//@@ 00401140 FUN_00401140 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00401140(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0daf; local_10 = ExceptionList; ExceptionList = &local_10; g_anmCacheMap = operator_new(0x54); *(void **)g_anmCacheMap = g_anmCacheMap; *(void **)((int)g_anmCacheMap + 4) = g_anmCacheMap; *(void **)((int)g_anmCacheMap + 8) = g_anmCacheMap; *(undefined2 *)((int)g_anmCacheMap + 0xc) = 0x101; local_8 = 0; g_textureCacheMap = (void *)0x0; _DAT_00c78eec = 0; g_textureCacheMap = operator_new(0x1c); *(void **)g_textureCacheMap = g_textureCacheMap; *(void **)((int)g_textureCacheMap + 4) = g_textureCacheMap; *(void **)((int)g_textureCacheMap + 8) = g_textureCacheMap; *(undefined2 *)((int)g_textureCacheMap + 0xc) = 0x101; _atexit(FUN_00b15200); ExceptionList = local_10; return; } //@@ 004011e0 FUN_004011e0 void FUN_004011e0(void) { undefined4 in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af16ef; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; FUN_0041f8d0(in_ECX); _atexit((_func_4879 *)&LAB_00b15300); ExceptionList = local_10; return; } //@@ 00401390 completion_mark_names_init /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? static initializer: fills a global string array "Mom's Heart", "Isaac", "Satan", "Boss Rush", "Cathedral", "Sheol", "Chest", "Dark Room", "Mega Satan", "Greed", "Delirium", "Mother", "Beast" (eh_vector_constructor_iterator + _atexit) */ void completion_mark_names_init(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af84cf; local_10 = ExceptionList; ExceptionList = &local_10; _DAT_00c34f10 = 0x7261; _DAT_00c34f08 = 0x65482073276d6f4d; DAT_00c34f12 = 0x74; _DAT_00c34f20 = 0x6172646568746143; DAT_00c34f28 = 0x6c; DAT_00c34f38 = 'S'; DAT_00c34f38_1._0_1_ = 'h'; DAT_00c34f38_1._1_1_ = 'e'; DAT_00c34f38_1._2_1_ = 'o'; DAT_00c34f3c = 0x6c; _DAT_00c34f50 = 0x7375522073736f42; DAT_00c34f58 = 0x68; DAT_00c34f68 = 'C'; DAT_00c34f68_1._0_1_ = 'h'; DAT_00c34f68_1._1_1_ = 'e'; DAT_00c34f68_1._2_1_ = 's'; DAT_00c34f6c = 0x74; _DAT_00c34f80 = 0x6f6f52206b726144; DAT_00c34f88 = 0x6d; _DAT_00c34f98 = 0x746153206167654d; _DAT_00c34fa0 = 0x6e61; DAT_00c34fb0 = 'G'; DAT_00c34fb0_1._0_1_ = 'r'; DAT_00c34fb0_1._1_1_ = 'e'; DAT_00c34fb0_1._2_1_ = 'e'; DAT_00c34fb4 = 100; local_8 = 0xb; std::string::assign(&DAT_00c35028,(byte *)"Delirium",8); local_8._0_1_ = 0xc; _DAT_00c35050 = 0; _DAT_00c35054 = 0xf; _DAT_00c35040 = 0; std::string::assign(&DAT_00c35040,(byte *)"Mother",6); local_8._0_1_ = 0xd; _DAT_00c35068 = 0; _DAT_00c3506c = 0xf; _DAT_00c35058 = 0; std::string::assign(&DAT_00c35058,(byte *)"Beast",5); local_8._0_1_ = 0xe; _DAT_00c35080 = 0; _DAT_00c35084 = 0xf; _DAT_00c35070 = 0; std::string::assign(&DAT_00c35070,&s_empty,0); local_8._0_1_ = 0xf; _DAT_00c35098 = 0; _DAT_00c3509c = 0xf; _DAT_00c35088 = 0; std::string::assign(&DAT_00c35088,&s_empty,0); local_8 = CONCAT31(local_8._1_3_,0x10); _eh_vector_constructor_iterator_(&DAT_00c350a0,0x18,1,FUN_0040c380,std::string::_Tidy_deallocate); _atexit((_func_4879 *)&LAB_00b155f0); ExceptionList = local_10; return; } //@@ 00402090 FUN_00402090 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00402090(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b10b2f; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; DAT_00c37988 = operator_new(0x1c); *(void **)DAT_00c37988 = DAT_00c37988; *(void **)((int)DAT_00c37988 + 4) = DAT_00c37988; *(void **)((int)DAT_00c37988 + 8) = DAT_00c37988; *(undefined2 *)((int)DAT_00c37988 + 0xc) = 0x101; DAT_00c37994 = 0; DAT_00c37990 = KAGE::Mutex::vftable; _DAT_00c37998 = 0; DAT_00c3799c = 0; DAT_00c379a0 = 0; DAT_00c379a4 = 1; DAT_00c379a8 = 1; _atexit((_func_4879 *)&LAB_00b16b70); ExceptionList = local_10; return; } //@@ 00402160 FUN_00402160 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00402160(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b10d23; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; DAT_00c379bc = operator_new(0x18); *(void **)DAT_00c379bc = DAT_00c379bc; *(void **)((int)DAT_00c379bc + 4) = DAT_00c379bc; *(void **)((int)DAT_00c379bc + 8) = DAT_00c379bc; *(undefined2 *)((int)DAT_00c379bc + 0xc) = 0x101; local_8._0_1_ = 1; g_glContextObjects = (void *)0x0; _DAT_00c379c8 = 0; g_glContextObjects = operator_new(0x18); *(void **)g_glContextObjects = g_glContextObjects; *(void **)((int)g_glContextObjects + 4) = g_glContextObjects; *(void **)((int)g_glContextObjects + 8) = g_glContextObjects; *(undefined2 *)((int)g_glContextObjects + 0xc) = 0x101; local_8 = CONCAT31(local_8._1_3_,2); _DAT_00c379cc = (undefined4 *)0x0; DAT_00c379d0 = 0; DAT_00c379d4 = 0; DAT_00c379d8 = 0; g_shaderStackSize = 0; _DAT_00c379cc = operator_new(8); _DAT_00c379cc[1] = 0; *_DAT_00c379cc = &DAT_00c379cc; _atexit((_func_4879 *)&LAB_00b16b90); ExceptionList = local_10; return; } //@@ 00402280 FUN_00402280 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00402280(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11761; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 2; _DAT_00c57b44 = operator_new(0x10); *(void **)_DAT_00c57b44 = _DAT_00c57b44; *(void **)((int)_DAT_00c57b44 + 4) = _DAT_00c57b44; local_8._0_1_ = 3; _DAT_00c57b4c = (void *)0x0; _DAT_00c57b50 = 0; _DAT_00c57b4c = operator_new(0x10); *(void **)_DAT_00c57b4c = _DAT_00c57b4c; *(void **)((int)_DAT_00c57b4c + 4) = _DAT_00c57b4c; local_8._0_1_ = 4; _DAT_00c57b54 = (void *)0x0; _DAT_00c57b58 = 0; _DAT_00c57b54 = operator_new(0x10); *(void **)_DAT_00c57b54 = _DAT_00c57b54; *(void **)((int)_DAT_00c57b54 + 4) = _DAT_00c57b54; local_8 = CONCAT31(local_8._1_3_,5); _DAT_00c57b5c = (void *)0x0; _DAT_00c57b60 = 0; _DAT_00c57b5c = operator_new(0x10); *(void **)_DAT_00c57b5c = _DAT_00c57b5c; *(void **)((int)_DAT_00c57b5c + 4) = _DAT_00c57b5c; PTR_vftable_00c57b18 = (undefined *)KAGE::Input::Manager::vftable; DAT_00c57b68 = 0; DAT_00c57b64 = KAGE::Thread::vftable; _DAT_00c57b6c = 0; DAT_00c57b3c = 0x3e4ccccd; DAT_00c57b40 = 0x3e99999a; _atexit(FUN_00b16c10); ExceptionList = local_10; return; } //@@ 00402390 init_controller_button_glyph_tables /* DB: ? 17KB of stack-built int tables copied into DAT_00c5a908 (58 ints) and DAT_00c5a9f0 (32 ints): (button index, 0xabab..0xabb6 PUA glyph codepoint) pairs per controller layout; no callees, no other references to the tables */ void init_controller_button_glyph_tables(void) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 local_170 [58]; undefined4 local_88 [33]; local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c57b80; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[0] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[1] = 2; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[2] = 1; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[3] = 3; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[4] = 2; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[5] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c57c68; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c57cf8; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c57de0; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c57e70; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c57f58; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c57fe8; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c580d0; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58160; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c58248; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c582d8; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[0] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[1] = 2; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[2] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[3] = 3; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[4] = 2; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[5] = 0; puVar2 = local_88; puVar3 = &DAT_00c583c0; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[6] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[7] = 1; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[8] = 4; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[9] = 0xc; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58450; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c58538; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c585c8; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c586b0; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58740; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c58828; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c588b8; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c589a0; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58a30; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[0] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[1] = 2; puVar2 = local_88; puVar3 = &DAT_00c58b18; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[2] = 1; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[3] = 3; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[4] = 2; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[5] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[6] = 3; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[7] = 1; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[8] = 4; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58ba8; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c58c90; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58d20; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c58e08; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c58e98; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c58f80; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c59010; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[0] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c590f8; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[1] = 2; local_170[2] = 1; local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c59188; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c59270; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 3; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 1; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xc; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c59300; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 7; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c593e8; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 5; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 4; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 6; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 7; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0xe; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0xd; local_170[0xc] = 4; local_170[0xd] = 0xf; local_170[0xe] = 6; local_170[0xf] = 0xc; local_170[0x10] = 8; local_170[0x11] = 10; local_170[0x12] = 0xb; local_170[0x13] = 0xb; local_170[0x14] = 0xe; local_170[0x15] = 0; local_170[0x16] = 0xf; local_170[0x17] = 3; local_170[0x18] = 10; local_170[0x19] = 1; local_170[0x1a] = 0xd; local_170[0x1b] = 2; local_170[0x1c] = 9; local_170[0x1d] = 8; local_170[0x1e] = 0xc; local_170[0x1f] = 9; local_170[0x20] = 0x11; local_170[0x21] = 0xe; local_170[0x22] = 0x12; local_170[0x23] = 0xd; local_170[0x24] = 0xabab; local_170[0x25] = 0xabb1; local_170[0x26] = 0xabac; local_170[0x27] = 0xabb2; local_170[0x28] = 0xabad; local_170[0x29] = 0xabb0; local_170[0x2a] = 0xabae; local_170[0x2b] = 0xabaf; local_170[0x2c] = 0xabaf; local_170[0x2d] = 0xabad; local_170[0x2e] = 0xabb0; local_170[0x2f] = 0xabae; local_170[0x30] = 0xabb1; local_170[0x31] = 0xabac; local_170[0x32] = 0xabb2; local_170[0x33] = 0xabab; puVar2 = local_170; puVar3 = &DAT_00c59478; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabb1; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c59560; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 0xabb2; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0xabb1; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 0xabb2; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 7; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 2; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 1; local_170[0xc] = 4; local_170[0xd] = 3; local_170[0xe] = 6; local_170[0xf] = 0; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 0xb; local_170[0x13] = 5; local_170[0x14] = 0xe; local_170[0x15] = 8; local_170[0x16] = 0xf; local_170[0x17] = 0xb; local_170[0x18] = 10; local_170[0x19] = 9; local_170[0x1a] = 0xd; local_170[0x1b] = 10; local_170[0x1c] = 9; local_170[0x1d] = 6; local_170[0x1e] = 0xc; local_170[0x1f] = 7; local_170[0x20] = 0x11; local_170[0x21] = 2; local_170[0x22] = 0x12; local_170[0x23] = 1; local_170[0x24] = 0xabab; local_170[0x25] = 0xabb1; local_170[0x26] = 0xabac; local_170[0x27] = 0xabb2; local_170[0x28] = 0xabad; local_170[0x29] = 0xabb2; local_170[0x2a] = 0xabae; local_170[0x2b] = 0xabb1; local_170[0x2c] = 0xabaf; local_170[0x2d] = 0xabb1; local_170[0x2e] = 0xabb0; local_170[0x2f] = 0xabb2; local_170[0x30] = 0xabb1; local_170[0x31] = 0xabb2; local_170[0x32] = 0xabb2; local_170[0x33] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c595f0; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabb3; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c596d8; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 0xabb4; local_170[4] = 2; local_170[5] = 0xabb5; local_170[6] = 3; local_170[7] = 0xabb6; local_170[8] = 4; local_170[9] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 6; local_170[0x14] = 10; local_170[0x15] = 10; local_170[0x16] = 0xb; local_170[0x17] = 5; local_170[0x18] = 0xc; local_170[0x19] = 7; local_170[0x1a] = 0xd; local_170[0x1b] = 0xb; local_170[0x1c] = 0xe; local_170[0x1d] = 8; local_170[0x1e] = 0xf; local_170[0x1f] = 9; local_170[0x20] = 0x10; local_170[0x21] = 0xd; local_170[0x22] = 0xabab; local_170[0x23] = 0xabb1; local_170[0x24] = 0xabac; local_170[0x25] = 0xabb2; local_170[0x26] = 0xabad; local_170[0x27] = 0xabaf; local_170[0x28] = 0xabae; local_170[0x29] = 0xabb0; local_170[0x2a] = 0xabaf; local_170[0x2b] = 0xabad; local_170[0x2c] = 0xabb0; local_170[0x2d] = 0xabae; local_170[0x2e] = 0xabb1; local_170[0x2f] = 0xabab; local_170[0x30] = 0xabb2; local_170[0x31] = 0xabac; puVar2 = local_170; puVar3 = &DAT_00c59768; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c59850; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[0] = 0; local_170[1] = 0xabb7; local_170[2] = 1; local_170[3] = 0xabb8; local_170[4] = 2; local_170[5] = 0xabb9; local_170[6] = 3; local_170[7] = 0xabba; local_170[8] = 4; local_170[9] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 0xabae; local_170[0x14] = 9; local_170[0x15] = 6; local_170[0x16] = 10; local_170[0x17] = 10; local_170[0x18] = 0xb; local_170[0x19] = 5; local_170[0x1a] = 0xc; local_170[0x1b] = 0xabac; local_170[0x1c] = 0xc; local_170[0x1d] = 7; local_170[0x1e] = 0xd; local_170[0x1f] = 0xb; local_170[0x20] = 0xe; local_170[0x21] = 8; local_170[0x22] = 0xf; local_170[0x23] = 9; local_170[0x24] = 0x10; local_170[0x25] = 0xd; local_170[0x26] = 0xabab; local_170[0x27] = 0xabb5; local_170[0x28] = 0xabac; local_170[0x29] = 0xabb6; local_170[0x2a] = 0xabad; local_170[0x2b] = 0xabb3; local_170[0x2c] = 0xabae; local_170[0x2d] = 0xabb4; local_170[0x2e] = 0xabaf; local_170[0x2f] = 0xabb1; local_170[0x30] = 0xabb0; local_170[0x31] = 0xabb2; local_170[0x32] = 0xabb1; local_170[0x33] = 0xabaf; local_170[0x34] = 0xabb2; local_170[0x35] = 0xabb0; puVar2 = local_170; puVar3 = &DAT_00c598e0; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[0] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[1] = 0xabb3; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[2] = 1; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[3] = 0xabb4; puVar2 = local_88; puVar3 = &DAT_00c599c8; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[4] = 2; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[5] = 0xabb5; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[6] = 3; local_170[7] = 0xabb6; local_170[8] = 4; local_170[9] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 0xabba; local_170[0x14] = 9; local_170[0x15] = 6; local_170[0x16] = 10; local_170[0x17] = 10; local_170[0x18] = 0xb; local_170[0x19] = 5; local_170[0x1a] = 0xc; local_170[0x1b] = 0xabb8; local_170[0x1c] = 0xc; local_170[0x1d] = 7; local_170[0x1e] = 0xd; local_170[0x1f] = 0xb; local_170[0x20] = 0xe; local_170[0x21] = 8; local_170[0x22] = 0xf; local_170[0x23] = 9; local_170[0x24] = 0x10; local_170[0x25] = 0xd; local_170[0x26] = 0xabab; local_170[0x27] = 0xabb1; local_170[0x28] = 0xabac; local_170[0x29] = 0xabb2; local_170[0x2a] = 0xabad; local_170[0x2b] = 0xabaf; local_170[0x2c] = 0xabae; local_170[0x2d] = 0xabb0; local_170[0x2e] = 0xabaf; local_170[0x2f] = 0xabad; local_170[0x30] = 0xabb0; local_170[0x31] = 0xabae; local_170[0x32] = 0xabb1; local_170[0x33] = 0xabab; local_170[0x34] = 0xabb2; local_170[0x35] = 0xabac; puVar2 = local_170; puVar3 = &DAT_00c59a58; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabb7; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c59b40; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 0xabb8; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0xabb9; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 0xabba; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 0xabae; local_170[0x14] = 9; local_170[0x15] = 6; local_170[0x16] = 10; local_170[0x17] = 10; local_170[0x18] = 0xb; local_170[0x19] = 5; local_170[0x1a] = 0xc; local_170[0x1b] = 0xabac; local_170[0x1c] = 0xc; local_170[0x1d] = 7; local_170[0x1e] = 0xd; local_170[0x1f] = 0xb; local_170[0x20] = 0xe; local_170[0x21] = 8; local_170[0x22] = 0xf; local_170[0x23] = 9; local_170[0x24] = 0x10; local_170[0x25] = 0xd; local_170[0x26] = 0xabab; local_170[0x27] = 0xabb5; local_170[0x28] = 0xabac; local_170[0x29] = 0xabb6; local_170[0x2a] = 0xabad; local_170[0x2b] = 0xabb3; local_170[0x2c] = 0xabae; local_170[0x2d] = 0xabb4; local_170[0x2e] = 0xabaf; local_170[0x2f] = 0xabb1; local_170[0x30] = 0xabb0; local_170[0x31] = 0xabb2; local_170[0x32] = 0xabb1; local_170[0x33] = 0xabaf; local_170[0x34] = 0xabb2; local_170[0x35] = 0xabb0; puVar2 = local_170; puVar3 = &DAT_00c59bd0; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabb3; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c59cb8; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 0xabb4; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0xabb5; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 0xabb6; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 0xabba; local_170[0x14] = 9; local_170[0x15] = 6; local_170[0x16] = 10; local_170[0x17] = 10; local_170[0x18] = 0xb; local_170[0x19] = 5; local_170[0x1a] = 0xc; local_170[0x1b] = 0xabb8; local_170[0x1c] = 0xc; local_170[0x1d] = 7; local_170[0x1e] = 0xd; local_170[0x1f] = 0xb; local_170[0x20] = 0xe; local_170[0x21] = 8; local_170[0x22] = 0xf; local_170[0x23] = 9; local_170[0x24] = 0x10; local_170[0x25] = 0xd; local_170[0x26] = 0xabab; local_170[0x27] = 0xabb1; local_170[0x28] = 0xabac; local_170[0x29] = 0xabb2; local_170[0x2a] = 0xabad; local_170[0x2b] = 0xabaf; local_170[0x2c] = 0xabae; local_170[0x2d] = 0xabb0; local_170[0x2e] = 0xabaf; local_170[0x2f] = 0xabad; local_170[0x30] = 0xabb0; local_170[0x31] = 0xabae; local_170[0x32] = 0xabb1; local_170[0x33] = 0xabab; local_170[0x34] = 0xabb2; local_170[0x35] = 0xabac; puVar2 = local_170; puVar3 = &DAT_00c59d48; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabab; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c59e30; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 0xabac; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0xabad; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 0xabae; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 7; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 1; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 4; local_170[0xd] = 0; local_170[0xe] = 6; local_170[0xf] = 3; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 0xb; local_170[0x13] = 5; local_170[0x14] = 0xe; local_170[0x15] = 8; local_170[0x16] = 0xf; local_170[0x17] = 9; local_170[0x18] = 9; local_170[0x19] = 6; local_170[0x1a] = 0xc; local_170[0x1b] = 7; local_170[0x1c] = 10; local_170[0x1d] = 10; local_170[0x1e] = 0xd; local_170[0x1f] = 10; local_170[0x20] = 0x10; local_170[0x21] = 10; local_170[0x22] = 0x11; local_170[0x23] = 1; local_170[0x24] = 0x12; local_170[0x25] = 2; local_170[0x26] = 0xabab; local_170[0x27] = 0xabb5; local_170[0x28] = 0xabac; local_170[0x29] = 0xabb5; local_170[0x2a] = 0xabad; local_170[0x2b] = 0xabb5; local_170[0x2c] = 0xabae; local_170[0x2d] = 0xabb5; local_170[0x2e] = 0xabaf; local_170[0x2f] = 0xabb5; local_170[0x30] = 0xabb0; local_170[0x31] = 0xabb5; local_170[0x32] = 0xabb1; local_170[0x33] = 0xabb5; local_170[0x34] = 0xabb2; local_170[0x35] = 0xabb5; puVar2 = local_170; puVar3 = &DAT_00c59ec0; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabb1; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c59fa8; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 0xabb2; local_170[4] = 2; local_170[5] = 0xabaf; local_170[6] = 3; local_170[7] = 0xabb0; local_170[8] = 7; local_170[9] = 0; local_170[10] = 5; local_170[0xb] = 1; local_170[0xc] = 4; local_170[0xd] = 3; local_170[0xe] = 6; local_170[0xf] = 4; local_170[0x10] = 8; local_170[0x11] = 6; local_170[0x12] = 0xb; local_170[0x13] = 7; local_170[0x14] = 0xe; local_170[0x15] = 10; local_170[0x16] = 0xf; local_170[0x17] = 0xb; local_170[0x18] = 0x11; local_170[0x19] = 0; local_170[0x1a] = 0x12; local_170[0x1b] = 1; puVar2 = local_170; puVar3 = &DAT_00c5a038; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[0] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[1] = 0xabb5; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[2] = 1; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[3] = 0xabb6; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[4] = 2; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[5] = 0xabb9; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c5a120; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[6] = 3; local_170[7] = 0xabba; local_170[8] = 7; local_170[9] = 0; local_170[10] = 5; local_170[0xb] = 1; local_170[0xc] = 4; local_170[0xd] = 3; local_170[0xe] = 6; local_170[0xf] = 4; local_170[0x10] = 8; local_170[0x11] = 6; local_170[0x12] = 0xb; local_170[0x13] = 7; local_170[0x14] = 0xe; local_170[0x15] = 10; local_170[0x16] = 0xf; local_170[0x17] = 0xb; local_170[0x18] = 0x11; local_170[0x19] = 0; local_170[0x1a] = 0x12; local_170[0x1b] = 1; puVar2 = local_170; puVar3 = &DAT_00c5a1b0; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabab; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c5a298; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 0xabac; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0xabad; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 0xabae; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 7; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 1; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 0; local_170[0xc] = 4; local_170[0xd] = 4; local_170[0xe] = 6; local_170[0xf] = 3; local_170[0x10] = 8; local_170[0x11] = 6; local_170[0x12] = 0xb; local_170[0x13] = 7; local_170[0x14] = 0xe; local_170[0x15] = 10; local_170[0x16] = 0xf; local_170[0x17] = 0xb; local_170[0x18] = 10; local_170[0x19] = 0xd; local_170[0x1a] = 0xd; local_170[0x1b] = 0xe; local_170[0x1c] = 9; local_170[0x1d] = 8; local_170[0x1e] = 0xc; local_170[0x1f] = 9; local_170[0x20] = 0x11; local_170[0x21] = 1; local_170[0x22] = 0x12; local_170[0x23] = 0; local_170[0x24] = 0xabab; local_170[0x25] = 0xabb5; local_170[0x26] = 0xabac; local_170[0x27] = 0xabb6; local_170[0x28] = 0xabad; local_170[0x29] = 0xabb4; local_170[0x2a] = 0xabae; local_170[0x2b] = 0xabb3; local_170[0x2c] = 0xabaf; local_170[0x2d] = 0xabb1; local_170[0x2e] = 0xabb0; local_170[0x2f] = 0xabb2; local_170[0x30] = 0xabb1; local_170[0x31] = 0xabb0; local_170[0x32] = 0xabb2; local_170[0x33] = 0xabaf; puVar2 = local_170; puVar3 = &DAT_00c5a328; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabab; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c5a410; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 0xabac; local_170[4] = 2; local_170[5] = 0xabad; local_170[6] = 3; local_170[7] = 0xabae; local_170[8] = 7; local_170[9] = 1; local_170[10] = 5; local_170[0xb] = 0; local_170[0xc] = 4; local_170[0xd] = 4; local_170[0xe] = 6; local_170[0xf] = 3; local_170[0x10] = 8; local_170[0x11] = 6; local_170[0x12] = 0xb; local_170[0x13] = 7; local_170[0x14] = 0xe; local_170[0x15] = 10; local_170[0x16] = 0xf; local_170[0x17] = 0xb; local_170[0x18] = 10; local_170[0x19] = 0xd; local_170[0x1a] = 0xd; local_170[0x1b] = 0xe; local_170[0x1c] = 9; local_170[0x1d] = 8; local_170[0x1e] = 0xc; local_170[0x1f] = 9; local_170[0x20] = 0x11; local_170[0x21] = 1; local_170[0x22] = 0x12; local_170[0x23] = 0; local_170[0x24] = 0xabab; local_170[0x25] = 0xabb5; local_170[0x26] = 0xabac; local_170[0x27] = 0xabb6; local_170[0x28] = 0xabad; local_170[0x29] = 0xabb4; local_170[0x2a] = 0xabae; local_170[0x2b] = 0xabb3; local_170[0x2c] = 0xabaf; local_170[0x2d] = 0xabb1; local_170[0x2e] = 0xabb0; local_170[0x2f] = 0xabb2; local_170[0x30] = 0xabb1; local_170[0x31] = 0xabb0; local_170[0x32] = 0xabb2; local_170[0x33] = 0xabaf; local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_170; puVar3 = &DAT_00c5a4a0; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 2; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c5a588; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[3] = 3; local_170[4] = 2; local_170[5] = 0; local_170[6] = 3; local_170[7] = 1; local_170[8] = 4; local_170[9] = 0xc; local_170[10] = 5; local_170[0xb] = 0xb; local_170[0xc] = 6; local_170[0xd] = 0xd; local_170[0xe] = 7; local_170[0xf] = 10; local_170[0x10] = 8; local_170[0x11] = 8; local_170[0x12] = 9; local_170[0x13] = 0xabb4; local_170[0x14] = 10; local_170[0x15] = 6; local_170[0x16] = 0xb; local_170[0x17] = 9; local_170[0x18] = 0xc; local_170[0x19] = 0xabb6; local_170[0x1a] = 0xd; local_170[0x1b] = 7; local_170[0x1c] = 0xe; local_170[0x1d] = 5; local_170[0x1e] = 0xf; local_170[0x1f] = 4; local_170[0x20] = 0xabab; local_170[0x21] = 0xabab; local_170[0x22] = 0xabac; local_170[0x23] = 0xabac; local_170[0x24] = 0xabad; local_170[0x25] = 0xabae; local_170[0x26] = 0xabae; local_170[0x27] = 0xabad; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabaf; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabb0; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabb1; puVar2 = local_170; puVar3 = &DAT_00c5a618; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[0] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[1] = 0xabb3; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[2] = 1; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[3] = 0xabb4; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[4] = 2; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; puVar2 = local_88; puVar3 = &DAT_00c5a700; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[5] = 0xabb5; local_170[6] = 3; local_170[7] = 0xabb6; local_170[8] = 4; local_170[9] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 6; local_170[0x14] = 10; local_170[0x15] = 10; local_170[0x16] = 0xb; local_170[0x17] = 5; local_170[0x18] = 0xc; local_170[0x19] = 7; local_170[0x1a] = 0xd; local_170[0x1b] = 0xb; local_170[0x1c] = 0xf; local_170[0x1d] = 9; local_170[0x1e] = 0x10; local_170[0x1f] = 8; local_170[0x20] = 0xabab; local_170[0x21] = 0xabb1; local_170[0x22] = 0xabac; local_170[0x23] = 0xabb2; local_170[0x24] = 0xabad; local_170[0x25] = 0xabaf; local_170[0x26] = 0xabae; local_170[0x27] = 0xabb0; local_170[0x28] = 0xabaf; local_170[0x29] = 0xabad; local_170[0x2a] = 0xabb0; local_170[0x2b] = 0xabae; local_170[0x2c] = 0xabb1; local_170[0x2d] = 0xabab; local_170[0x2e] = 0xabb2; local_170[0x2f] = 0xabac; puVar2 = local_170; puVar3 = &DAT_00c5a790; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_170[0] = 0; local_170[1] = 0xabab; local_170[2] = 1; puVar2 = local_88; puVar3 = &DAT_00c5a878; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } local_88[0] = 0; local_88[1] = 0; local_88[2] = 0; local_88[3] = 0; local_170[3] = 0xabac; local_88[4] = 0; local_88[5] = 0; local_88[6] = 0; local_88[7] = 0; local_170[4] = 2; local_88[8] = 0; local_88[9] = 0; local_88[10] = 0; local_88[0xb] = 0; local_170[5] = 0xabad; local_88[0xc] = 0; local_88[0xd] = 0; local_88[0xe] = 0; local_88[0xf] = 0; local_170[6] = 3; local_88[0x10] = 0; local_88[0x11] = 0; local_88[0x12] = 0; local_88[0x13] = 0; local_170[7] = 0xabae; local_88[0x14] = 0; local_88[0x15] = 0; local_88[0x16] = 0; local_88[0x17] = 0; local_170[8] = 4; local_88[0x18] = 0; local_88[0x19] = 0; local_88[0x1a] = 0; local_88[0x1b] = 0; local_170[9] = 0; local_88[0x1c] = 0; local_88[0x1d] = 0; local_88[0x1e] = 0; local_88[0x1f] = 0; local_170[10] = 5; local_170[0xb] = 2; local_170[0xc] = 6; local_170[0xd] = 3; local_170[0xe] = 7; local_170[0xf] = 1; local_170[0x10] = 8; local_170[0x11] = 4; local_170[0x12] = 9; local_170[0x13] = 6; local_170[0x14] = 10; local_170[0x15] = 10; local_170[0x16] = 0xb; local_170[0x17] = 5; local_170[0x18] = 0xc; local_170[0x19] = 7; local_170[0x1a] = 0xd; local_170[0x1b] = 0xb; local_170[0x1c] = 0xe; local_170[0x1d] = 8; local_170[0x1e] = 0xf; local_170[0x1f] = 9; local_170[0x20] = 0x10; local_170[0x21] = 0xd; local_170[0x22] = 0xabab; local_170[0x23] = 0xabb5; local_170[0x24] = 0xabac; local_170[0x25] = 0xabb6; local_170[0x26] = 0xabad; local_170[0x27] = 0xabb3; local_170[0x28] = 0xabae; local_170[0x29] = 0xabb4; local_170[0x2a] = 0xabaf; local_170[0x2b] = 0xabb1; local_170[0x2c] = 0xabb0; local_170[0x2d] = 0xabb2; local_170[0x2e] = 0xabb1; local_170[0x2f] = 0xabaf; local_170[0x30] = 0xabb2; local_170[0x31] = 0xabb0; puVar2 = local_170; puVar3 = &DAT_00c5a908; for (iVar1 = 0x3a; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } puVar2 = local_88; puVar3 = &DAT_00c5a9f0; for (iVar1 = 0x20; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } return; } //@@ 00406740 FUN_00406740 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406740(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11949; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; g_memoryManager_heaps = operator_new(0x18); *(void **)g_memoryManager_heaps = g_memoryManager_heaps; *(void **)((int)g_memoryManager_heaps + 4) = g_memoryManager_heaps; *(void **)((int)g_memoryManager_heaps + 8) = g_memoryManager_heaps; *(undefined2 *)((int)g_memoryManager_heaps + 0xc) = 0x101; local_8 = CONCAT31(local_8._1_3_,1); g_memoryManager_oomHandlers = (void *)0x0; _DAT_00c37978 = 0; g_memoryManager_oomHandlers = operator_new(0x10); *(void **)g_memoryManager_oomHandlers = g_memoryManager_oomHandlers; *(void **)((int)g_memoryManager_oomHandlers + 4) = g_memoryManager_oomHandlers; PTR_vftable_00c37964 = (undefined *)KAGE::Memory::Manager::vftable; _atexit((_func_4879 *)&LAB_00b16c80); ExceptionList = local_10; return; } //@@ 00406850 FUN_00406850 void FUN_00406850(void) { char *_Dest; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11aaf; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; _Dest = operator_new_tracked(1); strncpy(_Dest,(char *)&s_empty,1); DAT_00c5aa98 = _Dest; _atexit((_func_4879 *)&LAB_00b16df0); ExceptionList = local_10; return; } //@@ 004069e0 FUN_004069e0 void FUN_004069e0(void) { uint uVar1; double dVar2; double dVar3; double dVar4; uVar1 = 0; do { dVar2 = ((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) / 6144.0; dVar2 = ((dVar2 + dVar2) - 1.0) * 3.0; dVar4 = dVar2 * 3.141592653589793; if (dVar2 == 0.0) { dVar2 = 1.0; } else { if (3.0 < ABS(dVar2)) { _wassert(L"CLOWNRESAMPLER_FABS(x) <= kernel_radius", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\clownresampler.h" ,0x3f8); } dVar2 = dVar4 / 3.0; libm_sse2_sin_precise(); dVar3 = dVar4; libm_sse2_sin_precise(); dVar2 = (dVar2 * dVar3) / ((dVar4 / 3.0) * dVar4); } (&DAT_00c95a90)[uVar1] = (int)(dVar2 * 65536.0); uVar1 = uVar1 + 1; } while (uVar1 < 0x1800); return; } //@@ 00406af0 FUN_00406af0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406af0(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1223f; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; DAT_00c5aaa8 = operator_new(0x1c); *(void **)DAT_00c5aaa8 = DAT_00c5aaa8; *(void **)((int)DAT_00c5aaa8 + 4) = DAT_00c5aaa8; *(void **)((int)DAT_00c5aaa8 + 8) = DAT_00c5aaa8; *(undefined2 *)((int)DAT_00c5aaa8 + 0xc) = 0x101; DAT_00c5aab4 = 0; DAT_00c5aab0 = KAGE::Mutex::vftable; _DAT_00c5aab8 = 0; DAT_00c5aabc = 0; DAT_00c5aac0 = 0; DAT_00c5aac4 = 0; DAT_00c5aacc = 0; DAT_00c5aac8 = KAGE::Mutex::vftable; _DAT_00c5aad0 = 0; uRam00c5aad4 = 0; DAT_00c5aad8 = 0; DAT_00c5aadc = 0; DAT_00c5aae4 = 0; _DAT_00c5aae0 = KAGE::Thread::vftable; _DAT_00c5aae8 = 0; _DAT_00c5aaec = 0; _DAT_00c5aaf0 = 0; DAT_00c5aaf4 = 0; DAT_00c5aaf8 = 0; _DAT_00c5aafc = 0; DAT_00c5ab00 = 0; PTR_vftable_00c5aaa0 = (undefined *)KAGE::Sound::Manager::vftable; _atexit((_func_4879 *)&LAB_00b16e40); ExceptionList = local_10; return; } //@@ 00406c10 FUN_00406c10 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406c10(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12403; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; DAT_00c5ab18 = operator_new(0x18); *(void **)DAT_00c5ab18 = DAT_00c5ab18; *(void **)((int)DAT_00c5ab18 + 4) = DAT_00c5ab18; *(void **)((int)DAT_00c5ab18 + 8) = DAT_00c5ab18; *(undefined2 *)((int)DAT_00c5ab18 + 0xc) = 0x101; DAT_00c5ab24 = 0; DAT_00c5ab20 = KAGE::Mutex::vftable; _DAT_00c5ab28 = 0; local_8 = CONCAT31(local_8._1_3_,2); DAT_00c5ab2c = (void *)0x0; DAT_00c5ab30 = 0; DAT_00c5ab2c = operator_new(0xc); *(void **)DAT_00c5ab2c = DAT_00c5ab2c; *(void **)((int)DAT_00c5ab2c + 4) = DAT_00c5ab2c; DAT_00c5ab14 = DAT_00c5ab14 | 2; DAT_00c5ab38 = 0; DAT_00c5ab34 = KAGE::Mutex::vftable; _DAT_00c5ab3c = 0; DAT_00c5ab40 = 0; PTR_vftable_00c5ab10 = (undefined *)KAGE::System::LeaderboardManager::vftable; _atexit((_func_4879 *)&LAB_00b16e60); ExceptionList = local_10; return; } //@@ 00406d20 FUN_00406d20 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406d20(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12add; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 3; DAT_00c5ab90 = operator_new(0x10); *(void **)DAT_00c5ab90 = DAT_00c5ab90; *(void **)((int)DAT_00c5ab90 + 4) = DAT_00c5ab90; _DAT_00c5ab98 = 0; _DAT_00c5ab9c = 0; uRam00c5aba0 = 0; uRam00c5aba4 = 0; uRam00c5aba8 = 0; _DAT_00c5abac = 0; _DAT_00c5abb0 = 0; _DAT_00c5abb8 = 0; _atexit((_func_4879 *)&LAB_00b16eb0); ExceptionList = local_10; return; } //@@ 00406dc0 FUN_00406dc0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406dc0(void) { uint uVar1; undefined4 uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12e5f; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar2 = 0x10; local_8 = 0; DAT_00c5abc8 = operator_new(0x10); *(void **)DAT_00c5abc8 = DAT_00c5abc8; *(void **)((int)DAT_00c5abc8 + 4) = DAT_00c5abc8; DAT_00c5abd0 = 0; DAT_00c5abd4 = 0; PTR_vftable_00c5abc0 = (undefined *)KAGE::Network::Manager::vftable; DAT_00c5abd8 = 0; DAT_00c5abe0 = 0; _DAT_00c5abe4 = 0; _DAT_00c5abdc = CCallback::vftable; _DAT_00c5abe8 = &PTR_vftable_00c5abc0; _DAT_00c5abec = FUN_00a61250; SteamAPI_RegisterCallback(&DAT_00c5abdc,0xa8,uVar2,uVar1); _atexit((_func_4879 *)&LAB_00b16f30); ExceptionList = local_10; return; } //@@ 00406e80 FUN_00406e80 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406e80(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12fc2; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; DAT_00c5ac08 = operator_new(0x1c); *(void **)DAT_00c5ac08 = DAT_00c5ac08; *(void **)((int)DAT_00c5ac08 + 4) = DAT_00c5ac08; *(void **)((int)DAT_00c5ac08 + 8) = DAT_00c5ac08; *(undefined2 *)((int)DAT_00c5ac08 + 0xc) = 0x101; local_8._0_1_ = 1; DAT_00c5ac10 = (void *)0x0; _DAT_00c5ac14 = 0; DAT_00c5ac10 = operator_new(0x1c); *(void **)DAT_00c5ac10 = DAT_00c5ac10; *(void **)((int)DAT_00c5ac10 + 4) = DAT_00c5ac10; *(void **)((int)DAT_00c5ac10 + 8) = DAT_00c5ac10; *(undefined2 *)((int)DAT_00c5ac10 + 0xc) = 0x101; local_8 = CONCAT31(local_8._1_3_,2); _DAT_00c5ac18 = (void *)0x0; _DAT_00c5ac1c = 0; _DAT_00c5ac18 = operator_new(0x1c); *(void **)_DAT_00c5ac18 = _DAT_00c5ac18; *(void **)((int)_DAT_00c5ac18 + 4) = _DAT_00c5ac18; DAT_00c5ac24 = 0; DAT_00c5ac20 = KAGE::Mutex::vftable; _DAT_00c5ac28 = 0; _DAT_00c5ac30 = 0; _DAT_00c5ac38 = 0; DAT_00c5ac40 = 0; DAT_00c5ac44 = 0; _atexit((_func_4879 *)&LAB_00b16f40); ExceptionList = local_10; return; } //@@ 00406f90 FUN_00406f90 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00406f90(void) { uint uVar1; undefined4 uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1304f; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar2 = 0x10; local_8 = 0; DAT_00c5ac6c = operator_new(0x10); *(void **)DAT_00c5ac6c = DAT_00c5ac6c; *(void **)((int)DAT_00c5ac6c + 4) = DAT_00c5ac6c; _DAT_00c5ac4c = _DAT_00c5ac4c | 2; _DAT_00c5ac74 = 0; PTR_vftable_00c5ac48 = (undefined *)KAGE::System::Manager::vftable; DAT_00c5ac7c = 0; _DAT_00c5ac80 = 0; _DAT_00c5ac78 = CCallback::vftable; _DAT_00c5ac84 = &PTR_vftable_00c5ac48; _DAT_00c5ac88 = FUN_00a8c600; SteamAPI_RegisterCallback(&DAT_00c5ac78,0x130,uVar2,uVar1); _atexit((_func_4879 *)&LAB_00b16f80); ExceptionList = local_10; return; } //@@ 00407140 FUN_00407140 void FUN_00407140(void) { float in_XMM0_Da; floor((double)in_XMM0_Da); return; } //@@ 00407170 Color::Color /* DB: src/anm2 decompile labels (Color::Color()) prototype: db/protos.zhl */ void __thiscall Color::Color(Color *this) { this->_tint[0] = 1.0; this->_tint[1] = 1.0; this->_tint[2] = 1.0; this->_tint[3] = 1.0; this->_colorize[0] = 0.0; this->_colorize[1] = 0.0; this->_colorize[2] = 0.0; this->_colorize[3] = 0.0; this->_offset[0] = 0.0; this->_offset[1] = 0.0; this->_offset[2] = 0.0; return; } //@@ 004071c0 Color::operator_assign /* DB: copies 0x2c-byte (11 dword) Color struct prototype: db/protos.zhl, confirmed by RET 4 */ ColorMod * __thiscall Color::operator_assign(Color *this,ColorMod *other) { float fVar1; float fVar2; float fVar3; fVar1 = other->_tint[1]; fVar2 = other->_tint[2]; fVar3 = other->_tint[3]; this->_tint[0] = other->_tint[0]; this->_tint[1] = fVar1; this->_tint[2] = fVar2; this->_tint[3] = fVar3; fVar1 = other->_colorize[1]; fVar2 = other->_colorize[2]; fVar3 = other->_colorize[3]; this->_colorize[0] = other->_colorize[0]; this->_colorize[1] = fVar1; this->_colorize[2] = fVar2; this->_colorize[3] = fVar3; *(undefined8 *)this->_offset = *(undefined8 *)other->_offset; this->_offset[2] = other->_offset[2]; return (ColorMod *)this; } //@@ 004071f0 Color::operator_assign /* DB: src/anm2 decompile labels (Color::operator=(const&)) prototype: db/protos.zhl, confirmed by RET 4 */ ColorMod * __thiscall Color::operator_assign(Color *this,ColorMod *other) { float fVar1; float fVar2; float fVar3; if (this != (Color *)other) { fVar1 = other->_tint[1]; fVar2 = other->_tint[2]; fVar3 = other->_tint[3]; this->_tint[0] = other->_tint[0]; this->_tint[1] = fVar1; this->_tint[2] = fVar2; this->_tint[3] = fVar3; fVar1 = other->_colorize[1]; fVar2 = other->_colorize[2]; fVar3 = other->_colorize[3]; this->_colorize[0] = other->_colorize[0]; this->_colorize[1] = fVar1; this->_colorize[2] = fVar2; this->_colorize[3] = fVar3; *(undefined8 *)this->_offset = *(undefined8 *)other->_offset; this->_offset[2] = other->_offset[2]; } return (ColorMod *)this; } //@@ 00407220 FUN_00407220 void FUN_00407220(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = in_ECX[1]; uVar3 = in_ECX[2]; uVar4 = in_ECX[3]; param_1[4] = 0; *param_1 = uVar1; param_1[1] = uVar2; param_1[2] = uVar3; param_1[3] = uVar4; return; } //@@ 00407240 Color::R /* ZHL [lua] Lua binding Color:R */ float10 Color::R(void) { float *in_ECX; return (float10)*in_ECX; } //@@ 00407250 Color::G /* ZHL [lua] Lua binding Color:G */ float10 Color::G(void) { int in_ECX; return (float10)*(float *)(in_ECX + 4); } //@@ 00407260 Color::B /* ZHL [lua] Lua binding Color:B */ float10 Color::B(void) { int in_ECX; return (float10)*(float *)(in_ECX + 8); } //@@ 00407270 Color::A /* ZHL [lua] Lua binding Color:A */ float10 Color::A(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0xc); } //@@ 00407280 Font::SetLineHeightModifier /* DB: Lua Font table prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Font::SetLineHeightModifier(Font *this,float modifier) { *(float *)&this->_paddingRight = modifier; return; } //@@ 004072a0 FUN_004072a0 void FUN_004072a0(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x1c) = in_XMM1_Da; return; } //@@ 004072b0 Color::RO /* ZHL [lua] Lua binding Color:RO */ float10 Color::RO(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x20); } //@@ 004072c0 Color::GO /* ZHL [lua] Lua binding Color:GO */ float10 Color::GO(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x24); } //@@ 004072d0 Color::BO /* ZHL [lua] Lua binding Color:BO */ float10 Color::BO(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x28); } //@@ 004072e0 FUN_004072e0 void FUN_004072e0(float param_1,float param_2,float param_3,float param_4,float param_5, float param_6,float param_7,float param_8,undefined8 param_9,float param_10) { float *in_ECX; ColorMod *in_EDX; Color::__mul((Color *)¶m_1,in_EDX); *in_ECX = param_1; in_ECX[1] = param_2; in_ECX[2] = param_3; in_ECX[3] = param_4; in_ECX[4] = param_5; in_ECX[5] = param_6; in_ECX[6] = param_7; in_ECX[7] = param_8; *(undefined8 *)(in_ECX + 8) = param_9; in_ECX[10] = param_10; return; } //@@ 00407320 _get_name_string /* DB: ? ? copies std::string at *this+8 */ char * _get_name_string(char *param_1) { int *in_ECX; if (*in_ECX == 0) { param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; *param_1 = '\0'; return param_1; } std::string::string(param_1,(void *)(*in_ECX + 8)); return param_1; } //@@ 00407370 FUN_00407370 void FUN_00407370(void) { return; } //@@ 00407380 _string_holder_c_str /* DB: ? c_str of std::string* at +4 or empty fallback */ byte * _string_holder_c_str(void) { byte *pbVar1; int in_ECX; pbVar1 = *(byte **)(in_ECX + 4); if (pbVar1 == (byte *)0x0) { pbVar1 = &s_empty; } else if (0xf < *(uint *)(pbVar1 + 0x14)) { return *(byte **)pbVar1; } return pbVar1; } //@@ 004073a0 FUN_004073a0 bool FUN_004073a0(void) { int in_ECX; return *(int *)(in_ECX + 4) == 0; } //@@ 004073b0 AnimationState::IsLoopingAnimation /* DB: _animData(+4)->_loop(+0x34) per zhl AnimationData prototype: db/protos.zhl */ byte __thiscall AnimationState::IsLoopingAnimation(AnimationState *this) { if (this->_animData == (void *)0x0) { return 0; } return *(byte *)((int)this->_animData + 0x34); } //@@ 004073c0 GridEntity::GetType /* ZHL [lua] Lua binding GridEntity:GetType */ undefined4 GridEntity::GetType(void) { int in_ECX; return *(undefined4 *)(in_ECX + 4); } //@@ 004073d0 Sprite::SetColor /* DB: copies 0x2c-byte Color into ANM2+0xa8 (Lua Sprite.Color getter returns this+0xa8) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Sprite::SetColor(Sprite *this,ColorMod *color) { float fVar1; float fVar2; float fVar3; if (&this->_color != color) { fVar1 = color->_tint[1]; fVar2 = color->_tint[2]; fVar3 = color->_tint[3]; (this->_color)._tint[0] = color->_tint[0]; (this->_color)._tint[1] = fVar1; (this->_color)._tint[2] = fVar2; (this->_color)._tint[3] = fVar3; fVar1 = color->_colorize[1]; fVar2 = color->_colorize[2]; fVar3 = color->_colorize[3]; (this->_color)._colorize[0] = color->_colorize[0]; (this->_color)._colorize[1] = fVar1; (this->_color)._colorize[2] = fVar2; (this->_color)._colorize[3] = fVar3; *(undefined8 *)(this->_color)._offset = *(undefined8 *)color->_offset; (this->_color)._offset[2] = color->_offset[2]; } return; } //@@ 00407410 Sprite::Color /* ZHL [lua] Lua binding Sprite:Color */ ColorMod * __thiscall Sprite::Color(Sprite *this) { return &this->_color; } //@@ 00407420 Sprite::FlipX /* ZHL [lua] Lua binding Sprite:FlipX */ byte __thiscall Sprite::FlipX(Sprite *this) { return this->_flipX; } //@@ 00407430 Sprite::FlipY /* ZHL [lua] Lua binding Sprite:FlipY */ byte __thiscall Sprite::FlipY(Sprite *this) { return this->_flipY; } //@@ 00407440 `vector_constructor_iterator' /* Library Function - Single Match void __stdcall `vector constructor iterator'(void *,unsigned int,unsigned int,void * (__thiscall*)(void *)) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void _vector_constructor_iterator_ (void *param_1,uint param_2,uint param_3,_func_void_ptr_void_ptr *param_4) { void *unaff_EDI; if (param_3 != 0) { do { (*param_4)(unaff_EDI); param_3 = param_3 - 1; } while (param_3 != 0); } return; } //@@ 00407470 FUN_00407470 void FUN_00407470(void) { return; } //@@ 00407480 Level::GetCurrentRoom /* ZHL [lua] Lua binding Level:GetCurrentRoom */ void * __thiscall Level::GetCurrentRoom(Level *this) { return this->_room; } //@@ 00407490 Game::ScreenShakeOffset /* ZHL [lua] Lua binding Game:ScreenShakeOffset */ Vector * __thiscall Game::ScreenShakeOffset(Game *this) { return &this->_screenShakeOffset; } //@@ 004074a0 FUN_004074a0 int FUN_004074a0(void) { int in_ECX; return in_ECX + 0x67758; } //@@ 004074b0 Game::GetFrameCount /* ZHL [lua] Lua binding Game:GetFrameCount */ int __thiscall Game::GetFrameCount(Game *this) { return this->_frameCount; } //@@ 004074c0 ANM2::constructor /* ZHL [exact] __thiscall void ANM2::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall ANM2::constructor(ANM2 *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af094e; local_10 = ExceptionList; ExceptionList = &local_10; (this->_filename)._buf[0] = '\0'; (this->_filename)._buf[1] = '\0'; (this->_filename)._buf[2] = '\0'; (this->_filename)._buf[3] = '\0'; (this->_filename)._size = 0; (this->_filename)._capacity = 0xf; (this->_filename)._buf[0] = '\0'; (this->_animDefaultName)._buf[0] = '\0'; (this->_animDefaultName)._buf[1] = '\0'; (this->_animDefaultName)._buf[2] = '\0'; (this->_animDefaultName)._buf[3] = '\0'; (this->_animDefaultName)._size = 0; (this->_animDefaultName)._capacity = 0xf; (this->_animDefaultName)._buf[0] = '\0'; local_8 = 1; (this->_animState)._animation = this; (this->_animState)._layerFrames = (void *)0x0; (this->_animState)._nullLayerFrames = (void *)0x0; AnimationState::SetAnimationData(&this->_animState,(void *)0x0); local_8._0_1_ = 2; (this->_overlayAnimState)._animation = this; (this->_overlayAnimState)._layerFrames = (void *)0x0; (this->_overlayAnimState)._nullLayerFrames = (void *)0x0; AnimationState::SetAnimationData(&this->_overlayAnimState,(void *)0x0); local_8 = CONCAT31(local_8._1_3_,3); (this->_offset).y = 0.0; (this->_offset).x = 0.0; (this->_scale).y = 0.0; (this->_scale).x = 0.0; (this->_color)._tint[0] = 1.0; (this->_color)._tint[1] = 1.0; (this->_color)._tint[2] = 1.0; (this->_color)._tint[3] = 1.0; (this->_color)._colorize[0] = 0.0; (this->_color)._colorize[1] = 0.0; (this->_color)._colorize[2] = 0.0; (this->_color)._colorize[3] = 0.0; (this->_color)._offset[0] = 0.0; (this->_color)._offset[1] = 0.0; (this->_color)._offset[2] = 0.0; (this->_championColor)._tint[0] = 1.0; (this->_championColor)._tint[1] = 1.0; (this->_championColor)._tint[2] = 1.0; (this->_championColor)._tint[3] = 1.0; (this->_championColor)._colorize[0] = 0.0; (this->_championColor)._colorize[1] = 0.0; (this->_championColor)._colorize[2] = 0.0; (this->_championColor)._colorize[3] = 0.0; this->_layerState = (void *)0x0; (this->_championColor)._offset[0] = 0.0; (this->_championColor)._offset[1] = 0.0; (this->_championColor)._offset[2] = 0.0; Reset(this); ExceptionList = local_10; return; } //@@ 00407690 ANM2::ANM2 /* DB: src/anm2 decompile labels (ANM2::ANM2(copy)) prototype: db/protos.zhl, confirmed by RET 4 */ ANM2 * __thiscall ANM2::ANM2(ANM2 *this,ANM2 *other) { float fVar1; float fVar2; float fVar3; char isLastRef; std_string *text; void *textureRef; uint allocSize; LayerState *srcLayer; undefined4 *dstLayer; undefined1 tmpTexture [4]; uint *local_34; uint layerCount; ANM2 *self; uint *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte isLoaded; puStack_20 = tmpTexture + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af09d3; local_1c = ExceptionList; ExceptionList = &local_1c; self = this; std::string::string((char *)this,other); local_14 = 0; std::string::string((this->_animDefaultName)._buf,&other->_animDefaultName); local_14._0_1_ = 1; AnimationState::AnimationState(this,&other->_animState); local_14._0_1_ = 2; AnimationState::AnimationState(this,&other->_overlayAnimState); local_14._0_1_ = 3; this->_overlayRenderFirst = other->_overlayRenderFirst; this->_animData = other->_animData; this->_animCount = other->_animCount; this->_layerState = (void *)0x0; this->_layerCount = other->_layerCount; this->_nullLayerNames = other->_nullLayerNames; this->_numNullLayers = other->_numNullLayers; this->_eventNames = other->_eventNames; this->_numEvents = other->_numEvents; (this->_offset).y = 0.0; (this->_offset).x = 0.0; fVar1 = (other->_scale).y; (this->_scale).x = (other->_scale).x; (this->_scale).y = fVar1; this->_rotation = other->_rotation; fVar1 = (other->_color)._tint[1]; fVar2 = (other->_color)._tint[2]; fVar3 = (other->_color)._tint[3]; (this->_color)._tint[0] = (other->_color)._tint[0]; (this->_color)._tint[1] = fVar1; (this->_color)._tint[2] = fVar2; (this->_color)._tint[3] = fVar3; fVar1 = (other->_color)._colorize[1]; fVar2 = (other->_color)._colorize[2]; fVar3 = (other->_color)._colorize[3]; (this->_color)._colorize[0] = (other->_color)._colorize[0]; (this->_color)._colorize[1] = fVar1; (this->_color)._colorize[2] = fVar2; (this->_color)._colorize[3] = fVar3; *(undefined8 *)(this->_color)._offset = *(undefined8 *)(other->_color)._offset; (this->_color)._offset[2] = (other->_color)._offset[2]; fVar1 = (other->_championColor)._tint[1]; fVar2 = (other->_championColor)._tint[2]; fVar3 = (other->_championColor)._tint[3]; (this->_championColor)._tint[0] = (other->_championColor)._tint[0]; (this->_championColor)._tint[1] = fVar1; (this->_championColor)._tint[2] = fVar2; (this->_championColor)._tint[3] = fVar3; fVar1 = (other->_championColor)._colorize[1]; fVar2 = (other->_championColor)._colorize[2]; fVar3 = (other->_championColor)._colorize[3]; (this->_championColor)._colorize[0] = (other->_championColor)._colorize[0]; (this->_championColor)._colorize[1] = fVar1; (this->_championColor)._colorize[2] = fVar2; (this->_championColor)._colorize[3] = fVar3; fVar1 = (other->_championColor)._offset[1]; (this->_championColor)._offset[0] = (other->_championColor)._offset[0]; (this->_championColor)._offset[1] = fVar1; (this->_championColor)._offset[2] = (other->_championColor)._offset[2]; this->_flipX = other->_flipX; this->_flipY = other->_flipY; this->_playbackSpeed = other->_playbackSpeed; this->field_0x108 = other->field_0x108; isLoaded = other->_loaded; this->_loaded = isLoaded; this->_shadowLayerIndex = other->_shadowLayerIndex; this->_bitflags = 0; if (isLoaded != 0) { AnmCache::AddRef(this); } layerCount = other->_layerCount; local_28 = (uint *)0x0; allocSize = -(uint)((int)((ulonglong)layerCount * 0xa0 >> 0x20) != 0) | (uint)((ulonglong)layerCount * 0xa0); local_24 = layerCount; local_34 = operator_new_tracked(-(uint)(0xfffffffb < allocSize) | allocSize + 4); local_14._0_1_ = 4; if (local_34 == (uint *)0x0) { local_28 = (uint *)0x0; } else { *local_34 = local_24; local_28 = local_34 + 1; _eh_vector_constructor_iterator_ (local_28,0xa0,local_24,LayerState::LayerState,LayerState::~LayerState); } this->_layerState = local_28; local_24 = 0; if (other->_layerCount != 0) { local_28 = (uint *)0x0; do { local_14._0_1_ = 3; srcLayer = (LayerState *)((int)other->_layerState + (int)local_28); dstLayer = (undefined4 *)((int)this->_layerState + (int)local_28); *dstLayer = srcLayer->_layerData; text = &srcLayer->_spriteSheetPath; if ((std_string *)(dstLayer + 2) != text) { if (0xf < (srcLayer->_spriteSheetPath)._capacity) { text = *(std_string **)text->_buf; } std::string::assign((char *)(dstLayer + 2),(byte *)text,(srcLayer->_spriteSheetPath)._size); } textureRef = LayerState::GetTexture(srcLayer,tmpTexture); local_14._0_1_ = 5; KAGE::SmartPointer::operator_assign(dstLayer + 0x26,textureRef); local_14._0_1_ = 6; if (local_34 != (uint *)0x0) { isLastRef = (**(code **)(*local_34 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpTexture); } } *(byte *)(dstLayer + 0xc) = srcLayer->_spriteSheetLoaded; *(undefined1 *)((int)dstLayer + 0x31) = srcLayer->field_0x31; *(byte *)((int)dstLayer + 0x32) = srcLayer->_flipX; *(byte *)((int)dstLayer + 0x33) = srcLayer->_flipY; dstLayer[0xd] = (srcLayer->_size).x; dstLayer[0xe] = (srcLayer->_size).y; dstLayer[0xf] = srcLayer->_rotation; dstLayer[0x10] = (srcLayer->_pos).x; dstLayer[0x11] = (srcLayer->_pos).y; if ((ColorMod *)(dstLayer + 0x12) != &srcLayer->_color) { fVar1 = (srcLayer->_color)._tint[1]; fVar2 = (srcLayer->_color)._tint[2]; fVar3 = (srcLayer->_color)._tint[3]; dstLayer[0x12] = (srcLayer->_color)._tint[0]; dstLayer[0x13] = fVar1; dstLayer[0x14] = fVar2; dstLayer[0x15] = fVar3; fVar1 = (srcLayer->_color)._colorize[1]; fVar2 = (srcLayer->_color)._colorize[2]; fVar3 = (srcLayer->_color)._colorize[3]; dstLayer[0x16] = (srcLayer->_color)._colorize[0]; dstLayer[0x17] = fVar1; dstLayer[0x18] = fVar2; dstLayer[0x19] = fVar3; fVar1 = (srcLayer->_color)._offset[1]; dstLayer[0x1a] = (srcLayer->_color)._offset[0]; dstLayer[0x1b] = fVar1; dstLayer[0x1c] = (srcLayer->_color)._offset[2]; } *(byte *)(dstLayer + 0x1d) = srcLayer->_visible; dstLayer[0x1e] = srcLayer->_blendMode[0]; dstLayer[0x1f] = srcLayer->_blendMode[1]; local_24 = local_24 + 1; dstLayer[0x20] = srcLayer->_blendMode[2]; dstLayer[0x21] = srcLayer->_blendMode[3]; dstLayer[0x22] = srcLayer->_blendMode[4]; dstLayer[0x23] = srcLayer->_bitflags; dstLayer[0x24] = (srcLayer->_cropOffset).x; dstLayer[0x25] = (srcLayer->_cropOffset).y; *(ANM2 **)((int)local_28 + 4 + (int)self->_layerState) = self; local_28 = (uint *)((int)local_28 + 0xa0); this = self; } while (local_24 < (uint)other->_layerCount); } ExceptionList = local_1c; return this; } //@@ 00407a60 LayerState::~LayerState /* DB: src/anm2 decompile labels (LayerState::~LayerState) */ void LayerState::~LayerState(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 0x9c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x9c) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x98); } } std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 00407ae0 Isaac::SwapANM2 /* ZHL [exact] static cleanup void Isaac::SwapANM2(ANM2* left, ANM2* right); prototype: db/protos.zhl, confirmed by RET 0 */ void __fastcall Isaac::SwapANM2(ANM2 *left,ANM2 *right) { ColorMod *pCVar1; float fVar2; float fVar3; undefined1 uVar4; void *pvVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; float fVar19; float fVar20; float fVar21; float fVar22; int iVar23; uint uVar24; undefined4 tmpChampionColor [11]; undefined4 tmpColor [11]; ColorMod *rightColor; uint tmpCapacity; undefined8 tmpColorOffsetXY; byte tmpFlag; void *tmpPtr; uint tmpSize; uVar6 = *(undefined4 *)((right->_filename)._buf + 4); uVar7 = *(undefined4 *)((right->_filename)._buf + 8); uVar8 = *(undefined4 *)((right->_filename)._buf + 0xc); uVar9 = *(undefined4 *)(left->_filename)._buf; uVar10 = *(undefined4 *)((left->_filename)._buf + 4); uVar11 = *(undefined4 *)((left->_filename)._buf + 8); uVar12 = *(undefined4 *)((left->_filename)._buf + 0xc); tmpSize = (left->_filename)._size; tmpCapacity = (left->_filename)._capacity; *(undefined4 *)(left->_filename)._buf = *(undefined4 *)(right->_filename)._buf; *(undefined4 *)((left->_filename)._buf + 4) = uVar6; *(undefined4 *)((left->_filename)._buf + 8) = uVar7; *(undefined4 *)((left->_filename)._buf + 0xc) = uVar8; uVar24 = (right->_filename)._capacity; (left->_filename)._size = (right->_filename)._size; (left->_filename)._capacity = uVar24; *(undefined4 *)(right->_filename)._buf = uVar9; *(undefined4 *)((right->_filename)._buf + 4) = uVar10; *(undefined4 *)((right->_filename)._buf + 8) = uVar11; *(undefined4 *)((right->_filename)._buf + 0xc) = uVar12; (right->_filename)._size = tmpSize; (right->_filename)._capacity = tmpCapacity; uVar6 = *(undefined4 *)((right->_animDefaultName)._buf + 4); uVar7 = *(undefined4 *)((right->_animDefaultName)._buf + 8); uVar8 = *(undefined4 *)((right->_animDefaultName)._buf + 0xc); uVar9 = *(undefined4 *)(left->_animDefaultName)._buf; uVar10 = *(undefined4 *)((left->_animDefaultName)._buf + 4); uVar11 = *(undefined4 *)((left->_animDefaultName)._buf + 8); uVar12 = *(undefined4 *)((left->_animDefaultName)._buf + 0xc); tmpSize = (left->_animDefaultName)._size; tmpCapacity = (left->_animDefaultName)._capacity; *(undefined4 *)(left->_animDefaultName)._buf = *(undefined4 *)(right->_animDefaultName)._buf; *(undefined4 *)((left->_animDefaultName)._buf + 4) = uVar6; *(undefined4 *)((left->_animDefaultName)._buf + 8) = uVar7; *(undefined4 *)((left->_animDefaultName)._buf + 0xc) = uVar8; uVar24 = (right->_animDefaultName)._capacity; (left->_animDefaultName)._size = (right->_animDefaultName)._size; (left->_animDefaultName)._capacity = uVar24; *(undefined4 *)(right->_animDefaultName)._buf = uVar9; *(undefined4 *)((right->_animDefaultName)._buf + 4) = uVar10; *(undefined4 *)((right->_animDefaultName)._buf + 8) = uVar11; *(undefined4 *)((right->_animDefaultName)._buf + 0xc) = uVar12; (right->_animDefaultName)._size = tmpSize; (right->_animDefaultName)._capacity = tmpCapacity; tmpPtr = (left->_animState)._animData; fVar2 = (left->_animState)._animFrame; (left->_animState)._animData = (right->_animState)._animData; (right->_animState)._animData = tmpPtr; tmpPtr = (left->_animState)._layerFrames; (left->_animState)._layerFrames = (right->_animState)._layerFrames; (right->_animState)._layerFrames = tmpPtr; tmpPtr = (left->_animState)._nullLayerFrames; (left->_animState)._nullLayerFrames = (right->_animState)._nullLayerFrames; (right->_animState)._nullLayerFrames = tmpPtr; (left->_animState)._animFrame = (right->_animState)._animFrame; (right->_animState)._animFrame = fVar2; tmpFlag = (left->_animState)._isPlaying; (left->_animState)._isPlaying = (right->_animState)._isPlaying; (right->_animState)._isPlaying = tmpFlag; iVar23 = (left->_animState)._currentlyTriggeredEvents; (left->_animState)._currentlyTriggeredEvents = (right->_animState)._currentlyTriggeredEvents; (right->_animState)._currentlyTriggeredEvents = iVar23; iVar23 = (left->_animState)._previouslyTriggeredEvents; (left->_animState)._previouslyTriggeredEvents = (right->_animState)._previouslyTriggeredEvents; tmpPtr = (right->_overlayAnimState)._animData; (right->_animState)._previouslyTriggeredEvents = iVar23; pvVar5 = (left->_overlayAnimState)._animData; fVar2 = (left->_overlayAnimState)._animFrame; (left->_overlayAnimState)._animData = tmpPtr; (right->_overlayAnimState)._animData = pvVar5; tmpPtr = (left->_overlayAnimState)._layerFrames; (left->_overlayAnimState)._layerFrames = (right->_overlayAnimState)._layerFrames; (right->_overlayAnimState)._layerFrames = tmpPtr; tmpPtr = (left->_overlayAnimState)._nullLayerFrames; (left->_overlayAnimState)._nullLayerFrames = (right->_overlayAnimState)._nullLayerFrames; (left->_overlayAnimState)._animFrame = (right->_overlayAnimState)._animFrame; (right->_overlayAnimState)._nullLayerFrames = tmpPtr; (right->_overlayAnimState)._animFrame = fVar2; tmpFlag = (left->_overlayAnimState)._isPlaying; (left->_overlayAnimState)._isPlaying = (right->_overlayAnimState)._isPlaying; (right->_overlayAnimState)._isPlaying = tmpFlag; iVar23 = (left->_overlayAnimState)._currentlyTriggeredEvents; (left->_overlayAnimState)._currentlyTriggeredEvents = (right->_overlayAnimState)._currentlyTriggeredEvents; (right->_overlayAnimState)._currentlyTriggeredEvents = iVar23; iVar23 = (left->_overlayAnimState)._previouslyTriggeredEvents; (left->_overlayAnimState)._previouslyTriggeredEvents = (right->_overlayAnimState)._previouslyTriggeredEvents; tmpPtr = right->_animData; (right->_overlayAnimState)._previouslyTriggeredEvents = iVar23; pvVar5 = left->_animData; left->_animData = tmpPtr; right->_animData = pvVar5; iVar23 = left->_animCount; pCVar1 = &left->_color; left->_animCount = right->_animCount; right->_animCount = iVar23; tmpPtr = left->_layerState; left->_layerState = right->_layerState; right->_layerState = tmpPtr; iVar23 = left->_layerCount; left->_layerCount = right->_layerCount; right->_layerCount = iVar23; tmpPtr = left->_nullLayerNames; left->_nullLayerNames = right->_nullLayerNames; right->_nullLayerNames = tmpPtr; iVar23 = left->_numNullLayers; left->_numNullLayers = right->_numNullLayers; right->_numNullLayers = iVar23; tmpPtr = left->_eventNames; left->_eventNames = right->_eventNames; right->_eventNames = tmpPtr; iVar23 = left->_numEvents; left->_numEvents = right->_numEvents; right->_numEvents = iVar23; rightColor = &right->_color; fVar2 = (left->_scale).x; fVar3 = (left->_scale).y; (left->_scale).x = (right->_scale).x; (left->_scale).y = (right->_scale).y; (right->_scale).x = fVar2; (right->_scale).y = fVar3; fVar2 = left->_rotation; left->_rotation = right->_rotation; right->_rotation = fVar2; tmpColorOffsetXY = *(undefined8 *)(left->_color)._offset; fVar2 = (left->_color)._offset[2]; fVar3 = pCVar1->_tint[0]; fVar13 = (left->_color)._tint[1]; fVar14 = (left->_color)._tint[2]; fVar15 = (left->_color)._tint[3]; fVar16 = (left->_color)._colorize[0]; fVar17 = (left->_color)._colorize[1]; fVar18 = (left->_color)._colorize[2]; fVar19 = (left->_color)._colorize[3]; if (pCVar1 != rightColor) { fVar20 = (right->_color)._tint[1]; fVar21 = (right->_color)._tint[2]; fVar22 = (right->_color)._tint[3]; pCVar1->_tint[0] = rightColor->_tint[0]; (left->_color)._tint[1] = fVar20; (left->_color)._tint[2] = fVar21; (left->_color)._tint[3] = fVar22; fVar20 = (right->_color)._colorize[1]; fVar21 = (right->_color)._colorize[2]; fVar22 = (right->_color)._colorize[3]; (left->_color)._colorize[0] = (right->_color)._colorize[0]; (left->_color)._colorize[1] = fVar20; (left->_color)._colorize[2] = fVar21; (left->_color)._colorize[3] = fVar22; *(undefined8 *)(left->_color)._offset = *(undefined8 *)(right->_color)._offset; (left->_color)._offset[2] = (right->_color)._offset[2]; } if (rightColor != (ColorMod *)tmpColor) { *(undefined8 *)(right->_color)._offset = tmpColorOffsetXY; rightColor->_tint[0] = fVar3; (right->_color)._tint[1] = fVar13; (right->_color)._tint[2] = fVar14; (right->_color)._tint[3] = fVar15; (right->_color)._offset[2] = fVar2; (right->_color)._colorize[0] = fVar16; (right->_color)._colorize[1] = fVar17; (right->_color)._colorize[2] = fVar18; (right->_color)._colorize[3] = fVar19; } fVar3 = (left->_championColor)._tint[0]; fVar13 = (left->_championColor)._tint[1]; fVar14 = (left->_championColor)._tint[2]; fVar15 = (left->_championColor)._tint[3]; fVar2 = (left->_championColor)._offset[2]; fVar16 = (left->_championColor)._colorize[0]; fVar17 = (left->_championColor)._colorize[1]; fVar18 = (left->_championColor)._colorize[2]; fVar19 = (left->_championColor)._colorize[3]; pCVar1 = &right->_championColor; tmpColorOffsetXY = *(undefined8 *)(left->_championColor)._offset; if (&left->_championColor != pCVar1) { fVar20 = (right->_championColor)._tint[1]; fVar21 = (right->_championColor)._tint[2]; fVar22 = (right->_championColor)._tint[3]; (left->_championColor)._tint[0] = pCVar1->_tint[0]; (left->_championColor)._tint[1] = fVar20; (left->_championColor)._tint[2] = fVar21; (left->_championColor)._tint[3] = fVar22; fVar20 = (right->_championColor)._colorize[1]; fVar21 = (right->_championColor)._colorize[2]; fVar22 = (right->_championColor)._colorize[3]; (left->_championColor)._colorize[0] = (right->_championColor)._colorize[0]; (left->_championColor)._colorize[1] = fVar20; (left->_championColor)._colorize[2] = fVar21; (left->_championColor)._colorize[3] = fVar22; *(undefined8 *)(left->_championColor)._offset = *(undefined8 *)(right->_championColor)._offset; (left->_championColor)._offset[2] = (right->_championColor)._offset[2]; } if (pCVar1 != (ColorMod *)tmpChampionColor) { *(undefined8 *)(right->_championColor)._offset = tmpColorOffsetXY; pCVar1->_tint[0] = fVar3; (right->_championColor)._tint[1] = fVar13; (right->_championColor)._tint[2] = fVar14; (right->_championColor)._tint[3] = fVar15; (right->_championColor)._offset[2] = fVar2; (right->_championColor)._colorize[0] = fVar16; (right->_championColor)._colorize[1] = fVar17; (right->_championColor)._colorize[2] = fVar18; (right->_championColor)._colorize[3] = fVar19; } tmpFlag = left->_flipX; uVar24 = 0; left->_flipX = right->_flipX; right->_flipX = tmpFlag; tmpFlag = left->_flipY; left->_flipY = right->_flipY; right->_flipY = tmpFlag; fVar2 = left->_playbackSpeed; left->_playbackSpeed = right->_playbackSpeed; right->_playbackSpeed = fVar2; uVar4 = left->field_0x108; left->field_0x108 = right->field_0x108; right->field_0x108 = uVar4; tmpFlag = left->_loaded; left->_loaded = right->_loaded; right->_loaded = tmpFlag; iVar23 = left->_shadowLayerIndex; left->_shadowLayerIndex = right->_shadowLayerIndex; right->_shadowLayerIndex = iVar23; iVar23 = left->_bitflags; left->_bitflags = right->_bitflags; right->_bitflags = iVar23; if (left->_layerCount != 0) { iVar23 = 0; do { uVar24 = uVar24 + 1; *(ANM2 **)((int)left->_layerState + iVar23 + 4) = left; iVar23 = iVar23 + 0xa0; } while (uVar24 < (uint)left->_layerCount); } uVar24 = 0; if (right->_layerCount != 0) { iVar23 = 0; do { uVar24 = uVar24 + 1; *(ANM2 **)(iVar23 + 4 + (int)right->_layerState) = right; iVar23 = iVar23 + 0xa0; } while (uVar24 < (uint)right->_layerCount); } return; } //@@ 00407e90 ANM2::operator_assign /* DB: src/anm2 decompile labels (ANM2::operator=(ANM2)) prototype: db/protos.zhl, confirmed by RET 276 */ ANM2 * __thiscall ANM2::operator_assign(ANM2 *this,ANM2 other) { ANM2 *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; ExceptionList = &local_10; Isaac::SwapANM2(this,&other); local_8 = 0; Reset(this_00); AnimationState::~AnimationState(&other._overlayAnimState); AnimationState::~AnimationState(&other._animState); std::string::_Tidy_deallocate(other._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&other); ExceptionList = local_10; return this; } //@@ 00407f10 ANM2::Reset /* DB: src/anm2 decompile labels (ANM2::Reset) prototype: REPENTOGON */ void __thiscall ANM2::Reset(ANM2 *this) { uint *ptr; void *pvVar1; ANM2 *pAVar2; std_string *psVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a30; local_10 = ExceptionList; ExceptionList = &local_10; if ((this->_filename)._size != 0) { AnmCache::RemoveRef(&this->_filename); } pAVar2 = this; if (0xf < (this->_filename)._capacity) { pAVar2 = *(ANM2 **)(this->_filename)._buf; } (this->_filename)._size = 0; (pAVar2->_filename)._buf[0] = '\0'; AnimationState::SetAnimationData(&this->_animState,(void *)0x0); AnimationState::SetAnimationData(&this->_overlayAnimState,(void *)0x0); psVar3 = &this->_animDefaultName; if (0xf < (this->_animDefaultName)._capacity) { psVar3 = *(std_string **)(this->_animDefaultName)._buf; } (this->_animDefaultName)._size = 0; psVar3->_buf[0] = '\0'; pvVar1 = this->_layerState; this->_animData = (void *)0x0; this->_animCount = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); } this->_layerState = (void *)0x0; this->_layerCount = 0; this->_nullLayerNames = (void *)0x0; this->_numNullLayers = 0; this->_eventNames = (void *)0x0; this->_numEvents = 0; (this->_offset).x = g_vectorZero.x; (this->_offset).y = g_vectorZero.y; (this->_scale).x = g_vectorOne.x; (this->_scale).y = g_vectorOne.y; this->_rotation = 0.0; (this->_color)._tint[0] = 1.0; (this->_color)._tint[1] = 1.0; (this->_color)._tint[2] = 1.0; (this->_color)._tint[3] = 1.0; (this->_color)._colorize[0] = 0.0; (this->_color)._colorize[1] = 0.0; (this->_color)._colorize[2] = 0.0; (this->_color)._colorize[3] = 0.0; (this->_color)._offset[0] = 0.0; (this->_color)._offset[1] = 0.0; (this->_color)._offset[2] = 0.0; (this->_championColor)._colorize[0] = 0.0; (this->_championColor)._colorize[1] = 0.0; (this->_championColor)._colorize[2] = 0.0; (this->_championColor)._colorize[3] = 0.0; (this->_championColor)._offset[0] = 0.0; (this->_championColor)._offset[1] = 0.0; (this->_championColor)._offset[2] = 0.0; (this->_championColor)._tint[0] = 1.0; (this->_championColor)._tint[1] = 1.0; (this->_championColor)._tint[2] = 1.0; (this->_championColor)._tint[3] = 0.0; this->_flipX = 0; this->_flipY = 0; this->_playbackSpeed = 1.0; *(undefined2 *)&this->field_0x108 = 0; this->_overlayRenderFirst = 0; this->_shadowLayerIndex = -1; this->_bitflags = 0; ExceptionList = local_10; return; } //@@ 00408170 ANM2::~ANM2 /* DB: src/anm2 decompile labels (ANM2::~ANM2) prototype: db/protos.zhl */ void __thiscall ANM2::~ANM2(ANM2 *this) { void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0a50; local_10 = ExceptionList; ExceptionList = &local_10; Reset(this); AnimationState::~AnimationState(&this->_overlayAnimState); AnimationState::~AnimationState(&this->_animState); std::string::_Tidy_deallocate((this->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)this); ExceptionList = local_10; return; } //@@ 004081d0 LayerState::LayerState /* DB: src/anm2 decompile labels (LayerState::LayerState) */ LayerState * __thiscall LayerState::LayerState(LayerState *this) { uint uVar1; int iVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0a8e; local_10 = ExceptionList; ExceptionList = &local_10; (this->_spriteSheetPath)._buf[0] = '\0'; (this->_spriteSheetPath)._buf[1] = '\0'; (this->_spriteSheetPath)._buf[2] = '\0'; (this->_spriteSheetPath)._buf[3] = '\0'; (this->_spriteSheetPath)._size = 0; (this->_spriteSheetPath)._capacity = 0xf; (this->_spriteSheetPath)._buf[0] = '\0'; (this->_size).y = 0.0; (this->_size).x = 0.0; (this->_pos).y = 0.0; (this->_pos).x = 0.0; (this->_color)._tint[0] = 1.0; (this->_color)._tint[1] = 1.0; (this->_color)._tint[2] = 1.0; (this->_color)._tint[3] = 1.0; (this->_color)._colorize[0] = 0.0; (this->_color)._colorize[1] = 0.0; (this->_color)._colorize[2] = 0.0; (this->_color)._colorize[3] = 0.0; (this->_color)._offset[0] = 0.0; (this->_color)._offset[1] = 0.0; (this->_color)._offset[2] = 0.0; uVar1 = g_graphicsManager_flags & 4; this->_blendMode[0] = 0; iVar2 = 1; this->_blendMode[2] = 7; this->_blendMode[3] = 1; if (uVar1 == 0) { iVar2 = 6; } this->_blendMode[1] = iVar2; this->_blendMode[4] = 7; (this->_cropOffset).y = 0.0; (this->_cropOffset).x = 0.0; this->_spriteSheet = 0; this[1]._layerData = (void *)0x0; local_8 = 1; Init(this,0); ExceptionList = local_10; return this; } //@@ 00408310 LayerState::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/anm2 decompile labels (LayerState::Init(LayerInfo*)) */ void __thiscall LayerState::Init(LayerState *this,void *param_2) { void **ppvVar1; void **text; int iVar2; void *pvVar3; uint uVar4; bool bVar5; void *local_48 [4]; undefined4 local_38; uint local_34; void *local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af0ae7; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; this->_layerData = param_2; bVar5 = param_2 == (void *)0x0; if (bVar5) { local_1c = 0xf; local_20 = 0; local_30[0] = (void *)0x0; text = local_30; local_8 = (void *)0x1; } else { text = std::string::string((char *)local_48,(void *)((int)param_2 + 0x20)); local_8 = (void *)0x0; } local_8 = (void *)(uint)bVar5; if (&this->_spriteSheetPath != (std_string *)text) { ppvVar1 = text + 4; if ((void *)0xf < text[5]) { text = *text; } std::string::assign((this->_spriteSheetPath)._buf,(byte *)text,(uint)*ppvVar1); } local_8 = (void *)0x0; if ((bVar5) && (0xf < local_1c)) { uVar4 = local_1c + 1; pvVar3 = local_30[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_30[0] + -4); uVar4 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar3))) goto LAB_00408423; } operator_delete(pvVar3,uVar4); } local_8 = (void *)0xffffffff; if (!bVar5) { if (0xf < local_34) { uVar4 = local_34 + 1; pvVar3 = local_48[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_48[0] + -4); uVar4 = local_34 + 0x24; if (0x1f < (uint)((int)local_48[0] + (-4 - (int)pvVar3))) { LAB_00408423: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } local_38 = 0; local_34 = 0xf; local_48[0] = (void *)((uint)local_48[0] & 0xffffff00); } KAGE::SmartPointer::reset(&this->_spriteSheet,(void *)0x0); this->_spriteSheetLoaded = 0; this->field_0x31 = 0; this->_flipX = 0; this->_flipY = 0; (this->_size).x = g_vectorOne.x; (this->_size).y = g_vectorOne.y; this->_rotation = 0.0; (this->_pos).x = g_vectorZero.x; (this->_pos).y = g_vectorZero.y; (this->_color)._tint[0] = 1.0; (this->_color)._tint[1] = 1.0; (this->_color)._tint[2] = 1.0; (this->_color)._tint[3] = 1.0; (this->_color)._colorize[0] = 0.0; (this->_color)._colorize[1] = 0.0; (this->_color)._colorize[2] = 0.0; (this->_color)._colorize[3] = 0.0; (this->_color)._offset[0] = 0.0; (this->_color)._offset[1] = 0.0; (this->_color)._offset[2] = 0.0; this->_visible = 1; uVar4 = g_graphicsManager_flags & 4; this->_blendMode[0] = 0; this->_blendMode[2] = 7; iVar2 = 1; if (uVar4 == 0) { iVar2 = 6; } this->_blendMode[3] = 1; this->_blendMode[1] = iVar2; this->_blendMode[4] = 7; this->_minFilterMode = DAT_00c3799c; this->_magFilterMode = DAT_00c379a0; this->_wrapSMode = DAT_00c379a4; this->_wrapTMode = DAT_00c379a8; this->_bitflags = 0; (this->_cropOffset).x = g_vectorZero.x; (this->_cropOffset).y = g_vectorZero.y; ExceptionList = local_10; return; } //@@ 00408590 LayerState::GetTexture /* DB: src/anm2 decompile labels (LayerState::GetTexture) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall LayerState::GetTexture(LayerState *this,void *outTexture) { int iVar1; int iVar2; int *piVar3; piVar3 = (int *)this->_spriteSheet; if (piVar3 != (int *)0x0) { iVar1 = this->_minFilterMode; if (((piVar3[0xc] != iVar1) || (piVar3[0xd] != this->_magFilterMode)) && ((iVar2 = this->_magFilterMode, iVar1 != piVar3[0xc] || (iVar2 != piVar3[0xd])))) { (**(code **)(*piVar3 + 0x44))(iVar1,iVar2); piVar3[0xc] = iVar1; piVar3[0xd] = iVar2; piVar3 = (int *)this->_spriteSheet; } iVar1 = this->_wrapSMode; if (((piVar3[0xe] != iVar1) || (piVar3[0xf] != this->_wrapTMode)) && ((iVar2 = this->_wrapTMode, iVar1 != piVar3[0xe] || (iVar2 != piVar3[0xf])))) { (**(code **)(*piVar3 + 0x48))(iVar1,iVar2); piVar3[0xe] = iVar1; piVar3[0xf] = iVar2; } } KAGE::SmartPointer::operator_assign(outTexture,&this->_spriteSheet); return outTexture; } //@@ 00408640 LayerState::SetTexture /* DB: src/anm2 decompile labels (LayerState::SetTexture) prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall LayerState::SetTexture(LayerState *this,void *texture,void *textureRefCount) { char cVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b1d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (texture != (void *)0x0) { this->_minFilterMode = *(int *)((int)texture + 0x30); this->_magFilterMode = *(int *)((int)texture + 0x34); this->_wrapSMode = *(int *)((int)texture + 0x38); this->_wrapTMode = *(int *)((int)texture + 0x3c); } KAGE::SmartPointer::operator_assign(&this->_spriteSheet,&texture); local_8 = 1; if (textureRefCount != (void *)0x0) { cVar1 = (**(code **)(*(int *)textureRefCount + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&texture); } } ExceptionList = local_10; return; } //@@ 004086e0 AnimationState::AnimationState /* DB: src/anm2 decompile labels (AnimationState::AnimationState(owner,copy)) */ void AnimationState::AnimationState(undefined4 param_1,int param_2) { longlong lVar1; void *pvVar2; undefined4 *in_ECX; int iVar3; *in_ECX = param_1; iVar3 = *(int *)(param_2 + 4); in_ECX[1] = iVar3; if ((iVar3 == 0) || (*(uint *)(iVar3 + 0x1c) == 0)) { in_ECX[2] = 0; } else { lVar1 = (ulonglong)*(uint *)(iVar3 + 0x1c) * 4; pvVar2 = operator_new_tracked(-(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); in_ECX[2] = pvVar2; memcpy(pvVar2,*(void **)(param_2 + 8),*(int *)(in_ECX[1] + 0x1c) << 2); iVar3 = in_ECX[1]; } if ((iVar3 == 0) || (*(uint *)(iVar3 + 0x24) == 0)) { in_ECX[3] = 0; } else { lVar1 = (ulonglong)*(uint *)(iVar3 + 0x24) * 4; pvVar2 = operator_new_tracked(-(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); in_ECX[3] = pvVar2; memcpy(pvVar2,*(void **)(param_2 + 0xc),*(int *)(in_ECX[1] + 0x24) << 2); } in_ECX[4] = *(undefined4 *)(param_2 + 0x10); *(undefined1 *)(in_ECX + 5) = *(undefined1 *)(param_2 + 0x14); in_ECX[6] = *(undefined4 *)(param_2 + 0x18); in_ECX[7] = *(undefined4 *)(param_2 + 0x1c); return; } //@@ 004087a0 AnimationState::~AnimationState /* DB: src/anm2 decompile labels (AnimationState::~AnimationState) prototype: db/protos.zhl */ void __thiscall AnimationState::~AnimationState(AnimationState *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; if (this->_layerFrames != (void *)0x0) { local_8 = 0; tracked_alloc(1,this->_layerFrames,0); this->_layerFrames = (void *)0x0; } if (this->_nullLayerFrames != (void *)0x0) { local_8 = 1; tracked_alloc(1,this->_nullLayerFrames,0); this->_nullLayerFrames = (void *)0x0; } ExceptionList = local_10; return; } //@@ 00408830 AnimationState::SetAnimationData /* DB: src/anm2 decompile labels (AnimationState::SetAnimationData) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall AnimationState::SetAnimationData(AnimationState *this,void *animData) { longlong lVar1; void *pvVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b60; local_10 = ExceptionList; ExceptionList = &local_10; this->_animData = animData; if (this->_layerFrames != (void *)0x0) { local_8 = 0; tracked_alloc(1,this->_layerFrames,0); this->_layerFrames = (void *)0x0; } if (this->_nullLayerFrames != (void *)0x0) { local_8 = 1; tracked_alloc(1,this->_nullLayerFrames,0); this->_nullLayerFrames = (void *)0x0; } local_8 = 0xffffffff; pvVar2 = this->_animData; if (pvVar2 != (void *)0x0) { if (*(uint *)((int)pvVar2 + 0x1c) != 0) { lVar1 = (ulonglong)*(uint *)((int)pvVar2 + 0x1c) * 4; pvVar2 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1)); this->_layerFrames = pvVar2; memset(pvVar2,0xff,*(int *)((int)this->_animData + 0x1c) << 2); pvVar2 = this->_animData; if (pvVar2 == (void *)0x0) goto LAB_00408935; } if (*(uint *)((int)pvVar2 + 0x24) != 0) { lVar1 = (ulonglong)*(uint *)((int)pvVar2 + 0x24) * 4; pvVar2 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1)); this->_nullLayerFrames = pvVar2; memset(pvVar2,0xff,*(int *)((int)this->_animData + 0x24) << 2); } } LAB_00408935: this->_animFrame = (float)&DAT_bf800000; this->_isPlaying = 0; this->_currentlyTriggeredEvents = 0; this->_previouslyTriggeredEvents = 0; ExceptionList = local_10; return; } //@@ 00408970 AnimationState::ChangeAnimationKeepFrame /* DB: src/anm2 decompile labels (AnimationState::ChangeAnimationKeepFrame) */ void __thiscall AnimationState::ChangeAnimationKeepFrame(AnimationState *this,void *param_2) { qword qVar1; uint newNullLayerCount; void *pvVar2; uint uVar3; qword *allocatedBytes; uint newLayerCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *newAnimData; void *oldFrames; newAnimData = param_2; local_8 = 0xffffffff; puStack_c = &LAB_00af0b80; local_10 = ExceptionList; ExceptionList = &local_10; pvVar2 = this->_animData; if (pvVar2 == (void *)0x0) { uVar3 = 0; } else { uVar3 = *(uint *)((int)pvVar2 + 0x1c); } if (param_2 == (void *)0x0) { newLayerCount = 0; } else { newLayerCount = *(uint *)((int)param_2 + 0x1c); } if (pvVar2 == (void *)0x0) { param_2 = (void *)0x0; } else { param_2 = *(void **)((int)pvVar2 + 0x24); } if (newAnimData == (void *)0x0) { newNullLayerCount = 0; } else { newNullLayerCount = *(uint *)((int)newAnimData + 0x24); } if (uVar3 != newLayerCount) { if ((int)newLayerCount < 1) { if (this->_layerFrames != (void *)0x0) { local_8 = 0; tracked_alloc(1,this->_layerFrames,0); local_8 = 0xffffffff; this->_layerFrames = (void *)0x0; } } else { pvVar2 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)newLayerCount * 4 >> 0x20) != 0) | (uint)((ulonglong)newLayerCount * 4))); memset(pvVar2,0xff,newLayerCount * 4); if (0 < (int)uVar3) { memcpy(pvVar2,this->_layerFrames,uVar3 << 2); } oldFrames = this->_layerFrames; if (oldFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)oldFrames + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)oldFrames + -4)); local_8 = 0xffffffff; } this->_layerFrames = pvVar2; } } if (param_2 != (void *)newNullLayerCount) { if ((int)newNullLayerCount < 1) { if (this->_nullLayerFrames != (void *)0x0) { local_8 = 2; tracked_alloc(1,this->_nullLayerFrames,0); this->_nullLayerFrames = (void *)0x0; } } else { pvVar2 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)newNullLayerCount * 4 >> 0x20) != 0) | (uint)((ulonglong)newNullLayerCount * 4))); memset(pvVar2,0xff,newNullLayerCount * 4); if (0 < (int)param_2) { memcpy(pvVar2,this->_nullLayerFrames,(int)param_2 << 2); } oldFrames = this->_nullLayerFrames; if (oldFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)oldFrames + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)oldFrames + -4)); this->_nullLayerFrames = (void *)0x0; } this->_layerFrames = pvVar2; } } this->_animData = newAnimData; ExceptionList = local_10; return; } //@@ 00408b90 AnimationState::AdvanceLayerPosition /* DB: src/anm2 decompile labels (AnimationState::AdvanceLayerPosition(idx,xmm2 frame)) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall AnimationState::AdvanceLayerPosition(AnimationState *this,int layerId,float targetFrame) { void *pvVar1; int iVar2; void *pvVar3; int iVar4; int iVar5; pvVar3 = this->_animData; if (((pvVar3 == (void *)0x0) || (layerId < 0)) || (*(int *)((int)pvVar3 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); pvVar3 = this->_animData; } pvVar1 = this->_layerFrames; iVar2 = *(int *)((int)pvVar1 + layerId * 4); iVar5 = layerId * 0x10 + *(int *)((int)pvVar3 + 0x18); if (-1 < iVar2) { iVar4 = iVar2 * 0x6c; do { iVar2 = iVar2 + 1; if (*(int *)(iVar5 + 8) <= iVar2) { return; } if (targetFrame < (float)*(int *)(*(int *)(iVar5 + 4) + 0x68 + iVar4)) { return; } iVar4 = iVar4 + 0x6c; *(int *)((int)pvVar1 + layerId * 4) = iVar2; } while (-1 < iVar2); } return; } //@@ 00408c10 AnimationState::AdvanceNullLayerPosition /* DB: src/anm2 decompile labels (AnimationState::AdvanceNullLayerPosition(idx,xmm2 frame)) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall AnimationState::AdvanceNullLayerPosition(AnimationState *this,int nullLayerID,float targetFrame) { void *pvVar1; int iVar2; void *pvVar3; int iVar4; int iVar5; pvVar3 = this->_animData; if (((pvVar3 == (void *)0x0) || (nullLayerID < 0)) || (*(int *)((int)pvVar3 + 0x24) <= nullLayerID)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); pvVar3 = this->_animData; } pvVar1 = this->_nullLayerFrames; iVar2 = *(int *)((int)pvVar1 + nullLayerID * 4); iVar5 = nullLayerID * 0x10 + *(int *)((int)pvVar3 + 0x20); if (-1 < iVar2) { iVar4 = iVar2 * 0x54; do { iVar2 = iVar2 + 1; if (*(int *)(iVar5 + 0xc) <= iVar2) { return; } if (targetFrame < (float)*(int *)(*(int *)(iVar5 + 8) + 0x50 + iVar4)) { return; } iVar4 = iVar4 + 0x54; *(int *)((int)pvVar1 + nullLayerID * 4) = iVar2; } while (-1 < iVar2); } return; } //@@ 00408c90 AnimationState::FireTriggersAtCurrentFrame /* DB: src/anm2 decompile labels (AnimationState::FireTriggersAtCurrentFrame) */ void __thiscall AnimationState::FireTriggersAtCurrentFrame(AnimationState *this) { uint uVar1; void *pvVar2; pvVar2 = this->_animData; if (pvVar2 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); pvVar2 = this->_animData; } uVar1 = 0; if (*(int *)((int)pvVar2 + 0x2c) != 0) { do { if ((float)*(int *)(*(int *)((int)pvVar2 + 0x28) + 4 + uVar1 * 8) == this->_animFrame) { this->_currentlyTriggeredEvents = this->_currentlyTriggeredEvents | 1 << (*(uint *)(*(int *)((int)pvVar2 + 0x28) + uVar1 * 8) & 0x1f); this->_previouslyTriggeredEvents = this->_previouslyTriggeredEvents | 1 << (*(uint *)(*(int *)((int)pvVar2 + 0x28) + uVar1 * 8) & 0x1f); } uVar1 = uVar1 + 1; } while (uVar1 < *(uint *)((int)pvVar2 + 0x2c)); } return; } //@@ 00408d00 AnimationState::AdvancePosition /* ZHL [exact] __thiscall void AnimationState::AdvancePosition(int targetFrame); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall AnimationState::AdvancePosition(AnimationState *this,int targetFrame) { void *pvVar1; uint uVar2; float targetFrame_00; float fVar3; double dVar4; fVar3 = this->_animFrame; dVar4 = floor((double)fVar3); if (targetFrame < (int)dVar4) { KAGE_LogMessage(0x10,(byte *) "Animation::AdvancePosition cannot go backward (new: %d, cur: %d)\n"); fVar3 = this->_animFrame; } targetFrame_00 = (float)targetFrame; this->_currentlyTriggeredEvents = 0; if (fVar3 < targetFrame_00) { do { dVar4 = floor((double)this->_animFrame); this->_animFrame = (float)dVar4 + 1.0; FireTriggersAtCurrentFrame(this); } while (this->_animFrame <= targetFrame_00 && targetFrame_00 != this->_animFrame); } pvVar1 = this->_animData; uVar2 = 0; if (*(int *)((int)pvVar1 + 0x1c) != 0) { do { AdvanceLayerPosition(this,uVar2,targetFrame_00); pvVar1 = this->_animData; uVar2 = uVar2 + 1; } while (uVar2 < *(uint *)((int)pvVar1 + 0x1c)); } uVar2 = 0; if (*(int *)((int)pvVar1 + 0x24) != 0) { do { AdvanceNullLayerPosition(this,uVar2,targetFrame_00); uVar2 = uVar2 + 1; } while (uVar2 < *(uint *)((int)this->_animData + 0x24)); } return; } //@@ 00408e00 AnimationState::SetFrameFloat /* DB: src/anm2 decompile labels (AnimationState::SetFrameFloat(xmm1)) prototype: db/protos.zhl */ void __thiscall AnimationState::SetFrameFloat(AnimationState *this,float frame) { float fVar1; void *pvVar2; uint uVar3; float10 fVar4; fVar4 = (float10)nextafterf((float)*(int *)((int)this->_animData + 0x30),0); fVar1 = (float)fVar4; if (frame <= (float)fVar4) { fVar1 = frame; } this->_currentlyTriggeredEvents = 0; this->_animFrame = fVar1; FireTriggersAtCurrentFrame(this); pvVar2 = this->_animData; uVar3 = 0; if (*(int *)((int)pvVar2 + 0x1c) != 0) { do { if (((pvVar2 == (void *)0x0) || ((int)uVar3 < 0)) || (*(int *)((int)pvVar2 + 0x1c) <= (int)uVar3)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)this->_layerFrames + uVar3 * 4) = 0; AdvanceLayerPosition(this,uVar3,frame); pvVar2 = this->_animData; uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)pvVar2 + 0x1c)); } uVar3 = 0; if (*(int *)((int)pvVar2 + 0x24) != 0) { do { if (((pvVar2 == (void *)0x0) || ((int)uVar3 < 0)) || (*(int *)((int)pvVar2 + 0x24) <= (int)uVar3)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)this->_nullLayerFrames + uVar3 * 4) = 0; AdvanceNullLayerPosition(this,uVar3,frame); pvVar2 = this->_animData; uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)pvVar2 + 0x24)); } return; } //@@ 00408ef0 AnimationState::SetLayerFrame /* DB: src/anm2 decompile labels (AnimationState::SetLayerFrame(layer,frame)) prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall AnimationState::SetLayerFrame(AnimationState *this,int layerID,int frame) { void *pvVar1; int layerId; if (((layerID < 0) || (*(int *)((int)this->_animation + 0x80) <= layerID)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), layerID < 0)) { return; } if (layerID < *(int *)((int)this->_animation + 0x80)) { pvVar1 = this->_animData; layerId = *(int *)((int)pvVar1 + layerID * 4 + 0x38); if (((pvVar1 == (void *)0x0) || (layerId < 0)) || (*(int *)((int)pvVar1 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)this->_layerFrames + layerId * 4) = 0; AdvanceLayerPosition(this,layerId,(float)frame); } return; } //@@ 00408f70 AnimationState::GetLayerFrameIdx /* DB: src/anm2 decompile labels (AnimationState::GetLayerFrameIdx(layer)) */ undefined4 AnimationState::GetLayerFrameIdx(int param_1) { int *in_ECX; if (((param_1 < 0) || (*(int *)(*in_ECX + 0x80) <= param_1)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), param_1 < 0)) { return 0; } if (param_1 < *(int *)(*in_ECX + 0x80)) { return *(undefined4 *)(in_ECX[2] + *(int *)(in_ECX[1] + 0x38 + param_1 * 4) * 4); } return 0; } //@@ 00408fc0 AnimationState::SetNullLayerFrame /* DB: src/anm2 decompile labels (AnimationState::SetNullLayerFrame(null,frame)) */ void AnimationState::SetNullLayerFrame(int param_1,int param_2) { AnimationState *in_ECX; if ((param_1 < 0) || (*(int *)((int)in_ECX->_animation + 0x88) <= param_1)) { KAGE_LogMessage(0x10,(byte *)"layerId out of bounds\n"); } if (((in_ECX->_animData == (void *)0x0) || (param_1 < 0)) || (*(int *)((int)in_ECX->_animData + 0x24) <= param_1)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)in_ECX->_nullLayerFrames + param_1 * 4) = 0; AdvanceNullLayerPosition(in_ECX,param_1,(float)param_2); return; } //@@ 00409030 AnimationState::Update /* DB: src/anm2 decompile labels (AnimationState::Update) prototype: db/protos.zhl */ void __thiscall AnimationState::Update(AnimationState *this) { int targetFrame; float fVar1; void *pvVar2; float fVar3; double dVar4; pvVar2 = this->_animData; if ((pvVar2 != (void *)0x0) && (this->_isPlaying != 0)) { fVar1 = this->_animFrame; fVar3 = fVar1 + *(float *)((int)this->_animation + 0x104); dVar4 = floor((double)fVar3); if (*(int *)((int)pvVar2 + 0x30) <= (int)dVar4) { if (*(char *)((int)pvVar2 + 0x34) != '\0') { Rewind(this); return; } targetFrame = *(int *)((int)pvVar2 + 0x30) + -1; dVar4 = floor((double)fVar1); if ((int)dVar4 <= targetFrame) { AdvancePosition(this,targetFrame); } this->_isPlaying = 0; return; } AdvancePosition(this,(int)dVar4); this->_animFrame = fVar3; } return; } //@@ 00409100 ANM2::Update /* ZHL [exact] __thiscall void ANM2::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall ANM2::Update(ANM2 *this) { if (this->_loaded == 0) { return; } AnimationState::Update(&this->_animState); AnimationState::Update(&this->_overlayAnimState); return; } //@@ 00409120 AnimationLayer::RenderFrame /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? layer render with ChampionColor, GetSourceQuad, shader params prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall AnimationLayer::RenderFrame (AnimationLayer *this,Vector *position,int frameIndex,Vector *topLeftClamp, Vector *BottomRightClamp,ANM2 *animation) { int iVar1; int iVar2; int iVar3; float fVar4; float fVar5; float fVar6; AnimationFrame *pAVar7; int *piVar8; ColorMod *pCVar9; uint uVar10; undefined4 *puVar11; int iVar12; void *unused; int unused_00; int extraout_ECX; int extraout_ECX_00; uint extraout_EDX; uint extraout_EDX_00; ANM2 *animation_00; LayerState *pLVar13; float fVar14; undefined1 auStack_26c [36]; float fStack_248; undefined1 auStack_240 [12]; float fStack_234; void *pvVar15; undefined1 auStack_212 [2]; undefined1 local_208 [112]; int local_198; int iStack_194; int iStack_190; int iStack_18c; float local_184; ANM2 *pAStack_180; float fStack_17c; float fStack_178; undefined4 local_174; int local_170; int local_16c [2]; Vector local_164; SourceQuad local_15c; Vector *local_138; undefined1 local_134 [4]; float local_130; undefined1 local_12c [8]; float local_124; RNG RStack_120; uint local_110; LayerState *local_10c; AnimationFrame *local_108; ANM2 *local_104; Color local_100; Color local_d4 [3]; Color local_50; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; puStack_20 = (undefined1 *)(&local_50)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af0be7; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&local_50)[1]._colorize + 1); local_138 = position; local_104 = animation; if (*(char *)(this + 3) == '\0') { return; } if (frameIndex < 0) { return; } if ((int)this[2] <= frameIndex) { return; } local_108 = (AnimationFrame *)(frameIndex * 0x6c + (int)this[1]); if (local_108->visible == 0) { return; } pLVar13 = (LayerState *)((int)*this * 0xa0 + (int)animation->_layerState); if (pLVar13->_visible == 0) { return; } ExceptionList = &local_1c; local_10c = pLVar13; piVar8 = LayerState::GetTexture(pLVar13,local_16c); iVar12 = *piVar8; FUN_0040c440(); animation_00 = local_104; if (iVar12 == 0) { ExceptionList = local_1c; return; } local_110 = local_104->_bitflags | pLVar13->_bitflags; if (((local_110 & 4) != 0) && (DAT_00c7977e == '\0')) { ExceptionList = local_1c; return; } local_170 = g_graphicsManager_blendMode[4]; g_graphicsManager_blendMode[4] = pLVar13->_blendMode[4]; iVar12 = pLVar13->_blendMode[0]; iVar1 = pLVar13->_blendMode[1]; iVar2 = pLVar13->_blendMode[2]; iVar3 = pLVar13->_blendMode[3]; local_198 = g_graphicsManager_blendMode[0]; iStack_194 = g_graphicsManager_blendMode[1]; iStack_190 = g_graphicsManager_blendMode[2]; iStack_18c = g_graphicsManager_blendMode[3]; g_graphicsManager_blendMode[0] = iVar12; g_graphicsManager_blendMode[1] = iVar1; g_graphicsManager_blendMode[2] = iVar2; g_graphicsManager_blendMode[3] = iVar3; if ((local_110 & 1) == 0) { if (g_colorStackSize == 0) { Color::operator_assign((Color *)auStack_26c,&local_104->_color); FUN_004072e0(); pCVar9 = (ColorMod *)FUN_004072e0(); animation_00 = local_104; } else { pCVar9 = (ColorMod *)FUN_0040c6f0(); pCVar9 = Color::operator_assign(local_d4,pCVar9); } pCVar9 = Color::operator_assign(&local_100,pCVar9); } else { fStack_248 = 5.930037e-39; Color::operator_assign((Color *)auStack_240,&pLVar13->_color); pCVar9 = (ColorMod *)FUN_004072e0(); } Color::operator_assign(&local_50,pCVar9); if (DAT_00c7977d != '\0') { local_130 = local_50._tint[3] * 0.5; if (g_game != (Game *)0x0) { local_130 = local_130 * *(float *)((int)g_game->_room + 0x7240); } local_50._tint[3] = local_130; } fStack_234 = 5.930383e-39; local_130 = local_50._tint[3]; GetSourceQuad(&local_15c,unused,local_108,local_10c,topLeftClamp,BottomRightClamp,animation_00); pAVar7 = local_108; pLVar13 = local_10c; fStack_234 = 5.930441e-39; render_build_sprite_quad (local_208,local_138,local_108,local_10c,topLeftClamp,BottomRightClamp,local_104); if (DAT_00c7977f != '\0') { RStack_120._shift1 = 5; RStack_120._shift2 = 9; RStack_120._seed = (int)local_104; local_164.y = pAVar7->height * 0.5 + (pAVar7->crop).y; local_164.x = pAVar7->width * 0.5 + (pAVar7->crop).x; RStack_120._shift3 = 7; local_138 = (Vector *)local_164.x; local_108 = (AnimationFrame *)local_164.y; KAGE::SmartPointer::operator_assign(local_16c,&(g_game->_proceduralItemManager)._renderTarget); local_14 = 0.0; piVar8 = LayerState::GetTexture(pLVar13,local_12c); iVar12 = *piVar8; FUN_0040c440(); local_14 = -NAN; FUN_0040c440(); pLVar13 = local_10c; if (iVar12 == local_16c[0]) { local_164.x = (float)local_138 + (local_10c->_cropOffset).x; local_164.y = (float)local_108 + (local_10c->_cropOffset).y; } uVar10 = RNG::RandomInt(&RStack_120,2); if (uVar10 == 0) { fVar14 = 90.0; } else { fVar14 = -90.0; } Quad::rotate(&local_15c,&local_164,fVar14 * 0.017453292); BottomRightClamp = (Vector *)0x4094f3; uVar10 = RNG::RandomInt(&RStack_120,2); fVar6 = local_15c._bottomLeft.y; fVar5 = local_15c._bottomLeft.x; fVar4 = local_15c._topLeft.y; fVar14 = local_15c._topLeft.x; if (uVar10 != 0) { local_15c._topLeft.x = local_15c._topRight.x; local_15c._topLeft.y = local_15c._topRight.y; local_15c._topRight.x = fVar14; local_15c._topRight.y = fVar4; local_15c._bottomLeft.x = local_15c._bottomRight.x; local_15c._bottomLeft.y = local_15c._bottomRight.y; local_15c._bottomRight.x = fVar5; local_15c._bottomRight.y = fVar6; } } if ((local_110 & 0x10) != 0) { pvVar15 = (void *)0x409594; FUN_00682260(); LayerState::GetTexture(pLVar13,auStack_212 + -10); apply_sprite_shader_params((ColorMod *)&local_50,1,BottomRightClamp,pvVar15); Shader::set_uniform(g_currentShader,(byte *)"ChampionColor",0xb,&local_104->_championColor, unused_00); puVar11 = LayerState::GetTexture(pLVar13,local_12c); local_14 = 1.4013e-45; RStack_120._shift3 = 0; local_124 = local_50._tint[0]; RStack_120._seed = (int)local_50._tint[1]; RStack_120._shift2 = (int)local_50._tint[3]; RStack_120._shift1 = (int)local_50._tint[2]; (**(code **)(*(int *)*puVar11 + 0x14))(); local_14 = -NAN; FUN_0040c440(); FUN_00682260(); iVar12 = extraout_ECX; goto LAB_0040983b; } if ((local_110 & 0x20) == 0) { if ((char)local_110 < '\0') { pvVar15 = (void *)0x4096f7; FUN_00682260(); if ((extraout_EDX_00 & 0x40) == 0) { uVar10 = g_game->_frameCount; } else { uVar10 = g_manager->_framecount / 2; } uVar10 = uVar10 & 0x800000ff; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xffffff00) + 1; } local_50._colorize[3] = (float)(int)uVar10 * 0.00390625; LayerState::GetTexture(pLVar13,auStack_212 + -10); apply_sprite_shader_params((ColorMod *)&local_50,1,BottomRightClamp,pvVar15); puVar11 = LayerState::GetTexture(pLVar13,local_12c); local_14 = 4.2039e-45; goto LAB_004096ad; } if ((local_110 & 0x200) != 0) { puVar11 = LayerState::GetTexture(pLVar13,local_12c); local_14 = 5.60519e-45; iVar12 = *(int *)*puVar11; local_124 = local_50._tint[0]; RStack_120._seed = (int)local_50._tint[1]; RStack_120._shift2 = (int)local_130; RStack_120._shift1 = (int)local_50._tint[2]; goto LAB_004096bc; } pvVar15 = (void *)0x4097ce; FUN_00682260(); LayerState::GetTexture(pLVar13,auStack_212 + -10); apply_sprite_shader_params((ColorMod *)&local_50,1,BottomRightClamp,pvVar15); puVar11 = LayerState::GetTexture(pLVar13,local_134); local_14 = 7.00649e-45; local_174 = 0; local_184 = local_50._tint[0]; pAStack_180 = (ANM2 *)local_50._tint[1]; fStack_17c = local_50._tint[2]; fStack_178 = local_50._tint[3]; (**(code **)(*(int *)*puVar11 + 0x14))(); } else { pvVar15 = (void *)0x40963f; FUN_00682260(); if ((extraout_EDX & 0x40) == 0) { uVar10 = g_game->_frameCount; } else { uVar10 = g_manager->_framecount / 2; } uVar10 = uVar10 & 0x800000ff; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xffffff00) + 1; } local_50._colorize[3] = (float)(int)uVar10 * 0.00390625; LayerState::GetTexture(pLVar13,auStack_212 + -10); apply_sprite_shader_params((ColorMod *)&local_50,1,BottomRightClamp,pvVar15); puVar11 = LayerState::GetTexture(pLVar13,local_12c); local_14 = 2.8026e-45; LAB_004096ad: iVar12 = *(int *)*puVar11; local_124 = local_50._tint[0]; RStack_120._seed = (int)local_50._tint[1]; RStack_120._shift2 = (int)local_50._tint[3]; RStack_120._shift1 = (int)local_50._tint[2]; LAB_004096bc: RStack_120._shift3 = 0; (**(code **)(iVar12 + 0x14))(); } local_14 = -NAN; FUN_0040c440(); iVar12 = extraout_ECX_00; LAB_0040983b: g_graphicsManager_blendMode[0] = local_198; g_graphicsManager_blendMode[1] = iStack_194; g_graphicsManager_blendMode[2] = iStack_190; g_graphicsManager_blendMode[3] = iStack_18c; g_graphicsManager_blendMode[4] = local_170; shader_cache_find(iVar12); ExceptionList = local_1c; return; } //@@ 004098a0 AnimationLayer::GetSourceQuad /* ZHL [exact] static __stdcall SourceQuad* AnimationLayer::GetSourceQuad(SourceQuad* ret, void* unused, const AnimationFrame& frame, const LayerState& layer, const Vector& topLeftClamp, const Vector& BottomRightClamp, const ANM2& animation); prototype: REPENTOGON, confirmed by RET 28 */ SourceQuad * AnimationLayer::GetSourceQuad (SourceQuad *ret,void *unused,AnimationFrame *frame,LayerState *layer,Vector *topLeftClamp ,Vector *BottomRightClamp,ANM2 *animation) { float fVar1; float fVar2; byte bVar3; code *pcVar4; SourceQuad *pSVar5; uint uVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; byte local_12; bVar3 = animation->_flipX; local_12 = animation->_flipY; if (DAT_00c7977d != '\0') { local_12 = local_12 == 0; } fVar12 = (animation->_scale).y; fVar13 = (frame->scale).x * (layer->_size).x; fVar14 = (frame->crop).x; fVar10 = (frame->scale).y * (layer->_size).y; fVar8 = topLeftClamp->x / fVar13 + fVar14; fVar9 = (frame->crop).y; fVar7 = topLeftClamp->y / fVar10 + fVar9; fVar1 = frame->height; fVar11 = (fVar14 + frame->width) - BottomRightClamp->x / fVar13; fVar14 = (animation->_scale).x; fVar2 = BottomRightClamp->y; (ret->_topRight).y = 0.0; (ret->_bottomRight).y = 0.0; (ret->_bottomLeft).y = 0.0; *(undefined1 *)&ret->_coordinateSpace = 1; (ret->_topLeft).x = fVar8; fVar9 = (fVar9 + fVar1) - fVar2 / fVar10; (ret->_topLeft).y = fVar7; (ret->_bottomLeft).x = fVar8; (ret->_topRight).y = fVar7; (ret->_bottomRight).x = fVar11; (ret->_topRight).x = fVar11; (ret->_bottomRight).y = fVar9; (ret->_bottomLeft).y = fVar9; if (layer->_flipX != 0) { fVar13 = -fVar13; } if (bVar3 != 0) { fVar14 = -fVar14; } if (fVar14 < 0.0 != fVar13 < 0.0) { fVar14 = (ret->_topLeft).x; (ret->_topLeft).x = fVar11; (ret->_topLeft).y = (ret->_topRight).y; (ret->_topRight).x = fVar14; (ret->_topRight).y = fVar7; fVar14 = (ret->_bottomLeft).x; fVar9 = (ret->_bottomLeft).y; (ret->_bottomLeft).x = (ret->_bottomRight).x; (ret->_bottomLeft).y = (ret->_bottomRight).y; (ret->_bottomRight).y = fVar9; (ret->_bottomRight).x = fVar14; } if (layer->_flipY != 0) { fVar10 = -fVar10; } if (local_12 != 0) { fVar12 = -fVar12; } if (fVar12 < 0.0 != fVar10 < 0.0) { fVar12 = (ret->_topLeft).x; fVar14 = (ret->_topLeft).y; fVar9 = (ret->_topRight).x; fVar1 = (ret->_topRight).y; (ret->_topLeft).x = (ret->_bottomLeft).x; (ret->_topLeft).y = (ret->_bottomLeft).y; (ret->_topRight).x = (ret->_bottomRight).x; (ret->_topRight).y = (ret->_bottomRight).y; (ret->_bottomLeft).x = fVar12; (ret->_bottomLeft).y = fVar14; (ret->_bottomRight).x = fVar9; (ret->_bottomRight).y = fVar1; } if (((animation->_bitflags | layer->_bitflags) & 2U) != 0) { fVar12 = (ret->_topRight).x; fVar14 = (ret->_topLeft).x; fVar9 = (ret->_bottomLeft).y; fVar1 = (ret->_topLeft).y; if (DAT_00c33914 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); if (DAT_00c33914 == 0) { pcVar4 = (code *)swi(3); pSVar5 = (SourceQuad *)(*pcVar4)(); return pSVar5; } } uVar6 = DAT_00c33914 >> ((byte)DAT_00c33918 & 0x1f) ^ DAT_00c33914; uVar6 = uVar6 << ((byte)DAT_00c3391c & 0x1f) ^ uVar6; DAT_00c33914 = uVar6 >> ((byte)DAT_00c33920 & 0x1f) ^ uVar6; fVar9 = ((float)((double)(int)DAT_00c33914 + __uint_to_double_fixup[-((int)DAT_00c33914 >> 0x1f)]) * 2.3283062e-10 - 0.5) * (fVar9 - fVar1); if (DAT_00c33914 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); if (DAT_00c33914 == 0) { pcVar4 = (code *)swi(3); pSVar5 = (SourceQuad *)(*pcVar4)(); return pSVar5; } } uVar6 = DAT_00c33914 >> ((byte)DAT_00c33918 & 0x1f) ^ DAT_00c33914; uVar6 = uVar6 << ((byte)DAT_00c3391c & 0x1f) ^ uVar6; DAT_00c33914 = uVar6 >> ((byte)DAT_00c33920 & 0x1f) ^ uVar6; fVar14 = ((float)((double)(int)DAT_00c33914 + __uint_to_double_fixup[-((int)DAT_00c33914 >> 0x1f)]) * 2.3283062e-10 - 0.5) * (fVar12 - fVar14); (ret->_topLeft).x = fVar14 + (ret->_topLeft).x; (ret->_topLeft).y = fVar9 + (ret->_topLeft).y; (ret->_topRight).x = fVar14 + (ret->_topRight).x; (ret->_topRight).y = fVar9 + (ret->_topRight).y; (ret->_bottomLeft).x = fVar14 + (ret->_bottomLeft).x; fVar12 = (ret->_bottomLeft).y; (ret->_bottomRight).x = fVar14 + (ret->_bottomRight).x; (ret->_bottomLeft).y = fVar9 + fVar12; (ret->_bottomRight).y = fVar9 + (ret->_bottomRight).y; } (ret->_topLeft).x = (layer->_cropOffset).x + (ret->_topLeft).x; (ret->_topLeft).y = (layer->_cropOffset).y + (ret->_topLeft).y; (ret->_topRight).x = (ret->_topRight).x + (layer->_cropOffset).x; (ret->_topRight).y = (layer->_cropOffset).y + (ret->_topRight).y; (ret->_bottomLeft).x = (layer->_cropOffset).x + (ret->_bottomLeft).x; (ret->_bottomLeft).y = (layer->_cropOffset).y + (ret->_bottomLeft).y; (ret->_bottomRight).x = (layer->_cropOffset).x + (ret->_bottomRight).x; (ret->_bottomRight).y = (layer->_cropOffset).y + (ret->_bottomRight).y; return ret; } //@@ 00409cb0 render_build_sprite_quad /* DB: ? called by AnimationLayer::RenderFrame, Game::Render, Entity_Player::Update/Render; flips via sign bit from layer flags (+0x100/+0x101), KColor::SetFromARGB then FUN_00a10950/FUN_00a10760 quad submit prototype: db/protos.zhl, confirmed by RET 28 */ void * render_build_sprite_quad (void *outQuad,Vector *position,void *frame,LayerState *layer,Vector *cropTopLeft, Vector *cropBottomRight,ANM2 *anm2) { KColor *color; void *this; float fVar1; float fVar2; byte local_4e; float local_4c; float local_48; Vector local_44; float local_3c; float local_38; Vector local_34; float local_2c; float local_28; float local_24; float local_20; KColor local_1c; local_4e = anm2->_flipY; if (DAT_00c7977d != '\0') { local_4e = local_4e == 0; } fVar2 = (layer->_size).x; local_20 = (anm2->_scale).y; local_38 = anm2->_rotation; local_4c = *(float *)((int)frame + 0x20); local_28 = *(float *)((int)frame + 0x1c) * (layer->_size).y; local_2c = *(float *)((int)frame + 0x18) * fVar2; local_48 = *(float *)((int)frame + 0x24); local_3c = *(float *)((int)frame + 0x5c) + layer->_rotation; local_44.x = *(float *)((int)frame + 0x10) + (layer->_pos).x + (anm2->_offset).x; fVar1 = *(float *)((int)frame + 0x14) + (layer->_pos).y + (anm2->_offset).y; local_24 = (anm2->_scale).x; if (((anm2->_bitflags | layer->_bitflags) & 8U) != 0) { local_24 = fVar2 * (anm2->_scale).x; local_20 = (layer->_size).y * (anm2->_scale).y; local_2c = *(float *)((int)frame + 0x18); local_28 = *(float *)((int)frame + 0x1c); } if (layer->_flipX != 0) { local_2c = -local_2c; } if (anm2->_flipX != 0) { local_24 = -local_24; } if (local_24 < 0.0) { local_24 = -local_24; local_3c = -local_3c; local_38 = -local_38; local_44.x = -local_44.x; local_4c = *(float *)((int)frame + 8) - *(float *)((int)frame + 0x20); } if (local_2c < 0.0) { local_2c = -local_2c; local_4c = *(float *)((int)frame + 8) - local_4c; } if (layer->_flipY != 0) { local_28 = -local_28; } if (local_4e != 0) { local_20 = -local_20; } if (local_20 < 0.0) { local_20 = -local_20; local_48 = *(float *)((int)frame + 0xc) - *(float *)((int)frame + 0x24); local_3c = -local_3c; local_38 = -local_38; fVar1 = -fVar1; } if (local_28 < 0.0) { local_28 = -local_28; local_48 = *(float *)((int)frame + 0xc) - local_48; } fVar2 = g_vectorZero.x; local_34.y = g_vectorZero.y; if ((g_game != (Game *)0x0) && (DAT_00c33910 != '\0')) { fVar2 = (g_game->_screenShakeOffset).x; local_34.y = (g_game->_screenShakeOffset).y; } fVar2 = fVar2 + position->x; local_34.y = local_34.y + position->y; local_34.x = fVar2 + local_44.x; local_44.x = fVar2 + (anm2->_offset).x; local_44.y = local_34.y + (anm2->_offset).y; local_34.y = local_34.y + fVar1; local_4c = local_34.x - local_4c; local_48 = local_34.y - local_48; fVar2 = local_28; fVar1 = local_2c; KColor::SetFromARGB(&local_1c,0xffffffff); render_quad_set_uniform_color (outQuad,cropTopLeft->x / fVar1 + local_4c,cropTopLeft->y / fVar2 + local_48, (local_4c + *(float *)((int)frame + 8)) - cropBottomRight->x / fVar1, (local_48 + *(float *)((int)frame + 0xc)) - cropBottomRight->y / fVar2,color); Quad::scale(&local_34,&local_2c); Quad::scale(&local_44,&local_24); Quad::rotate(this,&local_34,local_3c * 0.017453292); Quad::rotate(outQuad,&local_44,local_38 * 0.017453292); return outQuad; } //@@ 0040a030 AnimationState::Render /* ZHL [exact] void Render(const Vector& position, const Vector& topLeftClamp, const Vector& bottomRightClamp); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall AnimationState::Render (AnimationState *this,Vector *position,Vector *topLeftClamp,Vector *bottomRightClamp) { void *pvVar1; int iVar2; uint uVar3; pvVar1 = this->_animData; if ((pvVar1 != (void *)0x0) && (uVar3 = 0, *(int *)((int)pvVar1 + 0x1c) != 0)) { iVar2 = 0; do { AnimationLayer::RenderFrame ((AnimationLayer *)(*(int *)((int)pvVar1 + 0x18) + iVar2),position, *(int *)((int)this->_layerFrames + uVar3 * 4),topLeftClamp,bottomRightClamp, this->_animation); pvVar1 = this->_animData; uVar3 = uVar3 + 1; iVar2 = iVar2 + 0x10; } while (uVar3 < *(uint *)((int)pvVar1 + 0x1c)); } return; } //@@ 0040a080 FUN_0040a080 void FUN_0040a080(int param_1,Vector *param_2,Vector *param_3,Vector *param_4) { int iVar1; int iVar2; undefined4 *in_ECX; iVar1 = in_ECX[1]; if ((((iVar1 != 0) && (-1 < param_1)) && (param_1 < ((ANM2 *)*in_ECX)->_layerCount)) && (iVar2 = *(int *)(iVar1 + 0x38 + param_1 * 4), -1 < iVar2)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)(iVar1 + 0x18)),param_2, *(int *)(in_ECX[2] + iVar2 * 4),param_3,param_4,(ANM2 *)*in_ECX); } return; } //@@ 0040a0d0 ANM2::Render /* ZHL [exact] __thiscall void ANM2::Render(Vector* position,Vector* topleftclamp,Vector* bottomrightclamp); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall ANM2::Render(ANM2 *this,Vector *position,Vector *topleftclamp,Vector *bottomrightclamp) { if (this->_loaded != 0) { if (this->_overlayRenderFirst != 0) { AnimationState::Render(&this->_overlayAnimState,position,topleftclamp,bottomrightclamp); AnimationState::Render(&this->_animState,position,topleftclamp,bottomrightclamp); return; } AnimationState::Render(&this->_animState,position,topleftclamp,bottomrightclamp); AnimationState::Render(&this->_overlayAnimState,position,topleftclamp,bottomrightclamp); } return; } //@@ 0040a140 Sprite::RenderLayer /* ZHL [lua] Lua binding Sprite:RenderLayer prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Sprite::RenderLayer(Sprite *this,int layerId,Vector *position,Vector *topLeftClamp, Vector *bottomRightClamp) { if (this->_loaded != 0) { if (this->_overlayRenderFirst != 0) { FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); return; } FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); } return; } //@@ 0040a1b0 AnimationState::Rewind /* DB: src/anm2 decompile labels (AnimationState::Rewind) prototype: REPENTOGON */ void __thiscall AnimationState::Rewind(AnimationState *this) { void *pvVar1; uint uVar2; this->_animFrame = 0.0; this->_currentlyTriggeredEvents = 0; this->_previouslyTriggeredEvents = 0; FireTriggersAtCurrentFrame(); pvVar1 = this->_animData; uVar2 = 0; if (*(int *)((int)pvVar1 + 0x1c) != 0) { do { *(undefined4 *)((int)this->_layerFrames + uVar2 * 4) = 0; uVar2 = uVar2 + 1; pvVar1 = this->_animData; } while (uVar2 < *(uint *)((int)pvVar1 + 0x1c)); } uVar2 = 0; if (*(int *)((int)pvVar1 + 0x24) != 0) { do { *(undefined4 *)((int)this->_nullLayerFrames + uVar2 * 4) = 0; uVar2 = uVar2 + 1; } while (uVar2 < *(uint *)((int)this->_animData + 0x24)); } return; } //@@ 0040a220 AnimationState::GetLayerFrame /* DB: src/anm2 decompile labels (AnimationState::GetLayerFrame(layer)->AnimationFrame*) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall AnimationState::GetLayerFrame(AnimationState *this,int layerId) { void *pvVar1; int iVar2; int iVar3; if (this->_animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if ((layerId < 0) || (*(int *)((int)this->_animation + 0x80) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } pvVar1 = this->_animData; if ((((pvVar1 == (void *)0x0) || (layerId < 0)) || (*(int *)((int)this->_animation + 0x80) < layerId)) || (((iVar3 = *(int *)((int)pvVar1 + layerId * 4 + 0x38), iVar3 < 0 || (*(int *)((int)pvVar1 + 0x1c) <= iVar3)) || ((iVar2 = *(int *)((int)this->_layerFrames + iVar3 * 4), iVar2 < 0 || (iVar3 = iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18), *(int *)(iVar3 + 8) <= iVar2)))))) { return (void *)0x0; } return (void *)(iVar2 * 0x6c + *(int *)(iVar3 + 4)); } //@@ 0040a2b0 Sprite::PlayRandom /* ZHL [lua] Lua binding Sprite:PlayRandom */ void Sprite::PlayRandom(uint param_1) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; ANM2 *in_ECX; byte *pbVar5; byte *anim; bool bVar6; if (in_ECX->_animCount == 0) { KAGE_LogMessage(1,(byte *)"[warn] PlayRandom: no animations\n"); return; } anim = (byte *)((param_1 % (uint)in_ECX->_animCount) * 0x13c + (int)in_ECX->_animData); if (0xf < *(uint *)(anim + 0x14)) { anim = *(byte **)anim; } pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = anim; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_0040a320: uVar4 = -(uint)bVar6 | 1; goto LAB_0040a325; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_0040a320; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0040a325: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((in_ECX->_animState)._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(in_ECX,anim,1); if (bVar2 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } return; } //@@ 0040a360 Sprite::Play /* ZHL [lua] Lua binding Sprite:Play */ void Sprite::Play(byte *param_1,byte param_2) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::Play(in_ECX,param_1,param_2); return; } //@@ 0040a380 ANM2::Play /* ZHL [exact] __thiscall void ANM2::Play(const char* anim, bool reset); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ANM2::Play(ANM2 *this,byte *anim,byte reset) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; byte *pbVar5; bool bVar6; if ((reset == 0) && (pbVar1 = (this->_animState)._animData, pbVar1 != (byte *)0x0)) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = anim; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_0040a3c1: uVar4 = -(uint)bVar6 | 1; goto LAB_0040a3c6; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_0040a3c1; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0040a3c6: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((this->_animState)._isPlaying != 0) { return; } } } bVar2 = SetAnimation(this,anim,1); if (bVar2 != 0) { AnimationState::Rewind(&this->_animState); (this->_animState)._isPlaying = 1; } return; } //@@ 0040a400 FUN_0040a400 void FUN_0040a400(int param_1) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; ANM2 *in_ECX; byte *pbVar5; byte *anim; bool bVar6; if ((param_1 < 0) || (in_ECX->_animCount <= param_1)) { KAGE_LogMessage(1,(byte *)"[warn] Animation index out of range!\n"); } else { anim = (byte *)(param_1 * 0x13c + (int)in_ECX->_animData); if (0xf < *(uint *)(anim + 0x14)) { anim = *(byte **)anim; } pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = anim; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_0040a458: uVar4 = -(uint)bVar6 | 1; goto LAB_0040a45d; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_0040a458; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0040a45d: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((in_ECX->_animState)._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(in_ECX,anim,1); if (bVar2 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; return; } } return; } //@@ 0040a4b0 Sprite::IsPlaying /* ZHL [lua] Lua binding Sprite:IsPlaying */ void Sprite::IsPlaying(byte *param_1) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::IsPlaying(in_ECX,param_1); return; } //@@ 0040a4d0 ANM2::IsPlaying /* DB: compares name vs animState._animData name, checks _isPlaying (0x44); wrapped by Sprite::IsPlaying prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall ANM2::IsPlaying(ANM2 *this,byte *name) { byte bVar1; byte *pbVar2; uint uVar3; bool bVar4; pbVar2 = (this->_animState)._animData; if ((pbVar2 == (byte *)0x0) || ((this->_animState)._isPlaying == 0)) { return 0; } if (*name != 0) { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } do { bVar1 = *pbVar2; bVar4 = bVar1 < *name; if (bVar1 != *name) { LAB_0040a510: uVar3 = -(uint)bVar4 | 1; goto LAB_0040a515; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar4 = bVar1 < name[1]; if (bVar1 != name[1]) goto LAB_0040a510; pbVar2 = pbVar2 + 2; name = name + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040a515: if (uVar3 != 0) { return 0; } } return 1; } //@@ 0040a530 Sprite::IsFinished /* ZHL [lua] Lua binding Sprite:IsFinished */ void Sprite::IsFinished(byte *param_1) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::IsFinishedImpl(in_ECX,param_1); return; } //@@ 0040a550 ANM2::IsFinishedImpl /* DB: body of Sprite::IsFinished thunk; animData null/!isPlaying + name compare prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall ANM2::IsFinishedImpl(ANM2 *this,byte *animName) { byte bVar1; byte *pbVar2; uint uVar3; bool bVar4; pbVar2 = (this->_animState)._animData; if (pbVar2 == (byte *)0x0) { bVar4 = *animName == 0; } else { if ((this->_animState)._isPlaying != 0) { return 0; } if (*animName == 0) { return 1; } if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } do { bVar1 = *pbVar2; bVar4 = bVar1 < *animName; if (bVar1 != *animName) { LAB_0040a598: uVar3 = -(uint)bVar4 | 1; goto LAB_0040a59d; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar4 = bVar1 < animName[1]; if (bVar1 != animName[1]) goto LAB_0040a598; pbVar2 = pbVar2 + 2; animName = animName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040a59d: bVar4 = uVar3 == 0; } if (bVar4) { return 1; } return 0; } //@@ 0040a5b0 Sprite::SetAnimation /* ZHL [lua] Lua binding Sprite:SetAnimation */ void Sprite::SetAnimation(byte *param_1,byte param_2) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::SetAnimation(in_ECX,param_1,param_2); return; } //@@ 0040a5d0 ANM2::SetAnimation /* DB: src/anm2 decompile labels (ANM2::SetAnimation(cstr,reset)) prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall ANM2::SetAnimation(ANM2 *this,byte *anim,byte reset) { byte bVar1; byte *pbVar2; uint uVar3; byte *pbVar4; byte *pbVar5; uint uVar6; bool bVar7; uVar6 = 0; if (this->_animCount != 0) { pbVar5 = this->_animData; do { pbVar2 = pbVar5; pbVar4 = anim; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar2 = *(byte **)pbVar5; } do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_0040a620: uVar3 = -(uint)bVar7 | 1; goto LAB_0040a625; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_0040a620; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040a625: if (uVar3 == 0) { pbVar5 = (byte *)((int)this->_animData + uVar6 * 0x13c); if (reset == 0) { AnimationState::ChangeAnimationKeepFrame(&this->_animState,pbVar5); return 1; } AnimationState::SetAnimationData(&this->_animState,pbVar5); return 1; } uVar6 = uVar6 + 1; pbVar5 = pbVar5 + 0x13c; } while (uVar6 < (uint)this->_animCount); } KAGE_LogMessage(1,(byte *)"[warn] no animation named %s\n"); return 0; } //@@ 0040a690 ANM2::SetFrame /* ZHL [exact] __thiscall void ANM2::SetFrame(std_string* anim, int frame); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ANM2::SetFrame(ANM2 *this,std_string *anim,int frame) { byte bVar1; if (0xf < anim->_capacity) { anim = *(std_string **)anim->_buf; } bVar1 = SetAnimation(this,(byte *)anim,1); if ((bVar1 != 0) && ((this->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&this->_animState,(float)frame); if ((this->_animState)._animData != (void *)0x0) { (this->_animState)._isPlaying = 0; } } return; } //@@ 0040a6e0 ANM2::SetFrame /* DB: SetAnimation(name) then AnimationState::SetFrameFloat and clears playing flag; ZHL ANM2::SetFrame(anim, frame) prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ANM2::SetFrame(ANM2 *this,std_string *anim,int frame) { byte bVar1; bVar1 = SetAnimation(this,(byte *)anim,1); if ((bVar1 != 0) && ((this->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&this->_animState,(float)frame); if ((this->_animState)._animData != (void *)0x0) { (this->_animState)._isPlaying = 0; } } return; } //@@ 0040a720 Sprite::SetFrame_1 /* ZHL [lua] Lua binding Sprite:SetFrame_1 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Sprite::SetFrame_1(Sprite *this,int frame) { if ((this->_animState)._animData != (void *)0x0) { AnimationState::SetFrameFloat(&this->_animState,(float)frame); } return; } //@@ 0040a740 FUN_0040a740 void FUN_0040a740(void) { int in_ECX; float in_XMM1_Da; if (*(int *)(in_ECX + 0x34) != 0) { AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x30),in_XMM1_Da); } return; } //@@ 0040a760 Sprite::SetLastFrame /* ZHL [lua] Lua binding Sprite:SetLastFrame prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Sprite::SetLastFrame(Sprite *this) { if ((this->_animState)._animData != (void *)0x0) { AnimationState::AdvancePosition (&this->_animState,*(int *)((int)(this->_animState)._animData + 0x30) + -1); } return; } //@@ 0040a780 ANM2::GetFrame /* ZHL [exact] __thiscall int ANM2::GetFrame(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall ANM2::GetFrame(ANM2 *this) { double dVar1; if ((this->_animState)._animData == (void *)0x0) { return -1; } dVar1 = floor((double)(this->_animState)._animFrame); return (int)dVar1; } //@@ 0040a7c0 _empty_check_0x34 /* DB: ? ? empty body, ICF */ void _empty_check_0x34(void) { int in_ECX; if (*(int *)(in_ECX + 0x34) == 0) { return; } return; } //@@ 0040a7e0 ANM2::SetLayerFrame /* ZHL [exact] __thiscall void ANM2::SetLayerFrame(int layerid,int frame); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ANM2::SetLayerFrame(ANM2 *this,int layerid,int frame) { AnimationState *this_00; void *pvVar1; int layerId; if ((this->_animState)._animData != (void *)0x0) { this_00 = &this->_animState; if (((layerid < 0) || (*(int *)((int)this_00->_animation + 0x80) <= layerid)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), layerid < 0)) { return; } if (layerid < *(int *)((int)this_00->_animation + 0x80)) { pvVar1 = (this->_animState)._animData; layerId = *(int *)((int)pvVar1 + layerid * 4 + 0x38); if (((pvVar1 == (void *)0x0) || (layerId < 0)) || (*(int *)((int)pvVar1 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_animState)._layerFrames + layerId * 4) = 0; AnimationState::AdvanceLayerPosition(this_00,layerId,(float)frame); } } return; } //@@ 0040a860 FUN_0040a860 void FUN_0040a860(byte *param_1,int param_2) { LayerState *pLVar1; ANM2 *in_ECX; pLVar1 = ANM2::GetLayer(in_ECX,param_1); if (pLVar1 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); return; } ANM2::SetLayerFrame(in_ECX,*(int *)pLVar1->_layerData,param_2); return; } //@@ 0040a8a0 FUN_0040a8a0 undefined4 FUN_0040a8a0(int param_1) { int in_ECX; if (*(int *)(in_ECX + 0x34) == 0) { return 0xffffffff; } if (((param_1 < 0) || (*(int *)(*(int *)(in_ECX + 0x30) + 0x80) <= param_1)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), param_1 < 0)) { return 0; } if (param_1 < *(int *)(*(int *)(in_ECX + 0x30) + 0x80)) { return *(undefined4 *) (*(int *)(in_ECX + 0x38) + *(int *)(*(int *)(in_ECX + 0x34) + 0x38 + param_1 * 4) * 4); } return 0; } //@@ 0040a910 Sprite::Stop /* ZHL [lua] Lua binding Sprite:Stop */ void __thiscall Sprite::Stop(Sprite *this) { if ((this->_animState)._animData != (void *)0x0) { (this->_animState)._isPlaying = 0; } return; } //@@ 0040a920 Sprite::PlayOverlay /* ZHL [lua] Lua binding Sprite:PlayOverlay */ void Sprite::PlayOverlay(byte *param_1,byte param_2) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::PlayOverlay(in_ECX,param_1,param_2); return; } //@@ 0040a940 ANM2::PlayOverlay /* DB: Sprite::PlayOverlay wrapper; compares current overlay name, force flag prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall ANM2::PlayOverlay(ANM2 *this,byte *animName,byte isForce) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; byte *pbVar5; bool bVar6; if ((isForce == 0) && (pbVar1 = (this->_overlayAnimState)._animData, pbVar1 != (byte *)0x0)) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = animName; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_0040a981: uVar4 = -(uint)bVar6 | 1; goto LAB_0040a986; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_0040a981; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0040a986: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((this->_overlayAnimState)._isPlaying != 0) { return; } } } bVar2 = SetOverlayAnimation(this,animName,1); if (bVar2 != 0) { AnimationState::Rewind(&this->_overlayAnimState); (this->_overlayAnimState)._isPlaying = 1; } return; } //@@ 0040a9c0 FUN_0040a9c0 void FUN_0040a9c0(void) { int in_ECX; if (*(int *)(in_ECX + 0x54) != 0) { *(undefined1 *)(in_ECX + 100) = 0; } return; } //@@ 0040a9d0 Sprite::IsOverlayPlaying /* ZHL [lua] Lua binding Sprite:IsOverlayPlaying */ void Sprite::IsOverlayPlaying(void) { FUN_0040a9f0(); return; } //@@ 0040a9f0 FUN_0040a9f0 uint FUN_0040a9f0(byte *param_1) { byte bVar1; byte *pbVar2; byte *pbVar3; int in_ECX; bool bVar4; pbVar2 = *(byte **)(in_ECX + 0x54); if ((pbVar2 == (byte *)0x0) || (*(char *)(in_ECX + 100) == '\0')) { LAB_0040aa3f: return (uint)pbVar2 & 0xffffff00; } pbVar3 = pbVar2; if (*param_1 != 0) { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } do { bVar1 = *pbVar2; bVar4 = bVar1 < *param_1; if (bVar1 != *param_1) { LAB_0040aa30: pbVar2 = (byte *)(-(uint)bVar4 | 1); goto LAB_0040aa35; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar4 = bVar1 < param_1[1]; if (bVar1 != param_1[1]) goto LAB_0040aa30; pbVar2 = pbVar2 + 2; param_1 = param_1 + 2; } while (bVar1 != 0); pbVar2 = (byte *)0x0; LAB_0040aa35: pbVar3 = (byte *)0x0; if (pbVar2 != (byte *)0x0) goto LAB_0040aa3f; } return CONCAT31((int3)((uint)pbVar3 >> 8),1); } //@@ 0040aa50 Sprite::IsOverlayFinished /* ZHL [lua] Lua binding Sprite:IsOverlayFinished */ void Sprite::IsOverlayFinished(void) { FUN_0040aa70(); return; } //@@ 0040aa70 FUN_0040aa70 undefined4 FUN_0040aa70(byte *param_1) { byte bVar1; byte *pbVar2; uint uVar3; int in_ECX; bool bVar4; pbVar2 = *(byte **)(in_ECX + 0x54); if (pbVar2 == (byte *)0x0) { bVar4 = *param_1 == 0; } else { if (*(char *)(in_ECX + 100) != '\0') { return 0; } if (*param_1 == 0) { return 1; } if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } do { bVar1 = *pbVar2; bVar4 = bVar1 < *param_1; if (bVar1 != *param_1) { LAB_0040aab8: uVar3 = -(uint)bVar4 | 1; goto LAB_0040aabd; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar4 = bVar1 < param_1[1]; if (bVar1 != param_1[1]) goto LAB_0040aab8; pbVar2 = pbVar2 + 2; param_1 = param_1 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040aabd: bVar4 = uVar3 == 0; } if (bVar4) { return 1; } return 0; } //@@ 0040aad0 Sprite::SetOverlayAnimation /* ZHL [lua] Lua binding Sprite:SetOverlayAnimation */ void Sprite::SetOverlayAnimation(byte *param_1,byte param_2) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::SetOverlayAnimation(in_ECX,param_1,param_2); return; } //@@ 0040aaf0 ANM2::SetOverlayAnimation /* DB: finds anim by name in animData list, "[warn] no animation named"; called by Sprite::SetOverlayAnimation/SetOverlayFrame prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall ANM2::SetOverlayAnimation(ANM2 *this,byte *anim,byte reset) { byte bVar1; byte *pbVar2; uint uVar3; byte *pbVar4; byte *pbVar5; uint uVar6; bool bVar7; uVar6 = 0; if (this->_animCount != 0) { pbVar5 = this->_animData; do { pbVar2 = pbVar5; pbVar4 = anim; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar2 = *(byte **)pbVar5; } do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_0040ab40: uVar3 = -(uint)bVar7 | 1; goto LAB_0040ab45; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_0040ab40; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040ab45: if (uVar3 == 0) { pbVar5 = (byte *)((int)this->_animData + uVar6 * 0x13c); if (reset == 0) { AnimationState::ChangeAnimationKeepFrame(&this->_overlayAnimState,pbVar5); return 1; } AnimationState::SetAnimationData(&this->_overlayAnimState,pbVar5); return 1; } uVar6 = uVar6 + 1; pbVar5 = pbVar5 + 0x13c; } while (uVar6 < (uint)this->_animCount); } KAGE_LogMessage(1,(byte *)"[warn] no animation named %s\n"); return 0; } //@@ 0040abb0 Sprite::SetOverlayFrame /* ZHL [lua] Lua binding Sprite:SetOverlayFrame */ void Sprite::SetOverlayFrame(byte *param_1,int param_2) { byte bVar1; ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } bVar1 = ANM2::SetOverlayAnimation(in_ECX,param_1,1); if ((bVar1 != 0) && ((in_ECX->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&in_ECX->_overlayAnimState,(float)param_2); } return; } //@@ 0040abf0 ANM2::SetOverlayFrame /* ZHL [exact] __thiscall void ANM2::SetOverlayFrame(const char* anim, int frame); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ANM2::SetOverlayFrame(ANM2 *this,byte *anim,int frame) { byte bVar1; bVar1 = SetOverlayAnimation(this,anim,1); if ((bVar1 != 0) && ((this->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&this->_overlayAnimState,(float)frame); } return; } //@@ 0040ac30 ANM2::SetOverlayFrame /* ZHL [exact] __thiscall void ANM2::SetOverlayFrame(int frame); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ANM2::SetOverlayFrame(ANM2 *this,int frame) { if ((this->_overlayAnimState)._animData != (void *)0x0) { AnimationState::SetFrameFloat(&this->_overlayAnimState,(float)frame); } return; } //@@ 0040ac50 Sprite::GetOverlayFrame /* ZHL [lua] Lua binding Sprite:GetOverlayFrame */ int __thiscall Sprite::GetOverlayFrame(Sprite *this) { if ((this->_overlayAnimState)._animData == (void *)0x0) { return -1; } return (int)(this->_overlayAnimState)._animFrame; } //@@ 0040ac60 Sprite::RemoveOverlay /* ZHL [lua] Lua binding Sprite:RemoveOverlay */ void __thiscall Sprite::RemoveOverlay(Sprite *this) { AnimationState::SetAnimationData(&this->_overlayAnimState,(void *)0x0); return; } //@@ 0040ac70 AnimationState::GetNullFrameById /* DB: ? "AnimationData is NULL"; finds layer by id and returns current frame (0x54 stride) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall AnimationState::GetNullFrameById(AnimationState *this,int nullLayerId) { int iVar1; void *pvVar2; int *piVar3; uint uVar4; int *piVar5; pvVar2 = this->_animData; if (pvVar2 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); pvVar2 = this->_animData; } uVar4 = 0; if (*(uint *)((int)pvVar2 + 0x24) != 0) { piVar5 = this->_nullLayerFrames; piVar3 = *(int **)((int)pvVar2 + 0x20); do { if (((*piVar3 == nullLayerId) && (iVar1 = *piVar5, -1 < iVar1)) && (iVar1 < piVar3[3])) { return (void *)(iVar1 * 0x54 + piVar3[2]); } uVar4 = uVar4 + 1; piVar3 = piVar3 + 4; piVar5 = piVar5 + 1; } while (uVar4 < *(uint *)((int)pvVar2 + 0x24)); } return (void *)0x0; } //@@ 0040ace0 AnimationState::GetNullFrame /* ZHL [exact] __thiscall NullFrame* AnimationState::GetNullFrame(const char* nullLayerName); prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall AnimationState::GetNullFrame(AnimationState *this,byte *nullLayerName) { byte bVar1; int iVar2; byte *pbVar3; uint uVar4; void *pvVar5; uint *puVar6; byte *pbVar7; uint uVar8; uint uVar9; byte *pbVar10; int *piVar11; bool bVar12; if (this->_animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } uVar9 = 0; uVar8 = *(uint *)((int)this->_animation + 0x88); if (uVar8 != 0) { pbVar10 = *(byte **)((int)this->_animation + 0x84); do { pbVar3 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar3 = *(byte **)pbVar10; } pbVar7 = nullLayerName; do { bVar1 = *pbVar3; bVar12 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_0040ad50: uVar4 = -(uint)bVar12 | 1; goto LAB_0040ad55; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar12 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_0040ad50; pbVar3 = pbVar3 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_0040ad55: if (uVar4 == 0) { pvVar5 = this->_animData; if (pvVar5 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); pvVar5 = this->_animData; } uVar8 = 0; if (*(uint *)((int)pvVar5 + 0x24) != 0) { puVar6 = *(uint **)((int)pvVar5 + 0x20); piVar11 = this->_nullLayerFrames; do { if (((*puVar6 == uVar9) && (iVar2 = *piVar11, -1 < iVar2)) && (iVar2 < (int)puVar6[3])) { return (void *)(iVar2 * 0x54 + puVar6[2]); } uVar8 = uVar8 + 1; puVar6 = puVar6 + 4; piVar11 = piVar11 + 1; } while (uVar8 < *(uint *)((int)pvVar5 + 0x24)); } return (void *)0x0; } uVar9 = uVar9 + 1; pbVar10 = pbVar10 + 0x18; } while (uVar9 < uVar8); } return (void *)0x0; } //@@ 0040add0 AnimationState::IsEventTriggered /* DB: src/anm2 decompile labels (AnimationState::IsEventTriggered(name)) prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall AnimationState::IsEventTriggered(AnimationState *this,byte *eventName) { byte bVar1; uint uVar2; byte *pbVar3; uint uVar4; byte *pbVar5; byte *pbVar6; uint uVar7; bool bVar8; if (this->_animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } uVar7 = 0; uVar2 = *(uint *)((int)this->_animation + 0x90); if (uVar2 != 0) { pbVar6 = *(byte **)((int)this->_animation + 0x8c); do { pbVar3 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar3 = *(byte **)pbVar6; } pbVar5 = eventName; do { bVar1 = *pbVar3; bVar8 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_0040ae32: uVar4 = -(uint)bVar8 | 1; goto LAB_0040ae37; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar8 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_0040ae32; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_0040ae37: if (uVar4 == 0) { if ((int)uVar7 < 0) { return 0; } return (this->_currentlyTriggeredEvents & 1 << ((byte)uVar7 & 0x1f)) != 0; } uVar7 = uVar7 + 1; pbVar6 = pbVar6 + 0x18; } while (uVar7 < uVar2); } return 0; } //@@ 0040ae70 AnimationState::WasEventTriggered /* DB: src/anm2 decompile labels (AnimationState::WasEventTriggered(name)) prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall AnimationState::WasEventTriggered(AnimationState *this,byte *eventName) { byte bVar1; uint uVar2; byte *pbVar3; uint uVar4; byte *pbVar5; byte *pbVar6; uint uVar7; bool bVar8; if (this->_animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } uVar7 = 0; uVar2 = *(uint *)((int)this->_animation + 0x90); if (uVar2 != 0) { pbVar6 = *(byte **)((int)this->_animation + 0x8c); do { pbVar3 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar3 = *(byte **)pbVar6; } pbVar5 = eventName; do { bVar1 = *pbVar3; bVar8 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_0040aed2: uVar4 = -(uint)bVar8 | 1; goto LAB_0040aed7; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar8 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_0040aed2; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_0040aed7: if (uVar4 == 0) { if ((int)uVar7 < 0) { return 0; } return (this->_previouslyTriggeredEvents & 1 << ((byte)uVar7 & 0x1f)) != 0; } uVar7 = uVar7 + 1; pbVar6 = pbVar6 + 0x18; } while (uVar7 < uVar2); } return 0; } //@@ 0040af10 AnimationState::NextEventTrigger /* ZHL [exact] __thiscall int AnimationState::NextEventTrigger(const char* eventName); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall AnimationState::NextEventTrigger(AnimationState *this,byte *eventName) { byte bVar1; void *pvVar2; int iVar3; byte *pbVar4; uint uVar5; byte *pbVar6; uint uVar7; int iVar8; uint uVar9; byte *pbVar10; int iVar11; int iVar12; bool bVar13; int local_c; if (this->_animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } uVar9 = 0; uVar7 = *(uint *)((int)this->_animation + 0x90); if (uVar7 != 0) { pbVar10 = *(byte **)((int)this->_animation + 0x8c); do { pbVar4 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar4 = *(byte **)pbVar10; } pbVar6 = eventName; do { bVar1 = *pbVar4; bVar13 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_0040af74: uVar5 = -(uint)bVar13 | 1; goto LAB_0040af79; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar13 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_0040af74; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_0040af79: if (uVar5 == 0) { if ((int)uVar9 < 0) { return -1; } iVar12 = -1; uVar7 = 0; local_c = -1; iVar11 = -1; pvVar2 = this->_animData; if (*(int *)((int)pvVar2 + 0x2c) != 0) { do { if (*(uint *)(*(int *)((int)pvVar2 + 0x28) + uVar7 * 8) == uVar9) { iVar3 = *(int *)(*(int *)((int)pvVar2 + 0x28) + 4 + uVar7 * 8); iVar8 = iVar3 - (int)this->_animFrame; iVar12 = local_c; if ((0 < iVar8) && ((iVar11 < 0 || (iVar8 < iVar11)))) { iVar11 = iVar8; iVar12 = iVar3; local_c = iVar3; } } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)((int)pvVar2 + 0x2c)); } return iVar12; } uVar9 = uVar9 + 1; pbVar10 = pbVar10 + 0x18; } while (uVar9 < uVar7); } return -1; } //@@ 0040b000 Sprite::IsEventTriggered /* ZHL [lua] Lua binding Sprite:IsEventTriggered prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Sprite::IsEventTriggered(Sprite *this,void *eventName) { byte bVar1; if (0xf < *(uint *)((int)eventName + 0x14)) { eventName = *(void **)eventName; } if ((this->_animState)._animData == (void *)0x0) { return 0; } bVar1 = AnimationState::IsEventTriggered(&this->_animState,eventName); return bVar1; } //@@ 0040b030 Sprite::IsEventTriggered /* DB: null-checks anm data (+0x34) then AnimationState::IsEventTriggered prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Sprite::IsEventTriggered(Sprite *this,void *eventName) { byte bVar1; if ((this->_animState)._animData == (void *)0x0) { return 0; } bVar1 = AnimationState::IsEventTriggered(&this->_animState,eventName); return bVar1; } //@@ 0040b060 Sprite::WasEventTriggered /* ZHL [lua] Lua binding Sprite:WasEventTriggered */ byte __thiscall Sprite::WasEventTriggered(Sprite *this,byte *param_2) { byte bVar1; if (0xf < *(uint *)(param_2 + 0x14)) { param_2 = *(byte **)param_2; } if ((this->_animState)._animData == (void *)0x0) { return 0; } bVar1 = AnimationState::WasEventTriggered(&this->_animState,param_2); return bVar1; } //@@ 0040b090 ANM2::WasEventTriggered /* DB: null-checks anim state at +0x34 then AnimationState::WasEventTriggered prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall ANM2::WasEventTriggered(ANM2 *this,byte *eventName) { byte bVar1; if ((this->_animState)._animData == (void *)0x0) { return 0; } bVar1 = AnimationState::WasEventTriggered(&this->_animState,eventName); return bVar1; } //@@ 0040b0c0 ANM2::GetNullFrame /* DB: string "[warn] ANM2::GetNullFrame frame number %d out of bounds."; finds the animation (FUN_0040bcd0), looks up null layer name in the names vector (+0x84, 0x18-byte strings) and returns its frame; Entity_Player::GetCostumeNullPos */ int __thiscall ANM2::GetNullFrame(ANM2 *this,byte *param_2,byte *param_3,int param_4) { byte bVar1; void *pvVar2; byte *pbVar3; uint uVar4; byte *pbVar5; uint uVar6; uint *puVar7; uint uVar8; uint uVar9; bool bVar10; pvVar2 = GetAnimationData(this,param_2); if (pvVar2 != (void *)0x0) { uVar9 = 0; if (this->_numNullLayers != 0) { uVar8 = 0xffffffff; do { pbVar3 = (byte *)((int)this->_nullLayerNames + uVar9 * 0x18); if (0xf < *(uint *)((int)this->_nullLayerNames + uVar9 * 0x18 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar5 = param_3; do { bVar1 = *pbVar3; bVar10 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_0040b132: uVar6 = -(uint)bVar10 | 1; goto LAB_0040b137; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar10 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_0040b132; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0040b137: uVar4 = uVar9; if (uVar6 != 0) { uVar4 = uVar8; } uVar9 = uVar9 + 1; uVar8 = uVar4; } while (uVar9 < (uint)this->_numNullLayers); if (-1 < (int)uVar4) { uVar9 = 0; if (*(uint *)((int)pvVar2 + 0x24) != 0) { puVar7 = *(uint **)((int)pvVar2 + 0x20); do { if (((*puVar7 == uVar4) && (-1 < param_4)) && (param_4 < (int)puVar7[3])) { return param_4 * 0x54 + puVar7[2]; } uVar9 = uVar9 + 1; puVar7 = puVar7 + 4; } while (uVar9 < *(uint *)((int)pvVar2 + 0x24)); } KAGE_LogMessage(1,(byte *)"[warn] ANM2::GetNullFrame frame number %d out of bounds.\n"); } } } return 0; } //@@ 0040b1a0 ANM2::GetLayerFrame /* DB: null animData guard then AnimationState layer frame lookup (0x54 stride) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall ANM2::GetLayerFrame(ANM2 *this,int nullLayerId) { void *pvVar1; if ((this->_animState)._animData == (void *)0x0) { return (void *)0x0; } pvVar1 = AnimationState::GetNullFrameById(&this->_animState,nullLayerId); return pvVar1; } //@@ 0040b1d0 Sprite::GetNullFrame /* DB: null-checks anm data then AnimationState::GetNullFrame(this+0x30) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall Sprite::GetNullFrame(Sprite *this,byte *nullLayerName) { void *pvVar1; if ((this->_animState)._animData == (void *)0x0) { return (void *)0x0; } pvVar1 = AnimationState::GetNullFrame(&this->_animState,nullLayerName); return pvVar1; } //@@ 0040b200 Sprite::GetLayer /* DB: thunk to ANM2::GetLayer on same this prototype: db/protos.zhl, confirmed by RET 4 */ LayerState * __thiscall Sprite::GetLayer(Sprite *this,byte *layerName) { LayerState *pLVar1; pLVar1 = ANM2::GetLayer((ANM2 *)this,layerName); return pLVar1; } //@@ 0040b220 ANM2::GetLayer /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall LayerState* ANM2::GetLayer(int layer); prototype: REPENTOGON, confirmed by RET 4 */ LayerState * __thiscall ANM2::GetLayer(ANM2 *this,byte *layerName) { uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0c31; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (((-1 < (int)layerName) && ((int)layerName < this->_layerCount)) || ((KAGE_LogMessage(0x10,(byte *)"%s: No layer with Id %d\n"), -1 < (int)layerName && ((int)layerName < this->_layerCount)))) { ExceptionList = local_10; return (LayerState *)((int)layerName * 0xa0 + (int)this->_layerState); } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < _DAT_00c7f628) && (_Init_thread_header(&DAT_00c7f628,uVar1), _DAT_00c7f628 == -1)) { uStack_8 = 0; LayerState::LayerState((LayerState *)0xc7f630); _atexit(FUN_00b15190); _Init_thread_footer(&DAT_00c7f628); } ExceptionList = local_10; return (LayerState *)0xc7f630; } //@@ 0040b310 ANM2::get_layer_by_string /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: linear search of _layerState (+0x7c, count +0x80, stride 0xa0) comparing layer name with a std::string, returns LayerState* or 0 (the byte* overload is ANM2::GetLayer); RichTextIcon::render/get_size */ void * __thiscall ANM2::get_layer_by_string(ANM2 *this,byte *param_2) { int iVar1; byte ****ppppbVar2; uint uVar3; byte bVar4; byte *b; byte ****ppppbVar5; uint uVar6; uint size; int local_2c; byte ****local_24 [4]; uint local_14; uint local_10; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); uVar6 = 0; if (this->_layerCount != 0) { local_2c = 0; do { iVar1 = *(int *)(local_2c + (int)this->_layerState); if (iVar1 == 0) { local_24[0] = (byte ****)0x0; local_10 = 0xf; local_14 = 0; } else { std::string::string((char *)local_24,(void *)(iVar1 + 8)); } uVar3 = local_10; ppppbVar2 = local_24[0]; b = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { b = *(byte **)param_2; } ppppbVar5 = (byte ****)local_24; if (0xf < local_10) { ppppbVar5 = local_24[0]; } bVar4 = str_eq((byte *)ppppbVar5,local_14,b,*(uint *)(param_2 + 0x10)); if (0xf < uVar3) { size = uVar3 + 1; ppppbVar5 = ppppbVar2; if (0xfff < size) { ppppbVar5 = (byte ****)ppppbVar2[-1]; size = uVar3 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbVar2 + (-4 - (int)ppppbVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar5,size); } if (bVar4 != 0) { return (void *)(uVar6 * 0xa0 + (int)this->_layerState); } uVar6 = uVar6 + 1; local_2c = local_2c + 0xa0; } while (uVar6 < (uint)this->_layerCount); } return (void *)0x0; } //@@ 0040b430 ANM2::GetLayer /* ZHL [exact] __thiscall LayerState* ANM2::GetLayer(const char* layerName); prototype: REPENTOGON, confirmed by RET 4 */ LayerState * __thiscall ANM2::GetLayer(ANM2 *this,byte *layerName) { byte bVar1; int iVar2; byte *pbVar3; uint uVar4; byte *pbVar5; uint uVar6; int *piVar7; bool bVar8; uVar6 = 0; if (this->_layerCount != 0) { piVar7 = this->_layerState; do { iVar2 = *piVar7; if (iVar2 == 0) { pbVar3 = &s_empty; } else { pbVar3 = (byte *)(iVar2 + 8); if (0xf < *(uint *)(iVar2 + 0x1c)) { pbVar3 = *(byte **)pbVar3; } } pbVar5 = layerName; do { bVar1 = *pbVar3; bVar8 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_0040b490: uVar4 = -(uint)bVar8 | 1; goto LAB_0040b495; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar8 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_0040b490; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_0040b495: if (uVar4 == 0) { return (LayerState *)((int)this->_layerState + uVar6 * 0x28 * 4); } uVar6 = uVar6 + 1; piVar7 = piVar7 + 0x28; } while (uVar6 < (uint)this->_layerCount); } return (LayerState *)0x0; } //@@ 0040b4d0 FUN_0040b4d0 int FUN_0040b4d0(int param_1) { int in_ECX; if ((param_1 < 0) || (*(int *)(in_ECX + 0x88) <= param_1)) { KAGE_LogMessage(0x10,(byte *)"%s: No null with Id %d\n"); } return *(int *)(in_ECX + 0x84) + param_1 * 0x18; } //@@ 0040b520 AnimationData::find_null_index /* DB: ECX anm2 data: linear search of the null-layer name strings (+0x84 array of 0x18-byte strings, count +0x88) for arg name, returns index or -1; Menu_OnlineLobby::Render feeds "WinStreakNum"/"BestStreakNum" into AnimationState::SetNullLayerFrame, Entity_NPC::Render uses it on the status-effect sprite; neighbour logs "%s: No null with Id %d" */ int AnimationData::find_null_index(byte *param_1) { byte bVar1; byte *pbVar2; uint uVar3; int in_ECX; byte *pbVar4; byte *pbVar5; int iVar6; bool bVar7; iVar6 = 0; if (0 < *(int *)(in_ECX + 0x88)) { pbVar5 = *(byte **)(in_ECX + 0x84); do { pbVar2 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar2 = *(byte **)pbVar5; } pbVar4 = param_1; do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_0040b565: uVar3 = -(uint)bVar7 | 1; goto LAB_0040b56a; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_0040b565; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040b56a: if (uVar3 == 0) { return iVar6; } iVar6 = iVar6 + 1; pbVar5 = pbVar5 + 0x18; } while (iVar6 < *(int *)(in_ECX + 0x88)); } return -1; } //@@ 0040b590 Sprite::GetTexel /* ZHL [lua] Lua binding Sprite:GetTexel */ undefined4 * Sprite::GetTexel(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,float param_6,undefined4 param_7) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *puVar4; undefined1 local_1c [24]; ANM2::GetTexel(param_1,param_7,param_2,param_3,param_4,param_5); if ((float)param_1[3] <= param_6 && param_6 != (float)param_1[3]) { puVar4 = (undefined4 *)ANM2::GetTexel(local_1c,param_7,param_2,param_3,param_4,param_5); uVar1 = puVar4[1]; uVar2 = puVar4[2]; uVar3 = puVar4[3]; *param_1 = *puVar4; param_1[1] = uVar1; param_1[2] = uVar2; param_1[3] = uVar3; param_1[4] = puVar4[4]; } return param_1; } //@@ 0040b600 ANM2::GetTexel /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? worker of the Lua Sprite::GetTexel glue (0040b590 calls it twice): "Start and End parameters cannot be the same!", ANM2::GetLayer, AnimationLayer::GetSourceQuad, LayerState::GetTexture, Quad::rotate sampling */ float * ANM2::GetTexel(float *param_1,byte *param_2,float param_3,float param_4,Vector param_5) { byte *layerName; int *piVar1; char cVar2; LayerState *layerState; float *pfVar3; undefined4 *puVar4; void *extraout_ECX; void *extraout_ECX_00; void *unused; undefined4 *extraout_ECX_01; int iVar5; float fVar6; float in_XMM2_Da; float fVar7; float fVar8; float fVar9; float fVar10; Color layerColor; undefined4 uStack_1bc; float screenQuad; float local_18c; float local_178; float local_174; float local_120; float local_11c; SourceQuad sourceQuad; KColor texel; undefined1 sampleTexture [4]; int *sampleTextureRefCount; undefined1 texture [4]; int *textureRefCount; float quadMaxX; float local_cc; float local_c8; float local_c4; float local_c0; float *outColor; uint layerIdx; float local_b0; int layerOffset; float local_a8; int *local_a4; float local_a0; float local_9c; AnimationFrame frame; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int layerAnim; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af0c80; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; outColor = param_1; local_b0 = in_XMM2_Da; KColor::SetFromARGB(&texel,0); iVar5 = local_a4[1]; if ((iVar5 != 0) && (layerIdx = 0, *(int *)(iVar5 + 0x1c) != 0)) { layerOffset = 0; do { layerAnim = *(int *)(*(int *)(iVar5 + 0x18) + 4 + layerOffset); if ((layerAnim != 0) && ((layerName = *(byte **)(*(int *)(iVar5 + 0x18) + layerOffset), (int)param_2 < 0 || (layerName == param_2)))) { AnimationState::copy_assign ((AnimationState *)&frame, (AnimationState *)(*(int *)(local_a4[2] + layerIdx * 4) * 0x6c + layerAnim)); piVar1 = local_a4; layerState = GetLayer((ANM2 *)*local_a4,layerName); if ((frame.visible != 0) && (layerState->_visible != 0)) { pfVar3 = LayerState::GetTexture(layerState,texture); local_a8 = *pfVar3; local_14 = 0; unused = (void *)0x0; if (textureRefCount != (int *)0x0) { cVar2 = (**(code **)(*textureRefCount + 0xc))(); unused = extraout_ECX; if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); unused = extraout_ECX_00; } } local_14 = 0xffffffff; if (local_a8 != 0.0) { uStack_1bc = 0x40b768; AnimationLayer::GetSourceQuad (&sourceQuad,unused,&frame,layerState,&g_vectorZero,&g_vectorZero, (ANM2 *)*piVar1); uStack_1bc = 0x40b78c; render_build_sprite_quad (&screenQuad,¶m_5,&frame,layerState,&g_vectorZero,&g_vectorZero, (ANM2 *)*piVar1); iVar5 = *piVar1; fVar6 = frame.rotation + layerState->_rotation; fVar9 = *(float *)(iVar5 + 0xa4); if ((fVar9 != 0.0) || (fVar6 != 0.0)) { fVar10 = frame.scale.x * (layerState->_size).x; fVar8 = *(float *)(iVar5 + 0xa0); fVar7 = frame.scale.y * (layerState->_size).y; if (*(float *)(iVar5 + 0x9c) < 0.0 != fVar10 < 0.0) { if (*(float *)(iVar5 + 0x9c) < 0.0) { fVar6 = -fVar6; fVar9 = -fVar9; } if (fVar10 < 0.0) { fVar6 = -fVar6; } } if (layerState->_flipY != 0) { fVar7 = -fVar7; } if (*(char *)(iVar5 + 0x101) != '\0') { fVar8 = -fVar8; } if (fVar8 < 0.0 != fVar7 < 0.0) { if (fVar8 < 0.0) { fVar6 = -fVar6; fVar9 = -fVar9; } if (fVar7 < 0.0) { fVar6 = -fVar6; } } local_a0 = -(fVar6 + fVar9) * 0.017453292; Quad::rotate(&screenQuad,&g_vectorZero,local_a0); local_9c = cos(local_a0); fVar9 = sin(local_a0); fVar6 = fVar9 * param_3; param_3 = local_9c * param_3 - fVar9 * param_4; param_4 = local_9c * param_4 + fVar6; } local_a0 = param_3; local_9c = param_4; if ((((screenQuad < param_3) && (quadMaxX = local_178, param_3 < local_178)) && (local_18c < param_4)) && (local_a8 = local_174, param_4 < local_174)) { if (screenQuad == local_178) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); local_9c = param_4; } fVar9 = (local_a0 - screenQuad) / (quadMaxX - screenQuad); if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } param_3 = (sourceQuad._bottomRight.x - sourceQuad._topLeft.x) * fVar9 + sourceQuad._topLeft.x; if (local_18c == local_a8) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar9 = (local_9c - local_18c) / (local_a8 - local_18c); if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } param_4 = (sourceQuad._bottomRight.y - sourceQuad._topLeft.y) * fVar9 + sourceQuad._topLeft.y; puVar4 = LayerState::GetTexture(layerState,sampleTexture); local_14 = 1; (**(code **)(*(int *)*puVar4 + 0x2c))(); local_14 = 2; if (((sampleTextureRefCount != (int *)0x0) && (cVar2 = (**(code **)(*sampleTextureRefCount + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14 = 0xffffffff; if (local_b0 <= local_c0) { Color::operator_assign(&layerColor,(ColorMod *)(*local_a4 + 0xa8)); FUN_004072e0(); layerColor._offset[2] = 5.944584e-39; FUN_004072e0(); local_cc = local_120 * local_cc + sourceQuad._bottomRight.x; local_c8 = local_11c * local_c8 + sourceQuad._bottomRight.y; local_c4 = sourceQuad._topLeft.x * local_c4 + (float)sourceQuad._coordinateSpace; local_c0 = sourceQuad._topLeft.y * local_c0; FUN_00a0f720(); ExceptionList = local_1c; return (float *)extraout_ECX_01; } } } } } layerOffset = layerOffset + 0x10; layerIdx = layerIdx + 1; iVar5 = local_a4[1]; } while (layerIdx < *(uint *)(iVar5 + 0x1c)); param_1 = outColor; } param_1[4] = (float)texel._unk; *param_1 = texel._red; param_1[1] = texel._green; param_1[2] = texel._blue; param_1[3] = texel._alpha; ExceptionList = local_1c; return param_1; } //@@ 0040bbf0 AnimationState::copy_assign /* DB: ? 0x40+ byte struct copy; used by Effect/Laser render prototype: db/protos.zhl, confirmed by RET 4 */ AnimationState * __thiscall AnimationState::copy_assign(AnimationState *this,AnimationState *other) { void *pvVar1; int iVar2; int iVar3; void *pvVar4; void *pvVar5; byte bVar6; undefined3 uVar7; pvVar1 = other->_animData; this->_animation = other->_animation; this->_animData = pvVar1; pvVar1 = other->_nullLayerFrames; this->_layerFrames = other->_layerFrames; this->_nullLayerFrames = pvVar1; bVar6 = other->_isPlaying; uVar7 = *(undefined3 *)&other->field_0x15; this->_animFrame = other->_animFrame; this->_isPlaying = bVar6; *(undefined3 *)&this->field_0x15 = uVar7; iVar2 = other->_previouslyTriggeredEvents; this->_currentlyTriggeredEvents = other->_currentlyTriggeredEvents; this->_previouslyTriggeredEvents = iVar2; pvVar1 = other[1]._animData; this[1]._animation = other[1]._animation; this[1]._animData = pvVar1; this[1]._layerFrames = other[1]._layerFrames; *(undefined1 *)&this[1]._nullLayerFrames = *(undefined1 *)&other[1]._nullLayerFrames; bVar6 = other[1]._isPlaying; uVar7 = *(undefined3 *)&other[1].field_0x15; iVar2 = other[1]._currentlyTriggeredEvents; iVar3 = other[1]._previouslyTriggeredEvents; this[1]._animFrame = other[1]._animFrame; this[1]._isPlaying = bVar6; *(undefined3 *)&this[1].field_0x15 = uVar7; this[1]._currentlyTriggeredEvents = iVar2; this[1]._previouslyTriggeredEvents = iVar3; pvVar1 = other[2]._animData; pvVar4 = other[2]._layerFrames; pvVar5 = other[2]._nullLayerFrames; this[2]._animation = other[2]._animation; this[2]._animData = pvVar1; this[2]._layerFrames = pvVar4; this[2]._nullLayerFrames = pvVar5; bVar6 = other[2]._isPlaying; uVar7 = *(undefined3 *)&other[2].field_0x15; this[2]._animFrame = other[2]._animFrame; this[2]._isPlaying = bVar6; *(undefined3 *)&this[2].field_0x15 = uVar7; this[2]._currentlyTriggeredEvents = other[2]._currentlyTriggeredEvents; this[2]._previouslyTriggeredEvents = other[2]._previouslyTriggeredEvents; *(undefined1 *)&this[3]._animation = *(undefined1 *)&other[3]._animation; this[3]._animData = other[3]._animData; this[3]._layerFrames = other[3]._layerFrames; return this; } //@@ 0040bc90 FUN_0040bc90 undefined4 FUN_0040bc90(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return 0xffffffff; } return *(undefined4 *)(*(int *)(in_ECX + 4) + 0x138); } //@@ 0040bcb0 FUN_0040bcb0 void FUN_0040bcb0(byte *param_1) { ANM2 *in_ECX; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } ANM2::GetAnimationData(in_ECX,param_1); return; } //@@ 0040bcd0 ANM2::GetAnimationData /* DB: linear search of this+0x74 array (count +0x78, stride 0x13c) for std::string name == arg, returns entry or 0; called with "CoinClosed" (GridEntity_Door::LoadSprite), "Clouds" (Entity_Effect::Init); ANM2 _animData +0x74 matches prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall ANM2::GetAnimationData(ANM2 *this,byte *name) { byte bVar1; byte *pbVar2; uint uVar3; byte *pbVar4; byte *pbVar5; uint uVar6; bool bVar7; uVar6 = 0; if (this->_animCount != 0) { pbVar5 = this->_animData; do { pbVar2 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar2 = *(byte **)pbVar5; } pbVar4 = name; do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_0040bd15: uVar3 = -(uint)bVar7 | 1; goto LAB_0040bd1a; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_0040bd15; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0040bd1a: if (uVar3 == 0) { return (byte *)((int)this->_animData + uVar6 * 0x13c); } uVar6 = uVar6 + 1; pbVar5 = pbVar5 + 0x13c; } while (uVar6 < (uint)this->_animCount); } return (void *)0x0; } //@@ 0040bd50 ANM2::Load /* ZHL [exact] __thiscall void ANM2::Load(std_string &ANM2Path, bool loadgraphics); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ANM2::Load(ANM2 *this,std_string *ANM2Path,byte loadgraphics) { uint *puVar1; byte bVar2; std_string *text; int *piVar3; byte *pbVar4; uint uVar5; byte unk; char *pcVar6; char *pcVar7; int iVar8; uint uVar9; byte *pbVar10; bool bVar11; if ((this->_filename)._size != 0) { AnmCache::RemoveRef(&this->_filename); } if (this != (ANM2 *)ANM2Path) { text = ANM2Path; if (0xf < ANM2Path->_capacity) { text = *(std_string **)ANM2Path->_buf; } std::string::assign((char *)this,(byte *)text,ANM2Path->_size); } AnmCache::Load(ANM2Path,this); AnmCache::AddRef(ANM2Path); if (loadgraphics != 0) { LoadGraphics(this,unk); } AnimationState::SetAnimationData(&this->_animState,(void *)0x0); AnimationState::SetAnimationData(&this->_overlayAnimState,(void *)0x0); uVar9 = 0; this->_loaded = 1; this->_shadowLayerIndex = -1; if (this->_layerCount != 0) { _loadgraphics = 0; do { piVar3 = (int *)((int)this->_layerState + _loadgraphics); iVar8 = *piVar3; if (iVar8 == 0) { pbVar10 = &s_empty; } else { pbVar10 = (byte *)(iVar8 + 8); if (0xf < *(uint *)(iVar8 + 0x1c)) { pbVar10 = *(byte **)pbVar10; } } pcVar6 = "shadow"; pbVar4 = pbVar10; do { bVar2 = *pbVar4; bVar11 = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_0040be20: uVar5 = -(uint)bVar11 | 1; goto LAB_0040be25; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar11 = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_0040be20; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0040be25: if (uVar5 == 0) { this->_shadowLayerIndex = uVar9; } else if (*pbVar10 == 0x2a) { puVar1 = (uint *)(piVar3 + 0x23); *puVar1 = *puVar1 | 5; this->_bitflags = this->_bitflags | 0x400; } uVar9 = uVar9 + 1; _loadgraphics = _loadgraphics + 0xa0; } while (uVar9 < (uint)this->_layerCount); } iVar8 = this->_numNullLayers; if (iVar8 != 0) { pcVar6 = this->_nullLayerNames; do { pcVar7 = pcVar6; if (0xf < *(uint *)(pcVar6 + 0x14)) { pcVar7 = *(char **)pcVar6; } if (*pcVar7 == '*') { this->_bitflags = this->_bitflags | 0x800; } pcVar6 = pcVar6 + 0x18; iVar8 = iVar8 + -1; } while (iVar8 != 0); } return; } //@@ 0040bea0 ANM2::Reload /* DB: src/anm2 decompile labels (ANM2::Reload) prototype: REPENTOGON */ void __thiscall ANM2::Reload(ANM2 *this) { byte unk; if ((this->_filename)._size != 0) { AnmCache::Load(this,this); AnmCache::AddRef(this); LoadGraphics(this,unk); } return; } //@@ 0040bf30 Sprite::ReplaceSpritesheet /* ZHL [lua] Lua binding Sprite:ReplaceSpritesheet prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Sprite::ReplaceSpritesheet(Sprite *this,int layerId,std_string *pngFilename) { void *pvVar1; uint lengthA; byte bVar2; int iVar3; std_string *b; std_string *a; std_string *this_00; if ((-1 < layerId) && (layerId < this->_layerCount)) { pvVar1 = this->_layerState; iVar3 = layerId * 0xa0; this_00 = (std_string *)(iVar3 + 8 + (int)pvVar1); b = this_00; if (0xf < this_00->_capacity) { b = *(std_string **)this_00->_buf; } lengthA = pngFilename->_size; a = pngFilename; if (0xf < pngFilename->_capacity) { a = *(std_string **)pngFilename->_buf; } bVar2 = str_eq((byte *)a,lengthA,(byte *)b,this_00->_size); if (bVar2 == 0) { if (this_00 == pngFilename) { *(undefined1 *)(iVar3 + 0x30 + (int)pvVar1) = 0; return 1; } if (0xf < pngFilename->_capacity) { pngFilename = *(std_string **)pngFilename->_buf; } std::string::assign((char *)this_00,(byte *)pngFilename,lengthA); *(undefined1 *)(iVar3 + 0x30 + (int)this->_layerState) = 0; return 1; } } return 0; } //@@ 0040bff0 Sprite::LoadGraphics /* ZHL [lua] Lua binding Sprite:LoadGraphics */ void Sprite::LoadGraphics(void) { ANM2 *in_ECX; ANM2::LoadGraphics(in_ECX,(byte)in_ECX); return; } //@@ 0040c000 ANM2::LoadGraphics /* DB: src/anm2 decompile labels (ANM2::LoadGraphics) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ANM2::LoadGraphics(ANM2 *this,byte unk) { void *pvVar1; char cVar2; byte *path; int iVar3; undefined1 auStackY_dc [128]; undefined4 **outImage; undefined4 *texture; void *pvVar4; int *piVar5; int local_3c; int *local_38; undefined4 *local_34; int *local_30; LayerState *local_2c; undefined4 *local_28; int *local_24; ANM2 *local_20; uint local_1c; undefined1 local_15; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0cc5; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = 0; if (this->_layerCount != 0) { iVar3 = 0; local_20 = this; do { local_8 = 0xffffffff; if (*(char *)(iVar3 + 0x30 + (int)this->_layerState) == '\0') { path = (byte *)((int)this->_layerState + iVar3 + 8); if (0xf < *(uint *)(path + 0x14)) { path = *(byte **)path; } outImage = &local_34; Manager::LoadImage(outImage,path); local_8 = 0; if (local_34 == (undefined4 *)0x0) { LAB_0040c096: local_15 = 0; } else { pvVar4 = (void *)0x40c079; cVar2 = (**(code **)*local_34)(); if (cVar2 == '\0') goto LAB_0040c096; local_15 = 1; KAGE::SmartPointer::operator_assign(auStackY_dc + 0x84,&local_34); TextureCache::Add(outImage,pvVar4); } piVar5 = &local_3c; pvVar4 = (void *)0x40c0a8; LayerState::GetTexture((LayerState *)((int)this->_layerState + iVar3),piVar5); local_8 = CONCAT31(local_8._1_3_,1); if (local_3c != 0) { pvVar1 = this->_layerState; KAGE::SmartPointer::SmartPointer(auStackY_dc + 0x84,(void *)0x0); LayerState::SetTexture((LayerState *)((int)pvVar1 + iVar3),pvVar4,piVar5); TextureCache::Release(); this = local_20; } local_2c = (LayerState *)((int)this->_layerState + iVar3); texture = (undefined4 *)0x0; piVar5 = (int *)0x0; local_24 = local_30; local_28 = local_34; if (local_30 != (int *)0x0) { cVar2 = (**(code **)(*local_30 + 4))(); if (cVar2 != '\0') { if (((piVar5 != (int *)0x0) && (cVar2 = (**(code **)(*piVar5 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStackY_dc + 0x84); } texture = local_28; piVar5 = local_24; } } LayerState::SetTexture(local_2c,texture,piVar5); *(undefined1 *)(iVar3 + 0x30 + (int)this->_layerState) = local_15; *(undefined1 *)(iVar3 + 0x31 + (int)this->_layerState) = 0; local_8 = CONCAT31(local_8._1_3_,2); if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_8 = 3; if (((local_30 != (int *)0x0) && (cVar2 = (**(code **)(*local_30 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_1c = local_1c + 1; iVar3 = iVar3 + 0xa0; } while (local_1c < (uint)this->_layerCount); } ExceptionList = local_10; return; } //@@ 0040c1e0 LayerAnimation::LayerAnimation /* DB: src/anm2 decompile labels (LayerAnimation::LayerAnimation()) */ void LayerAnimation::LayerAnimation(void) { undefined4 *in_ECX; *in_ECX = 0xffffffff; in_ECX[1] = 0; in_ECX[2] = 0; *(undefined1 *)(in_ECX + 3) = 1; return; } //@@ 0040c200 guard_check_icall /* guard_check_icall */ void __cdecl guard_check_icall(void) { /* 0xc200 3084 epoxy_handle_external_wglMakeCurrent */ return; } //@@ 0040c230 FUN_0040c230 void FUN_0040c230(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; uint size; int iVar2; iVar2 = in_ECX[4]; if (iVar2 != 0) { do { iVar2 = iVar2 + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; } iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x2c); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 0040c2d0 FUN_0040c2d0 bool FUN_0040c2d0(void) { int in_ECX; return *(int *)(in_ECX + 0x10) == 0; } //@@ 0040c2e0 Room::GetGridHeight /* ZHL [lua] Lua binding Room:GetGridHeight */ int __thiscall Room::GetGridHeight(Room *this) { return this->_gridHeight; } //@@ 0040c2f0 FUN_0040c2f0 void FUN_0040c2f0(void) { undefined4 *in_ECX; if ((uint)in_ECX[5] < 0x10) { in_ECX[4] = 0; *(undefined1 *)in_ECX = 0; return; } in_ECX[4] = 0; *(undefined1 *)*in_ECX = 0; return; } //@@ 0040c310 FUN_0040c310 void FUN_0040c310(byte *param_1) { uint *puVar1; byte *in_ECX; if (in_ECX != param_1) { puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::assign((char *)in_ECX,param_1,*puVar1); } return; } //@@ 0040c340 std::string::string_from_cstr /* DB: strlen then assign; init cap 15 prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std::string::string_from_cstr(char *this,byte *text) { byte bVar1; byte *pbVar2; this[0] = '\0'; this[1] = '\0'; this[2] = '\0'; this[3] = '\0'; this[0x10] = '\0'; this[0x11] = '\0'; this[0x12] = '\0'; this[0x13] = '\0'; this[0x14] = '\x0f'; this[0x15] = '\0'; this[0x16] = '\0'; this[0x17] = '\0'; pbVar2 = text; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); assign(this,text,(int)pbVar2 - (int)(text + 1)); return this; } //@@ 0040c380 FUN_0040c380 void FUN_0040c380(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0xf; return; } //@@ 0040c3a0 EntityPtr::Ref /* ZHL [lua] Lua binding EntityPtr:Ref */ undefined4 EntityPtr::Ref(void) { undefined4 *in_ECX; return *in_ECX; } //@@ 0040c3b0 KAGE::SmartPointer::operator_assign /* DB: copy-and-swap: builds temp via 0040c550 KAGE::SmartPointer::operator_assign ctor), swaps both words with ECX, releases the old refcount (vtable +0xc, then g_imageReleaseFn deleter); callers assign textures (LayerState::SetTexture, TextureCache::Add) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall KAGE::SmartPointer::operator_assign(void *this,void *other) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = operator_assign(local_1c,other); uVar1 = puVar4[1]; puVar4[1] = *(undefined4 *)((int)this + 4); *(undefined4 *)((int)this + 4) = uVar1; uVar1 = *puVar4; *puVar4 = *(undefined4 *)this; *(undefined4 *)this = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_1c); } } ExceptionList = local_10; return this; } //@@ 0040c440 FUN_0040c440 void FUN_0040c440(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 0040c4a0 KAGE::SmartPointer::SmartPointer /* DB: ctor from raw ImageBase*: zeroes ECX then wraps param_1 in a new ReferenceCount; Game::constructor, Backdrop::constructor, ANM2::LoadGraphics prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall KAGE::SmartPointer::SmartPointer(void *this,void *image) { char cVar1; uint uVar2; ReferenceCountBase *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; this_00 = operator_new(0x18); local_8 = 0; if (this_00 == (ReferenceCountBase *)0x0) { this_00 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this_00); *(undefined ***)this_00 = ReferenceCount::vftable; *(void **)(this_00 + 0x14) = image; } local_8 = 0xffffffff; if (*(int **)((int)this + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 4) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(this); } } *(ReferenceCountBase **)((int)this + 4) = this_00; *(void **)this = image; ExceptionList = local_10; return; } //@@ 0040c550 KAGE::SmartPointer::operator_assign /* DB: ?refcounted ptr assign via vtable +4/+0xc (LayerState::GetTexture, ANM2::LoadGraphics) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall KAGE::SmartPointer::operator_assign(void *this,void *other) { int *piVar1; undefined4 uVar2; char cVar3; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; piVar1 = *(int **)((int)other + 4); uVar2 = *(undefined4 *)other; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if (*(int **)((int)this + 4) != (int *)0x0) { cVar3 = (**(code **)(**(int **)((int)this + 4) + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(this); } } *(int **)((int)this + 4) = piVar1; *(undefined4 *)this = uVar2; } } return this; } //@@ 0040c5c0 FUN_0040c5c0 undefined4 FUN_0040c5c0(void) { short sVar1; undefined4 *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if ((*(short *)((int)in_ECX + 6) == 0) || (sVar1 = *(short *)((int)in_ECX + 6) + -1, *(short *)((int)in_ECX + 6) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); (**(code **)*in_ECX)(1); return 0; } //@@ 0040c610 FUN_0040c610 void FUN_0040c610(void) { int in_ECX; (**(code **)(*(int *)(in_ECX + 8) + 0xc))(0xffffffff); *(short *)(in_ECX + 6) = *(short *)(in_ECX + 6) + 1; /* WARNING: Could not recover jumptable at 0x0040c62b. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)(in_ECX + 8) + 0x10))(); return; } //@@ 0040c630 FUN_0040c630 undefined4 FUN_0040c630(void) { short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); if ((int *)in_ECX[5] != (int *)0x0) { (**(code **)(*(int *)in_ECX[5] + 0x34))(1); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x0040c679. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 0040c690 FUN_0040c690 void FUN_0040c690(void) { int in_ECX; (**(code **)(*(int *)(in_ECX + 8) + 0xc))(0xffffffff); *(short *)(in_ECX + 4) = *(short *)(in_ECX + 4) + 1; /* WARNING: Could not recover jumptable at 0x0040c6ab. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)(in_ECX + 8) + 0x10))(); return; } //@@ 0040c6b0 FUN_0040c6b0 undefined4 FUN_0040c6b0(void) { int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if ((short)in_ECX[1] == 0) { (**(code **)(in_ECX[2] + 0x10))(); return 0; } (**(code **)(in_ECX[2] + 0x10))(); (**(code **)(*in_ECX + 8))(); return 1; } //@@ 0040c6f0 FUN_0040c6f0 undefined4 FUN_0040c6f0(void) { return *(undefined4 *) (DAT_00c78db4 + (DAT_00c78db8 - 1U & (g_colorStackSize + DAT_00c78dbc) - 1) * 4); } //@@ 0040c720 FUN_0040c720 void FUN_0040c720(byte *param_1) { uint *puVar1; char *in_ECX; puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::assign(in_ECX,param_1,*puVar1); return; } //@@ 0040c740 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::_Parallelism_allocator::deallocate(unsigned int * const,unsigned int) public: void __thiscall std::allocator::deallocate(unsigned int * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct CHN * * const,unsigned int) public: void __thiscall std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M>::deallocate(struct `void __cdecl phmap::container_internal::Deallocate<4,class std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M * const,unsigned int) 8 names - too many to list Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 4; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 0040c780 std::min /* DB: returns ptr to smaller of ecx/edx floats */ float * std::min(void) { float *in_ECX; float *in_EDX; if (*in_EDX <= *in_ECX && *in_ECX != *in_EDX) { in_ECX = in_EDX; } return in_ECX; } //@@ 0040c790 FUN_0040c790 void FUN_0040c790(void) { uint *puVar1; uint *puVar2; byte *in_ECX; byte *in_EDX; puVar1 = (uint *)(in_EDX + 0x10); if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } puVar2 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } str_eq(in_ECX,*puVar2,in_EDX,*puVar1); return; } //@@ 0040c7c0 FUN_0040c7c0 uint FUN_0040c7c0(void) { uint *puVar1; uint *puVar2; byte bVar3; undefined3 extraout_var; byte *in_ECX; byte *in_EDX; puVar1 = (uint *)(in_EDX + 0x10); if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } puVar2 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } bVar3 = str_eq(in_ECX,*puVar2,in_EDX,*puVar1); return CONCAT31(extraout_var,bVar3) ^ 1; } //@@ 0040c7f0 KAGE::SmartPointer::reset /* DB: news a ReferenceCount (0x18, ptr at +0x14) for param_1, releases the old refcount (vtable +0xc), stores ptr/refcount into ECX[0]/[1]; TextureCache::Release, Game::~Game prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall KAGE::SmartPointer::reset(void *this,void *image) { char cVar1; uint uVar2; ReferenceCountBase *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this_00 = operator_new(0x18); local_8 = 0; if (this_00 == (ReferenceCountBase *)0x0) { this_00 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this_00); *(undefined ***)this_00 = ReferenceCount::vftable; *(void **)(this_00 + 0x14) = image; } local_8 = 0xffffffff; if (*(int **)((int)this + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 4) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(this); } } *(void **)this = image; *(ReferenceCountBase **)((int)this + 4) = this_00; ExceptionList = local_10; return; } //@@ 0040c890 render_color_stack_push /* DB: push_back of a 0x2c-byte ColorMod (11 floats: tint/colorize/offset) onto the global deque DAT_00c78db4 (map) /db8 (size) /dbc (offset) /dc0 (count), growing the map like _Growmap; Entity_Player::Render and Entity_Familiar::Render push then pop it (g_colorStackSize--), AnimationLayer::RenderFrame applies the top when g_colorStackSize != 0 */ void render_color_stack_push(undefined4 *param_1) { int iVar1; undefined4 *puVar2; code *pcVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; uint uVar7; uint uVar8; void *pvVar9; void *pvVar10; uint uVar11; size_t sVar12; size_t sVar13; uVar7 = DAT_00c78dbc; if (DAT_00c78db8 <= g_colorStackSize + 1) { uVar8 = 1; if (DAT_00c78db8 != 0) { uVar8 = DAT_00c78db8; } for (; (uVar11 = uVar8 - DAT_00c78db8, uVar11 == 0 || (uVar8 < 8)); uVar8 = uVar8 * 2) { if (0x5d1745d - uVar8 < uVar8) { FUN_0040cad0(); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } if (0x3fffffff < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar9 = std::_Allocate(uVar8 * 4); sVar12 = uVar7 * 4; sVar13 = (DAT_00c78db8 * 4 - (int)(sVar12 + (int)DAT_00c78db4)) + (int)DAT_00c78db4; memmove((void *)((int)pvVar9 + sVar12),(void *)(sVar12 + (int)DAT_00c78db4),sVar13); pvVar10 = (void *)((int)pvVar9 + sVar13 + sVar12); if (uVar11 < uVar7) { sVar13 = uVar11 * 4; memmove(pvVar10,DAT_00c78db4,sVar13); sVar12 = (sVar12 - (int)(sVar13 + (int)DAT_00c78db4)) + (int)DAT_00c78db4; memmove(pvVar9,(void *)(sVar13 + (int)DAT_00c78db4),sVar12); pvVar10 = (void *)(sVar12 + (int)pvVar9); } else { memmove(pvVar10,DAT_00c78db4,sVar12); memset((void *)((int)pvVar10 + sVar12),0,(uVar11 - uVar7) * 4); pvVar10 = pvVar9; sVar13 = sVar12; } memset(pvVar10,0,sVar13); if (DAT_00c78db4 != (void *)0x0) { deallocate(DAT_00c78db4,DAT_00c78db8); } DAT_00c78db8 = DAT_00c78db8 + uVar11; DAT_00c78db4 = pvVar9; } DAT_00c78dbc = DAT_00c78dbc & DAT_00c78db8 - 1; iVar1 = (DAT_00c78dbc + g_colorStackSize & DAT_00c78db8 - 1) * 4; if (*(int *)(iVar1 + (int)DAT_00c78db4) == 0) { pvVar9 = operator_new(0x2c); *(void **)(iVar1 + (int)DAT_00c78db4) = pvVar9; } puVar2 = *(undefined4 **)(iVar1 + (int)DAT_00c78db4); uVar4 = param_1[1]; uVar5 = param_1[2]; uVar6 = param_1[3]; *puVar2 = *param_1; puVar2[1] = uVar4; puVar2[2] = uVar5; puVar2[3] = uVar6; uVar4 = param_1[5]; uVar5 = param_1[6]; uVar6 = param_1[7]; puVar2[4] = param_1[4]; puVar2[5] = uVar4; puVar2[6] = uVar5; puVar2[7] = uVar6; *(undefined8 *)(puVar2 + 8) = *(undefined8 *)(param_1 + 8); puVar2[10] = param_1[10]; g_colorStackSize = g_colorStackSize + 1; return; } //@@ 0040ca70 memcmp_eq /* DB: src/anm2 decompile labels (memcmp_eq(ecx,edx,n)) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl memcmp_eq(void *a,void *b,uint size) { uint uVar1; bool bVar2; while (uVar1 = size - 4, 3 < size) { if (*(int *)a != *(int *)b) goto LAB_0040ca96; a = (void *)((int)a + 4); b = (void *)((int)b + 4); size = uVar1; } if (uVar1 != 0xfffffffc) { LAB_0040ca96: bVar2 = *(byte *)a < *(byte *)b; if ((*(byte *)a != *(byte *)b) || ((uVar1 != 0xfffffffd && ((bVar2 = *(byte *)((int)a + 1) < *(byte *)((int)b + 1), *(byte *)((int)a + 1) != *(byte *)((int)b + 1) || ((uVar1 != 0xfffffffe && ((bVar2 = *(byte *)((int)a + 2) < *(byte *)((int)b + 2), *(byte *)((int)a + 2) != *(byte *)((int)b + 2) || ((uVar1 != 0xffffffff && (bVar2 = *(byte *)((int)a + 3) < *(byte *)((int)b + 3), *(byte *)((int)a + 3) != *(byte *)((int)b + 3))))))))))))) { return -(uint)bVar2 | 1; } } return 0; } //@@ 0040cad0 FUN_0040cad0 void FUN_0040cad0(void) { /* WARNING: Subroutine does not return */ std::_Xlength_error("deque too long"); } //@@ 0040cae0 str_eq /* DB: src/anm2 decompile labels (str_eq(ecx,edx=len,s2,len2)) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte __cdecl str_eq(byte *a,uint lengthA,byte *b,uint lengthB) { uint uVar1; bool bVar2; if (lengthA != lengthB) { return 0; } while (uVar1 = lengthA - 4, 3 < lengthA) { if (*(int *)a != *(int *)b) goto LAB_0040cb07; a = a + 4; b = b + 4; lengthA = uVar1; } if (uVar1 != 0xfffffffc) { LAB_0040cb07: bVar2 = *a < *b; if ((*a != *b) || ((uVar1 != 0xfffffffd && ((bVar2 = a[1] < b[1], a[1] != b[1] || ((uVar1 != 0xfffffffe && ((bVar2 = a[2] < b[2], a[2] != b[2] || ((uVar1 != 0xffffffff && (bVar2 = a[3] < b[3], a[3] != b[3])))))))))))) { uVar1 = -(uint)bVar2 | 1; goto LAB_0040cb3d; } } uVar1 = 0; LAB_0040cb3d: if (uVar1 == 0) { return 1; } return 0; } //@@ 0040cb50 FUN_0040cb50 void FUN_0040cb50(byte param_1) { LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; *in_ECX = ReferenceCountBase::vftable; lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[4]; in_ECX[2] = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[4] = 0; } *(byte *)(in_ECX + 3) = *(byte *)(in_ECX + 3) & 0xfe; in_ECX[2] = KAGE::MutexBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } return; } //@@ 0040cbb0 FUN_0040cbb0 void FUN_0040cbb0(byte param_1) { LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; *in_ECX = ReferenceCountBase::vftable; lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[4]; in_ECX[2] = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[4] = 0; } *(byte *)(in_ECX + 3) = *(byte *)(in_ECX + 3) & 0xfe; in_ECX[2] = KAGE::MutexBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } return; } //@@ 0040cc10 ReferenceCountBase::ReferenceCountBase /* WARNING: Removing unreachable block (ram,0x0040cc84) */ /* DB: sets ReferenceCountBase::vftable, counts 0x10001, embedded KAGE::Mutex (vftable +8) initialised by FUN_00a15770; base of every ReferenceCount smart-pointer block prototype: db/protos.zhl */ void __thiscall ReferenceCountBase::ReferenceCountBase(ReferenceCountBase *this) { uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0d80; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)this = vftable; *(undefined4 *)(this + 4) = 0x10001; this[0xc] = (ReferenceCountBase)0x0; *(undefined ***)(this + 8) = KAGE::Mutex::vftable; *(undefined4 *)(this + 0x10) = 0; local_8 = 0; FUN_00a15770(uVar1); ExceptionList = local_10; return; } //@@ 0040cca0 FUN_0040cca0 void FUN_0040cca0(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; return; } //@@ 0040ccc0 std::string::_Xlen /* DB: "string too long" throw */ void std::string::_Xlen(void) { /* WARNING: Subroutine does not return */ std::_Xlength_error("string too long"); } //@@ 0040ccd0 std::string::assign /* DB: assign(ptr,len) with SSO grow prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall std::string::assign(char *this,byte *text,uint length) { uint uVar1; uint uVar2; void *pvVar3; void *_Dst; void *ptr; char *_Dst_00; uint uVar4; uVar2 = *(uint *)(this + 0x14); if (length <= uVar2) { _Dst_00 = this; if (0xf < uVar2) { _Dst_00 = *(char **)this; } *(uint *)(this + 0x10) = length; memmove(_Dst_00,text,length); _Dst_00[length] = '\0'; return (std_string *)this; } if (0x7fffffff < length) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar4 = length | 0xf; if (uVar4 < 0x80000000) { if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar4 = 0x7fffffff; } else { uVar1 = (uVar2 >> 1) + uVar2; if (uVar4 < uVar1) { uVar4 = uVar1; } } } else { uVar4 = 0x7fffffff; } _Dst = _Allocate(uVar4 + 1); *(uint *)(this + 0x10) = length; *(uint *)(this + 0x14) = uVar4; memcpy(_Dst,text,length); *(undefined1 *)((int)_Dst + length) = 0; if (0xf < uVar2) { uVar4 = uVar2 + 1; pvVar3 = *(void **)this; ptr = pvVar3; if (0xfff < uVar4) { ptr = *(void **)((int)pvVar3 + -4); uVar4 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } *(void **)this = _Dst; return (std_string *)this; } //@@ 0040cdc0 FUN_0040cdc0 uint * FUN_0040cdc0(void) { uint *in_ECX; uint *in_EDX; if (*in_ECX < *in_EDX) { in_ECX = in_EDX; } return in_ECX; } //@@ 0040cdd0 std_min_ptr /* DB: min of two uint pointers, ICF-foldable */ uint * std_min_ptr(void) { uint *in_ECX; uint *in_EDX; if (*in_EDX < *in_ECX) { in_ECX = in_EDX; } return in_ECX; } //@@ 0040cde0 FUN_0040cde0 void FUN_0040cde0(void) { undefined4 *in_ECX; *(undefined8 *)(in_ECX + 1) = 0; in_ECX[1] = "bad array new length"; *in_ECX = std::bad_array_new_length::vftable; return; } //@@ 0040ce00 FUN_0040ce00 void FUN_0040ce00(void) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; __std_exception_destroy(in_ECX + 1); return; } //@@ 0040ce20 FUN_0040ce20 void FUN_0040ce20(byte param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; __std_exception_destroy(in_ECX + 1); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 0040ce60 FUN_0040ce60 void FUN_0040ce60(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = std::bad_array_new_length::vftable; return; } //@@ 0040cea0 FUN_0040cea0 void FUN_0040cea0(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = std::bad_alloc::vftable; return; } //@@ 0040cee0 FUN_0040cee0 void FUN_0040cee0(void) { void *pExceptionObject; FUN_0040cde0(); /* WARNING: Subroutine does not return */ _CxxThrowException(pExceptionObject,(ThrowInfo *)&DAT_00bd5bcc); } //@@ 0040cf00 std::_Allocate /* DB: MSVC allocate with >=0x1000 32-byte alignment path (+0x23, store raw ptr at -4) prototype: db/protos.zhl */ void * __fastcall std::_Allocate(uint size) { void *pvVar1; void *pvVar2; if (size < 0x1000) { if (size == 0) { return (void *)0x0; } pvVar1 = operator_new(size); return pvVar1; } if (size + 0x23 <= size) { /* WARNING: Subroutine does not return */ FUN_0040cee0(size); } pvVar1 = operator_new(size + 0x23); if (pvVar1 == (void *)0x0) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } pvVar2 = (void *)((int)pvVar1 + 0x23U & 0xffffffe0); *(void **)((int)pvVar2 + -4) = pvVar1; return pvVar2; } //@@ 0040cf50 std::string::string /* DB: copy ctor: SSO copy if <16 else allocate+memcpy prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std::string::string(char *this,void *other) { uint uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; void *_Dst; uint uVar5; this[0] = '\0'; this[1] = '\0'; this[2] = '\0'; this[3] = '\0'; this[0x10] = '\0'; this[0x11] = '\0'; this[0x12] = '\0'; this[0x13] = '\0'; this[0x14] = '\0'; this[0x15] = '\0'; this[0x16] = '\0'; this[0x17] = '\0'; uVar1 = *(uint *)((int)other + 0x10); if (0xf < *(uint *)((int)other + 0x14)) { other = *(void **)other; } if (uVar1 < 0x10) { uVar2 = *(undefined4 *)((int)other + 4); uVar3 = *(undefined4 *)((int)other + 8); uVar4 = *(undefined4 *)((int)other + 0xc); *(undefined4 *)this = *(undefined4 *)other; *(undefined4 *)(this + 4) = uVar2; *(undefined4 *)(this + 8) = uVar3; *(undefined4 *)(this + 0xc) = uVar4; *(uint *)(this + 0x10) = uVar1; this[0x14] = '\x0f'; this[0x15] = '\0'; this[0x16] = '\0'; this[0x17] = '\0'; return this; } uVar5 = uVar1 | 0xf; if (0x7fffffff < uVar5) { uVar5 = 0x7fffffff; } _Dst = _Allocate(uVar5 + 1); *(void **)this = _Dst; memcpy(_Dst,other,uVar1 + 1); *(uint *)(this + 0x10) = uVar1; *(uint *)(this + 0x14) = uVar5; return this; } //@@ 0040cfe0 FUN_0040cfe0 void FUN_0040cfe0(void) { undefined1 *in_ECX; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0xf; *in_ECX = 0; return; } //@@ 0040d000 FUN_0040d000 void FUN_0040d000(void *param_1,uint param_2) { void *ptr; ptr = param_1; if (0xfff < param_2) { ptr = *(void **)((int)param_1 + -4); param_2 = param_2 + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,param_2); return; } //@@ 0040d040 std::string::_Tidy_deallocate /* DB: frees heap buffer if cap>15, resets size 0 cap 15 prototype: db/protos.zhl */ void __thiscall std::string::_Tidy_deallocate(char *this) { uint uVar1; void *pvVar2; void *ptr; uint size; uVar1 = *(uint *)(this + 0x14); if (0xf < uVar1) { pvVar2 = *(void **)this; size = uVar1 + 1; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = uVar1 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } this[0x10] = '\0'; this[0x11] = '\0'; this[0x12] = '\0'; this[0x13] = '\0'; this[0x14] = '\x0f'; this[0x15] = '\0'; this[0x16] = '\0'; this[0x17] = '\0'; *this = '\0'; return; } //@@ 0040d090 FUN_0040d090 void FUN_0040d090(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); return; } //@@ 0040d0c0 std::string::c_str /* DB: SSO cap<16 check prototype: db/protos.zhl */ byte * __thiscall std::string::c_str(char *this) { if (*(uint *)(this + 0x14) < 0x10) { return (byte *)this; } return *(byte **)this; } //@@ 0040d0d0 FUN_0040d0d0 char * FUN_0040d0d0(void) { char *pcVar1; int in_ECX; pcVar1 = "Unknown exception"; if (*(char **)(in_ECX + 4) != (char *)0x0) { pcVar1 = *(char **)(in_ECX + 4); } return pcVar1; } //@@ 0040d0e0 Color::Color /* DB: sets tint r,g,b,a, zero colorize, offsets r,g,b (11-float Color layout) */ void Color::Color(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[3] = param_1; in_ECX[8] = param_2; in_ECX[9] = param_3; *in_ECX = in_XMM1_Da; in_ECX[1] = in_XMM2_Da; in_ECX[2] = in_XMM3_Da; in_ECX[10] = param_4; return; } //@@ 0040d170 FUN_0040d170 void FUN_0040d170(void) { undefined4 *in_ECX; in_ECX[1] = 0; *in_ECX = 0; in_ECX[3] = 0; in_ECX[2] = 0; in_ECX[5] = 0; in_ECX[4] = 0; in_ECX[7] = 0; in_ECX[6] = 0; in_ECX[9] = 0; in_ECX[8] = 0; in_ECX[0xc] = 0x3f800000; in_ECX[0xd] = 0x3f800000; in_ECX[0xe] = 0x3f800000; in_ECX[0xf] = 0x3f800000; in_ECX[0x10] = 0; in_ECX[0x11] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0; in_ECX[0x16] = 0; *(undefined1 *)(in_ECX + 0x18) = 0; return; } //@@ 0040d210 FUN_0040d210 ModManager * FUN_0040d210(void) { return &g_manager->_modManager; } //@@ 0040d220 FUN_0040d220 void FUN_0040d220(void) { int *in_ECX; FUN_00415ae0(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x54); return; } //@@ 0040d240 AnmCache::~AnmCache /* DB: src/anm2 decompile labels (AnmCache::~AnmCache) */ void AnmCache::~AnmCache(void) { int *piVar1; ANM2 *this; void *pvVar2; uint uVar3; qword qVar4; int *piVar5; char cVar6; uint uVar7; ANM2 **ppAVar8; int *in_ECX; qword *pqVar9; ANM2 **ppAVar10; int *piVar11; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0dd0; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; ppAVar8 = DAT_00c78da8; ppAVar10 = g_staticSprites; local_14 = in_ECX; if (g_staticSprites != DAT_00c78da8) { do { this = *ppAVar10; if (this != (ANM2 *)0x0) { local_8 = 0; ANM2::Reset(this); pvVar2 = (this->_overlayAnimState)._layerFrames; if (pvVar2 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)pvVar2 + -4); qVar4 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)((int)pvVar2 + -4)); (this->_overlayAnimState)._layerFrames = (void *)0x0; } pvVar2 = (this->_overlayAnimState)._nullLayerFrames; if (pvVar2 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)pvVar2 + -4); qVar4 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)((int)pvVar2 + -4)); (this->_overlayAnimState)._nullLayerFrames = (void *)0x0; } pvVar2 = (this->_animState)._layerFrames; if (pvVar2 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)pvVar2 + -4); qVar4 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)((int)pvVar2 + -4)); (this->_animState)._layerFrames = (void *)0x0; } pvVar2 = (this->_animState)._nullLayerFrames; if (pvVar2 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)pvVar2 + -4); qVar4 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)((int)pvVar2 + -4)); (this->_animState)._nullLayerFrames = (void *)0x0; } std::string::_Tidy_deallocate((this->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)this); local_8 = 0xffffffff; operator_delete(this,0x114); ppAVar8 = DAT_00c78da8; } ppAVar10 = ppAVar10 + 1; } while (ppAVar10 != ppAVar8); in_ECX = local_14; } piVar11 = (int *)*in_ECX; local_14 = (int *)*piVar11; DAT_00c78da8 = g_staticSprites; if (local_14 != piVar11) { do { AnmFileData::Clear(uVar7); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); piVar11 = (int *)*in_ECX; } while (local_14 != piVar11); } FUN_00415ae0(in_ECX,piVar11[1]); piVar11[1] = (int)piVar11; piVar1 = in_ECX + 2; *piVar11 = (int)piVar11; piVar11[2] = (int)piVar11; in_ECX[1] = 0; piVar11 = (int *)*piVar1; local_14 = (int *)*piVar11; if (local_14 != piVar11) { do { piVar5 = local_14; piVar11 = local_14 + 5; if ((((int *)local_14[6] != (int *)0x0) && (cVar6 = (**(code **)(*(int *)local_14[6] + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(piVar11); } piVar5[6] = 0; *piVar11 = 0; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); piVar11 = (int *)*piVar1; } while (local_14 != piVar11); } std::map::_Erase_tree(piVar1,piVar11[1]); piVar11[1] = (int)piVar11; *piVar11 = (int)piVar11; piVar11[2] = (int)piVar11; in_ECX[3] = 0; ExceptionList = local_10; return; } //@@ 0040d480 FUN_0040d480 void FUN_0040d480(void) { basic_ios_> *this; int *in_ECX; this = (basic_ios_> *)(in_ECX + 0x1a); *(undefined ***)(this + *(int *)(*in_ECX + 4) + -0x68) = std::basic_stringstream,std::allocator_>::vftable; *(int *)(this + *(int *)(*in_ECX + 4) + -0x6c) = *(int *)(*in_ECX + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>::~basic_iostream_> ((basic_iostream_> *)(in_ECX + 8)); /* WARNING: Could not recover jumptable at 0x0040d4b2. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_>(this); return; } //@@ 0040d4c0 AnmCache::LogMemoryUsage /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (AnmCache::LogMemoryUsage) */ void AnmCache::LogMemoryUsage(void) { undefined4 *puVar1; int *piVar2; uint uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; int iVar7; int iVar8; int iVar9; uint uVar10; undefined1 auVar11 [16]; undefined1 auVar12 [16]; undefined1 auVar13 [16]; undefined1 auVar14 [16]; undefined1 auVar15 [16]; undefined1 auVar16 [16]; undefined1 auVar17 [16]; undefined1 auVar18 [16]; void *local_28; int local_24; int local_20; int local_1c; int local_18; int local_14; int local_10; void *local_c; int *local_8; iVar8 = 0; local_c = *(void **)g_anmCacheMap; local_24 = 0; if (local_c != g_anmCacheMap) { do { local_20 = *(int *)((int)local_c + 0x24); if (local_20 != 0) { iVar8 = *(int *)((int)local_c + 0x20); local_10 = iVar8 + 0x24; local_8 = (int *)(iVar8 + 0x18); do { uVar10 = 0; uVar3 = local_8[1]; if (((uVar3 != 0) && (7 < uVar3)) && (1 < __isa_available)) { iVar7 = *local_8; iVar9 = 0; do { puVar1 = (undefined4 *)(iVar7 + 0x38 + iVar9); iVar9 = iVar9 + 0x80; uVar4 = *(undefined4 *)(iVar7 + -0x58 + iVar9); uVar10 = uVar10 + 8; uVar5 = *(undefined4 *)(iVar7 + -0x78 + iVar9); auVar12._4_4_ = uVar4; auVar12._0_4_ = uVar5; uVar6 = *(undefined4 *)(iVar7 + -0x18 + iVar9); auVar12._8_4_ = uVar4; auVar12._12_4_ = *puVar1; auVar11._8_8_ = auVar12._8_8_; auVar11._4_4_ = *(undefined4 *)(iVar7 + -0x68 + iVar9); auVar11._0_4_ = uVar5; pmulld(auVar11,_DAT_00bab780); uVar4 = *(undefined4 *)(iVar7 + -0x38 + iVar9); auVar14._4_4_ = uVar6; auVar14._0_4_ = uVar4; auVar14._8_4_ = uVar6; auVar14._12_4_ = *(undefined4 *)(iVar7 + -8 + iVar9); auVar13._8_8_ = auVar14._8_8_; auVar13._4_4_ = *(undefined4 *)(iVar7 + -0x28 + iVar9); auVar13._0_4_ = uVar4; pmulld(auVar13,_DAT_00bab780); } while (uVar10 < (uVar3 & 0xfffffff8)); } if ((uVar10 < uVar3) && (local_1c = *local_8, 1 < uVar3 - uVar10)) { iVar9 = ((uVar3 - uVar10) - 2 >> 1) + 1; do { iVar9 = iVar9 + -1; } while (iVar9 != 0); } uVar3 = local_8[3]; uVar10 = 0; if (((uVar3 != 0) && (7 < uVar3)) && (1 < __isa_available)) { local_1c = local_8[2]; iVar9 = 0; do { puVar1 = (undefined4 *)(local_1c + 0x3c + iVar9); iVar9 = iVar9 + 0x80; uVar4 = *(undefined4 *)(local_1c + -0x54 + iVar9); uVar10 = uVar10 + 8; uVar5 = *(undefined4 *)(local_1c + -0x74 + iVar9); auVar16._4_4_ = uVar4; auVar16._0_4_ = uVar5; uVar6 = *(undefined4 *)(local_1c + -0x14 + iVar9); auVar16._8_4_ = uVar4; auVar16._12_4_ = *puVar1; auVar15._8_8_ = auVar16._8_8_; auVar15._4_4_ = *(undefined4 *)(local_1c + -100 + iVar9); auVar15._0_4_ = uVar5; pmulld(auVar15,_DAT_00bab760); uVar4 = *(undefined4 *)(local_1c + -0x34 + iVar9); auVar18._4_4_ = uVar6; auVar18._0_4_ = uVar4; auVar18._8_4_ = uVar6; auVar18._12_4_ = *(undefined4 *)(local_1c + -4 + iVar9); auVar17._8_8_ = auVar18._8_8_; auVar17._4_4_ = *(undefined4 *)(local_1c + -0x24 + iVar9); auVar17._0_4_ = uVar4; pmulld(auVar17,_DAT_00bab760); } while (uVar10 < (uVar3 & 0xfffffff8)); } local_18 = 0; local_14 = 0; if ((uVar10 < uVar3) && (1 < uVar3 - uVar10)) { local_1c = *(int *)((*(int *)((int)local_c + 0x20) - iVar8) + local_10 + -4); iVar9 = uVar10 << 4; iVar7 = ((local_8[3] - uVar10) - 2 >> 1) + 1; do { piVar2 = (int *)(local_1c + 0xc + iVar9); iVar9 = iVar9 + 0x20; local_18 = local_18 + *piVar2 * 0x54; local_14 = local_14 + *(int *)(local_1c + -4 + iVar9) * 0x54; iVar7 = iVar7 + -1; } while (iVar7 != 0); } local_8 = local_8 + 0x4f; local_10 = local_10 + 0x13c; local_20 = local_20 + -1; } while (local_20 != 0); local_20 = 0; iVar8 = local_24; } iVar8 = iVar8 + 1; local_28 = local_c; local_24 = iVar8; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); local_c = local_28; } while (local_28 != g_anmCacheMap); } local_28 = local_c; KAGE_LogMessage(1,(byte *)"AnmCache memory usage: %u bytes in %u entries.\n"); return; } //@@ 0040d850 AnmFileData::Clear /* DB: src/anm2 decompile labels (AnmFileData::Clear) */ void AnmFileData::Clear(void) { uint *puVar1; int iVar2; uint uVar3; void *pvVar4; qword qVar5; int in_ECX; int iVar6; void *pvVar7; int iVar8; qword *pqVar9; int iVar10; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0df0; local_10 = ExceptionList; ExceptionList = &local_10; pvVar7 = *(void **)(in_ECX + 4); if (pvVar7 != (void *)0x0) { puVar1 = (uint *)((int)pvVar7 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar7,0x38,*puVar1,FUN_0040db70); operator_delete(puVar1,*puVar1 * 0x38 + 4); } *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 8) = 0; local_1c = 0; if (*(int *)(in_ECX + 0x10) != 0) { iVar10 = 0; pvVar7 = g_mainHeap; do { local_8 = 0xffffffff; iVar6 = *(int *)(in_ECX + 0xc); local_18 = 0; if (*(int *)(iVar6 + 0x1c + iVar10) != 0) { iVar8 = 0; do { iVar2 = *(int *)(*(int *)(iVar10 + 0x18 + iVar6) + 4 + iVar8); pqVar9 = (qword *)((int)pvVar7 + 0x30); if (pvVar7 == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { puVar1 = (uint *)(iVar2 + -4); uVar3 = *puVar1; qVar5 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar5 < uVar3); free(puVar1); iVar6 = *(int *)(in_ECX + 0xc); pvVar7 = g_mainHeap; } iVar8 = iVar8 + 0x10; local_18 = local_18 + 1; } while (local_18 < *(uint *)(iVar10 + 0x1c + iVar6)); } pvVar4 = *(void **)(iVar10 + 0x18 + iVar6); if (pvVar4 != (void *)0x0) { puVar1 = (uint *)((int)pvVar4 + -4); local_8 = 2; _eh_vector_destructor_iterator_(pvVar4,0x10,*puVar1,guard_check_icall); operator_delete(puVar1,*puVar1 * 0x10 + 4); pvVar7 = g_mainHeap; } iVar6 = *(int *)(in_ECX + 0xc); local_18 = 0; if (*(int *)(iVar6 + 0x24 + iVar10) != 0) { iVar8 = 0; do { iVar2 = *(int *)(*(int *)(iVar10 + 0x20 + iVar6) + 8 + iVar8); pqVar9 = (qword *)((int)pvVar7 + 0x30); if (pvVar7 == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { puVar1 = (uint *)(iVar2 + -4); uVar3 = *puVar1; qVar5 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar5 < uVar3); free(puVar1); iVar6 = *(int *)(in_ECX + 0xc); pvVar7 = g_mainHeap; } iVar8 = iVar8 + 0x10; local_18 = local_18 + 1; } while (local_18 < *(uint *)(iVar10 + 0x24 + iVar6)); } pvVar4 = *(void **)(iVar10 + 0x20 + iVar6); if (pvVar4 != (void *)0x0) { puVar1 = (uint *)((int)pvVar4 + -4); local_8 = 4; _eh_vector_destructor_iterator_(pvVar4,0x10,*puVar1,guard_check_icall); operator_delete(puVar1,*puVar1 * 0x10 + 4); pvVar7 = g_mainHeap; } iVar6 = *(int *)(*(int *)(in_ECX + 0xc) + 0x28 + iVar10); pqVar9 = (qword *)((int)pvVar7 + 0x30); if (pvVar7 == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } if (iVar6 != 0) { uVar3 = *(uint *)(iVar6 + -4); qVar5 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar3; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar5 < uVar3); free((void *)(iVar6 + -4)); pvVar7 = g_mainHeap; } iVar10 = iVar10 + 0x13c; local_1c = local_1c + 1; } while (local_1c < *(uint *)(in_ECX + 0x10)); } pvVar7 = *(void **)(in_ECX + 0xc); if (pvVar7 != (void *)0x0) { puVar1 = (uint *)((int)pvVar7 + -4); local_8 = 6; _eh_vector_destructor_iterator_(pvVar7,0x13c,*puVar1,std::string::_Tidy_deallocate); operator_delete(puVar1,*puVar1 * 0x13c + 4); } pvVar7 = *(void **)(in_ECX + 0x14); *(undefined4 *)(in_ECX + 0xc) = 0; *(undefined4 *)(in_ECX + 0x10) = 0; if (pvVar7 != (void *)0x0) { puVar1 = (uint *)((int)pvVar7 + -4); local_8 = 7; _eh_vector_destructor_iterator_(pvVar7,0x18,*puVar1,std::string::_Tidy_deallocate); operator_delete(puVar1,*puVar1 * 0x18 + 4); } pvVar7 = *(void **)(in_ECX + 0x1c); *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; if (pvVar7 != (void *)0x0) { puVar1 = (uint *)((int)pvVar7 + -4); local_8 = 8; _eh_vector_destructor_iterator_(pvVar7,0x18,*puVar1,std::string::_Tidy_deallocate); operator_delete(puVar1,*puVar1 * 0x18 + 4); } *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0; ExceptionList = local_10; return; } //@@ 0040db70 FUN_0040db70 void FUN_0040db70(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); return; } //@@ 0040db90 AnmCache::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (AnmCache::Load(path,ANM2*)) */ void AnmCache::Load(byte *param_1,byte *param_2) { uint *ptr; void *pvVar1; longlong lVar2; longlong lVar3; qword qVar4; uint uVar5; byte ***pppbVar6; byte *pbVar7; uint uVar8; byte *pbVar9; uint uVar10; qword *pqVar11; uint uVar12; byte *pbVar13; byte **ppbVar14; bool bVar15; ulonglong uVar16; ulonglong uVar17; undefined1 local_160 [8]; void *local_158; uint local_154; undefined4 local_150 [2]; byte *local_148; uint local_13c; undefined4 local_138; undefined4 *local_134; byte *local_130; byte *local_12c; byte local_128 [260]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_128 + 0x124; local_14 = 0xffffffff; puStack_18 = &LAB_00af0e48; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_128 + 0x118); ExceptionList = &local_1c; local_130 = param_1; local_12c = param_2; if (*(int *)(param_1 + 0x10) != 0) { local_24 = uVar5; uVar16 = GetTimeNs(); pbVar9 = g_anmCacheMap; uVar12 = (uint)(uVar16 >> 0x20); uVar17 = (uVar16 & 0xffffffff) * 0xd7b634db; local_150[0] = (undefined4)uVar17; lVar2 = (uVar16 & 0xffffffff) * 0x431bde82; local_148 = (byte *)((ulonglong)lVar2 >> 0x20); uVar17 = (ulonglong)uVar12 * 0xd7b634db + (uVar17 >> 0x20); uVar10 = (uint)(uVar17 >> 0x20); lVar2 = lVar2 + (uVar17 & 0xffffffff); local_138 = (undefined4)lVar2; uVar8 = (uint)((ulonglong)lVar2 >> 0x20); local_134 = (undefined4 *)0x0; lVar2 = (ulonglong)uVar12 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar10,uVar8),uVar10 + uVar8); local_13c = (uint)((ulonglong)lVar2 >> 0x20); local_154 = (uint)lVar2 >> 0x12 | local_13c * 0x4000; local_13c = local_13c >> 0x12; if ((uint)((int)g_mountPrefixesEnd - (int)g_mountPrefixes) < 4) { pppbVar6 = FileSystem::GetMountPrefixes(local_150); if (pppbVar6 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar6; g_mountPrefixesEnd = pppbVar6[1]; _DAT_00c798c0 = pppbVar6[2]; *pppbVar6 = (byte **)0x0; pppbVar6[1] = (byte **)0x0; pppbVar6[2] = (byte **)0x0; } FID_conflict__Tidy(local_150); } ppbVar14 = g_mountPrefixes; if (g_mountPrefixes != g_mountPrefixesEnd) { do { strncpy_s((char *)local_128,0x100,(char *)*ppbVar14,0x100); pbVar9 = local_130; if (0xf < *(uint *)(local_130 + 0x14)) { pbVar9 = *(byte **)local_130; } strcat_s((char *)local_128,0x100,(char *)pbVar9); local_134 = (undefined4 *)KAGE_Filesys_FileManager::GetPrimaryFilePathHash(local_128); FUN_00416490(local_150,&local_134); if ((*(char *)((int)local_148 + 0xd) != '\0') || (pbVar9 = local_148, local_134 < *(undefined4 **)((int)local_148 + 0x10))) { pbVar9 = g_anmCacheMap; } } while ((pbVar9 == g_anmCacheMap) && (ppbVar14 = ppbVar14 + 1, ppbVar14 != g_mountPrefixesEnd)); } pbVar13 = local_130; pbVar7 = local_130; if (0xf < *(uint *)(local_130 + 0x14)) { pbVar7 = *(byte **)local_130; } local_148 = FileSystem::ResolvePath(pbVar7); if ((pbVar9 == g_anmCacheMap) || ((*(char *)((int)pbVar9 + 0x14) != '\0' && (local_148 != (byte *)0x0)))) { ParseFile(pbVar13,local_134,uVar5); FUN_00416490(local_160,&local_134); if ((*(char *)((int)local_158 + 0xd) != '\0') || (pbVar9 = local_158, local_134 < *(undefined4 **)((int)local_158 + 0x10))) { pbVar9 = g_anmCacheMap; } } if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } if (local_148 != (byte *)0x0) { uVar5 = *(uint *)(local_148 + -4); qVar4 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 - uVar5; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) - (uint)((uint)qVar4 < uVar5); free(local_148 + -4); } local_14 = 0xffffffff; if (pbVar9 == g_anmCacheMap) { KAGE_LogMessage(1,(byte *)"AnmCache failed to load %s\n"); } else { pvVar1 = *(void **)(local_12c + 0x7c); pbVar7 = local_12c; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_14 = 1; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); pbVar7 = local_12c; } local_14 = 0xffffffff; local_12c = *(byte **)((int)pbVar9 + 0x1c); pbVar13 = (byte *)0x0; if (local_12c != (byte *)0x0) { local_148 = (byte *)0x0; uVar5 = -(uint)((int)(ZEXT48(local_12c) * 0xa0 >> 0x20) != 0) | (uint)(ZEXT48(local_12c) * 0xa0); local_130 = local_12c; local_134 = operator_new_tracked(-(uint)(0xfffffffb < uVar5) | uVar5 + 4); local_14 = 3; if (local_134 == (undefined4 *)0x0) { pbVar13 = (byte *)0x0; } else { *local_134 = local_12c; local_148 = (byte *)(local_134 + 1); _eh_vector_constructor_iterator_ (local_148,0xa0,(uint)local_12c,LayerState::LayerState,LayerState::~LayerState); pbVar13 = local_148; } local_14 = 0xffffffff; *(byte **)(pbVar7 + 0x7c) = pbVar13; local_12c = (byte *)0x0; pbVar13 = (byte *)0x0; if (*(int *)((int)pbVar9 + 0x1c) != 0) { local_130 = (byte *)0x0; local_134 = (undefined4 *)0x0; do { LayerState::Init((LayerState *)(local_130 + *(int *)(pbVar7 + 0x7c)), *(int *)((int)pbVar9 + 0x18) + (int)local_134); local_134 = local_134 + 0xe; *(byte **)(local_130 + *(int *)(pbVar7 + 0x7c) + 4) = pbVar7; local_130 = local_130 + 0xa0; pbVar13 = *(byte **)((int)pbVar9 + 0x1c); local_12c = local_12c + 1; } while (local_12c < pbVar13); } } *(byte **)(pbVar7 + 0x80) = pbVar13; *(undefined4 *)(pbVar7 + 0x74) = *(undefined4 *)((int)pbVar9 + 0x20); *(undefined4 *)(pbVar7 + 0x78) = *(undefined4 *)((int)pbVar9 + 0x24); *(undefined4 *)(pbVar7 + 0x84) = *(undefined4 *)((int)pbVar9 + 0x28); *(undefined4 *)(pbVar7 + 0x88) = *(undefined4 *)((int)pbVar9 + 0x2c); *(undefined4 *)(pbVar7 + 0x8c) = *(undefined4 *)((int)pbVar9 + 0x30); pbVar13 = (byte *)((int)pbVar9 + 0x38); *(undefined4 *)(pbVar7 + 0x90) = *(undefined4 *)((int)pbVar9 + 0x34); if (pbVar7 + 0x18 != pbVar13) { if (0xf < *(uint *)((int)pbVar9 + 0x4c)) { pbVar13 = *(byte **)pbVar13; } std::string::assign((char *)(pbVar7 + 0x18),pbVar13,*(uint *)((int)pbVar9 + 0x48)); } } uVar17 = GetTimeNs(); uVar8 = (uint)(uVar17 >> 0x20); lVar2 = (uVar17 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar8 * 0xd7b634db + ((uVar17 & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)((ulonglong)lVar3 >> 0x20); uVar5 = (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (ulonglong)uVar8 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar12,uVar5),uVar12 + uVar5) ; uVar12 = (uint)((ulonglong)lVar2 >> 0x20); uVar5 = (uint)lVar2 >> 0x12 | uVar12 * 0x4000; uVar8 = uVar5 - local_154; bVar15 = CARRY4(_DAT_00c79c40,uVar8); _DAT_00c79c40 = _DAT_00c79c40 + uVar8; _DAT_00c79c44 = _DAT_00c79c44 + (((uVar12 >> 0x12) - local_13c) - (uint)(uVar5 < local_154)) + (uint)bVar15 ; } ExceptionList = local_1c; return; } //@@ 0040e110 AnmCache::AddRef /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (AnmCache::AddRef) */ void AnmCache::AddRef(char *param_1) { byte ***pppbVar1; char *_Src; void *pvVar2; byte **ppbVar3; undefined1 local_12c [8]; void *local_124; char *local_120; uint local_11c; byte local_118 [260]; undefined4 local_14; pvVar2 = g_anmCacheMap; local_14 = __security_cookie ^ (uint)(local_118 + 0x108); local_120 = param_1; if (((int)g_mountPrefixesEnd - (int)g_mountPrefixes & 0xfffffffcU) == 0) { pppbVar1 = FileSystem::GetMountPrefixes(local_12c); if (pppbVar1 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar1; g_mountPrefixesEnd = pppbVar1[1]; _DAT_00c798c0 = pppbVar1[2]; *pppbVar1 = (byte **)0x0; pppbVar1[1] = (byte **)0x0; pppbVar1[2] = (byte **)0x0; } FID_conflict__Tidy(local_12c); } ppbVar3 = g_mountPrefixes; if (g_mountPrefixes != g_mountPrefixesEnd) { do { strncpy_s((char *)local_118,0x100,(char *)*ppbVar3,0x100); _Src = local_120; if (0xf < *(uint *)(local_120 + 0x14)) { _Src = *(char **)local_120; } strcat_s((char *)local_118,0x100,_Src); local_11c = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(local_118); FUN_00416490(local_12c,&local_11c); if ((*(char *)((int)local_124 + 0xd) != '\0') || (pvVar2 = local_124, local_11c < *(uint *)((int)local_124 + 0x10))) { pvVar2 = g_anmCacheMap; } if (pvVar2 != g_anmCacheMap) goto LAB_0040e26e; ppbVar3 = ppbVar3 + 1; } while (ppbVar3 != g_mountPrefixesEnd); } if (pvVar2 == g_anmCacheMap) { KAGE_LogMessage(1,(byte *)"[warn] AnmCache: cannot add reference to %s\n"); } else { LAB_0040e26e: *(int *)((int)pvVar2 + 0x50) = *(int *)((int)pvVar2 + 0x50) + 1; } return; } //@@ 0040e2b0 AnmCache::RemoveRef /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (AnmCache::RemoveRef) prototype: db/protos.zhl, confirmed by RET 4 */ void AnmCache::RemoveRef(std_string *path) { byte ***pppbVar1; int iVar2; std_string *_Src; void *pvVar3; byte **ppbVar4; undefined1 local_12c [8]; void *local_124; std_string *local_120; uint local_11c; byte local_118 [260]; undefined4 local_14; pvVar3 = g_anmCacheMap; local_14 = __security_cookie ^ (uint)(local_118 + 0x108); local_120 = path; if (((int)g_mountPrefixesEnd - (int)g_mountPrefixes & 0xfffffffcU) == 0) { pppbVar1 = FileSystem::GetMountPrefixes(local_12c); if (pppbVar1 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar1; g_mountPrefixesEnd = pppbVar1[1]; _DAT_00c798c0 = pppbVar1[2]; *pppbVar1 = (byte **)0x0; pppbVar1[1] = (byte **)0x0; pppbVar1[2] = (byte **)0x0; } FID_conflict__Tidy(local_12c); } ppbVar4 = g_mountPrefixes; if (g_mountPrefixes != g_mountPrefixesEnd) { do { strncpy_s((char *)local_118,0x100,(char *)*ppbVar4,0x100); _Src = local_120; if (0xf < local_120->_capacity) { _Src = *(std_string **)local_120->_buf; } strcat_s((char *)local_118,0x100,_Src->_buf); local_11c = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(local_118); FUN_00416490(local_12c,&local_11c); if ((*(char *)((int)local_124 + 0xd) != '\0') || (pvVar3 = local_124, local_11c < *(uint *)((int)local_124 + 0x10))) { pvVar3 = g_anmCacheMap; } if (pvVar3 != g_anmCacheMap) goto LAB_0040e40e; ppbVar4 = ppbVar4 + 1; } while (ppbVar4 != g_mountPrefixesEnd); } if (pvVar3 == g_anmCacheMap) { KAGE_LogMessage(1,(byte *)"[warn] AnmCache: cannot remove reference to %s\n"); } else { LAB_0040e40e: iVar2 = *(int *)((int)pvVar3 + 0x50); if (iVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"cannot remove reference at RefCount 0\n"); iVar2 = *(int *)((int)pvVar3 + 0x50); if (iVar2 == 0) { return; } } *(int *)((int)pvVar3 + 0x50) = iVar2 + -1; } return; } //@@ 0040e470 AnmCache::Clear /* DB: src/anm2 decompile labels (AnmCache::Clear) */ void AnmCache::Clear(void) { void *node; void *pvVar1; void *local_14; local_14 = *(void **)g_anmCacheMap; pvVar1 = g_anmCacheMap; if (local_14 != g_anmCacheMap) { do { node = local_14; if (*(int *)((int)local_14 + 0x50) == 0) { KAGE_LogMessage(1,(byte *)"AnmCache: Clear %u.\n"); AnmFileData::Clear(); local_14 = node; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); pvVar1 = std_tree_extract(&g_anmCacheMap,node); std::string::_Tidy_deallocate((char *)((int)pvVar1 + 0x38)); operator_delete(pvVar1,0x54); pvVar1 = g_anmCacheMap; } else { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } } while (local_14 != pvVar1); } return; } //@@ 0040e520 TextureCache::Add /* DB: src/anm2 decompile labels (TextureCache::Add) prototype: db/protos.zhl, confirmed by RET 8 */ void TextureCache::Add(void *image,void *imageRefCount) { char cVar1; uint uVar2; void *this; byte *filePath; void **other; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0e8d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (image != (void *)0x0) { filePath = *(byte **)((int)image + 0x44); if (*(byte **)((int)image + 0x44) == (byte *)0x0) { filePath = (byte *)"unknown"; if (*(byte **)((int)image + 0x40) != (byte *)0x0) { filePath = *(byte **)((int)image + 0x40); } } local_14 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(filePath); other = ℑ this = (void *)FUN_00414440(&local_14); KAGE::SmartPointer::operator_assign(this,other); } local_8 = 1; if (imageRefCount != (void *)0x0) { cVar1 = (**(code **)(*(int *)imageRefCount + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&image); } } ExceptionList = local_10; return; } //@@ 0040e5d0 TextureCache::Has /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (TextureCache::Has) */ bool TextureCache::Has(char *param_1) { byte ***pppbVar1; byte **ppbVar2; void *pvVar3; bool bVar4; undefined1 local_12c [8]; void *local_124; char *local_120; uint local_11c; byte local_118 [260]; undefined4 local_14; pvVar3 = g_textureCacheMap; local_14 = __security_cookie ^ (uint)(local_118 + 0x108); local_120 = param_1; if (((int)g_mountPrefixesEnd - (int)g_mountPrefixes & 0xfffffffcU) == 0) { pppbVar1 = FileSystem::GetMountPrefixes(local_12c); if (pppbVar1 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar1; g_mountPrefixesEnd = pppbVar1[1]; _DAT_00c798c0 = pppbVar1[2]; *pppbVar1 = (byte **)0x0; pppbVar1[1] = (byte **)0x0; pppbVar1[2] = (byte **)0x0; } FID_conflict__Tidy(local_12c); } ppbVar2 = g_mountPrefixes; if (g_mountPrefixes != g_mountPrefixesEnd) { do { strncpy_s((char *)local_118,0x100,(char *)*ppbVar2,0x100); strcat_s((char *)local_118,0x100,local_120); local_11c = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(local_118); _Find_lower_bound<>(local_12c,&local_11c); if ((*(char *)((int)local_124 + 0xd) != '\0') || (pvVar3 = local_124, local_11c < *(uint *)((int)local_124 + 0x10))) { pvVar3 = g_textureCacheMap; } bVar4 = pvVar3 == g_textureCacheMap; if (!bVar4) goto LAB_0040e723; ppbVar2 = ppbVar2 + 1; } while (ppbVar2 != g_mountPrefixesEnd); } bVar4 = pvVar3 == g_textureCacheMap; LAB_0040e723: return !bVar4; } //@@ 0040e740 TextureCache::Release /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (TextureCache::Release) */ void TextureCache::Release(char *param_1) { ushort uVar1; char *pcVar2; byte ***pppbVar3; void *pvVar4; byte **ppbVar5; undefined1 local_12c [8]; void *local_124; uint local_120; char *local_11c; byte local_118 [260]; undefined4 local_14; pvVar4 = g_textureCacheMap; local_14 = __security_cookie ^ (uint)(local_118 + 0x108); local_11c = param_1; if (param_1 != (char *)0x0) { if (((int)g_mountPrefixesEnd - (int)g_mountPrefixes & 0xfffffffcU) == 0) { pppbVar3 = FileSystem::GetMountPrefixes(local_12c); if (pppbVar3 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar3; g_mountPrefixesEnd = pppbVar3[1]; _DAT_00c798c0 = pppbVar3[2]; *pppbVar3 = (byte **)0x0; pppbVar3[1] = (byte **)0x0; pppbVar3[2] = (byte **)0x0; } FID_conflict__Tidy(local_12c); } ppbVar5 = g_mountPrefixes; if (g_mountPrefixes != g_mountPrefixesEnd) { do { strncpy_s((char *)local_118,0x100,(char *)*ppbVar5,0x100); strcat_s((char *)local_118,0x100,local_11c); local_120 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(local_118); _Find_lower_bound<>(local_12c,&local_120); if ((*(char *)((int)local_124 + 0xd) != '\0') || (pvVar4 = local_124, local_120 < *(uint *)((int)local_124 + 0x10))) { pvVar4 = g_textureCacheMap; } if (pvVar4 != g_textureCacheMap) goto LAB_0040e8a3; ppbVar5 = ppbVar5 + 1; } while (ppbVar5 != g_mountPrefixesEnd); } if (pvVar4 != g_textureCacheMap) { LAB_0040e8a3: pcVar2 = *(char **)((int)pvVar4 + 0x18); local_11c = pcVar2; if (pcVar2 != (char *)0x0) { (**(code **)(*(int *)(pcVar2 + 8) + 0xc))(0xffffffff); uVar1 = *(ushort *)(pcVar2 + 4); (**(code **)(*(int *)(local_11c + 8) + 0x10))(); if (2 < uVar1) { return; } } KAGE::SmartPointer::reset((void *)((int)pvVar4 + 0x14),(void *)0x0); FUN_00414d60(&local_11c,pvVar4); } } return; } //@@ 0040e910 TextureCache::Purge /* DB: src/anm2 decompile labels (TextureCache::Purge) prototype: db/protos.zhl */ void __cdecl TextureCache::Purge(void) { ushort uVar1; int iVar2; char cVar3; uint uVar4; void *pvVar5; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = *(void **)g_textureCacheMap; if (local_14 != g_textureCacheMap) { do { pvVar5 = local_14; iVar2 = *(int *)((int)local_14 + 0x18); if (iVar2 == 0) { LAB_0040e979: KAGE::SmartPointer::reset((void *)((int)pvVar5 + 0x14),(void *)0x0); local_14 = pvVar5; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); pvVar5 = std_tree_extract(&g_textureCacheMap,pvVar5); local_8 = 0; if (*(int **)((int)pvVar5 + 0x18) != (int *)0x0) { cVar3 = (**(code **)(**(int **)((int)pvVar5 + 0x18) + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)pvVar5 + 0x14); } } local_8 = 0xffffffff; operator_delete(pvVar5,0x1c); } else { (**(code **)(*(int *)(iVar2 + 8) + 0xc))(0xffffffff,uVar4); uVar1 = *(ushort *)(iVar2 + 4); (**(code **)(*(int *)(iVar2 + 8) + 0x10))(); if (uVar1 < 3) goto LAB_0040e979; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } } while (local_14 != g_textureCacheMap); } ExceptionList = local_10; return; } //@@ 0040ea10 TextureCache::Preload /* DB: src/anm2 decompile labels (TextureCache::Preload) */ void TextureCache::Preload(byte *param_1) { char cVar1; void *image; void *imageRefCount; undefined1 auStack_6 [2]; image = (void *)0x40ea1c; cVar1 = Has(); if (cVar1 == '\0') { imageRefCount = (void *)0x40ea2b; Game::IsPaused(g_game); Manager::LoadImage(auStack_6 + -10,param_1); Add(image,imageRefCount); } return; } //@@ 0040ea50 AnmCache::Preload /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (AnmCache::Preload) */ void AnmCache::Preload(byte *param_1) { byte bVar1; char cVar2; byte ***pppbVar3; byte *pbVar4; undefined1 *puVar5; byte **ppbVar6; void *pvVar7; void *imageRefCount; undefined1 auStack_15a [2]; uint local_14c; int local_148; uint local_144; void *local_140 [3]; undefined1 local_134 [4]; undefined4 local_130; undefined1 *local_12c; byte local_128 [260]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puVar5 = g_anmCacheMap; puStack_20 = local_128 + 0x124; local_14 = 0xffffffff; puStack_18 = &LAB_00af0ee0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_128 + 0x118); ExceptionList = &local_1c; if (*param_1 != 0) { local_144 = 0; pbVar4 = local_128 + 0x124; if ((uint)((int)g_mountPrefixesEnd - (int)g_mountPrefixes) < 4) { pppbVar3 = FileSystem::GetMountPrefixes(local_134); if (pppbVar3 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar3; g_mountPrefixesEnd = pppbVar3[1]; _DAT_00c798c0 = pppbVar3[2]; *pppbVar3 = (byte **)0x0; pppbVar3[1] = (byte **)0x0; pppbVar3[2] = (byte **)0x0; } FID_conflict__Tidy(local_134); pbVar4 = puStack_20; } puStack_20 = pbVar4; ppbVar6 = g_mountPrefixes; if (g_mountPrefixes != g_mountPrefixesEnd) { do { strncpy_s((char *)local_128,0x100,(char *)*ppbVar6,0x100); strcat_s((char *)local_128,0x100,(char *)param_1); local_144 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(local_128); FUN_00416490(); if ((local_12c[0xd] != '\0') || (puVar5 = local_12c, local_144 < *(uint *)(local_12c + 0x10))) { puVar5 = g_anmCacheMap; } if (puVar5 != g_anmCacheMap) goto LAB_0040ecbd; ppbVar6 = ppbVar6 + 1; } while (ppbVar6 != g_mountPrefixesEnd); } if (puVar5 == g_anmCacheMap) { local_130 = 0; local_12c = &DAT_0000000f; local_140[0] = (void *)0x0; pbVar4 = param_1; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)local_140,param_1,(int)pbVar4 - (int)(param_1 + 1)); local_14 = 0; ParseFile(); local_14 = 0xffffffff; if (&DAT_0000000f < local_12c) { puVar5 = local_12c + 1; pvVar7 = local_140[0]; if ((undefined1 *)0xfff < puVar5) { pvVar7 = *(void **)((int)local_140[0] + -4); puVar5 = local_12c + 0x24; if (0x1f < (uint)((int)local_140[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,(uint)puVar5); } FUN_00416490(); if ((local_12c[0xd] != '\0') || (puVar5 = local_12c, local_144 < *(uint *)(local_12c + 0x10))) { puVar5 = g_anmCacheMap; } if (puVar5 == g_anmCacheMap) { ExceptionList = local_1c; return; } } LAB_0040ecbd: local_14c = 0; if (*(int *)(puVar5 + 0x1c) != 0) { local_148 = 0; do { pbVar4 = (byte *)(local_148 + 0x20 + *(int *)(puVar5 + 0x18)); if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pvVar7 = (void *)0x40ece9; cVar2 = TextureCache::Has(); if (cVar2 == '\0') { imageRefCount = (void *)0x40ecf8; Game::IsPaused(g_game); Manager::LoadImage(auStack_15a + -10,pbVar4); TextureCache::Add(pvVar7,imageRefCount); } local_14c = local_14c + 1; local_148 = local_148 + 0x38; } while (local_14c < *(uint *)(puVar5 + 0x1c)); } } ExceptionList = local_1c; return; } //@@ 0040ed50 AnmCache::ParseFile /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/anm2 decompile labels (AnmCache::ParseFile(path,key)) */ void AnmCache::ParseFile(std_string *param_1,uint param_2) { Color *pCVar1; float fVar2; float fVar3; undefined8 uVar4; byte *****pppppbVar5; byte *****pppppbVar6; byte *****pppppbVar7; byte *****pppppbVar8; byte *****pppppbVar9; byte *****pppppbVar10; uint uVar11; undefined1 uVar12; byte bVar13; uint uVar14; std_string *psVar15; int *piVar16; undefined1 *puVar17; int iVar18; void *pvVar19; byte *pbVar20; byte ****ppppbVar21; uint *puVar22; undefined4 *puVar23; char *pcVar24; byte *****pppppbVar25; int *******pppppppiVar26; char *******pppppppcVar27; byte *******pppppppbVar28; byte ****ppppbVar29; byte *pbVar30; byte *pbVar31; byte ******ppppppbVar32; int iVar33; int extraout_EDX; int extraout_EDX_00; int extraout_EDX_01; int extraout_EDX_02; int extraout_EDX_03; int extraout_EDX_04; byte ******ppppppbVar34; float *extraout_EDX_05; int extraout_EDX_06; int extraout_EDX_07; float *pfVar35; float *extraout_EDX_08; int extraout_EDX_09; int extraout_EDX_10; char *pcVar36; byte *****pppppbVar37; uint *puVar38; byte ******ppppppbVar39; byte ******ppppppbVar40; byte ******ppppppbVar41; byte *****pppppbVar42; bool bVar43; double dVar44; code *pcVar45; byte *****pppppbStack_26808; byte *****pppppbStack_26804; byte *****pppppbStack_26800; byte *****pppppbStack_267fc; undefined8 uStack_267f8; byte *****pppppbStack_267f0; byte *****pppppbStack_267ec; byte *****pppppbStack_267e8; byte *****pppppbStack_267e4; byte *****pppppbStack_267e0; byte *****pppppbStack_267dc; byte *****pppppbStack_267d8; undefined1 uStack_267d4; byte *****apppppbStack_267d0 [64]; byte *****pppppbStack_266d0; undefined4 *puStack_266c4; undefined4 *puStack_266c0; byte *pbStack_266bc; undefined4 *puStack_266b8; byte *******pppppppbStack_266b4; undefined1 *puStack_266b0; void *pvStack_266ac; void *pvStack_266a8; byte ******ppppppbStack_266a4; byte ******ppppppbStack_266a0; byte ******ppppppbStack_2669c; undefined1 uStack_26695; std_string *psStack_26694; byte ******ppppppbStack_26690; byte ******ppppppbStack_2668c; byte ******ppppppbStack_26688; byte ******ppppppbStack_26684; byte ******ppppppbStack_26680; byte ******ppppppbStack_2667c; byte ******ppppppbStack_26678; byte ******ppppppbStack_26674; byte ******ppppppbStack_26670; byte ******ppppppbStack_2666c; byte ******ppppppbStack_26668; byte ******ppppppbStack_26664; byte ******ppppppbStack_26660; byte ******ppppppbStack_2665c; byte ******ppppppbStack_26658; byte ******ppppppbStack_26654; byte ******ppppppbStack_26650; byte ******ppppppbStack_2664c; undefined1 auStack_26648 [48]; undefined1 auStack_26618 [65560]; std_string sStack_16600; byte *******apppppppbStack_165e8 [4]; uint uStack_165d8; uint uStack_165d4; byte *******apppppppbStack_165d0 [4]; uint uStack_165c0; uint uStack_165bc; byte *******apppppppbStack_165b8 [4]; uint uStack_165a8; uint uStack_165a4; byte *******apppppppbStack_165a0 [4]; uint uStack_16590; uint uStack_1658c; byte *******apppppppbStack_16588 [4]; uint uStack_16578; uint uStack_16574; byte *******apppppppbStack_16570 [4]; uint uStack_16560; uint uStack_1655c; byte *******apppppppbStack_16558 [4]; uint uStack_16548; uint uStack_16544; char *******apppppppcStack_16540 [4]; int iStack_16530; uint uStack_1652c; byte *******apppppppbStack_16528 [4]; uint uStack_16518; uint uStack_16514; byte *******apppppppbStack_16510 [4]; uint uStack_16500; uint uStack_164fc; char *******apppppppcStack_164f8 [4]; int iStack_164e8; uint uStack_164e4; char *******apppppppcStack_164e0 [4]; int iStack_164d0; uint uStack_164cc; int *******apppppppiStack_164c8 [4]; int iStack_164b8; uint uStack_164b4; byte ******ppppppbStack_164b0; byte *****apppppbStack_164ac [6]; byte *****apppppbStack_16494 [6]; undefined1 auStack_1647c [212]; byte *****apppppbStack_163a8 [12]; undefined4 auStack_16378 [20146]; byte *****local_28b0; float local_28ac [255]; byte ******local_24b0 [7]; uint local_2494; byte local_2490 [3552]; byte local_16b0 [16]; uint auStack_16a0 [380]; byte ******local_10b0 [4]; uint auStack_10a0 [380]; float local_ab0 [3]; undefined1 auStack_aa4 [1012]; byte local_6b0 [4]; byte *****local_6ac [255]; byte ******local_2b0 [4]; uint auStack_2a0 [92]; byte local_130 [268]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_130 + 300; local_14 = 0xffffffff; puStack_18 = &LAB_00af118f; local_1c = ExceptionList; uVar14 = __security_cookie ^ (uint)(local_130 + 0x120); ExceptionList = &local_1c; psStack_26694 = param_1; local_24 = uVar14; ModManager::TryRedirectPath(&g_manager->_modManager,&sStack_16600,param_1); local_14 = 0; psVar15 = &sStack_16600; if (0xf < sStack_16600._capacity) { psVar15 = (std_string *)sStack_16600._buf._0_4_; } piVar16 = FileSystem::Open(&PTR_vftable_00c37a10,(byte *)psVar15,(int *)0x0); if (piVar16 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"ERROR Could not open %s\n"); goto LAB_00413b0f; } if (param_2 == 0) { if (0xf < param_1->_capacity) { param_1 = *(std_string **)param_1->_buf; } param_2 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash((byte *)param_1); } puVar17 = (undefined1 *)FUN_00414500(¶m_2); puStack_266b0 = puVar17; AnmFileData::Clear(uVar14); *puVar17 = 0; iVar18 = (**(code **)(*piVar16 + 4))(); pbStack_266bc = operator_new_tracked(iVar18 + 1); (**(code **)(*piVar16 + 0x14))(pbStack_266bc,1,iVar18); pbStack_266bc[iVar18] = 0; (**(code **)*piVar16)(1); FUN_00413b90(); local_14._0_1_ = 1; iVar18 = 0x40ee8f; pbVar31 = pbStack_266bc; rapidxml::xml_document::parse(auStack_26648,pbStack_266bc); bVar13 = (byte)pbVar31; ppppppbStack_2664c = xml_node::first_node(auStack_26648,(byte *)"AnimatedActor",iVar18,bVar13); pvStack_266ac = xml_node::first_node(ppppppbStack_2664c,(byte *)"Content",iVar18,bVar13); pvVar19 = xml_node::first_node(pvStack_266ac,(byte *)"Spritesheets",iVar18,bVar13); _eh_vector_constructor_iterator_(local_16b0,0x18,0x40,FUN_0040c380,std::string::_Tidy_deallocate); local_14._0_1_ = 2; ppppppbStack_26678 = *(byte *******)((int)pvVar19 + 0x18); ppppppbStack_266a4 = (byte ******)0x0; while (ppppppbStack_26678 != (byte ******)0x0) { puVar23 = *(undefined4 **)((int)ppppppbStack_26678 + 0x20); ppppppbStack_2669c = (byte ******)0x40; if (puVar23 == (undefined4 *)0x0) { LAB_0040efb3: ppppppbVar41 = ppppppbStack_266a4; KAGE_LogMessage(0x10,(byte *)"%s: invalid spritesheet id %d\n"); } else { do { pbVar31 = (byte *)*puVar23; pbVar30 = &DAT_00b1b31c; pbVar20 = &g_xmlNullStr; if (pbVar31 != (byte *)0x0) { pbVar20 = pbVar31; } do { bVar13 = *pbVar20; bVar43 = bVar13 < *pbVar30; if (bVar13 != *pbVar30) { LAB_0040ef57: uVar14 = -(uint)bVar43 | 1; goto LAB_0040ef5c; } if (bVar13 == 0) break; bVar13 = pbVar20[1]; bVar43 = bVar13 < pbVar30[1]; if (bVar13 != pbVar30[1]) goto LAB_0040ef57; pbVar20 = pbVar20 + 2; pbVar30 = pbVar30 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040ef5c: if (uVar14 == 0) { psVar15 = psStack_26694; if (0xf < psStack_26694->_capacity) { psVar15 = *(std_string **)psStack_26694->_buf; } ResolveRelativePath(local_130,psVar15); } else { pbVar30 = &DAT_00b1b324; pbVar20 = &g_xmlNullStr; if (pbVar31 != (byte *)0x0) { pbVar20 = pbVar31; } do { bVar13 = *pbVar20; bVar43 = bVar13 < *pbVar30; if (bVar13 != *pbVar30) { LAB_0040f120: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f125; } if (bVar13 == 0) break; bVar13 = pbVar20[1]; bVar43 = bVar13 < pbVar30[1]; if (bVar13 != pbVar30[1]) goto LAB_0040f120; pbVar20 = pbVar20 + 2; pbVar30 = pbVar30 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040f125: if (uVar14 == 0) { pbVar31 = &g_xmlNullStr; if ((byte *)puVar23[1] != (byte *)0x0) { pbVar31 = (byte *)puVar23[1]; } ppppppbStack_2669c = (byte ******)atoi((char *)pbVar31); } } } while ((puVar23[4] != 0) && (puVar23 = (undefined4 *)puVar23[6], puVar23 != (undefined4 *)0x0)); if ((0x3f < (int)ppppppbStack_2669c) || (ppppppbVar41 = ppppppbStack_266a4, ppppppbStack_2669c != ppppppbStack_266a4)) goto LAB_0040efb3; } pbVar31 = local_130; do { bVar13 = *pbVar31; pbVar31 = pbVar31 + 1; } while (bVar13 != 0); std::string::assign((char *)(local_16b0 + (int)ppppppbStack_2669c * 0x18),local_130, (int)pbVar31 - (int)(local_130 + 1)); ppppppbStack_266a4 = (byte ******)((int)ppppppbVar41 + 1); ppppppbStack_26678 = *(byte *******)((int)ppppppbStack_26678 + 0x2c); } bVar13 = 0x70; puVar17 = &LAB_0040d140; _eh_vector_constructor_iterator_ (local_24b0,0x38,0x40,(_func_void_void_ptr *)&LAB_0040d140,FUN_0040db70); ppppppbVar41 = (byte ******)0x0; local_14._0_1_ = 3; ppppppbStack_2668c = (byte ******)0x0; pvVar19 = xml_node::first_node(pvStack_266ac,(byte *)"Layers",(int)puVar17,bVar13); ppppppbStack_26678 = *(byte *******)((int)pvVar19 + 0x18); if (ppppppbStack_26678 == (byte ******)0x0) { LAB_0040f3b5: KAGE_LogMessage(0x10,(byte *)"%s: no layers\n"); } else { do { ppppppbStack_2669c = (byte ******)0x40; uStack_16590 = 0; uStack_1658c = 0xf; apppppppbStack_165a0[0] = (byte *******)0x0; local_14 = CONCAT31(local_14._1_3_,4); pppppbVar42 = ppppppbStack_26678[8]; ppppppbStack_26680 = (byte ******)0xffffffff; if (pppppbVar42 == (byte *****)0x0) { LAB_0040f26a: ppppppbVar41 = ppppppbStack_2669c; KAGE_LogMessage(0x10,(byte *)"%s: invalid layer id %d\n"); } else { do { ppppbVar29 = *pppppbVar42; pbVar31 = &DAT_00b1b350; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040f151: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f156; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040f151; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040f156: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppbVar21 = ppppbVar29; do { bVar13 = *(byte *)ppppbVar21; ppppbVar21 = (byte ****)((int)ppppbVar21 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_165a0,(byte *)ppppbVar29, (int)ppppbVar21 - (int)((int)ppppbVar29 + 1)); } else { pbVar31 = &DAT_00b1b324; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040f1c0: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f1c5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040f1c0; pbVar31 = pbVar31 + 2; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); } while (bVar13 != 0); uVar14 = 0; LAB_0040f1c5: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppppbStack_2669c = (byte ******)atoi((char *)ppppbVar29); } else { pcVar24 = "SpritesheetId"; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_0040f220: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f225; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_0040f220; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040f225: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppppbStack_26680 = (byte ******)atoi((char *)ppppbVar29); } } } } while ((pppppbVar42[4] != (byte ****)0x0) && (pppppbVar42 = (byte *****)pppppbVar42[6], pppppbVar42 != (byte *****)0x0)); if ((0x3f < (int)ppppppbStack_2669c) || (ppppppbVar41 = ppppppbStack_2669c, ppppppbStack_2669c != ppppppbStack_2668c)) goto LAB_0040f26a; } ppppppbVar32 = ppppppbStack_26680; if (((int)ppppppbStack_26680 < 0) || ((int)ppppppbStack_266a4 <= (int)ppppppbStack_26680)) { KAGE_LogMessage(0x10,(byte *)"%s: invalid spritesheet id %d\n"); } pbVar31 = local_16b0 + (int)ppppppbVar32 * 0x18; if (local_2490 + (int)ppppppbVar41 * 0x38 != pbVar31) { if (0xf < auStack_16a0[(int)ppppppbVar32 * 6 + 1]) { pbVar31 = *(byte **)pbVar31; } std::string::assign((char *)(local_2490 + (int)ppppppbVar41 * 0x38),pbVar31, auStack_16a0[(int)ppppppbVar32 * 6]); } local_24b0[(int)ppppppbVar41 * 0xe] = ppppppbVar41; local_24b0[(int)ppppppbVar41 * 0xe + 1] = ppppppbStack_26680; if ((byte ********)(local_24b0 + (int)ppppppbVar41 * 0xe + 2) != apppppppbStack_165a0) { pppppppbVar28 = (byte *******)apppppppbStack_165a0; if (0xf < uStack_1658c) { pppppppbVar28 = apppppppbStack_165a0[0]; } std::string::assign((char *)(local_24b0 + (int)ppppppbVar41 * 0xe + 2),(byte *)pppppppbVar28 ,uStack_16590); } ppppppbVar41 = (byte ******)((int)ppppppbStack_2668c + 1); local_14._0_1_ = 3; ppppppbStack_2668c = ppppppbVar41; if (0xf < uStack_1658c) { uVar14 = uStack_1658c + 1; pppppppbVar28 = apppppppbStack_165a0[0]; if (0xfff < uVar14) { pppppppbVar28 = (byte *******)apppppppbStack_165a0[0][-1]; uVar14 = uStack_1658c + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_165a0[0] + (-4 - (int)pppppppbVar28))) goto LAB_00413762; } operator_delete(pppppppbVar28,uVar14); } uStack_16590 = 0; uStack_1658c = 0xf; apppppppbStack_165a0[0] = (byte *******)((uint)apppppppbStack_165a0[0] & 0xffffff00); ppppppbStack_26678 = (byte ******)ppppppbStack_26678[0xb]; } while (ppppppbStack_26678 != (byte ******)0x0); if (ppppppbVar41 == (byte ******)0x0) goto LAB_0040f3b5; } ppppppbStack_26678 = (byte ******)0x0; uVar14 = -(uint)((int)(ZEXT48(ppppppbVar41) * 0x38 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbVar41) * 0x38); ppppppbStack_26654 = ppppppbVar41; ppppppbStack_26678 = operator_new_tracked(-(uint)(0xfffffffb < uVar14) | uVar14 + 4); local_14._0_1_ = 5; if (ppppppbStack_26678 == (byte ******)0x0) { ppppppbVar32 = (byte ******)0x0; ppppppbStack_26680 = (byte ******)0x0; } else { ppppppbVar32 = ppppppbStack_26678 + 1; *ppppppbStack_26678 = (byte *****)ppppppbVar41; ppppppbStack_26680 = ppppppbVar32; _eh_vector_constructor_iterator_ (ppppppbVar32,0x38,(uint)ppppppbVar41,(_func_void_void_ptr *)&LAB_0040d140, FUN_0040db70); } local_14._0_1_ = 3; ppppppbVar40 = (byte ******)0x0; if (ppppppbVar41 != (byte ******)0x0) { ppppppbVar32 = ppppppbVar32 + 8; puVar38 = &local_2494; ppppppbStack_26678 = ppppppbStack_2668c; ppppppbVar41 = (byte ******)((int)ppppppbStack_26680 - (int)puVar38); ppppppbStack_26654 = ppppppbVar41; do { *(uint *)((int)ppppppbVar41 + (int)puVar38) = puVar38[-7]; if (ppppppbVar32 != (byte ******)(puVar38 + 1)) { puVar22 = puVar38 + -5; if (0xf < *puVar38) { puVar22 = (uint *)*puVar22; } std::string::assign((char *)(ppppppbVar32 + -6),(byte *)puVar22,puVar38[-1]); puVar22 = puVar38 + 1; if (0xf < puVar38[6]) { puVar22 = (uint *)*puVar22; } std::string::assign((char *)ppppppbVar32,(byte *)puVar22,puVar38[5]); ppppppbVar41 = ppppppbStack_26654; } pfVar35 = (float *)(puVar38 + -6); puVar38 = puVar38 + 0xe; ppppppbVar32[-7] = (byte *****)*pfVar35; ppppppbVar32 = ppppppbVar32 + 0xe; ppppppbStack_26678 = (byte ******)((int)ppppppbStack_26678 + -1); } while (ppppppbStack_26678 != (byte ******)0x0); ppppppbVar40 = ppppppbStack_2668c; } bVar13 = 0x20; pcVar45 = FUN_0040c380; *(byte *******)(puStack_266b0 + 4) = ppppppbStack_26680; *(byte *******)(puStack_266b0 + 8) = ppppppbVar40; _eh_vector_constructor_iterator_(local_10b0,0x18,0x40,FUN_0040c380,std::string::_Tidy_deallocate); local_14._0_1_ = 6; ppppppbStack_26684 = (byte ******)0x0; pvVar19 = xml_node::first_node(pvStack_266ac,(byte *)"Nulls",(int)pcVar45,bVar13); ppppppbStack_26678 = *(byte *******)((int)pvVar19 + 0x18); ppppppbVar41 = (byte ******)0x0; ppppppbVar32 = ppppppbStack_26678; if (ppppppbStack_26678 != (byte ******)0x0) { do { ppppppbStack_26680 = (byte ******)0x40; uStack_16578 = 0; uStack_16574 = 0xf; apppppppbStack_16588[0] = (byte *******)0x0; local_14 = CONCAT31(local_14._1_3_,7); pppppbVar42 = ppppppbStack_26678[8]; if (pppppbVar42 == (byte *****)0x0) { LAB_0040f664: ppppppbVar32 = ppppppbStack_26680; ppppppbVar41 = ppppppbStack_26684; KAGE_LogMessage(0x10,(byte *)"%s: invalid Null ID %d\n"); } else { do { ppppbVar29 = *pppppbVar42; pbVar31 = &DAT_00b1b324; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040f5a1: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f5a6; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040f5a1; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040f5a6: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppppbStack_26680 = (byte ******)atoi((char *)ppppbVar29); } else { pbVar31 = &DAT_00b1b350; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040f600: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f605; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040f600; pbVar31 = pbVar31 + 2; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); } while (bVar13 != 0); uVar14 = 0; LAB_0040f605: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppbVar21 = ppppbVar29; do { bVar13 = *(byte *)ppppbVar21; ppppbVar21 = (byte ****)((int)ppppbVar21 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_16588,(byte *)ppppbVar29, (int)ppppbVar21 - (int)((int)ppppbVar29 + 1)); } } } while ((pppppbVar42[4] != (byte ****)0x0) && (pppppbVar42 = (byte *****)pppppbVar42[6], pppppbVar42 != (byte *****)0x0)); if (0x3f < (int)ppppppbStack_26680) goto LAB_0040f664; ppppppbVar41 = ppppppbStack_26684; ppppppbVar32 = ppppppbStack_26680; if (ppppppbStack_26680 != ppppppbStack_26684) goto LAB_0040f664; } if ((byte ********)(local_10b0 + (int)ppppppbVar32 * 6) != apppppppbStack_16588) { pppppppbVar28 = (byte *******)apppppppbStack_16588; if (0xf < uStack_16574) { pppppppbVar28 = apppppppbStack_16588[0]; } std::string::assign((char *)(local_10b0 + (int)ppppppbVar32 * 6),(byte *)pppppppbVar28, uStack_16578); } ppppppbVar41 = (byte ******)((int)ppppppbVar41 + 1); local_14._0_1_ = 6; ppppppbStack_26684 = ppppppbVar41; if (0xf < uStack_16574) { uVar14 = uStack_16574 + 1; pppppppbVar28 = apppppppbStack_16588[0]; if (0xfff < uVar14) { pppppppbVar28 = (byte *******)apppppppbStack_16588[0][-1]; uVar14 = uStack_16574 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_16588[0] + (-4 - (int)pppppppbVar28))) goto LAB_00413762; } operator_delete(pppppppbVar28,uVar14); } uStack_16578 = 0; uStack_16574 = 0xf; apppppppbStack_16588[0] = (byte *******)((uint)apppppppbStack_16588[0] & 0xffffff00); ppppppbStack_26678 = (byte ******)ppppppbStack_26678[0xb]; } while (ppppppbStack_26678 != (byte ******)0x0); ppppppbVar32 = (byte ******)0x0; if (ppppppbVar41 != (byte ******)0x0) { uVar14 = -(uint)((int)(ZEXT48(ppppppbVar41) * 0x18 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbVar41) * 0x18); puVar23 = operator_new_tracked(-(uint)(0xfffffffb < uVar14) | uVar14 + 4); if (puVar23 == (undefined4 *)0x0) { ppppppbStack_26680 = (byte ******)0x0; } else { *puVar23 = ppppppbVar41; ppppppbStack_26680 = (byte ******)(puVar23 + 1); _eh_vector_constructor_iterator_ (ppppppbStack_26680,0x18,(uint)ppppppbVar41,FUN_0040c380, std::string::_Tidy_deallocate); } ppppppbStack_26678 = ppppppbStack_26684; iVar18 = -(int)ppppppbStack_26680; ppppppbVar41 = (byte ******)((int)local_10b0 - (int)ppppppbStack_26680); ppppppbStack_26654 = ppppppbVar41; ppppppbVar32 = ppppppbStack_26680; do { ppppppbVar40 = (byte ******)((int)ppppppbVar41 + (int)ppppppbVar32); if (ppppppbVar32 != ppppppbVar40) { if (0xf < *(uint *)((int)auStack_10a0 + iVar18 + 4 + (int)ppppppbVar32)) { ppppppbVar40 = (byte ******)*ppppppbVar40; } std::string::assign((char *)ppppppbVar32,(byte *)ppppppbVar40, *(uint *)((int)auStack_10a0 + iVar18 + (int)ppppppbVar32)); ppppppbVar41 = ppppppbStack_26654; } ppppppbVar32 = ppppppbVar32 + 6; ppppppbStack_26678 = (byte ******)((int)ppppppbStack_26678 + -1); } while (ppppppbStack_26678 != (byte ******)0x0); *(byte *******)(puStack_266b0 + 0x14) = ppppppbStack_26680; ppppppbVar41 = ppppppbStack_26684; ppppppbVar32 = ppppppbStack_26678; } } ppppppbStack_26678 = ppppppbVar32; bVar13 = 0x20; pcVar45 = FUN_0040c380; *(byte *******)(puStack_266b0 + 0x18) = ppppppbVar41; _eh_vector_constructor_iterator_(local_2b0,0x18,0x10,FUN_0040c380,std::string::_Tidy_deallocate); local_14._0_1_ = 8; ppppppbStack_26684 = (byte ******)0x0; pvVar19 = xml_node::first_node(pvStack_266ac,(byte *)"Events",(int)pcVar45,bVar13); ppppppbStack_26678 = *(byte *******)((int)pvVar19 + 0x18); ppppppbVar41 = (byte ******)0x0; ppppppbVar32 = ppppppbStack_26678; if (ppppppbStack_26678 != (byte ******)0x0) { do { ppppppbStack_26680 = (byte ******)0x10; uStack_16560 = 0; uStack_1655c = 0xf; apppppppbStack_16570[0] = (byte *******)0x0; local_14 = CONCAT31(local_14._1_3_,9); pppppbVar42 = ppppppbStack_26678[8]; if (pppppbVar42 == (byte *****)0x0) { LAB_0040f994: ppppppbVar32 = ppppppbStack_26680; ppppppbVar41 = ppppppbStack_26684; KAGE_LogMessage(0x10,(byte *)"%s: invalid Event ID %d\n"); } else { do { ppppbVar29 = *pppppbVar42; pbVar31 = &DAT_00b1b324; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040f8d1: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f8d6; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040f8d1; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040f8d6: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppppbStack_26680 = (byte ******)atoi((char *)ppppbVar29); } else { pbVar31 = &DAT_00b1b350; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040f930: uVar14 = -(uint)bVar43 | 1; goto LAB_0040f935; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040f930; pbVar31 = pbVar31 + 2; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); } while (bVar13 != 0); uVar14 = 0; LAB_0040f935: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } ppppbVar21 = ppppbVar29; do { bVar13 = *(byte *)ppppbVar21; ppppbVar21 = (byte ****)((int)ppppbVar21 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_16570,(byte *)ppppbVar29, (int)ppppbVar21 - (int)((int)ppppbVar29 + 1)); } } } while ((pppppbVar42[4] != (byte ****)0x0) && (pppppbVar42 = (byte *****)pppppbVar42[6], pppppbVar42 != (byte *****)0x0)); if (0xf < (int)ppppppbStack_26680) goto LAB_0040f994; ppppppbVar41 = ppppppbStack_26684; ppppppbVar32 = ppppppbStack_26680; if (ppppppbStack_26680 != ppppppbStack_26684) goto LAB_0040f994; } if ((byte ********)(local_2b0 + (int)ppppppbVar32 * 6) != apppppppbStack_16570) { pppppppbVar28 = (byte *******)apppppppbStack_16570; if (0xf < uStack_1655c) { pppppppbVar28 = apppppppbStack_16570[0]; } std::string::assign((char *)(local_2b0 + (int)ppppppbVar32 * 6),(byte *)pppppppbVar28, uStack_16560); } ppppppbVar41 = (byte ******)((int)ppppppbVar41 + 1); local_14._0_1_ = 8; ppppppbStack_26684 = ppppppbVar41; if (0xf < uStack_1655c) { uVar14 = uStack_1655c + 1; pppppppbVar28 = apppppppbStack_16570[0]; if (0xfff < uVar14) { pppppppbVar28 = (byte *******)apppppppbStack_16570[0][-1]; uVar14 = uStack_1655c + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_16570[0] + (-4 - (int)pppppppbVar28))) { LAB_00413762: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar28,uVar14); } uStack_16560 = 0; uStack_1655c = 0xf; apppppppbStack_16570[0] = (byte *******)((uint)apppppppbStack_16570[0] & 0xffffff00); ppppppbStack_26678 = (byte ******)ppppppbStack_26678[0xb]; } while (ppppppbStack_26678 != (byte ******)0x0); ppppppbVar32 = (byte ******)0x0; if (ppppppbVar41 != (byte ******)0x0) { uVar14 = -(uint)((int)(ZEXT48(ppppppbVar41) * 0x18 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbVar41) * 0x18); puVar23 = operator_new_tracked(-(uint)(0xfffffffb < uVar14) | uVar14 + 4); if (puVar23 == (undefined4 *)0x0) { ppppppbStack_26680 = (byte ******)0x0; } else { *puVar23 = ppppppbVar41; ppppppbStack_26680 = (byte ******)(puVar23 + 1); _eh_vector_constructor_iterator_ (ppppppbStack_26680,0x18,(uint)ppppppbVar41,FUN_0040c380, std::string::_Tidy_deallocate); } ppppppbStack_26678 = ppppppbStack_26684; iVar18 = -(int)ppppppbStack_26680; ppppppbVar41 = (byte ******)((int)local_2b0 - (int)ppppppbStack_26680); ppppppbStack_26654 = ppppppbVar41; ppppppbVar32 = ppppppbStack_26680; do { ppppppbVar40 = (byte ******)((int)ppppppbVar41 + (int)ppppppbVar32); if (ppppppbVar32 != ppppppbVar40) { if (0xf < *(uint *)((int)auStack_2a0 + iVar18 + 4 + (int)ppppppbVar32)) { ppppppbVar40 = (byte ******)*ppppppbVar40; } std::string::assign((char *)ppppppbVar32,(byte *)ppppppbVar40, *(uint *)((int)auStack_2a0 + iVar18 + (int)ppppppbVar32)); ppppppbVar41 = ppppppbStack_26654; } ppppppbVar32 = ppppppbVar32 + 6; ppppppbStack_26678 = (byte ******)((int)ppppppbStack_26678 + -1); } while (ppppppbStack_26678 != (byte ******)0x0); *(byte *******)(puStack_266b0 + 0x1c) = ppppppbStack_26680; ppppppbVar41 = ppppppbStack_26684; ppppppbVar32 = ppppppbStack_26678; } } ppppppbStack_26678 = ppppppbVar32; pcVar45 = std::string::_Tidy_deallocate; pbVar31 = &LAB_0040bec0; *(byte *******)(puStack_266b0 + 0x20) = ppppppbVar41; _eh_vector_constructor_iterator_ (&ppppppbStack_164b0,0x13c,0x100,(_func_void_void_ptr *)&LAB_0040bec0, std::string::_Tidy_deallocate); local_14 = CONCAT31(local_14._1_3_,10); puStack_266b8 = (undefined4 *)0x0; ppppppbStack_26678 = xml_node::first_node(ppppppbStack_2664c,(byte *)"Animations",(int)pbVar31,(byte)pcVar45); for (puVar23 = xml_node::first_attribute (ppppppbStack_26678,(byte *)0x0,(uint)pbVar31,(byte)pcVar45); bVar13 = (byte)pcVar45, puVar23 != (undefined4 *)0x0; puVar23 = (undefined4 *)puVar23[6]) { pcVar24 = "DefaultAnimation"; pbVar20 = &g_xmlNullStr; if ((byte *)*puVar23 != (byte *)0x0) { pbVar20 = (byte *)*puVar23; } do { bVar13 = *pbVar20; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_0040fbc2: uVar14 = -(uint)bVar43 | 1; goto LAB_0040fbc7; } if (bVar13 == 0) break; bVar13 = pbVar20[1]; bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_0040fbc2; pbVar20 = pbVar20 + 2; pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040fbc7: if (uVar14 == 0) { pbVar31 = &g_xmlNullStr; if ((byte *)puVar23[1] != (byte *)0x0) { pbVar31 = (byte *)puVar23[1]; } pbVar20 = pbVar31; do { bVar13 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar13 != 0); pcVar45 = (code *)(pbVar20 + -(int)(pbVar31 + 1)); std::string::assign(puStack_266b0 + 0x24,pbVar31,(uint)pcVar45); } bVar13 = (byte)pcVar45; if (puVar23[4] == 0) break; } ppppppbStack_26684 = xml_node::first_node(ppppppbStack_26678,(byte *)"Animation",(int)pbVar31,bVar13); ppppppbStack_26678 = operator_new_tracked(420000); if (ppppppbStack_26678 == (void *)0x0) { pvStack_266a8 = (void *)0x0; } else { iVar18 = 5000; puVar23 = (undefined4 *)((int)ppppppbStack_26678 + 4); pvStack_266a8 = ppppppbStack_26678; do { *puVar23 = 0; puVar23[-1] = 0; puVar23[4] = 0; puVar23[3] = 0; Color::Color((Color *)(puVar23 + 5)); *(undefined1 *)(extraout_EDX + 0x44) = 0; puVar23 = (undefined4 *)(extraout_EDX + 0x54); iVar18 = iVar18 + -1; } while (iVar18 != 0); } local_14 = CONCAT31(local_14._1_3_,10); ppppppbStack_26654 = operator_new_tracked(420000); if (ppppppbStack_26654 == (byte ******)0x0) { ppppppbStack_26678 = (byte ******)0x0; } else { iVar18 = 5000; ppppppbVar41 = ppppppbStack_26654 + 1; ppppppbStack_26678 = ppppppbStack_26654; do { *ppppppbVar41 = (byte *****)0x0; ppppppbVar41[-1] = (byte *****)0x0; ppppppbVar41[4] = (byte *****)0x0; ppppppbVar41[3] = (byte *****)0x0; Color::Color((Color *)(ppppppbVar41 + 5)); *(undefined1 *)(extraout_EDX_00 + 0x44) = 0; ppppppbVar41 = (byte ******)(extraout_EDX_00 + 0x54); iVar18 = iVar18 + -1; } while (iVar18 != 0); } local_14 = CONCAT31(local_14._1_3_,10); ppppppbStack_26654 = operator_new_tracked(420000); if (ppppppbStack_26654 == (void *)0x0) { pvStack_266ac = (void *)0x0; } else { iVar18 = 5000; puVar23 = (undefined4 *)((int)ppppppbStack_26654 + 4); pvStack_266ac = ppppppbStack_26654; do { *puVar23 = 0; puVar23[-1] = 0; puVar23[4] = 0; puVar23[3] = 0; Color::Color((Color *)(puVar23 + 5)); *(undefined1 *)(extraout_EDX_01 + 0x44) = 0; puVar23 = (undefined4 *)(extraout_EDX_01 + 0x54); iVar18 = iVar18 + -1; } while (iVar18 != 0); } local_14 = CONCAT31(local_14._1_3_,10); ppppppbStack_26654 = operator_new_tracked(420000); if (ppppppbStack_26654 == (byte ******)0x0) { ppppppbStack_266a4 = (byte ******)0x0; } else { iVar18 = 5000; ppppppbVar41 = ppppppbStack_26654 + 1; ppppppbStack_266a4 = ppppppbStack_26654; do { *ppppppbVar41 = (byte *****)0x0; ppppppbVar41[-1] = (byte *****)0x0; ppppppbVar41[4] = (byte *****)0x0; ppppppbVar41[3] = (byte *****)0x0; Color::Color((Color *)(ppppppbVar41 + 5)); *(undefined1 *)(extraout_EDX_02 + 0x44) = 0; ppppppbVar41 = (byte ******)(extraout_EDX_02 + 0x54); iVar18 = iVar18 + -1; } while (iVar18 != 0); } local_14 = CONCAT31(local_14._1_3_,10); ppppppbStack_26654 = operator_new_tracked(540000); if (ppppppbStack_26654 == (byte ******)0x0) { ppppppbStack_26680 = (byte ******)0x0; } else { iVar18 = 5000; ppppppbVar41 = ppppppbStack_26654 + 5; ppppppbStack_26680 = ppppppbStack_26654; do { ppppppbVar41[-4] = (byte *****)0x0; ppppppbVar41[-5] = (byte *****)0x0; ppppppbVar41[-2] = (byte *****)0x0; ppppppbVar41[-3] = (byte *****)0x0; *ppppppbVar41 = (byte *****)0x0; ppppppbVar41[-1] = (byte *****)0x0; ppppppbVar41[2] = (byte *****)0x0; ppppppbVar41[1] = (byte *****)0x0; ppppppbVar41[4] = (byte *****)0x0; ppppppbVar41[3] = (byte *****)0x0; Color::Color((Color *)(ppppppbVar41 + 7)); *(undefined1 *)(extraout_EDX_03 + 0x4c) = 0; ppppppbVar41 = (byte ******)(extraout_EDX_03 + 0x6c); iVar18 = iVar18 + -1; } while (iVar18 != 0); } local_14 = CONCAT31(local_14._1_3_,10); ppppppbStack_2669c = operator_new_tracked(540000); if (ppppppbStack_2669c == (byte ******)0x0) { ppppppbStack_2669c = (byte ******)0x0; } else { iVar18 = 5000; ppppppbVar41 = ppppppbStack_2669c + 5; ppppppbStack_26654 = ppppppbStack_2669c; do { ppppppbVar41[-4] = (byte *****)0x0; ppppppbVar41[-5] = (byte *****)0x0; ppppppbVar41[-2] = (byte *****)0x0; ppppppbVar41[-3] = (byte *****)0x0; *ppppppbVar41 = (byte *****)0x0; ppppppbVar41[-1] = (byte *****)0x0; ppppppbVar41[2] = (byte *****)0x0; ppppppbVar41[1] = (byte *****)0x0; ppppppbVar41[4] = (byte *****)0x0; ppppppbVar41[3] = (byte *****)0x0; Color::Color((Color *)(ppppppbVar41 + 7)); *(undefined1 *)(extraout_EDX_04 + 0x4c) = 0; ppppppbVar41 = (byte ******)(extraout_EDX_04 + 0x6c); iVar18 = iVar18 + -1; } while (iVar18 != 0); } local_14._0_1_ = 10; puVar23 = puStack_266b8; ppppppbVar41 = ppppppbStack_26684; while (puStack_266b8 = puVar23, ppppppbVar41 != (byte ******)0x0) { uStack_165d8 = 0; uStack_165d4 = 0xf; apppppppbStack_165e8[0] = (byte *******)0x0; local_14._0_1_ = 0x11; ppppppbVar41 = (byte ******)ppppppbVar41[8]; ppppppbStack_2667c = (byte ******)0x0; uStack_26695 = 0; for (; ppppppbStack_26654 = ppppppbVar41, ppppppbVar41 != (byte ******)0x0; ppppppbVar41 = (byte ******)ppppppbVar41[6]) { pppppbVar42 = *ppppppbVar41; pbVar31 = &DAT_00b1b350; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_0040ff91: uVar14 = -(uint)bVar43 | 1; goto LAB_0040ff96; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_0040ff91; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0040ff96: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_165e8,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); } else { pcVar24 = "FrameNum"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410000: uVar14 = -(uint)bVar43 | 1; goto LAB_00410005; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410000; pcVar24 = pcVar24 + 2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); } while (bVar13 != 0); uVar14 = 0; LAB_00410005: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } ppppppbStack_2667c = (byte ******)atoi((char *)pppppbVar42); } else { pbVar31 = &DAT_00b1b410; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_00410060: uVar14 = -(uint)bVar43 | 1; goto LAB_00410065; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_00410060; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410065: if (uVar14 == 0) { apppppppiStack_164c8[0] = (int *******)0x0; iStack_164b8 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } uStack_164b4 = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppiStack_164c8,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); if (iStack_164b8 == 0) { LAB_0041018f: uStack_26695 = 0; } else { pppppppiVar26 = (int *******)apppppppiStack_164c8; if (0xf < uStack_164b4) { pppppppiVar26 = apppppppiStack_164c8[0]; } if (iStack_164b8 == 4) { if ((*pppppppiVar26 == (int ******)0x65757274) || ((((bVar13 = (byte)*pppppppiVar26, bVar43 = bVar13 < 0x74, bVar13 == 0x74 && (bVar43 = *(byte *)((int)pppppppiVar26 + 1) < 0x72, *(byte *)((int)pppppppiVar26 + 1) == 0x72)) && (bVar43 = *(byte *)((int)pppppppiVar26 + 2) < 0x75, *(byte *)((int)pppppppiVar26 + 2) == 0x75)) && (bVar43 = *(byte *)((int)pppppppiVar26 + 3) < 0x65, *(byte *)((int)pppppppiVar26 + 3) == 0x65)))) { uVar14 = 0; } else { uVar14 = -(uint)bVar43 | 1; } if (uVar14 != 0) goto LAB_0041011b; } else { LAB_0041011b: pppppppiVar26 = (int *******)apppppppiStack_164c8; if (0xf < uStack_164b4) { pppppppiVar26 = apppppppiStack_164c8[0]; } if (iStack_164b8 == 4) { if ((*pppppppiVar26 == (int ******)0x65757254) || (((bVar13 = (byte)*pppppppiVar26, bVar43 = bVar13 < 0x54, bVar13 == 0x54 && (bVar43 = *(byte *)((int)pppppppiVar26 + 1) < 0x72, *(byte *)((int)pppppppiVar26 + 1) == 0x72)) && ((bVar43 = *(byte *)((int)pppppppiVar26 + 2) < 0x75, *(byte *)((int)pppppppiVar26 + 2) == 0x75 && (bVar43 = *(byte *)((int)pppppppiVar26 + 3) < 0x65, *(byte *)((int)pppppppiVar26 + 3) == 0x65)))))) { uVar14 = 0; } else { uVar14 = -(uint)bVar43 | 1; } if (uVar14 == 0) goto LAB_00410186; } pppppppiVar26 = (int *******)apppppppiStack_164c8; if (0xf < uStack_164b4) { pppppppiVar26 = apppppppiStack_164c8[0]; } iVar18 = atoi((char *)pppppppiVar26); if (iVar18 == 0) goto LAB_0041018f; } LAB_00410186: uStack_26695 = 1; } if (0xf < uStack_164b4) { uVar14 = uStack_164b4 + 1; pppppppiVar26 = apppppppiStack_164c8[0]; if (0xfff < uVar14) { pppppppiVar26 = (int *******)apppppppiStack_164c8[0][-1]; uVar14 = uStack_164b4 + 0x24; if (0x1f < (uint)((int)apppppppiStack_164c8[0] + (-4 - (int)pppppppiVar26))) goto LAB_00413762; } operator_delete(pppppppiVar26,uVar14); } iStack_164b8 = 0; uStack_164b4 = 0xf; apppppppiStack_164c8[0] = (int *******)((uint)apppppppiStack_164c8[0] & 0xffffff00); ppppppbVar41 = ppppppbStack_26654; } } } if (ppppppbVar41[4] == (byte *****)0x0) break; } ppppppbVar41 = ppppppbStack_2667c; puVar23 = puStack_266b8; iVar18 = (int)puStack_266b8 * 0x13c; pppppppbStack_266b4 = &ppppppbStack_164b0 + (int)puStack_266b8 * 0x4f; auStack_16378[(int)puStack_266b8 * 0x4f] = puStack_266b8; puStack_266b8 = (undefined4 *)((int)puStack_266b8 + 1); if ((byte ********)pppppppbStack_266b4 != apppppppbStack_165e8) { pppppppbVar28 = (byte *******)apppppppbStack_165e8; if (0xf < uStack_165d4) { pppppppbVar28 = apppppppbStack_165e8[0]; } std::string::assign((char *)pppppppbStack_266b4,(byte *)pppppppbVar28,uStack_165d8); } apppppbStack_16494[(int)puVar23 * 0x4f + 5] = (byte *****)ppppppbVar41; auStack_1647c[iVar18] = uStack_26695; pcVar24 = "RootAnimation"; do { pcVar36 = pcVar24; pcVar24 = pcVar36 + 1; } while (*pcVar24 != '\0'); for (pppppbVar42 = ppppppbStack_26684[6]; pppppbVar42 != (byte *****)0x0; pppppbVar42 = (byte *****)pppppbVar42[0xb]) { pbVar31 = (byte *)*pppppbVar42; if ((byte ****)pbVar31 == (byte ****)0x0) { ppppbVar29 = (byte ****)0x0; pbVar31 = &g_xmlNullStr; } else { ppppbVar29 = pppppbVar42[2]; } if (ppppbVar29 == (byte ****)(pcVar36 + -0xb1b417)) { ppppbVar29 = (byte ****)((int)pbVar31 + (int)ppppbVar29); if (ppppbVar29 <= pbVar31) goto LAB_004102d1; iVar18 = (int)"RootAnimation" - (int)pbVar31; while (*pbVar31 == *(byte *)((int)pbVar31 + iVar18)) { pbVar31 = (byte *)((int)pbVar31 + 1); if (ppppbVar29 <= pbVar31) goto LAB_004102d1; } } } pppppbVar42 = (byte *****)0x0; LAB_004102d1: ppppppbVar41 = (byte ******)pppppbVar42[6]; ppppppbStack_2667c = (byte ******)0x0; ppppppbStack_26690 = (byte ******)0x0; ppppppbVar32 = ppppppbStack_26690; while( true ) { ppppppbStack_26654 = ppppppbVar41; ppppppbStack_26690 = ppppppbVar32; if (ppppppbVar41 == (byte ******)0x0) break; if ((byte ******)0x1387 < ppppppbVar32) { KAGE_LogMessage(0x10,(byte *)"%s: too many root frames\n"); } ppppppbStack_26688 = (byte ******)ppppppbVar41[8]; ppppppbStack_26690 = (byte ******)((int)ppppppbVar32 + 1); ppppppbStack_2665c = (byte ******)0x3f800000; ppppppbStack_26660 = (byte ******)0x3f800000; ppppppbStack_26668 = (byte ******)0x3f800000; ppppppbStack_26650 = (byte ******)((int)ppppppbVar32 * 0x54 + (int)pvStack_266a8); ppppppbStack_2666c = (byte ******)0x3f800000; ppppppbStack_26670 = (byte ******)0x0; ppppppbStack_26674 = (byte ******)0x0; ppppppbStack_26664 = (byte ******)0x0; if (ppppppbStack_26688 != (byte ******)0x0) { LAB_004103a0: ppppppbVar41 = ppppppbStack_26688; pppppbVar42 = *ppppppbStack_26688; pcVar24 = "XPosition"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004103d1: uVar14 = -(uint)bVar43 | 1; goto LAB_004103d6; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004103d1; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004103d6: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); *ppppppbStack_26650 = (byte *****)(float)dVar44; } else { pcVar24 = "YPosition"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410430: uVar14 = -(uint)bVar43 | 1; goto LAB_00410435; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410430; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410435: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26650[1] = (byte *****)(float)dVar44; } else { pcVar24 = "Delay"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410490: uVar14 = -(uint)bVar43 | 1; goto LAB_00410495; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410490; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410495: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } pppppbVar42 = (byte *****)atoi((char *)pppppbVar42); ppppppbStack_26650[2] = pppppbVar42; } else { pcVar24 = "Visible"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004104f0: uVar14 = -(uint)bVar43 | 1; goto LAB_004104f5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004104f0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004104f5: if (uVar14 == 0) { apppppppcStack_16540[0] = (char *******)0x0; iStack_16530 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } uStack_1652c = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppcStack_16540,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); uVar14 = uStack_1652c; iVar18 = iStack_16530; if (iStack_16530 == 0) { LAB_004105ca: uVar12 = 0; } else { pppppppcVar27 = (char *******)apppppppcStack_16540; if (0xf < uStack_1652c) { pppppppcVar27 = apppppppcStack_16540[0]; } if ((iStack_16530 != 4) || (iVar33 = memcmp_eq(pppppppcVar27,&DAT_00b64fe8,4), iVar33 != 0)) { pppppppcVar27 = (char *******)apppppppcStack_16540; if (0xf < uVar14) { pppppppcVar27 = apppppppcStack_16540[0]; } if ((iVar18 != 4) || (iVar18 = memcmp_eq(pppppppcVar27,&DAT_00b64ff0,4), iVar18 != 0)) { pppppppcVar27 = (char *******)apppppppcStack_16540; if (0xf < uVar14) { pppppppcVar27 = apppppppcStack_16540[0]; } iVar18 = atoi((char *)pppppppcVar27); if (iVar18 == 0) goto LAB_004105ca; } } uVar12 = 1; } *(undefined1 *)(ppppppbStack_26650 + 3) = uVar12; if (0xf < uStack_1652c) { uVar14 = uStack_1652c + 1; pppppppcVar27 = apppppppcStack_16540[0]; if (0xfff < uVar14) { pppppppcVar27 = (char *******)apppppppcStack_16540[0][-1]; uVar14 = uStack_1652c + 0x24; if ((char *)0x1f < (char *)((int)apppppppcStack_16540[0] + (-4 - (int)pppppppcVar27))) goto LAB_00413762; } operator_delete(pppppppcVar27,uVar14); } iStack_16530 = 0; uStack_1652c = 0xf; apppppppcStack_16540[0] = (char *******)((uint)apppppppcStack_16540[0] & 0xffffff00) ; } else { pcVar24 = "XScale"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410660: uVar14 = -(uint)bVar43 | 1; goto LAB_00410665; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410660; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410665: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2664c = (byte ******)(float)dVar44; ppppppbStack_26650[4] = (byte *****)((float)ppppppbStack_2664c / 100.0); goto LAB_00410d5e; } pcVar24 = "YScale"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004106d0: uVar14 = -(uint)bVar43 | 1; goto LAB_004106d5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004106d0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004106d5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2664c = (byte ******)(float)dVar44; ppppppbStack_26650[5] = (byte *****)((float)ppppppbStack_2664c / 100.0); goto LAB_00410d5e; } pcVar24 = "RedTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410740: uVar14 = -(uint)bVar43 | 1; goto LAB_00410745; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410740; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410745: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2665c = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_2665c; goto LAB_00410d5e; } pcVar24 = "GreenTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004107c2: uVar14 = -(uint)bVar43 | 1; goto LAB_004107c7; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004107c2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004107c7: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26660 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26660; goto LAB_00410d5e; } pcVar24 = "BlueTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410850: uVar14 = -(uint)bVar43 | 1; goto LAB_00410855; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410850; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410855: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26668 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26668; goto LAB_00410d5e; } pcVar24 = "AlphaTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004108e2: uVar14 = -(uint)bVar43 | 1; goto LAB_004108e7; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004108e2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004108e7: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2666c = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_2666c; goto LAB_00410d5e; } pcVar24 = "RedOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410980: uVar14 = -(uint)bVar43 | 1; goto LAB_00410985; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410980; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410985: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26670 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26670; goto LAB_00410d5e; } pcVar24 = "GreenOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410a22: uVar14 = -(uint)bVar43 | 1; goto LAB_00410a27; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410a22; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410a27: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26674 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26674; goto LAB_00410d5e; } pcVar24 = "BlueOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410ad0: uVar14 = -(uint)bVar43 | 1; goto LAB_00410ad5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410ad0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410ad5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26664; goto LAB_00410d5e; } pcVar24 = "Rotation"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410b82: uVar14 = -(uint)bVar43 | 1; goto LAB_00410b87; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410b82; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410b87: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26650[0x11] = (byte *****)(float)dVar44; goto LAB_00410d5e; } pcVar24 = "Interpolated"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410be0: uVar14 = -(uint)bVar43 | 1; goto LAB_00410be5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410be0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410be5: if (uVar14 == 0) { apppppppcStack_164e0[0] = (char *******)0x0; iStack_164d0 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26688[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26688[1]; } uStack_164cc = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppcStack_164e0,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); uVar14 = uStack_164cc; iVar18 = iStack_164d0; if (iStack_164d0 == 0) { LAB_00410cba: uVar12 = 0; } else { pppppppcVar27 = (char *******)apppppppcStack_164e0; if (0xf < uStack_164cc) { pppppppcVar27 = apppppppcStack_164e0[0]; } if ((iStack_164d0 != 4) || (iVar33 = memcmp_eq(pppppppcVar27,&DAT_00b64fe8,4), iVar33 != 0)) { pppppppcVar27 = (char *******)apppppppcStack_164e0; if (0xf < uVar14) { pppppppcVar27 = apppppppcStack_164e0[0]; } if ((iVar18 != 4) || (iVar18 = memcmp_eq(pppppppcVar27,&DAT_00b64ff0,4), iVar18 != 0)) { pppppppcVar27 = (char *******)apppppppcStack_164e0; if (0xf < uVar14) { pppppppcVar27 = apppppppcStack_164e0[0]; } iVar18 = atoi((char *)pppppppcVar27); if (iVar18 == 0) goto LAB_00410cba; } } uVar12 = 1; } *(undefined1 *)(ppppppbStack_26650 + 0x12) = uVar12; if (0xf < uStack_164cc) { uVar14 = uStack_164cc + 1; pppppppcVar27 = apppppppcStack_164e0[0]; if (0xfff < uVar14) { pppppppcVar27 = (char *******)apppppppcStack_164e0[0][-1]; uVar14 = uStack_164cc + 0x24; if ((char *)0x1f < (char *)((int)apppppppcStack_164e0[0] + (-4 - (int)pppppppcVar27))) goto LAB_00413762; } operator_delete(pppppppcVar27,uVar14); } iStack_164d0 = 0; uStack_164cc = 0xf; apppppppcStack_164e0[0] = (char *******)((uint)apppppppcStack_164e0[0] & 0xffffff00); } } ppppppbVar41 = ppppppbStack_26688; } } } LAB_00410d5e: if ((ppppppbVar41[4] == (byte *****)0x0) || (ppppppbStack_26688 = (byte ******)ppppppbVar41[6], ppppppbStack_26688 == (byte ******)0x0)) goto LAB_00410d81; goto LAB_004103a0; } LAB_00410d81: ppppppbStack_26650[6] = (byte *****)ppppppbStack_2665c; ppppppbStack_26650[7] = (byte *****)ppppppbStack_26660; ppppppbStack_26650[8] = (byte *****)ppppppbStack_26668; ppppppbStack_26650[9] = (byte *****)ppppppbStack_2666c; ppppppbStack_26650[0xe] = (byte *****)ppppppbStack_26670; ppppppbStack_26650[0xf] = (byte *****)ppppppbStack_26674; ppppppbStack_26650[0x10] = (byte *****)ppppppbStack_26664; ppppppbStack_26650[0x13] = (byte *****)ppppppbStack_2667c; ppppppbStack_2667c = (byte ******)((int)ppppppbStack_2667c + (int)ppppppbStack_26650[2]); ppppppbStack_26650[0x14] = (byte *****)ppppppbStack_2667c; ppppppbVar41 = (byte ******)ppppppbStack_26654[0xb]; ppppppbVar32 = ppppppbStack_26690; } InterpolateNullFrames(ppppppbStack_26678); _eh_vector_constructor_iterator_ (local_ab0,0x10,0x40,LayerAnimation::LayerAnimation,guard_check_icall); local_14._0_1_ = 0x12; ppppppbStack_2668c = (byte ******)0x0; pcVar24 = "LayerAnimations"; do { pcVar36 = pcVar24; pcVar24 = pcVar36 + 1; } while (*pcVar24 != '\0'); ppppppbStack_26654 = (byte ******)(pcVar36 + -0xb1b4e7); for (pppppbVar42 = ppppppbStack_26684[6]; pppppbVar42 != (byte *****)0x0; pppppbVar42 = (byte *****)pppppbVar42[0xb]) { pbVar31 = (byte *)*pppppbVar42; if ((byte ****)pbVar31 == (byte ****)0x0) { ppppppbVar41 = (byte ******)0x0; pbVar31 = &g_xmlNullStr; } else { ppppppbVar41 = (byte ******)pppppbVar42[2]; } if (ppppppbVar41 == ppppppbStack_26654) { ppppbVar29 = (byte ****)((int)ppppppbVar41 + (int)pbVar31); if (ppppbVar29 <= pbVar31) goto LAB_00410e71; iVar18 = (int)"LayerAnimations" - (int)pbVar31; while (*pbVar31 == *(byte *)((int)pbVar31 + iVar18)) { pbVar31 = (byte *)((int)pbVar31 + 1); if (ppppbVar29 <= pbVar31) goto LAB_00410e71; } } } pppppbVar42 = (byte *****)0x0; LAB_00410e71: ppppppbStack_2664c = (byte ******)pppppbVar42[6]; if (ppppppbStack_2664c == (byte ******)0x0) { LAB_004122bc: ppppppbStack_2664c = (byte ******)0x0; pppppppbStack_266b4[7] = ppppppbStack_2668c; } else { do { ppppppbVar32 = ppppppbStack_2664c; ppppppbVar41 = ppppppbStack_2668c; if (&DAT_0000003f < ppppppbStack_2668c) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *)"%s: too many animation layers\n"); } ppppppbStack_2668c = (byte ******)((int)ppppppbVar41 + 1); ppppppbStack_26688 = (byte ******)((int)ppppppbVar41 << 4); ppppppbVar41 = (byte ******)ppppppbVar32[8]; while (ppppppbVar41 != (byte ******)0x0) { pppppbVar42 = *ppppppbVar41; pcVar24 = "LayerId"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410f01: uVar14 = -(uint)bVar43 | 1; goto LAB_00410f06; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410f01; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410f06: ppppppbStack_26654 = ppppppbVar41; if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } iVar18 = atoi((char *)pppppbVar42); *(int *)((int)local_ab0 + (int)ppppppbStack_26688) = iVar18; ppppppbStack_26654 = ppppppbVar41; } else { pcVar24 = "Visible"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00410f62: uVar14 = -(uint)bVar43 | 1; goto LAB_00410f67; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00410f62; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00410f67: if (uVar14 == 0) { apppppppcStack_164f8[0] = (char *******)0x0; iStack_164e8 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } uStack_164e4 = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppcStack_164f8,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); uVar14 = uStack_164e4; iVar18 = iStack_164e8; if (iStack_164e8 == 0) { LAB_0041103a: uVar12 = 0; } else { pppppppcVar27 = (char *******)apppppppcStack_164f8; if (0xf < uStack_164e4) { pppppppcVar27 = apppppppcStack_164f8[0]; } if ((iStack_164e8 != 4) || (iVar33 = memcmp_eq(pppppppcVar27,&DAT_00b64fe8,4), iVar33 != 0)) { pppppppcVar27 = (char *******)apppppppcStack_164f8; if (0xf < uVar14) { pppppppcVar27 = apppppppcStack_164f8[0]; } if ((iVar18 != 4) || (iVar18 = memcmp_eq(pppppppcVar27,&DAT_00b64ff0,4), iVar18 != 0)) { pppppppcVar27 = (char *******)apppppppcStack_164f8; if (0xf < uVar14) { pppppppcVar27 = apppppppcStack_164f8[0]; } iVar18 = atoi((char *)pppppppcVar27); if (iVar18 == 0) goto LAB_0041103a; } } uVar12 = 1; } auStack_aa4[(int)ppppppbStack_26688] = uVar12; if (0xf < uStack_164e4) { uVar14 = uStack_164e4 + 1; pppppppcVar27 = apppppppcStack_164f8[0]; if (0xfff < uVar14) { pppppppcVar27 = (char *******)apppppppcStack_164f8[0][-1]; uVar14 = uStack_164e4 + 0x24; if ((char *)0x1f < (char *)((int)apppppppcStack_164f8[0] + (-4 - (int)pppppppcVar27))) goto LAB_00413762; } operator_delete(pppppppcVar27,uVar14); } iStack_164e8 = 0; uStack_164e4 = 0xf; apppppppcStack_164f8[0] = (char *******)((uint)apppppppcStack_164f8[0] & 0xffffff00); } } if (ppppppbStack_26654[4] == (byte *****)0x0) break; ppppppbVar41 = (byte ******)ppppppbStack_26654[6]; } ppppppbStack_266a0 = (byte ******)0x0; ppppppbStack_2667c = (byte ******)0x0; ppppppbVar41 = (byte ******)ppppppbStack_2664c[6]; ppppppbVar32 = ppppppbStack_2667c; ppppppbVar40 = ppppppbStack_26680; while( true ) { ppppppbStack_26654 = ppppppbVar41; ppppppbStack_26680 = ppppppbVar40; ppppppbStack_2667c = ppppppbVar32; if (ppppppbVar41 == (byte ******)0x0) break; if ((byte ******)0x1387 < ppppppbVar32) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *)"%s: too many animation frames\n"); } ppppppbStack_26658 = (byte ******)ppppppbVar41[8]; ppppppbStack_2667c = (byte ******)((int)ppppppbVar32 + 1); ppppppbStack_26674 = (byte ******)0x3f800000; ppppppbStack_26670 = (byte ******)0x3f800000; ppppppbStack_2666c = (byte ******)0x3f800000; ppppppbStack_26664 = ppppppbStack_26680 + (int)ppppppbVar32 * 0x1b; ppppppbStack_26668 = (byte ******)0x3f800000; ppppppbStack_26660 = (byte ******)0x0; ppppppbStack_2665c = (byte ******)0x0; ppppppbStack_26650 = (byte ******)0x0; if (ppppppbStack_26658 != (byte ******)0x0) { LAB_00411184: ppppppbVar41 = ppppppbStack_26658; pppppbVar42 = *ppppppbStack_26658; pcVar24 = "XPosition"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004111b5: uVar14 = -(uint)bVar43 | 1; goto LAB_004111ba; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004111b5; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004111ba: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[4] = (byte *****)(float)dVar44; } else { pcVar24 = "YPosition"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411212: uVar14 = -(uint)bVar43 | 1; goto LAB_00411217; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411212; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411217: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[5] = (byte *****)(float)dVar44; } else { pbVar31 = &DAT_00b1b540; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_00411270: uVar14 = -(uint)bVar43 | 1; goto LAB_00411275; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_00411270; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411275: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[8] = (byte *****)(float)dVar44; } else { pbVar31 = &DAT_00b1b548; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_004112d0: uVar14 = -(uint)bVar43 | 1; goto LAB_004112d5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_004112d0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004112d5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[9] = (byte *****)(float)dVar44; } else { pcVar24 = "Width"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411330: uVar14 = -(uint)bVar43 | 1; goto LAB_00411335; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411330; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411335: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[2] = (byte *****)(float)dVar44; } else { pcVar24 = "Height"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411390: uVar14 = -(uint)bVar43 | 1; goto LAB_00411395; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411390; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411395: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[3] = (byte *****)(float)dVar44; } else { pcVar24 = "XScale"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004113f0: uVar14 = -(uint)bVar43 | 1; goto LAB_004113f5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004113f0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004113f5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26658 = (byte ******)(float)dVar44; ppppppbStack_26664[6] = (byte *****)((float)ppppppbStack_26658 / 100.0); } else { pcVar24 = "YScale"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411460: uVar14 = -(uint)bVar43 | 1; goto LAB_00411465; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411460; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411465: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26658 = (byte ******)(float)dVar44; ppppppbStack_26664[7] = (byte *****)((float)ppppppbStack_26658 / 100.0); } else { pcVar24 = "Delay"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004114d0: uVar14 = -(uint)bVar43 | 1; goto LAB_004114d5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004114d0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004114d5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } pppppbVar42 = (byte *****)atoi((char *)pppppbVar42); ppppppbStack_26664[10] = pppppbVar42; } else { pcVar24 = "Visible"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411530: uVar14 = -(uint)bVar43 | 1; goto LAB_00411535; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411530; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411535: if (uVar14 == 0) { apppppppbStack_16510[0] = (byte *******)0x0; uStack_16500 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } uStack_164fc = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_16510,(byte *)pppppbVar42 ,(int)pppppbVar25 - (int)((int)pppppbVar42 + 1)) ; uVar11 = uStack_164fc; uVar14 = uStack_16500; if (uStack_16500 == 0) { LAB_00411602: uVar12 = 0; } else { pppppppbVar28 = (byte *******)apppppppbStack_16510; if (0xf < uStack_164fc) { pppppppbVar28 = apppppppbStack_16510[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uStack_16500,&DAT_00b64fe8,4 ); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_16510; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_16510[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uVar14,&DAT_00b64ff0,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_16510; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_16510[0]; } iVar18 = atoi((char *)pppppppbVar28); if (iVar18 == 0) goto LAB_00411602; } } uVar12 = 1; } *(undefined1 *)(ppppppbStack_26664 + 0xb) = uVar12; if (0xf < uStack_164fc) { uVar14 = uStack_164fc + 1; pppppppbVar28 = apppppppbStack_16510[0]; if (0xfff < uVar14) { pppppppbVar28 = (byte *******)apppppppbStack_16510[0][-1]; uVar14 = uStack_164fc + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_16510[0] + (-4 - (int)pppppppbVar28))) goto LAB_00413762; } operator_delete(pppppppbVar28,uVar14); } uStack_16500 = 0; uStack_164fc = 0xf; apppppppbStack_16510[0] = (byte *******)((uint)apppppppbStack_16510[0] & 0xffffff00); } else { pcVar24 = "XCrop"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411696: uVar14 = -(uint)bVar43 | 1; goto LAB_0041169b; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411696; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_0041169b: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); *ppppppbStack_26664 = (byte *****)(float)dVar44; goto LAB_00411d66; } pbVar31 = &DAT_00b1b568; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < *pbVar31; if (bVar13 != *pbVar31) { LAB_004116f2: uVar14 = -(uint)bVar43 | 1; goto LAB_004116f7; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < pbVar31[1]; if (bVar13 != pbVar31[1]) goto LAB_004116f2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pbVar31 = pbVar31 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004116f7: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[1] = (byte *****)(float)dVar44; goto LAB_00411d66; } pcVar24 = "RedTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411750: uVar14 = -(uint)bVar43 | 1; goto LAB_00411755; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411750; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411755: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26674 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26658 = ppppppbStack_26674; goto LAB_00411d66; } pcVar24 = "GreenTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004117d2: uVar14 = -(uint)bVar43 | 1; goto LAB_004117d7; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004117d2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004117d7: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26670 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26658 = ppppppbStack_26670; goto LAB_00411d66; } pcVar24 = "BlueTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411860: uVar14 = -(uint)bVar43 | 1; goto LAB_00411865; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411860; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411865: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2666c = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26658 = ppppppbStack_2666c; goto LAB_00411d66; } pcVar24 = "AlphaTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004118f2: uVar14 = -(uint)bVar43 | 1; goto LAB_004118f7; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004118f2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004118f7: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26668 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26658 = ppppppbStack_26668; goto LAB_00411d66; } pcVar24 = "RedOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411990: uVar14 = -(uint)bVar43 | 1; goto LAB_00411995; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411990; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411995: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26660 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26658 = ppppppbStack_26660; goto LAB_00411d66; } pcVar24 = "GreenOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411a32: uVar14 = -(uint)bVar43 | 1; goto LAB_00411a37; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411a32; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411a37: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2665c = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26658 = ppppppbStack_2665c; goto LAB_00411d66; } pcVar24 = "BlueOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411ae0: uVar14 = -(uint)bVar43 | 1; goto LAB_00411ae5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411ae0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411ae5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26658 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_26650 = ppppppbStack_26658; goto LAB_00411d66; } pcVar24 = "Rotation"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411b92: uVar14 = -(uint)bVar43 | 1; goto LAB_00411b97; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411b92; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411b97: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664[0x17] = (byte *****)(float)dVar44; goto LAB_00411d66; } pcVar24 = "Interpolated"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00411bf0: uVar14 = -(uint)bVar43 | 1; goto LAB_00411bf5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00411bf0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00411bf5: if (uVar14 == 0) { apppppppbStack_16558[0] = (byte *******)0x0; uStack_16548 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_26658[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_26658[1]; } uStack_16544 = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_16558, (byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1) ); uVar11 = uStack_16544; uVar14 = uStack_16548; if (uStack_16548 == 0) { LAB_00411cc2: uVar12 = 0; } else { pppppppbVar28 = (byte *******)apppppppbStack_16558; if (0xf < uStack_16544) { pppppppbVar28 = apppppppbStack_16558[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uStack_16548,&DAT_00b64fe8 ,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_16558; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_16558[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uVar14,&DAT_00b64ff0,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_16558; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_16558[0]; } iVar18 = atoi((char *)pppppppbVar28); if (iVar18 == 0) goto LAB_00411cc2; } } uVar12 = 1; } *(undefined1 *)(ppppppbStack_26664 + 0x18) = uVar12; if (0xf < uStack_16544) { uVar14 = uStack_16544 + 1; pppppppbVar28 = apppppppbStack_16558[0]; if (0xfff < uVar14) { pppppppbVar28 = (byte *******)apppppppbStack_16558[0][-1]; uVar14 = uStack_16544 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_16558[0] + (-4 - (int)pppppppbVar28))) goto LAB_00413762; } operator_delete(pppppppbVar28,uVar14); } uStack_16548 = 0; uStack_16544 = 0xf; apppppppbStack_16558[0] = (byte *******)((uint)apppppppbStack_16558[0] & 0xffffff00); } } ppppppbVar41 = ppppppbStack_26658; } } } } } } } } } LAB_00411d66: if ((ppppppbVar41[4] == (byte *****)0x0) || (ppppppbStack_26658 = (byte ******)ppppppbVar41[6], ppppppbStack_26658 == (byte ******)0x0)) goto LAB_00411d89; goto LAB_00411184; } LAB_00411d89: ppppppbStack_26664[0xc] = (byte *****)ppppppbStack_26674; ppppppbStack_26664[0xd] = (byte *****)ppppppbStack_26670; ppppppbStack_26664[0xe] = (byte *****)ppppppbStack_2666c; ppppppbStack_26664[0xf] = (byte *****)ppppppbStack_26668; ppppppbStack_26664[0x14] = (byte *****)ppppppbStack_26660; ppppppbStack_26664[0x15] = (byte *****)ppppppbStack_2665c; ppppppbStack_26664[0x16] = (byte *****)ppppppbStack_26650; ppppppbStack_26664[0x19] = (byte *****)ppppppbStack_266a0; ppppppbStack_266a0 = (byte ******)((int)ppppppbStack_266a0 + (int)ppppppbStack_26664[10]); ppppppbStack_26664[0x1a] = (byte *****)ppppppbStack_266a0; ppppppbVar41 = (byte ******)ppppppbStack_26654[0xb]; ppppppbVar32 = ppppppbStack_2667c; ppppppbVar40 = ppppppbStack_26680; } InterpolateLayerFrames(ppppppbStack_2669c); ppppppbVar32 = (byte ******)0x0; ppppppbStack_26650 = (byte ******)0x0; ppppppbVar34 = (byte ******)0x0; ppppppbStack_26660 = ppppppbStack_2667c; ppppppbVar39 = (byte ******)0x0; ppppppbVar41 = ppppppbVar32; if (ppppppbStack_2667c != (byte ******)0x0) { ppppppbStack_2667c = ppppppbVar40 + 5; do { ppppppbStack_2667c[0x14] = (byte *****)ppppppbVar34; pppppbVar42 = ppppppbStack_2667c[5]; ppppppbStack_26658 = (byte ******)0x0; if (0 < (int)pppppbVar42) { ppppppbStack_266a0 = ppppppbStack_2669c + (int)ppppppbVar32 * 0x1b; ppppppbStack_2665c = ppppppbVar34; ppppppbVar41 = ppppppbVar39; do { ppppppbStack_2665c = (byte ******)((int)ppppppbStack_2665c + 1); iVar18 = (int)ppppppbVar41 + 1; ppppppbVar39 = ppppppbVar41; if (iVar18 < (int)ppppppbStack_26690) { piVar16 = (int *)((int)pvStack_266a8 + (int)ppppppbVar41 * 0x54 + 0x50); do { if ((int)ppppppbStack_2665c < *piVar16) break; iVar18 = iVar18 + 1; ppppppbVar39 = (byte ******)((int)ppppppbVar39 + 1); piVar16 = piVar16 + 0x15; } while (iVar18 < (int)ppppppbStack_26690); if ((int)ppppppbVar39 <= (int)ppppppbVar41) goto LAB_00411e9b; LAB_00411eb2: ppppppbStack_26654 = (byte ******)((int)ppppppbVar41 * 0x54 + (int)pvStack_266a8); if ((byte ******)0x1387 < ppppppbStack_26650) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *) "%s: too many frames after interpolation/root frame adjustment\n" ); } ppppppbVar41 = ppppppbStack_266a0; ppppppbStack_26650 = (byte ******)((int)ppppppbStack_26650 + 1); *ppppppbStack_266a0 = ppppppbStack_2667c[-5]; ppppppbStack_266a0[1] = ppppppbStack_2667c[-4]; ppppppbStack_266a0[2] = ppppppbStack_2667c[-3]; ppppppbStack_266a0[3] = ppppppbStack_2667c[-2]; ppppppbStack_266a0[4] = ppppppbStack_2667c[-1]; ppppppbStack_266a0[5] = *ppppppbStack_2667c; ppppppbStack_266a0[6] = ppppppbStack_2667c[1]; ppppppbStack_266a0[7] = ppppppbStack_2667c[2]; ppppppbStack_266a0[8] = ppppppbStack_2667c[3]; ppppppbStack_266a0[9] = ppppppbStack_2667c[4]; ppppppbStack_266a0[10] = ppppppbStack_2667c[5]; *(undefined1 *)(ppppppbStack_266a0 + 0xb) = *(undefined1 *)(ppppppbStack_2667c + 6); pCVar1 = (Color *)(ppppppbStack_266a0 + 0xc); ppppppbStack_266a0 = ppppppbStack_266a0 + 0x1b; Color::operator_assign(pCVar1,(ColorMod *)(ppppppbStack_2667c + 7)); ppppppbVar41[0x17] = ppppppbStack_2667c[0x12]; *(undefined1 *)(ppppppbVar41 + 0x18) = *(undefined1 *)(ppppppbStack_2667c + 0x13); ppppppbVar41[0x19] = ppppppbStack_2667c[0x14]; ppppppbVar41[0x1a] = ppppppbStack_2667c[0x15]; fVar2 = extraout_EDX_05[5]; fVar3 = extraout_EDX_05[1]; ppppppbVar41[4] = (byte *****)((float)ppppppbVar41[4] * extraout_EDX_05[4] + *extraout_EDX_05); ppppppbVar41[5] = (byte *****)(fVar2 * (float)ppppppbVar41[5] + fVar3); if ((*(char *)(ppppppbVar41 + 0xb) == '\0') || (*(char *)(extraout_EDX_05 + 3) == '\0')) { uVar12 = 0; } else { uVar12 = 1; } *(undefined1 *)(ppppppbVar41 + 0xb) = uVar12; ppppppbVar41[6] = (byte *****)((float)ppppppbVar41[6] * extraout_EDX_05[4]); ppppppbVar41[7] = (byte *****)(extraout_EDX_05[5] * (float)ppppppbVar41[7]); Color::__mul((Color *)(ppppppbVar41 + 0xc),(ColorMod *)(extraout_EDX_05 + 6)); ppppppbVar41[0x17] = (byte *****)((float)ppppppbStack_26654[0x11] + (float)ppppppbVar41[0x17]); ppppppbVar41[0x1a] = (byte *****)ppppppbStack_2665c; ppppppbStack_2667c[0x14] = (byte *****)ppppppbStack_2665c; } else { LAB_00411e9b: if (ppppppbStack_26658 == (byte ******)((int)pppppbVar42 + -1)) goto LAB_00411eb2; ppppppbStack_26654 = ppppppbVar41; } pppppbVar42 = ppppppbStack_2667c[5]; ppppppbStack_26658 = (byte ******)((int)ppppppbStack_26658 + 1); ppppppbVar41 = ppppppbVar39; } while ((int)ppppppbStack_26658 < (int)pppppbVar42); ppppppbVar32 = ppppppbStack_26650; ppppppbVar34 = ppppppbStack_2665c; } ppppppbVar40 = ppppppbStack_26650; ppppppbStack_2667c = ppppppbStack_2667c + 0x1b; ppppppbStack_26660 = (byte ******)((int)ppppppbStack_26660 + -1); } while (ppppppbStack_26660 != (byte ******)0x0); ppppppbVar41 = (byte ******)0x0; if (ppppppbVar32 != (byte ******)0x0) { ppppppbStack_26654 = ppppppbVar32; ppppppbVar41 = operator_new_tracked (-(uint)((int)(ZEXT48(ppppppbStack_26650) * 0x6c >> 0x20) != 0) | (uint)(ZEXT48(ppppppbStack_26650) * 0x6c)); if (ppppppbVar41 == (byte ******)0x0) { ppppppbVar41 = (byte ******)0x0; ppppppbStack_26654 = (byte ******)0x0; } else { ppppppbVar32 = ppppppbVar41 + 5; ppppppbStack_26658 = ppppppbVar41; ppppppbStack_26654 = ppppppbVar41; do { ppppppbVar32[-4] = (byte *****)0x0; ppppppbVar32[-5] = (byte *****)0x0; ppppppbVar32[-2] = (byte *****)0x0; ppppppbVar32[-3] = (byte *****)0x0; *ppppppbVar32 = (byte *****)0x0; ppppppbVar32[-1] = (byte *****)0x0; ppppppbVar32[2] = (byte *****)0x0; ppppppbVar32[1] = (byte *****)0x0; ppppppbVar32[4] = (byte *****)0x0; ppppppbVar32[3] = (byte *****)0x0; Color::Color((Color *)(ppppppbVar32 + 7)); *(undefined1 *)(extraout_EDX_06 + 0x4c) = 0; ppppppbVar32 = (byte ******)(extraout_EDX_06 + 0x6c); ppppppbVar40 = (byte ******)((int)ppppppbVar40 + -1); } while (ppppppbVar40 != (byte ******)0x0); } ppppppbVar32 = ppppppbVar41 + 3; local_14._0_1_ = 0x12; ppppppbStack_26658 = (byte ******)((int)ppppppbStack_2669c - (int)ppppppbVar41); ppppppbVar41 = ppppppbStack_2669c + 7; ppppppbVar40 = ppppppbStack_26650; do { ppppppbVar32[-3] = ppppppbVar41[-7]; ppppppbVar32[-2] = ppppppbVar41[-6]; ppppppbVar32[-1] = ppppppbVar41[-5]; *ppppppbVar32 = *(byte ******)((int)ppppppbStack_26658 + (int)ppppppbVar32); ppppppbVar32[1] = ppppppbVar41[-3]; ppppppbVar32[2] = ppppppbVar41[-2]; ppppppbVar32[3] = ppppppbVar41[-1]; ppppppbVar32[4] = *ppppppbVar41; ppppppbVar32[5] = ppppppbVar41[1]; ppppppbVar32[6] = ppppppbVar41[2]; ppppppbVar32[7] = ppppppbVar41[3]; *(undefined1 *)(ppppppbVar32 + 8) = *(undefined1 *)(ppppppbVar41 + 4); Color::operator_assign((Color *)(ppppppbVar32 + 9),(ColorMod *)(ppppppbVar41 + 5)); ppppppbVar32 = (byte ******)(extraout_EDX_07 + 0x6c); *(byte ******)(extraout_EDX_07 + 0x50) = ppppppbVar41[0x10]; *(undefined1 *)(extraout_EDX_07 + 0x54) = *(undefined1 *)(ppppppbVar41 + 0x11); *(byte ******)(extraout_EDX_07 + 0x58) = ppppppbVar41[0x12]; *(byte ******)(extraout_EDX_07 + 0x5c) = ppppppbVar41[0x13]; ppppppbVar40 = (byte ******)((int)ppppppbVar40 + -1); ppppppbVar41 = ppppppbVar41 + 0x1b; } while (ppppppbVar40 != (byte ******)0x0); *(byte *******)((int)(local_ab0 + 1) + (int)ppppppbStack_26688) = ppppppbStack_26654; ppppppbVar41 = ppppppbStack_26650; } } ppppppbVar32 = ppppppbStack_2668c; *(byte *******)((int)(local_ab0 + 2) + (int)ppppppbStack_26688) = ppppppbVar41; ppppppbStack_2664c = (byte ******)ppppppbStack_2664c[0xb]; } while (ppppppbStack_2664c != (byte ******)0x0); if (ppppppbStack_2668c == (byte ******)0x0) goto LAB_004122bc; ppppppbStack_2664c = ppppppbStack_2668c; ppppppbStack_26654 = (byte ******)0x0; uVar14 = -(uint)((int)(ZEXT48(ppppppbStack_2668c) * 0x10 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbStack_2668c) * 0x10); puStack_266c4 = operator_new_tracked(-(uint)(0xfffffffb < uVar14) | uVar14 + 4); local_14._0_1_ = 0x14; if (puStack_266c4 == (undefined4 *)0x0) { ppppppbVar41 = (byte ******)0x0; ppppppbStack_26654 = (byte ******)0x0; } else { ppppppbVar41 = (byte ******)(puStack_266c4 + 1); *puStack_266c4 = ppppppbVar32; ppppppbStack_26654 = ppppppbVar41; _eh_vector_constructor_iterator_ (ppppppbVar41,0x10,(uint)ppppppbVar32,LayerAnimation::LayerAnimation, guard_check_icall); } local_14._0_1_ = 0x12; ppppppbVar32 = ppppppbVar41 + 3; pfVar35 = local_ab0 + 2; ppppppbVar40 = ppppppbStack_2668c; do { ppppppbVar32[-3] = (byte *****)pfVar35[-2]; *(undefined1 *)ppppppbVar32 = *(undefined1 *) ((int)auStack_10a0 + (0x5e0 - (int)ppppppbVar41) + (int)(ppppppbVar32 + 4)); ppppppbVar32[-2] = (byte *****)pfVar35[-1]; ppppppbVar32[-1] = (byte *****)*pfVar35; ppppppbVar40 = (byte ******)((int)ppppppbVar40 + -1); ppppppbVar32 = ppppppbVar32 + 4; pfVar35 = pfVar35 + 4; } while (ppppppbVar40 != (byte ******)0x0); ppppppbVar41 = (byte ******)0x0; pppppppbStack_266b4[6] = ppppppbStack_26654; pppppppbStack_266b4[7] = ppppppbStack_2668c; iVar18 = 0; do { pppppppbStack_266b4[*(int *)((int)pppppppbStack_266b4[6] + iVar18) + 0xe] = ppppppbVar41; ppppppbVar41 = (byte ******)((int)ppppppbVar41 + 1); iVar18 = iVar18 + 0x10; } while (ppppppbVar41 < pppppppbStack_266b4[7]); } _eh_vector_constructor_iterator_ (local_6b0,0x10,0x40,(_func_void_void_ptr *)&LAB_0040c210,guard_check_icall); local_14._0_1_ = 0x15; ppppppbStack_2668c = (byte ******)0x0; pcVar24 = "NullAnimations"; do { pcVar36 = pcVar24; pcVar24 = pcVar36 + 1; } while (*pcVar24 != '\0'); for (pppppbVar42 = ppppppbStack_26684[6]; pppppbVar42 != (byte *****)0x0; pppppbVar42 = (byte *****)pppppbVar42[0xb]) { pbVar31 = (byte *)*pppppbVar42; if ((byte ****)pbVar31 == (byte ****)0x0) { ppppbVar29 = (byte ****)0x0; pbVar31 = &g_xmlNullStr; } else { ppppbVar29 = pppppbVar42[2]; } if (ppppbVar29 == (byte ****)(pcVar36 + -0xb1b5af)) { ppppbVar29 = (byte ****)((int)pbVar31 + (int)ppppbVar29); if (ppppbVar29 <= pbVar31) goto LAB_00412352; iVar18 = (int)"NullAnimations" - (int)pbVar31; while (*pbVar31 == *(byte *)((int)pbVar31 + iVar18)) { pbVar31 = (byte *)((int)pbVar31 + 1); if (ppppbVar29 <= pbVar31) goto LAB_00412352; } } } pppppbVar42 = (byte *****)0x0; LAB_00412352: ppppppbStack_26654 = (byte ******)pppppbVar42[6]; if (ppppppbStack_26654 == (byte ******)0x0) { LAB_00413466: local_14._0_1_ = 0x15; } else { do { ppppppbVar32 = ppppppbStack_26654; ppppppbVar41 = ppppppbStack_2668c; if (&DAT_0000003f < ppppppbStack_2668c) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *)"%s: too many null layers\n"); } ppppppbStack_2668c = (byte ******)((int)ppppppbVar41 + 1); ppppppbStack_266a0 = (byte ******)((int)ppppppbVar41 << 4); for (ppppppbVar41 = (byte ******)ppppppbVar32[8]; ppppppbStack_2664c = ppppppbVar41, ppppppbVar41 != (byte ******)0x0; ppppppbVar41 = (byte ******)ppppppbVar41[6]) { pppppbVar42 = *ppppppbVar41; pcVar24 = "NullId"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004123e1: uVar14 = -(uint)bVar43 | 1; goto LAB_004123e6; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004123e1; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004123e6: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } iVar18 = atoi((char *)pppppbVar42); *(int *)(local_6b0 + (int)ppppppbStack_266a0) = iVar18; } else { pcVar24 = "Visible"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412442: uVar14 = -(uint)bVar43 | 1; goto LAB_00412447; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412442; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412447: if (uVar14 == 0) { apppppppbStack_16528[0] = (byte *******)0x0; uStack_16518 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbVar41[1] != (byte *****)0x0) { pppppbVar42 = ppppppbVar41[1]; } uStack_16514 = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_16528,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); uVar11 = uStack_16514; uVar14 = uStack_16518; if (uStack_16518 == 0) { LAB_00412512: uVar12 = 0; } else { pppppppbVar28 = (byte *******)apppppppbStack_16528; if (0xf < uStack_16514) { pppppppbVar28 = apppppppbStack_16528[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uStack_16518,&DAT_00b64fe8,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_16528; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_16528[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uVar14,&DAT_00b64ff0,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_16528; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_16528[0]; } iVar18 = atoi((char *)pppppppbVar28); if (iVar18 == 0) goto LAB_00412512; } } uVar12 = 1; } *(undefined1 *)((int)local_6ac + (int)ppppppbStack_266a0) = uVar12; if (0xf < uStack_16514) { uVar14 = uStack_16514 + 1; pppppppbVar28 = apppppppbStack_16528[0]; if (0xfff < uVar14) { pppppppbVar28 = (byte *******)apppppppbStack_16528[0][-1]; uVar14 = uStack_16514 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_16528[0] + (-4 - (int)pppppppbVar28))) goto LAB_00413762; } operator_delete(pppppppbVar28,uVar14); } uStack_16518 = 0; uStack_16514 = 0xf; apppppppbStack_16528[0] = (byte *******)((uint)apppppppbStack_16528[0] & 0xffffff00); ppppppbVar41 = ppppppbStack_2664c; } } if (ppppppbVar41[4] == (byte *****)0x0) break; } ppppppbStack_26658 = (byte ******)0x0; ppppppbStack_26688 = (byte ******)0x0; ppppppbVar41 = (byte ******)ppppppbStack_26654[6]; ppppppbVar32 = ppppppbStack_26688; pvVar19 = pvStack_266ac; while( true ) { pvStack_266ac = pvVar19; ppppppbStack_26688 = ppppppbVar32; ppppppbStack_2667c = ppppppbVar41; if (ppppppbVar41 == (byte ******)0x0) break; if ((byte ******)0x1387 < ppppppbVar32) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *)"%s: too many null frames\n"); } ppppppbStack_2664c = (byte ******)ppppppbVar41[8]; ppppppbStack_26688 = (byte ******)((int)ppppppbVar32 + 1); ppppppbStack_2665c = (byte ******)0x3f800000; ppppppbStack_26660 = (byte ******)0x3f800000; ppppppbStack_26668 = (byte ******)0x3f800000; ppppppbStack_26650 = (byte ******)((int)ppppppbVar32 * 0x54 + (int)pvStack_266ac); ppppppbStack_2666c = (byte ******)0x3f800000; ppppppbStack_26670 = (byte ******)0x0; ppppppbStack_26674 = (byte ******)0x0; ppppppbStack_26664 = (byte ******)0x0; if (ppppppbStack_2664c != (byte ******)0x0) { do { ppppppbVar41 = ppppppbStack_2664c; pppppbVar42 = *ppppppbStack_2664c; pcVar24 = "XPosition"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412693: uVar14 = -(uint)bVar43 | 1; goto LAB_00412698; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412693; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412698: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); *ppppppbStack_26650 = (byte *****)(float)dVar44; } else { pcVar24 = "YPosition"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004126f0: uVar14 = -(uint)bVar43 | 1; goto LAB_004126f5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004126f0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004126f5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26650[1] = (byte *****)(float)dVar44; } else { pcVar24 = "Delay"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412750: uVar14 = -(uint)bVar43 | 1; goto LAB_00412755; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412750; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412755: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } pppppbVar42 = (byte *****)atoi((char *)pppppbVar42); ppppppbStack_26650[2] = pppppbVar42; } else { pcVar24 = "Visible"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004127b0: uVar14 = -(uint)bVar43 | 1; goto LAB_004127b5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004127b0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004127b5: if (uVar14 == 0) { apppppppbStack_165b8[0] = (byte *******)0x0; uStack_165a8 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } uStack_165a4 = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_165b8,(byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); uVar11 = uStack_165a4; uVar14 = uStack_165a8; if (uStack_165a8 == 0) { LAB_00412898: *(undefined1 *)(ppppppbStack_26650 + 3) = 0; pppppppbVar28 = (byte *******)apppppppbStack_165b8; } else { pppppppbVar28 = (byte *******)apppppppbStack_165b8; if (0xf < uStack_165a4) { pppppppbVar28 = apppppppbStack_165b8[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uStack_165a8,&DAT_00b64fe8,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_165b8; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_165b8[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uVar14,&DAT_00b64ff0,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_165b8; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_165b8[0]; } iVar18 = atoi((char *)pppppppbVar28); if (iVar18 == 0) goto LAB_00412898; } } *(undefined1 *)(ppppppbStack_26650 + 3) = 1; pppppppbVar28 = (byte *******)apppppppbStack_165b8; } LAB_00412f43: std::string::_Tidy_deallocate((char *)pppppppbVar28); ppppppbVar41 = ppppppbStack_2664c; } else { pcVar24 = "XScale"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004128e0: uVar14 = -(uint)bVar43 | 1; goto LAB_004128e5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004128e0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004128e5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2664c = (byte ******)(float)dVar44; ppppppbStack_26650[4] = (byte *****)((float)ppppppbStack_2664c / 100.0); } else { pcVar24 = "YScale"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412950: uVar14 = -(uint)bVar43 | 1; goto LAB_00412955; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412950; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412955: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2664c = (byte ******)(float)dVar44; ppppppbStack_26650[5] = (byte *****)((float)ppppppbStack_2664c / 100.0); } else { pcVar24 = "RedTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004129c0: uVar14 = -(uint)bVar43 | 1; goto LAB_004129c5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004129c0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004129c5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2665c = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_2665c; } else { pcVar24 = "GreenTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412a42: uVar14 = -(uint)bVar43 | 1; goto LAB_00412a47; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412a42; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412a47: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26660 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26660; } else { pcVar24 = "BlueTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412ad0: uVar14 = -(uint)bVar43 | 1; goto LAB_00412ad5; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412ad0; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412ad5: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26668 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26668; } else { pcVar24 = "AlphaTint"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412b62: uVar14 = -(uint)bVar43 | 1; goto LAB_00412b67; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412b62; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412b67: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_2666c = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_2666c; } else { pcVar24 = "RedOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412c00: uVar14 = -(uint)bVar43 | 1; goto LAB_00412c05; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412c00; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412c05: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26670 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26670; } else { pcVar24 = "GreenOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412ca2: uVar14 = -(uint)bVar43 | 1; goto LAB_00412ca7; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412ca2; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412ca7: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26674 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26674; } else { pcVar24 = "BlueOffset"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412d50: uVar14 = -(uint)bVar43 | 1; goto LAB_00412d55; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412d50; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412d55: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26664 = (byte ******)((float)dVar44 / 255.0); ppppppbStack_2664c = ppppppbStack_26664; } else { pcVar24 = "Rotation"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412e02: uVar14 = -(uint)bVar43 | 1; goto LAB_00412e07; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412e02; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412e07: if (uVar14 == 0) { pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } dVar44 = atof((char *)pppppbVar42); ppppppbStack_26650[0x11] = (byte *****)(float)dVar44; } else { pcVar24 = "Interpolated"; pppppbVar25 = (byte *****)&g_xmlNullStr; if (pppppbVar42 != (byte *****)0x0) { pppppbVar25 = pppppbVar42; } do { bVar13 = *(byte *)pppppbVar25; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00412e60: uVar14 = -(uint)bVar43 | 1; goto LAB_00412e65; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)pppppbVar25 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00412e60; pppppbVar25 = (byte *****)((int)pppppbVar25 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00412e65: if (uVar14 == 0) { apppppppbStack_165d0[0] = (byte *******)0x0; uStack_165c0 = 0; pppppbVar42 = (byte *****)&g_xmlNullStr; if (ppppppbStack_2664c[1] != (byte *****)0x0) { pppppbVar42 = ppppppbStack_2664c[1]; } uStack_165bc = 0xf; pppppbVar25 = pppppbVar42; do { bVar13 = *(byte *)pppppbVar25; pppppbVar25 = (byte *****)((int)pppppbVar25 + 1); } while (bVar13 != 0); std::string::assign((char *)apppppppbStack_165d0, (byte *)pppppbVar42, (int)pppppbVar25 - (int)((int)pppppbVar42 + 1)); uVar11 = uStack_165bc; uVar14 = uStack_165c0; if (uStack_165c0 == 0) { LAB_00412f32: uVar12 = 0; } else { pppppppbVar28 = (byte *******)apppppppbStack_165d0; if (0xf < uStack_165bc) { pppppppbVar28 = apppppppbStack_165d0[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uStack_165c0, &DAT_00b64fe8,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_165d0; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_165d0[0]; } bVar13 = str_eq((byte *)pppppppbVar28,uVar14, &DAT_00b64ff0,4); if (bVar13 == 0) { pppppppbVar28 = (byte *******)apppppppbStack_165d0 ; if (0xf < uVar11) { pppppppbVar28 = apppppppbStack_165d0[0]; } iVar18 = atoi((char *)pppppppbVar28); if (iVar18 == 0) goto LAB_00412f32; } } uVar12 = 1; } *(undefined1 *)(ppppppbStack_26650 + 0x12) = uVar12; pppppppbVar28 = (byte *******)apppppppbStack_165d0; goto LAB_00412f43; } } } } } } } } } } } } } } } } while ((ppppppbVar41[4] != (byte *****)0x0) && (ppppppbStack_2664c = (byte ******)ppppppbVar41[6], ppppppbStack_2664c != (byte ******)0x0)); } ppppppbStack_26650[6] = (byte *****)ppppppbStack_2665c; ppppppbStack_26650[7] = (byte *****)ppppppbStack_26660; ppppppbStack_26650[8] = (byte *****)ppppppbStack_26668; ppppppbStack_26650[9] = (byte *****)ppppppbStack_2666c; ppppppbStack_26650[0xe] = (byte *****)ppppppbStack_26670; ppppppbStack_26650[0xf] = (byte *****)ppppppbStack_26674; ppppppbStack_26650[0x10] = (byte *****)ppppppbStack_26664; ppppppbStack_26650[0x13] = (byte *****)ppppppbStack_26658; ppppppbStack_26658 = (byte ******)((int)ppppppbStack_26658 + (int)ppppppbStack_26650[2]); ppppppbStack_26650[0x14] = (byte *****)ppppppbStack_26658; ppppppbVar41 = (byte ******)ppppppbStack_2667c[0xb]; ppppppbVar32 = ppppppbStack_26688; pvVar19 = pvStack_266ac; } InterpolateNullFrames(ppppppbStack_266a4); ppppppbVar32 = (byte ******)0x0; ppppppbStack_26650 = (byte ******)0x0; ppppppbVar40 = (byte ******)0x0; ppppppbStack_2665c = ppppppbStack_26688; ppppppbVar34 = (byte ******)0x0; ppppppbVar41 = ppppppbVar32; if (ppppppbStack_26688 != (byte ******)0x0) { ppppppbStack_2667c = (byte ******)((int)pvVar19 + 4); do { ppppppbStack_2667c[0x12] = (byte *****)ppppppbVar40; pppppbVar42 = ppppppbStack_2667c[1]; ppppppbStack_2664c = (byte ******)0x0; ppppppbVar41 = ppppppbStack_2667c; if (0 < (int)pppppbVar42) { ppppppbStack_26688 = ppppppbStack_266a4 + (int)ppppppbVar32 * 0x15; ppppppbStack_26660 = ppppppbVar40; ppppppbVar32 = ppppppbVar34; do { ppppppbStack_26660 = (byte ******)((int)ppppppbStack_26660 + 1); iVar18 = (int)ppppppbVar32 + 1; ppppppbVar34 = ppppppbVar32; if (iVar18 < (int)ppppppbStack_26690) { piVar16 = (int *)((int)pvStack_266a8 + (int)ppppppbVar32 * 0x54 + 0x50); do { if ((int)ppppppbStack_26660 < *piVar16) break; iVar18 = iVar18 + 1; ppppppbVar34 = (byte ******)((int)ppppppbVar34 + 1); piVar16 = piVar16 + 0x15; } while (iVar18 < (int)ppppppbStack_26690); if ((int)ppppppbVar34 <= (int)ppppppbVar32) { pppppbVar42 = ppppppbStack_2667c[1]; ppppppbVar41 = ppppppbStack_2667c; goto LAB_004130be; } LAB_004130d3: ppppppbStack_26658 = (byte ******)((int)ppppppbVar32 * 0x54 + (int)pvStack_266a8); if ((byte ******)0x1387 < ppppppbStack_26650) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *) "%s: too many frames after interpolation/root frame adjustment\n" ); } ppppppbVar41 = ppppppbStack_26688; ppppppbStack_26650 = (byte ******)((int)ppppppbStack_26650 + 1); *ppppppbStack_26688 = ppppppbStack_2667c[-1]; ppppppbStack_26688[1] = *ppppppbStack_2667c; ppppppbStack_26688[2] = ppppppbStack_2667c[1]; *(undefined1 *)(ppppppbStack_26688 + 3) = *(undefined1 *)(ppppppbStack_2667c + 2); ppppppbStack_26688[4] = ppppppbStack_2667c[3]; ppppppbStack_26688[5] = ppppppbStack_2667c[4]; pCVar1 = (Color *)(ppppppbStack_26688 + 6); ppppppbStack_26688 = ppppppbStack_26688 + 0x15; Color::operator_assign(pCVar1,(ColorMod *)(ppppppbStack_2667c + 5)); ppppppbVar41[0x11] = ppppppbStack_2667c[0x10]; *(undefined1 *)(ppppppbVar41 + 0x12) = *(undefined1 *)(ppppppbStack_2667c + 0x11); ppppppbVar41[0x13] = ppppppbStack_2667c[0x12]; ppppppbVar41[0x14] = ppppppbStack_2667c[0x13]; fVar2 = extraout_EDX_08[5]; fVar3 = extraout_EDX_08[1]; *ppppppbVar41 = (byte *****)((float)*ppppppbVar41 * extraout_EDX_08[4] + *extraout_EDX_08); ppppppbVar41[1] = (byte *****)(fVar2 * (float)ppppppbVar41[1] + fVar3); if ((*(char *)(ppppppbVar41 + 3) == '\0') || (*(char *)(extraout_EDX_08 + 3) == '\0')) { uVar12 = 0; } else { uVar12 = 1; } *(undefined1 *)(ppppppbVar41 + 3) = uVar12; ppppppbVar41[4] = (byte *****)(extraout_EDX_08[4] * (float)ppppppbVar41[4]); ppppppbVar41[5] = (byte *****)(extraout_EDX_08[5] * (float)ppppppbVar41[5]); Color::__mul((Color *)(ppppppbVar41 + 6),(ColorMod *)(extraout_EDX_08 + 6)); ppppppbVar41[0x11] = (byte *****)((float)ppppppbStack_26658[0x11] + (float)ppppppbVar41[0x11]); ppppppbVar41[0x14] = (byte *****)ppppppbStack_26660; ppppppbStack_2667c[0x12] = (byte *****)ppppppbStack_26660; ppppppbVar41 = ppppppbStack_2667c; } else { LAB_004130be: ppppppbStack_26658 = ppppppbVar32; if (ppppppbStack_2664c == (byte ******)((int)pppppbVar42 + -1)) goto LAB_004130d3; } pppppbVar42 = ppppppbVar41[1]; ppppppbStack_2664c = (byte ******)((int)ppppppbStack_2664c + 1); ppppppbVar32 = ppppppbVar34; } while ((int)ppppppbStack_2664c < (int)pppppbVar42); ppppppbVar32 = ppppppbStack_26650; ppppppbVar40 = ppppppbStack_26660; } ppppppbVar39 = ppppppbStack_26650; ppppppbStack_2667c = ppppppbVar41 + 0x15; ppppppbStack_2665c = (byte ******)((int)ppppppbStack_2665c + -1); } while (ppppppbStack_2665c != (byte ******)0x0); ppppppbVar41 = (byte ******)0x0; if (ppppppbVar32 != (byte ******)0x0) { ppppppbStack_2664c = ppppppbVar32; ppppppbVar41 = operator_new_tracked (-(uint)((int)(ZEXT48(ppppppbStack_26650) * 0x54 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbStack_26650) * 0x54)); if (ppppppbVar41 == (byte ******)0x0) { ppppppbVar41 = (byte ******)0x0; ppppppbStack_2664c = (byte ******)0x0; } else { ppppppbVar32 = ppppppbVar41 + 1; ppppppbStack_26658 = ppppppbVar41; ppppppbStack_2664c = ppppppbVar41; do { *ppppppbVar32 = (byte *****)0x0; ppppppbVar32[-1] = (byte *****)0x0; ppppppbVar32[4] = (byte *****)0x0; ppppppbVar32[3] = (byte *****)0x0; Color::Color((Color *)(ppppppbVar32 + 5)); *(undefined1 *)(extraout_EDX_09 + 0x44) = 0; ppppppbVar32 = (byte ******)(extraout_EDX_09 + 0x54); ppppppbVar39 = (byte ******)((int)ppppppbVar39 + -1); } while (ppppppbVar39 != (byte ******)0x0); } ppppppbVar32 = ppppppbVar41 + 5; local_14._0_1_ = 0x15; ppppppbStack_26658 = (byte ******)((int)ppppppbStack_266a4 - (int)ppppppbVar41); ppppppbVar41 = ppppppbStack_266a4 + 2; ppppppbVar40 = ppppppbStack_26650; do { ppppppbVar32[-5] = ppppppbVar41[-2]; ppppppbVar32[-4] = ppppppbVar41[-1]; ppppppbVar32[-3] = *ppppppbVar41; *(undefined1 *)(ppppppbVar32 + -2) = *(undefined1 *)(ppppppbVar41 + 1); ppppppbVar32[-1] = ppppppbVar41[2]; *ppppppbVar32 = *(byte ******)((int)ppppppbStack_26658 + (int)ppppppbVar32); Color::operator_assign((Color *)(ppppppbVar32 + 1),(ColorMod *)(ppppppbVar41 + 4)); ppppppbVar32 = (byte ******)(extraout_EDX_10 + 0x54); *(byte ******)(extraout_EDX_10 + 0x30) = ppppppbVar41[0xf]; *(undefined1 *)(extraout_EDX_10 + 0x34) = *(undefined1 *)(ppppppbVar41 + 0x10); *(byte ******)(extraout_EDX_10 + 0x38) = ppppppbVar41[0x11]; *(byte ******)(extraout_EDX_10 + 0x3c) = ppppppbVar41[0x12]; ppppppbVar40 = (byte ******)((int)ppppppbVar40 + -1); ppppppbVar41 = ppppppbVar41 + 0x15; } while (ppppppbVar40 != (byte ******)0x0); *(byte *******)((int)(local_6ac + 1) + (int)ppppppbStack_266a0) = ppppppbStack_2664c; ppppppbVar41 = ppppppbStack_26650; } } ppppppbVar32 = ppppppbStack_2668c; *(byte *******)((int)(local_6ac + 2) + (int)ppppppbStack_266a0) = ppppppbVar41; ppppppbStack_26654 = (byte ******)ppppppbStack_26654[0xb]; } while (ppppppbStack_26654 != (byte ******)0x0); if (ppppppbStack_2668c != (byte ******)0x0) { ppppppbStack_2664c = ppppppbStack_2668c; ppppppbStack_26654 = (byte ******)0x0; uVar14 = -(uint)((int)(ZEXT48(ppppppbStack_2668c) * 0x10 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbStack_2668c) * 0x10); puStack_266c0 = operator_new_tracked(-(uint)(0xfffffffb < uVar14) | uVar14 + 4); local_14._0_1_ = 0x17; if (puStack_266c0 == (undefined4 *)0x0) { ppppppbVar41 = (byte ******)0x0; ppppppbStack_26654 = (byte ******)0x0; } else { ppppppbVar41 = (byte ******)(puStack_266c0 + 1); *puStack_266c0 = ppppppbVar32; ppppppbStack_26654 = ppppppbVar41; _eh_vector_constructor_iterator_ (ppppppbVar41,0x10,(uint)ppppppbVar32,(_func_void_void_ptr *)&LAB_0040c210, guard_check_icall); } pbVar31 = local_6b0; local_14._0_1_ = 0x15; ppppppbStack_2664c = (byte ******)((int)pbVar31 + -(int)ppppppbVar41); ppppppbStack_26658 = (byte ******)((int)local_6ac + -(int)ppppppbVar41); ppppppbStack_26688 = (byte ******)((int)local_6ac + -(int)ppppppbVar41 + 4); ppppppbVar40 = ppppppbVar41 + 1; do { pppppbVar42 = *(byte ******)pbVar31; pbVar31 = pbVar31 + 0x10; ppppppbVar40[-1] = pppppbVar42; ppppppbVar34 = ppppppbVar40 + 4; *(undefined1 *)ppppppbVar40 = (auStack_aa4 + -(int)ppppppbVar41 + 0x3e4)[(int)ppppppbVar34]; ppppppbVar40[1] = *(byte ******)(auStack_aa4 + -(int)ppppppbVar41 + 1000 + (int)ppppppbVar34); ppppppbVar40[2] = *(byte ******)(auStack_aa4 + -(int)ppppppbVar41 + 0x3ec + (int)ppppppbVar34); ppppppbVar32 = (byte ******)((int)ppppppbVar32 + -1); ppppppbVar40 = ppppppbVar34; } while (ppppppbVar32 != (byte ******)0x0); pppppppbStack_266b4[8] = ppppppbStack_26654; goto LAB_00413466; } } pppppppbStack_266b4[9] = ppppppbStack_2668c; ppppppbStack_26690 = (byte ******)0x0; pcVar24 = "Triggers"; do { pcVar36 = pcVar24; pcVar24 = pcVar36 + 1; } while (*pcVar24 != '\0'); ppppppbStack_26654 = (byte ******)(pcVar36 + -0xb1b5ff); for (pppppbVar42 = ppppppbStack_26684[6]; pppppbVar42 != (byte *****)0x0; pppppbVar42 = (byte *****)pppppbVar42[0xb]) { pbVar31 = (byte *)*pppppbVar42; if ((byte ****)pbVar31 == (byte ****)0x0) { ppppppbVar41 = (byte ******)0x0; pbVar31 = &g_xmlNullStr; } else { ppppppbVar41 = (byte ******)pppppbVar42[2]; } if (ppppppbVar41 == ppppppbStack_26654) { ppppbVar29 = (byte ****)((int)ppppppbVar41 + (int)pbVar31); if (ppppbVar29 <= pbVar31) goto LAB_004134e1; iVar18 = (int)"Triggers" - (int)pbVar31; while (*pbVar31 == *(byte *)((int)pbVar31 + iVar18)) { pbVar31 = (byte *)((int)pbVar31 + 1); if (ppppbVar29 <= pbVar31) goto LAB_004134e1; } } } pppppbVar42 = (byte *****)0x0; LAB_004134e1: ppppppbStack_2664c = (byte ******)pppppbVar42[6]; if (ppppppbStack_2664c != (byte ******)0x0) { ppppppbVar41 = &local_28b0; do { ppppppbVar32 = ppppppbStack_2664c; if ((byte ******)0x7f < ppppppbStack_26690) { std::string::c_str(psStack_26694->_buf); KAGE_LogMessage(0x10,(byte *)"%s: too many triggers\n"); } pppppbVar42 = ppppppbVar32[8]; ppppppbStack_26690 = (byte ******)((int)ppppppbStack_26690 + 1); ppppppbStack_26658 = ppppppbVar41 + 2; ppppppbStack_26654 = ppppppbVar41; if (pppppbVar42 != (byte *****)0x0) { do { ppppbVar29 = *pppppbVar42; pcVar24 = "EventId"; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_00413581: uVar14 = -(uint)bVar43 | 1; goto LAB_00413586; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_00413581; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_00413586: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } pppppbVar25 = (byte *****)atoi((char *)ppppbVar29); *ppppppbStack_26654 = pppppbVar25; } else { pcVar24 = "AtFrame"; ppppbVar21 = (byte ****)&g_xmlNullStr; if (ppppbVar29 != (byte ****)0x0) { ppppbVar21 = ppppbVar29; } do { bVar13 = *(byte *)ppppbVar21; bVar43 = bVar13 < (byte)*pcVar24; if (bVar13 != *pcVar24) { LAB_004135d7: uVar14 = -(uint)bVar43 | 1; goto LAB_004135dc; } if (bVar13 == 0) break; bVar13 = *(byte *)((int)ppppbVar21 + 1); bVar43 = bVar13 < (byte)pcVar24[1]; if (bVar13 != pcVar24[1]) goto LAB_004135d7; ppppbVar21 = (byte ****)((int)ppppbVar21 + 2); pcVar24 = pcVar24 + 2; } while (bVar13 != 0); uVar14 = 0; LAB_004135dc: if (uVar14 == 0) { ppppbVar29 = (byte ****)&g_xmlNullStr; if (pppppbVar42[1] != (byte ****)0x0) { ppppbVar29 = pppppbVar42[1]; } pppppbVar25 = (byte *****)atoi((char *)ppppbVar29); ppppppbStack_26654[1] = pppppbVar25; } } } while ((pppppbVar42[4] != (byte ****)0x0) && (pppppbVar42 = (byte *****)pppppbVar42[6], pppppbVar42 != (byte *****)0x0)); } ppppppbStack_2664c = (byte ******)ppppppbStack_2664c[0xb]; ppppppbVar41 = ppppppbStack_26658; } while (ppppppbStack_2664c != (byte ******)0x0); if (ppppppbStack_26690 != (byte ******)0x0) { ppppppbStack_26654 = operator_new_tracked (-(uint)((int)(ZEXT48(ppppppbStack_26690) * 8 >> 0x20) != 0) | (uint)(ZEXT48(ppppppbStack_26690) * 8)); ppppppbVar41 = ppppppbStack_26690; ppppppbVar32 = ppppppbStack_26654; do { pppppbVar42 = *(byte ******) ((int)auStack_16378 + -(int)ppppppbStack_26654 + 0x13ac4 + (int)(ppppppbVar32 + 2)); *ppppppbVar32 = *(byte ******)((int)&local_28b0 + -(int)ppppppbStack_26654 + (int)ppppppbVar32); ppppppbVar32[1] = pppppbVar42; ppppppbVar41 = (byte ******)((int)ppppppbVar41 - 1); ppppppbVar32 = ppppppbVar32 + 2; } while (ppppppbVar41 != (byte ******)0x0); pppppppbStack_266b4[10] = ppppppbStack_26654; } } pppppppbStack_266b4[0xb] = ppppppbStack_26690; ppppppbVar41 = (byte ******)ppppppbStack_26684[0xb]; local_14._0_1_ = 0x12; ppppppbStack_26684 = ppppppbVar41; _eh_vector_destructor_iterator_(local_6b0,0x10,0x40,guard_check_icall); local_14._0_1_ = 0x11; _eh_vector_destructor_iterator_(local_ab0,0x10,0x40,guard_check_icall); local_14._0_1_ = 10; std::string::_Tidy_deallocate((char *)apppppppbStack_165e8); puVar23 = puStack_266b8; } ppppppbStack_26654 = (byte ******)0x0; uVar14 = -(uint)((int)(ZEXT48(puVar23) * 0x13c >> 0x20) != 0) | (uint)(ZEXT48(puVar23) * 0x13c); puStack_266c0 = puVar23; puStack_266c4 = operator_new_tracked(-(uint)(0xfffffffb < uVar14) | uVar14 + 4); local_14._0_1_ = 0x18; if (puStack_266c4 == (undefined4 *)0x0) { ppppppbStack_2664c = (byte ******)0x0; } else { *puStack_266c4 = puVar23; ppppppbStack_2664c = (byte ******)(puStack_266c4 + 1); _eh_vector_constructor_iterator_ (ppppppbStack_2664c,0x13c,(uint)puVar23,(_func_void_void_ptr *)&LAB_0040bec0, std::string::_Tidy_deallocate); } local_14._0_1_ = 10; if (puVar23 != (undefined4 *)0x0) { ppppppbStack_266a0 = (byte ******)((int)&ppppppbStack_164b0 - (int)ppppppbStack_2664c); ppppppbStack_26658 = ppppppbStack_2664c + 0xc; ppppppbStack_2667c = (byte ******)((int)apppppbStack_164ac - (int)ppppppbStack_2664c); ppppppbStack_26654 = apppppbStack_16494; iVar18 = (int)apppppbStack_267d0 + (-0x38 - (int)ppppppbStack_2664c); ppppppbStack_2668c = (byte ******)((int)apppppbStack_163a8 - (int)ppppppbStack_2664c); ppppppbStack_26688 = (byte ******)puStack_266b8; do { ppppppbVar32 = ppppppbStack_26658; std::string::string((char *)&pppppbStack_26808,ppppppbStack_26654 + -7); ppppppbVar41 = (byte ******)ppppppbStack_26654[-1]; pppppbVar42 = *ppppppbStack_26654; pppppbVar25 = ppppppbStack_26654[1]; pppppbVar5 = ppppppbStack_26654[2]; pppppbVar6 = ppppppbStack_26654[3]; pppppbVar7 = ppppppbStack_26654[4]; pppppbVar37 = (byte *****)0x0; pppppbStack_267d8 = *(byte ******)((int)ppppppbStack_266a0 + (int)ppppppbVar32); uStack_267d4 = *(undefined1 *)((int)ppppppbStack_2667c + (int)ppppppbVar32); pppppbStack_266d0 = *(byte ******)((int)ppppppbStack_2668c + (int)ppppppbVar32); ppppppbStack_26684 = ppppppbVar41; if (pppppbVar42 != (byte *****)0x0) { iVar33 = 0; do { piVar16 = (int *)(iVar33 + (int)ppppppbVar41); iVar33 = iVar33 + 0x10; apppppbStack_267d0[*piVar16] = pppppbVar37; pppppbVar37 = (byte *****)((int)pppppbVar37 + 1); } while (pppppbVar37 < pppppbVar42); } pppppbVar37 = ppppppbVar32[-0xc]; pppppbVar8 = ppppppbVar32[-0xb]; pppppbVar9 = ppppppbVar32[-10]; pppppbVar10 = ppppppbVar32[-9]; ppppppbVar40 = ppppppbVar32 + 2; uVar4 = *(undefined8 *)(ppppppbVar32 + -8); ppppppbVar32[-0xc] = pppppbStack_26808; ppppppbVar32[-0xb] = pppppbStack_26804; ppppppbVar32[-10] = pppppbStack_26800; ppppppbVar32[-9] = pppppbStack_267fc; *(undefined8 *)(ppppppbVar32 + -8) = uStack_267f8; pppppbStack_26808 = pppppbVar37; pppppbStack_26804 = pppppbVar8; pppppbStack_26800 = pppppbVar9; pppppbStack_267fc = pppppbVar10; uStack_267f8 = uVar4; pppppbStack_267f0 = ppppppbVar32[-6]; ppppppbVar32[-6] = (byte *****)ppppppbVar41; pppppbStack_267ec = ppppppbVar32[-5]; ppppppbVar32[-5] = pppppbVar42; pppppbStack_267e8 = ppppppbVar32[-4]; ppppppbVar32[-4] = pppppbVar25; pppppbStack_267e4 = ppppppbVar32[-3]; ppppppbVar32[-3] = pppppbVar5; pppppbStack_267e0 = ppppppbVar32[-2]; ppppppbVar32[-2] = pppppbVar6; pppppbStack_267dc = ppppppbVar32[-1]; ppppppbVar32[-1] = pppppbVar7; if (ppppppbVar40 != apppppbStack_267d0) { ppppppbVar41 = ppppppbVar32 + 0x42; ppppppbStack_26684 = ppppppbVar41; if (ppppppbVar40 != ppppppbVar41) { do { pppppbVar42 = *ppppppbVar40; *ppppppbVar40 = *(byte ******)((int)ppppppbVar40 + iVar18); *(byte ******)((int)ppppppbVar40 + iVar18) = pppppbVar42; ppppppbVar40 = ppppppbVar40 + 1; } while (ppppppbVar40 != ppppppbVar41); ppppppbVar32 = ppppppbStack_26658; } } pppppbVar42 = *ppppppbVar32; *ppppppbVar32 = pppppbStack_267d8; uVar12 = *(undefined1 *)(ppppppbVar32 + 1); *(undefined1 *)(ppppppbVar32 + 1) = uStack_267d4; pppppbVar25 = ppppppbVar32[0x42]; ppppppbVar32[0x42] = pppppbStack_266d0; pppppbStack_267d8 = pppppbVar42; uStack_267d4 = uVar12; pppppbStack_266d0 = pppppbVar25; std::string::_Tidy_deallocate((char *)&pppppbStack_26808); ppppppbStack_26658 = ppppppbVar32 + 0x4f; ppppppbStack_26654 = ppppppbStack_26654 + 0x4f; iVar18 = iVar18 + -0x13c; ppppppbStack_26688 = (byte ******)((int)ppppppbStack_26688 + -1); } while (ppppppbStack_26688 != (byte ******)0x0); ppppppbStack_26688 = (byte ******)0x0; puVar23 = puStack_266b8; } *(byte *******)(puStack_266b0 + 0xc) = ppppppbStack_2664c; *(undefined4 **)(puStack_266b0 + 0x10) = puVar23; local_14._0_1_ = 0x19; tracked_alloc(1,pvStack_266a8,0); local_14._0_1_ = 0x1a; tracked_alloc(1,ppppppbStack_26678,0); local_14._0_1_ = 0x1b; tracked_alloc(1,pvStack_266ac,0); local_14._0_1_ = 0x1c; tracked_alloc(1,ppppppbStack_266a4,0); local_14._0_1_ = 0x1d; tracked_alloc(1,ppppppbStack_26680,0); local_14._0_1_ = 0x1e; tracked_alloc(1,ppppppbStack_2669c,0); local_14._0_1_ = 8; _eh_vector_destructor_iterator_(&ppppppbStack_164b0,0x13c,0x100,std::string::_Tidy_deallocate); local_14._0_1_ = 6; _eh_vector_destructor_iterator_(local_2b0,0x18,0x10,std::string::_Tidy_deallocate); local_14._0_1_ = 3; _eh_vector_destructor_iterator_(local_10b0,0x18,0x40,std::string::_Tidy_deallocate); local_14._0_1_ = 2; _eh_vector_destructor_iterator_(local_24b0,0x38,0x40,FUN_0040db70); local_14._0_1_ = 1; _eh_vector_destructor_iterator_(local_16b0,0x18,0x40,std::string::_Tidy_deallocate); local_14._0_1_ = 0x1f; xml_memory_pool::clear(auStack_26618); local_14 = CONCAT31(local_14._1_3_,0x20); tracked_alloc(1,pbStack_266bc,0); LAB_00413b0f: std::string::_Tidy_deallocate(sStack_16600._buf); ExceptionList = local_1c; return; } //@@ 00413b40 FUN_00413b40 void FUN_00413b40(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11c0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; xml_memory_pool::clear((void *)(in_ECX + 0x30)); ExceptionList = local_10; return; } //@@ 00413b90 FUN_00413b90 void FUN_00413b90(void) { undefined4 *puVar1; undefined4 *in_ECX; in_ECX[0x400f] = 0; puVar1 = in_ECX + 0xf; *in_ECX = 0; in_ECX[1] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[0xd] = (-(int)puVar1 & 3U) + (int)puVar1; in_ECX[8] = 0; in_ECX[0x4010] = 0; in_ECX[0xc] = puVar1; in_ECX[0xe] = in_ECX + 0x400f; return; } //@@ 00413bf0 xml_node::first_attribute /* DB: src/anm2 decompile labels (xml_node::first_attribute(name)) prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall xml_node::first_attribute(void *this,byte *name,uint nameSize,byte isCaseSensitive) { byte *pbVar1; byte bVar2; undefined4 *puVar3; byte *pbVar4; byte *pbVar5; int iVar6; if (name == (byte *)0x0) { return *(void **)((int)this + 0x20); } bVar2 = *name; pbVar5 = name; while (bVar2 != 0) { pbVar5 = pbVar5 + 1; bVar2 = *pbVar5; } puVar3 = *(undefined4 **)((int)this + 0x20); do { if (puVar3 == (undefined4 *)0x0) { return (void *)0x0; } pbVar4 = (byte *)*puVar3; if (pbVar4 == (byte *)0x0) { iVar6 = 0; pbVar4 = &g_xmlNullStr; } else { iVar6 = puVar3[2]; } if (iVar6 == (int)pbVar5 - (int)name) { pbVar1 = pbVar4 + iVar6; if (pbVar1 <= pbVar4) { return puVar3; } iVar6 = (int)name - (int)pbVar4; while (*pbVar4 == pbVar4[iVar6]) { pbVar4 = pbVar4 + 1; if (pbVar1 <= pbVar4) { return puVar3; } } } puVar3 = (undefined4 *)puVar3[6]; } while( true ); } //@@ 00413c70 xml_node::first_node /* DB: src/anm2 decompile labels (xml_node::first_node(name)) prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall xml_node::first_node(void *this,byte *name,int nameSize,byte isCaseSensitive) { byte *pbVar1; byte bVar2; undefined4 *puVar3; byte *pbVar4; byte *pbVar5; int iVar6; if (name == (byte *)0x0) { return *(void **)((int)this + 0x18); } bVar2 = *name; pbVar5 = name; while (bVar2 != 0) { pbVar5 = pbVar5 + 1; bVar2 = *pbVar5; } puVar3 = *(undefined4 **)((int)this + 0x18); do { if (puVar3 == (undefined4 *)0x0) { return (void *)0x0; } pbVar4 = (byte *)*puVar3; if (pbVar4 == (byte *)0x0) { iVar6 = 0; pbVar4 = &g_xmlNullStr; } else { iVar6 = puVar3[2]; } if (iVar6 == (int)pbVar5 - (int)name) { pbVar1 = pbVar4 + iVar6; if (pbVar1 <= pbVar4) { return puVar3; } iVar6 = (int)name - (int)pbVar4; while (*pbVar4 == pbVar4[iVar6]) { pbVar4 = pbVar4 + 1; if (pbVar1 <= pbVar4) { return puVar3; } } } puVar3 = (undefined4 *)puVar3[0xb]; } while( true ); } //@@ 00413cf0 FUN_00413cf0 void FUN_00413cf0(uint *param_1,uint param_2,int param_3,uint param_4,int param_5,undefined4 param_6 ,undefined4 param_7,uint param_8) { int iVar1; int iVar2; int iVar3; uint uVar4; int in_ECX; uint uVar5; uint uVar6; uint uVar7; uint uVar8; uVar8 = param_4 + param_2; uVar7 = param_5 + param_3 + (uint)CARRY4(param_4,param_2); iVar1 = **(int **)(in_ECX + 0x1c); if ((*(byte *)(in_ECX + 0x3c) & 2) == 0) { uVar5 = **(uint **)(in_ECX + 0x20); if ((uVar5 != 0) && (*(uint *)(in_ECX + 0x38) < uVar5)) { *(uint *)(in_ECX + 0x38) = uVar5; } } else { uVar5 = 0; } iVar2 = **(int **)(in_ECX + 0xc); iVar3 = *(int *)(in_ECX + 0x38); uVar4 = iVar3 - iVar2; uVar6 = (int)uVar4 >> 0x1f; if (((uVar6 < uVar7) || ((uVar6 <= uVar7 && (uVar4 < uVar8)))) || ((uVar8 != 0 || uVar7 != 0 && ((((param_8 & 1) != 0 && (iVar1 == 0)) || (((param_8 & 2) != 0 && (uVar5 == 0)))))))) { *param_1 = 0xffffffff; param_1[1] = 0xffffffff; } else { if (((param_8 & 1) != 0) && (iVar1 != 0)) { **(int **)(in_ECX + 0x1c) = iVar2 + uVar8; **(int **)(in_ECX + 0x2c) = iVar3 - (iVar2 + uVar8); } if (((param_8 & 2) != 0) && (uVar5 != 0)) { iVar1 = **(int **)(in_ECX + 0x20); iVar3 = **(int **)(in_ECX + 0x30); **(int **)(in_ECX + 0x10) = iVar2; **(int **)(in_ECX + 0x20) = iVar2 + uVar8; **(int **)(in_ECX + 0x30) = (iVar1 + iVar3) - (iVar2 + uVar8); } *param_1 = uVar8; param_1[1] = uVar7; } param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; return; } //@@ 00413e00 FUN_00413e00 void FUN_00413e00(uint *param_1,uint param_2,int param_3,int param_4,byte param_5) { int iVar1; int iVar2; int iVar3; uint uVar4; uint uVar5; int iVar6; int in_ECX; uint uVar7; uint uVar8; uint uVar9; uint local_20; uint uStack_1c; iVar1 = **(int **)(in_ECX + 0x1c); if ((*(byte *)(in_ECX + 0x3c) & 2) == 0) { uVar7 = **(uint **)(in_ECX + 0x20); if ((uVar7 != 0) && (*(uint *)(in_ECX + 0x38) < uVar7)) { *(uint *)(in_ECX + 0x38) = uVar7; } } else { uVar7 = 0; } iVar2 = **(int **)(in_ECX + 0xc); iVar3 = *(int *)(in_ECX + 0x38); uVar4 = iVar3 - iVar2; uVar8 = (int)uVar4 >> 0x1f; if (param_4 == 0) { uStack_1c = 0; local_20 = 0; LAB_00413ec6: uVar9 = local_20 + param_2; uVar5 = uStack_1c + param_3 + (uint)CARRY4(local_20,param_2); if (((uVar5 <= uVar8) && ((uVar5 < uVar8 || (uVar9 <= uVar4)))) && ((uVar9 == 0 && uVar5 == 0 || ((((param_5 & 1) == 0 || (iVar1 != 0)) && (((param_5 & 2) == 0 || (uVar7 != 0)))))))) { iVar6 = iVar2 + uVar9; if (((param_5 & 1) != 0) && (iVar1 != 0)) { **(int **)(in_ECX + 0x1c) = iVar6; **(int **)(in_ECX + 0x2c) = iVar3 - iVar6; } if (((param_5 & 2) != 0) && (uVar7 != 0)) { iVar1 = **(int **)(in_ECX + 0x20); iVar3 = **(int **)(in_ECX + 0x30); **(int **)(in_ECX + 0x10) = iVar2; **(int **)(in_ECX + 0x20) = iVar6; **(int **)(in_ECX + 0x30) = (iVar1 + iVar3) - iVar6; } *param_1 = uVar9; param_1[1] = uVar5; goto LAB_00413f70; } } else if (param_4 == 1) { if ((param_5 & 3) != 3) { if ((param_5 & 1) == 0) { if (((param_5 & 2) != 0) && ((uVar7 != 0 || (iVar2 == 0)))) { local_20 = uVar7 - iVar2; uStack_1c = (int)local_20 >> 0x1f; goto LAB_00413ec6; } } else if ((iVar1 != 0) || (iVar2 == 0)) { local_20 = iVar1 - iVar2; uStack_1c = (int)local_20 >> 0x1f; goto LAB_00413ec6; } } } else if (param_4 == 2) { uStack_1c = uVar8; local_20 = uVar4; goto LAB_00413ec6; } *param_1 = 0xffffffff; param_1[1] = 0xffffffff; LAB_00413f70: param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; return; } //@@ 00413f90 std::basic_stringbuf,std::allocator_>::underflow /* Library Function - Single Match protected: virtual int __thiscall std::basic_stringbuf,class std::allocator >::underflow(void) Library: Visual Studio 2019 Release */ int __thiscall std::basic_stringbuf,std::allocator_>::underflow (basic_stringbuf,std::allocator_> *this) { int *piVar1; byte *pbVar2; byte *pbVar3; int iVar4; byte *pbVar5; piVar1 = *(int **)(this + 0x1c); pbVar2 = (byte *)*piVar1; if (pbVar2 != (byte *)0x0) { if (pbVar2 < pbVar2 + **(int **)(this + 0x2c)) { return (uint)*pbVar2; } pbVar3 = (byte *)**(undefined4 **)(this + 0x20); if ((pbVar3 != (byte *)0x0) && (((byte)this[0x3c] & 4) == 0)) { pbVar5 = *(byte **)(this + 0x38); if (*(byte **)(this + 0x38) < pbVar3) { pbVar5 = pbVar3; } if (pbVar2 < pbVar5) { *(byte **)(this + 0x38) = pbVar5; iVar4 = *piVar1; *piVar1 = iVar4; **(int **)(this + 0x2c) = (int)pbVar5 - iVar4; return (uint)*(byte *)**(undefined4 **)(this + 0x1c); } } } return -1; } //@@ 00413ff0 std::basic_stringbuf,std::allocator_>::pbackfail /* Library Function - Single Match protected: virtual int __thiscall std::basic_stringbuf,class std::allocator >::pbackfail(int) Library: Visual Studio 2019 Release */ int __thiscall std::basic_stringbuf,std::allocator_>::pbackfail (basic_stringbuf,std::allocator_> *this,int param_1) { uint uVar1; uVar1 = **(uint **)(this + 0x1c); if (((uVar1 == 0) || (uVar1 <= **(uint **)(this + 0xc))) || ((param_1 != -1 && (((char)param_1 != *(char *)(uVar1 - 1) && (((byte)this[0x3c] & 2) != 0))))) ) { return -1; } **(int **)(this + 0x2c) = **(int **)(this + 0x2c) + 1; **(int **)(this + 0x1c) = **(int **)(this + 0x1c) + -1; if (param_1 == -1) { param_1 = 0; } else { *(char *)**(undefined4 **)(this + 0x1c) = (char)param_1; } return param_1; } //@@ 00414050 FUN_00414050 int FUN_00414050(int param_1) { void *_Src; char *pcVar1; uint uVar2; void *_Dst; basic_streambuf_> *in_ECX; int iVar3; int iVar4; uint uVar5; if (((byte)in_ECX[0x3c] & 2) != 0) { return -1; } if (param_1 == -1) { return 0; } uVar5 = **(uint **)(in_ECX + 0x20); if ((uVar5 != 0) && (uVar5 < **(int **)(in_ECX + 0x30) + uVar5)) { pcVar1 = std::basic_streambuf_>::_Pninc(in_ECX); *pcVar1 = (char)param_1; *(uint *)(in_ECX + 0x38) = uVar5 + 1; return param_1; } _Src = (void *)**(undefined4 **)(in_ECX + 0xc); uVar5 = -(uint)(uVar5 != 0) & (**(int **)(in_ECX + 0x30) + uVar5) - (int)_Src; if (uVar5 < 0x20) { uVar2 = 0x20; } else if (uVar5 < 0x3fffffff) { uVar2 = uVar5 * 2; } else { if (0x7ffffffe < uVar5) { return -1; } uVar2 = 0x7fffffff; } _Dst = std::_Allocate(uVar2); memcpy(_Dst,_Src,uVar5); iVar4 = (int)_Dst + uVar5; *(int *)(in_ECX + 0x38) = iVar4 + 1; **(undefined4 **)(in_ECX + 0x10) = _Dst; **(int **)(in_ECX + 0x20) = iVar4; **(int **)(in_ECX + 0x30) = (int)_Dst + (uVar2 - iVar4); if (((byte)in_ECX[0x3c] & 4) == 0) { iVar4 = *(int *)(in_ECX + 0x38); iVar3 = (**(int **)(in_ECX + 0x1c) - (int)_Src) + (int)_Dst; **(undefined4 **)(in_ECX + 0xc) = _Dst; **(int **)(in_ECX + 0x1c) = iVar3; **(int **)(in_ECX + 0x2c) = iVar4 - iVar3; } else { **(undefined4 **)(in_ECX + 0xc) = _Dst; **(undefined4 **)(in_ECX + 0x1c) = 0; **(undefined4 **)(in_ECX + 0x2c) = _Dst; } uVar2 = *(uint *)(in_ECX + 0x3c); if ((uVar2 & 1) != 0) { FUN_0040d000(_Src,uVar5); uVar2 = *(uint *)(in_ECX + 0x3c); } *(uint *)(in_ECX + 0x3c) = uVar2 | 1; pcVar1 = std::basic_streambuf_>::_Pninc(in_ECX); *pcVar1 = (char)param_1; return param_1; } //@@ 004141a0 std::basic_stringbuf::~basic_stringbuf /* DB: sets basic_stringbuf vftable, frees the owned buffer when mode bit 1 set, nulls the six get/put pointers, clears state, tail-jumps to the basic_streambuf dtor; called from its scalar_deleting_destructor and ResolveRelativePath */ void std::basic_stringbuf::~basic_stringbuf(void) { void *pvVar1; void *ptr; basic_streambuf_> *in_ECX; int iVar2; uint size; *(undefined ***)in_ECX = basic_stringbuf,std::allocator_>::vftable; if (((byte)in_ECX[0x3c] & 1) != 0) { if (**(int **)(in_ECX + 0x20) == 0) { iVar2 = **(int **)(in_ECX + 0x2c) + **(int **)(in_ECX + 0x1c); } else { iVar2 = **(int **)(in_ECX + 0x30) + **(int **)(in_ECX + 0x20); } pvVar1 = (void *)**(int **)(in_ECX + 0xc); size = iVar2 - (int)pvVar1; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } **(undefined4 **)(in_ECX + 0xc) = 0; **(undefined4 **)(in_ECX + 0x1c) = 0; **(undefined4 **)(in_ECX + 0x2c) = 0; **(undefined4 **)(in_ECX + 0x10) = 0; **(undefined4 **)(in_ECX + 0x20) = 0; **(undefined4 **)(in_ECX + 0x30) = 0; *(uint *)(in_ECX + 0x3c) = *(uint *)(in_ECX + 0x3c) & 0xfffffffe; *(undefined4 *)(in_ECX + 0x38) = 0; /* WARNING: Could not recover jumptable at 0x0041423a. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_streambuf_>::~basic_streambuf_> (in_ECX); return; } //@@ 00414250 FUN_00414250 char * FUN_00414250(char *param_1) { int in_ECX; byte *local_20; uint uStack_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11fe; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; if ((((byte)*(uint *)(in_ECX + 0x54) & 0x22) == 2) || (uStack_1c = **(uint **)(in_ECX + 0x38), uStack_1c == 0)) { if (((*(uint *)(in_ECX + 0x54) & 4) == 0) && (**(int **)(in_ECX + 0x34) != 0)) { local_20 = (byte *)**(int **)(in_ECX + 0x24); uStack_1c = (**(int **)(in_ECX + 0x44) - (int)local_20) + **(int **)(in_ECX + 0x34); } else { uStack_1c = 0; local_20 = (byte *)0x0; } } else { if (uStack_1c < *(uint *)(in_ECX + 0x50)) { uStack_1c = *(uint *)(in_ECX + 0x50); } local_20 = (byte *)**(int **)(in_ECX + 0x28); uStack_1c = uStack_1c - (int)local_20; } if (local_20 != (byte *)0x0) { std::string::assign(param_1,local_20,uStack_1c); } ExceptionList = local_10; return param_1; } //@@ 00414330 std_stringstream_constructor /* DB: std::basic_stringstream constructor: basic_ios at +0x68, basic_iostream over the stringbuf at +0x18, sets basic_stringstream / basic_stringbuf vftables, zeroes buffer state; ResolveRelativePath, write_desync_dump */ void std_stringstream_constructor(void) { basic_streambuf_> *this; basic_iostream_> *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af124e; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined **)in_ECX = &DAT_00b1b17c; *(undefined **)(in_ECX + 0x10) = &DAT_00b1b174; std::basic_ios_>::basic_ios_> ((basic_ios_> *)(in_ECX + 0x68)); this = (basic_streambuf_> *)(in_ECX + 0x18); local_8 = 0; std::basic_iostream_>::basic_iostream_> (in_ECX,this); local_8 = 1; *(undefined ***)(in_ECX + *(int *)(*(int *)in_ECX + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)(in_ECX + *(int *)(*(int *)in_ECX + 4) + -4) = *(int *)(*(int *)in_ECX + 4) + -0x68; std::basic_streambuf_>::basic_streambuf_> (this); *(undefined ***)this = std::basic_stringbuf,std::allocator_>::vftable; *(undefined4 *)(in_ECX + 0x50) = 0; *(undefined4 *)(in_ECX + 0x54) = 0; ExceptionList = local_10; return; } //@@ 004143f0 FUN_004143f0 int FUN_004143f0(int param_1) { int *in_ECX; return *in_ECX + param_1 * 0x18; } //@@ 00414410 FUN_00414410 int FUN_00414410(void) { int *in_ECX; return (in_ECX[1] - *in_ECX) / 0x18; } //@@ 00414440 FUN_00414440 int FUN_00414440(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af127d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(uint *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x1c); newNode[4] = *param_1; newNode[5] = 0; newNode[6] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 00414500 FUN_00414500 int FUN_00414500(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::_Try_emplace(local_10,param_1); return *piVar1 + 0x14; } //@@ 00414520 FUN_00414520 void FUN_00414520(uint param_1,byte param_2) { uint *puVar1; char *in_ECX; puVar1 = (uint *)(in_ECX + 0x10); if (*puVar1 < param_1) { std::string::append_n(in_ECX,param_1 - *puVar1,param_2); return; } if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(char **)in_ECX; } *puVar1 = param_1; in_ECX[param_1] = '\0'; return; } //@@ 00414550 SimpleString::operator= /* Library Function - Single Match public: char const * __thiscall SimpleString::operator=(char const *) Library: Visual Studio 2019 Release */ char * __thiscall SimpleString::operator=(SimpleString *this,char *param_1) { char cVar1; char *pcVar2; std_string *psVar3; pcVar2 = param_1; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); psVar3 = std::string::assign((char *)this,(byte *)param_1,(int)pcVar2 - (int)(param_1 + 1)); return psVar3->_buf; } //@@ 00414590 std::basic_stringbuf,std::allocator_>::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::basic_stringbuf,class std::allocator >::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::basic_stringbuf,std::allocator_>:: _scalar_deleting_destructor_ (basic_stringbuf,std::allocator_> *this,uint param_1) { basic_stringbuf::~basic_stringbuf(); if ((param_1 & 1) != 0) { operator_delete(this,0x44); } return this; } //@@ 004145c0 FUN_004145c0 basic_ios_> * FUN_004145c0(byte param_1) { basic_ios_> *ptr; basic_ios_> *in_ECX; ptr = in_ECX + -0x68; *(undefined ***)(in_ECX + *(int *)(*(int *)(in_ECX + -0x68) + 4) + -0x68) = std::basic_stringstream,std::allocator_>::vftable; *(int *)(in_ECX + *(int *)(*(int *)ptr + 4) + -0x6c) = *(int *)(*(int *)ptr + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>::~basic_iostream_> ((basic_iostream_> *)(in_ECX + -0x48)); std::basic_ios_>::~basic_ios_>(in_ECX); if ((param_1 & 1) != 0) { operator_delete(ptr,0xb0); } return ptr; } //@@ 00414620 FUN_00414620 void FUN_00414620(void) { int *piVar1; bool bVar2; uint uVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; bVar2 = std::uncaught_exception(); if (!bVar2) { std::basic_ostream_>::_Osfx ((basic_ostream_> *)*in_ECX); } local_8 = 0; piVar1 = *(int **)(*(int *)(*(int *)*in_ECX + 4) + 0x38 + *in_ECX); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 8))(uVar3); } ExceptionList = local_10; return; } //@@ 00414690 FUN_00414690 void FUN_00414690(basic_ostream_> *param_1) { basic_ostream_> *this; uint uVar1; undefined4 *in_ECX; int iVar2; bool bVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12cd; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = param_1; iVar2 = *(int *)param_1; if (*(int **)(param_1 + *(int *)(iVar2 + 4) + 0x38) != (int *)0x0) { (**(code **)(**(int **)(param_1 + *(int *)(iVar2 + 4) + 0x38) + 4))(uVar1); iVar2 = *(int *)param_1; } local_8 = 0; if (*(int *)(param_1 + *(int *)(iVar2 + 4) + 0xc) == 0) { this = *(basic_ostream_> **)(param_1 + *(int *)(iVar2 + 4) + 0x3c); if ((this == (basic_ostream_> *)0x0) || (this == param_1)) { bVar3 = true; } else { std::basic_ostream_>::flush(this); bVar3 = *(int *)(param_1 + *(int *)(*(int *)param_1 + 4) + 0xc) == 0; } } else { bVar3 = false; } *(bool *)(in_ECX + 1) = bVar3; ExceptionList = local_10; return; } //@@ 00414730 xml_memory_pool::clear /* DB: rapidxml memory_pool::clear: walks block list until this+0xc (static pool), frees via this[0x4004] free_func or free(), then resets begin/ptr/end (end = this+0x4003*4, 64KB static pool); called by every *_xml loader prototype: db/protos.zhl */ void __thiscall xml_memory_pool::clear(void *this) { int iVar1; int iVar2; uint uVar3; int iVar4; qword qVar5; void **ppvVar6; uint uVar7; qword *pqVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = (int)this + 0xc; ppvVar6 = &local_10; iVar4 = *(int *)this; local_10 = ExceptionList; while (ExceptionList = ppvVar6, iVar4 != iVar1) { iVar2 = *(int *)(iVar4 + (-iVar4 & 3U)); if (*(code **)((int)this + 0x10010) == (code *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } if (iVar4 != 0) { uVar3 = *(uint *)(iVar4 + -4); qVar5 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar3; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar5 < uVar3); free((void *)(iVar4 + -4)); } local_8 = 0xffffffff; } else { (**(code **)((int)this + 0x10010))(iVar4,uVar7); } *(int *)this = iVar2; ppvVar6 = ExceptionList; iVar4 = iVar2; } *(int *)this = iVar1; *(uint *)((int)this + 4) = (-iVar1 & 3U) + iVar1; *(int *)((int)this + 8) = (int)this + 0x1000c; ExceptionList = local_10; return; } //@@ 004147f0 std::vector::_Tidy /* DB: destroys each 0x18 std::string in [begin,end), operator_delete storage, zeroes begin/end/cap */ void std::vector::_Tidy(void) { uint size; int *in_ECX; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { string::_Tidy_deallocate(this); this = this + 0x18; } while (this != pcVar1); this = (char *)*in_ECX; } size = ((in_ECX[2] - (int)this) / 0x18) * 0x18; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00414870 std::string::append_n /* DB: append n chars (memset) prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall std::string::append_n(char *this,uint count,byte ch) { uint uVar1; size_t _Size; void *_Src; uint uVar2; void *_Dst; uint uVar3; void *pvVar4; uVar1 = *(uint *)(this + 0x14); _Size = *(size_t *)(this + 0x10); if (count <= uVar1 - _Size) { *(size_t *)(this + 0x10) = _Size + count; if (0xf < uVar1) { this = *(char **)this; } memset(this + _Size,(int)(char)ch,count); (this + _Size)[count] = '\0'; return; } if (0x7fffffff - _Size < count) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar3 = _Size + count | 0xf; if (uVar3 < 0x80000000) { if (0x7fffffff - (uVar1 >> 1) < uVar1) { uVar3 = 0x7fffffff; } else { uVar2 = (uVar1 >> 1) + uVar1; if (uVar3 < uVar2) { uVar3 = uVar2; } } } else { uVar3 = 0x7fffffff; } _Dst = _Allocate(uVar3 + 1); *(size_t *)(this + 0x10) = _Size + count; *(uint *)(this + 0x14) = uVar3; pvVar4 = (void *)((int)_Dst + _Size); if (uVar1 < 0x10) { memcpy(_Dst,this,_Size); memset(pvVar4,(int)(char)ch,count); *(undefined1 *)((int)pvVar4 + count) = 0; *(void **)this = _Dst; return; } _Src = *(void **)this; memcpy(_Dst,_Src,_Size); memset(pvVar4,(int)(char)ch,count); uVar3 = uVar1 + 1; *(undefined1 *)((int)pvVar4 + count) = 0; pvVar4 = _Src; if (0xfff < uVar3) { pvVar4 = *(void **)((int)_Src + -4); uVar3 = uVar1 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar3); *(void **)this = _Dst; return; } //@@ 004149d0 FID_conflict:_Tidy /* Library Function - Multiple Matches With Different Base Names public: __thiscall std::priority_queue >,struct std::greater >::~priority_queue >,struct std::greater >(void) public: __thiscall std::vector >::~vector >(void) public: __thiscall std::vector >::~vector >(void) public: __thiscall std::vector >::~vector >(void) 7 names - too many to list Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Tidy(void *this) { void *pvVar1; void *ptr; uint size; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = *(int *)((int)this + 8) - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } return; } //@@ 00414a30 FUN_00414a30 void FUN_00414a30(void) { int *piVar1; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = *(int **)(*(int *)(*(int *)*in_ECX + 4) + 0x38 + *in_ECX); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 8))(__security_cookie ^ (int)register0x00000010 - 4U); } ExceptionList = local_10; return; } //@@ 00414a80 std::_Tree_unchecked_const_iterator_>,std::_Iterator_base0>::operator++ /* Library Function - Single Match public: class std::_Tree_unchecked_const_iterator >,struct std::_Iterator_base0> & __thiscall std::_Tree_unchecked_const_iterator >,struct std::_Iterator_base0>::operator++(void) Library: Visual Studio 2019 Release */ _Tree_unchecked_const_iterator_>,struct_std::_Iterator_base0> * __thiscall std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++(_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *this) { char cVar1; int iVar2; int *piVar3; int *piVar4; int iVar5; iVar2 = *(int *)this; piVar3 = *(int **)(iVar2 + 8); if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar3 = piVar4; piVar4 = (int *)*piVar4; } *(int **)this = piVar3; return (_Tree_unchecked_const_iterator_>,struct_std::_Iterator_base0> *)this; } cVar1 = *(char *)(*(int *)(iVar2 + 4) + 0xd); iVar5 = *(int *)(iVar2 + 4); while ((cVar1 == '\0' && (iVar2 == *(int *)(iVar5 + 8)))) { *(int *)this = iVar5; cVar1 = *(char *)(*(int *)(iVar5 + 4) + 0xd); iVar2 = iVar5; iVar5 = *(int *)(iVar5 + 4); } *(int *)this = iVar5; return (_Tree_unchecked_const_iterator_>,struct_std::_Iterator_base0> *)this; } //@@ 00414ae0 FUN_00414ae0 void FUN_00414ae0(char *param_1,char *param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x18) { std::string::_Tidy_deallocate(param_1); } return; } //@@ 00414b10 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x18; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 00414b50 FUN_00414b50 void FUN_00414b50(void) { char cVar1; uint uVar2; bool bVar3; uint uVar4; int iVar5; int *in_ECX; char *pcVar6; uint uVar7; char *in_EDX; int iVar8; int iVar9; __int64 _Var10; undefined8 local_2c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af133d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pcVar6 = in_EDX; do { cVar1 = *pcVar6; pcVar6 = pcVar6 + 1; } while (cVar1 != '\0'); uVar7 = (int)pcVar6 - (int)(in_EDX + 1); iVar9 = *(int *)(*(int *)(*in_ECX + 4) + 0x24 + (int)in_ECX); uVar2 = *(uint *)(*(int *)(*in_ECX + 4) + 0x20 + (int)in_ECX); if ((iVar9 < 0) || ((iVar9 < 1 && (((uVar2 == 0 || (iVar9 < 0)) || ((iVar9 < 1 && (uVar2 <= uVar7)))))))) { local_2c = 0; local_2c._4_4_ = 0; local_2c._0_4_ = (basic_ostream_> *)0x0; iVar8 = (int)(basic_ostream_> *)local_2c; iVar9 = local_2c._4_4_; } else { iVar8 = uVar2 - uVar7; iVar9 = iVar9 - (uint)(uVar2 < uVar7); } FUN_00414690(in_ECX); local_8 = 0; if (local_2c._4_1_ == '\0') { std::basic_ios_>::setstate ((basic_ios_> *)(*(int *)(*in_ECX + 4) + (int)in_ECX),4, false); local_8 = 3; bVar3 = std::uncaught_exception(); if (!bVar3) { std::basic_ostream_>::_Osfx ((basic_ostream_> *)local_2c); } local_8 = CONCAT31(local_8._1_3_,4); if (*(int **)((basic_ostream_> *)local_2c + *(int *)(*(int *)(basic_ostream_> *)local_2c + 4) + 0x38) != (int *)0x0) { (**(code **)(**(int **)((basic_ostream_> *)local_2c + *(int *)(*(int *)(basic_ostream_> *) local_2c + 4) + 0x38) + 8))(); } ExceptionList = local_10; return; } local_8 = 1; iVar5 = *in_ECX; if ((*(uint *)(*(int *)(iVar5 + 4) + 0x14 + (int)in_ECX) & 0x1c0) != 0x40) { for (; (-1 < iVar9 && ((0 < iVar9 || (iVar8 != 0)))); iVar8 = iVar8 + -1) { iVar5 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(*in_ECX + 4) + 0x38 + (int)in_ECX), *(char *)(*(int *)(*in_ECX + 4) + 0x40 + (int)in_ECX)); if (iVar5 == -1) goto LAB_00414c94; iVar9 = iVar9 + -1 + (uint)(iVar8 != 0); } iVar5 = *in_ECX; } _Var10 = std::basic_streambuf_>::sputn (*(basic_streambuf_> **) (*(int *)(iVar5 + 4) + 0x38 + (int)in_ECX),in_EDX,(ulonglong)uVar4 << 0x20); if (((uint)_Var10 == uVar7) && ((int)((ulonglong)_Var10 >> 0x20) == 0)) { while ((-1 < iVar9 && (((0 < iVar9 || (iVar8 != 0)) && (iVar5 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(*in_ECX + 4) + 0x38 + (int)in_ECX), *(char *)(*(int *)(*in_ECX + 4) + 0x40 + (int)in_ECX)), iVar5 != -1) )))) { bVar3 = iVar8 != 0; iVar8 = iVar8 + -1; iVar9 = iVar9 + -1 + (uint)bVar3; } } LAB_00414c94: iVar9 = *(int *)(*in_ECX + 4); *(undefined4 *)(iVar9 + 0x20 + (int)in_ECX) = 0; *(undefined4 *)(iVar9 + 0x24 + (int)in_ECX) = 0; FUN_00414ccb(); return; } //@@ 00414cab Catch_All@00414cab undefined * Catch_All_00414cab(void) { int unaff_EBP; std::basic_ios_>::setstate ((basic_ios_> *) (*(int *)(**(int **)(unaff_EBP + -0x18) + 4) + (int)*(int **)(unaff_EBP + -0x18)),4, true); return &DAT_00414cc5; } //@@ 00414ccb FUN_00414ccb void FUN_00414ccb(void) { int *piVar1; bool bVar2; int in_EDX; int *unaff_EBX; int unaff_EBP; *(undefined4 *)(unaff_EBP + -4) = 0; std::basic_ios_>::setstate ((basic_ios_> *)(*(int *)(*unaff_EBX + 4) + (int)unaff_EBX), in_EDX,false); *(undefined4 *)(unaff_EBP + -4) = 3; bVar2 = std::uncaught_exception(); if (!bVar2) { std::basic_ostream_>::_Osfx (*(basic_ostream_> **)(unaff_EBP + -0x28)); } *(undefined1 *)(unaff_EBP + -4) = 4; piVar1 = *(int **)(*(int *)(**(int **)(unaff_EBP + -0x28) + 4) + 0x38 + (int)*(int **)(unaff_EBP + -0x28)); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 8))(); } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00414d30 FUN_00414d30 basic_ostream_> * FUN_00414d30(basic_ostream_> *param_1) { char cVar1; cVar1 = std::basic_ios_>::widen ((basic_ios_> *) (param_1 + *(int *)(*(int *)param_1 + 4)),'\n'); std::basic_ostream_>::put(param_1,cVar1); std::basic_ostream_>::flush(param_1); return param_1; } //@@ 00414d60 FUN_00414d60 void FUN_00414d60(undefined4 *param_1,void *param_2) { char cVar1; uint uVar2; void *ptr; void *in_ECX; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = param_2; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); ptr = std_tree_extract(in_ECX,param_2); local_8 = 0; if (*(int **)((int)ptr + 0x18) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)ptr + 0x18) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)ptr + 0x14); } } operator_delete(ptr,0x1c); *param_1 = local_14; ExceptionList = local_10; return; } //@@ 00414e00 InterpolateNullFrames /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/anm2 decompile labels (InterpolateNullFrames(ecx=buf,edx=&count,scratch)) */ void InterpolateNullFrames(void *param_1) { float fVar1; float fVar2; float fVar3; undefined8 uVar4; undefined1 uVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; uint uVar15; ColorMod *pCVar16; void *in_ECX; uint *in_EDX; uint uVar17; int iVar18; float fVar19; float *pfVar20; float *pfVar21; float fVar22; undefined1 auStack_124 [6]; undefined1 local_11e; undefined1 local_11d; float local_11c; uint local_118; uint local_114; float local_110; void *local_10c; float local_108; float local_104; float local_100; uint *local_fc; float local_f8; float local_f4; float local_f0; void *local_ec; undefined8 local_e8; float local_e0; float fStack_dc; float fStack_d8; float fStack_d4; float local_d0; float fStack_cc; float fStack_c8; float fStack_c4; ColorMod local_c0 [2]; ColorMod local_50; uint local_c; local_c = __security_cookie ^ (uint)auStack_124; uVar17 = 0; uVar15 = *in_EDX; local_10c = param_1; fVar19 = 0.0; local_118 = 0; local_11c = 0.0; local_114 = 0; local_fc = in_EDX; if (uVar15 != 0) { pfVar21 = (float *)((int)in_ECX + 0x58); local_ec = in_ECX; do { if ((local_114 == uVar15 - 1) || (*(char *)(pfVar21 + -4) == '\0')) { local_104 = pfVar21[-6]; fVar6 = pfVar21[-0x14]; fVar22 = pfVar21[-0x15]; uVar5 = *(undefined1 *)(pfVar21 + -0x13); fVar1 = pfVar21[-0x12]; fVar2 = pfVar21[-0x11]; fVar7 = pfVar21[-0x10]; fVar8 = pfVar21[-0xf]; fVar9 = pfVar21[-0xe]; fVar10 = pfVar21[-0xd]; local_11e = *(undefined1 *)(pfVar21 + -4); fVar11 = pfVar21[-0xc]; fVar12 = pfVar21[-0xb]; fVar13 = pfVar21[-10]; fVar14 = pfVar21[-9]; uVar4 = *(undefined8 *)(pfVar21 + -8); fVar3 = pfVar21[-5]; local_11c = (float)((int)fVar19 + (int)fVar6); pfVar20 = (float *)(uVar17 * 0x54 + (int)local_10c); *pfVar20 = pfVar21[-0x16]; pfVar20[1] = fVar22; pfVar20[2] = fVar6; *(undefined1 *)(pfVar20 + 3) = uVar5; pfVar20[4] = fVar1; pfVar20[5] = fVar2; if (pfVar20 + 6 != local_c0[0]._colorize + 2) { *(undefined8 *)(pfVar20 + 0xe) = uVar4; pfVar20[6] = fVar7; pfVar20[7] = fVar8; pfVar20[8] = fVar9; pfVar20[9] = fVar10; pfVar20[0x10] = local_104; pfVar20[10] = fVar11; pfVar20[0xb] = fVar12; pfVar20[0xc] = fVar13; pfVar20[0xd] = fVar14; } local_118 = uVar17 + 1; *(undefined1 *)(pfVar20 + 0x12) = local_11e; pfVar20[0x11] = fVar3; pfVar20[0x13] = fVar19; pfVar20[0x14] = local_11c; local_108 = fVar19; LAB_00415113: uVar17 = local_118; fVar19 = local_11c; } else { if (4999 < local_114 + 1) { KAGE_LogMessage(0x10,(byte *)"too many frames after interpolation\n"); uVar17 = local_118; } iVar18 = 0; local_110 = 0.0; local_f8 = 1.0 / (float)(int)pfVar21[-0x14]; if (0 < (int)pfVar21[-0x14]) { pfVar20 = (float *)((int)local_10c + uVar17 * 0x54 + 0x28); do { local_e0 = pfVar21[-0x10]; fStack_dc = pfVar21[-0xf]; fStack_d8 = pfVar21[-0xe]; fStack_d4 = pfVar21[-0xd]; local_11d = *(undefined1 *)(pfVar21 + -0x13); local_d0 = pfVar21[-0xc]; fStack_cc = pfVar21[-0xb]; fStack_c8 = pfVar21[-10]; fStack_c4 = pfVar21[-9]; local_100 = pfVar21[-6]; local_11e = *(undefined1 *)(pfVar21 + -4); local_e8 = *(undefined8 *)(pfVar21 + -8); local_f4 = (pfVar21[-1] - pfVar21[-0x16]) * local_110 + pfVar21[-0x16]; local_f0 = (*pfVar21 - pfVar21[-0x15]) * local_110 + pfVar21[-0x15]; local_108 = (pfVar21[3] - pfVar21[-0x12]) * local_110 + pfVar21[-0x12]; local_104 = (pfVar21[4] - pfVar21[-0x11]) * local_110 + pfVar21[-0x11]; pCVar16 = Color::Lerp(local_c0,(ColorMod *)(pfVar21 + -0x10),(ColorMod *)(pfVar21 + 5), local_110); if (&local_50 != pCVar16) { local_e0 = pCVar16->_tint[0]; fStack_dc = pCVar16->_tint[1]; fStack_d8 = pCVar16->_tint[2]; fStack_d4 = pCVar16->_tint[3]; local_d0 = pCVar16->_colorize[0]; fStack_cc = pCVar16->_colorize[1]; fStack_c8 = pCVar16->_colorize[2]; fStack_c4 = pCVar16->_colorize[3]; local_e8 = *(undefined8 *)pCVar16->_offset; local_100 = pCVar16->_offset[2]; } fVar22 = LerpAngleDeg(pfVar21[-5],pfVar21[0x10],local_110); local_110 = local_f8 + local_110; fVar19 = (float)((int)local_11c + 1); pfVar20[-10] = local_f4; pfVar20[-9] = local_f0; *(undefined1 *)(pfVar20 + -7) = local_11d; pfVar20[-8] = 1.4013e-45; pfVar20[-6] = local_108; pfVar20[-5] = local_104; if ((ColorMod *)(pfVar20 + -4) != &local_50) { pfVar20[-4] = local_e0; pfVar20[-3] = fStack_dc; pfVar20[-2] = fStack_d8; pfVar20[-1] = fStack_d4; *pfVar20 = local_d0; pfVar20[1] = fStack_cc; pfVar20[2] = fStack_c8; pfVar20[3] = fStack_c4; *(undefined8 *)(pfVar20 + 4) = local_e8; pfVar20[6] = local_100; } iVar18 = iVar18 + 1; pfVar20[9] = local_11c; pfVar20[7] = fVar22; local_118 = local_118 + 1; *(undefined1 *)(pfVar20 + 8) = local_11e; pfVar20[10] = fVar19; pfVar20 = pfVar20 + 0x15; local_11c = fVar19; } while (iVar18 < (int)pfVar21[-0x14]); goto LAB_00415113; } } local_114 = local_114 + 1; pfVar21 = pfVar21 + 0x15; uVar15 = *local_fc; } while (local_114 < uVar15); in_ECX = local_ec; } memcpy(in_ECX,local_10c,uVar17 * 0x54); *local_fc = local_118; return; } //@@ 00415170 InterpolateLayerFrames /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/anm2 decompile labels (InterpolateLayerFrames(ecx=buf,edx=&count,scratch)) */ void InterpolateLayerFrames(void *param_1) { float fVar1; float fVar2; undefined1 uVar3; float fVar4; float fVar5; float fVar6; float fVar7; uint uVar8; ColorMod *pCVar9; void *in_ECX; uint *in_EDX; uint uVar10; int iVar11; float fVar12; float *pfVar13; float *pfVar14; float fVar15; undefined1 auStack_19c [6]; undefined1 local_196; undefined1 local_195; float local_194; uint local_190; uint local_18c; float local_188; void *local_184; float local_180; float local_17c; float local_178; float local_174; float local_170; float local_16c; float local_168; uint *local_164; undefined8 local_160; float local_158; float local_154; float local_150; float local_14c; float local_148; void *local_144; float local_140; float fStack_13c; float fStack_138; float fStack_134; float local_130; float fStack_12c; float fStack_128; float fStack_124; ColorMod local_11c [2]; ColorMod local_c0 [2]; float local_50 [17]; uint local_c; local_c = __security_cookie ^ (uint)auStack_19c; uVar10 = 0; uVar8 = *in_EDX; local_184 = param_1; fVar12 = 0.0; local_190 = 0; local_194 = 0.0; local_18c = 0; local_164 = in_EDX; if (uVar8 != 0) { pfVar14 = (float *)((int)in_ECX + 0xc); local_144 = in_ECX; do { if ((local_18c == uVar8 - 1) || (*(char *)(pfVar14 + 0x15) == '\0')) { local_16c = pfVar14[3]; local_178 = pfVar14[0x13]; fVar5 = pfVar14[-2]; fVar6 = pfVar14[-1]; fVar7 = *pfVar14; fVar4 = pfVar14[7]; uVar3 = *(undefined1 *)(pfVar14 + 8); fVar15 = pfVar14[1]; fVar1 = pfVar14[2]; fVar2 = pfVar14[4]; local_170 = pfVar14[5]; local_174 = pfVar14[6]; local_130 = pfVar14[9]; fStack_12c = pfVar14[10]; fStack_128 = pfVar14[0xb]; fStack_124 = pfVar14[0xc]; local_196 = *(undefined1 *)(pfVar14 + 0x15); local_140 = pfVar14[0xd]; fStack_13c = pfVar14[0xe]; fStack_138 = pfVar14[0xf]; fStack_134 = pfVar14[0x10]; local_194 = (float)((int)fVar12 + (int)fVar4); local_160 = *(undefined8 *)(pfVar14 + 0x11); pfVar13 = (float *)(uVar10 * 0x6c + (int)local_184); local_17c = pfVar14[0x14]; *pfVar13 = pfVar14[-3]; pfVar13[1] = fVar5; pfVar13[2] = fVar6; pfVar13[3] = fVar7; pfVar13[4] = fVar15; pfVar13[5] = fVar1; pfVar13[6] = local_16c; pfVar13[7] = fVar2; pfVar13[8] = local_170; pfVar13[9] = local_174; pfVar13[10] = fVar4; *(undefined1 *)(pfVar13 + 0xb) = uVar3; if (pfVar13 + 0xc != local_50) { pfVar13[0xc] = local_130; pfVar13[0xd] = fStack_12c; pfVar13[0xe] = fStack_128; pfVar13[0xf] = fStack_124; pfVar13[0x10] = local_140; pfVar13[0x11] = fStack_13c; pfVar13[0x12] = fStack_138; pfVar13[0x13] = fStack_134; *(undefined8 *)(pfVar13 + 0x14) = local_160; pfVar13[0x16] = local_178; } local_190 = uVar10 + 1; *(undefined1 *)(pfVar13 + 0x18) = local_196; pfVar13[0x17] = local_17c; pfVar13[0x19] = fVar12; pfVar13[0x1a] = local_194; local_180 = fVar12; LAB_0041557d: uVar10 = local_190; fVar12 = local_194; } else { if (4999 < local_18c + 1) { KAGE_LogMessage(0x10,(byte *)"too many frames after interpolation\n"); uVar10 = local_190; } iVar11 = 0; local_188 = 0.0; local_158 = 1.0 / (float)(int)pfVar14[7]; if (0 < (int)pfVar14[7]) { pfVar13 = (float *)((int)local_184 + uVar10 * 0x6c + 0x14); do { local_154 = pfVar14[-3]; local_150 = pfVar14[-2]; local_14c = pfVar14[-1]; local_148 = *pfVar14; local_170 = pfVar14[5]; local_16c = pfVar14[6]; local_140 = ((ColorMod *)(pfVar14 + 9))->_tint[0]; fStack_13c = pfVar14[10]; fStack_138 = pfVar14[0xb]; fStack_134 = pfVar14[0xc]; local_195 = *(undefined1 *)(pfVar14 + 8); local_168 = pfVar14[0x13]; local_130 = pfVar14[0xd]; fStack_12c = pfVar14[0xe]; fStack_128 = pfVar14[0xf]; fStack_124 = pfVar14[0x10]; local_180 = (pfVar14[0x1c] - pfVar14[1]) * local_188 + pfVar14[1]; local_196 = *(undefined1 *)(pfVar14 + 0x15); local_160 = *(undefined8 *)(pfVar14 + 0x11); local_17c = (pfVar14[0x1d] - pfVar14[2]) * local_188 + pfVar14[2]; local_178 = (pfVar14[0x1e] - pfVar14[3]) * local_188 + pfVar14[3]; local_174 = (pfVar14[0x1f] - pfVar14[4]) * local_188 + pfVar14[4]; pCVar9 = Color::Lerp(local_11c,(ColorMod *)(pfVar14 + 9),(ColorMod *)(pfVar14 + 0x24), local_188); if (local_c0 != pCVar9) { local_140 = pCVar9->_tint[0]; fStack_13c = pCVar9->_tint[1]; fStack_138 = pCVar9->_tint[2]; fStack_134 = pCVar9->_tint[3]; local_130 = pCVar9->_colorize[0]; fStack_12c = pCVar9->_colorize[1]; fStack_128 = pCVar9->_colorize[2]; fStack_124 = pCVar9->_colorize[3]; local_160 = *(undefined8 *)pCVar9->_offset; local_168 = pCVar9->_offset[2]; } fVar15 = LerpAngleDeg(pfVar14[0x14],pfVar14[0x2f],local_188); pfVar13[-5] = local_154; fVar12 = (float)((int)local_194 + 1); pfVar13[-4] = local_150; pfVar13[-3] = local_14c; local_188 = local_158 + local_188; pfVar13[-2] = local_148; pfVar13[-1] = local_180; *pfVar13 = local_17c; pfVar13[1] = local_178; pfVar13[2] = local_174; pfVar13[3] = local_170; pfVar13[4] = local_16c; *(undefined1 *)(pfVar13 + 6) = local_195; pfVar13[5] = 1.4013e-45; if ((ColorMod *)(pfVar13 + 7) != local_c0) { ((ColorMod *)(pfVar13 + 7))->_tint[0] = local_140; pfVar13[8] = fStack_13c; pfVar13[9] = fStack_138; pfVar13[10] = fStack_134; pfVar13[0xb] = local_130; pfVar13[0xc] = fStack_12c; pfVar13[0xd] = fStack_128; pfVar13[0xe] = fStack_124; *(undefined8 *)(pfVar13 + 0xf) = local_160; pfVar13[0x11] = local_168; } iVar11 = iVar11 + 1; pfVar13[0x14] = local_194; pfVar13[0x12] = fVar15; local_190 = local_190 + 1; *(undefined1 *)(pfVar13 + 0x13) = local_196; pfVar13[0x15] = fVar12; pfVar13 = pfVar13 + 0x1b; local_194 = fVar12; } while (iVar11 < (int)pfVar14[7]); goto LAB_0041557d; } } local_18c = local_18c + 1; pfVar14 = pfVar14 + 0x1b; uVar8 = *local_164; } while (local_18c < uVar8); in_ECX = local_144; } memcpy(in_ECX,local_184,uVar10 * 0x6c); *local_164 = local_190; return; } //@@ 004155d0 rapidxml::xml_document::parse /* DB: resets first/last node+attr lists, skips UTF-8 BOM, loops whitespace table, "expected <" error, parse_node per child, links into ECX doc's node list; called by every *.xml loader (AnmCache::ParseFile, ItemConfig::Load, EntityConfig::LoadEntities) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall rapidxml::xml_document::parse(void *this,byte *text) { byte *pbVar1; char cVar2; int iVar3; for (iVar3 = *(int *)((int)this + 0x18); iVar3 != 0; iVar3 = *(int *)(iVar3 + 0x2c)) { *(undefined4 *)(iVar3 + 0x10) = 0; } iVar3 = *(int *)((int)this + 0x20); *(undefined4 *)((int)this + 0x18) = 0; for (; iVar3 != 0; iVar3 = *(int *)(iVar3 + 0x18)) { *(undefined4 *)(iVar3 + 0x10) = 0; } *(undefined4 *)((int)this + 0x20) = 0; if (((*text == 0xef) && (text[1] == 0xbb)) && (text[2] == 0xbf)) { text = text + 3; } while( true ) { cVar2 = (&DAT_00b1b060)[*text]; while (cVar2 != '\0') { pbVar1 = text + 1; text = text + 1; cVar2 = (&DAT_00b1b060)[*pbVar1]; } if (*text == 0) break; if (*text != 0x3c) { g_xmlParseError = (byte *)s_expected_<_00b1b66c; return; } text = text + 1; iVar3 = parse_node(&text); if (iVar3 != 0) { if (*(int *)((int)this + 0x18) == 0) { *(undefined4 *)(iVar3 + 0x28) = 0; *(int *)((int)this + 0x18) = iVar3; } else { *(undefined4 *)(iVar3 + 0x28) = *(undefined4 *)((int)this + 0x1c); *(int *)(*(int *)((int)this + 0x1c) + 0x2c) = iVar3; } *(int *)((int)this + 0x1c) = iVar3; *(void **)(iVar3 + 0x10) = this; *(undefined4 *)(iVar3 + 0x2c) = 0; } } return; } //@@ 004156c0 FUN_004156c0 ANM2 ** FUN_004156c0(ANM2 **param_1,undefined4 *param_2) { uint uVar1; ANM2 **ppAVar2; int iVar3; ANM2 **_Dst; ANM2 *ptr; uint uVar4; uint uVar5; int iVar6; iVar3 = (int)DAT_00c78da8 - (int)g_staticSprites >> 2; iVar6 = (int)param_1 - (int)g_staticSprites; if (iVar3 == 0x3fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar4 = (int)DAT_00c78dac - (int)g_staticSprites >> 2; if (0x3fffffff - (uVar4 >> 1) < uVar4) { uVar5 = 0x3fffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; uVar5 = uVar1; if (uVar1 <= uVar4) { uVar5 = uVar4; } if (0x3fffffff < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar5 * 4); ppAVar2 = _Dst + (iVar6 >> 2); *ppAVar2 = (ANM2 *)*param_2; if (param_1 == DAT_00c78da8) { memmove(_Dst,g_staticSprites,(int)DAT_00c78da8 - (int)g_staticSprites); } else { memmove(_Dst,g_staticSprites,(int)param_1 - (int)g_staticSprites); memmove(ppAVar2 + 1,param_1,(int)DAT_00c78da8 - (int)param_1); } if (g_staticSprites != (ANM2 **)0x0) { uVar4 = (int)DAT_00c78dac - (int)g_staticSprites & 0xfffffffc; ptr = (ANM2 *)g_staticSprites; if (0xfff < uVar4) { ptr = g_staticSprites[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)g_staticSprites + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } g_staticSprites = _Dst; DAT_00c78da8 = _Dst + uVar1; DAT_00c78dac = _Dst + uVar5; return ppAVar2; } //@@ 00415800 std::map::_Erase_tree /* DB: recursive tree erase (right subtree first) of 0x1c-byte nodes, releasing the KAGE image smart pointer at +0x14/+0x18 through g_imageReleaseFn before deleting; used by AnmCache::~AnmCache, PlayerHUD::Update and other sprite caches */ void std::map::_Erase_tree(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { _Erase_tree(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[6] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[6] + 0xc))(uVar4), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(param_2 + 5); } local_8 = 0xffffffff; operator_delete(param_2,0x1c); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 004158b0 std::map::_Try_emplace /* DB: ? g_anmCacheMap: FUN_00416490 lower bound on uint key, operator_new(0x54) node; from FUN_00414500 */ void std::map::_Try_emplace(int *param_1,uint *param_2) { char cVar1; int *piVar2; void *pvVar3; uint uVar4; int *piVar5; int *piVar6; int *piVar7; undefined4 *local_24; int local_20; int local_1c; void **local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af13ad; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00416490(&local_24,param_2); pvVar3 = g_anmCacheMap; if ((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (DAT_00c78ee4 == 0x30c30c3) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } local_18 = &g_anmCacheMap; local_8 = 0; local_14 = 0; piVar5 = operator_new(0x54); piVar5[4] = *param_2; *(undefined1 *)(piVar5 + 5) = 0; piVar5[6] = 0; piVar5[7] = 0; piVar5[8] = 0; piVar5[9] = 0; piVar5[10] = 0; piVar5[0xb] = 0; piVar5[0xc] = 0; piVar5[0xd] = 0; piVar5[0xe] = 0; piVar5[0x12] = 0; piVar5[0x13] = 0xf; piVar5[0x14] = 0; *piVar5 = (int)pvVar3; piVar5[1] = (int)pvVar3; piVar5[2] = (int)pvVar3; *(undefined2 *)(piVar5 + 3) = 0; pvVar3 = g_anmCacheMap; DAT_00c78ee4 = DAT_00c78ee4 + 1; piVar5[1] = (int)local_24; if (local_24 == pvVar3) { *(int **)pvVar3 = piVar5; *(int **)((int)pvVar3 + 4) = piVar5; *(int **)((int)pvVar3 + 8) = piVar5; *(undefined1 *)(piVar5 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = piVar5; if (local_24 == *(undefined4 **)((int)pvVar3 + 8)) { *(int **)((int)pvVar3 + 8) = piVar5; } } else { *local_24 = piVar5; if (local_24 == *(undefined4 **)pvVar3) { *(int **)pvVar3 = piVar5; } } cVar1 = *(char *)(piVar5[1] + 0xc); piVar7 = piVar5; while (cVar1 == '\0') { piVar2 = (int *)piVar7[1]; piVar6 = *(int **)piVar2[1]; if (piVar2 == piVar6) { piVar6 = (int *)((undefined4 *)piVar2[1])[2]; if ((char)piVar6[3] == '\0') { LAB_00415a55: *(undefined1 *)(piVar2 + 3) = 1; *(undefined1 *)(piVar6 + 3) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; piVar7 = *(int **)(piVar7[1] + 4); } else { if (piVar7 == (int *)piVar2[2]) { FUN_00415fe0(piVar2); piVar7 = piVar2; } *(undefined1 *)(piVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar7[1] + 4)); } } else { if ((char)piVar6[3] == '\0') goto LAB_00415a55; if (piVar7 == (int *)*piVar2) { FUN_00415f80(piVar2); piVar7 = piVar2; } *(undefined1 *)(piVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar7[1] + 4)); } cVar1 = *(char *)(piVar7[1] + 0xc); } *(undefined1 *)(*(int *)((int)pvVar3 + 4) + 0xc) = 1; } *param_1 = (int)piVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00415ae0 FUN_00415ae0 void FUN_00415ae0(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00415ae0(param_1,param_2[2]); piVar2 = (int *)*param_2; std::string::_Tidy_deallocate((char *)(param_2 + 0xe)); operator_delete(param_2,0x54); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00415b30 FUN_00415b30 void FUN_00415b30(void) { int iVar1; char cVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *(int *)(in_ECX + 4); if (iVar1 != 0) { local_8 = 0; if (*(int **)(iVar1 + 0x18) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar1 + 0x18) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(iVar1 + 0x14); } } } if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x1c); } ExceptionList = local_10; return; } //@@ 00415bb0 FUN_00415bb0 void FUN_00415bb0(void) { int *piVar1; uint size; undefined4 *in_ECX; char *this; char *pcVar2; piVar1 = (int *)*in_ECX; if (piVar1 == (int *)0x0) { return; } this = (char *)*piVar1; if (this != (char *)0x0) { pcVar2 = (char *)piVar1[1]; if (this != pcVar2) { do { std::string::_Tidy_deallocate(this); this = this + 0x18; } while (this != pcVar2); this = (char *)*piVar1; } size = ((piVar1[2] - (int)this) / 0x18) * 0x18; pcVar2 = this; if (0xfff < size) { pcVar2 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,size); *piVar1 = 0; piVar1[1] = 0; piVar1[2] = 0; } return; } //@@ 00415bc0 std::_Xlen /* DB: throws "vector too long" */ void std::_Xlen(void) { /* WARNING: Subroutine does not return */ std::_Xlength_error("vector too long"); } //@@ 00415bd0 std::_Tree::_Insert_node /* DB: red-black tree insert: ++size, links new node under parent param_1 (left/right by param_2), updates head min/max, recolour/rotate loop (FUN_00415f80/00415fe0 rotations); used by std::set::insert, std::map::operator[] (00730ed0) prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall std::_Tree::_Insert_node(void *this,void *parent,int childSide,void *newNode) { char cVar1; int *piVar2; int *piVar3; int *piVar4; int *piVar5; piVar2 = *(int **)this; *(int *)((int)this + 4) = *(int *)((int)this + 4) + 1; *(void **)((int)newNode + 4) = parent; if (parent == piVar2) { *piVar2 = (int)newNode; piVar2[1] = (int)newNode; piVar2[2] = (int)newNode; *(undefined1 *)((int)newNode + 0xc) = 1; return newNode; } if (childSide == 0) { *(void **)((int)parent + 8) = newNode; if (parent == (void *)piVar2[2]) { piVar2[2] = (int)newNode; } } else { *(void **)parent = newNode; if (parent == (void *)*piVar2) { *piVar2 = (int)newNode; } } cVar1 = *(char *)(*(int *)((int)newNode + 4) + 0xc); piVar5 = newNode; do { if (cVar1 != '\0') { *(undefined1 *)(piVar2[1] + 0xc) = 1; return newNode; } piVar3 = (int *)piVar5[1]; piVar4 = *(int **)piVar3[1]; if (piVar3 == piVar4) { piVar4 = (int *)((undefined4 *)piVar3[1])[2]; if ((char)piVar4[3] == '\0') { LAB_00415c76: *(undefined1 *)(piVar3 + 3) = 1; *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(*(int *)(piVar5[1] + 4) + 0xc) = 0; piVar5 = *(int **)(piVar5[1] + 4); } else { if (piVar5 == (int *)piVar3[2]) { FUN_00415fe0(piVar3); piVar5 = piVar3; } *(undefined1 *)(piVar5[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar5[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar5[1] + 4)); } } else { if ((char)piVar4[3] == '\0') goto LAB_00415c76; if (piVar5 == (int *)*piVar3) { FUN_00415f80(piVar3); piVar5 = piVar3; } *(undefined1 *)(piVar5[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar5[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar5[1] + 4)); } cVar1 = *(char *)(piVar5[1] + 0xc); } while( true ); } //@@ 00415ce0 FUN_00415ce0 void FUN_00415ce0(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x1c); } return; } //@@ 00415d00 FUN_00415d00 void FUN_00415d00(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x54); } return; } //@@ 00415d20 std_tree_extract /* DB: std::_Tree::_Extract: advances iterator, unlinks the node (+0xd isnil) and runs the red-black erase fixup, returns the node; used by std::multiset::erase, TextureCache::Purge prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std_tree_extract(void *this,void *node) { char cVar1; int *piVar2; void *pvVar3; int *piVar4; int *piVar5; int *piVar6; int *piVar7; pvVar3 = node; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&node); piVar6 = *(int **)pvVar3; piVar7 = *(int **)((int)pvVar3 + 8); if (*(char *)((int)piVar6 + 0xd) == '\0') { if (*(char *)((int)*(int **)((int)pvVar3 + 8) + 0xd) == '\0') { piVar7 = *(int **)((int)node + 8); if (node != pvVar3) { piVar6[1] = (int)node; *(undefined4 *)node = *(undefined4 *)pvVar3; if (node == *(void **)((int)pvVar3 + 8)) { piVar6 = node; } else { piVar6 = *(int **)((int)node + 4); if (*(char *)((int)piVar7 + 0xd) == '\0') { piVar7[1] = (int)piVar6; } *piVar6 = (int)piVar7; *(undefined4 *)((int)node + 8) = *(undefined4 *)((int)pvVar3 + 8); *(void **)(*(int *)((int)pvVar3 + 8) + 4) = node; } if (*(void **)(*(int *)this + 4) == pvVar3) { *(void **)(*(int *)this + 4) = node; } else { piVar5 = *(int **)((int)pvVar3 + 4); if ((void *)*piVar5 == pvVar3) { *piVar5 = (int)node; } else { piVar5[2] = (int)node; } } *(undefined4 *)((int)node + 4) = *(undefined4 *)((int)pvVar3 + 4); cVar1 = *(char *)((int)node + 0xc); *(undefined1 *)((int)node + 0xc) = *(undefined1 *)((int)pvVar3 + 0xc); *(char *)((int)pvVar3 + 0xc) = cVar1; goto LAB_00415e41; } } else { piVar7 = piVar6; } } piVar6 = *(int **)((int)pvVar3 + 4); if (*(char *)((int)piVar7 + 0xd) == '\0') { piVar7[1] = (int)piVar6; } if (*(void **)(*(int *)this + 4) == pvVar3) { *(int **)(*(int *)this + 4) = piVar7; } else if ((void *)*piVar6 == pvVar3) { *piVar6 = (int)piVar7; } else { piVar6[2] = (int)piVar7; } if ((void *)**(int **)this == pvVar3) { if (*(char *)((int)piVar7 + 0xd) == '\0') { piVar5 = piVar7; piVar4 = (int *)*piVar7; if (*(char *)(*piVar7 + 0xd) == '\0') { do { piVar5 = piVar4; piVar4 = (int *)*piVar5; } while (*(char *)(*piVar5 + 0xd) == '\0'); } } else { piVar5 = piVar6; } **(undefined4 **)this = piVar5; } if (*(void **)(*(int *)this + 8) == pvVar3) { if (*(char *)((int)piVar7 + 0xd) != '\0') { *(int **)(*(int *)this + 8) = piVar6; cVar1 = *(char *)((int)pvVar3 + 0xc); goto LAB_00415e41; } cVar1 = *(char *)(piVar7[2] + 0xd); piVar5 = (int *)piVar7[2]; piVar4 = piVar7; while (piVar2 = piVar5, cVar1 == '\0') { piVar5 = (int *)piVar2[2]; cVar1 = *(char *)((int)piVar5 + 0xd); piVar4 = piVar2; } *(int **)(*(int *)this + 8) = piVar4; } cVar1 = *(char *)((int)pvVar3 + 0xc); LAB_00415e41: if (cVar1 == '\x01') { if (piVar7 != *(int **)(*(int *)this + 4)) { do { piVar5 = piVar6; if ((char)piVar7[3] != '\x01') break; piVar6 = (int *)*piVar5; if (piVar7 == piVar6) { piVar6 = (int *)piVar5[2]; if ((char)piVar6[3] == '\0') { *(undefined1 *)(piVar6 + 3) = 1; *(undefined1 *)(piVar5 + 3) = 0; FUN_00415fe0(piVar5); piVar6 = (int *)piVar5[2]; } if (*(char *)((int)piVar6 + 0xd) == '\0') { if ((*(char *)(*piVar6 + 0xc) == '\x01') && (*(char *)(piVar6[2] + 0xc) == '\x01')) goto LAB_00415f0e; if (*(char *)(piVar6[2] + 0xc) == '\x01') { *(undefined1 *)(*piVar6 + 0xc) = 1; *(undefined1 *)(piVar6 + 3) = 0; FUN_00415f80(piVar6); piVar6 = (int *)piVar5[2]; } *(char *)(piVar6 + 3) = (char)piVar5[3]; *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar6[2] + 0xc) = 1; FUN_00415fe0(piVar5); break; } } else { if ((char)piVar6[3] == '\0') { *(undefined1 *)(piVar6 + 3) = 1; *(undefined1 *)(piVar5 + 3) = 0; FUN_00415f80(piVar5); piVar6 = (int *)*piVar5; } if (*(char *)((int)piVar6 + 0xd) == '\0') { if ((*(char *)(piVar6[2] + 0xc) != '\x01') || (*(char *)(*piVar6 + 0xc) != '\x01')) { if (*(char *)(*piVar6 + 0xc) == '\x01') { *(undefined1 *)(piVar6[2] + 0xc) = 1; *(undefined1 *)(piVar6 + 3) = 0; FUN_00415fe0(piVar6); piVar6 = (int *)*piVar5; } *(char *)(piVar6 + 3) = (char)piVar5[3]; *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(*piVar6 + 0xc) = 1; FUN_00415f80(piVar5); break; } LAB_00415f0e: *(undefined1 *)(piVar6 + 3) = 0; } } piVar6 = (int *)piVar5[1]; piVar7 = piVar5; } while (piVar5 != *(int **)(*(int *)this + 4)); } *(undefined1 *)(piVar7 + 3) = 1; } if (*(int *)((int)this + 4) != 0) { *(int *)((int)this + 4) = *(int *)((int)this + 4) + -1; } return pvVar3; } //@@ 00415f80 FUN_00415f80 void FUN_00415f80(int *param_1) { int iVar1; int *piVar2; int *in_ECX; iVar1 = *param_1; *param_1 = *(int *)(iVar1 + 8); if (*(char *)(*(int *)(iVar1 + 8) + 0xd) == '\0') { *(int **)(*(int *)(iVar1 + 8) + 4) = param_1; } *(int *)(iVar1 + 4) = param_1[1]; if (param_1 == *(int **)(*in_ECX + 4)) { *(int *)(*in_ECX + 4) = iVar1; *(int **)(iVar1 + 8) = param_1; param_1[1] = iVar1; return; } piVar2 = (int *)param_1[1]; if (param_1 == (int *)piVar2[2]) { piVar2[2] = iVar1; *(int **)(iVar1 + 8) = param_1; param_1[1] = iVar1; return; } *piVar2 = iVar1; *(int **)(iVar1 + 8) = param_1; param_1[1] = iVar1; return; } //@@ 00415fe0 FUN_00415fe0 void FUN_00415fe0(int param_1) { int *piVar1; int *piVar2; int *in_ECX; piVar1 = *(int **)(param_1 + 8); *(int *)(param_1 + 8) = *piVar1; if (*(char *)(*piVar1 + 0xd) == '\0') { *(int *)(*piVar1 + 4) = param_1; } piVar1[1] = *(int *)(param_1 + 4); if (param_1 == *(int *)(*in_ECX + 4)) { *(int **)(*in_ECX + 4) = piVar1; *piVar1 = param_1; *(int **)(param_1 + 4) = piVar1; return; } piVar2 = *(int **)(param_1 + 4); if (param_1 == *piVar2) { *piVar2 = (int)piVar1; *piVar1 = param_1; *(int **)(param_1 + 4) = piVar1; return; } piVar2[2] = (int)piVar1; *piVar1 = param_1; *(int **)(param_1 + 4) = piVar1; return; } //@@ 00416040 rapidxml::xml_document::parse_node /* DB: rapidxml: dispatches on '?' (xml declaration / PI), '!' (comment, DOCTYPE, CDATA) else element; "expected element name", "expected >", "unexpected end of data"; called from xml_document::parse and parse_node_contents (00416770) */ int * rapidxml::xml_document::parse_node(int *param_1) { byte *pbVar1; int *piVar2; char *pcVar3; char *pcVar4; byte *pbVar5; byte *pbVar6; char cVar7; int iVar8; pcVar3 = (char *)*param_1; if (*pcVar3 != '!') { if (*pcVar3 == '?') { pcVar4 = pcVar3 + 1; *param_1 = (int)pcVar4; cVar7 = *pcVar4; if ((((cVar7 == 'x') || (cVar7 == 'X')) && ((pcVar3[2] == 'm' || (pcVar3[2] == 'M')))) && (((pcVar3[3] == 'l' || (pcVar3[3] == 'L')) && ((&DAT_00b1b060)[(byte)pcVar3[4]] != '\0')))) { pcVar4 = pcVar3 + 5; while( true ) { *param_1 = (int)pcVar4; if ((*pcVar4 == '?') && (pcVar4[1] == '>')) break; pbVar6 = (byte *)"unexpected end of data"; if (*pcVar4 != '\0') { pbVar6 = g_xmlParseError; } pcVar4 = pcVar4 + 1; g_xmlParseError = pbVar6; } } else { while ((cVar7 != '?' || (pcVar4[1] != '>'))) { pbVar6 = (byte *)"unexpected end of data"; if (cVar7 != '\0') { pbVar6 = g_xmlParseError; } pcVar4 = pcVar4 + 1; *param_1 = (int)pcVar4; cVar7 = *pcVar4; g_xmlParseError = pbVar6; } } *param_1 = (int)(pcVar4 + 2); return (int *)0x0; } piVar2 = (int *)FUN_00416510(0x30); *piVar2 = 0; piVar2[1] = 0; piVar2[4] = 0; piVar2[5] = 1; piVar2[6] = 0; piVar2[8] = 0; pbVar6 = (byte *)*param_1; cVar7 = (&DAT_00b1ae60)[*pbVar6]; pbVar5 = pbVar6; while (cVar7 != '\0') { pbVar1 = pbVar5 + 1; pbVar5 = pbVar5 + 1; cVar7 = (&DAT_00b1ae60)[*pbVar1]; } *param_1 = (int)pbVar5; pcVar3 = "expected element name"; *piVar2 = (int)pbVar6; if (pbVar5 != pbVar6) { pcVar3 = (char *)g_xmlParseError; } piVar2[2] = (int)pbVar5 - (int)pbVar6; pbVar6 = (byte *)*param_1; cVar7 = (&DAT_00b1b060)[*pbVar6]; while (cVar7 != '\0') { pbVar5 = pbVar6 + 1; pbVar6 = pbVar6 + 1; cVar7 = (&DAT_00b1b060)[*pbVar5]; } g_xmlParseError = (byte *)pcVar3; *param_1 = (int)pbVar6; FUN_004165a0(param_1,piVar2); pcVar3 = (char *)*param_1; if (*pcVar3 == '>') { *param_1 = (int)(pcVar3 + 1); FUN_00416770(param_1,piVar2); } else if (*pcVar3 == '/') { pcVar4 = "expected >"; *param_1 = (int)(pcVar3 + 1); if (pcVar3[1] == '>') { pcVar4 = (char *)g_xmlParseError; } g_xmlParseError = (byte *)pcVar4; *param_1 = (int)(pcVar3 + 2); } else { g_xmlParseError = (byte *)s_expected_>_00b1b6a8; } if (*piVar2 == 0) { g_xmlNullStr = 0; return piVar2; } *(undefined1 *)(*piVar2 + piVar2[2]) = 0; return piVar2; } cVar7 = pcVar3[1]; pcVar4 = pcVar3 + 1; if (cVar7 == '-') { if (pcVar3[2] == '-') { pcVar3 = pcVar3 + 3; do { *param_1 = (int)pcVar3; if (*pcVar3 == '-') { pbVar6 = g_xmlParseError; if (pcVar3[1] == '-') { if (pcVar3[2] == '>') { *param_1 = (int)(pcVar3 + 3); return (int *)0x0; } goto LAB_004163d1; } } else { LAB_004163d1: pbVar6 = (byte *)"unexpected end of data"; if (*pcVar3 != '\0') { pbVar6 = g_xmlParseError; } } pcVar3 = pcVar3 + 1; g_xmlParseError = pbVar6; } while( true ); } } else if (cVar7 == 'D') { if ((((pcVar3[2] == 'O') && (pcVar3[3] == 'C')) && (pcVar3[4] == 'T')) && (((pcVar3[5] == 'Y' && (pcVar3[6] == 'P')) && ((pcVar3[7] == 'E' && ((&DAT_00b1b060)[(byte)pcVar3[8]] != '\0')))))) { pcVar3 = pcVar3 + 9; *param_1 = (int)pcVar3; cVar7 = *pcVar3; do { if (cVar7 == '>') { *param_1 = (int)(pcVar3 + 1); return (int *)0x0; } if (cVar7 == '\0') { g_xmlParseError = (byte *)s_unexpected_end_of_data_00b1b678; LAB_00416395: pcVar3 = pcVar3 + 1; *param_1 = (int)pcVar3; } else { if (cVar7 != '[') goto LAB_00416395; pcVar3 = pcVar3 + 1; iVar8 = 1; *param_1 = (int)pcVar3; do { cVar7 = *pcVar3; if (cVar7 == '\0') { g_xmlParseError = (byte *)s_unexpected_end_of_data_00b1b678; } else if (cVar7 == '[') { iVar8 = iVar8 + 1; } else if (cVar7 == ']') { iVar8 = iVar8 + -1; } pcVar3 = pcVar3 + 1; *param_1 = (int)pcVar3; } while (0 < iVar8); } cVar7 = *pcVar3; } while( true ); } } else if (((cVar7 == '[') && (pcVar3[2] == 'C')) && ((pcVar3[3] == 'D' && ((((pcVar3[4] == 'A' && (pcVar3[5] == 'T')) && (pcVar3[6] == 'A')) && (pcVar3[7] == '[')) )))) { pcVar3 = pcVar3 + 8; *param_1 = (int)pcVar3; pcVar4 = pcVar3; do { if (*pcVar4 == ']') { pbVar6 = g_xmlParseError; if (pcVar4[1] == ']') { if (pcVar4[2] == '>') { piVar2 = (int *)FUN_00416510(0x30); piVar2[1] = 0; *piVar2 = 0; piVar2[4] = 0; piVar2[5] = 3; piVar2[6] = 0; piVar2[8] = 0; iVar8 = *param_1; piVar2[1] = (int)pcVar3; piVar2[3] = iVar8 - (int)pcVar3; *(undefined1 *)*param_1 = 0; *param_1 = *param_1 + 3; return piVar2; } goto LAB_00416286; } } else { LAB_00416286: pbVar6 = (byte *)"unexpected end of data"; if (*pcVar4 != '\0') { pbVar6 = g_xmlParseError; } } pcVar4 = pcVar4 + 1; *param_1 = (int)pcVar4; g_xmlParseError = pbVar6; } while( true ); } *param_1 = (int)pcVar4; cVar7 = *pcVar4; if (cVar7 != '>') { pbVar6 = g_xmlParseError; do { g_xmlParseError = (byte *)"unexpected end of data"; if (cVar7 != '\0') { g_xmlParseError = pbVar6; } pcVar4 = pcVar4 + 1; *param_1 = (int)pcVar4; cVar7 = *pcVar4; pbVar6 = g_xmlParseError; } while (cVar7 != '>'); } *param_1 = (int)(pcVar4 + 1); return (int *)0x0; } //@@ 00416440 _Find_lower_bound<> /* Library Function - Multiple Matches With Same Base Name protected: struct std::_Tree_find_result *> __thiscall std::_Tree,class fuzzer::fuzzer_allocator,0> >::_Find_lower_bound(unsigned int const &)const protected: struct std::_Tree_find_result *> __thiscall std::_Tree,class fuzzer::fuzzer_allocator,0> >::_Find_lower_bound(struct fuzzer::TracePC::PCTableEntry const * const &)const Library: Visual Studio 2019 Release */ int * _Find_lower_bound<>(int *param_1,uint *param_2) { int iVar1; uint uVar2; uint uVar3; undefined4 *puVar4; int *in_ECX; iVar1 = *in_ECX; puVar4 = *(undefined4 **)(iVar1 + 4); *param_1 = (int)puVar4; param_1[1] = 0; param_1[2] = iVar1; if (*(char *)((int)puVar4 + 0xd) == '\0') { uVar2 = *param_2; do { *param_1 = (int)puVar4; uVar3 = puVar4[4]; if (uVar2 <= uVar3) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(uVar2 <= uVar3); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 00416490 FUN_00416490 int * FUN_00416490(int *param_1,uint *param_2) { uint uVar1; uint uVar2; void *pvVar3; undefined4 *puVar4; pvVar3 = g_anmCacheMap; puVar4 = *(undefined4 **)((int)g_anmCacheMap + 4); *param_1 = (int)puVar4; param_1[1] = 0; param_1[2] = (int)pvVar3; if (*(char *)((int)puVar4 + 0xd) == '\0') { uVar1 = *param_2; do { *param_1 = (int)puVar4; uVar2 = puVar4[4]; if (uVar1 <= uVar2) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(uVar1 <= uVar2); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 004164e0 FUN_004164e0 void FUN_004164e0(void) { char *pcVar1; undefined4 *in_ECX; char *this; pcVar1 = (char *)in_ECX[1]; for (this = (char *)*in_ECX; this != pcVar1; this = this + 0x18) { std::string::_Tidy_deallocate(this); } return; } //@@ 00416510 FUN_00416510 int FUN_00416510(uint param_1) { void *pvVar1; char *pcVar2; undefined4 *in_ECX; undefined4 *puVar3; int iVar4; uint uVar5; iVar4 = (-in_ECX[1] & 3) + in_ECX[1]; if ((uint)in_ECX[2] < iVar4 + param_1) { uVar5 = param_1; if (param_1 < 0x10001) { uVar5 = 0x10000; } uVar5 = uVar5 + 10; if ((code *)in_ECX[0x4003] == (code *)0x0) { pvVar1 = operator_new_tracked(uVar5); pcVar2 = "out of memory"; if (pvVar1 != (void *)0x0) { pcVar2 = (char *)g_xmlParseError; } g_xmlParseError = (byte *)pcVar2; } else { pvVar1 = (void *)(*(code *)in_ECX[0x4003])(uVar5); } puVar3 = (undefined4 *)((-(int)pvVar1 & 3U) + (int)pvVar1); *puVar3 = *in_ECX; *in_ECX = pvVar1; puVar3 = puVar3 + 1; in_ECX[2] = (int)pvVar1 + uVar5; iVar4 = (-(int)puVar3 & 3U) + (int)puVar3; } in_ECX[1] = iVar4 + param_1; return iVar4; } //@@ 004165a0 FUN_004165a0 void FUN_004165a0(int *param_1,int param_2) { byte *pbVar1; char cVar2; byte bVar3; int *piVar4; char *pcVar5; int iVar6; byte *pbVar7; byte *pbVar8; pbVar8 = (byte *)*param_1; if ((&DAT_00b1af60)[*pbVar8] != '\0') { pcVar5 = (char *)g_xmlParseError; do { pbVar7 = pbVar8 + 1; *param_1 = (int)pbVar7; cVar2 = (&DAT_00b1af60)[*pbVar7]; while (cVar2 != '\0') { pbVar1 = pbVar7 + 1; pbVar7 = pbVar7 + 1; cVar2 = (&DAT_00b1af60)[*pbVar1]; } *param_1 = (int)pbVar7; g_xmlParseError = (byte *)"expected attribute name"; if (pbVar7 != pbVar8) { g_xmlParseError = (byte *)pcVar5; } piVar4 = (int *)FUN_00416510(0x1c); *piVar4 = 0; piVar4[1] = 0; piVar4[4] = 0; iVar6 = *param_1; *piVar4 = (int)pbVar8; piVar4[2] = iVar6 - (int)pbVar8; if (*(int *)(param_2 + 0x20) == 0) { piVar4[5] = 0; *(int **)(param_2 + 0x20) = piVar4; } else { piVar4[5] = *(int *)(param_2 + 0x24); *(int **)(*(int *)(param_2 + 0x24) + 0x18) = piVar4; } *(int **)(param_2 + 0x24) = piVar4; piVar4[4] = param_2; piVar4[6] = 0; pbVar8 = (byte *)*param_1; cVar2 = (&DAT_00b1b060)[*pbVar8]; while (cVar2 != '\0') { pbVar7 = pbVar8 + 1; pbVar8 = pbVar8 + 1; cVar2 = (&DAT_00b1b060)[*pbVar7]; } *param_1 = (int)pbVar8; pcVar5 = "expected ="; if (*pbVar8 == 0x3d) { pcVar5 = (char *)g_xmlParseError; } g_xmlParseError = (byte *)pcVar5; *param_1 = (int)(pbVar8 + 1); pbVar8 = (byte *)*piVar4; if (pbVar8 == (byte *)0x0) { pbVar8 = &g_xmlNullStr; iVar6 = 0; } else { iVar6 = piVar4[2]; } pbVar8[iVar6] = 0; pbVar8 = (byte *)*param_1; cVar2 = (&DAT_00b1b060)[*pbVar8]; while (cVar2 != '\0') { pbVar7 = pbVar8 + 1; pbVar8 = pbVar8 + 1; cVar2 = (&DAT_00b1b060)[*pbVar7]; } *param_1 = (int)pbVar8; bVar3 = *pbVar8; if ((bVar3 == 0x27) || (bVar3 == 0x22)) { *param_1 = (int)(pbVar8 + 1); if (bVar3 != 0x27) goto LAB_004166dc; iVar6 = FUN_00416920(); } else { g_xmlParseError = (byte *)s_expected___or___00b1b6e8; *param_1 = (int)(pbVar8 + 1); LAB_004166dc: iVar6 = FUN_00416b70(); } piVar4[1] = (int)(pbVar8 + 1); pcVar5 = "expected \' or \""; piVar4[3] = iVar6 - (int)(pbVar8 + 1); if (*(byte *)*param_1 == bVar3) { pcVar5 = (char *)g_xmlParseError; } *param_1 = (int)((byte *)*param_1 + 1); pbVar8 = (byte *)piVar4[1]; if (pbVar8 == (byte *)0x0) { pbVar8 = &g_xmlNullStr; iVar6 = 0; } else { iVar6 = piVar4[3]; } g_xmlParseError = (byte *)pcVar5; pbVar8[iVar6] = 0; pbVar8 = (byte *)*param_1; cVar2 = (&DAT_00b1b060)[*pbVar8]; while (cVar2 != '\0') { pbVar7 = pbVar8 + 1; pbVar8 = pbVar8 + 1; cVar2 = (&DAT_00b1b060)[*pbVar7]; } *param_1 = (int)pbVar8; } while ((&DAT_00b1af60)[*pbVar8] != '\0'); } return; } //@@ 00416770 FUN_00416770 void FUN_00416770(int *param_1,int param_2) { byte *pbVar1; char cVar2; byte bVar3; int iVar4; undefined1 *puVar5; undefined4 *puVar6; char *pcVar7; byte *pbVar8; byte *pbVar9; LAB_00416780: pbVar9 = (byte *)*param_1; cVar2 = (&DAT_00b1b060)[*pbVar9]; pbVar8 = pbVar9; while (cVar2 != '\0') { pbVar1 = pbVar8 + 1; pbVar8 = pbVar8 + 1; cVar2 = (&DAT_00b1b060)[*pbVar1]; } *param_1 = (int)pbVar8; bVar3 = *pbVar8; do { if (bVar3 == 0) { g_xmlParseError = (byte *)s_unexpected_end_of_data_00b1b678; } else if (bVar3 == 0x3c) break; *param_1 = (int)pbVar9; puVar5 = (undefined1 *)FUN_00416e80(); puVar6 = (undefined4 *)FUN_00416510(0x30); *puVar6 = 0; puVar6[4] = 0; puVar6[5] = 2; puVar6[6] = 0; puVar6[8] = 0; puVar6[1] = pbVar9; puVar6[3] = (int)puVar5 - (int)pbVar9; if (*(int *)(param_2 + 0x18) == 0) { puVar6[10] = 0; *(undefined4 **)(param_2 + 0x18) = puVar6; } else { puVar6[10] = *(undefined4 *)(param_2 + 0x1c); *(undefined4 **)(*(int *)(param_2 + 0x1c) + 0x2c) = puVar6; } *(undefined4 **)(param_2 + 0x1c) = puVar6; puVar6[4] = param_2; puVar6[0xb] = 0; pbVar8 = &g_xmlNullStr; if (*(byte **)(param_2 + 4) != (byte *)0x0) { pbVar8 = *(byte **)(param_2 + 4); } if (*pbVar8 == 0) { *(byte **)(param_2 + 4) = pbVar9; *(int *)(param_2 + 0xc) = (int)puVar5 - (int)pbVar9; } bVar3 = *(byte *)*param_1; *puVar5 = 0; } while( true ); iVar4 = *param_1; if (*(char *)(iVar4 + 1) == '/') { pbVar9 = (byte *)(iVar4 + 2); *param_1 = (int)pbVar9; cVar2 = (&DAT_00b1ae60)[*pbVar9]; while (cVar2 != '\0') { pbVar8 = pbVar9 + 1; pbVar9 = pbVar9 + 1; cVar2 = (&DAT_00b1ae60)[*pbVar8]; } *param_1 = (int)pbVar9; cVar2 = (&DAT_00b1b060)[*pbVar9]; while (cVar2 != '\0') { pbVar8 = pbVar9 + 1; pbVar9 = pbVar9 + 1; cVar2 = (&DAT_00b1b060)[*pbVar8]; } *param_1 = (int)pbVar9; pcVar7 = "expected >"; if (*pbVar9 == 0x3e) { pcVar7 = (char *)g_xmlParseError; } g_xmlParseError = (byte *)pcVar7; *param_1 = (int)(pbVar9 + 1); return; } *param_1 = iVar4 + 1; iVar4 = rapidxml::xml_document::parse_node(param_1); if (iVar4 != 0) { if (*(int *)(param_2 + 0x18) == 0) { *(undefined4 *)(iVar4 + 0x28) = 0; *(int *)(param_2 + 0x18) = iVar4; *(int *)(param_2 + 0x1c) = iVar4; *(int *)(iVar4 + 0x10) = param_2; *(undefined4 *)(iVar4 + 0x2c) = 0; } else { *(undefined4 *)(iVar4 + 0x28) = *(undefined4 *)(param_2 + 0x1c); *(int *)(*(int *)(param_2 + 0x1c) + 0x2c) = iVar4; *(int *)(param_2 + 0x1c) = iVar4; *(int *)(iVar4 + 0x10) = param_2; *(undefined4 *)(iVar4 + 0x2c) = 0; } } goto LAB_00416780; } //@@ 00416920 FUN_00416920 byte * FUN_00416920(void) { byte *pbVar1; char cVar2; byte bVar3; undefined4 *in_ECX; byte *pbVar4; byte *local_8; pbVar4 = (byte *)*in_ECX; cVar2 = (&DAT_00b1a960)[*pbVar4]; while (cVar2 != '\0') { pbVar1 = pbVar4 + 1; pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1a960)[*pbVar1]; } *in_ECX = pbVar4; bVar3 = *pbVar4; cVar2 = (&DAT_00b1ac60)[bVar3]; local_8 = pbVar4; do { if (cVar2 == '\0') { *in_ECX = pbVar4; return local_8; } if (bVar3 != 0x26) { switchD_00416987_caseD_24: bVar3 = *pbVar4; pbVar4 = pbVar4 + 1; *local_8 = bVar3; goto LAB_00416adc; } switch(pbVar4[1]) { case 0x23: pbVar1 = pbVar4 + 2; if (*pbVar1 == 0x78) { pbVar1 = pbVar4 + 3; pbVar4 = pbVar4 + 3; cVar2 = (&DAT_00b1ad60)[*pbVar1]; while (cVar2 != -1) { pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1ad60)[*pbVar4]; } } else { pbVar4 = pbVar4 + 2; cVar2 = (&DAT_00b1ad60)[*pbVar1]; while (cVar2 != -1) { pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1ad60)[*pbVar4]; } } FUN_00416dc0(); if (*pbVar4 == 0x3b) { pbVar4 = pbVar4 + 1; } else { g_xmlParseError = (byte *)s_expected___00b1b6f8; } goto LAB_00416adf; default: goto switchD_00416987_caseD_24; case 0x61: if (pbVar4[2] == 0x6d) { if ((pbVar4[3] != 0x70) || (pbVar4[4] != 0x3b)) goto switchD_00416987_caseD_24; *local_8 = 0x26; pbVar4 = pbVar4 + 5; } else { if ((((pbVar4[2] != 0x70) || (pbVar4[3] != 0x6f)) || (pbVar4[4] != 0x73)) || (pbVar4[5] != 0x3b)) goto switchD_00416987_caseD_24; *local_8 = 0x27; pbVar4 = pbVar4 + 6; } break; case 0x67: if ((pbVar4[2] != 0x74) || (pbVar4[3] != 0x3b)) goto switchD_00416987_caseD_24; *local_8 = 0x3e; pbVar4 = pbVar4 + 4; break; case 0x6c: if ((pbVar4[2] != 0x74) || (pbVar4[3] != 0x3b)) goto switchD_00416987_caseD_24; *local_8 = 0x3c; pbVar4 = pbVar4 + 4; break; case 0x71: if ((((pbVar4[2] != 0x75) || (pbVar4[3] != 0x6f)) || (pbVar4[4] != 0x74)) || (pbVar4[5] != 0x3b)) goto switchD_00416987_caseD_24; *local_8 = 0x22; pbVar4 = pbVar4 + 6; } LAB_00416adc: local_8 = local_8 + 1; LAB_00416adf: bVar3 = *pbVar4; cVar2 = (&DAT_00b1ac60)[bVar3]; } while( true ); } //@@ 00416b70 FUN_00416b70 byte * FUN_00416b70(void) { byte *pbVar1; char cVar2; byte bVar3; undefined4 *in_ECX; byte *pbVar4; byte *local_8; pbVar4 = (byte *)*in_ECX; cVar2 = (&DAT_00b1a860)[*pbVar4]; while (cVar2 != '\0') { pbVar1 = pbVar4 + 1; pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1a860)[*pbVar1]; } *in_ECX = pbVar4; bVar3 = *pbVar4; cVar2 = (&DAT_00b1ab60)[bVar3]; local_8 = pbVar4; do { if (cVar2 == '\0') { *in_ECX = pbVar4; return local_8; } if (bVar3 != 0x26) { switchD_00416bd7_caseD_24: bVar3 = *pbVar4; pbVar4 = pbVar4 + 1; *local_8 = bVar3; goto LAB_00416d2c; } switch(pbVar4[1]) { case 0x23: pbVar1 = pbVar4 + 2; if (*pbVar1 == 0x78) { pbVar1 = pbVar4 + 3; pbVar4 = pbVar4 + 3; cVar2 = (&DAT_00b1ad60)[*pbVar1]; while (cVar2 != -1) { pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1ad60)[*pbVar4]; } } else { pbVar4 = pbVar4 + 2; cVar2 = (&DAT_00b1ad60)[*pbVar1]; while (cVar2 != -1) { pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1ad60)[*pbVar4]; } } FUN_00416dc0(); if (*pbVar4 == 0x3b) { pbVar4 = pbVar4 + 1; } else { g_xmlParseError = (byte *)s_expected___00b1b6f8; } goto LAB_00416d2f; default: goto switchD_00416bd7_caseD_24; case 0x61: if (pbVar4[2] == 0x6d) { if ((pbVar4[3] != 0x70) || (pbVar4[4] != 0x3b)) goto switchD_00416bd7_caseD_24; *local_8 = 0x26; pbVar4 = pbVar4 + 5; } else { if ((((pbVar4[2] != 0x70) || (pbVar4[3] != 0x6f)) || (pbVar4[4] != 0x73)) || (pbVar4[5] != 0x3b)) goto switchD_00416bd7_caseD_24; *local_8 = 0x27; pbVar4 = pbVar4 + 6; } break; case 0x67: if ((pbVar4[2] != 0x74) || (pbVar4[3] != 0x3b)) goto switchD_00416bd7_caseD_24; *local_8 = 0x3e; pbVar4 = pbVar4 + 4; break; case 0x6c: if ((pbVar4[2] != 0x74) || (pbVar4[3] != 0x3b)) goto switchD_00416bd7_caseD_24; *local_8 = 0x3c; pbVar4 = pbVar4 + 4; break; case 0x71: if ((((pbVar4[2] != 0x75) || (pbVar4[3] != 0x6f)) || (pbVar4[4] != 0x74)) || (pbVar4[5] != 0x3b)) goto switchD_00416bd7_caseD_24; *local_8 = 0x22; pbVar4 = pbVar4 + 6; } LAB_00416d2c: local_8 = local_8 + 1; LAB_00416d2f: bVar3 = *pbVar4; cVar2 = (&DAT_00b1ab60)[bVar3]; } while( true ); } //@@ 00416dc0 FUN_00416dc0 void FUN_00416dc0(void) { byte *pbVar1; int *in_ECX; byte bVar2; uint in_EDX; bVar2 = (byte)in_EDX; if (in_EDX < 0x80) { pbVar1 = (byte *)*in_ECX; *pbVar1 = bVar2; *in_ECX = (int)(pbVar1 + 1); return; } if (in_EDX < 0x800) { pbVar1 = (byte *)*in_ECX; pbVar1[1] = bVar2 & 0x3f | 0x80; *in_ECX = (int)(pbVar1 + 2); *pbVar1 = (byte)(in_EDX >> 6) | 0xc0; return; } if (in_EDX < 0x10000) { pbVar1 = (byte *)*in_ECX; pbVar1[2] = bVar2 & 0x3f | 0x80; pbVar1[1] = (byte)(in_EDX >> 6) & 0x3f | 0x80; *in_ECX = (int)(pbVar1 + 3); *pbVar1 = (byte)(in_EDX >> 0xc) | 0xe0; return; } if (in_EDX < 0x110000) { pbVar1 = (byte *)*in_ECX; pbVar1[3] = bVar2 & 0x3f | 0x80; pbVar1[2] = (byte)(in_EDX >> 6) & 0x3f | 0x80; pbVar1[1] = (byte)(in_EDX >> 0xc) & 0x3f | 0x80; *in_ECX = (int)(pbVar1 + 4); *pbVar1 = (byte)(in_EDX >> 0x12) | 0xf0; return; } g_xmlParseError = (byte *)s_invalid_numeric_character_entity_00b1b704; return; } //@@ 00416e80 FUN_00416e80 byte * FUN_00416e80(void) { byte *pbVar1; char cVar2; byte bVar3; undefined4 *in_ECX; byte *pbVar4; byte *local_8; pbVar4 = (byte *)*in_ECX; cVar2 = (&DAT_00b1a760)[*pbVar4]; while (cVar2 != '\0') { pbVar1 = pbVar4 + 1; pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1a760)[*pbVar1]; } *in_ECX = pbVar4; bVar3 = *pbVar4; cVar2 = (&DAT_00b1aa60)[bVar3]; local_8 = pbVar4; do { if (cVar2 == '\0') { *in_ECX = pbVar4; return local_8; } if (bVar3 != 0x26) { switchD_00416ee7_caseD_24: bVar3 = *pbVar4; pbVar4 = pbVar4 + 1; *local_8 = bVar3; goto LAB_0041703c; } switch(pbVar4[1]) { case 0x23: pbVar1 = pbVar4 + 2; if (*pbVar1 == 0x78) { pbVar1 = pbVar4 + 3; pbVar4 = pbVar4 + 3; cVar2 = (&DAT_00b1ad60)[*pbVar1]; while (cVar2 != -1) { pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1ad60)[*pbVar4]; } } else { pbVar4 = pbVar4 + 2; cVar2 = (&DAT_00b1ad60)[*pbVar1]; while (cVar2 != -1) { pbVar4 = pbVar4 + 1; cVar2 = (&DAT_00b1ad60)[*pbVar4]; } } FUN_00416dc0(); if (*pbVar4 == 0x3b) { pbVar4 = pbVar4 + 1; } else { g_xmlParseError = (byte *)s_expected___00b1b6f8; } goto LAB_0041703f; default: goto switchD_00416ee7_caseD_24; case 0x61: if (pbVar4[2] == 0x6d) { if ((pbVar4[3] != 0x70) || (pbVar4[4] != 0x3b)) goto switchD_00416ee7_caseD_24; *local_8 = 0x26; pbVar4 = pbVar4 + 5; } else { if ((((pbVar4[2] != 0x70) || (pbVar4[3] != 0x6f)) || (pbVar4[4] != 0x73)) || (pbVar4[5] != 0x3b)) goto switchD_00416ee7_caseD_24; *local_8 = 0x27; pbVar4 = pbVar4 + 6; } break; case 0x67: if ((pbVar4[2] != 0x74) || (pbVar4[3] != 0x3b)) goto switchD_00416ee7_caseD_24; *local_8 = 0x3e; pbVar4 = pbVar4 + 4; break; case 0x6c: if ((pbVar4[2] != 0x74) || (pbVar4[3] != 0x3b)) goto switchD_00416ee7_caseD_24; *local_8 = 0x3c; pbVar4 = pbVar4 + 4; break; case 0x71: if ((((pbVar4[2] != 0x75) || (pbVar4[3] != 0x6f)) || (pbVar4[4] != 0x74)) || (pbVar4[5] != 0x3b)) goto switchD_00416ee7_caseD_24; *local_8 = 0x22; pbVar4 = pbVar4 + 6; } LAB_0041703c: local_8 = local_8 + 1; LAB_0041703f: bVar3 = *pbVar4; cVar2 = (&DAT_00b1aa60)[bVar3]; } while( true ); } //@@ 004170c3 FUN_004170c3 void FUN_004170c3(void) { FUN_004145c0(); return; } //@@ 004170d0 FUN_004170d0 void FUN_004170d0(void) { /* WARNING: Subroutine does not return */ std::_Xlength_error("map/set too long"); } //@@ 004170e0 FUN_004170e0 int FUN_004170e0(int param_1) { undefined4 *in_ECX; if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } return param_1 + (int)in_ECX; } //@@ 00417100 FUN_00417100 void FUN_00417100(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; return; } //@@ 00417150 FUN_00417150 void FUN_00417150(void) { float in_XMM0_Da; cos(in_XMM0_Da); return; } //@@ 00417160 sinf_wrapper /* DB: ? body only calls sin(); ICF-foldable prototype: db/protos.zhl */ float __cdecl sinf_wrapper(float x) { float fVar1; fVar1 = sin(x); return fVar1; } //@@ 00417170 BitSet128::operator_and /* DB: ANDs four dwords of two 128-bit masks (entity flag sets) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ BitSet128 * __cdecl BitSet128::operator_and(BitSet128 *outResult,BitSet128 *a,BitSet128 *b) { uint uVar1; uint uVar2; qword qVar3; qword qVar4; qword qVar5; qword qVar6; qVar3 = a->_l; qVar4 = b->_l; qVar5 = a->_h; qVar6 = b->_h; *(uint *)((int)&outResult->_l + 4) = *(uint *)((int)&a->_l + 4) & *(uint *)((int)&b->_l + 4); uVar1 = *(uint *)((int)&a->_h + 4); uVar2 = *(uint *)((int)&b->_h + 4); *(uint *)&outResult->_l = (uint)qVar3 & (uint)qVar4; *(uint *)((int)&outResult->_h + 4) = uVar1 & uVar2; *(uint *)&outResult->_h = (uint)qVar5 & (uint)qVar6; return outResult; } //@@ 004171b0 BitSet128::IsNonZero /* DB: true if any of four dwords nonzero (tear-flag style 128-bit set) prototype: db/protos.zhl */ byte __thiscall BitSet128::IsNonZero(BitSet128 *this) { if (((int)this->_l == 0 && *(int *)((int)&this->_l + 4) == 0) && ((int)this->_h == 0 && *(int *)((int)&this->_h + 4) == 0)) { return 0; } return 1; } //@@ 004171d0 Vector::operator_mul /* DB: float scalar times vector prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Vector * __cdecl Vector::operator_mul(Vector *outResult,float *scalar,Vector *vector) { float fVar1; float fVar2; fVar1 = *scalar; fVar2 = vector->y; outResult->x = fVar1 * vector->x; outResult->y = fVar1 * fVar2; return outResult; } //@@ 00417200 Sprite::Scale /* ZHL [lua] Lua binding Sprite:Scale */ Vector * __thiscall Sprite::Scale(Sprite *this) { return &this->_scale; } //@@ 00417210 Sprite::Rotation /* ZHL [lua] Lua binding Sprite:Rotation */ float10 __thiscall Sprite::Rotation(Sprite *this) { return (float10)this->_rotation; } //@@ 00417220 Entity::IsType /* DB: compares type/variant/subtype with -1 wildcards prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Entity::IsType(Entity *this,int type,int variant,int subType) { if (((this->_type == type) && ((variant == -1 || (this->_variant == variant)))) && ((subType == -1 || (this->_subtype == subType)))) { return 1; } return 0; } //@@ 00417260 Entity::Type /* ZHL [lua] Lua binding Entity:Type */ int __thiscall Entity::Type(Entity *this) { return this->_type; } //@@ 00417270 Entity::Variant /* ZHL [lua] Lua binding Entity:Variant */ int __thiscall Entity::Variant(Entity *this) { return this->_variant; } //@@ 00417280 Entity::SubType /* ZHL [lua] Lua binding Entity:SubType */ int __thiscall Entity::SubType(Entity *this) { return this->_subtype; } //@@ 00417290 Entity::Position /* ZHL [lua] Lua binding Entity:Position prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity::Position(Entity *this,Vector *outPos) { float fVar1; fVar1 = (this->_pos).y; outPos->x = (this->_pos).x; outPos->y = fVar1; return outPos; } //@@ 004172b0 FUN_004172b0 void FUN_004172b0(undefined4 *param_1) { undefined4 uVar1; int in_ECX; uVar1 = *(undefined4 *)(in_ECX + 0x390); *param_1 = *(undefined4 *)(in_ECX + 0x38c); param_1[1] = uVar1; return; } //@@ 004172d0 Entity::Velocity /* ZHL [lua] Lua binding Entity:Velocity prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity::Velocity(Entity *this,Vector *outVelocity) { float fVar1; fVar1 = (this->_velocity).y; outVelocity->x = (this->_velocity).x; outVelocity->y = fVar1; return outVelocity; } //@@ 004172f0 Entity::SetPositionOffset /* DB: writes _posOffset 0x34c prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetPositionOffset(Entity *this,Vector *offset) { (this->_posOffset).x = offset->x; (this->_posOffset).y = offset->y; return; } //@@ 00417310 Entity::PositionOffset /* ZHL [lua] Lua binding Entity:PositionOffset */ Vector * __thiscall Entity::PositionOffset(Entity *this) { return &this->_posOffset; } //@@ 00417320 Entity::SpriteScale /* ZHL [lua] Lua binding Entity:SpriteScale */ Vector * __thiscall Entity::SpriteScale(Entity *this) { return &(this->_sprite)._scale; } //@@ 00417330 Entity::SpriteRotation /* ZHL [lua] Lua binding Entity:SpriteRotation */ float10 __thiscall Entity::SpriteRotation(Entity *this) { return (float10)(this->_sprite)._rotation; } //@@ 00417340 FUN_00417340 void FUN_00417340(void) { return; } //@@ 00417350 FUN_00417350 int FUN_00417350(void) { int in_ECX; return in_ECX + 0x374; } //@@ 00417360 Entity::MaxHitPoints /* ZHL [lua] Lua binding Entity:MaxHitPoints */ float10 Entity::MaxHitPoints(void) { int in_ECX; return (float10)*(float *)(in_ECX + 900); } //@@ 00417370 Entity::HitPoints /* ZHL [lua] Lua binding Entity:HitPoints */ float10 __thiscall Entity::HitPoints(Entity *this) { return (float10)this->_health; } //@@ 00417380 Entity::EntityCollisionClass /* ZHL [lua] Lua binding Entity:EntityCollisionClass */ int __thiscall Entity::EntityCollisionClass(Entity *this) { return this->_entityCollisionClass; } //@@ 00417390 FUN_00417390 undefined1 FUN_00417390(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x170); } //@@ 004173a0 FUN_004173a0 void FUN_004173a0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x170) = param_1; return; } //@@ 004173b0 Entity::is_player /* DB: tiny: type == 1 (ICF caution) (dogma_effects.md) prototype: db/protos.zhl */ byte __thiscall Entity::is_player(Entity *this) { return this->_type == 1; } //@@ 004173c0 Entity::is_bomb /* DB: tiny: type == 4 (ICF caution) (dogma_effects.md) */ bool __thiscall Entity::is_bomb(Entity *this) { return this->_type == 4; } //@@ 004173d0 FUN_004173d0 bool FUN_004173d0(void) { int in_ECX; return *(int *)(in_ECX + 0x28) == 1000; } //@@ 004173e0 Entity::AddEntityFlags /* ZHL [lua] Lua binding Entity:AddEntityFlags prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity::AddEntityFlags(Entity *this,ulonglong flags) { uint *puVar1; *(uint *)&this->_flags = (uint)this->_flags | (uint)flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 | flags._4_4_; return; } //@@ 00417400 Entity::ClearEntityFlags /* ZHL [lua] Lua binding Entity:ClearEntityFlags prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity::ClearEntityFlags(Entity *this,ulonglong flags) { uint *puVar1; *(uint *)&this->_flags = (uint)this->_flags & ~(uint)flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & ~flags._4_4_; return; } //@@ 00417420 Entity::GetEntityFlags /* ZHL [lua] Lua binding Entity:GetEntityFlags */ qword __thiscall Entity::GetEntityFlags(Entity *this) { return this->_flags; } //@@ 00417430 Entity::HasEntityFlags /* ZHL [lua] Lua binding Entity:HasEntityFlags prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity::HasEntityFlags(Entity *this,ulonglong flags) { if (((uint)flags & (uint)this->_flags) == 0 && (*(uint *)((int)&this->_flags + 4) & flags._4_4_) == 0) { return 0; } return 1; } //@@ 00417460 Entity::Exists /* ZHL [lua] Lua binding Entity:Exists */ byte __thiscall Entity::Exists(Entity *this) { return this->_exists; } //@@ 00417470 Entity::IsDead /* ZHL [lua] Lua binding Entity:IsDead */ byte __thiscall Entity::IsDead(Entity *this) { return this->_dead; } //@@ 00417480 Entity::Visible /* ZHL [lua] Lua binding Entity:Visible */ byte __thiscall Entity::Visible(Entity *this) { return this->_visible; } //@@ 00417490 FUN_00417490 undefined4 FUN_00417490(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x330); } //@@ 004174a0 Entity::SpawnerEntity /* ZHL [lua] Lua binding Entity:SpawnerEntity */ EntityPtr __thiscall Entity::SpawnerEntity(Entity *this) { return this->_spawnerEntity; } //@@ 004174b0 Entity::GetDropRNG /* ZHL [lua] Lua binding Entity:GetDropRNG */ RNG * __thiscall Entity::GetDropRNG(Entity *this) { return &this->_dropRNG; } //@@ 004174c0 buffer_init /* DB: ? alloc param bytes prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall buffer_init(void *this,uint count) { void *pvVar1; *(undefined1 *)this = 0; *(uint *)((int)this + 8) = count; *(undefined4 *)((int)this + 0xc) = 0; if (count == 0) { *(undefined4 *)((int)this + 4) = 0; return this; } pvVar1 = operator_new_tracked (-(uint)((int)((ulonglong)count * 4 >> 0x20) != 0) | (uint)((ulonglong)count * 4)); *(void **)((int)this + 4) = pvVar1; return this; } //@@ 00417510 EntityList_EL::constructor /* ZHL [exact] __thiscall void EntityList_EL::constructor(EntityList_EL *source); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall EntityList_EL::constructor(EntityList_EL *this,EntityList_EL *source) { *(undefined1 *)this = 1; this->_data = source->_data; this->_capacity = source->_capacity; this->_size = source->_size; return; } //@@ 00417540 EntityList::sublist_init /* DB: "EL: invalid sublist" prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall EntityList::sublist_init(EntityList *this,EntityList_EL *parent,int capacity) { void *pvVar1; int iVar2; uint uVar3; *(undefined1 *)this = 1; iVar2 = parent->_size; pvVar1 = parent->_data; *(int *)&this->field_0x8 = capacity; *(undefined4 *)&this->field_0xc = 0; *(void **)&this->field_0x4 = (void *)((int)pvVar1 + iVar2 * 4); iVar2 = parent->_size; uVar3 = parent->_capacity; if (uVar3 < (uint)(iVar2 + capacity)) { KAGE_LogMessage(0x10,(byte *)"EL: invalid sublist\n"); iVar2 = parent->_size; uVar3 = parent->_capacity; } if (uVar3 < (uint)(iVar2 + capacity)) { iVar2 = 0; *(void **)&this->field_0x4 = parent->_data; } parent->_size = iVar2 + capacity; return; } //@@ 004175b0 EntityList_Query::~EntityList_Query /* DB: ?frees query result buffer (tracked free) after ENTITY_MASK-folded room query prototype: db/protos.zhl */ void __thiscall EntityList_Query::~EntityList_Query(void *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11c0; local_10 = ExceptionList; ExceptionList = &local_10; if (*(char *)this == '\0') { local_8 = 0; tracked_alloc(1,*(void **)((int)this + 4),0); } ExceptionList = local_10; return; } //@@ 00417610 FUN_00417610 undefined4 FUN_00417610(int param_1) { int in_ECX; return *(undefined4 *)(*(int *)(in_ECX + 4) + param_1 * 4); } //@@ 00417620 std::vector::operator_index /* DB: returns begin+i*4; tiny, ICF-foldable */ int std::vector::operator_index(int param_1) { int in_ECX; return *(int *)(in_ECX + 4) + param_1 * 4; } //@@ 00417630 EntityList_EL::push_back /* DB: EL: not enough space for push_back */ void EntityList_EL::push_back(undefined4 param_1) { int in_ECX; int iVar1; iVar1 = *(int *)(in_ECX + 0xc); if (*(uint *)(in_ECX + 8) < iVar1 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar1 = *(int *)(in_ECX + 0xc); } *(undefined4 *)(*(int *)(in_ECX + 4) + iVar1 * 4) = param_1; *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 1; return; } //@@ 00417670 EntityList_EL::remove /* DB: removes every occurrence of the entity pointer from the EL array (+4 data, +0xc count) by shifting down, "EL: invalid index for remove" assert; EntityList::AddEntity, PlayerManager::RemoveCoPlayer, Game::rewind prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntityList_EL::remove(EntityList_EL *this,Entity *entity) { undefined4 *puVar1; uint uVar2; uint uVar3; uint uVar4; uVar4 = 0; uVar3 = this->_size; if (uVar3 != 0) { do { if (*(Entity **)((int)this->_data + uVar4 * 4) == entity) { while ((uVar4 < uVar3 && (*(Entity **)((int)this->_data + uVar4 * 4) == entity))) { if (uVar3 <= uVar4) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar3 = this->_size; } uVar2 = uVar4; if (uVar4 < uVar3 - 1) { do { puVar1 = (undefined4 *)((int)this->_data + uVar2 * 4); uVar2 = uVar2 + 1; *puVar1 = puVar1[1]; uVar3 = this->_size; } while (uVar2 < uVar3 - 1); } uVar3 = uVar3 - 1; this->_size = uVar3; } } else { uVar4 = uVar4 + 1; } } while (uVar4 < uVar3); } return; } //@@ 004176f0 EntityList::Size /* ZHL [lua] Lua binding EntityList:Size */ undefined4 EntityList::Size(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0xc); } //@@ 00417700 FUN_00417700 bool FUN_00417700(void) { int in_ECX; return *(int *)(in_ECX + 0xc) == 0; } //@@ 00417710 FUN_00417710 void FUN_00417710(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af13e0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; local_8 = 0; in_ECX[4] = 0; in_ECX[5] = 0; if ((uint)((int)in_ECX[3] / 0x38) < 0x200) { FUN_0041c840(in_ECX[3]); } ExceptionList = local_10; return; } //@@ 004177c0 Entity_Tear::TearFlags /* ZHL [lua] Lua binding EntityTear:TearFlags prototype: db/protos.zhl, confirmed by RET 4 */ BitSet128 * __thiscall Entity_Tear::TearFlags(Entity_Tear *this,BitSet128 *outFlags) { undefined4 uVar1; undefined4 uVar2; qword qVar3; uVar1 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); qVar3 = (this->_tearFlags)._h; uVar2 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); *(int *)&outFlags->_l = (int)(this->_tearFlags)._l; *(undefined4 *)((int)&outFlags->_l + 4) = uVar1; *(int *)&outFlags->_h = (int)qVar3; *(undefined4 *)((int)&outFlags->_h + 4) = uVar2; return outFlags; } //@@ 004177e0 FUN_004177e0 void * FUN_004177e0(void *param_1) { int in_ECX; shared_ptr::assign(param_1,(void *)(in_ECX + 0x1bc8)); return param_1; } //@@ 00417800 Entity_Player::GetMainTwin /* ZHL [lua] Lua binding EntityPlayer:GetMainTwin prototype: db/protos.zhl */ Entity_Player * __thiscall Entity_Player::GetMainTwin(Entity_Player *this) { EntityPtr EVar1; EVar1 = this->_twinPlayer; if (((EVar1 == (EntityPtr)0x0) || (*(int *)((int)EVar1 + 0x161c) == -1)) || (this->_playerIndex <= *(int *)((int)EVar1 + 0x161c))) { EVar1 = (EntityPtr)this; } return (Entity_Player *)EVar1; } //@@ 00417820 Entity_Player::GetOtherTwin /* ZHL [lua] Lua binding EntityPlayer:GetOtherTwin */ EntityPtr __thiscall Entity_Player::GetOtherTwin(Entity_Player *this) { return this->_twinPlayer; } //@@ 00417830 Entity_Projectile::ProjectileFlags /* ZHL [lua] Lua binding EntityProjectile:ProjectileFlags prototype: db/protos.zhl */ ulonglong __thiscall Entity_Projectile::ProjectileFlags(Entity_Projectile *this) { return this->_projectileFlags; } //@@ 00417840 std::vector::size /* DB: (end-begin)>>2, ICF-folded prototype: db/protos.zhl */ int __thiscall std::vector::size(void *this) { return *(int *)((int)this + 4) - *(int *)this >> 2; } //@@ 00417850 Game::GetField26614 /* DB: ? returns &Game+0x26614 (counter compared <2 in many places) prototype: db/protos.zhl */ DeathmatchManager * __thiscall Game::GetField26614(Game *this) { return &g_game->_deathmatchManager; } //@@ 00417860 Game::GetPlayerManager /* DB: returns Game+0x1baa8 _playerManager */ PlayerManager * __thiscall Game::GetPlayerManager(Game *this) { return &this->_playerManager; } //@@ 00417870 Game::GetPlayer /* ZHL [exact] __thiscall Entity_Player* Game::GetPlayer(unsigned int Index); prototype: REPENTOGON, confirmed by RET 4 */ Entity_Player * __thiscall Game::GetPlayer(Game *this,uint Index) { void *pvVar1; undefined4 *puVar2; pvVar1 = (this->_playerManager)._playerList._end; puVar2 = (this->_playerManager)._playerList._begin; if ((int)pvVar1 - (int)puVar2 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar1 = (this->_playerManager)._playerList._end; puVar2 = (this->_playerManager)._playerList._begin; } if (Index < (uint)((int)pvVar1 - (int)puVar2 >> 2)) { return (Entity_Player *)puVar2[Index]; } return (Entity_Player *)*puVar2; } //@@ 004178d0 Game::GetNumPlayers /* ZHL [exact] __thiscall int Game::GetNumPlayers(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Game::GetNumPlayers(Game *this) { return (int)(this->_playerManager)._playerList._end - (int)(this->_playerManager)._playerList._begin >> 2; } //@@ 004178e0 Game::GetHUD /* ZHL [lua] Lua binding Game:GetHUD */ HUD * __thiscall Game::GetHUD(Game *this) { return &this->_hud; } //@@ 004178f0 FUN_004178f0 undefined4 FUN_004178f0(void) { int *in_ECX; return CONCAT31((int3)((uint)*in_ECX >> 8),*in_ECX != in_ECX[1]); } //@@ 00417900 FUN_00417900 OptionsConfig * FUN_00417900(void) { return &g_manager->_optionsConfig; } //@@ 00417910 FUN_00417910 EntityConfig * FUN_00417910(void) { return &g_manager->_entityConfig; } //@@ 00417920 FUN_00417920 int FUN_00417920(void) { int in_ECX; return in_ECX + 0x4b3d8; } //@@ 00417930 Room::init_render_buffers /* DB: ? Room::constructor helper: allocates 4 buffers (0x4000/0x100/0x800/0x4000 entries), EntityList::Reset, Manager::LoadImage gfx/shadow.png */ Room * __thiscall Room::init_render_buffers(Room *this) { char isLastRef; void *pvVar1; undefined4 firstSubList; int iVar2; float fVar3; undefined1 shadowImage [4]; void **local_18; Room *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void **mapHeadSlot; local_8 = 0xffffffff; puStack_c = &LAB_00af151b; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined1 *)&(this->_bottomRightPos).y = 0; this->_gridEntities[1] = (void *)0x4000; this->_gridEntities[2] = (void *)0x0; local_14 = this; pvVar1 = operator_new_tracked(0x10000); this->_gridEntities[0] = pvVar1; local_8 = 0; *(undefined1 *)(this->_gridEntities + 3) = 0; this->_gridEntities[5] = (void *)0x100; this->_gridEntities[6] = (void *)0x0; pvVar1 = operator_new_tracked(0x400); this->_gridEntities[4] = pvVar1; local_8._0_1_ = 1; *(undefined1 *)(this->_gridEntities + 7) = 0; this->_gridEntities[9] = (void *)0x800; this->_gridEntities[10] = (void *)0x0; pvVar1 = operator_new_tracked(0x2000); this->_gridEntities[8] = pvVar1; local_8._0_1_ = 2; *(undefined1 *)(this->_gridEntities + 0xb) = 0; this->_gridEntities[0xd] = (void *)0x4000; this->_gridEntities[0xe] = (void *)0x0; pvVar1 = operator_new_tracked(0x10000); this->_gridEntities[0xc] = pvVar1; local_8._0_1_ = 3; *(undefined1 *)(this->_gridEntities + 0xf) = 0; this->_gridEntities[0x11] = (void *)0x4000; this->_gridEntities[0x12] = (void *)0x0; pvVar1 = operator_new_tracked(0x10000); this->_gridEntities[0x10] = pvVar1; local_8._0_1_ = 4; *(undefined1 *)(this->_gridEntities + 0x13) = 0; this->_gridEntities[0x15] = (void *)0x4000; this->_gridEntities[0x16] = (void *)0x0; pvVar1 = operator_new_tracked(0x10000); this->_gridEntities[0x14] = pvVar1; local_8._0_1_ = 5; *(undefined1 *)(this->_gridEntities + 0x17) = 0; this->_gridEntities[0x19] = (void *)0x8000; this->_gridEntities[0x1a] = (void *)0x0; pvVar1 = operator_new_tracked(0x20000); this->_gridEntities[0x18] = pvVar1; local_8._0_1_ = 6; *(undefined1 *)(this->_gridEntities + 0x1b) = 0; this->_gridEntities[0x1d] = (void *)0x100; this->_gridEntities[0x1e] = (void *)0x0; pvVar1 = operator_new_tracked(0x400); this->_gridEntities[0x1c] = pvVar1; this->_gridEntities[0x28] = (void *)0x0; this->_gridEntities[0x29] = (void *)0x0; this->_gridEntities[0x2a] = (void *)0x0; this->_gridEntities[0x2b] = (void *)0x0; this->_gridEntities[0x2d] = (void *)0x0; this->_gridEntities[0x2e] = (void *)0x0; local_8._0_1_ = 9; mapHeadSlot = this->_gridEntities + 0x2f; *mapHeadSlot = (void *)0x0; this->_gridEntities[0x30] = (void *)0x0; local_18 = mapHeadSlot; pvVar1 = operator_new(0x2c); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *mapHeadSlot = pvVar1; local_8._0_1_ = 10; local_18 = this->_gridEntities + 0x35; this->_gridEntities[0x34] = (void *)0x1; this->_gridEntities[0x31] = (void *)0x0; *(undefined1 *)(this->_gridEntities + 0x32) = 0; this->_gridEntities[0x33] = (void *)0xfedcba76; _eh_vector_constructor_iterator_ (local_18,0x18,0x20,FUN_00417710,(_func_void_void_ptr *)&LAB_004177b0); this->_gridEntities[0xf5] = (void *)0x0; this->_gridEntities[0xf6] = (void *)0x0; local_8._0_1_ = 0xb; local_18 = operator_new(0x24); local_8._0_1_ = 0xc; if (local_18 == (void *)0x0) { firstSubList = 0; } else { firstSubList = FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; *(undefined4 *)this = firstSubList; local_18 = operator_new(0x24); local_8._0_1_ = 0xd; if (local_18 == (void *)0x0) { pvVar1 = (void *)0x0; } else { pvVar1 = (void *)FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; this->_descriptor = pvVar1; local_18 = operator_new(0x24); local_8._0_1_ = 0xe; if (local_18 == (void *)0x0) { iVar2 = 0; } else { iVar2 = FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; this->_roomType = iVar2; local_18 = operator_new(0x24); local_8._0_1_ = 0xf; if (local_18 == (void *)0x0) { iVar2 = 0; } else { iVar2 = FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; this->_gridWidth = iVar2; local_18 = operator_new(0x24); local_8._0_1_ = 0x10; if (local_18 == (void *)0x0) { iVar2 = 0; } else { iVar2 = FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; this->_gridHeight = iVar2; local_18 = operator_new(0x24); local_8._0_1_ = 0x11; if (local_18 == (void *)0x0) { fVar3 = 0.0; } else { fVar3 = (float)FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; (this->_topLeftPos).x = fVar3; local_18 = operator_new(0x24); local_8._0_1_ = 0x12; if (local_18 == (void *)0x0) { fVar3 = 0.0; } else { fVar3 = (float)FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; (this->_topLeftPos).y = fVar3; local_18 = operator_new(0x24); local_8._0_1_ = 0x13; if (local_18 == (void **)0x0) { fVar3 = 0.0; } else { fVar3 = (float)FUN_0041b9f0(this,0x44340000); } local_8._0_1_ = 0xb; (this->_bottomRightPos).x = fVar3; pvVar1 = Manager::LoadImage(shadowImage,(byte *)"gfx/shadow.png"); local_8._0_1_ = 0x14; KAGE::SmartPointer::operator_assign(this->_gridEntities + 0x2d,pvVar1); local_8._0_1_ = 0x15; if (local_18 != (void **)0x0) { isLastRef = (**(code **)((int)*local_18 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(shadowImage); } } local_8 = CONCAT31(local_8._1_3_,0xb); this->_gridEntities[0x2c] = (void *)0x0; EntityList::Reset((EntityList *)this); ExceptionList = local_10; return this; } //@@ 00417dd0 FUN_00417dd0 void FUN_00417dd0(void) { int *in_ECX; std::map::destroy_subtree(in_ECX,in_ECX,*(void **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x2c); return; } //@@ 00417df0 FUN_00417df0 void FUN_00417df0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x18,0x20,(_func_void_void_ptr *)&LAB_004177b0); ExceptionList = local_10; return; } //@@ 00417e50 FUN_00417e50 void FUN_00417e50(void) { undefined4 *this; void *pvVar1; int iVar2; qword qVar3; char cVar4; undefined4 *in_ECX; qword *pqVar5; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1540; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00aefe20(__security_cookie ^ (int)register0x00000010 - 4U); KAGE_LogMessage(1,(byte *)"CPU time spent on enemy queries: %.2f seconds.\n"); pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[2]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[3]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[4]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[5]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[6]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } pvVar1 = (void *)in_ECX[7]; if (pvVar1 != (void *)0x0) { FUN_0041c670(); operator_delete(pvVar1,0x24); } uVar6 = 0; if (in_ECX[0xb] != 0) { do { (**(code **)(**(int **)(in_ECX[9] + uVar6 * 4) + 0x44))(); *(undefined1 *)(*(int *)(in_ECX[9] + uVar6 * 4) + 0x170) = 0; (**(code **)(**(int **)(in_ECX[9] + uVar6 * 4) + 0x28))(); uVar6 = uVar6 + 1; } while (uVar6 < (uint)in_ECX[0xb]); } uVar6 = 0; in_ECX[0xb] = 0; in_ECX[0x1b] = 0; if (in_ECX[0xf] != 0) { do { (**(code **)(**(int **)(in_ECX[0xd] + uVar6 * 4) + 0x44))(); *(undefined1 *)(*(int *)(in_ECX[0xd] + uVar6 * 4) + 0x170) = 0; (**(code **)(**(int **)(in_ECX[0xd] + uVar6 * 4) + 0x28))(); uVar6 = uVar6 + 1; } while (uVar6 < (uint)in_ECX[0xf]); } in_ECX[0xf] = 0; in_ECX[0x27] = 0; KAGE::SmartPointer::reset(in_ECX + 0x36,(void *)0x0); uStack_8 = 0; _eh_vector_destructor_iterator_(in_ECX + 0x3e,0x18,0x20,(_func_void_void_ptr *)&LAB_004177b0); this = in_ECX + 0x38; std::map::destroy_subtree(this,this,*(void **)(in_ECX[0x38] + 4)); operator_delete((void *)*this,0x2c); uStack_8 = 1; if ((((int *)in_ECX[0x37] != (int *)0x0) && (cVar4 = (**(code **)(*(int *)in_ECX[0x37] + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } FID_conflict__Tidy(in_ECX + 0x31); if (*(char *)(in_ECX + 0x24) == '\0') { iVar2 = in_ECX[0x25]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 0x20) == '\0') { iVar2 = in_ECX[0x21]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 0x1c) == '\0') { iVar2 = in_ECX[0x1d]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 0x18) == '\0') { iVar2 = in_ECX[0x19]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 0x14) == '\0') { iVar2 = in_ECX[0x15]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 0x10) == '\0') { iVar2 = in_ECX[0x11]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 0xc) == '\0') { iVar2 = in_ECX[0xd]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } if (*(char *)(in_ECX + 8) == '\0') { iVar2 = in_ECX[9]; pqVar5 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)(iVar2 + -4)); } } ExceptionList = local_10; return; } //@@ 00418230 EntityList::Reset /* ZHL [exact] __thiscall void EntityList::Reset(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall EntityList::Reset(EntityList *this) { int *piVar1; int iVar2; int wispIndex; uint i; Manager *manager; undefined4 movedEntity; iVar2 = 0; i = 0; (this->_updateEL)._size = 0; (this->_renderEL)._size = 0; *(undefined4 *)&this->field_0x6c = 0; if ((this->_mainEL)._size != 0) { do { piVar1 = *(int **)((int)(this->_mainEL)._data + i * 4); if ((piVar1[0x5b] & 0x20U) == 0) { (**(code **)(*piVar1 + 0x44))(); *(undefined1 *)(*(int *)((int)(this->_mainEL)._data + i * 4) + 0x170) = 0; (**(code **)(**(int **)((int)(this->_mainEL)._data + i * 4) + 0x28))(); } else { iVar2 = (this->_updateEL)._size; if ((uint)(this->_updateEL)._capacity < iVar2 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar2 = (this->_updateEL)._size; } *(int **)((int)(this->_updateEL)._data + iVar2 * 4) = piVar1; piVar1 = &(this->_updateEL)._size; *piVar1 = *piVar1 + 1; iVar2 = (this->_renderEL)._size; movedEntity = *(undefined4 *)((int)(this->_mainEL)._data + i * 4); if ((uint)(this->_renderEL)._capacity < iVar2 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar2 = (this->_renderEL)._size; } *(undefined4 *)((int)(this->_renderEL)._data + iVar2 * 4) = movedEntity; piVar1 = &(this->_renderEL)._size; *piVar1 = *piVar1 + 1; } i = i + 1; } while (i < (uint)(this->_mainEL)._size); iVar2 = (this->_updateEL)._size; } i = 0; (this->_mainEL)._size = 0; (this->_wispEL)._size = 0; if (iVar2 != 0) { iVar2 = 0; do { movedEntity = *(undefined4 *)((int)(this->_updateEL)._data + i * 4); if ((uint)(this->_mainEL)._capacity < iVar2 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar2 = (this->_mainEL)._size; } i = i + 1; *(undefined4 *)((int)(this->_mainEL)._data + iVar2 * 4) = movedEntity; piVar1 = &(this->_mainEL)._size; *piVar1 = *piVar1 + 1; iVar2 = (this->_mainEL)._size; } while (i < (uint)(this->_updateEL)._size); } i = 0; if ((this->_persistentEL)._size != 0) { do { iVar2 = (this->_updateEL)._size; movedEntity = *(undefined4 *)((int)(this->_persistentEL)._data + i * 4); if ((uint)(this->_updateEL)._capacity < iVar2 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar2 = (this->_updateEL)._size; } *(undefined4 *)((int)(this->_updateEL)._data + iVar2 * 4) = movedEntity; piVar1 = &(this->_updateEL)._size; *piVar1 = *piVar1 + 1; iVar2 = (this->_renderEL)._size; movedEntity = *(undefined4 *)((int)(this->_persistentEL)._data + i * 4); if ((uint)(this->_renderEL)._capacity < iVar2 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar2 = (this->_renderEL)._size; } i = i + 1; *(undefined4 *)((int)(this->_renderEL)._data + iVar2 * 4) = movedEntity; piVar1 = &(this->_renderEL)._size; *piVar1 = *piVar1 + 1; } while (i < (uint)(this->_persistentEL)._size); } i = 0; if ((this->_updateEL)._size != 0) { do { iVar2 = *(int *)((int)(this->_updateEL)._data + i * 4); if ((*(int *)(iVar2 + 0x28) == 3) && (*(int *)(iVar2 + 0x2c) == 0xce)) { wispIndex = (this->_wispEL)._size; if ((uint)(this->_wispEL)._capacity < wispIndex + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); wispIndex = (this->_wispEL)._size; } *(int *)((int)(this->_wispEL)._data + wispIndex * 4) = iVar2; piVar1 = &(this->_wispEL)._size; *piVar1 = *piVar1 + 1; } i = i + 1; } while (i < (uint)(this->_updateEL)._size); } iVar2 = this[1]._persistentEL._capacity; piVar1 = &this[1]._persistentEL._capacity; this->_renderCursor = 0; this->_renderMode = 0; *(undefined4 *)(this + 1) = 0; *(undefined4 *)&this[1].field_0x4 = 0; *(undefined4 *)&this[1].field_0x8 = 0; *(undefined4 *)&this[1].field_0xc = 0; *(undefined4 *)&this[1].field_0x10 = 0; *(undefined4 *)&this[1].field_0x14 = 0; *(undefined4 *)&this[1].field_0x18 = 0; std::map::destroy_subtree(piVar1,piVar1,*(void **)(iVar2 + 4)); manager = g_manager; *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; this[1]._persistentEL._size = 0; *(undefined4 *)&this->field_0x8c = 0; *(undefined4 *)&this[1]._updateEL = 0; *(undefined1 *)&this[1]._updateEL._data = 0; this[1]._updateEL._capacity = -0x123458a; if (((manager->_netplayManager != *(NetplayManager *)(manager + 1)) && (*(int *)&this[6].field_0xc != 0)) && ((uint)manager[1]._state < *(uint *)((int)&this[1]._renderEL + (*(uint *)&this[6].field_0x8 & 0x1f) * 0x18))) { *(undefined4 *)&this[6].field_0xc = 0; *(undefined4 *)&this[6].field_0x8 = 0; } return; } //@@ 00418500 EntityList::AddEntity /* DB: "EL: not enough space for push_back" into entity lists prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntityList::AddEntity(EntityList *this,Entity *entity) { int *piVar1; undefined4 *puVar2; Entity *pEVar3; char cVar4; uint uVar5; uint uVar6; int iVar7; Entity *pEVar8; Entity *pEVar9; bool bVar10; pEVar3 = entity; if (entity->_valid == 0) { iVar7 = entity->_type; if (((iVar7 == 1) || (iVar7 == 3)) || ((iVar7 == 8 && (entity->_subtype == 0)))) { iVar7 = (this->_persistentEL)._size; if ((uint)(this->_persistentEL)._capacity < iVar7 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar7 = (this->_persistentEL)._size; } *(Entity **)((int)(this->_persistentEL)._data + iVar7 * 4) = entity; piVar1 = &(this->_persistentEL)._size; *piVar1 = *piVar1 + 1; } else { EntityList_EL::push_back(entity); } cVar4 = (**(code **)(*(int *)entity + 0x48))(); if ((cVar4 != '\0') && (entity->_type != 0x362)) { *(int *)(this + 1) = *(int *)(this + 1) + 1; cVar4 = (**(code **)(*(int *)entity + 0x4c))(); if (cVar4 != '\0') { *(int *)&this[1].field_0x8 = *(int *)&this[1].field_0x8 + 1; } } entity->_valid = 1; entity = (Entity *)0x0; pEVar9 = (Entity *)0x0; if ((this->_renderEL)._size != 0) { do { uVar5 = (**(code **)(**(int **)((int)(this->_renderEL)._data + (int)entity * 4) + 0x34))(); uVar6 = (**(code **)(*(int *)pEVar3 + 0x34))(); pEVar9 = entity; if (uVar6 <= uVar5) break; pEVar9 = (Entity *)&entity->field_0x1; entity = pEVar9; } while (pEVar9 < (undefined1 *)(this->_renderEL)._size); } pEVar8 = (Entity *)(this->_renderEL)._size; if ((undefined1 *)(this->_renderEL)._capacity < &pEVar8->field_0x1) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for insert\n"); pEVar8 = (Entity *)(this->_renderEL)._size; } bVar10 = false; if (pEVar8 < pEVar9) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for insert\n"); pEVar8 = (Entity *)(this->_renderEL)._size; bVar10 = pEVar8 < pEVar9; } if (!bVar10 && pEVar8 != pEVar9) { do { puVar2 = (undefined4 *)((int)(this->_renderEL)._data + (int)pEVar8 * 4); pEVar8 = (Entity *)((int)&pEVar8[-1]._luaBridgeRef + 3); *puVar2 = puVar2[-1]; } while (pEVar9 < pEVar8); } *(Entity **)((int)(this->_renderEL)._data + (int)pEVar9 * 4) = pEVar3; piVar1 = &(this->_renderEL)._size; *piVar1 = *piVar1 + 1; if ((pEVar3->_type == 3) && (pEVar3->_variant == 0xce)) { iVar7 = (this->_wispEL)._size; if ((uint)(this->_wispEL)._capacity < iVar7 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar7 = (this->_wispEL)._size; } *(Entity **)((int)(this->_wispEL)._data + iVar7 * 4) = pEVar3; piVar1 = &(this->_wispEL)._size; *piVar1 = *piVar1 + 1; } } else { EntityList_EL::remove(&this->_updateEL,entity); } if ((pEVar3->_flags & 8) == 0) { iVar7 = (this->_updateEL)._size; if ((uint)(this->_updateEL)._capacity < iVar7 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar7 = (this->_updateEL)._size; } *(Entity **)((int)(this->_updateEL)._data + iVar7 * 4) = pEVar3; piVar1 = &(this->_updateEL)._size; *piVar1 = *piVar1 + 1; } invalidate_type_cache(this,pEVar3->_type,pEVar3->_variant,pEVar3->_subtype); return; } //@@ 004186c0 EntityList::Update /* DB: "EntityList: e_update is empty!", "EL: invalid index for remove"; iterates update list calling Entity vtable +0xc (Update); callers Room::Update, Game::update_pending_pickup_animations prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntityList::Update(EntityList *this,byte isTransition) { float fVar1; int iVar2; undefined4 uVar3; EntityList *pEVar4; char cVar5; byte isAnyWallEntity; uint uVar7; uint extraout_EAX; EntityConfig_Entity *configEntry; EntityPtr *pEVar8; float *pfVar9; undefined4 *puVar10; EntityPtr EVar11; EntityPtr EVar12; void *checksum; void *player; void *this_02; void *this_03; void *this_04; void *this_05; void *pvVar13; Game *game; EntityPtr extraout_EDX; uint uVar14; PlayerManager *playerManager; int *piVar15; uint uVar16; EntityList *curList; EntityPtr EVar17; EntityPtr EVar18; EntityPtr EVar19; EntityPtr EVar20; float bossHpFill; EntityPtr EVar21; EntityPtr EVar22; EntityPtr EVar23; double dVar24; EntityPtr local_c0; EntityPtr EStack_bc; EntityPtr EStack_b8; EntityPtr EStack_b4; EntityPtr local_b0; EntityPtr EStack_ac; EntityPtr EStack_a8; EntityPtr EStack_a4; EntityPtr EStack_a0; EntityPtr EStack_9c; EntityPtr EStack_98; EntityPtr EStack_94; EntityPtr local_90; EntityPtr EStack_8c; undefined4 local_88; int local_84; NetplayManager netplayEnd; int *checksumRecord; int activeEnemyCount; float bossMaxHealth; undefined8 local_70; NetplayManager local_64; EntityPtr prevHealth; EntityPtr local_5c; uint isListDirty; int bossCount; EntityList *entityList; float local_4c; EntityPtr local_48; EntityPtr curEntity; float local_40; EntityPtr local_3c; EntityPtr local_38; float local_34; void *renderTarget; EntityPtr local_2c [2]; bool isWallPass; bool local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; EntityPtr local_14; EntityList_EL *checksum; bool isAnyFloorEntity; bool isAnyWallEntity; Manager *manager; Entity *player; undefined1 *storedBossMaxHp; manager = g_manager; puStack_20 = (undefined1 *)(local_2c + 10); local_14 = (EntityPtr)0xffffffff; puStack_18 = &LAB_00af1575; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_2c + 7); ExceptionList = &local_1c; checksumRecord = (int *)0x0; local_64 = g_manager->_netplayManager; netplayEnd = *(NetplayManager *)(g_manager + 1); if (local_64 != netplayEnd) { *(undefined4 *)&this[1]._updateEL = 0; *(undefined1 *)&this[1]._updateEL._data = 0; this[1]._updateEL._capacity = -0x123458a; uVar16 = *(uint *)&this[6].field_0xc; uVar14 = *(uint *)&this[6].field_0x8; if (uVar16 < 0x20) { *(uint *)&this[6].field_0xc = uVar16 + 1; uVar14 = uVar14 + uVar16 & 0x1f; } else { *(uint *)&this[6].field_0x8 = uVar14 + 1 & 0x1f; } checksumRecord = (int *)((int)&this[1]._renderEL + uVar14 * 0x18); checksumRecord[2] = checksumRecord[1]; *checksumRecord = manager[1]._state; } iVar2 = this[1]._persistentEL._capacity; piVar15 = &this[1]._persistentEL._capacity; entityList = this; std::map::destroy_subtree(piVar15,piVar15,*(void **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; isListDirty = extraout_EAX & 0xffffff00; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; this[1]._persistentEL._size = 0; local_40 = 0.0; activeEnemyCount = 0; EVar11 = (EntityPtr)(entityList->_updateEL)._size; *(undefined4 *)&entityList->field_0x8c = 0; bossCount = 0; local_4c = 0.0; bossMaxHealth = 0.0; local_34 = 0.0; local_38 = (EntityPtr)0x0; local_48 = *(EntityPtr *)((int)(entityList->_updateEL)._data + (int)EVar11 * 4 + -4); curList = entityList; do { EVar12 = local_38; if (EVar11 == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"EntityList: e_update is empty!\n"); EVar11 = (EntityPtr)(curList->_updateEL)._size; } pEVar4 = entityList; EVar12 = *(EntityPtr *)((int)(curList->_updateEL)._data + (int)EVar12 * 4); if (*(char *)((int)EVar12 + 0x172) != '\0') { local_3c = *(EntityPtr *)((int)EVar12 + 0x16c); curList = pEVar4; if ((((*(uint *)((int)EVar12 + 0x168) & 8) == 0) || ((*(uint *)((int)EVar12 + 0x168) & 0x20000) != 0)) && ((isTransition == 0 || (local_3c = (EntityPtr)((uint)local_3c & 0x1000), local_3c != (EntityPtr)0x0)))) { (**(code **)(*(int *)EVar12 + 8))(uVar7); EVar11 = (EntityPtr)(pEVar4->_updateEL)._size; } } local_38 = (EntityPtr)((int)local_38 + 1); curEntity = EVar11; } while ((EVar12 != local_48) && ((uint)local_38 < (uint)EVar11)); local_3c = (EntityPtr)0x0; if (EVar12 == local_48) { } do { if (EVar11 == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"EntityList: e_update is empty!\n"); } prevHealth = (EntityPtr)0x0; EVar11 = *(EntityPtr *)((int)(curList->_updateEL)._data + (int)local_3c * 4); curEntity = EVar11; local_38 = (EntityPtr)((int)EVar11 + 0x28); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(EntityPtr *)local_38 != (EntityPtr)0x1)) { if ((int)*(EntityPtr *)local_38 - 10U < 0x3de) { if (*(EntityPtr *)local_38 == (EntityPtr)0x1) goto LAB_004188e4; prevHealth = *(EntityPtr *)((int)EVar11 + 0xc5c); goto LAB_0041890f; } } else { LAB_004188e4: prevHealth = (EntityPtr) (float)((double)*(int *)((int)EVar11 + 0x16b0) + __uint_to_double_fixup[-(*(int *)((int)EVar11 + 0x16b0) >> 0x1f)]); LAB_0041890f: } if (*(byte *)((int)EVar11 + 0x172) != 0) { if ((((((*(uint *)((int)EVar11 + 0x168) & 8) != 0) && ((*(uint *)((int)EVar11 + 0x168) & 0x20000) == 0)) || ((isTransition != 0 && ((*(uint *)((int)EVar11 + 0x16c) & 0x1000) == 0)))) || ((**(code **)(*(int *)EVar11 + 0xc))(), *(byte *)((int)EVar11 + 0x172) != 0)) && (*(EntityPtr *)local_38 != (EntityPtr)0x362)) { cVar5 = (**(code **)(*(int *)EVar11 + 0x48))(); if (cVar5 != '\0') { activeEnemyCount = activeEnemyCount + 1; cVar5 = (**(code **)(*(int *)EVar11 + 0x4c))(); if (cVar5 != '\0') { local_2c[0] = *(EntityPtr *)((int)EVar11 + 0x16c); if ((*(uint *)((int)EVar11 + 0x168) & 0x100000) == 0) { EVar12 = (EntityPtr)(*(uint *)((int)EVar11 + 0x168) & 0x80000000); if (EVar12 == (EntityPtr)0x0) { bossCount = bossCount + 1; } if ((0 < g_game->_frameCount - *(int *)((int)EVar11 + 0x328)) && (EVar12 == (EntityPtr)0x0)) { local_5c = EVar12; local_2c[0] = *(EntityPtr *)((int)EVar11 + 0x380); pEVar8 = &local_5c; if (0.0 <= (float)*(EntityPtr *)((int)EVar11 + 0x380)) { pEVar8 = local_2c; } local_4c = local_4c + (float)*pEVar8; bossMaxHealth = *(float *)((int)EVar11 + 900) + bossMaxHealth; } } } if ((((*(EntityPtr *)local_38 == (EntityPtr)0x3e8) && (*(int *)((int)EVar11 + 0x2c) == 0xcb)) && (configEntry = EntityConfig::GetEntity (&g_manager->_entityConfig,*(uint *)((int)EVar11 + 0x47c), *(uint *)((int)EVar11 + 0x480),*(int *)((int)EVar11 + 0x498) ), configEntry != (EntityConfig_Entity *)0x0)) && (configEntry->isBoss != 0)) { bossCount = bossCount + 1; } } cVar5 = (**(code **)(*(int *)EVar11 + 0x48))(); if ((cVar5 != '\0') || (*(EntityPtr *)local_38 == (EntityPtr)0x3c3)) { local_2c[0] = *(EntityPtr *)&g_game->_deathmatchManager; if (((int)*(EntityPtr *)&g_game->_deathmatchManager < 2) || (*(EntityPtr *)local_38 != (EntityPtr)0x1)) { EVar12 = *(EntityPtr *)local_38; if ((0x3dd < (int)EVar12 - 10U) && (EVar12 != (EntityPtr)0x3c3)) goto LAB_00418ba8; } else { EVar12 = (EntityPtr)0x1; } if ((*(uint *)((int)EVar11 + 0x168) & 0x20000000) == 0) { if (EVar12 == (EntityPtr)0x3e) { isAnyWallEntity = Entity::DoesEntityShareStatus((Entity *)EVar11); EVar12 = extraout_EDX; if ((isAnyWallEntity != 0) && (EVar23 = *(EntityPtr *)((int)EVar11 + 0x3bc), *(EntityPtr *)((int)EVar11 + 0x3bc) != (EntityPtr)0x0)) { do { EVar21 = EVar23; EVar23 = *(EntityPtr *)((int)EVar21 + 0x3bc); } while (EVar23 != (EntityPtr)0x0); if (EVar21 != EVar11) goto LAB_00418ba8; } } local_5c = (EntityPtr)0x0; if (((int)local_2c[0] < 2) || (EVar12 != (EntityPtr)0x1)) { if ((int)EVar12 - 10U < 0x3de) { if (EVar12 == (EntityPtr)0x1) goto LAB_00418b25; local_5c = *(EntityPtr *)((int)EVar11 + 0xc5c); } } else { LAB_00418b25: local_5c = (EntityPtr) (float)((double)*(int *)((int)EVar11 + 0x16b0) + __uint_to_double_fixup[-(*(int *)((int)EVar11 + 0x16b0) >> 0x1f)]); } local_2c[0] = *(EntityPtr *)((int)EVar11 + 900); pEVar8 = &local_5c; if ((float)*(EntityPtr *)((int)EVar11 + 900) <= (float)local_5c) { pEVar8 = local_2c; } local_2c[0] = (EntityPtr)((float)*pEVar8 - (float)prevHealth); prevHealth = (EntityPtr)0x0; pEVar8 = local_2c; if ((float)local_2c[0] <= 0.0) { pEVar8 = &prevHealth; } local_34 = (float)*pEVar8 + local_34; } } } } LAB_00418ba8: isListDirty = isListDirty & 0xff; if (*(char *)((int)EVar11 + 0x172) == '\0') { isListDirty = 1; } if ((*(uint *)((int)EVar11 + 0x16c) & 0x100000) != 0) { local_40 = (float)((uint)local_40 | 1); } if (local_64 != netplayEnd) { local_88 = *(undefined4 *)((int)EVar11 + 0x33c); local_84 = *(int *)((int)EVar11 + 0x340); local_70 = *(ulonglong *)((int)EVar11 + 0x360); local_2c[0] = local_3c; Checksum::Update(&curList[1]._updateEL,(byte *)local_2c,4); local_2c[0] = *(EntityPtr *)local_38; Checksum::Update(checksum,(byte *)local_2c,4); local_2c[0] = *(EntityPtr *)((int)EVar11 + 0x2c); Checksum::Update(player,(byte *)local_2c,4); local_2c[0] = *(EntityPtr *)((int)EVar11 + 0x30); Checksum::Update(this_02,(byte *)local_2c,4); local_2c[0] = *(EntityPtr *)((int)EVar11 + 0x3dc); Checksum::Update(this_03,(byte *)local_2c,4); Checksum::Update(this_04,(byte *)&local_88,8); Checksum::Update(this_05,(byte *)&local_70,8); EVar12 = *(EntityPtr *)((int)EVar11 + 0x360); EVar23 = *(EntityPtr *)((int)EVar11 + 0x364); EVar21 = *(EntityPtr *)((int)EVar11 + 0x33c); EVar22 = *(EntityPtr *)((int)EVar11 + 0x340); EVar17 = *(EntityPtr *)((int)EVar11 + 0x38c); EVar18 = *(EntityPtr *)((int)EVar11 + 0x390); EVar19 = *(EntityPtr *)((int)EVar11 + 0x394); EVar20 = *(EntityPtr *)((int)EVar11 + 0x398); EStack_ac = (EntityPtr)get_mt_state_checksum(); local_b0 = *(EntityPtr *)((int)EVar11 + 0x3dc); EStack_b4 = *(EntityPtr *)((int)EVar11 + 0x30); EStack_b8 = *(EntityPtr *)((int)curEntity + 0x2c); EStack_bc = *(EntityPtr *)local_38; local_2c[0] = EStack_ac; local_c0 = local_3c; pEVar8 = (EntityPtr *)checksumRecord[2]; EStack_a8 = EVar17; EStack_a4 = EVar18; EStack_a0 = EVar19; EStack_9c = EVar20; EStack_98 = EVar21; EStack_94 = EVar22; local_90 = EVar12; EStack_8c = EVar23; if (pEVar8 == (EntityPtr *)checksumRecord[3]) { FUN_0041ccf0(pEVar8,&local_c0); } else { *pEVar8 = local_3c; pEVar8[1] = EStack_bc; pEVar8[2] = EStack_b8; pEVar8[3] = EStack_b4; pEVar8[4] = local_b0; pEVar8[5] = EStack_ac; pEVar8[6] = EVar17; pEVar8[7] = EVar18; pEVar8[8] = EVar19; pEVar8[9] = EVar20; pEVar8[10] = EVar21; pEVar8[0xb] = EVar22; pEVar8[0xc] = EVar12; pEVar8[0xd] = EVar23; checksumRecord[2] = checksumRecord[2] + 0x38; } EVar11 = curEntity; curList = entityList; } local_3c = (EntityPtr)((int)local_3c + 1); } while ((EVar11 != local_48) && (EVar11 = (EntityPtr)(curList->_updateEL)._size, (uint)local_3c < (uint)EVar11)); uVar7 = 0; if ((int)(g_game->_playerManager)._extraPlayers._end - (int)(g_game->_playerManager)._extraPlayers._begin >> 2 != 0) { do { (**(code **)(**(int **)((int)(g_game->_playerManager)._extraPlayers._begin + uVar7 * 4) + 0xc) )(); uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(g_game->_playerManager)._extraPlayers._end - (int)(g_game->_playerManager)._extraPlayers._begin >> 2)); } game = g_game; if ((g_manager->_optionsConfig)._enableInterpolation == 0) { playerManager = &g_game->_playerManager; local_48 = (EntityPtr)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar13 = (playerManager->_playerList)._end; if ((int)pvVar13 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar13 = (playerManager->_playerList)._end; } puVar10 = (playerManager->_playerList)._begin; if ((uint)local_48 < (uint)((int)pvVar13 - (int)puVar10 >> 2)) { puVar10 = puVar10 + (int)local_48; } player = (Entity *)*puVar10; if ((isTransition == 0) || ((player->_flags & 0x100000000000) != 0)) { uVar3 = *(undefined4 *)((int)&player->_flags + 4); *(uint *)&player->_flags = (uint)player->_flags | 0x4000; *(undefined4 *)((int)&player->_flags + 4) = uVar3; (**(code **)(*(int *)player + 0xc))(); Entity::PlayerCollideWithGrid(player,0); uVar3 = *(undefined4 *)((int)&player->_flags + 4); *(uint *)&player->_flags = (uint)player->_flags & 0xffffbfff; *(undefined4 *)((int)&player->_flags + 4) = uVar3; } local_48 = (EntityPtr)((int)local_48 + 1); playerManager = &g_game->_playerManager; } while ((uint)local_48 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } game = g_game; if ((int)(g_game->_playerManager)._extraPlayers._end - (int)(g_game->_playerManager)._extraPlayers._begin >> 2 != 0) { uVar7 = 0; do { piVar15 = *(int **)((int)(game->_playerManager)._extraPlayers._begin + uVar7 * 4); piVar15[0x5a] = piVar15[0x5a] | 0x4000; piVar15[0x5b] = piVar15[0x5b]; (**(code **)(*piVar15 + 0xc))(); game = g_game; uVar7 = uVar7 + 1; piVar15[0x5a] = piVar15[0x5a] & 0xffffbfff; piVar15[0x5b] = piVar15[0x5b]; } while (uVar7 < (uint)((int)(game->_playerManager)._extraPlayers._end - (int)(game->_playerManager)._extraPlayers._begin >> 2)); curList = entityList; } } storedBossMaxHp = &curList[1].field_0x10; *(int *)&curList[1].field_0x4 = *(int *)(curList + 1) + activeEnemyCount; iVar2 = *(int *)&curList[1].field_0x8; *(undefined4 *)(curList + 1) = 0; *(int *)&curList[1].field_0xc = iVar2 + bossCount; *(undefined4 *)&curList[1].field_0x8 = 0; *(float *)&curList[1].field_0x18 = local_40; if (bossCount < 1) { *(undefined4 *)storedBossMaxHp = 0; fVar1 = (game->_hud)._bossHPBarFill; if (-1.0 < fVar1) { (game->_hud)._bossHPBarDamageFlash = 8; } if ((fVar1 < -1.0) && (fVar1 != -1.0)) { (game->_hud)._bossHPBarDamageFlash = -1; (game->_hud)._bossHPBarHealFlash = 8; } (game->_hud)._bossHPBarFill = (float)&DAT_bf800000; } else { pfVar9 = &bossMaxHealth; if (bossMaxHealth < *(float *)storedBossMaxHp || bossMaxHealth == *(float *)storedBossMaxHp) { pfVar9 = (float *)storedBossMaxHp; } bossHpFill = local_4c / *pfVar9; *(float *)storedBossMaxHp = *pfVar9; fVar1 = (game->_hud)._bossHPBarFill; if (bossHpFill < fVar1) { (game->_hud)._bossHPBarDamageFlash = 8; } if ((fVar1 < bossHpFill) && (fVar1 != -1.0)) { (game->_hud)._bossHPBarDamageFlash = -1; (game->_hud)._bossHPBarHealFlash = 8; } (game->_hud)._bossHPBarFill = bossHpFill; } fVar1 = g_displayPixelRatio; *(float *)&curList[1].field_0x14 = local_34; local_34 = fVar1 * g_screenPointScale; local_40 = (g_screenHeight - 182.0) * 0.5 - 52.0; local_2c[0] = (EntityPtr)(local_34 * ((g_screenWidth - 338.0) * 0.5 - 52.0) + 0.5); dVar24 = floor((double)(float)local_2c[0]); local_4c = (float)dVar24 / local_34; local_2c[0] = (EntityPtr)(local_34 * local_40 + 0.5); dVar24 = floor((double)(float)local_2c[0]); local_2c[0] = (EntityPtr)(float)dVar24; local_40 = (float)local_2c[0] / local_34; isAnyWallEntity = false; isAnyFloorEntity = false; local_21 = false; isWallPass = false; local_34 = 0.0; if ((curList->_renderEL)._size != 0) { piVar15 = (curList->_renderEL)._data; do { iVar2 = *piVar15; if (*(char *)(iVar2 + 0x172) != '\0') { local_70 = CONCAT44(*(undefined4 *)(iVar2 + 0x16c),(undefined4)local_70); if ((*(uint *)(iVar2 + 0x168) & 8) != 0) { isAnyFloorEntity = true; local_21 = true; } if ((*(uint *)(iVar2 + 0x168) & 0x2000) != 0) { isAnyWallEntity = true; isWallPass = true; } if (isAnyFloorEntity) { if (isAnyWallEntity) goto LAB_0041915c; } } piVar15 = piVar15 + 1; local_34 = (float)((int)local_34 + 1); } while ((uint)local_34 < (uint)(curList->_renderEL)._size); isWallPass = isAnyWallEntity; local_21 = isAnyFloorEntity; if ((isAnyFloorEntity != false) || (isAnyWallEntity != false)) { LAB_0041915c: local_70 = 0; std::vector::resize(&local_70); puVar10 = std::deque::back(); if ((byte *)(puVar10 + 1) != (byte *)0x0) { *(byte *)(puVar10 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar10 = g_graphicsManager_renderTarget; uVar7 = g_graphicsManager_flags & 0xfffffffd; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; g_graphicsManager_flags = uVar7; if (local_21 != false) { shared_ptr::assign(&renderTarget,(void *)((int)g_game->_room + 0x1bc8)); local_14 = (EntityPtr)0x0; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,renderTarget,0); local_14 = (EntityPtr)0x1; if (((local_2c[0] != (EntityPtr)0x0) && (cVar5 = (**(code **)(*(int *)local_2c[0] + 0xc))(), cVar5 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } local_14 = (EntityPtr)0xffffffff; local_34 = 0.0; if ((curList->_renderEL)._size != 0) { do { piVar15 = *(int **)((int)(curList->_renderEL)._data + (int)local_34 * 4); if ((*(char *)((int)piVar15 + 0x172) != '\0') && ((piVar15[0x5a] & 8U) != 0)) { local_70 = CONCAT44(local_40,local_4c) ^ 0x8000000080000000; (**(code **)(*piVar15 + 0x14))(); local_84 = piVar15[0x5b]; if (((piVar15[0x5a] & 0x2000U) == 0) && ((piVar15[0x5a] & 0x22000U) == 0)) { (**(code **)(*piVar15 + 0x28))(); isListDirty = CONCAT31(isListDirty._1_3_,1); } } local_34 = (float)((int)local_34 + 1); } while ((uint)local_34 < (uint)(curList->_renderEL)._size); } _glfw_context_reset(); } if (isWallPass != false) { shared_ptr::assign(&renderTarget,(void *)((int)g_game->_room + 0x1bd0)); local_14 = (EntityPtr)0x2; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,renderTarget,0); local_14 = (EntityPtr)0x3; if (((local_2c[0] != (EntityPtr)0x0) && (cVar5 = (**(code **)(*(int *)local_2c[0] + 0xc))(), cVar5 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } local_14 = (EntityPtr)0xffffffff; local_34 = 0.0; if ((curList->_renderEL)._size != 0) { do { piVar15 = *(int **)((int)(curList->_renderEL)._data + (int)local_34 * 4); if ((*(char *)((int)piVar15 + 0x172) != '\0') && ((piVar15[0x5a] & 0x2000U) != 0)) { local_70 = CONCAT44(local_40,local_4c) ^ 0x8000000080000000; (**(code **)(*piVar15 + 0x14))(); if ((piVar15[0x5a] & 0x20000U) == 0) { (**(code **)(*piVar15 + 0x28))(); isListDirty = CONCAT31(isListDirty._1_3_,1); } } local_34 = (float)((int)local_34 + 1); } while ((uint)local_34 < (uint)(curList->_renderEL)._size); } _glfw_context_reset(); } if ((local_21 != false) || (isWallPass != false)) { g_graphicsManager_flags = g_graphicsManager_flags | 2; if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } puVar10 = std::deque::back(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*puVar10,*(byte *)(puVar10 + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } } } } if ((char)isListDirty != '\0') { uVar7 = (curList->_updateEL)._size; uVar16 = 0; if (uVar7 != 0) { do { if (*(char *)(*(int *)((int)(curList->_updateEL)._data + uVar16 * 4) + 0x172) == '\0') { if (uVar7 <= uVar16) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar7 = (curList->_updateEL)._size; } uVar14 = uVar16; if (uVar16 < uVar7 - 1) { do { pvVar13 = (curList->_updateEL)._data; *(undefined4 *)((int)pvVar13 + uVar14 * 4) = *(undefined4 *)((int)pvVar13 + uVar14 * 4 + 4); uVar14 = uVar14 + 1; uVar7 = (curList->_updateEL)._size; } while (uVar14 < uVar7 - 1); } uVar7 = uVar7 - 1; (curList->_updateEL)._size = uVar7; } else { uVar16 = uVar16 + 1; } } while (uVar16 < uVar7); } uVar7 = (curList->_renderEL)._size; uVar16 = 0; if (uVar7 != 0) { do { if (*(char *)(*(int *)((int)(curList->_renderEL)._data + uVar16 * 4) + 0x172) == '\0') { if (uVar7 <= uVar16) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar7 = (curList->_renderEL)._size; } uVar14 = uVar16; if (uVar16 < uVar7 - 1) { do { pvVar13 = (curList->_renderEL)._data; *(undefined4 *)((int)pvVar13 + uVar14 * 4) = *(undefined4 *)((int)pvVar13 + uVar14 * 4 + 4); uVar14 = uVar14 + 1; uVar7 = (curList->_renderEL)._size; } while (uVar14 < uVar7 - 1); } uVar7 = uVar7 - 1; (curList->_renderEL)._size = uVar7; } else { uVar16 = uVar16 + 1; } } while (uVar16 < uVar7); } uVar7 = (curList->_wispEL)._size; uVar16 = 0; if (uVar7 != 0) { do { if (*(char *)(*(int *)((int)(curList->_wispEL)._data + uVar16 * 4) + 0x172) == '\0') { if (uVar7 <= uVar16) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar7 = (curList->_wispEL)._size; } uVar14 = uVar16; if (uVar16 < uVar7 - 1) { do { pvVar13 = (curList->_wispEL)._data; *(undefined4 *)((int)pvVar13 + uVar14 * 4) = *(undefined4 *)((int)pvVar13 + uVar14 * 4 + 4); uVar14 = uVar14 + 1; uVar7 = (curList->_wispEL)._size; } while (uVar14 < uVar7 - 1); } uVar7 = uVar7 - 1; (curList->_wispEL)._size = uVar7; } else { uVar16 = uVar16 + 1; } } while (uVar16 < uVar7); } uVar7 = (curList->_mainEL)._size; uVar16 = 0; if (uVar7 != 0) { do { piVar15 = *(int **)((int)(curList->_mainEL)._data + uVar16 * 4); if (*(char *)((int)piVar15 + 0x172) == '\0') { (**(code **)(*piVar15 + 0x44))(); *(undefined1 *)(*(int *)((int)(curList->_mainEL)._data + uVar16 * 4) + 0x170) = 0; uVar7 = (curList->_mainEL)._size; if (uVar7 <= uVar16) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar7 = (curList->_mainEL)._size; } uVar14 = uVar16; if (uVar16 < uVar7 - 1) { do { pvVar13 = (curList->_mainEL)._data; *(undefined4 *)((int)pvVar13 + uVar14 * 4) = *(undefined4 *)((int)pvVar13 + uVar14 * 4 + 4); uVar14 = uVar14 + 1; uVar7 = (curList->_mainEL)._size; } while (uVar14 < uVar7 - 1); } uVar7 = uVar7 - 1; (curList->_mainEL)._size = uVar7; } else { uVar16 = uVar16 + 1; } } while (uVar16 < uVar7); } uVar7 = (curList->_persistentEL)._size; uVar16 = 0; if (uVar7 != 0) { do { piVar15 = *(int **)((int)(curList->_persistentEL)._data + uVar16 * 4); if (*(char *)((int)piVar15 + 0x172) == '\0') { local_21 = SUB41(piVar15[0x5c],0); (**(code **)(*piVar15 + 0x44))(); *(undefined1 *)(*(int *)((int)(curList->_persistentEL)._data + uVar16 * 4) + 0x170) = 0; puVar10 = *(undefined4 **)((int)(curList->_persistentEL)._data + uVar16 * 4); if (((puVar10[10] == 1) && (local_21 != false)) && (puVar10 != (undefined4 *)0x0)) { (**(code **)*puVar10)(); } uVar7 = (curList->_persistentEL)._size; if (uVar7 <= uVar16) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar7 = (curList->_persistentEL)._size; } uVar14 = uVar16; if (uVar16 < uVar7 - 1) { do { pvVar13 = (curList->_persistentEL)._data; *(undefined4 *)((int)pvVar13 + uVar14 * 4) = *(undefined4 *)((int)pvVar13 + uVar14 * 4 + 4); uVar14 = uVar14 + 1; uVar7 = (curList->_persistentEL)._size; } while (uVar14 < uVar7 - 1); } uVar7 = uVar7 - 1; (curList->_persistentEL)._size = uVar7; } else { uVar16 = uVar16 + 1; } } while (uVar16 < uVar7); } } if (isTransition == 0) { rebuild_sublists(curList); } sort_by_render_z(curList); if (local_64 != netplayEnd) { local_64 = (NetplayManager)get_mt_state_checksum(); checksum = &curList[1]._updateEL; Checksum::Update(checksum,(byte *)&local_64,4); if ((curList[1]._updateEL._size == 0) && (isAnyWallEntity = *(byte *)&curList[1]._updateEL._data, isAnyWallEntity != 0)) { if (isAnyWallEntity < 4) { memset(&checksum->field_0x0 + isAnyWallEntity,0,(uint)(byte)(4 - isAnyWallEntity)); } uVar7 = curList[1]._updateEL._capacity; *(undefined1 *)&curList[1]._updateEL._data = 0; curList[1]._updateEL._capacity = (uVar7 >> 1) + uVar7 * -0x80000000 + *(int *)checksum; } checksumRecord[5] = curList[1]._updateEL._capacity; *(NetplayManager *)(checksumRecord + 4) = local_64; } ExceptionList = local_1c; return; } //@@ 00419750 EntityList::sort_by_render_z /* DB: ECX=EntityList: partitions the render list at +0x54 (count +0x5c) by vtable slot 13 Entity::GetRenderZ into >=10000 / >=5000 buckets using a cached key array DAT_00c7e810; called from EntityList::Update after rebuild_sublists */ void __thiscall EntityList::sort_by_render_z(EntityList *this) { uint uVar1; uint lowRenderZ; undefined4 swapTmp; uint *highKey; int highOffset; void *pvVar3; uint local_18; uint local_14; uint local_10; int local_c; uint renderCount; longlong allocSize; undefined4 *entitySlot; int highOffset; if (DAT_00c7e810 == (void *)0x0) { allocSize = (ulonglong)(uint)(this->_renderEL)._capacity * 4; DAT_00c7e810 = operator_new_tracked (-(uint)((int)((ulonglong)allocSize >> 0x20) != 0) | (uint)allocSize); } highOffset = 0; local_10 = (this->_renderEL)._size + -1; if (0 < (int)local_10) { do { uVar1 = (**(code **)(**(int **)((int)(this->_renderEL)._data + local_10 * 4) + 0x34))(); *(uint *)((int)DAT_00c7e810 + local_10 * 4) = uVar1; if (uVar1 < 10000) { for (; highOffset < (int)local_10; highOffset = highOffset + 1) { lowRenderZ = (**(code **)(**(int **)((int)(this->_renderEL)._data + highOffset * 4) + 0x34))(); if (9999 < lowRenderZ) { pvVar3 = (this->_renderEL)._data; swapTmp = *(undefined4 *)((int)pvVar3 + highOffset * 4); *(undefined4 *)((int)pvVar3 + highOffset * 4) = *(undefined4 *)((int)pvVar3 + local_10 * 4); *(undefined4 *)((int)(this->_renderEL)._data + local_10 * 4) = swapTmp; pvVar3 = DAT_00c7e810; *(uint *)((int)DAT_00c7e810 + highOffset * 4) = uVar1; *(uint *)((int)pvVar3 + local_10 * 4) = lowRenderZ; break; } *(uint *)((int)DAT_00c7e810 + highOffset * 4) = lowRenderZ; } } local_10 = local_10 + -1; } while (highOffset < (int)local_10); } swapTmp = (**(code **)(**(int **)((int)(this->_renderEL)._data + highOffset * 4) + 0x34))(); pvVar3 = DAT_00c7e810; *(undefined4 *)((int)DAT_00c7e810 + highOffset * 4) = swapTmp; highOffset = 0; renderCount = (this->_renderEL)._size; local_c = local_10 + 1; if ((int)(renderCount - 1) <= (int)local_10) { local_c = local_10; } if (0 < local_c) { do { highOffset = local_c * 4; highKey = (uint *)(highOffset + (int)pvVar3); if (*highKey < 5000) { for (; highOffset < local_c; highOffset = highOffset + 1) { if (4999 < *(uint *)((int)pvVar3 + highOffset * 4)) { pvVar3 = (this->_renderEL)._data; entitySlot = (undefined4 *)((int)pvVar3 + highOffset * 4); swapTmp = *entitySlot; *entitySlot = *(undefined4 *)((int)pvVar3 + highOffset); pvVar3 = DAT_00c7e810; *(undefined4 *)(highOffset + (int)(this->_renderEL)._data) = swapTmp; uVar1 = *(uint *)((int)pvVar3 + highOffset * 4); *(uint *)((int)pvVar3 + highOffset * 4) = *highKey; *highKey = uVar1; break; } } } local_c = local_c + -1; } while (highOffset < local_c); renderCount = (this->_renderEL)._size; } highOffset = ((uint)(this->_renderEL)._capacity >> 4) + 1; if ((g_game->_frameCount & 1) == 0) { local_14 = 1; local_18 = 0; while (local_14 < renderCount) { if (local_14 != 0) { local_10 = local_14; local_c = local_18; do { if (*(uint *)((int)pvVar3 + local_10 * 4 + -4) <= *(uint *)((int)pvVar3 + local_10 * 4)) break; pvVar3 = (this->_renderEL)._data; highOffset = highOffset + -1; entitySlot = (undefined4 *)((int)pvVar3 + local_10 * 4); swapTmp = *entitySlot; *entitySlot = *(undefined4 *)((int)pvVar3 + local_c); pvVar3 = DAT_00c7e810; *(undefined4 *)(local_c + (int)(this->_renderEL)._data) = swapTmp; swapTmp = *(undefined4 *)((int)pvVar3 + local_10 * 4); *(undefined4 *)((int)pvVar3 + local_10 * 4) = *(undefined4 *)((int)pvVar3 + local_10 * 4 + -4); *(undefined4 *)((int)pvVar3 + local_10 * 4 + -4) = swapTmp; local_10 = local_10 - 1; local_c = local_c + -4; } while (local_10 != 0); } local_14 = local_14 + 1; local_18 = local_18 + 4; if (highOffset < 1) { return; } } } else { local_14 = renderCount - 1; local_10 = local_14 * 4; do { local_10 = local_10 + -4; if (local_14 == 0) { return; } if (local_14 < renderCount) { local_c = local_10; local_18 = local_14; do { if (*(uint *)((int)pvVar3 + local_18 * 4 + -4) <= *(uint *)((int)pvVar3 + local_18 * 4)) break; pvVar3 = (this->_renderEL)._data; highOffset = highOffset + -1; entitySlot = (undefined4 *)((int)pvVar3 + local_18 * 4); swapTmp = *entitySlot; *entitySlot = *(undefined4 *)((int)pvVar3 + local_c); pvVar3 = DAT_00c7e810; *(undefined4 *)(local_c + (int)(this->_renderEL)._data) = swapTmp; swapTmp = *(undefined4 *)((int)pvVar3 + local_18 * 4); *(undefined4 *)((int)pvVar3 + local_18 * 4) = *(undefined4 *)((int)pvVar3 + local_18 * 4 + -4); *(undefined4 *)((int)pvVar3 + local_18 * 4 + -4) = swapTmp; local_18 = local_18 + 1; local_c = local_c + 4; } while (local_18 < renderCount); } local_14 = local_14 - 1; } while (0 < highOffset); } return; } //@@ 004199d0 EntityList::render_up_to /* DB: Room::Render passes LEA ECX,[ESI+0x1218] (Room::_entityList) with arg1 5000: walks the sorted render list (+0x54 array, +0x5c count) from cursor +0xa0, stops at the first entity whose vtable +0x34 depth >= arg1, else renders it via vtable +0x14 at offset arg2, filtering by render mode +0xa4 (3/4 water reflection skips, 5 mirrored y-offset pass); Room::render_water calls it too */ void EntityList::render_up_to(uint param_1,float *param_2) { int *piVar1; int iVar2; float fVar3; uint uVar4; int in_ECX; bool bVar5; float fStack_28; float fStack_24; undefined1 auStack_20 [8]; uint auStack_18 [2]; byte abStack_10 [12]; uVar4 = *(uint *)(in_ECX + 0xa0); if (uVar4 < *(uint *)(in_ECX + 0x5c)) { do { piVar1 = *(int **)(*(int *)(in_ECX + 0x54) + uVar4 * 4); uVar4 = (**(code **)(*piVar1 + 0x34))(); if (param_1 <= uVar4) { return; } switch(*(undefined4 *)(in_ECX + 0xa4)) { case 2: break; case 3: Entity::get_water_splash_variant(auStack_20); bVar5 = (auStack_20[0] & 0x42) == 2; LAB_00419a25: if (!bVar5) goto switchD_00419a0a_default; break; case 4: Entity::get_water_splash_variant(auStack_18); if ((auStack_18[0] & 0x48) == 0) { bVar5 = (auStack_18[0] & 6) == 0; goto LAB_00419a25; } break; case 5: Entity::get_water_splash_variant(abStack_10); fVar3 = g_vectorZero.x; if ((abStack_10[0] & 0x60) == 0) { if ((piVar1[10] == 1) && ((((iVar2 = piVar1[0x61], iVar2 == 0 || (iVar2 == 3)) || (iVar2 == 1)) || (iVar2 == 2)) )) { fStack_24 = g_vectorZero.y + 4.0; } else { fStack_24 = g_vectorZero.y - 0.0; } uVar4 = piVar1[0xd4]; iVar2 = piVar1[0xd3]; piVar1[0xd3] = iVar2; piVar1[0xd4] = uVar4 ^ 0x80000000; fStack_28 = fVar3 + *param_2; fStack_24 = fStack_24 + param_2[1]; DAT_00c7977d = 1; (**(code **)(*piVar1 + 0x14))(&fStack_28); piVar1[0xd3] = iVar2; DAT_00c7977d = 0; piVar1[0xd4] = uVar4; } break; default: switchD_00419a0a_default: (**(code **)(*piVar1 + 0x14))(param_2); } uVar4 = *(int *)(in_ECX + 0xa0) + 1; *(uint *)(in_ECX + 0xa0) = uVar4; } while (uVar4 < *(uint *)(in_ECX + 0x5c)); } return; } //@@ 00419b50 render_entity_light_masks /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=lighting object (render target smart pointer +0xd8, entity pointer vector +0x54 count +0x5c): Room::render_lighting calls it between SetRenderTarget/Clear and pop_render_target; per player (type 1) or NPC (type 10..0x3e7) draws a quad via the target vtable +0x1c, shader_cache_find, apply_sprite_shader_params */ void render_entity_light_masks(float *param_1) { int iVar1; int iVar2; Game *pGVar3; char cVar4; undefined *puVar5; int in_ECX; int *extraout_ECX; int *extraout_ECX_00; KColor *color; int *extraout_ECX_01; int *unusedArg; uint uVar6; float fVar7; float fVar8; float fVar9; double dVar10; undefined1 auStackY_184 [128]; undefined8 in_stack_ffffff00; undefined1 local_e8 [112]; Vector local_78; Vector local_70; KColor local_68; float local_54; float local_50; float local_4c; float local_48; float local_44; float *local_40; float local_3c; ColorMod local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); local_40 = param_1; local_38._offset[0] = 0.0; iVar1 = *(int *)(*(int *)(in_ECX + 0xd8) + 0x10); local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; iVar2 = *(int *)(*(int *)(in_ECX + 0xd8) + 0x14); local_50 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); puVar5 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar5 = g_currentShader; } local_54 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]); local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; g_currentShader = puVar5; KAGE::SmartPointer::operator_assign(auStackY_184 + 0x84,(void *)(in_ECX + 0xd8)); apply_sprite_shader_params (&local_38,1,(void *)in_stack_ffffff00,(void *)((ulonglong)in_stack_ffffff00 >> 0x20)); uVar6 = 0; unusedArg = extraout_ECX; if (*(int *)(in_ECX + 0x5c) != 0) { do { unusedArg = *(int **)(*(int *)(in_ECX + 0x54) + uVar6 * 4); if ((*(char *)((int)unusedArg + 0x171) != '\0') && ((*(char *)((int)unusedArg + 0x173) == '\0' || (((1 < *(int *)&g_game->_deathmatchManager && (unusedArg[10] == 1)) || (unusedArg[10] - 10U < 0x3de)))))) { cVar4 = (**(code **)(*unusedArg + 0x18))(); unusedArg = extraout_ECX_00; if (cVar4 == '\0') { iVar1 = *(int *)(*(int *)(in_ECX + 0x54) + uVar6 * 4); local_4c = *(float *)(iVar1 + 0x15c) * *(float *)(iVar1 + 0xe4); if (0.001 <= local_4c) { local_44 = g_displayPixelRatio * g_screenPointScale; local_3c = (((*(float *)(iVar1 + 0x33c) + *(float *)(iVar1 + 0x160)) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_44 + 0.5; dVar10 = floor((double)local_3c); local_48 = (float)dVar10 / local_44; local_3c = (((*(float *)(iVar1 + 0x340) + *(float *)(iVar1 + 0x164)) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_44 + 0.5; dVar10 = floor((double)local_3c); pGVar3 = g_game; local_3c = (float)dVar10; fVar7 = local_4c * local_50; fVar9 = local_4c * local_54; fVar8 = local_3c / local_44; local_70.x = fVar7; local_70.y = fVar9; KColor::SetFromARGB(&local_68,0xffffffff); local_78.x = (local_48 + *local_40 + (pGVar3->_screenShakeOffset).x) - fVar7 * 0.5; local_78.y = (fVar8 + local_40[1] + (pGVar3->_screenShakeOffset).y) - fVar9 * 0.5; render_quad_set_rect(local_e8,&local_78,&local_70,color); local_68._unk = 0; local_68._red = local_38._tint[0]; local_68._green = local_38._tint[1]; local_68._blue = local_38._tint[2]; local_68._alpha = local_38._tint[3]; (**(code **)(**(int **)(in_ECX + 0xd8) + 0x1c))(); unusedArg = extraout_ECX_01; } } } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)(in_ECX + 0x5c)); } shader_cache_find((int)unusedArg); return; } //@@ 00419e70 EntityList::rebuild_sublists /* DB: ? this=EntityList: clears 8 sublists (FUN_0041baf0 x8), walks entities assigning +0x24 index and pushing by type ("EL: not enough space for push_back"), Entity::CollideWithGrid; called from FUN_004186c0 (EntityList update) prototype: db/protos.zhl */ void __thiscall EntityList::rebuild_sublists(EntityList *this) { undefined4 uVar1; float fVar2; bool bVar3; undefined4 uVar4; undefined4 *playerSlot; int iVar5; void *playerListEnd; Entity *this_00; Entity *this_01; PlayerManager *playerManager; uint entityIndex; uint listIndex; uint local_14; int entity; Game *game; Entity *tmpEntity; *(undefined4 *)&this->field_0x6c = 0; FUN_0041baf0(); FUN_0041baf0(); FUN_0041baf0(); FUN_0041baf0(); FUN_0041baf0(); FUN_0041baf0(); FUN_0041baf0(); FUN_0041baf0(); local_14 = 0; bVar3 = false; listIndex = 0; if ((this->_updateEL)._size != 0) { do { entity = *(int *)((int)(this->_updateEL)._data + listIndex * 4); *(undefined1 *)(entity + 0x18c) = 0; if (*(int *)(entity + 0x188) != 0) { iVar5 = *(int *)(entity + 0x28); if (iVar5 == 3) { if (*(int *)(entity + 0x2c) == 0xef) { CellSpace::insert(entity); } LAB_0041a0aa: CellSpace::insert(entity); LAB_0041a0b4: *(uint *)(entity + 0x24) = local_14; iVar5 = *(int *)(entity + 0x28); local_14 = local_14 + 1; } else { if (iVar5 == 9) { CellSpace::insert(entity); if ((!bVar3) && ((*(uint *)(entity + 0x43c) & 0x1000) != 0)) { bVar3 = true; } if ((*(uint *)(entity + 0x438) & 0x80) == 0) goto LAB_0041a0b4; goto LAB_0041a0aa; } if ((iVar5 == 2) || (iVar5 == 8)) { if ((!bVar3) && (iVar5 == 2)) { if (((*(uint *)(entity + 0x428) & DAT_00c34c60) != 0 || (*(uint *)(entity + 0x42c) & DAT_00c34c64) != 0) || ((*(uint *)(entity + 0x430) & DAT_00c34c68) != 0 || (*(uint *)(entity + 0x434) & DAT_00c34c6c) != 0)) { bVar3 = true; } } goto LAB_0041a0aa; } if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar5 == 1)) || (iVar5 - 10U < 0x3de)) || (iVar5 == 4)) { CellSpace::insert(entity); iVar5 = *(int *)(entity + 0x28); if (((iVar5 == 0x196) || (iVar5 == 0x394)) || ((iVar5 == 4 && ((*(int *)(entity + 0x2c) == 0x13 || (*(int *)(entity + 0x2c) == 0x14)))))) { CellSpace::insert(entity); iVar5 = *(int *)(entity + 0x28); } if ((((((*(uint *)(entity + 0x168) & 0x20000000) != 0) || (iVar5 == 0xf5)) || (iVar5 == 0x3c3)) || (((*(uint *)(entity + 0x16c) & 0x100000) != 0 || (iVar5 == 0x322)))) || (iVar5 == 0x362)) goto LAB_0041a0aa; goto LAB_0041a0b4; } if ((iVar5 == 5) || (iVar5 == 6)) goto LAB_0041a0aa; if (iVar5 == 1) goto LAB_0041a0b4; } if (iVar5 == 1000) { iVar5 = *(int *)&this->field_0x6c; if (*(uint *)&this->field_0x68 < iVar5 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar5 = *(int *)&this->field_0x6c; } *(int *)(*(int *)&this->field_0x64 + iVar5 * 4) = entity; *(int *)&this->field_0x6c = *(int *)&this->field_0x6c + 1; } } listIndex = listIndex + 1; } while (listIndex < (uint)(this->_updateEL)._size); } uVar1 = *(undefined4 *)&this[1].field_0x1c; *(undefined4 *)&this[1]._mainEL = uVar1; this[1]._mainEL._capacity = 0; uVar4 = FUN_0041ca00(local_14 * local_14,uVar1,0); uVar1 = *(undefined4 *)&this[1].field_0x1c; FUN_0041c910(uVar4); FUN_0041c910(local_14 * local_14); FUN_0041cb90(uVar1,0,uVar1,0); this[1]._mainEL._size = local_14; if (1 < *(int *)&g_game->_deathmatchManager) { CellSpace::collide(*(undefined4 *)&this->field_0x4); CellSpace::collide(*(undefined4 *)&this->field_0x4); } CellSpace::collide(*(undefined4 *)&this->field_0xc); CellSpace::collide(*(undefined4 *)&this->field_0x8); playerManager = &g_game->_playerManager; local_14 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (local_14 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_14; } CellSpace::collide_entity(*playerSlot); playerManager = &g_game->_playerManager; local_14 = local_14 + 1; } while (local_14 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } CellSpace::collide(*(undefined4 *)&this->field_0x8); CellSpace::collide_self(); local_14 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { game = g_game; playerListEnd = (g_game->_playerManager)._playerList._end; if ((int)playerListEnd - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (game->_playerManager)._playerList._end; } playerSlot = (game->_playerManager)._playerList._begin; if (local_14 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_14; } CellSpace::collide_entity(*playerSlot); local_14 = local_14 + 1; } while (local_14 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } local_14 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { game = g_game; playerListEnd = (g_game->_playerManager)._playerList._end; if ((int)playerListEnd - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (game->_playerManager)._playerList._end; } playerSlot = (game->_playerManager)._playerList._begin; if (local_14 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_14; } CellSpace::collide_entity(*playerSlot); local_14 = local_14 + 1; } while (local_14 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } local_14 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { game = g_game; playerListEnd = (g_game->_playerManager)._playerList._end; if ((int)playerListEnd - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (game->_playerManager)._playerList._end; } playerSlot = (game->_playerManager)._playerList._begin; if (local_14 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_14; } CellSpace::collide_entity(*playerSlot); local_14 = local_14 + 1; } while (local_14 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } if (1 < *(int *)&g_game->_deathmatchManager) { playerManager = &g_game->_playerManager; local_14 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (local_14 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_14; } CellSpace::collide_entity(*playerSlot); playerManager = &g_game->_playerManager; local_14 = local_14 + 1; } while (local_14 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } CellSpace::collide_self(); CellSpace::collide(*(undefined4 *)&this->field_0x18); CellSpace::collide(*(undefined4 *)&this->field_0x8); if (bVar3) { CellSpace::collide(*(undefined4 *)&this->field_0x4); } CellSpace::collide(*(undefined4 *)&this->field_0xc); CellSpace::collide(*(undefined4 *)&this->field_0x8); playerManager = &g_game->_playerManager; local_14 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; if ((int)playerListEnd - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; } if (local_14 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_14; } tmpEntity = (Entity *)*playerSlot; this_01 = (Entity *)tmpEntity[7]._damageCountdown; if ((this_01 != (Entity *)0x0) && (((fVar2 = this_01[5]._color._offset[2], fVar2 == -NAN || ((int)tmpEntity[5]._color._offset[2] <= (int)fVar2)) || (this_01 == tmpEntity)))) { if ((g_game->_frameCount & 1) == 0) { if (((((tmpEntity->_sizeMulti).x == g_vectorOne.x) && ((tmpEntity->_sizeMulti).y == g_vectorOne.y)) && ((this_01->_sizeMulti).x == g_vectorOne.x)) && ((this_01->_sizeMulti).y == g_vectorOne.y)) { Entity::push_apart_circle(tmpEntity,this_01); } else { Entity::push_apart_capsule(tmpEntity,this_01); } if ((((this_01->_sizeMulti).x == g_vectorOne.x) && ((this_01->_sizeMulti).y == g_vectorOne.y)) && (((tmpEntity->_sizeMulti).x == g_vectorOne.x && ((tmpEntity->_sizeMulti).y == g_vectorOne.y)))) { Entity::push_apart_circle(this_01,tmpEntity); } else { this_00 = this_01; this_01 = tmpEntity; LAB_0041a727: Entity::push_apart_capsule(this_00,this_01); } } else { if ((((this_01->_sizeMulti).x == g_vectorOne.x) && ((this_01->_sizeMulti).y == g_vectorOne.y)) && (((tmpEntity->_sizeMulti).x == g_vectorOne.x && ((tmpEntity->_sizeMulti).y == g_vectorOne.y)))) { Entity::push_apart_circle(this_01,tmpEntity); } else { Entity::push_apart_capsule(this_01,tmpEntity); } if ((((tmpEntity->_sizeMulti).x != g_vectorOne.x) || ((tmpEntity->_sizeMulti).y != g_vectorOne.y)) || (((this_01->_sizeMulti).x != g_vectorOne.x || ((this_01->_sizeMulti).y != g_vectorOne.y)))) { this_00 = tmpEntity; goto LAB_0041a727; } Entity::push_apart_circle(tmpEntity,this_01); } } playerManager = &g_game->_playerManager; local_14 = local_14 + 1; } while (local_14 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } entityIndex = 0; if ((this->_updateEL)._size != 0) { do { tmpEntity = *(Entity **)((int)(this->_updateEL)._data + entityIndex * 4); if (tmpEntity->_type != 7) { if (tmpEntity->_type == 1) { Entity::PlayerCollideWithGrid(tmpEntity,0); } else { Entity::CollideWithGrid(tmpEntity,0); } } entityIndex = entityIndex + 1; } while (entityIndex < (uint)(this->_updateEL)._size); } return; } //@@ 0041a790 EntityList::QueryRadius /* DB: (result,pos,partitions) radius xmm3; callers iterate result list of entities prototype: db/protos.zhl, confirmed by RET 12 */ EntityList_EL * __thiscall EntityList::QueryRadius (EntityList *this,EntityList_EL *outResult,Vector *position,float radius,uint partitions) { longlong lVar1; longlong lVar2; undefined4 *playerSlot; void *playerListEnd; int iVar3; uint uVar4; uint uVar5; PlayerManager *playerManager; int iVar6; uint uVar7; bool bVar8; float fVar9; float fVar10; float fVar11; float fVar12; ulonglong startTimeNs; ulonglong uVar13; float boxHalfWidth; EntityList *local_2c; undefined4 local_28; uint startMsHigh; uint startMsLow; float queryRadius; void *local_10; undefined1 *puStack_c; undefined4 local_8; EntityList *entityList; Game *game; undefined1 *partition; undefined4 player; puStack_c = &LAB_00af15be; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; local_2c = this; queryRadius = radius; startTimeNs = GetTimeNs(); entityList = local_2c; uVar7 = (uint)(startTimeNs >> 0x20); boxHalfWidth = queryRadius; uVar13 = (startTimeNs & 0xffffffff) * 0xd7b634db; local_28 = (undefined4)uVar13; lVar1 = (startTimeNs & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar7 * 0xd7b634db + (uVar13 >> 0x20); lVar1 = (ulonglong)uVar7 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); startMsHigh = (uint)((ulonglong)lVar1 >> 0x20); local_2c = (EntityList *)queryRadius; startMsLow = (uint)lVar1 >> 0x12 | startMsHigh * 0x4000; *(undefined4 *)&entityList->field_0x7c = 0; partition = &entityList->field_0x70; startMsHigh = startMsHigh >> 0x12; if ((partitions & 1) != 0) { EntityPartition::query_box(partition,position,&boxHalfWidth); } if ((partitions & 4) != 0) { EntityPartition::query_box(partition,position,&boxHalfWidth); } if ((partitions & 8) != 0) { EntityPartition::query_box(partition,position,&boxHalfWidth); } if ((partitions & 2) != 0) { EntityPartition::query_box(partition,position,&boxHalfWidth); } if ((partitions & 0x10) != 0) { EntityPartition::query_box(partition,position,&boxHalfWidth); } if ((partitions & 0x20) != 0) { uVar7 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (uVar7 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar7; } iVar6 = *(int *)&entityList->field_0x7c; player = *playerSlot; if (*(uint *)&entityList->field_0x78 < iVar6 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar6 = *(int *)&entityList->field_0x7c; } uVar7 = uVar7 + 1; *(undefined4 *)(*(int *)&entityList->field_0x74 + iVar6 * 4) = player; game = g_game; *(int *)&entityList->field_0x7c = *(int *)&entityList->field_0x7c + 1; playerManager = &game->_playerManager; } while (uVar7 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } iVar6 = 0; uVar7 = 0; if (*(int *)&entityList->field_0x7c != 0) { do { iVar3 = *(int *)(*(int *)&entityList->field_0x74 + uVar7 * 4); fVar12 = queryRadius + *(float *)(iVar3 + 0x370); if (((*(uint *)(iVar3 + 0x16c) & 0x4000) == 0) && (fVar10 = *(float *)(iVar3 + 0x340) - position->y, fVar9 = *(float *)(iVar3 + 0x33c) - position->x, fVar10 * fVar10 + fVar9 * fVar9 < fVar12 * fVar12)) { *(int *)(*(int *)&entityList->field_0x74 + iVar6 * 4) = iVar3; iVar6 = iVar6 + 1; } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)&entityList->field_0x7c); } *(int *)&entityList->field_0x7c = iVar6; if (((partitions & 0x40) != 0) && (uVar7 = 0, fVar12 = queryRadius, *(int *)&entityList->field_0x6c != 0)) { do { iVar6 = *(int *)(*(int *)&entityList->field_0x64 + uVar7 * 4); fVar9 = fVar12 + *(float *)(iVar6 + 0x370); if (((*(uint *)(iVar6 + 0x16c) & 0x4000) == 0) && (fVar11 = *(float *)(iVar6 + 0x340) - position->y, fVar10 = *(float *)(iVar6 + 0x33c) - position->x, fVar11 * fVar11 + fVar10 * fVar10 < fVar9 * fVar9)) { iVar3 = *(int *)&entityList->field_0x7c; if (*(uint *)&entityList->field_0x78 < iVar3 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar3 = *(int *)&entityList->field_0x7c; fVar12 = queryRadius; } *(int *)(*(int *)&entityList->field_0x74 + iVar3 * 4) = iVar6; *(int *)&entityList->field_0x7c = *(int *)&entityList->field_0x7c + 1; } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)&entityList->field_0x6c); iVar6 = *(int *)&entityList->field_0x7c; } sublist_init((EntityList *)outResult,(EntityList_EL *)&entityList->field_0x80,iVar6); local_8 = 0; uVar7 = *(uint *)&entityList->field_0x7c; if ((uint)outResult->_capacity < uVar7) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for copy\n"); uVar7 = *(uint *)&entityList->field_0x7c; } memcpy(outResult->_data,*(void **)&entityList->field_0x74,uVar7 << 2); outResult->_size = *(int *)&entityList->field_0x7c; uVar13 = GetTimeNs(); uVar4 = (uint)(uVar13 >> 0x20); lVar1 = (uVar13 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar7 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar7),uVar5 + uVar7); uVar5 = (uint)((ulonglong)lVar1 >> 0x20); uVar7 = (uint)lVar1 >> 0x12 | uVar5 * 0x4000; uVar4 = uVar7 - startMsLow; bVar8 = CARRY4(DAT_00c79c48,uVar4); DAT_00c79c48 = DAT_00c79c48 + uVar4; DAT_00c79c4c = DAT_00c79c4c + (((uVar5 >> 0x12) - startMsHigh) - (uint)(uVar7 < startMsLow)) + (uint)bVar8; ExceptionList = local_10; return outResult; } //@@ 0041ab50 EntityList::query_player_capsule_hits /* DB: ? Capsule::Collide over players prototype: db/protos.zhl, confirmed by RET 12 */ EntityList_EL * __thiscall EntityList::query_player_capsule_hits (EntityList *this,EntityList_EL *outResult,void *capsule,uint partitions) { undefined4 uVar1; longlong lVar2; longlong lVar3; byte isColliding; undefined4 *playerSlot; uint uVar4; void *playerListEnd; uint uVar5; uint uVar6; PlayerManager *playerManager; int writeIdx; bool isColliding; float fVar8; float fVar9; ulonglong timeNs; Capsule entityCapsule [10]; float local_30; float local_2c; undefined4 local_28; float local_24; EntityList *local_20; uint startTimeHi; uint startTimeLo; void *local_10; undefined1 *puStack_c; undefined4 local_8; EntityList *entityList; Game *game; undefined1 *partition; puStack_c = &LAB_00af15fe; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; local_28 = 0; local_20 = this; timeNs = GetTimeNs(); entityList = local_20; uVar5 = (uint)(timeNs >> 0x20); local_2c = 0.0; local_24 = 0.0; lVar2 = (timeNs & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar5 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar6 = (uint)((ulonglong)lVar3 >> 0x20); uVar4 = (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3); local_30 = 0.0; lVar2 = (ulonglong)uVar5 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar6,uVar4),uVar6 + uVar4); startTimeHi = (uint)((ulonglong)lVar2 >> 0x20); local_20 = (EntityList *)0x0; startTimeLo = (uint)lVar2 >> 0x12 | startTimeHi * 0x4000; startTimeHi = startTimeHi >> 0x12; *(undefined4 *)&entityList->field_0x7c = 0; Capsule::get_bounding_box(&local_30,&local_24); partition = &entityList->field_0x70; fVar9 = local_24 - local_30; fVar8 = (float)local_20 - local_2c; local_2c = (local_2c + (float)local_20) * 0.5; local_30 = (local_24 + local_30) * 0.5; local_24 = fVar9 * 0.5; local_20 = (EntityList *)(fVar8 * 0.5); if ((partitions & 1) != 0) { EntityPartition::query_box(partition,&local_30,&local_24); } if ((partitions & 4) != 0) { EntityPartition::query_box(partition,&local_30,&local_24); } if ((partitions & 8) != 0) { EntityPartition::query_box(partition,&local_30,&local_24); } if ((partitions & 2) != 0) { EntityPartition::query_box(partition,&local_30,&local_24); } if ((partitions & 0x10) != 0) { EntityPartition::query_box(partition,&local_30,&local_24); } if ((partitions & 0x20) != 0) { uVar4 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (uVar4 < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar4; } writeIdx = *(int *)&entityList->field_0x7c; uVar1 = *playerSlot; if (*(uint *)&entityList->field_0x78 < writeIdx + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); writeIdx = *(int *)&entityList->field_0x7c; } uVar4 = uVar4 + 1; *(undefined4 *)(*(int *)&entityList->field_0x74 + writeIdx * 4) = uVar1; game = g_game; *(int *)&entityList->field_0x7c = *(int *)&entityList->field_0x7c + 1; playerManager = &game->_playerManager; } while (uVar4 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } uVar4 = 0; writeIdx = 0; if (*(int *)&entityList->field_0x7c != 0) { do { Entity::GetCollisionCapsule (*(Entity **)(*(int *)&entityList->field_0x74 + uVar4 * 4),entityCapsule, &g_vectorZero); if (((*(uint *)(*(int *)(*(int *)&entityList->field_0x74 + uVar4 * 4) + 0x16c) & 0x4000) == 0) && (isColliding = Capsule::Collide(capsule,entityCapsule,(Vector *)0x0), isColliding != 0)) { *(undefined4 *)(*(int *)&entityList->field_0x74 + writeIdx * 4) = *(undefined4 *)(*(int *)&entityList->field_0x74 + uVar4 * 4); writeIdx = writeIdx + 1; } uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)&entityList->field_0x7c); } *(int *)&entityList->field_0x7c = writeIdx; if (((partitions & 0x40) != 0) && (uVar4 = 0, *(int *)&entityList->field_0x6c != 0)) { do { Entity::GetCollisionCapsule (*(Entity **)(*(int *)&entityList->field_0x64 + uVar4 * 4),entityCapsule, &g_vectorZero); if (((*(uint *)(*(int *)(*(int *)&entityList->field_0x64 + uVar4 * 4) + 0x16c) & 0x4000) == 0) && (isColliding = Capsule::Collide(capsule,entityCapsule,(Vector *)0x0), isColliding != 0)) { writeIdx = *(int *)&entityList->field_0x7c; uVar1 = *(undefined4 *)(*(int *)&entityList->field_0x64 + uVar4 * 4); if (*(uint *)&entityList->field_0x78 < writeIdx + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); writeIdx = *(int *)&entityList->field_0x7c; } *(undefined4 *)(*(int *)&entityList->field_0x74 + writeIdx * 4) = uVar1; *(int *)&entityList->field_0x7c = *(int *)&entityList->field_0x7c + 1; } uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)&entityList->field_0x6c); writeIdx = *(int *)&entityList->field_0x7c; } sublist_init((EntityList *)outResult,(EntityList_EL *)&entityList->field_0x80,writeIdx); local_8 = 0; uVar4 = *(uint *)&entityList->field_0x7c; local_28 = 1; if ((uint)outResult->_capacity < uVar4) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for copy\n"); uVar4 = *(uint *)&entityList->field_0x7c; } memcpy(outResult->_data,*(void **)&entityList->field_0x74,uVar4 << 2); outResult->_size = *(int *)&entityList->field_0x7c; timeNs = GetTimeNs(); uVar5 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar5 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar6 = (uint)((ulonglong)lVar3 >> 0x20); uVar4 = (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (ulonglong)uVar5 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar6,uVar4),uVar6 + uVar4); uVar6 = (uint)((ulonglong)lVar2 >> 0x20); uVar4 = (uint)lVar2 >> 0x12 | uVar6 * 0x4000; uVar5 = uVar4 - startTimeLo; isColliding = CARRY4(DAT_00c79c48,uVar5); DAT_00c79c48 = DAT_00c79c48 + uVar5; DAT_00c79c4c = DAT_00c79c4c + (((uVar6 >> 0x12) - startTimeHi) - (uint)(uVar4 < startTimeLo)) + (uint)isColliding; ExceptionList = local_10; return outResult; } //@@ 0041af60 EntityList::QuerySublist /* DB: ? EL: copy/push_back strings, 157 callers on Room+0x1218; Mask case calls it first (Mask AI not identified) prototype: db/protos.zhl, confirmed by RET 24 */ EntityList_EL * __thiscall EntityList::QuerySublist (EntityList *this,EntityList_EL *outResult,int type,int variant,int subType,byte isCache, byte isIgnoreFriendly) { longlong lVar1; longlong lVar2; qword qVar3; void *pvVar4; int iVar5; undefined1 *cacheEntry; qword *allocatedBytes; int count; uint uVar6; uint uVar7; uint uVar8; bool bVar9; ulonglong startTimeNs; ulonglong uVar10; int cacheKeyType; int cacheKeyVariant; int cacheKeySubType; char wispSublist [4]; void *local_38; uint local_34; int local_30; char sublist [4]; void *sublistData; uint local_24; int local_20; void *startTimeHi; uint startTimeLo; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af1635; local_10 = ExceptionList; if ((type == 3) && (variant == 0xce)) { if (subType == -1) { outResult->_data = (this->_wispEL)._data; outResult->_capacity = (this->_wispEL)._capacity; iVar5 = (this->_wispEL)._size; *(undefined1 *)outResult = 1; outResult->_size = iVar5; return outResult; } iVar5 = 0; ExceptionList = &local_10; *(undefined4 *)&this->field_0x7c = 0; uVar8 = 0; if ((this->_wispEL)._size != 0) { do { iVar5 = *(int *)((int)(this->_wispEL)._data + uVar8 * 4); if (*(int *)(iVar5 + 0x30) == subType) { count = *(int *)&this->field_0x7c; if (*(uint *)&this->field_0x78 < count + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); count = *(int *)&this->field_0x7c; } *(int *)(*(int *)&this->field_0x74 + count * 4) = iVar5; *(int *)&this->field_0x7c = *(int *)&this->field_0x7c + 1; } iVar5 = *(int *)&this->field_0x7c; uVar8 = uVar8 + 1; } while (uVar8 < (uint)(this->_wispEL)._size); } sublist_init((EntityList *)wispSublist,(EntityList_EL *)&this->field_0x80,iVar5); local_8 = (void *)0x0; uVar8 = *(uint *)&this->field_0x7c; if (local_34 < uVar8) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for copy\n"); uVar8 = *(uint *)&this->field_0x7c; } memcpy(local_38,*(void **)&this->field_0x74,uVar8 << 2); iVar5 = *(int *)&this->field_0x7c; *(undefined1 *)outResult = 1; outResult->_data = local_38; outResult->_capacity = local_34; outResult->_size = iVar5; if (wispSublist[0] == '\0') { local_8 = (void *)0x1; tracked_alloc(1,local_38,0); } } else { ExceptionList = &local_10; startTimeNs = GetTimeNs(); uVar6 = (uint)(startTimeNs >> 0x20); uVar10 = (startTimeNs & 0xffffffff) * 0xd7b634db; local_34 = (uint)uVar10; lVar1 = (startTimeNs & 0xffffffff) * 0x431bde82; local_30 = (int)((ulonglong)lVar1 >> 0x20); lVar2 = (ulonglong)uVar6 * 0xd7b634db; local_20 = (int)((ulonglong)lVar2 >> 0x20); uVar10 = lVar2 + (uVar10 >> 0x20); uVar7 = (uint)(uVar10 >> 0x20); lVar1 = lVar1 + (uVar10 & 0xffffffff); local_24 = (uint)lVar1; uVar8 = (uint)((ulonglong)lVar1 >> 0x20); lVar1 = (ulonglong)uVar6 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar7,uVar8),uVar7 + uVar8); uVar8 = (uint)((ulonglong)lVar1 >> 0x20); cacheKeyVariant = variant; startTimeLo = (uint)lVar1 >> 0x12 | uVar8 * 0x4000; startTimeHi = (void *)(uVar8 >> 0x12); cacheKeyType = type; cacheKeySubType = subType; if (isCache != 0) { FUN_0041d390(&local_38,&cacheKeyType); if (((*(char *)(local_30 + 0xd) != '\0') || (type < *(int *)(local_30 + 0x10))) || ((iVar5 = local_30, type <= *(int *)(local_30 + 0x10) && ((variant < *(int *)(local_30 + 0x14) || ((variant <= *(int *)(local_30 + 0x14) && (subType < *(int *)(local_30 + 0x18))))))))) { iVar5 = this[1]._persistentEL._capacity; } if (iVar5 != this[1]._persistentEL._capacity) { outResult->_data = *(void **)(iVar5 + 0x20); outResult->_capacity = *(int *)(iVar5 + 0x24); iVar5 = *(int *)(iVar5 + 0x28); *(undefined1 *)outResult = 1; outResult->_size = iVar5; ExceptionList = local_10; return outResult; } } iVar5 = (this->_updateEL)._size; *(undefined4 *)&this->field_0x7c = 0; if (variant < 0) { uVar8 = 0; if (subType < 0) { if (iVar5 != 0) { do { iVar5 = *(int *)((int)(this->_updateEL)._data + uVar8 * 4); if (((*(int *)(iVar5 + 0x28) == type) && ((*(uint *)(iVar5 + 0x16c) & 0x4000) == 0)) && ((isIgnoreFriendly == 0 || ((*(uint *)(iVar5 + 0x168) & 0x20000000) == 0)))) { count = *(int *)&this->field_0x7c; if (*(uint *)&this->field_0x78 < count + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); count = *(int *)&this->field_0x7c; } *(int *)(*(int *)&this->field_0x74 + count * 4) = iVar5; *(int *)&this->field_0x7c = *(int *)&this->field_0x7c + 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(this->_updateEL)._size); } } else if (iVar5 != 0) { do { iVar5 = *(int *)((int)(this->_updateEL)._data + uVar8 * 4); if ((((*(int *)(iVar5 + 0x28) == type) && (*(int *)(iVar5 + 0x30) == subType)) && ((*(uint *)(iVar5 + 0x16c) & 0x4000) == 0)) && ((isIgnoreFriendly == 0 || ((*(uint *)(iVar5 + 0x168) & 0x20000000) == 0)))) { count = *(int *)&this->field_0x7c; if (*(uint *)&this->field_0x78 < count + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); count = *(int *)&this->field_0x7c; } *(int *)(*(int *)&this->field_0x74 + count * 4) = iVar5; *(int *)&this->field_0x7c = *(int *)&this->field_0x7c + 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(this->_updateEL)._size); } } else if (subType < 0) { uVar8 = 0; if (iVar5 != 0) { do { iVar5 = *(int *)((int)(this->_updateEL)._data + uVar8 * 4); if (((*(int *)(iVar5 + 0x28) == type) && (*(int *)(iVar5 + 0x2c) == variant)) && (((*(uint *)(iVar5 + 0x16c) & 0x4000) == 0 && ((isIgnoreFriendly == 0 || ((*(uint *)(iVar5 + 0x168) & 0x20000000) == 0)))))) { count = *(int *)&this->field_0x7c; if (*(uint *)&this->field_0x78 < count + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); count = *(int *)&this->field_0x7c; } *(int *)(*(int *)&this->field_0x74 + count * 4) = iVar5; *(int *)&this->field_0x7c = *(int *)&this->field_0x7c + 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(this->_updateEL)._size); } } else { uVar8 = 0; if (iVar5 != 0) { do { iVar5 = *(int *)((int)(this->_updateEL)._data + uVar8 * 4); if (((((*(int *)(iVar5 + 0x28) == type) && (*(int *)(iVar5 + 0x2c) == variant)) && (*(int *)(iVar5 + 0x30) == subType)) && ((*(uint *)(iVar5 + 0x16c) & 0x4000) == 0)) && ((isIgnoreFriendly == 0 || ((*(uint *)(iVar5 + 0x168) & 0x20000000) == 0)))) { count = *(int *)&this->field_0x7c; if (*(uint *)&this->field_0x78 < count + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); count = *(int *)&this->field_0x7c; } *(int *)(*(int *)&this->field_0x74 + count * 4) = iVar5; *(int *)&this->field_0x7c = *(int *)&this->field_0x7c + 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(this->_updateEL)._size); } } sublist_init((EntityList *)sublist,(EntityList_EL *)&this->field_0x80,*(int *)&this->field_0x7c) ; local_8 = (void *)0x2; uVar8 = *(uint *)&this->field_0x7c; if (local_24 < uVar8) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for copy\n"); uVar8 = *(uint *)&this->field_0x7c; } pvVar4 = sublistData; memcpy(sublistData,*(void **)&this->field_0x74,uVar8 << 2); iVar5 = *(int *)&this->field_0x7c; local_20 = iVar5; if (isCache != 0) { cacheEntry = (undefined1 *)FUN_0041c6f0(&cacheKeyType); *cacheEntry = 1; *(void **)(cacheEntry + 4) = pvVar4; *(uint *)(cacheEntry + 8) = local_24; *(int *)(cacheEntry + 0xc) = iVar5; } uVar10 = GetTimeNs(); uVar8 = (uint)(uVar10 >> 0x20); lVar1 = (uVar10 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar8 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); local_34 = (uint)(lVar2 + lVar1); *(undefined1 *)outResult = 1; lVar1 = (ulonglong)uVar8 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)) ,(int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar7 = (uint)((ulonglong)lVar1 >> 0x20); uVar8 = (uint)lVar1 >> 0x12 | uVar7 * 0x4000; outResult->_capacity = local_24; uVar6 = uVar8 - startTimeLo; outResult->_size = iVar5; bVar9 = CARRY4(DAT_00c79c48,uVar6); DAT_00c79c48 = DAT_00c79c48 + uVar6; DAT_00c79c4c = DAT_00c79c4c + (((uVar7 >> 0x12) - (int)startTimeHi) - (uint)(uVar8 < startTimeLo)) + (uint)bVar9; outResult->_data = sublistData; if (sublist[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (sublistData != (void *)0x0) { uVar8 = *(uint *)((int)sublistData + -4); qVar3 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar8; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar3 < uVar8); free((uint *)((int)sublistData + -4)); } } } ExceptionList = local_10; return outResult; } //@@ 0041b4f0 EntityList::AddPersistentEntity /* DB: "persistent list is full" log prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntityList::AddPersistentEntity(EntityList *this,Entity *entity) { int *piVar1; uint uVar2; uint uVar3; if ((uint)(this->_persistentEL)._capacity <= (this->_persistentEL)._size + 0x32U) { KAGE_LogMessage(1,(byte *) "[warn] Can\'t add more persistent entities, persistent list is full!\n"); return; } EntityList_EL::remove(&this->_mainEL,entity); uVar3 = (this->_persistentEL)._size; uVar2 = 0; if (uVar3 != 0) { piVar1 = (this->_persistentEL)._data; do { if (entity == (Entity *)*piVar1) { return; } uVar2 = uVar2 + 1; piVar1 = piVar1 + 1; } while (uVar2 < uVar3); } if ((uint)(this->_persistentEL)._capacity < uVar3 + 1) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); uVar3 = (this->_persistentEL)._size; } *(Entity **)((int)(this->_persistentEL)._data + uVar3 * 4) = entity; piVar1 = &(this->_persistentEL)._size; *piVar1 = *piVar1 + 1; return; } //@@ 0041b570 EntityList::invalidate_type_cache /* DB: thiscall EntityList, (type,variant,subtype) of the entity just added (EntityList::AddEntity passes piVar[10..12] = +0x28/+0x2c/+0x30); erases entries of the std::set at this+0xe0 keyed (type,variant,subtype), (type,variant,-1) and (type,-1,-1); also Game::rewind, PlayerManager::RemoveCoPlayer prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall EntityList::invalidate_type_cache(EntityList *this,int type,int variant,int subType) { int *piVar1; int iVar2; undefined1 local_1c [8]; int local_14; int local_10; int local_c; int local_8; iVar2 = variant; local_8 = subType; piVar1 = &this[1]._persistentEL._capacity; local_10 = type; local_c = variant; FUN_0041d390(local_1c,&local_10); if (((*(char *)(local_14 + 0xd) == '\0') && (*(int *)(local_14 + 0x10) <= type)) && ((*(int *)(local_14 + 0x10) < type || ((*(int *)(local_14 + 0x14) <= iVar2 && ((*(int *)(local_14 + 0x14) < iVar2 || (*(int *)(local_14 + 0x18) <= subType)))))))) { subType = *piVar1; if (local_14 != subType) { FUN_0041cc60(&subType,local_14); goto LAB_0041b5d4; } } else { LAB_0041b5d4: subType = *piVar1; } iVar2 = subType; local_c = variant; local_10 = type; local_8 = 0xffffffff; FUN_0041d390(local_1c,&local_10); if ((*(char *)(local_14 + 0xd) == '\0') && (*(int *)(local_14 + 0x10) <= type)) { if (type <= *(int *)(local_14 + 0x10)) { if ((variant < *(int *)(local_14 + 0x14)) || ((variant <= *(int *)(local_14 + 0x14) && (*(uint *)(local_14 + 0x18) < 0x80000000)))) goto LAB_0041b62c; } if (local_14 != iVar2) { FUN_0041cc60(&variant,local_14); iVar2 = *piVar1; } } else { LAB_0041b62c: iVar2 = subType; } local_10 = type; local_c = 0xffffffff; local_8 = 0xffffffff; FUN_0041d390(local_1c,&local_10); if ((((*(char *)(local_14 + 0xd) == '\0') && (*(int *)(local_14 + 0x10) <= type)) && ((*(int *)(local_14 + 0x10) < type || ((0x7fffffff < *(uint *)(local_14 + 0x14) && (((int)*(uint *)(local_14 + 0x14) < -1 || (0x7fffffff < *(uint *)(local_14 + 0x18))))))))) && (local_14 != iVar2)) { FUN_0041cc60(&variant,local_14); } return; } //@@ 0041b690 FUN_0041b690 int FUN_0041b690(int param_1,int param_2,int param_3) { int iVar1; uint uVar2; int in_ECX; int iVar3; int iVar4; uint uVar5; int *piVar6; uVar5 = *(uint *)(in_ECX + 0x4c); iVar4 = 0; if (param_2 < 0) { if (-1 < param_3) { uVar2 = 0; if (uVar5 == 0) { return 0; } do { iVar1 = *(int *)(*(int *)(in_ECX + 0x44) + uVar2 * 4); if ((*(int *)(iVar1 + 0x28) == param_1) && (*(int *)(iVar1 + 0x30) == param_3)) { iVar4 = iVar4 + 1; } uVar2 = uVar2 + 1; } while (uVar2 < uVar5); return iVar4; } if (uVar5 != 0) { piVar6 = *(int **)(in_ECX + 0x44); do { iVar1 = *piVar6; piVar6 = piVar6 + 1; iVar3 = iVar4 + 1; if (*(int *)(iVar1 + 0x28) != param_1) { iVar3 = iVar4; } uVar5 = uVar5 - 1; iVar4 = iVar3; } while (uVar5 != 0); return iVar3; } } else { uVar2 = 0; if (param_3 < 0) { if (uVar5 == 0) { return 0; } do { iVar1 = *(int *)(*(int *)(in_ECX + 0x44) + uVar2 * 4); if ((*(int *)(iVar1 + 0x28) == param_1) && (*(int *)(iVar1 + 0x2c) == param_2)) { iVar4 = iVar4 + 1; } uVar2 = uVar2 + 1; } while (uVar2 < uVar5); return iVar4; } if (uVar5 == 0) { return 0; } do { iVar1 = *(int *)(*(int *)(in_ECX + 0x44) + uVar2 * 4); if (((*(int *)(iVar1 + 0x28) == param_1) && (*(int *)(iVar1 + 0x2c) == param_2)) && (*(int *)(iVar1 + 0x30) == param_3)) { iVar4 = iVar4 + 1; } uVar2 = uVar2 + 1; } while (uVar2 < uVar5); } return iVar4; } //@@ 0041b770 FUN_0041b770 int FUN_0041b770(int param_1) { int iVar1; int in_ECX; int iVar2; int iVar3; int *piVar4; int iVar5; iVar5 = *(int *)(in_ECX + 0x9c); iVar2 = 0; if (iVar5 != 0) { piVar4 = *(int **)(in_ECX + 0x94); iVar3 = iVar2; do { iVar1 = *piVar4; piVar4 = piVar4 + 1; iVar2 = iVar3 + 1; if (*(int *)(iVar1 + 0x30) != param_1) { iVar2 = iVar3; } iVar5 = iVar5 + -1; iVar3 = iVar2; } while (iVar5 != 0); } return iVar2; } //@@ 0041b7b0 EntityList::CountEntities /* DB: Lua Isaac.CountEntities(spawner,type,variant,subtype) binding 00870b40 calls it: counts entities in the list (+0x44, count +0x4c) whose SpawnerEntity (+0x3c8) equals spawner and type/variant/subtype match (-1 wildcards); null spawner delegates to FUN_0041b690 */ int EntityList::CountEntities(EntityPtr param_1,int param_2,int param_3,int param_4) { int iVar1; uint i; int in_ECX; int newCount; uint entityCount; undefined4 *slot; Entity *entity; if (param_1 == (EntityPtr)0x0) { iVar1 = FUN_0041b690(param_2,param_3,param_4); return iVar1; } iVar1 = 0; entityCount = *(uint *)(in_ECX + 0x4c); if (param_3 < 0) { if (param_4 < 0) { if (param_2 == 0) { if (entityCount != 0) { slot = *(undefined4 **)(in_ECX + 0x44); do { entity = (Entity *)*slot; slot = slot + 1; newCount = iVar1 + 1; if (entity->_spawnerEntity != param_1) { newCount = iVar1; } entityCount = entityCount - 1; iVar1 = newCount; } while (entityCount != 0); return newCount; } } else { i = 0; if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if ((*(int *)(newCount + 0x28) == param_2) && (*(EntityPtr *)(newCount + 0x3c8) == param_1)) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); return iVar1; } } } else { i = 0; if (param_2 == 0) { if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if ((*(int *)(newCount + 0x30) == param_4) && (*(EntityPtr *)(newCount + 0x3c8) == param_1)) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); return iVar1; } } else if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if (((*(int *)(newCount + 0x28) == param_2) && (*(int *)(newCount + 0x30) == param_4)) && (*(EntityPtr *)(newCount + 0x3c8) == param_1)) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); return iVar1; } } } else if (param_4 < 0) { i = 0; if (param_2 == 0) { if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if ((*(int *)(newCount + 0x2c) == param_3) && (*(EntityPtr *)(newCount + 0x3c8) == param_1)) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); return iVar1; } } else if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if (((*(int *)(newCount + 0x28) == param_2) && (*(int *)(newCount + 0x2c) == param_3)) && (*(EntityPtr *)(newCount + 0x3c8) == param_1)) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); return iVar1; } } else if (param_2 == 0) { i = 0; if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if (((*(int *)(newCount + 0x2c) == param_3) && (*(int *)(newCount + 0x30) == param_4)) && (*(EntityPtr *)(newCount + 0x3c8) == param_1)) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); return iVar1; } } else { i = 0; if (entityCount != 0) { do { newCount = *(int *)(*(int *)(in_ECX + 0x44) + i * 4); if ((((*(int *)(newCount + 0x28) == param_2) && (*(int *)(newCount + 0x2c) == param_3)) && (*(int *)(newCount + 0x30) == param_4)) && (*(EntityPtr *)(newCount + 0x3c8) == param_1) ) { iVar1 = iVar1 + 1; } i = i + 1; } while (i < entityCount); } } return iVar1; } //@@ 0041b9f0 FUN_0041b9f0 void FUN_0041b9f0(undefined4 param_1,float param_2) { uint uVar1; void *pvVar2; int iVar3; undefined4 *in_ECX; int iVar4; uint uVar5; float in_XMM2_Da; float in_XMM3_Da; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar2 = ExceptionList; puStack_c = &LAB_00af1670; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = param_1; in_ECX[1] = in_XMM3_Da; in_ECX[2] = param_2; in_ECX[5] = in_XMM2_Da; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; local_8 = 0; iVar4 = (int)(param_2 / in_XMM2_Da + 0.5); iVar3 = (int)(in_XMM3_Da / in_XMM2_Da + 0.5); in_ECX[4] = iVar4; uVar5 = iVar4 * iVar3; in_ECX[3] = iVar3; uVar1 = (int)in_ECX[7] / 0xa4; if (uVar5 < uVar1) { iVar3 = uVar5 * 0xa4; } else { if (uVar5 <= uVar1) { ExceptionList = pvVar2; return; } if ((uint)((int)in_ECX[8] / 0xa4) < uVar5) { FUN_0041d230(uVar5,uVar5); ExceptionList = local_10; return; } iVar3 = FUN_0041d120(in_ECX[7],uVar5 - uVar1,param_1); } in_ECX[7] = iVar3; ExceptionList = local_10; return; } //@@ 0041baf0 FUN_0041baf0 void FUN_0041baf0(void) { int in_ECX; int iVar1; uint uVar2; int iVar3; uVar2 = 0; iVar1 = *(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18); iVar3 = iVar1 >> 0x1f; if (iVar1 / 0xa4 + iVar3 != iVar3) { iVar3 = 0; do { uVar2 = uVar2 + 1; *(undefined4 *)(iVar3 + 0xa0 + *(int *)(in_ECX + 0x18)) = 0; iVar3 = iVar3 + 0xa4; } while (uVar2 < (uint)((*(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18)) / 0xa4)); } return; } //@@ 0041bb50 CellSpace::insert /* DB: strings "CellSpace::insert: x1 > x2"/"y1 > y2" and "Entity Teleport Detected!": param entity pos (+0x33c), size*sizeMulti and rotation (+0xec) -> cell range in a grid of 0xa4-byte cells (max 40 entities each); called per entity from EntityList::rebuild_sublists */ void CellSpace::insert(int param_1) { int iVar1; int in_ECX; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; fVar9 = *(float *)(param_1 + 0x33c); fVar10 = *(float *)(param_1 + 0x340); fVar12 = *(float *)(param_1 + 0x374) * *(float *)(param_1 + 0x370); fVar11 = *(float *)(param_1 + 0x378) * *(float *)(param_1 + 0x370); if (((*(float *)(param_1 + 0x374) != g_vectorOne.x) || (*(float *)(param_1 + 0x378) != g_vectorOne.y)) && (*(float *)(param_1 + 0xec) != 0.0)) { fVar7 = *(float *)(param_1 + 0xec) * 0.017453292; fVar8 = cos(fVar7); fVar7 = sin(fVar7); fVar13 = fVar11 * fVar7; fVar11 = ABS(fVar11 * fVar8) + ABS(fVar12 * fVar7); fVar12 = ABS(fVar13) + ABS(fVar12 * fVar8); } fVar7 = fVar9 - fVar12; fVar12 = fVar12 + fVar9; fVar9 = fVar10 - fVar11; fVar11 = fVar11 + fVar10; if ((fVar12 <= fVar7) || (fVar11 <= fVar9)) { KAGE_LogMessage(0x10,(byte *) "Entity Teleport Detected! Type: %d, Variant: %d, Subtype: %d; Pos: %f, %f; Size: %f, %f\n" ); } fVar10 = *(float *)(in_ECX + 0x14); iVar2 = (int)(fVar9 / fVar10); iVar6 = (int)(fVar11 / fVar10); if (((iVar6 < iVar2) || (iVar2 + 1 <= iVar2)) || (iVar6 + 1 <= iVar6)) { KAGE_LogMessage(0x10,(byte *)"CellSpace::insert: y1 > y2\n"); fVar10 = *(float *)(in_ECX + 0x14); } iVar3 = (int)(fVar7 / fVar10); iVar4 = (int)(fVar12 / fVar10); if (((iVar4 < iVar3) || (iVar3 + 1 <= iVar3)) || (iVar4 + 1 <= iVar4)) { KAGE_LogMessage(0x10,(byte *)"CellSpace::insert: x1 > x2\n"); } for (; iVar1 = iVar3, iVar2 <= iVar6; iVar2 = iVar2 + 1) { for (; iVar1 <= iVar4; iVar1 = iVar1 + 1) { iVar5 = *(int *)(in_ECX + 0xc) * iVar2 + iVar1; if ((-1 < iVar5) && (iVar5 < (*(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18)) / 0xa4)) { iVar5 = iVar5 * 0xa4 + *(int *)(in_ECX + 0x18); if (*(int *)(iVar5 + 0xa0) < 0x28) { *(int *)(iVar5 + *(int *)(iVar5 + 0xa0) * 4) = param_1; *(int *)(iVar5 + 0xa0) = *(int *)(iVar5 + 0xa0) + 1; } } } } return; } //@@ 0041bdf0 CellSpace::collide_entity /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=CellSpace (cell size +0x14, columns +0xc, 0xa4-byte cells at +0x18): for each cell the entity overlaps, tests every other entity once (pair bit set at owner+0xc4 indexed by the two entity indices +0x24), circle (FUN_006b2940) or ellipse (FUN_006b25b0) collision when size multipliers differ from 1; per player from EntityList::rebuild_sublists */ void CellSpace::collide_entity(Entity *param_1) { float fVar1; float fVar2; int iVar3; int iVar4; Entity *this; int iVar5; int *in_ECX; int iVar6; uint uVar7; int iVar8; int iVar9; uint uVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; int local_2c; uint local_20; int local_1c; if (param_1->_entityCollisionClass != 0) { fVar1 = (param_1->_pos).x; fVar13 = param_1->_size * (param_1->_sizeMulti).x; iVar3 = *in_ECX; fVar11 = param_1->_size * (param_1->_sizeMulti).y; fVar12 = (float)in_ECX[5]; fVar14 = fVar13 + fVar1; iVar4 = *(int *)(iVar3 + 0xd4); fVar2 = (param_1->_pos).y; fVar15 = fVar11 + fVar2; local_2c = (int)((fVar2 - fVar11) / fVar12); if (local_2c <= (int)(fVar15 / fVar12)) { do { local_1c = (int)((fVar1 - fVar13) / fVar12); if (local_1c <= (int)(fVar14 / fVar12)) { do { iVar8 = local_1c + in_ECX[3] * local_2c; if ((-1 < iVar8) && (iVar8 < (in_ECX[7] - in_ECX[6]) / 0xa4)) { local_20 = 0; iVar8 = iVar8 * 0xa4 + in_ECX[6]; if (*(int *)(iVar8 + 0xa0) != 0) { do { this = *(Entity **)(iVar8 + local_20 * 4); iVar5 = param_1->_collisionIndex; iVar6 = this->_collisionIndex; iVar9 = iVar6; if (iVar6 < iVar5) { iVar9 = iVar5; } if (iVar5 < iVar6) { iVar6 = iVar5; } uVar10 = iVar9 * iVar4 + iVar6; if ((this != param_1) && ((int)uVar10 < *(int *)(iVar3 + 0xd0))) { uVar7 = uVar10 >> 5; if ((*(uint *)(*(int *)(iVar3 + 0xc4) + uVar7 * 4) & 1 << (sbyte)(uVar10 & 0x1f) ) == 0) { if (((((this->_sizeMulti).x == g_vectorOne.x) && ((this->_sizeMulti).y == g_vectorOne.y)) && ((param_1->_sizeMulti).x == g_vectorOne.x)) && ((param_1->_sizeMulti).y == g_vectorOne.y)) { Entity::push_apart_circle(this,param_1); } else { Entity::push_apart_capsule(this,param_1); } _DAT_00c71650 = _DAT_00c71650 + 1; *(uint *)(*(int *)(iVar3 + 0xc4) + uVar7 * 4) = *(uint *)(*(int *)(iVar3 + 0xc4) + uVar7 * 4) | 1 << (uVar10 & 0x1f); } } local_20 = local_20 + 1; } while (local_20 < *(uint *)(iVar8 + 0xa0)); } } fVar12 = (float)in_ECX[5]; local_1c = local_1c + 1; } while (local_1c <= (int)(fVar14 / fVar12)); } local_2c = local_2c + 1; } while (local_2c <= (int)(fVar15 / fVar12)); } } return; } //@@ 0041c070 CellSpace::collide /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: string "CellSpace::collide - cell counts don't match!": ECX and param are two CellSpaces with equal cell counts, tests every entity pair of matching cells once (pair bit set); EntityList::rebuild_sublists calls it for each sublist pair */ void CellSpace::collide(int param_1) { uint *puVar1; int iVar2; int iVar3; Entity *this; Entity *other; int iVar4; uint uVar5; int iVar6; int *in_ECX; int iVar7; int iVar8; uint uVar9; uint uVar10; undefined4 *local_38; uint local_34; uint local_30; int local_2c; iVar6 = in_ECX[7]; if ((iVar6 - in_ECX[6]) / 0xa4 != (*(int *)(param_1 + 0x1c) - *(int *)(param_1 + 0x18)) / 0xa4) { KAGE_LogMessage(0x10,(byte *)"CellSpace::collide - cell counts don\'t match!\n"); iVar6 = in_ECX[7]; } iVar2 = *in_ECX; iVar7 = in_ECX[6]; local_30 = 0; iVar3 = *(int *)(iVar2 + 0xd4); iVar4 = iVar6 - iVar7 >> 0x1f; if ((iVar6 - iVar7) / 0xa4 + iVar4 != iVar4) { local_2c = 0; do { local_38 = (undefined4 *)(local_2c + iVar7); local_34 = 0; iVar6 = *(int *)(param_1 + 0x18) + local_2c; puVar1 = local_38 + 0x28; if (*puVar1 != 0) { do { uVar10 = 0; if (*(int *)(iVar6 + 0xa0) != 0) { do { this = (Entity *)*local_38; other = *(Entity **)(iVar6 + uVar10 * 4); iVar7 = this->_collisionIndex; iVar4 = other->_collisionIndex; iVar8 = iVar7; if (iVar7 < iVar4) { iVar8 = iVar4; } if (iVar4 < iVar7) { iVar7 = iVar4; } uVar9 = iVar8 * iVar3 + iVar7; if ((this != other) && ((int)uVar9 < *(int *)(iVar2 + 0xd0))) { uVar5 = *(uint *)(*(int *)(iVar2 + 0xc4) + (uVar9 >> 5) * 4); if ((uVar5 & 1 << (sbyte)(uVar9 & 0x1f)) == 0) { *(uint *)(*(int *)(iVar2 + 0xc4) + (uVar9 >> 5) * 4) = uVar5 | 1 << (uVar9 & 0x1f) ; if (((((this->_sizeMulti).x == g_vectorOne.x) && ((this->_sizeMulti).y == g_vectorOne.y)) && ((other->_sizeMulti).x == g_vectorOne.x)) && ((other->_sizeMulti).y == g_vectorOne.y)) { Entity::push_apart_circle(this,other); } else { Entity::push_apart_capsule(this,other); } _DAT_00c71650 = _DAT_00c71650 + 1; } } uVar10 = uVar10 + 1; } while (uVar10 < *(uint *)(iVar6 + 0xa0)); } local_34 = local_34 + 1; local_38 = local_38 + 1; } while (local_34 < *puVar1); } local_30 = local_30 + 1; local_2c = local_2c + 0xa4; iVar7 = in_ECX[6]; } while (local_30 < (uint)((in_ECX[7] - iVar7) / 0xa4)); } return; } //@@ 0041c2a0 CellSpace::collide_self /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=CellSpace: for every cell tests each entity pair inside that cell once (pair bit set like CellSpace::collide); twice from EntityList::rebuild_sublists between CellSpace::collide calls */ void CellSpace::collide_self(void) { undefined4 *puVar1; int iVar2; int iVar3; Entity *other; Entity *this; uint uVar4; int *in_ECX; int iVar5; int iVar6; uint uVar7; uint uVar8; int iVar9; bool bVar10; undefined4 *local_38; int local_34; uint local_30; uint local_2c; local_2c = 0; iVar2 = *in_ECX; iVar9 = in_ECX[6]; iVar3 = *(int *)(iVar2 + 0xd4); iVar5 = in_ECX[7] - iVar9 >> 0x1f; if ((in_ECX[7] - iVar9) / 0xa4 + iVar5 != iVar5) { local_34 = 0; do { uVar7 = *(uint *)(local_34 + 0xa0 + iVar9); puVar1 = (undefined4 *)(local_34 + iVar9); if (uVar7 != 0) { local_30 = 1; local_38 = puVar1; do { uVar8 = local_30; if (local_30 < uVar7) { do { other = (Entity *)puVar1[uVar8]; this = (Entity *)*local_38; iVar9 = other->_collisionIndex; iVar5 = this->_collisionIndex; iVar6 = iVar5; if (iVar5 < iVar9) { iVar6 = iVar9; } if (iVar9 < iVar5) { iVar5 = iVar9; } uVar7 = iVar6 * iVar3 + iVar5; if ((this != other) && ((int)uVar7 < *(int *)(iVar2 + 0xd0))) { uVar4 = *(uint *)(*(int *)(iVar2 + 0xc4) + (uVar7 >> 5) * 4); if ((uVar4 & 1 << (sbyte)(uVar7 & 0x1f)) == 0) { *(uint *)(*(int *)(iVar2 + 0xc4) + (uVar7 >> 5) * 4) = uVar4 | 1 << (uVar7 & 0x1f) ; if (((((this->_sizeMulti).x == g_vectorOne.x) && ((this->_sizeMulti).y == g_vectorOne.y)) && ((other->_sizeMulti).x == g_vectorOne.x)) && ((other->_sizeMulti).y == g_vectorOne.y)) { Entity::push_apart_circle(this,other); } else { Entity::push_apart_capsule(this,other); } _DAT_00c71650 = _DAT_00c71650 + 1; } } uVar8 = uVar8 + 1; uVar7 = puVar1[0x28]; } while (uVar8 < uVar7); } local_38 = local_38 + 1; bVar10 = local_30 < uVar7; local_30 = local_30 + 1; } while (bVar10); } local_34 = local_34 + 0xa4; iVar9 = in_ECX[6]; local_2c = local_2c + 1; } while (local_2c < (uint)((in_ECX[7] - iVar9) / 0xa4)); } return; } //@@ 0041c490 EntityPartition::query_box /* DB: ? thiscall partition grid (cell size this[5], width this[3], cells vector this[6..7] of 0xa4 bytes): for every cell overlapping the box (pos param_2, extent param_3) appends each not-yet-seen entity to the result list param_1 ("EL: not enough space for push_back"); EntityList::QueryRadius, query_player_capsule_hits */ void EntityPartition::query_box(int param_1,float *param_2,float *param_3) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; int iVar7; int iVar8; int iVar9; qword qVar10; void *_Dst; int *in_ECX; int iVar11; int iVar12; qword *pqVar13; int iVar14; uint uVar15; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1690; local_10 = ExceptionList; ExceptionList = &local_10; if (*(uint *)(*in_ECX + 0xd4) != 0) { _Dst = operator_new_tracked(*(uint *)(*in_ECX + 0xd4)); memset(_Dst,0,*(size_t *)(*in_ECX + 0xd4)); fVar1 = param_3[1]; fVar2 = *param_3; fVar3 = *param_2; fVar4 = param_2[1]; fVar5 = (float)in_ECX[5]; fVar6 = *param_2; for (iVar11 = (int)((param_2[1] - fVar1) / fVar5); iVar9 = (int)((fVar3 - fVar2) / fVar5), iVar11 <= (int)((fVar1 + fVar4) / fVar5); iVar11 = iVar11 + 1) { for (; iVar9 <= (int)((fVar2 + fVar6) / fVar5); iVar9 = iVar9 + 1) { iVar14 = iVar9 + in_ECX[3] * iVar11; if ((-1 < iVar14) && (iVar14 < (in_ECX[7] - in_ECX[6]) / 0xa4)) { uVar15 = 0; iVar14 = iVar14 * 0xa4 + in_ECX[6]; if (*(int *)(iVar14 + 0xa0) != 0) { do { iVar7 = *(int *)(iVar14 + uVar15 * 4); iVar8 = *(int *)(iVar7 + 0x24); if (*(char *)(iVar8 + (int)_Dst) == '\0') { iVar12 = *(int *)(param_1 + 0xc); if (*(uint *)(param_1 + 8) < iVar12 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar12 = *(int *)(param_1 + 0xc); } *(int *)(*(int *)(param_1 + 4) + iVar12 * 4) = iVar7; *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1; *(undefined1 *)(iVar8 + (int)_Dst) = 1; } uVar15 = uVar15 + 1; } while (uVar15 < *(uint *)(iVar14 + 0xa0)); } } } } if (g_mainHeap == (void *)0x0) { pqVar13 = &g_allocatedBytesNoHeap; } else { pqVar13 = (qword *)((int)g_mainHeap + 0x30); } if (_Dst != (void *)0x0) { uVar15 = *(uint *)((int)_Dst + -4); qVar10 = *pqVar13; *(uint *)pqVar13 = (uint)*pqVar13 - uVar15; *(uint *)((int)pqVar13 + 4) = *(uint *)((int)pqVar13 + 4) - (uint)((uint)qVar10 < uVar15); free((void *)((int)_Dst + -4)); } } ExceptionList = local_10; return; } //@@ 0041c670 FUN_0041c670 void FUN_0041c670(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0xa4) * 0xa4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0041c6f0 FUN_0041c6f0 int FUN_0041c6f0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::_Try_emplace(local_10,param_1); return *piVar1 + 0x1c; } //@@ 0041c710 FUN_0041c710 void FUN_0041c710(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 0041c770 shared_ptr::assign /* DB: refcount vtable acquire/release prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall shared_ptr::assign(void *this,void *other) { int *piVar1; undefined4 uVar2; char cVar3; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; piVar1 = *(int **)((int)other + 4); uVar2 = *(undefined4 *)other; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if (*(int **)((int)this + 4) != (int *)0x0) { cVar3 = (**(code **)(**(int **)((int)this + 4) + 0xc))(); if ((cVar3 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(this); } } *(int **)((int)this + 4) = piVar1; *(undefined4 *)this = uVar2; } } return; } //@@ 0041c7d0 FUN_0041c7d0 void FUN_0041c7d0(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x38) * 0x38; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0041c840 FUN_0041c840 void FUN_0041c840(void) { int iVar1; int iVar2; void *pvVar3; int *in_ECX; undefined4 extraout_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; pvVar3 = std::_Allocate(0x7000); FUN_0041d0e0(pvVar3,extraout_ECX); FUN_0041c970(pvVar3,(iVar1 - iVar2) / 0x38,0x200); return; } //@@ 0041c890 FUN_0041c890 undefined4 * FUN_0041c890(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; uVar2 = FUN_0041ca00(param_2,param_4,param_5); *param_1 = *in_ECX; param_1[1] = 0; FUN_0041c910(uVar2); uVar2 = *param_1; uVar1 = param_1[1]; FUN_0041c910(param_2); FUN_0041cb90(uVar2,uVar1,uVar2,uVar1); return param_1; } //@@ 0041c910 FUN_0041c910 void FUN_0041c910(int param_1) { int *in_ECX; uint uVar1; if ((param_1 < 0) && ((uint)in_ECX[1] < (uint)-param_1)) { uVar1 = in_ECX[1] + param_1; in_ECX[1] = uVar1; *in_ECX = *in_ECX + (~uVar1 >> 5) * -4 + -4; in_ECX[1] = uVar1 & 0x1f; return; } uVar1 = in_ECX[1] + param_1; in_ECX[1] = uVar1; *in_ECX = *in_ECX + (uVar1 >> 5) * 4; in_ECX[1] = uVar1 & 0x1f; return; } //@@ 0041c970 FUN_0041c970 void FUN_0041c970(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x38) * 0x38; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x38; in_ECX[2] = param_1 + param_3 * 0x38; return; } //@@ 0041ca00 FUN_0041ca00 int FUN_0041ca00(uint param_1,int param_2,int param_3) { uint *puVar1; code *pcVar2; int iVar3; int *in_ECX; uint uVar4; uint uVar5; uint *puVar6; uint *puVar7; int local_20; uint local_14; param_3 = (param_2 - *in_ECX >> 2) * 0x20 + param_3; if (param_1 == 0) { return param_3; } if (0x7fffffffU - in_ECX[3] < param_1) { FUN_0041cb50(); pcVar2 = (code *)swi(3); iVar3 = (*pcVar2)(); return iVar3; } uVar4 = in_ECX[3] + 0x1f + param_1 >> 5; uVar5 = in_ECX[1] - *in_ECX >> 2; local_14 = 0; if (uVar4 < uVar5) { iVar3 = *in_ECX + uVar4 * 4; } else { if (uVar4 <= uVar5) goto LAB_0041ca93; if ((uint)(in_ECX[2] - *in_ECX >> 2) < uVar4) { FUN_0041d400(uVar4,&local_14); goto LAB_0041ca93; } iVar3 = FUN_0041d1b0(in_ECX[1],uVar4 - uVar5,&local_14); } in_ECX[1] = iVar3; LAB_0041ca93: if (in_ECX[3] == 0) { in_ECX[3] = param_1; } else { puVar1 = (uint *)*in_ECX; local_20 = 0; FUN_0041c910(in_ECX[3]); iVar3 = in_ECX[3]; in_ECX[3] = iVar3 + param_1; local_14 = 0; FUN_0041c910(iVar3 + param_1); FUN_0041c910(param_3); puVar6 = puVar1; puVar7 = puVar1; while ((puVar1 != puVar7 || (local_20 != 0))) { if (local_20 == 0) { local_20 = 0x1f; puVar7 = puVar7 + -1; } else { local_20 = local_20 + -1; } if (local_14 == 0) { local_14 = 0x1f; puVar6 = puVar6 + -1; } else { local_14 = local_14 - 1; } if ((*puVar7 & 1 << ((byte)local_20 & 0x1f)) == 0) { *puVar6 = *puVar6 & ~(1 << (local_14 & 0x1f)); } else { *puVar6 = *puVar6 | 1 << (local_14 & 0x1f); } } } return param_3; } //@@ 0041cb50 FUN_0041cb50 void FUN_0041cb50(void) { /* WARNING: Subroutine does not return */ std::_Xlength_error("vector too long"); } //@@ 0041cb60 std::min /* DB: returns pointer to smaller of two ints */ int * std::min(void) { int *in_ECX; int *in_EDX; if (*in_EDX < *in_ECX) { in_ECX = in_EDX; } return in_ECX; } //@@ 0041cb70 std::max /* DB: returns pointer to larger of two floats */ float * std::max(void) { float *in_ECX; float *in_EDX; if (*in_ECX <= *in_EDX && *in_EDX != *in_ECX) { in_ECX = in_EDX; } return in_ECX; } //@@ 0041cb80 std::max /* DB: returns pointer to larger of two ints */ int * std::max(void) { int *in_ECX; int *in_EDX; if (*in_ECX < *in_EDX) { in_ECX = in_EDX; } return in_ECX; } //@@ 0041cb90 FUN_0041cb90 void FUN_0041cb90(uint *param_1,int param_2,uint *param_3,int param_4) { char cVar1; int _Val; char *in_ECX; uint uVar2; uint uVar3; uint uVar4; if ((param_1 != param_3) || (param_2 != param_4)) { uVar2 = -1 << ((byte)param_2 & 0x1f); cVar1 = *in_ECX; if (param_1 == param_3) { uVar3 = 0xffffffff >> (0x20U - (char)param_4 & 0x1f); uVar4 = 0; if (cVar1 != '\0') { uVar4 = uVar3; } *param_1 = uVar4 & uVar2 | (~uVar3 | ~uVar2) & *param_1; return; } uVar4 = 0; if (cVar1 != '\0') { uVar4 = uVar2; } *param_1 = uVar4 | *param_1 & ~uVar2; _Val = 0; if (*in_ECX != '\0') { _Val = 0xff; } memset(param_1 + 1,_Val,(int)param_3 - (int)(param_1 + 1)); if (param_4 != 0) { uVar4 = 0xffffffff >> (0x20U - (char)param_4 & 0x1f); uVar2 = 0; if (cVar1 != '\0') { uVar2 = uVar4; } *param_3 = uVar2 | ~uVar4 & *param_3; } } return; } //@@ 0041cc60 FUN_0041cc60 void FUN_0041cc60(undefined4 *param_1,void *param_2) { void *ptr; void *in_ECX; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = param_2; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); ptr = std_tree_extract(in_ECX,param_2); if (*(char *)((int)ptr + 0x1c) == '\0') { local_8 = 0; tracked_alloc(1,*(void **)((int)ptr + 0x20),0); } operator_delete(ptr,0x2c); *param_1 = local_14; ExceptionList = local_10; return; } //@@ 0041ccf0 FUN_0041ccf0 undefined4 * FUN_0041ccf0(int param_1,undefined4 *param_2) { undefined4 *puVar1; uint uVar2; int iVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 *puVar7; int *in_ECX; uint uVar8; undefined4 *puVar9; int iVar10; iVar10 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x38; if (iVar3 == 0x4924924) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (in_ECX[2] - *in_ECX) / 0x38; if (0x4924924 - (uVar2 >> 1) < uVar2) { uVar8 = 0x4924924; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar8 = iVar3 + 1U; if (iVar3 + 1U <= uVar2) { uVar8 = uVar2; } if (0x4924924 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = std::_Allocate(uVar8 * 0x38); puVar1 = puVar7 + ((param_1 - iVar10) / 0x38) * 0xe; uVar4 = param_2[1]; uVar5 = param_2[2]; uVar6 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar4; puVar1[2] = uVar5; puVar1[3] = uVar6; uVar4 = param_2[5]; uVar5 = param_2[6]; uVar6 = param_2[7]; puVar1[4] = param_2[4]; puVar1[5] = uVar4; puVar1[6] = uVar5; puVar1[7] = uVar6; uVar4 = param_2[9]; uVar5 = param_2[10]; uVar6 = param_2[0xb]; puVar1[8] = param_2[8]; puVar1[9] = uVar4; puVar1[10] = uVar5; puVar1[0xb] = uVar6; *(undefined8 *)(puVar1 + 0xc) = *(undefined8 *)(param_2 + 0xc); iVar10 = *in_ECX; puVar9 = puVar7; if (param_1 != in_ECX[1]) { FUN_0041d0e0(puVar7,iVar10); puVar9 = puVar1 + 0xe; } FUN_0041d0e0(puVar9,iVar10); FUN_0041c970(puVar7,iVar3 + 1,uVar8); return puVar1; } //@@ 0041ce30 std::map::_Try_emplace /* DB: MSVC _Tree try_emplace: key 3 ints compared lexicographically (node+0x10..0x18), value 16 bytes zeroed (node 0x2c, max_size 0x5d1745d); operator[] wrapper 0x41c6f0 returns node+0x1c, used by EntityList::QuerySublist cache */ void std::map::_Try_emplace(int *param_1,int *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af16bd; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_0041d390(&local_24,param_2); if (*(char *)(local_1c + 0xd) == '\0') { if (*(int *)(local_1c + 0x10) <= *param_2) { if (*param_2 <= *(int *)(local_1c + 0x10)) { if ((param_2[1] < *(int *)(local_1c + 0x14)) || ((param_2[1] <= *(int *)(local_1c + 0x14) && (param_2[2] < *(int *)(local_1c + 0x18))))) goto LAB_0041cea8; } *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } LAB_0041cea8: if (in_ECX[1] == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x2c); *(undefined8 *)(piVar6 + 4) = *(undefined8 *)param_2; piVar6[6] = param_2[2]; *(undefined1 *)(piVar6 + 7) = 0; piVar6[8] = 0; piVar6[9] = 0; piVar6[10] = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_0041cfaa: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_0041cfaa; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 0041d030 std::map::destroy_subtree /* DB: recursive red-black tree node free prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall std::map::destroy_subtree(void *this,void *allocator,void *node) { char cVar1; int *piVar2; int iVar3; uint uVar4; qword qVar5; void **ppvVar6; qword *pqVar7; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; cVar1 = *(char *)((int)node + 0xd); ppvVar6 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar6, cVar1 == '\0') { destroy_subtree(this,allocator,*(void **)((int)node + 8)); piVar2 = *(int **)node; if ((char)*(int *)((int)node + 0x1c) == '\0') { iVar3 = *(int *)((int)node + 0x20); if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } if (iVar3 != 0) { uVar4 = *(uint *)(iVar3 + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)(iVar3 + -4)); } } operator_delete(node,0x2c); ppvVar6 = ExceptionList; node = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } ExceptionList = local_10; return; } //@@ 0041d0e0 FUN_0041d0e0 void FUN_0041d0e0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; undefined4 *in_EDX; for (; in_ECX != in_EDX; in_ECX = in_ECX + 0xe) { uVar1 = in_ECX[1]; uVar2 = in_ECX[2]; uVar3 = in_ECX[3]; *param_1 = *in_ECX; param_1[1] = uVar1; param_1[2] = uVar2; param_1[3] = uVar3; uVar1 = in_ECX[5]; uVar2 = in_ECX[6]; uVar3 = in_ECX[7]; param_1[4] = in_ECX[4]; param_1[5] = uVar1; param_1[6] = uVar2; param_1[7] = uVar3; uVar1 = in_ECX[9]; uVar2 = in_ECX[10]; uVar3 = in_ECX[0xb]; param_1[8] = in_ECX[8]; param_1[9] = uVar1; param_1[10] = uVar2; param_1[0xb] = uVar3; *(undefined8 *)(param_1 + 0xc) = *(undefined8 *)(in_ECX + 0xc); param_1 = param_1 + 0xe; } return; } //@@ 0041d120 FUN_0041d120 void FUN_0041d120(int param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *(undefined4 *)(param_1 + 0xa0) = 0; param_1 = param_1 + 0xa4; } return; } //@@ 0041d150 FID_conflict:_Change_array /* Library Function - Multiple Matches With Different Base Names private: void __thiscall std::vector >::_Change_array(unsigned int * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(unsigned int * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(struct CHN * * const,unsigned int,unsigned int) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Change_array(void *this,uint *param_1,uint param_2,uint param_3) { void *pvVar1; void *ptr; uint size; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = *(int *)((int)this + 8) - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(uint **)this = param_1; *(uint **)((int)this + 4) = param_1 + param_2; *(uint **)((int)this + 8) = param_1 + param_3; return; } //@@ 0041d1b0 FUN_0041d1b0 int * FUN_0041d1b0(int *param_1,int param_2,int *param_3) { if (*param_3 == 0) { memset(param_1,0,param_2 * 4); return param_1 + param_2; } for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = *param_3; param_1 = param_1 + 1; } return param_1; } //@@ 0041d210 FUN_0041d210 void FUN_0041d210(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x2c); } return; } //@@ 0041d230 FUN_0041d230 void FUN_0041d230(uint param_1) { uint uVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 *puVar4; uint size; int *in_ECX; int iVar5; int iVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 *puVar9; if (0x18f9c18 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar6 = (in_ECX[1] - *in_ECX) / 0xa4; uVar1 = (in_ECX[2] - *in_ECX) / 0xa4; if (0x18f9c18 - (uVar1 >> 1) < uVar1) { uVar1 = 0x18f9c18; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } else if (0x18f9c18 < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar2 = std::_Allocate(uVar1 * 0xa4); iVar5 = param_1 - iVar6; if (iVar5 != 0) { puVar3 = puVar2 + iVar6 * 0x29 + 0x28; do { *puVar3 = 0; puVar3 = puVar3 + 0x29; iVar5 = iVar5 + -1; } while (iVar5 != 0); } puVar3 = (undefined4 *)*in_ECX; puVar8 = (undefined4 *)in_ECX[1]; puVar4 = puVar2; if (puVar3 != puVar8) { do { puVar7 = puVar3 + 0x29; puVar9 = puVar4; for (iVar6 = 0x29; iVar6 != 0; iVar6 = iVar6 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } puVar4 = puVar4 + 0x29; puVar3 = puVar7; } while (puVar7 != puVar8); puVar3 = (undefined4 *)*in_ECX; } if (puVar3 != (undefined4 *)0x0) { size = ((in_ECX[2] - (int)puVar3) / 0xa4) * 0xa4; puVar8 = puVar3; if (0xfff < size) { puVar8 = (undefined4 *)puVar3[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar3 + (-4 - (int)puVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar8,size); } *in_ECX = (int)puVar2; in_ECX[1] = (int)(puVar2 + param_1 * 0x29); in_ECX[2] = (int)(puVar2 + uVar1 * 0x29); return; } //@@ 0041d390 FUN_0041d390 int * FUN_0041d390(int *param_1,int *param_2) { int iVar1; undefined4 *puVar2; int *in_ECX; int iVar3; iVar1 = *in_ECX; puVar2 = *(undefined4 **)(iVar1 + 4); *param_1 = (int)puVar2; param_1[1] = 0; param_1[2] = iVar1; if (*(char *)((int)puVar2 + 0xd) == '\0') { iVar1 = *param_2; do { *param_1 = (int)puVar2; if ((int)puVar2[4] < iVar1) { LAB_0041d3dc: puVar2 = (undefined4 *)puVar2[2]; iVar3 = 0; } else { if ((int)puVar2[4] <= iVar1) { if (((int)puVar2[5] < param_2[1]) || (((int)puVar2[5] <= param_2[1] && ((int)puVar2[6] < param_2[2])))) goto LAB_0041d3dc; } param_1[2] = (int)puVar2; iVar3 = 1; puVar2 = (undefined4 *)*puVar2; } param_1[1] = iVar3; } while (*(char *)((int)puVar2 + 0xd) == '\0'); } return param_1; } //@@ 0041d400 FUN_0041d400 void FUN_0041d400(uint param_1,undefined4 param_2) { uint *_Dst; int *in_ECX; uint uVar1; int iVar2; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar2 = in_ECX[1] - *in_ECX >> 2; uVar1 = in_ECX[2] - *in_ECX >> 2; if (0x3fffffff - (uVar1 >> 1) < uVar1) { uVar1 = 0x3fffffff; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } else if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar1 * 4); FUN_0041d1b0(_Dst + iVar2,param_1 - iVar2,param_2); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,param_1,uVar1); return; } //@@ 0041d4b0 FUN_0041d4b0 void FUN_0041d4b0(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; return; } //@@ 0041d4c0 FUN_0041d4c0 undefined * FUN_0041d4c0(void) { return &DAT_00c71648; } //@@ 0041d4d0 FUN_0041d4d0 int FUN_0041d4d0(void) { uint *puVar1; int iVar2; puVar1 = (uint *)FUN_0041d4c0(); iVar2 = __stdio_common_vsprintf(*puVar1 | 1,puVar1[1]); if (iVar2 < 0) { iVar2 = -1; } return iVar2; } //@@ 0041d510 FUN_0041d510 void FUN_0041d510(void) { return; } //@@ 0041d520 sin /* DB: tail-calls libm_sse2_sin_precise prototype: db/protos.zhl */ float __cdecl sin(float x) { double dVar1; dVar1 = (double)x; libm_sse2_sin_precise(); return (float)dVar1; } //@@ 0041d540 cos /* DB: thunk to libm_sse2_cos_precise prototype: db/protos.zhl */ float __cdecl cos(float x) { double dVar1; dVar1 = (double)x; libm_sse2_cos_precise(); return (float)dVar1; } //@@ 0041d560 FUN_0041d560 void FUN_0041d560(void) { undefined2 *in_ECX; int iVar1; undefined4 *puVar2; *(undefined4 *)(in_ECX + 0x36e) = 0; *(undefined4 *)(in_ECX + 0x370) = 0; memset(in_ECX + 0x1c,0,0x115); memset(in_ECX + 0x1ec,0,0x1ba); puVar2 = (undefined4 *)(in_ECX + 0xa8); for (iVar1 = 0xa2; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar2 = 0; puVar2 = puVar2 + 1; } *(undefined4 *)(in_ECX + 0x2ca) = 0; *(undefined4 *)(in_ECX + 0x2cc) = 0; *(undefined4 *)(in_ECX + 0x2ce) = 0; *(undefined4 *)(in_ECX + 0x2d0) = 0; *(undefined4 *)(in_ECX + 0x2d2) = 0; *(undefined4 *)(in_ECX + 0x2d4) = 0; *(undefined4 *)(in_ECX + 0x2d6) = 0; *(undefined4 *)(in_ECX + 0x2d8) = 0; *(undefined4 *)(in_ECX + 0x2da) = 0; *(undefined4 *)(in_ECX + 0x2dc) = 0; *(undefined4 *)(in_ECX + 0x2de) = 0; *(undefined4 *)(in_ECX + 0x2e0) = 0; *(undefined4 *)(in_ECX + 0x2e2) = 0; in_ECX[0x2e4] = 0; *(undefined1 *)(in_ECX + 0x2e5) = 0; memset((void *)((int)in_ECX + 0x5cb),0,0x43); *(undefined4 *)(in_ECX + 0x307) = 0; *(undefined4 *)(in_ECX + 0x309) = 0; *(undefined4 *)(in_ECX + 0x30b) = 0; *(undefined4 *)(in_ECX + 0x30d) = 0; *(undefined8 *)(in_ECX + 0x30f) = 0; *(undefined4 *)(in_ECX + 0x313) = 0; in_ECX[0x315] = 0; *(undefined1 *)(in_ECX + 0x316) = 0; *(undefined4 *)(in_ECX + 0x318) = 0; *(undefined4 *)(in_ECX + 0x31a) = 0; *(undefined4 *)(in_ECX + 0x31c) = 0; *(undefined4 *)(in_ECX + 0x31e) = 0; *(undefined4 *)(in_ECX + 800) = 0; *(undefined4 *)(in_ECX + 0x322) = 0; *(undefined4 *)(in_ECX + 0x324) = 0; *(undefined4 *)(in_ECX + 0x326) = 0; *(undefined4 *)(in_ECX + 0x328) = 0; *(undefined4 *)(in_ECX + 0x32a) = 0; *(undefined4 *)(in_ECX + 0x32c) = 0; *(undefined4 *)(in_ECX + 0x32e) = 0; *(undefined4 *)(in_ECX + 0x330) = 0; *(undefined4 *)(in_ECX + 0x332) = 0; *(undefined4 *)(in_ECX + 0x334) = 0; *(undefined4 *)(in_ECX + 0x336) = 0; *(undefined4 *)(in_ECX + 0x338) = 0; *(undefined4 *)(in_ECX + 0x33a) = 0; *(undefined4 *)(in_ECX + 0x33c) = 0; *(undefined4 *)(in_ECX + 0x33e) = 0; *(undefined8 *)(in_ECX + 0x340) = 0; *(undefined4 *)(in_ECX + 0x344) = 0; memset(in_ECX + 0x346,0,0x4d); *in_ECX = 0; *(undefined1 *)(in_ECX + 0x372) = 1; return; } //@@ 0041d670 AfterbirthPersistentGameData::check_header /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? validates AB/AB+ save headers CNGSAVE06R/07R/08R, "AfterbirthPersistentGameData wrong file header", "Different number of achievements/challenges/..."; caller 0x92b930 is reached from PersistentGameData::TryImportABLocalSave */ undefined4 AfterbirthPersistentGameData::check_header(int *param_1) { char cVar1; uint uVar2; int *piVar3; int *piVar4; int iVar5; uint uVar6; bool bVar7; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_40; uint local_3c; int local_38; int local_34; char local_2e; char local_2d; char local_2c; char local_2b; char local_2a; char local_29; uint local_28; int local_24; uint local_20; int local_1c [4]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); (**(code **)(*param_1 + 0x14))(local_1c,1,0x10); piVar3 = &DAT_00b1b98c; piVar4 = local_1c; uVar6 = 0xc; do { if (*piVar3 != *piVar4) { piVar3 = &DAT_00b1b9a0; piVar4 = local_1c; uVar6 = 0xc; goto LAB_0041d6d1; } piVar3 = piVar3 + 1; piVar4 = piVar4 + 1; bVar7 = 3 < uVar6; uVar6 = uVar6 - 4; } while (bVar7); uVar6 = 6; local_34 = 9; goto LAB_0041d717; LAB_0041d6d1: if (*piVar3 == *piVar4) goto code_r0x0041d6d7; piVar3 = &DAT_00b1b9b4; piVar4 = local_1c; uVar6 = 0xc; do { if (*piVar3 != *piVar4) { KAGE_LogMessage(1,(byte *)"AfterbirthPersistentGameData wrong file header (%.16s)\n"); return 0; } piVar3 = piVar3 + 1; piVar4 = piVar4 + 1; bVar7 = 3 < uVar6; uVar6 = uVar6 - 4; } while (bVar7); uVar6 = 8; goto LAB_0041d710; code_r0x0041d6d7: piVar3 = piVar3 + 1; piVar4 = piVar4 + 1; bVar7 = uVar6 < 4; uVar6 = uVar6 - 4; if (bVar7) goto code_r0x0041d6e2; goto LAB_0041d6d1; code_r0x0041d6e2: uVar6 = 7; LAB_0041d710: local_34 = 10; LAB_0041d717: uVar2 = checksum_stream(param_1,0x10,4); (**(code **)(*param_1 + 0xc))(0xfffffffc,2); local_3c = 0; (**(code **)(*param_1 + 0x14))(&local_3c,4,1); if ((7 < uVar6) && (local_3c != uVar2)) { KAGE_LogMessage(1,(byte *)"[warn] AfterbirthPersistentGameData checksum invalid!\n"); return 0; } (**(code **)(*param_1 + 0xc))(0x10,0); iVar5 = local_24; (**(code **)(*param_1 + 0x14))(local_24 + 0x6dc,4,1); local_38 = 0; cVar1 = (**(code **)(*param_1 + 0x10))(); joined_r0x0041d798: if (((cVar1 != '\0') || (local_38 < 0)) || (local_34 <= local_38)) { (**(code **)(*param_1 + 0x14))(iVar5 + 0x6e0,4,1); return 1; } (**(code **)(*param_1 + 0x14))(&local_38,4,1); local_28 = 0; (**(code **)(*param_1 + 0x14))(&local_28,4,1); if (local_28 == 0) goto switchD_0041d7f3_default; switch(local_38) { case 1: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0x115; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of achievements %d/%d\n"); bVar7 = local_20 == 0x115; } if (0x114 < local_20 && !bVar7) { local_20 = 0x115; } uVar6 = 0; if (local_20 != 0) { do { if (local_28 <= uVar6) break; (**(code **)(*param_1 + 0x14))(&local_29,1,1); *(bool *)(iVar5 + 0x38 + uVar6) = '\0' < local_29; uVar6 = uVar6 + 1; } while (uVar6 < local_20); } break; case 2: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0xa2; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of counters %d/%d\n"); bVar7 = local_20 == 0xa2; } if (0xa1 < local_20 && !bVar7) { local_20 = 0xa2; } uVar6 = 0; if (local_20 != 0) { uVar2 = 0; do { if (local_28 <= uVar2) goto LAB_0041dd41; (**(code **)(*param_1 + 0x14))(&local_40,4,1); uVar6 = uVar6 + 1; *(undefined4 *)(local_24 + 0x150 + uVar2) = local_40; uVar2 = uVar2 + 4; } while (uVar6 < local_20); goto LAB_0041d8fe; } LAB_0041dd49: iVar5 = local_24; break; case 3: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0xc; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of counters %d/%d\n"); bVar7 = local_20 == 0xc; } if (0xb < local_20 && !bVar7) { local_20 = 0xc; } uVar6 = 0; if (local_20 == 0) goto LAB_0041dd49; uVar2 = 0; do { if (local_28 <= uVar2) goto LAB_0041dd41; (**(code **)(*param_1 + 0x14))(&local_44,4,1); uVar6 = uVar6 + 1; *(undefined4 *)(local_24 + 0x594 + uVar2) = local_44; uVar2 = uVar2 + 4; } while (uVar6 < local_20); goto LAB_0041d8fe; case 4: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0x1ba; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of collectibles in collection %d/%d\n"); bVar7 = local_20 == 0x1ba; } if (0x1b9 < local_20 && !bVar7) { local_20 = 0x1ba; } uVar6 = 0; if (local_20 != 0) { do { if (local_28 <= uVar6) break; (**(code **)(*param_1 + 0x14))(&local_2a,1,1); *(bool *)(iVar5 + 0x3d8 + uVar6) = '\0' < local_2a; uVar6 = uVar6 + 1; } while (uVar6 < local_20); } break; case 5: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 7; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of minibosses %d/%d\n"); bVar7 = local_20 == 7; } if (6 < local_20 && !bVar7) { local_20 = 7; } uVar6 = 0; if (local_20 != 0) { do { if (local_28 <= uVar6) break; (**(code **)(*param_1 + 0x14))(&local_2b,1,1); *(bool *)(iVar5 + 0x5c4 + uVar6) = '\0' < local_2b; uVar6 = uVar6 + 1; } while (uVar6 < local_20); } break; case 6: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0x43; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of minibosses %d/%d\n"); bVar7 = local_20 == 0x43; } if (0x42 < local_20 && !bVar7) { local_20 = 0x43; } uVar6 = 0; if (local_20 != 0) { do { if (local_28 <= uVar6) break; (**(code **)(*param_1 + 0x14))(&local_2c,1,1); *(bool *)(iVar5 + 0x5cb + uVar6) = '\0' < local_2c; uVar6 = uVar6 + 1; } while (uVar6 < local_20); } break; case 7: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0x1f; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of challenges %d/%d\n"); bVar7 = local_20 == 0x1f; } if (0x1e < local_20 && !bVar7) { local_20 = 0x1f; } uVar6 = 0; if (local_20 != 0) { do { if (local_28 <= uVar6) break; (**(code **)(*param_1 + 0x14))(&local_2d,1,1); *(bool *)(iVar5 + 0x60e + uVar6) = '\0' < local_2d; uVar6 = uVar6 + 1; } while (uVar6 < local_20); } break; case 8: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0x16; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of cutscenes %d/%d\n"); bVar7 = local_20 == 0x16; } if (0x15 < local_20 && !bVar7) { local_20 = 0x16; } uVar6 = 0; if (local_20 == 0) goto LAB_0041dd49; uVar2 = 0; do { if (local_28 <= uVar2) goto LAB_0041dd41; (**(code **)(*param_1 + 0x14))(&local_48,4,1); uVar6 = uVar6 + 1; *(undefined4 *)(local_24 + 0x630 + uVar2) = local_48; uVar2 = uVar2 + 4; } while (uVar6 < local_20); goto LAB_0041d8fe; case 9: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 1; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of settings %d/%d\n"); bVar7 = local_20 == 1; } if (local_20 != 0 && !bVar7) { local_20 = 1; } uVar6 = 0; if (local_20 == 0) goto LAB_0041dd49; uVar2 = 0; do { if (local_28 <= uVar2) goto LAB_0041dd41; (**(code **)(*param_1 + 0x14))(&local_4c,4,1); uVar6 = uVar6 + 1; *(undefined4 *)(local_24 + 0x688 + uVar2) = local_4c; uVar2 = uVar2 + 4; } while (uVar6 < local_20); LAB_0041d8fe: iVar5 = local_24; break; case 10: local_20 = 0; (**(code **)(*param_1 + 0x14))(&local_20,4,1); bVar7 = local_20 == 0x4d; if (!bVar7) { KAGE_LogMessage(1,(byte *)"Different number of special seeds %d/%d\n"); bVar7 = local_20 == 0x4d; } if (0x4c < local_20 && !bVar7) { local_20 = 0x4d; } uVar6 = 0; if (local_20 != 0) { do { if (local_28 <= uVar6) break; (**(code **)(*param_1 + 0x14))(&local_2e,1,1); *(bool *)(iVar5 + 0x68c + uVar6) = '\0' < local_2e; uVar6 = uVar6 + 1; } while (uVar6 < local_20); } } goto switchD_0041d7f3_default; LAB_0041dd41: iVar5 = local_24; switchD_0041d7f3_default: cVar1 = (**(code **)(*param_1 + 0x10))(); goto joined_r0x0041d798; } //@@ 0041ddb0 afterbirth_save_index_remap /* DB: ? ECX=old index, switch returning the new index (1->1,2->2,3->3,4->5,5->6,...; 161 cases); used in PersistentGameData::import_afterbirth_save loop over 0xa2 entries copying into this+0x2bc */ undefined4 afterbirth_save_index_remap(void) { undefined4 in_ECX; switch(in_ECX) { case 1: return 1; case 2: return 2; case 3: return 3; case 4: return 5; case 5: return 6; case 6: return 7; case 7: return 8; case 8: return 9; case 9: return 10; case 10: return 0xb; case 0xb: return 0xc; case 0xc: return 0xd; case 0xd: return 0xe; case 0xe: return 0xf; case 0xf: return 0x10; case 0x10: return 0x11; case 0x11: return 0x12; case 0x12: return 0x13; case 0x13: return 0x14; case 0x14: return 0x15; case 0x15: return 0x16; case 0x16: return 0x17; case 0x17: return 0x18; case 0x18: return 0x19; case 0x19: return 0x1a; case 0x1a: return 0x1b; case 0x1b: return 0x1c; case 0x1c: return 0x1d; case 0x1d: return 0x1e; case 0x1e: return 0x1f; case 0x1f: return 0x20; case 0x20: return 0x21; case 0x21: return 0x22; case 0x22: return 0x23; case 0x23: return 0x24; case 0x24: return 0x25; case 0x25: return 0x26; case 0x26: return 0x27; case 0x27: return 0x29; case 0x28: return 0x2a; case 0x29: return 0x2b; case 0x2a: return 0x2c; case 0x2b: return 0x2d; case 0x2c: return 0x2e; case 0x2d: return 0x2f; case 0x2e: return 0x30; case 0x2f: return 0x31; case 0x30: return 0x32; case 0x31: return 0x33; case 0x32: return 0x34; case 0x33: return 0x35; case 0x34: return 0x37; case 0x35: return 0x38; case 0x36: return 0x39; case 0x37: return 0x3a; case 0x38: return 0x3b; case 0x39: return 0x3c; case 0x3a: return 0x3d; case 0x3b: return 0x3e; case 0x3c: return 0x3f; case 0x3d: return 0x40; case 0x3e: return 0x41; case 0x3f: return 0x42; case 0x40: return 0x43; case 0x41: return 0x45; case 0x42: return 0x46; case 0x43: return 0x47; case 0x44: return 0x48; case 0x45: return 0x49; case 0x46: return 0x4a; case 0x47: return 0x4b; case 0x48: return 0x4c; case 0x49: return 0x4d; case 0x4a: return 0x4e; case 0x4b: return 0x4f; case 0x4c: return 0x50; case 0x4d: return 0x51; case 0x4e: return 0x53; case 0x4f: return 0x54; case 0x50: return 0x55; case 0x51: return 0x56; case 0x52: return 0x57; case 0x53: return 0x58; case 0x54: return 0x59; case 0x55: return 0x5a; case 0x56: return 0x5b; case 0x57: return 0x5c; case 0x58: return 0x5d; case 0x59: return 0x5e; case 0x5a: return 0x5f; case 0x5b: return 0x61; case 0x5c: return 0x62; case 0x5d: return 99; case 0x5e: return 100; case 0x5f: return 0x65; case 0x60: return 0x66; case 0x61: return 0x67; case 0x62: return 0x68; case 99: return 0x69; case 100: return 0x6a; case 0x65: return 0x6b; case 0x66: return 0x6c; case 0x67: return 0x6d; case 0x68: return 0x6f; case 0x69: return 0x70; case 0x6a: return 0x71; case 0x6b: return 0x72; case 0x6c: return 0x73; case 0x6d: return 0x74; case 0x6e: return 0x75; case 0x6f: return 0x76; case 0x70: return 0x77; case 0x71: return 0x78; case 0x72: return 0x79; case 0x73: return 0x7a; case 0x74: return 0x7b; case 0x75: return 0x7c; case 0x76: return 0x7d; case 0x77: return 0x7e; case 0x78: return 0x7f; case 0x79: return 0x80; case 0x7a: return 0x82; case 0x7b: return 0x83; case 0x7c: return 0x84; case 0x7d: return 0x85; case 0x7e: return 0x86; case 0x7f: return 0x87; case 0x80: return 0x88; case 0x81: return 0x89; case 0x82: return 0x8a; case 0x83: return 0x8b; case 0x84: return 0x8c; case 0x85: return 0x8d; case 0x86: return 0x8e; case 0x87: return 0x90; case 0x88: return 0x91; case 0x89: return 0x92; case 0x8a: return 0x93; case 0x8b: return 0x94; case 0x8c: return 0x95; case 0x8d: return 0x96; case 0x8e: return 0x97; case 0x8f: return 0x98; case 0x90: return 0x99; case 0x91: return 0x9a; case 0x92: return 0x9b; case 0x93: return 0x9c; case 0x94: return 0x9e; case 0x95: return 0x9f; case 0x96: return 0xa0; case 0x97: return 0xa1; case 0x98: return 0xa2; case 0x99: return 0xa3; case 0x9a: return 0xa4; case 0x9b: return 0xa5; case 0x9c: return 0xa6; case 0x9d: return 0xa7; case 0x9e: return 0xa8; case 0x9f: return 0xa9; case 0xa0: return 0xaa; case 0xa1: return 0xab; default: return 0; } } //@@ 0041e420 sprintf_s /* DB: (buf,size,fmt,...) used for "Idle%d" prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl sprintf_s(byte *buffer,uint size,byte *format) { int iVar1; iVar1 = FUN_0041d4d0(format); return iVar1; } //@@ 0041e440 FUN_0041e440 void FUN_0041e440(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("STEAMUSERSTATS_INTERFACE_VERSION013"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 0041e460 Config::GetPillEffects /* ZHL [lua] Lua binding Config:GetPillEffects */ int Config::GetPillEffects(void) { int in_ECX; return in_ECX + 0x30; } //@@ 0041e470 FUN_0041e470 int FUN_0041e470(void) { int in_ECX; return in_ECX + 0x50; } //@@ 0041e480 BeamRenderer::Begin /* ZHL [exact] static void BeamRenderer::Begin(ANM2 *anm2, unsigned int layer, bool useOverlay, bool unk); */ void BeamRenderer::Begin(undefined4 param_1,undefined4 param_2,undefined1 param_3,undefined1 param_4 ) { DAT_00c78ef0 = param_1; DAT_00c78ef4 = param_2; DAT_00c78ef8._0_1_ = param_3; DAT_00c78ef8._1_1_ = param_4; g_beamRendererPointsEnd = g_beamRendererPoints; return; } //@@ 0041e4c0 Point::UpdateNormal /* ZHL [exact] __thiscall void Point::UpdateNormal(Vector* unk); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Point::UpdateNormal(Point *this,Vector *unk) { Point PVar1; Point PVar2; float fVar3; float fVar4; Vector *pVVar5; Point PVar6; Point PVar7; Point PVar8; float local_8; PVar1 = this[2]; if (((float)PVar1 == g_vectorZero.x) && ((float)this[3] == g_vectorZero.y)) { pVVar5 = (Vector *)(unk->x - (float)*this); local_8 = unk->y - (float)this[1]; fVar3 = sqrtf((float)pVVar5 * (float)pVVar5 + local_8 * local_8); unk = pVVar5; if (0.0 < fVar3) { unk = (Vector *)((float)pVVar5 * (1.0 / fVar3)); local_8 = local_8 * (1.0 / fVar3); } fVar3 = cos(1.5707964); fVar4 = sin(1.5707964); this[3] = (Point)((float)unk * fVar4 + local_8 * fVar3); this[2] = (Point)((float)unk * fVar3 - local_8 * fVar4); return; } PVar2 = this[3]; local_8 = unk->y - (float)this[1]; unk = (Vector *)(unk->x - (float)*this); fVar3 = sqrtf(local_8 * local_8 + (float)unk * (float)unk); if (0.0 < fVar3) { unk = (Vector *)((float)unk * (1.0 / fVar3)); local_8 = local_8 * (1.0 / fVar3); } fVar3 = cos(1.5707964); fVar4 = sin(1.5707964); PVar8 = (Point)(((float)unk * fVar3 - local_8 * fVar4) + (float)PVar1); PVar6 = (Point)((float)unk * fVar4 + local_8 * fVar3 + (float)this[3]); this[2] = PVar8; this[3] = PVar6; fVar3 = sqrtf((float)PVar6 * (float)PVar6 + (float)PVar8 * (float)PVar8); if (fVar3 <= 0.0) { PVar7 = this[3]; } else { PVar6 = (Point)((float)PVar6 * (1.0 / fVar3)); PVar8 = (Point)((float)PVar8 * (1.0 / fVar3)); PVar7 = PVar6; } fVar4 = (float)PVar2 * (float)PVar6 + (float)PVar1 * (float)PVar8; fVar3 = 0.4; if (0.4 <= fVar4) { fVar3 = fVar4; } this[3] = (Point)((float)PVar7 / fVar3); this[2] = (Point)((float)PVar8 / fVar3); return; } //@@ 0041e720 BeamRenderer::Add /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: appends a 0x44-byte Point to the global point vector g_beamRendererPoints..f00 (pos, spritesheet coord XMM2, width XMM3, color mod), Point::UpdateNormal on the previous point, between BeamRenderer::Begin and BeamRenderer::End in Entity_NPC::RenderSegmentLink; REPENTOGON static BeamRenderer::Add(Vector*, ColorMod*, float, float) prototype: db/protos.zhl, confirmed by RET 8 */ void BeamRenderer::Add(Vector *point,ColorMod *color,float spritesheetCoordinate,float width) { int iVar1; void *pvVar2; float fVar3; float local_78; float local_74; undefined8 local_70; float local_68; float fStack_64; float fStack_60; float fStack_5c; Vector local_58; float local_50; float local_4c; float local_48; float local_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; undefined8 local_20; float local_18; uint local_c; pvVar2 = g_beamRendererPointsEnd; local_c = __security_cookie ^ (uint)&local_78; local_58.x = point->x; local_58.y = point->y; local_68 = color->_tint[0]; fStack_64 = color->_tint[1]; fStack_60 = color->_tint[2]; fStack_5c = color->_tint[3]; local_18 = color->_offset[2]; local_30 = color->_colorize[0]; fStack_2c = color->_colorize[1]; fStack_28 = color->_colorize[2]; fStack_24 = color->_colorize[3]; local_70 = *(undefined8 *)color->_offset; iVar1 = (int)g_beamRendererPointsEnd - (int)g_beamRendererPoints >> 0x1f; local_50 = g_vectorZero.x; local_4c = g_vectorZero.y; local_48 = spritesheetCoordinate; local_44 = width; local_40 = local_68; fStack_3c = fStack_64; fStack_38 = fStack_60; fStack_34 = fStack_5c; local_20 = local_70; if (((int)g_beamRendererPointsEnd - (int)g_beamRendererPoints) / 0x44 + iVar1 != iVar1) { local_74 = local_58.y - *(float *)((int)g_beamRendererPointsEnd + -0x40); local_78 = local_58.x - *(float *)((int)g_beamRendererPointsEnd + -0x44); fVar3 = sqrtf(local_74 * local_74 + local_78 * local_78); if (0.0 < fVar3) { local_78 = local_78 * (1.0 / fVar3); local_74 = local_74 * (1.0 / fVar3); } fVar3 = cos(1.5707964); local_70 = CONCAT44(local_70._4_4_,fVar3); fVar3 = sin(1.5707964); local_50 = (float)local_70 * local_78 - fVar3 * local_74; local_4c = fVar3 * local_78 + (float)local_70 * local_74; Point::UpdateNormal((Point *)((int)pvVar2 + -0x44),&local_58); } pvVar2 = g_beamRendererPointsEnd; if (g_beamRendererPointsEnd == DAT_00c78f04) { FUN_0041fcb0(g_beamRendererPointsEnd,&local_58); return; } *(float *)g_beamRendererPointsEnd = local_58.x; *(float *)((int)pvVar2 + 4) = local_58.y; *(float *)((int)pvVar2 + 8) = local_50; *(float *)((int)pvVar2 + 0xc) = local_4c; *(float *)((int)pvVar2 + 0x10) = local_48; *(float *)((int)pvVar2 + 0x14) = local_44; *(undefined8 *)((int)pvVar2 + 0x38) = local_20; *(float *)((int)pvVar2 + 0x18) = local_40; *(float *)((int)pvVar2 + 0x1c) = fStack_3c; *(float *)((int)pvVar2 + 0x20) = fStack_38; *(float *)((int)pvVar2 + 0x24) = fStack_34; *(float *)((int)pvVar2 + 0x40) = local_18; *(float *)((int)pvVar2 + 0x28) = local_30; *(float *)((int)pvVar2 + 0x2c) = fStack_2c; *(float *)((int)pvVar2 + 0x30) = fStack_28; *(float *)((int)pvVar2 + 0x34) = fStack_24; g_beamRendererPointsEnd = (void *)((int)g_beamRendererPointsEnd + 0x44); return; } //@@ 0041e960 BeamRenderer::End /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 'Beam renderer needs per-vertex colors for Dogma'; RenderSegmentLink calls Begin, 5x 0041e720 (Add) then this; draws quads via shader prototype: db/protos.zhl */ void __cdecl BeamRenderer::End(void) { float *pfVar1; float fVar2; char cVar3; LayerState *pLVar4; float *pfVar5; void *pvVar6; int iVar7; AnimationState *this; KColor *color; undefined *unusedArg; float *pfVar8; uint uVar9; bool bVar10; int *piVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; int *imageRefCount; undefined1 auStack_202 [2]; Vector local_1f4; Vector local_1ec; Vector local_1e4; undefined1 local_1dc [20]; float fStack_1c8; float fStack_1c4; float fStack_1c0; undefined1 local_1bc; float local_1b8 [14]; undefined4 local_180; float local_17c [4]; undefined4 local_16c; Vector local_168; undefined8 local_160; Vector local_158; Vector local_150; Vector local_148; Vector local_140; Vector local_138; int *local_130; int *local_12c; Vector local_128; Color local_120; Color local_f0; Vector local_c0; float *local_b8; float local_b4; undefined *local_b0; float local_ac; float local_a8; byte local_a2; byte local_a1; float *local_a0; char local_99; undefined1 local_98 [24]; ColorMod local_80; float local_54; float fStack_50; float fStack_4c; float fStack_48; float local_44; float fStack_40; float fStack_3c; float fStack_38; undefined8 local_34; float local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_98 + 0x94; local_14 = 0xffffffff; puStack_18 = &LAB_00af1720; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_98 + 0x88); ExceptionList = &local_1c; pLVar4 = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); LayerState::GetTexture(pLVar4,&local_130); local_14 = 0; if ((local_130 != (int *)0x0) && (1 < (uint)(((int)g_beamRendererPointsEnd - (int)g_beamRendererPoints) / 0x44))) { if ((char)DAT_00c78ef8 == '\0') { this = &DAT_00c78ef0->_animState; } else { this = &DAT_00c78ef0->_overlayAnimState; } pfVar5 = AnimationState::GetLayerFrame(this,(int)DAT_00c78ef4); local_b8 = pfVar5; if (pfVar5 != (float *)0x0) { iVar7 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar7 + 0xc) < DAT_00c7f6d0) && (_Init_thread_header(), DAT_00c7f6d0 == -1)) { _atexit((_func_4879 *)&LAB_00b15320); _Init_thread_footer(); } if ((*(int *)(iVar7 + 0xc) < DAT_00c7f6e0) && (_Init_thread_header(), DAT_00c7f6e0 == -1)) { _atexit((_func_4879 *)&LAB_00b15310); _Init_thread_footer(); } DAT_00c7f6d8 = DAT_00c7f6d4; DAT_00c7f6e8 = DAT_00c7f6e4; pLVar4 = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); local_99 = '\0'; local_a1 = pLVar4->_flipX; local_a2 = DAT_00c78ef0->_flipX; pfVar8 = g_beamRendererPoints; if (g_beamRendererPoints != (void *)((int)g_beamRendererPointsEnd + -0x44)) { LAB_0041eac0: local_a0 = pfVar8 + 0x11; fVar13 = pfVar5[2]; local_b4 = fVar13 * pfVar8[4] * pfVar8[2] * 0.5; local_b0 = (undefined *)(fVar13 * pfVar8[4] * pfVar8[3] * 0.5); fVar15 = fVar13 * pfVar8[0x15] * pfVar8[0x13] * 0.5; fVar16 = fVar13 * pfVar8[0x15] * pfVar8[0x14] * 0.5; fVar14 = pfVar8[5]; cVar3 = (char)((uint)DAT_00c78ef8 >> 8); if (cVar3 != '\0') { fVar14 = fVar14 * pfVar5[3]; } fVar12 = pfVar8[0x16]; if (cVar3 != '\0') { fVar12 = fVar12 * pfVar5[3]; } fVar2 = *pfVar5; fVar12 = pfVar5[1] + fVar12; fVar13 = fVar13 + fVar2; piVar11 = (int *)(pfVar5[1] + fVar14); local_ac = fVar15; local_a8 = fVar16; if (local_a1 == local_a2) { local_158.x = fVar13; local_158.y = fVar12; local_150.x = fVar2; local_150.y = fVar12; local_148.x = fVar13; local_148.y = (float)piVar11; local_140.x = fVar2; local_140.y = (float)piVar11; DestinationQuad::DestinationQuad ((DestinationQuad *)local_1dc,&local_140,&local_148,&local_150,&local_158); local_1bc = 1; if (DAT_00c7f6d8 == DAT_00c7f6dc) goto LAB_0041eca3; SourceQuad::SourceQuad(DAT_00c7f6d8,local_1dc); DAT_00c7f6d8 = DAT_00c7f6d8 + 1; } else { local_168.x = fVar2; local_168.y = fVar12; local_160._0_4_ = fVar13; local_160._4_4_ = fVar12; local_128.x = fVar13; local_128.y = (float)piVar11; local_c0.x = fVar2; local_c0.y = (float)piVar11; DestinationQuad::DestinationQuad ((DestinationQuad *)local_1dc,&local_128,&local_c0,(Vector *)&local_160, &local_168); local_1bc = 1; if (DAT_00c7f6d8 == DAT_00c7f6dc) { LAB_0041eca3: local_1bc = 1; std::vector::_Emplace_reallocate(); fVar15 = local_ac; fVar16 = local_a8; } else { SourceQuad::SourceQuad(DAT_00c7f6d8,local_1dc); DAT_00c7f6d8 = DAT_00c7f6d8 + 1; } } KColor::SetFromARGB((KColor *)(local_1dc + 0x10),0xffffffff); local_138.x = *local_a0 - fVar15; local_1e4.x = fVar15 + *local_a0; local_138.y = local_a0[1] - fVar16; local_1e4.y = fVar16 + local_a0[1]; local_1ec.x = *pfVar8 - local_b4; local_1f4.x = *pfVar8 + local_b4; local_1ec.y = pfVar8[1] - (float)local_b0; local_1f4.y = (float)local_b0 + pfVar8[1]; pvVar6 = set_quad_corner_colors(local_98,&local_1f4,&local_1ec,&local_1e4,&local_138,color); if (DAT_00c7f6e8 == DAT_00c7f6ec) { FUN_0041fa30(); } else { render_quad_copy(DAT_00c7f6e8,pvVar6); DAT_00c7f6e8 = (void *)((int)DAT_00c7f6e8 + 0x70); } if (local_99 == '\0') { local_120._tint[0] = pfVar8[6]; local_120._tint[1] = pfVar8[7]; local_120._tint[2] = pfVar8[8]; local_120._tint[3] = pfVar8[9]; local_120._offset[2] = pfVar8[0x10]; local_120._colorize[0] = pfVar8[10]; local_120._colorize[1] = pfVar8[0xb]; local_120._colorize[2] = pfVar8[0xc]; local_120._colorize[3] = pfVar8[0xd]; local_120._offset._0_8_ = *(undefined8 *)(pfVar8 + 0xe); Color::__mul(&local_120,(ColorMod *)(pfVar5 + 0xc)); local_f0._tint[0] = local_a0[6]; local_f0._tint[1] = local_a0[7]; local_f0._tint[2] = local_a0[8]; local_f0._tint[3] = local_a0[9]; local_f0._colorize[0] = local_a0[10]; local_f0._colorize[1] = local_a0[0xb]; local_f0._colorize[2] = local_a0[0xc]; local_f0._colorize[3] = local_a0[0xd]; local_f0._offset._0_8_ = *(undefined8 *)(local_a0 + 0xe); local_f0._offset[2] = local_a0[0x10]; Color::__mul(&local_f0,(ColorMod *)(pfVar5 + 0xc)); local_16c = 0; pfVar5 = local_17c; local_180 = 0; pfVar8 = local_1b8 + 10; local_17c[0] = local_120._colorize[0]; local_17c[1] = local_120._colorize[1]; local_17c[2] = local_120._colorize[2]; local_17c[3] = local_120._colorize[3]; uVar9 = 0xc; local_1b8[10] = local_f0._colorize[0]; local_1b8[0xb] = local_f0._colorize[1]; local_1b8[0xc] = local_f0._colorize[2]; local_1b8[0xd] = local_f0._colorize[3]; do { if (*pfVar5 != *pfVar8) goto LAB_0041ef3a; pfVar5 = pfVar5 + 1; pfVar8 = pfVar8 + 1; bVar10 = 3 < uVar9; uVar9 = uVar9 - 4; } while (bVar10); pfVar5 = local_1b8 + 5; local_1b8[5] = local_120._offset[0]; pfVar8 = local_1b8; uVar9 = 0xc; local_1b8[6] = local_120._offset[1]; local_1b8[7] = local_120._offset[2]; local_1b8[0] = local_f0._offset[0]; local_1b8[1] = local_f0._offset[1]; local_1b8[9] = 0.0; local_1b8[8] = 1.0; local_1b8[4] = 0.0; local_1b8[2] = local_f0._offset[2]; local_1b8[3] = 1.0; do { if (*pfVar5 != *pfVar8) goto LAB_0041ef3a; pfVar5 = pfVar5 + 1; pfVar8 = pfVar8 + 1; bVar10 = 3 < uVar9; uVar9 = uVar9 - 4; } while (bVar10); local_99 = '\0'; goto LAB_0041ef41; } goto LAB_0041ef47; } LAB_0041ef71: local_1dc._16_4_ = g_graphicsManager_blendMode[0]; fStack_1c8 = (float)g_graphicsManager_blendMode[1]; fStack_1c4 = (float)g_graphicsManager_blendMode[2]; fStack_1c0 = (float)g_graphicsManager_blendMode[3]; iVar7 = ((int)DAT_00c7f6d8 - (int)DAT_00c7f6d4) / 0x24; local_168.y = (float)g_graphicsManager_blendMode[4]; local_b4 = (float)iVar7; pLVar4 = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); g_graphicsManager_blendMode[0] = pLVar4->_blendMode[0]; g_graphicsManager_blendMode[1] = pLVar4->_blendMode[1]; g_graphicsManager_blendMode[2] = pLVar4->_blendMode[2]; g_graphicsManager_blendMode[3] = pLVar4->_blendMode[3]; g_graphicsManager_blendMode[4] = pLVar4->_blendMode[4]; local_a0 = (float *)(uint)(local_99 != '\0'); pLVar4 = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); if (((DAT_00c78ef0->_bitflags | pLVar4->_bitflags) & 0x20U) != 0) { if (local_99 != '\0') { KAGE_LogMessage(8,(byte *) "Beam renderer needs per-vertex colors for Dogma but his shader doesn\'t support it!\n" ); } local_a0 = (float *)0x2; } unusedArg = &g_shaders + (int)local_a0 * 0x50; if ((unusedArg != (undefined *)0x0) && (((&DAT_00c7911c)[(int)local_a0 * 0x50] & 1) != 0)) { g_currentShader = unusedArg; } if (iVar7 != 0) { local_ac = 0.0; local_160._4_4_ = (float)CONCAT31(local_160._5_3_,local_a0 != (float *)0x1); local_a8 = 0.0; local_b0 = (undefined *)0x0; do { fVar13 = pfVar5[0x10]; fVar14 = pfVar5[0x11]; fVar15 = pfVar5[0x12]; pfVar8 = (float *)(local_b0 + 0x28 + (int)g_beamRendererPoints); local_120._colorize[0] = *pfVar8; local_120._colorize[1] = pfVar8[1]; local_120._colorize[2] = pfVar8[2]; local_120._colorize[3] = pfVar8[3]; pfVar8 = (float *)(local_b0 + 0x18 + (int)g_beamRendererPoints); local_120._offset._0_8_ = *(undefined8 *)(local_b0 + 0x38 + (int)g_beamRendererPoints); local_138.y = pfVar5[0xc]; local_120._tint[0] = local_138.y * *pfVar8; local_140.y = pfVar5[0xd]; local_120._tint[1] = local_140.y * pfVar8[1]; local_148.y = pfVar5[0xe]; local_120._tint[2] = local_148.y * pfVar8[2]; local_150.y = pfVar5[0xf]; local_120._tint[3] = local_150.y * pfVar8[3]; local_158.y = fVar13 + fVar14 + fVar15; if (local_158.y != 0.0) { if (local_120._colorize[0] + local_120._colorize[1] + local_120._colorize[2] == 0.0) { local_120._colorize[0] = fVar13; local_120._colorize[1] = fVar14; local_120._colorize[2] = fVar15; local_120._colorize[3] = pfVar5[0x13]; } else { local_120._colorize[0] = (fVar13 + local_120._colorize[0]) * 0.5; local_120._colorize[1] = (fVar14 + local_120._colorize[1]) * 0.5; local_120._colorize[2] = (fVar15 + local_120._colorize[2]) * 0.5; local_120._colorize[3] = (local_120._colorize[3] + pfVar5[0x13]) * 0.5; } } local_120._offset[2] = pfVar5[0x16] + *(float *)(local_b0 + 0x40 + (int)g_beamRendererPoints); pfVar8 = (float *)(local_b0 + 0x5c + (int)g_beamRendererPoints); local_80._offset[1] = pfVar5[0x15] + local_120._offset[1]; local_80._offset[0] = pfVar5[0x14] + local_120._offset[0]; local_80._colorize[0] = local_120._colorize[0]; local_80._colorize[1] = local_120._colorize[1]; local_80._colorize[2] = local_120._colorize[2]; local_80._colorize[3] = local_120._colorize[3]; pfVar1 = (float *)(local_b0 + 0x6c + (int)g_beamRendererPoints); local_f0._colorize[0] = *pfVar1; local_f0._colorize[1] = pfVar1[1]; local_f0._colorize[2] = pfVar1[2]; local_f0._offset._0_8_ = *(undefined8 *)(local_b0 + 0x7c + (int)g_beamRendererPoints); local_f0._tint[0] = local_138.y * *pfVar8; local_f0._tint[1] = local_140.y * pfVar8[1]; local_f0._tint[2] = local_148.y * pfVar8[2]; local_f0._tint[3] = local_150.y * pfVar8[3]; local_f0._colorize[3] = pfVar1[3]; if (local_158.y != 0.0) { local_f0._colorize[3] = pfVar5[0x13]; if (local_f0._colorize[0] + local_f0._colorize[1] + local_f0._colorize[2] != 0.0) { fVar13 = (fVar13 + local_f0._colorize[0]) * 0.5; fVar14 = (fVar14 + local_f0._colorize[1]) * 0.5; local_f0._colorize[3] = (pfVar1[3] + local_f0._colorize[3]) * 0.5; fVar15 = (fVar15 + local_f0._colorize[2]) * 0.5; } local_f0._colorize[0] = fVar13; local_f0._colorize[1] = fVar14; local_f0._colorize[2] = fVar15; } local_f0._offset[2] = pfVar5[0x16] + *(float *)(local_b0 + 0x84 + (int)g_beamRendererPoints); piVar11 = (int *)0x0; imageRefCount = (int *)0x0; local_34 = CONCAT44(pfVar5[0x15] + local_f0._offset[1],pfVar5[0x14] + local_f0._offset[0]) ; local_c0.y = (float)local_12c; local_128.y = (float)local_130; local_44 = local_f0._colorize[0]; fStack_40 = local_f0._colorize[1]; fStack_3c = local_f0._colorize[2]; fStack_38 = local_f0._colorize[3]; local_80._tint[0] = local_120._tint[0]; local_80._tint[1] = local_120._tint[1]; local_80._tint[2] = local_120._tint[2]; local_80._tint[3] = local_120._tint[3]; local_80._offset[2] = local_120._offset[2]; local_54 = local_f0._tint[0]; fStack_50 = local_f0._tint[1]; fStack_4c = local_f0._tint[2]; fStack_48 = local_f0._tint[3]; local_2c = local_f0._offset[2]; if (local_12c != (int *)0x0) { cVar3 = (**(code **)(*local_12c + 4))(); if (cVar3 != '\0') { if (((imageRefCount != (int *)0x0) && (cVar3 = (**(code **)(*imageRefCount + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStack_202 + -10); } piVar11 = (int *)local_128.y; imageRefCount = (int *)local_c0.y; } } apply_sprite_shader_params(&local_80,SUB41(local_160._4_4_,0),piVar11,imageRefCount); pvVar6 = DAT_00c7f6e4; local_17c[3] = fStack_48; local_1b8[0xd] = fStack_48; local_17c[0] = local_54; local_17c[1] = fStack_50; local_17c[2] = fStack_4c; local_1b8[10] = local_54; local_1b8[0xb] = fStack_50; local_1b8[0xc] = fStack_4c; local_1b8[8] = local_80._tint[3]; local_1b8[3] = local_80._tint[3]; local_1b8[0] = local_80._tint[0]; local_1b8[1] = local_80._tint[1]; local_1b8[2] = local_80._tint[2]; local_1b8[5] = local_80._tint[0]; pfVar5 = (float *)((int)local_a8 + 0x20 + (int)DAT_00c7f6e4); *pfVar5 = local_80._tint[0]; pfVar5[1] = local_80._tint[1]; pfVar5[2] = local_80._tint[2]; pfVar5[3] = local_80._tint[3]; *(undefined4 *)((int)local_a8 + 0x30 + (int)pvVar6) = 0; local_1b8[6] = local_80._tint[1]; local_1b8[7] = local_80._tint[2]; pfVar5 = (float *)((int)local_a8 + 0x34 + (int)pvVar6); *pfVar5 = local_80._tint[0]; pfVar5[1] = local_80._tint[1]; pfVar5[2] = local_80._tint[2]; pfVar5[3] = local_80._tint[3]; *(undefined4 *)((int)local_a8 + 0x44 + (int)pvVar6) = 0; pfVar5 = (float *)((int)local_a8 + 0x48 + (int)pvVar6); *pfVar5 = local_54; pfVar5[1] = fStack_50; pfVar5[2] = fStack_4c; pfVar5[3] = fStack_48; *(undefined4 *)((int)local_a8 + 0x58 + (int)pvVar6) = 0; pfVar5 = (float *)((int)local_a8 + 0x5c + (int)pvVar6); *pfVar5 = local_54; pfVar5[1] = fStack_50; pfVar5[2] = fStack_4c; pfVar5[3] = fStack_48; *(undefined4 *)((int)local_a8 + 0x6c + (int)pvVar6) = 0; iVar7 = (**(code **)(*local_130 + 0x14))((int)&(DAT_00c7f6d4->_topLeft).x + (int)local_ac) ; if ((iVar7 != 0) && (local_a0 == (float *)0x1)) { *(float *)(iVar7 + 0x24) = local_80._colorize[0]; *(float *)(iVar7 + 0x28) = local_80._colorize[1]; *(float *)(iVar7 + 0x2c) = local_80._colorize[2]; *(float *)(iVar7 + 0x30) = local_80._colorize[3]; *(undefined8 *)(iVar7 + 0x34) = local_80._offset._0_8_; *(float *)(iVar7 + 100) = local_80._colorize[0]; *(float *)(iVar7 + 0x68) = local_80._colorize[1]; *(float *)(iVar7 + 0x6c) = local_80._colorize[2]; *(float *)(iVar7 + 0x70) = local_80._colorize[3]; *(float *)(iVar7 + 0x3c) = local_80._offset[2]; *(undefined8 *)(iVar7 + 0x74) = local_80._offset._0_8_; *(float *)(iVar7 + 0x7c) = local_80._offset[2]; *(undefined8 *)(iVar7 + 0xb4) = local_34; *(undefined8 *)(iVar7 + 0xf4) = local_34; *(float *)(iVar7 + 0xa4) = local_44; *(float *)(iVar7 + 0xa8) = fStack_40; *(float *)(iVar7 + 0xac) = fStack_3c; *(float *)(iVar7 + 0xb0) = fStack_38; *(float *)(iVar7 + 0xbc) = local_2c; *(float *)(iVar7 + 0xe4) = local_44; *(float *)(iVar7 + 0xe8) = fStack_40; *(float *)(iVar7 + 0xec) = fStack_3c; *(float *)(iVar7 + 0xf0) = fStack_38; *(float *)(iVar7 + 0xfc) = local_2c; } local_a8 = (float)((int)local_a8 + 0x70); unusedArg = local_b0 + 0x44; local_ac = (float)((int)local_ac + 0x24); local_b4 = (float)((int)local_b4 + -1); pfVar5 = local_b8; local_b0 = unusedArg; } while (local_b4 != 0.0); } g_graphicsManager_blendMode[0] = local_1dc._16_4_; g_graphicsManager_blendMode[1] = (int)fStack_1c8; g_graphicsManager_blendMode[2] = (int)fStack_1c4; g_graphicsManager_blendMode[3] = (int)fStack_1c0; g_graphicsManager_blendMode[4] = (int)local_168.y; shader_cache_find((int)unusedArg); } } local_14 = 1; if (((local_12c != (int *)0x0) && (cVar3 = (**(code **)(*local_12c + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } ExceptionList = local_1c; return; LAB_0041ef3a: local_99 = '\x01'; LAB_0041ef41: pfVar5 = local_b8; LAB_0041ef47: pfVar8 = local_a0; if (local_a0 == (float *)((int)g_beamRendererPointsEnd + -0x44)) goto LAB_0041ef71; goto LAB_0041eac0; } //@@ 0041f780 std::vector::_Tidy /* DB: std::vector _Tidy for 0x70-byte elements (deallocate, zero begin/end/cap); only reached from unwind funclets; element size matches std::vector::_Emplace_reallocate 00589e40 std::vector::_Emplace_reallocate void std::vector::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x70) * 0x70; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0041f7f0 FID_conflict:_Tidy /* Library Function - Multiple Matches With Different Base Names public: __thiscall std::vector >::~vector >(void) private: void __thiscall std::vector >::_Tidy(void) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Tidy(void *this) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x24) * 0x24; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } return; } //@@ 0041f860 FUN_0041f860 void FUN_0041f860(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x44) * 0x44; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0041f8d0 FUN_0041f8d0 void FUN_0041f8d0(void) { int iVar1; int iVar2; void *pvVar3; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; pvVar3 = std::_Allocate(0x8800); FUN_0041f9b0(*in_ECX,in_ECX[1],pvVar3); FUN_0041f920(pvVar3,(iVar1 - iVar2) / 0x44,0x200); return; } //@@ 0041f920 FUN_0041f920 void FUN_0041f920(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x44) * 0x44; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x44; in_ECX[2] = param_1 + param_3 * 0x44; return; } //@@ 0041f9b0 FUN_0041f9b0 void FUN_0041f9b0(undefined4 *param_1,undefined4 *param_2,int param_3) { undefined8 *puVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined8 *puVar6; undefined4 *puVar7; if (param_1 != param_2) { puVar6 = (undefined8 *)(param_3 + 0x38); puVar7 = param_1 + 2; do { uVar3 = puVar7[-1]; puVar1 = (undefined8 *)((int)puVar6 + 0x44); *(undefined4 *)(puVar6 + -7) = puVar7[-2]; *(undefined4 *)((int)puVar6 + -0x34) = uVar3; uVar3 = puVar7[1]; *(undefined4 *)(puVar6 + -6) = *puVar7; *(undefined4 *)((int)puVar6 + -0x2c) = uVar3; *(undefined4 *)(puVar6 + -5) = puVar7[2]; *(undefined4 *)((int)puVar6 + -0x24) = puVar7[3]; uVar3 = puVar7[5]; uVar4 = puVar7[6]; uVar5 = puVar7[7]; *(undefined4 *)(puVar6 + -4) = puVar7[4]; *(undefined4 *)((int)puVar6 + -0x1c) = uVar3; *(undefined4 *)(puVar6 + -3) = uVar4; *(undefined4 *)((int)puVar6 + -0x14) = uVar5; uVar3 = puVar7[9]; uVar4 = puVar7[10]; uVar5 = puVar7[0xb]; *(undefined4 *)(puVar6 + -2) = puVar7[8]; *(undefined4 *)((int)puVar6 + -0xc) = uVar3; *(undefined4 *)(puVar6 + -1) = uVar4; *(undefined4 *)((int)puVar6 + -4) = uVar5; *puVar6 = *(undefined8 *)((int)param_1 + (-0x44 - param_3) + (int)puVar1); *(undefined4 *)(puVar6 + 1) = *(undefined4 *)((int)param_1 + (-0x3c - param_3) + (int)puVar1); puVar2 = puVar7 + 0xf; puVar6 = puVar1; puVar7 = puVar7 + 0x11; } while (puVar2 != param_2); } return; } //@@ 0041fa30 FUN_0041fa30 void * FUN_0041fa30(void *param_1,void *param_2) { uint uVar1; uint uVar2; int iVar3; void *pvVar4; void *pvVar5; void *pvVar6; void *pvVar7; void *this; int iVar8; void *src; src = param_1; iVar8 = (int)param_1 - (int)DAT_00c7f6e4; iVar3 = ((int)DAT_00c7f6e8 - (int)DAT_00c7f6e4) / 0x70; if (iVar3 == 0x2492492) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar2 = (DAT_00c7f6ec - (int)DAT_00c7f6e4) / 0x70; if (0x2492492 - (uVar2 >> 1) < uVar2) { param_1 = (void *)0x2492492; } else { uVar2 = (uVar2 >> 1) + uVar2; param_1 = (void *)uVar1; if (uVar1 <= uVar2) { param_1 = (void *)uVar2; } if (0x2492492 < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar7 = std::_Allocate((int)param_1 * 0x70); this = (void *)((iVar8 / 0x70) * 0x70 + (int)pvVar7); render_quad_copy(this,param_2); pvVar6 = DAT_00c7f6e8; pvVar4 = pvVar7; pvVar5 = DAT_00c7f6e4; if (src == DAT_00c7f6e8) { for (; pvVar5 != pvVar6; pvVar5 = (void *)((int)pvVar5 + 0x70)) { render_quad_copy(pvVar4,pvVar5); pvVar4 = (void *)((int)pvVar4 + 0x70); } } else { for (; DAT_00c7f6e8 = pvVar6, pvVar5 != src; pvVar5 = (void *)((int)pvVar5 + 0x70)) { render_quad_copy(pvVar4,pvVar5); pvVar4 = (void *)((int)pvVar4 + 0x70); pvVar6 = DAT_00c7f6e8; } if (src != pvVar6) { iVar3 = 0x70 - (int)src; do { render_quad_copy((void *)((int)this + iVar3 + (int)src),src); src = (void *)((int)src + 0x70); } while (src != pvVar6); } } std::vector::_Change_array(pvVar7,uVar1,param_1); return this; } //@@ 0041fba0 std::vector::_Emplace_reallocate /* DB: ? vector grow with 0x24-byte elements (DestinationQuad 0x20 + 4) copy-constructed by FUN_00a11210; BeamRenderer::End, render_quad_draw, Backdrop::render_floor_to_target */ SourceQuad * std::vector::_Emplace_reallocate(int param_1,void *param_2) { SourceQuad *this; uint uVar1; int iVar2; int iVar3; FileSymbolInfo *pFVar4; int *in_ECX; uint uVar5; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0x24; if (iVar3 == 0x71c71c7) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0x24; if (0x71c71c7 - (uVar1 >> 1) < uVar1) { uVar5 = 0x71c71c7; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0x71c71c7 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pFVar4 = _Allocate(uVar5 * 0x24); this = (SourceQuad *)(pFVar4 + ((param_1 - iVar2) / 0x24) * 0x24); SourceQuad::SourceQuad(this,param_2); if (param_1 == in_ECX[1]) { _Uninitialized_move(pFVar4,*in_ECX); } else { _Uninitialized_copy(*in_ECX,param_1,pFVar4); _Uninitialized_copy(param_1,in_ECX[1],this + 1); } FID_conflict__Change_array(in_ECX,pFVar4,iVar3 + 1,uVar5); return this; } //@@ 0041fcb0 FUN_0041fcb0 undefined4 * FUN_0041fcb0(int param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; uint uVar3; int iVar4; undefined4 uVar5; int iVar6; undefined4 uVar7; undefined4 uVar8; void *pvVar9; int *in_ECX; uint uVar10; iVar4 = *in_ECX; iVar6 = (in_ECX[1] - iVar4) / 0x44; if (iVar6 == 0x3c3c3c3) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar6 + 1; uVar3 = (in_ECX[2] - iVar4) / 0x44; if (0x3c3c3c3 - (uVar3 >> 1) < uVar3) { uVar10 = 0x3c3c3c3; } else { uVar3 = (uVar3 >> 1) + uVar3; uVar10 = uVar1; if (uVar1 <= uVar3) { uVar10 = uVar3; } if (0x3c3c3c3 < uVar10) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar9 = std::_Allocate(uVar10 * 0x44); puVar2 = (undefined4 *)((int)pvVar9 + ((param_1 - iVar4) / 0x44) * 0x44); uVar5 = param_2[1]; *puVar2 = *param_2; puVar2[1] = uVar5; uVar5 = param_2[3]; puVar2[2] = param_2[2]; puVar2[3] = uVar5; puVar2[4] = param_2[4]; puVar2[5] = param_2[5]; uVar5 = param_2[7]; uVar7 = param_2[8]; uVar8 = param_2[9]; puVar2[6] = param_2[6]; puVar2[7] = uVar5; puVar2[8] = uVar7; puVar2[9] = uVar8; uVar5 = param_2[0xb]; uVar7 = param_2[0xc]; uVar8 = param_2[0xd]; puVar2[10] = param_2[10]; puVar2[0xb] = uVar5; puVar2[0xc] = uVar7; puVar2[0xd] = uVar8; *(undefined8 *)(puVar2 + 0xe) = *(undefined8 *)(param_2 + 0xe); puVar2[0x10] = param_2[0x10]; if (param_1 == in_ECX[1]) { FUN_0041f9b0(*in_ECX,in_ECX[1],pvVar9); } else { FUN_00420020(*in_ECX,param_1,pvVar9); FUN_00420020(param_1,in_ECX[1],puVar2 + 0x11); } FUN_0041f920(pvVar9,uVar1,uVar10); return puVar2; } //@@ 0041fe10 std::vector::_Change_array /* DB: trivial 0x70-byte elements: frees old, installs new buffer; std::vector::_Emplace_reallocate, std::vector::_Reallocate */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x70) * 0x70; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x70 + param_1; in_ECX[2] = param_3 * 0x70 + param_1; return; } //@@ 0041fe80 FID_conflict:_Change_array /* Library Function - Multiple Matches With Different Base Names private: void __thiscall std::vector >::_Change_array(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(struct GSISymbolEntry * const,unsigned int,unsigned int) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Change_array(void *this,FileSymbolInfo *param_1,uint param_2,uint param_3) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x24) * 0x24; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(FileSymbolInfo **)this = param_1; *(FileSymbolInfo **)((int)this + 4) = param_1 + param_2 * 0x24; *(FileSymbolInfo **)((int)this + 8) = param_1 + param_3 * 0x24; return; } //@@ 0041ff00 FUN_0041ff00 uint FUN_0041ff00(uint param_1) { uint uVar1; int *in_ECX; uVar1 = (in_ECX[2] - *in_ECX) / 0x24; if (0x71c71c7 - (uVar1 >> 1) < uVar1) { return 0x71c71c7; } uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } return uVar1; } //@@ 0041ff50 std::_Uninitialized_copy /* DB: (first,last,dest): default-inits then copies 0x24-byte ColoredQuad elements (DestinationQuad + color); std::vector::_Emplace_reallocate, std::vector<36byte>::_Insert_range */ void std::_Uninitialized_copy(int param_1,int param_2,float *param_3) { float *pfVar1; float fVar2; float fVar3; float fVar4; float *pfVar5; if (param_1 != param_2) { param_1 = param_1 - (int)param_3; pfVar5 = param_3 + 7; do { pfVar5[-1] = 0.0; pfVar5[-6] = 0.0; *param_3 = 0.0; pfVar5[-4] = 0.0; pfVar5[-5] = 0.0; pfVar5[-2] = 0.0; pfVar5[-3] = 0.0; *pfVar5 = 0.0; pfVar5[-1] = g_vectorZero.x; fVar3 = g_vectorZero.y; fVar2 = pfVar5[-1]; *pfVar5 = g_vectorZero.y; pfVar5[-3] = fVar2; pfVar5[-2] = fVar3; pfVar5[-5] = fVar2; pfVar5[-4] = fVar3; *param_3 = fVar2; pfVar5[-6] = fVar3; pfVar1 = (float *)(param_1 + (int)param_3); fVar2 = pfVar1[1]; fVar3 = pfVar1[2]; fVar4 = pfVar1[3]; *param_3 = *pfVar1; param_3[1] = fVar2; param_3[2] = fVar3; param_3[3] = fVar4; pfVar1 = (float *)(param_1 + 0x10 + (int)param_3); fVar2 = pfVar1[1]; fVar3 = pfVar1[2]; fVar4 = pfVar1[3]; param_3[4] = *pfVar1; param_3[5] = fVar2; param_3[6] = fVar3; param_3[7] = fVar4; param_3[8] = *(float *)(param_1 + 0x20 + (int)param_3); param_3 = param_3 + 9; pfVar5 = pfVar5 + 9; } while (param_1 + (int)param_3 != param_2); } return; } //@@ 00420020 FUN_00420020 undefined4 * FUN_00420020(int param_1,int param_2,undefined4 *param_3) { undefined8 *puVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined8 *puVar6; undefined4 *puVar7; undefined4 *puVar8; puVar7 = param_3; if (param_1 != param_2) { puVar6 = (undefined8 *)(param_1 + 0x38); puVar8 = param_3 + 2; do { uVar3 = *(undefined4 *)(puVar6 + -7); puVar1 = (undefined8 *)((int)puVar6 + 0x44); puVar7[1] = *(undefined4 *)((int)puVar6 + -0x34); *puVar7 = uVar3; puVar7 = puVar7 + 0x11; uVar3 = *(undefined4 *)(puVar6 + -6); puVar8[1] = *(undefined4 *)((int)puVar6 + -0x2c); *puVar8 = uVar3; puVar8[2] = *(undefined4 *)(puVar6 + -5); puVar8[3] = *(undefined4 *)((int)puVar6 + -0x24); uVar3 = *(undefined4 *)((int)puVar6 + -0x1c); uVar4 = *(undefined4 *)(puVar6 + -3); uVar5 = *(undefined4 *)((int)puVar6 + -0x14); puVar8[4] = *(undefined4 *)(puVar6 + -4); puVar8[5] = uVar3; puVar8[6] = uVar4; puVar8[7] = uVar5; uVar3 = *(undefined4 *)((int)puVar6 + -0xc); uVar4 = *(undefined4 *)(puVar6 + -1); uVar5 = *(undefined4 *)((int)puVar6 + -4); puVar8[8] = *(undefined4 *)(puVar6 + -2); puVar8[9] = uVar3; puVar8[10] = uVar4; puVar8[0xb] = uVar5; *(undefined8 *)((int)param_3 + (-0x44 - param_1) + (int)puVar1) = *puVar6; *(undefined4 *)((int)param_3 + (-0x3c - param_1) + (int)puVar1) = *(undefined4 *)(puVar6 + 1); iVar2 = (int)puVar6 + 0xc; puVar6 = puVar1; puVar8 = puVar8 + 0x11; } while (iVar2 != param_2); } return puVar7; } //@@ 004200a0 std::_Uninitialized_move /* DB: same body as 0041ff50 std::_Uninitialized_copy ECX/EDX as first/last; std::vector::_Emplace_reallocate, std::vector<36byte>::_Insert_range */ void std::_Uninitialized_move(float *param_1) { float *pfVar1; float fVar2; float fVar3; float fVar4; int in_ECX; int in_EDX; float *pfVar5; int iVar6; if (in_ECX != in_EDX) { iVar6 = in_ECX - (int)param_1; pfVar5 = param_1 + 7; do { pfVar5[-1] = 0.0; pfVar5[-6] = 0.0; *param_1 = 0.0; pfVar5[-4] = 0.0; pfVar5[-5] = 0.0; pfVar5[-2] = 0.0; pfVar5[-3] = 0.0; *pfVar5 = 0.0; pfVar5[-1] = g_vectorZero.x; fVar3 = g_vectorZero.y; fVar2 = pfVar5[-1]; *pfVar5 = g_vectorZero.y; pfVar5[-3] = fVar2; pfVar5[-2] = fVar3; pfVar5[-5] = fVar2; pfVar5[-4] = fVar3; *param_1 = fVar2; pfVar5[-6] = fVar3; pfVar1 = (float *)(iVar6 + (int)param_1); fVar2 = pfVar1[1]; fVar3 = pfVar1[2]; fVar4 = pfVar1[3]; *param_1 = *pfVar1; param_1[1] = fVar2; param_1[2] = fVar3; param_1[3] = fVar4; pfVar1 = (float *)(iVar6 + 0x10 + (int)param_1); fVar2 = pfVar1[1]; fVar3 = pfVar1[2]; fVar4 = pfVar1[3]; param_1[4] = *pfVar1; param_1[5] = fVar2; param_1[6] = fVar3; param_1[7] = fVar4; param_1[8] = *(float *)(iVar6 + 0x20 + (int)param_1); param_1 = param_1 + 9; pfVar5 = pfVar5 + 9; } while (iVar6 + (int)param_1 != in_EDX); } return; } //@@ 00420160 Sprite::IsLoaded /* ZHL [lua] Lua binding Sprite:IsLoaded */ byte __thiscall Sprite::IsLoaded(Sprite *this) { return this->_loaded; } //@@ 00420170 Sprite::SetScale /* DB: writes ANM2 0x9c _scale; tiny prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Sprite::SetScale(Sprite *this,Vector *scale) { (this->_scale).x = scale->x; (this->_scale).y = scale->y; return; } //@@ 00420190 show_beta_disclaimer_popup /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "Disclaimer popup is already running", Repentance+ Beta welcome text, ACCEPT/DENY/I CONSENT buttons, PopupQueue::push stores id in DAT_00bf93e4, loads LoadingSpinner.anm2; returns bool; Menu_Game::Update and 3 others prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte __cdecl show_beta_disclaimer_popup(int mode,void *callback,void *userData) { byte bVar1; byte *pbVar2; LayerState *pLVar3; byte *pbVar4; uint uVar5; bool bVar6; char *pcVar7; undefined1 local_300 [16]; undefined4 local_2f0; undefined4 local_2d4; undefined1 local_2ac [12]; undefined1 local_2a0 [12]; code *local_294; undefined4 local_290; code *local_28c; undefined4 local_288; undefined4 local_284; undefined4 local_280; undefined4 local_27c; undefined4 local_278; undefined1 local_260; uint local_254 [2]; Vector local_24c; void *local_244; std_string local_240; byte local_228 [516]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_228 + 0x224; local_14 = 0xffffffff; puStack_18 = &LAB_00af176b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_228 + 0x218); ExceptionList = &local_1c; local_244 = callback; pbVar2 = local_228 + 0x224; if (DAT_00bf93e4 != -1) { KAGE_LogMessage(0x10,(byte *)"Disclaimer popup is already running\n"); pbVar2 = puStack_20; } puStack_20 = pbVar2; if (DAT_00c78ed1 == '\0') { local_240._size = 0; local_240._capacity = 0xf; local_240._buf[0] = '\0'; local_240._buf[1] = '\0'; local_240._buf[2] = '\0'; local_240._buf[3] = '\0'; local_240._buf._0_4_ = std::_Allocate(0x30); local_240._size = 0x24; local_240._capacity = 0x2f; builtin_strncpy((char *)local_240._buf._0_4_,"resources/gfx/ui/LoadingSpinner.anm2",0x25); local_14 = 0; ANM2::Load((ANM2 *)&DAT_00c78dc8,&local_240,1); local_14 = 0xffffffff; if (0xf < local_240._capacity) { uVar5 = local_240._capacity + 1; pcVar7 = (char *)local_240._buf._0_4_; if (0xfff < uVar5) { pcVar7 = *(char **)(local_240._buf._0_4_ + -4); uVar5 = local_240._capacity + 0x24; if ((char *)0x1f < (char *)(local_240._buf._0_4_ + (-4 - (int)pcVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar7,uVar5); } if (DAT_00c78dfc == (byte *)0x0) { LAB_0042031b: bVar1 = ANM2::SetAnimation((ANM2 *)&DAT_00c78dc8,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)&DAT_00c78df8); DAT_00c78e0c = '\x01'; } } else { pbVar2 = DAT_00c78dfc; if (0xf < *(uint *)(DAT_00c78dfc + 0x14)) { pbVar2 = *(byte **)DAT_00c78dfc; } pbVar4 = s_Idle; do { bVar1 = *pbVar2; bVar6 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_00420301: uVar5 = -(uint)bVar6 | 1; goto LAB_00420306; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar6 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_00420301; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00420306: if ((uVar5 != 0) || (((DAT_00c78dfc != (byte *)0x0 && (DAT_00c78dfc[0x34] != 0)) && (DAT_00c78e0c == '\0')))) goto LAB_0042031b; } pLVar3 = ANM2::GetLayer((ANM2 *)&DAT_00c78dc8,(byte *)0x0); pLVar3->_minFilterMode = 1; pLVar3 = ANM2::GetLayer((ANM2 *)&DAT_00c78dc8,(byte *)0x0); pLVar3->_magFilterMode = 1; callback = local_244; } if (mode == 0) { bVar1 = (g_manager->_optionsConfig)._acceptedPublicBeta_VERSION; LAB_0042038d: if (bVar1 != 0) { ExceptionList = local_1c; return 0; } } else if (mode == 1) { bVar1 = (g_manager->_optionsConfig)._acceptedDataCollectionDisclaimer; goto LAB_0042038d; } DAT_00c71654 = userData; local_24c.x = (float)&DAT_bf800000; local_24c.y = (float)&DAT_bf800000; DAT_00bf93e0 = mode; DAT_00c71658 = callback; MessagePopup::MessagePopup (local_300,&g_manager->_font2_TeamMeatEx12,FUN_00420930,(void *)0x0,&local_24c); local_14 = 1; if (mode == 0) { sprintf(local_228, (byte *) "Welcome to The Binding of Isaac: Repentance+ Beta!\\n\\nThis is a fully featured beta, but be aware that it may crash or have other issues. Repentance+ uses its own save files and your Repentance saves are not touched so in the event of save issues, your backups remain intact.\\n\\nReport bugs to isaac@nicalis.com with the subject line\\n#Repentance+Beta %s\\n\\nEnjoy playing online!" ); local_240._capacity = 0; local_24c.y = 1.4013e-45; local_240._buf[4] = -0x23; local_240._buf[5] = -0x24; local_240._buf[6] = '\\'; local_240._buf[7] = '>'; local_240._buf[8] = -0x53; local_240._buf[9] = -0x54; local_240._buf[10] = ','; local_240._buf[0xb] = '>'; local_240._buf[0xc] = -0x4b; local_240._buf[0xd] = -0x4c; local_240._buf[0xe] = '4'; local_240._buf[0xf] = '>'; local_240._size = 0x3f800000; FUN_009c2700(local_228,&g_vectorZero,&local_24c.y,local_240._buf + 4); local_240._capacity = 0; local_24c.y = 1.4013e-45; local_254[0] = 0; local_254[1] = 0x420c0000; local_240._buf[4] = -0x23; local_240._buf[5] = -0x24; local_240._buf[6] = '\\'; local_240._buf[7] = '>'; local_240._buf[8] = -0x53; local_240._buf[9] = -0x54; local_240._buf[10] = ','; local_240._buf[0xb] = '>'; local_240._buf[0xc] = -0x4b; local_240._buf[0xd] = -0x4c; local_240._buf[0xe] = '4'; local_240._buf[0xf] = '>'; local_240._size = 0x3f800000; local_244 = (void *)0x1; FUN_009c2760("ACCEPT",&local_244,local_254,&local_24c.y,local_240._buf + 4); pcVar7 = "DENY"; } else { uVar5 = mode - 1; if (uVar5 != 0) goto LAB_004205f8; local_244 = (void *)0x1; local_240._buf[4] = -0x23; local_240._buf[5] = -0x24; local_240._buf[6] = '\\'; local_240._buf[7] = '>'; local_240._buf[8] = -0x53; local_240._buf[9] = -0x54; local_240._buf[10] = ','; local_240._buf[0xb] = '>'; local_240._buf[0xc] = -0x4b; local_240._buf[0xd] = -0x4c; local_240._buf[0xe] = '4'; local_240._buf[0xf] = '>'; local_240._size = 0x3f800000; local_240._capacity = uVar5; FUN_009c2700(&DAT_00b1bdf8,&g_vectorZero,&local_244,local_240._buf + 4); local_244 = (void *)0x1; local_254[1] = 0x420c0000; local_240._buf[4] = -0x23; local_240._buf[5] = -0x24; local_240._buf[6] = '\\'; local_240._buf[7] = '>'; local_240._buf[8] = -0x53; local_240._buf[9] = -0x54; local_240._buf[10] = ','; local_240._buf[0xb] = '>'; local_240._buf[0xc] = -0x4b; local_240._buf[0xd] = -0x4c; local_240._buf[0xe] = '4'; local_240._buf[0xf] = '>'; local_240._size = 0x3f800000; local_24c.y = 1.4013e-45; local_254[0] = uVar5; local_240._capacity = uVar5; FUN_009c2760("I CONSENT",&local_24c.y,local_254,&local_244,local_240._buf + 4); pcVar7 = "I DO NOT CONSENT"; } local_240._capacity = 0; local_240._buf[4] = -0x23; local_240._buf[5] = -0x24; local_240._buf[6] = '\\'; local_240._buf[7] = '>'; local_240._buf[8] = -0x53; local_240._buf[9] = -0x54; local_240._buf[10] = ','; local_240._buf[0xb] = '>'; local_240._buf[0xc] = -0x4b; local_240._buf[0xd] = -0x4c; local_240._buf[0xe] = '4'; local_240._buf[0xf] = '>'; local_240._size = 0x3f800000; local_24c.y = 1.4013e-45; local_244 = (void *)0x2; FUN_009c2760(pcVar7,&local_244,&g_vectorZero,&local_24c.y,local_240._buf + 4); local_2d4 = 0x3f666666; local_2f0 = 0x3f400000; LAB_004205f8: local_27c = 2; local_278 = 1; local_260 = 0; local_294 = FUN_00420760; local_290 = 0; local_28c = FUN_004207c0; local_288 = 0; DAT_00bf93e4 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_300); FUN_009c3940(DAT_00bf93e4); FUN_009c0870(0,0); FUN_009c3940(DAT_00bf93e4); FUN_009c0870(1,0); local_284 = 0; local_280 = 0; local_28c = (code *)0x0; local_288 = 0; local_294 = (code *)0x0; local_290 = 0; FID_conflict__Tidy(local_2a0); FID_conflict__Tidy(local_2ac); ExceptionList = local_1c; return 1; } //@@ 00420710 FUN_00420710 void FUN_00420710(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x7c) = 0; *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x74) = 0; *(undefined4 *)(in_ECX + 0x78) = 0; *(undefined4 *)(in_ECX + 0x6c) = 0; *(undefined4 *)(in_ECX + 0x70) = 0; FID_conflict__Tidy((void *)(in_ECX + 0x60)); FID_conflict__Tidy((void *)(in_ECX + 0x54)); return; } //@@ 00420760 FUN_00420760 void FUN_00420760(void *param_1) { longlong lVar1; lVar1 = Popup::get_elapsed_ms(param_1); if (((int)((ulonglong)lVar1 >> 0x20) != 0) || (4999 < (uint)lVar1)) { FUN_009c0870(0,1); FUN_009c0870(1,1); *(undefined4 *)((int)param_1 + 0x90) = 0; *(undefined4 *)((int)param_1 + 0x94) = 0; *(undefined4 *)((int)param_1 + 0x98) = 0; *(undefined4 *)((int)param_1 + 0x9c) = 0; } return; } //@@ 004207c0 FUN_004207c0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_004207c0(int param_1) { AnimationState *this; float unaff_EDI; undefined1 *puVar1; undefined1 auStack_26 [2]; Vector VStack_24; undefined1 auStack_1c [4]; undefined1 local_18 [8]; undefined1 local_10 [12]; if (((g_manager->_framecount & 1) == 0) && (DAT_00c78ed1 != '\0')) { AnimationState::Update((AnimationState *)&DAT_00c78df8); AnimationState::Update((AnimationState *)&DAT_00c78e18); } FUN_009c06a0(local_18); puVar1 = local_10; (**(code **)(*(int *)(param_1 + 200) + 8))(); (**(code **)(*(int *)(param_1 + 0xf0) + 8))(auStack_1c); FUN_008370b0(); (**(code **)(*(int *)(param_1 + 0xf0) + 8))(auStack_26 + -10); _DAT_00c78e64 = (float)puVar1 * 0.8; _DAT_00c78e68 = unaff_EDI * 0.8; if (DAT_00c78ed1 != '\0') { if (DAT_00c78e38 == '\0') { AnimationState::Render ((AnimationState *)&DAT_00c78df8,(Vector *)(auStack_26 + -6),&g_vectorZero, &g_vectorZero); this = (AnimationState *)&DAT_00c78e18; } else { AnimationState::Render ((AnimationState *)&DAT_00c78e18,(Vector *)(auStack_26 + -6),&g_vectorZero, &g_vectorZero); this = (AnimationState *)&DAT_00c78df8; } AnimationState::Render(this,(Vector *)(auStack_26 + -6),&g_vectorZero,&g_vectorZero); } _DAT_00c78e64 = g_vectorOne.x; _DAT_00c78e68 = g_vectorOne.y; return; } //@@ 00420930 FUN_00420930 void FUN_00420930(int *param_1) { Manager *pMVar1; pMVar1 = g_manager; if (*param_1 == 1) { if (DAT_00bf93e0 == 0) { (g_manager->_optionsConfig)._acceptedPublicBeta_VERSION = 1; } else { if (DAT_00bf93e0 != 1) goto LAB_00420979; (g_manager->_optionsConfig)._acceptedDataCollectionDisclaimer = 1; } OptionsConfig::Save(&pMVar1->_optionsConfig); } LAB_00420979: if (DAT_00c71658 != (code *)0x0) { (*DAT_00c71658)(*param_1 == 1,DAT_00c71654); } DAT_00bf93e4 = 0xffffffff; DAT_00bf93e0 = 2; DAT_00c71658 = (code *)0x0; DAT_00c71654 = 0; return; } //@@ 004209d0 FID_conflict:_Tidy /* Library Function - Multiple Matches With Different Base Names public: __thiscall std::vector >::~vector >(void) private: void __thiscall std::vector >::_Tidy(void) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Tidy(void *this) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x30) * 0x30; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } return; } //@@ 00420a40 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x30; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 00420a80 sprintf /* DB: (buf,fmt,...) via vsprintf prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl sprintf(byte *buffer,byte *format) { int iVar1; iVar1 = FUN_0041d4d0(format); return iVar1; } //@@ 00420ae0 FUN_00420ae0 RoomTransition * FUN_00420ae0(void) { return &g_game->_roomTransition; } //@@ 00420af0 MusicManager::SFXManager /* ZHL [lua] Lua binding MusicManager:SFXManager prototype: db/protos.zhl */ SoundEffects * __cdecl MusicManager::SFXManager(void) { return &g_manager->_sfxManager; } //@@ 00420b00 FUN_00420b00 void FUN_00420b00(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); return; } //@@ 00420b20 FUN_00420b20 void FUN_00420b20(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x11c),0x38,5,FUN_00420b00); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x58)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 00420ba0 Game::load_bossoverlays_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Game::LoadConfigXmls with "bossoverlays.xml"; parses anm2root/entry/persist/bossoverlay attributes via xml_node */ 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 = (undefined1 *)(anm2Root + 0x14); local_14 = (byte ***)0xffffffff; puStack_18 = &LAB_00af17c3; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(anm2Root + 0x11); ExceptionList = &local_1c; *in_ECX = 0; local_24 = uVar3; file = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (file == (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 = (byte ***)0x0; uVar3 = 0x420c75; pbVar9 = text; rapidxml::xml_document::parse(xmlDoc,text); bVar2 = (byte)pbVar9; node = xml_node::first_node(xmlDoc,(byte *)"bossoverlay",uVar3,bVar2); anm2RootAttr = xml_node::first_attribute(node,(byte *)"anm2root",uVar3,bVar2); anm2RootSize = 0; anm2RootCapacity = 0xf; anm2Root[0] = (byte ****)0x0; pbVar9 = &g_xmlNullStr; if (*(byte **)((int)anm2RootAttr + 4) != (byte *)0x0) { pbVar9 = *(byte **)((int)anm2RootAttr + 4); } pbVar7 = pbVar9; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar7 - (int)(pbVar9 + 1); std::string::assign((char *)anm2Root,pbVar9,uVar3); for (node = xml_node::first_node(node,(byte *)"entry",(int)pbVar9,(byte)uVar3); node != (void *)0x0; node = *(void **)((int)node + 0x2c)) { anm2PathCapacity = 0xf; overlayId = 0; anm2PathSize = 0; anm2Path = (byte ****)0x0; animNameSize = 0; animNameCapacity = 0xf; animName[0] = (byte ****)0x0; isPersist = 0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14 = (byte ***)CONCAT31(local_14._1_3_,2); attr = *(undefined4 **)((int)node + 0x20); uVar3 = 0; if (attr == (undefined4 *)0x0) { LAB_004210b2: in_ECX[uVar3 * 0xe + 0x47] = uVar3; if ((byte *****)(in_ECX + uVar3 * 0xe + 0x48) != &anm2Path) { ppppbVar6 = (byte ****)&anm2Path; if (0xf < anm2PathCapacity) { ppppbVar6 = anm2Path; } std::string::assign((char *)(in_ECX + uVar3 * 0xe + 0x48),(byte *)ppppbVar6,anm2PathSize); } if ((byte *****)(in_ECX + uVar3 * 0xe + 0x4e) != animName) { ppppbVar6 = (byte ****)animName; if (0xf < animNameCapacity) { ppppbVar6 = animName[0]; } std::string::assign((char *)(in_ECX + uVar3 * 0xe + 0x4e),(byte *)ppppbVar6,animNameSize); } *(undefined1 *)(in_ECX + uVar3 * 0xe + 0x54) = isPersist; } else { do { pbVar9 = (byte *)*attr; pbVar8 = s_id; pbVar7 = &g_xmlNullStr; if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; } do { bVar2 = *pbVar7; bVar10 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00420d91: uVar3 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar9 = (byte *)attr[1]; } overlayId = atoi((char *)pbVar9); } else { pbVar8 = &DAT_00b1bff4; pbVar7 = &g_xmlNullStr; if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; } do { bVar2 = *pbVar7; bVar10 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00420df0: uVar3 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar9 = (byte *)attr[1]; } pbVar7 = pbVar9; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); allocSource = (std_string *)(pbVar7 + -(int)(pbVar9 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < allocSource) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar6 = (byte ****)anm2Root; if (0xf < anm2RootCapacity) { ppppbVar6 = anm2Root[0]; } std::string::concat((char *)&tmpString,(int)in_ECX,allocSource,(byte *)ppppbVar6, anm2RootSize,pbVar9,(uint)allocSource); if (0xf < anm2PathCapacity) { uVar3 = anm2PathCapacity + 1; ppppbVar6 = anm2Path; if (0xfff < uVar3) { ppppbVar6 = (byte ****)anm2Path[-1]; uVar3 = anm2PathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Path + (-4 - (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 != (byte *)0x0) { pbVar7 = pbVar9; } do { bVar2 = *pbVar7; bVar10 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00420ed8: uVar3 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar9 = (byte *)attr[1]; } pbVar7 = pbVar9; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); std::string::assign((char *)animName,pbVar9,(int)pbVar7 - (int)(pbVar9 + 1)); } else { persistKeyChar = "persist"; pbVar7 = &g_xmlNullStr; if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; } do { bVar2 = *pbVar7; bVar10 = bVar2 < (byte)*persistKeyChar; if (bVar2 != *persistKeyChar) { LAB_00420f40: uVar3 = -(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 = (byte ****)0x0; tmpStringSize = 0; pbVar9 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar9 = (byte *)attr[1]; } tmpStringCapacity = 0xf; pbVar7 = pbVar9; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); std::string::assign((char *)&tmpString,pbVar9,(int)pbVar7 - (int)(pbVar9 + 1)); if (tmpStringSize == 0) { LAB_00421045: isPersist = 0; } else { ppppbVar6 = (byte ****)&tmpString; if (0xf < tmpStringCapacity) { ppppbVar6 = tmpString; } if (tmpStringSize == 4) { if ((*ppppbVar6 == (byte ***)0x65757274) || ((((bVar2 = (byte)*ppppbVar6, bVar10 = bVar2 < 0x74, bVar2 == 0x74 && (bVar10 = *(byte *)((int)ppppbVar6 + 1) < 0x72, *(byte *)((int)ppppbVar6 + 1) == 0x72)) && (bVar10 = *(byte *)((int)ppppbVar6 + 2) < 0x75, *(byte *)((int)ppppbVar6 + 2) == 0x75)) && (bVar10 = *(byte *)((int)ppppbVar6 + 3) < 0x65, *(byte *)((int)ppppbVar6 + 3) == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar10 | 1; } if (uVar3 != 0) goto LAB_00420fdd; } else { LAB_00420fdd: ppppbVar6 = (byte ****)&tmpString; if (0xf < tmpStringCapacity) { ppppbVar6 = tmpString; } if (tmpStringSize == 4) { if ((*ppppbVar6 == (byte ***)0x65757254) || (((bVar2 = (byte)*ppppbVar6, bVar10 = bVar2 < 0x54, bVar2 == 0x54 && (bVar10 = *(byte *)((int)ppppbVar6 + 1) < 0x72, *(byte *)((int)ppppbVar6 + 1) == 0x72)) && ((bVar10 = *(byte *)((int)ppppbVar6 + 2) < 0x75, *(byte *)((int)ppppbVar6 + 2) == 0x75 && (bVar10 = *(byte *)((int)ppppbVar6 + 3) < 0x65, *(byte *)((int)ppppbVar6 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar10 | 1; } if (uVar3 == 0) goto LAB_0042103c; } ppppbVar6 = (byte ****)&tmpString; if (0xf < tmpStringCapacity) { ppppbVar6 = tmpString; } iVar5 = atoi((char *)ppppbVar6); if (iVar5 == 0) goto LAB_00421045; } LAB_0042103c: isPersist = 1; } if (0xf < tmpStringCapacity) { uVar3 = tmpStringCapacity + 1; ppppbVar6 = tmpString; if (0xfff < uVar3) { ppppbVar6 = (byte ****)tmpString[-1]; uVar3 = tmpStringCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)tmpString + (-4 - (int)ppppbVar6))) goto LAB_004211de; } operator_delete(ppppbVar6,uVar3); } } } } } } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); uVar3 = overlayId; if (overlayId < 5) goto LAB_004210b2; } local_14 = (byte ***)CONCAT31(local_14._1_3_,1); if (0xf < animNameCapacity) { uVar3 = animNameCapacity + 1; ppppbVar6 = animName[0]; if (0xfff < uVar3) { ppppbVar6 = (byte ****)animName[0][-1]; uVar3 = animNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)animName[0] + (-4 - (int)ppppbVar6))) goto LAB_004211de; } operator_delete(ppppbVar6,uVar3); } if (0xf < anm2PathCapacity) { uVar3 = anm2PathCapacity + 1; ppppbVar6 = anm2Path; if (0xfff < uVar3) { ppppbVar6 = (byte ****)anm2Path[-1]; uVar3 = anm2PathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Path + (-4 - (int)ppppbVar6))) goto LAB_004211de; } operator_delete(ppppbVar6,uVar3); } } local_14 = (byte ***)((uint)local_14 & 0xffffff00); if (0xf < anm2RootCapacity) { uVar3 = anm2RootCapacity + 1; ppppbVar6 = anm2Root[0]; if (0xfff < uVar3) { ppppbVar6 = (byte ****)anm2Root[0][-1]; uVar3 = anm2RootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Root[0] + (-4 - (int)ppppbVar6))) { LAB_004211de: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar6,uVar3); } local_14 = (byte ***)0x3; xml_memory_pool::clear(auStack_10070); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar3 = *(uint *)(text + -4); qVar1 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar3; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar1 < uVar3); free(text + -4); } uVar4 = 1; } ExceptionList = local_1c; return uVar4; } //@@ 00421260 FUN_00421260 void FUN_00421260(void) { SoundEffects *this; Manager *pMVar1; undefined4 *in_ECX; ANM2::Reset((ANM2 *)(in_ECX + 2)); *in_ECX = 0; in_ECX[1] = 0; pMVar1 = g_manager; if ((g_manager->_sfxManager)._volumeModifier != 1.0) { this = &g_manager->_sfxManager; (g_manager->_sfxManager)._volumeModifier = 1.0; SoundEffects::ClearVolumeModifier(this); } (pMVar1->_sfxManager)._volumeModifierStep = 0.005; return; } //@@ 004212c0 BossOverlay::update /* DB: called from Game::Update with ECX=Game+0x1d2ec; overlay 3 (Dogma Shutdown) "End" event: Dogma kill counters, cutscene 25, StartRoomTransition(-10,-1,1) into the Beast room (beast.md) */ void BossOverlay::update(void) { SoundEffects *this; int *piVar1; Game *this_00; Manager *pMVar2; byte bVar3; int *in_ECX; if (*in_ECX != 0) { if ((*in_ECX == 1) && (((in_ECX[0xf] == 0 || ((char)in_ECX[0x13] == '\0')) && ((char)in_ECX[(in_ECX[1] + 6) * 0xe] == '\0')))) { *in_ECX = 0; } if (*(char *)((int)in_ECX + 0x111) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0xe)); AnimationState::Update((AnimationState *)(in_ECX + 0x16)); } if (in_ECX[1] == 3) { if (in_ECX[0xf] != 0) { bVar3 = AnimationState::IsEventTriggered((AnimationState *)(in_ECX + 0xe),&DAT_00b1c00c); pMVar2 = g_manager; if (bVar3 != 0) { this = &g_manager->_sfxManager; piVar1 = (g_manager->_persistentGameData)._cutsceneCounters + 0x19; *piVar1 = *piVar1 + 1; *(undefined1 *)&pMVar2->_persistentGameData = 1; piVar1 = (pMVar2->_persistentGameData)._cutsceneCounters + 2; *piVar1 = *piVar1 + 1; *(undefined1 *)&pMVar2->_persistentGameData = 1; (pMVar2->_cutsceneManager).field_0x848 = 1; (pMVar2->_cutsceneManager)._isQueuedCleanup = 0; pMVar2->_cutsceneNextMenuState = 1; (pMVar2->_cutsceneManager)._queuedCutsceneId = 0x19; (pMVar2->_achievementOverlay)._isPopupBlocked = 1; if ((pMVar2->_sfxManager)._volumeModifier != 1.0) { (pMVar2->_sfxManager)._volumeModifier = 1.0; SoundEffects::ClearVolumeModifier(this); } this_00 = g_game; (pMVar2->_sfxManager)._volumeModifierStep = 0.005; Game::StartRoomTransition(this_00,-10,-1,1,(Entity_Player *)0x0,-1); RoomTransition::Update(&g_game->_roomTransition); return; } if ((in_ECX[0xf] != 0) && ((char)in_ECX[0x13] != '\0')) { return; } } *in_ECX = 0; in_ECX[1] = 0; } } return; } //@@ 00421400 FUN_00421400 void FUN_00421400(void) { int *in_ECX; AnimationState *this; float fVar1; if (*in_ECX != 0) { DAT_00c33910 = 0; fVar1 = g_screenHeight / 270.0; in_ECX[0x29] = (int)(g_screenWidth / 480.0); in_ECX[0x2a] = (int)fVar1; if (*(char *)((int)in_ECX + 0x111) != '\0') { this = (AnimationState *)(in_ECX + 0x16); if ((char)in_ECX[0x1e] == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0xe),&g_vectorZero,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render(this,&g_vectorZero,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0xe); } AnimationState::Render(this,&g_vectorZero,&g_vectorZero,&g_vectorZero); } DAT_00c33910 = 1; } return; } //@@ 004214b0 BossOverlay::play /* DB: this=Game+0x1d2ec (bossoverlays.xml, 5 entries x 0x38 at +0x120): loads entry id's anm2 and anim; Dogma angel death plays 2/3, Beast death 4 (beast.md) */ void BossOverlay::play(uint param_1) { ANM2 *this; byte *pbVar1; byte bVar2; LayerState *pLVar3; byte *pbVar4; uint uVar5; byte unk; undefined4 *in_ECX; byte *pbVar6; byte *anim; bool bVar7; if (4 < param_1) { return; } this = (ANM2 *)(in_ECX + 2); ANM2::Load(this,(std_string *)(in_ECX + param_1 * 0xe + 0x48),1); ANM2::LoadGraphics(this,unk); in_ECX[1] = param_1; if ((param_1 == 2) || (param_1 == 3)) { pLVar3 = ANM2::GetLayer(this,&DAT_00000004); pLVar3->_bitflags = pLVar3->_bitflags | 0x20; } anim = (byte *)(in_ECX + param_1 * 0xe + 0x4e); if (0xf < (uint)in_ECX[param_1 * 0xe + 0x53]) { anim = *(byte **)anim; } if (in_ECX[0xf] != 0) { pbVar1 = (byte *)in_ECX[0xf]; pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pbVar6 = anim; do { bVar2 = *pbVar4; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_00421555: uVar5 = -(uint)bVar7 | 1; goto LAB_0042155a; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_00421555; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0042155a: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x13) != '\0')))) goto LAB_00421582; } bVar2 = ANM2::SetAnimation(this,anim,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0xe)); *(undefined1 *)(in_ECX + 0x13) = 1; } LAB_00421582: *in_ECX = 1; return; } //@@ 004215a0 FUN_004215a0 void FUN_004215a0(char *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; char *in_ECX; if (in_ECX != param_1) { std::string::_Tidy_deallocate(in_ECX); uVar1 = *(undefined4 *)(param_1 + 4); uVar2 = *(undefined4 *)(param_1 + 8); uVar3 = *(undefined4 *)(param_1 + 0xc); *(undefined4 *)in_ECX = *(undefined4 *)param_1; *(undefined4 *)(in_ECX + 4) = uVar1; *(undefined4 *)(in_ECX + 8) = uVar2; *(undefined4 *)(in_ECX + 0xc) = uVar3; *(undefined8 *)(in_ECX + 0x10) = *(undefined8 *)(param_1 + 0x10); param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; } return; } //@@ 004215e0 FUN_004215e0 void FUN_004215e0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; char *in_ECX; std::string::_Tidy_deallocate(in_ECX); uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *(undefined4 *)in_ECX = *param_1; *(undefined4 *)(in_ECX + 4) = uVar1; *(undefined4 *)(in_ECX + 8) = uVar2; *(undefined4 *)(in_ECX + 0xc) = uVar3; *(undefined8 *)(in_ECX + 0x10) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; return; } //@@ 00421620 FUN_00421620 void FUN_00421620(byte *param_1) { byte bVar1; std_string *allocSource; char *in_ECX; byte *in_EDX; byte *pbVar2; uint rightSize; allocSource = *(std_string **)(in_EDX + 0x10); pbVar2 = param_1; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); rightSize = (int)pbVar2 - (int)(param_1 + 1); if (0x7fffffffU - (int)allocSource < rightSize) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } std::string::concat(in_ECX,(int)(param_1 + 1),allocSource,in_EDX,(uint)allocSource,param_1, rightSize); return; } //@@ 00421680 std::string::concat /* DB: alloc + 2 memcpy prototype: db/protos.zhl, confirmed by RET 24 */ void __thiscall std::string::concat(char *this,int tag,std_string *allocSource,byte *left,uint leftSize,byte *right, uint rightSize) { uint uVar1; char *_Dst; uint uVar2; uVar1 = leftSize + rightSize; uVar2 = 0xf; this[0] = '\0'; this[1] = '\0'; this[2] = '\0'; this[3] = '\0'; this[0x10] = '\0'; this[0x11] = '\0'; this[0x12] = '\0'; this[0x13] = '\0'; this[0x14] = '\0'; this[0x15] = '\0'; this[0x16] = '\0'; this[0x17] = '\0'; _Dst = this; if (0xf < uVar1) { uVar2 = uVar1 | 0xf; if (uVar2 < 0x80000000) { if (uVar2 < 0x16) { uVar2 = 0x16; } } else { uVar2 = 0x7fffffff; } _Dst = _Allocate(uVar2 + 1); *(char **)this = _Dst; } *(uint *)(this + 0x14) = uVar2; *(uint *)(this + 0x10) = uVar1; memcpy(_Dst,left,leftSize); memcpy(_Dst + leftSize,right,rightSize); _Dst[uVar1] = '\0'; return; } //@@ 00421720 FUN_00421720 uint FUN_00421720(uint param_1) { uint *puVar1; int in_ECX; uint uVar2; puVar1 = *(uint **)(in_ECX + 0x8ac); uVar2 = 1 << ((byte)param_1 & 0x1f); if (((puVar1[param_1 >> 5] & uVar2) == 0) && (puVar1 = (uint *)(*(int *)(in_ECX + 0x8bc) + (param_1 >> 5) * 4), (*puVar1 & uVar2) == 0)) { return (uint)puVar1 & 0xffffff00; } return CONCAT31((int3)((uint)puVar1 >> 8),1); } //@@ 00421770 Game::Challenge /* ZHL [lua] Lua binding Game:Challenge */ int __thiscall Game::Challenge(Game *this) { return this->_challenge; } //@@ 00421780 FUN_00421780 DailyChallenge * FUN_00421780(void) { return &g_game->_dailyChallenge; } //@@ 00421790 FUN_00421790 RoomConfig * FUN_00421790(void) { return &g_game->_roomConfig; } //@@ 004217a0 Game::GetStateFlag /* ZHL [lua] Lua binding Game:GetStateFlag prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Game::GetStateFlag(Game *this,int flag) { uint uVar1; uint uVar2; uint uVar3; if (flag < 1) { flag = 0; } uVar3 = 0x34; if (flag < 0x34) { uVar3 = flag; } uVar2 = 1 << (uVar3 & 0x1f); uVar1 = 0; if (0x1f < (uVar3 & 0x3f)) { uVar1 = uVar2; } uVar2 = uVar2 ^ uVar1; if (0x3f < (uVar3 & 0x3f)) { uVar1 = uVar2; } if ((uVar2 & *(uint *)(this->_giantBookClickerImage + (uVar3 >> 6) * 8 + 0x28)) == 0 && (uVar1 & *(uint *)(this->_giantBookClickerImage + (uVar3 >> 6) * 8 + 0x2c)) == 0) { return 0; } return 1; } //@@ 00421800 Room::GetTopLeftPos /* ZHL [lua] Lua binding Room:GetTopLeftPos */ Vector * __thiscall Room::GetTopLeftPos(Room *this) { return &this->_topLeftPos; } //@@ 00421860 FUN_00421860 void FUN_00421860(void) { char *in_ECX; FID_conflict__Tidy(in_ECX + 0x18); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 00421880 FUN_00421880 void FUN_00421880(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; FID_conflict__Tidy((void *)((int)in_ECX + 0x8bc)); FID_conflict__Tidy((void *)((int)in_ECX + 0x8ac)); _eh_vector_destructor_iterator_(in_ECX,0x3c,0x25,FUN_00421860); ExceptionList = local_10; return; } //@@ 004218e0 BossPool::init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX layout = BossPool (37 pools stride 0x3c from +0x18 with RNG at +0x28, vector_bool _removedBosses 0x8ac and _levelBlacklist 0x8bc of 0x68 bits): seeds each pool RNG from arg seed (shift 2,21,9), clears removed/blacklist bits, BossPool::load_xml("bosspools.xml") and MT-shuffles each pool's 0x14-byte entries; called by Game::restore_game_state and Console::RunCommand */ uint BossPool::init(uint param_1) { undefined4 *pickedEntry; code *pcVar2; undefined4 uVar3; undefined4 uVar4; undefined4 lastEntryTail; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; uint uVar10; byte isFillValue; int in_ECX; int wordOffset; uint uVar11; uint swapIndex; uint uVar12; uint uVar13; uint *poolRng; int poolsLeft; int lastEntryOffset; uint *local_9dc; MTRNG mtRng [624]; undefined4 local_18; uint local_c; undefined1 auStack_8 [4]; int blacklistBits; undefined4 *lastEntry; undefined4 lastEntryTail; undefined4 *pickedEntry; local_c = __security_cookie ^ (uint)(auStack_8 + 4); poolRng = (uint *)(in_ECX + 0x28); local_9dc = (uint *)0x25; do { if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar10 = (*pcVar2)(); return uVar10; } param_1 = param_1 >> 3 ^ param_1; poolRng[1] = 2; poolRng[2] = 0x15; param_1 = param_1 << 0xd ^ param_1; param_1 = param_1 >> 7 ^ param_1; *poolRng = param_1; poolRng[3] = 9; poolRng = poolRng + 0xf; local_9dc = (uint *)((int)local_9dc + -1); } while (local_9dc != (uint *)0x0); vector_bool_resize((void *)(in_ECX + 0x8ac),0x68,7); vector_bool_resize((int *)(in_ECX + 0x8bc),0x68,isFillValue); uVar10 = 0; if (*(int *)(in_ECX + 0x8b8) != 0) { do { wordOffset = (uVar10 >> 5) * 4; uVar12 = uVar10 & 0x1f; blacklistBits = *(int *)(in_ECX + 0x8bc); uVar11 = *(uint *)(blacklistBits + wordOffset) & ~(1 << uVar12); *(uint *)(blacklistBits + wordOffset) = uVar11; uVar13 = *(uint *)(*(int *)(in_ECX + 0x8ac) + wordOffset); if ((uVar11 & 1 << (sbyte)uVar12) == 0) { uVar13 = uVar13 & ~(1 << uVar12); } else { uVar13 = uVar13 | 1 << uVar12; } uVar10 = uVar10 + 1; *(uint *)(*(int *)(in_ECX + 0x8ac) + wordOffset) = uVar13; } while (uVar10 < *(uint *)(in_ECX + 0x8b8)); } load_xml("bosspools.xml",0); ModManager::LoadModBossPools(); local_9dc = (uint *)(in_ECX + 0x18); poolsLeft = 0x25; do { uVar10 = *local_9dc; if (uVar10 != local_9dc[1]) { local_18 = 0x271; MTRNG::Init(mtRng,local_9dc[4]); uVar10 = (local_9dc[1] - *local_9dc) * 0x66666667; uVar13 = (int)(local_9dc[1] - *local_9dc) / 0x14; uVar11 = uVar13 - 1; if (0 < (int)uVar11) { lastEntryOffset = uVar11 * 0x14; do { uVar12 = MTRNG::Next(mtRng); swapIndex = 0; uVar10 = uVar12; if (uVar13 != 0) { uVar10 = uVar12 / uVar13; swapIndex = uVar12 % uVar13; } if (uVar11 != swapIndex) { uVar12 = *local_9dc; pickedEntry = (undefined4 *)(uVar12 + swapIndex * 0x14); uVar3 = pickedEntry[1]; uVar4 = pickedEntry[2]; lastEntryTail = pickedEntry[3]; pickedEntry = (undefined4 *)(uVar12 + swapIndex * 0x14); lastEntryTail = *(undefined4 *)(lastEntryOffset + 0x10 + uVar12); lastEntry = (undefined4 *)(lastEntryOffset + uVar12); uVar6 = *lastEntry; uVar7 = lastEntry[1]; uVar8 = lastEntry[2]; uVar9 = lastEntry[3]; lastEntry = (undefined4 *)(lastEntryOffset + uVar12); *lastEntry = *pickedEntry; lastEntry[1] = uVar3; lastEntry[2] = uVar4; lastEntry[3] = lastEntryTail; uVar10 = pickedEntry[4]; *(uint *)(lastEntryOffset + 0x10 + uVar12) = uVar10; *pickedEntry = uVar6; pickedEntry[1] = uVar7; pickedEntry[2] = uVar8; pickedEntry[3] = uVar9; pickedEntry[4] = lastEntryTail; } uVar11 = uVar11 - 1; lastEntryOffset = lastEntryOffset + -0x14; uVar13 = uVar13 - 1; } while (0 < (int)uVar11); } } local_9dc = local_9dc + 0xf; poolsLeft = poolsLeft + -1; } while (poolsLeft != 0); return uVar10; } //@@ 00421b50 FUN_00421b50 void FUN_00421b50(void) { uint *puVar1; uint uVar2; uint uVar3; int in_ECX; uint uVar4; uint uVar5; int iVar6; uVar5 = 0; if (*(int *)(in_ECX + 0x8b8) != 0) { do { iVar6 = (uVar5 >> 5) * 4; uVar4 = uVar5 & 0x1f; puVar1 = (uint *)(*(int *)(in_ECX + 0x8ac) + iVar6); uVar2 = 1 << (sbyte)uVar4; uVar3 = *puVar1; if (((uVar2 & uVar3) == 0) && ((*(uint *)(*(int *)(in_ECX + 0x8bc) + iVar6) & uVar2) == 0)) { uVar3 = uVar3 & ~(1 << uVar4); } else { uVar3 = uVar3 | 1 << uVar4; } uVar5 = uVar5 + 1; *puVar1 = uVar3; *(uint *)(*(int *)(in_ECX + 0x8bc) + iVar6) = *(uint *)(*(int *)(in_ECX + 0x8bc) + iVar6) & ~(1 << uVar4); } while (uVar5 < *(uint *)(in_ECX + 0x8b8)); } return; } //@@ 00421bf0 BossPool::load_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (path, isMod): parses bosspools.xml ("Boss pool: Unknown stage '%s'", "BossID out of bounds", stage names basement..mortis, doubletrouble); callers 004218e0 BossPool::init and ModManager loader 008f4890 ModManager::LoadModBossPools void BossPool::load_xml(byte *param_1,int param_2) { byte bVar1; byte *****pppppbVar2; int *file; int iVar3; void *pvVar4; byte ****ppppbVar5; uint uVar6; byte *******pppppppbVar7; byte ****bossAttrNameCursor; byte *pbVar8; uint length; char *keyCursor; undefined4 *poolAttr; byte *poolAttrValue; bool bVar9; double dVar10; undefined1 auStack_100cc [8]; void *pvStack_100c4; int iStack_100c0; byte *xmlText; int poolNode; byte ****attrName; undefined1 auStack_100b0 [4]; byte ******ppppppbStack_100ac; char *stageKeyName; byte *******pppppppbStack_100a4; byte bStack_1009d; byte *****bossId; byte *****bossWeight; byte *****bossInitialWeight; byte *****pppppbStack_10090; byte *****bossRoom; undefined1 xmlDoc [48]; undefined1 xmlPool [65564]; byte *******stageName [4]; uint stageNameSize; uint stageNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; byte ******bossesEnd; Manager *manager; puStack_20 = (undefined1 *)(stageName + 0xe); local_14 = (byte ******)0xffffffff; puStack_18 = &LAB_00af1814; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(stageName + 0xb); ExceptionList = &local_1c; if (param_2 == 0) { pppppppbVar7 = (byte *******)(stageName + 0xe); if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7f6f0) { _Init_thread_header(&DAT_00c7f6f0,local_24); pppppppbVar7 = (byte *******)puStack_20; if (DAT_00c7f6f0 == -1) { local_14 = (byte ******)0x0; DAT_00c7f6f4 = operator_new(0x2c); *(void **)DAT_00c7f6f4 = DAT_00c7f6f4; *(void **)((int)DAT_00c7f6f4 + 4) = DAT_00c7f6f4; *(void **)((int)DAT_00c7f6f4 + 8) = DAT_00c7f6f4; *(undefined2 *)((int)DAT_00c7f6f4 + 0xc) = 0x101; _atexit(FUN_00b153a0); local_14 = (byte ******)0xffffffff; _Init_thread_footer(&DAT_00c7f6f0); pppppppbVar7 = (byte *******)puStack_20; } } puStack_20 = (undefined1 *)pppppppbVar7; if (DAT_00c7f6f8 == 0) { stageKeyName = "basement"; pppppppbStack_100a4 = (byte *******)0x1; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "cellar"; pppppppbStack_100a4 = (byte *******)0x2; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "caves"; pppppppbStack_100a4 = (byte *******)0x4; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "catacombs"; pppppppbStack_100a4 = (byte *******)0x5; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "depths"; pppppppbStack_100a4 = (byte *******)0x7; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "necropolis"; pppppppbStack_100a4 = (byte *******)0x8; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "womb"; pppppppbStack_100a4 = (byte *******)0xa; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "utero"; pppppppbStack_100a4 = (byte *******)0xb; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "sheol"; pppppppbStack_100a4 = (byte *******)0xe; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "cathedral"; pppppppbStack_100a4 = (byte *******)0xf; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "dark room"; pppppppbStack_100a4 = (byte *******)0x10; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "chest"; pppppppbStack_100a4 = (byte *******)0x11; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "burning basement"; pppppppbStack_100a4 = (byte *******)0x3; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "flooded caves"; pppppppbStack_100a4 = (byte *******)0x6; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "dank depths"; pppppppbStack_100a4 = (byte *******)0x9; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "scarred womb"; pppppppbStack_100a4 = (byte *******)0xc; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "blue womb"; pppppppbStack_100a4 = (byte *******)0xd; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "void"; pppppppbStack_100a4 = (byte *******)0x1a; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "downpour"; pppppppbStack_100a4 = (byte *******)0x1b; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "mines"; pppppppbStack_100a4 = (byte *******)0x1d; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "mausoleum"; pppppppbStack_100a4 = (byte *******)0x1f; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "corpse"; pppppppbStack_100a4 = (byte *******)0x21; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "dross"; pppppppbStack_100a4 = (byte *******)0x1c; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "ashpit"; pppppppbStack_100a4 = (byte *******)0x1e; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "gehenna"; pppppppbStack_100a4 = (byte *******)0x20; FUN_00423500(auStack_100b0,&stageKeyName); stageKeyName = "mortis"; pppppppbStack_100a4 = (byte *******)0x22; FUN_00423500(auStack_100b0,&stageKeyName); } file = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (file != (int *)0x0) { iVar3 = (**(code **)(*file + 4))(); xmlText = operator_new_tracked(iVar3 + 1); (**(code **)(*file + 0x14))(xmlText,1,iVar3); xmlText[iVar3] = 0; (**(code **)*file)(1); FUN_00413b90(); local_14 = (byte ******)0x1; iVar3 = 0x4220d8; pbVar8 = xmlText; rapidxml::xml_document::parse(xmlDoc,xmlText); pvVar4 = xml_node::first_node(xmlDoc,(byte *)"bosspools",iVar3,(byte)pbVar8); if (pvVar4 != (void *)0x0) { for (poolNode = *(int *)((int)pvVar4 + 0x18); poolNode != 0; poolNode = *(int *)(poolNode + 0x2c)) { stageNameSize = 0; stageNameCapacity = 0xf; stageName[0] = (byte *******)0x0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14 = (byte ******)CONCAT31(local_14._1_3_,2); poolAttr = *(undefined4 **)(poolNode + 0x20); ppppppbStack_100ac = (byte ******)0x0; if (poolAttr != (undefined4 *)0x0) { do { pbVar8 = s_name; attrName = (byte ****)&g_xmlNullStr; if ((byte ****)*poolAttr != (byte ****)0x0) { attrName = (byte ****)*poolAttr; } poolAttrValue = &g_xmlNullStr; if ((byte *)poolAttr[1] != (byte *)0x0) { poolAttrValue = (byte *)poolAttr[1]; } ppppbVar5 = attrName; do { bStack_1009d = *(byte *)ppppbVar5; bVar9 = bStack_1009d < *pbVar8; if (bStack_1009d != *pbVar8) { LAB_004221a2: uVar6 = -(uint)bVar9 | 1; goto LAB_004221a7; } if (bStack_1009d == 0) break; bStack_1009d = *(byte *)((int)ppppbVar5 + 1); bVar9 = bStack_1009d < pbVar8[1]; if (bStack_1009d != pbVar8[1]) goto LAB_004221a2; ppppbVar5 = (byte ****)((int)ppppbVar5 + 2); pbVar8 = pbVar8 + 2; } while (bStack_1009d != 0); uVar6 = 0; LAB_004221a7: if (uVar6 == 0) { pbVar8 = poolAttrValue; do { bVar1 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar1 != 0); std::string::assign((char *)stageName,poolAttrValue, (int)pbVar8 - (int)(poolAttrValue + 1)); } else { keyCursor = "doubletrouble"; ppppbVar5 = attrName; do { bVar1 = *(byte *)ppppbVar5; bVar9 = bVar1 < (byte)*keyCursor; if (bVar1 != *keyCursor) { LAB_004221f0: uVar6 = -(uint)bVar9 | 1; goto LAB_004221f5; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)ppppbVar5 + 1); bVar9 = bVar1 < (byte)keyCursor[1]; if (bVar1 != keyCursor[1]) goto LAB_004221f0; ppppbVar5 = (byte ****)((int)ppppbVar5 + 2); keyCursor = keyCursor + 2; } while (bVar1 != 0); uVar6 = 0; LAB_004221f5: if (uVar6 == 0) { ppppppbStack_100ac = (byte ******)atoi((char *)poolAttrValue); } } } while ((poolAttr[4] != 0) && (poolAttr = (undefined4 *)poolAttr[6], poolAttr != (undefined4 *)0x0)); } uVar6 = stageNameCapacity; FUN_00423530(auStack_100cc,stageName); pvVar4 = pvStack_100c4; if (*(char *)((int)pvStack_100c4 + 0xd) == '\0') { pbVar8 = (byte *)((int)pvStack_100c4 + 0x10); if (0xf < *(uint *)((int)pvStack_100c4 + 0x24)) { pbVar8 = *(byte **)pbVar8; } pppppppbVar7 = (byte *******)stageName; if (0xf < uVar6) { pppppppbVar7 = stageName[0]; } iVar3 = string_compare((byte *)pppppppbVar7,stageNameSize,pbVar8, *(uint *)((int)pvStack_100c4 + 0x20)); if ((iVar3 < 0) || (pvVar4 == DAT_00c7f6f4)) goto LAB_004224fe; pppppppbStack_100a4 = (byte *******) (iStack_100c0 + (*(int *)((int)pvVar4 + 0x28) * 0x10 - *(int *)((int)pvVar4 + 0x28)) * 4); if ((byte ********)pppppppbStack_100a4 != stageName) { pppppppbVar7 = (byte *******)stageName; if (0xf < uVar6) { pppppppbVar7 = stageName[0]; } std::string::assign((char *)pppppppbStack_100a4,(byte *)pppppppbVar7,length); } pppppppbStack_100a4[0xe] = ppppppbStack_100ac; pppppppbStack_100a4[7] = pppppppbStack_100a4[6]; pppppppbStack_100a4[9] = (byte ******)0x0; ppppppbStack_100ac = *(byte *******)(poolNode + 0x18); if (ppppppbStack_100ac != (byte ******)0x0) { do { pppppbVar2 = ppppppbStack_100ac[8]; bossId = (byte *****)0x0; bossRoom = (byte *****)0x0; for (; pppppbVar2 != (byte *****)0x0; pppppbVar2 = (byte *****)pppppbVar2[6]) { pbVar8 = s_id; attrName = (byte ****)&g_xmlNullStr; if (*pppppbVar2 != (byte ****)0x0) { attrName = *pppppbVar2; } ppppbVar5 = (byte ****)&g_xmlNullStr; if (pppppbVar2[1] != (byte ****)0x0) { ppppbVar5 = pppppbVar2[1]; } bossAttrNameCursor = attrName; do { bStack_1009d = *(byte *)bossAttrNameCursor; bVar9 = bStack_1009d < *pbVar8; if (bStack_1009d != *pbVar8) { LAB_00422368: uVar6 = -(uint)bVar9 | 1; goto LAB_0042236d; } if (bStack_1009d == 0) break; bStack_1009d = *(byte *)((int)bossAttrNameCursor + 1); bVar9 = bStack_1009d < pbVar8[1]; if (bStack_1009d != pbVar8[1]) goto LAB_00422368; bossAttrNameCursor = (byte ****)((int)bossAttrNameCursor + 2); pbVar8 = pbVar8 + 2; } while (bStack_1009d != 0); uVar6 = 0; LAB_0042236d: if (uVar6 == 0) { bossId = (byte *****)atoi((char *)ppppbVar5); } else { keyCursor = "weight"; bossAttrNameCursor = attrName; do { bStack_1009d = *(byte *)bossAttrNameCursor; bVar9 = bStack_1009d < (byte)*keyCursor; if (bStack_1009d != *keyCursor) { LAB_004223d2: uVar6 = -(uint)bVar9 | 1; goto LAB_004223d7; } if (bStack_1009d == 0) break; bStack_1009d = *(byte *)((int)bossAttrNameCursor + 1); bVar9 = bStack_1009d < (byte)keyCursor[1]; if (bStack_1009d != keyCursor[1]) goto LAB_004223d2; bossAttrNameCursor = (byte ****)((int)bossAttrNameCursor + 2); keyCursor = keyCursor + 2; } while (bStack_1009d != 0); uVar6 = 0; LAB_004223d7: if (uVar6 == 0) { dVar10 = atof((char *)ppppbVar5); bossWeight = (byte *****)(float)dVar10; } else { pbVar8 = &DAT_00b1c17c; bossAttrNameCursor = attrName; do { bVar1 = *(byte *)bossAttrNameCursor; bVar9 = bVar1 < *pbVar8; if (bVar1 != *pbVar8) { LAB_00422410: uVar6 = -(uint)bVar9 | 1; goto LAB_00422415; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)bossAttrNameCursor + 1); bVar9 = bVar1 < pbVar8[1]; if (bVar1 != pbVar8[1]) goto LAB_00422410; bossAttrNameCursor = (byte ****)((int)bossAttrNameCursor + 2); pbVar8 = pbVar8 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_00422415: if (uVar6 == 0) { bossRoom = (byte *****)atoi((char *)ppppbVar5); } } } if (pppppbVar2[4] == (byte ****)0x0) break; } pppppbVar2 = bossId; manager = g_manager; if (((int)bossId < 0) || (((int)(g_manager->_entityConfig)._bosses._end - (int)(g_manager->_entityConfig)._bosses._begin) / 100 <= (int)bossId)) { KAGE_LogMessage(0x10,(byte *)"BossID out of bounds\n"); } pppppppbVar7 = pppppppbStack_100a4; bossInitialWeight = bossWeight; pppppbStack_10090 = *(byte ******) ((int)(manager->_entityConfig)._bosses._begin + (int)pppppbVar2 * 100 + 0x54); bossesEnd = pppppppbStack_100a4[7]; if (bossesEnd == pppppppbStack_100a4[8]) { std::vector<20byte>::_Emplace_reallocate(bossesEnd,&bossId); } else { *bossesEnd = bossId; bossesEnd[1] = bossWeight; bossesEnd[2] = bossWeight; bossesEnd[3] = pppppbStack_10090; bossesEnd[4] = bossRoom; pppppppbStack_100a4[7] = pppppppbStack_100a4[7] + 5; } pppppppbVar7[9] = (byte ******)((float)bossInitialWeight + (float)pppppppbVar7[9]); ppppppbStack_100ac = (byte ******)ppppppbStack_100ac[0xb]; } while (ppppppbStack_100ac != (byte ******)0x0); ppppppbStack_100ac = (byte ******)0x0; } } else { LAB_004224fe: KAGE_LogMessage(4,(byte *)"Boss pool: Unknown stage \'%s\'\n"); } local_14 = (byte ******)CONCAT31(local_14._1_3_,1); if (0xf < stageNameCapacity) { uVar6 = stageNameCapacity + 1; pppppppbVar7 = stageName[0]; if (0xfff < uVar6) { pppppppbVar7 = (byte *******)stageName[0][-1]; uVar6 = stageNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)stageName[0] + (-4 - (int)pppppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar7,uVar6); } } } local_14 = (byte ******)CONCAT31(local_14._1_3_,3); tracked_alloc(1,xmlText,0); local_14 = (byte ******)0x4; xml_memory_pool::clear(xmlPool); } } ExceptionList = local_1c; return; } //@@ 00422620 FUN_00422620 uint * FUN_00422620(int param_1) { float fVar1; byte bVar2; int in_ECX; uint extraout_EDX; uint uVar3; int extraout_EDX_00; int iVar4; uint *puVar5; uint *puVar6; uint uVar7; float fVar8; float in_XMM2_Da; float fVar9; int local_c; if (*(int *)(param_1 + 0x18) == *(int *)(param_1 + 0x1c)) { return (uint *)0x0; } fVar9 = 0.0; if (*(float *)(param_1 + 0x24) <= 0.0) { return (uint *)0x0; } puVar5 = (uint *)0x0; local_c = 9; do { if (puVar5 != (uint *)0x0) goto LAB_00422803; fVar1 = fVar9; for (puVar6 = *(uint **)(param_1 + 0x18); puVar6 != *(uint **)(param_1 + 0x1c); puVar6 = puVar6 + 5) { fVar8 = fVar1 + (float)puVar6[1]; if (in_XMM2_Da < fVar8) { if ((((fVar9 < (float)puVar6[2]) && (in_XMM2_Da < (float)puVar6[2] + fVar1)) && ((uVar7 = *puVar6, uVar7 != 0x4a || (g_game->_challenge != 0x24)))) && (((int)puVar6[3] < 0 || (bVar2 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,puVar6[3]), uVar7 = extraout_EDX, bVar2 != 0)))) { uVar3 = 1 << ((byte)uVar7 & 0x1f); if (((*(uint *)(*(int *)(in_ECX + 0x8ac) + (uVar7 >> 5) * 4) & uVar3) == 0) && ((*(uint *)(*(int *)(in_ECX + 0x8bc) + (uVar7 >> 5) * 4) & uVar3) == 0)) { puVar5 = puVar6; break; } } if (local_c == 0) { KAGE_LogMessage(4,(byte *)"boss pool ran out of repicks\n"); puVar5 = puVar6 + 5; if (puVar5 == *(uint **)(param_1 + 0x1c)) { puVar5 = *(uint **)(param_1 + 0x18); } if (puVar5 == puVar6) goto LAB_0042273f; fVar9 = 0.0; iVar4 = param_1; goto LAB_00422780; } in_XMM2_Da = ((fVar8 - in_XMM2_Da) / (float)puVar6[1]) * *(float *)(param_1 + 0x24); break; } fVar1 = fVar8; } local_c = local_c + -1; } while (-1 < local_c); LAB_00422737: if (puVar5 != (uint *)0x0) { LAB_00422803: uVar7 = *puVar5 >> 5; *(uint *)(*(int *)(in_ECX + 0x8bc) + uVar7 * 4) = *(uint *)(*(int *)(in_ECX + 0x8bc) + uVar7 * 4) | 1 << (*puVar5 & 0x1f); return puVar5; } goto LAB_0042273f; LAB_00422780: do { if (((fVar9 < (float)puVar5[2]) && ((uVar7 = *puVar5, uVar7 != 0x4a || (g_game->_challenge != 0x24)))) && (((int)puVar5[3] < 0 || (bVar2 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,puVar5[3]), iVar4 = extraout_EDX_00, bVar2 != 0)))) { uVar3 = 1 << ((byte)uVar7 & 0x1f); if (((*(uint *)(*(int *)(in_ECX + 0x8ac) + (uVar7 >> 5) * 4) & uVar3) == 0) && ((*(uint *)(*(int *)(in_ECX + 0x8bc) + (uVar7 >> 5) * 4) & uVar3) == 0)) goto LAB_00422737; iVar4 = param_1; } puVar5 = puVar5 + 5; if (puVar5 == *(uint **)(iVar4 + 0x1c)) { puVar5 = *(uint **)(iVar4 + 0x18); } } while (puVar5 != puVar6); LAB_0042273f: KAGE_LogMessage(4,(byte *)"failed to pick random boss from pool\n"); return (uint *)0x0; } //@@ 00422830 BossPool::GetBossId /* WARNING: Removing unreachable block (ram,0x00422956) */ /* DB: REPENTOGON BossPool::GetBossId(leveltype, levelvariant, rng): this indexed by RoomConfig::GetStageID*0x3c (BossPool_Pool[37]), PersistentGameData::Unlocked / Game::GetStateFlag filters, "Failed to pick a boss room variant, defaulting to Monstro"; callers Level::TryInitializeExtraBossRoom, 0074fbe0 prototype: REPENTOGON, confirmed by RET 12 */ int __thiscall BossPool::GetBossId(BossPool *this,int leveltype,int levelvariant,RNG *rng) { code *pcVar1; bool bVar2; char cVar3; byte bVar4; uint uVar5; uint uVar6; uint uVar7; uint conquestRoll; uint specialRoll; uint stateFlagBossRoll; int iVar8; int *bossEntry; uint *poolEntry; int iVar9; int extraout_EDX; int *extraout_EDX_00; int bossId; Manager *manager; RNG *poolRng; void *removedBits; int rngShift2; int rngShift3; undefined1 *stagePool; manager = g_manager; uVar5 = RoomConfig::GetStageID(leveltype,levelvariant,-1); stagePool = &this->field_0x0 + uVar5 * 0x3c; poolRng = (RNG *)(&this->field_0x28 + uVar5 * 0x3c); if (g_game->_challenge == 0x20) { return 0x1e; } if ((g_game->_dailyChallenge)._specialDailyId == 0xd) { switch(leveltype) { case 1: return 0x3c; case 2: return 0x2b; case 3: return 0x32; case 4: return 0x17; case 5: return 0x33; case 7: return 0xf; } } if ((extraout_EDX == 4) || (extraout_EDX == 5)) { switch(leveltype) { case 6: return 0x59; case 8: return 0x58; case 10: case 0xb: return 0x28; case 0xc: goto switchD_00422915_caseD_c; } } else { switch(leveltype) { case 6: return 6; case 8: if (((manager->_persistentGameData)._achievements[0x22] == 0) && ((manager->_state != 2 || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0))) ))) { return 8; } return 0x19; case 10: iVar8 = 0x18; if (extraout_EDX == 1) { iVar8 = 0x27; } return iVar8; case 0xb: iVar8 = 0x36; if (extraout_EDX == 1) { iVar8 = 0x28; } return iVar8; case 0xc: switchD_00422915_caseD_c: return 0x46; } } uVar6 = RNG::Next(poolRng); uVar7 = RNG::Next(poolRng); conquestRoll = RNG::Next(poolRng); specialRoll = RNG::Next(poolRng); stateFlagBossRoll = RNG::Next(poolRng); RNG::Next(poolRng); RNG::Next(poolRng); uVar5 = poolRng->_seed; iVar8 = poolRng->_shift1; rngShift2 = poolRng->_shift2; rngShift3 = poolRng->_shift3; if (((uVar6 & 1) == 0) && (((manager->_persistentGameData)._achievements[0x42] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { bVar2 = true; } else { bVar2 = false; } if ((uVar7 % 10 == 0) && ((((manager->_persistentGameData)._achievements[5] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) && (((((leveltype == 1 || (leveltype == 3)) || (leveltype == 5)) || (leveltype == 7)) && ((levelvariant != 4 && (levelvariant != 5)))))))) { if ((conquestRoll == (conquestRoll / 10) * 10) && (cVar3 = FUN_00421720(0x16), cVar3 == '\0')) { **(uint **)(this + 1) = **(uint **)(this + 1) | 0x400000; return 0x16; } switch(leveltype) { case 1: cVar3 = FUN_00421720(9); if (cVar3 == '\0') { **(uint **)(this + 1) = **(uint **)(this + 1) | 0x200; return 9; } break; case 3: cVar3 = FUN_00421720(10); if (cVar3 == '\0') { **(uint **)(this + 1) = **(uint **)(this + 1) | 0x400; return 10; } break; case 5: cVar3 = FUN_00421720(0xb); if (cVar3 == '\0') { **(uint **)(this + 1) = **(uint **)(this + 1) | 0x800; return 0xb; } break; case 7: cVar3 = FUN_00421720(0xc); if (cVar3 == '\0') { **(uint **)(this + 1) = **(uint **)(this + 1) | 0x1000; if (bVar2) { *(uint *)(*(int *)(this + 1) + 4) = *(uint *)(*(int *)(this + 1) + 4) | 0x40; } iVar8 = 0xc; if (bVar2) { iVar8 = 0x26; } return iVar8; } } } iVar9 = *(int *)(stagePool + 0x38); if (iVar9 != 0) { if (g_game->_challenge == 0x22) { uVar6 = 1; } else if ((leveltype == 3) || (leveltype == 4)) { uVar6 = 0x32; } else if (leveltype == 5) { uVar6 = 0x19; } else { if (leveltype != 7) goto LAB_00422c80; uVar6 = 0x28; } if (specialRoll % uVar6 == 0) { LAB_00422e07: return -iVar9; } } LAB_00422c80: if ((((stateFlagBossRoll == (stateFlagBossRoll / 10) * 10) && (levelvariant != 4)) && (levelvariant != 5)) && ((bVar4 = Game::GetStateFlag(g_game,6), bVar4 != 0 && (cVar3 = FUN_00421720(0x17), cVar3 == '\0')))) { **(uint **)(this + 1) = **(uint **)(this + 1) | 0x800000; return 0x17; } leveltype = 0; do { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar8 = (*pcVar1)(); return iVar8; } uVar5 = uVar5 >> ((byte)iVar8 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)rngShift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; bossEntry = (int *)FUN_00422620(stagePool); if (bossEntry == (int *)0x0) { poolEntry = *(uint **)(stagePool + 0x18); if (poolEntry != *(uint **)(stagePool + 0x1c)) { do { removedBits = (this->_removedBosses)._begin; uVar6 = *poolEntry >> 5; *(uint *)((int)removedBits + uVar6 * 4) = *(uint *)((int)removedBits + uVar6 * 4) & ~(1 << (*poolEntry & 0x1f)); uVar6 = *poolEntry; uVar7 = uVar6 >> 5; poolEntry = poolEntry + 5; *(uint *)(*(int *)(this + 1) + uVar7 * 4) = *(uint *)(*(int *)(this + 1) + uVar7 * 4) & ~(1 << (uVar6 & 0x1f)); } while (poolEntry != *(uint **)(stagePool + 0x1c)); } } else { bossId = *bossEntry; if (((bossId != 0x4a) || (g_game->_challenge != 0x24)) && ((bossEntry[3] < 0 || (bVar4 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,bossEntry[3]), bossEntry = extraout_EDX_00, bVar4 != 0)))) { iVar9 = bossEntry[4]; if (iVar9 == 0) { return bossId; } goto LAB_00422e07; } } leveltype = leveltype + 1; if (9 < leveltype) { KAGE_LogMessage(4,(byte *)"Failed to pick a boss room variant, defaulting to Monstro\n"); return 1; } } while( true ); } //@@ 00422ea0 FUN_00422ea0 void FUN_00422ea0(int param_1) { undefined4 uVar1; int iVar2; uint *puVar3; byte isFillValue; int in_ECX; undefined4 *puVar4; int iVar5; uint uVar6; uint uVar7; uint local_18; uVar6 = 0; puVar4 = (undefined4 *)(in_ECX + 0x28); do { uVar1 = *(undefined4 *)(param_1 + uVar6 * 4); *(undefined8 *)(puVar4 + 1) = 0x1500000002; uVar6 = uVar6 + 1; *puVar4 = uVar1; puVar4[3] = 9; puVar4 = puVar4 + 0xf; } while (uVar6 < 0x25); vector_bool_resize((int *)(in_ECX + 0x8ac),0x68,(byte)in_ECX); vector_bool_resize((int *)(in_ECX + 0x8bc),0x68,isFillValue); local_18 = 0; do { uVar7 = local_18 & 0x1f; iVar5 = (local_18 >> 5) * 4; puVar3 = (uint *)(*(int *)(in_ECX + 0x8ac) + iVar5); uVar6 = *puVar3; if ((*(uint *)(iVar5 + *(int *)(param_1 + 0x94)) & 1 << (sbyte)uVar7) == 0) { uVar6 = uVar6 & ~(1 << uVar7); } else { uVar6 = uVar6 | 1 << uVar7; } *puVar3 = uVar6; iVar2 = *(int *)(in_ECX + 0x8bc); *(uint *)(iVar2 + iVar5) = *(uint *)(iVar2 + iVar5) & ~(1 << uVar7); local_18 = local_18 + 1; } while (local_18 < 0x68); return; } //@@ 00422f80 FUN_00422f80 void FUN_00422f80(int param_1) { undefined4 uVar1; uint uVar2; int in_ECX; int iVar3; uint uVar4; uint uVar5; uint *puVar6; undefined4 *puVar7; uVar5 = 0; puVar7 = (undefined4 *)(in_ECX + 0x28); do { uVar1 = *puVar7; puVar7 = puVar7 + 0xf; *(undefined4 *)(param_1 + uVar5 * 4) = uVar1; uVar5 = uVar5 + 1; } while (uVar5 < 0x25); vector_bool_resize((int *)(param_1 + 0x94),*(uint *)(in_ECX + 0x8b8),(byte)in_ECX); uVar5 = 0; do { iVar3 = (uVar5 >> 5) * 4; puVar6 = (uint *)(*(int *)(param_1 + 0x94) + iVar3); uVar4 = uVar5 & 0x1f; uVar2 = *puVar6; if ((*(uint *)(*(int *)(in_ECX + 0x8ac) + iVar3) & 1 << (sbyte)uVar4) == 0) { uVar2 = uVar2 & ~(1 << uVar4); } else { uVar2 = uVar2 | 1 << uVar4; } uVar5 = uVar5 + 1; *puVar6 = uVar2; } while (uVar5 < 0x68); return; } //@@ 00423020 FID_conflict:_Tidy /* Library Function - Multiple Matches With Different Base Names public: __thiscall std::vector >::~vector >(void) private: void __thiscall std::vector >::_Tidy(void) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Tidy(void *this) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x14) * 0x14; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } return; } //@@ 00423090 vector_bool_resize /* DB: std::vector::resize(n): size in bits at this+0xc, grows via FUN_0041c910/FUN_0041c890 insert of (n-size) false bits or trims; ItemPool::Init/StoreGameState, Item::IsAvailable prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall vector_bool_resize(void *this,uint newSize,byte isFillValue) { int *piVar1; uint uVar2; uint *puVar3; uint uVar4; uint *puVar5; uint uVar6; uint *local_44; uint local_40; uint *local_3c; uint *local_38; int local_34; uint local_30; uint local_2c; int *local_28; undefined1 local_24 [4]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_24 + 0x20; local_14 = 0xffffffff; puStack_18 = &LAB_00af1840; local_1c = ExceptionList; ExceptionList = &local_1c; uVar6 = *(uint *)((int)this + 0xc); local_24[0] = 0; local_2c = uVar6; local_28 = this; if (uVar6 < newSize) { local_3c = *(uint **)this; local_38 = (uint *)0x0; puStack_20 = local_24 + 0x20; FUN_0041c910(uVar6); FUN_0041c890(&local_44,newSize - uVar6,local_24,local_3c,local_38); } else if (newSize < uVar6) { local_34 = *(int *)this; local_30 = 0; FUN_0041c910(uVar6); piVar1 = local_28; local_38 = (uint *)0x0; local_3c = (uint *)*local_28; FUN_0041c910(newSize); local_14 = 0; puVar3 = (uint *)*piVar1; uVar6 = 0; local_40 = 0; if (local_2c == 0) { local_38 = (uint *)0x0; puVar5 = puVar3; } else { local_44 = puVar3; FUN_0041c910(((int)local_3c - (int)puVar3 >> 2) * 0x20 + (int)local_38); local_38 = (uint *)0x0; local_3c = (uint *)*local_28; FUN_0041c910((local_34 - (int)local_3c >> 2) * 0x20 + local_30); puVar3 = local_3c; puVar5 = local_44; uVar6 = local_40; } if ((puVar5 != puVar3) || ((uint *)uVar6 != local_38)) { local_40 = 0; local_44 = (uint *)*local_28; local_30 = (uint)local_38; local_38 = puVar3; FUN_0041c910(local_2c); uVar4 = local_30; puVar3 = local_38; while ((puVar3 != local_44 || (uVar4 != local_40))) { if ((*puVar3 & 1 << ((byte)uVar4 & 0x1f)) == 0) { uVar2 = *puVar5 & ~(1 << (uVar6 & 0x1f)); } else { uVar2 = *puVar5 | 1 << (uVar6 & 0x1f); } *puVar5 = uVar2; if (uVar6 < 0x1f) { uVar6 = uVar6 + 1; } else { uVar6 = 0; puVar5 = puVar5 + 1; } if (uVar4 < 0x1f) { uVar4 = uVar4 + 1; } else { uVar4 = 0; puVar3 = puVar3 + 1; } } std::vector::_Trim(((int)puVar5 - *local_28 >> 2) * 0x20 + uVar6); } } ExceptionList = local_1c; return; } //@@ 00423250 Game::GetGameStateFlag /* ZHL [exact] __thiscall bool Game::GetGameStateFlag(uint32_t GameStateFlag); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Game::GetGameStateFlag(Game *this,uint GameStateFlag) { uint uVar1; uint uVar2; uVar2 = 1 << (GameStateFlag & 0x1f); uVar1 = 0; if (0x1f < (GameStateFlag & 0x3f)) { uVar1 = uVar2; } uVar2 = uVar2 ^ uVar1; if (0x3f < (GameStateFlag & 0x3f)) { uVar1 = uVar2; } if ((uVar2 & this->_roomList[0]._doors[(GameStateFlag >> 6) * 2 + -0xc]) == 0 && (uVar1 & this->_roomList[0]._doors[(GameStateFlag >> 6) * 2 + -0xb]) == 0) { return 0; } return 1; } //@@ 00423290 std::vector::_Trim /* DB: (size): shrinks the word vector to (n+31)/32, sets size +0xc, masks the last word's unused bits; vector_bool_resize, ItemPool::on_pill_used */ void std::vector::_Trim(uint param_1) { uint *puVar1; void *_Dst; void *_Src; code *pcVar2; int *in_ECX; uint uVar3; if (0x7fffffff < param_1) { FUN_0041cb50(); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } _Src = (void *)in_ECX[1]; uVar3 = param_1 + 0x1f >> 5; if (uVar3 < (uint)((int)_Src - *in_ECX >> 2)) { _Dst = (void *)(*in_ECX + uVar3 * 4); if (_Dst != _Src) { memmove(_Dst,_Src,0); in_ECX[1] = (int)_Dst; } } in_ECX[3] = param_1; if ((param_1 & 0x1f) != 0) { puVar1 = (uint *)(*in_ECX + uVar3 * 4 + -4); *puVar1 = *puVar1 & (1 << (sbyte)(param_1 & 0x1f)) - 1U; } return; } //@@ 00423310 std::vector<20byte>::_Emplace_reallocate /* DB: MSVC vector grow+insert, 0x14-byte elements, max 0xccccccc, 1.5x growth, copies 5 dwords then memmoves halves; caller BossPool::load_xml */ undefined4 * std::vector<20byte>::_Emplace_reallocate(void *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; void *pvVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; void *_Dst; int *in_ECX; uint uVar8; uint uVar9; void *ptr; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x14; if (iVar4 == 0xccccccc) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar9 = (in_ECX[2] - *in_ECX) / 0x14; if (0xccccccc - (uVar9 >> 1) < uVar9) { uVar8 = 0xccccccc; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar8 = iVar4 + 1U; if (iVar4 + 1U <= uVar9) { uVar8 = uVar9; } if (0xccccccc < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar8 * 0x14); puVar1 = (undefined4 *)((int)_Dst + (((int)param_1 - iVar2) / 0x14) * 0x14); uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; puVar1[4] = param_2[4]; pvVar3 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar3,in_ECX[1] - (int)pvVar3); } else { memmove(_Dst,pvVar3,(int)param_1 - (int)pvVar3); memmove(puVar1 + 5,param_1,in_ECX[1] - (int)param_1); } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar9 = ((in_ECX[2] - (int)pvVar3) / 0x14) * 0x14; ptr = pvVar3; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar3 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + (iVar4 + 1) * 0x14); in_ECX[2] = (int)(uVar8 * 0x14 + (int)_Dst); return puVar1; } //@@ 00423480 string_compare /* DB: ECX=ptr1, EDX=len1, (ptr2,len2): memcmp dword-wise then length tiebreak, returns -1/0/1 (std::char_traits compare inlined helper); used by BossPool::load_xml, Menu_Mods prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl string_compare(byte *a,uint lengthA,byte *b,uint lengthB) { uint uVar1; uint uVar2; bool bVar3; uVar2 = lengthA; if (lengthB < lengthA) { uVar2 = lengthB; } while (uVar1 = uVar2 - 4, 3 < uVar2) { if (*(int *)a != *(int *)b) goto LAB_004234ae; a = a + 4; b = b + 4; uVar2 = uVar1; } if (uVar1 != 0xfffffffc) { LAB_004234ae: bVar3 = *a < *b; if ((*a != *b) || ((uVar1 != 0xfffffffd && ((bVar3 = a[1] < b[1], a[1] != b[1] || ((uVar1 != 0xfffffffe && ((bVar3 = a[2] < b[2], a[2] != b[2] || ((uVar1 != 0xffffffff && (bVar3 = a[3] < b[3], a[3] != b[3])))))))))))) { uVar2 = -(uint)bVar3 | 1; goto LAB_004234e4; } } uVar2 = 0; LAB_004234e4: if (uVar2 == 0) { if (lengthA < lengthB) { return -1; } uVar2 = (uint)(lengthB < lengthA); } return uVar2; } //@@ 00423500 FUN_00423500 void FUN_00423500(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::map::_Emplace(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00423530 FUN_00423530 int * FUN_00423530(int *param_1,byte *param_2) { char cVar1; uint uVar2; uint lengthB; byte *b; int iVar3; byte *a; undefined4 *puVar4; iVar3 = DAT_00c7f6f4; puVar4 = *(undefined4 **)(DAT_00c7f6f4 + 4); *param_1 = (int)puVar4; cVar1 = *(char *)((int)puVar4 + 0xd); param_1[1] = 0; param_1[2] = iVar3; if (cVar1 == '\0') { uVar2 = *(uint *)(param_2 + 0x14); lengthB = *(uint *)(param_2 + 0x10); do { *param_1 = (int)puVar4; a = (byte *)(puVar4 + 4); b = param_2; if (0xf < uVar2) { b = *(byte **)param_2; } if (0xf < (uint)puVar4[9]) { a = *(byte **)a; } iVar3 = string_compare(a,puVar4[8],b,lengthB); if (-1 < iVar3) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(-1 < iVar3); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 004235c0 FUN_004235c0 void FUN_004235c0(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_004235c0(param_1,param_2[2]); piVar2 = (int *)*param_2; std::string::_Tidy_deallocate((char *)(param_2 + 4)); operator_delete(param_2,0x2c); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00423610 std::map::_Emplace /* DB: (pair): operator_new(0x2c) node, string key assign, int value at +0x28, max_size 0x5d1745d; via FUN_00423500 from BossPool::load_xml ("basement"=1, "cellar"=2, "caves"=4 ...) */ int * std::map::_Emplace(int *param_1,undefined4 *param_2) { byte *this; byte bVar1; char cVar2; int iVar3; void *pvVar4; int *piVar5; int *piVar6; uint uVar7; int *ptr; undefined8 *puVar8; byte *pbVar9; int iVar10; void *ptr_00; byte *pbVar11; uint size; int *piVar12; int *piVar13; undefined1 local_34 [12]; undefined8 local_28; int **local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af187d; local_10 = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_14 = DAT_00c7f6f4; local_1c = &DAT_00c7f6f4; local_8 = 0; local_18 = (int *)0x0; ptr = operator_new(0x2c); local_8 = 1; this = (byte *)(ptr + 4); pbVar9 = (byte *)*param_2; this[0] = 0; this[1] = 0; this[2] = 0; this[3] = 0; ptr[8] = 0; ptr[9] = 0xf; pbVar11 = pbVar9; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); local_18 = ptr; string::assign((char *)this,pbVar9,(int)pbVar11 - (int)(pbVar9 + 1)); ptr[10] = param_2[1]; *ptr = (int)local_14; ptr[1] = (int)local_14; ptr[2] = (int)local_14; *(undefined2 *)(ptr + 3) = 0; local_8 = 2; puVar8 = (undefined8 *)FUN_00423530(local_34,this); local_28 = *puVar8; iVar3 = *(int *)(puVar8 + 1); if (*(char *)(iVar3 + 0xd) == '\0') { pbVar9 = (byte *)(iVar3 + 0x10); if (0xf < *(uint *)(iVar3 + 0x24)) { pbVar9 = *(byte **)pbVar9; } pbVar11 = this; if (0xf < (uint)ptr[9]) { pbVar11 = *(byte **)this; } iVar10 = string_compare(pbVar11,ptr[8],pbVar9,*(uint *)(iVar3 + 0x20)); if (-1 < iVar10) { uVar7 = ptr[9]; *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; if (0xf < uVar7) { pvVar4 = *(void **)this; size = uVar7 + 1; ptr_00 = pvVar4; if (0xfff < size) { ptr_00 = *(void **)((int)pvVar4 + -4); size = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); } ptr[8] = 0; ptr[9] = 0xf; *this = 0; operator_delete(ptr,0x2c); ExceptionList = local_10; return param_1; } } piVar6 = DAT_00c7f6f4; if (DAT_00c7f6f8 == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar7); } DAT_00c7f6f8 = DAT_00c7f6f8 + 1; ptr[1] = (int)(int *)local_28; if ((int *)local_28 == piVar6) { *piVar6 = (int)ptr; piVar6[1] = (int)ptr; piVar6[2] = (int)ptr; *(undefined1 *)(ptr + 3) = 1; } else { if (local_28._4_4_ == 0) { ((int *)local_28)[2] = (int)ptr; if ((int *)local_28 == (int *)piVar6[2]) { piVar6[2] = (int)ptr; } } else { *(int *)local_28 = (int)ptr; if ((int *)local_28 == (int *)*piVar6) { *piVar6 = (int)ptr; } } cVar2 = *(char *)(ptr[1] + 0xc); piVar13 = ptr; while (cVar2 == '\0') { piVar5 = (int *)piVar13[1]; piVar12 = *(int **)piVar5[1]; if (piVar5 == piVar12) { piVar12 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar12[3] == '\0') goto LAB_00423833; if (piVar13 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar13 = piVar5; } *(undefined1 *)(piVar13[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar13[1] + 4)); } else if ((char)piVar12[3] == '\0') { LAB_00423833: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar12 + 3) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; piVar13 = *(int **)(piVar13[1] + 4); } else { if (piVar13 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar13 = piVar5; } *(undefined1 *)(piVar13[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar13[1] + 4)); } cVar2 = *(char *)(piVar13[1] + 0xc); } *(undefined1 *)(piVar6[1] + 0xc) = 1; } *param_1 = (int)ptr; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return param_1; } //@@ 004238c0 FUN_004238c0 void FUN_004238c0(void) { void *ptr; int in_ECX; ptr = (void *)0x0; if (*(int *)(in_ECX + 4) != 0) { std::string::_Tidy_deallocate((char *)(*(int *)(in_ECX + 4) + 0x10)); ptr = *(void **)(in_ECX + 4); } if (ptr != (void *)0x0) { operator_delete(ptr,0x2c); } return; } //@@ 004238f0 Color::Color /* DB: sets 4 tint floats, zeroes colorize+offset (0x2c struct) */ void Color::Color(undefined4 param_1) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; *in_ECX = in_XMM1_Da; in_ECX[1] = in_XMM2_Da; in_ECX[2] = in_XMM3_Da; in_ECX[3] = param_1; return; } //@@ 00423950 Entity_Player::ControllerIndex /* ZHL [lua] Lua binding EntityPlayer:ControllerIndex */ int __thiscall Entity_Player::ControllerIndex(Entity_Player *this) { return this->_controllerIndex; } //@@ 00423960 FUN_00423960 undefined4 FUN_00423960(void) { int in_ECX; return CONCAT31((int3)((uint)*(int *)(in_ECX + 0x4b3d8) >> 8), *(int *)(in_ECX + 0x4b3d8) != *(int *)(in_ECX + 0x4b3dc)); } //@@ 00423970 FUN_00423970 undefined4 FUN_00423970(void) { int in_ECX; if (*(int *)(in_ECX + 0x378) == 0) { return 0xdeadbeef; } return *(undefined4 *)(*(int *)(in_ECX + 0x378) + 0xc); } //@@ 00423990 PopupButtons::Init /* DB: ? round 7 agent */ void PopupButtons::Init(void) { load_graphics(); reset(0); return; } //@@ 004239b0 PopupButtons::reset /* DB: ? ECX dialog: resets two button sub-records (+0x114.. and +0x244.., 0x130 apart: size 96x96, pos zero, visible, actions 0xf / 0xe), arg1 true zeroes their heights, then scale 1.0 and clears the callback/context at +0x264/+0x268; DeathScreen::Show and online_stats_finalize call it and then install a callback (FUN_008cb190) */ void PopupButtons::reset(char param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x11c) = 1; *(undefined4 *)(in_ECX + 0x24c) = 0; *(undefined4 *)(in_ECX + 0x124) = 0xf; *(undefined4 *)(in_ECX + 0x254) = 0xe; *(undefined1 *)(in_ECX + 0x120) = 1; *(float *)(in_ECX + 0x128) = g_vectorZero.x; *(float *)(in_ECX + 300) = g_vectorZero.y; *(undefined4 *)(in_ECX + 0x118) = 0x42c00000; *(undefined4 *)(in_ECX + 0x114) = 0x42c00000; if (param_1 != '\0') { *(undefined4 *)(in_ECX + 0x118) = 0; } *(undefined1 *)(in_ECX + 0x250) = 1; *(float *)(in_ECX + 600) = g_vectorZero.x; *(float *)(in_ECX + 0x25c) = g_vectorZero.y; *(undefined4 *)(in_ECX + 0x248) = 0x42c00000; *(undefined4 *)(in_ECX + 0x244) = 0x42c00000; if (param_1 != '\0') { *(undefined4 *)(in_ECX + 0x248) = 0; } *(undefined4 *)(in_ECX + 0x260) = 0x3f800000; *(undefined4 *)(in_ECX + 0x264) = 0; *(undefined4 *)(in_ECX + 0x268) = 0; return; } //@@ 00423aa0 PopupButtons::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? callers FUN_00423990 (load + PopupButtons::reset, from Manager::Init) and FUN_00954710; ANM2::Load gfx/ui/ButtonPromptWidget.anm2 into both button sprites and plays 'LeftPrompt' / 'RightPrompt' */ void PopupButtons::load_graphics(void) { byte *pbVar1; byte bVar2; byte *pbVar3; ANM2 *in_ECX; char *pcVar4; uint size; uint uVar5; ANM2 *this; bool bVar6; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af18ad; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; uVar5 = 0; this = in_ECX; do { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x1e; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/ButtonPromptWidget.anm2",0x1f); local_14 = 0; ANM2::Load(this,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { size = local_3c._capacity + 1; pcVar4 = (char *)local_3c._buf._0_4_; if (0xfff < size) { pcVar4 = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,size); } uVar5 = uVar5 + 1; this = (ANM2 *)(this[1]._animDefaultName._buf + 4); } while (uVar5 < 2); pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar4 = "LeftPrompt"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar4; if (bVar2 != *pcVar4) { LAB_00423bee: uVar5 = -(uint)bVar6 | 1; goto LAB_00423bf3; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar4[1]; if (bVar2 != pcVar4[1]) goto LAB_00423bee; pbVar3 = pbVar3 + 2; pcVar4 = pcVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00423bf3: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((in_ECX->_animState)._isPlaying != 0)))) goto LAB_00423c1f; } bVar2 = ANM2::SetAnimation(in_ECX,(byte *)"LeftPrompt",1); if (bVar2 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_00423c1f: pbVar1 = in_ECX[1]._overlayAnimState._animation; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar4 = "RightPrompt"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar4; if (bVar2 != *pcVar4) { LAB_00423c58: uVar5 = -(uint)bVar6 | 1; goto LAB_00423c5d; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar4[1]; if (bVar2 != pcVar4[1]) goto LAB_00423c58; pbVar3 = pbVar3 + 2; pcVar4 = pcVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00423c5d: if (uVar5 == 0) { if (pbVar1[0x34] == 0) { ExceptionList = local_1c; return; } if (*(char *)&in_ECX[1]._overlayAnimState._animFrame != '\0') { ExceptionList = local_1c; return; } } } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX[1]._animDefaultName._buf + 4),(byte *)"RightPrompt",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)&in_ECX[1]._animState._previouslyTriggeredEvents); *(undefined1 *)&in_ECX[1]._overlayAnimState._animFrame = 1; } ExceptionList = local_1c; return; } //@@ 00423cc0 PopupButtons::Render /* DB: ? ECX=button dialog (same layout as PopupButtons::reset 004239b0: button records at +0x114/+0x244 with ANM2 and frame at +0x11c): sets layer "Text" frame, AnimationState::Render, gamepad-specific glyph via Font::DrawString; called from Manager::Render after the popups */ void PopupButtons::Render(void) { Vector scale; int *piVar1; uint uVar2; char cVar3; int iVar4; LayerState *pLVar5; Vector *pVVar6; byte *str; int in_ECX; AnimationState *this; int *piVar7; float fVar8; float fVar9; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; KColor local_84; undefined1 local_70 [8]; undefined1 local_68 [8]; undefined1 local_60 [8]; Vector local_58; int *local_50; int *local_4c; float local_48; float local_44; int local_40; int *local_3c; Font *local_38; Vector *local_34; uint local_30; float local_2c; int local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_60 + 0x5c; local_14 = 0xffffffff; puStack_18 = &LAB_00af1900; local_1c = ExceptionList; ExceptionList = &local_1c; local_28 = in_ECX; iVar4 = FUN_00424220(__security_cookie ^ (uint)(local_60 + 0x50)); InputManager::get_device(&PTR_vftable_00c57b18,&local_40,iVar4); local_14 = 0; local_58.x = *(float *)(in_ECX + 0x260); local_58.y = local_58.x; local_2c = local_58.x; if (local_40 != 0) { g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; piVar7 = (int *)(in_ECX + 0x11c); g_graphicsManager_blendMode[4] = 7; local_24 = 0; do { uVar2 = local_24; pLVar5 = ANM2::GetLayer((ANM2 *)(piVar7 + -0x47),&DAT_00b1c208); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(piVar7 + -0x47),*(int *)pLVar5->_layerData,*piVar7); } piVar7[-0x20] = (int)local_2c; piVar7[-0x1f] = (int)local_2c; pVVar6 = (Vector *)FUN_00424130(local_60,uVar2); if (*(char *)((int)piVar7 + -0x13) != '\0') { if ((char)piVar7[-0x2b] == '\0') { AnimationState::Render ((AnimationState *)(piVar7 + -0x3b),pVVar6,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(piVar7 + -0x33); } else { AnimationState::Render ((AnimationState *)(piVar7 + -0x33),pVVar6,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(piVar7 + -0x3b); } AnimationState::Render(this,pVVar6,&g_vectorZero,&g_vectorZero); } if ((piVar7[2] != 0x20) && ((char)piVar7[1] != '\0')) { (**(code **)(PTR_vftable_00c57b18 + 0x28))(&local_50,0); local_14._0_1_ = 1; iVar4 = __RTDynamicCast(local_40,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0); local_30 = *(uint *)(local_40 + 0xc); if ((local_30 == 0) || ((iVar4 != 0 && (((*(byte *)(iVar4 + 8) & 0x20) != 0 || (*(int *)(iVar4 + 900) == 3)))))) { local_38 = &g_manager->_font1_TeamMeatEx10; local_a0 = 4; local_9c = 0xffff; local_98 = 0; local_94 = 0x3f800000; local_90 = 0xffffffff; local_8c = 0; local_88 = 0; local_14._0_1_ = 2; KColor::SetFromARGB(&local_84,0xff362f2d); local_34 = (Vector *)FUN_004240b0(local_70,local_24); piVar1 = local_50; local_30 = piVar7[2]; iVar4 = local_50[4]; if ((uint)(local_50[5] - iVar4 >> 4) <= local_30) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar4 = piVar1[4]; } iVar4 = *(int *)(iVar4 + local_30 * 0x10); if (iVar4 == -1) { str = &DAT_00b6d124; } else { str = (byte *)(**(code **)(*piVar1 + 0x10))(iVar4); } Font::DrawString(local_38,str,local_34,&local_58,&local_84,&local_a0); } else { fVar8 = local_2c * 1.5; iVar4 = piVar7[2]; fVar9 = fVar8; local_48 = fVar8; local_44 = fVar8; pVVar6 = (Vector *)FUN_004240b0(local_68,local_24); scale.y = fVar9; scale.x = fVar8; Manager::render_controller_action_glyph (g_manager,local_30,iVar4,0,1, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),*pVVar6 ,scale); } local_14._0_1_ = 3; if (local_4c != (int *)0x0) { cVar3 = (**(code **)(*local_4c + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_50); } } local_14 = (uint)local_14._1_3_ << 8; } piVar7 = piVar7 + 0x4c; local_24 = local_24 + 1; } while (local_24 < 2); if (*(code **)(local_28 + 0x264) != (code *)0x0) { (**(code **)(local_28 + 0x264))(local_28,*(undefined4 *)(local_28 + 0x268)); } } local_14 = 4; if (local_3c != (int *)0x0) { cVar3 = (**(code **)(*local_3c + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_40); } } ExceptionList = local_1c; return; } //@@ 004240b0 FUN_004240b0 void FUN_004240b0(float *param_1,int param_2) { float fVar1; float fVar2; float fVar3; float *pfVar4; int in_ECX; float *pfVar5; undefined1 local_10 [12]; pfVar4 = (float *)FUN_00424130(local_10,param_2); if (*(int *)(param_2 * 0x130 + 0x34 + in_ECX) == 0) { pfVar5 = (float *)0x0; } else { pfVar5 = AnimationState::GetNullFrame ((AnimationState *)(param_2 * 0x130 + 0x30 + in_ECX),(byte *)"IconPos"); } fVar1 = *(float *)(in_ECX + 0x260); fVar2 = pfVar5[1]; fVar3 = pfVar4[1]; *param_1 = fVar1 * *pfVar5 + *pfVar4; param_1[1] = fVar1 * fVar2 + fVar3; return; } //@@ 00424130 FUN_00424130 void FUN_00424130(float *param_1,int param_2) { float fVar1; float fVar2; int in_ECX; fVar1 = g_vectorZero.y; if (param_2 == 0) { fVar1 = *(float *)(in_ECX + 0x260); fVar2 = *(float *)(in_ECX + 0x114); *param_1 = *(float *)(in_ECX + 0x128) - fVar1 * 8.0; param_1[1] = (g_screenHeight - fVar1 * 64.0) + fVar1 * fVar2 + *(float *)(in_ECX + 300); return; } if (param_2 == 1) { fVar1 = *(float *)(in_ECX + 0x260); fVar2 = *(float *)(in_ECX + 0x244); *param_1 = (g_screenWidth - fVar1 * 88.0) + *(float *)(in_ECX + 600); param_1[1] = (g_screenHeight - fVar1 * 76.0) + fVar1 * fVar2 + *(float *)(in_ECX + 0x25c); return; } *param_1 = g_vectorZero.x; param_1[1] = fVar1; return; } //@@ 00424220 FUN_00424220 int FUN_00424220(void) { int iVar1; Entity_Player *pEVar2; switch(g_manager->_state) { case 1: return g_menuControllerIndex; case 2: case 3: case 5: if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar1 = FUN_0090b070(); if (*(int *)(iVar1 + 0x378) == 0) { return -0x21524111; } return *(int *)(*(int *)(iVar1 + 0x378) + 0xc); } if ((g_game != (Game *)0x0) && (((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin & 0xfffffffcU) != 0)) { pEVar2 = Game::GetPlayer(g_game,0); return pEVar2->_controllerIndex; } } return -1; } //@@ 004242b0 FUN_004242b0 void FUN_004242b0(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } } ExceptionList = local_10; return; } //@@ 00424310 ChallengeParams::ChallengeParams /* DB: ? ctor: empty std::string at +0, std::set/map head node (0x14, isnil 0x101) at +0x18, many zeroed vectors after; Game::constructor, Manager::constructor and challenges_xml_load (Manager+0x2a664 holds the 0xa4-byte challenge params read by Game::GetChallengeParams) prototype: db/protos.zhl */ void __thiscall ChallengeParams::ChallengeParams(void *this) { void *pvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af192d; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0xf; *(undefined1 *)this = 0; local_8 = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x1c) = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *(undefined4 *)((int)this + 0x18) = pvVar1; *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 0; *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 0; *(undefined4 *)((int)this + 0x48) = 0; *(undefined4 *)((int)this + 0x4c) = 0; *(undefined4 *)((int)this + 0x50) = 0; *(undefined4 *)((int)this + 0x8c) = 0; *(undefined4 *)((int)this + 0x90) = 0; *(undefined4 *)((int)this + 0x94) = 0; *(undefined4 *)((int)this + 0x98) = 0; *(undefined4 *)((int)this + 0x9c) = 0; *(undefined4 *)((int)this + 0xa0) = 0; ChallengeParam::Reset(this); ExceptionList = local_10; return; } //@@ 00424420 FUN_00424420 void FUN_00424420(void) { int *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x14); return; } //@@ 00424440 ChallengeParam::Reset /* DB: ? ECX = DailyChallenge+0x10 (LEA ECX,[EDI+0x10] in DailyChallenge::Init; Game+0x26640 in Game::reset_run_state): clears set at +0x18 and vectors, sets +0x38=-1, +0x6c=1 (ChallengeParam at DailyChallenge+0x10 per db/fields.tsv) prototype: db/protos.zhl */ void __thiscall ChallengeParam::Reset(ChallengeParam *this) { void *pvVar1; pvVar1 = (this->_roomset)._head; FID_conflict__Erase_tree_>_> (&this->_roomset, (fuzzer_allocator_> *)&this->_roomset, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; (this->_roomset)._size = 0; (this->_collectibleList)._end = (this->_collectibleList)._begin; (this->_trinketList)._end = (this->_trinketList)._begin; pvVar1 = (this->_seedEffects)._begin; this->_endStage = 0; this->_getCurse = 0; this->_curseFilter = 0; this->_playerType = 0; this->_startingPill = -1; this->_startingCard = 0; this->_blackHearts = 0; this->_soulHearts = 0; this->_coins = 0; this->_canShoot = 1; this->_maxDamage = 0; this->_minShotSpeed = 0; this->_bigRange = 0; this->_isPathTypeSet = 0; this->_minFireRate = 0.0; this->_maxHearts = 0; this->_hearts = 0; this->_difficulty = 0; this->_isMegaSatan = 0; this->_addDamage = 0.0; this->_pathType = 0; (this->_seedEffects)._end = pvVar1; return; } //@@ 00424510 FUN_00424510 void FUN_00424510(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; return; } //@@ 00424530 Config::GetCollectibles /* ZHL [lua] Lua binding Config:GetCollectibles */ void Config::GetCollectibles(void) { return; } //@@ 00424540 FID_conflict:_Erase_tree_>_> /* Library Function - Multiple Matches With Different Base Names public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree_and_orphan > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Erase_tree_>_> (void *this,fuzzer_allocator_> *param_1, _Tree_node *param_2) { _Tree_node _Var1; _Tree_node *p_Var2; _Var1 = param_2[0xd]; while (_Var1 == (_Tree_node)0x0) { FID_conflict__Erase_tree_>_> (this,param_1,*(_Tree_node **)(param_2 + 8)); p_Var2 = *(_Tree_node **)param_2; operator_delete(param_2,0x14); param_2 = p_Var2; _Var1 = p_Var2[0xd]; } return; } //@@ 00424580 ellipse_image_plot_points /* DB: ? ECX = image {pixels, size, w}: plots the 4 symmetric ellipse points with atan2f angle (deg) inside [param_2, param_3] in white (KColor::SetFromARGB(0xffffffff)); only caller ellipse_image_create 004248a0 ellipse_image_create void ellipse_image_plot_points(float param_1,float param_2,float param_3,float param_4) { ushort uVar1; int iVar2; int extraout_EAX; int extraout_EAX_00; int extraout_EAX_01; int extraout_EAX_02; int *in_ECX; int iVar3; uint uVar4; uint uVar5; float in_XMM1_Da; float in_XMM2_Da; float in_XMM3_Da; float x; float fVar6; KColor local_48; float local_34; int local_30; float local_2c; float local_28; float local_24; float local_20; float local_1c; uint local_18; int local_14; float local_10; float local_c; int *local_8; local_30 = (int)in_XMM2_Da; local_14 = 0; if (-1 < local_30) { local_18 = (int)(in_XMM1_Da + in_XMM3_Da) & 0xffff; x = (float)local_18 - in_XMM3_Da; local_34 = in_XMM2_Da + param_1; fVar6 = x * x; local_28 = in_XMM2_Da; local_20 = in_XMM1_Da; local_1c = in_XMM3_Da; local_10 = fVar6; local_c = x; local_8 = in_ECX; do { uVar5 = (int)(local_34 - (float)local_14) & 0xffff; local_24 = (float)uVar5 - param_1; if (param_4 * param_4 <= local_24 * local_24 + fVar6) { fVar6 = atan2f(local_24,x); fVar6 = fVar6 * 57.295776; if (fVar6 < 0.0) { fVar6 = fVar6 + 360.0; } if ((param_2 <= fVar6) && (fVar6 <= param_3)) { KColor::SetFromARGB(&local_48,0xffffffff); uVar1 = *(ushort *)(in_ECX + 2); iVar2 = *in_ECX; iVar3 = 0; do { *(char *)(iVar3 + 4 + iVar2 + (uVar1 * uVar5 + local_18) * 4) = (char)(int)(*(float *)(extraout_EAX + iVar3 * 4) * 255.0); iVar3 = iVar3 + 1; } while (iVar3 < 4); } uVar4 = (int)(local_1c - local_20) & 0xffff; local_2c = (float)uVar4 - local_1c; fVar6 = atan2f(local_24,local_2c); fVar6 = fVar6 * 57.295776; if (fVar6 < 0.0) { fVar6 = fVar6 + 360.0; } if ((param_2 <= fVar6) && (fVar6 <= param_3)) { KColor::SetFromARGB(&local_48,0xffffffff); uVar1 = *(ushort *)(local_8 + 2); iVar2 = *local_8; iVar3 = 0; do { *(char *)(iVar3 + 4 + iVar2 + (uVar1 * uVar5 + uVar4) * 4) = (char)(int)(*(float *)(extraout_EAX_00 + iVar3 * 4) * 255.0); iVar3 = iVar3 + 1; } while (iVar3 < 4); } uVar5 = (int)((param_1 - local_28) + (float)local_14) & 0xffff; local_24 = (float)uVar5 - param_1; fVar6 = atan2f(local_24,local_c); fVar6 = fVar6 * 57.295776; if (fVar6 < 0.0) { fVar6 = fVar6 + 360.0; } if ((param_2 <= fVar6) && (fVar6 <= param_3)) { KColor::SetFromARGB(&local_48,0xffffffff); uVar1 = *(ushort *)(local_8 + 2); iVar2 = *local_8; iVar3 = 0; do { *(char *)(iVar3 + 4 + iVar2 + (uVar1 * uVar5 + local_18) * 4) = (char)(int)(*(float *)(extraout_EAX_01 + iVar3 * 4) * 255.0); iVar3 = iVar3 + 1; } while (iVar3 < 4); } fVar6 = atan2f(local_24,local_2c); fVar6 = fVar6 * 57.295776; if (fVar6 < 0.0) { fVar6 = fVar6 + 360.0; } if ((param_2 <= fVar6) && (fVar6 <= param_3)) { KColor::SetFromARGB(&local_48,0xffffffff); uVar1 = *(ushort *)(local_8 + 2); iVar2 = *local_8; iVar3 = 0; do { *(char *)(iVar3 + 4 + iVar2 + (uVar1 * uVar5 + uVar4) * 4) = (char)(int)(*(float *)(extraout_EAX_02 + iVar3 * 4) * 255.0); iVar3 = iVar3 + 1; } while (iVar3 < 4); } in_ECX = local_8; fVar6 = local_10; x = local_c; } local_14 = local_14 + 1; } while (local_14 <= local_30); } return; } //@@ 004248a0 ellipse_image_create /* DB: ? (w, h, ...): heap_alloc'd w+1 x h+1 RGBA image named "Ellipse", midpoint ellipse rasterisation (rx^2, ry^2, 2rx^2 terms) plotting via FUN_00424580, then KAGE_Graphics::create_image; from FUN_00424d70 <- EmoteWheel::Render */ void ellipse_image_create (float param_1,float param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5 ) { char cVar1; uint uVar2; undefined2 *_Dst; int *ptr; uint uVar3; void *other; undefined2 uVar4; float fVar5; size_t local_40; undefined4 local_3c; void *local_38; float local_34; undefined1 local_30 [4]; int *local_2c; float local_28; float local_24; float local_20; float local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af195d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; local_3c = 0; local_34 = (float)((int)param_1 + 1U & 0xffff); local_40 = (int)local_34 * ((int)param_2 + 1U & 0xffff) * 4 + 4; local_24 = (float)local_40; _Dst = KAGE_Memory::heap_alloc(2,(ulonglong *)&local_40); memset(_Dst,0,(size_t)local_24); *_Dst = (short)((int)param_1 + 1U); uVar4 = (undefined2)((int)param_2 + 1U); _Dst[1] = uVar4; ptr = operator_new(0xc); if (ptr == (int *)0x0) { ptr = (int *)0x0; } else { ptr[1] = (int)local_24; *ptr = (int)_Dst; *(short *)(ptr + 2) = SUB42(local_34,0); *(undefined2 *)((int)ptr + 10) = uVar4; } uVar3 = (uint)param_2 >> 1 & 0x7fff; local_20 = (float)((uint)param_1 >> 1 & 0x7fff); param_2 = (float)uVar3; param_1 = 0.0; local_20 = local_20 * local_20; local_28 = param_2 * param_2; local_2c = (int *)(local_20 + local_20); local_34 = local_28 + local_28; local_18 = param_2 * (float)local_2c; local_1c = local_34 * 0.0; local_24 = (local_28 - (float)uVar3 * local_20) + local_20 * 0.25; if (local_1c < local_18) { do { ellipse_image_plot_points((float)uVar3,param_3,param_4,param_5,uVar2); local_1c = local_1c + local_34; param_1 = param_1 + 1.0; fVar5 = local_1c + local_24; if (0.0 <= local_24) { local_18 = local_18 - (float)local_2c; param_2 = param_2 - 1.0; fVar5 = fVar5 - local_18; } local_24 = fVar5 + local_28; } while (local_1c < local_18); } local_24 = ((param_1 + 0.5) * (param_1 + 0.5) * local_28 + (param_2 - 1.0) * (param_2 - 1.0) * local_20) - local_28 * local_20; while (0.0 <= param_2) { ellipse_image_plot_points((float)uVar3,param_3,param_4,param_5); local_18 = local_18 - (float)local_2c; param_2 = param_2 - 1.0; if (local_24 <= 0.0) { local_1c = local_1c + local_34; local_24 = ((local_24 + local_1c) - local_18) + local_20; } else { local_24 = (local_24 + local_20) - local_18; } } KAGE::SmartPointer::reset(local_38,(void *)0x0); other = KAGE_Graphics::create_image(local_30,*ptr,ptr[1],4,(byte *)"Ellipse"); local_8 = 0; KAGE::SmartPointer::operator_assign(local_38,other); local_8 = 1; if (((local_2c != (int *)0x0) && (cVar1 = (**(code **)(*local_2c + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_30); } operator_delete(ptr,0xc); ExceptionList = local_10; return; } //@@ 00424c40 SharedPtrPair::constructor /* DB: ? constructs two smart-pointer members (FUN_0040c4a0(0) x2) and zeroes +0x10..+0x28; only callers Game::constructor and HUD::constructor */ void SharedPtrPair::constructor(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af198d; local_10 = ExceptionList; ExceptionList = &local_10; KAGE::SmartPointer::SmartPointer(in_ECX,(void *)0x0); local_8 = 0; KAGE::SmartPointer::SmartPointer((void *)((int)in_ECX + 8),(void *)0x0); *(undefined4 *)((int)in_ECX + 0x10) = 0; *(undefined4 *)((int)in_ECX + 0x14) = 0; *(undefined4 *)((int)in_ECX + 0x18) = 0; *(undefined4 *)((int)in_ECX + 0x1c) = 0; *(undefined4 *)((int)in_ECX + 0x24) = 0; *(undefined4 *)((int)in_ECX + 0x20) = 0; *(undefined4 *)((int)in_ECX + 0x28) = 0; ExceptionList = local_10; return; } //@@ 00424cd0 SharedPtrPair::~SharedPtrPair /* DB: ? inverse of SharedPtrPair::constructor (00424c40, two KAGE::SmartPointer members): two KAGE::SmartPointer::reset(0) then releases two image refs (+4/+0xc) via g_imageReleaseFn; Game::~Game calls it twice exactly where Game::constructor built the two SharedPtrPairs (after FUN_0042fa30, reverse order), also 008d1d20 and 0083c4c0 prototype: db/protos.zhl */ void __thiscall SharedPtrPair::~SharedPtrPair(void *this) { char cVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE::SmartPointer::reset(this,(void *)0x0); KAGE::SmartPointer::reset((void *)((int)this + 8),(void *)0x0); local_8 = 0; if (*(int **)((int)this + 0xc) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 0xc) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((void *)((int)this + 8)); } } local_8 = 1; if (*(int **)((int)this + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 4) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(this); } } ExceptionList = local_10; return; } //@@ 00424d70 FUN_00424d70 void FUN_00424d70(float *param_1,undefined4 param_2,float param_3,float param_4) { undefined4 uVar1; int in_ECX; float fVar2; float in_XMM3_Da; float local_c; float local_8; fVar2 = *(float *)(in_ECX + 0x28); if ((((*(float *)(in_ECX + 0x10) != fVar2) || (*(float *)(in_ECX + 0x14) != in_XMM3_Da)) || (*(float *)(in_ECX + 0x18) != param_3)) || (*(float *)(in_ECX + 0x1c) != param_4)) { uVar1 = CONCAT22((short)((uint)(int)fVar2 >> 0x10),(short)(int)fVar2 * 2); local_8 = in_XMM3_Da; ellipse_image_create(uVar1,uVar1); fVar2 = *(float *)(in_ECX + 0x28); *(float *)(in_ECX + 0x14) = local_8; *(float *)(in_ECX + 0x18) = param_3; *(float *)(in_ECX + 0x10) = fVar2; *(float *)(in_ECX + 0x1c) = param_4; } local_c = (*(float *)(in_ECX + 0x20) - fVar2) + *param_1; local_8 = (*(float *)(in_ECX + 0x24) - fVar2) + param_1[1]; (**(code **)(**(int **)(in_ECX + 8) + 0x20))(&local_c,param_2); return; } //@@ 00424e60 FUN_00424e60 undefined4 FUN_00424e60(int param_1) { int in_ECX; return *(undefined4 *)(in_ECX + 700 + param_1 * 4); } //@@ 00424e80 sprite_member_at_0x4_destroy /* DB: ? dtor of a struct whose only non-trivial member is an ANM2/Sprite at +4 (ANM2::Reset, AnimationState dtors at +0x34/+0x54, 2 strings); unwind-only callers (Room / PauseScreen constructors' EH states) */ void sprite_member_at_0x4_destroy(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x54)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); ExceptionList = local_10; return; } //@@ 00424ef0 CompletionMarks::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX: player type +0, ANM2 +4 (layout of CompletionMarks::update_layers): ANM2::Load gfx/ui/completion_widget.anm2, with param true also replaces the spritesheet with gfx/ui/completion_widget_pause.png; PauseScreen::Init calls it with 1 */ void CompletionMarks::Load(char param_1) { ANM2 *this; byte *pbVar1; byte bVar2; byte *pbVar3; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; int in_ECX; char *pcVar4; byte *pbVar5; uint uVar6; int layerId; bool bVar7; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af19c5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; this = (ANM2 *)(in_ECX + 4); local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x1d; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/completion_widget.anm2",0x1e); local_14 = 0; ANM2::Load(this,&local_3c,0); local_14 = 0xffffffff; bVar2 = extraout_CL; if (0xf < local_3c._capacity) { uVar6 = local_3c._capacity + 1; pcVar4 = (char *)local_3c._buf._0_4_; if (0xfff < uVar6) { pcVar4 = *(char **)(local_3c._buf._0_4_ + -4); uVar6 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar4))) { LAB_00424fd9: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,uVar6); bVar2 = extraout_CL_00; } if (param_1 != '\0') { layerId = 0; do { local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x22; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/completion_widget_pause.png",0x23); local_14 = 1; Sprite::ReplaceSpritesheet((Sprite *)this,layerId,&local_3c); local_14 = 0xffffffff; bVar2 = extraout_CL_01; if (0xf < local_3c._capacity) { uVar6 = local_3c._capacity + 1; pcVar4 = (char *)local_3c._buf._0_4_; if (0xfff < uVar6) { pcVar4 = *(char **)(local_3c._buf._0_4_ + -4); uVar6 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar4))) goto LAB_00424fd9; } operator_delete(pcVar4,uVar6); bVar2 = extraout_CL_02; } layerId = layerId + 1; } while (layerId < 0xc); } ANM2::LoadGraphics(this,bVar2); pbVar1 = *(byte **)(in_ECX + 0x38); if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = s_Idle; do { bVar2 = *pbVar3; bVar7 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_004250d0: uVar6 = -(uint)bVar7 | 1; goto LAB_004250d5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_004250d0; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar6 = 0; LAB_004250d5: if ((uVar6 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x48) != '\0')))) goto LAB_00425101; } bVar2 = ANM2::SetAnimation(this,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x34)); *(undefined1 *)(in_ECX + 0x48) = 1; } LAB_00425101: *(undefined4 *)(in_ECX + 0x118) = 0; ExceptionList = local_1c; return; } //@@ 00425130 CompletionMarks::update_layers /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX: +0 player type, ANM2 at +4: per completion-mark layer (12 layers, layer->mark index table) reads the mark difficulty for that character from the 0x90-stride table DAT_00c35ed0 and the save/net-lobby data (g_manager+0x14 or +0x4b434, +700) and SetLayerFrame 0..2 (+5 for tainted, type > 20); clears all when type > 40; Menu_Character::UpdateRotations and netplay_lobby_menu_update */ void CompletionMarks::update_layers(void) { NetplayManager NVar1; NetplayManager NVar2; uint uVar3; uint uVar4; Manager *pMVar5; int iVar6; uint frame; uint *in_ECX; uint uVar7; PersistentGameData *local_70; int aiStack_68 [25]; aiStack_68[0x18] = __security_cookie ^ (uint)(aiStack_68 + 0x19); iVar6 = 0; do { aiStack_68[iVar6] = iVar6; aiStack_68[iVar6 + 1] = iVar6 + 1; aiStack_68[iVar6 + 2] = iVar6 + 2; aiStack_68[iVar6 + 3] = iVar6 + 3; iVar6 = iVar6 + 4; } while (iVar6 < 8); aiStack_68[8] = 9; aiStack_68[9] = 0xc; aiStack_68[10] = 0xd; aiStack_68[0xb] = 0xe; aiStack_68[0xc] = 1; aiStack_68[0xd] = 2; aiStack_68[0xe] = 3; aiStack_68[0xf] = 4; aiStack_68[0x10] = 5; aiStack_68[0x11] = 6; aiStack_68[0x12] = 7; aiStack_68[0x13] = 8; aiStack_68[0x14] = 9; aiStack_68[0x15] = 0; aiStack_68[0x16] = 10; aiStack_68[0x17] = 0xb; if (((g_manager->_framecount & 1) == 0) && (*(char *)((int)in_ECX + 0x10d) != '\0')) { AnimationState::Update((AnimationState *)(in_ECX + 0xd)); AnimationState::Update((AnimationState *)(in_ECX + 0x15)); } pMVar5 = g_manager; NVar1 = g_manager->_netplayManager; NVar2 = *(NetplayManager *)(g_manager + 1); in_ECX[0x46] = 0; if (0x28 < *in_ECX) { uVar7 = 0; do { ANM2::SetLayerFrame((ANM2 *)(in_ECX + 1),aiStack_68[uVar7 + 0xc],0); uVar7 = uVar7 + 1; } while (uVar7 < 0xc); return; } if (pMVar5->_netplayManager == *(NetplayManager *)(pMVar5 + 1)) { local_70 = &pMVar5->_persistentGameData; } else { local_70 = (PersistentGameData *)(pMVar5[1]._persistentGameData._achievements + 0xc); } uVar7 = 0; do { uVar3 = *in_ECX; if (((int)uVar3 < 0x29) && (&DAT_00c35ed0 + uVar3 * 0x90 != (undefined *)0x0)) { iVar6 = *(int *)(&DAT_00c35ed0 + uVar3 * 0x90 + *(int *)((int)aiStack_68 + uVar7) * 8); } else { iVar6 = 0; } uVar4 = local_70->_eventCounters[iVar6]; frame = uVar4 & 1; if ((uVar4 & 2) != 0) { frame = 2; } if ((NVar1 != NVar2) || (frame == 0)) { if ((uVar4 & 4) != 0) { frame = (uint)(NVar1 != NVar2) * 2 + 1; } if ((uVar4 & 8) != 0) { frame = (uint)(NVar1 != NVar2) * 2 + 2; } } iVar6 = *(int *)((int)aiStack_68 + uVar7 + 0x30); if ((iVar6 == 0) && (0x14 < (int)uVar3)) { frame = frame + 5; } ANM2::SetLayerFrame((ANM2 *)(in_ECX + 1),iVar6,frame); if (uVar4 != 0) { in_ECX[0x46] = in_ECX[0x46] + 1; } uVar7 = uVar7 + 4; } while (uVar7 < 0x30); return; } //@@ 004252f0 CompletionWidget::Render /* ZHL [exact] __thiscall void CompletionWidget::Render(Vector* pos,Vector* scale); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall CompletionWidget::Render(CompletionWidget *this,Vector *pos,Vector *scale) { AnimationState *this_00; this[0x28] = (CompletionWidget)scale->x; this[0x29] = (CompletionWidget)scale->y; if (this[0x43].field_0x1 != '\0') { this_00 = (AnimationState *)(this + 0x15); if (*(char *)(this + 0x1d) == '\0') { AnimationState::Render((AnimationState *)(this + 0xd),pos,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render(this_00,pos,&g_vectorZero,&g_vectorZero); this_00 = (AnimationState *)(this + 0xd); } AnimationState::Render(this_00,pos,&g_vectorZero,&g_vectorZero); } return; } //@@ 004253b0 Entity_Player::GetPlayerType /* ZHL [lua] Lua binding EntityPlayer:GetPlayerType */ int __thiscall Entity_Player::GetPlayerType(Entity_Player *this) { return this->_playerType; } //@@ 004253c0 FUN_004253c0 StringTable * FUN_004253c0(void) { return &g_manager->_stringTable; } //@@ 004253d0 FUN_004253d0 int FUN_004253d0(void) { int *piVar1; int in_ECX; uint uVar2; uint uVar3; uVar2 = 0; piVar1 = (g_game->_playerManager)._playerList._begin; uVar3 = (int)(g_game->_playerManager)._playerList._end - (int)piVar1 >> 2; if (uVar3 != 0) { do { if (*(int *)(*piVar1 + 0x1618) == *(int *)(in_ECX + 0xc)) { return *piVar1; } uVar2 = uVar2 + 1; piVar1 = piVar1 + 1; } while (uVar2 < uVar3); } return 0; } //@@ 00425410 FUN_00425410 void FUN_00425410(void) { char *in_ECX; std::vector::_Tidy(); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 00425430 online_stats_destroy /* DB: Game::~Game does LEA ECX,[EDI+0x1bbe0]; CALL 0x00425430 (006f3657) on the online stats block also read by online_stats_finalize: clears the user vector and 21 per-stat 0x34-byte arrays, flag +0x450, eh_vector destructor, frees storage */ void online_stats_destroy(void) { undefined4 *puVar1; uint uVar2; undefined4 *in_ECX; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar3 = 0x15; in_ECX[1] = *in_ECX; puVar1 = in_ECX; do { puVar1[0xe] = puVar1[0xd]; iVar3 = iVar3 + -1; puVar1 = puVar1 + 0xd; } while (iVar3 != 0); *(undefined1 *)(in_ECX + 0x114) = 0; _eh_vector_destructor_iterator_(in_ECX + 3,0x34,0x15,FUN_00425410); std::vector<104byte>::_Tidy(uVar2); ExceptionList = local_10; return; } //@@ 004254b0 OnlineStats::compute_awards /* WARNING: Removing unreachable block (ram,0x00425768) */ /* WARNING: Removing unreachable block (ram,0x0042577a) */ /* WARNING: Removing unreachable block (ram,0x0042578a) */ /* WARNING: Removing unreachable block (ram,0x00425790) */ /* DB: ? ECX=vector of 0x68-byte per-player stat records: in netplay drops records whose user is gone (PlayerManager::get_player_by_user_id) while >4, then per stat category (+0x28 table, id 0x16 skipped) finds the best/worst player by threshold; only caller online_stats_finalize */ void OnlineStats::compute_awards(void) { ulonglong *userId; undefined4 *puVar1; float fVar2; undefined4 uVar3; uint uVar4; Entity_Player *pEVar5; int *in_ECX; NetplayManager *this; undefined4 *puVar6; uint uVar7; int iVar8; int iVar9; int *piVar10; float fVar11; undefined4 *local_34; int local_2c; uint local_24; int local_20; undefined4 *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af19fd; local_10 = ExceptionList; ExceptionList = &local_10; this = &g_manager->_netplayManager; if (*(int *)&this->field_0x0 != *(int *)(g_manager + 1)) { iVar8 = in_ECX[1]; iVar9 = *in_ECX; uVar4 = (iVar8 - iVar9) / 0x68; if ((4 < uVar4) && (uVar7 = uVar4 - 1, uVar7 < uVar4)) { local_24 = uVar7 * 0x68; do { userId = (ulonglong *)(iVar9 + local_24); pEVar5 = PlayerManager::get_player_by_user_id((PlayerManager *)this,userId); if (pEVar5 == (Entity_Player *)0x0) { memmove(userId,userId + 0xd,iVar8 - (int)(userId + 0xd)); in_ECX[1] = in_ECX[1] + -0x68; iVar8 = in_ECX[1]; iVar9 = *in_ECX; } uVar4 = (iVar8 - iVar9) / 0x68; if (uVar4 < 5) break; uVar7 = uVar7 - 1; local_24 = local_24 + -0x68; } while (uVar7 < uVar4); } } local_8 = 0; piVar10 = in_ECX + 10; local_2c = 0x15; do { puVar6 = (undefined4 *)0x0; if (*(char *)((int)piVar10 + 1) == '\0') { fVar11 = 2.1474836e+09; } else { fVar11 = 0.0; } if (piVar10[-1] != 0x16) { iVar8 = *in_ECX; local_24 = 0; iVar9 = in_ECX[1] - iVar8 >> 0x1f; if ((in_ECX[1] - iVar8) / 0x68 + iVar9 != iVar9) { local_20 = 0; local_34 = puVar6; do { local_18 = (undefined4 *)0x0; puVar1 = (undefined4 *)(local_20 + iVar8); fVar2 = (float)puVar1[piVar10[-1] + 3]; if (*(char *)((int)piVar10 + 1) == '\0') { if ((((float)piVar10[1] < fVar2) || (fVar11 < fVar2)) || ((int)(float)puVar1[3] < piVar10[2])) goto LAB_004256df; if (fVar2 < fVar11) { LAB_00425690: local_34 = (undefined4 *)0x0; puVar6 = local_18; LAB_00425696: if ((fVar2 != fVar11) || ((char)*piVar10 != '\0')) goto LAB_004256a4; } else { if (fVar2 == fVar11) { if ((char)*piVar10 == '\0') goto LAB_00425690; goto LAB_00425696; } LAB_004256a4: if (puVar6 == (undefined4 *)0x0) goto LAB_004256bb; uVar3 = puVar1[1]; *puVar6 = *puVar1; puVar6[1] = uVar3; puVar6 = puVar6 + 2; local_34 = puVar6; } LAB_004256dc: fVar11 = fVar2; } else if ((((float)piVar10[1] <= fVar2) && (fVar11 <= fVar2)) && (piVar10[2] <= (int)(float)puVar1[3])) { if (fVar11 < fVar2) { LAB_0042563f: local_34 = (undefined4 *)0x0; puVar6 = local_18; LAB_00425645: if (fVar2 == fVar11) { if ((char)*piVar10 == '\0') goto LAB_004256dc; } } else if (fVar2 == fVar11) { if ((char)*piVar10 == '\0') goto LAB_0042563f; goto LAB_00425645; } if (puVar6 == (undefined4 *)0x0) { LAB_004256bb: std::vector<8byte>::_Emplace_reallocate(0,puVar1); puVar6 = local_34; } else { uVar3 = puVar1[1]; *puVar6 = *puVar1; puVar6[1] = uVar3; puVar6 = puVar6 + 2; local_34 = puVar6; } goto LAB_004256dc; } LAB_004256df: local_20 = local_20 + 0x68; local_24 = local_24 + 1; iVar8 = *in_ECX; } while (local_24 < (uint)((in_ECX[1] - iVar8) / 0x68)); } local_18 = (undefined4 *)0x0; iVar8 = (int)puVar6 >> 3; if (iVar8 != 0) { do { puVar6 = (undefined4 *)piVar10[4]; if (puVar6 == (undefined4 *)piVar10[5]) { std::vector<8byte>::_Emplace_reallocate(puVar6,local_18); } else { uVar3 = local_18[1]; *puVar6 = *local_18; puVar6[1] = uVar3; piVar10[4] = piVar10[4] + 8; } local_18 = local_18 + 2; iVar8 = iVar8 + -1; } while (iVar8 != 0); } } piVar10 = piVar10 + 0xd; local_2c = local_2c + -1; if (local_2c == 0) { *(undefined1 *)(in_ECX + 0x114) = 1; ExceptionList = local_10; return; } } while( true ); } //@@ 004257b0 online_stats_register_players /* DB: ? ECX=online stats vector (0x68-byte entries keyed by 64-bit net user id): for each main player with a net user id not yet listed calls online_stats_add_user; from Game::Update after PlayerManager::Update */ void online_stats_register_players(void) { Entity_Player *pEVar1; int *piVar2; int *in_ECX; int iVar3; Game *pGVar4; int iVar5; uint uVar6; uint uVar7; longlong lVar8; char local_1d; int local_1c; int *local_18; uint local_14; uint local_10; PlayerManager *local_c; pGVar4 = g_game; if (*(int *)&g_game->_deathmatchManager < 2) { local_18 = in_ECX; local_10 = PlayerManager::count_main_players(&g_game->_playerManager); local_14 = 0; if (local_10 != 0) { do { pEVar1 = PlayerManager::get_main_player(&pGVar4->_playerManager,local_14); lVar8 = player_get_net_user_id(pEVar1); local_1c = (int)((ulonglong)lVar8 >> 0x20); if (lVar8 != -1) { piVar2 = (int *)*in_ECX; uVar7 = 0; iVar5 = in_ECX[1] - (int)piVar2 >> 0x1f; iVar3 = (in_ECX[1] - (int)piVar2) / 0x68 + iVar5; in_ECX = local_18; if (iVar3 != iVar5) { do { if ((*piVar2 == (int)lVar8) && (piVar2[1] == local_1c)) goto LAB_0042585b; uVar7 = uVar7 + 1; piVar2 = piVar2 + 0x1a; } while (uVar7 < (uint)(iVar3 - iVar5)); } online_stats_add_user(lVar8); } LAB_0042585b: local_14 = local_14 + 1; pGVar4 = g_game; } while (local_14 < local_10); } iVar5 = *in_ECX; local_14 = 0; iVar3 = local_18[1] - iVar5 >> 0x1f; if ((local_18[1] - iVar5) / 0x68 + iVar3 != iVar3) { local_c = (PlayerManager *)&g_manager->_netplayManager; local_1c = 0; do { if ((local_c->_playerList)._begin == (local_c->_playerList)._end) { uVar7 = 0; piVar2 = (pGVar4->_playerManager)._playerList._begin; uVar6 = (int)(pGVar4->_playerManager)._playerList._end - (int)piVar2 >> 2; if (uVar6 != 0) { do { iVar3 = *piVar2; if (*(int *)(iVar3 + 0x1618) == (int)*(ulonglong *)(local_1c + iVar5)) goto LAB_004258f6; uVar7 = uVar7 + 1; piVar2 = piVar2 + 1; } while (uVar7 < uVar6); } } else { pEVar1 = PlayerManager::get_player_by_user_id(local_c,(ulonglong *)(local_1c + iVar5)); if (pEVar1 != (Entity_Player *)0x0) { uVar7 = 0; piVar2 = (pGVar4->_playerManager)._playerList._begin; uVar6 = (int)(pGVar4->_playerManager)._playerList._end - (int)piVar2 >> 2; if (uVar6 != 0) { do { iVar3 = *piVar2; if (*(void **)(iVar3 + 0x1618) == (pEVar1->_damageEvents)._end) goto LAB_004258f6; uVar7 = uVar7 + 1; piVar2 = piVar2 + 1; } while (uVar7 < uVar6); } iVar3 = 0; LAB_004258f6: if (iVar3 != 0) { FUN_00949bc0(&local_1d); *(uint *)(local_1c + 8 + *local_18) = local_10; if (local_1d != '\0') { piVar2 = (int *)(local_1c + 8 + *local_18); *piVar2 = *piVar2 + 0x11; } } } } local_1c = local_1c + 0x68; local_14 = local_14 + 1; iVar5 = *local_18; } while (local_14 < (uint)((local_18[1] - iVar5) / 0x68)); } } return; } //@@ 004259b0 online_stats_add_user /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX = the online stats block (Game+0x1bbe0: vector of 0x68-byte per-user records): if no record has the 64-bit user id (arg1:arg2) and the id is not -1, appends one {id, 1, zeroed 0x58 stat floats}; Player_stats_add calls it before adding to a stat, Entity_Player::TriggerCollectibleRemoved and FUN_004257b0 too */ void online_stats_add_user(uint param_1,uint param_2) { int *in_ECX; uint *puVar1; int iVar2; int iVar3; uint uVar4; uint *puVar5; uint local_74 [27]; uint local_8; local_8 = __security_cookie ^ (uint)(local_74 + 0x1c); uVar4 = 0; puVar1 = (uint *)*in_ECX; iVar2 = in_ECX[1] - (int)puVar1 >> 0x1f; iVar3 = (in_ECX[1] - (int)puVar1) / 0x68 + iVar2; if (iVar3 != iVar2) { do { if ((*puVar1 == param_1) && (puVar1[1] == param_2)) { return; } uVar4 = uVar4 + 1; puVar1 = puVar1 + 0x1a; } while (uVar4 < (uint)(iVar3 - iVar2)); } if ((param_1 & param_2) != 0xffffffff) { puVar1 = (uint *)in_ECX[1]; local_74[0] = param_1; local_74[1] = param_2; local_74[2] = 1; if (puVar1 == (uint *)in_ECX[2]) { std::vector<104byte>::_Emplace_reallocate(puVar1,local_74); } else { puVar5 = local_74; for (iVar2 = 0x1a; iVar2 != 0; iVar2 = iVar2 + -1) { *puVar1 = *puVar5; puVar5 = puVar5 + 1; puVar1 = puVar1 + 1; } in_ECX[1] = in_ECX[1] + 0x68; } iVar2 = in_ECX[1]; memset((void *)(iVar2 + -0x5c),0,0x58); *(undefined4 *)(iVar2 + -0x60) = 1; } return; } //@@ 00425a70 FUN_00425a70 int FUN_00425a70(int param_1,int param_2) { uint uVar1; uint3 uVar2; int *in_ECX; int *piVar3; uint uVar4; piVar3 = (int *)*in_ECX; uVar1 = (in_ECX[1] - (int)piVar3) / 0x68; uVar4 = 0; uVar2 = (uint3)(uVar1 >> 8); if (uVar1 != 0) { do { if ((*piVar3 == param_1) && (piVar3[1] == param_2)) { return CONCAT31(uVar2,1); } uVar4 = uVar4 + 1; piVar3 = piVar3 + 0x1a; } while (uVar4 < uVar1); } return (uint)uVar2 << 8; } //@@ 00425ac0 Player_stats_add /* DB: ? adds float to per-player stat slot <0x16; Entity::Kill uses ids 0x11/0x14/0x15 prototype: db/protos.zhl, confirmed by RET 8 */ void Player_stats_add(void *onlineStats,uint statId,Entity_Player *player,float amount) { char cVar1; int iVar2; longlong lVar3; if ((*(int *)&g_game->_deathmatchManager < 2) && (player != (Entity_Player *)0x0)) { lVar3 = player_get_net_user_id(player); if ((lVar3 != -1) && (((*(int *)&g_game->_deathmatchManager < 2 && (*(char *)((int)onlineStats + 0x450) == '\0')) && (statId < 0x16)))) { cVar1 = FUN_00425a70(lVar3); if (cVar1 == '\0') { online_stats_add_user(lVar3); } iVar2 = FUN_00426560(lVar3); if (iVar2 != 0) { *(float *)(iVar2 + 0xc + statId * 4) = amount + *(float *)(iVar2 + 0xc + statId * 4); } } } return; } //@@ 00425b70 init_coop_awards /* DB: called from Game::constructor right after constructing the 21x0x34 award array at Game+0x1bbec (ECX = that array); fills each entry with "#Online/COOP_AWARD_*" name, id, flags, 1.0f */ void init_coop_awards(void) { byte bVar1; Manager *pMVar2; byte *pbVar3; int in_ECX; byte *pbVar4; std::string::assign((char *)&DAT_00c78f08,(byte *)"#Online/COOP_AWARD_ETERNAL",0x1a); std::string::assign((char *)&DAT_00c78f20,(byte *)"#Online/COOP_AWARD_HEARTLESS",0x1c); std::string::assign((char *)&DAT_00c78f38,(byte *)"#Online/COOP_AWARD_ENVIOUS",0x1a); std::string::assign((char *)&DAT_00c78f50,(byte *)"#Online/COOP_AWARD_DRESSED_UP",0x1d); std::string::assign((char *)&DAT_00c78f68,(byte *)"#Online/COOP_AWARD_PRIDEFUL",0x1b); std::string::assign((char *)&DAT_00c78f80,(byte *)"#Online/COOP_AWARD_SAVIOR",0x19); std::string::assign((char *)&DAT_00c78f98,(byte *)"#Online/COOP_AWARD_WRATHFUL",0x1b); std::string::assign((char *)&DAT_00c78fb0,(byte *)"#Online/COOP_AWARD_BIG_BOSS",0x1b); std::string::assign((char *)&DAT_00c78fc8,(byte *)"#Online/COOP_AWARD_EXPLORER",0x1b); std::string::assign((char *)&DAT_00c78fe0,(byte *)"#Online/COOP_AWARD_EXPRESSIVE",0x1d); std::string::assign((char *)&DAT_00c78ff8,(byte *)"#Online/COOP_AWARD_GLUTTONOUS",0x1d); std::string::assign((char *)&DAT_00c79010,(byte *)"#Online/COOP_AWARD_RECKLESS",0x1b); std::string::assign((char *)&DAT_00c79028,(byte *)"#Online/COOP_AWARD_ESCAPE_ARTIST",0x20); std::string::assign((char *)&DAT_00c79040,(byte *)"#Online/COOP_AWARD_GAMBLER",0x1a); std::string::assign((char *)&DAT_00c79058,(byte *)"#Online/COOP_AWARD_GREEDY",0x19); std::string::assign((char *)&DAT_00c79070,(byte *)"#Online/COOP_AWARD_MYSTIC",0x19); std::string::assign((char *)&DAT_00c79088,(byte *)"#Online/COOP_AWARD_PILL_POPPER",0x1e); std::string::assign((char *)&DAT_00c790a0,(byte *)"#Online/COOP_AWARD_BIG_SPENDER",0x1e); std::string::assign((char *)&DAT_00c790b8,(byte *)"#Online/COOP_AWARD_JANITOR",0x1a); std::string::assign((char *)&DAT_00c790d0,(byte *)"#Online/COOP_AWARD_LUSTFUL",0x1a); std::string::assign((char *)&DAT_00c790e8,(byte *)"#Online/COOP_AWARD_SLOTHFUL",0x1b); pbVar4 = (byte *)&DAT_00c78f08; if (0xf < DAT_00c78f1c) { pbVar4 = DAT_00c78f08; } pbVar3 = string_table_translate(&g_manager->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0xc),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x24) = 0x15; *(undefined2 *)(in_ECX + 0x28) = 0x101; *(undefined4 *)(in_ECX + 0x2c) = 0x3f800000; *(undefined4 *)(in_ECX + 0x30) = 0; pbVar4 = (byte *)&DAT_00c78f20; if (0xf < DAT_00c78f34) { pbVar4 = DAT_00c78f20; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x40),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x58) = 7; *(undefined2 *)(in_ECX + 0x5c) = 1; *(undefined4 *)(in_ECX + 0x60) = 0x3f800000; *(undefined4 *)(in_ECX + 100) = 2; pbVar4 = (byte *)&DAT_00c78f38; if (0xf < DAT_00c78f4c) { pbVar4 = DAT_00c78f38; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x74),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x8c) = 4; *(undefined2 *)(in_ECX + 0x90) = 0x101; *(undefined4 *)(in_ECX + 0x94) = 0x3f800000; *(undefined4 *)(in_ECX + 0x98) = 0; pbVar4 = (byte *)&DAT_00c78f50; if (0xf < DAT_00c78f64) { pbVar4 = DAT_00c78f50; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0xa8),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0xc0) = 10; *(undefined2 *)(in_ECX + 0xc4) = 0x101; *(undefined4 *)(in_ECX + 200) = 0x40000000; *(undefined4 *)(in_ECX + 0xcc) = 0; pbVar4 = (byte *)&DAT_00c78f68; if (0xf < DAT_00c78f7c) { pbVar4 = DAT_00c78f68; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0xdc),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0xf4) = 2; *(undefined2 *)(in_ECX + 0xf8) = 0; *(undefined4 *)(in_ECX + 0xfc) = 0x41400000; *(undefined4 *)(in_ECX + 0x100) = 2; pbVar4 = (byte *)&DAT_00c78f80; if (0xf < DAT_00c78f94) { pbVar4 = DAT_00c78f80; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x110),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x128) = 0xc; *(undefined2 *)(in_ECX + 300) = 0x101; *(undefined4 *)(in_ECX + 0x130) = 0x40400000; *(undefined4 *)(in_ECX + 0x134) = 0; pbVar4 = (byte *)&DAT_00c78f98; if (0xf < DAT_00c78fac) { pbVar4 = DAT_00c78f98; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x144),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x15c) = 0xf; *(undefined2 *)(in_ECX + 0x160) = 0x101; *(undefined4 *)(in_ECX + 0x164) = 0x41a00000; *(undefined4 *)(in_ECX + 0x168) = 0; pbVar4 = (byte *)&DAT_00c78fb0; if (0xf < DAT_00c78fc4) { pbVar4 = DAT_00c78fb0; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x178),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 400) = 0x14; *(undefined2 *)(in_ECX + 0x194) = 0x101; *(undefined4 *)(in_ECX + 0x198) = 0x40a00000; *(undefined4 *)(in_ECX + 0x19c) = 0; pbVar4 = (byte *)&DAT_00c78fc8; if (0xf < DAT_00c78fdc) { pbVar4 = DAT_00c78fc8; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x1ac),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x1c4) = 0x13; *(undefined2 *)(in_ECX + 0x1c8) = 0x101; *(undefined4 *)(in_ECX + 0x1cc) = 0x40a00000; *(undefined4 *)(in_ECX + 0x1d0) = 0; pbVar4 = (byte *)&DAT_00c78fe0; if (0xf < DAT_00c78ff4) { pbVar4 = DAT_00c78fe0; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x1e0),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x1f8) = 8; *(undefined2 *)(in_ECX + 0x1fc) = 0x101; *(undefined4 *)(in_ECX + 0x200) = 0x41200000; *(undefined4 *)(in_ECX + 0x204) = 0; pbVar4 = (byte *)&DAT_00c78ff8; if (0xf < DAT_00c7900c) { pbVar4 = DAT_00c78ff8; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x214),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x22c) = 0x12; *(undefined2 *)(in_ECX + 0x230) = 0x101; *(undefined4 *)(in_ECX + 0x234) = 0x40400000; *(undefined4 *)(in_ECX + 0x238) = 0; pbVar4 = (byte *)&DAT_00c79010; if (0xf < DAT_00c79024) { pbVar4 = DAT_00c79010; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x248),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x260) = 0x10; *(undefined2 *)(in_ECX + 0x264) = 0x101; *(undefined4 *)(in_ECX + 0x268) = 0x40400000; *(undefined4 *)(in_ECX + 0x26c) = 0; pbVar4 = (byte *)&DAT_00c79028; if (0xf < DAT_00c7903c) { pbVar4 = DAT_00c79028; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x27c),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x294) = 9; *(undefined2 *)(in_ECX + 0x298) = 0x101; *(undefined4 *)(in_ECX + 0x29c) = 0x40000000; *(undefined4 *)(in_ECX + 0x2a0) = 0; pbVar4 = (byte *)&DAT_00c79040; if (0xf < DAT_00c79054) { pbVar4 = DAT_00c79040; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x2b0),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x2c8) = 0xb; *(undefined2 *)(in_ECX + 0x2cc) = 0x101; *(undefined4 *)(in_ECX + 0x2d0) = 0x41a00000; *(undefined4 *)(in_ECX + 0x2d4) = 0; pbVar4 = (byte *)&DAT_00c79058; if (0xf < DAT_00c7906c) { pbVar4 = DAT_00c79058; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x2e4),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x2fc) = 1; *(undefined2 *)(in_ECX + 0x300) = 0x101; *(undefined4 *)(in_ECX + 0x304) = 0x40400000; *(undefined4 *)(in_ECX + 0x308) = 0; pbVar4 = (byte *)&DAT_00c79070; if (0xf < DAT_00c79084) { pbVar4 = DAT_00c79070; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x318),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x330) = 5; *(undefined2 *)(in_ECX + 0x334) = 0x101; *(undefined4 *)(in_ECX + 0x338) = 0x40a00000; *(undefined4 *)(in_ECX + 0x33c) = 0; pbVar4 = (byte *)&DAT_00c79088; if (0xf < DAT_00c7909c) { pbVar4 = DAT_00c79088; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x34c),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x364) = 6; *(undefined2 *)(in_ECX + 0x368) = 0x101; *(undefined4 *)(in_ECX + 0x36c) = 0x40a00000; *(undefined4 *)(in_ECX + 0x370) = 0; pbVar4 = (byte *)&DAT_00c790a0; if (0xf < DAT_00c790b4) { pbVar4 = DAT_00c790a0; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x380),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x398) = 0xd; *(undefined2 *)(in_ECX + 0x39c) = 0x101; *(undefined4 *)(in_ECX + 0x3a0) = 0x41f80000; *(undefined4 *)(in_ECX + 0x3a4) = 0; pbVar4 = (byte *)&DAT_00c790b8; if (0xf < DAT_00c790cc) { pbVar4 = DAT_00c790b8; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x3b4),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x3cc) = 0xe; *(undefined2 *)(in_ECX + 0x3d0) = 0x101; *(undefined4 *)(in_ECX + 0x3d4) = 0x41200000; *(undefined4 *)(in_ECX + 0x3d8) = 0; pbVar4 = (byte *)&DAT_00c790d0; if (0xf < DAT_00c790e4) { pbVar4 = DAT_00c790d0; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 1000),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); pMVar2 = g_manager; *(undefined4 *)(in_ECX + 0x400) = 3; *(undefined2 *)(in_ECX + 0x404) = 0x101; *(undefined4 *)(in_ECX + 0x408) = 0x3f800000; *(undefined4 *)(in_ECX + 0x40c) = 1; pbVar4 = (byte *)&DAT_00c790e8; if (0xf < DAT_00c790fc) { pbVar4 = DAT_00c790e8; } pbVar3 = string_table_translate(&pMVar2->_stringTable,pbVar4); pbVar4 = pbVar3; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x41c),pbVar3,(int)pbVar4 - (int)(pbVar3 + 1)); *(undefined4 *)(in_ECX + 0x434) = 0x11; *(undefined2 *)(in_ECX + 0x438) = 1; *(undefined4 *)(in_ECX + 0x43c) = 0x447a0000; *(undefined4 *)(in_ECX + 0x440) = 1; return; } //@@ 004264c0 player_get_net_user_id /* DB: ? (player) -> uint64: without networked input devices (Manager+0x4b3d8 empty) returns _controllerIndex (+0x1618); else maps a twin to its main player, InputManager::GetDeviceByPlayerEntity and returns the device profile's 64-bit id (+0x374 -> +8), -1 if none; Player_stats_add, Entity_Player::TriggerCollectibleRemoved */ ulonglong player_get_net_user_id(Entity_Player *param_1) { EntityPtr player; void *pvVar1; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { return (ulonglong)(uint)param_1->_controllerIndex; } player = param_1->_twinPlayer; if (((player == (EntityPtr)0x0) || (*(int *)((int)player + 0x161c) == -1)) || (param_1->_playerIndex <= *(int *)((int)player + 0x161c))) { player = (EntityPtr)param_1; } pvVar1 = InputManager::GetDeviceByPlayerEntity (&g_manager->_netplayManager,(Entity_Player *)player); if (pvVar1 == (void *)0x0) { return 0xffffffffffffffff; } if (*(int *)((int)pvVar1 + 0x374) == 0) { return 0; } return *(ulonglong *)(*(int *)((int)pvVar1 + 0x374) + 8); } //@@ 00426560 FUN_00426560 int * FUN_00426560(int param_1,int param_2) { int *piVar1; int iVar2; int *piVar3; int *in_ECX; int iVar4; uint uVar5; piVar1 = (int *)*in_ECX; iVar2 = in_ECX[1] - (int)piVar1 >> 0x1f; iVar4 = (in_ECX[1] - (int)piVar1) / 0x68 + iVar2; uVar5 = 0; if (iVar4 != iVar2) { piVar3 = piVar1; do { if ((*piVar3 == param_1) && (piVar3[1] == param_2)) { return piVar1 + uVar5 * 0x1a; } uVar5 = uVar5 + 1; piVar3 = piVar3 + 0x1a; } while (uVar5 < (uint)(iVar4 - iVar2)); } KAGE_LogMessage(8,(byte *)"CoopStats::get_player_info() did not have data for user %llu \n"); return (int *)0x0; } //@@ 004265d0 std::vector<104byte>::_Tidy /* DB: trivial 0x68-byte elements: frees, nulls; online_stats_destroy */ void std::vector<104byte>::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x68) * 0x68; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00426640 std::vector<104byte>::_Emplace_reallocate /* DB: growth/max 0x2762762 by /0x68, 0x1a-dword POD copy; caller online_stats_add_user */ undefined4 * std::vector<104byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { void *pvVar1; int iVar2; uint uVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; int *in_ECX; uint uVar8; int iVar9; uint uVar10; undefined4 *puVar11; undefined4 *puVar12; undefined4 *puVar13; void *ptr; undefined4 *puVar14; undefined4 *puVar15; iVar9 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0x68; if (iVar2 == 0x2762762) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar3 = iVar2 + 1; uVar10 = (in_ECX[2] - *in_ECX) / 0x68; if (0x2762762 - (uVar10 >> 1) < uVar10) { uVar8 = 0x2762762; } else { uVar10 = (uVar10 >> 1) + uVar10; uVar8 = uVar3; if (uVar3 <= uVar10) { uVar8 = uVar10; } if (0x2762762 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = _Allocate(uVar8 * 0x68); puVar5 = puVar4 + (((int)param_1 - iVar9) / 0x68) * 0x1a; puVar12 = puVar5; for (iVar9 = 0x1a; iVar9 != 0; iVar9 = iVar9 + -1) { *puVar12 = *param_2; param_2 = param_2 + 1; puVar12 = puVar12 + 1; } puVar12 = (undefined4 *)in_ECX[1]; puVar7 = (undefined4 *)*in_ECX; puVar15 = puVar4; if (param_1 == puVar12) { while (puVar7 != puVar12) { puVar6 = puVar7 + 0x1a; puVar11 = puVar15 + 0x1a; iVar9 = 0x1a; puVar13 = puVar7; puVar14 = puVar15; while( true ) { puVar7 = puVar6; puVar15 = puVar11; if (iVar9 == 0) break; *puVar14 = *puVar13; iVar9 = iVar9 + -1; puVar13 = puVar13 + 1; puVar14 = puVar14 + 1; } } } else { param_2 = puVar4; if (puVar7 != param_1) { do { puVar12 = puVar7; puVar15 = param_2; for (iVar9 = 0x1a; iVar9 != 0; iVar9 = iVar9 + -1) { *puVar15 = *puVar12; puVar12 = puVar12 + 1; puVar15 = puVar15 + 1; } puVar7 = puVar7 + 0x1a; param_2 = param_2 + 0x1a; } while (puVar7 != param_1); puVar12 = (undefined4 *)in_ECX[1]; } if (param_1 != puVar12) { puVar7 = puVar5; do { puVar7 = puVar7 + 0x1a; puVar13 = param_1 + 0x1a; puVar15 = puVar7; for (iVar9 = 0x1a; iVar9 != 0; iVar9 = iVar9 + -1) { *puVar15 = *param_1; param_1 = param_1 + 1; puVar15 = puVar15 + 1; } param_1 = puVar13; } while (puVar13 != puVar12); } } pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { uVar10 = ((in_ECX[2] - (int)pvVar1) / 0x68) * 0x68; ptr = pvVar1; if (0xfff < uVar10) { ptr = *(void **)((int)pvVar1 + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar10); } *in_ECX = (int)puVar4; in_ECX[1] = (int)(puVar4 + uVar3 * 0x1a); in_ECX[2] = (int)(puVar4 + uVar8 * 0x1a); return puVar5; } //@@ 004267f0 std::vector<8byte>::_Emplace_reallocate /* DB: element size 8, max 0x1fffffff, grows x1.5, _Change_array; Game::AddEncounteredBoss, Menu_Save::select_save_slot, netplay */ uint * std::vector<8byte>::_Emplace_reallocate(void *param_1,uint *param_2) { uint uVar1; uint *puVar2; int iVar3; void *_Src; int iVar4; uint *_Dst; int *in_ECX; uint uVar5; uint uVar6; iVar3 = *in_ECX; iVar4 = in_ECX[1] - iVar3 >> 3; if (iVar4 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar4 + 1; uVar5 = in_ECX[2] - iVar3 >> 3; if (0x1fffffff - (uVar5 >> 1) < uVar5) { uVar6 = 0x1fffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar6 = uVar1; if (uVar1 <= uVar5) { uVar6 = uVar5; } if (0x1fffffff < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar6 * 8); puVar2 = _Dst + ((int)param_1 - iVar3 >> 3) * 2; uVar5 = param_2[1]; *puVar2 = *param_2; puVar2[1] = uVar5; _Src = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,_Src,in_ECX[1] - (int)_Src); } else { memmove(_Dst,_Src,(int)param_1 - (int)_Src); memmove(puVar2 + 2,param_1,in_ECX[1] - (int)param_1); } FID_conflict__Change_array(in_ECX,_Dst,uVar1,uVar6); return puVar2; } //@@ 004268e0 FID_conflict:_Change_array /* Library Function - Multiple Matches With Different Base Names private: void __thiscall std::vector >::_Change_array(unsigned int * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(unsigned int * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(struct CHN * * const,unsigned int,unsigned int) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Change_array(void *this,uint *param_1,uint param_2,uint param_3) { void *pvVar1; void *ptr; uint size; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = *(int *)((int)this + 8) - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(uint **)this = param_1; *(uint **)((int)this + 4) = param_1 + param_2 * 2; *(uint **)((int)this + 8) = param_1 + param_3 * 2; return; } //@@ 00426940 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator > >(class std::allocator > *,void *,unsigned int)'::`2'::M>::deallocate(struct `void __cdecl phmap::container_internal::Deallocate<8,class std::allocator > >(class std::allocator > *,void *,unsigned int)'::`2'::M * const,unsigned int) public: void __thiscall std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M>::deallocate(struct `void __cdecl phmap::container_internal::Deallocate<8,class std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M * const,unsigned int) public: void __thiscall std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M>::deallocate(struct `void __cdecl phmap::container_internal::Deallocate<8,class std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M * const,unsigned int) public: void __thiscall std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M>::deallocate(struct `void __cdecl phmap::container_internal::Deallocate<8,class std::allocator >(class std::allocator *,void *,unsigned int)'::`2'::M * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 8; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 00426980 std::vector::_Tidy /* DB: frees 8-byte element vector */ void std::vector::_Tidy(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 004269f0 FUN_004269f0 void FUN_004269f0(void) { char *this; char *in_ECX; FID_conflict__Tidy(in_ECX + 0x98); FID_conflict__Tidy(in_ECX + 0x8c); FID_conflict__Tidy(in_ECX + 0x48); FID_conflict__Tidy(in_ECX + 0x2c); FID_conflict__Tidy(in_ECX + 0x20); this = in_ECX + 0x18; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 0x18) + 4)); operator_delete(*(void **)this,0x14); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 00426a50 DailyChallenge::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ZHL sig (prefix drift: 53 8b5d08 56 vs 53 56 8bf1): this->_id = dailyDate, _specialDailyId, seeded xorshift picks of challenge params (mod 20 excluding 0xb/0xc/0x11/0x14, stage 6/8/10/11), "GetTaintedId() could not find tainted counterpart" prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall DailyChallenge::Init(DailyChallenge *this,uint dailyDate) { code *pcVar1; int iVar2; tm *ptVar3; uint uVar4; uint uVar5; bool bVar6; RNG local_58; byte local_48 [8]; __time64_t local_40; tm local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); this->_id = 0; this->_seed = 0; this->_specialDailyId = 0; this->_isPractice = 0; ChallengeParam::Reset(&this->_params); (this->_params)._isPathTypeSet = 1; iVar2 = holiday_get_current(); this->_specialDailyId = iVar2; this->_id = dailyDate; DateTime::set_from_yyyymmdd(local_48,dailyDate); bVar6 = this->_specialDailyId == 2; local_58._seed = dailyDate; if (bVar6) { local_58._seed = dailyDate - 1; } local_58._shift3 = 0x15; local_58._shift1 = 10; local_58._shift2 = 9; (this->_params)._playerType = 0x29; uVar4 = dailyDate - 1; if (!bVar6) { uVar4 = dailyDate; } do { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_58._seed = (uint)local_58._seed >> 10 ^ local_58._seed; local_58._seed = local_58._seed << 9 ^ local_58._seed; local_58._seed = (uint)local_58._seed >> 0x15 ^ local_58._seed; uVar5 = (uint)local_58._seed % 0x14; (this->_params)._playerType = uVar5; uVar4 = local_58._seed; } while ((((uVar5 == 0xc) || (uVar5 == 0xb)) || (uVar5 == 0x11)) || (uVar5 == 0x14)); if (local_58._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_58._seed = (uint)local_58._seed >> 10 ^ local_58._seed; local_58._seed = local_58._seed << 9 ^ local_58._seed; local_58._seed = (uint)local_58._seed >> 0x15 ^ local_58._seed; switch(local_58._seed & 3) { case 0: (this->_params)._endStage = 6; break; case 1: (this->_params)._endStage = 8; break; case 2: (this->_params)._endStage = 10; break; case 3: (this->_params)._endStage = 0xb; } if ((this->_params)._endStage < 10) { LAB_00426bde: iVar2 = 1; } else { if (local_58._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_58._seed = (uint)local_58._seed >> 10 ^ local_58._seed; local_58._seed = local_58._seed << 9 ^ local_58._seed; local_58._seed = (uint)local_58._seed >> 0x15 ^ local_58._seed; if ((local_58._seed & 1U) != 0) goto LAB_00426bde; iVar2 = 0; } (this->_params)._pathType = iVar2; (this->_params)._isMegaSatan = 0; (this->_params)._difficulty = 0; if ((local_48[0] & 2) != 0) { local_40 = _mkgmtime64(&local_38); } if ((local_48[0] & 3) != 0) { ptVar3 = _gmtime64(&local_40); local_38.tm_sec = ptVar3->tm_sec; local_38.tm_min = ptVar3->tm_min; local_38.tm_hour = ptVar3->tm_hour; local_38.tm_mday = ptVar3->tm_mday; local_38.tm_mon = ptVar3->tm_mon; local_38.tm_year = ptVar3->tm_year; local_38.tm_wday = ptVar3->tm_wday; local_38.tm_yday = ptVar3->tm_yday; local_38.tm_isdst = ptVar3->tm_isdst; } local_48[0] = local_48[0] & 0xfc; if ((char)local_38.tm_wday == '\0') { (this->_params)._endStage = 0xb; (this->_params)._isMegaSatan = 1; if (local_58._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_58._seed = (uint)local_58._seed >> ((byte)local_58._shift1 & 0x1f) ^ local_58._seed; local_58._seed = local_58._seed << ((byte)local_58._shift2 & 0x1f) ^ local_58._seed; local_58._seed = (uint)local_58._seed >> ((byte)local_58._shift3 & 0x1f) ^ local_58._seed; if (local_58._seed != ((uint)local_58._seed / 6) * 6) goto LAB_00427185; LAB_0042717b: (this->_params)._difficulty = 1; goto LAB_00427185; } if ((char)local_38.tm_wday == '\x01') { (this->_params)._pathType = 2; (this->_params)._endStage = 8; goto LAB_00427185; } if ((char)local_38.tm_wday == '\x02') { switch((this->_params)._playerType) { case 0: (this->_params)._playerType = 0x15; break; case 1: (this->_params)._playerType = 0x16; break; case 2: (this->_params)._playerType = 0x17; break; case 3: (this->_params)._playerType = 0x18; break; case 4: (this->_params)._playerType = 0x19; break; case 5: (this->_params)._playerType = 0x1a; break; case 6: (this->_params)._playerType = 0x1b; break; case 7: (this->_params)._playerType = 0x1c; break; case 8: (this->_params)._playerType = 0x1d; break; case 9: (this->_params)._playerType = 0x1e; break; case 10: (this->_params)._playerType = 0x1f; break; default: KAGE_LogMessage(8,(byte *) "GetTaintedId() could not find tainted counterpart to given ePlayerType (%d) \n" ); break; case 0xd: (this->_params)._playerType = 0x20; break; case 0xe: (this->_params)._playerType = 0x21; break; case 0xf: (this->_params)._playerType = 0x22; break; case 0x10: (this->_params)._playerType = 0x23; break; case 0x12: (this->_params)._playerType = 0x24; break; case 0x13: (this->_params)._playerType = 0x25; } if (local_58._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_58._seed = (uint)local_58._seed >> ((byte)local_58._shift1 & 0x1f) ^ local_58._seed; local_58._seed = local_58._seed << ((byte)local_58._shift2 & 0x1f) ^ local_58._seed; local_58._seed = (uint)local_58._seed >> ((byte)local_58._shift3 & 0x1f) ^ local_58._seed; uVar4 = (uint)local_58._seed % 100; if (uVar4 < 0x14) { (this->_params)._endStage = 6; goto LAB_00427185; } if (uVar4 < 0x28) { (this->_params)._endStage = 8; goto LAB_00427185; } if (0x31 < uVar4) { if (0x40 < uVar4) { if (0x4f < uVar4) { (this->_params)._endStage = 0xb; (this->_params)._pathType = (uint)(0x59 < uVar4); goto LAB_00427185; } goto LAB_00426e6e; } goto LAB_00426e53; } } else { if ((char)local_38.tm_wday == '\x03') { (this->_params)._endStage = 0xc; uVar4 = RNG::RandomInt(&local_58,2); (this->_params)._pathType = (uint)(uVar4 == 0); uVar4 = RNG::RandomInt(&local_58,100); if ((int)uVar4 < 0x14) { (this->_params)._endStage = 6; goto LAB_00427185; } if ((int)uVar4 < 0x28) { (this->_params)._endStage = 8; goto LAB_00427185; } } else { if ((char)local_38.tm_wday == '\x04') { (this->_params)._pathType = 3; (this->_params)._endStage = 0xd; goto LAB_00427185; } if ((char)local_38.tm_wday != '\x05') { if ((char)local_38.tm_wday != '\x06') goto LAB_00427185; uVar4 = RNG::RandomInt(&local_58,100); if ((int)uVar4 < 0xf) { (this->_params)._endStage = 6; } else if ((int)uVar4 < 0x1e) { (this->_params)._endStage = 8; } else if ((int)uVar4 < 0x28) { (this->_params)._endStage = 0xc; uVar4 = RNG::RandomInt(&local_58,2); (this->_params)._pathType = (uint)(uVar4 == 0); } else if ((int)uVar4 < 0x32) { (this->_params)._endStage = 10; (this->_params)._pathType = 0; } else if ((int)uVar4 < 0x3c) { (this->_params)._endStage = 10; (this->_params)._pathType = 1; } else if ((int)uVar4 < 0x46) { (this->_params)._endStage = 0xb; (this->_params)._pathType = 0; } else if ((int)uVar4 < 0x50) { (this->_params)._endStage = 0xb; (this->_params)._pathType = 1; } else if ((int)uVar4 < 0x5a) { (this->_params)._pathType = 3; (this->_params)._endStage = 0xd; } uVar4 = RNG::RandomInt(&local_58,2); if (uVar4 != 0) { switch((this->_params)._playerType) { case 0: (this->_params)._playerType = 0x15; break; case 1: (this->_params)._playerType = 0x16; break; case 2: (this->_params)._playerType = 0x17; break; case 3: (this->_params)._playerType = 0x18; break; case 4: (this->_params)._playerType = 0x19; break; case 5: (this->_params)._playerType = 0x1a; break; case 6: (this->_params)._playerType = 0x1b; break; case 7: (this->_params)._playerType = 0x1c; break; case 8: (this->_params)._playerType = 0x1d; break; case 9: (this->_params)._playerType = 0x1e; break; case 10: (this->_params)._playerType = 0x1f; break; default: KAGE_LogMessage(8,(byte *) "GetTaintedId() could not find tainted counterpart to given ePlayerType (%d) \n" ); break; case 0xd: (this->_params)._playerType = 0x20; break; case 0xe: (this->_params)._playerType = 0x21; break; case 0xf: (this->_params)._playerType = 0x22; break; case 0x10: (this->_params)._playerType = 0x23; break; case 0x12: (this->_params)._playerType = 0x24; break; case 0x13: (this->_params)._playerType = 0x25; } } uVar4 = RNG::RandomInt(&local_58,2); if (uVar4 == 0) goto LAB_00427185; goto LAB_0042717b; } (this->_params)._difficulty = 1; uVar4 = RNG::RandomInt(&local_58,100); if ((int)uVar4 < 0x14) { (this->_params)._endStage = 6; goto LAB_00427185; } if ((int)uVar4 < 0x28) { (this->_params)._endStage = 8; goto LAB_00427185; } } if (0x31 < (int)uVar4) { if (0x40 < (int)uVar4) { if (0x4f < (int)uVar4) { (this->_params)._endStage = 0xb; (this->_params)._pathType = (uint)(0x59 < (int)uVar4); goto LAB_00427185; } LAB_00426e6e: (this->_params)._endStage = 10; (this->_params)._pathType = 1; goto LAB_00427185; } LAB_00426e53: (this->_params)._endStage = 10; (this->_params)._pathType = 0; goto LAB_00427185; } } (this->_params)._endStage = 0xc; uVar4 = RNG::RandomInt(&local_58,2); (this->_params)._pathType = (uint)(uVar4 == 0); LAB_00427185: if (local_58._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = (uint)local_58._seed >> ((byte)local_58._shift1 & 0x1f) ^ local_58._seed; uVar4 = uVar4 << ((byte)local_58._shift2 & 0x1f) ^ uVar4; this->_seed = uVar4 >> ((byte)local_58._shift3 & 0x1f) ^ uVar4; FUN_00427290(this->_specialDailyId); return; } //@@ 00427290 FUN_00427290 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00427290(void) { undefined4 *puVar1; uint uVar2; int in_ECX; undefined1 auStack_30 [8]; undefined4 uStack_28; std_string sStack_24; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); switch(*(undefined4 *)(in_ECX + 0xc)) { case 1: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 8; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined4 *)(in_ECX + 0x90) = 0; *(undefined1 *)(in_ECX + 0x84) = 0; *(undefined1 *)(in_ECX + 0x7c) = 0; return; default: return; case 3: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 1; *(undefined4 *)(in_ECX + 0x50) = 8; goto LAB_004272da; case 4: case 0x13: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined1 *)(in_ECX + 0x84) = 1; return; case 5: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 2; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined1 *)(in_ECX + 0x84) = 1; return; case 6: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 8; *(undefined4 *)(in_ECX + 0x50) = 10; *(undefined4 *)(in_ECX + 0x90) = 1; *(undefined1 *)(in_ECX + 0x84) = 0; break; case 7: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 0xe; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined4 *)(in_ECX + 0x90) = 1; *(undefined1 *)(in_ECX + 0x84) = 1; return; case 8: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x50) = 8; *(undefined1 *)(in_ECX + 0x84) = 0; break; case 9: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 10; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined4 *)(in_ECX + 0x90) = 1; *(undefined1 *)(in_ECX + 0x84) = 0; *(undefined1 *)(in_ECX + 0x7c) = 0; return; case 10: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 2; *(undefined4 *)(in_ECX + 0x50) = 8; *(undefined1 *)(in_ECX + 0x84) = 0; break; case 0xb: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 10; *(undefined4 *)(in_ECX + 0x50) = 6; goto LAB_004272da; case 0xc: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 6; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined1 *)(in_ECX + 0x84) = 1; return; case 0xd: *(undefined4 *)(in_ECX + 0x54) = 5; goto LAB_004272bf; case 0xe: *(undefined4 *)(in_ECX + 0x80) = 1; *(undefined4 *)(in_ECX + 0x54) = 10; *(undefined4 *)(in_ECX + 0x50) = 0xb; goto LAB_004272d0; case 0xf: *(undefined4 *)(in_ECX + 0x80) = 1; *(undefined4 *)(in_ECX + 0x54) = 10; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined1 *)(in_ECX + 0x84) = 1; break; case 0x10: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 1; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined1 *)(in_ECX + 0x84) = 1; return; case 0x11: *(undefined4 *)(in_ECX + 0x54) = 0; LAB_004272bf: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x50) = 10; LAB_004272d0: *(undefined4 *)(in_ECX + 0x90) = 0; goto LAB_004272da; case 0x12: *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x50) = 10; *(undefined4 *)(in_ECX + 0x90) = 1; LAB_004272da: *(undefined1 *)(in_ECX + 0x84) = 0; return; case 0x14: case 0x1b: case 0x30: *(undefined4 *)(in_ECX + 0x54) = 0; break; case 0x15: *(undefined4 *)(in_ECX + 0x54) = 0xf; goto LAB_004275c8; case 0x16: *(undefined4 *)(in_ECX + 0x54) = 4; LAB_004275c8: uStack_28 = 4; FUN_00428560(auStack_30,&uStack_28); uStack_28 = 2; goto LAB_00427333; case 0x17: *(undefined4 *)(in_ECX + 0x54) = 2; break; case 0x18: case 0x2b: case 0x2d: *(undefined4 *)(in_ECX + 0x54) = 1; return; case 0x19: case 0x1c: case 0x20: case 0x22: case 0x2a: case 0x2f: case 0x33: *(undefined4 *)(in_ECX + 0x54) = 0; return; case 0x1a: case 0x1f: case 0x21: case 0x28: *(undefined4 *)(in_ECX + 0x54) = 1; break; case 0x1d: *(undefined4 *)(in_ECX + 0x54) = 0xd; return; case 0x1e: case 0x27: *(undefined4 *)(in_ECX + 0x54) = 8; break; case 0x23: *(undefined4 *)(in_ECX + 0x54) = 4; return; case 0x24: case 0x2c: *(undefined4 *)(in_ECX + 0x54) = 2; return; case 0x25: *(undefined4 *)(in_ECX + 0x54) = 0x10; return; case 0x26: case 0x31: *(undefined4 *)(in_ECX + 0x54) = 4; break; case 0x29: *(undefined4 *)(in_ECX + 0x54) = 0xe; return; case 0x2e: case 0x32: *(undefined4 *)(in_ECX + 0x54) = 3; return; case 0x34: puVar1 = *(undefined4 **)(in_ECX + 0xa8); *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x50) = 0xb; *(undefined4 *)(in_ECX + 0x90) = 1; *(undefined1 *)(in_ECX + 0x84) = 0; *(undefined4 *)(in_ECX + 0x80) = 0; *(undefined4 **)(in_ECX + 0xac) = puVar1; uStack_28 = 0x4f; if (puVar1 == *(undefined4 **)(in_ECX + 0xb0)) { std::vector<4byte>::_Emplace_reallocate(puVar1,&uStack_28); } else { *puVar1 = 0x4f; *(int *)(in_ECX + 0xac) = *(int *)(in_ECX + 0xac) + 4; } builtin_strncpy(sStack_24._buf,"XRA8 J6GH",10); sStack_24._capacity = 0xf; sStack_24._size = 9; uVar2 = Seeds::String2Seed(&sStack_24); *(uint *)(in_ECX + 4) = uVar2; return; } uStack_28 = 4; LAB_00427333: FUN_00428560(auStack_30,&uStack_28); return; } //@@ 00427870 holiday_get_current /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? builds tm for now, Nov 1 of year + weekday table (Thanksgiving = 4th Thursday), Meeus/Gauss Easter date ("Cannot calculate Easter date for year %d" if year>=5000); returns holiday id; caller 00426a50 DailyChallenge::Init date code) */ undefined4 holiday_get_current(void) { byte bVar1; short sVar2; tm *ptVar3; int tmYear; uint uVar4; short sVar5; uint in_ECX; int iVar6; uint uVar7; int iVar8; uint uVar9; byte local_f4; int iStack_f0; undefined4 uStack_ec; undefined4 uStack_e8; int local_e4; int iStack_e0; int iStack_dc; int iStack_cc; int iStack_c8; int local_c4; byte local_bc [8]; __time64_t local_b4; tm local_ac; uint local_84; int iStack_80; undefined4 uStack_7c; undefined4 uStack_78; int local_74; int iStack_70; int iStack_6c; int iStack_68; int local_64; int iStack_60; int iStack_5c; int iStack_58; undefined8 local_54; uint local_4c; int iStack_48; undefined8 uStack_44; tm local_3c; undefined4 uStack_18; byte bStack_11; int local_10; undefined2 local_c; undefined1 local_a; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; DateTime::set_from_yyyymmdd(local_bc,in_ECX); if ((local_bc[0] & 2) != 0) { local_b4 = _mkgmtime64(&local_ac); } if ((local_bc[0] & 3) != 0) { ptVar3 = _gmtime64(&local_b4); local_ac.tm_sec = ptVar3->tm_sec; local_ac.tm_min = ptVar3->tm_min; local_ac.tm_hour = ptVar3->tm_hour; local_ac.tm_mday = ptVar3->tm_mday; local_ac.tm_mon = ptVar3->tm_mon; local_ac.tm_year = ptVar3->tm_year; local_ac.tm_wday = ptVar3->tm_wday; local_ac.tm_yday = ptVar3->tm_yday; local_ac.tm_isdst = ptVar3->tm_isdst; } local_bc[0] = local_bc[0] & 0xfc; sVar2 = (short)local_ac.tm_year; sVar5 = sVar2 + 0x76c; DateTime::constructor(); local_4c = local_4c | 2; tmYear = sVar5 + -0x76c; local_3c.tm_mon = 10; local_3c.tm_mday = 1; local_10 = 0x1718191a; local_c = 0x1c16; local_a = 0x1b; local_3c.tm_year = tmYear; DateTime::constructor(); if ((local_4c & 2) != 0) { uStack_44 = _mkgmtime64(&local_3c); } if (((byte)local_4c & 3) != 0) { ptVar3 = _gmtime64(&uStack_44); local_3c.tm_sec = ptVar3->tm_sec; local_3c.tm_min = ptVar3->tm_min; local_3c.tm_hour = ptVar3->tm_hour; local_3c.tm_mday = ptVar3->tm_mday; local_3c.tm_mon = ptVar3->tm_mon; local_3c.tm_year = ptVar3->tm_year; local_3c.tm_wday = ptVar3->tm_wday; local_3c.tm_yday = ptVar3->tm_yday; local_3c.tm_isdst = ptVar3->tm_isdst; } bVar1 = (&bStack_11)[(char)((char)local_3c.tm_wday + '\x01')]; iVar6 = (int)sVar5; if ((ushort)(sVar2 + 0x76bU) < 5000) { local_10 = iVar6 % 0x13; uVar4 = iVar6 / 100; uVar7 = iVar6 % 100; iVar6 = (int)((-((int)((uVar4 - (int)(uVar4 + 8) / 0x19) + 1) / 3) - ((int)(uVar4 + ((int)uVar4 >> 0x1f & 3U)) >> 2)) + uVar4 + local_10 * 0x13 + 0xf) % 0x1e; uVar4 = uVar4 & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } uVar9 = uVar7 & 0x80000003; if ((int)uVar9 < 0) { uVar9 = (uVar9 - 1 | 0xfffffffc) + 1; } iVar8 = (int)((((((int)(uVar7 + ((int)uVar7 >> 0x1f & 3U)) >> 2) + uVar4) * 2 + 0x20) - uVar9) - iVar6) % 7; iVar6 = iVar6 + 0x72 + iVar8 + (((iVar6 + iVar8 * 2) * 0xb + local_10) / 0x1c3) * -7; DateTime::constructor(); local_4c = local_4c | 2; local_64 = iVar6 / 0x1f + -1; iStack_68 = iVar6 % 0x1f + 1; local_84 = local_4c; iStack_80 = iStack_48; uStack_7c = (undefined4)uStack_44; uStack_78 = uStack_44._4_4_; local_74 = local_3c.tm_sec; iStack_70 = local_3c.tm_min; iStack_6c = local_3c.tm_hour; iStack_5c = local_3c.tm_wday; iStack_58 = local_3c.tm_yday; local_54 = CONCAT44(uStack_18,local_3c.tm_isdst); iStack_60 = tmYear; local_3c.tm_mday = iStack_68; local_3c.tm_mon = local_64; local_3c.tm_year = tmYear; } else { KAGE_LogMessage(8,(byte *)"Cannot calculate Easter date for year %d"); local_84._0_1_ = 1; uStack_7c = 0; uStack_78 = 0; ptVar3 = _gmtime64((__time64_t *)&uStack_7c); local_74 = ptVar3->tm_sec; iStack_70 = ptVar3->tm_min; iStack_6c = ptVar3->tm_hour; iStack_68 = ptVar3->tm_mday; local_64 = ptVar3->tm_mon; iStack_60 = ptVar3->tm_year; iStack_5c = ptVar3->tm_wday; iStack_58 = ptVar3->tm_yday; local_84 = CONCAT31(local_84._1_3_,(undefined1)local_84) & 0xfffffffc; local_54 = CONCAT44(local_54._4_4_,ptVar3->tm_isdst); } uVar4 = date_to_yyyymmdd(local_f4 | 2,iStack_f0,CONCAT44(uStack_e8,uStack_ec),local_e4,iStack_e0, iStack_dc,(uint)bVar1,10,tmYear,iStack_cc,iStack_c8,local_c4); if (in_ECX == uVar4) { return 0x10; } uVar4 = date_to_yyyymmdd((byte)local_84,iStack_80,CONCAT44(uStack_78,uStack_7c),local_74,iStack_70 ,iStack_6c,iStack_68,local_64,iStack_60,iStack_5c,iStack_58,(int)local_54 ); if (in_ECX == uVar4) { return 6; } if ((in_ECX == 0x134b0b4) || (in_ECX == 0x134b10e)) { switchD_00427ff4_caseD_450: return 0x34; } uVar4 = in_ECX % 10000; if (uVar4 < 0x192) { if (uVar4 == 0x191) { return 7; } switch(uVar4) { case 0x65: return 1; case 0x72: return 0x14; case 0x74: return 0x15; case 0x7f: return 0x16; case 0xca: return 2; case 0xd1: return 0x17; case 0xd3: return 0x18; case 0xd6: return 3; case 0xda: return 0x19; case 0x12e: return 4; case 0x130: return 0x1a; case 0x13d: return 5; case 0x140: return 0x1b; case 0x142: return 0x1c; } } else if (uVar4 < 0x2bf) { if (uVar4 == 0x2be) { return 0x25; } switch(uVar4) { case 0x19a: return 0x1d; case 0x19f: return 0x1e; case 0x1a6: return 0x1f; case 0x1f8: return 0x20; case 0x1fc: return 8; case 0x201: return 0x21; case 0x205: return 0x22; case 0x212: return 9; case 0x25d: return 0x23; case 0x26a: return 0x24; case 0x26b: return 10; case 0x271: return 0xb; } } else if (uVar4 < 0x38a) { if (uVar4 == 0x389) { return 0x2b; } switch(uVar4) { case 0x2c0: return 0xc; case 0x2c7: return 0x26; case 0x2c9: return 0x27; case 0x32f: return 0x28; case 0x330: return 0x29; case 0x336: return 0x2a; } } else if (uVar4 < 0x4b6) { if (uVar4 == 0x4b5) { return 0x11; } switch(uVar4) { case 0x395: return 0x2c; case 0x39a: return 0x2d; case 0x3ee: return 0x2e; case 0x3ef: return 0x2f; case 0x407: return 0xd; case 0x44d: return 0xe; case 0x450: goto switchD_00427ff4_caseD_450; case 0x457: return 0xf; case 0x459: return 0x30; case 0x45f: return 0x31; } } else { switch(uVar4) { case 0x4b6: return 0x12; case 0x4c7: return 0x32; case 0x4c9: return 0x13; case 0x4cf: return 0x33; } } return 0; } //@@ 00428560 FUN_00428560 void FUN_00428560(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_004286b0(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00428590 std::vector<4byte>::_Emplace_reallocate /* DB: grow 1.5x, insert 4-byte element, memmove halves */ undefined4 * std::vector<4byte>::_Emplace_reallocate(void *param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; int iVar3; void *pvVar4; int iVar5; void *_Dst; void *ptr; int *in_ECX; uint uVar6; uint uVar7; iVar3 = *in_ECX; iVar5 = in_ECX[1] - iVar3 >> 2; if (iVar5 == 0x3fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar5 + 1; uVar6 = in_ECX[2] - iVar3 >> 2; if (0x3fffffff - (uVar6 >> 1) < uVar6) { uVar7 = 0x3fffffff; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar7 = uVar1; if (uVar1 <= uVar6) { uVar7 = uVar6; } if (0x3fffffff < uVar7) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar7 * 4); puVar2 = (undefined4 *)((int)_Dst + ((int)param_1 - iVar3 >> 2) * 4); *puVar2 = *param_2; pvVar4 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar4,in_ECX[1] - (int)pvVar4); } else { memmove(_Dst,pvVar4,(int)param_1 - (int)pvVar4); memmove(puVar2 + 1,param_1,in_ECX[1] - (int)param_1); } pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { uVar6 = in_ECX[2] - (int)pvVar4 & 0xfffffffc; ptr = pvVar4; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar4 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + uVar1 * 4); in_ECX[2] = (int)(uVar7 * 4 + (int)_Dst); return puVar2; } //@@ 004286b0 FUN_004286b0 void FUN_004286b0(int *param_1,int *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1a2d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)std::set::find_node(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(int *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x14); local_28 = (int *)uVar1; piVar8[4] = *param_2; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_004287fa: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_004287fa; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00428880 FUN_00428880 void FUN_00428880(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x14); } return; } //@@ 004288a0 std::set::find_node /* DB: src/rooms decompile labels (std::set::find_node) */ int * std::set::find_node(int *param_1,int *param_2) { int iVar1; int iVar2; undefined4 *puVar3; int *in_ECX; iVar1 = *in_ECX; puVar3 = *(undefined4 **)(iVar1 + 4); *param_1 = (int)puVar3; param_1[1] = 0; param_1[2] = iVar1; if (*(char *)((int)puVar3 + 0xd) == '\0') { iVar1 = *param_2; do { *param_1 = (int)puVar3; iVar2 = puVar3[4]; if (iVar1 <= iVar2) { param_1[2] = (int)puVar3; puVar3 = (undefined4 *)*puVar3; } else { puVar3 = (undefined4 *)puVar3[2]; } param_1[1] = (uint)(iVar1 <= iVar2); } while (*(char *)((int)puVar3 + 0xd) == '\0'); } return param_1; } //@@ 004288f0 Entity::SetPosition /* DB: writes Vector to +0x33c (_pos) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetPosition(Entity *this,Vector *pos) { (this->_pos).x = pos->x; (this->_pos).y = pos->y; return; } //@@ 00428910 Entity::SetVelocity /* DB: copies Vector to this+0x360/0x364 (velocity) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetVelocity(Entity *this,Vector *velocity) { (this->_velocity).x = velocity->x; (this->_velocity).y = velocity->y; return; } //@@ 00428930 GridEntity::GetSprite /* ZHL [lua] Lua binding GridEntity:GetSprite */ ANM2 * __thiscall GridEntity::GetSprite(GridEntity *this) { return &this->_sprite; } //@@ 00428940 Seeds::Init3 /* DB: ? draws seeds into +0x58.. via xorshift prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Seeds::Init3(Seeds *this,RNG *rng) { code *pcVar1; uint uVar2; uVar2 = rng->_seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = rng->_seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)rng->_shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 ^ uVar2 << ((byte)rng->_shift2 & 0x1f); uVar2 = uVar2 ^ uVar2 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = uVar2; this->_seedEffectsCount = uVar2; uVar2 = rng->_seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = rng->_seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)rng->_shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 ^ uVar2 << ((byte)rng->_shift2 & 0x1f); uVar2 = uVar2 ^ uVar2 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = uVar2; *(uint *)(this + 1) = uVar2; uVar2 = rng->_seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = rng->_seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)rng->_shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 ^ uVar2 << ((byte)rng->_shift2 & 0x1f); uVar2 = uVar2 ^ uVar2 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = uVar2; this[1]._gameStartSeed = uVar2; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar2 = uVar2 >> 0xb ^ uVar2; uVar2 = uVar2 << 7 ^ uVar2; this[1]._rng._seed = uVar2 >> 0xc ^ uVar2; return; } //@@ 00428a50 Room::GetEntities /* ZHL [lua] Lua binding Room:GetEntities */ int Room::GetEntities(void) { int in_ECX; return in_ECX + 0x1258; } //@@ 00428a60 FUN_00428a60 int FUN_00428a60(void) { int in_ECX; return in_ECX + 0x1218; } //@@ 00428a70 FUN_00428a70 undefined4 FUN_00428a70(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x11f8); } //@@ 00428a80 Level::SetStateFlag /* ZHL [lua] Lua binding Level:SetStateFlag */ void __thiscall Level::SetStateFlag(Level *this,uint param_2,char param_3) { byte *pbVar1; uint uVar2; if ((int)param_2 < 1) { param_2 = 0; } if ((int)param_2 < 0x19) { if (0x19 < param_2) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } } else { param_2 = 0x19; } pbVar1 = this->_ventricleRazorPortals + (param_2 >> 5) * 4 + 0x24; uVar2 = 1 << ((byte)param_2 & 0x1f); if (param_3 == '\0') { *(uint *)pbVar1 = ~uVar2 & *(uint *)pbVar1; return; } *(uint *)pbVar1 = *(uint *)pbVar1 | uVar2; return; } //@@ 00428ae0 FUN_00428ae0 void FUN_00428ae0(uint param_1) { uint uVar1; int in_ECX; if (0x7fffffff < param_1) { param_1 = 0xffffffff; } uVar1 = 7; if ((int)param_1 < 7) { uVar1 = param_1; } *(uint *)(in_ECX + 0x18318) = uVar1; return; } //@@ 00428b10 Entity_Player::GetHearts /* ZHL [lua] Lua binding EntityPlayer:GetHearts */ int __thiscall Entity_Player::GetHearts(Entity_Player *this) { return this->_redHearts; } //@@ 00428b20 Game::Spawn /* ZHL [lua] Lua binding Game:Spawn prototype: db/protos.zhl, confirmed by RET 28 */ Entity * __thiscall Game::Spawn(Game *this,uint type,uint variant,Vector *position,Vector *velocity,Entity *spawner, uint subType,uint seed) { Entity *pEVar1; pEVar1 = SpawnEx(this,type,variant,position,velocity,spawner,subType,seed,0); return pEVar1; } //@@ 00428b50 FUN_00428b50 StageTransition * FUN_00428b50(void) { return &g_game->_stageTransition; } //@@ 00428b60 FUN_00428b60 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00428b60(void *param_1,undefined4 param_2) { byte *pbVar1; byte bVar2; void *pvVar3; int iVar4; byte *pbVar5; int in_ECX; int iVar6; uint uVar7; char *pcVar8; bool bVar9; char local_38 [24]; undefined4 local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1a5d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_38 + 0x34); ExceptionList = &local_10; std::string::string(local_38,param_1); local_20 = param_2; local_8 = 0; iVar6 = *(int *)(in_ECX + 0x10b0); uVar7 = *(uint *)(in_ECX + 0x10a8); local_1c = 0; local_18 = 0; if (uVar7 <= iVar6 + 1U) { FUN_00923e60(iVar6); uVar7 = *(uint *)(in_ECX + 0x10a8); iVar6 = *(int *)(in_ECX + 0x10b0); } *(uint *)(in_ECX + 0x10ac) = *(uint *)(in_ECX + 0x10ac) & uVar7 - 1; uVar7 = iVar6 + *(int *)(in_ECX + 0x10ac) & uVar7 - 1; iVar4 = *(int *)(in_ECX + 0x10a4); iVar6 = uVar7 * 4; if (*(int *)(iVar4 + uVar7 * 4) == 0) { pvVar3 = operator_new(0x24); *(void **)(iVar6 + *(int *)(in_ECX + 0x10a4)) = pvVar3; iVar4 = *(int *)(in_ECX + 0x10a4); } pcVar8 = *(char **)(iVar6 + iVar4); std::string::string(pcVar8,local_38); *(undefined4 *)(pcVar8 + 0x18) = local_20; *(undefined4 *)(pcVar8 + 0x1c) = local_1c; *(undefined4 *)(pcVar8 + 0x20) = local_18; *(int *)(in_ECX + 0x10b0) = *(int *)(in_ECX + 0x10b0) + 1; if (*(int *)(in_ECX + 0x10b0) == 1) { pbVar1 = *(byte **)(in_ECX + 0x10e8); if (pbVar1 != (byte *)0x0) { pbVar5 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar5 = *(byte **)pbVar1; } pcVar8 = "TextIn"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*pcVar8; if (bVar2 != *pcVar8) { LAB_00428c62: uVar7 = -(uint)bVar9 | 1; goto LAB_00428c67; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)pcVar8[1]; if (bVar2 != pcVar8[1]) goto LAB_00428c62; pbVar5 = pbVar5 + 2; pcVar8 = pcVar8 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_00428c67: if ((uVar7 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x10f8) != '\0')))) goto LAB_00428c94; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x10b4),(byte *)"TextIn",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x10e4)); *(undefined1 *)(in_ECX + 0x10f8) = 1; } } LAB_00428c94: local_1c = 0; local_18 = 0; std::string::_Tidy_deallocate(local_38); ExceptionList = local_10; return; } //@@ 00428cd0 MusicManager::MusicManager /* ZHL [lua] Lua binding MusicManager:MusicManager */ MusicManager * MusicManager::MusicManager(void) { return &g_manager->_musicManager; } //@@ 00428ce0 FUN_00428ce0 void FUN_00428ce0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(undefined4 **)(in_ECX + 0xc) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 0xc))(1,__security_cookie ^ (int)register0x00000010 - 4U) ; *(undefined4 *)(in_ECX + 0xc) = 0; } ExceptionList = local_10; return; } //@@ 00428d30 FUN_00428d30 undefined4 FUN_00428d30(int param_1) { Manager *pMVar1; byte bVar2; uint uVar3; uint uVar4; int *in_ECX; RoomDescriptor *pRVar5; Game *pGVar6; float fVar7; KColor KStack_5c; float fStack_48; float fStack_44; float fStack_40; float fStack_3c; Game *pGStack_34; Game *pGStack_30; int iStack_2c; RNG *pRStack_28; int iStack_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; pGVar6 = g_game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00af1ab9; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; if (((*in_ECX == 0) && (uVar4 = PlayerManager::count_main_players(&g_game->_playerManager), 1 < uVar4)) && (pGVar6->_challenge == 0)) { shared_save_write(); pMVar1 = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar1->_persistentGameData)._isReadOnly = 1; pGVar6 = g_game; pGStack_34 = (Game *)&g_game->_roomConfig; pRStack_28 = &g_game->_generationRNG; iStack_24 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iStack_24 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard,uVar3), g_invalidRoomDescriptorGuard == -1 )) { uStack_14 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_14 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } pRVar5 = &g_roomDescriptorDummy; if ((uint)pGVar6->_currentDimensionIdx < 3) { pRVar5 = pGVar6->_roomList + 0x20d; } Seeds::Init3((Seeds *)pRVar5,&pGVar6->_generationRNG); iStack_2c = (**(code **)(*(int *)in_ECX[3] + 0x34))(); uVar3 = (**(code **)(*(int *)in_ECX[3] + 4))(); pGStack_30 = (Game *)0x0; uVar4 = RNG::Next(pRStack_28); pGVar6 = pGStack_34; pGStack_34 = (Game *)RoomConfig::GetRandomRoom ((RoomConfig *)pGStack_34,uVar4,1,0,0x1e,iStack_2c,uVar3,uVar3,1, 10,(uint *)&pGStack_30,0xffffffff,0); pGStack_30 = pGStack_34; if (pGStack_34 == (Game *)0x0) { uVar3 = RNG::Next(pRStack_28); pGStack_30 = (Game *)RoomConfig::GetRandomRoom ((RoomConfig *)pGVar6,uVar3,1,0,0x1e,iStack_2c,0,0,1,10, (uint *)&pGStack_34,0xffffffff,0); } pGStack_34 = g_game; if ((*(int *)(iStack_24 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_14 = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_14 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } pGVar6 = g_game; if ((uint)pGStack_34->_currentDimensionIdx < 3) { pRVar5 = pGStack_34->_roomList + 0x20d; } else { pRVar5 = &g_roomDescriptorDummy; } pRVar5->Data = pGStack_30; pGStack_34 = pGVar6; if (*(int *)(iStack_24 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { uStack_14 = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_14 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } pGVar6 = g_game; } if ((uint)pGStack_34->_currentDimensionIdx < 3) { pRVar5 = pGStack_34->_roomList + 0x20d; } else { pRVar5 = &g_roomDescriptorDummy; } if (pRVar5->Data != (void *)0x0) { in_ECX[2] = param_1; pGVar6->_leaveDoor = -1; pGVar6->_levelStateFlags = pGVar6->_levelStateFlags & 0xffffbfff; func_0x0092f000(); bVar2 = Room::IsBeastDungeon(pGVar6->_room); *(byte *)(in_ECX + 6) = bVar2; if (bVar2 == 0) { KColor::SetFromARGB(&KStack_5c,0xff000000); fStack_48 = KStack_5c._red; fStack_44 = KStack_5c._green; fStack_40 = KStack_5c._blue; fStack_3c = (pGVar6->_fadeOutColor)._alpha; pGVar6->_fadeSpeed = 0.033; (pGVar6->_fadeOutColor)._red = KStack_5c._red; (pGVar6->_fadeOutColor)._green = KStack_5c._green; (pGVar6->_fadeOutColor)._blue = KStack_5c._blue; (pGVar6->_fadeOutColor)._alpha = fStack_3c; (pGVar6->_fadeOutColor)._unk = 0; fVar7 = (pGVar6->_fadeOutColor)._alpha; pGVar6->_fadeOutTarget = 10; (pGVar6->_fadeOutColor)._alpha = fVar7 + 0.033; FUN_00429810(1); } else { FUN_00421260(); DeathmatchManager::enter_arena(); } pMVar1 = g_manager; if ((g_manager->_musicManager)._isEnabled == 0) { fVar7 = 0.0; } else { fVar7 = (g_manager->_optionsConfig)._musicVolume; } (g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]._targetVolume = fVar7 * 0.15 * (g_manager->_optionsConfig)._musicVolume; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._fadeRate = 0.08; FUN_007ea5d0(); ExceptionList = local_1c; return 1; } KAGE_LogMessage(8,(byte *)"No deathmatch room for current level\n"); } ExceptionList = local_1c; return 0; } //@@ 00429170 FUN_00429170 void FUN_00429170(void) { uint uVar1; DeathmatchManager *in_ECX; *(undefined4 *)in_ECX = 0; *(undefined4 *)&in_ECX->field_0x4 = 0; uVar1 = Random(); if ((uVar1 & 1) == 0) { DeathmatchManager::set_type(in_ECX,1); return; } uVar1 = Random(); DeathmatchManager::set_type(in_ECX,uVar1 % 10 + 2); return; } //@@ 004291c0 update_cutscene_state_machine /* DB: ? Game::Update after HUD::Update: state 2..5 timers, sound 0x341, Camera::SetFocusPosition lerp, entity_vector_set_flag_410, 00429810(3/5) */ void update_cutscene_state_machine(void) { float fVar1; int iVar2; longlong lVar3; Manager *pMVar4; char cVar5; uint uVar6; int iVar7; int *piVar8; undefined4 *in_ECX; void *pvVar9; Game *pGVar10; int iVar11; PlayerManager *pPVar12; longlong lVar13; undefined4 local_1c; float local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1ae0; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar2 = in_ECX[1]; iVar7 = iVar2 + 1; in_ECX[1] = iVar7; pMVar4 = g_manager; switch(*in_ECX) { case 2: cVar5 = *(char *)(in_ECX + 6); local_18 = 3.0; if (cVar5 != '\0') { local_18 = 6.0; } local_14 = 0x5a; if (cVar5 == '\0') { local_14 = -1; } iVar11 = 0x48; if (cVar5 == '\0') { iVar11 = 0x43; } if ((iVar2 < iVar11) && (iVar11 <= iVar7)) { (g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]._targetVolume = 0.0; (pMVar4->_musicManager)._channels[(pMVar4->_musicManager)._currentChannel]._fadeRate = 0.02; (pMVar4->_musicManager)._queuedMusicID = 0; iVar7 = in_ECX[1]; } if ((cVar5 != '\0') && (iVar7 == local_14)) { SoundEffects::Play(&pMVar4->_sfxManager,0x341,1.0,1,0,1.0,0.0); iVar7 = in_ECX[1]; } if ((int)(local_18 * 30.0) <= iVar7) { FUN_00429810(3); ExceptionList = local_10; return; } break; case 3: if ((g_game->_fadeInColor)._alpha <= 0.0) { pPVar12 = &g_game->_playerManager; *in_ECX = 4; in_ECX[1] = 0; entity_vector_set_flag_410(pPVar12,1); ExceptionList = local_10; return; } break; case 4: (**(code **)(*(int *)in_ECX[3] + 0x10))(); cVar5 = (**(code **)(*(int *)in_ECX[3] + 0x1c))(); if (cVar5 != '\0') { FUN_00429810(5); ExceptionList = local_10; return; } break; case 5: lVar13 = (**(code **)(*(int *)in_ECX[3] + 0x20))(uVar6); local_18 = (float)((ulonglong)lVar13 >> 0x20); local_1c = (undefined4)lVar13; lVar3 = 0; if (lVar13 != 0) { local_14 = local_1c; PlayerManager::get_player_by_user_id ((PlayerManager *)&g_manager->_netplayManager,(ulonglong *)&local_1c); iVar7 = FUN_004253d0(); fVar1 = (float)in_ECX[5]; *(float *)(iVar7 + 0x33c) = *(float *)(iVar7 + 0x33c) + ((float)in_ECX[4] - *(float *)(iVar7 + 0x33c)) * 0.1; *(float *)(iVar7 + 0x340) = *(float *)(iVar7 + 0x340) + (fVar1 - *(float *)(iVar7 + 0x340)) * 0.1; Camera::SetFocusPosition(*(Camera **)((int)g_game->_room + 0x11f8),(Vector *)(in_ECX + 4)); lVar3 = CONCAT44(local_18,local_14); } uVar6 = 0; pPVar12 = &g_game->_playerManager; pGVar10 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar12->_playerList)._begin >> 2 != 0) { do { local_18 = (float)((ulonglong)lVar3 >> 0x20); local_14 = (int)lVar3; pvVar9 = (pPVar12->_playerList)._end; if ((int)pvVar9 - (int)(pPVar12->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); lVar3 = CONCAT44(local_18,local_14); pvVar9 = (pPVar12->_playerList)._end; pGVar10 = g_game; } piVar8 = (pPVar12->_playerList)._begin; if (uVar6 < (uint)((int)pvVar9 - (int)piVar8 >> 2)) { piVar8 = piVar8 + uVar6; } iVar7 = *piVar8; pPVar12 = &pGVar10->_playerManager; uVar6 = uVar6 + 1; *(float *)(iVar7 + 0x360) = *(float *)(iVar7 + 0x360) * 0.95; *(float *)(iVar7 + 0x364) = *(float *)(iVar7 + 0x364) * 0.95; } while (uVar6 < (uint)((int)(pGVar10->_playerManager)._playerList._end - (int)(pPVar12->_playerList)._begin >> 2)); } local_18 = (float)((ulonglong)lVar3 >> 0x20); local_14 = (int)lVar3; if (in_ECX[1] == 0x1e) { if (lVar3 != 0) { uVar6 = Random(); Game::SpawnEx(g_game,1000,0x27,(Vector *)(in_ECX + 4),&g_vectorZero,(Entity *)0x0,2,uVar6,0) ; ExceptionList = local_10; return; } } else if (in_ECX[1] == 0x8c) { *in_ECX = 6; in_ECX[1] = 0; online_stats_finalize(in_ECX[2]); } } ExceptionList = local_10; return; } //@@ 00429550 FUN_00429550 bool FUN_00429550(void) { int *in_ECX; return 1 < *in_ECX; } //@@ 00429560 FUN_00429560 bool FUN_00429560(void) { int *in_ECX; return *in_ECX == 4; } //@@ 00429570 DeathmatchManager::enter_arena /* DB: ? ECX = DeathmatchManager (Game+0x26614: lea ecx,[edi+0x26614] in Game::Update case 10, also FUN_00428d30): sets mode +0 = 2, sound 0x341 unless +0x18, moves the room's "EL" entity lists, clears flag 0x20 on room entities, Game::StartRoomTransition(-19 ROOM_DEATHMATCH_IDX, -1, anim 0x15), RoomTransition::Update, resets the transition, Game::Fadein */ void DeathmatchManager::enter_arena(void) { void *pvVar1; int iVar2; undefined4 *in_ECX; uint uVar3; int iVar4; Game *pGVar5; uint uVar6; uint uVar7; float local_2c; float local_28; float local_24; undefined4 local_20; undefined4 local_1c; undefined4 *local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1b00; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 2; in_ECX[1] = 0; local_18 = in_ECX; if (*(char *)(in_ECX + 6) == '\0') { SoundEffects::Play(&g_manager->_sfxManager,0x341,1.0,1,0,1.0,0.0); } local_14 = g_game->_room; pGVar5 = g_game; if (*(int *)((int)local_14 + 0x1254) != 0) { do { pvVar1 = pGVar5->_room; uVar7 = 0; iVar2 = **(int **)((int)local_14 + 0x124c); if (*(int *)((int)pvVar1 + 0x1254) != 0) { do { if (iVar2 == *(int *)(*(int *)((int)pvVar1 + 0x124c) + uVar7 * 4)) { uVar3 = *(uint *)((int)pvVar1 + 0x1254); if (uVar3 <= uVar7) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); uVar3 = *(uint *)((int)pvVar1 + 0x1254); } uVar6 = uVar7; if (uVar7 < uVar3 - 1) { do { *(undefined4 *)(*(int *)((int)pvVar1 + 0x124c) + uVar6 * 4) = *(undefined4 *)(*(int *)((int)pvVar1 + 0x124c) + 4 + uVar6 * 4); uVar6 = uVar6 + 1; uVar3 = *(uint *)((int)pvVar1 + 0x1254); } while (uVar6 < uVar3 - 1); } *(uint *)((int)pvVar1 + 0x1254) = uVar3 - 1; iVar4 = *(int *)((int)pvVar1 + 0x1244); if (*(uint *)((int)pvVar1 + 0x1240) < iVar4 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar4 = *(int *)((int)pvVar1 + 0x1244); } *(int *)(*(int *)((int)pvVar1 + 0x123c) + iVar4 * 4) = iVar2; *(int *)((int)pvVar1 + 0x1244) = *(int *)((int)pvVar1 + 0x1244) + 1; } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)((int)pvVar1 + 0x1254)); pGVar5 = g_game; } } while (*(int *)((int)local_14 + 0x1254) != 0); in_ECX = local_18; } pvVar1 = pGVar5->_room; uVar7 = 0; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { iVar2 = *(int *)(*(int *)((int)pvVar1 + 0x125c) + uVar7 * 4); uVar7 = uVar7 + 1; *(uint *)(iVar2 + 0x16c) = *(uint *)(iVar2 + 0x16c) & 0xffffffdf; *(undefined4 *)(iVar2 + 0x168) = *(undefined4 *)(iVar2 + 0x168); } while (uVar7 < *(uint *)((int)pvVar1 + 0x1264)); pGVar5 = g_game; } Game::StartRoomTransition(pGVar5,-0x13,-1,0x15,(Entity_Player *)0x0,-1); RoomTransition::Update(&g_game->_roomTransition); pGVar5 = g_game; iVar2 = 0; local_1c = 0; local_20 = 0x3f800000; (g_game->_roomTransition)._frame = 0; *(undefined4 *)&(pGVar5->_roomTransition).field_0xc = 0; *(undefined4 *)&pGVar5->_roomTransition = 0; (pGVar5->_roomTransition)._direction = 0; (pGVar5->_roomTransition)._animation = 0; *(undefined4 *)&(pGVar5->_roomTransition).field_0x20 = 0; (pGVar5->_roomTransition)._flags = 0; (pGVar5->_playerManager)._roomTransitionPlayer = (void *)0x0; if (*(char *)(in_ECX + 6) != '\0') { iVar2 = 0xff; } local_2c = ((float)iVar2 + 0.0) / 255.0; local_28 = local_2c; local_24 = local_2c; Game::Fadein(pGVar5,0,0,&local_2c); ExceptionList = local_10; return; } //@@ 00429810 FUN_00429810 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00429810(undefined4 param_1) { int extraout_EAX; byte *pbVar1; Entity_Player *this; undefined4 *in_ECX; undefined4 extraout_ECX; uint uVar2; void *pvVar3; float fVar4; undefined4 uVar5; byte bVar6; undefined8 uStack_c0; undefined **appuStack_b8 [2]; void *pvStack_b0; KColor KStack_ac; byte abStack_98 [128]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1b51; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(abStack_98 + 0x94); ExceptionList = &local_10; *in_ECX = param_1; in_ECX[1] = 0; switch(param_1) { case 2: if (*(char *)(in_ECX + 6) == '\0') { SoundEffects::Play(&g_manager->_sfxManager,0x341,1.0,1,0,1.0,0.0); } break; case 3: uVar2 = 0xff000000; if (*(char *)(in_ECX + 6) != '\0') { uVar2 = 0xffffffff; } KColor::SetFromARGB(&KStack_ac,uVar2); Game::Fadein(g_game,0x3d072b02,0,extraout_ECX); if ((g_manager->_musicManager)._isEnabled == 0) { fVar4 = 0.0; } else { fVar4 = (g_manager->_optionsConfig)._musicVolume; } Music::Fadein((Music *)&g_manager->_musicManager,0x77,fVar4,0.02); break; case 4: bVar6 = 1; LAB_0042985e: entity_vector_set_flag_410(&g_game->_playerManager,bVar6); break; case 5: uStack_c0 = (**(code **)(*(int *)in_ECX[3] + 0x20))(local_18); if (uStack_c0 == 0) { pbVar1 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/DEATHMATCH_DRAW"); uVar5 = 0x429b26; std::string::string_from_cstr((char *)&pvStack_b0,pbVar1); uStack_8 = 3; FUN_00428b60(&pvStack_b0,200,uVar5,pbVar1); if (0xf < (uint)KStack_ac._unk) { uVar2 = KStack_ac._unk + 1; pvVar3 = pvStack_b0; if (0xfff < uVar2) { pvVar3 = *(void **)((int)pvStack_b0 + -4); uVar2 = KStack_ac._unk + 0x24; if (0x1f < (uint)((int)pvStack_b0 + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } } else { appuStack_b8[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&uStack_c0); uStack_8 = 0; appuStack_b8[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_b8); } uStack_8 = 1; (*(code *)appuStack_b8[0][1])(); pbVar1 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/DEATHMATCH_WINNER"); sprintf(abStack_98,pbVar1); uStack_8 = 0xffffffff; pbVar1 = abStack_98; appuStack_b8[0] = KAGE::System::UserProfileBase::vftable; KStack_ac._alpha = 0.0; KStack_ac._unk = 0xf; pvStack_b0 = (void *)0x0; do { bVar6 = *pbVar1; pbVar1 = pbVar1 + 1; } while (bVar6 != 0); uVar2 = (int)pbVar1 - (int)(abStack_98 + 1); pbVar1 = abStack_98; std::string::assign((char *)&pvStack_b0,pbVar1,uVar2); uStack_8 = 2; FUN_00428b60(&pvStack_b0,200,pbVar1,uVar2); uStack_8 = 0xffffffff; if (0xf < (uint)KStack_ac._unk) { uVar2 = KStack_ac._unk + 1; pvVar3 = pvStack_b0; if (0xfff < uVar2) { pvVar3 = *(void **)((int)pvStack_b0 + -4); uVar2 = KStack_ac._unk + 0x24; if (0x1f < (uint)((int)pvStack_b0 + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } PlayerManager::get_player_by_user_id((PlayerManager *)&g_manager->_netplayManager,&uStack_c0); this = (Entity_Player *)FUN_004253d0(); fVar4 = (this->_pos).y; in_ECX[4] = (this->_pos).x; in_ECX[5] = fVar4; this->_isInvicible = 1; if (this->_redHearts == 0) { Entity_Player::AddHearts(this,1,0,0); } } case 1: bVar6 = 0; goto LAB_0042985e; case 6: online_stats_finalize(in_ECX[2]); } ExceptionList = local_10; return; } //@@ 00429be0 DeathmatchManager::set_type /* DB: ? switch(type) allocates DeathmatchTypeNormal/Ipecac/... (RTTI vftables) into this+0xc after releasing the old one, "Unknown type specified"; callers Game::constructor and run start prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall DeathmatchManager::set_type(DeathmatchManager *this,int type) { int *piVar1; char cVar2; void *other; undefined4 *puVar3; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1c45; local_10 = ExceptionList; ExceptionList = &local_10; if (this->_type != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_type)(1,__security_cookie ^ (uint)(local_1c + 0x18)); this->_type = (void *)0x0; } switch(type) { case 1: puVar3 = operator_new(0x34); local_8 = 0; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeNormal::vftable; puVar3[0xb] = 0xb4; puVar3[0xc] = 6; goto LAB_00429ed1; } break; case 2: puVar3 = operator_new(0x2c); local_8 = 1; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeIpecac::vftable; goto LAB_00429ed1; } break; case 3: puVar3 = operator_new(0x2c); local_8 = 2; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeBomberman::vftable; goto LAB_00429ed1; } break; case 4: puVar3 = operator_new(0x34); local_8 = 3; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeLudovico::vftable; puVar3[0xb] = 0; puVar3[0xc] = 0; local_8._0_1_ = 5; other = Manager::LoadImage(local_1c,(byte *) "gfx/Items/Collectibles/collectibles_329_theludovicotechnique.png" ); local_8._0_1_ = 6; KAGE::SmartPointer::operator_assign(puVar3 + 0xb,other); local_8._0_1_ = 7; if (((local_18 != (int *)0x0) && (cVar2 = (**(code **)(*local_18 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_1c); } local_8 = CONCAT31(local_8._1_3_,5); piVar1 = (int *)puVar3[0xb]; if ((piVar1[0xc] != 1) || (piVar1[0xd] != 1)) { (**(code **)(*piVar1 + 0x44))(1,1); piVar1[0xc] = 1; piVar1[0xd] = 1; } goto LAB_00429ed1; } break; case 5: puVar3 = operator_new(0x2c); local_8 = 8; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeSumo::vftable; goto LAB_00429ed1; } break; case 6: puVar3 = operator_new(0x2c); local_8 = 9; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeKnockout::vftable; goto LAB_00429ed1; } break; case 7: puVar3 = operator_new(0x2c); local_8 = 10; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeSwordFight::vftable; goto LAB_00429ed1; } break; case 8: puVar3 = operator_new(0x2c); local_8 = 0xb; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeMachineGun::vftable; goto LAB_00429ed1; } break; case 9: puVar3 = operator_new(0x2c); local_8 = 0xc; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeIndigestion::vftable; goto LAB_00429ed1; } break; case 10: puVar3 = operator_new(0x2c); local_8 = 0xd; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeKnifeFight::vftable; goto LAB_00429ed1; } break; case 0xb: puVar3 = operator_new(0x2c); local_8 = 0xe; if (puVar3 != (undefined4 *)0x0) { FUN_0042a350(); *puVar3 = IsaacRepentancePlus::DeathmatchTypeVenom::vftable; goto LAB_00429ed1; } break; default: KAGE_LogMessage(0x10,(byte *)"Unknown type specified\n"); } puVar3 = (undefined4 *)0x0; LAB_00429ed1: this->_type = puVar3; ExceptionList = local_10; return; } //@@ 00429f20 FUN_00429f20 void FUN_00429f20(void) { return; } //@@ 00429f30 FUN_00429f30 int FUN_00429f30(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_0042a040(local_10,param_1); return *piVar1 + 0x14; } //@@ 00429f50 FUN_00429f50 void FUN_00429f50(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0x10); puVar1 = puVar2; } *(int *)*in_ECX = *in_ECX; *(int *)(*in_ECX + 4) = *in_ECX; in_ECX[1] = 0; return; } //@@ 00429f90 FUN_00429f90 void FUN_00429f90(int *param_1) { int iVar1; int iVar2; undefined4 *puVar3; int *piVar4; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1c7d; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; if (in_ECX[1] == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar4 = operator_new(0x10); iVar2 = param_1[1]; piVar4[2] = *param_1; piVar4[3] = iVar2; in_ECX[1] = in_ECX[1] + 1; puVar3 = *(undefined4 **)(iVar1 + 4); *piVar4 = iVar1; piVar4[1] = (int)puVar3; *(int **)(iVar1 + 4) = piVar4; *puVar3 = piVar4; ExceptionList = local_10; return; } //@@ 0042a020 FUN_0042a020 void FUN_0042a020(void) { undefined4 *in_ECX; *in_ECX = 0; return; } //@@ 0042a030 std::bitset::_Xran /* DB: throws "invalid bitset position" */ void std::bitset::_Xran(void) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("invalid bitset position"); } //@@ 0042a040 FUN_0042a040 void FUN_0042a040(int *param_1,int *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; std::set::find_node(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(int *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x18); piVar6[4] = *param_2; *(undefined1 *)(piVar6 + 5) = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_0042a181: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_0042a181; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 0042a210 FUN_0042a210 void FUN_0042a210(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x10); } return; } //@@ 0042a230 FUN_0042a230 void FUN_0042a230(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x18); } return; } //@@ 0042a250 Entity::IsFamiliar /* DB: type (this+0x28)==3 ENTITY_FAMILIAR prototype: db/protos.zhl */ byte __thiscall Entity::IsFamiliar(Entity *this) { return this->_type == 3; } //@@ 0042a260 Entity::Parent /* ZHL [lua] Lua binding Entity:Parent */ EntityPtr __thiscall Entity::Parent(Entity *this) { return this->_parent; } //@@ 0042a270 Room::GetRoomShape /* ZHL [lua] Lua binding Room:GetRoomShape prototype: db/protos.zhl, confirmed by RET 0 */ int __thiscall Room::GetRoomShape(Room *this) { int iVar1; if ((this->_descriptor == (void *)0x0) || (iVar1 = *(int *)((int)this->_descriptor + 0x10), iVar1 == 0)) { return 1; } return *(int *)(iVar1 + 0x48); } //@@ 0042a290 Room::SetGridPath /* ZHL [lua] Lua binding Room:SetGridPath prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::SetGridPath(Room *this,int gridIndex,int value) { if ((uint)gridIndex < 0x1c0) { this->_gridPaths[gridIndex] = value; return 1; } return 0; } //@@ 0042a2c0 Level::IsAltStage /* ZHL [lua] Lua binding Level:IsAltStage */ bool Level::IsAltStage(void) { int in_ECX; return *(int *)(in_ECX + 4) != 0; } //@@ 0042a2d0 Seeds::GetPlayerInitSeed /* ZHL [lua] Lua binding Seeds:GetPlayerInitSeed */ int __thiscall Seeds::GetPlayerInitSeed(Seeds *this) { if (this->_gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } return this->_playerInitSeed; } //@@ 0042a2f0 Entity_Player::GetBatteryCharge /* ZHL [exact] __thiscall int Entity_Player::GetBatteryCharge(int slot); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetBatteryCharge(Entity_Player *this,int slot) { if ((uint)slot < 4) { return this->_activeDesc[slot]._item; } return 0; } //@@ 0042a310 Entity_Player::GetMaxHearts /* ZHL [lua] Lua binding EntityPlayer:GetMaxHearts */ int __thiscall Entity_Player::GetMaxHearts(Entity_Player *this) { return this->_maxHearts; } //@@ 0042a320 Entity_Player::IsCoopGhost /* ZHL [lua] Lua binding EntityPlayer:IsCoopGhost */ byte __thiscall Entity_Player::IsCoopGhost(Entity_Player *this) { return this->_isCoopGhost; } //@@ 0042a330 Game::GetItemPool /* ZHL [lua] Lua binding Game:GetItemPool */ ItemPool * __thiscall Game::GetItemPool(Game *this) { return &this->_itemPool; } //@@ 0042a340 Game::GetSeeds /* ZHL [lua] Lua binding Game:GetSeeds */ Seeds * __thiscall Game::GetSeeds(Game *this) { return &this->_seedEffects; } //@@ 0042a350 FUN_0042a350 void FUN_0042a350(void) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1ceb; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = IsaacRepentancePlus::DeathmatchTypeBase::vftable; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; pvVar1 = operator_new(0x10); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; in_ECX[4] = pvVar1; local_8 = 0; in_ECX[6] = 0; in_ECX[7] = 0; pvVar1 = operator_new(0x10); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; in_ECX[6] = pvVar1; local_8 = CONCAT31(local_8._1_3_,1); in_ECX[8] = 0; in_ECX[9] = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[8] = pvVar1; in_ECX[10] = 0; ExceptionList = local_10; return; } //@@ 0042a430 FUN_0042a430 void FUN_0042a430(byte param_1) { int *this; undefined4 *in_ECX; this = in_ECX + 8; *in_ECX = IsaacRepentancePlus::DeathmatchTypeBase::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); FUN_0042c780(); FUN_0042c780(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x2c); } return; } //@@ 0042a490 FUN_0042a490 void FUN_0042a490(void) { int *this; undefined4 *in_ECX; this = in_ECX + 8; *in_ECX = IsaacRepentancePlus::DeathmatchTypeBase::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); FUN_0042c780(); FUN_0042c780(); return; } //@@ 0042a4d0 DeathmatchTypeBase::Init /* DB: ? DeathmatchTypeLudovico vtable slot 2 directly, DeathmatchTypeNormal slot 2 (FUN_0042d7f0) wraps it; logs 'Error: Game Start Seed was not set.', PlayerManager::init_main_player, SpawnCoPlayer2, HUD::AssignPlayerHUDs, Camera::update_follow */ undefined4 DeathmatchTypeBase::Init(void) { code *pcVar1; Camera *this; Game *pGVar2; int *in_ECX; void *pvVar3; int iVar4; uint uVar5; int *piVar6; int iVar7; undefined4 uVar8; undefined4 uVar9; int iStack_24; Manager *pMStack_20; int *local_1c; undefined4 uStack_18; undefined8 uStack_14; in_ECX[2] = 0xa8c; local_1c = in_ECX; ItemPool::remove_deathmatch_pill_effects(); uVar5 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pGVar2 = g_game; pvVar3 = (g_game->_playerManager)._playerList._end; if ((int)pvVar3 - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (pGVar2->_playerManager)._playerList._end; } piVar6 = (pGVar2->_playerManager)._playerList._begin; if (uVar5 < (uint)((int)pvVar3 - (int)piVar6 >> 2)) { piVar6 = piVar6 + uVar5; } iVar7 = 4; piVar6 = (int *)(*piVar6 + 0x13e0); do { if ((int *)*piVar6 != (int *)0x0) { (**(code **)(*(int *)*piVar6 + 0x14))(); } piVar6 = piVar6 + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); uVar5 = uVar5 + 1; } while (uVar5 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } FUN_009b9150(); piVar6 = local_1c; uVar5 = 0; pMStack_20 = g_manager; iVar4 = (int)(g_manager->_lobbyMembers)._end - (int)(g_manager->_lobbyMembers)._begin; iVar7 = iVar4 >> 0x1f; if (iVar4 / 0x14 + iVar7 != iVar7) { do { pMStack_20 = (Manager *) (**(code **)(*piVar6 + 0x7c)) (*(undefined4 *) ((int)(pMStack_20->_lobbyMembers)._begin + uVar5 * 0x14 + 0xc)); pGVar2 = g_game; iVar7 = *(int *)(*(int *)(iStack_24 + 0x4b278) + 4 + uVar5 * 0x14); if (iVar7 == 0) { uStack_14 = 0; uStack_14._4_4_ = 0; uStack_14._0_4_ = (int *)0x0; uStack_18 = uStack_14._4_4_; local_1c = (int *)uStack_14; } else { uStack_18 = *(undefined4 *)(iVar7 + 0xc); local_1c = *(int **)(iVar7 + 8); } if (uVar5 == 0) { if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player (&pGVar2->_playerManager,(int)pMStack_20,(pGVar2->_seedEffects)._playerInitSeed); pGVar2 = g_game; pMStack_20 = *(Manager **)(*piVar6 + 0x78); if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); } (*(code *)pMStack_20)(*(undefined4 *)(pGVar2->_playerManager)._playerList._begin,&local_1c); } else { pcVar1 = *(code **)(*piVar6 + 0x78); uVar8 = PlayerManager::SpawnCoPlayer2(&g_game->_playerManager,pMStack_20); (*pcVar1)(uVar8,&pMStack_20); } uVar5 = uVar5 + 1; } while (uVar5 < (uint)(((int)(pMStack_20->_lobbyMembers)._end - (int)(pMStack_20->_lobbyMembers)._begin) / 0x14)); } pGVar2 = g_game; (g_game->_playerManager)._coopSlots[0]._controllerIndex = -1; (pGVar2->_playerManager)._coopSlots[1]._controllerIndex = -1; (pGVar2->_playerManager)._coopSlots[0]._state = -1; (pGVar2->_playerManager)._coopSlots[0]._menuPosition = 0.0; (pGVar2->_playerManager)._coopSlots[0]._playerType = 0; (pGVar2->_playerManager)._coopSlots[1]._state = -1; (pGVar2->_playerManager)._coopSlots[1]._menuPosition = 0.0; (pGVar2->_playerManager)._coopSlots[1]._playerType = 0; (pGVar2->_playerManager)._coopSlots[2]._controllerIndex = -1; (pGVar2->_playerManager)._coopSlots[2]._state = -1; (pGVar2->_playerManager)._coopSlots[2]._menuPosition = 0.0; (pGVar2->_playerManager)._coopSlots[2]._playerType = 0; (pGVar2->_playerManager)._coopSlots[3]._controllerIndex = -1; (pGVar2->_playerManager)._coopSlots[3]._state = -1; (pGVar2->_playerManager)._coopSlots[3]._menuPosition = 0.0; (pGVar2->_playerManager)._coopSlots[3]._playerType = 0; HUD::AssignPlayerHUDs(&pGVar2->_hud); FUN_00943830(); this = *(Camera **)((int)g_game->_room + 0x11f8); iVar7 = (g_manager->_optionsConfig)._cameraStyle; if ((iVar7 == 1) || (iVar7 != 2)) { Camera::update_focus_position(this,0); this->_shouldOverride = 0; } else { Camera::update_follow(this); } uVar8 = 1; HUD::mark_all_slots_dirty(&g_game->_hud,1,1); uVar9 = 0x42a832; text_image_cache_reset(&(g_game->_hud)._statHUD); FUN_009a8a40(uVar8,uVar9); iVar7 = *(int *)((int)g_game->_room + 4); if (((iVar7 == 0) || (iVar7 = *(int *)(iVar7 + 0x10), iVar7 == 0)) || (((iVar7 = *(int *)(iVar7 + 0x48), iVar7 != 8 && (((iVar7 != 0xb && (iVar7 != 0xc)) && (iVar7 != 9)))) && (iVar7 != 10)))) { uVar5 = Random(); uVar5 = uVar5 % 5 + 8; } else { uVar5 = Random(); uVar5 = uVar5 % 6 + 5; } piVar6[10] = uVar5 * 0x1e; return CONCAT31((int3)(uVar5 / 9),1); } //@@ 0042a8b0 DeathmatchTypeBase::Update /* DB: DeathmatchTypeBase vtable slot 4 (shared by all DeathmatchType* except Normal, whose slot 4 0042d850 wraps it): sudden-death countdown this[2], every 30 frames Game::SpawnEx(819 ENTITY_FLY_BOMB) at Room::GetRandomPosition and every 4th wave GridEntity_Spikes at free tiles away from players; this[10] timer calls slot 32 (spawn_random_pickup) every 5..13 s */ void DeathmatchTypeBase::Update(void) { Room *this; undefined4 *puVar1; uint uVar2; uint uVar3; Vector *pVVar4; int *piVar5; GridEntity *pGVar6; int *in_ECX; void *pvVar7; int iVar8; Game *pGVar9; int iVar10; PlayerManager *pPVar11; float fVar12; float fVar13; float fVar14; float fVar15; Vector local_38; Vector local_30; Vector local_28; GridEntity *local_20; float local_1c; float local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1d27; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar10 = in_ECX[2] + -1; in_ECX[2] = iVar10; if ((float)in_ECX[3] < 1.0) { in_ECX[3] = (int)((float)in_ECX[3] + 0.033333335); } if (iVar10 < 0) { if (iVar10 % 0x1e == 0) { iVar10 = (int)((ulonglong)((longlong)iVar10 * 0x77777777) >> 0x20) - iVar10; local_14 = in_ECX; uVar3 = Random(); pVVar4 = Room::GetRandomPosition(g_game->_room,&local_28,0.0); Game::SpawnEx(g_game,0x333,0,pVVar4,&g_vectorZero,(Entity *)0x0,0,uVar3,0); uVar3 = (iVar10 >> 4) - (iVar10 >> 0x1f) & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } if (uVar3 == 0) { local_20 = (GridEntity *)0xa; pGVar9 = g_game; do { this = pGVar9->_room; local_20 = (GridEntity *)((int)&local_20[-1]._sprite._bitflags + 3); pVVar4 = Room::GetRandomPosition(this,&local_30,0.0); pVVar4 = Room::FindFreeTilePosition(this,&local_38,pVVar4,0.0); uVar3 = 0; pPVar11 = &g_game->_playerManager; fVar13 = pVVar4->x; fVar15 = pVVar4->y; pGVar9 = g_game; local_1c = fVar15; local_18 = fVar13; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar11->_playerList)._begin >> 2 == 0) { LAB_0042aa81: pvVar7 = pGVar9->_room; iVar10 = (int)((fVar15 - 120.0) / 40.0 + 0.5); iVar8 = (int)((fVar13 - 40.0) / 40.0 + 0.5); if ((((iVar8 < 0) || (*(int *)((int)pvVar7 + 0xc) <= iVar8)) || (iVar10 < 0)) || (*(int *)((int)pvVar7 + 0x10) <= iVar10)) { uVar3 = 0xffffffff; local_18 = (float)Random(); LAB_0042ab07: KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } else { uVar3 = *(int *)((int)pvVar7 + 0xc) * iVar10 + iVar8; local_18 = (float)Random(); if (((int)uVar3 < 0) || (0x1bf < (int)uVar3)) goto LAB_0042ab07; } in_ECX = local_14; if ((uVar3 < 0x1c0) && (*(int *)((int)pvVar7 + uVar3 * 4 + 0x76c) < 0x385)) { pGVar6 = operator_new(0x158); local_8 = 0xd; local_20 = pGVar6; if (pGVar6 == (GridEntity *)0x0) { pGVar6 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar6); *(undefined ***)pGVar6 = IsaacRepentancePlus::GridEntity_Spikes::vftable; } local_8 = 0xffffffff; in_ECX = local_14; if (pGVar6 != (GridEntity *)0x0) { (pGVar6->_desc)._type = 9; pGVar6->_gridIndex = uVar3; puVar1 = *(undefined4 **)((int)pvVar7 + uVar3 * 4 + 0x24); if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); } *(GridEntity **)((int)pvVar7 + uVar3 * 4 + 0x24) = pGVar6; (pGVar6->_desc)._spawnSeed = (int)local_18; iVar10 = *(int *)pGVar6; (pGVar6->_desc)._variant = 0; (pGVar6->_desc)._varData = 0; pGVar6->_collisionClass = 0; (**(code **)(iVar10 + 0x20))(); pGVar9 = g_game; piVar5 = &(pGVar6->_desc)._spawnCount; *piVar5 = *piVar5 + 1; (pGVar6->_desc)._initialized = 1; pGVar6->_spawnFrame = pGVar9->_frameCount; in_ECX = local_14; } } break; } while( true ) { pvVar7 = (pPVar11->_playerList)._end; if ((int)pvVar7 - (int)(pPVar11->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (pPVar11->_playerList)._end; pGVar9 = g_game; fVar13 = local_18; fVar15 = local_1c; } piVar5 = (pPVar11->_playerList)._begin; if (uVar3 < (uint)((int)pvVar7 - (int)piVar5 >> 2)) { piVar5 = piVar5 + uVar3; } fVar14 = fVar13 - *(float *)(*piVar5 + 0x33c); fVar12 = fVar15 - *(float *)(*piVar5 + 0x340); if (fVar12 * fVar12 + fVar14 * fVar14 < 144.0) break; pPVar11 = &pGVar9->_playerManager; uVar3 = uVar3 + 1; if ((uint)((int)(pGVar9->_playerManager)._playerList._end - (int)(pPVar11->_playerList)._begin >> 2) <= uVar3) goto LAB_0042aa81; } } while (local_20 != (GridEntity *)0x0); } } iVar10 = in_ECX[2]; fVar13 = (float)(-iVar10 % 0xf) / 15.0; iVar10 = (int)((ulonglong)((longlong)iVar10 * 0x77777777) >> 0x20) - iVar10; in_ECX[3] = (int)fVar13; if ((~((char)(iVar10 >> 3) - (char)(iVar10 >> 0x1f)) & 1U) != 0) { in_ECX[3] = (int)(1.0 - fVar13); } } if ((*(byte *)(in_ECX + 1) & 1) != 0) { piVar5 = in_ECX + 10; *piVar5 = *piVar5 + -1; if (*piVar5 == 0) { (**(code **)(*in_ECX + 0x80))(uVar2); iVar10 = *(int *)((int)g_game->_room + 4); if (((iVar10 == 0) || (iVar10 = *(int *)(iVar10 + 0x10), iVar10 == 0)) || (((iVar10 = *(int *)(iVar10 + 0x48), iVar10 != 8 && (((iVar10 != 0xb && (iVar10 != 0xc)) && (iVar10 != 9)))) && (iVar10 != 10)))) { uVar2 = Random(); iVar10 = uVar2 % 5 + 8; } else { uVar2 = Random(); iVar10 = uVar2 % 6 + 5; } in_ECX[10] = iVar10 * 0x1e; } } ExceptionList = local_10; return; } //@@ 0042aca0 FUN_0042aca0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0042aca0(void) { int iVar1; int in_ECX; float fVar2; KColor local_98; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; Font *local_68; float local_64; float local_60; Vector local_5c; byte local_54 [64]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1d5d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_54 + 0x50); ExceptionList = &local_10; local_68 = &g_manager->_font2_TeamMeatEx12; local_60 = (g_game->_screenShakeOffset).x; local_5c.y = (g_game->_screenShakeOffset).y; local_64 = (1.0 - (g_manager->_optionsConfig)._hudOffset) * -24.0; sprintf_s(local_54,0x40,(byte *)"%02d:%02d"); fVar2 = 0.5; local_98._alpha = *(float *)(in_ECX + 0xc); local_5c.y = local_64 + 30.0 + local_5c.y; local_5c.x = DAT_00c7997c * 0.5 + local_60; if (*(int *)(in_ECX + 8) < 1) { local_98._green = 0.0; local_98._blue = 0.0; } else { local_98._green = 1.0; local_98._blue = 1.0; } local_98._red = 1.0; local_98._unk = 0; iVar1 = Font::get_string_width_n(local_68,local_54,-1); local_84 = 0; local_80 = 0xffff; local_7c = 0; local_78 = 0x3f800000; local_74 = 0xffffffff; local_70 = 0; local_6c = 0; local_5c.x = local_5c.x - (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) * fVar2; local_8 = 0; Font::DrawStringScaled(local_68,local_54,&local_5c,&local_98,&local_84); ExceptionList = local_10; return; } //@@ 0042ae90 FUN_0042ae90 bool FUN_0042ae90(void) { PlayerManager *this; uint uVar1; Entity_Player *pEVar2; uint index; uint uVar3; this = &g_game->_playerManager; uVar3 = 0; uVar1 = PlayerManager::count_main_players(this); index = 0; if (uVar1 != 0) { do { pEVar2 = PlayerManager::get_main_player(this,index); if (((pEVar2->_dead == 0) && (pEVar2->_isCoopGhost == 0)) && ((pEVar2->_parent == (EntityPtr)0x0 || (*(int *)((int)pEVar2->_parent + 0x28) != 1)))) { uVar3 = uVar3 + 1; } index = index + 1; } while (index < uVar1); } return uVar3 < 2; } //@@ 0042af00 FUN_0042af00 undefined8 FUN_0042af00(void) { Game *pGVar1; char cVar2; uint uVar3; uint uVar4; Entity_Player *pEVar5; int iVar6; uint index; undefined4 uVar7; undefined4 uVar8; int local_20; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar1 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00af1d9d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; index = 0; uVar4 = PlayerManager::count_main_players(&g_game->_playerManager); if (uVar4 != 0) { do { pEVar5 = PlayerManager::get_main_player(&pGVar1->_playerManager,index); if ((pEVar5->_dead == 0) && (pEVar5->_isCoopGhost == 0)) { InputManager::get_device(&PTR_vftable_00c57b18,&local_20,pEVar5->_controllerIndex); local_8 = 0; if (local_20 != 0) { iVar6 = __RTDynamicCast(local_20,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0,uVar3 ); if ((iVar6 != 0) && (iVar6 = *(int *)(iVar6 + 0x374), iVar6 != 0)) { uVar7 = *(undefined4 *)(iVar6 + 8); uVar8 = *(undefined4 *)(iVar6 + 0xc); goto LAB_0042afd7; } } local_18 = 0; local_18._0_4_ = 0; local_18._4_4_ = 0; uVar7 = (undefined4)local_18; uVar8 = local_18._4_4_; LAB_0042afd7: local_8 = 1; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_20); } } ExceptionList = local_10; return CONCAT44(uVar8,uVar7); } index = index + 1; } while (index < uVar4); } ExceptionList = local_10; return 0; } //@@ 0042b020 FUN_0042b020 undefined4 FUN_0042b020(int param_1) { if (param_1 < 0xe9) { if (param_1 != 0xe8) { switch(param_1) { case 0xb: case 0x15: case 0x2c: case 0x36: case 0x3c: case 0x40: case 0x4c: case 0x51: case 0x54: case 0x5b: case 0x5e: case 0x60: case 0x62: case 0x7f: case 0x83: case 0x85: case 0x86: case 0x87: case 0x90: case 0x9e: case 0xa1: case 0xad: case 0xaf: case 0xb1: case 0xcb: case 0xd2: case 0xd4: case 0xd7: break; default: goto LAB_0042b067; } } LAB_0042b061: return 1; } if (param_1 - 0xeaU < 0x1ec) { /* WARNING (jumptable): Sanity check requires truncation of jumptable */ /* WARNING: Could not find normalized switch variable to match jumptable */ switch(*(undefined1 *)(param_1 + 0x42b066)) { case 0: goto LAB_0042b061; } } LAB_0042b067: return 0; } //@@ 0042b340 FUN_0042b340 undefined4 FUN_0042b340(undefined4 param_1) { switch(param_1) { case 3: case 4: case 5: case 7: case 0xd: case 0x11: case 0x12: case 0x14: case 0x15: case 0x17: case 0x1c: case 0x20: case 0x2b: case 0x2e: case 0x35: case 0x37: case 0x38: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3f: case 0x43: case 0x44: case 0x48: case 0x4a: case 0x4b: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x58: case 0x66: case 0x6b: case 0x6e: case 0x6f: case 0x70: case 0x77: case 0x78: case 0x79: case 0x7b: case 0x7c: case 0x87: case 0x89: case 0x8a: case 0x8e: case 0x8f: case 0x92: case 0x96: case 0x97: case 0x98: case 0x9a: case 0x9b: case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa5: case 0xa7: case 0xa8: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xb1: case 0xb6: case 0xb8: case 0xbb: case 0xbc: return 1; default: return 0; } } //@@ 0042b430 FUN_0042b430 undefined4 FUN_0042b430(undefined4 param_1) { switch(param_1) { case 0x13: case 0x17: case 0x19: case 0x1f: case 0x29: case 0x2a: return 1; default: return 0; } } //@@ 0042b480 FUN_0042b480 undefined4 FUN_0042b480(undefined4 param_1) { switch(param_1) { case 1: case 5: case 10: case 0x12: case 0x13: case 0x14: case 0x16: case 0x1f: case 0x22: case 0x24: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x32: case 0x33: case 0x36: case 0x39: case 0x3a: case 0x3c: case 0x3e: case 0x42: case 0x43: case 0x45: case 0x48: case 0x4a: case 0x4d: case 0x4e: case 0x52: case 0x53: case 0x56: case 0x59: case 0x5b: case 0x5f: case 0x61: return 1; default: return 0; } } //@@ 0042b520 FUN_0042b520 undefined4 FUN_0042b520(void) { int iVar1; undefined4 uVar2; iVar1 = PlayerManager::count_main_players(&g_game->_playerManager); uVar2 = 8; if (iVar1 == 2) { uVar2 = 1; } return uVar2; } //@@ 0042b550 FUN_0042b550 int FUN_0042b550(void) { int in_ECX; return in_ECX + 0x10; } //@@ 0042b560 ItemPool::ReplaceBlacklistedPickup /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? for pickup variant 300/350 rerolls card/trinket until not blocked; SpawnEx, Pickup::Morph */ void __thiscall ItemPool::ReplaceBlacklistedPickup(ItemPool *this,int *param_2,uint *param_3,uint *param_4) { code *pcVar1; bool bVar2; char cVar3; uint uVar4; int iVar5; uint uVar6; undefined8 local_38; int local_30; uint local_2c; ItemPool *local_28; uint *local_24; uint local_20; RNG local_1c; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); local_24 = param_4; uVar4 = Random(); local_38 = 0x900000005; local_20 = 7; if (*param_2 != 5) { return; } uVar6 = *param_3; if (300 < uVar6) { if (uVar6 != 0x15e) { return; } while ((*param_4 == 0 || (cVar3 = (**(code **)(this->_seed + 0x2c))(*param_4), cVar3 != '\0'))) { uVar4 = GetTrinket(&g_game->_itemPool,0); *param_4 = uVar4; } return; } if (uVar6 == 300) { while ((*param_4 == 0 || (cVar3 = (**(code **)(this->_seed + 0x24))(*param_4), cVar3 != '\0'))) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> ((byte)local_38 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)((ulonglong)local_38 >> 0x20) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_20 & 0x1f) ^ uVar4; iVar5 = GetCardEx(uVar4,0x19,10,10,1); local_1c._shift1 = 5; local_1c._shift2 = 9; local_1c._shift3 = 7; local_1c._seed = uVar4; uVar6 = lua_callback_run_get_card(&local_1c,iVar5,1,1,0); *param_4 = uVar6; } return; } if (uVar6 == 0x46) { uVar6 = *param_4; local_2c = uVar6 >> 0xb; while( true ) { if (uVar6 != 0) { pcVar1 = *(code **)(this->_seed + 0x28); iVar5 = GetPillEffect(&g_game->_itemPool,uVar6,(Entity_Player *)0x0); cVar3 = (*pcVar1)(iVar5); if (cVar3 == '\0') { return; } param_4 = local_24; } local_28 = &g_game->_itemPool; if (uVar4 == 0) break; uVar4 = uVar4 >> ((byte)local_38 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)((ulonglong)local_38 >> 0x20) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_20 & 0x1f) ^ uVar4; uVar6 = GetPill(uVar4); uVar6 = uVar6 | (local_2c & 1) << 0xb; *param_4 = uVar6; } KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } if (uVar6 != 100) { return; } uVar4 = *param_4; if ((uVar4 == 0x19) || (((local_20 = uVar4, std::set::find_node(&local_38,&local_20), *(char *)(local_30 + 0xd) == '\0' && (*(int *)(local_30 + 0x10) <= (int)uVar4)) && (local_30 != this->_pools[0]._rng1._shift3)))) { bVar2 = false; } else { bVar2 = true; } if ((uVar4 == 0) || (bVar2)) { uVar4 = (**(code **)(this->_seed + 0x84))(0); *param_4 = uVar4; } return; } //@@ 0042b770 FUN_0042b770 void FUN_0042b770(void) { code *pcVar1; Vector *pVVar2; int *in_ECX; Vector local_10; pcVar1 = *(code **)(*in_ECX + 0x38); pVVar2 = Room::GetRandomPosition(g_game->_room,&local_10,40.0); (*pcVar1)(pVVar2,0); return; } //@@ 0042b7c0 FUN_0042b7c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ Entity * FUN_0042b7c0(Vector *param_1,float param_2) { void *pvVar1; Manager *pMVar2; uint subType; uint uVar3; Entity *this; ColorMod *color; int *in_ECX; int iVar4; int iVar5; int iStack_48; Vector VStack_44; Color CStack_3c; uint local_c; local_c = __security_cookie ^ (uint)&iStack_48; subType = (**(code **)(*in_ECX + 0x84))(1); if (subType == 0) { return (Entity *)0x0; } Room::FindFreePickupSpawnPosition(g_game->_room,&VStack_44,param_1,param_2,0,0,0); pvVar1 = g_game->_room; iVar5 = (int)((VStack_44.x - 40.0) / 40.0 + 0.5); iVar4 = (int)((VStack_44.y - 120.0) / 40.0 + 0.5); if ((((-1 < iVar5) && (iVar5 < *(int *)((int)pvVar1 + 0xc))) && (-1 < iVar4)) && ((iVar4 < *(int *)((int)pvVar1 + 0x10) && (uVar3 = *(int *)((int)pvVar1 + 0xc) * iVar4 + iVar5, uVar3 < 0x1c0)))) { *(undefined4 *)((int)pvVar1 + uVar3 * 4 + 0x76c) = 900; } uVar3 = Random(); this = Game::SpawnEx(g_game,5,100,&VStack_44,&g_vectorZero,(Entity *)0x0,subType,uVar3,0); pMVar2 = g_manager; iStack_48 = 0x50; seed_fart_sound_override(&iStack_48); SoundEffects::Play(&pMVar2->_sfxManager,iStack_48,1.0,2,0,1.0,0.0); Color::Color(&CStack_3c); Entity::MakeGroundPoof(this,&this->_pos,color,0.3); return this; } //@@ 0042b940 FUN_0042b940 void FUN_0042b940(int param_1) { int iVar1; iVar1 = *(int *)(param_1 + 4); if (iVar1 < 0x14f) { if (iVar1 == 0x14e) { *(undefined4 *)(param_1 + 0x5c) = 10; *(undefined4 *)(param_1 + 0x58) = 10; return; } if (iVar1 == 0x81) { *(undefined4 *)(param_1 + 0x5c) = 10; return; } if (iVar1 == 0x12d) { *(undefined4 *)(param_1 + 0x60) = 2; return; } } else if (iVar1 == 0x1ac) { *(undefined4 *)(param_1 + 0x60) = 4; } return; } //@@ 0042b9a0 FUN_0042b9a0 void FUN_0042b9a0(int *param_1) { int iVar1; iVar1 = param_1[10]; if (iVar1 == 3) { switch(param_1[0xb]) { case 0x10: (**(code **)(*param_1 + 0x40))(0x41200000); return; case 0x23: case 0x5d: code_r0x0042b9e1: (**(code **)(*param_1 + 0x40))(0x40e00000); return; case 0x2c: case 0x2d: case 0x2e: (**(code **)(*param_1 + 0x40))(0x40400000); return; case 0x2f: case 0x3c: LAB_0042ba14: (**(code **)(*param_1 + 0x40))(0x40c00000); return; case 0x3a: case 0x3b: (**(code **)(*param_1 + 0x40))(0x41a00000); return; case 0x6b: (**(code **)(*param_1 + 0x40))(0x40a00000); } } else if (iVar1 == 7) { iVar1 = param_1[0xf2]; if (((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 3)) && (*(int *)(iVar1 + 0x2c) == 6)) { (**(code **)(*param_1 + 0x40))(0x40000000); return; } } else if (iVar1 == 1000) { switch(param_1[0xb]) { case 10: case 0x34: goto code_r0x0042b9e1; case 0x25: (**(code **)(*param_1 + 0x40))(0x40800000); return; case 0x4e: goto LAB_0042ba14; case 0x7f: case 0xca: (**(code **)(*param_1 + 0x40))(0x41f00000); return; } } return; } //@@ 0042bc00 FUN_0042bc00 undefined1 FUN_0042bc00(void) { return 1; } //@@ 0042bc10 FUN_0042bc10 float10 FUN_0042bc10(void) { return (float10)1; } //@@ 0042bc20 FUN_0042bc20 bool FUN_0042bc20(undefined4 param_1,Entity_Player *param_2) { byte bVar1; bVar1 = Entity_Player::HasCollectible(param_2,0x2b2,0); return bVar1 != 0; } //@@ 0042bc40 FUN_0042bc40 void FUN_0042bc40(Entity *param_1) { uint *puVar1; qword qVar2; byte bVar3; Vector local_10; local_10.x = (param_1->_velocity).x; local_10.y = (param_1->_velocity).y; bVar3 = Entity::is_grid_collision_at(param_1,&local_10); if (bVar3 != 0) { qVar2 = param_1->_flags; puVar1 = (uint *)((int)¶m_1->_flags + 4); *puVar1 = *puVar1 & 0xffff7fff; *(int *)¶m_1->_flags = (int)qVar2; } return; } //@@ 0042bc90 FUN_0042bc90 void FUN_0042bc90(void) { return; } //@@ 0042bca0 FUN_0042bca0 void FUN_0042bca0(Entity_Player *param_1) { int *piVar1; int iVar2; void **ppvVar3; iVar2 = (int)(param_1->_history)._historyItems._end - (int)(param_1->_history)._historyItems._begin; if (iVar2 / 0x1c + (iVar2 >> 0x1f) != iVar2 >> 0x1f) { do { Entity_Player::RemoveCollectibleByHistoryIndex(param_1,0,(byte)iVar2); iVar2 = (int)(param_1->_history)._historyItems._end - (int)(param_1->_history)._historyItems._begin; } while (iVar2 / 0x1c + (iVar2 >> 0x1f) != iVar2 >> 0x1f); } if (1 < *(int *)&g_game->_deathmatchManager) { ppvVar3 = param_1->_weapons; iVar2 = 4; do { ppvVar3 = ppvVar3 + 1; if (*ppvVar3 != (int *)0x0) { (**(code **)(*(int *)*ppvVar3 + 0x14))(); if (*ppvVar3 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*ppvVar3)(1); } *ppvVar3 = (void *)0x0; } iVar2 = iVar2 + -1; } while (iVar2 != 0); if (DAT_00c73670 != (undefined4 *)0x0) { piVar1 = (int *)(**(code **)*DAT_00c73670)(); (**(code **)(*piVar1 + 4))(0x10,param_1); param_1->_weapons[1] = piVar1; return; } param_1->_weapons[1] = (void *)0x0; } return; } //@@ 0042bd70 DeathmatchTypeBase::StoreGameState /* DB: ? round 7 agent */ void DeathmatchTypeBase::StoreGameState(int *param_1) { undefined4 *puVar1; int iVar2; int in_ECX; iVar2 = (int)param_1; *(undefined4 *)((int)param_1 + 0x1fde4) = *(undefined4 *)((int)param_1 + 0x1fde0); param_1 = (int *)**(int **)(in_ECX + 0x20); if (param_1 != *(int **)(in_ECX + 0x20)) { do { puVar1 = *(undefined4 **)(iVar2 + 0x1fde4); if (puVar1 == *(undefined4 **)(iVar2 + 0x1fde8)) { std::vector::_Emplace_reallocate(puVar1,(undefined4 *)((int)param_1 + 0x10)); } else { *puVar1 = *(undefined4 *)((int)param_1 + 0x10); *(int *)(iVar2 + 0x1fde4) = *(int *)(iVar2 + 0x1fde4) + 4; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } while (param_1 != (int *)*(int *)(in_ECX + 0x20)); } return; } //@@ 0042bdf0 DeathmatchTypeBase::RestoreGameState /* DB: ? vtable slot 29 of DeathmatchTypeBase and all 11 DeathmatchType* subclasses (no direct callers); clears the std::set at this+0x20 and refills it from the vector at GameState+0x1fde0..0x1fde4 (param_1); slot 28 (0042bd70) is the matching store that copies the set into GameState+0x1fde0 (GameState::~GameState frees that vector) */ void DeathmatchTypeBase::RestoreGameState(int param_1) { int iVar1; int *piVar2; uint uVar3; int *piVar4; int in_ECX; int *piVar5; int *piVar6; int *piVar7; int *piVar8; int *local_30; int local_2c; int *local_28; int *local_24; undefined4 local_20; int *local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1dcd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar1 = *(int *)(in_ECX + 0x20); piVar8 = (int *)(in_ECX + 0x20); local_14 = piVar8; FID_conflict__Erase_tree_>_> (piVar8,(fuzzer_allocator_> *)piVar8, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0x24) = 0; local_18 = *(int **)(param_1 + 0x1fde0); if (local_18 != *(int **)(param_1 + 0x1fde4)) { do { piVar6 = local_18; std::set::find_node(&local_30,local_18); if ((*(char *)((int)local_28 + 0xd) != '\0') || (piVar4 = local_28, *piVar6 < local_28[4])) { if (piVar8[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } iVar1 = *piVar8; local_24 = local_14; local_8 = 0; local_20 = 0; piVar4 = operator_new(0x18); piVar8 = local_14; local_8 = 0xffffffff; local_20 = 0; piVar4[4] = *piVar6; *(undefined1 *)(piVar4 + 5) = 0; *piVar4 = iVar1; piVar4[1] = iVar1; piVar4[2] = iVar1; *(undefined2 *)(piVar4 + 3) = 0; local_1c = (int *)*local_14; local_14[1] = local_14[1] + 1; piVar4[1] = (int)local_30; if (local_30 == local_1c) { *local_1c = (int)piVar4; local_1c[1] = (int)piVar4; local_1c[2] = (int)piVar4; *(undefined1 *)(piVar4 + 3) = 1; } else { if (local_2c == 0) { local_30[2] = (int)piVar4; if (local_30 == (int *)local_1c[2]) { local_1c[2] = (int)piVar4; } } else { *local_30 = (int)piVar4; if (local_30 == (int *)*local_1c) { *local_1c = (int)piVar4; } } piVar7 = piVar4; if (*(char *)(piVar4[1] + 0xc) == '\0') { do { piVar6 = (int *)piVar7[1]; piVar5 = *(int **)piVar6[1]; if (piVar6 == piVar5) { piVar5 = (int *)((undefined4 *)piVar6[1])[2]; if ((char)piVar5[3] == '\0') goto LAB_0042bfa6; if (piVar7 == (int *)piVar6[2]) { FUN_00415fe0(piVar6); piVar7 = piVar6; } *(undefined1 *)(piVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; piVar6 = *(int **)(piVar7[1] + 4); piVar5 = (int *)*piVar6; *piVar6 = piVar5[2]; if (*(char *)(piVar5[2] + 0xd) == '\0') { *(int **)(piVar5[2] + 4) = piVar6; } piVar5[1] = piVar6[1]; iVar1 = *piVar8; if (piVar6 == *(int **)(iVar1 + 4)) { *(int **)(iVar1 + 4) = piVar5; piVar5[2] = (int)piVar6; } else { piVar2 = (int *)piVar6[1]; if (piVar6 == (int *)piVar2[2]) { piVar2[2] = (int)piVar5; piVar5[2] = (int)piVar6; } else { *piVar2 = (int)piVar5; piVar5[2] = (int)piVar6; } } LAB_0042c01a: piVar6[1] = (int)piVar5; } else { if ((char)piVar5[3] != '\0') { if (piVar7 == (int *)*piVar6) { FUN_00415f80(piVar6); piVar7 = piVar6; } *(undefined1 *)(piVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; piVar6 = *(int **)(piVar7[1] + 4); piVar5 = (int *)piVar6[2]; piVar6[2] = *piVar5; if (*(char *)(*piVar5 + 0xd) == '\0') { *(int **)(*piVar5 + 4) = piVar6; } piVar5[1] = piVar6[1]; iVar1 = *piVar8; if (piVar6 == *(int **)(iVar1 + 4)) { *(int **)(iVar1 + 4) = piVar5; } else { piVar2 = (int *)piVar6[1]; if (piVar6 == (int *)*piVar2) { *piVar2 = (int)piVar5; } else { piVar2[2] = (int)piVar5; } } *piVar5 = (int)piVar6; goto LAB_0042c01a; } LAB_0042bfa6: *(undefined1 *)(piVar6 + 3) = 1; *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; piVar7 = *(int **)(piVar7[1] + 4); } } while (*(char *)(piVar7[1] + 0xc) == '\0'); piVar6 = local_18; } *(undefined1 *)(local_1c[1] + 0xc) = 1; piVar8 = local_14; } } local_18 = piVar6 + 1; *(undefined1 *)(piVar4 + 5) = 1; } while (local_18 != *(int **)(param_1 + 0x1fde4)); } ExceptionList = local_10; return; } //@@ 0042c070 FUN_0042c070 void FUN_0042c070(Entity_Player *param_1,ulonglong *param_2) { uint uVar1; int *ptr; Manager *pMVar2; uint uVar3; Entity_Player *pEVar4; int in_ECX; undefined4 uVar5; float local_10; float local_c; local_c = 0.0; local_10 = 0.0; uVar1 = *(uint *)(in_ECX + 0x1c); if (uVar1 == 0) { KAGE_LogMessage(8,(byte *)"No spawnpoints to place player at, add more spawnpoints\n"); } else { uVar3 = Random(); ptr = (int *)**(undefined4 **)(in_ECX + 0x18); for (uVar3 = uVar3 % uVar1; uVar3 != 0; uVar3 = uVar3 - 1) { ptr = (int *)*ptr; } local_10 = (float)ptr[2]; local_c = (float)ptr[3]; *(int *)ptr[1] = *ptr; *(int *)(*ptr + 4) = ptr[1]; *(int *)(in_ECX + 0x1c) = *(int *)(in_ECX + 0x1c) + -1; operator_delete(ptr,0x10); } pMVar2 = g_manager; uVar5 = 0; (param_1->_pos).x = local_10; (param_1->_pos).y = local_c; pEVar4 = PlayerManager::get_player_by_user_id((PlayerManager *)&pMVar2->_netplayManager,param_2); Entity_Player::SetControllerIndex(param_1,(pEVar4->_damageEvents)._end,uVar5); Entity_Player::InitPostLevelInitStats(param_1); Entity_Player::AddMaxHearts(param_1,0x50 - param_1->_maxHearts,1); Entity_Player::SetFullHearts(param_1); return; } //@@ 0042c160 FUN_0042c160 undefined4 FUN_0042c160(void) { return 0; } //@@ 0042c170 DeathmatchTypeBase::spawn_random_pickup /* DB: DeathmatchType* vtable slot 32 (all 12 classes); counts room pickups (variant!=100), caps at 4 (9 in big room shapes 8..12), then Room::FindFreePickupSpawnPosition around room centre and Game::SpawnEx(5, variant ..) ; called through slot 0x80 by DeathmatchTypeBase::Update */ Entity * DeathmatchTypeBase::spawn_random_pickup(void) { float fVar1; int iVar2; Room *this; qword qVar3; int iVar4; undefined4 uVar5; int *piVar6; uint uVar7; Entity *pEVar8; int *in_ECX; void *pvVar9; uint uVar10; qword *pqVar11; Game *pGVar12; uint uVar13; PlayerManager *pPVar14; Vector local_2c; undefined1 local_24 [12]; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1df0; local_10 = ExceptionList; ExceptionList = &local_10; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_24,5,-1,-1,0,0); uVar10 = 0; uVar13 = 0; uVar7 = uVar10; if (local_18 != 0.0) { do { uVar10 = uVar7 + 1; if (*(int *)(*(int *)(local_24._4_4_ + uVar13 * 4) + 0x2c) == 100) { uVar10 = uVar7; } uVar13 = uVar13 + 1; uVar7 = uVar10; } while (uVar13 < (uint)local_18); } iVar4 = *(int *)((int)g_game->_room + 4); if (iVar4 != 0) { if (*(int *)(iVar4 + 0x10) == 0) { LAB_0042c228: iVar4 = *(int *)(iVar4 + 0x10); if (iVar4 == 0) goto LAB_0042c24b; } else { iVar2 = *(int *)(*(int *)(iVar4 + 0x10) + 0x48); if ((((iVar2 == 8) || (iVar2 == 0xb)) || (iVar2 == 0xc)) || ((iVar2 == 9 || (iVar2 == 10)))) { if (9 < uVar10) goto LAB_0042c250; if (iVar4 == 0) goto LAB_0042c24b; goto LAB_0042c228; } iVar4 = *(int *)(iVar4 + 0x10); } iVar4 = *(int *)(iVar4 + 0x48); if (((iVar4 == 8) || (iVar4 == 0xb)) || ((iVar4 == 0xc || ((iVar4 == 9 || (iVar4 == 10)))))) goto LAB_0042c281; } LAB_0042c24b: if (4 < uVar10) { LAB_0042c250: if (local_24[0] == '\0') { local_8 = 0; tracked_alloc(1,(void *)local_24._4_4_,0); } ExceptionList = local_10; return (Entity *)0x0; } LAB_0042c281: if (local_24[0] == '\0') { if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_24._4_4_ != (void *)0x0) { uVar10 = *(uint *)(local_24._4_4_ + -4); qVar3 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 - uVar10; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) - (uint)((uint)qVar3 < uVar10); free((void *)(local_24._4_4_ + -4)); } local_8 = 0xffffffff; } uVar10 = 10; iVar4 = (**(code **)(*in_ECX + 0x88))(); if (iVar4 == 0) { uVar5 = (**(code **)(*in_ECX + 0x88))(); switch(uVar5) { case 1: uVar10 = 0x14; break; case 2: uVar10 = 0x1e; break; case 3: uVar10 = 0x28; } } else if (iVar4 == 1) { iVar4 = (**(code **)(*in_ECX + 0x88))(); if (iVar4 == 0) { uVar10 = 0x45; } else if (iVar4 == 1) { uVar10 = 0x46; } else if (iVar4 == 2) { uVar10 = 0; pPVar14 = &g_game->_playerManager; pGVar12 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar14->_playerList)._begin >> 2 != 0) { do { pvVar9 = (pPVar14->_playerList)._end; if ((int)pvVar9 - (int)(pPVar14->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar9 = (pPVar14->_playerList)._end; pGVar12 = g_game; } piVar6 = (pPVar14->_playerList)._begin; if (uVar10 < (uint)((int)pvVar9 - (int)piVar6 >> 2)) { piVar6 = piVar6 + uVar10; } if (*(int *)(*piVar6 + 0x1580) != 0) { uVar10 = 0x5a; goto LAB_0042c436; } pPVar14 = &pGVar12->_playerManager; uVar10 = uVar10 + 1; } while (uVar10 < (uint)((int)(pGVar12->_playerManager)._playerList._end - (int)(pPVar14->_playerList)._begin >> 2)); } uVar10 = Random(); uVar10 = 0x46 - ((uVar10 & 1) != 0); } } else if (iVar4 == 2) { uVar5 = (**(code **)(*in_ECX + 0x88))(); switch(uVar5) { case 0: uVar10 = 0x32; break; case 1: uVar10 = 0x33; break; case 2: uVar10 = 0x34; break; case 3: uVar10 = 0x168; } } LAB_0042c436: uVar7 = Random(); this = g_game->_room; local_18 = (this->_bottomRightPos).x - (this->_topLeftPos).x; local_14 = (this->_bottomRightPos).y - (this->_topLeftPos).y; uVar13 = Random(); fVar1 = local_14; if (local_14 <= local_18) { fVar1 = local_18; } local_24._8_4_ = local_18 * 0.5; local_18 = local_14 * 0.5 + (this->_topLeftPos).y; local_24._8_4_ = (float)local_24._8_4_ + (this->_topLeftPos).x; Room::FindFreePickupSpawnPosition (this,&local_2c,(Vector *)(local_24 + 8), (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * fVar1,0,0,0); pEVar8 = Game::SpawnEx(g_game,5,uVar10,&local_2c,&g_vectorZero,(Entity *)0x0,0,uVar7,0); ExceptionList = local_10; return pEVar8; } //@@ 0042c540 FUN_0042c540 int * FUN_0042c540(char param_1) { int *piVar1; uint uVar2; undefined1 *puVar3; int in_ECX; void *ptr; int *piVar4; undefined4 *puVar5; undefined4 *local_28; int local_20; int *local_1c; int *local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1e1d; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = (void *)0x0; local_28 = (undefined4 *)0x0; local_8 = 0; local_18 = (int *)(in_ECX + 0x20); piVar1 = (int *)*local_18; piVar4 = (int *)*piVar1; uVar2 = *(uint *)(in_ECX + 0x24); local_20 = (int)piVar4; local_1c = piVar1; if (uVar2 != 0) { if (0x3fffffff < uVar2) { /* WARNING: Subroutine does not return */ std::_Xlen(__security_cookie ^ (int)register0x00000010 - 4U); } std::vector::_Reallocate(uVar2); piVar1 = (int *)*local_18; } local_14 = (void *)0x0; puVar5 = (undefined4 *)0x0; if (piVar4 != piVar1) { do { if (*(char *)((int)piVar4 + 0x14) != '\0') { if (puVar5 == (undefined4 *)0x0) { std::vector::_Emplace_reallocate(0,(undefined4 *)((int)piVar4 + 0x10)); puVar5 = local_28; } else { *puVar5 = *(undefined4 *)((int)piVar4 + 0x10); local_28 = puVar5 + 1; puVar5 = local_28; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_20); piVar4 = (int *)local_20; } while (local_20 != *local_18); } local_14 = (void *)0x0; local_1c = (int *)0x19; if (param_1 != '\0') { local_1c = (int *)0x0; } if ((int)puVar5 >> 2 != 0) { uVar2 = Random(); local_1c = *(int **)((int)local_14 + (uVar2 % (uint)((int)puVar5 >> 2)) * 4); puVar3 = (undefined1 *)FUN_00429f30(&local_1c); *puVar3 = 0; } piVar4 = local_1c; if (local_14 != (void *)0x0) { uVar2 = -(int)local_14 & 0xfffffffc; ptr = local_14; if (0xfff < uVar2) { ptr = *(void **)((int)local_14 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_14 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } ExceptionList = local_10; return piVar4; } //@@ 0042c6a0 FUN_0042c6a0 void FUN_0042c6a0(undefined4 param_1,uint param_2) { uint uVar1; uint uVar2; undefined4 *puVar3; uint uVar4; uVar1 = Random(); uVar4 = 0; uVar2 = 0; if (param_2 != 0) { puVar3 = ¶m_2; do { uVar4 = uVar4 + puVar3[1]; puVar3 = puVar3 + 1; if (uVar1 % 0x65 < uVar4) { return; } uVar2 = uVar2 + 1; } while (uVar2 < param_2); } return; } //@@ 0042c6e0 FUN_0042c6e0 void FUN_0042c6e0(undefined4 *param_1) { undefined4 *puVar1; undefined4 *in_ECX; puVar1 = (undefined4 *)*in_ECX; *param_1 = puVar1; *in_ECX = *puVar1; return; } //@@ 0042c700 FUN_0042c700 int FUN_0042c700(void) { int *in_ECX; return *in_ECX + 8; } //@@ 0042c710 FUN_0042c710 bool FUN_0042c710(int *param_1) { int *in_ECX; return *in_ECX != *param_1; } //@@ 0042c730 FUN_0042c730 void FUN_0042c730(int *param_1,int *param_2) { int iVar1; int in_ECX; iVar1 = *param_2; *(int *)param_2[1] = iVar1; *(int *)(*param_2 + 4) = param_2[1]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -1; operator_delete(param_2,0x10); *param_1 = iVar1; return; } //@@ 0042c770 FUN_0042c770 void FUN_0042c770(undefined4 *param_1) { undefined4 *in_ECX; *param_1 = *(undefined4 *)*in_ECX; return; } //@@ 0042c780 FUN_0042c780 void FUN_0042c780(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0x10); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x10); return; } //@@ 0042c7c0 FUN_0042c7c0 void FUN_0042c7c0(void) { void *pvVar1; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x10); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *in_ECX = pvVar1; return; } //@@ 0042c7f0 FUN_0042c7f0 int FUN_0042c7f0(void) { int *in_ECX; return (in_ECX[1] - *in_ECX) / 0x1c; } //@@ 0042c810 FUN_0042c810 int FUN_0042c810(int param_1) { int *in_ECX; return *in_ECX + param_1 * 4; } //@@ 0042c820 FUN_0042c820 void FUN_0042c820(uint param_1) { int *in_ECX; if (param_1 <= (uint)(in_ECX[2] - *in_ECX >> 2)) { return; } if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(); return; } //@@ 0042c850 std::vector::push_back /* DB: emplace_reallocate fallback */ void std::vector::push_back(undefined4 *param_1) { undefined4 *puVar1; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { _Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 4; return; } //@@ 0042c880 std::vector::_Reallocate /* DB: reserve: allocate, memmove, change_array */ void std::vector::_Reallocate(uint param_1) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } _Dst = _Allocate(param_1 * 4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,param_1); return; } //@@ 0042c8e0 FID_conflict:_Erase_tree_>_> /* Library Function - Multiple Matches With Different Base Names public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree_and_orphan > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Erase_tree_>_> (void *this,fuzzer_allocator_> *param_1, _Tree_node *param_2) { _Tree_node _Var1; _Tree_node *p_Var2; _Var1 = param_2[0xd]; while (_Var1 == (_Tree_node)0x0) { FID_conflict__Erase_tree_>_> (this,param_1,*(_Tree_node **)(param_2 + 8)); p_Var2 = *(_Tree_node **)param_2; operator_delete(param_2,0x18); param_2 = p_Var2; _Var1 = p_Var2[0xd]; } return; } //@@ 0042c920 std::vector::_Emplace_reallocate /* DB: MSVC vector grow+insert, 4-byte elems */ uint * std::vector::_Emplace_reallocate(void *param_1,uint *param_2) { uint uVar1; uint *puVar2; int iVar3; void *_Src; int iVar4; uint *_Dst; int *in_ECX; uint uVar5; uint uVar6; iVar3 = *in_ECX; iVar4 = in_ECX[1] - iVar3 >> 2; if (iVar4 == 0x3fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar4 + 1; uVar5 = in_ECX[2] - iVar3 >> 2; if (0x3fffffff - (uVar5 >> 1) < uVar5) { uVar6 = 0x3fffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar6 = uVar1; if (uVar1 <= uVar5) { uVar6 = uVar5; } if (0x3fffffff < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar6 * 4); puVar2 = _Dst + ((int)param_1 - iVar3 >> 2); *puVar2 = *param_2; _Src = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,_Src,in_ECX[1] - (int)_Src); } else { memmove(_Dst,_Src,(int)param_1 - (int)_Src); memmove(puVar2 + 1,param_1,in_ECX[1] - (int)param_1); } FID_conflict__Change_array(in_ECX,_Dst,uVar1,uVar6); return puVar2; } //@@ 0042ca00 Isaac::GetItemConfig /* ZHL [lua] Lua binding Isaac:GetItemConfig prototype: db/protos.zhl, confirmed by RET 0 */ ItemConfig * __cdecl Isaac::GetItemConfig(void) { return &g_manager->_itemConfig; } //@@ 0042ca10 FUN_0042ca10 undefined4 FUN_0042ca10(void) { return 3; } //@@ 0042ca20 FUN_0042ca20 undefined4 FUN_0042ca20(void) { return 0xd; } //@@ 0042ca30 FUN_0042ca30 undefined1 FUN_0042ca30(int param_1) { return *(undefined1 *)(param_1 + 0x20a9); } //@@ 0042ca40 FUN_0042ca40 void FUN_0042ca40(Entity_Player *param_1,undefined4 param_2) { void *pvVar1; Game *pGVar2; ItemConfig_Item *collectibleID; int *piVar3; int *piVar4; int local_14 [4]; pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU) < 0x39) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar1 + 0x38); } Entity_Player::AddCostume(param_1,collectibleID,0); Entity_Player::AddCollectible(param_1,0x161,0,1,0,0,0); param_1->_hasGoldenBomb = 1; Entity_Player::ConsumableCountChanged(param_1,0x10); pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } if (param_1->_playerType == 0x19) { Entity_Player::AddBlueFlies(param_1,0x18,¶m_1->_pos,(Entity *)0x0); FUN_0042c070(param_1,param_2); return; } local_14[0] = param_1->_numBombs + 99; local_14[1] = 99; local_14[2] = 0; piVar4 = local_14; if (0x62 < local_14[0]) { piVar4 = local_14 + 1; } piVar3 = local_14 + 2; if (0 < *piVar4) { piVar3 = piVar4; } param_1->_numBombs = *piVar3; Entity_Player::ConsumableCountChanged(param_1,4); pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } FUN_0042c070(param_1,param_2); return; } //@@ 0042cb70 FUN_0042cb70 undefined4 FUN_0042cb70(void) { return 9; } //@@ 0042cb80 FUN_0042cb80 undefined1 FUN_0042cb80(void) { return 0; } //@@ 0042cb90 FUN_0042cb90 void FUN_0042cb90(Entity_Player *param_1,undefined4 param_2) { Game *pGVar1; int *piVar2; int *piVar3; int local_14 [4]; Entity_Player::AddCollectible(param_1,0x252,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0x74,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0x1e4,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0xd1,0,1,0,0,0); local_14[0] = param_1->_numBombs + -3; local_14[1] = 99; local_14[2] = 0; piVar3 = local_14; if (0x62 < local_14[0]) { piVar3 = local_14 + 1; } piVar2 = local_14 + 2; if (0 < *piVar3) { piVar2 = piVar3; } param_1->_numBombs = *piVar2; Entity_Player::ConsumableCountChanged(param_1,4); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } FUN_0042c070(param_1,param_2); return; } //@@ 0042cc70 Room::GetBottomRightPos /* ZHL [lua] Lua binding Room:GetBottomRightPos */ Vector * __thiscall Room::GetBottomRightPos(Room *this) { return &this->_bottomRightPos; } //@@ 0042cc80 FUN_0042cc80 undefined4 FUN_0042cc80(void) { return 2; } //@@ 0042cc90 FUN_0042cc90 void FUN_0042cc90(Entity *param_1) { uint *puVar1; void *pvVar2; qword qVar3; byte bVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; Vector local_10; if (param_1[8]._sprite._filename._buf[1] != '\0') { fVar6 = (param_1->_pos).x; pvVar2 = g_game->_room; fVar5 = fVar6 - *(float *)((int)pvVar2 + 0x14); fVar7 = *(float *)((int)pvVar2 + 0x1c) - fVar6; fVar9 = *(float *)((int)pvVar2 + 0x14); if (fVar7 <= fVar5) { fVar5 = fVar7; fVar9 = *(float *)((int)pvVar2 + 0x1c); } fVar7 = (param_1->_pos).y; fVar10 = fVar7 - *(float *)((int)pvVar2 + 0x18); fVar8 = *(float *)((int)pvVar2 + 0x20) - fVar7; local_10.x = *(float *)((int)pvVar2 + 0x18); if (fVar8 <= fVar10) { fVar10 = fVar8; local_10.x = *(float *)((int)pvVar2 + 0x20); } if (fVar10 <= fVar5) { fVar9 = fVar6; } else { local_10.x = fVar7; } fVar9 = fVar9 - fVar6; local_10.x = local_10.x - fVar7; fVar6 = sqrtf(fVar9 * fVar9 + local_10.x * local_10.x); if (0.0 < fVar6) { local_10.x = (1.0 / fVar6) * local_10.x; fVar9 = fVar9 * (1.0 / fVar6); } (param_1->_pos).x = fVar9 * 10.0 + (param_1->_pos).x; (param_1->_pos).y = local_10.x * 10.0 + (param_1->_pos).y; } local_10.x = (param_1->_velocity).x; local_10.y = (param_1->_velocity).y; bVar4 = Entity::is_grid_collision_at(param_1,&local_10); if (bVar4 != 0) { qVar3 = param_1->_flags; puVar1 = (uint *)((int)¶m_1->_flags + 4); *puVar1 = *puVar1 & 0xffff7fff; *(int *)¶m_1->_flags = (int)qVar3; } return; } //@@ 0042cdf0 GridEntity_Statue::Render /* ZHL [vtable slot 3] */ void __thiscall GridEntity_Statue::Render(void) { return; } //@@ 0042ce00 FUN_0042ce00 void FUN_0042ce00(int param_1,float *param_2) { if (*(char *)(param_1 + 0x20a9) != '\0') { *param_2 = *param_2 + 10.0; } return; } //@@ 0042ce30 FUN_0042ce30 void FUN_0042ce30(int param_1,float *param_2) { if (*(char *)(param_1 + 0x20a9) != '\0') { *param_2 = *param_2 - 20.0; } return; } //@@ 0042ce60 FUN_0042ce60 void FUN_0042ce60(Entity_Player *param_1,undefined4 param_2) { Entity_Player::AddCollectible(param_1,0x95,0,1,0,0,0); FUN_0042c070(param_1,param_2); return; } //@@ 0042cea0 FUN_0042cea0 undefined4 FUN_0042cea0(void) { return 10; } //@@ 0042ceb0 FUN_0042ceb0 void FUN_0042ceb0(Entity_Player *param_1,undefined4 param_2) { Entity_Player::AddCollectible(param_1,0x72,0,1,0,0,0); FUN_0042c070(param_1,param_2); return; } //@@ 0042cef0 FUN_0042cef0 undefined4 FUN_0042cef0(void) { return 6; } //@@ 0042cf00 FUN_0042cf00 float10 FUN_0042cf00(void) { return (float10)0.5; } //@@ 0042cf10 FUN_0042cf10 void FUN_0042cf10(Entity_Player *param_1,undefined4 param_2) { Game *pGVar1; int *piVar2; int *piVar3; int aiStack_14 [4]; Entity_Player::AddCollectible(param_1,0x27d,0,1,0,0,0); param_1->_donateLuck = param_1->_donateLuck + 8; param_1->_cacheFlags = param_1->_cacheFlags | 0x400; Entity_Player::EvaluateItems(); aiStack_14[0] = param_1->_numBombs + -1; aiStack_14[1] = 99; aiStack_14[2] = 0; piVar3 = aiStack_14; if (0x62 < aiStack_14[0]) { piVar3 = aiStack_14 + 1; } piVar2 = aiStack_14 + 2; if (0 < *piVar3) { piVar2 = piVar3; } param_1->_numBombs = *piVar2; Entity_Player::ConsumableCountChanged(param_1,4); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } FUN_0042c070(param_1,param_2); return; } //@@ 0042cfd0 Color::Color /* DB: tint rgb + alpha 1.0, colorize 0, 3 offset params (0x2c struct) */ void Color::Color(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = param_1; in_ECX[9] = param_2; *in_ECX = in_XMM1_Da; in_ECX[1] = in_XMM2_Da; in_ECX[2] = in_XMM3_Da; in_ECX[3] = 0x3f800000; in_ECX[10] = param_3; return; } //@@ 0042d030 Room::GetRenderScrollOffset /* ZHL [lua] Lua binding Room:GetRenderScrollOffset */ Vector * __thiscall Room::GetRenderScrollOffset(Room *this) { return &this->_renderScrollOffset; } //@@ 0042d040 FUN_0042d040 int FUN_0042d040(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x13dc); if (iVar1 == 0) { iVar1 = *(int *)(in_ECX + 0x13e0); } return iVar1; } //@@ 0042d060 get_netplay_player_color /* DB: ? ECX holds 4 net slot ids at +0x60: finds the slot matching player->_controllerIndex (arg2 +0x1618, 5 if none), PlayerManager::GetPlayerColorValue(slot) and writes a Color (tint rgb, alpha 1, colorize = rgb) into arg1; Entity_Player::Render uses it for the online local-player outline before render_color_stack_push, FUN_0042d1c0 for the name tag */ void get_netplay_player_color(float *param_1,int param_2) { int in_ECX; int *piVar1; int playerColor; KColor local_18; playerColor = 0; piVar1 = (int *)(in_ECX + 0x60); do { if (*piVar1 == *(int *)(param_2 + 0x1618)) goto LAB_0042d086; playerColor = playerColor + 1; piVar1 = piVar1 + 1; } while (playerColor < 4); playerColor = 5; LAB_0042d086: PlayerManager::GetPlayerColorValue(&local_18,playerColor); param_1[4] = 0.0; param_1[5] = 0.0; param_1[6] = 0.0; param_1[7] = 0.0; *param_1 = local_18._red; param_1[1] = local_18._green; param_1[2] = local_18._blue; param_1[3] = 1.0; param_1[8] = local_18._red; param_1[9] = local_18._green; param_1[10] = local_18._blue; return; } //@@ 0042d0f0 FUN_0042d0f0 void FUN_0042d0f0(byte param_1) { int *this; char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = IsaacRepentancePlus::DeathmatchTypeLudovico::vftable; local_8 = 0; if ((int *)in_ECX[0xc] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[0xc] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0xb); } } this = in_ECX + 8; *in_ECX = IsaacRepentancePlus::DeathmatchTypeBase::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); FUN_0042c780(); FUN_0042c780(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x34); } ExceptionList = local_10; return; } //@@ 0042d1b0 FUN_0042d1b0 undefined4 FUN_0042d1b0(void) { return 4; } //@@ 0042d1c0 DeathmatchTypeLudovico::render_ludovico_indicator /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? DeathmatchTypeLudovico vtable slot 23 (Normal uses stub 0042bc90); for the local player dynamic_casts the weapon to Weapon_Ludovico, projects its tear to screen and draws a clamped off-screen arrow tinted with get_netplay_player_color */ void DeathmatchTypeLudovico::render_ludovico_indicator(int param_1) { int iVar1; int *piVar2; int in_ECX; KColor *color; float fVar3; float fVar4; double dVar5; undefined1 auStackY_1d4 [128]; Vector *size; KColor *imageRefCount; undefined1 auStack_134 [4]; float fStack_130; float fStack_12c; float fStack_128; Vector VStack_124; float fStack_11c; Vector VStack_118; float fStack_110; float fStack_10c; undefined4 uStack_108; undefined4 uStack_104; undefined4 uStack_100; float fStack_fc; undefined4 uStack_f8; KColor KStack_f4; undefined1 auStack_e0 [112]; ColorMod CStack_70; uint local_44; local_44 = __security_cookie ^ (uint)auStack_134; FUN_0090b070(); iVar1 = FUN_004253d0(); if (iVar1 == param_1) { iVar1 = *(int *)(param_1 + 0x13dc); if (iVar1 == 0) { iVar1 = *(int *)(param_1 + 0x13e0); } piVar2 = (int *)__RTDynamicCast(iVar1,0,&IsaacRepentancePlus::Weapon::RTTI_Type_Descriptor); if (piVar2 != (int *)0x0) { iVar1 = (**(code **)(*piVar2 + 0x28))(); if (iVar1 != 0) { iVar1 = (**(code **)(*piVar2 + 0x28))(); fStack_128 = g_displayPixelRatio * g_screenPointScale; VStack_124.x = (g_manager->_optionsConfig)._hudOffset * 8.0 + 16.0; fStack_130 = ((g_screenWidth - 338.0) * 0.5 + (*(float *)(iVar1 + 0x33c) - 60.0) * 0.65) * fStack_128 + 0.5; dVar5 = floor((double)fStack_130); fStack_130 = (float)dVar5 / fStack_128; fStack_12c = ((g_screenHeight - 182.0) * 0.5 + (*(float *)(iVar1 + 0x340) - 140.0) * 0.65) * fStack_128 + 0.5; dVar5 = floor((double)fStack_12c); fStack_128 = (float)dVar5 / fStack_128 + *(float *)((int)g_game->_room + 0x1208); fStack_130 = fStack_130 + *(float *)((int)g_game->_room + 0x1204); fStack_110 = VStack_124.x + g_vectorZero.y + 10.0; fStack_12c = VStack_124.x + g_vectorZero.x + 0.0; fVar3 = fStack_130; if (fStack_130 <= g_vectorZero.x) { fVar3 = g_vectorZero.x; } VStack_118.x = (g_screenWidth - VStack_124.x) - 0.0; if (g_screenWidth <= fVar3) { fVar3 = g_screenWidth; } fStack_10c = (g_screenHeight - VStack_124.x) - 10.0; fVar4 = fStack_128; if (fStack_128 <= g_vectorZero.y) { fVar4 = g_vectorZero.y; } if (g_screenHeight <= fVar4) { fVar4 = g_screenHeight; } fVar3 = sqrtf((fStack_128 - fVar4) * (fStack_128 - fVar4) + (fStack_130 - fVar3) * (fStack_130 - fVar3)); fStack_11c = (fVar3 - 10.0) / 140.0; VStack_124.x = (fVar3 - 30.0) / 250.0; if (fStack_11c <= 0.0) { fStack_11c = 0.0; } if (VStack_124.x <= 0.0) { VStack_124.x = 0.0; } if (1.0 <= fStack_11c) { fStack_11c = 1.0; } if (1.0 <= VStack_124.x) { VStack_124.x = 1.0; } fStack_11c = fStack_11c + 0.0; VStack_124.x = 2.0 - VStack_124.x; if (0.0 < fStack_11c) { get_netplay_player_color(); fVar4 = VStack_124.x * 16.0; VStack_124.x = fVar4; VStack_124.y = fVar4; FUN_00682260(); KColor::SetFromARGB(&KStack_f4,0xffffffff); fVar3 = fStack_130; if (fStack_130 <= fStack_12c) { fVar3 = fStack_12c; } size = &VStack_124; if (VStack_118.x <= fVar3) { fVar3 = VStack_118.x; } VStack_118.x = fVar3 - fVar4 * 0.5; VStack_118.y = fStack_128; if (fStack_128 <= fStack_110) { VStack_118.y = fStack_110; } if (fStack_10c <= VStack_118.y) { VStack_118.y = fStack_10c; } VStack_118.y = VStack_118.y - fVar4 * 0.5; imageRefCount = color; render_quad_set_rect(auStack_e0,&VStack_118,size,color); fStack_fc = fStack_11c; uStack_f8 = 0; CStack_70._colorize[0] = 0.0; CStack_70._colorize[1] = 0.0; CStack_70._colorize[2] = 0.0; CStack_70._colorize[3] = 0.0; uStack_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_100 = 0x3f800000; CStack_70._tint[0] = 1.0; CStack_70._tint[1] = 1.0; CStack_70._tint[2] = 1.0; CStack_70._tint[3] = 1.0; CStack_70._offset[0] = 0.0; CStack_70._offset[1] = 0.0; CStack_70._offset[2] = 0.0; KAGE::SmartPointer::operator_assign(auStackY_1d4 + 0x8c,(undefined4 *)(in_ECX + 0x2c)); apply_sprite_shader_params(&CStack_70,1,size,imageRefCount); (**(code **)(**(int **)(in_ECX + 0x2c) + 0x1c))(); } } } } return; } //@@ 0042d5f0 FUN_0042d5f0 void FUN_0042d5f0(Entity_Player *param_1,undefined4 param_2) { Entity_Player::AddCollectible(param_1,0x149,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0x105,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0xa5,0,1,0,0,0); Entity_Player::AddTrinket(param_1,0x1b,1); FUN_0042c070(param_1,param_2); return; } //@@ 0042d660 FUN_0042d660 undefined4 FUN_0042d660(void) { return 8; } //@@ 0042d670 FUN_0042d670 float10 FUN_0042d670(void) { return (float10)6.8; } //@@ 0042d680 FUN_0042d680 void FUN_0042d680(Entity_Player *param_1,undefined4 param_2) { Game *pGVar1; int *piVar2; int *piVar3; int local_14 [4]; Entity_Player::AddCollectible(param_1,0x14a,0,1,0,0,0); Entity_Player::AddCollectible(param_1,3,0,1,0,0,0); Entity_Player::AddCollectible(param_1,299,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0x13a,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0x81,0,1,0,0,0); local_14[0] = param_1->_numBombs + -1; local_14[1] = 99; local_14[2] = 0; piVar3 = local_14; if (0x62 < local_14[0]) { piVar3 = local_14 + 1; } piVar2 = local_14 + 2; if (0 < *piVar3) { piVar2 = piVar3; } param_1->_numBombs = *piVar2; Entity_Player::ConsumableCountChanged(param_1,4); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } FUN_0042c070(param_1,param_2); return; } //@@ 0042d780 FUN_0042d780 void FUN_0042d780(byte param_1) { int *this; undefined4 *in_ECX; this = in_ECX + 8; *in_ECX = IsaacRepentancePlus::DeathmatchTypeBase::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); FUN_0042c780(); FUN_0042c780(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x34); } return; } //@@ 0042d7e0 FUN_0042d7e0 undefined4 FUN_0042d7e0(void) { return 1; } //@@ 0042d7f0 FUN_0042d7f0 undefined1 FUN_0042d7f0(void) { Game *pGVar1; char cVar2; int iVar3; uint uVar4; int *in_ECX; uint uVar5; cVar2 = DeathmatchTypeBase::Init(); pGVar1 = g_game; if (cVar2 == '\0') { return 0; } in_ECX[1] = in_ECX[1] | 1; uVar5 = 0; iVar3 = PlayerManager::count_main_players(&pGVar1->_playerManager); if (iVar3 != 0) { do { (**(code **)(*in_ECX + 0x3c))(); uVar5 = uVar5 + 1; uVar4 = PlayerManager::count_main_players(&g_game->_playerManager); } while (uVar5 < uVar4); } return 1; } //@@ 0042d850 FUN_0042d850 void FUN_0042d850(void) { int *piVar1; int iVar2; int *in_ECX; piVar1 = in_ECX + 0xb; *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { (**(code **)(*in_ECX + 0x3c))(); iVar2 = __ftoui3(); in_ECX[0xb] = iVar2; in_ECX[0xc] = 6; } DeathmatchTypeBase::Update(); return; } //@@ 0042d8a0 FUN_0042d8a0 undefined4 FUN_0042d8a0(void) { return 5; } //@@ 0042d8b0 FUN_0042d8b0 void FUN_0042d8b0(Entity_Player *param_1,undefined4 param_2) { Game *pGVar1; int *piVar2; int *piVar3; int local_14 [4]; Entity_Player::AddCollectible(param_1,0x2b2,0,1,0,0,0); local_14[0] = param_1->_numBombs + -1; local_14[1] = 99; local_14[2] = 0; piVar3 = local_14; if (0x62 < local_14[0]) { piVar3 = local_14 + 1; } piVar2 = local_14 + 2; if (0 < *piVar3) { piVar2 = piVar3; } param_1->_numBombs = *piVar2; Entity_Player::ConsumableCountChanged(param_1,4); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } FUN_0042c070(param_1,param_2); return; } //@@ 0042d950 FUN_0042d950 undefined4 FUN_0042d950(void) { return 7; } //@@ 0042d960 FUN_0042d960 void FUN_0042d960(Entity_Player *param_1,undefined4 param_2) { Entity_Player::AddCollectible(param_1,0x243,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0xf3,0,1,0,0,0); FUN_0042c070(param_1,param_2); return; } //@@ 0042d9b0 Entity::SetSpriteScale /* DB: writes Entity 0xe4 (SpriteScale getter returns +0xe4); tiny prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetSpriteScale(Entity *this,Vector *scale) { (this->_sprite)._scale.x = scale->x; (this->_sprite)._scale.y = scale->y; return; } //@@ 0042d9d0 FUN_0042d9d0 undefined4 FUN_0042d9d0(void) { return 0xb; } //@@ 0042d9e0 FUN_0042d9e0 void FUN_0042d9e0(Entity *param_1) { uint *puVar1; qword qVar2; Game *pGVar3; byte bVar4; uint uVar5; Entity *pEVar6; int *piVar7; float fVar8; float fVar9; Vector local_10; pGVar3 = g_game; if ((param_1[8]._sprite._filename._buf[1] != '\0') && ((param_1->_flags & 0x4000) == 0)) { bVar4 = Game::IsPaused(g_game); if ((bVar4 == 0) && ((~(byte)pGVar3->_frameCount & 1) != 0)) { uVar5 = Random(); if (1 < uVar5 % 5) { uVar5 = Random(); local_10.x = (param_1->_pos).x; local_10.y = (param_1->_pos).y; pEVar6 = Game::SpawnEx(g_game,1000,0x2d,&local_10,&g_vectorZero,param_1,0,uVar5,0); piVar7 = (int *)__RTDynamicCast(pEVar6,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0) ; uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; fVar8 = fVar9 * g_vectorOne.x; piVar7[0x3a] = (int)(fVar9 * g_vectorOne.y); piVar7[0x39] = (int)fVar8; (**(code **)(*piVar7 + 0xc))(); } } } local_10.x = (param_1->_velocity).x; local_10.y = (param_1->_velocity).y; bVar4 = Entity::is_grid_collision_at(param_1,&local_10); if (bVar4 != 0) { qVar2 = param_1->_flags; puVar1 = (uint *)((int)¶m_1->_flags + 4); *puVar1 = *puVar1 & 0xffff7fff; *(int *)¶m_1->_flags = (int)qVar2; } return; } //@@ 0042db40 FUN_0042db40 void FUN_0042db40(Entity_Player *param_1,undefined4 param_2) { Entity_Player::AddCollectible(param_1,0x13d,0,1,0,0,0); Entity_Player::AddCollectible(param_1,0x134,0,1,0,0,0); Entity_Player::AddTrinket(param_1,0x6a,1); FUN_0042c070(param_1,param_2); return; } //@@ 0042dbb0 DebugRenderer::Render /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Game::Render calls it with ECX=Game+0x6772c, the same list head/count (+0x6772c/+0x67730) DebugRenderer::Get walks and Game::Update expires by timeout; draws each entry (vector points, UTF-16 text with 0xfff9/0xfffa/0xfffd tokens) with Font::DrawString/render_color_quad relative to the room render offset */ void DebugRenderer::Render(void) { float *line; void *quad; undefined4 *puVar1; int *in_ECX; uint uVar2; ushort *puVar3; int iVar4; ushort *puVar5; int iVar6; int *piVar7; float fVar8; float fVar9; float fVar10; double dVar11; undefined1 local_1fc [112]; undefined1 local_18c [112]; undefined4 local_11c; undefined4 local_118; undefined4 local_114; undefined4 local_110; undefined4 local_10c; undefined4 local_108; undefined4 local_104; Vector local_100; Vector local_f8; Vector local_f0; Vector local_e8; Vector local_e0; Vector local_d8; Vector local_d0; Vector local_c8; Vector local_c0; Vector local_b8; Vector local_b0; Vector local_a8; Vector local_a0; int *local_98; Vector local_94; Vector local_8c; Vector local_84; KColor local_7c; float local_68; float local_64; float local_60; float local_5c; int *local_58; float local_54; float local_50; float local_4c; float local_48; float local_44; float local_40; float local_3c; ushort *local_38; float local_34; float local_30; float local_2c; undefined4 *local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1e50; local_1c = ExceptionList; ExceptionList = &local_1c; if (in_ECX[1] != 0) { local_4c = *(float *)((int)g_game->_room + 0x1204); local_50 = *(float *)((int)g_game->_room + 0x1208); local_58 = *(int **)*in_ECX; local_98 = in_ECX; if (local_58 != (int *)*in_ECX) { do { puVar3 = (ushort *)local_58[4]; local_7c._unk = 0; local_7c._red = (float)_DAT_00bac050; local_7c._green = (float)_UNK_00bac054; local_7c._blue = (float)_UNK_00bac058; local_7c._alpha = (float)_UNK_00bac05c; piVar7 = local_58; if (puVar3 != (ushort *)local_58[5]) { do { puVar5 = puVar3; switch(*puVar3) { case 0xfff9: puVar5 = puVar3 + 2; local_28 = (undefined4 *)(piVar7[0xd] + (uint)*puVar5 * 0x18); local_24 = g_displayPixelRatio * g_screenPointScale; local_40 = (*(float *)(piVar7[10] + 4 + (uint)puVar3[1] * 8) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_44 = local_24 * ((*(float *)(piVar7[10] + (uint)puVar3[1] * 8) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) + 0.5; dVar11 = floor((double)local_44); local_2c = (float)dVar11 / local_24; local_44 = local_24 * local_40 + 0.5; dVar11 = floor((double)local_44); local_44 = (float)dVar11; local_11c = 0; local_118 = 0xffff; local_114 = 0; local_110 = 0x3f800000; local_10c = 0xffffffff; local_108 = 0; local_104 = 0; local_14 = 0; puVar1 = local_28; if (0xf < (uint)local_28[5]) { puVar1 = (undefined4 *)*local_28; } Font::DrawString(puVar1,&local_7c,&local_11c); local_14 = 0xffffffff; break; case 0xfffa: local_24 = (float)(uint)puVar3[2]; local_30 = (float)(uint)puVar3[1]; puVar5 = puVar3 + 3; iVar6 = piVar7[10]; uVar2 = (uint)*puVar5; local_5c = *(float *)(iVar6 + 4 + uVar2 * 8) * *(float *)(iVar6 + (int)local_24 * 8); fVar8 = (*(float *)(iVar6 + uVar2 * 8) * 6.2831855) / 10.0; if (fVar8 <= 2.0) { fVar8 = 2.0; } local_60 = *(float *)(iVar6 + 4 + (int)local_24 * 8) * *(float *)(iVar6 + 4 + uVar2 * 8); if (12.0 <= fVar8) { fVar8 = 12.0; } local_2c = (float)((int)fVar8 * 2); local_38 = puVar5; local_28 = (undefined4 *)cos(1.5707964); fVar10 = sin(1.5707964); piVar7 = local_58; iVar6 = local_58[10]; fVar8 = *(float *)(iVar6 + (int)local_24 * 8); fVar9 = *(float *)(iVar6 + 4 + (int)local_24 * 8); local_34 = (fVar8 * (float)local_28 - fVar10 * fVar9) * *(float *)(iVar6 + (uint)*puVar5 * 8); local_3c = g_displayPixelRatio * g_screenPointScale; local_54 = (fVar10 * fVar8 + fVar9 * (float)local_28) * *(float *)(iVar6 + (uint)*puVar5 * 8); local_24 = ((g_screenWidth - 338.0) * 0.5 + (*(float *)(iVar6 + (int)local_30 * 8) - 60.0) * 0.65) * local_3c + 0.5; dVar11 = floor((double)local_24); local_28 = (undefined4 *)((float)dVar11 / local_3c); local_24 = ((*(float *)(piVar7[10] + 4 + (int)local_30 * 8) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_3c + 0.5; dVar11 = floor((double)local_24); local_68 = local_50 + (float)dVar11 / local_3c; local_64 = local_4c + (float)local_28; local_28 = (undefined4 *)-local_60; local_d8.x = (local_34 + local_5c) * 0.65 + local_64; local_d8.y = (local_54 + local_60) * 0.65 + local_68; local_48 = -local_5c; local_e0.x = (local_48 + local_34) * 0.65 + local_64; local_e0.y = ((float)local_28 + local_54) * 0.65 + local_68; local_40 = local_e0.y; local_3c = local_e0.x; local_30 = local_d8.y; local_24 = local_d8.x; render_color_quad(&local_e0,&local_d8,&local_7c,&local_7c,1.0); local_e8.x = (local_5c - local_34) * 0.65 + local_64; local_e8.y = (local_60 - local_54) * 0.65 + local_68; local_f0.x = (local_48 - local_34) * 0.65 + local_64; local_f0.y = ((float)local_28 - local_54) * 0.65 + local_68; render_color_quad(&local_f0,&local_e8,&local_7c,&local_7c,1.0); local_8c.x = local_24; local_8c.y = local_30; local_94.x = local_3c; local_94.y = local_40; local_40 = 1.4013e-45; if (0 < (int)local_2c) { iVar6 = 1; iVar4 = -1; local_24 = (float)(int)local_2c; do { local_40 = (((float)iVar4 * 180.0) / local_24) * 0.017453292; local_3c = cos(local_40); fVar8 = sin(local_40); local_40 = (((float)iVar6 * 180.0) / local_24) * 0.017453292; local_f8.y = (local_3c * local_54 + fVar8 * local_34 + local_60) * 0.65 + local_68 ; local_f8.x = ((local_3c * local_34 - fVar8 * local_54) + local_5c) * 0.65 + local_64; local_44 = local_f8.x; local_3c = local_f8.y; local_30 = cos(local_40); fVar8 = sin(local_40); local_100.x = ((local_30 * local_34 - local_54 * fVar8) + local_48) * 0.65 + local_64; local_100.y = (local_30 * local_54 + local_34 * fVar8 + (float)local_28) * 0.65 + local_68; local_40 = local_100.x; local_30 = local_100.y; render_color_quad(&local_8c,&local_f8,&local_7c,&local_7c,1.0); render_color_quad(&local_94,&local_100,&local_7c,&local_7c,1.0); iVar6 = iVar6 + 1; local_8c.x = local_44; iVar4 = iVar4 + -1; local_8c.y = local_3c; local_94.x = local_40; local_94.y = local_30; } while (iVar6 <= (int)local_2c); puVar5 = local_38; piVar7 = local_58; } break; case 0xfffb: local_2c = (float)(uint)puVar3[1]; puVar5 = puVar3 + 2; local_34 = *(float *)(piVar7[10] + (uint)*puVar5 * 8); fVar8 = (local_34 * 6.2831855) / 10.0; local_30 = g_displayPixelRatio * g_screenPointScale; if (fVar8 <= 2.0) { fVar8 = 2.0; } if (12.0 <= fVar8) { fVar8 = 12.0; } local_48 = (float)((int)fVar8 * 2); local_24 = ((g_screenWidth - 338.0) * 0.5 + (*(float *)(piVar7[10] + (int)local_2c * 8) - 60.0) * 0.65) * local_30 + 0.5; local_38 = puVar5; dVar11 = floor((double)local_24); local_28 = (undefined4 *)((float)dVar11 / local_30); local_24 = ((g_screenHeight - 182.0) * 0.5 + (*(float *)(piVar7[10] + 4 + (int)local_2c * 8) - 140.0) * 0.65) * local_30 + 0.5; dVar11 = floor((double)local_24); local_24 = (float)dVar11; local_3c = local_50 + local_24 / local_30; local_30 = local_4c + (float)local_28; fVar8 = cos(0.0); local_84.x = fVar8 * local_34 * 0.65 + local_30; fVar9 = sin(0.0); fVar8 = (float)((int)local_48 * 2); local_84.y = fVar9 * local_34 * 0.65 + local_3c; local_2c = fVar8; if (0 < (int)fVar8) { iVar6 = 1; local_28 = (undefined4 *)(float)(int)local_48; do { local_24 = (((float)iVar6 * 180.0) / (float)local_28) * 0.017453292; fVar9 = cos(local_24); local_d0.x = fVar9 * local_34 * 0.65 + local_30; local_2c = local_d0.x; fVar9 = sin(local_24); local_d0.y = fVar9 * local_34 * 0.65 + local_3c; local_24 = local_d0.y; render_color_quad(&local_84,&local_d0,&local_7c,&local_7c,1.0); iVar6 = iVar6 + 1; local_84.x = local_2c; local_84.y = local_24; } while (iVar6 <= (int)fVar8); puVar5 = local_38; piVar7 = local_58; } break; case 0xfffc: local_2c = (float)(uint)puVar3[1]; iVar6 = piVar7[10]; local_38 = (ushort *)(g_displayPixelRatio * g_screenPointScale); uVar2 = (uint)puVar3[2]; fVar8 = *(float *)(iVar6 + (int)local_2c * 8); local_c0.x = (*(float *)(iVar6 + uVar2 * 8) - fVar8) * 0.65; local_c0.y = (*(float *)(iVar6 + 4 + uVar2 * 8) - *(float *)(iVar6 + 4 + (int)local_2c * 8)) * 0.65; local_24 = ((g_screenWidth - 338.0) * 0.5 + (fVar8 - 60.0) * 0.65) * (float)local_38 + 0.5; dVar11 = floor((double)local_24); local_48 = (float)dVar11 / (float)local_38; local_24 = ((g_screenHeight - 182.0) * 0.5 + (*(float *)(piVar7[10] + 4 + (int)local_2c * 8) - 140.0) * 0.65) * (float)local_38 + 0.5; dVar11 = floor((double)local_24); local_24 = (float)dVar11; local_c8.x = local_48 + local_4c; local_c8.y = local_50 + local_24 / (float)local_38; render_quad_set_rect(local_1fc,&local_c8,&local_c0,&local_7c); render_color_shader_pass(quad); puVar5 = puVar3 + 2; break; case 0xfffd: local_2c = (float)(uint)puVar3[1]; iVar6 = piVar7[10]; local_38 = (ushort *)(g_displayPixelRatio * g_screenPointScale); uVar2 = (uint)puVar3[2]; fVar8 = *(float *)(iVar6 + (int)local_2c * 8); local_b0.x = (*(float *)(iVar6 + uVar2 * 8) - fVar8) * 0.65; local_b0.y = (*(float *)(iVar6 + 4 + uVar2 * 8) - *(float *)(iVar6 + 4 + (int)local_2c * 8)) * 0.65; local_24 = ((g_screenWidth - 338.0) * 0.5 + (fVar8 - 60.0) * 0.65) * (float)local_38 + 0.5; dVar11 = floor((double)local_24); local_48 = (float)dVar11 / (float)local_38; local_24 = ((g_screenHeight - 182.0) * 0.5 + (*(float *)(piVar7[10] + 4 + (int)local_2c * 8) - 140.0) * 0.65) * (float)local_38 + 0.5; dVar11 = floor((double)local_24); local_24 = (float)dVar11; local_b8.x = local_4c + local_48; local_b8.y = local_50 + local_24 / (float)local_38; render_quad_set_rect(local_18c,&local_b8,&local_b0,&local_7c); render_quad_draw_color_shader(line,1.0); puVar5 = puVar3 + 2; break; case 0xfffe: local_38 = (ushort *)(uint)puVar3[1]; puVar5 = puVar3 + 2; local_34 = g_displayPixelRatio * g_screenPointScale; local_30 = (g_screenHeight - 182.0) * 0.5; local_28 = (undefined4 *)((g_screenWidth - 338.0) * 0.5); local_24 = ((*(float *)(piVar7[10] + (uint)*puVar5 * 8) - 60.0) * 0.65 + (float)local_28) * local_34 + 0.5; dVar11 = floor((double)local_24); local_2c = (float)dVar11 / local_34; local_24 = ((*(float *)(piVar7[10] + 4 + (uint)*puVar5 * 8) - 140.0) * 0.65 + local_30 ) * local_34 + 0.5; dVar11 = floor((double)local_24); local_a0.x = local_2c + local_4c; local_a0.y = local_50 + (float)dVar11 / local_34; local_24 = ((*(float *)(piVar7[10] + (int)local_38 * 8) - 60.0) * 0.65 + (float)local_28) * local_34 + 0.5; dVar11 = floor((double)local_24); local_2c = (float)dVar11 / local_34; local_24 = ((*(float *)(piVar7[10] + 4 + (int)local_38 * 8) - 140.0) * 0.65 + local_30 ) * local_34 + 0.5; dVar11 = floor((double)local_24); local_24 = (float)dVar11; local_a8.x = local_4c + local_2c; local_a8.y = local_50 + local_24 / local_34; render_color_quad(&local_a8,&local_a0,&local_7c,&local_7c,1.0); break; case 0xffff: local_7c._0_16_ = *(undefined1 (*) [16])(piVar7[7] + (uint)puVar3[1] * 0x14); local_7c._unk = *(int *)(piVar7[7] + 0x10 + (uint)puVar3[1] * 0x14); puVar5 = puVar3 + 1; } puVar3 = puVar5 + 1; } while (puVar3 != (ushort *)piVar7[5]); in_ECX = local_98; } local_58 = (int *)*piVar7; } while (local_58 != (int *)*in_ECX); } } ExceptionList = local_1c; return; } //@@ 0042eb10 DebugRenderer::Get /* ZHL [exact] __thiscall Shape* DebugRenderer::Get(int Index, bool Unk); prototype: REPENTOGON, confirmed by RET 8 */ void * __thiscall DebugRenderer::Get(DebugRenderer *this,int Index,byte Unk) { DebugRenderer DVar1; char *pcVar2; DebugRenderer DVar3; int *piVar4; int *piVar5; DebugRenderer *pDVar6; void *ptr; uint size; uint uVar7; void *pvVar8; char *this_00; int *piVar9; int local_54; undefined4 local_50; void *pvStack_4c; undefined4 uStack_48; int iStack_44; void *local_40; undefined4 uStack_3c; int iStack_38; void *pvStack_34; undefined4 local_30; int iStack_2c; int *piStack_28; int *piStack_24; int local_20; DebugRenderer *local_1c; DebugRenderer *local_18; DebugRenderer *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1e85; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = this; if (Index != -1) { for (DVar1 = *(DebugRenderer *)*this; DVar1 != *this; DVar1 = *(DebugRenderer *)DVar1) { if (*(int *)((int)DVar1 + 8) == Index) { if (Unk != 0) { *(undefined4 *)((int)DVar1 + 0x20) = *(undefined4 *)((int)DVar1 + 0x1c); *(undefined4 *)((int)DVar1 + 0x2c) = *(undefined4 *)((int)DVar1 + 0x28); *(undefined4 *)((int)DVar1 + 0x14) = *(undefined4 *)((int)DVar1 + 0x10); pcVar2 = *(char **)((int)DVar1 + 0x38); this_00 = *(char **)((int)DVar1 + 0x34); if (this_00 != pcVar2) { do { std::string::_Tidy_deallocate(this_00); this_00 = this_00 + 0x18; } while (this_00 != pcVar2); this_00 = *(char **)((int)DVar1 + 0x34); } *(char **)((int)DVar1 + 0x38) = this_00; *(undefined4 *)((int)DVar1 + 0xc) = 5; } ExceptionList = local_10; return (undefined4 *)((int)DVar1 + 8); } } } local_50 = 5; pvStack_4c = (void *)0x0; uStack_48 = 0; iStack_44 = 0; local_54 = Index; local_20 = 0; local_40 = (void *)0x0; uStack_3c = 0; iStack_38 = 0; pvStack_34 = (void *)0x0; local_30 = 0; iStack_2c = 0; piStack_28 = (int *)0x0; piStack_24 = (int *)0x0; local_8 = 0; DVar1 = *this; if (this[1] == (DebugRenderer)0x3ffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 1; local_18 = (DebugRenderer *)0x0; local_1c = this; pDVar6 = operator_new(0x40); local_18 = pDVar6; Shape::Shape(&local_54); piVar5 = piStack_24; piVar4 = piStack_28; this[1] = (DebugRenderer)((int)this[1] + 1); DVar3 = *(DebugRenderer *)((int)DVar1 + 4); *pDVar6 = DVar1; pDVar6[1] = DVar3; *(DebugRenderer **)((int)DVar1 + 4) = pDVar6; *(DebugRenderer **)DVar3 = pDVar6; piVar9 = piStack_28; if (piStack_28 != (int *)0x0) { for (; piVar9 != piVar5; piVar9 = piVar9 + 6) { uVar7 = piVar9[5]; if (0xf < uVar7) { pvVar8 = (void *)*piVar9; size = uVar7 + 1; ptr = pvVar8; if (0xfff < size) { ptr = *(void **)((int)pvVar8 + -4); size = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)ptr))) goto LAB_0042ed75; } operator_delete(ptr,size); } piVar9[4] = 0; piVar9[5] = 0xf; *(undefined1 *)piVar9 = 0; } uVar7 = ((local_20 - (int)piVar4) / 0x18) * 0x18; piVar9 = piVar4; if (0xfff < uVar7) { piVar9 = (int *)piVar4[-1]; uVar7 = uVar7 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar4 + (-4 - (int)piVar9))) goto LAB_0042ed75; } operator_delete(piVar9,uVar7); this = local_14; } if (pvStack_34 != (void *)0x0) { uVar7 = iStack_2c - (int)pvStack_34 & 0xfffffff8; pvVar8 = pvStack_34; if (0xfff < uVar7) { pvVar8 = *(void **)((int)pvStack_34 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvStack_34 + (-4 - (int)pvVar8))) goto LAB_0042ed75; } operator_delete(pvVar8,uVar7); } if (local_40 != (void *)0x0) { uVar7 = ((iStack_38 - (int)local_40) / 0x14) * 0x14; pvVar8 = local_40; if (0xfff < uVar7) { pvVar8 = *(void **)((int)local_40 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)local_40 + (-4 - (int)pvVar8))) goto LAB_0042ed75; } operator_delete(pvVar8,uVar7); } if (pvStack_4c != (void *)0x0) { uVar7 = iStack_44 - (int)pvStack_4c & 0xfffffffe; pvVar8 = pvStack_4c; if (0xfff < uVar7) { pvVar8 = *(void **)((int)pvStack_4c + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvStack_4c + (-4 - (int)pvVar8))) { LAB_0042ed75: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar7); } ExceptionList = local_10; return (void *)(*(int *)((int)*this + 4) + 8); } //@@ 0042edb0 FUN_0042edb0 void FUN_0042edb0(void) { int in_ECX; std::vector::_Tidy(); std::vector::_Tidy(); FID_conflict__Tidy((void *)(in_ECX + 0x14)); FUN_0042f240(); return; } //@@ 0042ede0 FUN_0042ede0 void FUN_0042ede0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined2 *puVar3; uint uVar4; int in_ECX; undefined4 in_XMM2_Da; undefined1 local_10 [4]; undefined4 local_c; puVar1 = *(undefined4 **)(in_ECX + 0x24); if (puVar1 == *(undefined4 **)(in_ECX + 0x28)) { local_c = in_XMM2_Da; std::vector::_Emplace_reallocate(puVar1,param_1); in_XMM2_Da = local_c; } else { uVar2 = param_1[1]; *puVar1 = *param_1; puVar1[1] = uVar2; *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 8; } puVar1 = *(undefined4 **)(in_ECX + 0x24); local_c = 0; if (puVar1 == *(undefined4 **)(in_ECX + 0x28)) { std::vector::_Emplace_reallocate(puVar1,local_10); } else { *puVar1 = in_XMM2_Da; puVar1[1] = 0; *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 8; } puVar3 = *(undefined2 **)(in_ECX + 0xc); param_1 = (undefined4 *)&DAT_0000fffb; if (puVar3 == *(undefined2 **)(in_ECX + 0x10)) { FUN_0042f580(puVar3,¶m_1); } else { *puVar3 = 0xfffb; *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 2; } puVar3 = *(undefined2 **)(in_ECX + 0xc); uVar4 = (*(int *)(in_ECX + 0x24) - *(int *)(in_ECX + 0x20) >> 3) - 2; param_1 = (undefined4 *)(uVar4 & 0xffff); if (puVar3 == *(undefined2 **)(in_ECX + 0x10)) { FUN_0042f580(puVar3,¶m_1); } else { *puVar3 = (short)uVar4; *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 2; } puVar3 = *(undefined2 **)(in_ECX + 0xc); uVar4 = (*(int *)(in_ECX + 0x24) - *(int *)(in_ECX + 0x20) >> 3) - 1; param_1 = (undefined4 *)(uVar4 & 0xffff); if (puVar3 == *(undefined2 **)(in_ECX + 0x10)) { FUN_0042f580(puVar3,¶m_1); return; } *puVar3 = (short)uVar4; *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 2; return; } //@@ 0042eef0 push_shape_points /* DB: ? appends Vector pairs into vector at +0x24; Big Horn/Bumbino/Whipper prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall push_shape_points(void *this,Capsule *capsule) { Capsule *pCVar1; Capsule CVar2; undefined2 *puVar3; Capsule *pCVar4; uint uVar5; Capsule local_10; Capsule local_c; pCVar4 = capsule; pCVar1 = *(Capsule **)((int)this + 0x24); if (pCVar1 == *(Capsule **)((int)this + 0x28)) { std::vector::_Emplace_reallocate(pCVar1,capsule); } else { CVar2 = capsule[1]; *pCVar1 = *capsule; pCVar1[1] = CVar2; *(int *)((int)this + 0x24) = *(int *)((int)this + 0x24) + 8; } pCVar1 = *(Capsule **)((int)this + 0x24); if (pCVar1 == *(Capsule **)((int)this + 0x28)) { std::vector::_Emplace_reallocate(pCVar1,pCVar4 + 6); } else { CVar2 = pCVar4[7]; *pCVar1 = pCVar4[6]; pCVar1[1] = CVar2; *(int *)((int)this + 0x24) = *(int *)((int)this + 0x24) + 8; } pCVar1 = *(Capsule **)((int)this + 0x24); local_10 = pCVar4[8]; local_c = pCVar4[9]; if (pCVar1 == *(Capsule **)((int)this + 0x28)) { std::vector::_Emplace_reallocate(pCVar1,&local_10); } else { *pCVar1 = local_10; pCVar1[1] = local_c; *(int *)((int)this + 0x24) = *(int *)((int)this + 0x24) + 8; } puVar3 = *(undefined2 **)((int)this + 0xc); capsule = (Capsule *)0xfffa; if (puVar3 == *(undefined2 **)((int)this + 0x10)) { FUN_0042f580(puVar3,&capsule); } else { *puVar3 = 0xfffa; *(int *)((int)this + 0xc) = *(int *)((int)this + 0xc) + 2; } puVar3 = *(undefined2 **)((int)this + 0xc); uVar5 = (*(int *)((int)this + 0x24) - *(int *)((int)this + 0x20) >> 3) - 3; capsule = (Capsule *)(uVar5 & 0xffff); if (puVar3 == *(undefined2 **)((int)this + 0x10)) { FUN_0042f580(puVar3,&capsule); } else { *puVar3 = (short)uVar5; *(int *)((int)this + 0xc) = *(int *)((int)this + 0xc) + 2; } puVar3 = *(undefined2 **)((int)this + 0xc); uVar5 = (*(int *)((int)this + 0x24) - *(int *)((int)this + 0x20) >> 3) - 2; capsule = (Capsule *)(uVar5 & 0xffff); if (puVar3 == *(undefined2 **)((int)this + 0x10)) { FUN_0042f580(puVar3,&capsule); } else { *puVar3 = (short)uVar5; *(int *)((int)this + 0xc) = *(int *)((int)this + 0xc) + 2; } puVar3 = *(undefined2 **)((int)this + 0xc); uVar5 = (*(int *)((int)this + 0x24) - *(int *)((int)this + 0x20) >> 3) - 1; capsule = (Capsule *)(uVar5 & 0xffff); if (puVar3 == *(undefined2 **)((int)this + 0x10)) { FUN_0042f580(puVar3,&capsule); return; } *puVar3 = (short)uVar5; *(int *)((int)this + 0xc) = *(int *)((int)this + 0xc) + 2; return; } //@@ 0042f050 FUN_0042f050 void FUN_0042f050(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 4) = param_1; return; } //@@ 0042f060 FUN_0042f060 void FUN_0042f060(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; std::vector::_Tidy(); std::vector::_Tidy(); FID_conflict__Tidy(puVar1 + 7); FUN_0042f240(); operator_delete(puVar1,0x40); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x40); return; } //@@ 0042f0c0 FUN_0042f0c0 void FUN_0042f0c0(void) { char *pcVar1; int *in_ECX; char *this; pcVar1 = (char *)in_ECX[1]; this = (char *)*in_ECX; if (this == pcVar1) { in_ECX[1] = (int)this; return; } do { std::string::_Tidy_deallocate(this); this = this + 0x18; } while (this != pcVar1); in_ECX[1] = *in_ECX; return; } //@@ 0042f0f0 FUN_0042f0f0 void FUN_0042f0f0(std_string *param_1) { std_string *where; undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; uint uVar4; void *in_ECX; where = *(std_string **)((int)in_ECX + 4); if (where == *(std_string **)((int)in_ECX + 8)) { vector_string_emplace_reallocate_move(in_ECX,where,param_1); return; } where->_buf[0] = '\0'; where->_buf[1] = '\0'; where->_buf[2] = '\0'; where->_buf[3] = '\0'; where->_size = 0; where->_capacity = 0; uVar1 = *(undefined4 *)(param_1->_buf + 4); uVar2 = *(undefined4 *)(param_1->_buf + 8); uVar3 = *(undefined4 *)(param_1->_buf + 0xc); *(undefined4 *)where->_buf = *(undefined4 *)param_1->_buf; *(undefined4 *)(where->_buf + 4) = uVar1; *(undefined4 *)(where->_buf + 8) = uVar2; *(undefined4 *)(where->_buf + 0xc) = uVar3; uVar4 = param_1->_capacity; where->_size = param_1->_size; where->_capacity = uVar4; param_1->_size = 0; param_1->_capacity = 0xf; param_1->_buf[0] = '\0'; *(int *)((int)in_ECX + 4) = *(int *)((int)in_ECX + 4) + 0x18; return; } //@@ 0042f150 std::vector::operator__ /* DB: ? base+i*8 */ int std::vector::operator__(int param_1) { int *in_ECX; return *in_ECX + param_1 * 8; } //@@ 0042f160 FUN_0042f160 int FUN_0042f160(void) { int *in_ECX; return in_ECX[1] - *in_ECX >> 3; } //@@ 0042f170 FUN_0042f170 void FUN_0042f170(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector::_Emplace_reallocate(puVar1,param_1); return; } uVar2 = param_1[1]; *puVar1 = *param_1; puVar1[1] = uVar2; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 8; return; } //@@ 0042f1a0 FUN_0042f1a0 void FUN_0042f1a0(int *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; uint uVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined4 *puVar6; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; puVar6 = (undefined4 *)*param_1; puVar1 = (undefined4 *)param_1[1]; if (puVar6 != puVar1) { uVar4 = (int)puVar1 - (int)puVar6 >> 3; if (0x1fffffff < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } puVar5 = std::_Allocate(uVar4 * 8); *in_ECX = puVar5; in_ECX[1] = puVar5; in_ECX[2] = puVar5 + uVar4 * 2; do { uVar2 = *puVar6; uVar3 = puVar6[1]; puVar6 = puVar6 + 2; *puVar5 = uVar2; puVar5[1] = uVar3; puVar5 = puVar5 + 2; } while (puVar6 != puVar1); in_ECX[1] = puVar5; } return; } //@@ 0042f220 FUN_0042f220 void FUN_0042f220(void) { void *pvVar1; uint size; int *in_ECX; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x14) * 0x14; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0042f240 FUN_0042f240 void FUN_0042f240(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffffe; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0042f2a0 Math::clamp /* DB: XMM2 clamped to [XMM0, XMM1] (MAXSS/MINSS) (dogma_effects.md) prototype: db/protos.zhl */ float __cdecl Math::clamp(float min,float max,float value) { if (value <= min) { value = min; } if (max <= value) { value = max; } return value; } //@@ 0042f2b0 FUN_0042f2b0 void FUN_0042f2b0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; *in_EDX = 0; in_EDX[4] = 0; in_EDX[5] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_EDX = *param_1; in_EDX[1] = uVar1; in_EDX[2] = uVar2; in_EDX[3] = uVar3; *(undefined8 *)(in_EDX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; return; } //@@ 0042f2f0 vector_string_emplace_reallocate_move /* DB: std::vector::_Emplace_reallocate (elem 0x18, 0xaaaaaaa max) that move-constructs the new string (zeroes the slot then steals param_2's buffer); EntityConfig::load_players_xml, ResolveRelativePath prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall vector_string_emplace_reallocate_move(void *this,std_string *where,std_string *value) { std_string *psVar1; uint uVar2; int iVar3; int iVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; std_string *psVar8; uint uVar9; std_string *psVar10; undefined4 uVar11; iVar3 = *(int *)this; iVar4 = ((int)where - iVar3) / 0x18; iVar5 = (*(int *)((int)this + 4) - iVar3) / 0x18; if (iVar5 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (*(int *)((int)this + 8) - iVar3) / 0x18; if (0xaaaaaaa - (uVar2 >> 1) < uVar2) { uVar9 = 0xaaaaaaa; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar9 = iVar5 + 1U; if (iVar5 + 1U <= uVar2) { uVar9 = uVar2; } if (0xaaaaaaa < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } psVar8 = std::_Allocate(uVar9 * 0x18); psVar10 = psVar8 + iVar4; psVar10->_buf[0] = '\0'; psVar10->_buf[1] = '\0'; psVar10->_buf[2] = '\0'; psVar10->_buf[3] = '\0'; psVar1 = psVar8 + iVar4; psVar1->_size = 0; psVar1->_capacity = 0; uVar11 = *(undefined4 *)(value->_buf + 4); uVar6 = *(undefined4 *)(value->_buf + 8); uVar7 = *(undefined4 *)(value->_buf + 0xc); *(undefined4 *)psVar1->_buf = *(undefined4 *)value->_buf; *(undefined4 *)(psVar1->_buf + 4) = uVar11; *(undefined4 *)(psVar1->_buf + 8) = uVar6; *(undefined4 *)(psVar1->_buf + 0xc) = uVar7; uVar2 = value->_capacity; psVar1->_size = value->_size; psVar1->_capacity = uVar2; value->_size = 0; value->_capacity = 0xf; value->_buf[0] = '\0'; uVar11 = *(undefined4 *)this; psVar10 = psVar8; if (where != *(std_string **)((int)this + 4)) { FUN_0042f7a0(psVar8,uVar11); psVar10 = psVar1 + 1; } FUN_0042f7a0(psVar10,uVar11); std::vector::_Change_array(psVar8,iVar5 + 1,uVar9); return psVar1; } //@@ 0042f430 std::vector::_Emplace_reallocate /* DB: growth 1.5x of 8-byte elements, length_error at 0x1fffffff */ uint * std::vector::_Emplace_reallocate(uint *param_1,uint *param_2) { uint *puVar1; int iVar2; uint uVar3; uint *puVar4; int iVar5; uint uVar6; uint *puVar7; int *in_ECX; uint uVar8; uint *puVar9; uint *puVar10; uint *puVar11; uint local_c; iVar2 = *in_ECX; iVar5 = in_ECX[1] - iVar2 >> 3; if (iVar5 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar6 = iVar5 + 1; uVar8 = in_ECX[2] - iVar2 >> 3; if (0x1fffffff - (uVar8 >> 1) < uVar8) { local_c = 0x1fffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; local_c = uVar6; if (uVar6 <= uVar8) { local_c = uVar8; } if (0x1fffffff < local_c) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = _Allocate(local_c << 3); puVar1 = puVar7 + ((int)param_1 - iVar2 >> 3) * 2; uVar8 = *param_2; puVar1[1] = param_2[1]; *puVar1 = uVar8; puVar10 = (uint *)in_ECX[1]; puVar9 = (uint *)*in_ECX; puVar4 = puVar7; if (param_1 == puVar10) { for (; puVar9 != puVar10; puVar9 = puVar9 + 2) { uVar8 = puVar9[1]; *puVar4 = *puVar9; puVar4[1] = uVar8; puVar4 = puVar4 + 2; } } else { puVar11 = puVar7; puVar4 = puVar1; if (puVar9 != param_1) { do { uVar8 = *puVar9; uVar3 = puVar9[1]; puVar9 = puVar9 + 2; *puVar11 = uVar8; puVar11[1] = uVar3; puVar11 = puVar11 + 2; } while (puVar9 != param_1); puVar10 = (uint *)in_ECX[1]; } for (; param_1 != puVar10; param_1 = param_1 + 2) { uVar8 = param_1[1]; puVar4[2] = *param_1; puVar4[3] = uVar8; puVar4 = puVar4 + 2; } } FID_conflict__Change_array(in_ECX,puVar7,uVar6,local_c); return puVar1; } //@@ 0042f550 FUN_0042f550 void FUN_0042f550(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 uVar1; for (; param_1 != param_2; param_1 = param_1 + 2) { uVar1 = param_1[1]; *param_3 = *param_1; param_3[1] = uVar1; param_3 = param_3 + 2; } return; } //@@ 0042f580 FUN_0042f580 undefined2 * FUN_0042f580(void *param_1,undefined2 *param_2) { uint uVar1; undefined2 *puVar2; int iVar3; void *_Src; int iVar4; uint *_Dst; int *in_ECX; uint uVar5; uint uVar6; iVar3 = *in_ECX; iVar4 = in_ECX[1] - iVar3 >> 1; if (iVar4 == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar4 + 1; uVar5 = in_ECX[2] - iVar3 >> 1; if (0x7fffffff - (uVar5 >> 1) < uVar5) { uVar6 = 0x7fffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar6 = uVar1; if (uVar1 <= uVar5) { uVar6 = uVar5; } if (0x7fffffff < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar6 * 2); puVar2 = (undefined2 *)((int)_Dst + ((int)param_1 - iVar3 >> 1) * 2); *puVar2 = *param_2; _Src = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,_Src,in_ECX[1] - (int)_Src); } else { memmove(_Dst,_Src,(int)param_1 - (int)_Src); memmove(puVar2 + 1,param_1,in_ECX[1] - (int)param_1); } FID_conflict__Change_array(in_ECX,_Dst,uVar1,uVar6); return puVar2; } //@@ 0042f660 std::vector::_Change_array /* DB: destroys old 0x18-byte strings, frees, installs new buffer; vector_string_emplace_reallocate(_move) */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { uint size; int *in_ECX; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { string::_Tidy_deallocate(this); this = this + 0x18; } while (this != pcVar1); this = (char *)*in_ECX; } size = ((in_ECX[2] - (int)this) / 0x18) * 0x18; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x18; in_ECX[2] = param_1 + param_3 * 0x18; return; } //@@ 0042f6f0 FUN_0042f6f0 void FUN_0042f6f0(undefined4 *param_1,undefined4 *param_2,int param_3) { undefined4 uVar1; if (param_1 != param_2) { param_3 = param_3 - (int)param_1; do { uVar1 = param_1[1]; *(undefined4 *)(param_3 + (int)param_1) = *param_1; *(undefined4 *)(param_3 + 4 + (int)param_1) = uVar1; param_1 = param_1 + 2; } while (param_1 != param_2); } return; } //@@ 0042f720 FID_conflict:_Change_array /* Library Function - Multiple Matches With Different Base Names private: void __thiscall std::vector >::_Change_array(unsigned int * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(unsigned int * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(struct CHN * * const,unsigned int,unsigned int) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Change_array(void *this,uint *param_1,uint param_2,uint param_3) { void *pvVar1; void *ptr; uint size; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = *(int *)((int)this + 8) - (int)pvVar1 & 0xfffffffe; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(uint **)this = param_1; *(uint *)((int)this + 4) = (int)param_1 + param_2 * 2; *(uint *)((int)this + 8) = (int)param_1 + param_3 * 2; return; } //@@ 0042f780 FUN_0042f780 void FUN_0042f780(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x40); } return; } //@@ 0042f7a0 FUN_0042f7a0 void FUN_0042f7a0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined4 *puVar5; undefined4 *in_EDX; if (in_ECX != in_EDX) { puVar4 = param_1; puVar5 = in_ECX; do { *puVar4 = 0; puVar4[4] = 0; *(undefined4 *)((int)param_1 + (0x14 - (int)in_ECX) + (int)puVar5) = 0; uVar1 = puVar5[1]; uVar2 = puVar5[2]; uVar3 = puVar5[3]; *puVar4 = *puVar5; puVar4[1] = uVar1; puVar4[2] = uVar2; puVar4[3] = uVar3; *(undefined8 *)(puVar4 + 4) = *(undefined8 *)(puVar5 + 4); puVar4 = puVar4 + 6; puVar5[4] = 0; puVar5[5] = 0xf; *(undefined1 *)puVar5 = 0; puVar5 = puVar5 + 6; } while (puVar5 != in_EDX); } return; } //@@ 0042f800 FUN_0042f800 undefined4 * FUN_0042f800(undefined4 *param_1) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar2; undefined4 *puVar3; puVar3 = param_1; if (in_ECX != in_EDX) { puVar2 = in_ECX + 2; do { *puVar3 = puVar2[-2]; puVar3[1] = puVar2[-1]; *(undefined4 *)((int)param_1 + (-0x14 - (int)in_ECX) + (int)(puVar2 + 5)) = *puVar2; puVar3[3] = puVar2[1]; puVar3[4] = puVar2[2]; puVar1 = puVar2 + 3; puVar3 = puVar3 + 5; puVar2 = puVar2 + 5; } while (puVar1 != in_EDX); } return puVar3; } //@@ 0042f850 Shape::Shape /* DB: ? copy constructor of the 0x38-byte DebugRenderer Shape (Index, type 5, vector, vector<20byte>, +0x20 sub-copy FUN_0042f1a0, vector +0x2c); only caller DebugRenderer::Get copies the stack Shape into the new list node */ undefined4 * Shape::Shape(undefined4 *param_1) { undefined4 *puVar1; uint uVar2; size_t _Size; uint uVar3; void *pvVar4; void *pvVar5; undefined4 uVar6; void *pvVar7; undefined4 *in_ECX; undefined4 extraout_ECX; char *this; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1ee6; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; pvVar5 = (void *)param_1[2]; if (pvVar5 != (void *)param_1[3]) { _Size = (int)param_1[3] - (int)pvVar5; uVar3 = (int)_Size >> 1; if (0x7fffffff < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar2); } uVar3 = uVar3 * 2; pvVar4 = std::_Allocate(uVar3); in_ECX[2] = pvVar4; in_ECX[3] = pvVar4; in_ECX[4] = (void *)((int)pvVar4 + uVar3); pvVar4 = (void *)in_ECX[2]; memmove(pvVar4,pvVar5,_Size); in_ECX[3] = (void *)(uVar3 + (int)pvVar4); } local_8._0_1_ = 0; local_8._1_3_ = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; if (param_1[5] != param_1[6]) { uVar3 = (int)(param_1[6] - param_1[5]) / 0x14; if (0xccccccc < uVar3) goto LAB_0042fa29; uVar3 = uVar3 * 0x14; pvVar5 = std::_Allocate(uVar3); in_ECX[5] = pvVar5; in_ECX[6] = pvVar5; in_ECX[7] = (void *)((int)pvVar5 + uVar3); uVar6 = FUN_0042f800(in_ECX[5],extraout_ECX); in_ECX[6] = uVar6; } local_8._0_1_ = 1; FUN_0042f1a0(param_1 + 8); puVar1 = in_ECX + 0xb; local_8._0_1_ = 2; *puVar1 = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; pvVar5 = (void *)param_1[0xb]; pvVar4 = (void *)param_1[0xc]; if (pvVar5 != pvVar4) { uVar3 = ((int)pvVar4 - (int)pvVar5) / 0x18; if (0xaaaaaaa < uVar3) { LAB_0042fa29: /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar2); } uVar3 = uVar3 * 0x18; pvVar7 = std::_Allocate(uVar3); *puVar1 = pvVar7; in_ECX[0xc] = pvVar7; in_ECX[0xd] = (void *)((int)pvVar7 + uVar3); this = (char *)*puVar1; local_8 = CONCAT31(local_8._1_3_,4); do { std::string::string(this,pvVar5); this = this + 0x18; pvVar5 = (void *)((int)pvVar5 + 0x18); } while (pvVar5 != pvVar4); in_ECX[0xc] = this; } ExceptionList = local_10; return in_ECX; } //@@ 0042fa30 OnlineEmotes::constructor /* DB: inits +0=0, +4=0x3c, +8/+0xc=0, +0x10=1, ANM2::constructor at +0x14 and +0x128, eh_vector_constructor of 0x3b strings at +0x23c; called by Game::constructor and Entity_Player::constructor; pairs with OnlineEmotes::destructor 0042fac0 OnlineEmotes::destructor the play-by-index setter FUN_00430750 */ void OnlineEmotes::constructor(void) { undefined1 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1f2e; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; *(undefined4 *)(in_ECX + 4) = 0x3c; *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 0xc) = 0; in_ECX[0x10] = 1; ANM2::constructor((ANM2 *)(in_ECX + 0x14)); local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x128)); local_8 = CONCAT31(local_8._1_3_,1); _eh_vector_constructor_iterator_ (in_ECX + 0x23c,0x18,0x3b,FUN_0040c380,std::string::_Tidy_deallocate); ExceptionList = local_10; return; } //@@ 0042fac0 OnlineEmotes::destructor /* DB: same layout as OnlineEmotes::load_anm2 0042fba0 OnlineEmotes::load_anm2 at +0x14 and +0x128, 0x3b anim-name strings at +0x23c, state +0/+4=0x3c): resets fields, destroys the string array, both ANM2s; called by Game::~Game, the Entity_Player destructor FUN_00754ed0 and FUN_008d1d20 prototype: db/protos.zhl */ void __thiscall OnlineEmotes::destructor(void *this) { ANM2 *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1f50; local_10 = ExceptionList; ExceptionList = &local_10; this_00 = (ANM2 *)((int)this + 0x128); *(undefined1 *)this = 0; *(undefined4 *)((int)this + 4) = 0x3c; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 0; ANM2::Reset(this_00); ANM2::Reset((ANM2 *)((int)this + 0x14)); _eh_vector_destructor_iterator_ ((void *)((int)this + 0x23c),0x18,0x3b,std::string::_Tidy_deallocate); local_8 = 0; ANM2::Reset(this_00); AnimationState::~AnimationState((AnimationState *)((int)this + 0x178)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x158)); std::string::_Tidy_deallocate((char *)((int)this + 0x140)); std::string::_Tidy_deallocate((char *)this_00); local_8 = 1; ANM2::Reset((ANM2 *)((int)this + 0x14)); AnimationState::~AnimationState((AnimationState *)((int)this + 100)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x44)); std::string::_Tidy_deallocate((char *)((int)this + 0x2c)); std::string::_Tidy_deallocate((char *)((int)this + 0x14)); ExceptionList = local_10; return; } //@@ 0042fba0 OnlineEmotes::load_anm2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads gfx/OnlineEmotes.anm2 into this+0x14 and this+0x128 (Angel/Bubble/Devil/Happy/Heart/Nicalis/QuestionMark/RaiseHand/ThumbsUp/...); called from 008d1d60 OnlineEmotes::init Game::LoadConfigXmls */ void OnlineEmotes::load_anm2(void) { uint *puVar1; byte bVar2; byte *pbVar3; std_string *psVar4; byte *pbVar5; int in_ECX; char *pcVar6; uint uVar7; bool bVar8; std_string local_54; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_54._size = 0; local_54._capacity = 0xf; local_54._buf[0] = '\0'; local_54._buf[1] = '\0'; local_54._buf[2] = '\0'; local_54._buf[3] = '\0'; local_54._buf._0_4_ = std::_Allocate(0x20); local_54._size = 0x15; local_54._capacity = 0x1f; builtin_strncpy((char *)local_54._buf._0_4_,"gfx/OnlineEmotes.anm2",0x16); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x128),&local_54,1); local_14 = 0xffffffff; if (0xf < local_54._capacity) { uVar7 = local_54._capacity + 1; pcVar6 = (char *)local_54._buf._0_4_; if (0xfff < uVar7) { pcVar6 = *(char **)(local_54._buf._0_4_ + -4); uVar7 = local_54._capacity + 0x24; if ((char *)0x1f < (char *)(local_54._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar7); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x15; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/OnlineEmotes.anm2",0x16); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x14),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; pcVar6 = (char *)local_3c._buf._0_4_; if (0xfff < uVar7) { pcVar6 = *(char **)(local_3c._buf._0_4_ + -4); uVar7 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar7); } pbVar5 = *(byte **)(in_ECX + 0x48); local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (pbVar5 != (byte *)0x0) { pbVar3 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar3 = *(byte **)pbVar5; } pcVar6 = "Bubble"; do { bVar2 = *pbVar3; bVar8 = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_0042fd77: uVar7 = -(uint)bVar8 | 1; goto LAB_0042fd7c; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar8 = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_0042fd77; pbVar3 = pbVar3 + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_0042fd7c: if ((uVar7 == 0) && ((pbVar5[0x34] == 0 || (*(char *)(in_ECX + 0x58) != '\0')))) goto LAB_0042fdb0; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x14),(byte *)"Bubble",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x44)); *(undefined1 *)(in_ECX + 0x58) = 1; } LAB_0042fdb0: std::string::assign((char *)(in_ECX + 0x23c),(byte *)&DAT_00b1cde4,2); std::string::assign((char *)(in_ECX + 0x254),&DAT_00b1cddc,4); std::string::assign((char *)(in_ECX + 0x26c),&DAT_00b1cdf0,4); std::string::assign((char *)(in_ECX + 0x284),(byte *)"Right",5); std::string::assign((char *)(in_ECX + 0x29c),(byte *)"Happy",5); std::string::assign((char *)(in_ECX + 0x2b4),&DAT_00b1cdf8,3); std::string::assign((char *)(in_ECX + 0x2cc),(byte *)"ThumbsUp",8); std::string::assign((char *)(in_ECX + 0x2e4),(byte *)"ThumbsDown",10); std::string::assign((char *)(in_ECX + 0x2fc),(byte *)"Heart",5); std::string::assign((char *)(in_ECX + 0x314),&DAT_00b1ce1c,4); std::string::assign((char *)(in_ECX + 0x32c),&DAT_00b1ce30,4); std::string::assign((char *)(in_ECX + 0x344),&DAT_00b1ce2c,3); std::string::assign((char *)(in_ECX + 0x35c),(byte *)"TintedRock",10); std::string::assign((char *)(in_ECX + 0x374),(byte *)"Angel",5); std::string::assign((char *)(in_ECX + 0x38c),(byte *)"Devil",5); std::string::assign((char *)(in_ECX + 0x3a4),&DAT_00b1ce4c,4); std::string::assign((char *)(in_ECX + 0x3bc),(byte *)"RaiseHand",9); std::string::assign((char *)(in_ECX + 0x3d4),(byte *)"QuestionMark",0xc); std::string::assign((char *)(in_ECX + 0x41c),(byte *)"Reset",5); std::string::assign((char *)(in_ECX + 0x3ec),&DAT_00b1ce78,2); psVar4 = std::string::assign((char *)(in_ECX + 0x4c4),&DAT_00b1ce88,6); if ((std_string *)(in_ECX + 0x4ac) != psVar4) { puVar1 = &psVar4->_size; if (0xf < psVar4->_capacity) { psVar4 = *(std_string **)psVar4->_buf; } std::string::assign((char *)(in_ECX + 0x4ac),(byte *)psVar4,*puVar1); } pbVar3 = (byte *)(in_ECX + 0x4ac); pbVar5 = (byte *)(in_ECX + 0x494); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x4c0)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x4bc)); } if ((byte *)(in_ECX + 0x47c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x4a8)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x47c),pbVar5,*(uint *)(in_ECX + 0x4a4)); } pbVar3 = (byte *)(in_ECX + 0x47c); pbVar5 = (byte *)(in_ECX + 0x464); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x490)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x48c)); } if ((byte *)(in_ECX + 0x44c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x478)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x44c),pbVar5,*(uint *)(in_ECX + 0x474)); } std::string::assign((char *)(in_ECX + 0x404),&DAT_00b1ce84,3); psVar4 = std::string::assign((char *)(in_ECX + 0x6a4),&DAT_00b1ce98,7); if ((std_string *)(in_ECX + 0x68c) != psVar4) { puVar1 = &psVar4->_size; if (0xf < psVar4->_capacity) { psVar4 = *(std_string **)psVar4->_buf; } std::string::assign((char *)(in_ECX + 0x68c),(byte *)psVar4,*puVar1); } pbVar3 = (byte *)(in_ECX + 0x68c); pbVar5 = (byte *)(in_ECX + 0x674); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x6a0)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x69c)); } if ((byte *)(in_ECX + 0x65c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x688)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x65c),pbVar5,*(uint *)(in_ECX + 0x684)); } pbVar3 = (byte *)(in_ECX + 0x65c); pbVar5 = (byte *)(in_ECX + 0x644); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x670)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x66c)); } if ((byte *)(in_ECX + 0x62c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x658)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x62c),pbVar5,*(uint *)(in_ECX + 0x654)); } pbVar3 = (byte *)(in_ECX + 0x62c); pbVar5 = (byte *)(in_ECX + 0x614); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x640)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x63c)); } if ((byte *)(in_ECX + 0x5fc) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x628)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x5fc),pbVar5,*(uint *)(in_ECX + 0x624)); } pbVar3 = (byte *)(in_ECX + 0x5fc); pbVar5 = (byte *)(in_ECX + 0x5e4); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x610)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x60c)); } if ((byte *)(in_ECX + 0x5cc) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x5f8)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x5cc),pbVar5,*(uint *)(in_ECX + 0x5f4)); } pbVar3 = (byte *)(in_ECX + 0x5cc); pbVar5 = (byte *)(in_ECX + 0x5b4); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x5e0)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x5dc)); } if ((byte *)(in_ECX + 0x59c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x5c8)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x59c),pbVar5,*(uint *)(in_ECX + 0x5c4)); } pbVar3 = (byte *)(in_ECX + 0x59c); pbVar5 = (byte *)(in_ECX + 0x584); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x5b0)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x5ac)); } if ((byte *)(in_ECX + 0x56c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x598)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x56c),pbVar5,*(uint *)(in_ECX + 0x594)); } pbVar3 = (byte *)(in_ECX + 0x56c); pbVar5 = (byte *)(in_ECX + 0x554); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x580)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x57c)); } if ((byte *)(in_ECX + 0x53c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x568)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x53c),pbVar5,*(uint *)(in_ECX + 0x564)); } pbVar3 = (byte *)(in_ECX + 0x53c); pbVar5 = (byte *)(in_ECX + 0x524); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x550)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x54c)); } if ((byte *)(in_ECX + 0x50c) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x538)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x50c),pbVar5,*(uint *)(in_ECX + 0x534)); } pbVar3 = (byte *)(in_ECX + 0x50c); pbVar5 = (byte *)(in_ECX + 0x4f4); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x520)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x51c)); } if ((byte *)(in_ECX + 0x4dc) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x508)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x4dc),pbVar5,*(uint *)(in_ECX + 0x504)); } psVar4 = std::string::assign((char *)(in_ECX + 0x7ac),(byte *)"Nicalis",7); if ((std_string *)(in_ECX + 0x794) != psVar4) { puVar1 = &psVar4->_size; if (0xf < psVar4->_capacity) { psVar4 = *(std_string **)psVar4->_buf; } std::string::assign((char *)(in_ECX + 0x794),(byte *)psVar4,*puVar1); } pbVar3 = (byte *)(in_ECX + 0x794); pbVar5 = (byte *)(in_ECX + 0x77c); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x7a8)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x7a4)); } if ((byte *)(in_ECX + 0x764) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x790)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x764),pbVar5,*(uint *)(in_ECX + 0x78c)); } pbVar3 = (byte *)(in_ECX + 0x764); pbVar5 = (byte *)(in_ECX + 0x74c); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x778)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x774)); } if ((byte *)(in_ECX + 0x734) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x760)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x734),pbVar5,*(uint *)(in_ECX + 0x75c)); } pbVar3 = (byte *)(in_ECX + 0x734); pbVar5 = (byte *)(in_ECX + 0x71c); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x748)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x744)); } if ((byte *)(in_ECX + 0x704) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x730)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x704),pbVar5,*(uint *)(in_ECX + 0x72c)); } pbVar5 = (byte *)(in_ECX + 0x704); if ((byte *)(in_ECX + 0x6ec) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x718)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x6ec),pbVar5,*(uint *)(in_ECX + 0x714)); } pbVar3 = (byte *)(in_ECX + 0x6ec); pbVar5 = (byte *)(in_ECX + 0x6d4); if (pbVar5 != pbVar3) { if (0xf < *(uint *)(in_ECX + 0x700)) { pbVar3 = *(byte **)pbVar3; } std::string::assign((char *)pbVar5,pbVar3,*(uint *)(in_ECX + 0x6fc)); } if ((byte *)(in_ECX + 0x6bc) != pbVar5) { if (0xf < *(uint *)(in_ECX + 0x6e8)) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)(in_ECX + 0x6bc),pbVar5,*(uint *)(in_ECX + 0x6e4)); } ExceptionList = local_1c; return; } //@@ 004303e0 ItemUseAnim::update /* DB: ? thiscall on an active-item overlay struct (+0 active, +4 item kind, ANM2 at +0x128 and others): updates its AnimationStates and plays "D6Result"/"D20Result" when the pending animation name (+0x15c) matches, for kinds 0x16-0x1b and 0x1c-0x2f; callers Entity_Player::Update, Game::render_debug_overlay */ void ItemUseAnim::update(void) { int iVar1; byte bVar2; byte *pbVar3; uint uVar4; char *in_ECX; byte *pbVar5; bool bVar6; if (*in_ECX == '\0') { return; } if (*(int *)(in_ECX + 4) != 0x15) { if (in_ECX[0x231] != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x158)); AnimationState::Update((AnimationState *)(in_ECX + 0x178)); } if (in_ECX[0x11d] != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x44)); AnimationState::Update((AnimationState *)(in_ECX + 100)); } iVar1 = *(int *)(in_ECX + 4); if (iVar1 - 0x16U < 6) { if ((*(int *)(in_ECX + 0x15c) != 0) && (in_ECX[0x16c] == '\0')) { pbVar3 = *(byte **)(in_ECX + 0x15c); if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar5 = &DAT_00b1ce88; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_00430484: uVar4 = -(uint)bVar6 | 1; goto LAB_00430489; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_00430484; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00430489: if (uVar4 == 0) { ANM2::Play((ANM2 *)(in_ECX + 0x128),(byte *)"D6Result",0); } } bVar2 = ANM2::IsPlaying((ANM2 *)(in_ECX + 0x128),(byte *)"D6Result"); if ((bVar2 == 0) || (*(int *)(in_ECX + 0x15c) == 0)) goto LAB_00430589; uVar4 = *(int *)(in_ECX + 4) - 0x16; } else if (iVar1 - 0x1cU < 0x14) { if ((*(int *)(in_ECX + 0x15c) != 0) && (in_ECX[0x16c] == '\0')) { pbVar3 = *(byte **)(in_ECX + 0x15c); if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar5 = &DAT_00b1ce98; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_00430523: uVar4 = -(uint)bVar6 | 1; goto LAB_00430528; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_00430523; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00430528: if (uVar4 == 0) { ANM2::Play((ANM2 *)(in_ECX + 0x128),(byte *)"D20Result",0); } } bVar2 = ANM2::IsPlaying((ANM2 *)(in_ECX + 0x128),(byte *)"D20Result"); if ((bVar2 == 0) || (*(int *)(in_ECX + 0x15c) == 0)) goto LAB_00430589; uVar4 = *(int *)(in_ECX + 4) - 0x1c; } else { uVar4 = iVar1 - 0x30; if ((10 < uVar4) || (*(int *)(in_ECX + 0x15c) == 0)) goto LAB_00430589; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x158),(float)(int)uVar4); } LAB_00430589: iVar1 = *(int *)(in_ECX + 8); *(uint *)(in_ECX + 8) = iVar1 + 1U; if ((*(uint *)(in_ECX + 0xc) != 0) && (*(uint *)(in_ECX + 0xc) < iVar1 + 1U)) { *in_ECX = '\0'; in_ECX[4] = '<'; in_ECX[5] = '\0'; in_ECX[6] = '\0'; in_ECX[7] = '\0'; in_ECX[8] = '\0'; in_ECX[9] = '\0'; in_ECX[10] = '\0'; in_ECX[0xb] = '\0'; in_ECX[0xc] = '\0'; in_ECX[0xd] = '\0'; in_ECX[0xe] = '\0'; in_ECX[0xf] = '\0'; } return; } //@@ 004305c0 Game::Update /* ZHL [prefix40/41] __thiscall void Game::Update(); */ void __thiscall Game::Update(Game *this,Vector *param_2) { Manager *pMVar1; void *settings; KColor *color; KColor *color_00; KColor *color_01; int extraout_EDX; FontSettings local_4c [7]; KColor local_30; Vector local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1fcd; local_10 = ExceptionList; ExceptionList = &local_10; if ((char)this->_stage != '\0') { if (this->field_0x10 != '\0') { if (this->_stageType == 0x15) goto LAB_0043061e; ANM2::Render((ANM2 *)this->_roomList,param_2,&g_vectorZero,&g_vectorZero); } if (this->_stageType == 0x15) { LAB_0043061e: pMVar1 = g_manager; local_1c.x = param_2->x - 12.0; local_1c.y = param_2->y + 0.0; FontSettings::constructor(local_4c); if (extraout_EDX < 0x14) { local_8 = 0; KColor::SetFromARGB(&local_30,0xffffffff); Font::DrawStringScaled(&pMVar1->_font2_TeamMeatEx12,&DAT_00b1cebc,&local_1c,color,settings); ExceptionList = local_10; return; } if (extraout_EDX < 0x28) { local_8 = 1; KColor::SetFromARGB(&local_30,0xffffffff); Font::DrawStringScaled (&pMVar1->_font2_TeamMeatEx12,&DAT_00b1ceb8,&local_1c,color_00,settings); ExceptionList = local_10; return; } local_8 = 2; KColor::SetFromARGB(&local_30,0xffffffff); Font::DrawStringScaled(&pMVar1->_font2_TeamMeatEx12,&DAT_00b1cec0,&local_1c,color_01,settings) ; ExceptionList = local_10; return; } ANM2::Render((ANM2 *)&this->_roomList[1].SpawnSeed,param_2,&g_vectorZero,&g_vectorZero); } ExceptionList = local_10; return; } //@@ 00430750 FUN_00430750 void FUN_00430750(int param_1,undefined4 param_2) { byte *anim; undefined1 *in_ECX; *(undefined4 *)(in_ECX + 0xc) = param_2; *in_ECX = 1; if (*(int *)(in_ECX + 4) != param_1) { *(int *)(in_ECX + 4) = param_1; *(undefined4 *)(in_ECX + 8) = 0; if (param_1 != 0x15) { anim = in_ECX + param_1 * 0x18 + 0x23c; if (0xf < *(uint *)(anim + 0x14)) { anim = *(byte **)anim; } ANM2::Play((ANM2 *)(in_ECX + 0x128),anim,0); if (in_ECX[0x231] != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x158)); AnimationState::Update((AnimationState *)(in_ECX + 0x178)); } } } return; } //@@ 004307c0 init_engine_parameters /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: IsaacMain before KAGE init: "%s/options.ini", "The Binding of Isaac: Repentance+", "1.9.7.16", EnableEpicOverlay, "SetEngineParameters must be called before calling KAGE::Initialize" */ void init_engine_parameters(void) { uint uVar1; void *pvVar2; undefined1 uVar3; uint uVar4; uint uVar5; int *piVar6; int iVar7; undefined4 extraout_ECX; int extraout_ECX_00; char *ptr; void *pvVar8; int extraout_ECX_01; size_t sVar9; void *local_4c4; int local_4c0; int local_4bc; undefined4 local_4b8; void *local_4b4; int local_4b0; int local_4ac; undefined4 local_4a8; char *local_4a0; char *pcStack_49c; char *pcStack_498; char *pcStack_494; char *local_490; char *pcStack_48c; char *pcStack_488; undefined4 uStack_484; undefined4 local_480; undefined4 **local_47c; undefined4 local_478; undefined4 local_474; undefined1 local_470; undefined1 local_46f; undefined4 local_46c; undefined4 local_468; size_t local_464; void *local_460; int local_45c; int local_458; void *local_454; uint local_450; void *local_44c; void *local_448; char *local_444 [4]; undefined4 local_434; uint local_430; undefined8 local_42c; undefined1 local_424; undefined1 local_423; void *local_420; int local_41c; uint local_418; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af2059; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; FUN_00430f50(local_14); local_460 = (void *)0x0; local_45c = 0; local_458 = 0; local_8._0_1_ = 1; local_8._1_3_ = 0; std::vector<16byte_ff>::_Resize_reallocate(0x20,extraout_ECX); local_448 = (void *)(local_45c - (int)local_460); local_454 = (void *)((int)local_448 >> 4); local_450 = 0; do { iVar7 = *(int *)((int)&DAT_00c33954 + local_450); pvVar8 = *(void **)((int)&DAT_00c33950 + local_450); if (iVar7 == 0x11) { iVar7 = 7; } else if (iVar7 == 0x12) { iVar7 = 5; } else if (iVar7 == -1) { KAGE_LogMessage(0x10,(byte *)"Failed to convert standard button to platform button\n"); } if (local_454 <= pvVar8) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); } uVar4 = 0; do { if (*(int *)((int)local_460 + uVar4 * 4 + (int)pvVar8 * 0x10) == -1) { *(int *)((int)local_460 + uVar4 * 4 + (int)pvVar8 * 0x10) = iVar7; goto LAB_004308d0; } uVar4 = uVar4 + 1; } while (uVar4 < 4); KAGE_LogMessage(0x10,(byte *)"Mapping slot overflow\n"); LAB_004308d0: local_450 = local_450 + 8; } while (local_450 < 0x148); local_4a8 = 0xf000000; iVar7 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar7 + 0xc) < DAT_00c7f6fc) && (_Init_thread_header(&DAT_00c7f6fc), iVar7 = extraout_ECX_00, DAT_00c7f6fc == -1)) { local_418 = 0xf; local_41c = 9; local_42c = 0x312e372e392e3176; local_424 = 0x37; local_423 = 0; local_8._0_1_ = 4; local_444[0] = std::_Allocate(0x20); local_434 = 0x1e; local_430 = 0x1f; builtin_strncpy(local_444[0],"Binding of Isaac: Repentance+ ",0x1f); local_8._0_1_ = 5; std::string::concat_move((char *)&DAT_00c7f700,(int)local_448,local_444,&local_42c); local_8._0_1_ = 4; if (0xf < local_430) { uVar4 = local_430 + 1; ptr = local_444[0]; if (0xfff < uVar4) { ptr = *(char **)(local_444[0] + -4); uVar4 = local_430 + 0x24; if ((char *)0x1f < local_444[0] + (-4 - (int)ptr)) goto LAB_00430a9d; } operator_delete(ptr,uVar4); } local_8._0_1_ = 3; if (0xf < local_418) { uVar4 = local_418 + 1; pvVar8 = (void *)local_42c; if (0xfff < uVar4) { pvVar8 = *(void **)((int)(void *)local_42c + -4); uVar4 = local_418 + 0x24; if (0x1f < (uint)((int)(void *)local_42c + (-4 - (int)pvVar8))) goto LAB_00430a9d; } operator_delete(pvVar8,uVar4); } _atexit(FUN_00b153f0); _Init_thread_footer(&DAT_00c7f6fc); iVar7 = extraout_ECX_01; } local_47c = &DAT_00c7f700; local_478 = 0x3c0; if (0xf < DAT_00c7f714) { local_47c = (undefined4 **)DAT_00c7f700; } local_474 = 0x21c; local_470 = 0; local_46c = 0x65; local_420 = (void *)0x0; local_41c = 0; local_418 = 0; local_8 = CONCAT31(local_8._1_3_,6); std::vector<16byte_ff>::_Resize_reallocate(0x20,iVar7); local_464 = local_41c - (int)local_420; local_450 = (int)local_464 >> 4; uVar4 = 0; do { uVar1 = *(uint *)((int)&DAT_00c33b10 + uVar4); local_468 = *(undefined4 *)((int)&DAT_00c33b14 + uVar4); if (local_450 <= uVar1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); } uVar5 = 0; do { if (*(int *)((int)local_420 + uVar5 * 4 + uVar1 * 0x10) == -1) { *(undefined4 *)((int)local_420 + uVar5 * 4 + uVar1 * 0x10) = local_468; goto LAB_00430a08; } uVar5 = uVar5 + 1; } while (uVar5 < 4); KAGE_LogMessage(0x10,(byte *)"Mapping slot overflow\n"); LAB_00430a08: uVar4 = uVar4 + 8; } while (uVar4 < 0x108); local_8._0_1_ = 7; if ((uint)(local_4ac - (int)local_4b4 >> 4) < local_450) { vector16_clear_and_reserve(&local_4b4,local_450); } pvVar2 = local_420; pvVar8 = local_4b4; memmove(local_4b4,local_420,local_464); local_4b0 = local_464 + (int)pvVar8; local_8._0_1_ = 2; if (pvVar2 != (void *)0x0) { uVar4 = local_418 - (int)pvVar2 & 0xfffffff0; pvVar8 = pvVar2; if (0xfff < uVar4) { pvVar8 = *(void **)((int)pvVar2 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar8))) { LAB_00430a9d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar4); } if ((void *)(local_4bc - (int)local_4c4 >> 4) < local_454) { vector16_clear_and_reserve(&local_4c4,(uint)local_454); } pvVar2 = local_448; pvVar8 = local_4c4; memmove(local_4c4,local_460,(size_t)local_448); local_4c0 = (int)pvVar2 + (int)pvVar8; local_4b8 = 4; local_4a0 = "The Binding of Isaac: Repentance+"; pcStack_49c = "1.9.7.16"; pcStack_498 = "2a90dd094ae6410893d37349c597105a"; pcStack_494 = "dbf5337d024e457bac68f2059112da86"; local_490 = "5ad64cf01c9840e2b915f94ab97402b1"; pcStack_48c = "xyza7891iNiEvbvoaoq8R9vcejo9TFd0"; pcStack_488 = "qr2i404Dada5bxP/rCurS0u81l3B2I8H3fwkoyBmgRo"; local_480 = CONCAT31(local_480._1_3_,1); sprintf(local_414,(byte *)"%s/options.ini"); piVar6 = FileSystem::Open(&PTR_vftable_00c37a10,local_414,(int *)0x0); if (piVar6 != (int *)0x0) { (**(code **)(*piVar6 + 0xc))(0,0); iVar7 = (**(code **)(*piVar6 + 4))(); local_454 = operator_new_tracked(iVar7 + 1); (**(code **)(*piVar6 + 0x14))(local_454,iVar7,1); *(undefined1 *)(iVar7 + (int)local_454) = 0; (**(code **)*piVar6)(1); pvVar8 = local_454; if (local_454 != (void *)0x0) { keyvalue_map_parse(local_454); local_8._0_1_ = 8; uVar3 = OptionsConfig::read_bool("EnableEpicOverlay",1); local_480 = CONCAT31(local_480._1_3_,uVar3); local_8._0_1_ = 9; tracked_alloc(1,pvVar8,0); local_8._0_1_ = 2; FUN_00431200(&local_44c,*(undefined4 *)((int)local_44c + 4)); operator_delete(local_44c,0x40); } } iVar7 = local_4c0; if (DAT_00c78aad == '\0') { _DAT_00c799e0 = 5; uVar4 = local_4c0 - (int)local_4c4 >> 4; local_448 = local_4c4; if ((uint)(DAT_00c799f0 - (int)DAT_00c799e8 >> 4) < uVar4) { vector16_clear_and_reserve(&DAT_00c799e8,uVar4); } pvVar8 = DAT_00c799e8; sVar9 = iVar7 - (int)local_448; memmove(DAT_00c799e8,local_448,sVar9); iVar7 = local_4b0; DAT_00c799ec = sVar9 + (int)pvVar8; DAT_00c799f4 = local_4b8; uVar4 = local_4b0 - (int)local_4b4 >> 4; local_448 = local_4b4; if ((uint)(DAT_00c79a00 - (int)DAT_00c799f8 >> 4) < uVar4) { vector16_clear_and_reserve(&DAT_00c799f8,uVar4); } pvVar8 = DAT_00c799f8; sVar9 = iVar7 - (int)local_448; memmove(DAT_00c799f8,local_448,sVar9); DAT_00c799fc = sVar9 + (int)pvVar8; DAT_00c79a04 = local_4a8; _DAT_00c79a2c = local_480; DAT_00c79a30 = local_47c; DAT_00c79a34 = local_478; DAT_00c79a38 = local_474; DAT_00c79a3c = local_470; DAT_00c79a0c = local_4a0; DAT_00c79a10 = pcStack_49c; DAT_00c79a14 = pcStack_498; DAT_00c79a18 = pcStack_494; DAT_00c79a3d = local_46f; _DAT_00c79a40 = local_46c; DAT_00c79a1c = local_490; DAT_00c79a20 = pcStack_48c; DAT_00c79a24 = pcStack_488; DAT_00c79a28 = uStack_484; } else { KAGE_LogMessage(0x10,(byte *) "SetEngineParameters must be called before calling KAGE::Initialize\n"); } if (local_460 != (void *)0x0) { FUN_005cbf50(local_460,local_458 - (int)local_460 >> 4); } FUN_004b3950(); FUN_004b3950(); ExceptionList = local_10; return; } //@@ 00430f50 FUN_00430f50 void FUN_00430f50(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 1; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0x8000000; in_ECX[0xb] = "EGS KAGE Game"; in_ECX[0xc] = &DAT_00b76e84; in_ECX[0xd] = "00000000000000000000000000000000"; in_ECX[0xe] = "00000000000000000000000000000000"; in_ECX[0xf] = "00000000000000000000000000000000"; in_ECX[0x10] = "00000000000000000000000000000000"; in_ECX[0x11] = "0000000000000000000000000000000000000000000"; in_ECX[0x12] = "0000000000000000000000000000000000000000000000000000000000000000"; *(undefined1 *)(in_ECX + 0x13) = 1; in_ECX[0x14] = "KAGE Game"; in_ECX[0x15] = 0x780; in_ECX[0x16] = 0x438; *(undefined2 *)(in_ECX + 0x17) = 0x101; in_ECX[0x18] = 0; return; } //@@ 00431030 FUN_00431030 void FUN_00431030(void) { FUN_004b3950(); FUN_004b3950(); return; } //@@ 00431050 FUN_00431050 void FUN_00431050(void) { int *in_ECX; FUN_00431200(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x40); return; } //@@ 00431070 std::string::concat_move /* DB: std::operator+(string&&, string&&): steals the buffer of whichever operand has capacity (memcpy/memmove of the other), _Xlen on overflow, result in ECX; used for path building (costume_path_apply_skin_color, HUD::LoadGraphics) prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall std::string::concat_move(char *this,int unused,void *left,void *right) { uint uVar1; uint _Size; uint uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; uint uVar6; void *pvVar7; char *pcVar8; this[0] = '\0'; this[1] = '\0'; this[2] = '\0'; this[3] = '\0'; this[0x10] = '\0'; this[0x11] = '\0'; this[0x12] = '\0'; this[0x13] = '\0'; this[0x14] = '\0'; this[0x15] = '\0'; this[0x16] = '\0'; this[0x17] = '\0'; _Size = *(uint *)((int)left + 0x10); uVar2 = *(uint *)((int)right + 0x10); uVar1 = uVar2 + _Size; if ((uVar2 <= *(int *)((int)left + 0x14) - _Size) && (*(uint *)((int)right + 0x14) <= *(uint *)((int)left + 0x14))) { uVar3 = *(undefined4 *)((int)left + 4); uVar4 = *(undefined4 *)((int)left + 8); uVar5 = *(undefined4 *)((int)left + 0xc); *(undefined4 *)this = *(undefined4 *)left; *(undefined4 *)(this + 4) = uVar3; *(undefined4 *)(this + 8) = uVar4; *(undefined4 *)(this + 0xc) = uVar5; *(undefined8 *)(this + 0x10) = *(undefined8 *)((int)left + 0x10); *(undefined4 *)((int)left + 0x10) = 0; *(undefined4 *)((int)left + 0x14) = 0xf; *(undefined1 *)left = 0; pcVar8 = this; if (0xf < *(uint *)(this + 0x14)) { pcVar8 = *(char **)this; } if (0xf < *(uint *)((int)right + 0x14)) { right = *(void **)right; } memcpy(pcVar8 + _Size,right,uVar2 + 1); *(uint *)(this + 0x10) = uVar1; return this; } if (_Size <= *(uint *)((int)right + 0x14) - uVar2) { uVar3 = *(undefined4 *)((int)right + 4); uVar4 = *(undefined4 *)((int)right + 8); uVar5 = *(undefined4 *)((int)right + 0xc); *(undefined4 *)this = *(undefined4 *)right; *(undefined4 *)(this + 4) = uVar3; *(undefined4 *)(this + 8) = uVar4; *(undefined4 *)(this + 0xc) = uVar5; *(undefined8 *)(this + 0x10) = *(undefined8 *)((int)right + 0x10); *(undefined4 *)((int)right + 0x10) = 0; *(undefined4 *)((int)right + 0x14) = 0xf; *(undefined1 *)right = 0; pvVar7 = *(void **)this; memmove((void *)((int)pvVar7 + _Size),pvVar7,uVar2 + 1); if (0xf < *(uint *)((int)left + 0x14)) { left = *(void **)left; } memcpy(pvVar7,left,_Size); *(uint *)(this + 0x10) = uVar1; return this; } if (0x7fffffff - _Size < uVar2) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar6 = uVar1 | 0xf; if (uVar6 < 0x80000000) { if (uVar6 < 0x16) { uVar6 = 0x16; } } else { uVar6 = 0x7fffffff; } pvVar7 = _Allocate(uVar6 + 1); *(uint *)(this + 0x10) = uVar1; *(void **)this = pvVar7; *(uint *)(this + 0x14) = uVar6; if (0xf < *(uint *)((int)left + 0x14)) { left = *(void **)left; } memcpy(pvVar7,left,_Size); if (0xf < *(uint *)((int)right + 0x14)) { right = *(void **)right; } memcpy((void *)(_Size + (int)pvVar7),right,uVar2 + 1); return this; } //@@ 00431200 FUN_00431200 void FUN_00431200(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00431200(param_1,param_2[2]); piVar2 = (int *)*param_2; std::string::_Tidy_deallocate((char *)(param_2 + 10)); std::string::_Tidy_deallocate((char *)(param_2 + 4)); operator_delete(param_2,0x40); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00431260 FUN_00431260 void FUN_00431260(void) { float in_XMM0_Da; sqrtf(in_XMM0_Da); return; } //@@ 00431270 FUN_00431270 void FUN_00431270(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; return; } //@@ 00431290 FUN_00431290 void FUN_00431290(undefined4 *param_1) { undefined4 uVar1; undefined4 *in_ECX; undefined4 in_XMM2_Da; uVar1 = *param_1; in_ECX[1] = param_1[1]; *in_ECX = uVar1; in_ECX[2] = in_XMM2_Da; return; } //@@ 004312b0 FUN_004312b0 void FUN_004312b0(void) { float *in_ECX; sqrtf(*in_ECX * *in_ECX + in_ECX[1] * in_ECX[1] + in_ECX[2] * in_ECX[2]); return; } //@@ 004312e0 Sprite::GetFilename /* ZHL [lua] Lua binding Sprite:GetFilename */ char * Sprite::GetFilename(char *param_1) { void *in_ECX; std::string::string(param_1,in_ECX); return param_1; } //@@ 00431300 Sprite::SetOverlayRenderPriority /* ZHL [lua] Lua binding Sprite:SetOverlayRenderPriority */ void __thiscall Sprite::SetOverlayRenderPriority(Sprite *this,byte param_2) { this->_overlayRenderFirst = param_2; return; } //@@ 00431310 EntityRef::constructor /* DB: fills EntityRef from Entity* (type 0x28, variant 0x2c, pos 0x33c, vel 0x360, charm/friendly flags); ZHL EntityRef::constructor(Entity*) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall EntityRef::constructor(EntityRef *this,Entity *entity) { float fVar1; uint uVar2; float fVar3; uint uVar4; uint uVar5; if (entity == (Entity *)0x0) { this->_type = 0; this->_variant = 0; this->_spawnerType = 0; this->_spawnerVariant = 0; fVar1 = g_vectorZero.x; fVar3 = g_vectorZero.y; } else { this->_type = entity->_type; this->_variant = entity->_variant; this->_spawnerType = entity->_spawnerType; this->_spawnerVariant = entity->_spawnerVariant; fVar1 = (entity->_pos).x; fVar3 = (entity->_pos).y; } (this->_position).x = fVar1; (this->_position).y = fVar3; if (entity == (Entity *)0x0) { fVar1 = g_vectorZero.x; fVar3 = g_vectorZero.y; } else { fVar1 = (entity->_velocity).x; fVar3 = (entity->_velocity).y; } (this->_velocity).x = fVar1; (this->_velocity).y = fVar3; if ((entity == (Entity *)0x0) || ((entity->_flags & 0x100) == 0)) { uVar5 = 0; if (entity != (Entity *)0x0) goto LAB_004313dc; uVar5 = 0; LAB_004313f5: uVar4 = 0; if (entity != (Entity *)0x0) goto LAB_004313fb; } else { uVar5 = 1; LAB_004313dc: if ((entity->_flags & 0x20000000) == 0) goto LAB_004313f5; uVar4 = 2; LAB_004313fb: if ((entity->_flags & 0x40000000000000) != 0) { uVar2 = 4; goto LAB_00431416; } } uVar2 = 0; LAB_00431416: this->_entity = entity; this->_flags = uVar2 | uVar4 | uVar5; return; } //@@ 00431430 Entity::SpawnerType /* ZHL [lua] Lua binding Entity:SpawnerType */ int __thiscall Entity::SpawnerType(Entity *this) { return this->_spawnerType; } //@@ 00431440 Entity::SpawnerVariant /* ZHL [lua] Lua binding Entity:SpawnerVariant */ int __thiscall Entity::SpawnerVariant(Entity *this) { return this->_spawnerVariant; } //@@ 00431450 Entity::AddVelocity /* DB: velocity(0x360) += vec * (ignoreFriction ? 1 : friction 0x39c); Lua Entity:AddVelocity prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity::AddVelocity(Entity *this,Vector *velocity,byte isIgnoreSpeedMultiplier) { float fVar1; float fVar2; if (isIgnoreSpeedMultiplier == 0) { fVar2 = this->_speedMultiplier; } else { fVar2 = 1.0; } fVar1 = velocity->y; (this->_velocity).x = fVar2 * velocity->x + (this->_velocity).x; (this->_velocity).y = fVar1 * fVar2 + (this->_velocity).y; return; } //@@ 004314b0 Entity::AddVelocity_divided /* DB: velocity(0x360) += vec * speedMult / friction (the Lua binding); 00431450 Entity::AddVelocity the undivided one (boss_fidelity_4) */ void __thiscall Entity::AddVelocity_divided(Entity *this,Vector *velocity,byte isIgnoreSpeedMultiplier) { float fVar1; float fVar2; float fVar3; fVar1 = this->_friction; if (fVar1 != 0.0) { if (isIgnoreSpeedMultiplier == 0) { fVar3 = this->_speedMultiplier; } else { fVar3 = 1.0; } fVar2 = velocity->y; (this->_velocity).x = (fVar3 * velocity->x) / fVar1 + (this->_velocity).x; (this->_velocity).y = (fVar2 * fVar3) / fVar1 + (this->_velocity).y; } return; } //@@ 00431520 Entity::Mass /* ZHL [lua] Lua binding Entity:Mass */ float10 __thiscall Entity::Mass(Entity *this) { return (float10)this->_mass; } //@@ 00431530 Entity::IsTear /* DB: type==2 prototype: db/protos.zhl */ byte __thiscall Entity::IsTear(Entity *this) { return this->_type == 2; } //@@ 00431540 Entity::IsProjectile /* DB: type==9 check prototype: db/protos.zhl */ byte __thiscall Entity::IsProjectile(Entity *this) { return this->_type == 9; } //@@ 00431550 Entity::is_pickup /* DB: tiny: type == 5 (ICF caution) (dogma_effects.md) */ bool __thiscall Entity::is_pickup(Entity *this) { return this->_type == 5; } //@@ 00431560 Entity::Child /* ZHL [lua] Lua binding Entity:Child */ EntityPtr __thiscall Entity::Child(Entity *this) { return this->_child; } //@@ 00431570 sorted_vector_insert_unique /* DB: binary search lower_bound then insert uint if absent prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall sorted_vector_insert_unique(void *this,uint value) { uint *puVar1; size_t _Size; uint uVar2; uint uVar3; uint *_Src; puVar1 = *(uint **)((int)this + 4); _Src = *(uint **)this; uVar3 = (int)puVar1 - (int)_Src >> 2; if (0 < (int)uVar3) { do { uVar2 = uVar3 >> 1; if (_Src[uVar2] < value) { _Src = _Src + uVar2 + 1; uVar2 = uVar3 + (-1 - uVar2); } uVar3 = uVar2; } while (0 < (int)uVar2); } if ((_Src == puVar1) || (value < *_Src)) { if (puVar1 != *(uint **)((int)this + 8)) { if (_Src == puVar1) { *puVar1 = value; *(int *)((int)this + 4) = *(int *)((int)this + 4) + 4; return; } *puVar1 = puVar1[-1]; *(int *)((int)this + 4) = *(int *)((int)this + 4) + 4; _Size = (int)puVar1 + (-4 - (int)_Src); memmove((void *)((int)puVar1 - _Size),_Src,_Size); *_Src = value; return; } std::vector::_Emplace_reallocate(_Src,&value); } return; } //@@ 00431620 FUN_00431620 void FUN_00431620(Entity *param_1) { uint value; void *in_ECX; value = Entity::GetHitListIndex(param_1); sorted_vector_insert_unique(in_ECX,value); return; } //@@ 00431640 EntityList::HitListContains /* DB: ?binary_search of Entity::GetHitListIndex in sorted uint vector prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall EntityList::HitListContains(EntityList *this,Entity *entity) { uint *puVar1; uint uVar2; uint uVar3; uint uVar4; uVar3 = Entity::GetHitListIndex(entity); puVar1 = *(uint **)this; uVar4 = (int)*(uint **)&this->field_0x4 - (int)puVar1 >> 2; while (uVar2 = uVar4, 0 < (int)uVar2) { uVar4 = uVar2 >> 1; if (puVar1[uVar4] < uVar3) { puVar1 = puVar1 + uVar4 + 1; uVar4 = uVar2 + (-1 - uVar4); } } if ((puVar1 == *(uint **)&this->field_0x4) || (*puVar1 != uVar3)) { return 0; } return 1; } //@@ 004316a0 Entity_Bomb::IsFetus /* ZHL [lua] Lua binding EntityBomb:IsFetus */ byte __thiscall Entity_Bomb::IsFetus(Entity_Bomb *this) { return this->_isFetus; } //@@ 004316b0 FUN_004316b0 void FUN_004316b0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x34) = param_1; return; } //@@ 004316c0 FUN_004316c0 void FUN_004316c0(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x10) = in_XMM1_Da; return; } //@@ 004316d0 Entity_Player::GetFireDirection /* ZHL [lua] Lua binding EntityPlayer:GetFireDirection */ int __thiscall Entity_Player::GetFireDirection(Entity_Player *this) { return this->_fireDirection; } //@@ 004316e0 Entity_Player::GetAimDirection /* ZHL [lua] Lua binding EntityPlayer:GetAimDirection */ Vector * __thiscall Entity_Player::GetAimDirection(Entity_Player *this) { return &this->_aimDirection; } //@@ 004316f0 Entity_Player::GetNumBlueFlies /* ZHL [lua] Lua binding EntityPlayer:GetNumBlueFlies */ int __thiscall Entity_Player::GetNumBlueFlies(Entity_Player *this) { return this->_numBlueFlies; } //@@ 00431700 FUN_00431700 void FUN_00431700(void) { undefined4 *in_ECX; *in_ECX = IsaacRepentancePlus::Entity_Familiar::ExtraData::vftable; return; } //@@ 00431710 std::_Facet_base::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::_Facet_base::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::_Facet_base::_scalar_deleting_destructor_(_Facet_base *this,uint param_1) { *(undefined ***)this = IsaacRepentancePlus::Entity_Familiar::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(this,4); } return this; } //@@ 00431740 Entity_Pickup::Price /* ZHL [lua] Lua binding EntityPickup:Price */ int __thiscall Entity_Pickup::Price(Entity_Pickup *this) { return this->_price; } //@@ 00431750 Entity_Tear::Height /* ZHL [lua] Lua binding EntityTear:Height */ float10 __thiscall Entity_Tear::Height(Entity_Tear *this) { return (float10)this->_height; } //@@ 00431760 Game::GetDebugFlag /* ZHL [exact] __thiscall bool Game::GetDebugFlag(unsigned int flag); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Game::GetDebugFlag(Game *this,uint flag) { return (*(uint *)(this->_giantBookClickerImage + (flag >> 5) * 4 + 0x24) & 1 << ((byte)flag & 0x1f)) != 0; } //@@ 00431790 FUN_00431790 void FUN_00431790(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = IsaacRepentancePlus::UmbilicalBabyData::vftable; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 6)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1a)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x12)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xc)); std::string::_Tidy_deallocate((char *)(in_ECX + 6)); FUN_00435740(); *in_ECX = IsaacRepentancePlus::Entity_Familiar::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x158); } ExceptionList = local_10; return; } //@@ 00431830 FamiliarHelper::umbilical_baby_load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ECX = Entity_Familiar; only caller Entity_Familiar::Init case variant 0xf0 (240 FAMILIAR_UMBILICAL_BABY / Gello): HasCollectible 0x34 Dr Fetus, 0x105, 0x99, 2 Inner Eye ... picks gfx/familiar/umbilical_baby/{drfetus,innereye,brimstone,techx,...}.png and Sprite::ReplaceSpritesheet + LoadGraphics prototype: db/protos.zhl */ void __fastcall FamiliarHelper::umbilical_baby_load_graphics(Entity_Familiar *familiar) { byte bVar1; LayerState *layer; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte *pbVar2; void *pvVar3; uint uVar4; char *eyeSheet; char *bodySheet; ANM2 *sprite; byte *overlaySheet; std_string sheetPath; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af20f5; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&sheetPath + 0x28U; ExceptionList = &local_10; bVar1 = Entity_Player::HasCollectible(familiar->_player,0x34,0); overlaySheet = (byte *)0xb1d054; if (bVar1 == 0) { overlaySheet = (byte *)0x0; } bVar1 = Entity_Player::HasCollectible(familiar->_player,0x105,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(familiar->_player,0x99,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(familiar->_player,2,0); eyeSheet = "gfx/familiar/umbilical_baby/innereye.png"; if (bVar1 == 0) { eyeSheet = (char *)0x0; } } else { eyeSheet = "gfx/familiar/umbilical_baby/mutantspider.png"; } } else { eyeSheet = "gfx/familiar/umbilical_baby/proptosis.png"; } bVar1 = Entity_Player::HasCollectible(familiar->_player,0x18b,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(familiar->_player,0x14b,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(familiar->_player,0x95,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(familiar->_player,0xa9,0); bodySheet = "gfx/familiar/umbilical_baby/polyphemus.png"; if (bVar1 == 0) { bodySheet = "gfx/familiar/umbilical_baby/base.png"; } } else { bodySheet = "gfx/familiar/umbilical_baby/ipecac.png"; } } else { bodySheet = "gfx/familiar/umbilical_baby/godhead.png"; } } else { bodySheet = "gfx/familiar/umbilical_baby/techx.png"; } bVar1 = Entity_Player::HasCollectible(familiar->_player,0x76,0); if (bVar1 != 0) { bodySheet = "gfx/familiar/umbilical_baby/brimstone.png"; overlaySheet = (byte *)0xb1d17c; } sprite = &familiar->_sprite; sheetPath._size = 0; sheetPath._capacity = 0xf; sheetPath._buf._0_4_ = (void *)0x0; pbVar2 = (byte *)bodySheet; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(sheetPath._buf,(byte *)bodySheet,(int)pbVar2 - (int)(bodySheet + 1)); local_8 = 0; Sprite::ReplaceSpritesheet((Sprite *)sprite,0,&sheetPath); local_8 = 0xffffffff; if (0xf < sheetPath._capacity) { uVar4 = sheetPath._capacity + 1; pvVar3 = (void *)sheetPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(sheetPath._buf._0_4_ + -4); uVar4 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_00431ba4; } operator_delete(pvVar3,uVar4); } sheetPath._size = 0; sheetPath._capacity = 0xf; sheetPath._buf._0_4_ = (void *)0x0; pbVar2 = (byte *)bodySheet; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(sheetPath._buf,(byte *)bodySheet,(int)pbVar2 - (int)(bodySheet + 1)); local_8 = 1; Sprite::ReplaceSpritesheet((Sprite *)sprite,1,&sheetPath); local_8 = 0xffffffff; if (0xf < sheetPath._capacity) { uVar4 = sheetPath._capacity + 1; pvVar3 = (void *)sheetPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(sheetPath._buf._0_4_ + -4); uVar4 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_00431ba4; } operator_delete(pvVar3,uVar4); } layer = ANM2::GetLayer(sprite,(byte *)0x3); layer->_visible = (byte *)eyeSheet != (byte *)0x0; if ((byte *)eyeSheet != (byte *)0x0) { sheetPath._size = 0; sheetPath._capacity = 0xf; sheetPath._buf._0_4_ = (void *)0x0; pbVar2 = (byte *)eyeSheet; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(sheetPath._buf,(byte *)eyeSheet,(int)pbVar2 - (int)(eyeSheet + 1)); local_8 = 2; Sprite::ReplaceSpritesheet((Sprite *)sprite,3,&sheetPath); local_8 = 0xffffffff; if (0xf < sheetPath._capacity) { uVar4 = sheetPath._capacity + 1; pvVar3 = (void *)sheetPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(sheetPath._buf._0_4_ + -4); uVar4 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_00431ba4; } operator_delete(pvVar3,uVar4); } } layer = ANM2::GetLayer(sprite,&DAT_00000004); layer->_visible = overlaySheet != (byte *)0x0; bVar1 = extraout_CL; if (overlaySheet != (byte *)0x0) { sheetPath._size = 0; sheetPath._capacity = 0xf; sheetPath._buf._0_4_ = (void *)0x0; pbVar2 = overlaySheet; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(sheetPath._buf,overlaySheet,(int)pbVar2 - (int)(overlaySheet + 1)); local_8 = 3; Sprite::ReplaceSpritesheet((Sprite *)sprite,4,&sheetPath); local_8 = 0xffffffff; bVar1 = extraout_CL_00; if (0xf < sheetPath._capacity) { uVar4 = sheetPath._capacity + 1; pvVar3 = (void *)sheetPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(sheetPath._buf._0_4_ + -4); uVar4 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)pvVar3))) { LAB_00431ba4: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); bVar1 = extraout_CL_01; } } ANM2::LoadGraphics(sprite,bVar1); ExceptionList = local_10; return; } //@@ 00431be0 Entity_Familiar::ai_umbilical_baby /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Restarted to delay deadcode elimination for space: stack */ /* DB: familiar 3.240: launch over frames 3-10 (180 * eased f, sinc swing 20), cord capsule hits (radius 16, x3), reel-in (characters_9.md) */ void Entity_Familiar::ai_umbilical_baby(undefined4 param_1) { byte *animName; byte bVar1; char cVar2; undefined4 *puVar3; undefined4 *puVar4; Entity *bloodEffect; Weapon *newWeapon; float *extraout_EAX; int iVar5; Vector *pVVar6; LayerState *layer; LayerState *copyLayer; float *pfVar7; undefined4 *puVar8; float *pfVar9; float **ppfVar10; std_vector **ppsVar11; std_vector **ppsVar12; void *pvVar13; Capsule *capsule; int *piVar14; BitSet128 *maskedFlags; Entity_Familiar *in_ECX; undefined1 *ropePointCount; EntityPtr cordSegment; Entity *unused; uint uVar15; uint uVar16; std_vector *psVar17; Entity_Projectile *pEVar18; int iVar19; Entity_Familiar *baby; float fVar20; float fVar21; float fVar22; undefined1 auVar23 [12]; float fVar24; float fVar25; double dVar26; Capsule gridCapsule [10]; Vector bombPush; Vector bombOffset; EntityRef local_20c; Vector tearPushDir; Vector reflectDir; Vector bombPushDir; EntityList_EL capsuleHits; Vector projectileOffset; Vector pickupPos; Vector tearPos; Vector projectilePos; Vector bombPos; float babyPosX; Vector aimDirection; undefined1 local_184 [8]; undefined4 local_17c; undefined1 local_178 [8]; undefined4 local_170; float local_16c; Vector local_168; float local_160; Vector local_15c; Vector local_154; float local_14c; Vector local_148; undefined1 local_140 [4]; undefined1 local_13c [8]; float local_134; Vector local_12c; Vector local_124; Vector local_11c; float *local_114; float local_110; float fStack_10c; undefined8 uStack_108; float *local_fc; Vector *local_f8; Vector local_f4; undefined4 *local_ec; Entity_Familiar *local_e8; int *local_e4; std_vector *local_e0; float local_dc; Vector *local_d8; Vector *local_d4; float local_d0; float *local_cc; ANM2 *local_c8; Vector *local_c4; Entity_Projectile *local_c0; byte local_b9; undefined1 tearHitParams [56]; undefined4 local_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; float tearDamage; Capsule cordCapsule [4]; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; Capsule local_14; void **hitListProbe; Manager *manager; Entity_Player *player; float *prevPoint; ANM2 *sprite; code *vfn; puStack_20 = (undefined1 *)(cordCapsule + 0x13); local_14 = (Capsule)0xffffffff; puStack_18 = &LAB_00af2166; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(cordCapsule + 0x10); if (*(char *)((int)in_ECX->_player + 0x173) != '\0') { return; } ExceptionList = &local_1c; local_e8 = in_ECX; puVar3 = (undefined4 *) __RTDynamicCast(in_ECX->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor,0,local_24) ; local_ec = puVar3; if (puVar3 == (undefined4 *)0x0) { puVar3 = operator_new(0x158); local_12c.y = (float)puVar3; if (puVar3 == (undefined4 *)0x0) { puVar3 = (undefined4 *)0x0; local_ec = (undefined4 *)0x0; } else { local_14 = (Capsule)0x1; puVar8 = puVar3 + 1; *puVar3 = IsaacRepentancePlus::UmbilicalBabyData::vftable; *puVar8 = 0; puVar3[2] = 0; puVar3[3] = 0; puVar3[4] = 0; puVar3[5] = 0; local_ec = puVar3; puVar4 = operator_new(8); puVar4[1] = 0; *puVar8 = puVar4; *puVar4 = puVar8; local_14._0_1_ = 2; ANM2::constructor((ANM2 *)(puVar3 + 6)); puVar3[0x4c] = 0; puVar3[0x4d] = 0; puVar3[0x4e] = 0; puVar3[0x4f] = 0; puVar3[0x53] = 0; puVar3[0x52] = 0; in_ECX = local_e8; } local_14 = (Capsule)0xffffffff; set_extra_data(); std::string::string(anm2Path._buf,&in_ECX->_sprite); local_14 = (Capsule)0x3; ANM2::Load((ANM2 *)(puVar3 + 6),&anm2Path,1); local_14 = (Capsule)0xffffffff; if (0xf < anm2Path._capacity) { uVar15 = anm2Path._capacity + 1; pvVar13 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar15) { pvVar13 = *(void **)(anm2Path._buf._0_4_ + -4); uVar15 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar13,uVar15); } bVar1 = ANM2::SetAnimation((ANM2 *)(puVar3 + 6),&DAT_00b1d20c,1); if (((bVar1 != 0) && (puVar3[0x13] != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(puVar3 + 0x12),0.0), puVar3[0x13] != 0)) { *(undefined1 *)(puVar3 + 0x17) = 0; } Entity_Player::GetTearHitParams(tearHitParams,10,0x3f800000,1); in_ECX->_collisionDamage = tearDamage; *(undefined2 *)(puVar3 + 0x50) = 0; puVar3[0x4c] = local_80; puVar3[0x4d] = uStack_7c; puVar3[0x4e] = uStack_78; puVar3[0x4f] = uStack_74; std::deque<120byte>::resize(); puVar3[0x51] = 0x40a00000; puVar3[0x52] = g_vectorZero.x; puVar3[0x53] = g_vectorZero.y; } if (in_ECX->_updateTime <= 3.0 && in_ECX->_updateTime != 3.0) { LAB_00434e1f: in_ECX->_visible = 0; fVar20 = *(float *)((int)in_ECX->_player + 0x340); (in_ECX->_pos).x = *(float *)((int)in_ECX->_player + 0x33c); (in_ECX->_pos).y = fVar20; ExceptionList = local_1c; return; } if (in_ECX->_visible == 0) { if ((char)param_1 != '\0') goto LAB_00434e1f; uVar15 = Random(); local_154.x = (in_ECX->_targetPosition).x * 6.0; local_154.y = (in_ECX->_targetPosition).y * 6.0; bloodEffect = Game::Spawn(g_game,1000,2,&in_ECX->_pos,&local_154,(Entity *)0x0,2,uVar15); iVar5 = *(int *)bloodEffect; (bloodEffect->_posOffset).x = 0.0; (bloodEffect->_posOffset).y = -15.0; (**(code **)(iVar5 + 0xc))(); in_ECX->_visible = 1; local_dc = *(float *)((int)in_ECX->_player + 0x13e0); LAB_00431f23: pvVar13 = in_ECX->_weapon; if (local_dc == 0.0) { if (pvVar13 != (void *)0x0) { Isaac::DestoryWeapon(&in_ECX->_weapon); } } else if ((pvVar13 == (void *)0x0) || (*(int *)((int)pvVar13 + 0x30) != *(int *)((int)local_dc + 0x30))) { Isaac::DestoryWeapon(&in_ECX->_weapon); newWeapon = Isaac::CreateWeapon(*(int *)((int)local_dc + 0x30),(Entity *)in_ECX); in_ECX->_weapon = newWeapon; } } else { in_ECX->_visible = 1; local_dc = *(float *)((int)in_ECX->_player + 0x13e0); if ((char)param_1 == '\0') goto LAB_00431f23; } player = in_ECX->_player; local_f8 = (Vector *)player->_fireDirection; aimDirection.x = (player->_aimDirection).x; aimDirection.y = (player->_aimDirection).y; local_cc = (float *)CONCAT31(local_cc._1_3_,local_f8 != (Vector *)0xffffffff); local_d0 = (player->_pos).x; local_d8 = (Vector *)(player->_pos).y; local_e0 = (std_vector *)aimDirection.x; local_d4 = local_f8; uStack_108._4_4_ = (Entity_Projectile *)aimDirection.y; Entity_Player::GetBodyMoveDirection(player,&local_f4); local_d0 = local_d0 + *extraout_EAX * 6.0; local_d8 = (Vector *)((float)local_d8 + extraout_EAX[1] + extraout_EAX[1]); cVar2 = CanPlayerFire(in_ECX); if ((cVar2 != '\0') && (in_ECX->_state != 2)) { local_c0 = (Entity_Projectile *)0x0; local_12c.y = 0.0; local_c8 = (ANM2 *)0x0; local_12c.x = 0.0; PickEnemyTarget(in_ECX,800.0,-(uint)(in_ECX->_target != (EntityPtr)0x0) & 8,0x13,&g_vectorZero, 15.0); if ((local_dc != 0.0) && (in_ECX->_weapon != (void *)0x0)) { TryAimAtMarkedTarget(in_ECX,&aimDirection,(int *)&local_d4,&local_12c); local_c8 = (ANM2 *)local_12c.x; local_c0 = (Entity_Projectile *)local_12c.y; if ((local_12c.x == g_vectorZero.x) && (local_12c.y == g_vectorZero.y)) { local_c8 = (ANM2 *)(in_ECX->_pos).x; local_c0 = (Entity_Projectile *)(in_ECX->_pos).y; } } if (in_ECX->_counter < 1) { local_c4 = local_d4; if ((local_d4 == (Vector *)0xffffffff) && ((in_ECX->_headFrameDelay < 1 || (local_c4 = (Vector *)in_ECX->_shootDirection, local_c4 == (Vector *)0xffffffff)))) { local_c4 = (Vector *)0x3; } if ((in_ECX->_weapon == (int *)0x0) || (iVar5 = (**(code **)(*(int *)in_ECX->_weapon + 0x24))(), iVar5 == 0)) { pVVar6 = local_c4; } else { local_11c.x = *(float *)(iVar5 + 0x33c) - (in_ECX->_pos).x; local_11c.y = *(float *)(iVar5 + 0x340) - (in_ECX->_pos).y; pVVar6 = (Vector *)vector_to_direction(&local_11c); } in_ECX->_shootDirection = (int)pVVar6; fVar20 = atan2f(aimDirection.y,aimDirection.x); puVar3[0x54] = fVar20 * 57.295776; } if ((local_dc != 0.0) && (pvVar13 = in_ECX->_weapon, pvVar13 != (void *)0x0)) { *(ANM2 **)((int)pvVar13 + 0x28) = local_c8; *(Entity_Projectile **)((int)pvVar13 + 0x2c) = local_c0; *(undefined4 *)((int)in_ECX->_weapon + 0x10) = *(undefined4 *)((int)local_dc + 0x10); *(undefined4 *)((int)in_ECX->_weapon + 0x34) = *(undefined4 *)((int)local_dc + 0x34); (**(code **)(*(int *)in_ECX->_weapon + 8))(); (**(code **)(*(int *)in_ECX->_weapon + 0xc))(&aimDirection,local_cc,param_1); } if (in_ECX->_fireCooldown == 0) { if (in_ECX->_headFrameDelay < 9) { PlayFloatAnim(in_ECX,in_ECX->_shootDirection); } else { PlayShootAnim(in_ECX,in_ECX->_shootDirection); } } if ((char)param_1 == '\0') { if (0 < in_ECX->_counter) { in_ECX->_counter = in_ECX->_counter + -1; } if (0 < in_ECX->_headFrameDelay) { in_ECX->_headFrameDelay = in_ECX->_headFrameDelay + -1; } if (0 < in_ECX->_fireCooldown) { in_ECX->_fireCooldown = in_ECX->_fireCooldown + -1; } } } local_cc = (float *)((float)puVar3[0x55] * 0.017453292); local_d4 = (Vector *)sin((float)local_cc); local_fc = (float *)cos((float)local_cc); fVar20 = atan2f((float)local_d4,(float)local_fc); fVar20 = fVar20 * 57.295776; if (360.0 < ABS(fVar20)) { fVar20 = fmodf(fVar20,360.0); } if (fVar20 <= 180.0) { if (fVar20 < -180.0) { fVar20 = fVar20 + 360.0; } } else { fVar20 = fVar20 - 360.0; } local_cc = (float *)(fVar20 / 45.0 + 0.5); dVar26 = floor((double)(float)local_cc); local_cc = (float *)((int)dVar26 + 8U & 0x80000007); if ((int)local_cc < 0) { local_cc = (float *)(((uint)((int)local_cc + -1) | 0xfffffff8) + 1); } animName = (&PTR_s_BodySide_00b1d240)[(int)local_cc]; local_c8 = &in_ECX->_sprite; (in_ECX->_sprite)._overlayRenderFirst = local_cc != (float *)&DAT_00000006; ANM2::PlayOverlay(local_c8,animName,0); if (((local_cc == (float *)0x0) || (local_cc == (float *)0x1)) || (local_cc == (float *)&DAT_00000007)) { local_b9 = 1; } else { local_b9 = 0; } local_b9 = (in_ECX->_sprite)._flipX ^ local_b9; layer = ANM2::GetLayer(&in_ECX->_sprite,(byte *)0x1); layer->_flipX = local_b9; local_114 = AnimationState::GetNullFrameById(&(in_ECX->_sprite)._overlayAnimState,0); if (local_114 != (float *)0x0) { local_cc = (float *)(*local_114 + 0.0 + (float)local_fc * 6.0); local_fc = (float *)((local_114[1] - 8.0) + (float)local_d4 * 6.0); layer = ANM2::GetLayer(&in_ECX->_sprite,(byte *)0x0); (layer->_pos).x = (float)local_cc; (layer->_pos).y = (float)local_fc; if ((in_ECX->_sprite)._flipX != 0) { layer = ANM2::GetLayer(local_c8,(byte *)0x0); local_cc = (float *)((uint)(layer->_pos).x ^ 0x80000000); layer = ANM2::GetLayer(local_c8,(byte *)0x0); (layer->_pos).x = (float)local_cc; } sprite = local_c8; layer = ANM2::GetLayer(local_c8,(byte *)0x0); local_c0 = (Entity_Projectile *)0x0; (layer->_size).x = local_114[4]; (layer->_size).y = local_114[5]; do { layer = ANM2::GetLayer(sprite,(byte *)0x0); copyLayer = ANM2::GetLayer(sprite,*(byte **)((int)local_c0 + 0xb1d238)); (copyLayer->_pos).x = (layer->_pos).x; (copyLayer->_pos).y = (layer->_pos).y; layer = ANM2::GetLayer(sprite,(byte *)0x0); copyLayer = ANM2::GetLayer(sprite,*(byte **)((int)local_c0 + 0xb1d238)); (copyLayer->_size).x = (layer->_size).x; (copyLayer->_size).y = (layer->_size).y; local_c0 = (Entity_Projectile *)((int)local_c0 + 4); } while (local_c0 < &DAT_00000008); in_ECX = local_e8; puVar3 = local_ec; } if (in_ECX->_updateTime <= 10.0) { local_d4 = &in_ECX->_targetPosition; fVar20 = atan2f((in_ECX->_targetPosition).y,(in_ECX->_targetPosition).x); puVar3[0x55] = fVar20 * 57.295776; if ((char)param_1 == '\0') { local_dc = in_ECX->_speedMultiplier + in_ECX->_updateTime; pvVar13 = in_ECX->_player; local_c0 = (Entity_Projectile *)((local_dc - 3.0) / 6.0); if (1.0 <= (float)local_c0) { if ((float)local_c0 == 1.0) { fVar20 = 1.2; } else { uStack_108._4_4_ = (Entity_Projectile *)((float)local_c0 - 1.0); fVar20 = sin((float)uStack_108._4_4_ * 10.0); fVar20 = (fVar20 * 0.02) / ((float)local_c0 * (float)local_c0 * (float)uStack_108._4_4_) + 1.0; } } else { fVar20 = cos((float)local_c0 * 3.1415927); fVar20 = (1.0 - fVar20) * 0.6; } local_cc = (float *)(fVar20 * 180.0 * local_d4->y + *(float *)((int)pvVar13 + 0x340)); local_e0 = (std_vector *)(fVar20 * 180.0 * local_d4->x + *(float *)((int)pvVar13 + 0x33c)); if (local_d4->x <= 0.0) { fVar20 = 90.0; } else { fVar20 = -90.0; } uStack_108._4_4_ = (Entity_Projectile *)(fVar20 * 0.017453292); local_c8 = (ANM2 *)cos((float)uStack_108._4_4_); fVar20 = sin((float)uStack_108._4_4_); fVar22 = (float)local_c8 * local_d4->x; local_c8 = (ANM2 *)((float)local_c8 * local_d4->y + fVar20 * local_d4->x); uStack_108._4_4_ = (Entity_Projectile *)(fVar22 - fVar20 * local_d4->y); if ((float)local_c0 == 0.0) { fVar20 = 1.0; } else { local_c0 = (Entity_Projectile *)((float)local_c0 * 10.0); fVar20 = sin((float)local_c0); fVar20 = fVar20 / (float)local_c0; } fVar22 = (local_e8->_pos).y; (local_e8->_velocity).x = ((float)local_e0 + fVar20 * 20.0 * (float)uStack_108._4_4_) - (local_e8->_pos).x; (local_e8->_velocity).y = ((float)local_cc + fVar20 * 20.0 * (float)local_c8) - fVar22; in_ECX = local_e8; } else { local_dc = in_ECX->_speedMultiplier * 0.5 + in_ECX->_updateTime; } local_e0 = (std_vector *) ((in_ECX->_targetPosition).x * 233.99998 + *(float *)((int)in_ECX->_player + 0x33c)); local_cc = (float *)((in_ECX->_targetPosition).y * 233.99998 + *(float *)((int)in_ECX->_player + 0x340)); local_c8 = (ANM2 *)&local_11c; if ((char)param_1 == '\0') { local_11c.y = in_ECX->_speedMultiplier * (in_ECX->_velocity).y + (in_ECX->_pos).y; local_11c.x = in_ECX->_speedMultiplier * (in_ECX->_velocity).x + (in_ECX->_pos).x; } else { local_11c.y = in_ECX->_speedMultiplier * (in_ECX->_velocity).y * 0.5 + (in_ECX->_pos).y; local_11c.x = in_ECX->_speedMultiplier * (in_ECX->_velocity).x * 0.5 + (in_ECX->_pos).x; } uVar16 = 1; pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4]) * 4); *pfVar7 = local_d0; pfVar7[1] = (float)local_d8; pfVar7[2] = -13.0; uVar15 = puVar3[5]; if (1 < uVar15) { do { dVar26 = (double)(int)uVar16; iVar5 = (int)uVar16 >> 0x1f; local_f4.y = (float)puVar3[4]; uVar15 = (int)local_f4.y + uVar16; uVar16 = uVar16 + 1; pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); local_c8 = (ANM2 *)((float)(dVar26 + __uint_to_double_fixup[-iVar5]) / (float)((double)(puVar3[5] + -1) + __uint_to_double_fixup[-(puVar3[5] + -1 >> 0x1f)])); fVar20 = 1.0 - (float)local_c8; uStack_108._4_4_ = (Entity_Projectile *)((fVar20 * -13.0 + (float)local_c8 * -15.0) * fVar20); *pfVar7 = (local_11c.x * (float)local_c8 + local_d0 * fVar20) * (float)local_c8 + ((float)local_e0 * (float)local_c8 + local_d0 * fVar20) * fVar20; pfVar7[2] = (float)uStack_108._4_4_ + (fVar20 * -13.0 + (float)local_c8 * -20.0) * (float)local_c8; pfVar7[1] = (local_11c.y * (float)local_c8 + (float)local_d8 * fVar20) * (float)local_c8 + ((float)local_cc * (float)local_c8 + (float)local_d8 * fVar20) * fVar20; uVar15 = puVar3[5]; } while (uVar16 < uVar15); in_ECX = local_e8; } local_d8 = (Vector *)0x1; if (1 < uVar15) { uVar15 = puVar3[5]; do { pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4] + (int)local_d8) * 4); local_f4.y = (float)puVar3[4]; pfVar9 = *(float **) (puVar3[2] + ((int)local_f4.y + ((int)local_d8 - 1U) & puVar3[3] - 1) * 4); uStack_108._4_4_ = (Entity_Projectile *)(*pfVar7 - *pfVar9); local_e0 = (std_vector *)(pfVar7[1] - pfVar9[1]); if (((float)uStack_108._4_4_ != g_vectorZero.x) || ((float)local_e0 != g_vectorZero.y)) { local_d0 = cos(1.5707964); fVar20 = sin(1.5707964); local_c0 = (Entity_Projectile *) (local_d0 * (float)uStack_108._4_4_ - fVar20 * (float)local_e0); local_d0 = local_d0 * (float)local_e0 + fVar20 * (float)uStack_108._4_4_; fVar20 = sqrtf((float)local_c0 * (float)local_c0 + local_d0 * local_d0); if (0.0 < fVar20) { local_d0 = local_d0 * (1.0 / fVar20); local_c0 = (Entity_Projectile *)((float)local_c0 * (1.0 / fVar20)); } uStack_108._4_4_ = (Entity_Projectile *)(15.0 - local_dc); local_e0 = (std_vector *)0x0; ppsVar12 = (std_vector **)((int)&uStack_108 + 4); if ((local_dc - 6.0) * (float)uStack_108._4_4_ * 0.5 <= 0.0) { ppsVar12 = &local_e0; } local_e0 = (std_vector *)0x0; ppsVar11 = (std_vector **)((int)&uStack_108 + 4); if ((float)uStack_108._4_4_ <= 0.0) { ppsVar11 = &local_e0; } fVar20 = ((float)((double)(int)(uVar15 - (int)local_d8) + __uint_to_double_fixup[-((int)(uVar15 - (int)local_d8) >> 0x1f)]) * ((float)*ppsVar12 + (float)*ppsVar12)) / (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]); local_c0 = (Entity_Projectile *)((float)local_c0 * fVar20); local_d0 = local_d0 * fVar20; fVar20 = (float)((double)(int)local_d8 + __uint_to_double_fixup[-((int)local_d8 >> 0x1f)]) * (float)*ppsVar11 * 0.4; fVar20 = sin(((fVar20 + fVar20) * 3.1415927) / (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) ); local_f4.y = (float)puVar3[4]; pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & (int)local_f4.y + (int)local_d8) * 4); pfVar7[1] = fVar20 * local_d0 + pfVar7[1]; *pfVar7 = fVar20 * (float)local_c0 + *pfVar7; pfVar7[2] = pfVar7[2] + 0.0; uVar15 = puVar3[5]; } local_d8 = (Vector *)((int)local_d8 + 1); } while (local_d8 < uVar15); in_ECX = local_e8; } if (in_ECX->_updateTime <= 4.0) { ExceptionList = local_1c; return; } player = in_ECX->_player; local_d8 = &in_ECX->_pos; local_154.x = (player->_pos).x; local_154.y = (player->_pos).y; babyPosX = local_d8->x; local_12c.y = (in_ECX->_pos).y; local_c8 = (ANM2 *)(in_ECX->_collisionDamage * 3.0); local_d0 = 16.0; local_124.x = babyPosX; local_124.y = local_12c.y; local_114 = (float *)local_154.x; local_fc = (float *)local_154.y; if (((player->_playerType == 0x20) && (bVar1 = Entity_Player::HasCollectible(player,0x26b,0), bVar1 != 0)) && (cordSegment = in_ECX->_child, cordSegment != (EntityPtr)0x0)) { psVar17 = (std_vector *)0x3f800000; do { if (30.0 <= (float)psVar17) break; cordSegment = *(EntityPtr *)((int)cordSegment + 0x3c0); uStack_108._4_4_ = (Entity_Projectile *)((float)psVar17 + 1.0); local_e0 = (std_vector *)0x41f00000; local_c8 = (ANM2 *)((float)local_c8 + 3.0); ppsVar12 = (std_vector **)((int)&uStack_108 + 4); if (30.0 <= (float)uStack_108._4_4_) { ppsVar12 = &local_e0; } psVar17 = *ppsVar12; } while (cordSegment != (EntityPtr)0x0); local_d0 = (float)psVar17 + 16.0; } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0xf7,0); if (bVar1 != 0) { local_d0 = local_d0 * 1.5; } Capsule::constructor2(cordCapsule,&local_154,&local_124,local_d0); if (((uint)g_game->_debugFlags >> 5 & 1) != 0) { pvVar13 = DebugRenderer::Get(&g_game->_debugRenderer,in_ECX->_index,1); Capsule::constructor2((Capsule *)&local_20c,&local_154,&local_124,local_d0); push_shape_points(pvVar13,capsule); } local_c0 = g_game->_room; local_d0 = 18.0; local_124.y = 0.0; local_124.x = 0.0; uStack_108 = 0; Capsule::get_bounding_box(&local_124,&uStack_108); baby = local_e8; uVar15 = (uint)((local_124.x - 40.0) / 40.0 + 0.5); local_dc = (float)0; if (0 < (int)uVar15) { local_dc = (float)uVar15; } piVar14 = (int *)(int)((local_124.y - 120.0) / 40.0 + 0.5); local_f8 = (Vector *)(int *)0x0; if (0 < (int)piVar14) { local_f8 = (Vector *)piVar14; } local_e0 = (std_vector *)((int)(local_c0->_damageEvents)._end + -1); psVar17 = (std_vector *)(int)(((float)uStack_108 - 40.0) / 40.0 + 0.5); if ((int)psVar17 < (int)local_e0) { local_e0 = psVar17; } iVar5 = (int)(local_c0->_damageEvents)._capacity + -1; iVar19 = (int)(((float)uStack_108._4_4_ - 120.0) / 40.0 + 0.5); if (iVar19 < iVar5) { iVar5 = iVar19; } uStack_108 = CONCAT44(iVar5,(float)uStack_108); pEVar18 = local_c0; if ((int)local_dc <= (int)local_e0) { do { local_e4 = (int *)local_f8; fVar20 = local_dc; pVVar6 = local_f8; if ((int)local_f8 <= iVar5) { do { if (((((int)fVar20 < 0) || (pvVar13 = (pEVar18->_damageEvents)._end, (int)pvVar13 <= (int)fVar20)) || ((int)pVVar6 < 0)) || (((int)(pEVar18->_damageEvents)._capacity <= (int)pVVar6 || (iVar5 = (int)pvVar13 * (int)pVVar6 + (int)fVar20, iVar5 < 0)))) { local_c4 = (Vector *)0x0; } else { local_c4 = *(Vector **)((int)(&(pEVar18->_sprite)._filename + -2) + 0xc + iVar5 * 4); } if (local_c4 != (Vector *)0x0) { iVar5 = *(int *)((int)g_game->_room + 0xc); local_124.x = (float)((int)local_c4[4].y % iVar5) * 40.0 + 40.0; local_124.y = (float)((int)local_c4[4].y / iVar5) * 40.0 + 120.0; local_e4 = (int *)pVVar6; Capsule::constructor(gridCapsule,&local_124,&g_vectorOne,0.0,20.0); bVar1 = Capsule::Collide(gridCapsule,cordCapsule,(Vector *)0x0); if (bVar1 != 0) { vfn = *(code **)((int)local_c4->x + 0x10); EntityRef::constructor(&local_20c,(Entity *)baby); (*vfn)(1); pVVar6 = (Vector *)local_e4; } fVar20 = local_dc; pEVar18 = local_c0; } pVVar6 = (Vector *)((int)pVVar6 + 1); iVar5 = (int)uStack_108._4_4_; local_e4 = (int *)pVVar6; } while ((int)pVVar6 <= (int)uStack_108._4_4_); } local_dc = (float)((int)fVar20 + 1); } while ((int)local_dc <= (int)local_e0); } local_124.y = (float)(local_ec + 0x4c); maskedFlags = BitSet128::operator_and ((BitSet128 *)local_140,(BitSet128 *)local_124.y, (BitSet128 *)&DAT_00c34c60); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || (uVar15 = 0x1c, (int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { uVar15 = 0x1e; } local_cc = (float *)0x49742400; local_11c.y = 0.0; local_11c.x = 0.0; local_b9 = '\0'; EntityList::query_player_capsule_hits ((EntityList *)((int)g_game->_room + 0x1218),&capsuleHits,cordCapsule,uVar15); local_14 = (Capsule)0x4; local_c4 = (Vector *)0x0; if (capsuleHits._size != 0) { do { pEVar18 = *(Entity_Projectile **)((int)capsuleHits._data + (int)local_c4 * 4); local_c0 = pEVar18; if ((pEVar18->_size == 0.0) || (pEVar18->_entityCollisionClass == 0)) goto LAB_004345ff; cordSegment = local_e8->_child; if (cordSegment != (EntityPtr)0x0) { do { g_forceCollideDepth = g_forceCollideDepth + 1; entity_collision_classes_match((Entity *)cordSegment,(Entity *)pEVar18); g_forceCollideDepth = g_forceCollideDepth + -1; cordSegment = *(EntityPtr *)((int)cordSegment + 0x3c0); } while (cordSegment != (EntityPtr)0x0); } baby = local_e8; local_f8 = (Vector *)&pEVar18->_type; if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)local_f8 != 1)) { iVar5 = *(int *)local_f8; if (iVar5 - 10U < 0x3de) goto LAB_004344ed; LAB_00434a9f: if (iVar5 == 4) { if (((pEVar18->_parent == (EntityPtr)local_e8->_player) && ((char)pEVar18->_wiggleFrameOffset != '\0')) && (pfVar7 = &(pEVar18->_posOffset).y, !(0.0 < *pfVar7 || *pfVar7 == 0.0))) goto LAB_00434c47; psVar17 = &local_e8->_hitList; local_e0 = psVar17; local_e4 = (int *)Entity::GetHitListIndex((Entity *)pEVar18); puVar8 = (baby->_hitList)._end; puVar3 = psVar17->_begin; uStack_108 = CONCAT44(puVar8,(float)uStack_108); uVar15 = (int)puVar8 - (int)puVar3 >> 2; if (0 < (int)uVar15) { do { uVar16 = uVar15 >> 1; if ((undefined1 *)puVar3[uVar16] < local_e4) { puVar3 = puVar3 + uVar16 + 1; uVar16 = uVar15 + (-1 - uVar16); } uVar15 = uVar16; } while (0 < (int)uVar16); pEVar18 = local_c0; } if ((puVar3 == puVar8) || ((int *)*puVar3 != local_e4)) { FUN_00431620(); bombPos.x = (pEVar18->_pos).x; bombPos.y = (pEVar18->_pos).y; pVVar6 = Vector::__sub(&bombPos,&bombOffset,&local_154); Vector::Normalized(pVVar6,&bombPushDir); bVar1 = 0; pVVar6 = Vector::__mul(&bombPushDir,&bombPush,&local_d0); Entity::AddVelocity_divided((Entity *)pEVar18,pVVar6,bVar1); } } else if (iVar5 == 9) { if (local_e8->_player != (void *)0x0) { if (pEVar18->_dead != 0) goto LAB_00434c47; if (-50.0 < pEVar18->_height) { projectilePos.x = (pEVar18->_pos).x; projectilePos.y = (pEVar18->_pos).y; pVVar6 = Vector::__sub(&projectilePos,&projectileOffset,&local_154); Vector::Normalized(pVVar6,&reflectDir); pVVar6 = Vector::__mul(&reflectDir,(Vector *)(local_184 + 4),&local_d0); Entity_Projectile::Reflect(pEVar18,unused,pVVar6); } } } else { LAB_00434c47: if (((EntityPtr)local_e8->_player == (EntityPtr)0x0) || (iVar5 != 2)) { if (((iVar5 == 5) && (((pEVar18->_variant != 100 && (pEVar18[1]._sprite._eventNames == (void *)0x0)) && (pEVar18->_dead == 0)))) && (((pEVar18->_entityCollisionClass != 0 && (bVar1 = Entity::HasEntityFlags((Entity *)pEVar18,0x4000000), bVar1 == 0)) && (bVar1 = EntityList::HitListContains ((EntityList *)&baby->_hitList,(Entity *)pEVar18), bVar1 == 0)) )) { FUN_00431620(); pickupPos.x = (pEVar18->_pos).x; pickupPos.y = (pEVar18->_pos).y; pVVar6 = Vector::__sub(&pickupPos,&local_148,local_d8); Vector::Normalized(pVVar6,&local_f4); bVar1 = 0; pVVar6 = Vector::__mul(&local_f4,(Vector *)(local_13c + 4),&local_d0); Entity::AddVelocity_divided((Entity *)pEVar18,pVVar6,bVar1); } } else if (pEVar18->_parent == (EntityPtr)local_e8->_player) { local_110 = pEVar18->_curvingStrength; fStack_10c = pEVar18->_acceleration; uStack_108 = *(qword *)&pEVar18->_orbitDistance; maskedFlags = BitSet128::operator_and ((BitSet128 *)((int)&anm2Path + 8),(BitSet128 *)&local_110, &g_tearFlagLudovico); bVar1 = BitSet128::IsNonZero(maskedFlags); if ((bVar1 != 0) && (bVar1 = EntityList::HitListContains ((EntityList *)&baby->_hitList,(Entity *)pEVar18), bVar1 == 0)) { FUN_00431620(); tearPos.x = (pEVar18->_pos).x; tearPos.y = (pEVar18->_pos).y; pVVar6 = Vector::__sub(&tearPos,(Vector *)(local_178 + 4),local_d8); Vector::Normalized(pVVar6,&tearPushDir); pVVar6 = Vector::__mul(&tearPushDir,&local_15c,&local_d0); uStack_108 = CONCAT44(0x3fa00000,(float)uStack_108); pVVar6 = Vector::__mul(pVVar6,&local_168,(float *)((int)&uStack_108 + 4)); (pEVar18->_velocity).x = pVVar6->x; (pEVar18->_velocity).y = pVVar6->y; } } } } else { iVar5 = 1; LAB_004344ed: if ((pEVar18->_flags & 0x20000000) != 0) goto LAB_00434a9f; local_e4 = (int *)Entity::GetHitListIndex((Entity *)pEVar18); local_e0 = (baby->_hitList)._end; psVar17 = (baby->_hitList)._begin; uVar15 = (int)local_e0 - (int)psVar17 >> 2; if (0 < (int)uVar15) { do { uVar16 = uVar15 >> 1; hitListProbe = &psVar17->_begin + uVar16; if (*hitListProbe < local_e4) { psVar17 = (std_vector *)(hitListProbe + 1); uVar16 = uVar15 + (-1 - uVar16); hitListProbe = (void **)psVar17; } uStack_108 = CONCAT44(hitListProbe,(float)uStack_108); uVar15 = uVar16; } while (0 < (int)uVar16); baby = local_e8; pEVar18 = local_c0; } if ((psVar17 == local_e0) || (psVar17->_begin != local_e4)) { iVar5 = *(int *)local_f8; if ((iVar5 != 0xf5) && (iVar5 != 0x124)) { uVar15 = Entity::GetHitListIndex((Entity *)pEVar18); sorted_vector_insert_unique(&baby->_hitList,uVar15); iVar5 = pEVar18->_type; } if (iVar5 == 0x21) { if (pEVar18->_variant == 0xb) { LAB_00434715: if (pEVar18->_dead == 0) { local_e4 = (int *)((pEVar18->_pos).x - (float)local_114); local_f8 = (Vector *)((pEVar18->_pos).y - (float)local_fc); fVar20 = sqrtf((float)local_e4 * (float)local_e4 + (float)local_f8 * (float)local_f8); piVar14 = local_e4; pVVar6 = local_f8; if (0.0 < fVar20) { pVVar6 = (Vector *)((float)local_f8 * (1.0 / fVar20)); piVar14 = (int *)((float)local_e4 * (1.0 / fVar20)); } if ((pEVar18->_flags & 0x4000000) == 0) { fVar22 = 900.0 / (pEVar18->_mass + 50.0); fVar20 = pEVar18->_friction; if (fVar20 != 0.0) { fVar21 = pEVar18->_speedMultiplier; (pEVar18->_velocity).x = (fVar22 * (float)piVar14 * fVar21) / fVar20 + (pEVar18->_velocity).x; (pEVar18->_velocity).y = (fVar22 * (float)pVVar6 * fVar21) / fVar20 + (pEVar18->_velocity).y; } } uStack_108 = 0; bVar1 = Entity::IsVulnerableEnemy((Entity *)pEVar18,(Entity *)0x0); if ((bVar1 == 0) || (((bVar1 = Entity_Player::HasPlayerForm(baby->_player,0), bVar1 == 0 && ((bVar1 = Entity_Player::HasCollectible(baby->_player,0x97,0), bVar1 == 0 || (uVar15 = Random(), uVar15 % 6 != 0)))) || (0x1d < *(int *)((int)baby->_player + 0x136c))))) { local_c0 = uStack_108._4_4_; local_dc = (float)uStack_108; } else { local_dc = 2.29589e-41; local_c0 = (Entity_Projectile *)0x0; } bVar1 = Entity::HasEntityFlags((Entity *)baby,0x400000000); if (bVar1 != 0) { local_dc = (float)((uint)local_dc | 0x20000000); } vfn = *(code **)(*(int *)pEVar18 + 0x20); EntityRef::constructor(&local_20c,local_e8->_player); cVar2 = (*vfn)(local_c8,local_dc,local_c0,&local_20c); if (cVar2 == '\0') { LAB_004349aa: pVVar6 = local_d8; } else { bVar1 = Entity::IsVulnerableEnemy((Entity *)pEVar18,(Entity *)0x0); manager = g_manager; if (bVar1 == 0) goto LAB_004349aa; local_e4 = (int *)0x4d; seed_fart_sound_override((int *)&local_e4); SoundEffects::Play(&manager->_sfxManager,(int)local_e4,1.0,10,0,1.5,0.0); pVVar6 = local_d8; Entity_Tear::ApplyTearFlagEffects ((Entity *)pEVar18,local_d8,*(BitSet128 *)local_124.y, (Entity *)local_e8,(float)local_c8); } if ((pEVar18->_pendingDamage < pEVar18->_health) && (*(char *)(local_ec + 0x50) == '\0')) { *(undefined1 *)(local_ec + 0x50) = 1; } fVar21 = babyPosX - (float)local_114; fVar24 = local_12c.y - (float)local_fc; fVar22 = ((pEVar18->_pos).y - (float)local_fc) * fVar24 + ((pEVar18->_pos).x - (float)local_114) * fVar21; fVar20 = fVar24 * fVar24 + fVar21 * fVar21; fVar21 = (fVar21 * fVar22) / fVar20 + (float)local_114; fVar24 = (fVar24 * fVar22) / fVar20 + (float)local_fc; fVar20 = pVVar6->x - fVar21; fVar22 = pVVar6->y - fVar24; pfVar7 = (float *)(fVar22 * fVar22 + fVar20 * fVar20); if ((float)pfVar7 < (float)local_cc) { local_11c.x = fVar21; local_11c.y = fVar24; local_cc = pfVar7; } local_b9 = '\x01'; } } else { vfn = *(code **)(*(int *)pEVar18 + 0x20); EntityRef::constructor(&local_20c,(Entity *)local_e8->_parent); (*vfn)(0x447a0000,0,0,&local_20c); } } else if (iVar5 == 0x3c3) { piVar14 = baby->_player; g_forceCollideDepth = g_forceCollideDepth + 1; (**(code **)(*piVar14 + 0x5c))(pEVar18); (**(code **)(*(int *)pEVar18 + 0x5c))(piVar14,0); g_forceCollideDepth = g_forceCollideDepth + -1; } else if (iVar5 != 0x11) goto LAB_00434715; } } LAB_004345ff: local_c4 = (Vector *)((int)local_c4 + 1); } while (local_c4 < (uint)capsuleHits._size); if ((local_b9 != '\0') && (*(char *)((int)local_ec + 0x141) == '\0')) { *(undefined1 *)((int)local_ec + 0x141) = 1; play_sound_with_fart_seed(0x1ef,1.0,2,0,1.0); bVar1 = Vector::operator_ne(&local_11c,&g_vectorZero); if (bVar1 != 0) { uVar15 = Random(); local_12c.y = 6.0; pVVar6 = Vector::__mul(local_d4,(Vector *)(local_13c + 4),&local_12c.y); bloodEffect = Game::Spawn(g_game,1000,2,&local_11c,pVVar6,(Entity *)0x0,2,uVar15); iVar5 = *(int *)bloodEffect; (bloodEffect->_posOffset).x = 0.0; (bloodEffect->_posOffset).y = -15.0; (**(code **)(iVar5 + 0xc))(); } } } EntityList_Query::~EntityList_Query(&capsuleHits); ExceptionList = local_1c; return; } if (((0 < in_ECX->_state) && (in_ECX->_headFrameDelay < 1)) && (20.0 < in_ECX->_updateTime)) { if (in_ECX->_state == 1) { fVar20 = (in_ECX->_pos).y; fVar22 = *(float *)((int)in_ECX->_player + 0x340); puVar3[0x52] = (in_ECX->_pos).x - *(float *)((int)in_ECX->_player + 0x33c); puVar3[0x53] = fVar20 - fVar22; } local_cc = (float *)(in_ECX->_speedMultiplier * 10.0); fVar20 = atan2f((float)puVar3[0x53],(float)puVar3[0x52]); fVar20 = approach_angle((float)puVar3[0x55],fVar20 * 57.295776,(float)local_cc); puVar3[0x55] = fVar20; in_ECX->_state = 2; if ((char)param_1 == '\0') { local_c8 = (ANM2 *)((float)puVar3[0x51] - in_ECX->_speedMultiplier); puVar3[0x51] = local_c8; } else { local_c8 = (ANM2 *)((float)puVar3[0x51] - in_ECX->_speedMultiplier * 0.5); } local_fc = (float *)(((float)local_c8 - 0.0) / 5.0); if ((float)local_fc <= 0.0) { local_fc = (float *)0x0; } if (1.0 <= (float)local_fc) { local_fc = (float *)0x3f800000; } fVar20 = (float)local_fc + 0.0; fVar20 = (1.0 - fVar20) * fVar20 + fVar20; local_e4 = (int *)(fVar20 * (float)puVar3[0x53] + *(float *)((int)in_ECX->_player + 0x340)); local_114 = (float *)(fVar20 * ((Vector *)(puVar3 + 0x52))->x + *(float *)((int)in_ECX->_player + 0x33c)); pVVar6 = Vector::Normalized((Vector *)(puVar3 + 0x52),&local_f4); local_cc = (float *)cos(1.5707964); fVar21 = sin(1.5707964); fVar20 = pVVar6->x; fVar22 = pVVar6->y; fVar25 = 1.0; pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4]) * 4); pfVar7[2] = -13.0; fVar24 = fVar22 * (float)local_cc; local_cc = (float *)(fVar20 * (float)local_cc - fVar22 * fVar21); *pfVar7 = local_d0; local_ec = (undefined4 *)(fVar24 + fVar20 * fVar21); pfVar7[1] = (float)local_d8; local_c0 = (Entity_Projectile *) Math::timescale_factor(1.0 - (float)local_fc * 0.8,local_e8->_speedMultiplier); local_d4 = (Vector *)0x1; if (1 < (uint)puVar3[5]) { local_fc = (float *)((5.0 - (float)local_c8) * 4.0); local_dc = fVar25 - (float)local_c0; do { local_d8 = (Vector *) ((float)((double)(int)local_d4 + __uint_to_double_fixup[-((int)local_d4 >> 0x1f)] ) / (float)((double)(puVar3[5] + -1) + __uint_to_double_fixup[-(puVar3[5] + -1 >> 0x1f)])); local_c4 = (Vector *)(fVar25 - (float)local_d8); local_f8 = (Vector *) ((float)local_114 * (float)local_d8 + *(float *)((int)local_e8->_player + 0x33c) * (float)local_c4); local_d0 = (float)local_e4 * (float)local_d8 + *(float *)((int)local_e8->_player + 0x340) * (float)local_c4; fVar20 = sin(((float)local_d8 * (float)local_c8 + (float)local_d8 * (float)local_c8) * 3.1415927); pfVar7 = &local_d4->x; local_d4 = (Vector *)((int)&local_d4->x + 1); pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & (int)pfVar7 + puVar3[4]) * 4); fVar25 = 1.0; *pfVar7 = (fVar20 * (float)local_cc * (float)local_fc + (float)local_f8) * (float)local_c0 + local_dc * *pfVar7; pfVar7[1] = (fVar20 * (float)local_ec * (float)local_fc + local_d0) * (float)local_c0 + local_dc * pfVar7[1]; pfVar7[2] = ((float)local_d8 * -20.0 - (float)local_c4 * 15.0) * (float)local_c0 + local_dc * pfVar7[2]; } while (local_d4 < (Vector *)puVar3[5]); } (local_e8->_velocity).x = g_vectorZero.x; (local_e8->_velocity).y = g_vectorZero.y; pfVar7 = (float *)UmbilicalBabyData::last_point(); (local_e8->_pos).x = *pfVar7; (local_e8->_pos).y = pfVar7[1]; if (!(0.0 < (float)puVar3[0x51] || (float)puVar3[0x51] == 0.0)) { (**(code **)(*(int *)local_e8 + 0x28))(); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } iVar5 = puVar3[5]; local_c4 = (Vector *)in_ECX->_speedMultiplier; local_c8 = (ANM2 *)0x0; local_ec = (undefined4 *) (90.0 / (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)])); ropePointCount = (undefined1 *)0x0; if (iVar5 != 0) { do { iVar5 = *(int *)(puVar3[2] + ((uint)((int)local_c8 + puVar3[4]) & puVar3[3] - 1) * 4); local_13c = *(undefined1 (*) [8])(iVar5 + 0xc); local_134 = *(float *)(iVar5 + 0x14); *(undefined4 *)(iVar5 + 0x18) = local_13c._0_4_; *(undefined4 *)(iVar5 + 0x1c) = local_13c._4_4_; *(float *)(iVar5 + 0x20) = local_134; iVar19 = puVar3[4]; if (local_c8 < (undefined1 *)(puVar3[5] - 1)) { local_d4 = *(Vector **) (puVar3[2] + ((uint)((int)local_c8 + iVar19 + 1) & puVar3[3] - 1) * 4); iVar19 = puVar3[4]; } else { local_d4 = &DAT_00c79c58; } if (local_c8 == (ANM2 *)0x0) { pVVar6 = &DAT_00c79c58; } else { pVVar6 = *(Vector **)(puVar3[2] + ((uint)((int)local_c8 + iVar19 + -1) & puVar3[3] - 1) * 4) ; } puVar8 = (undefined4 *)umbilical_rope_force(iVar5 + 0xc,pVVar6,local_d4,local_ec); local_c8 = (ANM2 *)((int)local_c8 + 1); *(undefined4 *)(iVar5 + 0x48) = *puVar8; *(undefined4 *)(iVar5 + 0x4c) = puVar8[1]; *(undefined4 *)(iVar5 + 0x50) = puVar8[2]; ropePointCount = (undefined1 *)puVar3[5]; } while (local_c8 < ropePointCount); } local_c0 = (Entity_Projectile *)0x0; uVar15 = 0; if (ropePointCount != (undefined1 *)0x0) { do { pfVar7 = *(float **)(puVar3[2] + (puVar3[4] + (int)local_c0 & puVar3[3] - 1) * 4); pfVar7[9] = (float)local_c4 * pfVar7[0x12] * 0.5 + pfVar7[3]; pfVar7[10] = (float)local_c4 * pfVar7[0x13] * 0.5 + pfVar7[4]; pfVar7[0xb] = (float)local_c4 * pfVar7[0x14] * 0.5 + pfVar7[5]; if (local_c0 < puVar3[5] - 1) { pfVar9 = *(float **)(puVar3[2] + ((int)local_c0 + 1U + puVar3[4] & puVar3[3] - 1) * 4); iVar5 = *(int *)(puVar3[2] + (puVar3[4] + (int)local_c0 + 1U & puVar3[3] - 1) * 4); local_d4 = (Vector *)local_13c; local_13c._4_4_ = (float)local_c4 * *(float *)(iVar5 + 0x1c) * 0.5 + pfVar9[1]; local_13c._0_4_ = (float)local_c4 * *(float *)(iVar5 + 0x18) * 0.5 + *pfVar9; local_134 = (float)local_c4 * *(float *)(iVar5 + 0x20) * 0.5 + pfVar9[2]; } else { local_d4 = (Vector *)local_178; local_178._0_4_ = DAT_00c79c58.x; local_178._4_4_ = DAT_00c79c58.y; local_170 = DAT_00c79c60; } if (local_c0 == (Entity_Projectile *)0x0) { local_184._0_4_ = DAT_00c79c58.x; local_184._4_4_ = DAT_00c79c58.y; pfVar9 = (float *)local_184; local_17c = DAT_00c79c60; } else { uVar15 = (int)local_c0 + puVar3[4] + -1; prevPoint = *(float **)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); iVar5 = *(int *)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); local_148.x = (float)local_c4 * *(float *)(iVar5 + 0x1c) * 0.5 + prevPoint[1]; local_14c = (float)local_c4 * *(float *)(iVar5 + 0x18) * 0.5 + *prevPoint; pfVar9 = &local_14c; local_148.y = (float)local_c4 * *(float *)(iVar5 + 0x20) * 0.5 + prevPoint[2]; } local_168.x = (float)local_c4 * pfVar7[0x13] * 0.5 + pfVar7[4]; local_16c = (float)local_c4 * pfVar7[0x12] * 0.5 + pfVar7[3]; local_168.y = (float)local_c4 * pfVar7[0x14] * 0.5 + pfVar7[5]; local_160 = (float)local_c4 * pfVar7[6] * 0.5 + *pfVar7; local_15c.x = (float)local_c4 * pfVar7[7] * 0.5 + pfVar7[1]; local_15c.y = (float)local_c4 * pfVar7[8] * 0.5 + pfVar7[2]; local_cc = pfVar7; pfVar9 = (float *)umbilical_rope_force(&local_16c,pfVar9,local_d4,local_ec); local_c0 = (Entity_Projectile *)((int)local_c0 + 1); pfVar7[0x15] = *pfVar9; pfVar7[0x16] = pfVar9[1]; pfVar7[0x17] = pfVar9[2]; uVar15 = puVar3[5]; } while (local_c0 < uVar15); } local_c0 = (Entity_Projectile *)0x0; uVar16 = 0; if (uVar15 != 0) { do { pVVar6 = *(Vector **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4] + (int)local_c0) * 4); fVar20 = pVVar6[0xb].y; fVar22 = pVVar6[2].y; pVVar6[6].x = (float)local_c4 * pVVar6[10].y * 0.5 + pVVar6[1].y; pVVar6[6].y = (float)local_c4 * pVVar6[0xb].x * 0.5 + pVVar6[2].x; pVVar6[7].x = (float)local_c4 * fVar20 * 0.5 + fVar22; if (local_c0 < puVar3[5] - 1) { pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4] + (int)local_c0 + 1U) * 4); iVar5 = *(int *)(puVar3[2] + (puVar3[3] - 1 & (int)local_c0 + 1U + puVar3[4]) * 4); local_c8 = (ANM2 *)local_13c; local_13c._4_4_ = (float)local_c4 * *(float *)(iVar5 + 0x28) * 0.5 + pfVar7[1]; local_13c._0_4_ = (float)local_c4 * *(float *)(iVar5 + 0x24) * 0.5 + *pfVar7; local_134 = (float)local_c4 * *(float *)(iVar5 + 0x2c) * 0.5 + pfVar7[2]; } else { local_c8 = (ANM2 *)local_178; local_178._0_4_ = DAT_00c79c58.x; local_178._4_4_ = DAT_00c79c58.y; local_170 = DAT_00c79c60; } if (local_c0 == (Entity_Projectile *)0x0) { local_184._0_4_ = DAT_00c79c58.x; local_184._4_4_ = DAT_00c79c58.y; pfVar7 = (float *)local_184; local_17c = DAT_00c79c60; } else { uVar15 = (int)local_c0 + puVar3[4] + -1; pfVar9 = *(float **)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); iVar5 = *(int *)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); local_148.x = (float)local_c4 * *(float *)(iVar5 + 0x28) * 0.5 + pfVar9[1]; local_14c = (float)local_c4 * *(float *)(iVar5 + 0x24) * 0.5 + *pfVar9; pfVar7 = &local_14c; local_148.y = (float)local_c4 * *(float *)(iVar5 + 0x2c) * 0.5 + pfVar9[2]; } local_168.x = (float)local_c4 * pVVar6[0xb].x * 0.5 + pVVar6[2].x; local_16c = (float)local_c4 * pVVar6[10].y * 0.5 + pVVar6[1].y; local_168.y = (float)local_c4 * pVVar6[0xb].y * 0.5 + pVVar6[2].y; local_160 = (float)local_c4 * pVVar6[4].y * 0.5 + pVVar6->x; local_15c.x = (float)local_c4 * pVVar6[5].x * 0.5 + pVVar6->y; local_15c.y = (float)local_c4 * pVVar6[5].y * 0.5 + pVVar6[1].x; local_d4 = pVVar6; pfVar7 = (float *)umbilical_rope_force(&local_16c,pfVar7,local_c8,local_ec); local_c0 = (Entity_Projectile *)((int)local_c0 + 1); pVVar6[0xc].x = *pfVar7; pVVar6[0xc].y = pfVar7[1]; pVVar6[0xd].x = pfVar7[2]; uVar16 = puVar3[5]; } while (local_c0 < uVar16); } local_c0 = (Entity_Projectile *)0x0; uVar15 = 0; if (uVar16 != 0) { do { pVVar6 = *(Vector **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4] + (int)local_c0) * 4); fVar20 = pVVar6[0xd].x; fVar22 = pVVar6[2].x; fVar21 = pVVar6[2].y; pVVar6[7].y = (float)local_c4 * pVVar6[0xc].x + pVVar6[1].y; pVVar6[8].x = (float)local_c4 * pVVar6[0xc].y + fVar22; pVVar6[8].y = (float)local_c4 * fVar20 + fVar21; if (local_c0 < puVar3[5] - 1) { pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4] + (int)local_c0 + 1U) * 4); iVar5 = *(int *)(puVar3[2] + (puVar3[3] - 1 & (int)local_c0 + 1U + puVar3[4]) * 4); local_c8 = (ANM2 *)local_13c; local_13c._4_4_ = (float)local_c4 * *(float *)(iVar5 + 0x34) + pfVar7[1]; local_13c._0_4_ = (float)local_c4 * *(float *)(iVar5 + 0x30) + *pfVar7; local_134 = (float)local_c4 * *(float *)(iVar5 + 0x38) + pfVar7[2]; } else { local_c8 = (ANM2 *)local_178; local_178._0_4_ = DAT_00c79c58.x; local_178._4_4_ = DAT_00c79c58.y; local_170 = DAT_00c79c60; } if (local_c0 == (Entity_Projectile *)0x0) { local_184._0_4_ = DAT_00c79c58.x; local_184._4_4_ = DAT_00c79c58.y; pfVar7 = (float *)local_184; local_17c = DAT_00c79c60; } else { uVar15 = (int)local_c0 + puVar3[4] + -1; pfVar9 = *(float **)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); iVar5 = *(int *)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); local_148.x = (float)local_c4 * *(float *)(iVar5 + 0x34) + pfVar9[1]; local_14c = (float)local_c4 * *(float *)(iVar5 + 0x30) + *pfVar9; pfVar7 = &local_14c; local_148.y = (float)local_c4 * *(float *)(iVar5 + 0x38) + pfVar9[2]; } local_168.x = (float)local_c4 * pVVar6[0xc].y + pVVar6[2].x; local_16c = (float)local_c4 * pVVar6[0xc].x + pVVar6[1].y; local_168.y = (float)local_c4 * pVVar6[0xd].x + pVVar6[2].y; local_160 = (float)local_c4 * pVVar6[6].x + pVVar6->x; local_15c.x = (float)local_c4 * pVVar6[6].y + pVVar6->y; local_15c.y = (float)local_c4 * pVVar6[7].x + pVVar6[1].x; local_d4 = pVVar6; pfVar7 = (float *)umbilical_rope_force(&local_16c,pfVar7,local_c8,local_ec); local_c0 = (Entity_Projectile *)((int)local_c0 + 1); pVVar6[0xd].y = *pfVar7; pVVar6[0xe].x = pfVar7[1]; pVVar6[0xe].y = pfVar7[2]; uVar15 = puVar3[5]; } while (local_c0 < uVar15); } uVar16 = 0; if (uVar15 != 0) { local_c4 = (Vector *)((float)local_c4 / 6.0); do { uVar15 = puVar3[4] + uVar16; uVar16 = uVar16 + 1; pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & uVar15) * 4); *pfVar7 = (float)local_c4 * (pfVar7[9] + pfVar7[9] + pfVar7[6] + pfVar7[0xc] + pfVar7[0xc] + pfVar7[0xf]) + *pfVar7; pfVar7[1] = (float)local_c4 * (pfVar7[10] + pfVar7[10] + pfVar7[7] + pfVar7[0xd] + pfVar7[0xd] + pfVar7[0x10]) + pfVar7[1]; pfVar7[2] = (pfVar7[0xb] + pfVar7[0xb] + pfVar7[8] + pfVar7[0xe] + pfVar7[0xe] + pfVar7[0x11]) * (float)local_c4 + pfVar7[2]; pfVar7[3] = (float)local_c4 * (pfVar7[0x15] + pfVar7[0x15] + pfVar7[0x12] + pfVar7[0x18] + pfVar7[0x18] + pfVar7[0x1b]) + pfVar7[3]; pfVar7[4] = (float)local_c4 * (pfVar7[0x16] + pfVar7[0x16] + pfVar7[0x13] + pfVar7[0x19] + pfVar7[0x19] + pfVar7[0x1c]) + pfVar7[4]; pfVar7[5] = (pfVar7[0x17] + pfVar7[0x17] + pfVar7[0x14] + pfVar7[0x1a] + pfVar7[0x1a] + pfVar7[0x1d]) * (float)local_c4 + pfVar7[5]; } while (uVar16 < (uint)puVar3[5]); } pfVar7 = *(float **)(puVar3[2] + (puVar3[3] - 1 & puVar3[4]) * 4); *pfVar7 = local_d0; pfVar7[1] = (float)local_d8; pfVar7[2] = -13.0; iVar5 = *(int *)(puVar3[2] + (puVar3[4] & puVar3[3] - 1) * 4); *(undefined4 *)(iVar5 + 0xc) = 0; *(undefined4 *)(iVar5 + 0x10) = 0; *(undefined4 *)(iVar5 + 0x14) = 0; if ((char)param_1 == '\0') { local_e4 = (int *)(*(float *)((int)local_e8->_player + 0x340) - (local_e8->_pos).y); local_114 = (float *)(*(float *)((int)local_e8->_player + 0x33c) - (local_e8->_pos).x); fVar21 = sqrtf((float)local_114 * (float)local_114 + (float)local_e4 * (float)local_e4); fVar22 = (float)uStack_108._4_4_; fVar20 = local_e8->_speedMultiplier; local_fc = (float *)0x0; local_cc = (float *)((fVar21 - 160.0) * (1.0 / fVar21)); auVar23 = ZEXT812(0x3f59999a); ppfVar10 = &local_cc; if ((float)local_cc <= 0.0) { ppfVar10 = &local_fc; } pfVar7 = *ppfVar10; if (fVar20 != 1.0) { fVar21 = auVar23._0_4_; auVar23._4_8_ = auVar23._4_8_; auVar23._0_4_ = fVar21 / ((fVar20 + fVar21) - fVar20 * fVar21); } fVar21 = fVar20 * (float)pfVar7 * (float)local_114 * 0.2 + auVar23._0_4_ * (local_e8->_velocity).x; (local_e8->_velocity).x = fVar21; (local_e8->_velocity).y = auVar23._0_4_ * (local_e8->_velocity).y + fVar20 * (float)pfVar7 * (float)local_e4 * 0.2; if (local_f8 == (Vector *)0xffffffff) { if (local_e8->_isNotCountedAsFollower != 0) goto LAB_00433767; local_e8->_state = 1; fVar20 = local_e8->_speedMultiplier; fVar21 = fVar20 * fVar21; } else { fVar20 = local_e8->_speedMultiplier; (local_e8->_velocity).x = ((float)local_e0 + (float)local_e0) * fVar20 + fVar21; (local_e8->_velocity).y = ((float)uStack_108._4_4_ + (float)uStack_108._4_4_) * fVar20 + (local_e8->_velocity).y; uStack_108._4_4_ = (Entity_Projectile *)(local_e8->_speedMultiplier * 10.0); fVar20 = atan2f(fVar22,(float)local_e0); fVar20 = approach_angle((float)puVar3[0x55],fVar20 * 57.295776,(float)uStack_108._4_4_); puVar3[0x55] = fVar20; fVar20 = local_e8->_speedMultiplier; fVar21 = fVar20 * (local_e8->_velocity).x; } fVar20 = fVar20 * (local_e8->_velocity).y; } else { LAB_00433767: fVar20 = local_e8->_speedMultiplier * (local_e8->_velocity).y; fVar21 = local_e8->_speedMultiplier * (local_e8->_velocity).x; if ((char)param_1 != '\0') { fVar22 = 0.5; goto LAB_004336d9; } } fVar22 = 1.0; LAB_004336d9: fVar21 = fVar22 * fVar21 + (local_e8->_pos).x; fVar20 = fVar22 * fVar20 + (local_e8->_pos).y; pfVar7 = (float *)UmbilicalBabyData::last_point(); *pfVar7 = fVar21; pfVar7[1] = fVar20; pfVar7[2] = 0.0; iVar5 = UmbilicalBabyData::last_point(); *(undefined4 *)(iVar5 + 8) = 0xc1a00000; iVar5 = UmbilicalBabyData::last_point(); *(undefined4 *)(iVar5 + 0xc) = 0; *(undefined4 *)(iVar5 + 0x10) = 0; *(undefined4 *)(iVar5 + 0x14) = 0; ExceptionList = local_1c; return; } //@@ 00434e70 Entity_Familiar::umbilical_rope_force /* DB: FUN_00431be0 RK4 passes: -0.1 v, 0.7 * stretch past rest to each neighbour, z gravity 0.05 / floor 0.5 (characters_11) */ void Entity_Familiar::umbilical_rope_force (float *param_1,float *param_2,float *param_3,float param_4) { float *in_ECX; float *in_EDX; float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; fVar2 = param_1[1]; fVar4 = param_1[2] * -0.1; *in_ECX = *param_1 * -0.1; in_ECX[2] = fVar4; in_ECX[1] = fVar2 * -0.1; if ((*param_2 == (float)DAT_00c79c58) && (fVar2 = param_2[1], fVar2 == DAT_00c79c58._4_4_)) { fVar5 = param_2[2]; if (fVar5 != DAT_00c79c60) goto LAB_00434f12; } else { fVar2 = param_2[1]; fVar5 = param_2[2]; LAB_00434f12: fVar3 = *in_EDX - *param_2; fVar2 = in_EDX[1] - fVar2; fVar5 = in_EDX[2] - fVar5; fVar1 = sqrtf(fVar3 * fVar3 + fVar2 * fVar2 + fVar5 * fVar5); fVar1 = (fVar1 - param_4) * (1.0 / fVar1); if (fVar1 <= 0.0) { fVar1 = 0.0; } *in_ECX = *in_ECX - fVar3 * 0.7 * fVar1; in_ECX[1] = in_ECX[1] - fVar2 * 0.7 * fVar1; fVar4 = fVar4 - fVar5 * 0.7 * fVar1; in_ECX[2] = fVar4; } if ((*param_3 == (float)DAT_00c79c58) && (fVar2 = param_3[1], fVar2 == DAT_00c79c58._4_4_)) { fVar5 = param_3[2]; if (fVar5 == DAT_00c79c60) goto LAB_004350fb; } else { fVar2 = param_3[1]; fVar5 = param_3[2]; } fVar2 = in_EDX[1] - fVar2; fVar3 = *in_EDX - *param_3; fVar5 = in_EDX[2] - fVar5; fVar1 = sqrtf(fVar2 * fVar2 + fVar3 * fVar3 + fVar5 * fVar5); fVar1 = (fVar1 - param_4) * (1.0 / fVar1); if (fVar1 <= 0.0) { fVar1 = 0.0; } *in_ECX = *in_ECX - fVar3 * 0.7 * fVar1; in_ECX[1] = in_ECX[1] - fVar2 * 0.7 * fVar1; fVar4 = fVar4 - fVar5 * 0.7 * fVar1; in_ECX[2] = fVar4; LAB_004350fb: fVar2 = in_EDX[2] * 0.5; if (fVar2 <= 0.0) { fVar2 = 0.0; } in_ECX[2] = (0.05 - fVar2) + fVar4; return; } //@@ 00435130 FUN_00435130 void FUN_00435130(Vector *param_1) { float fVar1; Entity *in_ECX; float fVar2; double dVar3; double dVar4; fVar2 = g_displayPixelRatio * g_screenPointScale; dVar3 = floor((double)(((((in_ECX->_posOffset).x + (in_ECX->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar2 + 0.5)); dVar4 = floor((double)(((((in_ECX->_pos).y + (in_ECX->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar2 + 0.5)); fVar1 = param_1->y; (in_ECX->_renderPosition).x = (float)dVar3 / fVar2 + param_1->x; (in_ECX->_renderPosition).y = (float)dVar4 / fVar2 + fVar1; Entity_Effect::render_player_target(param_1,-(in_ECX[3]._gridCollisionNormal.x != 0.0) & 2); Entity::Render(in_ECX,param_1); return; } //@@ 00435290 Entity_Effect::render_player_target /* DB: ? called from Entity_Effect::Render and FUN_00435130; dyncast Entity_Familiar::ExtraData -> UmbilicalBabyData, player-colored (NetplayManager::IsIdxLocalPlayer) quads */ void Entity_Effect::render_player_target(float *param_1,int param_2) { double dVar1; double dVar2; uint uVar3; int iVar4; float *pfVar5; byte bVar6; int iVar7; int iVar8; int in_ECX; uint uVar9; float fVar10; double dVar11; double dVar12; undefined1 *puStack_94; uint uStack_8c; Vector VStack_74; Color aCStack_6c [2]; iVar7 = __RTDynamicCast(*(undefined4 *)(in_ECX + 0xee0),0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor); if (iVar7 != 0) { if (*(int *)((int)g_game->_room + 0x12bc) == 5) { puStack_94 = &DAT_bf800000; Color::Color(aCStack_6c); fVar10 = 0.5; aCStack_6c[0]._tint[3] = 0.5; } else { fVar10 = 1.0; puStack_94 = (undefined1 *)0x3f800000; Color::Color(aCStack_6c); } if ((*(int *)(in_ECX + 0x410) != 0) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) { bVar6 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(*(int *)(in_ECX + 0x410) + 0x1618)); if (bVar6 == 0) { FUN_00925df0(); aCStack_6c[0]._tint[3] = fVar10 * aCStack_6c[0]._tint[3]; } } uVar3 = *(uint *)(iVar7 + 0x14); uVar9 = 0; uStack_8c = uVar3 - 1; if (param_2 == 1) { uStack_8c = uVar3 >> 1; } else if (param_2 == 2) { uVar9 = uVar3 >> 1; } if (uVar9 < uStack_8c) { DAT_00c78ef0 = iVar7 + 0x18; DAT_00c78ef4 = 2; DAT_00c78ef8._0_2_ = 0x100; g_beamRendererPointsEnd = g_beamRendererPoints; do { iVar4 = *(int *)(iVar7 + 0x10); dVar1 = __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]; iVar8 = *(int *)(iVar7 + 0x14) + -1; fVar10 = g_displayPixelRatio * g_screenPointScale; dVar2 = __uint_to_double_fixup[-(iVar8 >> 0x1f)]; pfVar5 = *(float **)(*(int *)(iVar7 + 8) + (*(int *)(iVar7 + 0xc) - 1U & iVar4 + uVar9) * 4) ; dVar11 = floor((double)((((*pfVar5 + 0.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar10 + 0.5)); dVar12 = floor((double)(((((float)puStack_94 * *(float *)(*(int *)(*(int *)(iVar7 + 8) + (*(int *)(iVar7 + 0xc) - 1U & iVar4 + uVar9) * 4) + 8) + pfVar5[1]) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar10 + 0.5)); VStack_74.x = (float)dVar11 / fVar10 + *param_1; VStack_74.y = (float)dVar12 / fVar10 + param_1[1]; BeamRenderer::Add(&VStack_74,(ColorMod *)aCStack_6c,1.0, (float)((double)(int)uVar9 + dVar1) / (float)((double)iVar8 + dVar2)); uVar9 = uVar9 + 1; } while (uVar9 <= uStack_8c); BeamRenderer::End(); } } return; } //@@ 00435590 UmbilicalBabyData::last_point /* DB: ring-buffer element (start + count - 1): FUN_00431be0 pins it to the baby (characters_11) */ undefined4 UmbilicalBabyData::last_point(void) { int in_ECX; return *(undefined4 *) (*(int *)(in_ECX + 4) + (*(int *)(in_ECX + 8) - 1U & (*(int *)(in_ECX + 0x10) + *(int *)(in_ECX + 0xc)) - 1U) * 4) ; } //@@ 004355c0 std::deque<120byte>::resize /* DB: constant-folded resize(16): ECX={?,map +4,mapsize +8,off +0xc,size +0x10}, grows by allocating 0x78-byte single-element blocks (operator_new(0x78)) and zeroing them, then shrinks size back to 16; MSVC deque layout; caller Entity_Familiar::ai_umbilical_baby */ void std::deque<120byte>::resize(void) { undefined4 *_Dst; void *pvVar1; int iVar2; int in_ECX; uint uVar3; uint uVar4; bool bVar5; uVar4 = *(uint *)(in_ECX + 0x10); bVar5 = false; if (uVar4 < 0x10) { do { uVar3 = *(uint *)(in_ECX + 8); if (uVar3 <= uVar4 + 1) { FUN_00435910(uVar4); uVar3 = *(uint *)(in_ECX + 8); uVar4 = *(uint *)(in_ECX + 0x10); } *(uint *)(in_ECX + 0xc) = *(uint *)(in_ECX + 0xc) & uVar3 - 1; uVar4 = *(int *)(in_ECX + 0xc) + uVar4 & uVar3 - 1; iVar2 = *(int *)(in_ECX + 4); if (*(int *)(iVar2 + uVar4 * 4) == 0) { pvVar1 = operator_new(0x78); *(void **)(*(int *)(in_ECX + 4) + uVar4 * 4) = pvVar1; iVar2 = *(int *)(in_ECX + 4); } _Dst = *(undefined4 **)(iVar2 + uVar4 * 4); memset(_Dst,0,0x78); *_Dst = 0; _Dst[1] = 0; _Dst[2] = 0; _Dst[3] = 0; _Dst[4] = 0; _Dst[5] = 0; _Dst[6] = 0; _Dst[7] = 0; _Dst[8] = 0; _Dst[9] = 0; _Dst[10] = 0; _Dst[0xb] = 0; _Dst[0xc] = 0; _Dst[0xd] = 0; _Dst[0xe] = 0; _Dst[0xf] = 0; _Dst[0x10] = 0; _Dst[0x11] = 0; _Dst[0x12] = 0; _Dst[0x13] = 0; _Dst[0x14] = 0; _Dst[0x15] = 0; _Dst[0x16] = 0; _Dst[0x17] = 0; _Dst[0x18] = 0; _Dst[0x19] = 0; _Dst[0x1a] = 0; _Dst[0x1b] = 0; _Dst[0x1c] = 0; _Dst[0x1d] = 0; uVar4 = *(int *)(in_ECX + 0x10) + 1; *(uint *)(in_ECX + 0x10) = uVar4; } while (uVar4 < 0x10); bVar5 = uVar4 < 0x10; } if (!bVar5 && uVar4 != 0x10) { while( true ) { uVar4 = uVar4 - 1; *(uint *)(in_ECX + 0x10) = uVar4; if (uVar4 == 0) break; if (uVar4 < 0x11) { return; } } *(undefined4 *)(in_ECX + 0xc) = 0; } return; } //@@ 00435740 FUN_00435740 void FUN_00435740(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; uint size; int iVar2; iVar2 = in_ECX[4]; if (iVar2 != 0) { do { iVar2 = iVar2 + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; } iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x78); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 004357e0 Entity_Familiar::set_extra_data /* DB: ReferenceCount */ void Entity_Familiar::set_extra_data(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7e818 != (code *)0x0)) { (*DAT_00c7e818)(); } } in_ECX[1] = this; *in_ECX = param_1; ExceptionList = local_10; return; } //@@ 00435880 FUN_00435880 undefined4 FUN_00435880(uint param_1) { uint uVar1; int in_ECX; uVar1 = 1 << ((byte)param_1 & 0x1f); return CONCAT31((int3)(uVar1 >> 8),(*(uint *)(in_ECX + (param_1 >> 5) * 4) & uVar1) != 0); } //@@ 004358b0 FUN_004358b0 undefined4 FUN_004358b0(void) { short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); if ((undefined4 *)in_ECX[5] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX[5])(1); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x004358f8. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 00435910 FUN_00435910 void FUN_00435910(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0x2222222 - uVar3 < uVar3) { FUN_0040cad0(); LAB_00435a46: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = std::_Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_00435a46; } //@@ 00435a50 sqrtf /* DB: float sqrt wrapper calling libm_sse2_sqrt_precise for negatives prototype: db/protos.zhl */ float __cdecl sqrtf(float x) { double dVar1; dVar1 = (double)x; if (0.0 <= dVar1) { return (float)SQRT(dVar1); } libm_sse2_sqrt_precise(); return (float)dVar1; } //@@ 00435a80 Color::Color /* DB: writes 11 floats: rgb, a=1, colorize/offset zeroed (Color struct layout) prototype: db/protos.zhl */ void __thiscall Color::Color(Color *this) { float in_XMM1_Da; float in_XMM2_Da; float in_XMM3_Da; this->_colorize[0] = 0.0; this->_colorize[1] = 0.0; this->_colorize[2] = 0.0; this->_colorize[3] = 0.0; this->_offset[0] = 0.0; this->_offset[1] = 0.0; this->_offset[2] = 0.0; this->_tint[0] = in_XMM1_Da; this->_tint[1] = in_XMM2_Da; this->_tint[2] = in_XMM3_Da; this->_tint[3] = 1.0; return; } //@@ 00435ad0 Color::Color /* DB: rgb,a floats plus int offsets /255 into Color struct */ void Color::Color(undefined4 param_1,int param_2,int param_3,int param_4) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[3] = param_1; *in_ECX = in_XMM1_Da; in_ECX[1] = in_XMM2_Da; in_ECX[2] = in_XMM3_Da; in_ECX[8] = (float)param_2 * 0.003921569; in_ECX[9] = (float)param_3 * 0.003921569; in_ECX[10] = (float)param_4 * 0.003921569; return; } //@@ 00435b50 Color::Color /* DB: all 11 fields of 0x2c Color struct from args */ void Color::Color(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[3] = param_1; in_ECX[4] = param_2; in_ECX[5] = param_3; in_ECX[6] = param_4; in_ECX[7] = param_5; in_ECX[8] = param_6; in_ECX[9] = param_7; *in_ECX = in_XMM1_Da; in_ECX[1] = in_XMM2_Da; in_ECX[2] = in_XMM3_Da; in_ECX[10] = param_8; return; } //@@ 00435bc0 FUN_00435bc0 void FUN_00435bc0(undefined4 param_1,undefined4 param_2) { undefined4 *in_ECX; *in_ECX = param_1; in_ECX[1] = param_2; in_ECX[2] = 0; in_ECX[3] = 0; return; } //@@ 00435bf0 BitSet128::operator__ /* DB: 4 dword OR */ void BitSet128::operator__(uint *param_1) { uint *in_ECX; *in_ECX = *in_ECX | *param_1; in_ECX[1] = in_ECX[1] | param_1[1]; in_ECX[2] = in_ECX[2] | param_1[2]; in_ECX[3] = in_ECX[3] | param_1[3]; return; } //@@ 00435c20 BitSet128::operator_or /* DB: ors four dwords of two 128-bit sets prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ BitSet128 * __cdecl BitSet128::operator_or(BitSet128 *outResult,BitSet128 *a,BitSet128 *b) { uint uVar1; uint uVar2; qword qVar3; qword qVar4; qword qVar5; qword qVar6; qVar3 = a->_l; qVar4 = b->_l; qVar5 = a->_h; qVar6 = b->_h; *(uint *)((int)&outResult->_l + 4) = *(uint *)((int)&a->_l + 4) | *(uint *)((int)&b->_l + 4); uVar1 = *(uint *)((int)&a->_h + 4); uVar2 = *(uint *)((int)&b->_h + 4); *(uint *)&outResult->_l = (uint)qVar3 | (uint)qVar4; *(uint *)((int)&outResult->_h + 4) = uVar1 | uVar2; *(uint *)&outResult->_h = (uint)qVar5 | (uint)qVar6; return outResult; } //@@ 00435c60 Sprite::set_flip_x /* DB: tiny: writes byte +0x100 (Lua Sprite.FlipX reads +0x100) (dogma_effects.md) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Sprite::set_flip_x(Sprite *this,byte isFlipX) { this->_flipX = isFlipX; return; } //@@ 00435c70 EntityRef::EntityRef /* DB: zeroes type/variant/spawner, pos/vel = zero vector, flags/entity 0; EntityRef layout 0x28 prototype: db/protos.zhl */ EntityRef * __thiscall EntityRef::EntityRef(EntityRef *this) { this->_type = 0; this->_variant = 0; this->_spawnerType = 0; this->_spawnerVariant = 0; (this->_position).x = g_vectorZero.x; (this->_position).y = g_vectorZero.y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; this->_flags = 0; this->_entity = (void *)0x0; return this; } //@@ 00435cd0 FUN_00435cd0 void FUN_00435cd0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x30) = param_1; return; } //@@ 00435ce0 Entity::get_friction /* DB: tiny: returns +0x36c (Lua Entity.Friction field); blackhole pull divides by it (dogma_effects.md) */ void Entity::get_friction(void) { return; } //@@ 00435cf0 set_field_358 /* DB: ?trivial +0x358 setter, ICF-foldable; this unclear prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall set_field_358(void *this,float value) { *(float *)((int)this + 0x358) = value; return; } //@@ 00435d10 Entity::DepthOffset /* ZHL [lua] Lua binding Entity:DepthOffset */ float10 __thiscall Entity::DepthOffset(Entity *this) { return (float10)this->_renderDepthOffset; } //@@ 00435d20 Entity::SetField380 /* DB: ? stores +0x380 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetField380(Entity *this,float value) { this->_health = value; return; } //@@ 00435d40 FUN_00435d40 void FUN_00435d40(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 900) = param_1; return; } //@@ 00435d60 Entity::SetTargetPosition /* DB: writes +0x334/+0x338 (_targetPosition) prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity::SetTargetPosition(Entity *this,Vector position) { (this->_targetPosition).x = position.x; (this->_targetPosition).y = position.y; return; } //@@ 00435d90 FUN_00435d90 void FUN_00435d90(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x188) = param_1; return; } //@@ 00435da0 FUN_00435da0 bool FUN_00435da0(void) { int in_ECX; return *(int *)(in_ECX + 0x28) == 6; } //@@ 00435db0 Entity::GetHitPointsLost /* DB: ? (int)maxHP(0x3a4) - (int)HP(0x3a0) prototype: db/protos.zhl */ int __thiscall Entity::GetHitPointsLost(Entity *this) { return (int)this->_updateTime - (int)this->_prevUpdateTime; } //@@ 00435dd0 Entity::GetSprite /* ZHL [lua] Lua binding Entity:GetSprite */ ANM2 * __thiscall Entity::GetSprite(Entity *this) { return &this->_sprite; } //@@ 00435de0 FUN_00435de0 int FUN_00435de0(void) { int in_ECX; if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 3)) { return 0; } return in_ECX; } //@@ 00435df0 FUN_00435df0 int FUN_00435df0(void) { int in_ECX; if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 7)) { return 0; } return in_ECX; } //@@ 00435e00 Entity::to_npc_or_coop_player /* DB: returns this if type 10..999, or type 1 with 2+ players, else null; used by the Dogma Blackhole TV pull (dogma_effects.md) */ Entity * __thiscall Entity::to_npc_or_coop_player(Entity *this) { if ((this == (Entity *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (this->_type != 1)) && (0x3dd < this->_type - 10U)))) { return (Entity *)0x0; } return this; } //@@ 00435e30 FUN_00435e30 int FUN_00435e30(void) { int in_ECX; if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 5)) { return 0; } return in_ECX; } //@@ 00435e40 Entity::ToTear /* DB: returns this if type==2 else null */ Entity * __thiscall Entity::ToTear(Entity *this) { if ((this == (Entity *)0x0) || (this->_type != 2)) { return (Entity *)0x0; } return this; } //@@ 00435e50 Entity_Tear::FallingAcceleration /* ZHL [lua] Lua binding EntityTear:FallingAcceleration */ float10 __thiscall Entity_Tear::FallingAcceleration(Entity_Tear *this) { return (float10)this->_fallingAccel; } //@@ 00435e60 Entity_Effect::set_state /* DB: body: this+0x450 (EntityEffect.State, Lua field+0x450) = arg; the Lava Spawner sets 1 on the 1000.1 it spawns (tiny setter: ICF may fold other +0x450 setters) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Effect::set_state(Entity_Effect *this,int state) { this->_state = state; return; } //@@ 00435e70 FUN_00435e70 void FUN_00435e70(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x44c) = param_1; return; } //@@ 00435e90 Entity_Effect::SetTimeout /* ZHL [lua] Lua binding EntityEffect:SetTimeout prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Effect::SetTimeout(Entity_Effect *this,int timeout) { this->_timeout = timeout; this->_lifespan = timeout; return; } //@@ 00435eb0 Entity_Effect::set_rotation /* DB: tiny: writes +0x474 (Lua EntityEffect.Rotation) (dogma_effects.md) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Effect::set_rotation(Entity_Effect *this,float rotation) { this->_rotation = rotation; return; } //@@ 00435ed0 FUN_00435ed0 void FUN_00435ed0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x478) = param_1; return; } //@@ 00435ef0 Entity_Effect::SetRadii /* ZHL [lua] Lua binding EntityEffect:SetRadii prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Effect::SetRadii(Entity_Effect *this,float minRadius,float maxRadius) { this->_minRadius = minRadius; this->_maxRadius = maxRadius; return; } //@@ 00435f20 Entity_Laser::SetTimeout /* ZHL [lua] Lua binding EntityLaser:SetTimeout */ void __thiscall Entity_Laser::SetTimeout(Entity_Laser *this,int param_2) { this->_timeout = param_2; return; } //@@ 00435f30 Entity_Laser::SetMaxDistance /* ZHL [lua] Lua binding EntityLaser:SetMaxDistance prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Laser::SetMaxDistance(Entity_Laser *this,float maxDistance) { this->_maxDistance = maxDistance; return; } //@@ 00435f50 Entity_Laser::IsCircleLaser /* ZHL [lua] Lua binding EntityLaser:IsCircleLaser */ int __thiscall Entity_Laser::IsCircleLaser(Entity_Laser *this) { int iVar1; uint3 uVar2; iVar1 = this->_subtype; uVar2 = (uint3)((uint)iVar1 >> 8); if (((iVar1 == 1) || (iVar1 == 2)) || (iVar1 == 3)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 00435f70 FUN_00435f70 void FUN_00435f70(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x4e4) = param_1; return; } //@@ 00435f80 TemporaryEffect::TemporaryEffect /* DB: {config,0,config+0x78,0}, same layout as AddEffect arg prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall TemporaryEffect::TemporaryEffect(void *this,ItemConfig_Item *item) { *(ItemConfig_Item **)this = item; *(undefined4 *)((int)this + 4) = 0; *(int *)((int)this + 8) = item->maxCooldown; *(undefined4 *)((int)this + 0xc) = 0; return this; } //@@ 00435fb0 Level::SetHeartPicked /* ZHL [lua] Lua binding Level:SetHeartPicked */ void __thiscall Level::SetHeartPicked(Level *this) { this->_isHeartPicked = 1; return; } //@@ 00435fc0 GridEntity_Door::IsOpen /* ZHL [lua] Lua binding GridEntityDoor:IsOpen */ bool GridEntity_Door::IsOpen(void) { int in_ECX; return *(int *)(in_ECX + 0xc) == 2; } //@@ 00435fd0 GridEntity_Door::IsLocked /* ZHL [lua] Lua binding GridEntityDoor:IsLocked */ int GridEntity_Door::IsLocked(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 8); uVar2 = (uint3)((uint)iVar1 >> 8); if ((((iVar1 == 1) || (iVar1 == 4)) || (iVar1 == 3)) || ((iVar1 == 2 || (iVar1 == 5)))) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 00436000 FUN_00436000 byte FUN_00436000(void) { int in_ECX; return *(byte *)(in_ECX + 0x3a0) & 1; } //@@ 00436010 RoomDescriptor::Clear /* ZHL [lua] Lua binding RoomDescriptor:Clear */ byte __thiscall RoomDescriptor::Clear(RoomDescriptor *this) { return (byte)this->Flags & 1; } //@@ 00436020 Room::GetDoor /* ZHL [exact] __thiscall GridEntity_Door* Room::GetDoor(int slot); prototype: REPENTOGON, confirmed by RET 4 */ GridEntity_Door * __thiscall Room::GetDoor(Room *this,int slot) { if (slot + 1U < 9) { return this->_doors[slot]; } return (GridEntity_Door *)0x0; } //@@ 00436040 FUN_00436040 int FUN_00436040(void) { int in_ECX; return in_ECX + 0x724; } //@@ 00436050 Room::GetSpawnSeed /* ZHL [lua] Lua binding Room:GetSpawnSeed */ undefined4 Room::GetSpawnSeed(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return 0; } return *(undefined4 *)(*(int *)(in_ECX + 4) + 0x5c); } //@@ 00436060 Room::GetGridEntity /* ZHL [exact] __thiscall GridEntity* Room::GetGridEntity(uint32_t idx); prototype: REPENTOGON, confirmed by RET 4 */ GridEntity * __thiscall Room::GetGridEntity(Room *this,uint idx) { if (idx < 0x1c0) { return this->_gridEntities[idx]; } return (GridEntity *)0x0; } //@@ 00436080 Room::IsClear /* ZHL [lua] Lua binding Room:IsClear prototype: db/protos.zhl */ byte __thiscall Room::IsClear(Room *this) { return *(byte *)((int)this->_descriptor + 0x44) & 1; } //@@ 00436090 Room::GetClampedPosition /* ZHL [lua] Lua binding Room:GetClampedPosition prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Room::GetClampedPosition(Room *this,Vector *outPos,Vector *position,float margin) { GetClampedPositionImpl(this,outPos,position,margin,margin,margin,margin); return outPos; } //@@ 004360c0 Room::GetTintedRockIdx /* ZHL [lua] Lua binding Room:GetTintedRockIdx */ int __thiscall Room::GetTintedRockIdx(Room *this) { return this->_tintedRockIdx; } //@@ 004360d0 FUN_004360d0 int FUN_004360d0(void) { int in_ECX; return in_ECX + 0x7310; } //@@ 004360e0 Level::GetCurrentRoomIndex /* ZHL [lua] Lua binding Level:GetCurrentRoomIndex */ int __thiscall Level::GetCurrentRoomIndex(Level *this) { return this->_currentRoomIndex; } //@@ 004360f0 _get_index_plus_one_if_kind_4_5 /* WARNING: Removing unreachable block (ram,0x00436113) */ /* DB: ? ? returns [0]+1 when [1] is 4 or 5 */ int _get_index_plus_one_if_kind_4_5(void) { int *in_ECX; if ((in_ECX[1] == 4) || (in_ECX[1] == 5)) { return *in_ECX + 1; } return *in_ECX; } //@@ 00436120 FUN_00436120 int FUN_00436120(int param_1) { int in_ECX; return in_ECX + (param_1 * 3 + 0x60de) * 4; } //@@ 00436140 Seeds::GetStartSeed /* ZHL [lua] Lua binding Seeds:GetStartSeed */ int Seeds::GetStartSeed(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if (iVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); iVar1 = *(int *)(in_ECX + 4); } return iVar1; } //@@ 00436160 Entity_Player::AddCacheFlags /* ZHL [exact] __thiscall void Entity_Player::AddCacheFlags(int flags); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddCacheFlags(Entity_Player *this,int flags) { this->_cacheFlags = this->_cacheFlags | flags; return; } //@@ 00436170 Entity_Player::GetHeadDirection /* ZHL [lua] Lua binding EntityPlayer:GetHeadDirection */ int __thiscall Entity_Player::GetHeadDirection(Entity_Player *this) { return this->_headDirection; } //@@ 00436180 Entity_Player::AreOpposingShootDirectionsPressed /* ZHL [lua] Lua binding EntityPlayer:AreOpposingShootDirectionsPressed */ byte __thiscall Entity_Player::AreOpposingShootDirectionsPressed(Entity_Player *this) { return this->_areOpposingShootDirectionsPressed; } //@@ 00436190 FUN_00436190 void FUN_00436190(void) { return; } //@@ 004361a0 Entity_Player::GetTearPoisonDamage /* ZHL [lua] Lua binding EntityPlayer:GetTearPoisonDamage */ float10 __thiscall Entity_Player::GetTearPoisonDamage(Entity_Player *this) { return (float10)this->_meleeDamage; } //@@ 004361b0 Entity_Player::GetItemState /* ZHL [lua] Lua binding EntityPlayer:GetItemState */ int __thiscall Entity_Player::GetItemState(Entity_Player *this) { return this->_itemState; } //@@ 004361c0 Entity_Player::GetEffects /* ZHL [lua] Lua binding EntityPlayer:GetEffects */ TemporaryEffects * __thiscall Entity_Player::GetEffects(Entity_Player *this) { return &this->_temporaryeffects; } //@@ 004361d0 Entity_Player::SetMinDamageCooldown /* ZHL [lua] Lua binding EntityPlayer:SetMinDamageCooldown */ void __thiscall Entity_Player::SetMinDamageCooldown(Entity_Player *this,int param_2) { int *piVar1; piVar1 = ¶m_2; if (param_2 <= this->_damageCooldown) { piVar1 = &this->_damageCooldown; } this->_damageCooldown = *piVar1; return; } //@@ 004361f0 Entity_Familiar::Player /* ZHL [lua] Lua binding EntityFamiliar:Player */ void * __thiscall Entity_Familiar::Player(Entity_Familiar *this) { return this->_player; } //@@ 00436200 FUN_00436200 void FUN_00436200(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd88) = param_1; return; } //@@ 00436210 FUN_00436210 void FUN_00436210(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x544) = param_1; return; } //@@ 00436220 Entity::SetVisibleFlag /* DB: ? sets this+0xc3c=1 unless arg false or flag 0x20000000 (FLAG_FRIENDLY/charmed) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetVisibleFlag(Entity *this,byte isVisible) { if ((isVisible == 0) || ((this->_flags & 0x20000000) != 0)) { *(undefined1 *)&this[3]._pendingDamageFlags = 0; return; } *(undefined1 *)&this[3]._pendingDamageFlags = 1; return; } //@@ 00436260 FUN_00436260 void FUN_00436260(void) { int in_ECX; if (*(int *)(in_ECX + 0x2c) == 0xed) { ItemConfig::get_wisp_config(*(int *)(in_ECX + 0xf20)); return; } if (*(int *)(in_ECX + 0x2c) == 0xce) { ItemConfig::get_wisp_config(*(int *)(in_ECX + 0x30)); return; } ItemConfig::get_wisp_config(0x248); return; } //@@ 004362a0 ItemConfig::get_wisp_config /* DB: collectible+0xcc or modded table, error Book of Virtues missing default wisp prototype: db/protos.zhl */ void * __fastcall ItemConfig::get_wisp_config(int collectibleId) { Manager *pMVar1; ItemConfig_Item *pIVar2; void *pvVar3; int iVar4; pMVar1 = g_manager; if (collectibleId < 0x10000) { pIVar2 = GetCollectible(&g_manager->_itemConfig,collectibleId); if (pIVar2 == (ItemConfig_Item *)0x0) goto LAB_004362e9; pvVar3 = (void *)pIVar2[1].type; } else { if (*(int *)&g_manager->field_0x2a520 - *(int *)&g_manager->field_0x2a51c >> 2 <= collectibleId + -0x10000) goto LAB_004362e9; pvVar3 = *(void **)(*(int *)&g_manager->field_0x2a51c + (collectibleId + -0x10000) * 4); } if (pvVar3 != (void *)0x0) { return pvVar3; } LAB_004362e9: pvVar3 = (pMVar1->_itemConfig)._collectibles._begin; if ((int)((int)(pMVar1->_itemConfig)._collectibles._end - (int)pvVar3 & 0xfffffffcU) < 0x921) { iVar4 = 0; } else { iVar4 = *(int *)((int)pvVar3 + 0x920); if ((iVar4 != 0) && (*(void **)(iVar4 + 0xcc) != (void *)0x0)) { return *(void **)(iVar4 + 0xcc); } } KAGE_LogMessage(0x10,(byte *)"Book of Virtues is missing default wisp config!\n"); return *(void **)(iVar4 + 0xcc); } //@@ 00436330 Entity_Familiar::WispInit /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON Entity_Familiar::WispInit: variant 206 WISP / 237 ITEM_WISP (Lemegeton 712 -> +0xf20), subtype switch applies Map/Compass/BlueMap effects, ItemConfig::get_wisp_config spritesheet + hsv_to_rgb color, UpdateFamiliarCounts; callers are the wisp spawners 0043d7f0/0043e990 prototype: REPENTOGON */ void __thiscall Entity_Familiar::WispInit(Entity_Familiar *this) { EntityPtr *node; code *pcVar1; EntityPtr EVar2; EntityPtr EVar3; EntityPtr EVar4; undefined1 *puVar5; byte bVar6; Vector *randomDir; void *pvVar7; LayerState *layer; int *piVar8; KColor *rgbColor; byte rngShift2; byte rngShift3; int collectibleId; ANM2 *extraout_ECX; ANM2 *this_00; ColorMod *layerColor; Game *game; uint uVar9; float *wispSubtype; float fVar10; float fVar11; float fVar12; float fVar13; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; float local_94; KColor local_90; Vector local_7c; EntityPtr i; undefined8 local_6c; int *wispsByAge; uint wispsByAgeSize; float *local_58; EntityPtr *local_54; float local_50; float fStack_4c; float fStack_48; float fStack_44; undefined4 local_30; undefined4 uStack_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *playerFlagWord; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af219d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_58 = (float *)this->_subtype; puVar5 = (undefined1 *)((int)register0x00000010 + -4); if (this->_variant == 0xed) { bVar6 = Entity_Player::HasCollectible(this->_player,0x248,0); if (bVar6 == 0) { this->_wispCollectibleType = 0x2c8; local_58 = (float *)0x2c8; } else { this->_wispCollectibleType = 0x10012; local_58 = (float *)0x10012; } puVar5 = puStack_20; } puStack_20 = puVar5; if ((this->_variant == 0xce) && ((local_58 == (float *)0x203 || (local_58 == (float *)0x1ea)))) { this->_wispCollectibleType = (int)local_58; local_58 = (float *)GetRandomWisp(&this->_dropRNG); this->_subtype = (int)local_58; } wispSubtype = local_58; if (local_58 < 0x1e5) { if (local_58 == (float *)0x1e4) goto switchD_00436422_caseD_6f; if (0x121 < local_58) { switch(local_58) { case (float *)0x126: case (float *)0x152: case (float *)0x1a5: goto switchD_00436422_caseD_6f; case (float *)0x1ab: this->_entityCollisionClass = 0; this->_entityGridCollisionClass = 3; this->_isInvicible = 1; this->_isNotCountedAsFollower = 1; randomDir = MusicManager::RandomVector(&local_7c); (this->_velocity).x = randomDir->x; (this->_velocity).y = randomDir->y; } goto switchD_00436422_caseD_67; } if (local_58 == (float *)0x121) { switchD_00436422_caseD_6f: this->_isNotCountedAsFollower = 1; goto switchD_004364c6_caseD_1e8; } switch(local_58) { case (float *)0x66: if (this->_coins == 0) { uVar9 = RNG::RandomInt(&this->_dropRNG,6); this->_coins = uVar9 + 1; } break; case (float *)0x6f: case (float *)0xa4: goto switchD_00436422_caseD_6f; case (float *)0x11a: goto switchD_00436422_caseD_11a; } goto switchD_00436422_caseD_67; } switch(local_58) { case (float *)0x1e7: this->_entityCollisionClass = 0; this->_isInvicible = 1; if (this->_target != (EntityPtr)0x0) { local_54 = &this->_target; std::multiset::erase(&local_54); } this->_target = (EntityPtr)0x0; break; default: goto switchD_004364c6_caseD_1e8; case (float *)0x1f8: case (float *)0x25c: case (float *)0x2c1: case (float *)0x2c5: case (float *)0x2d2: case (float *)0x2d9: goto switchD_00436422_caseD_6f; case (float *)0x22d: playerFlagWord = (uint *)((int)this->_player + 0x1574); *playerFlagWord = *playerFlagWord | 0x400; *(undefined1 *)((int)this->_player + 0x1518) = 1; break; case (float *)0x261: this->_isInvicible = 1; break; case (float *)0x27b: (this->_pos).y = (this->_pos).y + 1.0; switchD_00436422_caseD_11a: (this->_targetPosition).x = (this->_pos).x; (this->_targetPosition).y = (this->_pos).y; this->_isNotCountedAsFollower = 1; wispsByAge = (int *)0x0; wispsByAgeSize = 0; wispsByAge = operator_new(0x18); *wispsByAge = (int)wispsByAge; wispsByAge[1] = (int)wispsByAge; wispsByAge[2] = (int)wispsByAge; *(undefined2 *)(wispsByAge + 3) = 0x101; local_14 = 0; i = (EntityPtr)0x0; local_54 = g_game->_room; game = g_game; if (local_54[0x499] != (EntityPtr)0x0) { do { fVar10 = *(float *)((int)local_54[0x497] + (int)i * 4); if ((((fVar10 != 0.0) && (*(int *)((int)fVar10 + 0x28) == 3)) && (*(int *)((int)fVar10 + 0x2c) == 0xce)) && ((*(void **)((int)fVar10 + 0x410) == this->_player && ((float *)*(uint *)((int)fVar10 + 0x30) == wispSubtype)))) { local_7c.x = (float)(*(int *)((int)fVar10 + 0x328) - game->_frameCount); local_7c.y = fVar10; FUN_0043ed20((int)&local_6c + 4,&local_7c); game = g_game; } i = (EntityPtr)((int)i + 1); } while ((uint)i < (uint)local_54[0x499]); } if (5 < wispsByAgeSize) { do { local_a4 = 0; local_a0 = 0; local_9c = 0; local_98 = 0; local_94 = g_vectorZero.x; local_90._red = g_vectorZero.y; local_90._green = g_vectorZero.x; local_90._blue = g_vectorZero.y; local_90._alpha = 0.0; local_90._unk = 0; (**(code **)(**(int **)(*wispsByAge + 0x14) + 0x24))(&local_a4); node = (EntityPtr *)*wispsByAge; local_54 = node; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_54); pvVar7 = std_tree_extract(&wispsByAge,node); operator_delete(pvVar7,0x18); } while (5 < wispsByAgeSize); wispSubtype = local_58; } local_14 = 0xffffffff; FID_conflict__Erase_tree_>_> (&wispsByAge,(fuzzer_allocator_> *)&wispsByAge, (_Tree_node *)wispsByAge[1]); operator_delete(wispsByAge,0x18); switchD_004364c6_caseD_1e8: if (wispSubtype == (float *)0x2c8) { uVar9 = this->_subtype; if (uVar9 < 0xf7) { if (uVar9 == 0xf6) { Level::ApplyBlueMapEffect((Level *)g_game); } else { if (uVar9 == 0x15) goto LAB_00436776; if (uVar9 == 0x36) { Level::ApplyMapEffect((Level *)g_game); } } } else if (uVar9 == 0x14d) { Level::ApplyMapEffect((Level *)g_game); Level::ApplyBlueMapEffect((Level *)g_game); LAB_00436776: Level::ApplyCompassEffect((Level *)g_game,1); } } } switchD_00436422_caseD_67: if (this->_variant == 0xed) { collectibleId = this->_wispCollectibleType; } else if (this->_variant == 0xce) { collectibleId = this->_subtype; } else { collectibleId = 0x248; } local_58 = ItemConfig::get_wisp_config(collectibleId); fVar10 = *local_58; this->_maxHitPoints = fVar10; this->_health = fVar10; fVar10 = local_58[0x61]; if (fVar10 != 0.0) { Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,(std_string *)(local_58 + 0x5d)); } this_00 = &this->_sprite; if (local_58[0x5b] == 0.0) { if (fVar10 == 0.0) goto LAB_0043680d; } else { Sprite::ReplaceSpritesheet((Sprite *)this_00,1,(std_string *)(local_58 + 0x57)); this_00 = extraout_ECX; } ANM2::LoadGraphics(&this->_sprite,(byte)this_00); LAB_0043680d: local_54 = (EntityPtr *)(local_58 + 0x36); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)local_54) { EVar2 = local_54[1]; EVar3 = local_54[2]; EVar4 = local_54[3]; (layer->_color)._tint[0] = (float)*local_54; *(EntityPtr *)((layer->_color)._tint + 1) = EVar2; *(EntityPtr *)((layer->_color)._tint + 2) = EVar3; *(EntityPtr *)((layer->_color)._tint + 3) = EVar4; EVar2 = local_54[5]; EVar3 = local_54[6]; EVar4 = local_54[7]; (layer->_color)._colorize[0] = (float)local_54[4]; *(EntityPtr *)((layer->_color)._colorize + 1) = EVar2; *(EntityPtr *)((layer->_color)._colorize + 2) = EVar3; *(EntityPtr *)((layer->_color)._colorize + 3) = EVar4; *(undefined8 *)(layer->_color)._offset = *(undefined8 *)(local_54 + 8); *(EntityPtr *)((layer->_color)._offset + 2) = local_54[10]; } local_54 = (EntityPtr *)(local_58 + 0x2b); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); if (&layer->_color != (ColorMod *)local_54) { EVar2 = local_54[1]; EVar3 = local_54[2]; EVar4 = local_54[3]; (layer->_color)._tint[0] = (float)*local_54; *(EntityPtr *)((layer->_color)._tint + 1) = EVar2; *(EntityPtr *)((layer->_color)._tint + 2) = EVar3; *(EntityPtr *)((layer->_color)._tint + 3) = EVar4; EVar2 = local_54[5]; EVar3 = local_54[6]; EVar4 = local_54[7]; (layer->_color)._colorize[0] = (float)local_54[4]; *(EntityPtr *)((layer->_color)._colorize + 1) = EVar2; *(EntityPtr *)((layer->_color)._colorize + 2) = EVar3; *(EntityPtr *)((layer->_color)._colorize + 3) = EVar4; *(undefined8 *)(layer->_color)._offset = *(undefined8 *)(local_54 + 8); *(EntityPtr *)((layer->_color)._offset + 2) = local_54[10]; } if (wispSubtype == (float *)0x2bf) { pvVar7 = this->_player; if (*(char *)((int)pvVar7 + 0x1519) == '\0') { for (piVar8 = *(int **)((int)pvVar7 + 0x150c); piVar8 != *(int **)((int)pvVar7 + 0x1510); piVar8 = piVar8 + 4) { if ((*(int *)*piVar8 == 0) && (((int *)*piVar8)[1] == 100)) { this->_coins = 1; local_30 = 0xc0008081; uStack_2c = 0xc0008081; local_28 = -2.0078433; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)&local_50) { (layer->_color)._tint[0] = (float)0x40323232; (layer->_color)._tint[1] = (float)0x40323232; (layer->_color)._tint[2] = (float)0x40323232; (layer->_color)._tint[3] = 1.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_2c,local_30); (layer->_color)._offset[2] = local_28; } local_30 = 0; uStack_2c = 0; local_28 = 0.0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layerColor = &layer->_color; if (layerColor != (ColorMod *)&local_50) { fVar10 = 0.078431375; fVar11 = 0.078431375; fVar12 = 0.078431375; fVar13 = 1.0; goto LAB_00436ceb; } break; } } } } else if (wispSubtype == (float *)0x7b) { uVar9 = this->_initSeed; local_6c = 0xb00000009; local_58 = (float *)&DAT_00000013; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> 9 ^ uVar9; uVar9 = uVar9 << 0xb ^ uVar9; uVar9 = uVar9 >> 0x13 ^ uVar9; local_54 = (EntityPtr *) ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> 9 ^ uVar9; uVar9 = uVar9 << 0xb ^ uVar9; uVar9 = uVar9 >> 0x13 ^ uVar9; local_54 = (EntityPtr *) ((((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 + (float)local_54) - 1.0) * 0.2 + 0.8); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> 9 ^ uVar9; uVar9 = uVar9 << 0xb ^ uVar9; uVar9 = uVar9 >> 0x13 ^ uVar9; hsv_to_rgb(&local_90, (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 * 360.0,(float)local_54,0.8,1.0); local_50 = local_90._red * 2.0; local_30 = 0; uStack_2c = 0; fStack_4c = local_90._green * 2.0; local_28 = 0.0; fStack_44 = 1.0; fStack_48 = local_90._blue * 2.0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)&local_50) { (layer->_color)._tint[0] = local_50; (layer->_color)._tint[1] = fStack_4c; (layer->_color)._tint[2] = fStack_48; (layer->_color)._tint[3] = fStack_44; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_2c,local_30); (layer->_color)._offset[2] = local_28; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } bVar6 = (byte)local_6c; uVar9 = uVar9 >> (bVar6 & 0x1f) ^ uVar9; rngShift2 = (byte)((ulonglong)local_6c >> 0x20); uVar9 = uVar9 << (rngShift2 & 0x1f) ^ uVar9; rngShift3 = (byte)local_58; uVar9 = uVar9 >> (rngShift3 & 0x1f) ^ uVar9; local_54 = (EntityPtr *) ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> (bVar6 & 0x1f) ^ uVar9; uVar9 = uVar9 << (rngShift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> (rngShift3 & 0x1f) ^ uVar9; local_54 = (EntityPtr *) ((((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 + (float)local_54) - 1.0) * 0.2 + 0.8); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> (bVar6 & 0x1f) ^ uVar9; uVar9 = uVar9 << (rngShift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> (rngShift3 & 0x1f) ^ uVar9; rgbColor = hsv_to_rgb(&local_90, (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)] ) * 2.3283062e-10 * 360.0,(float)local_54,0.8,1.0); local_30 = 0; uStack_2c = 0; local_28 = 0.0; fStack_44 = 1.0; local_50 = rgbColor->_red * 2.0; fStack_4c = rgbColor->_green * 2.0; fStack_48 = rgbColor->_blue * 2.0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layerColor = &layer->_color; if (layerColor != (ColorMod *)&local_50) { fVar10 = local_50; fVar11 = fStack_4c; fVar12 = fStack_48; fVar13 = fStack_44; LAB_00436ceb: layerColor->_tint[0] = fVar10; layerColor->_tint[1] = fVar11; layerColor->_tint[2] = fVar12; layerColor->_tint[3] = fVar13; layerColor->_colorize[0] = 0.0; layerColor->_colorize[1] = 0.0; layerColor->_colorize[2] = 0.0; layerColor->_colorize[3] = 0.0; *(ulonglong *)layerColor->_offset = CONCAT44(uStack_2c,local_30); layerColor->_offset[2] = local_28; } } if (this->_variant == 0xed) { Entity_Player::RecomputeWispCollectibles(this->_player,this); } Game::UpdateVisibility(g_game); ExceptionList = local_1c; return; } //@@ 00436fb0 FUN_00436fb0 void FUN_00436fb0(void) { int *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x18); return; } //@@ 00436fd0 Entity_Familiar::wisp_kill /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool Entity_Familiar::wisp_kill(); */ undefined4 __thiscall Entity_Familiar::wisp_kill(Entity_Familiar *this) { float fVar1; void *pvVar2; code *pcVar3; Vector velocity; Vector targetPos; ANM2 *pAVar4; byte bVar5; uint uVar6; Vector *pVVar7; ColorMod *Color; ColorMod *color; EntityPtr EVar8; Entity_Laser *laser; Entity_Tear *tear; ColorMod *color_00; Entity_Player *pEVar9; undefined4 uVar10; EntityRef *ref; Entity *spawned; LayerState *layer; uint uVar11; Manager *manager; Entity_Familiar *tear; float fVar13; float fVar14; Entity_Familiar *spawned; int iVar16; byte bVar17; byte isOnlyRunes; Color layer0Color; Color layer1Color; Vector VStack_94; void *wispConfig; Vector VStack_88; undefined1 auStack_80 [12]; Entity_Player *apEStack_74 [2]; Vector VStack_6c; undefined4 uStack_64; undefined1 auStack_60 [8]; float fStack_58; float fStack_54; float fStack_50; float fStack_4c; float fStack_48; float fStack_44; float fStack_40; float fStack_3c; float fStack_38; undefined1 auStack_34 [12]; undefined1 *queryCount; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; RNG *dropRng; uint *itemListEnd; int *queriedEnemy; Room *room; ColorMod *spawnedColor; puStack_20 = auStack_34 + 0x30; uStack_14 = 0xffffffff; puStack_18 = &LAB_00af21fd; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(auStack_34 + 0x24); ExceptionList = &local_1c; if (this->_variant == 0xed) { iVar16 = this->_wispCollectibleType; } else if (this->_variant == 0xce) { iVar16 = this->_subtype; } else { iVar16 = 0x248; } uStack_64 = this; local_24 = uVar6; wispConfig = ItemConfig::get_wisp_config(iVar16); pEVar9 = (Entity_Player *)this->_subtype; apEStack_74[0] = pEVar9; if ((Entity_Player *)0x11f < pEVar9) { if (pEVar9 < (Entity_Player *)0x222) { if (pEVar9 == (Entity_Player *)0x221) { apEStack_74[0] = (Entity_Player *)Random(); VStack_88.y = (float)this->_player; VStack_94.y = (float)Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,0.0,0,0 ,0); uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { pcVar3 = (code *)swi(3); uVar10 = (*pcVar3)(); return uVar10; } } uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar11 = 0xe3; uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6; (this->_dropRNG)._seed = uVar6; if (uVar6 == (uVar6 / 3) * 3) { uVar11 = 0x115; } spawned = Game::Spawn(g_game,uVar11,0,(Vector *)VStack_94.y,&g_vectorZero, (Entity *)VStack_88.y,0,(uint)apEStack_74[0]); if ((spawned == (Entity *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (spawned->_type != 1)) && (0x3dd < spawned->_type - 10U)))) { spawned = (Entity *)0x0; } bVar17 = 0; bVar5 = 0; iVar16 = -1; ref = EntityRef::EntityRef((EntityRef *)(auStack_60 + 4)); Entity::AddCharmed(spawned,ref,iVar16,bVar5,bVar17); (**(code **)(*(int *)spawned + 0xc))(); Entity::SetVisibleFlag(spawned,0); fVar13 = spawned->_maxHitPoints + spawned->_maxHitPoints; VStack_6c.y = 3.71344e-43; spawned->_maxHitPoints = fVar13; spawned->_health = fVar13; manager = g_manager; seed_fart_sound_override((int *)&VStack_6c.y); tear = (Entity_Familiar *)VStack_6c.y; goto code_r0x00437295; } switch(pEVar9) { case (Entity_Player *)0x120: apEStack_74[0] = this->_player; room = g_game->_room; pVVar7 = MusicManager::RandomVector((Vector *)(auStack_34 + 8)); uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 40.0; VStack_88.y = fVar13 * pVVar7->y + (uStack_64->_pos).y; VStack_88.x = fVar13 * pVVar7->x + (uStack_64->_pos).x; pVVar7 = Room::FindFreePickupSpawnPosition(room,&VStack_94,&VStack_88,40.0,0,0,0); this = uStack_64; Entity_Player::ThrowBlueSpider(apEStack_74[0],&uStack_64->_pos,pVVar7); break; case (Entity_Player *)0x122: apEStack_74[0] = (Entity_Player *)RNG::RandomFloat(&this->_dropRNG); if ((float)apEStack_74[0] < 0.25) { KAGE_LogMessage(1,(byte *)"Spawn heart!"); uVar6 = RNG::Next(&this->_dropRNG); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,0.0,0,0,0); spawned = Game::Spawn(g_game,5,10,pVVar7,&g_vectorZero,(Entity *)this,2,uVar6); spawned[1]._sprite._championColor._colorize[3] = 2.8026e-44; } break; case (Entity_Player *)0x125: EVar8 = (EntityPtr)FUN_00436260(); VStack_88.y = (float)EVar8; iVar16 = _get_index_plus_one_if_kind_4_5(); VStack_6c.y = 0.0; apEStack_74[0] = (Entity_Player *) ((float)(iVar16 + -1) * *(float *)((int)EVar8 + 8) + *(float *)((int)EVar8 + 4)); do { laser = Entity_Laser::ShootAngle (1,&this->_pos,(float)(int)VStack_6c.y * 90.0,0x14,&this->_posOffset, (Entity *)this,0); laser->_disableFollowParent = 1; (**(code **)(*(int *)laser + 0x40)) ((float)apEStack_74[0] * *(float *)((int)VStack_88.y + 0x18)); laser->_scale = 0.5; Entity_Laser::ResetSpriteScale(laser); (**(code **)(*(int *)laser + 0xc))(); VStack_6c.y = (float)((int)VStack_6c.y + 1); } while ((int)VStack_6c.y < 4); break; case (Entity_Player *)0x127: uVar6 = RNG::RandomInt(&this->_dropRNG,10); if (uVar6 == 0) { uVar6 = RNG::Next(&this->_dropRNG); fVar13 = 0.0; LAB_0043785e: pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,fVar13,0,0,0); Game::Spawn(g_game,5,0x14,pVVar7,&g_vectorZero,(Entity *)this,0,uVar6); } break; case (Entity_Player *)0x15c: EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_80,3,-1,-1,1 ,0); uVar6 = 0; uStack_14 = 2; if (apEStack_74[0] != (Entity_Player *)0x0) { do { if (*(void **)(*(int *)(auStack_80._4_4_ + uVar6 * 4) + 0x410) == this->_player) { farting_baby_fart(); } uVar6 = uVar6 + 1; } while (uVar6 < apEStack_74[0]); } uVar6 = RNG::Next(&this->_dropRNG); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,0.0,0,0,0); Game::Spawn(g_game,5,0x46,pVVar7,&g_vectorZero,(Entity *)this,0,uVar6); uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(auStack_80); break; case (Entity_Player *)0x15d: uVar6 = RNG::RandomInt(&this->_dropRNG,2); if (uVar6 == 0) { uVar6 = RNG::Next(&this->_dropRNG); fVar13 = 40.0; goto LAB_0043785e; } break; case (Entity_Player *)0x15f: ::Color::Color((Color *)auStack_60); pVVar7 = &this->_pos; Game::Fart(g_game,pVVar7,160.0,this->_player,0.5,0,color_00); Game::ButterBeanFart(g_game,pVVar7,200.0,this->_player,0,0); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_34,pVVar7, 180.0,8); uVar6 = 0; uStack_14 = 0; if (queryCount != (undefined1 *)0x0) { do { apEStack_74[0] = *(Entity_Player **)(auStack_34._4_4_ + uVar6 * 4); bVar5 = Entity::IsVulnerableEnemy((Entity *)apEStack_74[0],(Entity *)0x0); if (bVar5 != 0) { EntityRef::constructor((EntityRef *)(auStack_60 + 4),this->_player); Entity::AddFreeze((Entity *)apEStack_74[0],(EntityRef *)(auStack_60 + 4),-0x32,0); } uVar6 = uVar6 + 1; } while (uVar6 < queryCount); } uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(auStack_34); break; case (Entity_Player *)0x160: if (DAT_00c7e83c == '\0') { DAT_00c7e83c = 1; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_34,3,0xce, 0x160,0,0); uStack_14 = 1; VStack_6c.y = 0.0; if (queryCount != (undefined1 *)0x0) { uVar10 = auStack_34._4_4_; do { queriedEnemy = *(int **)(uVar10 + (int)VStack_6c.y * 4); if (*(char *)((int)queriedEnemy + 0x173) == '\0') { auStack_60._4_4_ = 0.0; fStack_58 = 0.0; fStack_48 = g_vectorZero.y; fStack_40 = g_vectorZero.y; fStack_54 = 0.0; fStack_50 = 0.0; fStack_4c = g_vectorZero.x; fStack_44 = g_vectorZero.x; fStack_3c = 0.0; fStack_38 = 0.0; (**(code **)(*queriedEnemy + 0x24))(auStack_60 + 4); } VStack_6c.y = (float)&((Entity_Familiar *)VStack_6c.y)->field_0x1; } while ((uint)VStack_6c.y < queryCount); this = uStack_64; } DAT_00c7e83c = '\0'; uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(auStack_34); } break; case (Entity_Player *)0x17f: Entity_Player::UseActiveItem(this->_player,(short *)((int)&uStack_64 + 2),0x17f,9,-1,0); uVar6 = Random(); uStack_64 = (Entity_Familiar *)0x0; VStack_88.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0 - 180.0; do { pEVar9 = this->_player; VStack_6c.y = pEVar9->_shotspeed * 10.0; apEStack_74[0] = (Entity_Player *)(((float)uStack_64 + VStack_88.y) * 0.017453292); VStack_94.x = cos((float)apEStack_74[0]); VStack_94.x = VStack_94.x * VStack_6c.y; fVar13 = sin((float)apEStack_74[0]); VStack_94.y = fVar13 * VStack_6c.y; velocity.y = VStack_94.y; velocity.x = VStack_94.x; tear = Entity_Player::FireTear(pEVar9,&this->_pos,velocity,6,(Entity *)0x0,1.0); fVar13 = (this->_pos).x; (tear->_targetPosition).y = (this->_pos).y; uStack_64 = (Entity_Familiar *)((float)uStack_64 + 60.0); (tear->_targetPosition).x = fVar13; } while ((float)uStack_64 < 360.0); break; case (Entity_Player *)0x18c: if (this->_parent != (EntityPtr)0x0) { iVar16 = *(int *)((int)this->_parent + 0x30); FUN_0074a280(iVar16,*(undefined4 *)(g_game->_ventricleRazorPortals + iVar16 * 0xc + 4),0); } break; case (Entity_Player *)0x1a5: Game::CharmFart(&this->_pos,0x42a00000,this); break; case (Entity_Player *)0x1b5: Entity_Player::UseActiveItem(this->_player,(short *)((int)&uStack_64 + 2),0x1b5,9,-1,0); pEVar9 = (Entity_Player *)this->_subtype; goto code_r0x00437e10; case (Entity_Player *)0x1de: Room::SetPauseTimer(g_game->_room,0x5a); break; case (Entity_Player *)0x1df: uVar6 = Random(); if ((uVar6 & 3) == 0) { uVar6 = RNG::Next(&this->_dropRNG); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,0.0,0,0,0); Game::Spawn(g_game,5,0x15e,pVVar7,&g_vectorZero,(Entity *)this,0,uVar6); } break; case (Entity_Player *)0x1e3: uVar6 = Random(); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,0.0,0,0,0); Game::Spawn(g_game,4,0x12,pVVar7,&g_vectorZero,(Entity *)this,0,uVar6); break; case (Entity_Player *)0x1e4: uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0x3d,&this->_pos,&g_vectorZero,this->_player,0,uVar6); VStack_88.y = (float)this->_player; if (spawned->_parent != (EntityPtr)0x0) { apEStack_74[0] = (Entity_Player *)&spawned->_parent; std::multiset::erase(apEStack_74); } spawned->_parent = (EntityPtr)VStack_88.y; if ((EntityPtr)VStack_88.y != (EntityPtr)0x0) { std::multiset::insert(&spawned->_parent); } *(float *)spawned[1]._sprite._filename._buf = this->_size; pAVar4 = &spawned[1]._sprite; (pAVar4->_filename)._buf[4] = '\0'; (pAVar4->_filename)._buf[5] = '\0'; (pAVar4->_filename)._buf[6] = -0x4c; (pAVar4->_filename)._buf[7] = 'B'; pAVar4 = &spawned[1]._sprite; (pAVar4->_filename)._buf[8] = '\n'; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &spawned[1]._sprite; (pAVar4->_filename)._buf[0xc] = '\n'; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; case (Entity_Player *)0x126: Game::ButterBeanFart(g_game,&this->_pos,80.0,this->_player,1,1); break; case (Entity_Player *)0x1e5: if (DAT_00c7e83d == '\0') { DAT_00c7e83d = 1; uVar11 = RNG::RandomInt(&this->_dropRNG,2); if (uVar11 == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_34,3, 0xce,-1,0,0); uVar6 = 0; uStack_14 = 3; if (queryCount != (undefined1 *)0x0) { do { if (*(char *)(*(int *)(auStack_34._4_4_ + uVar6 * 4) + 0x173) == '\0') { pEVar9 = this->_player; auStack_80._8_4_ = (pEVar9->_pos).x; apEStack_74[0] = (Entity_Player *)(pEVar9->_pos).y; Entity_Player::AddWisp (pEVar9,*(int *)(*(int *)(auStack_34._4_4_ + uVar6 * 4) + 0x30), (Vector *)(auStack_80 + 8),0,0); } uVar6 = uVar6 + 1; } while (uVar6 < queryCount); } } else { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_34,3, 0xce,-1,0,0); uStack_14 = 4; if (queryCount != (undefined1 *)0x0) { uVar11 = 0; do { auStack_60._4_4_ = 0.0; fStack_58 = 0.0; fStack_54 = 0.0; fStack_48 = g_vectorZero.y; fStack_40 = g_vectorZero.y; fStack_50 = 0.0; fStack_4c = g_vectorZero.x; fStack_44 = g_vectorZero.x; fStack_3c = 0.0; fStack_38 = 0.0; (**(code **)(**(int **)(auStack_34._4_4_ + uVar11 * 4) + 0x24)) (auStack_60 + 4,uVar6); uVar11 = uVar11 + 1; } while (uVar11 < queryCount); this = uStack_64; } } uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(auStack_34); DAT_00c7e83d = '\0'; } break; case (Entity_Player *)0x20b: uVar6 = RNG::Next(&this->_dropRNG); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,0.0,0,0,0); Game::Spawn(g_game,5,0,pVVar7,&g_vectorZero,(Entity *)this,4,uVar6); } } else { switch(pEVar9) { case (Entity_Player *)0x10006: case (Entity_Player *)0x10007: case (Entity_Player *)0x10008: case (Entity_Player *)0x10009: code_r0x00437e10: FUN_0043d7f0((undefined1 *)((int)&pEVar9[-1]._replacedPlayer + 3)); this->_health = this->_maxHitPoints; ExceptionList = local_1c; return 0; } } goto LAB_004372a0; } if (pEVar9 == (Entity_Player *)0x11f) { Entity_Player::trigger_cracked_orb(this->_player,&this->_pos); goto LAB_004372a0; } switch(pEVar9) { case (Entity_Player *)0x23: Entity_Player::UseActiveItem(this->_player,(short *)((int)&uStack_64 + 2),0x23,9,-1,0); break; case (Entity_Player *)0x25: case (Entity_Player *)0x41: dropRng = &this->_dropRNG; VStack_94.y = (float)RNG::Next(dropRng); VStack_88.y = (float)this->_player; uVar6 = RNG::Next(dropRng); pVVar7 = RandomVector((Vector *)(auStack_34 + 8),uVar6); fVar13 = RNG::RandomFloat(dropRng); this = uStack_64; VStack_6c.x = fVar13 * 2.0 + 2.0; VStack_6c.y = VStack_6c.x * pVVar7->y; VStack_6c.x = VStack_6c.x * pVVar7->x; uVar6 = 0; if (apEStack_74[0] == (Entity_Player *)0x41) { uVar6 = 3; } spawned = Game::Spawn(g_game,4,uVar6,&uStack_64->_pos,&VStack_6c,(Entity *)VStack_88.y,0, (uint)VStack_94.y); Entity_Player::GetBombFlags(this->_player,(BitSet128 *)auStack_80,0); if (this->_subtype == 0x25) { auStack_80._4_4_ = auStack_80._4_4_ | g_tearFlagHoming._l._4_4_; auStack_80._8_4_ = auStack_80._8_4_ | (uint)g_tearFlagHoming._h; auStack_80._0_4_ = auStack_80._0_4_ | (uint)g_tearFlagHoming._l; apEStack_74[0] = (Entity_Player *)((uint)apEStack_74[0] | g_tearFlagHoming._h._4_4_); } spawned[1]._sprite._filename._buf[0xf] = '\x01'; spawned[1]._variant = auStack_80._0_4_; spawned[1]._subtype = auStack_80._4_4_; spawned[1]._spawnerType = auStack_80._8_4_; spawned[1]._spawnerVariant = (int)apEStack_74[0]; if (this->_subtype == 0x25) { spawned[1]._type = 0x3f266666; *(undefined4 *)&spawned[1].field_0x40 = 0x3f400000; uVar6 = Random(); (spawned->_posOffset).x = 0.0; (spawned->_posOffset).y = -3.0; spawned[1]._damageEvents._capacity = (void *)(-3.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 5.0); } uVar10 = *(undefined4 *)((int)&spawned->_flags + 4); *(uint *)&spawned->_flags = (uint)spawned->_flags | 0x4000000; *(undefined4 *)((int)&spawned->_flags + 4) = uVar10; (**(code **)(*(int *)spawned + 0xc))(); break; case (Entity_Player *)0x28: pvVar2 = this->_player; uStack_64 = (Entity_Familiar *)((this->_pos).x - *(float *)((int)pvVar2 + 0x33c)); VStack_6c.y = (this->_pos).y - *(float *)((int)pvVar2 + 0x340); fVar13 = sqrtf((float)uStack_64 * (float)uStack_64 + VStack_6c.y * VStack_6c.y); if (70.0 <= fVar13) { spawned = uStack_64; tear = (Entity_Familiar *)VStack_6c.y; } else { spawned = (Entity_Familiar *)((float)uStack_64 * (70.0 / fVar13)); tear = (Entity_Familiar *)(VStack_6c.y * (70.0 / fVar13)); } ::Color::Color((Color *)auStack_60); VStack_88.x = (float)spawned + *(float *)((int)pvVar2 + 0x33c); VStack_88.y = (float)tear + *(float *)((int)pvVar2 + 0x340); Game::BombExplosionEffects (g_game,&VStack_88,30.0,(BitSet128)ZEXT816(0),Color,(Entity *)this,0.75,1,4,0); break; case (Entity_Player *)0x42: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 & 0xfffffffcU) < 0x109) { auStack_34._0_4_ = 0; } else { auStack_34._0_4_ = *(uint *)((int)pvVar2 + 0x108); } queryCount = (undefined1 *)0x0; auStack_34._4_4_ = 0; auStack_34._8_4_ = 0x5a; TemporaryEffects::AddEffect((TemporaryEffects *)((int)g_game->_room + 0x7310),auStack_34,1,1); manager = g_manager; fVar13 = Room::time_scale_update(g_game->_room); (manager->_musicManager)._targetPitch = fVar13; break; case (Entity_Player *)0x4e: TemporaryEffects::AddCollectibleEffect ((TemporaryEffects *)((int)this->_player + 0x1508),0x20e,1,1); uVar6 = Random(); spawned = Game::Spawn(g_game,3,0x7a,&this->_pos,&g_vectorZero,this->_player,0,uVar6); if ((spawned == (Entity *)0x0) || (spawned->_type != 3)) { spawned = (Entity *)0x0; } (**(code **)(*(int *)spawned + 0xc))(); Entity_Player::EvaluateItems(); manager = g_manager; uStack_64 = (Entity_Familiar *)0x109; seed_fart_sound_override(&uStack_64); tear = uStack_64; code_r0x00437295: SoundEffects::Play(&manager->_sfxManager,(int)tear,1.0,2,0,1.0,0.0); break; case (Entity_Player *)0x55: uVar6 = RNG::Next(&this->_dropRNG); iVar16 = ItemPool::GetCardEx(uVar6,0x19,0,10,1); isOnlyRunes = 0; bVar17 = 0; bVar5 = 1; goto LAB_004372ff; case (Entity_Player *)0x66: uVar6 = RNG::Next(&this->_dropRNG); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x46,pVVar7,&g_vectorZero,(Entity *)this,0,uVar6); if (this->_coins == 6) { targetPos.y = g_vectorZero.y; targetPos.x = g_vectorZero.x; Entity_NPC::ThrowSpider(&this->_pos,(Entity *)0x0,targetPos,0,-30.0); } break; case (Entity_Player *)0x6f: ::Color::Color((Color *)auStack_60); Game::Fart(g_game,&this->_pos,85.0,(Entity *)this,1.0,0,color); Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,0,0); break; case (Entity_Player *)0x91: spawned = Entity_Player::AddBlueFlies(this->_player,1,&this->_pos,(Entity *)0x0); if (spawned != (Entity *)0x0) { iVar16 = __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar16 + 0xd88) = 0xf; pVVar7 = MusicManager::RandomVector((Vector *)(auStack_34 + 8)); uVar6 = Random(); fVar14 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar13 = pVVar7->y; fVar1 = pVVar7->x; *(undefined4 *)(iVar16 + 0x188) = 0; *(float *)(iVar16 + 0x364) = fVar14 * fVar13 * 5.0; *(float *)(iVar16 + 0x360) = fVar14 * fVar1 * 5.0; this = uStack_64; } break; case (Entity_Player *)0x107: uVar6 = RNG::Next(&this->_dropRNG); iVar16 = ItemPool::GetCardEx(uVar6,0,1,0,1); isOnlyRunes = 1; bVar17 = 1; bVar5 = 0; LAB_004372ff: queryCount = &DAT_00000007; auStack_34._4_4_ = 5; auStack_34._8_4_ = 9; auStack_34._0_4_ = uVar6; uVar6 = lua_callback_run_get_card((RNG *)auStack_34,iVar16,bVar5,bVar17,isOnlyRunes); uVar11 = RNG::Next(&uStack_64->_dropRNG); pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_34 + 8),&uStack_64->_pos,40.0,0,0,0); this = uStack_64; Game::Spawn(g_game,5,300,pVVar7,&g_vectorZero,(Entity *)uStack_64,uVar6,uVar11); } LAB_004372a0: pEVar9 = (Entity_Player *)this->_wispCollectibleType; if ((pEVar9 == (Entity_Player *)0x1ea) || (pEVar9 == (Entity_Player *)0x203)) { pvVar2 = this->_player; itemListEnd = *(uint **)((int)pvVar2 + 0x1de0); apEStack_74[0] = pEVar9; if (itemListEnd == *(uint **)((int)pvVar2 + 0x1de4)) { std::vector::_Emplace_reallocate(itemListEnd,apEStack_74); } else { *itemListEnd = (uint)pEVar9; *(int *)((int)pvVar2 + 0x1de0) = *(int *)((int)pvVar2 + 0x1de0) + 4; } } uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6); (spawned->_posOffset).x = 0.0; spawnedColor = &(spawned->_sprite)._color; (spawned->_posOffset).y = -6.0; if (0.0 < *(float *)((int)wispConfig + 0x110) || *(float *)((int)wispConfig + 0x110) == 0.0) { if (spawnedColor != (ColorMod *)((int)wispConfig + 0x104)) { fVar13 = *(float *)((int)wispConfig + 0x108); fVar1 = *(float *)((int)wispConfig + 0x10c); fVar14 = *(float *)((int)wispConfig + 0x110); spawnedColor->_tint[0] = *(float *)((int)wispConfig + 0x104); (spawned->_sprite)._color._tint[1] = fVar13; (spawned->_sprite)._color._tint[2] = fVar1; (spawned->_sprite)._color._tint[3] = fVar14; fVar13 = *(float *)((int)wispConfig + 0x118); fVar1 = *(float *)((int)wispConfig + 0x11c); fVar14 = *(float *)((int)wispConfig + 0x120); (spawned->_sprite)._color._colorize[0] = *(float *)((int)wispConfig + 0x114); (spawned->_sprite)._color._colorize[1] = fVar13; (spawned->_sprite)._color._colorize[2] = fVar1; (spawned->_sprite)._color._colorize[3] = fVar14; *(undefined8 *)(spawned->_sprite)._color._offset = *(undefined8 *)((int)wispConfig + 0x124); layer1Color._offset[2] = *(float *)((int)wispConfig + 300); goto LAB_00438335; } } else { ::Color::Color(&layer1Color); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer1Color._colorize[0] = (layer->_color)._tint[0]; layer1Color._colorize[1] = (layer->_color)._tint[1]; layer1Color._colorize[2] = (layer->_color)._tint[2]; layer1Color._colorize[3] = (layer->_color)._tint[3]; if (spawnedColor != (ColorMod *)&layer1Color) { spawnedColor->_tint[0] = layer1Color._tint[0]; (spawned->_sprite)._color._tint[1] = layer1Color._tint[1]; (spawned->_sprite)._color._tint[2] = layer1Color._tint[2]; (spawned->_sprite)._color._tint[3] = layer1Color._tint[3]; (spawned->_sprite)._color._colorize[0] = layer1Color._colorize[0]; (spawned->_sprite)._color._colorize[1] = layer1Color._colorize[1]; (spawned->_sprite)._color._colorize[2] = layer1Color._colorize[2]; (spawned->_sprite)._color._colorize[3] = layer1Color._colorize[3]; *(undefined8 *)(spawned->_sprite)._color._offset = layer1Color._offset._0_8_; LAB_00438335: (spawned->_sprite)._color._offset[2] = layer1Color._offset[2]; } } uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0xc,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar6); (spawned->_posOffset).x = 0.0; spawnedColor = &(spawned->_sprite)._color; (spawned->_posOffset).y = -6.0; if (0.0 < *(float *)((int)wispConfig + 0x13c) || *(float *)((int)wispConfig + 0x13c) == 0.0) { if (spawnedColor == (ColorMod *)((int)wispConfig + 0x130)) goto LAB_0043842f; fVar13 = *(float *)((int)wispConfig + 0x134); fVar1 = *(float *)((int)wispConfig + 0x138); fVar14 = *(float *)((int)wispConfig + 0x13c); spawnedColor->_tint[0] = *(float *)((int)wispConfig + 0x130); (spawned->_sprite)._color._tint[1] = fVar13; (spawned->_sprite)._color._tint[2] = fVar1; (spawned->_sprite)._color._tint[3] = fVar14; fVar13 = *(float *)((int)wispConfig + 0x144); fVar1 = *(float *)((int)wispConfig + 0x148); fVar14 = *(float *)((int)wispConfig + 0x14c); (spawned->_sprite)._color._colorize[0] = *(float *)((int)wispConfig + 0x140); (spawned->_sprite)._color._colorize[1] = fVar13; (spawned->_sprite)._color._colorize[2] = fVar1; (spawned->_sprite)._color._colorize[3] = fVar14; *(undefined8 *)(spawned->_sprite)._color._offset = *(undefined8 *)((int)wispConfig + 0x150); layer0Color._offset[2] = *(float *)((int)wispConfig + 0x158); } else { ::Color::Color(&layer0Color); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer0Color._colorize[0] = (layer->_color)._tint[0]; layer0Color._colorize[1] = (layer->_color)._tint[1]; layer0Color._colorize[2] = (layer->_color)._tint[2]; layer0Color._colorize[3] = (layer->_color)._tint[3]; if (spawnedColor == (ColorMod *)&layer0Color) goto LAB_0043842f; spawnedColor->_tint[0] = layer0Color._tint[0]; (spawned->_sprite)._color._tint[1] = layer0Color._tint[1]; (spawned->_sprite)._color._tint[2] = layer0Color._tint[2]; (spawned->_sprite)._color._tint[3] = layer0Color._tint[3]; (spawned->_sprite)._color._colorize[0] = layer0Color._colorize[0]; (spawned->_sprite)._color._colorize[1] = layer0Color._colorize[1]; (spawned->_sprite)._color._colorize[2] = layer0Color._colorize[2]; (spawned->_sprite)._color._colorize[3] = layer0Color._colorize[3]; *(undefined8 *)(spawned->_sprite)._color._offset = layer0Color._offset._0_8_; } (spawned->_sprite)._color._offset[2] = layer0Color._offset[2]; LAB_0043842f: manager = g_manager; wispConfig = (void *)0x105; seed_fart_sound_override((int *)&wispConfig); SoundEffects::Play(&manager->_sfxManager,(int)wispConfig,1.0,2,0,1.0,0.0); ExceptionList = local_1c; return 1; } //@@ 004386f0 Entity_Familiar::fire_wisp_projectile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: only caller Entity_Familiar::FireProjectile for variant 0xce/0xed (Wisp/Item Wisp); get_wisp_config, AddBlueFlies, FireBrimstone prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Tear * __thiscall Entity_Familiar::fire_wisp_projectile(Entity_Familiar *dropRng,Vector velocity) { void *x; code *pcVar1; BitSet128 flags; BitSet128 flags_00; ANM2 *pAVar2; byte bVar3; void *pvVar4; Vector *vecResult; Entity_Laser *laser; int iVar5; Entity_Tear *shot; uint uVar6; Entity *laser; int *effect; EntityPtr blueFly; BitSet128 *spectralFlags; LayerState *layer; uint rngResult; float *tearStats; float10 depthOffset; float fVar8; float fVar9; float fVar10; EntityPtr *pEVar11; Entity_Familiar *pEVar12; undefined4 uVar13; TypeDescriptor *pTVar14; TypeDescriptor *pTVar15; undefined4 rngResult; RNG local_e0; Vector local_d0; float fallingAccel; Entity_Familiar *local_c4; float tearScale; float tearDamage; Vector local_b8; void *local_b0; float local_ac; EntityPtr *local_a8; uint local_a4; EntityPtr *local_a0; EntityPtr *local_9c; uint local_98; uint uStack_94; uint uStack_90; uint uStack_8c; float local_84; uint local_80; float local_7c; Vector scratchVec; Entity *local_70; Color tearColor; ColorMod tmpColor; float local_14; RNG *dropRng; local_14 = (float)(__security_cookie ^ (uint)((&tmpColor)[1]._tint + 1)); if (dropRng->_variant == 0xed) { iVar5 = dropRng->_wispCollectibleType; } else if (dropRng->_variant == 0xce) { iVar5 = dropRng->_subtype; } else { iVar5 = 0x248; } local_c4 = dropRng; pvVar4 = ItemConfig::get_wisp_config(iVar5); iVar5 = dropRng->_subtype; local_b0 = pvVar4; if (iVar5 == 0x10004) { fire_robo_baby_laser(dropRng,&velocity); return (Entity_Tear *)0x0; } if (iVar5 == 0x1000d) { local_84 = velocity.y; scratchVec.y = velocity.y; local_9c = (EntityPtr *)velocity.x; scratchVec.x = velocity.x; fVar8 = sqrtf(velocity.y * velocity.y + velocity.x * velocity.x); if (0.0 < fVar8) { local_9c = (EntityPtr *)((1.0 / fVar8) * (float)local_9c); local_84 = local_84 * (1.0 / fVar8); scratchVec.x = (float)local_9c; scratchVec.y = local_84; } bVar3 = 0; vecResult = Vector::ToCardinal(&local_b8,&scratchVec); laser = FireBrimstone(dropRng,vecResult,bVar3); iVar5 = *(int *)laser; (laser->_posOffset).x = (float)local_9c * 7.0; (laser->_posOffset).y = local_84 * 5.0 - 18.0; LAB_00438842: (**(code **)(iVar5 + 0xc))(); dropRng->_headFrameDelay = 0x1e; if (ABS(local_84) < ABS((float)local_9c)) { iVar5 = 2; if ((float)local_9c < 0.0) { iVar5 = 0; } PlayShootAnim(dropRng,iVar5); return (Entity_Tear *)0x0; } PlayShootAnim(dropRng,(uint)(0.0 <= local_84) * 2 + 1); return (Entity_Tear *)0x0; } if (iVar5 == 0x10011) { local_84 = velocity.y; scratchVec.y = velocity.y; local_9c = (EntityPtr *)velocity.x; scratchVec.x = velocity.x; fVar8 = sqrtf(velocity.y * velocity.y + velocity.x * velocity.x); if (0.0 < fVar8) { local_9c = (EntityPtr *)((1.0 / fVar8) * (float)local_9c); local_84 = local_84 * (1.0 / fVar8); scratchVec.x = (float)local_9c; scratchVec.y = local_84; } bVar3 = 0; vecResult = Vector::ToCardinal(&local_b8,&scratchVec); laser = FireBrimstone(dropRng,vecResult,bVar3); (**(code **)(*(int *)laser + 0x40)) (*(float *)((int)local_b0 + 4) * (float)dropRng[1]._damageEvents._capacity); (laser->_posOffset).x = (float)local_9c * 7.0; (laser->_posOffset).y = local_84 * 5.0 - 18.0; iVar5 = *(int *)laser; goto LAB_00438842; } if (iVar5 == 0x1000f) { if (dropRng->_player->_numBlueFlies < 5) { Entity_Player::AddBlueFlies(dropRng->_player,1,&dropRng->_pos,(Entity *)0x0); return (Entity_Tear *)0x0; } return (Entity_Tear *)0x0; } if (iVar5 == 0x22c) { Vector::Normalized(&velocity,&scratchVec); bVar3 = 1; vecResult = Vector::ToCardinal(&local_b8,&scratchVec); shot = (Entity_Tear *)FireBrimstone(dropRng,vecResult,bVar3); pAVar2 = &shot->_tearHaloANM2; (pAVar2->_animDefaultName)._buf[0xc] = '\0'; (pAVar2->_animDefaultName)._buf[0xd] = '\0'; (pAVar2->_animDefaultName)._buf[0xe] = '4'; (pAVar2->_animDefaultName)._buf[0xf] = 'C'; (shot->_posOffset).x = scratchVec.x * 7.0; (shot->_posOffset).y = scratchVec.y * 5.0 - 18.0; pcVar1 = *(code **)(*(int *)shot + 0x40); fVar8 = apply_tear_modifiers(local_c4); (*pcVar1)(fVar8 * 3.5); pEVar12 = local_c4; apply_baby_bender(local_c4,shot); Entity::convert_shot_for_enemy_owner((Entity *)pEVar12,(Entity *)shot); (**(code **)(*(int *)shot + 0xc))(); depthOffset = (float10)copysignf(0x40a00000,shot->_renderDepthOffset); shot->_renderDepthOffset = (float)depthOffset; pEVar12->_headFrameDelay = 0x1e; iVar5 = vector_to_direction(&scratchVec); PlayShootAnim(pEVar12,iVar5); return (Entity_Tear *)0x0; } if (iVar5 == 0x121) { Vector::ToCardinal(&scratchVec,&velocity); uVar6 = Random(); rngResult = 0; pTVar15 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_b8.x = scratchVec.x * 5.0 + velocity.x; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; local_b8.y = scratchVec.y * 5.0 + velocity.y; laser = Game::Spawn(g_game,1000,0x34,&dropRng->_pos,&local_b8,(Entity *)dropRng,0,uVar6); effect = (int *)__RTDynamicCast(laser,uVar13,pTVar14,pTVar15,rngResult); (**(code **)(*effect + 0x40))((float)dropRng[1]._damageEvents._capacity * 10.0); effect[0x11e] = 0x3f000000; effect[0x117] = 0x96; effect[0x118] = 0x96; (**(code **)(*effect + 0xc))(); return (Entity_Tear *)0x0; } local_a8 = (EntityPtr *)0x0; if (iVar5 == 0x280) { uVar6 = Random(); if (uVar6 % 7 == 0) { Vector::ToCardinal(&scratchVec,&velocity); uVar6 = Random(); rngResult = 0; pTVar15 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_b8.x = scratchVec.x * 5.0 + velocity.x; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; local_b8.y = scratchVec.y * 5.0 + velocity.y; laser = Game::Spawn(g_game,1000,10,&dropRng->_pos,&local_b8,(Entity *)dropRng,0,uVar6); effect = (int *)__RTDynamicCast(laser,uVar13,pTVar14,pTVar15,rngResult); (**(code **)(*effect + 0x40))((float)dropRng[1]._damageEvents._capacity * 10.0); effect[0x11e] = 0x3f000000; effect[0x117] = 0x5a; effect[0x118] = 0x5a; (**(code **)(*effect + 0xc))(); return (Entity_Tear *)0x0; } } else if (iVar5 == 0x242) { dropRng->_coins = dropRng->_coins + 1; if ((dropRng->_coins & 1) == 0) { uVar6 = Random(); laser = Game::Spawn(g_game,1000,0x2e,&dropRng->_pos,&g_vectorZero,(Entity *)dropRng,0,uVar6); iVar5 = *(int *)laser; pAVar2 = &laser[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &laser[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar5 + 0x40))((float)dropRng[1]._damageEvents._capacity * 7.0); (**(code **)(*(int *)laser + 0xc))(); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 6.0714; tmpColor._colorize[1] = 5.7857; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)&laser->_sprite,&tmpColor); pvVar4 = local_b0; } } else if (iVar5 == 0x27f) { uVar6 = Random(); if (uVar6 % 10 != 0) { return (Entity_Tear *)0x0; } pEVar11 = &dropRng->_linkedEntity; if (dropRng->_linkedEntity != (EntityPtr)0x0) { return (Entity_Tear *)0x0; } blueFly = (EntityPtr)Entity_Player::AddBlueFlies(dropRng->_player,1,&dropRng->_pos,(Entity *)0x0); if (blueFly == (EntityPtr)0x0) { return (Entity_Tear *)0x0; } if (*pEVar11 != (EntityPtr)0x0) { local_a0 = pEVar11; std::multiset::erase(&local_a0); } *pEVar11 = blueFly; std::multiset::insert(pEVar11); return (Entity_Tear *)0x0; } local_ac = 0.8; bVar3 = Entity_Player::HasCollectible(dropRng->_player,0xf7,0); if (bVar3 == 0) { local_84 = 1.0; } else { local_84 = 2.0; } bVar3 = Entity_Player::HasCollectible(dropRng->_player,0xf7,0); if (bVar3 != 0) { local_ac = 1.0; } fallingAccel = 0.0; Color::Color(&tearColor); iVar5 = _get_index_plus_one_if_kind_4_5(); local_a0 = (EntityPtr *) ((float)(iVar5 + -1) * *(float *)((int)pvVar4 + 8) + *(float *)((int)pvVar4 + 4)); uVar6 = Random(); x = dropRng[1]._damageEvents._end; tearStats = (float *)((int)pvVar4 + 0x60); if (*(float *)((int)pvVar4 + 0xa8) <= (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10) { tearStats = (float *)((int)pvVar4 + 0x18); } tearDamage = (float)x * *tearStats * (float)dropRng[1]._damageEvents._capacity * (float)local_a0; fVar8 = sqrtf((float)x); fVar8 = fVar8 * tearStats[1] * local_ac; tearScale = fVar8; spectralFlags = BitSet128::operator_or ((BitSet128 *)&local_e0,&g_tearFlagSpectral,(BitSet128 *)(tearStats + 0xe)); local_a4 = (uint)spectralFlags->_l; uStack_94 = *(uint *)((int)&spectralFlags->_l + 4); uStack_90 = (uint)spectralFlags->_h; uStack_8c = *(uint *)((int)&spectralFlags->_h + 4); local_98 = local_a4; local_80 = uStack_94; local_7c = (float)uStack_90; local_70 = (Entity *)uStack_8c; Color::operator_assign(&tearColor,(ColorMod *)(tearStats + 3)); local_a0 = (EntityPtr *)tearStats[2]; velocity.x = velocity.x * *(float *)((int)local_b0 + 0xc); velocity.y = velocity.y * *(float *)((int)local_b0 + 0xc); uVar6 = dropRng->_subtype; local_b0 = (void *)velocity.x; local_ac = velocity.y; local_9c = local_a0; if (uVar6 < 0x9f) { if (uVar6 == 0x9e) { scratchVec.x = velocity.x; local_d0.y = sqrtf(velocity.y * velocity.y + velocity.x * velocity.x); local_b0 = (void *)((float)local_b0 / local_d0.y); local_70 = (Entity *)0x0; local_b8.y = (float)g_game->_room; local_80 = 0; local_ac = local_ac / local_d0.y; local_7c = 0.0; if (*(int *)((int)local_b8.y + 0x1264) != 0) { do { laser = *(Entity **)(*(int *)((int)local_b8.y + 0x125c) + local_80 * 4); fVar8 = (laser->_pos).y - (dropRng->_pos).y; fVar10 = (laser->_pos).x - (dropRng->_pos).x; scratchVec.y = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); bVar3 = Entity::IsVulnerableEnemy(laser,(Entity *)0x0); if (((bVar3 != 0) && ((laser->_flags & 0x20000000) == 0)) && (laser->_dead == 0)) { local_a0 = (EntityPtr *)((laser->_pos).x - (dropRng->_pos).x); local_c4 = (Entity_Familiar *)((laser->_pos).y - (dropRng->_pos).y); fVar8 = sqrtf((float)local_a0 * (float)local_a0 + (float)local_c4 * (float)local_c4); pEVar12 = local_c4; pEVar11 = local_a0; if (0.0 < fVar8) { pEVar12 = (Entity_Familiar *)((float)local_c4 * (1.0 / fVar8)); pEVar11 = (EntityPtr *)((float)local_a0 * (1.0 / fVar8)); } fVar8 = (float)local_b0 * (float)pEVar11 + local_ac * (float)pEVar12; if (0.8 <= fVar8) { fVar10 = 800.0 - scratchVec.y; if (fVar10 <= 0.0) { fVar10 = 0.0; } fVar9 = 400.0 - laser->_health; if (fVar9 <= 0.0) { fVar9 = 0.0; } fVar9 = fVar8 * 2000.0 + 0.0 + fVar10 + fVar9; if (local_7c < fVar9) { local_7c = fVar9; local_70 = laser; } } } laser = local_70; local_80 = local_80 + 1; } while (local_80 < *(uint *)((int)local_b8.y + 0x1264)); if (local_70 != (Entity *)0x0) { fVar8 = (dropRng->_pos).y - (local_70->_pos).y; fVar10 = (dropRng->_pos).x - (local_70->_pos).x; fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); scratchVec.y = (fVar8 * (laser->_velocity).y * 0.05 + (laser->_pos).y) - (dropRng->_pos).y; scratchVec.x = (fVar8 * (laser->_velocity).x * 0.05 + (laser->_pos).x) - (dropRng->_pos).x; vecResult = Vector::Resized(&scratchVec,&local_b8,local_d0.y); velocity.x = vecResult->x; velocity.y = vecResult->y; } } goto switchD_00438fa0_caseD_27; } switch(uVar6) { case 0x26: uVar6 = Random(); local_a0 = (EntityPtr *) (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292); local_ac = cos((float)local_a0); fVar8 = sin((float)local_a0); fVar10 = fVar8 * velocity.x; velocity.x = local_ac * velocity.x - fVar8 * velocity.y; velocity.y = local_ac * velocity.y + fVar10; break; case 0x28: uVar6 = Random(); local_a8 = (EntityPtr *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 1.0 + 0.0); break; case 0x2a: fallingAccel = 0.6; uVar6 = Random(); local_a8 = (EntityPtr *) (0.0 - ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 5.0)); break; case 0x2f: if (((*(int *)((int)dropRng->_player + 0x1600) == 0x2f) && (iVar5 = *(int *)((int)dropRng->_player + 0x13dc), iVar5 != 0)) && ((*(int *)(iVar5 + 0x30) == 6 && ((iVar5 = *(int *)(iVar5 + 0x44), iVar5 != 0 && (0xf < g_game->_frameCount - *(int *)(iVar5 + 0x328))))))) { local_ac = *(float *)(iVar5 + 0x340); local_a0 = *(EntityPtr **)(iVar5 + 0x33c); vecResult = MusicManager::RandomVector(&scratchVec); uVar6 = Random(); local_c4 = (Entity_Familiar *)(dropRng->_pos).x; fVar8 = (dropRng->_pos).y; fallingAccel = 1.2; fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; scratchVec.y = fVar10 * vecResult->y * 120.0 + local_ac; local_b8.y = fVar10 * vecResult->x * 120.0 + (float)local_a0; velocity.y = (scratchVec.y - fVar8) / 20.0; velocity.x = (local_b8.y - (float)local_c4) / 20.0; fVar10 = velocity.y * velocity.y + velocity.x * velocity.x; local_d0.y = velocity.y; local_b0 = (void *)velocity.y; local_ac = fVar8; local_a8 = (EntityPtr *)velocity.x; local_a0 = (EntityPtr *)velocity.x; if (225.0 < fVar10) { fVar8 = sqrtf(fVar10); local_a8 = local_a0; local_b0 = (void *)local_d0.y; if (0.0 < fVar8) { local_b0 = (void *)((15.0 / fVar8) * local_d0.y); local_a8 = (EntityPtr *)((15.0 / fVar8) * (float)local_a0); } } local_98 = local_a4 | (uint)g_tearFlagExplosive._l; tearDamage = tearDamage * 4.0 + 8.0; uStack_94 = local_80 | g_tearFlagExplosive._l._4_4_; uStack_90 = (uint)local_7c | (uint)g_tearFlagExplosive._h; uStack_8c = (uint)local_70 | g_tearFlagExplosive._h._4_4_; tearScale = tearScale * 1.5; velocity.x = (float)local_a8; velocity.y = (float)local_b0; local_70 = (Entity *) sqrtf((local_ac - scratchVec.y) * (local_ac - scratchVec.y) + ((float)local_c4 - local_b8.y) * ((float)local_c4 - local_b8.y)); fVar8 = sqrtf((float)local_b0 * (float)local_b0 + (float)local_a8 * (float)local_a8); local_70 = (Entity *)((float)local_70 / fVar8); fVar8 = pow(0.9,(float)local_70); fVar8 = (fVar8 - 1.0) * -9.491221; if (fVar8 <= 0.01) { fVar8 = 0.01; } local_a8 = (EntityPtr *)((18.0 - ((float)local_70 - fVar8) * 13.0) / fVar8); } break; case 0x38: local_a8 = (EntityPtr *)0x3f19999a; break; case 0x4d: switchD_00438fa0_caseD_4d: layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); scratchVec.y = (layer->_color)._tint[0] * 0.5; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); local_b8.y = (layer->_color)._tint[1] * 0.5; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[3] = 1.0; tmpColor._tint[0] = scratchVec.y * 1.25; tmpColor._tint[1] = local_b8.y * 1.25; tmpColor._tint[2] = tmpColor._offset[2] * 1.25; tmpColor._offset[0] = scratchVec.y * 0.25; tmpColor._offset[1] = local_b8.y * 0.25; tmpColor._offset[2] = tmpColor._offset[2] * 0.25; Color::operator_assign(&tearColor,&tmpColor); break; case 0x66: layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); scratchVec.y = (layer->_color)._tint[0] * 0.5; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); local_b8.y = (layer->_color)._tint[1] * 0.5; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[3] = 1.0; tmpColor._tint[0] = scratchVec.y * 1.25; tmpColor._tint[1] = local_b8.y * 1.25; tmpColor._tint[2] = tmpColor._offset[2] * 1.25; tmpColor._offset[0] = scratchVec.y * 0.25; tmpColor._offset[1] = local_b8.y * 0.25; tmpColor._offset[2] = tmpColor._offset[2] * 0.25; Color::operator_assign(&tearColor,&tmpColor); uVar6 = Random(); if ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 < 0.15) { switch(dropRng->_coins) { case 1: local_98 = local_a4 | (uint)g_tearFlagPoison._l; uStack_94 = local_80 | g_tearFlagPoison._l._4_4_; uStack_90 = (uint)local_7c | (uint)g_tearFlagPoison._h; uStack_8c = (uint)local_70 | g_tearFlagPoison._h._4_4_; break; case 2: local_98 = local_a4 | DAT_00c34be0; uStack_94 = local_80 | DAT_00c34be4; uStack_90 = (uint)local_7c | DAT_00c34be8; uStack_8c = (uint)local_70 | DAT_00c34bec; break; case 3: local_98 = local_a4 | DAT_00c34bf0; uStack_94 = local_80 | DAT_00c34bf4; uStack_90 = (uint)local_7c | DAT_00c34bf8; uStack_8c = (uint)local_70 | DAT_00c34bfc; break; case 4: local_98 = local_a4 | DAT_00c34c00; uStack_94 = local_80 | DAT_00c34c04; uStack_90 = (uint)local_7c | DAT_00c34c08; uStack_8c = (uint)local_70 | DAT_00c34c0c; break; case 5: dropRng = &dropRng->_dropRNG; local_b8.y = (float)RNG::Next(dropRng); uVar6 = RNG::Next(dropRng); vecResult = RandomVector(&local_d0,uVar6); fVar8 = RNG::RandomFloat(dropRng); dropRng = local_c4; scratchVec.x = fVar8 * 2.0 + 2.0; scratchVec.y = scratchVec.x * vecResult->y; scratchVec.x = scratchVec.x * vecResult->x; laser = Game::Spawn(g_game,4,3,&local_c4->_pos,&scratchVec,(Entity *)0x0,0, (uint)local_b8.y); (**(code **)(*(int *)laser + 0xc))(); } } break; case 0x7b: local_e0._seed = dropRng->_initSeed; local_e0._shift3 = 9; local_e0._shift1 = 2; local_e0._shift2 = 0x15; familiar_wisp_pick_tear_color(&local_e0,&local_a0,&local_98); local_98 = local_98 | (uint)g_tearFlagSpectral._l; uStack_94 = uStack_94 | g_tearFlagSpectral._l._4_4_; uStack_90 = uStack_90 | (uint)g_tearFlagSpectral._h; uStack_8c = uStack_8c | g_tearFlagSpectral._h._4_4_; scratchVec.y = RNG::RandomFloat(&local_e0); tearDamage = (scratchVec.y * 0.4 + 0.8) * tearDamage; fVar8 = RNG::RandomFloat(&local_e0); fallingAccel = 0.0; local_d0.y = fVar8 * 0.4 - 0.2; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); scratchVec.y = (layer->_color)._tint[0] * 0.5; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); local_b8.y = (layer->_color)._tint[1] * 0.5; layer = ANM2::GetLayer(&dropRng->_sprite,(byte *)0x1); tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[3] = 1.0; tmpColor._tint[0] = scratchVec.y * 1.25; tmpColor._tint[1] = local_b8.y * 1.25; tmpColor._tint[2] = tmpColor._offset[2] * 1.25; tmpColor._offset[0] = scratchVec.y * 0.25; tmpColor._offset[1] = local_b8.y * 0.25; tmpColor._offset[2] = tmpColor._offset[2] * 0.25; Color::operator_assign(&tearColor,&tmpColor); fVar8 = RNG::RandomFloat(&local_e0); local_9c = local_a0; scratchVec.y = fVar8 * 0.6 + 0.7; velocity.y = scratchVec.y * velocity.y; velocity.x = scratchVec.y * velocity.x; local_a8 = (EntityPtr *)local_d0.y; } goto switchD_00438fa0_caseD_27; } if (0x204 < uVar6) { if (uVar6 == 0x246) { pvVar4 = dropRng->_player; iVar5 = TemporaryEffects::GetCollectibleEffectNum ((TemporaryEffects *)((int)pvVar4 + 0x1508),0x246); scratchVec.y = (float)iVar5 * 0.75; iVar5 = TemporaryEffects::GetNullEffectNum((TemporaryEffects *)((int)pvVar4 + 0x1508),0x47); local_84 = (float)iVar5 * 0.3 + scratchVec.y + local_84; fVar8 = sqrtf(local_84); tearScale = fVar8 * 0.23 + local_84 * 0.01 + 0.55; goto switchD_00438fa0_caseD_27; } if (uVar6 == 0x263) { tearDamage = (float)dropRng->_keys * 0.5 * tearDamage; tearScale = ((float)dropRng->_keys * 0.1 + 1.0) * fVar8; goto switchD_00438fa0_caseD_27; } if (uVar6 != 0x1000e) goto switchD_00438fa0_caseD_27; LAB_00439c27: vecResult = MusicManager::RandomVector(&scratchVec); uVar6 = Random(); fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar10 = fVar8 * vecResult->y; fVar8 = fVar8 * vecResult->x; velocity.y = fVar10 + fVar10 + velocity.y; velocity.x = fVar8 + fVar8 + velocity.x; uVar6 = Random(); fallingAccel = 0.5; fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.25; velocity.y = fVar8 * velocity.y; velocity.x = fVar8 * velocity.x; uVar6 = Random(); rngResult = Random(); tearScale = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.05 + ((float)(uVar6 & 1) + 0.0) * 0.4 + 0.9) * tearScale; uVar6 = Random(); local_a8 = (EntityPtr *) (0.0 - ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 15.0 + 5.0)); goto switchD_00438fa0_caseD_27; } if (uVar6 == 0x204) { dropRng->_coins = dropRng->_coins + 1; goto switchD_00438fa0_caseD_27; } switch(uVar6) { case 0x12a: goto switchD_00438fa0_caseD_4d; default: goto switchD_00438fa0_caseD_27; case 0x144: break; case 0x145: local_9c = (EntityPtr *)0x1; goto LAB_00439c27; case 0x196: local_e0._seed = (dropRng->_dropRNG)._seed; local_e0._shift1 = 2; local_e0._shift2 = 7; local_e0._shift3 = 7; scratchVec.y = RNG::RandomFloat(&local_e0); tearDamage = (scratchVec.y * 2.0 - 1.0) + tearDamage; goto switchD_00438fa0_caseD_27; } uVar6 = Random(); switch(uVar6 % 9) { case 1: local_98 = local_a4 | DAT_00c34c00; uStack_94 = local_80 | DAT_00c34c04; uStack_90 = (uint)local_7c | DAT_00c34c08; uStack_8c = (uint)local_70 | DAT_00c34c0c; local_9c = (EntityPtr *)0x5; break; case 2: local_98 = local_a4 | DAT_00c34c10; uStack_94 = local_80 | DAT_00c34c14; uStack_90 = (uint)local_7c | DAT_00c34c18; uStack_8c = (uint)local_70 | DAT_00c34c1c; tearColor._tint[0] = 1.0; tearColor._tint[1] = 0.0; tearColor._tint[2] = 1.0; tearColor._tint[3] = 1.0; tearColor._offset[0] = 0.19607845; tearColor._offset[1] = 0.0; tearColor._offset[2] = 0.0; break; case 3: local_98 = local_a4 | DAT_00c34bf0; uStack_94 = local_80 | DAT_00c34bf4; uStack_90 = (uint)local_7c | DAT_00c34bf8; uStack_8c = (uint)local_70 | DAT_00c34bfc; tearColor._tint[0] = 0.5; tearColor._tint[1] = 0.5; tearColor._tint[2] = 0.5; tearColor._tint[3] = 1.0; break; case 4: local_98 = local_a4 | DAT_00c34c20; uStack_94 = local_80 | DAT_00c34c24; uStack_90 = (uint)local_7c | DAT_00c34c28; uStack_8c = (uint)local_70 | DAT_00c34c2c; tearColor._tint[0] = 1.0; tearColor._tint[1] = 1.0; tearColor._tint[2] = 0.455; tearColor._tint[3] = 1.0; tearColor._offset[0] = 0.169; tearColor._offset[1] = 0.145; tearColor._offset[2] = 0.0; break; case 5: tearColor._tint[0] = 1.25; tearColor._tint[1] = 0.05; tearColor._tint[2] = 0.15; uStack_8c = DAT_00c34bec; local_98 = DAT_00c34be0; uStack_94 = DAT_00c34be4; uStack_90 = DAT_00c34be8; goto LAB_00439f99; case 6: tearColor._tint[0] = 0.4; tearColor._tint[1] = 0.97; tearColor._tint[2] = 0.5; uStack_8c = g_tearFlagPoison._h._4_4_; local_98 = (uint)g_tearFlagPoison._l; uStack_94 = g_tearFlagPoison._l._4_4_; uStack_90 = (uint)g_tearFlagPoison._h; LAB_00439f99: uStack_90 = (uint)local_7c | uStack_90; uStack_94 = local_80 | uStack_94; local_98 = local_a4 | local_98; uStack_8c = (uint)local_70 | uStack_8c; tearColor._tint[3] = 1.0; tearColor._offset[0] = 0.0; tearColor._offset[1] = 0.0; tearColor._offset[2] = 0.0; break; case 7: local_98 = local_a4 | DAT_00c34c30; uStack_94 = local_80 | DAT_00c34c34; uStack_90 = (uint)local_7c | DAT_00c34c38; uStack_8c = (uint)local_70 | DAT_00c34c3c; tearColor._tint[0] = 2.0; tearColor._tint[1] = 2.0; tearColor._tint[2] = 2.0; tearColor._tint[3] = 1.0; tearColor._offset[0] = 0.19607845; tearColor._offset[1] = 0.19607845; tearColor._offset[2] = 0.19607845; break; case 8: local_98 = local_a4 | DAT_00c34c40; uStack_94 = local_80 | DAT_00c34c44; uStack_90 = (uint)local_7c | DAT_00c34c48; uStack_8c = (uint)local_70 | DAT_00c34c4c; tearColor._colorize[0] = 0.3; tearColor._colorize[1] = 0.4; tearColor._colorize[2] = 1.0; tearColor._colorize[3] = 1.5; } switchD_00438fa0_caseD_27: local_70 = (Entity *)g_vectorZero.x; local_7c = g_vectorZero.y; if (dropRng->_subtype == 0x15b) { vecResult = Vector::Normalized(&velocity,&local_b8); scratchVec.y = cos(1.5707964); fVar8 = sin(1.5707964); local_70 = (Entity *)((vecResult->x * scratchVec.y - vecResult->y * fVar8) * 5.0); local_7c = (vecResult->y * scratchVec.y + vecResult->x * fVar8) * 5.0; uVar6 = Random(); scratchVec.x = (float)local_70 + (dropRng->_pos).x; scratchVec.y = local_7c + (dropRng->_pos).y; shot = (Entity_Tear *) Game::Spawn(g_game,2,(uint)local_9c,&scratchVec,&velocity,(Entity *)dropRng,0,uVar6); uVar6 = Random(); shot->_fallingSpeed = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.2 + (float)local_a8; shot->_fallingAccel = fallingAccel; (**(code **)(*(int *)shot + 0x40))(tearDamage * local_84); flags._l._4_4_ = uStack_94; flags._l._0_4_ = local_98; flags._h._0_4_ = uStack_90; flags._h._4_4_ = uStack_8c; Entity_Tear::SetTearFlags(shot,flags); Entity_Tear::SetScale(shot,tearScale); Entity::SetParent((Entity *)shot,(Entity *)dropRng); (**(code **)(*(int *)shot + 0x3c))(&tearColor,0xffffffff,0xff,0,1); uVar6 = Random(); local_70 = (Entity *)-(float)local_70; local_7c = -local_7c; shot->_tearIdx = uVar6 & 1; bVar3 = Entity_Player::HasTrinket(dropRng->_player,0x7f,0); if (bVar3 != 0) { TryFireTear(dropRng,shot); } } uVar6 = Random(); scratchVec.x = (float)local_70 + (dropRng->_pos).x; scratchVec.y = local_7c + (dropRng->_pos).y; shot = (Entity_Tear *) Game::Spawn(g_game,2,(uint)local_9c,&scratchVec,&velocity,(Entity *)dropRng,0,uVar6); uVar6 = Random(); shot->_fallingSpeed = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.2 + (float)local_a8; shot->_fallingAccel = fallingAccel; (**(code **)(*(int *)shot + 0x40))(tearDamage * local_84); flags_00._l._4_4_ = uStack_94; flags_00._l._0_4_ = local_98; flags_00._h._0_4_ = uStack_90; flags_00._h._4_4_ = uStack_8c; Entity_Tear::SetTearFlags(shot,flags_00); Entity_Tear::SetScale(shot,tearScale); Entity::SetParent((Entity *)shot,(Entity *)dropRng); (**(code **)(*(int *)shot + 0x3c))(&tearColor,0xffffffff,0xff,0,1); uVar6 = Random(); shot->_tearIdx = uVar6 & 1; bVar3 = Entity_Player::HasTrinket(dropRng->_player,0x7f,0); if (bVar3 != 0) { TryFireTear(dropRng,shot); } return shot; } //@@ 0043a5e0 Entity_Familiar::wisp_take_damage /* DB: Entity_Familiar::TakeDamage for variants 0xce/0xed (WISP 206, ITEM_WISP 237): GetLastSpawner, AddFear, AddErasedEnemy/ShouldEraseEnemy, RemoveWithPoof, HasInvincibility */ undefined4 __thiscall Entity_Familiar::wisp_take_damage(Entity_Familiar *this,float *param_2,uint *param_3,int *param_4) { byte bVar1; char cVar2; EntityPtr fearTarget; uint uVar3; uint uVar4; Entity_Effect *spawnedEffect; EntityRef *pEVar5; int unusedArg; bool bVar6; Entity_Familiar *local_3c; EntityPtr local_38; EntityRef selfRef; Manager *manager; EntityPtr *parentSlot; void *room; int sourceType; int wispItem; local_3c = this; bVar1 = Entity_Player::HasInvincibility(this->_player,0,(EntityRef *)0x0); if (bVar1 != 0) { return 0; } sourceType = *param_4; if (((sourceType == 1) || (sourceType == 3)) && ((*param_3 & 0x1000000) != 0)) { return 0; } if (this->_variant != 0xce) { return 1; } wispItem = this->_subtype; if (wispItem < 0xa1) { if (wispItem == 0xa0) { if (0x3dd < sourceType - 10U) { return 1; } uVar4 = Random(); spawnedEffect = (Entity_Effect *) Game::SpawnEx(g_game,1000,0x13,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4,0); local_38 = (EntityPtr)this->_player; parentSlot = &spawnedEffect->_parent; local_3c = (Entity_Familiar *)spawnedEffect; if (spawnedEffect->_parent != (EntityPtr)0x0) { local_3c = (Entity_Familiar *)parentSlot; std::multiset::erase(&local_3c); } *parentSlot = local_38; if (local_38 != (EntityPtr)0x0) { std::multiset::insert(parentSlot); } (**(code **)(*(int *)spawnedEffect + 0x40))(0x41400000); local_3c = (Entity_Familiar *)((uint)g_vectorOne.x ^ 0x80000000); local_38 = (EntityPtr)-g_vectorOne.y; Entity::SetSize((Entity *)spawnedEffect,80.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); spawnedEffect->_subtype = 1; return 1; } switch(wispItem) { case 0x28: if ((*param_3 & 4) != 0) { return 0; } if (((Entity *)param_4[9] != (Entity *)0x0) && (bVar1 = Entity::IsEnemy((Entity *)param_4[9]), bVar1 != 0)) { *param_2 = *param_2 * 3.0; } break; case 0x3a: if (sourceType < 10) { return 0; } bVar6 = sourceType == 1000; goto LAB_0043a7f7; case 0x5d: if (((this->_target == (EntityPtr)0x0) && ((sourceType < 10 || (sourceType == 1000)))) && ((Entity *)param_4[9] != (Entity *)0x0)) { fearTarget = (EntityPtr)Entity::GetLastSpawner((Entity *)param_4[9]); bVar1 = Entity::IsVulnerableEnemy((Entity *)fearTarget,(Entity *)0x0); if (bVar1 != 0) { selfRef._type = this->_type; selfRef._spawnerType = this->_spawnerType; selfRef._position.x = (this->_pos).x; selfRef._position.y = (this->_pos).y; selfRef._spawnerVariant = this->_spawnerVariant; selfRef._variant = this->_variant; selfRef._velocity.x = (this->_velocity).x; selfRef._velocity.y = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } local_3c = (Entity_Familiar *)(*(uint *)((int)&this->_flags + 4) & 0x400000); if (local_3c == (Entity_Familiar *)0x0) { uVar3 = 0; } else { uVar3 = 4; } selfRef._flags = uVar3 | uVar4 | (uint)((this->_flags & 0x100) != 0); selfRef._entity = this; Entity::AddFear((Entity *)fearTarget,&selfRef,2,0); bVar1 = Entity::HasEntityFlags((Entity *)fearTarget,0x800); if (bVar1 != 0) { if (this->_target != (EntityPtr)0x0) { local_3c = (Entity_Familiar *)&this->_target; std::multiset::erase(&local_3c); } this->_target = fearTarget; if (fearTarget != (EntityPtr)0x0) { std::multiset::insert(&this->_target); } this->_counter = 0x96; return 1; } } } break; case 0x7f: goto switchD_0043a658_caseD_7f; } } else { if (wispItem == 0x27e) { if ((Entity *)param_4[9] == (Entity *)0x0) { return 0; } bVar1 = Entity::IsVulnerableEnemy((Entity *)param_4[9],(Entity *)0x0); if (bVar1 == 0) { return 0; } cVar2 = (**(code **)(*(int *)param_4[9] + 0x4c))(); if ((cVar2 != '\0') && (*(float *)(param_4[9] + 0x14) < *(float *)(param_4[9] + 0x380))) { return 0; } bVar6 = false; Game::AddErasedEnemy(param_4[9]); uVar4 = 0; room = g_game->_room; if (*(int *)((int)room + 0x1264) != 0) { do { local_38 = *(EntityPtr *)(*(int *)((int)room + 0x125c) + uVar4 * 4); bVar1 = Game::ShouldEraseEnemy((Entity *)local_38); if (bVar1 != 0) { Entity::RemoveWithPoof((Entity *)local_38,unusedArg); bVar6 = true; } this = local_3c; manager = g_manager; uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)room + 0x1264)); if (bVar6) { local_3c = (Entity_Familiar *)0xed; seed_fart_sound_override((int *)&local_3c); SoundEffects::Play(&manager->_sfxManager,(int)local_3c,1.0,2,0,1.0,0.0); } } pEVar5 = EntityRef::EntityRef(&selfRef); (**(code **)(*(int *)this + 0x24))(pEVar5); return 0; } if (wispItem != 0x28a) { if (wispItem == 0x2be) { return 0; } return 1; } bVar6 = this->_state == 1; LAB_0043a7f7: if (bVar6) { switchD_0043a658_caseD_7f: return 0; } } return 1; } //@@ 0043aa90 Entity_Familiar::ai_wisp /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update callee; variant 0xce (WISP), ItemConfig::get_wisp_config, subtypes 0x28a/0x2c5/0x25c items, SpecialDown/SpecialUp anims prototype: db/protos.zhl */ void __thiscall Entity_Familiar::ai_wisp(Entity_Familiar *this) { EntityPtr *pEVar1; void *pvVar2; Entity_Player *player; code *pcVar3; ANM2 *pAVar4; char cVar5; byte bVar6; uint uVar7; int *piVar8; Entity *pEVar9; LayerState *layer; Entity_Laser *laser; ColorMod *Color; undefined4 extraout_EAX; ColorMod *extraout_EAX_00; ColorMod *extraout_EAX_01; int cooldown; float *extraout_EAX_02; float *extraout_EAX_03; float *orbitDistance; Entity_Effect *splat; EntityRef *pEVar10; Vector *tmpVec; Entity_Tear *tear; char *anim; byte *anim_00; Vector *vec; ColorMod *color; code *extraout_EDX; code *extraout_EDX_00; code *extraout_EDX_01; uint pickupIndex; EntityPtr EVar11; int iVar12; bool bVar13; float fVar14; float fVar15; Room *pRVar16; Entity *pEVar17; float fVar18; Entity_Familiar *source; ColorMod *pCVar19; EntityRef EStack_554; EntityRef EStack_52c; EntityRef EStack_504; EntityRef EStack_4dc; EntityRef EStack_4b4; EntityRef EStack_48c; EntityRef local_464; EntityRef EStack_43c; EntityRef gridDamageSource; KColor secondaryHueColor; EntityRef EStack_3d8; EntityRef EStack_3b0; Color fadeColor; Vector toEnemyDir; undefined1 auStack_354 [8]; Vector cardinalVelocity; Vector toParentDir; Vector lemonadeSplatOffset; Vector spawnOrbitPos; Vector lemonSplatOffset; Vector leadTargetDir; Vector ponyOrbitPos; Vector chaseVelocity; Vector returnVelocity; RNG rng; undefined8 uStack_2f0; Vector whitePonyFireDirection; KColor primaryHueColor; EntityList_EL nearbyPickups; EntityList_EL nuggetTargets [2]; Vector spawnParentPos; Vector toParent; Vector rotatedVelocity; Vector tearVelocity; Vector tearPos; EntityList_EL nearbyEnemies; Vector leadTargetDelta; Vector toTarget; Vector toPlayer; Vector toEnemy; Vector enemyPos; Vector ponyFireDirection; Vector explosionPos; Vector laserOffset; Vector clampedOrbitPos; undefined1 texture [4]; int *local_210; Vector orbitPos; Vector parentPos; Vector aimDirection; int updateSteps; Vector laserDirection; Vector shotDirection; Entity *local_1e0; EntityPtr *local_1dc; float local_1d8; Entity *local_1d4; float local_1d0; float local_1cc; EntityPtr local_1c8; float local_1c4; Entity *local_1c0; Entity *local_1bc; char isFiring; Room *local_1b4; Color CStack_1b0; Color CStack_184; Color CStack_158; Color local_12c; Color CStack_100; Color local_d4; ColorMod splatColor; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; RNG seedRng; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; Entity_Pickup *pickup; undefined4 swapValue; local_8 = 0xffffffff; puStack_c = &LAB_00af2261; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (this->_variant == 0xed) { iVar12 = this->_wispCollectibleType; } else if (this->_variant == 0xce) { iVar12 = this->_subtype; } else { iVar12 = 0x248; } local_1b4 = (Room *)this; local_14 = uVar7; local_1c8 = (EntityPtr)ItemConfig::get_wisp_config(iVar12); isFiring = *(char *)&((Vector *)((int)local_1c8 + 0x10))->y; updateSteps = (int)this->_updateTime - (int)this->_prevUpdateTime; if ((this->_variant == 0xce) && (this->_subtype == 0x28a)) { EVar11 = this->_target; if ((EVar11 == (EntityPtr)0x0) || (((*(int *)((int)EVar11 + 0x28) != 3 || (*(int *)((int)EVar11 + 0xd88) != 6)) || (*(int *)((int)EVar11 + 0xd4c) < 1)))) { if (this->_state == 1) { this->_state = 0; this->_fireCooldown = 0; this->_entityGridCollisionClass = 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); piVar8 = LayerState::GetTexture(layer,texture); local_8 = 0; anim_00 = s_Idle2; if (*(uint *)(*piVar8 + 0x10) < 0x81) { anim_00 = s_Idle; } ANM2::SetAnimation(&this->_sprite,anim_00,0); local_8 = 1; if (((local_210 != (int *)0x0) && (cVar5 = (**(code **)(*local_210 + 0xc))(uVar7), cVar5 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(texture); } local_8 = 0xffffffff; } goto LAB_0043ac23; } bVar13 = false; if (this->_state == 0) { this->_state = 1; this->_fireCooldown = 0; this->_entityGridCollisionClass = 3; goto LAB_0043ac23; } } else { LAB_0043ac23: bVar13 = this->_state == 0; } local_1e0 = (Entity *)0x3f800000; if (bVar13) { if (this->_orbitLayer < 0) { fVar14 = (this->_formationOffset).x; if ((fVar14 != g_vectorZero.x) || ((this->_formationOffset).y != g_vectorZero.y)) { (this->_pos).x = fVar14; (this->_pos).y = (this->_formationOffset).y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; } } else { pEVar9 = get_orbit_parent(this); local_1bc = (Entity *)(pEVar9->_pos).x; local_1cc = (pEVar9->_velocity).y; local_1d0 = (pEVar9->_pos).y; local_1c4 = (pEVar9->_velocity).x; if (((this->_subtype == 0x2c5) || (this->_subtype == 0x25c)) && ((pEVar17 = (Entity *)(this->_targetPosition).x, (float)pEVar17 != g_vectorZero.x || ((this->_targetPosition).y != g_vectorZero.y)))) { local_1d0 = (this->_targetPosition).y; local_1c4 = g_vectorZero.x; local_1cc = g_vectorZero.y; local_1bc = pEVar17; } if ((pEVar9->_type == 3) && (pEVar9->_variant == 0xf0)) { local_1c4 = local_1c4 * 0.5; local_1cc = local_1cc * 0.5; } parentPos.x = (float)local_1bc; parentPos.y = local_1d0; GetOrbitPosition(this,&orbitPos,&parentPos); if (this->_subtype == 0x25c) { Room::GetClampedPositionImpl(g_game->_room,&clampedOrbitPos,&orbitPos,0.0,0.0,0.0,0.0); local_1d4 = (Entity *)clampedOrbitPos.x; local_1d8 = clampedOrbitPos.y; } else { local_1d8 = orbitPos.y; local_1d4 = (Entity *)orbitPos.x; } local_1d0 = local_1d0 - (this->_pos).y; local_1bc = (Entity *)((float)local_1bc - (this->_pos).x); local_1c0 = (Entity *)sqrtf(local_1d0 * local_1d0 + (float)local_1bc * (float)local_1bc); local_1d0 = local_1d0 * 0.01; local_1bc = (Entity *)((float)local_1bc * 0.01); fVar14 = sqrtf(local_1d0 * local_1d0 + (float)local_1bc * (float)local_1bc); if ((8.0 < fVar14) && (0.0 < fVar14)) { local_1bc = (Entity *)((float)local_1bc * (8.0 / fVar14)); local_1d0 = local_1d0 * (8.0 / fVar14); } fVar14 = (this->_orbitDistance).y; tmpVec = &this->_orbitDistance; if ((this->_orbitDistance).x <= fVar14 && fVar14 != (this->_orbitDistance).x) { tmpVec = (Vector *)&(this->_orbitDistance).y; } pEVar17 = (Entity *)((((float)local_1c0 - (tmpVec->x + 10.0)) - 0.0) / 160.0); if ((float)pEVar17 <= 0.0) { pEVar17 = (Entity *)0x0; } if ((float)local_1e0 <= (float)pEVar17) { pEVar17 = local_1e0; } fVar14 = (float)local_1e0 - ((float)pEVar17 + 0.0); local_1c0 = (Entity *)((float)local_1e0 - fVar14 * fVar14); fVar14 = ((float)local_1e0 - (float)local_1c0) + ((float)local_1e0 - (float)local_1c0); local_1c4 = (local_1c4 * fVar14) / pEVar9->_friction; local_1cc = (local_1cc * fVar14) / pEVar9->_friction; local_1d4 = (Entity *)(((float)local_1d4 - ((this->_pos).x + local_1c4)) * 0.5); local_1d8 = (local_1d8 - ((this->_pos).y + local_1cc)) * 0.5; fVar14 = sqrtf((float)local_1d4 * (float)local_1d4 + local_1d8 * local_1d8); if ((fVar14 <= 5.0) || ((this->_flags & 0x20000000000) != 0)) { pEVar9 = local_1d4; fVar14 = local_1d8; } else { pEVar9 = local_1d4; fVar18 = local_1d8; if (0.0 < fVar14) { fVar18 = local_1d8 * ((float)local_1e0 / fVar14); pEVar9 = (Entity *)((float)local_1d4 * ((float)local_1e0 / fVar14)); } pEVar9 = (Entity *)((float)pEVar9 * 4.0); fVar14 = fVar18 * 4.0; } fVar18 = (fVar14 + local_1cc) / this->_friction; fVar14 = ((float)pEVar9 + local_1c4) / this->_friction; (this->_velocity).y = ((local_1d0 + (this->_velocity).y) - fVar18) * (float)local_1c0 + fVar18 ; (this->_velocity).x = (((float)local_1bc + (this->_velocity).x) - fVar14) * (float)local_1c0 + fVar14; } } local_1c4 = (this->_health / this->_maxHitPoints) * 0.4 + 0.6; if (this->_variant == 0xce) { if (this->_subtype == 0x242) { local_1c4 = local_1c4 * 1.5; } else if (this->_subtype == 0x263) { local_1c4 = ((float)this->_keys * 0.05 + (float)local_1e0) * local_1c4; } } local_1cc = sqrtf(local_1c4); local_1c0 = (Entity *)(local_1cc * g_vectorOne.x); local_1cc = local_1cc * g_vectorOne.y; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); (layer->_size).x = (float)local_1c0; (layer->_size).y = local_1cc; local_1c0 = (Entity *)(local_1c4 * g_vectorOne.x); local_1c4 = local_1c4 * g_vectorOne.y; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); (layer->_size).x = (float)local_1c0; (layer->_size).y = local_1c4; player = this->_player; local_1d8 = g_vectorZero.x; local_1bc = (Entity *)(player->_meleeDamage + player->_meleeDamage); local_1d4 = (Entity *)g_vectorZero.y; local_1cc = 0.0; local_1c4 = 0.0; this->_collisionDamage = (float)local_1bc; local_1d0 = (float)(int)((Vector *)((int)local_1c8 + 0x10))->x; if (this->_variant != 0xce) goto LAB_0043cdfe; uVar7 = this->_subtype; if (uVar7 < 299) { if (uVar7 == 0x12a) { bVar6 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x12a); if ((bVar6 != 0) || (bVar6 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x4d), bVar6 != 0)) { fVar14 = -5.0; goto code_r0x0043bfeb; } fVar14 = 0.0; LAB_0043bfef: this->_collisionDamage = fVar14; bVar6 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x4d); if ((bVar6 == 0) && (bVar6 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x12a), bVar6 == 0)) { local_1c0 = (Entity *)0x3e99999a; local_1bc = (Entity *)0x3f333333; local_1b4 = (Room *)(((float)((uint)((g_game->_frameCount - this->_spawnFrame) + this->_initSeed) % 0x3c) + 0.0) / 60.0); } else { local_1c0 = local_1e0; local_1bc = local_1e0; local_1b4 = (Room *)(((float)((uint)((g_game->_frameCount - this->_spawnFrame) + this->_initSeed) % 0x1e) + 0.0) / 30.0); } hsv_to_rgb(&primaryHueColor,(float)local_1b4 * 360.0,(float)local_1c0,(float)local_1bc,1.0); ::Color::Color(&local_12c); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)extraout_EAX_02) { fVar14 = extraout_EAX_02[1]; fVar18 = extraout_EAX_02[2]; fVar15 = extraout_EAX_02[3]; (layer->_color)._tint[0] = *extraout_EAX_02; (layer->_color)._tint[1] = fVar14; (layer->_color)._tint[2] = fVar18; (layer->_color)._tint[3] = fVar15; fVar14 = extraout_EAX_02[5]; fVar18 = extraout_EAX_02[6]; fVar15 = extraout_EAX_02[7]; (layer->_color)._colorize[0] = extraout_EAX_02[4]; (layer->_color)._colorize[1] = fVar14; (layer->_color)._colorize[2] = fVar18; (layer->_color)._colorize[3] = fVar15; *(undefined8 *)(layer->_color)._offset = *(undefined8 *)(extraout_EAX_02 + 8); (layer->_color)._offset[2] = extraout_EAX_02[10]; } fVar14 = (float)local_1b4 + 0.2; if ((float)local_1e0 < fVar14) { fVar14 = fVar14 - (float)local_1e0; } hsv_to_rgb(&secondaryHueColor,fVar14 * 360.0,(float)local_1c0,(float)local_1bc,1.0); ::Color::Color(&local_d4); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); if (&layer->_color != (ColorMod *)extraout_EAX_03) { fVar14 = extraout_EAX_03[1]; fVar18 = extraout_EAX_03[2]; fVar15 = extraout_EAX_03[3]; (layer->_color)._tint[0] = *extraout_EAX_03; (layer->_color)._tint[1] = fVar14; (layer->_color)._tint[2] = fVar18; (layer->_color)._tint[3] = fVar15; fVar14 = extraout_EAX_03[5]; fVar18 = extraout_EAX_03[6]; fVar15 = extraout_EAX_03[7]; (layer->_color)._colorize[0] = extraout_EAX_03[4]; (layer->_color)._colorize[1] = fVar14; (layer->_color)._colorize[2] = fVar18; (layer->_color)._colorize[3] = fVar15; *(undefined8 *)(layer->_color)._offset = *(undefined8 *)(extraout_EAX_03 + 8); (layer->_color)._offset[2] = extraout_EAX_03[10]; } } else { switch(uVar7) { case 0x28: local_1c8 = (EntityPtr) TemporaryEffects::GetCollectibleEffect(&player->_temporaryeffects,0x28); if ((player->_dead == 0) && (local_1c8 != (EntityPtr)0x0)) { pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 < 0x29) { iVar12 = 0; } else { iVar12 = *(int *)((int)pvVar2 + 0xa0); } if (((std_multiset *)((int)local_1c8 + 8))->_head == (void *)(*(int *)(iVar12 + 0x78) + -1)) { local_1b4 = (Room *)((this->_pos).x - (player->_pos).x); local_1bc = (Entity *)((this->_pos).y - (player->_pos).y); fVar14 = sqrtf((float)local_1b4 * (float)local_1b4 + (float)local_1bc * (float)local_1bc ); if (70.0 <= fVar14) { pRVar16 = local_1b4; pEVar9 = local_1bc; } else { pRVar16 = (Room *)((float)local_1b4 * (70.0 / fVar14)); pEVar9 = (Entity *)((float)local_1bc * (70.0 / fVar14)); } ::Color::Color(&CStack_100); explosionPos.x = (float)pRVar16 + (player->_pos).x; explosionPos.y = (float)pEVar9 + (player->_pos).y; Game::BombExplosionEffects (g_game,&explosionPos,30.0,(BitSet128)ZEXT816(0),Color,(Entity *)this,0.75,1,4 ,0); } } break; case 0x2c: LAB_0043c942: switch(*(undefined4 *)(this + 1)) { case 0: iVar12 = *(int *)&this[1].field_0x4; *(int *)&this[1].field_0x4 = iVar12 + -1; if (iVar12 < 0) { *(undefined4 *)(this + 1) = 1; } break; case 1: pvVar2 = this[1]._damageEvents._begin; isFiring = '\0'; this->_collisionDamage = 0.0; if ((float)pvVar2 <= 0.0) { *(undefined4 *)(this + 1) = 3; uVar7 = Random(); *(uint *)&this[1].field_0x4 = uVar7 % 0x1e + 0x1e; } else { this[1]._damageEvents._begin = (void *)((float)pvVar2 - 0.1); } break; case 2: pvVar2 = this[1]._damageEvents._begin; if ((float)local_1e0 <= (float)pvVar2) { *(undefined4 *)(this + 1) = 0; uVar7 = Random(); *(uint *)&this[1].field_0x4 = uVar7 % 0x1e + 0x3c; } else { this[1]._damageEvents._begin = (void *)((float)pvVar2 + 0.1); } break; case 3: iVar12 = *(int *)&this[1].field_0x4; isFiring = '\0'; this->_visible = 0; this->_collisionDamage = 0.0; *(int *)&this[1].field_0x4 = iVar12 + -1; if (iVar12 < 0) { this->_visible = 1; *(undefined4 *)(this + 1) = 2; } } ::Color::operator_assign(&fadeColor,&(this->_sprite)._color); fadeColor._tint[3] = (float)this[1]._damageEvents._begin; Sprite::SetColor((Sprite *)&this->_sprite,color); break; case 0x2f: if (((player->_itemState == 0x2f) && (pvVar2 = player->_weapons[0], pvVar2 != (void *)0x0)) && ((*(int *)((int)pvVar2 + 0x30) == 6 && ((*(int *)((int)pvVar2 + 0x44) != 0 && (0xf < g_game->_frameCount - *(int *)(*(int *)((int)pvVar2 + 0x44) + 0x328))))))) { if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } local_1d8 = 0.0; local_1d4 = local_1e0; } break; case 0x31: if (((player->_itemState == 0x31) && (player->_itemStateCooldown == 0x1e)) && (this->_counter < 1)) { laserDirection.x = (player->_aimDirection).x; laserDirection.y = (player->_aimDirection).y; if ((laserDirection.x == g_vectorZero.x) && (laserDirection.y == g_vectorZero.y)) { laserDirection.x = (this->_targetPosition).x; laserDirection.y = (this->_targetPosition).y; } Vector::Normalize(&laserDirection); bVar6 = Entity_Player::HasCollectible(player,0xf7,0); if (bVar6 == 0) { local_1e0 = (Entity *)0x40000000; } tmpVec = &laserOffset; bVar6 = 0; iVar12 = 0xf; laserOffset.x = 0.0; laserOffset.y = -18.0; source = this; fVar14 = atan2f(laserDirection.y,laserDirection.x); laser = Entity_Laser::ShootAngle (3,&this->_pos,fVar14 * 57.295776,iVar12,tmpVec,(Entity *)source,bVar6); (**(code **)(*(int *)laser + 0x40))((float)local_1e0 * 3.5); laser->_scale = (float)local_1e0 * 0.15 + 0.35; Entity_Laser::ResetSpriteScale(laser); if (laserDirection.y <= -0.5) { fVar14 = -50.0; } else { fVar14 = 3000.0; } laser->_renderDepthOffset = fVar14; (**(code **)(*(int *)laser + 0xc))(); this->_counter = 8; } break; case 0x38: bVar6 = Entity::IsFrame((Entity *)this,4,0); if (bVar6 != 0) { uVar7 = Random(); if (uVar7 % 6 == 0) { uVar7 = Random(); pEVar9 = Game::Spawn(g_game,1000,0x2e,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar7); fVar18 = g_vectorOne.x * 0.65; fVar14 = g_vectorOne.y * 0.65; pAVar4 = &pEVar9[1]._sprite; (pAVar4->_filename)._buf[8] = 'Z'; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; (pEVar9->_sprite)._scale.x = fVar18; pAVar4 = &pEVar9[1]._sprite; (pAVar4->_filename)._buf[0xc] = 'Z'; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (pEVar9->_sprite)._scale.y = fVar14; (**(code **)(*(int *)pEVar9 + 0x40))(0x40e00000); (**(code **)(*(int *)pEVar9 + 0xc))(); splatColor._tint[0] = 1.0; splatColor._tint[1] = 1.0; splatColor._tint[2] = 1.0; splatColor._tint[3] = 1.0; splatColor._offset[0] = 0.0; splatColor._colorize[0] = 6.0714; splatColor._colorize[1] = 5.7857; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 1.0; splatColor._offset[1] = 0.0; splatColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)&pEVar9->_sprite,&splatColor); } uVar7 = Random(); if (uVar7 % 6 == 0) { uVar7 = Random(); splat = Entity_NPC::MakeSplat ((Entity_NPC *)this, (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); tmpVec = MusicManager::RandomVector(&lemonSplatOffset); uStack_5c = 0x3f48c8ca; uStack_58 = 0x3f48c8ca; uStack_54 = 0; fVar14 = tmpVec->y; iVar12 = *(int *)splat; fVar18 = (this->_pos).y; (splat->_pos).x = tmpVec->x + tmpVec->x + (this->_pos).x + 0.0; uStack_6c = 0; uStack_68 = 0; uStack_64 = 0; uStack_60 = 0; (splat->_pos).y = fVar14 + fVar14 + fVar18 + 8.0; uStack_7c = 0; uStack_78 = 0; uStack_74 = 0; uStack_70 = 0x3f333333; (**(code **)(iVar12 + 0x3c))(&uStack_7c,0xffffffff,0xff,0,1); } } break; case 0x4d: fVar14 = 8.0; code_r0x0043bfeb: fVar14 = (float)local_1bc + fVar14; goto LAB_0043bfef; case 0x5d: pEVar1 = &this->_target; local_1c8 = (EntityPtr)pEVar1; if (this->_target != (EntityPtr)0x0) { if ((this->_counter < 1) || (*(char *)((int)this->_target + 0x173) != '\0')) { std::multiset::erase(&local_1c8); *(undefined4 *)&pEVar1->field_0x0 = 0; } else { ::Color::Color(&CStack_1b0); (*extraout_EDX)(extraout_EAX,2,0,0,1); pEVar9 = *(Entity **)&pEVar1->field_0x0; EntityRef::constructor(&EStack_3b0,(Entity *)this); Entity::AddFear(pEVar9,&EStack_3b0,-2,0); uVar7 = Random(); if ((uVar7 & 3) == 0) { pcVar3 = *(code **)(*(int *)*(EntityPtr *)local_1c8 + 0x20); EntityRef::constructor(&EStack_3d8,(Entity *)local_1b4); (*pcVar3)(0,0x4000000,0,&EStack_3d8,0x1e); this = (Entity_Familiar *)local_1b4; } } } break; case 0x66: if (g_game->_frameCount == this->_spawnFrame) { if ((0 < this->_coins) && ((uint)this->_coins < 7)) { local_1c0 = (Entity *)Seeds::GetStartSeed(); if (local_1c0 != pERam00c7e838) { uRam00c7e820 = 0; uRam00c7e824 = 1; uRam00c7e828 = 2; uRam00c7e82c = 3; local_1c8 = (EntityPtr)&DAT_0000000f; uRam00c7e830 = 4; uRam00c7e834 = 5; uStack_2f0 = 0x900000002; local_1bc = (Entity *)0x0; pEVar9 = local_1c0; do { if (pEVar9 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = (uint)pEVar9 >> 2 ^ (uint)pEVar9; uVar7 = uVar7 << 9 ^ uVar7; pEVar9 = (Entity *)(uVar7 >> 0xf ^ uVar7); if (6U - (int)local_1bc == 0) { uVar7 = 0; } else { uVar7 = (uint)pEVar9 % (6U - (int)local_1bc); } swapValue = *(undefined4 *)((int)local_1bc * 4 + 0xc7e820); iVar12 = (int)(&(local_1bc->_sprite)._filename + -3) + uVar7; *(undefined4 *)((int)local_1bc * 4 + 0xc7e820) = *(undefined4 *)(iVar12 * 4 + 0xc7e820); local_1bc = (Entity *)&local_1bc->field_0x1; *(undefined4 *)(iVar12 * 4 + 0xc7e820) = swapValue; } while (local_1bc < &DAT_00000005); this = (Entity_Familiar *)local_1b4; pERam00c7e838 = local_1c0; } FUN_00a0f720(*(int *)(((Room *)this)->_gridPaths[0x184] * 4 + 0xc7e81c) * 0x14 + 0xc33a98); ::Color::Color(&CStack_184); pCVar19 = extraout_EAX_00; layer = ANM2::GetLayer((ANM2 *)(((Room *)this)->_gridEntities + 9),(byte *)0x0); ::Color::operator_assign((Color *)&layer->_color,pCVar19); ::Color::Color(&CStack_158); pCVar19 = extraout_EAX_01; layer = ANM2::GetLayer((ANM2 *)(((Room *)this)->_gridEntities + 9),(byte *)0x1); ::Color::operator_assign((Color *)&layer->_color,pCVar19); } } break; case 0x7b: seedRng._seed = this->_initSeed; seedRng._shift1 = 1; seedRng._shift2 = 0xb; seedRng._shift3 = 0x10; uVar7 = RNG::RandomInt(&seedRng,0xe); local_1d0 = (float)(uVar7 + 0x10); break; case 0x82: iVar12 = player->_fireDirection; Isaac::GetAxisAlignedUnitVectorFromDir(&ponyFireDirection,iVar12); cooldown = this->_fireCooldown; if (0 < cooldown) { cooldown = cooldown + -1; this->_fireCooldown = cooldown; } if (((-1 < cooldown) && (this->_isInvicible != 0)) && (tmpVec = GetOrbitPosition(this,&ponyOrbitPos,(Vector *)((int)this->_player + 0x33c)), fVar14 = (this->_pos).x - tmpVec->x, fVar18 = (this->_pos).y - tmpVec->y, fVar18 * fVar18 + fVar14 * fVar14 < 50.0)) { this->_isInvicible = 0; PlayFloatAnim(this,-1); } game = g_game; cooldown = this->_fireCooldown; if (cooldown < 0) { if (((this->_collidesWithGrid != 0) || (cooldown < -1)) || (bVar6 = Room::IsPositionInRoom(g_game->_room,&this->_pos,-100.0), bVar6 == 0)) { this->_entityGridCollisionClass = 0; pRVar16 = game->_room; iVar12 = Room::GetGridIndex(pRVar16,(Vector *)(local_1b4->_gridEntities + 0xc6)); EntityRef::constructor(&gridDamageSource,local_1b4->_gridEntities[0xfb]); Room::DamageGridWithSource(pRVar16,iVar12,1,&gridDamageSource); ((Vector *)(local_1b4->_gridEntities + 0xcf))->x = ((Vector *)(local_1b4->_gridEntities + 0xcf))->x * 0.5; local_1b4->_gridEntities[0xd0] = (void *)((float)local_1b4->_gridEntities[0xd0] * 0.5); local_1b4->_gridPaths[0x178] = local_1b4->_gridPaths[0x178] + -1; this = (Entity_Familiar *)local_1b4; if (local_1b4->_gridPaths[0x178] < -10) { local_1b4->_gridPaths[0x178] = 0x3c; local_1b4->_gridPaths[0x187] = 0; } } } else { (this->_sprite)._flipX = ponyFireDirection.x < 0.0; if ((iVar12 != -1) && (cooldown < 1)) { this->_state = 1; this->_isInvicible = 1; this->_fireCooldown = -1; this->_entityGridCollisionClass = 4; (this->_velocity).x = ponyFireDirection.x * 10.0; (this->_velocity).y = ponyFireDirection.y * 10.0; PlayShootAnim(this,-1); } } iVar12 = 1; if (*(byte *)(((Room *)this)->_gridEntities + 0xe3) != 0) { ((Room *)this)->_gridEntities[0xd9] = (void *)((float)((Room *)this)->_gridEntities[0xd9] * 0.2); } goto LAB_0043ce03; case 0xaf: local_1b4 = g_game->_room; local_1bc = (Entity *)Room::GetGridIndex(local_1b4,&this->_pos); if ((-1 < (int)local_1bc) && ((int)local_1bc < 0x1c0)) { local_1c8 = (EntityPtr)Room::GetGridCollision(local_1b4,(int)local_1bc); pvVar2 = local_1b4->_gridEntities[(int)local_1bc]; if (pvVar2 != (void *)0x0) { if (*(int *)((int)pvVar2 + 4) == 0x10) { if ((((local_1c8 == (EntityPtr)&DAT_00000004) && (cVar5 = GridEntity_Door::IsLocked(), cVar5 != '\0')) && ((local_1b4->_gridEntities[(int)local_1bc]->_doorFlags & 1) == 0)) && (bVar6 = GridEntity_Door::TryUnlock (local_1b4->_gridEntities[(int)local_1bc],player,1), bVar6 != 0) ) { pEVar10 = &EStack_48c; goto LAB_0043bc25; } } else if ((*(int *)((int)pvVar2 + 4) == 0xb) && (*(int *)((int)pvVar2 + 0xc) == 0)) { GridEntity_Lock::try_unlock(player,1); pEVar10 = &EStack_4b4; LAB_0043bc25: pEVar10 = EntityRef::EntityRef(pEVar10); (*extraout_EDX_00)(pEVar10); } } } if (this->_dead == 0) { bVar6 = Entity::IsFrame((Entity *)this,2,0); if (bVar6 != 0) { EntityList::QueryRadius(&local_1b4->_entityList,&nearbyPickups,&this->_pos,24.0,0x10); local_8 = 2; pickupIndex = 0; uVar7 = nearbyPickups._size; if (nearbyPickups._size == 0) { LAB_0043bd3e: local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&nearbyPickups); } else { do { pickup = *(Entity_Pickup **)((int)nearbyPickups._data + pickupIndex * 4); if (pickup != (Entity_Pickup *)0x0) { if (pickup->_type == 5) { iVar12 = pickup->_variant; if (((iVar12 == 0x3c) || (iVar12 == 0x35)) || (iVar12 == 0x37)) { bVar6 = Entity_Pickup::TryOpenChest(pickup,this->_player); if (bVar6 != 0) { pEVar10 = &EStack_4dc; goto LAB_0043bd2f; } uVar7 = nearbyPickups._size; } } else if (((pickup->_type == 6) && (pickup->_variant == 7)) && ((pvVar2 = (pickup->_sprite)._animState._animData, pvVar2 == (void *)0x0 || ((*(char *)((int)pvVar2 + 0x34) != '\0' || ((pickup->_sprite)._animState._isPlaying == 0)))))) { Entity::ForceCollide(this->_player,(Entity *)pickup,1); pEVar10 = &EStack_504; LAB_0043bd2f: pEVar10 = EntityRef::EntityRef(pEVar10); (*extraout_EDX_01)(pEVar10); goto LAB_0043bd3e; } } pickupIndex = pickupIndex + 1; } while (pickupIndex < uVar7); local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&nearbyPickups); } } } break; case 0xb5: Isaac::GetAxisAlignedUnitVectorFromDir(&whitePonyFireDirection,player->_fireDirection); (this->_sprite)._flipX = whitePonyFireDirection.x < 0.0; break; case 0x11a: LAB_0043cc72: this->_collisionDamage = (float)local_1bc * 0.5; } } goto LAB_0043cdfe; } if (0x242 < uVar7) { if (uVar7 < 0x2d3) { if (uVar7 == 0x2d2) { EVar11 = this->_parent; if (EVar11 == (EntityPtr)0x0) { pEVar10 = EntityRef::EntityRef(&local_464); (**(code **)(*(int *)this + 0x24))(pEVar10); } else { toParent.x = *(float *)((int)EVar11 + 0x33c) - (this->_pos).x; toParent.y = *(float *)((int)EVar11 + 0x340) - (this->_pos).y; tmpVec = Vector::Normalized(&toParent,&toParentDir); local_1d8 = tmpVec->x; local_1d4 = (Entity *)tmpVec->y; } } else { switch(uVar7) { case 0x263: this->_collisionDamage = (float)this->_keys * 0.15 * (float)local_1bc; break; case 0x27b: goto LAB_0043cc72; case 0x2be: this->_mass = 0.1; this->_collisionDamage = (float)local_1bc * 0.25; break; case 0x2bf: bVar6 = TemporaryEffects::HasNullEffect(&player->_temporaryeffects,100); if (((bVar6 != 0) && (this->_coins == 0)) || ((bVar6 = TemporaryEffects::HasNullEffect(&player->_temporaryeffects,100), bVar6 == 0 && (this->_coins == 1)))) { pEVar10 = EntityRef::EntityRef(&EStack_43c); (**(code **)(*(int *)this + 0x24))(pEVar10); } } } } else { if (uVar7 != 0x2d8) { if (uVar7 == 0x1000e) { uVar7 = Random(); iVar12 = (uVar7 & 3) + 5; } else { if (uVar7 != 0x10010) goto LAB_0043cdfe; iVar12 = 4; local_1cc = 90.0; if ((this->_coins & 1U) == 0) { local_1c4 = 45.0; } if ((float)this->_fireCooldown == local_1d0) { this->_coins = this->_coins + 1; } } goto LAB_0043ce03; } this->_isInvicible = g_game->_frameCount - this->_spawnFrame < 0x3c; } goto LAB_0043cdfe; } if (uVar7 == 0x242) { bVar6 = Entity::IsFrame((Entity *)this,4,0); if (bVar6 != 0) { uVar7 = Random(); if (uVar7 % 6 == 0) { uVar7 = Random(); splat = Entity_NPC::MakeSplat ((Entity_NPC *)this, (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); tmpVec = MusicManager::RandomVector(&lemonadeSplatOffset); local_30 = 0x3f48c8ca; local_2c = 0x3f48c8ca; local_28 = 0; fVar14 = tmpVec->y; iVar12 = *(int *)splat; fVar18 = (this->_pos).y; (splat->_pos).x = tmpVec->x + tmpVec->x + (this->_pos).x + 0.0; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; (splat->_pos).y = fVar14 + fVar14 + fVar18 + 8.0; local_50 = 0; uStack_4c = 0; uStack_48 = 0; uStack_44 = 0x3f333333; (**(code **)(iVar12 + 0x3c))(&local_50,0xffffffff,0xff,0,1); } } goto LAB_0043cdfe; } switch(uVar7) { case 0x143: if (0x5a < g_game->_frameCount - this->_spawnFrame) { pEVar10 = EntityRef::EntityRef(&EStack_52c); (**(code **)(*(int *)this + 0x24))(pEVar10); } break; case 0x145: uVar7 = Random(); iVar12 = (uVar7 & 1) + 2; goto LAB_0043ce03; case 0x18c: EVar11 = this->_parent; if (g_game->_frameCount == this->_spawnFrame) { if (EVar11 != (EntityPtr)0x0) { spawnParentPos.x = *(float *)((int)EVar11 + 0x33c); spawnParentPos.y = *(float *)((int)EVar11 + 0x340); tmpVec = GetOrbitPosition(this,&spawnOrbitPos,&spawnParentPos); (this->_pos).x = tmpVec->x; (this->_pos).y = tmpVec->y; } } else if (EVar11 == (EntityPtr)0x0) { (**(code **)(*(int *)this + 0x28))(); } else if (*(char *)((int)EVar11 + 0x173) != '\0') { pEVar10 = EntityRef::EntityRef(&EStack_554); (**(code **)(*(int *)this + 0x24))(pEVar10); } break; case 0x196: RNG::game_constructor(&rng,(this->_dropRNG)._seed,0xd); uVar7 = RNG::RandomInt(&rng,5); local_1d0 = (float)((int)local_1d0 + -2 + uVar7); break; case 0x1a3: goto LAB_0043c942; case 0x1ab: FamiliarHelper::wisp_mine_crafter_update(); break; case 0x1b9: ai_mega_blast_wisp(); break; case 0x1e7: EVar11 = this->_target; local_1c8 = (EntityPtr)(*(short *)((int)local_1c8 + 0x18c) + 7); isFiring = '\0'; if (EVar11 == (EntityPtr)0x0) { if (this->_orbitLayer < 0) { this->_friction = 0.9; orbitDistance = (float *)GetOrbitDistance(auStack_354,local_1c8); local_1b4 = (Room *)(this->_pos).x; local_1bc = (Entity *)(this->_pos).y; fVar14 = (float)local_1b4 - *(float *)((int)this->_player + 0x33c); fVar18 = (float)local_1bc - *(float *)((int)this->_player + 0x340); fVar14 = sqrtf(fVar14 * fVar14 + fVar18 * fVar18); if (*orbitDistance <= fVar14) { bVar6 = 0; toPlayer.x = *(float *)((int)this->_player + 0x33c) - (float)local_1b4; toPlayer.y = *(float *)((int)this->_player + 0x340) - (float)local_1bc; tmpVec = Vector::Resized(&toPlayer,&returnVelocity,0.5); Entity::AddVelocity_divided((Entity *)this,tmpVec,bVar6); } else { AddToOrbit(this,(int)local_1c8); } } else { this->_friction = 1.0; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEnemies,&this->_pos,100.0,8); uVar7 = 0; local_8 = 4; if (nearbyEnemies._size == 0) { LAB_0043c7c6: local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&nearbyEnemies); } else { do { bVar6 = Entity::IsVulnerableEnemy (*(Entity **)((int)nearbyEnemies._data + uVar7 * 4),(Entity *)0x0); if (bVar6 != 0) { local_1c8 = *(EntityPtr *)((int)nearbyEnemies._data + uVar7 * 4); pEVar1 = &this->_target; if (this->_target != (EntityPtr)0x0) { local_1bc = (Entity *)pEVar1; std::multiset::erase(&local_1bc); } *pEVar1 = local_1c8; if (local_1c8 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } RemoveFromOrbit(this); goto LAB_0043c7c6; } uVar7 = uVar7 + 1; } while (uVar7 < (uint)nearbyEnemies._size); local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&nearbyEnemies); } } else { this->_friction = 0.8; toTarget.y = *(float *)((int)EVar11 + 0x340) - (this->_pos).y; toTarget.x = *(float *)((int)EVar11 + 0x33c) - (this->_pos).x; local_1c8 = (EntityPtr)(toTarget.y * toTarget.y + toTarget.x * toTarget.x); if (10000.0 < (float)local_1c8) { bVar6 = 0; tmpVec = Vector::Resized(&toTarget,&chaseVelocity,1.0); Entity::AddVelocity_divided((Entity *)this,tmpVec,bVar6); EVar11 = this->_target; } fVar14 = sqrtf((float)local_1c8); leadTargetDelta.y = (fVar14 * 0.02 * *(float *)((int)EVar11 + 0x364) + *(float *)((int)EVar11 + 0x340)) - (this->_pos).y; leadTargetDelta.x = (fVar14 * 0.02 * *(float *)((int)EVar11 + 0x360) + *(float *)((int)EVar11 + 0x33c)) - (this->_pos).x; tmpVec = Vector::Normalized(&leadTargetDelta,&leadTargetDir); local_1d8 = tmpVec->x; local_1d4 = (Entity *)tmpVec->y; if (this->_fireCooldown < 1) { isFiring = '\x01'; } else { this->_fireCooldown = this->_fireCooldown + -1; } bVar6 = Entity::IsVulnerableEnemy((Entity *)EVar11,(Entity *)0x0); if (bVar6 == 0) { if (this->_target != (EntityPtr)0x0) { local_1dc = &this->_target; std::multiset::erase(&local_1dc); } this->_target = (EntityPtr)0x0; } } break; case 0x1f8: isFiring = '\0'; if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } local_1c8 = (EntityPtr)&this->_pos; aimDirection.x = g_vectorZero.x; aimDirection.y = g_vectorZero.y; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),nuggetTargets,(Vector *)local_1c8,150.0,8 ); local_8 = 3; local_1c0 = (Entity *)0x0; if ((undefined1 *)nuggetTargets[0]._size != (undefined1 *)0x0) { pEVar9 = (Entity *)0x0; do { pEVar17 = *(Entity **)((int)nuggetTargets[0]._data + (int)local_1c0 * 4); bVar6 = Entity::IsVulnerableEnemy(pEVar17,(Entity *)0x0); if ((bVar6 != 0) && ((pEVar17->_flags & 0x20000010) == 0)) { enemyPos.y = (pEVar17->_pos).y; enemyPos.x = (pEVar17->_pos).x; bVar6 = Room::CheckLine(g_game->_room,(Vector *)local_1c8,&enemyPos,3,900,0,0, (Vector *)0x0); if (bVar6 != 0) { pEVar9 = pEVar17; } } this = (Entity_Familiar *)local_1b4; local_1c0 = (Entity *)&local_1c0->field_0x1; } while (local_1c0 < (uint)nuggetTargets[0]._size); local_1c0 = pEVar9; if (pEVar9 != (Entity *)0x0) { toEnemy.x = (pEVar9->_pos).x - ((Vector *)(local_1b4->_gridEntities + 0xc6))->x; toEnemy.y = (pEVar9->_pos).y - (float)local_1b4->_gridEntities[199]; tmpVec = Vector::Normalized(&toEnemy,&toEnemyDir); aimDirection.x = tmpVec->x; aimDirection.y = tmpVec->y; } } bVar6 = Vector::operator_ne(&aimDirection,&g_vectorZero); if ((bVar6 == 0) || ((float)(int)local_1d0 <= 0.0)) { if ((-1 < ((Room *)this)->_gridPaths[0x179]) && (iVar12 = ((Room *)this)->_gridPaths[0x179] + -1, ((Room *)this)->_gridPaths[0x179] = iVar12, iVar12 < 0)) { PlayFloatAnim(this,3); } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(nuggetTargets); } else { iVar12 = vector_to_direction(vec); if (((Room *)this)->_gridPaths[0x178] < 1) { FireProjectile(this,&aimDirection,0); ((Room *)this)->_gridPaths[0x178] = (int)local_1d0; ((Room *)this)->_gridPaths[0x179] = 0xc; PlayShootAnim(this,iVar12); ((Room *)this)->_gridPaths[0x179] = ((Room *)this)->_gridPaths[0x179] + -1; local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(nuggetTargets); } else if (((Room *)this)->_gridPaths[0x179] < 9) { PlayFloatAnim(this,iVar12); ((Room *)this)->_gridPaths[0x179] = 8; local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(nuggetTargets); } else { PlayShootAnim(this,iVar12); ((Room *)this)->_gridPaths[0x179] = ((Room *)this)->_gridPaths[0x179] + -1; local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(nuggetTargets); } } break; case 0x204: local_1c4 = (float)this->_coins * 45.0 + 0.0; break; case 0x209: iVar12 = 3; local_1cc = 15.0; local_1c4 = -15.0; goto LAB_0043ce03; case 0x20f: ai_mr_me_wisp(this); } LAB_0043cdfe: iVar12 = 1; LAB_0043ce03: bVar6 = Entity_Player::HasCollectible(((Room *)this)->_gridEntities[0xfb],0xf7,0); if (bVar6 != 0) { ((Room *)this)->_gridEntities[0xd9] = (void *)((float)((Room *)this)->_gridEntities[0xd9] + (float)((Room *)this)->_gridEntities[0xd9]); } if (0 < ((Room *)this)->_gridPaths[399]) { ((Room *)this)->_gridPaths[399] = ((Room *)this)->_gridPaths[399] + -1; } if (((Room *)this)->_gridPaths[0x187] != 0) { if (((Room *)this)->_gridPaths[0x187] != 1) { ExceptionList = local_10; return; } if (((Room *)this)->_gridEntities[2] != (void *)0xce) { ExceptionList = local_10; return; } if (((Room *)this)->_gridEntities[3] != (void *)0x28a) { ExceptionList = local_10; return; } local_1dc = (EntityPtr *)cos(0.7853982); fVar18 = sin(0.7853982); fVar14 = ((Vector *)(((Room *)this)->_gridEntities + 0xcf))->x; rotatedVelocity.x = fVar14 * (float)local_1dc - (float)((Room *)this)->_gridEntities[0xd0] * fVar18; rotatedVelocity.y = fVar14 * fVar18 + (float)((Room *)this)->_gridEntities[0xd0] * (float)local_1dc; tmpVec = Vector::ToCardinal(&cardinalVelocity,&rotatedVelocity); local_1cc = cos(-0.7853982); fVar15 = sin(-0.7853982); fVar14 = tmpVec->y; fVar18 = tmpVec->x; local_1c4 = local_1cc * tmpVec->x - fVar15 * tmpVec->y; ((Room *)this)->_gridEntities[0xd2] = (void *)0x3f7ae148; local_1cc = local_1cc * fVar14 + fVar15 * fVar18; if (0 < updateSteps) { do { ((Room *)this)->_gridPaths[0x178] = ((Room *)this)->_gridPaths[0x178] + 1; manager = g_manager; uVar7 = ((Room *)this)->_gridPaths[0x178] & 0x80000003; bVar13 = uVar7 == 0; if ((int)uVar7 < 0) { bVar13 = (uVar7 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar13) { local_1c0 = (Entity *)0xb9; seed_fart_sound_override((int *)&local_1c0); SoundEffects::Play(&manager->_sfxManager,(int)local_1c0,1.0,2,0,1.0,0.0); uVar7 = Random(); fVar14 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; local_1c0 = (Entity *)(-local_1c4 * 5.0 * fVar14); local_1b4 = (Room *)(-local_1cc * 5.0 * fVar14); uVar7 = Random(); local_1dc = (EntityPtr *) (((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292); local_1c8 = (EntityPtr)cos((float)local_1dc); fVar14 = sin((float)local_1dc); tearPos.x = ((Vector *)(((Room *)this)->_gridEntities + 0xc6))->x; tearPos.y = (float)((Room *)this)->_gridEntities[199]; tearVelocity.x = (float)local_1c8 * (float)local_1c0 - fVar14 * (float)local_1b4; tearVelocity.y = (float)local_1c8 * (float)local_1b4 + fVar14 * (float)local_1c0; uVar7 = Random(); local_1dc = (EntityPtr *) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10); uVar7 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,2,1,&tearPos,&tearVelocity,(Entity *)this,0,uVar7); tear->_fallingAccel = tear->_fallingAccel - 0.05; uVar7 = Random(); fVar14 = (float)(&DAT_00b64e34)[uVar7 & 1]; if (fVar14 <= 0.01) { fVar14 = 0.01; } tear->_baseScale = fVar14; tear->_fScale = fVar14; Entity_Tear::ResetSpriteScale(tear); Entity_Projectile::SetHeight((Entity_Projectile *)tear,tear->_height - 10.0); (**(code **)(*(int *)tear + 0x40))((float)local_1dc + 3.0); } updateSteps = updateSteps + -1; } while (updateSteps != 0); updateSteps = 0; } anim = "SpecialDown"; if (0.0 < local_1cc) { anim = "SpecialUp"; } ANM2::Play((ANM2 *)(((Room *)this)->_gridEntities + 9),(byte *)anim,0); pvVar2 = ((Room *)this)->_gridEntities[0xde]; ((Vector *)(((Room *)this)->_gridEntities + 0xcf))->x = local_1c4 * 0.4 * (float)pvVar2 + ((Vector *)(((Room *)this)->_gridEntities + 0xcf))->x; ((Room *)this)->_gridEntities[0xd0] = (void *)(local_1cc * 0.4 * (float)pvVar2 + (float)((Room *)this)->_gridEntities[0xd0]); ExceptionList = local_10; return; } if (isFiring == '\0') { ExceptionList = local_10; return; } if (0 < ((Room *)this)->_gridPaths[0x178]) { ((Room *)this)->_gridPaths[0x178] = ((Room *)this)->_gridPaths[0x178] + -1; } local_1b4 = *(Room **)((int)((Room *)this)->_gridEntities[0xfb] + 0x162c); if ((((local_1b4 == (Room *)0xffffffff) && (local_1d8 == g_vectorZero.x)) && ((float)local_1d4 == g_vectorZero.y)) || ((float)(int)local_1d0 <= 0.0)) { if (((Room *)this)->_gridPaths[0x179] < 0) { ExceptionList = local_10; return; } iVar12 = ((Room *)this)->_gridPaths[0x179] + -1; ((Room *)this)->_gridPaths[0x179] = iVar12; if (iVar12 < 0) { PlayFloatAnim(this,3); ExceptionList = local_10; return; } ExceptionList = local_10; return; } Isaac::GetAxisAlignedUnitVectorFromDir(&shotDirection,(int)local_1b4); TryAimAtMarkedTarget(this,&shotDirection,(int *)&local_1b4,(Vector *)0x0); if ((local_1d8 == g_vectorZero.x) && ((float)local_1d4 == g_vectorZero.y)) { local_1d4 = (Entity *)shotDirection.y; local_1d8 = shotDirection.x; } local_1c4 = local_1c4 * 0.017453292; local_1dc = (EntityPtr *)cos(local_1c4); fVar14 = sin(local_1c4); shotDirection.x = (float)local_1dc * local_1d8 - (float)local_1d4 * fVar14; shotDirection.y = local_1d8 * fVar14 + (float)local_1d4 * (float)local_1dc; if (((Room *)this)->_gridPaths[0x178] < 1) { if (iVar12 != 0) { local_1cc = local_1cc * 0.017453292; local_1dc = (EntityPtr *)cos(local_1cc); local_1c8 = (EntityPtr)sin(local_1cc); do { FireProjectile(this,&shotDirection,0); fVar14 = shotDirection.x * (float)local_1c8; shotDirection.x = shotDirection.x * (float)local_1dc - shotDirection.y * (float)local_1c8; shotDirection.y = shotDirection.y * (float)local_1dc + fVar14; iVar12 = iVar12 + -1; } while (iVar12 != 0); } ((Room *)this)->_gridPaths[0x178] = (int)local_1d0; ((Room *)this)->_gridPaths[0x179] = 0xc; } else if (((Room *)this)->_gridPaths[0x179] < 9) { PlayFloatAnim(this,(int)local_1b4); ((Room *)this)->_gridPaths[0x179] = 8; goto LAB_0043d0b0; } PlayShootAnim(this,(int)local_1b4); ((Room *)this)->_gridPaths[0x179] = ((Room *)this)->_gridPaths[0x179] + -1; LAB_0043d0b0: if (((Room *)this)->_gridEntities[3] == (void *)0x31) { ((Vector *)(((Room *)this)->_gridEntities + 0xc4))->x = shotDirection.x; ((Room *)this)->_gridEntities[0xc5] = (void *)shotDirection.y; } ExceptionList = local_10; return; } //@@ 0043d7f0 FUN_0043d7f0 void FUN_0043d7f0(int param_1) { float *pfVar1; float *pfVar2; Entity_Familiar *in_ECX; if (param_1 != in_ECX->_subtype) { in_ECX->_subtype = param_1; (**(code **)(*(int *)in_ECX + 0x60))(); (**(code **)(*(int *)in_ECX + 100))(); pfVar1 = &in_ECX->_health; pfVar2 = &in_ECX->_maxHitPoints; if (*pfVar1 <= in_ECX->_maxHitPoints && in_ECX->_maxHitPoints != *pfVar1) { pfVar2 = pfVar1; } *pfVar1 = *pfVar2; in_ECX->_entityGridCollisionClass = 0; Entity_Familiar::WispInit(in_ECX); } return; } //@@ 0043d850 FamiliarHelper::wisp_mine_crafter_update /* DB: ? Entity_Familiar::ai_wisp case subtype 0x1ab (427 COLLECTIBLE_MINE_CRAFTER): random drift, EntityList::QueryRadius, explodes (Game::BombDamage, Game::Spawn 1000, Game::spawn_bomb_crater) */ void FamiliarHelper::wisp_mine_crafter_update(void) { int iVar1; qword qVar2; uint uVar3; int *in_ECX; qword *pqVar4; float fVar5; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; float local_48; float local_44; float local_40; float local_3c; undefined4 local_38; undefined4 local_34; EntityList_EL local_30; Vector local_20; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af229d; local_10 = ExceptionList; ExceptionList = &local_10; in_ECX[0xdb] = 0x3f666666; local_18.y = (float)in_ECX[0xd8]; local_20.y = (float)in_ECX[0xd9]; fVar5 = sqrtf(local_18.y * local_18.y + local_20.y * local_20.y); if (0.0 < fVar5) { in_ECX[0xd8] = (int)(local_18.y * (2.0 / fVar5)); in_ECX[0xd9] = (int)(local_20.y * (2.0 / fVar5)); } if ((char)in_ECX[100] != '\0') { uVar3 = Random(); local_20.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20.y = local_20.y + local_20.y; local_18.y = sin(local_20.y); fVar5 = cos(local_20.y); in_ECX[0xd8] = (int)(fVar5 * 0.1 + (float)in_ECX[0xd8]); in_ECX[0xd9] = (int)(local_18.y * 0.1 + (float)in_ECX[0xd9]); } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&local_30,(Vector *)(in_ECX + 0xcf), (float)in_ECX[0xdc],4); local_8 = 0; uVar3 = 0; if (local_30._size != 0) { do { iVar1 = *(int *)((int)local_30._data + uVar3 * 4); if ((*(int *)(iVar1 + 0x28) == 2) && (*(int *)(iVar1 + 0x2c) != 9)) { uVar3 = Random(); local_20.x = (float)in_ECX[0xcf]; local_20.y = (float)in_ECX[0xd0]; Game::Spawn(g_game,1000,1,&local_20,&g_vectorZero,(Entity *)0x0,0,uVar3); local_18.x = (float)in_ECX[0xcf]; local_18.y = (float)in_ECX[0xd0]; Game::spawn_bomb_crater(g_game,&local_18,(Entity *)0x0,1.0); local_20.x = (float)in_ECX[0xcf]; local_20.y = (float)in_ECX[0xd0]; Game::BombDamage(g_game,&local_20,100.0,75.0,0,(Entity *)0x0,g_tearFlagsNone,0x1004,0); local_48 = g_vectorZero.x; local_40 = g_vectorZero.x; local_44 = g_vectorZero.y; local_3c = g_vectorZero.y; local_58 = 0; local_54 = 0; local_50 = 0; local_4c = 0; local_38 = 0; local_34 = 0; (**(code **)(*in_ECX + 0x24))(&local_58); break; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)local_30._size); } if (local_30._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (local_30._data != (void *)0x0) { uVar3 = *(uint *)((int)local_30._data + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar3; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar3); free((void *)((int)local_30._data + -4)); } } ExceptionList = local_10; return; } //@@ 0043db20 Entity_Familiar::ai_mr_me_wisp /* DB: called from Entity_Familiar::ai_wisp (0043aa90) for wisp subtype 0x20f (COLLECTIBLE_MR_ME 527): state this+0xd84 1/2/3 walks to grid targets (x%w*40+40, y*40+120), Entity_Pickup::TryOpenChest, GridEntity_Door::TryUnlock/TryBlowOpen/Open, Game::BombDamage, AddToOrbit */ void __thiscall Entity_Familiar::ai_mr_me_wisp(Entity_Familiar *this) { Vector *pos; int iVar1; byte bVar2; uint uVar3; float fVar4; int iVar5; void *wispConfig; NetplayManager orbitLevel; EntityRef *killSource; Entity_Player *nearestPlayer; Entity *explosion; EntityPtr targetPickup; EntityPtr target; NetplayManager orbitLevelLow; void *pvVar6; float dx; EntityRef doorKillRef; EntityRef killRef; EntityList_EL pickups; float posY; NetplayManager local_1c; float local_18; Entity_Familiar *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; GridEntity_Door *door; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00af22cd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar5 = this->_keys; if (iVar5 == 0) { local_14 = this; bVar2 = Entity::IsFrame((Entity *)this,0xf,this->_index); game = g_game; if (bVar2 == 0) { ExceptionList = local_10; return; } pvVar6 = g_game->_room; if ((*(byte *)(*(int *)((int)pvVar6 + 4) + 0x44) & 1) == 0) { ExceptionList = local_10; return; } iVar5 = *(int *)((int)pvVar6 + 0x764); if (((((-1 < iVar5) && (iVar5 < 0x1c0)) && (iVar1 = *(int *)((int)pvVar6 + iVar5 * 4 + 0x24), iVar1 != 0)) && ((*(int *)(iVar1 + 4) == 4 || (*(int *)(iVar1 + 4) == 0x16)))) && (*(int *)(iVar1 + 0xc) != 2)) { this->_keys = 1; this->_coins = iVar5; iVar1 = *(int *)((int)game->_room + 0xc); (this->_targetPosition).x = (float)(iVar5 % iVar1) * 40.0 + 40.0; (this->_targetPosition).y = (float)(iVar5 / iVar1) * 40.0 + 120.0; } if (this->_keys == 0) { EntityList::QuerySublist((EntityList *)((int)game->_room + 0x1218),&pickups,5,0x3c,-1,0,0); local_8 = 0; local_18 = 0.0; if (pickups._size != 0) { uVar3 = pickups._size; pvVar6 = pickups._data; do { target = *(EntityPtr *)((int)pvVar6 + (int)local_18 * 4); if (target != (EntityPtr)0x0) { if (*(int *)((int)target + 0x28) == 5) { if (*(int *)((int)target + 0x30) != 0) { if (this->_target != (EntityPtr)0x0) { local_1c = (NetplayManager)&this->_target; std::multiset::erase(&local_1c); } this->_target = target; std::multiset::insert(&this->_target); this->_keys = 2; fVar4 = *(float *)((int)target + 0x340); (this->_targetPosition).x = *(float *)((int)target + 0x33c); (this->_targetPosition).y = fVar4; uVar3 = pickups._size; pvVar6 = pickups._data; } } } local_18 = (float)((int)local_18 + 1); } while ((uint)local_18 < uVar3); } local_8 = 0xffffffff; if (pickups._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,pickups._data,0); local_8 = 0xffffffff; } } iVar5 = this->_keys; if (iVar5 == 0) { fVar4 = (float)((int)g_game->_room + 0x724); uVar3 = 0; local_18 = fVar4; do { door = *(GridEntity_Door **)((int)fVar4 + uVar3 * 4); if (door != (GridEntity_Door *)0x0) { if (((door->_doorFlags & 0x50U) == 0) && (((door->_doorFlags & 0x20U) == 0 || ((door->_desc)._variant != 4)))) { iVar5 = GridEntity_Door::get_secret_exit_kind(door); game = g_game; fVar4 = local_18; if ((iVar5 != 4) && ((iVar5 = *(int *)((int)local_18 + uVar3 * 4), *(int *)(iVar5 + 0xc) != 2 && ((iVar5 = *(int *)(iVar5 + 0x160), iVar5 == 7 || (iVar5 == 8)))))) { this->_keys = 3; this->_coins = uVar3; iVar5 = *(int *)(*(int *)((int)local_18 + uVar3 * 4) + 0x24); iVar1 = *(int *)((int)game->_room + 0xc); (this->_targetPosition).x = (float)(iVar5 % iVar1) * 40.0 + 40.0; (this->_targetPosition).y = (float)(iVar5 / iVar1) * 40.0 + 120.0; } } } uVar3 = uVar3 + 1; } while (uVar3 < 8); iVar5 = this->_keys; if (iVar5 == 0) { fVar4 = (float)((int)g_game->_room + 0x724); uVar3 = 0; local_18 = fVar4; do { door = *(GridEntity_Door **)((int)fVar4 + uVar3 * 4); if (door != (GridEntity_Door *)0x0) { if ((door->_doorFlags & 0x50U) == 0) { if ((door->_doorFlags & 0x20U) != 0) { if ((door->_desc)._variant == 4) goto LAB_0043df18; } iVar5 = GridEntity_Door::get_secret_exit_kind(door); game = g_game; fVar4 = local_18; if (iVar5 != 4) { iVar5 = *(int *)((int)local_18 + uVar3 * 4); if (*(int *)(iVar5 + 0xc) != 2) { if ((*(int *)(iVar5 + 0x160) != 7) && (*(int *)(iVar5 + 0x160) != 8)) { this = local_14; if (*(int *)(iVar5 + 0x394) == g_game->_lastRoomIdx) { local_1c = g_manager->_netplayManager; if (((local_1c != *(NetplayManager *)(g_manager + 1)) && (1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)local_1c >> 2)) ) && (*(uint *)(iVar5 + 0x154) < 0x1f)) goto LAB_0043df18; } local_14->_keys = 4; local_14->_coins = uVar3; iVar5 = *(int *)(*(int *)((int)local_18 + uVar3 * 4) + 0x24); iVar1 = *(int *)((int)game->_room + 0xc); (local_14->_targetPosition).x = (float)(iVar5 % iVar1) * 40.0 + 40.0; (local_14->_targetPosition).y = (float)(iVar5 / iVar1) * 40.0 + 120.0; } } } } } LAB_0043df18: uVar3 = uVar3 + 1; } while (uVar3 < 8); iVar5 = this->_keys; } } iVar1 = this->_orbitLayer; if (iVar5 != 0) { if (iVar1 < 0) { ExceptionList = local_10; return; } RecalculateOrbitOffset(this,iVar1,0); this->_orbitLayer = -1; ExceptionList = local_10; return; } if (-1 < iVar1) { this->_friction = 1.0; ExceptionList = local_10; return; } if (this->_variant == 0xed) { iVar5 = this->_wispCollectibleType; } else if (this->_variant == 0xce) { iVar5 = this->_subtype; } else { iVar5 = 0x248; } wispConfig = ItemConfig::get_wisp_config(iVar5); this->_friction = 0.7; pvVar6 = this->_player; local_1c = (NetplayManager)(*(short *)((int)wispConfig + 0x18c) + 7); orbitLevelLow = local_1c; if ((int)local_1c < 1) { orbitLevelLow = (NetplayManager)0x0; } orbitLevel = (NetplayManager)0xa; if ((int)orbitLevelLow < 10) { orbitLevel = orbitLevelLow; } posY = (local_14->_pos).y; local_18 = (local_14->_pos).x; fVar4 = posY - *(float *)((int)pvVar6 + 0x340); dx = local_18 - *(float *)((int)pvVar6 + 0x33c); fVar4 = sqrtf(fVar4 * fVar4 + dx * dx); if ((float)(&DAT_00c34130)[(int)orbitLevel * 5] <= fVar4) { local_1c = (NetplayManager)(*(float *)((int)pvVar6 + 0x340) - posY); local_18 = *(float *)((int)pvVar6 + 0x33c) - local_18; fVar4 = sqrtf((float)local_1c * (float)local_1c + local_18 * local_18); if (0.0 < fVar4) { local_1c = (NetplayManager)((2.0 / fVar4) * (float)local_1c); local_18 = (2.0 / fVar4) * local_18; } fVar4 = local_14->_speedMultiplier; (local_14->_velocity).y = (fVar4 * (float)local_1c) / 0.7 + (local_14->_velocity).y; (local_14->_velocity).x = (fVar4 * local_18) / 0.7 + (local_14->_velocity).x; ExceptionList = local_10; return; } AddToOrbit(local_14,(int)local_1c); ExceptionList = local_10; return; } target = this->_target; pos = &this->_pos; this->_friction = 0.7; local_18 = (this->_targetPosition).x; fVar4 = (this->_targetPosition).y; if (target != (EntityPtr)0x0) { local_18 = ((Vector *)((int)target + 0x33c))->x; fVar4 = *(float *)((int)target + 0x340); } local_14 = (Entity_Familiar *)(fVar4 - (this->_pos).y); local_18 = local_18 - pos->x; fVar4 = local_18 * local_18 + (float)local_14 * (float)local_14; if (fVar4 <= 225.0) { if (iVar5 == 2) { if (((target != (EntityPtr)0x0) && (*(int *)((int)target + 0x28) == 5)) && ((*(int *)((int)target + 0x30) != 0 && (bVar2 = Entity_Pickup::TryOpenChest((Entity_Pickup *)target,(Entity_Player *)0x0), bVar2 != 0)))) { LAB_0043e26b: killSource = &killRef; LAB_0043e26e: killSource = EntityRef::EntityRef(killSource); (**(code **)(*(int *)this + 0x24))(killSource,uVar3); } } else if (iVar5 == 1) { if ((((uint)this->_coins < 0x1c0) && (iVar5 = *(int *)((int)g_game->_room + this->_coins * 4 + 0x24), iVar5 != 0)) && (*(int *)(iVar5 + 0xc) != 2)) { nearestPlayer = Game::GetNearestPlayer(g_game,pos); fVar4 = (this->_pos).y - (nearestPlayer->_pos).y; dx = pos->x - (nearestPlayer->_pos).x; fVar4 = sqrtf(fVar4 * fVar4 + dx * dx); if (100.0 < fVar4) { Game::BombDamage(g_game,pos,40.0,80.0,1,(Entity *)this,g_tearFlagsNone,4,0); uVar3 = Random(); explosion = Game::Spawn(g_game,1000,1,pos,&g_vectorZero,(Entity *)0x0,0,uVar3); (**(code **)(*(int *)explosion + 0xc))(); killSource = EntityRef::EntityRef(&killRef); (**(code **)(*(int *)this + 0x24))(killSource); } goto LAB_0043e200; } } else if (iVar5 == 3) { door = *(GridEntity_Door **)((int)g_game->_room + this->_coins * 4 + 0x724); if ((door->_desc)._state != 2) { GridEntity_Door::TryBlowOpen(door,0,(Entity *)0x0); goto LAB_0043e26b; } } else { if (iVar5 != 4) goto LAB_0043e200; door = *(GridEntity_Door **)((int)g_game->_room + this->_coins * 4 + 0x724); if ((door->_desc)._state != 2) { bVar2 = GridEntity_Door::TryUnlock(door,this->_player,1); if (bVar2 == 0) { GridEntity_Door::Open(door); } killSource = &doorKillRef; goto LAB_0043e26e; } } this->_keys = 0; iVar5 = 0; LAB_0043e43e: target = this->_target; if (target != (EntityPtr)0x0) { LAB_0043e448: if ((*(char *)((int)target + 0x172) == '\0') || (*(char *)((int)target + 0x173) != '\0')) goto LAB_0043e460; } } else { fVar4 = sqrtf(fVar4); if (0.0 < fVar4) { local_18 = local_18 * (2.0 / fVar4); local_14 = (Entity_Familiar *)((float)local_14 * (2.0 / fVar4)); } fVar4 = this->_speedMultiplier; (this->_velocity).y = (fVar4 * (float)local_14) / 0.7 + (this->_velocity).y; (this->_velocity).x = (fVar4 * local_18) / 0.7 + (this->_velocity).x; LAB_0043e200: iVar5 = this->_keys; if (iVar5 != 1) { if (iVar5 == 2) { target = this->_target; if (target != (EntityPtr)0x0) { targetPickup = (EntityPtr)0x0; if (*(int *)((int)target + 0x28) == 5) { targetPickup = target; } if (*(int *)((int)targetPickup + 0x30) == 1) goto LAB_0043e448; } } else if (((iVar5 != 4) && (iVar5 != 3)) || (*(int *)(*(int *)((int)g_game->_room + this->_coins * 4 + 0x724) + 0xc) != 2)) goto LAB_0043e43e; LAB_0043e460: this->_keys = 0; goto LAB_0043e46a; } if (((0x1bf < (uint)this->_coins) || (iVar1 = *(int *)((int)g_game->_room + this->_coins * 4 + 0x24), iVar1 == 0)) || (*(int *)(iVar1 + 0xc) == 2)) { this->_keys = 0; iVar5 = 0; } } if (iVar5 != 0) { ExceptionList = local_10; return; } LAB_0043e46a: (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; ExceptionList = local_10; return; } //@@ 0043e4a0 Entity_Familiar::ai_mega_blast_wisp /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: called only from Entity_Familiar::ai_wisp switch case 0x1b9 (441 Mega Blast); aims with TryAimAtMarkedTarget, FireBrimstone, keeps _linkedEntity laser rotated (Entity_Laser::RotateToAngle), PlayShoot/Charge/FloatAnim (sibling of ai_mr_me_wisp 0043db20) */ void Entity_Familiar::ai_mega_blast_wisp(void) { EntityPtr EVar1; byte bVar2; Entity_Laser *brimstone; int iVar3; Entity_Familiar *in_ECX; int direction; float fVar4; undefined4 laserDepthOffset; float awayDirY; float awayDirX; Vector local_18; Vector local_10; void *player; player = in_ECX->_player; direction = *(int *)((int)player + 0x162c); fVar4 = sqrtf(*(float *)((int)player + 0x1630) * *(float *)((int)player + 0x1630) + *(float *)((int)player + 0x1634) * *(float *)((int)player + 0x1634)); if ((fVar4 < 0.5) && (*(char *)((int)in_ECX->_player + 0x1638) == '\0')) { direction = -1; } Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,in_ECX->_lastDirection); bVar2 = TryAimAtMarkedTarget(in_ECX,&local_10,&in_ECX->_lastDirection,(Vector *)0x0); if (bVar2 != 0) { if (in_ECX->_fireCooldown < 0) { direction = -1; } EVar1 = in_ECX->_linkedEntity; if ((((EVar1 != (EntityPtr)0x0) && (*(int *)((int)EVar1 + 0x28) == 7)) && (iVar3 = *(int *)((int)EVar1 + 0x30), iVar3 != 1)) && ((iVar3 != 2 && (iVar3 != 3)))) { fVar4 = atan2f(local_10.y,local_10.x); Entity_Laser::RotateToAngle((Entity_Laser *)in_ECX->_linkedEntity,fVar4 * 57.295776,8.0); } } player = in_ECX->_player; if (((*(char *)((int)player + 0x1398) == '\0') && (*(char *)((int)player + 0x139a) == '\0')) && ((*(int *)&g_game->_stageTransition == 0 && ((*(char *)((int)player + 0x410) != '\0' && (*(int *)((int)player + 0x414) < 1)))))) { if (direction == -1) { if ((in_ECX->_fireCooldown < 0) && (((local_10.x != g_vectorZero.x || (local_10.y != g_vectorZero.y)) && (in_ECX->_linkedEntity == (EntityPtr)0x0)))) { brimstone = FireBrimstone(in_ECX,&local_10,1); _DAT_00c5c554 = local_10.x * 7.0; DAT_00c5c558 = local_10.y * 5.0 - 18.0; iVar3 = *(int *)brimstone; (brimstone->_posOffset).x = _DAT_00c5c554; (brimstone->_posOffset).y = DAT_00c5c558; (**(code **)(iVar3 + 0xc))(); in_ECX->_headFrameDelay = 0x1e; iVar3 = vector_to_direction(&local_10); PlayShootAnim(in_ECX,iVar3); } iVar3 = in_ECX->_headFrameDelay; in_ECX->_fireCooldown = 0x1e; } else { iVar3 = in_ECX->_headFrameDelay; if (iVar3 < 9) { in_ECX->_fireCooldown = in_ECX->_fireCooldown + -1; } in_ECX->_lastDirection = direction; } if (iVar3 < 9) { if (direction == -1) { PlayFloatAnim(in_ECX,*(int *)((int)in_ECX->_player + 0x1628)); } else { PlayChargeAnim(); } in_ECX->_headFrameDelay = 8; } else { in_ECX->_headFrameDelay = iVar3 + -1; } } awayDirY = (in_ECX->_pos).y - *(float *)((int)in_ECX->_player + 0x340); awayDirX = (in_ECX->_pos).x - *(float *)((int)in_ECX->_player + 0x33c); local_18.x = awayDirX; local_18.y = awayDirY; fVar4 = sqrtf(awayDirY * awayDirY + awayDirX * awayDirX); if (0.0 < fVar4) { awayDirX = awayDirX * (1.0 / fVar4); awayDirY = awayDirY * (1.0 / fVar4); local_18.x = awayDirX; local_18.y = awayDirY; } if ((0 < *(int *)((int)in_ECX->_player + 0x18f4)) && (in_ECX->_linkedEntity == (EntityPtr)0x0)) { local_10.x = (float)FireBrimstone(in_ECX,&local_18,0); awayDirX = local_18.x; _DAT_00c5c554 = local_18.x * 7.0; awayDirY = local_18.y; DAT_00c5c558 = local_18.y * 5.0 - 18.0; ((Vector *)((int)local_10.x + 0x34c))->x = _DAT_00c5c554; *(float *)((int)local_10.x + 0x350) = DAT_00c5c558; *(int *)((int)local_10.x + 0x458) = *(int *)((int)in_ECX->_player + 0x18f4); (**(code **)(*(int *)local_10.x + 0xc))(); if (in_ECX->_linkedEntity != (EntityPtr)0x0) { local_18.x = (float)&in_ECX->_linkedEntity; std::multiset::erase(&local_18); } in_ECX->_linkedEntity = (EntityPtr)local_10.x; std::multiset::insert(&in_ECX->_linkedEntity); in_ECX->_headFrameDelay = 0x1e; PlayShootAnim(in_ECX,direction); } EVar1 = in_ECX->_linkedEntity; if (EVar1 != (EntityPtr)0x0) { fVar4 = atan2f(awayDirY,awayDirX); *(undefined1 *)((int)EVar1 + 0x4c0) = 1; *(undefined4 *)((int)EVar1 + 0x4c4) = 0; local_18.x = ABS(fVar4 * 57.295776); fVar4 = angle_difference(*(float *)((int)EVar1 + 0x41c),fVar4 * 57.295776); *(float *)((int)EVar1 + 0x4c8) = fVar4; if (fVar4 < 0.0) { local_18.x = -local_18.x; } *(float *)((int)EVar1 + 0x4cc) = local_18.x; if (-0.5 <= awayDirY) { laserDepthOffset = 0x453b8000; } else { laserDepthOffset = 0xc1200000; } *(undefined4 *)((int)EVar1 + 0x358) = laserDepthOffset; _DAT_00c5c554 = awayDirX * 7.0; DAT_00c5c558 = awayDirY * 5.0 - 18.0; *(float *)((int)EVar1 + 0x34c) = _DAT_00c5c554; *(float *)((int)EVar1 + 0x350) = DAT_00c5c558; } return; } //@@ 0043e990 FUN_0043e990 void FUN_0043e990(RNG *param_1) { float *pfVar1; int iVar2; float *pfVar3; Entity_Familiar *in_ECX; iVar2 = Entity_Familiar::GetRandomWisp(param_1); if (iVar2 != in_ECX->_subtype) { in_ECX->_subtype = iVar2; (**(code **)(*(int *)in_ECX + 0x60))(); (**(code **)(*(int *)in_ECX + 100))(); pfVar1 = &in_ECX->_health; pfVar3 = &in_ECX->_maxHitPoints; if (*pfVar1 <= in_ECX->_maxHitPoints && in_ECX->_maxHitPoints != *pfVar1) { pfVar3 = pfVar1; } *pfVar1 = *pfVar3; in_ECX->_entityGridCollisionClass = 0; Entity_Familiar::WispInit(in_ECX); } return; } //@@ 0043e9f0 FUN_0043e9f0 void FUN_0043e9f0(void) { Entity_Familiar *pEVar1; int *in_ECX; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; if ((float)in_ECX[0x3cc] <= 0.25) { local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; (**(code **)(*in_ECX + 0x24))(&local_30); } else { in_ECX[0x3cc] = (int)((float)in_ECX[0x3cc] * 0.5); in_ECX[0x39] = (int)((float)in_ECX[0x39] * 0.5); in_ECX[0x3a] = (int)((float)in_ECX[0x3a] * 0.5); pEVar1 = Entity_Player::AddWisp ((Entity_Player *)in_ECX[0x104],in_ECX[0xc],(Vector *)(in_ECX + 0xcf),1,0); if (pEVar1 != (Entity_Familiar *)0x0) { pEVar1[1]._damageEvents._end = (void *)in_ECX[0x3cc]; (pEVar1->_sprite)._scale.x = (float)in_ECX[0x39]; (pEVar1->_sprite)._scale.y = (float)in_ECX[0x3a]; return; } } return; } //@@ 0043eb10 Entity_Familiar::GetRandomWisp /* ZHL [exact] static __fastcall int Entity_Familiar::GetRandomWisp(RNG& rng); prototype: REPENTOGON, confirmed by RET 0 */ int __fastcall Entity_Familiar::GetRandomWisp(RNG *rng) { code *pcVar1; RNG *pRVar2; uint uVar3; void *pvVar4; int iVar5; uint uVar6; int *piVar7; int *piVar8; int *local_34; int local_30; void *local_28; int *local_24; int *local_20; RNG *local_1c; void *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af2305; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_1c = rng; pvVar4 = ItemConfig::GetTaggedItems(&g_manager->_itemConfig,0x4000000); std::vector::copy_constructor(pvVar4); piVar7 = (int *)0x0; local_18 = (void *)0x0; piVar8 = (int *)0x0; local_28 = (void *)0x0; local_24 = (int *)0x0; local_20 = (int *)0x0; local_8 = 1; local_14 = local_30 - (int)local_34 >> 2; if (local_14 != 0) { if (0x3fffffff < local_14) { /* WARNING: Subroutine does not return */ std::_Xlen(uVar3); } std::vector::_Reallocate(local_14); piVar7 = local_24; piVar8 = local_20; do { if (0 < *(short *)(*(int *)(*local_34 + 0xcc) + 400)) { if (piVar7 == piVar8) { std::vector::_Emplace_reallocate(piVar7,local_34); piVar7 = local_24; piVar8 = local_20; } else { *piVar7 = *local_34; local_24 = piVar7 + 1; piVar7 = local_24; } } local_34 = local_34 + 1; local_14 = local_14 - 1; } while (local_14 != 0); local_18 = local_28; local_14 = 0; } pRVar2 = local_1c; uVar3 = (int)piVar7 - (int)local_18 >> 2; local_28 = local_18; if (uVar3 == 0) { iVar5 = 0x248; } else { uVar6 = local_1c->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = pRVar2->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar6 = uVar6 >> ((byte)pRVar2->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)pRVar2->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)pRVar2->_shift3 & 0x1f) ^ uVar6; pRVar2->_seed = uVar6; iVar5 = *(int *)(*(int *)((int)local_18 + (uVar6 % uVar3) * 4) + 4); } if (local_18 != (void *)0x0) { uVar3 = (int)piVar8 - (int)local_18 & 0xfffffffc; pvVar4 = local_18; if (0xfff < uVar3) { pvVar4 = *(void **)((int)local_18 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_18 + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar3); } FID_conflict__Tidy(&local_34); ExceptionList = local_10; return iVar5; } //@@ 0043eca0 std::vector::copy_constructor /* DB: alloc+memmove of 4-byte elems */ void std::vector::copy_constructor(undefined4 *param_1) { void *_Src; size_t _Size; uint uVar1; void *_Dst; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; _Src = (void *)*param_1; if (_Src != (void *)param_1[1]) { _Size = (int)param_1[1] - (int)_Src; uVar1 = (int)_Size >> 2; if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar1 = uVar1 * 4; _Dst = _Allocate(uVar1); *in_ECX = _Dst; in_ECX[1] = _Dst; in_ECX[2] = (void *)(uVar1 + (int)_Dst); memmove(_Dst,_Src,_Size); in_ECX[1] = (void *)(uVar1 + (int)_Dst); } return; } //@@ 0043ed20 FUN_0043ed20 void FUN_0043ed20(undefined4 *param_1,int *param_2) { undefined4 *puVar1; int iVar2; void *pvVar3; int *in_ECX; undefined4 *puVar4; uint childSide; undefined4 *parent; void *local_c; childSide = 0; puVar4 = (undefined4 *)*in_ECX; parent = (undefined4 *)puVar4[1]; if (*(char *)((int)parent + 0xd) == '\0') { puVar1 = parent; do { parent = puVar1; if ((int)parent[4] < *param_2) { puVar1 = (undefined4 *)parent[2]; } else { puVar1 = (undefined4 *)*parent; puVar4 = parent; } childSide = (uint)(*param_2 <= (int)parent[4]); } while (*(char *)((int)puVar1 + 0xd) == '\0'); } if ((*(char *)((int)puVar4 + 0xd) == '\0') && ((int)puVar4[4] <= *param_2)) { *param_1 = puVar4; *(undefined1 *)(param_1 + 1) = 0; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } iVar2 = FUN_0043edf0(in_ECX,*in_ECX,param_2); pvVar3 = *(void **)(iVar2 + 4); *(undefined4 *)(iVar2 + 4) = 0; if (local_c != (void *)0x0) { operator_delete(local_c,0x18); } pvVar3 = std::_Tree::_Insert_node(in_ECX,parent,childSide,pvVar3); *param_1 = pvVar3; *(undefined1 *)(param_1 + 1) = 1; return; } //@@ 0043edf0 FUN_0043edf0 void FUN_0043edf0(undefined4 param_1,undefined4 param_2,undefined4 *param_3) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af233d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = param_1; local_8 = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x18); in_ECX[1] = pvVar1; *(undefined4 *)((int)pvVar1 + 0x10) = *param_3; *(undefined4 *)((int)pvVar1 + 0x14) = param_3[1]; *(undefined4 *)in_ECX[1] = param_2; *(undefined4 *)(in_ECX[1] + 4) = param_2; *(undefined4 *)(in_ECX[1] + 8) = param_2; *(undefined1 *)(in_ECX[1] + 0xc) = 0; *(undefined1 *)(in_ECX[1] + 0xd) = 0; ExceptionList = local_10; return; } //@@ 0043ee80 Sprite::SetRotation /* DB: writes ANM2 0xa4 _rotation; tiny, ICF-foldable prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Sprite::SetRotation(Sprite *this,float rotation) { this->_rotation = rotation; return; } //@@ 0043eea0 FUN_0043eea0 void FUN_0043eea0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xec) = param_1; return; } //@@ 0043eec0 GridEntity::GetVariant /* ZHL [lua] Lua binding GridEntity:GetVariant */ undefined4 GridEntity::GetVariant(void) { int in_ECX; return *(undefined4 *)(in_ECX + 8); } //@@ 0043eed0 FUN_0043eed0 void FUN_0043eed0(float *param_1) { int in_ECX; *param_1 = (*(float *)(in_ECX + 0x1c) - *(float *)(in_ECX + 0x14)) * 0.5 + *(float *)(in_ECX + 0x14); param_1[1] = (*(float *)(in_ECX + 0x20) - *(float *)(in_ECX + 0x18)) * 0.5 + *(float *)(in_ECX + 0x18); return; } //@@ 0043ef20 Room::GetBossID /* ZHL [lua] Lua binding Room:GetBossID */ int __thiscall Room::GetBossID(Room *this) { return this->_bossId; } //@@ 0043ef30 ProjectileParams::ProjectileParams /* DB: inits scale 1, TargetPosition Vector at +0x68 (Lua ProjectileParams field+0x68); Gemini case builds params first prototype: db/protos.zhl */ ProjectileParams * __thiscall ProjectileParams::ProjectileParams(ProjectileParams *this) { uint uVar1; this->GridCollision = 1; this->HeightModifier = 0.0; this->FallingSpeedModifier = 0.0; this->FallingAccelModifier = 0.0; this->VelocityMulti = 1.0; this->Scale = 1.0; uVar1 = Random(); this->HomingStrength = 1.0; this->CurvingStrength = 0.005; this->Acceleration = 1.01; this->Spread = 1.0; this->CircleAngle = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; (this->Color)._tint[0] = 1.0; (this->Color)._tint[1] = 1.0; (this->Color)._tint[2] = 1.0; (this->Color)._tint[3] = 1.0; (this->Color)._colorize[0] = 0.0; (this->Color)._colorize[1] = 0.0; (this->Color)._colorize[2] = 0.0; (this->Color)._colorize[3] = 0.0; (this->Color)._offset[0] = 0.0; (this->Color)._offset[1] = 0.0; (this->Color)._offset[2] = 0.0; *(undefined4 *)&this->BulletFlags = 0; *(undefined4 *)((int)&this->BulletFlags + 4) = 0; (this->PositionOffset).x = g_vectorZero.x; (this->PositionOffset).y = g_vectorZero.y; (this->TargetPosition).x = g_vectorZero.x; (this->TargetPosition).y = g_vectorZero.y; (this->FireDirectionLimit).x = g_vectorZero.x; (this->FireDirectionLimit).y = g_vectorZero.y; this->DotProductLimit = -1000.0; this->WiggleFrameOffset = 0; *(undefined4 *)&this->ChangeFlags = 0; *(undefined4 *)((int)&this->ChangeFlags + 4) = 0; this->ChangeVelocity = 0.0; this->ChangeTimeout = 0x1e; this->DepthOffset = 0.0; this->Variant = 0; this[1].GridCollision = 0; this[1].HeightModifier = (float)&DAT_bf800000; this[1].FallingSpeedModifier = 0.0; *(undefined1 *)&this[1].FallingAccelModifier = 0; return this; } //@@ 0043f0c0 NpcAI::ENTITY_BABY_PLUM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 908 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BABY_PLUM(Entity_NPC *npc) { Vector *position; float *pfVar1; code *pcVar2; longlong lVar3; longlong lVar4; char isBanned; byte bVar5; Entity *tmpEntity; uint uVar6; uint uVar7; int iVar8; int *piVar9; char *anim; int unusedArg; void *pvVar10; uint uVar11; PlayerManager *playerManager; ANM2 *pAVar12; Room *activeRoom; bool bVar13; float dirX; float fVar14; float fVar15; undefined1 auVar16 [12]; float fVar17; ulonglong uVar18; Room *room; uint uStack_184; uint spawnSubType; Vector scratchVec; uint resolvedSubType; Game *pGStack_170; Entity *pEStack_16c; int *piStack_168; uint uStack_15c; float fStack_158; Vector shotVelocity; uint spawnType; int iStack_148; uint spawnSeed; uint spawnVariant; Entity_NPC *local_13c; undefined4 uStack_138; void *triggerNode; uint subTypeKey; EntityPtr *pEStack_128; int triggerKeyType; int triggerKeyVariant; int triggerKeyAnyVariant [3]; undefined8 uStack_110; undefined4 uStack_108; undefined1 auStack_104 [4]; undefined1 auStack_100 [8]; int iStack_f8; RNG cardRng; undefined4 uStack_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; ProjectileParams projParams; uint local_c; AnimationState *animState; ColorMod *creepColor; Game *game; Manager *manager; EntityPtr *spawnerRef; local_c = __security_cookie ^ (uint)&room; activeRoom = g_game->_room; room = activeRoom; local_13c = npc; switch(npc->_state) { case 0: npc->_state = 3; if (activeRoom->_roomType == 5) { if (activeRoom->_bossId == 0x54) { *(int *)&activeRoom->field_0x73f0 = g_game->_frameCount; } break; } default: break; case 3: npc->_friction = npc->_friction * 0.8; ANM2::Play(&npc->_sprite,s_Idle,0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); pEStack_16c = (Entity *)(tmpEntity->_pos).y; fVar14 = (float)(g_game->_frameCount - npc->_spawnFrame); fStack_158 = (fVar14 + fVar14) * 0.017453292; fVar14 = cos(fStack_158); scratchVec.x = fVar14 * 80.0 + (tmpEntity->_pos).x; fVar14 = sin(fStack_158); scratchVec.y = fVar14 * 80.0 + (float)pEStack_16c; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.6,0,1); activeRoom = room; if ((0 < *(int *)&room->field_0x73f0) && (900 < g_game->_frameCount - *(int *)&room->field_0x73f0)) { npc->_state = 0x10; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_projectileCooldown = -1; npc->_stateFrame = 0; return; } npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if ((0x1e < npc->_stateFrame) && (uVar6 = Random(), uVar6 % 0x1e == 0)) { uVar6 = Random(); uVar6 = uVar6 % 3; if (uVar6 == 0) { npc->_state = 8; npc->_projectileCooldown = -1; } else if (uVar6 == 1) { npc->_state = 9; npc->_projectileCooldown = -1; } else if (uVar6 == 2) { npc->_state = 10; npc->_projectileCooldown = -1; } } break; case 8: npc->_friction = npc->_friction * 0.8; ANM2::Play(&npc->_sprite,s_Attack1,0); animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar5 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x - (npc->_pos).x; scratchVec.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalized(&scratchVec,&shotVelocity); (npc->_targetPosition).x = shotVelocity.x * 4.0; (npc->_targetPosition).y = shotVelocity.y * 4.0; npc->_projectileCooldown = 0; (npc->_sprite)._flipX = shotVelocity.x * 4.0 < 0.0; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(animState,(byte *)"Sound"); if (bVar5 != 0) { (npc->_sprite)._flipX = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { iVar8 = npc->_projectileCooldown; if (-1 < iVar8) { if (0 < (int)npc->_updateTime - (int)npc->_prevUpdateTime) { if (iVar8 < 0x169) { ProjectileParams::ProjectileParams(&projParams); if ((npc->_sprite)._flipX == 0) { fStack_158 = 90.0 - (float)npc->_projectileCooldown; } else { fStack_158 = (float)npc->_projectileCooldown + 90.0; } projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.099; fStack_158 = fStack_158 * 0.017453292; scratchVec.x = cos(fStack_158); scratchVec.x = scratchVec.x * 7.0; scratchVec.y = sin(fStack_158); scratchVec.y = scratchVec.y * 7.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,0,&projParams); iVar8 = npc->_projectileCooldown; } npc->_projectileCooldown = iVar8 + 0x1e; } fVar14 = npc->_speedMultiplier; fVar17 = (npc->_targetPosition).y; auVar16 = ZEXT812(0x3f6e147b); (npc->_velocity).x = fVar14 * (npc->_targetPosition).x + (npc->_velocity).x; (npc->_velocity).y = fVar17 * fVar14 + (npc->_velocity).y; fVar14 = npc->_speedMultiplier; if (fVar14 != 1.0) { fVar17 = auVar16._0_4_; auVar16._4_8_ = auVar16._4_8_; auVar16._0_4_ = fVar17 / ((fVar14 + fVar17) - fVar14 * fVar17); } (npc->_targetPosition).y = auVar16._0_4_ * (npc->_targetPosition).y; (npc->_targetPosition).x = auVar16._0_4_ * (npc->_targetPosition).x; } goto LAB_0043f5a8; } } } npc->_state = 3; npc->_stateFrame = 0; activeRoom = room; break; case 9: npc->_friction = npc->_friction * 0.7; ANM2::Play(&npc->_sprite,s_Attack2,0); npc->_entityGridCollisionClass = 3; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0043f793: activeRoom = room; if (npc->_projectileCooldown < 0) goto LAB_0043f763; iVar8 = Room::GetGridCollisionAtPos(room,npc->_pos); if (iVar8 == 0) { npc->_entityGridCollisionClass = 5; } npc->_friction = npc->_friction * 0.5; } else { bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar5 != 0) { Game::ShakeScreen(g_game,5); manager = g_manager; uStack_184 = 0x48; seed_fart_sound_override((int *)&uStack_184); SoundEffects::Play(&manager->_sfxManager,uStack_184,1.0,2,0,1.0,0.0); npc->_projectileCooldown = 0; uVar6 = Random(); position = &npc->_pos; tmpEntity = Game::SpawnEx(g_game,1000,0x16,position,&g_vectorZero,(Entity *)npc,0,uVar6,0); (tmpEntity->_sprite)._scale.x = 1.5; (tmpEntity->_sprite)._scale.y = 1.5; pAVar12 = &tmpEntity[1]._sprite; (pAVar12->_filename)._buf[8] = 'Z'; (pAVar12->_filename)._buf[9] = '\0'; (pAVar12->_filename)._buf[10] = '\0'; (pAVar12->_filename)._buf[0xb] = '\0'; pAVar12 = &tmpEntity[1]._sprite; (pAVar12->_filename)._buf[0xc] = 'Z'; (pAVar12->_filename)._buf[0xd] = '\0'; (pAVar12->_filename)._buf[0xe] = '\0'; (pAVar12->_filename)._buf[0xf] = '\0'; ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.099; scratchVec.x = 5.0; scratchVec.y = 14.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); scratchVec.x = 10.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,8,&projParams); } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"), bVar5 == 0)) goto LAB_0043f793; npc->_projectileCooldown = -1; LAB_0043f763: activeRoom = room; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; } break; case 10: if (npc->_projectileCooldown == -1) { npc->_friction = npc->_friction * 0.8; ANM2::Play(&npc->_sprite,&DAT_00b1d2e4,0); bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar5 != 0) { uVar6 = Random(); dirX = (float)&DAT_bf800000; if ((uVar6 & 1) == 0) { dirX = 1.0; } (npc->_targetPosition).x = dirX; (npc->_targetPosition).y = (float)&DAT_bf800000; (npc->_sprite)._flipX = dirX < 0.0; Vector::Normalize(&npc->_targetPosition); npc->_projectileCooldown = 0; } } else if (npc->_projectileCooldown == -2) { npc->_friction = npc->_friction * 0.9; ANM2::Play(&npc->_sprite,(byte *)"Attack3End",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; } } if (-1 < npc->_projectileCooldown) { pAVar12 = &npc->_sprite; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(pAVar12,(byte *)"Attack3Loop",0); } npc->_friction = 0.98; fVar14 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (0 < (int)fVar14) { do { npc->_projectileCooldown = npc->_projectileCooldown + 1; manager = g_manager; fStack_158 = (float)((int)fVar14 + -1); if ((npc->_projectileCooldown & 1) == 0) { iStack_148 = 0xb9; seed_fart_sound_override(&iStack_148); SoundEffects::Play(&manager->_sfxManager,iStack_148,1.0,2,0,1.0,0.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.099; uVar6 = Random(); projParams.HeightModifier = -10.0; projParams.Scale = ((float)((uVar6 & 3) + 4) - 3.0) / 3.0; shotVelocity.x = (npc->_targetPosition).x * -5.0; shotVelocity.y = (npc->_targetPosition).y * -5.0; uVar6 = Random(); fVar14 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; shotVelocity.x = shotVelocity.x * fVar14; shotVelocity.y = shotVelocity.y * fVar14; uVar6 = Random(); pEStack_16c = (Entity *) (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292); pGStack_170 = (Game *)cos((float)pEStack_16c); fVar14 = sin((float)pEStack_16c); fVar17 = shotVelocity.x * fVar14; shotVelocity.x = shotVelocity.x * (float)pGStack_170 - shotVelocity.y * fVar14; shotVelocity.y = fVar17 + shotVelocity.y * (float)pGStack_170; scratchVec.x = (npc->_pos).x - (npc->_targetPosition).x * 12.0; scratchVec.y = (npc->_pos).y - 4.0; Entity_NPC::FireProjectiles(npc,&scratchVec,&shotVelocity,0,&projParams); spawnSeed = Random(); pGStack_170 = g_game; spawnSubType = 0; spawnVariant = 0x4f; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&scratchVec,&g_vectorZero, (Entity *)0x0,(int *)&spawnSubType,&spawnSeed); uVar6 = spawnVariant; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0043fe09: resolvedSubType = spawnSubType; } else { piStack_168 = (g_game->_deathmatchManager)._type; uVar7 = Random(); piVar9 = piStack_168; uVar11 = spawnSubType; uStack_110 = 0x900000005; uStack_15c = 7; uStack_108 = 7; uStack_184 = uVar7; if (spawnType != 5) goto LAB_0043fe09; if (uVar6 < 0x12d) { if (uVar6 == 300) { while ((resolvedSubType = spawnSubType, spawnSubType == 0 || (isBanned = (**(code **)(*piStack_168 + 0x24))(spawnSubType), isBanned != '\0'))) { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)uStack_110 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)uStack_110 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)uStack_15c & 0x1f) ^ uVar7; iVar8 = ItemPool::GetCardEx(uVar7,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar7; spawnSubType = lua_callback_run_get_card(&cardRng,iVar8,1,1,0); } } else { if (uVar6 == 0x46) { pEStack_16c = (Entity *)(spawnSubType >> 0xb); do { resolvedSubType = spawnSubType; if (spawnSubType != 0) { pcVar2 = *(code **)(*piStack_168 + 0x28); iVar8 = ItemPool::GetPillEffect (&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0); isBanned = (*pcVar2)(iVar8); if (isBanned == '\0') goto LAB_0043fe11; uVar7 = uStack_184; } if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)uStack_110 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)uStack_110 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)uStack_15c & 0x1f) ^ uVar7; uStack_184 = uVar7; spawnSubType = ItemPool::GetPill(uVar7); spawnSubType = spawnSubType | ((uint)pEStack_16c & 1) << 0xb; } while( true ); } if (uVar6 != 100) goto LAB_0043fe09; resolvedSubType = spawnSubType; if (spawnSubType == 0x19) { LAB_0043fc4b: bVar13 = false; } else { subTypeKey = spawnSubType; std::set::find_node(auStack_100,&subTypeKey); if (((*(char *)(iStack_f8 + 0xd) == '\0') && (*(int *)(iStack_f8 + 0x10) <= (int)uVar11)) && (iStack_f8 != piVar9[8])) goto LAB_0043fc4b; bVar13 = true; } if ((uVar11 == 0) || (bVar13)) { spawnSubType = (**(code **)(*piVar9 + 0x84))(0); resolvedSubType = spawnSubType; } } } else { if (uVar6 != 0x15e) goto LAB_0043fe09; while ((resolvedSubType = spawnSubType, spawnSubType == 0 || (isBanned = (**(code **)(*piStack_168 + 0x2c))(spawnSubType), isBanned != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0043fe11: pEStack_16c = EntityFactory::Create(pGStack_170->_entityFactory,spawnType,0); lVar3 = CONCAT44(iStack_148,pGStack_170); if (pEStack_16c != (Entity *)0x0) { uVar18 = GetTimeNs(); tmpEntity = pEStack_16c; uVar11 = (uint)(uVar18 >> 0x20); lVar3 = (uVar18 & 0xffffffff) * 0x431bde82; uStack_138 = (undefined4)((ulonglong)lVar3 >> 0x20); uVar18 = (ulonglong)uVar11 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20) ; uVar7 = (uint)(uVar18 >> 0x20); lVar3 = lVar3 + (uVar18 & 0xffffffff); piStack_168 = (int *)lVar3; uVar6 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = (ulonglong)uVar11 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar7,uVar6),uVar7 + uVar6); pEStack_16c->_spawnerType = 0; uStack_184 = (uint)((ulonglong)lVar3 >> 0x20); pEStack_16c->_spawnerVariant = 0; uStack_15c = (uint)lVar3 >> 0x12 | uStack_184 * 0x4000; uStack_184 = uStack_184 >> 0x12; spawnerRef = &pEStack_16c->_spawnerEntity; if (*spawnerRef != (EntityPtr)0x0) { pEStack_128 = spawnerRef; std::multiset::erase(&pEStack_128); } iVar8 = *(int *)tmpEntity; *spawnerRef = (EntityPtr)0x0; (tmpEntity->_pos).x = scratchVec.x; (tmpEntity->_pos).y = scratchVec.y; (tmpEntity->_velocity).x = g_vectorZero.x; (tmpEntity->_velocity).y = g_vectorZero.y; (**(code **)(iVar8 + 4))(spawnType,spawnVariant,resolvedSubType,spawnSeed); game = pGStack_170; pvVar10 = pGStack_170->_room; iVar8 = *(int *)((int)pvVar10 + 0x1214); *(int *)((int)pvVar10 + 0x1214) = iVar8 + 1; tmpEntity->_index = iVar8; EntityList::AddEntity((EntityList *)((int)pvVar10 + 0x1218),tmpEntity); bVar5 = Game::ShouldEraseEnemy(tmpEntity); if (bVar5 != 0) { Entity::RemoveWithPoof(tmpEntity,unusedArg); } if ((tmpEntity->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { triggerKeyType = tmpEntity->_type; triggerKeyVariant = tmpEntity->_variant; std::map::find(&triggerNode,&triggerKeyType); if (triggerNode == (game->_proceduralItemManager)._spawnTriggerTargets._head) { triggerKeyAnyVariant[0] = tmpEntity->_type; triggerKeyAnyVariant[1] = 0xffffffff; piVar9 = (int *)std::map::find (auStack_104,triggerKeyAnyVariant); triggerNode = (void *)*piVar9; if (triggerNode == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_0044008d; } playerManager = &g_game->_playerManager; piStack_168 = (int *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (playerManager->_playerList)._end; } piVar9 = (playerManager->_playerList)._begin; if (piStack_168 < (int *)((int)pvVar10 - (int)piVar9 >> 2)) { piVar9 = piVar9 + (int)piStack_168; } trigger_set_dispatch ((void *)(*piVar9 + 0x1fc8),6,tmpEntity,&scratchVec,&g_vectorZero); playerManager = &g_game->_playerManager; piStack_168 = (int *)((int)piStack_168 + 1); } while (piStack_168 < (int *)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0044008d: uVar18 = GetTimeNs(); uVar6 = (uint)(uVar18 >> 0x20); lVar4 = (uVar18 & 0xffffffff) * 0x431bde82; spawnSeed = (uint)((ulonglong)lVar4 >> 0x20); lVar3 = (ulonglong)uVar6 * 0x431bde82; uVar18 = (ulonglong)uVar6 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); uVar11 = (uint)(uVar18 >> 0x20); lVar4 = lVar4 + (uVar18 & 0xffffffff); uStack_138 = (undefined4)lVar4; uVar6 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar11,uVar6),uVar11 + uVar6); uVar7 = (uint)((ulonglong)lVar4 >> 0x20); uVar6 = (uint)lVar4 >> 0x12 | uVar7 * 0x4000; uVar11 = uVar6 - uStack_15c; bVar13 = CARRY4((uint)g_entitySpawnTimeMs,uVar11); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar11; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar7 >> 0x12) - uStack_184) - (uint)(uVar6 < uStack_15c)) + (uint)bVar13; } tmpEntity = pEStack_16c; iStack_148 = (int)((ulonglong)lVar3 >> 0x20); pGStack_170 = (Game *)lVar3; uVar6 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar6 = Random(); creepColor = &(tmpEntity->_sprite)._color; uStack_c4 = 0x3f0c8c8d; uStack_c0 = 0x3d30b0b1; uStack_bc = 0x3d70f0f2; fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.8; fVar14 = fVar17 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar17 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar14; uStack_d4 = 0; uStack_d0 = 0; uStack_cc = 0; uStack_c8 = 0; uStack_e4 = 0; uStack_e0 = 0; uStack_dc = 0; uStack_d8 = 0x3f800000; if (creepColor != (ColorMod *)&uStack_e4) { (tmpEntity->_sprite)._color._colorize[0] = 0.0; (tmpEntity->_sprite)._color._colorize[1] = 0.0; (tmpEntity->_sprite)._color._colorize[2] = 0.0; (tmpEntity->_sprite)._color._colorize[3] = 0.0; (tmpEntity->_sprite)._color._offset[0] = 0.54901963; (tmpEntity->_sprite)._color._offset[1] = 0.043137256; creepColor->_tint[0] = 0.0; (tmpEntity->_sprite)._color._tint[1] = 0.0; (tmpEntity->_sprite)._color._tint[2] = 0.0; (tmpEntity->_sprite)._color._tint[3] = 1.0; (tmpEntity->_sprite)._color._offset[2] = 0.058823533; } (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -33.0; pfVar1 = &(local_13c->_targetPosition).y; npc = local_13c; if (*pfVar1 <= 0.0 && *pfVar1 != 0.0) { tmpEntity->_renderDepthOffset = 10.0; } } fVar14 = fStack_158; } while (0 < (int)fStack_158); pAVar12 = &npc->_sprite; } if (npc->_collidesWithGrid != 0) { fVar14 = (npc->_targetPosition).x; if (((0.0 < fVar14) && (0.2 < (npc->_gridCollisionNormal).x)) || ((fVar14 < 0.0 && ((npc->_gridCollisionNormal).x <= -0.2 && (npc->_gridCollisionNormal).x != -0.2)))) { (npc->_targetPosition).x = -fVar14; } fVar14 = (npc->_targetPosition).y; if (((0.0 < fVar14) && (0.2 < (npc->_gridCollisionNormal).y)) || ((fVar14 < 0.0 && (pfVar1 = &(npc->_gridCollisionNormal).y, *pfVar1 <= -0.2 && *pfVar1 != -0.2)))) { (npc->_targetPosition).y = -fVar14; } fVar14 = (npc->_velocity).x; fVar17 = (npc->_velocity).y; local_13c = (Entity_NPC *)sqrtf(fVar14 * fVar14 + fVar17 * fVar17); if (0.0 < (float)local_13c) { fVar14 = (npc->_gridCollisionVelocity).y; fVar17 = (npc->_gridCollisionVelocity).x; fVar14 = sqrtf(fVar17 * fVar17 + fVar14 * fVar14); (npc->_velocity).y = (fVar14 / (float)local_13c) * (npc->_velocity).y; (npc->_velocity).x = (fVar14 / (float)local_13c) * (npc->_velocity).x; } } anim = "Attack3Loop"; if (0.0 < (npc->_targetPosition).y) { anim = "Attack3BackLoop"; } ANM2::Play(pAVar12,(byte *)anim,0); fVar14 = (npc->_targetPosition).x; (npc->_sprite)._flipX = fVar14 < 0.0; fVar17 = (npc->_targetPosition).y; fVar15 = npc->_speedMultiplier; (npc->_velocity).x = fVar14 * 0.4 * fVar15 + (npc->_velocity).x; (npc->_velocity).y = fVar17 * 0.4 * fVar15 + (npc->_velocity).y; if (0x6e < npc->_projectileCooldown) { pfVar1 = &(npc->_targetPosition).y; activeRoom = room; if (*pfVar1 <= 0.0 && *pfVar1 != 0.0) { (npc->_sprite)._flipX = 0; npc->_projectileCooldown = -2; } break; } } goto LAB_0043f5a8; case 0x10: ANM2::Play(&npc->_sprite,(byte *)"Leave",0); npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; if (npc->_projectileCooldown == -2) { fVar14 = (npc->_targetPosition).y; fVar17 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_targetPosition).x * 0.75 * fVar17 + (npc->_velocity).x; (npc->_velocity).y = fVar14 * 0.75 * fVar17 + (npc->_velocity).y; fVar14 = npc->_friction * 0.98; } else { bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); game = g_game; if (bVar5 != 0) { npc->_projectileCooldown = -2; pvVar10 = game->_room; fVar15 = (*(float *)((int)pvVar10 + 0x1c) - *(float *)((int)pvVar10 + 0x14)) * 0.5 + *(float *)((int)pvVar10 + 0x14); fVar14 = (npc->_pos).x; fVar17 = (npc->_pos).x; (npc->_targetPosition).y = 0.0; if (fVar15 < fVar17 || fVar15 == fVar14) { (npc->_targetPosition).x = 1.0; (npc->_sprite)._flipX = 0; } else { (npc->_targetPosition).x = (float)&DAT_bf800000; (npc->_sprite)._flipX = 1; } } fVar14 = npc->_friction * 0.8; } activeRoom = room; npc->_friction = fVar14; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined4 *)&room->field_0x73f0 = 0xffffffff; (**(code **)(*(int *)npc + 0x28))(); Room::TriggerBossDeath(g_game->_room,(Entity *)npc); break; } LAB_0043f5a8: activeRoom = room; } if ((0 < *(int *)&activeRoom->field_0x73f0) && (0.0 < npc->_pendingDamage)) { *(int *)&activeRoom->field_0x73f0 = g_game->_frameCount; } return; } //@@ 004405e0 FUN_004405e0 void FUN_004405e0(void) { float in_XMM0_Da; ceil((double)in_XMM0_Da); return; } //@@ 00440610 Game::GetDarknessModifier /* ZHL [lua] Lua binding Game:GetDarknessModifier */ float10 __thiscall Game::GetDarknessModifier(Game *this) { return (float10)this->_darknessModifier; } //@@ 00440620 Game::GetTargetDarkness /* ZHL [lua] Lua binding Game:GetTargetDarkness */ float10 __thiscall Game::GetTargetDarkness(Game *this) { return (float10)this->_darknessStrength; } //@@ 00440630 NpcAI::ENTITY_BEAST_background /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dispatcher case for The Beast (951) variants 100-104 (BACKGROUND_BEAST/FAMINE/PESTILENCE/WAR/DEATH); Cheer, Leave, ScreamStart/Stop, Shoot anims */ void __fastcall NpcAI::ENTITY_BEAST_background(Entity_NPC *npc) { Entity *pEVar1; ANM2 *pAVar2; byte bVar3; int iVar4; uint uVar5; Entity *effect; undefined4 color; LayerState *layer; byte *animNameChar; char *expectedChar; byte *expectedByte; float unaff_ESI; ColorMod *spriteColor; bool bVar6; float fVar7; double dVar8; float afStack_b4 [3]; float local_a8; float local_a4; float roomLeft; undefined1 local_9c [44]; undefined4 effectColor; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_44; void *animData; AnimationState *animState; byte *curAnimData; uint *flagsHigh; Game *game; Manager *manager; qword oldFlags; int vtable; local_44 = __security_cookie ^ (uint)afStack_b4; roomLeft = *(float *)((int)g_game->_room + 0x14); local_a4 = *(float *)((int)g_game->_room + 0x1c); if (npc->_dead != 0) { npc->_dead = 0; } iVar4 = npc->_state; if (iVar4 == 0) { oldFlags = npc->_flags; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0xc4050001; curAnimData = (npc->_sprite)._animState._animData; if (curAnimData == (byte *)0x0) { LAB_00440d16: bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { animNameChar = *(byte **)curAnimData; } expectedByte = s_Idle; do { bVar3 = *animNameChar; bVar6 = bVar3 < *expectedByte; if (bVar3 != *expectedByte) { LAB_00440d00: uVar5 = -(uint)bVar6 | 1; goto LAB_00440d05; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; bVar6 = bVar3 < expectedByte[1]; if (bVar3 != expectedByte[1]) goto LAB_00440d00; animNameChar = animNameChar + 2; expectedByte = expectedByte + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00440d05: if ((uVar5 != 0) || ((curAnimData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00440d16; } npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_sortingLayer = 0; npc->_isInvicible = 1; } else { if (iVar4 == 4) { animData = (npc->_sprite)._animState._animData; if (npc->_variant == 100) { animState = &(npc->_sprite)._animState; if ((animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"ScreamStart"), manager = g_manager, bVar3 != 0)) { local_a8 = 9.92119e-43; seed_fart_sound_override((int *)&local_a8); SoundEffects::Play(&manager->_sfxManager,(int)local_a8,1.0,2,0,1.0,0.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,&DAT_00b1d33c); manager = g_manager; if (bVar3 != 0) { local_a8 = 9.79508e-43; seed_fart_sound_override((int *)&local_a8); SoundEffects::Play(&manager->_sfxManager,(int)local_a8,1.0,2,0,1.0,0.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"ScreamStart"); if ((bVar3 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"ScreamStop"), bVar3 == 0)))) { Game::ShakeScreen(g_game,8); iVar4 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar4 != 0) { dVar8 = ceil(17.77777862548828); local_a8 = (float)dVar8; uVar5 = Random(); effect = Game::SpawnEx(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)npc,10, uVar5,0); (effect->_posOffset).x = 0.0; (effect->_posOffset).y = -80.0; color = Color::Color(); (**(code **)(*(int *)effect + 0x3c))(color,0xffffffff,0xff,0); pEVar1 = effect + 1; (pEVar1->_sprite)._filename._buf[0] = '\0'; (pEVar1->_sprite)._filename._buf[1] = '\0'; (pEVar1->_sprite)._filename._buf[2] = ' '; (pEVar1->_sprite)._filename._buf[3] = 'A'; *(int *)(effect[1]._sprite._filename._buf + 8) = (int)dVar8 * 2; *(int *)(effect[1]._sprite._filename._buf + 0xc) = (int)dVar8 * 2; iVar4 = *(int *)effect; pAVar2 = &effect[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\x16'; (pAVar2->_filename)._buf[7] = 'C'; (**(code **)(iVar4 + 0xc))(); uVar5 = Random(); iVar4 = 0; local_a4 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; do { uVar5 = Random(); effect = Game::SpawnEx(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)npc,0xb ,uVar5,0); uVar5 = Random(); (effect->_posOffset).x = 0.0; (effect->_posOffset).y = -80.0; uStack_50 = 0; vtable = *(int *)effect; uStack_4c = 0; uStack_48 = 0; uStack_60 = 0; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; effectColor = 0x3f800000; uStack_6c = 0x3e4ccccd; uStack_68 = 0x3e4ccccd; uStack_64 = 0x3f800000; (effect->_sprite)._rotation = ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) + (float)iVar4 * 120.0 + local_a4; (**(code **)(vtable + 0x3c))(&effectColor,0xffffffff,0xff,0); *(int *)(effect[1]._sprite._filename._buf + 8) = (int)unaff_ESI; *(int *)(effect[1]._sprite._filename._buf + 0xc) = (int)unaff_ESI; uVar5 = Random(); pEVar1 = effect + 1; (pEVar1->_sprite)._filename._buf[0] = '\0'; (pEVar1->_sprite)._filename._buf[1] = '\0'; (pEVar1->_sprite)._filename._buf[2] = ' '; (pEVar1->_sprite)._filename._buf[3] = 'A'; *(float *)(effect[1]._sprite._filename._buf + 4) = ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.15 + 0.15) * 500.0; uVar5 = Random(); afStack_b4[0] = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.6; layer = ANM2::GetLayer(&effect->_sprite,(byte *)0x0); (layer->_size).y = afStack_b4[0]; (**(code **)(*(int *)effect + 0xc))(); iVar4 = iVar4 + 1; } while (iVar4 < 3); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00440d67; } } (**(code **)(*(int *)npc + 0x28))(); goto LAB_00440d67; } if ((animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { curAnimData = (npc->_sprite)._animState._animData; if (curAnimData != (byte *)0x0) { animNameChar = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { animNameChar = *(byte **)curAnimData; } expectedChar = "Leave"; do { bVar3 = *animNameChar; bVar6 = bVar3 < (byte)*expectedChar; if (bVar3 != *expectedChar) { LAB_00440b38: uVar5 = -(uint)bVar6 | 1; goto LAB_00440b3d; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; bVar6 = bVar3 < (byte)expectedChar[1]; if (bVar3 != expectedChar[1]) goto LAB_00440b38; animNameChar = animNameChar + 2; expectedChar = expectedChar + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00440b3d: if ((uVar5 == 0) && ((curAnimData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00440b70; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Leave",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_00440b70: if ((((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) || ((animData = (npc->_sprite)._animState._animData, animData != (void *)0x0 && (*(char *)((int)animData + 0x34) != '\0')))) { fVar7 = npc->_speedMultiplier; iVar4 = npc->_variant; (npc->_velocity).x = fVar7 * (npc->_v1).x + (npc->_velocity).x; (npc->_velocity).y = fVar7 * 0.0 + (npc->_velocity).y; switch(iVar4) { case 0x65: case 0x67: fVar7 = (npc->_v1).x - npc->_speedMultiplier * 0.8; if (fVar7 <= -8.0) { fVar7 = -8.0; } (npc->_v1).x = fVar7; break; case 0x66: fVar7 = (npc->_v1).x - npc->_speedMultiplier * 0.4; if (fVar7 <= -5.0) { fVar7 = -5.0; } (npc->_v1).x = fVar7; break; case 0x68: fVar7 = npc->_speedMultiplier * 0.3 + (npc->_v1).x; if (5.0 <= fVar7) { fVar7 = 5.0; } (npc->_v1).x = fVar7; } fVar7 = (npc->_pos).x; if ((fVar7 < roomLeft - 200.0) || (local_a4 + 200.0 < fVar7)) { (**(code **)(*(int *)npc + 0x28))(); } } goto LAB_00440d67; } if (iVar4 != 8) goto LAB_00440d67; if (0 < npc->_stateFrame) { iVar4 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; npc->_stateFrame = iVar4; if (iVar4 < 1) { ANM2::Play(&npc->_sprite,(byte *)"Cheer",0); npc->_stateFrame = 0; } goto LAB_00440d67; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00440d67; ANM2::Play(&npc->_sprite,s_Idle,0); } npc->_state = 3; LAB_00440d67: game = g_game; npc->_friction = npc->_friction * 0.8; spriteColor = &(npc->_sprite)._color; fVar7 = 1.0 - game->_darknessStrength * game->_darknessModifier * 0.96; if (spriteColor != (ColorMod *)local_9c) { (npc->_sprite)._color._colorize[0] = 0.0; (npc->_sprite)._color._colorize[1] = 0.0; (npc->_sprite)._color._colorize[2] = 0.0; (npc->_sprite)._color._colorize[3] = 0.0; spriteColor->_tint[0] = fVar7; (npc->_sprite)._color._tint[1] = fVar7; (npc->_sprite)._color._tint[2] = fVar7; (npc->_sprite)._color._tint[3] = 1.0; (npc->_sprite)._color._offset[0] = 0.0; (npc->_sprite)._color._offset[1] = 0.0; (npc->_sprite)._color._offset[2] = 0.0; } return; } //@@ 00440e30 AnimationState::GetAnimationLength /* DB: _animData(+4)->_length(+0x30) prototype: db/protos.zhl */ int __thiscall AnimationState::GetAnimationLength(AnimationState *this) { if (this->_animData == (void *)0x0) { return 0; } return *(int *)((int)this->_animData + 0x30); } //@@ 00440e40 Sprite::GetLayerCount /* ZHL [lua] Lua binding Sprite:GetLayerCount */ int __thiscall Sprite::GetLayerCount(Sprite *this) { return this->_layerCount; } //@@ 00440e50 set_PlaybackSpeed /* DB: src/anm2 decompile labels (set_PlaybackSpeed) prototype: db/protos.zhl, confirmed by RET 4 */ void __fastcall set_PlaybackSpeed(ANM2 *sprite,float speed) { sprite->_playbackSpeed = speed; return; } //@@ 00440e70 FUN_00440e70 bool FUN_00440e70(void) { int in_ECX; return 0.0 < *(float *)(in_ECX + 0x20); } //@@ 00440e80 FUN_00440e80 void FUN_00440e80(Vector *param_1) { Capsule *in_ECX; Capsule *in_EDX; Capsule::Collide(in_ECX,in_EDX,param_1); return; } //@@ 00440e90 FUN_00440e90 void FUN_00440e90(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x354) = param_1; return; } //@@ 00440ea0 FUN_00440ea0 void FUN_00440ea0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x148) = param_1; return; } //@@ 00440eb0 Entity::GridCollisionClass /* ZHL [lua] Lua binding Entity:GridCollisionClass */ int __thiscall Entity::GridCollisionClass(Entity *this) { return this->_entityGridCollisionClass; } //@@ 00440ec0 FUN_00440ec0 int FUN_00440ec0(void) { int in_ECX; return in_ECX + 0x1618; } //@@ 00440ed0 FUN_00440ed0 void FUN_00440ed0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xb64) = param_1; return; } //@@ 00440ee0 Game::Darken /* ZHL [lua] Lua binding Game:Darken */ void __thiscall Game::Darken(Game *this,float param_2,int param_3) { this->_darknessStrength = param_2; this->_darknessTimeout = param_3; return; } //@@ 00440f00 NpcAI::ENTITY_BEAST_ultra_death /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 951 Beast variant switch case 0x28 (variant 40 Ultra Death) at 006c4186; anims Swing/SwingPrepare(Loop)/SummonStart/Loop/End, spawns 951.41 (scythe) and 951.42 (skull) on "Shoot" event; npc_ai.tsv only lists NpcAI::ENTITY_BEAST */ void __fastcall NpcAI::ENTITY_BEAST_ultra_death(Entity_NPC *npc) { ANM2 *pAVar1; byte bVar2; uint uVar3; uint uVar4; Entity *pEVar5; Entity *playerTarget; EntityPtr linkedEffect; ColorMod *color; Vector *pVVar6; byte *strCursor; void *pvVar7; int iVar8; Vector *pVVar9; undefined4 uVar10; LayerState *layer; MusicManager *musicManager; char *pcVar11; int iVar12; undefined1 *puVar13; code *vfn; byte *pbVar14; bool bVar15; float fVar16; float fVar17; Entity_NPC *pEVar18; float fVar19; Entity_NPC *pEVar20; float fVar21; float candidateX; EntityList_EL capsuleHits; Room *room; Entity_NPC *self; float layerAlpha; float roomTop; Vector local_100; char local_f8 [4]; void *skullListData; Vector local_f0; Vector local_e8; float roomRight; float roomLeft; int elapsedFrames; Vector local_d4; Vector local_cc; float local_c4; undefined1 skullQuery [4]; int skullQueryData; Vector local_b8; Vector local_b0 [6]; undefined4 fadeColor; EntityRef EStack_78; undefined4 spawnColor; Vector VStack_4c; float fStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; Vector VStack_18; uint *flagsHigh; Game *game; Manager *manager; int *queriedNpc; pvVar7 = ExceptionList; manager = g_manager; puStack_20 = (undefined1 *)&local_b0[0x15].y; VStack_18.y = -NAN; VStack_18.x = (float)&LAB_00af2386; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_b0 + 0x14); elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; room = g_game->_room; iVar8 = npc->_aiCallPhase; self = npc; local_24 = uVar3; if (iVar8 == 1) { if (npc->_state != 0x12) { return; } fVar17 = npc->_speedMultiplier; ExceptionList = &local_1c; npc->_friction = 0.8; (npc->_velocity).x = fVar17 * 0.0 + (npc->_velocity).x; (npc->_velocity).y = fVar17 * 0.4 + (npc->_velocity).y; if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = pvVar7; return; } puStack_20 = (undefined1 *)&local_b0[0x15].y; AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Explosion"); ExceptionList = local_1c; return; } roomLeft = (room->_topLeftPos).x; roomTop = (room->_topLeftPos).y; roomRight = (room->_bottomRightPos).x; local_c4 = (room->_bottomRightPos).y; if ((iVar8 == 4) || (iVar8 == 2)) { linkedEffect = npc->_entityRef; if (linkedEffect == (EntityPtr)0x0) { return; } if (npc->_state == 0x10) { ExceptionList = &local_1c; Entity::GetNullOffset((Entity *)npc,&local_b8,&DAT_00b1d34c); if ((local_b8.x != g_vectorZero.x) || (local_b8.y != g_vectorZero.y)) { linkedEffect = npc->_entityRef; layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000004); *(float *)((int)linkedEffect + 0xfc) = (layer->_color)._tint[3]; fVar17 = (npc->_pos).y; linkedEffect = npc->_entityRef; *(float *)((int)linkedEffect + 0x33c) = local_b8.x + (npc->_pos).x; *(float *)((int)linkedEffect + 0x340) = fVar17 + local_b8.y; ExceptionList = local_1c; return; } linkedEffect = npc->_entityRef; } *(undefined4 *)((int)linkedEffect + 0xfc) = 0; ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = (undefined1 *)&local_b0[0x15].y; if (npc->_dead != 0) { local_cc.y = 9.66896e-43; puStack_20 = (undefined1 *)&local_b0[0x15].y; seed_fart_sound_override((int *)&local_cc.y); SoundEffects::Play(&manager->_sfxManager,(int)local_cc.y,1.0,2,0,1.0,0.0); local_b8.x = -8.0; local_b8.y = -13.0; uVar4 = Random(); local_f0.x = (npc->_pos).x + 0.0; local_f0.y = (npc->_pos).y - 60.0; pEVar5 = Game::Spawn(g_game,1000,199,&local_f0,&local_b8,(Entity *)0x0,0,uVar4); playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar17 = (npc->_pos).x; if ((playerTarget->_pos).x <= fVar17 && fVar17 != (playerTarget->_pos).x) { (pEVar5->_velocity).x = 8.0; (pEVar5->_velocity).y = -13.0; (pEVar5->_sprite)._flipX = 1; } (**(code **)(*(int *)pEVar5 + 0xc))(); } game = g_game; layerAlpha = 1.0; switch(npc->_state) { case 0: npc->_state = 3; pVVar9 = &npc->_pos; (npc->_targetPosition).x = pVVar9->x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_pathfinder)._movementTarget.x = pVVar9->x; (npc->_pathfinder)._movementTarget.y = (npc->_pos).y; pVVar6 = MusicManager::RandomVector(&local_b8); musicManager = &g_manager->_musicManager; fVar17 = pVVar6->y; fVar19 = pVVar6->x; uVar10 = *(undefined4 *)((int)&npc->_flags + 4); npc->_aiCallFlags = npc->_aiCallFlags | 0xb; *(uint *)&npc->_flags = (uint)npc->_flags | 0x44000000; (npc->_pathfinder)._moveDirection.x = fVar19; (npc->_pathfinder)._moveDirection.y = fVar17 * 0.5; (npc->_pathfinder)._moveCountdown = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar10; npc->_stateFrame = 0; npc->_i1 = 0; musicManager->_channels[musicManager->_currentChannel]._enabledLayers = 0; MusicManager::EnableLayer(musicManager,2,0); uVar3 = Random(); linkedEffect = (EntityPtr) Game::Spawn(g_game,1000,0xa6,pVVar9,&g_vectorZero,(Entity *)npc,0,uVar3); color = (ColorMod *)Color::Color(0x3f800000); Sprite::SetColor((Sprite *)((int)linkedEffect + 0x48),color); fVar17 = g_vectorOne.x; fVar19 = g_vectorOne.y * 2.0; pAVar1 = (ANM2 *)((int)linkedEffect + 0x454); (pAVar1->_filename)._buf[0] = -0x52; (pAVar1->_filename)._buf[1] = 'G'; (pAVar1->_filename)._buf[2] = -0x1f; (pAVar1->_filename)._buf[3] = '='; pcVar11 = (char *)((int)linkedEffect + 0x458); pcVar11[0] = -0x52; pcVar11[1] = 'G'; pcVar11[2] = -0x1f; pcVar11[3] = '='; *(float *)((int)linkedEffect + 0xe8) = fVar19; ((Vector *)((int)linkedEffect + 0xe4))->x = fVar17 * 2.0; if (*(EntityPtr *)((int)linkedEffect + 0x3bc) != (EntityPtr)0x0) { local_b0[0].y = (float)((int)linkedEffect + 0x3bc); std::multiset::erase(&local_b0[0].y); } *(EntityPtr *)((int)linkedEffect + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)linkedEffect + 0x3bc)); if (npc->_entityRef != (EntityPtr)0x0) { local_b0[0].y = (float)&npc->_entityRef; std::multiset::erase(&local_b0[0].y); } npc->_entityRef = linkedEffect; std::multiset::insert(&npc->_entityRef); break; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); } npc->_friction = 0.8; local_b0[0].y = (float)Entity_NPC::GetPlayerTarget(npc); fVar17 = (npc->_pos).y; fVar19 = (npc->_pos).x; fVar21 = (((Entity *)local_b0[0].y)->_pos).y; fVar16 = fVar17 - fVar21; local_e8.y = ABS(fVar21 - fVar17); fVar17 = (((Entity *)local_b0[0].y)->_pos).x; fVar21 = fVar19 - fVar17; local_cc.y = ABS(fVar17 - fVar19); fVar17 = sqrtf(fVar16 * fVar16 + fVar21 * fVar21); pVVar9 = &(npc->_pathfinder)._moveDirection; pVVar6 = &local_e8; if (local_cc.y <= local_e8.y) { pVVar6 = &local_cc; } local_cc.y = (160.0 - pVVar6->y) / fVar17; fVar17 = npc->_speedMultiplier; if (local_cc.y <= 0.0) { local_cc.y = 0.0; } if (1.0 <= local_cc.y) { local_cc.y = 1.0; } fVar21 = local_cc.y * 0.8 + 0.55; fVar19 = pVVar9->x; (npc->_velocity).y = fVar21 * (npc->_pathfinder)._moveDirection.y * fVar17 + (npc->_velocity).y; (npc->_velocity).x = fVar21 * fVar19 * fVar17 + (npc->_velocity).x; iVar8 = (npc->_pathfinder)._moveCountdown; if (iVar8 < 1) { uVar3 = Random(); fVar17 = 1e+06; (npc->_pathfinder)._moveCountdown = (int)((1.0 - local_cc.y * 0.6) * ((float)(uVar3 % 0x14 + 0x14) + 0.0)); local_b8.y = ((Vector *)((int)local_b0[0].y + 0x33c))->x; local_100.y = ((Vector *)((int)local_b0[0].y + 0x33c))->y; uVar3 = 0; local_f0.y = roomLeft + 60.0; local_e8.y = local_b8.y; local_d4.y = local_100.y; do { candidateX = *(float *)((int)&DAT_00c5c55c + uVar3) * 120.0 + local_b8.y; fVar16 = *(float *)((int)&DAT_00c5c560 + uVar3) * 120.0 + local_100.y; fVar19 = (npc->_pos).x - candidateX; fVar21 = (npc->_pos).y - fVar16; fVar19 = fVar21 * fVar21 + fVar19 * fVar19; if ((((candidateX < local_f0.y) || (roomRight - 60.0 < candidateX)) || (fVar16 < roomTop + 60.0)) || (local_c4 - 60.0 < fVar16)) { fVar19 = 1e+06; } if (fVar19 < fVar17) { fVar17 = fVar19; local_e8.y = candidateX; local_d4.y = fVar16; } uVar3 = uVar3 + 8; } while (uVar3 < 0x20); (npc->_pathfinder)._movementTarget.x = local_e8.y; (npc->_pathfinder)._movementTarget.y = local_d4.y; pVVar6 = MusicManager::RandomVector(&local_b8); fVar17 = pVVar6->y; fVar19 = (npc->_pathfinder)._movementTarget.y; (npc->_pathfinder)._movementTarget.x = pVVar6->x * 20.0 * (1.0 - local_cc.y) + (npc->_pathfinder)._movementTarget.x; (npc->_pathfinder)._movementTarget.y = fVar17 * 20.0 * (1.0 - local_cc.y) + fVar19; } else { (npc->_pathfinder)._moveCountdown = iVar8 - elapsedFrames; } local_d4.y = (npc->_pos).x; local_f0.y = (npc->_pathfinder)._movementTarget.x - local_d4.y; local_e8.y = (npc->_pathfinder)._movementTarget.y - (npc->_pos).y; if ((local_f0.y == g_vectorZero.x) && (local_e8.y == g_vectorZero.y)) { fVar17 = (npc->_pathfinder)._moveDirection.x; } else { fVar17 = sin(npc->_updateTime * 0.01); local_b8.y = fVar17 * 30.0 * 0.017453292; local_100.y = cos(local_b8.y); fVar21 = sin(local_b8.y); fVar19 = npc->_speedMultiplier; fVar16 = local_cc.y * local_cc.y * 0.0019999999 + 0.001; fVar17 = (local_f0.y * local_100.y - fVar21 * local_e8.y) * fVar16 * fVar19 + pVVar9->x; pVVar9->x = fVar17; (npc->_pathfinder)._moveDirection.y = (local_f0.y * fVar21 + local_100.y * local_e8.y) * fVar16 * fVar19 + (npc->_pathfinder)._moveDirection.y; local_d4.y = (npc->_pos).x; } roomTop = roomTop + 100.0; if (roomLeft + 80.0 <= local_d4.y) { if (roomRight - 80.0 < local_d4.y) { fVar19 = ((roomRight - 80.0) - local_d4.y) * 0.01 * npc->_speedMultiplier; goto LAB_004418c1; } } else { fVar19 = ((roomLeft + 80.0) - local_d4.y) * 0.01 * npc->_speedMultiplier; LAB_004418c1: fVar17 = fVar19 + fVar17; pVVar9->x = fVar17; } fVar19 = (npc->_pos).y; if (roomTop <= fVar19) { if (local_c4 - 100.0 < fVar19) { (npc->_pathfinder)._moveDirection.y = ((local_c4 - 100.0) - fVar19) * 0.01 * npc->_speedMultiplier + (npc->_pathfinder)._moveDirection.y; } } else { (npc->_pathfinder)._moveDirection.y = (roomTop - fVar19) * 0.01 * npc->_speedMultiplier + (npc->_pathfinder)._moveDirection.y; } fVar19 = (npc->_pathfinder)._moveDirection.y; local_e8.y = local_d4.y; fVar17 = sqrtf(fVar19 * fVar19 + fVar17 * fVar17); if (fVar17 <= 1.0) { pEVar18 = (Entity_NPC *)local_d4.y; pEVar20 = (Entity_NPC *)local_e8.y; } else { Vector::Normalize(pVVar9); pEVar18 = (Entity_NPC *)(npc->_pos).x; pEVar20 = pEVar18; } fVar17 = ((Vector *)((int)local_b0[0].y + 0x33c))->x; if (fVar17 <= (float)pEVar18 + 10.0) { if (fVar17 < (float)pEVar18 - 10.0) { (npc->_sprite)._flipX = 0; } } else { (npc->_sprite)._flipX = 1; } iVar8 = npc->_stateFrame + elapsedFrames; npc->_stateFrame = iVar8; if (0x3b < iVar8) { if (2 < npc->_i1) { if ((float)pEVar20 <= (roomRight + roomLeft) * 0.5) { puVar13 = &DAT_bf800000; } else { puVar13 = (undefined1 *)0x3f800000; } (npc->_v1).x = (float)puVar13; (npc->_v1).y = 0.0; npc->_aiFloat = 0.1; (npc->_sprite)._flipX = 0.0 < (float)puVar13; npc->_state = 9; goto LAB_0044364a; } ANM2::Play(&npc->_sprite,(byte *)"SummonStart",0); npc->_state = 8; pEVar5 = Entity_NPC::GetPlayerTarget(npc); fVar17 = (pEVar5->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar17 && fVar17 != (npc->_pos).x; npc->_i1 = npc->_i1 + 1; goto LAB_00443654; } break; case 7: ANM2::Play(&npc->_sprite,s_Idle,0); fVar17 = npc->_aiFloat; fVar19 = npc->_speedMultiplier; fVar21 = (npc->_v1).y; (npc->_velocity).x = fVar17 * (npc->_v1).x * fVar19 + (npc->_velocity).x; fVar16 = npc->_aiFloat - fVar19 * 0.07; (npc->_velocity).y = fVar21 * fVar17 * fVar19 + (npc->_velocity).y; if (fVar16 <= 0.2) { fVar16 = 0.2; } npc->_aiFloat = fVar16; manager = g_manager; if (0.1 < fVar16) { fVar17 = (npc->_pos).x; if ((npc->_sprite)._flipX == 0) { fVar19 = roomRight - 200.0; bVar15 = fVar19 < fVar17; } else { fVar19 = roomLeft + 200.0; bVar15 = fVar17 < fVar19; } if (bVar15 || fVar17 == fVar19) break; } local_b0[0].y = 9.69699e-43; seed_fart_sound_override((int *)&local_b0[0].y); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0].y,1.0,2,0,1.0,0.0); npc->_state = 3; LAB_0044364a: npc->_i1 = 0; LAB_00443654: npc->_stateFrame = 0; break; case 8: npc->_friction = npc->_friction * 0.8; pvVar7 = (npc->_sprite)._animState._animData; if (npc->_stateFrame < 0) { if ((pvVar7 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; goto LAB_00443654; } } else { if ((pvVar7 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"SummonLoop",0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_b8.x = (pEVar5->_pos).x - (npc->_pos).x; local_b8.y = (pEVar5->_pos).y - (npc->_pos).y; pVVar9 = Vector::Normalized(&local_b8,&local_f0); fVar17 = pVVar9->y; (npc->_v1).x = pVVar9->x * 500.0; (npc->_v1).y = fVar17 * 500.0; npc->_stateFrame = 1; Entity_NPC::PlaySound(npc,0x2b7,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); } iVar8 = npc->_stateFrame; if ((0 < iVar8) && (local_b0[0].y = 0.0, 0 < elapsedFrames)) { do { local_b8.y = (float)(iVar8 + -6) * 20.0 * 0.017453292; local_f0.y = cos(local_b8.y); fVar21 = sin(local_b8.y); fVar17 = (npc->_v1).x; fVar19 = (npc->_v1).y; local_d4.x = local_f0.y * fVar17 - fVar21 * fVar19; local_d4.y = local_f0.y * fVar19 + fVar21 * fVar17; Entity_Laser::CalculateEndPoint (&local_100,&npc->_pos,&local_d4,&g_vectorZero,(Entity *)0x0,-50.0); uVar3 = Random(); pEVar5 = Game::Spawn(g_game,0x3b7,0x29,&local_100,&g_vectorZero,(Entity *)npc,0,uVar3); local_cc.y = (npc->_pos).x - local_100.x; local_c4 = (npc->_pos).y - local_100.y; fVar17 = sqrtf(local_cc.y * local_cc.y + local_c4 * local_c4); if (0.0 < fVar17) { local_cc.y = local_cc.y * (1.0 / fVar17); local_c4 = local_c4 * (1.0 / fVar17); } uVar3 = Random(); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; flagsHigh = (uint *)((int)&pEVar5->_flags + 4); *flagsHigh = *flagsHigh | 0x80; local_30 = 0x3f800000; local_2c = 1.0; local_28 = 1.0; fVar17 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.0; (pEVar5->_targetPosition).x = local_cc.y * fVar17; (pEVar5->_targetPosition).y = local_c4 * fVar17; spawnColor = 0x3f800000; VStack_4c.x = 1.0; VStack_4c.y = 1.0; fStack_44 = 0.0; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; (**(code **)(*(int *)pEVar5 + 0x3c))(&spawnColor,8,0xff,1,1); (**(code **)(*(int *)pEVar5 + 0xc))(); *(int *)&pEVar5[1].field_0x4 = 0x10 - npc->_stateFrame; if (10 < npc->_stateFrame) { npc->_stateFrame = -1; ANM2::Play(&npc->_sprite,(byte *)"SummonEnd",0); break; } local_b0[0].y = (float)((int)local_b0[0].y + 1); iVar8 = npc->_stateFrame + 1; npc->_stateFrame = iVar8; } while ((int)local_b0[0].y < elapsedFrames); } } break; case 9: pAVar1 = &npc->_sprite; npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(pAVar1,(byte *)"SummonLoop",0); } bVar2 = ANM2::IsPlaying(pAVar1,(byte *)"SummonLoop"); if ((bVar2 != 0) && (local_b8.y = SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x2d9), local_b8.y < 1.0)) { SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x2d9,local_b8.y + 0.05,1.0); } fVar17 = npc->_aiFloat; if (npc->_i1 == 0) { fVar19 = npc->_speedMultiplier; (npc->_velocity).x = fVar17 * (npc->_v1).x * fVar19 + (npc->_velocity).x; (npc->_velocity).y = fVar17 * (npc->_v1).y * fVar19 + (npc->_velocity).y; fVar17 = npc->_speedMultiplier * 0.1 + npc->_aiFloat; if (4.0 <= fVar17) { fVar17 = 4.0; } npc->_aiFloat = fVar17; if ((npc->_stateFrame == 0) && (((fVar17 = (npc->_v1).x, 0.0 < fVar17 && (roomRight - 100.0 < (npc->_pos).x)) || ((fVar17 < 0.0 && ((npc->_pos).x <= roomLeft + 100.0 && roomLeft + 100.0 != (npc->_pos).x) ))))) { npc->_stateFrame = 1; } fVar17 = (npc->_v1).x; pVVar9 = &npc->_pos; if (((0.0 < fVar17) && (roomRight + 200.0 < pVVar9->x)) || ((fVar17 < 0.0 && (pVVar9->x <= roomLeft - 200.0 && roomLeft - 200.0 != pVVar9->x)))) { npc->_i1 = 1; fVar19 = roomRight + 200.0; if (fVar17 <= 0.0) { fVar19 = roomLeft - 200.0; } bVar2 = (npc->_sprite)._flipX; pVVar9->x = fVar19; (npc->_sprite)._flipX = bVar2 == 0; (npc->_pos).y = (local_c4 + roomTop) * 0.5; ANM2::Play(pAVar1,(byte *)"SummonLoop",0); manager = g_manager; local_b0[0].y = 9.75304e-43; seed_fart_sound_override((int *)&local_b0[0].y); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0].y,1.0,2,0,1.0,0.0); } } else { fVar19 = npc->_speedMultiplier; fVar21 = (npc->_v1).y; (npc->_velocity).x = (npc->_velocity).x - fVar17 * (npc->_v1).x * fVar19; (npc->_velocity).y = (npc->_velocity).y - fVar21 * fVar17 * fVar19; fVar17 = npc->_aiFloat - npc->_speedMultiplier * 0.07; if (fVar17 <= 0.2) { fVar17 = 0.2; } npc->_aiFloat = fVar17; } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_b8.x = (pEVar5->_pos).x - (npc->_pos).x; local_b8.y = (pEVar5->_pos).y - (npc->_pos).y; Vector::Normalized(&local_b8,&local_d4); local_b0[0].y = -NAN; do { local_b8.y = (float)(int)local_b0[0].y * 22.5 * 0.017453292; local_f0.y = cos(local_b8.y); fVar17 = sin(local_b8.y); local_100.x = (local_f0.y * local_d4.x - fVar17 * local_d4.y) * 8.0; local_100.y = (fVar17 * local_d4.x + local_f0.y * local_d4.y) * 8.0; uVar3 = Random(); local_e8.x = local_100.x + local_100.x + (npc->_pos).x; local_e8.y = local_100.y + local_100.y + (npc->_pos).y; pEVar5 = Game::Spawn(g_game,0x3b7,0x29,&local_e8,&local_100,(Entity *)npc,0,uVar3); uVar10 = *(undefined4 *)((int)&pEVar5->_flags + 4); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; (pEVar5->_targetPosition).x = local_100.x * 0.1; (pEVar5->_targetPosition).y = local_100.y * 0.1; *(undefined4 *)((int)&pEVar5->_flags + 4) = uVar10; spawnColor = 0x3f800000; VStack_4c.x = 1.0; VStack_4c.y = 1.0; fStack_44 = 1.0; pEVar5->_renderZOffset = 1000; local_30 = 0x3f800000; local_2c = 1.0; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_28 = 1.0; (**(code **)(*(int *)pEVar5 + 0x3c))(&spawnColor,8,0xff,1,1); (**(code **)(*(int *)pEVar5 + 0xc))(); local_b0[0].y = (float)((int)local_b0[0].y + 2); *(undefined4 *)&pEVar5[1].field_0x4 = 0xf; } while ((int)local_b0[0].y < 3); } iVar8 = npc->_stateFrame; if ((0 < iVar8) && (local_e8.y = 0.0, 0 < elapsedFrames)) { do { manager = g_manager; if (iVar8 % 0x2d == 0) { if ((npc->_v1).x <= 0.0) { local_d4.y = roomLeft - 100.0; } else { local_d4.y = roomRight + 100.0; } local_b0[0].y = 9.75304e-43; seed_fart_sound_override((int *)&local_b0[0].y); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0].y,1.0,2,0,1.0,0.0); local_b0[0].y = 0.0; do { iVar8 = 1000; local_cc.x = local_d4.y; local_b8.y = (float)(int)local_b0[0].y; local_cc.y = local_b8.y * 110.0 + 120.0; if (((uint)local_b0[0].y & 1) != 0) { iVar8 = -1000; local_cc.x = (npc->_v1).x * 80.0 + local_d4.y; } uVar3 = Random(); local_f0.x = (npc->_v1).x * -40.0; local_f0.y = (npc->_v1).y * -40.0; pEVar5 = Game::Spawn(g_game,0x3b7,0x2a,&local_cc,&local_f0,(Entity *)npc,0,uVar3); pEVar5->_renderZOffset = iVar8; iVar8 = npc->_stateFrame; iVar12 = *(int *)pEVar5; (pEVar5->_targetPosition).y = 0.0; (pEVar5->_targetPosition).x = ((float)iVar8 * 3.1415927) / 180.0 + local_b8.y * 2.3561945; (**(code **)(iVar12 + 0xc))(); local_b0[0].y = (float)((int)local_b0[0].y + 1); } while ((int)local_b0[0].y < 4); iVar8 = npc->_stateFrame; } if (((0x16d < iVar8) && (pbVar14 = (npc->_sprite)._animState._animData, pbVar14 != (byte *)0x0)) && (pbVar14[0x34] != 0)) { if (pbVar14 != (byte *)0x0) { strCursor = pbVar14; if (0xf < *(uint *)(pbVar14 + 0x14)) { strCursor = *(byte **)pbVar14; } pcVar11 = "SummonEnd"; do { bVar2 = *strCursor; bVar15 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004425f0: uVar3 = -(uint)bVar15 | 1; goto LAB_004425f5; } if (bVar2 == 0) break; bVar2 = strCursor[1]; bVar15 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004425f0; strCursor = strCursor + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004425f5: if ((uVar3 == 0) && ((pbVar14[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0044262c; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SummonEnd",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0044262c: if (0x17c < npc->_stateFrame) { pbVar14 = (npc->_sprite)._animState._animData; if (pbVar14 == (byte *)0x0) goto LAB_004426b8; if (0xf < *(uint *)(pbVar14 + 0x14)) { pbVar14 = *(byte **)pbVar14; } pcVar11 = "SwingPrepare"; goto LAB_00442680; } iVar8 = npc->_stateFrame + 1; local_e8.y = (float)((int)local_e8.y + 1); npc->_stateFrame = iVar8; } while ((int)local_e8.y < elapsedFrames); } break; case 10: npc->_friction = npc->_friction * 0.8; fVar17 = (npc->_targetPosition).y; fVar19 = (npc->_pos).y; fVar21 = npc->_speedMultiplier; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) * 0.1 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = (fVar17 - fVar19) * 0.1 * fVar21 + (npc->_velocity).y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"SwingPrepareLoop",0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar2 != 0) { local_b0[0].y = 1.02295e-42; seed_fart_sound_override((int *)&local_b0[0].y); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0].y,1.0,2,0,1.0,0.0); Entity_NPC::QueryNPCsType(local_f8,0x3b7,0x2a); VStack_18.y = 0.0; local_b0[0].y = 0.0; if (local_f0.y != 0.0) { pvVar7 = skullListData; fVar17 = local_f0.y; do { iVar8 = *(int *)((int)pvVar7 + (int)local_b0[0].y * 4); if (iVar8 != 0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar8 + 0x28) == 1)) || (*(int *)(iVar8 + 0x28) - 10U < 0x3de)) && (*(Entity_NPC **)(iVar8 + 0x3c8) == npc)) { *(undefined4 *)(iVar8 + 0xb64) = 5; bVar2 = ANM2::SetAnimation((ANM2 *)(iVar8 + 0x48),(byte *)"DieStart",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(iVar8 + 0x78)); *(undefined1 *)(iVar8 + 0x8c) = 1; } fVar17 = local_f0.y; } pvVar7 = skullListData; } local_b0[0].y = (float)((int)local_b0[0].y + 1); } while ((uint)local_b0[0].y < (uint)fVar17); } Entity_NPC::PlaySound(npc,0x2b3,1.0,2,0,1.0); local_b0[0].y = 0.0; do { local_b8.y = (float)(int)local_b0[0].y * 120.0 - 90.0; uVar3 = Random(); pEVar5 = Game::Spawn(g_game,0x3b7,0x29,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar3); fadeColor = 0x3f4ccccd; EStack_78._type = 0x3f4ccccd; EStack_78._variant = 0x3f4ccccd; EStack_78._spawnerType = 0x3f800000; EStack_78._velocity.y = -0.1; EStack_78._spawnerVariant = 0; EStack_78._position.x = 0.0; EStack_78._position.y = 0.0; EStack_78._velocity.x = 0.0; EStack_78._flags = -0x42333333; EStack_78._entity = (void *)0xbdcccccd; (**(code **)(*(int *)pEVar5 + 0x3c))(&fadeColor,0xffffffff,0xff,0,1); EStack_78._velocity.y = 0.0; EStack_78._spawnerVariant = 0; EStack_78._position.x = 0.0; EStack_78._position.y = 0.0; EStack_78._velocity.x = 0.0; EStack_78._flags = 0; EStack_78._entity = (void *)0x0; fadeColor = 0; EStack_78._type = 0; EStack_78._variant = 0; EStack_78._spawnerType = 0x3f800000; (**(code **)(*(int *)pEVar5 + 0x3c))(&fadeColor,8,0xff,1,1); uVar10 = *(undefined4 *)((int)&pEVar5->_flags + 4); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar5->_flags + 4) = uVar10; iVar8 = *(int *)pEVar5; pEVar5->_entityCollisionClass = 0; (pEVar5->_targetPosition).x = 60.0; (pEVar5->_targetPosition).y = local_b8.y; (**(code **)(iVar8 + 0xc))(); local_b0[0].y = (float)((int)local_b0[0].y + 1); pEVar5->_renderZOffset = 1000; } while ((int)local_b0[0].y < 3); VStack_18.y = -NAN; npc->_stateFrame = 1; if (local_f8[0] == '\0') { VStack_18.y = 1.4013e-45; tracked_alloc(1,skullListData,0); VStack_18.y = -NAN; } } iVar8 = npc->_stateFrame; layerAlpha = (60.0 - (float)iVar8) / 60.0; if (layerAlpha <= 0.0) { layerAlpha = 0.0; } if (1.0 <= layerAlpha) { layerAlpha = 1.0; } if ((0 < iVar8) && (npc->_stateFrame = iVar8 + elapsedFrames, 0x3c < iVar8 + elapsedFrames)) { npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_visible = 0; (npc->_v2).x = 0.5; (npc->_v2).y = 0.5; goto LAB_0044364a; } break; case 0x10: npc->_friction = npc->_friction * 0.8; game->_darknessStrength = (npc->_v2).x; game->_darknessTimeout = 300; fVar17 = (npc->_v2).x; fVar19 = (npc->_v2).y; fVar21 = npc->_speedMultiplier * 0.02; if (fVar21 < ABS(fVar17 - fVar19)) { if (fVar19 <= fVar17) { fVar19 = fVar17 - fVar21; } else { fVar19 = fVar17 + fVar21; } } iVar8 = npc->_stateFrame; (npc->_v2).x = fVar19; if (iVar8 < 1) { layerAlpha = (float)-iVar8 / 10.0; } else { layerAlpha = ((float)iVar8 - 30.0) / 30.0; } local_d4.y = 0.0; if (layerAlpha <= 0.0) { layerAlpha = 0.0; } if (1.0 <= layerAlpha) { layerAlpha = 1.0; } if (0 < elapsedFrames) { do { npc->_stateFrame = npc->_stateFrame + 1; iVar8 = npc->_stateFrame; if (iVar8 != 0x1e) { if (iVar8 == (uint)(npc->_i1 == 0) * 8 + 0x34) { pbVar14 = (npc->_sprite)._animState._animData; if (pbVar14 == (byte *)0x0) { LAB_00442dbe: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Swing",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { strCursor = pbVar14; if (0xf < *(uint *)(pbVar14 + 0x14)) { strCursor = *(byte **)pbVar14; } pcVar11 = "Swing"; do { bVar2 = *strCursor; bVar15 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_00442da0: uVar4 = -(uint)bVar15 | 1; goto LAB_00442da5; } if (bVar2 == 0) break; bVar2 = strCursor[1]; bVar15 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_00442da0; strCursor = strCursor + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00442da5: if ((uVar4 != 0) || ((pbVar14[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00442dbe; } manager = g_manager; local_b0[0].y = 9.72501e-43; seed_fart_sound_override((int *)&local_b0[0].y); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0].y,1.0,2,0,1.0,0.0); goto LAB_00442e5d; } if (iVar8 != 0) goto LAB_00442e5d; iVar8 = npc->_i1 + 1; npc->_visible = 0; npc->_entityCollisionClass = 0; npc->_i1 = iVar8; game = g_game; if (iVar8 < 4) { (npc->_sprite)._flipX = (npc->_sprite)._flipX == 0; goto LAB_00442e5d; } g_game->_darknessStrength = (npc->_v2).x; game->_darknessTimeout = 0x1e; bVar15 = (npc->_sprite)._flipX == 0; if (bVar15) { fVar17 = roomRight + 200.0; } else { fVar17 = roomLeft - 200.0; } (npc->_pos).x = fVar17; (npc->_pos).y = (local_c4 + roomTop) * 0.5; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; npc->_state = 7; npc->_visible = 1; npc->_entityCollisionClass = 4; if (bVar15) { puVar13 = &DAT_bf800000; } else { puVar13 = (undefined1 *)0x3f800000; } (npc->_v1).x = (float)puVar13; (npc->_v1).y = 0.0; npc->_aiFloat = 0.1; Entity_NPC::QueryNPCsType(skullQuery,0x3b7,0x2a); puVar13 = (undefined1 *)0x0; VStack_18.y = 2.8026e-45; if ((SoundEffects *)local_b8.y != (SoundEffects *)0x0) { iVar8 = skullQueryData; do { queriedNpc = *(int **)(iVar8 + (int)puVar13 * 4); if (queriedNpc != (int *)0x0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (queriedNpc[10] == 1)) || (queriedNpc[10] - 10U < 0x3de)) && ((Entity_NPC *)queriedNpc[0xf2] == npc)) { (**(code **)(*queriedNpc + 0x28))(uVar3); } iVar8 = skullQueryData; } puVar13 = puVar13 + 1; } while (puVar13 < (uint)local_b8.y); } VStack_18.y = -NAN; EntityList_Query::~EntityList_Query(skullQuery); break; } pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_b8.y = (pEVar5->_pos).x; local_f0.y = (pEVar5->_pos).y; npc->_visible = 1; npc->_entityCollisionClass = 4; pbVar14 = (npc->_sprite)._animState._animData; if (pbVar14 == (byte *)0x0) { LAB_00442c42: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SwingPrepareLoop",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { strCursor = pbVar14; if (0xf < *(uint *)(pbVar14 + 0x14)) { strCursor = *(byte **)pbVar14; } pcVar11 = "SwingPrepareLoop"; do { bVar2 = *strCursor; bVar15 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_00442c24: uVar4 = -(uint)bVar15 | 1; goto LAB_00442c29; } if (bVar2 == 0) break; bVar2 = strCursor[1]; bVar15 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_00442c24; strCursor = strCursor + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00442c29: if ((uVar4 != 0) || ((pbVar14[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00442c42; } manager = g_manager; local_b0[0].y = 9.711e-43; seed_fart_sound_override((int *)&local_b0[0].y); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0].y,1.0,2,0,1.0,0.0); pEVar5 = Entity_NPC::GetPlayerTarget(npc); if ((npc->_sprite)._flipX == 0) { fVar17 = 280.0; } else { fVar17 = -280.0; } if (npc->_i1 == 0) { fVar19 = 1.8; } else { fVar19 = 1.0; } (npc->_pos).y = local_f0.y + (pEVar5->_velocity).y * 15.0; (npc->_pos).x = fVar19 * fVar17 + local_b8.y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; LAB_00442e5d: local_d4.y = (float)((int)local_d4.y + 1); } while ((int)local_d4.y < elapsedFrames); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { local_f0.y = (npc->_v2).y + 0.2; local_b8.y = 1.0; pVVar9 = &local_b8; if (local_f0.y <= 1.0) { pVVar9 = &local_f0; } (npc->_v2).y = pVVar9->y; Entity_NPC::PlaySound(npc,0xfc,1.0,2,0,0.8); Entity_NPC::PlaySound(npc,0x1fa,1.0,2,0,1.0); Game::ShakeScreen(g_game,4); bVar2 = (npc->_sprite)._flipX; npc->_stateFrame = -10; if (bVar2 == 0) { fVar17 = -18.0; } else { fVar17 = 18.0; } (npc->_v1).x = fVar17; (npc->_v1).y = 0.0; } if ((npc->_visible != 0) && (Entity::GetNullCapsule((Entity *)npc,(Capsule *)&VStack_4c,&DAT_00b1d3b0), 0.0 < local_2c)) { if (((uint)g_game->_debugFlags >> 5 & 1) != 0) { pvVar7 = Entity::GetDebugShape((Entity *)npc,1); *(undefined4 *)((int)pvVar7 + 4) = 1; push_shape_points(pvVar7,(Capsule *)&VStack_4c); } EntityList::QueryRadius (&room->_entityList,&capsuleHits,&VStack_4c,local_28 + local_2c,0xffffffff); VStack_18.y = 4.2039e-45; local_cc.y = 0.0; if ((float)capsuleHits._size != 0.0) { do { pEVar18 = *(Entity_NPC **)((int)capsuleHits._data + (int)local_cc.y * 4); local_e8.y = (float)pEVar18; if (((pEVar18->_entityCollisionClass != 0) && (pEVar18->_entityGridCollisionClass != 4)) && (pEVar18 != npc)) { Entity::GetCollisionCapsule((Entity *)pEVar18,&EStack_78,&g_vectorZero); local_b8.y = 0.0; local_b8.x = 0.0; bVar2 = Capsule::Collide((Capsule *)&VStack_4c,(Capsule *)&EStack_78,&local_b8); if (bVar2 != 0) { local_b0[0].y = (pEVar18->_pos).x - (npc->_pos).x; local_d4.y = (pEVar18->_pos).y - (npc->_pos).y; fVar17 = sqrtf(local_b0[0].y * local_b0[0].y + local_d4.y * local_d4.y); if (fVar17 <= 0.0) { pEVar20 = (Entity_NPC *)local_d4.y; pEVar5 = (Entity *)local_b0[0].y; } else { pEVar20 = (Entity_NPC *)((1.0 / fVar17) * local_d4.y); pEVar5 = (Entity *)((1.0 / fVar17) * local_b0[0].y); } (pEVar18->_velocity).x = (float)pEVar5 * 10.0 + (pEVar18->_velocity).x; (pEVar18->_velocity).y = (float)pEVar20 * 10.0 + (pEVar18->_velocity).y; if ((pEVar18->_type == 1) || (pEVar18->_type == 3)) { vfn = *(code **)(*(int *)pEVar18 + 0x20); EntityRef::constructor(&EStack_78,(Entity *)npc); uVar10 = 0x40000000; } else { vfn = *(code **)(*(int *)pEVar18 + 0x20); EntityRef::constructor(&EStack_78,(Entity *)npc); uVar10 = 0x420c0000; } (*vfn)(uVar10,0,0,&EStack_78,0x1e); } } local_cc.y = (float)((int)local_cc.y + 1); } while ((uint)local_cc.y < (uint)capsuleHits._size); } VStack_18.y = -NAN; EntityList_Query::~EntityList_Query(&capsuleHits); } iVar8 = npc->_stateFrame; if (iVar8 < -5) { fVar17 = npc->_speedMultiplier; (npc->_velocity).x = fVar17 * (npc->_v1).x + (npc->_velocity).x; (npc->_velocity).y = fVar17 * (npc->_v1).y + (npc->_velocity).y; fVar17 = npc->_speedMultiplier; fVar19 = 0.8; if (fVar17 != 1.0) { fVar19 = 0.8 / ((fVar17 + 0.8) - fVar17 * 0.8); } (npc->_v1).y = fVar19 * (npc->_v1).y; (npc->_v1).x = fVar19 * (npc->_v1).x; iVar8 = npc->_stateFrame; } if ((0 < iVar8) && (npc->_visible != 0)) { fVar17 = ((float)iVar8 - 40.0) / 20.0; if (fVar17 <= 0.0) { fVar17 = 0.0; } if (1.0 <= fVar17) { fVar17 = 1.0; } local_b8.y = 1.0 - fVar17; pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_f0.y = (pEVar5->_pos).x; local_100.y = (pEVar5->_pos).y; pEVar5 = Entity_NPC::GetPlayerTarget(npc); if ((npc->_sprite)._flipX == 0) { fVar17 = 20.0; } else { fVar17 = -20.0; } local_c4 = (((pEVar5->_velocity).y * 15.0 * local_b8.y + local_100.y) - (npc->_pos).y) * 0.09 * local_b8.y * 0.5; local_cc.y = (((pEVar5->_velocity).x * 15.0 * local_b8.y + local_f0.y + fVar17) - (npc->_pos).x) * 0.09 * local_b8.y; fVar17 = sqrtf(local_c4 * local_c4 + local_cc.y * local_cc.y); if ((fVar17 <= 30.0) || (fVar17 <= 0.0)) { fVar19 = local_c4; fVar17 = local_cc.y; } else { fVar19 = local_c4 * (30.0 / fVar17); fVar17 = local_cc.y * (30.0 / fVar17); } (npc->_velocity).x = fVar17; (npc->_velocity).y = fVar19; } break; case 99: npc->_state = 7; (npc->_v1).x = (float)&DAT_bf800000; (npc->_v1).y = 0.0; npc->_visible = 1; npc->_entityCollisionClass = 4; npc->_i1 = 0; ANM2::Play(&npc->_sprite,s_Idle,0); } goto switchD_0044116f_caseD_1; while( true ) { bVar2 = pbVar14[1]; bVar15 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004426a0; pbVar14 = pbVar14 + 2; pcVar11 = pcVar11 + 2; if (bVar2 == 0) break; LAB_00442680: bVar2 = *pbVar14; bVar15 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004426a0: uVar3 = -(uint)bVar15 | 1; goto LAB_004426a5; } if (bVar2 == 0) break; } uVar3 = 0; LAB_004426a5: if ((uVar3 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) { LAB_004426b8: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SwingPrepare",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } npc->_stateFrame = 0; npc->_i1 = 0; npc->_state = 10; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; switchD_0044116f_caseD_1: iVar8 = npc->_state; if (iVar8 == 10) { if (npc->_stateFrame < 1) goto LAB_00443b10; iVar8 = Entity::GetIntervalTicks((Entity *)npc,3.0,0.0); if ((iVar8 != 0) && (0.0 < layerAlpha)) { uVar3 = Random(); local_f0.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.5; pVVar9 = MusicManager::RandomVector(&local_d4); uVar3 = Random(); fVar17 = sqrtf((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10); local_b8.y = fVar17 * pVVar9->x; local_b0[0].y = fVar17 * pVVar9->y; local_b0[0].x = local_b8.y; uVar3 = Random(); local_d4.x = npc->_size * local_b8.y + (npc->_pos).x; local_d4.y = npc->_size * local_b0[0].y + (npc->_pos).y; pEVar5 = Game::Spawn(g_game,1000,0x3b,&local_d4,local_b0,(Entity *)npc,0,uVar3); (pEVar5->_posOffset).x = (self->_posOffset).x; iVar8 = *(int *)pEVar5; (pEVar5->_posOffset).y = (self->_posOffset).y; (pEVar5->_sprite)._scale.x = local_f0.y + local_f0.y; (pEVar5->_sprite)._scale.y = local_f0.y + local_f0.y; vfn = *(code **)(iVar8 + 0x3c); uVar3 = Random(); uVar10 = Color::Color((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.2); (*vfn)(uVar10,0xffffffff,0xff,0,1); uVar10 = Color::Color(0); (**(code **)(*(int *)pEVar5 + 0x3c))(uVar10,10,0xff,1,1); uVar3 = Random(); *(float *)(pEVar5[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar3 = Random(); iVar8 = *(int *)pEVar5; iVar12 = uVar3 % 0xf + 0xf; *(int *)(pEVar5[1]._sprite._filename._buf + 8) = iVar12; *(int *)(pEVar5[1]._sprite._filename._buf + 0xc) = iVar12; (**(code **)(iVar8 + 0xc))(); iVar8 = self->_state; npc = self; if (iVar8 != 10) goto LAB_004438f1; } if (npc->_stateFrame < 1) goto LAB_00443b10; } else { LAB_004438f1: if ((iVar8 != 0x10) && ((iVar8 != 7 || (g_game->_darknessModifier <= 0.5)))) goto LAB_00443b10; } iVar8 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar8 != 0) { uVar3 = Random(); local_b8.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.5; Room::GetRandomPosition(room,&local_f0,0.0); uVar3 = Random(); pEVar5 = Game::Spawn(g_game,1000,0x3b,&local_f0,&g_vectorZero,(Entity *)npc,0,uVar3); (pEVar5->_posOffset).x = (self->_posOffset).x; iVar8 = *(int *)pEVar5; (pEVar5->_posOffset).y = (self->_posOffset).y; (pEVar5->_sprite)._scale.x = local_b8.y + local_b8.y; (pEVar5->_sprite)._scale.y = local_b8.y + local_b8.y; vfn = *(code **)(iVar8 + 0x3c); uVar3 = Random(); local_30 = 0; local_2c = 0.0; local_28 = 0.0; spawnColor = 0; VStack_4c.x = 0.0; VStack_4c.y = 0.0; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; fStack_44 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.15 + 0.1; (*vfn)(&spawnColor,0xffffffff,0xff,0,1); local_30 = 0; local_2c = 0.0; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_28 = 0.0; spawnColor = 0; VStack_4c.x = 0.0; VStack_4c.y = 0.0; fStack_44 = 0.0; (**(code **)(*(int *)pEVar5 + 0x3c))(&spawnColor,10,0xff,1,1); uVar3 = Random(); *(float *)(pEVar5[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar3 = Random(); pEVar5->_renderZOffset = 1000; iVar8 = *(int *)pEVar5; iVar12 = uVar3 % 0x14 + 0x14; *(int *)(pEVar5[1]._sprite._filename._buf + 8) = iVar12; *(int *)(pEVar5[1]._sprite._filename._buf + 0xc) = iVar12; (**(code **)(iVar8 + 0xc))(); } LAB_00443b10: pEVar18 = self; pbVar14 = (byte *)0x0; if ((self->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&pEVar18->_sprite,pbVar14); fVar17 = layerAlpha; if ((byte *)0x3 < pbVar14) { fVar17 = layerAlpha + layerAlpha; if (1.0 <= fVar17) { fVar17 = 1.0; } fVar17 = fVar17 * g_game->_darknessModifier * g_game->_darknessStrength; } (layer->_color)._tint[3] = fVar17; pbVar14 = pbVar14 + 1; } while (pbVar14 < (byte *)(pEVar18->_sprite)._layerCount); } if (pEVar18->_state != 9) { local_b8.y = (float)&g_manager->_sfxManager; pvVar7 = (((SoundEffects *)local_b8.y)->_sounds)._begin; if (0x2d9 < ((int)(g_manager->_sfxManager)._sounds._end - (int)pvVar7) / 0x1b8) { if (*(int *)((int)pvVar7 + 0x4e688) == 0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); } else if (((*(char *)((int)pvVar7 + 0x4e690) != '\0') && (bVar2 = SFXManager::IsPlaying((void *)local_b8.y,0x2d9), bVar2 != 0)) && (0.0 < *(float *)((int)pvVar7 + 0x4e68c))) { SFXManager::SetAmbientSound (&g_manager->_sfxManager,0x2d9,*(float *)((int)pvVar7 + 0x4e68c) - 0.05,1.0); } } } game = g_game; if (pEVar18->_dead != 0) { if (0.0 < g_game->_darknessModifier) { g_game->_darknessStrength = g_game->_darknessModifier; game->_darknessTimeout = 0x1e; } local_b0[0].y = 0.0; if ((room->_entityList)._updateEL._size != 0) { do { local_b8.y = *(float *)((int)(room->_entityList)._updateEL._data + (int)local_b0[0].y * 4); if (((SoundEffects *)local_b8.y != (SoundEffects *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && ((((OptionsConfig *)((int)local_b8.y + 0x18))->_optionsIniFilePath)._size == 1)) || ((((OptionsConfig *)((int)local_b8.y + 0x18))->_optionsIniFilePath)._size - 10 < 0x3de) ) && (*(Entity_NPC **)((undefined1 *)((int)local_b8.y + 0x3c0) + 8) == pEVar18)))) { vfn = *(code **)((int)(((SoundEffects *)local_b8.y)->_sounds)._begin + 0x24); EntityRef::constructor(&EStack_78,(Entity *)pEVar18); (*vfn)(&EStack_78); } local_b0[0].y = (float)((int)local_b0[0].y + 1); } while ((uint)local_b0[0].y < (uint)(room->_entityList)._updateEL._size); } SFXManager::Stop(&g_manager->_sfxManager,0x2d9); } ExceptionList = local_1c; return; } //@@ 00443e50 NpcAI::ENTITY_BEAST_ultra_death_scythe /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: 951.41 (Beast case variant switch 0x29); strs Rotate3-6, QueryRadius, normalize_angle_degrees */ void __fastcall NpcAI::ENTITY_BEAST_ultra_death_scythe(Entity_NPC *npc) { uint *puVar1; ANM2 *pAVar2; bool bVar3; byte bVar4; uint uVar5; Vector *pVVar6; int iVar7; uint uVar8; Entity *trailEffect; Vector *pVVar9; undefined1 *puVar10; undefined4 trailColor; char *pcVar11; uint startFrame; void *animData; EntityPtr linkedEffect; EntityRef *damageSource; int trailTimeout; EntityPtr *trailEffect; float fVar13; float fVar14; undefined1 local_60 [12]; EntityPtr *local_54; Vector local_50; float local_48; EntityPtr *local_44; undefined1 local_40 [8]; float fStack_38; float fStack_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float local_1c; float local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *nearbyEntity; code *setColorFn; float trailSpeedMultiplier; local_8 = 0xffffffff; puStack_c = &LAB_00af23bd; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_40 + 0x3c); ExceptionList = &local_10; fVar13 = npc->_updateTime; iVar7 = npc->_aiCallPhase; local_14 = uVar5; if ((iVar7 == 4) || (iVar7 == 2)) { if (((npc->_dead == 0) && (iVar7 == 4)) && ((npc->_spawnerEntity == (EntityPtr)0x0 || (*(char *)((int)npc->_spawnerEntity + 0x173) != '\0')))) { damageSource = EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x24))(damageSource); } else { linkedEffect = npc->_entityRef; if (linkedEffect != (EntityPtr)0x0) { fVar13 = (npc->_posOffset).y; fVar14 = (npc->_pos).y; *(float *)((int)linkedEffect + 0x33c) = (npc->_pos).x + (npc->_posOffset).x; *(float *)((int)linkedEffect + 0x340) = fVar13 + fVar14; fVar13 = npc->_updateTime * 0.05; if (1.0 <= fVar13) { fVar13 = 1.0; } *(float *)((int)npc->_entityRef + 0xfc) = fVar13; } } } else { if (npc->_state == 0) { npc->_state = 3; npc->_stateFrame = 0xf; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rotate3",1); if ((bVar4 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0); if ((npc->_sprite)._animState._animData != (void *)0x0) { (npc->_sprite)._animState._isPlaying = 0; } } animData = (npc->_sprite)._animState._animData; if ((animData == (void *)0x0) || (uVar8 = *(uint *)((int)animData + 0x30), uVar8 == 0)) { startFrame = 0; } else { startFrame = Random(); startFrame = startFrame % uVar8; animData = (npc->_sprite)._animState._animData; } if (animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)startFrame); } *(uint *)&npc->_flags = (uint)npc->_flags | 0x44010001; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x2400; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = -18.0; (npc->_v1).x = (npc->_pos).x; (npc->_v1).y = (npc->_pos).y; if (npc->_subtype == 1) { npc->_aiCallFlags = 10; uVar8 = Random(); linkedEffect = (EntityPtr) Game::Spawn(g_game,1000,0xa6,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar8); local_20 = 0.0; local_1c = 0.0; local_30 = 0.0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; local_18 = 0.0; local_40._0_4_ = 0.0; local_40._4_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.75; Sprite::SetColor((Sprite *)((int)linkedEffect + 0x48),(ColorMod *)local_40); fVar13 = g_vectorOne.x; trailEffect = (EntityPtr *)((int)linkedEffect + 0x3bc); fVar14 = g_vectorOne.y * 6.0; pAVar2 = (ANM2 *)((int)linkedEffect + 0x454); (pAVar2->_filename)._buf[0] = -0x52; (pAVar2->_filename)._buf[1] = 'G'; (pAVar2->_filename)._buf[2] = -0x1f; (pAVar2->_filename)._buf[3] = '='; pcVar11 = (char *)((int)linkedEffect + 0x458); pcVar11[0] = -0x52; pcVar11[1] = 'G'; pcVar11[2] = -0x1f; pcVar11[3] = '='; *(float *)((int)linkedEffect + 0xe8) = fVar14; ((Vector *)((int)linkedEffect + 0xe4))->x = fVar13 * 6.0; if (*trailEffect != (EntityPtr)0x0) { local_54 = trailEffect; std::multiset::erase(&local_54); } *trailEffect = (EntityPtr)npc; std::multiset::insert(trailEffect); trailEffect = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_54 = trailEffect; std::multiset::erase(&local_54); } *trailEffect = linkedEffect; std::multiset::insert(trailEffect); } } else if (npc->_state == 3) { if (npc->_subtype == 1) { local_50.y = (npc->_targetPosition).y * 0.017453292; local_44 = (EntityPtr *)(fVar13 * fVar13 * 0.15 * 0.15); local_48 = cos(local_50.y); fVar13 = sin(local_50.y); fVar14 = local_48 * 0.0; local_48 = (((npc->_targetPosition).x * local_48 - fVar13 * 0.0) + (npc->_v1).x) - (npc->_pos).x; local_50.y = ((npc->_targetPosition).x * fVar13 + fVar14 + (npc->_v1).y) - (npc->_pos).y; fVar13 = local_50.y * local_50.y + local_48 * local_48; if ((float)local_44 * (float)local_44 < fVar13) { fVar13 = sqrtf(fVar13); if (0.0 < fVar13) { local_48 = ((float)local_44 / fVar13) * local_48; local_50.y = local_50.y * ((float)local_44 / fVar13); } } fVar13 = npc->_speedMultiplier; pVVar9 = &npc->_v2; local_50.x = 1.0; fVar14 = fVar13 * 0.1 + pVVar9->x; pVVar9->x = fVar14; local_44 = (EntityPtr *)(fVar13 * fVar14 + (npc->_targetPosition).x); (npc->_targetPosition).x = (float)local_44; pVVar6 = &local_50; if (fVar14 < 1.0) { pVVar6 = pVVar9; } fVar13 = normalize_angle_degrees(pVVar6->x * 8.0 * fVar13 + (npc->_targetPosition).y); (npc->_targetPosition).y = fVar13; fVar13 = ((float)local_44 - 100.0) / 300.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } local_44 = (EntityPtr *)(fVar13 * 0.7 + 0.8); iVar7 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if ((iVar7 != 0) && (10.0 < npc->_updateTime)) { uVar8 = Random(); trailEffect = Game::Spawn(g_game,1000,0x3b,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar8) ; fVar13 = (npc->_velocity).y; (trailEffect->_velocity).x = (npc->_velocity).x * 0.2; (trailEffect->_velocity).y = fVar13 * 0.2; pVVar9 = MusicManager::RandomVector((Vector *)(local_60 + 8)); uVar8 = Random(); local_50.x = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_54 = (EntityPtr *)(local_50.x * pVVar9->y); local_50.x = local_50.x * pVVar9->x; fVar13 = (npc->_velocity).x; fVar14 = (npc->_velocity).y; fVar14 = sqrtf(fVar13 * fVar13 + fVar14 * fVar14); fVar13 = trailEffect->_friction; if (fVar13 != 0.0) { trailSpeedMultiplier = trailEffect->_speedMultiplier; (trailEffect->_velocity).y = (trailSpeedMultiplier * (float)local_54 * fVar14 * 0.4) / fVar13 + (trailEffect->_velocity).y; (trailEffect->_velocity).x = (trailSpeedMultiplier * local_50.x * fVar14 * 0.4) / fVar13 + (trailEffect->_velocity).x; } (trailEffect->_posOffset).x = (npc->_posOffset).x; (trailEffect->_posOffset).y = (npc->_posOffset).y; local_50.x = 1.0; (trailEffect->_sprite)._scale.x = (float)local_44 + (float)local_44; (trailEffect->_sprite)._scale.y = (float)local_44 + (float)local_44; local_54 = (EntityPtr *)(npc->_updateTime / 30.0); setColorFn = *(code **)(*(int *)trailEffect + 0x3c); local_44 = local_54; uVar8 = Random(); puVar10 = (undefined1 *)&local_54; if (1.0 <= (float)local_44) { puVar10 = (undefined1 *)&local_50; } trailColor = Color::Color(((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.1) * *(float *)puVar10); (*setColorFn)(trailColor,0xffffffff,0xff,0,1); uVar8 = Random(); *(float *)(trailEffect[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar8 = Random(); iVar7 = *(int *)trailEffect; trailTimeout = uVar8 % 0x1e + 0x1e; *(int *)(trailEffect[1]._sprite._filename._buf + 8) = trailTimeout; *(int *)(trailEffect[1]._sprite._filename._buf + 0xc) = trailTimeout; (**(code **)(iVar7 + 0xc))(); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rotate3",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } fVar13 = (npc->_targetPosition).x; if (100.0 <= fVar13) { if (200.0 <= fVar13) { pcVar11 = "Rotate5"; if (300.0 <= fVar13) { pcVar11 = "Rotate6"; } } else { pcVar11 = "Rotate4"; } } else { pcVar11 = "Rotate3"; } ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar11,0); fVar13 = (npc->_velocity).y; fVar14 = (npc->_velocity).x; fVar13 = sqrtf(fVar14 * fVar14 + fVar13 * fVar13); fVar13 = fVar13 / 10.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } (npc->_sprite)._playbackSpeed = fVar13; (npc->_velocity).y = local_50.y; fVar13 = npc->_updateTime; (npc->_velocity).x = local_48; if (30.0 < fVar13) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60, &npc->_pos,npc->_size + 40.0,8); local_8 = 0; uVar8 = 0; trailEffect = local_54; if (local_54 != (EntityPtr *)0x0) { do { nearbyEntity = *(int **)(local_60._4_4_ + uVar8 * 4); if ((nearbyEntity != (int *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (iVar7 = 1, nearbyEntity[10] == 1)) || (iVar7 = nearbyEntity[10], iVar7 - 10U < 0x3de)) && (*(char *)((int)nearbyEntity + 0x173) == '\0')))) { if ((iVar7 == 0x3b7) && (nearbyEntity[0xb] == 0x2a)) { bVar3 = true; } else { bVar3 = false; } if (bVar3) { fStack_2c = g_vectorZero.x; fStack_24 = g_vectorZero.x; fStack_28 = g_vectorZero.y; local_20 = g_vectorZero.y; local_40._4_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_30 = 0.0; local_1c = 0.0; local_18 = 0.0; (**(code **)(*nearbyEntity + 0x24))(local_40 + 4); trailEffect = local_54; } } uVar8 = uVar8 + 1; } while (uVar8 < trailEffect); } local_8 = 0xffffffff; if (local_60[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_60._4_4_,0); local_8 = 0xffffffff; } } } else if (npc->_stateFrame < 1) { fVar13 = (npc->_targetPosition).x * 0.2 * npc->_speedMultiplier + (npc->_velocity).x; fVar14 = (npc->_targetPosition).y * 0.2 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fVar13; (npc->_velocity).y = fVar14; fVar13 = sqrtf(fVar13 * fVar13 + fVar14 * fVar14); fVar13 = fVar13 / 10.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } (npc->_sprite)._playbackSpeed = fVar13; } else { iVar7 = npc->_stateFrame - ((int)fVar13 - (int)npc->_prevUpdateTime); npc->_stateFrame = iVar7; npc->_friction = npc->_friction * 0.8; if (iVar7 < 1) { iVar7 = ANM2::GetFrame(&npc->_sprite); bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rotate3",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)iVar7); } (npc->_sprite)._playbackSpeed = 0.01; npc->_friction = 1.0; } } } if (npc->_subtype == 0) { bVar4 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-200.0); if (bVar4 == 0) { (**(code **)(*(int *)npc + 0x28))(); } } if ((npc->_subtype == 1) && (1000.0 < (npc->_targetPosition).x)) { (**(code **)(*(int *)npc + 0x28))(uVar5); } } ExceptionList = local_10; return; } //@@ 00444900 NpcAI::ENTITY_BEAST_ultra_death_head /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? 951 variant switch case 0x2a (variant 42); "DieLoop", MakeGroundPoof, SFXManager::Stop, Game::start_poop_cloud_screen_effect */ void __fastcall NpcAI::ENTITY_BEAST_ultra_death_head(Entity_NPC *npc) { uint *puVar1; int iVar2; Manager *pMVar3; float fVar4; float fVar5; float local_68; float local_64; ColorMod local_60; ColorMod local_34; float local_8; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); if ((npc->_dead == 0) && ((npc->_spawnerEntity == (EntityPtr)0x0 || (*(char *)((int)npc->_spawnerEntity + 0x173) != '\0')))) { local_34._tint[1] = 0.0; local_34._tint[2] = 0.0; local_34._tint[3] = 0.0; local_34._colorize[0] = 0.0; local_34._colorize[1] = g_vectorZero.x; local_34._colorize[2] = g_vectorZero.y; local_34._colorize[3] = g_vectorZero.x; local_34._offset[0] = g_vectorZero.y; local_34._offset[1] = 0.0; local_34._offset[2] = 0.0; (**(code **)(*(int *)npc + 0x24))(local_34._tint + 1); SFXManager::Stop(&g_manager->_sfxManager,0x2d9); return; } iVar2 = npc->_state; local_68 = 1.0; if (iVar2 == 0) { npc->_state = 3; fVar4 = (npc->_velocity).x; local_64 = (npc->_velocity).y; fVar5 = sqrtf(fVar4 * fVar4 + local_64 * local_64); if (0.0 < fVar5) { fVar4 = fVar4 * (1.0 / fVar5); local_64 = local_64 * (1.0 / fVar5); } *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x2000; (npc->_v1).x = fVar4; (npc->_v1).y = local_64; npc->_isInvicible = 1; } else if (iVar2 == 3) { npc->_friction = npc->_friction * 0.8; (npc->_velocity).x = npc->_speedMultiplier * (npc->_v1).x + (npc->_velocity).x; fVar4 = npc->_updateTime; (npc->_sprite)._flipX = 0.0 < (npc->_v1).x; fVar4 = sin(fVar4 * 0.05 + (npc->_targetPosition).x); (npc->_velocity).y = fVar4 * 6.0; ANM2::Play(&npc->_sprite,s_Idle,0); } else if (iVar2 == 5) { fVar4 = npc->_friction; (npc->_sprite)._flipX = 0; npc->_entityCollisionClass = 3; npc->_friction = fVar4 * 0.7; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"DieLoop",0); } } pMVar3 = g_manager; if (npc->_dead == 0) { return; } if (npc->_championColorIdx == 0x12) { local_68 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_68 = 0.5; } local_64 = 1.12104e-43; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&pMVar3->_sfxManager,(int)local_64,0.8,2,0,local_68,0.0); local_34._offset[0] = 0.0; local_34._colorize[0] = 0.0; local_34._colorize[1] = 0.0; local_34._colorize[2] = 0.0; local_34._colorize[3] = 0.0; local_34._offset[1] = 0.0; local_34._offset[2] = 0.0; local_34._tint[0] = 0.2; local_34._tint[1] = 0.2; local_34._tint[2] = 0.2; local_34._tint[3] = 1.0; Entity::MakeGroundPoof((Entity *)npc,&npc->_pos,&local_34,1.5); local_60._offset[0] = 0.0; local_60._colorize[0] = 0.0; local_60._colorize[1] = 0.0; local_60._colorize[2] = 0.0; local_60._colorize[3] = 0.0; local_60._offset[1] = 0.0; local_60._offset[2] = 0.0; local_60._tint[0] = 0.0; local_60._tint[1] = 0.0; local_60._tint[2] = 0.0; local_60._tint[3] = 1.0; Game::start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),&local_60); return; } //@@ 00444c60 Entity::Die /* ZHL [lua] Lua binding Entity:Die prototype: db/protos.zhl */ void __thiscall Entity::Die(Entity *this) { this->_dead = 1; return; } //@@ 00444c70 FUN_00444c70 void FUN_00444c70(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x414) = param_1; return; } //@@ 00444c90 Entity_Projectile::set_falling_accel /* DB: trivial setter of +0x418 (db/fields.tsv _fallingAccel); Entity_Effect 1000.181 sets 0.5 on its 9.14 lava ball (beast_fight.md) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Projectile::set_falling_accel(Entity_Projectile *this,float accel) { this->_fallingAccel = accel; return; } //@@ 00444cb0 FUN_00444cb0 void FUN_00444cb0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x448) = param_1; return; } //@@ 00444cc0 NpcAI::ENTITY_BEAST_ultra_famine /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dispatcher case for The Beast (951) variant 10 (ULTRA_FAMINE); DashStart/DashLoop/DashEnd, Summon, HeadLoop, Reverse, Transition anims */ void __fastcall NpcAI::ENTITY_BEAST_ultra_famine(Entity_NPC *npc) { void *pvVar1; byte bVar2; ColorMod *color; uint uVar3; undefined4 uVar4; ColorMod *bloodCloudColor; int extraout_EAX; uint rngValue; Vector *pVVar5; uint uVar6; int extraout_EAX_00; Entity_Effect *bloodCloud; int extraout_EAX_01; Entity *pEVar7; ANM2 *sprite; Room *room; int iVar8; bool isLess; bool bVar9; float fVar10; float dashDirection; undefined1 *puVar11; float fVar12; float fVar13; float pullX; float fVar14; float fVar15; float fVar16; undefined1 auStack_168 [4]; float local_164; float local_160; Vector local_15c; Vector VStack_154; Vector local_14c; Vector local_144; Vector VStack_13c; float local_134; Entity_NPC *local_130; Vector VStack_12c; Vector tmpVec; Vector ringShotPos; Vector bloodCloudPos; Vector sideShotVelocity; Vector sideShotPos; Vector bloodVelocityA; Vector bloodOffset; Vector bloodVelocityB; Color local_e4; ProjectileParams projectileParams; uint local_c; Manager *manager; int *roomEntity; local_c = __security_cookie ^ (uint)auStack_168; local_134 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); room = g_game->_room; if (npc->_aiCallPhase == 1) { if (npc->_state == 0x12) { fVar10 = npc->_speedMultiplier; npc->_friction = 0.8; (npc->_velocity).x = fVar10 * 0.0 + (npc->_velocity).x; (npc->_velocity).y = fVar10 * 0.4 + (npc->_velocity).y; return; } return; } local_14c.x = (float)room; local_130 = npc; if ((((npc->_state == 0x10) || (fVar10 = npc->_maxHitPoints * 0.33, fVar10 < npc->_health || fVar10 == npc->_health)) || (npc->_pendingDamage <= 0.0)) || (bVar2 = Room::IsPositionInRoom(room,&npc->_pos,0.0), bVar2 == 0)) { if (npc->_dead != 0) { SFXManager::Stop(&g_manager->_sfxManager,0x292); manager = g_manager; local_164 = 9.15048e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); room = (Room *)local_14c.x; } } else { Color::Color(&local_e4); spawn_gibs(&npc->_pos,10,90.0,(uint *)((int)npc->_config + 0x60),(Entity *)npc,color, &g_vectorZero,1.0); manager = g_manager; local_160 = 9.13647e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,10); (npc->_pos).x = (npc->_pos).x + 0.0; (npc->_pos).y = (npc->_pos).y - 40.0; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); room = (Room *)local_14c.x; local_164 = 0.0; if ((((EntityList *)((int)local_14c.x + 0x1218))->_updateEL)._size != 0) { do { roomEntity = *(int **)((int)(((EntityList *)((int)room + 0x1218))->_updateEL)._data + (int)local_164 * 4); iVar8 = roomEntity[10]; if (iVar8 == 9) { *(undefined1 *)((int)roomEntity + 0x173) = 1; } else if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar8 == 1)) || (iVar8 - 10U < 0x3de)) && ((*(char *)((int)roomEntity + 0x173) == '\0' && (roomEntity[0xd] == 0x3b7)))) { local_e4._colorize[0] = (npc->_pos).x; local_e4._colorize[1] = (npc->_pos).y; local_15c.x = *(float *)(*roomEntity + 0x24); local_e4._tint[0] = (float)npc->_type; local_e4._tint[1] = (float)npc->_variant; local_e4._tint[2] = (float)npc->_spawnerType; local_e4._tint[3] = (float)npc->_spawnerVariant; local_e4._colorize[2] = (npc->_velocity).x; local_e4._colorize[3] = (npc->_velocity).y; local_144.x = 2.8026e-45; if ((npc->_flags & 0x20000000) == 0) { local_144.x = 0.0; } local_160 = (float)(*(uint *)((int)&npc->_flags + 4) & 0x400000); if (local_160 == 0.0) { uVar3 = 0; } else { uVar3 = 4; } local_e4._offset[0] = (float)((npc->_flags & 0x100) != 0 | uVar3 | (uint)local_144.x); local_e4._offset[1] = (float)npc; (*(code *)local_15c.x)(&local_e4); } local_164 = (float)((int)local_164 + 1); } while ((uint)local_164 < (uint)(((EntityList *)((int)room + 0x1218))->_updateEL)._size); } } manager = g_manager; switch(npc->_state) { case 0: npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_pathfinder)._movementTarget.x = (npc->_pos).x; (npc->_pathfinder)._movementTarget.y = (npc->_pos).y; pVVar5 = MusicManager::RandomVector(&tmpVec); manager = g_manager; fVar10 = pVVar5->y; fVar15 = pVVar5->x; npc->_aiCallFlags = 1; (npc->_pathfinder)._moveDirection.x = fVar15; (npc->_pathfinder)._moveDirection.y = fVar10 * 0.5; uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x44000000; (npc->_pathfinder)._moveCountdown = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; npc->_stateFrame = 0; (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._enabledLayers = 0; return; case 3: ANM2::Play(&npc->_sprite,s_Idle,0); fVar10 = npc->_speedMultiplier; npc->_friction = 0.8; fVar15 = (npc->_pathfinder)._moveDirection.y; (npc->_velocity).x = (npc->_pathfinder)._moveDirection.x * 0.55 * fVar10 + (npc->_velocity).x; (npc->_velocity).y = fVar15 * 0.55 * fVar10 + (npc->_velocity).y; local_144.x = (float)Entity_NPC::GetPlayerTarget(npc); iVar8 = (npc->_pathfinder)._moveCountdown; if (iVar8 < 1) { uVar3 = Random(); (npc->_pathfinder)._moveCountdown = uVar3 % 0x14 + 0x14; local_15c.x = ((Vector *)((int)local_144.x + 0x33c))->x; if (local_15c.x < (npc->_pos).x || local_15c.x == (npc->_pos).x) { local_164 = 100.0; } else { local_164 = -100.0; } uVar3 = Random(); fVar10 = sin(((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.003 + 0.01) * npc->_updateTime); (npc->_pathfinder)._movementTarget.x = fVar10 * 100.0 + local_164 + local_15c.x; (npc->_pathfinder)._movementTarget.y = ((Vector *)((int)local_144.x + 0x33c))->y; pVVar5 = MusicManager::RandomVector(&tmpVec); fVar10 = pVVar5->y; fVar15 = (npc->_pathfinder)._movementTarget.y; (npc->_pathfinder)._movementTarget.x = pVVar5->x * 20.0 + (npc->_pathfinder)._movementTarget.x ; (npc->_pathfinder)._movementTarget.y = fVar10 * 20.0 + fVar15; } else { (npc->_pathfinder)._moveCountdown = iVar8 - (int)local_134; } fVar10 = (npc->_pos).x; local_144.x = (npc->_pathfinder)._movementTarget.x - fVar10; local_130 = (Entity_NPC *)((npc->_pathfinder)._movementTarget.y - (npc->_pos).y); if ((local_144.x == g_vectorZero.x) && ((float)local_130 == g_vectorZero.y)) { local_164 = (npc->_pathfinder)._moveDirection.x; } else { fVar10 = sin(npc->_updateTime * 0.01); local_15c.x = fVar10 * 30.0 * 0.017453292; local_164 = cos(local_15c.x); fVar12 = sin(local_15c.x); pVVar5 = &(npc->_pathfinder)._moveDirection; fVar14 = local_164 * (float)local_130; fVar10 = npc->_speedMultiplier; local_164 = (local_164 * local_144.x - fVar12 * (float)local_130) * 0.001 * fVar10 + pVVar5->x ; fVar15 = (npc->_pathfinder)._moveDirection.y; pVVar5->x = local_164; (npc->_pathfinder)._moveDirection.y = (fVar14 + fVar12 * local_144.x) * 0.001 * fVar10 + fVar15; fVar10 = (npc->_pos).x; } fVar15 = (room->_topLeftPos).x + 80.0; fVar16 = (room->_bottomRightPos).x - 80.0; fVar14 = (room->_topLeftPos).y + 100.0; fVar12 = (room->_bottomRightPos).y - 100.0; if ((fVar10 < fVar15) || (fVar13 = local_164, fVar15 = fVar16, fVar16 < fVar10)) { fVar13 = (fVar15 - fVar10) * 0.001 + local_164; (npc->_pathfinder)._moveDirection.x = fVar13; } fVar10 = (npc->_pos).y; if (fVar14 <= fVar10) { if (fVar12 < fVar10) { (npc->_pathfinder)._moveDirection.y = (fVar12 - fVar10) * 0.001 + (npc->_pathfinder)._moveDirection.y; } } else { (npc->_pathfinder)._moveDirection.y = (fVar14 - fVar10) * 0.001 + (npc->_pathfinder)._moveDirection.y; } fVar10 = (npc->_pathfinder)._moveDirection.y; fVar10 = sqrtf(fVar10 * fVar10 + fVar13 * fVar13); if (1.0 < fVar10) { Vector::Normalize(&(npc->_pathfinder)._moveDirection); } npc->_stateFrame = npc->_stateFrame + (int)local_134; manager = g_manager; if (0x59 < npc->_stateFrame) { local_164 = 9.16449e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); ANM2::Play(&npc->_sprite,(byte *)"DashStart",0); npc->_state = 8; return; } break; case 7: npc->_friction = 0.8; if (npc->_i1 == 0) { if ((npc->_sprite)._flipX == 0) { fVar10 = (room->_bottomRightPos).x + 40.0; bVar9 = fVar10 == (npc->_pos).x; isLess = fVar10 < (npc->_pos).x; } else { fVar15 = (room->_topLeftPos).x - 40.0; fVar10 = (npc->_pos).x; bVar9 = fVar10 == fVar15; isLess = fVar10 < fVar15; } if (!isLess && !bVar9) { npc->_i1 = 1; goto LAB_00446626; } if ((npc->_sprite)._flipX == 0) { fVar10 = -10.0; } else { fVar10 = 10.0; } fVar10 = fVar10 * npc->_speedMultiplier + (npc->_velocity).x; if (fVar10 <= -40.0) { fVar10 = -40.0; } if (40.0 <= fVar10) { fVar10 = 40.0; } (npc->_velocity).x = fVar10; iVar8 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar8 != 0) { uVar3 = Random(); VStack_154.x = (npc->_velocity).x; VStack_13c.x = (npc->_velocity).y; pVVar5 = MusicManager::RandomVector(&tmpVec); local_15c.x = (npc->_pos).x + 0.0; VStack_12c.x = pVVar5->x + pVVar5->x + VStack_154.x * 0.2; local_15c.y = (npc->_pos).y - 40.0; VStack_12c.y = pVVar5->y + pVVar5->y + VStack_13c.x * 0.2; pEVar7 = Game::Spawn(g_game,1000,0x3b,&local_15c,&VStack_12c,(Entity *)npc,0,uVar3); fVar10 = g_vectorOne.y * 2.0; (pEVar7->_sprite)._scale.x = g_vectorOne.x * 2.0; (pEVar7->_sprite)._scale.y = fVar10; uVar3 = Random(); *(float *)(pEVar7[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar3 = Random(); iVar8 = uVar3 % 0xf + 0xf; *(int *)(pEVar7[1]._sprite._filename._buf + 8) = iVar8; *(int *)(pEVar7[1]._sprite._filename._buf + 0xc) = iVar8; uVar4 = Color::Color(0x3f19999a); (**(code **)(*(int *)pEVar7 + 0x3c))(uVar4,0xffffffff,0xff,0,1); pEVar7->_renderDepthOffset = -5.0; } } else { LAB_00446626: npc->_friction = 0.88000005; fVar10 = (npc->_velocity).y; fVar15 = (npc->_velocity).x; fVar10 = sqrtf(fVar15 * fVar15 + fVar10 * fVar10); if (fVar10 < 8.0) { ANM2::Play(&npc->_sprite,(byte *)"DashEnd",0); } } bVar2 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if (bVar2 == 0) { npc->_friction = npc->_friction * 0.9; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_stateFrame = 0; npc->_state = 3; (npc->_pathfinder)._movementTarget.x = (npc->_pos).x; (npc->_pathfinder)._movementTarget.y = (npc->_pos).y; fVar10 = (npc->_velocity).x; fVar15 = (npc->_velocity).y; (npc->_pathfinder)._moveCountdown = 0; (npc->_pathfinder)._moveDirection.x = fVar10 * 0.1; (npc->_pathfinder)._moveDirection.y = fVar15 * 0.1; return; } break; case 8: npc->_friction = 0.8; manager = g_manager; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { local_164 = 9.1785e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); ANM2::Play(&npc->_sprite,(byte *)"DashLoop",0); } sprite = &npc->_sprite; bVar2 = Sprite::IsEventTriggered((Sprite *)sprite,&DAT_00b1d410); if (bVar2 != 0) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar10 = (pEVar7->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar10 && fVar10 != (npc->_pos).x; } bVar2 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x290,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x331,1.0,2,0,1.0); (npc->_velocity).y = 0.0; } pvVar1 = (npc->_sprite)._animState._animData; if (((pvVar1 == (void *)0x0) || (*(char *)((int)pvVar1 + 0x34) == '\0')) && (bVar2 = ANM2::WasEventTriggered(sprite,(byte *)"Shoot"), bVar2 == 0)) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar10 = npc->_speedMultiplier; fVar15 = ((pEVar7->_pos).y - (npc->_pos).y) * 0.003 + (npc->_pathfinder)._moveDirection.y; (npc->_pathfinder)._moveDirection.y = fVar15; (npc->_velocity).x = (npc->_pathfinder)._moveDirection.x * 0.3 * fVar10 + (npc->_velocity).x; (npc->_velocity).y = fVar15 * 0.3 * fVar10 + (npc->_velocity).y; } else { if ((npc->_sprite)._flipX == 0) { fVar10 = -8.0; } else { fVar10 = 8.0; } fVar10 = fVar10 * npc->_speedMultiplier + (npc->_velocity).x; if (fVar10 <= -30.0) { fVar10 = -30.0; } if (30.0 <= fVar10) { fVar10 = 30.0; } (npc->_velocity).x = fVar10; iVar8 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar8 != 0) { uVar3 = Random(); local_15c.x = (npc->_velocity).x; local_164 = (npc->_velocity).y; pVVar5 = MusicManager::RandomVector(&tmpVec); VStack_13c.x = (npc->_pos).x + 0.0; VStack_154.x = pVVar5->x + pVVar5->x + local_15c.x * 0.2; VStack_13c.y = (npc->_pos).y - 40.0; VStack_154.y = pVVar5->y + pVVar5->y + local_164 * 0.2; pEVar7 = Game::SpawnEx(g_game,1000,0x3b,&VStack_13c,&VStack_154,(Entity *)npc,0,uVar3,0); uVar3 = Random(); *(float *)(pEVar7[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar3 = Random(); iVar8 = uVar3 % 0xf + 0xf; *(int *)(pEVar7[1]._sprite._filename._buf + 8) = iVar8; *(int *)(pEVar7[1]._sprite._filename._buf + 0xc) = iVar8; uVar4 = Color::Color(0x3f19999a); (**(code **)(*(int *)pEVar7 + 0x3c))(uVar4,0xffffffff,0xff,0,1); fVar10 = g_vectorOne.y; fVar15 = g_vectorOne.x * 2.0; pEVar7->_renderDepthOffset = -5.0; (pEVar7->_sprite)._scale.x = fVar15; (pEVar7->_sprite)._scale.y = fVar10 * 2.0; } } if ((npc->_sprite)._flipX == 0) { fVar10 = ((Vector *)((int)local_14c.x + 0x14))->x - 180.0; bVar9 = fVar10 == (npc->_pos).x; isLess = fVar10 < (npc->_pos).x; } else { fVar15 = ((Vector *)((int)local_14c.x + 0x1c))->x + 180.0; fVar10 = (npc->_pos).x; bVar9 = fVar10 == fVar15; isLess = fVar10 < fVar15; } if (!isLess && !bVar9) { (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; npc->_state = 9; npc->_i1 = 5; return; } break; case 9: bVar2 = Vector::operator_eq(&npc->_v1,&g_vectorZero); if (bVar2 != 0) { uVar3 = Random(); if ((uVar3 & 1) == 0) { dashDirection = 1.0; } else { dashDirection = (float)&DAT_bf800000; } (npc->_v1).x = dashDirection; pVVar5 = &(npc->_pathfinder)._moveDirection; if ((pVVar5->x <= 0.0 && pVVar5->x != 0.0) == dashDirection < 0.0) { uVar3 = Random(); if ((uVar3 & 1) == 0) { puVar11 = (undefined1 *)0x3f800000; } else { puVar11 = &DAT_bf800000; } (npc->_v1).x = (float)puVar11; } uVar3 = Random(); fVar15 = (room->_topLeftPos).y + 80.0; fVar15 = (((room->_bottomRightPos).y - 80.0) - fVar15) * (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 + fVar15; fVar10 = (npc->_v1).x; (npc->_v1).y = fVar15; if (0.0 <= fVar10) { fVar12 = (room->_bottomRightPos).x + 200.0; } else { fVar12 = (room->_topLeftPos).x - 200.0; } (npc->_pos).x = fVar12; (npc->_pos).y = fVar15; (npc->_velocity).x = fVar10 * -40.0; (npc->_velocity).y = 0.0; fVar10 = (npc->_v1).x; (npc->_pathfinder)._moveDirection.y = 0.0; (npc->_pathfinder)._moveDirection.x = fVar10 * -10.0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"DashLoop",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; room = (Room *)local_14c.x; } (npc->_sprite)._flipX = (npc->_v1).x <= 0.0 && (npc->_v1).x != 0.0; } fVar10 = npc->_speedMultiplier; npc->_friction = 0.8; local_15c.x = fVar10 * (npc->_pathfinder)._moveDirection.x + (npc->_velocity).x; (npc->_velocity).x = local_15c.x; local_164 = fVar10 * (npc->_pathfinder)._moveDirection.y + (npc->_velocity).y; (npc->_velocity).y = local_164; fVar10 = local_164 * local_164 + local_15c.x * local_15c.x; if ((1600.0 < fVar10) && (fVar10 = sqrtf(fVar10), 0.0 < fVar10)) { (npc->_velocity).x = local_15c.x * (40.0 / fVar10); (npc->_velocity).y = local_164 * (40.0 / fVar10); } pvVar1 = (npc->_sprite)._animState._animData; if ((pvVar1 == (void *)0x0) || (*(char *)((int)pvVar1 + 0x34) == '\0')) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x290,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x331,1.0,2,0,1.0); if ((npc->_sprite)._flipX == 0) { fVar10 = -20.0; } else { fVar10 = 20.0; } VStack_154.x = fVar10 + (npc->_pos).x; VStack_154.y = (npc->_pos).y - 50.0; bloodCloudColor = (ColorMod *)Color::Color(0x3f4ccccd); Entity_NPC::MakeBloodCloud(npc,&VStack_154,bloodCloudColor); ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Scale = 1.5; pEVar7 = Entity_NPC::GetPlayerTarget(npc); VStack_13c.x = (pEVar7->_pos).x - VStack_154.x; VStack_13c.y = (pEVar7->_pos).y - VStack_154.y; Vector::Normalized(&VStack_13c,&local_144); local_164 = -NAN; do { local_15c.x = (float)(int)local_164 * 30.0 * 0.017453292; local_160 = cos(local_15c.x); fVar10 = sin(local_15c.x); iVar8 = 0; local_15c.x = local_160 * local_144.x - fVar10 * local_144.y; local_160 = local_160 * local_144.y + fVar10 * local_144.x; do { VStack_13c.x = 10.0 - ((float)iVar8 + (float)iVar8); VStack_13c.y = VStack_13c.x * local_160; VStack_13c.x = VStack_13c.x * local_15c.x; Entity_NPC::FireProjectiles(npc,&VStack_154,&VStack_13c,0,&projectileParams); iVar8 = iVar8 + 1; *(undefined4 *)(extraout_EAX + 0x414) = 0; *(undefined4 *)(extraout_EAX + 0x418) = 0xbdcccccd; } while (iVar8 < 5); local_164 = (float)((int)local_164 + 1); } while ((int)local_164 < 3); } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d410), bVar2 == 0)) { (npc->_pathfinder)._moveDirection.x = (npc->_pathfinder)._moveDirection.x * 0.8; (npc->_pathfinder)._moveDirection.y = (npc->_pathfinder)._moveDirection.y * 0.8; return; } fVar10 = (npc->_pos).x; fVar15 = (npc->_v1).x * 0.3 * npc->_speedMultiplier + (npc->_pathfinder)._moveDirection.x; if (fVar15 <= -10.0) { fVar15 = -10.0; } if (10.0 <= fVar15) { fVar15 = 10.0; } (npc->_pathfinder)._moveDirection.x = fVar15; if ((fVar10 < ((Vector *)((int)local_14c.x + 0x14))->x - 180.0) || (((Vector *)((int)local_14c.x + 0x1c))->x + 180.0 < fVar10)) { (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; iVar8 = npc->_i1 + -1; npc->_i1 = iVar8; if (iVar8 < 1) { npc->_state = 10; ANM2::Play(&npc->_sprite,(byte *)"Summon",0); (npc->_v1).x = 0.0; uVar3 = Random(); (npc->_v1).y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 6.2831855; uVar3 = Random(); (npc->_sprite)._flipX = (byte)uVar3 & 1; return; } } } else { fVar10 = (npc->_v1).x; if (((fVar10 < 0.0) && ((room->_topLeftPos).x - 160.0 < (npc->_pos).x)) || ((0.0 < fVar10 && (fVar10 = (room->_bottomRightPos).x + 160.0, (npc->_pos).x <= fVar10 && fVar10 != (npc->_pos).x)))) { ANM2::Play(&npc->_sprite,(byte *)"Reverse",0); (npc->_pathfinder)._moveDirection.x = (npc->_pathfinder)._moveDirection.x * 0.5; (npc->_pathfinder)._moveDirection.y = (npc->_pathfinder)._moveDirection.y * 0.5; return; } } break; case 10: if (npc->_visible != 0) { local_160 = (room->_topLeftPos).x - 120.0; fVar15 = (room->_bottomRightPos).x + 120.0; fVar10 = fVar15; if ((npc->_sprite)._flipX != 0) { fVar10 = local_160; local_160 = fVar15; } fVar15 = (npc->_v1).x; local_144.x = (local_160 - fVar10) * ((fVar15 - 0.0) / 240.0) + fVar10; fVar10 = (npc->_v1).y; (npc->_pathfinder)._movementTarget.x = local_144.x; local_164 = (room->_bottomRightPos).y + 80.0; local_15c.x = (room->_topLeftPos).y - 80.0; fVar10 = sin(fVar15 * 0.1 + fVar10); fVar10 = (fVar10 - -1.0) * 0.5; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } fVar15 = (npc->_v1).x; (npc->_pathfinder)._movementTarget.y = (local_164 - local_15c.x) * fVar10 + local_15c.x; if (fVar15 == 0.0) { (npc->_pos).x = local_144.x; (npc->_pos).y = (npc->_pathfinder)._movementTarget.y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } fVar10 = npc->_speedMultiplier; npc->_friction = 0.8; fVar15 = (npc->_pathfinder)._movementTarget.y; (npc->_velocity).x = ((npc->_pathfinder)._movementTarget.x - (npc->_pos).x) * 0.01 * fVar10 + (npc->_velocity).x; (npc->_velocity).y = (fVar15 - (npc->_pos).y) * 0.01 * fVar10 + (npc->_velocity).y; fVar10 = (npc->_pos).x; if ((npc->_sprite)._flipX == 0) { bVar9 = local_160 < fVar10; } else { bVar9 = fVar10 < local_160; } if (!bVar9 && fVar10 != local_160) { npc->_visible = 0; npc->_entityCollisionClass = 0; npc->_i1 = 0x5a; } fVar10 = 0.0; while( true ) { local_160 = fVar10; if ((npc->_flags & 0x4000) == 0) { bVar2 = Game::IsPaused(g_game); if (bVar2 == 0) { iVar8 = (int)((npc->_prevUpdateTime + 0.0) / -10.0) - (int)((npc->_updateTime + 0.0) / -10.0); } else { iVar8 = 0; } } else { iVar8 = 0; } if (iVar8 <= (int)fVar10) break; uVar3 = Random(); uVar6 = Random(); local_134 = (local_130->_pos).y; pVVar5 = Room::GetCenterPos(&tmpVec); VStack_13c.x = pVVar5->y; local_15c.x = (local_130->_pos).x; VStack_154.x = (local_130->_pos).y; rngValue = Random(); local_164 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_164 = local_164 + local_164; rngValue = Random(); local_144.x = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 20.0; fVar10 = cos(local_164); VStack_12c.x = fVar10 * local_144.x + local_15c.x + 0.0; fVar10 = sin(local_164); npc = local_130; VStack_12c.y = fVar10 * local_144.x + (local_134 - VStack_13c.x) * 0.2 + VStack_154.x; pEVar7 = Game::SpawnEx(g_game,0x3b7,0xb,&VStack_12c,&g_vectorZero,(Entity *)local_130, uVar6 % 3,uVar3,0); pEVar7->_health = 100.0; (**(code **)(*(int *)pEVar7 + 0xc))(); fVar10 = (float)((int)local_160 + 1); } (npc->_v1).x = (npc->_v1).x + npc->_speedMultiplier; return; } iVar8 = npc->_i1 - (int)local_134; npc->_friction = 0.8; npc->_i1 = iVar8; if (iVar8 < 1) { npc->_state = 7; npc->_visible = 1; npc->_entityCollisionClass = 4; ANM2::Play(&npc->_sprite,(byte *)"DashLoop",0); manager = g_manager; local_164 = 9.12245e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); if ((npc->_sprite)._flipX == 0) { fVar10 = ((Vector *)((int)local_14c.x + 0x1c))->x + 200.0; } else { fVar10 = ((Vector *)((int)local_14c.x + 0x14))->x - 200.0; } (npc->_pos).x = fVar10; uVar3 = Random(); (npc->_pos).y = (((Vector *)((int)local_14c.x + 0x1c))->y - ((Vector *)((int)local_14c.x + 0x14))->y) * ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.3) + ((Vector *)((int)local_14c.x + 0x14))->y; goto LAB_004451df; } break; case 0x10: if ((npc->_dead == 0) && (bVar2 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x292), bVar2 == 0)) { SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x292,1.0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { (npc->_sprite)._flipX = 0; Entity_NPC::PlaySound(npc,0x133,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"HeadLoop",0); npc->_stateFrame = 0; (npc->_v1).x = -90.0; (npc->_v1).y = -90.0; } npc->_friction = 0.8; bVar2 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if ((bVar2 != 0) || (bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"), bVar2 != 0) ) { pVVar5 = Room::GetCenterPos(&tmpVec); local_15c.y = (pVVar5->y - (npc->_pos).y) * 0.005; local_15c.x = (pVVar5->x - (npc->_pos).x) * 0.005; VStack_154.x = local_15c.x; VStack_13c.x = local_15c.y; fVar10 = sqrtf(local_15c.y * local_15c.y + local_15c.x * local_15c.x); if (fVar10 <= 1.0) { pullX = VStack_154.x; fVar10 = VStack_13c.x; } else { Vector::Normalize(&local_15c); pullX = local_15c.x; fVar10 = local_15c.y; } fVar15 = npc->_speedMultiplier; (npc->_velocity).x = pullX * fVar15 + (npc->_velocity).x; (npc->_velocity).y = fVar10 * fVar15 + (npc->_velocity).y; } bVar2 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if (bVar2 != 0) { local_14c.x = (npc->_pos).x; local_14c.y = (npc->_pos).y; if (0 < (int)local_134) { do { npc->_stateFrame = npc->_stateFrame + 1; uVar3 = npc->_stateFrame; uVar6 = uVar3 & 0x80000007; bVar9 = uVar6 == 0; if ((int)uVar6 < 0) { bVar9 = (uVar6 - 1 | 0xfffffff8) == 0xffffffff; } if (bVar9) { fVar10 = (npc->_v1).x + 26.96; if (360.0 < ABS(fVar10)) { fVar10 = fmodf(fVar10,360.0); } if (fVar10 <= 180.0) { if (fVar10 < -180.0) { fVar10 = fVar10 + 360.0; } } else { fVar10 = fVar10 - 360.0; } (npc->_v1).x = fVar10; fVar10 = (npc->_v1).y - 30.48; if (360.0 < ABS(fVar10)) { fVar10 = fmodf(fVar10,360.0); } if (fVar10 <= 180.0) { if (fVar10 < -180.0) { fVar10 = fVar10 + 360.0; } } else { fVar10 = fVar10 - 360.0; } (npc->_v1).y = fVar10; uVar6 = uVar3 & 0x8000001f; bVar9 = uVar6 == 0; if ((int)uVar6 < 0) { bVar9 = (uVar6 - 1 | 0xffffffe0) == 0xffffffff; } if (bVar9) { uVar3 = uVar3 & 0x8000003f; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xffffffc0) + 1; } if (uVar3 == 0) { local_164 = 0.0; } else { local_164 = 30.0; } ProjectileParams::ProjectileParams(&projectileParams); projectileParams.BulletFlags._0_4_ = 0x20; projectileParams.BulletFlags._4_4_ = 0; local_160 = 0.0; do { VStack_154.x = ((float)(int)local_160 * 60.0 + local_164) * 0.017453292; local_130 = (Entity_NPC *)cos(VStack_154.x); local_15c.x = sin(VStack_154.x); VStack_154.x = (float)local_130 * 16.0; iVar8 = 0; VStack_13c.x = local_15c.x * 16.0; local_144.x = 0.0; do { ringShotPos.x = VStack_154.x + local_14c.x; ringShotPos.y = VStack_13c.x + local_14c.y; VStack_12c.y = (float)(int)local_144.x + 8.0; projectileParams.Scale = (float)(int)local_144.x * 0.2 + 1.0; VStack_12c.x = (float)local_130 * VStack_12c.y; VStack_12c.y = local_15c.x * VStack_12c.y; Entity_NPC::FireProjectiles(npc,&ringShotPos,&VStack_12c,0,&projectileParams); *(int *)(extraout_EAX_00 + 0x448) = iVar8; iVar8 = iVar8 + 10; *(undefined4 *)(extraout_EAX_00 + 0x414) = 0; *(undefined4 *)(extraout_EAX_00 + 0x418) = 0xbdcccccd; local_144.x = (float)((int)local_144.x + 1); } while (iVar8 < 0x3c); local_160 = (float)((int)local_160 + 1); } while ((int)local_160 < 6); Color::Reset(&local_e4); local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 0.8; bloodCloudPos.x = local_14c.x + 0.0; bloodCloudPos.y = local_14c.y - 16.0; bloodCloud = Entity_NPC::MakeBloodCloud(npc,&bloodCloudPos,(ColorMod *)&local_e4); bloodCloud->_renderDepthOffset = 100.0; Entity_NPC::PlaySound(npc,0xb2,1.2,2,0,1.0); manager = g_manager; local_164 = 9.20653e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); } else { ProjectileParams::ProjectileParams(&projectileParams); iVar8 = -1; do { VStack_154.x = ((float)iVar8 * 25.0 + (npc->_v1).y) * 0.017453292; VStack_13c.x = cos(VStack_154.x); fVar10 = sin(VStack_154.x); sideShotVelocity.x = (float)iVar8 + (float)iVar8 + 9.0; sideShotVelocity.y = sideShotVelocity.x * fVar10; sideShotVelocity.x = sideShotVelocity.x * VStack_13c.x; sideShotPos.y = fVar10 * 30.0 + local_14c.y; sideShotPos.x = VStack_13c.x * 30.0 + local_14c.x; Entity_NPC::FireProjectiles(npc,&sideShotPos,&sideShotVelocity,0,&projectileParams); iVar8 = iVar8 + 2; projectileParams.Scale = 1.2; *(undefined4 *)(extraout_EAX_01 + 0x414) = 0; *(undefined4 *)(extraout_EAX_01 + 0x418) = 0xbdcccccd; } while (iVar8 < 2); VStack_154.x = (npc->_v1).x * 0.017453292; bloodVelocityA.x = cos(VStack_154.x); bloodVelocityA.x = bloodVelocityA.x * 6.0; bloodVelocityA.y = sin(VStack_154.x); bloodVelocityA.y = bloodVelocityA.y * 6.0; Color::Reset(&local_e4); bloodOffset.x = 0.0; bloodOffset.y = -16.0; local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 0.8; pEVar7 = spawn_blood_explosion (4,&local_14c,&bloodOffset,(ColorMod *)&local_e4,&bloodVelocityA); pEVar7->_renderDepthOffset = 100.0; VStack_154.x = (npc->_v2).x * 0.017453292; bloodVelocityB.x = cos(VStack_154.x); bloodVelocityB.x = bloodVelocityB.x * 6.0; bloodVelocityB.y = sin(VStack_154.x); bloodVelocityB.y = bloodVelocityB.y * 6.0; Color::Reset(&local_e4); tmpVec.x = 0.0; tmpVec.y = -16.0; local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 0.8; pEVar7 = spawn_blood_explosion (3,&local_14c,&tmpVec,(ColorMod *)&local_e4,&bloodVelocityB); pEVar7->_renderDepthOffset = 100.0; Entity_NPC::PlaySound(npc,0x99,1.0,2,0,1.0); } } local_134 = (float)((int)local_134 + -1); } while (local_134 != 0.0); } } break; case 99: local_164 = 9.12245e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); npc->_state = 7; npc->_visible = 1; npc->_entityCollisionClass = 4; ANM2::Play(&npc->_sprite,(byte *)"DashLoop",0); LAB_004451df: if ((npc->_sprite)._flipX == 0) { fVar10 = -40.0; } else { fVar10 = 40.0; } (npc->_velocity).x = fVar10; (npc->_velocity).y = 0.0; npc->_i1 = 0; return; } return; } //@@ 00447180 NpcAI::ENTITY_BEAST_ultra_famine_fly /* DB: ? 951 variant switch case 0xb (variant 11); m_Parent downcast, CalcTargetPosition, IsPositionInRoom, 1299 bytes */ void __fastcall NpcAI::ENTITY_BEAST_ultra_famine_fly(Entity_NPC *npc) { int iVar1; byte bVar2; Vector *pVVar3; uint uVar4; byte *curAnimName; byte *wantedAnimName; bool isLess; float fVar5; float fVar6; float velX; float dirX; Vector local_20; Vector local_18; Vector local_10; byte *animData; Game *game; float *maxHp; float speedMult; iVar1 = npc->_state; if (iVar1 != 0) { if (iVar1 == 3) { if (npc->_stateFrame < 1) { npc->_state = 8; npc->_stateFrame = 10; } else { uVar4 = Random(); npc->_friction = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.8) * npc->_friction; Entity_NPC::CalcTargetPosition(npc,&local_10,0.0); dirX = local_10.x - (npc->_pos).x; local_20.x = local_10.y - (npc->_pos).y; uVar4 = Random(); local_18.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar5 = sqrtf(dirX * dirX + local_20.x * local_20.x); if (0.0 < fVar5) { dirX = dirX * (local_18.x / fVar5); local_20.x = local_20.x * (local_18.x / fVar5); } uVar4 = Random(); local_18.x = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292; local_10.x = cos(local_18.x); fVar6 = sin(local_18.x); game = g_game; fVar5 = npc->_speedMultiplier; velX = fVar5 * (local_10.x * dirX - fVar6 * local_20.x) + (npc->_velocity).x; (npc->_velocity).x = velX; (npc->_velocity).y = fVar5 * (fVar6 * dirX + local_10.x * local_20.x) + (npc->_velocity).y; fVar5 = (npc->_pos).y; fVar6 = *(float *)((int)game->_room + 0x18) + 80.0; if (fVar5 < fVar6) { speedMult = npc->_speedMultiplier; (npc->_velocity).x = speedMult * 0.0 + velX; (npc->_velocity).y = (fVar6 - fVar5) * 0.4 * speedMult + (npc->_velocity).y; } npc->_stateFrame = npc->_stateFrame + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); } } else if (iVar1 == 8) { if (npc->_stateFrame < 1) { fVar5 = npc->_speedMultiplier; npc->_friction = 0.86; fVar6 = (npc->_v1).y; (npc->_velocity).x = (npc->_v1).x * 0.4 * fVar5 + (npc->_velocity).x; (npc->_velocity).y = fVar6 * 0.4 * fVar5 + (npc->_velocity).y; } else { npc->_friction = 0.8; iVar1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; npc->_stateFrame = iVar1; if (iVar1 < 1) { pVVar3 = Entity_NPC::CalcTargetPosition(npc,&local_18,0.0); local_10.x = pVVar3->x - (npc->_pos).x; local_10.y = pVVar3->y - (npc->_pos).y; pVVar3 = Vector::Normalized(&local_10,&local_20); fVar5 = pVVar3->y; (npc->_v1).x = pVVar3->x * 6.0; (npc->_v1).y = fVar5 * 6.0; } } } goto LAB_004475d1; } animData = (npc->_sprite)._animState._animData; pVVar3 = &local_10; if ((uint)npc->_subtype < 3) { pVVar3 = (Vector *)&npc->_subtype; } local_10.x = 4.2039e-45; local_20.x = (float)(&PTR_s_Idle_00b1d444)[-(uint)(pVVar3->x != 0.0) & (uint)pVVar3->x]; if (animData == (byte *)0x0) { LAB_0044759f: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)local_20.x,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; wantedAnimName = (byte *)local_20.x; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } do { bVar2 = *curAnimName; isLess = bVar2 < *wantedAnimName; if (bVar2 != *wantedAnimName) { LAB_00447585: uVar4 = -(uint)isLess | 1; goto LAB_0044758a; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; isLess = bVar2 < wantedAnimName[1]; if (bVar2 != wantedAnimName[1]) goto LAB_00447585; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0044758a: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0044759f; } npc->_state = 3; npc->_stateFrame = 0x46; LAB_004475d1: bVar2 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-100.0); if (bVar2 == 0) { (**(code **)(*(int *)npc + 0x28))(); } maxHp = &npc->_maxHitPoints; if ((((*maxHp <= npc->_health && npc->_health != *maxHp) && ((npc->_flags & 0x4000) == 0)) && (bVar2 = Game::IsPaused(g_game), bVar2 == 0)) && ((int)((npc->_prevUpdateTime + 0.0) / -15.0) != (int)((npc->_updateTime + 0.0) / -15.0))) { local_10.x = npc->_health - 10.0; pVVar3 = &local_10; if (local_10.x < *maxHp || local_10.x == *maxHp) { pVVar3 = (Vector *)maxHp; } npc->_health = pVVar3->x; } return; } //@@ 004476a0 Color::Color /* DB: sets white then copies tint */ void Color::Color(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = 0x3f800000; in_ECX[1] = 0x3f800000; in_ECX[2] = 0x3f800000; in_ECX[3] = 0x3f800000; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; return; } //@@ 00447720 set_field_0x37c /* DB: ? ICF-foldable setter this+0x37c */ void set_field_0x37c(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x37c) = param_1; return; } //@@ 00447740 Entity_Projectile::set_projectile_flags /* DB: tiny: writes 64-bit +0x438 (Lua ProjectileFlags) (dogma_effects.md) */ void __thiscall Entity_Projectile::set_projectile_flags (Entity_Projectile *this,undefined4 param_2,undefined4 param_3) { *(undefined4 *)&this->_projectileFlags = param_2; *(undefined4 *)((int)&this->_projectileFlags + 4) = param_3; return; } //@@ 00447760 FUN_00447760 undefined4 FUN_00447760(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0xb64); } //@@ 00447770 Entity_NPC::ParentNPC /* ZHL [lua] Lua binding EntityNPC:ParentNPC prototype: db/protos.zhl, confirmed by RET 0 */ Entity_NPC * __thiscall Entity_NPC::ParentNPC(Entity_NPC *this) { int iVar1; EntityPtr EVar2; EVar2 = (EntityPtr)0x0; if (this->_parent != (EntityPtr)0x0) { iVar1 = __RTDynamicCast(this->_parent,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } EVar2 = this->_parent; } return (Entity_NPC *)EVar2; } //@@ 004477b0 NpcAI::ENTITY_BEAST_ultra_pestilence /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: dispatcher case type 951 sub-switch variant 0x14 (20 = Ultra Pestilence); strs HeadlessIdle/HeadlessSpit/HorseSpit/MaggotAttack, spawn_small_maggot */ void __fastcall NpcAI::ENTITY_BEAST_ultra_pestilence(Entity_NPC *npc) { undefined4 uVar1; byte bVar2; uint uVar3; Entity *pEVar4; uint uVar5; uint rngResult; byte *pbVar6; byte *curAnimName; int extraout_EAX; Vector *shootPosOffset; int extraout_EAX_00; byte *animNameCursor2; EntityPtr *pEVar7; int iVar8; char *animNameCursor; int *piVar9; Room *room; int iVar10; bool bVar11; float fVar12; float fVar13; float fVar14; undefined1 auVar15 [12]; float minX; float maxX; undefined1 auStack_210 [4]; EntityPtr *local_20c; Vector local_208; char local_1fd; float local_1fc; Vector local_1f8; AnimationState *local_1f0; Vector local_1ec; Vector local_1e4; EntityPtr local_1dc; Room *roomCopy; Vector local_1d4; Vector local_1cc; int elapsedUpdates; Color local_1c0; ColorMod tmpColor; ProjectileParams projParams; ProjectileParams projParams2; uint local_c; Manager *manager; manager = g_manager; local_c = __security_cookie ^ (uint)auStack_210; elapsedUpdates = (int)npc->_updateTime - (int)npc->_prevUpdateTime; room = g_game->_room; iVar10 = npc->_state; local_1dc = (EntityPtr)npc; roomCopy = room; if (npc->_aiCallPhase == 1) { if (iVar10 != 0x12) { return; } fVar12 = npc->_speedMultiplier; npc->_friction = 0.8; (npc->_velocity).y = fVar12 * 0.4 + (npc->_velocity).y; (npc->_velocity).x = fVar12 * 0.0 + (npc->_velocity).x; if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Explosion"); if (bVar2 == 0) { return; } local_1dc = (EntityPtr)0x0; if ((room->_entityList)._updateEL._size != 0) { do { piVar9 = *(int **)((int)(room->_entityList)._updateEL._data + (int)local_1dc * 4); iVar10 = piVar9[10]; if (iVar10 == 9) { *(undefined1 *)((int)piVar9 + 0x173) = 1; } else if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar10 == 1)) || (iVar10 - 10U < 0x3de)) && ((*(char *)((int)piVar9 + 0x173) == '\0' && (piVar9[0xd] == 0x3b7)))) { local_1c0._colorize[0] = (npc->_pos).x; local_1c0._colorize[1] = (npc->_pos).y; local_208.x = *(float *)(*piVar9 + 0x24); local_1c0._tint[0] = (float)npc->_type; local_1c0._tint[1] = (float)npc->_variant; local_1c0._tint[2] = (float)npc->_spawnerType; local_1c0._tint[3] = (float)npc->_spawnerVariant; local_1c0._colorize[2] = (npc->_velocity).x; local_1c0._colorize[3] = (npc->_velocity).y; local_1f0 = (AnimationState *)(uint)((npc->_flags & 0x100) != 0); local_1ec.x = 2.8026e-45; if ((npc->_flags & 0x20000000) == 0) { local_1ec.x = 0.0; } if ((npc->_flags & 0x40000000000000) == 0) { uVar3 = 0; } else { uVar3 = 4; } local_1c0._offset[1] = (float)npc; local_1c0._offset[0] = (float)(uVar3 | (uint)local_1ec.x | (uint)local_1f0); (*(code *)local_208.x)(&local_1c0); } local_1dc = (EntityPtr)((int)local_1dc + 1); } while ((uint)local_1dc < (uint)(room->_entityList)._updateEL._size); } local_1fc = 1.68156e-44; do { uVar3 = Random(); local_1ec.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1ec.x = local_1ec.x + local_1ec.x; uVar3 = Random(); local_1f0 = (AnimationState *) ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 8.0); fVar12 = cos(local_1ec.x); local_1dc = (EntityPtr)(fVar12 * (float)local_1f0); fVar12 = sin(local_1ec.x); local_20c = (EntityPtr *)(fVar12 * (float)local_1f0); local_208.x = (float)local_1dc + 0.0; uVar3 = Random(); local_208.y = (-8.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 4.0) + (float)local_20c; local_1f8.y = (float)local_20c + (float)local_20c + (npc->_pos).y; local_1f8.x = (float)local_1dc + (float)local_1dc + (npc->_pos).x; pEVar4 = spawn_small_maggot(&local_1f8,0.0,&local_208,-8.0); pEVar4->_entityCollisionClass = 0; uVar3 = Random(); local_1fc = (float)((int)local_1fc + -1); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.0; fVar13 = fVar12 * g_vectorOne.y; fVar12 = fVar12 * g_vectorOne.x; pEVar4->_mass = 15.0; (pEVar4->_sprite)._scale.y = fVar13; (pEVar4->_sprite)._scale.x = fVar12; } while (local_1fc != 0.0); return; } local_1f0 = (AnimationState *)0x3f800000; if ((((iVar10 != 3) && (iVar10 != 8)) && (iVar10 != 9)) || (fVar12 = npc->_maxHitPoints * 0.4, fVar12 < npc->_health || fVar12 == npc->_health)) { if (npc->_dead != 0) { local_1ec.x = 9.30462e-43; seed_fart_sound_override((int *)&local_1ec); SoundEffects::Play(&manager->_sfxManager,(int)local_1ec.x,1.0,2,0,1.0,0.0); room = roomCopy; } } else { spawn_gibs(&npc->_pos,10,90.0,(uint *)((int)npc->_config + 0x60),(Entity *)npc,&npc->_splatColor ,&g_vectorZero,1.0); Game::ShakeScreen(g_game,10); npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); manager = g_manager; local_1fc = 1.0; if (npc->_championColorIdx == 0x12) { local_1fc = 1.5; } else if (npc->_championColorIdx == 0x13) { local_1fc = 0.5; } local_1ec.x = 9.29061e-43; seed_fart_sound_override((int *)&local_1ec); SoundEffects::Play(&manager->_sfxManager,(int)local_1ec.x,1.0,2,0,local_1fc,0.0); manager = g_manager; local_1fc = 1.0; if (npc->_championColorIdx == 0x12) { local_1fc = 1.5; } else if (npc->_championColorIdx == 0x13) { local_1fc = 0.5; } local_1ec.x = 9.36067e-43; seed_fart_sound_override((int *)&local_1ec); SoundEffects::Play(&manager->_sfxManager,(int)local_1ec.x,1.0,2,0,local_1fc,0.0); local_1fc = 0.0; npc->_aiFloat = npc->_maxHitPoints * 0.4; room = roomCopy; if ((roomCopy->_entityList)._updateEL._size != 0) { do { piVar9 = *(int **)((int)(room->_entityList)._updateEL._data + (int)local_1fc * 4); iVar10 = piVar9[10]; if (iVar10 == 9) { piVar9[0x10e] = 0; piVar9[0x10f] = 0; LAB_00447ecd: *(undefined1 *)((int)piVar9 + 0x173) = 1; } else if ((((*(int *)&g_game->_deathmatchManager < 2) || (iVar10 != 1)) && (0x3dd < iVar10 - 10U)) || ((*(char *)((int)piVar9 + 0x173) != '\0' || (piVar9[0xd] != 0x3b7)))) { LAB_00447ebc: if ((iVar10 == 1000) && (piVar9[0xb] == 0x8d)) goto LAB_00447ecd; } else { if ((iVar10 == 0x3b7) && (piVar9[0xb] == 0x15)) { bVar11 = true; } else { bVar11 = false; } if (bVar11) goto LAB_00447ebc; local_1c0._colorize[0] = (npc->_pos).x; local_1c0._colorize[1] = (npc->_pos).y; local_208.x = *(float *)(*piVar9 + 0x24); local_1c0._tint[0] = (float)npc->_type; local_1c0._tint[1] = (float)npc->_variant; local_1c0._tint[2] = (float)npc->_spawnerType; local_1c0._tint[3] = (float)npc->_spawnerVariant; local_1c0._colorize[2] = (npc->_velocity).x; local_1c0._colorize[3] = (npc->_velocity).y; local_1ec.x = 2.8026e-45; if ((npc->_flags & 0x20000000) == 0) { local_1ec.x = 0.0; } if ((npc->_flags & 0x40000000000000) == 0) { uVar3 = 0; } else { uVar3 = 4; } local_1c0._offset[1] = (float)npc; local_1c0._offset[0] = (float)((uint)((npc->_flags & 0x100) != 0) | (uint)local_1ec.x | uVar3); (*(code *)local_208.x)(&local_1c0); room = roomCopy; } local_1fc = (float)((int)local_1fc + 1); } while ((uint)local_1fc < (uint)(room->_entityList)._updateEL._size); } } local_1ec.x = 10.0; if (npc->_state == 0) { local_20c = (EntityPtr *)0x10; LAB_00447fc6: iVar10 = (room->_entityList)._updateEL._size; if (iVar10 == 0) { local_1fc = 0.0; local_208.x = 0.0; if (local_20c == (EntityPtr *)0x0) goto LAB_0044829a; } else { piVar9 = (room->_entityList)._updateEL._data; uVar3 = 0; do { if ((*(int *)(*piVar9 + 0x28) != 0x3b7) || (local_1fd = '\x01', *(int *)(*piVar9 + 0x2c) != 0x15)) { local_1fd = '\0'; } local_1fc = (float)(uVar3 + 1); if (local_1fd == '\0') { local_1fc = (float)uVar3; } piVar9 = piVar9 + 1; iVar10 = iVar10 + -1; uVar3 = (uint)local_1fc; } while (iVar10 != 0); npc = (Entity_NPC *)local_1dc; } local_208.x = 0.0; do { if (0x17 < (int)local_1fc) break; uVar3 = Random(); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1f8.x = fVar12 + fVar12; local_1d4.x = cos(local_1f8.x); local_1f8.x = sin(local_1f8.x); uVar3 = Random(); uVar5 = Random(); rngResult = Random(); local_1cc.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; local_1cc.y = local_1cc.x * local_1f8.x; local_1cc.x = local_1cc.x * local_1d4.x; rngResult = Random(); npc = (Entity_NPC *)local_1dc; fVar12 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 20.0 + 10.0; local_1e4.y = fVar12 * local_1f8.x + *(float *)((int)local_1dc + 0x340); local_1e4.x = fVar12 * local_1d4.x + *(float *)((int)local_1dc + 0x33c); pEVar4 = Game::SpawnEx(g_game,0x3b7,0x15,&local_1e4,&local_1cc,(Entity *)local_1dc,uVar5 % 3, uVar3,0); pEVar4->_health = 50.0; if (pEVar4->_parent != (EntityPtr)0x0) { local_1f8.x = (float)&pEVar4->_parent; std::multiset::erase(&local_1f8); } pEVar4->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar4->_parent); uVar1 = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar1; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 0.0; (**(code **)(*(int *)pEVar4 + 0x3c))(&tmpColor,0xf,1,1,1); uVar3 = Random(); iVar10 = *(int *)pEVar4; fVar13 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar12 = fVar13 * g_vectorOne.x; (pEVar4->_sprite)._scale.y = fVar13 * g_vectorOne.y; (pEVar4->_sprite)._scale.x = fVar12; (**(code **)(iVar10 + 0xc))(); local_208.x = (float)((int)local_208.x + 1); local_1fc = (float)((int)local_1fc + 1); } while ((int)local_208.x < (int)local_20c); } else if ((((npc->_flags & 0x4000) == 0) && (bVar2 = Game::IsPaused(g_game), bVar2 == 0)) && (local_20c = (EntityPtr *) ((int)((npc->_prevUpdateTime + 0.0) / -30.0) - (int)((npc->_updateTime + 0.0) / -30.0)), 0 < (int)local_20c)) goto LAB_00447fc6; LAB_0044829a: switch(*(int *)((int)npc + 0xb64)) { case 0: curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName != (byte *)0x0) { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor2 = s_Idle; do { bVar2 = *pbVar6; bVar11 = bVar2 < *animNameCursor2; if (bVar2 != *animNameCursor2) { LAB_004482f0: uVar3 = -(uint)bVar11 | 1; goto LAB_004482f5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < animNameCursor2[1]; if (bVar2 != animNameCursor2[1]) goto LAB_004482f0; pbVar6 = pbVar6 + 2; animNameCursor2 = animNameCursor2 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004482f5: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_0044832c; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } LAB_0044832c: manager = g_manager; local_20c = (EntityPtr *)0x29b; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x334) = *(undefined4 *)((int)npc + 0x33c); *(undefined4 *)((int)npc + 0x338) = *(undefined4 *)((int)npc + 0x340); *(undefined4 *)((int)npc + 0x418) = *(undefined4 *)((int)npc + 0x33c); *(undefined4 *)((int)npc + 0x41c) = *(undefined4 *)((int)npc + 0x340); uVar3 = Random(); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20c = (EntityPtr *)(fVar12 + fVar12); local_208.x = cos((float)local_20c); fVar12 = sin((float)local_20c); *(float *)((int)npc + 0x420) = local_208.x; *(float *)((int)npc + 0x424) = fVar12 * 0.5; *(undefined4 *)((int)npc + 0x43c) = 0; fVar14 = g_colorGreenSplat._tint[3]; fVar13 = g_colorGreenSplat._tint[2]; fVar12 = g_colorGreenSplat._tint[1]; if ((ColorMod *)((int)npc + 0x1e4) != &g_colorGreenSplat) { ((ColorMod *)((int)npc + 0x1e4))->_tint[0] = g_colorGreenSplat._tint[0]; *(float *)((int)npc + 0x1e8) = fVar12; *(float *)((int)npc + 0x1ec) = fVar13; *(float *)((int)npc + 0x1f0) = fVar14; fVar14 = g_colorGreenSplat._colorize[3]; fVar13 = g_colorGreenSplat._colorize[2]; fVar12 = g_colorGreenSplat._colorize[1]; *(float *)((int)npc + 500) = g_colorGreenSplat._colorize[0]; *(float *)((int)npc + 0x1f8) = fVar12; *(float *)((int)npc + 0x1fc) = fVar13; *(float *)((int)npc + 0x200) = fVar14; *(undefined8 *)((int)npc + 0x204) = g_colorGreenSplat._offset._0_8_; *(float *)((int)npc + 0x20c) = g_colorGreenSplat._offset[2]; } manager = g_manager; *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) | 0x44000000; *(undefined4 *)((int)npc + 0x410) = 0; *(undefined4 *)((int)npc + 0xba0) = 0; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); *(undefined4 *)((int)npc + 0xf18) = 1; (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._enabledLayers = 0; piVar9 = &(manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]. _enabledLayers; *piVar9 = *piVar9 | 1; return; default: goto LAB_00449fa0; case 3: case 4: if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { curAnimName = *(byte **)((int)npc + 0x7c); local_20c = (EntityPtr *)s_Idle; if (*(int *)((int)npc + 0xb64) != 3) { local_20c = (EntityPtr *)"HeadlessIdle"; } if (curAnimName != (byte *)0x0) { pbVar6 = curAnimName; pEVar7 = local_20c; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } do { bVar2 = *pbVar6; bVar11 = bVar2 < *(byte *)pEVar7; if (bVar2 != *(byte *)pEVar7) { LAB_00448681: uVar3 = -(uint)bVar11 | 1; goto LAB_00448686; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < (byte)pEVar7->field_0x1; if (bVar2 != pEVar7->field_0x1) goto LAB_00448681; pbVar6 = pbVar6 + 2; pEVar7 = (EntityPtr *)&pEVar7->field_0x2; } while (bVar2 != 0); uVar3 = 0; LAB_00448686: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004486bc; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)local_20c,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } LAB_004486bc: *(undefined4 *)((int)npc + 0x36c) = 0x3f4ccccd; *(float *)((int)npc + 0x360) = *(float *)((int)npc + 0x420) * 0.55 * *(float *)((int)npc + 0x39c) + *(float *)((int)npc + 0x360); *(float *)((int)npc + 0x364) = *(float *)((int)npc + 0x424) * 0.55 * *(float *)((int)npc + 0x39c) + *(float *)((int)npc + 0x364); Entity_NPC::GetPlayerTarget(npc); if (*(int *)((int)npc + 0x43c) < 1) { uVar3 = Random(); *(uint *)((int)npc + 0x43c) = uVar3 % 0x14 + 0x14; uVar3 = Random(); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20c = (EntityPtr *)(fVar12 + fVar12); uVar3 = Random(); local_208.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 60.0 + 20.0; fVar12 = cos((float)local_20c); local_1e4.x = fVar12 * local_208.x + *(float *)((int)npc + 0x418); fVar12 = sin((float)local_20c); room = roomCopy; local_1e4.y = fVar12 * local_208.x + *(float *)((int)npc + 0x41c); Room::GetClampedPositionImpl(roomCopy,&local_1cc,&local_1e4,60.0,60.0,60.0,60.0); *(float *)((int)npc + 0x418) = local_1cc.x; *(float *)((int)npc + 0x41c) = local_1cc.y; } else { *(int *)((int)npc + 0x43c) = *(int *)((int)npc + 0x43c) - elapsedUpdates; room = roomCopy; } fVar12 = *(float *)((int)npc + 0x33c); local_208.x = *(float *)((int)npc + 0x418) - fVar12; local_1d4.x = *(float *)((int)npc + 0x41c) - *(float *)((int)npc + 0x340); if ((local_208.x != g_vectorZero.x) || (local_1d4.x != g_vectorZero.y)) { fVar12 = sin(*(float *)((int)npc + 0x3a4) * 0.01); local_20c = (EntityPtr *)(fVar12 * 30.0 * 0.017453292); local_1f8.x = cos((float)local_20c); fVar12 = sin((float)local_20c); *(float *)((int)npc + 0x420) = (local_208.x * local_1f8.x - fVar12 * local_1d4.x) * 0.001 * *(float *)((int)npc + 0x39c) + *(float *)((int)npc + 0x420); *(float *)((int)npc + 0x424) = (local_1f8.x * local_1d4.x + local_208.x * fVar12) * 0.001 * *(float *)((int)npc + 0x39c) + *(float *)((int)npc + 0x424); fVar12 = *(float *)((int)npc + 0x33c); } minX = (room->_topLeftPos).x + 180.0; maxX = (room->_bottomRightPos).x - 180.0; fVar14 = (room->_topLeftPos).y + 180.0; fVar13 = (room->_bottomRightPos).y - 180.0; if (*(int *)((int)npc + 0xb64) == 4) { fVar13 = fVar14 + 80.0; } if (minX <= fVar12) { if (maxX < fVar12) { *(float *)((int)npc + 0x420) = (maxX - fVar12) * 0.002 + *(float *)((int)npc + 0x420); } } else { *(float *)((int)npc + 0x420) = (minX - fVar12) * 0.002 + *(float *)((int)npc + 0x420); } fVar12 = *(float *)((int)npc + 0x340); if (fVar14 <= fVar12) { if (fVar13 < fVar12) { *(float *)((int)npc + 0x424) = (fVar13 - fVar12) * 0.002 + *(float *)((int)npc + 0x424); } } else { *(float *)((int)npc + 0x424) = (fVar14 - fVar12) * 0.002 + *(float *)((int)npc + 0x424); } local_20c = *(EntityPtr **)((int)npc + 0x420); local_208.x = *(float *)((int)npc + 0x424); fVar12 = sqrtf((float)local_20c * (float)local_20c + local_208.x * local_208.x); if ((1.0 < fVar12) && (0.0 < fVar12)) { *(float *)((int)npc + 0x420) = (float)local_20c * (1.0 / fVar12); *(float *)((int)npc + 0x424) = local_208.x * (1.0 / fVar12); } iVar10 = *(int *)((int)npc + 0x410) + elapsedUpdates; *(int *)((int)npc + 0x410) = iVar10; if (*(int *)((int)npc + 0xb64) != 3) { if ((*(float *)((int)npc + 0x380) <= *(float *)((int)npc + 0xc34) && *(float *)((int)npc + 0xc34) != *(float *)((int)npc + 0x380)) && (0x3b < iVar10)) { *(undefined4 *)((int)npc + 0xb64) = 0xd; curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName != (byte *)0x0) { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor = "HorseSpit"; do { bVar2 = *pbVar6; bVar11 = bVar2 < (byte)*animNameCursor; if (bVar2 != *animNameCursor) { LAB_00448d60: uVar3 = -(uint)bVar11 | 1; goto LAB_00448d65; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < (byte)animNameCursor[1]; if (bVar2 != animNameCursor[1]) goto LAB_00448d60; pbVar6 = pbVar6 + 2; animNameCursor = animNameCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00448d65: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_00448d9c; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"HorseSpit",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } LAB_00448d9c: pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar12 = (pEVar4->_pos).x; *(bool *)((int)npc + 0x148) = *(float *)((int)npc + 0x33c) <= fVar12 && fVar12 != *(float *)((int)npc + 0x33c); *(float *)((int)npc + 0xc34) = *(float *)((int)npc + 0xc34) - *(float *)((int)npc + 900) * 0.2; return; } if (iVar10 < 0x78) { return; } *(undefined4 *)((int)npc + 0xb64) = 7; curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName == (byte *)0x0) { LAB_00448e5e: bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"HeadlessSpit",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor = "HeadlessSpit"; do { bVar2 = *pbVar6; bVar11 = bVar2 < (byte)*animNameCursor; if (bVar2 != *animNameCursor) { LAB_00448e40: uVar3 = -(uint)bVar11 | 1; goto LAB_00448e45; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < (byte)animNameCursor[1]; if (bVar2 != animNameCursor[1]) goto LAB_00448e40; pbVar6 = pbVar6 + 2; animNameCursor = animNameCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00448e45: if ((uVar3 != 0) || ((curAnimName[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_00448e5e; } manager = g_manager; local_20c = (EntityPtr *)0x296; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); manager = g_manager; local_20c = (EntityPtr *)0x2a0; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); goto LAB_00448f04; } if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Sound"); manager = g_manager; iVar10 = *(int *)((int)npc + 0x410); if (bVar2 != 0) { if (*(int *)((int)npc + 0xc64) == 0x12) { local_1f0 = (AnimationState *)0x3fc00000; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_1f0 = (AnimationState *)0x3f000000; } local_20c = (EntityPtr *)0x1d; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,(float)local_1f0,0.0); iVar10 = *(int *)((int)npc + 0x410); } } if ((*(int *)((int)npc + 0x3c0) != 0) && (0x3c < iVar10)) { *(undefined4 *)((int)npc + 0x410) = 0x3c; return; } if (iVar10 < 0x5a) { return; } if (*(int *)((int)npc + 0xba0) < 3) { *(undefined4 *)((int)npc + 0xb64) = 8; curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName != (byte *)0x0) { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor2 = &DAT_00b1d47c; do { bVar2 = *pbVar6; bVar11 = bVar2 < *animNameCursor2; if (bVar2 != *animNameCursor2) { LAB_00448c75: uVar3 = -(uint)bVar11 | 1; goto LAB_00448c7a; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < animNameCursor2[1]; if (bVar2 != animNameCursor2[1]) goto LAB_00448c75; pbVar6 = pbVar6 + 2; animNameCursor2 = animNameCursor2 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00448c7a: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_00448ca6; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),&DAT_00b1d47c,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } LAB_00448ca6: manager = g_manager; local_20c = (EntityPtr *)0x2a1; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); return; } *(undefined4 *)((int)npc + 0xb64) = 9; curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName == (byte *)0x0) { LAB_00448c08: bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"MaggotAttack",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } animNameCursor = "MaggotAttack"; do { bVar2 = *curAnimName; bVar11 = bVar2 < (byte)*animNameCursor; if (bVar2 != *animNameCursor) { LAB_00448bf0: uVar3 = -(uint)bVar11 | 1; goto LAB_00448bf5; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; bVar11 = bVar2 < (byte)animNameCursor[1]; if (bVar2 != animNameCursor[1]) goto LAB_00448bf0; curAnimName = curAnimName + 2; animNameCursor = animNameCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00448bf5: if ((uVar3 != 0) || ((*(char *)(*(int *)((int)npc + 0x7c) + 0x34) != '\0' && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_00448c08; } *(undefined4 *)((int)npc + 0xba0) = 0; LAB_00448f04: pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar12 = (pEVar4->_pos).x; *(bool *)((int)npc + 0x148) = *(float *)((int)npc + 0x33c) <= fVar12 && fVar12 != *(float *)((int)npc + 0x33c); return; case 7: *(undefined4 *)((int)npc + 0x36c) = 0x3f4ccccd; if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); if (bVar2 != 0) { *(undefined4 *)((int)npc + 0x410) = 0; } if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::WasEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); if (bVar2 != 0) { shootPosOffset = Entity::GetNullOffset((Entity *)npc,&local_1e4,(byte *)"ShootPos"); local_1d4.x = *(float *)((int)npc + 0x33c) + shootPosOffset->x; local_1d4.y = shootPosOffset->y + *(float *)((int)npc + 0x340); ProjectileParams::ProjectileParams(&projParams); projParams.Color._offset[2] = DAT_00c34f00; projParams.Color._tint[0] = _DAT_00c34ed8; projParams.Color._tint[1] = fRam00c34edc; projParams.Color._tint[2] = fRam00c34ee0; projParams.Color._tint[3] = fRam00c34ee4; projParams.Color._colorize[0] = _DAT_00c34ee8; projParams.Color._colorize[1] = fRam00c34eec; projParams.Color._colorize[2] = fRam00c34ef0; projParams.Color._colorize[3] = fRam00c34ef4; projParams.Color._offset[0] = (float)DAT_00c34ef8; projParams.Color._offset[1] = DAT_00c34ef8._4_4_; uVar3 = Random(); projParams.BulletFlags._0_4_ = 0x2080; projParams.BulletFlags._4_4_ = 1; projParams.ChangeFlags._0_4_ = 0x8002080; projParams.ChangeFlags._4_4_ = 0; projParams.Acceleration = 0.96; projParams.ChangeTimeout = 0x1e; projParams.Scale = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.8 + 1.0; if (*(char *)((int)npc + 0x148) == '\0') { local_20c = (EntityPtr *)0xc0a00000; } else { local_20c = (EntityPtr *)0x40a00000; } iVar10 = 0; if (0 < elapsedUpdates) { iVar8 = *(int *)((int)npc + 0x410); do { if (0x1d < iVar8) break; uVar3 = Random(); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_208.x = fVar12 + fVar12; fVar12 = cos(local_208.x); local_1f8.x = fVar12 * 6.0 + (float)local_20c; fVar12 = sin(local_208.x); local_1f8.y = fVar12 * 6.0 - 16.0; if (-6.0 < local_1f8.y) { local_1f8.y = -6.0; } Entity_NPC::FireProjectiles(npc,&local_1d4,&local_1f8,0,&projParams); *(undefined4 *)(extraout_EAX_00 + 0x414) = 0; *(undefined4 *)(extraout_EAX_00 + 0x418) = 0x3f000000; uVar3 = *(uint *)((int)npc + 0x410); uVar5 = uVar3 & 0x80000003; bVar11 = uVar5 == 0; if ((int)uVar5 < 0) { bVar11 = (uVar5 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar11) { local_1e4.x = local_1f8.x * 0.4; local_1e4.y = local_1f8.y * 0.4; spawn_blood_explosion(2,&local_1d4,&g_vectorZero,&g_colorGreenSplat,&local_1e4); uVar3 = *(uint *)((int)npc + 0x410); } iVar8 = uVar3 + 1; iVar10 = iVar10 + 1; *(int *)((int)npc + 0x410) = iVar8; } while (iVar10 < elapsedUpdates); } } if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) != '\0')) { return; } } } curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName != (byte *)0x0) { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor = "HeadlessIdle"; do { bVar2 = *pbVar6; bVar11 = bVar2 < (byte)*animNameCursor; if (bVar2 != *animNameCursor) { LAB_00449f50: uVar3 = -(uint)bVar11 | 1; goto LAB_00449f55; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < (byte)animNameCursor[1]; if (bVar2 != animNameCursor[1]) goto LAB_00449f50; pbVar6 = pbVar6 + 2; animNameCursor = animNameCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00449f55: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_00449f8c; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"HeadlessIdle",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } goto LAB_00449f8c; case 8: *(undefined4 *)((int)npc + 0x36c) = 0x3f4ccccd; if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { local_20c = (EntityPtr *)0x29a; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); shootPosOffset = Entity::GetNullOffset((Entity *)npc,&local_1e4,(byte *)"ShootPos"); local_1f8.x = *(float *)((int)npc + 0x33c) + shootPosOffset->x; local_1f8.y = *(float *)((int)npc + 0x340) + shootPosOffset->y; local_1c0._offset[2] = *(float *)((int)npc + 0x20c); tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 0.8; tmpColor._offset[2] = 0.0; local_1c0._tint[0] = *(float *)((int)npc + 0x1e4); local_1c0._tint[1] = *(float *)((int)npc + 0x1e8); local_1c0._tint[2] = *(float *)((int)npc + 0x1ec); local_1c0._tint[3] = *(float *)((int)npc + 0x1f0); local_1c0._colorize[0] = *(float *)((int)npc + 500); local_1c0._colorize[1] = *(float *)((int)npc + 0x1f8); local_1c0._colorize[2] = *(float *)((int)npc + 0x1fc); local_1c0._colorize[3] = *(float *)((int)npc + 0x200); local_1c0._offset._0_8_ = *(undefined8 *)((int)npc + 0x204); Color::__mul(&local_1c0,&tmpColor); tmpColor._tint[0] = local_1c0._tint[0]; tmpColor._tint[1] = local_1c0._tint[1]; tmpColor._tint[2] = local_1c0._tint[2]; tmpColor._tint[3] = local_1c0._tint[3]; tmpColor._offset[2] = local_1c0._offset[2]; tmpColor._colorize[0] = local_1c0._colorize[0]; tmpColor._colorize[1] = local_1c0._colorize[1]; tmpColor._colorize[2] = local_1c0._colorize[2]; tmpColor._colorize[3] = local_1c0._colorize[3]; tmpColor._offset[0] = local_1c0._offset[0]; tmpColor._offset[1] = local_1c0._offset[1]; Entity_NPC::MakeBloodCloud(npc,&local_1f8,&tmpColor); ProjectileParams::ProjectileParams(&projParams2); projParams2.Scale = 3.0; projParams2.Color._tint[0] = _DAT_00c34eac; projParams2.Color._tint[1] = fRam00c34eb0; projParams2.Color._tint[2] = fRam00c34eb4; projParams2.Color._tint[3] = fRam00c34eb8; projParams2.Color._offset[2] = DAT_00c34ed4; projParams2.BulletFlags._0_4_ = 0x2002; projParams2.BulletFlags._4_4_ = 0; projParams2.Color._colorize[0] = _DAT_00c34ebc; projParams2.Color._colorize[1] = fRam00c34ec0; projParams2.Color._colorize[2] = fRam00c34ec4; projParams2.Color._colorize[3] = fRam00c34ec8; projParams2.Color._offset[0] = (float)DAT_00c34ecc; projParams2.Color._offset[1] = DAT_00c34ecc._4_4_; pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar12 = (pEVar4->_pos).x; fVar13 = (roomCopy->_bottomRightPos).y; fVar14 = fVar12 - local_1f8.x; *(bool *)((int)npc + 0x148) = *(float *)((int)npc + 0x33c) <= fVar12 && fVar12 != *(float *)((int)npc + 0x33c); local_208.x = (fVar13 - 30.0) - local_1f8.y; local_1fd = fVar14 < 0.0; if ((bool)local_1fd) { fVar14 = -fVar14; } local_1d4.y = -20.0; local_20c = (EntityPtr *)(fVar14 * -20.0); fVar12 = fVar14 * 0.5 * fVar14 * 4.0 * local_208.x + (float)local_20c * (float)local_20c; if (fVar12 <= 0.0) { fVar12 = 0.0; } fVar12 = sqrtf(fVar12); local_1d4.x = (fVar12 + (float)local_20c) / (local_208.x + local_208.x); if (local_1fd != '\0') { local_1d4.x = -local_1d4.x; } Entity_NPC::FireProjectiles(npc,&local_1f8,&local_1d4,0,&projParams2); *(undefined4 *)(extraout_EAX + 0x414) = 0; *(undefined4 *)(extraout_EAX + 0x418) = 0x3f800000; } } if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) != '\0')) { return; } *(int *)((int)npc + 0xba0) = *(int *)((int)npc + 0xba0) + 1; ANM2::Play((ANM2 *)((int)npc + 0x48),s_Idle,0); *(undefined4 *)((int)npc + 0xb64) = 3; break; case 9: *(undefined4 *)((int)npc + 0x36c) = 0x3f4ccccd; local_1f0 = (AnimationState *)((int)npc + 0x78); if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered(local_1f0,(byte *)"Sound"); manager = g_manager; if (bVar2 != 0) { local_20c = (EntityPtr *)0x293; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); manager = g_manager; local_20c = (EntityPtr *)0x29e; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); local_1f0 = (AnimationState *)((int)npc + 0x78); } if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { local_20c = (EntityPtr *)0x294; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); manager = g_manager; local_20c = (EntityPtr *)0x29f; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); shootPosOffset = Entity::GetNullOffset((Entity *)npc,&local_1e4,(byte *)"ShootPos"); local_1f8.y = *(float *)((int)npc + 0x340) + shootPosOffset->y; local_1f8.x = *(float *)((int)npc + 0x33c) + shootPosOffset->x; if (*(char *)((int)npc + 0x148) == '\0') { local_1cc.x = -10.0; local_1ec.x = -10.0; } else { local_1cc.x = 10.0; } *(float *)((int)npc + 0xbb0) = -local_1cc.x * 0.5; local_1cc.y = 0.0; local_1e4.x = local_1cc.x * 0.5; *(undefined4 *)((int)npc + 0xbb4) = 0x80000000; local_1e4.y = 0.0; pEVar4 = spawn_blood_explosion(3,&local_1f8,&g_vectorZero,&g_colorGreenSplat,&local_1e4); pEVar4->_renderZOffset = 500; uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,0x3b7,0x16,&local_1f8,&local_1cc,(Entity *)npc,0,uVar3,0); (pEVar4->_targetPosition).y = 0.0; (pEVar4->_targetPosition).x = local_1ec.x * 0.75; if (pEVar4->_parent != (EntityPtr)0x0) { local_20c = &pEVar4->_parent; std::multiset::erase(&local_20c); } pEVar4->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar4->_parent); uVar1 = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar1; if (*(EntityPtr *)((int)npc + 0x3c0) != (EntityPtr)0x0) { local_20c = (EntityPtr *)((int)npc + 0x3c0); std::multiset::erase(&local_20c); } *(undefined4 *)((int)npc + 0x3c0) = pEVar4; std::multiset::insert((undefined4 *)((int)npc + 0x3c0)); (**(code **)(*(int *)pEVar4 + 0xc))(); iVar10 = 8; do { uVar3 = Random(); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20c = (EntityPtr *)(fVar12 + fVar12); uVar3 = Random(); local_208.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * 3.0; fVar12 = cos((float)local_20c); local_1e4.x = fVar12 * local_208.x + local_1ec.x; fVar12 = sin((float)local_20c); local_1e4.y = fVar12 * local_208.x + 0.0; uVar3 = Random(); fVar12 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20c = (EntityPtr *)(fVar12 + fVar12); uVar3 = Random(); local_208.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10; fVar12 = cos((float)local_20c); local_1cc.x = fVar12 * 6.0 * local_208.x + local_1f8.x; fVar12 = sin((float)local_20c); local_1cc.y = fVar12 * 6.0 * local_208.x + local_1f8.y; pEVar4 = spawn_small_maggot(&local_1cc,0.0,&local_1e4,-8.0); pEVar4->_entityCollisionClass = 0; pEVar4->_mass = 15.0; iVar10 = iVar10 + -1; } while (iVar10 != 0); } if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::WasEventTriggered(local_1f0,(byte *)"Shoot"); if (bVar2 != 0) { fVar12 = *(float *)((int)npc + 0x39c); auVar15 = ZEXT812(0x3f000000); *(float *)((int)npc + 0x360) = fVar12 * *(float *)((int)npc + 0xbb0) + *(float *)((int)npc + 0x360); *(float *)((int)npc + 0x364) = fVar12 * *(float *)((int)npc + 0xbb4) + *(float *)((int)npc + 0x364); if (fVar12 != 1.0) { fVar13 = auVar15._0_4_; auVar15._4_8_ = auVar15._4_8_; auVar15._0_4_ = fVar13 / ((fVar12 + fVar13) - fVar12 * fVar13); } *(float *)((int)npc + 0xbb4) = auVar15._0_4_ * *(float *)((int)npc + 0xbb4); *(float *)((int)npc + 0xbb0) = auVar15._0_4_ * *(float *)((int)npc + 0xbb0); } if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) != '\0')) { return; } } } } curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName == (byte *)0x0) { LAB_004497de: bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor2 = s_Idle; do { bVar2 = *pbVar6; bVar11 = bVar2 < *animNameCursor2; if (bVar2 != *animNameCursor2) { LAB_004497c0: uVar3 = -(uint)bVar11 | 1; goto LAB_004497c5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < animNameCursor2[1]; if (bVar2 != animNameCursor2[1]) goto LAB_004497c0; pbVar6 = pbVar6 + 2; animNameCursor2 = animNameCursor2 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004497c5: if ((uVar3 != 0) || ((curAnimName[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_004497de; } *(undefined4 *)((int)npc + 0xb64) = 3; break; case 0xd: *(undefined4 *)((int)npc + 0x36c) = 0x3f4ccccd; if (*(int *)((int)npc + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { local_20c = (EntityPtr *)0x299; seed_fart_sound_override((int *)&local_20c); SoundEffects::Play(&manager->_sfxManager,(int)local_20c,1.0,2,0,1.0,0.0); shootPosOffset = Entity::GetNullOffset((Entity *)npc,&local_1e4,(byte *)"ShootPos"); local_1ec.x = *(float *)((int)npc + 0x33c) + shootPosOffset->x; local_1ec.y = shootPosOffset->y + *(float *)((int)npc + 0x340); if (*(char *)((int)npc + 0x148) == '\0') { local_20c = (EntityPtr *)0xc1000000; } else { local_20c = (EntityPtr *)0x41000000; } local_1e4.y = 3.0; local_1e4.x = (float)local_20c; uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,0x3b7,0x17,&local_1ec,&local_1e4,(Entity *)npc,0,uVar3,0); uVar1 = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar1; if (pEVar4->_parent != (EntityPtr)0x0) { local_208.x = (float)&pEVar4->_parent; std::multiset::erase(&local_208); } pEVar4->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar4->_parent); if (*(int *)((int)npc + 0x3c0) != 0) { local_208.x = (float)((int)npc + 0x3c0); std::multiset::erase(&local_208); } *(undefined4 *)((int)npc + 0x3c0) = pEVar4; std::multiset::insert((undefined4 *)((int)npc + 0x3c0)); (**(code **)(*(int *)pEVar4 + 0xc))(); local_1d4.x = 5.60519e-45; do { uVar3 = Random(); uVar5 = Random(); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_208.x = fVar12 + fVar12; uVar5 = Random(); local_1f8.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar12 = cos(local_208.x); local_1e4.x = fVar12 * 1.5 * local_1f8.x + (float)local_20c; fVar12 = sin(local_208.x); local_1e4.y = fVar12 * 1.5 * local_1f8.x + 3.0; uVar5 = Random(); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_208.x = fVar12 + fVar12; uVar5 = Random(); local_1f8.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar12 = cos(local_208.x); local_1cc.x = fVar12 * 10.0 * local_1f8.x + local_1ec.x; fVar12 = sin(local_208.x); local_1cc.y = fVar12 * 10.0 * local_1f8.x + local_1ec.y; pEVar4 = Game::SpawnEx(g_game,1000,0x3b,&local_1cc,&local_1e4,(Entity *)npc,0,uVar3,0); uVar3 = Random(); *(float *)(pEVar4[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar3 = Random(); iVar10 = uVar3 % 0xf + 0xf; *(int *)(pEVar4[1]._sprite._filename._buf + 8) = iVar10; *(int *)(pEVar4[1]._sprite._filename._buf + 0xc) = iVar10; Color::Reset((Color *)&tmpColor); tmpColor._tint[0] = 0.7; tmpColor._tint[1] = 0.8; tmpColor._tint[2] = 0.65; tmpColor._tint[3] = 0.6; (**(code **)(*(int *)pEVar4 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); fVar12 = g_vectorOne.y; local_1d4.x = (float)((int)local_1d4.x + -1); fVar13 = g_vectorOne.x * 2.0; pEVar4->_renderDepthOffset = -5.0; (pEVar4->_sprite)._scale.x = fVar13; (pEVar4->_sprite)._scale.y = fVar12 * 2.0; } while (local_1d4.x != 0.0); } } if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) != '\0')) { return; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"HeadlessIdle",0); LAB_00449f8c: *(undefined4 *)((int)npc + 0xb64) = 4; break; case 0x10: *(undefined4 *)((int)npc + 0x36c) = 0x3f4ccccd; if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"HeadlessIdle",0); *(undefined4 *)((int)npc + 0xb64) = 4; return; } return; case 99: curAnimName = *(byte **)((int)npc + 0x7c); if (curAnimName == (byte *)0x0) { code_r0x00448520: bVar2 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { pbVar6 = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { pbVar6 = *(byte **)curAnimName; } animNameCursor2 = s_Idle; do { bVar2 = *pbVar6; bVar11 = bVar2 < *animNameCursor2; if (bVar2 != *animNameCursor2) { code_r0x00448502: uVar3 = -(uint)bVar11 | 1; goto code_r0x00448507; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar11 = bVar2 < animNameCursor2[1]; if (bVar2 != animNameCursor2[1]) goto code_r0x00448502; pbVar6 = pbVar6 + 2; animNameCursor2 = animNameCursor2 + 2; } while (bVar2 != 0); uVar3 = 0; code_r0x00448507: if ((uVar3 != 0) || ((curAnimName[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto code_r0x00448520; } if (*(int *)((int)npc + 0xbc0) == 0) { fVar12 = *(float *)((int)npc + 0x360) - (*(float *)((int)npc + 0x39c) + *(float *)((int)npc + 0x39c)); if (fVar12 <= -15.0) { fVar12 = -15.0; } if (15.0 <= fVar12) { fVar12 = 15.0; } *(float *)((int)npc + 0x360) = fVar12; fVar12 = (roomCopy->_bottomRightPos).x + 40.0; if (*(float *)((int)npc + 0x33c) <= fVar12 && fVar12 != *(float *)((int)npc + 0x33c)) { *(undefined4 *)((int)npc + 0xbc0) = 1; return; } } else { *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.95; fVar12 = sqrtf(*(float *)((int)npc + 0x360) * *(float *)((int)npc + 0x360) + *(float *)((int)npc + 0x364) * *(float *)((int)npc + 0x364)); if (fVar12 < 8.0) { *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0xbc0) = 0; return; } } goto LAB_00449fa0; } *(undefined4 *)((int)npc + 0x410) = 0; LAB_00449fa0: return; } //@@ 0044a040 NpcAI::ENTITY_BEAST_pestilence_fly /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_NPC_UpdateAI_dispatch type 951 (Beast) variant switch case 0x15 = 21 Ultra Pestilence Fly (20=Pestilence 004477b0 NpcAI::ENTITY_BEAST_ultra_pestilence 22=Maggot 0044b6f0 NpcAI::ENTITY_BEAST_ultra_pestilence_maggot +0xb74==1: removed when outside room, slows and takes 10 dmg every 8 frames below the room bottom (lava), AddBurn */ void __fastcall NpcAI::ENTITY_BEAST_pestilence_fly(Entity_NPC *npc) { float fVar1; float fVar2; float fVar3; undefined4 uVar4; byte bVar5; EntityRef *selfRef; uint uVar6; int iVar7; LayerState *layer; ColorMod *extraout_EAX; Vector *vecResult; int *clampedSubtype; Game *game; bool isEighthFrame; float fVar8; float fVar9; float fVar10; undefined1 auVar11 [12]; float fVar12; undefined1 local_50 [12]; float local_44; float local_40; float local_3c; float local_38; undefined1 local_34 [44]; undefined4 local_8; EntityPtr parent; int prevStateFrame; ColorMod *srcColor; game = g_game; local_8 = __security_cookie ^ (uint)(local_34 + 0x30); if (npc->_aiCallPhase == 1) { if (npc->_spawnerEntity == (EntityPtr)0x0) { bVar5 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,0.0); if (bVar5 == 0) { selfRef = EntityRef::EntityRef((EntityRef *)(local_34 + 4)); (**(code **)(*(int *)npc + 0x24))(selfRef); game = g_game; } } if (*(float *)((int)game->_room + 0x20) - 30.0 < (npc->_pos).y) { (npc->_velocity).x = (npc->_velocity).x * 0.9; (npc->_velocity).y = (npc->_velocity).y * 0.9; if (*(char *)game->_room != '\0') { uVar6 = game->_frameCount - *(int *)((int)game->_room + 0x11f0) & 0x80000007; isEighthFrame = uVar6 == 0; if ((int)uVar6 < 0) { isEighthFrame = (uVar6 - 1 | 0xfffffff8) == 0xffffffff; } if (isEighthFrame) { selfRef = EntityRef::EntityRef((EntityRef *)(local_34 + 4)); (**(code **)(*(int *)npc + 0x20))(0x41200000,2,0,selfRef,0x1e); EntityRef::constructor((EntityRef *)(local_34 + 4),(Entity *)0x0); Entity::AddBurn((Entity *)npc,(EntityRef *)(local_34 + 4),0x5a,0.0,0); } } } if ((npc->_maxHitPoints <= npc->_health && npc->_health != npc->_maxHitPoints) && (iVar7 = Entity::GetIntervalTicks((Entity *)npc,15.0,0.0), iVar7 != 0)) { fVar8 = npc->_health - 10.0; if (fVar8 <= npc->_maxHitPoints) { fVar8 = npc->_maxHitPoints; } npc->_health = fVar8; return; } } else { iVar7 = npc->_state; if (iVar7 == 0) { local_44 = 4.2039e-45; clampedSubtype = (int *)&local_44; if ((uint)npc->_subtype < 3) { clampedSubtype = &npc->_subtype; } ANM2::Play(&npc->_sprite, (&PTR_s_Idle_00b1d444)[-(uint)(*clampedSubtype != 0) & *clampedSubtype],0); npc->_state = 3; uVar6 = Random(); local_44 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44 = local_44 + local_44; local_3c = cos(local_44); fVar8 = sin(local_44); (npc->_targetPosition).x = local_3c; (npc->_targetPosition).y = fVar8; npc->_renderZOffset = -1000; npc->_aiCallFlags = 1; fVar12 = g_colorGreenSplat._tint[3]; fVar9 = g_colorGreenSplat._tint[2]; fVar8 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar8; (npc->_splatColor)._tint[2] = fVar9; (npc->_splatColor)._tint[3] = fVar12; fVar12 = g_colorGreenSplat._colorize[3]; fVar9 = g_colorGreenSplat._colorize[2]; fVar8 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar8; (npc->_splatColor)._colorize[2] = fVar9; (npc->_splatColor)._colorize[3] = fVar12; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } parent = npc->_parent; if (((parent != (EntityPtr)0x0) && (*(int *)((int)parent + 0x28) == 0x3b7)) && (*(int *)((int)parent + 0x2c) == 0x17)) { uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; npc->_renderZOffset = 0; return; } uVar6 = Random(); local_44 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44 = local_44 + local_44; fVar8 = cos(local_44); local_3c = fVar8 * 40.0 + (npc->_pos).x; fVar9 = sin(local_44); fVar8 = (npc->_pos).y; (npc->_v2).x = local_3c; (npc->_v2).y = fVar9 * 40.0 + fVar8; } else if (iVar7 == 3) { parent = npc->_parent; npc->_friction = npc->_friction * 0.8; if (parent == (EntityPtr)0x0) { uVar6 = Random(); if ((uVar6 & 0xf) == 0) { vecResult = MusicManager::RandomVector((Vector *)(local_50 + 8)); fVar9 = vecResult->y; fVar8 = vecResult->x * 40.0 + (npc->_pos).x; fVar12 = (npc->_pos).y; (npc->_v2).x = fVar8; (npc->_v2).y = fVar9 * 40.0 + fVar12; } else { fVar8 = (npc->_v2).x; } local_40 = (npc->_targetPosition).y; local_3c = (npc->_targetPosition).x; local_44 = (((npc->_v2).y - (npc->_pos).y) * local_40 + (fVar8 - (npc->_pos).x) * local_3c) * 0.005; if (local_44 <= 1.0) { local_44 = 1.0; } if (2.0 <= local_44) { local_44 = 2.0; } uVar6 = Random(); fVar8 = npc->_friction; fVar9 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.0; if (fVar8 != 0.0) { fVar12 = npc->_speedMultiplier; (npc->_velocity).x = (local_3c * local_44 * fVar9 * fVar12) / fVar8 + (npc->_velocity).x; (npc->_velocity).y = (local_40 * local_44 * fVar9 * fVar12) / fVar8 + (npc->_velocity).y; } vecResult = MusicManager::RandomVector((Vector *)(local_50 + 8)); fVar8 = npc->_speedMultiplier; fVar9 = vecResult->y; fVar12 = (npc->_v2).y; (npc->_targetPosition).x = (((npc->_v2).x - (npc->_pos).x) * 0.004 + vecResult->x * 0.75) * fVar8 + (npc->_targetPosition).x; fVar8 = ((fVar12 - (npc->_pos).y) * 0.004 + fVar9 * 0.75) * fVar8; } else { local_38 = *(float *)((int)parent + 0x340); fVar9 = *(float *)((int)parent + 0x33c); local_40 = (npc->_targetPosition).y; local_3c = (npc->_targetPosition).x; local_44 = ((local_38 - (npc->_pos).y) * local_40 + (fVar9 - (npc->_pos).x) * local_3c) * 0.01; if (local_44 <= 1.0) { local_44 = 1.0; } if (4.0 <= local_44) { local_44 = 4.0; } uVar6 = Random(); fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; fVar8 = npc->_friction; if (fVar8 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).x = (local_3c * local_44 * fVar12 * fVar1) / fVar8 + (npc->_velocity).x; (npc->_velocity).y = (local_40 * local_44 * fVar12 * fVar1) / fVar8 + (npc->_velocity).y; } vecResult = MusicManager::RandomVector((Vector *)(local_50 + 8)); fVar8 = npc->_speedMultiplier; fVar12 = vecResult->y; (npc->_targetPosition).x = ((fVar9 - (npc->_pos).x) * 0.001 + vecResult->x * 0.75) * fVar8 + (npc->_targetPosition).x; fVar8 = ((local_38 - (npc->_pos).y) * 0.001 + fVar12 * 0.75) * fVar8; } game = g_game; local_38 = fVar8 + (npc->_targetPosition).y; (npc->_targetPosition).y = local_38; fVar8 = (npc->_pos).y; fVar9 = *(float *)((int)game->_room + 0x20) - 30.0; if (fVar9 - 80.0 < fVar8) { auVar11 = ZEXT812(0x41200000); fVar9 = fVar9 - fVar8; if (auVar11._0_4_ <= fVar9) { auVar11._4_8_ = auVar11._4_8_; auVar11._0_4_ = fVar9; } local_38 = local_38 - 4.0 / auVar11._0_4_; (npc->_targetPosition).y = local_38; } fVar8 = (npc->_targetPosition).x; fVar8 = sqrtf(local_38 * local_38 + fVar8 * fVar8); if (0.0 < fVar8) { (npc->_targetPosition).y = (1.0 / fVar8) * local_38; (npc->_targetPosition).x = (1.0 / fVar8) * (npc->_targetPosition).x; return; } } else if (iVar7 == 0x10) { if (npc->_parent == (EntityPtr)0x0) { Color::Color((Color *)local_34); srcColor = extraout_EAX; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,srcColor); uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; npc->_state = 3; npc->_entityCollisionClass = 4; npc->_isInvicible = 0; vecResult = Vector::Normalized(&npc->_velocity,(Vector *)(local_50 + 8)); (npc->_targetPosition).x = vecResult->x; (npc->_targetPosition).y = vecResult->y; vecResult = MusicManager::RandomVector((Vector *)(local_50 + 8)); fVar8 = vecResult->x; fVar9 = vecResult->y; fVar12 = (npc->_pos).x; fVar1 = (npc->_pos).y; npc->_renderZOffset = -1000; (npc->_v2).x = fVar8 * 40.0 + fVar12; (npc->_v2).y = fVar9 * 40.0 + fVar1; return; } local_50._0_4_ = npc->_initSeed; local_50._4_4_ = 5; local_50._8_4_ = 9; local_44 = 9.80909e-45; fVar8 = RNG::RandomFloat((RNG *)local_50); local_38 = fVar8 * 8.0 - 4.0; local_38 = normalize_angle_degrees(local_38 * npc->_speedMultiplier + (npc->_v2).x); fVar12 = local_38 * 0.017453292; (npc->_v2).x = local_38; fVar9 = cos(fVar12); fVar8 = (npc->_v1).x; local_3c = sin(fVar12); local_3c = local_3c * (npc->_v1).x; local_38 = (local_38 + 90.0) * 0.017453292; local_40 = cos(local_38); local_40 = local_40 * (npc->_v1).y; local_44 = sin(local_38); local_44 = local_44 * (npc->_v1).y; prevStateFrame = npc->_stateFrame; iVar7 = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + prevStateFrame; npc->_stateFrame = iVar7; fVar12 = ((float)prevStateFrame / 30.0) * 6.2831855; if (0x1e < iVar7) { do { iVar7 = iVar7 + -0x1e; } while (0x1e < iVar7); npc->_stateFrame = iVar7; } parent = npc->_parent; local_38 = cos(fVar12); fVar10 = sin(fVar12); srcColor = (ColorMod *)((int)parent + 0xf0); fVar12 = *(float *)((int)parent + 0x33c); fVar1 = *(float *)((int)parent + 0x340); fVar2 = (npc->_pos).x; fVar3 = (npc->_pos).y; npc->_friction = 1.0; (npc->_velocity).x = (local_38 * fVar9 * fVar8 + fVar12 + fVar10 * local_40) - fVar2; (npc->_velocity).y = (local_38 * local_3c + fVar1 + fVar10 * local_44) - fVar3; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,srcColor); return; } } return; } //@@ 0044aad0 NpcAI::ENTITY_BEAST_ultra_pestilence_fly_ball /* DB: ? dispatcher case type 951 sub-switch variant 0x17 (23 = Ultra Pestilence Fly Ball); no anm strings, AddBurn/SpawnEx/CalcTargetPosition */ void __fastcall NpcAI::ENTITY_BEAST_ultra_pestilence_fly_ball(Entity_NPC *npc) { float fVar1; code *room; EntityPtr *pEVar3; byte bVar4; uint uVar5; uint uVar6; EntityRef *sourceRefPtr; int iVar7; uint rngValue; Entity *spawnedFly; Vector *pVVar8; EntityPtr orbitFly; byte *pbVar9; byte *pbVar10; undefined1 *puVar11; bool bVar12; float fVar13; float fVar14; float fVar15; int *piVar16; float fVar17; float fVar18; double dVar19; EntityRef sourceRef; Vector local_4c; Vector local_44; undefined1 local_3c [12]; code *local_30; int *local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; Game *game; Entity_NPC *otherBall; char *room; game = g_game; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af23f0; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_3c + 0x2c); local_4c.y = (float)npc; if (npc->_aiCallPhase == 1) { ExceptionList = &local_1c; puStack_20 = local_3c + 0x38; if (*(float *)((int)g_game->_room + 0x20) - 30.0 < (npc->_pos).y) { (npc->_velocity).x = (npc->_velocity).x * 0.9; (npc->_velocity).y = (npc->_velocity).y * 0.9; room = game->_room; puStack_20 = local_3c + 0x38; if (*room != '\0') { uVar6 = game->_frameCount - *(int *)(room + 0x11f0) & 0x80000007; bVar12 = uVar6 == 0; if ((int)uVar6 < 0) { bVar12 = (uVar6 - 1 | 0xfffffff8) == 0xffffffff; } puStack_20 = local_3c + 0x38; if (bVar12) { puStack_20 = local_3c + 0x38; sourceRefPtr = EntityRef::EntityRef(&sourceRef); (**(code **)(*(int *)npc + 0x20))(0x41200000,2,0,sourceRefPtr,0x1e,uVar5); 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 = (Entity_NPC *)0x0; Entity::AddBurn((Entity *)npc,&sourceRef,0x5a,0.0,0); } } } local_30 = (code *)npc->_health; local_2c = (int *)npc->_maxHitPoints; local_28 = ((float)local_30 * 6.0) / (float)local_2c + 0.5; dVar19 = floor((double)local_28); local_28 = (float)dVar19; local_44.y = 0.0; if (0 < (int)dVar19) { local_44.y = (float)(int)dVar19; } if ((int)local_44.y < (int)(npc->_entityDeque)._size) { local_24 = local_44.y; do { uVar5 = (npc->_entityDeque)._offset + (int)local_24; local_2c = *(int **)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar5 >> 2) * 4) + (uVar5 & 3) * 4); if (local_2c != (int *)0x0) { sourceRef._position.x = (npc->_pos).x; sourceRef._position.y = (npc->_pos).y; local_30 = *(code **)(*local_2c + 0x24); sourceRef._type = npc->_type; sourceRef._variant = npc->_variant; sourceRef._spawnerType = npc->_spawnerType; sourceRef._spawnerVariant = npc->_spawnerVariant; sourceRef._velocity.x = (npc->_velocity).x; sourceRef._velocity.y = (npc->_velocity).y; local_28 = (float)(uint)((npc->_flags & 0x100) != 0); if ((npc->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } sourceRef._flags = uVar6 | uVar5 | (uint)local_28; sourceRef._entity = npc; (*local_30)(); } room = (code *)(npc->_entityDeque)._offset; uVar5 = (int)local_24 + (int)room; uVar6 = uVar5 & 3; iVar7 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar5 >> 2) * 4); local_30 = (code *)(iVar7 + uVar6 * 4); local_2c = (int *)local_30; if (*(int *)(iVar7 + uVar6 * 4) != 0) { std::multiset::erase(); room = local_30; } local_30 = room; local_24 = (float)((int)local_24 + 1); *local_2c = 0; } while ((int)local_24 < (int)(npc->_entityDeque)._size); std::deque::resize(); piVar16 = (undefined4 *)npc->_maxHitPoints; room = (code *)npc->_health; } else { piVar16 = local_2c; room = local_30; } local_44.y = ((float)room * 14.0) / (float)piVar16; dVar19 = ceil((double)local_44.y); local_44.y = (float)dVar19; iVar7 = 0; if (0 < (int)dVar19) { iVar7 = (int)dVar19; } if (iVar7 < npc->_i1) { npc->_i1 = npc->_i1 + -1; uVar5 = Random(); fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44.y = fVar13 + fVar13; local_28 = cos(local_44.y); local_24 = sin(local_44.y); uVar5 = Random(); uVar6 = Random(); rngValue = Random(); local_44.x = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; local_44.y = local_44.x * local_24; local_44.x = local_44.x * local_28; rngValue = Random(); fVar13 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 10.0 + 10.0; local_30 = (code *)(fVar13 * local_24 + ((Vector *)((int)local_4c.y + 0x33c))->y); local_3c._8_4_ = fVar13 * local_28 + ((Vector *)((int)local_4c.y + 0x33c))->x; spawnedFly = Game::SpawnEx(g_game,0x3b7,0x15,(Vector *)(local_3c + 8),&local_44, (Entity *)local_4c.y,uVar6 % 3,uVar5,0); spawnedFly->_health = 50.0; (**(code **)(*(int *)spawnedFly + 0xc))(); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_state != 0) { if (npc->_state != 3) { return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; puStack_20 = local_3c + 0x38; pVVar8 = Entity_NPC::CalcTargetPosition(npc,&local_4c,0.0); fVar13 = npc->_speedMultiplier; local_28 = pVVar8->x - (npc->_pos).x; local_24 = pVVar8->y - (npc->_pos).y; fVar18 = 1.1764705; if (fVar13 != 1.0) { fVar18 = 1.1764705 / ((fVar13 + 1.1764705) - fVar13 * 1.1764705); } local_4c.y = fVar18 * (npc->_velocity).x; (npc->_velocity).y = fVar18 * (npc->_velocity).y; (npc->_velocity).x = local_4c.y; fVar14 = sqrtf(local_28 * local_28 + local_24 * local_24); fVar13 = local_28; fVar18 = local_24; if (0.0 < fVar14) { fVar18 = local_24 * (1.0 / fVar14); fVar13 = local_28 * (1.0 / fVar14); } fVar14 = npc->_friction; fVar1 = npc->_scale; if (fVar14 != 0.0) { fVar15 = npc->_speedMultiplier; (npc->_velocity).y = (fVar15 * fVar18 * 0.5 * fVar1) / fVar14 + (npc->_velocity).y; (npc->_velocity).x = (fVar15 * fVar13 * 0.5 * fVar1) / fVar14 + local_4c.y; } game = g_game; npc->_mass = 8.0; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_3c,npc->_type, npc->_variant,-1,1,0); uVar5 = 0; if (local_30 != (code *)0x0) { do { otherBall = *(Entity_NPC **)(local_3c._4_4_ + uVar5 * 4); if (otherBall != npc) { fVar13 = (otherBall->_pos).x; fVar18 = (otherBall->_pos).y; fVar14 = (npc->_pos).x; fVar1 = (npc->_pos).y; fVar17 = fVar13 - fVar14; fVar15 = fVar18 - fVar1; if (fVar15 * fVar15 + fVar17 * fVar17 < 10000.0) { local_28 = fVar14 - fVar13; local_24 = fVar1 - fVar18; fVar14 = sqrtf(local_28 * local_28 + local_24 * local_24); fVar13 = local_28; fVar18 = local_24; if (0.0 < fVar14) { fVar14 = (100.0 - fVar14) / fVar14; fVar13 = local_28 * fVar14; fVar18 = local_24 * fVar14; } fVar14 = npc->_friction; if (fVar14 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).y = (fVar1 * fVar18 * 0.003) / fVar14 + (npc->_velocity).y; (npc->_velocity).x = (fVar1 * fVar13 * 0.003) / fVar14 + (npc->_velocity).x; } } } uVar5 = uVar5 + 1; } while (uVar5 < local_30); } fVar13 = (npc->_pos).y; fVar18 = *(float *)((int)g_game->_room + 0x20) - 30.0; if (fVar18 - 80.0 < fVar13) { local_44.y = fVar18 - fVar13; fVar13 = npc->_friction; local_4c.y = 10.0; pVVar8 = &local_4c; if (10.0 <= local_44.y) { pVVar8 = &local_44; } if (fVar13 != 0.0) { fVar18 = npc->_speedMultiplier; (npc->_velocity).y = (fVar18 * (-10.0 / pVVar8->y)) / fVar13 + (npc->_velocity).y; (npc->_velocity).x = (fVar18 * 0.0) / fVar13 + (npc->_velocity).x; } } if (local_3c[0] == '\0') { local_14 = 0; tracked_alloc(1,(void *)local_3c._4_4_,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } local_4c.y = 0.0; ExceptionList = &local_1c; std::deque::resize(6,&local_4c.y); local_24 = 0.0; do { uVar5 = Random(); uVar6 = Random(); orbitFly = (EntityPtr) Game::SpawnEx(g_game,0x3b7,0x15,&npc->_pos,&g_vectorZero,(Entity *)npc,uVar6 % 3, uVar5,0); uVar5 = Random(); fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.1 + (float)((double)(int)local_24 + __uint_to_double_fixup[-((int)local_24 >> 0x1f)]) * 0.05 + 0.2; *(float *)((int)orbitFly + 0xbb4) = fVar13 * 8.0; *(float *)((int)orbitFly + 0xbb0) = fVar13 * 40.0; uVar5 = Random(); *(float *)((int)orbitFly + 3000) = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar5 = Random(); *(uint *)((int)orbitFly + 0x168) = *(uint *)((int)orbitFly + 0x168) & 0xfffffffb; *(undefined4 *)((int)orbitFly + 0x16c) = *(undefined4 *)((int)orbitFly + 0x16c); *(uint *)((int)orbitFly + 0x410) = uVar5 % 0x1e; if (*(EntityPtr *)((int)orbitFly + 0x3bc) != (EntityPtr)0x0) { local_4c.y = (float)((int)orbitFly + 0x3bc); std::multiset::erase(); } *(Entity_NPC **)((int)orbitFly + 0x3bc) = npc; std::multiset::insert(); pEVar3 = (EntityPtr *)(npc->_entityDeque)._offset; puVar11 = &pEVar3->field_0x0 + (int)local_24; uVar5 = (uint)puVar11 & 3; iVar7 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & (uint)puVar11 >> 2) * 4); local_4c.y = (float)(iVar7 + uVar5 * 4); local_44.y = local_4c.y; if (*(int *)(iVar7 + uVar5 * 4) != 0) { std::multiset::erase(); pEVar3 = (EntityPtr *)local_4c.y; } local_4c.y = (float)pEVar3; *(EntityPtr *)local_44.y = orbitFly; std::multiset::insert(); (**(code **)(*(int *)orbitFly + 0xc))(); fVar14 = g_colorGreenSplat._tint[3]; fVar18 = g_colorGreenSplat._tint[2]; fVar13 = g_colorGreenSplat._tint[1]; local_24 = (float)((int)local_24 + 1); } while ((uint)local_24 < 6); if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar13; (npc->_splatColor)._tint[2] = fVar18; (npc->_splatColor)._tint[3] = fVar14; fVar14 = g_colorGreenSplat._colorize[3]; fVar18 = g_colorGreenSplat._colorize[2]; fVar13 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar13; (npc->_splatColor)._colorize[2] = fVar18; (npc->_splatColor)._colorize[3] = fVar14; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { pbVar9 = animData; if (0xf < *(uint *)(animData + 0x14)) { pbVar9 = *(byte **)animData; } pbVar10 = s_Idle; do { bVar4 = *pbVar9; bVar12 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_0044b580: uVar5 = -(uint)bVar12 | 1; goto LAB_0044b585; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar12 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_0044b580; pbVar9 = pbVar9 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0044b585: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0044b5bc; } bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0044b5bc: npc->_aiCallFlags = 1; npc->_entityCollisionClass = 2; npc->_state = 3; local_28 = (npc->_velocity).x; if ((local_28 == g_vectorZero.x) && ((npc->_velocity).y == g_vectorZero.y)) { uVar5 = Random(); fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_4c.y = fVar13 + fVar13; local_24 = sin(local_4c.y); local_28 = cos(local_4c.y); } else { local_24 = (npc->_velocity).y; fVar13 = sqrtf(local_28 * local_28 + local_24 * local_24); if (0.0 < fVar13) { local_28 = local_28 * (1.0 / fVar13); local_24 = local_24 * (1.0 / fVar13); } } (npc->_v1).x = local_28; (npc->_v1).y = local_24; npc->_i1 = 0xe; ExceptionList = local_1c; return; } //@@ 0044b6f0 NpcAI::ENTITY_BEAST_ultra_pestilence_maggot /* DB: 951.22 (Beast case variant switch 0x16); strs Maggot/MaggotBack/ShootPos, Entity_NPC::ParentNPC, spawn_blood_explosion */ void __fastcall NpcAI::ENTITY_BEAST_ultra_pestilence_maggot(Entity_NPC *npc) { byte bVar1; Entity_NPC *parentNpc; Vector *pVVar2; Entity *tmpEntity; int passCount; byte *curAnimChar; uint uVar3; char *expectedAnimChar; bool bVar4; float fVar5; float fVar6; float fVar7; Vector shootPos; float roomTopY; Entity_NPC *parent; float roomLeftX; float local_1c; Vector local_18; byte *animData; Manager *manager; EntityPtr parentEntity; void *room; room = g_game->_room; roomLeftX = *(float *)((int)room + 0x14); local_1c = *(float *)((int)room + 0x1c); roomTopY = *(float *)((int)room + 0x18); if (npc->_state != 0) { if (npc->_state != 3) { return; } if ((npc->_v2).y == 0.0) { (npc->_v2).y = (npc->_pos).y; } fVar6 = npc->_friction * 0.8; npc->_friction = fVar6; if (fVar6 != 0.0) { fVar5 = npc->_speedMultiplier; fVar7 = (npc->_targetPosition).y; (npc->_velocity).x = (fVar5 * (npc->_targetPosition).x) / fVar6 + (npc->_velocity).x; (npc->_velocity).y = (fVar7 * fVar5) / fVar6 + (npc->_velocity).y; } fVar6 = (npc->_targetPosition).x; (npc->_sprite)._flipX = 0.0 < fVar6; if (npc->_projectileCooldown == 3) { fVar5 = (npc->_v2).x; fVar7 = npc->_speedMultiplier * 0.26; if (fVar7 < ABS(fVar6 - fVar5)) { if (fVar5 <= fVar6) { fVar5 = fVar6 - fVar7; } else { fVar5 = fVar6 + fVar7; } } (npc->_targetPosition).x = fVar5; } parentNpc = Entity_NPC::ParentNPC(npc); parent = parentNpc; if ((npc->_projectileCooldown == 6) && (parentNpc != (Entity_NPC *)0x0)) { shootPos.x = (parentNpc->_pos).x; shootPos.y = (parentNpc->_pos).y; pVVar2 = Entity::GetNullOffset((Entity *)parentNpc,&local_18,(byte *)"ShootPos"); fVar6 = (npc->_pos).x; shootPos.x = shootPos.x + pVVar2->x; shootPos.y = shootPos.y + pVVar2->y; (npc->_velocity).y = (shootPos.y - (npc->_pos).y) * 0.1; if ((npc->_targetPosition).x <= 0.0) { bVar4 = shootPos.x < fVar6; } else { bVar4 = fVar6 < shootPos.x; } if (!bVar4) { local_18.x = -(npc->_velocity).x * 0.5; local_18.y = -(npc->_velocity).y * 0.5; tmpEntity = spawn_blood_explosion(2,&shootPos,&g_vectorZero,&g_colorGreenSplat,&local_18); tmpEntity->_renderDepthOffset = 400.0; if ((parentNpc->_state == 3) && (bVar1 = ANM2::SetAnimation(&parentNpc->_sprite,(byte *)"MaggotBack",1), bVar1 != 0)) { AnimationState::Rewind(&(parentNpc->_sprite)._animState); (parentNpc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); manager = g_manager; local_18.y = 9.26258e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,2,0,1.0,0.0); manager = g_manager; local_18.y = 9.37469e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,2,0,1.0,0.0); fVar6 = (npc->_targetPosition).x; fVar5 = (npc->_targetPosition).y; fVar7 = parent->_speedMultiplier; (parent->_velocity).x = (fVar6 + fVar6) * fVar7 + (parent->_velocity).x; (parent->_velocity).y = (fVar5 + fVar5) * fVar7 + (parent->_velocity).y; (**(code **)(*(int *)npc + 0x28))(); } } else { (npc->_velocity).y = ((npc->_v2).y - (npc->_pos).y) * 0.5; } fVar6 = (npc->_pos).x; if (0.0 < (npc->_targetPosition).x || (npc->_targetPosition).x == 0.0) { fVar5 = local_1c + 80.0; bVar4 = fVar6 < fVar5; } else { fVar5 = roomLeftX - 80.0; bVar4 = fVar5 < fVar6; } if (!(bVar4 || fVar5 == fVar6)) { if ((5 < npc->_projectileCooldown) || (npc->_parent == (EntityPtr)0x0)) { (**(code **)(*(int *)npc + 0x28))(); } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_18.y = (tmpEntity->_pos).y; passCount = npc->_projectileCooldown; if ((passCount == 0) || (passCount == 4)) { local_18.y = roomTopY + 120.0; } passCount = passCount + 1; npc->_projectileCooldown = passCount; if ((passCount == 6) && (parentEntity = npc->_parent, parentEntity != (EntityPtr)0x0)) { local_18.y = *(float *)((int)parentEntity + 0x340); bVar1 = Entity::IsEnemy((Entity *)parentEntity); if (bVar1 != 0) { pVVar2 = Entity::GetNullOffset((Entity *)npc->_parent,&shootPos,(byte *)"ShootPos"); passCount = npc->_projectileCooldown; local_18.y = local_18.y + pVVar2->y; } } if (0.0 < (npc->_targetPosition).x || (npc->_targetPosition).x == 0.0) { local_1c = roomLeftX - 80.0; } else { local_1c = local_1c + 80.0; } (npc->_pos).y = local_18.y; (npc->_pos).x = local_1c; (npc->_v2).y = (npc->_pos).y; if (passCount == 3) { (npc->_v2).x = -(npc->_targetPosition).x; return; } return; } return; } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedAnimChar = "Maggot"; do { bVar1 = *curAnimChar; bVar4 = bVar1 < (byte)*expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_0044bc10: uVar3 = -(uint)bVar4 | 1; goto LAB_0044bc15; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar4 = bVar1 < (byte)expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_0044bc10; curAnimChar = curAnimChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0044bc15: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0044bc4c; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Maggot",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0044bc4c: npc->_state = 3; npc->_renderZOffset = 400; (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; return; } //@@ 0044bc90 FUN_0044bc90 int FUN_0044bc90(int param_1) { int in_ECX; uint uVar1; uVar1 = *(int *)(in_ECX + 0xc) + param_1; return *(int *)(*(int *)(in_ECX + 4) + (uVar1 >> 2 & *(int *)(in_ECX + 8) - 1U) * 4) + (uVar1 & 3) * 4; } //@@ 0044bcc0 std::deque::resize /* DB: grows map blocks of 4 via operator_new(0x10), shrinks size */ void std::deque::resize(uint param_1,undefined4 *param_2) { int iVar1; uint uVar2; void *pvVar3; int in_ECX; int iVar4; uint uVar5; uVar5 = *(uint *)(in_ECX + 0x10); while (uVar5 < param_1) { uVar2 = *(uint *)(in_ECX + 0xc); if (((uVar2 + uVar5 & 3) == 0) && (*(uint *)(in_ECX + 8) <= uVar5 + 4 >> 2)) { deque<4byte>::_Growmap(uVar5); uVar2 = *(uint *)(in_ECX + 0xc); uVar5 = *(uint *)(in_ECX + 0x10); } uVar2 = *(int *)(in_ECX + 8) * 4 - 1U & uVar2; uVar5 = uVar5 + uVar2; *(uint *)(in_ECX + 0xc) = uVar2; iVar1 = (*(int *)(in_ECX + 8) - 1U & uVar5 >> 2) * 4; iVar4 = *(int *)(in_ECX + 4); if (*(int *)(iVar4 + iVar1) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar1 + *(int *)(in_ECX + 4)) = pvVar3; iVar4 = *(int *)(in_ECX + 4); } *(undefined4 *)(*(int *)(iVar1 + iVar4) + (uVar5 & 3) * 4) = *param_2; uVar5 = *(int *)(in_ECX + 0x10) + 1; *(uint *)(in_ECX + 0x10) = uVar5; } while (param_1 < uVar5) { uVar5 = uVar5 - 1; *(uint *)(in_ECX + 0x10) = uVar5; if (uVar5 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; } } return; } //@@ 0044bd80 std::deque::resize /* DB: the Pestilence fly ball (0x44aad0) calls it on its +0xbf0 orbiter deque with the new count after killing the slots past it (also Hornfel 0x4b92e0); grows by operator_new(0x10) blocks of 4 pointers (std::deque::resize is 0x44bcc0) */ void std::deque::resize(uint param_1) { int iVar1; uint uVar2; void *pvVar3; int in_ECX; int iVar4; uint uVar5; uVar5 = *(uint *)(in_ECX + 0x10); if (uVar5 < param_1) { uVar2 = *(uint *)(in_ECX + 0xc); do { if (((uVar5 + uVar2 & 3) == 0) && (*(uint *)(in_ECX + 8) <= uVar5 + 4 >> 2)) { deque<4byte>::_Growmap(uVar5); uVar2 = *(uint *)(in_ECX + 0xc); uVar5 = *(uint *)(in_ECX + 0x10); } uVar2 = *(int *)(in_ECX + 8) * 4 - 1U & uVar2; *(uint *)(in_ECX + 0xc) = uVar2; uVar2 = uVar2 + uVar5; iVar1 = (*(int *)(in_ECX + 8) - 1U & uVar2 >> 2) * 4; iVar4 = *(int *)(in_ECX + 4); if (*(int *)(iVar4 + iVar1) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar1 + *(int *)(in_ECX + 4)) = pvVar3; iVar4 = *(int *)(in_ECX + 4); } *(undefined4 *)(*(int *)(iVar1 + iVar4) + (uVar2 & 3) * 4) = 0; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; uVar5 = *(uint *)(in_ECX + 0x10); uVar2 = *(uint *)(in_ECX + 0xc); } while (uVar5 < param_1); } while (param_1 < uVar5) { uVar5 = uVar5 - 1; *(uint *)(in_ECX + 0x10) = uVar5; if (uVar5 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; } } return; } //@@ 0044be50 std::deque<4byte>::_Growmap /* DB: doubles map size (min 8, 0xfffffff overflow check), _Allocate then memmove/memset of the 4-byte block pointer map around the offset at +0xc; callers std::deque::resize/push_front, std::deque::resize (same as named std::deque::_Growmap 00499410) */ void std::deque<4byte>::_Growmap(void) { void *pvVar1; uint uVar2; void *_Dst; int in_ECX; uint uVar3; size_t sVar4; size_t sVar5; uint uVar6; uVar6 = *(uint *)(in_ECX + 8); uVar2 = 1; if (uVar6 != 0) { uVar2 = uVar6; } for (; (uVar3 = uVar2 - uVar6, uVar3 == 0 || (uVar2 < 8)); uVar2 = uVar2 * 2) { if (0xfffffff - uVar2 < uVar2) { FUN_0040cad0(); LAB_0044bf83: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar6 = *(uint *)(in_ECX + 0xc) >> 2; if (uVar2 < 0x40000000) { _Dst = _Allocate(uVar2 * 4); sVar5 = uVar6 * 4; pvVar1 = (void *)(*(int *)(in_ECX + 4) + sVar5); sVar4 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove((void *)((int)_Dst + sVar5),pvVar1,sVar4); pvVar1 = (void *)(sVar4 + (int)((int)_Dst + sVar5)); if (uVar3 < uVar6) { sVar4 = uVar3 * 4; memmove(pvVar1,*(void **)(in_ECX + 4),sVar4); pvVar1 = (void *)(sVar4 + *(int *)(in_ECX + 4)); sVar5 = (*(int *)(in_ECX + 4) - (int)pvVar1) + sVar5; memmove(_Dst,pvVar1,sVar5); memset((void *)(sVar5 + (int)_Dst),0,sVar4); } else { memmove(pvVar1,*(void **)(in_ECX + 4),uVar6 * 4); memset((void *)((int)pvVar1 + sVar5),0,(uVar3 - uVar6) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar3; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_0044bf83; } //@@ 0044bf90 FUN_0044bf90 void FUN_0044bf90(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x171) = param_1; return; } //@@ 0044bfa0 FUN_0044bfa0 void FUN_0044bfa0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x184) = param_1; return; } //@@ 0044bfb0 PlayerManager::AnyoneHasTrinket /* ZHL [exact] __thiscall bool PlayerManager::AnyoneHasTrinket(TrinketType trinketType); prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall PlayerManager::AnyoneHasTrinket(PlayerManager *this,int trinketType) { void *pvVar1; int iVar2; bool bVar3; byte bVar4; undefined4 *puVar5; Entity_Player *this_00; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(trinketType & 0x7fffU) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) && (iVar2 = *(int *)((int)pvVar1 + (trinketType & 0x7fffU) * 4), iVar2 != 0)) && ((*(uint *)(iVar2 + 0xb8) & 0x80000000) != 0)) { bVar3 = true; } else { bVar3 = false; } puVar5 = (this->_playerList)._begin; if (puVar5 != (this->_playerList)._end) { do { this_00 = (Entity_Player *)*puVar5; if (this_00->_variant == 0) { bVar4 = Entity_Player::HasTrinket(this_00,trinketType,0); if (bVar4 != 0) goto LAB_0044c04e; if (((bVar3) && (this_00->_backupPlayer != (Entity_Player *)0x0)) && (bVar4 = Entity_Player::HasTrinket(this_00->_backupPlayer,trinketType,0), bVar4 != 0)) { return this_00->_backupPlayer != (void *)0x0; } } puVar5 = puVar5 + 1; } while (puVar5 != (this->_playerList)._end); } this_00 = (Entity_Player *)0x0; LAB_0044c04e: return this_00 != (Entity_Player *)0x0; } //@@ 0044c070 NpcAI::ENTITY_BEAST_ultra_war /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 951.30 (Beast case variant switch 0x1e); strs ChaseLoop/DashStart/LungeBomb/ThrowBomb/QuickBurst/Shockwave, BombExplosionEffects */ void __fastcall NpcAI::ENTITY_BEAST_ultra_war(Entity_NPC *npc) { float *pfVar1; int *piVar2; byte bVar3; ColorMod *Color; uint uVar4; uint uVar5; Entity *pEVar6; undefined4 uVar7; Vector *pVVar8; int iVar9; void *pvVar10; Vector *pVVar11; LayerState *smokeLayer; Vector *this; int unusedArg; int dustTimeout; bool bVar12; float10 fVar13; float fVar14; float fVar15; float fVar16; float targetY; float fVar17; Vector local_160; float local_158; Vector local_154; Room *local_14c; float local_148; code *local_144; Vector local_140; char isEmittingSmoke; Vector local_134; Vector scratchVec; byte isTargetLeft; Vector local_120; Vector spawnPos; Color defaultColor; Color local_e4; ProjectileParams projParams; uint local_c; float moveDirX; EntityPtr child; Game *game; Manager *manager; ColorMod *smokeLayerColor; local_c = __security_cookie ^ (uint)&local_160; local_140.x = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_14c = g_game->_room; iVar9 = npc->_state; if (npc->_aiCallPhase == 1) { if (iVar9 != 0x12) { return; } fVar14 = npc->_speedMultiplier; npc->_friction = 0.8; (npc->_velocity).y = fVar14 * 0.4 + (npc->_velocity).y; (npc->_velocity).x = fVar14 * 0.0 + (npc->_velocity).x; if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Explosion"); if (bVar3 == 0) { return; } ::Color::Color(&local_e4); Game::BombExplosionEffects (g_game,&npc->_pos,80.0,(BitSet128)ZEXT816(0),Color,(Entity *)npc->_spawnerEntity,1.5, 0,4,0); local_148 = 0.0; do { fVar14 = local_148; uVar4 = Random(); local_140.x = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.8 + ((float)(int)fVar14 - 0.4)) * 36.0 * 0.017453292; uVar4 = Random(); uVar5 = Random(); local_134.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 10.0; fVar14 = cos(local_140.x); local_154.x = fVar14 * local_134.x; local_154.y = sin(local_140.x); local_154.y = local_154.y * local_134.x; pEVar6 = Game::SpawnEx(g_game,1000,0x3b,&npc->_pos,&local_154,(Entity *)npc,0,uVar4,0); uVar4 = Random(); *(float *)(pEVar6[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; iVar9 = *(int *)pEVar6; dustTimeout = uVar4 % 0xf + 0xf; local_e4._offset[2] = 0.0; *(int *)(pEVar6[1]._sprite._filename._buf + 8) = dustTimeout; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; *(int *)(pEVar6[1]._sprite._filename._buf + 0xc) = dustTimeout; local_e4._tint[0] = 0.8; local_e4._tint[1] = 0.68; local_e4._tint[2] = 0.65; local_e4._tint[3] = 0.6; (**(code **)(iVar9 + 0x3c))(&local_e4,0xffffffff,0xff,0,1); fVar14 = g_vectorOne.y; fVar15 = g_vectorOne.x * 2.0; pEVar6->_renderZOffset = -600; (pEVar6->_sprite)._scale.x = fVar15; (pEVar6->_sprite)._scale.y = fVar14 * 2.0; local_148 = (float)((int)local_148 + 1); } while ((int)local_148 < 10); local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; local_e4._offset[2] = 0.0; Entity::MakeGroundPoof((Entity *)npc,&npc->_pos,(ColorMod *)&local_e4,1.0); Game::ShakeScreen(g_game,0x32); game = g_game; g_game->_bloomDuration = 6; game->_bloomTimer = 6; game->_bloomStrength = 1.0; local_160.x = (npc->_pos).x; local_140.x = (npc->_pos).y; pvVar10 = game->_room; *(int *)((int)pvVar10 + 0x70fc) = *(int *)((int)pvVar10 + 0x70fc) + 1; uVar4 = *(uint *)((int)pvVar10 + 0x70fc) & 0x80000001; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffe) + 1; } if (1 < uVar4) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } iVar9 = uVar4 + 0x407; *(float *)((int)pvVar10 + iVar9 * 0x1c) = local_160.x; *(float *)((int)pvVar10 + iVar9 * 0x1c + 4) = local_140.x; *(undefined4 *)((int)pvVar10 + iVar9 * 0x1c + 8) = 0; *(undefined4 *)((int)pvVar10 + iVar9 * 0x1c + 0xc) = 0x3f000000; *(undefined4 *)((int)pvVar10 + iVar9 * 0x1c + 0x10) = 0x3d8f5c29; *(undefined4 *)((int)pvVar10 + iVar9 * 0x1c + 0x14) = 0; *(undefined4 *)((int)pvVar10 + iVar9 * 0x1c + 0x18) = 0x14; return; } if ((((((iVar9 == 0x10) || (iVar9 == 4)) || (iVar9 == 6)) || ((iVar9 == 7 || (iVar9 == 0xd)))) || (iVar9 == 10)) || (iVar9 == 5)) { isEmittingSmoke = '\x01'; LAB_0044c6df: manager = g_manager; if (npc->_dead != 0) { local_134.x = 9.52883e-43; seed_fart_sound_override((int *)&local_134); SoundEffects::Play(&manager->_sfxManager,(int)local_134.x,1.0,2,0,1.0,0.0); } } else { fVar14 = npc->_maxHitPoints * 0.5; isEmittingSmoke = '\0'; if (((fVar14 < npc->_health || fVar14 == npc->_health) || (npc->_pendingDamage <= 0.0)) || (bVar3 = Room::IsPositionInRoom(local_14c,&npc->_pos,0.0), bVar3 == 0)) goto LAB_0044c6df; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); uVar4 = 0; npc->_entityCollisionClass = 0; if ((local_14c->_entityList)._updateEL._size != 0) { do { piVar2 = *(int **)((int)(local_14c->_entityList)._updateEL._data + uVar4 * 4); iVar9 = piVar2[10]; if (iVar9 == 9) { *(undefined1 *)((int)piVar2 + 0x173) = 1; } else if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar9 == 1)) || (iVar9 - 10U < 0x3de)) && ((*(char *)((int)piVar2 + 0x173) == '\0' && (piVar2[0xd] == 0x3b7)))) { local_e4._colorize[0] = (npc->_pos).x; local_e4._colorize[1] = (npc->_pos).y; local_144 = *(code **)(*piVar2 + 0x24); local_e4._tint[0] = (float)npc->_type; local_e4._tint[1] = (float)npc->_variant; local_e4._tint[2] = (float)npc->_spawnerType; local_e4._tint[3] = (float)npc->_spawnerVariant; local_e4._colorize[2] = (npc->_velocity).x; local_e4._colorize[3] = (npc->_velocity).y; local_148 = (float)(uint)((npc->_flags & 0x100) != 0); local_134.x = 2.8026e-45; if ((npc->_flags & 0x20000000) == 0) { local_134.x = 0.0; } if ((npc->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } local_e4._offset[0] = (float)(uVar5 | (uint)local_134.x | (uint)local_148); local_e4._offset[1] = (float)npc; (*local_144)(&local_e4); } uVar4 = uVar4 + 1; } while (uVar4 < (uint)(local_14c->_entityList)._updateEL._size); } } local_144 = (code *)(local_14c->_topLeftPos).x; fVar14 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_134.x = (local_14c->_topLeftPos).y; local_120.x = (local_14c->_bottomRightPos).x; local_14c = (Room *)(local_14c->_bottomRightPos).y; local_148 = fVar14; switch(npc->_state) { case 0: npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_pathfinder)._movementTarget.x = (npc->_pos).x; (npc->_pathfinder)._movementTarget.y = (npc->_pos).y; pVVar11 = MusicManager::RandomVector(&scratchVec); manager = g_manager; fVar14 = pVVar11->y; fVar15 = pVVar11->x; uVar7 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x44000000; (npc->_pathfinder)._moveDirection.x = fVar15; (npc->_pathfinder)._moveDirection.y = fVar14 * 0.5; (npc->_pathfinder)._moveCountdown = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar7; npc->_aiCallFlags = 1; npc->_stateFrame = 0; npc->_i1 = 0; (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._enabledLayers = 0; piVar2 = &(manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]. _enabledLayers; *piVar2 = *piVar2 | 2; break; case 3: ANM2::Play(&npc->_sprite,s_Idle,0); fVar14 = npc->_speedMultiplier; pVVar11 = &(npc->_pathfinder)._moveDirection; npc->_friction = 0.8; fVar15 = (npc->_pathfinder)._moveDirection.y; (npc->_velocity).x = pVVar11->x * 0.55 * fVar14 + (npc->_velocity).x; (npc->_velocity).y = fVar15 * 0.55 * fVar14 + (npc->_velocity).y; local_160.x = (float)Entity_NPC::GetPlayerTarget(npc); iVar9 = (npc->_pathfinder)._moveCountdown; if (iVar9 < 1) { uVar4 = Random(); (npc->_pathfinder)._moveCountdown = uVar4 % 0x14 + 0x14; local_158 = ((Vector *)((int)local_160.x + 0x33c))->x; if (local_158 < (npc->_pos).x || local_158 == (npc->_pos).x) { local_148 = 100.0; } else { local_148 = -100.0; } uVar4 = Random(); fVar14 = sin(((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.003 + 0.01) * npc->_updateTime); (npc->_pathfinder)._movementTarget.x = fVar14 * 100.0 + local_148 + local_158; (npc->_pathfinder)._movementTarget.y = ((Vector *)((int)local_160.x + 0x33c))->y; pVVar8 = MusicManager::RandomVector(&scratchVec); fVar14 = pVVar8->y; fVar15 = (npc->_pathfinder)._movementTarget.y; (npc->_pathfinder)._movementTarget.x = pVVar8->x * 20.0 + (npc->_pathfinder)._movementTarget.x ; (npc->_pathfinder)._movementTarget.y = fVar14 * 20.0 + fVar15; } else { (npc->_pathfinder)._moveCountdown = iVar9 - (int)local_140.x; } fVar14 = (npc->_pos).x; local_148 = (npc->_pathfinder)._movementTarget.x - fVar14; local_154.x = (npc->_pathfinder)._movementTarget.y - (npc->_pos).y; if ((local_148 == g_vectorZero.x) && (local_154.x == g_vectorZero.y)) { local_160.x = (npc->_pathfinder)._moveDirection.x; } else { fVar14 = sin(npc->_updateTime * 0.01); local_158 = fVar14 * 30.0 * 0.017453292; local_160.x = cos(local_158); fVar16 = sin(local_158); fVar17 = local_160.x * local_154.x; fVar14 = npc->_speedMultiplier; local_160.x = (local_160.x * local_148 - fVar16 * local_154.x) * 0.001 * fVar14 + pVVar11->x; fVar15 = (npc->_pathfinder)._moveDirection.y; pVVar11->x = local_160.x; (npc->_pathfinder)._moveDirection.y = (fVar16 * local_148 + fVar17) * 0.001 * fVar14 + fVar15; fVar14 = (npc->_pos).x; } fVar15 = (float)local_144 + 80.0; if (fVar14 < fVar15) { LAB_0044cbfd: fVar16 = (fVar15 - fVar14) * 0.001 + local_160.x; pVVar11->x = fVar16; } else { fVar16 = local_160.x; fVar15 = local_120.x - 80.0; if (local_120.x - 80.0 < fVar14) goto LAB_0044cbfd; } fVar14 = (npc->_pos).y; if (local_134.x + 100.0 <= fVar14) { if ((float)local_14c - 100.0 < fVar14) { (npc->_pathfinder)._moveDirection.y = (((float)local_14c - 100.0) - fVar14) * 0.001 + (npc->_pathfinder)._moveDirection.y; } } else { (npc->_pathfinder)._moveDirection.y = ((local_134.x + 100.0) - fVar14) * 0.001 + (npc->_pathfinder)._moveDirection.y; } fVar14 = (npc->_pathfinder)._moveDirection.y; fVar14 = sqrtf(fVar14 * fVar14 + fVar16 * fVar16); if (1.0 < fVar14) { Vector::Normalize(pVVar11); } iVar9 = npc->_stateFrame + (int)local_140.x; npc->_stateFrame = iVar9; if (0x3b < iVar9) { if (npc->_i1 < 3) { ANM2::Play(&npc->_sprite,(byte *)"ThrowBomb",0); manager = g_manager; local_160.x = 9.58488e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,2,0,1.0,0.0); npc->_state = 8; pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (pEVar6->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar14 && fVar14 != (npc->_pos).x; npc->_i1 = npc->_i1 + 1; npc->_stateFrame = 0; } else { ANM2::Play(&npc->_sprite,(byte *)"DashStart",0); manager = g_manager; local_160.x = 9.48679e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,2,0,1.0,0.0); npc->_state = 9; pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (pEVar6->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar14 && fVar14 != (npc->_pos).x; npc->_i1 = 0; npc->_stateFrame = 0; } } break; case 4: case 6: if ((npc->_state == 6) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { ANM2::Play(&npc->_sprite,(byte *)"ChaseLoop",0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0x2ad,1.0,2,0,1.0); } npc->_friction = npc->_friction * 0.8; if (npc->_state == 6) { fVar14 = 1.6; } else { fVar14 = 0.55; } fVar15 = (npc->_pathfinder)._moveDirection.y; fVar16 = npc->_speedMultiplier; (npc->_velocity).x = fVar14 * (npc->_pathfinder)._moveDirection.x * fVar16 + (npc->_velocity).x; (npc->_velocity).y = fVar15 * fVar14 * fVar16 + (npc->_velocity).y; pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_148 = (float)npc->_state; fVar14 = (pEVar6->_pos).x; local_160.x = (pEVar6->_pos).y; local_154.y = local_160.x; local_158 = fVar14; if (local_148 == 8.40779e-45) { local_14c = (Room *)(((float)local_14c + local_134.x) * 0.5); if ((local_160.x <= (float)local_14c) || (0x3b < npc->_stateFrame)) { fVar15 = (npc->_pos).x; fVar16 = (npc->_pos).y; local_154.x = fVar14 - 113.137085; local_154.y = local_160.x - 113.137085; local_134.x = fVar14 + 113.137085; fVar17 = fVar15 - (pEVar6->_pos).x; fVar14 = fVar16 - (pEVar6->_pos).y; pVVar11 = &local_154; if ((fVar15 - local_134.x) * (fVar15 - local_134.x) + (fVar16 - local_154.y) * (fVar16 - local_154.y) <= (fVar15 - local_154.x) * (fVar15 - local_154.x) + (fVar16 - local_154.y) * (fVar16 - local_154.y)) { pVVar11 = &local_134; } local_134.y = local_154.y; fVar14 = sqrtf(fVar14 * fVar14 + fVar17 * fVar17); fVar14 = (fVar14 - 160.0) / 180.0; local_148 = 8.40779e-45; if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } local_154.y = local_160.x + (pVVar11->y - local_160.x) * fVar14; fVar14 = (pVVar11->x - local_158) * fVar14 + local_158; if (npc->_stateFrame < 0x3c) goto LAB_0044db6c; targetY = (float)local_14c; if (local_154.y <= (float)local_14c) { targetY = local_154.y; } } else { fVar14 = (npc->_pos).x - fVar14; fVar15 = (npc->_pos).y - local_160.x; local_154.x = (float)pEVar6; fVar15 = sqrtf(fVar15 * fVar15 + fVar14 * fVar14); fVar14 = fVar15 * 0.1 * ((Vector *)((int)local_154.x + 0x360))->x + local_158; targetY = fVar15 * 0.1 * ((Vector *)((int)local_154.x + 0x360))->y + local_160.x; } local_148 = 8.40779e-45; local_154.y = targetY; } LAB_0044db6c: pVVar11 = &(npc->_pathfinder)._moveDirection; local_154.x = fVar14 - (npc->_pos).x; local_154.y = local_154.y - (npc->_pos).y; bVar3 = Vector::operator_ne(&local_154,&g_vectorZero); if (bVar3 == 0) { fVar14 = (npc->_pathfinder)._moveDirection.y; } else { pVVar8 = Vector::Normalized(this,&scratchVec); if (local_148 == 8.40779e-45) { fVar15 = 0.8; } else { fVar15 = 0.1; } fVar14 = pVVar8->y * fVar15 * npc->_speedMultiplier + (npc->_pathfinder)._moveDirection.y; pVVar11->x = fVar15 * pVVar8->x * npc->_speedMultiplier + pVVar11->x; (npc->_pathfinder)._moveDirection.y = fVar14; } local_154.x = pVVar11->x; fVar14 = sqrtf(local_154.x * local_154.x + fVar14 * fVar14); if (fVar14 <= 1.0) { moveDirX = local_154.x; } else { Vector::Normalize(pVVar11); moveDirX = (npc->_pathfinder)._moveDirection.x; } (npc->_sprite)._flipX = 0.0 < moveDirX; iVar9 = npc->_stateFrame + (int)local_140.x; npc->_stateFrame = iVar9; if (npc->_state != 4) { if (0x59 < iVar9) { fVar14 = (npc->_pos).x; if (0.0 < moveDirX) { fVar15 = local_120.x - 150.0; bVar12 = fVar15 < fVar14; } else { fVar15 = (float)local_144 + 150.0; bVar12 = fVar14 < fVar15; } if (!bVar12 && fVar15 != fVar14) { if (npc->_i1 < 2) { ANM2::Play(&npc->_sprite,(byte *)"LungeShort",0); pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (pEVar6->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar14 && fVar14 != (npc->_pos).x; npc->_i1 = npc->_i1 + 1; npc->_state = 7; npc->_stateFrame = 0; } else { ANM2::Play(&npc->_sprite,(byte *)"LungeBomb",0); fVar14 = (local_120.x + (float)local_144) * 0.5; (npc->_sprite)._flipX = (npc->_pos).x <= fVar14 && fVar14 != (npc->_pos).x; npc->_state = 10; npc->_stateFrame = 0; npc->_i1 = 0; } } } break; } if (iVar9 < 0x3c) break; goto LAB_0044e4ea; case 5: pVVar11 = &npc->_v1; npc->_friction = npc->_friction * 0.6; if (npc->_stateFrame == 2) { fVar14 = Math::timescale_factor(0.6,npc->_speedMultiplier); (npc->_v1).y = fVar14 * (npc->_v1).y; pVVar11->x = fVar14 * pVVar11->x; child = npc->_child; (npc->_v1).y = npc->_speedMultiplier * 0.3 + (npc->_v1).y; if ((child == (EntityPtr)0x0) || (*(int *)((int)child + 0x410) < 1)) { Entity::SetChild((Entity *)npc,(Entity *)0x0); game = g_game; npc->_stateFrame = 3; (npc->_v1).x = 0.0; (npc->_v1).y = -18.0; (npc->_pos).y = *(float *)((int)game->_room + 0x20) - 30.0; ANM2::Play(&npc->_sprite,(byte *)"QuickBurst",0); play_sound_with_fart_seed(0x2a3,1.0,2,0,1.0); Sprite::SetFrame_1((Sprite *)&npc->_sprite,5); } } else if (npc->_stateFrame == 3) { Entity::AddVelocity_divided((Entity *)npc,pVVar11,0); fVar14 = Math::timescale_factor(0.8,npc->_speedMultiplier); pVVar11->x = fVar14 * pVVar11->x; (npc->_v1).y = fVar14 * (npc->_v1).y; bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { ANM2::Play(&npc->_sprite,(byte *)"Float",0); npc->_i1 = 0; npc->_stateFrame = 0; npc->_state = 4; } } else { Entity::AddVelocity_divided((Entity *)npc,pVVar11,0); fVar14 = pVVar11->x; (npc->_sprite)._flipX = fVar14 < 0.0; if (((0.0 < fVar14) && (local_120.x < npc->_size + (npc->_pos).x)) || ((fVar14 < 0.0 && ((npc->_pos).x - npc->_size < (float)local_144)))) { Entity_NPC::PlaySound(npc,0x45,1.0,2,0,1.0); (npc->_v1).x = -(npc->_v1).x; pfVar1 = &(npc->_pos).y; if (*pfVar1 <= local_134.x + 100.0 && local_134.x + 100.0 != *pfVar1) { fVar14 = (npc->_v1).y; npc->_stateFrame = 1; (npc->_v1).y = fVar14 - 4.0; } } iVar9 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar9 != 0) { uVar4 = Random(); local_154.x = (npc->_velocity).x; local_158 = (npc->_velocity).y; pVVar11 = MusicManager::RandomVector(&local_160); scratchVec.x = pVVar11->x + pVVar11->x + local_154.x * 0.2; scratchVec.y = pVVar11->y + pVVar11->y + local_158 * 0.2; spawnPos.x = (npc->_pos).x + 0.0; spawnPos.y = (npc->_pos).y - 40.0; pEVar6 = Game::Spawn(g_game,1000,0x3b,&spawnPos,&scratchVec,(Entity *)npc,0,uVar4); uVar4 = Random(); *(float *)(pEVar6[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); iVar9 = uVar4 % 0xf + 0xf; *(int *)(pEVar6[1]._sprite._filename._buf + 8) = iVar9; *(int *)(pEVar6[1]._sprite._filename._buf + 0xc) = iVar9; uVar7 = ::Color::Color(0x3f19999a); (**(code **)(*(int *)pEVar6 + 0x3c))(uVar7,0xffffffff,0xff,0,1); fVar14 = g_vectorOne.y; fVar15 = g_vectorOne.x * 2.0; pEVar6->_renderDepthOffset = -5.0; (pEVar6->_sprite)._scale.x = fVar15; (pEVar6->_sprite)._scale.y = fVar14 * 2.0; } if (npc->_stateFrame == 1) { fVar14 = npc->_speedMultiplier; fVar15 = Math::timescale_factor(0.94,fVar14); game = g_game; (npc->_v1).x = fVar15 * (npc->_v1).x; (npc->_v1).y = fVar14 * 0.5 + (npc->_v1).y; if ((*(float *)((int)game->_room + 0x20) - 30.0) + 80.0 < (npc->_pos).y) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x2b0,1.0,2,0,1.0); npc->_stateFrame = 2; uVar4 = Random(); pEVar6 = Game::Spawn(g_game,0x3b7,0x1f,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar4); uVar7 = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar9 = *(int *)pEVar6; *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar7; (**(code **)(iVar9 + 0xc))(); pEVar6->_visible = 0; (**(code **)(*(int *)pEVar6 + 0xc))(); Entity::SetChild((Entity *)npc,pEVar6); } } } break; case 7: case 10: npc->_friction = npc->_friction * 0.8; Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,(npc->_state == 10) + 0x2aa,1.0,2,0,1.0); if ((npc->_sprite)._flipX == 0) { fVar14 = -15.0; } else { fVar14 = 15.0; } (npc->_v1).x = fVar14; (npc->_v1).y = 12.0; } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar3 != 0) { fVar14 = npc->_speedMultiplier; fVar15 = (npc->_v1).y; (npc->_velocity).x = fVar14 * (npc->_v1).x + (npc->_velocity).x; (npc->_velocity).y = fVar15 * fVar14 + (npc->_velocity).y; fVar14 = Math::timescale_factor(0.7,npc->_speedMultiplier); (npc->_v1).y = fVar14 * (npc->_v1).y; (npc->_v1).x = fVar14 * (npc->_v1).x; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_state == 10) { uVar4 = Random(); pVVar11 = MusicManager::RandomVector(&scratchVec); local_154.x = (npc->_pos).x + pVVar11->x; local_154.y = pVVar11->y + (npc->_pos).y; pEVar6 = Game::Spawn(g_game,0x3b7,0x1f,&local_154,&g_vectorZero,(Entity *)npc,2,uVar4); uVar7 = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar9 = *(int *)pEVar6; *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar7; (**(code **)(iVar9 + 0xc))(); iVar9 = *(int *)pEVar6; pEVar6->_visible = 0; *(undefined4 *)&pEVar6[1].field_0x4 = 0; (**(code **)(iVar9 + 0xc))(); npc->_state = 5; ANM2::Play(&npc->_sprite,(byte *)"Knockback",0); if ((npc->_sprite)._flipX == 0) { fVar14 = 15.0; } else { fVar14 = -15.0; } (npc->_v1).x = fVar14; (npc->_v1).y = -2.0; npc->_stateFrame = 0; } else { ANM2::Play(&npc->_sprite,(byte *)"QuickBurst",0); npc->_state = 0xd; npc->_stateFrame = 0; } } break; case 8: npc->_friction = npc->_friction * 0.8; Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar3 != 0) { local_160.x = 9.47278e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,2,0,1.0,0.0); manager = g_manager; local_160.x = 9.61291e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,2,0,1.0,0.0); pVVar11 = Entity::GetNullOffset((Entity *)npc,&scratchVec,(byte *)"ShootPos"); local_140.y = (npc->_pos).y + pVVar11->y; local_140.x = (npc->_pos).x + pVVar11->x; pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_14c = (Room *)((pEVar6->_pos).x - local_140.x); local_158 = (pEVar6->_pos).y - local_140.y; isTargetLeft = (float)local_14c < 0.0; if ((bool)isTargetLeft) { local_14c = (Room *)-(float)local_14c; } local_160.y = -18.0; local_154.x = (float)local_14c * -18.0; fVar14 = (float)local_14c * 0.6 * (float)local_14c * 4.0 * local_158 + local_154.x * local_154.x; if (fVar14 <= 0.0) { fVar14 = 0.0; } fVar14 = sqrtf(fVar14); local_160.x = (fVar14 + local_154.x) / (local_158 + local_158); if ((float)local_14c <= 0.1) { local_14c = (Room *)0x41f00000; } else { local_14c = (Room *)((float)local_14c / local_160.x); } if (isTargetLeft != 0) { local_160.x = -local_160.x; } (npc->_sprite)._flipX = isTargetLeft ^ 1; uVar4 = Random(); pEVar6 = Game::SpawnEx(g_game,0x3b7,0x1f,&local_140,&local_160,(Entity *)npc,0,uVar4,0); uVar7 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar7; if (pEVar6->_parent != (EntityPtr)0x0) { local_154.x = (float)&pEVar6->_parent; std::multiset::erase(&local_154); } pEVar6->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar6->_parent); *(int *)&pEVar6[1].field_0x4 = (int)(float)local_14c + 0xf; (**(code **)(*(int *)pEVar6 + 0xc))(); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = (npc->_sprite)._animState._isPlaying; joined_r0x0044d76a: if (bVar3 != 0) break; } goto LAB_0044d03a; case 9: iVar9 = npc->_stateFrame; if (-1 < iVar9) { if (iVar9 < 4) { local_160.x = 40.0; } else { local_160.x = 30.0; } npc->_friction = 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"DashLoop",0); } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { (npc->_velocity).y = 0.0; } pvVar10 = (npc->_sprite)._animState._animData; if (((pvVar10 != (void *)0x0) && (*(char *)((int)pvVar10 + 0x34) != '\0')) || (bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"), bVar3 != 0)) { if ((npc->_sprite)._flipX == 0) { fVar14 = -10.0; } else { fVar14 = 10.0; } fVar14 = fVar14 * npc->_speedMultiplier + (npc->_velocity).x; if (fVar14 <= -local_160.x) { fVar14 = -local_160.x; } if (local_160.x <= fVar14) { fVar14 = local_160.x; } (npc->_velocity).x = fVar14; iVar9 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar9 != 0) { uVar4 = Random(); local_154.x = (npc->_velocity).x; local_158 = (npc->_velocity).y; pVVar11 = MusicManager::RandomVector(&scratchVec); local_154.x = pVVar11->x + pVVar11->x + local_154.x * 0.2; local_154.y = pVVar11->y + pVVar11->y + local_158 * 0.2; local_160.x = (npc->_pos).x + 0.0; local_160.y = (npc->_pos).y - 40.0; pEVar6 = Game::SpawnEx(g_game,1000,0x3b,&local_160,&local_154,(Entity *)npc,0,uVar4,0); uVar4 = Random(); *(float *)(pEVar6[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); iVar9 = uVar4 % 0xf + 0xf; *(int *)(pEVar6[1]._sprite._filename._buf + 8) = iVar9; *(int *)(pEVar6[1]._sprite._filename._buf + 0xc) = iVar9; uVar7 = ::Color::Color(0x3f19999a); (**(code **)(*(int *)pEVar6 + 0x3c))(uVar7,0xffffffff,0xff,0,1); fVar14 = g_vectorOne.y; fVar15 = g_vectorOne.x * 2.0; pEVar6->_renderDepthOffset = -5.0; (pEVar6->_sprite)._scale.x = fVar15; (pEVar6->_sprite)._scale.y = fVar14 * 2.0; } } if ((npc->_projectileDelay == 0) && (npc->_stateFrame - 1U < 3)) { fVar14 = (npc->_pos).x; fVar15 = (npc->_v1).x; if ((npc->_sprite)._flipX == 0) { fVar15 = fVar15 + 60.0; bVar12 = fVar15 < fVar14; } else { fVar15 = fVar15 - 60.0; bVar12 = fVar14 < fVar15; } if (!bVar12 && fVar14 != fVar15) { npc->_projectileDelay = 1; uVar4 = Random(); local_154.x = (npc->_velocity).x * 0.06; local_154.y = -8.0; pEVar6 = Game::SpawnEx(g_game,0x3b7,0x1f,&npc->_pos,&local_154,(Entity *)npc,1,uVar4,0); uVar7 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar7; if (pEVar6->_parent != (EntityPtr)0x0) { local_154.x = (float)&pEVar6->_parent; std::multiset::erase(&local_154); } pEVar6->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar6->_parent); (**(code **)(*(int *)pEVar6 + 0xc))(); } } iVar9 = npc->_stateFrame; if (iVar9 < 4) { if (iVar9 == 0) { fVar14 = 180.0; } else { fVar14 = 1000.0; if (iVar9 == 3) { fVar14 = 3200.0; } } fVar15 = (npc->_pos).x; if ((npc->_sprite)._flipX == 0) { fVar14 = (float)local_144 - fVar14; bVar12 = fVar14 < fVar15; } else { fVar14 = fVar14 + local_120.x; bVar12 = fVar15 < fVar14; } if (!bVar12 && fVar15 != fVar14) { npc->_stateFrame = iVar9 + 1; manager = g_manager; if (iVar9 + 1 < 4) { Entity_NPC::PlaySound(npc,0x2a6,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x2b1,1.0,2,0,1.0); } else { local_160.x = 9.44475e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,2,0,1.0,0.0); } if ((npc->_sprite)._flipX == 0) { fVar14 = local_120.x + 180.0; } else { fVar14 = (float)local_144 - 180.0; } iVar9 = npc->_stateFrame; (npc->_pos).x = fVar14; if (iVar9 - 1U < 3) { fVar14 = (float)local_14c - 20.0; } else { fVar14 = ((local_134.x + 80.0 + (float)local_14c) - 120.0) * 0.5; } (npc->_pos).y = fVar14; if (iVar9 == 1) { uVar4 = Random(); fVar14 = ((local_120.x - 160.0) - ((float)local_144 + 160.0)) * (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 + (float)local_144 + 160.0; } else { uVar4 = Random(); local_158 = (npc->_v1).x + 70.0; local_154.x = ((((local_120.x - 140.0) - ((float)local_144 + 140.0)) * (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 + (float)local_144 + 140.0) - local_158) / 140.0; fVar13 = (float10)roundf(local_154.x); local_154.x = (float)fVar13; fVar14 = local_154.x * 140.0 + local_158; } (npc->_v1).x = fVar14; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; npc->_projectileDelay = 0; local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; local_e4._offset[0] = 0.5; local_e4._offset[1] = 0.25; local_e4._offset[2] = 0.0; (**(code **)(*(int *)npc + 0x3c))(&local_e4,0xf,1,1,1); } } else { fVar14 = (npc->_pos).x; if ((npc->_sprite)._flipX == 0) { fVar15 = local_120.x - 20.0; bVar12 = fVar15 < fVar14; } else { fVar15 = (float)local_144 + 20.0; bVar12 = fVar14 < fVar15; } if (!bVar12 && fVar14 != fVar15) { ANM2::Play(&npc->_sprite,(byte *)"DashEnd",0); npc->_stateFrame = -1; } } break; } fVar14 = ((float)iVar9 - -1.0) / -29.0; npc->_stateFrame = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar9; if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } npc->_friction = (1.0 - fVar14 * 0.6) * npc->_friction; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = (npc->_sprite)._animState._isPlaying; goto joined_r0x0044d76a; } LAB_0044d03a: ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_stateFrame = 0; break; case 0xd: npc->_friction = npc->_friction * 0.7; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { play_sound_with_fart_seed(0x2a9,1.0,2,0,1.0); play_sound_with_fart_seed(0x2af,1.0,2,0,1.0); ENTITY_BEAST_ultra_war_fire_burst(npc); fVar14 = 0.0; npc->_stateFrame = 1; local_134.x = 0.0; local_14c = (Room *)cos(0.3926991); local_144 = (code *)sin(0.3926991); do { local_154.x = (float)(int)fVar14 * 45.0 * 0.017453292; local_158 = cos(local_154.x); fVar14 = sin(local_154.x); local_160.x = local_158 * 5.0 - fVar14 * 0.0; local_140.x = fVar14 * 5.0 + local_158 * 0.0; local_120.x = local_160.x; local_120.y = local_140.x; uVar4 = Random(); spawnPos.x = local_160.x * 4.0 + (npc->_pos).x; spawnPos.y = local_140.x * 4.0 + (npc->_pos).y; pEVar6 = Game::SpawnEx(g_game,0x21,10,&spawnPos,&local_120,(Entity *)npc,0,uVar4,0); pEVar6->_renderZOffset = -2000; pEVar6->_health = pEVar6->_maxHitPoints * 1.2; (**(code **)(*(int *)pEVar6 + 0xc))(); pEVar6->_entityGridCollisionClass = 0; local_154.x = ((float)local_14c * local_160.x - (float)local_144 * local_140.x) * 0.6; local_158 = ((float)local_14c * local_140.x + (float)local_144 * local_160.x) * 0.6; local_120.x = local_154.x; local_120.y = local_158; uVar4 = Random(); scratchVec.x = local_154.x * 4.0 + (npc->_pos).x; scratchVec.y = local_158 * 4.0 + (npc->_pos).y; pEVar6 = Game::SpawnEx(g_game,0x21,10,&scratchVec,&local_120,(Entity *)npc,0,uVar4,0); pEVar6->_renderZOffset = -2000; pEVar6->_health = pEVar6->_maxHitPoints * 0.8; (**(code **)(*(int *)pEVar6 + 0xc))(); pEVar6->_entityGridCollisionClass = 0; fVar14 = (float)((int)local_134.x + 1); local_134.x = fVar14; } while ((int)fVar14 < 8); fVar14 = local_148; } uVar4 = npc->_stateFrame; if (0 < (int)uVar4) { if (0 < (int)fVar14) { do { if ((uVar4 & 1) == 0) { iVar9 = 0; do { local_154.x = (float)iVar9 * 90.0 * 0.017453292; local_158 = cos(local_154.x); fVar14 = sin(local_154.x); local_160.x = local_158 * 16.0 - fVar14 * 0.0; local_140.x = fVar14 * 16.0 + local_158 * 0.0; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 2; uVar4 = Random(); projParams.FallingAccelModifier = -0.2; projParams.Scale = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.7; ::Color::Reset(&defaultColor); projParams.Color._tint[0] = 1.0; projParams.Color._tint[1] = 0.8; projParams.Color._tint[2] = 0.8; projParams.Color._tint[3] = 1.0; projParams.Color._offset[2] = defaultColor._offset[2]; projParams.Color._colorize[0] = defaultColor._colorize[0]; projParams.Color._colorize[1] = defaultColor._colorize[1]; projParams.Color._colorize[2] = defaultColor._colorize[2]; projParams.Color._colorize[3] = defaultColor._colorize[3]; projParams.Color._offset[0] = defaultColor._offset[0]; projParams.Color._offset[1] = defaultColor._offset[1]; uVar4 = Random(); scratchVec.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8; scratchVec.y = scratchVec.x * local_140.x; scratchVec.x = scratchVec.x * local_160.x; uVar4 = Random(); local_154.x = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 90.0 - 45.0) * 0.017453292; local_158 = cos(local_154.x); fVar14 = sin(local_154.x); spawnPos.x = (local_158 * local_160.x - fVar14 * local_140.x) * 4.0 + (npc->_pos).x; spawnPos.y = (local_158 * local_140.x + fVar14 * local_160.x) * 4.0 + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&spawnPos,&scratchVec,0,&projParams); iVar9 = iVar9 + 1; } while (iVar9 < 4); uVar4 = npc->_stateFrame; fVar14 = local_148; } uVar4 = uVar4 + 1; fVar14 = (float)((int)fVar14 + -1); npc->_stateFrame = uVar4; local_148 = fVar14; } while (fVar14 != 0.0); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; LAB_0044e4ea: ANM2::Play(&npc->_sprite,(byte *)"ChaseStart",0); npc->_state = 6; npc->_stateFrame = 0; break; case 0x10: npc->_friction = npc->_friction * 0.6; Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar3 != 0) { local_160.x = 9.51482e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,2,0,1.0,0.0); spawn_gibs(&npc->_pos,10,90.0,(uint *)((int)npc->_config + 0x60),(Entity *)npc, &npc->_splatColor,&g_vectorZero,1.0); Entity_NPC::PlaySound(npc,0x8d,1.0,2,0,1.0); Game::ShakeScreen(g_game,10); ENTITY_BEAST_ultra_war_fire_burst(npc); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_entityCollisionClass = 4; npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)"Float",0); npc->_stateFrame = 0; npc->_i1 = 0; } break; case 99: npc->_state = 9; npc->_visible = 1; npc->_entityCollisionClass = 4; ANM2::Play(&npc->_sprite,(byte *)"DashLoop",0); manager = g_manager; local_140.x = 9.44475e-43; seed_fart_sound_override((int *)&local_140); SoundEffects::Play(&manager->_sfxManager,(int)local_140.x,1.0,2,0,1.0,0.0); npc->_stateFrame = 4; npc->_i1 = 0; } if ((isEmittingSmoke != '\0') && (((npc->_state != 0x10 || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)))) && (iVar9 = Entity::GetIntervalTicks((Entity *)npc,3.0,0.0), iVar9 != 0)))) { pvVar10 = AnimationState::GetLayerFrame(&(npc->_sprite)._animState,0); local_134.x = *(float *)((int)pvVar10 + 0x14); local_160.x = *(float *)((int)pvVar10 + 0x10); local_148 = *(float *)((int)pvVar10 + 0x1c); local_140.x = *(float *)((int)pvVar10 + 0x18); if ((npc->_sprite)._flipX != 0) { local_160.x = -local_160.x; local_140.x = -local_140.x; } local_158 = (npc->_posOffset).x; local_154.x = (npc->_pos).x; local_144 = (code *)(npc->_pos).y; local_14c = (Room *)(npc->_posOffset).y; pVVar11 = MusicManager::RandomVector(&scratchVec); uVar4 = Random(); fVar14 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; spawnPos.x = (local_160.x / 0.65) * local_140.x + local_154.x + local_158 + fVar14 * pVVar11->x * 40.0 * local_140.x; spawnPos.y = (local_134.x / 0.65) * local_148 + (float)local_14c + (float)local_144 + fVar14 * pVVar11->y * 40.0 * local_148; uVar4 = Random(); local_154.x = (npc->_velocity).y * 0.1; scratchVec.x = (npc->_velocity).x * 0.1 + 0.0; uVar5 = Random(); scratchVec.y = (-2.0 - (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 6.0) + local_154.x; pEVar6 = Game::SpawnEx(g_game,1000,0x3b,&spawnPos,&scratchVec,(Entity *)npc,0,uVar4,0); BlendMode::SetMode(&local_e4,2,unusedArg); smokeLayer = ANM2::GetLayer(&pEVar6->_sprite,(byte *)0x0); smokeLayer->_blendMode[0] = (int)local_e4._tint[0]; smokeLayer->_blendMode[1] = (int)local_e4._tint[1]; smokeLayer->_blendMode[2] = (int)local_e4._tint[2]; smokeLayer->_blendMode[3] = (int)local_e4._tint[3]; smokeLayer->_blendMode[4] = (int)local_e4._colorize[0]; smokeLayerColor = (ColorMod *)::Color::Color(0x3f800000); smokeLayer = ANM2::GetLayer(&pEVar6->_sprite,(byte *)0x0); ::Color::operator_assign((Color *)&smokeLayer->_color,smokeLayerColor); uVar4 = Random(); *(float *)(pEVar6[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); iVar9 = uVar4 % 10 + 10; *(int *)(pEVar6[1]._sprite._filename._buf + 8) = iVar9; *(int *)(pEVar6[1]._sprite._filename._buf + 0xc) = iVar9; uVar4 = Random(); fVar14 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.6; fVar15 = fVar14 * g_vectorOne.y; fVar14 = fVar14 * g_vectorOne.x; pEVar6->_renderZOffset = -2000; (pEVar6->_sprite)._scale.y = fVar15; (pEVar6->_sprite)._scale.x = fVar14; } return; } //@@ 0044ee60 NpcAI::ENTITY_BEAST_ultra_war_fire_burst /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: npc in ECX; called by NpcAI::ENTITY_BEAST_ultra_war 0x44c070 on the Transition and QuickBurst Shoot events: sound 483 flame_burst (pitch 1.5/0.5 for champion colour 18/19) and 5 fans x 5 dust clouds 1000.59 rising from pos (notes/entities/beast_war_death.md) */ void __fastcall NpcAI::ENTITY_BEAST_ultra_war_fire_burst(Entity_NPC *npc) { uint uVar1; Entity *dustCloud; LayerState *layer; int iVar2; float fVar3; float scaleY; float local_6c; float local_68; float local_64; int fanIndex; Entity_NPC *savedNpc; float local_58; float cosJitter; float local_50; float fanDirY; Vector cloudVelocity; Vector cloudPos; undefined4 local_38 [8]; undefined4 local_18; undefined4 uStack_14; float local_10; uint securityCookie; Manager *manager; manager = g_manager; securityCookie = __security_cookie ^ (uint)&local_6c; local_6c = 1.0; if (npc->_championColorIdx == 0x12) { local_6c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_6c = 0.5; } local_68 = 6.76827e-43; savedNpc = npc; seed_fart_sound_override((int *)&local_68); SoundEffects::Play(&manager->_sfxManager,(int)local_68,1.0,2,0,local_6c,0.0); fanIndex = -2; do { iVar2 = fanIndex; uVar1 = Random(); local_64 = -14.0 - (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 10.0; uVar1 = Random(); local_68 = (((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 12.0 + (float)iVar2 * 20.0) * 0.017453292; local_6c = cos(local_68); fVar3 = sin(local_68); local_68 = 0.0; fanDirY = local_6c * 0.0 - fVar3 * local_64; local_6c = local_6c * local_64 + fVar3 * 0.0; do { local_58 = (float)(int)local_68 * 0.7 * 0.25 + 0.3; local_50 = local_58 * local_6c; local_58 = local_58 * fanDirY; uVar1 = Random(); local_64 = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 10.0 - 5.0) * 0.017453292; cosJitter = cos(local_64); fVar3 = sin(local_64); cloudVelocity.x = local_58 * cosJitter - local_50 * fVar3; cloudVelocity.y = local_50 * cosJitter + local_58 * fVar3; cloudPos.x = cloudVelocity.x + cloudVelocity.x + (npc->_pos).x; cloudPos.y = cloudVelocity.y + cloudVelocity.y + (npc->_pos).y; uVar1 = Random(); dustCloud = Game::SpawnEx(g_game,1000,0x3b,&cloudPos,&cloudVelocity,(Entity *)npc,0,uVar1,0); uVar1 = g_graphicsManager_flags; layer = ANM2::GetLayer(&dustCloud->_sprite,(byte *)0x0); local_18 = 0; uStack_14 = 0; iVar2 = 1; local_10 = 0.0; if ((uVar1 & 4) == 0) { iVar2 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar2; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; layer = ANM2::GetLayer(&dustCloud->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)local_38) { (layer->_color)._tint[0] = 5.0; (layer->_color)._tint[1] = 0.5; (layer->_color)._tint[2] = 0.2; (layer->_color)._tint[3] = 1.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_14,local_18); (layer->_color)._offset[2] = local_10; } uVar1 = Random(); *(float *)(dustCloud[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar1 = Random(); iVar2 = uVar1 % 10 + 10; *(int *)(dustCloud[1]._sprite._filename._buf + 8) = iVar2; *(int *)(dustCloud[1]._sprite._filename._buf + 0xc) = iVar2; uVar1 = Random(); local_68 = (float)((int)local_68 + 1); fVar3 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 1.2 + 0.3; scaleY = fVar3 * g_vectorOne.y; fVar3 = fVar3 * g_vectorOne.x; dustCloud->_renderZOffset = -600; (dustCloud->_sprite)._scale.y = scaleY; (dustCloud->_sprite)._scale.x = fVar3; npc = savedNpc; } while ((int)local_68 < 5); fanIndex = fanIndex + 1; } while (fanIndex < 3); return; } //@@ 0044f2b0 NpcAI::ENTITY_BEAST_ultra_war_bomb /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? 951 variant switch case 0x1f (variant 31) at 006c417d; "Pulse" anim, falls until y > room bottom-30 then spawns 1000.181 + Game::BombDamage/BombExplosionEffects, RemoveWithPoof; inlined Game::Spawn pickup randomization */ void __fastcall NpcAI::ENTITY_BEAST_ultra_war_bomb(Entity_NPC *npc) { float *pfVar1; ANM2 *pAVar2; char *pcVar3; Room *pRVar4; code *pcVar5; EntityPtr EVar6; undefined4 uVar7; longlong lVar8; byte bVar9; char cVar10; uint uVar11; Entity *pEVar12; ColorMod *Color; uint uVar13; int extraout_EAX; ColorMod *color; float *pfVar14; EntityPtr centerEffect; int unusedArg; void *pvVar15; int *piVar16; uint uVar17; int iVar18; int iVar19; PlayerManager *playerManager; bool bVar20; float fVar21; float fVar22; ulonglong uVar23; undefined1 auStack_190 [4]; Entity *local_18c; float local_188; char isAnyInsideRoom; Vector scratchVec; float pickupSubType; int *local_174; float finalSubType; int local_16c; undefined8 local_168; float local_160; Entity_NPC *warBomb; Vector local_158; Entity *local_150; EntityPtr *local_148; uint spawnType; float fStack_13c; uint spawnVariant; float local_134; Vector local_130; Vector VStack_128; Vector local_120; Vector local_118; undefined8 local_10c; undefined4 local_104; undefined1 local_100 [8]; int local_f8; Color tmpColor; RNG cardRng; ProjectileParams projParams; uint local_c; Game *game; Manager *manager; EntityPtr *spawnerSlot; int subtype; game = g_game; local_c = __security_cookie ^ (uint)auStack_190; if (npc->_aiCallPhase == 1) { if (((npc->_visible != 0) && ((npc->_velocity).y = npc->_speedMultiplier * 1.2 + (npc->_velocity).y, *(float *)((int)game->_room + 0x20) - 30.0 < (npc->_pos).y)) && (npc->_friction = npc->_friction * 0.5, npc->_subtype == 1)) { (npc->_velocity).x = 0.0; return; } } else if (npc->_aiCallPhase == 3) { if ((npc->_subtype == 1) && ((iVar19 = *(int *)((int)npc->_collisionEntity + 0x28), iVar19 == 1 || (iVar19 == 3)))) { npc->_collisionResult = 0; return; } } else { iVar18 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; iVar19 = npc->_state; local_16c = iVar18; warBomb = npc; if (iVar19 == 0) { uVar7 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x44000011; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = uVar7; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_aiCallFlags = 5; npc->_renderZOffset = -500; npc->_state = (uint)(npc->_subtype != 1) * 2 + 3; } else if (iVar19 == 3) { if (*(float *)((int)g_game->_room + 0x20) - 30.0 < (npc->_pos).y) { npc->_stateFrame = 0xf; npc->_state = 5; uVar11 = Random(); local_120.x = (npc->_pos).x; local_120.y = *(float *)((int)g_game->_room + 0x20) - 30.0; centerEffect = (EntityPtr) Game::SpawnEx(g_game,1000,0xb5,&local_120,&g_vectorZero,(Entity *)npc,0, uVar11,0); if (npc->_child != (EntityPtr)0x0) { local_158.x = (float)&npc->_child; std::multiset::erase(&local_158); } npc->_child = centerEffect; if (centerEffect != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } *(float *)((int)centerEffect + 0xfc) = 0.0; EVar6 = *(EntityPtr *)((int)centerEffect + 0x3bc); pAVar2 = (ANM2 *)((int)centerEffect + 0x454); (pAVar2->_filename)._buf[0] = '\0'; (pAVar2->_filename)._buf[1] = '\0'; (pAVar2->_filename)._buf[2] = -0x80; (pAVar2->_filename)._buf[3] = '?'; pcVar3 = (char *)((int)centerEffect + 0x458); pcVar3[0] = '\0'; pcVar3[1] = '\0'; pcVar3[2] = '\0'; pcVar3[3] = '\0'; if (EVar6 != (EntityPtr)0x0) { local_158.x = (float)((int)centerEffect + 0x3bc); std::multiset::erase(&local_158); } *(EntityPtr *)((int)centerEffect + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)centerEffect + 0x3bc)); (**(code **)(*(int *)centerEffect + 0xc))(); local_16c = 1; do { uVar11 = Random(); local_134 = (float)local_16c * 140.0; VStack_128.y = *(float *)((int)g_game->_room + 0x20) - 30.0; VStack_128.x = local_134 + (npc->_pos).x; local_150 = Game::SpawnEx(g_game,1000,0xb5,&VStack_128,&g_vectorZero,(Entity *)npc,0, uVar11,0); (local_150->_sprite)._color._tint[3] = 0.0; EVar6 = local_150->_parent; *(undefined4 *)&local_150[1].field_0x44 = 3; pAVar2 = &local_150[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; local_160 = 1.0 - (float)local_16c * 0.2; *(float *)local_150[1]._sprite._filename._buf = local_160; local_148 = &local_150->_parent; if (EVar6 != (EntityPtr)0x0) { local_158.x = (float)local_148; std::multiset::erase(&local_158); } *local_148 = centerEffect; if (centerEffect != (EntityPtr)0x0) { std::multiset::insert(local_148); } (**(code **)(*(int *)local_150 + 0xc))(); uVar11 = Random(); local_130.x = (npc->_pos).x - local_134; local_130.y = *(float *)((int)g_game->_room + 0x20) - 30.0; local_150 = Game::SpawnEx(g_game,1000,0xb5,&local_130,&g_vectorZero,(Entity *)npc,0,uVar11 ,0); (local_150->_sprite)._color._tint[3] = 0.0; EVar6 = local_150->_parent; *(undefined4 *)&local_150[1].field_0x44 = 3; *(float *)local_150[1]._sprite._filename._buf = local_160; pAVar2 = &local_150[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; local_148 = &local_150->_parent; if (EVar6 != (EntityPtr)0x0) { local_158.x = (float)local_148; std::multiset::erase(&local_158); } *local_148 = centerEffect; if (centerEffect != (EntityPtr)0x0) { std::multiset::insert(local_148); } (**(code **)(*(int *)local_150 + 0xc))(); local_16c = local_16c + 1; } while (local_16c < 5); return; } } else if (iVar19 == 5) { pvVar15 = (npc->_sprite)._animState._animData; if ((pvVar15 != (void *)0x0) && (*(char *)((int)pvVar15 + 0x34) != '\0')) { ANM2::SetFrame(&npc->_sprite,(std_string *)"Pulse",0); } iVar19 = npc->_stateFrame; if (iVar19 < 1) { if (iVar19 == 0) { if (npc->_child != (EntityPtr)0x0) { *(undefined1 *)((int)npc->_child + 0x173) = 1; } bVar9 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x3f); if (bVar9 != 0) { (**(code **)(*(int *)npc + 0x28))(); manager = g_manager; local_18c = (Entity *)0x384; seed_fart_sound_override((int *)&local_18c); SoundEffects::Play(&manager->_sfxManager,(int)local_18c,1.0,2,0,1.0,0.0); uVar11 = Random(); pEVar12 = Game::SpawnEx(g_game,5,0x28,&npc->_pos,&npc->_velocity,(Entity *)0x0,7,uVar11, 0); pvVar15 = (pEVar12->_sprite)._animState._animData; if (pvVar15 != (void *)0x0) { AnimationState::SetFrameFloat (&(pEVar12->_sprite)._animState,(float)(*(int *)((int)pvVar15 + 0x30) + -8)) ; } uVar11 = Random(); Game::SpawnEx(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,1,uVar11,0); return; } ::Color::Color(&tmpColor); Game::BombExplosionEffects (g_game,&npc->_pos,80.0,(BitSet128)ZEXT816(0),Color, (Entity *)npc->_spawnerEntity,1.5,0,4,0); Game::ShakeScreen(g_game,10); local_168._4_4_ = 0; do { iVar19 = local_168._4_4_; uVar11 = Random(); local_18c = (Entity *) (((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 0.8 + ((float)iVar19 - 0.4)) * 36.0 * 0.017453292); uVar11 = Random(); uVar13 = Random(); local_188 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)] ) * 2.3283064e-10 * 5.0 + 10.0; scratchVec.x = cos((float)local_18c); scratchVec.x = scratchVec.x * local_188; scratchVec.y = sin((float)local_18c); scratchVec.y = scratchVec.y * local_188; pEVar12 = Game::SpawnEx(g_game,1000,0x3b,&npc->_pos,&scratchVec,(Entity *)npc,0,uVar11,0 ); uVar11 = Random(); *(float *)(pEVar12[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar11 = Random(); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; iVar19 = *(int *)pEVar12; iVar18 = uVar11 % 0xf + 0xf; tmpColor._offset[2] = 0.0; *(int *)(pEVar12[1]._sprite._filename._buf + 8) = iVar18; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; *(int *)(pEVar12[1]._sprite._filename._buf + 0xc) = iVar18; tmpColor._tint[0] = 0.8; tmpColor._tint[1] = 0.68; tmpColor._tint[2] = 0.65; tmpColor._tint[3] = 0.6; (**(code **)(iVar19 + 0x3c))(); fVar21 = g_vectorOne.y; fVar22 = g_vectorOne.x * 2.0; pEVar12->_renderZOffset = -600; (pEVar12->_sprite)._scale.x = fVar22; (pEVar12->_sprite)._scale.y = fVar21 * 2.0; local_168._4_4_ = local_168._4_4_ + 1; } while (local_168._4_4_ < 10); if (npc->_subtype == 0) { ProjectileParams::ProjectileParams(&projParams); tmpColor._tint[0] = 2.0; tmpColor._tint[1] = 2.0; tmpColor._tint[2] = 2.0; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 0.4; tmpColor._offset[1] = 0.12; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[2] = -0.3; ::Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&tmpColor); fVar21 = 0.0; projParams.BulletFlags._0_4_ = 0x2000; projParams.BulletFlags._4_4_ = 0; local_188 = 0.0; do { iVar19 = 0; local_160 = ((fVar21 * 360.0) / 12.0) * 0.017453292; local_18c = (Entity *)cos(local_160); local_168._0_4_ = sin(local_160); local_160 = (float)local_168 * 0.0; fStack_13c = (float)local_18c * 0.0; do { fVar21 = 10.0 - ABS((float)iVar19); projParams.Scale = ABS((float)iVar19) * 0.4 + 1.0; scratchVec.x = (float)local_18c * fVar21 - local_160; scratchVec.y = (float)local_168 * fVar21 + fStack_13c; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,0,&projParams); iVar19 = iVar19 + 1; *(undefined4 *)(extraout_EAX + 0x414) = 0; *(undefined4 *)(extraout_EAX + 0x418) = 0xbdcccccd; } while (iVar19 < 4); local_188 = (float)((int)local_188 + 1); fVar21 = (float)(int)local_188; } while (fVar21 < 12.0); } ::Color::Color(&tmpColor); Entity::MakeGroundPoof((Entity *)npc,&npc->_pos,color,1.0); game = g_game; g_game->_bloomDuration = 6; game->_bloomTimer = 6; game->_bloomStrength = 1.0; npc->_stateFrame = -1; (npc->_v1).x = 0.0; npc->_visible = 0; npc->_entityCollisionClass = 0; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; return; } subtype = npc->_subtype; if ((subtype == 0) || (subtype == 2)) { if (0 < iVar18) { iVar19 = npc->_stateFrame; do { if ((-iVar19 & 1U) == 0) { isAnyInsideRoom = '\0'; local_160 = 0.0; (npc->_v1).x = (npc->_v1).x + 80.0; do { fVar21 = (npc->_v1).x; scratchVec.y = fVar21 * *(float *)((int)&DAT_00c5c580 + (int)local_160) + (npc->_pos).y; scratchVec.x = fVar21 * *(float *)((int)&DAT_00c5c57c + (int)local_160) + (npc->_pos).x; pRVar4 = g_game->_room; if (*(int *)(*(int *)((int)pRVar4->_descriptor + 0x10) + 0x48) - 9U < 4) { Room::GetClampedPositionImpl(pRVar4,&local_130,&scratchVec,0.0,0.0,0.0,0.0); if ((local_130.x == scratchVec.x) && (local_130.y == scratchVec.y)) goto LAB_0044fe62; } else if (((pRVar4->_topLeftPos).x + 0.0 <= scratchVec.x) && (((scratchVec.x <= (pRVar4->_bottomRightPos).x - 0.0 && ((pRVar4->_topLeftPos).y + 0.0 <= scratchVec.y)) && (scratchVec.y <= (pRVar4->_bottomRightPos).y - 0.0)))) { LAB_0044fe62: isAnyInsideRoom = '\x01'; uVar11 = Random(); local_168 = CONCAT44(g_game,uVar11); pickupSubType = 0.0; spawnVariant = 1; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&scratchVec,&g_vectorZero, (Entity *)0x0,(int *)&pickupSubType,(uint *)&local_168); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00450156: finalSubType = pickupSubType; } else { local_174 = (g_game->_deathmatchManager)._type; pEVar12 = (Entity *)Random(); piVar16 = local_174; fVar21 = pickupSubType; local_10c = 0x900000005; local_188 = 9.80909e-45; local_104 = 7; local_18c = pEVar12; if (spawnType != 5) goto LAB_00450156; if (spawnVariant < 0x12d) { if (spawnVariant == 300) { while ((finalSubType = pickupSubType, pickupSubType == 0.0 || (cVar10 = (**(code **)(*local_174 + 0x24))(pickupSubType), cVar10 != '\0'))) { if (pEVar12 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar11 = (uint)pEVar12 >> ((byte)local_10c & 0x1f) ^ (uint)pEVar12; uVar11 = uVar11 << ((byte)((ulonglong)local_10c >> 0x20) & 0x1f) ^ uVar11; pEVar12 = (Entity *)(uVar11 >> (SUB41(local_188,0) & 0x1f) ^ uVar11); iVar19 = ItemPool::GetCardEx((int)pEVar12,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)pEVar12; pickupSubType = (float)lua_callback_run_get_card(&cardRng,iVar19,1,1,0); } } else { if (spawnVariant == 0x46) { local_150 = (Entity *)((uint)pickupSubType >> 0xb); do { finalSubType = pickupSubType; if (pickupSubType != 0.0) { pcVar5 = *(code **)(*local_174 + 0x28); iVar19 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)pickupSubType, (Entity_Player *)0x0); cVar10 = (*pcVar5)(iVar19); if (cVar10 == '\0') goto LAB_0044ff99; pEVar12 = local_18c; } if (pEVar12 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar11 = (uint)pEVar12 >> ((byte)local_10c & 0x1f) ^ (uint)pEVar12; uVar11 = uVar11 << ((byte)((ulonglong)local_10c >> 0x20) & 0x1f) ^ uVar11; pEVar12 = (Entity *)(uVar11 >> (SUB41(local_188,0) & 0x1f) ^ uVar11); local_18c = pEVar12; uVar11 = ItemPool::GetPill((uint)pEVar12); pickupSubType = (float)(uVar11 | ((uint)local_150 & 1) << 0xb); } while( true ); } if (spawnVariant != 100) goto LAB_00450156; finalSubType = pickupSubType; if (pickupSubType == 3.50325e-44) { LAB_0044ff77: bVar20 = false; } else { local_134 = pickupSubType; std::set::find_node(local_100,&local_134); if (((*(char *)(local_f8 + 0xd) == '\0') && (*(int *)(local_f8 + 0x10) <= (int)fVar21)) && (local_f8 != piVar16[8])) goto LAB_0044ff77; bVar20 = true; } if ((fVar21 == 0.0) || (bVar20)) { pickupSubType = (float)(**(code **)(*piVar16 + 0x84))(0); finalSubType = pickupSubType; } } } else { if (spawnVariant != 0x15e) goto LAB_00450156; while ((finalSubType = pickupSubType, pickupSubType == 0.0 || (cVar10 = (**(code **)(*local_174 + 0x2c))(pickupSubType), cVar10 != '\0'))) { pickupSubType = (float)ItemPool::GetTrinket(&g_game->_itemPool,0); } } LAB_0044ff99: npc = warBomb; } local_18c = EntityFactory::Create (*(void **)(local_168._4_4_ + 0x26580),spawnType,0); if (local_18c != (Entity *)0x0) { uVar23 = GetTimeNs(); pEVar12 = local_18c; uVar13 = (uint)(uVar23 >> 0x20); lVar8 = (uVar23 & 0xffffffff) * 0x431bde82; local_148 = (EntityPtr *)((ulonglong)lVar8 >> 0x20); uVar23 = (ulonglong)uVar13 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar23 >> 0x20); lVar8 = lVar8 + (uVar23 & 0xffffffff); local_150 = (Entity *)lVar8; uVar11 = (uint)((ulonglong)lVar8 >> 0x20); lVar8 = (ulonglong)uVar13 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar11),uVar17 + uVar11); uVar11 = (uint)((ulonglong)lVar8 >> 0x20); local_174 = (int *)((uint)lVar8 >> 0x12 | uVar11 * 0x4000); local_188 = (float)(uVar11 >> 0x12); spawnerSlot = &local_18c->_spawnerEntity; local_18c->_spawnerType = 0; local_18c->_spawnerVariant = 0; if (*spawnerSlot != (EntityPtr)0x0) { local_158.x = (float)spawnerSlot; std::multiset::erase(&local_158); } iVar19 = *(int *)pEVar12; *spawnerSlot = (EntityPtr)0x0; (pEVar12->_pos).x = scratchVec.x; (pEVar12->_pos).y = scratchVec.y; (pEVar12->_velocity).x = g_vectorZero.x; (pEVar12->_velocity).y = g_vectorZero.y; (**(code **)(iVar19 + 4))(); iVar19 = *(int *)(local_168._4_4_ + 0x18300); iVar18 = *(int *)(iVar19 + 0x1214); *(int *)(iVar19 + 0x1214) = iVar18 + 1; pEVar12->_index = iVar18; EntityList::AddEntity((EntityList *)(iVar19 + 0x1218),pEVar12); bVar9 = Game::ShouldEraseEnemy(pEVar12); if (bVar9 != 0) { Entity::RemoveWithPoof(pEVar12,unusedArg); } if ((pEVar12->_exists != 0) && (*(int *)(local_168._4_4_ + 0x67758) != *(int *)(local_168._4_4_ + 0x6775c) )) { VStack_128.y = (float)pEVar12->_variant; fVar21 = (float)pEVar12->_type; pfVar1 = (float *)(local_168._4_4_ + 0x67780); VStack_128.x = fVar21; std::map::find(&fStack_13c,&VStack_128); if (fStack_13c == *pfVar1) { local_120.y = -NAN; local_120.x = fVar21; pfVar14 = (float *)std::map::find (&local_118,&local_120); fStack_13c = *pfVar14; if (fStack_13c == *pfVar1) goto LAB_004503a9; } uVar11 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar15 = (playerManager->_playerList)._end; if ((int)pvVar15 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar15 = (playerManager->_playerList)._end; } piVar16 = (playerManager->_playerList)._begin; if (uVar11 < (uint)((int)pvVar15 - (int)piVar16 >> 2)) { piVar16 = piVar16 + uVar11; } trigger_set_dispatch ((void *)(*piVar16 + 0x1fc8),6,local_18c,&scratchVec, &g_vectorZero); uVar11 = uVar11 + 1; playerManager = &g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_004503a9: uVar23 = GetTimeNs(); uVar11 = (uint)(uVar23 >> 0x20); lVar8 = (uVar23 & 0xffffffff) * 0x431bde82; local_150 = (Entity *)((ulonglong)lVar8 >> 0x20); local_168 = (ulonglong)uVar11 * 0x431bde82; uVar23 = (ulonglong)uVar11 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)(uVar23 >> 0x20); lVar8 = lVar8 + (uVar23 & 0xffffffff); local_148 = (EntityPtr *)lVar8; uVar11 = (uint)((ulonglong)lVar8 >> 0x20); lVar8 = local_168 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar11),uVar13 + uVar11) ; uVar13 = (uint)((ulonglong)lVar8 >> 0x20); piVar16 = (int *)((uint)lVar8 >> 0x12 | uVar13 * 0x4000); uVar11 = (int)piVar16 - (int)local_174; bVar20 = CARRY4((uint)g_entitySpawnTimeMs,uVar11); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar11; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar13 >> 0x12) - (int)local_188) - (uint)(piVar16 < local_174)) + (uint)bVar20; npc = warBomb; } game = g_game; *(undefined4 *)&local_18c[1].field_0x44 = 1; Game::BombDamage(game,&scratchVec,30.0,45.0,0,(Entity *)npc->_spawnerEntity, g_tearFlagsNone,4,0); } local_160 = (float)((int)local_160 + 8); } while ((uint)local_160 < 0x20); if (isAnyInsideRoom == '\0') { (**(code **)(*(int *)npc + 0x28))(); } iVar18 = local_16c; } npc->_stateFrame = npc->_stateFrame + -1; iVar19 = npc->_stateFrame; iVar18 = iVar18 + -1; local_16c = iVar18; if (iVar18 == 0) { return; } } while( true ); } } else if ((subtype == 1) && (local_18c = (Entity *)0x0, 0 < iVar18)) { do { uVar11 = -iVar19 & 0x80000003; bVar20 = uVar11 == 0; if ((int)uVar11 < 0) { bVar20 = (uVar11 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar20) { fVar21 = (npc->_v1).x; iVar19 = 0; do { scratchVec.y = *(float *)((int)g_game->_room + 0x20) - 30.0; if (iVar19 == 0) { fVar21 = -fVar21; } scratchVec.x = fVar21 + (npc->_pos).x; pRVar4 = g_game->_room; if (*(int *)(*(int *)((int)pRVar4->_descriptor + 0x10) + 0x48) - 9U < 4) { Room::GetClampedPositionImpl(pRVar4,&local_118,&scratchVec,0.0,0.0,0.0,0.0); if ((local_118.x != scratchVec.x) || (local_118.y != scratchVec.y)) goto LAB_0044fbc1; bVar20 = true; } else if ((((scratchVec.x < (pRVar4->_topLeftPos).x + 0.0) || ((pRVar4->_bottomRightPos).x - 0.0 < scratchVec.x)) || (scratchVec.y < (pRVar4->_topLeftPos).y + 0.0)) || ((pRVar4->_bottomRightPos).y - 0.0 < scratchVec.y)) { LAB_0044fbc1: bVar20 = false; } else { bVar20 = true; } if (bVar20) { ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 0xe; projParams.BulletFlags._0_4_ = 0x2000; projParams.BulletFlags._4_4_ = 0; projParams.FallingAccelModifier = 0.5; local_158.x = 0.0; local_158.y = -20.0; Entity_NPC::FireProjectiles(npc,&scratchVec,&local_158,0,&projParams); uVar11 = Random(); pEVar12 = Game::SpawnEx(g_game,1000,1,&scratchVec,&g_vectorZero,(Entity *)0x0,0, uVar11,0); *(undefined4 *)&pEVar12[1].field_0x44 = 1; } fVar21 = (npc->_v1).x; } while ((fVar21 != 0.0) && (iVar19 = iVar19 + 1, iVar19 < 2)); iVar19 = npc->_stateFrame; (npc->_v1).x = fVar21 + 140.0; iVar18 = local_16c; } iVar19 = iVar19 + -1; npc->_stateFrame = iVar19; if (iVar19 < -0x10) { (**(code **)(*(int *)npc + 0x28))(); return; } local_18c = (Entity *)&local_18c->field_0x1; if (iVar18 <= (int)local_18c) { return; } } while( true ); } } else { if (npc->_child != (EntityPtr)0x0) { fVar21 = ((float)iVar19 - 0.0) / 15.0; if (fVar21 <= 0.0) { fVar21 = 0.0; } if (1.0 <= fVar21) { fVar21 = 1.0; } *(float *)((int)npc->_child + 0xfc) = 1.0 - fVar21; iVar19 = npc->_stateFrame; } iVar19 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar19; iVar18 = 0; if (0 < iVar19) { iVar18 = iVar19; } npc->_stateFrame = iVar18; pvVar15 = (npc->_sprite)._animState._animData; if (pvVar15 != (void *)0x0) { iVar18 = *(int *)((int)pvVar15 + 0x30) - iVar18; iVar19 = 0; if (0 < iVar18) { iVar19 = iVar18; } AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)iVar19); iVar18 = npc->_stateFrame; } if (iVar18 < 0x14) { fVar21 = ((float)iVar18 - 0.0) / 20.0; if (fVar21 <= 0.0) { fVar21 = 0.0; } if (1.0 <= fVar21) { fVar21 = 1.0; } npc->_friction = (fVar21 * 0.39999998 + 0.5) * npc->_friction; return; } } } } return; } //@@ 00450880 FUN_00450880 void FUN_00450880(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x410) = param_1; return; } //@@ 004508a0 FUN_004508a0 void FUN_004508a0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x420) = param_1; return; } //@@ 004508c0 ItemPool::pick_collectible /* ZHL [exact] __thiscall PoolItem* ItemPool::pick_collectible(float targetWeight, ItemPool_Item* pool, uint32_t flags); */ void __thiscall ItemPool::pick_collectible(undefined4 param_1,int param_2) { int iVar1; uint uVar2; uint uVar3; Entity *projectile; Game *game; int shotsLeft; float fVar4; float dirX; float rngFraction; Vector local_18; Vector local_10; float originX; float originY; originX = *(float *)(param_2 + 0x33c); shotsLeft = 2; originY = *(float *)(param_2 + 0x340); do { uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; dirX = cos(fVar4); fVar4 = sin(fVar4); uVar2 = Random(); uVar3 = Random(); rngFraction = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; local_18.y = rngFraction * fVar4 * 4.0; local_18.x = rngFraction * dirX * 4.0; uVar3 = Random(); game = g_game; rngFraction = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; local_10.x = dirX * 15.0 * rngFraction + originX; local_10.y = fVar4 * 15.0 * rngFraction + originY; if (g_game->_challenge == 0x2c) { uVar3 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); uVar3 = RoomConfig::GetStageID(game->_stage,uVar3,-1); game = g_game; LAB_00450a46: } else { if (g_game->_currentDimensionIdx != 2) { uVar3 = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); goto LAB_00450a46; } uVar3 = 0x23; } projectile = Game::SpawnEx(game,9,(uVar3 != 0x1c) + 3,&local_10,&local_18,(Entity *)0x0,0,uVar2, 0); projectile->_spawnerType = 0x385; uVar2 = Random(); projectile[1]._damageEvents._end = (void *)0x40000000; projectile[1]._pendingDamage = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 1.4; uVar2 = Random(); projectile[1]._damageEvents._begin = (void *)(-15.0 - (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)] ) * 2.3283064e-10 * 60.0); uVar2 = Random(); iVar1 = *(int *)projectile; *(float *)&projectile[1].field_0x4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * -15.0; (**(code **)(iVar1 + 0xc))(); shotsLeft = shotsLeft + -1; } while (shotsLeft != 0); shotsLeft = 2; do { uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; dirX = cos(fVar4); fVar4 = sin(fVar4); uVar2 = Random(); uVar3 = Random(); rngFraction = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; local_10.y = rngFraction * fVar4 * 2.5; local_10.x = rngFraction * dirX * 2.5; uVar3 = Random(); game = g_game; rngFraction = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; local_18.x = dirX * 15.0 * rngFraction + originX; local_18.y = fVar4 * 15.0 * rngFraction + originY; if (g_game->_challenge == 0x2c) { uVar3 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); uVar3 = RoomConfig::GetStageID(game->_stage,uVar3,-1); game = g_game; LAB_00450c97: } else { if (g_game->_currentDimensionIdx != 2) { uVar3 = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); goto LAB_00450c97; } uVar3 = 0x23; } projectile = Game::SpawnEx(game,9,(uVar3 != 0x1c) + 3,&local_18,&local_10,(Entity *)0x0,0,uVar2, 0); projectile->_spawnerType = 0x385; uVar2 = Random(); projectile[1]._damageEvents._end = (void *)0x40000000; projectile[1]._pendingDamage = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 1.4; uVar2 = Random(); projectile[1]._damageEvents._begin = (void *)(-15.0 - (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)] ) * 2.3283064e-10 * 60.0); uVar2 = Random(); iVar1 = *(int *)projectile; *(float *)&projectile[1].field_0x4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * -1000.0; (**(code **)(iVar1 + 0xc))(); shotsLeft = shotsLeft + -1; if (shotsLeft == 0) { return; } } while( true ); } //@@ 00450da0 NpcAI::ENTITY_LIL_BLUB /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 901 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_LIL_BLUB(Entity_NPC *npc) { byte bVar1; Vector *pVVar2; byte *pbVar3; Entity_NPC *pEVar4; float *pfVar5; byte *pbVar6; Vector *clampedPos; uint uVar7; Entity *pEVar8; Entity_Effect *timer; byte unused; byte unused_00; byte unused_01; ColorMod *creepColor; byte *pbVar9; void *curRoom; float fVar10; int iVar11; Game *game; bool bVar12; float driftDirY; float fVar13; float fVar14; EntityPtr *pEVar15; float driftDirX; EntityRef damageSource; Vector projPos; Vector projVel; undefined1 local_114 [12]; undefined1 *local_108; float leechPush; float local_100; Room *room; Vector local_f8; float local_ec; Vector local_e8; EntityPtr *local_e0; char isLowHealth; Entity *local_d8; Entity *local_d4; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Entity *leech; AnimationState *animState; Manager *manager; code *takeDamageFn; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af2420; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; ExceptionList = &local_1c; fVar10 = 0.0; leechPush = (float)&DAT_bf800000; local_ec = 0.0; local_d4 = (Entity *)0x0; room = g_game->_room; local_d8 = (Entity *)0x0; iVar11 = (room->_entityList)._updateEL._size; pEVar4 = npc; if (iVar11 != 0) { pEVar4 = (room->_entityList)._updateEL._data; do { leech = *(Entity **)pEVar4; if ((leech->_type == 0x32a) && (leech->_spawnerType == 0x385)) { fVar10 = (float)((int)fVar10 + 1); if (leech->_parent == (EntityPtr)npc) { local_d8 = (Entity *)&local_d8->field_0x1; } local_ec = fVar10; if ((leech->_parent == (EntityPtr)0x0) && (leech->_subtype == 1)) { local_d4 = (Entity *)(((std_string *)&local_d4->field_0x0)->_buf + 1); } } pEVar4 = (Entity_NPC *)((int)pEVar4 + 4); iVar11 = iVar11 + -1; } while (iVar11 != 0); } isLowHealth = npc->_health / npc->_maxHitPoints < 0.3; pfVar5 = (&projParams)[1].Color._tint + 2; switch(npc->_state) { case 0: npc->_state = 3; npc->_entityGridCollisionClass = 3; (npc->_targetPosition).x = g_vectorZero.x; game = g_game; (npc->_targetPosition).y = g_vectorZero.y; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); uVar7 = Game::GetStageID(game,(byte)pEVar4); pfVar5 = (float *)&DAT_00c33c18; if (uVar7 != 0x1c) { pfVar5 = (float *)&DAT_00c33924; } if (&npc->_splatColor != (ColorMod *)pfVar5) { fVar10 = pfVar5[1]; fVar14 = pfVar5[2]; fVar13 = pfVar5[3]; (npc->_splatColor)._tint[0] = *pfVar5; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar14; (npc->_splatColor)._tint[3] = fVar13; fVar10 = pfVar5[5]; fVar14 = pfVar5[6]; fVar13 = pfVar5[7]; (npc->_splatColor)._colorize[0] = pfVar5[4]; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar14; (npc->_splatColor)._colorize[3] = fVar13; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(pfVar5 + 8); (npc->_splatColor)._offset[2] = pfVar5[10]; } npc->_projectileDelay = 0; goto LAB_004524d5; default: goto switchD_00450eaa_caseD_1; case 3: pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_00450f8e: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar9 = s_Idle; do { bVar1 = *pbVar6; bVar12 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00450f70: uVar7 = -(uint)bVar12 | 1; goto LAB_00450f75; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar12 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00450f70; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_00450f75: if ((uVar7 != 0) || ((puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), pbVar3[0x34] != 0 && (puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00450f8e; } npc->_projectileDelay = 0; uVar7 = Random(); if ((uVar7 % 0x28 == 0) && ((int)local_ec < 6)) { npc->_state = 8; pfVar5 = (float *)puStack_20; } else { uVar7 = Random(); if (((uVar7 % 0x46 == 0) || ((isLowHealth != '\0' && (uVar7 = Random(), uVar7 % 0x28 == 0)))) && ((int)local_d4 < 1)) { npc->_state = 9; pfVar5 = (float *)puStack_20; } else { uVar7 = Random(); pEVar8 = local_d8; if ((uVar7 % 0x2d == 0) && (2 < (int)local_d8)) { npc->_state = 10; pfVar5 = (float *)puStack_20; } else { uVar7 = Random(); pfVar5 = (float *)puStack_20; if (isLowHealth == '\0') { if ((uVar7 % 0x6e != 0) || ((int)pEVar8 < 3)) goto switchD_00450eaa_caseD_1; } else if (uVar7 % 10 != 0) goto switchD_00450eaa_caseD_1; npc->_state = 0xb; npc->_projectileDelay = 1; if (isLowHealth != '\0') { uVar7 = Random(); npc->_projectileDelay = npc->_projectileDelay + uVar7 % 3 + 2; pfVar5 = (float *)puStack_20; } } } } goto switchD_00450eaa_caseD_1; case 8: pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_00451114: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar9 = &DAT_00b1d53c; do { bVar1 = *pbVar6; bVar12 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_004510f6: uVar7 = -(uint)bVar12 | 1; goto LAB_004510fb; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar12 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_004510f6; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_004510fb: if ((uVar7 != 0) || ((puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), pbVar3[0x34] != 0 && (puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00451114; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 == 0) goto LAB_00451540; uVar7 = Random(); local_d4 = (Entity *)(uVar7 % 3 + 1); if (local_d4 != (Entity *)0x0) { do { local_e0 = (EntityPtr *)(npc->_pos).x; local_ec = (npc->_pos).y; uVar7 = Random(); fVar10 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d8 = (Entity *)(fVar10 + fVar10); fVar10 = cos((float)local_d8); local_e8.x = fVar10 * 30.0 + (float)local_e0 + 0.0; fVar10 = sin((float)local_d8); local_e8.y = fVar10 * 30.0 + local_ec + 30.0; pVVar2 = Room::GetClampedPositionImpl(room,&local_f8,&local_e8,5.0,5.0,5.0,5.0); local_e8.x = pVVar2->x; local_e8.y = pVVar2->y; pEVar4 = Entity_NPC::ThrowLeech(&npc->_pos,(Entity *)npc,-30.0,&local_e8,0); pEVar15 = &pEVar4->_parent; fVar10 = pEVar4->_maxHitPoints + pEVar4->_maxHitPoints; pEVar4->_spawnerType = npc->_type; pEVar4->_spawnerVariant = npc->_variant; pEVar4->_maxHitPoints = fVar10; pEVar4->_health = fVar10; if (*pEVar15 != (EntityPtr)0x0) { local_e0 = pEVar15; std::multiset::erase(&local_e0); } *pEVar15 = (EntityPtr)npc; std::multiset::insert(pEVar15); local_d4 = (Entity *)((int)local_d4 + -1); } while (local_d4 != (Entity *)0x0); } uVar7 = Random(); local_e8.x = (npc->_velocity).x + 0.0; local_e8.y = (npc->_velocity).y + 5.0; pEVar8 = Game::Spawn(g_game,1000,2,&npc->_pos,&local_e8,(Entity *)0x0,1,uVar7); local_d4 = pEVar8; uVar7 = Random(); local_e0 = (EntityPtr *)&pEVar8->_sprite; (pEVar8->_sprite)._rotation = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0; pbVar3 = (pEVar8->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_004513f1: bVar1 = ANM2::SetAnimation(&pEVar8->_sprite,&DAT_00b1d534,1); pEVar15 = local_e0; if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(local_e0 + 0xc)); *(byte *)(pEVar15 + 0x11) = 1; pEVar8 = local_d4; } } else { if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar6 = &DAT_00b1d534; do { bVar1 = *pbVar3; bVar12 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_004513d1: uVar7 = -(uint)bVar12 | 1; goto LAB_004513d6; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar12 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_004513d1; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_004513d6: if ((uVar7 != 0) || ((*(char *)((int)(pEVar8->_sprite)._animState._animData + 0x34) != '\0' && ((pEVar8->_sprite)._animState._isPlaying == 0)))) goto LAB_004513f1; } (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -40.0; pEVar8->_renderZOffset = 500; game = g_game; if (g_game->_challenge == 0x2c) { uVar7 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); LAB_0045146a: uVar7 = RoomConfig::GetStageID(game->_stage,uVar7,-1); } else { if (g_game->_currentDimensionIdx != 2) { uVar7 = g_game->_stageType; goto LAB_0045146a; } uVar7 = 0x23; } pfVar5 = (float *)&DAT_00c33c18; if (uVar7 != 0x1c) { pfVar5 = (float *)&DAT_00c33924; } creepColor = &(local_d4->_sprite)._color; if (creepColor != (ColorMod *)pfVar5) { fVar10 = pfVar5[1]; fVar14 = pfVar5[2]; fVar13 = pfVar5[3]; creepColor->_tint[0] = *pfVar5; (local_d4->_sprite)._color._tint[1] = fVar10; (local_d4->_sprite)._color._tint[2] = fVar14; (local_d4->_sprite)._color._tint[3] = fVar13; fVar10 = pfVar5[5]; fVar14 = pfVar5[6]; fVar13 = pfVar5[7]; (local_d4->_sprite)._color._colorize[0] = pfVar5[4]; (local_d4->_sprite)._color._colorize[1] = fVar10; (local_d4->_sprite)._color._colorize[2] = fVar14; (local_d4->_sprite)._color._colorize[3] = fVar13; *(undefined8 *)(local_d4->_sprite)._color._offset = *(undefined8 *)(pfVar5 + 8); (local_d4->_sprite)._color._offset[2] = pfVar5[10]; } manager = g_manager; local_d4 = (Entity *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_d4 = (Entity *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_d4 = (Entity *)0x3f000000; } local_d8 = (Entity *)0x6c; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,(float)local_d4,0.0); LAB_00451540: if (((npc->_sprite)._animState._animData != (void *)0x0) && (pfVar5 = (float *)puStack_20, (npc->_sprite)._animState._isPlaying != 0)) goto switchD_00450eaa_caseD_1; } break; case 9: pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_004515b6: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d554,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar9 = &DAT_00b1d554; do { bVar1 = *pbVar6; bVar12 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00451598: uVar7 = -(uint)bVar12 | 1; goto LAB_0045159d; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar12 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00451598; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_0045159d: if ((uVar7 != 0) || ((puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), pbVar3[0x34] != 0 && (puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004515b6; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); pVVar2 = &npc->_pos; local_d8 = (Entity *)((pEVar8->_pos).y - (npc->_pos).y); local_d4 = (Entity *)((pEVar8->_pos).x - pVVar2->x); fVar10 = sqrtf((float)local_d8 * (float)local_d8 + (float)local_d4 * (float)local_d4); if (fVar10 <= 90.0) { local_e8.y = (float)local_d8; pEVar8 = local_d4; } else if (fVar10 <= 0.0) { local_e8.y = (float)((float)local_d8 * 90.0); pEVar8 = (Entity *)((float)local_d4 * 90.0); } else { local_e8.y = (float)((1.0 / fVar10) * (float)local_d8 * 90.0); pEVar8 = (Entity *)((1.0 / fVar10) * (float)local_d4 * 90.0); } local_e8.x = (float)pEVar8 + pVVar2->x; local_e8.y = local_e8.y + (npc->_pos).y; Room::GetClampedPositionImpl(room,&local_f8,&local_e8,5.0,5.0,5.0,5.0); pEVar4 = Entity_NPC::ThrowLeech(pVVar2,(Entity *)npc,-30.0,&local_f8,1); pEVar4->_spawnerType = npc->_type; pEVar4->_spawnerVariant = npc->_variant; uVar7 = Random(); local_e8.x = (npc->_velocity).x + 0.0; local_e8.y = (npc->_velocity).y + 5.0; pEVar8 = Game::Spawn(g_game,1000,2,pVVar2,&local_e8,(Entity *)0x0,1,uVar7); uVar7 = Random(); (pEVar8->_sprite)._rotation = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0; ANM2::Play(&pEVar8->_sprite,&DAT_00b1d534,0); game = g_game; (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -40.0; pEVar8->_renderZOffset = 500; uVar7 = Game::GetStageID(game,unused); pfVar5 = (float *)&DAT_00c33c18; if (uVar7 != 0x1c) { pfVar5 = (float *)&DAT_00c33924; } creepColor = &(pEVar8->_sprite)._color; if (creepColor != (ColorMod *)pfVar5) { fVar10 = pfVar5[1]; fVar14 = pfVar5[2]; fVar13 = pfVar5[3]; creepColor->_tint[0] = *pfVar5; (pEVar8->_sprite)._color._tint[1] = fVar10; (pEVar8->_sprite)._color._tint[2] = fVar14; (pEVar8->_sprite)._color._tint[3] = fVar13; fVar10 = pfVar5[5]; fVar14 = pfVar5[6]; fVar13 = pfVar5[7]; (pEVar8->_sprite)._color._colorize[0] = pfVar5[4]; (pEVar8->_sprite)._color._colorize[1] = fVar10; (pEVar8->_sprite)._color._colorize[2] = fVar14; (pEVar8->_sprite)._color._colorize[3] = fVar13; *(undefined8 *)(pEVar8->_sprite)._color._offset = *(undefined8 *)(pfVar5 + 8); (pEVar8->_sprite)._color._offset[2] = pfVar5[10]; } Entity_NPC::PlaySound(npc,0x6a,1.0,2,0,1.0); } goto LAB_00451540; } break; case 10: pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_00451896: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d548,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar9 = &DAT_00b1d548; do { bVar1 = *pbVar6; bVar12 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00451878: uVar7 = -(uint)bVar12 | 1; goto LAB_0045187d; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar12 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00451878; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_0045187d: if ((uVar7 != 0) || ((puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), pbVar3[0x34] != 0 && (puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00451896; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); leechPush = 8.0; uVar7 = Random(); (npc->_v1).x = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::WasEventTriggered(animState,(byte *)"Shoot"); if (bVar1 != 0) { uVar7 = npc->_projectileDelay; if (((uVar7 & 1) == 0) && ((int)uVar7 < 0xc)) { local_e0 = (EntityPtr *)0x0; do { local_d4 = (Entity *)(((float)(int)local_e0 * 60.0 + (npc->_v1).x) * 0.017453292); local_d8 = (Entity *)cos((float)local_d4); local_100 = sin((float)local_d4); uVar7 = Random(); local_d4 = (Entity *) (((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 12.0 - 6.0) * 0.017453292); local_ec = cos((float)local_d4); fVar10 = sin((float)local_d4); local_d4 = (Entity *)(local_ec * (float)local_d8 - fVar10 * local_100); local_ec = local_ec * local_100 + fVar10 * (float)local_d8; uVar7 = Random(); local_100 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)] ) * 2.3283064e-10; ProjectileParams::ProjectileParams(&projParams); game = g_game; if (g_game->_challenge == 0x2c) { uVar7 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); LAB_00451ad7: uVar7 = RoomConfig::GetStageID(game->_stage,uVar7,-1); } else { if (g_game->_currentDimensionIdx != 2) { uVar7 = g_game->_stageType; goto LAB_00451ad7; } uVar7 = 0x23; } projParams.HeightModifier = -10.0; projParams.Variant = (uVar7 != 0x1c) + 3; projParams.FallingAccelModifier = local_100 * 0.049999997 - 0.08; projParams.Scale = local_100 * 0.6 + 0.9; projVel.y = local_100 * 0.19999999 + 0.8; projVel.x = (float)local_d4 * 10.0 * projVel.y; projVel.y = local_ec * 10.0 * projVel.y; local_100 = (npc->_pos).x; local_e8.y = (npc->_pos).y; uVar7 = Random(); fVar10 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d8 = (Entity *)(fVar10 + fVar10); fVar10 = cos((float)local_d8); projPos.x = fVar10 * 3.0 + (float)local_d4 * 30.0 + local_100; fVar10 = sin((float)local_d8); projPos.y = fVar10 * 3.0 + local_ec * 30.0 + local_e8.y; Entity_NPC::FireProjectiles(npc,&projPos,&projVel,0,&projParams); uVar7 = npc->_projectileDelay & 0x80000003; bVar12 = uVar7 == 0; if ((int)uVar7 < 0) { bVar12 = (uVar7 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar12) { uVar7 = Random(); local_114._8_4_ = (float)local_d4 * 7.0; local_f8.x = (float)local_d4 * 40.0 + (npc->_pos).x; local_108 = (undefined1 *)(local_ec * 7.0); local_f8.y = local_ec * 40.0 + (npc->_pos).y; pEVar8 = Game::Spawn(g_game,1000,2,&local_f8,(Vector *)(local_114 + 8),(Entity *)0x0 ,1,uVar7); local_d8 = pEVar8; uVar7 = Random(); (pEVar8->_sprite)._rotation = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0; local_d4 = (Entity *)&pEVar8->_sprite; pbVar3 = (pEVar8->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_00451db1: bVar1 = ANM2::SetAnimation((ANM2 *)local_d4,&DAT_00b1d534,1); if (bVar1 != 0) { AnimationState::Rewind(&(pEVar8->_sprite)._animState); (pEVar8->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar9 = &DAT_00b1d534; do { bVar1 = *pbVar6; bVar12 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00451d90: uVar7 = -(uint)bVar12 | 1; goto LAB_00451d95; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar12 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00451d90; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_00451d95: if ((uVar7 != 0) || ((pbVar3[0x34] != 0 && ((pEVar8->_sprite)._animState._isPlaying == 0)))) goto LAB_00451db1; } game = g_game; (local_d8->_posOffset).x = 0.0; (local_d8->_posOffset).y = -28.0; local_d8->_renderZOffset = 500; if (game->_challenge == 0x2c) { uVar7 = Level::GetRoomStageType((Level *)game,game->_currentRoomIdx); LAB_00451e31: uVar7 = RoomConfig::GetStageID(game->_stage,uVar7,-1); } else { if (g_game->_currentDimensionIdx != 2) { uVar7 = g_game->_stageType; game = g_game; goto LAB_00451e31; } uVar7 = 0x23; } pfVar5 = (float *)&DAT_00c33c18; if (uVar7 != 0x1c) { pfVar5 = (float *)&DAT_00c33924; } creepColor = &(local_d8->_sprite)._color; if (creepColor != (ColorMod *)pfVar5) { fVar10 = pfVar5[1]; fVar14 = pfVar5[2]; fVar13 = pfVar5[3]; creepColor->_tint[0] = *pfVar5; (local_d8->_sprite)._color._tint[1] = fVar10; (local_d8->_sprite)._color._tint[2] = fVar14; (local_d8->_sprite)._color._tint[3] = fVar13; fVar10 = pfVar5[5]; fVar14 = pfVar5[6]; fVar13 = pfVar5[7]; (local_d8->_sprite)._color._colorize[0] = pfVar5[4]; (local_d8->_sprite)._color._colorize[1] = fVar10; (local_d8->_sprite)._color._colorize[2] = fVar14; (local_d8->_sprite)._color._colorize[3] = fVar13; *(undefined8 *)(local_d8->_sprite)._color._offset = *(undefined8 *)(pfVar5 + 8); (local_d8->_sprite)._color._offset[2] = pfVar5[10]; } } local_e0 = (EntityPtr *)&local_e0->field_0x1; } while ((int)local_e0 < 6); uVar7 = npc->_projectileDelay; } npc->_projectileDelay = uVar7 + 1; } goto LAB_00451540; } } break; case 0xb: pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_00451efe: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d568,1); pfVar5 = (float *)puStack_20; if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pfVar5 = (float *)puStack_20; } } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar9 = &DAT_00b1d568; do { bVar1 = *pbVar6; bVar12 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00451ee0: uVar7 = -(uint)bVar12 | 1; goto LAB_00451ee5; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar12 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00451ee0; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_00451ee5: if ((uVar7 != 0) || ((pfVar5 = (&projParams)[1].Color._tint + 2, pbVar3[0x34] != 0 && (pfVar5 = (&projParams)[1].Color._tint + 2, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00451efe; } puStack_20 = (undefined1 *)pfVar5; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Jump); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1da,1.0,2,0,1.0); uVar7 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_e8.y = (pEVar8->_velocity).x * 0.04; fVar10 = (npc->_pos).y - (pEVar8->_pos).y; local_100 = (pEVar8->_velocity).y * 0.04; fVar14 = (npc->_pos).x - (pEVar8->_pos).x; fVar10 = sqrtf(fVar10 * fVar10 + fVar14 * fVar14); local_f8.x = (pEVar8->_pos).x + local_e8.y * fVar10; local_f8.y = (pEVar8->_pos).y + local_100 * fVar10; Room::GetClampedPositionImpl(room,(Vector *)(local_114 + 8),&local_f8,20.0,0.0,0.0,0.0); pVVar2 = &npc->_pos; local_d4 = (Entity *)((float)local_108 - (npc->_pos).y); local_e0 = (EntityPtr *)((float)local_114._8_4_ - pVVar2->x); fVar10 = sqrtf((float)local_d4 * (float)local_d4 + (float)local_e0 * (float)local_e0); if (isLowHealth == '\0') { fVar14 = 240.0; } else { fVar14 = 160.0; } pEVar15 = local_e0; pEVar8 = local_d4; if ((fVar14 < fVar10) && (0.0 < fVar10)) { pEVar8 = (Entity *)((fVar14 / fVar10) * (float)local_d4); pEVar15 = (EntityPtr *)((fVar14 / fVar10) * (float)local_e0); } fVar13 = (float)pEVar15 + pVVar2->x; fVar14 = (float)pEVar8 + (npc->_pos).y; leechPush = 1.0; (npc->_targetPosition).x = fVar13; (npc->_targetPosition).y = fVar14; fVar10 = (npc->_pos).y; (npc->_v2).x = (fVar13 - pVVar2->x) * 0.0625; (npc->_v2).y = (fVar14 - fVar10) * 0.0625; npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land), bVar1 != 0)) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); uVar7 = Random(); pVVar2 = &npc->_pos; pEVar8 = Game::Spawn(g_game,1000,0x84,pVVar2,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)pEVar8 + 0xc))(); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_entityCollisionClass = 4; if (isLowHealth == '\0') { npc->_stateFrame = 8; } else { ProjectileParams::ProjectileParams(&projParams); uVar7 = Game::GetStageID(g_game,unused_00); local_f8.x = 10.0; local_f8.y = 0.0; projParams.Variant = (uVar7 != 0x1c) + 3; Entity_NPC::FireProjectiles(npc,pVVar2,&local_f8,6,&projParams); local_f8.x = 4.0; local_f8.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar2,&local_f8,7,&projParams); } EntityList::QueryRadius(&room->_entityList,(EntityList_EL *)local_114,pVVar2,60.0,8); local_14 = 0.0; local_e0 = (EntityPtr *)0x0; if (local_108 != (undefined1 *)0x0) { do { pEVar8 = *(Entity **)(local_114._4_4_ + (int)local_e0 * 4); local_e8.y = (float)pEVar8; bVar1 = Entity::IsVulnerableEnemy(pEVar8,(Entity *)0x0); if (bVar1 != 0) { takeDamageFn = *(code **)(*(int *)pEVar8 + 0x20); EntityRef::constructor(&damageSource,(Entity *)npc); (*takeDamageFn)(0x420c0000,4,0,&damageSource,0x1e); } local_e0 = (EntityPtr *)&local_e0->field_0x1; } while (local_e0 < local_108); } Game::ShakeScreen(g_game,8); npc->_projectileDelay = npc->_projectileDelay + -1; local_14 = -NAN; if (local_114[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_114._4_4_,0); local_14 = -NAN; } } } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) { npc->_friction = npc->_friction * 0.2; } else { fVar14 = npc->_friction * 0.9; npc->_friction = fVar14; fVar10 = (npc->_v2).y; (npc->_velocity).x = (npc->_v2).x / fVar14; (npc->_velocity).y = fVar10 / fVar14; } if (0 < npc->_stateFrame) { npc->_stateFrame = npc->_stateFrame + -1; ProjectileParams::ProjectileParams(&projParams); uVar7 = Game::GetStageID(g_game,unused_01); projParams.Variant = (uVar7 != 0x1c) + 3; uVar7 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar7 & 1) + 1,&g_vectorZero,0.0,&projParams); } if (npc->_projectileDelay < 1) { LAB_004524bc: if (((npc->_sprite)._animState._animData != (void *)0x0) && (pfVar5 = (float *)puStack_20, (npc->_sprite)._animState._isPlaying != 0)) goto switchD_00450eaa_caseD_1; } else if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004524cb; AnimationState::SetFrameFloat(&(npc->_sprite)._animState,19.0); } goto LAB_004524bc; } LAB_004524cb: npc->_state = 3; LAB_004524d5: npc->_stateFrame = 0; pfVar5 = (float *)puStack_20; goto switchD_00450eaa_caseD_1; } npc->_state = 3; pfVar5 = (float *)puStack_20; switchD_00450eaa_caseD_1: puStack_20 = (undefined1 *)pfVar5; pVVar2 = &npc->_pos; clampedPos = Room::GetClampedPositionImpl(g_game->_room,&local_f8,pVVar2,40.0,0.0,0.0,0.0); game = g_game; fVar10 = clampedPos->x; pVVar2->x = fVar10; (npc->_pos).y = clampedPos->y; curRoom = game->_room; if (fVar10 == *(float *)((int)curRoom + 0x1c)) { (npc->_velocity).x = (float)&DAT_bf800000; curRoom = game->_room; } if (fVar10 == *(float *)((int)curRoom + 0x14)) { (npc->_velocity).x = 1.0; curRoom = game->_room; } fVar10 = (npc->_pos).y; if (fVar10 == *(float *)((int)curRoom + 0x20)) { (npc->_velocity).y = (float)&DAT_bf800000; curRoom = game->_room; } if (fVar10 == *(float *)((int)curRoom + 0x18) + 40.0) { (npc->_velocity).y = 1.0; } local_f8.y = *(float *)((int)&npc->_flags + 4); if (((npc->_flags & 0x200) == 0) || ((npc->_flags & 0x100) != 0)) { if ((npc->_velocity).y < 0.1) { driftDirY = (float)&DAT_bf800000; } else { driftDirY = 1.0; } fVar10 = (npc->_velocity).x; driftDirX = (float)&DAT_bf800000; if (0.0 < fVar10) { driftDirX = 1.0; } fVar14 = npc->_friction * 0.8; npc->_friction = fVar14; if (fVar14 != 0.0) { fVar13 = npc->_speedMultiplier; (npc->_velocity).x = (driftDirX * 0.5 * fVar13) / fVar14 + fVar10; (npc->_velocity).y = (driftDirY * 0.5 * fVar13) / fVar14 + (npc->_velocity).y; } if ((npc->_variant == 0) && (npc->_subtype == 2)) { npc->_friction = fVar14 * 0.9; } if ((npc->_flags & 0x1000800) != 0) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_d4 = (Entity *)-((pEVar8->_pos).y - (npc->_pos).y); local_e0 = (EntityPtr *)-((pEVar8->_pos).x - pVVar2->x); fVar10 = sqrtf((float)local_d4 * (float)local_d4 + (float)local_e0 * (float)local_e0); if (fVar10 <= 0.0) { pEVar15 = local_e0; pEVar8 = local_d4; } else { fVar14 = (180.0 - fVar10) * 0.02; if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } pEVar15 = (EntityPtr *)((fVar14 / fVar10) * (float)local_e0); pEVar8 = (Entity *)((fVar14 / fVar10) * (float)local_d4); } fVar10 = npc->_friction; if (fVar10 != 0.0) { fVar14 = npc->_speedMultiplier; (npc->_velocity).x = ((float)pEVar15 * fVar14) / fVar10 + (npc->_velocity).x; (npc->_velocity).y = ((float)pEVar8 * fVar14) / fVar10 + (npc->_velocity).y; } } } else { fVar10 = npc->_friction * 0.8; npc->_friction = fVar10; if ((npc->_variant == 0) && (npc->_subtype == 2)) { npc->_friction = fVar10 * 0.9; } PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } if (npc->_dead == 0) { if (leechPush <= 0.0) { ExceptionList = local_1c; return; } } else { uVar7 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x84,pVVar2,&g_vectorZero,(Entity *)0x0,0,uVar7); fVar10 = g_vectorOne.y * 1.5; iVar11 = *(int *)pEVar8; (pEVar8->_sprite)._scale.x = g_vectorOne.x * 1.5; (pEVar8->_sprite)._scale.y = fVar10; (**(code **)(iVar11 + 0xc))(); leechPush = 4.0; timer = Entity_Effect::CreateTimer(ItemPool::pick_collectible,1,0xf,0); iVar11 = *(int *)timer; (timer->_pos).x = pVVar2->x; (timer->_pos).y = (npc->_pos).y; (**(code **)(iVar11 + 0xc))(); uVar7 = Random(); for (local_d8 = (Entity *)(uVar7 % 3 + 2); local_d8 != (Entity *)0x0; local_d8 = (Entity *)((int)&local_d8[-1]._luaBridgeRef + 3)) { uVar7 = Random(); fVar10 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_e0 = (EntityPtr *)(fVar10 + fVar10); uVar7 = Random(); local_d4 = (Entity *) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10); fVar10 = cos((float)local_e0); local_e8.x = fVar10 * (float)local_d4 * 60.0 + pVVar2->x; fVar10 = sin((float)local_e0); local_e8.y = fVar10 * (float)local_d4 * 60.0 + (npc->_pos).y; clampedPos = Room::GetClampedPositionImpl(room,&local_f8,&local_e8,5.0,5.0,5.0,5.0); local_e8.x = clampedPos->x; local_e8.y = clampedPos->y; Entity_NPC::ThrowLeech(pVVar2,(Entity *)npc,-30.0,&local_e8,0); } } local_d8 = (Entity *)0x0; if ((room->_entityList)._updateEL._size != 0) { do { iVar11 = *(int *)((int)(room->_entityList)._updateEL._data + (int)local_d8 * 4); if (*(int *)(iVar11 + 0x28) == 0x32a) { if (*(Entity_NPC **)(iVar11 + 0x3bc) == npc) { if (*(Entity_NPC **)(iVar11 + 0x3bc) != (Entity_NPC *)0x0) { local_e8.y = (float)(iVar11 + 0x3bc); std::multiset::erase(&local_e8.y); } *(undefined4 *)(iVar11 + 0x3bc) = 0; local_e0 = (EntityPtr *)(*(float *)(iVar11 + 0x33c) - (npc->_pos).x); local_d4 = (Entity *)(*(float *)(iVar11 + 0x340) - (npc->_pos).y); fVar10 = sqrtf((float)local_e0 * (float)local_e0 + (float)local_d4 * (float)local_d4); pEVar15 = local_e0; pEVar8 = local_d4; if (0.0 < fVar10) { pEVar15 = (EntityPtr *)((float)local_e0 * (1.0 / fVar10)); pEVar8 = (Entity *)((float)local_d4 * (1.0 / fVar10)); } fVar10 = *(float *)(iVar11 + 0x36c); if (fVar10 != 0.0) { *(float *)(iVar11 + 0x360) = ((float)pEVar15 * leechPush * *(float *)(iVar11 + 0x39c)) / fVar10 + *(float *)(iVar11 + 0x360); *(float *)(iVar11 + 0x364) = ((float)pEVar8 * leechPush * *(float *)(iVar11 + 0x39c)) / fVar10 + *(float *)(iVar11 + 0x364); } fVar10 = *(float *)(iVar11 + 900) * 0.5; *(undefined4 *)(iVar11 + 0xbb0) = 0; if (*(float *)(iVar11 + 0x380) <= fVar10) { fVar10 = *(float *)(iVar11 + 0x380); } *(float *)(iVar11 + 0x380) = fVar10; } } local_d8 = (Entity *)&local_d8->field_0x1; } while (local_d8 < (undefined1 *)(room->_entityList)._updateEL._size); } ExceptionList = local_1c; return; } //@@ 00452be0 _ptr_deref_or_minus1 /* DB: ? ? returns *ptr or -1 */ undefined4 _ptr_deref_or_minus1(void) { int *in_ECX; if ((undefined4 *)*in_ECX == (undefined4 *)0x0) { return 0xffffffff; } return *(undefined4 *)*in_ECX; } //@@ 00452bf0 ANM2::GetAnimation /* DB: returns std::string copy of current anim name; compared to "SmallHoleOpen" prototype: db/protos.zhl, confirmed by RET 4 */ std_string * __thiscall ANM2::GetAnimation(ANM2 *this,std_string *outName) { void *other; other = *(void **)((this->_filename)._buf + 4); if (other == (void *)0x0) { outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; outName->_size = 0; outName->_buf[0] = '\0'; return outName; } std::string::string(outName->_buf,other); return outName; } //@@ 00452c40 Entity_Bomb::SetExplosionCountdown /* ZHL [lua] Lua binding EntityBomb:SetExplosionCountdown */ void Entity_Bomb::SetExplosionCountdown(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x410) = param_1; *(undefined4 *)(in_ECX + 0x414) = param_1; return; } //@@ 00452c60 FUN_00452c60 void FUN_00452c60(void) { int iVar1; byte bVar2; Entity_Player *in_ECX; int in_EDX; float fVar3; float fVar4; fVar3 = (in_ECX->_pos).x / *(float *)(in_EDX + 0x374) - *(float *)(in_EDX + 0x33c) / *(float *)(in_EDX + 0x374); fVar4 = (in_ECX->_pos).y / *(float *)(in_EDX + 0x378) - *(float *)(in_EDX + 0x340) / *(float *)(in_EDX + 0x378); if ((((fVar4 * fVar4 + fVar3 * fVar3 < *(float *)(in_EDX + 0x370) * *(float *)(in_EDX + 0x370)) && (iVar1 = in_ECX->_entityGridCollisionClass, iVar1 != 0)) && (iVar1 != 3)) && (((iVar1 != 1 && (iVar1 != 2)) && (in_ECX->_pitfallState == 0)))) { bVar2 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x271); if (bVar2 == 0) { Entity_Player::PlayExtraAnimation(in_ECX,(byte *)"FallIn"); in_ECX->_isControlsEnabled = 0; in_ECX->_entityCollisionClass = 0; in_ECX->_pitfallState = 1; in_ECX->_pitfallTimer = 0; } } return; } //@@ 00452d40 FUN_00452d40 int FUN_00452d40(void) { int iVar1; qword qVar2; uint uVar3; uint uVar4; qword *pqVar5; void *pvVar6; int iVar7; int iVar8; uint uVar9; float fVar10; float fVar11; EntityList_EL local_28; undefined4 *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af245d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar8 = 0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_28,4,-1,-1,0,0); local_8 = 0; uVar9 = 0; if (local_28._size != 0) { uVar4 = local_28._size; pvVar6 = local_28._data; iVar7 = local_14; do { iVar1 = *(int *)((int)pvVar6 + uVar9 * 4); fVar10 = *(float *)(iVar1 + 0x33c) / *(float *)(iVar7 + 0x374) - *(float *)(iVar7 + 0x33c) / *(float *)(iVar7 + 0x374); fVar11 = *(float *)(iVar1 + 0x340) / *(float *)(iVar7 + 0x378) - *(float *)(iVar7 + 0x340) / *(float *)(iVar7 + 0x378); if ((fVar11 * fVar11 + fVar10 * fVar10 < *(float *)(iVar7 + 0x370) * *(float *)(iVar7 + 0x370) ) && (*(int *)(iVar1 + 0x3fc) == 0)) { FUN_006a6940(uVar3); if (*(int *)(iVar1 + 0x3bc) != 0) { local_18 = (undefined4 *)(iVar1 + 0x3bc); std::multiset::erase(&local_18); } iVar8 = iVar8 + 1; *(undefined4 *)(iVar1 + 0x3bc) = 0; uVar4 = local_28._size; pvVar6 = local_28._data; iVar7 = local_14; } uVar9 = uVar9 + 1; } while (uVar9 < uVar4); } if (local_28._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } if (local_28._data != (void *)0x0) { uVar3 = *(uint *)((int)local_28._data + -4); qVar2 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar2 < uVar3); free((uint *)((int)local_28._data + -4)); } } ExceptionList = local_10; return iVar8; } //@@ 00452eb0 NpcAI::ENTITY_BIG_HORN_grab_bomb /* DB: ? ECX=npc (Big Horn) on the "Shoot" event: QuerySublist of bombs near npc pos+(0,30) within half its size that are airborne (height < -0.1) and unowned, increments +0xbc0, links the bomb to the npc (+0x3c0 child, bomb +0x3bc) and plays "BombDizzy" */ void __fastcall NpcAI::ENTITY_BIG_HORN_grab_bomb(Entity_NPC *npc) { EntityPtr EVar1; qword qVar2; Manager *pMVar3; uint uVar4; uint uVar5; qword *pqVar6; EntityPtr *pEVar7; float fVar8; float fVar9; float fVar10; EntityList_EL local_28; EntityPtr *local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af245d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_28,4,-1,-1,0,0); local_8 = 0; uVar5 = 0; if (local_28._size != 0) { pEVar7 = &npc->_child; fVar10 = npc->_size * 0.5; do { EVar1 = *(EntityPtr *)((int)local_28._data + uVar5 * 4); fVar8 = *(float *)((int)EVar1 + 0x33c) - ((npc->_pos).x + 0.0); fVar9 = *(float *)((int)EVar1 + 0x340) - ((npc->_pos).y + 30.0); if ((((fVar9 * fVar9 + fVar8 * fVar8 < fVar10 * fVar10) && (*(int *)((int)EVar1 + 0x3fc) == 0) ) && (*(float *)((int)EVar1 + 0x364) <= -0.1 && *(float *)((int)EVar1 + 0x364) != -0.1)) && (*pEVar7 == (EntityPtr)0x0)) { npc->_i1 = npc->_i1 + 1; FUN_006a6940(uVar4); if (*pEVar7 != (EntityPtr)0x0) { local_18 = pEVar7; std::multiset::erase(&local_18); } *pEVar7 = EVar1; std::multiset::insert(pEVar7); pEVar7 = (EntityPtr *)((int)EVar1 + 0x3bc); if (*(int *)((int)EVar1 + 0x3bc) != 0) { local_18 = pEVar7; std::multiset::erase(&local_18); } *pEVar7 = (EntityPtr)npc; std::multiset::insert(pEVar7); ANM2::Play(&npc->_sprite,(byte *)"BombDizzy",0); pMVar3 = g_manager; local_14 = 0.8; if (npc->_championColorIdx == 0x12) { local_14 = 1.3; } else if (npc->_championColorIdx == 0x13) { local_14 = 0.4; } local_18 = (EntityPtr *)0x9d; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&pMVar3->_sfxManager,(int)local_18,1.0,0,0,local_14,0.0); break; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_28._size); } if (local_28._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } if (local_28._data != (void *)0x0) { uVar4 = *(uint *)((int)local_28._data + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar4); free((uint *)((int)local_28._data + -4)); } } ExceptionList = local_10; return; } //@@ 004530e0 FUN_004530e0 void FUN_004530e0(void) { int iVar1; int iVar2; int in_ECX; bool bVar3; iVar2 = *(int *)(in_ECX + 0x3c0); while (iVar2 != 0) { *(undefined4 *)(iVar2 + 0x188) = 0; if (*(int *)(iVar2 + 0x3fc) == 2) { *(undefined4 *)(iVar2 + 0x33c) = *(undefined4 *)(in_ECX + 0x33c); *(undefined4 *)(iVar2 + 0x340) = *(undefined4 *)(in_ECX + 0x340); *(undefined4 *)(iVar2 + 0x358) = 0xc2ca0000; } iVar1 = *(int *)(*(int *)(in_ECX + 0x3c0) + 0x3c0); bVar3 = iVar1 != iVar2; iVar2 = 0; if (bVar3) { iVar2 = iVar1; } } return; } //@@ 00453140 NpcAI::ENTITY_BIG_HORN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 411 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BIG_HORN(Entity_NPC *npc) { EntityPtr *pEVar1; byte bVar2; uint uVar3; undefined4 uVar4; int iVar5; float *damageEvent; Entity_Player *pEVar6; Entity_Effect *bloodCloud; byte *strCursor; byte *pbVar7; EntityRef *sourceRef; Entity *pEVar8; Vector *aimDir; std_string *curAnimName; int iVar9; Vector *pVVar10; byte extraout_CL; byte extraout_CL_00; EntityPtr EVar11; char *pcVar12; uint uVar13; int *piVar14; code *extraout_EDX; void *pvVar15; code *extraout_EDX_00; float fVar16; void **ppvVar17; EntityPtr heldBomb; code *vfn; bool bVar18; float fVar19; float fVar20; float fVar21; Vector local_d8; Vector local_d0; Vector local_c8; Vector local_c0; EntityPtr local_b8; byte isAnimMatch; Vector local_b0; Entity *local_a8; char local_a1; float local_a0; EntityPtr local_9c; Entity_Player *local_98; undefined1 local_94 [8]; float fStack_8c; float fStack_88; float local_84; float fStack_80; float fStack_7c; float fStack_78; float local_74; float local_70; float local_6c; undefined1 local_68 [16]; Vector VStack_58; undefined1 local_4c [28]; void *pvStack_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *animNameSize; float *damageEventsEnd; Manager *manager; Room *room; Entity_NPC *roomEntity; ANM2 *sprite; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af249d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; local_9c = (EntityPtr)npc->_variant; fVar16 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_d0.y = (float)npc; local_a0 = fVar16; local_a1 = NpcHelper::big_horn_is_any_hole_busy(local_24); if (npc->_state == 0) { local_98 = (Entity_Player *)0x0; std::deque::resize(1,&local_98); } uVar3 = (npc->_entityDeque)._offset; uVar13 = uVar3 & 3; iVar9 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar3 >> 2) * 4); local_b8 = (EntityPtr)(iVar9 + uVar13 * 4); if ((*(int *)(iVar9 + uVar13 * 4) == 0) && (local_98 = (Entity_Player *)ANM2::GetLayer(&npc->_sprite,&DAT_00b1d57c), local_98 != (Entity_Player *)0x0)) { uVar3 = Random(); local_a8 = Game::Spawn(g_game,1000,0x7a,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); local_c0.y = (float)&local_a8->_parent; if (local_a8->_parent != (EntityPtr)0x0) { local_c8.y = local_c0.y; std::multiset::erase(&local_c8.y); } *(Entity_NPC **)local_c0.y = npc; std::multiset::insert(local_c0.y); if (*(undefined4 **)local_98 == (undefined4 *)0x0) { uVar4 = 0xffffffff; } else { uVar4 = **(undefined4 **)local_98; } *(undefined4 *)&local_a8[1].field_0x44 = uVar4; if (*(float *)local_b8 != 0.0) { local_c0.y = (float)local_b8; std::multiset::erase(&local_c0.y); } *(Entity **)local_b8 = local_a8; std::multiset::insert(local_b8); *(undefined1 *)&(local_98->_sprite)._animDefaultName._capacity = 0; } if (local_9c != (EntityPtr)0x0) { if (local_9c != (EntityPtr)0x1) { if (local_9c != (EntityPtr)0x2) goto LAB_004560df; if (npc->_state == 0) { ANM2::Play(&npc->_sprite,(byte *)"BigHoleOpen",1); npc->_state = 3; npc->_canShutDoors = 0; npc->_isInvicible = 1; npc->_collisionDamage = 0.0; npc->_entityCollisionClass = 3; npc->_renderDepthOffset = -100.0; goto LAB_00454a73; } EVar11 = npc->_parent; npc->_renderDepthOffset = -100.0; if (EVar11 == (EntityPtr)0x0) goto LAB_00454a98; if (*(float *)((int)EVar11 + 0x380) <= npc->_health) { npc->_health = *(float *)((int)EVar11 + 0x380); } else { *(float *)((int)EVar11 + 0x380) = npc->_health; } if (npc->_dead != 0) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_94 + 4)); (*extraout_EDX_00)(sourceRef); } if (npc->_state != 3) goto LAB_004560df; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 1; } goto LAB_004560df; } curAnimName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)local_68); isAnimMatch = str_eq_cstr(curAnimName,(byte *)"BigHoleOpen"); std::string::_Tidy_deallocate(local_68); if (isAnimMatch != 0) { uVar3 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { Game::GetPlayer(g_game,uVar3); FUN_00452c60(); uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } iVar9 = FUN_00452d40(); npc->_i1 = npc->_i1 + iVar9; iVar9 = npc->_stateFrame; npc->_stateFrame = iVar9 + 1; if ((0x3c < iVar9) && (local_a1 == '\0')) { ANM2::Play(&npc->_sprite,(byte *)"BigHoleClose",0); } goto LAB_004560df; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004560df; (**(code **)(*(int *)npc + 0x28))(); if (npc->_i1 < 2) { if (npc->_i1 == 1) { uVar3 = Random(); VStack_58.x = 0.0; VStack_58.y = 0.0; pVVar10 = Room::GetRandomPosition(g_game->_room,&local_d0,0.0); uVar13 = 2; goto LAB_004560aa; } } else { uVar3 = Random(); VStack_58.x = 0.0; VStack_58.y = 0.0; pVVar10 = Room::GetRandomPosition(g_game->_room,&local_2c,0.0); uVar13 = 3; LAB_004560aa: pEVar8 = Game::Spawn(g_game,0x19b,1,pVVar10,&VStack_58,(Entity *)npc,uVar13,uVar3); *(undefined4 *)((int)&pEVar8->_flags + 4) = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; } npc->_i1 = 0; goto LAB_004560df; } if (npc->_state == 0) { npc->_canShutDoors = 0; npc->_isInvicible = 1; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SmallHoleOpen",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } uVar3 = npc->_subtype; npc->_entityCollisionClass = 0; if ((uVar3 & 1) != 0) { (npc->_sprite)._flipX = 1; } if (uVar3 == 0) { LAB_00454a56: npc->_state = 3; } else if (uVar3 < 3) { npc->_state = 8; } else if (uVar3 < 5) { npc->_state = 9; } else if (uVar3 < 7) { npc->_state = 10; } else { if (8 < uVar3) goto LAB_00454a56; npc->_state = 0xb; } uVar3 = Random(); if ((uVar3 & 1) != 0) { npc->_i2 = 0x1e; } LAB_00454a73: uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; ExceptionList = local_1c; return; } EVar11 = npc->_parent; if (EVar11 == (EntityPtr)0x0) { LAB_00454a98: (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } if (*(float *)((int)EVar11 + 0x380) <= npc->_health) { npc->_health = *(float *)((int)EVar11 + 0x380); } else { *(float *)((int)EVar11 + 0x380) = npc->_health; } if (npc->_dead != 0) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_94 + 4)); (*extraout_EDX)(sourceRef); if (((npc->_subtype - 7U < 2) && (bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"BombExplode"), bVar2 == 0)) && (npc->_deliriumBossType == 0)) { uVar3 = Random(); local_b0.x = 0.0; local_b0.y = 0.0; pEVar8 = Game::Spawn(g_game,0x194,0,&npc->_pos,&local_b0,(Entity *)npc->_parent,0,uVar3); uVar4 = *(undefined4 *)((int)&pEVar8->_flags + 4); fVar16 = pEVar8->_maxHitPoints * 0.2; *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar4; iVar9 = *(int *)pEVar8; pEVar8->_maxHitPoints = fVar16; pEVar8->_health = fVar16; *(undefined4 *)&pEVar8[1].field_0x4 = 0; pEVar8[2]._posOffset.x = 4.2039e-45; pEVar8->_entityGridCollisionClass = 3; *(undefined4 *)&pEVar8[2].field_0x3a8 = 0x2d; (**(code **)(iVar9 + 0xc))(); } fVar16 = local_a0; } switch(npc->_state) { case 3: npc->_renderDepthOffset = -100.0; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_collisionDamage = 1.0; npc->_stateFrame = 1; npc->_entityCollisionClass = 3; } } else { curAnimName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)local_68); animNameSize = &curAnimName->_size; if (0xf < curAnimName->_capacity) { curAnimName = *(std_string **)curAnimName->_buf; } isAnimMatch = str_eq((byte *)curAnimName,*animNameSize,(byte *)"SmallHoleOpen",0xd); if (0xf < (uint)VStack_58.y) { uVar3 = (int)VStack_58.y + 1; pcVar12 = (char *)local_68._0_4_; if (0xfff < uVar3) { pcVar12 = *(char **)(local_68._0_4_ + -4); uVar3 = (int)VStack_58.y + 0x24; if ((char *)0x1f < (char *)(local_68._0_4_ + (-4 - (int)pcVar12))) { LAB_00454c84: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar3); } VStack_58.x = 0.0; VStack_58.y = 2.10195e-44; local_68._0_4_ = local_68._0_4_ & 0xffffff00; if (isAnimMatch == 0) { npc->_entityCollisionClass = 0; goto LAB_00455d86; } uVar3 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { Game::GetPlayer(g_game,uVar3); FUN_00452c60(); uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } iVar9 = FUN_00452d40(); iVar9 = npc->_i1 + iVar9; npc->_i1 = iVar9; iVar5 = npc->_stateFrame + (int)local_a0; npc->_stateFrame = iVar5; if ((0x1e < iVar5) && (local_a1 == '\0')) { if (iVar9 == 1) { npc->_state = 9; } else if (iVar9 < 2) { ANM2::Play(&npc->_sprite,(byte *)"SmallHoleClose",0); } else { npc->_state = 10; } manager = g_manager; npc->_stateFrame = 0; npc->_i1 = 0; local_98 = (Entity_Player *)0x375; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); } } break; case 5: (npc->_velocity).x = (npc->_velocity).x * 0.0; (npc->_velocity).y = (npc->_velocity).y * 0.0; LAB_00455d86: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); } break; case 8: iVar9 = npc->_stateFrame; npc->_renderDepthOffset = 0.0; if (iVar9 == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { piVar14 = &npc->_i2; *piVar14 = *piVar14 - (int)fVar16; if (*piVar14 < 0) { npc->_isInvicible = 0; npc->_entityCollisionClass = 4; npc->_collisionDamage = 1.0; ANM2::Play(&npc->_sprite,(byte *)"HandSlap",0); manager = g_manager; local_98 = (Entity_Player *)0x370; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); local_9c = (EntityPtr)Game::GetRandomPlayer(g_game,&npc->_pos,9999999.0); pEVar1 = &npc->_target; if (npc->_target != (EntityPtr)0x0) { local_d0.y = (float)pEVar1; std::multiset::erase(&local_d0.y); } *pEVar1 = local_9c; if (local_9c != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } npc->_stateFrame = 1; } } } else if (0 < iVar9) { if (iVar9 == 2) { EVar11 = npc->_target; if (EVar11 != (EntityPtr)0x0) { fVar16 = *(float *)((int)EVar11 + 0x340); fVar19 = (npc->_pos).y; (npc->_velocity).x = *(float *)((int)EVar11 + 0x33c) - (npc->_pos).x; (npc->_velocity).y = fVar16 - fVar19; } pVVar10 = Vector::Normalized(&npc->_velocity,&VStack_58); fVar16 = pVVar10->y; (npc->_velocity).x = pVVar10->x * 3.0; (npc->_velocity).y = fVar16 * 3.0; } else { (npc->_velocity).x = (npc->_velocity).x * 0.0; (npc->_velocity).y = (npc->_velocity).y * 0.0; } sprite = &npc->_sprite; bVar2 = Sprite::IsEventTriggered((Sprite *)sprite,&DAT_00b1d6fc); if (bVar2 == 0) { bVar2 = Sprite::IsEventTriggered((Sprite *)sprite,&DAT_00b1d6f4); if (bVar2 != 0) { npc->_stateFrame = 1; } } else { npc->_stateFrame = 2; } bVar2 = Sprite::IsEventTriggered((Sprite *)sprite,&DAT_00b1d710); if (bVar2 != 0) { Entity::GetNullCapsule((Entity *)npc,(Capsule *)local_4c,&DAT_00b1d710); if (0.0 < local_2c.x) { if (((uint)g_game->_debugFlags >> 5 & 1) != 0) { pvVar15 = Entity::GetDebugShape((Entity *)npc,1); *(undefined4 *)((int)pvVar15 + 4) = 1; push_shape_points(pvVar15,(Capsule *)local_4c); } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_68 + 8), (Vector *)local_4c,local_2c.y + local_2c.x,0xffffffff); local_14 = 4; local_a0 = 0.0; if (VStack_58.y != 0.0) { do { EVar11 = *(EntityPtr *)(local_68._12_4_ + (int)local_a0 * 4); local_b8 = EVar11; if (((*(int *)((int)EVar11 + 0x188) != 0) && (*(int *)((int)EVar11 + 0x184) != 4)) && (EVar11 != (EntityPtr)npc)) { Entity::GetCollisionCapsule((Entity *)EVar11,local_94 + 4,&g_vectorZero); local_b0.y = 0.0; local_b0.x = 0.0; bVar2 = Capsule::Collide((Capsule *)local_4c,(Capsule *)(local_94 + 4),&local_b0); if (bVar2 != 0) { local_a8 = (Entity *)(*(float *)((int)EVar11 + 0x340) - (npc->_pos).y); local_98 = (Entity_Player *) (((Vector *)((int)EVar11 + 0x33c))->x - (npc->_pos).x); fVar16 = sqrtf((float)local_a8 * (float)local_a8 + (float)local_98 * (float)local_98); if (fVar16 <= 0.0) { pEVar8 = local_a8; pEVar6 = local_98; } else { pEVar8 = (Entity *)((1.0 / fVar16) * (float)local_a8); pEVar6 = (Entity_Player *)((1.0 / fVar16) * (float)local_98); } fVar16 = *(float *)((int)EVar11 + 0x364); ((Vector *)((int)EVar11 + 0x360))->x = (float)pEVar6 * 5.0 + ((Vector *)((int)EVar11 + 0x360))->x; *(float *)((int)EVar11 + 0x364) = (float)pEVar8 * 5.0 + fVar16; if ((*(int *)((int)EVar11 + 0x28) == 1) || (*(int *)((int)EVar11 + 0x28) == 3)) { vfn = *(code **)(*(int *)EVar11 + 0x20); EntityRef::constructor((EntityRef *)(local_94 + 4),(Entity *)npc); uVar4 = 0x3f800000; } else { vfn = *(code **)(*(int *)EVar11 + 0x20); EntityRef::constructor((EntityRef *)(local_94 + 4),(Entity *)npc); uVar4 = 0x41c80000; } (*vfn)(uVar4,0,0,local_94 + 4,0x1e); } } local_a0 = (float)((int)local_a0 + 1); } while ((uint)local_a0 < (uint)VStack_58.y); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_68 + 8); } local_94._0_4_ = 1.0; local_94._4_4_ = 1.0; fStack_8c = 1.0; fStack_88 = 0.6; local_74 = 0.0; local_84 = (float)0x3f333333; fStack_80 = (float)0x3f333333; fStack_7c = (float)0x3f333333; fStack_78 = 1.0; local_70 = 0.0; local_6c = 0.0; Entity::MakeGroundPoof((Entity *)npc,(Vector *)local_4c,(ColorMod *)local_94,0.5); local_b0.x = 60.0; local_b0.y = 40.0; spawn_rock_particles(local_4c,&local_b0); Game::ShakeScreen(g_game,6); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"SmallHoleClose",0); npc->_state = 5; SoundEffects::PlayWithFartOverride(0x375,1.0,2,0,1.0); } } break; case 9: npc->_renderDepthOffset = 0.0; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_collisionDamage = 1.0; npc->_isInvicible = 0; npc->_entityCollisionClass = 4; ANM2::Play(&npc->_sprite,(byte *)"HandThrow",0); SoundEffects::PlayWithFartOverride(0x370,1.0,2,0,1.0); npc->_stateFrame = npc->_stateFrame + 1; uVar13 = 3; local_68[8] = '\0'; local_68[9] = '\0'; local_68[10] = '\0'; local_68[0xb] = '\0'; local_68[0xc] = '\0'; local_68[0xd] = '\0'; local_68[0xe] = '\0'; local_68[0xf] = '\0'; local_a0 = 4.2039e-45; VStack_58.x = 0.0; VStack_58.y = 0.0; uVar3 = Random(); if (uVar3 % 100 < 10) { uVar13 = 4; local_a0 = 5.60519e-45; LAB_004553bc: } else { if (0x1d < uVar3 % 100) goto LAB_004553bc; if (*(float *)((int)g_game->_room + 0x7240) <= 0.0) { uVar13 = 8; local_a0 = 1.12104e-44; local_68._8_4_ = DAT_00c34c00; local_68._12_4_ = DAT_00c34c04; VStack_58.x = DAT_00c34c08; VStack_58.y = DAT_00c34c0c; } else { uVar13 = 0x10; local_a0 = 2.24208e-44; local_68._8_4_ = DAT_00c34b90; local_68._12_4_ = DAT_00c34b94; VStack_58.x = DAT_00c34b98; VStack_58.y = DAT_00c34b9c; } } local_68[0xc] = local_68[0xc]; local_68[0xd] = local_68[0xd]; local_68[0xe] = local_68[0xe]; local_68[0xf] = local_68[0xf]; local_68[8] = local_68[8]; local_68[9] = local_68[9]; local_68[10] = local_68[10]; local_68[0xb] = local_68[0xb]; uVar3 = Random(); pEVar8 = Game::Spawn(g_game,4,uVar13,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); pEVar8->_visible = 0; pEVar8->_entityCollisionClass = 0; pEVar8->_entityGridCollisionClass = 0; Entity::SetParent(pEVar8,(Entity *)npc); uVar4 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags | 0x20; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar4; pEVar8[1]._sprite._filename._buf[0xf] = '\x01'; pEVar8[1]._variant = local_68._8_4_; pEVar8[1]._subtype = local_68._12_4_; pEVar8[1]._spawnerType = (int)VStack_58.x; pEVar8[1]._spawnerVariant = (int)VStack_58.y; if ((local_a0 == 4.2039e-45) || (local_a0 == 5.60519e-45)) { uVar3 = Random(); pvVar15 = (void *)(uVar3 % 10 + 0x23); *(void **)&pEVar8[1].field_0x4 = pvVar15; pEVar8[1]._damageEvents._begin = pvVar15; } Entity_NPC::SetRef_bec(npc,pEVar8); } } else if (npc->_stateFrame == 1) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { local_d0.y = *(float *)&npc->_entityRef; if (((EntityPtr)local_d0.y != (EntityPtr)0x0) && (*(int *)((int)local_d0.y + 0x28) == 4)) { pVVar10 = &npc->_pos; pEVar6 = Game::GetNearestPlayer(g_game,pVVar10); local_b0.x = (pEVar6->_pos).x - pVVar10->x; local_b0.y = (pEVar6->_pos).y - (npc->_pos).y; aimDir = Vector::Normalized(&local_b0,&VStack_58); fVar16 = local_d0.y; local_c8.y = aimDir->x * 15.0; local_98 = (Entity_Player *)(aimDir->y * 15.0); local_9c = (EntityPtr)(local_c8.y * 3.0 + pVVar10->x); local_c0.y = (float)local_98 + (npc->_pos).y; Entity::SetParent((Entity *)local_d0.y,(Entity *)npc); uVar4 = *(undefined4 *)((int)fVar16 + 0x16c); *(uint *)((int)fVar16 + 0x168) = *(uint *)((int)fVar16 + 0x168) & 0xffffffdf; ((Vector *)((int)fVar16 + 0x33c))->x = (float)local_9c; *(float *)((int)fVar16 + 0x340) = local_c0.y; *(undefined4 *)((int)fVar16 + 0x16c) = uVar4; iVar9 = *(int *)fVar16; ((Vector *)((int)fVar16 + 0x360))->x = local_c8.y; *(int *)((int)fVar16 + 0x188) = 4; *(byte *)((int)fVar16 + 0x171) = 1; *(float *)((int)fVar16 + 0x41c) = -4.0; ((Vector *)((int)fVar16 + 0x34c))->x = 0.0; *(float *)((int)fVar16 + 0x350) = -24.0; *(Entity_Player **)((int)fVar16 + 0x364) = local_98; (**(code **)(iVar9 + 0xc))(); Entity_NPC::SetRef_bec(npc,(Entity *)0x0); } Entity_NPC::PlaySound(npc,0xfc,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"SmallHoleClose",0); SoundEffects::PlayWithFartOverride(0x375,1.0,2,0,1.0); npc->_state = 5; } } break; case 10: npc->_renderDepthOffset = 0.0; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pcVar12 = "HandBombs"; LAB_004556d6: npc->_collisionDamage = 1.0; npc->_entityCollisionClass = 4; npc->_isInvicible = 0; ANM2::Play(&npc->_sprite,(byte *)pcVar12,0); SoundEffects::PlayWithFartOverride(0x370,1.0,2,0,1.0); npc->_stateFrame = npc->_stateFrame + 1; } } else if (npc->_stateFrame == 1) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { pVVar10 = &npc->_pos; pEVar6 = Game::GetNearestPlayer(g_game,pVVar10); local_b0.x = (pEVar6->_pos).x - pVVar10->x; local_b0.y = (pEVar6->_pos).y - (npc->_pos).y; aimDir = Vector::Normalized(&local_b0,&VStack_58); local_98 = (Entity_Player *)0x3; local_d0.y = aimDir->x * 12.0; local_c0.y = aimDir->y * 12.0; local_c8.y = local_d0.y * 2.5; local_d8.y = local_d0.y * 3.0 + pVVar10->x; local_b0.y = local_c0.y + (npc->_pos).y; local_a8 = (Entity *)(local_c0.y * 2.5); local_a0 = -80.0; do { uVar3 = Random(); local_b8 = (EntityPtr)(local_a0 * 0.017453292); local_9c = (EntityPtr)cos((float)local_b8); fVar16 = sin((float)local_b8); local_2c.x = local_d0.y * (float)local_9c - local_c0.y * fVar16; local_2c.y = local_d0.y * fVar16 + local_c0.y * (float)local_9c; local_9c = (EntityPtr)cos((float)local_b8); fVar16 = sin((float)local_b8); VStack_58.y = (float)local_a8 * (float)local_9c + local_c8.y * fVar16 + local_b0.y; VStack_58.x = (local_c8.y * (float)local_9c - (float)local_a8 * fVar16) + local_d8.y; pEVar8 = Game::Spawn(g_game,4,3,&VStack_58,&local_2c,(Entity *)npc,0,uVar3); local_a0 = local_a0 + 80.0; uVar4 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar4; pEVar8[1]._variant = 0; pEVar8[1]._subtype = 0; pEVar8[1]._spawnerType = 0; pEVar8[1]._spawnerVariant = 0; EVar11 = pEVar8->_parent; pEVar8[1]._sprite._filename._buf[0xf] = '\x01'; if (EVar11 != (EntityPtr)0x0) { local_9c = (EntityPtr)&pEVar8->_parent; std::multiset::erase(&local_9c); } pEVar8->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar8->_parent); uVar3 = Random(); (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -24.0; fVar16 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; pEVar8[1]._damageEvents._capacity = (void *)(-3.0 - (fVar16 + fVar16)); uVar3 = Random(); pvVar15 = (void *)(uVar3 % 10 + 0x23); *(void **)&pEVar8[1].field_0x4 = pvVar15; pEVar8[1]._damageEvents._begin = pvVar15; if ((pEVar8->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(pEVar8->_sprite)._animState, *(int *)((int)(pEVar8->_sprite)._animState._animData + 0x30) + -1); } local_98 = (Entity_Player *)((int)&local_98[-1]._replacedPlayer + 3); } while (local_98 != (Entity_Player *)0x0); Entity_NPC::PlaySound(npc,0xfc,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"SmallHoleClose",0); SoundEffects::PlayWithFartOverride(0x375,1.0,2,0,1.0); npc->_state = 5; } } break; case 0xb: npc->_renderDepthOffset = 0.0; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pcVar12 = "HandLittleHorn"; goto LAB_004556d6; } } else if (0 < npc->_stateFrame) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1d6fc); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x19f,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { uVar3 = Random(); Entity_NPC::PlaySound (npc,0x19e,1.0,2,0, (float)(npc->_stateFrame + -1) * 0.1 + 0.98 + (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.05); bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_68 + 8), 0x194,1,-1,0,0); EntityList_Query::~EntityList_Query(local_68 + 8); } uVar3 = Random(); pEVar8 = Game::Spawn(g_game,0x194,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { pEVar8->_health = 5.0; pEVar8->_maxHitPoints = 5.0; } local_b0.y = (90.0 - (float)(npc->_stateFrame + -2) * 30.0) * 0.017453292; fVar16 = cos(local_b0.y); local_d8.y = fVar16 * 10.0; fVar20 = sin(local_b0.y); (pEVar8->_velocity).x = local_d8.y; (pEVar8->_velocity).y = fVar20 * 10.0; fVar16 = (npc->_pos).x; fVar19 = (npc->_pos).y; uVar4 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar4; (pEVar8->_pos).x = local_d8.y + fVar16; (pEVar8->_pos).y = fVar20 * 10.0 + fVar19; npc->_stateFrame = npc->_stateFrame + 1; } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1d6f4); if (bVar2 != 0) { npc->_isInvicible = 1; npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"SmallHoleClose",0); SoundEffects::PlayWithFartOverride(0x375,1.0,2,0,1.0); npc->_state = 5; } } } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1d5b0); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x371,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Crack"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x376,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Open); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x377,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shake"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x378,1.0,2,0,1.0); } goto LAB_004560df; } if (npc->_state == 0) { ANM2::Play(&npc->_sprite,(byte *)"Appear",0); npc->_state = 3; ExceptionList = local_1c; return; } switch(npc->_state) { case 3: npc->_renderDepthOffset = 0.0; pvVar15 = (npc->_sprite)._animState._animData; if ((pvVar15 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { iVar9 = npc->_stateFrame; bVar18 = false; if (iVar9 == 0) { if ((pvVar15 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_entityCollisionClass = 4; npc->_stateFrame = npc->_stateFrame + (int)fVar16; npc->_isInvicible = 0; } break; } } else { iVar9 = npc->_stateFrame; bVar18 = iVar9 == 0; } if (!bVar18 && -1 < iVar9) { local_9c = (EntityPtr)(iVar9 + (int)fVar16); npc->_stateFrame = (int)local_9c; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (((bVar2 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (0xf < (int)local_9c)) { bVar2 = ANM2::IsPlaying(&npc->_sprite,(byte *)"PopDown"); if (bVar2 == 0) { ANM2::Play(&npc->_sprite,(byte *)"PopDown",0); } else { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1d5b0); manager = g_manager; if (bVar2 != 0) { local_98 = (Entity_Player *)0x372; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); } } manager = g_manager; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { local_98 = (Entity_Player *)0x36a; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); ANM2::Play(&npc->_sprite,(byte *)"BigHoleClose",0); npc->_state = 4; npc->_stateFrame = 0; } } else { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (((bVar2 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) && (bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1), bVar2 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } break; case 4: if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_entityCollisionClass = 0; npc->_renderDepthOffset = -100.0; npc->_stateFrame = 1; uVar3 = Random(); iVar9 = Room::GetRoomShape(g_game->_room); local_a0 = 0.0; local_c0.y = (float)((uint)(7 < iVar9) * 2 + 2 + (uVar3 & 1)); if ((EntityPtr)local_c0.y != (EntityPtr)0x0) { LAB_004535e0: local_98 = g_game->_room; Random(); EVar11 = (EntityPtr)&g_game->_room; local_a8 = (Entity *)0x0; LAB_00453604: local_a8 = (Entity *)&local_a8->field_0x1; Room::GetRandomPosition((Room *)*(EntityPtr *)EVar11,&VStack_58,0.0); fVar16 = npc->_size * 0.75; local_9c = (EntityPtr)&g_game->_room; Room::GetClampedPositionImpl (*(Room **)local_9c,&local_b0,&VStack_58,fVar16,fVar16,fVar16,fVar16); uVar3 = 0; if (local_98->_playerCostumeMap[3]._priority != 0) { piVar14 = (int *)local_98->_playerCostumeMap[3]._index; do { iVar9 = *piVar14; if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)(iVar9 + 0x28) != 1)) { iVar5 = *(int *)(iVar9 + 0x28); if ((9 < iVar5) && ((((iVar5 < 1000 && (iVar5 != 0x21)) && (iVar5 != 0x11)) && (iVar5 != 0x124)))) { if (iVar5 == 0x375) { bVar18 = *(int *)(iVar9 + 0x2c) == 10; } else { if ((iVar5 == 0x3c0) || (iVar5 == 0x3c5)) goto LAB_0045374a; bVar18 = iVar5 == 0xf5; } if (!bVar18) goto LAB_004536fb; } } else { iVar5 = 1; LAB_004536fb: if (((*(char *)(iVar9 + 0x173) == '\0') && (iVar5 == 0x19b)) && ((*(int *)(iVar9 + 0x2c) == 1 && (fVar16 = *(float *)(iVar9 + 0x33c) - local_b0.x, fVar20 = *(float *)(iVar9 + 0x340) - local_b0.y, fVar19 = npc->_size + npc->_size, fVar20 * fVar20 + fVar16 * fVar16 < fVar19 * fVar19)))) goto LAB_0045378b; } LAB_0045374a: uVar3 = uVar3 + 1; piVar14 = piVar14 + 1; if ((uint)local_98->_playerCostumeMap[3]._priority <= uVar3) break; } while( true ); } uVar3 = 0; if ((uint)local_a0 < 2) { uVar3 = Random(); uVar3 = uVar3 % 100; if (uVar3 < 0x32) { iVar9 = 1; } else { iVar9 = (-(uint)(uVar3 < 0x5a) & 0xfffffffe) + 5; } if ((local_a0 == 0.0) && (uVar3 % 10 == 0)) { local_d8.x = local_b0.x + 0.0; local_d8.y = local_b0.y + 80.0; bVar2 = Room::IsPositionInRoom(g_game->_room,&local_d8,0.0); if (bVar2 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218), (EntityList_EL *)(local_4c + 0x18),0x194,1,-1,0,0); local_a1 = (uint)local_2c.y < (void *)0x2; if (local_4c[0x18] == '\0') { local_14 = 0; tracked_alloc(1,pvStack_30,0); local_14 = 0xffffffff; } if (local_a1 != '\0') { iVar9 = 7; } } } uVar3 = iVar9 + (int)local_a0; } uVar13 = Random(); local_c8.x = 0.0; local_c8.y = 0.0; pEVar8 = Game::Spawn(g_game,0x19b,1,&local_b0,&local_c8,(Entity *)npc,uVar3,uVar13); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = *(undefined4 *)((int)&pEVar8->_flags + 4); pEVar8->_maxHitPoints = npc->_maxHitPoints; pEVar8->_health = npc->_health; if (pEVar8->_parent != (EntityPtr)0x0) { local_9c = (EntityPtr)&pEVar8->_parent; std::multiset::erase(&local_9c); } pEVar8->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar8->_parent); pEVar8->_entityCollisionClass = 0; pEVar8 = local_a8; goto LAB_00453941; } } else { npc->_entityCollisionClass = 0; if (0.0 < npc->_pendingDamage) { damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { if (((uint)damageEvent[2] & 0x2000) == 0) { *damageEvent = *damageEvent * 0.0; } } } } } else { iVar9 = npc->_stateFrame + (int)fVar16; npc->_stateFrame = iVar9; if (iVar9 < 0x6a) { LAB_00453d8f: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar7 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar12 = "BigHoleOpen"; do { bVar2 = *pbVar7; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00453dd6: uVar3 = -(uint)bVar18 | 1; goto LAB_00453ddb; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00453dd6; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00453ddb: if ((uVar3 == 0) && (local_a1 == '\0')) { EVar11 = npc->_child; npc->_entityCollisionClass = 4; if (EVar11 == (EntityPtr)0x0) { npc->_isInvicible = 0; if (npc->_i1 < 1) { npc->_state = 0xd; ANM2::Play(&npc->_sprite,(byte *)"PopUp",0); Entity_NPC::PlaySound(npc,0xe,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x369,1.0,2,0,1.0); } else { npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"PopUpDizzy",0); npc->_i2 = 0x96; npc->_i1 = 0; } npc->_stateFrame = 0; npc->_renderDepthOffset = 0.0; } else { npc->_isInvicible = 0; iVar9 = Entity::GetIntervalTicks((Entity *)npc,5.0,0.0); if (iVar9 != 0) { local_c0.y = *(float *)((int)EVar11 + 0x3c0); local_9c = (EntityPtr)&npc->_child; std::multiset::erase(&local_9c); npc->_child = (EntityPtr)local_c0.y; if ((EntityPtr)local_c0.y != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } *(float *)((int)EVar11 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar11 + 0x340) = (npc->_pos).y; *(int *)((int)EVar11 + 0x410) = 0; *(int *)((int)EVar11 + 0x414) = 0; (**(code **)(*(int *)EVar11 + 0xc))(); (**(code **)(*(int *)EVar11 + 0x28))(); } FUN_004530e0(); } } } } else { pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) goto LAB_00453b59; if ((npc->_sprite)._animState._isPlaying == 0) { strCursor = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { strCursor = *(byte **)pbVar7; } pcVar12 = "BigHoleOpen"; do { bVar2 = *strCursor; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00453a20: uVar3 = -(uint)bVar18 | 1; goto LAB_00453a25; } if (bVar2 == 0) break; bVar2 = strCursor[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00453a20; strCursor = strCursor + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00453a25: if (uVar3 == 0) goto LAB_00453d8f; } if ((pbVar7 == (byte *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_00453b59: local_a8 = (Entity *)0x0; fVar16 = npc->_size; ppvVar17 = &g_game->_room; LAB_00453b70: room = *ppvVar17; local_a8 = (Entity *)&local_a8->field_0x1; local_9c = (EntityPtr)(fVar16 * 0.45); local_c0.y = fVar16 * 1.15; pVVar10 = Room::GetRandomPosition(room,&VStack_58,0.0); Room::GetClampedPositionImpl (room,&local_b0,pVVar10,(float)local_9c,local_c0.y,(float)local_9c,local_c0.y); ppvVar17 = &g_game->_room; local_98 = (Entity_Player *)0x0; local_9c = *(EntityPtr *)((int)g_game->_room + 0x1264); local_c8.y = (float)ppvVar17; if (local_9c != (EntityPtr)0x0) { local_c0.y = *(float *)&g_game->_deathmatchManager; piVar14 = *(int **)((int)g_game->_room + 0x125c); do { roomEntity = (Entity_NPC *)*piVar14; if ((1 < (int)local_c0.y) && (roomEntity->_type == 1)) { iVar9 = 1; goto LAB_00453c9f; } iVar9 = roomEntity->_type; if ((((iVar9 - 10U < 0x3de) && (iVar9 != 0x21)) && (iVar9 != 0x11)) && (iVar9 != 0x124)) { if (iVar9 != 0x375) { if (((iVar9 != 0x3c0) && (iVar9 != 0x3c5)) && (iVar9 != 0xf5)) goto LAB_00453c9f; goto LAB_00453cbc; } if (roomEntity->_variant != 10) { LAB_00453c9f: if (((roomEntity->_dead != 0) || (roomEntity == npc)) || ((iVar9 != 0x19b && (iVar9 != 0x194)))) goto LAB_00453cbc; goto LAB_00453cc1; } } else { LAB_00453cbc: if (iVar9 == 4) { LAB_00453cc1: fVar20 = (roomEntity->_pos).x - local_b0.x; fVar16 = npc->_size; fVar21 = (roomEntity->_pos).y - local_b0.y; fVar19 = fVar16 + roomEntity->_size; if (fVar21 * fVar21 + fVar20 * fVar20 < fVar19 * fVar19) goto LAB_00453d24; } } piVar14 = piVar14 + 1; local_98 = (Entity_Player *)&local_98->field_0x1; if ((uint)local_9c <= local_98) break; } while( true ); } ANM2::Play(&npc->_sprite,(byte *)"BigHoleOpen",0); (npc->_pos).x = local_b0.x; (npc->_pos).y = local_b0.y; pEVar8 = local_a8; goto LAB_00453d72; } pbVar7 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar12 = "BigHoleOpen"; do { bVar2 = *pbVar7; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00453a72: uVar3 = -(uint)bVar18 | 1; goto LAB_00453a77; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00453a72; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00453a77: if (uVar3 != 0) goto LAB_00453b59; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Crack"); manager = g_manager; if (bVar2 != 0) { local_98 = (Entity_Player *)0x36b; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Open); manager = g_manager; if (bVar2 != 0) { local_98 = (Entity_Player *)0x36c; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shake"); if (bVar2 == 0) break; local_98 = (Entity_Player *)0x36d; LAB_004547fb: manager = g_manager; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); } } break; case 0xd: npc->_renderDepthOffset = 0.0; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { fVar16 = *(float *)((int)g_game->_room + 0x20) - (npc->_pos).y; if (fVar16 < npc->_size || fVar16 == npc->_size) { npc->_state = 3; } else { uVar3 = Random(); if (uVar3 % 100 < 0x23) { pcVar12 = "Charge2"; } else { pcVar12 = "Charge3"; if (0x27 < uVar3 % 100) { pcVar12 = "Charge"; } } ANM2::Play(&npc->_sprite,(byte *)pcVar12,0); npc->_stateFrame = npc->_stateFrame + 1; manager = g_manager; local_98 = (Entity_Player *)0x374; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); } npc->_isInvicible = 0; npc->_entityCollisionClass = 4; } } else { npc->_stateFrame = npc->_stateFrame + (int)fVar16; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { fVar16 = 1.4013e-45; local_a0 = 1.4013e-45; local_4c._16_4_ = 5.0; local_4c._20_4_ = 5.0; local_4c._24_4_ = 15.0; pvStack_30 = (void *)0x40e00000; local_2c.x = -15.0; local_2c.y = 7.0; if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) { pbVar7 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar12 = "Charge"; do { bVar2 = *pbVar7; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_004540d0: uVar3 = -(uint)bVar18 | 1; goto LAB_004540d5; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_004540d0; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004540d5: if ((uVar3 == 0) && (pEVar6 = Game::GetRandomPlayer(g_game,&npc->_pos,9999999.0), fVar16 = (npc->_pos).x, (pEVar6->_pos).x <= fVar16 && fVar16 != (pEVar6->_pos).x)) { local_4c._16_4_ = -5.0; } } fVar16 = 1.4013e-45; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar7 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar12 = "Charge2"; do { bVar2 = *pbVar7; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00454153: uVar3 = -(uint)bVar18 | 1; goto LAB_00454158; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00454153; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00454158: if (uVar3 == 0) { fVar16 = 2.8026e-45; } else { pbVar7 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar12 = "Charge3"; do { bVar2 = *pbVar7; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00454191: uVar3 = -(uint)bVar18 | 1; goto LAB_00454196; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00454191; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00454196: if (uVar3 == 0) { fVar16 = 4.2039e-45; } } local_a0 = fVar16; } } local_74 = 0.15; local_9c = (EntityPtr)&npc->_pos; local_70 = 0.15; local_84 = 0.0; fStack_80 = 0.0; fStack_7c = 0.0; fStack_78 = 0.0; local_6c = 0.15; local_94._0_4_ = 0.0; local_94._4_4_ = 0.0; fStack_8c = 0.0; fStack_88 = 0.8; bloodCloud = Entity_NPC::MakeBloodCloud(npc,(Vector *)local_9c,(ColorMod *)local_94); (bloodCloud->_posOffset).x = 0.0; (bloodCloud->_posOffset).y = (float)&DAT_c1c80000; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_68 + 8), 0x194,1,-1,0,0); fVar16 = (float)(2 - (int)VStack_58.y); local_a0 = fVar16; EntityList_Query::~EntityList_Query(local_68 + 8); } local_a8 = (Entity *)0x0; if (0 < (int)fVar16) { local_b8 = (EntityPtr)((int)local_4c + 0x10); if (fVar16 == 2.8026e-45) { local_b8 = (EntityPtr)((int)local_4c + 0x18); } do { local_98 = (Entity_Player *)0x0; if ((fVar16 == 2.8026e-45) || (1 < (int)local_a8)) { local_98 = (Entity_Player *)0x1; } local_d8.x = *(float *)local_b8; local_d8.y = *(float *)((int)local_b8 + 4); uVar3 = Random(); local_c0.x = *(float *)local_b8 * 2.0 + (float)*(EntityPtr *)local_9c; local_c0.y = (float)*(void **)((int)local_b8 + 4) * 2.0 + (float)*(EntityPtr *)((int)local_9c + 4); pEVar8 = Game::Spawn(g_game,0x194,1,&local_c0,&local_d8,(Entity *)npc,(uint)local_98, uVar3); if ((npc->_flags & 0x1000000000000000) != 0) { pEVar8->_health = 5.0; pEVar8->_maxHitPoints = 5.0; } uVar4 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar4; local_68._0_4_ = std::_Allocate(0x30); VStack_58.x = 5.60519e-44; VStack_58.y = 6.5861e-44; builtin_strncpy((char *)local_68._0_4_,"gfx/effects/Effect_088_DarkSmoke_Big.png",0x29); local_14 = 1; Sprite::ReplaceSpritesheet((Sprite *)&pEVar8->_sprite,0,(std_string *)local_68); local_14 = 0xffffffff; bVar2 = extraout_CL; if (0xf < (uint)VStack_58.y) { uVar3 = (int)VStack_58.y + 1; pcVar12 = (char *)local_68._0_4_; if (0xfff < uVar3) { pcVar12 = *(char **)(local_68._0_4_ + -4); uVar3 = (int)VStack_58.y + 0x24; if ((char *)0x1f < (char *)(local_68._0_4_ + (-4 - (int)pcVar12))) goto LAB_00454c84; } operator_delete(pcVar12,uVar3); bVar2 = extraout_CL_00; } ANM2::LoadGraphics(&pEVar8->_sprite,bVar2); local_b0.y = -g_vectorOne.y; local_b0.x = -g_vectorOne.x; Entity::SetSize(pEVar8,pEVar8->_size * 1.5, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1) ; local_a8 = (Entity *)&local_a8->field_0x1; local_b8 = (EntityPtr)((int)local_b8 + 8); fVar16 = local_a0; } while ((int)local_a8 < (int)local_a0); } Entity_NPC::PlaySound(npc,0x379,1.0,2,0,1.0); } bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar2 != 0) { ENTITY_BIG_HORN_grab_bomb(npc); } FUN_004530e0(); if (npc->_child != (EntityPtr)0x0) { bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"BombExplode"); manager = g_manager; if (bVar2 != 0) { local_98 = (Entity_Player *)0x373; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); EVar11 = npc->_child; if ((EVar11 == (EntityPtr)0x0) || (*(int *)((int)EVar11 + 0x28) != 4)) { heldBomb = (EntityPtr)0x0; if (EVar11 != (EntityPtr)0x0) goto LAB_0045454b; } else { heldBomb = EVar11; LAB_0045454b: local_9c = (EntityPtr)&npc->_child; std::multiset::erase(&local_9c); } npc->_child = (EntityPtr)0x0; if (heldBomb != (EntityPtr)0x0) { fVar16 = (npc->_pos).x; fVar19 = (npc->_pos).y; *(int *)((int)heldBomb + 0x410) = 0; *(int *)((int)heldBomb + 0x414) = 0; *(float *)((int)heldBomb + 0x33c) = fVar16 + 0.0; *(float *)((int)heldBomb + 0x340) = fVar19 + 2.0; (**(code **)(*(int *)heldBomb + 0xc))(); } } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { EVar11 = npc->_child; if (EVar11 == (EntityPtr)0x0) { if (npc->_i1 < 1) { npc->_state = 3; } else { npc->_stateFrame = 1; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"DizzyLoop",0); npc->_i2 = 0x96; npc->_i1 = 0; } } else { npc->_isInvicible = 0; local_9c = (EntityPtr)&npc->_child; std::multiset::erase(&local_9c); npc->_child = (EntityPtr)0x0; *(float *)((int)EVar11 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar11 + 0x340) = (npc->_pos).y; *(int *)((int)EVar11 + 0x410) = 0; *(int *)((int)EVar11 + 0x414) = 0; (**(code **)(*(int *)EVar11 + 0xc))(); (**(code **)(*(int *)EVar11 + 0x28))(); } } } break; case 0x10: npc->_entityCollisionClass = 4; npc->_renderDepthOffset = 0.0; if (npc->_stateFrame == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 1; ANM2::Play(&npc->_sprite,(byte *)"DizzyLoop",0); } } else { if (0.0 < npc->_pendingDamage) { damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { *damageEvent = *damageEvent * 1.2; } } npc->_i2 = npc->_i2 - (int)fVar16; if (npc->_i2 < 1) { pbVar7 = (npc->_sprite)._animState._animData; if ((pbVar7 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { strCursor = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { strCursor = *(byte **)pbVar7; } pcVar12 = "DizzyEnd"; do { bVar2 = *strCursor; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00454768: uVar3 = -(uint)bVar18 | 1; goto LAB_0045476d; } if (bVar2 == 0) break; bVar2 = strCursor[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00454768; strCursor = strCursor + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0045476d: if (uVar3 == 0) { npc->_state = 3; npc->_stateFrame = 0; npc->_i2 = 0; break; } } if ((pbVar7 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { pbVar7 = &s_empty; } else if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar12 = "DizzyEnd"; do { bVar2 = *pbVar7; bVar18 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_004547d7: uVar3 = -(uint)bVar18 | 1; goto LAB_004547dc; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar18 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_004547d7; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004547dc: if (uVar3 == 0) break; } ANM2::Play(&npc->_sprite,(byte *)"DizzyEnd",0); local_98 = (Entity_Player *)0x36f; goto LAB_004547fb; } } } switchD_0045334c_caseD_5: manager = g_manager; if (npc->_dead != 0) { local_98 = (Entity_Player *)0x36e; seed_fart_sound_override((int *)&local_98); SoundEffects::Play(&manager->_sfxManager,(int)local_98,1.0,2,0,1.0,0.0); EVar11 = npc->_child; pEVar1 = &npc->_child; if (EVar11 != (EntityPtr)0x0) { do { local_c0.y = *(float *)((int)EVar11 + 0x3c0); local_9c = (EntityPtr)pEVar1; std::multiset::erase(&local_9c); *pEVar1 = (EntityPtr)local_c0.y; if ((EntityPtr)local_c0.y != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } (**(code **)(*(int *)EVar11 + 0x28))(); EVar11 = *pEVar1; } while (EVar11 != (EntityPtr)0x0); npc = (Entity_NPC *)local_d0.y; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_68 + 8), *(int *)((int)npc + 0x28),-1,-1,0,0); local_14 = 2; local_98 = (Entity_Player *)0x0; if (VStack_58.y != 0.0) { iVar9 = local_68._12_4_; do { local_d0.y = *(float *)(iVar9 + (int)local_98 * 4); if (((((Entity_NPC *)local_d0.y != npc) && (*(int *)((int)local_d0.y + 0x2c) != 0)) && (*(EntityPtr *)((int)local_d0.y + 0x3bc) == (EntityPtr)npc)) && (*(byte *)((int)local_d0.y + 0x173) == 0)) { vfn = *(code **)(*(int *)local_d0.y + 0x24); EntityRef::constructor((EntityRef *)local_4c,(Entity *)npc); (*vfn)(local_4c); iVar9 = local_68._12_4_; } local_98 = (Entity_Player *)&local_98->field_0x1; } while (local_98 < (uint)VStack_58.y); } if (local_68[8] == '\0') { local_14 = 3; tracked_alloc(1,(void *)local_68._12_4_,0); } } LAB_004560df: if (((*(int *)((int)npc + 0x2c) != 1) || (*(int *)((int)npc + 0xb64) != 8)) || (*(int *)((int)npc + 0x410) < 1)) { *(float *)((int)npc + 0x36c) = 0.0; } ExceptionList = local_1c; return; LAB_0045378b: EVar11 = local_9c; if (0x31 < (int)local_a8) goto code_r0x004537a0; goto LAB_00453604; code_r0x004537a0: pEVar8 = (Entity *)&local_a8->field_0x1; LAB_00453941: if (0x31 < (int)pEVar8) { KAGE_LogMessage(4,(byte *)"Failed to find safe spawn location for Big Horn\'s Small Hole\n"); } local_a0 = (float)((int)local_a0 + 1); if ((int)local_c0.y <= (int)local_a0) goto switchD_0045334c_caseD_5; goto LAB_004535e0; LAB_00453d24: if (0x31 < (int)local_a8) goto LAB_00453d3a; goto LAB_00453b70; LAB_00453d3a: pEVar8 = (Entity *)&local_a8->field_0x1; LAB_00453d72: if (0x31 < (int)pEVar8) { KAGE_LogMessage(4,(byte *)"Failed to find safe for big horn to move to\n"); } goto switchD_0045334c_caseD_5; } //@@ 00456170 FUN_00456170 void FUN_00456170(int *param_1) { int iVar1; int *in_ECX; iVar1 = *in_ECX; *param_1 = iVar1; *in_ECX = iVar1 + 0x38; return; } //@@ 00456190 FUN_00456190 void FUN_00456190(undefined4 *param_1) { int in_ECX; *param_1 = *(undefined4 *)(in_ECX + 4); return; } //@@ 004561a0 std::iterator_copy /* DB: ? *out=*this, ICF-foldable prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std::iterator_copy(void *this,void *outIterator) { *(undefined4 *)outIterator = *(undefined4 *)this; return outIterator; } //@@ 004561b0 str_eq_cstr /* DB: strlen then str_eq prototype: db/protos.zhl */ byte __fastcall str_eq_cstr(std_string *str,byte *cstr) { uint *puVar1; byte bVar2; byte *pbVar3; pbVar3 = cstr; do { bVar2 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar2 != 0); puVar1 = &str->_size; if (0xf < str->_capacity) { str = *(std_string **)str->_buf; } bVar2 = str_eq((byte *)str,*puVar1,cstr,(int)pbVar3 - (int)(cstr + 1)); return bVar2; } //@@ 004561f0 FUN_004561f0 void FUN_004561f0(byte *param_1) { uint *puVar1; byte bVar2; byte *in_ECX; byte *pbVar3; pbVar3 = param_1; do { bVar2 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar2 != 0); puVar1 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } str_eq(in_ECX,*puVar1,param_1,(int)pbVar3 - (int)(param_1 + 1)); return; } //@@ 00456230 FUN_00456230 void FUN_00456230(void) { float in_XMM0_Da; float in_XMM1_Da; atan2f(in_XMM0_Da,in_XMM1_Da); return; } //@@ 00456240 ColorParams::set_from_bytes /* DB: ints *1/255 into tint/offset floats prototype: db/protos.zhl, confirmed by RET 28 */ ColorMod * __thiscall ColorParams::set_from_bytes (ColorParams *this,int tintR,int tintG,int tintB,int tintA,int offsetR,int offsetG, int offsetB) { *(undefined4 *)&this->field_0x10 = 0; *(undefined4 *)&this->field_0x14 = 0; *(undefined4 *)&this->field_0x18 = 0; *(undefined4 *)&this->field_0x1c = 0; this->_priority = (int)((float)tintR * 0.003921569); *(float *)&this->field_0x4 = (float)tintG * 0.003921569; *(float *)&this->field_0x8 = (float)tintB * 0.003921569; *(float *)&this->field_0xc = (float)tintA * 0.003921569; *(float *)&this->field_0x20 = (float)offsetR * 0.003921569; *(float *)&this->field_0x24 = (float)offsetG * 0.003921569; *(float *)&this->field_0x28 = (float)offsetB * 0.003921569; return (ColorMod *)this; } //@@ 004562f0 FUN_004562f0 char * FUN_004562f0(char *param_1) { int *in_ECX; if (*in_ECX == 0) { param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; *param_1 = '\0'; return param_1; } std::string::string(param_1,(void *)(*in_ECX + 0x20)); return param_1; } //@@ 00456340 Sprite::set_offset /* DB: tiny: writes +0x94/+0x98 (Lua Sprite.Offset is +0x94) (dogma_effects.md) */ void __thiscall Sprite::set_offset(Sprite *this,float *param_2) { (this->_offset).x = *param_2; (this->_offset).y = param_2[1]; return; } //@@ 00456360 Sprite::PlaybackSpeed /* ZHL [lua] Lua binding Sprite:PlaybackSpeed */ float10 __thiscall Sprite::PlaybackSpeed(Sprite *this) { return (float10)this->_playbackSpeed; } //@@ 00456370 PathFinder::GetGridIndex /* ZHL [lua] Lua binding PathFinder:GetGridIndex */ undefined4 PathFinder::GetGridIndex(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x20); } //@@ 00456380 Color::assign /* DB: 11-dword copy into +0x1e4 (entity color) with self check */ void Color::assign(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; if ((undefined4 *)(in_ECX + 0x1e4) != param_1) { uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *(undefined4 *)(in_ECX + 0x1e4) = *param_1; *(undefined4 *)(in_ECX + 0x1e8) = uVar1; *(undefined4 *)(in_ECX + 0x1ec) = uVar2; *(undefined4 *)(in_ECX + 0x1f0) = uVar3; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; *(undefined4 *)(in_ECX + 500) = param_1[4]; *(undefined4 *)(in_ECX + 0x1f8) = uVar1; *(undefined4 *)(in_ECX + 0x1fc) = uVar2; *(undefined4 *)(in_ECX + 0x200) = uVar3; *(undefined8 *)(in_ECX + 0x204) = *(undefined8 *)(param_1 + 8); *(undefined4 *)(in_ECX + 0x20c) = param_1[10]; } return; } //@@ 004563c0 FUN_004563c0 void FUN_004563c0(undefined4 *param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xdc) = *param_1; *(undefined4 *)(in_ECX + 0xe0) = param_1[1]; return; } //@@ 004563e0 FUN_004563e0 void FUN_004563e0(undefined4 *param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x374) = *param_1; *(undefined4 *)(in_ECX + 0x378) = param_1[1]; return; } //@@ 00456400 FUN_00456400 void FUN_00456400(void) { undefined4 *in_ECX; in_ECX[1] = *in_ECX; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; return; } //@@ 00456420 Entity_Projectile::AddHeight /* ZHL [lua] Lua binding EntityProjectile:AddHeight */ void __thiscall Entity_Projectile::AddHeight(Entity_Projectile *this,float param_2) { this->_height = param_2 + this->_height; return; } //@@ 00456440 Entity_Tear::FallingSpeed /* ZHL [lua] Lua binding EntityTear:FallingSpeed */ float10 __thiscall Entity_Tear::FallingSpeed(Entity_Tear *this) { return (float10)this->_fallingSpeed; } //@@ 00456450 Entity_Projectile::AddFallingSpeed /* ZHL [lua] Lua binding EntityProjectile:AddFallingSpeed */ void __thiscall Entity_Projectile::AddFallingSpeed(Entity_Projectile *this,float param_2) { this->_fallingSpeed = param_2 + this->_fallingSpeed; return; } //@@ 00456470 Entity_Projectile::AddFallingAccel /* ZHL [lua] Lua binding EntityProjectile:AddFallingAccel */ void __thiscall Entity_Projectile::AddFallingAccel(Entity_Projectile *this,float param_2) { this->_fallingAccel = param_2 + this->_fallingAccel; return; } //@@ 00456490 Entity_Projectile::AddProjectileFlags /* ZHL [lua] Lua binding EntityProjectile:AddProjectileFlags */ void __thiscall Entity_Projectile::AddProjectileFlags(Entity_Projectile *this,uint param_2,uint param_3) { uint *puVar1; *(uint *)&this->_projectileFlags = (uint)this->_projectileFlags | param_2; puVar1 = (uint *)((int)&this->_projectileFlags + 4); *puVar1 = *puVar1 | param_3; return; } //@@ 004564b0 Entity_Effect::FollowParent /* ZHL [lua] Lua binding EntityEffect:FollowParent prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Effect::FollowParent(Entity_Effect *this,Entity *parent) { EntityPtr *pEVar1; float fVar2; float fVar3; float fVar4; float fVar5; Entity_Effect *local_c [2]; pEVar1 = &this->_parent; local_c[0] = this; if (this->_parent != (EntityPtr)0x0) { local_c[0] = (Entity_Effect *)pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)parent; if (parent != (Entity *)0x0) { std::multiset::insert(pEVar1); } fVar2 = (this->_pos).x; fVar3 = (this->_pos).y; fVar4 = (parent->_pos).x; fVar5 = (parent->_pos).y; this->_isFollowing = 1; (this->_parentOffset).x = fVar2 - fVar4; (this->_parentOffset).y = fVar3 - fVar5; return; } //@@ 00456540 FUN_00456540 int FUN_00456540(void) { int iVar1; int in_ECX; int iVar2; iVar2 = *(int *)(in_ECX + 0xa8) + *(int *)(in_ECX + 0xac); iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } return iVar1; } //@@ 00456560 RoomDescriptor::PressurePlatesTriggered /* ZHL [lua] Lua binding RoomDescriptor:PressurePlatesTriggered */ uint __thiscall RoomDescriptor::PressurePlatesTriggered(RoomDescriptor *this) { return CONCAT31((uint3)((uint)this->Flags >> 9),(char)((uint)this->Flags >> 1)) & 0xffffff01; } //@@ 00456570 ShockwaveParams::ShockwaveParams /* DB: defaults (-150,0,0,0.01,0.1,0,5) passed to Room shockwave setter 0081df10 prototype: db/protos.zhl */ void __thiscall ShockwaveParams::ShockwaveParams(void *this) { *(undefined4 *)this = 0xc3160000; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 0x3c23d70a; *(undefined4 *)((int)this + 0x10) = 0x3dcccccd; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x18) = 5; return; } //@@ 004565b0 FUN_004565b0 undefined4 FUN_004565b0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x11ec); } //@@ 004565c0 Room::GetGridPath /* ZHL [lua] Lua binding Room:GetGridPath */ int __thiscall Room::GetGridPath(Room *this,uint param_2) { if (param_2 < 0x1c0) { return this->_gridPaths[param_2]; } return 0; } //@@ 004565e0 Room::SetGridPath /* DB: grid idx<448, writes room+0x76c[idx] if current <951; called (GetGridIndex,900) prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::SetGridPath(Room *this,int gridIndex,int value) { if (((uint)gridIndex < 0x1c0) && (this->_gridPaths[gridIndex] < 0x3b7)) { this->_gridPaths[gridIndex] = value; return 1; } return 0; } //@@ 00456620 Room::GetGridEntityFromPos /* ZHL [lua] Lua binding Room:GetGridEntityFromPos prototype: db/protos.zhl, confirmed by RET 4 */ GridEntity * __thiscall Room::GetGridEntityFromPos(Room *this,Vector *pos) { uint uVar1; int iVar2; int iVar3; iVar3 = (int)((pos->x - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar2 = (int)((pos->y - 120.0) / 40.0 + 0.5), iVar2 < 0)) || ((this->_gridHeight <= iVar2 || (uVar1 = this->_gridWidth * iVar2 + iVar3, 0x1bf < uVar1)))) { return (GridEntity *)0x0; } return this->_gridEntities[uVar1]; } //@@ 004566a0 Room::GetGridSize /* ZHL [lua] Lua binding Room:GetGridSize */ int __thiscall Room::GetGridSize(Room *this) { return this->_gridHeight * this->_gridWidth; } //@@ 004566b0 Room::GetAliveEnemiesCount /* ZHL [lua] Lua binding Room:GetAliveEnemiesCount prototype: db/protos.zhl, confirmed by RET 0 */ int __thiscall Room::GetAliveEnemiesCount(Room *this) { int iVar1; int iVar2; iVar2 = this->_aliveEnemyCount + *(int *)&this->field_0x12c4; iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } return iVar1; } //@@ 004566d0 Room::GetAliveBossesCount /* ZHL [lua] Lua binding Room:GetAliveBossesCount */ int Room::GetAliveBossesCount(void) { int iVar1; int in_ECX; int iVar2; iVar2 = *(int *)(in_ECX + 0x12c8) + *(int *)(in_ECX + 0x12cc); iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } return iVar1; } //@@ 004566f0 Room::EmitBloodFromWalls /* ZHL [lua] Lua binding Room:EmitBloodFromWalls */ void Room::EmitBloodFromWalls(undefined4 param_1,undefined4 param_2) { int in_ECX; *(undefined4 *)(in_ECX + 0x7214) = param_1; *(undefined4 *)(in_ECX + 0x7218) = param_2; return; } //@@ 00456710 Room::HasSlowDown /* ZHL [lua] Lua binding Room:HasSlowDown */ bool __thiscall Room::HasSlowDown(Room *this) { return 0 < this->_slowdownDuration; } //@@ 00456720 Room::SetSlowDown /* ZHL [lua] Lua binding Room:SetSlowDown */ void __thiscall Room::SetSlowDown(Room *this,int param_2) { int *piVar1; piVar1 = ¶m_2; if (param_2 <= this->_slowdownDuration) { piVar1 = &this->_slowdownDuration; } this->_slowdownDuration = *piVar1; return; } //@@ 00456740 PathFinder::GetEvadeMovementCountdown /* ZHL [lua] Lua binding PathFinder:GetEvadeMovementCountdown */ undefined4 PathFinder::GetEvadeMovementCountdown(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x73c); } //@@ 00456750 Seeds::HasSeedEffect /* ZHL [lua] Lua binding Seeds:HasSeedEffect prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Seeds::HasSeedEffect(Seeds *this,uint seedEffect) { undefined1 local_10 [8]; void *local_8; std::set::find_node(local_10,&seedEffect); if ((*(char *)((int)local_8 + 0xd) == '\0') && (*(int *)((int)local_8 + 0x10) <= (int)seedEffect)) { return local_8 != this->_seedEffects; } return 0; } //@@ 004567a0 Entity_NPC::Scale /* ZHL [lua] Lua binding EntityNPC:Scale */ float10 __thiscall Entity_NPC::Scale(Entity_NPC *this) { return (float10)this->_scale; } //@@ 004567b0 Entity::IsFriendly /* DB: flags & 0x20000000 (FLAG_FRIENDLY); tiny, ICF-foldable prototype: db/protos.zhl */ byte __thiscall Entity::IsFriendly(Entity *this) { if ((this->_flags & 0x20000000) == 0) { return 0; } return 1; } //@@ 004567d0 FUN_004567d0 bool FUN_004567d0(void) { int in_ECX; return *(int *)(in_ECX + 0xf1c) != -1; } //@@ 004567e0 Entity_NPC::ChildNPC /* ZHL [lua] Lua binding EntityNPC:ChildNPC prototype: db/protos.zhl, confirmed by RET 0 */ Entity_NPC * __thiscall Entity_NPC::ChildNPC(Entity_NPC *this) { int iVar1; EntityPtr EVar2; EVar2 = (EntityPtr)0x0; if (this->_child != (EntityPtr)0x0) { iVar1 = __RTDynamicCast(this->_child,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } EVar2 = this->_child; } return (Entity_NPC *)EVar2; } //@@ 00456820 FUN_00456820 void FUN_00456820(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x428) = in_XMM1_Da; return; } //@@ 00456830 FUN_00456830 void FUN_00456830(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int in_ECX; *(undefined4 *)(in_ECX + 0x428) = param_1; *(undefined4 *)(in_ECX + 0x42c) = param_2; *(undefined4 *)(in_ECX + 0x430) = param_3; *(undefined4 *)(in_ECX + 0x434) = param_4; return; } //@@ 00456850 Entity_Laser::SetHomingType /* ZHL [lua] Lua binding EntityLaser:SetHomingType */ void __thiscall Entity_Laser::SetHomingType(Entity_Laser *this,int param_2) { this->_homingType = param_2; return; } //@@ 00456860 Game::GetItemOverlay /* ZHL [lua] Lua binding Game:GetItemOverlay */ ItemOverlay * __thiscall Game::GetItemOverlay(Game *this) { return &this->_itemOverlay; } //@@ 00456870 GridEntity_Poop::ReduceSpawnRate /* ZHL [lua] Lua binding GridEntityPoop:ReduceSpawnRate */ void __thiscall GridEntity_Poop::ReduceSpawnRate(GridEntity_Poop *this) { (this->_desc)._varData = 1; return; } //@@ 00456880 FUN_00456880 int FUN_00456880(void) { int iVar1; uint3 uVar2; int in_ECX; int in_EDX; undefined1 *puVar3; undefined1 *puVar4; float in_XMM2_Da; iVar1 = *(int *)(in_ECX + 0x34); puVar3 = &DAT_bf800000; if (iVar1 == 0) { puVar4 = &DAT_bf800000; } else { puVar4 = *(undefined1 **)(in_ECX + 0x40); } uVar2 = (uint3)((uint)iVar1 >> 8); if ((float)puVar4 - in_XMM2_Da * *(float *)(in_ECX + 0x104) < (float)in_EDX) { if (iVar1 != 0) { puVar3 = *(undefined1 **)(in_ECX + 0x40); } if ((float)in_EDX <= (float)puVar3) { return CONCAT31(uVar2,1); } } return (uint)uVar2 << 8; } //@@ 004568d0 NpcAI::ENTITY_FLY_isaac_spawned /* DB: NpcAI::ENTITY_FLY branch for _spawnerType 0x66 (102 Isaac/??? boss) and subtype != 0: orbits the spawner (QuerySublist, radius 100/85, V1 direction) */ void __fastcall NpcAI::ENTITY_FLY_isaac_spawned(Entity_NPC *npc) { float fVar1; int iVar2; float fVar3; float fVar4; float fVar5; float fVar6; EntityList_EL local_48; float local_38; float local_34; float local_30; float local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1840; local_1c = ExceptionList; ExceptionList = &local_1c; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_48,0x66,-1,-1,1,0); if (local_48._size == 0) { npc->_spawnerType = 0; iVar2 = 3; npc->_subtype = 0; goto LAB_00456bfe; } local_28 = *(float *)(*(int *)local_48._data + 0x33c); local_2c = *(float *)(*(int *)local_48._data + 0x340); local_38 = local_28 - (npc->_pos).x; local_24 = local_2c - (npc->_pos).y; local_34 = local_38; fVar3 = sqrtf(local_38 * local_38 + local_24 * local_24); if (fVar3 <= 0.0) { fVar3 = local_24; local_34 = local_38; } else { local_38 = (1.0 / fVar3) * local_34; fVar3 = (1.0 / fVar3) * local_24; } local_24 = -local_24; fVar6 = -local_34; local_30 = 100.0; (npc->_targetPosition).x = fVar6; (npc->_targetPosition).y = local_24; local_34 = 10.0; if (npc->_subtype == 2) { fVar3 = fVar3 * -20.0; local_24 = -local_38 * -20.0 + local_24; local_30 = 85.0; local_34 = 6.0; (npc->_targetPosition).y = local_24; LAB_00456a87: (npc->_targetPosition).x = fVar3 + fVar6; } else if (npc->_subtype == 1) { fVar3 = fVar3 * 20.0; local_24 = -local_38 * 20.0 + (npc->_targetPosition).y; local_30 = 55.0; local_34 = 8.0; (npc->_targetPosition).y = local_24; goto LAB_00456a87; } local_38 = (npc->_targetPosition).x; fVar3 = sqrtf(local_38 * local_38 + local_24 * local_24); if (fVar3 <= 0.0) { fVar3 = local_38; } else { (npc->_targetPosition).y = (local_30 / fVar3) * local_24; fVar3 = (npc->_targetPosition).x * (local_30 / fVar3); } local_2c = local_2c + (npc->_targetPosition).y; (npc->_targetPosition).x = local_28 + fVar3; (npc->_targetPosition).y = local_2c; local_28 = (local_28 + fVar3) - (npc->_pos).x; local_2c = local_2c - (npc->_pos).y; fVar4 = sqrtf(local_28 * local_28 + local_2c * local_2c); fVar3 = local_28; fVar6 = local_2c; if ((local_34 < fVar4) && (0.0 < fVar4)) { fVar6 = local_2c * (local_34 / fVar4); fVar3 = local_28 * (local_34 / fVar4); } fVar4 = npc->_speedMultiplier; fVar5 = 0.39999998; if (fVar4 != 1.0) { fVar5 = 0.39999998 / ((fVar4 + 0.39999998) - fVar4 * 0.39999998); } fVar4 = (npc->_velocity).y; fVar1 = (npc->_velocity).x; iVar2 = 0; (npc->_velocity).y = fVar4 + (fVar6 - fVar4) * (1.0 - fVar5); (npc->_velocity).x = fVar1 + (fVar3 - fVar1) * (1.0 - fVar5); LAB_00456bfe: npc->_entityGridCollisionClass = iVar2; if (local_48._0_1_ == '\0') { local_14 = 0; tracked_alloc(1,local_48._data,0); } ExceptionList = local_1c; return; } //@@ 00456c40 NpcAI::ENTITY_FAMINE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 63 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FAMINE(Entity_NPC *npc) { byte bVar1; float *pfVar2; Entity *target; uint uVar3; int iVar4; ProjectileParams *params; byte *animNameChar; Vector *pVVar5; byte *pbVar6; int3 extraout_var; char *expectedAnimChar; void *pvVar7; int iVar8; int unused; bool bVar9; float fVar10; float fVar11; float fVar12; Vector randomDir; Vector local_118; Vector toTarget; Vector scratchVec; ProjectileParams projParams; std_string vertAnimName; std_string horiAnimName; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; float *posY; pvVar7 = ExceptionList; local_14 = 0xffffffff; puStack_18 = &LAB_00af24e5; local_1c = ExceptionList; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; posY = &(npc->_pos).y; npc->_entityGridCollisionClass = 3; local_118.y = 170.0; pfVar2 = &local_118.y; if (170.0 < *posY) { pfVar2 = posY; } iVar4 = npc->_state; *posY = *pfVar2; if (iVar4 == 0) { npc->_state = 4; ExceptionList = pvVar7; return; } npc->_friction = npc->_friction * 0.8; target = Entity_NPC::GetPlayerTarget(npc); toTarget.x = (target->_pos).x - (npc->_pos).x; toTarget.y = (target->_pos).y - (npc->_pos).y; if ((npc->_health / npc->_maxHitPoints < 0.33) && (npc->_state != 9)) { npc->_state = 9; uVar3 = Random(); Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); Entity::BloodExplode((Entity *)npc); ANM2::Play(&npc->_sprite,(byte *)"HeadWalk",0); ANM2::PlayOverlay(&npc->_sprite,(byte *)"Blood",0); (npc->_sprite)._overlayRenderFirst = 1; } pVVar5 = &npc->_pos; iVar4 = npc->_state; if (iVar4 == 9) { fVar10 = npc->_size; Room::GetClampedPositionImpl(g_game->_room,&scratchVec,pVVar5,fVar10,fVar10,fVar10,fVar10); pVVar5->x = scratchVec.x; (npc->_pos).y = scratchVec.y; iVar4 = npc->_state; if (iVar4 == 9) { npc->_entityGridCollisionClass = 3; bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar1 != 0) { uVar3 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3); } iVar4 = Entity::GetIntervalTicks ((Entity *)npc,7.0, (float)((double)npc->_index + __uint_to_double_fixup[-(npc->_index >> 0x1f)])); if (iVar4 != 0) { if (npc->_projectileCooldown < 1) { bVar1 = Entity_NPC::IsTargetInAttackRange(npc,300.0,0,0); if (bVar1 != 0) { npc->_projectileCooldown = 8; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"HeadAttack",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { npc->_projectileCooldown = npc->_projectileCooldown + -1; } } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00457050: pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { animNameChar = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { animNameChar = *(byte **)pbVar6; } expectedAnimChar = "HeadWalk"; do { bVar1 = *animNameChar; bVar9 = bVar1 < (byte)*expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_00457086: uVar3 = -(uint)bVar9 | 1; goto LAB_0045708b; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar9 = bVar1 < (byte)expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_00457086; animNameChar = animNameChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0045708b: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004570c2; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"HeadWalk",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x68,1.0,2,0,1.0); if (npc->_subtype == 1) { params = ProjectileParams::ProjectileParams(&projParams); target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; Entity_NPC::FireBossProjectiles(npc,10,&scratchVec,0.0,params); } else { params = ProjectileParams::ProjectileParams(&projParams); target = Entity_NPC::GetPlayerTarget(npc); local_118.y = (target->_pos).y - (npc->_pos).y; randomDir.y = (target->_pos).x - (npc->_pos).x; fVar10 = sqrtf(local_118.y * local_118.y + randomDir.y * randomDir.y); if (fVar10 <= 0.0) { scratchVec.x = randomDir.y; scratchVec.y = local_118.y; } else { scratchVec.y = (10.0 / fVar10) * local_118.y; scratchVec.x = (10.0 / fVar10) * randomDir.y; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,2,params); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_00457050; } LAB_004570c2: if (npc->_projectileCooldown < 1) { fVar10 = sqrtf(toTarget.x * toTarget.x + toTarget.y * toTarget.y); if (0.0 < fVar10) { toTarget.y = toTarget.y * (1.0 / fVar10); toTarget.x = toTarget.x * (1.0 / fVar10); } fVar10 = npc->_friction; if (fVar10 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).x = (toTarget.x * 0.5 * fVar11) / fVar10 + (npc->_velocity).x; (npc->_velocity).y = (toTarget.y * 0.5 * fVar11) / fVar10 + (npc->_velocity).y; } } goto LAB_004577cd; } } if (iVar4 == 4) { PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); vertAnimName._capacity = 0xf; vertAnimName._size = 9; builtin_strncpy(vertAnimName._buf,"FullFloat",10); horiAnimName._capacity = 0xf; horiAnimName._size = 9; builtin_strncpy(horiAnimName._buf,"FullFloat",10); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,&horiAnimName,&vertAnimName,1.0); local_14 = local_14 & 0xffffff00; if (0xf < horiAnimName._capacity) { uVar3 = horiAnimName._capacity + 1; pvVar7 = (void *)horiAnimName._buf._0_4_; if (0xfff < uVar3) { pvVar7 = *(void **)(horiAnimName._buf._0_4_ + -4); uVar3 = horiAnimName._capacity + 0x24; if (0x1f < (uint)(horiAnimName._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_0045726d; } operator_delete(pvVar7,uVar3); } local_14 = 0xffffffff; horiAnimName._size = 0; horiAnimName._capacity = 0xf; horiAnimName._buf._0_8_ = horiAnimName._buf._0_8_ & 0xffffffffffffff00; if (0xf < vertAnimName._capacity) { uVar3 = vertAnimName._capacity + 1; pvVar7 = (void *)vertAnimName._buf._0_4_; if (0xfff < uVar3) { pvVar7 = *(void **)(vertAnimName._buf._0_4_ + -4); uVar3 = vertAnimName._capacity + 0x24; if (0x1f < (uint)(vertAnimName._buf._0_4_ + (-4 - (int)pvVar7))) { LAB_0045726d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar3); } vertAnimName._size = 0; vertAnimName._capacity = 0xf; vertAnimName._buf._0_8_ = vertAnimName._buf._0_8_ & 0xffffffffffffff00; if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { uVar3 = Random(); if (uVar3 % 0x28 == 0) { iVar8 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar4 = 0; if (0 < iVar8) { iVar4 = iVar8; } if (iVar4 < 3) { npc->_state = 0xd; bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_stateFrame = 0; goto LAB_004577cd; } } if ((((ABS(toTarget.y) < 20.0) || ((npc->_subtype == 1 && (uVar3 = Random(), (uVar3 & 3) == 0)))) && (uVar3 = Random(), uVar3 % 5 == 0)) && (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 == 0)) { Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); (npc->_sprite)._flipX = toTarget.x < 0.0; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"AttackDashStart",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 8; npc->_stateFrame = 0; } } goto LAB_004577cd; } if (iVar4 == 0xd) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); if (npc->_subtype == 1) { params = ProjectileParams::ProjectileParams(&projParams); scratchVec.x = 8.0; scratchVec.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar5,&scratchVec,9,params); } else { bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar1 == 0) || (uVar3 = Entity::CountRelatedEntities((Entity *)npc,0xe,0,unused,(void *)0x0), uVar3 < 3)) { Entity_NPC::PlaySound(npc,0x109,0.8,2,0,1.0); uVar3 = Random(); pVVar5 = MusicManager::RandomVector(&randomDir); local_118.x = pVVar5->x * 50.0 + (npc->_pos).x; local_118.y = pVVar5->y * 50.0 + (npc->_pos).y; Game::Spawn(g_game,0xe,0,&local_118,&g_vectorZero,(Entity *)npc,0,uVar3); } } goto LAB_004577cd; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004577cd; } } else { if (iVar4 != 8) goto LAB_004577cd; npc->_entityGridCollisionClass = 2; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"AttackDash",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_004575a9; goto LAB_004575ed; } } else { LAB_004575a9: pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } expectedAnimChar = "AttackDash"; do { bVar1 = *pbVar6; bVar9 = bVar1 < (byte)*expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_004575e4: uVar3 = -(uint)bVar9 | 1; goto LAB_004575e9; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar9 = bVar1 < (byte)expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_004575e4; pbVar6 = pbVar6 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004575e9: if (uVar3 == 0) { LAB_00457662: if ((npc->_sprite)._flipX == 0) { fVar10 = 18.0; } else { fVar10 = -18.0; } (npc->_velocity).x = fVar10; bVar1 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar1) != 0 && -1 < extraout_var) { (npc->_velocity).x = fVar10 * 1.25; } if (npc->_subtype == 1) { fVar12 = -toTarget.y / 100.0; fVar10 = (npc->_velocity).y; fVar11 = npc->_speedMultiplier; if (fVar12 <= 0.4) { if (fVar12 < -0.4) { (npc->_velocity).y = (fVar11 * 0.4) / npc->_friction + fVar10; goto LAB_0045771d; } fVar11 = fVar11 * fVar12; } else { fVar11 = fVar11 * 0.4; } (npc->_velocity).y = fVar10 - fVar11 / npc->_friction; } } else { LAB_004575ed: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } expectedAnimChar = "AttackDashStart"; do { bVar1 = *pbVar6; bVar9 = bVar1 < (byte)*expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_00457640: uVar3 = -(uint)bVar9 | 1; goto LAB_00457645; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar9 = bVar1 < (byte)expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_00457640; pbVar6 = pbVar6 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00457645: if ((uVar3 == 0) && (bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"), bVar1 != 0)) goto LAB_00457662; } } } LAB_0045771d: fVar10 = (npc->_velocity).x; if ((fVar10 <= 0.0) || (pVVar5->x <= *(float *)((int)g_game->_room + 0x1c) + 200.0)) { if ((fVar10 < 0.0) && (fVar11 = *(float *)((int)g_game->_room + 0x14) - 200.0, pVVar5->x <= fVar11 && fVar11 != pVVar5->x)) { fVar11 = *(float *)((int)g_game->_room + 0x1c) + 80.0; goto LAB_0045778c; } } else { fVar11 = *(float *)((int)g_game->_room + 0x14) - 80.0; LAB_0045778c: npc->_stateFrame = npc->_stateFrame + 1; pVVar5->x = fVar11; } if ((npc->_stateFrame < 1) || (((0.0 <= fVar10 || (fVar11 = (npc->_targetPosition).x, fVar11 < pVVar5->x || fVar11 == pVVar5->x)) && ((fVar10 <= 0.0 || (pVVar5->x < (npc->_targetPosition).x || pVVar5->x == (npc->_targetPosition).x)))))) goto LAB_004577cd; } npc->_state = 4; LAB_004577cd: if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (fVar10 = (npc->_pos).y, fVar10 < 320.0)) { fVar11 = (npc->_velocity).y; (npc->_velocity).y = ((320.0 - fVar10) - fVar11) * 0.5 + fVar11; } ExceptionList = local_1c; return; } //@@ 00457840 NpcAI::ENTITY_PESTILENCE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 64 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PESTILENCE(Entity_NPC *npc) { code *pcVar1; Vector targetPos; Manager *pMVar2; byte bVar3; uint uVar4; uint angleRng; Entity *tmpEntity; int *piVar5; LayerState *headLayer; int iVar6; int iVar7; Entity_NPC *pEVar8; Vector *pVVar9; int triteCount; Vector *pVVar10; ProjectileParams *params; Entity_Projectile *projectile; void *pvVar11; int unused; int unused_00; int unused_01; int unused_02; int unused_03; int unused_04; int unused_05; int unused_06; int unused_07; int unused_08; int iVar12; Entity_NPC *minionCount; float fVar13; bool bVar14; bool bVar15; bool bVar16; float fVar17; undefined4 uVar18; TypeDescriptor *pTVar19; TypeDescriptor *pTVar20; char *anim; undefined4 uVar21; Vector throwOffsetDir; Vector spawnOffsetDir; undefined4 local_240 [11]; Vector burstPos; Vector burstVelocity; Vector local_204; Vector local_1fc; Vector local_1f4; Vector local_1ec; float local_1e4; float local_1e0; Vector local_1dc; char isUnderSpawnCap; ProjectileParams bigShotParams; ProjectileParams burstParams; undefined4 local_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 local_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; void *walkAnimV; char local_50; uint walkAnimVSize; uint walkAnimVCapacity; void *walkAnimH; char local_38; uint walkAnimHSize; uint walkAnimHCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af2525; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; if (npc->_state == 0) { npc->_state = 4; if (npc->_subtype != 1) { return; } if (&npc->_splatColor == (ColorMod *)local_240) { return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = -0.19607845; (npc->_splatColor)._offset[1] = 0.50980395; (npc->_splatColor)._tint[0] = 0.5; (npc->_splatColor)._tint[1] = 0.5; (npc->_splatColor)._tint[2] = 0.5; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.19607845; return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; local_1ec.y = (float)npc; bVar3 = Entity::IsFrame((Entity *)npc,3,0); if ((bVar3 != 0) && (npc->_subtype == 0)) { uVar4 = Random(); local_1f4.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.4; uVar4 = Random(); angleRng = Random(); fVar17 = (float)((double)(int)angleRng + __uint_to_double_fixup[-((int)angleRng >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1dc.y = fVar17 + fVar17; local_1e0 = sin(local_1dc.y); fVar17 = cos(local_1dc.y); uVar21 = 0; local_1fc.x = fVar17 * 20.0 + (npc->_pos).x; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_1fc.y = local_1e0 * 20.0 + (npc->_pos).y; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; tmpEntity = Game::Spawn(g_game,1000,7,&local_1fc,&g_vectorZero,(Entity *)npc,0,uVar4); piVar5 = (int *)__RTDynamicCast(tmpEntity,uVar18,pTVar19,pTVar20,uVar21); pcVar1 = *(code **)(*piVar5 + 0x3c); piVar5[0x39] = (int)local_1f4.y; piVar5[0x3a] = (int)local_1f4.y; (*pcVar1)(&npc->_splatColor,0xffffffff,0xff,0,1); (**(code **)(*piVar5 + 0xc))(); } if ((npc->_i1 == 0) && (npc->_health / npc->_maxHitPoints < 0.5)) { npc->_i1 = 1; uVar4 = Random(); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); local_1fc.x = (npc->_pos).x + (headLayer->_pos).x; local_1fc.y = (headLayer->_pos).y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,1,&local_1fc,&g_vectorZero,(Entity *)npc,0,uVar4); Entity::BloodExplode((Entity *)npc); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); headLayer->_visible = 0; (**(code **)(*(int *)tmpEntity + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; } bVar3 = Entity::IsFrame((Entity *)npc,7,0); if (bVar3 != 0) { uVar4 = Random(); uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; tmpEntity = Game::Spawn(g_game,1000,(uint)(npc->_subtype != 0) * 2 + 0x17,&npc->_pos, &g_vectorZero,(Entity *)npc,0,uVar4); piVar5 = (int *)__RTDynamicCast(tmpEntity,uVar18,pTVar19,pTVar20,uVar21); fVar17 = g_vectorOne.y * 2.0; piVar5[0x39] = (int)(g_vectorOne.x * 2.0); piVar5[0x3a] = (int)fVar17; (**(code **)(*piVar5 + 0xc))(); } iVar12 = 3; if ((npc->_flags & 0x1000000000000000) == 0) { iVar12 = 4; } local_1e0 = (float)iVar12; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1f4.y = (tmpEntity->_pos).x - (npc->_pos).x; local_1dc.y = (tmpEntity->_pos).y - (npc->_pos).y; if (npc->_i1 == 0) { iVar6 = npc->_state; if (iVar6 != 4) { if (iVar6 == 0xd) { iVar7 = npc->_stateFrame; iVar6 = iVar7 + 1; npc->_stateFrame = iVar6; if (iVar7 == 0x19) { Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x109,1.2,2,0,1.0); pVVar9 = MusicManager::RandomVector(&local_204); local_1ec.y = 2.8026e-45; local_1f4.y = pVVar9->x * 10.0; local_1e0 = pVVar9->y * 10.0; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 == 0) { fVar17 = 2.8026e-45; } else { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x17,0,unused_02,(void *)0x0); iVar7 = Entity::CountRelatedEntities((Entity *)npc,0x1f,0,unused_03,(void *)0x0); triteCount = Entity::CountRelatedEntities((Entity *)npc,0x1d,1,unused_04,(void *)0x0); fVar13 = (float)(((iVar12 - iVar6) - iVar7) - triteCount); fVar17 = 2.8026e-45; if ((int)fVar13 < 3) { fVar17 = fVar13; } local_1ec.y = fVar17; } if (npc->_subtype == 0) { uVar4 = Random(); local_1dc.y = (float)((uVar4 & 1) << 3 | 0x17); if (0 < (int)local_1ec.y) { uVar4 = Random(); local_1fc.x = local_1f4.y + (npc->_pos).x; local_1fc.y = local_1e0 + (npc->_pos).y; Game::Spawn(g_game,(uint)local_1dc.y,0,&local_1fc,&g_vectorZero,(Entity *)npc,0,uVar4) ; } if (1 < (int)local_1ec.y) { uVar4 = Random(); local_1ec.x = (npc->_pos).x - local_1f4.y; local_1ec.y = (npc->_pos).y - local_1e0; Game::Spawn(g_game,(uint)local_1dc.y,0,&local_1ec,&g_vectorZero,(Entity *)npc,0,uVar4) ; } } else if (0 < (int)fVar17) { uVar4 = Random(); local_1dc.x = local_1f4.y + (npc->_pos).x; local_1dc.y = local_1e0 + (npc->_pos).y; Game::Spawn(g_game,0x1d,1,&local_1dc,&g_vectorZero,(Entity *)npc,0,uVar4); } goto LAB_004587f9; } LAB_0045813e: bVar16 = SBORROW4(iVar6,0x39); bVar15 = iVar6 + -0x39 < 0; bVar14 = iVar6 == 0x39; } else { if (iVar6 != 8) goto LAB_004587f9; iVar6 = npc->_stateFrame; iVar12 = iVar6 + 1; npc->_stateFrame = iVar12; if (iVar6 == 0x16) { LAB_004585eb: pMVar2 = g_manager; local_1e0 = 1.0; if (npc->_championColorIdx == 0x12) { local_1e0 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_1e0 = 0.5; } local_1dc.y = 1.45735e-43; seed_fart_sound_override((int *)&local_1dc.y); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_1dc.y,1.0,2,0,local_1e0,0.0); if (npc->_subtype == 0) { params = ProjectileParams::ProjectileParams(&bigShotParams); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1e4 = (tmpEntity->_pos).x; local_1e0 = (tmpEntity->_pos).y; projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_1e4,10.0,params); fVar17 = projectile->_fallingAccel; uVar18 = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 6; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = uVar18; projectile->_scale = 1.6; projectile->_fallingAccel = fVar17 - 0.3; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 13.0; local_80 = 0x3f800000; uStack_7c = 0x3f800000; uStack_78 = 0x3f800000; uStack_74 = 0x3f800000; local_60 = 0; local_5c = 0; local_58 = 0; local_70 = 0x3ecccccd; uStack_6c = 0x40000000; uStack_68 = 0x3f000000; uStack_64 = 0x3f800000; (**(code **)(*(int *)projectile + 0x3c))(&local_80,0xffffffff,0xff,0,1); } else { ProjectileParams::ProjectileParams(&burstParams); burstParams.Color._colorize[0] = 3.0; burstParams.Color._colorize[1] = 3.0; burstParams.Color._colorize[2] = 3.0; burstParams.Color._colorize[3] = 1.0; burstParams.Color._offset[0] = 0.19607845; burstPos.x = (npc->_pos).x + 0.0; burstParams.Color._offset[1] = 0.19607845; burstParams.Color._offset[2] = 0.19607845; burstPos.y = (npc->_pos).y - 30.0; burstVelocity.x = 8.0; burstVelocity.y = 6.0; Entity_NPC::FireProjectiles(npc,&burstPos,&burstVelocity,9,&burstParams); } goto LAB_004587f9; } bVar16 = SBORROW4(iVar12,0x28); bVar15 = iVar6 + -0x27 < 0; bVar14 = iVar12 == 0x28; } LAB_004585d6: if (!bVar14 && bVar16 == bVar15) { npc->_state = 4; } goto LAB_004587f9; } PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); walkAnimVCapacity = 0xf; walkAnimVSize = 4; walkAnimV = (void *)0x6b6c6157; local_50 = '\0'; walkAnimHCapacity = 0xf; walkAnimHSize = 4; walkAnimH = (void *)0x6b6c6157; local_38 = '\0'; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimH,(std_string *)&walkAnimV,3.0); local_14 = local_14 & 0xffffff00; if (0xf < walkAnimHCapacity) { uVar4 = walkAnimHCapacity + 1; pvVar11 = walkAnimH; if (0xfff < uVar4) { pvVar11 = *(void **)((int)walkAnimH + -4); uVar4 = walkAnimHCapacity + 0x24; if (0x1f < (uint)((int)walkAnimH + (-4 - (int)pvVar11))) goto LAB_00457d6c; } operator_delete(pvVar11,uVar4); } local_14 = 0xffffffff; walkAnimHSize = 0; walkAnimHCapacity = 0xf; walkAnimH = (void *)((uint)walkAnimH & 0xffffff00); if (0xf < walkAnimVCapacity) { uVar4 = walkAnimVCapacity + 1; pvVar11 = walkAnimV; if (0xfff < uVar4) { pvVar11 = *(void **)((int)walkAnimV + -4); uVar4 = walkAnimVCapacity + 0x24; if (0x1f < (uint)((int)walkAnimV + (-4 - (int)pvVar11))) { LAB_00457d6c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar4); } walkAnimVSize = 0; walkAnimVCapacity = 0xf; walkAnimV = (void *)((uint)walkAnimV & 0xffffff00); if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) goto LAB_004587f9; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 == 0) { pEVar8 = (Entity_NPC *) (*(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4)); minionCount = (Entity_NPC *)0x0; if (0 < (int)pEVar8) { minionCount = pEVar8; } } else { iVar12 = Entity::CountRelatedEntities((Entity *)npc,0x1f,0,unused,(void *)0x0); iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x1d,1,unused_00,(void *)0x0); iVar7 = Entity::CountRelatedEntities((Entity *)npc,0x17,0,unused_01,(void *)0x0); local_1ec.y = (float)(iVar7 + iVar12 + iVar6); minionCount = (Entity_NPC *)local_1ec.y; } uVar4 = Random(); if ((uVar4 % 0x28 == 0) && ((int)minionCount < (int)local_1e0)) { anim = (char *)s_Attack2; goto LAB_00457e45; } uVar4 = Random(); if ((uVar4 % 0x14 != 0) || (fVar17 = sqrtf(local_1dc.y * local_1dc.y + local_1f4.y * local_1f4.y), 230.0 <= fVar17)) goto LAB_004587f9; npc->_state = 8; npc->_stateFrame = 0; (npc->_sprite)._flipX = local_1f4.y < 0.0; anim = (char *)s_Attack1; } else { if (npc->_i1 != 1) goto LAB_004587f9; iVar6 = npc->_state; if (iVar6 != 4) { if (iVar6 == 0xd) { iVar7 = npc->_stateFrame; iVar6 = iVar7 + 1; npc->_stateFrame = iVar6; if ((iVar7 == 0x19) && (npc->_subtype == 0)) { local_1e0 = 2.8026e-45; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x12,0,unused_08,(void *)0x0); local_1e0 = (float)2; if (iVar12 - iVar6 < 3) { local_1e0 = (float)(iVar12 - iVar6); } } Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); pVVar9 = &local_1dc; if ((npc->_sprite)._flipX == 0) { local_1fc.x = 40.0; local_1fc.y = 0.0; pVVar9 = &local_1fc; } else { local_1dc.x = -40.0; local_1dc.y = 0.0; } pVVar10 = MusicManager::RandomVector(&spawnOffsetDir); local_1f4.y = pVVar10->x * 10.0 + pVVar9->x; local_1ec.y = pVVar10->y * 10.0 + pVVar9->y; iVar12 = 0; if (0 < (int)local_1e0) { do { if (iVar12 == 0) { local_1dc.y = 1.0; } else { local_1dc.y = (float)&DAT_bf800000; } uVar4 = Random(); uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_204.x = local_1f4.y * local_1dc.y + (npc->_pos).x; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; local_204.y = local_1ec.y * local_1dc.y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,0x12,0,&local_204,&g_vectorZero,(Entity *)npc,0,uVar4); iVar6 = __RTDynamicCast(tmpEntity,uVar18,pTVar19,pTVar20,uVar21); iVar12 = iVar12 + 1; *(uint *)(iVar6 + 0x168) = *(uint *)(iVar6 + 0x168) & 0xfffffffb; *(undefined1 *)(iVar6 + 0x174) = 1; *(undefined4 *)(iVar6 + 0x16c) = *(undefined4 *)(iVar6 + 0x16c); } while (iVar12 < (int)local_1e0); } goto LAB_004587f9; } if ((iVar6 == 0x13) && (npc->_subtype == 1)) { Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); pVVar9 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_1f4,&npc->_pos,70.0,0,0,0) ; pVVar10 = MusicManager::RandomVector(&throwOffsetDir); uVar4 = Random(); npc = (Entity_NPC *)local_1ec.y; fVar17 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_1dc.y = fVar17 * pVVar10->y * 10.0 + pVVar9->y; local_1dc.x = fVar17 * pVVar10->x * 10.0 + pVVar9->x; targetPos.y = local_1dc.y; targetPos.x = local_1dc.x; Entity_NPC::ThrowSpider ((Vector *)((int)local_1ec.y + 0x33c),(Entity *)local_1ec.y,targetPos,0,-30.0); goto LAB_004587f9; } goto LAB_0045813e; } if (iVar6 != 8) goto LAB_004587f9; iVar6 = npc->_stateFrame; iVar12 = iVar6 + 1; npc->_stateFrame = iVar12; if (iVar6 == 9) goto LAB_004585eb; bVar16 = SBORROW4(iVar12,0x1d); bVar15 = iVar6 + -0x1c < 0; bVar14 = iVar12 == 0x1d; goto LAB_004585d6; } PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar3 != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) goto LAB_004587f9; iVar7 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar6 = 0; if (0 < iVar7) { iVar6 = iVar7; } isUnderSpawnCap = iVar6 < iVar12; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { if (npc->_subtype == 0) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x12,0,unused_05,(void *)0x0); bVar14 = SBORROW4(iVar6,iVar12); iVar6 = iVar6 - iVar12; } else { if (npc->_subtype != 1) goto LAB_00458255; iVar12 = Entity::CountRelatedEntities((Entity *)npc,0x32e,0,unused_05,(void *)0x0); iVar7 = Entity::CountRelatedEntities((Entity *)npc,0x5e,0,unused_06,(void *)0x0); iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused_07,(void *)0x0); iVar6 = iVar6 + iVar12 + iVar7; bVar14 = SBORROW4(iVar6,(int)local_1e0); iVar6 = iVar6 - (int)local_1e0; } isUnderSpawnCap = bVar14 != iVar6 < 0; } LAB_00458255: uVar4 = Random(); if ((uVar4 % 0x28 == 0) && (isUnderSpawnCap != '\0')) { anim = "HeadlessAttack2"; LAB_00457e45: npc->_state = 0xd; } else { uVar4 = Random(); if ((uVar4 % 0x14 != 0) || (fVar17 = sqrtf(local_1dc.y * local_1dc.y + local_1f4.y * local_1f4.y), 230.0 <= fVar17)) goto LAB_004587f9; npc->_state = 8; anim = "HeadlessAttack1"; } npc->_stateFrame = 0; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)anim,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004587f9: if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (fVar17 = (npc->_pos).y, fVar17 < 320.0)) { fVar13 = (npc->_velocity).y; (npc->_velocity).y = ((320.0 - fVar17) - fVar13) * 0.5 + fVar13; } ExceptionList = local_1c; return; } //@@ 00458870 NpcAI::ENTITY_WAR /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 65 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WAR(Entity_NPC *npc) { double dVar1; int iVar2; char *pcVar3; byte bVar4; uint uVar5; Entity *pEVar6; Vector *pVVar7; Vector *pVVar8; int3 extraout_var; int3 extraout_var_00; int3 extraout_var_01; char extraout_CL; Vector *pVVar9; int iVar10; void *pvVar11; uint mode; byte *literalCursor; bool isLess; float fVar12; float fVar13; uint variant; byte *literalCursor; Vector local_140; float local_138; Vector *local_134; float local_130; Vector local_12c; float local_124; float local_120; float local_11c; Entity_NPC *local_118; char isWrappedAround; ProjectileParams projParams; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; void *local_54; float local_50; float local_4c; float local_48; uint local_44; uint local_40; void *local_3c; uint local_38; char local_34 [4]; void *local_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Room *room; pvVar11 = ExceptionList; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af257d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; if (npc->_state == 0) { npc->_state = 4; npc->_i1 = 0; npc->_stateFrame = 0; npc->_aiFloat = 0.5; if (npc->_variant == 1) { npc->_groupIdx = npc->_index; ExceptionList = pvVar11; return; } ExceptionList = pvVar11; return; } local_24 = uVar5; if (npc->_variant == 0) { local_118 = (Entity_NPC *)npc->_maxHitPoints; pcVar3 = local_34 + 0x30; if (npc->_health / (float)local_118 < 0.5) { puStack_20 = local_34 + 0x30; uVar5 = Random(); Game::Spawn(g_game,1000,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); Entity_NPC::Morph(npc,npc->_type,10,npc->_subtype,-1); if ((npc->_flags & 0x1000000000000000) != 0) { ANM2::LoadDeliriumForm(&npc->_sprite,npc->_type,npc->_variant,1); npc->_maxHitPoints = (float)local_118; } npc->_stateFrame = 0; npc->_aiFloat = 0.5; npc->_state = 8; bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1dd24,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3ee,1.0,2,0,1.0); pcVar3 = puStack_20; } } else { pcVar3 = local_34 + 0x30; if (((npc->_variant == 1) && (pcVar3 = local_34 + 0x30, 0.0 < npc->_pendingDamage)) && (pcVar3 = local_34 + 0x30, (npc->_pendingDamageFlags & 0x100) == 0)) { Entity_NPC::QueryNPCsGroup((EntityList *)local_34,npc->_groupIdx); local_14 = 0; fVar13 = 0.0; fVar12 = local_2c.y; if (local_2c.y != 0.0) { do { local_118 = *(Entity_NPC **)((int)local_30 + (int)fVar13 * 4); if (local_118 != npc) { local_50 = g_vectorZero.y; local_48 = g_vectorZero.y; local_54 = (void *)g_vectorZero.x; local_4c = g_vectorZero.x; local_64 = 0; local_60 = 0; local_5c = 0; local_58 = 0; local_44 = 0; local_40 = 0; (**(code **)(*(int *)local_118 + 0x20)) (npc->_pendingDamage,0x100,0,&local_64,0x1e,uVar5); fVar12 = local_2c.y; } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)fVar12); } local_14 = 0xffffffff; pcVar3 = puStack_20; if (local_34[0] == '\0') { local_14 = 1; tracked_alloc(1,local_30,0); local_14 = 0xffffffff; pcVar3 = puStack_20; } } } puStack_20 = pcVar3; pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar12 = (npc->_pos).x; pVVar8 = &npc->_pos; iVar10 = npc->_state; local_134 = pVVar8; pvVar11 = g_game->_room; local_11c = (pEVar6->_pos).x - fVar12; local_124 = (pEVar6->_pos).y - (npc->_pos).y; local_130 = *(float *)((int)pvVar11 + 0x14); local_120 = *(float *)((int)pvVar11 + 0x18); local_140.y = *(float *)((int)pvVar11 + 0x18); local_118 = *(Entity_NPC **)((int)pvVar11 + 0x1c); local_140.x = local_130; local_2c.x = (float)local_118; local_12c.y = *(float *)((int)pvVar11 + 0x20); local_2c.y = *(float *)((int)pvVar11 + 0x20); if (iVar10 != 9) { pVVar9 = &local_140; if (local_130 < fVar12) { pVVar9 = pVVar8; } pVVar7 = &local_2c; if (pVVar9->x <= (float)local_118 && (float)local_118 != pVVar9->x) { pVVar7 = pVVar9; } pVVar8->x = pVVar7->x; } iVar2 = npc->_variant; if (iVar2 == 10) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; if (iVar10 != 4) { if (iVar10 == 8) { iVar10 = npc->_stateFrame + 1; npc->_stateFrame = iVar10; (npc->_v1).x = npc->_health; npc->_aiFloat = 0.5; if (iVar10 < 0x29) { if ((iVar10 == 3) && (npc->_subtype == 1)) { ProjectileParams::ProjectileParams(&projParams); bVar4 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar4) == 0 || extraout_var < 0) { local_2c.x = 10.0; } else { local_2c.x = 12.0; } local_2c.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar8,&local_2c,9,&projParams); Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); } } else { npc->_state = 4; npc->_stateFrame = 0; } } goto LAB_00459cb6; } local_40 = 0xf; local_44 = 8; local_54 = (void *)0x6b6c6157; local_50 = (float)0x74726556; local_4c = (float)((uint)local_4c & 0xffffff00); local_2c.y = 2.10195e-44; local_2c.x = 1.12104e-44; local_3c = (void *)0x6b6c6157; local_38._0_1_ = 'H'; local_38._1_1_ = 'o'; local_38._2_1_ = 'r'; local_38._3_1_ = 'i'; local_34[0] = '\0'; local_14 = 3; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)&local_54,2.0); local_14._0_1_ = 2; if (0xf < (uint)local_2c.y) { uVar5 = (int)local_2c.y + 1; pvVar11 = local_3c; if (0xfff < uVar5) { pvVar11 = *(void **)((int)local_3c + -4); uVar5 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_00458cdf; } operator_delete(pvVar11,uVar5); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar5 = local_40 + 1; pvVar11 = local_54; if (0xfff < uVar5) { pvVar11 = *(void **)((int)local_54 + -4); uVar5 = local_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar11))) { LAB_00458cdf: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar5); } local_118 = (Entity_NPC *)((npc->_aiFloat + 0.1) * 0.955); npc->_aiFloat = (float)local_118; npc->_friction = ((float)local_118 * 0.1 + 1.0) * npc->_friction; pVVar8 = Entity_NPC::CalcTargetPosition(npc,&local_2c,0.0); PathFinder::FindGridPath ((PathFinder *)&npc->_pathfinder,pVVar8,(float)local_118 * 0.4 + 0.5,900,1); iVar10 = npc->_stateFrame; fVar12 = npc->_health; npc->_stateFrame = iVar10 + 1; if (iVar10 < 10) { (npc->_v1).x = fVar12; fVar13 = fVar12; } else { fVar13 = (npc->_v1).x; } if ((fVar12 + 85.0) - npc->_aiFloat * 5.0 < fVar13) { npc->_stateFrame = 0; npc->_state = 8; bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1dd24,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3ee,1.0,2,0,1.0); } goto LAB_00459cb6; } npc->_entityGridCollisionClass = 3; if (iVar10 != 4) { if (iVar10 == 8) { iVar2 = npc->_stateFrame; iVar10 = iVar2 + 1; npc->_stateFrame = iVar10; if (iVar2 == 5) { ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = -45.0; projParams.FallingSpeedModifier = 7.0; if (npc->_variant == 1) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; projParams.Scale = 1.5; } bVar4 = Game::IsHardMode(); if (CONCAT31(extraout_var_00,bVar4) == 0 || extraout_var_00 < 0) { local_2c.x = 10.0; } else { local_2c.x = 12.0; } local_2c.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar8,&local_2c,mode,&projParams); Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); } else if (0x26 < iVar10) { npc->_state = 4; } goto LAB_00459cb6; } if (iVar10 == 6) { iVar10 = npc->_stateFrame; local_124 = (float)(iVar10 + 1); npc->_stateFrame = (int)local_124; if (0x14 < (int)local_124) { npc->_entityCollisionClass = 0; npc->_shadowSize = 0.0; } if (iVar2 == 1) { local_11c = 2.10195e-44; } else { local_11c = 2.8026e-45; if (npc->_subtype == 0) { local_11c = 7.00649e-45; } } if (((-1 < iVar10 + -0x20) && (local_120 = (float)((iVar10 + -0x20) / 5), iVar10 + -0x20 == (int)local_120 * 5)) && ((int)local_120 < (int)local_11c)) { room = g_game->_room; if (npc->_variant == 1) { pVVar8 = Room::GetRandomPosition(room,&local_2c,20.0); pVVar8 = Room::FindFreePickupSpawnPosition(room,&local_140,pVVar8,0.0,0,0,0); local_12c.x = pVVar8->x; local_12c.y = pVVar8->y; pVVar8 = MusicManager::RandomVector(&local_2c); uVar5 = Random(); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_12c.y = pVVar8->y * fVar12 * 20.0 + local_12c.y; local_12c.x = fVar12 * pVVar8->x * 20.0 + local_12c.x; if (((int)local_120 + 1) % 5 == 0) { room = g_game->_room; pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar12 = (float)*(EntityPtr *)&local_134->y - (pEVar6->_pos).y; fVar13 = local_134->x - (pEVar6->_pos).x; fVar12 = sqrtf(fVar12 * fVar12 + fVar13 * fVar13); local_2c.y = fVar12 * 0.2 * (pEVar6->_velocity).y + (pEVar6->_pos).y; local_2c.x = fVar12 * 0.2 * (pEVar6->_velocity).x + (pEVar6->_pos).x; Room::GetClampedPositionImpl(room,&local_140,&local_2c,20.0,20.0,20.0,20.0); local_12c.x = local_140.x; local_12c.y = local_140.y; } uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x13,&local_12c,&g_vectorZero,(Entity *)npc,2,uVar5); local_138 = -g_vectorOne.x; local_134 = (Vector *)((uint)g_vectorOne.y ^ 0x80000000); Entity::SetSize(pEVar6,10.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); (**(code **)(*(int *)pEVar6 + 0xc))(); } else { pVVar8 = Room::get_random_pickup_position(room,&local_2c,0,0); local_12c.x = pVVar8->x; local_12c.y = pVVar8->y; if (npc->_subtype == 0) { uVar5 = Random(); variant = 3; } else { uVar5 = Random(); variant = 4; } Game::Spawn(g_game,4,variant,&local_12c,&g_vectorZero,(Entity *)npc,0,uVar5); } room = g_game->_room; iVar10 = Room::GetGridIndex(room,&local_12c); Room::SetGridPath(room,iVar10,900); local_124 = (float)npc->_stateFrame; } if ((int)local_11c * 5 + 0x71 < (int)local_124) { npc->_entityCollisionClass = 4; fVar12 = *(float *)((int)npc->_config + 0x24); npc->_state = 9; npc->_entityGridCollisionClass = 2; npc->_shadowSize = fVar12; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_stateFrame = 0; pEVar6 = Entity_NPC::GetPlayerTarget(npc); if ((pEVar6->_pos).x <= 320.0) { (npc->_pos).x = (float)local_118 + 200.0; (npc->_sprite)._flipX = 1; } else { (npc->_pos).x = local_130 - 200.0; (npc->_sprite)._flipX = 0; } } goto LAB_00459cb6; } if (iVar10 != 9) goto LAB_00459cb6; npc->_entityGridCollisionClass = 2; if (((iVar2 == 1) && (iVar10 = Entity::GetIntervalTicks((Entity *)npc,8.0,0.0), iVar10 != 0)) && ((npc->_spawnerType != npc->_type && (npc->_stateFrame == 2)))) { Entity_NPC::PlaySound(npc,0x77,0.6,2,0,1.0); if ((npc->_velocity).x <= 0.0) { local_130 = (float)local_118 + 200.0; } else { local_130 = local_130 - 200.0; } local_134 = (Vector *)((local_12c.y - local_120) * 0.5); uVar5 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; iVar10 = npc->_i2; npc->_i2 = iVar10 + 1; local_118 = (Entity_NPC *) ((float)(iVar10 % 3) * (float)local_134 * 0.5 + (float)((double)(int)uVar5 + dVar1) * 2.3283064e-10 * (float)local_134 + local_120 + 40.0); if (*(int *)((int)g_game->_room + 0x1bb0) == 0x37) { uVar5 = Random(); local_118 = (Entity_NPC *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * ((local_12c.y - 320.0) - 80.0) + 360.0); } uVar5 = Random(); local_2c.x = local_130; local_2c.y = (float)local_118; pEVar6 = Game::Spawn(g_game,npc->_type,npc->_variant,&local_2c,&g_vectorZero,(Entity *)npc,0, uVar5); pEVar6[2]._posOffset.x = (float)npc->_state; *(undefined4 *)&pEVar6[1].field_0x4 = 3; (pEVar6->_sprite)._flipX = (npc->_sprite)._flipX; if (*(int *)&(pEVar6->_parent).field_0x0 != 0) { local_134 = (Vector *)&pEVar6->_parent; std::multiset::erase(&local_134); } pEVar6->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar6->_parent); fVar12 = npc->_health; *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags | 0x80000000; pEVar6->_health = fVar12; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); pEVar6->_entityGridCollisionClass = 0; pEVar6[3]._sprite._filename._size = npc->_groupIdx; (**(code **)(*(int *)pEVar6 + 0xc))(); } game = g_game; pVVar8 = &npc->_pos; isWrappedAround = '\0'; if ((npc->_sprite)._flipX == 0) { (npc->_velocity).x = 18.0; pvVar11 = game->_room; if (*(float *)((int)pvVar11 + 0x1c) + 200.0 < (npc->_pos).x) { fVar12 = *(float *)((int)pvVar11 + 0x14) - 200.0; goto LAB_00459a9b; } } else { (npc->_velocity).x = -18.0; pvVar11 = game->_room; fVar12 = *(float *)((int)pvVar11 + 0x14) - 200.0; if ((npc->_pos).x <= fVar12 && fVar12 != (npc->_pos).x) { fVar12 = *(float *)((int)pvVar11 + 0x1c) + 200.0; LAB_00459a9b: pVVar8->x = fVar12; npc->_i1 = 1; isWrappedAround = '\x01'; if (npc->_variant != 1) { Entity_NPC::PlaySound(npc,0x3ef,1.0,2,0,1.0); } } } bVar4 = Game::IsHardMode(); if (CONCAT31(extraout_var_01,bVar4) != 0 && -1 < extraout_var_01) { (npc->_velocity).x = (npc->_velocity).x * 1.25; } if (((extraout_CL != '\0') && (npc->_spawnerType == npc->_type)) && (npc->_variant == 1)) { (**(code **)(*(int *)npc + 0x28))(); } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && ((ANM2::Play(&npc->_sprite,&DAT_00b1dd28,0), (npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { LAB_00459b89: (npc->_velocity).x = 0.0; } else { literalCursor = (npc->_sprite)._animState._animData; if (literalCursor == (byte *)0x0) { literalCursor = &s_empty; } else if (0xf < *(uint *)(literalCursor + 0x14)) { literalCursor = *(byte **)literalCursor; } literalCursor = &DAT_00b1dd28; do { bVar4 = *literalCursor; isLess = bVar4 < *literalCursor; if (bVar4 != *literalCursor) { LAB_00459b80: uVar5 = -(uint)isLess | 1; goto LAB_00459b85; } if (bVar4 == 0) break; bVar4 = literalCursor[1]; isLess = bVar4 < literalCursor[1]; if (bVar4 != literalCursor[1]) goto LAB_00459b80; literalCursor = literalCursor + 2; literalCursor = literalCursor + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00459b85: if (uVar5 != 0) goto LAB_00459b89; } fVar12 = local_12c.y - local_120; if (*(int *)((int)g_game->_room + 0x1bb0) == 0x37) { fVar12 = local_12c.y - 320.0; } iVar10 = npc->_stateFrame; if (iVar10 < 1) { fVar12 = (npc->_velocity).x; if (((fVar12 < 0.0) && (fVar13 = (npc->_targetPosition).x, pVVar8->x <= fVar13 && fVar13 != pVVar8->x)) || ((0.0 < fVar12 && ((npc->_targetPosition).x <= pVVar8->x && pVVar8->x != (npc->_targetPosition).x)))) { npc->_state = 4; } } else if (isWrappedAround != '\0') { fVar13 = fVar12 * 0.3 + (npc->_pos).y; (npc->_pos).y = fVar13; if (local_12c.y - 40.0 < fVar13) { (npc->_pos).y = fVar13 - fVar12 * 0.3 * 3.0; } npc->_stateFrame = iVar10 + -1; } if ((((npc->_i1 != 0) && (bVar4 = Entity::IsFrame((Entity *)npc,0x28,0), bVar4 != 0)) && (npc->_variant == 0)) && (npc->_subtype == 1)) { uVar5 = Random(); Game::Spawn(g_game,4,3,pVVar8,&g_vectorZero,(Entity *)npc,0,uVar5); npc->_i1 = 0; } goto LAB_00459cb6; } PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); local_40 = 0xf; local_44 = 4; local_54 = (void *)0x6b6c6157; local_50 = (float)((uint)local_50 & 0xffffff00); local_2c.y = 2.10195e-44; local_2c.x = 5.60519e-45; local_3c = (void *)0x6b6c6157; local_38 = local_38 & 0xffffff00; local_14 = 5; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)&local_54,2.0); local_14._0_1_ = 4; if (0xf < (uint)local_2c.y) { uVar5 = (int)local_2c.y + 1; pvVar11 = local_3c; if (0xfff < uVar5) { pvVar11 = *(void **)((int)local_3c + -4); uVar5 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_00458fd9; } operator_delete(pvVar11,uVar5); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar5 = local_40 + 1; pvVar11 = local_54; if (0xfff < uVar5) { pvVar11 = *(void **)((int)local_54 + -4); uVar5 = local_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar11))) { LAB_00458fd9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar5); } local_44 = 0; local_40 = 0xf; local_54 = (void *)((uint)local_54 & 0xffffff00); if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) goto LAB_00459cb6; uVar5 = Random(); if (uVar5 % 0x5a == 0) { local_120 = local_11c * local_11c; fVar12 = sqrtf(local_124 * local_124 + local_120); if (200.0 <= fVar12) goto LAB_004590c0; npc->_state = 8; literalCursor = s_Attack1; } else { local_120 = local_11c * local_11c; LAB_004590c0: uVar5 = Random(); if (((uVar5 % 200 == 0) && (fVar12 = sqrtf(local_124 * local_124 + local_120), 150.0 < fVar12)) || ((uVar5 = Random(), uVar5 % 0x1e == 0 && (ABS(local_124) < 20.0)))) { bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar4 == 0) { Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); (npc->_sprite)._flipX = local_11c < 0.0; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"DashStart",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 9; uVar5 = Random(); npc->_stateFrame = 3; npc->_i2 = uVar5 % 3; Entity_NPC::PlaySound(npc,0x3ef,1.0,2,0,1.0); } goto LAB_00459cb6; } uVar5 = Random(); if ((uVar5 % 0xb4 != 0) || (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar4 != 0) ) goto LAB_00459cb6; uVar5 = Random(); Entity_NPC::PlaySound(npc,(uVar5 & 3) + 0x73,1.0,2,0,1.0); npc->_state = 6; literalCursor = s_Attack2; } npc->_stateFrame = 0; bVar4 = ANM2::SetAnimation(&npc->_sprite,literalCursor,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_00459cb6: if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (fVar12 = (npc->_pos).y, fVar12 < 320.0)) { fVar13 = (npc->_velocity).y; (npc->_velocity).y = ((320.0 - fVar12) - fVar13) * 0.5 + fVar13; } ExceptionList = local_1c; return; } //@@ 00459d20 NpcAI::ENTITY_DEATH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 66 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DEATH(Entity_NPC *npc) { ColorMod color; undefined1 auVar1 [32]; byte bVar2; Entity *playerTarget; Vector *pVVar3; byte *animNameChar; int iVar4; Vector *pVVar5; Entity_Player *player; uint uVar6; Entity_NPC *playerTarget; Vector *pVVar8; byte *animNameLiteral; int unused; int unused_00; int unused_01; int unused_02; void *pvVar9; char *animName; int unused_03; undefined1 *puVar10; int iVar11; int iVar12; bool bVar13; bool bVar14; float fVar15; float fVar16; float fVar17; float fVar18; undefined4 local_b0 [8]; undefined4 local_90; undefined4 uStack_8c; undefined4 local_88; Vector local_84; Vector local_7c; float local_74; Vector local_70; char isWrapped; void *local_64; char local_60; char local_5c [4]; char local_58 [4]; Vector local_54; undefined1 local_4c [12]; float local_40; void *local_3c; float local_38; float local_34; float local_30; float local_2c; undefined1 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword flags; uint *flagsHigh; Game *game; Manager *manager; Room *room; ANM2 *sprite; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af25d5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; local_7c.y = (float)npc; playerTarget = Entity_NPC::GetPlayerTarget(npc); pVVar5 = &npc->_pos; local_84.x = (playerTarget->_pos).x - pVVar5->x; local_84.y = (playerTarget->_pos).y - (npc->_pos).y; if (npc->_state == 0) { npc->_entityGridCollisionClass = 3; local_90 = 0x3dcccccd; uStack_8c = 0x3dcccccd; local_88 = 0x3dcccccd; if (&npc->_splatColor != (ColorMod *)local_b0) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.1; (npc->_splatColor)._offset[1] = 0.1; (npc->_splatColor)._tint[0] = 0.15; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.1; } } iVar4 = npc->_variant; local_74 = local_84.x; local_70.y = local_84.y; if (iVar4 == 0) { fVar16 = (float)npc->_state; npc->_friction = npc->_friction * 0.8; if (fVar16 == 0.0) { npc->_state = 4; ExceptionList = local_1c; return; } if (0.5 <= npc->_health / npc->_maxHitPoints) { sprite = &npc->_sprite; if (fVar16 == 5.60519e-45) { local_28 = &DAT_0000000f; local_3c = (void *)0x6b6c6157; local_38 = (float)((uint)local_38 & 0xffffff00); local_54.y = 2.10195e-44; local_64 = (void *)0x6b6c6157; local_60 = '\0'; local_14 = 1; local_54.x = fVar16; local_2c = fVar16; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_64,(std_string *)&local_3c,1.0); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_54.y) { uVar6 = (int)local_54.y + 1; pvVar9 = local_64; if (0xfff < uVar6) { pvVar9 = *(void **)((int)local_64 + -4); uVar6 = (int)local_54.y + 0x24; if (0x1f < (uint)((int)local_64 + (-4 - (int)pvVar9))) goto LAB_00459f91; } operator_delete(pvVar9,uVar6); } local_14 = 0xffffffff; local_54.x = 0.0; local_54.y = 2.10195e-44; local_64 = (void *)((uint)local_64 & 0xffffff00); if (&DAT_0000000f < local_28) { puVar10 = local_28 + 1; pvVar9 = local_3c; if ((undefined1 *)0xfff < puVar10) { pvVar9 = *(void **)((int)local_3c + -4); puVar10 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar9))) { LAB_00459f91: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,(uint)puVar10); } PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); uVar6 = Random(); if (uVar6 % 0x5a == 0) { pvVar9 = g_game->_room; iVar11 = *(int *)((int)pvVar9 + 0x12c4) + *(int *)((int)pvVar9 + 0x12c0); iVar12 = *(int *)((int)pvVar9 + 0x12cc) + *(int *)((int)pvVar9 + 0x12c8); uVar6 = Random(); iVar4 = 0; if (0 < iVar11) { iVar4 = iVar11; } iVar11 = 0; if (0 < iVar12) { iVar11 = iVar12; } npc = (Entity_NPC *)local_7c.y; if (iVar4 - iVar11 < (int)((uVar6 & 1) + 1)) { ((Vector *)((int)local_7c.y + 0xb64))->x = 1.82169e-44; *(int *)((int)local_7c.y + 0x410) = 0; goto LAB_0045ab9f; } } uVar6 = Random(); if (((uVar6 % 0xb4 == 0) && (*(int *)((int)g_game->_room + 0x722c) < 1)) && (npc->_subtype == 0)) { ((Vector *)&npc->_state)->x = 1.12104e-44; npc->_stateFrame = 0; } else { uVar6 = Random(); if (uVar6 % 100 == 0) { pvVar9 = g_game->_room; iVar11 = *(int *)((int)pvVar9 + 0x12c8) + *(int *)((int)pvVar9 + 0x12cc); iVar12 = *(int *)((int)pvVar9 + 0x12c4) + *(int *)((int)pvVar9 + 0x12c0); iVar4 = 0; if (0 < iVar11) { iVar4 = iVar11; } iVar11 = 0; if (0 < iVar12) { iVar11 = iVar12; } if (iVar11 - iVar4 < 4) { ((Vector *)&npc->_state)->x = 1.96182e-44; npc->_stateFrame = 0; } } } } else if (fVar16 == 1.82169e-44) { bVar2 = ANM2::IsPlaying(sprite,&DAT_00b1d53c); if (bVar2 == 0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animNameLiteral = &DAT_00b1d53c; do { bVar2 = *animNameChar; bVar13 = bVar2 < *animNameLiteral; if (bVar2 != *animNameLiteral) { LAB_0045a120: uVar6 = -(uint)bVar13 | 1; goto LAB_0045a125; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar13 = bVar2 < animNameLiteral[1]; if (bVar2 != animNameLiteral[1]) goto LAB_0045a120; animNameChar = animNameChar + 2; animNameLiteral = animNameLiteral + 2; } while (bVar2 != 0); uVar6 = 0; LAB_0045a125: if (uVar6 == 0) goto LAB_0045a17f; } ANM2::Play(&npc->_sprite,&DAT_00b1d53c,0); manager = g_manager; local_7c.y = 1.30181e-42; seed_fart_sound_override((int *)&local_7c.y); SoundEffects::Play(&manager->_sfxManager,(int)local_7c.y,1.0,2,0,1.0,0.0); } LAB_0045a17f: iVar4 = npc->_stateFrame + 1; npc->_stateFrame = iVar4; if (iVar4 != 0x14) goto LAB_0045a729; Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x109,1.2,2,0,1.0); if (npc->_subtype != 1) { local_7c.y = 0.0; local_74 = 0.0; do { if (0x13 < (int)local_74) break; room = g_game->_room; uVar6 = Random(); Room::FindFreePickupSpawnPosition (room,&local_84,&npc->_pos, (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 100.0 + 250.0,0,0,0); playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar16 = (playerTarget->_pos).y - local_84.y; fVar15 = (playerTarget->_pos).x - local_84.x; fVar16 = sqrtf(fVar16 * fVar16 + fVar15 * fVar15); if (150.0 < fVar16) { uVar6 = Random(); Game::Spawn(g_game,npc->_type,10,&local_84,&g_vectorZero,(Entity *)npc,0,uVar6); playerTarget = (Entity_NPC *)__RTDynamicCast(); if (playerTarget->_parent != (EntityPtr)0x0) { local_70.y = (float)&playerTarget->_parent; std::multiset::erase(); } playerTarget->_parent = (EntityPtr)npc; std::multiset::insert(); Entity_NPC::SetBossColorIdx(playerTarget,npc->_bosscoloridx,unused_00); if ((npc->_flags & 0x1000000000000000) != 0) { flags = playerTarget->_flags; flagsHigh = (uint *)((int)&playerTarget->_flags + 4); *flagsHigh = *flagsHigh & 0xffffffdf; *(int *)&playerTarget->_flags = (int)flags; } local_7c.y = (float)((int)local_7c.y + 1); } local_74 = (float)((int)local_74 + 1); } while ((int)local_7c.y < 2); goto LAB_0045ab9f; } pVVar5 = MusicManager::RandomVector(&local_54); local_7c.y = 2.8026e-45; local_74 = pVVar5->x * 50.0; local_84.y = pVVar5->y * 50.0; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 == 0) { LAB_0045a240: uVar6 = Random(); local_54.x = local_74 + (npc->_pos).x; local_54.y = local_84.y + (npc->_pos).y; Game::Spawn(g_game,0x37,1,&local_54,&g_vectorZero,(Entity *)npc,0,uVar6); } else { iVar4 = Entity::CountRelatedEntities((Entity *)npc,0x37,1,unused,(void *)0x0); local_7c.y = (float)(3 - iVar4); if (0 < (int)local_7c.y) goto LAB_0045a240; } if (1 < (int)local_7c.y) { uVar6 = Random(); local_7c.x = (npc->_pos).x - local_74; local_7c.y = (npc->_pos).y - local_84.y; Game::Spawn(g_game,0x37,1,&local_7c,&g_vectorZero,(Entity *)npc,0,uVar6); } } else { if (fVar16 == 1.96182e-44) { bVar2 = ANM2::IsPlaying(sprite,&DAT_00b1d568); if (bVar2 == 0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animNameLiteral = &DAT_00b1d568; do { bVar2 = *animNameChar; bVar13 = bVar2 < *animNameLiteral; if (bVar2 != *animNameLiteral) { LAB_0045a4a0: uVar6 = -(uint)bVar13 | 1; goto LAB_0045a4a5; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar13 = bVar2 < animNameLiteral[1]; if (bVar2 != animNameLiteral[1]) goto LAB_0045a4a0; animNameChar = animNameChar + 2; animNameLiteral = animNameLiteral + 2; } while (bVar2 != 0); uVar6 = 0; LAB_0045a4a5: if (uVar6 == 0) goto LAB_0045a4ff; } ANM2::Play(&npc->_sprite,&DAT_00b1d568,0); manager = g_manager; local_7c.y = 1.30181e-42; seed_fart_sound_override((int *)&local_7c.y); SoundEffects::Play(&manager->_sfxManager,(int)local_7c.y,1.0,2,0,1.0,0.0); } LAB_0045a4ff: iVar4 = npc->_stateFrame + 1; npc->_stateFrame = iVar4; if (iVar4 == 0x12) { Entity_NPC::PlaySound(npc,0x109,1.5,2,0,1.0); Entity_NPC::PlaySound(npc,0x68,1.0,2,0,1.0); local_70.y = 5.60519e-45; pvVar9 = g_game->_room; local_4c._8_4_ = *(int *)((int)pvVar9 + 0x14); local_30 = *(float *)((int)pvVar9 + 0x18); local_3c = *(void **)((int)pvVar9 + 0x1c); local_28 = *(undefined1 **)((int)pvVar9 + 0x20); local_40 = (npc->_pos).y; local_34 = (npc->_pos).x; local_84.y = (float)(local_4c + 8); local_38 = local_40; local_2c = local_34; do { pVVar5 = (Vector *)local_84.y; playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar16 = (playerTarget->_pos).y - (float)*(EntityPtr *)((int)pVVar5 + 4); fVar15 = (playerTarget->_pos).x - *&pVVar5->x; fVar16 = sqrtf(fVar16 * fVar16 + fVar15 * fVar15); manager = g_manager; if (80.0 < fVar16) { local_7c.y = 1.0; if (npc->_championColorIdx == 0x12) { local_7c.y = 1.5; } else if (npc->_championColorIdx == 0x13) { local_7c.y = 0.5; } local_74 = 1.45735e-43; seed_fart_sound_override((int *)&local_74); SoundEffects::Play(&manager->_sfxManager,(int)local_74,1.0,2,0,local_7c.y,0.0); uVar6 = Random(); Game::Spawn(g_game,npc->_type,10,(Vector *)local_84.y,&g_vectorZero,(Entity *)npc,0, uVar6); playerTarget = (Entity_NPC *)__RTDynamicCast(); playerTarget->_i1 = 1; if (playerTarget->_parent != (EntityPtr)0x0) { local_7c.y = (float)&playerTarget->_parent; std::multiset::erase(); } playerTarget->_parent = (EntityPtr)npc; std::multiset::insert(); Entity_NPC::SetBossColorIdx(playerTarget,npc->_bosscoloridx,unused_01); if ((npc->_flags & 0x1000000000000000) != 0) { flags = playerTarget->_flags; flagsHigh = (uint *)((int)&playerTarget->_flags + 4); *flagsHigh = *flagsHigh & 0xffffffdf; *(int *)&playerTarget->_flags = (int)flags; } pVVar5 = (Vector *)local_84.y; } local_84.y = (float)(pVVar5 + 1); local_70.y = (float)((int)local_70.y + -1); } while (local_70.y != 0.0); local_70.y = 0.0; goto LAB_0045ab9f; } LAB_0045a729: bVar14 = SBORROW4(iVar4,0x30); iVar11 = iVar4 + -0x30; bVar13 = iVar4 == 0x30; } else { if (fVar16 != 1.12104e-44) { if (fVar16 != 8.40779e-45) goto LAB_0045ab9f; goto LAB_0045a994; } bVar2 = ANM2::IsPlaying(sprite,&DAT_00b1d554); if (bVar2 == 0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animNameLiteral = &DAT_00b1d554; do { bVar2 = *animNameChar; bVar13 = bVar2 < *animNameLiteral; if (bVar2 != *animNameLiteral) { LAB_0045a790: uVar6 = -(uint)bVar13 | 1; goto LAB_0045a795; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar13 = bVar2 < animNameLiteral[1]; if (bVar2 != animNameLiteral[1]) goto LAB_0045a790; animNameChar = animNameChar + 2; animNameLiteral = animNameLiteral + 2; } while (bVar2 != 0); uVar6 = 0; LAB_0045a795: if (uVar6 == 0) goto LAB_0045a7e9; } ANM2::Play(&npc->_sprite,&DAT_00b1d554,0); manager = g_manager; local_70.y = 1.299e-42; seed_fart_sound_override((int *)&local_70.y); SoundEffects::Play(&manager->_sfxManager,(int)local_70.y,1.0,2,0,1.0,0.0); } LAB_0045a7e9: iVar11 = npc->_stateFrame; iVar4 = iVar11 + 1; npc->_stateFrame = iVar4; if (iVar4 == 0x16) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x100); if (bVar2 == 0) { local_70.y = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,(uint)local_70.y); EntityRef::constructor((EntityRef *)local_4c,(Entity *)npc); auVar1 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3fa66666,0x3f8000003f800000))); color._offset[0] = 0.15686275; color._tint[0] = (float)auVar1._0_4_; color._tint[1] = (float)auVar1._4_4_; color._tint[2] = (float)auVar1._8_4_; color._tint[3] = (float)auVar1._12_4_; color._colorize[0] = (float)auVar1._16_4_; color._colorize[1] = (float)auVar1._20_4_; color._colorize[2] = (float)auVar1._24_4_; color._colorize[3] = (float)auVar1._28_4_; color._offset[1] = 0.15686275; color._offset[2] = 0.15686275; Entity::AddSlowing((Entity *)player,(EntityRef *)local_4c,0xa0,0.9,color,0); local_70.y = (float)((int)local_70.y + 1); } while ((uint)local_70.y < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } ItemOverlay::Show(&g_game->_itemOverlay,0xe,3,(Entity_Player *)0x0); local_70.y = 1.2962e-42; iVar4 = *(int *)((int)g_game->_room + 0x722c); if (iVar4 < 0xa0) { iVar4 = 0xa0; } *(int *)((int)g_game->_room + 0x722c) = iVar4; goto LAB_0045ab65; } pvVar9 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar9 & 0xfffffffcU) < 0x109) { local_5c[0] = '\0'; local_5c[1] = '\0'; local_5c[2] = '\0'; local_5c[3] = '\0'; } else { local_5c = *(char (*) [4])((int)pvVar9 + 0x108); } local_58[0] = '\0'; local_58[1] = '\0'; local_58[2] = '\0'; local_58[3] = '\0'; local_54.y = 0.0; local_54.x = 2.24208e-43; TemporaryEffects::AddEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),local_5c,0,1); goto LAB_0045ab9f; } bVar14 = SBORROW4(iVar4,0x34); iVar11 = iVar11 + -0x33; bVar13 = iVar4 == 0x34; } if (!bVar13 && bVar14 == iVar11 < 0) { npc->_state = 4; } } } else { pvVar9 = g_game->_room; local_7c.x = *(float *)((int)pvVar9 + 0x1c); local_70.y = (float)*(Vector **)((int)pvVar9 + 0x18); local_7c.y = *(float *)((int)pvVar9 + 0x20); local_70.x = *(float *)((int)pvVar9 + 0x14); pVVar8 = &local_70; if (*(float *)((int)pvVar9 + 0x14) < pVVar5->x) { pVVar8 = pVVar5; } pVVar3 = &local_7c; if (pVVar8->x <= local_7c.x && local_7c.x != pVVar8->x) { pVVar3 = pVVar8; } pVVar5->x = pVVar3->x; (npc->_sprite)._flipX = local_84.x < 0.0; npc->_state = 6; LAB_0045a994: ANM2::Play(&npc->_sprite,(byte *)"DashStart",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x109,1.5,2,0,1.0); Entity_NPC::Morph(npc,npc->_type,0x1e,npc->_subtype,-1); npc->_state = 0; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); local_70.y = 15.0; if ((npc->_sprite)._flipX != 0) { local_70.y = -15.0; } uVar6 = Random(); local_54.x = local_70.y + pVVar5->x; local_54.y = (npc->_pos).y - 8.0; Game::Spawn(g_game,npc->_type,0x14,&local_54,&g_vectorZero,(Entity *)npc,0,uVar6); playerTarget = (Entity_NPC *)__RTDynamicCast(); fVar16 = npc->_scale; playerTarget->_scale = fVar16; fVar16 = fVar16 * playerTarget->_shrinkStatus1; fVar15 = fVar16 * g_vectorOne.x; (playerTarget->_sprite)._scale.y = fVar16 * g_vectorOne.y; (playerTarget->_sprite)._scale.x = fVar15; if (playerTarget->_parent != (EntityPtr)0x0) { local_70.y = (float)&playerTarget->_parent; std::multiset::erase(); } playerTarget->_parent = (EntityPtr)npc; std::multiset::insert(); Entity_NPC::SetBossColorIdx(playerTarget,npc->_bosscoloridx,unused_02); bVar2 = (npc->_sprite)._flipX; *(uint *)&playerTarget->_flags = (uint)playerTarget->_flags & 0xfffffffb; (playerTarget->_sprite)._flipX = bVar2; *(undefined4 *)((int)&playerTarget->_flags + 4) = *(undefined4 *)((int)&playerTarget->_flags + 4); bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { playerTarget->_health = 30.0; playerTarget->_maxHitPoints = 30.0; } playerTarget->_entityCollisionClass = 0; local_70.y = 1.30321e-42; LAB_0045ab65: manager = g_manager; seed_fart_sound_override((int *)&local_70.y); SoundEffects::Play(&manager->_sfxManager,(int)local_70.y,1.0,2,0,1.0,0.0); } } LAB_0045ab9f: if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0045b7cd; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1dd44); LAB_0045b780: manager = g_manager; if (bVar2 != 0) { local_70.y = 1.3004e-42; seed_fart_sound_override((int *)&local_70.y); SoundEffects::Play(&manager->_sfxManager,(int)local_70.y,1.0,2,0,1.0,0.0); } goto LAB_0045b7cd; } if (iVar4 == 10) { if (npc->_parent == (EntityPtr)0x0) { EntityRef::EntityRef((EntityRef *)local_4c); (**(code **)(*(int *)npc + 0x24))(); } npc->_friction = npc->_friction * 0.975; if (npc->_state == 0) { (npc->_sprite)._flipX = local_74 < 0.0; npc->_state = 3; fVar16 = sqrtf(local_70.y * local_70.y + local_74 * local_74); npc->_health = 15.0; npc->_entityCollisionClass = 2; npc->_entityGridCollisionClass = 0; npc->_stateFrame = 0x50 - (int)(fVar16 * 0.1); ExceptionList = local_1c; return; } if (npc->_state == 3) { if (npc->_i1 == 1) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; ANM2::SetFrame(&npc->_sprite,(std_string *)"Throw",0); iVar4 = npc->_stateFrame + -1; npc->_stateFrame = iVar4; if (0 < iVar4) goto LAB_0045ad21; } else { npc->_stateFrame = 0; } manager = g_manager; local_70.y = 1.2976e-42; npc->_state = 4; seed_fart_sound_override((int *)&local_70.y); SoundEffects::Play(&manager->_sfxManager,(int)local_70.y,1.0,2,0,1.0,0.0); } LAB_0045ad21: if (npc->_state == 4) { npc->_stateFrame = npc->_stateFrame + 1; ANM2::Play(&npc->_sprite,(byte *)"Throw",0); if (npc->_i1 == 1) { if (0xb4 < npc->_stateFrame) { (**(code **)(*(int *)npc + 0x28))(); } bVar2 = Vector::operator_eq(&npc->_v1,&g_vectorZero); if (bVar2 != 0) { pVVar5 = Vector::Normalized(&local_84,&local_54); fVar16 = pVVar5->y; (npc->_v1).x = pVVar5->x * 0.75; (npc->_v1).y = fVar16 * 0.75; } } else { pVVar5 = Vector::Normalized(&local_84,&local_54); fVar16 = pVVar5->y; (npc->_v1).x = pVVar5->x * 0.5; (npc->_v1).y = fVar16 * 0.5; } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar2 == 0) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800); pVVar5 = &npc->_v1; if (bVar2 != 0) { pVVar5->x = -pVVar5->x; (npc->_v1).y = -(npc->_v1).y; } fVar16 = npc->_friction; if (fVar16 != 0.0) { fVar15 = npc->_speedMultiplier; fVar17 = (npc->_v1).y; (npc->_velocity).x = (fVar15 * pVVar5->x) / fVar16 + (npc->_velocity).x; (npc->_velocity).y = (fVar17 * fVar15) / fVar16 + (npc->_velocity).y; } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } Room::GetClampedPositionImpl(g_game->_room,&local_54,&npc->_pos,0.0,0.0,0.0,0.0); local_54.y = (npc->_pos).y - local_54.y; local_54.x = (npc->_pos).x - local_54.x; fVar16 = sqrtf(local_54.y * local_54.y + local_54.x * local_54.x); if (250.0 < fVar16) { (**(code **)(*(int *)npc + 0x28))(); } } goto LAB_0045b7cd; } if (iVar4 != 0x14) { if (iVar4 != 0x1e) goto LAB_0045b7cd; iVar4 = npc->_state; npc->_friction = npc->_friction * 0.8; if (iVar4 == 0) { npc->_state = 7; npc->_stateFrame = 0; ExceptionList = local_1c; return; } if (iVar4 == 7) { if (npc->_stateFrame == 0) { ANM2::Play(&npc->_sprite,(byte *)"Appear",0); npc->_stateFrame = npc->_stateFrame + 1; iVar4 = npc->_state; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0045b35a; npc->_state = 4; LAB_0045b363: local_28 = &DAT_0000000f; local_2c = 5.60519e-45; local_3c = (void *)0x6b6c6157; local_38 = (float)((uint)local_38 & 0xffffff00); local_54.y = 2.10195e-44; local_54.x = 5.60519e-45; local_64 = (void *)0x6b6c6157; local_60 = '\0'; local_14 = 3; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_64,(std_string *)&local_3c,1.0); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < (uint)local_54.y) { uVar6 = (int)local_54.y + 1; pvVar9 = local_64; if (0xfff < uVar6) { pvVar9 = *(void **)((int)local_64 + -4); uVar6 = (int)local_54.y + 0x24; if (0x1f < (uint)((int)local_64 + (-4 - (int)pvVar9))) goto LAB_0045b42a; } operator_delete(pvVar9,uVar6); } local_14 = 0xffffffff; local_54.x = 0.0; local_54.y = 2.10195e-44; local_64 = (void *)((uint)local_64 & 0xffffff00); if (&DAT_0000000f < local_28) { puVar10 = local_28 + 1; pvVar9 = local_3c; if ((undefined1 *)0xfff < puVar10) { pvVar9 = *(void **)((int)local_3c + -4); puVar10 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar9))) { LAB_0045b42a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,(uint)puVar10); } PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); uVar6 = Random(); if (uVar6 % 0x5a == 0) { pvVar9 = g_game->_room; iVar11 = *(int *)((int)pvVar9 + 0x12c8) + *(int *)((int)pvVar9 + 0x12cc); iVar12 = *(int *)((int)pvVar9 + 0x12c4) + *(int *)((int)pvVar9 + 0x12c0); iVar4 = 0; if (0 < iVar11) { iVar4 = iVar11; } iVar11 = 0; if (0 < iVar12) { iVar11 = iVar12; } if (iVar11 - iVar4 < 2) { npc->_state = 0xd; npc->_stateFrame = 0; } } } else { LAB_0045b35a: if (iVar4 == 4) goto LAB_0045b363; if (iVar4 == 0xd) { bVar2 = ANM2::IsPlaying(&npc->_sprite,(byte *)"Attack"); if (bVar2 == 0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Attack"; do { bVar2 = *animNameChar; bVar13 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0045b510: uVar6 = -(uint)bVar13 | 1; goto LAB_0045b515; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar13 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0045b510; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar6 = 0; LAB_0045b515: if (uVar6 == 0) goto LAB_0045b56f; } ANM2::Play(&npc->_sprite,(byte *)"Attack",0); manager = g_manager; local_70.y = 1.30181e-42; seed_fart_sound_override((int *)&local_70.y); SoundEffects::Play(&manager->_sfxManager,(int)local_70.y,1.0,2,0,1.0,0.0); } LAB_0045b56f: pVVar5 = &npc->_pos; iVar4 = npc->_stateFrame + 1; npc->_stateFrame = iVar4; if (iVar4 == 0x10) { Entity_NPC::PlaySound(npc,0x109,1.2,2,0,1.0); Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); pVVar8 = MusicManager::RandomVector(&local_54); local_84.y = 2.8026e-45; local_74 = pVVar8->x * 10.0; local_7c.y = pVVar8->y * 10.0; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 == 0) { pVVar8 = (Vector *)0x2; } else { iVar4 = Entity::CountRelatedEntities((Entity *)npc,0x1a,1,unused_03,(void *)0x0); local_84.y = (float)(2 - iVar4); iVar4 = Entity::CountRelatedEntities((Entity *)npc,0x29,0,(int)local_84.y,(void *)0x0); pVVar8 = (Vector *)((int)local_84.y - iVar4); local_84.y = (float)pVVar8; } if (npc->_subtype == 1) { if (0 < (int)pVVar8) { uVar6 = Random(); local_54.x = local_74 + pVVar5->x; local_54.y = local_7c.y + (npc->_pos).y; Game::Spawn(g_game,0x1a,1,&local_54,&g_vectorZero,(Entity *)npc,0,uVar6); pVVar8 = (Vector *)local_84.y; } if (1 < (int)pVVar8) { uVar6 = Random(); local_54.x = pVVar5->x - local_74; local_54.y = (npc->_pos).y - local_7c.y; Game::Spawn(g_game,0x1a,1,&local_54,&g_vectorZero,(Entity *)npc,0,uVar6); } } else { if (0 < (int)pVVar8) { uVar6 = Random(); local_54.x = local_74 + pVVar5->x; local_54.y = local_7c.y + (npc->_pos).y; Game::Spawn(g_game,0x29,0,&local_54,&g_vectorZero,(Entity *)npc,0,uVar6); pVVar8 = (Vector *)local_84.y; } if (1 < (int)pVVar8) { uVar6 = Random(); local_54.x = pVVar5->x - local_74; local_54.y = (npc->_pos).y - local_7c.y; Game::Spawn(g_game,0x29,0,&local_54,&g_vectorZero,(Entity *)npc,0,uVar6); } } } else if (0x29 < iVar4) { npc->_state = 4; } } } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1dd44); goto LAB_0045b780; } if (((npc->_flags & 0x1000000000000000) == 0) && (npc->_parent != (EntityPtr)0x0)) { playerTarget = Entity_NPC::ParentNPC(npc); fVar16 = npc->_health + 40.0; if (playerTarget->_health <= fVar16 && fVar16 != playerTarget->_health) { npc->_health = npc->_health - 1.0; } } bVar2 = (npc->_sprite)._flipX; npc->_friction = npc->_friction * 0.8; game = g_game; if (bVar2 == 0) { fVar16 = 18.0; } else { fVar16 = -18.0; } (npc->_velocity).x = fVar16; if ((game->_difficulty == 1) || (game->_difficulty == 3)) { (npc->_velocity).x = fVar16 * 1.25; } if (npc->_state == 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 2; npc->_state = 4; ANM2::Play(&npc->_sprite,&DAT_00b1dd28,0); npc->_i2 = 0; ExceptionList = local_1c; return; } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar2 != 0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar2 != 0) { playerTarget = Entity_NPC::GetPlayerTarget(npc); local_54.y = -((playerTarget->_pos).y - (npc->_pos).y); local_54.x = -((playerTarget->_pos).x - pVVar5->x); fVar16 = sqrtf(local_54.y * local_54.y + local_54.x * local_54.x); fVar16 = (200.0 - fVar16) * 0.03; if (fVar16 <= 0.0) { fVar16 = 0.0; } if (1.6 <= fVar16) { fVar16 = 1.6; } pVVar8 = Vector::Resized(&local_54,&local_84,fVar16); fVar16 = npc->_friction; if (fVar16 != 0.0) { fVar15 = npc->_speedMultiplier; fVar17 = pVVar8->y; (npc->_velocity).x = (fVar15 * pVVar8->x) / fVar16 + (npc->_velocity).x; (npc->_velocity).y = (fVar17 * fVar15) / fVar16 + (npc->_velocity).y; } } pvVar9 = g_game->_room; local_74 = *(float *)((int)pvVar9 + 0x18); fVar16 = *(float *)((int)pvVar9 + 0x14); local_7c.y = *(float *)((int)pvVar9 + 0x20); if (npc->_state != 4) goto LAB_0045b7cd; fVar15 = (npc->_velocity).x; fVar17 = *(float *)((int)pvVar9 + 0x1c) + 200.0; isWrapped = '\0'; if (fVar15 <= 0.0) { fVar18 = (npc->_pos).x; LAB_0045b17e: if ((fVar15 < 0.0) && (fVar18 < fVar16 - 200.0)) { pVVar5->x = fVar17; fVar18 = fVar17; goto LAB_0045b19c; } } else { fVar18 = pVVar5->x; if (fVar18 <= fVar17) goto LAB_0045b17e; pVVar5->x = fVar16 - 200.0; fVar18 = fVar16 - 200.0; LAB_0045b19c: isWrapped = '\x01'; } if (fVar18 <= fVar17) { if (fVar18 < fVar16 - 200.0) { pVVar5->x = fVar17; goto LAB_0045b1bc; } } else { (npc->_pos).x = fVar16 - 200.0; LAB_0045b1bc: isWrapped = '\x01'; } player = PlayerManager::get_first_local_main_player(&g_game->_playerManager); manager = g_manager; if (((player != (Entity_Player *)0x0) && (ABS(pVVar5->x - (player->_pos).x) < 150.0)) && (npc->_i2 != 1)) { npc->_i2 = 1; local_70.y = 1.30461e-42; seed_fart_sound_override((int *)&local_70.y); SoundEffects::Play(&manager->_sfxManager,(int)local_70.y,1.0,2,0,1.0,0.0); } local_74 = local_7c.y - local_74; if (*(int *)((int)g_game->_room + 0x1bb0) == 0x37) { local_74 = local_7c.y - 320.0; } if (isWrapped != '\0') { npc->_i2 = 0; fVar16 = local_74 * 0.3 + (npc->_pos).y; (npc->_pos).y = fVar16; if (local_7c.y - 40.0 < fVar16) { (npc->_pos).y = fVar16 - local_74 * 0.3 * 3.0; } } LAB_0045b7cd: if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (fVar16 = (npc->_pos).y, fVar16 < 320.0)) { fVar15 = (npc->_velocity).y; (npc->_velocity).y = ((320.0 - fVar16) - fVar15) * 0.5 + fVar15; } ExceptionList = local_1c; return; } //@@ 0045b830 NpcAI::ENTITY_FALLEN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 81 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FALLEN(Entity_NPC *npc) { float *pfVar1; byte bVar2; float *pfVar3; Entity *pEVar4; int iVar5; ProjectileParams *params; Vector *vecResult; int *poofEffect; Entity_NPC *splitNpc; EntityRef *killRef; char *anim; Entity_Laser *laser; void *pvVar6; uint uVar7; undefined1 *puVar8; AnimationState *pAVar9; float fVar10; float fVar11; undefined4 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; Vector local_14c; undefined1 *local_144; AnimationState *local_140; Vector scratchVec; float local_134; AnimationState *local_130; undefined1 *local_12c; byte local_125; float local_124; ProjectileParams projParams; undefined1 local_78 [20]; undefined1 local_64; int local_58; undefined1 *local_54; undefined1 local_50 [24]; float fStack_38; float afStack_34 [2]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; Room *room; float speedMultiplier; puStack_20 = (undefined1 *)(afStack_34 + 0xc); local_14 = -NAN; puStack_18 = &LAB_00af2615; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(afStack_34 + 9); ExceptionList = &local_1c; local_124 = (float)npc->_spawnerType; local_134 = (float)npc->_type; if (npc->_state == 0) goto LAB_0045cd38; pAVar9 = &(npc->_sprite)._animState; local_144 = (undefined1 *)0x3f800000; local_130 = pAVar9; pfVar1 = afStack_34 + 0xc; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0045bac1: puStack_20 = (undefined1 *)pfVar1; pAVar9 = local_130; } else { local_140 = pAVar9; bVar2 = AnimationState::IsEventTriggered(pAVar9,(byte *)"FlapChase"); manager = g_manager; local_130 = pAVar9; if (bVar2 != 0) { local_130 = (AnimationState *)local_144; if (npc->_championColorIdx == 0x12) { local_130 = (AnimationState *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_130 = (AnimationState *)0x3f000000; } local_12c = (undefined1 *)0x3c4; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,(float)local_130,0.0); local_130 = local_140; } pfVar1 = (float *)puStack_20; if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0045bac1; bVar2 = AnimationState::IsEventTriggered(local_130,&DAT_00b1dd68); manager = g_manager; if (bVar2 != 0) { local_12c = local_144; if (npc->_championColorIdx == 0x12) { local_12c = (undefined1 *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_12c = (undefined1 *)0x3f000000; } local_140 = (AnimationState *)0x3c6; seed_fart_sound_override((int *)&local_140); SoundEffects::Play(&manager->_sfxManager,(int)local_140,1.0,2,0,(float)local_12c,0.0); } pAVar9 = local_130; pfVar1 = (float *)puStack_20; if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0045bac1; bVar2 = AnimationState::IsEventTriggered(local_130,(byte *)"OpenWings"); manager = g_manager; if (bVar2 != 0) { local_12c = local_144; if (npc->_championColorIdx == 0x12) { local_12c = (undefined1 *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_12c = (undefined1 *)0x3f000000; } local_140 = (AnimationState *)0x3c7; seed_fart_sound_override((int *)&local_140); SoundEffects::Play(&manager->_sfxManager,(int)local_140,1.0,2,0,(float)local_12c,0.0); pfVar1 = (float *)puStack_20; goto LAB_0045bac1; } } npc->_friction = npc->_friction * 0.8; if ((((npc->_health / npc->_maxHitPoints < 0.5) && (local_124 != local_134)) && (npc->_variant == 0)) && (npc->_state != 0xd)) { Entity_NPC::PlaySound(npc,0x75,1.0,2,0,1.0); pfVar1 = &npc->_health; npc->_state = 0xd; npc->_stateFrame = 0; local_140 = (AnimationState *)0x3f800000; pfVar3 = (float *)&local_140; if ((float)local_144 < *pfVar1) { pfVar3 = pfVar1; } *pfVar1 = *pfVar3; npc->_dead = 0; } iVar5 = npc->_state; if (iVar5 != 4) { if (iVar5 != 8) { if (iVar5 == 9) { if (npc->_stateFrame == 0) { ANM2::Play(&npc->_sprite,(byte *)"ChargeStart",0); npc->_stateFrame = npc->_stateFrame + 1; } else if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Charge",0); } bVar2 = ANM2::IsPlaying(&npc->_sprite,(byte *)"Charge"); if (bVar2 == 0) { ExceptionList = local_1c; return; } iVar5 = npc->_stateFrame; npc->_stateFrame = iVar5 + 1; if ((0x77 < iVar5) && (uVar7 = Random(), uVar7 % 0x3c != 0)) { Entity_NPC::PlaySound(npc,0x3c5,1.0,0x78,0,1.0); } vecResult = Entity_NPC::CalcTargetPosition(npc,&local_2c,0.0); pEVar4 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = ((pEVar4->_velocity).x * 10.0 + vecResult->x) - (npc->_pos).x; scratchVec.y = ((pEVar4->_velocity).y * 10.0 + vecResult->y) - (npc->_pos).y; vecResult = Vector::Normalized(&scratchVec,&local_2c); fVar10 = npc->_friction; fVar11 = vecResult->x; if (fVar10 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * vecResult->y * 1.4) / fVar10 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * fVar11 * 1.4) / fVar10 + (npc->_velocity).x; } fVar11 = npc->_pendingDamage + (npc->_v1).x; (npc->_v1).x = fVar11; fVar10 = npc->_maxHitPoints; (npc->_sprite)._flipX = scratchVec.x < 0.0; if (fVar10 * 0.125 < fVar11) { npc->_state = 10; npc->_stateFrame = 0; (npc->_v1).x = 0.0; if ((npc->_variant == 1) && ((uVar7 = Random(), (uVar7 & 1) == 0 || (g_game->_frameCount - npc->_spawnFrame < 0x3c) ))) { iVar5 = 1; } else { iVar5 = 0; } npc->_i1 = iVar5; local_124 = 0.0; local_14c.x = 0.0; local_14c.y = -40.0; do { iVar5 = 0x16; afStack_34[1] = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; afStack_34[0] = 0.0; if (npc->_variant == 1) { iVar5 = 0x20; } local_2c.x = 0.0; local_2c.y = 0.0; local_50._0_4_ = 0.6; local_50._4_4_ = 0.05; local_50._8_4_ = 0.0; local_50._12_4_ = 0.8; if (npc->_i1 == 0) { fVar10 = 0.0; } else { fVar10 = 45.0; } local_134 = ((float)(int)local_124 * 90.0 + fVar10) * 0.017453292; scratchVec.x = cos(local_134); scratchVec.y = sin(local_134); Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_14c,&scratchVec,iVar5,(ColorMod *)local_50,4.0); local_124 = (float)((int)local_124 + 1); } while ((int)local_124 < 4); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if ((iVar5 != 10) && (iVar5 != 0xb)) { if (iVar5 != 0xd) { ExceptionList = local_1c; return; } ANM2::Play(&npc->_sprite,(byte *)"Split",0); npc->_stateFrame = npc->_stateFrame + 1; npc->_entityCollisionClass = 0; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x109,2.0,2,0,1.0); local_124 = -NAN; do { uVar7 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; pEVar4 = Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)npc,3,uVar7); poofEffect = (int *)__RTDynamicCast(pEVar4,uVar12,pTVar13,pTVar14,uVar15); afStack_34[1] = 0.0; local_2c.x = 0.0; local_2c.y = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; afStack_34[0] = 0.0; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; local_50._8_4_ = 0.0; local_50._12_4_ = 1.0; (**(code **)(*poofEffect + 0x3c))(local_50,0xffffffff,0xff,0,1); iVar5 = (int)local_124 + 1; poofEffect[0x11d] = (int)((float)(int)local_124 * 30.0); local_124 = (float)iVar5; } while (iVar5 < 2); iVar5 = 0; afStack_34[0] = 30.0; afStack_34[1] = -20.0; local_2c.x = -30.0; local_2c.y = -20.0; do { uVar7 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; scratchVec.x = afStack_34[iVar5 * 2] + (npc->_pos).x; scratchVec.y = afStack_34[iVar5 * 2 + 1] + (npc->_pos).y; pEVar4 = Game::Spawn(g_game,npc->_type,npc->_variant,&scratchVec,&g_vectorZero, (Entity *)npc,0,uVar7); splitNpc = (Entity_NPC *)__RTDynamicCast(pEVar4,uVar12,pTVar13,pTVar14,uVar15); splitNpc->_health = splitNpc->_health * 0.5; if ((npc->_flags & 0x1000000000000000) != 0) { splitNpc->_maxHitPoints = 20.0; splitNpc->_health = 20.0; } iVar5 = iVar5 + 1; fVar11 = splitNpc->_shrinkStatus1 * 0.75; splitNpc->_scale = 0.75; fVar10 = fVar11 * g_vectorOne.x; (splitNpc->_sprite)._scale.y = fVar11 * g_vectorOne.y; (splitNpc->_sprite)._scale.x = fVar10; } while (iVar5 < 2); killRef = EntityRef::EntityRef((EntityRef *)local_78); (**(code **)(*(int *)npc + 0x24))(killRef); ExceptionList = local_1c; return; } anim = "Attack2Alt"; if (iVar5 != 0xb) { anim = (char *)s_Attack2; } ANM2::Play(&npc->_sprite,(byte *)anim,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot2"), bVar2 == 0)) { bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot2"); if ((bVar2 != 0) && (fVar10 = (npc->_v1).y, 0.0 < fVar10)) { fVar11 = npc->_speedMultiplier; (npc->_velocity).x = fVar10 * (npc->_targetPosition).x * fVar11 + (npc->_velocity).x; (npc->_velocity).y = fVar10 * (npc->_targetPosition).y * fVar11 + (npc->_velocity).y; fVar11 = (npc->_v1).y - fVar11 * 0.2; fVar10 = 0.0; if (0.0 <= fVar11) { fVar10 = fVar11; } (npc->_v1).y = fVar10; } } else { room = g_game->_room; pEVar4 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar4->_pos).x; scratchVec.y = (pEVar4->_pos).y; Room::GetClampedPositionImpl(room,&local_14c,&scratchVec,100.0,100.0,100.0,100.0); local_130 = (AnimationState *)((local_14c.y - (npc->_pos).y) * 0.05); local_12c = (undefined1 *)((local_14c.x - (npc->_pos).x) * 0.05); fVar10 = sqrtf((float)local_130 * (float)local_130 + (float)local_12c * (float)local_12c); puVar8 = local_12c; pAVar9 = local_130; if (8.0 <= fVar10) { if ((15.0 < fVar10) && (0.0 < fVar10)) { puVar8 = (undefined1 *)((float)local_12c * (15.0 / fVar10)); pAVar9 = (AnimationState *)((float)local_130 * (15.0 / fVar10)); } } else if (0.0 < fVar10) { puVar8 = (undefined1 *)((float)local_12c * (8.0 / fVar10)); pAVar9 = (AnimationState *)((float)local_130 * (8.0 / fVar10)); } (npc->_targetPosition).x = (float)puVar8; (npc->_targetPosition).y = (float)pAVar9; (npc->_v1).y = 1.0; (npc->_sprite)._flipX = (float)puVar8 < 0.0; } npc->_stateFrame = npc->_stateFrame + 1; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { local_12c = (undefined1 *)npc->_state; uVar7 = Random(); if ((uVar7 & 1) != 0) { local_144 = &DAT_bf800000; } if (((npc->_variant == 1) && (npc->_state == 10)) && (npc->_i1 != 0)) { local_125 = '\x01'; } else { local_125 = '\0'; } iVar5 = 0; local_14c.y = 4.2039e-44; if (local_12c == (undefined1 *)0xb) { local_14c.y = 7.00649e-44; } do { local_124 = (float)iVar5 * 90.0; if (local_125 != '\0') { local_124 = local_124 + 45.0; } local_134 = (npc->_pos).x; local_130 = (AnimationState *)(npc->_pos).y; if (local_12c == (undefined1 *)0xb) { scratchVec.y = (float)local_130; } else { local_140 = (AnimationState *)(local_124 * 0.017453292); fVar10 = cos((float)local_140); local_134 = fVar10 * 10.0 + local_134 + 0.0; fVar10 = sin((float)local_140); scratchVec.y = fVar10 * 10.0 + ((float)local_130 - 20.0); } local_2c.x = 0.0; local_2c.y = -20.0; fVar10 = local_124; scratchVec.x = local_134; if (360.0 < ABS(local_124)) { fVar10 = fmodf(local_124,360.0); } if (fVar10 <= 180.0) { if (fVar10 < -180.0) { fVar10 = fVar10 + 360.0; } } else { fVar10 = fVar10 - 360.0; } laser = Entity_Laser::ShootAngle (1,&scratchVec,fVar10,(int)local_14c.y,&local_2c,(Entity *)npc,0); laser->_renderDepthOffset = -10.0; if (local_12c == (undefined1 *)0xb) { laser->_isActiveRotating = 1; laser->_rotationDelay = 0x1e; laser->_rotationDegrees = (float)local_144 * 90.0; laser->_rotationSpd = (float)local_144 + (float)local_144; } (**(code **)(*(int *)laser + 0xc))(); iVar5 = iVar5 + 1; } while (iVar5 < 4); ExceptionList = local_1c; return; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } LAB_0045cd38: npc->_state = 4; ExceptionList = local_1c; return; } npc->_stateFrame = npc->_stateFrame + 1; ANM2::Play(&npc->_sprite,s_Attack1,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(pAVar9,(byte *)"Shoot"); if (bVar2 != 0) { LAB_0045c021: if ((npc->_sprite)._animState._animData == (void *)0x0) { local_125 = 0; } else { local_125 = AnimationState::IsEventTriggered(pAVar9,(byte *)"Shoot"); } Entity_NPC::PlaySound(npc,(uint)local_125 * 2 + 0x6a,1.0,2,0,1.0); pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_124 = (pEVar4->_pos).x; local_134 = (pEVar4->_pos).y; pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_124 = ((pEVar4->_velocity).x * 10.0 + local_124) - (npc->_pos).x; local_134 = ((pEVar4->_velocity).y * 10.0 + local_134) - (npc->_pos).y; fVar10 = sqrtf(local_124 * local_124 + local_134 * local_134); if (fVar10 <= 0.0) { scratchVec.x = local_124; scratchVec.y = local_134; } else { scratchVec.x = local_124 * ((float)local_144 / fVar10); scratchVec.y = local_134 * ((float)local_144 / fVar10); } scratchVec.x = scratchVec.x * 8.2; scratchVec.y = scratchVec.y * 8.2; params = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,(local_125 ^ 1) * 2 + 2,params); ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(pAVar9,(byte *)"Shoot2"); if (bVar2 != 0) goto LAB_0045c021; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } } uVar7 = Random(); if ((uVar7 % 3 != 0) || (npc->_variant != 1)) goto LAB_0045cd38; Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,1.0); npc->_state = 10; if (npc->_variant == 1) { uVar7 = Random(); if ((uVar7 & 3) == 0) { npc->_state = 0xb; } if (((npc->_variant == 1) && (npc->_state == 10)) && ((uVar7 = Random(), (uVar7 & 1) == 0 || (g_game->_frameCount - npc->_spawnFrame < 0x3c)))) { iVar5 = 1; goto LAB_0045c22c; } } iVar5 = 0; LAB_0045c22c: npc->_i1 = iVar5; local_124 = 0.0; local_14c.x = 0.0; local_14c.y = -40.0; do { iVar5 = 0x16; afStack_34[1] = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; afStack_34[0] = 0.0; if (npc->_variant == 1) { iVar5 = 0x20; } local_2c.x = 0.0; local_2c.y = 0.0; local_50._0_4_ = 0.6; local_50._4_4_ = 0.05; local_50._8_4_ = 0.0; local_50._12_4_ = 0.8; if (npc->_i1 == 0) { fVar10 = 0.0; } else { fVar10 = 45.0; } local_134 = ((float)(int)local_124 * 90.0 + fVar10) * 0.017453292; scratchVec.x = cos(local_134); scratchVec.y = sin(local_134); Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_14c,&scratchVec,iVar5,(ColorMod *)local_50,4.0); local_124 = (float)((int)local_124 + 1); } while ((int)local_124 < 4); npc->_stateFrame = 0; (npc->_v1).x = 0.0; ExceptionList = local_1c; return; } PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); local_54 = &DAT_0000000f; local_58 = 4; local_78._16_4_ = (void *)0x6b6c6157; local_64 = 0; local_2c.y = 2.10195e-44; local_2c.x = 5.60519e-45; local_50._20_4_ = (void *)0x6b6c6157; fStack_38 = (float)((uint)fStack_38 & 0xffffff00); local_14 = 1.4013e-45; Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_50 + 0x14),(std_string *)(local_78 + 0x10),3.0) ; local_14 = (float)((uint)local_14 & 0xffffff00); if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar6 = (void *)local_50._20_4_; if (0xfff < uVar7) { pvVar6 = *(void **)(local_50._20_4_ + -4); uVar7 = (int)local_2c.y + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar6))) goto LAB_0045bc66; } operator_delete(pvVar6,uVar7); } local_14 = -NAN; local_2c.x = 0.0; local_2c.y = 2.10195e-44; local_50._20_4_ = local_50._20_4_ & 0xffffff00; if (&DAT_0000000f < local_54) { puVar8 = local_54 + 1; pvVar6 = (void *)local_78._16_4_; if ((undefined1 *)0xfff < puVar8) { pvVar6 = *(void **)(local_78._16_4_ + -4); puVar8 = local_54 + 0x24; if (0x1f < (uint)(local_78._16_4_ + (-4 - (int)pvVar6))) { LAB_0045bc66: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,(uint)puVar8); } local_58 = 0; local_54 = &DAT_0000000f; local_78._16_4_ = local_78._16_4_ & 0xffffff00; if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) { ExceptionList = local_1c; return; } uVar7 = Random(); if ((uVar7 % 3 != 0) && (local_124 != local_134)) { ExceptionList = local_1c; return; } pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_130 = (AnimationState *)((pEVar4->_pos).x - (npc->_pos).x); local_12c = (undefined1 *)((pEVar4->_pos).y - (npc->_pos).y); uVar7 = Random(); if ((uVar7 % 0x50 == 0) && (npc->_variant == 0)) { Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,1.0); npc->_state = 9; npc->_stateFrame = 0; ExceptionList = local_1c; return; } if ((npc->_variant != 1) || (((uVar7 = Random(), uVar7 % 0x14 != 0 || (((20.0 <= ABS((float)local_130) && (20.0 <= ABS((float)local_12c))) || (fVar10 = sqrtf((float)local_130 * (float)local_130 + (float)local_12c * (float)local_12c), 400.0 <= fVar10)))) && (uVar7 = Random(), uVar7 % 200 != 0)))) { uVar7 = Random(); if (uVar7 % 0x14 != 0) { ExceptionList = local_1c; return; } fVar10 = sqrtf((float)local_12c * (float)local_12c + (float)local_130 * (float)local_130); if (fVar10 < 230.0) { (npc->_sprite)._flipX = (float)local_130 < 0.0; npc->_state = 8; npc->_stateFrame = 0; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,1.0); npc->_state = 10; if (npc->_variant == 1) { uVar7 = Random(); if ((uVar7 & 3) == 0) { npc->_state = 0xb; } if (((npc->_variant == 1) && (npc->_state == 10)) && ((uVar7 = Random(), (uVar7 & 1) == 0 || (g_game->_frameCount - npc->_spawnFrame < 0x3c)))) { iVar5 = 1; goto LAB_0045be5f; } } iVar5 = 0; LAB_0045be5f: npc->_i1 = iVar5; local_124 = 0.0; local_14c.x = 0.0; local_14c.y = -40.0; do { iVar5 = 0x16; afStack_34[1] = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; afStack_34[0] = 0.0; if (npc->_variant == 1) { iVar5 = 0x20; } local_2c.x = 0.0; local_2c.y = 0.0; local_50._0_4_ = 0.6; local_50._4_4_ = 0.05; local_50._8_4_ = 0.0; local_50._12_4_ = 0.8; if (npc->_i1 == 0) { fVar10 = 0.0; } else { fVar10 = 45.0; } local_134 = ((float)(int)local_124 * 90.0 + fVar10) * 0.017453292; scratchVec.x = cos(local_134); scratchVec.y = sin(local_134); Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_14c,&scratchVec,iVar5,(ColorMod *)local_50,4.0); local_124 = (float)((int)local_124 + 1); } while ((int)local_124 < 4); npc->_stateFrame = 0; ExceptionList = local_1c; return; } //@@ 0045cd60 NpcAI::ENTITY_HEADLESS_HORSEMAN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 82 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HEADLESS_HORSEMAN(Entity_NPC *npc) { undefined1 *puVar1; byte bVar2; uint uVar3; ProjectileParams *params; Entity *target; Entity_Projectile *projectile; undefined4 *damageEvent; Vector *resultVec; byte *pbVar4; byte *pbVar5; int3 extraout_var; void *pvVar6; int iVar7; char *pcVar8; bool bVar9; float fVar10; float fVar11; float fVar12; float chargeSpeed; Vector shotVelocity; Vector local_1c0; float local_1b8; float local_1b4; Vector local_1b0; ProjectileParams headProjParams; ProjectileParams bodyProjParams; void *walkAnimName; char local_50; uint walkAnimSize; uint walkAnimCapacity; void *walkAnimName2; char local_38; uint walkAnimSize2; uint walkAnimCapacity2; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; int prevStateFrame; void *room; pvVar6 = ExceptionList; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af2665; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; iVar7 = npc->_state; if (iVar7 == 0) goto LAB_0045d7a7; local_24 = uVar3; if (npc->_type == 0x52) { ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; if (iVar7 == 4) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); walkAnimCapacity2 = 0xf; walkAnimSize2 = 4; walkAnimName2 = (void *)0x6b6c6157; local_38 = '\0'; walkAnimCapacity = 0xf; walkAnimSize = 4; walkAnimName = (void *)0x6b6c6157; local_50 = '\0'; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimName,(std_string *)&walkAnimName2,3.0); local_14 = local_14 & 0xffffff00; if (0xf < walkAnimCapacity) { uVar3 = walkAnimCapacity + 1; pvVar6 = walkAnimName; if (0xfff < uVar3) { pvVar6 = *(void **)((int)walkAnimName + -4); uVar3 = walkAnimCapacity + 0x24; if (0x1f < (uint)((int)walkAnimName + (-4 - (int)pvVar6))) goto LAB_0045ceba; } operator_delete(pvVar6,uVar3); } local_14 = 0xffffffff; walkAnimSize = 0; walkAnimCapacity = 0xf; walkAnimName = (void *)((uint)walkAnimName & 0xffffff00); if (0xf < walkAnimCapacity2) { uVar3 = walkAnimCapacity2 + 1; pvVar6 = walkAnimName2; if (0xfff < uVar3) { pvVar6 = *(void **)((int)walkAnimName2 + -4); uVar3 = walkAnimCapacity2 + 0x24; if (0x1f < (uint)((int)walkAnimName2 + (-4 - (int)pvVar6))) { LAB_0045ceba: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar3); } walkAnimSize2 = 0; walkAnimCapacity2 = 0xf; walkAnimName2 = (void *)((uint)walkAnimName2 & 0xffffff00); if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) { ExceptionList = local_1c; return; } uVar3 = Random(); if (uVar3 % 0x28 != 0) { ExceptionList = local_1c; return; } npc->_state = 8; npc->_stateFrame = 0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar2 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; ExceptionList = local_1c; return; } if (iVar7 != 8) { ExceptionList = pvVar6; return; } prevStateFrame = npc->_stateFrame; iVar7 = prevStateFrame + 1; npc->_stateFrame = iVar7; if (prevStateFrame == 9) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); params = ProjectileParams::ProjectileParams(&bodyProjParams); target = Entity_NPC::GetPlayerTarget(npc); local_1b0.x = (target->_pos).x; local_1b0.y = (target->_pos).y; projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_1b0,10.0,params); fVar10 = (projectile->_velocity).x; chargeSpeed = (projectile->_velocity).y; flagsHigh = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x102; projectile->_fallingAccel = projectile->_fallingAccel - 0.3; fVar11 = projectile->_fallingSpeed; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = flagsHigh; projectile->_scale = 1.6; projectile->_fallingSpeed = fVar11 * 0.7 - 13.0; projectile->_height = projectile->_height - 27.0; (projectile->_velocity).x = fVar10 * 0.55; (projectile->_velocity).y = chargeSpeed * 0.55; resultVec = &local_1c0; if ((npc->_sprite)._flipX == 0) { local_1b0.x = 10.0; local_1b0.y = 0.0; resultVec = &local_1b0; } else { local_1c0.x = -10.0; local_1c0.y = 0.0; } fVar10 = resultVec->y; iVar7 = *(int *)projectile; (projectile->_pos).x = (projectile->_pos).x + resultVec->x; (projectile->_pos).y = (projectile->_pos).y + fVar10; (**(code **)(iVar7 + 0xc))(uVar3); ExceptionList = local_1c; return; } } else { if (npc->_type != 0x53) { return; } ExceptionList = &local_1c; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (damageEvent[4] == 0x52) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); iVar7 = npc->_state; } npc->_entityGridCollisionClass = 2; npc->_friction = npc->_friction * 0.8; if (iVar7 == 8) { room = g_game->_room; local_1b8 = *(float *)((int)room + 0x14); local_1b0.y = *(float *)((int)room + 0x18); local_1c0.y = *(float *)((int)room + 0x1c); local_1b4 = *(float *)((int)room + 0x20); if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = pvVar6; return; } puVar1 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_sprite)._animState._isPlaying == 0) { pbVar4 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar8 = "Charge"; do { bVar2 = *pbVar4; bVar9 = bVar2 < (byte)*pcVar8; if (bVar2 != *pcVar8) { LAB_0045d5a6: uVar3 = -(uint)bVar9 | 1; goto LAB_0045d5ab; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar9 = bVar2 < (byte)pcVar8[1]; if (bVar2 != pcVar8[1]) goto LAB_0045d5a6; pbVar4 = pbVar4 + 2; pcVar8 = pcVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0045d5ab: puVar1 = (undefined1 *)((int)register0x00000010 + -4); if (uVar3 == 0) { pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 != (byte *)0x0) { pbVar5 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar5 = *(byte **)pbVar4; } pcVar8 = "Charge Shake"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*pcVar8; if (bVar2 != *pcVar8) { LAB_0045d5f0: uVar3 = -(uint)bVar9 | 1; goto LAB_0045d5f5; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)pcVar8[1]; if (bVar2 != pcVar8[1]) goto LAB_0045d5f0; pbVar5 = pbVar5 + 2; pcVar8 = pcVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0045d5f5: if ((uVar3 == 0) && ((puVar1 = (undefined1 *)((int)register0x00000010 + -4), pbVar4[0x34] == 0 || (puVar1 = (undefined1 *)((int)register0x00000010 + -4), (npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0045d647; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge Shake",1); puVar1 = puStack_20; if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; puVar1 = puStack_20; } } } LAB_0045d647: puStack_20 = puVar1; fVar10 = 0.0; if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._isPlaying == 0) { ExceptionList = local_1c; return; } pbVar4 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar8 = "Charge Shake"; do { bVar2 = *pbVar4; bVar9 = bVar2 < (byte)*pcVar8; if (bVar2 != *pcVar8) { LAB_0045d690: uVar3 = -(uint)bVar9 | 1; goto LAB_0045d695; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar9 = bVar2 < (byte)pcVar8[1]; if (bVar2 != pcVar8[1]) goto LAB_0045d690; pbVar4 = pbVar4 + 2; pcVar8 = pcVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0045d695: if (uVar3 != 0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._flipX == 0) { chargeSpeed = 18.0; } else { chargeSpeed = -18.0; } (npc->_velocity).x = chargeSpeed; bVar2 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar2) != 0 && -1 < extraout_var) { chargeSpeed = chargeSpeed * 1.25; (npc->_velocity).x = chargeSpeed; } if ((chargeSpeed <= fVar10) || ((npc->_pos).x <= local_1c0.y + 200.0)) { if ((chargeSpeed < fVar10) && ((npc->_pos).x <= local_1b8 - 200.0 && local_1b8 - 200.0 != (npc->_pos).x)) { (npc->_pos).x = local_1c0.y + 200.0; goto LAB_0045d725; } } else { (npc->_pos).x = local_1b8 - 200.0; LAB_0045d725: npc->_stateFrame = npc->_stateFrame + -1; fVar11 = (local_1b4 - local_1b0.y) * 0.3; fVar12 = fVar11 + (npc->_pos).y; (npc->_pos).y = fVar12; if (local_1b4 - 40.0 < fVar12) { (npc->_pos).y = fVar12 - fVar11 * 3.0; } } if (0 < npc->_stateFrame) { ExceptionList = local_1c; return; } if ((fVar10 <= chargeSpeed) || (fVar11 = (npc->_targetPosition).x, fVar11 < (npc->_pos).x || fVar11 == (npc->_pos).x)) { if (chargeSpeed <= fVar10) { ExceptionList = local_1c; return; } fVar10 = (npc->_pos).x; if (fVar10 < (npc->_targetPosition).x || fVar10 == (npc->_targetPosition).x) { ExceptionList = local_1c; return; } } goto LAB_0045d7a7; } npc->_entityGridCollisionClass = 3; if (iVar7 == 4) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); walkAnimCapacity = 0xf; walkAnimSize = 4; walkAnimName = (void *)0x6b6c6157; local_50 = '\0'; walkAnimCapacity2 = 0xf; walkAnimSize2 = 4; walkAnimName2 = (void *)0x6b6c6157; local_38 = '\0'; local_14 = 3; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimName2,(std_string *)&walkAnimName,2.0); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < walkAnimCapacity2) { uVar3 = walkAnimCapacity2 + 1; pvVar6 = walkAnimName2; if (0xfff < uVar3) { pvVar6 = *(void **)((int)walkAnimName2 + -4); uVar3 = walkAnimCapacity2 + 0x24; if (0x1f < (uint)((int)walkAnimName2 + (-4 - (int)pvVar6))) goto LAB_0045d243; } operator_delete(pvVar6,uVar3); } local_14 = 0xffffffff; walkAnimSize2 = 0; walkAnimCapacity2 = 0xf; walkAnimName2 = (void *)((uint)walkAnimName2 & 0xffffff00); if (0xf < walkAnimCapacity) { uVar3 = walkAnimCapacity + 1; pvVar6 = walkAnimName; if (0xfff < uVar3) { pvVar6 = *(void **)((int)walkAnimName + -4); uVar3 = walkAnimCapacity + 0x24; if (0x1f < (uint)((int)walkAnimName + (-4 - (int)pvVar6))) { LAB_0045d243: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar3); } resultVec = Entity_NPC::CalcTargetPosition(npc,&local_1b0,0.0); local_1b8 = resultVec->x - (npc->_pos).x; local_1b4 = resultVec->y - (npc->_pos).y; uVar3 = Random(); if ((uVar3 % 0x1e == 0) && (fVar10 = sqrtf(local_1b8 * local_1b8 + local_1b4 * local_1b4), fVar10 < 200.0)) { npc->_state = 9; npc->_stateFrame = 0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar2 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; ExceptionList = local_1c; return; } uVar3 = Random(); if (uVar3 % 0x78 != 0) { if (20.0 <= ABS(local_1b4)) { ExceptionList = local_1c; return; } uVar3 = Random(); if (uVar3 % 0x50 != 0) { ExceptionList = local_1c; return; } } if ((npc->_flags & 0x1000a00) != 0) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); (npc->_sprite)._flipX = local_1b8 < 0.0; npc->_state = 8; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } uVar3 = Random(); npc->_stateFrame = uVar3 % 3 + 1; ExceptionList = local_1c; return; } if (iVar7 != 9) { ExceptionList = pvVar6; return; } prevStateFrame = npc->_stateFrame; iVar7 = prevStateFrame + 1; npc->_stateFrame = iVar7; if (prevStateFrame == 0xd) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Entity_NPC::PlaySound(npc,0x6c,1.0,2,0,1.0); target = Entity_NPC::GetPlayerTarget(npc); local_1b0.y = (target->_pos).x; local_1c0.y = (target->_pos).y; target = Entity_NPC::GetPlayerTarget(npc); local_1b0.x = ((target->_velocity).x * 10.0 + local_1b0.y) - (npc->_pos).x; local_1b0.y = ((target->_velocity).y * 10.0 + local_1c0.y) - (npc->_pos).y; resultVec = Vector::Normalized(&local_1b0,&local_1c0); shotVelocity.y = resultVec->y * 9.2; shotVelocity.x = resultVec->x * 9.2; params = ProjectileParams::ProjectileParams(&headProjParams); Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVelocity,2,params); ExceptionList = local_1c; return; } } if (iVar7 < 0x1f) { ExceptionList = pvVar6; return; } LAB_0045d7a7: npc->_state = 4; ExceptionList = local_1c; return; } //@@ 0045d7d0 NpcAI::ENTITY_DARK_ONE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 267 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DARK_ONE(Entity_NPC *npc) { Vector *position; float *pfVar1; byte bVar2; Entity *playerTarget; int iVar3; uint uVar4; ColorMod *color; byte *pbVar5; Entity_Laser *laser; byte *expectedName; bool bVar6; float fVar7; float fVar8; float fVar9; float chargeSteer; Vector local_100; float toTargetY; Vector scratchVec [6]; ProjectileParams projParams; float local_14; float friction; Game *game; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); npc->_entityGridCollisionClass = 2; playerTarget = Entity_NPC::GetPlayerTarget(npc); position = &npc->_pos; local_100.y = (playerTarget->_pos).x - position->x; toTargetY = (playerTarget->_pos).y - (npc->_pos).y; iVar3 = npc->_state; if (iVar3 == 0) { npc->_state = 4; npc->_stateFrame = 0; return; } npc->_friction = 0.8; if (iVar3 != 10) { fVar7 = npc->_size; Room::GetClampedPositionImpl(g_game->_room,scratchVec,position,fVar7,fVar7,fVar7,fVar7); position->x = scratchVec[0].x; (npc->_pos).y = scratchVec[0].y; iVar3 = npc->_state; } if (iVar3 == 4) { npc->_stateFrame = npc->_stateFrame + 1; ANM2::Play(&npc->_sprite,s_Walk,0); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { bVar2 = Entity::IsFrame((Entity *)npc,0x3c,npc->_index); if ((bVar2 == 0) || (uVar4 = Random(), 2 < ((byte)uVar4 & 3))) { bVar6 = false; } else { bVar6 = true; } if ((((npc->_flags & 0x1000800) == 0) && (!bVar6)) || (0.0 < g_game->_darknessModifier)) { bVar2 = Entity::IsFrame((Entity *)npc,10,npc->_index); if ((bVar2 == 0) || (uVar4 = Random(), uVar4 % 6 != 0)) { if (((((20.0 <= ABS(toTargetY)) || (bVar2 = Entity::IsFrame((Entity *)npc,10,npc->_index), bVar2 == 0)) || (uVar4 = Random(), (uVar4 & 1) != 0)) && (((g_game->_darknessModifier <= 0.0 || (bVar2 = Entity::IsFrame((Entity *)npc,10,npc->_index), bVar2 == 0)) || (uVar4 = Random(), uVar4 % 5 != 0)))) || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 != 0)) { if (((ABS(local_100.y) < 40.0) && (0.0 < toTargetY)) && ((bVar2 = Entity::IsFrame((Entity *)npc,10,npc->_index), bVar2 != 0 && (uVar4 = Random(), (uVar4 & 1) == 0)))) { npc->_state = 9; npc->_stateFrame = 0; color = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec[0].x = cos(1.5707964); scratchVec[0].y = sin(1.5707964); Entity::SpawnFollowingEffect198((Entity *)npc,&g_vectorZero,scratchVec,0x16,color,4.0) ; } } else { Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); (npc->_sprite)._flipX = local_100.y < 0.0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 10; npc->_stateFrame = 0; } } else { npc->_state = 8; npc->_stateFrame = 0; } } else { npc->_state = 0x10; npc->_stateFrame = 0; Entity_NPC::PlaySound(npc,0x68,1.0,2,0,1.0); } } goto LAB_0045e004; } if (iVar3 == 8) { npc->_stateFrame = npc->_stateFrame + 1; pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_0045dc27: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } expectedName = s_Attack1; do { bVar2 = *pbVar5; bVar6 = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_0045dc07: uVar4 = -(uint)bVar6 | 1; goto LAB_0045dc0c; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar6 = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_0045dc07; pbVar5 = pbVar5 + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0045dc0c: if ((uVar4 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0045dc27; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = -17.0; projParams.FallingSpeedModifier = 1.3; scratchVec[0].x = 9.0; scratchVec[0].y = 12.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,scratchVec,9,&projParams); } LAB_0045dde8: if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { npc->_state = 4; npc->_stateFrame = 0; } goto LAB_0045e004; } } } else if (iVar3 == 9) { npc->_stateFrame = npc->_stateFrame + 1; pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_0045dd40: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Attack2,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } expectedName = s_Attack2; do { bVar2 = *pbVar5; bVar6 = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_0045dd20: uVar4 = -(uint)bVar6 | 1; goto LAB_0045dd25; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar6 = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_0045dd20; pbVar5 = pbVar5 + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0045dd25: if ((uVar4 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0045dd40; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { scratchVec[0].x = 0.0; local_100.x = (npc->_pos).x + 0.0; scratchVec[0].y = -20.0; local_100.y = (npc->_pos).y + 5.0; laser = Entity_Laser::ShootAngle(1,&local_100,90.0,10,scratchVec,(Entity *)npc,0); (**(code **)(*(int *)laser + 0xc))(); } goto LAB_0045dde8; } } else { if (iVar3 != 10) { if (iVar3 == 0x10) { ANM2::Play(&npc->_sprite,(byte *)"Darkness",0); npc->_stateFrame = npc->_stateFrame + 1; game = g_game; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; game->_darknessStrength = 1.0; game->_darknessTimeout = 0xb4; } } goto LAB_0045e004; } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Charge"); if (bVar2 != 0) { npc->_stateFrame = 1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Charge Shake",0); } iVar3 = npc->_stateFrame; if (0 < iVar3) { if ((npc->_sprite)._flipX == 0) { fVar7 = 22.0; } else { fVar7 = -22.0; } chargeSteer = -toTargetY / 100.0; fVar9 = (npc->_velocity).y; fVar8 = npc->_speedMultiplier; friction = npc->_friction; (npc->_velocity).x = fVar7; if (chargeSteer <= 0.4) { if (chargeSteer < -0.4) { (npc->_velocity).y = (fVar8 * 0.4) / friction + fVar9; goto LAB_0045df09; } fVar8 = fVar8 * chargeSteer; } else { fVar8 = fVar8 * 0.4; } (npc->_velocity).y = fVar9 - fVar8 / friction; } LAB_0045df09: fVar7 = (npc->_velocity).x; fVar9 = *(float *)((int)g_game->_room + 0x14); fVar8 = *(float *)((int)g_game->_room + 0x1c); if ((fVar7 <= 0.0) || (position->x <= fVar8 + 100.0)) { if ((fVar7 < 0.0) && (fVar9 = fVar9 - 100.0, position->x <= fVar9 && fVar9 != position->x)) { position->x = fVar8 + 100.0; goto LAB_0045df5e; } } else { position->x = fVar9 - 100.0; LAB_0045df5e: npc->_stateFrame = iVar3 + 1; } if ((npc->_stateFrame < 3) || (((0.0 <= fVar7 || (fVar9 = (npc->_targetPosition).x, fVar9 < position->x || fVar9 == position->x)) && ((fVar7 <= 0.0 || (position->x < (npc->_targetPosition).x || position->x == (npc->_targetPosition).x)))))) goto LAB_0045e004; } npc->_state = 4; npc->_stateFrame = 0; LAB_0045e004: if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (pfVar1 = &(npc->_pos).y, *pfVar1 <= 320.0 && *pfVar1 != 320.0)) { (npc->_pos).y = 320.0; } return; } //@@ 0045e050 NpcAI::ENTITY_ADVERSARY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 268 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ADVERSARY(Entity_NPC *npc) { Game *pGVar1; ANM2 *pAVar2; byte bVar3; Entity *tmpEntity; Vector *targetPos; undefined4 *damageEvent; byte *curAnim; uint uVar4; ColorMod *trailColor; Entity_Laser *laser; std_string *curAnimName; byte *pbVar5; int iVar6; byte *pbVar7; int unused; undefined1 ptr [4]; void **ppvVar8; int iVar9; bool bVar10; float laserOffsetY; float fVar11; float fVar12; undefined1 auStack_78 [3]; byte local_75; void **local_74; float local_70; Vector local_6c; float local_64; Entity_NPC *local_60; Vector targetPosOut; undefined1 local_54 [4]; undefined1 *local_50; uint local_48 [3]; undefined4 local_3c; uint local_c; uint *animNameSize; AnimationState *animState; char *attackAnim; EntityPtr *effectParent; float jumpStartX; float jumpStartY; EntityPtr oldParent; float *posY; void *room; float spiderLandY; local_c = __security_cookie ^ (uint)auStack_78; iVar9 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_60 = npc; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_64 = (tmpEntity->_pos).x - (npc->_pos).x; local_70 = (tmpEntity->_pos).y - (npc->_pos).y; targetPos = Entity_NPC::CalcTargetPosition(npc,&targetPosOut,0.0); local_74 = (void **)(targetPos->x - (npc->_pos).x); local_6c.x = targetPos->y - (npc->_pos).y; if (npc->_state == 0) { npc->_state = 4; npc->_stateFrame = 0; return; } npc->_friction = 0.85; if (((0.0 < npc->_pendingDamage) && ((npc->_pendingDamageFlags & 4) != 0)) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (damageEvent[4] == npc->_type) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } if (0 < npc->_i2) { npc->_i2 = npc->_i2 - iVar9; } iVar6 = npc->_state; if (iVar6 == 4) { npc->_stateFrame = npc->_stateFrame + iVar9; curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0045e1cf: bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } pbVar5 = s_Walk; do { bVar3 = *curAnim; bVar10 = bVar3 < *pbVar5; if (bVar3 != *pbVar5) { LAB_0045e1b7: uVar4 = -(uint)bVar10 | 1; goto LAB_0045e1bc; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar10 = bVar3 < pbVar5[1]; if (bVar3 != pbVar5[1]) goto LAB_0045e1b7; curAnim = curAnim + 2; pbVar5 = pbVar5 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0045e1bc: if ((uVar4 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0045e1cf; } PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) goto LAB_0045eea5; local_50 = (undefined1 *)(npc->_pos).y; local_54 = (undefined1 [4])(npc->_pos).x; local_75 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),(Vector *)local_54); local_74 = (void **)0x1e; if (npc->_health / npc->_maxHitPoints < 0.3) { local_74 = (void **)0xf; } if (((((npc->_flags & 0x4000) == 0) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)) && ((g_game->_frameCount + npc->_index) % ((int)local_74 * 2) == 0)) && (uVar4 = Random(), ((byte)uVar4 & 3) < 3)) { bVar10 = true; } else { bVar10 = false; } if ((((npc->_flags & 0x1000800) != 0) || (bVar10)) && (g_game->_darknessModifier <= 0.0)) { npc->_state = 0x10; npc->_stateFrame = 0; goto LAB_0045eea5; } if (((local_75 == 0) || (bVar3 = Entity::IsFrame((Entity *)npc,(int)local_74,npc->_index), bVar3 == 0)) || ((uVar4 = Random(), uVar4 % 3 != 0 || (0 < npc->_i2)))) { iVar6 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar9 = 0; if (0 < iVar6) { iVar9 = iVar6; } if (((iVar9 < 3) && (bVar3 = Entity::IsFrame((Entity *)npc,(int)local_74,npc->_index), bVar3 != 0)) && (uVar4 = Random(), uVar4 % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); npc->_state = 0xd; goto LAB_0045eea5; } if (((((npc->_flags & 0x4000) != 0) || (bVar3 = Game::IsPaused(g_game), bVar3 != 0)) || ((g_game->_frameCount + npc->_index) % (int)local_74 != 0)) || (uVar4 = Random(), uVar4 % 3 != 0)) goto LAB_0045eea5; npc->_state = 6; curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0045e678: bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1ddc0,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } pbVar5 = &DAT_00b1ddc0; do { bVar3 = *curAnim; bVar10 = bVar3 < *pbVar5; if (bVar3 != *pbVar5) { LAB_0045e660: uVar4 = -(uint)bVar10 | 1; goto LAB_0045e665; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar10 = bVar3 < pbVar5[1]; if (bVar3 != pbVar5[1]) goto LAB_0045e660; curAnim = curAnim + 2; pbVar5 = pbVar5 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0045e665: if ((uVar4 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0045e678; } npc->_stateFrame = 0; Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); goto LAB_0045eea5; } npc->_state = 8; npc->_stateFrame = 0; Entity_NPC::PlaySound(npc,0x76,1.0,2,0,1.0); if (ABS(local_70) <= ABS(local_64)) { if (0.0 <= local_64) { npc->_i1 = 2; fVar12 = 0.0; local_54 = (undefined1 [4])0x41f00000; } else { npc->_i1 = 0; fVar12 = 180.0; local_54 = (undefined1 [4])0xc1f00000; } LAB_0045e444: local_50 = &DAT_c1c80000; } else { npc->_i1 = (uint)(0.0 <= local_70) * 2 + 1; switch(0.0 <= local_70) { case false: fVar12 = 270.0; local_54 = (undefined1 [4])0x0; goto LAB_0045e444; case true: fVar12 = 90.0; local_54 = (undefined1 [4])0x0; local_50 = (undefined1 *)0xc0a00000; } } trailColor = (ColorMod *)Color::Color(0x3f4ccccd); local_64 = fVar12 * 0.017453292; local_6c.x = cos(local_64); local_6c.y = sin(local_64); Entity::SpawnFollowingEffect198((Entity *)npc,(Vector *)local_54,&local_6c,0x1c,trailColor,4.0); bVar3 = Entity::IsFriendly((Entity *)npc); if (bVar3 == 0) { Entity_NPC::QueryNPCsType(local_54,npc->_type,npc->_variant); uVar4 = 0; if (local_48[0] != 0) { do { iVar9 = *(int *)(local_50 + uVar4 * 4); if (((iVar9 != 0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)(iVar9 + 0x28) == 1)) || (*(int *)(iVar9 + 0x28) - 10U < 0x3de)))) && ((*(char *)(iVar9 + 0x173) == '\0' && ((*(uint *)(iVar9 + 0x168) & 0x20000000) == 0)))) { *(undefined4 *)(iVar9 + 0xbc4) = 0x5a; } uVar4 = uVar4 + 1; } while (uVar4 < local_48[0]); npc = local_60; } EntityList_Query::~EntityList_Query(local_54); } goto LAB_0045eea5; } if (iVar6 != 8) { if (iVar6 == 0xd) { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0045e86e: bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { pbVar5 = *(byte **)curAnim; } pbVar7 = s_Attack1; do { bVar3 = *pbVar5; bVar10 = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_0045e850: uVar4 = -(uint)bVar10 | 1; goto LAB_0045e855; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar10 = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_0045e850; pbVar5 = pbVar5 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0045e855: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0045e86e; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Skin Pull"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x109,0.7,2,0,1.0); iVar6 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar9 = 0; if (0 < iVar6) { iVar9 = iVar6; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { iVar9 = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused,(void *)0x0); } if (-1 < -iVar9 + 3) { ppvVar8 = &g_game->_room; local_70 = (float)(-iVar9 + 4); do { Room::FindFreePickupSpawnPosition (*ppvVar8,(Vector *)local_54,&npc->_pos,100.0,0,0,0); uVar4 = Random(); Game::SpawnEx(g_game,0x55,0,(Vector *)local_54,&g_vectorZero,(Entity *)npc,0,uVar4,0 ); local_60 = (Entity_NPC *)__RTDynamicCast(); ppvVar8 = &g_game->_room; room = *ppvVar8; iVar6 = (int)(((float)local_54 - 40.0) / 40.0 + 0.5); iVar9 = (int)(((float)local_50 - 120.0) / 40.0 + 0.5); if (((((-1 < iVar6) && (iVar6 < *(int *)((int)room + 0xc))) && (-1 < iVar9)) && ((iVar9 < *(int *)((int)room + 0x10) && (uVar4 = iVar9 * *(int *)((int)room + 0xc) + iVar6, uVar4 < 0x1c0)))) && (*(int *)((int)room + uVar4 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)room + uVar4 * 4 + 0x76c) = 900; } local_70 = (float)((int)local_70 + -1); fVar12 = (local_60->_pos).x; fVar11 = (local_60->_posOffset).y; (local_60->_targetPosition).x = fVar12; spiderLandY = (local_60->_pos).y; (local_60->_targetPosition).y = spiderLandY; jumpStartX = (npc->_pos).x; (local_60->_pos).x = jumpStartX; jumpStartY = (npc->_pos).y; (local_60->_pos).y = jumpStartY; (local_60->_posOffset).y = fVar11 - 10.0; local_60->_state = 6; fVar11 = (fVar12 - jumpStartX) * 0.04; (local_60->_v2).y = -8.0; fVar12 = (spiderLandY - jumpStartY) * 0.04; (local_60->_velocity).x = fVar11; (local_60->_v1).x = fVar11; (local_60->_velocity).y = fVar12; (local_60->_v1).y = fVar12; local_74 = ppvVar8; } while (local_70 != 0.0); } } goto LAB_0045edef; } } goto LAB_0045ee02; } if (iVar6 != 6) { if (iVar6 == 0x10) { ANM2::Play(&npc->_sprite,(byte *)"Scream",0); npc->_stateFrame = npc->_stateFrame + iVar9; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Scream"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,1.0); } pGVar1 = g_game; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; pGVar1->_darknessStrength = 1.0; pGVar1->_darknessTimeout = 0xb4; } } goto LAB_0045eea5; } npc->_stateFrame = npc->_stateFrame + iVar9; curAnimName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)local_54); animNameSize = &curAnimName->_size; if (0xf < curAnimName->_capacity) { curAnimName = *(std_string **)curAnimName->_buf; } local_75 = str_eq((byte *)curAnimName,*animNameSize,&DAT_00b1ddc0,5); if (0xf < local_48[2]) { uVar4 = local_48[2] + 1; ptr = local_54; if (0xfff < uVar4) { ptr = *(undefined1 (*) [4])((int)local_54 + -4); uVar4 = local_48[2] + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar4); } if (local_75 != 0) { bVar3 = ANM2::WasEventTriggered(&npc->_sprite,s_Fly); if (bVar3 != 0) { local_54 = (undefined1 [4])local_74; local_50 = (undefined1 *)local_6c.x; Vector::Normalize((Vector *)local_54); fVar12 = npc->_speedMultiplier; (npc->_velocity).x = (float)local_54 * 1.3 * fVar12 + (npc->_velocity).x; (npc->_velocity).y = (float)local_50 * 1.3 * fVar12 + (npc->_velocity).y; } npc->_entityCollisionClass = 0; if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (Entity_NPC::PlaySound(npc,0x74,0.8,0x3c,0,1.0), 0x4b < npc->_stateFrame)) { ANM2::Play(&npc->_sprite,(byte *)"FlyDown",0); } goto LAB_0045eea5; } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Land); if (bVar3 != 0) { npc->_entityCollisionClass = 4; uVar4 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x3d,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4,0); oldParent = tmpEntity->_parent; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = '\x14'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; effectParent = &tmpEntity->_parent; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x14'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; fVar12 = npc->_size; *(float *)tmpEntity[1]._sprite._filename._buf = fVar12; *(float *)(tmpEntity[1]._sprite._filename._buf + 4) = fVar12 + 75.0; if (oldParent != (EntityPtr)0x0) { local_6c.x = (float)effectParent; std::multiset::erase(&local_6c); } *effectParent = (EntityPtr)npc; std::multiset::insert(effectParent); Game::ShakeScreen(g_game,0xf); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Game::BombDamage(g_game,&npc->_pos,50.0,npc->_size,0,(Entity *)npc,g_tearFlagsNone,0x1000000,0 ); ShockwaveParams::ShockwaveParams(local_54); local_54 = (undefined1 [4])(npc->_pos).x; local_50 = (undefined1 *)(npc->_pos).y; pGVar1 = g_game->_room; local_3c = 0xd; local_48[1] = 0x3ccccccd; local_48[0]._0_1_ = '\n'; local_48[0]._1_1_ = -0x29; local_48[0]._2_1_ = '#'; local_48[0]._3_1_ = '='; ppvVar8 = &pGVar1->_roomList[0x9d].Data; *ppvVar8 = (void *)((int)*ppvVar8 + 1); uVar4 = (uint)pGVar1->_roomList[0x9d].Data & 0x80000001; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(pGVar1,uVar4,local_54); } goto LAB_0045edef; } npc->_stateFrame = npc->_stateFrame + iVar9; switch(npc->_i1) { case 0: attackAnim = "Attack2Left"; break; case 1: attackAnim = "Attack2Up"; break; case 2: attackAnim = "Attack2Right"; break; case 3: attackAnim = "Attack2Down"; break; default: goto LAB_0045e70d; } ANM2::Play(&npc->_sprite,(byte *)attackAnim,0); LAB_0045e70d: if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0045ee02; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 == 0) goto LAB_0045edef; fVar11 = 0.0; fVar12 = g_vectorZero.x; laserOffsetY = g_vectorZero.y; switch(npc->_i1) { case 0: fVar11 = 180.0; fVar12 = -30.0; break; case 1: fVar11 = 270.0; fVar12 = 0.0; break; case 2: fVar12 = 30.0; break; case 3: fVar11 = 90.0; fVar12 = 0.0; laserOffsetY = -5.0; default: goto LAB_0045e798; } laserOffsetY = (float)&DAT_c1c80000; LAB_0045e798: local_6c.x = fVar12 + (npc->_pos).x; local_6c.y = laserOffsetY + (npc->_pos).y; local_54 = (undefined1 [4])0x0; local_50 = &DAT_c1c80000; laser = Entity_Laser::ShootAngle(1,&local_6c,fVar11,10,(Vector *)local_54,(Entity *)npc,0); laser->_homingType = 2; if (npc->_i1 == 3) { laser->_renderDepthOffset = 10.0; } (**(code **)(*(int *)laser + 0xc))(); LAB_0045edef: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_0045ee02: npc->_state = 4; npc->_stateFrame = 0; } LAB_0045eea5: if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (posY = &(npc->_pos).y, *posY <= 320.0 && *posY != 320.0)) { (npc->_pos).y = 320.0; } return; } //@@ 0045ef20 NpcAI::ENTITY_MEGA_MAW /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 262 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MEGA_MAW(Entity_NPC *npc) { Vector *position; float *pfVar1; float fVar2; byte bVar3; Entity *tmpEntity; uint rngResult; ProjectileParams *params; uint extraBulletFlag; Vector *pVVar4; int iVar5; int iVar6; int unused; int unused_00; int unused_01; int iVar7; bool isCanSummon; float fVar8; float fVar9; Vector scratchVec; float local_cc; Vector local_c8; Vector resultVec; ProjectileParams projParams; undefined4 local_1c; uint local_c; Room *room; local_c = __security_cookie ^ (uint)&scratchVec; local_c8.x = (float)((uint)(npc->_subtype == 2) * 2 + 4); if ((npc->_flags & 0x1000000000000000) != 0) { local_c8.x = 4.2039e-45; } fVar9 = local_c8.x; if (npc->_state == 0) { npc->_state = 3; npc->_stateFrame = 0; if (npc->_deliriumBossType == 0) { (npc->_pos).y = (npc->_pos).y - 60.0; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; return; } position = &npc->_pos; npc->_friction = npc->_friction * 0.8; fVar8 = (npc->_targetPosition).y; fVar2 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - position->x; (npc->_velocity).y = fVar8 - fVar2; iVar7 = npc->_state; if (iVar7 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); iVar7 = 0x14; if (npc->_health / npc->_maxHitPoints < 0.3) { iVar7 = 10; } if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) { return; } if ((((npc->_subtype == 1) || (tmpEntity = Entity_NPC::GetPlayerTarget(npc), fVar8 = (tmpEntity->_pos).y - 40.0, pfVar1 = &(npc->_pos).y, fVar8 < *pfVar1 || fVar8 == *pfVar1)) || (bVar3 = Entity::IsFrame((Entity *)npc,iVar7,0), bVar3 == 0)) || (rngResult = Random(), (rngResult & 3) != 0)) { if ((npc->_subtype == 1) || (((npc->_subtype != 2 && (bVar3 = Entity::IsFrame((Entity *)npc,iVar7,0), bVar3 != 0)) && (rngResult = Random(), rngResult % 3 == 0)))) { npc->_state = 9; } else { iVar5 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar6 = 0; if (0 < iVar5) { iVar6 = iVar5; } if ((int)fVar9 < iVar6) { return; } bVar3 = Entity::IsFrame((Entity *)npc,iVar7 * 2,0); if (bVar3 == 0) { return; } rngResult = Random(); if ((rngResult & 1) != 0) { return; } iVar6 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar7 = 0; if (0 < iVar6) { iVar7 = iVar6; } isCanSummon = iVar7 <= (int)fVar9; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { if (npc->_subtype == 2) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x32e,0,unused,(void *)0x0); iVar5 = Entity::CountRelatedEntities((Entity *)npc,0x5e,0,unused_00,(void *)0x0); iVar7 = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused_01,(void *)0x0); iVar7 = iVar7 + iVar6 + iVar5; isCanSummon = SBORROW4(iVar7,(int)local_c8.x); iVar7 = iVar7 - (int)local_c8.x; } else { iVar7 = Entity::CountRelatedEntities((Entity *)npc,0x1d,0,unused,(void *)0x0); isCanSummon = SBORROW4(iVar7,(int)fVar9); iVar7 = iVar7 - (int)fVar9; } isCanSummon = isCanSummon != iVar7 < 0; } if (!isCanSummon) { return; } npc->_state = 0xd; } } else { npc->_state = 8; } LAB_0045fbb9: npc->_i1 = 0; return; } if (iVar7 == 8) { ANM2::Play(&npc->_sprite,&DAT_00b1d47c,0); Entity_NPC::PlaySound(npc,0x136,1.0,0x3c,0,1.0); if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0045f862; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.y = (tmpEntity->_pos).y; scratchVec.x = (tmpEntity->_pos).x; local_cc = scratchVec.y - (npc->_pos).y; local_c8.x = scratchVec.x - position->x; fVar9 = sqrtf(local_cc * local_cc + local_c8.x * local_c8.x); if (fVar9 <= 0.0) { fVar8 = local_c8.x; fVar9 = local_cc; } else { fVar8 = local_c8.x * (1.0 / fVar9); fVar9 = local_cc * (1.0 / fVar9); } if (fVar8 * 0.0 + fVar9 < 0.3) { scratchVec.y = (tmpEntity->_pos).y + 100.0; } params = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireBossProjectiles(npc,0xf,&scratchVec,0.0,params); Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); } goto LAB_0045f84f; } if (iVar7 != 9) { if (iVar7 != 0xd) { return; } if (npc->_i1 == 0) { ANM2::Play(&npc->_sprite,(byte *)"SummonTell",0); Entity_NPC::PlaySound(npc,0x138,1.0,0x3c,0,1.0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = 1; return; } return; } if (npc->_i1 != 1) { return; } ANM2::Play(&npc->_sprite,(byte *)"Summon",0); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { if (npc->_subtype == 2) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; pVVar4 = Room::FindFreePickupSpawnPosition(room,&resultVec,&scratchVec,0.0,0,0,0); Entity_NPC::ThrowSpider(position,(Entity *)npc,*pVVar4,0,-30.0); rngResult = Random(); if ((rngResult & 1) == 0) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; pVVar4 = Room::FindFreePickupSpawnPosition(room,&resultVec,&scratchVec,0.0,0,0,0); Entity_NPC::ThrowSpider(position,(Entity *)npc,*pVVar4,0,-30.0); } } else { rngResult = Random(); scratchVec.x = position->x + 0.0; scratchVec.y = (npc->_pos).y + 0.0; tmpEntity = Game::SpawnEx(g_game,0x1d,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,rngResult, 0); iVar7 = __RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); local_c8.x = position->x + 0.0; local_c8.y = (npc->_pos).y + 150.0; Room::FindFreePickupSpawnPosition(g_game->_room,&resultVec,&local_c8,40.0,0,0,0); *(float *)(iVar7 + 0x334) = resultVec.x; *(float *)(iVar7 + 0x338) = resultVec.y; *(undefined4 *)(iVar7 + 0xb64) = 4; *(undefined4 *)(iVar7 + 0x410) = 5; bVar3 = ANM2::SetAnimation((ANM2 *)(iVar7 + 0x48),&DAT_00b1de1c,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar7 + 0x78)); *(undefined1 *)(iVar7 + 0x8c) = 1; } if (*(int *)(iVar7 + 0x7c) != 0) { AnimationState::SetFrameFloat((AnimationState *)(iVar7 + 0x78),5.0); } } Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return; } npc->_state = 3; goto LAB_0045fbb9; } ANM2::Play(&npc->_sprite,(byte *)"FireRing",0); if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0045f862; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { pVVar4 = &npc->_pos; if (npc->_subtype == 1) { ProjectileParams::ProjectileParams(&projParams); projParams.TargetPosition.x = pVVar4->x; projParams.TargetPosition.y = (npc->_pos).y; projParams.Scale = projParams.Scale * 1.5; projParams.FallingSpeedModifier = (float)&DAT_bf800000; rngResult = Random(); switch(rngResult & 3) { case 0: rngResult = Random(); extraBulletFlag = 0x800; if ((rngResult & 1) != 0) { extraBulletFlag = 0x1000; } projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | extraBulletFlag | 0x2000; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { local_1c = 0x40e00000; } scratchVec.x = 15.0; goto LAB_0045f833; case 1: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x40; rngResult = Random(); projParams.CircleAngle = normalize_angle_degrees ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 360.0); bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { local_1c = 0x40e00000; } scratchVec.x = 12.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,pVVar4,&scratchVec,9,&projParams); scratchVec.x = 10.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,pVVar4,&scratchVec,9,&projParams); scratchVec.x = 8.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,pVVar4,&scratchVec,9,&projParams); scratchVec.x = 6.0; scratchVec.y = 10.0; break; case 2: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x402000; tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x - position->x; scratchVec.y = (tmpEntity->_pos).y - (npc->_pos).y; pVVar4 = Vector::Normalized(&scratchVec,&resultVec); projParams.FireDirectionLimit.x = pVVar4->x; projParams.FireDirectionLimit.y = pVVar4->y; projParams.DotProductLimit = 0.3; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { local_1c = 0x40e00000; } local_cc = 4.0; do { scratchVec.y = 10.0; scratchVec.x = local_cc; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); local_cc = local_cc + 1.0; projParams.WiggleFrameOffset = projParams.WiggleFrameOffset + 2; } while (local_cc <= 10.0); goto LAB_0045f84f; case 3: rngResult = Random(); extraBulletFlag = 0x40000; if ((rngResult & 1) != 0) { extraBulletFlag = 0x80000; } projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | extraBulletFlag | 0x2000; tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x - position->x; scratchVec.y = (tmpEntity->_pos).y - (npc->_pos).y; pVVar4 = Vector::Normalized(&scratchVec,&resultVec); projParams.FireDirectionLimit.x = pVVar4->x; projParams.FireDirectionLimit.y = pVVar4->y; projParams.DotProductLimit = 0.25; projParams.CurvingStrength = 0.005; projParams.FallingAccelModifier = -0.003; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { local_1c = 0x40e00000; } scratchVec.x = 12.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); scratchVec.x = 10.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); scratchVec.x = 8.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); scratchVec.x = 6.0; scratchVec.y = 10.0; } } else { Entity_NPC::PlaySound(npc,0x130,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 2; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34e28); projParams.TargetPosition.x = pVVar4->x; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x2080; projParams.TargetPosition.y = (npc->_pos).y; projParams.HeightModifier = 18.5; projParams.FallingAccelModifier = -0.06; projParams.FallingSpeedModifier = -2.0; projParams.GridCollision = 0; projParams.VelocityMulti = 1.05; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { local_1c = 0x40e00000; } rngResult = Random(); switch(rngResult & 3) { case 0: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x800; break; case 1: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x1000; break; case 2: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x800; scratchVec.x = 10.0; scratchVec.y = 5.0; Entity_NPC::FireProjectiles(npc,pVVar4,&scratchVec,9,&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x1000; scratchVec.x = 7.0; scratchVec.y = 5.0; goto LAB_0045f848; } scratchVec.x = 10.0; LAB_0045f833: scratchVec.y = 9.0; } LAB_0045f848: Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projParams); } LAB_0045f84f: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return; } LAB_0045f862: npc->_state = 3; return; } //@@ 0045fc00 NpcAI::ENTITY_GATE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: type 263; was MinimapConfig::Render */ void __fastcall NpcAI::ENTITY_GATE(Entity_NPC *npc) { Vector *position; float *pfVar1; byte bVar2; int iVar3; int iVar4; int iVar5; Entity_Laser *laser; Entity *laser; float fVar7; int unused; int unused_00; uint uVar8; bool isCanSpawn; undefined1 *spinDir; float fVar9; Vector local_d8; Vector local_d0; Vector spawnPos; Vector landingPos; ProjectileParams projParams; uint local_c; local_c = __security_cookie ^ (uint)&local_d8; if (npc->_state == 0) { npc->_state = 3; npc->_stateFrame = 0; if (npc->_deliriumBossType == 0) { (npc->_pos).y = (npc->_pos).y - 40.0; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; return; } position = &npc->_pos; npc->_friction = npc->_friction * 0.8; fVar9 = (npc->_targetPosition).y; fVar7 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - position->x; (npc->_velocity).y = fVar9 - fVar7; iVar4 = npc->_state; if (iVar4 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); uVar8 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; if ((uVar8 != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) { return; } local_d8.x = 2.8026e-44; local_d0.x = 1.0; if (npc->_health / npc->_maxHitPoints < 0.3) { local_d8.x = 1.4013e-44; } iVar3 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar4 = 0; if (0 < iVar3) { iVar4 = iVar3; } switch(iVar4) { case 2: local_d0.x = 0.5; break; case 3: local_d0.x = 0.25; break; case 4: local_d0.x = 0.125; break; case 5: local_d0.x = 0.0625; break; case 6: local_d0.x = 0.0; } isCanSpawn = iVar4 < 5; if (uVar8 != 0) { if (npc->_subtype == 2) { iVar4 = Entity::CountRelatedEntities((Entity *)npc,0x32e,0,iVar4,(void *)0x0); iVar3 = Entity::CountRelatedEntities((Entity *)npc,0x5e,0,unused,(void *)0x0); iVar5 = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused_00,(void *)0x0); isCanSpawn = iVar5 + iVar4 + iVar3 < 3; } else { uVar8 = Entity::CountRelatedEntities((Entity *)npc,0x22,0,iVar4,(void *)0x0); isCanSpawn = uVar8 < 3; } } if (((!isCanSpawn) || (bVar2 = Entity::IsFrame((Entity *)npc,(int)local_d8.x,0), bVar2 == 0)) || (uVar8 = Random(), local_d0.x <= (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10)) { if (npc->_subtype != 2) { iVar3 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar4 = 0; if (0 < iVar3) { iVar4 = iVar3; } if (((2 < iVar4) && (bVar2 = Entity::IsFrame((Entity *)npc,(int)local_d8.x,0), bVar2 != 0)) && ((iVar4 = Isaac::Random((int)(0xc / (longlong)iVar4)), iVar4 == 0 && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 == 0)))) { npc->_state = 8; goto LAB_0045fee9; } } bVar2 = Entity::IsFrame((Entity *)npc,(int)local_d8.x,0); if ((bVar2 == 0) || (uVar8 = Random(), (uVar8 & 1) != 0)) goto LAB_0045fef3; npc->_state = 9; } else { npc->_state = 0xd; } LAB_0045fee9: npc->_i1 = 0; LAB_0045fef3: if (npc->_subtype == 1) { npc->_state = 9; npc->_i1 = 0; uVar8 = Random(); npc->_i2 = uVar8 & 3; uVar8 = Random(); (npc->_v1).x = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0 - 180.0; uVar8 = Random(); if ((uVar8 & 1) == 0) { spinDir = &DAT_bf800000; } else { spinDir = (undefined1 *)0x3f800000; } (npc->_v1).y = (float)spinDir; iVar4 = npc->_stateFrame; npc->_stateFrame = iVar4 + -1; if (0 < iVar4) { npc->_state = 3; return; } } return; } if (iVar4 == 8) { if (npc->_i1 != 0) { if (npc->_i1 != 1) { return; } ANM2::Play(&npc->_sprite,(byte *)"Shooting",0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); local_d8.x = 0.0; local_d8.y = -30.0; laser = Entity_Laser::ShootAngle(1,&npc->_pos,90.0,10,&local_d8,(Entity *)npc,0); laser->_renderDepthOffset = 100.0; laser->_homingType = 1; (**(code **)(*(int *)laser + 0xc))(); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; return; } return; } ANM2::Play(&npc->_sprite,(byte *)"Charging",0); iVar4 = 0x138; LAB_0045ffee: Entity_NPC::PlaySound(npc,iVar4,1.0,0x3c,0,1.0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = 1; return; } return; } if (iVar4 != 9) { if (iVar4 != 0xd) { return; } ANM2::Play(&npc->_sprite,s_Spawn,0); Entity_NPC::PlaySound(npc,0x70,1.0,0x3c,0,1.0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x72,1.0,2,0,1.0); if (npc->_subtype == 2) { laser = Entity_NPC::GetPlayerTarget(npc); local_d8.x = (laser->_pos).x; local_d8.y = (laser->_pos).y; local_d0.x = (npc->_pos).x + 0.0; local_d0.y = (npc->_pos).y + 0.5; Entity_NPC::ThrowSpider(&local_d0,(Entity *)npc,laser->_pos,1,-100.0); } else { uVar8 = Random(); spawnPos.x = (npc->_pos).x + 0.0; spawnPos.y = (npc->_pos).y - 60.0; laser = Game::SpawnEx(g_game,0x22,0,&spawnPos,&g_vectorZero,(Entity *)npc,0,uVar8,0); fVar7 = (float)__RTDynamicCast(laser,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); local_d0.x = fVar7; Room::FindFreePickupSpawnPosition(g_game->_room,&landingPos,&npc->_pos,150.0,0,0,0); local_d8.x = (float)((int)fVar7 + 0x48); *(float *)((int)fVar7 + 0x334) = landingPos.x; *(float *)((int)fVar7 + 0x338) = landingPos.y; *(undefined4 *)((int)fVar7 + 0xb64) = 6; *(undefined4 *)((int)fVar7 + 0x410) = 5; bVar2 = ANM2::SetAnimation((ANM2 *)local_d8.x,(byte *)"BigJumpUp",1); fVar9 = local_d8.x; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)local_d8.x + 0x30)); ((AnimationState *)((int)fVar9 + 0x30))->_isPlaying = 1; fVar7 = local_d0.x; } if (*(int *)((int)fVar7 + 0x7c) != 0) { AnimationState::SetFrameFloat((AnimationState *)((int)fVar7 + 0x78),5.0); } *(undefined4 *)((int)fVar7 + 0x354) = 100000; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { *(undefined4 *)((int)fVar7 + 0x380) = 0x41200000; *(undefined4 *)((int)fVar7 + 900) = 0x41200000; } } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_i1 = 0; return; } return; } if (npc->_i1 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Charging",0); iVar4 = 0x136; goto LAB_0045ffee; } if (npc->_i1 != 1) { return; } ANM2::Play(&npc->_sprite,(byte *)"Shooting",0); if (npc->_subtype != 1) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) goto LAB_004604b0; Entity_NPC::PlaySound(npc,0x130,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.TargetPosition.x = position->x; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x2080; projParams.TargetPosition.y = (npc->_pos).y; projParams.HeightModifier = 18.5; projParams.FallingAccelModifier = -0.06; projParams.FallingSpeedModifier = -2.0; projParams.GridCollision = 0; projParams.VelocityMulti = 1.05; projParams.Scale = 1.8; uVar8 = Random(); switch(uVar8 & 3) { case 0: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x800; break; case 1: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x1000; break; case 2: projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x800; local_d8.x = 10.0; local_d8.y = 6.0; Entity_NPC::FireProjectiles(npc,position,&local_d8,9,&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x1000; local_d8.x = 7.0; local_d8.y = 6.0; goto code_r0x0046049c; case 3: local_d8.y = 11.0; goto code_r0x00460494; } local_d8.y = 9.0; goto code_r0x00460494; } bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar2 == 0) goto LAB_004604b0; ProjectileParams::ProjectileParams(&projParams); projParams.TargetPosition.x = position->x; projParams.TargetPosition.y = (npc->_pos).y; projParams.HeightModifier = 18.5; projParams.FallingAccelModifier = -0.06; projParams.FallingSpeedModifier = -2.0; projParams.Scale = 1.75; switch(npc->_i2) { case 0: bVar2 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (bVar2 == 0) goto LAB_004604b0; projParams.CircleAngle = (npc->_v1).x; projParams.BulletFlags._0_4_ = 0x2000000; projParams.BulletFlags._4_4_ = 0; local_d8.y = 8.0; goto code_r0x00460494; case 1: bVar2 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (bVar2 == 0) goto LAB_004604b0; projParams.CircleAngle = (npc->_v1).x; uVar8 = 0x40000; pfVar1 = &(npc->_v1).y; if (0.0 < *pfVar1 || *pfVar1 == 0.0) { uVar8 = 0x80000; } projParams.FallingAccelModifier = -0.05; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | uVar8 | 0x2000; local_d8.y = 8.0; code_r0x00460494: local_d8.x = 10.0; break; case 2: bVar2 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (bVar2 == 0) goto LAB_004604b0; fVar9 = sin((float)(g_game->_frameCount - npc->_spawnFrame) * 0.15); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x240000; projParams.CircleAngle = fVar9 * 0.2 + (npc->_v1).x; local_d8.x = 5.0; local_d8.y = 7.0; break; case 3: bVar2 = Entity::IsFrame((Entity *)npc,10,npc->_index); if (bVar2 == 0) goto LAB_004604b0; local_d8.x = 5.0; local_d8.y = 5.0; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; projParams.HomingStrength = 0.3; projParams.CircleAngle = (float)(g_game->_frameCount - npc->_spawnFrame) * 1.5 + (npc->_v1).x; break; default: goto LAB_004604b0; } code_r0x0046049c: Entity_NPC::FireProjectiles(npc,position,&local_d8,9,&projParams); LAB_004604b0: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0x1e; return; } return; } //@@ 00460780 NpcAI::ENTITY_MEGA_FATTY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 264 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MEGA_FATTY(Entity_NPC *npc) { void **ppvVar1; ANM2 *pAVar2; byte bVar3; LayerState *layer; undefined4 *puVar4; byte *pbVar5; uint uVar6; Entity *pEVar7; int iVar8; Vector *pVVar9; float *pfVar10; Vector *pVVar11; ProjectileParams *params; uint uVar12; void *pvVar13; GridEntity *poop; byte *pbVar14; char *pcVar15; float *pfVar16; int unused; byte *pbVar17; int iVar18; AnimationState *animState; GridEntity *pGVar19; bool bVar20; float fVar21; float fVar22; float fVar23; float fVar24; undefined8 in_stack_fffffe1c; undefined1 auVar25 [16]; undefined1 auVar26 [16]; undefined1 auVar27 [16]; undefined1 auVar28 [16]; undefined1 auVar29 [16]; undefined1 auVar30 [16]; undefined1 auVar31 [16]; undefined1 auVar32 [16]; undefined1 auVar33 [16]; undefined1 auVar34 [16]; undefined1 auVar35 [16]; undefined1 auVar36 [16]; undefined1 auVar37 [16]; undefined1 auVar38 [16]; undefined1 auVar39 [16]; float shockwavePosX; float shockwavePosY; undefined4 local_1bc; undefined4 local_1b8; undefined4 shockwaveDuration; Vector scratchVec; Vector local_1a4; float local_19c; Vector local_198; Vector local_190; Vector local_188; void *local_180; void *local_17c; ProjectileParams bossProjParams; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; EntityPtr *parentPtr; Room *room; Game *shockwaveRoom; pvVar13 = ExceptionList; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af26aa; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; ExceptionList = &local_1c; local_198.y = (float)npc; if (npc->_state == 0) { (npc->_shadowOffset).y = 5.0; npc->_state = 3; npc->_stateFrame = 0; npc->_i2 = 0; if (npc->_subtype != 1) { ExceptionList = pvVar13; return; } pbVar17 = (byte *)0x2; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); do { layer = ANM2::GetLayer(&npc->_sprite,pbVar17); pbVar17 = pbVar17 + 1; layer->_visible = 0; } while ((int)pbVar17 < 8); ExceptionList = local_1c; return; } local_180 = (void *)0x0; if ((npc->_subtype == 1) && (puVar4 = (npc->_damageEvents)._begin, puVar4 != (npc->_damageEvents)._end)) { do { if ((puVar4[2] & 0x200) != 0) { *puVar4 = 0; } puVar4 = puVar4 + 0xe; } while (puVar4 != (npc->_damageEvents)._end); } local_190.y = (float)&(npc->_sprite)._animState; pfVar16 = (&projParams)[1].Color._tint + 2; if ((npc->_sprite)._animState._animData != (void *)0x0) { auVar25._8_4_ = 0x46087c; auVar25._0_8_ = in_stack_fffffe1c; auVar25._12_4_ = "EndSucking"; bVar3 = AnimationState::IsEventTriggered((AnimationState *)local_190.y,(byte *)"EndSucking"); manager = g_manager; in_stack_fffffe1c = auVar25._0_8_; if (bVar3 != 0) { local_17c = (void *)0x3bc; seed_fart_sound_override((int *)&local_17c); auVar26._4_12_ = SUB1612(ZEXT416(0x3f800000) << 0x40,4); auVar26._0_4_ = 2; SoundEffects::Play(&manager->_sfxManager,(int)local_17c,1.0,2,0,1.0,0.0); in_stack_fffffe1c = auVar26._0_8_; local_190.y = (float)&(npc->_sprite)._animState; } pfVar16 = (float *)puStack_20; if ((npc->_sprite)._animState._animData != (void *)0x0) { auVar27._8_4_ = 0x4608e5; auVar27._0_8_ = in_stack_fffffe1c; auVar27._12_4_ = "StartSucking"; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"StartSucking"); manager = g_manager; in_stack_fffffe1c = auVar27._0_8_; pfVar16 = (float *)puStack_20; if (bVar3 != 0) { local_17c = (void *)0x3bd; seed_fart_sound_override((int *)&local_17c); auVar28._4_12_ = SUB1612(ZEXT416(0x3f800000) << 0x40,4); auVar28._0_4_ = 2; SoundEffects::Play(&manager->_sfxManager,(int)local_17c,1.0,2,0,1.0,0.0); in_stack_fffffe1c = auVar28._0_8_; pfVar16 = (float *)puStack_20; } } } puStack_20 = (undefined1 *)pfVar16; iVar18 = npc->_state; if (iVar18 != 3) { if (iVar18 != 0x10) { if (iVar18 == 8) { pbVar17 = (npc->_sprite)._animState._animData; if (pbVar17 == (byte *)0x0) { LAB_00460f54: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Puking",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar5 = *(byte **)pbVar17; } pcVar15 = "Puking"; do { bVar3 = *pbVar5; bVar20 = bVar3 < (byte)*pcVar15; if (bVar3 != *pcVar15) { LAB_00460f36: uVar6 = -(uint)bVar20 | 1; goto LAB_00460f3b; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar20 = bVar3 < (byte)pcVar15[1]; if (bVar3 != pcVar15[1]) goto LAB_00460f36; pbVar5 = pbVar5 + 2; pcVar15 = pcVar15 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_00460f3b: if ((uVar6 != 0) || ((pbVar17[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00460f54; } animState = (AnimationState *)local_190.y; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered((AnimationState *)local_190.y,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x137,1.0,2,0,1.0); manager = g_manager; local_180 = (void *)0x3be; seed_fart_sound_override((int *)&local_180); SoundEffects::Play(&manager->_sfxManager,(int)local_180,1.0,2,0,1.0,0.0); animState = (AnimationState *)local_190.y; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"Shoot"); if ((bVar3 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"StopShooting"), bVar3 == 0)))) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_19c = (pEVar7->_pos).x - (npc->_pos).x; local_17c = (void *)((pEVar7->_pos).y - (npc->_pos).y); if (npc->_subtype == 1) { bVar3 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (bVar3 != 0) { ProjectileParams::ProjectileParams(&projParams); local_188.x = 5.0; local_188.y = 4.0; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x200000; projParams.HeightModifier = -40.0; projParams.Scale = 1.5; projParams.FallingSpeedModifier = 1.5; projParams.CircleAngle = (float)(g_game->_frameCount - npc->_spawnFrame) * 0.05; projParams.Variant = 3; local_198.x = (npc->_pos).x - 0.0; local_198.y = (npc->_pos).y - 8.0; Entity_NPC::FireProjectiles(npc,&local_198,&local_188,9,&projParams); } } else { iVar18 = ANM2::GetFrame(&npc->_sprite); fVar21 = ((float)iVar18 - 10.0) / 15.0; if (fVar21 <= 0.0) { fVar21 = 0.0; } if (1.0 <= fVar21) { fVar21 = 1.0; } local_1a4.y = fVar21 + fVar21 + 1.0; ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = -300.0; projParams.FallingSpeedModifier = -40.0; projParams.FallingAccelModifier = 2.0; uVar6 = Random(); projParams.Variant = 3; projParams.Scale = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.5; pVVar9 = MusicManager::RandomVector(&scratchVec); uVar6 = Random(); local_198.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_188.y = pVVar9->x; local_180 = (void *)pVVar9->y; pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_190.x = local_188.y * local_198.y * local_1a4.y + local_19c * 0.025 + (pEVar7->_velocity).x * 0.6; local_190.y = (float)local_180 * local_198.y * local_1a4.y + (float)local_17c * 0.025 + (pEVar7->_velocity).y * 0.6; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_190,0,&projParams); } } goto LAB_00461c93; } } } else { if (iVar18 == 6) { iVar18 = npc->_i1; if (iVar18 < 2) { pbVar17 = (npc->_sprite)._animState._animData; if (pbVar17 == (byte *)0x0) { LAB_00461380: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Jumping",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar5 = *(byte **)pbVar17; } pcVar15 = "Jumping"; do { bVar3 = *pbVar5; bVar20 = bVar3 < (byte)*pcVar15; if (bVar3 != *pcVar15) { LAB_00461362: uVar6 = -(uint)bVar20 | 1; goto LAB_00461367; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar20 = bVar3 < (byte)pcVar15[1]; if (bVar3 != pcVar15[1]) goto LAB_00461362; pbVar5 = pbVar5 + 2; pcVar15 = pcVar15 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_00461367: if ((uVar6 != 0) || ((pbVar17[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00461380; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004613ea: npc->_i1 = 2; iVar18 = 2; goto LAB_004613f9; } bVar3 = AnimationState::IsEventTriggered (&(npc->_sprite)._animState,(byte *)"EarlyTransition"); if ((bVar3 != 0) && (npc->_i1 == 1)) { npc->_i1 = 3; iVar18 = 3; goto LAB_004613f9; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004613ea; iVar18 = npc->_i1; if (iVar18 != 0) goto LAB_004613f9; } else { LAB_004613f9: fVar21 = (npc->_targetPosition).x - (npc->_pos).x; fVar24 = (npc->_targetPosition).y - (npc->_pos).y; if ((fVar24 * fVar24 + fVar21 * fVar21 < 2.0) || (iVar18 == 3)) { npc->_state = 7; } } animState = (AnimationState *)local_190.y; if ((npc->_sprite)._animState._animData == (void *)0x0) { animState = &(npc->_sprite)._animState; } else { bVar3 = AnimationState::IsEventTriggered((AnimationState *)local_190.y,s_Jump); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } } if ((npc->_i1 != 0) || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar3 = AnimationState::WasEventTriggered(animState,s_Jump), bVar3 != 0)))) { fVar21 = (npc->_v1).x + 0.02; if (1.0 <= fVar21) { fVar21 = 1.0; } (npc->_v1).x = fVar21; fVar24 = (npc->_pos).x; fVar22 = (npc->_pos).y; fVar23 = (npc->_targetPosition).y; (npc->_velocity).x = (fVar24 * (1.0 - fVar21) + fVar21 * (npc->_targetPosition).x) - fVar24; (npc->_velocity).y = (fVar21 * fVar23 + fVar22 * (1.0 - fVar21)) - fVar22; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; } goto LAB_00461cb6; } if (iVar18 == 7) { pbVar17 = (npc->_sprite)._animState._animData; if (pbVar17 == (byte *)0x0) { LAB_0046159e: auVar29._8_4_ = "Landing"; auVar29._0_8_ = in_stack_fffffe1c; auVar29._12_4_ = 1; auVar30._8_8_ = auVar29._8_8_; auVar30._0_8_ = 0x4615ac00000000; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Landing",1); auVar31._0_12_ = auVar30._0_12_; in_stack_fffffe1c = auVar30._0_8_; if (bVar3 != 0) { auVar31._12_4_ = 0x4615b8; AnimationState::Rewind(&(npc->_sprite)._animState); in_stack_fffffe1c = auVar31._0_8_; (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar5 = *(byte **)pbVar17; } pcVar15 = "Landing"; do { bVar3 = *pbVar5; bVar20 = bVar3 < (byte)*pcVar15; if (bVar3 != *pcVar15) { LAB_00461580: uVar6 = -(uint)bVar20 | 1; goto LAB_00461585; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar20 = bVar3 < (byte)pcVar15[1]; if (bVar3 != pcVar15[1]) goto LAB_00461580; pbVar5 = pbVar5 + 2; pcVar15 = pcVar15 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_00461585: if ((uVar6 != 0) || ((pbVar17[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0046159e; } pVVar9 = &npc->_pos; if (npc->_entityGridCollisionClass == 0) { local_198.x = pVVar9->x; local_198.y = (npc->_pos).y; local_188.y = (float)g_game->_room; auVar32._8_4_ = local_198.x; auVar32._0_8_ = in_stack_fffffe1c; auVar32._12_4_ = local_198.y; iVar18 = Room::GetGridCollisionAtPos((Room *)local_188.y,auVar32._8_8_); if (iVar18 != 0) { pVVar11 = Room::FindFreeTilePosition((Room *)local_188.y,&scratchVec,pVVar9,80.0); pVVar9->x = pVVar11->x; (npc->_pos).y = pVVar11->y; } npc->_entityGridCollisionClass = 5; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Landed"); if (bVar3 != 0) { npc->_entityCollisionClass = 4; if (npc->_subtype == 1) { params = ProjectileParams::ProjectileParams(&projParams); local_188.x = 10.0; local_188.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_188,9,params); Entity_NPC::MakeSplat(npc,3.0); } else if ((npc->_subtype == 2) && (npc->_i1 != 3)) { uVar6 = Random(); local_1a4.y = 360.0 / ((float)((uVar6 & 1) + 3) + 0.0); do { uVar6 = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,0, uVar6,0); local_198.y = (float)__RTDynamicCast(pEVar7); parentPtr = &((Entity_NPC *)local_198.y)->_parent; if (*(int *)&(((Entity_NPC *)local_198.y)->_parent).field_0x0 != 0) { local_188.y = (float)parentPtr; std::multiset::erase(); } *parentPtr = (EntityPtr)npc; std::multiset::insert(); *(void **)&((NPCAI_Pathfinder *)((int)local_198.y + 0x414))->field_0x60 = local_180; local_180 = (void *)((float)local_180 + local_1a4.y); } while ((float)local_180 < 360.0); } else { local_190.y = (float)&DAT_00000005; do { uVar6 = Random(); uVar12 = Random(); fVar21 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_180 = (void *)(fVar21 + fVar21); uVar12 = Random(); local_17c = (void *)((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 75.0); fVar21 = cos((float)local_180); local_188.x = fVar21 * (float)local_17c + (npc->_pos).x; fVar21 = sin((float)local_180); local_188.y = fVar21 * (float)local_17c + (npc->_pos).y; pEVar7 = Game::SpawnEx(g_game,1000,0x16,&local_188,&g_vectorZero,(Entity *)npc,0, uVar6,0); iVar18 = __RTDynamicCast(pEVar7); local_190.y = (float)((int)&((AnimationState *)((int)local_190.y + -0x20))-> _previouslyTriggeredEvents + 3); fVar21 = g_vectorOne.y * 2.0; *(float *)(iVar18 + 0xe4) = g_vectorOne.x * 2.0; *(float *)(iVar18 + 0xe8) = fVar21; } while ((AnimationState *)local_190.y != (AnimationState *)0x0); } Game::ShakeScreen(g_game,10); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); ShockwaveParams::ShockwaveParams(&shockwavePosX); shockwavePosX = (npc->_pos).x; shockwavePosY = (npc->_pos).y; shockwaveRoom = g_game->_room; shockwaveDuration = 0xd; local_1b8 = 0x3ccccccd; local_1bc = 0x3d23d70a; ppvVar1 = &shockwaveRoom->_roomList[0x9d].Data; *ppvVar1 = (void *)((int)*ppvVar1 + 1); uVar6 = (uint)shockwaveRoom->_roomList[0x9d].Data & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(shockwaveRoom,uVar6,&shockwavePosX); } goto LAB_00461c93; } } else { if (iVar18 != 10) goto LAB_00461cb6; auVar33._8_4_ = &DAT_00b1deb4; auVar33._0_8_ = 0x4619e600000000; auVar33._12_4_ = 0; ANM2::Play(&npc->_sprite,&DAT_00b1deb4,0); auVar34._0_8_ = auVar33._0_8_; auVar34._8_4_ = 0; auVar34._12_4_ = 0x10000000; bVar3 = Entity::HasEntityFlags((Entity *)npc,auVar34._8_8_); local_188.y = 1.12104e-44; if (bVar3 != 0) { local_188.y = 4.2039e-45; } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1deb4); if (bVar3 != 0) { uVar6 = Random(); pVVar11 = &npc->_pos; auVar35._4_12_ = SUB1612(ZEXT416(uVar6) << 0x40,4); auVar35._0_4_ = npc; Game::SpawnEx(g_game,1000,0x22,pVVar11,&g_vectorZero,(Entity *)npc,0,uVar6,0); auVar36._0_8_ = auVar35._0_8_; auVar36._8_4_ = 0; auVar36._12_4_ = 0x3f800000; auVar37._8_8_ = auVar36._8_8_; auVar37._0_8_ = 0x200000000; auVar38._4_12_ = auVar37._4_12_; auVar38._0_4_ = 0x3f800000; pVVar9 = (Vector *)0x461a67; Entity_NPC::PlaySound(npc,0x3ea,1.0,2,0,1.0); auVar39._0_8_ = auVar38._0_8_; auVar39._8_4_ = 0; auVar39._12_4_ = 0x10000000; local_180 = (void *)((uint)(npc->_subtype == 2) * 4 + 4); bVar3 = Entity::HasEntityFlags((Entity *)npc,auVar39._8_8_); if (bVar3 == 0) { pvVar13 = local_180; } else { iVar18 = Entity::CountRelatedEntities((Entity *)npc,0xd9,0,unused,(void *)0x0); pvVar13 = (void *)((int)local_180 - iVar18); } if (npc->_subtype == 1) { LAB_00461cec: if ((npc->_subtype == 1) && ((npc->_i2 < (int)local_188.y && (uVar6 = Random(), (uVar6 & 1) == 0)))) { room = g_game->_room; pVVar9 = &scratchVec; pVVar11 = Room::FindFreePickupSpawnPosition(room,pVVar9,&npc->_pos,60.0,0,0,0); pvVar13 = (void *)Room::GetGridIndex(room,pVVar11); local_17c = g_game->_room; local_180 = pvVar13; if ((((void *)0x1bf < pvVar13) || (((iVar18 = *(int *)((int)local_17c + (int)pvVar13 * 4 + 0x24), iVar18 == 0 || (iVar18 = *(int *)(iVar18 + 4), iVar18 == 1)) || (iVar18 == 10)))) && (*(int *)((int)local_17c + 8) != 0x10)) { local_188.y = (float)RNG::Next(&npc->_dropRNG); if (((int)pvVar13 < 0) || (0x1bf < (int)pvVar13)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((pvVar13 < (void *)0x1c0) && (*(int *)((int)local_17c + (int)pvVar13 * 4 + 0x76c) < 0x385)) { poop = operator_new(0x19c); local_14 = 9.80909e-45; local_198.y = (float)poop; if (poop == (GridEntity *)0x0) { pGVar19 = (GridEntity *)0x0; } else { GridEntity::GridEntity(poop); *(undefined ***)poop = IsaacRepentancePlus::GridEntity_Poop::vftable; poop[1]._desc._type = 0; poop[1]._desc._spawnSeed = 0; poop[1]._desc._varData = 0xf; *(undefined1 *)&poop[1]._desc._type = 0; poop[1]._desc._variableSeed = 0; poop[1]._gridIndex = 0; poop[1]._spawnFrame = 0; poop[1]._rng._seed = 0; fVar21 = g_vectorZero.y; poop[1]._rng._shift1 = (int)g_vectorZero.x; poop[1]._rng._shift2 = (int)fVar21; fVar21 = g_vectorZero.y; poop[1]._rng._shift3 = (int)g_vectorZero.x; poop[1]._collisionClass = (int)fVar21; pGVar19 = poop + 1; (pGVar19->_sprite)._filename._buf[0] = '\0'; (pGVar19->_sprite)._filename._buf[1] = '\0'; (pGVar19->_sprite)._filename._buf[2] = '\0'; (pGVar19->_sprite)._filename._buf[3] = '\0'; pAVar2 = &poop[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; pGVar19 = poop; } local_14 = -NAN; if (pGVar19 != (GridEntity *)0x0) { (pGVar19->_desc)._type = 0xe; pGVar19->_gridIndex = (int)local_180; puVar4 = *(undefined4 **)((int)local_17c + (int)local_180 * 4 + 0x24); if (puVar4 != (undefined4 *)0x0) { (**(code **)*puVar4)(); } *(GridEntity **)((int)local_17c + (int)local_180 * 4 + 0x24) = pGVar19; (pGVar19->_desc)._variant = 1; (pGVar19->_desc)._varData = 0; GridEntity::Init(pGVar19,(uint)local_188.y); } } npc->_i2 = npc->_i2 + 1; } LAB_00461c56: pVVar11 = &npc->_pos; } else { pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar21 = (npc->_pos).y - 80.0; local_188.x = (pEVar7->_pos).x; local_188.y = (pEVar7->_pos).y; if (fVar21 < local_188.y) { local_188.y = fVar21; } ProjectileParams::ProjectileParams(&bossProjParams); uVar6 = Random(); bossProjParams.Variant = 3; bossProjParams.Scale = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.5; Entity_NPC::FireBossProjectiles(npc,0x1e,&local_188,15.0,&bossProjParams); } } else { iVar8 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar18 = 0; if (0 < iVar8) { iVar18 = iVar8; } if (((int)pvVar13 <= iVar18) || (uVar6 = Random(), (uVar6 & 1) != 0)) goto LAB_00461cec; uVar6 = Random(); local_17c = (void *)((uVar6 & 1) + 1); if (npc->_subtype == 2) { local_17c = (void *)0x3; LAB_00461b20: do { uVar6 = Random(); pVVar11 = Room::FindFreePickupSpawnPosition (g_game->_room,&scratchVec,pVVar11,60.0,0,0,0); uVar12 = Random(); fVar21 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_180 = (void *)(fVar21 + fVar21); uVar12 = Random(); local_190.y = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10; fVar21 = sin((float)local_180); local_188.y = fVar21 * local_190.y * 10.0 + pVVar11->y; fVar21 = cos((float)local_180); npc = (Entity_NPC *)local_198.y; pVVar9 = &local_1a4; local_1a4.x = fVar21 * local_190.y * 10.0 + pVVar11->x; local_1a4.y = local_188.y; Game::SpawnEx(g_game,0xd9,0,pVVar9,&g_vectorZero,(Entity *)local_198.y,0,uVar6,0); local_17c = (void *)((int)local_17c + -1); pVVar11 = (Vector *)((int)npc + 0x33c); } while (local_17c != (void *)0x0); goto LAB_00461c56; } if (local_17c != (void *)0x0) goto LAB_00461b20; } Game::DamageRadius(pVVar11,(Entity *)npc,0,0,(int)pVVar9,50.0,g_tearFlagPoison,15.0, 100.0); } LAB_00461c93: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00461cb6; } } npc->_state = 3; npc->_stateFrame = 0; goto LAB_00461cb6; } pbVar17 = (npc->_sprite)._animState._animData; if (pbVar17 == (byte *)0x0) { LAB_00460bfe: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Sucking",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar5 = *(byte **)pbVar17; } pcVar15 = "Sucking"; do { bVar3 = *pbVar5; bVar20 = bVar3 < (byte)*pcVar15; if (bVar3 != *pcVar15) { LAB_00460be0: uVar6 = -(uint)bVar20 | 1; goto LAB_00460be5; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar20 = bVar3 < (byte)pcVar15[1]; if (bVar3 != pcVar15[1]) goto LAB_00460be0; pbVar5 = pbVar5 + 2; pcVar15 = pcVar15 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_00460be5: if ((uVar6 != 0) || ((pbVar17[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00460bfe; } fVar21 = local_190.y; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered ((AnimationState *)local_190.y,(byte *)"StartSucking"); if ((bVar3 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar3 = AnimationState::WasEventTriggered((AnimationState *)fVar21,(byte *)"EndSucking"), bVar3 == 0)))) { local_180 = (void *)0x0; local_188.y = (float)g_game->_room; if (*(int *)((int)local_188.y + 0x1264) != 0) { do { iVar18 = *(int *)(*(int *)((int)local_188.y + 0x125c) + (int)local_180 * 4); if ((*(char *)(iVar18 + 0x173) == '\0') && ((iVar8 = *(int *)(iVar18 + 0x28), iVar8 == 1 || ((((iVar8 - 10U < 0x3de && (iVar8 != 0x21)) || (iVar8 == 2)) || ((iVar8 == 9 || (iVar8 == 5)))))))) { fVar21 = *(float *)(iVar18 + 0x33c); fVar24 = *(float *)(iVar18 + 0x340); if ((iVar8 == 1) && (iVar8 = *(int *)(iVar18 + 0x1e68), iVar8 != 0)) { fVar23 = fVar21 - *(float *)(iVar8 + 0x33c); fVar22 = fVar24 - *(float *)(iVar8 + 0x340); if (fVar22 * fVar22 + fVar23 * fVar23 < 2704.0) { fVar21 = (*(float *)(iVar8 + 0x33c) + fVar21) * 0.5; fVar24 = (*(float *)(iVar8 + 0x340) + fVar24) * 0.5; } } local_1a4.y = (npc->_pos).y; local_19c = (npc->_pos).x; local_17c = (void *)(local_1a4.y - fVar24); local_190.y = local_19c - fVar21; fVar21 = sqrtf((float)local_17c * (float)local_17c + local_190.y * local_190.y); if (0.0 < fVar21) { local_190.y = (1.0 / fVar21) * local_190.y; local_17c = (void *)((float)local_17c * (1.0 / fVar21)); } fVar21 = local_1a4.y - *(float *)(iVar18 + 0x340); fVar24 = local_19c - *(float *)(iVar18 + 0x33c); local_198.y = 0.9; fVar24 = sqrtf(fVar21 * fVar21 + fVar24 * fVar24); fVar21 = *(float *)(iVar18 + 0x36c); local_19c = 0.0; local_1a4.y = ((600.0 - fVar24) * 0.9) / 600.0; pfVar16 = &local_1a4.y; if (local_1a4.y <= 0.0) { pfVar16 = &local_19c; } pfVar10 = &local_198.y; if (*pfVar16 <= 0.9 && *pfVar16 != 0.9) { pfVar10 = pfVar16; } fVar24 = *pfVar10; if (fVar21 != 0.0) { *(float *)(iVar18 + 0x360) = (local_190.y * *pfVar10 * *(float *)(iVar18 + 0x39c)) / fVar21 + *(float *)(iVar18 + 0x360); *(float *)(iVar18 + 0x364) = ((float)local_17c * fVar24 * *(float *)(iVar18 + 0x39c)) / fVar21 + *(float *)(iVar18 + 0x364); } } local_180 = (void *)((int)local_180 + 1); } while (local_180 < *(void **)((int)local_188.y + 0x1264)); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00461cb6; } npc->_state = 8; goto LAB_00461cb6; } pbVar17 = (npc->_sprite)._animState._animData; if (pbVar17 == (byte *)0x0) { LAB_00460996: bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar5 = *(byte **)pbVar17; } pbVar14 = s_Idle; do { bVar3 = *pbVar5; bVar20 = bVar3 < *pbVar14; if (bVar3 != *pbVar14) { LAB_00460978: uVar6 = -(uint)bVar20 | 1; goto LAB_0046097d; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar20 = bVar3 < pbVar14[1]; if (bVar3 != pbVar14[1]) goto LAB_00460978; pbVar5 = pbVar5 + 2; pbVar14 = pbVar14 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0046097d: if ((uVar6 != 0) || ((pbVar17[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00460996; } if (((((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (iVar18 = npc->_stateFrame, npc->_stateFrame = iVar18 + 1, 0x1e < iVar18)) && ((uVar6 = Random(), uVar6 % 0xf == 0 || ((0.0 < npc->_pendingDamage && (uVar6 = Random(), uVar6 % 5 == 0)))))) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar21 = (pEVar7->_pos).x; fVar24 = (pEVar7->_pos).y; iVar18 = 0x1e; local_17c = (void *)0x1e; if (npc->_subtype == 2) { local_17c = (void *)0x0; } fVar21 = sqrtf(fVar21 * fVar21 + fVar24 * fVar24); if (fVar21 < 120.0) { iVar18 = 0x32; } iVar8 = 0x14; if (240.0 < fVar21) { iVar8 = 0x28; } iVar18 = iVar18 + (int)local_17c; local_190.y = (float)(iVar8 + iVar18); local_180 = (void *)((int)local_190.y + iVar18 + (int)local_17c); if (local_180 == (void *)0x0) { uVar6 = 0; } else { uVar6 = Random(); uVar6 = uVar6 % (uint)local_180; } if ((int)uVar6 < (int)local_17c) { npc->_state = 0x10; } else if ((int)uVar6 < iVar18) { npc->_state = 10; Entity_NPC::PlaySound(npc,0x12e,1.0,2,0,1.0); } else if ((int)uVar6 < (int)local_190.y) { npc->_state = 6; pVVar9 = Entity_NPC::CalcTargetPosition(npc,&local_188,0.0); pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar21 = (pEVar7->_velocity).y; fVar24 = pVVar9->y; (npc->_targetPosition).x = (pEVar7->_velocity).x * 10.0 + pVVar9->x; (npc->_targetPosition).y = fVar21 * 10.0 + fVar24; (npc->_v1).x = 0.0; uVar6 = Random(); npc->_i1 = uVar6 & 1; } } LAB_00461cb6: npc->_friction = npc->_friction * 0.5; ExceptionList = local_1c; return; } //@@ 00461fc0 NpcAI::ENTITY_MASK_OF_INFAMY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 97 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MASK_OF_INFAMY(Entity_NPC *npc) { byte *text; byte bVar1; uint uVar2; Entity *tmpEntity; EntityRef *entityRef; byte *******pppppppbVar3; int iVar4; Vector *tmpVec; int *checkGridIdx; undefined **animNameTable; byte *textCursor; EntityPtr EVar5; int iVar6; code *extraout_EDX; int gridY; float fVar7; EntityPtr EVar8; int iVar9; float pathScore; undefined1 auVar10 [12]; float fVar11; float traceDist; undefined4 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; Vector local_a8; undefined1 local_a0 [12]; float local_94; float local_90; Vector local_8c; float local_84; EntityPtr local_80; float local_7c; float local_78; char isCanSeeTarget; void *local_70; EntityPtr local_6c; EntityPtr controllerEntity; byte *******animName [4]; undefined4 animNameSize; uint animNameCapacity; EntityRef local_4c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; Room *currentRoom; EntityPtr *entityRefSlot; Game *game; Manager *manager; void *room; puStack_20 = (undefined1 *)(animName + 0x18); local_14 = (byte ******)0xffffffff; puStack_18 = &LAB_00af26f8; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(animName + 0x15); ExceptionList = &local_1c; controllerEntity = (EntityPtr)0x0; if (npc->_controllerID != -1) { controllerEntity = (EntityPtr)npc; } if (controllerEntity == (EntityPtr)0x0) { EVar8 = npc->_parent; if ((EVar8 == (EntityPtr)0x0) || ((((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)EVar8 + 0x28) != 1)) && (0x3dd < *(int *)((int)EVar8 + 0x28) - 10U)) || (*(int *)((int)EVar8 + 0xf1c) == -1)))) { EVar8 = npc->_entityRef; if ((EVar8 != (EntityPtr)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar8 + 0x28) == 1)) || (*(int *)((int)EVar8 + 0x28) - 10U < 0x3de)) && (*(int *)((int)EVar8 + 0xf1c) != -1)))) { controllerEntity = EVar8; } } else { controllerEntity = EVar8; } } local_8c.y = (float)npc; local_24 = uVar2; if (npc->_state == 0) { puStack_20 = (undefined1 *)(animName + 0x18); if ((npc->_flags & 0x1000000000000000) == 0) { puStack_20 = (undefined1 *)(animName + 0x18); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_a0,0x62,-1,-1,0, 0); fVar7 = 0.0; local_14 = (byte ******)0x0; if (local_94 != 0.0) { do { local_6c = (EntityPtr) __RTDynamicCast(*(undefined4 *)(local_a0._4_4_ + (int)fVar7 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if ((local_6c != (EntityPtr)0x0) && (*(int *)((int)local_6c + 0x3c0) == 0)) { *(int *)((int)local_6c + 0x3c0) = (int)npc; std::multiset::insert((int *)((int)local_6c + 0x3c0)); if (npc->_parent != (EntityPtr)0x0) { local_8c.y = (float)&npc->_parent; std::multiset::erase(&local_8c.y); } EVar8 = local_6c; npc->_parent = local_6c; std::multiset::insert(&npc->_parent); goto LAB_0046211e; } fVar7 = (float)((int)fVar7 + 1); } while ((uint)fVar7 < (uint)local_94); } EVar8 = (EntityPtr)0x0; LAB_0046211e: if (local_a0[0] == '\0') { local_14 = (byte ******)0x1; tracked_alloc(1,(void *)local_a0._4_4_,0); } if (EVar8 != (EntityPtr)0x0) goto LAB_004622d3; } local_14 = (byte ******)0xffffffff; Room::FindFreePickupSpawnPosition(g_game->_room,(Vector *)(local_a0 + 8),&npc->_pos,40.0,0,0,0); room = g_game->_room; iVar9 = (int)(((float)local_a0._8_4_ - 40.0) / 40.0 + 0.5); iVar6 = (int)((local_94 - 120.0) / 40.0 + 0.5); if (((((-1 < iVar9) && (iVar9 < *(int *)((int)room + 0xc))) && (-1 < iVar6)) && ((iVar6 < *(int *)((int)room + 0x10) && (uVar2 = *(int *)((int)room + 0xc) * iVar6 + iVar9, uVar2 < 0x1c0)))) && (*(int *)((int)room + uVar2 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)room + uVar2 * 4 + 0x76c) = 900; } uVar2 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; tmpEntity = Game::Spawn(g_game,0x62,0,(Vector *)(local_a0 + 8),&g_vectorZero,(Entity *)npc,0, uVar2); EVar8 = (EntityPtr)__RTDynamicCast(tmpEntity,uVar12,pTVar13,pTVar14,uVar15); if (*(int *)((int)EVar8 + 0x3c0) != 0) { local_8c.y = (float)((int)EVar8 + 0x3c0); std::multiset::erase(&local_8c.y); } *(int *)((int)EVar8 + 0x3c0) = (int)npc; std::multiset::insert((int *)((int)EVar8 + 0x3c0)); if (npc->_parent != (EntityPtr)0x0) { local_8c.y = (float)&npc->_parent; std::multiset::erase(&local_8c.y); } npc->_parent = EVar8; std::multiset::insert(&npc->_parent); if ((npc->_flags & 0x1000000000000000) != 0) { *(int *)((int)EVar8 + 0x380) = 0x42480000; *(int *)((int)EVar8 + 900) = 0x42480000; } LAB_004622d3: (npc->_v2).x = *(float *)((int)EVar8 + 0x380); npc->_i1 = 0; (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; uVar12 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_state = 4; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = uVar12; (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; ExceptionList = local_1c; return; } pppppppbVar3 = (byte *******)(animName + 0x18); if (npc->_variant == 1) { entityRefSlot = &npc->_entityRef; pppppppbVar3 = (byte *******)(animName + 0x18); if (npc->_entityRef == (EntityPtr)0x0) { LAB_00462435: puStack_20 = (undefined1 *)pppppppbVar3; uVar12 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; *(undefined4 *)((int)&npc->_flags + 4) = uVar12; npc->_state = 9; pppppppbVar3 = (byte *******)puStack_20; goto LAB_00462452; } pppppppbVar3 = (byte *******)(animName + 0x18); if (npc->_parent == (EntityPtr)0x0) { npc->_parent = npc->_entityRef; std::multiset::insert(&npc->_parent); local_80 = (EntityPtr)((int)*entityRefSlot + 0x3c0); if (*(int *)local_80 != 0) { local_6c = local_80; std::multiset::erase(&local_6c); } *(Entity_NPC **)local_80 = npc; std::multiset::insert(local_80); if (*entityRefSlot != (EntityPtr)0x0) { local_6c = (EntityPtr)entityRefSlot; std::multiset::erase(&local_6c); } *entityRefSlot = (EntityPtr)0x0; pppppppbVar3 = (byte *******)puStack_20; goto LAB_00462435; } } else { LAB_00462452: puStack_20 = (undefined1 *)pppppppbVar3; pppppppbVar3 = (byte *******)puStack_20; if (npc->_parent == (EntityPtr)0x0) { if (npc->_type == 0x61) { if (npc->_isInvicible != 0) { uVar12 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; manager = g_manager; npc->_isInvicible = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar12; local_7c = 1.33684e-42; seed_fart_sound_override((int *)&local_7c); SoundEffects::Play(&manager->_sfxManager,(int)local_7c,1.0,2,0,1.0,0.0); } npc->_state = 9; pppppppbVar3 = (byte *******)puStack_20; } else { entityRef = EntityRef::EntityRef(&local_4c); (*extraout_EDX)(entityRef,uVar2); pppppppbVar3 = (byte *******)puStack_20; } } } puStack_20 = (undefined1 *)pppppppbVar3; if (((npc->_type == 0x61) && (npc->_state != 9)) && ((npc->_parent != (EntityPtr)0x0 && (fVar7 = *(float *)((int)npc->_parent + 0x380), (npc->_v2).x != fVar7)))) { (npc->_v2).x = fVar7; uVar2 = Random(); game = g_game; if (((uVar2 & 1) == 0) && (controllerEntity == (EntityPtr)0x0)) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; currentRoom = game->_room; iVar9 = Room::GetClampedGridIndex(currentRoom,&npc->_pos); iVar6 = currentRoom->_gridWidth; local_70 = (void *)((float)(iVar9 % iVar6) * 40.0 + 40.0); local_78 = (float)(iVar9 / iVar6) * 40.0 + 120.0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_7c = (tmpEntity->_pos).x; local_90 = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_6c = (EntityPtr)(tmpEntity->_velocity).x; local_80 = (EntityPtr)(tmpEntity->_velocity).y; uVar2 = Random(); fVar7 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0; fVar11 = local_78 - (fVar7 * (float)local_80 + local_90); fVar7 = (float)local_70 - (fVar7 * (float)local_6c + local_7c); if (ABS(fVar7) <= ABS(fVar11)) { if (0.0 <= fVar11) { (npc->_targetPosition).y = (float)&DAT_bf800000; } else { (npc->_targetPosition).y = 1.0; } } else if (0.0 <= fVar7) { (npc->_targetPosition).x = (float)&DAT_bf800000; } else { (npc->_targetPosition).x = 1.0; } (npc->_targetPosition).x = (npc->_targetPosition).x * 1.6; (npc->_targetPosition).y = (npc->_targetPosition).y * 1.6; npc->_i1 = 2; } } animNameSize = 0; animNameCapacity = 0xf; animName[0] = (byte *******)0x0; local_14 = (byte ******)0x2; animNameTable = &PTR_DAT_00c5c2d0; if (npc->_type == 0x61) { animNameTable = &PTR_s_AngryMaskLeft_00c5c2c0; if (npc->_state != 9) { animNameTable = &PTR_s_SadMaskLeft_00c5c2b0; } } else if ((npc->_variant == 1) && (animNameTable = &PTR_s_AngryMaskLeft_00c5c2c0, npc->_state != 9) ) { animNameTable = &PTR_DAT_00c5c2d0; } fVar7 = (npc->_v1).x; fVar11 = (npc->_v1).y; if (ABS(fVar7) <= ABS(fVar11)) { iVar6 = (uint)(0.0 <= fVar11) * 8 + 4; } else { iVar6 = 8; if (fVar7 < 0.0) { iVar6 = 0; } } text = *(byte **)(iVar6 + (int)animNameTable); textCursor = text; do { bVar1 = *textCursor; textCursor = textCursor + 1; } while (bVar1 != 0); std::string::assign((char *)animName,text,(int)textCursor - (int)(text + 1)); pppppppbVar3 = (byte *******)animName; if (0xf < animNameCapacity) { pppppppbVar3 = animName[0]; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)pppppppbVar3,1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } EVar8 = (EntityPtr)local_8c.y; game = g_game; fVar11 = (npc->_v1).x + (npc->_velocity).x; (npc->_v1).x = fVar11; fVar7 = (npc->_velocity).y; (npc->_v1).x = fVar11 * 0.35; (npc->_v1).y = (fVar7 + (npc->_v1).y) * 0.35; local_70 = game->_room; local_6c = *(EntityPtr *)((int)local_70 + 0xc); iVar9 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar6 = 0; if (0 < iVar9) { iVar6 = iVar9; } iVar9 = *(int *)((int)local_70 + 0x10) + -1; gridY = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); iVar4 = 0; if (0 < gridY) { iVar4 = gridY; } if (iVar4 < iVar9) { iVar9 = iVar4; } iVar4 = (int)local_6c + -1; if (iVar6 < (int)local_6c + -1) { iVar4 = iVar6; } iVar4 = iVar9 * (int)local_6c + iVar4; local_90 = (float)(iVar4 % (int)local_6c) * 40.0 + 40.0; local_7c = (float)(iVar4 / (int)local_6c) * 40.0 + 120.0; if ((*(int *)((int)local_8c.y + 0xbc0) == 0) || (*(int *)((int)local_8c.y + 0xbc0) == 2)) { if ((*(uint *)((int)local_8c.y + 0x168) & 0x1000a00) != 0) goto LAB_00462f23; if (((*(uint *)((int)local_8c.y + 0x16c) & 0x10000000) == 0) || (isCanSeeTarget = '\0', (*(byte *)(*(int *)((int)local_70 + 4) + 0x44) & 1) == 0)) { isCanSeeTarget = '\x01'; } if (controllerEntity == (EntityPtr)0x0) { bVar1 = Entity::IsFrame((Entity *)local_8c.y,4,*(int *)((int)local_8c.y + 0x20)); if ((bVar1 != 0) && (isCanSeeTarget != '\0')) { tmpEntity = Entity_NPC::GetPlayerTarget((Entity_NPC *)EVar8); local_80 = (EntityPtr)(tmpEntity->_pos).x; local_78 = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget((Entity_NPC *)EVar8); local_6c = (EntityPtr)(tmpEntity->_velocity).x; local_70 = (void *)(tmpEntity->_velocity).y; uVar2 = Random(); fVar7 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0; local_70 = (void *)(local_7c - (fVar7 * (float)local_70 + local_78)); local_84 = local_90 - (fVar7 * (float)local_6c + (float)local_80); if ((ABS(local_84) < 20.0) || (ABS((float)local_70) < 20.0)) { local_94 = sqrtf((float)local_70 * (float)local_70 + local_84 * local_84); if (local_94 < 200.0) { pathScore = 1.0; if (0.0 < local_94) { traceDist = 0.0; local_a8.y = (float)g_game->_room; local_78 = *(float *)((int)local_a8.y + 0xc); local_6c = *(EntityPtr *)((int)local_a8.y + 0x10); local_84 = (local_84 / local_94) * 10.0; local_70 = (void *)(((float)local_70 / local_94) * 10.0); fVar7 = local_90; fVar11 = local_7c; do { fVar7 = fVar7 - local_84; uVar2 = 0; local_80 = (EntityPtr)((int)local_78 + -1); local_4c._spawnerType = -0x3f600000; local_4c._spawnerVariant = -0x3f600000; local_4c._position.x = -5.0; local_4c._position.y = 5.0; fVar11 = fVar11 - (float)local_70; local_4c._velocity.x = 5.0; local_4c._velocity.y = 5.0; local_4c._flags = 0x40a00000; local_4c._entity = (void *)0xc0a00000; do { EVar5 = (EntityPtr) (int)(((fVar7 + (float)(&local_4c._spawnerType)[uVar2 * 2]) - 40.0) / 40.0 + 0.5); EVar8 = (EntityPtr)0x0; if (0 < (int)EVar5) { EVar8 = EVar5; } EVar5 = local_80; if ((int)EVar8 < (int)local_80) { EVar5 = EVar8; } iVar9 = (int)(((fVar11 + (float)(&local_4c._spawnerVariant)[uVar2 * 2]) - 120.0) / 40.0 + 0.5); iVar6 = 0; if (0 < iVar9) { iVar6 = iVar9; } iVar9 = (int)local_6c + -1; if (iVar6 < (int)local_6c + -1) { iVar9 = iVar6; } checkGridIdx = (int *)(iVar9 * (int)local_78 + (int)EVar5); if ((checkGridIdx < (int *)0x1c0) && (iVar6 = *(int *)((int)local_a8.y + (int)checkGridIdx * 4 + 0x76c), iVar6 != 0x3de)) { if (iVar6 < 1000) { if (0 < iVar6) { pathScore = pathScore - 0.3; } } else { pathScore = (float)&DAT_bf800000; } } uVar2 = uVar2 + 1; } while (uVar2 < 4); traceDist = traceDist + 10.0; } while (traceDist < local_94); EVar8 = (EntityPtr)local_8c.y; if (pathScore <= 0.0) goto LAB_00462f23; } bVar1 = Entity::HasEntityFlags((Entity *)EVar8,0x1000a00); if (bVar1 == 0) { ((Vector *)((int)EVar8 + 0x334))->x = g_vectorZero.x; *(float *)((int)EVar8 + 0x338) = g_vectorZero.y; if (ABS(local_84) <= ABS((float)local_70)) { if (0.0 <= (float)local_70) { *(undefined1 **)((int)EVar8 + 0x338) = &DAT_bf800000; } else { *(float *)((int)EVar8 + 0x338) = 1.0; } } else if (0.0 <= local_84) { ((Vector *)((int)EVar8 + 0x334))->x = (float)&DAT_bf800000; } else { ((Vector *)((int)EVar8 + 0x334))->x = 1.0; } manager = g_manager; fVar7 = ((Vector *)((int)EVar8 + 0x334))->x; local_8c.y = 1.33824e-42; ((Vector *)((int)EVar8 + 0x334))->x = fVar7 + fVar7; *(float *)((int)EVar8 + 0x338) = *(float *)((int)EVar8 + 0x338) + *(float *)((int)EVar8 + 0x338); *(int *)((int)EVar8 + 0xbc0) = 1; seed_fart_sound_override((int *)&local_8c.y); SoundEffects::Play(&manager->_sfxManager,(int)local_8c.y,1.0,2,0,1.0,0.0); } } } } goto LAB_00462f23; } *(float *)((int)local_8c.y + 0x334) = g_vectorZero.x; *(float *)((int)local_8c.y + 0x338) = g_vectorZero.y; if (*(int *)((int)controllerEntity + 0xf1c) == -1) goto LAB_00462f23; bVar1 = input_is_action_pressed (9,*(int *)((int)controllerEntity + 0xf1c),(Entity *)controllerEntity, (int)controllerEntity); if (bVar1 == 0) goto LAB_00462f23; if (controllerEntity == EVar8) { tmpVec = Entity_NPC::GetControllerInput((Entity_NPC *)controllerEntity,&local_a8,0.0); } else { tmpVec = Entity_NPC::GetControllerMovementInput((Entity_NPC *)controllerEntity,&local_8c,0.0); } local_a0._8_4_ = tmpVec->x; local_94 = tmpVec->y; if (((float)local_a0._8_4_ == g_vectorZero.x) && (local_94 == g_vectorZero.y)) { local_a0._8_4_ = *(float *)((int)EVar8 + 0x360); local_94 = *(float *)((int)EVar8 + 0x364); } if (((float)local_a0._8_4_ == g_vectorZero.x) && (local_94 == g_vectorZero.y)) goto LAB_00462f23; tmpVec = Vector::ToCardinal(&local_a8,(Vector *)(local_a0 + 8)); fVar7 = tmpVec->y; *(float *)((int)EVar8 + 0x334) = tmpVec->x + tmpVec->x; *(float *)((int)EVar8 + 0x338) = fVar7 + fVar7; *(undefined4 *)((int)EVar8 + 0xbc0) = 1; } else { LAB_00462f23: if (*(int *)((int)EVar8 + 0xbc0) == 0) { iVar6 = *(int *)((int)EVar8 + 0xf1c); if (controllerEntity != (EntityPtr)0x0) { *(int *)((int)EVar8 + 0xf1c) = *(int *)((int)controllerEntity + 0xf1c); *(bool *)((int)EVar8 + 0xf2c) = controllerEntity != EVar8; } if (*(int *)((int)EVar8 + 0xb64) == 9) { fVar7 = 1.5; } else { fVar7 = 0.85; } PathFinder::MoveRandomlyAxisAligned((PathFinder *)((int)EVar8 + 0x414),fVar7,0); if (controllerEntity != (EntityPtr)0x0) { *(int *)((int)EVar8 + 0xf1c) = iVar6; *(undefined1 *)((int)EVar8 + 0xf2c) = 0; } fVar7 = *(float *)((int)EVar8 + 0x39c); fVar11 = 0.85; if (fVar7 != 1.0) { fVar11 = 0.85 / ((fVar7 + 0.85) - fVar7 * 0.85); } auVar10 = ZEXT812(0x3f47ae14); ((Vector *)((int)EVar8 + 0x360))->x = fVar11 * ((Vector *)((int)EVar8 + 0x360))->x; if (fVar7 != 1.0) { fVar11 = auVar10._0_4_; auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar11 / ((fVar7 + fVar11) - fVar7 * fVar11); } *(float *)((int)EVar8 + 0x364) = auVar10._0_4_ * *(float *)((int)EVar8 + 0x364); goto LAB_004630a2; } } if ((*(byte *)((int)EVar8 + 400) == 0) && ((*(uint *)((int)EVar8 + 0x168) & 0x1000a00) == 0)) { fVar7 = *(float *)((int)EVar8 + 0x36c) * 0.82; *(float *)((int)EVar8 + 0x36c) = fVar7; if (fVar7 != 0.0) { fVar11 = *(float *)((int)EVar8 + 0x39c); ((Vector *)((int)EVar8 + 0x360))->x = (fVar11 * ((Vector *)((int)EVar8 + 0x334))->x) / fVar7 + ((Vector *)((int)EVar8 + 0x360))->x; *(float *)((int)EVar8 + 0x364) = (fVar11 * *(float *)((int)EVar8 + 0x338)) / fVar7 + *(float *)((int)EVar8 + 0x364); } fVar7 = ((Vector *)((int)EVar8 + 0x334))->x; fVar11 = ((Vector *)((int)EVar8 + 0xbb0))->x; *(float *)((int)EVar8 + 0xbb4) = *(float *)((int)EVar8 + 0x338) * 3.0 + *(float *)((int)EVar8 + 0xbb4); ((Vector *)((int)EVar8 + 0xbb0))->x = fVar7 * 3.0 + fVar11; if (ABS(local_90) <= ABS(local_7c)) { ((Vector *)((int)EVar8 + 0x33c))->x = local_90 * 0.1 + ((Vector *)((int)EVar8 + 0x33c))->x * 0.9; } else { *(float *)((int)EVar8 + 0x340) = local_7c * 0.1 + *(float *)((int)EVar8 + 0x340) * 0.9; } } else { *(int *)((int)EVar8 + 0xbc0) = 0; ((Vector *)((int)EVar8 + 0x418))->x = g_vectorZero.x; *(float *)((int)EVar8 + 0x41c) = g_vectorZero.y; ((Vector *)((int)EVar8 + 0x420))->x = g_vectorZero.x; *(float *)((int)EVar8 + 0x424) = g_vectorZero.y; ((Vector *)((int)EVar8 + 0x334))->x = g_vectorZero.x; *(float *)((int)EVar8 + 0x338) = g_vectorZero.y; } LAB_004630a2: if (animNameCapacity < 0x10) { ExceptionList = local_1c; return; } uVar2 = animNameCapacity + 1; pppppppbVar3 = animName[0]; if (0xfff < uVar2) { pppppppbVar3 = (byte *******)animName[0][-1]; uVar2 = animNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)animName[0] + (-4 - (int)pppppppbVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar3,uVar2); ExceptionList = local_1c; return; } //@@ 00463100 NpcAI::ENTITY_ISAAC /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 102 (from dispatcher 006c2990) */ float __fastcall NpcAI::ENTITY_ISAAC(Entity_NPC *npc) { double dVar1; float *pfVar2; byte bVar3; char cVar4; uint uVar5; uint uVar6; int iVar7; Entity *pEVar8; undefined4 *puVar9; Vector *pVVar10; byte *strCursor; byte *pbVar11; int *playerSlot; void *pvVar12; float *pfVar13; Entity_Player *player; undefined1 uVar14; float fVar15; byte *keyCursor; char *pcVar16; PlayerManager *playerManager; int iVar17; undefined4 *puVar18; bool bVar19; float fVar20; float fVar21; float fVar22; undefined1 *puVar23; Entity_NPC *pEVar24; undefined4 uVar25; TypeDescriptor *pTVar26; TypeDescriptor *pTVar27; undefined4 uVar28; RNG projectileRng; EntityList_EL nearbyEntities; Vector local_2b4; Vector spawnPos; Vector summonPos; Vector local_29c; Vector local_294; Vector local_28c; Vector local_284; Vector local_27c; Vector local_274; Vector local_26c; int elapsedFrames; Vector local_260; Vector local_258; float local_24c; Entity_NPC *local_248; float local_244; Vector local_240; byte local_235; float local_234; undefined4 *local_230; Entity_NPC *local_22c; float local_228; byte local_221; ProjectileParams shotParams; ProjectileParams burstParams; undefined1 local_e0; undefined1 *local_dc; undefined4 local_d8; undefined1 local_d4; ProjectileParams circleParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; Manager *manager; Room *room; puStack_20 = (undefined1 *)((&circleParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af2740; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)&(&circleParams)[1].Spread; ExceptionList = &local_1c; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_248 = npc; local_24 = uVar5; if (npc->_state == 0) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; *(undefined1 *)&npc->_i2 = 0; npc->_stateFrame = 0; npc->_state = 3; puStack_20 = (undefined1 *)((&circleParams)[1].Color._tint + 2); uVar5 = Random(); *(char *)((int)&npc->_i2 + 2) = (char)(uVar5 % 0x3c) + '<'; if (npc->_variant != 1) { ExceptionList = local_1c; return (float)(uVar5 / 0x3c); } bVar3 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (bVar3 == 0) { ExceptionList = local_1c; return 0.0; } npc->_shieldStrength = 90.0; ExceptionList = local_1c; return (float)(uint)bVar3; } local_244 = 1.0; pfVar2 = (&circleParams)[1].Color._tint + 2; if ((char)npc->_i2 == '\0') { uVar6 = Random(); pfVar2 = (float *)puStack_20; if (uVar6 % 0x14 == 0) { uVar6 = Random(); Entity_NPC::PlaySound(npc,0x8f,1.0,uVar6 % 100 + 0x2d,0,1.0); pfVar2 = (float *)puStack_20; } } puStack_20 = (undefined1 *)pfVar2; if ((0.0 < npc->_pendingDamage) && (puVar18 = (npc->_damageEvents)._begin, puVar18 != (npc->_damageEvents)._end)) { do { if ((puVar18[4] == 1000) && (puVar18[5] == 0x13)) { *puVar18 = 0; } puVar18 = puVar18 + 0xe; } while (puVar18 != (npc->_damageEvents)._end); } iVar7 = npc->_variant; if (iVar7 == 0) { fVar20 = npc->_maxHitPoints * 0.75; if (npc->_health <= fVar20 && fVar20 != npc->_health) { cVar4 = (char)npc->_i2; goto joined_r0x004632d7; } } else if (iVar7 == 1) { fVar20 = npc->_maxHitPoints * 0.7; if (npc->_health <= fVar20 && fVar20 != npc->_health) { cVar4 = (char)npc->_i2; goto joined_r0x004632d7; } } else if ((iVar7 == 2) && (fVar20 = npc->_maxHitPoints * 0.7, npc->_health <= fVar20 && fVar20 != npc->_health)) { cVar4 = (char)npc->_i2; joined_r0x004632d7: if (cVar4 == '\0') { *(undefined1 *)&npc->_i2 = 1; npc->_state = 0x10; if ((iVar7 == 1) || (iVar7 == 2)) { uVar6 = Random(); uVar28 = 0; pTVar27 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar26 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar25 = 0; pEVar8 = Game::Spawn(g_game,0x60,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6); iVar7 = __RTDynamicCast(pEVar8,uVar25,pTVar26,pTVar27,uVar28,uVar5); puVar18 = (undefined4 *)(iVar7 + 0x3bc); if (*(int *)(iVar7 + 0x3bc) != 0) { local_230 = puVar18; std::multiset::erase(&local_230); } *puVar18 = npc; std::multiset::insert(puVar18); uVar5 = Random(); uVar28 = 0; pTVar27 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar26 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar25 = 0; pEVar8 = Game::Spawn(g_game,0x60,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); iVar7 = __RTDynamicCast(pEVar8,uVar25,pTVar26,pTVar27,uVar28); puVar18 = (undefined4 *)(iVar7 + 0x3bc); if (*(int *)(iVar7 + 0x3bc) != 0) { local_230 = puVar18; std::multiset::erase(&local_230); } *puVar18 = npc; std::multiset::insert(puVar18); } } } iVar7 = npc->_variant; if ((iVar7 == 0) || (iVar7 == 1)) { fVar20 = npc->_maxHitPoints * 0.5; if (npc->_health <= fVar20 && fVar20 != npc->_health) { cVar4 = (char)npc->_i2; goto joined_r0x0046343d; } } else if ((iVar7 == 2) && (fVar20 = npc->_maxHitPoints * 0.5, npc->_health <= fVar20 && fVar20 != npc->_health)) { cVar4 = (char)npc->_i2; joined_r0x0046343d: if (cVar4 == '\x01') { *(undefined1 *)&npc->_i2 = 2; npc->_state = 0x10; } } local_221 = (byte)npc->_i2; if (local_221 < 2) { fVar20 = (npc->_targetPosition).x; fVar15 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; (npc->_velocity).x = fVar20 - fVar15; npc->_friction = npc->_friction * 0.6; local_221 = (byte)npc->_i2; } else { npc->_friction = npc->_friction * 0.9; } fVar20 = (npc->_v2).x; if ((npc->_health < fVar20) && (fVar20 = (fVar20 - npc->_health) + (npc->_v2).y, (npc->_v2).y = fVar20, 200.0 < fVar20)) { (npc->_v2).y = 200.0; } fVar20 = 8.0; iVar7 = npc->_variant; uVar5 = 0x1e; if (local_221 != 1) { uVar5 = 0x14; } local_234 = 8.0; if (local_221 < 2) { uVar6 = uVar5 >> 1; if (iVar7 != 1) { uVar6 = uVar5; } uVar5 = uVar6 >> 1; if (iVar7 != 2) { uVar5 = uVar6; } if (local_221 == 1) { fVar20 = 6.0; local_234 = 6.0; } } else { uVar6 = 0xc; if (iVar7 != 1) { uVar6 = 0x19; } uVar5 = uVar6 >> 1; if (iVar7 != 2) { uVar5 = uVar6; } } if ((iVar7 == 1) || (iVar7 == 2)) { local_234 = fVar20 * 0.75; } local_284.y = 4.2039e-45; if (npc->_state != 8) { if ((npc->_v2).y <= 10.0) { if (1 < local_221) goto LAB_004635fb; } else { if (1 < local_221) { LAB_004635fb: if (npc->_state != 3) goto LAB_00463976; } iVar7 = Entity::GetIntervalTicks((Entity *)npc,(float)uVar5,0.0); if (iVar7 != 0) { ProjectileParams::ProjectileParams(&shotParams); uVar5 = Random(); if ((uVar5 % 10 == 0) && ((npc->_variant == 1 || (npc->_variant == 2)))) { shotParams.BulletFlags._0_4_ = (uint)shotParams.BulletFlags | 1; shotParams.Scale = 1.2; } else { shotParams.Variant = 4; } fVar20 = (npc->_v2).y; fVar15 = 1.4013e-45; shotParams.FallingSpeedModifier = -0.1; shotParams.FallingAccelModifier = -0.1; if (100.0 < fVar20) { fVar15 = 2.8026e-45; } if (150.0 < fVar20) { fVar15 = local_284.y; } local_260.y = fVar15; do { pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_274.x = (pEVar8->_pos).x - (npc->_pos).x; local_22c = (Entity_NPC *)((pEVar8->_pos).y - (npc->_pos).y); local_228 = local_274.x; if ((1 < (byte)npc->_i2) && (npc->_variant == 0)) { if (ABS(local_274.x) <= ABS((float)local_22c)) { local_274.x = 0.0; } else { local_22c = (Entity_NPC *)0x0; } local_228 = local_274.x; } local_274.x = local_228; local_274.y = (float)local_22c; fVar20 = sqrtf((float)local_22c * (float)local_22c + local_228 * local_228); if (0.0 < fVar20) { local_274.y = (1.0 / fVar20) * (float)local_22c; local_274.x = (1.0 / fVar20) * local_228; } uVar5 = Random(); fVar20 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_230 = (undefined4 *)(fVar20 + fVar20); local_228 = sin((float)local_230); fVar20 = cos((float)local_230); local_274.y = local_228 * 0.1 + local_274.y; local_274.x = fVar20 * 0.1 + local_274.x; local_22c = (Entity_NPC *)local_274.x; local_228 = local_274.y; fVar21 = sqrtf(local_274.y * local_274.y + local_274.x * local_274.x); pEVar24 = local_22c; fVar20 = local_228; if (0.0 < fVar21) { fVar20 = local_228 * (local_234 / fVar21); pEVar24 = (Entity_NPC *)((float)local_22c * (local_234 / fVar21)); local_274.x = (float)pEVar24; local_274.y = fVar20; } if (1 < (byte)npc->_i2) { iVar7 = npc->_variant; if (iVar7 == 0) { fVar21 = (npc->_velocity).x * 0.3; fVar22 = (npc->_velocity).y * 0.3; } else { if ((iVar7 != 1) && (iVar7 != 2)) goto LAB_0046390f; fVar21 = (npc->_velocity).x * 0.6; fVar22 = (npc->_velocity).y * 0.6; } local_274.y = fVar22 + fVar20; local_274.x = fVar21 + (float)pEVar24; } LAB_0046390f: Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_274,0,&shotParams); fVar15 = (float)((int)fVar15 + -1); } while (fVar15 != 0.0); fVar20 = 10.0; if ((npc->_variant == 1) || (npc->_variant == 2)) { fVar20 = 5.0; } (npc->_v2).y = (npc->_v2).y - (float)(int)local_260.y * fVar20; } } } LAB_00463976: pfVar2 = &(npc->_v2).y; if (*pfVar2 <= 0.0 && *pfVar2 != 0.0) { (npc->_v2).y = 0.0; } puVar9 = (undefined4 *) (*(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4)); puVar18 = (undefined4 *)0x0; if (0 < (int)puVar9) { puVar18 = puVar9; } local_230 = puVar18; if (((((npc->_variant == 1) || (npc->_variant == 2)) && (iVar7 = Entity::GetIntervalTicks((Entity *)npc,30.0,0.0), iVar7 != 0)) && ((uVar5 = Random(), (uVar5 & 7) == 0 && ((int)puVar18 < 9)))) && (fVar20 = npc->_maxHitPoints * 0.9, npc->_health <= fVar20 && fVar20 != npc->_health)) { uVar5 = Random(); fVar20 = (float)(9 - (int)local_230); if ((int)((int)puVar18 + (uVar5 & 3) + 2) < 10) { fVar20 = (float)((uVar5 & 3) + 2); } local_26c.y = fVar20; uVar5 = Random(); local_228 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; local_228 = local_228 + local_228; if (0 < (int)fVar20) { local_29c.y = 6.2831855 / (float)(int)fVar20; do { uVar5 = Random(); fVar20 = npc->_maxHitPoints * 0.7; uVar6 = 0x12; local_22c = (Entity_NPC *)0x1; if ((uVar5 & 3) == 0) { uVar6 = 0x50; } if ((npc->_health <= fVar20 && fVar20 != npc->_health) && (uVar5 = Random(), (uVar5 & 3) != 0)) { local_22c = (Entity_NPC *)0x2; uVar6 = 0xe; } local_260.y = sin(local_228); local_230 = (undefined4 *)cos(local_228); uVar5 = Random(); uVar28 = 0; summonPos.x = (float)local_230 * 15.0 + (npc->_pos).x; local_240.x = (float)local_230 * 3.0; pTVar27 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; summonPos.y = local_260.y * 15.0 + (npc->_pos).y; local_240.y = local_260.y * 3.0; pTVar26 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar25 = 0; pEVar8 = Game::Spawn(g_game,uVar6,0,&summonPos,&local_240,(Entity *)npc,(uint)local_22c, uVar5); iVar7 = __RTDynamicCast(pEVar8,uVar25,pTVar26,pTVar27,uVar28); local_228 = local_228 + local_29c.y; *(uint *)(iVar7 + 0x168) = *(uint *)(iVar7 + 0x168) & 0xfffffffb; local_26c.y = (float)((int)local_26c.y + -1); *(undefined1 *)(iVar7 + 0x174) = 1; *(undefined4 *)(iVar7 + 0x16c) = *(undefined4 *)(iVar7 + 0x16c); } while (local_26c.y != 0.0); } } if (((char)npc->_i2 == '\x01') && (npc->_variant == 0)) { if (npc->_projectileCooldown < 0) { uVar5 = Random(); if ((uVar5 & 3) == 0) { npc->_stateFrame = 10; npc->_projectileCooldown = 0x28; } else { uVar5 = Random(); if (uVar5 % 10 == 0) { iVar17 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar7 = 0; if (0 < iVar17) { iVar7 = iVar17; } if (iVar7 < 2) { npc->_projectileCooldown = 0x78; local_22c = (Entity_NPC *)0x2; do { room = g_game->_room; uVar5 = Random(); fVar20 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_230 = (undefined4 *)(fVar20 + fVar20); local_260.y = sin((float)local_230); fVar20 = cos((float)local_230); local_240.x = fVar20 * 100.0 + (npc->_pos).x; local_240.y = local_260.y * 100.0 + (npc->_pos).y; pVVar10 = Room::FindFreePickupSpawnPosition(room,&local_294,&local_240,0.0,1,1,0); uVar5 = Random(); fVar20 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_230 = (undefined4 *)(fVar20 + fVar20); local_26c.y = sin((float)local_230); uVar5 = Random(); local_260.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar20 = cos((float)local_230); spawnPos.x = fVar20 * local_260.y * 10.0 + pVVar10->x; spawnPos.y = local_260.y * local_26c.y * 10.0 + pVVar10->y; uVar5 = Random(); Game::Spawn(g_game,0x26,1,&spawnPos,&g_vectorZero,(Entity *)npc,0,uVar5); local_22c = (Entity_NPC *)((int)&local_22c[-1]._pickupGhostsEntity + 3); } while (local_22c != (Entity_NPC *)0x0); local_22c = (Entity_NPC *)0x0; } } } } else { npc->_projectileCooldown = npc->_projectileCooldown - elapsedFrames; } } if (0 < elapsedFrames) { local_22c = (Entity_NPC *)elapsedFrames; do { if ((char)npc->_i2 == '\x01') { iVar17 = npc->_stateFrame; iVar7 = iVar17 + -1; npc->_stateFrame = iVar7; if ((0 < iVar17) && (iVar7 % 5 == 0)) { room = g_game->_room; pVVar10 = Room::GetRandomPosition(room,&local_28c,20.0); Room::FindFreePickupSpawnPosition(room,&local_294,pVVar10,0.0,0,0,0); uVar5 = Random(); fVar20 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_230 = (undefined4 *)(fVar20 + fVar20); local_26c.y = sin((float)local_230); uVar5 = Random(); local_260.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar20 = cos((float)local_230); local_294.x = local_294.x + fVar20 * local_260.y * 20.0; local_294.y = local_294.y + local_26c.y * local_260.y * 20.0; uVar5 = Random(); if (uVar5 % (uint)local_284.y == 0) { room = g_game->_room; pEVar8 = Entity_NPC::GetPlayerTarget(local_248); fVar20 = (local_248->_pos).y - (pEVar8->_pos).y; fVar15 = (local_248->_pos).x - (pEVar8->_pos).x; fVar20 = sqrtf(fVar20 * fVar20 + fVar15 * fVar15); local_240.x = (pEVar8->_pos).x + fVar20 * 0.2 * (pEVar8->_velocity).x; local_240.y = (pEVar8->_pos).y + fVar20 * 0.2 * (pEVar8->_velocity).y; Room::GetClampedPositionImpl(room,&local_27c,&local_240,20.0,20.0,20.0,20.0); local_294.x = local_27c.x; local_294.y = local_27c.y; npc = local_248; } pvVar12 = g_game->_room; iVar7 = (int)((local_294.y - 120.0) / 40.0 + 0.5); iVar17 = (int)((local_294.x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar17) && (iVar17 < *(int *)((int)pvVar12 + 0xc))) && (-1 < iVar7)) && (((iVar7 < *(int *)((int)pvVar12 + 0x10) && (uVar5 = iVar7 * *(int *)((int)pvVar12 + 0xc) + iVar17, uVar5 < 0x1c0)) && (*(int *)((int)pvVar12 + uVar5 * 4 + 0x76c) < 0x3b7)))) { *(undefined4 *)((int)pvVar12 + uVar5 * 4 + 0x76c) = 900; } uVar5 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x13,&local_294,&g_vectorZero,(Entity *)npc,2,uVar5); local_258.y = -g_vectorOne.y; local_258.x = -g_vectorOne.x; Entity::SetSize(pEVar8,10.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); (**(code **)(*(int *)pEVar8 + 0xc))(); } } local_22c = (Entity_NPC *)((int)&local_22c[-1]._pickupGhostsEntity + 3); } while (local_22c != (Entity_NPC *)0x0); } iVar7 = npc->_state; if (iVar7 != 3) { if (iVar7 != 8) { if (iVar7 != 9) { if (iVar7 == 0x10) { bVar3 = (byte)npc->_i2; if (bVar3 == 1) { ANM2::Play(&npc->_sprite,(byte *)"1StandUp",0); pvVar12 = (npc->_sprite)._animState._animData; if (pvVar12 == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = (undefined1 *)(npc->_sprite)._animState._animFrame; } if ((((float)puVar23 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed < 20.0) && (pvVar12 != (void *)0x0)) && (20.0 <= (npc->_sprite)._animState._animFrame)) { iVar7 = 0x36; LAB_00465f0a: Entity_NPC::PlaySound(npc,iVar7,1.0,2,0,1.0); } } else if (1 < bVar3) { ANM2::Play(&npc->_sprite,(byte *)"2Evolve",0); pvVar12 = (npc->_sprite)._animState._animData; if (pvVar12 == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = (undefined1 *)(npc->_sprite)._animState._animFrame; } if ((((float)puVar23 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed < 17.0) && (pvVar12 != (void *)0x0)) && (17.0 <= (npc->_sprite)._animState._animFrame)) { iVar7 = 0x10a; goto LAB_00465f0a; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0046646a; LAB_00466460: npc->_state = 3; goto LAB_0046646a; } if (iVar7 != 6) goto LAB_0046646a; if (npc->_i1 != 0) { if (npc->_i1 != 1) goto LAB_0046646a; ANM2::Play(&npc->_sprite,(byte *)"3Appear",0); cVar4 = FUN_00456880(); if (cVar4 != '\0') { pfVar2 = &(npc->_v1).y; local_258.y = 151.0; pfVar13 = &local_258.y; if (151.0 < *pfVar2 || *pfVar2 == 151.0) { pfVar13 = pfVar2; } local_230 = (undefined4 *)*pfVar13; pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_240.x = (pEVar8->_velocity).x; local_240.y = (pEVar8->_velocity).y; bVar3 = Vector::operator_ne(&local_240,&g_vectorZero); local_28c.y = npc->_size; room = g_game->_room; if (bVar3 == 0) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_258.y = (pEVar8->_pos).x; local_27c.y = (pEVar8->_pos).y; pVVar10 = MusicManager::RandomVector(&local_2b4); local_240.x = (float)local_230 * pVVar10->x + local_258.y; } else { pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_258.y = (pEVar8->_pos).x; local_27c.y = (pEVar8->_pos).y; pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_240.x = (pEVar8->_velocity).x; local_240.y = (pEVar8->_velocity).y; pVVar10 = Vector::Normalized(&local_240,&local_2b4); local_240.x = (float)local_230 * pVVar10->x + local_258.y; } local_240.y = (float)local_230 * pVVar10->y + local_27c.y; pVVar10 = Room::GetClampedPosition(room,&local_260,&local_240,local_28c.y); puVar18 = (undefined4 *)0x0; local_234 = pVVar10->y; local_228 = pVVar10->x; local_230 = (undefined4 *)0x0; uVar5 = Random(); local_258.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 360.0; while( true ) { uVar5 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) break; while (player = PlayerManager::GetPlayer(playerManager,uVar5), fVar20 = (player->_pos).x - local_228, fVar15 = (player->_pos).y - local_234, 22500.0 <= fVar15 * fVar15 + fVar20 * fVar20) { uVar5 = uVar5 + 1; playerManager = &g_game->_playerManager; if ((uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2) <= uVar5) goto LAB_004663f2; } uVar5 = (uint)puVar18 & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } local_22c = (Entity_NPC *)((float)(int)uVar5 * 90.0 + local_258.y); room = g_game->_room; local_27c.y = (float)(int)puVar18 * 50.0 * 0.25 + 151.0; local_260.y = local_248->_size; pEVar8 = Entity_NPC::GetPlayerTarget(local_248); local_22c = (Entity_NPC *)((float)local_22c * 0.017453292); local_28c.y = sin((float)local_22c); fVar20 = cos((float)local_22c); local_240.x = fVar20 * local_27c.y + (pEVar8->_pos).x; local_240.y = local_28c.y * local_27c.y + (pEVar8->_pos).y; Room::GetClampedPositionImpl (room,&local_26c,&local_240,local_260.y,local_260.y,local_260.y,local_260.y) ; puVar18 = (undefined4 *)((int)local_230 + 1); local_228 = local_26c.x; local_234 = local_26c.y; local_230 = puVar18; if (0x13 < (int)puVar18) break; } LAB_004663f2: KAGE_LogMessage(1,(byte *)"??? teleport: %d tries\n"); npc = local_248; (local_248->_pos).x = local_228; (local_248->_pos).y = local_234; Entity_NPC::PlaySound(local_248,0xd6,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0046646a; npc->_i1 = 0; goto LAB_00466460; } ANM2::Play(&npc->_sprite,(byte *)"3FBAttack3",0); pvVar12 = (npc->_sprite)._animState._animData; if (pvVar12 == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = (undefined1 *)(npc->_sprite)._animState._animFrame; } if (19.0 <= (float)puVar23 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed) { LAB_00465fc0: if ((pvVar12 != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0046646a; } else if (pvVar12 != (void *)0x0) { if (19.0 <= (npc->_sprite)._animState._animFrame) { Entity_NPC::PlaySound(npc,0xd7,1.0,2,0,1.0); pvVar12 = (npc->_sprite)._animState._animData; } goto LAB_00465fc0; } LAB_00465fd1: npc->_i1 = 1; goto LAB_0046646a; } if ((byte)npc->_i2 < 2) goto LAB_0046646a; iVar7 = npc->_i1; if (iVar7 != 0) { if (iVar7 != 1) { local_29c.y = 0.0; local_26c.y = 0.0; local_284.y = 0.0; local_244 = 0.0; local_234 = 0.0; local_24c = 0.0; local_248 = (Entity_NPC *)0x0; local_230 = (undefined4 *)0x0; if (0 < elapsedFrames) { do { if (999 < iVar7) { if (iVar7 < 2000) { local_29c.y = (float)(iVar7 + -1000); local_234 = 75.0; local_284.y = *(float *)((int)g_game->_room + 0x14) + 10.0; local_26c.y = *(float *)((int)g_game->_room + 0x18); local_248 = (Entity_NPC *)0xc2700000; } else { if (2999 < iVar7) goto LAB_00465a75; local_234 = -75.0; local_29c.y = (float)(iVar7 + -2000); local_26c.y = *(float *)((int)g_game->_room + 0x18); local_284.y = *(float *)((int)g_game->_room + 0x1c) - 10.0; local_248 = (Entity_NPC *)0x42700000; } local_26c.y = local_26c.y + 10.0; local_24c = 60.0; local_244 = 0.0; } LAB_00465a75: pVVar10 = RandomVector(&local_2b4,npc->_projectileDelay); projectileRng._seed = npc->_projectileDelay; projectileRng._shift3 = 6; projectileRng._shift1 = 1; projectileRng._shift2 = 0xb; RNG::Next(&projectileRng); fVar20 = (float)((double)projectileRng._seed + __uint_to_double_fixup[-(projectileRng._seed >> 0x1f)]) * 2.3283062e-10; local_234 = local_234 + fVar20 * pVVar10->x * 20.0; local_244 = local_244 + fVar20 * pVVar10->y * 20.0; uVar5 = (uint)local_29c.y & 0x80000007; bVar19 = uVar5 == 0; if ((int)uVar5 < 0) { bVar19 = (uVar5 - 1 | 0xfffffff8) == 0xffffffff; } if (bVar19) { local_235 = 1; local_22c = local_248; iVar7 = (int)(((int)local_29c.y >> 0x1f & 7U) + (int)local_29c.y) >> 3; local_228 = ((float)*(byte *)((int)&npc->_i2 + 1) / 255.0) * (float)iVar7; local_260.y = local_24c; fVar20 = sqrtf(local_24c * local_24c + (float)local_248 * (float)local_248); if (0.0 < fVar20) { local_260.y = (1.0 / fVar20) * local_24c; local_22c = (Entity_NPC *)((1.0 / fVar20) * (float)local_248); } fVar20 = local_228 * (float)local_22c; local_228 = local_228 * local_260.y * 75.0; local_22c = (Entity_NPC *)(fVar20 * 75.0); fVar20 = sqrtf(2.0); pEVar24 = (Entity_NPC *)((float)local_22c * fVar20); fVar20 = local_228 * fVar20; local_22c = pEVar24; local_228 = fVar20; local_28c.y = (float)EntityConfig::GetEntity(&g_manager->_entityConfig,1000,0x13,0); fVar15 = (float)iVar7; local_260.y = -NAN; local_27c.y = local_234 * fVar15 + local_284.y; local_258.y = local_244 * fVar15 + local_26c.y; do { local_240.x = (float)pEVar24 + (float)local_248 * (float)(int)local_260.y + local_27c.y; local_240.y = fVar20 + local_24c * (float)(int)local_260.y + local_258.y; bVar3 = Room::IsPositionInRoom(g_game->_room,&local_240,10.0); if (bVar3 != 0) { local_235 = 0; uVar5 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x13,&local_240,&g_vectorZero,(Entity *)npc,2, uVar5); Entity::SetSize(pEVar8,10.0,*(Vector *)((int)local_28c.y + 0x3c), *(int *)((int)local_28c.y + 0x48)); } local_260.y = (float)((int)local_260.y + 1); fVar20 = local_228; pEVar24 = local_22c; } while ((int)local_260.y < 10); if (local_235 != 0) goto LAB_00465fd1; } if (npc->_i1 < 1000) break; iVar7 = npc->_i1 + 1; local_230 = (undefined4 *)((int)local_230 + 1); npc->_i1 = iVar7; } while ((int)local_230 < elapsedFrames); } goto LAB_0046646a; } ANM2::Play(&npc->_sprite,(byte *)"3Appear",0); pvVar12 = (npc->_sprite)._animState._animData; if (pvVar12 == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = (undefined1 *)(npc->_sprite)._animState._animFrame; } if (0.0 <= (float)puVar23 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed) { LAB_004658ff: if ((pvVar12 != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0046646a; } else if (pvVar12 != (void *)0x0) { if (0.0 <= (npc->_sprite)._animState._animFrame) { npc->_visible = 1; npc->_entityCollisionClass = 4; local_228 = 0.0; while( true ) { uVar5 = Random(); pvVar12 = g_game->_room; local_230 = (undefined4 *) ((*(float *)((int)pvVar12 + 0x20) - *(float *)((int)pvVar12 + 0x18)) * (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 + *(float *)((int)pvVar12 + 0x18)); uVar5 = Random(); game = g_game; playerManager = &g_game->_playerManager; local_24c = 0.0; dVar1 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; pvVar12 = g_game->_room; fVar20 = *(float *)((int)pvVar12 + 0x1c); fVar15 = *(float *)((int)pvVar12 + 0x14); fVar21 = *(float *)((int)pvVar12 + 0x14); (npc->_pos).y = (float)local_230; (npc->_pos).x = (fVar20 - fVar15) * (float)((double)(int)uVar5 + dVar1) * 2.3283064e-10 + fVar21; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) break; while( true ) { pvVar12 = (playerManager->_playerList)._end; if ((int)pvVar12 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar12 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if ((uint)local_24c < (uint)((int)pvVar12 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_24c; } fVar20 = *(float *)(*playerSlot + 0x340) - (npc->_pos).y; fVar15 = *(float *)(*playerSlot + 0x33c) - (npc->_pos).x; fVar20 = sqrtf(fVar20 * fVar20 + fVar15 * fVar15); if (fVar20 < 100.0) break; playerManager = &g_game->_playerManager; local_24c = (float)((int)local_24c + 1); if ((uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2) <= (uint)local_24c) goto LAB_0046585a; } local_228 = (float)((int)local_228 + 1); if (0x13 < (int)local_228) break; } LAB_0046585a: KAGE_LogMessage(1,(byte *)"Isaac teleport: %d tries\n"); manager = g_manager; if (npc->_championColorIdx == 0x12) { local_244 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_244 = 0.5; } local_22c = (Entity_NPC *)0xd6; seed_fart_sound_override((int *)&local_22c); SoundEffects::Play(&manager->_sfxManager,(int)local_22c,1.0,2,0,local_244,0.0); pvVar12 = (npc->_sprite)._animState._animData; } goto LAB_004658ff; } npc->_i1 = 0x1b; npc->_state = 8; *(undefined1 *)((int)&npc->_i2 + 2) = 0; goto LAB_0046646a; } ANM2::Play(&npc->_sprite,(byte *)"3FBAttack3",0); pvVar12 = (npc->_sprite)._animState._animData; if (pvVar12 == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = (undefined1 *)(npc->_sprite)._animState._animFrame; } if (19.0 <= (float)puVar23 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed) { LAB_004655d7: if ((pvVar12 != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0046646a; } else if (pvVar12 != (void *)0x0) { if (19.0 <= (npc->_sprite)._animState._animFrame) { Entity_NPC::PlaySound(npc,0xd7,1.0,2,0,1.0); pvVar12 = (npc->_sprite)._animState._animData; } goto LAB_004655d7; } uVar5 = Random(); npc->_i1 = ((uVar5 & 1) + 1) * 1000; uVar5 = Random(); *(char *)((int)&npc->_i2 + 1) = (char)uVar5; uVar5 = Random(); npc->_projectileDelay = uVar5; npc->_visible = 0; npc->_entityCollisionClass = 0; (npc->_pos).x = g_vectorZero.x; (npc->_pos).y = g_vectorZero.y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; goto LAB_0046646a; } bVar3 = (byte)npc->_i2; local_221 = 0; if (bVar3 == 0) { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } pcVar16 = "1Attack"; do { bVar3 = *strCursor; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00464cc3: uVar5 = -(uint)bVar19 | 1; goto LAB_00464cc8; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00464cc3; strCursor = strCursor + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464cc8: if ((uVar5 == 0) && ((pbVar11[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00464cff; } pcVar16 = "1Attack"; LAB_00464ce8: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar16,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_00464cff: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) { LAB_00464d4d: local_221 = 0; } else { pbVar11 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar11 + 0x14)) { pbVar11 = *(byte **)pbVar11; } pcVar16 = "3FBAttack4End"; do { bVar3 = *pbVar11; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00464d40: uVar5 = -(uint)bVar19 | 1; goto LAB_00464d45; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00464d40; pbVar11 = pbVar11 + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464d45: if (uVar5 != 0) goto LAB_00464d4d; local_221 = 1; } if (0 < elapsedFrames) { local_235 = *(byte *)((int)&npc->_i2 + 2); pEVar24 = npc; do { npc = local_248; manager = g_manager; uVar5 = (-(uint)((byte)pEVar24->_i2 < 2) & 0xfffffff0) + 0x13; local_284.y = (float)(pEVar24->_i1 / 5 + 3); iVar7 = local_235 - uVar5; fVar20 = ((float)pEVar24->_i1 / 5.0 - 0.0) / 5.0; if (fVar20 <= 0.0) { fVar20 = 0.0; } if (1.0 <= fVar20) { fVar20 = 1.0; } iVar17 = (int)(fVar20 * 3.0 + 3.0); local_26c.y = (float)(iVar7 / iVar17); if (((uVar5 < local_235) && (iVar7 % iVar17 == 0)) && ((int)local_26c.y < (int)local_284.y)) { local_228 = 1.0; if (local_248->_championColorIdx == 0x12) { local_228 = 1.5; } else if (local_248->_championColorIdx == 0x13) { local_228 = 0.5; } local_22c = (Entity_NPC *)0x10b; seed_fart_sound_override((int *)&local_22c); SoundEffects::Play(&manager->_sfxManager,(int)local_22c,0.5,2,0,local_228,0.0); manager = g_manager; local_228 = 1.0; if (npc->_championColorIdx == 0x12) { local_228 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_228 = 0.5; } local_22c = (Entity_NPC *)0xb2; seed_fart_sound_override((int *)&local_22c); SoundEffects::Play(&manager->_sfxManager,(int)local_22c,1.0,2,0,local_228,0.0); if (npc->_variant == 0) { local_244 = 10.0; local_234 = 7.0; ProjectileParams::ProjectileParams(&circleParams); circleParams.CircleAngle = (npc->_v1).x; circleParams.Variant = 4; circleParams.FallingSpeedModifier = -0.1; circleParams.FallingAccelModifier = -0.06; circleParams.CurvingStrength = 0.002; switch(npc->_i1 % 5) { case 0: circleParams.BulletFlags._0_4_ = 0x40000; break; case 1: circleParams.BulletFlags._0_4_ = 0x80000; break; default: goto switchD_00464fa4_caseD_2; case 3: local_244 = 8.0; if (((uint)local_26c.y & 1) == 0) { circleParams.CircleAngle = circleParams.CircleAngle + 0.3926991; } goto LAB_00464fc1; case 4: local_240.x = 12.0; circleParams.BulletFlags._0_4_ = (uint)circleParams.BulletFlags | 0x42000; local_244 = 8.0; circleParams.CurvingStrength = 0.009; goto LAB_00464fc9; } circleParams.BulletFlags._4_4_ = 0; switchD_00464fa4_caseD_2: LAB_00464fc1: local_240.x = local_234; LAB_00464fc9: local_240.y = local_244; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_240,9,&circleParams); iVar7 = npc->_i1 % 5; if (iVar7 < 2) { if (iVar7 == 0) { circleParams.BulletFlags._0_4_ = 0x80000; LAB_004650a5: circleParams.BulletFlags._4_4_ = 0; } else if (iVar7 == 1) { circleParams.BulletFlags._0_4_ = 0x40000; goto LAB_004650a5; } circleParams.CurvingStrength = 0.015; circleParams.FallingAccelModifier = 0.15; local_258.x = 11.0; local_258.y = local_244; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_258,9,&circleParams); } } else { pEVar24 = (Entity_NPC *)(npc->_v1).x; uVar5 = (int)(float)pEVar24 & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } iVar7 = uVar5 + 6; local_260.y = 6.2831855 / (float)iVar7; if (0 < iVar7) { do { local_22c = (Entity_NPC *)((float)pEVar24 + local_260.y); fVar20 = sin((float)local_22c); local_230 = (undefined4 *)(fVar20 * 7.0); local_27c.x = cos((float)local_22c); local_27c.x = local_27c.x * 7.0; burstParams.GridCollision = 1; burstParams.Scale = 1.0; local_27c.y = (float)local_230; burstParams.HeightModifier = 0.0; burstParams.FallingSpeedModifier = 0.0; burstParams.FallingAccelModifier = 0.0; burstParams.VelocityMulti = 1.0; uVar5 = Random(); burstParams.CircleAngle = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; burstParams.HomingStrength = 1.0; burstParams.CurvingStrength = 0.005; burstParams.Acceleration = 1.01; burstParams.Spread = 1.0; Color::Color((Color *)&burstParams.Color); iVar17 = npc->_variant; burstParams.BulletFlags = 0; burstParams.PositionOffset.y = g_vectorZero.y; burstParams.TargetPosition.y = g_vectorZero.y; burstParams.FireDirectionLimit.y = g_vectorZero.y; burstParams.PositionOffset.x = g_vectorZero.x; burstParams.TargetPosition.x = g_vectorZero.x; burstParams.FireDirectionLimit.x = g_vectorZero.x; burstParams.DotProductLimit = -1000.0; burstParams.WiggleFrameOffset = 0; burstParams.ChangeFlags = 0; burstParams.ChangeVelocity = 0.0; burstParams.ChangeTimeout = 0x1e; burstParams.DepthOffset = 0.0; burstParams.Variant = 0; local_e0 = 0; local_dc = &DAT_bf800000; local_d8 = 0; local_d4 = 0; if (iVar17 == 1) { burstParams.FallingAccelModifier = -0.05; LAB_004652ce: burstParams.FallingSpeedModifier = -0.1; } else if (iVar17 == 2) { burstParams.FallingAccelModifier = -0.15; goto LAB_004652ce; } fVar20 = npc->_maxHitPoints * 0.9; if (npc->_health <= fVar20 && fVar20 != npc->_health) { burstParams.BulletFlags = 0x80000; if (iVar17 == 1) { burstParams.CurvingStrength = 0.007; } else if (iVar17 == 2) { burstParams.CurvingStrength = 0.0035; } } if ((npc->_i1 < 3) && (uVar5 = Random(), uVar5 % 5 == 0)) { burstParams.BulletFlags = burstParams.BulletFlags | 1; burstParams.Scale = 1.5; } else { burstParams.Variant = 4; } local_28c.x = (npc->_pos).x + 0.0; local_28c.y = (npc->_pos).y + 20.0; Entity_NPC::FireProjectiles(npc,&local_28c,&local_27c,0,&burstParams); iVar7 = iVar7 + -1; pEVar24 = local_22c; } while (iVar7 != 0); } } if (((char)npc->_i2 == '\0') && (bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"1Attack",1), bVar3 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if ((1 < (byte)npc->_i2) && (local_284.y == (float)((int)local_26c.y + 1))) { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } pcVar16 = "3FBAttack4End"; do { bVar3 = *strCursor; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00465451: uVar5 = -(uint)bVar19 | 1; goto LAB_00465456; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00465451; strCursor = strCursor + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00465456: if ((uVar5 == 0) && ((pbVar11[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004654b0; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"3FBAttack4End",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } LAB_004654b0: pcVar16 = (char *)((int)&npc->_i2 + 2); *pcVar16 = *pcVar16 + '\x01'; elapsedFrames = elapsedFrames + -1; local_235 = *(byte *)((int)&npc->_i2 + 2); pEVar24 = npc; } while (elapsedFrames != 0); } } else { if (1 < bVar3) { if (*(char *)((int)&npc->_i2 + 2) == '\0') { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } pcVar16 = "3FBAttack4Start"; do { bVar3 = *strCursor; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00464ae0: uVar5 = -(uint)bVar19 | 1; goto LAB_00464ae5; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00464ae0; strCursor = strCursor + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464ae5: if ((uVar5 == 0) && ((pbVar11[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00464b1c; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"3FBAttack4Start",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_00464b1c: if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { LAB_00464bd6: pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 == (byte *)0x0) { pbVar11 = &s_empty; } else if (0xf < *(uint *)(pbVar11 + 0x14)) { pbVar11 = *(byte **)pbVar11; } pcVar16 = "3FBAttack4Start"; do { bVar3 = *pbVar11; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00464c11: uVar5 = -(uint)bVar19 | 1; goto LAB_00464c16; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00464c11; pbVar11 = pbVar11 + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464c16: if (uVar5 == 0) { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } pcVar16 = "3FBAttack4Loop"; do { bVar3 = *strCursor; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00464c54: uVar5 = -(uint)bVar19 | 1; goto LAB_00464c59; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00464c54; strCursor = strCursor + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464c59: if (uVar5 == 0) { if ((pbVar11[0x34] != 0) && ((npc->_sprite)._animState._isPlaying == 0)) { pcVar16 = "3FBAttack4Loop"; goto LAB_00464ce8; } goto LAB_00464cff; } } pcVar16 = "3FBAttack4Loop"; goto LAB_00464ce8; } } else { pbVar11 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar11 + 0x14)) { pbVar11 = *(byte **)pbVar11; } pcVar16 = "3FBAttack4Start"; do { bVar3 = *pbVar11; bVar19 = bVar3 < (byte)*pcVar16; if (bVar3 != *pcVar16) { LAB_00464b63: uVar5 = -(uint)bVar19 | 1; goto LAB_00464b68; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar19 = bVar3 < (byte)pcVar16[1]; if (bVar3 != pcVar16[1]) goto LAB_00464b63; pbVar11 = pbVar11 + 2; pcVar16 = pcVar16 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464b68: if (uVar5 == 0) { fVar20 = (npc->_sprite)._animState._animFrame; if ((fVar20 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed < 17.0) && (17.0 <= fVar20)) { Entity_NPC::PlaySound(npc,0x81,1.0,2,0,1.0); } } else if ((npc->_sprite)._animState._isPlaying == 0) goto LAB_00464bd6; } goto LAB_00464cff; } goto LAB_00464d4d; } if (bVar3 == 1) { ANM2::Play(&npc->_sprite,(byte *)"2Attack",0); pvVar12 = (npc->_sprite)._animState._animData; if (pvVar12 == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = (undefined1 *)(npc->_sprite)._animState._animFrame; } if ((((float)puVar23 - npc->_speedMultiplier * (npc->_sprite)._playbackSpeed < 6.0) && (pvVar12 != (void *)0x0)) && (6.0 <= (npc->_sprite)._animState._animFrame)) { Entity_NPC::PlaySound(npc,0x10c,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&circleParams); circleParams.CircleAngle = (npc->_v1).x; iVar7 = npc->_i1; circleParams.Scale = 1.5; if (npc->_variant == 0) { circleParams.Variant = 4; if (iVar7 == 0) { circleParams.BulletFlags._0_4_ = (uint)circleParams.BulletFlags | 0x10000; local_240.x = 7.0; goto LAB_00464a11; } if (iVar7 == 1) { local_240.x = 10.0; local_240.y = 8.0; goto LAB_00464a21; } } else { if (iVar7 == 0) { circleParams.BulletFlags._0_4_ = (uint)circleParams.BulletFlags | 1; local_240.x = 10.0; LAB_00464a11: local_240.y = 4.0; } else { if (iVar7 != 1) goto LAB_004654d5; circleParams.BulletFlags._0_4_ = (uint)circleParams.BulletFlags | 1; local_240.x = 8.0; local_240.y = 8.0; } LAB_00464a21: Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_240,9,&circleParams); } } } } LAB_004654d5: if ((((byte)npc->_i2 < 2) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) || (local_221 != 0)) { npc->_state = 3; uVar5 = Random(); bVar3 = (char)(uVar5 % 0x5a) + 0xf; *(byte *)((int)&npc->_i2 + 2) = bVar3; if (npc->_variant == 2) { *(byte *)((int)&npc->_i2 + 2) = bVar3 / 3; } } goto LAB_0046646a; } if ((char)npc->_i2 == '\0') { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } keyCursor = &DAT_00b1df3c; do { bVar3 = *strCursor; bVar19 = bVar3 < *keyCursor; if (bVar3 != *keyCursor) { LAB_00464214: uVar5 = -(uint)bVar19 | 1; goto LAB_00464219; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < keyCursor[1]; if (bVar3 != keyCursor[1]) goto LAB_00464214; strCursor = strCursor + 2; keyCursor = keyCursor + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464219: if ((uVar5 == 0) && ((pbVar11[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00464250; } bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1df3c,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_00464250: if ((char)npc->_i2 == '\x01') { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } keyCursor = &DAT_00b1df34; do { bVar3 = *strCursor; bVar19 = bVar3 < *keyCursor; if (bVar3 != *keyCursor) { LAB_00464293: uVar5 = -(uint)bVar19 | 1; goto LAB_00464298; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < keyCursor[1]; if (bVar3 != keyCursor[1]) goto LAB_00464293; strCursor = strCursor + 2; keyCursor = keyCursor + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464298: if ((uVar5 == 0) && ((pbVar11[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004642cf; } bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1df34,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004642cf: if (1 < (byte)npc->_i2) { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 != (byte *)0x0) { strCursor = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { strCursor = *(byte **)pbVar11; } keyCursor = &DAT_00b1df4c; do { bVar3 = *strCursor; bVar19 = bVar3 < *keyCursor; if (bVar3 != *keyCursor) { LAB_00464312: uVar5 = -(uint)bVar19 | 1; goto LAB_00464317; } if (bVar3 == 0) break; bVar3 = strCursor[1]; bVar19 = bVar3 < keyCursor[1]; if (bVar3 != keyCursor[1]) goto LAB_00464312; strCursor = strCursor + 2; keyCursor = keyCursor + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00464317: if ((uVar5 == 0) && ((pbVar11[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0046434e; } bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1df4c,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0046434e: bVar3 = *(byte *)((int)&npc->_i2 + 2); if (bVar3 == 0) { uVar5 = 0; LAB_0046440c: if (npc->_maxHitPoints < npc->_health || npc->_maxHitPoints == npc->_health) goto LAB_00464371; npc->_state = 8; npc->_projectileCooldown = 0x28; *(undefined1 *)((int)&npc->_i2 + 2) = 0; bVar3 = (byte)npc->_i2; if ((bVar3 == 0) || (1 < bVar3)) { uVar5 = Random(); uVar6 = Random(); npc->_i1 = uVar6 % 5 + (uVar5 % 6) * 4 + uVar5 % 6; bVar3 = (byte)npc->_i2; } if (bVar3 == 1) { uVar5 = npc->_i1 + 1U & 0x80000001; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffe) + 1; } npc->_i1 = uVar5; } uVar5 = Random(); (npc->_v1).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; } else { uVar5 = (uint)bVar3; if ((int)(uVar5 - elapsedFrames) < 1) goto LAB_0046440c; LAB_00464371: uVar14 = 0; if (0 < (int)(uVar5 - elapsedFrames)) { uVar14 = (char)(uVar5 - elapsedFrames); } *(undefined1 *)((int)&npc->_i2 + 2) = uVar14; } if ((((npc->_variant == 1) || (npc->_variant == 2)) && (1 < (byte)npc->_i2)) && (((g_game->_frameCount - npc->_spawnFrame) % 100 == 0 && (uVar5 = Random(), (uVar5 & 1) == 0))) ) { npc->_state = 6; npc->_i1 = 0; } if (npc->_variant == 0) { cVar4 = (char)npc->_i2; if (cVar4 == '\x02') { fVar20 = npc->_maxHitPoints * 0.5; if (npc->_health <= fVar20 && fVar20 != npc->_health) goto LAB_0046454d; } else if (cVar4 == '\x03') { fVar20 = npc->_maxHitPoints * 0.4; if (npc->_health <= fVar20 && fVar20 != npc->_health) goto LAB_0046454d; } else if (cVar4 == '\x04') { fVar20 = npc->_maxHitPoints * 0.3; if (npc->_health <= fVar20 && fVar20 != npc->_health) goto LAB_0046454d; } else if (cVar4 == '\x05') { fVar20 = npc->_maxHitPoints * 0.2; if (npc->_health <= fVar20 && fVar20 != npc->_health) goto LAB_0046454d; } else if ((cVar4 == '\x06') && (fVar20 = npc->_maxHitPoints * 0.1, npc->_health <= fVar20 && fVar20 != npc->_health)) { LAB_0046454d: *(char *)&npc->_i2 = cVar4 + '\x01'; npc->_state = 9; npc->_i1 = 0; } } if (1 < (byte)npc->_i2) { iVar7 = Entity::GetIntervalTicks((Entity *)npc,15.0,0.0); if (iVar7 != 0) { iVar7 = npc->_variant; if (iVar7 == 0) { uVar5 = Random(); (npc->_v1).y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 120.0; iVar7 = npc->_variant; } if (iVar7 == 1) { (npc->_v1).y = 0.0; } } pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_240.x = (pEVar8->_pos).x; local_240.y = (pEVar8->_pos).y; local_228 = (npc->_pos).x - local_240.x; local_24c = (npc->_pos).y - local_240.y; if (npc->_variant == 0) { if (ABS(local_228) <= ABS(local_24c)) { local_228 = 0.0; } else { local_24c = 0.0; } } fVar20 = sqrtf(local_24c * local_24c + local_228 * local_228); if (fVar20 <= 0.0) { fVar15 = local_24c; fVar20 = local_228; } else { fVar15 = local_24c * (1.0 / fVar20); fVar20 = local_228 * (1.0 / fVar20); } fVar21 = (npc->_v1).y; local_258.y = *(float *)((int)&npc->_flags + 4); local_230 = (undefined4 *)((fVar21 * fVar20 + (pEVar8->_pos).x) - (npc->_pos).x); local_260.y = (fVar21 * fVar15 + (pEVar8->_pos).y) - (npc->_pos).y; if ((npc->_flags & 0x1000800) == 0) { if ((npc->_flags & 0x200) == 0) { fVar20 = sqrtf(local_260.y * local_260.y + (float)local_230 * (float)local_230); if (32.0 < fVar20) { fVar20 = atan2f(local_260.y,(float)local_230); fVar20 = fVar20 / 0.7853982 + 0.5; FUN_008370b0(); local_230 = (undefined4 *)(fVar20 * 0.7853982); local_228 = sin((float)local_230); local_22c = (Entity_NPC *)cos((float)local_230); fVar15 = sqrtf((float)local_22c * (float)local_22c + local_228 * local_228); fVar20 = local_228; pEVar24 = local_22c; if (0.0 < fVar15) { fVar20 = local_228 * (1.0 / fVar15); pEVar24 = (Entity_NPC *)((float)local_22c * (1.0 / fVar15)); } fVar15 = (float)pEVar24 * 1.3; fVar20 = fVar20 * 1.3; if ((npc->_variant == 1) || (npc->_variant == 2)) { fVar15 = fVar15 * 0.175; fVar20 = fVar20 * 0.175; } fVar21 = npc->_friction; if (fVar21 != 0.0) { fVar22 = npc->_speedMultiplier; (npc->_velocity).x = (fVar15 * fVar22) / fVar21 + (npc->_velocity).x; (npc->_velocity).y = (fVar20 * fVar22) / fVar21 + (npc->_velocity).y; } } } else { if ((npc->_variant == 1) || (npc->_variant == 2)) { npc->_friction = 0.6; } PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); if (npc->_variant == 0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } } } else { if ((npc->_variant == 1) || (npc->_variant == 2)) { npc->_friction = 0.6; } PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_240,0); } } LAB_0046646a: game = g_game; if ((npc->_dead != 0) && (npc->_variant == 2)) { local_258.y = *(float *)((int)g_game->_room + 0x18) + 60.0; pVVar10 = Room::GetCenterPos(&local_29c); local_284.x = pVVar10->x; local_284.y = local_258.y; npc->_maxHitPoints = 0.0; *(undefined4 *)((int)game->_room + 0x12d0) = 0; EntityList::QueryRadius ((EntityList *)((int)game->_room + 0x1218),&nearbyEntities,&npc->_pos,1000.0,2); uVar5 = 0; local_14 = 0.0; if (nearbyEntities._size != 0) { do { iVar7 = uVar5 * 4; uVar5 = uVar5 + 1; *(undefined1 *)(*(int *)((int)nearbyEntities._data + iVar7) + 0x173) = 1; } while (uVar5 < (uint)nearbyEntities._size); } uVar5 = Random(); pEVar8 = Game::Spawn(g_game,0x197,0,&local_284,&g_vectorZero,(Entity *)npc,0,uVar5); uVar25 = *(undefined4 *)((int)&pEVar8->_flags + 4); iVar7 = *(int *)pEVar8; *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar25; (**(code **)(iVar7 + 0xc))(); MusicManager::Crossfade(&g_manager->_musicManager,0x1b,0.08); if (nearbyEntities._0_1_ == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,nearbyEntities._data,0); } } fVar20 = npc->_health; (npc->_v2).x = fVar20; ExceptionList = local_1c; return fVar20; } //@@ 00466600 NpcAI::ENTITY_FISTULA_BIG /* NPC AI for entity type 71 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FISTULA_BIG(Entity_NPC *npc) { byte isFlagSet; uint uVar1; uint uVar2; LayerState *layer; Entity *tmpEntity; Vector *outPos; Vector *pVVar3; undefined4 *puVar4; void *pvVar5; undefined4 *soundIdsEnd; void **ppvVar6; int gridY; float fVar7; float fVar8; float fVar9; int iVar10; undefined4 uVar11; TypeDescriptor *pTVar12; TypeDescriptor *pTVar13; undefined4 uVar14; undefined4 local_9c [11]; void *local_70; Vector local_6c; Vector local_60; float local_58; void **local_54; Vector local_50; Vector local_48; void *local_40; Vector local_3c; int local_34; Vector local_30; Vector local_28; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword entityFlags; float npcY; Room *room; puStack_20 = (undefined1 *)(local_9c + 0x26); local_14 = 0xffffffff; puStack_18 = &LAB_00af277d; local_1c = ExceptionList; local_34 = npc->_variant; if (npc->_state == 0) { npc->_state = 4; npc->_entityGridCollisionClass = 3; if (local_34 != 1) { return; } if (&npc->_splatColor == (ColorMod *)local_9c) { return; } (npc->_splatColor)._offset[0] = 0.13; (npc->_splatColor)._offset[1] = 0.13; (npc->_splatColor)._tint[0] = 0.15; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.13; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } fVar8 = npc->_friction; if (npc->_subtype == 1) { fVar8 = fVar8 * 0.9; } local_3c.y = 0.2; if (npc->_type == 0x48) { local_3c.y = 0.38; } else if (npc->_type == 0x49) { local_3c.y = 0.56; } ExceptionList = &local_1c; npc->_friction = fVar8 * 0.9; local_48.y = (float)npc; puVar4 = local_9c + 0x26; if (local_34 == 0) { npc->_i1 = npc->_i1 + 1; puVar4 = local_9c + 0x26; if (0x78 < npc->_i1) { uVar1 = Random(); puVar4 = (undefined4 *)puStack_20; if (uVar1 % 200 == 0) { puVar4 = (undefined4 *)0x0; npc->_i1 = 0; soundIdsEnd = (undefined4 *)0x0; local_6c.x = 0.0; local_30.y = 0.0; local_6c.y = 0.0; local_14 = 0; local_40 = g_game->_room; local_70 = (void *)0x0; local_28.y = (float)local_70; if (*(int *)((int)local_40 + 0x1264) != 0) { uVar1 = 0; local_28.y = 0.0; do { iVar10 = *(int *)(*(int *)(*(int *)((int)local_40 + 0x125c) + uVar1 * 4) + 0x28); if (iVar10 == 0x47) { local_30.y = 1.37047e-42; if (soundIdsEnd == puVar4) { LAB_004667f6: std::vector<4byte>::_Emplace_reallocate(soundIdsEnd,&local_30.y); puVar4 = (undefined4 *)local_6c.y; soundIdsEnd = (undefined4 *)local_6c.x; } else { *soundIdsEnd = 0x3d2; soundIdsEnd = soundIdsEnd + 1; local_6c.x = (float)soundIdsEnd; } } else if (iVar10 == 0x48) { local_30.y = 1.37187e-42; if (soundIdsEnd == puVar4) goto LAB_004667f6; *soundIdsEnd = 0x3d3; soundIdsEnd = soundIdsEnd + 1; local_6c.x = (float)soundIdsEnd; } else if (iVar10 == 0x49) { local_30.y = 1.37327e-42; if (soundIdsEnd == puVar4) goto LAB_004667f6; *soundIdsEnd = 0x3d4; soundIdsEnd = soundIdsEnd + 1; local_6c.x = (float)soundIdsEnd; } uVar1 = uVar1 + 1; } while (uVar1 < *(uint *)((int)local_40 + 0x1264)); local_28.y = (float)local_70; npc = (Entity_NPC *)local_48.y; local_30.y = (float)puVar4; } uVar1 = (int)soundIdsEnd - (int)local_28.y >> 2; local_70 = (void *)local_28.y; if (uVar1 != 0) { uVar2 = Random(); Entity_NPC::PlaySound(npc,*(int *)((int)local_28.y + (uVar2 % uVar1) * 4),1.0,0x3c,0,1.0); } local_14 = 0xffffffff; puVar4 = (undefined4 *)puStack_20; if ((void *)local_28.y != (void *)0x0) { uVar1 = (int)local_30.y - (int)local_28.y & 0xfffffffc; pvVar5 = (void *)local_28.y; if (0xfff < uVar1) { pvVar5 = *(void **)((int)local_28.y + -4); uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)local_28.y + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar1); puVar4 = (undefined4 *)puStack_20; } } } } puStack_20 = (undefined1 *)puVar4; if (npc->_collidesWithGrid == 0) goto LAB_0046693e; if (local_34 == 0) { iVar10 = npc->_type; if (iVar10 == 0x47) { iVar10 = 0x3ce; } else { LAB_004668d1: if (iVar10 == 0x48) { iVar10 = 0x3c9; } else { if (iVar10 != 0x49) goto LAB_0046693e; iVar10 = 0x3ca; } } } else { if (local_34 != 1) goto LAB_0046693e; iVar10 = npc->_type; if (iVar10 != 0x47) goto LAB_004668d1; iVar10 = 0x3c8; } Entity_NPC::PlaySound(npc,iVar10,1.0,0x14,0,1.0); LAB_0046693e: local_6c.x = *(float *)((int)&npc->_flags + 4); entityFlags = npc->_flags; if ((entityFlags & 0x200) == 0) { fVar8 = (npc->_velocity).x; fVar7 = (local_3c.y * npc->_speedMultiplier) / npc->_friction; if (fVar8 <= 0.0) { fVar8 = fVar8 - fVar7; } else { fVar8 = fVar7 + fVar8; } (npc->_velocity).x = fVar8; fVar8 = (npc->_velocity).y; if (fVar8 <= 0.0) { fVar7 = fVar8 - fVar7; } else { fVar7 = fVar7 + fVar8; } (npc->_velocity).y = fVar7; if ((entityFlags & 0x1000800) != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_30.y = -((tmpEntity->_pos).y - (npc->_pos).y); local_3c.y = -((tmpEntity->_pos).x - (npc->_pos).x); fVar8 = sqrtf(local_30.y * local_30.y + local_3c.y * local_3c.y); if (fVar8 <= 0.0) { puVar4 = (undefined4 *)local_30.y; fVar8 = local_3c.y; } else { fVar7 = ((npc->_size + 80.0) - fVar8) * 0.02; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (0.5 <= fVar7) { fVar7 = 0.5; } puVar4 = (undefined4 *)((fVar7 / fVar8) * local_30.y); fVar8 = (fVar7 / fVar8) * local_3c.y; } fVar7 = npc->_friction; if (fVar7 != 0.0) { fVar9 = npc->_speedMultiplier; (npc->_velocity).y = (fVar9 * (float)puVar4) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (fVar9 * fVar8) / fVar7 + (npc->_velocity).x; } } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } if (npc->_type != 0x49) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); local_48.y = layer->_rotation + 1.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = local_48.y; } if ((npc->_dead != 0) && ((npc->_flags & 0x2000000000000000) == 0)) { uVar1 = Random(); fVar8 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_48.y = fVar8 + fVar8; fVar8 = cos(local_48.y); local_28.y = fVar8 * 20.0; fVar8 = sin(local_48.y); local_30.y = fVar8 * 20.0; if (npc->_type == 0x47) { uVar1 = Random(); uVar14 = 0; local_3c.x = local_28.y + (npc->_pos).x; local_50.x = local_28.y * 0.2; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; local_3c.y = local_30.y + (npc->_pos).y; local_54 = (void **)(local_30.y * 0.2); local_50.y = (float)local_54; local_40 = (void *)local_50.x; tmpEntity = Game::Spawn(g_game,0x48,npc->_variant,&local_3c,&local_50,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_48.y = *(float *)(iVar10 + 0x16c); uVar2 = *(uint *)(iVar10 + 0x168) & 0xfffffffb; *(float *)(iVar10 + 0x16c) = local_48.y; *(uint *)(iVar10 + 0x168) = uVar2; uVar1 = *(uint *)((int)&npc->_flags + 4); if ((npc->_flags & 0x80000000) != 0) { *(uint *)(iVar10 + 0x168) = uVar2 | 0x80000000; *(float *)(iVar10 + 0x16c) = local_48.y; uVar1 = *(uint *)((int)&npc->_flags + 4); } local_70 = (void *)npc->_flags; if ((uVar1 & 0x10000000) != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; } uVar1 = Random(); local_60.x = (npc->_pos).x - local_28.y; local_50.y = local_28.y * -0.2; uVar14 = 0; local_48.y = local_30.y * -0.2; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; local_60.y = (npc->_pos).y - local_30.y; local_48.x = local_50.y; local_3c.y = local_48.y; tmpEntity = Game::Spawn(g_game,0x48,npc->_variant,&local_60,&local_48,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_48.y = *(float *)(iVar10 + 0x16c); uVar2 = *(uint *)(iVar10 + 0x168) & 0xfffffffb; *(float *)(iVar10 + 0x16c) = local_48.y; *(uint *)(iVar10 + 0x168) = uVar2; uVar1 = *(uint *)((int)&npc->_flags + 4); if ((npc->_flags & 0x80000000) != 0) { *(uint *)(iVar10 + 0x168) = uVar2 | 0x80000000; *(float *)(iVar10 + 0x16c) = local_48.y; uVar1 = *(uint *)((int)&npc->_flags + 4); } local_70 = (void *)npc->_flags; if ((uVar1 & 0x10000000) != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; } if ((npc->_subtype == 1) || (local_34 == 1)) { uVar1 = Random(); local_6c.x = local_28.y + (npc->_pos).x; uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; local_6c.y = (npc->_pos).y - local_30.y; tmpEntity = Game::Spawn(g_game,0x48,npc->_variant,&local_6c,&g_vectorZero,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_54 = *(void ***)(iVar10 + 0x16c); uVar2 = *(uint *)(iVar10 + 0x168) & 0xfffffffb; *(void ***)(iVar10 + 0x16c) = local_54; *(uint *)(iVar10 + 0x168) = uVar2; uVar1 = *(uint *)((int)&npc->_flags + 4); if ((npc->_flags & 0x80000000) != 0) { *(uint *)(iVar10 + 0x168) = uVar2 | 0x80000000; *(void ***)(iVar10 + 0x16c) = local_54; uVar1 = *(uint *)((int)&npc->_flags + 4); } if ((uVar1 & 0x10000000) != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; } } else { uVar1 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; local_60.x = (float)local_40; uVar11 = 0; local_60.y = local_3c.y; local_6c.x = local_28.y + (npc->_pos).x; local_6c.y = (npc->_pos).y - local_30.y; tmpEntity = Game::Spawn(g_game,0x48,npc->_variant,&local_6c,&local_60,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_40 = *(void **)(iVar10 + 0x16c); local_48.y = (float)(*(uint *)(iVar10 + 0x168) & 0xfffffffb); *(void **)(iVar10 + 0x16c) = local_40; *(float *)(iVar10 + 0x168) = local_48.y; isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x80000000); if (isFlagSet != 0) { *(uint *)(iVar10 + 0x168) = (uint)local_48.y | 0x80000000; *(void **)(iVar10 + 0x16c) = local_40; } isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (isFlagSet != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; } uVar1 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; local_6c.x = local_50.y; uVar11 = 0; local_6c.y = (float)local_54; local_60.x = (npc->_pos).x - local_28.y; local_60.y = local_30.y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,0x48,npc->_variant,&local_60,&local_6c,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_50.y = *(float *)(iVar10 + 0x16c); local_54 = (void **)(*(uint *)(iVar10 + 0x168) & 0xfffffffb); *(float *)(iVar10 + 0x16c) = local_50.y; *(void ***)(iVar10 + 0x168) = local_54; isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x80000000); if (isFlagSet != 0) { *(uint *)(iVar10 + 0x168) = (uint)local_54 | 0x80000000; *(float *)(iVar10 + 0x16c) = local_50.y; } isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (isFlagSet != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; } } if (local_34 == 0) { Entity_NPC::PlaySound(npc,0x3d1,1.0,0x14,0,1.0); ExceptionList = local_1c; return; } } else if (npc->_type == 0x48) { uVar1 = Random(); local_6c.x = local_28.y * 0.2; uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_6c.y = local_30.y * 0.2; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; local_60.x = local_28.y + (npc->_pos).x; local_60.y = local_30.y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,0x49,npc->_variant,&local_60,&local_6c,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_50.y = *(float *)(iVar10 + 0x16c); local_54 = (void **)(*(uint *)(iVar10 + 0x168) & 0xfffffffb); *(float *)(iVar10 + 0x16c) = local_50.y; *(void ***)(iVar10 + 0x168) = local_54; isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x80000000); if (isFlagSet != 0) { *(uint *)(iVar10 + 0x168) = (uint)local_54 | 0x80000000; *(float *)(iVar10 + 0x16c) = local_50.y; } isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (isFlagSet != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; } uVar1 = Random(); local_6c.x = local_28.y * -0.2; uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_6c.y = local_30.y * -0.2; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; local_60.x = (npc->_pos).x - local_28.y; local_60.y = (npc->_pos).y - local_30.y; tmpEntity = Game::Spawn(g_game,0x49,npc->_variant,&local_60,&local_6c,(Entity *)npc, npc->_subtype,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); local_50.y = *(float *)(iVar10 + 0x16c); local_54 = (void **)(*(uint *)(iVar10 + 0x168) & 0xfffffffb); *(float *)(iVar10 + 0x16c) = local_50.y; *(void ***)(iVar10 + 0x168) = local_54; isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x80000000); if (isFlagSet != 0) { *(uint *)(iVar10 + 0x168) = (uint)local_54 | 0x80000000; *(float *)(iVar10 + 0x16c) = local_50.y; } isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (isFlagSet != 0) { *(undefined4 *)(iVar10 + 900) = 0x41700000; *(undefined4 *)(iVar10 + 0x380) = 0x41700000; ExceptionList = local_1c; return; } } else { Entity_NPC::PlaySound(npc,0x109,0.8,2,0,1.0); PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); uVar1 = (npc->_pathfinder)._gridIndex; if (uVar1 < 0x1c0) { iVar10 = *(int *)((int)g_game->_room + uVar1 * 4 + 0x76c); } else { iVar10 = 0; } if ((local_34 == 1) || (iVar10 != 3000)) { local_50.y = (float)npc->_subtype; local_54 = (void **)((uint)(local_50.y == 1.4013e-45) * 2 + 0x17); if (local_34 == 1) { local_58 = (npc->_pos).x; ppvVar6 = &g_game->_room; local_54 = (void **)(npc->_pos).y; iVar10 = Room::GetGridCollisionAtPos(*ppvVar6,npc->_pos); if (iVar10 == 0) { local_34 = 0; local_30.x = 0.0; local_30.y = 0.0; do { room = *ppvVar6; if (local_34 == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); pVVar3 = &local_6c; fVar8 = 70.0; local_6c.x = ((tmpEntity->_pos).x + (npc->_pos).x) * 0.5; outPos = &local_60; local_6c.y = ((tmpEntity->_pos).y + (npc->_pos).y) * 0.5; } else { pVVar3 = &npc->_pos; fVar8 = 100.0; outPos = &local_28; } pVVar3 = Room::FindFreePickupSpawnPosition(room,outPos,pVVar3,fVar8,0,0,0); local_30.x = pVVar3->x; local_30.y = pVVar3->y; uVar1 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; tmpEntity = Game::Spawn(g_game,0x55,0,&local_30,&g_vectorZero,(Entity *)npc,0,uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); ppvVar6 = &g_game->_room; pvVar5 = *ppvVar6; local_3c.y = (float)(int)((local_30.x - 40.0) / 40.0 + 0.5); gridY = (int)((local_30.y - 120.0) / 40.0 + 0.5); if (((((-1 < (int)local_3c.y) && ((int)local_3c.y < *(int *)((int)pvVar5 + 0xc))) && (-1 < gridY)) && ((gridY < *(int *)((int)pvVar5 + 0x10) && (uVar1 = *(int *)((int)pvVar5 + 0xc) * gridY + (int)local_3c.y, uVar1 < 0x1c0)))) && (*(int *)((int)pvVar5 + uVar1 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)pvVar5 + uVar1 * 4 + 0x76c) = 900; } fVar8 = *(float *)(iVar10 + 0x33c); *(float *)(iVar10 + 0x334) = fVar8; fVar7 = *(float *)(iVar10 + 0x340); *(float *)(iVar10 + 0x338) = fVar7; fVar9 = (npc->_pos).x; *(float *)(iVar10 + 0x33c) = fVar9; npcY = (npc->_pos).y; *(uint *)(iVar10 + 0x168) = *(uint *)(iVar10 + 0x168) & 0xfffffffb; *(undefined4 *)(iVar10 + 0x16c) = *(undefined4 *)(iVar10 + 0x16c); fVar9 = (fVar8 - fVar9) * 0.04; local_34 = local_34 + 1; *(undefined4 *)(iVar10 + 0xb64) = 6; *(float *)(iVar10 + 0x340) = npcY; fVar8 = (fVar7 - npcY) * 0.04; *(undefined4 *)(iVar10 + 0xbbc) = 0xc1000000; *(float *)(iVar10 + 0x350) = *(float *)(iVar10 + 0x350) - 10.0; *(float *)(iVar10 + 0x360) = fVar9; *(float *)(iVar10 + 0x364) = fVar8; *(float *)(iVar10 + 0xbb0) = fVar9; *(float *)(iVar10 + 0xbb4) = fVar8; local_54 = ppvVar6; } while (local_34 < 2); ExceptionList = local_1c; return; } } else { if (local_50.y != 1.4013e-45) { local_48.x = (npc->_pos).x; local_48.y = (npc->_pos).y; iVar10 = Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); if (iVar10 != 0) { ExceptionList = local_1c; return; } } uVar1 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; tmpEntity = Game::Spawn(g_game,(uint)local_54,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0, uVar1); iVar10 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); *(float *)(iVar10 + 0x380) = *(float *)(iVar10 + 0x380) * 0.75; isFlagSet = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((isFlagSet != 0) && (local_50.y == 1.4013e-45)) { *(undefined4 *)(iVar10 + 0x380) = 0x41200000; *(undefined4 *)(iVar10 + 900) = 0x41200000; } *(uint *)(iVar10 + 0x168) = *(uint *)(iVar10 + 0x168) & 0xfffffffb; *(undefined4 *)(iVar10 + 0x16c) = *(undefined4 *)(iVar10 + 0x16c); } } } } ExceptionList = local_1c; return; } //@@ 00467670 NpcAI::ENTITY_LOKI /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 69 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_LOKI(Entity_NPC *npc) { undefined4 uVar1; void *pvVar2; float *pfVar3; byte bVar4; uint uVar5; int iVar6; byte *anim; Entity *tmpEntity; Entity_Player *nearestPlayer; ColorMod *color; ColorMod *color_00; ProjectileParams *firingParams; ColorMod *color_01; ColorMod *color_02; int roomWidth; float *extraout_ECX; int unused; Game *game; int iVar7; float fVar8; float fVar9; float distSq; Vector *pVVar10; Vector shotVelocity; float teleportY; undefined1 local_1b8 [12]; float local_1ac; AnimationState *local_1a8; AnimationState *local_1a4; ProjectileParams burstParams; ProjectileParams projParams; Color bloodColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; AnimationState *animState; Manager *manager; pvVar2 = ExceptionList; puStack_20 = (undefined1 *)(&bloodColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af27b0; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)((&bloodColor)[1]._colorize + 1); ExceptionList = &local_1c; local_24 = uVar5; if (npc->_state == 0) { uVar1 = *(undefined4 *)((int)&npc->_flags + 4); (npc->_targetPosition).x = g_vectorZero.x; fVar8 = g_vectorZero.y; *(uint *)&npc->_flags = (uint)npc->_flags | 0x80000; (npc->_targetPosition).y = fVar8; iVar7 = npc->_variant; npc->_state = 3; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; game = g_game; if (iVar7 != 1) { ExceptionList = pvVar2; return; } if (npc->_i1 != 0) { ExceptionList = pvVar2; return; } iVar7 = 0; npc->_i1 = 1; puStack_20 = (undefined1 *)(&bloodColor)[1]._offset; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_1b8,npc->_type,1,-1, 0,0); fVar8 = 0.0; local_14 = 0.0; if (local_1ac != 0.0) { do { iVar6 = __RTDynamicCast(*(undefined4 *)(local_1b8._4_4_ + (int)fVar8 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar5); if (*(int *)(iVar6 + 0xbc0) == 0) { iVar7 = iVar6; } fVar8 = (float)((int)fVar8 + 1); } while ((uint)fVar8 < (uint)local_1ac); if (iVar7 != 0) { *(undefined4 *)(iVar7 + 0xbc0) = 2; *(undefined1 *)(iVar7 + 0x171) = 0; *(undefined1 *)(iVar7 + 0x148) = 1; } } if (local_1b8[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_1b8._4_4_,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } animState = &(npc->_sprite)._animState; local_1a8 = animState; pfVar3 = (&bloodColor)[1]._offset; if ((npc->_sprite)._animState._animData != (void *)0x0) { local_1a4 = animState; bVar4 = AnimationState::IsEventTriggered(animState,(byte *)"Giggle"); manager = g_manager; local_1a8 = animState; if (bVar4 != 0) { local_1a8 = (AnimationState *)0x3b5; seed_fart_sound_override((int *)&local_1a8); SoundEffects::Play(&manager->_sfxManager,(int)local_1a8,1.0,2,0,1.0,0.0); local_1a8 = local_1a4; } pfVar3 = (float *)puStack_20; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(local_1a8,s_Jump); manager = g_manager; if (bVar4 != 0) { local_1a4 = (AnimationState *)0x3b6; seed_fart_sound_override((int *)&local_1a4); SoundEffects::Play(&manager->_sfxManager,(int)local_1a4,1.0,2,0,1.0,0.0); } pfVar3 = (float *)puStack_20; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(local_1a8,(byte *)"JumpIn"), manager = g_manager, pfVar3 = (float *)puStack_20, bVar4 != 0)) { local_1a4 = (AnimationState *)0x3b7; seed_fart_sound_override((int *)&local_1a4); SoundEffects::Play(&manager->_sfxManager,(int)local_1a4,1.0,2,0,1.0,0.0); pfVar3 = (float *)puStack_20; } } } puStack_20 = (undefined1 *)pfVar3; npc->_friction = npc->_friction * 0.8; pvVar2 = (npc->_sprite)._animState._animData; if ((pvVar2 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { iVar7 = npc->_state; if (iVar7 != 6) { npc->_state = 3; goto switchD_00467969_caseD_0; } } else { iVar7 = npc->_state; } switch(iVar7) { case 3: switchD_00467969_caseD_0: PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); fVar8 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; anim = s_Idle; if (1.0 < fVar9 * fVar9 + fVar8 * fVar8) { anim = s_Walk; } ANM2::Play(&npc->_sprite,anim,0); bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar4 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1a4 = (AnimationState *)((npc->_pos).x - (tmpEntity->_pos).x); local_1a8 = (AnimationState *)((npc->_pos).y - (tmpEntity->_pos).y); uVar5 = Random(); if ((uVar5 % 0x28 == 0) && ((float)local_1a4 * (float)local_1a4 + (float)local_1a8 * (float)local_1a8 < 90000.0)) { ANM2::Play(&npc->_sprite,(byte *)"TeleportUp",0); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_state = 6; npc->_stateFrame = 0; ExceptionList = local_1c; return; } uVar5 = Random(); if (uVar5 % 0x8c == 0) { ANM2::Play(&npc->_sprite,&DAT_00b1d548,0); npc->_state = 9; npc->_stateFrame = 0; ExceptionList = local_1c; return; } uVar5 = Random(); if (uVar5 % 100 == 0) { ANM2::Play(&npc->_sprite,&DAT_00b1d53c,0); npc->_state = 10; npc->_stateFrame = 0; ExceptionList = local_1c; return; } uVar5 = Random(); if (uVar5 % 0x46 == 0) { iVar6 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); uVar5 = Random(); iVar7 = 0; if (0 < iVar6) { iVar7 = iVar6; } if ((iVar7 < (int)(uVar5 % 3 + 3)) && ((uVar5 = Random(), uVar5 % 3 == 0 || (npc->_variant == 0)))) { ANM2::Play(&npc->_sprite,&DAT_00b1d554,0); npc->_state = 8; } } } npc->_stateFrame = 0; ExceptionList = local_1c; return; default: ExceptionList = local_1c; return; case 6: if ((pvVar2 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"TeleportDown",0); npc->_state = 7; bVar4 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero); if (bVar4 == 0) { ExceptionList = local_1c; return; } (npc->_pos).x = *extraout_ECX; (npc->_pos).y = extraout_ECX[1]; ExceptionList = local_1c; return; } local_1a4 = (AnimationState *)0x5; game = g_game; do { Room::GetRandomPosition(game->_room,(Vector *)(local_1b8 + 8),20.0); pvVar2 = g_game->_room; iVar7 = (int)(((float)local_1b8._8_4_ - 40.0) / 40.0 + 0.5); iVar6 = (int)((local_1ac - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (roomWidth = *(int *)((int)pvVar2 + 0xc), roomWidth <= iVar7)) || (iVar6 < 0)) || (*(int *)((int)pvVar2 + 0x10) <= iVar6)) { roomWidth = *(int *)((int)pvVar2 + 0xc); uVar5 = 0xffffffff; } else { uVar5 = iVar6 * roomWidth + iVar7; } local_1b8._8_4_ = (float)((int)uVar5 % roomWidth) * 40.0 + 40.0; teleportY = (float)((int)uVar5 / roomWidth) * 40.0 + 120.0; local_1ac = teleportY; local_1a8 = (AnimationState *)local_1b8._8_4_; nearestPlayer = Game::GetNearestPlayer(g_game,(Vector *)(local_1b8 + 8)); game = g_game; fVar8 = (float)local_1a8 - (nearestPlayer->_pos).x; fVar9 = teleportY - (nearestPlayer->_pos).y; distSq = fVar9 * fVar9 + fVar8 * fVar8; if ((((20.0 <= ABS(fVar8)) && (20.0 <= ABS(fVar9))) || (160000.0 <= distSq)) && ((40000.0 <= distSq && ((0x1bf < uVar5 || (*(int *)((int)g_game->_room + uVar5 * 4 + 0x76c) < 500)))))) { (npc->_targetPosition).x = (float)local_1a8; (npc->_targetPosition).y = teleportY; } if ((int)local_1a4 < 1) { ExceptionList = local_1c; return; } if ((npc->_targetPosition).x != g_vectorZero.x) { ExceptionList = local_1c; return; } local_1a4 = (AnimationState *)((int)&local_1a4[-1]._previouslyTriggeredEvents + 3); } while ((npc->_targetPosition).y == g_vectorZero.y); ExceptionList = local_1c; return; case 8: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 == 0) { ExceptionList = local_1c; return; } bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar4 != 0) && (uVar5 = Entity::CountRelatedEntities((Entity *)npc,0x19,npc->_variant,unused,(void *)0x0), 2 < uVar5)) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x19,npc->_variant,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5 ); bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar4 == 0) { ExceptionList = local_1c; return; } tmpEntity->_health = 10.0; tmpEntity->_maxHitPoints = 10.0; ExceptionList = local_1c; return; case 9: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 == 0) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x3b9,1.0,2,0,1.0); pVVar10 = &g_vectorZero; Color::Color(&bloodColor); spawn_blood_explosion(3,&npc->_pos,&g_vectorZero,color,pVVar10); firingParams = ProjectileParams::ProjectileParams(&projParams); local_1b8._8_4_ = 0x41400000; local_1ac = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(local_1b8 + 8),8,firingParams); ExceptionList = local_1c; return; case 10: break; } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 == 0) { ExceptionList = local_1c; return; } iVar7 = npc->_stateFrame; if (iVar7 == 0) { Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x3b8,1.0,2,0,1.0); pVVar10 = &g_vectorZero; Color::Color(&bloodColor); spawn_blood_explosion(3,&npc->_pos,&g_vectorZero,color_00,pVVar10); firingParams = ProjectileParams::ProjectileParams(&projParams); local_1b8._8_4_ = (AnimationState *)0x41400000; pVVar10 = (Vector *)(local_1b8 + 8); local_1ac = 0.0; LAB_00468130: uVar5 = 6; } else { if (iVar7 != 1) { if (iVar7 != 2) goto LAB_0046813b; Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x3b8,1.0,2,0,1.0); pVVar10 = &g_vectorZero; Color::Color(&bloodColor); spawn_blood_explosion(3,&npc->_pos,&g_vectorZero,color_02,pVVar10); firingParams = ProjectileParams::ProjectileParams(&burstParams); shotVelocity.x = 12.0; pVVar10 = &shotVelocity; shotVelocity.y = 0.0; goto LAB_00468130; } Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x3b8,1.0,2,0,1.0); pVVar10 = &g_vectorZero; Color::Color(&bloodColor); spawn_blood_explosion(3,&npc->_pos,&g_vectorZero,color_01,pVVar10); firingParams = ProjectileParams::ProjectileParams(&projParams); local_1b8._8_4_ = (AnimationState *)0x41400000; pVVar10 = (Vector *)(local_1b8 + 8); local_1ac = 0.0; uVar5 = 7; } Entity_NPC::FireProjectiles(npc,&npc->_pos,pVVar10,uVar5,firingParams); LAB_0046813b: npc->_stateFrame = npc->_stateFrame + 1; ExceptionList = local_1c; return; } //@@ 00468180 NpcAI::ENTITY_DADDYLONGLEGS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Exceeded maximum restarts with more pending */ /* NPC AI for entity type 101 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DADDYLONGLEGS(Entity_NPC *npc) { float fVar1; undefined4 uVar2; code *pcVar3; longlong lVar4; longlong lVar5; byte bVar6; char cVar7; int iVar8; Entity *pEVar9; float fVar10; EntityRef *ref; int *piVar11; Entity_Effect *bloodCloud; int iVar12; int gridY; Entity *bloodCloud; Vector *pVVar14; undefined4 *puVar15; Game *game; uint uVar16; int unusedArg; void *pvVar17; undefined1 *puVar18; int unused; void **ppvVar19; int unused_00; uint uVar20; uint uVar21; PlayerManager *playerManager; Room *room; bool bVar22; float fVar23; float fVar24; ulonglong timeNs; undefined8 uVar25; BitSet128 in_stack_fffffc94; undefined1 auVar26 [16]; undefined1 auVar27 [16]; undefined1 auVar28 [16]; undefined1 auVar29 [16]; byte addEnemyKillScore; Entity *pEStack_348; float fStack_344; uint spawnVariant; Entity *local_33c; uint uStack_338; Vector *pVStack_334; ItemPool *spawnSubType; float *pfStack_32c; void *pvStack_328; Game *pGStack_324; Entity *pEStack_320; ItemPool *pIStack_31c; Vector scratchVec; EntityPtr *pEStack_310; EntityPtr selfNpc; EntityPtr *pEStack_308; uint uStack_304; Vector *pVStack_300; float fStack_2fc; float fStack_2f8; float fStack_2f4; float fStack_2f0; float fStack_2ec; Vector spiderSpawnPos; EntityRef charmSourceRef; int procItemKeyAnyVariant [2]; Vector targetLeadPos; Vector targetPos; Vector effectSpawnPos; Vector projectileVelocity; undefined8 uStack_288; undefined4 uStack_280; int procItemKeyType; int procItemKeyVariant; Entity *pEStack_274; float *pfStack_270; undefined4 uStack_26c; undefined4 uStack_268; undefined4 uStack_264; undefined4 uStack_260; undefined4 uStack_25c; EntityRef brimstoneMarkSourceRef; EntityRef shrinkSourceRef; float fStack_208; float fStack_204; float fStack_200; float fStack_1fc; float fStack_1f8; float fStack_1f4; float fStack_1f0; float fStack_1ec; float fStack_1e8; float fStack_1e4; float fStack_1e0; float fStack_1dc; float fStack_1d8; float fStack_1d4; undefined1 auStack_1d0 [8]; int iStack_1c8; Vector freePosNearTarget; Vector freePosNearTargetFar; Vector freePosNearSelf; EntityRef EStack_1ac; RNG cardRng; ColorMod poofColor; undefined4 uStack_148; undefined4 uStack_144; undefined4 uStack_140; undefined4 uStack_13c; undefined4 uStack_138; undefined4 uStack_134; undefined4 uStack_130; undefined4 uStack_12c; undefined4 uStack_128; undefined4 uStack_124; undefined4 uStack_120; ColorMod bloodCloudColor; ProjectileParams projectileParams; int nextAttackStates [5]; float stompPositions [10]; uint local_c; char *animName; std_set *spawnTriggerTargets; EntityPtr spawner; local_c = __security_cookie ^ (uint)&pEStack_348; iVar8 = npc->_state; if (iVar8 == 0) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; return; } selfNpc = (EntityPtr)npc; if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (npc->_projectileDelay < 1)) { if (iVar8 == 7) { if (npc->_i1 == 0) { iVar8 = npc->_i2; npc->_i2 = iVar8 + 1; if ((iVar8 < (int)((npc->_variant != 1) + 3)) || (uVar16 = Random(), uVar16 % 7 == 0)) { iVar8 = npc->_i2; if (4 < iVar8) { iVar8 = 4; } local_33c = (Entity *)(iVar8 - 1); if (((int)local_33c / 2 == 0) || (npc->_variant == 1)) { animName = "StompArm"; } else { animName = "StompLeg"; } bVar6 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_sprite)._flipX = ~(byte)local_33c & 1; } else { npc->_state = 4; ANM2::Play(&npc->_sprite,&DAT_00b1cddc,0); npc->_stateFrame = 0; scratchVec.y = -g_vectorOne.y; scratchVec.x = -g_vectorOne.x; fVar10 = *(float *)((int)npc->_config + 0x38); in_stack_fffffc94._h._0_4_ = (Entity *)0x4682d2; in_stack_fffffc94._h._4_4_ = (Vector *)fVar10; Entity::SetSize((Entity *)npc,fVar10, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); } } else { (**(code **)(*(int *)npc + 0x28))(); } } else if (iVar8 == 6) { npc->_state = 7; scratchVec.y = -g_vectorOne.y; scratchVec.x = -g_vectorOne.x; fVar10 = *(float *)((int)npc->_config + 0x38) * 0.5; in_stack_fffffc94._h._0_4_ = (Entity *)0x46838a; in_stack_fffffc94._h._4_4_ = (Vector *)fVar10; Entity::SetSize((Entity *)npc,fVar10, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); } else { npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); } } if ((((npc->_state == 4) || (npc->_state == 7)) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (bVar6 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land), bVar6 != 0)) { if (npc->_state == 4) { Entity_NPC::PlaySound(npc,0x34,0.7,2,0,1.0); ShockwaveParams::ShockwaveParams(&pEStack_274); game = g_game; local_33c = (Entity *)(npc->_pos).x; pfStack_32c = (float *)(npc->_pos).y; uStack_25c = 0xd; pvVar17 = g_game->_room; uStack_264 = 0x3ccccccd; uStack_268 = 0x3d23d70a; *(int *)((int)pvVar17 + 0x70fc) = *(int *)((int)pvVar17 + 0x70fc) + 1; pvStack_328 = (void *)(*(uint *)((int)pvVar17 + 0x70fc) & 0x80000001); if ((int)pvStack_328 < 0) { pvStack_328 = (void *)(((int)pvStack_328 - 1U | 0xfffffffe) + 1); } pEStack_274 = local_33c; pfStack_270 = pfStack_32c; if ((void *)0x1 < pvStack_328) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); game = g_game; } iVar8 = (int)pvStack_328 + 0x407; *(Entity **)((int)pvVar17 + iVar8 * 0x1c) = local_33c; *(float **)((int)pvVar17 + iVar8 * 0x1c + 4) = pfStack_32c; *(undefined4 *)((int)pvVar17 + iVar8 * 0x1c + 8) = uStack_26c; *(undefined4 *)((int)pvVar17 + iVar8 * 0x1c + 0xc) = 0x3d23d70a; *(undefined4 *)((int)pvVar17 + iVar8 * 0x1c + 0x10) = 0x3ccccccd; *(undefined4 *)((int)pvVar17 + iVar8 * 0x1c + 0x14) = uStack_260; *(undefined4 *)((int)pvVar17 + iVar8 * 0x1c + 0x18) = 0xd; Game::ShakeScreen(game,0xc); poofColor._offset[0] = 0.0; poofColor._colorize[0] = 0.0; poofColor._colorize[1] = 0.0; poofColor._colorize[2] = 0.0; poofColor._colorize[3] = 0.0; poofColor._offset[1] = 0.0; poofColor._offset[2] = 0.0; poofColor._tint[0] = 0.62; poofColor._tint[1] = 0.62; poofColor._tint[2] = 0.62; poofColor._tint[3] = 0.8; Entity::MakeGroundPoof((Entity *)npc,&npc->_pos,&poofColor,1.0); } else { Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); uVar16 = Random(); pEVar9 = Game::SpawnEx(g_game,1000,0x10,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar16,0); uVar16 = Random(); (pEVar9->_sprite)._offset.x = 0.0; (pEVar9->_sprite)._offset.y = 15.0; (pEVar9->_sprite)._flipX = ~(byte)uVar16 & 1; uStack_138 = 0; uStack_134 = 0; uStack_130 = 0; uStack_12c = 0; uStack_128 = 0; uStack_124 = 0; uStack_120 = 0; uStack_148 = 0x3f4ccccd; uStack_144 = 0x3f4ccccd; uStack_140 = 0x3f4ccccd; uStack_13c = 0x3f333333; (**(code **)(*(int *)pEVar9 + 0x3c))(); if (pEVar9->_parent != (EntityPtr)0x0) { pEStack_310 = &pEVar9->_parent; std::multiset::erase(); } pEVar9->_parent = (EntityPtr)npc; std::multiset::insert(); fVar10 = (pEVar9->_pos).x; fVar23 = (pEVar9->_pos).y; fVar24 = (npc->_pos).x; fVar1 = (npc->_pos).y; iVar8 = *(int *)pEVar9; *(undefined1 *)&pEVar9[1]._sprite._filename._size = 1; pEVar9[1]._sprite._filename._capacity = (uint)(fVar10 - fVar24); *(float *)pEVar9[1]._sprite._animDefaultName._buf = fVar23 - fVar1; (**(code **)(iVar8 + 0xc))(); } pVVar14 = &npc->_pos; fVar10 = 300.0; if ((npc->_flags & 0x1000000000000000) != 0) { fVar10 = 50.0; } in_stack_fffffc94 = g_tearFlagsNone; Game::BombDamage(g_game,pVVar14,fVar10,44.0,0,(Entity *)npc,g_tearFlagsNone,0x1000000,0); if (npc->_state == 4) { ProjectileParams::ProjectileParams(&projectileParams); if (npc->_variant == 1) { projectileParams.Color._tint[0] = 0.0; projectileParams.Color._tint[1] = 0.0; projectileParams.Color._tint[2] = 0.0; projectileParams.Color._tint[3] = 1.0; projectileParams.Color._offset[0] = 1.0; projectileParams.Color._offset[1] = 1.0; projectileParams.Color._offset[2] = 1.0; } projectileVelocity.x = 10.0; projectileVelocity.y = 0.0; in_stack_fffffc94._h._0_4_ = (Entity *)0x468762; in_stack_fffffc94._h._4_4_ = pVVar14; Entity_NPC::FireProjectiles(npc,pVVar14,&projectileVelocity,8,&projectileParams); } if (npc->_variant == 1) { pVStack_300 = (Vector *)Random(); game = g_game; pVStack_334 = &npc->_pos; pGStack_324 = g_game; spawnSubType = (ItemPool *)0x0; spawnVariant = 0x19; uStack_304 = 1000; lua_callback_run_pre_entity_spawn ((int *)&uStack_304,(int *)&spawnVariant,pVStack_334,&g_vectorZero,(Entity *)npc, (int *)&spawnSubType,(uint *)&pVStack_300); uStack_338 = uStack_304; if (1 < *(int *)&g_game->_deathmatchManager) { pEStack_348 = (g_game->_deathmatchManager)._type; fVar10 = (float)Random(); pEVar9 = pEStack_348; uStack_288 = 0x900000005; pEStack_310 = (EntityPtr *)&DAT_00000007; uStack_280 = 7; fStack_344 = fVar10; if (uStack_338 == 5) { if (spawnVariant < 0x12d) { if (spawnVariant == 300) { while ((spawnSubType == (ItemPool *)0x0 || (cVar7 = (**(code **)(*(int *)pEStack_348 + 0x24))(spawnSubType), cVar7 != '\0' ))) { if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar16 = (uint)fVar10 >> ((byte)uStack_288 & 0x1f) ^ (uint)fVar10; uVar16 = uVar16 << ((byte)((ulonglong)uStack_288 >> 0x20) & 0x1f) ^ uVar16; fVar10 = (float)(uVar16 >> ((byte)pEStack_310 & 0x1f) ^ uVar16); iVar8 = ItemPool::GetCardEx((int)fVar10,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)fVar10; spawnSubType = (ItemPool *)lua_callback_run_get_card(&cardRng,iVar8,1,1,0); } goto LAB_004688a3; } if (spawnVariant == 0x46) { local_33c = (Entity *)((uint)spawnSubType >> 0xb); do { if (spawnSubType != (ItemPool *)0x0) { pcVar3 = *(code **)(*(int *)pEStack_348 + 0x28); iVar8 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)spawnSubType,(Entity_Player *)0x0); cVar7 = (*pcVar3)(iVar8); if (cVar7 == '\0') goto LAB_004688a3; fVar10 = fStack_344; } pIStack_31c = &g_game->_itemPool; if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar16 = (uint)fVar10 >> ((byte)uStack_288 & 0x1f) ^ (uint)fVar10; uVar16 = uVar16 << ((byte)((ulonglong)uStack_288 >> 0x20) & 0x1f) ^ uVar16; fVar10 = (float)(uVar16 >> ((byte)pEStack_310 & 0x1f) ^ uVar16); fStack_344 = fVar10; uVar16 = ItemPool::GetPill((uint)fVar10); spawnSubType = (ItemPool *)(uVar16 | ((uint)local_33c & 1) << 0xb); } while( true ); } if (spawnVariant != 100) goto LAB_004688ab; if (spawnSubType == (ItemPool *)0x19) { LAB_00468887: bVar22 = false; } else { pIStack_31c = spawnSubType; std::set::find_node(auStack_1d0,&pIStack_31c); if (((*(char *)(iStack_1c8 + 0xd) == '\0') && (*(int *)(iStack_1c8 + 0x10) <= (int)spawnSubType)) && (iStack_1c8 != pEVar9->_index)) goto LAB_00468887; bVar22 = true; } if ((spawnSubType == (ItemPool *)0x0) || (bVar22)) { spawnSubType = (ItemPool *)(**(code **)(*(int *)pEVar9 + 0x84))(0); } } else { if (spawnVariant != 0x15e) goto LAB_004688ab; while ((spawnSubType == (ItemPool *)0x0 || (cVar7 = (**(code **)(*(int *)pEVar9 + 0x2c))(spawnSubType), cVar7 != '\0'))) { spawnSubType = (ItemPool *)ItemPool::GetTrinket(&g_game->_itemPool,0); } npc = (Entity_NPC *)selfNpc; } LAB_004688a3: } LAB_004688ab: game = pGStack_324; } if (((*(uint *)((int)npc + 0x168) & 0x20000000) != 0) && (uStack_338 == 1000)) { switch(spawnVariant) { case 0x468ab9: /* WARNING: This code block may not be properly labeled as switch case */ spawnVariant = 0x2c; } } local_33c = EntityFactory::Create(game->_entityFactory,uStack_338,0); lVar4 = CONCAT44(pIStack_31c,pEStack_308); if (local_33c != (Entity *)0x0) { timeNs = GetTimeNs(); spawner = selfNpc; pEVar9 = local_33c; uVar21 = (uint)(timeNs >> 0x20); lVar4 = (timeNs & 0xffffffff) * 0x431bde82; pvStack_328 = (void *)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar21 * 0xd7b634db; pfStack_32c = (float *)((ulonglong)lVar5 >> 0x20); timeNs = lVar5 + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar20 = (uint)(timeNs >> 0x20); lVar4 = lVar4 + (timeNs & 0xffffffff); fStack_2f8 = (float)lVar4; uVar16 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = (ulonglong)uVar21 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar20,uVar16),uVar20 + uVar16); uVar16 = (uint)((ulonglong)lVar4 >> 0x20); pEStack_310 = (EntityPtr *)((uint)lVar4 >> 0x12 | uVar16 * 0x4000); fStack_344 = (float)(uVar16 >> 0x12); local_33c->_spawnerType = *(int *)((int)selfNpc + 0x28); local_33c->_spawnerVariant = *(int *)((int)selfNpc + 0x2c); if (local_33c->_spawnerEntity != (EntityPtr)0x0) { pEStack_308 = &local_33c->_spawnerEntity; std::multiset::erase(&pEStack_308); } pEVar9->_spawnerEntity = spawner; std::multiset::insert(&pEVar9->_spawnerEntity); (pEVar9->_pos).x = ((Vector *)((int)spawner + 0x33c))->x; (pEVar9->_pos).y = *(float *)((int)spawner + 0x340); iVar8 = *(int *)pEVar9; (pEVar9->_velocity).x = g_vectorZero.x; (pEVar9->_velocity).y = g_vectorZero.y; (**(code **)(iVar8 + 4))(); pvVar17 = pGStack_324->_room; iVar8 = *(int *)((int)pvVar17 + 0x1214); *(int *)((int)pvVar17 + 0x1214) = iVar8 + 1; pEVar9->_index = iVar8; EntityList::AddEntity((EntityList *)((int)pvVar17 + 0x1218),pEVar9); bVar6 = Entity::IsActiveEnemy((Entity *)spawner,1); if (bVar6 != 0) { if ((*(uint *)((int)spawner + 0x16c) & 0x10000000) == 0) { bVar6 = Entity::HasEntityFlags((Entity *)spawner,0x20000000); if (bVar6 != 0) { addEnemyKillScore = 0; bVar6 = 0; iVar8 = -1; ref = EntityRef::EntityRef(&EStack_1ac); Entity::AddCharmed(pEVar9,ref,iVar8,bVar6,addEnemyKillScore); } } else { uVar16 = *(uint *)((int)&pEVar9->_flags + 4); uVar2 = (undefined4)pEVar9->_flags; *(undefined4 *)&pEVar9->_flags = uVar2; *(uint *)((int)&pEVar9->_flags + 4) = uVar16 | 0x10000000; if ((uStack_338 != 9) && (uStack_338 != 7)) { *(undefined4 *)&pEVar9->_flags = uVar2; *(uint *)((int)&pEVar9->_flags + 4) = uVar16 | 0x10000020; } charmSourceRef._entity = *(void **)((int)spawner + 0x264); if (charmSourceRef._entity == (void *)0x0) { charmSourceRef._type = 0; charmSourceRef._variant = 0; charmSourceRef._spawnerType = 0; charmSourceRef._spawnerVariant = 0; fStack_1d8 = g_vectorZero.x; fStack_1d4 = g_vectorZero.y; charmSourceRef._position.x = g_vectorZero.x; charmSourceRef._position.y = g_vectorZero.y; fStack_208 = g_vectorZero.x; fStack_204 = g_vectorZero.y; charmSourceRef._velocity.x = g_vectorZero.x; charmSourceRef._velocity.y = g_vectorZero.y; LAB_00468d9e: pEStack_348 = (Entity *)0x0; if (charmSourceRef._entity != (void *)0x0) goto LAB_00468da8; pEStack_348 = (Entity *)0x0; LAB_00468dc8: pvStack_328 = (void *)0x0; if (charmSourceRef._entity != (void *)0x0) goto LAB_00468dd4; LAB_00468ded: charmSourceRef._flags = 0; } else { charmSourceRef._type = *(int *)((int)charmSourceRef._entity + 0x28); charmSourceRef._position.x = *(float *)((int)charmSourceRef._entity + 0x33c); charmSourceRef._position.y = *(float *)((int)charmSourceRef._entity + 0x340); charmSourceRef._variant = *(int *)((int)charmSourceRef._entity + 0x2c); charmSourceRef._spawnerType = *(int *)((int)charmSourceRef._entity + 0x34); charmSourceRef._spawnerVariant = *(int *)((int)charmSourceRef._entity + 0x38); charmSourceRef._velocity.x = *(float *)((int)charmSourceRef._entity + 0x360); charmSourceRef._velocity.y = *(float *)((int)charmSourceRef._entity + 0x364); fStack_1e8 = charmSourceRef._position.x; fStack_1e4 = charmSourceRef._position.y; fStack_1e0 = charmSourceRef._velocity.x; fStack_1dc = charmSourceRef._velocity.y; if ((*(uint *)((int)charmSourceRef._entity + 0x168) & 0x100) == 0) goto LAB_00468d9e; pEStack_348 = (Entity *)0x1; LAB_00468da8: if ((*(uint *)((int)charmSourceRef._entity + 0x168) & 0x20000000) == 0) goto LAB_00468dc8; pvStack_328 = (void *)0x2; LAB_00468dd4: if ((*(uint *)((int)charmSourceRef._entity + 0x16c) & 0x400000) == 0) goto LAB_00468ded; charmSourceRef._flags = 4; } charmSourceRef._flags = (uint)pEStack_348 | (uint)pvStack_328 | charmSourceRef._flags; Entity::AddCharmed(pEVar9,&charmSourceRef,-1,0,0); if (uStack_338 - 10 < 0x3de) { ANM2::LoadDeliriumForm(&pEVar9->_sprite,uStack_338,spawnVariant,1); } } uStack_338 = __RTDynamicCast(); pEStack_348 = (Entity *)__RTDynamicCast(); if ((uStack_338 != 0) && (pEStack_348 != (Entity *)0x0)) { bVar6 = Entity::HasEntityFlags(pEStack_348,1); if (bVar6 == 0) { bVar6 = Entity::HasEntityFlags((Entity *)spawner,0x100000000000000); if (bVar6 != 0) { brimstoneMarkSourceRef._type = 0; brimstoneMarkSourceRef._variant = 0; brimstoneMarkSourceRef._spawnerType = 0; brimstoneMarkSourceRef._spawnerVariant = 0; fStack_200 = g_vectorZero.x; fStack_1fc = g_vectorZero.y; brimstoneMarkSourceRef._position.x = g_vectorZero.x; brimstoneMarkSourceRef._position.y = g_vectorZero.y; fStack_1f8 = g_vectorZero.x; fStack_1f4 = g_vectorZero.y; brimstoneMarkSourceRef._velocity.x = g_vectorZero.x; brimstoneMarkSourceRef._velocity.y = g_vectorZero.y; brimstoneMarkSourceRef._flags = 0; brimstoneMarkSourceRef._entity = (void *)0x0; Entity::AddBrimstoneMark(pEStack_348,&brimstoneMarkSourceRef,0x5a); } bVar6 = Entity::HasEntityFlags((Entity *)spawner,0x1000000); bloodCloud = pEStack_348; if (bVar6 != 0) { shrinkSourceRef._type = 0; shrinkSourceRef._variant = 0; shrinkSourceRef._spawnerType = 0; shrinkSourceRef._spawnerVariant = 0; fStack_1f0 = g_vectorZero.x; fStack_1ec = g_vectorZero.y; shrinkSourceRef._position.x = g_vectorZero.x; shrinkSourceRef._position.y = g_vectorZero.y; fStack_2f8 = g_vectorZero.x; fStack_2f4 = g_vectorZero.y; shrinkSourceRef._velocity.x = g_vectorZero.x; shrinkSourceRef._velocity.y = g_vectorZero.y; shrinkSourceRef._flags = 0; shrinkSourceRef._entity = (void *)0x0; Entity::AddShrink(pEStack_348,&shrinkSourceRef,0x5a,0,0); if (0 < bloodCloud->_shrinkCountdown) { uVar2 = *(undefined4 *)((int)&bloodCloud->_flags + 4); *(uint *)&bloodCloud->_flags = (uint)bloodCloud->_flags | 0x1000000; *(undefined4 *)((int)&bloodCloud->_flags + 4) = uVar2; bloodCloud->_shrinkStatus1 = bloodCloud->_shrinkStatus2; } } } else { bloodCloud = pEStack_348; } fVar23 = *(float *)(uStack_338 + 0xf48) * bloodCloud[3]._pendingDamage; bloodCloud[3]._pendingDamage = fVar23; fVar23 = fVar23 * bloodCloud->_shrinkStatus1; fVar10 = fVar23 * g_vectorOne.x; (bloodCloud->_sprite)._scale.y = fVar23 * g_vectorOne.y; (bloodCloud->_sprite)._scale.x = fVar10; bloodCloud[3]._burnTickDamage = *(float *)(uStack_338 + 0xf48) * bloodCloud[3]._burnTickDamage ; bloodCloud[3]._poisonTickDamage = *(float *)(uStack_338 + 0xf44) * bloodCloud[3]._poisonTickDamage; bloodCloud->_maxHitPoints = *(float *)(uStack_338 + 0xf44) * bloodCloud->_maxHitPoints; pcVar3 = *(code **)(*(int *)bloodCloud + 0x4c); bloodCloud->_health = *(float *)(uStack_338 + 0xf44) * bloodCloud->_health; cVar7 = (*pcVar3)(); if (cVar7 != '\0') { ppvVar19 = &bloodCloud[3]._config; pvStack_328 = *(void **)(uStack_338 + 0xf54); if (*ppvVar19 != pvStack_328) { if (*ppvVar19 != (void *)0x0) { pEStack_320 = (Entity *)ppvVar19; std::multiset::erase(&pEStack_320); } *ppvVar19 = pvStack_328; if (pvStack_328 != (void *)0x0) { std::multiset::insert(ppvVar19); } } } } } bVar6 = Game::ShouldEraseEnemy(pEVar9); if (bVar6 != 0) { Entity::RemoveWithPoof(pEVar9,unusedArg); } if ((pEVar9->_exists != 0) && ((pGStack_324->_proceduralItemManager)._proceduralItems._begin != (pGStack_324->_proceduralItemManager)._proceduralItems._end)) { procItemKeyVariant = pEVar9->_variant; spawnTriggerTargets = &(pGStack_324->_proceduralItemManager)._spawnTriggerTargets; procItemKeyType = pEVar9->_type; std::map::find(&pfStack_32c,&procItemKeyType); if (pfStack_32c == spawnTriggerTargets->_head) { procItemKeyAnyVariant[0] = pEVar9->_type; procItemKeyAnyVariant[1] = 0xffffffff; piVar11 = (int *)std::map::find(&fStack_2f0,procItemKeyAnyVariant); pfStack_32c = (float *)*piVar11; if (pfStack_32c == spawnTriggerTargets->_head) goto LAB_004692a0; } playerManager = &g_game->_playerManager; pEStack_348 = (Entity *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar17 = (playerManager->_playerList)._end; if ((int)pvVar17 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar17 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (pEStack_348 < (Entity *)((int)pvVar17 - (int)piVar11 >> 2)) { piVar11 = piVar11 + (int)pEStack_348; } trigger_set_dispatch((void *)(*piVar11 + 0x1fc8),6,pEVar9,pVStack_334,&g_vectorZero); playerManager = &g_game->_playerManager; pEStack_348 = (Entity *)&pEStack_348->field_0x1; } while (pEStack_348 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_004692a0: timeNs = GetTimeNs(); pfStack_32c = (float *)(timeNs >> 0x20); lVar5 = (timeNs & 0xffffffff) * 0x431bde82; pEStack_320 = (Entity *)((ulonglong)lVar5 >> 0x20); pVStack_334 = (Vector *)(ZEXT48(pfStack_32c) * 0xd7b634db >> 0x20); lVar4 = ZEXT48(pfStack_32c) * 0x431bde82; timeNs = ZEXT48(pfStack_32c) * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar21 = (uint)(timeNs >> 0x20); lVar5 = lVar5 + (timeNs & 0xffffffff); fStack_2f8 = (float)lVar5; uVar16 = (uint)((ulonglong)lVar5 >> 0x20); lVar5 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar21,uVar16),uVar21 + uVar16); uVar21 = (uint)((ulonglong)lVar5 >> 0x20); puVar18 = (undefined1 *)((uint)lVar5 >> 0x12 | uVar21 * 0x4000); uVar16 = (int)puVar18 - (int)pEStack_310; bVar22 = CARRY4((uint)g_entitySpawnTimeMs,uVar16); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar16; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar21 >> 0x12) - (int)fStack_344) - (uint)(puVar18 < pEStack_310)) + (uint)bVar22; npc = (Entity_NPC *)selfNpc; } pIStack_31c = (ItemPool *)((ulonglong)lVar4 >> 0x20); pEStack_308 = (EntityPtr *)lVar4; in_stack_fffffc94._h._0_4_ = local_33c; in_stack_fffffc94._l = 0x46934a00000000; in_stack_fffffc94._h._4_4_ = (Vector *)0x0; piVar11 = (int *)__RTDynamicCast(); fVar10 = g_vectorOne.y * 2.0; piVar11[0x39] = (int)(g_vectorOne.x * 2.0); piVar11[0x3a] = (int)fVar10; (**(code **)(*piVar11 + 0xc))(); } } iVar8 = (int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0); *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; switch(*(int *)((int)npc + 0xb64)) { case 3: bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (((bVar6 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (uVar16 = Random(), uVar16 % 0x14 == 0)) { nextAttackStates[0] = 6; nextAttackStates[1] = 9; nextAttackStates[2] = 9; nextAttackStates[3] = 8; nextAttackStates[4] = 8; iVar12 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar8 = 0; if (0 < iVar12) { iVar8 = iVar12; } if (iVar8 < 4) { uVar16 = Random(); uVar21 = 5; } else { uVar16 = Random(); uVar21 = 3; } *(int *)((int)npc + 0xb64) = nextAttackStates[uVar16 % uVar21]; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc4) = 0; } break; case 4: ANM2::Play((ANM2 *)((int)npc + 0x48),&DAT_00b1cddc,0); bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Land); *(uint *)((int)npc + 0x188) = -(uint)(bVar6 != 0) & 4; bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Land); if ((bVar6 != 0) && (0 < iVar8)) { do { iVar12 = *(int *)((int)npc + 0x410) + 1; *(int *)((int)npc + 0x410) = iVar12; if ((*(int *)((int)npc + 0x2c) == 1) && (iVar12 < 0x18)) { uVar16 = Random(); fVar10 = (float)((double)(int)uVar16 + __uint_to_double_fixup[-((int)uVar16 >> 0x1f)]) * 2.3283064e-10 * 3.14; pVStack_334 = (Vector *)(fVar10 + fVar10); local_33c = (Entity *) ((float)*(int *)((int)npc + 0x410) + (float)*(int *)((int)npc + 0x410) + 50.0) ; fVar10 = cos((float)pVStack_334); effectSpawnPos.x = fVar10 * (float)local_33c + ((Vector *)((int)npc + 0x33c))->x; fVar10 = sin((float)pVStack_334); effectSpawnPos.y = fVar10 * (float)local_33c + *(float *)((int)npc + 0x340); uVar16 = Random(); Game::SpawnEx(g_game,1000,0x19,&effectSpawnPos,&g_vectorZero,(Entity *)npc,0,uVar16,0); piVar11 = (int *)__RTDynamicCast(); fVar23 = (float)*(int *)((int)npc + 0x410) * 0.05 + 1.0; fVar10 = fVar23 * g_vectorOne.x; piVar11[0x3a] = (int)(fVar23 * g_vectorOne.y); piVar11[0x39] = (int)fVar10; (**(code **)(*piVar11 + 0xc))(); } iVar8 = iVar8 + -1; } while (iVar8 != 0); } iVar8 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar8 == 0) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); fVar10 = *(float *)((int)npc + 0x338); ((Vector *)((int)npc + 0x33c))->x = (pEVar9->_pos).x; *(float *)((int)npc + 0x340) = fVar10; } break; case 6: bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Jump); iVar8 = 4; if (bVar6 != 0) { iVar8 = 0; } bVar6 = 0; *(int *)((int)npc + 0x188) = iVar8; animName = (char *)&DAT_00b1cde4; goto LAB_0046a02e; case 7: if (*(int *)((int)npc + 0xba4) < 1) { bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Jump); if ((bVar6 == 0) && (bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Land), bVar6 != 0)) { iVar8 = 4; } else { iVar8 = 0; } *(int *)((int)npc + 0x188) = iVar8; if (*(int *)((int)npc + 0xbc0) == 0) { iVar8 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar8 == 0) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); fVar10 = (pEVar9->_pos).y; ((Vector *)((int)npc + 0x33c))->x = (pEVar9->_pos).x; *(float *)((int)npc + 0x340) = fVar10; } } else { pVStack_334 = *(Vector **)((int)npc + 0xbc4); if (4 < (int)pVStack_334) { pVStack_334 = (Vector *)0x4; } if (((int)pVStack_334 / 2 == 0) || (animName = "StompLeg", *(int *)((int)npc + 0x2c) == 1)) { animName = "StompArm"; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)animName,0); *(byte *)((int)npc + 0x148) = ~(byte)pVStack_334 & 1; } break; } iVar8 = *(int *)((int)npc + 0xba4) - iVar8; *(int *)((int)npc + 0xba4) = iVar8; if (0 < iVar8) break; bVar6 = 1; animName = "StompArm"; LAB_0046a02e: ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)animName,bVar6); break; case 8: ANM2::Play((ANM2 *)((int)npc + 0x48),s_Attack1,0); bVar6 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),"Shoot"); if (bVar6 != 0) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); bloodCloudColor._offset[0] = 0.4; bloodCloudColor._colorize[0] = 0.0; bloodCloudColor._colorize[1] = 0.0; bloodCloudColor._colorize[2] = 0.0; bloodCloudColor._colorize[3] = 0.0; bloodCloudColor._tint[0] = 0.0; bloodCloudColor._tint[1] = 0.0; bloodCloudColor._tint[2] = 0.0; bloodCloudColor._tint[3] = 0.55; bloodCloudColor._offset[1] = 0.38; bloodCloudColor._offset[2] = 0.34; bloodCloud = Entity_NPC::MakeBloodCloud(npc,(Vector *)((int)npc + 0x33c),&bloodCloudColor); (bloodCloud->_posOffset).x = 0.0; (bloodCloud->_posOffset).y = -26.0; if (*(int *)((int)npc + 0x2c) == 0) { uVar16 = Random(); iVar8 = (uVar16 & 1) + 2; bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar6 != 0) { iVar12 = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused,(void *)0x0); if (3 - iVar12 <= iVar8) { iVar8 = 3 - iVar12; } } if (0 < iVar8) { pVVar14 = (Vector *)((int)npc + 0x33c); ppvVar19 = &g_game->_room; do { Room::FindFreePickupSpawnPosition(*ppvVar19,&spiderSpawnPos,pVVar14,100.0,0,0,0); uVar16 = Random(); Game::SpawnEx(g_game,0x55,0,&spiderSpawnPos,&g_vectorZero,(Entity *)npc,0,uVar16,0); iVar12 = __RTDynamicCast(); ppvVar19 = &g_game->_room; pvVar17 = *ppvVar19; fStack_344 = (float)(int)((spiderSpawnPos.x - 40.0) / 40.0 + 0.5); gridY = (int)((spiderSpawnPos.y - 120.0) / 40.0 + 0.5); if ((((-1 < (int)fStack_344) && (npc = (Entity_NPC *)selfNpc, (int)fStack_344 < *(int *)((int)pvVar17 + 0xc))) && (-1 < gridY)) && (((gridY < *(int *)((int)pvVar17 + 0x10) && (uVar16 = gridY * *(int *)((int)pvVar17 + 0xc) + (int)fStack_344, uVar16 < 0x1c0)) && (*(int *)((int)pvVar17 + uVar16 * 4 + 0x76c) < 0x3b7)))) { *(undefined4 *)((int)pvVar17 + uVar16 * 4 + 0x76c) = 900; } fVar10 = *(float *)(iVar12 + 0x33c); pVVar14 = (Vector *)((int)npc + 0x33c); *(float *)(iVar12 + 0x334) = fVar10; fVar23 = *(float *)(iVar12 + 0x340); *(float *)(iVar12 + 0x338) = fVar23; fVar24 = pVVar14->x; *(float *)(iVar12 + 0x33c) = fVar24; fVar1 = *(float *)((int)npc + 0x340); *(float *)(iVar12 + 0x340) = fVar1; *(undefined4 *)(iVar12 + 0xb64) = 6; *(undefined4 *)(iVar12 + 0xbbc) = 0xc1000000; fVar24 = (fVar10 - fVar24) * 0.04; fVar10 = (fVar23 - fVar1) * 0.04; *(float *)(iVar12 + 0x360) = fVar24; *(float *)(iVar12 + 0xbb0) = fVar24; *(float *)(iVar12 + 0x364) = fVar10; *(float *)(iVar12 + 0xbb4) = fVar10; *(float *)(iVar12 + 0x350) = *(float *)(iVar12 + 0x350) - 10.0; iVar8 = iVar8 + -1; pVStack_334 = (Vector *)ppvVar19; } while (iVar8 != 0); } } else { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar6 == 0) || (uVar16 = Entity::CountRelatedEntities((Entity *)npc,0x1d,1,unused_00,(void *)0x0), uVar16 < 3)) { uVar16 = Random(); Game::SpawnEx(g_game,0x1d,1,(Vector *)((int)npc + 0x33c),&g_vectorZero,(Entity *)npc,0, uVar16,0); pEVar9 = (Entity *)__RTDynamicCast(); pEStack_320 = pEVar9; bloodCloud = Entity_NPC::GetPlayerTarget(npc); fVar10 = (bloodCloud->_pos).y; pVStack_334 = (Vector *)&pEVar9->_sprite; (pEVar9->_targetPosition).x = (bloodCloud->_pos).x; (pEVar9->_targetPosition).y = fVar10; pEVar9[2]._posOffset.x = 5.60519e-45; *(undefined4 *)&pEVar9[1].field_0x4 = 5; bVar6 = ANM2::SetAnimation((ANM2 *)pVStack_334,&DAT_00b1de1c,1); pVVar14 = pVStack_334; if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)pVStack_334 + 0x30)); ((AnimationState *)((int)pVVar14 + 0x30))->_isPlaying = 1; pEVar9 = pEStack_320; } if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,5.0); } } } } break; case 9: ANM2::Play((ANM2 *)((int)npc + 0x48),s_Attack2,0); bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Jump); if ((bVar6 == 0) || (bVar6 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),s_Land), bVar6 != 0)) { iVar8 = 4; } else { iVar8 = 0; } *(int *)((int)npc + 0x188) = iVar8; if (*(int *)((int)npc + 0x410) == 0) { *(int *)((int)npc + 0x410) = 1; uStack_304 = (*(int *)((int)npc + 0x2c) != 1) + 3; pVStack_334 = (Vector *)Isaac::Random(uStack_304); iVar8 = 5; piVar11 = nextAttackStates + 5; do { piVar11[1] = 0; *piVar11 = 0; iVar8 = iVar8 + -1; piVar11 = piVar11 + 2; } while (iVar8 != 0); stompPositions[0] = ((Vector *)((int)npc + 0x33c))->x; pVStack_300 = (Vector *)((int)npc + 0x33c); stompPositions[1] = *(float *)((int)npc + 0x340); pfStack_32c = stompPositions + 2; pvStack_328 = (void *)0x0; fStack_344 = 2.24208e-44; do { pvVar17 = pvStack_328; scratchVec.y = 0.0; scratchVec.x = 0.0; pEStack_320 = Entity_NPC::GetPlayerTarget(npc); if (pVStack_334 == pvVar17) { pEStack_308 = (EntityPtr *)(pEStack_320->_pos).x; fStack_2fc = (pEStack_320->_pos).y; room = g_game->_room; pIStack_31c = (ItemPool *)(pEStack_320->_velocity).y; pEStack_320 = (Entity *)(pEStack_320->_velocity).x; uVar16 = Random(); auVar26._0_8_ = in_stack_fffffc94._l; auVar26._8_4_ = &targetLeadPos; auVar26._12_4_ = 0x41a00000; in_stack_fffffc94._h = auVar26._8_8_; in_stack_fffffc94._l._4_4_ = &freePosNearTarget; fVar10 = (float)((double)(int)uVar16 + __uint_to_double_fixup[-((int)uVar16 >> 0x1f)]) * 2.3283064e-10 * 20.0; targetLeadPos.y = fVar10 * (float)pIStack_31c + fStack_2fc; targetLeadPos.x = fVar10 * (float)pEStack_320 + (float)pEStack_308; in_stack_fffffc94._l._0_4_ = 0x469a18; pVVar14 = Room::FindFreePickupSpawnPosition (room,&freePosNearTarget,&targetLeadPos,20.0,0,0,0); uVar16 = Random(); pEStack_348 = (Entity *) ((float)((double)(int)uVar16 + __uint_to_double_fixup[-((int)uVar16 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0); uVar16 = Random(); scratchVec.y = (float)pEStack_348 + pVVar14->y; scratchVec.x = ((float)((double)(int)uVar16 + __uint_to_double_fixup[-((int)uVar16 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) + pVVar14->x; } else { uVar16 = Random(); local_33c = (Entity *)0x5; do { if ((uVar16 & 3) == 0) { room = g_game->_room; uVar21 = Random(); targetPos.x = (pEStack_320->_pos).x; targetPos.y = (pEStack_320->_pos).y; auVar27._0_8_ = in_stack_fffffc94._l; auVar27._8_4_ = &targetPos; auVar27._12_4_ = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 100.0 + 80.0; pVVar14 = &freePosNearTargetFar; } else { room = g_game->_room; uVar21 = Random(); pVVar14 = &freePosNearSelf; auVar27._0_8_ = in_stack_fffffc94._l; auVar27._8_4_ = pVStack_300; auVar27._12_4_ = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 400.0; } in_stack_fffffc94._h = auVar27._8_8_; in_stack_fffffc94._l._4_4_ = pVVar14; in_stack_fffffc94._l._0_4_ = 0x469b95; pVVar14 = Room::FindFreePickupSpawnPosition (room,pVVar14,auVar27._8_4_,auVar27._12_4_,1,0,0); uVar21 = Random(); pEStack_348 = (Entity *) ((float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0); uVar21 = Random(); scratchVec.y = (float)pEStack_348 + pVVar14->y; local_33c = (Entity *)((int)local_33c + -1); scratchVec.x = ((float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) + pVVar14->x; } while (local_33c != (Entity *)0x0); local_33c = (Entity *)0x0; npc = (Entity_NPC *)selfNpc; } *pfStack_32c = scratchVec.x; pfStack_32c[1] = scratchVec.y; pfStack_32c = pfStack_32c + 2; uVar16 = Random(); auVar28._0_8_ = in_stack_fffffc94._l; auVar28._8_4_ = &g_vectorZero; auVar28._12_4_ = npc; auVar29._8_8_ = auVar28._8_8_; auVar29._4_4_ = &scratchVec; auVar29._0_4_ = *(int *)((int)npc + 0x2c); pEVar9 = Game::SpawnEx(g_game,0x65,*(int *)((int)npc + 0x2c),&scratchVec,&g_vectorZero, (Entity *)npc,0,uVar16,0); uVar2 = *(undefined4 *)((int)&pEVar9->_flags + 4); *(uint *)&pEVar9->_flags = (uint)pEVar9->_flags | 0x80000000; *(undefined4 *)((int)&pEVar9->_flags + 4) = uVar2; *(undefined4 *)&pEVar9[2].field_0x3a8 = 1; pEVar9[2]._posOffset.x = 9.80909e-45; fVar10 = *(float *)((int)npc + 0xbc4); *(int *)((int)npc + 0xbc4) = (int)fVar10 + 1; pEVar9[2]._slowingAmount = fVar10; pEVar9[2]._prevPosition.x = fStack_344; bVar6 = ANM2::SetAnimation(&pEVar9->_sprite,(byte *)"StompArm",1); uVar25 = auVar29._0_8_; if ((bVar6 != 0) && ((pEVar9->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,0.0); uVar25 = auVar29._0_8_; if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { (pEVar9->_sprite)._animState._isPlaying = 0; } } pEVar9->_entityCollisionClass = 0; fStack_2ec = -g_vectorOne.y; fStack_2f0 = -g_vectorOne.x; fVar10 = *(float *)((int)*(void **)((int)npc + 0x330) + 0x38) * 0.5; in_stack_fffffc94._h._0_4_ = (Entity *)0x469d4b; in_stack_fffffc94._l = uVar25; in_stack_fffffc94._h._4_4_ = (Vector *)fVar10; Entity::SetSize(pEVar9,fVar10, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); fStack_344 = (float)((int)fStack_344 + 10); pvStack_328 = (void *)((int)pvStack_328 + 1); } while ((int)pvStack_328 < (int)uStack_304); } } if ((0.0 < *(float *)((int)npc + 0x14)) && (puVar15 = ((std_vector *)((int)npc + 8))->_begin, puVar15 != *(void **)((int)npc + 0xc))) { do { if (puVar15[4] == 0x65) { *puVar15 = 0; } puVar15 = puVar15 + 0xe; } while (puVar15 != *(void **)((int)npc + 0xc)); } if ((*(byte *)((int)npc + 0x173) != 0) && (*(int *)((int)npc + 0xbc0) == 0)) { pvVar17 = g_game->_room; *(undefined4 *)((int)pvVar17 + 0x7214) = 0x1e; *(undefined4 *)((int)pvVar17 + 0x7218) = 7; } return; } //@@ 0046a0f0 NpcAI::ENTITY_LARRYJR /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 19 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_LARRYJR(Entity_NPC *npc) { Room *pRVar1; EntityPtr EVar2; code *pcVar3; undefined4 uVar4; EntityPtr *pEVar5; byte bVar6; uint uVar7; Entity_NPC *pEVar8; EntityPtr EVar9; char *walkAnimName; Vector *pVVar10; LayerState *layer; EntityRef *pEVar11; byte *directionAnimName; void *pvVar12; Entity *pEVar13; int iVar14; float *pfVar15; EntityPtr EVar16; code *extraout_EDX; undefined1 *puVar17; float fVar18; float fVar19; float fVar20; float fVar21; Room *pRVar22; uint uVar23; uint variant; int iVar24; EntityRef sourceRef; byte isClampedToRoom; Vector local_100; Vector local_f8; Vector local_f0; EntityPtr local_e4; ProjectileParams projectileParams; EntityList_EL local_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = -NAN; puStack_18 = &LAB_00af280a; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)((&projectileParams)[1].Color._tint + 3); ExceptionList = &local_1c; local_100.y = (float)npc; local_24 = uVar7; if ((npc->_type == 0x13) && ((npc->_variant == 2 || (npc->_variant == 3)))) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); ENTITY_TUFF_TWINS(npc); ExceptionList = local_1c; return; } puVar17 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_controllerID != -1) && (puVar17 = (undefined1 *)((int)register0x00000010 + -4), npc->_parent != (EntityPtr)0x0)) { pEVar8 = (Entity_NPC *)Entity::GetLastParent((Entity *)npc); puVar17 = puStack_20; if ((pEVar8 != (Entity_NPC *)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (pEVar8->_type == 1)) || (pEVar8->_type - 10U < 0x3de)))) { Entity_NPC::TransferControl(npc,pEVar8); puVar17 = puStack_20; } } puStack_20 = puVar17; if (npc->_dead != 0) { if (npc->_type == 0x13) { if (((npc->_parent == (EntityPtr)0x0) && (EVar9 = npc->_child, EVar9 != (EntityPtr)0x0)) && ((0.0 < *(float *)((int)EVar9 + 0x380) && (npc->_subtype != 2)))) { fVar18 = *(float *)((int)EVar9 + 0x380) + 25.0; if (*(float *)((int)EVar9 + 900) <= fVar18) { fVar18 = *(float *)((int)EVar9 + 900); } *(float *)((int)EVar9 + 0x380) = fVar18; } } else if ((npc->_type == 0xef) && (npc->_i2 == 0)) { local_34._data = (void *)0x0; local_34._capacity = 0; local_34._size = 0; local_14 = 0.0; std::vector::_Emplace_reallocate(0,&npc->_pos); npc->_i2 = 1; pfVar15 = (float *)local_34._capacity; local_f8.y = (float)npc; while( true ) { if ((*(EntityPtr *)((int)npc + 0x3c0) != (EntityPtr)0x0) && (iVar24 = __RTDynamicCast(*(EntityPtr *)((int)npc + 0x3c0),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar7) , iVar24 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } npc = *(Entity_NPC **)((int)npc + 0x3c0); if ((EntityPtr)npc == (EntityPtr)0x0) break; if (pfVar15 == (float *)local_34._size) { std::vector::_Emplace_reallocate(pfVar15,(float *)((int)npc + 0x33c)); } else { fVar18 = *(float *)((int)npc + 0x340); *pfVar15 = *(float *)((int)npc + 0x33c); pfVar15[1] = fVar18; local_34._capacity = (int)(pfVar15 + 2); } pfVar15 = (float *)local_34._capacity; *(int *)((int)npc + 0xbc4) = 1; 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; (**(code **)(*(int *)npc + 0x24))(&sourceRef); } EVar9 = (EntityPtr)local_100.y; while( true ) { if ((*(EntityPtr *)((int)EVar9 + 0x3bc) != (EntityPtr)0x0) && (iVar24 = __RTDynamicCast(*(EntityPtr *)((int)EVar9 + 0x3bc),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar24 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } npc = (Entity_NPC *)local_100.y; EVar9 = *(EntityPtr *)((int)EVar9 + 0x3bc); if (EVar9 == (EntityPtr)0x0) break; if (pfVar15 == (float *)local_34._size) { std::vector::_Emplace_reallocate(pfVar15,(float *)((int)EVar9 + 0x33c)); } else { fVar18 = *(float *)((int)EVar9 + 0x340); *pfVar15 = *(float *)((int)EVar9 + 0x33c); pfVar15[1] = fVar18; local_34._capacity = (int)(pfVar15 + 2); } pfVar15 = (float *)local_34._capacity; *(float *)((int)EVar9 + 0xbc4) = 1.4013e-45; 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; (**(code **)((int)*(float *)EVar9 + 0x24))(&sourceRef); } puVar17 = (undefined1 *)((int)pfVar15 - (int)local_34._data >> 3); local_f8.y = (float)(puVar17 + -1); if (0 < (int)local_f8.y) { EVar9 = (EntityPtr)local_34._data; local_e4 = (EntityPtr)puVar17; do { EVar16 = (EntityPtr)0x0; if (local_e4 != (EntityPtr)0x0) { uVar7 = Random(); EVar16 = (EntityPtr)(uVar7 % (uint)local_e4); EVar9 = (EntityPtr)local_34._data; } fVar18 = *(float *)((int)EVar9 + (int)local_f8.y * 8); fVar19 = ((float *)((int)EVar9 + 4))[(int)local_f8.y * 2]; *(float *)((int)EVar9 + (int)local_f8.y * 8) = *(float *)((int)EVar9 + (int)EVar16 * 8); ((float *)((int)EVar9 + 4))[(int)local_f8.y * 2] = ((float *)((int)EVar9 + 4))[(int)EVar16 * 2]; local_f8.y = (float)((int)local_f8.y + -1); *(float *)((int)EVar9 + (int)EVar16 * 8) = fVar18; ((float *)((int)EVar9 + 4))[(int)EVar16 * 2] = fVar19; local_e4 = (EntityPtr)((int)local_e4 + -1); local_100.y = (float)EVar16; } while (0 < (int)local_f8.y); } uVar7 = Random(); local_f0.y = (float)((uVar7 & 3) + 2); local_f8.y = 0.0; if (puVar17 != (undefined1 *)0x0) { local_100.y = 4.2039e-45; local_e4 = (EntityPtr)local_34._data; do { if ((uint)local_f0.y <= (uint)local_f8.y) break; pRVar22 = g_game->_room; iVar14 = (int)((*(float *)local_e4 - 40.0) / 40.0 + 0.5); iVar24 = (int)((*(float *)((int)local_e4 + 4) - 120.0) / 40.0 + 0.5); if ((((iVar14 < 0) || (pRVar22->_gridWidth <= iVar14)) || (iVar24 < 0)) || (pRVar22->_gridHeight <= iVar24)) { iVar14 = -1; } else { iVar14 = iVar24 * pRVar22->_gridWidth + iVar14; } uVar7 = Room::GetGridCollision(pRVar22,iVar14); if (uVar7 == 0) { uVar7 = Random(); uVar7 = uVar7 % (uint)local_100.y; pEVar8 = (Entity_NPC *)0x0; if (uVar7 == 0) { uVar7 = Random(); uVar23 = 0x17; LAB_0046a616: pEVar8 = (Entity_NPC *) Game::Spawn(g_game,uVar23,0,(Vector *)local_e4,&g_vectorZero,(Entity *)npc,0, uVar7); } else { if (uVar7 == 1) { uVar7 = Random(); uVar23 = 0x1f; goto LAB_0046a616; } if (uVar7 == 2) { uVar7 = Random(); uVar23 = 0x15; goto LAB_0046a616; } } if ((*(int *)((int)npc + 0xf1c) != -1) && (pEVar8 != (Entity_NPC *)0x0)) { Entity_NPC::TransferControl(npc,pEVar8); } } local_f8.y = (float)((int)local_f8.y + 1); local_e4 = (EntityPtr)((int)local_e4 + 8); } while ((uint)local_f8.y < puVar17); } *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) & 0xfffbffff; local_14 = -NAN; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); if ((EntityPtr)local_34._data != (EntityPtr)0x0) { uVar7 = local_34._size - (int)local_34._data & 0xfffffff8; EVar9 = (EntityPtr)local_34._data; if (0xfff < uVar7) { EVar9 = *(EntityPtr *)((int)local_34._data + -4); uVar7 = uVar7 + 0x23; if ((undefined *)0x1f < (undefined *)((int)local_34._data + (-4 - (int)EVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar9,uVar7); } } if (*(undefined1 **)((int)npc + 0x28) != &DAT_00000013) goto LAB_0046a80b; if ((*(int *)((int)npc + 0x2c) == 0) && (*(int *)((int)npc + 0x3bc) == 0)) { DAT_00c7e844 = DAT_00c7e844 + 1; if ((DAT_00c7e844 & 1) == 0) { iVar24 = 999; } else { iVar24 = 1000; } Entity_NPC::PlaySound(npc,iVar24,1.0,2,0,1.0); } if ((*(undefined1 **)((int)npc + 0x28) != &DAT_00000013) || (*(int *)((int)npc + 0x2c) != 1)) goto LAB_0046a80b; iVar24 = *(int *)((int)npc + 0x30); pVVar10 = (Vector *)((int)npc + 0x33c); if (iVar24 == 1) { local_f0.x = pVVar10->x; local_f0.y = *(float *)((int)npc + 0x340); iVar24 = Room::GetGridCollisionAtPos(g_game->_room,*pVVar10); if (iVar24 == 0) goto LAB_0046a775; } else { if (iVar24 == 1) { LAB_0046a775: uVar7 = Random(); variant = 0; uVar23 = 0x17; } else if (iVar24 == 2) { uVar7 = Random(); variant = 0; uVar23 = 0x19; } else { if (iVar24 != 3) goto LAB_0046a793; uVar7 = Random(); variant = 0x14; uVar23 = 5; } Game::Spawn(g_game,uVar23,variant,pVVar10,&g_vectorZero,(Entity *)npc,0,uVar7); } LAB_0046a793: if (*(int *)((int)npc + 0x3bc) == 0) { DAT_00c7e840 = DAT_00c7e840 + 1; if ((DAT_00c7e840 & 1) == 0) { iVar24 = 0x3eb; } else { iVar24 = 0x3ec; } Entity_NPC::PlaySound(npc,iVar24,1.0,2,0,1.0); } LAB_0046a80b: if (((*(int *)((int)npc + 0xf1c) != -1) && (*(int *)((int)npc + 0x28) != 0xef)) && (((pEVar8 = *(Entity_NPC **)((int)npc + 0x3c0), 1 < *(int *)&g_game->_deathmatchManager && (pEVar8->_type == 1)) || (pEVar8->_type - 10U < 0x3de)))) { Entity_NPC::TransferControl(npc,pEVar8); } ExceptionList = local_1c; return; } if (npc->_state == 0) { npc->_i1 = 0; npc->_i2 = 0; npc->_stateFrame = 0; if ((npc->_type != 0x13) || (npc->_variant != 1)) { npc->_entityGridCollisionClass = 5; } game = g_game; npc->_entityCollisionClass = 4; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),&local_34,npc->_type,-1,-1,0,0); local_14 = 1.4013e-45; EVar9 = npc->_parent; if (EVar9 == (EntityPtr)0x0) { if ((*(int *)(npc + 1) == 0) && (local_f8.y = (float)(local_34._size + -1), -1 < (int)local_f8.y)) { do { EVar9 = (EntityPtr) __RTDynamicCast(*(float *)((int)local_34._data + (int)local_f8.y * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (((EVar9 != (EntityPtr)0x0) && (((EVar9 != (EntityPtr)npc && (*(EntityPtr *)((int)EVar9 + 0x3bc) != (EntityPtr)npc)) && (*(EntityPtr *)((int)EVar9 + 0x3c0) == (EntityPtr)0x0)))) && (fVar18 = *(float *)((int)EVar9 + 0x340) - (npc->_pos).y, fVar19 = ((Vector *)((int)EVar9 + 0x33c))->x - (npc->_pos).x, fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19), fVar18 < 42.0)) { EVar16 = EVar9; do { if (EVar16 == (EntityPtr)npc) goto LAB_0046a9d1; EVar16 = *(EntityPtr *)((int)EVar16 + 0x3bc); } while ((EVar16 != (EntityPtr)0x0) && (EVar16 != EVar9)); if (npc->_parent != (EntityPtr)0x0) { local_f0.y = (float)&npc->_parent; std::multiset::erase(&local_f0.y); } npc->_parent = EVar9; std::multiset::insert(&npc->_parent); } LAB_0046a9d1: local_f8.y = (float)&((Room *)((int)local_f8.y + -0x7898))->field_0x7897; } while (-1 < (int)local_f8.y); EVar9 = npc->_parent; if (EVar9 != (EntityPtr)0x0) goto LAB_0046a9fa; } walkAnimName = "WalkHeadDown"; if (npc->_type == 0x59) { walkAnimName = "WalkDown"; } ANM2::Play(&npc->_sprite,(byte *)walkAnimName,0); for (local_f8.y = *(float *)&npc->_child; (EntityPtr)local_f8.y != (EntityPtr)0x0; local_f8.y = *(float *)((int)local_f8.y + 0x3c0)) { iVar24 = npc->_index; iVar14 = __RTDynamicCast(local_f8.y,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); *(int *)(iVar14 + 0xc7c) = iVar24; } npc->_groupIdx = npc->_index; local_f8.y = 0.0; } else { LAB_0046a9fa: local_f8.y = (float)((int)EVar9 + 0x3c0); if (*(int *)((int)EVar9 + 0x3c0) != 0) { local_f0.y = local_f8.y; std::multiset::erase(&local_f0.y); } *(Entity_NPC **)local_f8.y = npc; std::multiset::insert(local_f8.y); walkAnimName = "WalkBodyHori"; if (npc->_type == 0x59) { walkAnimName = "WalkHori"; } ANM2::Play(&npc->_sprite,(byte *)walkAnimName,0); if (npc->_type == 0xef) { EVar9 = npc->_child; if (EVar9 == (EntityPtr)0x0) { local_f0.y = 0.0; } else { local_f0.y = *(float *)((int)EVar9 + 0x380); } EVar16 = npc->_parent; local_f8.y = (float)*(Room **)((int)EVar16 + 0x380); pVVar10 = &local_f0; if (local_f0.y <= (float)*(Room **)((int)EVar16 + 0x380)) { pVVar10 = &local_f8; } fVar18 = *(float *)((int)npc->_config + 0x50) + pVVar10->y; npc->_health = fVar18; npc->_maxHitPoints = fVar18; if (EVar16 != (EntityPtr)0x0) { do { *(float *)((int)EVar16 + 0x380) = npc->_health; *(float *)((int)EVar16 + 900) = npc->_health; EVar16 = *(EntityPtr *)((int)EVar16 + 0x3bc); } while (EVar16 != (EntityPtr)0x0); EVar9 = npc->_child; } for (; EVar9 != (EntityPtr)0x0; EVar9 = *(EntityPtr *)((int)EVar9 + 0x3c0)) { *(float *)((int)EVar9 + 0x380) = npc->_health; *(float *)((int)EVar9 + 900) = npc->_health; } } } std::deque::push_back(&npc->_vectorDeque1,&npc->_pos); std::deque::push_back(&npc->_vectorDeque2,&npc->_velocity); npc->_state = 4; if (local_34._0_1_ == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,local_34._data,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_state != 4) { ExceptionList = local_1c; return; } iVar24 = npc->_type; if (iVar24 == 0x13) { if (npc->_subtype == 2) { npc->_friction = npc->_friction * 0.96; } bVar6 = Entity::IsFrame((Entity *)npc,10,npc->_index); if (bVar6 != 0) { uVar23 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.3); iVar24 = npc->_type; } } if (npc->_parent != (EntityPtr)0x0) { if ((iVar24 == 0x13) && (npc->_subtype == 2)) { pEVar8 = Entity_NPC::ParentNPC(npc); fVar18 = npc->_health; if (1.0 < ABS(fVar18 - pEVar8->_health)) { local_f0.y = (*(float *)((int)npc->_parent + 0x380) - fVar18) * 0.5; npc->_health = local_f0.y + fVar18; pEVar8 = Entity_NPC::ParentNPC(npc); pEVar8->_health = pEVar8->_health - local_f0.y; } } pEVar8 = Entity_NPC::ParentNPC(npc); if (1 < (int)(pEVar8->_vectorDeque1)._size) { pEVar8 = Entity_NPC::ParentNPC(npc); local_f0.x = (pEVar8->_pos).x - (npc->_pos).x; local_f0.y = (pEVar8->_pos).y - (npc->_pos).y; if ((npc->_variant == 1) && ((local_f0.x != g_vectorZero.x || (local_f0.y != g_vectorZero.y))) ) { if (local_f0.x < 0.0 == local_f0.y < 0.0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = 15.0; } else { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = -15.0; } if ((npc->_sprite)._flipX != 0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = layer->_rotation * -1.0; } } local_34._0_4_ = "WalkBodyHori"; local_34._data = "WalkBodyUp"; local_34._capacity = 0xb1e080; local_34._size = 0xb1e0ac; if ((npc->_child == (EntityPtr)0x0) && (local_34._data = &DAT_00b1e0d4, npc->_type == 0xef)) { local_34._data = "WalkBodyUp"; } iVar24 = vector_to_direction(&local_f0); if (npc->_type == 0x59) { directionAnimName = (&PTR_s_WalkHori_00b1dc6c)[iVar24]; } else { directionAnimName = *(byte **)(&local_34.field_0x0 + iVar24 * 4); } ANM2::Play(&npc->_sprite,directionAnimName,0); (npc->_sprite)._flipX = iVar24 == 0; pEVar8 = (Entity_NPC *)Entity::GetLastParent((Entity *)npc); if ((pEVar8 == (Entity_NPC *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (pEVar8->_type != 1)) && (0x3dd < pEVar8->_type - 10U)))) { pEVar8 = (Entity_NPC *)0x0; } fVar18 = (npc->_v1).x; if (0.0 < fVar18) { local_f0.y = fVar18 - npc->_speedMultiplier; local_f8.y = 0.0; pVVar10 = &local_f0; if (local_f0.y <= 0.0) { pVVar10 = &local_f8; } (npc->_v1).x = pVVar10->y; } if (((npc->_type == 0x13) && (npc->_child == (EntityPtr)0x0)) && (npc->_subtype != 2)) { if ((pEVar8 == (Entity_NPC *)0x0) || (pEVar8->_controllerID == -1)) { if ((*(int *)((int)g_game->_room + 8) == 0xb) || ((uVar7 = Random(), uVar7 % 100 != 0 && ((npc->_pendingDamage <= 0.0 || (uVar7 = Random(), uVar7 % 0x14 != 0)))))) goto LAB_0046bfa5; } else { bVar6 = Entity_NPC::IsControllerActionPressed(pEVar8,8); if ((bVar6 == 0) || (0.0 < (npc->_v1).x)) goto LAB_0046bfa5; } bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar6 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { local_f0.y = (float)g_game->_room; pvVar12 = (void *)Room::GetGridIndex((Room *)local_f0.y,&npc->_pos); if (((void *)0x1bf < pvVar12) || ((((((void **)((int)local_f0.y + 0x24))[(int)pvVar12] == (void *)0x0 || (iVar24 = *(int *)((int)((void **)((int)local_f0.y + 0x24))[(int)pvVar12] + 4), iVar24 == 0xe)) || (iVar24 == 1)) || (iVar24 == 10)))) { local_100.y = (float)pvVar12; Entity_NPC::PlaySound(npc,0x3de,1.0,2,0,1.0); local_e4 = (EntityPtr)g_game->_room; local_f0.y = (float)RNG::Next(&npc->_dropRNG); if (((-1 < (int)pvVar12) && ((int)pvVar12 < 0x1c0)) || ((KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"), -1 < (int)pvVar12 && ((int)pvVar12 < 0x1c0)))) { if ((int)((float *)((int)local_e4 + 0x76c))[(int)pvVar12] < 0x385) { pRVar22 = operator_new(0x19c); local_14 = 1.54143e-44; local_f8.y = (float)pRVar22; if (pRVar22 == (Room *)0x0) { pRVar22 = (Room *)0x0; } else { GridEntity::GridEntity((GridEntity *)pRVar22); *(undefined ***)pRVar22 = IsaacRepentancePlus::GridEntity_Poop::vftable; pRVar22->_gridEntities[0x4d] = (void *)0x0; pRVar22->_gridEntities[0x51] = (void *)0x0; pRVar22->_gridEntities[0x52] = &DAT_0000000f; *(undefined1 *)(pRVar22->_gridEntities + 0x4d) = 0; EntityRef::EntityRef((EntityRef *)(pRVar22->_gridEntities + 0x54)); } local_14 = -NAN; if (pRVar22 != (Room *)0x0) { pRVar22->_descriptor = &DAT_0000000e; pRVar22->_gridEntities[0] = (void *)local_100.y; if ((undefined4 *)((int *)((int)local_e4 + 0x24))[(int)local_100.y] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)((int *)((int)local_e4 + 0x24))[(int)local_100.y])(1) ; } ((int *)((int)local_e4 + 0x24))[(int)local_100.y] = (int)pRVar22; pRVar22->_roomType = 0; (pRVar22->_topLeftPos).y = 0.0; GridEntity::Init((GridEntity *)pRVar22,(uint)local_f0.y); } pvVar12 = (void *)local_100.y; } iVar24 = *(int *)((int)g_game->_room + (int)pvVar12 * 4 + 0x24); if ((iVar24 != 0) && (*(int *)(iVar24 + 4) == 0xe)) { iVar24 = __RTDynamicCast(iVar24,0,&IsaacRepentancePlus::GridEntity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Poop::RTTI_Type_Descriptor ,0); *(undefined4 *)(iVar24 + 0x18) = 1; (npc->_v1).x = 30.0; } } } } } } goto LAB_0046bfa5; } if (iVar24 == 0x13) { if (npc->_variant == 0) { if ((npc->_child != (EntityPtr)0x0) && (uVar23 = Random(), uVar23 % 0x78 != 0)) { iVar24 = 0x3e9; goto LAB_0046ad2d; } } else if (((npc->_variant == 1) && (npc->_child != (EntityPtr)0x0)) && (uVar23 = Random(), uVar23 % 0x78 != 0)) { iVar24 = 0x3ed; LAB_0046ad2d: Entity_NPC::PlaySound(npc,iVar24,1.0,0x78,0,1.0); } } else if ((iVar24 == 0x59) && (uVar23 = Random(), uVar23 % 0x78 != 0)) { iVar24 = 0x43d; goto LAB_0046ad2d; } if (npc->_type == 0xef) { EVar16 = (EntityPtr)(npc->_health - npc->_pendingDamage); EVar9 = (EntityPtr)npc; while( true ) { EVar2 = *(EntityPtr *)((int)EVar9 + 0x3c0); local_e4 = EVar16; if ((EVar2 != (EntityPtr)0x0) && (iVar24 = __RTDynamicCast(EVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar7), iVar24 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } EVar9 = *(EntityPtr *)((int)EVar9 + 0x3c0); if (EVar9 == (EntityPtr)0x0) break; EVar16 = (EntityPtr)(*(float *)((int)EVar9 + 0x380) - *(float *)((int)EVar9 + 0x14)); if ((float)local_e4 <= (float)EVar16) { EVar16 = local_e4; } } local_100.y = (float)npc; do { if ((float)local_e4 < *(float *)((int)local_100.y + 0x380) - *(float *)((int)local_100.y + 0x14)) { pcVar3 = *(code **)((int)*(float *)local_100.y + 0x20); EVar9 = local_e4; EntityRef::constructor(&sourceRef,(Entity *)npc); (*pcVar3)(*(float *)((int)local_100.y + 0x380) - (float)EVar9,0,0,&sourceRef,0x1e); } pEVar5 = (EntityPtr *)((int)local_100.y + 0x3c0); EVar9 = *pEVar5; if ((EVar9 != (EntityPtr)0x0) && (iVar24 = __RTDynamicCast(EVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar24 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } local_100.y = *(float *)pEVar5; } while ((Entity_NPC *)local_100.y != (Entity_NPC *)0x0); } iVar24 = npc->_projectileCooldown; if (iVar24 < 0x1f) { if (npc->_variant == 0) { if (npc->_type == 0xef) goto LAB_0046b3bb; LAB_0046b4ae: PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,2.0,0); if ((npc->_type == 0xef) && (bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar6 == 0)) { if (npc->_stateFrame < 0x33) { npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } else { pEVar13 = Entity_NPC::GetPlayerTarget(npc); local_100.y = (pEVar13->_pos).x; local_e4 = (EntityPtr)(pEVar13->_pos).y; pEVar13 = Entity_NPC::GetPlayerTarget(npc); local_f0.y = (pEVar13->_velocity).x; local_f8.y = (pEVar13->_velocity).y; uVar7 = Random(); fVar18 = (npc->_pos).x; fVar19 = (npc->_pos).y; fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar21 = fVar20 * local_f0.y; local_f0.y = (fVar20 * local_f8.y * 16.0 + (float)local_e4) - fVar19; local_f0.x = (fVar21 * 16.0 + local_100.y) - fVar18; if (npc->_controllerID == -1) { if ((ABS(local_f0.y) < 20.0) || (ABS(local_f0.x) < 20.0)) { local_f8.x = fVar18 + local_f0.x; local_f8.y = fVar19 + local_f0.y; bVar6 = Room::CheckLine(g_game->_room,&npc->_pos,&local_f8,0,0,0,0,(Vector *)0x0); goto LAB_0046b668; } } else { bVar6 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar6 != 0) { pVVar10 = Entity_NPC::GetControllerInput(npc,&local_100,0.1); bVar6 = Vector::operator_ne(pVVar10,&g_vectorZero); LAB_0046b668: if (bVar6 != 0) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); if (npc->_controllerID != -1) { pVVar10 = Entity_NPC::GetControllerInput(npc,&local_f8,0.0); local_f0.x = pVVar10->x; local_f0.y = pVVar10->y; } pVVar10 = Vector::ToCardinal(&local_f8,&local_f0); (npc->_targetPosition).x = pVVar10->x; (npc->_targetPosition).y = pVVar10->y; npc->_stateFrame = 0; npc->_i1 = 1; (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; } } } } } } else if (npc->_type == 0xef) { LAB_0046b3bb: if (npc->_i1 == 0) goto LAB_0046b4ae; if ((npc->_collidesWithGrid == 0) && (bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar6 == 0)) { fVar18 = npc->_friction * 0.9; npc->_friction = fVar18; if (npc->_controllerID == -1) { fVar19 = 3.7; } else { fVar19 = 5.55; } if (fVar18 != 0.0) { fVar20 = (fVar19 * (npc->_targetPosition).y * npc->_speedMultiplier) / fVar18; (npc->_velocity).x = (fVar19 * (npc->_targetPosition).x * npc->_speedMultiplier) / fVar18 + (npc->_velocity).x; goto LAB_0046b46a; } } else { npc->_i1 = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } } else { fVar18 = (npc->_velocity).y; fVar19 = (npc->_velocity).x; if (fVar19 * fVar19 + fVar18 * fVar18 < 0.16000001) { pVVar10 = MusicManager::RandomVector(&local_f0); fVar18 = npc->_friction; fVar19 = pVVar10->y; if (fVar18 != 0.0) { fVar20 = npc->_speedMultiplier; (npc->_velocity).x = (pVVar10->x * 0.1 * fVar20) / fVar18 + (npc->_velocity).x; (npc->_velocity).y = (fVar19 * 0.1 * fVar20) / fVar18 + (npc->_velocity).y; } } fVar18 = (npc->_velocity).y; if (fVar18 <= 0.0) { local_100.y = (float)&DAT_bf800000; } else { local_100.y = 1.0; } fVar19 = (npc->_velocity).x; if (fVar19 <= 0.0) { local_e4 = (EntityPtr)&DAT_bf800000; } else { local_e4 = (EntityPtr)0x3f800000; } if ((ABS(fVar19) < ABS(fVar18)) || (fVar18 <= 0.0)) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = 0.0; } else { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = 15.0; } game = g_game; EVar9 = (EntityPtr)0x3f800000; npc->_friction = npc->_friction * 0.85; pvVar12 = game->_room; local_f0.y = *(float *)((int)pvVar12 + 0x20) - 10.0; fVar18 = *(float *)((int)pvVar12 + 0x14) + 1.0; pRVar22 = (Room *)(*(float *)((int)pvVar12 + 0x18) + 20.0); fVar19 = *(float *)((int)pvVar12 + 0x1c) - 1.0; if (*(int *)((int)pvVar12 + 0x1bb0) == 0x37) { pRVar22 = (Room *)0x43a00000; } fVar20 = (npc->_pos).x; pVVar10 = &npc->_pos; pRVar1 = (Room *)(npc->_pos).y; if (fVar20 <= fVar18) { fVar20 = fVar18; } local_f8.y = (npc->_pos).y; if ((float)pRVar1 <= (float)pRVar22) { pRVar1 = pRVar22; } local_f8.x = pVVar10->x; if (fVar19 <= fVar20) { fVar20 = fVar19; } if (local_f0.y <= (float)pRVar1) { pRVar1 = (Room *)local_f0.y; } pVVar10->x = fVar20; (npc->_pos).y = (float)pRVar1; isClampedToRoom = Vector::operator_ne(&local_f8,pVVar10); if (isClampedToRoom != 0) { fVar21 = (npc->_velocity).x; if (((fVar20 == fVar18) && (fVar21 < 0.0)) || ((fVar20 == fVar19 && (0.0 < fVar21)))) { fVar21 = -fVar21; (npc->_velocity).x = fVar21; } fVar18 = (npc->_pos).y; fVar19 = (npc->_velocity).y; if (((fVar18 == (float)pRVar22) && (fVar19 < 0.0)) || ((fVar18 == local_f0.y && (0.0 < fVar19)))) { fVar19 = -fVar19; (npc->_velocity).y = fVar19; } if (fVar21 <= 0.0) { local_e4 = (EntityPtr)&DAT_bf800000; } else { local_e4 = EVar9; } if (fVar19 <= 0.0) { EVar9 = (EntityPtr)&DAT_bf800000; } local_100.y = (float)EVar9; } bVar6 = Vector::operator_eq(&npc->_v1,&g_vectorZero); if ((bVar6 != 0) || ((isClampedToRoom != 0 && (uVar7 = Random(), uVar7 % 10 == 0)))) { uVar7 = Random(); if ((uVar7 & 1) == 0) { fVar18 = 3.0; local_f8.x = 3.0; local_f8.y = 1.6; } else { fVar18 = 1.8; local_f0.x = 1.8; local_f0.y = 3.0; } (npc->_v1).x = fVar18; pVVar10 = &local_f0; if ((uVar7 & 1) == 0) { pVVar10 = &local_f8; } (npc->_v1).y = pVVar10->y; } if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { fVar18 = npc->_friction; fVar19 = (npc->_v1).y; if (fVar18 != 0.0) { fVar20 = npc->_speedMultiplier; (npc->_velocity).x = ((float)local_e4 * (npc->_v1).x * fVar20) / fVar18 + (npc->_velocity).x; (npc->_velocity).y = (local_100.y * fVar19 * fVar20) / fVar18 + (npc->_velocity).y; } bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if ((bVar6 != 0) && (npc->_controllerID == -1)) { pEVar13 = Entity_NPC::GetPlayerTarget(npc); local_f0.y = -((pEVar13->_pos).y - (npc->_pos).y); local_f0.x = -((pEVar13->_pos).x - (npc->_pos).x); fVar18 = sqrtf(local_f0.y * local_f0.y + local_f0.x * local_f0.x); fVar18 = (160.0 - fVar18) * 0.03; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (2.0 <= fVar18) { fVar18 = 2.0; } pVVar10 = Vector::Resized(&local_f0,&local_f8,fVar18); fVar18 = npc->_friction; if (fVar18 != 0.0) { fVar20 = (npc->_speedMultiplier * pVVar10->y) / fVar18; (npc->_velocity).x = (npc->_speedMultiplier * pVVar10->x) / fVar18 + (npc->_velocity).x; LAB_0046b46a: (npc->_velocity).y = fVar20 + (npc->_velocity).y; } } } else { npc->_friction = 0.95; PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); } } if ((npc->_type == 0x13) && (npc->_subtype == 1)) { if (npc->_controllerID == -1) { uVar7 = Random(); bVar6 = uVar7 % 3 == 0; } else { bVar6 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if (bVar6 != 0) { iVar24 = npc->_projectileCooldown; if (0 < iVar24) goto LAB_0046b893; Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); if (npc->_controllerID == -1) { uVar7 = Random(); iVar24 = uVar7 % 0x14 + 0x28; } else { iVar24 = 0x28; } npc->_projectileCooldown = iVar24; ProjectileParams::ProjectileParams(&projectileParams); projectileParams.FallingAccelModifier = 0.3; if (npc->_variant == 0) { projectileParams.FallingSpeedModifier = -5.0; pVVar10 = Vector::Normalized(&npc->_velocity,&local_f8); local_f0.x = pVVar10->x; fVar18 = pVVar10->y; uVar7 = 0; } else { pVVar10 = Vector::Normalized(&npc->_velocity,&local_f8); local_f0.x = pVVar10->x; fVar18 = pVVar10->y; uVar7 = 2; } local_f0.y = fVar18 * 7.5; local_f0.x = local_f0.x * 7.5; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_f0,uVar7,&projectileParams); } } } else { LAB_0046b893: npc->_projectileCooldown = iVar24 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } iVar14 = Entity::get_velocity_direction((Entity *)npc); iVar24 = npc->_type; if ((iVar24 == 0x13) || (iVar24 == 0xef)) { local_34._0_4_ = "WalkHeadHori"; local_34._data = "WalkHeadUp"; local_34._capacity = 0xb1e09c; local_34._size = 0xb1e070; if ((iVar24 == 0xef) && (npc->_i1 != 0)) { directionAnimName = (&PTR_s_AttackHeadHori_00b1dc7c)[iVar14]; } else { directionAnimName = *(byte **)(&local_34.field_0x0 + iVar14 * 4); } LAB_0046b911: ANM2::Play(&npc->_sprite,directionAnimName,0); (npc->_sprite)._flipX = iVar14 == 0; } else if (iVar24 == 0x59) { directionAnimName = (&PTR_s_WalkHori_00b1dc6c)[iVar14]; goto LAB_0046b911; } if ((npc->_type == 0x13) && ((npc->_child == (EntityPtr)0x0 || (*(char *)((int)npc->_child + 0x173) != '\0')))) { pEVar11 = EntityRef::EntityRef(&sourceRef); (*extraout_EDX)(pEVar11); Entity_NPC::QueryNPCsGroup((EntityList *)&local_34,npc->_groupIdx); pfVar15 = (float *)0x0; if ((float *)local_34._size != (float *)0x0) { do { if (*(char *)((int)*(float *)((int)local_34._data + (int)pfVar15 * 4) + 0x173) == '\0') goto LAB_0046b9af; pfVar15 = (float *)((int)pfVar15 + 1); } while (pfVar15 < (uint)local_34._size); if (((float *)local_34._size != (float *)0x0) && (*(Entity_NPC **)local_34._data == npc)) { uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; } } LAB_0046b9af: if (local_34._0_1_ == '\0') { local_14 = 4.2039e-45; tracked_alloc(1,local_34._data,0); local_14 = -NAN; } } local_f0.y = (npc->_velocity).x; local_f8.y = (npc->_velocity).y; fVar18 = sqrtf(local_f0.y * local_f0.y + local_f8.y * local_f8.y); game = g_game; if (0.0 < fVar18) { local_f0.y = (npc->_velocity).x * (1.0 / fVar18); local_f8.y = (npc->_velocity).y * (1.0 / fVar18); } local_f8.x = local_f0.y * 40.0 + (npc->_pos).x; local_f0.y = (float)g_game->_room; local_f8.y = local_f8.y * 40.0 + (npc->_pos).y; EntityRef::constructor(&sourceRef,(Entity *)npc); uVar7 = Room::GetGridIndex(game->_room,&local_f8); if ((uVar7 < 0x1c0) && (((void **)((int)local_f0.y + 0x24))[uVar7] != (int *)0x0)) { (**(code **)(*(int *)((void **)((int)local_f0.y + 0x24))[uVar7] + 0x10))(1,&sourceRef); } LAB_0046bfa5: if (npc->_variant == 1) { local_100.y = 18.0; } else { local_100.y = 24.0; } if ((npc->_subtype == 2) && (npc->_type == 0x13)) { local_100.y = local_100.y + 12.0; } else if (npc->_type == 0x59) { local_100.y = 18.0; } pEVar13 = Entity::GetLastParent((Entity *)npc); if (((pEVar13 == (Entity *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (iVar24 = 1, pEVar13->_type != 1)) && (iVar24 = pEVar13->_type, 0x3dd < iVar24 - 10U)))) || ((iVar24 != 0xef || (*(int *)&pEVar13[2].field_0x3a8 == 0)))) { fVar18 = 20.0; } else { fVar18 = 40.0; } Entity_NPC::FollowParentSegment(npc,1,local_100.y,fVar18); npc->_friction = npc->_friction * 0.8; ExceptionList = local_1c; return; } //@@ 0046c0a0 NpcAI::ENTITY_MONSTRO /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 20 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MONSTRO(Entity_NPC *npc) { Game *pGVar1; Vector pos; Vector pos_00; byte bVar2; uint uVar3; byte *animNameChar; Entity *tmpEntity; uint rngValue; ColorMod *tmpColor; ProjectileParams *params; Entity_Effect *effect; Entity_Laser *laser; Entity_Projectile *projectile; int gridIndex; undefined4 uVar4; Vector *pVVar5; Vector *direction; int *spawnedEffect; Room *unused; int unused_00; int unused_01; int unused_02; int unused_03; int unused_04; int unused_05; int unused_06; int unused_07; int extraout_ECX; int extraout_ECX_00; Room *extraout_ECX_01; Room *extraout_ECX_02; Room *extraout_ECX_03; Room *extraout_ECX_04; char *expectedChar; int unused_08; int unused_09; int unused_10; int iVar6; int iVar7; undefined1 *puVar8; bool bVar9; float fVar10; Room *pRVar11; float fVar12; float fVar13; TypeDescriptor *pTVar14; TypeDescriptor *pTVar15; undefined4 uVar16; undefined1 local_234 [32]; undefined4 local_214; undefined4 uStack_210; undefined4 local_20c; void *local_208; float local_204; EntityList_EL local_1fc; Vector local_1ec; Vector local_1e4; float fireInputX; float fireInputY; Vector local_1d4; byte isLandTriggered; float moveInputX; Room *local_1c4; int controllerId; Room *local_1bc; Vector local_1b8; Vector local_1b0; byte isEventTriggered; char isJumpPressed; char isGish; Room *local_1a4; ProjectileParams defaultParams; ProjectileParams projectileParams; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; float *animFrame; Manager *manager; void **shockwaveCounter; float speedMultiplier; ANM2 *sprite; code *takeDamageFn; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af2850; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; if ((npc->_type != 0x2b) || (isGish = '\x01', npc->_variant != 1)) { isGish = '\0'; } npc->_friction = npc->_friction * 0.9; local_1a4 = (Room *)0x0; Entity_NPC::CalcTargetPosition(npc,&local_1d4,0.0); iVar6 = npc->_controllerID; local_1c4 = local_1a4; local_1b0.y = (float)local_1a4; moveInputX = (float)local_1a4; local_1b0.x = (float)local_1a4; fireInputY = (float)local_1a4; fireInputX = (float)local_1a4; controllerId = iVar6; if (iVar6 == -1) { local_1bc = (Room *)local_1d4.y; isJumpPressed = isLandTriggered; pRVar11 = unused; } else { fVar10 = InputManager::GetActionValue(0,iVar6,(Entity *)npc,(int)unused); moveInputX = (float)local_1a4 - fVar10; if (npc->_controllerID == -1) { moveInputX = moveInputX + (float)local_1a4; local_1c4 = local_1a4; local_1b0.x = moveInputX; LAB_0046c323: local_1c4 = (Room *)((float)local_1c4 + (float)local_1a4); local_1ec.y = (float)local_1a4 + (float)local_1a4; fireInputY = (float)local_1a4; fireInputX = local_1ec.y; local_1bc = local_1c4; local_1b0.y = (float)local_1c4; LAB_0046c3c0: local_1b8.y = -NAN; pRVar11 = local_1a4; } else { fVar10 = InputManager::GetActionValue(1,npc->_controllerID,(Entity *)npc,unused_00); moveInputX = moveInputX + fVar10; local_1b0.x = moveInputX; if (npc->_controllerID == -1) { local_1c4 = local_1a4; goto LAB_0046c323; } fVar10 = InputManager::GetActionValue(2,npc->_controllerID,(Entity *)npc,unused_01); local_1c4 = (Room *)((float)local_1a4 - fVar10); if (npc->_controllerID == -1) goto LAB_0046c323; fVar10 = InputManager::GetActionValue(3,npc->_controllerID,(Entity *)npc,unused_02); local_1c4 = (Room *)((float)local_1c4 + fVar10); local_1bc = local_1c4; local_1b0.y = (float)local_1c4; if (npc->_controllerID == -1) { local_1ec.y = (float)local_1a4 + (float)local_1a4; fireInputY = (float)local_1a4; fireInputX = local_1ec.y; goto LAB_0046c3c0; } fVar10 = InputManager::GetActionValue(4,npc->_controllerID,(Entity *)npc,unused_03); fireInputX = (float)local_1a4 - fVar10; if (npc->_controllerID == -1) { local_1ec.y = fireInputX + (float)local_1a4; fireInputY = (float)local_1a4; fireInputX = local_1ec.y; goto LAB_0046c3c0; } local_1ec.y = InputManager::GetActionValue(5,npc->_controllerID,(Entity *)npc,unused_04); local_1ec.y = fireInputX + local_1ec.y; fireInputX = local_1ec.y; if (npc->_controllerID == -1) { fireInputY = (float)local_1a4; goto LAB_0046c3c0; } fVar10 = InputManager::GetActionValue(6,npc->_controllerID,(Entity *)npc,unused_05); fireInputY = (float)local_1a4 - fVar10; if (npc->_controllerID == -1) goto LAB_0046c3c0; pRVar11 = (Room *)InputManager::GetActionValue(7,npc->_controllerID,(Entity *)npc,unused_06); local_1b8.y = (float)npc->_controllerID; } fireInputY = (float)pRVar11 + fireInputY; fVar10 = sqrtf((float)local_1bc * (float)local_1bc + moveInputX * moveInputX); if ((1.0 < fVar10) && ((float)local_1a4 < fVar10)) { moveInputX = (1.0 / fVar10) * moveInputX; local_1c4 = (Room *)((float)local_1bc * (1.0 / fVar10)); local_1b0.x = moveInputX; local_1b0.y = (float)local_1c4; } fVar10 = sqrtf(fireInputY * fireInputY + local_1ec.y * local_1ec.y); if ((1.0 < fVar10) && ((float)local_1a4 < fVar10)) { fireInputX = local_1ec.y * (1.0 / fVar10); fireInputY = fireInputY * (1.0 / fVar10); } iVar7 = unused_07; if ((Room *)local_1b8.y == (Room *)0xffffffff) { LAB_0046c4cc: if (npc->_controllerID != -1) { bVar2 = input_is_action_pressed(8,npc->_controllerID,(Entity *)npc,iVar7); iVar7 = extraout_ECX_00; if (bVar2 != 0) goto LAB_0046c512; } if ((npc->_controllerID != -1) && (bVar2 = input_is_action_pressed(10,npc->_controllerID,(Entity *)npc,iVar7), bVar2 != 0)) goto LAB_0046c512; bVar2 = Entity_NPC::IsControllerActionPressed(npc,0xb); isJumpPressed = '\0'; if (bVar2 != 0) goto LAB_0046c512; } else { bVar2 = input_is_action_pressed(9,(int)local_1b8.y,(Entity *)npc,unused_07); iVar7 = extraout_ECX; if (bVar2 == 0) goto LAB_0046c4cc; LAB_0046c512: isJumpPressed = '\x01'; } fVar10 = sqrtf((float)local_1c4 * (float)local_1c4 + moveInputX * moveInputX); if (0.5 < fVar10) { (npc->_v1).x = moveInputX; (npc->_v1).y = (float)local_1c4; } fVar10 = sqrtf(fireInputY * fireInputY + fireInputX * fireInputX); if (0.5 < fVar10) { (npc->_v2).x = fireInputX; (npc->_v2).y = fireInputY; } fVar10 = npc->_size; local_1d4.x = (npc->_v1).x * 250.0 + (npc->_pos).x; local_1d4.y = (npc->_v1).y * 250.0 + (npc->_pos).y; Room::GetClampedPositionImpl(g_game->_room,&local_1e4,&local_1d4,fVar10,fVar10,fVar10,fVar10); local_1d4.x = local_1e4.x; local_1bc = (Room *)local_1e4.y; pRVar11 = extraout_ECX_01; } local_1ec.y = local_1d4.x; local_1d4.y = (float)local_1bc; if ((((npc->_type == 0x2b) && (npc->_variant == 0)) && ((npc->_state == 7 || (npc->_state == 4)))) && ((npc->_sprite)._animState._animData != (void *)0x0)) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); pRVar11 = extraout_ECX_02; if (bVar2 != 0) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&local_1fc,&npc->_pos,70.0,8); local_14 = 0; local_1b8.y = 0.0; puVar8 = (undefined1 *)local_1fc._size; if ((undefined1 *)local_1fc._size != (undefined1 *)0x0) { do { local_1e4.y = *(float *)((int)local_1fc._data + (int)local_1b8.y * 4); if ((((Room *)local_1e4.y)->_gridEntities[1] == (void *)0x3d) && (((Room *)local_1e4.y)->_gridEntities[2] == (void *)0x0)) { takeDamageFn = *(code **)(*(int *)local_1e4.y + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); (*takeDamageFn)(0x41f00000,0,0,local_50 + 4,0x1e); puVar8 = (undefined1 *)local_1fc._size; } local_1b8.y = (float)&((Room *)local_1b8.y)->field_0x1; } while ((uint)local_1b8.y < puVar8); iVar6 = controllerId; } local_14 = 0xffffffff; pRVar11 = (Room *)local_1b8.y; if (local_1fc._0_1_ == '\0') { local_14 = 1; tracked_alloc(1,local_1fc._data,0); local_14 = 0xffffffff; pRVar11 = extraout_ECX_03; } } } iVar7 = npc->_state; if (iVar7 != 0) { if (iVar7 != 3) { if (iVar7 == 8) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { if (npc->_type == 0x14) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); if (iVar6 == -1) { params = ProjectileParams::ProjectileParams(&projectileParams); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1b0.x = (tmpEntity->_pos).x; local_1b0.y = (tmpEntity->_pos).y; } else { (npc->_sprite)._flipX = (float)local_1a4 <= (npc->_v2).x; params = ProjectileParams::ProjectileParams(&projectileParams); local_1b0.x = (npc->_v2).x * 100.0 + (npc->_pos).x; local_1b0.y = (npc->_v2).y * 100.0 + (npc->_pos).y; } Entity_NPC::FireBossProjectiles(npc,0xd,&local_1b0,0.0,params); tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); effect = Entity_NPC::MakeBloodCloud(npc,&npc->_pos,tmpColor); (effect->_posOffset).x = 0.0; (effect->_posOffset).y = -29.0; } else if (npc->_type == 0x2b) { if (npc->_variant == 0) { local_1b0.x = 0.0; local_1b0.y = -20.0; if (iVar6 == -1) { if ((npc->_sprite)._flipX == 0) { pRVar11 = (Room *)0x43340000; } else { pRVar11 = local_1a4; } } else { fVar10 = (npc->_v2).x; (npc->_sprite)._flipX = (float)local_1a4 <= fVar10; fVar10 = atan2f((npc->_v2).y,fVar10); pRVar11 = (Room *)(fVar10 * 57.295776); } laser = Entity_Laser::ShootAngle (1,&npc->_pos,(float)pRVar11,0x1e,&local_1b0,(Entity *)npc,0); laser->_renderDepthOffset = 3000.0; (**(code **)(*(int *)laser + 0xc))(); } else { if (iVar6 == -1) { params = ProjectileParams::ProjectileParams(&defaultParams); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1b0.x = (tmpEntity->_pos).x; local_1b0.y = (tmpEntity->_pos).y; } else { (npc->_sprite)._flipX = (float)local_1a4 <= (npc->_v2).x; params = ProjectileParams::ProjectileParams(&projectileParams); local_1b0.x = (npc->_v2).x * 70.0 + (npc->_pos).x; local_1b0.y = (npc->_v2).y * 70.0 + (npc->_pos).y; } projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_1b0,10.0,params); fVar10 = projectile->_fallingAccel; uVar4 = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 10; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = uVar4; projectile->_fallingAccel = fVar10 - 0.3; projectile->_scale = 1.6; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 13.0; (**(code **)(*(int *)projectile + 0x3c))(&DAT_00c34e54,0xffffffff,0xff,0,1); manager = g_manager; local_1b8.y = 1.31442e-42; seed_fart_sound_override((int *)&local_1b8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_1b8.y,1.0,2,0,1.0,0.0); } } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } npc->_state = 3; ExceptionList = local_1c; return; } if (iVar7 == 4) { if ((iVar6 == -1) || ((((npc->_sprite)._animState._animData != (void *)0x0 && (animFrame = &(npc->_sprite)._animState._animFrame, 4.0 < *animFrame || *animFrame == 4.0)) || (isJumpPressed == '\0')))) { if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { local_1b8.y = (float)g_game->_room; pos.y = local_1d4.y; pos.x = local_1d4.x; iVar7 = Room::GetGridCollisionAtPos((Room *)local_1b8.y,pos); if (iVar7 == 0) { gridIndex = Room::GetGridIndex((Room *)local_1b8.y,&local_1d4); iVar7 = *(int *)((int)local_1b8.y + 0xc); (npc->_targetPosition).x = (float)(gridIndex % iVar7) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(gridIndex / iVar7) * 40.0 + 120.0; } if (iVar6 != -1) { (npc->_targetPosition).x = local_1ec.y; (npc->_targetPosition).y = (float)local_1bc; } } if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { sprite = &npc->_sprite; isEventTriggered = ANM2::WasEventTriggered(sprite,s_Jump); isLandTriggered = ANM2::WasEventTriggered(sprite,s_Land); if ((isEventTriggered == 0) || (isLandTriggered != 0)) { iVar6 = 5; iVar7 = 4; } else { iVar6 = 3; iVar7 = 0; } npc->_entityCollisionClass = iVar7; npc->_entityGridCollisionClass = iVar6; bVar2 = Sprite::IsEventTriggered((Sprite *)sprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,0.5,2,0,1.0); uVar3 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x10,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar3); uVar3 = Random(); (effect->_sprite)._offset.x = 0.0; (effect->_sprite)._flipX = ~(byte)uVar3 & 1; (effect->_sprite)._offset.y = 15.0; uVar4 = Color::Color(0x3f333333); (**(code **)(*(int *)effect + 0x3c))(uVar4,0xffffffff,0xff,0,1); Entity_Effect::FollowParent(effect,(Entity *)npc); (**(code **)(*(int *)effect + 0xc))(); } if (isLandTriggered == 0) { local_1b8.y = (npc->_targetPosition).y - (npc->_pos).y; local_1bc = (Room *)((npc->_targetPosition).x - (npc->_pos).x); local_1e4.y = sqrtf(local_1b8.y * local_1b8.y + (float)local_1bc * (float)local_1bc); if ((controllerId != -1) && (isEventTriggered != 0)) { pVVar5 = Vector::Normalized(&npc->_velocity,&local_1b0); fVar10 = (float)local_1c4 * pVVar5->y + moveInputX * pVVar5->x; if (fVar10 < (float)local_1a4) { fVar10 = fVar10 * (float)local_1a4; } fVar10 = ABS(fVar10 * fVar10 * fVar10) * 0.6 + 0.4; bVar2 = Vector::operator_eq(&npc->_velocity,&g_vectorZero); if (bVar2 != 0) { fVar10 = 1.0; } local_1b8.y = fVar10 * (float)local_1c4 * local_1e4.y; local_1bc = (Room *)(fVar10 * moveInputX * local_1e4.y); } if (local_1e4.y == (float)local_1a4) { local_1e4.y = 0.001; } fVar10 = 1.2 / local_1e4.y; if ((npc->_type == 0x2b) && (npc->_subtype == 1)) { fVar10 = fVar10 * 1.5; } fVar12 = npc->_friction; if (fVar12 == (float)local_1a4) { fVar13 = (npc->_velocity).x; } else { speedMultiplier = npc->_speedMultiplier; fVar13 = ((float)local_1bc * fVar10 * speedMultiplier) / fVar12 + (npc->_velocity).x ; (npc->_velocity).x = fVar13; (npc->_velocity).y = (local_1b8.y * fVar10 * speedMultiplier) / fVar12 + (npc->_velocity).y; fVar12 = npc->_friction; } npc->_friction = fVar12 * 0.9; (npc->_sprite)._flipX = (float)local_1a4 < fVar13; ExceptionList = local_1c; return; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; if (controllerId == -1) { uVar3 = Random(); if ((uVar3 & 1) != 0) goto LAB_0046d72e; } else { fVar10 = sqrtf((float)local_1c4 * (float)local_1c4 + moveInputX * moveInputX); if ((0.5 <= fVar10) && (isJumpPressed == '\0')) { LAB_0046d72e: Entity_NPC::PlaySound(npc,0xe,0.4,2,0,1.0); bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } manager = g_manager; if (isGish == '\0') { ExceptionList = local_1c; return; } local_1b8.y = 1.31162e-42; seed_fart_sound_override((int *)&local_1b8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_1b8.y,1.0,2,0,1.0,0.0); ExceptionList = local_1c; return; } } (npc->_sprite)._playbackSpeed = 1.0; npc->_state = 3; ExceptionList = local_1c; return; } } npc->_friction = npc->_friction * 0.8; ExceptionList = local_1c; return; } npc->_state = 6; Entity_NPC::PlaySound(npc,0xe,1.0,2,0,1.0); bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e0e4,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_0046d208; } if (iVar7 == 6) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump); if (bVar2 == 0) { ExceptionList = local_1c; return; } npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; npc->_state = 7; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; goto LAB_0046d83f; } if (iVar7 != 7) { ExceptionList = local_1c; return; } bVar2 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero); if (bVar2 != 0) { local_1d4.x = local_1ec.y; local_1d4.y = (float)local_1bc; if (npc->_i1 == 2) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1e4.x = (tmpEntity->_velocity).x; local_1e4.y = (tmpEntity->_velocity).y; pVVar5 = Vector::Normalized(&local_1e4,&local_1b8); fVar10 = tmpEntity->_size + npc->_size + 5.0; local_1d4.x = -pVVar5->x * fVar10 + local_1ec.y; local_1d4.y = -pVVar5->y * fVar10 + (float)local_1bc; } local_1b8.y = (float)g_game->_room; pos_00.y = local_1d4.y; pos_00.x = local_1d4.x; iVar6 = Room::GetGridCollisionAtPos((Room *)local_1b8.y,pos_00); if (iVar6 == 0) { iVar7 = Room::GetGridIndex((Room *)local_1b8.y,&local_1d4); iVar6 = *(int *)((int)local_1b8.y + 0xc); fVar10 = (float)(iVar7 % iVar6) * 40.0 + 40.0; (npc->_targetPosition).x = fVar10; (npc->_targetPosition).y = (float)(iVar7 / iVar6) * 40.0 + 120.0; if (npc->_i1 == 2) { (npc->_pos).x = fVar10; (npc->_pos).y = (npc->_targetPosition).y; } } } pVVar5 = &npc->_targetPosition; isEventTriggered = ANM2::WasEventTriggered(&npc->_sprite,s_Land); bVar2 = Vector::operator_ne(pVVar5,&g_vectorZero); if ((bVar2 == 0) || (isEventTriggered != 0)) { npc->_friction = npc->_friction * 0.8; } else { npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; if (controllerId == -1) { local_1e4.y = pVVar5->x - (npc->_pos).x; local_1b8.y = (npc->_targetPosition).y - (npc->_pos).y; local_1b0.x = local_1e4.y; local_1b0.y = local_1b8.y; direction = Vector::Normalized(&local_1b0,&local_1d4); fVar10 = npc->_friction; if (fVar10 != (float)local_1a4) { fVar12 = (npc->_speedMultiplier * (local_1b8.y * 0.006 + direction->y * 0.3)) / fVar10; fVar10 = (npc->_speedMultiplier * (local_1e4.y * 0.006 + direction->x * 0.3)) / fVar10; goto LAB_0046dbc2; } } else { direction = Vector::Normalized(&npc->_velocity,&local_1d4); local_1c4 = (Room *)(ABS((float)local_1c4 * direction->y + moveInputX * direction->x) * 1.1999999 + 0.1); bVar2 = Vector::operator_eq(&npc->_velocity,&g_vectorZero); if (bVar2 != 0) { local_1c4 = (Room *)0x3fa66666; } direction = Vector::Normalized(&local_1b0,&local_1d4); fVar10 = npc->_friction; if (fVar10 != (float)local_1a4) { fVar12 = (npc->_speedMultiplier * (float)local_1c4 * direction->y) / fVar10; fVar10 = (npc->_speedMultiplier * (float)local_1c4 * direction->x) / fVar10; LAB_0046dbc2: (npc->_velocity).x = fVar10 + (npc->_velocity).x; (npc->_velocity).y = fVar12 + (npc->_velocity).y; } } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { if (isEventTriggered == 0) { ExceptionList = local_1c; return; } npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); ShockwaveParams::ShockwaveParams(&local_208); local_208 = (void *)(npc->_pos).x; local_204 = (npc->_pos).y; pGVar1 = g_game->_room; local_1fc._size = 10; local_1fc._data = (void *)0x3ccccccd; local_1fc._0_4_ = 0x3d0f5c29; shockwaveCounter = &pGVar1->_roomList[0x9d].Data; *shockwaveCounter = (void *)((int)*shockwaveCounter + 1); uVar3 = (uint)pGVar1->_roomList[0x9d].Data & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(pGVar1,uVar3,&local_208); Color::Color((Color *)local_50); if ((npc->_type == 0x2b) && (npc->_variant == 1)) { local_50._0_4_ = 3.0; local_50._4_4_ = 3.0; fStack_48 = 3.0; local_40 = 0.03; fStack_3c = 0.03; fStack_38 = 0.03; fStack_34 = 1.0; } else { local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; } fStack_44 = 1.0; Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,(ColorMod *)local_50,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) { ExceptionList = local_1c; return; } if (npc->_type == 0x14) { params = ProjectileParams::ProjectileParams(&defaultParams); Entity_NPC::FireBossProjectiles(npc,0x12,&g_vectorZero,0.0,params); ExceptionList = local_1c; return; } if (npc->_type != 0x2b) { ExceptionList = local_1c; return; } if (npc->_i1 == 0) { if (npc->_variant == 1) { uVar3 = Random(); uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar4 = 0; tmpEntity = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3) ; spawnedEffect = (int *)__RTDynamicCast(tmpEntity,uVar4,pTVar14,pTVar15,uVar16); if (spawnedEffect[0xef] != 0) { local_1e4.y = (float)(spawnedEffect + 0xef); std::multiset::erase(&local_1e4.y); } spawnedEffect[0xef] = (int)npc; std::multiset::insert(spawnedEffect + 0xef); fVar12 = g_vectorOne.x * 3.0; fVar10 = g_vectorOne.y * 3.0; spawnedEffect[0x117] = 0; spawnedEffect[0x39] = (int)fVar12; spawnedEffect[0x118] = 0; spawnedEffect[0x3a] = (int)fVar10; (**(code **)(*spawnedEffect + 0xc))(); ExceptionList = local_1c; return; } if (npc->_variant == 0) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Scale = 1.4; local_1b0.x = 10.0; local_1b0.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_1b0,8,&projectileParams); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_i1 != 1) { ExceptionList = local_1c; return; } if (npc->_variant == 1) { iVar6 = Room::GetAliveEnemiesCount(g_game->_room); if (2 < iVar6) { ExceptionList = local_1c; return; } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar2 != 0) && (uVar3 = Entity::CountRelatedEntities((Entity *)npc,0xf,1,unused_08,(void *)0x0), 2 < uVar3)) { ExceptionList = local_1c; return; } local_1b0.x = 5.0; local_1b0.y = 0.0; uVar3 = Random(); uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar4 = 0; tmpEntity = Game::Spawn(g_game,0xf,1,&npc->_pos,&local_1b0,(Entity *)npc,0,uVar3); iVar6 = __RTDynamicCast(tmpEntity,uVar4,pTVar14,pTVar15,uVar16); pGVar1 = g_game; *(float *)(iVar6 + 0x380) = *(float *)(iVar6 + 0x380) - 5.0; iVar6 = Room::GetAliveEnemiesCount(pGVar1->_room); if ((iVar6 < 3) && ((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar2 == 0 || (uVar3 = Entity::CountRelatedEntities((Entity *)npc,0xf,1,unused_09,(void *)0x0), uVar3 < 3)))) { Entity_NPC::PlaySound(npc,0x109,1.5,2,0,1.0); uVar3 = Random(); uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar4 = 0; local_1b0.x = -5.0; local_1b0.y = -0.0; tmpEntity = Game::Spawn(g_game,0xf,1,&npc->_pos,&local_1b0,(Entity *)npc,0,uVar3); iVar6 = __RTDynamicCast(tmpEntity,uVar4,pTVar14,pTVar15,uVar16); *(float *)(iVar6 + 0x380) = *(float *)(iVar6 + 0x380) - 5.0; ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); ExceptionList = local_1c; return; } if (npc->_variant != 0) { ExceptionList = local_1c; return; } iVar6 = Room::GetAliveEnemiesCount(g_game->_room); if (4 < iVar6) { ExceptionList = local_1c; return; } puVar8 = &DAT_00000004; local_1bc = (Room *)&DAT_00000004; if ((npc->_type == 0x2b) && (npc->_subtype == 1)) { fVar10 = 1.0; puVar8 = (undefined1 *)0x2; local_1bc = (Room *)0x2; } else { fVar10 = 1.5; } Entity_NPC::PlaySound(npc,0x109,fVar10,2,0,1.0); bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x3d,0,unused_10,(void *)0x0); if (4 - iVar6 <= (int)puVar8) { puVar8 = (undefined1 *)(4 - iVar6); } local_1bc = (Room *)puVar8; } if ((int)puVar8 < 1) { ExceptionList = local_1c; return; } local_1b8.y = (float)&DAT_00c5c59c; do { uVar3 = Random(); rngValue = Random(); fVar10 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1e4.y = fVar10 + fVar10; fVar10 = cos(local_1e4.y); local_1ec.x = fVar10 * npc->_size + (npc->_pos).x; fVar12 = sin(local_1e4.y); fVar10 = local_1b8.y; uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_1ec.y = fVar12 * npc->_size + (npc->_pos).y; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar4 = 0; tmpEntity = Game::Spawn(g_game,0x3d,0,&local_1ec,(Vector *)local_1b8.y,(Entity *)npc,0, uVar3); iVar6 = __RTDynamicCast(tmpEntity,uVar4,pTVar14,pTVar15,uVar16); local_1b8.y = (float)((int)fVar10 + 8); local_1bc = (Room *)((int)local_1bc + -1); *(undefined1 *)(iVar6 + 0x174) = 1; } while (local_1bc != (Room *)0x0); ExceptionList = local_1c; return; } pVVar5->x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; uVar3 = npc->_i1; if (uVar3 == 2) { npc->_i1 = 0; uVar3 = 0; } if (npc->_type == 0x2b) { uVar3 = uVar3 ^ 1; npc->_i1 = uVar3; } iVar6 = 6; if (uVar3 == 0) { iVar6 = 3; } npc->_state = iVar6; if (uVar3 == 0) { (npc->_sprite)._playbackSpeed = 1.0; ExceptionList = local_1c; return; } ANM2::Play(&npc->_sprite,&DAT_00b1e0e4,0); LAB_0046d208: manager = g_manager; if (isGish != '\0') { local_1b8.y = 1.31302e-42; seed_fart_sound_override((int *)&local_1b8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_1b8.y,1.0,2,0,1.0,0.0); } if (npc->_type != 0x2b) { ExceptionList = local_1c; return; } if (npc->_subtype == 1) { (npc->_sprite)._playbackSpeed = 1.5; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)local_1a4), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; if ((npc->_type == 0x2b) && (npc->_variant == 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); uVar3 = Random(); if ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 50.0 + 20.0 <= ABS((npc->_pos).y - (tmpEntity->_pos).y)) { uVar3 = Random(); uVar3 = ((uVar3 & 0xff ^ 0xffffffff) & 1) * 2; } else { uVar3 = 1; } iVar6 = npc->_type; LAB_0046ca54: if (((iVar6 == 0x2b) && (npc->_i2 == uVar3)) && (rngValue = Random(), (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 < 0.9)) { rngValue = Random(); iVar7 = uVar3 + (rngValue & 1) + 1; iVar6 = (int)((ulonglong)((longlong)iVar7 * 0x55555555) >> 0x20) - iVar7; uVar3 = ((iVar6 >> 1) - (iVar6 >> 0x1f)) * 3 + iVar7; } } else { uVar3 = Random(); uVar3 = uVar3 % 3; iVar6 = npc->_type; if (iVar6 != 0x14) goto LAB_0046ca54; if ((npc->_subtype == 2) && (uVar3 == 2)) { uVar3 = 1; } } if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) { uVar3 = 0; } npc->_i2 = uVar3; if (controllerId == -1) { if (uVar3 == 2) goto LAB_0046cb4a; if (uVar3 == 1) goto LAB_0046cc2e; if (uVar3 != 0) goto LAB_0046cc60; LAB_0046ccbb: npc->_state = 4; Entity_NPC::PlaySound(npc,0xe,0.5,2,0,1.0); bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if (isGish != '\0') { local_1b8.y = 1.31162e-42; LAB_0046cba6: manager = g_manager; seed_fart_sound_override((int *)&local_1b8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_1b8.y,1.0,2,0,1.0,0.0); } } else { if (isJumpPressed == '\0') { fVar10 = sqrtf(fireInputX * fireInputX + fireInputY * fireInputY); if (0.5 < fVar10) { LAB_0046cc2e: npc->_state = 8; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Taunt",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_0046cc60; } fVar10 = sqrtf((float)local_1c4 * (float)local_1c4 + moveInputX * moveInputX); if (fVar10 <= 0.5) goto LAB_0046cc60; goto LAB_0046ccbb; } LAB_0046cb4a: npc->_state = 6; Entity_NPC::PlaySound(npc,0xe,1.0,2,0,1.0); bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e0e4,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if (isGish != '\0') { local_1b8.y = 1.31302e-42; goto LAB_0046cba6; } } if ((npc->_type == 0x2b) && (npc->_subtype == 1)) { (npc->_sprite)._playbackSpeed = 1.5; } LAB_0046cc60: if (npc->_state != 8) { ExceptionList = local_1c; return; } if (controllerId == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar9 = (npc->_pos).x - (tmpEntity->_pos).x < (float)local_1a4; } else { bVar9 = (float)local_1a4 <= (npc->_v2).x; } (npc->_sprite)._flipX = bVar9; if (npc->_type != 0x2b) { ExceptionList = local_1c; return; } if (npc->_variant != 0) { ExceptionList = local_1c; return; } tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); if ((npc->_sprite)._flipX == 0) { local_1a4 = (Room *)0x43340000; } local_1a4 = (Room *)((float)local_1a4 * 0.017453292); local_1b0.x = cos((float)local_1a4); local_1b0.y = sin((float)local_1a4); local_1d4.x = 0.0; local_1d4.y = -18.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_1d4,&local_1b0,0x16,tmpColor,4.0); ExceptionList = local_1c; return; } npc->_state = 3; npc->_i1 = 0; iVar6 = npc->_type; if (iVar6 == 0x14) { if ((npc->_subtype == 1) && (npc->_spawnerType != 0x14)) { uVar3 = Random(); local_1b0.x = (npc->_pos).x + 24.0; local_1b0.y = (npc->_pos).y + (float)local_1a4; Game::Spawn(g_game,npc->_type,npc->_variant,&local_1b0,&npc->_velocity,(Entity *)npc, npc->_subtype,uVar3); (npc->_pos).x = (npc->_pos).x - 24.0; (npc->_pos).y = (npc->_pos).y - (float)local_1a4; iVar6 = npc->_type; pRVar11 = extraout_ECX_04; goto LAB_0046c87b; } } else { LAB_0046c87b: if ((iVar6 == 0x2b) && (npc->_variant == 1)) { pRVar11 = (Room *)&npc->_splatColor; local_214 = 0; uStack_210 = 0; local_20c = 0; if (pRVar11 != (Room *)local_234) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; ((ColorMod *)pRVar11)->_tint[0] = 0.02; (npc->_splatColor)._tint[1] = 0.05; (npc->_splatColor)._tint[2] = 0.05; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } } } uVar3 = Game::GetStageID(g_game,(byte)pRVar11); if (uVar3 != 0x19) { ExceptionList = local_1c; return; } *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 7; npc->_i1 = 2; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedChar = "JumpDown"; do { bVar2 = *animNameChar; bVar9 = bVar2 < (byte)*expectedChar; if (bVar2 != *expectedChar) { LAB_0046c951: uVar3 = -(uint)bVar9 | 1; goto LAB_0046c956; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar9 = bVar2 < (byte)expectedChar[1]; if (bVar2 != expectedChar[1]) goto LAB_0046c951; animNameChar = animNameChar + 2; expectedChar = expectedChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0046c956: if (uVar3 == 0) { if (animData[0x34] == 0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._isPlaying != 0) { ExceptionList = local_1c; return; } } } LAB_0046d83f: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"JumpDown",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } ExceptionList = local_1c; return; } //@@ 0046e290 NpcAI::ENTITY_DUKE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 67 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DUKE(Entity_NPC *npc) { code *pcVar1; Vector targetPos; qword qVar2; byte bVar3; Vector *pVVar4; byte *curAnimName; int *effect; EntityList_EL *tinyFlyQuery; ProjectileParams *projParams; uint uVar5; uint uVar6; Entity *tmpEntity; byte *walkAnimName; int unused; void *pvVar7; qword *allocatedBytes; int iVar8; bool bVar9; float fVar10; float fVar11; float fVar12; undefined1 *puVar13; float dirY; undefined4 uVar14; TypeDescriptor *pTVar15; Vector *pVVar16; TypeDescriptor *pTVar17; undefined4 uVar18; EntityList_EL tinyFlies; Vector local_320; Vector flySpawnPos; Vector bossFlySpawnPos; Vector huskFlySpawnPos; Vector deathTinyFlyPos; Vector shotVelocity; Vector huskShotOrigin; Vector huskShotVelocity; Vector shotTarget; Vector minionSpawnPos; Vector tinyFlySpawnPos; Vector tinyFlyVelocity; Vector spiderTarget; Vector boomFlySpawnPos; undefined1 groupNpcs [20]; undefined8 local_298; EntityList_EL tinyFlyList; char isSpawnedFliesRef; void *spawnedFlies; int spawnedFlyCapacity; undefined1 *spawnedFlyCount; code *freeFn; Vector local_268; float local_260; Vector local_25c; float local_254; Entity_NPC *local_250; Vector *local_24c; ProjectileParams shotParams; ProjectileParams huskShotParams; ProjectileParams bossShotParams; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animName; Game *game; Room *room; float speedMultiplier; game = g_game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af28a6; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; pVVar16 = &npc->_pos; npc->_entityGridCollisionClass = 3; local_250 = npc; local_24c = pVVar16; pVVar4 = Room::GetClampedPositionImpl(game->_room,&local_320,pVVar16,40.0,0.0,0.0,0.0); game = g_game; puVar13 = &DAT_bf800000; fVar10 = pVVar4->x; pVVar16->x = fVar10; (npc->_pos).y = pVVar4->y; pvVar7 = game->_room; if (fVar10 == *(float *)((int)pvVar7 + 0x1c)) { (npc->_velocity).x = (float)&DAT_bf800000; pvVar7 = game->_room; } if (fVar10 == *(float *)((int)pvVar7 + 0x14)) { (npc->_velocity).x = 1.0; pvVar7 = game->_room; } fVar10 = (npc->_pos).y; if (fVar10 == *(float *)((int)pvVar7 + 0x20)) { (npc->_velocity).y = (float)&DAT_bf800000; pvVar7 = game->_room; } if (fVar10 == *(float *)((int)pvVar7 + 0x18) + 40.0) { (npc->_velocity).y = 1.0; } fVar10 = 0.4; if (npc->_variant == 1) { fVar10 = 0.8; if (npc->_subtype == 2) { fVar10 = 1.1; } else if (npc->_subtype == 1) { fVar10 = 0.5; } } local_320.y = *(float *)((int)&npc->_flags + 4); if (((npc->_flags & 0x200) == 0) || ((npc->_flags & 0x100) != 0)) { if ((npc->_velocity).y < 0.1) { dirY = (float)&DAT_bf800000; } else { dirY = 1.0; } fVar11 = (npc->_velocity).x; if (0.0 < fVar11) { puVar13 = (undefined1 *)0x3f800000; } fVar12 = npc->_friction * 0.8; npc->_friction = fVar12; if (fVar12 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * dirY * fVar10) / fVar12 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * (float)puVar13 * fVar10) / fVar12 + fVar11; } if ((npc->_variant == 0) && (npc->_subtype == 2)) { npc->_friction = fVar12 * 0.9; } if ((npc->_flags & 0x1000800) != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_25c.y = -((tmpEntity->_pos).x - pVVar16->x); local_268.y = -((tmpEntity->_pos).y - (npc->_pos).y); fVar11 = sqrtf(local_25c.y * local_25c.y + local_268.y * local_268.y); fVar10 = (180.0 - fVar11) * 0.02; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } if (fVar11 <= 0.0) { pvVar7 = (void *)local_25c.y; fVar10 = local_268.y; } else { pvVar7 = (void *)(local_25c.y * (fVar10 / fVar11)); fVar10 = local_268.y * (fVar10 / fVar11); } fVar11 = npc->_friction; if (fVar11 != 0.0) { fVar12 = npc->_speedMultiplier; (npc->_velocity).y = (fVar12 * fVar10) / fVar11 + (npc->_velocity).y; (npc->_velocity).x = (fVar12 * (float)pvVar7) / fVar11 + (npc->_velocity).x; } } } else { fVar10 = npc->_friction * 0.8; npc->_friction = fVar10; if ((npc->_variant == 0) && (npc->_subtype == 2)) { npc->_friction = fVar10 * 0.9; } PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } Entity_NPC::QueryNPCsGroup((EntityList *)groupNpcs,npc->_index); local_14 = 0; pvVar7 = g_game->_room; puVar13 = (undefined1 *)(*(int *)((int)pvVar7 + 0x12c0) + *(int *)((int)pvVar7 + 0x12c4)); local_25c.y = (float)(undefined1 *)0x0; if (0 < (int)puVar13) { local_25c.y = (float)puVar13; } local_254 = (float)groupNpcs._12_4_; freeFn = free_exref; switch(npc->_state) { case 0: npc->_state = 4; break; case 4: if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)pvVar7 + 4) + 0x44) & 1) == 0)) { uVar5 = Random(); fVar10 = local_25c.y; if (((uVar5 % 0x28 == 0) && ((int)((int)local_25c.y + (int)local_254) < 9)) && ((npc->_variant != 1 || (npc->_subtype != 2)))) { npc->_state = 0xd; animName = &DAT_00b1d53c; } else { uVar5 = Random(); if ((uVar5 % 0x46 == 0) && (((int)fVar10 - (int)local_254 < 10 && ((npc->_variant != 1 || (npc->_subtype != 2)))))) { npc->_state = 0xe; animName = &DAT_00b1d554; } else { uVar5 = Random(); if ((uVar5 % 0x2d != 0) || ((((int)local_254 < 5 || (4 < (int)fVar10 - (int)local_254)) || ((npc->_variant == 0 && (npc->_subtype == 1)))))) { uVar5 = Random(); if (uVar5 % 0x46 == 0) { if (npc->_variant != 1) { if (npc->_variant != 0) goto LAB_0046e7ef; if (npc->_subtype != 1) goto LAB_0046e792; } } else { LAB_0046e792: if (((npc->_variant != 1) || (npc->_subtype != 2)) || (uVar5 = Random(), uVar5 % 0x14 != 0)) goto LAB_0046e7ef; } } npc->_state = 8; animName = &DAT_00b1d548; } } bVar3 = ANM2::SetAnimation(&npc->_sprite,animName,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; npc->_stateFrame = 0; break; } } else { LAB_0046e7ef: animName = (npc->_sprite)._animState._animData; if (animName != (byte *)0x0) { curAnimName = animName; if (0xf < *(uint *)(animName + 0x14)) { curAnimName = *(byte **)animName; } walkAnimName = s_Walk; do { bVar3 = *curAnimName; bVar9 = bVar3 < *walkAnimName; if (bVar3 != *walkAnimName) { LAB_0046e825: uVar5 = -(uint)bVar9 | 1; goto LAB_0046e82a; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar9 = bVar3 < walkAnimName[1]; if (bVar3 != walkAnimName[1]) goto LAB_0046e825; curAnimName = curAnimName + 2; walkAnimName = walkAnimName + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0046e82a: if ((uVar5 == 0) && ((animName[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0046e861; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0046e861: npc->_stateFrame = 0; break; case 8: if (npc->_stateFrame == 0x11) { Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); pVVar16 = local_24c; local_254 = 0.0; if ((float)groupNpcs._12_4_ != 0.0) { do { iVar8 = __RTDynamicCast(*(undefined4 *)(groupNpcs._4_4_ + (int)local_254 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar8 != 0) { if (*(int *)(iVar8 + 0x3bc) != 0) { local_260 = (float)(iVar8 + 0x3bc); std::multiset::erase(&local_260); } *(undefined4 *)(iVar8 + 0x3bc) = 0; *(undefined4 *)(iVar8 + 0xc7c) = 0xffffffff; local_268.y = *(float *)(iVar8 + 0x340) - (float)*(EntityPtr *)&pVVar16->y; local_25c.y = *(float *)(iVar8 + 0x33c) - pVVar16->x; fVar10 = local_268.y * local_268.y + local_25c.y * local_25c.y; if (0.01 < fVar10) { fVar10 = sqrtf(fVar10); if (fVar10 <= 0.0) { puVar13 = (undefined1 *)local_25c.y; fVar10 = local_268.y; } else { puVar13 = (undefined1 *)(local_25c.y * (18.0 / fVar10)); fVar10 = local_268.y * (18.0 / fVar10); } fVar11 = *(float *)(iVar8 + 0x36c); if (fVar11 != 0.0) { *(float *)(iVar8 + 0x364) = (*(float *)(iVar8 + 0x39c) * fVar10) / fVar11 + *(float *)(iVar8 + 0x364); *(float *)(iVar8 + 0x360) = (*(float *)(iVar8 + 0x39c) * (float)puVar13) / fVar11 + *(float *)(iVar8 + 0x360); } } } local_254 = (float)((int)local_254 + 1); } while ((uint)local_254 < (uint)groupNpcs._12_4_); npc = local_250; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&tinyFlyList,1000,0x21,-1,1,0); pVVar16 = local_24c; local_14 = CONCAT31(local_14._1_3_,4); local_268.y = 0.0; if ((float)tinyFlyList._size != 0.0) { fVar10 = (float)tinyFlyList._size; pvVar7 = tinyFlyList._data; do { iVar8 = *(int *)((int)pvVar7 + (int)local_268.y * 4); if (iVar8 != 0) { local_24c = (Vector *)(*(float *)(iVar8 + 0x33c) - pVVar16->x); local_25c.y = *(float *)(iVar8 + 0x340) - (float)*(EntityPtr *)&pVVar16->y; fVar11 = (float)local_24c * (float)local_24c + local_25c.y * local_25c.y; if (0.01 < fVar11) { fVar10 = sqrtf(fVar11); if (fVar10 <= 0.0) { pVVar4 = local_24c; puVar13 = (undefined1 *)local_25c.y; } else { pVVar4 = (Vector *)((float)local_24c * (3.0 / fVar10)); puVar13 = (undefined1 *)(local_25c.y * (3.0 / fVar10)); } fVar11 = *(float *)(iVar8 + 0x36c); fVar10 = (float)tinyFlyList._size; pvVar7 = tinyFlyList._data; if (fVar11 != 0.0) { *(float *)(iVar8 + 0x364) = (*(float *)(iVar8 + 0x39c) * (float)puVar13) / fVar11 + *(float *)(iVar8 + 0x364); *(float *)(iVar8 + 0x360) = (*(float *)(iVar8 + 0x39c) * (float)pVVar4) / fVar11 + *(float *)(iVar8 + 0x360); } } } local_268.y = (float)((int)local_268.y + 1); } while ((uint)local_268.y < (uint)fVar10); npc = local_250; } if (npc->_variant == 1) { projParams = ProjectileParams::ProjectileParams(&huskShotParams); huskShotOrigin.x = (npc->_pos).x - 0.0; huskShotVelocity.x = 8.0; huskShotOrigin.y = (npc->_pos).y - 40.0; pVVar16 = &huskShotVelocity; huskShotVelocity.y = 8.0; pVVar4 = &huskShotOrigin; LAB_0046f4e4: Entity_NPC::FireProjectiles(npc,pVVar4,pVVar16,9,projParams); } else if (npc->_subtype == 1) { projParams = ProjectileParams::ProjectileParams(&shotParams); pVVar16 = &shotVelocity; shotVelocity.x = 7.0; pVVar4 = &npc->_pos; shotVelocity.y = 8.0; goto LAB_0046f4e4; } uVar5 = local_14 >> 8; local_14 = local_14 & 0xffffff00; if (tinyFlyList._0_1_ == '\0') { local_14._0_1_ = 5; local_14._1_3_ = (uint3)uVar5; tracked_alloc(1,tinyFlyList._data,0); local_14 = (uint)local_14._1_3_ << 8; } } break; case 0xd: if (npc->_stateFrame == 0x14) { Entity_NPC::PlaySound(npc,0x6c,1.0,2,0,1.0); local_254 = 0.0; do { uVar5 = Random(); uVar18 = 0; pTVar17 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar14 = 0; tmpEntity = Game::Spawn(g_game,1000,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); effect = (int *)__RTDynamicCast(tmpEntity,uVar14,pTVar15,pTVar17,uVar18); if (local_254 == 0.0) { iVar8 = 0x42b40000; } else { iVar8 = -0x3d4c0000; } effect[0x11d] = iVar8; effect[0x5a] = effect[0x5a] | 0x10000; effect[0x5b] = effect[0x5b]; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_50 = 0; uStack_4c = 0; uStack_48 = 0; uStack_44 = 0x3f000000; local_30 = 0; local_2c = 0; local_28 = 0; (**(code **)(*effect + 0x3c))(&local_50,0xffffffff,0xff,0,1); effect[0xd3] = 0; effect[0xd4] = -0x3de00000; (**(code **)(*effect + 0xc))(); local_254 = (float)((int)local_254 + 1); } while ((int)local_254 < 2); if ((npc->_variant == 1) && (npc->_subtype == 1)) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar3 == 0) || (uVar5 = Entity::CountRelatedEntities((Entity *)npc,0x19,0,unused,(void *)0x0), uVar5 < 3 )) { boomFlySpawnPos.y = (npc->_pos).y + 20.0; boomFlySpawnPos.x = (npc->_pos).x; uVar5 = Random(); Game::Spawn(g_game,0x19,0,&boomFlySpawnPos,&g_vectorZero,(Entity *)npc,0,uVar5); } } else { uVar5 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; iVar8 = 3; if (uVar5 != 0) { iVar8 = Entity::CountRelatedEntities((Entity *)npc,0x12,0,uVar5,(void *)0x0); iVar8 = 6 - iVar8; } isSpawnedFliesRef = '\0'; spawnedFlyCapacity = 0x10; spawnedFlyCount = (undefined1 *)0x0; spawnedFlies = operator_new_tracked(0x40); local_14 = CONCAT31(local_14._1_3_,1); local_268.x = (npc->_pos).x; local_268.y = (npc->_pos).y + 20.0; if (0 < iVar8) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x12,0,&local_268,&g_vectorZero,(Entity *)npc,0,uVar5); EntityList_EL::push_back(tmpEntity); } local_268.x = local_268.x + 10.0; if (1 < iVar8) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x12,0,&local_268,&g_vectorZero,(Entity *)npc,0,uVar5); EntityList_EL::push_back(tmpEntity); } if (npc->_variant == 0) { local_268.x = local_268.x - 20.0; if (2 < iVar8) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x12,0,&local_268,&g_vectorZero,(Entity *)npc,0,uVar5); EntityList_EL::push_back(tmpEntity); } } else if ((npc->_variant == 1) && (2 < iVar8)) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_25c.x = (npc->_pos).x * 0.5 + (tmpEntity->_pos).x * 0.5; local_25c.y = (npc->_pos).y * 0.5 + (tmpEntity->_pos).y * 0.5; Room::FindFreePickupSpawnPosition(room,&spiderTarget,&local_25c,70.0,0,0,0); targetPos.y = spiderTarget.y; targetPos.x = spiderTarget.x; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos,0,-30.0); } local_25c.y = 0.0; if (spawnedFlyCount != (undefined1 *)0x0) { do { iVar8 = __RTDynamicCast(*(undefined4 *)((int)spawnedFlies + (int)local_25c.y * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); *(int *)(iVar8 + 0xc7c) = npc->_index; if (*(int *)(iVar8 + 0x3bc) != 0) { local_250 = (Entity_NPC *)(iVar8 + 0x3bc); std::multiset::erase(&local_250); } *(undefined4 *)(iVar8 + 0x3bc) = npc; std::multiset::insert((undefined4 *)(iVar8 + 0x3bc)); *(uint *)(iVar8 + 0x168) = *(uint *)(iVar8 + 0x168) & 0xfffffffb; *(undefined4 *)(iVar8 + 0x16c) = *(undefined4 *)(iVar8 + 0x16c); local_25c.y = (float)((int)local_25c.y + 1); *(undefined1 *)(iVar8 + 0x174) = 1; } while ((uint)local_25c.y < spawnedFlyCount); } local_14 = local_14 & 0xffffff00; if (isSpawnedFliesRef == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (spawnedFlies != (void *)0x0) { uVar5 = *(uint *)((int)spawnedFlies + -4); qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar5); (*freeFn)((uint *)((int)spawnedFlies + -4)); } local_14 = local_14 & 0xffffff00; } } tinyFlyQuery = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&tinyFlies,1000,0x21,-1, 1,0); local_250 = (Entity_NPC *)tinyFlyQuery->_size; if (tinyFlies._0_1_ == '\0') { local_14._0_1_ = 3; tracked_alloc(1,tinyFlies._data,0); local_14 = (uint)local_14._1_3_ << 8; } if (local_250 < (Entity_NPC *)0x19) { uVar5 = Random(); local_254 = (npc->_pos).x; local_260 = (npc->_pos).y + 20.0; local_25c.y = (float)(uVar5 % 5 + 1); if ((undefined1 *)local_25c.y != (undefined1 *)0x0) { do { uVar5 = Random(); uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_250 = (Entity_NPC *)(fVar10 + fVar10); local_24c = (Vector *)sin((float)local_250); tinyFlyVelocity.x = cos((float)local_250); tinyFlyVelocity.y = (float)local_24c; uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_250 = (Entity_NPC *)(fVar10 + fVar10); local_268.y = sin((float)local_250); uVar6 = Random(); local_24c = (Vector *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0); fVar10 = cos((float)local_250); tinyFlySpawnPos.x = fVar10 * (float)local_24c + local_254; tinyFlySpawnPos.y = local_268.y * (float)local_24c + local_260; tmpEntity = Game::Spawn(g_game,1000,0x21,&tinyFlySpawnPos,&tinyFlyVelocity,(Entity *)npc ,0,uVar5); if (tmpEntity->_parent != (EntityPtr)0x0) { local_24c = (Vector *)&tmpEntity->_parent; std::multiset::erase(&local_24c); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); uVar14 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar14; (**(code **)(*(int *)tmpEntity + 0xc))(); local_25c.y = (float)((int)local_25c.y + -1); } while ((undefined1 *)local_25c.y != (undefined1 *)0x0); local_25c.y = 0.0; } } } break; case 0xe: if (npc->_stateFrame == 0x12) { Entity_NPC::PlaySound(npc,0x6a,1.0,2,0,1.0); if (npc->_variant == 0) { iVar8 = npc->_subtype; local_25c.y = 2.52234e-44; if (iVar8 == 1) { local_25c.y = (float)&DAT_00000050; } else if (iVar8 == 2) { local_25c.y = 8.54792e-44; } uVar5 = Entity::CountRelatedEntities((Entity *)npc,(int)local_25c.y,0,iVar8,(void *)0x0); if (uVar5 < 5) { uVar5 = Random(); minionSpawnPos.y = (npc->_pos).y + 20.0; minionSpawnPos.x = pVVar16->x; uVar18 = 0; pTVar17 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar14 = 0; tmpEntity = Game::Spawn(g_game,(uint)local_25c.y,0,&minionSpawnPos,&g_vectorZero, (Entity *)npc,0,uVar5); iVar8 = __RTDynamicCast(tmpEntity,uVar14,pTVar15,pTVar17,uVar18); *(uint *)(iVar8 + 0x168) = *(uint *)(iVar8 + 0x168) & 0xfffffffb; *(undefined1 *)(iVar8 + 0x174) = 1; *(undefined4 *)(iVar8 + 0x16c) = *(undefined4 *)(iVar8 + 0x16c); if (npc->_subtype == 0) { fVar11 = *(float *)(iVar8 + 0xc38) * 1.25; *(float *)(iVar8 + 0xc38) = fVar11; fVar11 = fVar11 * *(float *)(iVar8 + 0x3b4); fVar10 = fVar11 * g_vectorOne.x; *(float *)(iVar8 + 0xe8) = fVar11 * g_vectorOne.y; *(float *)(iVar8 + 0xe4) = fVar10; *(float *)(iVar8 + 900) = *(float *)(iVar8 + 900) * 1.8; *(float *)(iVar8 + 0x380) = *(float *)(iVar8 + 0x380) * 1.8; } } } else if (npc->_variant == 1) { projParams = ProjectileParams::ProjectileParams(&bossShotParams); tmpEntity = Entity_NPC::GetPlayerTarget(npc); shotTarget.x = (tmpEntity->_pos).x; shotTarget.y = (tmpEntity->_pos).y; Entity_NPC::FireBossProjectiles(npc,10,&shotTarget,0.0,projParams); } } } npc->_stateFrame = npc->_stateFrame + 1; if (0x27 < npc->_stateFrame) { npc->_state = 4; } if (npc->_dead == 0) goto LAB_0046fb4c; local_25c.y = 0.0; uVar5 = Random(); if (uVar5 % 10 != 0xfffffffb) { do { uVar5 = Random(); uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_250 = (Entity_NPC *)(fVar10 + fVar10); uVar6 = Random(); local_24c = (Vector *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 50.0); fVar10 = cos((float)local_250); deathTinyFlyPos.x = fVar10 * (float)local_24c + (npc->_pos).x; fVar10 = sin((float)local_250); deathTinyFlyPos.y = fVar10 * (float)local_24c + (npc->_pos).y; Game::Spawn(g_game,1000,0x21,&deathTinyFlyPos,&g_vectorZero,(Entity *)npc,0,uVar5); puVar13 = (undefined1 *)((int)local_25c.y + 1); local_25c.y = (float)puVar13; uVar5 = Random(); } while (puVar13 < (undefined1 *)(uVar5 % 10 + 5)); } uVar5 = npc->_initSeed; local_298 = 0x900000005; local_254 = 9.80909e-45; if (npc->_variant != 1) { local_250 = (Entity_NPC *)&DAT_00000006; do { uVar6 = Random(); local_260 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_260 = local_260 + local_260; local_25c.y = sin(local_260); uVar6 = Random(); local_24c = (Vector *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.8 * npc->_size); fVar10 = cos(local_260); flySpawnPos.x = fVar10 * (float)local_24c + (npc->_pos).x; flySpawnPos.y = (float)local_24c * local_25c.y + (npc->_pos).y; local_260 = (float)Random(); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> ((byte)local_298 & 0x1f) ^ uVar5; uVar5 = uVar5 << (SUB81(local_298,4) & 0x1f) ^ uVar5; uVar5 = uVar5 >> (SUB41(local_254,0) & 0x1f) ^ uVar5; uVar6 = 0x12; if ((uVar5 & 1) != 0) { uVar6 = 0xd; } tmpEntity = Game::Spawn(g_game,uVar6,0,&flySpawnPos,&g_vectorZero,(Entity *)npc,0, (uint)local_260); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; local_250 = (Entity_NPC *)((int)&local_250[-1]._pickupGhostsEntity + 3); *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); } while (local_250 != (Entity_NPC *)0x0); goto LAB_0046fb4c; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 9 ^ uVar5; uVar5 = uVar5 >> 7 ^ uVar5; for (local_250 = (Entity_NPC *)(uVar5 % 3 + 4); local_250 != (Entity_NPC *)0x0; local_250 = (Entity_NPC *)((int)&local_250[-1]._pickupGhostsEntity + 3)) { uVar6 = Random(); local_260 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_260 = local_260 + local_260; local_25c.y = sin(local_260); uVar6 = Random(); local_24c = (Vector *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.8 * npc->_size); fVar10 = cos(local_260); huskFlySpawnPos.x = fVar10 * (float)local_24c + (npc->_pos).x; huskFlySpawnPos.y = local_25c.y * (float)local_24c + (npc->_pos).y; local_260 = (float)Random(); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> ((byte)local_298 & 0x1f) ^ uVar5; uVar5 = uVar5 << (SUB81(local_298,4) & 0x1f) ^ uVar5; uVar5 = uVar5 >> (SUB41(local_254,0) & 0x1f) ^ uVar5; uVar6 = 0x12; if ((uVar5 & 1) != 0) { uVar6 = 0xd; } tmpEntity = Game::Spawn(g_game,uVar6,0,&huskFlySpawnPos,&g_vectorZero,(Entity *)npc,0, (uint)local_260); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); } local_25c.y = (float)&DAT_0000000e; local_268.y = 0.0; if (npc->_subtype == 1) { local_268.y = 0.0; LAB_0046f885: local_25c.y = 3.50325e-44; } else if (npc->_subtype == 2) { local_268.y = 1.4013e-45; goto LAB_0046f885; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> ((byte)local_298 & 0x1f) ^ uVar5; uVar5 = uVar5 << (SUB81(local_298,4) & 0x1f) ^ uVar5; local_250 = (Entity_NPC *)0x0; for (iVar8 = ((uVar5 >> (SUB41(local_254,0) & 0x1f) ^ uVar5) & 1) + 1; iVar8 != 0; iVar8 = iVar8 + -1) { uVar5 = Random(); local_260 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_260 = local_260 + local_260; local_24c = (Vector *)sin(local_260); uVar5 = Random(); local_250 = (Entity_NPC *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.8 * npc->_size); fVar10 = cos(local_260); bossFlySpawnPos.x = fVar10 * (float)local_250 + (npc->_pos).x; bossFlySpawnPos.y = (float)local_24c * (float)local_250 + (npc->_pos).y; uVar5 = Random(); tmpEntity = Game::Spawn(g_game,(uint)local_25c.y,(uint)local_268.y,&bossFlySpawnPos, &g_vectorZero,(Entity *)npc,0,uVar5); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); } LAB_0046fb4c: if (groupNpcs[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (groupNpcs._4_4_ != 0) { uVar5 = *(uint *)(groupNpcs._4_4_ + -4); qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar5); (*freeFn)(groupNpcs._4_4_ + -4); } } ExceptionList = local_1c; return; } //@@ 0046fbe0 NpcAI::ENTITY_WIDOW /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 100 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WIDOW(Entity_NPC *npc) { Vector targetPos; Vector targetPos_00; Vector targetPos_01; byte bVar1; char isAllowSummon; Vector *pVVar2; Entity *pEVar3; uint uVar4; int iVar5; int iVar6; int spiderCount; Entity_Effect *effect; Entity_NPC *relatedNpc; uint seed; int *piVar7; Vector *pVVar8; ProjectileParams *params; int unused; int unused_00; int unused_01; int unused_02; void *ptr; int unused_03; int unused_04; int unused_05; int unused_06; bool isNotVariant1; float fVar9; undefined4 uVar10; float fVar11; undefined8 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; EntityRef sourceRef; undefined1 spawnedList [12]; int *spawnedCount; Vector local_160; undefined1 queryList [8]; Vector local_150; char isFewEnemies; undefined1 local_144 [12]; int *local_138; int *local_134; float local_130; int *local_12c; ProjectileParams projParams; ColorMod cloudColor; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined8 local_30; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; float jumpVelX; Manager *manager; Room *room; int *stateListCap; code *takeDamageFn; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af2901; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; if (npc->_state == 0) { npc->_state = 4; return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; pVVar2 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_144 + 8),0.0); pVVar8 = &npc->_pos; local_130 = pVVar2->x - pVVar8->x; local_12c = (int *)(pVVar2->y - (npc->_pos).y); pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_144._8_4_ = (pEVar3->_pos).x - pVVar8->x; local_138 = (int *)((pEVar3->_pos).y - (npc->_pos).y); iVar6 = npc->_state; npc->_entityCollisionClass = 2; npc->_entityGridCollisionClass = 5; if (iVar6 == 4) { ANM2::Play(&npc->_sprite,s_Idle,0); if (((npc->_flags & 0x1000000000000000) != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) goto LAB_00470598; uVar4 = Random(); if ((uVar4 % 3 != 0) || (fVar9 = sqrtf(local_130 * local_130 + (float)local_12c * (float)local_12c), fVar9 <= 100.0)) { if (npc->_variant == 0) { iVar5 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar6 = 0; if (0 < iVar5) { iVar6 = iVar5; } if (5 < iVar6) goto LAB_0046fd8f; } if (npc->_i1 < 1) { local_144._4_4_ = (void *)0x0; local_144._8_4_ = (int *)0x0; local_138 = (int *)0x0; local_14 = 0; local_134 = (int *)0x4; std::vector::_Emplace_reallocate(0,&local_134); local_134 = (int *)&DAT_00000008; if ((int *)local_144._8_4_ == local_138) { std::vector::_Emplace_reallocate(local_144._8_4_,&local_134); } else { *(int *)local_144._8_4_ = 8; local_144._8_4_ = local_144._8_4_ + 4; } iVar5 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar6 = 0; if (0 < iVar5) { iVar6 = iVar5; } if ((iVar6 < 6) || (npc->_variant == 0)) { isFewEnemies = '\x01'; } else { isFewEnemies = '\0'; } local_12c = (int *)local_144._8_4_; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar1 == 0) { isAllowSummon = isFewEnemies; } else { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x32e,0,unused,(void *)0x0); iVar5 = Entity::CountRelatedEntities((Entity *)npc,0x5e,0,unused_00,(void *)0x0); spiderCount = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused_01,(void *)0x0); local_130 = (float)(spiderCount + iVar6 + iVar5); isNotVariant1 = npc->_variant != 1; if (isNotVariant1) { iVar6 = 0x12; } else { iVar6 = 0x1d; } iVar6 = Entity::CountRelatedEntities ((Entity *)npc,iVar6,(uint)!isNotVariant1,unused_02,(void *)0x0); isAllowSummon = (int)local_130 + iVar6 < 3; } piVar7 = local_12c; if (isAllowSummon != '\0') { local_134 = (int *)&DAT_00000009; if (local_12c == local_138) { std::vector::_Emplace_reallocate(local_12c,&local_134); piVar7 = (int *)local_144._8_4_; } else { *local_12c = 9; piVar7 = local_12c + 1; local_144._8_4_ = piVar7; } } stateListCap = local_138; npc->_stateFrame = 0; iVar6 = Isaac::Random((int)piVar7 - local_144._4_4_ >> 2); npc->_state = *(int *)(local_144._4_4_ + iVar6 * 4); local_14 = 0xffffffff; if ((void *)local_144._4_4_ != (void *)0x0) { uVar4 = (int)stateListCap - local_144._4_4_ & 0xfffffffc; ptr = (void *)local_144._4_4_; if (0xfff < uVar4) { ptr = *(void **)(local_144._4_4_ + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)(local_144._4_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } goto LAB_00470598; } } LAB_0046fd8f: npc->_i1 = 0; npc->_stateFrame = 0; npc->_state = 6; npc->_friction = npc->_friction * 0.7; fVar9 = sqrtf(local_130 * local_130 + (float)local_12c * (float)local_12c); if (fVar9 <= 0.0) { fVar11 = local_130; piVar7 = local_12c; } else { fVar11 = local_130 * (1.0 / fVar9); piVar7 = (int *)((1.0 / fVar9) * (float)local_12c); } (npc->_v1).x = fVar11 * 7.0; (npc->_v1).y = (float)piVar7 * 7.0; goto LAB_00470598; } if (iVar6 != 6) { if (iVar6 == 8) { ANM2::Play(&npc->_sprite,&DAT_00b1d53c,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { if (npc->_variant == 1) { ProjectileParams::ProjectileParams(&projParams); projParams.Color._offset[0] = 0.54901963; projParams.Color._offset[1] = 0.54901963; projParams.Color._tint[0] = 0.3; projParams.Color._tint[1] = 0.8; projParams.Color._tint[2] = 0.8; projParams.Color._tint[3] = 1.0; projParams.Color._offset[2] = 0.54901963; local_144._8_4_ = (int *)0x41200000; local_138 = (int *)0x0; Entity_NPC::FireProjectiles(npc,pVVar8,(Vector *)(local_144 + 8),8,&projParams); } else { iVar6 = 2; local_12c = (int *)0x2; iVar5 = 0x1e; local_130 = 4.2039e-44; if (npc->_subtype == 2) { LAB_00470417: iVar6 = 0; local_12c = (int *)0x0; } else if (npc->_subtype == 1) { iVar5 = 0x5e; local_130 = 1.31722e-43; goto LAB_00470417; } Entity_NPC::QueryNPCsType(queryList,iVar5,iVar6); local_14 = 3; if (((uint)local_150.y < (void *)0x3) && ((bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar1 == 0 || ((uint)local_150.y < (void *)0x2)))) { uVar4 = Random(); local_144._8_4_ = pVVar8->x + 0.0; local_138 = (int *)((npc->_pos).y + 30.0); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; pEVar3 = Game::Spawn(g_game,(uint)local_130,(uint)local_12c,(Vector *)(local_144 + 8), &g_vectorZero,(Entity *)npc,0,uVar4); local_12c = (int *)__RTDynamicCast(pEVar3,uVar10,pTVar13,pTVar14,uVar15); local_12c[0xe0] = 0x41200000; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar1 != 0) { (**(code **)(*local_12c + 0xc))(); local_12c[0xe0] = 0x3f800000; local_12c[0xe1] = 0x3f800000; } } npc->_i1 = npc->_i1 + 1; local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(queryList); } npc->_stateFrame = 0; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (((bVar1 != 0) && (bVar1 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump), bVar1 == 0)) && (local_134 = (int *)((int)npc->_updateTime - (int)npc->_prevUpdateTime), 0 < (int)local_134)) { do { uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c = (int *)(fVar9 + fVar9); local_160.y = sin((float)local_12c); local_130 = (float)npc->_stateFrame * 3.0; fVar9 = cos((float)local_12c); local_150.x = fVar9 * local_130 + (npc->_pos).x; local_150.y = local_160.y * local_130 + (npc->_pos).y; if (npc->_subtype == 1) { uVar4 = 0x1a; local_28 = 0; local_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; local_40 = 0x3ecccccd; uStack_3c = 0x3edc28f6; uStack_38 = 0x3ee66666; uStack_34 = 0x3f800000; uVar15 = 0; uVar10 = 0; } else { local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; uVar4 = 0x19; uVar15 = 0x3f800000; local_28 = 0x3f800000; local_50 = 0; uStack_4c = 0; uStack_48 = 0; uVar10 = 0x3f800000; } uStack_44 = 0x3f800000; local_30 = CONCAT44(uVar15,uVar10); seed = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; pEVar3 = Game::Spawn(g_game,1000,uVar4,&local_150,&g_vectorZero,(Entity *)npc,0,seed); piVar7 = (int *)__RTDynamicCast(pEVar3,uVar10,pTVar13,pTVar14,uVar15); fVar11 = (float)npc->_stateFrame * 0.2 + 1.0; fVar9 = fVar11 * g_vectorOne.x; piVar7[0x3a] = (int)(fVar11 * g_vectorOne.y); piVar7[0x39] = (int)fVar9; (**(code **)(*piVar7 + 0xc))(); manager = g_manager; local_12c = (void *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_12c = (void *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_12c = (void *)0x3f000000; } local_130 = 2.5924e-43; seed_fart_sound_override((int *)&local_130); SoundEffects::Play(&manager->_sfxManager,(int)local_130,1.5,2,0,(float)local_12c,0.0); local_130 = local_150.y - (npc->_pos).y; local_12c = (int *)(local_150.x - (npc->_pos).x); fVar9 = sqrtf(local_130 * local_130 + (float)local_12c * (float)local_12c); if (0.0 < fVar9) { local_12c = (int *)((float)local_12c * (1.0 / fVar9)); local_130 = local_130 * (1.0 / fVar9); } local_12c = (int *)((float)local_12c * 6.0); local_130 = local_130 * 6.0; uVar4 = Random(); pEVar3 = Game::Spawn(g_game,1000,2,&local_150,&g_vectorZero,(Entity *)0x0,2,uVar4); (**(code **)(*(int *)pEVar3 + 0x3c))(&local_50,0xffffffff,0xff,0,1); (pEVar3->_sprite)._offset.x = (float)local_12c; local_134 = (int *)((int)local_134 + -1); (pEVar3->_sprite)._offset.y = local_130; pEVar3->_renderDepthOffset = 10.0; npc->_stateFrame = npc->_stateFrame + 1; } while (0 < (int)local_134); } goto LAB_0047057f; } } } else { if (iVar6 != 9) goto LAB_00470598; ANM2::Play(&npc->_sprite,&DAT_00b1d554,0); npc->_stateFrame = npc->_stateFrame + 1; bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x9e,1.6,2,0,1.0); } bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { cloudColor._offset[0] = 0.4; cloudColor._colorize[0] = 0.0; cloudColor._colorize[1] = 0.0; cloudColor._colorize[2] = 0.0; cloudColor._colorize[3] = 0.0; cloudColor._offset[1] = 0.38; cloudColor._tint[0] = 0.0; cloudColor._tint[1] = 0.0; cloudColor._tint[2] = 0.0; cloudColor._tint[3] = 0.55; cloudColor._offset[2] = 0.34; effect = Entity_NPC::MakeBloodCloud(npc,pVVar8,&cloudColor); local_130 = 2.8026e-45; (effect->_posOffset).x = 0.0; (effect->_posOffset).y = -40.0; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar1 != 0) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0x32e,0,unused_03,(void *)0x0); iVar5 = Entity::CountRelatedEntities((Entity *)npc,0x5e,0,unused_04,(void *)0x0); spiderCount = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused_05,(void *)0x0); local_134 = (int *)(spiderCount + iVar6 + iVar5); isNotVariant1 = npc->_variant != 1; if (isNotVariant1) { iVar6 = 0x12; } else { iVar6 = 0x1d; } iVar6 = Entity::CountRelatedEntities ((Entity *)npc,iVar6,(uint)!isNotVariant1,unused_06,(void *)0x0); fVar9 = (float)(3 - (int)((int)local_134 + iVar6)); local_130 = 2.8026e-45; if ((int)fVar9 < 3) { local_130 = fVar9; } } pVVar8 = &npc->_pos; if (npc->_variant == 1) { uVar4 = Random(); if (uVar4 % 3 == 0) { uVar4 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; pEVar3 = Game::Spawn(g_game,0x1d,1,pVVar8,&g_vectorZero,(Entity *)npc,0,uVar4); local_134 = (int *)__RTDynamicCast(pEVar3,uVar10,pTVar13,pTVar14,uVar15); room = g_game->_room; pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_144._8_4_ = (pEVar3->_pos).x; local_138 = (int *)(pEVar3->_pos).y; pVVar8 = Room::FindFreePickupSpawnPosition (room,&local_150,(Vector *)(local_144 + 8),50.0,0,0,0); piVar7 = local_134; local_134[0xcd] = (int)pVVar8->x; local_134[0xce] = (int)pVVar8->y; local_160.y = (float)(local_134 + 0x12); local_134[0x2d9] = 4; local_134[0x104] = 5; bVar1 = ANM2::SetAnimation((ANM2 *)local_160.y,&DAT_00b1de1c,1); fVar9 = local_160.y; if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)local_160.y + 0x30)); ((AnimationState *)((int)fVar9 + 0x30))->_isPlaying = 1; piVar7 = local_134; } if (piVar7[0x1f] != 0) { AnimationState::SetFrameFloat((AnimationState *)(piVar7 + 0x1e),5.0); } goto LAB_00470598; } uVar4 = Random(); if ((uVar4 & 1) == 0) { iVar5 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar6 = 0; if (0 < iVar5) { iVar6 = iVar5; } if (iVar6 < 5) { if (0 < (int)local_130) { do { Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_144 + 8),pVVar8,100.0,0,0,0); targetPos_00.y = (float)local_138; targetPos_00.x = (float)local_144._8_4_; Entity_NPC::ThrowSpider(pVVar8,(Entity *)npc,targetPos_00,0,-30.0); local_130 = (float)((int)local_130 + -1); } while (local_130 != 0.0); local_130 = 0.0; } goto LAB_00470598; } } Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_144 + 8),pVVar8,100.0,0,0,0); bVar1 = 1; } else { if (npc->_subtype == 2) { pVVar2 = Vector::Normalized((Vector *)(local_144 + 8),&local_150); local_134 = (int *)(pVVar2->x * 13.0); local_12c = (int *)(pVVar2->y * 13.0); uVar4 = Random(); local_150.y = (float)local_134 * 0.4; local_160.y = (float)local_12c * 0.4; uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; local_138 = (int *)(local_150.y + (float)local_12c); local_144._8_4_ = (float)local_134 + local_160.y; pEVar3 = Game::Spawn(g_game,0x12,0,pVVar8,(Vector *)(local_144 + 8),(Entity *)npc,0, uVar4); iVar6 = __RTDynamicCast(pEVar3,uVar10,pTVar13,pTVar14,uVar15); *(uint *)(iVar6 + 0x168) = *(uint *)(iVar6 + 0x168) & 0xfffffffb; *(undefined1 *)(iVar6 + 0x174) = 1; *(undefined4 *)(iVar6 + 0x16c) = *(undefined4 *)(iVar6 + 0x16c); if (1 < (int)local_130) { uVar4 = Random(); local_144._8_4_ = (float)local_134 - local_160.y; local_138 = (int *)((float)local_12c - local_150.y); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; pEVar3 = Game::Spawn(g_game,0x12,0,pVVar8,(Vector *)(local_144 + 8),(Entity *)npc,0, uVar4); iVar6 = __RTDynamicCast(pEVar3,uVar10,pTVar13,pTVar14,uVar15); *(uint *)(iVar6 + 0x168) = *(uint *)(iVar6 + 0x168) & 0xfffffffb; *(undefined1 *)(iVar6 + 0x174) = 1; *(undefined4 *)(iVar6 + 0x16c) = *(undefined4 *)(iVar6 + 0x16c); } goto LAB_00470598; } if (npc->_subtype == 1) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); params = ProjectileParams::ProjectileParams(&projParams); local_150.x = (npc->_pos).x + 0.0; local_150.y = (npc->_pos).y - 15.0; local_144._8_4_ = (int *)0x41000000; local_138 = (int *)0x40c00000; Entity_NPC::FireProjectiles(npc,&local_150,(Vector *)(local_144 + 8),9,params); goto LAB_00470598; } Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_144 + 8),&npc->_pos,100.0,0,0,0); bVar1 = 0; } targetPos_01.y = (float)local_138; targetPos_01.x = (float)local_144._8_4_; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos_01,bVar1,-30.0); goto LAB_00470598; } LAB_0047057f: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00470598; } npc->_state = 4; goto LAB_00470598; } ANM2::Play(&npc->_sprite,s_Jump,0); if (npc->_subtype == 2) { (npc->_sprite)._playbackSpeed = 1.4; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00470314: npc->_state = 4; (npc->_sprite)._playbackSpeed = 1.0; } else { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Jump); if (bVar1 == 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00470314; bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); uVar4 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x10,pVVar8,&g_vectorZero,(Entity *)npc,2,uVar4); uVar4 = Random(); (effect->_sprite)._offset.x = 0.0; (effect->_sprite)._flipX = ((byte)uVar4 ^ 0xff) & 1; (effect->_sprite)._offset.y = 15.0; (effect->_sprite)._scale.x = 1.3; (effect->_sprite)._scale.y = 1.0; uVar12 = Color::Color(0x3f333333); (*(code *)((ulonglong)uVar12 >> 0x20))((int)uVar12,0xffffffff,0xff,0,1); Entity_Effect::FollowParent(effect,(Entity *)npc); (**(code **)(*(int *)effect + 0xc))(); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_144,&npc->_pos ,60.0,0xffffffff); local_14 = 1; local_12c = (int *)0x0; piVar7 = local_138; if (local_138 != (int *)0x0) { do { local_134 = *(int **)(local_144._4_4_ + (int)local_12c * 4); if ((9 < local_134[10]) && (local_134[10] != npc->_type)) { takeDamageFn = *(code **)(*local_134 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)npc); (*takeDamageFn)(0x42c80000,0,0,&sourceRef,0x1e); piVar7 = local_138; } local_12c = (int *)((int)local_12c + 1); } while (local_12c < piVar7); } local_14 = 0xffffffff; if (local_144[0] == '\0') { local_14 = 2; tracked_alloc(1,(void *)local_144._4_4_,0); local_14 = 0xffffffff; } } } else { Entity_NPC::PlaySound(npc,0xe,1.0,2,0,1.0); } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00470314; bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump); if ((bVar1 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land), bVar1 == 0))) ) { fVar9 = npc->_friction; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; if (fVar9 != 0.0) { fVar11 = npc->_speedMultiplier; jumpVelX = (npc->_v1).x; (npc->_velocity).y = (fVar11 * (npc->_v1).y) / fVar9 + (npc->_velocity).y; (npc->_velocity).x = (fVar11 * jumpVelX) / fVar9 + (npc->_velocity).x; } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_00470314; } npc->_friction = npc->_friction * 0.9; LAB_00470598: if (npc->_dead != 0) { if (npc->_variant == 1) { local_134 = (int *)0x3; do { Room::FindFreePickupSpawnPosition(g_game->_room,&local_160,&npc->_pos,100.0,0,0,0); targetPos.y = g_vectorZero.y; targetPos.x = g_vectorZero.x; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos,0,-30.0); local_134 = (int *)((int)local_134 + -1); } while (local_134 != (int *)0x0); } if ((npc->_flags & 0x1000000000000000) != 0) { Entity_NPC::QueryNPCsSpawnerType((EntityList *)spawnedList,npc->_type,0,0); local_14 = 4; local_134 = (int *)0x0; if (spawnedCount != (int *)0x0) { do { relatedNpc = (Entity_NPC *) __RTDynamicCast(*(undefined4 *)(spawnedList._4_4_ + (int)local_134 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (((relatedNpc != (Entity_NPC *)0x0) && (relatedNpc != npc)) && (relatedNpc->_type == 0x1e)) { sourceRef._position.x = g_vectorZero.x; sourceRef._velocity.x = g_vectorZero.x; sourceRef._position.y = g_vectorZero.y; sourceRef._velocity.y = g_vectorZero.y; sourceRef._type = 0; sourceRef._variant = 0; sourceRef._spawnerType = 0; sourceRef._spawnerVariant = 0; sourceRef._flags = 0; sourceRef._entity = (void *)0x0; (**(code **)(*(int *)relatedNpc + 0x24))(&sourceRef); } local_134 = (int *)((int)local_134 + 1); } while (local_134 < spawnedCount); } if (spawnedList[0] == '\0') { local_14 = 5; tracked_alloc(1,(void *)spawnedList._4_4_,0); } } } ExceptionList = local_1c; return; } //@@ 00471050 NpcAI::ENTITY_GEMINI /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Gemini (79) inline case: after FireProjectiles, variant < 10 -> cordSegment (variants 10..19 Contusion/Suture -> 00471cc0); anims Hori/Vert/WalkHori/WalkVert/IdleHead/RageBody, m_Child downcast, SetBossColorIdx, PathFinder::FindGridPath */ void __fastcall NpcAI::ENTITY_GEMINI(Entity_NPC *npc) { qword qVar1; undefined1 *puVar2; byte bVar3; uint uVar4; uint uVar5; Entity *spawned; EntityPtr child; Entity_NPC *cordSegment; Vector *targetPos; int iVar6; EntityPtr **ppEVar7; LayerState *segmentLayer; int *segmentToRemove; int extraout_ECX; void *pvVar8; EntityPtr *pEVar9; qword *allocCounter; float fVar10; float fVar11; undefined4 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; EntityPtr *cordSlack; float segmentIndex; float childOffsetY; float childOffsetX; float local_70; EntityPtr *local_6c; undefined1 local_68 [24]; float fStack_50; float fStack_4c; void *local_48; float local_44; EntityPtr *local_40; void *walkAnimV; char local_38 [4]; undefined1 local_34 [12]; EntityPtr *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af295d; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; local_24 = uVar4; puVar2 = local_34 + 0x30; if ((npc->_variant == 2) && (bVar3 = Entity::IsFrame((Entity *)npc,7,0), puVar2 = puStack_20, bVar3 != 0)) { uVar5 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; spawned = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); __RTDynamicCast(spawned,uVar12,pTVar13,pTVar14,uVar15,uVar4); puVar2 = puStack_20; } puStack_20 = puVar2; switch(npc->_state) { case 0: uVar5 = Random(); local_34._8_4_ = (npc->_pos).x + 0.0; local_28 = (EntityPtr *)((npc->_pos).y - 8.0); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; spawned = Game::Spawn(g_game,npc->_type,npc->_variant + 10,(Vector *)(local_34 + 8), &g_vectorZero,(Entity *)npc,0,uVar5); child = (EntityPtr)__RTDynamicCast(spawned,uVar12,pTVar13,pTVar14,uVar15,uVar4); if (*(int *)((int)child + 0x3bc) != 0) { local_6c = (EntityPtr *)((int)child + 0x3bc); std::multiset::erase(&local_6c); } *(int *)((int)child + 0x3bc) = (int)npc; std::multiset::insert((int *)((int)child + 0x3bc)); if ((npc->_flags & 0x1000000000000000) != 0) { *(float *)((int)child + 900) = npc->_maxHitPoints; *(float *)((int)child + 0x380) = npc->_maxHitPoints; } if (npc->_child != (EntityPtr)0x0) { local_6c = &npc->_child; std::multiset::erase(&local_6c); } npc->_child = child; std::multiset::insert(&npc->_child); (**(code **)(*(int *)child + 0xc))(); iVar6 = npc->_variant; if ((iVar6 == 0) && (npc->_subtype != 1)) { local_70 = 0.0; do { uVar5 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; spawned = Game::Spawn(g_game,npc->_type,0x14,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5) ; cordSegment = (Entity_NPC *)__RTDynamicCast(spawned,uVar12,pTVar13,pTVar14,uVar15); iVar6 = extraout_ECX; if (local_70 != 1.26117e-44) { iVar6 = *(int *)((int)&cordSegment->_flags + 4); *(uint *)&cordSegment->_flags = (uint)cordSegment->_flags & 0xfffffffb; *(int *)((int)&cordSegment->_flags + 4) = iVar6; } Entity_NPC::SetBossColorIdx(cordSegment,npc->_bosscoloridx,iVar6); if (cordSegment->_parent != (EntityPtr)0x0) { local_6c = &cordSegment->_parent; std::multiset::erase(&local_6c); } cordSegment->_parent = (EntityPtr)npc; std::multiset::insert(&cordSegment->_parent); cordSegment->_entityCollisionClass = 0; cordSegment->_visible = 0; if ((npc->_flags & 0x1000000000000000) != 0) { cordSegment->_maxHitPoints = npc->_maxHitPoints; cordSegment->_health = npc->_maxHitPoints; } local_70 = (float)((int)local_70 + 1); } while ((int)local_70 < 0x12); iVar6 = npc->_variant; } npc->_state = 4; if (iVar6 == 1) { local_48 = (void *)0x0; local_68._16_4_ = 0.0; local_68._20_4_ = (void *)0x0; fStack_50 = 0.0; fStack_4c = 0.0; local_44 = 0.0; local_40 = (EntityPtr *)0x0; local_68._0_4_ = 0.1; local_68._4_4_ = 0.0; local_68._8_4_ = 0.0; local_68._12_4_ = 1.0; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_68); } break; case 3: AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,&DAT_00b1e10c,0); npc->_stateFrame = npc->_stateFrame + 1; npc->_aiFloat = 0.0; if (100 < npc->_stateFrame) { npc->_state = 4; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"IdleHead",1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } break; case 4: local_28 = (EntityPtr *)&DAT_0000000f; local_34._8_4_ = 1.12104e-44; walkAnimV = (void *)0x6b6c6157; builtin_strncpy(local_38,"Vert",4); local_34[0] = '\0'; local_40 = (EntityPtr *)0xf; local_44 = 1.12104e-44; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; fStack_50 = (float)0x69726f48; fStack_4c = (float)((uint)fStack_4c & 0xffffff00); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_68 + 0x14),(std_string *)&walkAnimV,0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_40) { uVar5 = (int)local_40 + 1; pvVar8 = (void *)local_68._20_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(local_68._20_4_ + -4); uVar5 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)pvVar8))) goto LAB_0047141e; } operator_delete(pvVar8,uVar5); } local_14 = 0xffffffff; local_44 = 0.0; local_40 = (EntityPtr *)0xf; local_68._20_4_ = local_68._20_4_ & 0xffffff00; if ((EntityPtr *)&DAT_0000000f < local_28) { pEVar9 = (EntityPtr *)&local_28->field_0x1; pvVar8 = walkAnimV; if ((undefined1 *)0xfff < pEVar9) { pvVar8 = *(void **)((int)walkAnimV + -4); pEVar9 = local_28 + 9; if (0x1f < (uint)((int)walkAnimV + (-4 - (int)pvVar8))) { LAB_0047141e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,(uint)pEVar9); } if (npc->_variant == 2) { fVar11 = 1.6; } else { fVar11 = 1.4; } npc->_aiFloat = fVar11; local_6c = (EntityPtr *)(fVar11 * 0.83); targetPos = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_34 + 8),0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,(float)local_6c,900,1); bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"IdleHead",1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } if (((((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (uVar5 = Random(), uVar5 % 0x3c == 0)) && ((npc->_variant != 2 || (uVar5 = Random(), (uVar5 & 3) == 0)))) { Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,1.0); npc->_stateFrame = 0; npc->_state = 8; } break; case 8: fVar11 = (npc->_aiFloat + 0.04) * 0.98; npc->_aiFloat = fVar11; if (npc->_variant == 2) { fVar11 = fVar11 + 0.2; } fVar11 = fVar11 * 0.83; bVar3 = 1; iVar6 = 900; targetPos = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_34 + 8),0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,fVar11,iVar6,bVar3); local_28 = (EntityPtr *)&DAT_0000000f; local_34._8_4_ = 1.12104e-44; walkAnimV = (void *)0x6b6c6157; builtin_strncpy(local_38,"Vert",4); local_34[0] = '\0'; local_40 = (EntityPtr *)0xf; local_44 = 1.12104e-44; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; fStack_50 = (float)0x69726f48; fStack_4c = (float)((uint)fStack_4c & 0xffffff00); local_14 = 3; Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_68 + 0x14),(std_string *)&walkAnimV,0.1); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < local_40) { uVar5 = (int)local_40 + 1; pvVar8 = (void *)local_68._20_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(local_68._20_4_ + -4); uVar5 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)pvVar8))) goto LAB_0047167f; } operator_delete(pvVar8,uVar5); } local_14 = 0xffffffff; local_44 = 0.0; local_40 = (EntityPtr *)0xf; local_68._20_4_ = local_68._20_4_ & 0xffffff00; if ((EntityPtr *)&DAT_0000000f < local_28) { pEVar9 = (EntityPtr *)&local_28->field_0x1; pvVar8 = walkAnimV; if ((undefined1 *)0xfff < pEVar9) { pvVar8 = *(void **)((int)walkAnimV + -4); pEVar9 = local_28 + 9; if (0x1f < (uint)((int)walkAnimV + (-4 - (int)pvVar8))) { LAB_0047167f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,(uint)pEVar9); } ANM2::PlayOverlay(&npc->_sprite,(byte *)"RageBody",0); npc->_stateFrame = npc->_stateFrame + 1; if (100 < npc->_stateFrame) { npc->_stateFrame = 0; npc->_state = (npc->_variant == 2) + 3; } } pEVar9 = &npc->_child; if (npc->_child != (EntityPtr)0x0) { iVar6 = __RTDynamicCast(npc->_child,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4); if (iVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } if (*(int *)((int)*pEVar9 + 0x3bc) == 0) { if (*pEVar9 != (EntityPtr)0x0) { local_6c = pEVar9; std::multiset::erase(&local_6c); } *pEVar9 = (EntityPtr)0x0; } } if (npc->_subtype == 1) { ExceptionList = local_1c; return; } fStack_4c = (float)((uint)fStack_4c & 0xffffff00); local_48 = (void *)0x0; local_44 = 0.0; local_40 = (EntityPtr *)0x0; local_14 = 4; if (npc->_variant == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_34,0x4f,-1,-1,0,0) ; local_44 = (float)local_34._8_4_; fStack_4c = (float)CONCAT31(fStack_4c._1_3_,1); local_48 = (void *)local_34._4_4_; local_40 = local_28; if (local_34[0] == '\0') { local_14._0_1_ = 5; tracked_alloc(1,(void *)local_34._4_4_,0); local_14 = CONCAT31(local_14._1_3_,4); } } if ((*pEVar9 == (EntityPtr)0x0) || (npc->_dead != 0)) { if ((npc->_variant == 0) && (uVar4 = 0, local_40 != (EntityPtr *)0x0)) { do { segmentToRemove = (int *)__RTDynamicCast(*(undefined4 *)((int)local_48 + uVar4 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if ((segmentToRemove[0xb] == 0x14) && ((Entity_NPC *)segmentToRemove[0xef] == npc)) { (**(code **)(*segmentToRemove + 0x28))(); } uVar4 = uVar4 + 1; } while (uVar4 < local_40); } goto LAB_00471c39; } iVar6 = __RTDynamicCast(*pEVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4); if (iVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } childOffsetY = (npc->_pos).y - *(float *)((int)*pEVar9 + 0x340); childOffsetX = (npc->_pos).x - *(float *)((int)*pEVar9 + 0x33c); local_70 = sqrtf(childOffsetY * childOffsetY + childOffsetX * childOffsetX); if (npc->_variant == 1) { if (0.0 < local_70) { if ((*pEVar9 != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(*pEVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } child = *pEVar9; if (*(Entity_NPC **)((int)child + 0x3bc) == npc) { if ((child != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(child,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } child = *pEVar9; fVar11 = *(float *)((int)child + 0x36c); if (fVar11 != 0.0) { fVar10 = (((local_70 - 26.0) * childOffsetY * 0.1) / local_70) * *(float *)((int)child + 0x39c); *(float *)((int)child + 0x360) = ((((local_70 - 26.0) * childOffsetX * 0.1) / local_70) * *(float *)((int)child + 0x39c)) / fVar11 + *(float *)((int)child + 0x360); goto LAB_00471a68; } } } } else if (76.0 < local_70) { if ((*pEVar9 != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(*pEVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } child = *pEVar9; fVar11 = *(float *)((int)child + 0x36c); if (fVar11 != 0.0) { fVar10 = *(float *)((int)child + 0x39c) * (((local_70 - 76.0) * childOffsetY * 0.01) / local_70); *(float *)((int)child + 0x360) = (*(float *)((int)child + 0x39c) * (((local_70 - 76.0) * childOffsetX * 0.01) / local_70)) / fVar11 + *(float *)((int)child + 0x360); LAB_00471a68: *(float *)((int)child + 0x364) = fVar10 / fVar11 + *(float *)((int)child + 0x364); } } if (npc->_variant == 0) { segmentIndex = 0.0; local_6c = (EntityPtr *)0x0; if (local_40 != (EntityPtr *)0x0) { do { iVar6 = __RTDynamicCast(*(undefined4 *)((int)local_48 + (int)local_6c * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (((iVar6 != 0) && (*(int *)(iVar6 + 0x2c) == 0x14)) && (*(Entity_NPC **)(iVar6 + 0x3bc) == npc)) { local_28 = (EntityPtr *)0x0; fVar11 = (16.0 - segmentIndex) / 18.0; ppEVar7 = &cordSlack; if (196.0 - local_70 <= 0.0) { ppEVar7 = &local_28; } cordSlack = (EntityPtr *)(196.0 - local_70); pEVar9 = *ppEVar7; fVar10 = ABS(segmentIndex - 9.0) * 0.5; *(float *)(iVar6 + 0x33c) = ((npc->_pos).x - fVar11 * childOffsetX) - 6.0; *(float *)(iVar6 + 0x340) = (((npc->_pos).y - fVar11 * childOffsetY) - 20.0) + (16.0 - fVar10 * fVar10) * ((float)pEVar9 / 196.0) * 1.5 + segmentIndex * 0.8; segmentLayer = ANM2::GetLayer((ANM2 *)(iVar6 + 0x48),(byte *)0x0); segmentIndex = segmentIndex + 1.0; (segmentLayer->_pos).x = 0.0; (segmentLayer->_pos).y = -8.0; *(undefined1 *)(iVar6 + 0x171) = 1; } local_6c = (EntityPtr *)&local_6c->field_0x1; } while (local_6c < local_40); } } LAB_00471c39: if (fStack_4c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_48 != (void *)0x0) { uVar4 = *(uint *)((int)local_48 + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); free((uint *)((int)local_48 + -4)); } } ExceptionList = local_1c; return; } //@@ 00471cc0 NpcAI::ENTITY_GEMINI_baby /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dispatcher case after MOMS_HEART (type 79 Gemini) for variant 10..19 (Contusion/Suture/Blighted Ovum babies): Shoot/Walk01, ParentNPC, FireProjectiles, Entity_Laser::ShootAngle; variant<10 goes to FUN_00471050 */ void __fastcall NpcAI::ENTITY_GEMINI_baby(Entity_NPC *npc) { byte bVar1; Vector *vecResult; Entity *target; EntityRef *sourceRef; undefined4 **ppuVar2; uint uVar3; Vector *pVVar4; ColorMod *tmpColor; Entity_Laser *laser; Entity_NPC *parentNpc; int3 extraout_var; byte *pbVar5; int id; byte *pbVar6; byte *pbVar7; bool isLess; float fVar8; undefined1 auVar9 [12]; undefined4 *puVar10; float fVar11; undefined4 *puVar12; undefined4 local_198 [11]; undefined4 local_16c [11]; undefined1 local_140 [8]; float fStack_138; float fStack_134; float local_130; float fStack_12c; float fStack_128; float fStack_124; float local_120; float local_11c; float local_118; Vector tmpVec; Vector local_10c; Vector scratchVec; undefined4 *toTargetY; Vector local_f8; undefined4 *local_f0; undefined4 *local_ec; ProjectileParams projParams; Color bloodColor; float stackCookie; qword entityFlags; undefined4 flagsHigh; EntityPtr parent; EntityPtr *parentRef; float speedMultiplier; stackCookie = (float)(__security_cookie ^ (uint)((&bloodColor)[1]._tint + 1)); if (npc->_state == 0) { npc->_state = 4; if (npc->_variant == 0xc) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; parent = npc->_parent; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_isInvicible = 1; npc->_isBoss = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; if (parent != (EntityPtr)0x0) { if (*(int *)((int)parent + 0x3c0) != 0) { local_ec = (undefined4 *)((int)parent + 0x3c0); std::multiset::erase(&local_ec); } *(undefined4 *)((int)parent + 0x3c0) = 0; } if (&npc->_splatColor == (ColorMod *)local_16c) { return; } (npc->_splatColor)._offset[0] = 0.8; (npc->_splatColor)._offset[1] = 0.8; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.3; (npc->_splatColor)._offset[2] = 0.8; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } if (npc->_variant != 0xb) { return; } if (&npc->_splatColor == (ColorMod *)local_198) { return; } (npc->_splatColor)._tint[0] = 0.1; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; return; } npc->_entityGridCollisionClass = 3; vecResult = Entity_NPC::CalcTargetPosition(npc,&local_f8,0.0); pVVar4 = &npc->_pos; scratchVec.x = vecResult->x - pVVar4->x; scratchVec.y = vecResult->y - (npc->_pos).y; toTargetY = (undefined4 *)scratchVec.y; local_f0 = (undefined4 *)scratchVec.x; target = Entity_NPC::GetPlayerTarget(npc); parent = npc->_parent; local_10c.y = (target->_pos).x - pVVar4->x; local_f8.y = (target->_pos).y - (npc->_pos).y; local_f8.x = local_10c.y; local_ec = (undefined4 *)local_f8.y; if (npc->_variant == 0xc) { if ((parent == (EntityPtr)0x0) || (*(char *)((int)parent + 0x173) != '\0')) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_140 + 4)); (**(code **)(*(int *)npc + 0x24))(sourceRef); } vecResult = Room::GetClampedPositionImpl(g_game->_room,&tmpVec,pVVar4,30.0,0.0,10.0,0.0); pVVar4->x = vecResult->x; (npc->_pos).y = vecResult->y; if (npc->_state == 4) { if (npc->_stateFrame < 0xa0) { fVar8 = sqrtf((float)toTargetY * (float)toTargetY + (float)local_f0 * (float)local_f0); if (fVar8 < 300.0) { vecResult = Vector::Normalized(&scratchVec,&tmpVec); fVar8 = npc->_friction; fVar11 = vecResult->y; if (fVar8 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = (vecResult->x * 0.65 * speedMultiplier) / fVar8 + (npc->_velocity).x; (npc->_velocity).y = (fVar11 * 0.65 * 0.9 * speedMultiplier) / fVar8 + (npc->_velocity).y; } } } else { toTargetY = (undefined4 *)((float)toTargetY * 0.01); local_f0 = (undefined4 *)0x3e4ccccd; auVar9 = ZEXT812(0xbe4ccccd); ppuVar2 = &toTargetY; if (0.2 <= (float)toTargetY) { ppuVar2 = &local_f0; } if (auVar9._0_4_ < (float)*ppuVar2) { auVar9._4_8_ = auVar9._4_8_; auVar9._0_4_ = *ppuVar2; } (npc->_velocity).y = (auVar9._0_4_ * npc->_speedMultiplier) / npc->_friction + (npc->_velocity).y; } uVar3 = Random(); if ((uVar3 % 0x1e == 0) && (npc->_stateFrame - 0x3dU < 99)) { npc->_stateFrame = 0xa0; } else { uVar3 = Random(); if ((uVar3 % 0x28 == 0) && (0xf0 < npc->_stateFrame)) { npc->_stateFrame = 0; } } ANM2::Play(&npc->_sprite,(byte *)"Walk01",0); entityFlags = npc->_flags; (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; if ((((((entityFlags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (0x28 < npc->_stateFrame)) && ((ABS(local_10c.y) < 20.0 || (ABS((float)local_ec) < 20.0)))) && ((fVar8 = sqrtf((float)local_ec * (float)local_ec + local_10c.y * local_10c.y), fVar8 < 300.0 && (bVar1 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),pVVar4), bVar1 != 0)))) { pVVar4 = Vector::ToCardinal(&tmpVec,&local_f8); fVar8 = pVVar4->x; (npc->_v1).x = fVar8; (npc->_v1).y = pVVar4->y; if (ABS(fVar8) <= 0.0) { (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; npc->_stateFrame = npc->_stateFrame + 1; } else { npc->_state = 8; npc->_stateFrame = 0; bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } fVar8 = (npc->_v1).x; (npc->_sprite)._flipX = fVar8 < 0.0; tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); fVar8 = atan2f((npc->_v1).y,fVar8); local_10c.y = fVar8 * 57.295776 * 0.017453292; scratchVec.x = cos(local_10c.y); scratchVec.y = sin(local_10c.y); local_f8.x = 0.0; local_f8.y = -40.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_f8,&scratchVec,0x12,tmpColor,2.0); npc->_stateFrame = npc->_stateFrame + 1; } goto LAB_00472c00; } } else if (npc->_state == 8) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { scratchVec.x = 0.0; scratchVec.y = -20.0; fVar8 = atan2f((npc->_v1).y,(npc->_v1).x); local_f8.y = (npc->_pos).y - 20.0; local_f8.x = (npc->_v1).x * 10.0 + pVVar4->x; laser = Entity_Laser::ShootAngle (1,&local_f8,fVar8 * 57.295776,0x23,&scratchVec,(Entity *)npc,0); laser->_renderDepthOffset = 3000.0; laser->_scale = 0.8; Entity_Laser::ResetSpriteScale(laser); (**(code **)(*(int *)laser + 0xc))(); npc->_stateFrame = npc->_stateFrame + 1; goto LAB_00472c00; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00472424; } npc->_state = 4; npc->_stateFrame = 0; } LAB_00472424: npc->_stateFrame = npc->_stateFrame + 1; goto LAB_00472c00; } if ((parent == (EntityPtr)0x0) || ((npc->_variant == 0xb && (parentNpc = Entity_NPC::ParentNPC(npc), parentNpc->_health <= 60.0 && parentNpc->_health != 60.0)))) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) { LAB_00472940: pbVar5 = (npc->_sprite)._animState._animData; if ((pbVar5 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar6 = &DAT_00b1e114; do { bVar1 = *pbVar5; isLess = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_00472980: uVar3 = -(uint)isLess | 1; goto LAB_00472985; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; isLess = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_00472980; pbVar5 = pbVar5 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00472985: if (uVar3 == 0) goto LAB_00472a35; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { pbVar5 = &s_empty; } else if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar6 = &DAT_00b1e11c; do { bVar1 = *pbVar5; isLess = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_004729d7: uVar3 = -(uint)isLess | 1; goto LAB_004729dc; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; isLess = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_004729d7; pbVar5 = pbVar5 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004729dc: if (uVar3 == 0) goto LAB_00472a35; } id = 0x3c3; if (npc->_variant != 0xb) { id = 0x19; } Entity_NPC::PlaySound(npc,id,1.0,2,0,1.0); bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e11c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar6 = &DAT_00b1e11c; do { bVar1 = *pbVar5; isLess = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_004728b0: uVar3 = -(uint)isLess | 1; goto LAB_004728b5; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; isLess = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_004728b0; pbVar5 = pbVar5 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004728b5: if (uVar3 != 0) goto LAB_00472940; pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_00472919: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e114,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar6 = *(byte **)pbVar5; } pbVar7 = &DAT_00b1e114; do { bVar1 = *pbVar6; isLess = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_004728f3: uVar3 = -(uint)isLess | 1; goto LAB_004728f8; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_004728f3; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004728f8: if ((uVar3 != 0) || ((pbVar5[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00472919; } } LAB_00472a35: pVVar4 = Room::GetClampedPositionImpl(g_game->_room,&tmpVec,&npc->_pos,30.0,0.0,10.0,0.0); (npc->_pos).x = pVVar4->x; (npc->_pos).y = pVVar4->y; parentRef = &npc->_parent; if (*parentRef != (EntityPtr)0x0) { local_f8.y = (float)parentRef; std::multiset::erase(&local_f8.y); *parentRef = (EntityPtr)0x0; } fVar8 = npc->_speedMultiplier; fVar11 = 1.1764705; if (fVar8 != 1.0) { fVar11 = 1.1764705 / ((fVar8 + 1.1764705) - fVar8 * 1.1764705); } local_10c.y = fVar11 * (npc->_velocity).x; (npc->_velocity).y = fVar11 * (npc->_velocity).y; (npc->_velocity).x = local_10c.y; local_f8.y = (float)local_f0; local_ec = toTargetY; fVar8 = sqrtf((float)local_f0 * (float)local_f0 + (float)toTargetY * (float)toTargetY); if (0.0 < fVar8) { local_ec = (undefined4 *)((1.0 / fVar8) * (float)local_ec); local_f8.y = (1.0 / fVar8) * (float)local_f0; } fVar8 = npc->_friction; if (fVar8 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).x = (local_f8.y * 0.5 * fVar11) / fVar8 + local_10c.y; (npc->_velocity).y = ((float)local_ec * 0.5 * fVar11) / fVar8 + (npc->_velocity).y; } npc->_mass = 8.0; } else { local_10c.y = (float)local_f0; local_ec = toTargetY; fVar8 = sqrtf((float)local_f0 * (float)local_f0 + (float)toTargetY * (float)toTargetY); if (fVar8 <= 0.0) { puVar10 = (undefined4 *)local_10c.y; puVar12 = local_ec; } else { puVar10 = (undefined4 *)((1.0 / fVar8) * (float)local_f0); puVar12 = (undefined4 *)((1.0 / fVar8) * (float)local_ec); } fVar8 = npc->_friction; if (fVar8 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).y = (fVar11 * (float)puVar12 * 0.25) / fVar8 + (npc->_velocity).y; (npc->_velocity).x = (fVar11 * (float)puVar10 * 0.25) / fVar8 + (npc->_velocity).x; } if (npc->_state == 4) { if ((npc->_projectileCooldown < 1) && (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,300.0,0,7), bVar1 != 0)) { npc->_state = 8; bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else if (npc->_state == 8) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingSpeedModifier = 3.0; projParams.HeightModifier = -15.0; projParams.VelocityMulti = 1.2; if (npc->_variant == 0xb) { projParams.Variant = 0xc; } else if ((npc->_variant == 10) && (npc->_bosscoloridx == 1)) { projParams.BulletFlags._0_4_ = 1; projParams.BulletFlags._4_4_ = 0; } target = Entity_NPC::GetPlayerTarget(npc); puVar12 = (undefined4 *)((target->_pos).x - pVVar4->x); puVar10 = (undefined4 *)((target->_pos).y - (npc->_pos).y); local_10c.y = (float)puVar12; scratchVec.x = (float)puVar12; scratchVec.y = (float)puVar10; local_f8.y = (float)puVar10; bVar1 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar1) == 0 || extraout_var < 0) { local_ec = (undefined4 *)0x40e00000; } else { local_ec = (undefined4 *)0x41200000; } fVar8 = sqrtf((float)puVar10 * (float)puVar10 + (float)puVar12 * (float)puVar12); if (0.0 < fVar8) { scratchVec.x = local_10c.y * ((float)local_ec / fVar8); scratchVec.y = local_f8.y * ((float)local_ec / fVar8); } Entity_NPC::FireProjectiles(npc,pVVar4,&scratchVec,0,&projParams); Color::Color(&bloodColor); fVar8 = 0.4; if (npc->_variant == 0xb) { tmpColor = (ColorMod *)Color::Color(0x3f800000); LAB_004727a1: Color::operator_assign(&bloodColor,tmpColor); } else if ((npc->_variant == 10) && (npc->_bosscoloridx == 1)) { tmpColor = (ColorMod *)local_140; local_140._0_4_ = 1.0; local_140._4_4_ = 1.0; fStack_138 = 1.0; fStack_134 = 0.6; local_120 = 0.26; local_130 = 0.8; fStack_12c = 0.15; fStack_128 = 1.0; fStack_124 = 1.0; local_11c = 0.05; local_118 = 0.4; goto LAB_004727a1; } local_f8.x = (npc->_velocity).x * fVar8; local_f8.y = (npc->_velocity).y * fVar8; if ((npc->_sprite)._flipX == 0) { local_10c.x = 7.0; } else { local_10c.x = -7.0; } local_10c.y = (float)&DAT_c1c80000; spawn_blood_explosion(2,pVVar4,&local_10c,(ColorMod *)&bloodColor,&local_f8); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Walk01",0); npc->_state = 4; npc->_projectileCooldown = 0x23; } } } if (ABS((float)toTargetY) < ABS((float)local_f0)) { (npc->_sprite)._flipX = (float)local_f0 < 0.0; } LAB_00472c00: if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } return; } //@@ 00472c40 NpcAI::ENTITY_BLASTOCYST_BIG /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 74 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BLASTOCYST_BIG(Entity_NPC *npc) { void **ppvVar1; byte bVar2; Vector *pVVar3; LayerState *layer; uint rngResult; ColorMod *color; int iVar4; ColorMod *color_00; ProjectileParams *params; ColorMod *color_01; ColorMod *color_02; ColorMod *color_03; ColorMod *color_04; Entity *poof; ANM2 *npcSprite; Sprite *sprite; float fVar5; undefined1 auStack_120 [7]; byte isFlipX; float local_118; Entity *local_114; Vector scratchVec; Vector local_108; Vector local_100; float splitOffsetX; Vector local_f4; Vector toTarget; Color local_e4; ProjectileParams projParams; uint local_c; undefined4 flagsHigh; Game *room; float speedMult; float v1Y; local_c = __security_cookie ^ (uint)auStack_120; if (npc->_state == 0) { npc->_state = 3; if (npc->_type != 0x4a) { return; } if (*(int *)((int)g_game->_room + 8) != 5) { return; } if (*(int *)((int)g_game->_room + 0x1bb0) != 0x10) { return; } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; ANM2::Play(&npc->_sprite,&DAT_00b1e0e4,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(npc->_sprite)._animState, *(int *)((int)(npc->_sprite)._animState._animData + 0x30) + -1); } npc->_stateFrame = 1; npc->_state = 2; npc->_entityCollisionClass = 0; return; } npc->_friction = npc->_friction * 0.8; pVVar3 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); fVar5 = (npc->_velocity).x; sprite = (Sprite *)&npc->_sprite; toTarget.x = pVVar3->x - (npc->_pos).x; local_118 = pVVar3->y - (npc->_pos).y; local_100.x = (float)sprite; toTarget.y = local_118; if (ABS((npc->_velocity).y) < ABS(fVar5)) { isFlipX = fVar5 < 0.0; (npc->_sprite)._flipX = isFlipX; layer = ANM2::GetLayer((ANM2 *)sprite,(byte *)0x0); layer->_flipX = isFlipX; isFlipX = (npc->_sprite)._flipX; layer = ANM2::GetLayer((ANM2 *)sprite,&DAT_00000004); layer->_flipX = isFlipX; } iVar4 = npc->_type; if (iVar4 != 0x4a) { if (iVar4 != 0x4b) { if (iVar4 == 0x4c) { npc->_friction = npc->_friction * 0.9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_state == 0x10) { npc->_dead = 1; npc->_visible = 0; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar2 == 0) || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x2000000000000000), bVar2 == 0)) { rngResult = Random(); local_114 = Game::SpawnEx(g_game,0x4d,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0, rngResult,0); flagsHigh = *(undefined4 *)((int)&local_114->_flags + 4); *(uint *)&local_114->_flags = (uint)local_114->_flags & 0xfffffffb; *(undefined4 *)((int)&local_114->_flags + 4) = flagsHigh; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { local_114->_health = 5.0; local_114->_maxHitPoints = 5.0; } } Entity::BloodExplode((Entity *)npc); } else { npc->_state = 3; } } if ((npc->_dead != 0) && (npc->_state != 0x10)) { Color::Color(&local_e4); scratchVec.x = 0.0; scratchVec.y = -10.0; local_114 = spawn_blood_explosion(3,&npc->_pos,&scratchVec,color_04,&g_vectorZero); (**(code **)(*(int *)local_114 + 0xc))(); if ((local_114->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(local_114->_sprite)._animState,5.0); } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_state = 0x10; npc->_stateFrame = 1; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } switch(npc->_state) { case 3: npc->_stateFrame = 0; ANM2::Play((ANM2 *)sprite,s_Idle,0); rngResult = Random(); if (((rngResult & 1) == 0) || ((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar2 != 0 && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)))) { npc->_state = 4; (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; } else { npc->_state = 8; } break; case 4: if (npc->_stateFrame == 1) { ANM2::Play((ANM2 *)sprite,s_Walk,0); Entity_NPC::PlaySound(npc,0x3dd,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered(sprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,0.6,2,0,1.0); } bVar2 = ANM2::WasEventTriggered((ANM2 *)sprite,s_Land); if (bVar2 != 0) { npc->_friction = npc->_friction * 0.6; } break; case 8: if (npc->_stateFrame == 1) { Entity_NPC::PlaySound(npc,0x3dd,1.0,2,0,1.0); bVar2 = ANM2::SetAnimation((ANM2 *)sprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; sprite = (Sprite *)local_100.x; } } bVar2 = Sprite::IsEventTriggered(sprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); rngResult = Random(); poof = Game::SpawnEx(g_game,1000,0x10,&npc->_pos,&g_vectorZero,(Entity *)npc,3,rngResult ,0); fVar5 = g_vectorOne.y * 0.75; (poof->_sprite)._scale.x = g_vectorOne.x * 0.75; (poof->_sprite)._scale.y = fVar5; rngResult = Random(); (poof->_sprite)._flipX = ~(byte)rngResult & 1; (**(code **)(*(int *)poof + 0xc))(); ProjectileParams::ProjectileParams(&projParams); projParams.Scale = 1.5; projParams.FallingAccelModifier = -0.04; scratchVec.x = 10.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,6,&projParams); } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; break; case 0x10: if ((npc->_stateFrame == 1) && (bVar2 = ANM2::SetAnimation((ANM2 *)sprite,(byte *)"Death",1), bVar2 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } if (npc->_state != 8) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } } goto LAB_0047415c; } npcSprite = &npc->_sprite; npc->_friction = npc->_friction * 0.9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_state == 0x10) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar2 == 0) || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x2000000000000000), bVar2 == 0)) { rngResult = RNG::Next(&npc->_dropRNG); RandomVector(&local_108,rngResult); rngResult = RNG::Next(&npc->_dropRNG); local_f4.x = local_108.x * -12.0; splitOffsetX = local_108.x * 12.0; local_f4.y = local_108.y * -12.0; local_100.x = local_108.y * 12.0; scratchVec.x = (npc->_pos).x - splitOffsetX; scratchVec.y = (npc->_pos).y - local_100.x; local_114 = Game::SpawnEx(g_game,0x4c,0,&scratchVec,&local_f4,(Entity *)npc,0,rngResult,0) ; flagsHigh = *(undefined4 *)((int)&local_114->_flags + 4); *(uint *)&local_114->_flags = (uint)local_114->_flags & 0xfffffffb; *(undefined4 *)((int)&local_114->_flags + 4) = flagsHigh; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { local_114->_health = 20.0; local_114->_maxHitPoints = 20.0; } rngResult = RNG::Next(&npc->_dropRNG); scratchVec.x = splitOffsetX; local_108.x = splitOffsetX + (npc->_pos).x; scratchVec.y = local_100.x; local_108.y = local_100.x + (npc->_pos).y; local_114 = Game::SpawnEx(g_game,0x4c,0,&local_108,&scratchVec,(Entity *)npc,0,rngResult,0 ); flagsHigh = *(undefined4 *)((int)&local_114->_flags + 4); *(uint *)&local_114->_flags = (uint)local_114->_flags & 0xfffffffb; *(undefined4 *)((int)&local_114->_flags + 4) = flagsHigh; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { local_114->_health = 20.0; local_114->_maxHitPoints = 20.0; } } npc->_dead = 1; Color::Color(&local_e4); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,color_02,0.75); Entity::BloodExplode((Entity *)npc); } else { npc->_state = 3; } } if ((npc->_dead != 0) && (npc->_state != 0x10)) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_state = 0x10; npc->_stateFrame = 1; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } switch(npc->_state) { case 3: npc->_stateFrame = 0; ANM2::Play(npcSprite,s_Idle,0); fVar5 = sqrtf(toTarget.x * toTarget.x + local_118 * local_118); if (250.0 <= fVar5) { pVVar3 = MusicManager::RandomVector(&scratchVec); fVar5 = pVVar3->y; (npc->_v1).x = pVVar3->x * 1.5; (npc->_v1).y = fVar5 * 1.5; npc->_state = 4; break; } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar2 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) goto LAB_00473997; goto LAB_00473157; case 4: if (npc->_stateFrame == 1) { bVar2 = ANM2::SetAnimation(npcSprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3dd,1.0,2,0,1.0); } npcSprite = &npc->_sprite; bVar2 = Sprite::IsEventTriggered((Sprite *)npcSprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,0.8,2,0,1.0); } bVar2 = ANM2::WasEventTriggered(npcSprite,s_Jump); if (((bVar2 != 0) && (bVar2 = ANM2::WasEventTriggered(npcSprite,s_Land), bVar2 == 0)) && (fVar5 = npc->_friction, fVar5 != 0.0)) { speedMult = npc->_speedMultiplier; v1Y = (npc->_v1).y; (npc->_velocity).x = (speedMult * (npc->_v1).x) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (v1Y * speedMult) / fVar5 + (npc->_velocity).y; } break; case 8: if (npc->_stateFrame == 1) { bVar2 = ANM2::SetAnimation(npcSprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3dd,1.0,2,0,1.0); } npcSprite = &npc->_sprite; bVar2 = Sprite::IsEventTriggered((Sprite *)npcSprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,0.8,2,0,1.0); Color::Color(&local_e4); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,color_03,0.75); ProjectileParams::ProjectileParams(&projParams); rngResult = Random(); projParams.CircleAngle = 0.0; if ((rngResult & 1) != 0) { projParams.CircleAngle = 0.5235988; } projParams.Scale = 1.5; projParams.FallingAccelModifier = -0.04; scratchVec.x = 10.0; scratchVec.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projParams); } bVar2 = ANM2::WasEventTriggered(npcSprite,s_Jump); if (((bVar2 != 0) && (bVar2 = ANM2::WasEventTriggered(npcSprite,s_Land), bVar2 == 0)) && (fVar5 = npc->_friction, fVar5 != 0.0)) { speedMult = npc->_speedMultiplier; v1Y = (npc->_v1).y; (npc->_velocity).x = (speedMult * (npc->_v1).x) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (v1Y * speedMult) / fVar5 + (npc->_velocity).y; } break; case 0x10: goto LAB_00473c94; } goto LAB_0047415c; } npcSprite = &npc->_sprite; npc->_friction = npc->_friction * 0.9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_state == 6) { npc->_state = 7; npc->_stateFrame = 1; } else if (npc->_state == 0x10) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar2 == 0) || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x2000000000000000), bVar2 == 0)) { rngResult = RNG::Next(&npc->_dropRNG); RandomVector(&local_f4,rngResult); rngResult = RNG::Next(&npc->_dropRNG); local_100.x = local_f4.x * -12.0; splitOffsetX = local_f4.x * 20.0; local_114 = (Entity *)(local_f4.y * 20.0); local_100.y = local_f4.y * -12.0; local_108.x = (npc->_pos).x - splitOffsetX; local_108.y = (npc->_pos).y - (float)local_114; local_100.x = (float)Game::SpawnEx(g_game,0x4b,0,&local_108,&local_100,(Entity *)npc,0, rngResult,0); flagsHigh = *(undefined4 *)((int)&((Entity *)local_100.x)->_flags + 4); *(uint *)&((Entity *)local_100.x)->_flags = (uint)((Entity *)local_100.x)->_flags & 0xfffffffb; *(undefined4 *)((int)&((Entity *)local_100.x)->_flags + 4) = flagsHigh; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { *(float *)((int)local_100.x + 0x380) = 30.0; *(float *)((int)local_100.x + 900) = 30.0; } rngResult = RNG::Next(&npc->_dropRNG); local_108.x = local_f4.x * 12.0; local_108.y = local_f4.y * 12.0; local_100.x = splitOffsetX + (npc->_pos).x; local_100.y = (float)local_114 + (npc->_pos).y; local_114 = Game::SpawnEx(g_game,0x4b,0,&local_100,&local_108,(Entity *)npc,0,rngResult,0); flagsHigh = *(undefined4 *)((int)&local_114->_flags + 4); *(uint *)&local_114->_flags = (uint)local_114->_flags & 0xfffffffb; *(undefined4 *)((int)&local_114->_flags + 4) = flagsHigh; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { local_114->_health = 30.0; local_114->_maxHitPoints = 30.0; } } npc->_dead = 1; Color::Color(&local_e4); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,color,1.0); Entity::BloodExplode((Entity *)npc); } else { npc->_state = 3; } } if ((npc->_dead != 0) && (npc->_state != 0x10)) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_state = 0x10; npc->_stateFrame = 1; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } switch(npc->_state) { case 2: case 7: if ((npc->_stateFrame == 1) && (bVar2 = ANM2::SetAnimation(npcSprite,(byte *)"JumpDown",1), bVar2 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } bVar2 = ANM2::WasEventTriggered(&npc->_sprite,s_Land); if (bVar2 == 0) { fVar5 = npc->_friction; if (fVar5 != 0.0) { speedMult = npc->_speedMultiplier; v1Y = (npc->_v1).y; (npc->_velocity).x = (speedMult * (npc->_v1).x) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (v1Y * speedMult) / fVar5 + (npc->_velocity).y; } iVar4 = 0; } else { iVar4 = 4; } npc->_entityCollisionClass = iVar4; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Land); if (bVar2 != 0) { ShockwaveParams::ShockwaveParams(&local_e4); pVVar3 = &npc->_pos; local_e4._tint[0] = pVVar3->x; local_e4._tint[1] = (npc->_pos).y; room = g_game->_room; local_e4._colorize[2] = 1.82169e-44; local_e4._colorize[0] = 0.025; local_e4._tint[3] = 0.04; ppvVar1 = &room->_roomList[0x9d].Data; *ppvVar1 = (void *)((int)*ppvVar1 + 1); rngResult = (uint)room->_roomList[0x9d].Data & 0x80000001; if ((int)rngResult < 0) { rngResult = (rngResult - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(room,rngResult,&local_e4); Color::Color(&local_e4); Entity::MakeBloodPoof((Entity *)npc,pVVar3,color_00,1.0); Entity_NPC::PlaySound(npc,0x30,1.2,2,0,1.0); if (npc->_state == 7) { ProjectileParams::ProjectileParams(&projParams); params = ProjectileParams::ProjectileParams(&projParams); local_108.x = 12.0; local_108.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar3,&local_108,8,params); } } break; case 3: ANM2::Play(npcSprite,s_Idle,0); npc->_stateFrame = 0; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar2 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { fVar5 = toTarget.x * toTarget.x + local_118 * local_118; if ((fVar5 < 32400.0) || ((fVar5 < 62500.0 && (rngResult = Random(), rngResult % 5 != 0)))) { LAB_00473997: rngResult = Random(); if ((rngResult & 1) != 0) goto LAB_00473157; local_118 = 0.4; npc->_state = 8; } else { local_118 = 3.0; npc->_state = 6; } } else { LAB_00473157: local_118 = 1.5; npc->_state = 4; } pVVar3 = Vector::Normalized(&toTarget,&scratchVec); fVar5 = pVVar3->y; (npc->_v1).x = local_118 * pVVar3->x; (npc->_v1).y = local_118 * fVar5; break; case 4: if (npc->_stateFrame == 1) { bVar2 = ANM2::SetAnimation(npcSprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3dc,1.0,2,0,1.0); } npcSprite = &npc->_sprite; bVar2 = Sprite::IsEventTriggered((Sprite *)npcSprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,0.8,2,0,1.0); } bVar2 = ANM2::WasEventTriggered(npcSprite,s_Jump); if (((bVar2 != 0) && (bVar2 = ANM2::WasEventTriggered(npcSprite,s_Land), bVar2 == 0)) && (fVar5 = npc->_friction, fVar5 != 0.0)) { speedMult = npc->_speedMultiplier; (npc->_velocity).x = (speedMult * (npc->_v1).x) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (speedMult * (npc->_v1).y) / fVar5 + (npc->_velocity).y; } break; case 6: if (npc->_stateFrame == 1) { bVar2 = ANM2::SetAnimation(npcSprite,&DAT_00b1e0e4,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3db,1.0,2,0,1.0); } bVar2 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); fVar5 = npc->_friction; if (bVar2 == 0) { npc->_friction = fVar5 * 0.6; } else if (fVar5 != 0.0) { speedMult = npc->_speedMultiplier; (npc->_velocity).x = (speedMult * (npc->_v1).x) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (speedMult * (npc->_v1).y) / fVar5 + (npc->_velocity).y; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_entityCollisionClass = 0; } break; case 8: if (npc->_stateFrame == 1) { bVar2 = ANM2::SetAnimation(npcSprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3dc,1.0,2,0,1.0); } npcSprite = &npc->_sprite; bVar2 = Sprite::IsEventTriggered((Sprite *)npcSprite,s_Land); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Color::Color(&local_e4); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,color_01,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.VelocityMulti = 1.2; projParams.FallingSpeedModifier = -2.0; Entity_NPC::FireBossProjectiles(npc,10,&g_vectorZero,2.0,&projParams); } bVar2 = ANM2::WasEventTriggered(npcSprite,s_Jump); if (((bVar2 != 0) && (bVar2 = ANM2::WasEventTriggered(npcSprite,s_Land), bVar2 == 0)) && (fVar5 = npc->_friction, fVar5 != 0.0)) { speedMult = npc->_speedMultiplier; v1Y = (npc->_v1).y; (npc->_velocity).x = (speedMult * (npc->_v1).x) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (v1Y * speedMult) / fVar5 + (npc->_velocity).y; } break; case 0x10: LAB_00473c94: if ((npc->_stateFrame == 1) && (bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Split",1), bVar2 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0047415c: npc->_stateFrame = npc->_stateFrame + 1; return; } //@@ 004741f0 NpcAI::ENTITY_SLOTH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 46 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SLOTH(Entity_NPC *npc) { Vector *pVVar1; float fVar2; Vector targetPos; Vector targetPos_00; byte bVar3; uint uVar4; Entity *tmpEntity; int iVar5; ProjectileParams *params; Entity_Projectile *projectile; uint rngResult; int *creep; void *pvVar6; int iVar7; EntityPtr *parentSlot; undefined1 *puVar8; float dirSign; float fVar9; undefined4 rngResult; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; Vector effectPos; Vector local_138; Vector scratchPos; Vector local_128; Vector local_120; Vector local_118; ProjectileParams projParams; void *horiAnimName; char local_64 [12]; uint local_58; uint local_54; undefined4 effectColor; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; std_string sStack_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; Room *room; puStack_20 = local_64 + 0x60; local_14 = 0xffffffff; puStack_18 = &LAB_00af29a5; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_64 + 0x54); if (npc->_state == 0) { npc->_state = 4; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.3; (npc->_splatColor)._offset[2] = 0.0; return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.75; local_24 = uVar4; tmpEntity = Entity_NPC::GetPlayerTarget(npc); manager = g_manager; pVVar1 = &npc->_pos; local_120.y = (tmpEntity->_pos).x - pVVar1->x; local_118.y = (tmpEntity->_pos).y - (npc->_pos).y; iVar5 = npc->_state; if (iVar5 != 4) { if (iVar5 == 8) { if (npc->_stateFrame == 5) { if (npc->_variant == 2) { Entity_NPC::PlaySound(npc,0xd5,0.7,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; projParams.Scale = 1.2; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_128.x = (tmpEntity->_pos).x; local_128.y = (tmpEntity->_pos).y; Entity_NPC::FireBossProjectiles(npc,3,&local_128,10.0,&projParams); } else if (npc->_variant == 1) { Entity_NPC::PlaySound(npc,0x9f,1.0,2,0,1.0); uVar4 = Random(); if ((uVar4 & 1) == 0) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_128.x = (tmpEntity->_pos).x * 0.5 + (npc->_pos).x * 0.5; local_128.y = (npc->_pos).y * 0.5 + (tmpEntity->_pos).y * 0.5; Room::FindFreePickupSpawnPosition(room,&local_120,&local_128,70.0,0,0,0); targetPos_00.y = local_120.y; targetPos_00.x = local_120.x; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos_00,1,-30.0); } else { local_118.y = 2.8026e-45; do { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_128.x = (tmpEntity->_pos).x * 0.5 + (npc->_pos).x * 0.5; local_128.y = (tmpEntity->_pos).y * 0.5 + (npc->_pos).y * 0.5; Room::FindFreePickupSpawnPosition(room,&local_120,&local_128,70.0,0,0,0); targetPos.y = local_120.y; targetPos.x = local_120.x; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos,0,-30.0); local_118.y = (float)((int)local_118.y + -1); } while (local_118.y != 0.0); } } else { Entity_NPC::PlaySound(npc,0x109,0.8,2,0,1.0); Entity_NPC::PlaySound(npc,0x6c,1.0,2,0,1.0); uVar4 = Random(); bVar3 = (npc->_sprite)._flipX; if (bVar3 == 0) { scratchPos.x = 30.0; local_120.x = 30.0; local_120.y = 0.0; } else { scratchPos.x = -30.0; local_118.x = -30.0; local_118.y = 0.0; } scratchPos.x = scratchPos.x + pVVar1->x; uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngResult = 0; pVVar1 = &local_120; if (bVar3 != 0) { pVVar1 = &local_118; } scratchPos.y = pVVar1->y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,0x17,0,&scratchPos,&g_vectorZero,(Entity *)npc,0,uVar4); iVar5 = __RTDynamicCast(tmpEntity,rngResult,pTVar11,pTVar12,uVar13); *(undefined4 *)(iVar5 + 0xb64) = 8; if ((npc->_sprite)._flipX == 0) { puVar8 = (undefined1 *)0x3f800000; } else { puVar8 = &DAT_bf800000; } *(undefined1 **)(iVar5 + 0xbb0) = puVar8; *(undefined4 *)(iVar5 + 0xbb4) = 0; npc->_entityCollisionClass = 2; } } } else { if (iVar5 != 9) goto LAB_00474dce; iVar5 = npc->_stateFrame; if (npc->_variant == 2) { if (iVar5 - 6U < 9) { if (0.0 <= local_120.y) { dirSign = 1.0; } else { dirSign = (float)&DAT_bf800000; } local_118.y = (float)(iVar5 + -5) * dirSign; rngResult = Random(); uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; scratchPos.x = local_118.y * 25.0 + pVVar1->x; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngResult = 0; scratchPos.y = (npc->_pos).y + 0.0; tmpEntity = Game::Spawn(g_game,1000,0x17,&scratchPos,&g_vectorZero,(Entity *)npc,0, rngResult); creep = (int *)__RTDynamicCast(tmpEntity,rngResult,pTVar11,pTVar12,uVar13,uVar4); local_128.y = local_118.y * 0.07 + 1.6; creep[0x39] = (int)local_128.y; creep[0x3a] = (int)local_128.y; local_120.y = (float)creep; (**(code **)(*creep + 0xc))(); local_138.y = (float)creep[0xd0]; local_138.x = (float)creep[0xcf]; bVar3 = Room::IsPositionInRoom(g_game->_room,&local_138,0.0); if (bVar3 != 0) { local_138.x = local_118.y; local_138.y = 0.0; Vector::Normalized(&local_138,&local_118); uVar4 = Random(); rngResult = Random(); fVar9 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; local_138.y = fVar9 * local_118.y * 10.0; local_138.x = fVar9 * local_118.x * 10.0; effectPos.x = *(float *)((int)local_120.y + 0x33c) - local_118.x * 5.0; effectPos.y = *(float *)((int)local_120.y + 0x340) - local_118.y * 5.0; tmpEntity = Game::Spawn(g_game,1000,2,&effectPos,&local_138,(Entity *)0x0,2,uVar4); uVar4 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar4 = Random(); (tmpEntity->_posOffset).x = 0.0; sStack_3c._buf[0xc] = '\n'; sStack_3c._buf[0xd] = -0x29; sStack_3c._buf[0xe] = -0x5d; sStack_3c._buf[0xf] = '='; sStack_3c._size = 0x3f000000; iVar5 = *(int *)tmpEntity; sStack_3c._capacity = 0x3c23d70a; (tmpEntity->_posOffset).y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * -16.0; local_40 = 0; sStack_3c._buf[0] = '\0'; sStack_3c._buf[1] = '\0'; sStack_3c._buf[2] = '\0'; sStack_3c._buf[3] = '\0'; sStack_3c._buf[4] = '\0'; sStack_3c._buf[5] = '\0'; sStack_3c._buf[6] = '\0'; sStack_3c._buf[7] = '\0'; sStack_3c._buf[8] = '\0'; sStack_3c._buf[9] = '\0'; sStack_3c._buf[10] = '\0'; sStack_3c._buf[0xb] = '\0'; effectColor = 0; uStack_4c = 0; uStack_48 = 0; uStack_44 = 0x3f800000; (**(code **)(iVar5 + 0x3c))(&effectColor,0xffffffff,0xff,0,1); uVar4 = Random(); effectPos.x = *(float *)((int)local_120.y + 0x33c); effectPos.y = *(float *)((int)local_120.y + 0x340); tmpEntity = Game::Spawn(g_game,1000,7,&effectPos,&g_vectorZero,(Entity *)0x0,0,uVar4); sStack_3c._buf[0xc] = '\n'; sStack_3c._buf[0xd] = -0x29; sStack_3c._buf[0xe] = -0x5d; sStack_3c._buf[0xf] = '='; iVar5 = *(int *)tmpEntity; (tmpEntity->_sizeMulti).x = local_128.y; (tmpEntity->_sizeMulti).y = local_128.y; local_40 = 0; sStack_3c._buf[0] = '\0'; sStack_3c._buf[1] = '\0'; sStack_3c._buf[2] = '\0'; sStack_3c._buf[3] = '\0'; sStack_3c._buf[4] = '\0'; sStack_3c._buf[5] = '\0'; sStack_3c._buf[6] = '\0'; sStack_3c._buf[7] = '\0'; sStack_3c._buf[8] = '\0'; sStack_3c._buf[9] = '\0'; sStack_3c._buf[10] = '\0'; sStack_3c._buf[0xb] = '\0'; effectColor = 0; uStack_4c = 0; uStack_48 = 0; uStack_44 = 0x3f000000; sStack_3c._size = 0x3f000000; sStack_3c._capacity = 0x3c23d70a; (**(code **)(iVar5 + 0x3c))(&effectColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); } } else if (iVar5 == 5) { local_120.y = 2.97075e-43; seed_fart_sound_override((int *)&local_120.y); SoundEffects::Play(&manager->_sfxManager,(int)local_120.y,0.7,2,0,1.0,0.0); } } else if (iVar5 == 5) { Entity_NPC::PlaySound(npc,0xd5,0.7,2,0,1.0); local_118.y = (float)(2 - (uint)(npc->_variant != 1)); do { params = ProjectileParams::ProjectileParams(&projParams); tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchPos.x = (tmpEntity->_pos).x; scratchPos.y = (tmpEntity->_pos).y; projectile = Entity_NPC::FireBossProjectiles(npc,1,&scratchPos,10.0,params); fVar9 = projectile->_fallingAccel; fVar2 = (projectile->_velocity).y; rngResult = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 2; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = rngResult; projectile->_fallingAccel = fVar9 - 0.3; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 13.0; (projectile->_velocity).y = fVar2 * 0.55; (projectile->_velocity).x = (projectile->_velocity).x * 0.55; effectColor = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f800000; sStack_3c._buf[0xc] = '\0'; sStack_3c._buf[0xd] = '\0'; sStack_3c._buf[0xe] = '\0'; sStack_3c._buf[0xf] = '\0'; sStack_3c._size = 0; sStack_3c._capacity = 0; local_40 = 0x3ecccccd; sStack_3c._buf[0] = '\0'; sStack_3c._buf[1] = '\0'; sStack_3c._buf[2] = '\0'; sStack_3c._buf[3] = '@'; sStack_3c._buf[4] = '\0'; sStack_3c._buf[5] = '\0'; sStack_3c._buf[6] = '\0'; sStack_3c._buf[7] = '?'; sStack_3c._buf[8] = '\0'; sStack_3c._buf[9] = '\0'; sStack_3c._buf[10] = -0x80; sStack_3c._buf[0xb] = '?'; (**(code **)(*(int *)projectile + 0x3c))(&effectColor,0xffffffff,0xff,0,1); projectile->_scale = 1.6; parentSlot = &projectile->_parent; if (projectile->_parent != (EntityPtr)0x0) { local_128.y = (float)parentSlot; std::multiset::erase(&local_128.y); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); local_118.y = (float)((int)local_118.y + -1); } while (local_118.y != 0.0); } } if (0x1d < npc->_stateFrame) { npc->_state = 4; } goto LAB_00474dce; } sStack_3c._capacity = 0xf; sStack_3c._size = 8; builtin_strncpy(sStack_3c._buf,"WalkVert",8); sStack_3c._buf._8_4_ = sStack_3c._buf._8_4_ & 0xffffff00; local_54 = 0xf; local_58 = 8; horiAnimName = (void *)0x6b6c6157; builtin_strncpy(local_64,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimName,&sStack_3c,0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_54) { uVar4 = local_54 + 1; pvVar6 = horiAnimName; if (0xfff < uVar4) { pvVar6 = *(void **)((int)horiAnimName + -4); uVar4 = local_54 + 0x24; if (0x1f < (uint)((int)horiAnimName + (-4 - (int)pvVar6))) goto LAB_004743c7; } operator_delete(pvVar6,uVar4); } local_14 = 0xffffffff; local_58 = 0; local_54 = 0xf; horiAnimName = (void *)((uint)horiAnimName & 0xffffff00); if (0xf < sStack_3c._capacity) { uVar4 = sStack_3c._capacity + 1; pvVar6 = (void *)sStack_3c._buf._0_4_; if (0xfff < uVar4) { pvVar6 = *(void **)(sStack_3c._buf._0_4_ + -4); uVar4 = sStack_3c._capacity + 0x24; if (0x1f < (uint)(sStack_3c._buf._0_4_ + (-4 - (int)pvVar6))) { LAB_004743c7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar4); } PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); uVar4 = Random(); if (((uVar4 % 0x32 != 0) || ((npc->_flags & 0x200) != 0)) || ((bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar3 != 0 && (uVar4 = Random(), uVar4 % 10 != 0)))) goto LAB_00474dce; npc->_stateFrame = 0; (npc->_sprite)._flipX = local_120.y < 0.0; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } uVar4 = Random(); if ((uVar4 & 1) == 0) { iVar7 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar5 = 0; if (0 < iVar7) { iVar5 = iVar7; } if (3 < iVar5) goto LAB_004744a9; } else { LAB_004744a9: if ((ABS(local_118.y) <= 60.0) || (npc->_variant != 2)) { npc->_state = 9; goto LAB_00474dce; } } npc->_state = 8; LAB_00474dce: npc->_stateFrame = npc->_stateFrame + 1; ExceptionList = local_1c; return; } //@@ 00474e00 NpcAI::ENTITY_LUST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 47 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_LUST(Entity_NPC *npc) { byte bVar1; uint uVar2; uint seed; Entity *pEVar3; int *trailEffect; Vector *targetPos; void *pvVar4; float fVar5; undefined4 uVar6; TypeDescriptor *pTVar7; TypeDescriptor *pTVar8; int pathMarker; undefined4 uVar9; Vector pathTarget; Vector targetPosOut; float chaseDirY; float chaseDirX; void *vertAnimName; char local_40 [12]; uint vertAnimNameSize; uint vertAnimNameCapacity; void *horiAnimName; char local_28 [12]; uint horiAnimNameSize; uint horiAnimNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Room *room; float speedMultiplier; local_8 = 0xffffffff; puStack_c = &LAB_00af29e5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; npc->_friction = npc->_friction * 0.95; local_14 = uVar2; bVar1 = Entity::IsFrame((Entity *)npc,7,0); if ((bVar1 != 0) && (npc->_variant == 1)) { seed = Random(); uVar9 = 0; pTVar8 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar7 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; pEVar3 = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,seed); trailEffect = (int *)__RTDynamicCast(pEVar3,uVar6,pTVar7,pTVar8,uVar9,uVar2); (**(code **)(*trailEffect + 0xc))(); } vertAnimNameCapacity = 0xf; vertAnimNameSize = 8; vertAnimName = (void *)0x6b6c6157; builtin_strncpy(local_40,"Vert",5); horiAnimNameCapacity = 0xf; horiAnimNameSize = 8; horiAnimName = (void *)0x6b6c6157; builtin_strncpy(local_28,"Hori",5); local_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimName,(std_string *)&vertAnimName,0.1); local_8 = local_8 & 0xffffff00; if (0xf < horiAnimNameCapacity) { uVar2 = horiAnimNameCapacity + 1; pvVar4 = horiAnimName; if (0xfff < uVar2) { pvVar4 = *(void **)((int)horiAnimName + -4); uVar2 = horiAnimNameCapacity + 0x24; if (0x1f < (uint)((int)horiAnimName + (-4 - (int)pvVar4))) goto LAB_00474f78; } operator_delete(pvVar4,uVar2); } local_8 = 0xffffffff; horiAnimNameSize = 0; horiAnimNameCapacity = 0xf; horiAnimName = (void *)((uint)horiAnimName & 0xffffff00); if (0xf < vertAnimNameCapacity) { uVar2 = vertAnimNameCapacity + 1; pvVar4 = vertAnimName; if (0xfff < uVar2) { pvVar4 = *(void **)((int)vertAnimName + -4); uVar2 = vertAnimNameCapacity + 0x24; if (0x1f < (uint)((int)vertAnimName + (-4 - (int)pvVar4))) { LAB_00474f78: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } targetPos = Entity_NPC::CalcTargetPosition(npc,&targetPosOut,0.0); pEVar3 = Entity_NPC::GetPlayerTarget(npc); room = g_game->_room; chaseDirX = ((pEVar3->_velocity).x * 10.0 + targetPos->x) - (npc->_pos).x; chaseDirY = ((pEVar3->_velocity).y * 10.0 + targetPos->y) - (npc->_pos).y; targetPos = Entity_NPC::CalcTargetPosition(npc,&targetPosOut,0.0); bVar1 = Room::CheckLine(room,&npc->_pos,targetPos,0,0,0,0,(Vector *)0x0); if (bVar1 == 0) { bVar1 = 1; pathMarker = 900; fVar5 = 0.996; targetPos = Entity_NPC::CalcTargetPosition(npc,&pathTarget,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,fVar5,pathMarker,bVar1); } else { fVar5 = sqrtf(chaseDirX * chaseDirX + chaseDirY * chaseDirY); if (0.0 < fVar5) { chaseDirY = chaseDirY * (1.0 / fVar5); chaseDirX = chaseDirX * (1.0 / fVar5); } fVar5 = npc->_friction; if (fVar5 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * chaseDirY * 0.65) / fVar5 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * chaseDirX * 0.65) / fVar5 + (npc->_velocity).x; } } ExceptionList = local_10; return; } //@@ 00475110 NpcAI::ENTITY_WRATH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 48 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WRATH(Entity_NPC *npc) { float fVar1; char *pcVar2; byte bVar3; undefined4 *damageEvent; uint uVar4; Entity *tmpEntity; int bombGridIndex; int iVar5; void *freeBlock; uint uVar6; Vector *position; undefined1 *dashSign; float fVar7; float fVar8; float fVar9; undefined4 local_a0 [11]; Vector predictedPos; Vector local_6c; Vector local_64; float local_5c; Entity_NPC *local_58; void *walkVertAnim; char local_50 [12]; uint walkVertAnimSize; uint walkVertAnimCapacity; void *walkHoriAnim; char local_38 [12]; uint walkHoriAnimSize; uint walkHoriAnimCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int gridWidth; Room *room; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af2a25; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; iVar5 = npc->_state; if (iVar5 == 0) { npc->_state = 4; if ((npc->_variant == 1) && (&npc->_splatColor != (ColorMod *)local_a0)) { (npc->_splatColor)._offset[0] = 0.2; (npc->_splatColor)._offset[1] = 0.2; (npc->_splatColor)._tint[0] = 0.05; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.2; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } } else { damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { if ((damageEvent[2] & 4) != 0) { if (damageEvent[6] == npc->_type) { *damageEvent = 0x41a00000; } else if (damageEvent[6] == 1) { *damageEvent = 0x43480000; } } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); iVar5 = npc->_state; } fVar7 = npc->_friction * 0.85; npc->_friction = fVar7; local_58 = npc; if (iVar5 == 8) { if ((npc->_collidesWithGrid == 0) && (npc->_collidesWithEntity == 0)) { fVar7 = fVar7 * 0.8; npc->_friction = fVar7; fVar8 = (npc->_v2).y; if (fVar7 == 0.0) { fVar9 = (npc->_velocity).x; } else { fVar1 = npc->_speedMultiplier; fVar9 = ((npc->_v2).x * 1.5 * fVar1) / fVar7 + (npc->_velocity).x; (npc->_velocity).x = fVar9; (npc->_velocity).y = (fVar8 * 1.5 * fVar1) / fVar7 + (npc->_velocity).y; } iVar5 = (npc->_pathfinder)._gridIndex; gridWidth = *(int *)((int)g_game->_room + 0xc); if (ABS(fVar9) <= ABS((npc->_velocity).y)) { (npc->_pos).x = (npc->_pos).x * 0.9 + ((float)(iVar5 % gridWidth) * 40.0 + 40.0) * 0.1; pcVar2 = local_38 + 0x34; } else { (npc->_pos).y = ((float)(iVar5 / gridWidth) * 40.0 + 120.0) * 0.1 + (npc->_pos).y * 0.9; pcVar2 = local_38 + 0x34; } } else { npc->_state = 4; pcVar2 = local_38 + 0x34; } } else if (iVar5 == 4) { fVar7 = (npc->_v1).x; if (((fVar7 == g_vectorZero.x) && ((npc->_v1).y == g_vectorZero.y)) || (npc->_stateFrame < 1)) { puStack_20 = local_38 + 0x34; PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); Entity_NPC::CalcTargetPosition(npc,&local_64,0.0); fVar7 = local_64.y - (npc->_pos).y; fVar8 = local_64.x - (npc->_pos).x; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); uVar6 = 0x3c; if (0x3c < (int)fVar7) { uVar6 = (int)fVar7; } if ((uVar6 == 0) || (uVar4 = Random(), uVar4 % uVar6 == 0)) { npc->_state = 9; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; pcVar2 = puStack_20; } else { PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_58 = (Entity_NPC *)(tmpEntity->_velocity).x; local_5c = (tmpEntity->_velocity).y; uVar6 = Random(); room = g_game->_room; iVar5 = (npc->_pathfinder)._gridIndex; gridWidth = room->_gridWidth; fVar7 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; predictedPos.y = local_64.y + fVar7 * local_5c * 16.0; predictedPos.x = local_64.x + fVar7 * (float)local_58 * 16.0; local_6c.x = (float)(iVar5 % gridWidth) * 40.0 + 40.0; local_6c.y = (float)(iVar5 / gridWidth) * 40.0 + 120.0; local_64.y = predictedPos.x - local_6c.x; local_5c = predictedPos.y - local_6c.y; local_58 = (Entity_NPC *)ABS(local_64.y); if ((((float)local_58 < 20.0) || (pcVar2 = puStack_20, ABS(local_5c) < 20.0)) && ((fVar7 = sqrtf(local_5c * local_5c + local_64.y * local_64.y), pcVar2 = puStack_20, fVar7 < 200.0 && (bVar3 = Room::CheckLine(room,&local_6c,&predictedPos,0,0,0,0,(Vector *)0x0), pcVar2 = puStack_20, bVar3 != 0)))) { if ((float)local_58 <= ABS(local_5c)) { (npc->_v2).x = 0.0; if (0.0 <= local_5c) { dashSign = (undefined1 *)0x3f800000; } else { dashSign = &DAT_bf800000; } (npc->_v2).y = (float)dashSign; } else { (npc->_v2).y = 0.0; if (0.0 <= local_64.y) { (npc->_v2).x = 1.0; } else { (npc->_v2).x = (float)&DAT_bf800000; } } npc->_stateFrame = 0; uVar6 = Random(); if ((uVar6 & 1) == 0) { npc->_state = 9; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); pcVar2 = puStack_20; if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pcVar2 = puStack_20; } } else { npc->_state = 8; pcVar2 = puStack_20; } } } } else { npc->_stateFrame = npc->_stateFrame + -1; fVar7 = fVar7 - (npc->_pos).x; fVar8 = (npc->_v1).y - (npc->_pos).y; puStack_20 = local_38 + 0x34; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); pcVar2 = puStack_20; if (fVar7 < 130.0) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); fVar7 = (npc->_targetPosition).x; pcVar2 = puStack_20; if (((fVar7 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) && ((fVar8 = (npc->_pos).x, fVar9 = (npc->_pos).y, 50.0 < (fVar7 - fVar8) * ((npc->_v1).x - fVar8) || (50.0 < ((npc->_v1).y - fVar9) * ((npc->_targetPosition).y - fVar9))))) { KAGE_LogMessage(1,(byte *)"Wrath: Evade own bomb.\n"); npc->_friction = npc->_friction * 0.5; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; pcVar2 = puStack_20; } } } } else { pcVar2 = local_38 + 0x34; if (iVar5 == 9) { iVar5 = npc->_stateFrame; pcVar2 = local_38 + 0x34; if (4 < iVar5) { iVar5 = npc->_variant; room = g_game->_room; bombGridIndex = Room::GetGridIndex(room,&npc->_pos); gridWidth = room->_gridWidth; position = &local_58->_v1; position->x = (float)(bombGridIndex % gridWidth) * 40.0 + 40.0; (local_58->_v1).y = (float)(bombGridIndex / gridWidth) * 40.0 + 120.0; uVar6 = Random(); local_6c.x = (local_58->_v2).x * 10.0; local_6c.y = (local_58->_v2).y * 10.0; uVar4 = 4; if (iVar5 != 1) { uVar4 = 0; } tmpEntity = Game::Spawn(g_game,4,uVar4,position,&local_6c,(Entity *)local_58,0,uVar6); if (((local_58->_v2).x == g_vectorZero.x) && ((local_58->_v2).y == g_vectorZero.y)) { iVar5 = 0; } else { iVar5 = 1; } tmpEntity->_entityCollisionClass = iVar5; iVar5 = 0x3c; local_58->_state = 4; pcVar2 = puStack_20; } puStack_20 = pcVar2; local_58->_stateFrame = iVar5 + 1; npc = local_58; pcVar2 = puStack_20; } } puStack_20 = pcVar2; if ((npc->_state != 4) && (npc->_state != 8)) { ExceptionList = local_1c; return; } walkVertAnimCapacity = 0xf; walkVertAnimSize = 8; walkVertAnim = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&walkVertAnim,0.1); if (0xf < walkHoriAnimCapacity) { uVar6 = walkHoriAnimCapacity + 1; freeBlock = walkHoriAnim; if (0xfff < uVar6) { freeBlock = *(void **)((int)walkHoriAnim + -4); uVar6 = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)freeBlock))) goto LAB_004759e9; } operator_delete(freeBlock,uVar6); } walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < walkVertAnimCapacity) { uVar6 = walkVertAnimCapacity + 1; freeBlock = walkVertAnim; if (0xfff < uVar6) { freeBlock = *(void **)((int)walkVertAnim + -4); uVar6 = walkVertAnimCapacity + 0x24; if (0x1f < (uint)((int)walkVertAnim + (-4 - (int)freeBlock))) { LAB_004759e9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar6); } } ExceptionList = local_1c; return; } //@@ 00475a30 NpcAI::ENTITY_GREED /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 50 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GREED(Entity_NPC *npc) { float fVar1; byte bVar2; Entity *target; int iVar3; Vector *pVVar4; ProjectileParams *pPVar5; void *freeBlock; int iVar6; uint uVar7; bool bVar8; bool bVar9; char *anim; undefined4 local_15c [11]; Vector minionPosUp; Vector minionPosRight; Vector minionPosLeft; Vector local_118; Vector local_110; Vector searchPos; ProjectileParams projParams; void *vertAnimName; char local_50 [12]; uint vertAnimNameSize; uint vertAnimNameCapacity; void *horiAnimName; char local_38 [12]; uint horiAnimNameSize; uint horiAnimNameCapacity; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Room *room; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af2a65; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_38 + 0x28); if (npc->_state == 0) { npc->_state = 4; if (&npc->_splatColor == (ColorMod *)local_15c) { return; } (npc->_splatColor)._tint[0] = 0.4; (npc->_splatColor)._tint[1] = 0.2; (npc->_splatColor)._tint[2] = 0.2; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.75; target = Entity_NPC::GetPlayerTarget(npc); pVVar4 = &npc->_pos; local_110.x = (target->_pos).x - pVVar4->x; local_110.y = (target->_pos).y - (npc->_pos).y; iVar3 = npc->_state; if (iVar3 == 4) { vertAnimNameCapacity = 0xf; vertAnimNameSize = 8; vertAnimName = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); horiAnimNameCapacity = 0xf; horiAnimNameSize = 8; horiAnimName = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimName,(std_string *)&vertAnimName,0.1); local_14 = local_14 & 0xffffff00; if (0xf < horiAnimNameCapacity) { uVar7 = horiAnimNameCapacity + 1; freeBlock = horiAnimName; if (0xfff < uVar7) { freeBlock = *(void **)((int)horiAnimName + -4); uVar7 = horiAnimNameCapacity + 0x24; if (0x1f < (uint)((int)horiAnimName + (-4 - (int)freeBlock))) goto LAB_00475c1a; } operator_delete(freeBlock,uVar7); } local_14 = 0xffffffff; horiAnimNameSize = 0; horiAnimNameCapacity = 0xf; horiAnimName = (void *)((uint)horiAnimName & 0xffffff00); if (0xf < vertAnimNameCapacity) { uVar7 = vertAnimNameCapacity + 1; freeBlock = vertAnimName; if (0xfff < uVar7) { freeBlock = *(void **)((int)vertAnimName + -4); uVar7 = vertAnimNameCapacity + 0x24; if (0x1f < (uint)((int)vertAnimName + (-4 - (int)freeBlock))) { LAB_00475c1a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); uVar7 = Random(); if (uVar7 % 0x32 == 0) { npc->_stateFrame = 0; uVar7 = Random(); if (uVar7 % 3 == 0) { iVar6 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar3 = 0; if (0 < iVar6) { iVar3 = iVar6; } if (iVar3 < 3) { npc->_state = 0xd; goto LAB_0047605e; } } npc->_state = 8; } goto LAB_0047605e; } if (iVar3 != 8) { if (iVar3 != 0xd) goto LAB_0047605e; iVar3 = npc->_stateFrame; if (iVar3 == 1) { (npc->_sprite)._flipX = 0; bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d554,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_0047605e; } if (iVar3 == 5) { Entity_NPC::PlaySound(npc,0x109,1.2,2,0,1.0); searchPos.x = (npc->_pos).x; local_110.y = 1.20512e-43; if (npc->_variant != 1) { local_110.y = 4.06377e-44; } room = g_game->_room; iVar6 = *(int *)&room->field_0x12c4 + room->_aliveEnemyCount; iVar3 = 0; if (0 < iVar6) { iVar3 = iVar6; } if (iVar3 == 1) { searchPos.x = searchPos.x - 50.0; searchPos.y = (npc->_pos).y + 0.0; Room::FindFreePickupSpawnPosition(room,&minionPosLeft,&searchPos,0.0,0,0,0); searchPos.x = pVVar4->x + 50.0; searchPos.y = (npc->_pos).y + 0.0; Room::FindFreePickupSpawnPosition(g_game->_room,&minionPosRight,&searchPos,0.0,0,0,0); uVar7 = Random(); fVar1 = local_110.y; Game::Spawn(g_game,(uint)local_110.y,0,&minionPosLeft,&g_vectorZero,(Entity *)npc,0,uVar7); uVar7 = Random(); Game::Spawn(g_game,(uint)fVar1,0,&minionPosRight,&g_vectorZero,(Entity *)npc,0,uVar7); } else { searchPos.x = searchPos.x + 0.0; searchPos.y = (npc->_pos).y - 50.0; Room::FindFreePickupSpawnPosition(room,&minionPosUp,&searchPos,0.0,0,0,0); searchPos.x = pVVar4->x + 0.0; searchPos.y = (npc->_pos).y + 50.0; Room::FindFreePickupSpawnPosition(g_game->_room,&local_118,&searchPos,0.0,0,0,0); uVar7 = Random(); fVar1 = local_110.y; Game::Spawn(g_game,(uint)local_110.y,0,&minionPosUp,&g_vectorZero,(Entity *)npc,0,uVar7); uVar7 = Random(); Game::Spawn(g_game,(uint)fVar1,0,&local_118,&g_vectorZero,(Entity *)npc,0,uVar7); } goto LAB_0047605e; } bVar9 = SBORROW4(iVar3,0x1a); iVar6 = iVar3 + -0x1a; bVar8 = iVar3 == 0x1a; LAB_00476052: if (!bVar8 && bVar9 == iVar6 < 0) { npc->_state = 4; } goto LAB_0047605e; } iVar3 = npc->_stateFrame; if (iVar3 != 1) { if (iVar3 == 5) { if (npc->_variant == 1) { pPVar5 = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireProjectiles(npc,pVVar4,&npc->_v1,4,pPVar5); } else { pPVar5 = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireProjectiles(npc,pVVar4,&npc->_v1,2,pPVar5); } goto LAB_0047605e; } bVar9 = SBORROW4(iVar3,0x18); iVar6 = iVar3 + -0x18; bVar8 = iVar3 == 0x18; goto LAB_00476052; } (npc->_sprite)._flipX = 0; iVar3 = vector_to_direction(&local_110); switch(iVar3) { case 0: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack01Hori",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_sprite)._flipX = 1; goto switchD_00475cdf_default; case 1: anim = "Attack01Up"; break; case 2: anim = "Attack01Hori"; break; case 3: anim = "Attack01Down"; break; default: goto switchD_00475cdf_default; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)anim,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } switchD_00475cdf_default: pVVar4 = Vector::ToCardinal(&local_118,&local_110); fVar1 = pVVar4->y; (npc->_v1).x = pVVar4->x * 10.0; (npc->_v1).y = fVar1 * 10.0; LAB_0047605e: npc->_stateFrame = npc->_stateFrame + 1; ExceptionList = local_1c; return; } //@@ 004760a0 NpcAI::ENTITY_ENVY /* NPC AI for entity type 51 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ENVY(Entity_NPC *npc) { float *pfVar1; char *walkAnim; uint uVar2; Entity *pEVar3; float fVar4; float fVar5; float fVar6; float fVar7; Vector local_70; Vector local_68; undefined4 local_60 [11]; undefined4 local_34 [12]; undefined4 flagsHi; ColorMod *splatColor; int vtable; if (npc->_state == 0) { uVar2 = npc->_variant; if (uVar2 < 0x1e) { if (uVar2 < 0x14) { if (uVar2 < 10) { ANM2::Play(&npc->_sprite,(byte *)"Walk0",0); } else { walkAnim = "Walk2"; if (uVar2 % 10 != 1) { walkAnim = "Walk1"; } ANM2::Play(&npc->_sprite,(byte *)walkAnim,0); npc->_health = npc->_health / 3.0; npc->_maxHitPoints = npc->_maxHitPoints / 3.0; } } else { walkAnim = "Walk3"; npc->_shadowSize = *(float *)((int)npc->_config + 0x24) * 0.8; if (uVar2 % 10 != 1) { walkAnim = "Walk2"; } ANM2::Play(&npc->_sprite,(byte *)walkAnim,0); npc->_health = npc->_health * 0.25; npc->_maxHitPoints = npc->_maxHitPoints * 0.25; } } else { walkAnim = "Walk4"; if (uVar2 % 10 != 1) { walkAnim = "Walk3"; } npc->_shadowSize = *(float *)((int)npc->_config + 0x24) * 0.6; ANM2::Play(&npc->_sprite,(byte *)walkAnim,0); npc->_health = npc->_health / 5.0; npc->_maxHitPoints = npc->_maxHitPoints / 5.0; } npc->_entityGridCollisionClass = 3; npc->_state = 4; uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; fVar5 = cos(fVar4); fVar4 = sin(fVar4); splatColor = &npc->_splatColor; (npc->_velocity).x = fVar5; (npc->_velocity).y = fVar4; if ((uint)npc->_variant % 10 == 1) { if (splatColor != (ColorMod *)local_60) { splatColor->_tint[0] = 0.8; (npc->_splatColor)._tint[1] = 0.75; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 2.1; (npc->_splatColor)._colorize[1] = 1.7; (npc->_splatColor)._colorize[2] = 2.5; (npc->_splatColor)._colorize[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; return; } } else if (splatColor != (ColorMod *)local_34) { splatColor->_tint[0] = 0.9; (npc->_splatColor)._tint[1] = 0.9; (npc->_splatColor)._tint[2] = 0.9; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = (float)0x3f666666; (npc->_splatColor)._colorize[1] = (float)0x3f666666; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 0.3; (npc->_splatColor)._offset[2] = 0.0; return; } } else { if ((npc->_dead != 0) && ((uint)npc->_variant < 0x1e)) { uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; fVar5 = cos(fVar4); fVar5 = fVar5 * 10.0; fVar4 = sin(fVar4); fVar4 = fVar4 * 10.0; uVar2 = RNG::Next(&npc->_dropRNG); local_68.x = fVar5 + (npc->_pos).x; local_70.x = fVar5 * 0.4; local_68.y = fVar4 + (npc->_pos).y; local_70.y = fVar4 * 0.4; pEVar3 = Game::SpawnEx(g_game,npc->_type,npc->_variant + 10,&local_68,&local_70,(Entity *)npc, 0,uVar2,0); flagsHi = *(undefined4 *)((int)&pEVar3->_flags + 4); vtable = *(int *)pEVar3; *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHi; (**(code **)(vtable + 0xc))(); uVar2 = RNG::Next(&npc->_dropRNG); local_68.x = fVar5 * -0.4; local_68.y = fVar4 * -0.4; local_70.x = (npc->_pos).x - fVar5; local_70.y = (npc->_pos).y - fVar4; pEVar3 = Game::SpawnEx(g_game,npc->_type,npc->_variant + 10,&local_70,&local_68,(Entity *)npc, 0,uVar2,0); flagsHi = *(undefined4 *)((int)&pEVar3->_flags + 4); vtable = *(int *)pEVar3; *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHi; (**(code **)(vtable + 0xc))(); if (((uint)npc->_variant % 10 == 1) && (uVar2 = Random(), (uint)npc->_variant / 10 < (uVar2 & 1) + 1)) { uVar2 = RNG::Next(&npc->_dropRNG); local_68.y = -fVar5 * 0.4; local_70.x = (npc->_pos).x - fVar5; local_70.y = (npc->_pos).y - fVar4; local_68.x = fVar4 * 0.4; pEVar3 = Game::SpawnEx(g_game,npc->_type,npc->_variant + 10,&local_70,&local_68, (Entity *)npc,0,uVar2,0); flagsHi = *(undefined4 *)((int)&pEVar3->_flags + 4); vtable = *(int *)pEVar3; *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHi; (**(code **)(vtable + 0xc))(); } } if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (pfVar1 = &(npc->_pos).y, *pfVar1 <= 320.0 && *pfVar1 != 320.0)) { fVar4 = (npc->_velocity).x; fVar5 = (npc->_velocity).y; (npc->_pos).y = 320.0; fVar6 = fVar4 * 0.0 + fVar5; fVar6 = fVar6 + fVar6; (npc->_velocity).y = fVar5 - fVar6; (npc->_velocity).x = fVar4 - fVar6 * 0.0; } fVar4 = npc->_friction * 0.9; npc->_friction = fVar4; if ((npc->_flags & 0x200) != 0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); return; } uVar2 = npc->_variant; if (uVar2 < 10) { fVar5 = 0.25; } else if ((uVar2 < 0x14) || (0x1d < uVar2)) { fVar5 = 0.35; } else { fVar5 = 0.45; } fVar6 = (npc->_velocity).x; fVar7 = fVar5 * g_vectorOne.y; fVar5 = g_vectorOne.x * fVar5; if (fVar6 < 0.0) { fVar5 = -fVar5; } pfVar1 = &(npc->_velocity).y; if (*pfVar1 <= 0.0 && *pfVar1 != 0.0) { fVar7 = -fVar7; } if (fVar4 != 0.0) { fVar6 = fVar6 + (npc->_speedMultiplier * fVar5) / fVar4; (npc->_velocity).y = (npc->_speedMultiplier * fVar7) / fVar4 + (npc->_velocity).y; (npc->_velocity).x = fVar6; } (npc->_sprite)._flipX = fVar6 < 0.0; if ((npc->_flags & 0x1000800) != 0) { pEVar3 = Entity_NPC::GetPlayerTarget(npc); fVar5 = -((pEVar3->_pos).y - (npc->_pos).y); fVar6 = -((pEVar3->_pos).x - (npc->_pos).x); fVar4 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if (0.0 < fVar4) { fVar7 = (120.0 - fVar4) * 0.02; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } fVar5 = (fVar7 / fVar4) * fVar5; fVar6 = (fVar7 / fVar4) * fVar6; } fVar4 = npc->_friction; if (fVar4 != 0.0) { fVar7 = npc->_speedMultiplier; (npc->_velocity).y = (fVar7 * fVar5) / fVar4 + (npc->_velocity).y; (npc->_velocity).x = (fVar7 * fVar6) / fVar4 + (npc->_velocity).x; } } } return; } //@@ 00476860 NpcAI::ENTITY_PIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 62 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PIN(Entity_NPC *npc) { short sVar1; EntityPtr EVar2; code *pcVar3; EntityPtr EVar4; int iVar5; int iVar6; qword qVar7; byte bVar8; undefined2 uVar9; uint uVar10; int iVar11; uint uVar12; Entity *pEVar13; EntityPtr EVar14; LayerState *layer; std_string *sheetPath; Vector *tmpVec; Entity_Projectile *bigShot; float *pfVar15; char *pcVar16; ColorMod *effectColor; byte *wiggleAnim; EntityPtr EVar17; ANM2 *pAVar18; void *ptr; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 extraout_ECX_03; EntityPtr *pEVar19; int iVar20; int *piVar21; EntityPtr *pEVar22; EntityPtr EVar23; float fVar24; undefined1 *puVar25; float fVar26; undefined4 in_stack_fffffc1c; undefined4 uVar27; undefined4 uVar28; TypeDescriptor *pTVar29; TypeDescriptor *pTVar30; undefined4 uVar31; EntityRef damageSource; undefined1 local_394 [4]; Vector targetPos; Vector tmpPos; Entity_NPC *self; EntityPtr *local_37c; Vector local_378; EntityPtr local_370; float local_36c; EntityPtr local_368; float local_364; Vector local_360; EntityPtr local_358; Vector local_354; byte local_349; EntityPtr local_348; EntityPtr tail; EntityPtr local_340; EntityPtr local_33c; ProjectileParams bossShotParams; ProjectileParams arcShotParams; ProjectileParams ringShotParams; ProjectileParams params; undefined1 local_a8; undefined1 *local_a4; undefined4 local_a0; undefined1 local_9c; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; float local_80; float local_7c; float local_78; float local_74; undefined4 local_70; undefined4 local_6c; void *redirectedSheetPath [3]; undefined4 local_5c; Vector local_58; Color local_50; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; puStack_20 = (undefined1 *)(&local_50)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af2ab5; local_1c = ExceptionList; uVar10 = __security_cookie ^ (uint)((&local_50)[1]._colorize + 1); ExceptionList = &local_1c; self = npc; stackCookie = uVar10; if (npc->_variant == 3) { ENTITY_WORMWOOD_main(npc); ExceptionList = local_1c; return; } local_354.y = (float)npc->_subtype; local_340 = (EntityPtr)0x0; local_364 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); EVar17 = npc->_parent; pEVar22 = &npc->_parent; local_37c = pEVar22; puStack_20 = (undefined1 *)(&local_50)[1]._offset; if (EVar17 != (EntityPtr)0x0) { EVar23 = (EntityPtr)0x0; puStack_20 = (undefined1 *)(&local_50)[1]._offset; do { in_stack_fffffc1c = 0x476914; iVar11 = __RTDynamicCast(EVar17,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar10); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } EVar23 = (EntityPtr)((int)EVar23 + 1); pEVar22 = (EntityPtr *)((int)*pEVar22 + 0x3bc); EVar17 = *pEVar22; } while (EVar17 != (EntityPtr)0x0); local_340 = EVar23; } EVar17 = (EntityPtr)self; pfVar15 = &(self->_velocity).y; fVar26 = *pfVar15; fVar24 = *pfVar15; self->_renderZOffset = (int)local_340 * 5; if (fVar24 <= 0.0 && fVar26 != 0.0) { self->_renderZOffset = (int)local_340 * -5; } if ((self->_state == 0) && (local_340 == (EntityPtr)0x0)) { local_33c = (EntityPtr)self->_variant; if (local_33c == (EntityPtr)0x2) { fVar24 = self->_health; uVar28 = *(undefined4 *)((int)&self->_flags + 4); *(uint *)&self->_flags = (uint)self->_flags | 0x10000; *(undefined4 *)((int)&self->_flags + 4) = uVar28; self->_health = fVar24 * 0.5; local_348 = (EntityPtr)0x0; self->_maxHitPoints = self->_maxHitPoints * 0.5; std::deque::resize(1,&local_348); local_33c = (EntityPtr)((Entity_NPC *)EVar17)->_variant; } qVar7 = ((Entity_NPC *)EVar17)->_flags; *(undefined4 *)((int)&((Entity_NPC *)EVar17)->_flags + 4) = *(undefined4 *)((int)&((Entity_NPC *)EVar17)->_flags + 4); *(uint *)&((Entity_NPC *)EVar17)->_flags = (uint)qVar7 & 0xfffffffb | 0x40000; local_368 = (EntityPtr)0x6; ((Entity_NPC *)EVar17)->_entityCollisionClass = 0; ((Entity_NPC *)EVar17)->_state = 3; if (local_33c == (EntityPtr)0x1) { local_368 = (EntityPtr)0x9; } ((Entity_NPC *)EVar17)->_i1 = 0; local_358 = (EntityPtr)0x0; local_370 = (EntityPtr)0x8; tail = EVar17; do { uVar12 = Random(); uVar31 = 0; pTVar30 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar28 = 0; pEVar13 = Game::Spawn(g_game,0x3e,((Entity_NPC *)EVar17)->_variant, &((Entity_NPC *)EVar17)->_pos,&g_vectorZero,(Entity *)EVar17,0,uVar12); in_stack_fffffc1c = 0x476aa0; EVar23 = (EntityPtr)__RTDynamicCast(pEVar13,uVar28,pTVar29,pTVar30,uVar31); *(uint *)((int)EVar23 + 0x168) = *(uint *)((int)EVar23 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar23 + 0x16c) = *(undefined4 *)((int)EVar23 + 0x16c); *(undefined1 *)((int)EVar23 + 0x171) = 0; if (*(EntityPtr *)((int)EVar23 + 0x3bc) != (EntityPtr)0x0) { local_348 = (EntityPtr)((int)EVar23 + 0x3bc); std::multiset::erase(&local_348); } *(EntityPtr *)((int)EVar23 + 0x3bc) = tail; if (tail != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar23 + 0x3bc)); } *(float *)((int)EVar23 + 900) = ((Entity_NPC *)EVar17)->_maxHitPoints; *(float *)((int)EVar23 + 0x380) = ((Entity_NPC *)EVar17)->_health; tail = (EntityPtr)((int)tail + 0x3c0); if (*(EntityPtr *)tail != (EntityPtr)0x0) { local_348 = tail; std::multiset::erase(&local_348); } *(EntityPtr *)tail = EVar23; std::multiset::insert(tail); *(undefined4 *)((int)EVar23 + 0xb64) = 3; *(undefined4 *)((int)EVar23 + 0x188) = 0; tail = EVar23; if (((Entity_NPC *)EVar17)->_variant == 1) { iVar11 = 1; if (local_33c == (EntityPtr)0x1) { iVar11 = 4; } if (iVar11 <= (int)local_358) { EVar14 = (EntityPtr)0x5; if (local_33c == (EntityPtr)0x1) { EVar14 = local_370; } if ((int)local_358 < (int)EVar14) { iVar11 = 4; if (local_33c == (EntityPtr)0x1) { iVar11 = 7; } if (local_358 == (EntityPtr)iVar11) { fVar24 = *(float *)((int)EVar23 + 0x370) * 1.5; local_378.x = (float)((uint)g_vectorOne.x ^ 0x80000000); local_378.y = (float)((uint)g_vectorOne.y ^ 0x80000000); } else { fVar24 = *(float *)((int)EVar23 + 0x370) * 0.7; local_360.x = (float)((uint)g_vectorOne.x ^ 0x80000000); local_360.y = (float)((uint)g_vectorOne.y ^ 0x80000000); } Entity::SetSize((Entity *)EVar23,fVar24, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1) ; } } } if (((Entity_NPC *)EVar17)->_variant == 2) { *(uint *)((int)EVar23 + 0x168) = *(uint *)((int)EVar23 + 0x168) | 0x10000; *(undefined4 *)((int)EVar23 + 0x16c) = *(undefined4 *)((int)EVar23 + 0x16c); } local_358 = (EntityPtr)((int)local_358 + 1); } while ((int)local_358 < (int)local_368); *(undefined4 *)((int)EVar23 + 0x354) = 1000; layer = ANM2::GetLayer((ANM2 *)((int)EVar23 + 0x48),(byte *)0x0); (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; *(uint *)((int)EVar23 + 0x168) = *(uint *)((int)EVar23 + 0x168) | 0x10000; *(undefined4 *)((int)EVar23 + 0x16c) = *(undefined4 *)((int)EVar23 + 0x16c); } EVar23 = EVar17; if ((((EntityPtr *)local_354.y == (EntityPtr *)0x1) && ((short)((Entity_NPC *)EVar17)->_i2 == 0)) && (((Entity_NPC *)EVar17)->_variant == 2)) { EVar14 = ((Entity_NPC *)EVar17)->_parent; if (EVar14 != (EntityPtr)0x0) { do { in_stack_fffffc1c = 0x476d14; iVar11 = __RTDynamicCast(EVar14,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar10); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } EVar17 = *(EntityPtr *)((int)EVar17 + 0x3bc); EVar14 = *(EntityPtr *)((int)EVar17 + 0x3bc); } while (EVar14 != (EntityPtr)0x0); EVar23 = (EntityPtr)self; } do { fVar24 = *(float *)(*(int *)((int)EVar23 + 0x330) + 0x50); *(float *)((int)EVar17 + 900) = fVar24; pAVar18 = (ANM2 *)(*(uint *)((int)EVar23 + 0x16c) & 0x10000000); if (pAVar18 != (ANM2 *)0x0) { fVar24 = 75.0; *(float *)((int)EVar17 + 900) = 75.0; } *(short *)((int)EVar17 + 0xbc4) = *(short *)((int)EVar17 + 0xbc4) + 1; *(float *)((int)EVar17 + 0x380) = fVar24; *(byte *)((int)EVar17 + 0x173) = 0; local_358 = (EntityPtr)0x0; if (*(int *)((int)EVar17 + 200) != 0) { do { layer = ANM2::GetLayer((ANM2 *)((int)EVar17 + 0x48),(byte *)local_358); if (layer->_layerData == (void *)0x0) { iVar11 = -1; } else { iVar11 = *(int *)((int)layer->_layerData + 4); } if (iVar11 == 0) { local_50._colorize[1] = (float)std::_Allocate(0x30); local_50._offset[1] = 5.60519e-44; local_50._offset[2] = 6.5861e-44; builtin_strncpy((char *)local_50._colorize[1],"gfx/Bosses/Afterbirth/Boss_TheFrail2.png" ,0x29); local_14 = 0.0; bVar8 = Entity::HasEntityFlags((Entity *)EVar23,0x1000000000000000); if (bVar8 != 0) { std::string::replace ((char *)(local_50._colorize + 1),4,6, (byte *)"Bosses/AfterbirthPlus/DeliriumForms",0x23); } sheetPath = (std_string *) Menu_Character::ChangeCharacterPage ((Menu_Character *)EVar23,redirectedSheetPath, local_50._colorize + 1); local_14._0_1_ = 1; Sprite::ReplaceSpritesheet((Sprite *)((int)EVar17 + 0x48),(int)local_358,sheetPath); local_14 = (float)((uint)local_14._1_3_ << 8); if (0xf < (uint)local_58.y) { uVar12 = (int)local_58.y + 1; ptr = redirectedSheetPath[0]; if (0xfff < uVar12) { ptr = *(void **)((int)redirectedSheetPath[0] + -4); uVar12 = (int)local_58.y + 0x24; if (0x1f < (uint)((int)redirectedSheetPath[0] + (-4 - (int)ptr))) goto LAB_004770e8; } operator_delete(ptr,uVar12); } local_14 = -NAN; if (0xf < (uint)local_50._offset[2]) { uVar12 = (int)local_50._offset[2] + 1; pcVar16 = (char *)local_50._colorize[1]; if (0xfff < uVar12) { pcVar16 = *(char **)((int)local_50._colorize[1] + -4); uVar12 = (int)local_50._offset[2] + 0x24; if ((char *)0x1f < (char *)((int)local_50._colorize[1] + (-4 - (int)pcVar16))) goto LAB_004770e8; } operator_delete(pcVar16,uVar12); } } pAVar18 = (ANM2 *)((int)EVar17 + 0x48); local_358 = (EntityPtr)((int)local_358 + 1); } while ((uint)local_358 < (uint)*(EntityPtr *)((int)EVar17 + 200)); } ANM2::LoadGraphics((ANM2 *)((int)EVar17 + 0x48),(byte)pAVar18); if (*(byte *)((int)EVar17 + 0x151) != 0) { AnimationState::Update((AnimationState *)((int)EVar17 + 0x78)); AnimationState::Update((AnimationState *)((int)EVar17 + 0x98)); } if (-1 < *(int *)((int)EVar23 + 0xc78)) { local_354.y = *(float *)(*(int *)((int)EVar23 + 0x330) + 0x68); if (*(uint *)((int)EVar23 + 0xc78) <= (uint)((*(int *)(*(int *)((int)EVar23 + 0x330) + 0x6c) - (int)local_354.y) / 0x7c)) { in_stack_fffffc1c = 0x476f5c; (**(code **)(*(int *)EVar17 + 0x3c)) ((EntityPtr *)((int)local_354.y + *(uint *)((int)EVar23 + 0xc78) * 0x1f * 4), 0xffffffff,0xff,0,1); } } if (*(EntityPtr *)((int)EVar17 + 0x3c0) != (EntityPtr)0x0) { in_stack_fffffc1c = 0x476f7a; iVar11 = __RTDynamicCast(*(EntityPtr *)((int)EVar17 + 0x3c0),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } } EVar17 = *(EntityPtr *)((int)EVar17 + 0x3c0); } while (EVar17 != (EntityPtr)0x0); } iVar11 = *(int *)((int)EVar23 + 0x3bc); local_358 = EVar23; if (iVar11 != 0) { do { pEVar22 = (EntityPtr *)((int)local_358 + 0x3bc); in_stack_fffffc1c = 0x476fc8; iVar11 = __RTDynamicCast(iVar11,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar10); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } local_358 = *pEVar22; iVar11 = *(int *)((int)local_358 + 0x3bc); } while (iVar11 != 0); EVar23 = (EntityPtr)self; } EVar17 = *(EntityPtr *)((int)EVar23 + 0x3c0); EVar14 = EVar23; tail = EVar23; if (EVar17 != (EntityPtr)0x0) { pEVar22 = (EntityPtr *)((int)EVar23 + 0x3c0); do { in_stack_fffffc1c = 0x477034; iVar11 = __RTDynamicCast(EVar17,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } tail = *pEVar22; pEVar22 = (EntityPtr *)((int)tail + 0x3c0); EVar17 = *pEVar22; } while (EVar17 != (EntityPtr)0x0); EVar14 = (EntityPtr)self; } EVar17 = local_340; if (local_358 == tail) { *(uint *)((int)EVar14 + 0x168) = *(uint *)((int)EVar14 + 0x168) & 0xfffbffff; *(undefined4 *)((int)EVar14 + 0x16c) = *(undefined4 *)((int)EVar14 + 0x16c); local_90 = 0; local_8c = 0; local_88 = 0; local_84 = 0; local_80 = g_vectorZero.x; local_7c = g_vectorZero.y; local_78 = g_vectorZero.x; local_74 = g_vectorZero.y; local_70 = 0; local_6c = 0; (**(code **)(*(int *)EVar14 + 0x24))(&local_90); ExceptionList = local_1c; return; } if ((*(int *)((int)EVar14 + 0x2c) == 1) && (*(int *)((int)EVar14 + 0xb64) != 8)) { EVar23 = *(EntityPtr *)((int)EVar23 + 0x3c0); uVar10 = 0; if (EVar23 != (EntityPtr)0x0) { do { if (EVar23 == tail) break; EVar23 = *(EntityPtr *)((int)EVar23 + 0x3c0); uVar10 = uVar10 + 1; } while (EVar23 != (EntityPtr)0x0); if ((2 < uVar10) && (pfVar15 = *(float **)((int)EVar14 + 8), pfVar15 != *(float **)((int)EVar14 + 0xc))) { do { if (pfVar15[4] != *(float *)((int)EVar14 + 0x28)) { *(float *)((int)EVar14 + 0x14) = *(float *)((int)EVar14 + 0x14) - (*pfVar15 + 0.0001); *pfVar15 = 0.0; } pfVar15 = pfVar15 + 0xe; } while (pfVar15 != *(float **)((int)EVar14 + 0xc)); } } } if (EVar14 == local_358) { EVar23 = EVar14; EVar17 = (EntityPtr)(*(float *)((int)EVar14 + 0x380) - *(float *)((int)EVar14 + 0x14)); while( true ) { EVar2 = *(EntityPtr *)((int)EVar23 + 0x3c0); local_340 = EVar17; if (EVar2 != (EntityPtr)0x0) { in_stack_fffffc1c = 0x4771a7; iVar11 = __RTDynamicCast(EVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } } EVar23 = *(EntityPtr *)((int)EVar23 + 0x3c0); if (EVar23 == (EntityPtr)0x0) break; EVar17 = *(EntityPtr *)((int)EVar23 + 0x380); if ((float)local_340 <= (float)EVar17) { EVar17 = local_340; } } local_33c = EVar14; do { EVar17 = local_33c; pTVar29 = (TypeDescriptor *)0x4771fe; bVar8 = Entity::HasEntityFlags((Entity *)EVar14,0x1000000000000000); if (((bVar8 == 0) || (*(float *)((int)EVar14 + 0x14) <= 0.0)) || (uVar28 = extraout_ECX, *(float *)((int)EVar17 + 0x380) - (float)local_340 <= 0.0)) { pTVar29 = (TypeDescriptor *)0x477236; bVar8 = Entity::HasEntityFlags((Entity *)EVar14,0x1000000000000000); uVar28 = extraout_ECX_00; if ((bVar8 == 0) && ((float)local_340 < *(float *)((int)EVar17 + 0x380) - *(float *)((int)EVar17 + 0x14))) goto LAB_00477254; } else { LAB_00477254: if (EVar17 != tail) { pcVar3 = *(code **)(*(int *)EVar17 + 0x20); EVar17 = local_340; EntityRef::constructor(&damageSource,(Entity *)EVar14); pTVar29 = (TypeDescriptor *)0x0; in_stack_fffffc1c = 0x477297; (*pcVar3)(*(float *)((int)local_33c + 0x380) - (float)EVar17,0x2000,0,&damageSource,0x1e); uVar28 = extraout_ECX_01; EVar17 = local_33c; } } if (*(int *)((int)EVar17 + 0x3c0) != 0) { pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; in_stack_fffffc1c = 0x4772bb; iVar11 = __RTDynamicCast(*(int *)((int)EVar17 + 0x3c0),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); uVar28 = extraout_ECX_02; if (iVar11 == 0) { pTVar29 = (TypeDescriptor *)0x4772ce; KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); uVar28 = extraout_ECX_03; } } local_33c = *(EntityPtr *)((int)EVar17 + 0x3c0); } while (local_33c != (EntityPtr)0x0); iVar11 = *(int *)((int)EVar14 + 0xb64); if (iVar11 == 8) { if ((*(int *)((int)EVar14 + 0x2c) == 2) && (*(short *)((int)EVar14 + 0xbc4) != 0)) { if (*(short *)((int)EVar14 + 0xbc4) != 1) goto LAB_00479293; LAB_00477318: tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&targetPos,0.0); fVar24 = atan2f(tmpVec->y - *(float *)((int)EVar14 + 0x340), tmpVec->x - *(float *)((int)EVar14 + 0x33c)); local_370 = (EntityPtr)(fVar24 * 57.295776); pEVar22 = (EntityPtr *)((int)EVar14 + 0xbec); local_348 = local_370; if (*pEVar22 != (EntityPtr)0x0) { iVar11 = __RTDynamicCast(*pEVar22,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); local_348 = *(EntityPtr *)(iVar11 + 0x41c); } if (*(int *)((int)EVar14 + 0x410) == 0) { ANM2::Play((ANM2 *)((int)EVar14 + 0x48),(byte *)"Attack3Start",0); *(undefined1 *)((int)tail + 0x171) = 0; *(undefined4 *)((int)EVar14 + 0x188) = 4; *(undefined1 *)((int)EVar14 + 0x171) = 1; *(undefined4 *)((int)EVar14 + 0x15c) = 0; *(float *)((int)EVar14 + 0x360) = g_vectorZero.x; *(float *)((int)EVar14 + 0x364) = g_vectorZero.y; *(undefined4 *)((int)EVar14 + 0x350) = 0; } else if (*(int *)((int)EVar14 + 0x410) == 2) { sVar1 = *(short *)((int)EVar14 + 0xbc6); if (*(int *)((int)EVar14 + 0xb64) == 8) { if (0x14 < sVar1) { EVar17 = *pEVar22; local_349 = 0; if (EVar17 == (EntityPtr)0x0) { local_368 = (EntityPtr) Entity_Laser::ShootAngle (1,(Vector *)((int)EVar14 + 0x33c), *(float *)((int)EVar14 + 3000),0x3c,&g_vectorZero, (Entity *)EVar14,0); if (*pEVar22 != (EntityPtr)0x0) { local_354.y = (float)pEVar22; std::multiset::erase(&local_354.y); } *pEVar22 = local_368; EVar17 = (EntityPtr)0x0; if (local_368 != (EntityPtr)0x0) { std::multiset::insert(pEVar22); EVar17 = *(EntityPtr *)((int)EVar14 + 0xbec); } local_349 = 1; } EVar17 = (EntityPtr) __RTDynamicCast(EVar17,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); local_33c = EVar17; local_340 = (EntityPtr) LerpAngleDeg(*(float *)((int)EVar17 + 0x41c),(float)local_370,0.05); EVar23 = (EntityPtr) normalize_angle_degrees((float)local_340 - *(float *)((int)EVar17 + 0x41c)); local_368 = EVar23; if (ABS((float)EVar23) < 1.0) { local_354.y = 1.0; if ((float)EVar23 <= 0.0) { local_368 = (EntityPtr)-(float)EVar23; pEVar22 = (EntityPtr *)&local_354.y; if (-(float)EVar23 <= 1.0) { pEVar22 = &local_368; } local_340 = (EntityPtr) normalize_angle_degrees (*(float *)((int)EVar17 + 0x41c) - (float)*pEVar22); } else { pEVar22 = (EntityPtr *)&local_354.y; if ((float)EVar23 <= 1.0) { pEVar22 = &local_368; } local_340 = (EntityPtr) normalize_angle_degrees (*(float *)((int)EVar17 + 0x41c) + (float)*pEVar22); } } Entity_NPC::SetAimAngle((Entity_NPC *)EVar17,(float)local_340); if (*(int *)(*(int *)(*(int *)((int)EVar14 + 0xbf4) + (*(int *)((int)EVar14 + 0xbf8) - 1U & *(uint *)((int)EVar14 + 0xbfc) >> 2) * 4) + (*(uint *)((int)EVar14 + 0xbfc) & 3) * 4) != 0) { local_340 = (EntityPtr)((float)local_340 * 0.017453292); iVar11 = *(int *)(*(int *)(*(int *)((int)EVar14 + 0xbf4) + (*(int *)((int)EVar14 + 0xbf8) - 1U & *(uint *)((int)EVar14 + 0xbfc) >> 2) * 4) + (*(uint *)((int)EVar14 + 0xbfc) & 3) * 4); local_354.y = sin((float)local_340); fVar24 = cos((float)local_340); *(float *)(iVar11 + 0x334) = fVar24; *(float *)(iVar11 + 0x338) = local_354.y; EVar17 = local_33c; } local_354.y = *(float *)((int)EVar17 + 0x41c) * 0.017453292; local_368 = (EntityPtr)sin(local_354.y); local_360.x = cos(local_354.y); local_360.y = (float)local_368; iVar11 = vector_to_direction(&local_360); puVar25 = (undefined1 *)0x0; if (iVar11 == 2) { puVar25 = (undefined1 *)0x41c80000; } else if (iVar11 == 0) { puVar25 = &DAT_c1c80000; } *(int *)((int)EVar17 + 0x350) = -0x3d740000; *(float *)((int)EVar17 + 0x34c) = (float)puVar25 - 5.0; if (0.0 < *(float *)((int)EVar17 + 0x41c) || *(float *)((int)EVar17 + 0x41c) == 0.0) { iVar11 = 0x453b8000; } else { iVar11 = -0x3ee00000; } *(int *)((int)EVar17 + 0x358) = iVar11; if (local_349 != 0) { (**(code **)(*(int *)EVar17 + 0xc))(); } } } else { if ((sVar1 == 0x3c) || (sVar1 == 0x6e)) { tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&targetPos,0.0); fVar24 = atan2f(tmpVec->y - *(float *)((int)EVar14 + 0x340), tmpVec->x - *(float *)((int)EVar14 + 0x33c)); fVar24 = fVar24 * 57.295776; *(float *)((int)EVar14 + 3000) = fVar24; effectColor = (ColorMod *)Color::Color(0x3f4ccccd); local_354.y = fVar24 * 0.017453292; local_368 = (EntityPtr)sin(local_354.y); local_360.x = cos(local_354.y); local_360.y = (float)local_368; local_378.x = 0.0; local_378.y = -80.0; Entity::SpawnFollowingEffect198 ((Entity *)EVar14,&local_378,&local_360,0x18,effectColor,4.0); } else if ((sVar1 == 0x32) || (sVar1 == 100)) { local_33c = (EntityPtr) Entity_Laser::ShootAngle (1,(Vector *)((int)EVar14 + 0x33c), *(float *)((int)EVar14 + 3000),0x14,&g_vectorZero, (Entity *)EVar14,0); if (*pEVar22 != (EntityPtr)0x0) { local_354.y = (float)pEVar22; std::multiset::erase(&local_354.y); } *pEVar22 = local_33c; if (local_33c != (EntityPtr)0x0) { std::multiset::insert(pEVar22); } if (0.0 < *(float *)((int)EVar14 + 3000) || *(float *)((int)EVar14 + 3000) == 0.0) { iVar11 = 0x453b8000; } else { iVar11 = -0x3ee00000; } *(int *)((int)local_33c + 0x358) = iVar11; local_354.y = *(float *)((int)local_33c + 0x41c) * 0.017453292; local_368 = (EntityPtr)sin(local_354.y); local_360.x = cos(local_354.y); local_360.y = (float)local_368; iVar11 = vector_to_direction(&local_360); puVar25 = (undefined1 *)0x0; if (iVar11 == 2) { puVar25 = (undefined1 *)0x41c80000; } else if (iVar11 == 0) { puVar25 = &DAT_c1c80000; } *(float *)((int)local_33c + 0x34c) = (float)puVar25 - 5.0; *(int *)((int)local_33c + 0x350) = -0x3d740000; } sVar1 = *(short *)((int)EVar14 + 0xbc6); if (((sVar1 < 0x6f) && (0x59 < sVar1)) || ((ushort)(sVar1 - 0x28U) < 0x15)) { local_349 = 1; } else { local_349 = 0; } layer = ANM2::GetLayer((ANM2 *)((int)EVar14 + 0x48),(byte *)"Effect1"); layer->_visible = local_349; layer = ANM2::GetLayer((ANM2 *)((int)EVar14 + 0x48),(byte *)"EyesGlow"); layer->_visible = local_349; } *(short *)((int)EVar14 + 0xbc6) = *(short *)((int)EVar14 + 0xbc6) - SUB42(local_364,0); if (*(short *)((int)EVar14 + 0xbc6) < 1) { *(int *)((int)EVar14 + 0x410) = *(int *)((int)EVar14 + 0x410) + 1; ANM2::Play((ANM2 *)((int)EVar14 + 0x48),(byte *)"Attack3End",0); layer = ANM2::GetLayer((ANM2 *)((int)EVar14 + 0x48),(byte *)"Effect1"); layer->_visible = 1; layer = ANM2::GetLayer((ANM2 *)((int)EVar14 + 0x48),(byte *)"EyesGlow"); layer->_visible = 1; } } if ((*(int *)((int)EVar14 + 0x7c) == 0) || (*(char *)((int)EVar14 + 0x8c) == '\0')) { iVar11 = *(int *)((int)EVar14 + 0x410); if (iVar11 == 0) { ANM2::Play((ANM2 *)((int)EVar14 + 0x48),(byte *)"Attack3Charge",0); *(int *)((int)EVar14 + 0x410) = *(int *)((int)EVar14 + 0x410) + 1; tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&local_58,0.0); fVar24 = atan2f(tmpVec->y - *(float *)((int)EVar14 + 0x340), tmpVec->x - *(float *)((int)EVar14 + 0x33c)); *(float *)((int)EVar14 + 3000) = fVar24 * 57.295776; Entity_NPC::PlaySound((Entity_NPC *)EVar14,0x1a8,1.0,2,0,1.0); } else { if (iVar11 == 1) { uVar9 = 0x78; if (*(int *)((int)EVar14 + 0xb64) == 8) { uVar9 = 0x50; } *(undefined2 *)((int)EVar14 + 0xbc6) = uVar9; *(undefined4 *)((int)EVar14 + 0x410) = 2; Entity_NPC::PlaySound((Entity_NPC *)EVar14,0x75,1.0,2,0,1.0); } else if (iVar11 != 2) { *(undefined4 *)((int)EVar14 + 0xb64) = 3; tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&local_58,0.0); *(float *)((int)EVar14 + 0x334) = tmpVec->x; *(float *)((int)EVar14 + 0x338) = tmpVec->y; *(undefined4 *)((int)EVar14 + 0x410) = 0; *(undefined1 *)((int)EVar14 + 0x171) = 0; *(undefined4 *)((int)EVar14 + 0x188) = 0; goto LAB_00478eb0; } fVar24 = ((float)local_348 + 45.0) - 22.5; if (360.0 < ABS(fVar24)) { fVar24 = fmodf(fVar24,360.0); } if (fVar24 <= 180.0) { if (fVar24 < -180.0) { fVar24 = fVar24 + 360.0; } } else { fVar24 = fVar24 - 360.0; } local_368 = (EntityPtr)0x0; local_370 = (EntityPtr)0x167; local_354.y = (float)(int)(fVar24 + 180.0); pEVar22 = (EntityPtr *)&local_354.y; if ((int)(int)(fVar24 + 180.0) < 1) { pEVar22 = &local_368; } pEVar19 = &local_370; if ((int)*pEVar22 < 0x167) { pEVar19 = pEVar22; } bVar8 = ANM2::SetAnimation((ANM2 *)((int)EVar14 + 0x48), (&PTR_s_Attack3ShootLeft_00b1dc1c)[(int)*pEVar19 / 0x2d],1); if (bVar8 != 0) { AnimationState::Rewind((AnimationState *)((int)EVar14 + 0x78)); *(undefined1 *)((int)EVar14 + 0x8c) = 1; } } } LAB_00478eb0: *(float *)((int)EVar14 + 0x360) = g_vectorZero.x; *(float *)((int)EVar14 + 0x364) = g_vectorZero.y; goto LAB_00479293; } } else if (iVar11 != 9) { if (iVar11 == 10) goto LAB_00477318; if (iVar11 != 3) { if (iVar11 == 4) { uVar31 = 0x4781d4; pfVar15 = (float *)std::deque::front(uVar28); fVar24 = *(float *)((int)EVar14 + 0x340) - pfVar15[1]; fVar26 = ((Vector *)((int)EVar14 + 0x33c))->x - *pfVar15; tmpVec = (Vector *)0x4781f7; fVar24 = sqrtf(fVar24 * fVar24 + fVar26 * fVar26); if ((3.0 < fVar24) || (16.0 < *(float *)((int)EVar14 + 0x350))) { std::deque::push_back((void *)((int)EVar14 + 0xc04),(Vector *)((int)EVar14 + 0x33c)); tmpVec = (Vector *)((int)EVar14 + 0x34c); uVar31 = 0x478233; std::deque::push_back((void *)((int)EVar14 + 0xc18),tmpVec); } fVar24 = 16.0; if (0x3c < *(uint *)((int)EVar14 + 0xc14)) { local_5c = *(undefined4 *)((int)EVar14 + 0xc04); local_58.y = (float)(*(int *)((int)EVar14 + 0xc10) + 0x1e); local_58.x = 0.0; uVar28 = _range_to_span(local_394); uVar27 = 0x478280; FUN_00479d50(uVar28); FUN_00479d50(&local_5c); std::deque::erase (&local_5c,in_stack_fffffc1c,uVar27,uVar28,pTVar29,uVar31,tmpVec); local_5c = *(undefined4 *)((int)EVar14 + 0xc18); local_58.y = (float)(*(int *)((int)EVar14 + 0xc24) + 0x1e); local_58.x = 0.0; uVar28 = _range_to_span(local_394); uVar27 = 0x4782d8; FUN_00479d50(uVar28); FUN_00479d50(&local_5c); std::deque::erase (&local_5c,in_stack_fffffc1c,uVar27,uVar28,pTVar29,uVar31,tmpVec); } pfVar15 = (float *)((int)EVar14 + 0x33c); *(float *)((int)EVar14 + 0xbb4) = *(float *)((int)EVar14 + 0x39c) * 0.4 + *(float *)((int)EVar14 + 0xbb4); if (fVar24 < *(float *)((int)EVar14 + 0x350) || fVar24 == *(float *)((int)EVar14 + 0x350)) { *(undefined4 *)((int)EVar14 + 0x188) = 0; *(undefined1 *)((int)EVar14 + 0x171) = 0; *(float *)((int)EVar14 + 0x36c) = *(float *)((int)EVar14 + 0x36c) * 0.95; pEVar13 = Entity_NPC::GetPlayerTarget((Entity_NPC *)EVar14); local_354.y = (pEVar13->_pos).x - *pfVar15; local_368 = (EntityPtr)((pEVar13->_pos).y - *(float *)((int)EVar14 + 0x340)); local_33c = (EntityPtr) sqrtf(local_354.y * local_354.y + (float)local_368 * (float)local_368); if (1.0 < ABS((float)local_33c)) { local_360.x = ((-local_354.y * (250.0 - (float)local_33c)) / (float)local_33c) * 0.003 ; local_360.y = ((-(float)local_368 * (250.0 - (float)local_33c)) / (float)local_33c) * 0.003; Entity::AddVelocity_divided((Entity *)EVar14,&local_360,0); } tmpVec = Room::GetCenterPos(&tmpPos); local_348 = (EntityPtr)(tmpVec->y - *(float *)((int)EVar14 + 0x340)); local_370 = (EntityPtr)(tmpVec->x - *pfVar15); local_354.y = sqrtf((float)local_348 * (float)local_348 + (float)local_370 * (float)local_370); if (1.0 < ABS(local_354.y)) { local_368 = (EntityPtr)0x43480000; pEVar22 = (EntityPtr *)&local_354.y; if (200.0 <= local_354.y) { pEVar22 = &local_368; } local_360.y = (((float)*pEVar22 * (float)local_348) / local_354.y) * 0.002; local_360.x = (((float)*pEVar22 * (float)local_370) / local_354.y) * 0.002; Entity::AddVelocity_divided((Entity *)EVar14,&local_360,0); } if ((15.0 < *(float *)((int)EVar14 + 0xbb4) - (float)local_33c / 20.0) && (100.0 < (float)local_33c)) { tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&targetPos,0.0); *(float *)((int)EVar14 + 0x334) = tmpVec->x; *(float *)((int)EVar14 + 0x338) = tmpVec->y; *(undefined4 *)((int)EVar14 + 0xb64) = 3; } } else { *(undefined4 *)((int)EVar14 + 0x188) = 4; if (*(float *)((int)EVar14 + 0x364) <= 0.0) { pcVar16 = "HeadWiggleUp"; if (*(int *)((int)EVar14 + 0x2c) != 2) { pcVar16 = "Body1Wiggle"; } } else { pcVar16 = "HeadWiggle"; } ANM2::Play((ANM2 *)((int)EVar14 + 0x48),(byte *)pcVar16,0); EVar17 = tail; fVar24 = *(float *)((int)EVar14 + 0x39c) * *(float *)((int)EVar14 + 0xbb4) + *(float *)((int)EVar14 + 0x350); *(float *)((int)EVar14 + 0x34c) = *(float *)((int)EVar14 + 0x39c) * *(float *)((int)EVar14 + 0xbb0) + *(float *)((int)EVar14 + 0x34c); *(float *)((int)EVar14 + 0x350) = fVar24; if ((8.0 < fVar24) && (fVar24 - *(float *)((int)EVar14 + 0xbb4) * *(float *)((int)EVar14 + 0x39c) < 8.0)) { fVar24 = *(float *)((int)EVar14 + 0x364); fVar26 = *(float *)((int)EVar14 + 0x340); *(float *)((int)tail + 0x33c) = *(float *)((int)EVar14 + 0x360) + *pfVar15; *(float *)((int)tail + 0x340) = fVar24 + fVar26; *(undefined1 *)((int)tail + 0x171) = 1; *(undefined4 *)((int)tail + 0x410) = 0; ANM2::Play((ANM2 *)((int)tail + 0x48),(byte *)"Ground",0); if (*(char *)((int)EVar14 + 0x171) != '\0') { if (*(int *)((int)EVar14 + 0x2c) == 0) { fVar24 = 0.7; } else { fVar24 = 1.0; } Entity_NPC::PlaySound((Entity_NPC *)EVar14,0x42,fVar24,2,0,1.0); Entity_NPC::UpdateDirtColor((Entity_NPC *)EVar17,1); } *(undefined1 *)((int)EVar14 + 0x171) = 0; goto LAB_00479299; } } } goto LAB_00479293; } if (((((*(uint *)((int)EVar14 + 0x16c) & 0x10000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (uVar10 = Random(), (uVar10 & 1) == 0)) && (iVar11 = *(int *)((int)EVar14 + 0xbc0), iVar11 != 8)) { if (iVar11 == 9) goto LAB_00477c69; if (iVar11 == 10) goto LAB_00477edd; if (iVar11 == 0) goto LAB_00477c5c; LAB_00477c97: if ((((*(int *)((int)EVar14 + 0x2c) == 1) || ((*(int *)((int)EVar14 + 0x2c) == 2 && (*(short *)((int)EVar14 + 0xbc4) == 1)))) && (uVar10 = Random(), (uVar10 & 1) == 0)) && (*(int *)((int)EVar14 + 0xbc0) != 9)) { *(undefined4 *)((int)EVar14 + 0xbc0) = 9; *(undefined4 *)((int)EVar14 + 0xb64) = 9; bVar8 = ANM2::SetAnimation((ANM2 *)((int)EVar14 + 0x48),s_Attack2,1); if (bVar8 != 0) { AnimationState::Rewind((AnimationState *)((int)EVar14 + 0x78)); *(undefined1 *)((int)EVar14 + 0x8c) = 1; } } else if ((*(int *)((int)EVar14 + 0x2c) == 2) && (*(short *)((int)EVar14 + 0xbc4) == 1)) { uVar10 = Random(); iVar11 = (uVar10 & 1) * 2 + 8; *(int *)((int)EVar14 + 0xbc0) = iVar11; *(int *)((int)EVar14 + 0xb64) = iVar11; bVar8 = ANM2::SetAnimation((ANM2 *)((int)EVar14 + 0x48),(byte *)"Attack3Start",1); if (bVar8 != 0) { AnimationState::Rewind((AnimationState *)((int)EVar14 + 0x78)); *(undefined1 *)((int)EVar14 + 0x8c) = 1; } if (*(int *)((int)EVar14 + 0xb64) == 8) { tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&tmpPos,0.0); fVar26 = tmpVec->x - *(float *)((int)EVar14 + 0x33c); fVar24 = tmpVec->y - *(float *)((int)EVar14 + 0x340); effectColor = (ColorMod *)Color::Color(0x3f4ccccd); fVar24 = atan2f(fVar24,fVar26); local_354.y = fVar24 * 57.295776 * 0.017453292; local_368 = (EntityPtr)sin(local_354.y); local_360.x = cos(local_354.y); local_360.y = (float)local_368; local_378.x = 0.0; local_378.y = -80.0; local_368 = (EntityPtr) Entity::SpawnFollowingEffect198 ((Entity *)EVar14,&local_378,&local_360,0x3c,effectColor,4.0); uVar10 = *(uint *)((int)EVar14 + 0xbfc) & 3; iVar11 = *(int *)(*(int *)((int)EVar14 + 0xbf4) + (*(int *)((int)EVar14 + 0xbf8) - 1U & *(uint *)((int)EVar14 + 0xbfc) >> 2) * 4); pEVar22 = (EntityPtr *)(iVar11 + uVar10 * 4); if (*(int *)(iVar11 + uVar10 * 4) != 0) { local_354.y = (float)pEVar22; std::multiset::erase(&local_354.y); } *pEVar22 = local_368; if (local_368 != (EntityPtr)0x0) { std::multiset::insert(pEVar22); } } } else { *(undefined4 *)((int)EVar14 + 0xbc0) = 8; *(undefined4 *)((int)EVar14 + 0xb64) = 8; ANM2::Play((ANM2 *)((int)EVar14 + 0x48),s_Attack1,1); } Entity_NPC::UpdateDirtColor((Entity_NPC *)EVar14,1); *(undefined4 *)((int)EVar14 + 0x410) = 0; } else { LAB_00477c5c: if (*(int *)((int)EVar14 + 0xbc0) == 9) { LAB_00477c69: if (((*(int *)((int)EVar14 + 0x2c) == 2) && (*(short *)((int)EVar14 + 0xbc4) == 1)) && (uVar10 = Random(), uVar10 % 5 != 0)) goto LAB_00477c97; } LAB_00477edd: if (10 < g_game->_frameCount - *(int *)((int)EVar14 + 0x328)) { if (*(int *)((int)EVar14 + 0x2c) == 1) { fVar24 = 1.0; } else { fVar24 = 0.7; } Entity_NPC::PlaySound((Entity_NPC *)EVar14,0x40,fVar24,2,0,1.0); } if ((*(float *)((int)EVar14 + 0x334) == g_vectorZero.x) && (*(float *)((int)EVar14 + 0x338) == g_vectorZero.y)) { tmpVec = Room::GetCenterPos(&tmpPos); *(float *)((int)EVar14 + 0x334) = tmpVec->x; *(float *)((int)EVar14 + 0x338) = tmpVec->y; *(undefined4 *)((int)EVar14 + 0x15c) = 0; *(undefined4 *)((int)EVar14 + 0x350) = 0x41d00000; } else { *(undefined1 *)((int)tail + 0x171) = 1; *(undefined1 *)((int)EVar14 + 0x171) = 1; *(undefined4 *)((int)EVar14 + 0x15c) = *(undefined4 *)(*(int *)((int)EVar14 + 0x330) + 0x24); *(undefined4 *)((int)EVar14 + 0x350) = 0x40c00000; *(undefined4 *)((int)EVar14 + 0xbc0) = 4; } EVar17 = tail; local_368 = (EntityPtr)((int)EVar14 + 0x33c); local_364 = *(float *)((int)EVar14 + 0x338) - *(float *)((int)EVar14 + 0x340); local_340 = (EntityPtr)(*(float *)((int)EVar14 + 0x334) - *(float *)local_368); local_354.y = sqrtf(local_364 * local_364 + (float)local_340 * (float)local_340); if (1.0 < ABS(local_354.y)) { if (*(int *)((int)EVar14 + 0x2c) == 2) { local_340 = (EntityPtr)((float)local_340 / local_354.y); local_364 = local_364 / local_354.y; uVar10 = Random(); if ((uVar10 & 1) == 0) { fVar24 = 10.0; } else { fVar24 = 6.0; } *(float *)((int)EVar14 + 0x364) = fVar24 * local_364; *(float *)((int)EVar14 + 0x360) = fVar24 * (float)local_340; } else { *(float *)((int)EVar14 + 0x360) = ((float)local_340 / local_354.y) * 8.0; *(float *)((int)EVar14 + 0x364) = (local_364 / local_354.y) * 8.0; } } *(undefined4 *)((int)EVar14 + 0xb64) = 4; fVar24 = *(float *)((int)EVar14 + 0x340); fVar26 = *(float *)((int)EVar14 + 0x364); *(float *)((int)EVar17 + 0x33c) = *(float *)((int)EVar14 + 0x33c) + *(float *)((int)EVar14 + 0x360); *(float *)((int)EVar17 + 0x340) = fVar24 + fVar26; ANM2::Play((ANM2 *)((int)EVar17 + 0x48),(byte *)"Ground",0); *(undefined4 *)((int)EVar17 + 0x410) = 0; Entity_NPC::UpdateDirtColor((Entity_NPC *)EVar17,1); std::deque::_Tidy(); std::deque::_Tidy(); (self->_v1).x = 0.0; (self->_v1).y = -2.0 - local_354.y * 0.02; std::deque::push_back((void *)((int)EVar14 + 0xc04),(Vector *)local_368); std::deque::push_back((void *)((int)EVar14 + 0xc18),&self->_posOffset); EVar14 = (EntityPtr)self; } goto LAB_00479293; } *(undefined1 *)((int)tail + 0x171) = 0; *(undefined4 *)((int)EVar14 + 0x188) = 4; *(undefined1 *)((int)EVar14 + 0x171) = 1; *(undefined4 *)((int)EVar14 + 0x15c) = 0; *(float *)((int)EVar14 + 0x360) = g_vectorZero.x; *(float *)((int)EVar14 + 0x364) = g_vectorZero.y; *(undefined4 *)((int)EVar14 + 0x350) = 0; EVar17 = tail; if ((int)local_364 < 1) goto LAB_00479299; iVar11 = *(int *)((int)EVar14 + 0x410); do { manager = g_manager; if (*(int *)((int)EVar14 + 0xb64) == 9) { if (iVar11 == 0x14) { if (*(int *)((int)EVar14 + 0x2c) == 2) goto LAB_0047749c; } else if ((*(int *)((int)EVar14 + 0x2c) != 2) || (iVar11 != 0x2f)) goto LAB_00477bb4; local_33c = (EntityPtr)0x3f800000; if (*(int *)((int)EVar14 + 0xc64) == 0x12) { local_33c = (EntityPtr)0x3fc00000; } else if (*(int *)((int)EVar14 + 0xc64) == 0x13) { local_33c = (EntityPtr)0x3f000000; } local_340 = (EntityPtr)0xb2; seed_fart_sound_override((int *)&local_340); SoundEffects::Play(&manager->_sfxManager,(int)local_340,1.0,2,0,(float)local_33c,0.0); manager = g_manager; local_33c = (EntityPtr)0x3f800000; if (*(int *)((int)EVar14 + 0xc64) == 0x12) { local_33c = (EntityPtr)0x3fc00000; } else if (*(int *)((int)EVar14 + 0xc64) == 0x13) { local_33c = (EntityPtr)0x3f000000; } local_340 = (EntityPtr)0x75; seed_fart_sound_override((int *)&local_340); SoundEffects::Play(&manager->_sfxManager,(int)local_340,1.0,2,0,(float)local_33c,0.0); if (*(int *)((int)EVar14 + 0x2c) == 2) { ProjectileParams::ProjectileParams(&ringShotParams); ringShotParams.BulletFlags._0_4_ = (uint)ringShotParams.BulletFlags | 0x80000008; ringShotParams.Color._tint[0] = 0.3; ringShotParams.Color._tint[1] = 0.8; ringShotParams.Color._tint[2] = 0.8; ringShotParams.Color._tint[3] = 1.0; ringShotParams.Color._offset[0] = 0.54901963; ringShotParams.Color._offset[1] = 0.54901963; ringShotParams.Color._offset[2] = 0.54901963; ringShotParams.HeightModifier = -40.0; Entity_NPC::FireBossProjectiles ((Entity_NPC *)EVar14,0xc,&g_vectorZero,7.0,&ringShotParams); } else { ProjectileParams::ProjectileParams(&bossShotParams); bossShotParams.HeightModifier = -40.0; pEVar13 = Entity_NPC::GetPlayerTarget((Entity_NPC *)EVar14); local_360.x = (pEVar13->_pos).x; local_360.y = (pEVar13->_pos).y; Entity_NPC::FireBossProjectiles((Entity_NPC *)EVar14,0xf,&local_360,0.0,&bossShotParams); } LAB_00477b65: manager = g_manager; local_33c = (EntityPtr)0x3a7; seed_fart_sound_override((int *)&local_33c); SoundEffects::Play(&manager->_sfxManager,(int)local_33c,1.0,2,0,1.0,0.0); } else { if (*(int *)((int)EVar14 + 0xb64) == 8) { if (iVar11 != 0x2e) { if (iVar11 == 0x2f) { iVar11 = *(int *)((int)EVar14 + 0x2c); } else { if (iVar11 != 0x30) goto LAB_00477bb4; iVar11 = *(int *)((int)EVar14 + 0x2c); } if (iVar11 != 1) goto LAB_0047749c; } local_33c = (EntityPtr)0x3f800000; if (*(int *)((int)EVar14 + 0xc64) == 0x12) { local_33c = (EntityPtr)0x3fc00000; } else if (*(int *)((int)EVar14 + 0xc64) == 0x13) { local_33c = (EntityPtr)0x3f000000; } local_340 = (EntityPtr)0xb2; seed_fart_sound_override((int *)&local_340); SoundEffects::Play(&manager->_sfxManager,(int)local_340,1.0,2,0,(float)local_33c,0.0); manager = g_manager; local_33c = (EntityPtr)0x3f800000; iVar11 = *(int *)((int)EVar14 + 0xc64); if (*(int *)((int)EVar14 + 0x2c) == 0) { if (iVar11 == 0x12) { local_33c = (EntityPtr)0x3fc00000; } else if (iVar11 == 0x13) { local_33c = (EntityPtr)0x3f000000; } local_340 = (EntityPtr)0x19; seed_fart_sound_override((int *)&local_340); fVar24 = 0.8; } else { if (iVar11 == 0x12) { local_33c = (EntityPtr)0x3fc00000; } else if (iVar11 == 0x13) { local_33c = (EntityPtr)0x3f000000; } local_340 = (EntityPtr)0xd; seed_fart_sound_override((int *)&local_340); fVar24 = 1.0; } SoundEffects::Play(&manager->_sfxManager,(int)local_340,fVar24,2,0,(float)local_33c,0.0); if ((*(int *)((int)EVar14 + 0x2c) == 0) && (*(int *)((int)EVar14 + 0x30) == 1)) { ProjectileParams::ProjectileParams(&arcShotParams); local_354.x = *(float *)((int)EVar14 + 0x33c) + 0.0; local_354.y = *(float *)((int)EVar14 + 0x340) - 20.0; arcShotParams.BulletFlags._0_4_ = (uint)arcShotParams.BulletFlags | 0x800; arcShotParams.FallingAccelModifier = -0.06; local_378.x = 8.0; local_378.y = 6.0; arcShotParams.TargetPosition.x = local_354.x; arcShotParams.TargetPosition.y = local_354.y; Entity_NPC::FireProjectiles((Entity_NPC *)EVar14,&local_354,&local_378,9,&arcShotParams) ; } else { params.GridCollision = 1; params.HeightModifier = 0.0; params.FallingSpeedModifier = 0.0; params.FallingAccelModifier = 0.0; params.VelocityMulti = 1.0; params.Scale = 1.0; uVar10 = Random(); params.Color._offset[0] = 0.0; params.Color._offset[1] = 0.0; params.Color._offset[2] = 0.0; params.DotProductLimit = -1000.0; params.WiggleFrameOffset = 0; params.ChangeVelocity = 0.0; params.PositionOffset.x = g_vectorZero.x; params.TargetPosition.x = g_vectorZero.x; params.FireDirectionLimit.x = g_vectorZero.x; params.ChangeTimeout = 0x1e; params.DepthOffset = 0.0; params.Variant = 0; local_a8 = 0; local_a4 = &DAT_bf800000; local_a0 = 0; local_9c = 0; params.CircleAngle = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; params.HomingStrength = 1.0; params.CurvingStrength = 0.005; params.Acceleration = 1.01; params.Spread = 1.0; params.Color._tint[0] = 1.0; params.Color._tint[1] = 1.0; params.Color._tint[2] = 1.0; params.Color._tint[3] = 1.0; params.Color._colorize[0] = 0.0; params.Color._colorize[1] = 0.0; params.Color._colorize[2] = 0.0; params.Color._colorize[3] = 0.0; params.BulletFlags = 0; params.PositionOffset.y = g_vectorZero.y; params.TargetPosition.y = g_vectorZero.y; params.FireDirectionLimit.y = g_vectorZero.y; params.ChangeFlags = 0; pEVar13 = Entity_NPC::GetPlayerTarget((Entity_NPC *)EVar14); local_36c = (pEVar13->_pos).x; local_368 = (EntityPtr)(pEVar13->_pos).y; bigShot = Entity_NPC::FireBossProjectiles ((Entity_NPC *)EVar14,1,&local_36c,10.0,¶ms); fVar24 = (bigShot->_velocity).y; uVar28 = *(undefined4 *)((int)&bigShot->_projectileFlags + 4); *(uint *)&bigShot->_projectileFlags = (uint)bigShot->_projectileFlags | 2; bigShot->_fallingAccel = bigShot->_fallingAccel - 0.3; fVar26 = bigShot->_fallingSpeed; *(undefined4 *)((int)&bigShot->_projectileFlags + 4) = uVar28; bigShot->_scale = 1.6; bigShot->_fallingSpeed = fVar26 * 0.7 - 13.0; bigShot->_height = bigShot->_height - 40.0; (bigShot->_velocity).y = fVar24 * 0.55; (bigShot->_velocity).x = (bigShot->_velocity).x * 0.55; } goto LAB_00477b65; } LAB_00477bb4: if (iVar11 < 0x69) { LAB_0047749c: if ((*(int *)((int)EVar14 + 0x7c) == 0) || (*(char *)((int)EVar14 + 0x8c) == '\0')) goto LAB_004774ab; } else { *(undefined4 *)((int)EVar14 + 0xb64) = 3; tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)EVar14,&tmpPos,0.0); *(float *)((int)EVar14 + 0x334) = tmpVec->x; *(float *)((int)EVar14 + 0x338) = tmpVec->y; *(undefined4 *)((int)EVar14 + 0x410) = 0; LAB_004774ab: *(undefined4 *)((int)EVar14 + 0x188) = 0; *(undefined1 *)((int)EVar14 + 0x171) = 0; } } *(int *)((int)EVar14 + 0x410) = *(int *)((int)EVar14 + 0x410) + 1; local_364 = (float)((int)local_364 + -1); iVar11 = *(int *)((int)EVar14 + 0x410); } while (local_364 != 0.0); local_364 = 0.0; goto LAB_00479293; } if (EVar14 == tail) { iVar11 = *(int *)((int)EVar14 + 0x2c); iVar20 = *(int *)((int)EVar14 + 0x410) + 1; *(undefined4 *)((int)EVar14 + 0x188) = 0; *(undefined4 *)((int)EVar14 + 0x15c) = 0; *(int *)((int)EVar14 + 0x410) = iVar20; if (((iVar20 == 0xf) && ((iVar11 == 0 || (iVar11 == 2)))) || ((iVar20 == 0x19 && (iVar11 == 1))) ) { bVar8 = ANM2::SetAnimation((ANM2 *)((int)EVar14 + 0x48),(byte *)"HoleClose",1); if (bVar8 != 0) { AnimationState::Rewind((AnimationState *)((int)EVar14 + 0x78)); *(undefined1 *)((int)EVar14 + 0x8c) = 1; } Entity_NPC::UpdateDirtColor((Entity_NPC *)EVar14,1); } if ((*(int *)((int)EVar14 + 0x7c) == 0) || (*(char *)((int)EVar14 + 0x8c) == '\0')) { *(undefined1 *)((int)EVar14 + 0x171) = 0; } EVar17 = tail; if (*(int *)((int)EVar14 + 0x3bc) != 0) { *(undefined4 *)((int)EVar14 + 0x380) = *(undefined4 *)(*(int *)((int)EVar14 + 0x3bc) + 0x380); } goto LAB_00479299; } if (*(char *)((int)EVar14 + 0x171) != '\0') { *(undefined4 *)((int)EVar14 + 0x15c) = *(undefined4 *)(*(int *)((int)EVar14 + 0x330) + 0x24); } if (*(int *)((int)local_358 + 0xb64) != 4) { *(undefined1 *)((int)EVar14 + 0x171) = 0; *(undefined4 *)((int)EVar14 + 0x188) = 0; goto LAB_00479293; } iVar11 = *(int *)((int)EVar14 + 0x2c); wiggleAnim = &s_empty; if (iVar11 == 0) { wiggleAnim = (byte *)"Body2Wiggle"; } else if (iVar11 == 1) { switch(local_340) { case (EntityPtr)0x1: case (EntityPtr)0x3: case (EntityPtr)0x4: case (EntityPtr)0x5: case (EntityPtr)0x6: goto switchD_00478fe8_caseD_1; case (EntityPtr)0x2: case (EntityPtr)0x7: goto switchD_00478fe8_caseD_2; case (EntityPtr)0x8: wiggleAnim = (byte *)"TailWiggle"; } } else if (iVar11 == 2) { uVar10 = (int)local_340 - 1; if (uVar10 < 5) { if (*(short *)((int)EVar14 + 0xbc4) == 0) { switch(uVar10) { case 0: case 2: goto switchD_00478fe8_caseD_1; default: goto switchD_00478fe8_caseD_2; } } switch(uVar10) { default: wiggleAnim = (byte *)"Body1Wiggle"; break; case 1: switchD_00478fe8_caseD_1: wiggleAnim = (byte *)"Body2Wiggle"; break; case 3: switchD_00478fe8_caseD_2: wiggleAnim = (byte *)"Body3Wiggle"; break; case 4: wiggleAnim = (byte *)"TailWiggleUp"; } } } ANM2::Play((ANM2 *)((int)EVar14 + 0x48),wiggleAnim,0); if (*(int *)((int)EVar14 + 0x2c) == 1) { iVar11 = *(int *)(&DAT_00b1dc48 + (int)EVar17 * 4); } else { iVar11 = *(int *)(&DAT_00b1dc04 + (int)EVar17 * 4); } if (iVar11 < *(int *)((int)local_358 + 0xc14)) { uVar10 = *(int *)((int)local_358 + 0xc10) + iVar11; uVar12 = uVar10 & 1; iVar20 = *(int *)(*(int *)((int)local_358 + 0xc08) + (*(int *)((int)local_358 + 0xc0c) - 1U & uVar10 >> 1) * 4); *(undefined4 *)((int)EVar14 + 0x33c) = *(undefined4 *)(iVar20 + uVar12 * 8); *(undefined4 *)((int)EVar14 + 0x340) = *(undefined4 *)(iVar20 + 4 + uVar12 * 8); *(float *)((int)EVar14 + 0x360) = g_vectorZero.x; *(float *)((int)EVar14 + 0x364) = g_vectorZero.y; local_58.y = *(float *)((int)local_358 + 0xc24); uVar10 = (int)local_58.y + iVar11 & 1; iVar11 = *(int *)(*(int *)((int)local_358 + 0xc1c) + (*(int *)((int)local_358 + 0xc20) - 1U & (uint)((int)local_58.y + iVar11) >> 1) * 4); *(undefined4 *)((int)EVar14 + 0x34c) = *(undefined4 *)(iVar11 + uVar10 * 8); *(undefined4 *)((int)EVar14 + 0x350) = *(undefined4 *)(iVar11 + 4 + uVar10 * 8); fVar24 = *(float *)((int)EVar14 + 0x350); if (16.0 <= fVar24) { uVar28 = 0; } else { uVar28 = 4; } *(undefined4 *)((int)EVar14 + 0x188) = uVar28; *(bool *)((int)EVar14 + 0x171) = 16.0 > fVar24 && fVar24 < 24.0; if ((((*(int *)((int)EVar14 + 0x2c) == 0) || (*(int *)((int)EVar14 + 0x2c) == 2)) && (local_340 == (EntityPtr)0x4)) && ((bVar8 = Entity::HasEntityFlags((Entity *)EVar14,0x1000000000000000), bVar8 == 0 || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)))) { if (0 < *(int *)((int)EVar14 + 0xba0)) { *(int *)((int)EVar14 + 0xba0) = *(int *)((int)EVar14 + 0xba0) + -1; } uVar10 = Random(); if ((((uVar10 & 1) == 0) && (*(float *)((int)EVar14 + 0x350) <= -20.0 && *(float *)((int)EVar14 + 0x350) != -20.0)) && (*(int *)((int)EVar14 + 0xba0) < 1)) { *(undefined4 *)((int)EVar14 + 0xba0) = 0x1e; ProjectileParams::ProjectileParams(¶ms); if (*(int *)((int)EVar14 + 0x2c) == 2) { if (*(short *)((int)EVar14 + 0xbc4) == 1) { params.BulletFlags = params.BulletFlags | 0x10000; } LAB_00479201: local_378.x = 5.0; local_378.y = 0.0; tmpVec = &local_378; uVar10 = 7; } else { if ((*(int *)((int)EVar14 + 0x2c) != 0) || (*(int *)((int)EVar14 + 0x30) != 1)) goto LAB_00479201; local_360.x = 8.0; local_360.y = 6.0; tmpVec = &local_360; uVar10 = 9; } Entity_NPC::FireProjectiles ((Entity_NPC *)EVar14,(Vector *)((int)EVar14 + 0x33c),tmpVec,uVar10,¶ms); SoundEffects::PlayWithFartOverride(0x3a7,1.0,2,0,1.0); } } } LAB_00479293: EVar17 = tail; LAB_00479299: iVar11 = *(int *)((int)EVar14 + 0x2c); if (iVar11 == 2) { if (*(char *)((int)EVar14 + 0x173) != '\0') { if (*(short *)((int)EVar14 + 0xbc4) == 0) { Entity_NPC::PlaySound((Entity_NPC *)EVar14,0x1c,1.0,2,0,1.0); iVar11 = *(int *)((int)EVar14 + 0x3bc); local_340 = EVar14; if (iVar11 != 0) { pEVar22 = local_37c; do { iVar11 = __RTDynamicCast(iVar11,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } local_340 = *pEVar22; iVar11 = *(int *)((int)local_340 + 0x3bc); pEVar22 = (EntityPtr *)((int)local_340 + 0x3bc); } while (iVar11 != 0); EVar14 = (EntityPtr)self; } do { EVar17 = local_340; piVar21 = (int *)(*(uint *)((int)local_340 + 0x16c) & 0x10000000); if (piVar21 == (int *)0x0) { iVar11 = *(int *)(*(int *)((int)EVar14 + 0x330) + 0x50); *(int *)((int)local_340 + 900) = iVar11; } else { iVar11 = *(int *)((int)local_340 + 900); } *(short *)((int)local_340 + 0xbc4) = *(short *)((int)local_340 + 0xbc4) + 1; *(int *)((int)local_340 + 0x380) = iVar11; *(undefined1 *)((int)local_340 + 0x173) = 0; local_33c = (EntityPtr)0x0; if (*(int *)((int)local_340 + 200) != 0) { do { layer = ANM2::GetLayer((ANM2 *)((int)EVar17 + 0x48),(byte *)local_33c); if (layer->_layerData == (void *)0x0) { fVar24 = -NAN; } else { fVar24 = *(float *)((int)layer->_layerData + 4); } if (fVar24 == 0.0) { local_50._offset[2] = 2.10195e-44; local_50._colorize[1] = 0.0; local_50._offset[1] = fVar24; std::string::assign((char *)(local_50._colorize + 1), (byte *)"gfx/Bosses/Afterbirth/Boss_TheFrail2.png",0x28); local_14 = 2.8026e-45; bVar8 = Entity::HasEntityFlags((Entity *)EVar14,0x1000000000000000); if (bVar8 != 0) { std::string::replace ((char *)(local_50._colorize + 1),4,6, (byte *)"Bosses/AfterbirthPlus/DeliriumForms",0x23); } sheetPath = (std_string *) Menu_Character::ChangeCharacterPage ((Menu_Character *)EVar14,&local_80,local_50._colorize + 1); local_14 = (float)CONCAT31(local_14._1_3_,3); Sprite::ReplaceSpritesheet((Sprite *)((int)EVar17 + 0x48),(int)local_33c,sheetPath); std::string::_Tidy_deallocate((char *)&local_80); local_14 = -NAN; if (0xf < (uint)local_50._offset[2]) { uVar10 = (int)local_50._offset[2] + 1; pcVar16 = (char *)local_50._colorize[1]; if (0xfff < uVar10) { pcVar16 = *(char **)((int)local_50._colorize[1] + -4); uVar10 = (int)local_50._offset[2] + 0x24; if ((char *)0x1f < (char *)((int)local_50._colorize[1] + (-4 - (int)pcVar16))) { LAB_004770e8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar16,uVar10); } } piVar21 = (int *)((int)EVar17 + 0x48); local_33c = (EntityPtr)((int)local_33c + 1); } while ((uint)local_33c < (uint)*(EntityPtr *)((int)EVar17 + 200)); } ANM2::LoadGraphics((ANM2 *)((int)EVar17 + 0x48),(byte)piVar21); if (*(char *)((int)EVar17 + 0x151) != '\0') { AnimationState::Update((AnimationState *)((int)EVar17 + 0x78)); AnimationState::Update((AnimationState *)((int)EVar17 + 0x98)); } *(int *)((int)EVar17 + 0xc) = *(int *)((int)EVar17 + 8); local_354.y = (float)((int)EVar17 + 0x1e4); *(int *)((int)EVar17 + 0x14) = 0; *(int *)((int)EVar17 + 0x18) = 0; *(int *)((int)EVar17 + 0x1c) = 0; local_364 = 4.2039e-45; do { uVar10 = Random(); local_348 = (EntityPtr) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0); uVar10 = Random(); local_33c = *(EntityPtr *)(&DAT_00b1dc3c + (uVar10 % 3) * 4); if ((local_33c == (EntityPtr)0x3) && (EVar17 != local_358)) { uVar10 = Random(); local_33c = *(EntityPtr *)(&DAT_00b1dc3c + (uVar10 & 1) * 4); } uVar10 = Random(); uVar12 = Random(); fVar24 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_37c = (EntityPtr *)(fVar24 + fVar24); fVar24 = cos((float)local_37c); local_360.x = fVar24 * (float)local_348; fVar24 = sin((float)local_37c); local_360.y = fVar24 * 0.5 * (float)local_348; uVar12 = Random(); fVar24 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_37c = (EntityPtr *)(fVar24 + fVar24); fVar24 = cos((float)local_37c); local_378.x = fVar24 * 0.5 * *(float *)((int)local_340 + 0x370) + *(float *)((int)local_340 + 0x33c); fVar24 = sin((float)local_37c); uVar31 = 0; pTVar30 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar28 = 0; local_378.y = fVar24 * 0.5 * *(float *)((int)local_340 + 0x370) + *(float *)((int)local_340 + 0x340); pEVar13 = Game::Spawn(g_game,1000,5,&local_378,&local_360,(Entity *)EVar14, (uint)local_33c,uVar10); iVar11 = __RTDynamicCast(pEVar13,uVar28,pTVar29,pTVar30,uVar31); EVar17 = local_340; if ((EntityPtr *)(iVar11 + 0x1e4) != (EntityPtr *)local_354.y) { EVar23 = *(EntityPtr *)((int)local_354.y + 4); EVar2 = *(EntityPtr *)((int)local_354.y + 8); EVar4 = *(EntityPtr *)((int)local_354.y + 0xc); *(EntityPtr *)(iVar11 + 0x1e4) = *(EntityPtr *)local_354.y; *(EntityPtr *)(iVar11 + 0x1e8) = EVar23; *(EntityPtr *)(iVar11 + 0x1ec) = EVar2; *(EntityPtr *)(iVar11 + 0x1f0) = EVar4; iVar20 = *(int *)((int)local_340 + 0x1f8); iVar5 = *(int *)((int)local_340 + 0x1fc); iVar6 = *(int *)((int)local_340 + 0x200); *(int *)(iVar11 + 500) = *(int *)((int)local_340 + 500); *(int *)(iVar11 + 0x1f8) = iVar20; *(int *)(iVar11 + 0x1fc) = iVar5; *(int *)(iVar11 + 0x200) = iVar6; *(undefined8 *)(iVar11 + 0x204) = *(undefined8 *)((int)local_340 + 0x204); *(int *)(iVar11 + 0x20c) = *(int *)((int)local_340 + 0x20c); } local_364 = (float)((int)local_364 + -1); } while (local_364 != 0.0); uVar10 = Random(); uVar31 = 0; pTVar30 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar28 = 0; pEVar13 = Game::Spawn(g_game,1000,0x4d,(Vector *)((int)EVar17 + 0x33c),&g_vectorZero, (Entity *)EVar14,0,uVar10); piVar21 = (int *)__RTDynamicCast(pEVar13,uVar28,pTVar29,pTVar30,uVar31); (**(code **)(*piVar21 + 0x3c))((int)EVar14 + 0x1e4,0xffffffff,0xff,0,1); if ((*(int *)((int)EVar17 + 0x3c0) != 0) && (iVar11 = __RTDynamicCast(*(int *)((int)EVar17 + 0x3c0),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar11 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } local_340 = *(EntityPtr *)((int)EVar17 + 0x3c0); } while (local_340 != (EntityPtr)0x0); local_340 = (EntityPtr)0x0; } else { uVar10 = Random(); local_364 = (float)((uVar10 & 3) + 3); if (local_364 != 0.0) { do { uVar10 = Random(); fVar24 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_348 = (EntityPtr)(fVar24 + fVar24); uVar10 = Random(); local_33c = (EntityPtr) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 5.0); fVar24 = cos((float)local_348); local_368 = (EntityPtr)(fVar24 * (float)local_33c); local_360.x = (float)local_368; fVar24 = sin((float)local_348); local_370 = (EntityPtr)(fVar24 * (float)local_33c); local_360.y = (float)local_370; uVar10 = Random(); local_37c = *(EntityPtr **)((int)EVar14 + 0x33c); local_354.y = *(float *)((int)EVar14 + 0x340); uVar12 = Random(); fVar24 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_348 = (EntityPtr)(fVar24 + fVar24); uVar12 = Random(); local_33c = (EntityPtr) ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar24 = cos((float)local_348); local_378.x = fVar24 * (float)local_33c + (float)local_37c; fVar24 = sin((float)local_348); uVar31 = 0; pTVar30 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_378.y = fVar24 * (float)local_33c + local_354.y; pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar28 = 0; pEVar13 = Game::Spawn(g_game,1000,0x3b,&local_378,&local_360,(Entity *)EVar14,0,uVar10); EVar17 = (EntityPtr)__RTDynamicCast(pEVar13,uVar28,pTVar29,pTVar30,uVar31); local_348 = (EntityPtr)0x3f800000; if ((*(float *)((int)EVar17 + 0x340) - *(float *)((int)EVar14 + 0x340)) * -(float)local_368 + (*(float *)((int)EVar17 + 0x33c) - *(float *)((int)EVar14 + 0x33c)) * (float)local_370 < 0.0) { local_348 = (EntityPtr)&DAT_bf800000; } local_33c = EVar17; uVar10 = Random(); *(float *)((int)EVar17 + 0x474) = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_348; uVar10 = Random(); iVar11 = uVar10 % 0xf + 0xf; *(int *)((int)EVar17 + 0x45c) = iVar11; *(int *)((int)EVar17 + 0x460) = iVar11; pcVar3 = *(code **)(*(int *)EVar17 + 0x3c); uVar10 = Random(); local_37c = (EntityPtr *) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10); Color::Reset(&local_50); local_50._tint[3] = (float)local_37c * 0.5 + 0.2; local_50._tint[0] = 1.0; local_50._tint[1] = 1.0; local_50._tint[2] = 1.0; local_50._offset[0] = 0.0; local_50._offset[1] = 0.0; local_50._offset[2] = 0.0; (*pcVar3)(&local_50,0xffffffff,0xff,0,1); (**(code **)(*(int *)local_33c + 0xc))(); bVar8 = Entity::HasEntityFlags((Entity *)EVar14,0x1000000000000000); if (bVar8 != 0) { EVar17 = tail; do { local_90 = 0; local_8c = 0; local_88 = 0; local_84 = 0; local_80 = g_vectorZero.x; local_7c = g_vectorZero.y; local_78 = g_vectorZero.x; local_74 = g_vectorZero.y; local_70 = 0; local_6c = 0; (**(code **)(*(int *)EVar17 + 0x24))(&local_90); EVar17 = *(EntityPtr *)((int)EVar17 + 0x3bc); } while (EVar17 != (EntityPtr)0x0); } local_364 = (float)((int)local_364 + -1); } while (local_364 != 0.0); local_364 = 0.0; } } } } else if (((iVar11 == 0) || (iVar11 == 1)) && (*(char *)((int)EVar14 + 0x173) != '\0')) { EVar23 = (EntityPtr)(*(uint *)((int)EVar14 + 0x16c) & 0x10000000); while (EVar23 != (EntityPtr)0x0) { local_50._tint[1] = 0.0; local_50._tint[2] = 0.0; local_50._tint[3] = 0.0; local_50._colorize[0] = 0.0; local_50._offset[1] = 0.0; local_50._offset[2] = 0.0; local_50._colorize[1] = g_vectorZero.x; local_50._colorize[2] = g_vectorZero.y; local_50._colorize[3] = g_vectorZero.x; local_50._offset[0] = g_vectorZero.y; (**(code **)(*(int *)EVar17 + 0x24))(local_50._tint + 1); EVar17 = *(EntityPtr *)((int)EVar17 + 0x3bc); EVar23 = EVar17; } } if (*(int *)((int)EVar14 + 0x7c) != 0) { bVar8 = AnimationState::IsEventTriggered((AnimationState *)((int)EVar14 + 0x78),&DAT_00b1d33c); manager = g_manager; if (bVar8 != 0) { local_348 = (EntityPtr)0x3a4; seed_fart_sound_override((int *)&local_348); SoundEffects::Play(&manager->_sfxManager,(int)local_348,1.0,2,0,1.0,0.0); } if (*(int *)((int)EVar14 + 0x7c) != 0) { bVar8 = AnimationState::IsEventTriggered ((AnimationState *)((int)EVar14 + 0x78),(byte *)"Popup"); manager = g_manager; if (bVar8 != 0) { local_348 = (EntityPtr)0x3a5; seed_fart_sound_override((int *)&local_348); SoundEffects::Play(&manager->_sfxManager,(int)local_348,1.0,2,0,1.0,0.0); } } } ExceptionList = local_1c; return; } //@@ 00479d50 FUN_00479d50 void FUN_00479d50(undefined4 *param_1) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; *in_ECX = *param_1; in_ECX[2] = param_1[2]; return; } //@@ 00479d80 NpcAI::ENTITY_PRIDE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 52 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PRIDE(Entity_NPC *npc) { float fVar1; byte bVar2; undefined4 *puVar3; uint rngResult; ProjectileParams *params; Entity_Laser *laser; undefined4 *puVar4; undefined4 *puVar5; int iVar6; float fVar7; char *anim; byte *anim_00; undefined1 auStack_130 [4]; undefined4 *local_12c; undefined4 *local_128; Vector local_124; Vector local_11c; undefined4 *eventCursor; undefined4 local_110 [11]; undefined4 laserColor; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 local_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; ProjectileParams projParams; uint local_c; Manager *manager; Room *room; ANM2 *sprite; int variant; local_c = __security_cookie ^ (uint)auStack_130; iVar6 = npc->_state; if (iVar6 == 0) { npc->_state = 4; if (&npc->_splatColor == (ColorMod *)local_110) { return; } (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.2; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.2; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } puVar3 = (npc->_damageEvents)._begin; local_128 = (npc->_damageEvents)._end; eventCursor = puVar3; if (puVar3 != local_128) { local_12c = puVar3 + 0xe; puVar4 = local_12c; do { if (puVar4[-8] == npc->_type) { puVar5 = puVar4; if (puVar4 != local_128) { puVar3 = puVar4; puVar5 = puVar4 + -3; do { puVar5[-0xb] = *puVar3; puVar3 = puVar3 + 0xe; puVar5[-9] = puVar5[5]; puVar5[-8] = puVar5[6]; puVar5[-7] = puVar5[7]; puVar5[-6] = puVar5[8]; puVar5[-5] = puVar5[9]; puVar5[-4] = puVar5[10]; puVar5[-3] = puVar5[0xb]; puVar5[-2] = puVar5[0xc]; puVar5[-1] = puVar5[0xd]; *puVar5 = puVar5[0xe]; puVar5[1] = puVar5[0xf]; puVar5[2] = puVar5[0x10]; puVar5 = puVar5 + 0xe; } while (puVar3 != local_128); local_128 = (npc->_damageEvents)._end; puVar3 = eventCursor; puVar5 = local_12c; } local_128 = local_128 + -0xe; (npc->_damageEvents)._end = local_128; local_124.x = (float)puVar4; } else { puVar3 = puVar3 + 0xe; puVar5 = puVar4 + 0xe; local_12c = puVar5; eventCursor = puVar3; } puVar4 = puVar5; } while (puVar3 != local_128); iVar6 = npc->_state; } npc->_friction = npc->_friction * 0.75; local_11c.x = (float)npc; if (iVar6 == 4) { fVar7 = (npc->_velocity).x; fVar1 = (npc->_velocity).y; fVar7 = sqrtf(fVar7 * fVar7 + fVar1 * fVar1); sprite = &npc->_sprite; if (1.0 <= fVar7) { fVar7 = (npc->_velocity).y; if (ABS((npc->_velocity).x) <= ABS(fVar7)) { if (fVar7 <= 0.0) { anim = (char *)&DAT_00b1e020; } else { anim = "WalkDown"; } ANM2::Play(sprite,(byte *)anim,0); } else { ANM2::Play(sprite,(byte *)"WalkHori",0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } } else { bVar2 = ANM2::SetAnimation(sprite,(byte *)"WalkDown",1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } } PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); rngResult = Random(); if (rngResult % 0x32 == 0) { npc->_stateFrame = 0; rngResult = Random(); if ((rngResult & 1) == 0) { npc->_state = 8; anim_00 = &DAT_00b1d53c; } else { npc->_state = 9; anim_00 = &DAT_00b1d554; } bVar2 = ANM2::SetAnimation(&npc->_sprite,anim_00,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } goto LAB_0047a346; } if (iVar6 == 8) { if ((npc->_variant == 1) && (npc->_stateFrame == 0x14)) { params = ProjectileParams::ProjectileParams(&projParams); local_124.x = (npc->_pos).x - 0.0; local_11c.x = 8.0; local_11c.y = 6.0; local_124.y = (npc->_pos).y - -20.0; Entity_NPC::FireProjectiles(npc,&local_124,&local_11c,9,params); } manager = g_manager; iVar6 = npc->_stateFrame; if (iVar6 == 0xc) { local_128 = (undefined4 *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_128 = (undefined4 *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_128 = (undefined4 *)0x3f000000; } local_12c = (undefined4 *)0x387; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,(float)local_128,0.0); iVar6 = npc->_stateFrame; } if (iVar6 == 0x14) { local_11c.y = -20.0; local_12c = (undefined4 *)0x0; local_11c.x = 0.0; do { local_124.x = (npc->_pos).x + 0.0; local_124.y = (npc->_pos).y - 10.0; laser = Entity_Laser::ShootAngle (4,&local_124,(float)(int)local_12c * 90.0 + 45.0,0x11,&local_11c, (Entity *)npc,0); if (npc->_variant == 1) { local_c4 = 0x3f52d2d4; local_d4 = 0; uStack_d0 = 0; uStack_cc = 0; uStack_c8 = 0; laserColor = 0x3f61e1e3; uStack_e0 = 0x3f028283; uStack_dc = 0x3ef0f0f2; uStack_d8 = 0x3f800000; local_c0 = 0x3e70f0f2; local_bc = 0x3f34b4b5; (**(code **)(*(int *)laser + 0x3c))(&laserColor,0xffffffff,0xff,0,1); } (**(code **)(*(int *)laser + 0xc))(); local_12c = (undefined4 *)((int)local_12c + 1); } while ((int)local_12c < 4); goto LAB_0047a346; } } else { if (iVar6 != 9) goto LAB_0047a346; iVar6 = npc->_stateFrame + -6; if (iVar6 == 1) { Entity_NPC::PlaySound(npc,0x134,1.0,2,0,1.0); LAB_0047a28c: if (iVar6 == (iVar6 / 5) * 5) { variant = npc->_variant; local_11c.x = (float)(4 - (variant != 1)); if (variant == 0) { if (iVar6 < 0x14) goto LAB_0047a2cf; } else if ((variant == 1) && (iVar6 < 10)) { LAB_0047a2cf: Room::get_random_pickup_position(g_game->_room,&local_124,0,0); room = g_game->_room; iVar6 = Room::GetGridIndex(room,&local_124); Room::SetGridPath(room,iVar6,900); rngResult = Random(); Game::SpawnEx(g_game,4,(uint)local_11c.x,&local_124,&g_vectorZero,(Entity *)npc,0, rngResult,0); } } } else if (-1 < iVar6) goto LAB_0047a28c; iVar6 = npc->_stateFrame; } if (0x2d < iVar6) { npc->_state = 4; } LAB_0047a346: npc->_stateFrame = npc->_stateFrame + 1; return; } //@@ 0047a360 NpcAI::ENTITY_CHUB /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 28 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CHUB(Entity_NPC *npc) { uint *puVar1; float fVar2; undefined1 *puVar3; undefined1 *puVar4; undefined1 *puVar5; code *pcVar6; uint uVar7; undefined4 *ptr; GridEntity *pGVar8; ANM2 *pAVar9; qword qVar10; byte bVar11; EntityPtr EVar12; EntityPtr *pEVar13; int iVar14; uint uVar15; byte *pbVar16; Entity_NPC *pEVar17; float *pfVar18; Entity_NPC *pEVar19; GridEntity *poop; EntityList *chubList; char *downAnim; void *pvVar20; Entity_Player *this; uint uVar21; int iVar22; Entity *pEVar23; byte *pbVar24; int unused; int unused_00; int unused_01; char *anim; Entity_NPC *this_00; int unused_02; int unused_03; EntityPtr EVar25; qword *allocatedBytes; code *extraout_EDX; undefined1 *puVar26; int *gridSlot; code *extraout_EDX_00; AnimationState *pAVar27; Vector *tmpVec; bool bVar28; float fVar29; EntityPtr EVar30; float fVar31; float fVar32; undefined1 *puVar33; void *pvVar34; undefined8 uVar35; undefined4 uVar36; TypeDescriptor *pTVar37; TypeDescriptor *pTVar38; undefined4 uVar39; undefined4 uStack_2bc; undefined4 uStack_2b8; undefined4 uStack_2b4; undefined4 uStack_2b0; float fStack_2ac; float fStack_2a8; float fStack_2a4; float fStack_2a0; undefined4 uStack_29c; undefined4 uStack_298; undefined1 auStack_294 [16]; Vector VStack_284; Vector VStack_27c; Vector VStack_274; Vector VStack_26c; Vector VStack_264; Vector VStack_25c; Vector VStack_254; Vector VStack_24c; char cStack_241; Entity *pEStack_240; AnimationState *pAStack_23c; ProjectileParams PStack_238; undefined4 uStack_18c; EntityPtr in_stack_fffffe78; Vector *in_stack_fffffe80; char *pcVar40; undefined1 auStack_15a [2]; EntityRef emptyRef; undefined4 local_124; undefined4 local_120; undefined4 local_11c; undefined4 local_118; float local_114; float local_110; float local_10c; float local_108; undefined4 local_104; undefined4 local_100; EntityRef selfRef; undefined1 local_d4 [12]; EntityPtr local_c8; Entity_NPC *self; Vector local_c0; Vector local_b8; Vector local_ac [2]; EntityPtr local_9c; EntityPtr local_98; char local_91; EntityPtr local_90; EntityPtr local_8c; int local_88; char *local_84; undefined1 *local_80; int local_7c; undefined8 local_78; undefined4 local_70; undefined4 local_6c; undefined4 local_68; char *local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined8 local_50; undefined4 local_48; char *local_44; void *local_40; int local_3c; int local_38; int local_34; undefined8 local_30; uint local_24; int iStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; undefined4 *nextNode; std_deque *positionHistory; local_14 = 0xffffffff; puStack_18 = &LAB_00af2b1b; local_1c = ExceptionList; iStack_20 = (int)register0x00000010 + -4; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; self = npc; local_98 = (EntityPtr)0x0; if ((npc->_type == 0x1c) && (npc->_variant == 0)) { local_9c = (EntityPtr)0x0; if (npc->_spawnerType != 0x19d) goto LAB_0047a3ed; local_91 = '\x01'; } else { local_9c = (EntityPtr)npc->_variant; LAB_0047a3ed: local_91 = '\0'; if (local_9c == (EntityPtr)0x1) { local_90 = (EntityPtr)(npc->_health / npc->_maxHitPoints); local_8c = (EntityPtr)0x0; pEVar13 = &local_90; if ((float)local_90 <= 0.0) { pEVar13 = &local_8c; } fVar32 = 1.1 - (float)*pEVar13 * 0.14; fVar31 = (float)*pEVar13 * 0.35 + 0.7; npc->_scale = fVar31; fVar31 = fVar31 * npc->_shrinkStatus1; fVar29 = fVar31 * g_vectorOne.x; (npc->_sprite)._scale.y = fVar31 * g_vectorOne.y; (npc->_sprite)._scale.x = fVar29; fVar29 = npc->_speedMultiplier; if (fVar29 != 1.0) { fVar32 = fVar32 / ((fVar32 + fVar29) - fVar32 * fVar29); } (npc->_velocity).x = fVar32 * (npc->_velocity).x; } } manager = g_manager; EVar12 = (EntityPtr)0x3fc00000; if (npc->_dead != 0) { local_8c = (EntityPtr)0x3f800000; if (npc->_championColorIdx == 0x12) { LAB_0047a4f0: local_8c = EVar12; } else if (npc->_championColorIdx == 0x13) { EVar12 = (EntityPtr)0x3f000000; goto LAB_0047a4f0; } local_b8.y = 1.63952e-43; seed_fart_sound_override((int *)&local_b8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_b8.y,0.5,2,0,(float)local_8c,0.0); if (npc->_child != (EntityPtr)0x0) { local_124 = 0; local_120 = 0; local_11c = 0; local_118 = 0; local_114 = g_vectorZero.x; local_110 = g_vectorZero.y; local_10c = g_vectorZero.x; local_108 = g_vectorZero.y; local_104 = 0; local_100 = 0; (**(code **)(*(int *)npc->_child + 0x24))(); } if (npc->_parent != (EntityPtr)0x0) { selfRef._type = 0; selfRef._variant = 0; selfRef._spawnerType = 0; selfRef._spawnerVariant = 0; selfRef._position.x = g_vectorZero.x; selfRef._position.y = g_vectorZero.y; selfRef._velocity.x = g_vectorZero.x; selfRef._velocity.y = g_vectorZero.y; selfRef._flags = 0; selfRef._entity = (void *)0x0; (**(code **)(*(int *)npc->_parent + 0x24))(); } } EVar12 = local_9c; if (npc->_state == 0) { if ((npc->_parent == (EntityPtr)0x0) && (npc->_child == (EntityPtr)0x0)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_d4,npc->_type, npc->_variant,-1,0,0); EVar12 = local_c8; local_14 = 0; if (local_c8 == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"Chub cannot find Chub?! - Should at least find myself."); } local_ac[0].x = 0.0; local_ac[0].y = 0.0; local_98 = (EntityPtr)operator_new(0xc); *(EntityPtr *)local_98 = local_98; *(EntityPtr *)((int)local_98 + 4) = local_98; local_ac[0].x = (float)local_98; local_14._0_1_ = 1; local_8c = (EntityPtr)0x0; if (EVar12 != (EntityPtr)0x0) { do { EVar12 = (EntityPtr)__RTDynamicCast(); if ((((EVar12 != (EntityPtr)0x0) && (*(int *)((int)EVar12 + 0x3bc) == 0)) && (*(int *)((int)EVar12 + 0x3c0) == 0)) && (*(char *)((int)EVar12 + 0x173) == '\0')) { local_90 = (EntityPtr)local_ac[0].x; if ((EntityPtr)local_ac[0].y == (EntityPtr)0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_c0.x = (float)local_ac; local_14._0_1_ = 2; local_c0.y = 0.0; pEVar13 = operator_new(0xc); local_14._0_1_ = 1; local_c0.y = 0.0; pEVar13[2] = EVar12; local_ac[0].y = (float)((int)local_ac[0].y + 1); EVar12 = *(EntityPtr *)((int)local_90 + 4); *pEVar13 = local_90; pEVar13[1] = EVar12; *(EntityPtr **)((int)local_90 + 4) = pEVar13; *(EntityPtr **)EVar12 = pEVar13; } local_8c = (EntityPtr)((int)local_8c + 1); } while ((uint)local_8c < (uint)local_c8); local_98 = (EntityPtr)local_ac[0].x; } local_90 = (EntityPtr)local_ac[0].y; local_ac[0].x = (float)local_98; if (((EntityPtr)local_ac[0].y != (EntityPtr)0x0) && ((EntityPtr)local_ac[0].y != (EntityPtr)0x1)) { local_8c = (EntityPtr)FUN_004999d0(); FUN_004999d0(); EVar12 = local_98; iVar14 = NpcHelper::chub_nearest_segment(); *(int *)EVar12 = iVar14; } EVar12 = *(EntityPtr *)local_ac[0].x; local_b8.y = 1.4013e-45; EVar30 = (EntityPtr)npc; EVar25 = (EntityPtr)local_ac[0].x; local_8c = (EntityPtr)npc; if (EVar12 != (EntityPtr)local_ac[0].x) { do { local_98 = *(EntityPtr *)((int)EVar12 + 8); if (local_98 != (EntityPtr)npc) { fVar29 = *(float *)((int)local_98 + 0x340) - *(float *)((int)EVar30 + 0x340); fVar31 = ((Vector *)((int)local_98 + 0x33c))->x - *(float *)((int)EVar30 + 0x33c); local_90 = (EntityPtr)sqrtf(fVar29 * fVar29 + fVar31 * fVar31); fVar29 = sqrtf(2.0); if (fVar29 * 40.0 + 1.0 < (float)local_90) break; local_9c = (EntityPtr)((int)local_98 + 0x3bc); if (*(EntityPtr *)local_9c != (EntityPtr)0x0) { local_90 = local_9c; std::multiset::erase(); } *(EntityPtr *)local_9c = local_8c; std::multiset::insert(); local_8c = (EntityPtr)((int)local_8c + 0x3c0); if (*(EntityPtr *)local_8c != (EntityPtr)0x0) { local_90 = local_8c; std::multiset::erase(); } *(EntityPtr *)local_8c = local_98; std::multiset::insert(); local_b8.y = (float)((int)local_b8.y + 1); local_8c = local_98; if (local_b8.y == 4.2039e-45) break; EVar30 = local_98; EVar25 = (EntityPtr)local_ac[0].x; } EVar12 = *(EntityPtr *)EVar12; } while (EVar12 != EVar25); } if (((*(int *)(npc + 1) != 0) || (npc->_deliriumBossType == npc->_type)) && ((uint)local_b8.y < 3)) { local_b8.y = (float)(3 - (int)local_b8.y); EVar12 = local_8c; do { uVar15 = Random(); uStack_18c = 0x47a9bb; Game::Spawn(g_game,npc->_type,npc->_variant,&npc->_pos,&g_vectorZero,(Entity *)npc, npc->_subtype,uVar15); local_98 = (EntityPtr)__RTDynamicCast(); local_8c = (EntityPtr)((int)local_98 + 0x3bc); if (*(int *)((int)local_98 + 0x3bc) != 0) { local_90 = local_8c; std::multiset::erase(); } *(EntityPtr *)local_8c = EVar12; if (EVar12 != (EntityPtr)0x0) { std::multiset::insert(); } if (*(EntityPtr *)((int)EVar12 + 0x3c0) != (EntityPtr)0x0) { local_90 = (EntityPtr)((int)EVar12 + 0x3c0); std::multiset::erase(); } *(EntityPtr *)((int)EVar12 + 0x3c0) = local_98; std::multiset::insert(); local_b8.y = (float)((int)local_b8.y - 1); EVar12 = local_98; } while (local_b8.y != 0.0); } local_88 = 0; local_84 = "AppearHead"; EVar12 = (EntityPtr)&local_80; local_80 = &DAT_bf800000; local_7c = 0x5dc; local_78._0_4_ = 0; local_78._4_4_ = 0; local_70 = 0x40000; local_6c = 0; local_68 = 1; local_64 = "AppearBody01"; local_60 = 0x3eae147b; local_5c = 500; local_58 = 0x80000000; local_54 = 0; local_50 = 0; local_48 = 2; local_44 = "AppearBody02"; local_40 = (void *)0x3e851eb8; local_3c = -500; local_38 = -0x80000000; local_34 = 0; local_30 = 0; local_98 = (EntityPtr)0x0; local_90 = (EntityPtr)npc; local_8c = EVar12; do { if (2 < (int)local_98) break; pbVar24 = *(undefined1 **)((int)EVar12 + -4); npc->_i1 = (int)*(undefined1 **)((int)EVar12 + -8); pbVar16 = (npc->_sprite)._animState._animData; if (pbVar16 == (byte *)0x0) { LAB_0047ab5a: bVar11 = ANM2::SetAnimation(&npc->_sprite,pbVar24,1); if (bVar11 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; EVar12 = local_8c; } } else { if (0xf < *(uint *)(pbVar16 + 0x14)) { pbVar16 = *(byte **)pbVar16; } do { bVar11 = *pbVar16; bVar28 = bVar11 < *pbVar24; if (bVar11 != *pbVar24) { LAB_0047ab3c: uVar15 = -(uint)bVar28 | 1; goto LAB_0047ab41; } if (bVar11 == 0) break; bVar11 = pbVar16[1]; bVar28 = bVar11 < pbVar24[1]; if (bVar11 != pbVar24[1]) goto LAB_0047ab3c; pbVar16 = pbVar16 + 2; pbVar24 = pbVar24 + 2; } while (bVar11 != 0); uVar15 = 0; LAB_0047ab41: if ((uVar15 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) { pbVar24 = *(undefined1 **)((int)EVar12 + -4); goto LAB_0047ab5a; } } puVar26 = *(undefined1 **)EVar12; if ((float)puVar26 == -1.0) { puVar26 = (undefined1 *)npc->_shadowSize; } puVar33 = *(undefined1 **)((int)EVar12 + 8); puVar3 = *(undefined1 **)((int)EVar12 + 0xc); uVar15 = *(uint *)((int)&npc->_flags + 4); qVar10 = npc->_flags; local_98 = (EntityPtr)((int)local_98 + 1); npc->_renderZOffset = (int)*(undefined1 **)((int)EVar12 + 4); puVar4 = *(undefined1 **)((int)local_8c + 0x10); puVar5 = *(undefined1 **)((int)local_8c + 0x14); npc->_shadowSize = (float)puVar26; *(uint *)((int)&npc->_flags + 4) = ((uint)puVar3 | uVar15) & ~(uint)puVar5; EVar12 = (EntityPtr)((int)local_8c + 0x20); *(uint *)&npc->_flags = ((uint)puVar33 | (uint)qVar10) & ~(uint)puVar4; local_8c = EVar12; npc = (Entity_NPC *)__RTDynamicCast(); } while (npc != (Entity_NPC *)0x0); npc = self; **(undefined4 **)((int)local_ac[0].x + 4) = 0; ptr = *(undefined4 **)local_ac[0].x; while (ptr != (undefined4 *)0x0) { nextNode = (undefined4 *)*ptr; operator_delete(ptr,0xc); ptr = nextNode; } operator_delete((void *)local_ac[0].x,0xc); if (local_d4[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_d4._4_4_ != (void *)0x0) { uVar15 = *(uint *)(local_d4._4_4_ + -4); qVar10 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar15; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar10 < uVar15); free((uint *)(local_d4._4_4_ + -4)); } } } else { npc->_state = 4; } goto LAB_0047c7f8; } if ((((local_9c == (EntityPtr)0x2) && (npc->_i1 != 2)) && (0.0 < npc->_pendingDamage)) && (pfVar18 = (npc->_damageEvents)._begin, pfVar18 != (npc->_damageEvents)._end)) { do { if ((pfVar18[4] != (float)npc->_type) || (pfVar18[5] != (float)npc->_variant)) { npc->_pendingDamage = npc->_pendingDamage - *pfVar18; *pfVar18 = 0.0; } pfVar18 = pfVar18 + 0xe; } while (pfVar18 != (npc->_damageEvents)._end); } iVar14 = npc->_i1; if (iVar14 != 0) { if (iVar14 == 2) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pcVar40 = "WalkBody02"; goto LAB_0047ad39; } } else if (iVar14 == 1) { pcVar40 = "WalkBody01"; LAB_0047ad39: ANM2::Play(&npc->_sprite,(byte *)pcVar40,0); } if (npc->_parent == (EntityPtr)0x0) { EntityRef::EntityRef(&emptyRef); (*extraout_EDX)(); if (npc->_parent != (EntityPtr)0x0) goto LAB_0047ad6b; } else { LAB_0047ad6b: pEVar17 = Entity_NPC::ParentNPC(npc); if ((pEVar17->_vectorDeque1)._size != 0) { local_8c = (EntityPtr)((uint)(npc->_i1 != 2) * 2 + 0xd); pEVar17 = Entity_NPC::ParentNPC(npc); if ((int)local_8c < (int)(pEVar17->_vectorDeque1)._size) { pEVar17 = Entity_NPC::ParentNPC(npc); local_ac[0].y = (float)(pEVar17->_vectorDeque1)._offset; uVar15 = (uint)((char *)((int)local_8c + -0x40) + (int)&(((GridEntity *)local_ac[0].y)->_sprite)._filename) & 1; iVar14 = *(int *)((int)(pEVar17->_vectorDeque1)._map + ((pEVar17->_vectorDeque1)._mapSize - 1 & (uint)((char *)((int)local_8c + -0x40) + (int)&(((GridEntity *)local_ac[0].y)->_sprite)._filename) >> 1) * 4 ); (npc->_pos).x = *(float *)(iVar14 + uVar15 * 8); (npc->_pos).y = *(float *)(iVar14 + 4 + uVar15 * 8); if ((npc->_vectorDeque1)._size != 0) { pfVar18 = (float *)std::deque::front(); fVar29 = (npc->_pos).y - pfVar18[1]; fVar31 = (npc->_pos).x - *pfVar18; fVar29 = sqrtf(fVar29 * fVar29 + fVar31 * fVar31); if (2.0 < fVar29) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; pEVar17 = Entity_NPC::ParentNPC(npc); local_ac[0].y = (float)(pEVar17->_vectorDeque1)._offset; local_90 = (EntityPtr)((uint)((char *)((int)local_8c + -1) + (int)local_ac[0].y) & 1); iVar14 = *(int *)((int)(pEVar17->_vectorDeque1)._map + ((pEVar17->_vectorDeque1)._mapSize - 1 & (uint)((char *)((int)local_8c + -1) + (int)local_ac[0].y) >> 1) * 4); pEVar17 = Entity_NPC::ParentNPC(self); local_ac[0].y = (float)(pEVar17->_vectorDeque1)._offset; uVar15 = (uint)((char *)((int)local_8c + -0x40) + (int)&(((GridEntity *)local_ac[0].y)->_sprite)._filename) & 1; iVar22 = *(int *)((int)(pEVar17->_vectorDeque1)._map + ((pEVar17->_vectorDeque1)._mapSize - 1 & (uint)((char *)((int)local_8c + -0x40) + (int)&(((GridEntity *)local_ac[0].y)->_sprite)._filename) >> 1) * 4); fVar29 = *(float *)(iVar14 + (int)local_90 * 8); fVar31 = *(float *)(iVar22 + uVar15 * 8); fVar32 = self->_friction; EVar12 = local_9c; npc = self; if (fVar32 != 0.0) { fVar2 = self->_speedMultiplier; (self->_velocity).y = (fVar2 * (*(float *)(iVar14 + 4 + (int)local_90 * 8) - *(float *)(iVar22 + 4 + uVar15 * 8)) * 4.0) / fVar32 + (self->_velocity).y; (self->_velocity).x = (fVar2 * (fVar29 - fVar31) * 4.0) / fVar32 + (self->_velocity).x; } goto LAB_0047af7c; } } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; EVar12 = local_9c; } } } LAB_0047af7c: pEVar17 = npc; if ((npc->_i1 == 2) && (npc->_state == 0xd)) { iVar14 = npc->_stateFrame + 1; npc->_stateFrame = iVar14; if (iVar14 == 1) { iVar14 = 0x3e2; if (EVar12 != (EntityPtr)0x2) { iVar14 = 0x74; } Entity_NPC::PlaySound(npc,iVar14,1.0,2,0,1.0); fVar29 = g_vectorZero.y; fVar31 = g_vectorZero.x; if (npc->_parent != (EntityPtr)0x0) { pEVar19 = Entity_NPC::ParentNPC(npc); fVar31 = (pEVar19->_pos).x - (npc->_pos).x; fVar29 = (pEVar19->_pos).y - (npc->_pos).y; } if (ABS(fVar31) <= ABS(fVar29)) { if (0.0 <= fVar29) { pcVar40 = "PoopUp"; } else { pcVar40 = "PoopDown"; } } else { pcVar40 = "PoopSide"; (npc->_sprite)._flipX = 0.0 < fVar31; } bVar11 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar40,1); if (bVar11 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else if (iVar14 == 5) { if ((npc->_vectorDeque1)._size < 6) { local_ac[0].x = (float)((npc->_vectorDeque1)._size + (npc->_vectorDeque1)._offset); puVar26 = (undefined1 *)((int)local_ac[0].x + -1); } else { local_ac[0].y = (float)(npc->_vectorDeque1)._offset; puVar26 = (undefined1 *)((int)&(((GridEntity *)local_ac[0].y)->_desc)._type + 1); } iVar14 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & (uint)puVar26 >> 1) * 4); local_c0.x = *(float *)(iVar14 + ((uint)puVar26 & 1) * 8); local_c0.y = *(float *)(iVar14 + 4 + ((uint)puVar26 & 1) * 8); local_8c = (EntityPtr)g_game->_room; fVar29 = (float)Room::GetGridIndex((Room *)local_8c,&local_c0); local_c0.x = (float)((int)fVar29 % *(int *)((int)local_8c + 0xc)) * 40.0 + 40.0; local_c0.y = (float)((int)fVar29 / *(int *)((int)local_8c + 0xc)) * 40.0 + 120.0; local_98 = (EntityPtr)fVar29; if (local_9c == (EntityPtr)0x2) { if (npc->_subtype == 0) { if (((((0x1bf < (uint)fVar29) || (((void **)((int)local_8c + 0x24))[(int)fVar29] == (void *)0x0)) || (iVar14 = *(int *)((int)((void **)((int)local_8c + 0x24))[(int)fVar29] + 4), iVar14 == 1)) || (iVar14 == 10)) && (*(int *)((int)local_8c + 8) != 0x10)) { local_90 = (EntityPtr)RNG::Next(&npc->_dropRNG); if (((int)fVar29 < 0) || (0x1bf < (int)fVar29)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (((uint)fVar29 < 0x1c0) && (((int *)((int)local_8c + 0x76c))[(int)fVar29] < 0x385)) { poop = operator_new(0x19c); local_14 = 0xb; local_ac[0].y = (float)poop; if (poop == (GridEntity *)0x0) { poop = (GridEntity *)0x0; } else { GridEntity::GridEntity(poop); *(undefined ***)poop = IsaacRepentancePlus::GridEntity_Poop::vftable; poop[1]._desc._type = 0; poop[1]._desc._spawnSeed = 0; poop[1]._desc._varData = 0xf; *(undefined1 *)&poop[1]._desc._type = 0; poop[1]._desc._variableSeed = 0; poop[1]._gridIndex = 0; poop[1]._spawnFrame = 0; poop[1]._rng._seed = 0; poop[1]._rng._shift1 = (int)g_vectorZero.x; poop[1]._rng._shift2 = (int)g_vectorZero.y; poop[1]._rng._shift3 = (int)g_vectorZero.x; poop[1]._collisionClass = (int)g_vectorZero.y; pGVar8 = poop + 1; (pGVar8->_sprite)._filename._buf[0] = '\0'; (pGVar8->_sprite)._filename._buf[1] = '\0'; (pGVar8->_sprite)._filename._buf[2] = '\0'; (pGVar8->_sprite)._filename._buf[3] = '\0'; pAVar9 = &poop[1]._sprite; (pAVar9->_filename)._buf[4] = '\0'; (pAVar9->_filename)._buf[5] = '\0'; (pAVar9->_filename)._buf[6] = '\0'; (pAVar9->_filename)._buf[7] = '\0'; } local_14 = 0xffffffff; if (poop != (GridEntity *)0x0) { (poop->_desc)._type = 0xe; poop->_gridIndex = (int)local_98; if (((void **)((int)local_8c + 0x24))[(int)local_98] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)((void **)((int)local_8c + 0x24))[(int)local_98])(); } ((void **)((int)local_8c + 0x24))[(int)local_98] = poop; (poop->_desc)._variant = 1; (poop->_desc)._varData = 0; GridEntity::Init(poop,(uint)local_90); } } Entity_NPC::PlaySound(npc,0x3de,1.0,2,0,1.0); } } else { iVar14 = Room::GetAliveEnemiesCount((Room *)local_8c); if ((iVar14 < 5) && ((bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar11 == 0 || (uVar15 = Entity::CountRelatedEntities((Entity *)npc,0x5c,0,unused,(void *)0x0), uVar15 < 3)))) { uVar15 = Random(); in_stack_fffffe80 = &local_c0; in_stack_fffffe78 = (EntityPtr)0x5c; uStack_18c = 0x47b39a; Game::Spawn(g_game,0x5c,0,in_stack_fffffe80,&g_vectorZero,(Entity *)npc,0,uVar15); pEVar19 = (Entity_NPC *)__RTDynamicCast(); pEVar19->_health = pEVar19->_health * 0.7; Entity_NPC::SetScale(pEVar19,pEVar19->_scale * 0.5); Entity::SetParent((Entity *)pEVar19,(Entity *)npc); } } npc->_state = 4; if (0.3 <= npc->_health / npc->_maxHitPoints) { Entity_NPC::PlaySound(npc,0x3e0,1.0,2,0,1.0); } } else { EVar12 = (EntityPtr)0x3d; if (npc->_variant == 0) { if (npc->_subtype == 1) { EVar12 = (EntityPtr)0x1e; } else { EVar12 = (EntityPtr)((uint)(npc->_subtype == 2) * 8 + 0x17); local_90 = EVar12; } } bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar11 == 0) || (uVar15 = Entity::CountRelatedEntities ((Entity *)npc,(int)EVar12,0,unused_00,(void *)0x0), uVar15 < 3)) { if ((EVar12 == (EntityPtr)0x1e) || (uVar15 = Random(), uVar15 % 3 != 0)) { Entity_NPC::PlaySound(npc,0x109,0.7,2,0,1.0); } else { Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); uVar15 = Random(); Game::Spawn(g_game,(uint)EVar12,0,&local_c0,&g_vectorZero,(Entity *)npc,0,uVar15); } uVar15 = Random(); in_stack_fffffe80 = &local_c0; uStack_18c = 0x47b538; in_stack_fffffe78 = EVar12; Game::Spawn(g_game,(uint)EVar12,0,in_stack_fffffe80,&g_vectorZero,(Entity *)npc,0,uVar15 ); pEVar19 = (Entity_NPC *)__RTDynamicCast(); if (EVar12 == (EntityPtr)0x1e) { Entity_NPC::SetBossColorIdx(pEVar19,0,unused_01); npc->_state = 4; } else { local_ac[0].x = -(local_c0.x - (npc->_pos).x) * 0.1; local_ac[0].y = -(local_c0.y - (npc->_pos).y) * 0.1; Entity::AddVelocity_divided((Entity *)npc,local_ac,0); npc->_state = 4; } } else { npc->_state = 4; } } } } goto LAB_0047c55f; } EVar12 = (EntityPtr)npc; EVar30 = (EntityPtr)(npc->_health - npc->_pendingDamage); while( true ) { local_8c = EVar30; if ((*(EntityPtr *)((int)EVar12 + 0x3c0) != (EntityPtr)0x0) && (iVar14 = __RTDynamicCast(), iVar14 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); if (EVar12 == (EntityPtr)0x0) break; EVar30 = (EntityPtr)(*(float *)((int)EVar12 + 0x380) - *(float *)((int)EVar12 + 0x14)); if ((float)local_8c <= (float)EVar30) { EVar30 = local_8c; } } local_b8.y = (float)npc; do { if ((float)local_8c < *(float *)((int)local_b8.y + 0x380) - *(float *)((int)local_b8.y + 0x14)) { pcVar6 = *(code **)(*(int *)local_b8.y + 0x20); EntityRef::constructor(&selfRef,(Entity *)npc); (*pcVar6)(); } pEVar13 = (EntityPtr *)((int)local_b8.y + 0x3c0); if ((*pEVar13 != (EntityPtr)0x0) && (iVar14 = __RTDynamicCast(), iVar14 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } local_b8.y = *(float *)pEVar13; } while ((EntityPtr)local_b8.y != (EntityPtr)0x0); local_90 = (EntityPtr)(npc->_velocity).x; local_8c = (EntityPtr)(npc->_velocity).y; local_c0.y = (float)&npc->_pos; fVar29 = sqrtf((float)local_90 * (float)local_90 + (float)local_8c * (float)local_8c); game = g_game; if (fVar29 <= 0.0) { EVar12 = local_8c; } else { local_90 = (EntityPtr)((npc->_velocity).x * (1.0 / fVar29)); EVar12 = (EntityPtr)((npc->_velocity).y * (1.0 / fVar29)); } local_ac[0].x = (float)local_90 * 40.0 + (npc->_pos).x; local_ac[0].y = (float)EVar12 * 40.0 + (npc->_pos).y; local_90 = (EntityPtr)g_game->_room; EntityRef::constructor(&selfRef,(Entity *)npc); uVar15 = Room::GetGridIndex(game->_room,local_ac); if ((uVar15 < 0x1c0) && ((int *)((int *)((int)local_90 + 0x24))[uVar15] != (int *)0x0)) { (**(code **)(*(int *)((int *)((int)local_90 + 0x24))[uVar15] + 0x10))(); } pcVar40 = "WalkNormalHori"; local_b8.y = 1.6336657e-38; local_8c = (EntityPtr)0xb1e3e4; pEVar17 = npc; switch(npc->_state) { case 4: bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar11 == 0) || (local_91 = '\0', (*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { local_91 = '\x01'; } if (((local_9c != (EntityPtr)0x2) || (0.3 <= npc->_health / npc->_maxHitPoints)) || (npc->_subtype != 0)) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.5,0); iVar14 = npc->_stateFrame + 1; npc->_stateFrame = iVar14; if (local_91 == '\0') { LAB_0047bc8b: EVar12 = local_98; LAB_0047bc91: local_91 = '\0'; } else { if (0x32 < iVar14) { tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_b8,0.0); pEVar23 = Entity_NPC::GetPlayerTarget(npc); local_90 = (EntityPtr)(pEVar23->_velocity).x; local_8c = (EntityPtr)(pEVar23->_velocity).y; uVar15 = Random(); fVar29 = (npc->_pos).y; fVar31 = (npc->_pos).x; fVar32 = (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10; local_c0.y = (fVar32 * (float)local_8c * 16.0 + tmpVec->y) - fVar29; local_c0.x = (fVar32 * (float)local_90 * 16.0 + tmpVec->x) - fVar31; if ((ABS(local_c0.y) < 20.0) || (ABS(local_c0.x) < 20.0)) { local_ac[0].x = fVar31 + local_c0.x; local_ac[0].y = fVar29 + local_c0.y; bVar11 = Room::CheckLine(g_game->_room,&npc->_pos,local_ac,0,0,0,0,(Vector *)0x0); if ((bVar11 != 0) && (bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar11 == 0)) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); tmpVec = Vector::ToCardinal(local_ac,&local_c0); (npc->_v1).x = tmpVec->x; (npc->_v1).y = tmpVec->y; npc->_stateFrame = 0; npc->_state = 8; NPCAI_Pathfinder::ResetMovementTarget(&npc->_pathfinder); } } } if ((npc->_state != 4) || (uVar15 = Random(), uVar15 % 100 != 0)) goto LAB_0047bc8b; if (npc->_variant != 2) { chubList = Entity_NPC::QueryNPCsSpawnerType((EntityList *)local_d4,npc->_type,0,1); EVar12 = (EntityPtr)1.4013e-45; if (*(uint *)&chubList->field_0xc < 5) { local_91 = '\x01'; goto LAB_0047bc98; } goto LAB_0047bc91; } local_91 = '\x01'; EVar12 = local_98; } LAB_0047bc98: pcVar40 = "WalkNormalHori"; if (((uint)EVar12 & 1) != 0) { EntityList_Query::~EntityList_Query(local_d4); } if (local_91 != '\0') { EVar12 = (EntityPtr)0x0; local_8c = (EntityPtr)0x0; if (npc->_variant == 2) { local_90 = (EntityPtr)g_game->_room; local_98 = (EntityPtr)(*(int *)((int)local_90 + 0x10) * *(int *)((int)local_90 + 0xc)); uVar15 = 0; if (0 < (int)local_98) { gridSlot = (int *)((int)local_90 + 0x24); do { if (uVar15 < 0x1c0) { iVar14 = *gridSlot; EVar12 = local_8c; if (((iVar14 != 0) && (*(int *)(iVar14 + 4) == 0xe)) && (*(int *)(iVar14 + 8) == 1)) { local_8c = (EntityPtr)((int)local_8c + 1); EVar12 = local_8c; } } uVar15 = uVar15 + 1; gridSlot = gridSlot + 1; } while ((int)uVar15 < (int)local_98); if (4 < (int)EVar12) goto LAB_0047ba62; } } npc->_stateFrame = 0; npc->_state = 0xd; NPCAI_Pathfinder::ResetMovementTarget(&npc->_pathfinder); downAnim = "WalkNormalDown"; anim = "WalkNormalUp"; goto LAB_0047be4d; } } else { if ((npc->_flags & 0x200) != 0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); pcVar40 = "WalkNormalHori"; downAnim = "WalkNormalDown"; anim = "WalkNormalUp"; goto LAB_0047be4d; } puVar26 = &DAT_bf800000; if ((npc->_velocity).y < 0.1) { puVar33 = &DAT_bf800000; } else { puVar33 = (undefined1 *)0x3f800000; } if (0.0 < (npc->_velocity).x) { puVar26 = (undefined1 *)0x3f800000; } local_ac[0].x = (float)puVar26 + (float)puVar26; local_ac[0].y = (float)puVar33 + (float)puVar33; Entity::AddVelocity_divided((Entity *)npc,local_ac,0); bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar11 != 0) { pEVar23 = Entity_NPC::GetPlayerTarget(npc); local_ac[0].x = -((pEVar23->_pos).x - (npc->_pos).x); local_ac[0].y = -((pEVar23->_pos).y - (npc->_pos).y); fVar29 = sqrtf(local_ac[0].x * local_ac[0].x + local_ac[0].y * local_ac[0].y); bVar11 = 0; fVar29 = (120.0 - fVar29) * 0.04; if (fVar29 <= 0.0) { fVar29 = 0.0; } if (1.8 <= fVar29) { fVar29 = 1.8; } tmpVec = Vector::Resized(local_ac,&local_c0,fVar29); Entity::AddVelocity_divided((Entity *)npc,tmpVec,bVar11); } if (npc->_collidesWithGrid != 0) { Entity_NPC::PlaySound(npc,0x3df,1.0,2,0,1.0); } if (0.3 <= (npc->_v2).y / npc->_maxHitPoints) { Entity_NPC::PlaySound(npc,0x3e0,1.0,2,0,1.0); } uVar15 = Random(); if (uVar15 % 100 == 0) { Entity_NPC::PlaySound(npc,0x3e1,1.0,100,0,1.0); } } LAB_0047ba62: pcVar40 = "WalkNormalHori"; downAnim = "WalkNormalDown"; anim = "WalkNormalUp"; goto LAB_0047be4d; case 8: npc->_stateFrame = npc->_stateFrame + 1; pcVar40 = "WalkAttack01Hori"; local_b8.y = 1.6336808e-38; local_8c = (EntityPtr)0xb1e450; if (npc->_collidesWithGrid == 0) { local_c0.y = (float)g_game->_room; uVar15 = Room::GetGridIndex((Room *)local_c0.y,local_ac); if (((0x1bf < uVar15) || (((int *)((int)local_c0.y + 0x76c))[uVar15] != 999)) && (bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar11 == 0)) { npc->_friction = npc->_friction * 0.9; local_ac[0].x = (npc->_v1).x * 3.7; local_ac[0].y = (npc->_v1).y * 3.7; Entity::AddVelocity_divided((Entity *)npc,local_ac,0); break; } } npc->_state = 4; if ((local_9c == (EntityPtr)0x2) && (0.3 <= npc->_health / npc->_maxHitPoints)) { Entity_NPC::PlaySound(npc,0x3e0,1.0,2,0,1.0); } (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; break; case 0xc: EVar12 = npc->_entityRef; if (EVar12 != (EntityPtr)0x0) { *(float *)((int)EVar12 + 0x360) = g_vectorZero.x; *(float *)((int)EVar12 + 0x364) = g_vectorZero.y; EVar12 = npc->_entityRef; *(float *)((int)EVar12 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar12 + 0x340) = (npc->_pos).y; EVar12 = npc->_entityRef; if (*(int *)((int)EVar12 + 0x28) == 4) { *(undefined4 *)((int)EVar12 + 0x410) = 0x18; *(undefined4 *)((int)EVar12 + 0x414) = 0x18; } } bVar11 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar11 != 0) { pEVar23 = Entity_NPC::GetPlayerTarget(npc); local_98 = (EntityPtr)((pEVar23->_velocity).y * 0.1); local_90 = (EntityPtr)((pEVar23->_velocity).x * 0.1); fVar31 = (npc->_pos).x - (pEVar23->_pos).x; fVar29 = (npc->_pos).y - (pEVar23->_pos).y; fVar31 = sqrtf(fVar29 * fVar29 + fVar31 * fVar31); fVar29 = local_c0.y; local_ac[0].x = ((pEVar23->_pos).x + fVar31 * (float)local_90) - *(float *)local_c0.y; local_ac[0].y = ((pEVar23->_pos).y + fVar31 * (float)local_98) - (float)*(void **)((int)local_c0.y + 4); tmpVec = Vector::Normalized(local_ac,&local_c0); local_98 = (EntityPtr)(tmpVec->x * 20.0); local_8c = (EntityPtr)(tmpVec->y * 20.0); Entity_NPC::PlaySound(npc,0x13f,1.2,2,0,1.0); EVar12 = npc->_entityRef; if (EVar12 != (EntityPtr)0x0) { *(EntityPtr *)((int)EVar12 + 0x360) = local_98; *(EntityPtr *)((int)EVar12 + 0x364) = local_8c; pvVar20 = *(void **)((int)fVar29 + 4); EVar12 = npc->_entityRef; *(float *)((int)EVar12 + 0x33c) = (float)local_98 + *(float *)fVar29; *(float *)((int)EVar12 + 0x340) = (float)local_8c + (float)pvVar20; EVar12 = npc->_entityRef; if (*(int *)((int)EVar12 + 0x28) == 4) { ANM2::Play((ANM2 *)((int)EVar12 + 0x48),(byte *)"Pulse",1); *(int *)((int)EVar12 + 0x410) = 0x12; *(undefined4 *)((int)EVar12 + 0x414) = 0x12; bVar11 = Entity_Bomb::IsRocket((Entity_Bomb *)EVar12); if (bVar11 != 0) { ((Vector *)((int)EVar12 + 0x360))->x = (float)local_98 * 0.1; *(float *)((int)EVar12 + 0x364) = (float)local_8c * 0.1; fVar29 = atan2f((float)local_8c,(float)local_98); *(float *)((int)EVar12 + 0x428) = fVar29 * 57.295776; } *(int *)((int)EVar12 + 0x188) = 2; *(byte *)((int)EVar12 + 0x171) = 1; Entity::SetParent((Entity *)EVar12,(Entity *)npc); } Entity_NPC::SetRef_bec(npc,(Entity *)0x0); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; if ((local_9c == (EntityPtr)0x2) && (0.3 <= npc->_health / npc->_maxHitPoints)) { Entity_NPC::PlaySound(npc,0x3e0,1.0,2,0,1.0); } (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; (npc->_v2).x = 0.0; npc->_i2 = 0; } goto LAB_0047c541; case 0xd: iVar14 = npc->_stateFrame + 1; npc->_stateFrame = iVar14; if (((iVar14 == 5) && (npc->_child != (EntityPtr)0x0)) && (pEVar19 = Entity_NPC::ChildNPC(npc), pEVar19->_child != (EntityPtr)0x0)) { pEVar19 = Entity_NPC::ChildNPC(npc); pEVar19 = Entity_NPC::ChildNPC(pEVar19); pEVar19->_state = 0xd; pEVar19 = Entity_NPC::ChildNPC(npc); pEVar19 = Entity_NPC::ChildNPC(pEVar19); pEVar19->_stateFrame = 0; } if (10 < npc->_stateFrame) { local_8c = (EntityPtr)0xb1e450; local_b8.y = 1.6336836e-38; pcVar40 = "WalkAttack02Hori"; if (0x1e < npc->_stateFrame) { local_8c = (EntityPtr)0xb1e450; npc->_state = 4; local_b8.y = 1.6336836e-38; if (local_9c == (EntityPtr)0x2) { local_8c = (EntityPtr)0xb1e450; local_b8.y = 1.6336836e-38; if (0.3 <= npc->_health / npc->_maxHitPoints) { Entity_NPC::PlaySound(npc,0x3e0,1.0,2,0,1.0); anim = "WalkAttackUp"; downAnim = "WalkAttack02Down"; goto LAB_0047be4d; } } } break; } downAnim = "WalkChubbyDown"; pcVar40 = "WalkChubbyHori"; anim = "WalkNormalUp"; goto LAB_0047be4d; case 0x10: pcVar40 = "WalkSadHori"; local_b8.y = 1.633668e-38; iVar14 = npc->_stateFrame; if (iVar14 == 1) { Entity_NPC::PlaySound(npc,0x8e,1.0,2,0,1.0); iVar14 = npc->_stateFrame; } npc->_stateFrame = iVar14 + 1; EVar12 = npc->_entityRef; npc->_friction = npc->_friction * 0.6; if (EVar12 != (EntityPtr)0x0) { *(float *)((int)EVar12 + 0x360) = g_vectorZero.x; *(float *)((int)EVar12 + 0x364) = g_vectorZero.y; EVar12 = npc->_entityRef; *(float *)((int)EVar12 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar12 + 0x340) = (npc->_pos).y; EVar12 = npc->_entityRef; if (EVar12 != (EntityPtr)0x0) { if (npc->_stateFrame < 0x25) { if ((local_91 != '\0') && (9 < npc->_stateFrame)) { npc->_state = 0xc; local_b8.y = 1.6336713e-38; pcVar40 = "SpitHori"; local_8c = (EntityPtr)0xb1e448; } break; } if (*(int *)((int)EVar12 + 0x28) == 4) { *(undefined4 *)((int)EVar12 + 0x410) = 0; *(undefined4 *)((int)EVar12 + 0x414) = 0; (**(code **)(*(int *)npc->_entityRef + 0xc))(); *(undefined1 *)((int)npc->_entityRef + 0x171) = 1; } } } Entity_NPC::PlaySound(npc,0x75,0.8,2,0,1.0); npc->_state = 4; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; if ((local_9c == (EntityPtr)0x2) && (0.3 <= npc->_health / npc->_maxHitPoints)) { Entity_NPC::PlaySound(npc,0x3e0,1.0,2,0,1.0); } } downAnim = (char *)local_b8.y; anim = (char *)local_8c; LAB_0047be4d: fVar29 = (npc->_velocity).x; fVar31 = (npc->_velocity).y; if (ABS(fVar29) <= ABS(fVar31)) { if (0.0 < fVar31) { anim = downAnim; } } else { (npc->_sprite)._flipX = fVar29 < 0.0; anim = pcVar40; } if (npc->_state == 0x10) { ANM2::SetFrame(&npc->_sprite,(std_string *)anim,0); if (npc->_child != (EntityPtr)0x0) { pEVar19 = Entity_NPC::ChildNPC(npc); pEVar19->_state = 0x10; pEVar19 = Entity_NPC::ChildNPC(npc); if (pEVar19->_child != (EntityPtr)0x0) { pEVar19 = Entity_NPC::ChildNPC(npc); pEVar19 = Entity_NPC::ChildNPC(pEVar19); pEVar19->_state = 0x10; } goto LAB_0047c541; } LAB_0047c54a: EntityRef::EntityRef(&emptyRef); (*extraout_EDX_00)(); } else { ANM2::Play(&npc->_sprite,(byte *)anim,0); LAB_0047c541: if (npc->_child == (EntityPtr)0x0) goto LAB_0047c54a; } LAB_0047c55f: if ((pEVar17->_vectorDeque1)._size == 0) { std::deque::push_back(&pEVar17->_vectorDeque1,&pEVar17->_pos); } positionHistory = &pEVar17->_vectorDeque1; pfVar18 = (float *)std::deque::front(); local_98 = (EntityPtr)((pEVar17->_pos).x - *pfVar18); local_b8.y = (pEVar17->_pos).y - pfVar18[1]; local_9c = (EntityPtr)sqrtf((float)local_98 * (float)local_98 + local_b8.y * local_b8.y); if (0.0 < (float)local_9c) { local_b8.y = local_b8.y * (1.0 / (float)local_9c); local_98 = (EntityPtr)((1.0 / (float)local_9c) * (float)local_98); } local_98 = (EntityPtr)((float)local_98 + (float)local_98); local_b8.y = local_b8.y + local_b8.y; npc = pEVar17; if (2.0 < (float)local_9c) { uVar15 = (pEVar17->_vectorDeque1)._size; pEVar19 = pEVar17; while (uVar15 != 0) { local_8c = (EntityPtr)(pEVar17->_vectorDeque1)._offset; if (positionHistory->_proxy == (EntityPtr *)0x0) { local_90 = (EntityPtr)0x0; } else { local_90 = *positionHistory->_proxy; } uVar15 = (uint)local_8c & 1; iVar14 = *(int *)(*(int *)((int)local_90 + 4) + (*(int *)((int)local_90 + 8) - 1U & (uint)local_8c >> 1) * 4); local_c0.y = (float)local_98 + *(float *)(iVar14 + uVar15 * 8); local_ac[0].y = local_b8.y + *(float *)(iVar14 + 4 + uVar15 * 8); if ((uVar15 == 0) && ((pEVar17->_vectorDeque1)._mapSize <= (pEVar17->_vectorDeque1)._size + 2 >> 1)) { std::deque::_Growmap(); local_8c = (EntityPtr)(pEVar17->_vectorDeque1)._offset; } uVar21 = (pEVar17->_vectorDeque1)._mapSize; uVar7 = uVar21 * 2; uVar15 = (uint)local_8c & uVar7 - 1; (pEVar17->_vectorDeque1)._offset = uVar15; if (uVar15 == 0) { uVar15 = uVar7; } local_8c = (EntityPtr)(uVar15 - 1); local_90 = (EntityPtr)(uVar21 - 1 & (uint)local_8c >> 1); if (*(int *)((int)(pEVar17->_vectorDeque1)._map + (int)local_90 * 4) == 0) { pvVar20 = operator_new(0x10); *(void **)((int)(pEVar17->_vectorDeque1)._map + (int)local_90 * 4) = pvVar20; } local_9c = (EntityPtr)((float)local_9c - 2.0); iVar14 = *(int *)((int)(pEVar17->_vectorDeque1)._map + (int)local_90 * 4); *(float *)(iVar14 + ((uint)local_8c & 1) * 8) = local_c0.y; *(float *)(iVar14 + 4 + ((uint)local_8c & 1) * 8) = local_ac[0].y; puVar1 = &(pEVar17->_vectorDeque1)._size; *puVar1 = *puVar1 + 1; uVar15 = (pEVar17->_vectorDeque1)._size; (pEVar17->_vectorDeque1)._offset = (uint)local_8c; npc = self; pEVar19 = self; if ((float)local_9c <= 2.0) goto LAB_0047c75c; } uVar35 = FUN_00499550(); pcVar40 = (char *)((int)((ulonglong)uVar35 >> 0x20) + -0x3e); *pcVar40 = *pcVar40 + (char)((uint)this_00 >> 8); pcVar40 = (char *)((int)&pEVar17->_i1 + 3); *pcVar40 = *pcVar40 + (char)((ulonglong)uVar35 >> 0x20); puVar26 = &this_00[0x5276c]._pathfinder.field_0x3f; *puVar26 = *puVar26 + (char)((ulonglong)uVar35 >> 0x28); puVar26 = &pEVar19->field_0x3; *(char *)uVar35 = *(char *)uVar35 + (char)uVar35; uVar15 = __security_cookie ^ (uint)(auStack_15a + -0xe); pvVar20 = ExceptionList; ExceptionList = auStack_15a + -0x1a; VStack_25c.y = (float)this_00; pEStack_240 = Entity_NPC::GetPlayerTarget(this_00); if (this_00->_state == 0) { iVar14 = *(int *)((int)g_game->_room + 4); if ((((iVar14 == 0) || (iVar14 = *(int *)(iVar14 + 0x10), iVar14 == 0)) || (pEVar17 = this_00, *(int *)(iVar14 + 0x48) == 1)) && (pEVar17 = this_00, -1 < this_00->_spawnGridIndex)) { VStack_254.x = (this_00->_pos).x; VStack_254.y = 400.0; pEVar17 = this_00; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { uVar15 = 0; pEStack_240 = (Entity *)VStack_254.x; do { if (uVar15 == 0) { this = Game::GetPlayer(g_game,0); tmpVec = &VStack_254; } else { this = Game::GetPlayer(g_game,uVar15); uVar21 = Random(); fVar29 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 3.14; pAStack_23c = (AnimationState *)(fVar29 + fVar29); fVar29 = cos((float)pAStack_23c); VStack_24c.x = fVar29 * 20.0 + (float)pEStack_240; fVar29 = sin((float)pAStack_23c); tmpVec = &VStack_24c; VStack_24c.y = fVar29 * 20.0 + 400.0; } Entity_Player::Teleport(this,tmpVec,0,0); uVar15 = uVar15 + 1; } while (uVar15 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); pEVar17 = (Entity_NPC *)VStack_25c.y; } } (pEVar17->_pos).y = (pEVar17->_pos).y + 25.0; (pEVar17->_targetPosition).x = (pEVar17->_pos).x; (pEVar17->_targetPosition).y = (pEVar17->_pos).y; pEVar17->_state = 3; ExceptionList = pvVar20; return; } fVar29 = (this_00->_targetPosition).x; fVar31 = (this_00->_pos).x; iVar14 = this_00->_type; (this_00->_velocity).y = (this_00->_targetPosition).y - (this_00->_pos).y; fVar32 = this_00->_friction; (this_00->_velocity).x = fVar29 - fVar31; this_00->_friction = fVar32 * 0.8; Entity_NPC::QueryNPCsSpawnerType((EntityList *)auStack_294,iVar14,0,0); pAStack_23c = (AnimationState *)0x0; if (auStack_294._12_4_ != 0) { do { pEVar17 = (Entity_NPC *) __RTDynamicCast(*(undefined4 *)(auStack_294._4_4_ + (int)pAStack_23c * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar15, puVar26,positionHistory); if ((pEVar17 != (Entity_NPC *)0x0) && (pEVar17 != this_00)) { if (pEVar17->_type == 0x1e) { if ((this_00->_dead != 0) && ((this_00->_flags & 0x1000000000000000) != 0)) { fStack_2ac = g_vectorZero.x; fStack_2a4 = g_vectorZero.x; fStack_2a8 = g_vectorZero.y; fStack_2a0 = g_vectorZero.y; uStack_2bc = 0; uStack_2b8 = 0; uStack_2b4 = 0; uStack_2b0 = 0; uStack_29c = 0; uStack_298 = 0; (**(code **)(*(int *)pEVar17 + 0x24))(&uStack_2bc); } } else { VStack_254.y = (pEVar17->_pos).y - (this_00->_pos).y; VStack_25c.y = (pEVar17->_pos).x - (this_00->_pos).x; fVar29 = sqrtf(VStack_254.y * VStack_254.y + VStack_25c.y * VStack_25c.y); if ((0.01 < fVar29) && (fVar29 < 80.0)) { fVar31 = pEVar17->_friction; fVar29 = ((80.0 - fVar29) * 0.03) / fVar29; if (fVar31 != 0.0) { fVar32 = pEVar17->_speedMultiplier; (pEVar17->_velocity).y = (fVar32 * VStack_254.y * fVar29) / fVar31 + (pEVar17->_velocity).y; (pEVar17->_velocity).x = (fVar32 * VStack_25c.y * fVar29) / fVar31 + (pEVar17->_velocity).x; } } } } pAStack_23c = (AnimationState *)((int)pAStack_23c + 1); } while (pAStack_23c < (uint)auStack_294._12_4_); } if (this_00->_state == 3) { if (this_00->_stateFrame == 0) { Random(); if (0.0 < (this_00->_v1).x) { (this_00->_v1).x = 0.0; } sprintf_s(&DAT_00c7f718,0x20,(byte *)"Idle%d"); bVar11 = ANM2::SetAnimation(&this_00->_sprite,&DAT_00c7f718,1); if (bVar11 != 0) { AnimationState::Rewind(&(this_00->_sprite)._animState); (this_00->_sprite)._animState._isPlaying = 1; } this_00->_stateFrame = this_00->_stateFrame + 1; } else if (((this_00->_sprite)._animState._animData == (void *)0x0) || ((this_00->_sprite)._animState._isPlaying == 0)) { pAVar27 = (AnimationState *)0x0; pAStack_23c = (AnimationState *)0x0; if (((this_00->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { uVar15 = Random(); if ((uVar15 % 3 == 0) || (fVar29 = (pEStack_240->_pos).y, fVar29 <= 200.0)) { LAB_0047ce36: iVar22 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar14 = 0; if (0 < iVar22) { iVar14 = iVar22; } if (iVar14 < 0xe) { LAB_0047ce56: uVar15 = Random(); pAVar27 = (AnimationState *)(&PStack_238)[1].Color._tint[uVar15 % 3 - 5]; LAB_0047ce79: pAStack_23c = pAVar27; } this_00->_stateFrame = 0; if ((int)pAVar27 < 1) goto LAB_0047d697; } else { iVar22 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar14 = 0; if (0 < iVar22) { iVar14 = iVar22; } if (7 < iVar14) goto LAB_0047ce36; if (this_00->_subtype == 1) goto LAB_0047ce56; fVar29 = (this_00->_pos).y - fVar29; fVar31 = (this_00->_pos).x - (pEStack_240->_pos).x; if ((ABS(fVar29) < ABS(fVar31)) || (0.0 < fVar29)) { if (0.0 < fVar31) { pAVar27 = (AnimationState *)0x4; this_00->_stateFrame = 0; pAStack_23c = (AnimationState *)0x4; goto LAB_0047ce91; } pAVar27 = (AnimationState *)0x5; goto LAB_0047ce79; } pAVar27 = (AnimationState *)0x2; this_00->_stateFrame = 0; pAStack_23c = (AnimationState *)0x2; } LAB_0047ce91: this_00->_state = 8; sprintf_s(&DAT_00c7f718,0x20,(byte *)"Attack%d"); pbVar16 = (this_00->_sprite)._animState._animData; if (pbVar16 == (byte *)0x0) { LAB_0047cf06: bVar11 = ANM2::SetAnimation(&this_00->_sprite,&DAT_00c7f718,1); if (bVar11 != 0) { AnimationState::Rewind(&(this_00->_sprite)._animState); (this_00->_sprite)._animState._isPlaying = 1; pAVar27 = pAStack_23c; } } else { if (0xf < *(uint *)(pbVar16 + 0x14)) { pbVar16 = *(byte **)pbVar16; } pbVar24 = &DAT_00c7f718; do { bVar11 = *pbVar16; bVar28 = bVar11 < *pbVar24; if (bVar11 != *pbVar24) { LAB_0047cee6: uVar15 = -(uint)bVar28 | 1; goto LAB_0047ceeb; } if (bVar11 == 0) break; bVar11 = pbVar16[1]; bVar28 = bVar11 < pbVar24[1]; if (bVar11 != pbVar24[1]) goto LAB_0047cee6; pbVar16 = pbVar16 + 2; pbVar24 = pbVar24 + 2; } while (bVar11 != 0); uVar15 = 0; LAB_0047ceeb: if ((uVar15 != 0) || ((*(char *)((int)(this_00->_sprite)._animState._animData + 0x34) != '\0' && ((this_00->_sprite)._animState._isPlaying == 0)))) goto LAB_0047cf06; } this_00->_i1 = (int)pAVar27; (this_00->_v1).x = 0.0; } else { this_00->_stateFrame = 0; } } } else if (this_00->_state == 8) { if (((this_00->_sprite)._animState._animData == (void *)0x0) || ((this_00->_sprite)._animState._isPlaying == 0)) { this_00->_stateFrame = 0; this_00->_state = 3; } else { bVar11 = AnimationState::IsEventTriggered(&(this_00->_sprite)._animState,(byte *)"Shoot"); if (bVar11 != 0) { ProjectileParams::ProjectileParams(&PStack_238); iVar14 = this_00->_i1; if (iVar14 == 3) { Entity_NPC::PlaySound(this_00,0x109,0.7,2,0,1.0); Entity_NPC::PlaySound(this_00,9,1.0,2,0,1.0); uVar15 = *(uint *)((int)&this_00->_flags + 4) & 0x10000000; if ((uVar15 == 0) || (uVar15 = Entity::CountRelatedEntities((Entity *)this_00,0xe,0,uVar15,(void *)0x0), uVar15 < 3)) { uVar15 = Random(); VStack_25c.x = (this_00->_pos).x + 60.0; VStack_25c.y = (this_00->_pos).y - 25.0; VStack_24c.x = 10.0; VStack_24c.y = 0.0; Game::Spawn(g_game,0xe,0,&VStack_25c,&VStack_24c,(Entity *)this_00,0,uVar15); } } else if (iVar14 == 1) { Entity_NPC::PlaySound(this_00,0x109,1.0,2,0,1.0); Entity_NPC::PlaySound(this_00,0xd,1.0,2,0,1.0); pAStack_23c = (AnimationState *)0x2; bVar11 = Entity::HasEntityFlags((Entity *)this_00,0x1000000000000000); if (bVar11 != 0) { iVar14 = Entity::CountRelatedEntities((Entity *)this_00,0x12,0,unused_02,(void *)0x0); pAStack_23c = (AnimationState *)2; if (3 - iVar14 < 3) { pAStack_23c = (AnimationState *)(3 - iVar14); } } iVar14 = 0; if (0 < (int)pAStack_23c) { VStack_24c.x = 0.0; VStack_24c.y = -20.0; do { if (iVar14 == 0) { pEStack_240 = (Entity *)0x3f800000; } else { pEStack_240 = (Entity *)&DAT_bf800000; } uVar15 = Random(); VStack_264.y = (this_00->_pos).y - 65.0; VStack_264.x = (float)pEStack_240 * 40.0 + (this_00->_pos).x; uVar39 = 0; pTVar38 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar37 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar36 = 0; pEVar23 = Game::Spawn(g_game,0x12,0,&VStack_264,&VStack_24c,(Entity *)this_00,0, uVar15); iVar22 = __RTDynamicCast(pEVar23,uVar36,pTVar37,pTVar38,uVar39); iVar14 = iVar14 + 1; *(undefined1 *)(iVar22 + 0x174) = 1; *(float *)(iVar22 + 0x380) = *(float *)(iVar22 + 0x380) - 2.0; } while (iVar14 < (int)pAStack_23c); } } else if (iVar14 == 6) { Entity_NPC::PlaySound(this_00,0x109,1.2,2,0,1.0); Entity_NPC::QueryNPCsType(&uStack_18c,0x1e,-1); iVar14 = 2; pAStack_23c = (AnimationState *)0x2; bVar11 = Entity::HasEntityFlags((Entity *)this_00,0x1000000000000000); if (bVar11 != 0) { iVar22 = Entity::CountRelatedEntities((Entity *)this_00,0x1e,0,unused_03,(void *)0x0); if (3 - iVar22 < 3) { iVar14 = 3 - iVar22; } pAStack_23c = (AnimationState *)iVar14; } pEStack_240 = (Entity *)0x0; if (0 < iVar14) { EVar12 = in_stack_fffffe78; do { tmpVec = (Vector *)0x0; cStack_241 = '\x01'; fVar29 = (float)(&DAT_00c5c5bc)[(int)pEStack_240 * 2] + (this_00->_pos).x; pvVar34 = (void *)((float)(&DAT_00c5c5c0)[(int)pEStack_240 * 2] + (this_00->_pos).y) ; VStack_254.x = fVar29; VStack_254.y = (float)pvVar34; in_stack_fffffe78 = EVar12; if (in_stack_fffffe80 == (Vector *)0x0) { LAB_0047d335: uVar15 = Random(); Game::Spawn(g_game,0x1e,0,&VStack_254,&g_vectorZero,(Entity *)this_00,0,uVar15); } else { do { iVar14 = *(int *)((int)EVar12 + (int)tmpVec * 4); fVar31 = fVar29 - *(float *)(iVar14 + 0x33c); fVar32 = (float)pvVar34 - *(float *)(iVar14 + 0x340); if (fVar32 * fVar32 + fVar31 * fVar31 < 400.0) { cStack_241 = '\0'; *(undefined4 *)(iVar14 + 0x380) = *(undefined4 *)(iVar14 + 900); uVar15 = Random(); EVar12 = in_stack_fffffe78; Game::Spawn(g_game,1000,0xf,&VStack_254,&g_vectorZero,(Entity *)0x0,0,uVar15); pvVar34 = (void *)VStack_254.y; fVar29 = VStack_254.x; in_stack_fffffe78 = EVar12; } tmpVec = (Vector *)((int)&tmpVec->x + 1); } while (tmpVec < in_stack_fffffe80); if (cStack_241 != '\0') goto LAB_0047d335; } pEStack_240 = (Entity *)&pEStack_240->field_0x1; EVar12 = in_stack_fffffe78; } while ((int)pEStack_240 < (int)pAStack_23c); } if ((char)uStack_18c == '\0') { tracked_alloc(1,(void *)in_stack_fffffe78,0); } } else if (iVar14 == 2) { Entity_NPC::PlaySound(this_00,0xc,1.0,2,0,1.0); uVar15 = Random(); VStack_26c.y = (this_00->_pos).y - 20.0; VStack_26c.x = ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0) + (this_00->_pos).x; uVar15 = Random(); VStack_24c.y = 10.0; VStack_24c.x = (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 3.0 - 1.5; Entity_NPC::FireProjectiles(this_00,&VStack_26c,&VStack_24c,5,&PStack_238); } else if (iVar14 == 4) { Entity_NPC::PlaySound(this_00,0xb,1.0,2,0,1.0); uVar15 = Random(); VStack_27c.x = (this_00->_pos).x + 13.0; VStack_27c.y = (-18.0 - ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0)) + (this_00->_pos).y; uVar15 = Random(); VStack_274.x = -10.0; VStack_274.y = ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0) - 1.5; Entity_NPC::FireProjectiles(this_00,&VStack_27c,&VStack_274,5,&PStack_238); } else if (iVar14 == 5) { Entity_NPC::PlaySound(this_00,0xb,1.0,2,0,1.0); Random(); uVar15 = Random(); VStack_284.x = 10.0; VStack_284.y = ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0) - 1.5; Entity_NPC::FireProjectiles (this_00,(Vector *)(auStack_15a + -0x2a),&VStack_284,5,&PStack_238); } } } } LAB_0047d697: pAStack_23c = &(this_00->_sprite)._animState; if ((this_00->_sprite)._animState._animData != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered(pAStack_23c,(byte *)"FaceAttackAppear"); manager = g_manager; if (bVar11 != 0) { pEStack_240 = (Entity *)0x3ab; seed_fart_sound_override((int *)&pEStack_240); SoundEffects::Play(&manager->_sfxManager,(int)pEStack_240,1.0,2,0,1.0,0.0); pAStack_23c = &(this_00->_sprite)._animState; } if ((this_00->_sprite)._animState._animData != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered (&(this_00->_sprite)._animState,(byte *)"FaceAttackHide"); manager = g_manager; if (bVar11 != 0) { pEStack_240 = (Entity *)0x3ac; seed_fart_sound_override((int *)&pEStack_240); SoundEffects::Play(&manager->_sfxManager,(int)pEStack_240,1.0,2,0,1.0,0.0); } pAVar27 = pAStack_23c; if ((this_00->_sprite)._animState._animData != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered(pAStack_23c,(byte *)"SmileAppear"); manager = g_manager; if (bVar11 == 0) goto LAB_0047d7dd; pEStack_240 = (Entity *)0x3ad; seed_fart_sound_override((int *)&pEStack_240); SoundEffects::Play(&manager->_sfxManager,(int)pEStack_240,1.0,2,0,1.0,0.0); } } } pAVar27 = pAStack_23c; LAB_0047d7dd: if ((this_00->_sprite)._animState._animData != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered(pAVar27,(byte *)"SmileHide"); manager = g_manager; if (bVar11 != 0) { pEStack_240 = (Entity *)0x3ae; seed_fart_sound_override((int *)&pEStack_240); SoundEffects::Play(&manager->_sfxManager,(int)pEStack_240,1.0,2,0,1.0,0.0); } } if (auStack_294[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (auStack_294._4_4_ != 0) { uVar15 = *(uint *)(auStack_294._4_4_ + -4); qVar10 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar15; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar10 < uVar15); free((void *)(auStack_294._4_4_ + -4)); } } ExceptionList = pvVar20; return; } LAB_0047c75c: if (0x1e < (npc->_vectorDeque1)._size) { std::deque::erase(); } if (npc->_variant == 0) { if (npc->_subtype == 1) { fVar29 = npc->_friction * 0.75; } else { if (npc->_subtype != 2) goto LAB_0047c7e0; fVar29 = npc->_friction * 0.86; } } else { LAB_0047c7e0: fVar29 = npc->_friction * 0.8; } npc->_friction = fVar29; LAB_0047c7f8: (npc->_v2).y = npc->_health; ExceptionList = local_1c; return; } //@@ 0047c850 NpcAI::ENTITY_GURDY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 36 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GURDY(Entity_NPC *npc) { qword qVar1; byte bVar2; uint uVar3; Entity_Player *player; uint angleRng; Entity_NPC *relatedNpc; int iVar4; byte *curAnimName; int iVar5; Entity *spawnedFly; void *boilListData; byte *newAnimName; int unused; int unused_00; qword *allocCounter; AnimationState *pAVar6; bool bVar7; float fVar8; float fVar9; float fVar10; void *boilListData; float fVar12; undefined4 uVar13; Vector *position; TypeDescriptor *pTVar14; TypeDescriptor *pTVar15; undefined4 uVar16; undefined4 local_164; undefined4 local_160; undefined4 local_15c; undefined4 local_158; float local_154; float local_150; float local_14c; float local_148; undefined4 local_144; undefined4 local_140; undefined1 spawnerTypeNpcs [16]; Vector rightShotVelocity; Vector leftShotPos; Vector leftShotVelocity; Vector downShotPos; Vector flySpawnPos; Vector local_104; Vector local_fc; Vector local_f4; char isSpotFree; Entity *local_e8; AnimationState *local_e4; ProjectileParams projParams; char local_34 [4]; void *local_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af2b68; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; local_104.y = (float)npc; local_24 = uVar3; local_e8 = Entity_NPC::GetPlayerTarget(npc); if (npc->_state == 0) { iVar5 = *(int *)((int)g_game->_room + 4); if ((((iVar5 == 0) || (iVar5 = *(int *)(iVar5 + 0x10), iVar5 == 0)) || (*(int *)(iVar5 + 0x48) == 1)) && (-1 < npc->_spawnGridIndex)) { local_fc.x = (npc->_pos).x; local_fc.y = 400.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { uVar3 = 0; local_e8 = (Entity *)local_fc.x; do { if (uVar3 == 0) { player = Game::GetPlayer(g_game,0); position = &local_fc; } else { player = Game::GetPlayer(g_game,uVar3); angleRng = Random(); fVar8 = (float)((double)(int)angleRng + __uint_to_double_fixup[-((int)angleRng >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_e4 = (AnimationState *)(fVar8 + fVar8); fVar8 = cos((float)local_e4); local_f4.x = fVar8 * 20.0 + (float)local_e8; fVar8 = sin((float)local_e4); position = &local_f4; local_f4.y = fVar8 * 20.0 + 400.0; } Entity_Player::Teleport(player,position,0,0); uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); npc = (Entity_NPC *)local_104.y; } } (npc->_pos).y = (npc->_pos).y + 25.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; ExceptionList = local_1c; return; } fVar8 = (npc->_targetPosition).x; fVar12 = (npc->_pos).x; iVar5 = npc->_type; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; fVar9 = npc->_friction; (npc->_velocity).x = fVar8 - fVar12; npc->_friction = fVar9 * 0.8; Entity_NPC::QueryNPCsSpawnerType((EntityList *)spawnerTypeNpcs,iVar5,0,0); local_14 = 0; local_e4 = (AnimationState *)0x0; if (spawnerTypeNpcs._12_4_ != 0) { do { relatedNpc = (Entity_NPC *) __RTDynamicCast(*(undefined4 *)(spawnerTypeNpcs._4_4_ + (int)local_e4 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar3); if ((relatedNpc != (Entity_NPC *)0x0) && (relatedNpc != npc)) { if (relatedNpc->_type == 0x1e) { if ((npc->_dead != 0) && ((npc->_flags & 0x1000000000000000) != 0)) { local_154 = g_vectorZero.x; local_14c = g_vectorZero.x; local_150 = g_vectorZero.y; local_148 = g_vectorZero.y; local_164 = 0; local_160 = 0; local_15c = 0; local_158 = 0; local_144 = 0; local_140 = 0; (**(code **)(*(int *)relatedNpc + 0x24))(&local_164); } } else { local_fc.y = (relatedNpc->_pos).y - (npc->_pos).y; local_104.y = (relatedNpc->_pos).x - (npc->_pos).x; fVar8 = sqrtf(local_fc.y * local_fc.y + local_104.y * local_104.y); if ((0.01 < fVar8) && (fVar8 < 80.0)) { fVar12 = relatedNpc->_friction; fVar8 = ((80.0 - fVar8) * 0.03) / fVar8; if (fVar12 != 0.0) { fVar9 = relatedNpc->_speedMultiplier; (relatedNpc->_velocity).y = (fVar9 * local_fc.y * fVar8) / fVar12 + (relatedNpc->_velocity).y; (relatedNpc->_velocity).x = (fVar9 * local_104.y * fVar8) / fVar12 + (relatedNpc->_velocity).x; } } } } local_e4 = (AnimationState *)((int)local_e4 + 1); } while (local_e4 < (uint)spawnerTypeNpcs._12_4_); } if (npc->_state == 3) { if (npc->_stateFrame == 0) { Random(); if (0.0 < (npc->_v1).x) { (npc->_v1).x = 0.0; } sprintf_s(&DAT_00c7f718,0x20,(byte *)"Idle%d"); bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00c7f718,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_stateFrame = npc->_stateFrame + 1; } else if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pAVar6 = (AnimationState *)0x0; local_e4 = (AnimationState *)0x0; if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { uVar3 = Random(); if ((uVar3 % 3 == 0) || (fVar8 = (local_e8->_pos).y, fVar8 <= 200.0)) { LAB_0047ce36: iVar4 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar5 = 0; if (0 < iVar4) { iVar5 = iVar4; } if (iVar5 < 0xe) { LAB_0047ce56: uVar3 = Random(); local_2c.x = 1.4013e-45; local_30 = (void *)0x3; local_2c.y = 8.40779e-45; pAVar6 = *(AnimationState **)(local_34 + (uVar3 % 3) * 4 + 4); LAB_0047ce79: local_e4 = pAVar6; } npc->_stateFrame = 0; if ((int)pAVar6 < 1) goto LAB_0047d697; } else { iVar4 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar5 = 0; if (0 < iVar4) { iVar5 = iVar4; } if (7 < iVar5) goto LAB_0047ce36; if (npc->_subtype == 1) goto LAB_0047ce56; fVar8 = (npc->_pos).y - fVar8; fVar12 = (npc->_pos).x - (local_e8->_pos).x; if ((ABS(fVar8) < ABS(fVar12)) || (0.0 < fVar8)) { if (0.0 < fVar12) { pAVar6 = (AnimationState *)0x4; npc->_stateFrame = 0; local_e4 = (AnimationState *)0x4; goto LAB_0047ce91; } pAVar6 = (AnimationState *)0x5; goto LAB_0047ce79; } pAVar6 = (AnimationState *)0x2; npc->_stateFrame = 0; local_e4 = (AnimationState *)0x2; } LAB_0047ce91: npc->_state = 8; sprintf_s(&DAT_00c7f718,0x20,(byte *)"Attack%d"); curAnimName = (npc->_sprite)._animState._animData; if (curAnimName == (byte *)0x0) { LAB_0047cf06: bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00c7f718,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pAVar6 = local_e4; } } else { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } newAnimName = &DAT_00c7f718; do { bVar2 = *curAnimName; bVar7 = bVar2 < *newAnimName; if (bVar2 != *newAnimName) { LAB_0047cee6: uVar3 = -(uint)bVar7 | 1; goto LAB_0047ceeb; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; bVar7 = bVar2 < newAnimName[1]; if (bVar2 != newAnimName[1]) goto LAB_0047cee6; curAnimName = curAnimName + 2; newAnimName = newAnimName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0047ceeb: if ((uVar3 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0047cf06; } npc->_i1 = (int)pAVar6; (npc->_v1).x = 0.0; } else { npc->_stateFrame = 0; } } } else if (npc->_state == 8) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; npc->_state = 3; } else { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { ProjectileParams::ProjectileParams(&projParams); iVar5 = npc->_i1; if (iVar5 == 3) { Entity_NPC::PlaySound(npc,0x109,0.7,2,0,1.0); Entity_NPC::PlaySound(npc,9,1.0,2,0,1.0); uVar3 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; if ((uVar3 == 0) || (uVar3 = Entity::CountRelatedEntities((Entity *)npc,0xe,0,uVar3,(void *)0x0), uVar3 < 3 )) { uVar3 = Random(); local_104.x = (npc->_pos).x + 60.0; local_104.y = (npc->_pos).y - 25.0; local_f4.x = 10.0; local_f4.y = 0.0; Game::Spawn(g_game,0xe,0,&local_104,&local_f4,(Entity *)npc,0,uVar3); } } else if (iVar5 == 1) { Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xd,1.0,2,0,1.0); local_e4 = (AnimationState *)0x2; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { iVar5 = Entity::CountRelatedEntities((Entity *)npc,0x12,0,unused,(void *)0x0); local_e4 = (AnimationState *)2; if (3 - iVar5 < 3) { local_e4 = (AnimationState *)(3 - iVar5); } } iVar5 = 0; if (0 < (int)local_e4) { local_f4.x = 0.0; local_f4.y = -20.0; do { if (iVar5 == 0) { local_e8 = (Entity *)0x3f800000; } else { local_e8 = (Entity *)&DAT_bf800000; } uVar3 = Random(); flySpawnPos.y = (npc->_pos).y - 65.0; flySpawnPos.x = (float)local_e8 * 40.0 + (npc->_pos).x; uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; spawnedFly = Game::Spawn(g_game,0x12,0,&flySpawnPos,&local_f4,(Entity *)npc,0,uVar3); iVar4 = __RTDynamicCast(spawnedFly,uVar13,pTVar14,pTVar15,uVar16); iVar5 = iVar5 + 1; *(undefined1 *)(iVar4 + 0x174) = 1; *(float *)(iVar4 + 0x380) = *(float *)(iVar4 + 0x380) - 2.0; } while (iVar5 < (int)local_e4); } } else if (iVar5 == 6) { Entity_NPC::PlaySound(npc,0x109,1.2,2,0,1.0); Entity_NPC::QueryNPCsType(local_34,0x1e,-1); iVar5 = 2; local_14 = CONCAT31(local_14._1_3_,1); local_e4 = (AnimationState *)0x2; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { iVar4 = Entity::CountRelatedEntities((Entity *)npc,0x1e,0,unused_00,(void *)0x0); if (3 - iVar4 < 3) { iVar5 = 3 - iVar4; } local_e4 = (AnimationState *)iVar5; } local_e8 = (Entity *)0x0; if (0 < iVar5) { do { fVar12 = 0.0; isSpotFree = '\x01'; fVar8 = (float)(&DAT_00c5c5bc)[(int)local_e8 * 2] + (npc->_pos).x; boilListData = (void *)((float)(&DAT_00c5c5c0)[(int)local_e8 * 2] + (npc->_pos).y); local_fc.x = fVar8; local_fc.y = (float)boilListData; if (local_2c.y == 0.0) { LAB_0047d335: uVar3 = Random(); Game::Spawn(g_game,0x1e,0,&local_fc,&g_vectorZero,(Entity *)npc,0,uVar3); } else { boilListData = local_30; do { iVar5 = *(int *)((int)boilListData + (int)fVar12 * 4); fVar9 = fVar8 - *(float *)(iVar5 + 0x33c); fVar10 = (float)boilListData - *(float *)(iVar5 + 0x340); if (fVar10 * fVar10 + fVar9 * fVar9 < 400.0) { isSpotFree = '\0'; *(undefined4 *)(iVar5 + 0x380) = *(undefined4 *)(iVar5 + 900); uVar3 = Random(); Game::Spawn(g_game,1000,0xf,&local_fc,&g_vectorZero,(Entity *)0x0,0,uVar3); boilListData = local_30; fVar8 = local_fc.x; boilListData = (void *)local_fc.y; } fVar12 = (float)((int)fVar12 + 1); } while ((uint)fVar12 < (uint)local_2c.y); if (isSpotFree != '\0') goto LAB_0047d335; } local_e8 = (Entity *)&local_e8->field_0x1; } while ((int)local_e8 < (int)local_e4); } uVar3 = local_14 >> 8; local_14 = local_14 & 0xffffff00; if (local_34[0] == '\0') { local_14._0_1_ = 2; local_14._1_3_ = (uint3)uVar3; tracked_alloc(1,local_30,0); local_14 = (uint)local_14._1_3_ << 8; } } else if (iVar5 == 2) { Entity_NPC::PlaySound(npc,0xc,1.0,2,0,1.0); uVar3 = Random(); downShotPos.y = (npc->_pos).y - 20.0; downShotPos.x = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0) + (npc->_pos).x; uVar3 = Random(); local_f4.y = 10.0; local_f4.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.0 - 1.5; Entity_NPC::FireProjectiles(npc,&downShotPos,&local_f4,5,&projParams); } else if (iVar5 == 4) { Entity_NPC::PlaySound(npc,0xb,1.0,2,0,1.0); uVar3 = Random(); leftShotPos.x = (npc->_pos).x + 13.0; leftShotPos.y = (-18.0 - ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0)) + (npc->_pos).y; uVar3 = Random(); leftShotVelocity.x = -10.0; leftShotVelocity.y = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0) - 1.5; Entity_NPC::FireProjectiles(npc,&leftShotPos,&leftShotVelocity,5,&projParams); } else if (iVar5 == 5) { Entity_NPC::PlaySound(npc,0xb,1.0,2,0,1.0); uVar3 = Random(); local_2c.x = (npc->_pos).x - 13.0; local_2c.y = (-18.0 - ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0)) + (npc->_pos).y; uVar3 = Random(); rightShotVelocity.x = 10.0; rightShotVelocity.y = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0) - 1.5; Entity_NPC::FireProjectiles(npc,&local_2c,&rightShotVelocity,5,&projParams); } } } } LAB_0047d697: local_e4 = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(local_e4,(byte *)"FaceAttackAppear"); manager = g_manager; if (bVar2 != 0) { local_e8 = (Entity *)0x3ab; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); local_e4 = &(npc->_sprite)._animState; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"FaceAttackHide"); manager = g_manager; if (bVar2 != 0) { local_e8 = (Entity *)0x3ac; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); } pAVar6 = local_e4; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(local_e4,(byte *)"SmileAppear"); manager = g_manager; if (bVar2 == 0) goto LAB_0047d7dd; local_e8 = (Entity *)0x3ad; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); } } } pAVar6 = local_e4; LAB_0047d7dd: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(pAVar6,(byte *)"SmileHide"); manager = g_manager; if (bVar2 != 0) { local_e8 = (Entity *)0x3ae; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); } } if (spawnerTypeNpcs[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (spawnerTypeNpcs._4_4_ != 0) { uVar3 = *(uint *)(spawnerTypeNpcs._4_4_ + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free((void *)(spawnerTypeNpcs._4_4_ + -4)); } } ExceptionList = local_1c; return; } //@@ 0047d8a0 NpcAI::ENTITY_PEEP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 68 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PEEP(Entity_NPC *npc) { uint *puVar1; float *pfVar2; void **ppvVar3; float fVar4; code *pcVar5; void *pvVar6; byte bVar7; byte bVar8; uint uVar9; Vector *pVVar10; Entity *tmpEntity; RoomDescriptor *roomDesc; int iVar11; EntityRef *killSource; uint uVar12; ColorMod *extraout_EAX; Color *srcColor; int *creepEffect; ColorMod *pCVar13; ProjectileParams *pPVar14; Entity_Projectile *bossShot; int3 extraout_var; int3 extraout_var_00; int3 extraout_var_01; int3 extraout_var_02; Entity_Laser *laserLeft; Entity_Laser *laserRight; Entity_Effect *splat; std_string *sheetPath; int eyesSpawned; Entity_NPC *eye; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; uint extraout_EDX; EntityPtr *eyeParentPtr; float fVar15; float fVar16; undefined4 uVar17; TypeDescriptor *pTVar18; TypeDescriptor *pTVar19; undefined4 uVar20; Vector freePickupPos; Vector local_250; Vector local_248; Vector local_240; Vector local_238; Vector local_230; float local_228; EntityPtr local_224; Vector local_220; Vector local_218; ProjectileParams bossShotParams; ProjectileParams shotParams; ColorMod bloodColor; Color tmpColor; char sheetName [16]; int local_58; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; pvVar6 = ExceptionList; puStack_20 = local_50 + 0x4c; local_14 = -NAN; puStack_18 = &LAB_00af2bc5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_228 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_224 = (EntityPtr)npc; if (npc->_state == 0) { npc->_state = 4; if (9 < (uint)npc->_variant) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; npc->_isInvicible = 1; npc->_entityGridCollisionClass = 3; if (npc->_subtype == 99) { npc->_canShutDoors = 0; ExceptionList = pvVar6; return; } ExceptionList = pvVar6; return; } if (npc->_variant != 1) { ExceptionList = pvVar6; return; } if (g_game->_challenge != 0x20) { ExceptionList = pvVar6; return; } if (g_game->_stage != 6) { ExceptionList = pvVar6; return; } if (*(int *)((int)g_game->_room + 8) != 5) { ExceptionList = pvVar6; return; } if (npc->_spawnerType == npc->_type) { ExceptionList = pvVar6; return; } puStack_20 = local_50 + 0x4c; uVar9 = Random(); uVar12 = npc->_subtype; pVVar10 = MusicManager::RandomVector(&local_240); local_218.x = pVVar10->x * 40.0 + ((Vector *)((int)local_224 + 0x33c))->x; local_218.y = pVVar10->y * 40.0 + ((Vector *)((int)local_224 + 0x33c))->y; Game::Spawn(g_game,*(int *)((int)local_224 + 0x28),*(int *)((int)local_224 + 0x2c),&local_218, (Vector *)((int)local_224 + 0x360),(Entity *)local_224,uVar12,uVar9); ExceptionList = local_1c; return; } Entity_NPC::CalcTargetPosition(npc,&local_218,0.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); uVar12 = npc->_variant; local_238.y = (tmpEntity->_velocity).x; fVar15 = (tmpEntity->_velocity).y; local_238.y = local_238.y + local_238.y; local_220.y = fVar15 + fVar15; if (9 < uVar12) { ANM2::Play(&npc->_sprite,s_Walk,0); if (npc->_subtype == 99) { roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); if ((((uint)roomDesc->Flags >> 1 & 1) == 0) && ((iVar11 = Entity_NPC::GetAliveEnemyCount(npc), 0 < iVar11 || (8 < *(int *)((int)g_game->_room + 0x11ec))))) goto LAB_0047dade; } else if ((npc->_parent != (EntityPtr)0x0) && (*(char *)((int)npc->_parent + 0x173) == '\0')) goto LAB_0047dade; killSource = EntityRef::EntityRef((EntityRef *)(local_50 + 4)); (**(code **)(*(int *)npc + 0x24))(killSource); LAB_0047dade: uVar12 = Random(); if ((uVar12 & 3) == 0) { uVar12 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3); } fVar15 = sqrtf(2.0); local_230.y = fVar15 * 0.45; local_224 = (EntityPtr)(npc->_velocity).x; if (((0.0 < (float)local_224) && ((npc->_v1).x <= 0.0)) || ((local_228 = (npc->_velocity).y, 0.0 < local_228 && ((npc->_v1).y <= 0.0)))) { uVar12 = Random(); npc->_i2 = uVar12 % 0x1f - 0xf; local_228 = (npc->_velocity).y; local_224 = (EntityPtr)(npc->_velocity).x; } local_220.y = ((float)npc->_i2 * 3.1415927) / 180.0 + 0.7853982; local_238.y = sin(local_220.y); if (local_228 <= 0.0) { local_238.y = -local_238.y; } local_238.y = local_230.y * local_238.y; fVar15 = cos(local_220.y); if ((float)local_224 <= 0.0) { fVar15 = -fVar15; } fVar16 = npc->_friction * 0.9; npc->_friction = fVar16; if (fVar16 != 0.0) { fVar4 = npc->_speedMultiplier; (npc->_velocity).x = (local_230.y * fVar15 * fVar4) / fVar16 + (float)local_224; (npc->_velocity).y = (local_238.y * fVar4) / fVar16 + (npc->_velocity).y; } (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; ExceptionList = local_1c; return; } if (uVar12 == 1) { if (npc->_subtype == 1) { pCVar13 = &bloodColor; bloodColor._tint[0] = 1.0; bloodColor._tint[1] = 1.0; bloodColor._tint[2] = 1.0; bloodColor._tint[3] = 0.9; bloodColor._offset[0] = 0.0; bloodColor._colorize[0] = 0.5; bloodColor._colorize[1] = 3.0; bloodColor._colorize[2] = 0.0; bloodColor._colorize[3] = 1.0; bloodColor._offset[1] = 0.0; bloodColor._offset[2] = 0.0; } else { Color::Color((Color *)local_50); pCVar13 = extraout_EAX; uVar12 = extraout_EDX; } tmpColor._tint[0] = pCVar13->_tint[0]; tmpColor._tint[1] = pCVar13->_tint[1]; tmpColor._tint[2] = pCVar13->_tint[2]; tmpColor._tint[3] = pCVar13->_tint[3]; tmpColor._colorize[0] = pCVar13->_colorize[0]; tmpColor._colorize[1] = pCVar13->_colorize[1]; tmpColor._colorize[2] = pCVar13->_colorize[2]; tmpColor._colorize[3] = pCVar13->_colorize[3]; tmpColor._offset[2] = pCVar13->_offset[2]; srcColor = &tmpColor; tmpColor._offset._0_8_ = *(undefined8 *)pCVar13->_offset; } else { srcColor = (Color *)local_50; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; fStack_44 = 0.9; local_30 = 0.0; local_40 = 3.0; fStack_3c = 3.0; fStack_38 = 0.0; fStack_34 = 1.0; local_2c = 0.0; local_28 = 0.0; } bloodColor._tint[0] = srcColor->_tint[0]; bloodColor._tint[1] = srcColor->_tint[1]; bloodColor._tint[2] = srcColor->_tint[2]; bloodColor._tint[3] = srcColor->_tint[3]; bloodColor._colorize[0] = srcColor->_colorize[0]; bloodColor._colorize[1] = srcColor->_colorize[1]; bloodColor._colorize[2] = srcColor->_colorize[2]; bloodColor._colorize[3] = srcColor->_colorize[3]; bloodColor._offset[0] = srcColor->_offset[0]; bloodColor._offset[1] = srcColor->_offset[1]; bloodColor._offset[2] = srcColor->_offset[2]; if (npc->_entityCollisionClass == 0) { LAB_0047ddee: if (uVar12 == 0) goto LAB_0047ddf6; } else { if ((uVar12 != 0) || (npc->_subtype != 1)) { npc->_friction = npc->_friction * 0.6; goto LAB_0047ddee; } npc->_friction = npc->_friction * 0.8; LAB_0047ddf6: if (((npc->_subtype == 1) && (*(char *)g_game->_room != '\0')) && (iVar11 = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0), iVar11 == (iVar11 / 0xd) * 0xd)) { uVar12 = Random(); uVar20 = 0; pTVar19 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar18 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar17 = 0; tmpEntity = Game::Spawn(g_game,1000,0x18,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar12); creepEffect = (int *)__RTDynamicCast(tmpEntity,uVar17,pTVar18,pTVar19,uVar20); fVar15 = g_vectorOne.y * 1.6; creepEffect[0x39] = (int)(g_vectorOne.x * 1.6); creepEffect[0x3a] = (int)fVar15; (**(code **)(*creepEffect + 0xc))(); } } switch(npc->_state) { case 4: PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); ANM2::Play(&npc->_sprite,s_Walk,0); npc->_stateFrame = 0; bVar7 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (((bVar7 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && ((npc->_variant != 0 || ((npc->_subtype != 1 || (uVar12 = Random(), uVar12 % 3 != 0)))))) { uVar12 = Random(); if (uVar12 % 0x17 == 0) { npc->_state = 6; } uVar12 = Random(); if (uVar12 % 0x14 == 0) { uVar12 = Random(); iVar11 = 0xd; if ((uVar12 & 1) == 0) { iVar11 = 8; } npc->_state = iVar11; } if (npc->_variant == 1) { pCVar13 = (ColorMod *)Color::Color(0x3f4ccccd); Color::operator_assign(&tmpColor,pCVar13); if ((ABS((((npc->_pos).y - local_218.y) - 40.0) - local_220.y * 5.0) < 20.0) && (npc->_size * npc->_scale < ABS((npc->_pos).x - local_218.x))) { npc->_state = 10; local_220.y = sin(0.0); local_230.x = cos(0.0); local_230.y = local_220.y; local_220.x = 20.0; local_220.y = -80.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_220,&local_230,0xc,(ColorMod *)&tmpColor,4.0); local_220.y = sin(3.1415927); local_230.x = cos(3.1415927); local_230.y = local_220.y; local_220.x = -20.0; local_220.y = -80.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_220,&local_230,0xc,(ColorMod *)&tmpColor,4.0); } if ((ABS(((npc->_pos).x - local_218.x) - local_238.y * 5.0) < 40.0) && (pfVar2 = &(npc->_pos).y, *pfVar2 <= local_218.y && local_218.y != *pfVar2)) { npc->_state = 9; local_230.y = sin(1.5707964); local_218.x = cos(1.5707964); local_218.y = local_230.y; local_220.x = 15.0; local_220.y = -40.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_220,&local_218,0xc,(ColorMod *)&tmpColor,4.0); local_218.y = local_230.y; local_220.x = -15.0; local_220.y = -40.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_220,&local_218,0xc,(ColorMod *)&tmpColor,4.0); } } } break; case 6: iVar11 = npc->_stateFrame; if (iVar11 == 0) { bVar7 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e0e4,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0xf,1.0,2,0,1.0); iVar11 = npc->_stateFrame; } npc->_stateFrame = iVar11 + 1; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar7 != 0) { fVar15 = (npc->_pos).y; (npc->_velocity).x = (local_218.x - (npc->_pos).x) * 0.033; (npc->_velocity).y = (local_218.y - fVar15) * 0.033; } bVar7 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); if (bVar7 != 0) { npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; npc->_state = 7; } break; case 7: if ((npc->_stateFrame == 0) && (bVar7 = ANM2::SetAnimation(&npc->_sprite,(byte *)"JumpDown",1), bVar7 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_stateFrame = npc->_stateFrame + 1; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } bVar7 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar7 != 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { ShockwaveParams::ShockwaveParams(&local_40); local_40 = (npc->_pos).x; fStack_3c = (npc->_pos).y; game = g_game->_room; local_28 = 1.4013e-44; local_30 = 0.025; fStack_34 = 0.035; ppvVar3 = &game->_roomList[0x9d].Data; *ppvVar3 = (void *)((int)*ppvVar3 + 1); uVar12 = (uint)game->_roomList[0x9d].Data & 0x80000001; if ((int)uVar12 < 0) { uVar12 = (uVar12 - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(game,uVar12,&local_40); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&shotParams); if (npc->_variant == 1) { local_230.y = 1.4013e-44; do { uVar12 = Random(); uVar9 = Random(); fVar15 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_220.y = fVar15 + fVar15; local_228 = sin(local_220.y); uVar9 = Random(); local_238.y = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 100.0; fVar15 = cos(local_220.y); uVar20 = 0; pTVar19 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_218.x = fVar15 * local_238.y + (npc->_pos).x; pTVar18 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; local_218.y = local_228 * local_238.y + (npc->_pos).y; uVar17 = 0; tmpEntity = Game::Spawn(g_game,1000,0x17 - (npc->_subtype != 1),&local_218,&g_vectorZero, (Entity *)npc,0,uVar12); iVar11 = __RTDynamicCast(tmpEntity,uVar17,pTVar18,pTVar19,uVar20); local_230.y = (float)((int)local_230.y + -1); fVar15 = g_vectorOne.y * 2.0; *(float *)(iVar11 + 0xe4) = g_vectorOne.x * 2.0; *(float *)(iVar11 + 0xe8) = fVar15; } while ((void *)local_230.y != (void *)0x0); if (npc->_subtype == 0) { bVar7 = Game::IsHardMode(); if (CONCAT31(extraout_var_01,bVar7) == 0 || extraout_var_01 < 0) { local_218.x = 10.0; local_218.y = 0.0; uVar12 = 8; } else { local_218.x = 12.0; local_218.y = 0.0; uVar12 = 8; } goto LAB_0047ea10; } iVar11 = 0; do { local_220.y = (float)ProjectileParams::ProjectileParams(&bossShotParams); if (iVar11 == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_218.x = (tmpEntity->_pos).x; local_218.y = (tmpEntity->_pos).y; pVVar10 = &local_218; } else { pVVar10 = &local_238; local_238.x = g_vectorZero.x; local_238.y = g_vectorZero.y; } bossShot = Entity_NPC::FireBossProjectiles(npc,1,pVVar10,10.0,(void *)local_220.y); fVar15 = bossShot->_fallingAccel; uVar17 = *(undefined4 *)((int)&bossShot->_projectileFlags + 4); *(uint *)&bossShot->_projectileFlags = (uint)bossShot->_projectileFlags | 2; *(undefined4 *)((int)&bossShot->_projectileFlags + 4) = uVar17; bossShot->_scale = 1.6; bossShot->_fallingAccel = fVar15 - 0.3; bossShot->_fallingSpeed = bossShot->_fallingSpeed * 0.7 - 13.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; fStack_44 = 1.0; local_30 = 0.0; local_2c = 0.0; local_28 = 0.0; local_40 = 0.4; fStack_3c = 2.0; fStack_38 = 0.5; fStack_34 = 1.0; (**(code **)(*(int *)bossShot + 0x3c))(local_50,0xffffffff,0xff,0,1); iVar11 = iVar11 + 1; } while (iVar11 < 3); } else { shotParams.Color._colorize[0] = 1.2; shotParams.Color._colorize[1] = 1.2; shotParams.Color._colorize[2] = 0.2; shotParams.Color._colorize[3] = 1.0; shotParams.Color._offset[0] = 0.23529413; shotParams.Color._offset[1] = 0.23529413; shotParams.Color._offset[2] = 0.0; bVar7 = Game::IsHardMode(); local_218.x = 12.0; if (CONCAT31(extraout_var_02,bVar7) == 0 || extraout_var_02 < 0) { local_218.x = 10.0; } local_218.y = 12.0; uVar12 = 9; LAB_0047ea10: Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_218,uVar12,&shotParams); } Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,&bloodColor,1.0); } break; case 8: iVar11 = npc->_stateFrame; if (iVar11 == 0) { bVar7 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0xf,1.0,2,0,1.0); iVar11 = npc->_stateFrame; } npc->_stateFrame = iVar11 + 1; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { Entity_NPC::PlaySound(npc,0x30,0.8,2,0,1.0); ProjectileParams::ProjectileParams(&shotParams); if (npc->_variant == 1) { if (npc->_subtype == 0) { bVar7 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar7) == 0 || extraout_var < 0) { local_218.x = 10.0; local_218.y = 0.0; uVar12 = 8; } else { local_218.x = 12.0; local_218.y = 0.0; uVar12 = 8; } goto LAB_0047e4ac; } iVar11 = 2; do { pPVar14 = ProjectileParams::ProjectileParams(&bossShotParams); bossShot = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,10.0,pPVar14); fVar15 = bossShot->_fallingAccel; uVar17 = *(undefined4 *)((int)&bossShot->_projectileFlags + 4); *(uint *)&bossShot->_projectileFlags = (uint)bossShot->_projectileFlags | 2; *(undefined4 *)((int)&bossShot->_projectileFlags + 4) = uVar17; bossShot->_scale = 1.6; bossShot->_fallingAccel = fVar15 - 0.3; bossShot->_fallingSpeed = bossShot->_fallingSpeed * 0.7 - 13.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; fStack_44 = 1.0; local_30 = 0.0; local_2c = 0.0; local_28 = 0.0; local_40 = 0.4; fStack_3c = 2.0; fStack_38 = 0.5; fStack_34 = 1.0; (**(code **)(*(int *)bossShot + 0x3c))(local_50,0xffffffff,0xff,0,1); iVar11 = iVar11 + -1; } while (iVar11 != 0); } else { shotParams.Color._colorize[0] = 1.2; shotParams.Color._colorize[1] = 1.2; shotParams.Color._colorize[2] = 0.2; shotParams.Color._colorize[3] = 1.0; shotParams.Color._offset[0] = 0.23529413; shotParams.Color._offset[1] = 0.23529413; shotParams.Color._offset[2] = 0.0; bVar7 = Game::IsHardMode(); if (CONCAT31(extraout_var_00,bVar7) == 0 || extraout_var_00 < 0) { local_218.x = 10.0; } else { local_218.x = 12.0; } local_218.y = 8.0; uVar12 = 9; LAB_0047e4ac: Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_218,uVar12,&shotParams); } Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,&bloodColor,1.0); } break; case 9: iVar11 = npc->_stateFrame; if (iVar11 == 0) { ANM2::Play(&npc->_sprite,(byte *)"AttackAlt01",1); iVar11 = npc->_stateFrame; } npc->_stateFrame = iVar11 + 1; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { local_250.x = (npc->_pos).x - 15.0; local_250.y = (npc->_pos).y - 40.0; local_240.x = 0.0; local_240.y = (float)&DAT_c1c80000; laserLeft = Entity_Laser::ShootAngle(1,&local_250,90.0,0x28,&local_240,(Entity *)npc,0); local_240.y = (float)&DAT_c1c80000; local_248.x = *(float *)((int)local_224 + 0x33c) + 15.0; fVar15 = 90.0; LAB_0047f0d6: local_248.y = *(float *)((int)local_224 + 0x340) - 40.0; local_240.x = 0.0; laserRight = Entity_Laser::ShootAngle (1,&local_248,fVar15,0x28,&local_240,(Entity *)local_224,0); laserLeft->_renderDepthOffset = 3000.0; laserRight->_renderDepthOffset = 3000.0; (**(code **)(*(int *)laserLeft + 0xc))(); (**(code **)(*(int *)laserRight + 0xc))(); npc = (Entity_NPC *)local_224; } break; case 10: iVar11 = npc->_stateFrame; if (iVar11 == 0) { ANM2::Play(&npc->_sprite,(byte *)"AttackAlt02",1); iVar11 = npc->_stateFrame; } npc->_stateFrame = iVar11 + 1; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { local_250.x = (npc->_pos).x - 20.0; local_250.y = (npc->_pos).y - 40.0; local_240.x = 0.0; local_240.y = -35.0; laserLeft = Entity_Laser::ShootAngle(1,&local_250,180.0,0x28,&local_240,(Entity *)npc,0); local_240.y = -35.0; local_248.x = *(float *)((int)local_224 + 0x33c) + 20.0; fVar15 = 0.0; goto LAB_0047f0d6; } break; case 0xd: if ((npc->_stateFrame == 0) && (bVar7 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d554,1), bVar7 != 0)) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_stateFrame = npc->_stateFrame + 1; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar7 != 0) { Entity_NPC::PlaySound(npc,0x95,1.0,2,0,1.0); uVar12 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x10,&npc->_pos,&g_vectorZero,(Entity *)npc,3,uVar12); (**(code **)(*(int *)tmpEntity + 0x3c))(&bloodColor,0xffffffff,0xff,0,1); uVar12 = Random(); (tmpEntity->_sprite)._flipX = ((byte)uVar12 ^ 0xff) & 1; (**(code **)(*(int *)tmpEntity + 0xc))(); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } local_220.y = 0.0; fVar15 = local_228; if (0 < (int)local_228) { do { pPVar14 = (ProjectileParams *)local_220.y; if ((npc->_sprite)._animState._animData != (void *)0x0) { local_230.y = (float)AnimationState::GetNullFrame (&(npc->_sprite)._animState,(byte *)"BloodGuide"); if (((void *)local_230.y != (void *)0x0) && (*(char *)((int)local_230.y + 0xc) != '\0')) { uVar12 = Random(); local_238.y = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_238.y = local_238.y + local_238.y; local_224 = (EntityPtr)sin(local_238.y); fVar15 = cos(local_238.y); local_238.y = fVar15 * *(float *)((int)local_230.y + 0x10) * 10.0; local_224 = (EntityPtr)((float)local_224 * *(float *)((int)local_230.y + 0x14) * 10.0); uVar12 = Random(); fVar15 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10; local_238.y = fVar15 * local_238.y; local_224 = (EntityPtr)((float)local_224 * fVar15); if ((npc->_variant == 1) && ((((npc->_subtype == 1 && ((npc->_sprite)._animState._animData != (void *)0x0)) && (bVar7 = AnimationState::IsEventTriggered (&(npc->_sprite)._animState,(byte *)"Shoot"), bVar7 != 0)) && (pPVar14 == (ProjectileParams *)0x0)))) { Room::FindFreePickupSpawnPosition(g_game->_room,&local_218,&npc->_pos,50.0,0,0,0); uVar12 = Random(); Game::Spawn(g_game,0x17,0,&local_218,&g_vectorZero,(Entity *)npc,0,uVar12); pVVar10 = Room::FindFreePickupSpawnPosition (g_game->_room,&freePickupPos,&npc->_pos,50.0,0,0,0); local_218.x = pVVar10->x; local_218.y = pVVar10->y; uVar12 = Random(); Game::Spawn(g_game,0x17,0,&local_218,&g_vectorZero,(Entity *)npc,0,uVar12); } uVar12 = 0x18; local_230.y = 2.0; if (npc->_variant == 1) { local_230.y = 2.6; uVar12 = 0x17 - (npc->_subtype != 1); } uVar9 = Random(); local_248.x = local_238.y + (npc->_pos).x; local_248.y = (float)local_224 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,uVar12,&local_248,&g_vectorZero,(Entity *)npc,0, uVar9); fVar15 = local_230.y * g_vectorOne.x; iVar11 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.y = local_230.y * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar15; (**(code **)(iVar11 + 0xc))(); local_240.x = local_238.y * 0.35 + (npc->_pos).x; local_250.x = local_238.y * 0.01; local_240.y = (float)local_224 * 0.35 + (npc->_pos).y; local_250.y = (float)local_224 * 0.01; uVar12 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&local_240,&local_250,(Entity *)0x0,3,uVar12); (**(code **)(*(int *)tmpEntity + 0x3c))(&bloodColor,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = g_vectorZero.x; (tmpEntity->_sprite)._offset.y = g_vectorZero.y; tmpEntity->_renderDepthOffset = 10.0; pPVar14 = (ProjectileParams *)local_220.y; } fVar15 = local_228; } local_220.y = (float)&pPVar14->field_0x1; } while ((int)local_220.y < (int)fVar15); } } uVar12 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); local_230.y = (float)splat; uVar12 = Random(); fVar15 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_220.y = fVar15 + fVar15; local_238.y = sin(local_220.y); fVar16 = cos(local_220.y); fVar15 = *(float *)((int)npc + 0x340); (splat->_pos).x = fVar16 + fVar16 + *(float *)((int)npc + 0x33c) + 0.0; (splat->_pos).y = local_238.y + local_238.y + fVar15 + 8.0; iVar11 = *(int *)((int)npc + 0x2c); if (iVar11 == 0) { pcVar5 = *(code **)(*(int *)splat + 0x3c); Color::Reset(&tmpColor); tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 0.7; tmpColor._offset[0] = 0.7843138; tmpColor._offset[1] = 0.7843138; tmpColor._offset[2] = 0.0; (*pcVar5)(&tmpColor,0xffffffff,0xff,0,1); iVar11 = *(int *)((int)npc + 0x2c); } fVar15 = (float)(2 - (int)((*(float *)((int)npc + 0x380) * 3.0) / *(float *)((int)npc + 900))); local_238.y = 2.8026e-45; if ((int)fVar15 < 2) { local_238.y = fVar15; } if ((iVar11 == 1) || (*(int *)((int)npc + 0x30) == 2)) { local_238.y = 2.8026e-45; } fVar15 = local_238.y; eyesSpawned = *(int *)((int)npc + 0xbc0); if (eyesSpawned < (int)local_238.y) { if (local_238.y != 1.4013e-45) goto LAB_0047f387; if (iVar11 == 0) { ANM2::GetLayer((ANM2 *)((int)npc + 0x48),(byte *)0x0); FUN_004562f0(sheetName); local_14 = 0.0; FUN_00414520(local_58 + -4,0); std::string::append(sheetName,(byte *)"_b.png",6); sheetPath = (std_string *) Menu_Character::ChangeCharacterPage((Menu_Character *)npc,&fStack_3c,sheetName); local_14._0_1_ = 1; Sprite::ReplaceSpritesheet((Sprite *)((int)npc + 0x48),0,sheetPath); local_14 = (float)((uint)local_14._1_3_ << 8); std::string::_Tidy_deallocate((char *)&fStack_3c); bVar8 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); bVar7 = extraout_CL; if (bVar8 != 0) { ANM2::LoadDeliriumForm ((ANM2 *)((int)npc + 0x48),*(int *)((int)npc + 0x28),*(int *)((int)npc + 0x2c),0); bVar7 = extraout_CL_00; } ANM2::LoadGraphics((ANM2 *)((int)npc + 0x48),bVar7); local_14 = -NAN; std::string::_Tidy_deallocate(sheetName); eyesSpawned = *(int *)((int)npc + 0xbc0); } } if ((int)fVar15 <= eyesSpawned) { ExceptionList = local_1c; return; } LAB_0047f387: if (fVar15 == 2.8026e-45) { if (*(int *)((int)npc + 0x2c) == 0) { ANM2::GetLayer((ANM2 *)((int)npc + 0x48),(byte *)0x0); FUN_004562f0(sheetName); local_14 = fVar15; FUN_00414520(local_58 + -4,0); std::string::append(sheetName,(byte *)"_c.png",6); sheetPath = (std_string *) Menu_Character::ChangeCharacterPage((Menu_Character *)npc,&fStack_3c,sheetName); local_14._0_1_ = 3; Sprite::ReplaceSpritesheet((Sprite *)((int)npc + 0x48),0,sheetPath); local_14 = (float)CONCAT31(local_14._1_3_,2); std::string::_Tidy_deallocate((char *)&fStack_3c); bVar8 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); bVar7 = extraout_CL_01; if (bVar8 != 0) { ANM2::LoadDeliriumForm ((ANM2 *)((int)npc + 0x48),*(int *)((int)npc + 0x28),*(int *)((int)npc + 0x2c),0); bVar7 = extraout_CL_02; } ANM2::LoadGraphics((ANM2 *)((int)npc + 0x48),bVar7); local_14 = -NAN; std::string::_Tidy_deallocate(sheetName); eyesSpawned = *(int *)((int)npc + 0xbc0); } if (1 < eyesSpawned) { ExceptionList = local_1c; return; } } do { manager = g_manager; local_228 = 1.0; if (*(int *)((int)npc + 0xc64) == 0x12) { local_228 = 1.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_228 = 0.5; } local_220.y = 3.32108e-43; seed_fart_sound_override((int *)&local_220.y); SoundEffects::Play(&manager->_sfxManager,(int)local_220.y,1.0,2,0,local_228,0.0); *(int *)((int)npc + 0xbc0) = *(int *)((int)npc + 0xbc0) + 1; uVar12 = Random(); uVar9 = Random(); fVar15 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_220.y = fVar15 + fVar15; fVar15 = cos(local_220.y); local_240.x = fVar15 * 30.0 + *(float *)((int)npc + 0x33c); fVar15 = sin(local_220.y); iVar11 = 0; pTVar19 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_240.y = fVar15 * 30.0 + *(float *)((int)npc + 0x340); pTVar18 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar17 = 0; tmpEntity = Game::Spawn(g_game,*(uint *)((int)npc + 0x28),*(int *)((int)npc + 0x2c) + 10, &local_240,&g_vectorZero,(Entity *)npc,0,uVar12); eye = (Entity_NPC *)__RTDynamicCast(tmpEntity,uVar17,pTVar18,pTVar19); Entity_NPC::SetBossColorIdx(eye,*(int *)((int)npc + 0xc78),iVar11); eyeParentPtr = &eye->_parent; if (eye->_parent != (EntityPtr)0x0) { local_220.y = (float)eyeParentPtr; std::multiset::erase(&local_220.y); } *eyeParentPtr = (EntityPtr)npc; std::multiset::insert(eyeParentPtr); } while (*(int *)((int)npc + 0xbc0) < (int)local_238.y); ExceptionList = local_1c; return; } //@@ 0047f640 NpcAI::ENTITY_SATAN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 84 (from dispatcher 006c2990) */ Entity_NPC * __fastcall NpcAI::ENTITY_SATAN(Entity_NPC *npc) { MusicManager *this; Room *this_00; Game *this_01; byte bVar1; char cVar2; float *pfVar3; Entity_NPC *extraout_EAX; byte *animName; Vector *pVVar4; Entity_NPC *extraout_EAX_00; Entity_Laser *laser; int *piVar5; uint uVar6; Entity_NPC *pEVar7; Entity *tmpEntity; ColorMod *color; float *parentHealth; EntityRef *sourceRef; char *compareName; int enemyCount; int aliveEnemyCount; int iVar8; code *extraout_EDX; code *extraout_EDX_00; int entityIdx; bool isLess; float fVar9; undefined1 auVar10 [12]; float fVar11; float fVar12; Vector local_168; Vector local_160; Vector VStack_158; Vector local_150; Vector local_148; byte isShoot2; Vector scratchVec; EntityRef EStack_134; ColorMod CStack_10c; ProjectileParams projParams; uint local_c; undefined4 flagsHigh; void *gridWidth; Manager *manager; void **shockwaveCounter; float speedMultiplier; local_c = __security_cookie ^ (uint)&local_168; if ((0.0 < npc->_pendingDamage) && (pfVar3 = (npc->_damageEvents)._begin, pfVar3 != (npc->_damageEvents)._end)) { do { if ((((uint)pfVar3[2] & 0x1000004) != 0) && (((pfVar3[4] != 1.4013e-45 && (pfVar3[6] != 1.4013e-45)) && (pfVar3[6] != 4.2039e-45)))) { npc->_pendingDamage = npc->_pendingDamage - *pfVar3; *pfVar3 = 0.0; } pfVar3 = pfVar3 + 0xe; } while (pfVar3 != (npc->_damageEvents)._end); } local_150.x = 1.0; if ((npc->_i1 == 2) && (npc->_health - npc->_pendingDamage < 0.0)) { (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; npc->_stateFrame = 0; npc->_health = 0.0; npc->_state = 4; npc->_dead = 0; npc->_i1 = 3; manager = g_manager; local_160.x = 1.0; if (npc->_championColorIdx == 0x12) { local_160.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_160.x = 0.5; } local_148.x = 3.39114e-43; seed_fart_sound_override((int *)&local_148); SoundEffects::Play(&manager->_sfxManager,(int)local_148.x,1.0,2,0,local_160.x,0.0); bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Death",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity::RemoveStatusEffects((Entity *)npc); } if (npc->_state == 0) { npc->_state = 3; npc->_entityCollisionClass = 0; manager = g_manager; if (npc->_variant != 10) { *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_maxHitPoints = 0.0; npc->_health = 0.0; (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; fVar11 = (npc->_pos).y; npc->_shadowSize = 0.0; (npc->_pos).y = fVar11 + 80.0; (npc->_targetPosition).x = (npc->_pos).x; pEVar7 = (Entity_NPC *)(npc->_pos).y; (npc->_targetPosition).y = (float)pEVar7; return pEVar7; } if (npc->_championColorIdx == 0x12) { local_150.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_150.x = 0.5; } local_160.x = 3.44719e-43; seed_fart_sound_override((int *)&local_160); SoundEffects::Play(&manager->_sfxManager,(int)local_160.x,1.0,4,0,local_150.x,0.0); npc->_i1 = 4; npc->_stateFrame = 0; npc->_visible = 0; npc->_shadowSize = 0.0; return extraout_EAX; } pVVar4 = &npc->_pos; npc->_friction = npc->_friction * 0.8; local_148.x = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); pEVar7 = g_game->_room; local_160.x = (float)(int)((((npc->_posOffset).x + pVVar4->x) - 40.0) / 40.0 + 0.5); if (((int)local_160.x < 0) || (gridWidth = (pEVar7->_damageEvents)._end, (int)gridWidth <= (int)local_160.x)) { LAB_0047f9ed: local_168.x = -NAN; } else { fVar11 = (((npc->_pos).y + (npc->_posOffset).y) - 120.0) / 40.0 + 0.5; iVar8 = (int)fVar11; if ((iVar8 < 0) || ((int)(pEVar7->_damageEvents)._capacity <= (int)fVar11)) goto LAB_0047f9ed; local_168.x = (float)((int)local_160.x + (int)gridWidth * iVar8); } switch(npc->_i1) { case 0: npc->_entityGridCollisionClass = 0; if ((uint)local_168.x < (int *)0x1c0) { *(undefined4 *)((int)g_game->_room + (int)local_168.x * 4 + 0x76c) = 2000; } if (0 < (int)local_148.x) { do { npc->_stateFrame = npc->_stateFrame + 1; manager = g_manager; if (npc->_stateFrame == 2) { if (npc->_championColorIdx == 0x12) { local_160.x = 1.5; } else { local_160.x = local_150.x; if (npc->_championColorIdx == 0x13) { local_160.x = 0.5; } } VStack_158.x = 3.33509e-43; seed_fart_sound_override((int *)&VStack_158); SoundEffects::Play(&manager->_sfxManager,(int)VStack_158.x,1.0,2,0,local_160.x,0.0); } local_148.x = (float)((int)local_148.x + -1); } while (local_148.x != 0.0); local_148.x = 0.0; } manager = g_manager; if (0x82 < npc->_stateFrame) { local_160.x = local_150.x; if (npc->_championColorIdx == 0x12) { local_160.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_160.x = 0.5; } VStack_158.x = 3.3491e-43; seed_fart_sound_override((int *)&VStack_158); SoundEffects::Play(&manager->_sfxManager,(int)VStack_158.x,1.0,2,0,local_160.x,0.0); manager = g_manager; if (npc->_championColorIdx == 0x12) { local_150.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_150.x = 0.5; } VStack_158.x = 3.71344e-43; seed_fart_sound_override((int *)&VStack_158); SoundEffects::Play(&manager->_sfxManager,(int)VStack_158.x,2.0,2,0,local_150.x,0.0); npc->_stateFrame = 0; npc->_i1 = npc->_i1 + 1; uVar6 = Random(); local_168.x = (npc->_pos).x + 0.0; local_168.y = (npc->_pos).y + 30.0; tmpEntity = Game::SpawnEx(g_game,0x51,0,&local_168,&g_vectorZero,(Entity *)npc,0,uVar6,0); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar6 = Random(); local_168.x = (npc->_pos).x + 50.0; local_168.y = (npc->_pos).y + 30.0; tmpEntity = Game::SpawnEx(g_game,0x37,1,&local_168,&g_vectorZero,(Entity *)npc,0,uVar6,0); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar6 = Random(); local_168.x = (npc->_pos).x - 50.0; local_168.y = (npc->_pos).y + 30.0; tmpEntity = Game::SpawnEx(g_game,0x37,1,&local_168,&g_vectorZero,(Entity *)npc,0,uVar6,0); (**(code **)(*(int *)tmpEntity + 0xc))(); FUN_007ebc40(); } animName = (npc->_sprite)._animState._animData; if (animName != (byte *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) goto code_r0x0047fd9b; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } compareName = "SmallIdle"; do { bVar1 = *animName; isLess = bVar1 < (byte)*compareName; if (bVar1 != *compareName) { code_r0x0047fd55: uVar6 = -(uint)isLess | 1; goto code_r0x0047fd5a; } if (bVar1 == 0) break; bVar1 = animName[1]; isLess = bVar1 < (byte)compareName[1]; if (bVar1 != compareName[1]) goto code_r0x0047fd55; animName = animName + 2; compareName = compareName + 2; } while (bVar1 != 0); uVar6 = 0; code_r0x0047fd5a: if ((uVar6 == 0) && (*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0')) goto code_r0x0047fd9b; } local_160.x = (float)&npc->_sprite; bVar1 = ANM2::SetAnimation((ANM2 *)local_160.x,(byte *)"SmallIdle",1); fVar11 = local_160.x; if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)local_160.x + 0x30)); ((AnimationState *)((int)fVar11 + 0x30))->_isPlaying = 1; } code_r0x0047fd9b: (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; pEVar7 = *(Entity_NPC **)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000000; *(Entity_NPC **)((int)&npc->_flags + 4) = pEVar7; return pEVar7; case 1: if ((uint)local_168.x < (int *)0x1c0) { (pEVar7->_floorColor)._tint[(int)local_168.x + -0x145] = 1.4013e-42; pEVar7 = g_game->_room; } enemyCount = (int)pEVar7[1]._sizeMulti.y + (int)pEVar7[1]._sizeMulti.x; iVar8 = 0; if (0 < enemyCount) { iVar8 = enemyCount; } if (iVar8 == 1) { if (0 < (int)local_148.x) { do { npc->_stateFrame = npc->_stateFrame + 1; if (npc->_stateFrame == 0x19) { *(undefined4 *)((int)g_game->_room + 0x12d0) = 0; fVar11 = *(float *)((int)npc->_config + 0x50); npc->_maxHitPoints = fVar11; npc->_health = fVar11; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_160.x = 1.5; } else { local_160.x = local_150.x; if (npc->_championColorIdx == 0x13) { local_160.x = 0.5; } } VStack_158.x = 3.40516e-43; seed_fart_sound_override((int *)&VStack_158); SoundEffects::Play(&manager->_sfxManager,(int)VStack_158.x,1.0,2,0,local_160.x,0.0); bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Change",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } this = &g_manager->_musicManager; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); MusicManager::Crossfade(this,0x17,0.08); } local_148.x = (float)((int)local_148.x + -1); } while (local_148.x != 0.0); local_148.x = 0.0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { Entity_NPC::PlaySound(npc,0xef,1.0,2,0,1.0); } if ((0x19 < npc->_stateFrame) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { npc->_i1 = npc->_i1 + 1; npc->_state = 4; npc->_stateFrame = 0; if ((uint)local_168.x < (int *)0x1c0) { *(undefined4 *)((int)g_game->_room + (int)local_168.x * 4 + 0x76c) = 0; } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xbfffffff; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } } (npc->_pos).x = (npc->_targetPosition).x; pEVar7 = (Entity_NPC *)(npc->_targetPosition).y; (npc->_pos).y = (float)pEVar7; return pEVar7; case 2: auVar10 = ZEXT812(0x43750000); npc->_renderZOffset = 0; npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 1; fVar11 = (npc->_pos).y; if (auVar10._0_4_ < fVar11) { auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar11; } (npc->_pos).y = auVar10._0_4_; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_168.x = (tmpEntity->_pos).x; local_150.x = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar11 = (tmpEntity->_velocity).x; fVar9 = (tmpEntity->_velocity).y; local_160.x = fVar11 + fVar11; pEVar7 = (Entity_NPC *)(npc->_state + -4); switch(pEVar7) { case (Entity_NPC *)0x0: ANM2::Play(&npc->_sprite,s_Walk,0); fVar9 = local_150.x * 0.93; fVar11 = local_160.x * 25.0 + local_168.x; if (fVar9 <= 305.0) { fVar9 = 305.0; } local_168.x = local_168.x - pVVar4->x; local_160.x = fVar11 - pVVar4->x; local_150.x = (fVar9 - (npc->_pos).y) - 60.0; local_148.x = local_168.x; local_148.y = local_150.x; if ((((local_160.x * local_168.x < 0.0) && (-70.0 < local_150.x)) && ((npc->_i2 != 9 || (uVar6 = Random(), uVar6 % 10 == 0)))) || (((npc->_i2 == 10 && (ABS(local_168.x) < 40.0)) && (uVar6 = Random(), uVar6 % 3 == 0)))) { Entity_NPC::PlaySound(npc,0xf0,1.0,2,0,1.0); npc->_stateFrame = 0; npc->_state = 9; npc->_i2 = 9; animName = &DAT_00b1d554; } else { uVar6 = Random(); if (uVar6 % 0xf == 0) { LAB_0048039d: npc->_stateFrame = 0; uVar6 = Random(); if (uVar6 % 10 < 3) { npc->_state = 8; npc->_i2 = 8; animName = &DAT_00b1d53c; goto LAB_004803f2; } npc->_state = 0xb; npc->_i2 = 0xb; } else { uVar6 = Random(); fVar11 = local_168.x; if (((uVar6 % 3 == 0) && (npc->_i2 != 8)) && (npc->_i2 != 0xb)) goto LAB_0048039d; if ((100.0 < ABS(local_168.x)) || (local_150.x < 0.0)) { local_168.x = 15.0; VStack_158.x = 7.0; pVVar4 = &local_148; if (15.0 <= fVar11) { pVVar4 = &local_168; } fVar11 = pVVar4->x; if (fVar11 <= -15.0) { fVar11 = -15.0; } pVVar4 = (Vector *)&local_148.y; if (7.0 <= local_150.x) { pVVar4 = &VStack_158; } fVar9 = pVVar4->x; if (fVar9 <= -7.0) { fVar9 = -7.0; } fVar12 = npc->_friction; if (fVar12 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = (fVar11 * 0.1 * speedMultiplier) / fVar12 + (npc->_velocity).x; (npc->_velocity).y = (fVar9 * 0.1 * speedMultiplier) / fVar12 + (npc->_velocity).y; } goto LAB_00480413; } if (((ABS(local_168.x) <= 40.0) || (200.0 <= ABS(local_160.x))) || (local_150.x < 0.0)) goto LAB_00480413; Entity_NPC::PlaySound(npc,0xf0,1.0,2,0,1.0); npc->_stateFrame = 0; npc->_state = 10; npc->_i2 = 10; } animName = &DAT_00b1d548; } LAB_004803f2: bVar1 = ANM2::SetAnimation(&npc->_sprite,animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_00480413: local_168.x = (npc->_pos).x + (npc->_velocity).x; local_168.y = (npc->_velocity).y + (npc->_pos).y; pEVar7 = (Entity_NPC *) Room::GetClampedPositionImpl (g_game->_room,&VStack_158,&local_168,0.0,120.0,0.0,120.0); fVar11 = (npc->_pos).y; (npc->_velocity).x = VStack_158.x - (npc->_pos).x; (npc->_velocity).y = VStack_158.y - fVar11; return pEVar7; default: goto LAB_004813c2; case (Entity_NPC *)0x4: local_160.x = (local_160.x * 5.0 + local_168.x) - pVVar4->x; VStack_158.x = ((fVar9 + fVar9) * 5.0 + local_150.x) - (npc->_pos).y; local_148.x = local_160.x; local_148.y = VStack_158.x; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { fVar11 = sqrtf(local_160.x * local_160.x + VStack_158.x * VStack_158.x); if ((300.0 <= fVar11) || (uVar6 = Random(), uVar6 % 3 == 0)) { npc->_state = 4; } else { bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,10.0); } } } isShoot2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot2"); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if ((bVar1 == 0) && (isShoot2 == 0)) { return (Entity_NPC *)0x0; } ProjectileParams::ProjectileParams(&projParams); projParams.Scale = 1.4; projParams.Spread = 1.15; projParams.FallingAccelModifier = -0.07; local_168.x = 7.00649e-45; Entity_NPC::PlaySound(npc,0xf5,1.0,2,0,1.0); if (isShoot2 == 0) { projParams.HeightModifier = -40.0; projParams.FallingSpeedModifier = 5.5; } else { local_168.x = 5.60519e-45; } fVar11 = sqrtf(VStack_158.x * VStack_158.x + local_160.x * local_160.x); if (fVar11 <= 300.0) { fVar11 = 8.2; } else { fVar11 = 10.0; } VStack_158.x = fVar11 * 0.85; pVVar4 = Vector::Normalized(&local_148,&scratchVec); VStack_158.y = VStack_158.x * pVVar4->y; VStack_158.x = VStack_158.x * pVVar4->x; Entity_NPC::FireProjectiles(npc,&npc->_pos,&VStack_158,(uint)local_168.x,&projParams); return extraout_EAX_00; case (Entity_NPC *)0x5: bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { local_168.x = pVVar4->x + 0.0; local_168.y = (npc->_pos).y - 60.0; laser = Entity_Laser::ShootAngle(1,&local_168,90.0,0x10,&g_vectorZero,(Entity *)npc,0); laser->_renderDepthOffset = 3000.0; laser->_scale = 1.2; Entity_Laser::ResetSpriteScale(laser); (**(code **)(*(int *)laser + 0xc))(); (npc->_pos).x = (npc->_pos).x - 5.0; } bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); pEVar7 = (Entity_NPC *)(uint)bVar1; if (bVar1 != 0) { bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot2"); pEVar7 = (Entity_NPC *)(uint)bVar1; if ((bVar1 == 0) && (0 < (int)local_148.x)) { fVar11 = (npc->_pos).x; pEVar7 = (Entity_NPC *)((int)npc->_updateTime & 0x80000001); if ((int)pEVar7 < 0) { pEVar7 = (Entity_NPC *) (((uint)((int)&pEVar7[-1]._pickupGhostsEntity + 3U) | 0xfffffffe) + 1); } if (pEVar7 == (Entity_NPC *)0x1) { fVar11 = fVar11 + 10.0; } else { fVar11 = fVar11 - 10.0; } LAB_00480ab0: (npc->_pos).x = fVar11; } } break; case (Entity_NPC *)0x6: bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 == 0) { LAB_00480a54: bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); pEVar7 = (Entity_NPC *)(uint)bVar1; if (bVar1 != 0) { bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot2"); pEVar7 = (Entity_NPC *)(uint)bVar1; if ((bVar1 == 0) && (0 < (int)local_148.x)) { fVar11 = (npc->_pos).x; pEVar7 = (Entity_NPC *)((int)npc->_updateTime & 0x80000001); if ((int)pEVar7 < 0) { pEVar7 = (Entity_NPC *) (((uint)((int)&pEVar7[-1]._pickupGhostsEntity + 3U) | 0xfffffffe) + 1); } if (pEVar7 == (Entity_NPC *)0x1) { fVar11 = fVar11 + 5.0; } else { fVar11 = fVar11 - 5.0; } goto LAB_00480ab0; } } } else { fVar11 = (npc->_pos).x; local_160.x = 0.0; do { if (local_160.x == 0.0) { local_168.x = -40.0; fVar12 = 120.0; VStack_158.x = -1.5; fVar9 = -100.0; } else { fVar9 = 100.0; fVar12 = 60.0; local_168.x = 40.0; VStack_158.x = 1.5; } local_150.y = (npc->_pos).y + -60.0; local_150.x = fVar9 + fVar11; laser = Entity_Laser::ShootAngle(1,&local_150,fVar12,0xe,&g_vectorZero,(Entity *)npc,0); laser->_rotationDegrees = local_168.x; laser->_renderDepthOffset = 3000.0; laser->_isActiveRotating = 1; laser->_rotationDelay = 0; laser->_rotationSpd = VStack_158.x; (**(code **)(*(int *)laser + 0xc))(); fVar11 = pVVar4->x - 2.5; pEVar7 = (Entity_NPC *)((int)local_160.x + 1); pVVar4->x = fVar11; local_160.x = (float)pEVar7; } while ((int)pEVar7 < 2); } break; case (Entity_NPC *)0x7: bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 == 0) goto LAB_00480a54; Entity_NPC::PlaySound(npc,0xf5,1.0,2,0,1.0); VStack_158.x = 0.0; do { pVVar4 = &local_150; if (VStack_158.x == 0.0) { local_168.x = -100.0; local_150.x = (float)&DAT_bf800000; local_150.y = 0.0; } else { local_168.x = 100.0; local_160.x = 1.0; local_160.y = 0.0; pVVar4 = &local_160; } ProjectileParams::ProjectileParams(&projParams); projParams.FireDirectionLimit.x = pVVar4->x; projParams.FireDirectionLimit.y = pVVar4->y; scratchVec.x = local_168.x + (npc->_pos).x; projParams.Scale = 1.4; projParams.HeightModifier = -40.0; scratchVec.y = (npc->_pos).y + 0.0; projParams.FallingSpeedModifier = 2.5; projParams.DotProductLimit = -0.38; local_148.x = 7.5; local_148.y = 14.0; Entity_NPC::FireProjectiles(npc,&scratchVec,&local_148,9,&projParams); pEVar7 = (Entity_NPC *)((int)VStack_158.x + 1); (npc->_pos).x = (npc->_pos).x - 2.5; VStack_158.x = (float)pEVar7; } while ((int)pEVar7 < 2); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; return pEVar7; } break; case 3: npc->_stateFrame = npc->_stateFrame + 1; npc->_entityCollisionClass = 0; npc->_isInvicible = 1; Entity_NPC::update_blood_guide_gibs(npc,(float *)0x0); if ((npc->_sprite)._animState._animData == (void *)0x0) { local_160.x = (float)&(npc->_sprite)._animState; } else { local_160.x = (float)&(npc->_sprite)._animState; bVar1 = AnimationState::IsEventTriggered((AnimationState *)local_160.x,(byte *)"Sound"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0xf1,1.0,2,0,1.0); local_160.x = (float)&(npc->_sprite)._animState; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { CStack_10c._offset[0] = 0.0; CStack_10c._colorize[0] = 0.0; CStack_10c._colorize[1] = 0.0; CStack_10c._colorize[2] = 0.0; CStack_10c._colorize[3] = 0.0; CStack_10c._offset[1] = 0.0; CStack_10c._offset[2] = 0.0; CStack_10c._tint[0] = 0.52; CStack_10c._tint[1] = 0.52; CStack_10c._tint[2] = 0.52; CStack_10c._tint[3] = 0.8; Entity::MakeGroundPoof((Entity *)npc,pVVar4,&CStack_10c,local_150.x); Game::ShakeScreen(g_game,0xc); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered((AnimationState *)local_160.x,(byte *)"Shoot2"); pEVar7 = (Entity_NPC *)(uint)bVar1; if (bVar1 != 0) { VStack_158.x = 0.0; do { fVar11 = VStack_158.x; uVar6 = Random(); fVar9 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168.x = fVar9 + fVar9; local_160.x = *(float *)((int)&DAT_00c5c5cc + (int)fVar11); local_150.x = *(float *)((int)&DAT_00c5c5d0 + (int)fVar11); uVar6 = Random(); fVar11 = cos(local_168.x); scratchVec.x = fVar11 * 10.0 + local_160.x + (npc->_pos).x; fVar11 = sin(local_168.x); scratchVec.y = fVar11 * 10.0 + local_150.x + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,1000,0x10,&scratchVec,&g_vectorZero,(Entity *)npc,2, uVar6,0); CStack_10c._offset[0] = 0.0; CStack_10c._offset[1] = 0.0; CStack_10c._colorize[0] = 0.0; CStack_10c._colorize[1] = 0.0; CStack_10c._colorize[2] = 0.0; CStack_10c._colorize[3] = 0.0; CStack_10c._offset[2] = 0.0; CStack_10c._tint[0] = 1.0; CStack_10c._tint[1] = 0.05; CStack_10c._tint[2] = 0.05; CStack_10c._tint[3] = 0.8; (**(code **)(*(int *)tmpEntity + 0x3c))(); uVar6 = Random(); (tmpEntity->_sprite)._flipX = ~(byte)uVar6 & 1; pEVar7 = (Entity_NPC *)(**(code **)(*(int *)tmpEntity + 0xc))(); VStack_158.x = (float)((int)VStack_158.x + 8); } while ((uint)VStack_158.x < 0x18); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return pEVar7; } } } uVar6 = Random(); Game::SpawnEx(g_game,npc->_type,npc->_variant + 10,&g_vectorZero,&g_vectorZero,(Entity *)npc,0, uVar6,0); piVar5 = (int *)__RTDynamicCast(); uVar6 = Random(); Game::SpawnEx(g_game,npc->_type,npc->_variant + 10,&g_vectorZero,&g_vectorZero,(Entity *)npc,0, uVar6,0); local_160.x = (float)__RTDynamicCast(); VStack_158.x = (float)((int)local_160.x + 0x3bc); if (*(int *)((int)local_160.x + 0x3bc) != 0) { local_168.x = VStack_158.x; std::multiset::erase(&local_168); } *(int **)VStack_158.x = piVar5; if (piVar5 != (int *)0x0) { std::multiset::insert(VStack_158.x); } if (piVar5[0xf0] != 0) { local_168.x = (float)(piVar5 + 0xf0); std::multiset::erase(&local_168); } piVar5[0xf0] = (int)local_160.x; std::multiset::insert(piVar5 + 0xf0); *(int *)((int)local_160.x + 0xb64) = 0; piVar5[0x2d9] = 0; (**(code **)(*piVar5 + 0xc))(); (**(code **)(*(int *)local_160.x + 0xc))(); pEVar7 = (Entity_NPC *)(**(code **)(*(int *)npc + 0x28))(); return pEVar7; case 4: pEVar7 = (Entity_NPC *)npc->_state; if (pEVar7 == (Entity_NPC *)0x3) { npc->_visible = 0; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 5; uVar6 = Random(); pEVar7 = (Entity_NPC *)(uVar6 / 9); if (uVar6 % 9 == 0) { if ((npc->_parent != (EntityPtr)0x0) && (npc->_stateFrame != 0)) { pEVar7 = Entity_NPC::ParentNPC(npc); if (pEVar7->_stateFrame < 0x15) break; } if (npc->_child != (EntityPtr)0x0) { pEVar7 = Entity_NPC::ChildNPC(npc); if (pEVar7->_stateFrame < 0x15) break; } npc->_state = 7; npc->_stateFrame = 0; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Stomp",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } pVVar4 = &npc->_pos; npc->_visible = 1; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar11 = (tmpEntity->_pos).y; pVVar4->x = (tmpEntity->_pos).x; (npc->_pos).y = fVar11; if (npc->_parent != (EntityPtr)0x0) { pEVar7 = Entity_NPC::ParentNPC(npc); VStack_158.x = pVVar4->x; local_160.x = (pEVar7->_pos).y - (npc->_pos).y; local_168.x = (pEVar7->_pos).x - VStack_158.x; fVar11 = sqrtf(local_160.x * local_160.x + local_168.x * local_168.x); if ((fVar11 < 111.0) && (0.0 < fVar11)) { fVar11 = (111.0 - fVar11) / fVar11; pVVar4->x = VStack_158.x - fVar11 * local_168.x; (npc->_pos).y = (npc->_pos).y - local_160.x * fVar11; } } if (npc->_child != (EntityPtr)0x0) { pEVar7 = Entity_NPC::ChildNPC(npc); VStack_158.x = pVVar4->x; local_160.x = (pEVar7->_pos).y - (npc->_pos).y; local_168.x = (pEVar7->_pos).x - VStack_158.x; fVar11 = sqrtf(local_160.x * local_160.x + local_168.x * local_168.x); if ((fVar11 < 111.0) && (0.0 < fVar11)) { fVar11 = (111.0 - fVar11) / fVar11; pVVar4->x = VStack_158.x - fVar11 * local_168.x; (npc->_pos).y = (npc->_pos).y - local_160.x * fVar11; } } aliveEnemyCount = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); pEVar7 = (Entity_NPC *)0x0; if (0 < aliveEnemyCount) { pEVar7 = (Entity_NPC *)aliveEnemyCount; } if ((int)pEVar7 < 4) { pEVar7 = (Entity_NPC *)Random(); if (((uint)pEVar7 & 1) == 0) { this_00 = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; Room::FindFreePickupSpawnPosition(this_00,&local_168,&scratchVec,200.0,1,0,0); uVar6 = Random(); pEVar7 = (Entity_NPC *) Game::SpawnEx(g_game,0x37,1,&local_168,&g_vectorZero,(Entity *)npc,0,uVar6,0); return pEVar7; } } } } else { if (pEVar7 == (Entity_NPC *)&DAT_00000007) { npc->_stateFrame = npc->_stateFrame + 1; bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Stomp"); if ((bVar1 == 0) || (bVar1 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b1e554), bVar1 != 0)) { iVar8 = 0; } else { iVar8 = 4; } npc->_entityCollisionClass = iVar8; bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Stomp"); pEVar7 = (Entity_NPC *)(uint)bVar1; if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); Game::BombDamage(g_game,pVVar4,300.0,70.0,0,(Entity *)npc,g_tearFlagsNone,0x1000000,0); ShockwaveParams::ShockwaveParams(&EStack_134); EStack_134._type = (int)pVVar4->x; EStack_134._variant = (int)(npc->_pos).y; this_01 = g_game->_room; EStack_134._velocity.x = 1.82169e-44; EStack_134._position.x = 0.025; EStack_134._spawnerVariant = 0x3d23d70a; shockwaveCounter = &this_01->_roomList[0x9d].Data; *shockwaveCounter = (void *)((int)*shockwaveCounter + 1); uVar6 = (uint)this_01->_roomList[0x9d].Data & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(this_01,uVar6,&EStack_134); color = (ColorMod *)Color::Color(0x3f4ccccd); pEVar7 = (Entity_NPC *)Entity::MakeGroundPoofAtSelf((Entity *)npc,color,local_150.x); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_visible = 0; npc->_state = 3; } } if (npc->_parent != (EntityPtr)0x0) { pEVar7 = Entity_NPC::ParentNPC(npc); parentHealth = &pEVar7->_health; pfVar3 = &npc->_health; if (*parentHealth <= npc->_health && npc->_health != *parentHealth) { pfVar3 = parentHealth; } local_168.x = *pfVar3; pEVar7 = Entity_NPC::ParentNPC(npc); pEVar7->_health = local_168.x; npc->_health = local_168.x; } if (npc->_dead != 0) { if (npc->_child != (EntityPtr)0x0) { sourceRef = EntityRef::EntityRef(&EStack_134); (*extraout_EDX)(sourceRef); } if (npc->_parent != (EntityPtr)0x0) { sourceRef = EntityRef::EntityRef((EntityRef *)&CStack_10c); (*extraout_EDX_00)(sourceRef); } entityIdx = 0; local_168.x = (float)g_game->_room; pEVar7 = (Entity_NPC *)local_168.x; if (((Entity_NPC *)((int)local_168.x + 0xf54))->_iceFrozenEffect != (EntityPtr)0x0) { do { piVar5 = *(int **)((int)(((Entity_NPC *)((int)local_168.x + 0xf54))->_knockbackDirection ).x + entityIdx * 4); cVar2 = (**(code **)(*piVar5 + 0x48))(); if (cVar2 != '\0') { EntityRef::EntityRef((EntityRef *)&CStack_10c); (**(code **)(*piVar5 + 0x20))(); } entityIdx = entityIdx + 1; pEVar7 = (Entity_NPC *)local_168.x; } while ((uint)entityIdx < (uint)((Entity_NPC *)((int)local_168.x + 0xf54))->_iceFrozenEffect); } } } } LAB_004813c2: return pEVar7; } //@@ 00481410 NpcAI::ENTITY_THE_HAUNT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 260 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_THE_HAUNT(Entity_NPC *npc) { undefined4 uVar1; void *pvVar2; undefined4 uVar3; undefined4 uVar4; byte bVar5; uint uVar6; Entity *tmpEntity; int *piVar7; LayerState *layer; int iVar8; uint frameMod4; ColorMod *effectColor; byte *curAnimNameChar; Vector *tmpVec; ProjectileParams *projParams; int iVar9; int striderCount; Entity_Laser *laser; Entity_Effect *bloodEffect; Entity_NPC *pEVar10; undefined4 extraout_EAX; EntityRef *entityRefPtr; char *targetAnimNameChar; int unused; int unused_00; byte *pbVar11; Vector *position; bool bVar12; float fVar13; undefined1 *spreadSign; float fVar14; float fVar15; EntityRef entityRef; Vector randomDir; Vector spiderLandPos; undefined4 local_1b0 [11]; char lilHauntList [4]; void *lilHauntListData; Vector local_17c; Vector local_174; Entity_NPC *local_16c; int *local_168; Vector scratchVec2; float local_15c; Vector scratchVec; ProjectileParams projectileParams; Color local_a8 [2]; float local_50; float fStack_4c; float fStack_48; undefined4 uStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; undefined8 local_30; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; qword entityFlags; Game *game; Manager *manager; EntityPtr parent; Room *room; pvVar2 = ExceptionList; puStack_20 = (undefined1 *)local_a8[3]._offset; local_14 = -NAN; puStack_18 = &LAB_00af2bf0; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_a8[3]._colorize + 1); ExceptionList = &local_1c; iVar8 = npc->_variant; local_24 = uVar6; if (npc->_state == 0) { npc->_stateFrame = 0; if (iVar8 == 0) { npc->_entityCollisionClass = 2; npc->_entityGridCollisionClass = 3; npc->_i1 = 3; if (npc->_subtype == 1) { npc->_i1 = 2; } else { iVar8 = npc->_i1; if (npc->_subtype == 2) { iVar8 = 1; } npc->_i1 = iVar8; } local_16c = (Entity_NPC *)0x0; puStack_20 = (undefined1 *)local_a8[3]._offset; do { uVar6 = Random(); local_168 = (int *)(((float)(int)local_16c / (float)npc->_i1) * 360.0 * 0.017453292); fVar13 = cos((float)local_168); scratchVec.x = fVar13 * 50.0 + (npc->_pos).x; fVar13 = sin((float)local_168); scratchVec.y = fVar13 * 50.0 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,npc->_type,10,&scratchVec,&g_vectorZero,(Entity *)npc,0, uVar6,0); piVar7 = (int *)__RTDynamicCast(tmpEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (piVar7[0xef] != 0) { local_168 = piVar7 + 0xef; std::multiset::erase(&local_168); } piVar7[0xef] = (int)npc; std::multiset::insert(piVar7 + 0xef); local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_50 = 1.0; fStack_4c = 1.0; fStack_48 = 1.0; uStack_44 = 0x3f000000; local_30 = 0; local_28 = 0.0; (**(code **)(*piVar7 + 0x3c))(&local_50,0xffffffff,0xff,0,1); piVar7[0x2f0] = (int)local_16c; local_16c = (Entity_NPC *)&local_16c->field_0x1; *(undefined1 *)(piVar7 + 0xec) = 1; } while ((int)local_16c < npc->_i1); pbVar11 = (byte *)0x0; (npc->_targetPosition).x = 0.3; (npc->_targetPosition).y = 0.0; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar11); pbVar11 = pbVar11 + 1; (layer->_color)._tint[3] = 0.5; } while (pbVar11 < (byte *)(npc->_sprite)._layerCount); } uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; iVar8 = 4; npc->_isInvicible = 1; } else { uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x80000000; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; iVar8 = 3; npc->_entityGridCollisionClass = 0; npc->_entityCollisionClass = 1; } npc->_state = iVar8; if (&npc->_splatColor == (ColorMod *)local_1b0) { ExceptionList = local_1c; return; } (npc->_splatColor)._offset[0] = 0.8; (npc->_splatColor)._offset[1] = 0.8; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.3; (npc->_splatColor)._offset[2] = 0.8; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; ExceptionList = local_1c; return; } npc->_isInvicible = 0; game = g_game; local_16c = npc; if (iVar8 != 0) { if (iVar8 != 10) { ExceptionList = pvVar2; return; } Entity_NPC::UpdateChargeBar(npc,0.0,60.0,(float)npc->_stateFrame,1); iVar8 = npc->_state; if (iVar8 != 4) { if (iVar8 == 8) { Entity_NPC::UpdateControllerMovement(npc,0); ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar5 != 0) { uVar6 = Random(); Entity_NPC::PlaySound (npc,0x13e,1.0,2,0, (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 1.2); scratchVec.x = 0.0; scratchVec.y = -12.0; bloodEffect = (Entity_Effect *) spawn_blood_explosion (1,&npc->_pos,&scratchVec,&npc->_splatColor,&g_vectorZero); bloodEffect->_renderDepthOffset = 4.0; Entity_Effect::FollowParent(bloodEffect,(Entity *)npc); tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.y = (tmpEntity->_pos).x; scratchVec2.y = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = ((tmpEntity->_velocity).x * 5.0 + scratchVec.y) - (npc->_pos).x; scratchVec.y = ((tmpEntity->_velocity).y * 5.0 + scratchVec2.y) - (npc->_pos).y; if (npc->_controllerID != -1) { scratchVec.x = (npc->_controllerMovement).x; scratchVec.y = (npc->_controllerMovement).y; } projParams = ProjectileParams::ProjectileParams(&projectileParams); tmpVec = Vector::Normalized(&scratchVec,&local_17c); scratchVec2.y = tmpVec->y * 10.0; scratchVec2.x = tmpVec->x * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec2,0,projParams); npc->_state = 4; } npc->_stateFrame = 0; npc->_friction = npc->_friction * 0.5; } else if (iVar8 == 3) { ANM2::Play(&npc->_sprite,(byte *)"Float",0); local_168 = (int *)0x0; fVar13 = 0.0; if (npc->_parent != (EntityPtr)0x0) { pEVar10 = Entity_NPC::ParentNPC(npc); piVar7 = (int *)pEVar10->_i1; local_168 = piVar7; pEVar10 = Entity_NPC::ParentNPC(npc); local_174.y = (float)pEVar10->_subtype; if (local_174.y == 0.0) { iVar8 = g_game->_frameCount - npc->_spawnFrame; if (iVar8 < 0x5b) { fVar13 = 3.0; } else if (iVar8 < 0x96) { fVar13 = 3.0 - (float)(iVar8 + -0x5a) / 60.0; } else { fVar13 = 2.0; } } else { fVar13 = (float)(int)piVar7; } parent = npc->_parent; if (*(char *)g_game->_room == '\0') { iVar8 = -1; } else { iVar8 = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0); } scratchVec.y = ((((float)npc->_i1 / fVar13) * 360.0 + (float)iVar8 + (float)iVar8) - 40.0) * 0.017453292; fVar13 = cos(scratchVec.y); scratchVec2.y = fVar13 * 50.0 + *(float *)((int)parent + 0x33c); fVar14 = sin(scratchVec.y); fVar13 = *(float *)((int)parent + 0x340); (npc->_pos).x = scratchVec2.y; (npc->_pos).y = fVar14 * 50.0 + fVar13; fVar13 = local_174.y; } npc->_friction = npc->_friction * 0.5; if (0.0 < npc->_pendingDamage) { local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_50 = 1.0; fStack_4c = 1.0; fStack_48 = 1.0; uStack_44 = 0x3e4ccccd; local_30 = 0; local_28 = 0.0; (**(code **)(*(int *)npc + 0x3c))(&local_50,10,1,0,1); (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; } if ((((npc->_i1 == 0) || (fVar13 != 0.0)) && (0x5a < g_game->_frameCount - npc->_spawnFrame) ) || ((((int)local_168 < 3 && (fVar13 == 0.0)) || (npc->_controllerID != -1)))) { npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)"FloatChase",0); Color::Color(local_a8); (**(code **)(*(int *)npc + 0x3c))(extraout_EAX,0xffffffff,0xff,0,1); npc->_entityCollisionClass = 4; Entity_NPC::PlaySound(npc,0x3e6,1.0,2,0,1.0); } } goto LAB_00482f74; } tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_17c,0.0); local_168 = (int *)(tmpVec->x - (npc->_pos).x); local_15c = tmpVec->y - (npc->_pos).y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"FloatChase",0); } scratchVec2.y = local_15c * local_15c + (float)local_168 * (float)local_168; scratchVec.y = sqrtf(scratchVec2.y); if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = scratchVec.y * (tmpEntity->_velocity).x * 0.5 + (float)local_168; scratchVec.y = scratchVec.y * (tmpEntity->_velocity).y * 0.5 + local_15c; tmpVec = Vector::Normalized(&scratchVec,&local_17c); } else { tmpVec = Entity_NPC::GetControllerInput(npc,&local_17c,0.0); } fVar13 = npc->_friction; fVar14 = tmpVec->x; if (fVar13 != 0.0) { fVar15 = npc->_speedMultiplier; (npc->_velocity).y = (tmpVec->y * 0.5 * fVar15) / fVar13 + (npc->_velocity).y; (npc->_velocity).x = (fVar14 * 0.5 * fVar15) / fVar13 + (npc->_velocity).x; } (npc->_sprite)._flipX = 0.0 < (npc->_velocity).x; npc->_friction = npc->_friction * 0.95; if (npc->_controllerID == -1) { if (((0x5a < npc->_stateFrame) && (scratchVec2.y < 40000.0)) && (uVar6 = Random(), uVar6 % 0x32 == 0)) goto LAB_00482a9e; } else if ((0x3c < npc->_stateFrame) && (bVar5 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar5 != 0)) { LAB_00482a9e: Entity_NPC::UpdateControllerMovement(npc,1); npc->_state = 8; } npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); LAB_00482f74: if (npc->_state != 3) { Room::GetClampedPositionImpl(g_game->_room,&local_174,&npc->_pos,0.0,0.0,0.0,0.0); scratchVec.x = local_174.x - (npc->_pos).x; scratchVec.y = local_174.y - (npc->_pos).y; if ((scratchVec.x != g_vectorZero.x) || (scratchVec.y != g_vectorZero.y)) { Vector::Normalize(&scratchVec); fVar13 = (npc->_velocity).x; fVar14 = npc->_speedMultiplier; fVar15 = -(scratchVec.y * (npc->_velocity).y + fVar13 * scratchVec.x); if (fVar15 <= 0.02) { fVar15 = 0.02; } if (1.0 <= fVar15) { fVar15 = 1.0; } (npc->_velocity).y = fVar15 * scratchVec.y * fVar14 + (npc->_velocity).y; (npc->_velocity).x = fVar15 * scratchVec.x * fVar14 + fVar13; } } if (npc->_parent == (EntityPtr)0x0) { ExceptionList = local_1c; return; } if (*(char *)((int)npc->_parent + 0x173) == '\0') { ExceptionList = local_1c; return; } entityRefPtr = EntityRef::EntityRef(&entityRef); (**(code **)(*(int *)npc + 0x24))(entityRefPtr); ExceptionList = local_1c; return; } puStack_20 = (undefined1 *)local_a8[3]._offset; if ((0 < npc->_i1) && (puStack_20 = (undefined1 *)local_a8[3]._offset, (npc->_flags & 0x4000) == 0)) { puStack_20 = (undefined1 *)local_a8[3]._offset; bVar5 = Game::IsPaused(g_game); if (bVar5 == 0) { frameMod4 = game->_frameCount & 0x80000003; bVar12 = frameMod4 == 0; if ((int)frameMod4 < 0) { bVar12 = (frameMod4 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar12) { npc->_i1 = 0; Entity_NPC::QueryNPCsType(lilHauntList,0x104,10); fVar13 = 0.0; if (local_17c.y != 0.0) { do { if (*(Entity_NPC **)(*(int *)((int)lilHauntListData + (int)fVar13 * 4) + 0x3bc) == npc) { npc->_i1 = npc->_i1 + 1; } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)local_17c.y); } if (lilHauntList[0] == '\0') { local_14 = 0.0; tracked_alloc(1,lilHauntListData,0); local_14 = -NAN; } } } } iVar8 = npc->_state; if (((iVar8 == 4) || (iVar8 == 0x10)) && (0.0 < npc->_pendingDamage)) { if ((iVar8 == 4) && (0 < npc->_i1)) { local_50 = (npc->_sprite)._color._tint[0]; fStack_4c = (npc->_sprite)._color._tint[1]; fStack_48 = (npc->_sprite)._color._tint[2]; local_28 = (npc->_sprite)._color._offset[2]; local_40 = (npc->_sprite)._color._colorize[0]; fStack_3c = (npc->_sprite)._color._colorize[1]; fStack_38 = (npc->_sprite)._color._colorize[2]; fStack_34 = (npc->_sprite)._color._colorize[3]; local_30 = *(undefined8 *)(npc->_sprite)._color._offset; uStack_44 = 0x3e4ccccd; (**(code **)(*(int *)npc + 0x3c))(&local_50,10,1,0,1,uVar6); } (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; } iVar8 = npc->_state; local_168 = (int *)0x3f800000; if (iVar8 == 4) { if (npc->_i1 < 1) { uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffef; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; ANM2::Play(&npc->_sprite,(byte *)"AngrySkin",0); Entity_NPC::PlaySound(npc,300,1.0,600,0,1.0); pvVar2 = (npc->_sprite)._animState._animData; if (pvVar2 == (void *)0x0) { iVar8 = 0; } else { iVar8 = *(int *)((int)pvVar2 + 0x30); } pbVar11 = (byte *)0x0; local_174.y = (npc->_sprite)._animState._animFrame / (float)iVar8; local_15c = local_174.y * 0.5 + 0.5; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar11); pbVar11 = pbVar11 + 1; (layer->_color)._tint[3] = local_15c; } while (pbVar11 < (byte *)(npc->_sprite)._layerCount); } game = g_game; fVar13 = (npc->_pos).y; entityFlags = npc->_flags; (npc->_pos).y = ((*(float *)((int)g_game->_room + 0x18) + 20.0) - fVar13) * local_174.y + fVar13; if ((((entityFlags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)game->_room + 4) + 0x44) & 1) == 0)) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { ANM2::Play(&npc->_sprite,&DAT_00b1e588,0); Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); game = g_game; npc->_state = 0x10; (game->_hud).field_0x549c = 1; } npc->_friction = npc->_friction * 0.5; } else { ANM2::Play(&npc->_sprite,(byte *)"IdleSkin",0); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); npc->_friction = npc->_friction * 0.9; uVar6 = Random(); if ((uVar6 % 100 == 0) && (bVar5 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x3e6), bVar5 == 0)) { Entity_NPC::PlaySound(npc,0x3e5,1.0,100,0,1.0); } } } else if (iVar8 == 0x10) { pbVar11 = (byte *)0x0; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar11); pbVar11 = pbVar11 + 1; (layer->_color)._tint[3] = 1.0; } while (pbVar11 < (byte *)(npc->_sprite)._layerCount); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; npc->_entityCollisionClass = 2; } } else if (iVar8 == 3) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"IdleNoSkin",0); } tmpVec = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_174.y = tmpVec->x - (npc->_pos).x; if ((ABS(tmpVec->y - (npc->_pos).y) < 40.0) && (uVar6 = Random(), uVar6 % 0x28 == 0)) { fVar13 = ABS((npc->_targetPosition).x); fVar14 = ABS((npc->_velocity).x); if (0.0 <= local_174.y) { (npc->_targetPosition).x = fVar13; (npc->_velocity).x = fVar14; uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 10.0 + (npc->_velocity).x; } else { (npc->_targetPosition).x = -fVar13; (npc->_velocity).x = -fVar14; uVar6 = Random(); fVar13 = (npc->_velocity).x - ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 10.0); } (npc->_velocity).x = fVar13; bVar5 = ANM2::IsPlaying(&npc->_sprite,(byte *)"AngryNoSkin"); if (bVar5 == 0) { ANM2::Play(&npc->_sprite,(byte *)"AngryNoSkin",0); Entity_NPC::PlaySound(npc,0x3e3,1.0,2,0,1.0); } } bVar5 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((((bVar5 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (iVar8 = npc->_stateFrame, npc->_stateFrame = iVar8 + 1, 0x3c < iVar8)) && (uVar6 = Random(), uVar6 % 0x3c == 0)) { uVar6 = Random(); if ((uVar6 & 1) == 0) { npc->_state = 8; (npc->_v2).x = 0.0; } else { npc->_state = 9; if (npc->_subtype != 1) { if (npc->_subtype == 2) { effectColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = cos(2.3561945); scratchVec.y = sin(2.3561945); scratchVec2.x = 0.0; scratchVec2.y = -46.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&scratchVec2,&scratchVec,0x12,effectColor,4.0); effectColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = cos(0.7853982); scratchVec.y = sin(0.7853982); scratchVec2.y = -46.0; } else { effectColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = cos(1.5707964); scratchVec.y = sin(1.5707964); scratchVec2.y = -28.0; } scratchVec2.x = 0.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&scratchVec2,&scratchVec,0x12,effectColor,4.0); } } } } iVar8 = npc->_state; if (iVar8 == 8) { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 == (byte *)0x0) { LAB_00481ef3: bVar5 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SpitNoSkin",1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimNameChar = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { curAnimNameChar = *(byte **)pbVar11; } targetAnimNameChar = "SpitNoSkin"; do { bVar5 = *curAnimNameChar; bVar12 = bVar5 < (byte)*targetAnimNameChar; if (bVar5 != *targetAnimNameChar) { LAB_00481ed5: uVar6 = -(uint)bVar12 | 1; goto LAB_00481eda; } if (bVar5 == 0) break; bVar5 = curAnimNameChar[1]; bVar12 = bVar5 < (byte)targetAnimNameChar[1]; if (bVar5 != targetAnimNameChar[1]) goto LAB_00481ed5; curAnimNameChar = curAnimNameChar + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00481eda: if ((uVar6 != 0) || ((pbVar11[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00481ef3; } pvVar2 = (npc->_sprite)._animState._animData; if (npc->_subtype == 2) { if ((((pvVar2 != (void *)0x0) && (bVar5 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar5 != 0)) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar5 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d6f4), bVar5 == 0)))) && (bVar5 = Entity::IsFrame((Entity *)npc,2,0), bVar5 != 0)) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.FallingAccelModifier = -0.1; bVar5 = Entity::IsFrame((Entity *)npc,4,0); if (bVar5 == 0) { spreadSign = &DAT_bf800000; } else { spreadSign = (undefined1 *)0x3f800000; } local_15c = (npc->_v2).x * 0.5 * (float)spreadSign + 0.5; tmpVec = Entity_NPC::CalcTargetPosition(npc,&scratchVec2,0.0); scratchVec.x = tmpVec->x - (npc->_pos).x; scratchVec.y = tmpVec->y - (npc->_pos).y; Vector::Resized(&scratchVec,&scratchVec2,10.0); local_15c = (local_15c * 120.0 - 60.0) * 0.017453292; local_174.y = cos(local_15c); fVar13 = sin(local_15c); scratchVec.x = local_174.y * scratchVec2.x - scratchVec2.y * fVar13; scratchVec.y = fVar13 * scratchVec2.x + scratchVec2.y * local_174.y; scratchVec2.x = (npc->_pos).x + (npc->_velocity).x; scratchVec2.y = (npc->_pos).y + (npc->_velocity).y; Entity_NPC::FireProjectiles(npc,&scratchVec2,&scratchVec,0,&projectileParams); Entity_NPC::PlaySound(npc,0x132,1.0,2,0,1.0); (npc->_v2).x = (npc->_v2).x + 0.125; } } else if ((pvVar2 != (void *)0x0) && (bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar5 != 0)) { projParams = ProjectileParams::ProjectileParams(&projectileParams); scratchVec2.x = (npc->_velocity).x + (npc->_pos).x; scratchVec.x = 0.0; scratchVec2.y = (npc->_velocity).y + (npc->_pos).y; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,&scratchVec2,&scratchVec,5,projParams); Entity_NPC::PlaySound(npc,0x132,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { iVar8 = npc->_state; goto LAB_004821f1; } LAB_004827f0: npc->_state = 3; npc->_stateFrame = 0; } else { LAB_004821f1: if (iVar8 == 9) { pbVar11 = (npc->_sprite)._animState._animData; if (pbVar11 == (byte *)0x0) { LAB_0048224e: bVar5 = ANM2::SetAnimation(&npc->_sprite,(byte *)"LaserNoSkin",1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimNameChar = pbVar11; if (0xf < *(uint *)(pbVar11 + 0x14)) { curAnimNameChar = *(byte **)pbVar11; } targetAnimNameChar = "LaserNoSkin"; do { bVar5 = *curAnimNameChar; bVar12 = bVar5 < (byte)*targetAnimNameChar; if (bVar5 != *targetAnimNameChar) { LAB_00482230: uVar6 = -(uint)bVar12 | 1; goto LAB_00482235; } if (bVar5 == 0) break; bVar5 = curAnimNameChar[1]; bVar12 = bVar5 < (byte)targetAnimNameChar[1]; if (bVar5 != targetAnimNameChar[1]) goto LAB_00482230; curAnimNameChar = curAnimNameChar + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00482235: if ((uVar6 != 0) || ((pbVar11[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048224e; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004827f0; bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar5 != 0) { if (npc->_subtype == 1) { uVar6 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; local_15c = 2.8026e-45; if (uVar6 == 0) { LAB_00482300: room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); position = &npc->_pos; scratchVec.x = ((tmpEntity->_pos).x - position->x) * 0.5 + position->x; scratchVec.y = ((tmpEntity->_pos).y - (npc->_pos).y) * 0.5 + (npc->_pos).y; tmpVec = Room::FindFreePickupSpawnPosition(room,&spiderLandPos,&scratchVec,0.0,0,0,0); npc = local_16c; Entity_NPC::ThrowSpider(position,(Entity *)local_16c,*tmpVec,0,-50.0); } else { iVar8 = Entity::CountRelatedEntities((Entity *)npc,0x5e,0,uVar6,(void *)0x0); iVar9 = Entity::CountRelatedEntities((Entity *)npc,0x55,0,unused,(void *)0x0); striderCount = Entity::CountRelatedEntities((Entity *)npc,0x32e,0,unused_00,(void *)0x0) ; fVar13 = (float)(((3 - iVar8) - iVar9) - striderCount); if ((2 < (int)fVar13) || (local_15c = fVar13, 0 < (int)fVar13)) goto LAB_00482300; } if (1 < (int)local_15c) { uVar6 = Random(); pEVar10 = local_16c; if ((uVar6 & 1) == 0) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(local_16c); local_15c = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; local_174.y = (pEVar10->_pos).x; scratchVec2.y = (pEVar10->_pos).y; tmpVec = MusicManager::RandomVector(&randomDir); uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 50.0; local_174.x = (local_15c - local_174.y) * 0.5 + local_174.y + fVar13 * tmpVec->x; local_174.y = (scratchVec.y - scratchVec2.y) * 0.5 + scratchVec2.y + fVar13 * tmpVec->y; Room::GetClampedPositionImpl(room,&scratchVec,&local_174,0.0,0.0,0.0,0.0); tmpVec = Room::FindFreePickupSpawnPosition(room,&local_17c,&scratchVec,0.0,0,0,0); npc = local_16c; Entity_NPC::ThrowSpider(&local_16c->_pos,(Entity *)local_16c,*tmpVec,0,-50.0); } } } else { scratchVec.x = 0.0; scratchVec.y = -50.0; if (npc->_subtype == 2) { local_15c = 135.0; iVar8 = 2; do { laser = Entity_Laser::ShootAngle (1,&npc->_pos,local_15c,10,&scratchVec,(Entity *)npc,0); iVar9 = *(int *)laser; laser->_renderDepthOffset = 3000.0; uVar4 = DAT_00c34b8c; uVar3 = DAT_00c34b88; uVar1 = DAT_00c34b84; *(undefined4 *)&(laser->_tearFlags)._l = DAT_00c34b80; *(undefined4 *)((int)&(laser->_tearFlags)._l + 4) = uVar1; *(undefined4 *)&(laser->_tearFlags)._h = uVar3; *(undefined4 *)((int)&(laser->_tearFlags)._h + 4) = uVar4; (**(code **)(iVar9 + 0xc))(); local_15c = local_15c - 90.0; iVar8 = iVar8 + -1; } while (iVar8 != 0); } else { laser = Entity_Laser::ShootAngle(1,&npc->_pos,90.0,10,&scratchVec,(Entity *)npc,0); laser->_renderDepthOffset = 3000.0; (**(code **)(*(int *)laser + 0xc))(); } } manager = g_manager; local_15c = 1.0; if (npc->_championColorIdx == 0x12) { local_15c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_15c = 0.5; } local_16c = (Entity_NPC *)0x131; seed_fart_sound_override((int *)&local_16c); SoundEffects::Play(&manager->_sfxManager,(int)local_16c,1.0,2,0,local_15c,0.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004827f0; iVar8 = npc->_state; } if (((iVar8 != 3) && (iVar8 != 8)) && (iVar8 != 9)) goto LAB_00482785; } bVar5 = npc->_collidesWithGrid; fVar13 = npc->_speedMultiplier; fVar14 = (npc->_targetPosition).y; (npc->_velocity).x = fVar13 * (npc->_targetPosition).x + (npc->_velocity).x; (npc->_velocity).y = fVar14 * fVar13 + (npc->_velocity).y; if ((bVar5 != 0) && (0.5 < ABS((npc->_gridCollisionNormal).x))) { fVar13 = -(npc->_targetPosition).x; fVar14 = -(npc->_targetPosition).y; (npc->_targetPosition).x = fVar13; (npc->_targetPosition).y = fVar14; (npc->_velocity).x = fVar13 * 15.0 + (npc->_velocity).x; (npc->_velocity).y = fVar14 * 15.0 + (npc->_velocity).y; } LAB_00482785: npc->_friction = npc->_friction * 0.96; if (npc->_state != 4) { (npc->_pos).y = *(float *)((int)g_game->_room + 0x18) + 30.0; } manager = g_manager; if (npc->_dead != 0) { if (npc->_championColorIdx == 0x12) { local_168 = (int *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_168 = (int *)0x3f000000; } local_15c = 1.39569e-42; seed_fart_sound_override((int *)&local_15c); SoundEffects::Play(&manager->_sfxManager,(int)local_15c,1.0,2,0,(float)local_168,0.0); } ExceptionList = local_1c; return; } //@@ 004830e0 NpcHelper::the_lamb_pattern /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: The Lamb bullet pattern (salvage fb_lambpat.c) prototype: db/protos.zhl, confirmed by RET 8 */ void NpcHelper::the_lamb_pattern(Entity_NPC *npc,int pattern,int frame) { Entity *target; uint uVar1; int projectileCount; bool isEighthFrame; float fVar2; float pitch; Vector local_c8; float dirY; float dirX; float projectileSpeed; ProjectileParams params; float local_8; Manager *manager; local_8 = (float)(__security_cookie ^ (uint)&(¶ms)[1].CircleAngle); ProjectileParams::ProjectileParams(¶ms); params.HeightModifier = 5.0; params.Scale = 1.8; params.FallingAccelModifier = -0.06; params.FallingSpeedModifier = -2.0; target = Entity_NPC::GetPlayerTarget(npc); dirX = (target->_pos).x - (npc->_pos).x; dirY = (target->_pos).y - (npc->_pos).y; fVar2 = sqrtf(dirX * dirX + dirY * dirY); pitch = 1.0; if (0.0 < fVar2) { dirY = (1.0 / fVar2) * dirY; dirX = (1.0 / fVar2) * dirX; } local_c8.y = atan2f(dirY,dirX); if (pattern < 4) { params.Color._colorize[0] = (float)0x3f333333; params.Color._colorize[1] = (float)0x3f333333; params.Color._colorize[2] = 1.0; params.Color._colorize[3] = 1.0; if (pattern == 0) { if (frame != (frame / 3) * 3) { return; } fVar2 = (float)frame * 0.125; } else { if (pattern != 1) { if (pattern == 2) { if (frame % 0x16 != 0) { return; } projectileCount = 3; projectileSpeed = 8.0; params.BulletFlags._0_4_ = (uint)params.BulletFlags | 0x10000; params.FallingSpeedModifier = 0.0; params.FallingAccelModifier = 0.0; } else { if (pattern != 3) { return; } if (frame % 0x16 != 0) { return; } projectileSpeed = 9.0; projectileCount = 10; } goto LAB_00483620; } if (frame != (frame / 3) * 3) { return; } fVar2 = (float)frame * -0.125; } projectileSpeed = 12.0; projectileCount = 5; params.CircleAngle = (fVar2 / 30.0) * 6.2831855; } else { params.BulletFlags._0_4_ = (uint)params.BulletFlags | 1; params.HomingStrength = 0.3; if (pattern == 4) { uVar1 = frame & 0x80000007; isEighthFrame = uVar1 == 0; if ((int)uVar1 < 0) { isEighthFrame = (uVar1 - 1 | 0xfffffff8) == 0xffffffff; } if (!isEighthFrame) { return; } projectileSpeed = 9.0; projectileCount = 7; params.FireDirectionLimit.x = dirX; params.FireDirectionLimit.y = dirY; params.DotProductLimit = 0.4; params.CircleAngle = 0.0; } else if (pattern == 5) { uVar1 = frame & 0x80000007; isEighthFrame = uVar1 == 0; if ((int)uVar1 < 0) { isEighthFrame = (uVar1 - 1 | 0xfffffff8) == 0xffffffff; } if (!isEighthFrame) { return; } projectileSpeed = 9.0; projectileCount = 7; params.FireDirectionLimit.x = dirX; params.FireDirectionLimit.y = dirY; params.DotProductLimit = 0.4; params.CircleAngle = local_c8.y; } else if (pattern == 6) { uVar1 = frame & 0x80000007; isEighthFrame = uVar1 == 0; if ((int)uVar1 < 0) { isEighthFrame = (uVar1 - 1 | 0xfffffff8) == 0xffffffff; } if (!isEighthFrame) { return; } projectileSpeed = 9.0; projectileCount = 7; params.FireDirectionLimit.x = dirX; params.FireDirectionLimit.y = dirY; params.DotProductLimit = 0.4; uVar1 = Random(); params.CircleAngle = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 3.1415927 * 0.1 + local_c8.y + 0.44879895; } else if (pattern == 7) { uVar1 = frame & 0x80000007; isEighthFrame = uVar1 == 0; if ((int)uVar1 < 0) { isEighthFrame = (uVar1 - 1 | 0xfffffff8) == 0xffffffff; } if (!isEighthFrame) { return; } projectileSpeed = 9.0; projectileCount = 7; params.FireDirectionLimit.y = dirY; params.DotProductLimit = 0.4; params.FireDirectionLimit.x = dirX; fVar2 = sin(((float)frame + (float)frame) / 30.0); params.CircleAngle = fVar2 * 0.44879895 + local_c8.y + 0.44879895; } else if (pattern == 8) { if (frame % 0xd != 0) { return; } projectileSpeed = 9.0; projectileCount = 8; params.FireDirectionLimit.x = dirX; params.FireDirectionLimit.y = dirY; params.DotProductLimit = 0.0; } else { if (pattern != 9) { return; } if (frame % 10 != 0) { return; } projectileCount = 3; projectileSpeed = 9.0; params.HomingStrength = 0.65; params.CircleAngle = (((float)frame * -0.125) / 30.0) * 6.2831855; } } LAB_00483620: uVar1 = Random(); manager = g_manager; if (npc->_championColorIdx == 0x12) { pitch = 1.5; } else if (npc->_championColorIdx == 0x13) { pitch = 0.5; } local_c8.y = 1.62551e-43; seed_fart_sound_override((int *)&local_c8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_c8.y,0.6,uVar1 % 0x1e + 0x14,0,pitch,0.0); local_c8.x = projectileSpeed; local_c8.y = (float)projectileCount; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_c8,9,¶ms); return; } //@@ 00483710 NpcAI::ENTITY_THE_LAMB /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 273 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_THE_LAMB(Entity_NPC *npc) { uint *puVar1; byte bVar2; uint uVar3; EntityList_EL *lambList; Entity *pEVar4; EntityPtr childEffect; byte *pbVar5; byte *pbVar6; Vector *tmpVec; char *pcVar7; std_string *currentAnim; Entity_Laser *laser; byte *pbVar8; void *pvVar9; float *extraout_ECX; int iVar10; uint uVar11; ANM2 *sprite; int iVar12; bool bVar13; float fVar14; float fVar15; float fVar16; EntityPtr *pEVar17; undefined4 uVar18; TypeDescriptor *pTVar19; TypeDescriptor *pTVar20; undefined4 uVar21; undefined4 local_2d4 [11]; undefined1 local_2a8; EntityPtr *local_2a4; Vector local_2a0; undefined1 local_294 [12]; EntityPtr *local_288; Vector local_284; Vector local_27c; Vector local_274; Vector local_26c; char isChargeDone; ProjectileParams burstParams; ProjectileParams aimedParams; ProjectileParams swarmParams; void *animName [5]; uint animNameCapacity; undefined4 effectColor; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; std_string sStack_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; Game *game; Room *room; puStack_20 = (undefined1 *)(animName + 0x19); puStack_18 = &LAB_00af2c30; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(animName + 0x16); ExceptionList = &local_1c; local_27c.y = 0.0; local_26c.y = 0.0; uVar11 = 0; local_2a8 = 0; local_2a4 = (EntityPtr *)0x0; local_2a0.x = 0.0; local_2a0.y = 0.0; local_14 = (void *)0x0; local_24 = uVar3; lambList = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_294,0x111 ,0,-1,0,0); local_2a8 = 1; local_2a0.x = (float)lambList->_capacity; local_2a4 = lambList->_data; local_2a0.y = (float)lambList->_size; local_284.y = (float)local_2a4; local_274.y = local_2a0.y; if (local_294[0] == '\0') { local_14._0_1_ = 1; tracked_alloc(1,(void *)local_294._4_4_,0); local_14 = (void *)((uint)local_14._1_3_ << 8); } if (local_274.y != 0.0) { local_26c.y = (float)__RTDynamicCast(*(undefined4 *)local_284.y,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0, uVar3); } lambList = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_294,0x111 ,10,-1,0,0); local_2a8 = 1; local_2a4 = lambList->_data; local_2a0.x = (float)lambList->_capacity; local_2a0.y = (float)lambList->_size; local_284.y = (float)local_2a4; local_274.y = local_2a0.y; if (local_294[0] == '\0') { local_14._0_1_ = 2; tracked_alloc(1,(void *)local_294._4_4_,0); local_14 = (void *)((uint)local_14._1_3_ << 8); } if (local_274.y != 0.0) { uVar11 = __RTDynamicCast(*(EntityPtr *)local_284.y,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); } local_274.y = (float)(uVar11 & 0xffffff00); local_14 = (void *)0xffffffff; if (uVar11 != 0) { local_274.y = (float)(uint)(5.0 < *(float *)(uVar11 + 0xbbc)); } if (((npc->_variant == 0) && (npc->_i1 == 1)) && (fVar14 = npc->_maxHitPoints * 0.5, npc->_health <= fVar14 && fVar14 != npc->_health)) { npc->_i1 = 2; npc->_state = 0x10; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Death",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } uVar3 = Random(); Game::Spawn(g_game,0x111,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); npc->_isInvicible = 1; Entity_NPC::PlaySound(npc,0x7a,1.0,0x3c,0,1.0); npc->_dead = 0; fVar14 = npc->_health; if (fVar14 <= 0.0) { fVar14 = 0.0; } npc->_health = fVar14; } iVar12 = npc->_state; if (iVar12 == 0) { if (npc->_variant == 10) { npc->_state = 0x10; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_sprite)._offset.x = -4.0; (npc->_sprite)._offset.y = 0.0; uVar3 = Random(); local_274.x = (npc->_pos).x + 4.0; uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; local_274.y = (npc->_pos).y + 2.0; pEVar4 = Game::Spawn(g_game,1000,10,&local_274,&g_vectorZero,(Entity *)npc,0,uVar3); childEffect = (EntityPtr)__RTDynamicCast(pEVar4,uVar18,pTVar19,pTVar20,uVar21); sStack_3c._buf[0xc] = '\0'; sStack_3c._buf[0xd] = '\0'; sStack_3c._buf[0xe] = '\0'; sStack_3c._buf[0xf] = '\0'; sStack_3c._size = 0; sStack_3c._capacity = 0x3f800000; local_40 = 0; sStack_3c._buf[0] = '\0'; sStack_3c._buf[1] = '\0'; sStack_3c._buf[2] = '\0'; sStack_3c._buf[3] = '\0'; sStack_3c._buf[4] = '\0'; sStack_3c._buf[5] = '\0'; sStack_3c._buf[6] = '\0'; sStack_3c._buf[7] = '\0'; sStack_3c._buf[8] = '\0'; sStack_3c._buf[9] = '\0'; sStack_3c._buf[10] = '\0'; sStack_3c._buf[0xb] = '\0'; effectColor = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f000000; (**(code **)(*(int *)childEffect + 0x3c))(&effectColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)childEffect + 0x40))(0); (**(code **)(*(int *)childEffect + 0xc))(); if (npc->_child != (EntityPtr)0x0) { local_26c.y = (float)&npc->_child; std::multiset::erase(&local_26c.y); } npc->_child = childEffect; std::multiset::insert(&npc->_child); pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } pbVar8 = &DAT_00b1d734; do { bVar2 = *pbVar5; bVar13 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00483b66: uVar3 = -(uint)bVar13 | 1; goto LAB_00483b6b; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar13 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00483b66; pbVar5 = pbVar5 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00483b6b: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00483bd9; } bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d734,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { npc->_state = 4; npc->_aiFloat = 2.0; uVar3 = Random(); npc->_i1 = 1; npc->_stateFrame = uVar3 % 0x1e + 0x3c; } LAB_00483bd9: (npc->_v2).x = npc->_health; if (&npc->_splatColor == (ColorMod *)local_2d4) { ExceptionList = local_1c; return; } (npc->_splatColor)._offset[0] = 0.1; (npc->_splatColor)._offset[1] = 0.1; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.15; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; ExceptionList = local_1c; return; } if (iVar12 == 4) { pbVar6 = (npc->_sprite)._animState._animData; if (npc->_i1 == 1) { if (pbVar6 == (byte *)0x0) { LAB_00483cb5: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else if ((npc->_sprite)._animState._isPlaying == 0) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pbVar5 = s_Idle; do { bVar2 = *pbVar6; bVar13 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_00483ca3: uVar3 = -(uint)bVar13 | 1; goto LAB_00483ca8; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_00483ca3; pbVar6 = pbVar6 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00483ca8: if ((uVar3 != 0) || (*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0')) goto LAB_00483cb5; } tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_26c,0.0); local_274.y = tmpVec->x - (npc->_pos).x; local_27c.y = tmpVec->y - (npc->_pos).y; fVar15 = sqrtf(local_274.y * local_274.y + local_27c.y * local_27c.y); pEVar17 = (EntityPtr *)local_27c.y; fVar14 = local_274.y; if (0.0 < fVar15) { fVar14 = local_274.y * (1.0 / fVar15); pEVar17 = (EntityPtr *)(local_27c.y * (1.0 / fVar15)); } fVar15 = npc->_aiFloat; (npc->_velocity).y = fVar15 * (float)pEVar17; (npc->_velocity).x = fVar15 * fVar14; iVar12 = npc->_stateFrame; npc->_stateFrame = iVar12 + -1; if (iVar12 < 1) { uVar3 = Random(); if (uVar3 % 100 < 0x32) { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Charge",0); } else { npc->_state = 10; npc->_stateFrame = 0; ANM2::Play(&npc->_sprite,(byte *)"Charge",0); } } goto LAB_004853d4; } if (pbVar6 == (byte *)0x0) { LAB_00483e3a: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"HeadIdle",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else if ((npc->_sprite)._animState._isPlaying == 0) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadIdle"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00483e28: uVar3 = -(uint)bVar13 | 1; goto LAB_00483e2d; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00483e28; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00483e2d: if ((uVar3 != 0) || (*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0')) goto LAB_00483e3a; } sprite = &npc->_sprite; tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_26c,0.0); local_288 = (EntityPtr *)(tmpVec->x - (npc->_pos).x); local_284.y = tmpVec->y - (npc->_pos).y; local_27c.y = (float)local_288; local_26c.y = local_284.y; fVar14 = sqrtf((float)local_288 * (float)local_288 + local_284.y * local_284.y); if (0.0 < fVar14) { local_288 = (EntityPtr *)(local_27c.y * (1.0 / fVar14)); local_26c.y = local_284.y * (1.0 / fVar14); } fVar14 = npc->_aiFloat; (npc->_velocity).y = fVar14 * local_26c.y; (npc->_velocity).x = fVar14 * (float)local_288; iVar12 = npc->_stateFrame; npc->_stateFrame = iVar12 + -1; if (0 < iVar12) goto LAB_004853d4; uVar3 = Random(); uVar3 = uVar3 % 99; if (uVar3 < 0x19) { npc->_state = 8; ANM2::Play(sprite,(byte *)"HeadCharge",0); goto LAB_004853d4; } if (uVar3 < 0x32) { npc->_state = 10; npc->_stateFrame = 0; ANM2::Play(sprite,(byte *)"HeadCharge",0); goto LAB_004853d4; } if (uVar3 < 0x4b) { npc->_state = 0xb; ANM2::Play(sprite,(byte *)"HeadCharge",0); goto LAB_004853d4; } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar2 != 0) goto LAB_004853d4; uVar3 = Random(); uVar3 = uVar3 % 6; if (uVar3 == 0) { local_288 = (EntityPtr *)0x40f00000; } else if (uVar3 == 1) { local_288 = (EntityPtr *)0x41200000; } else if (uVar3 == 2) { local_288 = (EntityPtr *)0x41400000; } else if (uVar3 < 3) { local_288 = (EntityPtr *)local_26c.y; } else { local_288 = (EntityPtr *)0x0; } fVar14 = ABS(local_27c.y); if ((fVar14 < 20.0) || ((SUB41(local_274.y,0) != '\0' && (fVar14 < ABS(local_284.y))))) { npc->_state = 9; if (0.0 <= local_284.y) { pcVar7 = "HeadDashDown"; } else { local_288 = (EntityPtr *)((uint)local_288 ^ 0x80000000); pcVar7 = "HeadDashUp"; } ANM2::Play(sprite,(byte *)pcVar7,0); (npc->_v1).x = 0.0; (npc->_v1).y = (float)local_288; LAB_0048411d: npc->_stateFrame = 0x1e; } else if ((ABS(local_284.y) < 20.0) || ((SUB41(local_274.y,0) != '\0' && (ABS(local_284.y) < fVar14)))) { npc->_state = 9; ANM2::Play(&npc->_sprite,(byte *)"HeadDashSide",0); pEVar17 = local_288; if (local_27c.y < 0.0) { pEVar17 = (EntityPtr *)((uint)local_288 ^ 0x80000000); } (npc->_v1).x = (float)pEVar17; (npc->_v1).y = 0.0; goto LAB_0048411d; } bVar2 = Vector::operator_eq(&npc->_v1,&g_vectorZero); if (bVar2 != 0) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (pEVar4->_pos).y; (npc->_targetPosition).x = local_27c.y * 0.5 + (pEVar4->_pos).x; (npc->_targetPosition).y = local_284.y * 0.5 + fVar14; npc->_stateFrame = 8; } goto LAB_004853d4; } if (iVar12 == 8) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Charge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484205: uVar3 = -(uint)bVar13 | 1; goto LAB_0048420a; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484205; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048420a: if (uVar3 != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadCharge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484240: uVar3 = -(uint)bVar13 | 1; goto LAB_00484245; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484240; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484245: if (uVar3 != 0) goto LAB_00484266; } Entity_NPC::PlaySound(npc,0x6c,1.0,0x3c,0,1.0); } LAB_00484266: if (npc->_i1 == 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { currentAnim = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)animName); local_27c.y = 1.4013e-45; puVar1 = ¤tAnim->_size; if (0xf < currentAnim->_capacity) { currentAnim = *(std_string **)currentAnim->_buf; } bVar2 = str_eq((byte *)currentAnim,*puVar1,(byte *)"Charge",6); isChargeDone = '\x01'; if (bVar2 == 0) goto LAB_004842bf; } else { LAB_004842bf: isChargeDone = '\0'; } if ((((uint)local_27c.y & 1) != 0) && (0xf < animNameCapacity)) { uVar3 = animNameCapacity + 1; pvVar9 = animName[0]; if (0xfff < uVar3) { pvVar9 = *(void **)((int)animName[0] + -4); uVar3 = animNameCapacity + 0x24; if (0x1f < (uint)((int)animName[0] + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar3); } if (isChargeDone != '\0') { ANM2::Play(&npc->_sprite,(byte *)"Swarm",0); ProjectileParams::ProjectileParams(&swarmParams); swarmParams.BulletFlags._0_4_ = (uint)swarmParams.BulletFlags | 2; swarmParams.Color._colorize[0] = (float)0x3f333333; swarmParams.Color._colorize[1] = (float)0x3f333333; swarmParams.Color._colorize[2] = 1.0; swarmParams.Color._colorize[3] = 1.0; Entity_NPC::PlaySound(npc,0xb,1.0,0x3c,0,1.0); Entity_NPC::FireBossProjectiles(npc,0xc,&g_vectorZero,0.0,&swarmParams); goto LAB_004853d4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004853d4; pbVar6 = s_Idle; } else { if (npc->_variant != 0) { if (npc->_variant == 10) { ANM2::Play(&npc->_sprite,(byte *)"BodyAttack",0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { ProjectileParams::ProjectileParams(&burstParams); burstParams.Color._colorize[0] = (float)0x3f333333; burstParams.Color._colorize[1] = (float)0x3f333333; burstParams.Color._colorize[2] = 1.0; burstParams.Color._colorize[3] = 1.0; Entity_NPC::FireBossProjectiles(npc,0xc,&g_vectorZero,0.0,&burstParams); Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); uVar3 = Random(); for (local_26c.y = (float)(uVar3 % 5); (EntityPtr *)local_26c.y != (EntityPtr *)0x0; local_26c.y = (float)&((EntityPtr *)((int)local_26c.y + -4))->field_0x3) { uVar3 = Random(); uVar11 = Random(); local_274.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_274.y = local_274.y + local_274.y; local_27c.x = cos(local_274.y); local_27c.x = local_27c.x * 10.0; fVar14 = sin(local_274.y); local_27c.y = fVar14 * 10.0; Game::Spawn(g_game,0x12,0,&npc->_pos,&local_27c,(Entity *)npc,0,uVar3); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 0x10; } } goto LAB_004853d4; } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { currentAnim = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,&sStack_3c); local_27c.y = 2.8026e-45; puVar1 = ¤tAnim->_size; if (0xf < currentAnim->_capacity) { currentAnim = *(std_string **)currentAnim->_buf; } bVar2 = str_eq((byte *)currentAnim,*puVar1,(byte *)"HeadCharge",10); isChargeDone = '\x01'; if (bVar2 == 0) goto LAB_00484420; } else { LAB_00484420: isChargeDone = '\0'; } if ((((uint)local_27c.y & 2) != 0) && (0xf < sStack_3c._capacity)) { uVar3 = sStack_3c._capacity + 1; pvVar9 = (void *)sStack_3c._buf._0_4_; if (0xfff < uVar3) { pvVar9 = *(void **)(sStack_3c._buf._0_4_ + -4); uVar3 = sStack_3c._capacity + 0x24; if (0x1f < (uint)(sStack_3c._buf._0_4_ + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar3); } if (isChargeDone != '\0') { ANM2::Play(&npc->_sprite,(byte *)"HeadShoot",0); ProjectileParams::ProjectileParams(&aimedParams); aimedParams.BulletFlags._0_4_ = (uint)aimedParams.BulletFlags | 1; aimedParams.Scale = 1.5; Entity_NPC::PlaySound(npc,0xb,1.0,0x3c,0,1.0); pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_26c.x = (pEVar4->_pos).x; local_26c.y = (pEVar4->_pos).y; Entity_NPC::FireBossProjectiles(npc,0xf,&local_26c,0.0,&aimedParams); goto LAB_004853d4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004853d4; LAB_00485284: pbVar6 = (byte *)"HeadIdle"; } LAB_0048528b: npc->_state = 4; ANM2::Play(&npc->_sprite,pbVar6,0); } else { if (iVar12 == 9) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (npc->_i1 == 1) goto LAB_004853d4; iVar12 = npc->_stateFrame; npc->_stateFrame = iVar12 + -1; if ((0 < iVar12) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 == 0)) { Entity_NPC::PlaySound(npc,0x77,1.0,0x32,0,1.0); bVar2 = Vector::operator_ne(&npc->_v1,&g_vectorZero); if (bVar2 == 0) { npc->_entityCollisionClass = 0; bVar2 = npc->_collidesWithGrid; (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; if (bVar2 != 0) { npc->_stateFrame = 0; } fVar14 = (npc->_targetPosition).y; fVar16 = (npc->_targetPosition).x - (npc->_pos).x; fVar15 = (npc->_pos).y; (npc->_velocity).x = fVar16; (npc->_velocity).y = fVar14 - fVar15; fVar14 = (float)npc->_stateFrame; if (fVar14 != 0.0) { (npc->_velocity).x = fVar16 / fVar14; (npc->_velocity).y = (npc->_velocity).y / fVar14; } } else { fVar14 = *extraout_ECX; (npc->_velocity).x = fVar14; (npc->_velocity).y = extraout_ECX[1]; if (npc->_collidesWithGrid != 0) { npc->_stateFrame = 0; } (npc->_sprite)._flipX = fVar14 < 0.0; tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_274,0.0); local_26c.x = tmpVec->x - (npc->_pos).x; local_26c.y = tmpVec->y - (npc->_pos).y; tmpVec = Vector::Normalized(&local_26c,&local_274); fVar14 = npc->_speedMultiplier; fVar15 = npc->_aiFloat * tmpVec->x; fVar16 = npc->_aiFloat * tmpVec->y; (npc->_velocity).x = (fVar15 + fVar15) * fVar14 + (npc->_velocity).x; (npc->_velocity).y = (fVar16 + fVar16) * fVar14 + (npc->_velocity).y; } goto LAB_004853d4; } npc->_entityCollisionClass = 4; goto LAB_00485284; } if (iVar12 == 10) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Charge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_004848f7: uVar3 = -(uint)bVar13 | 1; goto LAB_004848fc; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_004848f7; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004848fc: if (uVar3 != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadCharge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484930: uVar3 = -(uint)bVar13 | 1; goto LAB_00484935; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484930; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484935: if (uVar3 != 0) goto LAB_00484956; } Entity_NPC::PlaySound(npc,0x6a,1.0,0x3c,0,1.0); } LAB_00484956: sprite = &npc->_sprite; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00484b29: bVar2 = ANM2::WasEventTriggered(sprite,(byte *)"Shoot"); if (bVar2 != 0) goto LAB_00484b3d; } else { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Charge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_004849c0: uVar3 = -(uint)bVar13 | 1; goto LAB_004849c5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_004849c0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004849c5: if (uVar3 != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadCharge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484a00: uVar3 = -(uint)bVar13 | 1; goto LAB_00484a05; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484a00; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484a05: if (uVar3 != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Swarm2Start"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484a40: uVar3 = -(uint)bVar13 | 1; goto LAB_00484a45; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484a40; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484a45: if (uVar3 == 0) { if (npc->_i1 == 1) { ANM2::Play(sprite,(byte *)"Swarm2Loop",0); } else { ANM2::Play(sprite,(byte *)"HeadShoot2Loop",0); } } goto LAB_00484a9f; } } pcVar7 = "HeadShoot2Start"; if (npc->_i1 == 1) { pcVar7 = "Swarm2Start"; } ANM2::Play(sprite,(byte *)pcVar7,0); uVar3 = Random(); npc->_i2 = uVar3 % 10; } LAB_00484a9f: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_00484b29; pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Swarm2Loop"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484ae6: uVar3 = -(uint)bVar13 | 1; goto LAB_00484aeb; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484ae6; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484aeb: if (uVar3 != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2Loop"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484b20: uVar3 = -(uint)bVar13 | 1; goto LAB_00484b25; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484b20; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484b25: if (uVar3 != 0) goto LAB_00484b29; } LAB_00484b3d: if (npc->_i2 < 4) { tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_274,0.0); local_26c.x = tmpVec->x - (npc->_pos).x; local_26c.y = tmpVec->y - (npc->_pos).y; tmpVec = Vector::Normalized(&local_26c,&local_2a0); game = g_game; fVar14 = npc->_aiFloat; fVar15 = tmpVec->y; (npc->_velocity).x = fVar14 * tmpVec->x * 0.333; (npc->_velocity).y = fVar14 * fVar15 * 0.333; pvVar9 = game->_room; local_26c.y = (float)(*(int *)((int)pvVar9 + 0x12c4) + *(int *)((int)pvVar9 + 0x12c0)); iVar12 = *(int *)((int)pvVar9 + 0x12cc) + *(int *)((int)pvVar9 + 0x12c8); if (((npc->_i1 == 1) && (npc->_stateFrame % 0x1e == 0)) && (uVar3 = Random(), (uVar3 & 1) == 0)) { iVar10 = 0; if (0 < iVar12) { iVar10 = iVar12; } pEVar17 = (EntityPtr *)0x0; if (0 < (int)local_26c.y) { pEVar17 = (EntityPtr *)local_26c.y; } if ((int)pEVar17 - iVar10 < 0xf) { uVar3 = Random(); tmpVec = MusicManager::RandomVector(&local_274); local_26c.x = tmpVec->x * 10.0 + (npc->_velocity).x; local_26c.y = tmpVec->y * 10.0 + (npc->_velocity).y; pEVar4 = Game::Spawn(g_game,0x12,0,&npc->_pos,&local_26c,(Entity *)npc,0,uVar3); uVar18 = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar18; } } } NpcHelper::the_lamb_pattern(npc,npc->_i2,npc->_stateFrame); if (0x78 < npc->_stateFrame) { if (npc->_i1 == 1) { pcVar7 = "Swarm2End"; } else { pcVar7 = "HeadShoot2End"; } ANM2::Play(&npc->_sprite,(byte *)pcVar7,0); } npc->_stateFrame = npc->_stateFrame + 1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004853d4; pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Swarm2End"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484d54: uVar3 = -(uint)bVar13 | 1; goto LAB_00484d59; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484d54; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484d59: if (uVar3 != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2End"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484d90: uVar3 = -(uint)bVar13 | 1; goto LAB_00484d95; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484d90; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484d95: if (uVar3 != 0) goto LAB_004853d4; } pcVar7 = "HeadIdle"; if (npc->_i1 == 1) { pcVar7 = (char *)s_Idle; } pbVar6 = (byte *)pcVar7; goto LAB_0048528b; } if (iVar12 != 0xb) { if (iVar12 != 0x10) goto LAB_004853d4; if (npc->_variant != 0) { if (npc->_variant == 10) { ANM2::Play(&npc->_sprite,&DAT_00b1d734,0); fVar14 = (npc->_targetPosition).y; fVar15 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar14 - fVar15; childEffect = npc->_child; if (childEffect != (EntityPtr)0x0) { fVar14 = (npc->_pos).y; *(float *)((int)childEffect + 0x33c) = (npc->_pos).x + 4.0; *(float *)((int)childEffect + 0x340) = fVar14 + 2.0; } if (((((0.0 < npc->_health) && (npc->_stateFrame % 0xf == 0)) && ((uVar3 = Random(), (uVar3 & 7) == 0 || ((local_274.y._0_1_ != '\0' && (uVar3 = Random(), (uVar3 & 1) == 0)))))) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 == 0)) && (((EntityPtr *)local_26c.y == (EntityPtr *)0x0 || (*(EntityPtr *)((int)local_26c.y + 0xb64) == (EntityPtr)0x4)))) { npc->_state = 8; if (local_274.y._0_1_ != '\0') { (npc->_v2).y = (npc->_v2).y - 4.0; } } npc->_stateFrame = npc->_stateFrame + 1; } goto LAB_004853d4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004853d4; npc->_isInvicible = 0; goto LAB_00485284; } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { LAB_00484ea1: pbVar6 = (npc->_sprite)._animState._animData; if ((pbVar6 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2Start"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484ee0: uVar3 = -(uint)bVar13 | 1; goto LAB_00484ee5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484ee0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484ee5: if (uVar3 == 0) { pcVar7 = "HeadShoot2Loop"; goto LAB_00484eef; } } } else { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } pcVar7 = "Charge2"; do { bVar2 = *pbVar5; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484e27: uVar3 = -(uint)bVar13 | 1; goto LAB_00484e2c; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484e27; pbVar5 = pbVar5 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484e2c: if (uVar3 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Blast",0); pbVar6 = (npc->_sprite)._animState._animData; } } if ((pbVar6 == (byte *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00484ea1; pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadCharge"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00484e90: uVar3 = -(uint)bVar13 | 1; goto LAB_00484e95; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00484e90; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00484e95: if (uVar3 != 0) goto LAB_00484ea1; pcVar7 = "HeadShoot2Start"; LAB_00484eef: ANM2::Play(&npc->_sprite,(byte *)pcVar7,0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { uVar3 = Random(); local_274.y = (float)(uVar3 % 3); uVar3 = Random(); uVar3 = uVar3 % 0x1e; bVar2 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,70.0); if (bVar2 == 0) { local_274.y = 0.0; LAB_00484f6c: local_27c.y = 1.26117e-43; } else { local_27c.y = (float)(uVar3 + 0x3c); if (local_274.y == 0.0) goto LAB_00484f6c; } npc->_stateFrame = (int)&((EntityPtr *)((int)local_27c.y + -0x10))->field_0x1; local_26c.y = 0.0; local_284.x = 0.0; local_284.y = -20.0; do { local_294._8_4_ = (npc->_pos).x + 0.0; local_288 = (EntityPtr *)((npc->_pos).y - 30.0); laser = Entity_Laser::ShootAngle (1,(Vector *)(local_294 + 8),(float)(int)local_26c.y * 90.0 - 180.0, (int)local_27c.y,&local_284,(Entity *)npc,0); laser->_renderDepthOffset = 1000.0; if (local_274.y == 1.4013e-45) { laser->_rotationDegrees = 90.0; laser->_rotationSpd = 2.0; laser->_timeout = uVar3 + 0x3d; LAB_00485061: laser->_rotationDelay = uVar3 + 0xf; laser->_isActiveRotating = 1; } else if (local_274.y == 2.8026e-45) { laser->_rotationDegrees = -90.0; laser->_rotationSpd = -2.0; laser->_timeout = uVar3 + 0x3d; goto LAB_00485061; } (**(code **)(*(int *)laser + 0xc))(); local_26c.y = (float)((int)local_26c.y + 1); } while ((int)local_26c.y < 4); goto LAB_004853d4; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004853d4; if ((npc->_sprite)._animState._isPlaying == 0) { LAB_0048518c: pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2End"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_004851c0: uVar3 = -(uint)bVar13 | 1; goto LAB_004851c5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_004851c0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004851c5: if (uVar3 != 0) goto LAB_004853d4; } else { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "Blast"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_004850e0: uVar3 = -(uint)bVar13 | 1; goto LAB_004850e5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_004850e0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004850e5: if (uVar3 != 0) { if ((npc->_sprite)._animState._isPlaying != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2Loop"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00485130: uVar3 = -(uint)bVar13 | 1; goto LAB_00485135; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00485130; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00485135: if (uVar3 == 0) goto LAB_004851cd; if ((npc->_sprite)._animState._isPlaying != 0) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2End"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00485176: uVar3 = -(uint)bVar13 | 1; goto LAB_0048517b; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00485176; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048517b: if (uVar3 == 0) goto LAB_004851cd; if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_004853d4; } } goto LAB_0048518c; } } LAB_004851cd: iVar12 = npc->_stateFrame; npc->_stateFrame = iVar12 + -1; if (0 < iVar12) goto LAB_004853d4; if (npc->_i1 != 1) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar7 = "HeadShoot2End"; do { bVar2 = *pbVar6; bVar13 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_00485230: uVar3 = -(uint)bVar13 | 1; goto LAB_00485235; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar13 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_00485230; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00485235: if (uVar3 == 0) goto LAB_0048524d; } ANM2::Play(&npc->_sprite,(byte *)"HeadShoot2End",0); goto LAB_004853d4; } LAB_0048524d: npc->_state = 4; } uVar3 = Random(); npc->_stateFrame = uVar3 % 0x1e + 0x3c; LAB_004853d4: game = g_game; if ((npc->_variant == 10) && (npc->_dead != 0)) { g_game->_darknessStrength = 1.0; game->_darknessTimeout = 600; npc->_collisionDamage = 0.0; npc->_dead = 0; npc->_isInvicible = 1; npc->_canShutDoors = 0; npc->_isBoss = 0; npc->_health = 0.0; npc->_entityCollisionClass = 1; Entity::RemoveStatusEffects((Entity *)npc); local_2a0.y = *(float *)((int)&npc->_flags + 4); uVar3 = (uint)npc->_flags; *(float *)((int)&npc->_flags + 4) = local_2a0.y; game = g_game; *(uint *)&npc->_flags = uVar3 | 1; room = game->_room; iVar10 = *(int *)&room->field_0x12cc + room->_aliveBossCount; iVar12 = 0; if (0 < iVar10) { iVar12 = iVar10; } if ((0 < iVar12) && ((uVar3 & 0x100000) == 0)) { Room::TriggerBossDeath(room,(Entity *)npc); } uVar3 = Random(); local_2a0.x = (npc->_pos).x + 0.0; local_2a0.y = (npc->_pos).y - 10.0; Game::Spawn(g_game,1000,0xf,&local_2a0,&g_vectorZero,(Entity *)npc,0,uVar3); Entity_NPC::PlaySound(npc,0x105,0.85,2,0,1.0); if (npc->_child != (EntityPtr)0x0) { (**(code **)(*(int *)npc->_child + 0x28))(); } } fVar14 = (npc->_v2).x; fVar15 = npc->_health; if ((fVar15 < fVar14) && (fVar14 = (fVar14 - fVar15) + (npc->_v2).y, (npc->_v2).y = fVar14, 35.0 < fVar14)) { (npc->_v2).y = 35.0; } fVar14 = (npc->_v2).y - 0.25; (npc->_v2).y = fVar14; if (fVar14 < 0.0) { (npc->_v2).y = 0.0; } (npc->_v2).x = fVar15; ExceptionList = local_1c; return; } //@@ 004855b0 NpcAI::ENTITY_DINGLE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 261 (from dispatcher 006c2990) */ undefined4 * __fastcall NpcAI::ENTITY_DINGLE(Entity_NPC *npc) { float fVar1; undefined4 uVar2; float *pfVar3; byte bVar4; uint uVar5; byte *animName; uint uVar6; uint uVar7; Entity *pEVar8; Vector *pVVar9; void *pvVar10; Room *pRVar11; Vector *pVVar12; ColorMod *color; int *piVar13; GridEntity *gridEntity; undefined4 *puVar14; int iVar15; Entity_Effect *splat; byte *pbVar16; int iVar17; char *expectedAnim; int unused; bool bVar18; float fVar19; float fVar20; Entity_NPC *pEVar21; undefined4 local_1a8 [11]; undefined4 local_17c [11]; Vector local_150; Vector freePos; Vector spawnPos; Vector local_138; Vector local_130; Vector local_128; Vector local_120; Vector local_118; float local_110; float local_10c; Entity_NPC *local_108; Entity_NPC *local_104; Vector local_100; ProjectileParams projParams; Color scratchColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; ColorMod *splatColor; puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af2c7a; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)((&scratchColor)[1]._colorize + 1); if (npc->_state == 0) { splatColor = &npc->_splatColor; puVar14 = local_17c; npc->_state = 3; npc->_stateFrame = 0; if (splatColor != (ColorMod *)puVar14) { puVar14 = (undefined4 *)0x3e0c8c8d; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.25490198; (npc->_splatColor)._offset[1] = 0.16078432; splatColor->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.13725491; } if ((npc->_variant == 1) && (puVar14 = local_1a8, splatColor != (ColorMod *)puVar14)) { puVar14 = (undefined4 *)0x0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.6; (npc->_splatColor)._offset[1] = 0.4; splatColor->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } npc->_i1 = 0; npc->_i2 = 0; return puVar14; } ExceptionList = &local_1c; (npc->_sprite)._flipX = 0; if ((npc->_subtype == 1) && (puVar14 = (npc->_damageEvents)._begin, puVar14 != (npc->_damageEvents)._end)) { do { if ((puVar14[2] & 0x200) != 0) { *puVar14 = 0; } puVar14 = puVar14 + 0xe; } while (puVar14 != (npc->_damageEvents)._end); } iVar15 = npc->_state; local_108 = npc; local_24 = uVar5; if (iVar15 != 3) { if (iVar15 == 8) { animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_0048590e: puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d47c,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pbVar16 = &DAT_00b1d47c; do { bVar4 = *animName; bVar18 = bVar4 < *pbVar16; if (bVar4 != *pbVar16) { LAB_004858f3: uVar6 = -(uint)bVar18 | 1; goto LAB_004858f8; } if (bVar4 == 0) break; bVar4 = animName[1]; bVar18 = bVar4 < pbVar16[1]; if (bVar4 != pbVar16[1]) goto LAB_004858f3; animName = animName + 2; pbVar16 = pbVar16 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_004858f8: if (uVar6 != 0) goto LAB_0048590e; puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; if (*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0') { puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; if ((npc->_sprite)._animState._isPlaying == 0) goto LAB_0048590e; } } pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_108 = (Entity_NPC *)((pEVar8->_pos).x - (npc->_pos).x); local_120.y = (pEVar8->_pos).y - (npc->_pos).y; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { if (npc->_subtype == 2) { ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 3; projParams.FallingAccelModifier = 0.001; if (npc->_variant == 1) { projParams.Variant = 5; } projParams.FallingSpeedModifier = (float)&DAT_bf800000; local_100.x = 10.0; local_100.y = 0.0; uVar6 = 8; } else { ProjectileParams::ProjectileParams(&projParams); local_104 = local_108; projParams.Variant = -(uint)(npc->_subtype != 1) & 3; if (npc->_variant == 1) { projParams.Variant = 5; } fVar19 = sqrtf((float)local_108 * (float)local_108 + local_120.y * local_120.y); if (fVar19 <= 0.0) { fVar20 = local_120.y; pEVar21 = local_104; } else { fVar20 = local_120.y * (1.0 / fVar19); pEVar21 = (Entity_NPC *)((float)local_108 * (1.0 / fVar19)); } local_100.x = (float)pEVar21 * 10.0; local_100.y = fVar20 * 10.0; uVar6 = 2; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_100,uVar6,&projParams); Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { (npc->_sprite)._flipX = 0.0 < (float)local_108; } if ((npc->_sprite)._animState._animData != (void *)0x0) { pfVar3 = (float *)puStack_20; if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_00486cd2; } } } npc->_state = 3; } else { if (iVar15 == 4) { if (npc->_stateFrame != 0) { iVar15 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; npc->_friction = npc->_friction * 0.9; if (iVar15 < 0) { iVar15 = 0; } npc->_stateFrame = iVar15; pfVar3 = (&scratchColor)[1]._offset; if (iVar15 == 0) { puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Slide",1); pfVar3 = (float *)puStack_20; if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pfVar3 = (float *)puStack_20; } } goto LAB_00486cd2; } animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_00485b7c: puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Slide",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnim = "Slide"; do { bVar4 = *animName; bVar18 = bVar4 < (byte)*expectedAnim; if (bVar4 != *expectedAnim) { LAB_00485b61: uVar6 = -(uint)bVar18 | 1; goto LAB_00485b66; } if (bVar4 == 0) break; bVar4 = animName[1]; bVar18 = bVar4 < (byte)expectedAnim[1]; if (bVar4 != expectedAnim[1]) goto LAB_00485b61; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00485b66: if ((uVar6 != 0) || ((puStack_20 = (undefined1 *)(&scratchColor)[1]._offset, *(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && (puStack_20 = (undefined1 *)(&scratchColor)[1]._offset, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00485b7c; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Slide"), bVar4 != 0)) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); pVVar12 = &npc->_pos; local_100.x = (pEVar8->_pos).x - pVVar12->x; local_100.y = (pEVar8->_pos).y - (npc->_pos).y; pVVar9 = Vector::Normalized(&local_100,&local_130); if (npc->_subtype == 2) { fVar19 = 15.0; } else { fVar19 = 10.0; } fVar20 = pVVar9->y; (npc->_velocity).x = fVar19 * pVVar9->x + (npc->_velocity).x; (npc->_velocity).y = fVar19 * fVar20 + (npc->_velocity).y; Entity_NPC::PlaySound(npc,0x12d,1.0,0x1e,0,1.0); if ((npc->_i1 == 0) && (uVar6 = Random(), uVar6 % 5 == 0)) { if (npc->_variant == 0) { local_118.y = (float)g_game->_room; pvVar10 = (void *)Room::GetGridIndex((Room *)local_118.y,pVVar12); local_128.y = (float)pvVar10; if ((((((void *)0x1bf < pvVar10) || (((void **)((int)local_118.y + 0x24))[(int)pvVar10] == (void *)0x0)) || (iVar15 = *(int *)((int)((void **)((int)local_118.y + 0x24))[(int)pvVar10] + 4), iVar15 == 1)) || (iVar15 == 10)) && (*(int *)((int)local_118.y + 8) != 0x10)) { local_104 = (Entity_NPC *)RNG::Next(&npc->_dropRNG); if (((int)pvVar10 < 0) || (0x1bf < (int)pvVar10)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((pvVar10 < (void *)0x1c0) && (((int *)((int)local_118.y + 0x76c))[(int)pvVar10] < 0x385)) { pRVar11 = operator_new(0x19c); local_14 = 9.80909e-45; local_100.y = (float)pRVar11; if (pRVar11 == (Room *)0x0) { pRVar11 = (Room *)0x0; } else { GridEntity::GridEntity((GridEntity *)pRVar11); *(undefined ***)pRVar11 = IsaacRepentancePlus::GridEntity_Poop::vftable; pRVar11->_gridEntities[0x4d] = (void *)0x0; pRVar11->_gridEntities[0x51] = (void *)0x0; pRVar11->_gridEntities[0x52] = &DAT_0000000f; *(undefined1 *)(pRVar11->_gridEntities + 0x4d) = 0; pRVar11->_gridEntities[0x54] = (void *)0x0; pRVar11->_gridEntities[0x55] = (void *)0x0; pRVar11->_gridEntities[0x56] = (void *)0x0; pRVar11->_gridEntities[0x57] = (void *)0x0; fVar19 = g_vectorZero.y; pRVar11->_gridEntities[0x58] = (void *)g_vectorZero.x; pRVar11->_gridEntities[0x59] = (void *)fVar19; fVar19 = g_vectorZero.y; pRVar11->_gridEntities[0x5a] = (void *)g_vectorZero.x; pRVar11->_gridEntities[0x5b] = (void *)fVar19; pRVar11->_gridEntities[0x5c] = (void *)0x0; pRVar11->_gridEntities[0x5d] = (void *)0x0; } local_14 = -NAN; if (pRVar11 != (Room *)0x0) { ((GridEntityDesc *)&pRVar11->_descriptor)->_type = 0xe; pRVar11->_gridEntities[0] = (void *)local_128.y; if (((void **)((int)local_118.y + 0x24))[(int)local_128.y] != (undefined4 *)0x0) { (*(code *)**(undefined4 **) ((void **)((int)local_118.y + 0x24))[(int)local_128.y])(1); } ((void **)((int)local_118.y + 0x24))[(int)local_128.y] = pRVar11; pRVar11->_roomType = 0; (pRVar11->_topLeftPos).y = 0.0; GridEntity::Init((GridEntity *)pRVar11,(uint)local_104); } } } } else if (npc->_variant == 1) { uVar6 = Random(); Game::SpawnEx(g_game,0x127,0,pVVar12,&g_vectorZero,(Entity *)npc,0,uVar6,0); } Entity_NPC::PlaySound(npc,0x25,1.0,2,0,1.0); } } npc->_friction = npc->_friction * 0.98; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Slide"), bVar4 != 0)) { if (npc->_subtype == 2) { fVar19 = 1.5; } else { fVar19 = 1.0; } pVVar12 = Vector::Resized(&npc->_velocity,&local_130,fVar19); fVar19 = npc->_friction; if (fVar19 != 0.0) { fVar20 = npc->_speedMultiplier; fVar1 = pVVar12->y; (npc->_velocity).x = (fVar20 * pVVar12->x) / fVar19 + (npc->_velocity).x; (npc->_velocity).y = (fVar1 * fVar20) / fVar19 + (npc->_velocity).y; } if (npc->_variant == 1) { iVar15 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar15 != 0) { Color::Color(&scratchColor); Game::Fart(g_game,&npc->_pos,npc->_size + 20.0,(Entity *)npc,0.5,0,color); } bVar4 = Entity::HasEntityFlags((Entity *)npc,0x40); uVar6 = 0x17; if (bVar4 == 0) { uVar6 = 0x5e; } bVar4 = Entity::HasEntityFlags((Entity *)npc,0x80); if (bVar4 != 0) { uVar6 = 0x19; } uVar7 = Random(); pEVar8 = Game::SpawnEx(g_game,1000,uVar6,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar7, 0); piVar13 = (int *)__RTDynamicCast(pEVar8,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect:: RTTI_Type_Descriptor,0); uVar6 = Random(); fVar20 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.25 + 0.75; fVar19 = fVar20 * g_vectorOne.x; piVar13[0x3a] = (int)(fVar20 * g_vectorOne.y); piVar13[0x39] = (int)fVar19; (**(code **)(*piVar13 + 0xc))(); } } (npc->_sprite)._flipX = 0.0 < (npc->_velocity).x; bVar4 = Entity::IsFrame((Entity *)npc,2,npc->_index); if (bVar4 != 0) { uVar6 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); scratchColor._offset[0] = 0.25490198; scratchColor._offset[1] = 0.16078432; scratchColor._colorize[0] = 0.0; scratchColor._colorize[1] = 0.0; scratchColor._colorize[2] = 0.0; scratchColor._colorize[3] = 0.0; scratchColor._tint[0] = 0.0; scratchColor._tint[1] = 0.0; scratchColor._tint[2] = 0.0; scratchColor._tint[3] = 1.0; scratchColor._offset[2] = 0.13725491; (**(code **)(*(int *)splat + 0x3c))(&scratchColor,0xffffffff,0xff,0,1); } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) || (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar4 != 0)) { if (npc->_subtype == 1) { iVar15 = 3; } else { iVar15 = (npc->_variant != 1) + 1; if (npc->_subtype == 2) { iVar15 = 0; } } if (npc->_i1 < iVar15) { uVar6 = Random(); npc->_stateFrame = (uVar6 & 3) + 0xc; npc->_i1 = npc->_i1 + 1; } else { npc->_state = 0x10; npc->_stateFrame = 0; npc->_i1 = 0; } } pfVar3 = (float *)puStack_20; if (npc->_collidesWithGrid != 0) { pVVar12 = Room::GetRandomPosition(g_game->_room,&local_130,0.0); (npc->_targetPosition).x = pVVar12->x; (npc->_targetPosition).y = pVVar12->y; Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); pRVar11 = g_game->_room; uVar6 = Random(); local_104 = (Entity_NPC *)&npc->_gridCollisionNormal; local_138.x = ((Vector *)local_104)->x * 200.0 + (npc->_pos).x; fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 * -0.6; local_138.y = (npc->_gridCollisionNormal).y * 200.0 + (npc->_pos).y; Room::GetClampedPositionImpl(pRVar11,&local_100,&local_138,fVar19,fVar19,fVar19,fVar19); gridEntity = Room::GetGridEntityFromPos(g_game->_room,&local_100); pfVar3 = (float *)puStack_20; if ((gridEntity != (GridEntity *)0x0) && ((iVar15 = (gridEntity->_desc)._type, iVar15 == 0xf || (iVar15 == 0x10)))) { uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; splat = Entity_NPC::MakeSplat(npc,fVar19 + fVar19 + 1.0); iVar15 = *(int *)splat; (splat->_pos).x = local_100.x; (splat->_pos).y = local_100.y; (**(code **)(iVar15 + 0x3c))(&local_108->_splatColor,0xffffffff,0xff,0,1); pVVar12 = Vector::ToCardinal(&local_130,(Vector *)local_104); fVar19 = atan2f(pVVar12->y,pVVar12->x); uVar2 = *(undefined4 *)((int)&splat->_flags + 4); *(uint *)&splat->_flags = (uint)splat->_flags | 0x2000; *(undefined4 *)((int)&splat->_flags + 4) = uVar2; iVar15 = *(int *)splat; (splat->_sprite)._rotation = fVar19 * 57.295776 + 90.0; (**(code **)(iVar15 + 0xc))(); npc = local_108; pfVar3 = (float *)puStack_20; } } goto LAB_00486cd2; } if (iVar15 == 9) { animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_0048649b: puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Whistle",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnim = "Whistle"; do { bVar4 = *animName; bVar18 = bVar4 < (byte)*expectedAnim; if (bVar4 != *expectedAnim) { LAB_00486480: uVar6 = -(uint)bVar18 | 1; goto LAB_00486485; } if (bVar4 == 0) break; bVar4 = animName[1]; bVar18 = bVar4 < (byte)expectedAnim[1]; if (bVar4 != expectedAnim[1]) goto LAB_00486480; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00486485: if ((uVar6 != 0) || ((puStack_20 = (undefined1 *)(&scratchColor)[1]._offset, *(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && (puStack_20 = (undefined1 *)(&scratchColor)[1]._offset, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048649b; } iVar15 = 0x19d; if (npc->_variant != 1) { iVar15 = 0x13b; } Entity_NPC::PlaySound(npc,iVar15,1.0,0x3c,0,1.0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Spawn); if (bVar4 != 0) { pRVar11 = g_game->_room; iVar17 = *(int *)&pRVar11->field_0x12c4 + pRVar11->_aliveEnemyCount; iVar15 = 0; if (0 < iVar17) { iVar15 = iVar17; } if (((iVar15 < 5) && (npc->_subtype != 1)) || (npc->_i2 < 6)) { iVar15 = npc->_subtype; if (iVar15 == 0) { local_104 = (Entity_NPC *)0x2; if (npc->_variant != 1) { local_104 = (Entity_NPC *)0x0; } uVar6 = Random(); pvVar10 = (void *)((uVar6 & 1) + 1); local_128.y = (float)pvVar10; bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar4 != 0) { iVar15 = Entity::CountRelatedEntities((Entity *)npc,0xd9,0,unused,(void *)0x0); if ((int)(3U - iVar15) <= (int)pvVar10) { pvVar10 = (void *)(3U - iVar15); } local_128.y = (float)pvVar10; } if (0 < (int)pvVar10) { do { if (npc->_variant == 1) { pVVar12 = Entity_NPC::CalcTargetPosition(npc,&local_150,0.0); local_118.y = pVVar12->x - (npc->_pos).x; local_120.y = pVVar12->y - (npc->_pos).y; fVar19 = sqrtf(local_118.y * local_118.y + local_120.y * local_120.y); if (0.0 < fVar19) { local_118.y = (1.0 / fVar19) * local_118.y; local_120.y = local_120.y * (1.0 / fVar19); } uVar6 = Random(); local_138.y = (npc->_pos).x; local_100.y = (npc->_pos).y; uVar7 = Random(); local_10c = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_10c = local_10c + local_10c; uVar7 = Random(); local_110 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0; fVar19 = cos(local_10c); spawnPos.x = fVar19 * local_110 + local_118.y * 30.0 + local_138.y; fVar19 = sin(local_10c); spawnPos.y = fVar19 * local_110 + local_120.y * 30.0 + local_100.y; pEVar8 = Game::SpawnEx(g_game,0xd9,(uint)local_104,&spawnPos,&g_vectorZero, (Entity *)npc,0,uVar6,0); piVar13 = (int *)__RTDynamicCast(pEVar8,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC:: RTTI_Type_Descriptor,0); fVar19 = (float)piVar13[0xdb]; if (fVar19 != 0.0) { piVar13[0xd8] = (int)((local_118.y * 15.0 * (float)piVar13[0xe7]) / fVar19 + (float)piVar13[0xd8]); piVar13[0xd9] = (int)((local_120.y * 15.0 * (float)piVar13[0xe7]) / fVar19 + (float)piVar13[0xd9]); } piVar13[0x5a] = piVar13[0x5a] & 0xfffffffb; piVar13[0x5b] = piVar13[0x5b]; (**(code **)(*piVar13 + 0xc))(); piVar13[0x2d9] = 4; } else { uVar6 = Random(); pVVar12 = Room::FindFreePickupSpawnPosition (g_game->_room,&freePos,&npc->_pos,60.0,0,0,0); uVar7 = Random(); local_110 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_110 = local_110 + local_110; uVar7 = Random(); local_10c = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar19 = sin(local_110); local_100.y = fVar19 * local_10c * 10.0 + pVVar12->y; fVar19 = cos(local_110); npc = local_108; local_130.x = fVar19 * local_10c * 10.0 + pVVar12->x; local_130.y = local_100.y; pEVar8 = Game::SpawnEx(g_game,0xd9,(uint)local_104,&local_130,&g_vectorZero, (Entity *)local_108,0,uVar6,0); (**(code **)(*(int *)pEVar8 + 0xc))(); } local_128.y = (float)((int)local_128.y - 1); } while ((void *)local_128.y != (void *)0x0); local_128.y = 0.0; } } else if (iVar15 == 1) { pVVar12 = Room::FindFreePickupSpawnPosition(pRVar11,&freePos,&npc->_pos,60.0,0,0,0); uVar6 = Room::GetGridIndex(pRVar11,pVVar12); if ((((0x1bf < uVar6) || (iVar15 = *(int *)((int)g_game->_room + uVar6 * 4 + 0x24), iVar15 == 0)) || ((iVar15 = *(int *)(iVar15 + 4), iVar15 == 1 || (iVar15 == 10)))) && (local_100.y = (float)g_game->_room, ((Room *)local_100.y)->_roomType != 0x10)) { uVar7 = RNG::Next(&npc->_dropRNG); Room::SpawnGridEntity((Room *)local_100.y,uVar6,0xe,1,uVar7,0); npc->_i2 = npc->_i2 + 1; } } else if (iVar15 == 2) { local_100.y = (float)Random(); local_138.y = (float)&npc->_pos; pVVar12 = Room::FindFreePickupSpawnPosition (g_game->_room,&freePos,(Vector *)local_138.y,60.0,0,0,0); pVVar9 = MusicManager::RandomVector(&local_150); uVar6 = Random(); npc = local_108; fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_130.x = fVar19 * pVVar9->x * 10.0 + pVVar12->x; local_130.y = fVar19 * pVVar9->y * 10.0 + pVVar12->y; Game::SpawnEx(g_game,0x55,0,&local_130,&g_vectorZero,(Entity *)local_108,0, (uint)local_100.y,0); uVar6 = Random(); if ((uVar6 & 1) == 0) { local_100.y = (float)Random(); pVVar12 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_120,(Vector *)local_138.y,60.0,0,0,0); pVVar9 = MusicManager::RandomVector(&local_118); uVar6 = Random(); npc = local_108; fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_128.x = fVar19 * pVVar9->x * 10.0 + pVVar12->x; local_128.y = fVar19 * pVVar9->y * 10.0 + pVVar12->y; Game::SpawnEx(g_game,0x55,0,&local_128,&g_vectorZero,(Entity *)local_108,0, (uint)local_100.y,0); } } iVar15 = 2; goto LAB_00486bd7; } } goto LAB_00486be8; } LAB_00486bfb: npc->_state = 8; } else { if (iVar15 == 10) { puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Dance",0); iVar15 = 0x3c; LAB_00486bd7: Entity_NPC::PlaySound(npc,0x48,0.6,iVar15,0,1.0); LAB_00486be8: if ((npc->_sprite)._animState._animData != (void *)0x0) { pfVar3 = (float *)puStack_20; if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_00486cd2; } goto LAB_00486bfb; } if (iVar15 == 0x10) { puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Tired",0); uVar6 = Random(); iVar15 = npc->_stateFrame; uVar6 = uVar6 % 0x1e + 0x3c; uVar7 = uVar6 / 2; if (npc->_variant != 1) { uVar7 = uVar6; } npc->_stateFrame = iVar15 + 1; pfVar3 = (float *)puStack_20; if (iVar15 <= (int)uVar7) goto LAB_00486cd2; npc->_state = 3; } else { pfVar3 = (&scratchColor)[1]._offset; if (iVar15 != 0xb) goto LAB_00486cd2; ANM2::Play(&npc->_sprite,(byte *)"BeforeSlide",0); Entity_NPC::PlaySound(npc,0x48,0.6,0x3c,0,1.0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (pfVar3 = (float *)puStack_20, (npc->_sprite)._animState._isPlaying != 0)) goto LAB_00486cd2; npc->_state = 4; } } } npc->_stateFrame = 0; pfVar3 = (float *)puStack_20; goto LAB_00486cd2; } animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_0048576e: puStack_20 = (undefined1 *)(&scratchColor)[1]._offset; bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pbVar16 = s_Idle; do { bVar4 = *animName; bVar18 = bVar4 < *pbVar16; if (bVar4 != *pbVar16) { LAB_00485753: uVar6 = -(uint)bVar18 | 1; goto LAB_00485758; } if (bVar4 == 0) break; bVar4 = animName[1]; bVar18 = bVar4 < pbVar16[1]; if (bVar4 != pbVar16[1]) goto LAB_00485753; animName = animName + 2; pbVar16 = pbVar16 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00485758: if ((uVar6 != 0) || ((puStack_20 = (undefined1 *)(&scratchColor)[1]._offset, *(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && (puStack_20 = (undefined1 *)(&scratchColor)[1]._offset, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048576e; } pfVar3 = (float *)puStack_20; if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { local_110 = (float)npc->_variant; local_10c = 7.00649e-45; local_104 = (Entity_NPC *)0x1e; uVar6 = 10; if (local_110 != 1.4013e-45) { local_10c = 1.4013e-44; } iVar17 = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + npc->_stateFrame; npc->_stateFrame = iVar17; iVar15 = 0xf; if (local_110 != 1.4013e-45) { iVar15 = 0x1e; } if (iVar15 < iVar17) { uVar7 = Random(); if (local_110 != 1.4013e-45) { uVar6 = 0x14; } if (uVar7 % uVar6 != 0) { pfVar3 = (float *)puStack_20; if (npc->_pendingDamage <= 0.0) goto LAB_00486cd2; uVar6 = Random(); pfVar3 = (float *)puStack_20; if (uVar6 % (uint)local_10c != 0) goto LAB_00486cd2; } uVar6 = Random(); if (uVar6 % 3 == 0) { npc->_state = 9; pfVar3 = (float *)puStack_20; } else { uVar6 = Random(); if (((uVar6 & 1) == 0) && (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar4 == 0)) { npc->_state = 0xb; pfVar3 = (float *)puStack_20; } else { npc->_state = 10; pfVar3 = (float *)puStack_20; } } } } LAB_00486cd2: puStack_20 = (undefined1 *)pfVar3; game = g_game; puVar14 = (undefined4 *)((uint)npc->_flags & 0x4000); if (puVar14 == (undefined4 *)0x0) { bVar4 = Game::IsPaused(g_game); puVar14 = (undefined4 *)(uint)bVar4; if ((bVar4 == 0) && (iVar15 = game->_frameCount + npc->_index, puVar14 = (undefined4 *)(iVar15 / 5), iVar15 % 5 == 0)) { uVar6 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); puVar14 = (undefined4 *) (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1,uVar5); } } if (npc->_state != 4) { npc->_friction = npc->_friction * 0.7; } ExceptionList = local_1c; return puVar14; } //@@ 00486db0 NpcAI::ENTITY_MR_FRED /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 270 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MR_FRED(Entity_NPC *npc) { byte bVar1; uint uVar2; undefined4 *damageEvent; EntityList_EL *fredQuery; std_string *animName; void *pvVar3; ProjectileParams *params; Entity *spawnedFred; Entity_NPC *fredNpc; Vector *landingPos; byte *animNameChar; int iVar4; byte *idleNameChar; qword *heapByteCounter; uint i; uint uVar5; bool bVar6; float roll; double dVar7; undefined4 uVar8; TypeDescriptor *pTVar9; undefined8 uVar10; undefined1 auStack_ec [12]; float local_e0; Vector scratchVec; ProjectileParams projParams; void *animNameBuf [2]; undefined1 local_24 [12]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword allocatedBytes; byte *animData; uint *animNameSize; Game *game; ANM2 *sprite; local_8 = 0xffffffff; puStack_c = &LAB_00af2ccd; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { local_e0 = (float)damageEvent[3]; if (((damageEvent[2] & 4) != 0) && ((((damageEvent[4] != 1 && (damageEvent[6] != 1)) && (damageEvent[6] != 3)) && ((damageEvent[2] & 0x1000) == 0)))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } scratchVec.y = (float)npc; local_14 = uVar2; switch(npc->_state) { case 0: npc->_state = 3; uVar5 = Random(); npc->_entityGridCollisionClass = 5; npc->_stateFrame = uVar5 % 0x1e + 0x1e; (npc->_v1).x = (npc->_pos).x; (npc->_v1).y = (npc->_pos).y; Entity_NPC::UpdateDirtColor(npc,1); break; case 3: sprite = &npc->_sprite; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(sprite,s_Idle,0); } if ((((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (iVar4 = npc->_stateFrame, npc->_stateFrame = iVar4 + -1, iVar4 < 0)) { uVar5 = Random(); roll = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; if (0.4 <= roll) { if (0.666 <= roll) { bVar6 = false; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_24,0xe4,-1, -1,0,0); uVar8 = local_24._4_4_; uVar5 = 0; local_8 = 0; if (local_18 != 0) { do { iVar4 = __RTDynamicCast(*(undefined4 *)(uVar8 + uVar5 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar2 ); npc = (Entity_NPC *)scratchVec.y; if ((iVar4 != 0) && (*(int *)(iVar4 + 0xb64) == 4)) { bVar6 = true; } uVar5 = uVar5 + 1; } while (uVar5 < local_18); if ((bVar6) && (uVar5 = Random(), 0x1e < uVar5 % 100)) { *(int *)((int)npc + 0xb64) = 0x10; ANM2::Play((ANM2 *)((int)npc + 0x48),&DAT_00b1d20c,0); local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(local_24); break; } } fredQuery = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218), (EntityList_EL *)auStack_ec,0x3b,-1,-1,0,0); uVar5 = fredQuery->_size; EntityList_Query::~EntityList_Query(auStack_ec); if (uVar5 < 4) { npc->_state = 0xd; ANM2::Play(&npc->_sprite,&UNK_00b1d874,0); local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(local_24); } else { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Dissapear",0); uVar5 = Random(); local_8 = 0xffffffff; npc->_stateFrame = uVar5 % 0x1e + 0xf; EntityList_Query::~EntityList_Query(local_24); } } else { npc->_state = 9; ANM2::Play(sprite,(byte *)"Squirt",0); } } else { npc->_state = 8; ANM2::Play(sprite,(byte *)"Dissapear",0); uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0xf; } } break; case 8: animName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)animNameBuf); animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar1 = str_eq((byte *)animName,*animNameSize,(byte *)"Dissapear",9); if (0xf < local_18) { uVar5 = local_18 + 1; pvVar3 = animNameBuf[0]; if (0xfff < uVar5) { pvVar3 = *(void **)((int)animNameBuf[0] + -4); uVar5 = local_18 + 0x24; if (0x1f < (uint)((int)animNameBuf[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar5); } iVar4 = ANM2::GetFrame(&npc->_sprite); if (bVar1 != 0) { if (iVar4 == 1) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); } if ((npc->_entityCollisionClass != 0) && ((((npc->_sprite)._animState._animData == (void *)0x0 || (pvVar3 = AnimationState::GetNullFrame (&(npc->_sprite)._animState,(byte *)"OverlayEffect"), pvVar3 == (void *)0x0)) || (*(char *)((int)pvVar3 + 0xc) == '\0')))) { npc->_isInvicible = 1; npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { iVar4 = npc->_stateFrame; npc->_visible = 0; npc->_stateFrame = iVar4 + -1; if (iVar4 < 0) { npc->_visible = 1; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); } } break; } if (iVar4 == 1) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); } if (((npc->_entityCollisionClass == 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && ((pvVar3 = AnimationState::GetNullFrame (&(npc->_sprite)._animState,(byte *)"OverlayEffect"), pvVar3 != (void *)0x0 && (*(char *)((int)pvVar3 + 0xc) != '\0')))) { npc->_isInvicible = 0; npc->_entityCollisionClass = 4; } iVar4 = ANM2::GetFrame(&npc->_sprite); if (iVar4 == 5) { params = ProjectileParams::ProjectileParams(&projParams); scratchVec.x = 8.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,8,params); break; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); goto code_r0x0048730e; case 9: if ((npc->_sprite)._animState._animData != (void *)0x0) { scratchVec.y = (npc->_sprite)._animState._animFrame; dVar7 = floor((double)scratchVec.y); scratchVec.y = (float)dVar7; if (((int)dVar7 != 1) || (Entity_NPC::PlaySound(npc,0x6c,1.0,2,0,1.0), (npc->_sprite)._animState._animData != (void *)0x0)) { scratchVec.y = (npc->_sprite)._animState._animFrame; dVar7 = floor((double)scratchVec.y); scratchVec.y = (float)dVar7; if ((int)dVar7 == 0xf) { Entity_NPC::PlaySound(npc,0xe,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x500; projParams.Scale = 2.0; scratchVec.x = 10.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,6,&projParams); break; } goto code_r0x0048743e; } } goto code_r0x0048744b; case 0xd: if ((npc->_sprite)._animState._animData != (void *)0x0) { scratchVec.y = (npc->_sprite)._animState._animFrame; dVar7 = floor((double)scratchVec.y); scratchVec.y = (float)dVar7; if ((int)dVar7 == 8) { uVar5 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; if ((uVar5 == 0) || (uVar5 = Entity::CountRelatedEntities((Entity *)npc,0x3b,0,uVar5,(void *)0x0), uVar5 < 3) ) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); uVar5 = Random(); scratchVec.x = (npc->_pos).x - 15.0; scratchVec.y = (npc->_pos).y + 1.0; uVar10 = 0xc5d6ac; pTVar9 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar8 = 0; spawnedFred = Game::Spawn(g_game,0x3b,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar5); fredNpc = (Entity_NPC *)__RTDynamicCast(spawnedFred,uVar8,pTVar9,uVar10); auStack_ec._8_4_ = (npc->_pos).x - 100.0; local_e0 = (npc->_pos).y + 0.0; landingPos = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_24 + 8),(Vector *)(auStack_ec + 8), 0.0,0,0,0); (fredNpc->_targetPosition).x = landingPos->x; (fredNpc->_targetPosition).y = landingPos->y; ANM2::Play(&fredNpc->_sprite,(byte *)"JumpDownHead",0); fredNpc->_state = 6; (**(code **)(*(int *)fredNpc + 0xc))(); } break; } code_r0x0048743e: if ((npc->_sprite)._animState._isPlaying != 0) break; } code_r0x0048744b: npc->_state = 3; code_r0x0048730e: uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0x1e; break; case 0x10: if ((npc->_sprite)._animState._animData != (void *)0x0) { scratchVec.y = (npc->_sprite)._animState._animFrame; dVar7 = floor((double)scratchVec.y); scratchVec.y = (float)dVar7; if ((((int)dVar7 != 1) || (Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0), (npc->_sprite)._animState._animData != (void *)0x0)) && ((npc->_sprite)._animState._isPlaying != 0)) break; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_24,0xe4,-1,-1,0,0) ; uVar5 = local_18; local_8 = 1; i = 0; if (local_18 != 0) { do { iVar4 = __RTDynamicCast(*(undefined4 *)(local_24._4_4_ + i * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar2); if ((iVar4 != 0) && (*(int *)(iVar4 + 0xb64) == 4)) { *(undefined4 *)(iVar4 + 0xbc4) = 1; break; } i = i + 1; } while (i < uVar5); } npc->_state = 3; uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0x1e; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { code_r0x00487726: bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } idleNameChar = s_Idle; do { bVar1 = *animNameChar; bVar6 = bVar1 < *idleNameChar; if (bVar1 != *idleNameChar) { code_r0x00487710: uVar5 = -(uint)bVar6 | 1; goto code_r0x00487715; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar6 = bVar1 < idleNameChar[1]; if (bVar1 != idleNameChar[1]) goto code_r0x00487710; animNameChar = animNameChar + 2; idleNameChar = idleNameChar + 2; } while (bVar1 != 0); uVar5 = 0; code_r0x00487715: if ((uVar5 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto code_r0x00487726; } local_8 = 0xffffffff; if (local_24[0] == '\0') { local_8 = 2; tracked_alloc(1,(void *)local_24._4_4_,0); local_8 = 0xffffffff; } } (npc->_pos).x = (npc->_v1).x; (npc->_pos).y = (npc->_v1).y; game = g_game; if (0 < npc->_i1) { npc->_i1 = 0; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_24,0xe4,-1,-1,0,0); local_8 = 3; uVar5 = 0; if (local_18 != 0) { do { iVar4 = __RTDynamicCast(*(undefined4 *)(local_24._4_4_ + uVar5 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar2); if ((iVar4 != 0) && (*(int *)(iVar4 + 0x410) < 0x96)) { *(undefined4 *)(iVar4 + 0x410) = 0; npc->_i1 = npc->_i1 + 1; } uVar5 = uVar5 + 1; } while (uVar5 < local_18); } if (local_24[0] == '\0') { if (g_mainHeap == (void *)0x0) { heapByteCounter = &g_allocatedBytesNoHeap; } else { heapByteCounter = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_24._4_4_ != (void *)0x0) { uVar2 = *(uint *)(local_24._4_4_ + -4); allocatedBytes = *heapByteCounter; *(uint *)heapByteCounter = (uint)*heapByteCounter - uVar2; *(uint *)((int)heapByteCounter + 4) = *(uint *)((int)heapByteCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(local_24._4_4_ + -4)); } } } ExceptionList = local_10; return; } //@@ 004878a0 NpcAI::ENTITY_CAGE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Exceeded maximum restarts with more pending */ /* NPC AI for entity type 265 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CAGE(Entity_NPC *npc) { code *pcVar1; longlong lVar2; longlong lVar3; byte bVar4; char cVar5; uint uVar6; undefined4 *damageEvent; byte *animNameCursor; Vector *targetPos; Entity *pEVar7; int iVar8; byte *pbVar9; Vector *tmpVec; undefined1 *shockwaveIndex; Entity_Effect *splat; float fVar10; EntityRef *ref; int *piVar11; Entity_Player *player; byte *wantedAnimBytes; char *wantedAnimChars; int unused; int unusedArg; uint uVar12; uint uVar13; int iVar14; Game *game; Entity_NPC *pEVar15; bool bVar16; float fVar17; ulonglong uVar18; int iVar19; byte addEnemyKillScore; float local_318; uint spawnVariant; Game *local_310; int spawnSubType; Entity_NPC *local_308; EntityPtr local_2fc; float local_2f8; Room *local_2f4; uint local_2f0; float local_2ec; int local_2e8; float local_2e4; uint local_2e0; float local_2dc; Vector scratchVec; Entity_NPC *savedNpc; void **ppvStack_2c8; EntityPtr *local_2c4; ItemPool *local_2c0; EntityPtr *local_2bc; void *pvStack_2b8; Vector *local_2b4; int landSoundId; int landImpactSoundId; int shockwaveSoundId; int attackSoundId; int rollStartSoundId; int rollBounceSoundId; undefined4 local_298; int anyVariantKeyType; undefined4 local_28c; Vector twinSpawnPos; Vector clampedTargetPos; Vector creepPos; Vector shotVelocity; Vector visVelocity; Vector visSpawnPos; Vector toPlayer; int triggerKeyType; int triggerKeyVariant; Vector local_248; undefined8 local_23c; undefined1 auStack_230 [12]; undefined4 uStack_224; undefined4 uStack_220; undefined4 uStack_21c; undefined4 uStack_218; undefined4 uStack_214; undefined1 local_210 [8]; int local_208; undefined4 local_204 [8]; undefined4 local_1e4; undefined4 uStack_1e0; undefined4 local_1dc; Vector calcTargetPos; Vector freeTilePos; Vector toPlayerDir; EntityRef charmSourceRef; EntityRef brimstoneMarkRef; EntityRef shrinkRef; EntityRef charmRef; RNG cardRng; undefined4 creepColor; undefined4 uStack_10c; undefined4 uStack_108; undefined4 uStack_104; undefined4 uStack_100; undefined4 uStack_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 splatColor; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; ProjectileParams projParams; uint local_c; Entity_NPC *spawner; EntityPtr spawnedEntity; AnimationState *animState; void **effectRefSlot; EntityPtr *entityRefSlot; undefined4 flagsHigh; Manager *manager; void *room; std_set *spawnTriggerTargets; float targetPosY; local_c = __security_cookie ^ (uint)&local_318; iVar19 = npc->_state; savedNpc = npc; if (iVar19 == 0) { npc->_stateFrame = 0; npc->_state = 3; (npc->_sizeMulti).x = 1.2; (npc->_sizeMulti).y = 0.5; local_1e4 = 0x3ec8c8ca; uStack_1e0 = 0x3ec8c8ca; local_1dc = 0x3ea0a0a1; if (&npc->_splatColor != (ColorMod *)local_204) { (npc->_splatColor)._offset[0] = 0.3921569; (npc->_splatColor)._offset[1] = 0.3921569; (npc->_splatColor)._tint[0] = 0.039215688; (npc->_splatColor)._tint[1] = 0.3137255; (npc->_splatColor)._tint[2] = 0.039215688; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.3137255; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } if (npc->_subtype != 2) { return; } if (npc->_spawnerType != npc->_type) { uVar6 = Random(); twinSpawnPos.x = (npc->_pos).x + 24.0; twinSpawnPos.y = (npc->_pos).y + 0.0; Game::SpawnEx(g_game,npc->_type,npc->_variant,&twinSpawnPos,&npc->_velocity,(Entity *)npc, npc->_subtype,uVar6,0); (npc->_pos).x = (npc->_pos).x - 24.0; (npc->_pos).y = (npc->_pos).y - 0.0; } npc->_size = *(float *)((int)npc->_config + 0x38) * 0.67; return; } local_308 = (Entity_NPC *)0x0; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { local_28c = damageEvent[3]; if ((((damageEvent[2] & 8) != 0) && (damageEvent[6] == 0x109)) || (((damageEvent[2] & 4) != 0 && (damageEvent[4] == 0x109)))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); iVar19 = npc->_state; } local_310 = (Game *)0x3f800000; if (iVar19 == 3) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_00487af0: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { animNameCursor = *(byte **)pbVar9; } wantedAnimBytes = s_Idle; do { bVar4 = *animNameCursor; bVar16 = bVar4 < *wantedAnimBytes; if (bVar4 != *wantedAnimBytes) { LAB_00487ad2: uVar6 = -(uint)bVar16 | 1; goto LAB_00487ad7; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar16 = bVar4 < wantedAnimBytes[1]; if (bVar4 != wantedAnimBytes[1]) goto LAB_00487ad2; animNameCursor = animNameCursor + 2; wantedAnimBytes = wantedAnimBytes + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00487ad7: if ((uVar6 != 0) || ((pbVar9[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00487af0; } if (((((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (iVar19 = npc->_stateFrame, npc->_stateFrame = iVar19 + 1, 0x1e < iVar19)) && (uVar6 = Random(), uVar6 % 0x14 == 0)) { uVar6 = Random(); if (uVar6 % 3 == 0) { room = g_game->_room; iVar8 = *(int *)((int)room + 0x12c8) + *(int *)((int)room + 0x12cc); iVar14 = *(int *)((int)room + 0x12c4) + *(int *)((int)room + 0x12c0); iVar19 = 0; if (0 < iVar8) { iVar19 = iVar8; } iVar8 = 0; if (0 < iVar14) { iVar8 = iVar14; } if (((iVar8 - iVar19 < 3) && (iVar19 = Isaac::Random(2), iVar19 != 0)) && (npc->_subtype != 1)) { npc->_state = 0xd; } else { npc->_state = 9; uVar6 = Random(); (npc->_v1).x = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0 - 180.0; uVar6 = Random(); fVar10 = (float)(uVar6 & 1) + 0.0; (npc->_v1).y = (fVar10 + fVar10) - 1.0; } } else { uVar6 = Random(); iVar19 = npc->_subtype; if ((((uVar6 & 1) == 0) || (iVar19 == 2)) && (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar4 == 0)) { npc->_state = 8; npc->_i1 = 0; Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } else { bVar4 = Entity::HasEntityFlags((Entity *)npc,0x200); if ((bVar4 == 0) && (iVar19 != 2)) { npc->_state = 6; targetPos = Entity_NPC::CalcTargetPosition(npc,&calcTargetPos,0.0); pEVar7 = Entity_NPC::GetPlayerTarget(npc); game = g_game; fVar10 = npc->_size; fVar17 = (pEVar7->_velocity).y; targetPosY = targetPos->y; tmpVec = &npc->_targetPosition; tmpVec->x = (pEVar7->_velocity).x * 10.0 + targetPos->x; (npc->_targetPosition).y = fVar17 * 10.0 + targetPosY; Room::GetClampedPositionImpl (game->_room,&clampedTargetPos,tmpVec,fVar10,fVar10,fVar10,fVar10); tmpVec->x = clampedTargetPos.x; (npc->_targetPosition).y = clampedTargetPos.y; (npc->_v1).x = 0.0; npc->_i1 = 0; } } } } } else if (iVar19 == 6) { if (npc->_i1 == 0) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_00487e3f: pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_00487e93: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Jumping",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { animNameCursor = *(byte **)pbVar9; } wantedAnimChars = "Jumping"; do { bVar4 = *animNameCursor; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00487e75: uVar6 = -(uint)bVar16 | 1; goto LAB_00487e7a; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00487e75; animNameCursor = animNameCursor + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00487e7a: if ((uVar6 != 0) || ((pbVar9[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00487e93; } manager = g_manager; local_2ec = 1.28779e-42; seed_fart_sound_override((int *)&local_2ec); SoundEffects::Play(&manager->_sfxManager,(int)local_2ec,1.0,2,0,1.0,0.0); } else { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar9 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "Jumping"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00487e32: uVar6 = -(uint)bVar16 | 1; goto joined_r0x00487e39; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00487e32; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; } else { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "Jumping"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00487df4: uVar6 = -(uint)bVar16 | 1; goto joined_r0x00487e39; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00487df4; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; } joined_r0x00487e39: if (uVar6 != 0) goto LAB_00487e3f; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = 1; } } else { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_00487f66: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"JumpLoop",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { animNameCursor = *(byte **)pbVar9; } wantedAnimChars = "JumpLoop"; do { bVar4 = *animNameCursor; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00487f50: uVar6 = -(uint)bVar16 | 1; goto LAB_00487f55; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00487f50; animNameCursor = animNameCursor + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00487f55: if ((uVar6 != 0) || ((pbVar9[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00487f66; } fVar10 = (npc->_targetPosition).x - (npc->_pos).x; fVar17 = (npc->_targetPosition).y - (npc->_pos).y; if (fVar17 * fVar17 + fVar10 * fVar10 < 2.0) { npc->_state = 7; } } animState = &(npc->_sprite)._animState; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(animState,s_Jump), bVar4 != 0)) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } if ((npc->_i1 != 0) || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar4 = AnimationState::WasEventTriggered(animState,s_Jump), bVar4 != 0)))) { fVar10 = (npc->_v1).x + 0.02; if (1.0 <= fVar10) { fVar10 = 1.0; } (npc->_v1).x = fVar10; fVar17 = (npc->_targetPosition).x; (npc->_pos).y = fVar10 * (npc->_targetPosition).y + (1.0 - fVar10) * (npc->_pos).y; (npc->_pos).x = (1.0 - fVar10) * (npc->_pos).x + fVar10 * fVar17; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; } } else { if (iVar19 == 7) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_0048810e: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Landing",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { animNameCursor = *(byte **)pbVar9; } wantedAnimChars = "Landing"; do { bVar4 = *animNameCursor; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_004880f0: uVar6 = -(uint)bVar16 | 1; goto LAB_004880f5; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_004880f0; animNameCursor = animNameCursor + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; LAB_004880f5: if ((uVar6 != 0) || ((pbVar9[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048810e; } if (npc->_entityGridCollisionClass != 5) { scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; local_2f4 = g_game->_room; iVar19 = Room::GetGridCollisionAtPos(local_2f4,npc->_pos); if (iVar19 != 0) { tmpVec = Room::FindFreeTilePosition(local_2f4,&freeTilePos,&npc->_pos,80.0); (npc->_pos).x = tmpVec->x; (npc->_pos).y = tmpVec->y; } npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Landed"); if (bVar4 != 0) { local_2f0 = 5; do { uVar6 = Random(); uVar13 = Random(); local_2ec = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_2ec = local_2ec + local_2ec; uVar13 = Random(); local_2f8 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)] ) * 2.3283064e-10 * 75.0; fVar10 = cos(local_2ec); creepPos.x = fVar10 * local_2f8 + (npc->_pos).x; fVar10 = sin(local_2ec); creepPos.y = fVar10 * local_2f8 + (npc->_pos).y; pEVar7 = Game::SpawnEx(g_game,1000,0x16,&creepPos,&g_vectorZero,(Entity *)npc,0,uVar6,0) ; piVar11 = (int *)__RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect:: RTTI_Type_Descriptor,0); uStack_f0 = 0; uStack_ec = 0; creepColor = 0x3f800000; uStack_10c = 0x3f800000; uStack_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_e8 = 0; uStack_100 = 0x404ccccd; uStack_fc = 0x404ccccd; uStack_f8 = 0x40133333; uStack_f4 = 0x3f800000; (**(code **)(*piVar11 + 0x3c))(&creepColor,0xffffffff,0xff,0,1); local_2f0 = local_2f0 - 1; fVar10 = g_vectorOne.y * 2.0; piVar11[0x39] = (int)(g_vectorOne.x * 2.0); piVar11[0x3a] = (int)fVar10; manager = g_manager; } while (local_2f0 != 0); local_318 = 1.0; if (npc->_championColorIdx == 0x12) { local_318 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_318 = 0.5; } landSoundId = 0x12f; seed_fart_sound_override(&landSoundId); SoundEffects::Play(&manager->_sfxManager,landSoundId,1.0,2,0,local_318,0.0); manager = g_manager; local_318 = 1.0; if (npc->_championColorIdx == 0x12) { local_318 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_318 = 0.5; } landImpactSoundId = 0x30; seed_fart_sound_override(&landImpactSoundId); SoundEffects::Play(&manager->_sfxManager,landImpactSoundId,0.8,2,0,local_318,0.0); Game::ShakeScreen(g_game,10); uVar6 = Random(); local_2fc = (EntityPtr)(360.0 / ((float)((uVar6 & 1) + 4) + 0.0)); do { uVar6 = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6,0 ); local_2f4 = (Room *)__RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect:: RTTI_Type_Descriptor,0); effectRefSlot = local_2f4->_gridEntities + 0xe6; if (local_2f4->_gridEntities[0xe6] != (void *)0x0) { ppvStack_2c8 = effectRefSlot; std::multiset::erase(&ppvStack_2c8); } *effectRefSlot = npc; std::multiset::insert(effectRefSlot); local_2f4->_gridEntities[0x114] = local_308; manager = g_manager; local_308 = (Entity_NPC *)((float)local_308 + (float)local_2fc); } while ((float)local_308 < 360.0); if (npc->_championColorIdx == 0x12) { local_310 = (Game *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_310 = (Game *)0x3f000000; } shockwaveSoundId = 0x30; seed_fart_sound_override(&shockwaveSoundId); SoundEffects::Play(&manager->_sfxManager,shockwaveSoundId,1.0,2,0,(float)local_310,0.0); ppvStack_2c8 = (void **)(npc->_pos).x; local_2f4 = (Room *)(npc->_pos).y; uStack_224 = 0; room = g_game->_room; uStack_218 = 0; uStack_214 = 0xd; uStack_21c = 0x3ccccccd; *(int *)((int)room + 0x70fc) = *(int *)((int)room + 0x70fc) + 1; uStack_220 = 0x3d23d70a; local_2fc = (EntityPtr)(*(uint *)((int)room + 0x70fc) & 0x80000001); if ((int)local_2fc < 0) { local_2fc = (EntityPtr)(((uint)((int)local_2fc - 1U) | 0xfffffffe) + 1); } if (1 < (uint)local_2fc) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } shockwaveIndex = (undefined1 *)((int)local_2fc + 0x407); *(void ***)((int)room + (int)shockwaveIndex * 0x1c) = ppvStack_2c8; *(Room **)((int)room + (int)shockwaveIndex * 0x1c + 4) = local_2f4; *(undefined4 *)((int)room + (int)shockwaveIndex * 0x1c + 8) = 0; *(undefined4 *)((int)room + (int)shockwaveIndex * 0x1c + 0xc) = 0x3d23d70a; *(undefined4 *)((int)room + (int)shockwaveIndex * 0x1c + 0x10) = 0x3ccccccd; *(undefined4 *)((int)room + (int)shockwaveIndex * 0x1c + 0x14) = 0; *(undefined4 *)((int)room + (int)shockwaveIndex * 0x1c + 0x18) = 0xd; } LAB_00488693: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004892ac; } LAB_004886a6: npc->_state = 3; } else { if (iVar19 == 9) { pbVar9 = (npc->_sprite)._animState._animData; if ((pbVar9 == (byte *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_0048870d: if ((pbVar9 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar9 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "Puking"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00488750: uVar6 = -(uint)bVar16 | 1; goto LAB_00488755; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00488750; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00488755: if (uVar6 == 0) goto LAB_004887ae; } ANM2::Play(&npc->_sprite,(byte *)"Puking",0); manager = g_manager; local_2dc = 1.292e-42; seed_fart_sound_override((int *)&local_2dc); SoundEffects::Play(&manager->_sfxManager,(int)local_2dc,1.0,2,0,1.0,0.0); } else { animNameCursor = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { animNameCursor = *(byte **)pbVar9; } wantedAnimChars = "Puking"; do { bVar4 = *animNameCursor; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00488700: uVar6 = -(uint)bVar16 | 1; goto LAB_00488705; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00488700; animNameCursor = animNameCursor + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00488705: if (uVar6 != 0) goto LAB_0048870d; } LAB_004887ae: animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x137,1.0,2,0,1.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::WasEventTriggered(animState,(byte *)"Shoot"); if ((bVar4 != 0) && ((((npc->_sprite)._animState._animData == (void *)0x0 || (bVar4 = AnimationState::WasEventTriggered(animState,(byte *)"StopShooting"), bVar4 == 0)) && (bVar4 = Entity::IsFrame((Entity *)npc,3,0), bVar4 != 0)))) { pEVar15 = (Entity_NPC *)(npc->_v1).x; local_308 = pEVar15; if ((float)pEVar15 < (float)pEVar15 + 360.0) { do { uVar6 = Random(); if ((uVar6 & 3) != 0) { local_2dc = (float)local_308 * 0.017453292; ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = -30.0; projParams.FallingSpeedModifier = 3.0; projParams.FallingAccelModifier = -0.05; uVar6 = Random(); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x20000; projParams.Variant = 3; projParams.Color._colorize[0] = 0.8; projParams.Color._colorize[1] = 1.0; projParams.Color._colorize[2] = 0.85; projParams.Color._colorize[3] = 1.0; projParams.Scale = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.5; shotVelocity.x = cos(local_2dc); shotVelocity.x = shotVelocity.x * 8.0; shotVelocity.y = sin(local_2dc); shotVelocity.y = shotVelocity.y * 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVelocity,0,&projParams); } pEVar15 = (Entity_NPC *)(npc->_v1).x; local_308 = (Entity_NPC *)((float)local_308 + 60.0); } while ((float)local_308 < (float)pEVar15 + 360.0); } (npc->_v1).x = (npc->_v1).y * 9.0 + (float)pEVar15; } goto LAB_00488693; } } goto LAB_004886a6; } if (iVar19 == 0xd) { pbVar9 = (npc->_sprite)._animState._animData; if ((pbVar9 == (byte *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_00488a10: if ((pbVar9 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar9 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } animNameCursor = s_Attack1; do { bVar4 = *pbVar9; bVar16 = bVar4 < *animNameCursor; if (bVar4 != *animNameCursor) { LAB_00488a50: uVar6 = -(uint)bVar16 | 1; goto LAB_00488a55; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < animNameCursor[1]; if (bVar4 != animNameCursor[1]) goto LAB_00488a50; pbVar9 = pbVar9 + 2; animNameCursor = animNameCursor + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00488a55: if (uVar6 == 0) goto LAB_00488ab1; } ANM2::Play(&npc->_sprite,s_Attack1,0); manager = g_manager; attackSoundId = 0x398; seed_fart_sound_override(&attackSoundId); SoundEffects::Play(&manager->_sfxManager,attackSoundId,1.0,2,0,1.0,0.0); } else { animNameCursor = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { animNameCursor = *(byte **)pbVar9; } wantedAnimBytes = s_Attack1; do { bVar4 = *animNameCursor; bVar16 = bVar4 < *wantedAnimBytes; if (bVar4 != *wantedAnimBytes) { LAB_00488a03: uVar6 = -(uint)bVar16 | 1; goto LAB_00488a08; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar16 = bVar4 < wantedAnimBytes[1]; if (bVar4 != wantedAnimBytes[1]) goto LAB_00488a03; animNameCursor = animNameCursor + 2; wantedAnimBytes = wantedAnimBytes + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00488a08: if (uVar6 != 0) goto LAB_00488a10; } LAB_00488ab1: if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004886a6; bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if ((bVar4 != 0) && ((bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar4 == 0 || (iVar19 = Entity::CountRelatedEntities((Entity *)npc,0x27,0,unused,(void *)0x0), iVar19 == 0)))) { uVar6 = Random(); visSpawnPos.x = (npc->_pos).x + (float)local_308; visSpawnPos.y = (npc->_pos).y + 20.0; visVelocity.x = 0.0; visVelocity.y = 5.0; pEVar7 = Game::SpawnEx(g_game,0x27,0,&visSpawnPos,&visVelocity,(Entity *)npc,0,uVar6,0); (**(code **)(*(int *)pEVar7 + 0xc))(); Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); uVar6 = Random(); local_318 = 0.0; local_2fc = (EntityPtr)(uVar6 % 3 + 2); if (local_2fc != (EntityPtr)0x0) { do { uVar6 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5); if (local_318 == 0.0) { fVar17 = (npc->_pos).y + 20.0; fVar10 = (npc->_pos).x + (float)local_308; } else { uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar10 = fVar17 * (float)local_308 + (npc->_pos).x; fVar17 = fVar17 * 20.0 + (npc->_pos).y; } (splat->_pos).x = fVar10; (splat->_pos).y = fVar17; uStack_d4 = 0; uStack_d0 = 0; uStack_cc = 0; uStack_c8 = 0; splatColor = 0; uStack_e0 = 0; uStack_dc = 0; uStack_d8 = 0x3f800000; uStack_c4 = 0x3ed70a3d; uStack_c0 = 0x3edc28f6; uStack_bc = 0x3eb33333; (**(code **)(*(int *)splat + 0x3c))(&splatColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)splat + 0xc))(); local_318 = (float)((int)local_318 + 1); } while ((int)local_318 < (int)local_2fc); } } goto LAB_00488693; } if (iVar19 != 8) { if (iVar19 == 10) { iVar8 = vector_to_direction(&npc->_targetPosition); (npc->_sprite)._flipX = iVar8 == 0; iVar19 = npc->_i1; if (iVar19 == 0) { ANM2::Play(&npc->_sprite,(&PTR_s_LaserStartSide_00b1dbf4)[iVar8],0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = npc->_i1 + 1; } } else if (iVar19 == 1) { ANM2::Play(&npc->_sprite,(&PTR_s_LaserLoopSide_00b1dbe4)[iVar8],0); scratchVec.x = 0.0; scratchVec.y = -30.0; if (iVar8 == 0) { scratchVec.x = -35.0; } else if (iVar8 == 2) { scratchVec.x = 35.0; } tmpVec = &scratchVec; bVar4 = 0; iVar19 = 0x1e; pEVar15 = npc; fVar10 = normalize_angle_degrees((float)iVar8 * 90.0 + 180.0); local_2fc = (EntityPtr) Entity_Laser::ShootAngle (6,&npc->_pos,fVar10,iVar19,tmpVec,(Entity *)pEVar15,bVar4); if (iVar8 == 1) { fVar10 = -10.0; } else { fVar10 = 3000.0; } *(float *)((int)local_2fc + 0x358) = fVar10; (**(code **)(*(int *)local_2fc + 0xc))(); entityRefSlot = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_2c4 = entityRefSlot; std::multiset::erase(&local_2c4); } *entityRefSlot = local_2fc; std::multiset::insert(entityRefSlot); npc->_i1 = npc->_i1 + 1; } else { if (iVar19 != 2) { if ((iVar19 != 3) || ((ANM2::Play(&npc->_sprite,(&PTR_s_LaserEndSide_00b1dbd4)[iVar8],0), (npc->_sprite)._animState._animData != (void *)0x0 && ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004892ac; npc->_state = 3; npc->_i1 = 0; goto LAB_004892a2; } if (npc->_entityRef == (EntityPtr)0x0) { npc->_i1 = 3; } } } goto LAB_004892ac; } if (npc->_i1 != 0) { if (npc->_i1 == 1) { ANM2::Play(&npc->_sprite,(byte *)"RollLoop",0); bVar4 = Vector::operator_ne(&npc->_velocity,&g_vectorZero); if (bVar4 != 0) { tmpVec = Vector::Normalized(&npc->_velocity,&local_248); bVar4 = npc->_collidesWithGrid; fVar10 = tmpVec->y; (npc->_velocity).x = tmpVec->x * 25.0; (npc->_velocity).y = fVar10 * 25.0; manager = g_manager; if (bVar4 != 0) { rollBounceSoundId = 0x39c; seed_fart_sound_override(&rollBounceSoundId); SoundEffects::Play(&manager->_sfxManager,rollBounceSoundId,1.0,2,0,1.0,0.0); } } iVar19 = npc->_stateFrame; npc->_stateFrame = iVar19 + 1; if ((0x96 < iVar19) || (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar4 != 0)) { npc->_i1 = npc->_i1 + 1; } pEVar7 = Entity_NPC::GetPlayerTarget(npc); if ((npc->_type == 0x19a) && (((ABS((pEVar7->_pos).x - (npc->_pos).x) < 20.0 || (ABS((pEVar7->_pos).y - (npc->_pos).y) < 20.0)) && (uVar6 = Random(), uVar6 % 3 == 0) ))) { npc->_friction = npc->_friction * 0.6; npc->_i1 = npc->_i1 + 1; } goto LAB_004892ac; } pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_00489099: ANM2::Play(&npc->_sprite,(byte *)"Taunt",0); manager = g_manager; local_2e8 = 0x39b; seed_fart_sound_override(&local_2e8); SoundEffects::Play(&manager->_sfxManager,local_2e8,1.0,2,0,1.0,0.0); } else { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar9 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "Taunt"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00489090: uVar6 = -(uint)bVar16 | 1; goto joined_r0x00489097; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00489090; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; } else { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "Taunt"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00489050: uVar6 = -(uint)bVar16 | 1; goto joined_r0x00489097; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00489050; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; } joined_r0x00489097: if (uVar6 != 0) goto LAB_00489099; } if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { npc->_state = 3; } goto LAB_004892a2; } goto LAB_004886a6; } pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_00488d89: ANM2::Play(&npc->_sprite,(byte *)"RollStart",0); manager = g_manager; rollStartSoundId = 0x399; seed_fart_sound_override(&rollStartSoundId); SoundEffects::Play(&manager->_sfxManager,rollStartSoundId,1.0,2,0,1.0,0.0); } else { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar9 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "RollStart"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00488d80: uVar6 = -(uint)bVar16 | 1; goto joined_r0x00488d87; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00488d80; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; } else { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } wantedAnimChars = "RollStart"; do { bVar4 = *pbVar9; bVar16 = bVar4 < (byte)*wantedAnimChars; if (bVar4 != *wantedAnimChars) { LAB_00488d42: uVar6 = -(uint)bVar16 | 1; goto joined_r0x00488d87; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar16 = bVar4 < (byte)wantedAnimChars[1]; if (bVar4 != wantedAnimChars[1]) goto LAB_00488d42; pbVar9 = pbVar9 + 2; wantedAnimChars = wantedAnimChars + 2; } while (bVar4 != 0); uVar6 = 0; } joined_r0x00488d87: if (uVar6 != 0) goto LAB_00488d89; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004892ac; npc->_i1 = npc->_i1 + 1; pEVar7 = Entity_NPC::GetPlayerTarget(npc); toPlayer.x = (pEVar7->_pos).x - (npc->_pos).x; toPlayer.y = (pEVar7->_pos).y - (npc->_pos).y; tmpVec = Vector::Normalized(&toPlayer,&toPlayerDir); fVar10 = tmpVec->y; (npc->_velocity).x = tmpVec->x * 25.0 + (npc->_velocity).x; (npc->_velocity).y = fVar10 * 25.0 + (npc->_velocity).y; } LAB_004892a2: npc->_stateFrame = 0; } LAB_004892ac: game = g_game; if (((npc->_subtype != 1) || ((npc->_flags & 0x4000) != 0)) || ((bVar4 = Game::IsPaused(g_game), bVar4 != 0 || ((game->_frameCount + npc->_index) % 0x1e != 0) ))) goto LAB_00489c07; local_2e0 = Random(); game = g_game; local_2b4 = &npc->_pos; local_310 = g_game; spawnSubType = 0; spawnVariant = 0x17; local_2e4 = 1.4013e-42; lua_callback_run_pre_entity_spawn ((int *)&local_2e4,(int *)&spawnVariant,local_2b4,&g_vectorZero,(Entity *)npc, &spawnSubType,&local_2e0); local_318 = local_2e4; if (1 < *(int *)&g_game->_deathmatchManager) { local_308 = (g_game->_deathmatchManager)._type; fVar10 = (float)Random(); pEVar15 = local_308; local_23c = 0x900000005; local_2e8 = 7; local_2e4 = fVar10; if (local_318 == 7.00649e-45) { if (spawnVariant < 0x12d) { if (spawnVariant == 300) { while ((spawnSubType == 0 || (cVar5 = (**(code **)(*(int *)local_308 + 0x24))(spawnSubType), cVar5 != '\0'))) { if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = (uint)fVar10 >> ((byte)local_23c & 0x1f) ^ (uint)fVar10; uVar6 = uVar6 << ((byte)((ulonglong)local_23c >> 0x20) & 0x1f) ^ uVar6; fVar10 = (float)(uVar6 >> ((byte)local_2e8 & 0x1f) ^ uVar6); iVar19 = ItemPool::GetCardEx((int)fVar10,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)fVar10; spawnSubType = lua_callback_run_get_card(&cardRng,iVar19,1,1,0); } goto LAB_00489428; } if (spawnVariant == 0x46) { local_2c4 = (EntityPtr *)((uint)spawnSubType >> 0xb); do { if (spawnSubType != 0) { pcVar1 = *(code **)(*(int *)local_308 + 0x28); iVar19 = ItemPool::GetPillEffect(&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0) ; cVar5 = (*pcVar1)(iVar19); if (cVar5 == '\0') goto LAB_00489428; fVar10 = local_2e4; } local_2c0 = &g_game->_itemPool; if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = (uint)fVar10 >> ((byte)local_23c & 0x1f) ^ (uint)fVar10; uVar6 = uVar6 << ((byte)((ulonglong)local_23c >> 0x20) & 0x1f) ^ uVar6; fVar10 = (float)(uVar6 >> ((byte)local_2e8 & 0x1f) ^ uVar6); local_2e4 = fVar10; uVar6 = ItemPool::GetPill((uint)fVar10); spawnSubType = uVar6 | ((uint)local_2c4 & 1) << 0xb; } while( true ); } if (spawnVariant != 100) goto LAB_00489430; if (spawnSubType == 0x19) { LAB_0048940c: bVar16 = false; } else { local_2c0 = (ItemPool *)spawnSubType; std::set::find_node(local_210,&local_2c0); if (((*(char *)(local_208 + 0xd) == '\0') && (*(int *)(local_208 + 0x10) <= spawnSubType)) && (local_208 != pEVar15->_index)) goto LAB_0048940c; bVar16 = true; } if ((spawnSubType == 0) || (bVar16)) { spawnSubType = (**(code **)(*(int *)pEVar15 + 0x84))(0); } } else { if (spawnVariant != 0x15e) goto LAB_00489430; while ((spawnSubType == 0 || (cVar5 = (**(code **)(*(int *)pEVar15 + 0x2c))(spawnSubType), cVar5 != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } npc = savedNpc; } LAB_00489428: } LAB_00489430: game = local_310; } if (((npc->_flags & 0x20000000) != 0) && (local_318 == 1.4013e-42)) { switch(spawnVariant) { case 0x48962f: /* WARNING: This code block may not be properly labeled as switch case */ spawnVariant = 0x35; } } local_2fc = (EntityPtr)EntityFactory::Create(game->_entityFactory,(uint)local_318,0); lVar2 = CONCAT44(local_298,local_2bc); if (local_2fc != (EntityPtr)0x0) { uVar18 = GetTimeNs(); spawner = savedNpc; spawnedEntity = local_2fc; uVar13 = (uint)(uVar18 >> 0x20); lVar2 = (uVar18 & 0xffffffff) * 0x431bde82; local_298 = (undefined4)((ulonglong)lVar2 >> 0x20); uVar18 = (ulonglong)uVar13 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)(uVar18 >> 0x20); lVar2 = lVar2 + (uVar18 & 0xffffffff); local_308 = (Entity_NPC *)lVar2; uVar6 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = (ulonglong)uVar13 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar12,uVar6),uVar12 + uVar6); uVar6 = (uint)((ulonglong)lVar2 >> 0x20); local_2f0 = (uint)lVar2 >> 0x12 | uVar6 * 0x4000; local_2f8 = (float)(uVar6 >> 0x12); *(int *)((int)local_2fc + 0x34) = savedNpc->_type; *(int *)((int)local_2fc + 0x38) = savedNpc->_variant; if (*(EntityPtr *)((int)local_2fc + 0x3c8) != (EntityPtr)0x0) { local_2bc = (EntityPtr *)((int)local_2fc + 0x3c8); std::multiset::erase(&local_2bc); } *(EntityPtr *)((int)spawnedEntity + 0x3c8) = (EntityPtr)spawner; std::multiset::insert((EntityPtr *)((int)spawnedEntity + 0x3c8)); ((Vector *)((int)spawnedEntity + 0x33c))->x = (spawner->_pos).x; *(float *)((int)spawnedEntity + 0x340) = (spawner->_pos).y; iVar19 = *(int *)spawnedEntity; ((Vector *)((int)spawnedEntity + 0x360))->x = g_vectorZero.x; *(float *)((int)spawnedEntity + 0x364) = g_vectorZero.y; (**(code **)(iVar19 + 4))(local_318,spawnVariant,spawnSubType,local_2e0); room = local_310->_room; iVar19 = *(int *)((int)room + 0x1214); *(int *)((int)room + 0x1214) = iVar19 + 1; *(int *)((int)spawnedEntity + 0x20) = iVar19; EntityList::AddEntity((EntityList *)((int)room + 0x1218),(Entity *)spawnedEntity); bVar4 = Entity::IsActiveEnemy((Entity *)spawner,1); if (bVar4 != 0) { bVar4 = Entity::HasEntityFlags((Entity *)spawner,0x1000000000000000); if (bVar4 == 0) { bVar4 = Entity::HasEntityFlags((Entity *)spawner,0x20000000); if (bVar4 != 0) { addEnemyKillScore = 0; bVar4 = 0; iVar19 = -1; ref = EntityRef::EntityRef(&charmRef); Entity::AddCharmed((Entity *)spawnedEntity,ref,iVar19,bVar4,addEnemyKillScore); } } else { uVar6 = *(uint *)((int)spawnedEntity + 0x16c); flagsHigh = *(undefined4 *)((int)spawnedEntity + 0x168); *(undefined4 *)((int)spawnedEntity + 0x168) = flagsHigh; *(uint *)((int)spawnedEntity + 0x16c) = uVar6 | 0x10000000; if ((local_318 != 1.26117e-44) && (local_318 != 9.80909e-45)) { *(undefined4 *)((int)spawnedEntity + 0x168) = flagsHigh; *(uint *)((int)spawnedEntity + 0x16c) = uVar6 | 0x10000020; } EntityRef::constructor(&charmSourceRef,(spawner->_charmSource)._entity); Entity::AddCharmed((Entity *)spawnedEntity,&charmSourceRef,-1,0,0); if ((int)local_318 - 10U < 0x3de) { ANM2::LoadDeliriumForm((ANM2 *)((int)spawnedEntity + 0x48),(int)local_318,spawnVariant,1); } } local_318 = (float)__RTDynamicCast(spawner,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); local_308 = (Entity_NPC *) __RTDynamicCast(spawnedEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if ((local_318 != 0.0) && (local_308 != (Entity_NPC *)0x0)) { bVar4 = Entity::HasEntityFlags((Entity *)local_308,1); if (bVar4 == 0) { bVar4 = Entity::HasEntityFlags((Entity *)spawner,0x100000000000000); if (bVar4 != 0) { EntityRef::constructor(&brimstoneMarkRef,(Entity *)0x0); Entity::AddBrimstoneMark((Entity *)local_308,&brimstoneMarkRef,0x5a); } bVar4 = Entity::HasEntityFlags((Entity *)spawner,0x1000000); if (bVar4 == 0) goto LAB_0048996a; EntityRef::constructor(&shrinkRef,(Entity *)0x0); pEVar15 = local_308; Entity::AddShrink((Entity *)local_308,&shrinkRef,0x5a,0,0); if (0 < pEVar15->_shrinkCountdown) { flagsHigh = *(undefined4 *)((int)&pEVar15->_flags + 4); *(uint *)&pEVar15->_flags = (uint)pEVar15->_flags | 0x1000000; *(undefined4 *)((int)&pEVar15->_flags + 4) = flagsHigh; pEVar15->_shrinkStatus1 = pEVar15->_shrinkStatus2; } } else { LAB_0048996a: pEVar15 = local_308; } Entity_NPC::SetScale(pEVar15,pEVar15->_scale * *(float *)((int)local_318 + 0xf48)); pEVar15->_scaleMulti = pEVar15->_scaleMulti * *(float *)((int)local_318 + 0xf48); pEVar15->_hitPointsMulti = pEVar15->_hitPointsMulti * *(float *)((int)local_318 + 0xf44); pEVar15->_maxHitPoints = pEVar15->_maxHitPoints * *(float *)((int)local_318 + 0xf44); pEVar15->_health = pEVar15->_health * *(float *)((int)local_318 + 0xf44); cVar5 = (**(code **)(*(int *)pEVar15 + 0x4c))(); if (cVar5 != '\0') { Entity_NPC::set_entity_ptr_f54(*(undefined4 *)((int)local_318 + 0xf54)); } } } bVar4 = Game::ShouldEraseEnemy((Entity *)spawnedEntity); if (bVar4 != 0) { Entity::RemoveWithPoof((Entity *)spawnedEntity,unusedArg); } if ((*(byte *)((int)spawnedEntity + 0x172) != 0) && ((local_310->_proceduralItemManager)._proceduralItems._begin != (local_310->_proceduralItemManager)._proceduralItems._end)) { triggerKeyVariant = *(int *)((int)spawnedEntity + 0x2c); spawnTriggerTargets = &(local_310->_proceduralItemManager)._spawnTriggerTargets; triggerKeyType = *(int *)((int)spawnedEntity + 0x28); std::map::find(&pvStack_2b8,&triggerKeyType); if (pvStack_2b8 == spawnTriggerTargets->_head) { anyVariantKeyType = *(int *)((int)spawnedEntity + 0x28); local_28c = 0xffffffff; piVar11 = (int *)std::map::find(auStack_230,&anyVariantKeyType); if ((void *)*piVar11 == spawnTriggerTargets->_head) goto LAB_00489b0d; } uVar6 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = PlayerManager::GetPlayer(&g_game->_playerManager,uVar6); trigger_set_dispatch (&player->_proceduralItems,6,(Entity *)spawnedEntity,local_2b4,&g_vectorZero); uVar6 = uVar6 + 1; } while (uVar6 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } LAB_00489b0d: uVar18 = GetTimeNs(); local_2e0 = (uint)(uVar18 >> 0x20); lVar3 = (uVar18 & 0xffffffff) * 0x431bde82; pvStack_2b8 = (void *)((ulonglong)lVar3 >> 0x20); local_2b4 = (Vector *)((ulonglong)local_2e0 * 0xd7b634db >> 0x20); lVar2 = (ulonglong)local_2e0 * 0x431bde82; uVar18 = (ulonglong)local_2e0 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)(uVar18 >> 0x20); lVar3 = lVar3 + (uVar18 & 0xffffffff); local_248.x = (float)lVar3; uVar6 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar6),uVar13 + uVar6); uVar12 = (uint)((ulonglong)lVar3 >> 0x20); uVar6 = (uint)lVar3 >> 0x12 | uVar12 * 0x4000; uVar13 = uVar6 - local_2f0; bVar16 = CARRY4((uint)g_entitySpawnTimeMs,uVar13); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar13; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar12 >> 0x12) - (int)local_2f8) - (uint)(uVar6 < local_2f0)) + (uint)bVar16; npc = savedNpc; } local_298 = (undefined4)((ulonglong)lVar2 >> 0x20); local_2bc = (EntityPtr *)lVar2; piVar11 = (int *)__RTDynamicCast(local_2fc,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); fVar10 = g_vectorOne.y * 2.5; piVar11[0x39] = (int)(g_vectorOne.x * 2.5); piVar11[0x11e] = 0x3f400000; piVar11[0x3a] = (int)fVar10; (**(code **)(*piVar11 + 0xc))(); LAB_00489c07: manager = g_manager; if (npc->_dead != 0) { local_2f4 = (Room *)0x396; seed_fart_sound_override((int *)&local_2f4); SoundEffects::Play(&manager->_sfxManager,(int)local_2f4,1.0,2,0,1.0,0.0); } npc->_friction = npc->_friction * 0.5; return; } //@@ 00489ca0 NpcAI::ENTITY_POLYCEPHALUS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 269 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_POLYCEPHALUS(Entity_NPC *npc) { ANM2 *pAVar1; byte bVar2; uint uVar3; Vector *pVVar4; uint uVar5; Vector *randomDir; Entity *tmpEntity; int iVar6; ProjectileParams *projParamsRef; char *anim; int iVar7; int unused; int unused_00; int unused_01; int unused_02; Entity_NPC *summonCount; float fVar8; float fVar9; Entity_NPC *local_e8; char local_e1; Vector local_e0; char isUnderSpawnCap; float local_d4; Vector local_d0; Vector local_c8; Vector targetPos; ProjectileParams projParams; uint local_c; Manager *manager; local_c = __security_cookie ^ (uint)&local_e8; local_e8 = npc; if (npc->_variant == 1) { ENTITY_POLYCEPHALUS_the_pile(npc); return; } local_d4 = (float)npc->_type; if ((local_d4 != 5.61921e-43) || (local_e1 = '\x01', npc->_subtype != 1)) { local_e1 = '\0'; } npc->_i2 = npc->_i2 + 1; iVar6 = npc->_state; if (iVar6 == 0) { npc->_state = 3; if (((npc->_subtype == 2) && (local_d4 == 3.76949e-43)) && (npc->_spawnerType != 0x10d)) { uVar3 = Random(); uVar5 = npc->_subtype; pVVar4 = MusicManager::RandomVector(&local_e0); npc = local_e8; local_d0.x = pVVar4->x * 40.0 + (local_e8->_pos).x; local_d0.y = pVVar4->y * 40.0 + (local_e8->_pos).y; Game::SpawnEx(g_game,local_e8->_type,local_e8->_variant,&local_d0,&local_e8->_velocity, (Entity *)local_e8,uVar5,uVar3,0); } Entity_NPC::UpdateDirtColor(npc,1); return; } if (iVar6 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); if ((((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (uVar5 = Random(), uVar5 % 0x1e == 0)) { npc->_state = 4; npc->_i1 = 0; npc->_i2 = 0; } goto LAB_0048adbd; } if (iVar6 == 4) { Entity_NPC::UpdateDirtColor(npc,0); iVar6 = npc->_i1; if (iVar6 != 0) { if (iVar6 == 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = 2; npc->_i2 = 0; npc->_stateFrame = 0; } } else if (iVar6 == 2) { iVar7 = npc->_stateFrame; iVar6 = iVar7 + 1; npc->_stateFrame = iVar6; if (iVar7 < 0x32) { fVar8 = 1.0 - (float)iVar6 / 50.0; npc->_scale = fVar8; fVar8 = fVar8 * npc->_shrinkStatus1; fVar9 = fVar8 * g_vectorOne.x; (npc->_sprite)._scale.y = fVar8 * g_vectorOne.y; (npc->_sprite)._scale.x = fVar9; } ANM2::Play(&npc->_sprite,&DAT_00b1d940,0); pVVar4 = Entity_NPC::CalcTargetPosition(npc,&targetPos,0.0); randomDir = MusicManager::RandomVector(&local_c8); uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 100.0; local_d0.x = fVar9 * randomDir->x + pVVar4->x; local_d0.y = fVar9 * randomDir->y + pVVar4->y; Room::GetClampedPositionImpl(g_game->_room,&local_e0,&local_d0,20.0,20.0,20.0,20.0); npc = local_e8; local_d0.x = local_e0.x; local_d0.y = local_e0.y; PathFinder::FindGridPath((PathFinder *)&local_e8->_pathfinder,&local_d0,1.0,100,1); npc->_entityCollisionClass = 0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar9 = (npc->_pos).x - (tmpEntity->_pos).x; fVar8 = (npc->_pos).y - (tmpEntity->_pos).y; if (((fVar8 * fVar8 + fVar9 * fVar9 < 22500.0) && (uVar5 = Random(), uVar5 % 0xf == 0)) || (((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x200), bVar2 != 0 && (npc->_confusionCountdown < 5)) || ((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar2 != 0 && (npc->_fearCountdown < 5)))))) { if (npc->_type == 0x10d) { iVar7 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar6 = 0; if (0 < iVar7) { iVar6 = iVar7; } local_e1 = iVar6 < 3; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { iVar6 = 0xf4; if (npc->_subtype == 1) { iVar6 = 0x3a; } uVar5 = Entity::CountRelatedEntities((Entity *)npc,iVar6,0,unused,(void *)0x0); local_e1 = uVar5 < 3; } uVar5 = Random(); npc->_state = uVar5 & 1 | 8; if (npc->_subtype == 1) { npc->_state = 8; } uVar5 = Random(); if (((uVar5 % 5 == 0) && (local_e1 != '\0')) && (npc->_subtype != 2)) { npc->_state = 10; } } else if (local_d4 == 5.61921e-43) { uVar5 = Random(); if (((uVar5 & 1) == 0) || (iVar6 = 9, local_e1 != '\0')) { iVar6 = 8; } npc->_state = iVar6; iVar7 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar6 = 0; if (0 < iVar7) { iVar6 = iVar7; } isUnderSpawnCap = iVar6 < 3; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { iVar6 = 0x17; if (local_e1 == '\x01') { iVar6 = 0xf4; } uVar5 = Entity::CountRelatedEntities((Entity *)npc,iVar6,0,unused_00,(void *)0x0); isUnderSpawnCap = uVar5 < 3; } uVar5 = Random(); if (((uVar5 % 5 == 0) || (local_e1 != '\0')) && (isUnderSpawnCap != '\0')) { npc->_state = 0xd; } npc->_stateFrame = 0; } npc->_i1 = 0; npc->_i2 = 0; npc->_scale = 1.0; npc->_entityCollisionClass = 4; fVar9 = npc->_shrinkStatus1 * g_vectorOne.y; (npc->_sprite)._scale.x = npc->_shrinkStatus1 * g_vectorOne.x; (npc->_sprite)._scale.y = fVar9; Entity_NPC::UpdateDirtColor(npc,1); } } goto LAB_0048adbd; } ANM2::Play(&npc->_sprite,(byte *)"GoUnder",0); npc->_i1 = 1; npc->_i2 = 0; npc->_stateFrame = 0; local_e8 = (Entity_NPC *)0x42; LAB_0048abe0: manager = g_manager; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); goto LAB_0048adbd; } if (local_d4 == 3.76949e-43) { if (((iVar6 != 8) && (iVar6 != 9)) && (iVar6 != 10)) goto LAB_0048adbd; if (npc->_i1 != 0) { if (iVar6 == 8) { ANM2::Play(&npc->_sprite,s_Attack1,0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_d4 = (tmpEntity->_pos).x; local_e8 = (Entity_NPC *)(tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); pVVar4 = &npc->_pos; local_e0.x = ((tmpEntity->_velocity).x * 10.0 + local_d4) - pVVar4->x; local_e0.y = ((tmpEntity->_velocity).y * 10.0 + (float)local_e8) - (npc->_pos).y; Entity_NPC::PlaySound(npc,0x39,1.5,0x3c,0,1.0); if (npc->_subtype == 1) { projParamsRef = ProjectileParams::ProjectileParams(&projParams); local_e0.x = 10.0; local_e0.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar4,&local_e0,9,projParamsRef); } else { uVar5 = Random(); if ((uVar5 & 1) == 0) { projParamsRef = ProjectileParams::ProjectileParams(&projParams); pVVar4 = Vector::Normalized(&local_e0,&local_c8); local_d0.y = pVVar4->y * 10.0; local_d0.x = pVVar4->x * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_d0,3,projParamsRef); } else { projParamsRef = ProjectileParams::ProjectileParams(&projParams); local_e0.x = 10.0; local_e0.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar4,&local_e0,8,projParamsRef); } } } } else if (iVar6 == 9) { ANM2::Play(&npc->_sprite,s_Attack2,0); Entity_NPC::PlaySound(npc,0x107,1.0,0x3c,0,1.0); bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar2 != 0) && (bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"StopShooting"), bVar2 == 0)) { projParamsRef = ProjectileParams::ProjectileParams(&projParams); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_d4 = (tmpEntity->_pos).x; local_e8 = (Entity_NPC *)(tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_e0.x = (tmpEntity->_velocity).x * 10.0 + local_d4; local_e0.y = (tmpEntity->_velocity).y * 10.0 + (float)local_e8; Entity_NPC::FireBossProjectiles(npc,1,&local_e0,1.0,projParamsRef); } } else if (iVar6 == 10) { ANM2::Play(&npc->_sprite,&DAT_00b1d2e4,0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x92,1.0,0x3c,0,1.0); uVar5 = Random(); pVVar4 = MusicManager::RandomVector(&local_c8); uVar3 = 0xf4; if (npc->_subtype == 1) { uVar3 = 0x3a; } local_e0.x = pVVar4->x * 60.0 + (npc->_pos).x; local_e0.y = pVVar4->y * 60.0 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,uVar3,0,&local_e0,&g_vectorZero,(Entity *)npc,0,uVar5,0); (**(code **)(*(int *)tmpEntity + 0xc))(); } } goto LAB_0048ada4; } ANM2::Play(&npc->_sprite,(byte *)"ComeUp",0); Entity_NPC::PlaySound(npc,0x139,0.8,0x3c,0,1.0); } else { if ((local_d4 != 5.61921e-43) || (((iVar6 != 8 && (iVar6 != 9)) && (iVar6 != 0xd)))) goto LAB_0048adbd; iVar7 = npc->_i1; if (iVar7 != 0) { if (iVar6 == 8) { ANM2::Play(&npc->_sprite,s_Attack1,0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar2 != 0) { local_e8 = (Entity_NPC *)0x107; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); local_e8 = (Entity_NPC *)&DAT_bf800000; do { uVar5 = Random(); local_e0.x = (float)local_e8 * 120.0 + (npc->_pos).x; local_e0.y = (float)local_e8 * 0.0 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,1000,0x16,&local_e0,&g_vectorZero,(Entity *)npc,0,uVar5 ,0); fVar9 = ABS((float)local_e8) * 0.56 + 0.3; if ((float)local_e8 == 0.0) { fVar9 = 1.84; } iVar6 = *(int *)tmpEntity; fVar8 = fVar9 * g_vectorOne.x; fVar9 = fVar9 * g_vectorOne.y; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[8] = 'F'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (tmpEntity->_sprite)._scale.x = fVar8; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[0xc] = 'F'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (tmpEntity->_sprite)._scale.y = fVar9; (**(code **)(iVar6 + 0xc))(); local_e8 = (Entity_NPC *)((float)local_e8 + 0.125); } while ((float)local_e8 <= 1.0); } goto LAB_0048ada4; } if (iVar6 == 9) { if (iVar7 != 3) { if ((iVar7 == 1) || (iVar7 == 4)) { bVar2 = ANM2::IsPlaying(&npc->_sprite,(byte *)"Attack2Shooting"); if (bVar2 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Attack2Shooting",0); manager = g_manager; local_e8 = (Entity_NPC *)0x3bf; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); } npc->_stateFrame = npc->_stateFrame + 1; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { iVar6 = npc->_i1; if (iVar6 == 1) { ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x8000000; projParams.FallingAccelModifier = -0.06; projParams.CircleAngle = (float)npc->_stateFrame * 0.118; projParams.FallingSpeedModifier = -2.0; projParams.Acceleration = 0.985; local_e0.x = 6.0; local_e0.y = 3.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_e0,9,&projParams); iVar6 = npc->_i1; } if (iVar6 == 4) { ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x8000000; projParams.FallingAccelModifier = -0.06; projParams.CircleAngle = (float)npc->_stateFrame * 0.12; projParams.FallingSpeedModifier = -2.0; projParams.Acceleration = 1.025; local_e0.x = 3.2; local_e0.y = 4.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_e0,9,&projParams); } } if (npc->_stateFrame < 0x5a) goto LAB_0048adbd; } else { if ((iVar7 != 2) && (iVar7 != 5)) { if (iVar7 == 6) { ANM2::Play(&npc->_sprite,(byte *)"GoUnder2",0); manager = g_manager; if (npc->_i2 == 1) { local_e8 = (Entity_NPC *)0x42; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; npc->_i1 = 1; npc->_i2 = 0; npc->_stateFrame = 0; } } goto LAB_0048adbd; } ANM2::Play(&npc->_sprite,(byte *)"Attack2End",0); iVar6 = npc->_stateFrame + 1; npc->_stateFrame = iVar6; if ((((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) || (iVar6 < 0x1f)) goto LAB_0048adbd; } npc->_i1 = npc->_i1 + 1; npc->_i2 = 0; npc->_stateFrame = 0; goto LAB_0048adbd; } ANM2::Play(&npc->_sprite,(byte *)"Attack2Start",0); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0048adbd; npc->_i1 = npc->_i1 + 1; npc->_i2 = 0; local_e8 = (Entity_NPC *)0x1a3; goto LAB_0048abe0; } if (iVar6 != 0xd) goto LAB_0048adbd; ANM2::Play(&npc->_sprite,(byte *)"Summon",0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Summon"); manager = g_manager; if (bVar2 != 0) { local_e8 = (Entity_NPC *)0x109; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); local_e8 = (Entity_NPC *)0x2; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar2 != 0) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0xf4,0,unused_01,(void *)0x0); iVar7 = Entity::CountRelatedEntities((Entity *)npc,0x17,0,unused_02,(void *)0x0); summonCount = (Entity_NPC *)((3 - iVar6) - iVar7); if (((int)summonCount < 3) && (local_e8 = summonCount, (int)summonCount < 1)) goto LAB_0048ada4; } if (local_e1 == '\0') { do { uVar5 = Random(); pVVar4 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_c8,&npc->_pos,60.0,0,0,0); Game::SpawnEx(g_game,0x17,0,pVVar4,&g_vectorZero,(Entity *)npc,0,uVar5,0); local_e8 = (Entity_NPC *)((int)&local_e8[-1]._pickupGhostsEntity + 3); } while (local_e8 != (Entity_NPC *)0x0); } else { do { uVar5 = Random(); pVVar4 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_c8,&npc->_pos,60.0,0,0,0); Game::SpawnEx(g_game,0xf4,0,pVVar4,&g_vectorZero,(Entity *)npc,0,uVar5,0); local_e8 = (Entity_NPC *)((int)&local_e8[-1]._pickupGhostsEntity + 3); } while (local_e8 != (Entity_NPC *)0x0); } } LAB_0048ada4: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } goto LAB_0048adbd; } if ((iVar6 == 8) || (anim = "ComeUp2", iVar6 == 0xd)) { anim = "ComeUp"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); manager = g_manager; if (npc->_i2 == 1) { local_e8 = (Entity_NPC *)0x40; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); manager = g_manager; local_e8 = (Entity_NPC *)0x1a3; seed_fart_sound_override((int *)&local_e8); SoundEffects::Play(&manager->_sfxManager,(int)local_e8,1.0,2,0,1.0,0.0); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = 1; npc->_i2 = 0; } LAB_0048adbd: npc->_friction = npc->_friction * 0.8; if (npc->_dead != 0) { npc->_scale = 1.0; fVar9 = npc->_shrinkStatus1 * g_vectorOne.y; (npc->_sprite)._scale.x = npc->_shrinkStatus1 * g_vectorOne.x; (npc->_sprite)._scale.y = fVar9; } return; } //@@ 0048ae30 NpcAI::ENTITY_MAMA_GURDY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 266 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MAMA_GURDY(Entity_NPC *npc) { double dVar1; char isOverlayPlaying; byte bVar2; EntityList_EL *bodyList; uint uVar3; ProjectileParams *params; byte *pbVar4; int *debrisProjectile; int iVar5; Vector *tmpVec; Entity *pEVar6; byte *targetAnimNameChar; float fVar7; undefined4 *damageEvent; bool bVar8; float fVar9; float fVar10; undefined1 auVar11 [16]; undefined1 auVar12 [16]; Vector local_13c; undefined1 local_134 [12]; float local_128; Vector local_124; float local_11c; float local_118; float local_114; float local_110; Entity_NPC *local_10c; Entity *local_108; Vector scratchVec; Entity *mamaGurdyBody; ProjectileParams projParams; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; Game *game; void *room; int shotPattern; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af2d10; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; mamaGurdyBody = (Entity *)0x0; local_13c.x = 0.0; local_13c.y = 0.0; local_14 = 0; local_10c = npc; bodyList = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_134,0x10a ,0,-1,0,0); local_108 = bodyList->_data; local_13c.x = (float)bodyList->_capacity; fVar7 = (float)bodyList->_size; local_13c.y = fVar7; if (local_134[0] == '\0') { local_14._0_1_ = 1; tracked_alloc(1,(void *)local_134._4_4_,0); local_14 = (uint)local_14._1_3_ << 8; } if (fVar7 != 0.0) { mamaGurdyBody = (Entity *)__RTDynamicCast(*(undefined4 *)local_108); } local_14 = 0xffffffff; uVar3 = Random(); fVar7 = (float)((int)((npc->_health / npc->_maxHitPoints) * 0.5 + 0.5) * (uVar3 % 0x19 + 0x1e)); (g_game->_hud).field_0x549c = 1; local_114 = fVar7; switch(npc->_state) { case 0: *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; iVar5 = npc->_variant; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 3; npc->_entityGridCollisionClass = 0; npc->_entityCollisionClass = 2; npc->_stateFrame = (int)fVar7; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; if (iVar5 == 0) { fVar7 = (npc->_pos).x; (npc->_sprite)._offset.x = 0.0; (npc->_sprite)._offset.y = 26.0; (npc->_sizeMulti).x = 2.2; (npc->_pos).x = fVar7 + 0.0; fVar7 = (npc->_pos).y; npc->_renderZOffset = -8000; (npc->_pos).y = fVar7 - 40.0; ANM2::PlayOverlay(&npc->_sprite,(byte *)"Organs",0); uVar3 = Random(); game = g_game; tmpVec = Room::GetCenterPos(&local_13c); scratchVec.x = tmpVec->x * 0.5; scratchVec.y = 175.0; local_108 = Game::Spawn(game,0x10a,1,&scratchVec,&g_vectorZero,(Entity *)local_10c,0,uVar3); uVar3 = Random(); game = g_game; tmpVec = Room::GetCenterPos((Vector *)(local_134 + 8)); local_124.x = tmpVec->x * 1.5; local_124.y = 175.0; pEVar6 = Game::Spawn(game,0x10a,2,&local_124,&g_vectorZero,(Entity *)local_10c,0,uVar3); local_108->_visible = 0; pEVar6->_visible = 0; tmpVec = Room::GetCenterPos(&local_13c); fVar7 = tmpVec->x + 0.0; (local_10c->_targetPosition).y = 155.0; (local_10c->_targetPosition).x = fVar7; (local_10c->_v1).x = fVar7; (local_10c->_v1).y = (local_10c->_targetPosition).y; npc = local_10c; break; } fVar7 = *(float *)((int)g_game->_room + 0x18) + 8.0; (npc->_pos).y = fVar7; (npc->_v1).x = (npc->_pos).x; (npc->_v1).y = (npc->_pos).y; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_visible = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; if (mamaGurdyBody != (Entity *)0x0) { fVar9 = (mamaGurdyBody->_pos).y; (npc->_targetPosition).x = (npc->_pos).x - (mamaGurdyBody->_pos).x; (npc->_targetPosition).y = fVar7 - fVar9; } npc->_canShutDoors = 0; if (npc->_variant == 2) { (npc->_sprite)._flipX = 1; } goto LAB_0048c1bf; case 3: if (npc->_variant == 0) { isOverlayPlaying = FUN_0040a9f0(); if (isOverlayPlaying == '\0') { ANM2::PlayOverlay(&npc->_sprite,(byte *)"Organs",0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); } iVar5 = npc->_stateFrame; npc->_stateFrame = iVar5 + -1; if (iVar5 < 0) { uVar3 = Random(); uVar3 = uVar3 % 3; if (uVar3 == npc->_i2) { uVar3 = Random(); uVar3 = uVar3 % 3; } npc->_i2 = uVar3; if (uVar3 == 0) { npc->_state = 8; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } uVar3 = Random(); npc->_i1 = (uVar3 & 3) * 2 + 1; uVar3 = Random(); if (uVar3 % 100 < 0x1e) { npc->_i1 = 0; } } else if (uVar3 == 1) { npc->_state = 9; bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else if (uVar3 == 2) { npc->_state = 10; uVar3 = Random(); if (uVar3 % 100 < 0x14) { npc->_i1 = 1; pbVar4 = s_Attack1; } else { npc->_i1 = 0; pbVar4 = &DAT_00b1d998; } bVar2 = ANM2::SetAnimation(&npc->_sprite,pbVar4,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_stateFrame = 0; } } } else { npc->_visible = 0; } break; case 8: if (npc->_variant == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = (int)fVar7; } iVar5 = ANM2::GetFrame(&npc->_sprite); if (iVar5 == 0x1f) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar7 = (pEVar6->_pos).y; fVar9 = (npc->_pos).y; (npc->_v2).x = (pEVar6->_pos).x - (npc->_pos).x; (npc->_v2).y = fVar7 - fVar9; } shotPattern = npc->_i1; if (shotPattern < 2) { bVar8 = iVar5 == 0x1f; LAB_0048b4a4: if (!bVar8) break; } else if (shotPattern == 3) { if ((iVar5 != 0x1f) && (iVar5 != 0x24)) { bVar8 = iVar5 == 0x29; goto LAB_0048b4a4; } } else if (shotPattern == 5) { if (((iVar5 != 0x1f) && (iVar5 != 0x22)) && (iVar5 != 0x25)) { bVar8 = iVar5 == 0x28; LAB_0048b49f: if (!bVar8) { bVar8 = iVar5 == 0x2b; goto LAB_0048b4a4; } } } else { if (shotPattern != 7) break; if ((((iVar5 != 0x1f) && (iVar5 != 0x21)) && (iVar5 != 0x23)) && ((iVar5 != 0x25 && (iVar5 != 0x27)))) { bVar8 = iVar5 == 0x29; goto LAB_0048b49f; } } Entity_NPC::PlaySound(npc,0x10,1.0,0x14,0,1.0); if (npc->_i1 == 0) { local_108 = (Entity *)(npc->_pos).x; local_110 = (npc->_pos).y; (npc->_pos).x = (float)local_108 - 0.0; (npc->_pos).y = (npc->_pos).y - -40.0; ProjectileParams::ProjectileParams(&projParams); projParams.VelocityMulti = 1.8; pEVar6 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; scratchVec.x = ((pEVar6->_pos).x - scratchVec.x) * 0.7 + scratchVec.x; scratchVec.y = ((pEVar6->_pos).y - scratchVec.y) * 0.7 + scratchVec.y; Entity_NPC::FireBossProjectiles(npc,0xc,&scratchVec,10.0,&projParams); (npc->_pos).x = (float)local_108; (npc->_pos).y = local_110; } else { params = ProjectileParams::ProjectileParams(&projParams); tmpVec = Vector::Normalized(&npc->_v2,&local_13c); scratchVec.x = tmpVec->x * 8.5; scratchVec.y = tmpVec->y * 8.5; local_124.x = (npc->_pos).x - 0.0; local_124.y = (npc->_pos).y - -40.0; Entity_NPC::FireProjectiles(npc,&local_124,&scratchVec,5,params); } } else { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Smash"); if (bVar2 == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); goto LAB_0048c1af; } } else { iVar5 = 0x48b68a; Entity_NPC::PlaySound(npc,0x30,0.7,0x14,0,1.0); Game::DamageRadius(&npc->_pos,(Entity *)npc,0,0,iVar5,50.0,g_tearFlagsNone,45.0,150.0); } } break; case 9: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = (int)fVar7; } iVar5 = ANM2::GetFrame(&npc->_sprite); if (iVar5 == 0x14) { Entity_NPC::PlaySound(npc,0x133,1.0,0x3c,0,1.0); iVar5 = 0x14; do { room = g_game->_room; local_110 = *(float *)((int)room + 0x14); local_118 = *(float *)((int)room + 0x18) + 40.0; local_108 = *(Entity **)((int)room + 0x1c); local_11c = *(float *)((int)room + 0x20); uVar3 = Random(); local_10c = (Entity_NPC *) ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10); uVar3 = Random(); scratchVec.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * ((float)local_108 - local_110) + local_110; scratchVec.y = (local_11c - local_118) * (float)local_10c + local_118; Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_134 + 8),&scratchVec,0.0,0,0,0); uVar3 = Random(); Game::Spawn(g_game,1000,0x37,(Vector *)(local_134 + 8),&g_vectorZero,(Entity *)npc,0,uVar3); iVar5 = iVar5 + -1; } while (iVar5 != 0); } break; case 10: if (npc->_i1 == 1) { iVar5 = npc->_stateFrame; if (iVar5 == 0) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); iVar5 = npc->_stateFrame; } fVar9 = (npc->_v1).y; fVar10 = ((float)iVar5 - 0.0) / 45.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } (npc->_targetPosition).y = ((fVar9 - 280.0) - fVar9) * fVar10 + fVar9; if (iVar5 == 0x23) { Entity_NPC::PlaySound(npc,0x133,1.0,0x3c,0,1.0); iVar5 = 0x14; do { room = g_game->_room; local_110 = *(float *)((int)room + 0x14); local_118 = *(float *)((int)room + 0x18) + 40.0; local_108 = *(Entity **)((int)room + 0x1c); local_11c = *(float *)((int)room + 0x20); uVar3 = Random(); local_10c = (Entity_NPC *) ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10); uVar3 = Random(); scratchVec.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * ((float)local_108 - local_110) + local_110; scratchVec.y = (local_11c - local_118) * (float)local_10c + local_118; Room::FindFreePickupSpawnPosition(g_game->_room,&local_13c,&scratchVec,0.0,0,0,0); uVar3 = Random(); Game::Spawn(g_game,1000,0x37,&local_13c,&g_vectorZero,(Entity *)npc,0,uVar3); iVar5 = iVar5 + -1; } while (iVar5 != 0); iVar5 = npc->_stateFrame; fVar7 = local_114; } npc->_stateFrame = iVar5 + 1; if (0x2c < iVar5 + 1) { npc->_i1 = 2; uVar3 = Random(); npc->_stateFrame = uVar3 % 0x3c; } } if ((npc->_i1 == 2) && (npc->_stateFrame = npc->_stateFrame + -1, npc->_stateFrame < 1)) { npc->_i1 = 3; ANM2::Play(&npc->_sprite,&DAT_00b1d998,0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { LAB_0048bb56: pbVar4 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } targetAnimNameChar = &DAT_00b1d998; do { bVar2 = *pbVar4; bVar8 = bVar2 < *targetAnimNameChar; if (bVar2 != *targetAnimNameChar) { LAB_0048bb86: uVar3 = -(uint)bVar8 | 1; goto LAB_0048bb8b; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar8 = bVar2 < targetAnimNameChar[1]; if (bVar2 != targetAnimNameChar[1]) goto LAB_0048bb86; pbVar4 = pbVar4 + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048bb8b: if (uVar3 != 0) break; } else { pbVar4 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } targetAnimNameChar = &DAT_00b1d998; do { bVar2 = *pbVar4; bVar8 = bVar2 < *targetAnimNameChar; if (bVar2 != *targetAnimNameChar) { LAB_0048bb40: uVar3 = -(uint)bVar8 | 1; goto LAB_0048bb45; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar8 = bVar2 < targetAnimNameChar[1]; if (bVar2 != targetAnimNameChar[1]) goto LAB_0048bb40; pbVar4 = pbVar4 + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048bb45: if (uVar3 != 0) { if ((npc->_sprite)._animState._isPlaying != 0) break; goto LAB_0048bb56; } } if (npc->_i1 == 3) { iVar5 = ANM2::GetFrame(&npc->_sprite); if (iVar5 == 0x22) { Game::ShakeScreen(g_game,8); Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); } local_108 = (Entity *)(npc->_v1).y; local_114 = (float)local_108 - 280.0; iVar5 = ANM2::GetFrame(&npc->_sprite); fVar9 = ((float)iVar5 - 34.0) / 10.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } (npc->_targetPosition).y = ((float)local_108 - local_114) * fVar9 + local_114; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = (int)fVar7; } uVar3 = ANM2::GetFrame(&npc->_sprite); if (((0x29 < (int)uVar3) && ((int)uVar3 < 0x42)) && ((uVar3 & 1) != 0)) { Entity_NPC::PlaySound(npc,0x134,1.0,0x3c,0,1.0); local_124.y = sqrtf(2500.0); local_108 = (Entity *)0x3; do { local_10c = (Entity_NPC *)0x0; local_110 = 50.0; if (0.0 < local_124.y) { local_110 = (1.0 / local_124.y) * 50.0; local_10c = (Entity_NPC *)((1.0 / local_124.y) * 0.0); } uVar3 = Random(); local_118 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_118 = local_118 + local_118; uVar3 = Random(); local_11c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; fVar7 = cos(local_118); local_134._8_4_ = fVar7 * local_11c * 6.5 + (float)local_10c * 9.0; fVar7 = sin(local_118); local_128 = fVar7 * local_11c * 6.5 + local_110 * 9.0; uVar3 = Random(); local_114 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_114 = local_114 + local_114; scratchVec.x = cos(local_114); scratchVec.y = sin(local_114); uVar3 = Random(); local_114 = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 + 1.0) * scratchVec.x; scratchVec.x = local_114; fVar7 = sqrtf(local_114 * local_114 + scratchVec.y * scratchVec.y); if (0.0 < fVar7) { scratchVec.x = local_114 * (1.0 / fVar7); scratchVec.y = scratchVec.y * (1.0 / fVar7); } uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 + 1.0; scratchVec.x = (((npc->_pos).x + 0.0) - 0.0) + fVar7 * scratchVec.x; scratchVec.y = (((npc->_pos).y - 10.0) - -40.0) + scratchVec.y * fVar7; uVar3 = Random(); auVar11._8_8_ = 0xc5d70c; auVar11._0_8_ = 0xc5d5dc00000000; auVar12._12_4_ = 0; auVar12._0_12_ = auVar11._4_12_; auVar12 = auVar12 << 0x20; pEVar6 = Game::Spawn(g_game,9,0,&scratchVec,(Vector *)(local_134 + 8),(Entity *)npc,0, uVar3); debrisProjectile = (int *)__RTDynamicCast(pEVar6,auVar12); local_30 = 0x3f26a6a7; local_2c = 0x3ed0d0d2; local_28 = 0x3e24a4a5; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_50 = 0x3f000000; uStack_4c = 0x3f000000; uStack_48 = 0x3f000000; uStack_44 = 0x3f800000; (**(code **)(*debrisProjectile + 0x3c))(&local_50,0xffffffff); debrisProjectile[0x108] = 0x40000000; debrisProjectile[0x104] = (int)((float)debrisProjectile[0x104] - 20.0); uVar3 = Random(); debrisProjectile[0x10e] = debrisProjectile[0x10e] | 0x4000; local_108 = (Entity *)((int)local_108 + -1); dVar1 = __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]; debrisProjectile[0x10f] = debrisProjectile[0x10f]; debrisProjectile[0x105] = (int)((float)((double)(int)uVar3 + dVar1) * 2.3283064e-10 * 7.0 + (float)debrisProjectile[0x105]); } while (local_108 != (Entity *)0x0); local_108 = (Entity *)0x0; } } break; case 0xd: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = (int)fVar7; LAB_0048c1af: npc->_state = 3; } else { iVar5 = ANM2::GetFrame(&npc->_sprite); if (iVar5 == 0x19) { Entity_NPC::PlaySound(npc,0x133,1.0,0x3c,0,1.0); local_134._8_4_ = 0x435c0000; local_128 = 240.0; Room::FindFreePickupSpawnPosition (g_game->_room,&scratchVec,(Vector *)(local_134 + 8),0.0,1,0,0); uVar3 = Random(); Game::Spawn(g_game,0x20,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar3); local_134._8_4_ = 420.0; local_128 = 240.0; tmpVec = Room::FindFreePickupSpawnPosition (g_game->_room,&local_13c,(Vector *)(local_134 + 8),0.0,1,0,0); scratchVec.x = tmpVec->x; scratchVec.y = tmpVec->y; uVar3 = Random(); Game::Spawn(g_game,0x20,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar3); } } } LAB_0048c1bf: if (npc->_variant != 0) { if (mamaGurdyBody == (Entity *)0x0) { (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { (**(code **)(*(int *)mamaGurdyBody + 0x20))(*damageEvent,damageEvent[2]); damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } (npc->_damageEvents)._end = (npc->_damageEvents)._begin; fVar7 = npc->_maxHitPoints; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; npc->_dead = 0; npc->_health = fVar7; if (npc->_variant != 0) goto LAB_0048c2fd; } fVar7 = npc->_friction; fVar9 = (npc->_pos).x; (npc->_pos).y = (npc->_targetPosition).y; game = g_game; npc->_friction = fVar7 * 0.8; (npc->_velocity).y = 0.0; fVar7 = *(float *)((int)game->_room + 0x14) + 60.0; if (fVar9 <= fVar7) { fVar9 = fVar7; } fVar7 = *(float *)((int)game->_room + 0x1c) - 60.0; if (fVar7 <= fVar9) { fVar9 = fVar7; } (npc->_pos).x = fVar9; pEVar6 = Entity_NPC::GetPlayerTarget(npc); bVar2 = npc->_dead; fVar7 = ((pEVar6->_pos).x - (npc->_pos).x) * 0.05; if (fVar7 <= -2.0) { fVar7 = -2.0; } if (2.0 <= fVar7) { fVar7 = 2.0; } (npc->_velocity).x = fVar7; if (bVar2 != 0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } if (npc->_variant == 0) { ExceptionList = local_1c; return; } LAB_0048c2fd: if (mamaGurdyBody != (Entity *)0x0) { fVar7 = (mamaGurdyBody->_pos).y; fVar9 = (npc->_targetPosition).y; (npc->_pos).x = (mamaGurdyBody->_pos).x + (npc->_targetPosition).x; (npc->_pos).y = fVar7 + fVar9; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } ExceptionList = local_1c; return; } //@@ 0048c3b0 NpcAI::ENTITY_BROWNIE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 402 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BROWNIE(Entity_NPC *npc) { char cVar1; code *pcVar2; Room *this; undefined4 uVar3; undefined1 auVar4 [16]; undefined1 auVar5 [16]; uint3 uVar6; undefined1 *puVar7; undefined1 uVar8; byte bVar9; EntityList_EL *subList; uint uVar10; Vector *pVVar11; Entity *subList; byte *pbVar13; int iVar14; byte *pbVar15; int *piVar16; uint rngResult; Vector *pVVar17; Entity_NPC *spawnedNpc; Entity_Effect *splat; undefined4 *queryIt; float fVar18; EntityList *entityList; undefined4 *writeIt; char *pcVar19; int unused; void *pvVar20; int iVar21; undefined4 *puVar22; bool bVar23; float fVar24; float fVar25; float fVar26; undefined8 in_stack_fffffe14; undefined1 auVar28 [13]; undefined1 auVar29 [16]; undefined1 auVar30 [16]; undefined1 auVar31 [16]; undefined1 auVar32 [16]; undefined1 auVar33 [16]; undefined1 auVar34 [16]; undefined1 auVar35 [16]; undefined1 auVar36 [16]; undefined1 auVar37 [16]; undefined1 auVar38 [16]; undefined8 uVar27; undefined1 auVar39 [16]; undefined1 auVar40 [16]; undefined1 auVar41 [16]; undefined1 auVar42 [16]; undefined1 auVar43 [16]; undefined1 auVar44 [16]; undefined1 auVar45 [16]; undefined1 auVar46 [16]; undefined1 auVar47 [16]; undefined1 auVar48 [16]; undefined1 auVar49 [16]; undefined1 auVar50 [16]; undefined1 auVar51 [16]; Vector local_1d0; undefined4 local_1c8 [11]; EntityList_EL dipList; EntityList_EL queryList; undefined1 local_17c; undefined4 *local_178; Vector local_174; void *relatedBegin; undefined4 *relatedEnd; undefined4 *relatedCapEnd; void *local_160; uint creepVariant; undefined4 *local_158; float local_154; Entity_NPC *savedNpc; undefined4 *local_14c; float local_148; float local_144; float local_140; float local_13c; undefined1 local_138 [12]; Vector *local_12c; Vector local_128; Vector local_120; float local_114; float local_110; byte local_109; float local_108; byte local_101; float local_100; Vector *local_fc; ProjectileParams projParams; float local_50; EntityRef EStack_4c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af2d66; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; local_114 = (float)npc->_subtype; if (npc->_state == 0) { npc->_state = 3; uVar8 = 3; if (&npc->_splatColor != (ColorMod *)local_1c8) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.6; (npc->_splatColor)._offset[1] = 0.4; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; uVar8 = (undefined1)npc->_state; } *(undefined1 *)&npc->_i2 = 0xff; *(undefined1 *)((int)&npc->_i2 + 2) = uVar8; npc->_renderZOffset = 2000; return; } uVar10 = *(uint *)((int)&npc->_flags + 4); creepVariant = 0x1a; if (local_114 != 1.4013e-45) { creepVariant = 0x5e; } fVar18 = *(float *)&npc->_flags; if (((uint)fVar18 & 0x40) != 0) { creepVariant = 0x17; } if (((uint)fVar18 & 0x80) != 0) { creepVariant = 0x19; } local_144 = npc->_maxHitPoints; local_100 = local_144 * 0.95; local_12c = (Vector *)(local_144 / 10.0); local_158 = (undefined4 *)(local_144 * 0.25); local_108 = local_144 - (float)((byte)npc->_i1 + 1) * (local_144 / 50.0); local_144 = local_144 - (float)(*(byte *)((int)&npc->_i1 + 1) + 1) * (float)local_12c; local_fc = (Vector *)(local_144 + (float)local_12c); fVar24 = npc->_health; local_140 = fVar24; ExceptionList = &local_1c; savedNpc = npc; puVar7 = (undefined1 *)((int)register0x00000010 + -4); if (local_144 == (float)local_fc) { auVar29._8_4_ = 0x10; auVar29._0_8_ = in_stack_fffffe14; auVar29._12_4_ = "Start and End parameters cannot be the same!"; auVar30._8_8_ = auVar29._8_8_; auVar30._0_8_ = 0x48c5a200000000; KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); in_stack_fffffe14 = auVar30._0_8_; fVar24 = npc->_health; fVar18 = *(float *)&npc->_flags; uVar10 = *(uint *)((int)&npc->_flags + 4); puVar7 = puStack_20; } puStack_20 = puVar7; fVar25 = local_114; local_154 = 7.00649e-45; local_128.y = 1.4013e-45; if (local_100 < fVar24) { local_128.y = 7.00649e-45; } if (local_114 == 1.4013e-45) { local_128.y = 1.4013e-45; } local_140 = (local_140 - local_144) / ((float)local_fc - local_144); local_fc = (Vector *)&DAT_0000000f; local_13c = 4.2039e-45; if (local_114 != 1.4013e-45) { local_13c = 2.10195e-44; } local_120.x = fVar18; if ((((fVar24 <= (float)local_158) || (npc->_dead != 0)) && (npc->_state != 0x10)) && (npc->_deliriumBossType == 0)) { uVar10 = *(uint *)((int)&npc->_flags + 4); local_120.x = *(float *)&npc->_flags; fVar18 = (float)(uVar10 & 0x20000000); if (fVar18 == 0.0) { npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_state = 0x10; } } local_160 = (void *)0x0; relatedBegin = (void *)0x0; local_14c = (undefined4 *)0x0; relatedEnd = (undefined4 *)0x0; local_158 = (undefined4 *)0x0; relatedCapEnd = (undefined4 *)0x0; local_14 = 0; if ((uVar10 & 0x10000000) == 0) { local_17c = 0; local_178 = (undefined4 *)0x0; local_174.x = 0.0; local_174.y = 0.0; local_14 = 1; auVar34._8_8_ = 1; auVar34._0_8_ = 0xffffffff00000000; entityList = (EntityList *)((int)g_game->_room + 0x1218); auVar33._4_12_ = auVar34._4_12_; auVar33._0_4_ = 0xffffffff; if (local_114 == 1.4013e-45) { subList = EntityList::QuerySublist(entityList,&queryList,0x17,-1,-1,1,0); local_17c = 1; queryIt = subList->_data; local_174.x = (float)subList->_capacity; local_174.y = (float)subList->_size; local_178 = queryIt; local_110 = local_174.y; if (queryList._0_1_ == '\0') { local_14._0_1_ = 2; goto LAB_0048c81f; } } else { subList = EntityList::QuerySublist(entityList,&dipList,0xd9,-1,-1,1,0); local_17c = 1; queryIt = subList->_data; local_174.x = (float)subList->_capacity; local_174.y = (float)subList->_size; local_178 = queryIt; local_110 = local_174.y; if (dipList._0_1_ == '\0') { local_14._0_1_ = 3; queryList._data = dipList._data; LAB_0048c81f: queryIt = local_178; local_17c = 1; auVar33 = ZEXT816(0x48c82a00000000); local_174.y = local_110; tracked_alloc(1,queryList._data,0); local_14 = CONCAT31(local_14._1_3_,1); } } if (local_110 == 0.0) { pvVar20 = (void *)0x0; } else { puVar22 = (undefined4 *)0x0; writeIt = (undefined4 *)0x0; do { if (writeIt == puVar22) { auVar35._0_8_ = auVar33._0_8_; auVar35._8_4_ = writeIt; auVar35._12_4_ = queryIt; auVar33._8_8_ = auVar35._8_8_; auVar33._0_8_ = 0x48c86000000000; std::vector::_Emplace_reallocate(); puVar22 = relatedCapEnd; } else { *writeIt = *queryIt; relatedEnd = writeIt + 1; } queryIt = queryIt + 1; local_110 = (float)((int)local_110 + -1); writeIt = relatedEnd; } while (local_110 != 0.0); local_160 = relatedBegin; pvVar20 = relatedBegin; npc = savedNpc; local_158 = puVar22; local_14c = relatedEnd; } local_14 = local_14 & 0xffffff00; fVar25 = local_114; } else { auVar31._8_4_ = fVar18; auVar31._0_8_ = in_stack_fffffe14; auVar31._12_4_ = &relatedBegin; auVar32._8_8_ = auVar31._8_8_; auVar32._0_8_ = 0xffffffff00000000; auVar33._4_12_ = auVar32._4_12_; if (local_114 == 1.4013e-45) { auVar33._0_4_ = 0x17; } else { auVar33._0_4_ = 0xd9; } Entity::CountRelatedEntities ((Entity *)npc,auVar33._0_4_,auVar33._4_4_,auVar33._8_4_,auVar33._12_4_); local_158 = relatedCapEnd; local_13c = 8.40779e-45; local_160 = relatedBegin; local_14c = relatedEnd; pvVar20 = relatedBegin; } uVar27 = auVar33._0_8_; local_14c = (undefined4 *)((int)local_14c - (int)pvVar20 >> 2); local_110 = (float)local_14c; if ((npc->_health <= local_108) && (npc->_state != 0x10)) { local_fc = (Vector *)0x0; do { uVar27 = auVar33._0_8_; if ((int)local_13c <= (int)local_110) break; uVar10 = Random(); fVar18 = npc->_size + 5.0; auVar36._4_12_ = SUB1612(ZEXT816(0),4); auVar36._0_4_ = fVar18; if (fVar25 == 1.4013e-45) { pVVar11 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_1d0,&npc->_pos,fVar18,0,0,0); auVar37._0_8_ = auVar36._0_8_; auVar37._8_4_ = 0; auVar37._12_4_ = uVar10; auVar4._4_8_ = auVar37._8_8_; auVar4._0_4_ = npc; auVar4._12_4_ = 0; auVar33 = auVar4 << 0x20; subList = Game::Spawn(g_game,0x17,0,pVVar11,&g_vectorZero,(Entity *)npc,0,uVar10); if (subList != (Entity *)0x0) { *(uint *)&subList->_flags = (uint)subList->_flags & 0xfffffffb; local_110 = (float)((int)local_110 + 1); *(undefined4 *)((int)&subList->_flags + 4) = *(undefined4 *)((int)&subList->_flags + 4); (subList->_velocity).x = (npc->_velocity).x; (subList->_velocity).y = (npc->_velocity).y; local_108 = (subList->_pos).x - (npc->_pos).x; local_100 = (subList->_pos).y - (npc->_pos).y; fVar18 = sqrtf(local_108 * local_108 + local_100 * local_100); if (0.0 < fVar18) { local_100 = (7.0 / fVar18) * local_100; local_108 = (7.0 / fVar18) * local_108; } uVar10 = Random(); local_148 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_148 = local_148 + local_148; local_120.y = cos(local_148); fVar24 = sin(local_148); fVar18 = subList->_friction; if (fVar18 != 0.0) { fVar25 = subList->_speedMultiplier; (subList->_velocity).x = ((local_120.y + local_108) * fVar25) / fVar18 + (subList->_velocity).x; (subList->_velocity).y = ((fVar24 + local_100) * fVar25) / fVar18 + (subList->_velocity).y; } iVar14 = npc->_championColorIdx; if (iVar14 != 0x12) goto LAB_0048cd09; local_108 = 1.5; goto LAB_0048cd1e; } } else { pVVar11 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_174,&npc->_pos,fVar18,0,0,0); auVar38._0_8_ = auVar36._0_8_; auVar38._8_4_ = 0; auVar38._12_4_ = uVar10; auVar5._4_8_ = auVar38._8_8_; auVar5._0_4_ = npc; auVar5._12_4_ = 0; auVar33 = auVar5 << 0x20; subList = Game::Spawn(g_game,0xd9,2,pVVar11,&g_vectorZero,(Entity *)npc,0,uVar10); if (subList != (Entity *)0x0) { *(uint *)&subList->_flags = (uint)subList->_flags & 0xfffffffb; local_110 = (float)((int)local_110 + 1); *(undefined4 *)((int)&subList->_flags + 4) = *(undefined4 *)((int)&subList->_flags + 4); (subList->_velocity).x = (npc->_velocity).x; (subList->_velocity).y = (npc->_velocity).y; local_100 = (subList->_pos).x - (npc->_pos).x; local_108 = (subList->_pos).y - (npc->_pos).y; fVar18 = sqrtf(local_100 * local_100 + local_108 * local_108); if (0.0 < fVar18) { local_108 = (7.0 / fVar18) * local_108; local_100 = (7.0 / fVar18) * local_100; } uVar10 = Random(); local_120.y = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_120.y = local_120.y + local_120.y; local_148 = cos(local_120.y); fVar24 = sin(local_120.y); fVar18 = subList->_friction; if (fVar18 != 0.0) { fVar25 = subList->_speedMultiplier; (subList->_velocity).x = ((local_148 + local_100) * fVar25) / fVar18 + (subList->_velocity).x; (subList->_velocity).y = ((fVar24 + local_108) * fVar25) / fVar18 + (subList->_velocity).y; } iVar14 = npc->_championColorIdx; if (iVar14 == 0x12) { local_108 = 1.5; } else { LAB_0048cd09: local_108 = 1.0; if (iVar14 == 0x13) { local_108 = 0.5; } } LAB_0048cd1e: manager = g_manager; local_100 = 3.32108e-43; seed_fart_sound_override((int *)&local_100); auVar33._4_12_ = SUB1612(ZEXT416((uint)local_108) << 0x40,4); auVar33._0_4_ = 10; SoundEffects::Play(&manager->_sfxManager,(int)local_100,0.8,10,0,local_108,0.0); } } uVar27 = auVar33._0_8_; local_fc = (Vector *)((int)&local_fc->x + 1); fVar25 = local_114; } while ((int)local_fc < (int)local_128.y); *(char *)&npc->_i1 = (char)npc->_i1 + '\x01'; } if ((npc->_sprite)._animState._animData != (void *)0x0) { auVar39._8_4_ = 0x48cdb6; auVar39._0_8_ = uVar27; auVar39._12_4_ = "Splat"; bVar9 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Splat"); manager = g_manager; uVar27 = auVar39._0_8_; if (bVar9 != 0) { local_13c = 1.0; if (npc->_championColorIdx == 0x12) { local_13c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_13c = 0.5; } local_fc = (Vector *)0x48; seed_fart_sound_override((int *)&local_fc); auVar40._4_12_ = SUB1612(ZEXT416((uint)local_13c) << 0x40,4); auVar40._0_4_ = 2; SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,local_13c,0.0); uVar27 = auVar40._0_8_; } } game = g_game; iVar14 = npc->_state; if ((npc->_flags & 0x1000000000000000) == 0) { LAB_0048ce8f: if (iVar14 == 3) goto LAB_0048ce98; if (iVar14 == 10) { npc->_friction = npc->_friction * 0.7; pbVar13 = (npc->_sprite)._animState._animData; if (pbVar13 == (byte *)0x0) { LAB_0048d27e: bVar9 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SpinStart",1); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar15 = pbVar13; if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar15 = *(byte **)pbVar13; } pcVar19 = "SpinStart"; do { bVar9 = *pbVar15; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048d260: uVar10 = -(uint)bVar23 | 1; goto LAB_0048d265; } if (bVar9 == 0) break; bVar9 = pbVar15[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048d260; pbVar15 = pbVar15 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048d265: if ((uVar10 != 0) || ((pbVar13[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048d27e; } npc->_renderZOffset = 2000; if (*(char *)((int)&npc->_i1 + 2) == '\0') { uVar10 = Random(); *(char *)&npc->_i2 = (char)(uVar10 % 0xc); uVar10 = Random(); *(char *)((int)&npc->_i1 + 3) = ((char)(uVar10 % 3) - (char)(int)((1.0 - npc->_health / npc->_maxHitPoints) * -6.0)) + '\x03'; *(undefined1 *)((int)&npc->_i1 + 2) = 1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar9 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar9 == 0)) { manager = g_manager; if (npc->_entityCollisionClass == 0) { local_fc = (Vector *)0x48; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); uVar10 = Random(); auVar44._8_8_ = 0xc5d5ac; auVar44._0_8_ = 0xc5d5dc00000000; auVar45._12_4_ = 0; auVar45._0_12_ = auVar44._4_12_; auVar45 = auVar45 << 0x20; subList = Game::Spawn(g_game,1000,creepVariant,&npc->_pos,&g_vectorZero,(Entity *)npc,0, uVar10); piVar16 = (int *)__RTDynamicCast(subList,auVar45); if (piVar16 != (int *)0x0) { piVar16[0x39] = 0x40400000; piVar16[0x3a] = 0x40400000; (**(code **)(*piVar16 + 0xc))(); } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_138, &npc->_pos,npc->_size * 1.1,0xffffffff); local_14._0_1_ = 5; local_fc = (Vector *)0x0; pVVar11 = local_12c; if (local_12c != (Vector *)0x0) { do { iVar14 = *(int *)(local_138._4_4_ + (int)local_fc * 4); if (*(int *)(iVar14 + 0x28) == 0xd9) { npc->_health = *(float *)(iVar14 + 0x380) + npc->_health; pcVar2 = *(code **)(**(int **)(local_138._4_4_ + (int)local_fc * 4) + 0x24); EntityRef::constructor(&EStack_4c,(Entity *)savedNpc); (*pcVar2)(); pVVar11 = local_12c; npc = savedNpc; } local_fc = (Vector *)((int)&local_fc->x + 1); } while (local_fc < pVVar11); } uVar6 = local_14._1_3_; local_14 = (uint)local_14._1_3_ << 8; if (local_138[0] == '\0') { local_14._0_1_ = 6; local_14._1_3_ = uVar6; tracked_alloc(1,(void *)local_138._4_4_,0); local_14 = (uint)local_14._1_3_ << 8; } } npc->_entityCollisionClass = 4; uVar10 = Random(); local_128.y = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_128.y = local_128.y + local_128.y; local_120.y = cos(local_128.y); fVar18 = sin(local_128.y); (npc->_targetPosition).x = local_120.y; (npc->_targetPosition).y = fVar18; } else { if (npc->_collidesWithGrid != 0) { local_128.y = (npc->_gridCollisionNormal).x; local_120.y = (npc->_gridCollisionNormal).y; fVar18 = sqrtf(local_128.y * local_128.y + local_120.y * local_120.y); if (fVar18 <= 0.0) { fVar18 = local_120.y; } else { local_128.y = (npc->_gridCollisionNormal).x * (1.0 / fVar18); fVar18 = (npc->_gridCollisionNormal).y * (1.0 / fVar18); } fVar24 = (npc->_targetPosition).y; fVar25 = (npc->_targetPosition).x; fVar26 = fVar25 * local_128.y + fVar24 * fVar18; fVar18 = fVar26 * fVar18; fVar26 = fVar26 * local_128.y; (npc->_targetPosition).y = fVar24 - (fVar18 + fVar18); (npc->_targetPosition).x = fVar25 - (fVar26 + fVar26); } fVar18 = npc->_friction; fVar24 = (npc->_targetPosition).y; if (fVar18 != 0.0) { fVar25 = npc->_speedMultiplier; (npc->_velocity).x = ((npc->_targetPosition).x * 2.5 * fVar25) / fVar18 + (npc->_velocity).x; (npc->_velocity).y = (fVar24 * 2.5 * fVar25) / fVar18 + (npc->_velocity).y; } bVar9 = (byte)npc->_i2; local_148 = ((float)bVar9 / 12.0) * 3.1415927; local_128.y = ((float)bVar9 / 12.0) * -360.0 * 0.017453292; local_109 = bVar9; local_120.y = cos(local_128.y); fVar18 = sin(local_128.y); local_12c = (Vector *)(fVar18 * 0.0 + local_120.y * 10.0); local_138._8_4_ = local_120.y * 0.0 - fVar18 * 10.0; fVar18 = sin(local_148 + local_148); local_120.y = (npc->_pos).y + 0.0; local_120.x = fVar18 * npc->_size + (npc->_pos).x; fVar18 = fmodf((float)bVar9,12.0 / (float)*(byte *)((int)&npc->_i1 + 3)); if (1.0 <= fVar18) { bVar9 = local_109; } else { ProjectileParams::ProjectileParams(&projParams); uVar10 = npc->_bosscoloridx; projParams.Variant = 5; projParams.Scale = 1.1; projParams.HeightModifier = -35.0; projParams.FallingSpeedModifier = 4.0; if ((-1 < (int)uVar10) && (local_128.y = *(float *)((int)npc->_config + 0x68), uVar10 <= (uint)((*(int *)((int)npc->_config + 0x6c) - (int)local_128.y) / 0x7c))) { Color::operator_assign ((Color *)&projParams.Color,(ColorMod *)(uVar10 * 0x7c + (int)local_128.y)); } Entity_NPC::FireProjectiles(npc,&local_120,(Vector *)(local_138 + 8),0,&projParams); bVar9 = (byte)npc->_i2; } npc->_entityCollisionClass = 0; *(byte *)&npc->_i2 = bVar9 + 1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { cVar1 = *(char *)((int)&npc->_i2 + 1); if (cVar1 == '\0') { npc->_state = 3; *(undefined1 *)((int)&npc->_i1 + 2) = 0; npc->_stateFrame = 0; } else { *(char *)((int)&npc->_i2 + 1) = cVar1 + -1; bVar9 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SpinStart",1); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_renderZOffset = 2000; *(undefined1 *)((int)&npc->_i1 + 2) = 0; } } } else if (((iVar14 == 8) || (iVar14 == 4)) || (iVar14 == 0xb)) { local_101 = 0; if ((iVar14 == 4) || (iVar14 == 0xb)) { bVar9 = *(byte *)((int)&npc->_i1 + 2); if (bVar9 == 0) { *(undefined1 *)((int)&npc->_i1 + 2) = 1; npc->_stateFrame = 0; pVVar11 = Room::GetRandomPosition(game->_room,(Vector *)(local_138 + 8),0.0); manager = g_manager; local_fc = (Vector *)0x1a4; (npc->_targetPosition).x = pVVar11->x; (npc->_targetPosition).y = pVVar11->y; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); iVar14 = npc->_state; goto LAB_0048dc48; } LAB_0048ded5: if (bVar9 == 1) { local_101 = bVar9; if ((iVar14 == 4) || (iVar14 == 0xb)) { pbVar13 = (npc->_sprite)._animState._animData; if (pbVar13 == (byte *)0x0) { LAB_0048dfdb: bVar9 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Spinning",1); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar15 = pbVar13; if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar15 = *(byte **)pbVar13; } pcVar19 = "Spinning"; do { bVar9 = *pbVar15; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048dfc3: uVar10 = -(uint)bVar23 | 1; goto LAB_0048dfc8; } if (bVar9 == 0) break; bVar9 = pbVar15[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048dfc3; pbVar15 = pbVar15 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048dfc8: if ((uVar10 != 0) || ((pbVar13[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048dfdb; } local_12c = (Vector *)npc->_state; npc->_renderZOffset = 2000; if (local_12c == (Vector *)&DAT_0000000b) { (npc->_sprite)._playbackSpeed = 2.0; } iVar14 = npc->_stateFrame; if ((0x2d < iVar14) && ((iVar21 = ANM2::GetFrame(&npc->_sprite), iVar21 == 0 || (local_12c == (Vector *)&DAT_0000000b)))) goto LAB_0048e04b; } else { pbVar13 = (npc->_sprite)._animState._animData; if (pbVar13 == (byte *)0x0) { LAB_0048df4e: bVar9 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Dashing",1); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar15 = pbVar13; if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar15 = *(byte **)pbVar13; } pcVar19 = "Dashing"; do { bVar9 = *pbVar15; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048df30: uVar10 = -(uint)bVar23 | 1; goto LAB_0048df35; } if (bVar9 == 0) break; bVar9 = pbVar15[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048df30; pbVar15 = pbVar15 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048df35: if ((uVar10 != 0) || ((pbVar13[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048df4e; } iVar14 = npc->_stateFrame; npc->_renderZOffset = 0x6a4; if (0x5a < iVar14) { LAB_0048e04b: (npc->_sprite)._playbackSpeed = 1.0; uVar10 = Random(); if (uVar10 % 100 < 0x46) { uVar10 = Random(); local_128.y = npc->_maxHitPoints; local_120.y = (float)(uVar10 % 100); local_12c = (Vector *)npc->_health; if (local_128.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } pcVar19 = (char *)((int)&npc->_i1 + 1); *pcVar19 = *pcVar19 + '\x01'; fVar18 = ((float)local_12c - 0.0) / (local_128.y - 0.0); if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } iVar21 = (int)(80.0 - fVar18 * 50.0); iVar14 = iVar21 / 2; if (*(char *)((int)&npc->_i2 + 2) != '\n') { iVar14 = iVar21; } if (iVar14 <= (int)local_120.y) { npc->_state = 8; *(undefined1 *)((int)&npc->_i2 + 2) = 8; goto LAB_0048e1af; } npc->_state = 10; *(undefined1 *)((int)&npc->_i2 + 2) = 10; *(undefined1 *)((int)&npc->_i1 + 2) = 0; uVar10 = Random(); manager = g_manager; local_fc = (Vector *)0x1a4; *(char *)((int)&npc->_i2 + 1) = (char)(uVar10 % (uint)local_154) + '\x02'; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); } else { npc->_state = 9; LAB_0048e1af: *(undefined1 *)((int)&npc->_i1 + 2) = 0; } iVar14 = npc->_stateFrame; } } npc->_stateFrame = iVar14 + 1; } } else { LAB_0048dc48: bVar9 = *(byte *)((int)&npc->_i1 + 2); if (bVar9 != 0) goto LAB_0048ded5; pbVar13 = (npc->_sprite)._animState._animData; if (pbVar13 == (byte *)0x0) { LAB_0048dcae: bVar9 = ANM2::SetAnimation(&npc->_sprite,(byte *)"DashStart",1); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar15 = pbVar13; if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar15 = *(byte **)pbVar13; } pcVar19 = "DashStart"; do { bVar9 = *pbVar15; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048dc90: uVar10 = -(uint)bVar23 | 1; goto LAB_0048dc95; } if (bVar9 == 0) break; bVar9 = pbVar15[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048dc90; pbVar15 = pbVar15 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048dc95: if ((uVar10 != 0) || ((pbVar13[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_0048dcae; } npc->_renderZOffset = 0x6a4; if ((npc->_sprite)._animState._animData == (void *)0x0) { local_101 = 0; LAB_0048de2b: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0048de3e; } else { local_109 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,&DAT_00b1dd28); local_101 = local_109; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar9 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1dd28); local_101 = local_109; if (bVar9 != 0) { subList = Entity_NPC::GetPlayerTarget(npc); local_100 = (subList->_pos).y - (npc->_pos).y; local_fc = (Vector *)((subList->_pos).x - (npc->_pos).x); fVar18 = sqrtf(local_100 * local_100 + (float)local_fc * (float)local_fc); if (fVar18 <= 0.0) { pVVar11 = local_fc; fVar18 = local_100; } else { pVVar11 = (Vector *)((2.5 / fVar18) * (float)local_fc); fVar18 = (2.5 / fVar18) * local_100; } fVar24 = npc->_friction; if (fVar24 != 0.0) { fVar25 = npc->_speedMultiplier; (npc->_velocity).y = (fVar25 * fVar18) / fVar24 + (npc->_velocity).y; (npc->_velocity).x = (fVar25 * (float)pVVar11) / fVar24 + (npc->_velocity).x; } Entity_NPC::PlaySound(npc,0x12d,1.0,0x1e,0,1.0); local_101 = local_109; } goto LAB_0048de2b; } LAB_0048de3e: game = g_game; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 2) = 1; pVVar11 = Room::GetRandomPosition(game->_room,(Vector *)(local_138 + 8),0.0); manager = g_manager; local_fc = (Vector *)0x1a4; (npc->_targetPosition).x = pVVar11->x; (npc->_targetPosition).y = pVVar11->y; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); *(undefined1 *)&npc->_i2 = 0xff; } } if ((npc->_state == 8) && (bVar9 = (byte)npc->_i2, bVar9 != 0xff)) { if ((uint)bVar9 % 3 == 0) { subList = Entity_NPC::GetPlayerTarget(npc); local_140 = (subList->_pos).y - (npc->_pos).y; local_144 = (subList->_pos).x - (npc->_pos).x; fVar18 = sqrtf(local_140 * local_140 + local_144 * local_144); if (0.0 < fVar18) { local_144 = (1.0 / fVar18) * local_144; local_140 = local_140 * (1.0 / fVar18); } uVar10 = Random(); fVar18 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc = (Vector *)(fVar18 + fVar18); uVar10 = Random(); local_100 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos((float)local_fc); local_128.y = fVar18 * local_100 * 0.3 + local_144; fVar18 = sin((float)local_fc); local_120.y = fVar18 * local_100 * 0.3 + local_140; ProjectileParams::ProjectileParams(&projParams); uVar10 = npc->_bosscoloridx; projParams.Variant = 5; projParams.Scale = 1.1; if ((-1 < (int)uVar10) && (local_12c = *(Vector **)((int)npc->_config + 0x68), uVar10 <= (uint)((*(int *)((int)npc->_config + 0x6c) - (int)local_12c) / 0x7c))) { Color::operator_assign ((Color *)&projParams.Color,(ColorMod *)(uVar10 * 0x7c + (int)local_12c)); } local_138._8_4_ = local_128.y * 10.0; local_12c = (Vector *)(local_120.y * 10.0); Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(local_138 + 8),0,&projParams); (npc->_v2).x = (npc->_v2).x * 0.95; bVar9 = (byte)npc->_i2; } *(byte *)&npc->_i2 = bVar9 + 1; if ((uint)*(byte *)((int)&npc->_i1 + 3) <= (byte)(bVar9 + 1) / 3) { *(undefined1 *)&npc->_i2 = 0xff; } } else { bVar9 = Entity::IsFrame((Entity *)npc,0x1e,0); if (bVar9 != 0) { uVar10 = Random(); fVar18 = local_154; if (uVar10 % (uint)local_154 == 0) { uVar10 = Random(); *(char *)((int)&npc->_i1 + 3) = (char)(uVar10 % (uint)fVar18) + '\x03'; *(undefined1 *)&npc->_i2 = 0; } } } if (local_101 == 0) { npc->_friction = npc->_friction * 0.7; } else { pVVar11 = &npc->_pos; npc->_friction = npc->_friction * 0.88; local_114 = (npc->_targetPosition).x; local_110 = (npc->_targetPosition).y; local_12c = (Vector *)(npc->_pos).y; fVar18 = local_114 - pVVar11->x; fVar18 = sqrtf((local_110 - (float)local_12c) * (local_110 - (float)local_12c) + fVar18 * fVar18); if (npc->_size <= fVar18) { pVVar17 = local_12c; } else { pVVar17 = Room::GetRandomPosition(g_game->_room,&local_174,0.0); (npc->_targetPosition).x = pVVar17->x; local_110 = pVVar17->y; (npc->_targetPosition).y = local_110; local_114 = (npc->_targetPosition).x; pVVar17 = (Vector *)(npc->_pos).y; } fVar18 = pVVar11->x; local_110 = local_110 - (float)pVVar17; local_114 = local_114 - fVar18; fVar24 = 0.0; iVar14 = 0; if (local_14c != (undefined4 *)0x0) { do { iVar21 = *(int *)((int)local_160 + (int)fVar24 * 4); fVar26 = fVar18 - *(float *)(iVar21 + 0x33c); fVar25 = (float)pVVar17 - *(float *)(iVar21 + 0x340); if ((iVar14 == 0) || (fVar25 * fVar25 + fVar26 * fVar26 < 0.0)) { iVar14 = iVar21; } fVar24 = (float)((int)fVar24 + 1); } while ((uint)fVar24 < local_14c); npc = savedNpc; if (iVar14 != 0) { local_114 = *(float *)(iVar14 + 0x33c) - fVar18; local_110 = *(float *)(iVar14 + 0x340) - (float)pVVar17; } } if (((npc->_v2).x == 0.0) || (bVar9 = Entity::IsFrame((Entity *)npc,0x3c,npc->_index), bVar9 != 0)) { uVar10 = Random(); fVar18 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; (npc->_v2).x = fVar18; if (npc->_state == 0xb) { (npc->_v2).x = fVar18 * 0.5; } } local_154 = (npc->_velocity).y; fVar18 = sqrtf(local_114 * local_114 + local_110 * local_110); if (fVar18 <= 0.0) { fVar18 = local_110; } else { local_114 = local_114 * (1.0 / fVar18); fVar18 = local_110 * (1.0 / fVar18); } fVar24 = (npc->_v2).x; local_fc = (Vector *)(npc->_velocity).x; local_12c = (Vector *)(fVar24 * local_114 * 0.15 + (float)local_fc); local_128.y = fVar24 * fVar18 * 0.15 + local_154; local_100 = local_154; fVar18 = sqrtf((float)local_fc * (float)local_fc + local_154 * local_154); if (0.0 < fVar18) { local_fc = (Vector *)((float)local_fc * (1.0 / fVar18)); local_100 = local_100 * (1.0 / fVar18); } fVar18 = (npc->_v2).x; fVar24 = fVar18 * (float)local_fc; local_fc = (Vector *)(fVar18 * local_100 * 0.15 + local_128.y); local_100 = fVar24 * 0.15 + (float)local_12c; fVar24 = sqrtf((float)local_fc * (float)local_fc + local_100 * local_100); pVVar17 = local_fc; fVar18 = local_100; if (0.0 < fVar24) { fVar24 = (npc->_v2).x / fVar24; pVVar17 = (Vector *)((float)local_fc * fVar24); fVar18 = local_100 * fVar24; } fVar24 = npc->_speedMultiplier; fVar25 = 0.8; if (fVar24 != 1.0) { fVar25 = 0.8 / ((fVar24 + 0.8) - fVar24 * 0.8); } fVar24 = (npc->_velocity).x; (npc->_velocity).y = ((float)pVVar17 - local_154) * (1.0 - fVar25) + local_154; (npc->_velocity).x = (fVar18 - fVar24) * (1.0 - fVar25) + fVar24; if ((npc->_state == 8) || (npc->_state == 0xb)) { bVar9 = Entity::IsFrame((Entity *)npc,8,npc->_index); if (bVar9 != 0) { uVar10 = Random(); subList = Game::Spawn(g_game,1000,creepVariant,pVVar11,&g_vectorZero,(Entity *)npc,0, uVar10); piVar16 = (int *)__RTDynamicCast(subList); if (piVar16 != (int *)0x0) { piVar16[0x39] = 0x40400000; piVar16[0x3a] = 0x40400000; (**(code **)(*piVar16 + 0xc))(); } } bVar9 = Entity::IsFrame((Entity *)npc,0x14,npc->_index); if ((bVar9 != 0) && (uVar10 = Random(), uVar10 % 100 < 0x3c)) { uVar10 = Random(); rngResult = Random(); fVar18 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc = (Vector *)(fVar18 + fVar18); rngResult = Random(); local_100 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; fVar18 = cos((float)local_fc); local_138._8_4_ = fVar18 * local_100 * npc->_size + (npc->_pos).x; fVar18 = sin((float)local_fc); local_12c = (Vector *)(fVar18 * local_100 * npc->_size + (npc->_pos).y); spawnedNpc = (Entity_NPC *) Game::Spawn(g_game,0x127,0,(Vector *)(local_138 + 8),&g_vectorZero, (Entity *)npc,0,uVar10); Entity_NPC::SetBossColorIdx(spawnedNpc,npc->_bosscoloridx,unused); } } if (npc->_collidesWithGrid != 0) { pVVar11 = Room::GetRandomPosition(g_game->_room,&local_174,0.0); (npc->_targetPosition).x = pVVar11->x; (npc->_targetPosition).y = pVVar11->y; Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); Game::ShakeScreen(g_game,4); this = g_game->_room; uVar10 = Random(); local_12c = &npc->_gridCollisionNormal; local_120.x = local_12c->x * 200.0 + (npc->_pos).x; fVar18 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 40.0 * -0.6; local_120.y = (npc->_gridCollisionNormal).y * 200.0 + (npc->_pos).y; Room::GetClampedPositionImpl(this,&local_128,&local_120,fVar18,fVar18,fVar18,fVar18); pvVar20 = g_game->_room; iVar21 = (int)((local_128.x - 40.0) / 40.0 + 0.5); iVar14 = (int)((local_128.y - 120.0) / 40.0 + 0.5); if (-1 < iVar21) { if (((iVar21 < *(int *)((int)pvVar20 + 0xc)) && (-1 < iVar14)) && (iVar14 < *(int *)((int)pvVar20 + 0x10))) { uVar10 = iVar14 * *(int *)((int)pvVar20 + 0xc) + iVar21; if (uVar10 < 0x1c0) { iVar14 = *(int *)((int)pvVar20 + uVar10 * 4 + 0x24); if ((iVar14 != 0) && ((iVar14 = *(int *)(iVar14 + 4), iVar14 == 0xf || (iVar14 == 0x10)))) { uVar10 = Random(); fVar18 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; splat = Entity_NPC::MakeSplat(npc,fVar18 + fVar18 + 1.6); iVar14 = *(int *)splat; (splat->_pos).x = local_128.x; (splat->_pos).y = local_128.y; (**(code **)(iVar14 + 0x3c))(&savedNpc->_splatColor); pVVar11 = Vector::ToCardinal(&local_174,local_12c); fVar18 = atan2f(pVVar11->y,pVVar11->x); uVar3 = *(undefined4 *)((int)&splat->_flags + 4); *(uint *)&splat->_flags = (uint)splat->_flags | 0x2000; *(undefined4 *)((int)&splat->_flags + 4) = uVar3; iVar14 = *(int *)splat; (splat->_sprite)._rotation = fVar18 * 57.295776 + 90.0; (**(code **)(iVar14 + 0xc))(); npc = savedNpc; } } } } } } } else if (iVar14 == 0x10) { npc->_friction = npc->_friction * 0.7; auVar46._8_4_ = "Death"; auVar46._0_8_ = 0x48d91c00000000; auVar46._12_4_ = 0; ANM2::Play(&npc->_sprite,(byte *)"Death",0); auVar47._0_12_ = auVar46._0_12_; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { auVar47._12_4_ = 0x48d936; Entity::BloodExplode((Entity *)npc); if (local_114 == 1.4013e-45) { uVar10 = 0; do { rngResult = Random(); local_138._8_4_ = ((float)(uVar10 >> 1) + 0.0) * 10.0 + (npc->_pos).x; local_12c = (Vector *)(((float)(uVar10 & 1) + 0.0) * 10.0 + (npc->_pos).y); Game::Spawn(g_game,0xdc,1,(Vector *)(local_138 + 8),&g_vectorZero,(Entity *)npc,0, rngResult); uVar10 = uVar10 + 1; } while (uVar10 < 2); npc->_state = 0x12; } else { auVar48._0_8_ = auVar47._0_8_; auVar48._8_4_ = 0; auVar48._12_4_ = 0xffffffff; auVar49._8_8_ = auVar48._8_8_; auVar49._0_8_ = 0x100000000; auVar50._4_12_ = auVar49._4_12_; auVar50._0_4_ = 0x105; Entity_NPC::Morph(npc,0x105,1,0,-1); auVar51._0_8_ = auVar50._0_8_; auVar51._8_4_ = 0; auVar51._12_4_ = 0x10000000; npc->_dead = 0; bVar9 = Entity::HasEntityFlags((Entity *)npc,auVar51._8_8_); if (bVar9 == 0) { fVar18 = npc->_maxHitPoints * 0.2; npc->_health = fVar18; npc->_maxHitPoints = fVar18; } else { npc->_maxHitPoints = 15.0; npc->_health = 15.0; ANM2::LoadDeliriumForm(&npc->_sprite,npc->_type,npc->_variant,1); } *(undefined4 *)((int)g_game->_room + 0x12d0) = 0; npc->_entityCollisionClass = 4; npc->_state = 0; } goto LAB_0048edf0; } } else if (iVar14 == 9) { npc->_friction = npc->_friction * 0.7; ANM2::Play(&npc->_sprite,&DAT_00b1deb4,0); npc->_renderZOffset = 0x6a4; bVar9 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b1deb4); if (bVar9 != 0) { iVar14 = 0x48daf9; Game::ButterBeanFart(g_game,&npc->_pos,160.0,(Entity *)npc,1,0); Game::DamageRadius(&npc->_pos,(Entity *)npc,0,0,iVar14,50.0,g_tearFlagPoison,15.0,120.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 2) = 0; fVar18 = npc->_health; for (fVar24 = local_144; fVar18 <= fVar24; fVar24 = fVar24 - (float)local_12c) { pcVar19 = (char *)((int)&npc->_i1 + 1); *pcVar19 = *pcVar19 + '\x01'; } } } } else { if (iVar14 != 3) { if ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0) goto LAB_0048ce8f; npc->_state = 3; npc->_stateFrame = 0; } LAB_0048ce98: npc->_friction = npc->_friction * 0.7; pbVar13 = (npc->_sprite)._animState._animData; if (local_140 < 0.6666667) { if (local_140 < 0.33333334) { if (pbVar13 != (byte *)0x0) { if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar13 = *(byte **)pbVar13; } pcVar19 = "Idle_Angry"; do { bVar9 = *pbVar13; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048cfc0: uVar10 = -(uint)bVar23 | 1; goto LAB_0048cfc5; } if (bVar9 == 0) break; bVar9 = pbVar13[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048cfc0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048cfc5: if ((uVar10 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0048cffd; } auVar43._8_4_ = "Idle_Angry"; auVar43._0_8_ = uVar27; auVar43._12_4_ = 1; auVar28 = auVar43._0_13_; goto LAB_0048cfe2; } if (pbVar13 == (byte *)0x0) { LAB_0048cf81: auVar42._8_4_ = "Idle_Upset"; auVar42._0_8_ = uVar27; auVar42._12_4_ = 1; auVar28 = auVar42._0_13_; goto LAB_0048cfe2; } if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar13 = *(byte **)pbVar13; } pcVar19 = "Idle_Upset"; do { bVar9 = *pbVar13; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048cf62: uVar10 = -(uint)bVar23 | 1; goto LAB_0048cf67; } if (bVar9 == 0) break; bVar9 = pbVar13[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048cf62; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048cf67: if ((uVar10 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048cf81; } else { if (pbVar13 != (byte *)0x0) { if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar13 = *(byte **)pbVar13; } pcVar19 = "Idle_Happy"; do { bVar9 = *pbVar13; bVar23 = bVar9 < (byte)*pcVar19; if (bVar9 != *pcVar19) { LAB_0048cef7: uVar10 = -(uint)bVar23 | 1; goto LAB_0048cefc; } if (bVar9 == 0) break; bVar9 = pbVar13[1]; bVar23 = bVar9 < (byte)pcVar19[1]; if (bVar9 != pcVar19[1]) goto LAB_0048cef7; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar9 != 0); uVar10 = 0; LAB_0048cefc: if ((uVar10 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0048cffd; } auVar41._8_4_ = "Idle_Happy"; auVar41._0_8_ = uVar27; auVar41._12_4_ = 1; auVar28 = auVar41._0_13_; LAB_0048cfe2: bVar9 = ANM2::SetAnimation(&npc->_sprite,auVar28._8_4_,auVar28[0xc]); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0048cffd: npc->_renderZOffset = 2000; if (npc->_stateFrame < 0x1f) { LAB_0048d1fb: npc->_stateFrame = npc->_stateFrame + 1; } else if (local_144 < npc->_health) { if ((npc->_pendingDamage <= 0.0) || (npc->_health <= npc->_maxHitPoints * 0.95)) { bVar9 = Entity::IsFrame((Entity *)npc,0x1e,npc->_index); if ((bVar9 != 0) && (uVar10 = Random(), (uVar10 & 3) == 0)) { uVar10 = Random(); iVar14 = 0xb; if ((uVar10 & 1) == 0) { iVar14 = 4; } npc->_state = iVar14; *(undefined1 *)((int)&npc->_i1 + 2) = 0; } goto LAB_0048d1fb; } npc->_stateFrame = npc->_stateFrame + 1; npc->_state = 9; } else { uVar10 = Random(); local_120.y = npc->_maxHitPoints; local_128.y = npc->_health; local_148 = (float)(uVar10 % 100); if (local_120.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } pcVar19 = (char *)((int)&npc->_i1 + 1); *pcVar19 = *pcVar19 + '\x01'; fVar18 = (local_128.y - 0.0) / (local_120.y - 0.0); if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } iVar21 = (int)(80.0 - fVar18 * 50.0); iVar14 = iVar21 / 2; if (*(char *)((int)&npc->_i2 + 2) != '\n') { iVar14 = iVar21; } if ((int)local_148 < iVar14) { npc->_state = 10; *(undefined1 *)((int)&npc->_i2 + 2) = 10; *(undefined1 *)((int)&npc->_i1 + 2) = 0; uVar10 = Random(); manager = g_manager; local_fc = (Vector *)0x1a4; *(char *)((int)&npc->_i2 + 1) = (char)(uVar10 % 10) + '\x03'; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); npc->_stateFrame = npc->_stateFrame + 1; } else { npc->_state = 8; *(undefined1 *)((int)&npc->_i2 + 2) = 8; *(undefined1 *)((int)&npc->_i1 + 2) = 0; npc->_stateFrame = npc->_stateFrame + 1; } } } bVar9 = Entity::IsFrame((Entity *)npc,3,npc->_index); if ((bVar9 != 0) && (fVar18 = (npc->_velocity).y, fVar24 = (npc->_velocity).x, fVar18 = sqrtf(fVar24 * fVar24 + fVar18 * fVar18), 1.0 < fVar18)) { uVar10 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 + 0.6); local_50 = (npc->_splatColor)._tint[0]; EStack_4c._type = (int)(npc->_splatColor)._tint[1]; EStack_4c._variant = (int)(npc->_splatColor)._tint[2]; EStack_4c._entity = (void *)(npc->_splatColor)._offset[2]; EStack_4c._spawnerVariant = (int)(npc->_splatColor)._colorize[0]; EStack_4c._position.x = (npc->_splatColor)._colorize[1]; EStack_4c._position.y = (npc->_splatColor)._colorize[2]; EStack_4c._velocity.x = (npc->_splatColor)._colorize[3]; EStack_4c._spawnerType = 0x3f000000; EStack_4c._velocity.y = (npc->_splatColor)._offset[0]; EStack_4c._flags = (int)(npc->_splatColor)._offset[1]; (**(code **)(*(int *)splat + 0x3c))(&local_50); } if ((0.0 < npc->_pendingDamage) && (queryIt = (npc->_damageEvents)._begin, queryIt != (npc->_damageEvents)._end)) { do { if ((queryIt[4] != 1) && ((queryIt[6] != 1 && ((queryIt[2] & 0x8000) != 0)))) { *queryIt = 0; } queryIt = queryIt + 0xe; } while (queryIt != (npc->_damageEvents)._end); } (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; LAB_0048edf0: if (local_160 != (void *)0x0) { deallocate(local_160,(int)local_158 - (int)local_160 >> 2); } ExceptionList = local_1c; return; } //@@ 0048ee30 NpcAI::ENTITY_CORN_MINE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 295 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CORN_MINE(Entity_NPC *npc) { byte bVar1; Vector *pVVar2; int state; byte *curAnimName; uint cmpResult; ColorMod *color; char *wantedAnimName; bool isLess; float fVar3; float dx; Vector local_e4; ProjectileParams projParams; Color local_34; float local_8; byte *animData; undefined4 flagsHigh; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); state = npc->_state; if (state == 0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x90001; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_state = 3; return; } if (state == 3) { pVVar2 = Entity_NPC::CalcTargetPosition(npc,&local_e4,0.0); fVar3 = (npc->_pos).y - pVVar2->y; dx = (npc->_pos).x - pVVar2->x; fVar3 = sqrtf(fVar3 * fVar3 + dx * dx); if (60.0 <= fVar3) { state = npc->_state; } else { ANM2::Play(&npc->_sprite,(byte *)"Pulse",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,50.0); } npc->_state = 8; state = 8; } npc->_stateFrame = npc->_stateFrame + 1; if (npc->_stateFrame < 0xb5) goto LAB_0048ef31; npc->_state = 8; } else { LAB_0048ef31: if ((state != 8) && (npc->_dead == 0)) goto LAB_0048f0e2; } animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0048ef96: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Pulse",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimName = "Pulse"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*wantedAnimName; if (bVar1 != *wantedAnimName) { LAB_0048ef80: cmpResult = -(uint)isLess | 1; goto LAB_0048ef85; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)wantedAnimName[1]; if (bVar1 != wantedAnimName[1]) goto LAB_0048ef80; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar1 != 0); cmpResult = 0; LAB_0048ef85: if ((cmpResult != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048ef96; } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) || (npc->_dead != 0)) { local_34._tint[1] = 0.0; local_34._tint[2] = 0.0; local_34._tint[3] = 0.0; local_34._colorize[0] = 0.0; local_34._colorize[1] = g_vectorZero.x; local_34._colorize[2] = g_vectorZero.y; local_34._colorize[3] = g_vectorZero.x; local_34._offset[0] = g_vectorZero.y; local_34._offset[1] = 0.0; local_34._offset[2] = 0.0; (**(code **)(*(int *)npc + 0x24))(local_34._tint + 1); Color::Color(&local_34); pVVar2 = &npc->_pos; Game::Fart(g_game,pVVar2,85.0,(Entity *)npc,1.0,0,color); Game::BombDamage(g_game,pVVar2,40.0,npc->_size,0,(Entity *)npc,g_tearFlagsNone,4,0); ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x80; projParams.Variant = 5; local_e4.x = 10.0; local_e4.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar2,&local_e4,8,&projParams); } LAB_0048f0e2: npc->_friction = npc->_friction * 0.1; return; } //@@ 0048f110 NpcAI::ENTITY_FORSAKEN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 403 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FORSAKEN(Entity_NPC *npc) { void *pvVar1; byte bVar2; EntityList *groupQuery; byte *animNameChar; uint uVar3; byte *pbVar4; int iVar5; Vector *pVVar6; Entity *pEVar7; Entity_Player *nearestPlayer; Entity_Laser *laser; uint shiftIdx; byte *idleNameChar; char *animName; uint uVar8; qword *allocatedBytes; float fVar9; Entity_NPC *pEVar10; bool bVar11; float fVar12; undefined4 local_e0 [11]; EntityList_EL lasers; EntityList_EL queryList; EntityList_EL groupList; Vector local_7c; char local_71; Vector local_70; Entity_NPC *local_68; void *local_64; Vector local_60; Entity_NPC *local_58; float local_54; ColorMod trailColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; int entityType; longlong gridWidth; Manager *manager; qword prevAllocated; void *room; float speedMultiplier; puStack_20 = (undefined1 *)(&trailColor)[1]._offset; puStack_18 = &LAB_00af2db6; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&trailColor)[1]._colorize + 1); local_7c.y = (float)npc->_subtype; if (npc->_state == 0) { npc->_state = 0xd; npc->_stateFrame = 0; npc->_entityGridCollisionClass = 3; if (&npc->_splatColor == (ColorMod *)local_e0) { return; } (npc->_splatColor)._offset[0] = 0.8; (npc->_splatColor)._offset[1] = 0.8; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.3; (npc->_splatColor)._offset[2] = 0.8; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } ExceptionList = &local_1c; npc->_stateFrame = npc->_stateFrame + 1; local_64 = (void *)0x0; groupList._0_1_ = 0; groupList._data = (void *)0x0; groupList._capacity = 0; groupList._size = 0; local_14 = 0.0; local_68 = npc; groupQuery = Entity_NPC::QueryNPCsGroup((EntityList *)&queryList,npc->_index); local_71 = '\x01'; groupList._0_1_ = 1; pvVar1 = *(void **)&groupQuery->field_0x4; groupList._capacity = *(int *)&groupQuery->field_0x8; groupList._size = *(int *)&groupQuery->field_0xc; groupList._data = pvVar1; local_70.y = (float)groupList._size; if (queryList._0_1_ == '\0') { local_14._0_1_ = 1; tracked_alloc(1,queryList._data,0); local_14 = (float)((uint)local_14._1_3_ << 8); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&queryList,0xd4,-1,-1,0,1); local_14 = (float)CONCAT31(local_14._1_3_,2); local_58 = (Entity_NPC *)0x0; local_60.y = (float)queryList._size; pEVar10 = (Entity_NPC *)queryList._size; if ((Entity_NPC *)queryList._size != (Entity_NPC *)0x0) { do { if ((*(uint *)(*(int *)((int)queryList._data + (int)local_58 * 4) + 0x168) & 0x20000000) != 0) { if (pEVar10 <= local_58) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); } pEVar10 = (Entity_NPC *)((int)&pEVar10[-1]._pickupGhostsEntity + 3); for (shiftIdx = (uint)local_58; shiftIdx < pEVar10; shiftIdx = (uint)&((Entity_NPC *)shiftIdx)->field_0x1) { *(undefined4 *)((int)queryList._data + shiftIdx * 4) = *(undefined4 *)((int)queryList._data + shiftIdx * 4 + 4); } queryList._size = (int)pEVar10; } local_58 = (Entity_NPC *)&local_58->field_0x1; } while (local_58 < pEVar10); npc = local_68; local_60.y = (float)pEVar10; } fVar9 = 0.0; if (local_70.y != 0.0) { do { iVar5 = *(int *)((int)pvVar1 + (int)fVar9 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)(iVar5 + 0x28) != 1)) { entityType = *(int *)(iVar5 + 0x28); if ((entityType - 10U < 0x3de) && (((entityType != 0x21 && (entityType != 0x11)) && (entityType != 0x124)))) { if (entityType == 0x375) { bVar11 = *(int *)(iVar5 + 0x2c) == 10; } else { if ((entityType == 0x3c0) || (entityType == 0x3c5)) goto LAB_0048f38d; bVar11 = entityType == 0xf5; } if (!bVar11) goto LAB_0048f378; } } else { LAB_0048f378: if ((*(char *)(iVar5 + 0x173) == '\0') && (*(int *)(iVar5 + 0x28) != 0x3c3)) { local_64 = (void *)((int)local_64 + 1); } } LAB_0048f38d: fVar9 = (float)((int)fVar9 + 1); } while ((uint)fVar9 < (uint)local_70.y); npc = local_68; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"ArmsUp"); manager = g_manager; if (bVar2 != 0) { local_58 = (Entity_NPC *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_58 = (Entity_NPC *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_58 = (Entity_NPC *)0x3f000000; } local_54 = 1.36206e-42; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,1.0,2,0,(float)local_58,0.0); } } manager = g_manager; iVar5 = npc->_state; local_58 = (Entity_NPC *)free_exref; if (iVar5 == 3) { pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048f49e: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } idleNameChar = s_Idle; do { bVar2 = *animNameChar; bVar11 = bVar2 < *idleNameChar; if (bVar2 != *idleNameChar) { LAB_0048f480: uVar3 = -(uint)bVar11 | 1; goto LAB_0048f485; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < idleNameChar[1]; if (bVar2 != idleNameChar[1]) goto LAB_0048f480; animNameChar = animNameChar + 2; idleNameChar = idleNameChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048f485: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048f49e; } if (0x96 < npc->_stateFrame) { npc->_stateFrame = 0; npc->_state = 0xd; } } else if (iVar5 == 0xd) { pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { pbVar4 = &s_empty; } else if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } animName = "Summon"; do { bVar2 = *pbVar4; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048f530: uVar3 = -(uint)bVar11 | 1; goto LAB_0048f535; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048f530; pbVar4 = pbVar4 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048f535: if (uVar3 != 0) { local_54 = 5.84341e-43; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,1.0,2,0,1.0,0.0); } pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048f5ce: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Summon",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "Summon"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048f5b0: uVar3 = -(uint)bVar11 | 1; goto LAB_0048f5b5; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048f5b0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048f5b5: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048f5ce; } iVar5 = 1; fVar9 = npc->_maxHitPoints * 0.25; if (npc->_health <= fVar9 && fVar9 != npc->_health) { iVar5 = 2; } if (((int)local_64 < iVar5) || (npc->_i2 != 0)) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004905ac; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Summon"); if (bVar2 != 0) { if (npc->_i2 != 0) { npc->_i2 = 0; } uVar3 = Random(); fVar9 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_60.y = fVar9 + fVar9; local_54 = sin(local_60.y); fVar9 = cos(local_60.y); local_70.x = fVar9 * 70.0 + (npc->_pos).x; local_70.y = local_54 * 70.0 + (npc->_pos).y; pVVar6 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_70,0.0,0,0,0); uVar3 = 0xe3; local_70.x = pVVar6->x; local_70.y = pVVar6->y; if (local_7c.y == 1.4013e-45) { uVar3 = 0x115; } uVar8 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; if ((uVar8 == 0) || (iVar5 = Entity::CountRelatedEntities((Entity *)npc,uVar3,0,uVar8,(void *)0x0), iVar5 == 0)) { uVar8 = Random(); pEVar7 = Game::Spawn(g_game,uVar3,0,&local_70,&g_vectorZero,(Entity *)npc,0,uVar8); pEVar7[3]._sprite._filename._size = npc->_index; if ((npc->_flags & 0x1000000000000000) != 0) { pEVar7->_health = 10.0; pEVar7->_maxHitPoints = 10.0; } } } } LAB_0049059d: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_004905ac: npc->_stateFrame = 0; npc->_i1 = 0; npc->_state = 0x10; } } else { if (iVar5 != 0x10) { if (iVar5 == 8) { iVar5 = npc->_i1; if (iVar5 == 0) { pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048fffe: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"BlastStart",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "BlastStart"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048ffe0: uVar3 = -(uint)bVar11 | 1; goto LAB_0048ffe5; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048ffe0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048ffe5: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_0048fffe; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Blast"), bVar2 == 0)) { LAB_0049022f: pEVar10 = local_58; } else { uVar3 = Random(); local_60.y = (float)(uVar3 % 0x1e + 0xf); uVar3 = Random(); if ((uVar3 & 1) == 0) { local_54 = -2.0; } else { local_54 = 2.0; } local_54 = ((float)((double)(int)local_70.y + __uint_to_double_fixup[-((int)local_70.y >> 0x1f)]) * 0.25 + 1.0) * local_54; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&lasers,7,-1,-1,0,1); uVar3 = 0; local_14 = (float)CONCAT31(local_14._1_3_,3); if (lasers._size != 0) { do { iVar5 = *(int *)((int)lasers._data + uVar3 * 4); if (((((*(char *)(iVar5 + 0x4c0) != '\0') && (*(float *)(iVar5 + 0x4cc) != 0.0)) && (pEVar10 = *(Entity_NPC **)(iVar5 + 0x3bc), pEVar10 != (Entity_NPC *)0x0)) && (((1 < *(int *)&g_game->_deathmatchManager && (pEVar10->_type == 1)) || (pEVar10->_type - 10U < 0x3de)))) && (pEVar10 != npc)) { local_54 = *(float *)(iVar5 + 0x4cc); uVar3 = Random(); local_60.y = (float)(uVar3 % 10 + 5); break; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)lasers._size); } iVar5 = 0; local_7c.x = 0.0; local_7c.y = 0.0; do { local_70.x = (npc->_pos).x + 0.0; local_70.y = (npc->_pos).y - 30.0; laser = Entity_Laser::ShootAngle (1,&local_70,(float)iVar5 * 120.0 + (npc->_v1).x,0x78,&local_7c, (Entity *)npc,0); laser->_rotationDelay = (int)local_60.y; laser->_isActiveRotating = 1; laser->_rotationDegrees = 1800.0; laser->_rotationSpd = local_54; (**(code **)(*(int *)laser + 0xc))(); pEVar10 = local_58; iVar5 = iVar5 + 1; } while (iVar5 < 4); if (lasers._0_1_ != '\0') goto LAB_0049022f; allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (lasers._data != (void *)0x0) { uVar3 = *(uint *)((int)lasers._data + -4); prevAllocated = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocated < uVar3); (*(code *)local_58)((uint *)((int)lasers._data + -4)); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; npc->_i1 = 1; } } else { if (iVar5 != 1) { if (iVar5 != 2) goto LAB_004905ca; pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_00490370: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"BlastEnd",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "BlastEnd"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00490352: uVar3 = -(uint)bVar11 | 1; goto LAB_00490357; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00490352; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00490357: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00490370; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; npc->_i1 = 0; npc->_state = 3; } goto LAB_004903bb; } npc->_friction = npc->_friction * 0.9; pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_004902cf: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Blasting",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "Blasting"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_004902b1: uVar3 = -(uint)bVar11 | 1; goto LAB_004902b6; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_004902b1; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004902b6: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_004902cf; } if (0x78 < npc->_stateFrame) { npc->_stateFrame = 0; npc->_i1 = 2; } LAB_004903bb: pEVar10 = local_58; } fVar9 = npc->_friction * 0.7; goto LAB_004905e2; } if (iVar5 != 0xe) goto LAB_004905ca; pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { pbVar4 = &s_empty; } else if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } animName = "Summon"; do { bVar2 = *pbVar4; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00490417: uVar3 = -(uint)bVar11 | 1; goto LAB_0049041c; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00490417; pbVar4 = pbVar4 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0049041c: if (uVar3 != 0) { local_60.y = 5.84341e-43; seed_fart_sound_override((int *)&local_60.y); SoundEffects::Play(&manager->_sfxManager,(int)local_60.y,1.0,2,0,1.0,0.0); } pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_004904b5: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Summon",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "Summon"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00490497: uVar3 = -(uint)bVar11 | 1; goto LAB_0049049c; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00490497; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0049049c: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004904b5; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Summon"); if (bVar2 != 0) { iVar5 = 2; do { uVar3 = Random(); fVar9 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_60.y = fVar9 + fVar9; local_54 = sin(local_60.y); fVar9 = cos(local_60.y); local_7c.x = fVar9 * 70.0 + (npc->_pos).x; local_7c.y = local_54 * 70.0 + (npc->_pos).y; uVar3 = Random(); Game::Spawn(g_game,0xd4,1,&local_7c,&g_vectorZero,(Entity *)npc,0,uVar3); iVar5 = iVar5 + -1; } while (iVar5 != 0); } goto LAB_0049059d; } goto LAB_004905ac; } iVar5 = npc->_i1; if (iVar5 == 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0048f83d: pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048f891: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"FadeOut",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "FadeOut"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048f873: uVar3 = -(uint)bVar11 | 1; goto LAB_0048f878; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048f873; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048f878: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048f891; } Entity_NPC::PlaySound(npc,0x3cd,1.0,2,0,1.0); } else { pbVar4 = (npc->_sprite)._animState._animData; if ((npc->_sprite)._animState._isPlaying == 0) { if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } animName = "FadeOut"; do { bVar2 = *pbVar4; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048f830: uVar3 = -(uint)bVar11 | 1; goto joined_r0x0048f837; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048f830; pbVar4 = pbVar4 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; } else { if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } animName = "FadeOut"; do { bVar2 = *pbVar4; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048f7f0: uVar3 = -(uint)bVar11 | 1; goto joined_r0x0048f837; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048f7f0; pbVar4 = pbVar4 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; } joined_r0x0048f837: if (uVar3 != 0) goto LAB_0048f83d; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; npc->_i1 = 1; npc->_isInvicible = 1; npc->_entityCollisionClass = 0; npc->_i2 = 0; } } else if (iVar5 == 1) { pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048f973: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Faded",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "Faded"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048f955: uVar3 = -(uint)bVar11 | 1; goto LAB_0048f95a; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048f955; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048f95a: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048f973; } nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos); fVar9 = (npc->_pos).y - (nearestPlayer->_pos).y; fVar12 = (npc->_pos).x - (nearestPlayer->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar12 * fVar12); uVar3 = (uint)(fVar9 < local_68->_size + nearestPlayer->_size); local_68->_i2 = uVar3; npc = local_68; if ((local_64 == (void *)0x0) || (uVar3 != 0)) { local_68->_stateFrame = 0; local_68->_i1 = 2; } } else { if (iVar5 != 2) { if (iVar5 != 3) goto LAB_004905ca; pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048fd74: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"FadeIn",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "FadeIn"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048fd56: uVar3 = -(uint)bVar11 | 1; goto LAB_0048fd5b; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048fd56; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048fd5b: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048fd74; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; manager = g_manager; if ((npc->_i2 == 0) || (3 < (uint)local_70.y)) { if (local_7c.y == 1.4013e-45) { iVar5 = 3; if ((Entity_NPC *)local_60.y == (Entity_NPC *)0x0) { iVar5 = 0xe; } npc->_state = iVar5; npc->_i1 = 0; } else { npc->_state = 8; local_60.y = 5.85743e-43; seed_fart_sound_override((int *)&local_60.y); SoundEffects::Play(&manager->_sfxManager,(int)local_60.y,1.0,2,0,1.0,0.0); npc->_i1 = 0; pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_60.y = atan2f((pEVar7->_pos).y - (npc->_pos).y,(pEVar7->_pos).x - (npc->_pos).x) ; uVar3 = Random(); local_70.y = -32.0; iVar5 = 0; local_70.x = 0.0; (npc->_v1).x = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) + local_60.y * 57.295776 + 180.0; do { trailColor._offset[0] = 0.0; trailColor._colorize[0] = 0.0; trailColor._colorize[1] = 0.0; trailColor._colorize[2] = 0.0; trailColor._colorize[3] = 0.0; trailColor._offset[1] = 0.0; trailColor._tint[0] = 0.6; trailColor._tint[1] = 0.05; trailColor._tint[2] = 0.0; trailColor._tint[3] = 0.8; trailColor._offset[2] = 0.0; local_60.y = ((float)iVar5 * 120.0 + (npc->_v1).x) * 0.017453292; local_54 = sin(local_60.y); local_7c.x = cos(local_60.y); local_7c.y = local_54; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_70,&local_7c,0x19,&trailColor,4.0); iVar5 = iVar5 + 1; } while (iVar5 < 4); } } else { npc->_state = 0xd; npc->_i1 = 0; } } goto LAB_004903bb; } pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0048fa7e: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Faded",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameChar = *(byte **)pbVar4; } animName = "Faded"; do { bVar2 = *animNameChar; bVar11 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0048fa60: uVar3 = -(uint)bVar11 | 1; goto LAB_0048fa65; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar11 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0048fa60; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0048fa65: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0048fa7e; } room = g_game->_room; Room::GetCenterPos(&local_60); iVar5 = *(int *)((int)room + 4); if ((iVar5 == 0) || (iVar5 = *(int *)(iVar5 + 0x10), iVar5 == 0)) { LAB_0048fb21: local_68 = (Entity_NPC *)local_60.y; } else { iVar5 = *(int *)(iVar5 + 0x48); if (iVar5 == 0xb) { uVar3 = 0x84; } else if (iVar5 == 0xc) { uVar3 = 0x77; } else if (iVar5 == 9) { uVar3 = 0x148; } else { if (iVar5 != 10) goto LAB_0048fb21; uVar3 = 0x13b; } gridWidth = (longlong)*(int *)((int)room + 0xc); local_60.x = (float)(int)((longlong)(ulonglong)uVar3 % gridWidth) * 40.0 + 40.0; local_68 = (Entity_NPC *) ((float)(int)((longlong)(ulonglong)uVar3 / gridWidth) * 40.0 + 120.0); } local_54 = local_60.x - (npc->_pos).x; local_70.y = (float)local_68 - (npc->_pos).y; local_64 = (void *)local_60.x; fVar12 = sqrtf(local_54 * local_54 + local_70.y * local_70.y); fVar9 = local_70.y; if (0.0 < fVar12) { local_54 = local_54 * (1.0 / fVar12); fVar9 = local_70.y * (1.0 / fVar12); } fVar12 = npc->_friction; if (fVar12 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * fVar9 * 1.2) / fVar12 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * local_54 * 1.2) / fVar12 + (npc->_velocity).x; } local_60.y = (npc->_velocity).x; local_54 = (npc->_velocity).y; fVar9 = sqrtf(local_60.y * local_60.y + local_54 * local_54); if ((3.2 < fVar9) && (0.0 < fVar9)) { (npc->_velocity).x = local_60.y * (3.2 / fVar9); (npc->_velocity).y = local_54 * (3.2 / fVar9); } if ((0x78 < npc->_stateFrame) || (fVar9 = (npc->_pos).y - (float)local_68, fVar12 = (npc->_pos).x - (float)local_64, fVar9 = sqrtf(fVar9 * fVar9 + fVar12 * fVar12), fVar9 < 45.0)) { uVar3 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; if (uVar3 != 0) { iVar5 = 0xe3; if (local_7c.y == 1.4013e-45) { iVar5 = 0x115; } iVar5 = Entity::CountRelatedEntities((Entity *)npc,iVar5,0,uVar3,(void *)0x0); if (iVar5 != 0) goto LAB_004905ca; } npc->_stateFrame = 0; npc->_i1 = 3; if ((npc->_flags & 0x1000000000000000) != 0) { npc->_i2 = 0; } npc->_isInvicible = 0; npc->_entityCollisionClass = 4; } } } LAB_004905ca: PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); fVar9 = npc->_friction; pEVar10 = local_58; LAB_004905e2: npc->_friction = fVar9 * 0.9; if (queryList._0_1_ == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (queryList._data != (void *)0x0) { uVar3 = *(uint *)((int)queryList._data + -4); prevAllocated = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocated < uVar3); (*(code *)pEVar10)((uint *)((int)queryList._data + -4)); } } if (local_71 == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (pvVar1 != (void *)0x0) { uVar3 = *(uint *)((int)pvVar1 + -4); prevAllocated = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocated < uVar3); (*(code *)pEVar10)((uint *)((int)pvVar1 + -4)); } } ExceptionList = local_1c; return; } //@@ 00490680 NpcAI::ENTITY_LITTLE_HORN /* NPC AI for entity type 404 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_LITTLE_HORN(Entity_NPC *npc) { void *pvVar1; float fVar2; void *pvVar3; undefined4 uVar4; int iVar5; qword qVar6; int iVar7; int iVar8; undefined1 *puVar9; byte bVar10; undefined1 uVar11; char cVar12; float *damageEvent; LayerState *layer; uint uVar13; Entity_Player *player; Vector *pVVar14; int iVar15; Entity *pEVar16; Entity_NPC *pEVar17; uint variant; Entity *player; byte unk; int unused; qword *allocatedBytes; ANM2 *sprite; int *piVar19; Game *game; float fVar20; double dVar21; float fVar22; float fVar23; undefined4 local_bc [8]; undefined4 local_9c; undefined4 uStack_98; undefined4 local_94; EntityList_EL bombs; Vector local_80; Vector local_78; undefined1 local_70 [12]; Entity_NPC *local_64; undefined1 local_60 [12]; float local_54; float local_50; float wanderTargetY; float wanderTargetX; undefined1 local_44 [12]; Entity *local_38; Vector local_34; AnimationState *local_2c; Entity *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; AnimationState *animState; Manager *manager; Room *room; puStack_20 = local_44 + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00af2e05; local_1c = ExceptionList; local_64 = npc; if (npc->_variant != 0) { if (npc->_variant != 1) { return; } if (npc->_state == 0) { local_9c = 0; uStack_98 = 0; local_94 = 0; ExceptionList = &local_1c; if (&npc->_splatColor != (ColorMod *)local_bc) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.8; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } (npc->_sprite)._offset.x = 0.0; (npc->_sprite)._offset.y = -20.0; npc->_state = 3; npc->_entityGridCollisionClass = 3; puStack_20 = local_44 + 0x40; ANM2::Play(&npc->_sprite,s_Idle,0); ExceptionList = local_1c; return; } ExceptionList = &local_1c; npc->_stateFrame = npc->_stateFrame + 1; if (npc->_subtype == 0) { npc->_friction = npc->_friction * 0.8; puStack_20 = local_44 + 0x40; pVVar14 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_60 + 8),0.0); fVar20 = npc->_speedMultiplier; local_60._8_4_ = pVVar14->x - (npc->_pos).x; local_54 = pVVar14->y - (npc->_pos).y; fVar22 = 1.1764705; if (fVar20 != 1.0) { fVar22 = 1.1764705 / ((fVar20 + 1.1764705) - fVar20 * 1.1764705); } local_38 = (Entity *)(fVar22 * (npc->_velocity).x); (npc->_velocity).x = (float)local_38; (npc->_velocity).y = fVar22 * (npc->_velocity).y; pVVar14 = Vector::Normalized((Vector *)(local_60 + 8),(Vector *)(local_70 + 8)); fVar20 = npc->_scale; fVar22 = npc->_friction; fVar23 = pVVar14->x; if (fVar22 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).y = (fVar2 * pVVar14->y * 0.5 * fVar20) / fVar22 + (npc->_velocity).y; (npc->_velocity).x = (fVar2 * fVar23 * 0.5 * fVar20) / fVar22 + (float)local_38; } game = g_game; npc->_mass = 8.0; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_44,0x194,1,-1,1,0) ; uVar13 = 0; local_14 = 6; if (local_38 != (Entity *)0x0) { do { pEVar17 = *(Entity_NPC **)(local_44._4_4_ + uVar13 * 4); if (pEVar17 != npc) { local_34.y = (npc->_pos).x; local_24 = (int *)(npc->_pos).y; fVar22 = (pEVar17->_pos).x - local_34.y; fVar20 = (pEVar17->_pos).y - (float)local_24; fVar20 = sqrtf(fVar20 * fVar20 + fVar22 * fVar22); if (fVar20 < 100.0) { iVar15 = *(int *)(local_44._4_4_ + uVar13 * 4); local_34.y = local_34.y - *(float *)(iVar15 + 0x33c); local_24 = (int *)((float)local_24 - *(float *)(iVar15 + 0x340)); fVar22 = sqrtf(local_34.y * local_34.y + (float)local_24 * (float)local_24); fVar20 = local_34.y; piVar19 = local_24; if (0.0 < fVar22) { fVar22 = (100.0 - fVar22) / fVar22; fVar20 = local_34.y * fVar22; piVar19 = (int *)((float)local_24 * fVar22); } fVar22 = npc->_friction; if (fVar22 != 0.0) { fVar23 = npc->_speedMultiplier; (npc->_velocity).y = (fVar23 * (float)piVar19 * 0.003) / fVar22 + (npc->_velocity).y ; (npc->_velocity).x = (fVar23 * fVar20 * 0.003) / fVar22 + (npc->_velocity).x; } } } uVar13 = uVar13 + 1; } while (uVar13 < local_38); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,4,-1,-1,1,0); fVar20 = 0.0; if (local_54 != 0.0) { do { pEVar17 = *(Entity_NPC **)(local_60._4_4_ + (int)fVar20 * 4); if (pEVar17 != npc) { local_34.y = (npc->_pos).x; local_24 = (int *)(npc->_pos).y; fVar23 = (pEVar17->_pos).x - local_34.y; fVar22 = (pEVar17->_pos).y - (float)local_24; fVar22 = sqrtf(fVar22 * fVar22 + fVar23 * fVar23); if (fVar22 < 100.0) { iVar15 = *(int *)(local_60._4_4_ + (int)fVar20 * 4); local_34.y = local_34.y - *(float *)(iVar15 + 0x33c); local_24 = (int *)((float)local_24 - *(float *)(iVar15 + 0x340)); fVar23 = sqrtf(local_34.y * local_34.y + (float)local_24 * (float)local_24); fVar22 = local_34.y; piVar19 = local_24; if (0.0 < fVar23) { fVar23 = (100.0 - fVar23) / fVar23; fVar22 = local_34.y * fVar23; piVar19 = (int *)((float)local_24 * fVar23); } fVar23 = npc->_friction; if (fVar23 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).y = (fVar2 * (float)piVar19 * 0.01) / fVar23 + (npc->_velocity).y; (npc->_velocity).x = (fVar2 * fVar22 * 0.01) / fVar23 + (npc->_velocity).x; } } } fVar20 = (float)((int)fVar20 + 1); } while ((uint)fVar20 < (uint)local_54); } if (local_60[0] == '\0') { local_14 = CONCAT31(local_14._1_3_,7); tracked_alloc(1,(void *)local_60._4_4_,0); } local_14 = 0xffffffff; puVar9 = puStack_20; if (local_44[0] == '\0') { local_14 = 8; tracked_alloc(1,(void *)local_44._4_4_,0); local_14 = 0xffffffff; puVar9 = puStack_20; } } else { puVar9 = local_44 + 0x40; if (npc->_subtype == 1) { npc->_friction = 1.0; npc->_mass = 8.0; pVVar14 = Vector::Normalized(&npc->_velocity,(Vector *)(local_60 + 8)); fVar20 = pVVar14->y; (npc->_velocity).x = pVVar14->x * 10.0; (npc->_velocity).y = fVar20 * 10.0; puVar9 = puStack_20; } } puStack_20 = puVar9; local_80.y = 4.2039e-45; do { uVar13 = Random(); pEVar16 = Game::Spawn(g_game,1000,0x58,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar13); local_38 = pEVar16; if (pEVar16 != (Entity *)0x0) { if (-1 < npc->_bosscoloridx) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Sprite::ReplaceSpritesheet((Sprite *)&pEVar16->_sprite,0,&layer->_spriteSheetPath); ANM2::LoadGraphics(&pEVar16->_sprite,unk); } fVar20 = (npc->_velocity).y; (pEVar16->_velocity).x = (npc->_velocity).x * -0.5; (pEVar16->_velocity).y = fVar20 * -0.5; uVar13 = Random(); fVar20 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38 = (Entity *)(fVar20 + fVar20); uVar13 = Random(); fVar20 = (npc->_velocity).y; local_64 = (Entity_NPC *) ((float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10); fVar22 = (npc->_velocity).x; local_78.y = sqrtf(fVar22 * fVar22 + fVar20 * fVar20); fVar20 = cos((float)local_38); local_50 = fVar20 * (float)local_64 * local_78.y * 0.4; fVar22 = sin((float)local_38); fVar20 = pEVar16->_friction; if (fVar20 != 0.0) { fVar23 = pEVar16->_speedMultiplier; (pEVar16->_velocity).y = (fVar23 * fVar22 * (float)local_64 * local_78.y * 0.4) / fVar20 + (pEVar16->_velocity).y; (pEVar16->_velocity).x = (fVar23 * local_50) / fVar20 + (pEVar16->_velocity).x; } (pEVar16->_sprite)._offset.x = 0.0; (pEVar16->_sprite)._offset.y = -20.0; fVar20 = npc->_scale; (pEVar16->_sprite)._scale.x = fVar20; (pEVar16->_sprite)._scale.y = fVar20; } local_80.y = (float)((int)local_80.y + -1); } while (local_80.y != 0.0); ExceptionList = local_1c; return; } animState = &(npc->_sprite)._animState; ExceptionList = &local_1c; local_28 = (Entity *)animState; puStack_20 = local_44 + 0x40; if ((npc->_sprite)._animState._animData != (void *)0x0) { local_38 = (Entity *)animState; puStack_20 = local_44 + 0x40; bVar10 = AnimationState::IsEventTriggered(animState,(byte *)"HoleOpen"); manager = g_manager; local_28 = (Entity *)animState; if (bVar10 != 0) { local_28 = (Entity *)0x3b3; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); local_28 = local_38; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar10 = AnimationState::IsEventTriggered((AnimationState *)local_28,(byte *)"HoleExit"); manager = g_manager; if (bVar10 != 0) { local_2c = (AnimationState *)0x3b4; seed_fart_sound_override((int *)&local_2c); SoundEffects::Play(&manager->_sfxManager,(int)local_2c,1.0,2,0,1.0,0.0); } } sprite = &npc->_sprite; if ((0.0 < npc->_pendingDamage) && ((npc->_pendingDamageFlags & 4) != 0)) { npc->_pendingDamage = 0.0; damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { fVar20 = *damageEvent; if (damageEvent[6] == (float)npc->_type) { fVar20 = fVar20 * 0.25; *damageEvent = fVar20; } damageEvent = damageEvent + 0xe; npc->_pendingDamage = fVar20 + npc->_pendingDamage; } while (damageEvent != (npc->_damageEvents)._end); } } iVar15 = npc->_state; if (iVar15 == 0) { npc->_state = 3; npc->_entityGridCollisionClass = 3; npc->_i1 = 0; ExceptionList = local_1c; return; } if (0 < npc->_i1) { npc->_i1 = npc->_i1 + -1; } npc->_friction = npc->_friction * 0.8; if (iVar15 != 3) { if (iVar15 == 8) { ANM2::Play(sprite,(byte *)"Shoot",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar10 = AnimationState::IsEventTriggered((AnimationState *)local_28,(byte *)"Shoot"); if (bVar10 != 0) { uVar13 = Random(); manager = g_manager; local_38 = (Entity *)0x19e; local_64 = (Entity_NPC *) ((float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,(float)local_64,0.0); pVVar14 = &npc->_pos; if (npc->_subtype == 1) { pEVar16 = Entity_NPC::GetPlayerTarget(npc); local_60._8_4_ = (pEVar16->_pos).x - pVVar14->x; local_54 = (pEVar16->_pos).y - (npc->_pos).y; Vector::Normalized((Vector *)(local_60 + 8),(Vector *)(local_44 + 8)); uVar13 = Random(); local_60._8_4_ = (float)local_44._8_4_ * 15.0; local_70._8_4_ = (float)local_44._8_4_ * 5.0 + pVVar14->x; local_54 = (float)local_38 * 15.0; local_64 = (Entity_NPC *)((float)local_38 * 5.0 + (npc->_pos).y); pEVar16 = Game::Spawn(g_game,4,8,(Vector *)(local_70 + 8),(Vector *)(local_60 + 8), (Entity *)npc,0,uVar13); iVar5 = DAT_00c34c0c; iVar8 = DAT_00c34c08; iVar7 = DAT_00c34c04; iVar15 = *(int *)pEVar16; pEVar16[1]._variant = DAT_00c34c00; pEVar16[1]._subtype = iVar7; pEVar16[1]._spawnerType = iVar8; pEVar16[1]._spawnerVariant = iVar5; pEVar16[1]._sprite._filename._buf[0xf] = '\x01'; (**(code **)(iVar15 + 0x40))(0x3f800000); if ((pEVar16->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar16->_sprite)._animState,8.0); } } else { uVar13 = Random(); pEVar17 = (Entity_NPC *) Game::Spawn(g_game,0x194,1,pVVar14,&g_vectorZero,(Entity *)npc,0,uVar13); (pEVar17->_velocity).x = 0.0; (pEVar17->_velocity).y = 4.0; Entity_NPC::SetBossColorIdx(pEVar17,npc->_bosscoloridx,unused); *(uint *)&pEVar17->_flags = (uint)pEVar17->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar17->_flags + 4) = *(undefined4 *)((int)&pEVar17->_flags + 4); fVar20 = npc->_friction; if (fVar20 != 0.0) { fVar22 = npc->_speedMultiplier; (npc->_velocity).x = (fVar22 * 0.0) / fVar20 + (npc->_velocity).x; (npc->_velocity).y = (npc->_velocity).y - (fVar22 * 3.5) / fVar20; } } } goto LAB_00491d76; } } else { if (iVar15 == 9) { ANM2::Play(sprite,&DAT_00b1ce1c,0); iVar15 = npc->_state; if (iVar15 == 10) goto LAB_00491b1a; } else { if (iVar15 != 10) { if ((iVar15 == 6) || (iVar15 == 0x10)) { if (npc->_stateFrame == 0) { ANM2::Play(sprite,(byte *)"Teleport",0); bVar10 = Sprite::IsEventTriggered((Sprite *)sprite,&DAT_00b1d33c); manager = g_manager; if (bVar10 != 0) { local_38 = (Entity *)0x3b2; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); } bVar10 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"CollisionOff"); if (bVar10 != 0) { npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if ((npc->_state == 0x10) && (iVar15 = npc->_subtype, iVar15 != 2)) { uVar13 = Random(); variant = 8; if (iVar15 != 1) { variant = 3; } pEVar16 = Game::Spawn(g_game,4,variant,&npc->_pos,&g_vectorZero,(Entity *)npc,1, uVar13); iVar8 = DAT_00c34c0c; iVar7 = DAT_00c34c08; iVar15 = DAT_00c34c04; if (npc->_subtype == 1) { iVar5 = *(int *)pEVar16; pEVar16[1]._variant = DAT_00c34c00; pEVar16[1]._subtype = iVar15; pEVar16[1]._spawnerType = iVar7; pEVar16[1]._spawnerVariant = iVar8; pEVar16[1]._sprite._filename._buf[0xf] = '\x01'; (**(code **)(iVar5 + 0x40))(0x3f800000); } } npc->_stateFrame = 1; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (npc->_i2 == 1) { uVar13 = Random(); dVar21 = (double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]; iVar15 = 0x1a0; } else { uVar13 = Random(); dVar21 = (double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]; iVar15 = 0x19f; } SoundEffects::PlayWithFartOverride (iVar15,1.0,2,0,(float)dVar21 * 2.3283064e-10 * 0.2 + 0.9); local_50 = (npc->_pos).x; local_2c = (AnimationState *)(npc->_pos).y; local_64 = (Entity_NPC *)0x1e; game = g_game; do { room = game->_room; local_28 = (Entity *)((uint)local_28 & 0xffffff00); pVVar14 = Room::GetRandomPosition(room,(Vector *)(local_60 + 8),0.0); pVVar14 = Room::FindFreePickupSpawnPosition(room,&local_34,pVVar14,0.0,0,0,0); game = g_game; (npc->_pos).x = pVVar14->x; fVar20 = pVVar14->y; (npc->_pos).y = fVar20; local_38 = (Entity *)0x0; if ((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2 == 0) { fVar22 = (npc->_pos).x; } else { do { player = Game::GetPlayer(game,(uint)local_38); local_80.y = (npc->_pos).x; fVar22 = (player->_pos).x - local_80.y; local_78.y = (npc->_pos).y; fVar20 = (player->_pos).y - local_78.y; fVar20 = sqrtf(fVar20 * fVar20 + fVar22 * fVar22); local_28 = (Entity *)((uint)local_28 & 0xff); if (fVar20 < 120.0) { local_28 = (Entity *)0x1; } local_38 = (Entity *)&local_38->field_0x1; game = g_game; } while (local_38 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); fVar20 = local_78.y; fVar22 = local_80.y; } fVar20 = sqrtf((local_50 - fVar22) * (local_50 - fVar22) + ((float)local_2c - fVar20) * ((float)local_2c - fVar20)); cVar12 = (char)local_28; if (fVar20 < 160.0) { cVar12 = '\x01'; } local_64 = (Entity_NPC *)((int)&local_64[-1]._pickupGhostsEntity + 3); } while ((0 < (int)local_64) && (cVar12 != '\0')); Entity_NPC::UpdateDirtColor(npc,1); } } if (npc->_stateFrame == 1) { ANM2::Play(&npc->_sprite,(byte *)"Return",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar10 = AnimationState::WasEventTriggered (&(npc->_sprite)._animState,(byte *)"CollisionOn"); if (bVar10 != 0) { npc->_entityCollisionClass = 4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00491d99; } iVar15 = npc->_i2 + -1; npc->_i2 = iVar15; npc->_stateFrame = 0; if (iVar15 < 1) { npc->_state = 3; npc->_i1 = 0x4b; } } goto LAB_00491d99; } if ((iVar15 != 0xd) && (iVar15 != 0xe)) goto LAB_00491d99; ANM2::Play(sprite,(byte *)"Summon",0); bVar10 = Sprite::IsEventTriggered((Sprite *)sprite,"Summon"); if (bVar10 != 0) { local_64 = (Entity_NPC *)0x2; piVar19 = (int *)0x1; local_24 = (int *)0x1; if (npc->_state == 0xe) { uVar13 = Random(); if (uVar13 % 100 < 10) { local_24 = (int *)&DAT_00000005; } else { if (uVar13 % 100 < 0x32) { piVar19 = (int *)0x3; } local_24 = piVar19; } } else { local_64 = (Entity_NPC *)0x0; } uVar13 = Random(); SoundEffects::PlayWithFartOverride (0x19f,1.0,2,0, (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); pEVar16 = Entity_NPC::GetPlayerTarget(npc); local_78.y = atan2f((pEVar16->_pos).y - (npc->_pos).y,(pEVar16->_pos).x - (npc->_pos).x) ; local_78.y = local_78.y * 57.295776; local_28 = (Entity *)0x0; do { uVar13 = Random(); pEVar16 = Game::Spawn(g_game,0x123,(uint)local_64,&npc->_pos,&g_vectorZero, (Entity *)npc,0,uVar13); if (pEVar16 != (Entity *)0x0) { *(undefined4 *)&pEVar16[1].field_0x4 = 0xf0; if (npc->_state == 0xe) { local_38 = (Entity *) ((((float)(int)local_28 / (float)(int)local_24) * 360.0 + local_78.y) * 0.017453292); local_34.y = cos((float)local_38); fVar20 = sin((float)local_38); local_38 = (Entity *)(local_34.y - fVar20 * 0.0); local_34.y = local_34.y * 0.0 + fVar20; fVar20 = sqrtf(local_34.y * local_34.y + (float)local_38 * (float)local_38); if (fVar20 <= 0.0) { player = local_38; fVar20 = local_34.y; } else { player = (Entity *)((float)local_38 * (8.75 / fVar20)); fVar20 = local_34.y * (8.75 / fVar20); } uVar4 = *(undefined4 *)((int)&pEVar16->_flags + 4); *(uint *)&pEVar16->_flags = (uint)pEVar16->_flags & 0xfffffffb; (pEVar16->_velocity).x = (float)player; (pEVar16->_velocity).y = fVar20; *(undefined4 *)((int)&pEVar16->_flags + 4) = uVar4; } (**(code **)(*(int *)pEVar16 + 0xc))(); } local_28 = (Entity *)&local_28->field_0x1; } while ((int)local_28 < (int)local_24); } goto LAB_00491d76; } LAB_00491b1a: ANM2::Play(sprite,(byte *)"MegaBomb",0); iVar15 = npc->_state; } local_2c = &(npc->_sprite)._animState; local_28 = (Entity *)((iVar15 == 10) + 3); if (npc->_subtype == 1) { local_28 = (Entity *)&DAT_00000008; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00491ccb: pEVar16 = local_28; } else { bVar10 = AnimationState::IsEventTriggered(local_2c,(byte *)"BombDrop"); manager = g_manager; if (bVar10 != 0) { local_38 = (Entity *)0x3b1; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); local_2c = &(npc->_sprite)._animState; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar10 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1ce1c), bVar10 == 0)) goto LAB_00491ccb; uVar13 = Random(); manager = g_manager; local_38 = (Entity *)0x1a0; local_64 = (Entity_NPC *) ((float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,(float)local_64,0.0); room = g_game->_room; pVVar14 = Entity_NPC::CalcTargetPosition(npc,&local_78,0.0); pVVar14 = Room::FindFreePickupSpawnPosition(room,&local_80,pVVar14,40.0,0,0,0); pEVar16 = local_28; player = Game::Spawn(g_game,4,(uint)local_28,pVVar14,&g_vectorZero,(Entity *)npc,1,1); iVar8 = DAT_00c34c0c; iVar7 = DAT_00c34c08; iVar15 = DAT_00c34c04; if (npc->_subtype == 1) { iVar5 = *(int *)player; player[1]._variant = DAT_00c34c00; player[1]._subtype = iVar15; player[1]._spawnerType = iVar7; player[1]._spawnerVariant = iVar8; player[1]._sprite._filename._buf[0xf] = '\x01'; (**(code **)(iVar5 + 0x40))(0x3f800000); } } if ((npc->_dead != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar10 = AnimationState::WasEventTriggered(local_2c,&DAT_00b1ce1c), bVar10 == 0)))) { uVar13 = Random(); local_70._8_4_ = (npc->_pos).x + 0.0; local_60._8_4_ = 0.0; local_64 = (Entity_NPC *)((npc->_pos).y + 5.0); local_54 = 3.0; pEVar16 = Game::Spawn(g_game,4,(uint)pEVar16,(Vector *)(local_70 + 8), (Vector *)(local_60 + 8),(Entity *)npc,0,uVar13); iVar8 = DAT_00c34c0c; iVar7 = DAT_00c34c08; iVar15 = DAT_00c34c04; if (npc->_subtype == 1) { iVar5 = *(int *)pEVar16; pEVar16[1]._variant = DAT_00c34c00; pEVar16[1]._subtype = iVar15; pEVar16[1]._spawnerType = iVar7; pEVar16[1]._spawnerVariant = iVar8; pEVar16[1]._sprite._filename._buf[0xf] = '\x01'; (**(code **)(iVar5 + 0x40))(0x3f800000); } } LAB_00491d76: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00491d99; } npc->_stateFrame = 0; npc->_state = 3; goto LAB_00491d99; } layer = ANM2::GetLayer(sprite,&DAT_00b1d57c); layer->_visible = 1; ANM2::Play(sprite,s_Idle,0); if (((npc->_v1).x == g_vectorZero.x) && ((npc->_v1).y == g_vectorZero.y)) { npc->_stateFrame = 0; LAB_004908d2: local_24 = &npc->_stateFrame; uVar13 = Random(); fVar20 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38 = (Entity *)(fVar20 + fVar20); local_34.y = sin((float)local_38); fVar20 = cos((float)local_38); local_38 = (Entity *)(fVar20 * 1.2); local_34.y = local_34.y * 1.2; uVar13 = Random(); fVar20 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10; (npc->_v1).x = (float)local_38 * fVar20; (npc->_v1).y = local_34.y * fVar20; iVar15 = *local_24; } else { iVar15 = npc->_stateFrame; local_24 = &npc->_stateFrame; if (0x32 < iVar15) { *local_24 = 0; goto LAB_004908d2; } if (iVar15 == 0) goto LAB_004908d2; } local_34.y = (float)((uint)local_34.y & 0xffffff00); *local_24 = iVar15 + 1; local_28 = (Entity *)&npc->_pos; local_60._8_4_ = (npc->_pos).x + (npc->_v1).x; local_54 = (npc->_pos).y + (npc->_v1).y; wanderTargetY = local_54; wanderTargetX = (float)local_60._8_4_; if (((npc->_flags & 0x20000000) == 0) && (local_2c = (AnimationState *)0x0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,(uint)local_2c); fVar20 = (player->_pos).y - wanderTargetY; fVar22 = (player->_pos).x - wanderTargetX; fVar20 = sqrtf(fVar20 * fVar20 + fVar22 * fVar22); if (fVar20 < 190.0) { local_50 = wanderTargetX - (player->_pos).x; local_80.y = wanderTargetY - (player->_pos).y; fVar20 = sqrtf(local_50 * local_50 + local_80.y * local_80.y); if (fVar20 <= 0.0) { fVar22 = local_50; fVar20 = local_80.y; } else { fVar20 = ((190.0 - fVar20) * 0.03) / fVar20; fVar22 = local_50 * fVar20; fVar20 = local_80.y * fVar20; } wanderTargetX = wanderTargetX + fVar22; wanderTargetY = wanderTargetY + fVar20; } local_60._8_4_ = wanderTargetX; local_54 = wanderTargetY; player = Game::GetPlayer(g_game,(uint)local_2c); fVar20 = (player->_pos).y - *(float *)&local_28->field_0x4; fVar22 = (player->_pos).x - *(float *)local_28; fVar20 = sqrtf(fVar20 * fVar20 + fVar22 * fVar22); local_34.y = (float)((uint)local_34.y & 0xff); if (fVar20 < 120.0) { local_34.y = 1.4013e-45; } local_2c = (AnimationState *)((int)&local_2c->_animation + 1); } while (local_2c < (AnimationState *) ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); npc = local_64; } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&bombs,4,-1,-1,1,0); local_14 = 0; local_38 = bombs._data; if (bombs._size != 0) { uVar13 = 0; do { iVar15 = *(int *)((int)(&(local_38->_sprite)._filename + -3) + uVar13 * 4); local_2c = *(AnimationState **)(iVar15 + 0x33c); local_78.y = *(float *)(iVar15 + 0x340); fVar20 = sqrtf((local_78.y - wanderTargetY) * (local_78.y - wanderTargetY) + ((float)local_2c - wanderTargetX) * ((float)local_2c - wanderTargetX)); if (fVar20 < 130.0) { local_80.y = wanderTargetX - (float)local_2c; local_50 = wanderTargetY - local_78.y; fVar20 = sqrtf(local_80.y * local_80.y + local_50 * local_50); if (fVar20 <= 0.0) { fVar22 = local_80.y; fVar20 = local_50; } else { fVar20 = ((130.0 - fVar20) * 0.03) / fVar20; fVar22 = local_80.y * fVar20; fVar20 = local_50 * fVar20; } wanderTargetX = wanderTargetX + fVar22; wanderTargetY = wanderTargetY + fVar20; } fVar20 = local_78.y - *(float *)&local_28->field_0x4; local_60._8_4_ = wanderTargetX; local_54 = wanderTargetY; fVar20 = sqrtf(fVar20 * fVar20 + ((float)local_2c - *(float *)local_28) * ((float)local_2c - *(float *)local_28) ); uVar11 = SUB41(local_34.y,0); if (fVar20 < 120.0) { uVar11 = 1; } uVar13 = uVar13 + 1; local_34.y = (float)CONCAT31(local_34.y._1_3_,uVar11); } while (uVar13 < (uint)bombs._size); npc = local_64; } game = g_game; fVar20 = npc->_size; Room::GetClampedPositionImpl (g_game->_room,(Vector *)(local_70 + 8),(Vector *)(local_60 + 8),fVar20,fVar20,fVar20, fVar20); Room::GetClampedPositionImpl (game->_room,(Vector *)(local_60 + 8),&npc->_pos,100.0,100.0,100.0,100.0); fVar22 = (float)local_60._8_4_ - (npc->_pos).x; fVar20 = local_54 - (npc->_pos).y; if ((fVar22 != 0.0) && (fVar20 != 0.0)) { if (ABS(fVar22) <= ABS(fVar20)) { fVar20 = 0.0; fVar22 = fVar22 + fVar22; } else { fVar22 = 0.0; fVar20 = fVar20 + fVar20; } } local_54 = *(float *)((int)&npc->_flags + 4); qVar6 = npc->_flags; fVar22 = fVar22 * 0.03 + (float)local_70._8_4_; fVar20 = fVar20 * 0.03 + (float)local_64; if (((((qVar6 & 0x100) != 0) || ((qVar6 & 0x200) != 0)) || ((qVar6 & 0x800) != 0)) || ((qVar6 & 0x1000800) != 0)) { pVVar14 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_60 + 8),0.0); fVar22 = pVVar14->x; fVar20 = pVVar14->y; } local_64 = (Entity_NPC *)(fVar22 - (npc->_pos).x); local_78.y = fVar20 - (npc->_pos).y; fVar22 = sqrtf(local_78.y * local_78.y + (float)local_64 * (float)local_64); fVar20 = local_78.y; if ((0.8 < fVar22) && (0.0 < fVar22)) { fVar20 = (0.8 / fVar22) * local_78.y; local_64 = (Entity_NPC *)((0.8 / fVar22) * (float)local_64); } fVar22 = npc->_friction; if (fVar22 != 0.0) { fVar23 = npc->_speedMultiplier; (npc->_velocity).x = ((float)local_64 * fVar23) / fVar22 + (npc->_velocity).x; (npc->_velocity).y = (fVar20 * fVar23) / fVar22 + (npc->_velocity).y; } fVar20 = npc->_maxHitPoints * 0.3; local_64 = (Entity_NPC *)&DAT_00000014; if (npc->_health <= fVar20 && fVar20 != npc->_health) { local_64 = (Entity_NPC *)0x32; } if ((local_34.y._0_1_ == '\0') && ((bVar10 = Entity::IsFrame((Entity *)npc,0xf,npc->_index), bVar10 == 0 || (uVar13 = Random(), 0xe < uVar13 % 100)))) { piVar19 = local_24; } else { piVar19 = local_24; if (npc->_i1 < 1) { npc->_state = 6; *local_24 = 0; npc->_i2 = 1; uVar13 = Random(); if ((int)(uVar13 % 100) < (int)local_64) { uVar13 = Random(); npc->_i2 = uVar13 % 3 + 3; npc->_state = 0x10; } Entity_NPC::UpdateDirtColor(npc,1); } } if (((((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) && (bVar10 = Entity::IsFrame((Entity *)npc,0xf,npc->_index), bVar10 != 0)) && (uVar13 = Random(), uVar13 % 100 < 0x19)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,0x194,1,-1,1,0) ; local_14._0_1_ = 1; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_70,0x123,-1,-1,0,0 ); local_14 = CONCAT31(local_14._1_3_,2); if (local_54 == 0.0) { uVar13 = Random(); if (0x3b < uVar13 % 100) goto LAB_00491070; LAB_00491091: npc->_state = 8; *piVar19 = 0; } else { if ((uint)local_54 < 3) { LAB_00491070: uVar13 = Random(); if (uVar13 % 100 < 0x14) goto LAB_00491091; } if ((npc->_subtype == 2) && ((uint)local_54 < 2)) goto LAB_00491091; if (local_64 == (Entity_NPC *)0x0) { uVar13 = Random(); if (uVar13 % 100 < 0x32) goto LAB_0049117e; LAB_004910c5: if (npc->_subtype != 2) { uVar13 = Random(); if ((uVar13 % 100 < 0x4b) || (iVar15 = 10, npc->_subtype == 1)) { iVar15 = 9; } npc->_state = iVar15; *piVar19 = 0; Entity_NPC::UpdateDirtColor(npc,1); } } else { if ((local_64 != (Entity_NPC *)0x1) || (uVar13 = Random(), 9 < uVar13 % 100)) goto LAB_004910c5; LAB_0049117e: cVar12 = NpcHelper::big_horn_is_any_hole_busy(); if ((cVar12 != '\0') || (((npc->_subtype == 2 || (npc->_subtype == 1)) || (bVar10 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar10 != 0)))) goto LAB_004910c5; pEVar16 = Entity_NPC::GetPlayerTarget(npc); fVar20 = (pEVar16->_pos).y - (npc->_pos).y; fVar22 = (pEVar16->_pos).x - (npc->_pos).x; fVar20 = sqrtf(fVar20 * fVar20 + fVar22 * fVar22); npc->_state = (140.0 <= fVar20) + 0xd; *piVar19 = 0; } } if (local_70[0] == '\0') { local_14 = CONCAT31(local_14._1_3_,3); tracked_alloc(1,(void *)local_70._4_4_,0); } if (local_60[0] == '\0') { local_14 = CONCAT31(local_14._1_3_,4); tracked_alloc(1,(void *)local_60._4_4_,0); } } local_14 = 0xffffffff; if (bombs._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (local_38 != (Entity *)0x0) { pvVar3 = local_38[-1]._luaBridgeRef; pvVar1 = *(void **)allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - (int)pvVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)(pvVar1 < pvVar3); free(&local_38[-1]._luaBridgeRef); } local_14 = 0xffffffff; } LAB_00491d99: manager = g_manager; if (npc->_dead == 0) { ExceptionList = local_1c; return; } local_38 = (Entity *)0x3b0; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); ExceptionList = local_1c; return; } //@@ 00492550 NpcAI::ENTITY_PITFALL /* NPC AI for entity type 291 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PITFALL(Entity_NPC *npc) { byte bVar1; int iVar2; uint uVar3; byte *pbVar4; Entity_Player *player; Vector *pVVar5; RoomDescriptor *roomDesc; Entity_Player *trappedPlayer; byte *pbVar6; Vector *pVVar7; char *pcVar8; byte *expectedName; int iVar9; bool isLess; float fVar10; float fVar11; float pullDirX; float local_2c; Vector local_28; Vector local_20; Vector local_18; Vector local_10; undefined4 flagsHigh; Game *game; void *room; if (npc->_state == 0) { npc->_state = 2; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; npc->_sortingLayer = 0; npc->_renderZOffset = 0xc1c; local_10.y = 0.5; local_10.x = 1.0; Entity::SetSize((Entity *)npc,npc->_size,(Vector)0x3f0000003f800000, *(int *)((int)npc->_config + 0x48)); game = g_game; fVar10 = npc->_size; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x4000011; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; Room::GetClampedPositionImpl (game->_room,&local_10,&npc->_pos,fVar10 * 0.5,fVar10,fVar10 * 0.5,fVar10); (npc->_pos).x = local_10.x; (npc->_pos).y = local_10.y; (npc->_v1).x = 1.0; Entity_NPC::UpdateDirtColor(npc,1); } room = g_game->_room; iVar9 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if (((((-1 < iVar9) && (iVar9 < *(int *)((int)room + 0xc))) && (iVar2 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), -1 < iVar2)) && ((iVar2 < *(int *)((int)room + 0x10) && (uVar3 = iVar2 * *(int *)((int)room + 0xc) + iVar9, uVar3 < 0x1c0)))) && (*(int *)((int)room + uVar3 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)room + uVar3 * 4 + 0x76c) = 900; } if (npc->_state == 2) { pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { LAB_00492742: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar4 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar4 = *(byte **)pbVar6; } pcVar8 = "Appear"; do { bVar1 = *pbVar4; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00492724: uVar3 = -(uint)isLess | 1; goto LAB_00492729; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00492724; pbVar4 = pbVar4 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00492729: if ((uVar3 != 0) || ((pbVar6[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00492742; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_entityCollisionClass = 3; } } if (npc->_state == 2) { LAB_004928f2: iVar9 = npc->_variant; if ((((iVar9 != 3) && (npc->_state == 3)) && ((npc->_flags & 0x20000000) == 0)) && (local_2c = 0.0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,(uint)local_2c); fVar10 = (npc->_sizeMulti).x; fVar11 = (npc->_sizeMulti).y; fVar10 = (player->_pos).x / fVar10 - (npc->_pos).x / fVar10; fVar11 = (player->_pos).y / fVar11 - (npc->_pos).y / fVar11; if ((((fVar11 * fVar11 + fVar10 * fVar10 < npc->_size * npc->_size) && (iVar9 = player->_entityGridCollisionClass, iVar9 != 0)) && ((iVar9 != 3 && ((iVar9 != 1 && (iVar9 != 2)))))) && (player->_pitfallState == 0)) { bVar1 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x271); if (bVar1 == 0) { Entity_Player::PlayExtraAnimation(player,(byte *)"FallIn"); player->_isControlsEnabled = 0; player->_entityCollisionClass = 0; player->_pitfallState = 1; player->_pitfallTimer = 0; } npc->_state = 0x10; if (npc->_parent != (EntityPtr)0x0) { local_28.y = (float)&npc->_parent; std::multiset::erase(&local_28.y); } npc->_parent = (EntityPtr)player; std::multiset::insert(&npc->_parent); npc->_stateFrame = 0; } local_2c = (float)((int)local_2c + 1); } while ((uint)local_2c < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); iVar9 = npc->_variant; } if (iVar9 == 1) { local_28.y = 0.0; local_10.x = (float)g_game->_room; if (*(int *)((int)local_10.x + 0x1264) != 0) { do { iVar9 = *(int *)(*(int *)((int)local_10.x + 0x125c) + (int)local_28.y * 4); iVar2 = *(int *)(iVar9 + 0x28); if (((iVar2 == 1) || (iVar2 == 2)) || (iVar2 == 9)) { pullDirX = *(float *)(iVar9 + 0x33c); local_2c = *(float *)(iVar9 + 0x340); if ((iVar2 == 1) && (iVar2 = *(int *)(iVar9 + 0x1e68), iVar2 != 0)) { fVar11 = pullDirX - *(float *)(iVar2 + 0x33c); fVar10 = local_2c - *(float *)(iVar2 + 0x340); if (fVar10 * fVar10 + fVar11 * fVar11 < 2704.0) { pullDirX = (pullDirX + *(float *)(iVar2 + 0x33c)) * 0.5; local_2c = (local_2c + *(float *)(iVar2 + 0x340)) * 0.5; } } local_20.x = (npc->_pos).x; local_18.x = (npc->_pos).y; pullDirX = local_20.x - pullDirX; local_2c = local_18.x - local_2c; fVar10 = sqrtf(local_2c * local_2c + pullDirX * pullDirX); if (0.0 < fVar10) { pullDirX = pullDirX * (1.0 / fVar10); local_2c = local_2c * (1.0 / fVar10); } local_28.x = 0.9; if (*(int *)(iVar9 + 0x28) == 1) { local_28.x = 0.6; } local_28.x = local_28.x * (npc->_v1).x; fVar11 = local_20.x - *(float *)(iVar9 + 0x33c); fVar10 = local_18.x - *(float *)(iVar9 + 0x340); fVar11 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); fVar10 = *(float *)(iVar9 + 0x36c); local_20.x = 0.0; local_18.x = ((300.0 - fVar11) * local_28.x) / 300.0; pVVar7 = &local_18; if (local_18.x <= 0.0) { pVVar7 = &local_20; } pVVar5 = &local_28; if (pVVar7->x <= local_28.x && local_28.x != pVVar7->x) { pVVar5 = pVVar7; } fVar11 = pVVar5->x; if (fVar10 != 0.0) { *(float *)(iVar9 + 0x360) = (fVar11 * pullDirX * *(float *)(iVar9 + 0x39c)) / fVar10 + *(float *)(iVar9 + 0x360); *(float *)(iVar9 + 0x364) = (*(float *)(iVar9 + 0x39c) * fVar11 * local_2c) / fVar10 + *(float *)(iVar9 + 0x364); } } local_28.y = (float)((int)local_28.y + 1); } while ((uint)local_28.y < *(undefined1 **)((int)local_10.x + 0x1264)); } } if ((npc->_state == 2) || (npc->_state == 3)) { if (npc->_collidesWithGrid != 0) { npc->_state = 5; } iVar9 = npc->_stateFrame; if (iVar9 < 1) { if ((iVar9 == 0) && (roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx), ((uint)roomDesc->Flags >> 1 & 1) != 0)) { npc->_stateFrame = 5; } } else { npc->_stateFrame = iVar9 + -1; if (iVar9 + -1 == 0) { npc->_state = 5; } } } } else if (npc->_state == 3) { iVar9 = npc->_variant; if ((iVar9 == 0) || (iVar9 == 2)) { pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar4 = *(byte **)pbVar6; } expectedName = s_Idle; do { bVar1 = *pbVar4; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_004928b6: uVar3 = -(uint)isLess | 1; goto LAB_004928bb; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_004928b6; pbVar4 = pbVar4 + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004928bb: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004928f2; } pcVar8 = (char *)s_Idle; } else { if (iVar9 != 1) { if (iVar9 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); uVar3 = Random(); Game::SpawnEx(g_game,0x129,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3,0); npc->_variant = 1; (npc->_v1).x = 0.55; } goto LAB_004928f2; } pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar4 = *(byte **)pbVar6; } pcVar8 = "Suction"; do { bVar1 = *pbVar4; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_004927f0: uVar3 = -(uint)isLess | 1; goto LAB_004927f5; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_004927f0; pbVar4 = pbVar4 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004927f5: if (uVar3 == 0) { if ((pbVar6[0x34] == 0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004928f2; pcVar8 = "Suction"; goto LAB_004928db; } } pcVar8 = "Suction"; } LAB_004928db: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar8,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_004928f2; } if (npc->_state == 0x10) { npc->_friction = npc->_friction * 0.8; trappedPlayer = (Entity_Player *) __RTDynamicCast(npc->_parent,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); local_28.y = (float)trappedPlayer; if ((npc->_variant == 2) && ((npc->_sprite)._animState._animData != (void *)0x0)) { if ((npc->_sprite)._animState._isPlaying == 0) { LAB_00492ec1: pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar8 = "Disappear"; do { bVar1 = *pbVar6; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00492f00: uVar3 = -(uint)isLess | 1; goto LAB_00492f05; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00492f00; pbVar6 = pbVar6 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00492f05: if (uVar3 != 0) goto LAB_0049307e; if (trappedPlayer == (Entity_Player *)0x0) goto LAB_00493149; if (trappedPlayer->_dead == 0) { Room::GetRandomPosition(g_game->_room,&local_10,0.0); pVVar7 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_20,&local_10,0.0,1,0,0); fVar10 = npc->_size; local_10.x = pVVar7->x; local_10.y = pVVar7->y; Room::GetClampedPositionImpl (g_game->_room,&local_18,&local_10,fVar10 * 0.5,fVar10,fVar10 * 0.5,fVar10); local_10.x = local_18.x; local_10.y = local_18.y; (npc->_pos).x = local_18.x; (npc->_pos).y = local_18.y; Entity_Player::Teleport(trappedPlayer,&local_10,0,0); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar8 = "Appear"; do { bVar1 = *pbVar6; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00493048: uVar3 = -(uint)isLess | 1; goto LAB_0049304d; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00493048; pbVar6 = pbVar6 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0049304d: if (uVar3 == 0) { if ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0') && ((npc->_sprite)._animState._isPlaying == 0)) { pcVar8 = "Appear"; goto LAB_00492e8f; } goto LAB_00493086; } } pcVar8 = "Appear"; goto LAB_00492e8f; } } else { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pbVar4 = s_Idle; do { bVar1 = *pbVar6; isLess = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_00492e06: uVar3 = -(uint)isLess | 1; goto LAB_00492e0b; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_00492e06; pbVar6 = pbVar6 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00492e0b: if (((uVar3 != 0) || (trappedPlayer == (Entity_Player *)0x0)) || (trappedPlayer->_pitfallState != 2)) { if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_0049307e; goto LAB_00492ec1; } pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar8 = "Disappear"; do { bVar1 = *pbVar6; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00492e60: uVar3 = -(uint)isLess | 1; goto LAB_00492e65; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00492e60; pbVar6 = pbVar6 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00492e65: if ((uVar3 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00492e88; goto LAB_00493086; } LAB_00492e88: pcVar8 = "Disappear"; LAB_00492e8f: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar8,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; trappedPlayer = (Entity_Player *)local_28.y; } } } else { LAB_0049307e: if (trappedPlayer == (Entity_Player *)0x0) goto LAB_00493149; } LAB_00493086: if (((trappedPlayer->_pitfallState == 3) || (trappedPlayer->_pitfallState == 0)) || (trappedPlayer->_dead != 0)) { if (npc->_variant == 2) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar8 = "Appear"; do { bVar1 = *pbVar6; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00493125: uVar3 = -(uint)isLess | 1; goto LAB_0049312a; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00493125; pbVar6 = pbVar6 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0049312a: if (uVar3 == 0) goto LAB_00493137; } if (npc->_collidesWithGrid == 0) goto LAB_00493149; } LAB_00493137: npc->_state = 5; } else { fVar10 = (npc->_pos).y; fVar11 = (trappedPlayer->_pos).y; (trappedPlayer->_velocity).x = ((npc->_pos).x - (trappedPlayer->_pos).x) * 0.1; (trappedPlayer->_velocity).y = (fVar10 - fVar11) * 0.1; } } LAB_00493149: if (npc->_state != 5) { return; } npc->_friction = npc->_friction * 0.8; pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar4 = *(byte **)pbVar6; } pcVar8 = "Disappear"; do { bVar1 = *pbVar4; isLess = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_004931a0: uVar3 = -(uint)isLess | 1; goto LAB_004931a5; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_004931a0; pbVar4 = pbVar4 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004931a5: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004931dc; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Disappear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004931dc: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); } return; } //@@ 00493200 NpcAI::ENTITY_RAG_MAN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 405 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_RAG_MAN(Entity_NPC *npc) { void *pvVar1; code *pcVar2; Entity_NPC *pEVar3; byte bVar4; uint uVar5; Entity *pEVar6; byte *animNameChar; std_string *anim; ProjectileParams *params; Entity_Player *randomPlayer; Vector *pVVar7; Vector *velocityDir; int iVar8; char *animName; byte *pbVar9; int iVar10; int iVar11; int unused; Entity_NPC *randomPlayer; bool bVar13; float fVar14; float fVar15; float sideSign; undefined1 *puVar16; undefined1 frictionScale [12]; undefined4 local_1cc [11]; EntityList_EL headQuery; EntityList_EL spiderQuery; undefined1 local_180 [8]; float fStack_178; float fStack_174; float local_170; float local_16c; float local_168; float local_164; float local_160; float local_15c; float local_158; EntityList_EL raglingQuery; Vector scratchVec; float raglingY; float raglingX; uint local_134; uint maxActiveRaglings; float closestRaglingDist; Entity_NPC *local_128; undefined1 local_124 [12]; Entity_NPC *local_118; int subtype; float local_110; float local_10c; int puddleRaglingCount; EntityPtr local_104; Entity_NPC *local_100; float local_fc; int childCount; uint local_f4; Vector local_f0; Entity_NPC *local_e8; byte isTargetLeft; Entity_NPC *local_e0; char isDestinationFound; char isReviveTargetFound; Entity_NPC *local_d8; byte local_d1; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; undefined4 flagsHigh; float health; Manager *manager; EntityPtr *spiderParent; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af2e61; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)&(&projParams)[1].Spread; subtype = npc->_subtype; local_f0.y = (float)npc; local_24 = uVar5; if (npc->_variant != 0) { if (npc->_variant != 1) { return; } iVar8 = npc->_state; if (iVar8 == 0) { ExceptionList = &local_1c; npc->_state = 4; npc->_stateFrame = 0; uVar5 = Random(); npc->_i1 = 0x3c - (int)((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * -2.3283064e-10 * 45.0); Color::Reset((Color *)local_180); local_160 = 0.35; local_180._0_4_ = 0.0; local_180._4_4_ = 0.0; fStack_178 = 0.0; fStack_174 = 1.0; local_15c = 0.11; local_158 = 0.36; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_180); ExceptionList = local_1c; return; } local_f0.y = (float)(int)((float)npc->_i1 - 75.0); local_e0 = (Entity_NPC *)(int)((float)npc->_i1 - 15.0); ExceptionList = &local_1c; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); if (npc->_parent != (EntityPtr)0x0) { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); if (npc->_spawnerType != 0x199) { iVar10 = (int)(npc->_damageEvents)._end - (int)(npc->_damageEvents)._begin; local_d8 = (Entity_NPC *)0x0; iVar11 = iVar10 >> 0x1f; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); if (iVar10 / 0x38 + iVar11 != iVar11) { local_f4 = 0; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); do { pvVar1 = (npc->_damageEvents)._begin; (**(code **)(*(int *)npc->_parent + 0x20)) (*(undefined4 *)(local_f4 + (int)pvVar1), *(undefined4 *)(local_f4 + 8 + (int)pvVar1), *(undefined4 *)(local_f4 + 0xc + (int)pvVar1),local_f4 + 0x10 + (int)pvVar1, 0x1e,uVar5); local_f4 = local_f4 + 0x38; local_d8 = (Entity_NPC *)&local_d8->field_0x1; } while (local_d8 < (undefined1 *) (((int)(npc->_damageEvents)._end - (int)(npc->_damageEvents)._begin) / 0x38)); iVar8 = npc->_state; } } } iVar11 = npc->_stateFrame + 1; npc->_stateFrame = iVar11; if ((npc->_flags & 0x100) == 0) { if (iVar8 != 4) goto LAB_00495318; } else { npc->_stateFrame = 0; iVar11 = 0; npc->_state = 4; } local_d8 = (Entity_NPC *)(float)(int)local_f0.y; local_f0.y = (float)(int)local_e0; local_104 = (EntityPtr)(float)iVar11; if ((float)local_d8 == local_f0.y) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar14 = ((float)local_104 - (float)local_d8) / (local_f0.y - (float)local_d8); if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } local_d8 = (Entity_NPC *)(10.0 - fVar14 * 8.0); pVVar7 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_124._8_4_ = pVVar7->x - (npc->_pos).x; local_118 = (Entity_NPC *)(pVVar7->y - (npc->_pos).y); local_fc = (npc->_velocity).y; pVVar7 = Vector::Normalized((Vector *)(local_124 + 8),&scratchVec); velocityDir = Vector::Normalized(&npc->_velocity,(Vector *)(local_124 + 8)); local_100 = (Entity_NPC *) ((float)local_d8 * pVVar7->x * 0.15 + (npc->_velocity).x + (float)local_d8 * velocityDir->x * 0.15); local_128 = (Entity_NPC *) ((float)local_d8 * pVVar7->y * 0.15 + local_fc + (float)local_d8 * velocityDir->y * 0.15); fVar14 = sqrtf((float)local_100 * (float)local_100 + (float)local_128 * (float)local_128); if (fVar14 <= 0.0) { randomPlayer = local_100; pEVar3 = local_128; } else { randomPlayer = (Entity_NPC *)((float)local_100 * ((float)local_d8 / fVar14)); pEVar3 = (Entity_NPC *)((float)local_128 * ((float)local_d8 / fVar14)); } fVar14 = npc->_speedMultiplier; fVar15 = 0.8; if (fVar14 != 1.0) { fVar15 = 0.8 / ((fVar14 + 0.8) - fVar14 * 0.8); } (npc->_velocity).x = ((float)randomPlayer - (npc->_velocity).x) * (1.0 - fVar15) + (npc->_velocity).x ; (npc->_velocity).y = ((float)pEVar3 - local_fc) * (1.0 - fVar15) + local_fc; iVar8 = Entity::get_velocity_direction((Entity *)npc); switch(iVar8) { case 0: animName = "RollLeft"; break; case 1: animName = "RollUp"; break; case 2: animName = "RollRight"; break; default: animName = "RollDown"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); iVar11 = npc->_stateFrame; if ((int)local_e0 < iVar11) { npc->_state = 3; } LAB_00495318: if (((npc->_state != 3) && (npc->_dead == 0)) || ((iVar11 <= npc->_i1 && (npc->_dead == 0)))) { fVar14 = (npc->_velocity).y; fVar15 = (npc->_velocity).x; fVar14 = sqrtf(fVar15 * fVar15 + fVar14 * fVar14); fVar14 = (fVar14 - 0.0) / 10.0; if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } (npc->_sprite)._playbackSpeed = fVar14 + fVar14 + 0.0; npc->_friction = npc->_friction * 0.8; ExceptionList = local_1c; return; } uVar5 = Random(); if (subtype == 2) { local_d8 = (Entity_NPC *)((uVar5 & 1) + 1); if (local_d8 != (Entity_NPC *)0x0) { do { uVar5 = Random(); pEVar6 = Game::Spawn(g_game,0x55,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); local_104 = npc->_parent; spiderParent = &pEVar6->_parent; if (*spiderParent != (EntityPtr)0x0) { local_f0.y = (float)spiderParent; std::multiset::erase(&local_f0.y); } *spiderParent = local_104; if (local_104 != (EntityPtr)0x0) { std::multiset::insert(spiderParent); } local_d8 = (Entity_NPC *)((int)&local_d8[-1]._pickupGhostsEntity + 3); } while (local_d8 != (Entity_NPC *)0x0); local_d8 = (Entity_NPC *)0x0; } } else { randomPlayer = (Entity_NPC *) Game::Spawn(g_game,0xf6,1,&npc->_pos,&npc->_velocity,(Entity *)npc,0,uVar5); if (randomPlayer != (Entity_NPC *)0x0) { Entity::SetParent((Entity *)randomPlayer,(Entity *)npc->_parent); Entity_NPC::SetBossColorIdx(randomPlayer,npc->_bosscoloridx,unused); if (npc->_dead == 0) { local_d8 = (Entity_NPC *)randomPlayer->_maxHitPoints; if (subtype == 1) { local_d8 = (Entity_NPC *)((float)local_d8 * 0.66); randomPlayer->_maxHitPoints = (float)local_d8; randomPlayer->_health = (float)local_d8; } local_100 = (Entity_NPC *)npc->_maxHitPoints; local_f0.y = npc->_health; local_104 = (EntityPtr)((float)local_d8 * 0.5); if ((float)local_100 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar14 = (local_f0.y - 0.0) / ((float)local_100 - 0.0); if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } randomPlayer->_health = ((float)local_d8 - (float)local_104) * fVar14 + (float)local_104; } else if (npc->_parent == (EntityPtr)0x0) { (**(code **)(*(int *)randomPlayer + 0x28))(); } else { uVar5 = Random(); Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); flagsHigh = *(undefined4 *)((int)&randomPlayer->_flags + 4); *(uint *)&randomPlayer->_flags = (uint)randomPlayer->_flags & 0xfffffffb; *(undefined4 *)((int)&randomPlayer->_flags + 4) = flagsHigh; (**(code **)(*(int *)randomPlayer + 0xc))(); randomPlayer->_dead = 1; } } } (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (npc->_pos).x; local_10c = (pEVar6->_pos).x; local_110 = (pEVar6->_pos).y; local_104 = (EntityPtr)&npc->_pos; pvVar1 = g_game->_room; local_d1 = ABS(local_110) < ABS(local_10c); isTargetLeft = local_10c - fVar14 < 0.0; fVar15 = npc->_maxHitPoints; local_f4 = 0; if (*(float *)((int)pvVar1 + 0x14) + 80.0 <= fVar14) { local_f4 = (uint)isTargetLeft; } health = npc->_health; if (*(float *)((int)pvVar1 + 0x1c) - 80.0 < fVar14) { local_f4 = 1; } local_fc = (float)(uint)(health < fVar15); if (health < fVar15 * 0.75) { local_fc = 2.8026e-45; } if (health < fVar15 * 0.55) { local_fc = 4.2039e-45; } if (health < fVar15 * 0.35) { local_fc = 5.60519e-45; } maxActiveRaglings = (uint)(health < fVar15); if (health < fVar15 * 0.6) { maxActiveRaglings = 2; } if (npc->_subtype == 1) { local_fc = 5.60519e-45; maxActiveRaglings = 4; } if (npc->_state == 0) { npc->_state = 4; npc->_i1 = 0; if (&npc->_splatColor == (ColorMod *)local_1cc) { ExceptionList = local_1c; return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.35; (npc->_splatColor)._offset[1] = 0.11; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.36; ExceptionList = local_1c; return; } EntityList::QuerySublist((EntityList *)((int)pvVar1 + 0x1218),&raglingQuery,0xf6,1,-1,0,0); local_14 = 0.0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&headQuery,0x195,-1,-1,0,0); local_14._0_1_ = 1; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&spiderQuery,0x55,-1,-1,0,0); randomPlayer = (Entity_NPC *)0x0; local_14._0_1_ = 2; uVar5 = 0; childCount = 0; puddleRaglingCount = 0; local_d8 = (Entity_NPC *)0x0; if (headQuery._size != 0) { do { iVar8 = *(int *)((int)headQuery._data + uVar5 * 4); if ((*(int *)(iVar8 + 0x2c) == 1) && (*(Entity_NPC **)(iVar8 + 0x3bc) == npc)) { randomPlayer = (Entity_NPC *)&randomPlayer->field_0x1; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)headQuery._size); local_d8 = randomPlayer; } uVar5 = 0; iVar8 = 0; if (raglingQuery._size != 0) { do { iVar11 = *(int *)((int)raglingQuery._data + uVar5 * 4); childCount = iVar8 + 1; if (*(Entity_NPC **)(iVar11 + 0x3bc) != npc) { childCount = iVar8; } iVar10 = puddleRaglingCount + 1; if (*(int *)(iVar11 + 0xb64) != 0x10) { iVar10 = puddleRaglingCount; } uVar5 = uVar5 + 1; iVar8 = childCount; puddleRaglingCount = iVar10; } while (uVar5 < (uint)raglingQuery._size); } if (subtype == 2) { uVar5 = 0; iVar8 = childCount; if (spiderQuery._size != 0) { do { childCount = iVar8 + 1; if (*(Entity_NPC **)(*(int *)((int)spiderQuery._data + uVar5 * 4) + 0x3bc) != npc) { childCount = iVar8; } uVar5 = uVar5 + 1; iVar8 = childCount; } while (uVar5 < (uint)spiderQuery._size); } } closestRaglingDist = 9999999.0; isDestinationFound = '\0'; isReviveTargetFound = '\0'; local_134 = 0; local_128 = (Entity_NPC *)closestRaglingDist; local_100 = (Entity_NPC *)closestRaglingDist; local_e8 = (Entity_NPC *)closestRaglingDist; local_e0 = (Entity_NPC *)closestRaglingDist; if (raglingQuery._size != 0) { do { iVar8 = *(int *)((int)raglingQuery._data + local_134 * 4); raglingX = *(float *)(iVar8 + 0x33c); raglingY = *(float *)(iVar8 + 0x340); fVar15 = raglingX - (npc->_pos).x; fVar14 = raglingY - (npc->_pos).y; fVar14 = sqrtf(fVar14 * fVar14 + fVar15 * fVar15); if (*(int *)(iVar8 + 0xb64) == 0x10) { if ((((isReviveTargetFound == '\0') || (fVar14 < closestRaglingDist)) && (0x77 < npc->_i1)) && (childCount - puddleRaglingCount < (int)maxActiveRaglings)) { local_e8 = (Entity_NPC *)raglingX; local_e0 = (Entity_NPC *)raglingY; isDestinationFound = '\x01'; isReviveTargetFound = '\x01'; local_128 = (Entity_NPC *)raglingX; local_100 = (Entity_NPC *)raglingY; closestRaglingDist = fVar14; } } else if ((fVar14 < closestRaglingDist) && (isReviveTargetFound == '\0')) { local_e8 = (Entity_NPC *)(raglingY - local_110); local_e0 = (Entity_NPC *)(raglingX - local_10c); isDestinationFound = '\x01'; closestRaglingDist = fVar14; fVar14 = sqrtf((float)local_e8 * (float)local_e8 + (float)local_e0 * (float)local_e0); if (fVar14 <= 0.0) { randomPlayer = local_e0; pEVar3 = local_e8; } else { randomPlayer = (Entity_NPC *)((float)local_e0 * (1.0 / fVar14)); pEVar3 = (Entity_NPC *)((float)local_e8 * (1.0 / fVar14)); } scratchVec.x = raglingX + (float)randomPlayer * 60.0; scratchVec.y = raglingY + (float)pEVar3 * 60.0; Room::GetClampedPositionImpl (g_game->_room,(Vector *)(local_124 + 8),&scratchVec,60.0,60.0,60.0,60.0); local_e8 = (Entity_NPC *)local_124._8_4_; local_e0 = local_118; } local_134 = local_134 + 1; } while (local_134 < (uint)raglingQuery._size); } iVar8 = childCount; local_134 = childCount - puddleRaglingCount; if ((int)local_134 < (int)maxActiveRaglings) { npc->_i1 = npc->_i1 + 1; } else { npc->_i1 = 0; } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown + -1; } iVar11 = npc->_state; if (iVar11 == 4) { Entity_NPC::CalcTargetPosition(npc,&local_f0,0.0); if ((isDestinationFound != '\0') && ((npc->_flags & 0x1000b00) == 0)) { local_f0.x = (float)local_e8; local_f0.y = (float)local_e0; } (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_f0,1.05,900,1); (npc->_sprite)._flipX = 0; fVar14 = (npc->_velocity).x; fVar15 = (npc->_velocity).y; fVar14 = sqrtf(fVar14 * fVar14 + fVar15 * fVar15); animNameChar = (npc->_sprite)._animState._animData; if (fVar14 <= 1.0) { if (animNameChar == (byte *)0x0) { LAB_00493b20: animName = (char *)s_Idle; goto LAB_00493b27; } if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } pbVar9 = s_Idle; do { bVar4 = *animNameChar; bVar13 = bVar4 < *pbVar9; if (bVar4 != *pbVar9) { LAB_00493b00: uVar5 = -(uint)bVar13 | 1; goto LAB_00493b05; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < pbVar9[1]; if (bVar4 != pbVar9[1]) goto LAB_00493b00; animNameChar = animNameChar + 2; pbVar9 = pbVar9 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493b05: if ((uVar5 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00493b20; } else { fVar14 = (npc->_velocity).x; if (ABS(fVar14) <= ABS((npc->_velocity).y)) { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "WalkVert"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493a92: uVar5 = -(uint)bVar13 | 1; goto LAB_00493a97; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493a92; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493a97: if (uVar5 == 0) { if ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0') && ((npc->_sprite)._animState._isPlaying == 0)) { animName = "WalkVert"; goto LAB_00493b27; } goto LAB_00493b45; } } animName = "WalkVert"; } else if (0.0 <= fVar14) { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "WalkRight"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493a21: uVar5 = -(uint)bVar13 | 1; goto LAB_00493a26; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493a21; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493a26: if (uVar5 == 0) { if ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0') && ((npc->_sprite)._animState._isPlaying == 0)) { animName = "WalkRight"; goto LAB_00493b27; } goto LAB_00493b45; } } animName = "WalkRight"; } else { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "WalkLeft"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_004939b0: uVar5 = -(uint)bVar13 | 1; goto LAB_004939b5; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_004939b0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004939b5: if (uVar5 == 0) { if ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0') || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00493b45; animName = "WalkLeft"; goto LAB_00493b27; } } animName = "WalkLeft"; } LAB_00493b27: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; iVar8 = childCount; } } LAB_00493b45: manager = g_manager; if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { if ((npc->_i1 < 0x78) && (subtype != 1)) { LAB_00493c39: if ((subtype == 2) && (uVar5 = Random(), uVar5 % 100 == 0)) { LAB_00493c54: npc->_state = 0xe; } else { bVar4 = Entity::IsFrame((Entity *)npc,0xf,npc->_index); if (((bVar4 != 0) && (((uVar5 = Random(), uVar5 % 100 < 0x14 && (local_d1 != 0)) && (npc->_projectileCooldown < 1)))) && (npc->_subtype != 1)) { npc->_state = 8; (npc->_sprite)._flipX = isTargetLeft; } } } else { if (((int)local_fc <= iVar8) || ((int)maxActiveRaglings <= (int)local_134)) { if ((npc->_i1 < 0x78) || (fVar14 = (npc->_pos).y - (float)local_100, fVar15 = (npc->_pos).x - (float)local_128, fVar14 = sqrtf(fVar14 * fVar14 + fVar15 * fVar15), 70.0 <= fVar14)) goto LAB_00493c39; goto LAB_00493c54; } npc->_state = 0xd; local_fc = 5.52112e-43; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); } } } else if (iVar11 == 0xd) { if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00493e66: animNameChar = (npc->_sprite)._animState._animData; if ((char)local_f4 == '\0') { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadThrowRight"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493f00: uVar5 = -(uint)bVar13 | 1; goto LAB_00493f05; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493f00; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493f05: if ((uVar5 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00493f3d; } animName = "HeadThrowRight"; } else { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadThrowLeft"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493ea5: uVar5 = -(uint)bVar13 | 1; goto LAB_00493eaa; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493ea5; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493eaa: if ((uVar5 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00493f3d; } animName = "HeadThrowLeft"; } bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = (npc->_sprite)._animState._animData; if ((npc->_sprite)._animState._isPlaying == 0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadThrowLeft"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493e18: uVar5 = -(uint)bVar13 | 1; goto LAB_00493e1d; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493e18; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493e1d: if (uVar5 != 0) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadThrowRight"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493e51: uVar5 = -(uint)bVar13 | 1; goto LAB_00493e56; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493e51; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493e56: if (uVar5 != 0) goto LAB_00493e66; } } else { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadThrowLeft"; do { local_d1 = *animNameChar; bVar13 = local_d1 < (byte)*animName; pbVar9 = (npc->_sprite)._animState._animData; if (local_d1 != *animName) { LAB_00493d3c: uVar5 = -(uint)bVar13 | 1; goto LAB_00493d41; } if (local_d1 == 0) break; local_d1 = animNameChar[1]; bVar13 = local_d1 < (byte)animName[1]; pbVar9 = (npc->_sprite)._animState._animData; if (local_d1 != animName[1]) goto LAB_00493d3c; animNameChar = animNameChar + 2; animName = animName + 2; } while (local_d1 != 0); uVar5 = 0; LAB_00493d41: if (uVar5 != 0) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadThrowRight"; do { local_d1 = *animNameChar; bVar13 = local_d1 < (byte)*animName; pbVar9 = (npc->_sprite)._animState._animData; if (local_d1 != *animName) { LAB_00493d9c: uVar5 = -(uint)bVar13 | 1; goto LAB_00493da1; } if (local_d1 == 0) break; local_d1 = animNameChar[1]; bVar13 = local_d1 < (byte)animName[1]; pbVar9 = (npc->_sprite)._animState._animData; if (local_d1 != animName[1]) goto LAB_00493d9c; animNameChar = animNameChar + 2; animName = animName + 2; } while (local_d1 != 0); uVar5 = 0; LAB_00493da1: if (uVar5 != 0) goto LAB_00493e66; } if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } animName = "HeadThrowLeft"; do { bVar4 = *pbVar9; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00493dd6: uVar5 = -(uint)bVar13 | 1; goto LAB_00493ddb; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00493dd6; pbVar9 = pbVar9 + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00493ddb: if (uVar5 == 0) { local_f4 = CONCAT31(local_f4._1_3_,1); goto LAB_00493f3d; } } local_f4 = (uint)local_f4._1_3_ << 8; } LAB_00493f3d: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Spawn), bVar4 != 0)) { local_f0.y = 0.0; if ((char)local_f4 == '\0') { local_f0.x = 10.0; uVar5 = Random(); sideSign = 1.0; } else { local_f0.x = -10.0; uVar5 = Random(); sideSign = (float)&DAT_bf800000; } local_118 = (Entity_NPC *)((npc->_pos).y + 0.0); local_124._8_4_ = sideSign * 57.0 + (npc->_pos).x; randomPlayer = (Entity_NPC *) Game::Spawn(g_game,0x195,1,(Vector *)(local_124 + 8),&local_f0,(Entity *)npc, npc->_subtype,uVar5); if (randomPlayer->_parent != (EntityPtr)0x0) { local_d8 = (Entity_NPC *)&randomPlayer->_parent; std::multiset::erase(&local_d8); } randomPlayer->_parent = (EntityPtr)npc; std::multiset::insert(&randomPlayer->_parent); flagsHigh = *(undefined4 *)((int)&randomPlayer->_flags + 4); *(uint *)&randomPlayer->_flags = (uint)randomPlayer->_flags & 0xfffffffb; *(undefined4 *)((int)&randomPlayer->_flags + 4) = flagsHigh; if (randomPlayer->_bosscoloridx != npc->_bosscoloridx) { randomPlayer->_bosscoloridx = npc->_bosscoloridx; Entity_NPC::load_graphics(randomPlayer,1); anim = &(randomPlayer->_sprite)._animDefaultName; if (0xf < (randomPlayer->_sprite)._animDefaultName._capacity) { anim = *(std_string **)anim->_buf; } bVar4 = ANM2::SetAnimation(&randomPlayer->_sprite,(byte *)anim,1); if (((bVar4 != 0) && ((randomPlayer->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(randomPlayer->_sprite)._animState,0.0), (randomPlayer->_sprite)._animState._animData != (void *)0x0)) { (randomPlayer->_sprite)._animState._isPlaying = 0; } } (**(code **)(*(int *)randomPlayer + 0x60))(); if ((npc->_flags & 0x1000000000000000) != 0) { randomPlayer->_health = 8.0; randomPlayer->_maxHitPoints = 8.0; } } local_180._4_4_ = 0.0; fStack_178 = 0.0; fStack_174 = 0.0; local_170 = 0.0; local_16c = g_vectorZero.x; local_168 = g_vectorZero.y; local_164 = g_vectorZero.x; local_160 = g_vectorZero.y; local_15c = 0.0; local_158 = 0.0; (**(code **)(*(int *)npc + 0x20))(&DAT_bf800000,0,0,local_180 + 4,0x1e); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar5 = Random(); npc->_projectileCooldown = uVar5 % 0x14 + 0x28; } } else { if (iVar11 == 3) { npc->_friction = npc->_friction * 0.75; if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadPop"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_004941f0: uVar5 = -(uint)bVar13 | 1; goto LAB_004941f5; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_004941f0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004941f5: if (uVar5 == 0) { npc->_state = 4; npc->_stateFrame = 0; npc->_projectileCooldown = 0; goto LAB_00494d49; } if ((npc->_sprite)._animState._isPlaying == 0) goto LAB_00494265; } animNameChar = (npc->_sprite)._animState._animData; if (animNameChar == (byte *)0x0) { animNameChar = &s_empty; } else if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadPop"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494258: uVar5 = -(uint)bVar13 | 1; goto LAB_0049425d; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494258; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0049425d: if (uVar5 == 0) goto LAB_00494d49; } LAB_00494265: if ((npc->_flags & 0x1000800) == 0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); fVar14 = npc->_speedMultiplier; frictionScale = ZEXT812(0x3f8ccccd); if (fVar14 != 1.0) { fVar15 = frictionScale._0_4_; frictionScale._4_8_ = frictionScale._4_8_; frictionScale._0_4_ = fVar15 / ((fVar14 + fVar15) - fVar14 * fVar15); } (npc->_velocity).y = frictionScale._0_4_ * (npc->_velocity).y; (npc->_velocity).x = frictionScale._0_4_ * (npc->_velocity).x; } else { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_124._8_4_ = (pEVar6->_pos).x; local_118 = (Entity_NPC *)(pEVar6->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,(Vector *)(local_124 + 8),0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } fVar14 = (npc->_velocity).x; animNameChar = (npc->_sprite)._animState._animData; if (ABS(fVar14) <= ABS((npc->_velocity).y)) { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "WalkNoHeadVert"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494450: uVar5 = -(uint)bVar13 | 1; goto LAB_00494455; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494450; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00494455: if ((uVar5 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00494489; } animName = "WalkNoHeadVert"; LAB_0049446f: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0.0 <= fVar14) { if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "WalkNoHeadRight"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_004943f5: uVar5 = -(uint)bVar13 | 1; goto LAB_004943fa; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_004943f5; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004943fa: if ((uVar5 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00494489; } animName = "WalkNoHeadRight"; goto LAB_0049446f; } if (animNameChar == (byte *)0x0) { LAB_004943b6: animName = "WalkNoHeadLeft"; goto LAB_0049446f; } if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "WalkNoHeadLeft"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494396: uVar5 = -(uint)bVar13 | 1; goto LAB_0049439b; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494396; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0049439b: if ((uVar5 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004943b6; } LAB_00494489: if (((npc->_projectileCooldown < 1) && ((npc->_flags & 0x1000a00) == 0)) && (npc->_subtype != 1)) { uVar5 = Random(); npc->_projectileCooldown = uVar5 % 0x14 + 0x28; local_e8 = (Entity_NPC *)(npc->_velocity).y; local_e0 = (Entity_NPC *)(npc->_velocity).x; fVar14 = sqrtf((float)local_e8 * (float)local_e8 + (float)local_e0 * (float)local_e0); if (0.0 < fVar14) { local_e0 = (Entity_NPC *)((float)local_e0 * (1.0 / fVar14)); local_e8 = (Entity_NPC *)((float)local_e8 * (1.0 / fVar14)); } ProjectileParams::ProjectileParams(&projParams); local_124._8_4_ = (float)local_e0 * 5.0; local_118 = (Entity_NPC *)((float)local_e8 * 5.0); projParams.FallingAccelModifier = 0.3; projParams.FallingSpeedModifier = -5.0; projParams.BulletFlags._0_4_ = 1; projParams.BulletFlags._4_4_ = 0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(local_124 + 8),0,&projParams); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); } if (local_d8 == (Entity_NPC *)0x0) { animNameChar = (npc->_sprite)._animState._animData; if (animNameChar != (byte *)0x0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "HeadPop"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494620: uVar5 = -(uint)bVar13 | 1; goto LAB_00494625; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494620; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00494625: if ((uVar5 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00494d49; } bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"HeadPop",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } goto LAB_00494d49; } if (iVar11 == 8) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0049480d; animNameChar = (npc->_sprite)._animState._animData; if ((npc->_sprite)._animState._isPlaying == 0) { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Shooting1"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494770: uVar5 = -(uint)bVar13 | 1; goto LAB_00494775; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494770; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00494775: if (uVar5 != 0) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Shooting3"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_004947b0: uVar5 = -(uint)bVar13 | 1; goto joined_r0x004947b7; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_004947b0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; joined_r0x004947b7: if (uVar5 != 0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Shooting5"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494800: uVar5 = -(uint)bVar13 | 1; goto LAB_00494805; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494800; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00494805: if (uVar5 == 0) goto switchD_00494858_default; } LAB_0049480d: uVar5 = Random(); fVar14 = npc->_maxHitPoints; uVar5 = uVar5 % 3; if ((fVar14 + fVar14) / 3.0 < npc->_health) { uVar5 = uVar5 - 1; } if (npc->_health < fVar14 / 3.0) { uVar5 = uVar5 + 1; } switch(uVar5) { case 1: ANM2::Play(&npc->_sprite,(byte *)"Shooting3",0); iVar8 = 0x18b; break; case 2: case 3: ANM2::Play(&npc->_sprite,(byte *)"Shooting5",0); iVar8 = 0x189; break; case 0xffffffff: case 0: ANM2::Play(&npc->_sprite,(byte *)"Shooting1",0); iVar8 = 0x188; break; default: goto switchD_00494858_default; } SoundEffects::PlayWithFartOverride(iVar8,1.0,2,0,1.0); } } } else { if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Shooting1"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_004946b7: uVar5 = -(uint)bVar13 | 1; goto LAB_004946bc; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_004946b7; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004946bc: if (uVar5 != 0) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Shooting3"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_004946f4: uVar5 = -(uint)bVar13 | 1; goto LAB_004946f9; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_004946f4; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004946f9: if (uVar5 != 0) { animNameChar = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Shooting5"; do { bVar4 = *animNameChar; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494731: uVar5 = -(uint)bVar13 | 1; goto joined_r0x004947b7; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494731; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; goto joined_r0x004947b7; } } } switchD_00494858_default: local_d1 = (npc->_sprite)._flipX; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar4 != 0) { local_d8 = (Entity_NPC *)0xb2; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); local_10c = local_10c - (npc->_pos).x; local_110 = local_110 - (npc->_pos).y; fVar14 = sqrtf(local_10c * local_10c + local_110 * local_110); if (0.0 < fVar14) { local_10c = (1.0 / fVar14) * local_10c; local_110 = local_110 * (1.0 / fVar14); } ProjectileParams::ProjectileParams(&projParams); local_124._8_4_ = local_10c * 7.0; projParams.BulletFlags._0_4_ = 1; local_118 = (Entity_NPC *)(local_110 * 7.0); projParams.BulletFlags._4_4_ = 0; projParams.HomingStrength = 1.0; if (local_d1 == 0) { puVar16 = (undefined1 *)0x3f800000; } else { puVar16 = &DAT_bf800000; } scratchVec.y = (npc->_pos).y + 0.0; scratchVec.x = (float)puVar16 * 16.0 + (npc->_pos).x; Entity_NPC::FireProjectiles(npc,&scratchVec,(Vector *)(local_124 + 8),0,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00494d31; } npc->_projectileCooldown = 0x5a; } else { if (iVar11 != 0xe) goto LAB_00494d49; animNameChar = (npc->_sprite)._animState._animData; if (animNameChar == (byte *)0x0) { LAB_00494b03: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rebirth",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar9 = animNameChar; if (0xf < *(uint *)(animNameChar + 0x14)) { pbVar9 = *(byte **)animNameChar; } animName = "Rebirth"; do { bVar4 = *pbVar9; bVar13 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_00494ae5: uVar5 = -(uint)bVar13 | 1; goto LAB_00494aea; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar13 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_00494ae5; pbVar9 = pbVar9 + 2; animName = animName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00494aea: if ((uVar5 != 0) || ((animNameChar[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00494b03; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Revive"); manager = g_manager; if (bVar4 != 0) { local_d8 = (Entity_NPC *)0x109; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); manager = g_manager; local_d8 = (Entity_NPC *)0x189; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); if (subtype == 2) { params = ProjectileParams::ProjectileParams(&projParams); randomPlayer = Game::GetRandomPlayer(g_game,&npc->_pos,9999999.0); local_124._8_4_ = (randomPlayer->_pos).x; local_118 = (Entity_NPC *)(randomPlayer->_pos).y; Entity_NPC::FireBossProjectiles(npc,3,local_124 + 8,10.0,params); } else if (raglingQuery._size != 0) { uVar5 = 0; do { iVar8 = *(int *)((int)raglingQuery._data + uVar5 * 4); fVar14 = *(float *)(iVar8 + 0x340) - *(float *)((int)local_104 + 4); fVar15 = *(float *)(iVar8 + 0x33c) - *(float *)local_104; fVar14 = sqrtf(fVar14 * fVar14 + fVar15 * fVar15); if (fVar14 < 100.0) { if (*(int *)(iVar8 + 0xb64) == 0x10) { *(undefined4 *)(iVar8 + 0xb64) = 2; } else { fVar14 = *(float *)(iVar8 + 900); fVar15 = fVar14 * 0.25 + *(float *)(iVar8 + 0x380); *(float *)(iVar8 + 0x380) = fVar15; if (fVar14 < fVar15) { *(float *)(iVar8 + 0x380) = fVar14; } } } uVar5 = uVar5 + 1; } while (uVar5 < (uint)raglingQuery._size); npc = (Entity_NPC *)local_f0.y; } npc->_health = npc->_maxHitPoints * 0.05 + npc->_health; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00494d31; } npc->_i1 = 0; } npc->_state = 4; } LAB_00494d31: npc->_friction = npc->_friction * 0.8; LAB_00494d49: if ((npc->_dead != 0) && ((npc->_flags & 0x20000000) == 0)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_124,0xf6,1,-1,0,0) ; local_14._0_1_ = 3; local_d8 = (Entity_NPC *)0x0; if (local_118 != (Entity_NPC *)0x0) { do { local_f0.y = *(float *)(local_124._4_4_ + (int)local_d8 * 4); if ((((Entity_NPC *)local_f0.y)->_flags & 0x20000000) == 0) { pcVar2 = *(code **)(*(int *)local_f0.y + 0x24); EntityRef::constructor((EntityRef *)(local_180 + 4),(Entity *)npc); (*pcVar2)(local_180 + 4); } local_d8 = (Entity_NPC *)&local_d8->field_0x1; } while (local_d8 < local_118); } if (local_124[0] == '\0') { local_14._0_1_ = 4; tracked_alloc(1,(void *)local_124._4_4_,0); } } if (spiderQuery._0_1_ == '\0') { local_14._0_1_ = 5; tracked_alloc(1,spiderQuery._data,0); } if (headQuery._0_1_ == '\0') { local_14 = (float)CONCAT31(local_14._1_3_,6); tracked_alloc(1,headQuery._data,0); } if (raglingQuery._0_1_ == '\0') { local_14 = 9.80909e-45; tracked_alloc(1,raglingQuery._data,0); } ExceptionList = local_1c; return; } //@@ 00495610 NpcAI::ENTITY_RAG_MEGA /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 409 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_RAG_MEGA(Entity_NPC *npc) { float fVar1; ANM2 *pAVar2; byte bVar3; uint uVar4; Vector *clampedPos; Entity *pEVar5; byte *pbVar6; LayerState *layer; Vector *pVVar7; ColorMod *from; ColorMod *fadedColor; EntityRef *damageSource; byte *pbVar8; int iVar9; void *room; byte *pbVar10; char *pcVar11; int orbitFrame; bool bVar12; float fVar13; float fVar14; float fVar15; Entity_NPC *pEVar16; float fadeAmount; float driftDirX; int *piVar17; float driftDirY; undefined4 uVar18; TypeDescriptor *pTVar19; TypeDescriptor *pTVar20; undefined4 uVar21; undefined4 local_15c [11]; undefined4 local_130 [8]; undefined4 local_110; undefined4 uStack_10c; float local_108; undefined4 local_104 [11]; undefined1 local_d8 [12]; undefined1 *local_cc; undefined1 local_c8 [12]; ANM2 *local_bc; char isRaglingCollapsed; EntityPtr *local_b4; int *local_b0; Entity_NPC *local_ac; ColorMod lerpOut; Color baseColor; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; EntityPtr parent; code *setColorFn; game = g_game; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af2eab; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_50 + 0x40); iVar9 = npc->_variant; local_ac = npc; local_24 = uVar4; if (iVar9 != 0) { if (iVar9 == 1) { iVar9 = npc->_state; local_110 = 0x3e4ccccd; uStack_10c = 0; local_108 = 0.2; if (iVar9 == 0) { ExceptionList = &local_1c; puStack_20 = local_50 + 0x4c; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)local_130) { (layer->_color)._tint[0] = 1.3; (layer->_color)._tint[1] = 0.8; (layer->_color)._tint[2] = 1.3; (layer->_color)._tint[3] = 1.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_10c,local_110); (layer->_color)._offset[2] = local_108; } if (&npc->_splatColor != (ColorMod *)local_15c) { (npc->_splatColor)._offset[0] = 0.5; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.1; (npc->_splatColor)._offset[2] = 0.5; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } (npc->_posOffset).y = -40.0; npc->_state = 3; npc->_i2 = 3; ExceptionList = local_1c; return; } if (iVar9 == 4) { ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; puStack_20 = local_50 + 0x4c; pVVar7 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_c8 + 8),0.0); fVar13 = npc->_speedMultiplier; local_c8._8_4_ = pVVar7->x - (npc->_pos).x; local_bc = (ANM2 *)(pVVar7->y - (npc->_pos).y); fVar14 = 1.1764705; if (fVar13 != 1.0) { fVar14 = 1.1764705 / ((fVar13 + 1.1764705) - fVar13 * 1.1764705); } local_b4 = (EntityPtr *)(fVar14 * (npc->_velocity).x); (npc->_velocity).x = (float)local_b4; (npc->_velocity).y = fVar14 * (npc->_velocity).y; pVVar7 = Vector::Normalized((Vector *)(local_c8 + 8),(Vector *)(local_d8 + 8)); fVar13 = npc->_friction; fVar14 = pVVar7->x; if (fVar13 != 0.0) { fVar15 = npc->_speedMultiplier; (npc->_velocity).y = (pVVar7->y * 0.5 * fVar15) / fVar13 + (npc->_velocity).y; (npc->_velocity).x = (float)local_b4 + (fVar14 * 0.5 * fVar15) / fVar13; } fVar13 = (npc->_v2).y; npc->_mass = 8.0; if (0.0 < fVar13) { fVar13 = fVar13 - npc->_speedMultiplier; local_50._0_4_ = 1.3; local_50._4_4_ = 0.8; fStack_48 = 1.3; fStack_44 = 1.0; local_30 = 0.2; local_2c = 0.0; (npc->_v2).y = fVar13; fadeAmount = fVar13 / 30.0; local_28 = 0.2; local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; if (fadeAmount <= 0.0) { fadeAmount = 0.0; } if (1.0 <= fadeAmount) { fadeAmount = 1.0; } local_b4 = (EntityPtr *)fadeAmount; Color::Color(&baseColor); fadedColor = Color::Lerp(&lerpOut,from,(ColorMod *)local_50,fadeAmount); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,fadedColor); if ((float)local_b4 < 0.5) { local_30 = 0.0; local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.8; local_28 = 0.0; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_50); npc->_isInvicible = 0; } } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_c8,npc->_type, npc->_variant,-1,1,0); fVar13 = 0.0; if (local_bc != (ANM2 *)0x0) { do { pEVar16 = *(Entity_NPC **)(local_c8._4_4_ + (int)fVar13 * 4); if (pEVar16 != npc) { local_b0 = (int *)(npc->_pos).x; local_ac = (Entity_NPC *)(npc->_pos).y; fVar15 = (pEVar16->_pos).x - (float)local_b0; fVar14 = (pEVar16->_pos).y - (float)local_ac; fVar14 = sqrtf(fVar14 * fVar14 + fVar15 * fVar15); if (fVar14 < 100.0) { iVar9 = *(int *)(local_c8._4_4_ + (int)fVar13 * 4); local_b0 = (int *)((float)local_b0 - *(float *)(iVar9 + 0x33c)); local_ac = (Entity_NPC *)((float)local_ac - *(float *)(iVar9 + 0x340)); fVar14 = sqrtf((float)local_b0 * (float)local_b0 + (float)local_ac * (float)local_ac ); piVar17 = local_b0; pEVar16 = local_ac; if (0.0 < fVar14) { fVar14 = (100.0 - fVar14) / fVar14; pEVar16 = (Entity_NPC *)((float)local_ac * fVar14); piVar17 = (int *)((float)local_b0 * fVar14); } fVar14 = npc->_friction; if (fVar14 != 0.0) { fVar15 = npc->_speedMultiplier; (npc->_velocity).x = ((float)piVar17 * 0.003 * fVar15) / fVar14 + (npc->_velocity).x; (npc->_velocity).y = ((float)pEVar16 * 0.003 * fVar15) / fVar14 + (npc->_velocity).y; } } } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < local_bc); } if (local_c8[0] == '\0') { local_14 = 2; tracked_alloc(1,(void *)local_c8._4_4_,0); local_14 = 0xffffffff; } goto LAB_00496afa; } ExceptionList = &local_1c; puStack_20 = local_50 + 0x4c; if (iVar9 != 3) goto LAB_00496afa; puStack_20 = local_50 + 0x4c; if (npc->_parent != (EntityPtr)0x0) { puStack_20 = local_50 + 0x4c; pEVar16 = Entity_NPC::ParentNPC(npc); npc = local_ac; iVar9 = 1; if (1 < pEVar16->_i1) { iVar9 = pEVar16->_i1; } local_b4 = (EntityPtr *) (*(float *)((int)local_ac->_parent + 0x380) / *(float *)((int)local_ac->_parent + 900)); pEVar16 = Entity_NPC::ParentNPC(local_ac); local_b0 = (int *)pEVar16->_i1; if (0.25 <= (float)local_b4) { if (0.5 <= (float)local_b4) { if (((float)local_b4 < 0.75) && (npc->_i1 == 2)) goto LAB_004968d5; } else if (0 < npc->_i1) { LAB_004968d5: npc->_state = 4; pEVar16 = Entity_NPC::ParentNPC(npc); pEVar16->_i1 = pEVar16->_i1 + -1; goto LAB_004968ec; } } else { npc->_state = 4; LAB_004968ec: Entity_NPC::PlaySound(npc,0x3d5,1.0,2,0,1.0); } if (npc->_state == 4) { local_c8._8_4_ = (npc->_pos).x - *(float *)((int)npc->_parent + 0x33c); local_bc = (ANM2 *)((npc->_pos).y - *(float *)((int)npc->_parent + 0x340)); pVVar7 = Vector::Resized((Vector *)(local_c8 + 8),(Vector *)(local_d8 + 8),10.0); fVar13 = npc->_friction; if (fVar13 != 0.0) { fVar14 = npc->_speedMultiplier; fVar15 = pVVar7->y; (npc->_velocity).x = (fVar14 * pVVar7->x) / fVar13 + (npc->_velocity).x; (npc->_velocity).y = (fVar14 * fVar15) / fVar13 + (npc->_velocity).y; } } else { if ((int *)npc->_i2 == local_b0) { orbitFrame = npc->_stateFrame; } else { npc->_stateFrame = 0x19; orbitFrame = 0x19; npc->_i2 = (int)local_b0; } parent = npc->_parent; fVar13 = (float)(g_game->_frameCount - local_ac->_spawnFrame); local_b4 = (EntityPtr *) ((((float)local_ac->_i1 / (float)iVar9) * 360.0 + fVar13 + fVar13) * 0.017453292); local_b0 = (int *)(1.0 - (float)orbitFrame / 30.0); fVar13 = cos((float)local_b4); npc = local_ac; local_ac = (Entity_NPC *) (((fVar13 * 50.0 + *(float *)((int)parent + 0x33c)) - (local_ac->_pos).x) * (float)local_b0); fVar15 = sin((float)local_b4); fVar13 = *(float *)((int)parent + 0x340); fVar14 = (npc->_pos).y; (npc->_velocity).x = (float)local_ac; (npc->_velocity).y = ((fVar15 * 50.0 + fVar13) - fVar14) * (float)local_b0; } } if (0 < npc->_stateFrame) { npc->_stateFrame = npc->_stateFrame + -1; } LAB_00496afa: if (npc->_parent == (EntityPtr)0x0) { damageSource = EntityRef::EntityRef((EntityRef *)(local_50 + 4)); (**(code **)(*(int *)npc + 0x24))(damageSource); } local_bc = &npc->_sprite; uVar4 = Random(); local_ac = (Entity_NPC *) Game::Spawn(g_game,1000,0x58,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar4); setColorFn = *(code **)(*(int *)local_ac + 0x3c); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (*setColorFn)(&layer->_color,0xffffffff,0xff,0,1); pEVar16 = local_ac; fVar13 = (npc->_velocity).y; (local_ac->_velocity).x = (npc->_velocity).x * -0.5; (local_ac->_velocity).y = fVar13 * -0.5; uVar4 = Random(); fVar13 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_ac = (Entity_NPC *)(fVar13 + fVar13); uVar4 = Random(); fVar13 = (npc->_velocity).y; local_b0 = (int *)((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10); fVar14 = (npc->_velocity).x; local_b4 = (EntityPtr *)sqrtf(fVar14 * fVar14 + fVar13 * fVar13); fVar13 = cos((float)local_ac); local_cc = (undefined1 *)(fVar13 * (float)local_b0 * (float)local_b4 * 0.4); fVar14 = sin((float)local_ac); pAVar2 = local_bc; fVar13 = pEVar16->_friction; if (fVar13 != 0.0) { fVar15 = pEVar16->_speedMultiplier; (pEVar16->_velocity).x = ((float)local_cc * fVar15) / fVar13 + (pEVar16->_velocity).x; (pEVar16->_velocity).y = (fVar15 * fVar14 * (float)local_b0 * (float)local_b4 * 0.4) / fVar13 + (pEVar16->_velocity).y; } (pEVar16->_posOffset).x = 0.0; (pEVar16->_posOffset).y = -40.0; pbVar6 = (local_bc->_animState)._animData; if (pbVar6 != (byte *)0x0) { pbVar8 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar8 = *(byte **)pbVar6; } pbVar10 = s_Idle; do { bVar3 = *pbVar8; bVar12 = bVar3 < *pbVar10; if (bVar3 != *pbVar10) { LAB_00496d30: uVar4 = -(uint)bVar12 | 1; goto LAB_00496d35; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar12 = bVar3 < pbVar10[1]; if (bVar3 != pbVar10[1]) goto LAB_00496d30; pbVar8 = pbVar8 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00496d35: if (uVar4 == 0) { if (pbVar6[0x34] == 0) { ExceptionList = local_1c; return; } if ((local_bc->_animState)._isPlaying != 0) { ExceptionList = local_1c; return; } } } bVar3 = ANM2::SetAnimation(local_bc,s_Idle,1); if (bVar3 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&pAVar2->_animState); (pAVar2->_animState)._isPlaying = 1; ExceptionList = local_1c; return; } if (iVar9 != 2) { return; } ExceptionList = &local_1c; npc->_state = 3; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_d8,0xf6,1,-1,0,0); local_14 = 3; local_ac = (Entity_NPC *)0x0; if (local_cc != (undefined1 *)0x0) { do { iVar9 = *(int *)(local_d8._4_4_ + (int)local_ac * 4); fVar13 = *(float *)(iVar9 + 0x340) - (npc->_pos).y; fVar14 = *(float *)(iVar9 + 0x33c) - (npc->_pos).x; local_bc = (ANM2 *)sqrtf(fVar13 * fVar13 + fVar14 * fVar14); iVar9 = __RTDynamicCast(iVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4); if ((float)local_bc < 40.0) { if (*(int *)(iVar9 + 0xb64) == 0x10) { *(undefined4 *)(*(int *)(local_d8._4_4_ + (int)local_ac * 4) + 0xb64) = 2; } else { fVar13 = *(float *)(iVar9 + 900); fVar14 = fVar13 * 0.25 + *(float *)(iVar9 + 0x380); *(float *)(iVar9 + 0x380) = fVar14; if (fVar13 < fVar14) { *(float *)(iVar9 + 0x380) = fVar13; } } } local_ac = (Entity_NPC *)&local_ac->field_0x1; } while (local_ac < local_cc); } if (npc->_collidesWithGrid != 0) { (**(code **)(*(int *)npc + 0x28))(); } pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { LAB_00496f05: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rebirth Pillar",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar8 = *(byte **)pbVar6; } pcVar11 = "Rebirth Pillar"; do { bVar3 = *pbVar8; bVar12 = bVar3 < (byte)*pcVar11; if (bVar3 != *pcVar11) { LAB_00496ee7: uVar4 = -(uint)bVar12 | 1; goto LAB_00496eec; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar12 = bVar3 < (byte)pcVar11[1]; if (bVar3 != pcVar11[1]) goto LAB_00496ee7; pbVar8 = pbVar8 + 2; pcVar11 = pcVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00496eec: if ((uVar4 != 0) || ((pbVar6[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00496f05; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); } if (local_d8[0] != '\0') { ExceptionList = local_1c; return; } local_14 = 4; LAB_00496f56: tracked_alloc(1,(void *)local_d8._4_4_,0); ExceptionList = local_1c; return; } pVVar7 = &npc->_pos; ExceptionList = &local_1c; npc->_entityGridCollisionClass = 3; puStack_20 = local_50 + 0x4c; clampedPos = Room::GetClampedPositionImpl (game->_room,(Vector *)(local_c8 + 8),pVVar7,40.0,0.0,0.0,0.0); game = g_game; driftDirX = (float)&DAT_bf800000; fVar13 = clampedPos->x; pVVar7->x = fVar13; (npc->_pos).y = clampedPos->y; room = game->_room; if (fVar13 == *(float *)((int)room + 0x1c)) { (npc->_velocity).x = (float)&DAT_bf800000; room = game->_room; } if (fVar13 == *(float *)((int)room + 0x14)) { (npc->_velocity).x = 1.0; room = game->_room; } fVar13 = (npc->_pos).y; if (fVar13 == *(float *)((int)room + 0x20)) { (npc->_velocity).y = (float)&DAT_bf800000; room = game->_room; } if (fVar13 == *(float *)((int)room + 0x18) + 40.0) { (npc->_velocity).y = 1.0; } fVar13 = 0.4; if (npc->_variant == 1) { fVar13 = 0.8; if (npc->_subtype == 2) { fVar13 = 1.1; } else if (npc->_subtype == 1) { fVar13 = 0.5; } } local_cc = *(undefined1 **)((int)&npc->_flags + 4); if (((npc->_flags & 0x200) == 0) || ((npc->_flags & 0x100) != 0)) { if ((npc->_velocity).y < 0.1) { driftDirY = (float)&DAT_bf800000; } else { driftDirY = 1.0; } fVar14 = (npc->_velocity).x; if (0.0 < fVar14) { driftDirX = 1.0; } fVar15 = npc->_friction * 0.8; npc->_friction = fVar15; if (fVar15 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).y = (fVar1 * driftDirY * fVar13) / fVar15 + (npc->_velocity).y; (npc->_velocity).x = (fVar1 * driftDirX * fVar13) / fVar15 + fVar14; } if ((npc->_variant == 0) && (npc->_subtype == 2)) { npc->_friction = fVar15 * 0.9; } if ((npc->_flags & 0x1000800) != 0) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_ac = (Entity_NPC *)-((pEVar5->_pos).x - pVVar7->x); local_b0 = (int *)-((pEVar5->_pos).y - (npc->_pos).y); fVar13 = sqrtf((float)local_ac * (float)local_ac + (float)local_b0 * (float)local_b0); fVar14 = (180.0 - fVar13) * 0.02; if (fVar14 <= 0.0) { fVar14 = 0.0; } if (1.0 <= fVar14) { fVar14 = 1.0; } pEVar16 = local_ac; piVar17 = local_b0; if (0.0 < fVar13) { pEVar16 = (Entity_NPC *)((float)local_ac * (fVar14 / fVar13)); piVar17 = (int *)((float)local_b0 * (fVar14 / fVar13)); } fVar13 = npc->_friction; if (fVar13 != 0.0) { fVar14 = npc->_speedMultiplier; (npc->_velocity).y = (fVar14 * (float)piVar17) / fVar13 + (npc->_velocity).y; (npc->_velocity).x = (fVar14 * (float)pEVar16) / fVar13 + (npc->_velocity).x; } } } else { fVar13 = npc->_friction * 0.8; npc->_friction = fVar13; if ((npc->_variant == 0) && (npc->_subtype == 2)) { npc->_friction = fVar13 * 0.9; } PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } switch(npc->_state) { case 0: local_b0 = (int *)0x0; do { uVar4 = Random(); local_b4 = (EntityPtr *)(((float)(int)local_b0 / 3.0) * 360.0 * 0.017453292); fVar13 = cos((float)local_b4); local_c8._8_4_ = fVar13 * 50.0 + (npc->_pos).x; fVar13 = sin((float)local_b4); uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_bc = (ANM2 *)(fVar13 * 50.0 + (npc->_pos).y); pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar5 = Game::Spawn(g_game,0x199,1,(Vector *)(local_c8 + 8),&g_vectorZero,(Entity *)npc,0, uVar4); piVar17 = (int *)__RTDynamicCast(pEVar5,uVar18,pTVar19,pTVar20,uVar21); if (piVar17[0xef] != 0) { local_b4 = (EntityPtr *)(piVar17 + 0xef); std::multiset::erase(&local_b4); } piVar17[0xef] = (int)npc; std::multiset::insert(piVar17 + 0xef); piVar17[0x5a] = piVar17[0x5a] & 0xfffffffb; piVar17[0x2f0] = (int)local_b0; piVar17[0x5b] = piVar17[0x5b]; *(undefined1 *)(piVar17 + 0xec) = 1; piVar17[0x61] = 0; piVar17[0x62] = 2; (**(code **)(*piVar17 + 0xc))(); local_b0 = (int *)((int)local_b0 + 1); } while ((int)local_b0 < 3); npc->_i1 = 3; npc->_state = 4; if (&npc->_splatColor == (ColorMod *)local_104) { ExceptionList = local_1c; return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.35; (npc->_splatColor)._offset[1] = 0.11; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.36; ExceptionList = local_1c; return; default: goto switchD_0049599b_caseD_1; case 4: isRaglingCollapsed = '\0'; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_c8,0xf6,1,-1,0,0); pAVar2 = local_bc; local_14 = 0; fVar13 = 0.0; if (local_bc != (ANM2 *)0x0) { do { if (*(int *)(*(int *)(local_c8._4_4_ + (int)fVar13 * 4) + 0xb64) == 0x10) { isRaglingCollapsed = '\x01'; break; } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < local_bc); } if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { local_b4 = (EntityPtr *)((int)local_bc * 100); if (((local_b4 == (EntityPtr *)0x0) || (uVar4 = Random(), uVar4 % (uint)local_b4 == 0)) && (pAVar2 < 3)) { npc->_state = 0xd; bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3d7,1.0,2,0,1.0); } else { uVar4 = Random(); if ((uVar4 % 0x46 == 0) && (isRaglingCollapsed != '\0')) { npc->_state = 0xe; pbVar6 = &DAT_00b1d554; } else { uVar4 = Random(); if (uVar4 % 0x2d == 0) { npc->_state = 8; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Cover",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x3d9,1.0,2,0,1.0); goto LAB_00495df4; } pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pbVar8 = s_Walk; do { bVar3 = *pbVar6; bVar12 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_00495db7: uVar4 = -(uint)bVar12 | 1; goto LAB_00495dbc; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar12 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_00495db7; pbVar6 = pbVar6 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00495dbc: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00495df4; } pbVar6 = s_Walk; } bVar3 = ANM2::SetAnimation(&npc->_sprite,pbVar6,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar8 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar8 = *(byte **)pbVar6; } pbVar10 = s_Walk; do { bVar3 = *pbVar8; bVar12 = bVar3 < *pbVar10; if (bVar3 != *pbVar10) { LAB_00495c30: uVar4 = -(uint)bVar12 | 1; goto LAB_00495c35; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar12 = bVar3 < pbVar10[1]; if (bVar3 != pbVar10[1]) goto LAB_00495c30; pbVar8 = pbVar8 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00495c35: if ((uVar4 == 0) && ((pbVar6[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00495df4; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_00495df4: npc->_stateFrame = 0; if (local_c8[0] != '\0') { ExceptionList = local_1c; return; } local_14 = 1; local_d8._4_4_ = local_c8._4_4_; goto LAB_00496f56; case 8: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) { LAB_004962c7: iVar9 = npc->_stateFrame; } else { pbVar6 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pcVar11 = "Cover"; do { bVar3 = *pbVar6; bVar12 = bVar3 < (byte)*pcVar11; if (bVar3 != *pcVar11) { LAB_00496290: uVar4 = -(uint)bVar12 | 1; goto LAB_00496295; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar12 = bVar3 < (byte)pcVar11[1]; if (bVar3 != pcVar11[1]) goto LAB_00496290; pbVar6 = pbVar6 + 2; pcVar11 = pcVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00496295: if (uVar4 != 0) goto LAB_004962c7; ANM2::Play(&npc->_sprite,(byte *)"Covered",0); uVar4 = Random(); npc->_isInvicible = 1; iVar9 = uVar4 % 0x1e + 0x3c; npc->_stateFrame = iVar9; } if (0 < iVar9) { npc->_stateFrame = iVar9 + -1; if (iVar9 + -1 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Uncover",0); Entity_NPC::PlaySound(npc,0x3da,1.0,2,0,1.0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } iVar9 = ANM2::GetFrame(&npc->_sprite); if (0x14 < iVar9) { npc->_isInvicible = 0; } break; case 0xd: if (npc->_stateFrame == 0x14) { Entity_NPC::PlaySound(npc,0x3d8,1.0,2,0,1.0); local_ac = (Entity_NPC *)0x0; do { uVar4 = Random(); uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar5 = Game::Spawn(g_game,1000,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); piVar17 = (int *)__RTDynamicCast(pEVar5,uVar18,pTVar19,pTVar20,uVar21); if (local_ac == (Entity_NPC *)0x0) { iVar9 = 0x42b40000; } else { iVar9 = -0x3d4c0000; } piVar17[0x11d] = iVar9; local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.5; local_30 = 0.0; local_2c = 0.0; local_28 = 0.0; (**(code **)(*piVar17 + 0x3c))(local_50,0xffffffff,0xff,0,1); piVar17[0xd3] = 0; piVar17[0xd4] = -0x3de00000; (**(code **)(*piVar17 + 0xc))(); local_ac = (Entity_NPC *)((int)local_ac + 1); } while ((int)local_ac < 2); uVar4 = Random(); local_d8._8_4_ = (npc->_pos).x + 0.0; local_cc = (undefined1 *)((npc->_pos).y + 10.0); local_c8._8_4_ = 0; local_bc = (ANM2 *)0x41200000; pEVar5 = Game::Spawn(g_game,0xf6,1,(Vector *)(local_d8 + 8),(Vector *)(local_c8 + 8), (Entity *)npc,0,uVar4); if (pEVar5->_parent != (EntityPtr)0x0) { local_b4 = &pEVar5->_parent; std::multiset::erase(&local_b4); } pEVar5->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar5->_parent); uVar18 = *(undefined4 *)((int)&pEVar5->_flags + 4); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar5->_flags + 4) = uVar18; if ((npc->_flags & 0x1000000000000000) != 0) { pEVar5->_health = 15.0; pEVar5->_maxHitPoints = 15.0; } } npc->_stateFrame = npc->_stateFrame + 1; break; case 0xe: iVar9 = npc->_stateFrame; if (iVar9 == 0x14) { uVar4 = Random(); local_ac = (Entity_NPC *)0x0; local_b4 = (EntityPtr *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0); do { uVar4 = Random(); local_b0 = (int *)((((float)(int)local_ac / 3.0) * 360.0 + (float)local_b4) * 0.017453292); local_c8._8_4_ = cos((float)local_b0); local_c8._8_4_ = (float)local_c8._8_4_ * 10.0; fVar13 = sin((float)local_b0); local_bc = (ANM2 *)(fVar13 * 10.0); uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar5 = Game::Spawn(g_game,0x199,2,&npc->_pos,(Vector *)(local_c8 + 8),(Entity *)npc,0, uVar4); piVar17 = (int *)__RTDynamicCast(pEVar5,uVar18,pTVar19,pTVar20,uVar21); if (piVar17[0xef] != 0) { local_b0 = piVar17 + 0xef; std::multiset::erase(&local_b0); } piVar17[0xef] = (int)npc; std::multiset::insert(piVar17 + 0xef); piVar17[0x5a] = piVar17[0x5a] & 0xfffffffb; piVar17[0x5b] = piVar17[0x5b]; piVar17[0x62] = 0; piVar17[0x61] = 3; piVar17[0x57] = 0; (**(code **)(*piVar17 + 0xc))(); local_ac = (Entity_NPC *)((int)local_ac + 1); } while ((int)local_ac < 3); Entity_NPC::PlaySound(npc,0x3d6,1.0,2,0,1.0); iVar9 = npc->_stateFrame; } npc->_stateFrame = iVar9 + 1; pbVar6 = (npc->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar8 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar8 = *(byte **)pbVar6; } pcVar11 = "Rebirth"; do { bVar3 = *pbVar8; bVar12 = bVar3 < (byte)*pcVar11; if (bVar3 != *pcVar11) { LAB_00496202: uVar4 = -(uint)bVar12 | 1; goto LAB_00496207; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar12 = bVar3 < (byte)pcVar11[1]; if (bVar3 != pcVar11[1]) goto LAB_00496202; pbVar8 = pbVar8 + 2; pcVar11 = pcVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00496207: if ((uVar4 == 0) && ((pbVar6[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) break; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rebirth",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } switchD_0049599b_caseD_1: ExceptionList = local_1c; return; } //@@ 00496fb0 NpcAI::ENTITY_SISTERS_VIS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 410 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SISTERS_VIS(Entity_NPC *npc) { float fVar1; float fVar2; ANM2 *pAVar3; byte bVar4; char isCanSummon; undefined4 *damageEntry; uint uVar5; uint uVar6; Entity *pEVar7; byte *pbVar8; uint uVar9; Vector *pVVar10; int iVar11; int iVar12; ColorMod *pCVar13; float *damageEvent; Entity_Player *targetPlayer; Entity_NPC *pEVar14; int *summonedNpc; Entity_Effect *splat; byte *pbVar15; int unused; int unused_00; char *pcVar16; Vector *this; byte *pbVar17; void *pvVar18; void **roomPtr; int iVar19; EntityPtr EVar20; bool bVar21; float fVar22; float fVar23; float fVar24; float fVar25; EntityPtr EVar26; undefined1 auStack_1c8 [7]; char local_1c1; Vector scratchVec; Vector local_1b8; char isSisterInactive; char isOriginal; char isStatusImpaired; Vector local_1ac; Vector local_1a4; undefined4 local_19c [8]; undefined4 local_17c; undefined4 uStack_178; undefined4 local_174; undefined4 local_170 [8]; undefined4 local_150; undefined4 uStack_14c; undefined4 local_148; Vector velocityDir; ColorMod splatColor; ProjectileParams projParams; uint local_c; float *damageEventsEnd; Game *game; EntityPtr *laserRefPtr; Manager *manager; local_c = __security_cookie ^ (uint)auStack_1c8; EVar20 = npc->_child; if ((npc->_spawnerType == npc->_type) || (EVar20 == (EntityPtr)0x0)) { isOriginal = '\0'; if ((npc->_spawnerType != npc->_type) || (isOriginal = '\0', EVar20 == (EntityPtr)0x0)) goto LAB_00496ff7; local_1c1 = '\x01'; isOriginal = '\0'; } else { isOriginal = '\x01'; LAB_00496ff7: local_1c1 = '\0'; } isStatusImpaired = (npc->_flags & 0x1000a00) != 0; if ((EVar20 == (EntityPtr)0x0) || ((*(uint *)((int)EVar20 + 0x168) & 0x1000a00) != 0)) { isSisterInactive = '\x01'; if (EVar20 != (EntityPtr)0x0) goto LAB_00497042; npc->_i2 = npc->_i2 + 1; isSisterInactive = '\x01'; } else { isSisterInactive = '\0'; if (EVar20 != (EntityPtr)0x0) { LAB_00497042: if (300.0 < npc->_health - *(float *)((int)EVar20 + 0x380)) { npc->_i2 = 0x78; } } } EVar26 = (EntityPtr)0x0; if ((0.0 < npc->_pendingDamage) && (damageEntry = (npc->_damageEvents)._begin, damageEntry != (npc->_damageEvents)._end)) { do { if (damageEntry[4] == 0x27) { *damageEntry = 0; } damageEntry = damageEntry + 0xe; } while (damageEntry != (npc->_damageEvents)._end); } local_1a4.x = (float)npc; if (npc->_state == 0) { npc->_state = 3; npc->_stateFrame = 0; (npc->_sizeMulti).x = 1.2; (npc->_sizeMulti).y = 0.5; local_17c = 0x3ec8c8ca; uStack_178 = 0x3ec8c8ca; local_174 = 0x3ea0a0a1; if (&npc->_splatColor != (ColorMod *)local_19c) { (npc->_splatColor)._offset[0] = 0.3921569; (npc->_splatColor)._offset[1] = 0.3921569; (npc->_splatColor)._tint[0] = 0.039215688; (npc->_splatColor)._tint[1] = 0.3137255; (npc->_splatColor)._tint[2] = 0.039215688; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.3137255; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } npc->_i2 = 0; local_1b8.x = 0.0; std::deque::resize(1,&local_1b8); if (npc->_spawnerType == npc->_type) { return; } uVar5 = Random(); uVar9 = npc->_subtype; uVar6 = Random(); fVar22 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1b8.x = fVar22 + fVar22; fVar22 = cos(local_1b8.x); scratchVec.x = fVar22 * 40.0 + *(float *)((int)local_1a4.x + 0x33c); fVar23 = sin(local_1b8.x); fVar22 = local_1a4.x; scratchVec.y = fVar23 * 40.0 + *(float *)((int)local_1a4.x + 0x340); pEVar7 = Game::SpawnEx(g_game,*(uint *)((int)local_1a4.x + 0x28), *(uint *)((int)local_1a4.x + 0x2c),&scratchVec, (Vector *)((int)local_1a4.x + 0x360),(Entity *)local_1a4.x,uVar9,uVar5,0) ; if (*(int *)((int)fVar22 + 0x28) != 0x19a) { return; } if (*(int *)((int)fVar22 + 0x3c0) != 0) { local_1b8.x = (float)((int)fVar22 + 0x3c0); std::multiset::erase(&local_1b8); } *(undefined4 *)((int)fVar22 + 0x3c0) = pEVar7; if (pEVar7 != (Entity *)0x0) { std::multiset::insert((undefined4 *)((int)fVar22 + 0x3c0)); } if (pEVar7->_child != (EntityPtr)0x0) { local_1b8.x = (float)&pEVar7->_child; std::multiset::erase(&local_1b8); } pEVar7->_child = (EntityPtr)fVar22; std::multiset::insert(&pEVar7->_child); if ((*(uint *)((int)fVar22 + 0x16c) & 0x10000000) == 0) { return; } pEVar7->_health = *(float *)((int)fVar22 + 0x380); pEVar7->_maxHitPoints = *(float *)((int)fVar22 + 900); return; } pCVar13 = &(npc->_sprite)._color; fVar22 = 1.0; fVar23 = 1.5; if (npc->_i2 == 0) { if (pCVar13 != &npc->_color) { fVar1 = (npc->_color)._tint[1]; fVar2 = (npc->_color)._tint[2]; fVar24 = (npc->_color)._tint[3]; pCVar13->_tint[0] = (npc->_color)._tint[0]; (npc->_sprite)._color._tint[1] = fVar1; (npc->_sprite)._color._tint[2] = fVar2; (npc->_sprite)._color._tint[3] = fVar24; fVar1 = (npc->_color)._colorize[1]; fVar2 = (npc->_color)._colorize[2]; fVar24 = (npc->_color)._colorize[3]; (npc->_sprite)._color._colorize[0] = (npc->_color)._colorize[0]; (npc->_sprite)._color._colorize[1] = fVar1; (npc->_sprite)._color._colorize[2] = fVar2; (npc->_sprite)._color._colorize[3] = fVar24; *(undefined8 *)(npc->_sprite)._color._offset = *(undefined8 *)(npc->_color)._offset; (npc->_sprite)._color._offset[2] = (npc->_color)._offset[2]; } } else { local_150 = 0; uStack_14c = 0; local_148 = 0; if (pCVar13 != (ColorMod *)local_170) { (npc->_sprite)._color._colorize[0] = 0.0; (npc->_sprite)._color._colorize[1] = 0.0; (npc->_sprite)._color._colorize[2] = 0.0; (npc->_sprite)._color._colorize[3] = 0.0; (npc->_sprite)._color._offset[0] = 0.0; (npc->_sprite)._color._offset[1] = 0.0; pCVar13->_tint[0] = 1.0; (npc->_sprite)._color._tint[1] = 0.3; (npc->_sprite)._color._tint[2] = 0.3; (npc->_sprite)._color._tint[3] = 1.0; (npc->_sprite)._color._offset[2] = 0.0; } fVar22 = 1.5; } npc->_collisionDamage = fVar22; game = g_game; iVar12 = npc->_state; local_1b8.x = (float)EVar20; if (iVar12 == 3) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_00497403: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar15 = s_Idle; do { bVar4 = *pbVar8; bVar21 = bVar4 < *pbVar15; if (bVar4 != *pbVar15) { LAB_004973e3: uVar9 = -(uint)bVar21 | 1; goto LAB_004973e8; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar21 = bVar4 < pbVar15[1]; if (bVar4 != pbVar15[1]) goto LAB_004973e3; pbVar8 = pbVar8 + 2; pbVar15 = pbVar15 + 2; } while (bVar4 != 0); uVar9 = 0; LAB_004973e8: if ((uVar9 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00497403; } if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { iVar12 = npc->_stateFrame; npc->_stateFrame = iVar12 + 1; if (0x14 < iVar12) { uVar9 = Random(); if ((uVar9 % 5 == 0) && (((isOriginal != '\0' || (EVar20 == (EntityPtr)0x0)) && (isStatusImpaired == '\0')))) { uVar9 = Random(); if (uVar9 % 100 < 0x23) { if (isSisterInactive == '\0') { npc->_state = 6; pVVar10 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar22 = (pEVar7->_velocity).y; fVar23 = pVVar10->y; (npc->_targetPosition).x = (pEVar7->_velocity).x * 10.0 + pVVar10->x; (npc->_targetPosition).y = fVar22 * 10.0 + fVar23; uVar9 = Random(); game = g_game; local_1a4.x = (float)(uVar9 & 0xffffff01); if ((uVar9 & 1) == 0) { (npc->_targetPosition).y = *(float *)((int)g_game->_room + 0x18); } else { (npc->_targetPosition).x = *(float *)((int)g_game->_room + 0x14); } roomPtr = &game->_room; fVar22 = npc->_size; Room::GetClampedPositionImpl (*roomPtr,&scratchVec,&npc->_targetPosition,fVar22,fVar22,fVar22,fVar22); pVVar10 = (Vector *)((int)local_1b8.x + 0x334); (npc->_targetPosition).x = scratchVec.x; (npc->_targetPosition).y = scratchVec.y; (npc->_v1).x = 0.0; npc->_i1 = 0; *(undefined1 **)((int)local_1b8.x + 0xb64) = &DAT_00000006; *(float *)((int)local_1b8.x + 0xbc0) = 0.0; ((Vector *)((int)local_1b8.x + 0xbb0))->x = 0.0; ((Vector *)((int)local_1b8.x + 0x334))->x = (npc->_targetPosition).x; *(float *)((int)local_1b8.x + 0x338) = (npc->_targetPosition).y; if (local_1a4.x._0_1_ == '\0') { *(float *)((int)local_1b8.x + 0x338) = *(float *)((int)*roomPtr + 0x20); } else { pVVar10->x = *(float *)((int)*roomPtr + 0x1c); } fVar22 = npc->_size; local_1b8.x = (float)((int)local_1b8.x + 0x334); Room::GetClampedPositionImpl(*roomPtr,&scratchVec,pVVar10,fVar22,fVar22,fVar22,fVar22) ; *(float *)local_1b8.x = scratchVec.x; *(float *)((int)local_1b8.x + 4) = scratchVec.y; goto LAB_00498e97; } } else if (0x54 < uVar9 % 100) { pvVar18 = g_game->_room; iVar11 = *(int *)((int)pvVar18 + 0x12c8) + *(int *)((int)pvVar18 + 0x12cc); iVar19 = *(int *)((int)pvVar18 + 0x12c4) + *(int *)((int)pvVar18 + 0x12c0); iVar12 = 0; if (0 < iVar11) { iVar12 = iVar11; } iVar11 = 0; if (0 < iVar19) { iVar11 = iVar19; } local_1c1 = iVar11 - iVar12 < 2; bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar4 == 0) { isCanSummon = local_1c1; } else { iVar12 = Entity::CountRelatedEntities((Entity *)npc,0xfb,0,unused,(void *)0x0); iVar11 = Entity::CountRelatedEntities((Entity *)npc,0x27,0,unused_00,(void *)0x0); isCanSummon = (uint)(iVar12 + iVar11) < 2; } if (isCanSummon != '\0') { uVar9 = Random(); pvVar18 = (void *)((uVar9 % 3 != 0) + 0xd); npc->_state = (int)pvVar18; if ((npc->_child != (EntityPtr)0x0) && (isSisterInactive == '\0')) { *(void **)((int)local_1b8.x + 0xb64) = pvVar18; } } goto LAB_00498e97; } npc->_state = 8; npc->_i1 = 0; Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); if (isSisterInactive == '\0') { *(undefined1 **)((int)EVar20 + 0xb64) = &DAT_00000008; *(float *)((int)EVar20 + 0xbc0) = 0.0; } } } } goto LAB_00498e97; } if ((iVar12 == 0xd) || (iVar12 == 0xe)) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_00498bdf: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar15 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar15 = *(byte **)pbVar8; } pbVar17 = s_Attack1; do { bVar4 = *pbVar15; bVar21 = bVar4 < *pbVar17; if (bVar4 != *pbVar17) { LAB_00498bc1: uVar9 = -(uint)bVar21 | 1; goto LAB_00498bc6; } if (bVar4 == 0) break; bVar4 = pbVar15[1]; bVar21 = bVar4 < pbVar17[1]; if (bVar4 != pbVar17[1]) goto LAB_00498bc1; pbVar15 = pbVar15 + 2; pbVar17 = pbVar17 + 2; } while (bVar4 != 0); uVar9 = 0; LAB_00498bc6: if ((uVar9 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00498bdf; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { if (npc->_state == 0xd) { uVar9 = Random(); local_1b8.x = (npc->_pos).x + 0.0; local_1b8.y = (npc->_pos).y + 20.0; pVVar10 = &local_1b8; uVar5 = 0xfb; } else { if (npc->_state != 0xe) goto LAB_00498e74; uVar9 = Random(); local_1ac.x = (npc->_pos).x + 0.0; local_1ac.y = (npc->_pos).y + 20.0; pVVar10 = &local_1ac; uVar5 = 0x27; } scratchVec.x = 0.0; scratchVec.y = 5.0; pEVar7 = Game::SpawnEx(g_game,uVar5,0,pVVar10,&scratchVec,(Entity *)npc,0,uVar9,0); summonedNpc = (int *)__RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor, 0); (**(code **)(*summonedNpc + 0xc))(); Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); uVar9 = Random(); local_1b8.x = 0.0; local_1ac.x = (float)(uVar9 % 3 + 2); if ((EntityPtr)local_1ac.x != (EntityPtr)0x0) { do { uVar9 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5); if ((EntityPtr)local_1b8.x == (EntityPtr)0x0) { fVar23 = (npc->_pos).y + 20.0; fVar22 = (npc->_pos).x + 0.0; } else { uVar9 = Random(); fVar23 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; fVar22 = fVar23 * 0.0 + (npc->_pos).x; fVar23 = fVar23 * 20.0 + (npc->_pos).y; } (splat->_pos).x = fVar22; (splat->_pos).y = fVar23; splatColor._colorize[0] = 0.0; splatColor._colorize[1] = 0.0; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 0.0; splatColor._tint[0] = 0.0; splatColor._tint[1] = 0.0; splatColor._tint[2] = 0.0; splatColor._tint[3] = 1.0; splatColor._offset[0] = 0.42; splatColor._offset[1] = 0.43; splatColor._offset[2] = 0.35; (**(code **)(*(int *)splat + 0x3c))(&splatColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)splat + 0xc))(); local_1b8.x = (float)((int)local_1b8.x + 1); } while ((int)local_1b8.x < (int)local_1ac.x); } } LAB_00498e74: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00498e97; } npc->_state = 3; LAB_00498e8d: npc->_stateFrame = 0; goto LAB_00498e97; } if (iVar12 == 8) { local_1b8.x = 16.0; if (npc->_i2 != 0) { local_1b8.x = 24.0; } if (npc->_i1 == 0) { pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_00497821: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"RollStart",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar15 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar15 = *(byte **)pbVar8; } pcVar16 = "RollStart"; do { bVar4 = *pbVar15; bVar21 = bVar4 < (byte)*pcVar16; if (bVar4 != *pcVar16) { LAB_00497802: uVar9 = -(uint)bVar21 | 1; goto LAB_00497807; } if (bVar4 == 0) break; bVar4 = pbVar15[1]; bVar21 = bVar4 < (byte)pcVar16[1]; if (bVar4 != pcVar16[1]) goto LAB_00497802; pbVar15 = pbVar15 + 2; pcVar16 = pcVar16 + 2; } while (bVar4 != 0); uVar9 = 0; LAB_00497807: if ((uVar9 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00497821; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = npc->_i1 + 1; pEVar7 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar7->_pos).x - (npc->_pos).x; scratchVec.y = (pEVar7->_pos).y - (npc->_pos).y; pVVar10 = Vector::Normalized(&scratchVec,&local_1a4); fVar22 = pVVar10->y; fVar23 = local_1b8.x * pVVar10->x + (npc->_velocity).x; (npc->_velocity).x = fVar23; (npc->_velocity).y = local_1b8.x * fVar22 + (npc->_velocity).y; npc->_stateFrame = 0; if (local_1c1 != '\0') { (npc->_velocity).x = fVar23 * -1.0; (npc->_velocity).y = (npc->_velocity).y * -1.0; } } goto LAB_00498e97; } if (npc->_i1 == 1) { iVar12 = ANM2::GetFrame(&npc->_sprite); if (iVar12 % 3 == 0) { uVar9 = Random(); uVar5 = 0x5e; if (local_1c1 == '\0') { uVar5 = 0x17; } pEVar7 = Game::SpawnEx(g_game,1000,uVar5,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar9,0); fVar22 = g_vectorOne.y * 2.0; iVar12 = *(int *)pEVar7; (pEVar7->_sprite)._scale.x = g_vectorOne.x * 2.0; pAVar3 = &pEVar7[1]._sprite; (pAVar3->_filename)._buf[8] = '\x05'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; (pEVar7->_sprite)._scale.y = fVar22; pAVar3 = &pEVar7[1]._sprite; (pAVar3->_filename)._buf[0xc] = '\x05'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; (**(code **)(iVar12 + 0xc))(); } ANM2::Play(&npc->_sprite,(byte *)"RollLoop",0); bVar4 = Vector::operator_ne(&npc->_velocity,&g_vectorZero); if (bVar4 != 0) { pVVar10 = Vector::Normalized(this,&velocityDir); fVar22 = pVVar10->y; (npc->_velocity).x = local_1b8.x * pVVar10->x; (npc->_velocity).y = local_1b8.x * fVar22; } if (((EVar20 == (EntityPtr)0x0) || ((*(void **)((int)EVar20 + 0xb64) == &DAT_00000008 && (*(float *)((int)EVar20 + 0xbc0) == 1.4013e-45)))) && ((iVar12 = npc->_stateFrame, npc->_stateFrame = iVar12 + 1, 0x41 < iVar12 || (isStatusImpaired != '\0')))) { uVar9 = Random(); if (uVar9 % 0x23 == 0) { bVar4 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&npc->_pos); if (bVar4 != 0) { uVar9 = Random(); if (uVar9 % 100 < 0x3c) { npc->_i1 = 2; } else { npc->_i1 = 4 - (uint)(uVar9 % 100 < 0x46); } } } } goto LAB_00498e97; } ANM2::Play(&npc->_sprite,(byte *)"Taunt",0); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00498e97; if (isStatusImpaired != '\0') goto LAB_00498b2e; iVar12 = npc->_i1; if (iVar12 == 2) { npc->_state = 10; npc->_i1 = 0; pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar22 = (pEVar7->_pos).x; fVar23 = (npc->_pos).x; (npc->_targetPosition).y = (pEVar7->_pos).y - (npc->_pos).y; (npc->_targetPosition).x = fVar22 - fVar23; npc->_stateFrame = 0; pCVar13 = (ColorMod *)Color::Color(0x3f4ccccd); iVar12 = vector_to_direction(&npc->_targetPosition); fVar22 = normalize_angle_degrees((float)iVar12 * 90.0 + 180.0); local_1b8.x = fVar22 * 0.017453292; scratchVec.x = cos(local_1b8.x); scratchVec.y = sin(local_1b8.x); local_1ac.x = 0.0; local_1ac.y = -40.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_1ac,&scratchVec,0x28,pCVar13,8.0); goto LAB_00498e97; } if (iVar12 == 3) { npc->_state = 0xb; } else { if (iVar12 != 4) goto LAB_00498e97; npc->_state = 0xc; } npc->_i1 = 0; pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar22 = (pEVar7->_pos).y; fVar23 = (npc->_pos).y; (npc->_targetPosition).x = (pEVar7->_pos).x - (npc->_pos).x; (npc->_targetPosition).y = fVar22 - fVar23; goto LAB_00498e8d; } if (iVar12 == 10) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; local_1b8.x = (float)vector_to_direction(&npc->_targetPosition); (npc->_sprite)._flipX = (EntityPtr)local_1b8.x == (EntityPtr)0x0; iVar12 = npc->_i1; if (iVar12 != 0) { if (iVar12 == 1) { if ((float)EVar26 < npc->_pendingDamage) { damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { *damageEvent = *damageEvent * fVar23; } } ANM2::Play(&npc->_sprite,(&PTR_s_LaserLoopSide_00b1dbe4)[(int)local_1b8.x],0); fVar22 = local_1b8.x; scratchVec.x = 0.0; scratchVec.y = -30.0; if ((EntityPtr)local_1b8.x == (EntityPtr)0x0) { scratchVec.x = -35.0; } else if ((EntityPtr)local_1b8.x == (EntityPtr)0x2) { scratchVec.x = 35.0; } pVVar10 = &scratchVec; bVar4 = 0; iVar12 = 0x1e; pEVar14 = npc; fVar23 = normalize_angle_degrees((float)(int)local_1b8.x * 90.0 + 180.0); local_1b8.x = (float)Entity_Laser::ShootAngle (6,&npc->_pos,fVar23,iVar12,pVVar10,(Entity *)pEVar14,bVar4); if ((EntityPtr)fVar22 == (EntityPtr)0x1) { fVar22 = -10.0; } else { fVar22 = 3000.0; } laserRefPtr = &npc->_entityRef; *(float *)((int)local_1b8.x + 0x358) = fVar22; if (*laserRefPtr != (EntityPtr)0x0) { local_1a4.x = (float)laserRefPtr; std::multiset::erase(&local_1a4); } *laserRefPtr = (EntityPtr)local_1b8.x; if ((EntityPtr)local_1b8.x != (EntityPtr)0x0) { std::multiset::insert(laserRefPtr); } (**(code **)(*(int *)local_1b8.x + 0xc))(); npc->_i1 = npc->_i1 + 1; goto LAB_00498e97; } if (iVar12 == 2) { LAB_00497dee: if (npc->_entityRef == (EntityPtr)0x0) { npc->_i1 = 3; } goto LAB_00498e97; } bVar21 = iVar12 == 3; LAB_00497e0d: if (!bVar21) goto LAB_00498e97; pbVar8 = (&PTR_s_LaserEndSide_00b1dbd4)[(int)local_1b8.x]; LAB_00498b13: ANM2::Play(&npc->_sprite,pbVar8,0); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00498e97; LAB_00498b2e: npc->_state = 3; npc->_i1 = 0; npc->_stateFrame = 0; if (EVar20 != (EntityPtr)0x0) { *(void **)((int)EVar20 + 0xb64) = (void *)0x3; *(float *)((int)EVar20 + 0xbc0) = 0.0; ((Vector *)((int)EVar20 + 0x410))->x = 0.0; } goto LAB_00498e97; } ANM2::Play(&npc->_sprite,(&PTR_s_LaserStartSide_00b1dbf4)[(int)local_1b8.x],0); goto LAB_00497cb0; } if (iVar12 == 6) { iVar12 = npc->_i1; if (iVar12 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Jumping",0); npc->_i1 = npc->_i1 + 1; } else if (iVar12 == 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"JumpLoop",0); npc->_i1 = npc->_i1 + 1; } } else if ((iVar12 == 2) && (fVar22 = (npc->_targetPosition).x - (npc->_pos).x, fVar23 = (npc->_targetPosition).y - (npc->_pos).y, fVar23 * fVar23 + fVar22 * fVar22 < 2.0)) { npc->_i1 = 0; npc->_state = 7; npc->_entityCollisionClass = 4; } bVar4 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } if (npc->_i1 < 2) { bVar4 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); if (bVar4 == 0) goto LAB_00498e97; } fVar22 = (npc->_v1).x + 0.02; if (1.0 <= fVar22) { fVar22 = 1.0; } (npc->_v1).x = fVar22; fVar23 = (npc->_targetPosition).x; (npc->_pos).y = fVar22 * (npc->_targetPosition).y + (1.0 - fVar22) * (npc->_pos).y; (npc->_pos).x = (1.0 - fVar22) * (npc->_pos).x + fVar22 * fVar23; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; goto LAB_00498e97; } if (iVar12 == 7) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; if (npc->_i1 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Landing",0); npc->_i1 = npc->_i1 + 1; goto LAB_00498e97; } if (npc->_i1 != 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (EVar20 == (EntityPtr)0x0) { npc->_i1 = 0; npc->_state = 3; } else if (*(float *)((int)EVar20 + 0xbc0) == 2.8026e-45) { npc->_i1 = 0; *(float *)((int)EVar20 + 0xbc0) = 0.0; npc->_state = 9; *(undefined1 **)((int)EVar20 + 0xb64) = &DAT_00000009; } } goto LAB_00498e97; } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Landed"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x45,1.0,2,0,1.0); } LAB_00497cb0: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = npc->_i1 + 1; } goto LAB_00498e97; } if (iVar12 == 9) { npc->_entityGridCollisionClass = 5; npc->_entityCollisionClass = 4; targetPlayer = Game::GetRandomPlayer(game,&npc->_pos,9999999.0); fVar22 = (targetPlayer->_pos).x; fVar23 = (targetPlayer->_pos).y; if (EVar20 != (EntityPtr)0x0) { fVar22 = ((Vector *)((int)EVar20 + 0x33c))->x; fVar23 = *(float *)((int)EVar20 + 0x340); } fVar1 = (npc->_pos).x; fVar2 = (npc->_pos).y; fVar25 = ABS(fVar1 - fVar22); fVar24 = ABS(fVar2 - fVar23); local_1c1 = fVar24 < fVar25; local_1a4.x = 0.0; if (fVar25 <= fVar24) { local_1a4.x = (float)((uint)(fVar2 < fVar23) * 2 + 1); } else if (fVar1 < fVar22) { local_1a4.x = 2.8026e-45; } (npc->_sprite)._flipX = (EntityPtr)local_1a4.x == (EntityPtr)0x0; iVar12 = npc->_i1; if (iVar12 != 0) { if (iVar12 == 1) { if (0.0 < npc->_pendingDamage) { damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { *damageEvent = *damageEvent * 1.5; } } ANM2::Play(&npc->_sprite,(&PTR_s_LaserLoopSide_00b1dbe4)[(int)local_1a4.x],0); scratchVec.x = 0.0; scratchVec.y = -30.0; if ((EntityPtr)local_1a4.x == (EntityPtr)0x0) { scratchVec.x = -35.0; } else if ((EntityPtr)local_1a4.x == (EntityPtr)0x2) { scratchVec.x = 35.0; } pVVar10 = &scratchVec; bVar4 = 0; iVar12 = 0xf; pEVar14 = npc; fVar22 = normalize_angle_degrees((float)(int)local_1a4.x * 90.0 + 180.0); local_1ac.x = (float)Entity_Laser::ShootAngle (6,&npc->_pos,fVar22,iVar12,pVVar10,(Entity *)pEVar14,bVar4); if ((EntityPtr)local_1a4.x == (EntityPtr)0x1) { fVar22 = -10.0; } else { fVar22 = 3000.0; } *(float *)((int)local_1ac.x + 0x358) = fVar22; *(float *)((int)local_1ac.x + 0x4d0) = 57.0; if (EVar20 != (EntityPtr)0x0) { if (local_1c1 == '\0') { fVar22 = ABS((npc->_pos).y - *(float *)((int)EVar20 + 0x340)) - 87.0; } else { fVar22 = ABS((npc->_pos).x - ((Vector *)((int)EVar20 + 0x33c))->x) - 157.0; } *(float *)((int)local_1ac.x + 0x4d0) = fVar22 * 0.5; } (**(code **)(*(int *)local_1ac.x + 0xc))(); laserRefPtr = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_1b8.x = (float)laserRefPtr; std::multiset::erase(&local_1b8); } *laserRefPtr = (EntityPtr)local_1ac.x; std::multiset::insert(laserRefPtr); npc->_i1 = npc->_i1 + 1; goto LAB_00498e97; } if (iVar12 != 2) { if ((iVar12 != 3) || ((ANM2::Play(&npc->_sprite,(&PTR_s_LaserEndSide_00b1dbd4)[(int)local_1a4.x],0), (npc->_sprite)._animState._animData != (void *)0x0 && ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00498e97; npc->_state = 3; npc->_i1 = 0; goto LAB_00498e8d; } goto LAB_00497dee; } ANM2::Play(&npc->_sprite,(&PTR_s_LaserStartSide_00b1dbf4)[(int)local_1a4.x],0); uVar9 = (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar9 >> 2) * 4) + (uVar9 & 3) * 4) == 0) { pCVar13 = (ColorMod *)Color::Color(0x3f4ccccd); fVar22 = normalize_angle_degrees((float)(int)local_1a4.x * 90.0 + 180.0); local_1b8.x = fVar22 * 0.017453292; scratchVec.x = cos(local_1b8.x); scratchVec.y = sin(local_1b8.x); local_1ac.x = 0.0; local_1ac.y = -40.0; local_1a4.x = (float)Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_1ac,&scratchVec,0x2a,pCVar13,8.0); uVar9 = (npc->_entityDeque)._offset; uVar5 = uVar9 & 3; iVar12 = *(int *)((int)(npc->_entityDeque)._map + (uVar9 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); EVar20 = (EntityPtr)(iVar12 + uVar5 * 4); if (*(int *)(iVar12 + uVar5 * 4) != 0) { local_1b8.x = (float)EVar20; std::multiset::erase(&local_1b8); } EVar26 = (EntityPtr)local_1a4.x; LAB_00498270: *(EntityPtr *)EVar20 = EVar26; if (EVar26 != (EntityPtr)0x0) { std::multiset::insert(EVar20); } } goto LAB_00497cb0; } if (iVar12 != 0xb) { if (iVar12 != 0xc) goto LAB_00498e97; npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; local_1ac.x = (float)vector_to_direction(&npc->_targetPosition); iVar12 = npc->_i1; if (iVar12 == 0) { pbVar8 = (&PTR_s_LaserStartSide_00b1dbf4)[(int)local_1ac.x]; (npc->_sprite)._flipX = (EntityPtr)local_1ac.x == (EntityPtr)0x0; ANM2::Play(&npc->_sprite,pbVar8,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); npc->_i1 = npc->_i1 + 1; uVar9 = Random(); (npc->_v1).x = (float)(uVar9 % 100) + 0.0; } goto LAB_00498e97; } if (iVar12 == 1) { fVar22 = (npc->_v1).x; iVar19 = npc->_stateFrame + 1; npc->_stateFrame = iVar19; iVar12 = (uint)(npc->_i2 == 0) * 2; iVar11 = iVar12 + 5; if (33.0 <= fVar22) { if (fVar22 < 66.0) { iVar11 = iVar12 + 6; } } else { iVar11 = iVar12 + 7; } if (iVar19 % iVar11 == 0) { fVar22 = 6.0; if (npc->_i2 != 0) { fVar22 = 8.0; } scratchVec.y = 0.0; scratchVec.x = 0.0; if ((EntityPtr)local_1ac.x == (EntityPtr)0x1) { scratchVec.y = -fVar22; ProjectileParams::ProjectileParams(&projParams); projParams.DepthOffset = -10.0; local_1a4.x = 0.0; } else { local_1a4.x = (float)EVar26; if ((EntityPtr)local_1ac.x == (EntityPtr)0x3) { scratchVec.y = fVar22; } else if ((EntityPtr)local_1ac.x == (EntityPtr)0x0) { scratchVec.x = -fVar22; local_1a4.x = (float)(EntityPtr)0xc1f00000; } else if ((EntityPtr)local_1ac.x == (EntityPtr)0x2) { scratchVec.x = fVar22; local_1a4.x = (float)(EntityPtr)0x41f00000; } ProjectileParams::ProjectileParams(&projParams); projParams.DepthOffset = 3000.0; } fVar22 = (npc->_v1).x; uVar9 = 4; if (33.0 <= fVar22) { if (fVar22 < 66.0) { uVar9 = 3; } } else { uVar9 = 1; } Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); local_1ac.x = local_1a4.x + (npc->_pos).x; local_1ac.y = (npc->_pos).y - 15.0; Entity_NPC::FireProjectiles(npc,&local_1ac,&scratchVec,uVar9,&projParams); iVar19 = npc->_stateFrame; } if (0x1e < iVar19) { npc->_i1 = npc->_i1 + 1; } goto LAB_00498e97; } if (iVar12 != 2) goto LAB_00498e97; pbVar8 = (&PTR_s_LaserEndSide_00b1dbd4)[(int)local_1ac.x]; goto LAB_00498b13; } npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; local_1b8.x = (float)vector_to_direction(&npc->_targetPosition); iVar12 = npc->_i1; if (iVar12 == 0) { pbVar8 = (&PTR_s_LaserStartSide_00b1dbf4)[(int)local_1b8.x]; (npc->_sprite)._flipX = (EntityPtr)local_1b8.x == (EntityPtr)0x0; ANM2::Play(&npc->_sprite,pbVar8,0); uVar9 = (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar9 >> 2) * 4) + (uVar9 & 3) * 4) == 0) { pCVar13 = (ColorMod *)Color::Color(0x3f4ccccd); fVar22 = normalize_angle_degrees((float)(int)local_1b8.x * 90.0 + 180.0); local_1ac.x = fVar22 * 0.017453292; scratchVec.x = cos(local_1ac.x); scratchVec.y = sin(local_1ac.x); local_1ac.x = 0.0; local_1ac.y = -40.0; local_1b8.x = (float)Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_1ac,&scratchVec,0x2a,pCVar13,8.0); uVar9 = (npc->_entityDeque)._offset; uVar5 = uVar9 & 3; iVar12 = *(int *)((int)(npc->_entityDeque)._map + (uVar9 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); EVar20 = (EntityPtr)(iVar12 + uVar5 * 4); if (*(int *)(iVar12 + uVar5 * 4) != 0) { local_1ac.x = (float)EVar20; std::multiset::erase(&local_1ac); } EVar26 = (EntityPtr)local_1b8.x; goto LAB_00498270; } goto LAB_00497cb0; } if (iVar12 == 1) { if ((float)EVar26 < npc->_pendingDamage) { damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { *damageEvent = *damageEvent * 1.5; } } ANM2::Play(&npc->_sprite,(&PTR_s_LaserLoopSide_00b1dbe4)[(int)local_1b8.x],0); fVar22 = local_1b8.x; scratchVec.x = 0.0; scratchVec.y = -30.0; if ((EntityPtr)local_1b8.x == (EntityPtr)0x0) { scratchVec.x = -35.0; } else if ((EntityPtr)local_1b8.x == (EntityPtr)0x2) { scratchVec.x = 35.0; } pVVar10 = &scratchVec; bVar4 = 0; iVar12 = 0x3c; pEVar14 = npc; fVar23 = normalize_angle_degrees((float)(int)local_1b8.x * 90.0 + 180.0); local_1b8.x = (float)Entity_Laser::ShootAngle (6,&npc->_pos,fVar23,iVar12,pVVar10,(Entity *)pEVar14,bVar4); if ((EntityPtr)fVar22 == (EntityPtr)0x1) { fVar22 = -10.0; } else { fVar22 = 3000.0; } *(float *)((int)local_1b8.x + 0x358) = fVar22; (**(code **)(*(int *)local_1b8.x + 0xc))(); laserRefPtr = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_1ac.x = (float)laserRefPtr; std::multiset::erase(&local_1ac); } *laserRefPtr = (EntityPtr)local_1b8.x; std::multiset::insert(laserRefPtr); uVar9 = Random(); npc->_i1 = (uVar9 & 1) + 2; goto LAB_00498e97; } bVar21 = iVar12 == 4; if (3 < iVar12) goto LAB_00497e0d; if (npc->_entityRef == (EntityPtr)0x0) { npc->_i1 = 4; goto LAB_00498e97; } if (iVar12 == 3) { local_1a4.x = 2.0; } else { local_1a4.x = -2.0; } pEVar14 = (Entity_NPC *) __RTDynamicCast(npc->_entityRef,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); fVar22 = (pEVar14->_pathfinder)._movementTarget.y; if (fVar22 < 0.0) { fVar22 = fVar22 + 360.0; } fVar22 = local_1a4.x + fVar22; switch(local_1b8.x) { case 0.0: if (fVar22 < 210.0) { fVar23 = 150.0; LAB_00498820: if (fVar22 <= fVar23) { LAB_00498825: npc->_i1 = 3; } } else { npc->_i1 = 2; } break; case 1.4013e-45: if (fVar22 < 300.0) { fVar23 = 240.0; goto LAB_00498820; } npc->_i1 = 2; break; case 2.8026e-45: if ((30.0 <= fVar22) && (fVar22 < 180.0)) { npc->_i1 = 2; break; } if (330.0 < fVar22) break; if (180.0 < fVar22) goto LAB_00498825; goto LAB_00498838; case 4.2039e-45: if (fVar22 < 120.0) { fVar23 = 60.0; goto LAB_00498820; } npc->_i1 = 2; } if (180.0 < fVar22) { fVar22 = fVar22 - 360.0; } LAB_00498838: fVar22 = normalize_angle_degrees(fVar22); Entity_NPC::SetAimAngle(pEVar14,fVar22); LAB_00498e97: iVar12 = npc->_state; if ((((iVar12 != 10) && (iVar12 != 9)) && (iVar12 != 0xb)) && (iVar12 != 0xc)) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); (npc->_sprite)._flipX = (pEVar7->_pos).x - (npc->_pos).x < 0.0; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"ScareSFX"); manager = g_manager; if (bVar4 != 0) { local_1b8.x = 1.34525e-42; seed_fart_sound_override((int *)&local_1b8); SoundEffects::Play(&manager->_sfxManager,(int)local_1b8.x,1.0,2,0,1.0,0.0); } } npc->_friction = npc->_friction * 0.5; if (0 < npc->_i2) { npc->_i2 = npc->_i2 + -1; } return; } //@@ 00498f80 FUN_00498f80 void FUN_00498f80(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0xc); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0xc); return; } //@@ 00498fd0 std::deque::erase /* DB: deque of 8-byte elems range erase */ void std::deque::erase (undefined4 *param_1,undefined4 param_2,undefined4 param_3,uint param_4, undefined4 param_5,undefined4 param_6,uint param_7) { int iVar1; int iVar2; uint uVar3; undefined4 *in_ECX; uint uVar4; int iVar5; int *piVar6; uint uVar7; int local_c; uint local_8; if (in_ECX == (undefined4 *)0x0) { piVar6 = (int *)0x0; } else { piVar6 = (int *)*in_ECX; } uVar7 = in_ECX[3]; uVar4 = param_4 - uVar7; iVar5 = param_7 - param_4; local_8 = param_7; if (iVar5 == 0) { *param_1 = piVar6; param_1[2] = param_4; param_1[1] = 0; return; } uVar3 = in_ECX[4] + uVar7; if (uVar4 < uVar3 - param_7) { if (piVar6 == (int *)0x0) { local_c = 0; } else { local_c = *piVar6; } if (uVar7 != param_4) { do { param_4 = param_4 - 1; local_8 = local_8 - 1; iVar1 = *(int *)(*(int *)(local_c + 4) + (param_4 >> 1 & *(int *)(local_c + 8) - 1U) * 4); iVar2 = *(int *)(*(int *)(local_c + 4) + (local_8 >> 1 & *(int *)(local_c + 8) - 1U) * 4); *(undefined4 *)(iVar2 + (local_8 & 1) * 8) = *(undefined4 *)(iVar1 + (param_4 & 1) * 8); *(undefined4 *)(iVar2 + 4 + (local_8 & 1) * 8) = *(undefined4 *)(iVar1 + 4 + (param_4 & 1) * 8); } while (uVar7 != param_4); } do { piVar6 = in_ECX + 4; *piVar6 = *piVar6 + -1; if (*piVar6 == 0) { in_ECX[3] = 0; } else { in_ECX[3] = in_ECX[3] + 1; } iVar5 = iVar5 + -1; } while (iVar5 != 0); } else { if (piVar6 == (int *)0x0) { local_c = 0; } else { local_c = *piVar6; } if (param_7 != uVar3) { do { uVar7 = param_7 & 1; iVar1 = *(int *)(*(int *)(local_c + 4) + (param_7 >> 1 & *(int *)(local_c + 8) - 1U) * 4); iVar2 = *(int *)(*(int *)(local_c + 4) + (param_4 >> 1 & *(int *)(local_c + 8) - 1U) * 4); *(undefined4 *)(iVar2 + (param_4 & 1) * 8) = *(undefined4 *)(iVar1 + uVar7 * 8); param_7 = param_7 + 1; *(undefined4 *)(iVar2 + 4 + (param_4 & 1) * 8) = *(undefined4 *)(iVar1 + 4 + uVar7 * 8); param_4 = param_4 + 1; } while (param_7 != uVar3); } do { piVar6 = in_ECX + 4; *piVar6 = *piVar6 + -1; if (*piVar6 == 0) { in_ECX[3] = 0; } iVar5 = iVar5 + -1; } while (iVar5 != 0); } *param_1 = *in_ECX; param_1[2] = in_ECX[3] + uVar4; param_1[1] = 0; return; } //@@ 00499190 std::deque::push_back /* DB: 8-byte elements, 2 per block map growth prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall std::deque::push_back(void *this,Vector *value) { int iVar1; float fVar2; void *pvVar3; uint uVar4; uint uVar5; int local_8; uVar5 = *(uint *)((int)this + 0xc); if (((uVar5 & 1) == 0) && (*(uint *)((int)this + 8) <= *(int *)((int)this + 0x10) + 2U >> 1)) { deque::_Growmap(this); uVar5 = *(uint *)((int)this + 0xc); } uVar4 = *(int *)((int)this + 8) * 2; uVar5 = uVar4 - 1 & uVar5; *(uint *)((int)this + 0xc) = uVar5; if (uVar5 == 0) { uVar5 = uVar4; } uVar5 = uVar5 - 1; uVar4 = *(int *)((int)this + 8) - 1U & uVar5 >> 1; local_8 = *(int *)((int)this + 4); iVar1 = uVar4 * 4; if (*(int *)(local_8 + uVar4 * 4) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar1 + *(int *)((int)this + 4)) = pvVar3; local_8 = *(int *)((int)this + 4); } fVar2 = value->y; iVar1 = *(int *)(iVar1 + local_8); *(float *)(iVar1 + (uVar5 & 1) * 8) = value->x; *(float *)(iVar1 + 4 + (uVar5 & 1) * 8) = fVar2; *(int *)((int)this + 0x10) = *(int *)((int)this + 0x10) + 1; *(uint *)((int)this + 0xc) = uVar5; return; } //@@ 00499230 std::deque::front /* DB: deque index math */ int std::deque::front(void) { code *pcVar1; int *in_ECX; int iVar2; if (in_ECX[4] == 0) { FUN_00499550(); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } if ((int *)*in_ECX == (int *)0x0) { iVar2 = 0; } else { iVar2 = *(int *)*in_ECX; } return *(int *)(*(int *)(iVar2 + 4) + ((uint)in_ECX[3] >> 1 & *(int *)(iVar2 + 8) - 1U) * 4) + (in_ECX[3] & 1U) * 8; } //@@ 00499270 _range_to_span /* DB: ? ? builds {start,0,count} */ void _range_to_span(undefined4 *param_1) { int iVar1; int iVar2; undefined4 uVar3; undefined4 *in_ECX; iVar1 = in_ECX[4]; iVar2 = in_ECX[3]; uVar3 = *in_ECX; param_1[1] = 0; param_1[2] = iVar1 + iVar2; *param_1 = uVar3; return; } //@@ 00499290 std::vector::erase /* DB: ECX vector, args (out iterator, where): shifts each following 0x38-byte (14 dword) element down and shrinks end by 0x38; used while walking the Entity+0x8 pending damage list (float damage [0], flags [2]) in NpcAI::ENTITY_TUFF_TWINS and Entity_Player::Update; element matches DamageInfo 006a8190 DamageInfo::DamageInfo void std::vector::erase(int *param_1,int param_2) { undefined4 uVar1; int in_ECX; undefined4 *puVar2; undefined4 *puVar3; undefined4 *puVar4; undefined4 *puVar5; puVar3 = *(undefined4 **)(in_ECX + 4); puVar5 = (undefined4 *)(param_2 + 0x38); if (puVar5 != puVar3) { puVar2 = (undefined4 *)(param_2 + 0x2c); puVar4 = (undefined4 *)(param_2 + 100); do { puVar2[-0xb] = *puVar5; puVar5 = puVar5 + 0xe; uVar1 = puVar4[-8]; puVar2[-9] = puVar4[-9]; puVar2[-8] = uVar1; puVar2[-7] = puVar4[-7]; puVar2[-6] = puVar4[-6]; puVar2[-5] = puVar4[-5]; puVar2[-4] = puVar4[-4]; puVar2[-3] = puVar4[-3]; puVar2[-2] = puVar4[-2]; puVar2[-1] = puVar4[-1]; *puVar2 = *puVar4; puVar2[1] = puVar4[1]; puVar2[2] = puVar4[2]; puVar2 = puVar2 + 0xe; puVar4 = puVar4 + 0xe; } while (puVar5 != puVar3); puVar3 = *(undefined4 **)(in_ECX + 4); } *(undefined4 **)(in_ECX + 4) = puVar3 + -0xe; *param_1 = param_2; return; } //@@ 00499330 FUN_00499330 int FUN_00499330(void) { int *in_ECX; return (in_ECX[1] - *in_ECX) / 0x7c; } //@@ 00499350 SimpleString::operator= /* Library Function - Single Match public: char const * __thiscall SimpleString::operator=(char const *) Library: Visual Studio 2019 Release */ char * __thiscall SimpleString::operator=(SimpleString *this,char *param_1) { char cVar1; char *pcVar2; pcVar2 = param_1; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); pcVar2 = std::string::append((char *)this,(byte *)param_1,(int)pcVar2 - (int)(param_1 + 1)); return pcVar2; } //@@ 00499380 std::deque::_Tidy /* DB: clears elements (size 0x10 blocks), frees map */ void std::deque::_Tidy(void) { void *pvVar1; void *ptr; int in_ECX; uint size; int iVar2; iVar2 = *(int *)(in_ECX + 0x10); if (iVar2 != 0) { do { iVar2 = iVar2 + -1; *(int *)(in_ECX + 0x10) = iVar2; } while (iVar2 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; } iVar2 = *(int *)(in_ECX + 8); while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(*(int *)(in_ECX + 4) + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x10); } } pvVar1 = *(void **)(in_ECX + 4); if (pvVar1 != (void *)0x0) { size = *(int *)(in_ECX + 8) * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 00499410 std::deque::_Growmap /* DB: doubling map realloc with memmove (deque growth) */ void std::deque::_Growmap(void) { void *pvVar1; uint uVar2; void *_Dst; int in_ECX; uint uVar3; size_t sVar4; size_t sVar5; uint uVar6; uVar6 = *(uint *)(in_ECX + 8); uVar2 = 1; if (uVar6 != 0) { uVar2 = uVar6; } for (; (uVar3 = uVar2 - uVar6, uVar3 == 0 || (uVar2 < 8)); uVar2 = uVar2 * 2) { if (0xfffffff - uVar2 < uVar2) { FUN_0040cad0(); LAB_00499542: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar6 = *(uint *)(in_ECX + 0xc) >> 1; if (uVar2 < 0x40000000) { _Dst = _Allocate(uVar2 * 4); sVar5 = uVar6 * 4; pvVar1 = (void *)(*(int *)(in_ECX + 4) + sVar5); sVar4 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove((void *)((int)_Dst + sVar5),pvVar1,sVar4); pvVar1 = (void *)(sVar4 + (int)((int)_Dst + sVar5)); if (uVar3 < uVar6) { sVar4 = uVar3 * 4; memmove(pvVar1,*(void **)(in_ECX + 4),sVar4); pvVar1 = (void *)(sVar4 + *(int *)(in_ECX + 4)); sVar5 = (*(int *)(in_ECX + 4) - (int)pvVar1) + sVar5; memmove(_Dst,pvVar1,sVar5); memset((void *)(sVar5 + (int)_Dst),0,sVar4); } else { memmove(pvVar1,*(void **)(in_ECX + 4),uVar6 * 4); memset((void *)((int)pvVar1 + sVar5),0,(uVar3 - uVar6) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar3; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_00499542; } //@@ 00499550 FUN_00499550 void FUN_00499550(void) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("invalid deque subscript"); } //@@ 00499560 FUN_00499560 void FUN_00499560(void) { int *piVar1; int in_ECX; piVar1 = (int *)(in_ECX + 0x10); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; return; } *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 1; return; } //@@ 00499580 std::string::replace /* DB: (pos, count, const char*, count2) with _Xlen/memmove; NpcAI::ENTITY_PIN replaces "Bosses/AfterbirthPlus/DeliriumForms" prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall std::string::replace(char *this,uint position,uint count,byte *text,uint textLength) { void *_Src; uint uVar1; size_t _Size; char *pcVar2; uint uVar3; byte *_Dst; uint uVar4; void *_Dst_00; uint uVar5; uint uVar6; byte *_Src_00; size_t _Size_00; void *pvVar7; uVar5 = position; uVar6 = *(uint *)(this + 0x10); if (uVar6 < position) { /* WARNING: Subroutine does not return */ FUN_00499950(); } uVar1 = uVar6 - position; if (uVar1 < count) { count = uVar1; } if (count == textLength) { pcVar2 = this; if (0xf < *(uint *)(this + 0x14)) { pcVar2 = *(char **)this; } memmove(pcVar2 + position,text,textLength); return this; } _Size = (uVar1 - count) + 1; if (textLength < count) { *(uint *)(this + 0x10) = (uVar6 - count) + textLength; pcVar2 = this; if (0xf < *(uint *)(this + 0x14)) { pcVar2 = *(char **)this; } pcVar2 = pcVar2 + position; memmove(pcVar2,text,textLength); memmove(pcVar2 + textLength,pcVar2 + count,_Size); return this; } uVar3 = textLength - count; uVar1 = *(uint *)(this + 0x14); if (uVar3 <= uVar1 - uVar6) { *(uint *)(this + 0x10) = uVar3 + uVar6; position = (uint)this; if (0xf < uVar1) { position = *(uint *)this; } _Dst = (byte *)(position + uVar5); _Src_00 = _Dst + count; if ((_Dst < text + textLength) && (text <= (byte *)(position + uVar6))) { if (text < _Src_00) { _Size_00 = (int)_Src_00 - (int)text; } else { _Size_00 = 0; } } else { _Size_00 = textLength; } memmove(_Src_00 + uVar3,_Src_00,_Size); memmove(_Dst,text,_Size_00); memcpy(_Dst + _Size_00,text + uVar3 + _Size_00,textLength - _Size_00); return this; } if (0x7fffffff - uVar6 < uVar3) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = uVar6 + uVar3 | 0xf; if (uVar5 < 0x80000000) { if (0x7fffffff - (uVar1 >> 1) < uVar1) { uVar5 = 0x7fffffff; } else { uVar4 = uVar1 + (uVar1 >> 1); if (uVar5 < uVar4) { uVar5 = uVar4; } } } else { uVar5 = 0x7fffffff; } _Dst_00 = _Allocate(uVar5 + 1); *(uint *)(this + 0x10) = uVar6 + uVar3; *(uint *)(this + 0x14) = uVar5; pvVar7 = (void *)((int)_Dst_00 + position); if (uVar1 < 0x10) { memcpy(_Dst_00,this,position); memcpy(pvVar7,text,textLength); memcpy((void *)((int)pvVar7 + textLength),this + position + count,_Size); *(void **)this = _Dst_00; return this; } _Src = *(void **)this; memcpy(_Dst_00,_Src,position); memcpy(pvVar7,text,textLength); memcpy((void *)((int)pvVar7 + textLength),(void *)((int)_Src + count + position),_Size); uVar6 = uVar1 + 1; pvVar7 = _Src; if (0xfff < uVar6) { pvVar7 = *(void **)((int)_Src + -4); uVar6 = uVar1 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar6); *(void **)this = _Dst_00; return this; } //@@ 004997f0 std::string::append /* DB: MSVC basic_string append(ptr,len) prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall std::string::append(char *this,byte *text,uint length) { uint uVar1; size_t _Size; void *_Src; char *pcVar2; uint uVar3; void *_Dst; uint uVar4; void *pvVar5; uVar1 = *(uint *)(this + 0x14); _Size = *(size_t *)(this + 0x10); if (length <= uVar1 - _Size) { *(size_t *)(this + 0x10) = _Size + length; pcVar2 = this; if (0xf < uVar1) { pcVar2 = *(char **)this; } memmove(pcVar2 + _Size,text,length); (pcVar2 + _Size)[length] = '\0'; return this; } if (0x7fffffff - _Size < length) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar4 = _Size + length | 0xf; if (uVar4 < 0x80000000) { if (0x7fffffff - (uVar1 >> 1) < uVar1) { uVar4 = 0x7fffffff; } else { uVar3 = (uVar1 >> 1) + uVar1; if (uVar4 < uVar3) { uVar4 = uVar3; } } } else { uVar4 = 0x7fffffff; } _Dst = _Allocate(uVar4 + 1); *(size_t *)(this + 0x10) = _Size + length; *(uint *)(this + 0x14) = uVar4; pvVar5 = (void *)((int)_Dst + _Size); if (uVar1 < 0x10) { memcpy(_Dst,this,_Size); memcpy(pvVar5,text,length); *(undefined1 *)((int)pvVar5 + length) = 0; *(void **)this = _Dst; return this; } _Src = *(void **)this; memcpy(_Dst,_Src,_Size); memcpy(pvVar5,text,length); uVar4 = uVar1 + 1; *(undefined1 *)((int)pvVar5 + length) = 0; pvVar5 = _Src; if (0xfff < uVar4) { pvVar5 = *(void **)((int)_Src + -4); uVar4 = uVar1 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar4); *(void **)this = _Dst; return this; } //@@ 00499950 FUN_00499950 void FUN_00499950(void) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("invalid string position"); } //@@ 00499960 EntityRef::operator_ /* DB: ? copies 10 dwords; used by TakeDamage/AddBleeding/AddBaited prototype: db/protos.zhl, confirmed by RET 4 */ EntityRef * __thiscall EntityRef::operator_(EntityRef *this,EntityRef *other) { this->_type = other->_type; this->_variant = other->_variant; this->_spawnerType = other->_spawnerType; this->_spawnerVariant = other->_spawnerVariant; (this->_position).x = (other->_position).x; (this->_position).y = (other->_position).y; (this->_velocity).x = (other->_velocity).x; (this->_velocity).y = (other->_velocity).y; this->_flags = other->_flags; this->_entity = other->_entity; return this; } //@@ 004999b0 FUN_004999b0 void FUN_004999b0(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0xc); } return; } //@@ 004999d0 FUN_004999d0 undefined4 FUN_004999d0(undefined4 param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; int in_EDX; if (in_EDX == 0) { return *in_ECX; } if (in_EDX == 1) { return *(undefined4 *)*in_ECX; } FUN_004999d0(param_1); uVar1 = FUN_004999d0(param_1); uVar2 = NpcHelper::chub_nearest_segment(uVar1,param_1); *in_ECX = uVar2; return uVar1; } //@@ 00499a50 NpcHelper::chub_nearest_segment /* DB: ? this = array of 3 segment entities, arg = a segment: returns the other segment closest by position (0x33c); called from NpcAI::ENTITY_CHUB and 0x4999d0 */ int * NpcHelper::chub_nearest_segment(int *param_1,int param_2) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 *puVar4; int *in_ECX; int iVar5; int *in_EDX; int *piVar6; int *piVar7; float fVar8; float fVar9; float fVar10; float fVar11; int *local_8; iVar5 = in_EDX[2]; local_8 = in_EDX; piVar7 = in_EDX; piVar6 = in_ECX; if (iVar5 != param_2) { iVar1 = in_ECX[2]; if (iVar1 != param_2) { fVar9 = *(float *)(param_2 + 0x33c) - *(float *)(iVar5 + 0x33c); fVar11 = *(float *)(param_2 + 0x33c) - *(float *)(iVar1 + 0x33c); fVar8 = *(float *)(param_2 + 0x340) - *(float *)(iVar5 + 0x340); fVar10 = *(float *)(param_2 + 0x340) - *(float *)(iVar1 + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (fVar8 < fVar9) goto LAB_00499ba3; iVar5 = in_EDX[2]; } do { do { piVar6 = (int *)*piVar6; if (piVar6 == in_EDX) { return in_ECX; } iVar1 = piVar6[2]; } while (iVar1 == param_2); fVar9 = *(float *)(param_2 + 0x33c) - *(float *)(iVar5 + 0x33c); fVar11 = *(float *)(param_2 + 0x33c) - *(float *)(iVar1 + 0x33c); fVar8 = *(float *)(param_2 + 0x340) - *(float *)(iVar5 + 0x340); fVar10 = *(float *)(param_2 + 0x340) - *(float *)(iVar1 + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); iVar5 = in_EDX[2]; local_8 = in_ECX; } while (fVar9 <= fVar8); } LAB_00499ba3: in_EDX = (int *)*in_EDX; if (in_EDX != param_1) goto code_r0x00499bae; goto LAB_00499c40; code_r0x00499bae: iVar5 = in_EDX[2]; if (iVar5 != param_2) { iVar1 = piVar6[2]; if (iVar1 != param_2) { fVar9 = *(float *)(param_2 + 0x33c) - *(float *)(iVar5 + 0x33c); fVar11 = *(float *)(param_2 + 0x33c) - *(float *)(iVar1 + 0x33c); fVar8 = *(float *)(param_2 + 0x340) - *(float *)(iVar5 + 0x340); fVar10 = *(float *)(param_2 + 0x340) - *(float *)(iVar1 + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (fVar8 < fVar9) goto LAB_00499ba3; } LAB_00499c40: puVar2 = (undefined4 *)piVar7[1]; *puVar2 = in_EDX; puVar3 = (undefined4 *)in_EDX[1]; *puVar3 = piVar6; puVar4 = (undefined4 *)piVar6[1]; *puVar4 = piVar7; piVar6[1] = (int)puVar3; in_EDX[1] = (int)puVar2; piVar7[1] = (int)puVar4; if (in_EDX == param_1) { return local_8; } do { do { piVar6 = (int *)*piVar6; if (piVar6 == in_EDX) { return local_8; } iVar5 = in_EDX[2]; piVar7 = in_EDX; if (iVar5 == param_2) goto LAB_00499ba3; iVar1 = piVar6[2]; } while (iVar1 == param_2); fVar9 = *(float *)(param_2 + 0x33c) - *(float *)(iVar5 + 0x33c); fVar11 = *(float *)(param_2 + 0x33c) - *(float *)(iVar1 + 0x33c); fVar8 = *(float *)(param_2 + 0x340) - *(float *)(iVar5 + 0x340); fVar10 = *(float *)(param_2 + 0x340) - *(float *)(iVar1 + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); } while (fVar9 <= fVar8); } goto LAB_00499ba3; } //@@ 00499d20 fmodf /* DB: src/anm2 decompile labels (fmodf) prototype: db/protos.zhl */ float __cdecl fmodf(float x,float y) { float10 fVar1; fVar1 = (float10)_CIfmod((double)y); return (float)fVar1; } //@@ 00499d60 atan2f /* DB: float wrapper around _CIatan2 prototype: db/protos.zhl */ float __cdecl atan2f(float y,float x) { float10 fVar1; fVar1 = (float10)_CIatan2((double)x); return (float)fVar1; } //@@ 00499da0 Entity::ToPlayer /* DB: returns this if type==1 else null prototype: db/protos.zhl */ Entity_Player * __thiscall Entity::ToPlayer(Entity *this) { if ((this == (Entity *)0x0) || (this->_type != 1)) { return (Entity_Player *)0x0; } return (Entity_Player *)this; } //@@ 00499db0 FUN_00499db0 undefined4 FUN_00499db0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x3c); } //@@ 00499dc0 PathFinder::SetCanCrushRocks /* ZHL [lua] Lua binding PathFinder:SetCanCrushRocks */ void PathFinder::SetCanCrushRocks(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x738) = param_1; return; } //@@ 00499dd0 Entity_Player::GetNumCoins /* ZHL [lua] Lua binding EntityPlayer:GetNumCoins */ int __thiscall Entity_Player::GetNumCoins(Entity_Player *this) { return this->_numCoins; } //@@ 00499de0 NpcAI::ENTITY_BUMBINO /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 916 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BUMBINO(Entity_NPC *npc) { ANM2 *pAVar1; Entity_NPC *pEVar2; char cVar3; byte bVar4; EntityPtr EVar5; void *pvVar6; EntityPtr *pEVar7; float *pfVar8; undefined4 *playerSlot; undefined4 uVar9; ColorMod *color; uint rngResult; Vector *pVVar10; uint uVar11; GridEntity *pit; Entity *tmpEntity; byte *animNameCursor; int iVar12; undefined1 *puVar13; char *pcVar14; int iVar15; EntityPtr *coinDropRoll; code *pcVar16; PlayerManager *playerManager; bool bVar17; Entity_Player *pEVar18; float normDirX; float fVar19; undefined1 auVar20 [16]; Room *pRVar21; float fVar22; float fVar23; undefined8 uVar24; byte isAllowPits; byte isAvoidDoors; EntityRef selfRef; EntityRef local_300; EntityList_EL hitboxEntities; Vector local_2c8; Vector local_2c0; Vector local_2b8; Vector local_2b0; Vector local_2a8; uint isWallImpact; Vector local_29c; Vector local_294; int elapsedFrames; Entity_NPC *self; Vector local_284; undefined1 local_27c [12]; float local_270; Room *room; Vector local_268; Vector local_260; EntityPtr local_258; Entity_Player *local_254; Room *local_250; char local_249; ProjectileParams wallImpactParams; ProjectileParams slamParams; ProjectileParams dizzyRainParams; undefined1 local_50 [8]; float fStack_48; float fStack_44; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; EntityPtr candidateCoin; Manager *manager; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af2efb; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; isWallImpact = isWallImpact & 0xffffff00; local_249 = '\0'; room = g_game->_room; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; if (npc->_collidesWithGrid == 0) { npc->_aiCounter = 0; } else { npc->_aiCounter = npc->_aiCounter + 1; } manager = g_manager; self = npc; puVar13 = local_50 + 0x4c; if (npc->_dead != 0) { local_254 = (Entity_Player *)0x2cf; seed_fart_sound_override((int *)&local_254); SoundEffects::Play(&manager->_sfxManager,(int)local_254,1.0,2,0,1.0,0.0); puVar13 = puStack_20; } puStack_20 = puVar13; iVar15 = elapsedFrames; auVar20 = ZEXT816(0x3f800000); switch(npc->_state) { case 0: npc->_state = 3; uVar11 = Random(); npc->_i2 = 0; npc->_aiCounter = 0; npc->_i1 = uVar11 % 0x1e + 0x1e; (npc->_pathfinder)._canCrushRocks = 1; break; default: goto switchD_00499f10_caseD_1; case 3: npc->_friction = npc->_friction * 0.8; ANM2::Play(&npc->_sprite,s_Idle2,0); npc->_i1 = npc->_i1 - iVar15; if (npc->_i1 < 1) { npc->_state = 4; uVar11 = Random(); npc->_stateFrame = 0; npc->_i1 = uVar11 % 0x3c + 0x3c; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_258 = (EntityPtr)(tmpEntity->_velocity).x; fVar22 = (npc->_pos).x - (tmpEntity->_pos).x; fVar19 = (npc->_pos).y - (tmpEntity->_pos).y; fVar19 = sqrtf(fVar19 * fVar19 + fVar22 * fVar22); local_284.x = (float)local_258 * fVar19 * 0.1 + (tmpEntity->_pos).x; local_284.y = (tmpEntity->_velocity).y * fVar19 * 0.1 + (tmpEntity->_pos).y; local_268.x = local_284.x - (npc->_pos).x; local_268.y = local_284.y - (npc->_pos).y; local_258 = (EntityPtr)local_268.x; Vector::Normalized(&local_268,(Vector *)(local_27c + 8)); if ((((0.30710676 < local_270) && (local_270 < 0.90710676)) && (bVar4 = Room::CheckLine(room,&npc->_pos,&local_284,1,0,0,0,(Vector *)0x0), bVar4 != 0)) && (uVar11 = Random(), uVar11 % 10 == 0)) { ANM2::Play(&npc->_sprite,(byte *)"ButtBomb",0); npc->_state = 0xb; (npc->_sprite)._flipX = (float)local_258 < 0.0; } } break; case 4: EVar5 = npc->_entityRef; if ((EVar5 == (EntityPtr)0x0) || (((*(char *)((int)EVar5 + 0x173) == '\0' && (*(int *)((int)EVar5 + 0x28) == 5)) && (*(int *)((int)EVar5 + 0x2c) == 0x14)))) { bVar4 = Entity::IsFrame((Entity *)npc,3,0); if ((bVar4 != 0) && ((EVar5 == (EntityPtr)0x0 || (uVar11 = Random(), (uVar11 & 3) == 0)))) goto LAB_0049a295; } else { local_250 = (Room *)&npc->_entityRef; std::multiset::erase(&local_250); npc->_entityRef = (EntityPtr)0x0; LAB_0049a295: EntityList::QuerySublist(&room->_entityList,(EntityList_EL *)local_27c,5,0x14,-1,0,0); local_14 = 0; EVar5 = (EntityPtr)0x0; local_258 = (EntityPtr)0x0; local_254 = (Entity_Player *)0x47c35000; local_260.y = 0.0; if (local_270 != 0.0) { fVar19 = local_270; pvVar6 = (void *)local_27c._4_4_; do { candidateCoin = *(EntityPtr *)((int)pvVar6 + (int)local_260.y * 4); if (candidateCoin != (EntityPtr)0x0) { if (*(int *)((int)candidateCoin + 0x28) == 5) { if (*(char *)((int)candidateCoin + 0x173) == '\0') { if (*(int *)((int)candidateCoin + 0x534) == 0) { local_268.x = *(float *)((int)candidateCoin + 0x33c); local_268.y = *(float *)((int)candidateCoin + 0x340); bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&local_268,0); fVar19 = local_270; pvVar6 = (void *)local_27c._4_4_; if ((bVar4 == 0) || (fVar22 = (npc->_pos).x - *(float *)((int)candidateCoin + 0x33c), fVar23 = (npc->_pos).y - *(float *)((int)candidateCoin + 0x340), pEVar18 = (Entity_Player *)(fVar23 * fVar23 + fVar22 * fVar22), (float)local_254 <= (float)pEVar18)) { EVar5 = local_258; } else { EVar5 = candidateCoin; local_258 = candidateCoin; local_254 = pEVar18; } } } } } local_260.y = (float)((int)local_260.y + 1); } while ((uint)local_260.y < (uint)fVar19); if (EVar5 != (EntityPtr)0x0) { pEVar7 = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_250 = (Room *)pEVar7; std::multiset::erase(&local_250); EVar5 = local_258; } *pEVar7 = EVar5; std::multiset::insert(pEVar7); } } local_14 = 0xffffffff; if (local_27c[0] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_27c._4_4_,0); local_14 = 0xffffffff; } } ANM2::Play(&npc->_sprite,s_Walk,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1e5a8), bVar4 == 0)) { iVar15 = npc->_stateFrame; if (0 < iVar15) goto LAB_0049a485; } else { Entity_NPC::PlaySound(npc,0x45,1.0,2,0,1.0); iVar15 = 3; LAB_0049a485: npc->_stateFrame = iVar15 - elapsedFrames; npc->_friction = npc->_friction * 0.4; } EVar5 = npc->_entityRef; if (EVar5 == (EntityPtr)0x0) { pVVar10 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_27c + 8),0.0); local_284.x = pVVar10->x; local_284.y = pVVar10->y; local_260.y = local_284.x; local_250 = (Room *)local_284.y; pVVar10 = Room::GetCenterPos((Vector *)(local_27c + 8)); fVar19 = (npc->_pos).y; if (pVVar10->y <= fVar19 && fVar19 != pVVar10->y) { local_268.x = 0.0; local_268.y = (float)&DAT_bf800000; pVVar10 = Room::GetLaserTarget(room,(Vector *)(local_27c + 8),&local_284,&local_268); local_254 = (Entity_Player *)(pVVar10->y - (float)local_250); local_258 = (EntityPtr)(pVVar10->x - local_260.y); fVar19 = sqrtf((float)local_254 * (float)local_254 + (float)local_258 * (float)local_258); if ((fVar19 <= 80.0) || (fVar19 <= 0.0)) { EVar5 = local_258; pEVar18 = local_254; } else { EVar5 = (EntityPtr)((float)local_258 * (80.0 / fVar19)); pEVar18 = (Entity_Player *)((float)local_254 * (80.0 / fVar19)); } local_284.x = local_260.y + (float)EVar5; local_284.y = (float)local_250 + (float)pEVar18; } } else { local_284.x = *(float *)((int)EVar5 + 0x33c); local_284.y = *(float *)((int)EVar5 + 0x340); } if (npc->_entityRef == (EntityPtr)0x0) { fVar19 = 0.8; } else { fVar19 = 0.95; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_284,fVar19,900,1); iVar12 = npc->_i1 - elapsedFrames; fVar19 = (npc->_pos).x; fVar22 = (npc->_pos).x; npc->_i1 = iVar12; iVar15 = npc->_aiCounter; (npc->_sprite)._flipX = fVar22 <= local_284.x && local_284.x != fVar19; if ((iVar15 < 9) || (0 < npc->_projectileCooldown)) { if (npc->_entityRef == (EntityPtr)0x0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar19 = (npc->_pos).y - (tmpEntity->_pos).y; fVar22 = (npc->_pos).x - (tmpEntity->_pos).x; fVar19 = sqrtf(fVar19 * fVar19 + fVar22 * fVar22); local_254 = (Entity_Player *)(fVar19 * (tmpEntity->_velocity).x * 0.1 + (tmpEntity->_pos).x) ; local_250 = (Room *)(fVar19 * (tmpEntity->_velocity).y * 0.1 + (tmpEntity->_pos).y); uVar11 = Random(); if (((((uVar11 & 3) == 0) && (ABS((float)local_250 - (npc->_pos).y) <= 40.0)) && (ABS((float)local_254 - (npc->_pos).x) <= 200.0)) && ((npc->_projectileCooldown < 1 || (uVar11 = Random(), uVar11 % 0x32 == 0)))) { npc->_stateFrame = 1; goto LAB_0049a69d; } if ((ABS((float)local_254 - (npc->_pos).x) <= 40.0) && (uVar11 = Random(), uVar11 % 6 == 0)) { pcVar14 = "UpCharge"; npc->_state = 10; fVar19 = (float)local_250 - (npc->_pos).y; (npc->_v1).x = (float)local_254 - (npc->_pos).x; (npc->_v1).y = fVar19; if (0.0 <= fVar19) { pcVar14 = "DownCharge"; } ANM2::Play(&npc->_sprite,(byte *)pcVar14,0); npc->_stateFrame = 0; } } else { if (iVar12 < 0xf) { iVar12 = 0xf; } npc->_i1 = iVar12; } } else { npc->_stateFrame = -1; LAB_0049a69d: (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; npc->_state = 8; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Swipe",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } manager = g_manager; local_250 = (Room *)0x2d3; seed_fart_sound_override((int *)&local_250); SoundEffects::Play(&manager->_sfxManager,(int)local_250,1.0,2,0,1.0,0.0); } if (npc->_i1 < 1) { LAB_0049a8fb: npc->_state = 3; uVar11 = Random(); npc->_i1 = uVar11 % 0x14 + 10; } break; case 5: npc->_friction = npc->_friction * 0.7; bVar4 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (npc->_stateFrame == 0) { if (bVar4 != 0) { ANM2::Play(&npc->_sprite,(byte *)"Dizzy",0); play_sound_with_fart_seed(0x2d0,1.0,2,0,1.0); } if (0 < elapsedFrames) { iVar15 = elapsedFrames; do { npc->_i1 = npc->_i1 + -1; if ((10 < npc->_i1) && ((npc->_i1 & 1U) == 0)) { uVar11 = Random(); if (uVar11 % 5 == 0) { pVVar10 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_27c + 8),0.0); } else { isAvoidDoors = 0; isAllowPits = 0; bVar4 = 0; fVar19 = 64.0; pVVar10 = Room::GetRandomPosition(room,&local_29c,10.0); pVVar10 = Room::FindFreePickupSpawnPosition (room,&local_2c8,pVVar10,fVar19,bVar4,isAllowPits,isAvoidDoors); } local_2c0.x = pVVar10->x; local_2c0.y = pVVar10->y; ProjectileParams::ProjectileParams(&dizzyRainParams); uVar11 = Random(); dizzyRainParams.HeightModifier = -400.0; dizzyRainParams.FallingAccelModifier = 2.0; dizzyRainParams.Scale = 1.2 - (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 0.40000004; uVar11 = Random(); dizzyRainParams.Variant = 9; dizzyRainParams.FallingSpeedModifier = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 0.0; uVar11 = Random(); fVar19 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_250 = (Room *)(fVar19 + fVar19); uVar11 = Random(); local_260.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10; fVar19 = cos((float)local_250); local_268.x = fVar19 * local_260.y; fVar19 = sin((float)local_250); local_268.y = fVar19 * local_260.y; Entity_NPC::FireProjectiles(npc,&local_2c0,&local_268,0,&dizzyRainParams); } iVar15 = iVar15 + -1; } while (iVar15 != 0); } if (npc->_i1 < 0) { ANM2::Play(&npc->_sprite,(byte *)"ShakeOff",0); play_sound_with_fart_seed(0x2d6,1.0,2,0,1.0); npc->_stateFrame = npc->_stateFrame + 1; } } else if (bVar4 != 0) { play_sound_with_fart_seed(0x2d2,auVar20._0_4_,2,0,1.0); goto LAB_0049a8fb; } break; case 8: npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar4 != 0)) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_260.y = (npc->_pos).x; local_250 = (Room *)(tmpEntity->_pos).y; fVar22 = local_260.y - (tmpEntity->_pos).x; fVar19 = (npc->_pos).y - (float)local_250; fVar19 = sqrtf(fVar19 * fVar19 + fVar22 * fVar22); if (fVar19 <= 0.001) { fVar19 = 0.0; } else { fVar19 = ((float)local_250 - (npc->_pos).y) / fVar19; } fVar19 = fVar19 * 4.0; (npc->_v1).x = -12.0; if (fVar19 <= -4.0) { fVar19 = -4.0; } if (4.0 <= fVar19) { fVar19 = 4.0; } (npc->_v1).y = fVar19; fVar19 = -12.0; if ((npc->_sprite)._flipX != 0) { (npc->_v1).x = 12.0; fVar19 = 12.0; } if (npc->_stateFrame == 0) { fVar22 = ((tmpEntity->_pos).x - local_260.y) / 20.0; if (0.0 <= fVar19) { if (fVar22 <= 4.0) { fVar22 = 4.0; } if (12.0 <= fVar22) { fVar22 = 12.0; } } else { if (fVar22 <= -12.0) { fVar22 = -12.0; } if (-4.0 <= fVar22) { fVar22 = -4.0; } } (npc->_v1).x = fVar22; } } fVar19 = 2.0; bVar4 = Vector::operator_ne(&npc->_v1,&g_vectorZero); if (bVar4 != 0) { iVar15 = Entity::GetIntervalTicks((Entity *)npc,fVar19,0.0); if (iVar15 != 0) { uVar11 = Random(); local_250 = (Room *)((npc->_velocity).x * 0.2); local_260.y = (npc->_velocity).y * 0.2; pVVar10 = MusicManager::RandomVector((Vector *)(local_27c + 8)); local_268.x = (float)local_250 + pVVar10->x + pVVar10->x; local_268.y = local_260.y + pVVar10->y + pVVar10->y; tmpEntity = Game::Spawn(g_game,1000,0x3b,&npc->_pos,&local_268,(Entity *)npc,0,uVar11); uVar11 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar11 = Random(); iVar15 = uVar11 % 0xf + 0xf; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar15; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar15; uVar24 = Color::Color(0x3f400000); (*(code *)((ulonglong)uVar24 >> 0x20))((int)uVar24,0xffffffff,0xff,0,1); tmpEntity->_renderDepthOffset = -5.0; } pVVar10 = &npc->_v1; Entity::AddVelocity_divided((Entity *)npc,pVVar10,0); fVar19 = Math::timescale_factor(0.75,npc->_speedMultiplier); fVar22 = fVar19 * pVVar10->x; (npc->_v1).y = fVar19 * (npc->_v1).y; pVVar10->x = fVar22; if (ABS(fVar22) < 0.1) { pVVar10->x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; } if ((npc->_collidesWithGrid != 0) && (fVar19 = (npc->_gridCollisionVelocity).y, fVar22 = (npc->_gridCollisionVelocity).x, fVar19 = sqrtf(fVar22 * fVar22 + fVar19 * fVar19), 10.0 < fVar19)) { pVVar10 = Vector::Normalized(&npc->_gridCollisionVelocity,(Vector *)(local_27c + 8)); isWallImpact = isWallImpact & 0xff; if (0.3 < pVVar10->y * (npc->_gridCollisionNormal).y + pVVar10->x * (npc->_gridCollisionNormal).x) { isWallImpact = 1; } } local_249 = '\x01'; } Entity::GetNullCapsule((Entity *)npc,(Capsule *)&local_300,(byte *)"Hitbox"); if (0.0 < (float)local_300._flags) { if (((uint)g_game->_debugFlags >> 5 & 1) != 0) { pvVar6 = Entity::GetDebugShape((Entity *)npc,1); *(undefined4 *)((int)pvVar6 + 4) = 1; push_shape_points(pvVar6,(Capsule *)&local_300); } EntityList::QueryRadius (&room->_entityList,&hitboxEntities,(Vector *)&local_300, (float)local_300._entity + (float)local_300._flags,0xffffffff); local_14 = 2; local_258 = (EntityPtr)0x0; if (hitboxEntities._size != 0) { do { pEVar18 = *(Entity_Player **)((int)hitboxEntities._data + (int)local_258 * 4); local_254 = pEVar18; if (((pEVar18->_entityCollisionClass != 0) && (pEVar18->_entityGridCollisionClass != 4)) && (pEVar18 != (Entity_Player *)npc)) { Entity::GetCollisionCapsule((Entity *)pEVar18,local_50 + 4,&g_vectorZero); local_2c8.y = 0.0; local_2c8.x = 0.0; bVar4 = Capsule::Collide((Capsule *)&local_300,(Capsule *)(local_50 + 4),&local_2c8); if (bVar4 != 0) { local_2b8.y = (pEVar18->_pos).x - (((Entity_Player *)npc)->_pos).x; local_2a8.y = (pEVar18->_pos).y - (((Entity_Player *)npc)->_pos).y; local_260.y = local_2a8.y; local_250 = (Room *)local_2b8.y; local_294.y = sqrtf(local_2b8.y * local_2b8.y + local_2a8.y * local_2a8.y); if (local_294.y <= 0.0) { fVar19 = local_2a8.y; pRVar21 = (Room *)local_2b8.y; } else { fVar19 = local_260.y * (1.0 / local_294.y); pRVar21 = (Room *)((float)local_250 * (1.0 / local_294.y)); } (pEVar18->_velocity).x = (float)pRVar21 * 10.0 + (pEVar18->_velocity).x; (pEVar18->_velocity).y = fVar19 * 10.0 + (pEVar18->_velocity).y; if ((pEVar18->_type == 1) || (pEVar18->_type == 3)) { pcVar16 = *(code **)(*(int *)pEVar18 + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); uVar9 = 0x40000000; } else { pcVar16 = *(code **)(*(int *)pEVar18 + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); uVar9 = 0x420c0000; } (*pcVar16)(uVar9,0,0,local_50 + 4,0x1e); pEVar18 = local_254; if (((local_254->_type == 1) && (local_254->_variant == 0)) && ((local_254->_isCoopGhost == 0 && ((bVar4 = Entity_Player::HasInvincibility(local_254,0,(EntityRef *)0x0), bVar4 == 0 && (0 < pEVar18->_numCoins)))))) { Entity_Player::AddCoins(pEVar18,-1); uVar11 = Random(); coinDropRoll = (EntityPtr *)(uVar11 % 3 + 1); pEVar7 = (EntityPtr *)pEVar18->_numCoins; if ((int)coinDropRoll < pEVar18->_numCoins) { pEVar7 = coinDropRoll; } local_268.y = (float)pEVar7; if (0 < (int)pEVar7) { do { local_284.y = (float)Random(); local_2b0.y = local_260.y; normDirX = (float)local_250; if (0.0 < local_294.y) { normDirX = (float)local_250 * (1.0 / local_294.y); local_2b0.y = local_260.y * (1.0 / local_294.y); } local_2c0.y = normDirX * 3.0; local_2b0.y = local_2b0.y * 3.0; uVar11 = Random(); local_2a8.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2a8.y = local_2a8.y + local_2a8.y; local_254 = (Entity_Player *)sin(local_2a8.y); uVar11 = Random(); local_2b8.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 2.0; fVar19 = cos(local_2a8.y); local_27c._8_4_ = (pEVar18->_pos).x; local_270 = (pEVar18->_pos).y; local_29c.x = fVar19 * local_2b8.y + local_2c0.y; local_29c.y = (float)local_254 * local_2b8.y + local_2b0.y; Game::Spawn(g_game,5,0x14,(Vector *)(local_27c + 8),&local_29c,(Entity *)0x0,1, (uint)local_284.y); pEVar7 = (EntityPtr *)&pEVar7[-1].field_0x3; } while (pEVar7 != (EntityPtr *)0x0); npc = self; } Entity_Player::AddCoins(pEVar18,-(int)local_268.y); } } } local_258 = (EntityPtr)((int)local_258 + 1); } while ((uint)local_258 < (uint)hitboxEntities._size); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&hitboxEntities); } pAVar1 = &((Entity_Player *)npc)->_sprite; if ((0 < *(int *)&((Entity_Player *)npc)->_isControlsEnabled) && (bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar1,"Sound"), bVar4 != 0)) { bVar4 = (((Entity_Player *)npc)->_sprite)._flipX; *(int *)&((Entity_Player *)npc)->_isControlsEnabled = *(int *)&((Entity_Player *)npc)->_isControlsEnabled + -1; (((Entity_Player *)npc)->_sprite)._flipX = bVar4 == 0; ANM2::Play(pAVar1,(byte *)"Swipe",1); play_sound_with_fart_seed(0x2d3,1.0,2,0,1.0); Sprite::SetFrame_1((Sprite *)pAVar1,7); } if (((((Entity_Player *)npc)->_sprite)._animState._animData == (void *)0x0) || ((((Entity_Player *)npc)->_sprite)._animState._isPlaying == 0)) { if (*(int *)&((Entity_Player *)npc)->_isControlsEnabled < 0) { ((Entity_Player *)npc)->_chargeBarSprites[3]._color._offset[2] = 4.2039e-45; pAVar1 = ((Entity_Player *)npc)->_chargeBarSprites; pAVar1[4]._animDefaultName._buf[0] = '\x01'; pAVar1[4]._animDefaultName._buf[1] = '\0'; pAVar1[4]._animDefaultName._buf[2] = '\0'; pAVar1[4]._animDefaultName._buf[3] = '\0'; ((Entity_Player *)npc)->_chargeBarSprites[3]._shadowLayerIndex = 1; } else { (((Entity_Player *)npc)->_sprite)._flipX = 0; ANM2::Play(pAVar1,(byte *)"GroundSlam",0); ((Entity_Player *)npc)->_chargeBarSprites[3]._color._offset[2] = 1.26117e-44; } } goto switchD_00499f10_caseD_1; case 9: npc->_friction = npc->_friction * 0.7; bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { play_sound_with_fart_seed(0x2d5,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { pVVar10 = Entity::GetNullOffset((Entity *)npc,(Vector *)(local_27c + 8),(byte *)"Hitbox"); local_294.x = (npc->_pos).x + pVVar10->x; local_294.y = pVVar10->y + (npc->_pos).y; Game::ShakeScreen(g_game,0xe); local_254 = (Entity_Player *)0xf; do { uVar11 = Random(); fVar19 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_250 = (Room *)(fVar19 + fVar19); uVar11 = Random(); local_260.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 15.0; local_27c._8_4_ = cos((float)local_250); local_27c._8_4_ = (float)local_27c._8_4_ * local_260.y; local_270 = sin((float)local_250); local_270 = local_270 * local_260.y; uVar11 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x3b,&local_294,(Vector *)(local_27c + 8),(Entity *)npc, 0,uVar11); uVar11 = Random(); if ((uVar11 & 1) == 0) { local_250 = (Room *)&DAT_bf800000; } else { local_250 = (Room *)0x3f800000; } uVar11 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_250; uVar11 = Random(); fVar22 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.9; fVar19 = fVar22 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar22 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar19; uVar11 = Random(); iVar15 = uVar11 % 0x14 + 0x14; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar15; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar15; Color::Reset((Color *)local_50); local_50._0_4_ = 0.8; local_50._4_4_ = 0.7; fStack_48 = 0.65; fStack_44 = 0.75; (**(code **)(*(int *)tmpEntity + 0x3c))(local_50,0xffffffff,0xff,0,1); local_254 = (Entity_Player *)((int)&local_254[-1]._replacedPlayer + 3); } while (local_254 != (Entity_Player *)0x0); local_250 = (Room *)0x0; local_254 = (Entity_Player *)0x0; do { uVar11 = Random(); local_284.y = (float)Game::Spawn(g_game,1000,0x48,&local_294,&g_vectorZero,(Entity *)npc,0, uVar11); pEVar7 = (EntityPtr *)(((Room *)local_284.y)->_gridEntities + 0xe6); if (*(EntityPtr *)(((Room *)local_284.y)->_gridEntities + 0xe6) != (EntityPtr)0x0) { local_268.y = (float)pEVar7; std::multiset::erase(&local_268.y); } *pEVar7 = (EntityPtr)npc; std::multiset::insert(pEVar7); puVar13 = &local_250->field_0x1; ((void **)((int)local_284.y + 0x24))[0x114] = (void *)((float)((double)(int)local_250 + __uint_to_double_fixup[-((int)local_250 >> 0x1f)]) * 90.0 + 45.0); manager = g_manager; local_250 = (Room *)puVar13; } while (puVar13 < (undefined1 *)0x4); local_250 = (Room *)0x34; seed_fart_sound_override((int *)&local_250); SoundEffects::Play(&manager->_sfxManager,(int)local_250,1.0,0x14,0,1.0,0.0); Game::ShakeScreen(g_game,0xe); Color::Reset((Color *)local_50); local_50._0_4_ = 0.9; local_50._4_4_ = 0.85; fStack_48 = 0.84; fStack_44 = 0.9; Entity::MakeGroundPoof((Entity *)npc,&local_294,(ColorMod *)local_50,1.0); ProjectileParams::ProjectileParams(&slamParams); slamParams.Variant = 9; slamParams.Scale = 1.25; local_27c._8_4_ = 12.0; local_270 = 0.0; Entity_NPC::FireProjectiles(npc,&local_294,(Vector *)(local_27c + 8),8,&slamParams); iVar15 = 10; do { uVar11 = Random(); fVar19 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_250 = (Room *)(fVar19 + fVar19); uVar11 = Random(); local_260.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 + 0.5; fVar19 = cos((float)local_250); local_268.y = fVar19 * local_260.y; fVar19 = sin((float)local_250); local_284.y = fVar19 * local_260.y * 0.8; uVar11 = Random(); rngResult = Random(); local_29c.x = local_268.y * 10.0; local_2c8.x = local_268.y * 3.0 + local_294.x; local_29c.y = local_284.y * 10.0; local_2c8.y = local_284.y * 3.0 + local_294.y; Game::Spawn(g_game,1000,4,&local_2c8,&local_29c,(Entity *)0x0, -(uint)(rngResult % 3 != 0) & 0x20000,uVar11); npc = self; iVar15 = iVar15 + -1; } while (iVar15 != 0); playerManager = &g_game->_playerManager; local_254 = (Entity_Player *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; if ((int)pvVar6 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (local_254 < (Entity_Player *)((int)pvVar6 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_254; } pEVar7 = (EntityPtr *)*playerSlot; local_260.y = (float)pEVar7[0xd0] - local_294.y; local_250 = (Room *)((float)pEVar7[0xcf] - local_294.x); local_268.y = (float)pEVar7; fVar19 = sqrtf(local_260.y * local_260.y + (float)local_250 * (float)local_250); if (fVar19 < 100.0) { if (fVar19 <= 0.0) { pRVar21 = local_250; local_29c.y = local_260.y; } else { pRVar21 = (Room *)((float)local_250 * (1.0 / fVar19)); local_29c.y = local_260.y * (1.0 / fVar19); } local_29c.x = (float)pRVar21 * 3.0; local_29c.y = local_29c.y * 3.0; pcVar16 = *(code **)((int)*pEVar7 + 0x54); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); (*pcVar16)(local_50 + 4,&local_29c,0x41100000); } playerManager = &g_game->_playerManager; local_254 = (Entity_Player *)&local_254->field_0x1; } while (local_254 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } if (((((Entity_Player *)npc)->_sprite)._animState._animData == (void *)0x0) || ((((Entity_Player *)npc)->_sprite)._animState._isPlaying == 0)) { ((Entity_Player *)npc)->_chargeBarSprites[3]._color._offset[2] = 4.2039e-45; uVar11 = Random(); *(uint *)((Entity_Player *)npc)->_chargeBarSprites[4]._animDefaultName._buf = uVar11 % 0x14 + 10; uVar11 = Random(); ((Entity_Player *)npc)->_chargeBarSprites[3]._shadowLayerIndex = uVar11 % 0x3c + 0x1e; } break; case 10: npc->_friction = npc->_friction * 0.7; if (npc->_stateFrame == 0) { bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { play_sound_with_fart_seed(0x2d4,1.0,2,0,1.0); fVar19 = (npc->_v1).y; npc->_stateFrame = npc->_stateFrame + 1; if (fVar19 <= 0.0) { local_270 = -8.0; } else { local_270 = 10.0; } (npc->_v1).y = local_270; local_270 = local_270 + local_270; (npc->_v1).x = 0.0; local_27c._8_4_ = 0.0; Entity::AddVelocity_divided((Entity *)npc,(Vector *)(local_27c + 8),0); break; } } else if (npc->_stateFrame == 1) { iVar15 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar15 != 0) { uVar11 = Random(); local_268.y = (npc->_velocity).x; local_284.y = (npc->_velocity).y; pVVar10 = MusicManager::RandomVector(&local_29c); local_27c._8_4_ = pVVar10->x + pVVar10->x + local_268.y * 0.2; local_270 = pVVar10->y + pVVar10->y + local_284.y * 0.2; tmpEntity = Game::Spawn(g_game,1000,0x3b,&npc->_pos,(Vector *)(local_27c + 8),(Entity *)npc, 0,uVar11); uVar11 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar11 = Random(); iVar15 = uVar11 % 0xf + 0xf; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar15; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar15; uVar9 = Color::Color(0x3f400000); (**(code **)(*(int *)tmpEntity + 0x3c))(uVar9,0xffffffff,0xff,0,1); tmpEntity->_renderDepthOffset = -5.0; } Entity::AddVelocity_divided((Entity *)npc,&npc->_v1,0); local_249 = '\x01'; isWallImpact = CONCAT31(isWallImpact._1_3_,npc->_collidesWithGrid != 0); } switchD_00499f10_caseD_1: pfVar8 = (float *)((int)((Entity_Player *)npc)->_config + 0x28); if (local_249 == '\0') goto LAB_00499f61; fVar19 = *pfVar8; if (fVar19 <= 2.0) { fVar19 = 2.0; } goto LAB_00499f65; case 0xb: npc->_friction = npc->_friction * 0.7; bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x2d1,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { pVVar10 = Entity::GetNullOffset((Entity *)npc,(Vector *)(local_27c + 8),(byte *)"Hitbox"); local_2b0.x = (npc->_pos).x + pVVar10->x; local_2b0.y = pVVar10->y + (npc->_pos).y; Color::Color((Color *)local_50); Game::Fart(g_game,&local_2b0,85.0,(Entity *)npc,1.0,0,color); if ((npc->_sprite)._flipX == 0) { local_250 = (Room *)0x41f00000; } else { local_250 = (Room *)0x43160000; } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_254 = (Entity_Player *)(tmpEntity->_velocity).x; local_258 = (EntityPtr)(tmpEntity->_velocity).y; fVar19 = (npc->_pos).y - (tmpEntity->_pos).y; fVar22 = (npc->_pos).x - (tmpEntity->_pos).x; fVar19 = sqrtf(fVar19 * fVar19 + fVar22 * fVar22); local_254 = (Entity_Player *) (((float)local_254 * fVar19 * 0.1 + (tmpEntity->_pos).x) - local_2b0.x); local_258 = (EntityPtr)(((float)local_258 * fVar19 * 0.1 + (tmpEntity->_pos).y) - local_2b0.y) ; uVar11 = Random(); fVar19 = atan2f((float)local_258,(float)local_254); fVar19 = approach_angle((float)local_250,fVar19 * 57.295776,45.0); local_268.y = fVar19 * 0.017453292; local_27c._8_4_ = cos(local_268.y); local_27c._8_4_ = (float)local_27c._8_4_ * 12.0; local_270 = sin(local_268.y); local_270 = local_270 * 12.0; tmpEntity = Game::Spawn(g_game,4,9,&local_2b0,(Vector *)(local_27c + 8),(Entity *)npc,0,uVar11 ); *(undefined4 *)&tmpEntity[1].field_0x4 = 0x14; tmpEntity[1]._damageEvents._begin = (void *)0x14; tmpEntity->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0049a8fb; break; case 0x10: npc->_friction = npc->_friction * 0.5; bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { uVar11 = ItemPool::GetCollectibleFromList (&g_game->_itemPool,(int *)&DAT_00b1e620,0xc,npc->_initSeed,0x24,1,0); rngResult = RNG::Next(&self->_dropRNG); pVVar10 = (Vector *)Isaac::GetCollectibleSpawnPosition(); tmpEntity = Game::Spawn(g_game,5,100,pVVar10,&g_vectorZero,(Entity *)0x0,uVar11,rngResult); uVar11 = Random(); local_27c._8_4_ = (tmpEntity->_pos).x; local_270 = (tmpEntity->_pos).y; Game::Spawn(g_game,1000,0xf,(Vector *)(local_27c + 8),&g_vectorZero,(Entity *)0x0,0,uVar11); SoundEffects::PlayWithFartOverride(0x10c,1.0,2,0,1.0); npc = self; } if (((((Entity_Player *)npc)->_sprite)._animState._animData == (void *)0x0) || ((((Entity_Player *)npc)->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); Room::TriggerBossDeath(g_game->_room,(Entity *)npc); ExceptionList = local_1c; return; } } pfVar8 = (float *)((int)((Entity_Player *)npc)->_config + 0x28); LAB_00499f61: fVar19 = *pfVar8; LAB_00499f65: ((Entity_Player *)npc)->_collisionDamage = fVar19; if ((((Entity_Player *)npc)->_collidesWithGrid == 0) || (local_249 == '\0')) { LAB_0049c479: manager = g_manager; if ((char)isWallImpact != '\0') { local_250 = (Room *)0x34; seed_fart_sound_override((int *)&local_250); SoundEffects::Play(&manager->_sfxManager,(int)local_250,1.0,0x14,0,1.0,0.0); Game::ShakeScreen(g_game,0xe); animData = (((Entity_Player *)npc)->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0049c531: bVar4 = ANM2::SetAnimation(&((Entity_Player *)npc)->_sprite,(byte *)"WallImpact",1); if (bVar4 != 0) { AnimationState::Rewind(&(((Entity_Player *)npc)->_sprite)._animState); (((Entity_Player *)npc)->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } pcVar14 = "WallImpact"; do { bVar4 = *animNameCursor; bVar17 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_0049c513: uVar11 = -(uint)bVar17 | 1; goto LAB_0049c518; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar17 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_0049c513; animNameCursor = animNameCursor + 2; pcVar14 = pcVar14 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0049c518: if ((uVar11 != 0) || ((animData[0x34] != 0 && ((((Entity_Player *)npc)->_sprite)._animState._isPlaying == 0))) ) goto LAB_0049c531; } manager = g_manager; local_250 = (Room *)0x2d1; seed_fart_sound_override((int *)&local_250); SoundEffects::Play(&manager->_sfxManager,(int)local_250,1.0,2,0,1.0,0.0); ((Entity_Player *)npc)->_chargeBarSprites[3]._color._offset[2] = 7.00649e-45; *(int *)&((Entity_Player *)npc)->_isControlsEnabled = 0; pAVar1 = ((Entity_Player *)npc)->_chargeBarSprites; pAVar1[4]._animDefaultName._buf[0] = '<'; pAVar1[4]._animDefaultName._buf[1] = '\0'; pAVar1[4]._animDefaultName._buf[2] = '\0'; pAVar1[4]._animDefaultName._buf[3] = '\0'; Entity_NPC::GetPlayerTarget(npc); local_260.y = 1.4013e-44; do { uVar11 = Random(); local_268.y = ((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 160.0 + 100.0) * 0.017453292; local_284.y = cos(local_268.y); local_2c0.y = sin(local_268.y); local_268.y = (((Entity_Player *)npc)->_gridCollisionNormal).x; local_2b0.y = (((Entity_Player *)npc)->_gridCollisionNormal).y; uVar11 = Random(); local_270 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 15.0; local_27c._8_4_ = (local_268.y * local_284.y - local_2b0.y * local_2c0.y) * local_270; local_270 = (local_268.y * local_2c0.y + local_2b0.y * local_284.y) * local_270; uVar11 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x3b,&((Entity_Player *)npc)->_pos, (Vector *)(local_27c + 8),(Entity *)npc,0,uVar11); uVar11 = Random(); if ((uVar11 & 1) == 0) { local_250 = (Room *)&DAT_bf800000; } else { local_250 = (Room *)0x3f800000; } uVar11 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_250; uVar11 = Random(); fVar22 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.9; fVar19 = fVar22 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar22 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar19; uVar11 = Random(); iVar15 = uVar11 % 0x14 + 0x14; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar15; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar15; Color::Reset((Color *)local_50); local_50._0_4_ = 0.8; local_50._4_4_ = 0.7; fStack_48 = 0.65; fStack_44 = 0.75; (**(code **)(*(int *)tmpEntity + 0x3c))(local_50,0xffffffff,0xff,0,1); local_260.y = (float)((int)local_260.y + -1); } while (local_260.y != 0.0); ProjectileParams::ProjectileParams(&wallImpactParams); local_27c._8_4_ = (((Entity_Player *)npc)->_pos).x - (((Entity_Player *)npc)->_gridCollisionNormal).x * 100.0; local_270 = (((Entity_Player *)npc)->_pos).y - (((Entity_Player *)npc)->_gridCollisionNormal).y * 100.0; wallImpactParams.Variant = 9; Entity_NPC::FireBossProjectiles(npc,8,local_27c + 8,0.0,&wallImpactParams); playerManager = &g_game->_playerManager; local_254 = (Entity_Player *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; if ((int)pvVar6 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (local_254 < (Entity_Player *)((int)pvVar6 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_254; } pEVar7 = (EntityPtr *)*playerSlot; local_260.y = (float)pEVar7[0xd0] - (((Entity_Player *)npc)->_pos).y; local_250 = (Room *)((float)pEVar7[0xcf] - (((Entity_Player *)npc)->_pos).x); local_268.y = (float)pEVar7; fVar19 = sqrtf(local_260.y * local_260.y + (float)local_250 * (float)local_250); if (fVar19 < 150.0) { if (fVar19 <= 0.0) { pRVar21 = local_250; local_2a8.y = local_260.y; } else { pRVar21 = (Room *)((float)local_250 * (1.0 / fVar19)); local_2a8.y = local_260.y * (1.0 / fVar19); } local_2a8.x = (float)pRVar21 * 3.0; local_2a8.y = local_2a8.y * 3.0; pcVar16 = *(code **)((int)*pEVar7 + 0x54); EntityRef::constructor(&selfRef,(Entity *)npc); (*pcVar16)(&selfRef,&local_2a8,0x41100000); } playerManager = &g_game->_playerManager; local_254 = (Entity_Player *)&local_254->field_0x1; } while (local_254 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } } else { pfVar8 = (((Entity_Player *)npc)->_collisionPoints)._begin; cVar3 = '\0'; local_249 = '\0'; if (pfVar8 == (((Entity_Player *)npc)->_collisionPoints)._end) goto LAB_0049c479; do { pEVar2 = self; iVar15 = (int)((((((Entity_Player *)npc)->_gridCollisionVelocity).x * 0.5 + (((Entity_Player *)npc)->_pos).x + *pfVar8) - 40.0) / 40.0 + 0.5); iVar12 = (int)((((((Entity_Player *)npc)->_gridCollisionVelocity).y * 0.5 + (((Entity_Player *)npc)->_pos).y + pfVar8[1]) - 120.0) / 40.0 + 0.5); if (-1 < iVar15) { if (((iVar15 < room->_gridWidth) && (-1 < iVar12)) && ((npc = pEVar2, iVar12 < room->_gridHeight && (iVar15 = room->_gridWidth * iVar12 + iVar15, -1 < iVar15)))) { if (iVar15 < 0x1c0) { local_258 = *(EntityPtr *)(room->_gridEntities + iVar15); } else { local_258 = (EntityPtr)0x0; } uVar11 = Room::GetGridCollision(room,iVar15); if ((((uVar11 == 3) || (uVar11 == 2)) && (local_258 != (EntityPtr)0x0)) && (*(int *)((int)local_258 + 0x3c) == 3)) { pcVar16 = *(code **)(*(int *)local_258 + 0x14); EntityRef::constructor(&local_300,(Entity *)self); cVar3 = (*pcVar16)(0,&local_300); npc = self; if (cVar3 != '\0') { fVar23 = 40.0; local_250 = g_game->_room; fVar19 = (float)(*(int *)((int)local_258 + 0x24) % local_250->_gridWidth) * 40.0 + 40.0; fVar22 = (float)(*(int *)((int)local_258 + 0x24) / local_250->_gridWidth) * 40.0 + 120.0; local_2a8.x = fVar19 - (self->_pos).x; local_2a8.y = fVar22 - (self->_pos).y; Vector::ToCardinal(&local_2b8,&local_2a8); local_260.x = local_2b8.x * fVar23 + fVar19; local_260.y = local_2b8.y * fVar23 + fVar22; iVar15 = Room::GetGridIndex(local_250,&local_260); if (-1 < iVar15) { if (iVar15 < 0x1c0) { pit = room->_gridEntities[iVar15]; } else { pit = (GridEntity *)0x0; } Room::TryMakeBridge(local_250,pit,(GridEntity *)local_258); } local_249 = '\x01'; cVar3 = '\x01'; goto LAB_0049c439; } } } cVar3 = local_249; } LAB_0049c439: pfVar8 = pfVar8 + 2; } while (pfVar8 != (((Entity_Player *)npc)->_collisionPoints)._end); if (cVar3 == '\0') goto LAB_0049c479; fVar19 = (((Entity_Player *)npc)->_gridCollisionVelocity).y; (((Entity_Player *)npc)->_velocity).x = (((Entity_Player *)npc)->_gridCollisionVelocity).x * 0.5 ; (((Entity_Player *)npc)->_velocity).y = fVar19 * 0.5; } iVar15 = ((Entity_Player *)npc)->_chargeBarSprites[3]._shadowLayerIndex; if (0 < iVar15) { ((Entity_Player *)npc)->_chargeBarSprites[3]._shadowLayerIndex = iVar15 - elapsedFrames; } fVar19 = ((Entity_Player *)npc)->_chargeBarSprites[3]._color._offset[2]; if ((fVar19 != 4.2039e-45) && (fVar19 != 5.60519e-45)) { ExceptionList = local_1c; return; } if (*(int *)(((Entity_Player *)npc)->_chargeBarSprites[4]._animDefaultName._buf + 4) < 0xc) { ExceptionList = local_1c; return; } pAVar1 = ((Entity_Player *)npc)->_chargeBarSprites + 4; (pAVar1->_animDefaultName)._buf[4] = '\0'; (pAVar1->_animDefaultName)._buf[5] = '\0'; (pAVar1->_animDefaultName)._buf[6] = '\0'; (pAVar1->_animDefaultName)._buf[7] = '\0'; ((Entity_Player *)npc)->_chargeBarSprites[3]._color._offset[2] = 2.24208e-44; animData = (((Entity_Player *)npc)->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } pcVar14 = "ItemSpawn"; do { bVar4 = *animNameCursor; bVar17 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_0049ca87: uVar11 = -(uint)bVar17 | 1; goto LAB_0049ca8c; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; bVar17 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_0049ca87; animNameCursor = animNameCursor + 2; pcVar14 = pcVar14 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0049ca8c: if ((uVar11 == 0) && ((animData[0x34] == 0 || ((((Entity_Player *)npc)->_sprite)._animState._isPlaying != 0)))) goto LAB_0049cac3; } bVar4 = ANM2::SetAnimation(&((Entity_Player *)npc)->_sprite,(byte *)"ItemSpawn",1); if (bVar4 != 0) { AnimationState::Rewind(&(((Entity_Player *)npc)->_sprite)._animState); (((Entity_Player *)npc)->_sprite)._animState._isPlaying = 1; } LAB_0049cac3: (((Entity_Player *)npc)->_sprite)._flipX = 0; Entity::RemoveStatusEffects((Entity *)npc); ((Entity_Player *)npc)->_entityCollisionClass = 0; ExceptionList = local_1c; return; } //@@ 0049cb40 Sprite::Offset /* ZHL [lua] Lua binding Sprite:Offset */ Vector * __thiscall Sprite::Offset(Sprite *this) { return &this->_offset; } //@@ 0049cb50 Entity::SpriteOffset /* ZHL [lua] Lua binding Entity:SpriteOffset */ Vector * __thiscall Entity::SpriteOffset(Entity *this) { return &(this->_sprite)._offset; } //@@ 0049cb60 WeightedOutcomePicker::AddOutcomeWeight /* ZHL [exact] __thiscall void WeightedOutcomePicker::AddOutcomeWeight(WeightedOutcomePicker_Outcome outcome, bool unk); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall WeightedOutcomePicker::AddOutcomeWeight (WeightedOutcomePicker *this,int outcome,int weight,byte isNoMerge) { int *piVar1; WeightedOutcomePicker WVar2; uint uVar3; uint uVar4; int local_10; int local_c; if (isNoMerge == 0) { uVar4 = 0; WVar2 = *this; uVar3 = (int)this[1] - (int)WVar2 >> 3; if (uVar3 != 0) { do { if (*(int *)((int)WVar2 + uVar4 * 8) == outcome) { piVar1 = (int *)((int)WVar2 + 4 + uVar4 * 8); *piVar1 = *piVar1 + weight; if (*(int *)((int)*this + 4 + uVar4 * 8) < 0) { *(undefined4 *)((int)*this + 4 + uVar4 * 8) = 0; return; } return; } uVar4 = uVar4 + 1; } while (uVar4 < uVar3); } } if (0 < weight) { WVar2 = this[1]; local_10 = outcome; local_c = weight; if (WVar2 != this[2]) { *(int *)WVar2 = outcome; *(int *)((int)WVar2 + 4) = weight; this[1] = (WeightedOutcomePicker)((int)this[1] + 8); return; } std::vector<8byte>::_Emplace_reallocate(WVar2,&local_10); } return; } //@@ 0049cbf0 WeightedOutcomePicker::PickOutcome /* ZHL [exact] __thiscall unsigned int WeightedOutcomePicker::PickOutcome(RNG rng); prototype: REPENTOGON, confirmed by RET 16 */ uint __thiscall WeightedOutcomePicker::PickOutcome(WeightedOutcomePicker *this,RNG rng) { int iVar1; int iVar2; int iVar3; int iVar4; WeightedOutcomePicker WVar5; code *pcVar6; uint uVar7; uint uVar8; int *piVar9; uint uVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; uVar10 = 0; WVar5 = *this; uVar7 = 0; uVar8 = (int)this[1] - (int)WVar5 >> 3; if ((uVar8 != 0) && (7 < uVar8)) { iVar15 = 0; iVar16 = 0; iVar17 = 0; iVar18 = 0; iVar11 = 0; iVar12 = 0; iVar13 = 0; iVar14 = 0; do { iVar1 = uVar7 * 8; iVar2 = uVar7 * 8; iVar3 = uVar7 * 8; iVar15 = iVar15 + *(int *)((int)WVar5 + 4 + uVar7 * 8); iVar16 = iVar16 + *(int *)((int)WVar5 + 0xc + uVar7 * 8); iVar17 = iVar17 + *(int *)((int)WVar5 + 0x14 + uVar7 * 8); iVar18 = iVar18 + *(int *)((int)WVar5 + 0x1c + uVar7 * 8); iVar4 = uVar7 * 8; uVar7 = uVar7 + 8; iVar11 = iVar11 + *(int *)((int)WVar5 + 0x24 + iVar4); iVar12 = iVar12 + *(int *)((int)WVar5 + 0x2c + iVar3); iVar13 = iVar13 + *(int *)((int)WVar5 + 0x34 + iVar1); iVar14 = iVar14 + *(int *)((int)WVar5 + 0x3c + iVar2); } while (uVar7 < uVar8 - (uVar8 & 7)); uVar10 = iVar11 + iVar15 + iVar13 + iVar17 + iVar12 + iVar16 + iVar14 + iVar18; } iVar11 = 0; iVar12 = 0; if (uVar8 <= uVar7) goto LAB_0049ccec; if (uVar8 - uVar7 < 2) { LAB_0049cce3: uVar10 = uVar10 + *(int *)((int)WVar5 + 4 + uVar7 * 8); } else { do { iVar11 = iVar11 + *(int *)((int)WVar5 + 4 + uVar7 * 8); iVar12 = iVar12 + *(int *)((int)WVar5 + 0xc + uVar7 * 8); uVar7 = uVar7 + 2; } while (uVar7 < uVar8 - 1); if (uVar7 < uVar8) goto LAB_0049cce3; } uVar10 = uVar10 + iVar12 + iVar11; LAB_0049ccec: if (rng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); uVar7 = (*pcVar6)(); return uVar7; } uVar7 = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; uVar7 = uVar7 << ((byte)rng._shift2 & 0x1f) ^ uVar7; if (uVar10 == 0) { uVar10 = 0; } else { uVar10 = (uVar7 >> ((byte)rng._shift3 & 0x1f) ^ uVar7) % uVar10; } iVar11 = 0; uVar7 = 0; WVar5 = *this; uVar8 = (int)this[1] - (int)WVar5 >> 3; if (uVar8 != 0) { piVar9 = (int *)((int)WVar5 + 4); do { iVar11 = iVar11 + *piVar9; if ((int)uVar10 < iVar11) { return *(uint *)((int)WVar5 + uVar7 * 8); } uVar7 = uVar7 + 1; piVar9 = piVar9 + 2; } while (uVar7 < uVar8); if (0 < iVar11) { return 0; } } KAGE_LogMessage(0x10,(byte *)"No weights were added. At least one outcome needs weight."); return 0; } //@@ 0049cd90 NpcAI::ENTITY_CHIMERA_head_update /* DB: ? once from ENTITY_CHIMERA_body for variant 0: HeadIdle/HeadCharge/HeadAttack overlay anims, "Shoot" event spawns small maggots / Game::Spawn toward GetPlayerTarget, Entity_Effect::FollowParent */ void __fastcall NpcAI::ENTITY_CHIMERA_head_update(Entity_NPC *npc) { byte bVar1; Entity *target; LayerState *headLayer; Entity_Effect *splat; int newCooldown; int cooldown; uint uVar2; AnimationState *overlayAnimState; float fVar3; Vector maggotVel; float cosAngle; float angleRad; float local_c; float toTargetX; bool isOffsetX; bool isRightOfNpc; void *overlayAnimData; if (npc->_projectileCooldown != -1000) { target = Entity_NPC::GetPlayerTarget(npc); cooldown = npc->_projectileCooldown; toTargetX = (target->_pos).x; local_c = (target->_pos).y; if (cooldown < 0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0xb,1.0,2,0,1.0); toTargetX = toTargetX - (npc->_pos).x; local_c = local_c - (npc->_pos).y; fVar3 = sqrtf(toTargetX * toTargetX + local_c * local_c); if (0.0 < fVar3) { toTargetX = toTargetX * (1.0 / fVar3); local_c = local_c * (1.0 / fVar3); } uVar2 = 0xfffffffe; do { angleRad = (float)(int)uVar2 * 22.0 * 0.017453292; cosAngle = cos(angleRad); fVar3 = sin(angleRad); maggotVel.y = 1.0 - (float)(int)((uVar2 ^ (int)uVar2 >> 0x1f) - ((int)uVar2 >> 0x1f)) * 0.2; maggotVel.x = (toTargetX * cosAngle - local_c * fVar3) * 8.0 * maggotVel.y; maggotVel.y = (toTargetX * fVar3 + local_c * cosAngle) * 8.0 * maggotVel.y; spawn_small_maggot(&npc->_pos,-24.0,&maggotVel,-8.0); uVar2 = uVar2 + 1; } while ((int)uVar2 < 3); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); if (headLayer->_flipX == 0) { local_c = -6.0; } else { local_c = 6.0; } uVar2 = Random(); splat = (Entity_Effect *) Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,3,uVar2); (**(code **)(*(int *)splat + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (splat->_sprite)._offset.x = local_c; (splat->_sprite)._offset.y = -48.0; splat->_renderDepthOffset = 10.0; Entity_Effect::FollowParent(splat,(Entity *)npc); } overlayAnimState = &(npc->_sprite)._overlayAnimState; bVar1 = AnimationState::IsEventTriggered(overlayAnimState,s_Jump); if (bVar1 != 0) { headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); headLayer->_flipX = 0; } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { if (npc->_state == 4) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadCharge",0); overlayAnimData = (npc->_sprite)._overlayAnimState._animData; if (overlayAnimData != (void *)0x0) { AnimationState::SetFrameFloat (overlayAnimState,(float)*(int *)((int)overlayAnimData + 0x30)); npc->_projectileCooldown = 0x5a; return; } } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadIdle",0); } npc->_projectileCooldown = 0x5a; return; } } else if (cooldown == 0) { uVar2 = Random(); if (uVar2 % 0x28 == 0) { npc->_projectileCooldown = -1; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAttack",0); isOffsetX = toTargetX != (npc->_pos).x; isRightOfNpc = (npc->_pos).x <= toTargetX; headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); headLayer->_flipX = isRightOfNpc && isOffsetX; return; } } else { cooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + cooldown; newCooldown = 0; if (0 < cooldown) { newCooldown = cooldown; } npc->_projectileCooldown = newCooldown; } } return; } //@@ 0049d100 FUN_0049d100 uint FUN_0049d100(void) { uint in_EAX; int in_ECX; if (((*(int *)(in_ECX + 0x3c0) == 0) || (*(char *)(in_ECX + 0xbbb) != '\0')) || ((in_EAX = *(uint *)(in_ECX + 0xb64), in_EAX != 3 && (in_EAX != 4)))) { return in_EAX & 0xffffff00; } return CONCAT31((int3)(in_EAX >> 8),1); } //@@ 0049d130 NpcAI::ENTITY_CHIMERA_body /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs RunHoriHeadless/Brimstone*/Leap */ void __fastcall NpcAI::ENTITY_CHIMERA_body(Entity_NPC *npc) { ANM2 *pAVar1; RNG rng; undefined1 *puVar2; byte bVar3; uint uVar4; LayerState *layer; void *layerFrame; Vector *pVVar5; Entity_Effect *effect; EntityPtr EVar6; ColorMod *color; Entity *tmpEntity; Entity_Laser *brimstoneLaser; float *pfVar7; Vector *game; float *damageEventsEnd; WeightedOutcomePicker pickerAlloc; int iVar8; uint outcomeCount; int tick; float fVar9; float fVar10; float fVar11; Vector local_178; Vector scratchVec; Vector local_168; float local_160; char rollCooldown; char throwHeadCooldown; char fallBackCooldown; char spitFlyCooldown; WeightedOutcomePicker attackPicker; Vector local_154; uint pickSeed; undefined1 auStack_148 [8]; EntityPtr *pEStack_140; Entity *local_13c; EntityPtr local_138; char local_131; EntityPtr *local_130; byte local_129; ProjectileParams projectileParams; Color scratchColor; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *animName; EntityPtr collider; undefined4 flagsHigh; Game *game; int *outcomeWeight; EntityPtr *parentRef; ColorMod *spawnedColor; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af2f40; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; EVar6 = npc->_child; if ((((EVar6 == (EntityPtr)0x0) || (*(char *)((int)&(npc->_v2).x + 3) != '\0')) || ((npc->_state != 3 && (npc->_state != 4)))) || (*(char *)((int)EVar6 + 0xbc0) == '\0')) { local_131 = '\0'; } else { local_131 = '\x01'; } local_24 = uVar4; if (npc->_aiCallPhase == 1) { if (npc->_variant != 0) { return; } if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { return; } if ((uint)npc->_state < 3) { return; } pAVar1 = &npc->_sprite; ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); layer = ANM2::GetLayer(pAVar1,(byte *)0x2); layer->_visible = 0; layerFrame = AnimationState::GetLayerFrame(&(npc->_sprite)._animState,2); if ((layerFrame == (void *)0x0) || (*(char *)((int)layerFrame + 0x2c) == '\0')) { layer = ANM2::GetLayer(pAVar1,(byte *)0x1); layer->_visible = 0; ExceptionList = local_1c; return; } layer = ANM2::GetLayer(pAVar1,(byte *)0x1); layer->_visible = 1; layer = ANM2::GetLayer(pAVar1,(byte *)0x2); local_138 = *(EntityPtr *)((int)layerFrame + 0x10); if (layer->_flipX != 0) { local_138 = (EntityPtr)-(float)local_138; } layer = ANM2::GetLayer(pAVar1,(byte *)0x1); (layer->_pos).x = (float)local_138; local_130 = *(EntityPtr **)((int)layerFrame + 0x14); layer = ANM2::GetLayer(pAVar1,(byte *)0x1); (layer->_pos).y = (float)local_130; layer = ANM2::GetLayer(pAVar1,(byte *)0x1); (layer->_size).x = *(float *)((int)layerFrame + 0x18); (layer->_size).y = *(float *)((int)layerFrame + 0x1c); ExceptionList = local_1c; return; } if (npc->_aiCallPhase == 3) { collider = (EntityPtr)npc->_collisionEntity; if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)collider + 0x28) != 1)) { iVar8 = *(int *)((int)collider + 0x28); if (0x3dd < iVar8 - 10U) { return; } } else { iVar8 = 1; } if ((collider != EVar6) && (collider != npc->_parent)) { return; } if ((((((npc->_variant == 1) && (iVar8 == 0x38e)) && (*(int *)((int)collider + 0x2c) == 2)) && ((collider == EVar6 && (EVar6 != (EntityPtr)0x0)))) && (*(char *)((int)&(npc->_v2).x + 3) == '\0')) && (((npc->_state == 3 || (npc->_state == 4)) && ((*(int *)((int)EVar6 + 0xb64) == 10 && (*(char *)((int)EVar6 + 0xbc0) != '\0')))))) { ExceptionList = &local_1c; npc->_state = 0x10; *(undefined4 *)((int)EVar6 + 0xb64) = 0x10; *(undefined1 *)((int)EVar6 + 0x171) = 0; (npc->_velocity).x = *(float *)((int)EVar6 + 0x360) + (npc->_velocity).x; (npc->_velocity).y = *(float *)((int)EVar6 + 0x364) + (npc->_velocity).y; *(float *)((int)EVar6 + 0x360) = g_vectorZero.x; *(float *)((int)EVar6 + 0x364) = g_vectorZero.y; *(undefined4 *)((int)EVar6 + 0x188) = 0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); ANM2::Play(&npc->_sprite,(byte *)"ThrowHead",0); } npc->_collisionResult = 0; ExceptionList = local_1c; return; } ExceptionList = &local_1c; puVar2 = (undefined1 *)((int)register0x00000010 + -4); switch(npc->_state) { case 0: npc->_state = 3; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadIdle",0); npc->_aiCallFlags = 5; npc->_projectileCooldown = 0; (npc->_v2).x = 0.0; *(undefined2 *)&(npc->_v2).y = 0; puVar2 = puStack_20; break; case 3: npc->_friction = npc->_friction * 0.7; if (local_131 == '\0') { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); tmpEntity = Entity_NPC::GetPlayerTarget(npc); pEStack_140 = (EntityPtr *)(tmpEntity->_pos).y; auStack_148._4_4_ = (tmpEntity->_pos).x; } else { pEStack_140 = *(EntityPtr **)((int)EVar6 + 0x340); auStack_148._4_4_ = *(undefined4 *)((int)EVar6 + 0x33c); puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,(Vector *)(auStack_148 + 4),0.6,0,1); iVar8 = npc->_variant; if (iVar8 == 0) { ENTITY_CHIMERA_head_update(npc); iVar8 = npc->_variant; } if (ABS((npc->_velocity).x) <= ABS((npc->_velocity).y)) { animName = "WalkVert"; if (iVar8 != 0) { animName = "WalkVertHeadless"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = 0; } else { animName = "WalkHori"; if (iVar8 != 0) { animName = "WalkHoriHeadless"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); local_129 = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = local_129; } if (npc->_variant == 0) { uVar4 = npc->_projectileCooldown; if (uVar4 == 0xfffffc18) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); npc->_mass = 1000.0; npc->_state = 4; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAngry",0); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; uVar4 = npc->_projectileCooldown; npc->_projectileDelay = 0; } puVar2 = puStack_20; if (uVar4 < 0x1e) { attackPicker = (WeightedOutcomePicker)0x0; local_154.x = 0.0; local_154.y = 0.0; local_14 = 0; if (*(char *)&(npc->_v2).x == '\0') { auStack_148._4_4_ = 1; pEStack_140 = (EntityPtr *)&DAT_00000008; std::vector<8byte>::_Emplace_reallocate(0,auStack_148 + 4); } if (*(char *)((int)&(npc->_v2).x + 1) == '\0') { uVar4 = 0; outcomeCount = (int)local_154.x - (int)attackPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)attackPicker + uVar4 * 8) == 2) { outcomeWeight = (int *)((int)attackPicker + 4 + uVar4 * 8); *outcomeWeight = *outcomeWeight + 10; if (*outcomeWeight < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar4 * 8) = 0; } goto LAB_0049d6c1; } uVar4 = uVar4 + 1; } while (uVar4 < outcomeCount); } auStack_148._4_4_ = 2; pEStack_140 = (EntityPtr *)0xa; if (local_154.x == local_154.y) { std::vector<8byte>::_Emplace_reallocate(local_154.x,auStack_148 + 4); } else { *(undefined4 *)local_154.x = 2; *(undefined4 *)((int)local_154.x + 4) = 10; local_154.x = (float)((int)local_154.x + 8); } } LAB_0049d6c1: if (*(char *)((int)&(npc->_v2).x + 2) == '\0') { uVar4 = 0; outcomeCount = (int)local_154.x - (int)attackPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)attackPicker + uVar4 * 8) == 3) { outcomeWeight = (int *)((int)attackPicker + 4 + uVar4 * 8); *outcomeWeight = *outcomeWeight + 10; if (*outcomeWeight < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar4 * 8) = 0; } goto LAB_0049d746; } uVar4 = uVar4 + 1; } while (uVar4 < outcomeCount); } auStack_148._4_4_ = 3; pEStack_140 = (EntityPtr *)0xa; if (local_154.x == local_154.y) { std::vector<8byte>::_Emplace_reallocate(local_154.x,auStack_148 + 4); } else { *(undefined4 *)local_154.x = 3; *(undefined4 *)((int)local_154.x + 4) = 10; local_154.x = (float)((int)local_154.x + 8); } } LAB_0049d746: uVar4 = 0; outcomeCount = (int)local_154.x - (int)attackPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)attackPicker + uVar4 * 8) == 0) { outcomeWeight = (int *)((int)attackPicker + 4 + uVar4 * 8); *outcomeWeight = *outcomeWeight + 600; if (*outcomeWeight < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar4 * 8) = 0; } goto LAB_0049d7b3; } uVar4 = uVar4 + 1; } while (uVar4 < outcomeCount); } pEStack_140 = (EntityPtr *)0x258; auStack_148 = (undefined1 [8])((ulonglong)auStack_148 & 0xffffffff); if (local_154.x == local_154.y) { std::vector<8byte>::_Emplace_reallocate(local_154.x,auStack_148 + 4); } else { *(undefined4 *)local_154.x = 0; *(undefined4 *)((int)local_154.x + 4) = 600; local_154.x = (float)((int)local_154.x + 8); } LAB_0049d7b3: pickSeed = Random(); pickSeed = pickSeed | 1; auStack_148 = (undefined1 [8])0x900000005; pEStack_140 = (EntityPtr *)&DAT_00000007; rng._shift1 = 5; rng._seed = pickSeed; rng._shift2 = 9; rng._shift3 = 7; uVar4 = WeightedOutcomePicker::PickOutcome(&attackPicker,rng); if (uVar4 == 1) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); npc->_mass = 1000.0; npc->_state = 4; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadCharge",0); iVar8 = npc->_projectileCooldown; if (iVar8 < 0x1e) { iVar8 = 0x1e; } npc->_projectileCooldown = iVar8; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; LAB_0049d8b7: npc->_projectileDelay = 0; } else { if (uVar4 == 2) { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"SpitFly",0); goto LAB_0049d8b7; } if (uVar4 == 3) { npc->_state = 9; ANM2::Play(&npc->_sprite,(byte *)"FallBack",0); goto LAB_0049d8b7; } } puVar2 = puStack_20; if (attackPicker != (WeightedOutcomePicker)0x0) { uVar4 = (int)local_154.y - (int)attackPicker & 0xfffffff8; pickerAlloc = attackPicker; if (0xfff < uVar4) { pickerAlloc = *(WeightedOutcomePicker *)((int)attackPicker + -4); uVar4 = uVar4 + 0x23; if (0x1f < ((int)attackPicker - (int)pickerAlloc) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)pickerAlloc,uVar4); puVar2 = puStack_20; } } } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_13c = (Entity *)(tmpEntity->_velocity).x; fVar10 = (npc->_pos).x - (tmpEntity->_pos).x; local_160 = (tmpEntity->_velocity).y; fVar9 = (npc->_pos).y - (tmpEntity->_pos).y; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); local_13c = (Entity *)((float)local_13c * fVar9 * 0.04 + (tmpEntity->_pos).x); local_160 = local_160 * fVar9 * 0.04 + (tmpEntity->_pos).y; if ((((*(char *)&(npc->_v2).y == '\0') && ((npc->_child == (EntityPtr)0x0 || (*(int *)((int)npc->_child + 0xb64) == 3)))) && (uVar4 = Random(), uVar4 % 0x3c == 0)) || (npc->_child == (EntityPtr)0x0)) { Entity_NPC::PlaySound(npc,0xf,1.0,2,0,1.0); npc->_mass = 1000.0; npc->_state = 4; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; npc->_projectileDelay = 0; puVar2 = puStack_20; } else { puVar2 = puStack_20; if (((*(char *)((int)&(npc->_v2).y + 1) == '\0') && (60.0 < ABS(local_160 - (npc->_pos).y))) && (ABS((float)local_13c - (npc->_pos).x) < 20.0)) { npc->_state = 10; ANM2::Play(&npc->_sprite,(byte *)"BrimstoneStart",0); npc->_projectileDelay = -1; puVar2 = puStack_20; } } } break; case 4: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130 = (EntityPtr *)(tmpEntity->_velocity).y; local_138 = (EntityPtr)(tmpEntity->_pos).y; fVar10 = (npc->_pos).x - (tmpEntity->_pos).x; fVar9 = (npc->_pos).y - (float)local_138; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); local_178.y = fVar9 * 0.2 * (float)local_130 + (float)local_138; local_178.x = fVar9 * 0.2 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x; if (local_131 != '\0') { local_178.x = *(float *)((int)npc->_child + 0x33c); local_178.y = *(float *)((int)npc->_child + 0x340); } local_130 = (EntityPtr *)(npc->_velocity).x; local_168.y = (npc->_velocity).y; if (npc->_projectileCooldown == -1000) { fVar9 = 0.16; } else { fVar9 = 0.12; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_178,fVar9,0,1); local_138 = (EntityPtr)((npc->_velocity).x - (float)local_130); pEStack_140 = (EntityPtr *)((npc->_velocity).y - local_168.y); iVar8 = npc->_variant; npc->_friction = 0.96; auStack_148._4_4_ = local_138; local_130 = pEStack_140; if (iVar8 == 0) { ENTITY_CHIMERA_head_update(npc); iVar8 = npc->_variant; } if (ABS((float)local_138) <= ABS((float)local_130)) { animName = "RunVert"; if (iVar8 != 0) { animName = "RunVertHeadless"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = 0; } else { animName = "RunHori"; if (iVar8 != 0) { animName = "RunHoriHeadless"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); local_129 = (float)local_138 < 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = local_129; } npc->_projectileDelay = npc->_projectileDelay + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_variant == 0) { uVar4 = Random(); if (uVar4 % 3 == 0) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x17,&npc->_pos,&g_vectorZero,(Entity *)npc,100,uVar4); iVar8 = *(int *)tmpEntity; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[8] = '\x14'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[0xc] = '\x14'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (**(code **)(iVar8 + 0xc))(); uVar4 = Random(); effect = Entity_NPC::MakeSplat (npc,((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5) * 0.25); (**(code **)(*(int *)effect + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); } iVar8 = npc->_projectileCooldown; if (iVar8 == -1000) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130 = (EntityPtr *)(tmpEntity->_pos).x; local_138 = (EntityPtr)(tmpEntity->_pos).y; scratchVec.x = (float)local_130 - (npc->_pos).x; scratchVec.y = (float)local_138 - (npc->_pos).y; Vector::Normalized(&scratchVec,&local_168); if ((npc->_projectileDelay < 0x79) || (uVar4 = Random(), uVar4 % 0xf != 0)) { puVar2 = puStack_20; if (0x3c < npc->_projectileDelay) { fVar9 = (float)local_138 - (npc->_pos).y; fVar10 = (float)local_130 - (npc->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); puVar2 = puStack_20; if (fVar9 < 300.0) { pVVar5 = Vector::ToCardinal(&local_154,(Vector *)(auStack_148 + 4)); puVar2 = puStack_20; if (0.94 < local_168.y * pVVar5->y + local_168.x * pVVar5->x) goto LAB_0049deaa; } } } else { LAB_0049deaa: Vector::ToCardinal(&scratchVec,(Vector *)(auStack_148 + 4)); npc->_mass = *(float *)((int)npc->_config + 0x44); npc->_state = 7; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadTrip",0); fVar9 = (npc->_velocity).x; (npc->_targetPosition).x = local_168.x; (npc->_targetPosition).y = local_168.y; (npc->_velocity).x = local_168.x * 5.0 + fVar9; (npc->_velocity).y = local_168.y * 5.0 + (npc->_velocity).y; if (ABS(scratchVec.x) <= ABS(scratchVec.y)) { ANM2::Play(&npc->_sprite,(byte *)"TripVert",0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = 0; } else { ANM2::Play(&npc->_sprite,(byte *)"TripHori",0); local_129 = scratchVec.x < 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = local_129; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); local_129 = layer->_flipX; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer->_flipX = local_129; puVar2 = puStack_20; } } else { puVar2 = puStack_20; if (((0x5a < npc->_projectileDelay) && (-1 < iVar8)) && (iVar8 < 0x2e)) { uVar4 = Random(); puVar2 = puStack_20; if (uVar4 % 0xf == 0) { animName = &DAT_00b1e72c; npc->_mass = *(float *)((int)npc->_config + 0x44); npc->_state = 6; npc->_projectileDelay = 0; goto LAB_0049f62a; } } } } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); pEStack_140 = (EntityPtr *)((tmpEntity->_pos).y - (npc->_pos).y); auStack_148._4_4_ = (tmpEntity->_pos).x - (npc->_pos).x; Vector::Normalized((Vector *)(auStack_148 + 4),&scratchVec); if ((100 < npc->_projectileDelay) || ((puVar2 = puStack_20, 0x1e < npc->_projectileDelay && (npc->_child == (EntityPtr)0x0)))) { npc->_mass = *(float *)((int)npc->_config + 0x44); npc->_state = 0xb; ANM2::Play(&npc->_sprite,(byte *)"RollBegin",0); local_130 = (EntityPtr *)cos(0.7853982); fVar9 = sin(0.7853982); pEStack_140 = (EntityPtr *)(scratchVec.y * (float)local_130 + scratchVec.x * fVar9); auStack_148._4_4_ = scratchVec.x * (float)local_130 - scratchVec.y * fVar9; pVVar5 = Vector::ToCardinal(&local_154,(Vector *)(auStack_148 + 4)); local_130 = (EntityPtr *)cos(-0.7853982); fVar10 = sin(-0.7853982); fVar11 = pVVar5->y * (float)local_130; local_130 = (EntityPtr *)(pVVar5->x * (float)local_130 - fVar10 * pVVar5->y); fVar9 = (npc->_velocity).y; local_138 = (EntityPtr)(fVar11 + fVar10 * pVVar5->x); fVar10 = (npc->_velocity).x; fVar9 = sqrtf(fVar10 * fVar10 + fVar9 * fVar9); (npc->_velocity).x = (float)local_130 * fVar9 * 0.6; (npc->_targetPosition).x = (float)local_130; (npc->_velocity).y = (float)local_138 * fVar9 * 0.6; (npc->_targetPosition).y = (float)local_138; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = 0; npc->_projectileDelay = 0; puVar2 = puStack_20; } } break; case 6: if (npc->_entityCollisionClass != 0) { npc->_friction = npc->_friction * 0.8; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar3 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130 = (EntityPtr *)(tmpEntity->_velocity).x; fVar10 = (npc->_pos).x - (tmpEntity->_pos).x; local_138 = (EntityPtr)(tmpEntity->_velocity).y; fVar9 = (npc->_pos).y - (tmpEntity->_pos).y; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); pVVar5 = &npc->_velocity; fVar10 = (((float)local_130 * fVar9 * 0.1 + (tmpEntity->_pos).x) - (npc->_pos).x) * 0.08; fVar9 = (((float)local_138 * fVar9 * 0.1 + (tmpEntity->_pos).y) - (npc->_pos).y) * 0.08; pVVar5->x = fVar10; (npc->_velocity).y = fVar9; fVar9 = sqrtf(fVar10 * fVar10 + fVar9 * fVar9); if (10.0 < fVar9) { Vector::Normalize(pVVar5); pVVar5->x = pVVar5->x * 10.0; (npc->_velocity).y = (npc->_velocity).y * 10.0; } npc->_friction = 1.0; npc->_entityCollisionClass = 0; Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { npc->_entityCollisionClass = 4; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (npc->_projectileDelay == 0) { Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Scale = 1.4; auStack_148._4_4_ = 0x41200000; pEStack_140 = (EntityPtr *)0x0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(auStack_148 + 4),8,&projectileParams); } else { Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); Game::ShakeScreen(g_game,0xc); local_138 = (EntityPtr)0xc2340000; local_168.y = (float)&DAT_00000004; do { uVar4 = Random(); local_13c = Game::Spawn(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar4); parentRef = &local_13c->_parent; if (local_13c->_parent != (EntityPtr)0x0) { local_130 = parentRef; std::multiset::erase(&local_130); } *parentRef = (EntityPtr)npc; std::multiset::insert(parentRef); local_168.y = (float)((int)local_168.y + -1); *(EntityPtr *)(local_13c[1]._sprite._animDefaultName._buf + 8) = local_138; local_138 = (EntityPtr)((float)local_138 + 90.0); } while ((undefined1 *)local_168.y != (undefined1 *)0x0); } npc->_projectileDelay = npc->_projectileDelay + 1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (puVar2 = puStack_20, (npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadIdle",0); *(undefined1 *)&(npc->_v2).x = 0xf; puVar2 = puStack_20; } break; case 7: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Game::ShakeScreen(g_game,6); npc->_variant = 1; Entity_NPC::PlaySound(npc,0x30,0.7,2,0,1.0); Entity_NPC::PlaySound(npc,0xed,1.0,2,0,1.0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); local_178.y = (layer->_pos).x; local_130 = (EntityPtr *)(layer->_pos).y; uVar4 = Random(); local_154.x = (npc->_targetPosition).x * 10.0; auStack_148._4_4_ = local_178.y / 0.65 + (npc->_pos).x; pEStack_140 = (EntityPtr *)((float)local_130 / 0.65 + (npc->_pos).y); local_154.y = (npc->_targetPosition).y * 10.0; tmpEntity = Game::Spawn(g_game,0x38e,2,(Vector *)(auStack_148 + 4),&local_154,(Entity *)0x0,0, uVar4); flagsHigh = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = flagsHigh; Entity::SetParent(tmpEntity,(Entity *)npc); Entity::SetChild((Entity *)npc,tmpEntity); tmpEntity->_health = npc->_health; fVar9 = (tmpEntity->_velocity).y; (tmpEntity->_targetPosition).x = (tmpEntity->_velocity).x * 0.1; (tmpEntity->_targetPosition).y = fVar9 * 0.1; Color::Color(&scratchColor); pEStack_140 = (EntityPtr *)(tmpEntity->_pos).y; local_154.x = 0.0; local_154.y = -48.0; auStack_148._4_4_ = (tmpEntity->_pos).x; spawn_blood_explosion(3,(Vector *)(auStack_148 + 4),&local_154,color,&g_vectorZero); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_visible = 0; } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar3 != 0) { npc->_friction = npc->_friction * 0.8; } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { npc->_state = 3; } goto LAB_0049f635; case 8: npc->_friction = npc->_friction * 0.8; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x13f,1.0,2,0,1.0); uVar4 = Random(); pVVar5 = &npc->_pos; auStack_148._4_4_ = 0; pEStack_140 = (EntityPtr *)0x41200000; tmpEntity = Game::Spawn(g_game,0x19,5,pVVar5,(Vector *)(auStack_148 + 4),(Entity *)npc,0,uVar4 ); flagsHigh = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = flagsHigh; (tmpEntity->_sprite)._scale.x = 0.5; (tmpEntity->_sprite)._scale.y = 0.5; tmpEntity->_entityCollisionClass = 0; tmpEntity[2]._posOffset.x = 2.24208e-44; fVar9 = pVVar5->x; fVar10 = (npc->_pos).y; tmpEntity[2]._prevVelocity.y = -8.0; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; (tmpEntity->_targetPosition).x = fVar9 + 0.0; (tmpEntity->_targetPosition).y = fVar10 + 10.0; Entity::SetChild((Entity *)npc,tmpEntity); auStack_148 = (undefined1 [8])((ulonglong)auStack_148 & 0xffffffff); pEStack_140 = (EntityPtr *)0xc2400000; effect = (Entity_Effect *) spawn_blood_explosion (3,pVVar5,(Vector *)(auStack_148 + 4),(ColorMod *)&DAT_00c34ed8, &g_vectorZero); Entity_Effect::FollowParent(effect,(Entity *)npc); } EVar6 = npc->_child; if (EVar6 != (EntityPtr)0x0) { fVar9 = (npc->_pos).y; *(float *)((int)EVar6 + 0x334) = (npc->_pos).x + 0.0; *(float *)((int)EVar6 + 0x338) = fVar9 + 10.0; } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if ((bVar3 != 0) && (npc->_child != (EntityPtr)0x0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); pEStack_140 = (EntityPtr *)((tmpEntity->_pos).y - (npc->_pos).y); auStack_148._4_4_ = (tmpEntity->_pos).x - (npc->_pos).x; Vector::Normalized((Vector *)(auStack_148 + 4),&scratchVec); Entity_NPC::PlaySound(npc,0x1e5,1.0,2,0,1.0); EVar6 = npc->_child; *(undefined4 *)((int)EVar6 + 0xb64) = 5; *(float *)((int)EVar6 + 0xe4) = g_vectorOne.x; *(float *)((int)EVar6 + 0xe8) = g_vectorOne.y; *(float *)((int)EVar6 + 0x334) = scratchVec.x * 15.0; *(float *)((int)EVar6 + 0x338) = scratchVec.y * 15.0; *(undefined4 *)((int)EVar6 + 0x188) = 4; *(float *)((int)EVar6 + 0x34c) = g_vectorZero.x; *(float *)((int)EVar6 + 0x350) = g_vectorZero.y; Entity::SetChild((Entity *)npc,(Entity *)0x0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || (puVar2 = puStack_20, (npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadIdle",0); *(undefined1 *)((int)&(npc->_v2).x + 1) = 0xf; puVar2 = puStack_20; } break; case 9: npc->_friction = 0.7; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); game = g_game; if (bVar3 != 0) { npc->_projectileDelay = 1; Game::ShakeScreen(game,8); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x134,1.0,2,0,1.0); } local_130 = (EntityPtr *)0x0; if (0 < (int)npc->_updateTime - (int)npc->_prevUpdateTime) { do { if (0 < npc->_projectileDelay) { uVar4 = npc->_projectileDelay + 1; npc->_projectileDelay = uVar4; if (((0 < (int)uVar4) && ((uVar4 & 1) == 0)) && ((int)uVar4 < 0x12)) { local_138 = (EntityPtr)(((float)(int)uVar4 - 0.0) / 22.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_168.y = (npc->_pos).x; local_13c = (Entity *)(npc->_pos).y; fVar9 = (float)local_13c - (tmpEntity->_pos).y; fVar10 = local_168.y - (tmpEntity->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); fVar9 = fVar9 * ((float)local_138 * 0.2 + 0.0); local_178.y = ((tmpEntity->_velocity).x * fVar9 + (tmpEntity->_pos).x) - local_168.y; local_13c = (Entity *) (((tmpEntity->_velocity).y * fVar9 + (tmpEntity->_pos).y) - (float)local_13c ); local_168.y = ((float)local_138 * 40.0 - 20.0) * 0.017453292; local_160 = cos(local_168.y); fVar9 = sin(local_168.y); pVVar5 = &npc->_pos; pEStack_140 = (EntityPtr *) (local_160 * (float)local_13c + fVar9 * local_178.y + (npc->_pos).y); scratchVec.x = (float)local_138 * 30.0 + 20.0; fVar9 = (local_160 * local_178.y - fVar9 * (float)local_13c) + pVVar5->x; auStack_148._4_4_ = fVar9; scratchVec.y = ((float)pEStack_140 - (npc->_pos).y) / scratchVec.x; scratchVec.x = (fVar9 - pVVar5->x) / scratchVec.x; local_160 = scratchVec.y; local_13c = (Entity *)scratchVec.x; fVar9 = sqrtf(scratchVec.y * scratchVec.y + scratchVec.x * scratchVec.x); if ((10.0 < fVar9) && (0.0 < fVar9)) { scratchVec.x = (float)local_13c * (10.0 / fVar9); scratchVec.y = local_160 * (10.0 / fVar9); local_160 = scratchVec.y; local_13c = (Entity *)scratchVec.x; } local_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f800000; local_30 = 0; local_40 = 0x3f333333; uStack_3c = 0x40000000; uStack_38 = 0x3f000000; uStack_34 = 0x3f800000; local_2c = 0; local_28 = 0; uVar4 = Random(); EVar6 = (EntityPtr)Game::Spawn(g_game,9,0,pVVar5,&scratchVec,(Entity *)npc,0,uVar4); fVar9 = (npc->_pos).y - (float)pEStack_140; fVar10 = (npc->_pos).x - (float)auStack_148._4_4_; local_168.y = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); fVar9 = sqrtf(local_160 * local_160 + (float)local_13c * (float)local_13c); local_168.y = local_168.y / fVar9; fVar9 = pow(0.9,local_168.y); iVar8 = *(int *)EVar6; fVar9 = (fVar9 - 1.0) * -9.491221; if (fVar9 <= 0.01) { fVar9 = 0.01; } *(void **)((int)EVar6 + 0x418) = (void *)0x40000000; *(float *)((int)EVar6 + 0x420) = 1.4; *(int *)((int)EVar6 + 0x438) = 2; *(int *)((int)EVar6 + 0x43c) = 0; ((std_vector *)((int)EVar6 + 0x414))->_begin = (void *)(((-5.0 - *(float *)((int)EVar6 + 0x410)) - (local_168.y - fVar9) * 21.0) / fVar9); (**(code **)(iVar8 + 0x3c))(&local_50,0xffffffff,0xff,0,1); uVar4 = Random(); local_13c = Game::Spawn(g_game,1000,0x99,(Vector *)(auStack_148 + 4),&g_vectorZero, (Entity *)0x0,10,uVar4); local_168.y = (float)&local_13c->_parent; if (local_13c->_parent != (EntityPtr)0x0) { local_178.y = local_168.y; std::multiset::erase(&local_178.y); } *(EntityPtr *)local_168.y = EVar6; std::multiset::insert(local_168.y); Color::Reset(&scratchColor); spawnedColor = &(local_13c->_sprite)._color; if (spawnedColor != (ColorMod *)&scratchColor) { spawnedColor->_tint[0] = 0.4; (local_13c->_sprite)._color._tint[1] = 1.0; (local_13c->_sprite)._color._tint[2] = 0.1; (local_13c->_sprite)._color._tint[3] = 1.0; (local_13c->_sprite)._color._colorize[0] = scratchColor._colorize[0]; (local_13c->_sprite)._color._colorize[1] = scratchColor._colorize[1]; (local_13c->_sprite)._color._colorize[2] = scratchColor._colorize[2]; (local_13c->_sprite)._color._colorize[3] = scratchColor._colorize[3]; *(undefined8 *)(local_13c->_sprite)._color._offset = scratchColor._offset._0_8_; (local_13c->_sprite)._color._offset[2] = scratchColor._offset[2]; } (**(code **)(*(int *)local_13c + 0xc))(); local_154.x = 0.0; local_178.y = -20.0 - (float)local_138 * 100.0; uVar4 = Random(); local_154.y = local_178.y - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)] ) * 2.3283064e-10 * 16.0; spawn_blood_explosion(3,&npc->_pos,&local_154,&g_colorGreenSplat,&g_vectorZero); } } local_130 = (EntityPtr *)&local_130->field_0x1; } while ((int)local_130 < (int)npc->_updateTime - (int)npc->_prevUpdateTime); } if (((npc->_sprite)._animState._animData == (void *)0x0) || (puVar2 = puStack_20, (npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadIdle",0); *(undefined1 *)((int)&(npc->_v2).x + 2) = 0xf; puVar2 = puStack_20; } break; case 10: iVar8 = npc->_projectileDelay; if (iVar8 < 0) { if ((iVar8 == -1) || (iVar8 == -3)) { npc->_friction = npc->_friction * 0.8; if (iVar8 == -3) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { npc->_state = 3; *(undefined1 *)((int)&(npc->_v2).y + 1) = 9; } goto LAB_0049f635; } } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x12f,1.0,2,0,1.0); npc->_projectileDelay = -2; (npc->_velocity).x = (npc->_velocity).x + 0.0; (npc->_velocity).y = (npc->_velocity).y + 5.0; } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); puVar2 = puStack_20; if (bVar3 != 0) { local_154.x = (npc->_pos).x + 0.0; local_154.y = (npc->_pos).y + 4.0; brimstoneLaser = Entity_Laser::ShootAngle(1,&local_154,90.0,0x1e,&g_vectorZero,(Entity *)npc,0); local_30 = 0; local_2c = 0; local_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f800000; local_28 = 0; brimstoneLaser->_renderDepthOffset = 1000.0; local_40 = 0x3fc00000; uStack_3c = 0x40000000; uStack_38 = 0x3f800000; uStack_34 = 0x3f800000; (**(code **)(*(int *)brimstoneLaser + 0x3c))(&local_50,0xffffffff,0xff,0,1,uVar4); (**(code **)(*(int *)brimstoneLaser + 0xc))(); Entity_NPC::SetRef_bec(npc,(Entity *)brimstoneLaser); npc->_projectileDelay = 0; puVar2 = puStack_20; } } else { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { ANM2::Play(&npc->_sprite,(byte *)"BrimstoneLoop",0); } bVar3 = npc->_collidesWithGrid; fVar9 = npc->_speedMultiplier; (npc->_velocity).x = fVar9 * 0.0 + (npc->_velocity).x; (npc->_velocity).y = (npc->_velocity).y - fVar9 * 2.0; if ((bVar3 == 0) || (pfVar7 = &(npc->_gridCollisionVelocity).y, 0.0 < *pfVar7 || *pfVar7 == 0.0)) goto LAB_0049f635; local_178.y = *(float *)&npc->_entityRef; if (((EntityPtr)local_178.y == (EntityPtr)0x0) || (*(int *)((int)local_178.y + 0x28) != 7)) { ANM2::Play(&npc->_sprite,(byte *)"BrimstoneEnd",0); } else { ANM2::Play(&npc->_sprite,(byte *)"BrimstoneEnd",0); *(undefined4 *)((int)local_178.y + 0x458) = 1; } Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); npc->_projectileDelay = -3; puVar2 = puStack_20; } break; case 0xb: if ((npc->_projectileDelay < 0) && (EVar6 != (EntityPtr)0x0)) { npc->_friction = npc->_friction * 0.7; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { npc->_state = 3; *(undefined1 *)&(npc->_v2).y = 0xf; } goto LAB_0049f635; } npc->_friction = npc->_friction * 0.8; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { ANM2::Play(&npc->_sprite,&DAT_00b1e758,0); } pVVar5 = &npc->_velocity; bVar3 = Vector::operator_ne(pVVar5,&g_vectorZero); if (bVar3 != 0) { Vector::Normalize(game); if (npc->_child == (EntityPtr)0x0) { fVar9 = 18.0; } else { fVar9 = 14.0; } (npc->_velocity).y = fVar9 * (npc->_velocity).y; pVVar5->x = fVar9 * pVVar5->x; } npc->_projectileDelay = npc->_projectileDelay + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); puVar2 = puStack_20; if (0x59 < npc->_projectileDelay) { uVar4 = Random(); puVar2 = puStack_20; if ((uVar4 % 0x14 == 0) && (npc->_child != (EntityPtr)0x0)) { npc->_projectileDelay = -1; animName = "RollEnd"; LAB_0049f62a: ANM2::Play(&npc->_sprite,(byte *)animName,0); puVar2 = puStack_20; } } break; case 0x10: npc->_friction = 0.8; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } EVar6 = npc->_child; if ((EVar6 != (EntityPtr)0x0) && (*(int *)((int)EVar6 + 0xb64) == 0x10)) { fVar9 = (npc->_pos).y; *(float *)((int)EVar6 + 0x360) = (npc->_pos).x - *(float *)((int)EVar6 + 0x33c); *(float *)((int)EVar6 + 0x364) = fVar9 - *(float *)((int)EVar6 + 0x340); } local_138 = EVar6; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (((bVar3 != 0) && (Entity_NPC::PlaySound(npc,0xfc,1.0,2,0,0.8), EVar6 != (EntityPtr)0x0)) && (*(int *)((int)EVar6 + 0xb64) == 0x10)) { *(undefined4 *)((int)EVar6 + 0x188) = 4; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_178.y = (tmpEntity->_pos).x; local_130 = (EntityPtr *)(tmpEntity->_pos).y; fVar10 = (npc->_pos).x - local_178.y; fVar9 = (npc->_pos).y - (float)local_130; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); EVar6 = local_138; local_154.x = (tmpEntity->_velocity).x * fVar9 * 0.3 + local_178.y; local_154.y = (tmpEntity->_velocity).y * fVar9 * 0.3 + (float)local_130; NpcHelper::chimera_charge_begin(&local_154); *(undefined1 *)((int)EVar6 + 0xbc1) = 1; *(undefined4 *)((int)EVar6 + 0x350) = 0xc1a00000; *(undefined1 *)((int)EVar6 + 0x171) = 1; *(float *)((int)EVar6 + 0x360) = *(float *)((int)EVar6 + 0x334) + *(float *)((int)EVar6 + 0x334); *(float *)((int)EVar6 + 0x364) = *(float *)((int)EVar6 + 0x338) + *(float *)((int)EVar6 + 0x338); } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { npc->_state = 3; *(undefined1 *)((int)&(npc->_v2).x + 3) = 0xf; } goto LAB_0049f635; } puStack_20 = puVar2; LAB_0049f635: tick = 0; iVar8 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (0 < iVar8) { local_131 = *(char *)&(npc->_v2).x; spitFlyCooldown = *(char *)((int)&(npc->_v2).x + 1); fallBackCooldown = *(char *)((int)&(npc->_v2).x + 2); throwHeadCooldown = *(char *)((int)&(npc->_v2).x + 3); rollCooldown = *(char *)&(npc->_v2).y; local_129 = *(char *)((int)&(npc->_v2).y + 1); do { if (local_131 != '\0') { local_131 = local_131 + -1; *(char *)&(npc->_v2).x = local_131; } if (spitFlyCooldown != '\0') { spitFlyCooldown = spitFlyCooldown + -1; *(char *)((int)&(npc->_v2).x + 1) = spitFlyCooldown; } if (fallBackCooldown != '\0') { fallBackCooldown = fallBackCooldown + -1; *(char *)((int)&(npc->_v2).x + 2) = fallBackCooldown; } if (throwHeadCooldown != '\0') { throwHeadCooldown = throwHeadCooldown + -1; *(char *)((int)&(npc->_v2).x + 3) = throwHeadCooldown; } if (rollCooldown != '\0') { rollCooldown = rollCooldown + -1; *(char *)&(npc->_v2).y = rollCooldown; } if (local_129 != '\0') { local_129 = local_129 + -1; *(byte *)((int)&(npc->_v2).y + 1) = local_129; } tick = tick + 1; iVar8 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); } while (tick < iVar8); } if (((npc->_variant == 0) && (npc->_projectileCooldown != -1000)) && (npc->_health / npc->_maxHitPoints < 0.5)) { npc->_projectileCooldown = -1000; npc->_health = npc->_maxHitPoints * 0.5; } pfVar7 = (npc->_damageEvents)._begin; damageEventsEnd = (npc->_damageEvents)._end; if (pfVar7 != damageEventsEnd) { do { if ((((uint)pfVar7[2] & 4) != 0) && (pfVar7[6] != 1.4013e-45)) { npc->_pendingDamage = npc->_pendingDamage - *pfVar7; *pfVar7 = 0.0; } damageEventsEnd = (npc->_damageEvents)._end; pfVar7 = pfVar7 + 0xe; } while (pfVar7 != damageEventsEnd); } if ((npc->_projectileCooldown == -1000) && (npc->_variant == 0)) { npc->_pendingDamage = 0.0; for (pfVar7 = (npc->_damageEvents)._begin; pfVar7 != damageEventsEnd; pfVar7 = pfVar7 + 0xe) { fVar9 = *pfVar7; *pfVar7 = fVar9 * 0.1; npc->_pendingDamage = fVar9 * 0.1 + npc->_pendingDamage; } } ExceptionList = local_1c; return; } //@@ 0049f870 NpcHelper::chimera_charge_begin /* DB: ? sets "ChargeBegin" (rewind), state 10, SoundEffects::Play 0x12d with champion pitch, normalizes (target - pos) into the charge direction; only caller NpcAI::ENTITY_CHIMERA_body */ void NpcHelper::chimera_charge_begin(float *param_1) { byte *pbVar1; Manager *pMVar2; byte bVar3; byte *pbVar4; uint uVar5; int in_ECX; char *pcVar6; bool bVar7; float fVar8; float fVar9; float in_XMM2_Da; float local_c; float local_8; pbVar1 = *(byte **)(in_ECX + 0x7c); if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pcVar6 = "ChargeBegin"; do { bVar3 = *pbVar4; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_0049f8b6: uVar5 = -(uint)bVar7 | 1; goto LAB_0049f8bb; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_0049f8b6; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0049f8bb: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x8c) != '\0')))) goto LAB_0049f8ee; } bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),(byte *)"ChargeBegin",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x78)); *(undefined1 *)(in_ECX + 0x8c) = 1; } LAB_0049f8ee: *(undefined4 *)(in_ECX + 0xb64) = 10; pMVar2 = g_manager; local_8 = 1.0; if (*(int *)(in_ECX + 0xc64) == 0x12) { local_8 = 1.5; } else if (*(int *)(in_ECX + 0xc64) == 0x13) { local_8 = 0.5; } local_c = 4.21791e-43; seed_fart_sound_override((int *)&local_c); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_c,1.0,2,0,local_8,0.0); fVar9 = *param_1 - *(float *)(in_ECX + 0x33c); local_c = param_1[1] - *(float *)(in_ECX + 0x340); fVar8 = sqrtf(fVar9 * fVar9 + local_c * local_c); if (0.0 < fVar8) { fVar9 = fVar9 * (1.0 / fVar8); local_c = local_c * (1.0 / fVar8); } *(undefined1 *)(in_ECX + 0xbc0) = 0; *(float *)(in_ECX + 0x334) = fVar9 * in_XMM2_Da; *(float *)(in_ECX + 0x338) = local_c * in_XMM2_Da; return; } //@@ 0049fa10 NpcAI::ENTITY_CHIMERA /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 910 (from dispatcher 006c2990) */ uint __fastcall NpcAI::ENTITY_CHIMERA(Entity_NPC *npc) { float fVar1; Vector pos; ANM2 *pAVar2; char cVar3; byte bVar4; Vector *targetPos; Vector *pVVar5; char *anim; uint uVar6; undefined3 extraout_var; int iVar7; undefined3 uVar10; ProjectileParams *params; EntityPtr *extraout_EAX; Entity *pEVar8; uint uVar9; Vector *extraout_ECX; int extraout_EDX; Game *game; float fVar11; EntityPtr *pEVar12; float fVar13; float fVar14; undefined1 auStack_178 [4]; Vector scratchPos; EntityPtr *pEStack_16c; Vector local_168; Vector local_160; char isCharging; float local_154; Vector VStack_150; float local_148; Vector *pVStack_144; Vector VStack_140; undefined4 uStack_138; undefined4 uStack_134; undefined4 uStack_130; undefined4 uStack_12c; undefined4 uStack_128; undefined4 uStack_124; undefined4 uStack_120; undefined4 uStack_11c; undefined4 uStack_118; undefined4 uStack_114; undefined4 uStack_110; undefined4 flashColor; undefined4 uStack_108; undefined4 uStack_104; undefined4 uStack_100; undefined4 local_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined4 local_ec; undefined4 local_e8; undefined4 local_e4; ProjectileParams projParams; Color poofColor; uint local_c; Manager *manager; EntityPtr parent; local_c = __security_cookie ^ (uint)auStack_178; local_148 = 6.0; switch(npc->_state) { case 0: (npc->_v2).x = 0.0; *(undefined2 *)&(npc->_v2).y = 0; npc->_state = 7; bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e7b0,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } break; case 3: npc->_friction = npc->_friction * 0.8; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (8 < npc->_stateFrame) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); scratchPos.x = (pEVar8->_pos).x; pVVar5 = &npc->_pos; scratchPos.y = (pEVar8->_pos).y; bVar4 = Room::CheckLine(g_game->_room,pVVar5,&scratchPos,3,0,0,0,(Vector *)0x0); if ((((bVar4 == 0) || (uVar6 = Random(), (uVar6 & 3) != 0)) || ((*(char *)&(npc->_v2).x != '\0' || ((npc->_parent != (EntityPtr)0x0 && (*(int *)((int)npc->_parent + 0xb64) != 3)))))) && (npc->_parent != (EntityPtr)0x0)) { uVar6 = Random(); if (((uVar6 % 10 == 0) || ((1 < npc->_i2 && (uVar6 = Random(), uVar6 % 3 == 0)))) || ((3 < npc->_i2 && (uVar6 = Random(), (uVar6 & 1) == 0)))) { local_154 = pVVar5->x; fVar13 = (npc->_pos).y - scratchPos.y; fVar13 = sqrtf(fVar13 * fVar13 + (local_154 - scratchPos.x) * (local_154 - scratchPos.x)); if ((fVar13 < 420.0) && ((npc->_parent == (EntityPtr)0x0 || (*(int *)((int)npc->_parent + 0xb64) == 3)))) { (npc->_sprite)._flipX = 0.0 < scratchPos.x - local_154; ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); npc->_state = 8; npc->_i2 = 0; npc->_stateFrame = -1; npc->_projectileCooldown = 0; break; } } bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if ((bVar4 == 0) && (bVar4 = Room::CheckLine(g_game->_room,pVVar5,&scratchPos,0,0,0,0,(Vector *)0x0), bVar4 == 0)) { local_154 = pVVar5->x; pVStack_144 = (Vector *)(npc->_pos).y; VStack_140.x = (npc->_velocity).x; VStack_150.x = (npc->_velocity).y; local_160.x = npc->_friction; PathFinder::Reset((PathFinder *)&npc->_pathfinder); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchPos,1.0,0,1); bVar4 = Vector::operator_ne(&npc->_velocity,&g_vectorZero); if (bVar4 == 0) { targetPos = Entity_NPC::CalcTargetPosition(npc,&local_168,0.0); pVVar5 = &npc->_velocity; pEStack_16c = (EntityPtr *)targetPos->x; local_168.x = targetPos->y; } else { pEStack_16c = (EntityPtr *)(extraout_ECX->x * 300.0 + (npc->_pos).x); local_168.x = extraout_ECX->y * 300.0 + (npc->_pos).y; pVVar5 = extraout_ECX; } (npc->_pos).x = local_154; (npc->_pos).y = (float)pVStack_144; pVVar5->x = VStack_140.x; pVVar5->y = VStack_150.x; npc->_friction = local_160.x; } else { pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_160,0.0); pEStack_16c = (EntityPtr *)pVVar5->x; local_168.x = pVVar5->y; } if (((float)pEStack_16c == scratchPos.x) && (local_168.x == scratchPos.y)) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); fVar13 = (npc->_pos).y - scratchPos.y; fVar11 = (npc->_pos).x - scratchPos.x; fVar13 = sqrtf(fVar13 * fVar13 + fVar11 * fVar11); local_160.x = (pEVar8->_velocity).x * 0.1 * fVar13 + (float)pEStack_16c; local_160.y = (pEVar8->_velocity).y * 0.1 * fVar13 + local_168.x; pos.y = local_160.y; pos.x = local_160.x; iVar7 = Room::GetGridCollisionAtPos(g_game->_room,pos); if (iVar7 == 0) { pEStack_16c = (EntityPtr *)local_160.x; local_168.x = local_160.y; } } npc->_stateFrame = -1; ANM2::Play(&npc->_sprite,s_Jump,0); npc->_i2 = npc->_i2 + 1; (npc->_v1).x = (float)pEStack_16c; (npc->_v1).y = local_168.x; npc->_state = 6; } else { (npc->_sprite)._flipX = 0.0 < scratchPos.x - pVVar5->x; ANM2::Play(&npc->_sprite,(byte *)"ChargeAnnounce",0); npc->_state = 9; npc->_i2 = 0; npc->_stateFrame = -1; } } break; case 6: if ((((npc->_sprite)._animState._animData == (void *)0x0) || (bVar4 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar4 == 0)) || (bVar4 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"), bVar4 != 0)) { npc->_entityCollisionClass = 4; npc->_friction = npc->_friction * 0.8; } else { npc->_entityCollisionClass = 0; scratchPos.x = (npc->_v1).x - (npc->_pos).x; scratchPos.y = (npc->_v1).y - (npc->_pos).y; pVVar5 = Vector::Normalized(&scratchPos,&VStack_150); fVar13 = npc->_friction; if (fVar13 == 0.0) { fVar11 = (npc->_velocity).x; } else { fVar11 = (npc->_speedMultiplier * pVVar5->x * 1.5) / fVar13 + (npc->_velocity).x; (npc->_velocity).y = (npc->_speedMultiplier * pVVar5->y * 1.5) / fVar13 + (npc->_velocity).y ; (npc->_velocity).x = fVar11; fVar13 = npc->_friction; } npc->_friction = fVar13 * 0.9; (npc->_sprite)._flipX = 0.0 < fVar11; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); npc->_stateFrame = 0; fVar13 = (npc->_velocity).y; (npc->_targetPosition).x = (npc->_velocity).x * 0.05; (npc->_targetPosition).y = fVar13 * 0.05; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_entityCollisionClass = 4; npc->_state = 3; npc->_stateFrame = 0; break; case 7: ANM2::Play(&npc->_sprite,&DAT_00b1e7b0,0); npc->_friction = npc->_friction * 0.93; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } break; case 8: npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar4 != 0)) { Entity_NPC::PlaySound(npc,0xb,1.0,2,0,1.0); npc->_stateFrame = 0; pEVar8 = Entity_NPC::GetPlayerTarget(npc); fVar13 = (pEVar8->_pos).y; (npc->_v1).x = (pEVar8->_pos).x; (npc->_v1).y = fVar13; } if (-1 < npc->_stateFrame) { iVar7 = npc->_projectileCooldown; if (iVar7 == 2) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); iVar7 = npc->_projectileCooldown; scratchPos.x = (pEVar8->_pos).x; scratchPos.y = (pEVar8->_pos).y; } else { scratchPos.x = (npc->_v1).x; scratchPos.y = (npc->_v1).y; } pVStack_144 = &scratchPos; local_154 = 0.0; local_160.x = (float)((uint)(iVar7 < 1) * 2 + 10); if (0 < (int)npc->_updateTime - (int)npc->_prevUpdateTime) { iVar7 = npc->_stateFrame; do { if ((iVar7 % 3 == 0) && (iVar7 < (int)local_160.x)) { pVVar5 = &npc->_pos; local_168.x = pVStack_144->x - pVVar5->x; pEStack_16c = (EntityPtr *)(pVStack_144->y - (npc->_pos).y); fVar13 = sqrtf(local_168.x * local_168.x + (float)pEStack_16c * (float)pEStack_16c); if (0.0 < fVar13) { local_168.x = local_168.x * (1.0 / fVar13); pEStack_16c = (EntityPtr *)((float)pEStack_16c * (1.0 / fVar13)); } uStack_138 = 0x3f800000; uStack_134 = 0x3f800000; uStack_130 = 0x3f800000; uStack_12c = 0x3f800000; uStack_118 = 0; uStack_114 = 0; uStack_128 = 0; uStack_124 = 0; uStack_120 = 0; uStack_11c = 0; uStack_110 = 0; if (npc->_projectileCooldown == 0) { ProjectileParams::ProjectileParams(&projParams); projParams.Spread = 1.5; projParams.Scale = 1.4; if (npc->_stateFrame != 0) { projParams.Scale = 1.0; } VStack_140.x = local_168.x * 8.0; projParams.FallingAccelModifier = -0.05; VStack_140.y = (float)pEStack_16c * 8.0; Entity_NPC::FireProjectiles(npc,pVVar5,&VStack_140,5,&projParams); } if ((npc->_sprite)._flipX == 0) { local_168.x = -6.0; } else { local_168.x = 6.0; } uVar6 = Random(); pEVar8 = Game::Spawn(g_game,1000,2,pVVar5,&g_vectorZero,(Entity *)0x0,3,uVar6); (**(code **)(*(int *)pEVar8 + 0x3c))(&uStack_138,0xffffffff,0xff,0,1); (pEVar8->_sprite)._offset.x = local_168.x; (pEVar8->_sprite)._offset.y = -10.0; pEVar8->_renderDepthOffset = 10.0; if (pEVar8->_parent != (EntityPtr)0x0) { VStack_150.x = (float)&pEVar8->_parent; std::multiset::erase(&VStack_150); } pEVar8->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar8->_parent); fVar13 = (pEVar8->_pos).x; fVar11 = (pEVar8->_pos).y; fVar14 = (npc->_pos).x; fVar1 = (npc->_pos).y; *(undefined1 *)&pEVar8[1]._sprite._filename._size = 1; pEVar8[1]._sprite._filename._capacity = (uint)(fVar13 - fVar14); *(float *)pEVar8[1]._sprite._animDefaultName._buf = fVar11 - fVar1; } npc->_stateFrame = npc->_stateFrame + 1; iVar7 = npc->_stateFrame; local_154 = (float)((int)local_154 + 1); } while ((int)local_154 < (int)npc->_updateTime - (int)npc->_prevUpdateTime); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; } break; case 9: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_160.x = (pEVar8->_pos).x; VStack_150.x = (pEVar8->_pos).y; fVar11 = (npc->_pos).x - local_160.x; fVar13 = (npc->_pos).y - VStack_150.x; fVar13 = sqrtf(fVar13 * fVar13 + fVar11 * fVar11); scratchPos.x = (pEVar8->_velocity).x * fVar13 * 0.05 + local_160.x; scratchPos.y = (pEVar8->_velocity).y * fVar13 * 0.05 + VStack_150.x; NpcHelper::chimera_charge_begin(&scratchPos); npc->_projectileDelay = 1; } break; case 10: fVar13 = (npc->_targetPosition).x; if ((fVar13 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { npc->_friction = 0.85; if ((npc->_projectileDelay < 3) || (anim = "ChargeEnd", npc->_parent == (EntityPtr)0x0)) { anim = "ChargeEndShort"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); *(undefined2 *)&npc->_i1 = 0; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if ((npc->_projectileDelay < 3) || (npc->_parent == (EntityPtr)0x0)) { parent = npc->_parent; if (((parent == (EntityPtr)0x0) || (cVar3 = FUN_0049d100(), cVar3 == '\0')) || (extraout_EDX != 2)) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); local_160.x = (pEVar8->_pos).x; VStack_150.x = (pEVar8->_pos).y; fVar11 = (npc->_pos).x - local_160.x; fVar13 = (npc->_pos).y - VStack_150.x; fVar13 = sqrtf(fVar13 * fVar13 + fVar11 * fVar11); scratchPos.x = (pEVar8->_velocity).x * fVar13 * 0.05 + local_160.x; scratchPos.y = (pEVar8->_velocity).y * fVar13 * 0.05 + VStack_150.x; NpcHelper::chimera_charge_begin(&scratchPos); npc->_projectileDelay = npc->_projectileDelay + 1; } else { local_160.x = *(float *)((int)parent + 0x33c); VStack_150.x = *(float *)((int)parent + 0x340); fVar11 = (npc->_pos).x - local_160.x; fVar13 = (npc->_pos).y - VStack_150.x; fVar13 = sqrtf(fVar13 * fVar13 + fVar11 * fVar11); scratchPos.x = *(float *)((int)parent + 0x360) * fVar13 * 0.1 + local_160.x; scratchPos.y = *(float *)((int)parent + 0x364) * fVar13 * 0.1 + VStack_150.x; NpcHelper::chimera_charge_begin(&scratchPos); *(undefined1 *)&npc->_i1 = 1; npc->_projectileDelay = npc->_projectileDelay + 1; } } else { npc->_state = 3; npc->_stateFrame = 0; } } } else { (npc->_sprite)._flipX = 0.0 < fVar13; npc->_friction = 0.93; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"ChargeLoop",0); } } break; case 0x10: if ((npc->_parent == (EntityPtr)0x0) || (*(int *)((int)npc->_parent + 0xb64) != 0x10)) { npc->_entityCollisionClass = 4; npc->_state = 7; ANM2::Play(&npc->_sprite,&DAT_00b1e7b0,0); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; (npc->_posOffset).y = 0.0; npc->_visible = 1; } } if (npc->_state != 0x10) { npc->_visible = 1; } fVar13 = npc->_aiFloat; fVar11 = fVar13 + (npc->_posOffset).y; (npc->_posOffset).y = fVar11; if (0.0 <= fVar11) { (npc->_posOffset).y = 0.0; if (fVar13 <= 1.5) { fVar13 = 0.0; } else { fVar13 = fVar13 * -0.2; } } game = g_game; uVar6 = (uint)npc->_flags & 0x4000; npc->_aiFloat = fVar13 + 1.1; if (uVar6 == 0) { bVar4 = Game::IsPaused(game); uVar6 = CONCAT31(extraout_var,bVar4); if (bVar4 == 0) { iVar7 = (int)((npc->_prevUpdateTime + 0.0) / -10.0) - (int)((npc->_updateTime + 0.0) / -10.0); uVar6 = 0; if (iVar7 != 0) { cVar3 = *(char *)&(npc->_v2).x; uVar10 = (undefined3)((uint)iVar7 >> 8); if (cVar3 != '\0') { *(char *)&(npc->_v2).x = cVar3 + -1; } cVar3 = *(char *)((int)&(npc->_v2).x + 1); if (cVar3 != '\0') { *(char *)((int)&(npc->_v2).x + 1) = cVar3 + -1; } cVar3 = *(char *)((int)&(npc->_v2).x + 2); if (cVar3 != '\0') { *(char *)((int)&(npc->_v2).x + 2) = cVar3 + -1; } cVar3 = *(char *)((int)&(npc->_v2).x + 3); if (cVar3 != '\0') { *(char *)((int)&(npc->_v2).x + 3) = cVar3 + -1; } cVar3 = *(char *)&(npc->_v2).y; if (cVar3 != '\0') { *(char *)&(npc->_v2).y = cVar3 + -1; } cVar3 = *(char *)((int)&(npc->_v2).y + 1); uVar6 = CONCAT31(uVar10,cVar3); if (cVar3 != '\0') { uVar6 = CONCAT31(uVar10,cVar3 + -1); *(char *)((int)&(npc->_v2).y + 1) = cVar3 + -1; } } } } if ((npc->_targetPosition).x == g_vectorZero.x) { fVar13 = (npc->_targetPosition).y; if (fVar13 == g_vectorZero.y) { return CONCAT22((short)(uVar6 >> 0x10), CONCAT11((fVar13 == g_vectorZero.y) << 6 | (NAN(fVar13) || NAN(g_vectorZero.y)) << 2 | 2U | fVar13 < g_vectorZero.y,(char)uVar6)); } } fVar13 = npc->_friction; if (fVar13 < 0.93) { fVar13 = 0.93; } npc->_friction = fVar13; isCharging = *(char *)((int)&npc->_i1 + 1); cVar3 = isCharging; if ((isCharging != '\0') && ((npc->_flags & 0x4000) == 0)) { bVar4 = Game::IsPaused(game); cVar3 = isCharging; if (bVar4 == 0) { if ((int)((npc->_prevUpdateTime + 0.0) / -5.0) != (int)((npc->_updateTime + 0.0) / -5.0)) { flashColor = 0x3f800000; uStack_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_100 = 0x3f800000; local_ec = 0x3f400000; local_e8 = 0; local_e4 = 0; local_fc = 0; uStack_f8 = 0; uStack_f4 = 0; uStack_f0 = 0; (**(code **)(*(int *)npc + 0x3c))(&flashColor,4,0xff,1,1); cVar3 = *(char *)((int)&npc->_i1 + 1); game = g_game; } } else { } } if (npc->_collidesWithGrid != 0) { if (cVar3 != '\0') { Game::ShakeScreen(game,10); params = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireBossProjectiles(npc,0x14,&g_vectorZero,0.0,params); manager = g_manager; local_168.x = 1.0; if (npc->_championColorIdx == 0x12) { local_168.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_168.x = 0.5; } local_154 = 6.72623e-44; seed_fart_sound_override((int *)&local_154); SoundEffects::Play(&manager->_sfxManager,(int)local_154,1.0,2,0,local_168.x,0.0); Color::Color(&poofColor); if ((npc->_sprite)._flipX == 0) { local_148 = -6.0; } local_160.x = (float)extraout_EAX; uVar6 = Random(); pEVar8 = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,4,uVar6); (**(code **)(*(int *)pEVar8 + 0x3c))(local_160.x,0xffffffff,0xff,0,1); (pEVar8->_sprite)._offset.x = local_148; (pEVar8->_sprite)._offset.y = -10.0; pEVar8->_renderDepthOffset = 10.0; if (pEVar8->_parent != (EntityPtr)0x0) { local_160.x = (float)&pEVar8->_parent; std::multiset::erase(&local_160); } pEVar8->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar8->_parent); fVar13 = (pEVar8->_pos).x; fVar11 = (pEVar8->_pos).y; fVar14 = (npc->_pos).x; fVar1 = (npc->_pos).y; *(undefined1 *)&pEVar8[1]._sprite._filename._size = 1; pEVar8[1]._sprite._filename._capacity = (uint)(fVar13 - fVar14); *(float *)pEVar8[1]._sprite._animDefaultName._buf = fVar11 - fVar1; (npc->_v1).x = -8.0; } manager = g_manager; local_168.x = 1.0; if (npc->_championColorIdx == 0x12) { local_168.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_168.x = 0.5; } local_148 = 1.00893e-43; seed_fart_sound_override((int *)&local_148); SoundEffects::Play(&manager->_sfxManager,(int)local_148,1.0,2,0,local_168.x,0.0); local_168.x = (npc->_velocity).x; pEStack_16c = (EntityPtr *)(npc->_velocity).y; fVar13 = sqrtf(local_168.x * local_168.x + (float)pEStack_16c * (float)pEStack_16c); if (0.0 < fVar13) { local_168.x = local_168.x * (1.0 / fVar13); pEStack_16c = (EntityPtr *)((float)pEStack_16c * (1.0 / fVar13)); } fVar13 = (npc->_targetPosition).y; fVar11 = (npc->_targetPosition).x; fVar13 = sqrtf(fVar11 * fVar11 + fVar13 * fVar13); (npc->_targetPosition).x = local_168.x * fVar13 * 0.5; (npc->_targetPosition).y = (float)pEStack_16c * fVar13 * 0.5; *(undefined1 *)((int)&npc->_i1 + 1) = 0; } iVar7 = npc->_state; fVar14 = (npc->_velocity).x + (npc->_targetPosition).x; local_160.x = (npc->_targetPosition).x * 0.95; pEVar12 = (EntityPtr *)((npc->_targetPosition).y * 0.95); (npc->_velocity).x = fVar14; fVar11 = (npc->_targetPosition).y + (npc->_velocity).y; (npc->_targetPosition).x = local_160.x; (npc->_targetPosition).y = (float)pEVar12; (npc->_velocity).y = fVar11; fVar13 = local_160.x; if (iVar7 == 10) { VStack_150.x = (float)pEVar12; VStack_140.x = local_160.x; fVar13 = sqrtf(fVar11 * fVar11 + fVar14 * fVar14); if (8.0 <= fVar13) { pEVar12 = (EntityPtr *)VStack_150.x; fVar13 = VStack_140.x; } else { (npc->_targetPosition).x = local_160.x * 0.95; pEVar12 = (EntityPtr *)((npc->_targetPosition).y * 0.95); (npc->_targetPosition).y = (float)pEVar12; fVar13 = (npc->_targetPosition).x; } } fVar13 = sqrtf((float)pEVar12 * (float)pEVar12 + fVar13 * fVar13); if (fVar13 < 0.1) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } if ((*(char *)((int)&npc->_i1 + 1) != '\0') && (uVar6 = Random(), (uVar6 & 3) == 0)) { params = ProjectileParams::ProjectileParams(&projParams); scratchPos.x = (npc->_pos).x - (npc->_velocity).x * 4.0; scratchPos.y = (npc->_pos).y - (npc->_velocity).y * 4.0; uVar6 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar6 & 1) + 1,&scratchPos,0.0,params); } uVar6 = Random(); uVar9 = uVar6 / 3; if (uVar6 % 3 == 0) { uVar6 = Random(); pEVar8 = Game::SpawnEx(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6,0); iVar7 = *(int *)pEVar8; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[8] = '\x1e'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x1e'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; uVar9 = (**(code **)(iVar7 + 0xc))(); } return uVar9; } //@@ 004a1000 NpcHelper::chimera_render_child /* DB: ? Entity_NPC::Render when type 0x38e (910 Chimera) variant 1 state 16: renders the child (+0x3c0) at sprite layer 2 frame position/scale (flipX-aware) via its vtable +0x14 Render, then restores its fields */ void NpcHelper::chimera_render_child(undefined4 param_1) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int *piVar7; void *pvVar8; LayerState *pLVar9; int in_ECX; uint uVar10; if (((((*(int *)(in_ECX + 0x28) == 0x38e) && (*(int *)(in_ECX + 0x2c) == 1)) && (*(int *)(in_ECX + 0xb64) == 0x10)) && ((piVar7 = *(int **)(in_ECX + 0x3c0), piVar7 != (int *)0x0 && (piVar7[0x2d9] == 0x10)))) && (*(char *)((int)piVar7 + 0x171) == '\0')) { pvVar8 = AnimationState::GetLayerFrame((AnimationState *)(in_ECX + 0x78),2); if ((pvVar8 != (void *)0x0) && (*(char *)((int)pvVar8 + 0x2c) != '\0')) { iVar1 = piVar7[0xcf]; iVar2 = piVar7[0x37]; iVar3 = piVar7[0x38]; iVar4 = piVar7[0x39]; iVar5 = piVar7[0x3a]; piVar7[0xcf] = *(int *)(in_ECX + 0x33c); piVar7[0xd0] = *(int *)(in_ECX + 0x340); iVar6 = *(int *)((int)pvVar8 + 0x14); pLVar9 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x48),(byte *)0x2); uVar10 = *(uint *)((int)pvVar8 + 0x10); if (pLVar9->_flipX != 0) { uVar10 = uVar10 ^ 0x80000000; } piVar7[0x37] = uVar10; piVar7[0x38] = iVar6; piVar7[0x39] = *(int *)((int)pvVar8 + 0x18); piVar7[0x3a] = *(int *)((int)pvVar8 + 0x1c); *(undefined1 *)((int)piVar7 + 0x171) = 1; (**(code **)(*piVar7 + 0x14))(param_1); piVar7[0x39] = iVar6; piVar7[0x3a] = iVar4; piVar7[0x37] = iVar5; piVar7[0x38] = iVar2; piVar7[0xcf] = iVar3; *(undefined1 *)((int)piVar7 + 0x171) = 0; piVar7[0xd0] = iVar1; } } return; } //@@ 004a11b0 FUN_004a11b0 void FUN_004a11b0(void) { int *in_ECX; *in_ECX = *in_ECX + 0x38; return; } //@@ 004a11c0 std::vector<8byte>::_Emplace_reallocate /* DB: grow 1.5x, insert 8-byte element, memmove halves */ undefined4 * std::vector<8byte>::_Emplace_reallocate(void *param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; void *pvVar5; int iVar6; void *_Dst; void *ptr; int *in_ECX; uint uVar7; uint uVar8; iVar3 = *in_ECX; iVar6 = in_ECX[1] - iVar3 >> 3; if (iVar6 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar6 + 1; uVar7 = in_ECX[2] - iVar3 >> 3; if (0x1fffffff - (uVar7 >> 1) < uVar7) { uVar8 = 0x1fffffff; } else { uVar7 = (uVar7 >> 1) + uVar7; uVar8 = uVar1; if (uVar1 <= uVar7) { uVar8 = uVar7; } if (0x1fffffff < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar8 * 8); puVar2 = (undefined4 *)((int)_Dst + ((int)param_1 - iVar3 >> 3) * 8); uVar4 = param_2[1]; *puVar2 = *param_2; puVar2[1] = uVar4; pvVar5 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar5,in_ECX[1] - (int)pvVar5); } else { memmove(_Dst,pvVar5,(int)param_1 - (int)pvVar5); memmove(puVar2 + 2,param_1,in_ECX[1] - (int)param_1); } pvVar5 = (void *)*in_ECX; if (pvVar5 != (void *)0x0) { uVar7 = in_ECX[2] - (int)pvVar5 & 0xfffffff8; ptr = pvVar5; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar5 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + uVar1 * 8); in_ECX[2] = (int)(uVar8 * 8 + (int)_Dst); return puVar2; } //@@ 004a12f0 NpcAI::ENTITY_CLOG /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 914 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CLOG(Entity_NPC *npc) { float fVar1; RNG rng; char cVar2; byte bVar3; uint uVar4; EntityPtr enemyCount; Entity_NPC *pEVar5; Vector *vecResult; Entity *spawnedEffect; int animFrame; void *pvVar6; uint uVar7; uint uVar8; Entity *tmpEntity; float *pfVar9; int iVar10; EntityPtr EVar11; float spinSpeed; float fVar12; float fVar13; ColorMod splatColor; uint pickerSeed; undefined1 auStack_13c [8]; float fStack_134; Vector *npcPos; float suctionCap; float suctionRamp; Vector local_124; float local_11c; Vector local_118; float local_110; float local_10c; float local_108; float local_104; char isSlowSpin; Entity *local_fc; undefined1 local_f8 [12]; EntityPtr local_ec; float local_e8; Vector local_e4; Entity_NPC *local_dc; float local_d8; EntityPtr local_d4; ProjectileParams projParams; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; char *animName; undefined4 flagsHigh; Manager *manager; int *outcomeWeight; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af2f8b; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)&(&projParams)[1].Spread; ExceptionList = &local_1c; local_dc = npc; stackCookie = uVar4; pfVar9 = (&projParams)[1].Color._tint + 2; switch(npc->_state) { case 0: npc->_state = 3; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; splatColor._colorize[0] = 0.0; splatColor._colorize[1] = 0.0; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 0.0; splatColor._tint[0] = 0.0; splatColor._tint[1] = 0.0; splatColor._tint[2] = 0.0; splatColor._tint[3] = 1.0; splatColor._offset[0] = 0.25490198; splatColor._offset[1] = 0.16078432; splatColor._offset[2] = 0.13725491; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); Color::operator_assign((Color *)&npc->_splatColor,&splatColor); npc->_stateFrame = 0; npc->_projectileDelay = 0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_i2 = 0; npc->_entityGridCollisionClass = 3; pfVar9 = (float *)puStack_20; break; case 3: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,s_Idle,0); uVar8 = Random(); EVar11 = (EntityPtr)(uVar8 % 10); pfVar9 = (float *)puStack_20; if (EVar11 == (EntityPtr)0x0) { local_f8._8_4_ = (EntityPtr)0x0; local_14 = 0.0; enemyCount = (EntityPtr) (*(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4)); local_d4 = (EntityPtr)0x0; if (0 < (int)enemyCount) { local_d4 = enemyCount; } pEVar5 = (Entity_NPC *)((5 - (int)local_d4) * 0x28); local_f8._4_4_ = EVar11; local_ec = EVar11; if (0 < (int)pEVar5) { local_e4.x = 1.12104e-44; local_e4.y = (float)pEVar5; std::vector<8byte>::_Emplace_reallocate(0,&local_e4); } local_dc = (Entity_NPC *)((int)local_d4 * 0x14); if (((int)local_dc < 0x3c) || (*(char *)((int)&npc->_i2 + 1) != '\0')) { local_dc = (Entity_NPC *)0x1; } uVar8 = 0; uVar7 = (int)(local_f8._8_4_ - local_f8._4_4_) >> 3; if (uVar7 != 0) { do { if (*(int *)(local_f8._4_4_ + uVar8 * 8) == 9) { outcomeWeight = (undefined4 *)(local_f8._4_4_ + 4) + uVar8 * 2; *outcomeWeight = (int)(&(local_dc->_sprite)._filename + -3) + *outcomeWeight; if (*outcomeWeight < 0) { ((undefined4 *)(local_f8._4_4_ + 4))[uVar8 * 2] = 0; } goto LAB_004a1556; } uVar8 = uVar8 + 1; } while (uVar8 < uVar7); } if (0 < (int)local_dc) { local_e4.x = 1.26117e-44; local_e4.y = (float)local_dc; if ((EntityPtr)local_f8._8_4_ == local_ec) { std::vector<8byte>::_Emplace_reallocate(local_f8._8_4_,&local_e4); } else { *(undefined4 *)local_f8._8_4_ = 9; *(Entity_NPC **)(local_f8._8_4_ + 4) = local_dc; local_f8._8_4_ = local_f8._8_4_ + 8; } } LAB_004a1556: uVar7 = (int)(local_f8._8_4_ - local_f8._4_4_) >> 3; local_dc = (Entity_NPC *) ((-(uint)(*(char *)((int)&npc->_i2 + 2) != '\0') & 0xffffffe3) + 0x1e); uVar8 = 0; if (uVar7 != 0) { do { if (*(int *)(local_f8._4_4_ + uVar8 * 8) == 10) { outcomeWeight = (undefined4 *)(local_f8._4_4_ + 4) + uVar8 * 2; *outcomeWeight = (int)(&(local_dc->_sprite)._filename + -3) + *outcomeWeight; if (*outcomeWeight < 0) { ((undefined4 *)(local_f8._4_4_ + 4))[uVar8 * 2] = 0; } goto LAB_004a15f2; } uVar8 = uVar8 + 1; } while (uVar8 < uVar7); } local_e4.x = 1.4013e-44; local_e4.y = (float)local_dc; if ((EntityPtr)local_f8._8_4_ == local_ec) { std::vector<8byte>::_Emplace_reallocate(local_f8._8_4_,&local_e4); } else { *(undefined4 *)local_f8._8_4_ = 10; *(Entity_NPC **)(local_f8._8_4_ + 4) = local_dc; local_f8._8_4_ = local_f8._8_4_ + 8; } LAB_004a15f2: uVar7 = (int)(local_f8._8_4_ - local_f8._4_4_) >> 3; local_dc = (Entity_NPC *) ((-(uint)(*(char *)((int)&npc->_i2 + 3) != '\0') & 0xffffffe3) + 0x1e); uVar8 = 0; if (uVar7 != 0) { do { if (*(int *)(local_f8._4_4_ + uVar8 * 8) == 0xb) { outcomeWeight = (undefined4 *)(local_f8._4_4_ + 4) + uVar8 * 2; *outcomeWeight = (int)(&(local_dc->_sprite)._filename + -3) + *outcomeWeight; if (*outcomeWeight < 0) { ((undefined4 *)(local_f8._4_4_ + 4))[uVar8 * 2] = 0; } goto LAB_004a167b; } uVar8 = uVar8 + 1; } while (uVar8 < uVar7); } local_e4.x = 1.54143e-44; local_e4.y = (float)local_dc; if ((EntityPtr)local_f8._8_4_ == local_ec) { std::vector<8byte>::_Emplace_reallocate(local_f8._8_4_,&local_e4); } else { *(undefined4 *)local_f8._8_4_ = 0xb; *(Entity_NPC **)(local_f8._8_4_ + 4) = local_dc; local_f8._8_4_ = local_f8._8_4_ + 8; } LAB_004a167b: pickerSeed = Random(); pickerSeed = pickerSeed | 1; auStack_13c = (undefined1 [8])0x900000005; fStack_134 = 9.80909e-45; rng._shift1 = 5; rng._seed = pickerSeed; rng._shift2 = 9; rng._shift3 = 7; uVar8 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)(local_f8 + 4),rng); npc->_state = uVar8; if (uVar8 == 9) { uVar8 = Random(); npc->_i1 = uVar8 & 1; } else if (uVar8 == 10) { uVar8 = Random(); (npc->_v1).x = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar8 = Random(); if ((uVar8 & 1) == 0) { uVar8 = Random(); if ((uVar8 & 1) == 0) { spinSpeed = -10.0; } else { spinSpeed = 10.0; } } else { uVar8 = Random(); if ((uVar8 & 1) == 0) { spinSpeed = (float)&DAT_c1c80000; } else { spinSpeed = 25.0; } } (npc->_v1).y = spinSpeed; } local_14 = -NAN; npc->_stateFrame = 0; pfVar9 = (float *)puStack_20; if ((EntityPtr)local_f8._4_4_ != (EntityPtr)0x0) { uVar8 = ((int)local_ec - local_f8._4_4_ >> 3) * 8; EVar11 = (EntityPtr)local_f8._4_4_; if (0xfff < uVar8) { EVar11 = *(EntityPtr *)(local_f8._4_4_ + -4); uVar8 = uVar8 + 0x23; if (0x1f < (local_f8._4_4_ - (int)EVar11) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar11,uVar8); pfVar9 = (float *)puStack_20; } } break; case 8: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,&DAT_00b1d47c,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { uVar8 = Random(); local_d4 = (EntityPtr) (((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 90.0 - 45.0) * 0.017453292); local_104 = cos((float)local_d4); fVar13 = sin((float)local_d4); local_d8 = local_104 * 0.0 - fVar13; local_e8 = fVar13 * 0.0 + local_104; uVar8 = Random(); local_e4.x = local_d8 * 10.0 + (npc->_pos).x; local_e4.y = local_e8 * 10.0 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,0x366,0,&local_e4,&g_vectorZero,(Entity *)npc,0,uVar8); uVar8 = Random(); fVar13 = tmpEntity->_friction; fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; if (fVar13 != 0.0) { fVar1 = tmpEntity->_speedMultiplier; (tmpEntity->_velocity).y = (fVar1 * fVar12 * local_e8) / fVar13 + (tmpEntity->_velocity).y ; (tmpEntity->_velocity).x = (fVar1 * fVar12 * local_d8) / fVar13 + (tmpEntity->_velocity).x ; } flagsHigh = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = flagsHigh; iVar10 = *(int *)tmpEntity; tmpEntity[2]._posOffset.x = 5.60519e-45; (**(code **)(iVar10 + 0xc))(); uVar8 = Random(); local_118.x = (tmpEntity->_velocity).x; local_118.y = (tmpEntity->_velocity).y; local_124.x = (tmpEntity->_pos).x; local_124.y = (tmpEntity->_pos).y; tmpEntity = Game::Spawn(g_game,1000,2,&local_124,&local_118,(Entity *)0x0,1,uVar8); uVar8 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0; ANM2::Play(&tmpEntity->_sprite,&DAT_00b1d534,0); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -40.0; tmpEntity->_renderZOffset = 500; Sprite::SetColor((Sprite *)&tmpEntity->_sprite,(ColorMod *)&DAT_00c33c44); npc = local_dc; Entity_NPC::PlaySound(local_dc,0x12f,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (pfVar9 = (float *)puStack_20, (npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 3; pfVar9 = (float *)puStack_20; break; case 9: if (npc->_stateFrame != 0) { if (npc->_stateFrame < 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || (pfVar9 = (&projParams)[1].Color._tint + 2, (npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(undefined1 *)((int)&npc->_i2 + 1) = 0x5a; pfVar9 = (&projParams)[1].Color._tint + 2; } break; } animName = "SpinLoop2"; if (npc->_i1 == 0) { animName = "SpinLoop"; } puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)animName,0); npc->_stateFrame = npc->_stateFrame + 1; manager = g_manager; if (npc->_stateFrame == 5) { local_d8 = 6.83834e-43; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,0x1e,0,1.0,0.0); } npcPos = &npc->_pos; vecResult = Room::GetCenterPos((Vector *)(local_f8 + 8)); local_e4.x = (npc->_pos).x - vecResult->x; local_e4.y = (npc->_pos).y - vecResult->y; fVar13 = sqrtf(local_e4.x * local_e4.x + local_e4.y * local_e4.y); if (80.0 < fVar13) { vecResult = Vector::Normalized(&local_e4,(Vector *)(local_f8 + 8)); fVar13 = npc->_friction; fVar12 = vecResult->y; if (fVar13 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).x = ((vecResult->x + vecResult->x) * fVar1) / fVar13 + (npc->_velocity).x ; (npc->_velocity).y = ((fVar12 + fVar12) * fVar1) / fVar13 + (npc->_velocity).y; } } suctionCap = 1.5; suctionRamp = (float)npc->_stateFrame / 15.0; pfVar9 = &suctionRamp; if (1.5 <= suctionRamp) { pfVar9 = &suctionCap; } if (npc->_i1 == 0) { local_104 = 90.0; } else { local_104 = -90.0; } local_118.y = (float)pfVar9; if ((4 < npc->_stateFrame) && (bVar3 = Entity::IsFrame((Entity *)npc,8,0), bVar3 != 0)) { uVar8 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8e,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar8); uVar8 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0; (tmpEntity->_sprite)._flipX = local_dc->_i1 == 0; uVar8 = Random(); iVar10 = *(int *)tmpEntity; fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.0; fVar13 = fVar12 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar12 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar13; (**(code **)(iVar10 + 0xc))(); npc = local_dc; } local_d4 = (EntityPtr)0x0; local_e4.y = (float)g_game->_room; if (((Entity_NPC *)((int)local_e4.y + 0xf54))->_iceFrozenEffect != (EntityPtr)0x0) { do { tmpEntity = *(Entity **) ((int)(((Entity_NPC *)((int)local_e4.y + 0xf54))->_knockbackDirection).x + (int)local_d4 * 4); iVar10 = tmpEntity->_type; local_fc = tmpEntity; if ((((iVar10 == 1) || (iVar10 - 10U < 0x3de)) || (iVar10 == 5)) || (iVar10 == 4)) { cVar2 = (**(code **)(*(int *)tmpEntity + 0x4c))(); if ((cVar2 == '\0') && ((tmpEntity->_entityGridCollisionClass == 5 || (tmpEntity->_entityGridCollisionClass == 6)))) { local_e8 = npcPos->x - (tmpEntity->_pos).x; local_d8 = npcPos->y - (tmpEntity->_pos).y; fVar13 = sqrtf(local_e8 * local_e8 + local_d8 * local_d8); if (0.0 < fVar13) { local_d8 = local_d8 * (1.0 / fVar13); local_e8 = local_e8 * (1.0 / fVar13); } local_10c = local_e8 * 0.4; local_110 = local_d8 * 0.4; local_11c = local_104 * 0.017453292; local_108 = cos(local_11c); fVar13 = sin(local_11c); local_11c = *pfVar9 * ((local_e8 * local_108 - local_d8 * fVar13) * 0.8 + local_10c); local_124.y = *pfVar9 * ((local_e8 * fVar13 + local_d8 * local_108) * 0.8 + local_110) ; (tmpEntity->_velocity).x = (tmpEntity->_velocity).x + local_11c; (tmpEntity->_velocity).y = local_124.y + (tmpEntity->_velocity).y; bVar3 = Entity::IsFrame(tmpEntity,3,0); if ((bVar3 != 0) && ((tmpEntity->_type == 1 || (tmpEntity->_type - 10U < 0x3de)))) { uVar8 = Random(); tmpEntity = local_fc; local_e8 = (float)(uVar8 % 3 + 2); if (local_e8 != 0.0) { do { local_10c = (tmpEntity->_pos).x; local_108 = (tmpEntity->_pos).y; uVar8 = Random(); fVar13 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc = (Entity *)(fVar13 + fVar13); local_110 = sin((float)local_fc); local_d8 = tmpEntity->_size; fVar13 = cos((float)local_fc); local_fc = (Entity *)(fVar13 * local_d8); local_d8 = local_d8 * local_110; uVar8 = Random(); fVar13 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_ec = (EntityPtr)(fVar13 * local_d8 + local_108); local_f8._8_4_ = fVar13 * (float)local_fc + local_10c; uVar8 = Random(); uVar7 = Random(); local_110 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 4.0; local_108 = local_110 * local_124.y; local_110 = local_110 * local_11c; uVar7 = Random(); fVar13 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc = (Entity *)(fVar13 + fVar13); local_10c = sin((float)local_fc); fVar13 = cos((float)local_fc); fStack_134 = local_10c + local_108; auStack_13c._4_4_ = fVar13 + local_110; spawnedEffect = Game::Spawn(g_game,1000,99,(Vector *)(local_f8 + 8), (Vector *)(auStack_13c + 4),tmpEntity,1,uVar8); (**(code **)(*(int *)spawnedEffect + 0xc))(); local_e8 = (float)((int)local_e8 + -1); } while (local_e8 != 0.0); local_e8 = 0.0; pfVar9 = (float *)local_118.y; } } } } local_d4 = (EntityPtr)((int)local_d4 + 1); } while ((uint)local_d4 < (uint)((Entity_NPC *)((int)local_e4.y + 0xf54))->_iceFrozenEffect) ; npc = local_dc; } pfVar9 = (float *)puStack_20; if (npc->_stateFrame < 0x5b) break; pvVar6 = (npc->_sprite)._animState._animData; if (pvVar6 == (void *)0x0) { iVar10 = 0; } else { iVar10 = *(int *)((int)pvVar6 + 0x30); } animFrame = ANM2::GetFrame(&npc->_sprite); pfVar9 = (float *)puStack_20; if (animFrame != iVar10 + -1) break; animName = "SpinEnd2"; if (npc->_i1 == 0) { animName = "SpinEnd"; } LAB_004a2281: ANM2::Play(&npc->_sprite,(byte *)animName,0); npc->_stateFrame = -1; pfVar9 = (float *)puStack_20; break; } animName = "SpinBegin2"; if (npc->_i1 == 0) { animName = "SpinBegin"; } goto LAB_004a1adf; case 10: if (npc->_stateFrame != 0) { if (npc->_stateFrame < 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || (pfVar9 = (&projParams)[1].Color._tint + 2, (npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(undefined1 *)((int)&npc->_i2 + 2) = 0x5a; pfVar9 = (&projParams)[1].Color._tint + 2; } break; } puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)"BulletHellLoop",0); Entity_NPC::PlaySound(npc,0x12d,1.0,0x2d,0,0.8); fVar13 = ABS((npc->_v1).y); local_d4 = (EntityPtr)0x40800000; isSlowSpin = fVar13 < 20.0; if (20.0 <= fVar13) { local_d4 = (EntityPtr)0x40c00000; } iVar10 = npc->_stateFrame; local_e4.y = (float)&DAT_00000006; if (iVar10 % 6 == 0) { ProjectileParams::ProjectileParams(&projParams); projParams.TargetPosition.x = (npc->_pos).x; projParams.TargetPosition.y = (npc->_pos).y; projParams.FallingAccelModifier = -0.1; if (isSlowSpin == '\0') { projParams.FallingAccelModifier = -0.05; } projParams.Variant = 3; projParams.CircleAngle = ((npc->_v1).x * 3.1415927) / 180.0; projParams.BulletFlags._0_4_ = 0x2000; projParams.BulletFlags._4_4_ = 1; projParams.ChangeTimeout = 0x1e; local_ec = (EntityPtr)0x40800000; projParams.ChangeFlags = 0; local_f8._8_4_ = local_d4; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(local_f8 + 8),9,&projParams); fVar13 = normalize_angle_degrees((npc->_v1).x + (npc->_v1).y); iVar10 = npc->_stateFrame; (npc->_v1).x = fVar13; } npc->_stateFrame = iVar10 + 1; pfVar9 = (float *)puStack_20; if (iVar10 + 1 < 0x5b) break; animName = "BulletHellEnd"; goto LAB_004a2281; } animName = "BulletHellBegin"; LAB_004a1adf: puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)animName,0); pfVar9 = (float *)puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 1; } break; case 0xb: ANM2::Play(&npc->_sprite,&DAT_00b1deb4,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar3 != 0) { local_d4 = (EntityPtr)0x3fa; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); uVar8 = Random(); local_e4.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0; pvVar6 = Entity_NPC::QueryNPCsType(local_f8,0x60,-1); local_d4 = *(EntityPtr *)((int)pvVar6 + 0xc); EntityList_Query::~EntityList_Query(local_f8); uVar8 = 0; do { local_fc = (Entity *) ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 120.0 + local_e4.y); local_118.y = (float)local_fc * 0.017453292; local_124.y = sin(local_118.y); local_118.y = cos(local_118.y); local_104 = 0.0; if ((uVar8 < 2) && ((int)local_d4 < 3)) { local_d4 = (EntityPtr)((int)local_d4 + 1); local_104 = 1.4013e-45; } uVar7 = Random(); local_f8._8_4_ = local_118.y * 30.0 + (npc->_pos).x; local_ec = (EntityPtr)(local_124.y * 30.0 + (npc->_pos).y); tmpEntity = Game::Spawn(g_game,1000,0x8f,(Vector *)(local_f8 + 8),&g_vectorZero, (Entity *)npc,(uint)local_104,uVar7); iVar10 = *(int *)tmpEntity; *(Entity **)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = local_fc; (**(code **)(iVar10 + 0xc))(); uVar8 = uVar8 + 1; } while (uVar8 < 3); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x1a4,1.0,0x14,0,0.9); } if ((npc->_sprite)._animState._animData != (void *)0x0) { pfVar9 = (float *)puStack_20; if ((npc->_sprite)._animState._isPlaying != 0) break; } } } npc->_state = 3; *(undefined1 *)((int)&npc->_i2 + 3) = 0x5a; pfVar9 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar9; bVar3 = Entity::IsFrame((Entity *)npc,2,0); if (bVar3 != 0) { cVar2 = (char)npc->_i2; if (cVar2 != '\0') { *(char *)&npc->_i2 = cVar2 + -1; } cVar2 = *(char *)((int)&npc->_i2 + 1); if (cVar2 != '\0') { *(char *)((int)&npc->_i2 + 1) = cVar2 + -1; } cVar2 = *(char *)((int)&npc->_i2 + 2); if (cVar2 != '\0') { *(char *)((int)&npc->_i2 + 2) = cVar2 + -1; } cVar2 = *(char *)((int)&npc->_i2 + 3); if (cVar2 != '\0') { *(char *)((int)&npc->_i2 + 3) = cVar2 + -1; } } bVar3 = npc->_dead; fVar13 = (npc->_targetPosition).x; fVar12 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; fVar1 = npc->_friction; (npc->_velocity).x = fVar13 - fVar12; npc->_friction = fVar1 * 0.7; if (bVar3 != 0) { uVar8 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8e,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar8); (**(code **)(*(int *)tmpEntity + 0xc))(uVar4); manager = g_manager; local_d4 = (EntityPtr)0x18c; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); SFXManager::Stop(&g_manager->_sfxManager,0x1e8); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_f8,0x366,-1,-1,0,0 ); EVar11 = (EntityPtr)0x0; local_14 = 1.4013e-45; if (local_ec != (EntityPtr)0x0) { do { pEVar5 = *(Entity_NPC **)(local_f8._4_4_ + (int)EVar11 * 4); bVar3 = Entity::IsVulnerableEnemy((Entity *)pEVar5,(Entity *)0x0); if ((bVar3 != 0) && ((pEVar5->_flags & 0x20000000) == 0)) { Entity_NPC::KillUnique(pEVar5); } EVar11 = (EntityPtr)((int)EVar11 + 1); } while ((uint)EVar11 < (uint)local_ec); } if (local_f8[0] == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,(void *)local_f8._4_4_,0); } } ExceptionList = local_1c; return; } //@@ 004a2910 EntityRef::IsFriendly /* ZHL [lua] Lua binding EntityRef:IsFriendly */ uint __thiscall EntityRef::IsFriendly(EntityRef *this) { return CONCAT31((uint3)((uint)this->_flags >> 9),(char)((uint)this->_flags >> 1)) & 0xffffff01; } //@@ 004a2920 FUN_004a2920 int FUN_004a2920(void) { int in_ECX; if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 1000)) { return 0; } return in_ECX; } //@@ 004a2940 NpcHelper::colostomia_pick_target /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (out Vector*, out bool*) -> Vector*: NpcAI::ENTITY_COLOSTOMIA stores the result as _targetPosition; EntityList::QuerySublist, GetPlayerTarget */ float * NpcHelper::colostomia_pick_target(float *param_1,undefined1 *param_2) { qword qVar1; Entity *playerTarget; qword *allocCounter; int gridWidth; uint uVar3; uint uVar4; int iVar5; float score; float dy; float cellX; float cellY; float fVar6; float fVar7; float bestY; EntityList_EL effects; Entity_NPC *local_720; undefined1 *local_71c; float *local_718; int cellCounts [448]; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; Game *game; int gridWidth; void *room; local_8 = 0xffffffff; puStack_c = &LAB_00af2fd0; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(cellCounts + 0x1c4); ExceptionList = &local_10; local_71c = param_2; local_718 = param_1; memset(cellCounts,0,0x700); EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&effects,1000,0x8d,1,0,0); local_8 = 0; uVar4 = 0; if (effects._size != 0) { room = g_game->_room; do { uVar3 = 0; iVar5 = *(int *)((int)effects._data + uVar4 * 4); fVar6 = *(float *)(iVar5 + 0x33c); fVar7 = *(float *)(iVar5 + 0x340); do { iVar5 = (int)(((fVar6 + *(float *)((int)&DAT_00c5c5e8 + uVar3)) - 40.0) / 40.0 + 0.5); gridWidth = (int)(((fVar7 + *(float *)((int)&DAT_00c5c5ec + uVar3)) - 120.0) / 40.0 + 0.5); if ((((-1 < iVar5) && (gridWidth = *(int *)((int)room + 0xc), iVar5 < gridWidth)) && (-1 < gridWidth)) && ((gridWidth < *(int *)((int)room + 0x10) && (iVar5 = gridWidth * gridWidth + iVar5, -1 < iVar5))) ) { cellCounts[iVar5] = cellCounts[iVar5] + 1; } uVar3 = uVar3 + 8; } while (uVar3 < 0x48); uVar4 = uVar4 + 1; } while (uVar4 < (uint)effects._size); param_1 = local_718; } playerTarget = Entity_NPC::GetPlayerTarget(local_720); game = g_game; local_718 = (float *)(playerTarget->_pos).x; local_720 = (Entity_NPC *)(playerTarget->_pos).y; iVar5 = (int)(((float)local_718 - 40.0) / 40.0 + 0.5); gridWidth = (int)(((float)local_720 - 120.0) / 40.0 + 0.5); if (((iVar5 < 0) || (gridWidth = *(int *)((int)g_game->_room + 0xc), gridWidth <= iVar5)) || ((gridWidth < 0 || (*(int *)((int)g_game->_room + 0x10) <= gridWidth)))) { *local_71c = 1; } else { iVar5 = gridWidth * gridWidth + iVar5; *local_71c = 1; if ((-1 < iVar5) && (iVar5 = cellCounts[iVar5], iVar5 != 0)) { uVar4 = 0; gridWidth = *(int *)((int)game->_room + 0xc); uVar3 = *(int *)((int)game->_room + 0x10) * gridWidth; fVar6 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * 1000.0; fVar7 = (float)local_718; bestY = (float)local_720; if (uVar3 != 0) { do { cellY = (float)((int)uVar4 / gridWidth) * 40.0 + 120.0; iVar5 = cellCounts[uVar4] * cellCounts[uVar4]; cellX = (float)((int)uVar4 % gridWidth) * 40.0 + 40.0; dy = (float)local_720 - cellY; score = (float)local_718 - cellX; score = dy * dy + score * score + (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * 10000.0; if (score < fVar6) { fVar6 = score; fVar7 = cellX; bestY = cellY; } uVar4 = uVar4 + 1; } while (uVar4 < uVar3); } *local_71c = 0; *param_1 = fVar7; param_1[1] = bestY; if (effects._0_1_ != '\0') { ExceptionList = local_10; return param_1; } if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (effects._data == (void *)0x0) { ExceptionList = local_10; return param_1; } uVar4 = *(uint *)((int)effects._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); goto LAB_004a2cad; } } *param_1 = (float)local_718; param_1[1] = (float)local_720; if (effects._0_1_ != '\0') { ExceptionList = local_10; return param_1; } if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (effects._data == (void *)0x0) { ExceptionList = local_10; return param_1; } uVar4 = *(uint *)((int)effects._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); LAB_004a2cad: free((void *)((int)effects._data + -4)); ExceptionList = local_10; return param_1; } //@@ 004a2ce0 NpcHelper::colostomia_pick_dive_target /* WARNING: Removing unreachable block (ram,0x004a2f55) */ /* DB: ? called from NpcAI::ENTITY_COLOSTOMIA right before playing GoUnder; GetNearestPlayer, Room::GetRandomPosition/FindFreePickupSpawnPosition/GetGridCollision/IsPositionInRoom */ void NpcHelper::colostomia_pick_dive_target(void) { byte bVar1; void **roomRef; Vector *candidatePos; Entity_Player *nearestPlayer; uint uVar2; byte *animData; int in_ECX; int iVar4; byte *pbVar5; int iVar6; bool bVar7; float fVar8; float fVar9; Vector freePos; Vector randomPos; int *local_24; int *local_20; void **roomSlot; uint attempt; int npc; byte *animData; int *childRef; Vector *diveTarget; Game *game; Room *room; game = g_game; diveTarget = (Vector *)(in_ECX + 0xbb0); diveTarget->x = g_vectorZero.x; *(float *)(in_ECX + 0xbb4) = g_vectorZero.y; attempt = 0; roomRef = &game->_room; npc = in_ECX; do { room = *roomRef; candidatePos = Room::GetRandomPosition(room,&randomPos,0.0); candidatePos = Room::FindFreePickupSpawnPosition(room,&freePos,candidatePos,0.0,0,0,0); iVar6 = npc; fVar9 = candidatePos->x; diveTarget->x = fVar9; fVar8 = candidatePos->y; *(float *)(in_ECX + 0xbb4) = fVar8; fVar9 = *(float *)(npc + 0x33c) - fVar9; fVar8 = *(float *)(npc + 0x340) - fVar8; local_20 = (int *)sqrtf(fVar8 * fVar8 + fVar9 * fVar9); nearestPlayer = Game::GetNearestPlayer(g_game,diveTarget); fVar9 = (nearestPlayer->_pos).y - *(float *)(in_ECX + 0xbb4); fVar8 = (nearestPlayer->_pos).x - diveTarget->x; local_24 = (int *)sqrtf(fVar9 * fVar9 + fVar8 * fVar8); roomSlot = &g_game->_room; bVar1 = Room::IsPositionInRoom(*roomSlot,diveTarget,60.0); if (bVar1 != 0) { room = *roomSlot; iVar6 = (int)((diveTarget->x - 40.0) / 40.0 + 0.5); iVar4 = (int)((*(float *)(in_ECX + 0xbb4) - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (iVar4 < 0)) || (room->_gridHeight <= iVar4)) { iVar6 = -1; } else { iVar6 = room->_gridWidth * iVar4 + iVar6; } uVar2 = Room::GetGridCollision(room,iVar6); iVar6 = npc; if ((((uVar2 == 0) && (80.0 <= (float)local_20)) && (((float)local_20 <= 200.0 && (120.0 < (float)local_24)))) && ((iVar4 = *(int *)(npc + 0xbec), iVar4 == 0 || (fVar9 = *(float *)(in_ECX + 0xbb4) - *(float *)(iVar4 + 0x340), fVar8 = diveTarget->x - *(float *)(iVar4 + 0x33c), 10000.0 < fVar9 * fVar9 + fVar8 * fVar8 )))) break; } attempt = attempt + 1; roomRef = roomSlot; } while (attempt < 0xf); childRef = (int *)(iVar6 + 0xbec); if (*(int *)(iVar6 + 0xbec) != 0) { local_20 = (int *)(*(int *)(iVar6 + 0xbec) + 0x3bc); if (*local_20 != 0) { local_24 = local_20; std::multiset::erase(&local_24); } *local_20 = 0; if (*childRef != 0) { local_24 = childRef; std::multiset::erase(&local_24); } *childRef = 0; } local_20 = *(int **)(iVar6 + 0x3c0); if (local_20 != (int *)0x0) { *childRef = (int)local_20; std::multiset::insert(childRef); if (*(int *)(iVar6 + 0x3c0) != 0) { local_24 = (int *)(iVar6 + 0x3c0); std::multiset::erase(&local_24); } *(int *)(iVar6 + 0x3c0) = 0; } animData = *(byte **)(iVar6 + 0x7c); if (animData != (byte *)0x0) { animData = animData; if (0xf < *(uint *)(animData + 0x14)) { animData = *(byte **)animData; } pbVar5 = &DAT_00b1d33c; do { bVar1 = *animData; bVar7 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_004a2fd4: uVar2 = -(uint)bVar7 | 1; goto LAB_004a2fd9; } if (bVar1 == 0) break; bVar1 = animData[1]; bVar7 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_004a2fd4; animData = animData + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_004a2fd9: if ((uVar2 == 0) && ((animData[0x34] == 0 || (*(char *)(iVar6 + 0x8c) != '\0')))) goto LAB_004a2fed; } bVar1 = ANM2::SetAnimation((ANM2 *)(iVar6 + 0x48),&DAT_00b1d33c,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(iVar6 + 0x78)); *(undefined1 *)(iVar6 + 0x8c) = 1; *(undefined4 *)(npc + 0xb64) = 6; return; } LAB_004a2fed: *(undefined4 *)(iVar6 + 0xb64) = 6; return; } //@@ 004a3040 NpcAI::ENTITY_COLOSTOMIA /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 917 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_COLOSTOMIA(Entity_NPC *npc) { float fVar1; RNG rng; undefined1 *puVar2; byte bVar3; uint uVar4; byte *pbVar5; uint uVar6; float *pfVar7; byte *pbVar8; EntityList_EL *colostomiaQuery; Entity_Effect *bloodCloud; Vector *pVVar9; std_string *animName; ColorMod *tmpColor; void *pvVar10; int iVar11; Entity *tmpEntity; byte *pbVar12; char *chargeAnim; undefined4 *puVar13; ColorMod *color; int i; ANM2 *sprite; bool bVar14; float fVar15; float fVar16; float fVar17; undefined4 local_1b0 [8]; undefined4 local_190; undefined4 uStack_18c; undefined4 local_188; int elapsedTicks; float frictionScale; undefined1 local_17c [12]; undefined4 *local_170; Vector local_16c; Vector local_164; Vector local_15c; Vector local_154; Vector local_14c; uint local_144; undefined1 auStack_140 [8]; float fStack_138; Vector local_134; byte local_129; ProjectileParams projParams; Color cloudColor; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *animNameSize; AnimationState *animState; EntityPtr child; EntityPtr *childRef; Game *game; int *outcomeWeight; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af301b; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_16c.y = 0.0; frictionScale = 0.65; elapsedTicks = (int)npc->_updateTime - (int)npc->_prevUpdateTime; if (0.0 < npc->_pendingDamage) { npc->_pendingDamage = 0.0; pfVar7 = (npc->_damageEvents)._begin; if (pfVar7 != (npc->_damageEvents)._end) { do { if (((((uint)pfVar7[2] & 4) != 0) && (((uint)pfVar7[0xc] >> 1 & 1) == 0)) && (((pfVar7[4] == 1.4013e-42 && (pfVar7[5] == 1.97583e-43)) || (pfVar7[6] == 1.28499e-42))) ) { *pfVar7 = 0.0; } fVar15 = *pfVar7; pfVar7 = pfVar7 + 0xe; npc->_pendingDamage = fVar15 + npc->_pendingDamage; } while (pfVar7 != (npc->_damageEvents)._end); } } fVar15 = npc->_maxHitPoints * 0.4; local_164.y = (float)npc; local_24 = uVar4; puVar2 = local_50 + 0x4c; if ((((npc->_health <= fVar15 && fVar15 != npc->_health) && (iVar11 = npc->_state, puVar2 = local_50 + 0x4c, iVar11 != 0x10)) && (puVar2 = local_50 + 0x4c, iVar11 != 4)) && (((puVar2 = local_50 + 0x4c, iVar11 != 6 && (puVar2 = local_50 + 0x4c, iVar11 != 10)) && (puVar2 = local_50 + 0x4c, iVar11 != 0xb)))) { npc->_state = 0x10; Entity::RemoveStatusEffects((Entity *)npc); npc->_entityCollisionClass = 0; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_004a31e2: bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1e848,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar5 = *(byte **)pbVar8; } pbVar12 = &DAT_00b1e848; do { bVar3 = *pbVar5; bVar14 = bVar3 < *pbVar12; if (bVar3 != *pbVar12) { LAB_004a31c4: uVar6 = -(uint)bVar14 | 1; goto LAB_004a31c9; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar14 = bVar3 < pbVar12[1]; if (bVar3 != pbVar12[1]) goto LAB_004a31c4; pbVar5 = pbVar5 + 2; pbVar12 = pbVar12 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_004a31c9: if ((uVar6 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004a31e2; } (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; puVar2 = puStack_20; } puStack_20 = puVar2; switch(npc->_state) { case 0: npc->_state = 3; local_190 = 0; uStack_18c = 0; local_188 = 0; if (&npc->_splatColor != (ColorMod *)local_1b0) { (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 3.7; (npc->_splatColor)._colorize[1] = 2.7; (npc->_splatColor)._colorize[2] = 1.5; (npc->_splatColor)._colorize[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } npc->_i1 = -1; npc->_i2 = 1; npc->_entityCollisionClass = 0; break; case 3: npc->_entityCollisionClass = 4; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_004a331e: bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar5 = s_Idle; do { bVar3 = *pbVar8; bVar14 = bVar3 < *pbVar5; if (bVar3 != *pbVar5) { LAB_004a3306: uVar4 = -(uint)bVar14 | 1; goto LAB_004a330b; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar14 = bVar3 < pbVar5[1]; if (bVar3 != pbVar5[1]) goto LAB_004a3306; pbVar8 = pbVar8 + 2; pbVar5 = pbVar5 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004a330b: if ((uVar4 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004a331e; } sprite = &npc->_sprite; if (npc->_projectileCooldown < 1) { if (npc->_i2 == 0) { local_129 = 0; pfVar7 = (float *)NpcHelper::colostomia_pick_target(auStack_140 + 4,&local_129); fVar15 = *pfVar7; (npc->_targetPosition).x = fVar15; fStack_138 = pfVar7[1]; (npc->_targetPosition).y = fStack_138; fVar15 = fVar15 - (npc->_pos).x; fStack_138 = fStack_138 - (npc->_pos).y; auStack_140._4_4_ = fVar15 + fVar15; iVar11 = vector_to_direction((Vector *)(auStack_140 + 4)); npc->_i1 = iVar11; if (local_129 != 0) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; iVar11 = npc->_i1; } if (iVar11 == 1) { ANM2::Play(sprite,(byte *)"ChargeStartUp",0); iVar11 = 8; } else { chargeAnim = "ChargeStartDown"; if (iVar11 != 3) { chargeAnim = "ChargeStartHori"; } ANM2::Play(sprite,(byte *)chargeAnim,0); iVar11 = 8; } } else { ANM2::Play(sprite,(byte *)"Attack",0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar15 = (npc->_pos).y - (tmpEntity->_pos).y; fVar17 = (npc->_pos).x - (tmpEntity->_pos).x; fVar15 = sqrtf(fVar15 * fVar15 + fVar17 * fVar17); fVar15 = fVar15 * 0.1 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar15 && fVar15 != (npc->_pos).x; iVar11 = 9; } npc->_state = iVar11; npc->_i2 = 0; } break; case 4: if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004a4a0f: ANM2::Play(&npc->_sprite,s_Idle2,0); } else { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { npc->_entityCollisionClass = 4; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004a4a0f; } if (npc->_projectileCooldown < 1) { npc->_entityCollisionClass = 4; local_17c._4_4_ = (void *)0x0; local_17c._8_4_ = (undefined4 *)0x0; local_170 = (undefined4 *)0x0; local_14 = 2; pvVar10 = Entity_NPC::QueryNPCsType(&local_144,1000,0x8d); local_154.y = *(float *)((int)pvVar10 + 0xc); EntityList_Query::~EntityList_Query(&local_144); pvVar10 = (void *)0x0; if ((npc->_i1 == 0) && ((int)local_154.y < 0xe)) { WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)(local_17c + 4),0,(uint)((int)local_154.y < 4) * 2 + 1,0 ); pvVar10 = (void *)local_17c._4_4_; } uVar4 = 0; uVar6 = local_17c._8_4_ - (int)pvVar10 >> 3; if (uVar6 != 0) { do { if (*(int *)((int)pvVar10 + uVar4 * 8) == 1) { outcomeWeight = (int *)((int)pvVar10 + uVar4 * 8 + 4); *outcomeWeight = *outcomeWeight + 2; if (*outcomeWeight < 0) { *(undefined4 *)((int)pvVar10 + uVar4 * 8 + 4) = 0; } goto LAB_004a4b34; } uVar4 = uVar4 + 1; } while (uVar4 < uVar6); } auStack_140._4_4_ = 1; fStack_138 = 2.8026e-45; if ((undefined4 *)local_17c._8_4_ == local_170) { std::vector<8byte>::_Emplace_reallocate(local_17c._8_4_,auStack_140 + 4); pvVar10 = (void *)local_17c._4_4_; } else { *(undefined4 *)local_17c._8_4_ = 1; *(undefined4 *)(local_17c._8_4_ + 4) = 2; local_17c._8_4_ = local_17c._8_4_ + 8; } LAB_004a4b34: uVar4 = 0; uVar6 = local_17c._8_4_ - (int)pvVar10 >> 3; if (uVar6 != 0) { do { if (*(int *)((int)pvVar10 + uVar4 * 8) == 2) { outcomeWeight = (int *)((int)pvVar10 + uVar4 * 8 + 4); *outcomeWeight = *outcomeWeight + 1; if (*outcomeWeight < 0) { *(undefined4 *)((int)pvVar10 + uVar4 * 8 + 4) = 0; } goto LAB_004a4ba4; } uVar4 = uVar4 + 1; } while (uVar4 < uVar6); } auStack_140._4_4_ = 2; fStack_138 = 1.4013e-45; if ((undefined4 *)local_17c._8_4_ == local_170) { std::vector<8byte>::_Emplace_reallocate(local_17c._8_4_,auStack_140 + 4); } else { *(undefined4 *)local_17c._8_4_ = 2; *(undefined4 *)(local_17c._8_4_ + 4) = 1; local_17c._8_4_ = local_17c._8_4_ + 8; } LAB_004a4ba4: local_144 = Random(); local_144 = local_144 | 1; auStack_140 = (undefined1 [8])0x900000005; fStack_138 = 9.80909e-45; rng._shift1 = 5; rng._seed = local_144; rng._shift2 = 9; rng._shift3 = 7; uVar4 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)(local_17c + 4),rng); if (uVar4 == 0) { ANM2::Play(&npc->_sprite,(byte *)"GoUnder",0); npc->_state = 0xb; npc->_i1 = 1; } else if (uVar4 == 1) { ANM2::Play(&npc->_sprite,s_Attack2,0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar15 = (npc->_pos).y - (tmpEntity->_pos).y; fVar17 = (npc->_pos).x - (tmpEntity->_pos).x; fVar15 = sqrtf(fVar15 * fVar15 + fVar17 * fVar17); (npc->_sprite)._flipX = (tmpEntity->_pos).x + (tmpEntity->_velocity).x * fVar15 * 0.1 < (npc->_pos).x; npc->_state = 10; } else if (uVar4 == 2) { NpcHelper::colostomia_pick_dive_target(); ANM2::Play(&npc->_sprite,(byte *)"GoUnder",0); } local_14 = 0xffffffff; if ((void *)local_17c._4_4_ != (void *)0x0) { deallocate((void *)local_17c._4_4_,(int)local_170 - local_17c._4_4_ >> 3); } } break; case 6: animName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)(local_50 + 0x14) ); animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } local_129 = str_eq((byte *)animName,*animNameSize,(byte *)"GoUnder",7); std::string::_Tidy_deallocate(local_50 + 0x14); sprite = &npc->_sprite; if (local_129 != 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(sprite,&DAT_00b1d33c,0); } break; } bVar3 = Sprite::IsEventTriggered((Sprite *)sprite,s_Jump); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_entityGridCollisionClass = 3; npc->_entityCollisionClass = 0; (npc->_v2).x = 0.0; } bVar3 = ANM2::WasEventTriggered(sprite,s_Jump); if ((bVar3 != 0) && (bVar3 = ANM2::WasEventTriggered(sprite,s_Land), bVar3 == 0)) { fVar15 = npc->_friction * 0.5; fVar17 = npc->_speedMultiplier * 0.011 + (npc->_v2).x; npc->_friction = fVar15; if (fVar17 <= 0.0) { fVar17 = 0.0; } if (1.0 <= fVar17) { fVar17 = 1.0; } (npc->_v2).x = fVar17; fVar16 = (npc->_v1).y; fVar1 = (npc->_pos).y; (npc->_velocity).x = (fVar17 * ((npc->_v1).x - (npc->_pos).x)) / fVar15; (npc->_velocity).y = (fVar17 * (fVar16 - fVar1)) / fVar15; } bVar3 = Sprite::IsEventTriggered((Sprite *)sprite,s_Land); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); Entity::MakeBloodPoofAtPos(&npc->_splatColor); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 3; auStack_140._4_4_ = 0x41200000; fStack_138 = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(auStack_140 + 4),8,&projParams); child = npc->_child; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_entityGridCollisionClass = 5; npc->_entityCollisionClass = 4; if (child == (EntityPtr)0x0) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xa8,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); Entity::SetParent(tmpEntity,(Entity *)npc); (**(code **)(*(int *)tmpEntity + 0xc))(); Entity::SetChild((Entity *)npc,tmpEntity); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; ANM2::Play(&npc->_sprite,(byte *)"Surface",0); npc->_state = 4; uVar4 = Random(); iVar11 = uVar4 % 0x1e + 0x14; goto LAB_004a571c; case 8: uVar6 = npc->_i1; if ((int)uVar6 < 0) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { (npc->_sprite)._flipX = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 3; uVar6 = Random(); colostomiaQuery = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_17c,1000, 0x8d,1,0,0); uVar4 = colostomiaQuery->_size; EntityList_Query::~EntityList_Query(local_17c); *(int *)((int)local_164.y + 0xba0) = 1; npc = (Entity_NPC *)local_164.y; if (uVar6 % 5 + 8 <= uVar4) { *(int *)((int)local_164.y + 0xbc4) = 1; } break; } if (uVar6 < 4) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80020) && (_Init_thread_header(&DAT_00c80020,uVar4), DAT_00c80020 == -1)) { _DAT_00c80024 = &DAT_bf800000; _DAT_00c80028 = 0; uRam00c8002c = 0; puRam00c80030 = &DAT_bf800000; _DAT_00c80034 = 0x3f800000; uRam00c80038 = 0; uRam00c8003c = 0; uRam00c80040 = 0x3f800000; _Init_thread_footer(&DAT_00c80020); } local_164.y = *(float *)(&DAT_00c80024 + uVar6 * 8); local_16c.y = *(float *)(&DAT_00c80028 + uVar6 * 8); } else { local_164.y = g_vectorZero.x; local_16c.y = g_vectorZero.y; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004a35f3: pvVar10 = (npc->_sprite)._animState._animData; if ((pvVar10 != (void *)0x0) && (*(char *)((int)pvVar10 + 0x34) != '\0')) goto LAB_004a3608; } else { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar3 != 0) { (npc->_sprite)._flipX = npc->_i1 == 0; Entity_NPC::PlaySound(npc,0x12d,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1da,1.0,2,0,1.0); (npc->_v2).x = (npc->_pos).x; (npc->_v2).y = (npc->_pos).y; pvVar10 = npc->_config; (npc->_v1).x = 0.0; (npc->_v1).y = 0.0; npc->_mass = *(float *)((int)pvVar10 + 0x44) * 5.0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"Shoot"), bVar3 == 0)) goto LAB_004a35f3; LAB_004a3608: frictionScale = 0.95; local_15c.y = cos(1.5707964); fVar17 = sin(1.5707964); fVar16 = local_15c.y * local_164.y; local_15c.y = local_15c.y * local_16c.y + fVar17 * local_164.y; fVar15 = (npc->_targetPosition).x; local_14c.y = fVar16 - fVar17 * local_16c.y; fVar17 = (npc->_targetPosition).y; if ((fVar15 == g_vectorZero.x) && (fVar17 == g_vectorZero.y)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar15 = (tmpEntity->_pos).x; fVar17 = (tmpEntity->_pos).y; } fVar15 = ((fVar17 - (npc->_pos).y) * local_15c.y + (fVar15 - (npc->_pos).x) * local_14c.y) * 0.002; if (fVar15 <= -0.2) { fVar15 = -0.2; } if (0.2 <= fVar15) { fVar15 = 0.2; } fVar17 = fVar15 * local_15c.y + local_16c.y; fVar15 = fVar15 * local_14c.y + local_164.y; local_134.y = (fVar17 + fVar17) * npc->_speedMultiplier + (npc->_velocity).y; local_15c.y = (fVar15 + fVar15) * npc->_speedMultiplier + (npc->_velocity).x; (npc->_velocity).y = local_134.y; (npc->_velocity).x = local_15c.y; iVar11 = Entity::GetIntervalTicks((Entity *)npc,4.0,0.0); if (iVar11 != 0) { local_15c.y = local_15c.y * 0.1; local_134.y = local_134.y * 0.1; pVVar9 = MusicManager::RandomVector(&local_154); uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar17 = fVar15 * pVVar9->y; fVar15 = fVar15 * pVVar9->x; fStack_138 = fVar17 + fVar17 + local_134.y; auStack_140._4_4_ = fVar15 + fVar15 + local_15c.y; tmpEntity = spawn_blood_explosion (3,&npc->_pos,&g_vectorZero,&npc->_splatColor, (Vector *)(auStack_140 + 4)); uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8; (tmpEntity->_sprite)._scale.x = fVar15; (tmpEntity->_sprite)._scale.y = fVar15 * 0.8; uVar4 = Random(); for (local_14c.y = (float)(uVar4 % 6 + 8); local_14c.y != 0.0; local_14c.y = (float)((int)local_14c.y + -1)) { uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_134.y = fVar15 + fVar15; local_15c.y = sin(local_134.y); fVar15 = cos(local_134.y); local_134.y = fVar15 * 60.0; local_15c.y = local_15c.y * 40.0; uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 3.0; fStack_138 = (local_15c.y * fVar15) / 60.0; auStack_140._4_4_ = (local_134.y * fVar15) / 60.0; uVar4 = Random(); local_154.x = local_134.y + (npc->_pos).x; local_154.y = local_15c.y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,99,&local_154,(Vector *)(auStack_140 + 4), (Entity *)0x0,1,uVar4); fVar15 = (tmpEntity->_sprite)._scale.x; fVar17 = (tmpEntity->_sprite)._scale.y; (tmpEntity->_sprite)._scale.x = fVar15 + fVar15; (tmpEntity->_sprite)._scale.y = fVar17 + fVar17; uVar4 = Random(); tmpEntity[1]._damageEvents._end = (void *)0x3fc00000; iVar11 = *(int *)tmpEntity; tmpEntity[1]._damageEvents._begin = (void *)(-4.0 - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 8.0); (**(code **)(iVar11 + 0xc))(); } } local_14c.y = (npc->_pos).x; fVar15 = (npc->_pos).y - (npc->_v2).y; fVar17 = local_14c.y - (npc->_v2).x; fVar16 = sqrtf(fVar15 * fVar15 + fVar17 * fVar17); (npc->_v1).x = fVar16 + (npc->_v1).x; (npc->_v2).x = local_14c.y; (npc->_v2).y = (npc->_pos).y; fVar17 = npc->_speedMultiplier; fVar15 = (npc->_v1).y; if (fVar16 < fVar17 * 6.0) { fVar15 = fVar17 + fVar15; (npc->_v1).y = fVar15; } if (10.0 < fVar15) { npc->_collidesWithGrid = 1; (npc->_gridCollisionVelocity).x = (npc->_velocity).x; (npc->_gridCollisionVelocity).y = (npc->_velocity).y; (npc->_gridCollisionNormal).x = (npc->_velocity).x; (npc->_gridCollisionNormal).y = (npc->_velocity).y; fVar15 = (npc->_v1).y; fVar17 = npc->_speedMultiplier; } (npc->_v1).y = fVar15 - fVar17 * 0.2; if (60.0 < (npc->_v1).x) { (npc->_v1).x = 0.0; Entity_NPC::PlaySound(npc,0x25,0.5,2,0,1.0); pVVar9 = MusicManager::RandomVector((Vector *)(auStack_140 + 4)); uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0; local_134.y = fVar15 * pVVar9->y + (npc->_velocity).y; local_14c.y = fVar15 * pVVar9->x + (npc->_velocity).x; uVar4 = Random(); pVVar9 = &npc->_pos; fStack_138 = local_134.y * 0.2; auStack_140._4_4_ = local_14c.y * 0.2; tmpEntity = Game::Spawn(g_game,1000,0x8d,pVVar9,(Vector *)(auStack_140 + 4),(Entity *)npc,1, uVar4); iVar11 = *(int *)tmpEntity; sprite = &tmpEntity[1]._sprite; (sprite->_filename)._buf[8] = -1; (sprite->_filename)._buf[9] = -1; (sprite->_filename)._buf[10] = -1; (sprite->_filename)._buf[0xb] = -1; sprite = &tmpEntity[1]._sprite; (sprite->_filename)._buf[0xc] = -1; (sprite->_filename)._buf[0xd] = -1; (sprite->_filename)._buf[0xe] = -1; (sprite->_filename)._buf[0xf] = -1; (**(code **)(iVar11 + 0xc))(); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.093; uVar4 = Random(); projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x20; projParams.Acceleration = 0.96; projParams.Variant = 3; projParams.FallingSpeedModifier = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * -2.0; local_15c.y = cos(1.9198622); fVar16 = sin(1.9198622); fVar15 = (npc->_velocity).x; fVar17 = (npc->_velocity).y; local_134.y = local_15c.y * fVar15 - fVar16 * fVar17; local_15c.y = local_15c.y * fVar17 + fVar16 * fVar15; fVar15 = sqrtf(local_134.y * local_134.y + local_15c.y * local_15c.y); if (0.0 < fVar15) { local_134.y = (1.0 / fVar15) * local_134.y; local_15c.y = local_15c.y * (1.0 / fVar15); } uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar15 = fVar15 + fVar15 + 6.0; fStack_138 = fVar15 * local_15c.y; auStack_140._4_4_ = fVar15 * local_134.y; Entity_NPC::FireProjectiles(npc,pVVar9,(Vector *)(auStack_140 + 4),0,&projParams); local_14c.y = cos(-1.9198622); fVar16 = sin(-1.9198622); fVar15 = (npc->_velocity).y; fVar17 = (npc->_velocity).x; local_134.y = fVar17 * local_14c.y - fVar15 * fVar16; local_15c.y = fVar15 * local_14c.y + fVar17 * fVar16; fVar15 = sqrtf(local_15c.y * local_15c.y + local_134.y * local_134.y); if (0.0 < fVar15) { local_134.y = local_134.y * (1.0 / fVar15); local_15c.y = local_15c.y * (1.0 / fVar15); } uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar15 = fVar15 + fVar15 + 6.0; fStack_138 = fVar15 * local_15c.y; auStack_140._4_4_ = fVar15 * local_134.y; Entity_NPC::FireProjectiles(npc,pVVar9,(Vector *)(auStack_140 + 4),0,&projParams); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_i1 == 1) { pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } chargeAnim = "ChargeLoopUp"; do { bVar3 = *pbVar8; bVar14 = bVar3 < (byte)*chargeAnim; if (bVar3 != *chargeAnim) { LAB_004a3fc3: uVar4 = -(uint)bVar14 | 1; goto LAB_004a3fc8; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar14 = bVar3 < (byte)chargeAnim[1]; if (bVar3 != chargeAnim[1]) goto LAB_004a3fc3; pbVar8 = pbVar8 + 2; chargeAnim = chargeAnim + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004a3fc8: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004a4020; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"ChargeLoopUp",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (npc->_i1 == 3) { chargeAnim = "ChargeLoopDown"; } else { chargeAnim = "ChargeLoopHori"; } ANM2::Play(&npc->_sprite,(byte *)chargeAnim,0); } } LAB_004a4020: if ((npc->_collidesWithGrid != 0) && (0.5 < local_16c.y * (npc->_gridCollisionNormal).y + local_164.y * (npc->_gridCollisionNormal).x)) { npc->_mass = *(float *)((int)npc->_config + 0x44); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); Game::ShakeScreen(g_game,6); if (npc->_i1 == 1) { chargeAnim = "ChargeEndUp"; } else { chargeAnim = "ChargeEndDown"; if (npc->_i1 != 3) { chargeAnim = "ChargeEndHori"; } } ANM2::Play(&npc->_sprite,(byte *)chargeAnim,0); (npc->_sprite)._flipX = npc->_i1 == 0; npc->_i1 = -1; } break; case 9: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); uVar4 = Random(); local_134.y = (float)&npc->_pos; tmpEntity = Game::Spawn(g_game,1000,0x10,(Vector *)local_134.y,&g_vectorZero,(Entity *)npc,3 ,uVar4); (**(code **)(*(int *)tmpEntity + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); uVar4 = Random(); (tmpEntity->_sprite)._flipX = ((byte)uVar4 ^ 0xff) & 1; (**(code **)(*(int *)tmpEntity + 0xc))(); auStack_140._4_4_ = (npc->_pos).x; if ((npc->_sprite)._flipX == 0) { auStack_140._4_4_ = (float)auStack_140._4_4_ - 15.0; fStack_138 = (npc->_pos).y; local_14c.y = 180.0; } else { auStack_140._4_4_ = (float)auStack_140._4_4_ + 15.0; local_14c.y = 0.0; fStack_138 = (npc->_pos).y; } fStack_138 = fStack_138 + 0.0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar15 = local_134.y; fVar17 = *(float *)((int)local_134.y + 4) - (tmpEntity->_pos).y; fVar16 = *(float *)local_134.y - (tmpEntity->_pos).x; fVar17 = sqrtf(fVar17 * fVar17 + fVar16 * fVar16); local_16c.y = fVar17 * 0.1 * (tmpEntity->_velocity).y + (tmpEntity->_pos).y; local_134.y = fVar17 * 0.1 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x; fVar17 = atan2f(local_16c.y - fStack_138,local_134.y - (float)auStack_140._4_4_); local_154.y = fVar17 * 57.295776; fVar17 = *(float *)fVar15 - local_134.y; fVar15 = *(float *)((int)fVar15 + 4) - local_16c.y; local_16c.y = sqrtf(fVar15 * fVar15 + fVar17 * fVar17); local_16c.y = local_16c.y * 0.08; local_15c.y = 18.0; pVVar9 = &local_16c; if (18.0 <= local_16c.y) { pVVar9 = &local_15c; } local_134.y = approach_angle(local_14c.y,local_154.y,65.0); uVar4 = Random(); local_134.y = local_134.y * 0.017453292; local_154.y = sin(local_134.y); local_154.x = cos(local_134.y); npc = (Entity_NPC *)local_164.y; local_154.x = local_154.x * pVVar9->y; local_154.y = pVVar9->y * local_154.y; tmpEntity = Game::Spawn(g_game,4,9,(Vector *)(auStack_140 + 4),&local_154, (Entity *)local_164.y,0,uVar4); tmpEntity[1]._damageEvents._capacity = (void *)0xc0c00000; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -50.0; *(undefined4 *)&tmpEntity[1].field_0x4 = 0x24; tmpEntity[1]._damageEvents._begin = (void *)0x24; tmpEntity->_entityCollisionClass = 0; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); if (bVar3 != 0) { (npc->_sprite)._flipX = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } } npc->_state = 3; uVar4 = Random(); iVar11 = uVar4 % 0x14 + 0x28; goto LAB_004a5726; case 10: animName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)(local_50 + 0x14) ); animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } local_129 = str_eq((byte *)animName,*animNameSize,(byte *)"Surface",7); std::string::_Tidy_deallocate(local_50 + 0x14); if (local_129 == 0) { bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xc,1.0,2,0,1.0); Color::operator_assign(&cloudColor,&npc->_splatColor); cloudColor._tint[3] = 0.5; bloodCloud = Entity_NPC::MakeBloodCloud(npc,&npc->_pos,color); if ((npc->_sprite)._flipX == 0) { fVar15 = 10.0; } else { fVar15 = -10.0; } (bloodCloud->_posOffset).x = fVar15; (bloodCloud->_posOffset).y = -20.0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar15 = (npc->_pos).y - (tmpEntity->_pos).y; fVar17 = (npc->_pos).x - (tmpEntity->_pos).x; fVar15 = sqrtf(fVar15 * fVar15 + fVar17 * fVar17); local_16c.y = ((fVar15 * 0.1 * (tmpEntity->_velocity).y + (tmpEntity->_pos).y) - (npc->_pos).y) * 0.05; local_164.y = ((fVar15 * 0.1 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x) - (npc->_pos).x) * 0.05; fVar15 = sqrtf(local_16c.y * local_16c.y + local_164.y * local_164.y); if ((20.0 < fVar15) && (0.0 < fVar15)) { local_164.y = (20.0 / fVar15) * local_164.y; local_16c.y = local_16c.y * (20.0 / fVar15); } uVar4 = Random(); local_154.y = cos(-0.34906584); fVar15 = sin(-0.34906584); auStack_140._4_4_ = local_164.y * local_154.y - local_16c.y * fVar15; fStack_138 = local_164.y * fVar15 + local_16c.y * local_154.y; pVVar9 = MusicManager::RandomVector(&local_134); local_14c.x = pVVar9->x * 5.0 + (npc->_pos).x; local_14c.y = pVVar9->y * 5.0 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,4,9,&local_14c,(Vector *)(auStack_140 + 4),(Entity *)npc,0, uVar4); tmpEntity[1]._damageEvents._capacity = (void *)0xc0c00000; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -50.0; *(undefined4 *)&tmpEntity[1].field_0x4 = 0x1e; tmpEntity[1]._damageEvents._begin = (void *)0x1e; tmpEntity->_entityCollisionClass = 0; uVar4 = Random(); local_154.y = cos(0.34906584); fVar15 = sin(0.34906584); fStack_138 = fVar15 * local_164.y + local_154.y * local_16c.y; auStack_140._4_4_ = local_154.y * local_164.y - fVar15 * local_16c.y; pVVar9 = MusicManager::RandomVector((Vector *)(local_17c + 8)); local_15c.x = pVVar9->x * 5.0 + (npc->_pos).x; local_15c.y = pVVar9->y * 5.0 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,4,9,&local_15c,(Vector *)(auStack_140 + 4),(Entity *)npc,0, uVar4); tmpEntity[1]._damageEvents._capacity = (void *)0xc0c00000; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -50.0; *(undefined4 *)&tmpEntity[1].field_0x4 = 0x24; tmpEntity[1]._damageEvents._begin = (void *)0x24; tmpEntity->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { NpcHelper::colostomia_pick_dive_target(); } } else if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Attack2,0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar15 = (npc->_pos).y - (tmpEntity->_pos).y; fVar17 = (npc->_pos).x - (tmpEntity->_pos).x; fVar15 = sqrtf(fVar15 * fVar15 + fVar17 * fVar17); (npc->_sprite)._flipX = fVar15 * 0.1 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x < (npc->_pos).x; } break; case 0xb: animName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)(local_50 + 0x14) ); animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } local_129 = str_eq((byte *)animName,*animNameSize,(byte *)"GoUnder",7); std::string::_Tidy_deallocate(local_50 + 0x14); if (local_129 != 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,&DAT_00b1d2e4,0); } break; } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x25,1.0,2,0,1.0); tmpColor = (ColorMod *)Color::Color(0x3f19999a); Entity::MakeGroundPoofAtSelf((Entity *)npc,tmpColor,1.0); uVar4 = 0; do { uVar6 = Random(); local_154.y = (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) + (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 45.0) * 0.017453292; local_134.y = sin(local_154.y); uVar6 = Random(); local_14c.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 8.0 + 14.0; fVar15 = cos(local_154.y); fStack_138 = local_14c.y * local_134.y; auStack_140._4_4_ = fVar15 * local_14c.y; uVar6 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8d,&npc->_pos,(Vector *)(auStack_140 + 4), (Entity *)npc,1,uVar6); iVar11 = *(int *)tmpEntity; sprite = &tmpEntity[1]._sprite; (sprite->_filename)._buf[8] = -1; (sprite->_filename)._buf[9] = -1; (sprite->_filename)._buf[10] = -1; (sprite->_filename)._buf[0xb] = -1; sprite = &tmpEntity[1]._sprite; (sprite->_filename)._buf[0xc] = -1; (sprite->_filename)._buf[0xd] = -1; (sprite->_filename)._buf[0xe] = -1; (sprite->_filename)._buf[0xf] = -1; (**(code **)(iVar11 + 0xc))(); uVar4 = uVar4 + 1; } while (uVar4 < 8); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; uVar4 = Random(); if (uVar4 % 3 == 0) { pvVar10 = Entity_NPC::QueryNPCsType(local_17c,1000,0x8d); fVar15 = 1.4013e-45; if (0xb < *(uint *)((int)pvVar10 + 0xc)) goto LAB_004a53f5; local_129 = 0; } else { fVar15 = local_16c.y; LAB_004a53f5: local_129 = 1; } if (((uint)fVar15 & 1) != 0) { EntityList_Query::~EntityList_Query(local_17c); } ANM2::Play(&npc->_sprite,(byte *)"Surface",0); if (local_129 != 0) { npc->_state = 10; break; } npc->_state = 4; uVar4 = Random(); iVar11 = uVar4 % 10 + 6; goto LAB_004a5726; case 0x10: if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) { Room::GetClampedPositionImpl (g_game->_room,(Vector *)(auStack_140 + 4),&npc->_pos,40.0,80.0,40.0,80.0); fVar15 = (npc->_pos).y; (npc->_velocity).x = ((float)auStack_140._4_4_ - (npc->_pos).x) * 0.6; (npc->_velocity).y = (fStack_138 - fVar15) * 0.6; npc->_friction = npc->_friction * 0.4; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; Entity_NPC::PlaySound(npc,0xed,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1c,1.0,2,0,1.0); local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_28 = 0.0; local_50._0_4_ = 0.62; local_50._4_4_ = 0.6; local_50._8_4_ = 0.42; local_50._12_4_ = 0.6; Entity::MakeGroundPoof((Entity *)npc,&npc->_pos,(ColorMod *)local_50,1.0); Entity_NPC::QueryNPCsType(local_17c,1000,0x8d); local_14 = 0; puVar13 = (undefined4 *)0x0; if (local_170 != (undefined4 *)0x0) { do { iVar11 = *(int *)(local_17c._4_4_ + (int)puVar13 * 4); if (((iVar11 != 0) && (*(int *)(iVar11 + 0x28) == 1000)) && (*(Entity_NPC **)(iVar11 + 0x3c8) == npc)) { *(undefined4 *)(iVar11 + 0x45c) = 0x1e; *(undefined4 *)(iVar11 + 0x460) = 0x1e; } puVar13 = (undefined4 *)((int)puVar13 + 1); } while (puVar13 < local_170); } uVar4 = 0; do { uVar6 = Random(); local_154.y = (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)] ) * 2.3283064e-10 * 20.0 - 10.0) + (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 60.0) * 0.017453292; local_134.y = sin(local_154.y); uVar6 = Random(); local_14c.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 13.0; fVar15 = cos(local_154.y); fStack_138 = local_14c.y * local_134.y; auStack_140._4_4_ = fVar15 * local_14c.y; uVar6 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8d,&npc->_pos,(Vector *)(auStack_140 + 4), (Entity *)npc,1,uVar6); iVar11 = *(int *)tmpEntity; sprite = &tmpEntity[1]._sprite; (sprite->_filename)._buf[8] = -1; (sprite->_filename)._buf[9] = -1; (sprite->_filename)._buf[10] = -1; (sprite->_filename)._buf[0xb] = -1; sprite = &tmpEntity[1]._sprite; (sprite->_filename)._buf[0xc] = -1; (sprite->_filename)._buf[0xd] = -1; (sprite->_filename)._buf[0xe] = -1; (sprite->_filename)._buf[0xf] = -1; (**(code **)(iVar11 + 0xc))(); uVar4 = uVar4 + 1; } while (uVar4 < 6); local_14 = 0xffffffff; if (local_17c[0] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_17c._4_4_,0); local_14 = 0xffffffff; } } if ((((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) && (childRef = &npc->_child, npc->_child == (EntityPtr)0x0)) { uVar4 = Random(); local_14c.y = (float)Game::Spawn(g_game,1000,0xa8,&npc->_pos,&g_vectorZero,(Entity *)npc,0, uVar4); local_134.y = (float)((int)local_14c.y + 0x3bc); if (*(EntityPtr *)((int)local_14c.y + 0x3bc) != (EntityPtr)0x0) { local_154.y = local_134.y; std::multiset::erase(&local_154.y); } *(Entity_NPC **)local_134.y = npc; std::multiset::insert(local_134.y); (**(code **)(*(int *)local_14c.y + 0xc))(); if (*childRef != (EntityPtr)0x0) { local_154.y = (float)childRef; std::multiset::erase(&local_154.y); } *childRef = (EntityPtr)local_14c.y; std::multiset::insert(childRef); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,&npc->_splatColor,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 3; auStack_140._4_4_ = 0x41200000; fStack_138 = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(auStack_140 + 4),8,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; ANM2::Play(&npc->_sprite,(byte *)"Surface",0); npc->_state = 4; uVar4 = Random(); iVar11 = uVar4 % 10 + 6; LAB_004a571c: npc->_i1 = 0; LAB_004a5726: npc->_projectileCooldown = iVar11; } if ((((npc->_state == 0x10) || (npc->_state == 6)) && (iVar11 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar11 != 0)) && ((Entity::GetNullOffset((Entity *)npc,&local_164,(byte *)"EffectGuide"), local_164.x != g_vectorZero.x || (local_164.y != g_vectorZero.y)))) { uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_154.y = fVar15 + fVar15; local_14c.y = sin(local_154.y); uVar4 = Random(); local_134.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_14c.x = cos(local_154.y); local_14c.x = local_14c.x * local_134.y; local_14c.y = local_134.y * local_14c.y; local_154.y = local_14c.x * 6.0; local_134.y = local_14c.y * 6.0; uVar4 = Random(); local_16c.y = (npc->_pos).y + 0.0; local_16c.x = local_164.x + local_154.y + (npc->_pos).x; tmpEntity = Game::Spawn(g_game,1000,0x6f,&local_16c,&local_14c,(Entity *)0x0,0,uVar4); tmpColor = &(tmpEntity->_sprite)._color; (tmpEntity->_posOffset).x = 0.0; tmpEntity->_renderDepthOffset = -10.0; (tmpEntity->_posOffset).y = local_164.y + local_134.y; if (tmpColor != &npc->_splatColor) { fVar15 = (npc->_splatColor)._tint[1]; fVar17 = (npc->_splatColor)._tint[2]; fVar16 = (npc->_splatColor)._tint[3]; tmpColor->_tint[0] = (npc->_splatColor)._tint[0]; (tmpEntity->_sprite)._color._tint[1] = fVar15; (tmpEntity->_sprite)._color._tint[2] = fVar17; (tmpEntity->_sprite)._color._tint[3] = fVar16; fVar15 = (npc->_splatColor)._colorize[1]; fVar17 = (npc->_splatColor)._colorize[2]; fVar16 = (npc->_splatColor)._colorize[3]; (tmpEntity->_sprite)._color._colorize[0] = (npc->_splatColor)._colorize[0]; (tmpEntity->_sprite)._color._colorize[1] = fVar15; (tmpEntity->_sprite)._color._colorize[2] = fVar17; (tmpEntity->_sprite)._color._colorize[3] = fVar16; *(undefined8 *)(tmpEntity->_sprite)._color._offset = *(undefined8 *)(npc->_splatColor)._offset ; (tmpEntity->_sprite)._color._offset[2] = (npc->_splatColor)._offset[2]; } (**(code **)(*(int *)tmpEntity + 0xc))(); } iVar11 = npc->_state; if ((((iVar11 == 0x10) || (iVar11 == 4)) || ((iVar11 == 6 || ((iVar11 == 10 || (iVar11 == 0xb))))) ) && ((fVar15 = (npc->_targetPosition).x, fVar15 != g_vectorZero.x || ((npc->_targetPosition).y != g_vectorZero.y)))) { fVar17 = (npc->_targetPosition).y; fVar16 = (npc->_pos).y; (npc->_velocity).x = fVar15 - (npc->_pos).x; (npc->_velocity).y = fVar17 - fVar16; } npc->_friction = frictionScale * npc->_friction; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - elapsedTicks; } game = g_game; if (npc->_dead != 0) { pvVar10 = g_game->_room; iVar11 = *(int *)((int)pvVar10 + 0x7294); if (iVar11 < 0) { *(undefined4 *)((int)pvVar10 + 0x7244) = *(undefined4 *)((int)pvVar10 + 0x1b30); *(undefined4 *)((int)pvVar10 + 0x7248) = *(undefined4 *)((int)pvVar10 + 0x1b34); *(undefined4 *)((int)pvVar10 + 0x724c) = *(undefined4 *)((int)pvVar10 + 0x1b38); *(undefined4 *)((int)pvVar10 + 0x7250) = *(undefined4 *)((int)pvVar10 + 0x1b3c); *(undefined4 *)((int)pvVar10 + 0x7254) = *(undefined4 *)((int)pvVar10 + 0x1b40); *(undefined4 *)((int)pvVar10 + 0x7258) = *(undefined4 *)((int)pvVar10 + 0x1b44); *(undefined4 *)((int)pvVar10 + 0x725c) = *(undefined4 *)((int)pvVar10 + 0x1b48); *(undefined4 *)((int)pvVar10 + 0x7260) = *(undefined4 *)((int)pvVar10 + 0x1b4c); *(undefined4 *)((int)pvVar10 + 0x7264) = *(undefined4 *)((int)pvVar10 + 0x1b50); *(undefined4 *)((int)pvVar10 + 0x7268) = *(undefined4 *)((int)pvVar10 + 0x1b54); } else { fVar15 = 1.0; if (iVar11 != 0) { fVar15 = 1.0 - (float)*(int *)((int)pvVar10 + 0x7298) / (float)iVar11; if (fVar15 <= 0.0) { fVar15 = 0.0; } if (1.0 <= fVar15) { fVar15 = 1.0; } } *(float *)((int)pvVar10 + 0x7244) = (*(float *)((int)pvVar10 + 0x726c) - *(float *)((int)pvVar10 + 0x7244)) * fVar15 + *(float *)((int)pvVar10 + 0x7244); *(float *)((int)pvVar10 + 0x7248) = (*(float *)((int)pvVar10 + 0x7270) - *(float *)((int)pvVar10 + 0x7248)) * fVar15 + *(float *)((int)pvVar10 + 0x7248); *(float *)((int)pvVar10 + 0x724c) = (*(float *)((int)pvVar10 + 0x7274) - *(float *)((int)pvVar10 + 0x724c)) * fVar15 + *(float *)((int)pvVar10 + 0x724c); *(float *)((int)pvVar10 + 0x7250) = (*(float *)((int)pvVar10 + 0x7278) - *(float *)((int)pvVar10 + 0x7250)) * fVar15 + *(float *)((int)pvVar10 + 0x7250); *(float *)((int)pvVar10 + 0x7258) = (*(float *)((int)pvVar10 + 0x7280) - *(float *)((int)pvVar10 + 0x7258)) * fVar15 + *(float *)((int)pvVar10 + 0x7258); *(float *)((int)pvVar10 + 0x725c) = (*(float *)((int)pvVar10 + 0x7284) - *(float *)((int)pvVar10 + 0x725c)) * fVar15 + *(float *)((int)pvVar10 + 0x725c); *(float *)((int)pvVar10 + 0x7260) = (*(float *)((int)pvVar10 + 0x7288) - *(float *)((int)pvVar10 + 0x7260)) * fVar15 + *(float *)((int)pvVar10 + 0x7260); *(float *)((int)pvVar10 + 0x7264) = (*(float *)((int)pvVar10 + 0x728c) - *(float *)((int)pvVar10 + 0x7264)) * fVar15 + *(float *)((int)pvVar10 + 0x7264); } *(undefined4 *)((int)pvVar10 + 0x726c) = 0x3ee8f5c3; *(undefined4 *)((int)pvVar10 + 0x7270) = 0x3e978d50; *(undefined4 *)((int)pvVar10 + 0x7274) = 0x3e020c4a; *(undefined4 *)((int)pvVar10 + 0x7278) = 0x3f333333; *(undefined4 *)((int)pvVar10 + 0x7280) = 0x3f800000; *(undefined4 *)((int)pvVar10 + 0x7284) = 0x3f4ccccd; *(undefined4 *)((int)pvVar10 + 0x7288) = 0x3f333333; *(undefined4 *)((int)pvVar10 + 0x728c) = 0x3f800000; *(undefined4 *)((int)pvVar10 + 0x727c) = 0; *(undefined4 *)((int)pvVar10 + 0x7290) = 0; *(undefined4 *)((int)pvVar10 + 0x7294) = 0x5a; *(undefined4 *)((int)pvVar10 + 0x7298) = 0x5a; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_17c,1000,0x8d,-1,0,0 ); i = 0; if (local_170 != (undefined4 *)0x0) { do { iVar11 = *(int *)(local_17c._4_4_ + i * 4); if (((iVar11 != 0) && (*(int *)(iVar11 + 0x28) == 1000)) && (*(Entity_NPC **)(iVar11 + 0x3c8) == npc)) { *(undefined4 *)(iVar11 + 0x45c) = 0x1e; *(undefined4 *)(iVar11 + 0x460) = 0x1e; } i = i + 1; } while ((uint)i < local_170); } if (local_17c[0] == '\0') { local_14 = 3; tracked_alloc(1,(void *)local_17c._4_4_,0); } } ExceptionList = local_1c; return; } //@@ 004a5cf0 Sprite::GetDefaultAnimationName /* DB: src/anm2 labels (lua_GetDefaultAnimationName); ZHL said Config::GetNullItems */ std_string * __thiscall Sprite::GetDefaultAnimationName(Sprite *this) { return &this->_animDefaultName; } //@@ 004a5d00 Game::HasHallucination /* ZHL [lua] Lua binding Game:HasHallucination */ bool __thiscall Game::HasHallucination(Game *this) { return 0 < this->_hallucinationTimer; } //@@ 004a5d10 ANM2::LoadDeliriumForm /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? reloads entity anm2, rewrites layer paths to Bosses/AfterbirthPlus/DeliriumForms prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl ANM2::LoadDeliriumForm(ANM2 *sprite,int type,int variant,byte isReloadAnm2) { char *_Dst; uint uVar1; undefined4 uVar2; undefined1 *puVar3; EntityConfig_Entity *entityConfig; LayerState *pLVar4; int iVar5; std_string *psVar6; byte *pbVar7; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; ANM2 *extraout_ECX; ANM2 *extraout_ECX_00; ANM2 *pAVar8; uint uVar9; char *_Src; uint uVar10; size_t tailLen; std_string *ptr; uint uVar11; uint replacedLen; uint newCapacity; byte bVar12; byte *layerIdx; std_string sheetPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af305d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; pAVar8 = sprite; puVar3 = (undefined1 *)((int)register0x00000010 + -4); if (isReloadAnm2 != 0) { entityConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,type,variant,0); pAVar8 = extraout_ECX; puVar3 = puStack_20; if (entityConfig != (EntityConfig_Entity *)0x0) { Load(sprite,&entityConfig->anm2Path,0); pAVar8 = extraout_ECX_00; puVar3 = puStack_20; } } puStack_20 = puVar3; bVar12 = (byte)pAVar8; layerIdx = (byte *)0x0; if (sprite->_layerCount != 0) { do { pLVar4 = GetLayer(sprite,layerIdx); sheetPath._buf[0] = '\0'; sheetPath._buf[1] = '\0'; sheetPath._buf[2] = '\0'; sheetPath._buf[3] = '\0'; sheetPath._size = 0; sheetPath._capacity = 0; psVar6 = &pLVar4->_spriteSheetPath; uVar11 = (pLVar4->_spriteSheetPath)._size; if (0xf < (pLVar4->_spriteSheetPath)._capacity) { psVar6 = *(std_string **)psVar6->_buf; } if (uVar11 < 0x10) { sheetPath._buf._0_4_ = *(undefined4 *)psVar6->_buf; sheetPath._buf._4_4_ = *(undefined4 *)(psVar6->_buf + 4); sheetPath._buf._8_4_ = *(undefined4 *)(psVar6->_buf + 8); sheetPath._buf._12_4_ = *(undefined4 *)(psVar6->_buf + 0xc); uVar10 = 0xf; bVar12 = extraout_CL; } else { uVar10 = uVar11 | 0xf; if (0x7fffffff < uVar10) { uVar10 = 0x7fffffff; } sheetPath._buf._0_4_ = std::_Allocate(uVar10 + 1); memcpy((void *)sheetPath._buf._0_4_,psVar6,uVar11 + 1); bVar12 = extraout_CL_00; } local_14 = 0; sheetPath._size = uVar11; sheetPath._capacity = uVar10; if (type != 0x19c) { psVar6 = &sheetPath; if (0xf < uVar10) { psVar6 = (std_string *)sheetPath._buf._0_4_; } iVar5 = _strnicmp(psVar6->_buf + 4,"bosses",6); uVar10 = sheetPath._capacity; uVar11 = sheetPath._size; if (iVar5 == 0) { if (sheetPath._size < 4) { /* WARNING: Subroutine does not return */ FUN_00499950(); } replacedLen = 6; if (sheetPath._size - 4 < 6) { replacedLen = sheetPath._size - 4; } if (replacedLen == 0x23) { psVar6 = &sheetPath; if (0xf < sheetPath._capacity) { psVar6 = (std_string *)sheetPath._buf._0_4_; } memmove(psVar6->_buf + 4,"Bosses/AfterbirthPlus/DeliriumForms",0x23); LAB_004a609a: } else { tailLen = (sheetPath._size - replacedLen) - 3; if (0x23 < replacedLen) { sheetPath._size = (sheetPath._size - replacedLen) + 0x23; psVar6 = &sheetPath; if (0xf < sheetPath._capacity) { psVar6 = (std_string *)sheetPath._buf._0_4_; } memmove(psVar6->_buf + 4,"Bosses/AfterbirthPlus/DeliriumForms",0x23); memmove(psVar6[1]._buf + 0xf,psVar6->_buf + 4 + replacedLen,tailLen); goto LAB_004a609a; } uVar9 = -replacedLen + 0x23; if (uVar9 <= sheetPath._capacity - sheetPath._size) { psVar6 = &sheetPath; if (0xf < sheetPath._capacity) { psVar6 = (std_string *)sheetPath._buf._0_4_; } _Src = psVar6->_buf + replacedLen + 4; _Dst = psVar6->_buf + 4; if (((byte *)0xb1e25e < _Dst) || (psVar6->_buf + sheetPath._size < "Bosses/AfterbirthPlus/DeliriumForms")) { pbVar7 = &DAT_00000023; } else if ("Bosses/AfterbirthPlus/DeliriumForms" < _Src) { pbVar7 = (byte *)(_Src + -0xb1e23c); } else { pbVar7 = (byte *)0x0; } sheetPath._size = sheetPath._size + uVar9; memmove(_Src + uVar9,_Src,tailLen); memmove(_Dst,"Bosses/AfterbirthPlus/DeliriumForms",(size_t)pbVar7); memcpy(pbVar7 + (int)_Dst, pbVar7 + (int)("Bosses/AfterbirthPlus/DeliriumForms" + -replacedLen + 0x23), 0x23 - (int)pbVar7); goto LAB_004a609a; } if (0x7fffffff - sheetPath._size < uVar9) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar9 = uVar9 + sheetPath._size; newCapacity = uVar9 | 0xf; if (newCapacity < 0x80000000) { if (0x7fffffff - (sheetPath._capacity >> 1) < sheetPath._capacity) { newCapacity = 0x7fffffff; } else { uVar1 = sheetPath._capacity + (sheetPath._capacity >> 1); if (newCapacity < uVar1) { newCapacity = uVar1; } } } else { newCapacity = 0x7fffffff; } psVar6 = std::_Allocate(newCapacity + 1); uVar2 = sheetPath._buf._0_4_; tailLen = (uVar11 - replacedLen) - 3; sheetPath._size = uVar9; sheetPath._capacity = newCapacity; if (uVar10 < 0x10) { *(undefined4 *)psVar6->_buf = sheetPath._buf._0_4_; psVar6->_buf[4] = 'B'; psVar6->_buf[5] = 'o'; psVar6->_buf[6] = 's'; psVar6->_buf[7] = 's'; psVar6->_buf[8] = 'e'; psVar6->_buf[9] = 's'; psVar6->_buf[10] = '/'; psVar6->_buf[0xb] = 'A'; psVar6->_buf[0xc] = 'f'; psVar6->_buf[0xd] = 't'; psVar6->_buf[0xe] = 'e'; psVar6->_buf[0xf] = 'r'; psVar6->_size = 0x74726962; psVar6->_capacity = 0x756c5068; builtin_strncpy(psVar6[1]._buf,"s/DeliriumForms",0xf); memcpy(psVar6[1]._buf + 0xf,sheetPath._buf + replacedLen + 4,tailLen); sheetPath._buf._0_4_ = psVar6; goto LAB_004a609a; } *(undefined4 *)psVar6->_buf = *(undefined4 *)(char *)sheetPath._buf._0_4_; psVar6->_buf[4] = 'B'; psVar6->_buf[5] = 'o'; psVar6->_buf[6] = 's'; psVar6->_buf[7] = 's'; psVar6->_buf[8] = 'e'; psVar6->_buf[9] = 's'; psVar6->_buf[10] = '/'; psVar6->_buf[0xb] = 'A'; psVar6->_buf[0xc] = 'f'; psVar6->_buf[0xd] = 't'; psVar6->_buf[0xe] = 'e'; psVar6->_buf[0xf] = 'r'; psVar6->_size = 0x74726962; psVar6->_capacity = 0x756c5068; builtin_strncpy(psVar6[1]._buf,"s/DeliriumForms",0xf); memcpy(psVar6[1]._buf + 0xf,(char *)sheetPath._buf._0_4_ + replacedLen + 4,tailLen); uVar11 = uVar10 + 1; ptr = (std_string *)uVar2; if (0xfff < uVar11) { ptr = (std_string *)((std_string *)(uVar2 + -0x18))->_capacity; uVar11 = uVar10 + 0x24; if ((byte *)0x1f < (byte *)(uVar2 + (-4 - (int)ptr))) goto LAB_004a622d; } operator_delete(ptr,uVar11); sheetPath._buf._0_4_ = psVar6; } psVar6 = &sheetPath; if (0xf < sheetPath._capacity) { psVar6 = (std_string *)sheetPath._buf._0_4_; } pbVar7 = FileSystem::ResolvePath((byte *)psVar6); bVar12 = pbVar7 != (byte *)0x0; if (pbVar7 != (byte *)0x0) { local_14._0_1_ = 1; tracked_alloc(1,pbVar7,0); local_14 = (uint)local_14._1_3_ << 8; Sprite::ReplaceSpritesheet((Sprite *)sprite,(int)layerIdx,&sheetPath); bVar12 = extraout_CL_01; } } else { psVar6 = &sheetPath; if (0xf < sheetPath._capacity) { psVar6 = (std_string *)sheetPath._buf._0_4_; } iVar5 = _strnicmp(psVar6->_buf + 4,"monsters",8); bVar12 = extraout_CL_02; if (iVar5 == 0) { std::string::replace (sheetPath._buf,4,8,(byte *)"Bosses/AfterbirthPlus/DeliriumForms",0x23); psVar6 = &sheetPath; if (0xf < sheetPath._capacity) { psVar6 = (std_string *)sheetPath._buf._0_4_; } pbVar7 = FileSystem::ResolvePath((byte *)psVar6); bVar12 = pbVar7 != (byte *)0x0; if (pbVar7 != (byte *)0x0) { local_14._0_1_ = 2; tracked_alloc(1,pbVar7,0); local_14 = (uint)local_14._1_3_ << 8; Sprite::ReplaceSpritesheet((Sprite *)sprite,(int)layerIdx,&sheetPath); bVar12 = extraout_CL_03; } } } } local_14 = 0xffffffff; if (0xf < sheetPath._capacity) { uVar11 = sheetPath._capacity + 1; psVar6 = (std_string *)sheetPath._buf._0_4_; if (0xfff < uVar11) { psVar6 = (std_string *)((std_string *)(sheetPath._buf._0_4_ + -0x18))->_capacity; uVar11 = sheetPath._capacity + 0x24; if ((byte *)0x1f < (byte *)(sheetPath._buf._0_4_ + (-4 - (int)psVar6))) { LAB_004a622d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar6,uVar11); bVar12 = extraout_CL_04; } layerIdx = layerIdx + 1; } while (layerIdx < (byte *)sprite->_layerCount); } LoadGraphics(sprite,bVar12); psVar6 = &sprite->_animDefaultName; if (0xf < (sprite->_animDefaultName)._capacity) { psVar6 = *(std_string **)psVar6->_buf; } bVar12 = SetAnimation(sprite,(byte *)psVar6,1); if (((bVar12 != 0) && ((sprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&sprite->_animState,0.0), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } ExceptionList = local_1c; return; } //@@ 004a6240 NpcHelper::delirium_remove_minions /* DB: (type, variant, self, other): Entity::Remove (vfn 0x28) every room NPC that is not self/alive-check and matches type.variant or other type.variant; type 0x4f (Fistula) also removes the QuerySublist entries; from ENTITY_DELIRIUM morph */ void NpcHelper::delirium_remove_minions(int *param_1,int param_2) { void *pvVar1; qword qVar2; char cVar3; uint uVar4; int in_ECX; int iVar5; int in_EDX; qword *allocCounter; code *freeFn; uint npcIdx; EntityList_EL laserList; EntityList_EL tmpList; int targetVariant; int targetType; void *local_10; undefined1 *puStack_c; undefined4 local_8; int roomEntity; int *tmpEntity; local_8 = 0xffffffff; puStack_c = &LAB_00af30b5; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; npcIdx = 0; pvVar1 = g_game->_room; targetVariant = in_EDX; targetType = in_ECX; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { tmpEntity = *(int **)(*(int *)((int)pvVar1 + 0x125c) + npcIdx * 4); if ((tmpEntity == param_1) || (cVar3 = (**(code **)(*tmpEntity + 0x4c))(uVar4), cVar3 == '\0') ) { LAB_004a62c2: if (param_2 != 0) { iVar5 = *(int *)((int)pvVar1 + 0x125c); roomEntity = *(int *)(iVar5 + npcIdx * 4); if ((*(int *)(roomEntity + 0x28) == *(int *)(param_2 + 0x28)) && (*(int *)(roomEntity + 0x2c) == *(int *)(param_2 + 0x2c))) goto LAB_004a62df; } } else { iVar5 = *(int *)((int)pvVar1 + 0x125c); roomEntity = *(int *)(iVar5 + npcIdx * 4); if ((*(int *)(roomEntity + 0x28) != targetType) || (*(int *)(roomEntity + 0x2c) != targetVariant)) goto LAB_004a62c2; LAB_004a62df: (**(code **)(**(int **)(iVar5 + npcIdx * 4) + 0x28))(); } npcIdx = npcIdx + 1; } while (npcIdx < *(uint *)((int)pvVar1 + 0x1264)); in_ECX = targetType; } if (in_ECX == 0x4f) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&tmpList,0x4f,0x14,-1,0,0); iVar5 = tmpList._size; pvVar1 = tmpList._data; local_8 = 0; uVar4 = 0; if (tmpList._size != 0) { do { (**(code **)(**(int **)((int)pvVar1 + uVar4 * 4) + 0x28))(); uVar4 = uVar4 + 1; } while (uVar4 < (uint)iVar5); } joined_r0x004a63ae: local_8 = 0xffffffff; if (tmpList._0_1_ == '\0') { local_8 = 0xffffffff; if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (pvVar1 != (void *)0x0) { uVar4 = *(uint *)((int)pvVar1 + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar4); free((void *)((int)pvVar1 + -4)); } local_8 = 0xffffffff; } } else if (in_ECX == 0x197) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&tmpList,1000,0x65,-1,0,0); iVar5 = tmpList._size; pvVar1 = tmpList._data; local_8 = 2; uVar4 = 0; if (tmpList._size != 0) { do { (**(code **)(**(int **)((int)pvVar1 + uVar4 * 4) + 0x28))(); uVar4 = uVar4 + 1; } while (uVar4 < (uint)iVar5); } goto joined_r0x004a63ae; } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&laserList,7,-1,-1,0,0); local_8 = 4; uVar4 = 0; if (laserList._size != 0) { do { tmpEntity = *(int **)((int)laserList._data + uVar4 * 4); if (tmpEntity[0xd] != 1) { (**(code **)(*tmpEntity + 0x28))(); } uVar4 = uVar4 + 1; } while (uVar4 < (uint)laserList._size); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&tmpList,0x60,0,-1,0,0); local_8 = CONCAT31(local_8._1_3_,5); uVar4 = 0; if (tmpList._size != 0) { do { (**(code **)(**(int **)((int)tmpList._data + uVar4 * 4) + 0x28))(); uVar4 = uVar4 + 1; } while (uVar4 < (uint)tmpList._size); } if (tmpList._0_1_ == '\0') { allocCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (tmpList._data != (void *)0x0) { uVar4 = *(uint *)((int)tmpList._data + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; freeFn = free_exref; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar4); free((void *)((int)tmpList._data + -4)); goto LAB_004a64bb; } } freeFn = free_exref; LAB_004a64bb: if (laserList._0_1_ == '\0') { allocCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (laserList._data != (void *)0x0) { uVar4 = *(uint *)((int)laserList._data + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar4); (*freeFn)((int)laserList._data + -4); } } ExceptionList = local_10; return; } //@@ 004a6500 NpcAI::ENTITY_DELIRIUM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 412 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DELIRIUM(Entity_NPC *npc) { char cVar1; byte bVar2; uint uVar3; int iVar4; undefined4 uVar5; byte *pbVar6; byte *pbVar7; uint uVar8; EntityConfig_Entity *bossConfig; uint uVar9; Entity *tmpEntity; Vector *direction; int *piVar10; char *pcVar11; byte *pbVar12; byte *******pppppppbVar13; ANM2 *pAVar14; Game *game; void *i; void *pvVar15; uint rngBits; Room *room; PlayerManager *playerManager; bool bVar16; float fVar17; float deltaY; double dVar18; TypeDescriptor *pTVar19; TypeDescriptor *pTVar20; undefined4 uVar21; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; void *local_b4; void *local_b0; Game *local_ac; float local_a8; byte *******local_a4; void *local_a0; Entity_NPC *local_9c; Vector local_98; EntityList_EL entityList; Vector local_80; void *local_78; Vector local_74; Vector local_6c; Vector local_64; float local_58; Entity_NPC *local_54; void *local_50; Game *local_4c; ANM2 *local_48; char isBigHornStateDone; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; byte *******pppppppbStack_2c; float fStack_28; float fStack_24; float local_20; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; std_vector *damageEvents; void **deliriumEntitySlot; code *initFn; Manager *manager; int queriedEntity; EntityPtr segment; short *transformTimer; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00af312f; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_6c.y = npc->_maxHitPoints; local_4c = (Game *)npc->_health; local_54 = npc; local_14 = uVar3; if (local_6c.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar17 = ((float)local_4c - 0.0) / (local_6c.y - 0.0); if (fVar17 <= 0.0) { fVar17 = 0.0; } local_58 = 1.0; if (1.0 <= fVar17) { fVar17 = 1.0; } iVar4 = (int)(fVar17 * 5.0 + 0.0); local_6c.y = *(float *)(&DAT_00c5c630 + iVar4 * 8); local_98.y = *(float *)(&DAT_00c5c634 + iVar4 * 8); if (npc->_dead != 0) { NpcHelper::delirium_remove_minions(npc); uVar3 = 0; pvVar15 = g_game->_room; if (*(int *)((int)pvVar15 + 0x1264) != 0) { do { piVar10 = *(int **)(*(int *)((int)pvVar15 + 0x125c) + uVar3 * 4); if ((((*(int *)&g_game->_deathmatchManager < 2) || (piVar10[10] != 1)) && (0x3dd < piVar10[10] - 10U)) || (((cVar1 = (**(code **)(*piVar10 + 0x48))(), cVar1 == '\0' || (piVar10[10] == 0x362)) || ((piVar10[0x5a] & 0x20000000U) != 0)))) { bVar16 = false; } else { bVar16 = true; } if (bVar16) { uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_30 = 0; pppppppbStack_2c = (byte *******)g_vectorZero.x; fStack_28 = g_vectorZero.y; fStack_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = 0; local_18 = 0; (**(code **)(*piVar10 + 0x24))(); } if (piVar10[10] == 9) { *(undefined1 *)((int)piVar10 + 0x173) = 1; } uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)pvVar15 + 0x1264)); npc = local_54; } game = g_game; fVar17 = npc->_size; npc->_dead = 0; Room::GetClampedPositionImpl(game->_room,&local_64,&npc->_pos,fVar17,fVar17,fVar17,fVar17); (**(code **)(*(int *)npc + 0x44))(); initFn = *(code **)(*(int *)npc + 4); Random(); (*initFn)(0x19c,0,0); (npc->_pos).x = local_64.x; (npc->_pos).y = local_64.y; bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_deliriumState = 0x11; npc->_deliriumTransformationTimer = 5; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; npc->_health = 1.0; npc->_isInvicible = 1; npc->_entityCollisionClass = 0; ExceptionList = local_10; return; } bVar2 = npc->_deliriumState; if (bVar2 == 0x11) { if ((npc->_sprite)._loaded != 0) { AnimationState::Update(&(npc->_sprite)._animState); AnimationState::Update(&(npc->_sprite)._overlayAnimState); } if (0 < g_game->_hallucinationTimer) goto LAB_004a68bf; uVar5 = 0x3f; if (npc->_deliriumTransformationTimer == 1) { uVar5 = 0x11; } Game::ShowHallucination (g_game,(int)((float)(ushort)npc->_deliriumTransformationTimer * 0.4 * 30.0),uVar5); transformTimer = &npc->_deliriumTransformationTimer; *transformTimer = *transformTimer + -1; manager = g_manager; if (*transformTimer != 0) goto LAB_004a68bf; npc->_deliriumState = 0x12; npc->_deliriumTransformationTimer = 10; local_58 = 2.34017e-43; seed_fart_sound_override((int *)&local_58); SoundEffects::Play(&manager->_sfxManager,(int)local_58,5.0,2,0,0.1,0.0); LAB_004a68a0: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"IdleNoLoop",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004a68bf: (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; ExceptionList = local_10; return; } if (bVar2 == 0x12) { pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 != (byte *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pcVar11 = "IdleNoLoop"; do { bVar2 = *pbVar6; bVar16 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004a6930: uVar3 = -(uint)bVar16 | 1; goto LAB_004a6935; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar16 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004a6930; pbVar6 = pbVar6 + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004a6935: if (uVar3 == 0) { ANM2::Update(&npc->_sprite); ANM2::Update(&npc->_sprite); pbVar7 = (npc->_sprite)._animState._animData; } } if ((pbVar7 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { pbVar7 = &s_empty; } else if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar11 = "IdleNoLoop"; do { bVar2 = *pbVar7; bVar16 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004a6994: uVar3 = -(uint)bVar16 | 1; goto LAB_004a6999; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar16 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004a6994; pbVar7 = pbVar7 + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004a6999: if (uVar3 == 0) { transformTimer = &npc->_deliriumTransformationTimer; *transformTimer = *transformTimer + -1; if (*transformTimer == 0) { ANM2::Play(&npc->_sprite,(byte *)"Scream",0); goto LAB_004a68bf; } goto LAB_004a68a0; } } } pbVar7 = (npc->_sprite)._animState._animData; if ((pbVar7 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar11 = "Scream"; do { bVar2 = *pbVar7; bVar16 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004a6a08: uVar3 = -(uint)bVar16 | 1; goto LAB_004a6a0d; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar16 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004a6a08; pbVar7 = pbVar7 + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004a6a0d: if (uVar3 == 0) { npc->_dead = 1; } } goto LAB_004a68bf; } if (bVar2 == 0) { npc->_isInvicible = 1; pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 != (byte *)0x0) { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = s_Idle; do { bVar2 = *pbVar6; bVar16 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004a6a66: uVar3 = -(uint)bVar16 | 1; goto LAB_004a6a6b; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar16 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004a6a66; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004a6a6b: if ((uVar3 == 0) && ((pbVar7[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004a6a9e; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004a6a9e: npc->_deliriumState = 0x10; npc->_deliriumBossType = 0; npc->_deliriumBossVariant = 0; uVar3 = Random(); npc->_deliriumTransformationTimer = (short)(int)((float)((double)(int)(uVar3 % 0xffffffff) + __uint_to_double_fixup[-((int)(uVar3 % 0xffffffff) >> 0x1f)]) / (4.2949673e+09 / (local_98.y - local_6c.y)) + local_6c.y) * 0x1e; uVar3 = Random(); npc->_deliriumAttackID = 0xff; *(undefined4 *)&npc->_deliriumAttackAngle = 0; npc->_state = 8; npc->_deliriumRemainingAttacks = (char)(uVar3 % 3) + 2; npc->_shieldFrames = 0x78; uVar3 = npc->_deliriumCycleID; uVar9 = local_54->_deliriumCycleID; uVar8 = Random(); local_54->_deliriumCycleID = (uVar8 % 600 + 300) * 0x8000 & 0x1ff8000 | (uVar9 >> 7 & 0xff | (uVar9 >> 0x19) << 0x12) << 7 | uVar3 & 0x7f; local_54->_deliriumCycleIDHigh = 0; ExceptionList = local_10; return; } if (bVar2 == 8) { transformTimer = &npc->_deliriumTransformationTimer; *transformTimer = *transformTimer + -1; if ((*transformTimer == 0) || (bVar2 = 8, npc->_deliriumRemainingAttacks == 0)) { npc->_deliriumState = 0x10; bVar2 = 0x10; npc->_stateFrame = 0; } } local_48 = (ANM2 *)npc->_health; local_9c = (Entity_NPC *)npc->_maxHitPoints; iVar4 = npc->_deliriumBossType; npc->_shieldStrength = (1.0 - (float)local_48 / (float)local_9c) * 80.0; if (iVar4 == 0x19c) { npc->_shieldStrength = 0.0; } if (bVar2 != 0x10) { if (bVar2 != 8) { ExceptionList = local_10; return; } local_80.y = (float)npc->_type; local_64.y = (float)npc->_variant; npc->_type = iVar4; npc->_variant = npc->_deliriumBossVariant; if (iVar4 == 0x19c) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar7 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar11 = "Blink"; do { bVar2 = *pbVar7; bVar16 = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004a7bc0: uVar3 = -(uint)bVar16 | 1; goto LAB_004a7bc5; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar16 = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004a7bc0; pbVar7 = pbVar7 + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004a7bc5: if (uVar3 == 0) { ANM2::Play(&npc->_sprite,s_Idle,0); } } game = g_game; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; local_74.x = (npc->_pos).x - 100.0; local_74.y = (npc->_pos).y - 100.0; bVar2 = Camera::IsPosVisible(*(Camera **)((int)game->_room + 0x11f8),&local_74); if (bVar2 == 0) { local_74.x = (npc->_pos).x + 100.0; local_74.y = (npc->_pos).y - 100.0; bVar2 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&local_74); if (bVar2 == 0) { local_74.x = (npc->_pos).x - 100.0; local_74.y = (npc->_pos).y + 100.0; bVar2 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&local_74); if (bVar2 == 0) { local_74.x = (npc->_pos).x + 100.0; local_74.y = (npc->_pos).y + 100.0; bVar2 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&local_74); if (bVar2 == 0) { uVar3 = npc->_deliriumCycleID; uVar9 = uVar3 >> 0xf & 0x3ff; if (0x1e < uVar9) { uVar9 = 0x1e; } local_54->_deliriumCycleIDHigh = 0; local_54->_deliriumCycleID = (((uVar3 >> 0x19) << 10 | uVar9) << 8 | uVar3 >> 7 & 0xff) << 7 | uVar3 & 0x7f; npc = local_54; } } } } } else { isBigHornStateDone = '\0'; if (iVar4 == 0x19b) { if (((npc->_state == 4) && (npc->_stateFrame == 0)) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { isBigHornStateDone = '\x01'; } else { isBigHornStateDone = '\0'; } } local_74.y = (float)npc->_i1; damageEvents = &npc->_damageEvents; local_78 = (npc->_damageEvents)._end; local_50 = (void *)0x0; local_b4 = (void *)0x0; local_4c = (Game *)0x0; local_ac = (Game *)0x0; local_6c.y = (float)damageEvents->_begin; local_b0 = (void *)0x0; if ((void *)local_6c.y != local_78) { uVar9 = ((int)local_78 - (int)local_6c.y) / 0x38; if (0x4924924 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar3); } uVar9 = uVar9 * 0x38; local_b4 = std::_Allocate(uVar9); local_ac = (Game *)(uVar9 + (int)local_b4); local_b0 = local_b4; local_b0 = (void *)FUN_004aaaf0(local_6c.y,local_78,local_b4); local_4c = local_ac; local_50 = local_b4; } pvVar15 = local_b0; local_a8 = npc->_pendingDamage; local_a4 = *(byte ********)&npc->_pendingDamageFlags; local_a0 = *(void **)((int)&npc->_pendingDamageFlags + 4); local_8 = 4; (npc->_damageEvents)._end = damageEvents->_begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; local_b4 = local_50; local_ac = local_4c; local_98.y = (float)local_a0; local_78 = (void *)local_a8; local_6c.y = (float)local_a4; NpcHelper::delirium_morph_update(npc); npc->_health = (float)local_48; npc->_maxHitPoints = (float)local_9c; if (damageEvents != (std_vector *)&local_b4) { std::vector::assign_0x38(local_50,pvVar15,local_64.y); } cVar1 = isBigHornStateDone; *(float *)&npc->_pendingDamageFlags = local_6c.y; npc->_pendingDamage = (float)local_78; *(float *)((int)&npc->_pendingDamageFlags + 4) = local_98.y; local_48 = (ANM2 *)npc->_type; if (local_48 == (ANM2 *)0x19b) { uVar3 = 0; pvVar15 = g_game->_room; local_48 = (ANM2 *)0x19b; if (*(int *)((int)pvVar15 + 0x1264) != 0) { do { iVar4 = *(int *)(*(int *)((int)pvVar15 + 0x125c) + uVar3 * 4); if (((cVar1 != '\0') && (*(int *)(iVar4 + 0x28) == 0x19b)) && (*(int *)(iVar4 + 0x2c) == 1)) { ANM2::LoadDeliriumForm((ANM2 *)(iVar4 + 0x48),0x19b,1,0); } uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)pvVar15 + 0x1264)); local_48 = (ANM2 *)local_54->_type; npc = local_54; } } uVar3 = npc->_deliriumCycleID; rngBits = uVar3 >> 0xf & 0x3ff; uVar8 = __ftoui3(); npc = local_54; uVar9 = 0; if (uVar8 <= rngBits) { uVar9 = rngBits - uVar8; } local_54->_deliriumCycleIDHigh = 0; local_54->_deliriumCycleID = ((uVar9 & 0x3ff | (uVar3 >> 0x19) << 10) << 8 | (uint)local_54->_deliriumCycleID >> 7 & 0xff) << 7 | local_54->_deliriumCycleID & 0x7fU; if (((ANM2 *)local_54->_deliriumBossType == local_48) && (local_54->_deliriumBossVariant == local_54->_variant)) { pAVar14 = local_48; } else { local_54->_deliriumBossType = (int)local_48; local_54->_deliriumBossVariant = local_54->_variant; ANM2::LoadDeliriumForm(&local_54->_sprite,(int)local_48,local_54->_variant,0); pAVar14 = (ANM2 *)npc->_type; } if ((int)local_74.y < npc->_i1) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,(int)pAVar14, npc->_variant + 10,-1,0,0); pvVar15 = (void *)0x0; local_8._0_1_ = 5; if ((void *)entityList._size != (void *)0x0) { do { ANM2::LoadDeliriumForm(&npc->_sprite,npc->_type,npc->_variant,0); ANM2::LoadDeliriumForm ((ANM2 *)(*(int *)((int)entityList._data + (int)pvVar15 * 4) + 0x48), npc->_type,npc->_variant + 10,1); pvVar15 = (void *)((int)pvVar15 + 1); } while (pvVar15 < (uint)entityList._size); } local_8 = CONCAT31(local_8._1_3_,4); EntityList_Query::~EntityList_Query(&entityList); pAVar14 = (ANM2 *)npc->_type; } if (pAVar14 == (ANM2 *)0x41) { if (((npc->_variant == 1) && (bVar2 = Entity::IsFrame((Entity *)npc,8,0), bVar2 != 0)) && ((npc->_state == 9 && (((npc->_stateFrame < 3 && (1 < npc->_stateFrame)) && (npc->_spawnerType != 0x41)))))) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,0x41,1,-1,0,0); iVar4 = entityList._size; local_8._0_1_ = 6; pvVar15 = (void *)0x0; if ((void *)entityList._size != (void *)0x0) { do { ANM2::LoadDeliriumForm ((ANM2 *)(*(int *)((int)entityList._data + (int)pvVar15 * 4) + 0x48), npc->_type,npc->_variant,1); pvVar15 = (void *)((int)pvVar15 + 1); } while (pvVar15 < (uint)iVar4); } local_8 = CONCAT31(local_8._1_3_,4); EntityList_Query::~EntityList_Query(&entityList); pAVar14 = (ANM2 *)npc->_type; goto LAB_004a7933; } } else { LAB_004a7933: if (pAVar14 == (ANM2 *)&DAT_00000065) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,0x65,npc->_variant,-1,0 ,0); local_8._0_1_ = 7; local_98.y = 0.0; if ((void *)entityList._size != (void *)0x0) { do { local_9c = *(Entity_NPC **)((int)entityList._data + (int)local_98.y * 4); if (local_9c != npc) { pvVar15 = (local_9c->_sprite)._animState._animData; pAVar14 = &local_9c->_sprite; local_48 = pAVar14; if (pvVar15 == (void *)0x0) { iVar4 = -1; } else { local_74.y = (local_9c->_sprite)._animState._animFrame; dVar18 = floor((double)local_74.y); local_74.y = (float)dVar18; iVar4 = (int)dVar18; } if (iVar4 == 0) { if (pvVar15 == (void *)0x0) { local_18 = 0xf; local_1c = 0; pppppppbStack_2c = (byte *******)0x0; } else { std::string::string((char *)&pppppppbStack_2c,pvVar15); } local_8 = CONCAT31(local_8._1_3_,8); ANM2::LoadDeliriumForm(pAVar14,npc->_type,npc->_variant,1); pAVar14 = local_48; local_6c.y = (float)&pppppppbStack_2c; if (0xf < local_18) { local_6c.y = (float)pppppppbStack_2c; } pbVar7 = (local_48->_animState)._animData; if (pbVar7 == (byte *)0x0) { LAB_004a7a7b: bVar2 = ANM2::SetAnimation(local_48,(byte *)local_6c.y,1); if (bVar2 != 0) { AnimationState::Rewind(&pAVar14->_animState); (pAVar14->_animState)._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pppppppbVar13 = (byte *******)local_6c.y; do { bVar2 = *pbVar7; bVar16 = bVar2 < *(byte *)pppppppbVar13; if (bVar2 != *(byte *)pppppppbVar13) { LAB_004a7a60: uVar3 = -(uint)bVar16 | 1; goto LAB_004a7a65; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar16 = bVar2 < *(byte *)((int)pppppppbVar13 + 1); if (bVar2 != *(byte *)((int)pppppppbVar13 + 1)) goto LAB_004a7a60; pbVar7 = pbVar7 + 2; pppppppbVar13 = (byte *******)((int)pppppppbVar13 + 2); } while (bVar2 != 0); uVar3 = 0; LAB_004a7a65: if ((uVar3 != 0) || ((*(char *)((int)(local_48->_animState)._animData + 0x34) != '\0' && ((local_48->_animState)._isPlaying == 0)))) goto LAB_004a7a7b; } local_8._0_1_ = 7; local_9c->_isInvicible = 1; if (0xf < local_18) { uVar3 = local_18 + 1; pppppppbVar13 = pppppppbStack_2c; if (0xfff < uVar3) { pppppppbVar13 = (byte *******)pppppppbStack_2c[-1]; uVar3 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbStack_2c + (-4 - (int)pppppppbVar13)) ) goto LAB_004a7b68; } operator_delete(pppppppbVar13,uVar3); } } } local_98.y = (float)((int)local_98.y + 1); } while ((uint)local_98.y < (uint)entityList._size); } if (entityList._0_1_ == '\0') { local_8 = CONCAT31(local_8._1_3_,9); tracked_alloc(1,entityList._data,0); } } } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (local_50 != (void *)0x0) { uVar3 = (((int)local_4c - (int)local_50) / 0x38) * 0x38; pvVar15 = local_50; if (0xfff < uVar3) { pvVar15 = *(void **)((int)local_50 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_50 + (-4 - (int)pvVar15))) { LAB_004a7b68: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar15,uVar3); } } NpcHelper::delirium_fire_pattern(npc); npc->_type = (int)local_80.y; npc->_variant = (int)local_64.y; local_78 = (void *)npc->_deliriumCycleID; local_20 = 0.0; local_1c = 0; local_9c = (Entity_NPC *)((uint)local_78 >> 7 & 0xff); fVar17 = (float)(((uint)local_78 >> 0x19 | (npc->_deliriumCycleIDHigh & 7U) << 7) + 1); uVar3 = (uint)local_78 >> 0xf & 0x3ff; local_18 = 0; local_30 = 0; pppppppbStack_2c = (byte *******)0x0; fStack_28 = 0.0; fStack_24 = 0.0; if (local_9c == (Entity_NPC *)0x0) { uStack_3c = 0x3f800000; uStack_38 = 0x3f800000; } else { uStack_3c = 0x3f333333; uStack_38 = 0x3f333333; } local_40 = 0x3f800000; uStack_34 = 0x3f800000; local_74.y = fVar17; (**(code **)(*(int *)npc + 0x3c))(&local_40,0xffffffff,0xff,0); uVar9 = npc->_deliriumBossType; if (uVar9 < 0x107) { if (uVar9 == 0x106) goto LAB_004a81e2; switch(uVar9) { case 0x24: case 0x2d: case 0x4e: case 0x66: goto LAB_004a81e2; } } else { switch(uVar9) { case 0x107: case 0x10a: case 0x10e: case 0x111: case 0x19d: goto LAB_004a81e2; } } bVar16 = uVar3 == 0; uVar3 = uVar3 - 1; if (bVar16) { uVar3 = Random(); local_4c = (Game *)((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * 160.0 + 160.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); if (((tmpEntity->_velocity).x == g_vectorZero.x) && ((tmpEntity->_velocity).y == g_vectorZero.y)) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_64.y = (tmpEntity->_pos).x; local_80.y = (tmpEntity->_pos).y; direction = MusicManager::RandomVector(&local_6c); } else { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_64.y = (tmpEntity->_pos).x; local_80.y = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_6c.x = (tmpEntity->_velocity).x; local_6c.y = (tmpEntity->_velocity).y; direction = Vector::Normalized(&local_6c,&local_98); } local_64.x = (float)local_4c * direction->x + local_64.y; local_64.y = (float)local_4c * direction->y + local_80.y; Room::GetClampedPositionImpl(room,&local_80,&local_64,160.0,160.0,160.0,160.0); local_54 = (Entity_NPC *)local_80.x; local_50 = (void *)local_80.y; local_48 = (ANM2 *)0x0; uVar3 = Random(); local_64.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 360.0; do { uVar3 = 0; playerManager = &g_game->_playerManager; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) { LAB_004a8344: KAGE_LogMessage(1,(byte *)"??? teleport: %d tries\n"); (npc->_pos).x = (float)local_54; (npc->_pos).y = (float)local_50; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_58 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_58 = 0.5; } local_4c = (Game *)0xd6; seed_fart_sound_override((int *)&local_4c); SoundEffects::Play(&manager->_sfxManager,(int)local_4c,1.0,2,0,local_58,0.0); npc->_deliriumAttackID = npc->_deliriumAttackID & 0xffffff; *(undefined4 *)&npc->_deliriumAttackAngle = 0; fVar17 = 0.0; goto LAB_004a81ce; } while( true ) { pvVar15 = (playerManager->_playerList)._end; if ((int)pvVar15 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar15 = (playerManager->_playerList)._end; game = g_game; } piVar10 = (playerManager->_playerList)._begin; if (uVar3 < (uint)((int)pvVar15 - (int)piVar10 >> 2)) { piVar10 = piVar10 + uVar3; } fVar17 = *(float *)(*piVar10 + 0x33c) - (float)local_54; deltaY = *(float *)(*piVar10 + 0x340) - (float)local_50; if (deltaY * deltaY + fVar17 * fVar17 < 25600.0) break; playerManager = &game->_playerManager; uVar3 = uVar3 + 1; if ((uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2) <= uVar3) goto LAB_004a8344; } room = game->_room; local_4c = (Game *)((float)(int)local_48 * 160.0 * 0.25 + 320.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); uVar3 = (uint)local_48 & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } local_80.y = ((float)(int)uVar3 * 90.0 + local_64.y) * 0.017453292; fVar17 = cos(local_80.y); local_6c.x = fVar17 * (float)local_4c + (tmpEntity->_pos).x; fVar17 = sin(local_80.y); local_6c.y = fVar17 * (float)local_4c + (tmpEntity->_pos).y; Room::GetClampedPositionImpl(room,&local_98,&local_6c,160.0,160.0,160.0,160.0); local_48 = (ANM2 *)((local_48->_filename)._buf + 1); local_50 = (void *)local_98.y; local_54 = (Entity_NPC *)local_98.x; } while ((int)local_48 < 0x14); KAGE_LogMessage(1,(byte *)"??? teleport: %d tries\n"); fVar17 = local_74.y; LAB_004a81ce: uVar3 = Random(); uVar3 = uVar3 % 600 + 300; } LAB_004a81e2: npc->_deliriumCycleIDHigh = 0; npc->_deliriumCycleID = ((uVar3 & 0x3ff | (int)fVar17 << 10) << 8 | (uint)local_9c & 0xff) << 7 | (uint)local_78 & 0x7f; if ((npc->_stateFrame == 1) && ((((((iVar4 = npc->_state, iVar4 == 6 || (iVar4 == 7)) || (iVar4 == 0x10)) || ((iVar4 == 8 || (iVar4 == 9)))) || (iVar4 == 10)) || (((iVar4 == 0xb || (iVar4 == 0xd)) || ((iVar4 == 0xe || (iVar4 == 0xf)))))))) { npc->_deliriumRemainingAttacks = npc->_deliriumRemainingAttacks - 1; } pvVar15 = npc->_deliriumEntity; if (pvVar15 == (void *)0x0) { ExceptionList = local_10; return; } if (*(char *)((int)pvVar15 + 0x173) == '\0') { local_c4 = 0; local_c0 = 0; local_bc = 0; local_b8 = 0; local_b4 = (void *)g_vectorZero.x; local_b0 = (void *)g_vectorZero.y; local_ac = (Game *)g_vectorZero.x; local_a8 = g_vectorZero.y; local_a4 = (byte *******)0x0; local_a0 = (void *)0x0; (**(code **)(*(int *)npc + 0x20)) (*(undefined4 *)((int)pvVar15 + 0x14),*(undefined4 *)((int)pvVar15 + 0x18), *(undefined4 *)((int)pvVar15 + 0x1c),&local_c4,0x1e); NpcHelper::delirium_morph_update(npc->_deliriumEntity); NpcHelper::delirium_fire_pattern(npc->_deliriumEntity); ExceptionList = local_10; return; } ExceptionList = local_10; return; } NpcHelper::delirium_remove_minions(npc); if (((npc->_deliriumBossType == 0x111) && (npc->_deliriumBossVariant == 10)) && (npc->_child != (EntityPtr)0x0)) { (**(code **)(*(int *)npc->_child + 0x28))(); } uVar3 = Random(); local_48 = (ANM2 *)(uVar3 % 100); local_58 = 1.4013e-43; iVar4 = 0; local_50 = (void *)0x19c; do { pvVar15 = local_50; local_58 = (float)((int)local_58 + -1); if ((local_48 < 10) || (((local_50 != (void *)0x19c && (local_50 != (void *)0x38a)) && (((local_50 != (void *)0x38b && (bossConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,(int)local_50,iVar4,0), (bossConfig->tags & 0x200U) == 0)) && ((pvVar15 != (void *)npc->_deliriumBossType || (iVar4 != npc->_deliriumBossVariant)))))))) break; iVar4 = 0; local_4c = g_game; local_50 = (void *)0x0; uVar3 = *(int *)(g_game->_encounteredBosses + 4) - *(int *)g_game->_encounteredBosses >> 3; if (uVar3 != 0) { uVar9 = Random(); uVar9 = uVar9 % uVar3; local_50 = *(void **)(*(int *)local_4c->_encounteredBosses + uVar9 * 8); iVar4 = *(int *)(*(int *)local_4c->_encounteredBosses + 4 + uVar9 * 8); } } while (local_58 != 0.0); npc->_deliriumBossType = (int)local_50; npc->_deliriumBossVariant = iVar4; if (local_50 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"No form for Delirium"); } uVar3 = npc->_deliriumCycleID; local_58 = (float)(uVar3 >> 0x19 | (npc->_deliriumCycleIDHigh & 7U) << 7); uVar9 = npc->_deliriumCycleID & 0x7f; if ((npc->_deliriumBossType == 0x2d) || ((npc->_deliriumBossType == 0x54 && (npc->_deliriumBossVariant == 10)))) { LAB_004a6dd0: uVar8 = 0; } else { uVar8 = Random(); if (uVar9 <= uVar8 % 100) { uVar9 = uVar9 + 10; goto LAB_004a6dd0; } uVar8 = 0x78; uVar9 = 0; } npc->_deliriumCycleIDHigh = 0; iVar4 = npc->_deliriumBossType; npc->_deliriumCycleID = ((uVar3 >> 0xf & 0x3ff | (int)local_58 << 10) << 8 | uVar8) << 7 | uVar9 & 0x7f; if (iVar4 == 0x10a) { npc->_deliriumBossVariant = 0; } else if ((iVar4 == 0x2d) || ((iVar4 == 0x54 && (uVar3 = Random(), (uVar3 & 1) == 0)))) { npc->_deliriumBossVariant = 10; } local_50 = (void *)npc->_type; fVar17 = npc->_size; local_58 = npc->_health; local_78 = (void *)npc->_variant; npc->_type = npc->_deliriumBossType; npc->_variant = npc->_deliriumBossVariant; local_48 = (ANM2 *)npc->_maxHitPoints; Room::GetClampedPositionImpl(g_game->_room,&local_64,&npc->_pos,fVar17,fVar17,fVar17,fVar17); (**(code **)(*(int *)npc + 0x44))(); KAGE_LogMessage(1,(byte *)"Changed Delirium form to %d:%u.\n"); initFn = *(code **)(*(int *)npc + 4); uVar3 = Random(); (*initFn)(npc->_type,npc->_variant,0,uVar3); (npc->_pos).x = local_64.x; (npc->_pos).y = local_64.y; npc->_deliriumBossType = npc->_type; npc->_state = 0; npc->_deliriumBossVariant = npc->_variant; uVar3 = Random(); npc->_deliriumTransformationTimer = (short)(int)((float)((double)(int)(uVar3 % 0xffffffff) + __uint_to_double_fixup[-((int)(uVar3 % 0xffffffff) >> 0x1f)]) / (4.2949673e+09 / (local_98.y - local_6c.y)) + local_6c.y) * 0x1e; uVar3 = Random(); pAVar14 = &npc->_sprite; npc->_deliriumRemainingAttacks = (char)(uVar3 % 3) + 2; ANM2::LoadDeliriumForm(pAVar14,npc->_type,npc->_variant,1); NpcHelper::delirium_spawn_form_parts(npc,(float)local_48); FUN_004a84f0(); npc->_deliriumState = 8; npc->_stateFrame = 0; if (npc->_type == 0x54) { if (npc->_deliriumBossVariant == 10) { npc->_entityCollisionClass = 0; } else { npc->_i1 = 2; npc->_state = 4; } } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_4c = (Game *)(tmpEntity->_pos).x; local_6c.y = (tmpEntity->_pos).y; if ((npc->_type == 0x24) || (npc->_type == 0x4e)) { Entity_NPC_UpdateAI_dispatch(npc); } tmpEntity = Entity_NPC::GetPlayerTarget(npc); (tmpEntity->_pos).x = (float)local_4c; (tmpEntity->_pos).y = local_6c.y; iVar4 = npc->_type; if (iVar4 == 0x2d) { Entity_NPC::PlaySound(npc,0x65,1.0,0x2d,0,1.0); uVar5 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; *(undefined4 *)((int)&npc->_flags + 4) = uVar5; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; iVar4 = npc->_type; npc->_state = 3; npc->_subtype = 2; npc->_projectileCooldown = 0x1e; npc->_entityCollisionClass = 0; } if (iVar4 == 0x4f) { Entity_NPC_UpdateAI_dispatch(npc); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,npc->_type,0x14,-1,0,0); iVar4 = entityList._size; pvVar15 = entityList._data; local_8 = 0; i = (void *)0x0; if ((void *)entityList._size != (void *)0x0) { do { queriedEntity = *(int *)((int)pvVar15 + (int)i * 4); ANM2::LoadDeliriumForm ((ANM2 *)(queriedEntity + 0x48),*(int *)(queriedEntity + 0x28), *(int *)(queriedEntity + 0x2c),1); i = (void *)((int)i + 1); } while (i < (uint)iVar4); npc = local_54; } segment = npc->_child; if (segment != (EntityPtr)0x0) { ANM2::LoadDeliriumForm ((ANM2 *)((int)segment + 0x48),*(int *)((int)segment + 0x28), *(int *)((int)segment + 0x2c),1); } if (entityList._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,entityList._data,0); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; pAVar14 = &npc->_sprite; } if (npc->_type == 0x197) { Entity_NPC_UpdateAI_dispatch(npc); npc->_state = 3; pbVar7 = (pAVar14->_animState)._animData; if (pbVar7 != (byte *)0x0) { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = s_Idle; do { bVar2 = *pbVar6; bVar16 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004a71c3: uVar3 = -(uint)bVar16 | 1; goto LAB_004a71c8; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar16 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004a71c3; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_004a71c8: if ((uVar3 == 0) && ((pbVar7[0x34] == 0 || ((pAVar14->_animState)._isPlaying != 0)))) goto LAB_004a71f4; } bVar2 = ANM2::SetAnimation(pAVar14,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&pAVar14->_animState); (pAVar14->_animState)._isPlaying = 1; } } LAB_004a71f4: if (npc->_type == 0x45) { if (npc->_variant == 1) goto LAB_004a7212; } else if (npc->_type == 0x19a) { LAB_004a7212: Entity_NPC_UpdateAI_dispatch(npc); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,npc->_type,npc->_variant,-1,0 ,0); local_8 = 2; pvVar15 = (void *)0x0; if ((void *)entityList._size != (void *)0x0) { do { iVar4 = *(int *)((int)entityList._data + (int)pvVar15 * 4); ANM2::LoadDeliriumForm ((ANM2 *)(iVar4 + 0x48),*(int *)(iVar4 + 0x28),*(int *)(iVar4 + 0x2c),1); pvVar15 = (void *)((int)pvVar15 + 1); } while (pvVar15 < (uint)entityList._size); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (entityList._0_1_ == '\0') { local_8 = 3; tracked_alloc(1,entityList._data,0); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; } } if (npc->_type == 0x19a) { deliriumEntitySlot = &npc->_deliriumEntity; segment = npc->_child; if (npc->_deliriumEntity != (void *)0x0) { local_4c = (Game *)deliriumEntitySlot; std::multiset::erase(&local_4c); } *deliriumEntitySlot = (void *)segment; if (segment != (EntityPtr)0x0) { std::multiset::insert(deliriumEntitySlot); } } iVar4 = npc->_type; if (iVar4 == 0x107) { Entity_NPC_UpdateAI_dispatch(npc); iVar4 = npc->_type; } if (iVar4 == 0x61) { Entity_NPC_UpdateAI_dispatch(npc); segment = npc->_child; uVar3 = 0; do { while (segment != (EntityPtr)0x0) { ANM2::LoadDeliriumForm ((ANM2 *)((int)segment + 0x48),*(int *)((int)segment + 0x28), *(int *)((int)segment + 0x2c),1); if (uVar3 == 0) { segment = *(EntityPtr *)((int)segment + 0x3c0); } else { segment = *(EntityPtr *)((int)segment + 0x3bc); } } segment = npc->_parent; uVar3 = uVar3 + 1; } while (uVar3 < 2); iVar4 = npc->_type; } if (iVar4 == 0x111) { if (npc->_variant != 10) goto LAB_004a740d; Entity_NPC_UpdateAI_dispatch(npc); iVar4 = npc->_type; } if (((iVar4 == 0x1c) || (iVar4 == 0x3e)) || (iVar4 == 0x4e)) { Entity_NPC_UpdateAI_dispatch(npc); segment = npc->_child; uVar3 = 0; do { while (segment != (EntityPtr)0x0) { ANM2::LoadDeliriumForm ((ANM2 *)((int)segment + 0x48),*(int *)((int)segment + 0x28), *(int *)((int)segment + 0x2c),1); *(uint *)((int)segment + 0x168) = *(uint *)((int)segment + 0x168) | 0x80040000; *(ANM2 **)((int)segment + 0x380) = local_48; *(ANM2 **)((int)segment + 900) = local_48; *(undefined1 *)((int)segment + 0x3b0) = 1; *(undefined4 *)((int)segment + 0x16c) = *(undefined4 *)((int)segment + 0x16c); if (uVar3 == 0) { segment = *(EntityPtr *)((int)segment + 0x3c0); } else { segment = *(EntityPtr *)((int)segment + 0x3bc); } } segment = npc->_parent; uVar3 = uVar3 + 1; } while (uVar3 < 2); iVar4 = npc->_type; } if (iVar4 == 0x1c) { npc->_state = 1; } LAB_004a740d: uVar3 = 2; npc->_deliriumCycleID = npc->_deliriumCycleID & 0x1ffffff; npc->_health = local_58; npc->_maxHitPoints = (float)local_48; npc->_type = (int)local_50; npc->_variant = (int)local_78; local_64.y = (float)npc->_deliriumCycleIDHigh; npc->_deliriumCycleIDHigh = 0; if (npc->_size < 13.0) { uVar3 = 1; } if ((18.0 <= npc->_size) || (30.0 < npc->_shadowSize)) { uVar3 = 3; } uVar9 = Random(); uVar21 = 0; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar5 = 0; tmpEntity = Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)npc,uVar3,uVar9); iVar4 = __RTDynamicCast(tmpEntity,uVar5,pTVar19,pTVar20,uVar21); *(float *)(iVar4 + 0x34c) = (npc->_posOffset).x; *(float *)(iVar4 + 0x350) = (npc->_posOffset).y; *(float *)(iVar4 + 0x358) = (npc->_posOffset).y + 1.0; ExceptionList = local_10; return; } //@@ 004a84f0 FUN_004a84f0 void FUN_004a84f0(void) { uint variant; float fVar1; uint uVar2; uint *puVar3; uint uVar4; Vector *position; Entity_NPC *npc; Entity *in_ECX; Vector local_14; uint *local_c; Entity *local_8; uVar4 = in_ECX->_type; variant = in_ECX->_variant; local_8 = in_ECX; uVar2 = Random(); if ((uVar2 & 1) == 0) { puVar3 = &DAT_00b1e980; local_c = (uint *)0x0; while ((uVar2 = puVar3[-2], uVar4 != uVar2 || (variant != puVar3[-1]))) { if ((uVar4 == *puVar3) && (variant == puVar3[1])) goto LAB_004a857c; local_c = (uint *)((int)local_c + 1); puVar3 = puVar3 + 5; if (0xb1ebff < (int)puVar3) { return; } } } else { puVar3 = &DAT_00b1ebec; local_c = (uint *)&DAT_0000001f; while ((uVar2 = puVar3[-2], uVar4 != uVar2 || (variant != puVar3[-1]))) { if ((uVar4 == *puVar3) && (variant == puVar3[1])) goto LAB_004a857c; local_c = (uint *)((int)local_c + -1); puVar3 = puVar3 + -5; if ((int)puVar3 < 0xb1e980) { return; } } } uVar2 = *puVar3; LAB_004a857c: uVar4 = Random(); if ((int)(uVar4 % 100) < *(int *)(&UNK_00b1e988 + (int)local_c * 0x14)) { uVar4 = Random(); position = Room::GetRandomPosition(g_game->_room,&local_14,0.0); npc = (Entity_NPC *)Game::Spawn(g_game,uVar2,variant,position,&g_vectorZero,local_8,0,uVar4); npc->_health = local_8->_maxHitPoints; fVar1 = local_8->_maxHitPoints; *(uint *)&npc->_flags = (uint)npc->_flags | 0x80040000; npc->_maxHitPoints = fVar1; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); ANM2::LoadDeliriumForm(&npc->_sprite,uVar2,variant,1); NpcHelper::delirium_spawn_form_parts(npc,local_8->_maxHitPoints); local_8 = (Entity *)&local_8[2]._entityPtrReferrers._size; if (*(uint *)local_8 != 0) { local_c = (uint *)local_8; std::multiset::erase(&local_c); } *(Entity_NPC **)local_8 = npc; std::multiset::insert(local_8); (**(code **)(*(int *)npc + 0xc))(); KAGE_LogMessage(1,(byte *)"Spawned Delirium companion %d:%u\n"); } return; } //@@ 004a8680 NpcHelper::delirium_spawn_form_parts /* DB: only caller FUN_004a84f0 (Delirium next-boss-form picker, called from NpcAI::ENTITY_DELIRIUM): for type 0x13 (Larry Jr) spawns 4..9 body segments linked through +0x3bc/+0x3c0, ANM2::LoadDeliriumForm + WalkBodyHori; for type 0x10a spawns variants 1 and 2 at the boss position prototype: db/protos.zhl */ void __cdecl NpcHelper::delirium_spawn_form_parts(Entity_NPC *npc,float maxHealth) { undefined4 uVar1; undefined4 uVar2; byte bVar3; uint uVar4; Entity *target; EntityPtr EVar5; void *newBlock; byte *curAnimChar; uint uVar6; char *expectedAnimChar; Entity_NPC *spawner; bool isCharLess; float fVar7; Vector spawnPos; float dirX; EntityPtr local_24; float formMaxHealth; Entity_NPC *formNpc; int segmentCount; float segmentIndex; EntityPtr *local_10; float local_c; float dirY; byte *animData; EntityPtr *linkSlot; EntityPtr posBlock; int velBlock; formMaxHealth = maxHealth; formNpc = npc; if (npc->_type == 0x13) { uVar4 = Random(); segmentCount = uVar4 % 6 + 4; target = Entity_NPC::GetPlayerTarget(npc); dirY = (npc->_pos).x - (target->_pos).x; local_c = (npc->_pos).y - (target->_pos).y; fVar7 = sqrtf(dirY * dirY + local_c * local_c); if (0.0 < fVar7) { dirY = dirY * (1.0 / fVar7); local_c = local_c * (1.0 / fVar7); } uVar4 = Random(); segmentIndex = (float)(int)(uVar4 % 0x5a - 0x2d) * 0.017453292; local_10 = (EntityPtr *)cos(segmentIndex); fVar7 = sin(segmentIndex); segmentIndex = 1.4013e-45; dirX = dirY * (float)local_10 - local_c * fVar7; dirY = dirY * fVar7 + local_c * (float)local_10; spawner = npc; if (0 < segmentCount) { do { fVar7 = segmentIndex; spawnPos.y = (float)(int)segmentIndex * 20.0 * dirY + (spawner->_pos).y; spawnPos.x = (float)(int)segmentIndex * 20.0 * dirX + (spawner->_pos).x; uVar4 = Random(); local_10 = (EntityPtr *)(((float)(uVar4 % 5000) + 0.0) / 1000.0); uVar4 = Random(); spawnPos.x = ((float)(uVar4 % 5000) + 0.0) / 1000.0 + spawnPos.x; spawnPos.y = spawnPos.y + (float)local_10; uVar4 = Random(); EVar5 = (EntityPtr) Game::Spawn(g_game,spawner->_type,spawner->_variant,&spawnPos,&g_vectorZero, (Entity *)spawner,0,uVar4); if (fVar7 == 1.4013e-45) { *(float *)((int)EVar5 + 0x380) = formMaxHealth; *(float *)((int)EVar5 + 900) = formMaxHealth; *(byte *)((int)EVar5 + 0x3b0) = 1; } linkSlot = (EntityPtr *)((int)EVar5 + 0x3bc); if (*(EntityPtr *)((int)EVar5 + 0x3bc) != (EntityPtr)0x0) { local_10 = linkSlot; std::multiset::erase(&local_10); } *linkSlot = (EntityPtr)npc; if ((EntityPtr)npc != (EntityPtr)0x0) { std::multiset::insert(linkSlot); } linkSlot = (EntityPtr *)((int)npc + 0x3c0); if (*(int *)((int)npc + 0x3c0) != 0) { local_10 = linkSlot; std::multiset::erase(&local_10); } *linkSlot = EVar5; std::multiset::insert(linkSlot); uVar6 = *(uint *)((int)EVar5 + 0x168) & 0xfffffffb | 0x80040000; *(undefined4 *)((int)EVar5 + 0x16c) = *(undefined4 *)((int)EVar5 + 0x16c); *(uint *)((int)EVar5 + 0x168) = uVar6; *(undefined4 *)((int)EVar5 + 0xb64) = 4; uVar4 = *(uint *)((int)EVar5 + 0xc10); if (((uVar4 & 1) == 0) && (*(uint *)((int)EVar5 + 0xc0c) <= *(int *)((int)EVar5 + 0xc14) + 2U >> 1)) { std::deque::_Growmap(uVar6); uVar4 = *(uint *)((int)EVar5 + 0xc10); } uVar6 = *(int *)((int)EVar5 + 0xc0c) * 2; uVar4 = uVar6 - 1 & uVar4; *(uint *)((int)EVar5 + 0xc10) = uVar4; if (uVar4 == 0) { uVar4 = uVar6; } uVar4 = uVar4 - 1; local_c = (float)(*(int *)((int)EVar5 + 0xc0c) - 1U & uVar4 >> 1); local_10 = *(EntityPtr **)((int)EVar5 + 0xc08); local_24 = (EntityPtr)uVar4; if (local_10[(int)local_c] == (EntityPtr)0x0) { newBlock = operator_new(0x10); *(void **)(*(int *)((int)EVar5 + 0xc08) + (int)local_c * 4) = newBlock; local_10 = *(EntityPtr **)((int)EVar5 + 0xc08); } uVar1 = *(undefined4 *)((int)EVar5 + 0x340); uVar2 = *(undefined4 *)((int)EVar5 + 0x33c); posBlock = local_10[(int)local_c]; *(undefined4 *)((int)posBlock + (uVar4 & 1) * 8) = uVar2; *(undefined4 *)((int)posBlock + 4 + (uVar4 & 1) * 8) = uVar1; *(int *)((int)EVar5 + 0xc14) = *(int *)((int)EVar5 + 0xc14) + 1; *(EntityPtr *)((int)EVar5 + 0xc10) = local_24; uVar4 = *(uint *)((int)EVar5 + 0xc24); if (((uVar4 & 1) == 0) && (*(uint *)((int)EVar5 + 0xc20) <= *(int *)((int)EVar5 + 0xc28) + 2U >> 1)) { std::deque::_Growmap(uVar2); uVar4 = *(uint *)((int)EVar5 + 0xc24); } uVar6 = *(int *)((int)EVar5 + 0xc20) * 2; uVar4 = uVar6 - 1 & uVar4; *(uint *)((int)EVar5 + 0xc24) = uVar4; if (uVar4 == 0) { uVar4 = uVar6; } uVar4 = uVar4 - 1; local_10 = (EntityPtr *)(*(int *)((int)EVar5 + 0xc20) - 1U & uVar4 >> 1); local_c = *(float *)((int)EVar5 + 0xc1c); local_24 = (EntityPtr)uVar4; if (*(int *)((int)local_c + (int)local_10 * 4) == 0) { newBlock = operator_new(0x10); *(void **)(*(int *)((int)EVar5 + 0xc1c) + (int)local_10 * 4) = newBlock; local_c = *(float *)((int)EVar5 + 0xc1c); } uVar1 = *(undefined4 *)((int)EVar5 + 0x360); velBlock = *(int *)((int)local_c + (int)local_10 * 4); *(undefined4 *)(velBlock + 4 + (uVar4 & 1) * 8) = *(undefined4 *)((int)EVar5 + 0x364); *(undefined4 *)(velBlock + (uVar4 & 1) * 8) = uVar1; *(int *)((int)EVar5 + 0xc28) = *(int *)((int)EVar5 + 0xc28) + 1; *(EntityPtr *)((int)EVar5 + 0xc24) = local_24; *(int *)((int)EVar5 + 0xc7c) = formNpc->_groupIdx; ANM2::LoadDeliriumForm((ANM2 *)((int)EVar5 + 0x48),formNpc->_type,formNpc->_variant,1); animData = *(byte **)((int)EVar5 + 0x7c); local_24 = EVar5; if (animData == (byte *)0x0) { LAB_004a8acc: bVar3 = ANM2::SetAnimation((ANM2 *)((int)EVar5 + 0x48),(byte *)"WalkBodyHori",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)EVar5 + 0x78)); *(undefined1 *)((int)EVar5 + 0x8c) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedAnimChar = "WalkBodyHori"; do { bVar3 = *curAnimChar; isCharLess = bVar3 < (byte)*expectedAnimChar; if (bVar3 != *expectedAnimChar) { LAB_004a8ab6: uVar4 = -(uint)isCharLess | 1; goto LAB_004a8abb; } if (bVar3 == 0) break; bVar3 = curAnimChar[1]; isCharLess = bVar3 < (byte)expectedAnimChar[1]; if (bVar3 != expectedAnimChar[1]) goto LAB_004a8ab6; curAnimChar = curAnimChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004a8abb: if ((uVar4 != 0) || ((animData[0x34] != 0 && (*(char *)((int)EVar5 + 0x8c) == '\0')))) goto LAB_004a8acc; } (**(code **)(*(int *)EVar5 + 0xc))(); segmentIndex = (float)((int)segmentIndex + 1); npc = (Entity_NPC *)local_24; spawner = formNpc; if (segmentCount < (int)segmentIndex) { return; } } while( true ); } } else if (npc->_type == 0x10a) { uVar4 = Random(); Game::Spawn(g_game,npc->_type,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); uVar4 = Random(); Game::Spawn(g_game,npc->_type,2,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); } return; } //@@ 004a8b70 NpcHelper::delirium_fire_pattern /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Delirium (from NpcAI::ENTITY_DELIRIUM, after morph back): 11 bullet patterns picked by npc+0xbd8 byte (0xff = random), spiral angle tables, FireProjectiles; skips while type 0x2d or 0x54.10 prototype: db/protos.zhl */ void __fastcall NpcHelper::delirium_fire_pattern(Entity_NPC *npc) { byte bVar1; int iVar2; Entity *target; int iVar3; uint uVar4; byte *animNameCh; char *expectedNameCh; char repeatByte; uint uVar5; int iVar6; bool bVar7; float fVar8; undefined1 auVar9 [16]; undefined1 auVar10 [16]; int fireInterval; uint keepPatternChance; uint patternId; float altColorizeR; Vector projVelocity; undefined8 local_16c; float local_164; uint repeatsLeft; int burstCount; float local_158; uint extraBulletFlags; float colorizeB; float colorizeG; float colorizeR; uint local_144; uint local_140; uint attackAngle; char isAlternating; ProjectileParams projParams; undefined1 local_9c; undefined1 *local_98; undefined4 local_94; undefined1 local_90; float angleTable [16]; int delayTable [17]; uint local_8; uint attackId; byte *curAnimData; local_8 = __security_cookie ^ (uint)(delayTable + 0x12); if (npc->_type == 0x2d) { return; } if ((npc->_deliriumBossType == 0x54) && (npc->_deliriumBossVariant == 10)) { return; } attackId = npc->_deliriumAttackID; patternId = attackId & 0xff; local_140 = attackId >> 8; keepPatternChance = attackId >> 0x10 & 0xff; attackAngle = (uint)npc->_deliriumAttackAngle; uVar5 = local_140 & 0xff; repeatsLeft = uVar5; if (patternId == 0xff) { patternId = Random(); patternId = patternId % 0xb; } iVar2 = 0; colorizeB = 0.0; local_144 = 6; burstCount = 4; projVelocity.x = 3.0; projVelocity.y = 0.0; isAlternating = '\0'; local_164 = 1.26117e-44; local_158 = 1.0; colorizeR = 1.0; colorizeG = 0.4; altColorizeR = 1.0; if (__isa_available < 2) { iVar6 = 0; do { delayTable[iVar2] = iVar6; iVar6 = iVar6 + 5; angleTable[iVar2] = (float)iVar2 * 3.1415927; iVar2 = iVar2 + 1; } while (iVar6 < 0x50); } else { iVar2 = 0; do { auVar10._4_4_ = iVar2 + 1; auVar10._0_4_ = iVar2; auVar10._8_4_ = iVar2 + 2; auVar10._12_4_ = iVar2 + 3; auVar9 = pmulld(auVar10,_DAT_00bab470); angleTable[iVar2] = (float)iVar2 * 3.1415927; angleTable[iVar2 + 1] = (float)auVar10._4_4_ * 3.1415927; angleTable[iVar2 + 2] = (float)auVar10._8_4_ * 3.1415927; angleTable[iVar2 + 3] = (float)auVar10._12_4_ * 3.1415927; delayTable[iVar2] = (int)((-(uint)(auVar9._0_4_ < 0) & 1) + auVar9._0_4_) >> 1; delayTable[iVar2 + 1] = (int)((-(uint)(auVar9._4_4_ < 0) & 1) + auVar9._4_4_) >> 1; delayTable[iVar2 + 2] = (int)((-(uint)(auVar9._8_4_ < 0) & 1) + auVar9._8_4_) >> 1; delayTable[iVar2 + 3] = (int)((-(uint)(auVar9._12_4_ < 0) & 1) + auVar9._12_4_) >> 1; auVar9._4_4_ = iVar2 + 5; auVar9._0_4_ = iVar2 + 4; auVar9._8_4_ = iVar2 + 6; auVar9._12_4_ = iVar2 + 7; auVar10 = pmulld(auVar9,_DAT_00bab470); angleTable[iVar2 + 4] = (float)(iVar2 + 4) * 3.1415927; angleTable[iVar2 + 5] = (float)auVar9._4_4_ * 3.1415927; angleTable[iVar2 + 6] = (float)auVar9._8_4_ * 3.1415927; angleTable[iVar2 + 7] = (float)auVar9._12_4_ * 3.1415927; delayTable[iVar2 + 4] = (int)((-(uint)(auVar10._0_4_ < 0) & 1) + auVar10._0_4_) >> 1; delayTable[iVar2 + 5] = (int)((-(uint)(auVar10._4_4_ < 0) & 1) + auVar10._4_4_) >> 1; delayTable[iVar2 + 6] = (int)((-(uint)(auVar10._8_4_ < 0) & 1) + auVar10._8_4_) >> 1; delayTable[iVar2 + 7] = (int)((-(uint)(auVar10._12_4_ < 0) & 1) + auVar10._12_4_) >> 1; iVar2 = iVar2 + 8; } while (iVar2 < 0x10); } local_16c = 0; repeatByte = (char)local_140; switch(patternId) { case 0: fireInterval = 0x12; local_144 = 0x14; burstCount = 1; if (uVar5 == 0xff) { uVar5 = 2; } projVelocity.x = 2.5; isAlternating = '\x01'; colorizeR = 2.0; colorizeG = 2.0; colorizeB = 2.0; altColorizeR = 3.0; extraBulletFlags = 0x8000000; local_158 = 3.0; break; case 1: fireInterval = 0x19; local_144 = 8; burstCount = 1; projVelocity.x = 4.0; colorizeR = 2.0; colorizeG = 2.8; colorizeB = 2.0; extraBulletFlags = 2; goto LAB_004a9349; case 2: fireInterval = 5; local_144 = 6; projVelocity.x = 4.5; burstCount = 1; delayTable[0] = 0; angleTable[0] = 0.3926991; colorizeR = 2.6; colorizeG = 2.6; colorizeB = 2.6; extraBulletFlags = 0x800000; goto LAB_004a9349; case 3: iVar3 = 0; local_144 = 1; fireInterval = 0x19; iVar6 = 0; projVelocity.x = 4.0; burstCount = 0xc; iVar2 = 0; do { *(int *)((int)delayTable + iVar6) = iVar3; *(int *)((int)delayTable + iVar6 + 0xc) = iVar3; iVar3 = iVar3 + 10; *(undefined4 *)((int)delayTable + iVar6 + 0x18) = *(undefined4 *)((int)delayTable + iVar6); fVar8 = (float)iVar2 * 1.0471976; *(undefined4 *)((int)delayTable + iVar6 + 0x24) = *(undefined4 *)((int)delayTable + iVar6); *(float *)((int)angleTable + iVar6) = fVar8; *(float *)((int)angleTable + iVar6 + 0xc) = fVar8 + 3.1415927; *(float *)((int)angleTable + iVar6 + 0x18) = fVar8 + 1.5707964; *(float *)((int)angleTable + iVar6 + 0x24) = fVar8 + 3.1415927 + 1.5707964; iVar6 = iVar6 + 4; iVar2 = iVar2 + 1; } while (iVar6 < 0xc); if (repeatByte == -1) { uVar5 = 3; } colorizeR = 3.4; colorizeG = 3.4; colorizeB = 3.4; local_158 = 1.0; extraBulletFlags = 0; break; case 4: fireInterval = 0x14; attackAngle = attackAngle + 3; local_144 = 0x14; burstCount = 1; if (repeatByte == -1) { uVar5 = 4; } projVelocity.x = 5.0; colorizeR = 2.4; colorizeG = 2.4; colorizeB = 2.4; extraBulletFlags = 0x20; local_158 = 1.0; repeatsLeft = uVar5; goto LAB_004a9394; case 5: attackAngle = attackAngle + 2; fireInterval = 0x14; local_144 = 10; if (repeatByte == -1) { uVar5 = 2; } burstCount = 1; isAlternating = '\x01'; colorizeR = 3.6; colorizeG = 3.6; colorizeB = 3.6; altColorizeR = 2.2; extraBulletFlags = 0x400000; local_158 = 2.2; break; case 6: colorizeB = 3.8; extraBulletFlags = 0x800; goto LAB_004a9111; case 7: colorizeB = 4.0; extraBulletFlags = 0x1000; LAB_004a9111: uVar4 = 2; projVelocity.x = 5.0; local_144 = 0xe; fireInterval = 0x19; LAB_004a912d: burstCount = 1; if (repeatByte == -1) { uVar5 = uVar4; } local_158 = 1.0; colorizeG = colorizeB; colorizeR = colorizeB; break; case 8: attackAngle = attackAngle + 4; fireInterval = 10; colorizeB = 2.6; local_144 = 10; projVelocity.x = 4.0; uVar4 = 3; extraBulletFlags = 0x200000; goto LAB_004a912d; case 9: fireInterval = 0x1e; attackAngle = attackAngle + 2; local_144 = 0xe; projVelocity.x = 4.0; colorizeR = 2.6; colorizeG = 2.6; colorizeB = 2.6; goto LAB_004a933d; case 10: burstCount = 1; fireInterval = 0x12; target = Entity_NPC::GetPlayerTarget(npc); local_158 = (target->_pos).y - (npc->_pos).y; local_164 = (target->_pos).x - (npc->_pos).x; fVar8 = sqrtf(local_158 * local_158 + local_164 * local_164); if (0.0 < fVar8) { local_158 = local_158 * (1.0 / fVar8); local_164 = local_164 * (1.0 / fVar8); } colorizeB = 3.6; projVelocity.x = local_164 * 4.0; if ((char)local_140 == -1) { uVar5 = 4; } local_164 = 7.00649e-45; projVelocity.y = local_158 * 4.0; local_158 = 1.0; extraBulletFlags = 0; colorizeG = colorizeB; colorizeR = colorizeB; break; default: fireInterval = 10; LAB_004a933d: extraBulletFlags = 0; LAB_004a9349: isAlternating = '\0'; local_164 = 1.26117e-44; altColorizeR = 1.0; if (uVar5 == 0xff) { uVar5 = 1; isAlternating = '\0'; local_164 = 1.26117e-44; altColorizeR = 1.0; break; } goto LAB_004a938e; } repeatsLeft = uVar5; LAB_004a938e: LAB_004a9394: uVar5 = local_144; local_140 = 0; iVar2 = 4; if (npc->_type == 0x19c) { iVar2 = 1; } bVar7 = false; iVar6 = 0; local_16c = (ulonglong)(uint)(((float)(int)attackAngle / 255.0) * 6.2831855) << 0x20; do { iVar3 = (attackId >> 0x18) - delayTable[iVar6]; local_144 = iVar3 / (iVar2 * fireInterval); if (iVar3 % (iVar2 * fireInterval) == 0) { projParams.GridCollision = 1; projParams.HeightModifier = 0.0; projParams.FallingSpeedModifier = 0.0; projParams.FallingAccelModifier = 0.0; projParams.VelocityMulti = 1.0; projParams.Scale = 1.0; uVar4 = Random(); projParams.Color._offset[0] = 0.0; projParams.Color._offset[1] = 0.0; projParams.Color._offset[2] = 0.0; projParams.DotProductLimit = -1000.0; projParams.WiggleFrameOffset = 0; projParams.ChangeVelocity = 0.0; projParams.PositionOffset.x = g_vectorZero.x; projParams.TargetPosition.x = g_vectorZero.x; projParams.FireDirectionLimit.x = g_vectorZero.x; projParams.ChangeTimeout = 0x1e; projParams.DepthOffset = 0.0; projParams.Variant = 0; local_9c = 0; local_98 = &DAT_bf800000; local_94 = 0; local_90 = 0; projParams.HeightModifier = 5.0; projParams.CircleAngle = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; projParams.HomingStrength = 1.0; projParams.CurvingStrength = 0.005; projParams.Acceleration = 1.01; projParams.Spread = 1.0; projParams.Color._tint[0] = 1.0; projParams.Color._tint[1] = 1.0; projParams.Color._tint[2] = 1.0; projParams.Color._tint[3] = 1.0; projParams.Color._colorize[0] = 0.0; projParams.Color._colorize[1] = 0.0; projParams.Color._colorize[2] = 0.0; projParams.Color._colorize[3] = 0.0; projParams.BulletFlags = 0; projParams.PositionOffset.y = g_vectorZero.y; projParams.TargetPosition.y = g_vectorZero.y; projParams.FireDirectionLimit.y = g_vectorZero.y; projParams.ChangeFlags = 0; uVar4 = Random(); projParams.FallingAccelModifier = -0.06; projParams.FallingSpeedModifier = -3.2; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | extraBulletFlags; projParams.Color._colorize[3] = 1.0; projParams.Scale = (float)((double)(int)(uVar4 % 0xffffffff) + __uint_to_double_fixup[-((int)(uVar4 % 0xffffffff) >> 0x1f)]) * 2.3283064e-10 + 1.5; projParams.TargetPosition.x = (npc->_pos).x; projParams.TargetPosition.y = (npc->_pos).y; projParams.CircleAngle = local_16c._4_4_ + angleTable[iVar6]; projParams.Color._colorize[0] = colorizeR; projParams.Color._colorize[1] = colorizeG; projParams.Color._colorize[2] = colorizeB; if (isAlternating != '\0') { if ((local_144 & 1) == 0) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x80000; projParams.Color._colorize[0] = altColorizeR; projParams.Color._colorize[1] = local_158; projParams.Color._colorize[2] = local_158; } else { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x40000; } } projParams.BulletFlags = CONCAT44(projParams.BulletFlags._4_4_ | local_140,(uint)projParams.BulletFlags); if (local_164 == 1.26117e-44) { projVelocity.y = (float)(int)uVar5; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&projVelocity,(uint)local_164,&projParams); bVar7 = true; } uVar4 = repeatsLeft; iVar6 = iVar6 + 1; } while (iVar6 < burstCount); if (!bVar7) goto LAB_004a97bc; if (npc->_type == 0x19c) { curAnimData = (npc->_sprite)._animState._animData; if (curAnimData != (byte *)0x0) { animNameCh = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { animNameCh = *(byte **)curAnimData; } expectedNameCh = "Blink"; do { bVar1 = *animNameCh; bVar7 = bVar1 < (byte)*expectedNameCh; if (bVar1 != *expectedNameCh) { LAB_004a9717: uVar5 = -(uint)bVar7 | 1; goto LAB_004a971c; } if (bVar1 == 0) break; bVar1 = animNameCh[1]; bVar7 = bVar1 < (byte)expectedNameCh[1]; if (bVar1 != expectedNameCh[1]) goto LAB_004a9717; animNameCh = animNameCh + 2; expectedNameCh = expectedNameCh + 2; } while (bVar1 != 0); uVar5 = 0; LAB_004a971c: if ((uVar5 == 0) && ((curAnimData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004a9753; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Blink",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004a9753: uVar4 = uVar4 - 1; if ((int)uVar4 < 1) { uVar5 = Random(); if (uVar5 % 100 < keepPatternChance) { keepPatternChance = keepPatternChance - 10; } else { do { uVar5 = Random(); } while (uVar5 % 0xb == patternId); keepPatternChance = 0x1e; attackAngle = Random(); attackAngle = attackAngle % 0xff; patternId = uVar5 % 0xb; } uVar4 = 0xff; } LAB_004a97bc: *(uint *)&npc->_deliriumAttackAngle = attackAngle & 0xff; npc->_deliriumAttackID = ((((attackId >> 0x18) + 1 & 0xff) << 8 | keepPatternChance & 0xff) << 8 | uVar4 & 0xff) << 8 | patternId; /* WARNING: Read-only address (ram,0x00bab470) is written */ return; } //@@ 004a9860 NpcHelper::delirium_morph_update /* DB: ? called twice by NpcAI::ENTITY_DELIRIUM; Taunt/JumpUp/Attack1/HeadlessAttack1 anims then Entity_NPC_UpdateAI_dispatch for the mimicked boss prototype: db/protos.zhl */ void __fastcall NpcHelper::delirium_morph_update(Entity_NPC *npc) { int iVar1; byte isAnimSet; uint nextCycleCount; int iVar2; uint uVar3; uint uVar4; float fVar5; float stepFraction; double dVar6; float fVar7; byte *anim; float local_28; float local_24; uint chanceDivisor; float local_1c; uint aiUpdateCount; int step; float stepVelocityY; float stepVelocityX; uint cycleTime; uint cycleId; Manager *manager; local_28 = npc->_health; if (local_28 == 0.0) { return; } cycleId = npc->_deliriumCycleID; local_24 = npc->_maxHitPoints; uVar4 = cycleId >> 7 & 0xff; cycleTime = cycleId >> 0x19 | (npc->_deliriumCycleIDHigh & 7U) << 7; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } local_1c = (float)__ftoui3(); uVar3 = cycleTime; stepVelocityX = (npc->_velocity).x; stepVelocityY = (npc->_velocity).y; aiUpdateCount = (int)local_1c + 1; chanceDivisor = 3 - (int)local_1c; nextCycleCount = uVar4 - 1; if (uVar4 == 0) { nextCycleCount = 0; fVar7 = local_1c; } else { fVar7 = 4.2039e-45; } iVar2 = npc->_type; iVar1 = (int)fVar7 >> 0x1f; if (iVar2 < 0x194) { if (iVar2 == 0x193) { switchD_004a998d_caseD_45: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * fVar5; stepVelocityY = stepVelocityY * fVar5; goto switchD_004a998d_caseD_15; } switch(iVar2) { case 0x13: case 0x1c: case 0x61: case 99: case 100: case 0xed: case 0x10b: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.20000005 * fVar5; stepVelocityY = stepVelocityY * 0.20000005 * fVar5; break; case 0x14: case 0x52: goto switchD_004a998d_caseD_14; case 0x24: case 0x2b: case 0x4e: case 0x106: if (cycleTime < 0x1e) { if (npc->_state == 8) { npc->_state = 3; } } else if (npc->_state != 8) goto LAB_004a9b6d; local_24 = npc->_maxHitPoints; local_28 = npc->_health; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar7 = (float)__ftoui3(); aiUpdateCount = (int)fVar7 + 1; local_1c = fVar7; goto LAB_004a9b6d; case 0x2d: if ((0x3c < cycleTime) && (iVar2 = Isaac::Random(chanceDivisor), iVar2 == 0)) { npc->_projectileCooldown = 0; } local_24 = npc->_maxHitPoints; local_28 = npc->_health; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } goto LAB_004a9d83; case 0x3e: if (npc->_variant == 0) { fVar5 = 1.2; } else { fVar5 = 2.0; } stepFraction = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * (fVar5 - 1.0) * stepFraction; stepVelocityY = stepVelocityY * (fVar5 - 1.0) * stepFraction; break; case 0x3f: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 1.5 * fVar5; stepVelocityY = stepVelocityY * 1.5 * fVar5; break; case 0x41: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; if (npc->_variant == 10) { stepVelocityX = stepVelocityX * 0.0 * fVar5; stepVelocityY = stepVelocityY * 0.0 * fVar5; break; } if (npc->_variant == 1) goto LAB_004a9b8f; stepVelocityX = stepVelocityX * 1.5; stepVelocityY = stepVelocityY * 1.5; goto LAB_004a9b9f; case 0x43: if (npc->_variant != 1) goto LAB_004aa3d4; LAB_004a9b6d: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-((int)fVar7 >> 0x1f)]) / 3.0; LAB_004a9b8f: stepVelocityX = stepVelocityX * 0.39999998; stepVelocityY = stepVelocityY * 0.39999998; LAB_004a9b9f: stepVelocityX = stepVelocityX * fVar5; stepVelocityY = stepVelocityY * fVar5; goto LAB_004aa3d4; case 0x44: if (npc->_variant != 1) goto LAB_004aa3d4; iVar2 = npc->_state; if (cycleTime < 0x1e) { if ((iVar2 == 9) || (iVar2 == 10)) { npc->_state = 3; } } else if ((iVar2 != 9) && (iVar2 != 10)) goto LAB_004aa3d4; local_24 = npc->_maxHitPoints; local_28 = npc->_health; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } LAB_004a9d83: fVar7 = (float)__ftoui3(); aiUpdateCount = (int)fVar7 + 1; local_1c = fVar7; goto LAB_004aa3d4; case 0x45: goto switchD_004a998d_caseD_45; case 0x4a: goto switchD_004a998d_caseD_4a; case 0x4f: if (npc->_variant == 2) { fVar5 = 1.1; } else { fVar5 = 1.2; } stepFraction = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * (fVar5 - 1.0) * stepFraction; stepVelocityY = stepVelocityY * (fVar5 - 1.0) * stepFraction; break; case 0x51: npc->_maxHitPoints = npc->_health; goto switchD_004a998d_caseD_4a; case 0x54: if (npc->_variant == 10) { iVar2 = Isaac::Random(chanceDivisor); if (iVar2 == 0) { npc->_stateFrame = 0; } fVar7 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.20000005 * fVar7; stepVelocityY = stepVelocityY * 0.20000005 * fVar7; local_28 = npc->_health; local_24 = npc->_maxHitPoints; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } } else { fVar7 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.0 * fVar7; stepVelocityY = stepVelocityY * 0.0 * fVar7; local_28 = npc->_health; local_24 = npc->_maxHitPoints; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } } goto LAB_004aa3bf; case 0x65: local_1c = 0.0; break; case 0x66: local_24 = npc->_maxHitPoints; local_28 = npc->_health; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar7 = (float)__ftoui3(); fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-((int)fVar7 >> 0x1f)]) / 3.0; stepVelocityX = stepVelocityX * 0.6 * fVar5; stepVelocityY = stepVelocityY * 0.6 * fVar5; goto LAB_004aa3cc; case 0x105: aiUpdateCount = 2; fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.20000005 * fVar5; stepVelocityY = stepVelocityY * 0.20000005 * fVar5; break; case 0x107: dVar6 = __uint_to_double_fixup[-iVar1]; (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; fVar5 = (float)((double)(int)fVar7 + dVar6) / 3.0; stepVelocityX = stepVelocityX * -1.0 * fVar5; stepVelocityY = stepVelocityY * -1.0 * fVar5; break; case 0x109: if (npc->_state == 6) goto switchD_004aa2e2_caseD_197; break; case 0x10c: fVar7 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.20000005 * fVar7; stepVelocityY = stepVelocityY * 0.20000005 * fVar7; local_24 = npc->_health; local_1c = npc->_maxHitPoints; if (npc->_state == 8) { if (local_1c == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } } else if (local_1c == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } goto LAB_004aa3bf; case 0x10f: case 0x110: case 0x111: aiUpdateCount = 1; fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.20000005 * fVar5; stepVelocityY = stepVelocityY * 0.20000005 * fVar5; } goto switchD_004a998d_caseD_15; } switch(iVar2) { case 0x194: fVar7 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * fVar7; stepVelocityY = stepVelocityY * fVar7; goto LAB_004aa34b; case 0x195: switchD_004a998d_caseD_14: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.39999998 * fVar5; stepVelocityY = stepVelocityY * 0.39999998 * fVar5; break; case 0x197: switchD_004aa2e2_caseD_197: local_24 = npc->_maxHitPoints; local_28 = npc->_health; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } goto LAB_004aa3bf; case 0x19a: fVar7 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.6 * fVar7; stepVelocityY = stepVelocityY * 0.6 * fVar7; LAB_004aa34b: local_28 = npc->_health; local_24 = npc->_maxHitPoints; if (local_24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } LAB_004aa3bf: fVar7 = (float)__ftoui3(); LAB_004aa3cc: aiUpdateCount = (int)fVar7 + 1; local_1c = fVar7; } switchD_004a998d_caseD_15: uVar3 = cycleTime; LAB_004aa3d4: if ((uint)((int)fVar7 * 4) < uVar3) { step = 0; do { uVar4 = chanceDivisor; dVar6 = 10.0; switch(npc->_type) { case 0x14: case 0x2b: if ((npc->_state == 3) && ((chanceDivisor == 0 || (uVar3 = Random(), uVar3 % uVar4 == 0)))) { uVar4 = Random(); if ((uVar4 & 1) == 0) { npc->_state = 8; anim = (byte *)"Taunt"; } else { if ((uVar4 & 1) != 1) break; local_24 = 1.0; npc->_state = 6; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_24 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_24 = 0.5; } local_28 = 1.96182e-44; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,local_24,0.0); anim = &DAT_00b1e0e4; } LAB_004aa517: isAnimSet = ANM2::SetAnimation(&npc->_sprite,anim,1); if (isAnimSet != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } break; case 0x1c: if ((((npc->_variant == 0) && (npc->_state == 4)) && ((chanceDivisor == 0 || (uVar3 = Random(), uVar3 % uVar4 == 0)))) && (npc->_stateFrame == 0)) { npc->_state = 0xd; } break; case 0x40: if (npc->_state == 4) { libm_sse2_pow_precise(); if (((int)dVar6 == 0) || (uVar4 = Random(), uVar4 % (uint)(int)dVar6 == 0)) { uVar4 = Random(); npc->_stateFrame = 0; if ((uVar4 & 1) == 0) { npc->_state = 0xd; anim = s_Attack2; if (npc->_i1 != 0) { anim = (byte *)"HeadlessAttack2"; } } else { npc->_state = 8; anim = s_Attack1; if (npc->_i1 != 0) { anim = (byte *)"HeadlessAttack1"; } } goto LAB_004aa517; } } break; case 0x41: if ((npc->_state == 4) && (npc->_variant != 10)) { libm_sse2_pow_precise(); if (((int)dVar6 == 0) || (uVar4 = Random(), uVar4 % (uint)(int)dVar6 == 0)) { uVar4 = Random(); if ((uVar4 & 1) == 0) { npc->_state = 8; npc->_stateFrame = 0; anim = s_Attack1; } else { uVar4 = Random(); manager = g_manager; local_24 = 1.0; if (npc->_championColorIdx == 0x12) { local_24 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_24 = 0.5; } local_28 = (float)((uVar4 & 3) + 0x73); seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,local_24,0.0); npc->_state = 6; npc->_stateFrame = 0; anim = s_Attack2; } goto LAB_004aa517; } } break; case 0x42: if ((npc->_state == 4) && (npc->_variant != 10)) { libm_sse2_pow_precise(); if (((int)dVar6 == 0) || (uVar4 = Random(), uVar4 % (uint)(int)dVar6 == 0)) { if (npc->_variant == 0x1e) { LAB_004aa7f9: npc->_state = 0xd; } else { uVar4 = Random(); uVar4 = uVar4 % 3; if (uVar4 == 0) goto LAB_004aa7f9; if (uVar4 == 1) { npc->_state = 8; } else if (uVar4 == 2) { npc->_state = 0xe; } } npc->_stateFrame = 0; } } break; case 0x4a: if (npc->_state == 0x10) { npc->_state = 3; } } if (step != 0) { if (((uint)step <= (uint)local_1c) && ((npc->_sprite)._loaded != 0)) { AnimationState::Update(&(npc->_sprite)._animState); AnimationState::Update(&(npc->_sprite)._overlayAnimState); } (npc->_pos).x = stepVelocityX + (npc->_pos).x; (npc->_pos).y = stepVelocityY + (npc->_pos).y; } if ((uint)step < aiUpdateCount) { Entity_NPC_UpdateAI_dispatch(npc); } step = step + 1; } while ((uint)step <= (uint)fVar7); npc->_deliriumCycleIDHigh = 0; npc->_deliriumCycleID = ((cycleId >> 0xf & 0x3ff | cycleTime << 10) << 8 | nextCycleCount & 0xff) << 7 | cycleId & 0x7f; } else if ((npc->_sprite)._loaded != 0) { AnimationState::Update(&(npc->_sprite)._animState); AnimationState::Update(&(npc->_sprite)._overlayAnimState); return; } return; switchD_004a998d_caseD_4a: fVar5 = (float)((double)(int)fVar7 + __uint_to_double_fixup[-iVar1]) / 3.0; stepVelocityX = stepVelocityX * 0.6 * fVar5; stepVelocityY = stepVelocityY * 0.6 * fVar5; goto switchD_004a998d_caseD_15; } //@@ 004aaaa0 FUN_004aaaa0 void FUN_004aaaa0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x38; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 004aaaf0 FUN_004aaaf0 void FUN_004aaaf0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; for (; param_1 != param_2; param_1 = param_1 + 0xe) { uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *param_3 = *param_1; param_3[1] = uVar1; param_3[2] = uVar2; param_3[3] = uVar3; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; param_3[4] = param_1[4]; param_3[5] = uVar1; param_3[6] = uVar2; param_3[7] = uVar3; uVar1 = param_1[9]; uVar2 = param_1[10]; uVar3 = param_1[0xb]; param_3[8] = param_1[8]; param_3[9] = uVar1; param_3[10] = uVar2; param_3[0xb] = uVar3; *(undefined8 *)(param_3 + 0xc) = *(undefined8 *)(param_1 + 0xc); param_3 = param_3 + 0xe; } return; } //@@ 004aab30 std::vector::assign_0x38 /* DB: 0x38-elem vector assign; Delirium/Kill */ void std::vector::assign_0x38(int param_1,int param_2) { uint uVar1; uint uVar2; void *pvVar3; int iVar4; int *in_ECX; uint uVar5; uint uVar6; uVar1 = (param_2 - param_1) / 0x38; pvVar3 = (void *)*in_ECX; uVar5 = (in_ECX[1] - (int)pvVar3) / 0x38; if (uVar1 <= uVar5) { FUN_004aac80(pvVar3); in_ECX[1] = (int)((int)pvVar3 + uVar1 * 0x38); return; } uVar2 = (in_ECX[2] - (int)pvVar3) / 0x38; if (uVar2 < uVar1) { if (0x4924924 < uVar1) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x4924924 - (uVar2 >> 1) < uVar2) { uVar6 = 0x4924924; } else { uVar6 = (uVar2 >> 1) + uVar2; if (uVar6 < uVar1) { uVar6 = uVar1; } } if (pvVar3 != (void *)0x0) { FUN_004aaaa0(pvVar3,uVar2); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x4924924 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar3 = _Allocate(uVar6 * 0x38); uVar5 = 0; *in_ECX = (int)pvVar3; in_ECX[1] = (int)pvVar3; in_ECX[2] = (int)(uVar6 * 0x38 + (int)pvVar3); } FUN_004aac80(pvVar3); iVar4 = FUN_004aaaf0(param_1 + uVar5 * 0x38,param_2,in_ECX[1]); in_ECX[1] = iVar4; return; } //@@ 004aac80 FUN_004aac80 undefined4 * FUN_004aac80(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar3; undefined4 *puVar4; if (in_ECX == in_EDX) { return param_1; } puVar3 = in_ECX + 0xb; puVar4 = param_1 + 0xb; do { *param_1 = puVar3[-0xb]; uVar2 = puVar3[-9]; param_1 = param_1 + 0xe; puVar4[-8] = puVar3[-8]; puVar4[-9] = uVar2; puVar4[-7] = puVar3[-7]; puVar4[-6] = puVar3[-6]; puVar4[-5] = puVar3[-5]; puVar4[-4] = puVar3[-4]; puVar4[-3] = puVar3[-3]; puVar4[-2] = puVar3[-2]; puVar4[-1] = puVar3[-1]; *puVar4 = *puVar3; puVar4[1] = puVar3[1]; puVar4[2] = puVar3[2]; puVar1 = puVar3 + 3; puVar3 = puVar3 + 0xe; puVar4 = puVar4 + 0xe; } while (puVar1 != in_EDX); return param_1; } //@@ 004aad00 FUN_004aad00 void FUN_004aad00(void) { return; } //@@ 004aad10 FUN_004aad10 void FUN_004aad10(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x18) = in_XMM1_Da; return; } //@@ 004aad20 FUN_004aad20 void FUN_004aad20(void) { return; } //@@ 004aad30 Entity::TargetPosition /* ZHL [lua] Lua binding Entity:TargetPosition */ Vector * __thiscall Entity::TargetPosition(Entity *this) { return &this->_targetPosition; } //@@ 004aad40 FUN_004aad40 int FUN_004aad40(void) { int in_ECX; if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 9)) { return 0; } return in_ECX; } //@@ 004aad50 FUN_004aad50 void FUN_004aad50(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x428) = param_1; return; } //@@ 004aad70 FUN_004aad70 void FUN_004aad70(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x42c) = param_1; return; } //@@ 004aad90 FUN_004aad90 void FUN_004aad90(undefined4 param_1,undefined4 param_2) { int in_ECX; *(undefined4 *)(in_ECX + 0x450) = param_1; *(undefined4 *)(in_ECX + 0x454) = param_2; return; } //@@ 004aadb0 FUN_004aadb0 void FUN_004aadb0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x458) = param_1; return; } //@@ 004aadd0 FUN_004aadd0 void FUN_004aadd0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x45c) = param_1; return; } //@@ 004aade0 Entity_Tear::TearIndex /* ZHL [lua] Lua binding EntityTear:TearIndex */ int __thiscall Entity_Tear::TearIndex(Entity_Tear *this) { return this->_tearIdx; } //@@ 004aadf0 FUN_004aadf0 void FUN_004aadf0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[3] = param_1; in_ECX[4] = param_2; *in_ECX = in_XMM1_Da; in_ECX[1] = in_XMM2_Da; in_ECX[2] = in_XMM3_Da; in_ECX[5] = param_3; return; } //@@ 004aae30 FUN_004aae30 void FUN_004aae30(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 1; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xfffffffe; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 004aae50 FUN_004aae50 void FUN_004aae50(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 4; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xfffffffb; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 004aae70 FUN_004aae70 int FUN_004aae70(void) { int in_ECX; return in_ECX + 0x1bc8; } //@@ 004aae80 Room::GetDecorationSeed /* ZHL [lua] Lua binding Room:GetDecorationSeed */ undefined4 Room::GetDecorationSeed(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return 0; } return *(undefined4 *)(*(int *)(in_ECX + 4) + 0x58); } //@@ 004aae90 Room::SetClear /* ZHL [lua] Lua binding Room:SetClear */ void Room::SetClear(char param_1) { uint uVar1; int in_ECX; uint uVar2; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); uVar2 = uVar1 | 1; if (param_1 == '\0') { uVar2 = uVar1 & 0xfffffffe; } *(uint *)(*(int *)(in_ECX + 4) + 0x44) = uVar2; return; } //@@ 004aaeb0 Room::SetSacrificeDone /* ZHL [lua] Lua binding Room:SetSacrificeDone */ void Room::SetSacrificeDone(char param_1) { uint uVar1; int in_ECX; uint uVar2; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); uVar2 = uVar1 | 4; if (param_1 == '\0') { uVar2 = uVar1 & 0xfffffffb; } *(uint *)(*(int *)(in_ECX + 4) + 0x44) = uVar2; return; } //@@ 004aaed0 Entity_Laser::set_disable_init_sound /* DB: tiny: writes byte +0x518 (_disableInitSound) (dogma_effects.md) */ void __thiscall Entity_Laser::set_disable_init_sound(Entity_Laser *this,byte param_2) { this->_disableInitSound = param_2; return; } //@@ 004aaee0 HUD::SetVisible /* ZHL [lua] Lua binding HUD:SetVisible */ void __thiscall HUD::SetVisible(HUD *this,byte param_2) { this->_isVisible = param_2; return; } //@@ 004aaef0 NpcAI::ENTITY_DOGMA_update_distortion /* DB: reads "Distortion" null frame value from the NPC's animation state (+0x78/+0x98), adds 3 while +0xbc4 timer > 0, decays it, and writes the value into field 0x58 of every sprite layer; ENTITY_DOGMA, _angel, _angel_baby */ void __fastcall NpcAI::ENTITY_DOGMA_update_distortion(Entity_NPC *npc) { float fVar1; float fVar2; void *pvVar3; LayerState *pLVar4; int iVar5; int iVar6; byte *layerName; float local_8; iVar5 = 0x98; local_8 = 0.0; fVar1 = npc->_prevUpdateTime; fVar2 = npc->_updateTime; if ((npc->_sprite)._overlayAnimState._isPlaying == 0) { iVar5 = 0x78; } pvVar3 = AnimationState::GetNullFrame ((AnimationState *)((int)(&(npc->_sprite)._filename + -3) + iVar5), (byte *)"Distortion"); if (pvVar3 != (void *)0x0) { local_8 = *(float *)((int)pvVar3 + 0x18); } if (0 < npc->_i2) { local_8 = local_8 + 3.0; } iVar6 = npc->_i2 - ((int)fVar2 - (int)fVar1); iVar5 = 0; if (0 < iVar6) { iVar5 = iVar6; } layerName = (byte *)0x0; npc->_i2 = iVar5; if ((npc->_sprite)._layerCount != 0) { do { pLVar4 = ANM2::GetLayer(&npc->_sprite,layerName); layerName = layerName + 1; (pLVar4->_color)._colorize[0] = local_8; } while (layerName < (byte *)(npc->_sprite)._layerCount); } return; } //@@ 004aafa0 NpcAI::ENTITY_DOGMA /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 950 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DOGMA(Entity_NPC *npc) { uint *puVar1; undefined4 uVar2; ANM2 *pAVar3; undefined4 uVar4; undefined4 uVar5; float *pfVar6; byte bVar7; uint uVar8; RoomConfig_Room *replacementRoom; int *playerSlot; Entity_Laser *brimstoneLaser; char *animName; Vector *pVVar9; int iVar10; Entity *pEVar11; LayerState *layer; Game *camera; Game *extraout_ECX; Game *extraout_ECX_00; Game *pGVar12; void *pvVar13; Game *this_00; int framesLeft; undefined1 *puVar14; uint uVar15; uint uVar16; bool lerp; float fVar17; float fVar18; float fVar19; EntityPtr EVar20; Entity_NPC *source; RNG wallRng; undefined8 local_154; Vector tmpVec; Vector local_144; undefined4 local_13c; Room *local_138; undefined4 local_134; Entity *local_130; Vector local_12c; float local_124; Vector local_120; Entity *local_118; float local_114; Room *local_110; Vector local_10c; EntityPtr local_104; Vector local_100; ProjectileParams projParams; ColorMod flashColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Camera *camera; qword flags; Room *room; puStack_20 = (undefined1 *)(&flashColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af3170; local_1c = ExceptionList; uVar8 = __security_cookie ^ (uint)((&flashColor)[1]._colorize + 1); ExceptionList = &local_1c; EVar20 = npc->_parent; room = g_game->_room; local_118 = (Entity *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (EVar20 == (EntityPtr)0x0) { local_110 = (Room *)0x3f800000; } else { local_110 = (Room *)(*(float *)((int)EVar20 + 0x380) / *(float *)((int)EVar20 + 900)); } local_114 = (float)npc->_aiCallPhase; local_104 = (EntityPtr)npc; local_138 = room; local_24 = uVar8; if ((local_114 == 1.4013e-45) || (local_114 == 2.8026e-45)) { local_154._4_4_ = (float)CONCAT31(local_154._5_3_,local_114 == 2.8026e-45); pfVar6 = (&flashColor)[1]._offset; if (npc->_state == 2) { bVar7 = input_is_action_triggered(g_manager,0xe,-1,(Entity *)0x0,0); pfVar6 = (float *)puStack_20; if (bVar7 != 0) { iVar10 = PersistentGameData::GetBestiaryEncounterCount (&g_manager->_persistentGameData,0x3b6,0); pfVar6 = (float *)puStack_20; if (iVar10 != 0) { npc->_state = 7; } } } puStack_20 = (undefined1 *)pfVar6; if (local_114 != 2.8026e-45) { ENTITY_DOGMA_update_distortion(npc); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); local_100.y = npc->_speedMultiplier * 0.05; local_12c.y = (float)&layer->_color; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); fVar17 = (layer->_color)._colorize[2]; if (local_100.y < ABS(fVar17 - 0.0)) { if (0.0 <= fVar17) { EVar20 = (EntityPtr)(fVar17 - local_100.y); } else { EVar20 = (EntityPtr)(local_100.y + fVar17); } } else { EVar20 = (EntityPtr)0x0; } *(EntityPtr *)((int)local_12c.y + 0x18) = EVar20; } Entity::GetNullOffset((Entity *)npc,&local_10c,(byte *)"CordPos"); if (((local_10c.x != g_vectorZero.x) || (local_10c.y != g_vectorZero.y)) && ((npc->_vectorDeque1)._size == 0)) { uVar8 = 0; do { local_100.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) / 9.0; fVar18 = sin((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 0.4); fVar17 = (npc->_pos).x; local_12c.x = fVar18 * 10.0 + (((npc->_targetPosition).x - 8.0) - fVar17) * local_100.y + fVar17; fVar17 = (npc->_pos).y; local_12c.y = (((npc->_targetPosition).y + 0.0) - fVar17) * local_100.y + fVar17 + 0.0; std::deque::push_back(&local_12c); local_13c = 0; local_138 = (Room *)0x0; std::deque::push_back(&local_13c); local_134 = 0xc1f00000; local_130 = (Entity *)0x0; std::deque::push_back(&local_134); uVar8 = uVar8 + 1; } while (uVar8 < 10); std::deque::assign(&npc->_vectorDeque1); } EVar20 = npc->_parent; if (EVar20 == (EntityPtr)0x0) { local_100.x = (npc->_targetPosition).x; local_100.y = (npc->_targetPosition).y; } else { local_100.x = *(float *)((int)EVar20 + 0x33c) + 0.0; local_100.y = *(float *)((int)EVar20 + 0x340) + 20.0; } local_104 = (EntityPtr)local_100.x; local_110 = (Room *)local_100.y; if ((npc->_vectorDeque1)._size != 0) { uVar8 = (npc->_vectorDeque1)._offset; uVar16 = uVar8 & 1; fVar17 = (npc->_pos).x; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar8 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar10 + 4 + uVar16 * 8) = (npc->_pos).y + 0.0; *(float *)(iVar10 + uVar16 * 8) = local_10c.x + fVar17; uVar8 = (npc->_vectorDeque1)._offset + 1; uVar16 = uVar8 & 1; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar8 >> 1) * 4); *(float *)(iVar10 + uVar16 * 8) = (npc->_velocity).x; *(float *)(iVar10 + 4 + uVar16 * 8) = (npc->_velocity).y; uVar8 = (npc->_vectorDeque1)._offset + 2; uVar16 = uVar8 & 1; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar8 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar10 + uVar16 * 8) = local_10c.y; *(undefined4 *)(iVar10 + 4 + uVar16 * 8) = 0; uVar8 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 3); uVar16 = uVar8 & 1; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar8 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar10 + uVar16 * 8) = local_100.x - 8.0; *(float *)(iVar10 + 4 + uVar16 * 8) = local_100.y + 0.0; uVar8 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 2); uVar16 = uVar8 & 1; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar8 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar10 + uVar16 * 8) = g_vectorZero.x; *(float *)(iVar10 + 4 + uVar16 * 8) = g_vectorZero.y; uVar8 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 1); uVar16 = uVar8 & 1; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar8 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(undefined4 *)(iVar10 + uVar16 * 8) = 0xc1f00000; *(undefined4 *)(iVar10 + 4 + uVar16 * 8) = 0; Entity_NPC::UpdateCordChain(npc,SUB41(local_154._4_4_,0)); } local_110 = (Room *)((float)local_110 - (npc->_pos).y); local_104 = (EntityPtr)((float)local_104 - (npc->_pos).x); fVar17 = sqrtf((float)local_110 * (float)local_110 + (float)local_104 * (float)local_104); if (190.0 < fVar17) { fVar18 = npc->_speedMultiplier; (npc->_velocity).x = ((float)local_104 / fVar17) * (fVar17 - 190.0) * 0.1 * 0.3 * fVar18 + (npc->_velocity).x; (npc->_velocity).y = ((float)local_110 / fVar17) * (fVar17 - 190.0) * 0.1 * 0.3 * fVar18 + (npc->_velocity).y; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } puStack_20 = (undefined1 *)(&flashColor)[1]._offset; if (npc->_parent == (EntityPtr)0x0) { iVar10 = npc->_state; puStack_20 = (undefined1 *)(&flashColor)[1]._offset; if (((iVar10 != 0) && (puStack_20 = (undefined1 *)(&flashColor)[1]._offset, iVar10 != 0x10)) && ((puStack_20 = (undefined1 *)(&flashColor)[1]._offset, iVar10 != 2 && (puStack_20 = (undefined1 *)(&flashColor)[1]._offset, iVar10 != 7)))) { npc->_state = 0x10; puStack_20 = (undefined1 *)(&flashColor)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); } } local_114 = 2.8026e-45; switch(npc->_state) { case 0: npc->_aiCallFlags = 3; if (npc->_spawnerType == 0) { pVVar9 = Room::GetCenterPos(&local_10c); pEVar11 = Game::Spawn(g_game,0x3b6,1,pVVar9,&g_vectorZero,(Entity *)npc,0,npc->_initSeed); (**(code **)(*(int *)pEVar11 + 0xc))(); Entity::SetChild(pEVar11,(Entity *)npc); Entity::SetParent((Entity *)npc,pEVar11); npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); ANM2::PlayOverlay(&npc->_sprite,&DAT_00b1d20c,0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); room = local_138; layer->_visible = 0; flags = npc->_flags; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; npc->_entityCollisionClass = 4; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x80000011; npc->_projectileCooldown = 0x14; npc->_projectileDelay = -1; iVar10 = 0; do { Room::RemoveDoor(room,iVar10); iVar10 = iVar10 + 1; } while (iVar10 < 8); puVar1 = (uint *)((int)room->_descriptor + 0x44); *puVar1 = *puVar1 | 4; puVar1 = (uint *)((int)room->_descriptor + 0x44); *puVar1 = *puVar1 & 0xfffffffe; puVar1 = (uint *)((int)room->_descriptor + 0x44); *puVar1 = *puVar1 | 0x8000; Room::LoadBackdropGraphics(room); Backdrop::load_details(&room->_backdrop); Game::SetColorModifier(camera,(ColorModState *)&DAT_00c33c70,0,0.015); npc = (Entity_NPC *)local_104; } else { npc->_state = 2; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); ANM2::PlayOverlay(&npc->_sprite,&DAT_00b1d20c,0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer->_visible = 0; pGVar12 = g_game; flags = npc->_flags; npc->_entityCollisionClass = 0; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x80000011; (pGVar12->_hud)._isVisible = 0; } flashColor._tint[0] = 1.0; flashColor._tint[1] = 1.0; flashColor._tint[2] = 1.0; flashColor._tint[3] = 1.0; *(undefined4 *)((int)npc + 0xc34) = 0; flashColor._colorize[0] = 3.0; flashColor._colorize[1] = 3.0; flashColor._colorize[2] = 3.0; flashColor._colorize[3] = 1.0; flashColor._offset[0] = 0.0; flashColor._offset[1] = 0.0; flashColor._offset[2] = 0.0; Color::operator_assign((Color *)((int)npc + 0x1e4),&flashColor); break; case 2: case 7: npc->_friction = npc->_friction * 0.8; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Splat"); if (bVar7 != 0) { uVar16 = Random(); pEVar11 = Game::Spawn(g_game,1000,0xa9,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar16); fVar18 = g_vectorOne.x * 1.2; uVar2 = *(undefined4 *)((int)&pEVar11->_flags + 4); fVar17 = g_vectorOne.y * 1.2; *(uint *)&pEVar11->_flags = (uint)pEVar11->_flags | 0x10000; *(undefined4 *)((int)&pEVar11->_flags + 4) = uVar2; iVar10 = *(int *)pEVar11; (pEVar11->_sprite)._scale.x = fVar18; (pEVar11->_sprite)._scale.y = fVar17; pAVar3 = &pEVar11[1]._sprite; (pAVar3->_filename)._buf[8] = ','; (pAVar3->_filename)._buf[9] = '\x01'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &pEVar11[1]._sprite; (pAVar3->_filename)._buf[0xc] = ','; (pAVar3->_filename)._buf[0xd] = '\x01'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; (**(code **)(iVar10 + 0xc))(uVar8); uVar8 = Random(); pEVar11 = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar8); (**(code **)(*(int *)pEVar11 + 0xc))(); } local_110 = (Room *)npc->_state; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if ((bVar7 != 0) || (local_110 == (Room *)&DAT_00000007)) { lerp = local_110 != (Room *)&DAT_00000007; if (lerp) { Entity_NPC::PlaySound(npc,0x21d,1.0,2,0,1.0); Game::MakeShockwave(g_game,&npc->_pos,0.04,0.07,0x14); fVar17 = 0.04; pGVar12 = extraout_ECX_00; } else { fVar17 = 0.015; pGVar12 = extraout_ECX; } Game::SetColorModifier(pGVar12,(ColorModState *)&DAT_00c5c660,lerp,fVar17); } bVar7 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Sound"); if (bVar7 != 0) { Game::ShakeScreen(g_game,6); } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if ((bVar7 != 0) || (local_110 == (Room *)&DAT_00000007)) { puVar1 = (uint *)((int)room->_descriptor + 0x44); *puVar1 = *puVar1 | 4; puVar1 = (uint *)((int)room->_descriptor + 0x44); *puVar1 = *puVar1 & 0xfffffffe; Room::LoadBackdropGraphics(room); Backdrop::load_details(&room->_backdrop); local_118 = (Entity *)0x0; local_114 = 0.0; if ((room->_entityList)._updateEL._size != 0) { uVar8 = 0; do { local_130 = *(Entity **)((int)(room->_entityList)._updateEL._data + uVar8 * 4); if (local_130->_type == 0x3c0) { if (local_130->_variant == 4) { pVVar9 = Room::GetCenterPos(&local_10c); local_114 = pVVar9->x - (local_130->_targetPosition).x; local_118 = (Entity *)(pVVar9->y - (local_130->_targetPosition).y); } LAB_004ab524: (**(code **)(*(int *)local_130 + 0x28))(); } else if ((local_130->_type == 1000) && ((local_130->_variant == 0x4a || (local_130->_variant == 0xa9)))) goto LAB_004ab524; uVar8 = uVar8 + 1; } while (uVar8 < (uint)(room->_entityList)._updateEL._size); } local_120.y = 0.0; do { Room::RemoveDoor(room,(int)local_120.y); local_120.y = (float)((int)local_120.y + 1); } while ((int)local_120.y < 8); replacementRoom = RoomConfig::GetRoomByStageTypeAndVariant (&g_game->_roomConfig,**(uint **)((int)room->_descriptor + 0x10),1,1000,-1); *(RoomConfig_Room **)((int)room->_descriptor + 0x10) = replacementRoom; wallRng._seed = 0; if (room->_descriptor != (void *)0x0) { wallRng._seed = *(int *)((int)room->_descriptor + 0x58); } uVar8 = 0; local_124 = (room->_bottomRightPos).y - (room->_topLeftPos).y; wallRng._shift1 = 1; wallRng._shift2 = 5; local_130 = (Entity *)((room->_bottomRightPos).x - (room->_topLeftPos).x); wallRng._shift3 = (int)&DAT_00000013; local_100.y = local_124 + (float)local_130; local_12c.y = (float)local_130 + local_100.y; local_154._4_4_ = local_124 + local_12c.y; do { RNG::Next(&wallRng); local_144.y = (room->_topLeftPos).x; fVar17 = (room->_topLeftPos).y; fVar18 = (((float)((double)wallRng._seed + __uint_to_double_fixup[-(wallRng._seed >> 0x1f)]) * 2.3283062e-10 + ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) - 0.5 )) * local_154._4_4_) / 20.0; if (fVar18 <= local_12c.y) { if (fVar18 <= local_100.y) { if (fVar18 <= (float)local_130) { local_144.y = local_144.y + fVar18; local_120.y = fVar17 + 0.0; } else { local_144.y = local_144.y + (float)local_130; local_120.y = (fVar18 - (float)local_130) + fVar17; } } else { local_144.y = ((float)local_130 - (fVar18 - local_100.y)) + local_144.y; local_120.y = fVar17 + local_124; } } else { local_144.y = local_144.y + 0.0; local_120.y = (local_124 - (fVar18 - local_12c.y)) + fVar17; } local_10c.x = local_144.y; local_10c.y = local_120.y; pVVar9 = Room::GetCenterPos(&tmpVec); local_144.y = local_144.y - pVVar9->x; local_120.y = local_120.y - pVVar9->y; RNG::Next(&wallRng); fVar17 = sqrtf(local_120.y * local_120.y + local_144.y * local_144.y); if (fVar17 <= 0.0) { fVar18 = local_144.y; fVar17 = local_120.y; } else { fVar17 = ((float)((double)wallRng._seed + __uint_to_double_fixup[-(wallRng._seed >> 0x1f)] ) * 2.3283062e-10 * 80.0 + 10.0) / fVar17; fVar18 = local_144.y * fVar17; fVar17 = local_120.y * fVar17; } local_10c.x = local_10c.x + fVar18; local_10c.y = local_10c.y + fVar17; uVar16 = RNG::Next(&wallRng); pEVar11 = Game::Spawn(g_game,1000,0xaa,&local_10c,&g_vectorZero,(Entity *)0x0,0,uVar16); (**(code **)(*(int *)pEVar11 + 0xc))(); npc = (Entity_NPC *)local_104; uVar8 = uVar8 + 1; } while (uVar8 < 0x1e); if (*(int *)((int)local_104 + 0xc14) != 0) { uVar8 = *(uint *)((int)local_104 + 0xc10) & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (*(int *)((int)local_104 + 0xc0c) - 1U & *(uint *)((int)local_104 + 0xc10) >> 1) * 4); *(float *)(iVar10 + uVar8 * 8) = local_114 + *(float *)(iVar10 + uVar8 * 8); *(float *)(iVar10 + 4 + uVar8 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar8 * 8); uVar8 = *(uint *)((int)local_104 + 0xc24) & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (*(uint *)((int)local_104 + 0xc24) >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar8 * 8) = local_114 + *(float *)(iVar10 + uVar8 * 8); *(float *)(iVar10 + 4 + uVar8 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar8 * 8); uVar8 = *(int *)((int)local_104 + 0xc10) + 3; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 3; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 6; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 6; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 9; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 9; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 0xc; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 0xc; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 0xf; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 0xf; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 0x12; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 0x12; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 0x15; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 0x15; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 0x18; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc24) + 0x18; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; uVar8 = *(int *)((int)local_104 + 0xc10) + 0x1b; uVar16 = uVar8 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc08) + (uVar8 >> 1 & *(int *)((int)local_104 + 0xc0c) - 1U) * 4); *(float *)(iVar10 + uVar16 * 8) = local_114 + *(float *)(iVar10 + uVar16 * 8); *(float *)(iVar10 + 4 + uVar16 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar16 * 8) ; local_100.y = *(float *)((int)local_104 + 0xc24); puVar14 = &((EntityPtr *)&((Entity *)local_100.y)->_pendingDamageFlags)->field_0x3; uVar8 = (uint)puVar14 & 1; iVar10 = *(int *)(*(int *)((int)local_104 + 0xc1c) + ((uint)puVar14 >> 1 & *(int *)((int)local_104 + 0xc20) - 1U) * 4); *(float *)(iVar10 + uVar8 * 8) = local_114 + *(float *)(iVar10 + uVar8 * 8); *(float *)(iVar10 + 4 + uVar8 * 8) = (float)local_118 + *(float *)(iVar10 + 4 + uVar8 * 8); } local_120.y = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar13 = (g_game->_playerManager)._playerList._end; local_104 = (EntityPtr)g_game; if ((int)pvVar13 - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar13 = (((PlayerManager *)((int)local_104 + 0x1baa8))->_playerList)._end; } playerSlot = (((Game *)local_104)->_playerManager)._playerList._begin; if ((uint)local_120.y < (Entity *)((int)pvVar13 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_120.y; } local_104 = (EntityPtr)*playerSlot; local_130 = (Entity *) ((((Entity_Player *)local_104)->_pos).y - *(float *)((int)npc + 0x340)); local_124 = (((Entity_Player *)local_104)->_pos).x - *(float *)((int)npc + 0x33c); fVar17 = sqrtf((float)local_130 * (float)local_130 + local_124 * local_124); if (80.0 <= fVar17) { fVar17 = ((Vector *)((int)local_104 + 0x33c))->y; } else { if (fVar17 <= 0.0) { pEVar11 = local_130; fVar18 = local_124; } else { pEVar11 = (Entity *)((float)local_130 * (80.0 / fVar17)); fVar18 = local_124 * (80.0 / fVar17); } fVar17 = (float)pEVar11 + *(float *)((int)npc + 0x340); ((Vector *)((int)local_104 + 0x33c))->x = fVar18 + *(float *)((int)npc + 0x33c); ((Vector *)((int)local_104 + 0x33c))->y = fVar17; } local_100.x = local_114 + ((Vector *)((int)local_104 + 0x33c))->x; local_100.y = (float)local_118 + fVar17; Room::GetClampedPositionImpl(room,&local_12c,&local_100,0.0,0.0,0.0,0.0); Entity_Player::Teleport((Entity_Player *)local_104,&local_12c,0,0); local_120.y = (float)((int)local_120.y + 1); } while ((uint)local_120.y < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } local_104 = (EntityPtr)g_game; pVVar9 = Room::GetCenterPos(&tmpVec); local_130 = Game::Spawn((Game *)local_104,0x3b6,1,pVVar9,&g_vectorZero,(Entity *)npc,0, *(uint *)((int)npc + 0x3ec)); (**(code **)(*(int *)local_130 + 0xc))(); local_12c.y = (float)&local_130->_child; if (*(EntityPtr *)local_12c.y != (EntityPtr)0x0) { local_100.y = local_12c.y; std::multiset::erase(&local_100.y); } *(Entity_NPC **)local_12c.y = npc; std::multiset::insert(local_12c.y); if (*(int *)((int)npc + 0x3bc) != 0) { local_100.y = (float)((int)npc + 0x3bc); std::multiset::erase(&local_100.y); } *(int *)((int)npc + 0x3bc) = (int)local_130; std::multiset::insert((int *)((int)npc + 0x3bc)); *(float *)((int)npc + 0x33c) = local_114 + *(float *)((int)npc + 0x33c); *(float *)((int)npc + 0x340) = (float)local_118 + *(float *)((int)npc + 0x340); } pGVar12 = g_game; if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { if (local_110 == (Room *)&DAT_00000007) goto LAB_004ac08d; RoomTransition::StartBossIntro(&g_game->_roomTransition,99,0); } else { if (local_110 != (Room *)&DAT_00000007) { pvVar13 = room->_Camera; if (*(char *)((int)pvVar13 + 0x8c) == '\0') { ring_buffer_push((void *)((int)pvVar13 + 0x50),(Vector *)((int)npc + 0x33c)); *(undefined1 *)((int)pvVar13 + 0x8c) = 1; } break; } LAB_004ac08d: playerSlot = (g_game->_playerManager)._playerList._begin; if (playerSlot != (g_game->_playerManager)._playerList._end) { do { iVar10 = *playerSlot; playerSlot = playerSlot + 1; *(undefined1 *)(iVar10 + 0x410) = 1; } while (playerSlot != (pGVar12->_playerManager)._playerList._end); } Room::PlayMusic(pGVar12->_room); (g_game->_hud)._isVisible = 1; } *(undefined4 *)((int)npc + 0x188) = 4; *(undefined4 *)((int)npc + 0xb64) = 3; ANM2::Play((ANM2 *)((int)npc + 0x48),s_Idle,0); *(undefined4 *)((int)npc + 0xba0) = 0x3c; Game::SetColorModifier(this_00,(ColorModState *)&DAT_00c33c70,1,0.04); camera = room->_Camera; pVVar9 = players_center_position(&g_game->_playerManager,&tmpVec,0); Camera::SnapToPosition(camera,pVVar9); puVar1 = (uint *)((int)local_138->_descriptor + 0x44); *puVar1 = *puVar1 | 0x8000; break; case 3: npc->_friction = npc->_friction * 0.8; local_110 = *(Room **)((int)npc->_parent + 0x33c); local_104 = *(EntityPtr *)((int)npc->_parent + 0x340); Entity_NPC::CalcTargetPosition(npc,&local_10c,0.0); local_124 = local_10c.x - (npc->_pos).x; local_12c.y = (float)((int)npc->_parent + 0x378); pEVar11 = (Entity *)((int)npc->_parent + 0x374); local_130 = (Entity *)(local_10c.y - (npc->_pos).y); local_120.x = local_124; local_120.y = (float)local_130; local_138 = (Room *)cos(1.5707964); local_100.y = sin(1.5707964); local_10c.x = (float)local_138 * local_124 - local_100.y * (float)local_130; local_10c.y = (float)local_138 * (float)local_130 + local_100.y * local_124; Vector::Normalized(&local_10c,(Vector *)&local_154); local_110 = (Room *)((float)local_110 - (npc->_pos).x); local_104 = (EntityPtr)((float)local_104 - (npc->_pos).y); local_10c.x = (float)local_110 * (float)local_138 - (float)local_104 * local_100.y; local_10c.y = (float)local_110 * local_100.y + (float)local_104 * (float)local_138; Vector::Normalized(&local_10c,&local_100); if ((float)local_104 * (float)local_130 + (float)local_110 * local_124 <= 0.0) { LAB_004ac401: bVar7 = 0; pVVar9 = Vector::Resized(&local_120,&tmpVec,npc->_aiFloat); Entity::AddVelocity_divided((Entity *)npc,pVVar9,bVar7); fVar17 = 0.5; } else { if ((float)*(EntityPtr *)pEVar11 <= (float)*(EntityPtr *)local_12c.y && (float)*(EntityPtr *)local_12c.y != (float)*(EntityPtr *)pEVar11) { pEVar11 = (Entity *)local_12c.y; } if ((float)*(EntityPtr *)pEVar11 * *(float *)((int)npc->_parent + 0x370) + npc->_size < ABS((float)local_104 * local_154._4_4_ + (float)local_154 * (float)local_110)) goto LAB_004ac401; bVar7 = 0; fVar17 = local_100.y * (float)local_130 + local_100.x * local_124; local_10c.y = fVar17 * local_100.y; local_10c.x = fVar17 * local_100.x; pVVar9 = Vector::Resized(&local_10c,&tmpVec,npc->_aiFloat); Entity::AddVelocity_divided((Entity *)npc,pVVar9,bVar7); fVar17 = 0.9; } if (npc->_entityRef != (EntityPtr)0x0) { fVar17 = 0.05; } fVar18 = Math::timescale_factor(0.9,npc->_speedMultiplier); npc->_aiFloat = (npc->_aiFloat - fVar17) * fVar18 + fVar17; if ((npc->_projectileCooldown < 1) || (iVar10 = npc->_projectileCooldown - (int)local_118, npc->_projectileCooldown = iVar10, 0 < iVar10)) break; uVar8 = Random(); fVar17 = (float)(uVar8 & 3); goto LAB_004ace95; case 8: iVar10 = npc->_stateFrame; npc->_friction = npc->_friction * 0.8; if (0 < iVar10) { iVar10 = (int)(&(local_118->_sprite)._filename + -3) + iVar10; npc->_stateFrame = iVar10; } if (iVar10 < 0x5a) { pEVar11 = Entity_NPC::GetPlayerTarget(npc); local_114 = (pEVar11->_pos).x; local_120.y = (pEVar11->_pos).y; local_10c.x = (npc->_pos).x + 0.0; local_10c.y = (npc->_pos).y - 15.0; local_144.y = (float)npc->_stateFrame / 20.0; if (1.0 <= local_144.y) { local_144.y = 1.0; } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { Isaac::GetAxisAlignedUnitVectorFromDir(&local_100,npc->_i1); pVVar9 = &local_12c; framesLeft = 0x5a - npc->_stateFrame; bVar7 = 0; local_12c.x = 0.0; local_12c.y = -30.0; iVar10 = 0; if (0 < framesLeft) { iVar10 = framesLeft; } iVar10 = iVar10 + 0xf; source = npc; fVar17 = atan2f(local_100.y,local_100.x); brimstoneLaser = Entity_Laser::ShootAngle (1,&local_10c,fVar17 * 57.295776,iVar10,pVVar9,(Entity *)source,bVar7); fVar17 = local_100.y; if (npc->_i1 == 1) { fVar18 = -50.0; } else { fVar18 = 1000.0; } brimstoneLaser->_renderDepthOffset = fVar18; local_12c.y = 100.0; local_100.y = (local_120.y - local_10c.y) * local_100.y + (local_114 - local_10c.x) * local_100.x; pVVar9 = &local_100; if (local_100.y <= 100.0) { pVVar9 = &local_12c; } fVar18 = pVVar9->y; (npc->_targetPosition).y = fVar18 * fVar17 + local_10c.y; (npc->_targetPosition).x = fVar18 * local_100.x + local_10c.x; brimstoneLaser->_disableInitSound = 1; if (npc->_stateFrame < 1) { Entity_NPC::PlaySound(npc,0x224,1.0,2,0,1.0); Game::ShakeScreen(g_game,10); fVar17 = (npc->_targetPosition).x; fVar18 = (npc->_targetPosition).y; } else { fVar17 = (npc->_targetPosition).x; fVar17 = (local_114 - fVar17) * 0.1 + fVar17; (npc->_targetPosition).x = fVar17; fVar18 = (local_120.y - (npc->_targetPosition).y) * 0.1 + (npc->_targetPosition).y; (npc->_targetPosition).y = fVar18; } (brimstoneLaser->_targetPosition).x = fVar17; (brimstoneLaser->_targetPosition).y = fVar18; uVar5 = DAT_00c34b7c; uVar4 = DAT_00c34b78; uVar2 = DAT_00c34b74; iVar10 = *(int *)brimstoneLaser; *(undefined4 *)&(brimstoneLaser->_tearFlags)._l = DAT_00c34b70; *(undefined4 *)((int)&(brimstoneLaser->_tearFlags)._l + 4) = uVar2; *(undefined4 *)&(brimstoneLaser->_tearFlags)._h = uVar4; *(undefined4 *)((int)&(brimstoneLaser->_tearFlags)._h + 4) = uVar5; (**(code **)(iVar10 + 0xc))(); Entity::SetChild((Entity *)npc,(Entity *)brimstoneLaser); if (npc->_i1 == 3) { animName = "BrimstoneLoopDown"; } else { animName = "BrimstoneLoopUp"; if (npc->_i1 != 1) { animName = "BrimstoneLoopRight"; } } ANM2::Play(&npc->_sprite,(byte *)animName,0); if (npc->_stateFrame == 0) { npc->_stateFrame = 1; } } if ((npc->_child != (EntityPtr)0x0) && (*(int *)((int)npc->_child + 0x28) == 7)) { fVar17 = (npc->_v2).x; if (fVar17 < 1.0) { fVar17 = fVar17 + npc->_speedMultiplier * 0.02; if (1.0 <= fVar17) { fVar17 = 1.0; } (npc->_v2).x = fVar17; } local_110 = (Room *)((local_120.y - (npc->_targetPosition).y) * 0.1 * fVar17); local_104 = (EntityPtr)((local_114 - (npc->_targetPosition).x) * 0.1 * fVar17); fVar17 = sqrtf((float)local_110 * (float)local_110 + (float)local_104 * (float)local_104); if (fVar17 <= 4.0) { if ((fVar17 < 2.0) && (0.0 < fVar17)) { local_110 = (Room *)((2.0 / fVar17) * (float)local_110); local_104 = (EntityPtr)((2.0 / fVar17) * (float)local_104); } } else if (0.0 < fVar17) { local_104 = (EntityPtr)((float)local_104 * (4.0 / fVar17)); local_110 = (Room *)((float)local_110 * (4.0 / fVar17)); } local_104 = (EntityPtr) (local_144.y * (float)local_104 * npc->_speedMultiplier + (npc->_targetPosition).x); local_144.y = local_144.y * (float)local_110 * npc->_speedMultiplier + (npc->_targetPosition).y; local_110 = (Room *)local_10c.x; local_154._4_4_ = (float)local_104 - local_10c.x; local_12c.y = local_144.y - local_10c.y; local_118 = (Entity *)local_10c.y; fVar17 = atan2f(local_12c.y,local_154._4_4_); local_100.y = fVar17 * 57.295776; fVar17 = atan2f((npc->_targetPosition).y - (float)local_118, (npc->_targetPosition).x - (float)local_110); fVar17 = normalize_angle_degrees(local_100.y - fVar17 * 57.295776); if (ABS(fVar17) <= 10.0) { fVar17 = local_144.y; EVar20 = local_104; } else { local_100.y = (10.0 - fVar17) * 0.017453292; local_104 = (EntityPtr)cos(local_100.y); fVar18 = sin(local_100.y); fVar17 = (float)local_104 * local_12c.y + fVar18 * local_154._4_4_ + (float)local_118; EVar20 = (EntityPtr) (((float)local_104 * local_154._4_4_ - fVar18 * local_12c.y) + (float)local_110); } (npc->_targetPosition).x = (float)EVar20; (npc->_targetPosition).y = fVar17; fVar18 = (npc->_targetPosition).x; if (((float)local_118 - fVar17) * ((float)local_118 - fVar17) + ((float)local_110 - fVar18) * ((float)local_110 - fVar18) < 3600.0) { local_100.x = fVar18 - (float)local_110; local_100.y = fVar17 - (float)local_118; pVVar9 = Vector::Resized(&local_100,&tmpVec,60.0); fVar18 = (float)local_110 + pVVar9->x; fVar17 = pVVar9->y; (npc->_targetPosition).x = fVar18; (npc->_targetPosition).y = (float)local_118 + fVar17; } EVar20 = npc->_child; fVar17 = (npc->_targetPosition).y; *(float *)((int)EVar20 + 0x334) = fVar18; *(float *)((int)EVar20 + 0x338) = fVar17; if (0xf < npc->_stateFrame) { local_100.x = local_114 - local_10c.x; local_100.y = local_120.y - local_10c.y; pEVar11 = (Entity *)vector_to_direction(&local_100); local_100.y = (float)pEVar11; if ((pEVar11 != (Entity *)npc->_i1) && ((uVar8 = Random(), (uVar8 & 3) == 0 || (fVar17 = local_114 - (npc->_targetPosition).x, fVar18 = local_120.y - (npc->_targetPosition).y, fVar18 * fVar18 + fVar17 * fVar17 < 2500.0)))) { (**(code **)(*(int *)npc->_child + 0x28))(); pAVar3 = &npc->_sprite; npc->_i1 = (int)pEVar11; if ((Entity *)local_100.y == (Entity *)0x3) { ANM2::Play(pAVar3,(byte *)"BrimstoneStartDown",0); } else if ((Entity *)local_100.y == (Entity *)0x1) { ANM2::Play(pAVar3,(byte *)"BrimstoneStartUp",0); } else { ANM2::Play(pAVar3,(byte *)"BrimstoneStartRight",0); (npc->_sprite)._flipX = npc->_i1 == 0; } iVar10 = AnimationState::GetAnimationLength(&(npc->_sprite)._animState); Sprite::SetFrame_1((Sprite *)&npc->_sprite,iVar10 + -2); npc->_i2 = 4; Entity_NPC::PlaySound(npc,0x51,0.5,2,0,1.0); (npc->_v2).x = 0.0; } } } } else { bVar7 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if (bVar7 != 0) { if ((npc->_i1 == 3) || (npc->_i1 == 1)) { animName = "BrimstoneEndDown"; } else { animName = "BrimstoneEndRight"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); (npc->_sprite)._flipX = 0; npc->_state = 3; } } break; case 9: npc->_friction = npc->_friction * 0.6; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { Entity_NPC::PlaySound(npc,0x226,1.0,2,0,1.0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._colorize[2] = 1.0; uVar8 = Random(); for (iVar10 = (uVar8 & 1) + 3; iVar10 != 0; iVar10 = iVar10 + -1) { uVar8 = Random(); fVar17 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_100.y = fVar17 + fVar17; fVar17 = cos(local_100.y); local_10c.x = fVar17 * 7.0; fVar17 = sin(local_100.y); local_10c.y = fVar17 * 7.0; ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x4000; projParams.Scale = 1.5; uVar8 = Random(); projParams.FallingAccelModifier = -0.096; projParams.FallingSpeedModifier = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_10c,0,&projParams); } npc->_stateFrame = npc->_stateFrame + 1; } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Splat"); if (bVar7 == 0) { LAB_004ace68: fVar17 = -NAN; } else { if (npc->_stateFrame < 3) { Sprite::SetFrame_1((Sprite *)&npc->_sprite,6); goto LAB_004ace68; } if (0.5 <= (float)local_110) goto LAB_004ace68; uVar8 = Random(); fVar17 = -NAN; if ((uVar8 & 1) == 0) { fVar17 = local_114; } } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; } LAB_004ace95: if (-1 < (int)fVar17) { local_100.y = (float)Entity_NPC::GetPlayerTarget(npc); switch(fVar17) { case 0.0: fVar18 = (((Entity *)local_100.y)->_pos).x - (npc->_pos).x; fVar17 = (((Entity *)local_100.y)->_pos).y - (npc->_pos).y; if (ABS(fVar18) <= ABS(fVar17)) { if (0.0 <= fVar17) { fVar17 = 4.2039e-45; animName = "BrimstoneStartDown"; } else { fVar17 = 1.4013e-45; animName = "BrimstoneStartUp"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } else { fVar17 = 0.0; if (0.0 <= fVar18) { fVar17 = local_114; } ANM2::Play(&npc->_sprite,(byte *)"BrimstoneStartRight",0); (npc->_sprite)._flipX = fVar17 == 0.0; } npc->_i1 = (int)fVar17; (npc->_v2).x = 0.0; npc->_state = 8; Entity_NPC::PlaySound(npc,0x223,1.0,2,0,1.0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._colorize[2] = 2.0; npc->_projectileCooldown = 0x14; break; case 1.4013e-45: ANM2::Play(&npc->_sprite,(byte *)"JacobAttack",0); npc->_state = 9; npc->_projectileCooldown = 0x28; break; case 2.8026e-45: ANM2::Play(&npc->_sprite,(byte *)"CrossStart",0); npc->_state = 10; npc->_projectileCooldown = 5; break; case 4.2039e-45: ANM2::Play(&npc->_sprite,(byte *)"GodheadStart",0); npc->_state = 0xb; npc->_projectileCooldown = 0x3c; break; case 5.60519e-45: ANM2::Play(&npc->_sprite,(byte *)"BlackholeAttack",0); fVar17 = (npc->_pos).x; npc->_state = 0xc; npc->_projectileCooldown = 0x96; (npc->_sprite)._flipX = ((Vector *)((int)local_100.y + 0x33c))->x <= fVar17 && fVar17 != ((Vector *)((int)local_100.y + 0x33c))->x; Entity_NPC::PlaySound(npc,0x21f,1.0,2,0,2.0); } (npc->_v1).x = (npc->_pos).x; (npc->_v1).y = (npc->_pos).y; uVar8 = Random(); npc->_stateFrame = 0; npc->_projectileCooldown = npc->_projectileCooldown + uVar8 % 0x1e; } break; case 10: npc->_friction = npc->_friction * 0.6; fVar17 = (npc->_v1).y; fVar18 = (npc->_pos).y; (npc->_velocity).x = (npc->_v1).x - (npc->_pos).x; (npc->_velocity).y = fVar17 - fVar18; iVar10 = npc->_stateFrame; if ((0 < iVar10) && (local_114 = 0.0, 0 < (int)local_118)) { do { local_124 = (float)((iVar10 + -1) / 5); if (((iVar10 + -1) % 5 == 0) && ((int)local_124 < 5)) { local_100.y = 10.0 - (float)(int)local_124 * 0.5; Entity_NPC::PlaySound(npc,0x10b,0.5,2,0,1.0); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.098; projParams.FallingSpeedModifier = -0.5; local_104 = (EntityPtr)0x0; do { EVar20 = local_104; Isaac::GetAxisAlignedUnitVectorFromDir(&local_10c,(int)local_104); local_10c.x = local_10c.x * local_100.y; local_10c.y = local_10c.y * local_100.y; if (EVar20 == (EntityPtr)0x3) { local_10c.x = local_10c.x * 1.5; local_10c.y = local_10c.y * 1.5; } iVar10 = 0; local_138 = (Room *)local_10c.x; local_130 = (Entity *)local_10c.y; if (0 < (int)local_124) { local_120.y = (float)((int)local_124 + -1) * 0.5; do { local_12c.y = ((float)iVar10 - local_120.y) * 24.0 * 0.017453292; local_154._4_4_ = cos(local_12c.y); fVar17 = sin(local_12c.y); local_144.x = local_154._4_4_ * (float)local_138 - fVar17 * (float)local_130; local_144.y = local_154._4_4_ * (float)local_130 + fVar17 * (float)local_138; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_144,0,&projParams); iVar10 = iVar10 + 1; } while (iVar10 < (int)local_124); } local_104 = (EntityPtr)((int)local_104 + 1); } while ((uint)local_104 < 4); } iVar10 = npc->_stateFrame + 1; npc->_stateFrame = iVar10; if (0x19 < iVar10) { if ((0.33 <= (float)local_110) || (uVar8 = Random(), (uVar8 & 1) != 0)) { ANM2::Play(&npc->_sprite,(byte *)"CrossEnd",0); } else { ANM2::Play(&npc->_sprite,(byte *)"Scream",0); npc->_state = 0xd; } npc->_stateFrame = -1; break; } local_114 = (float)((int)local_114 + 1); } while ((int)local_114 < (int)local_118); } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { npc->_stateFrame = 1; } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 != 0) { if (npc->_stateFrame < 1) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; } else { ANM2::Play(&npc->_sprite,(byte *)"CrossLoop",0); } } break; case 0xb: npc->_friction = npc->_friction * 0.6; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { Entity_NPC::PlaySound(npc,0x225,1.0,2,0,1.0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._colorize[2] = 1.0; pEVar11 = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (pEVar11->_pos).x - (npc->_pos).x; local_10c.y = (pEVar11->_pos).y - (npc->_pos).y; Vector::Normalized(&local_10c,&tmpVec); Random(); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.08; projParams.Scale = 2.0; projParams.CircleAngle = 0.3926991; if ((npc->_stateFrame & 1) != 0) { projParams.CircleAngle = 0.0; } projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x8000; local_10c.x = 7.0; local_10c.y = 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_10c,9,&projParams); } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 == 0) break; iVar10 = 3; if ((float)local_110 < 0.5) { iVar10 = 4; } if (npc->_stateFrame != -1) { if (npc->_stateFrame < iVar10) { ANM2::Play(&npc->_sprite,(byte *)"GodheadShoot",1); npc->_stateFrame = npc->_stateFrame + 1; } else { ANM2::Play(&npc->_sprite,(byte *)"GodheadEnd",0); npc->_stateFrame = -1; } break; } goto LAB_004ad5b4; case 0xc: npc->_friction = npc->_friction * 0.6; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { Entity_NPC::PlaySound(npc,0x220,1.0,2,0,1.0); SFXManager::Stop(&g_manager->_sfxManager,0x21f); pEVar11 = Entity_NPC::GetPlayerTarget(npc); local_100.x = (pEVar11->_pos).x - (npc->_pos).x; local_100.y = (pEVar11->_pos).y - (npc->_pos).y; Vector::Normalized(&local_100,&local_10c); (npc->_sprite)._flipX = local_10c.x < 0.0; uVar8 = Random(); local_100.x = local_10c.x * 15.0; local_100.y = local_10c.y * 15.0; pEVar11 = Game::Spawn(g_game,1000,0xab,&npc->_pos,&local_100,(Entity *)npc,0,uVar8); (**(code **)(*(int *)pEVar11 + 0xc))(); (pEVar11->_posOffset).x = 0.0; (pEVar11->_posOffset).y = -46.0; Entity_NPC::SetRef_bec(npc,pEVar11); } bVar7 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Sound"); if (((bVar7 != 0) && (bVar7 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Splat"), bVar7 == 0)) && (iVar10 = Entity::GetIntervalTicks((Entity *)npc,8.0,0.0), iVar10 != 0)) { uVar8 = Random(); pEVar11 = Game::Spawn(g_game,1000,0xab,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar8); (**(code **)(*(int *)pEVar11 + 0xc))(); uVar8 = Random(); local_100.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.2; uVar8 = Random(); (pEVar11->_posOffset).x = 0.0; (pEVar11->_posOffset).y = -46.0; (pEVar11->_sprite)._scale.x = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.5; (pEVar11->_sprite)._scale.y = local_100.y; } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; (npc->_sprite)._flipX = 0; } break; case 0xd: if ((uint)npc->_stateFrame < 0xf) { Game::ShakeScreen(g_game,4); (npc->_v2).x = npc->_speedMultiplier * 40.0 + (npc->_v2).x; Entity_NPC::CalcTargetPosition(npc,&tmpVec,0.0); EntityList_EL::constructor((EntityList_EL *)&wallRng,&(room->_entityList)._updateEL); local_14 = 0.0; local_138 = (Room *)0x0; if ((undefined1 *)wallRng._shift3 != (undefined1 *)0x0) { puVar14 = (undefined1 *)wallRng._shift3; iVar10 = wallRng._shift1; do { playerSlot = *(int **)(iVar10 + (int)local_138 * 4); if (playerSlot != (int *)0x0) { if (playerSlot[10] == 9) { if (playerSlot[0xd] == 0x3b6) { if (playerSlot[0xc] == 0) { fVar18 = (npc->_pos).x - (float)playerSlot[0xcf]; fVar19 = (npc->_pos).y - (float)playerSlot[0xd0]; fVar17 = (npc->_v2).x; if (fVar19 * fVar19 + fVar18 * fVar18 <= fVar17 * fVar17) { flashColor._tint[0] = 1.0; flashColor._tint[1] = 1.0; flashColor._tint[2] = 1.0; flashColor._tint[3] = 1.0; playerSlot[0xc] = 1; flashColor._colorize[0] = 8.0; flashColor._colorize[1] = 0.0; flashColor._colorize[2] = 0.0; flashColor._colorize[3] = 0.0; flashColor._offset[0] = 0.0; flashColor._offset[1] = 0.0; flashColor._offset[2] = 0.0; (**(code **)(*playerSlot + 0x3c))(&flashColor,0xc,0xff,1,1); uVar8 = playerSlot[0x10e]; playerSlot[0x115] = playerSlot[0x10f]; playerSlot[0x116] = 0x40000000; playerSlot[0x104] = -0x3e240000; playerSlot[0x106] = -0x4251eb85; playerSlot[0x105] = (int)&DAT_bf800000; playerSlot[0x10a] = -0x40000000; playerSlot[0x10f] = playerSlot[0x10f] | 3; playerSlot[0x117] = (int)(float)playerSlot[0xe9] + 0x14; playerSlot[0x10e] = uVar8 | 0x8080000; playerSlot[0x114] = uVar8 & 0xf7ffffff; local_12c.y = (float)Entity_NPC::GetPlayerTarget(npc); if (playerSlot[0xf1] != 0) { local_100.y = (float)(playerSlot + 0xf1); std::multiset::erase(&local_100.y); } playerSlot[0xf1] = (int)local_12c.y; if ((Entity *)local_12c.y != (Entity *)0x0) { std::multiset::insert(playerSlot + 0xf1); } playerSlot[0x10b] = 0x3f59999a; npc->_i1 = npc->_i1 + 1; puVar14 = (undefined1 *)wallRng._shift3; iVar10 = wallRng._shift1; } } } } } local_138 = (Room *)&local_138->field_0x1; } while (local_138 < puVar14); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&wallRng); } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); pGVar12 = g_game; if (bVar7 != 0) { npc->_stateFrame = 0; (npc->_v2).x = 0.0; Game::MakeShockwave(pGVar12,&npc->_pos,0.02,0.07,0x14); npc->_i1 = 0; Entity_NPC::PlaySound(npc,0x228,1.0,2,0,1.0); } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 == 0) break; LAB_004ad5b4: ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; break; case 0x10: Camera::SetFocusPosition(room->_Camera,&npc->_pos); npc->_entityCollisionClass = 0; npc->_friction = npc->_friction * 0.5; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar7 != 0) { local_138 = (Room *)0x0; if ((room->_entityList)._updateEL._size != 0) { do { local_100.y = *(float *)((int)(room->_entityList)._updateEL._data + (int)local_138 * 4); if (((Vector *)&((Entity *)local_100.y)->_spawnerType)->x == 1.33123e-42) { iVar10 = ((Entity *)local_100.y)->_type; if (iVar10 == 9) { ((Entity *)((int)local_100.y + 0x40c))->_variant = 0; ((Entity *)((int)local_100.y + 0x40c))->_subtype = 0; goto LAB_004adc69; } if (iVar10 == 7) { pAVar3 = &((Entity *)((int)local_100.y + 0x40c))->_sprite; (pAVar3->_filename)._buf[4] = '\x01'; (pAVar3->_filename)._buf[5] = '\0'; (pAVar3->_filename)._buf[6] = '\0'; (pAVar3->_filename)._buf[7] = '\0'; } else if (iVar10 == 1000) { if (((Entity *)local_100.y)->_variant == 0x7e) { *(undefined4 *)&((Entity *)((int)local_100.y + 0x40c))->field_0x44 = 1; } else { if ((((Entity *)local_100.y)->_variant != 0xab) || (((Entity *)local_100.y)->_subtype != 0)) goto LAB_004adc70; *(undefined4 *)&((Entity *)((int)local_100.y + 0x40c))->field_0x44 = 2; ANM2::Play(&((Entity *)local_100.y)->_sprite,(byte *)"Fizzle",0); } LAB_004adc69: *(byte *)((int)local_100.y + 0x173) = 1; } } LAB_004adc70: local_138 = (Room *)&local_138->field_0x1; } while (local_138 < (undefined1 *)(room->_entityList)._updateEL._size); } local_104 = (EntityPtr)0x0; if ((npc->_vectorDeque1)._size != 0) { do { uVar16 = (npc->_vectorDeque1)._offset; uVar8 = (int)local_104 + uVar16; uVar15 = uVar8 & 1; iVar10 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar8 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); local_10c.x = *(float *)(iVar10 + uVar15 * 8); local_10c.y = *(float *)(iVar10 + 4 + uVar15 * 8); uVar16 = (int)local_104 + 2 + uVar16; local_100.y = *(float *)(*(int *)((int)(npc->_vectorDeque1)._map + (uVar16 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4) + (uVar16 & 1) * 8); uVar8 = Random(); pEVar11 = Game::Spawn(g_game,1000,200,&local_10c,&g_vectorZero,(Entity *)0x0,0,uVar8); local_104 = (EntityPtr)((int)local_104 + 3); (pEVar11->_sprite)._offset.x = 0.0; (pEVar11->_sprite)._offset.y = local_100.y; } while ((uint)local_104 < (npc->_vectorDeque1)._size); } std::deque::_Tidy(); std::deque::_Tidy(); Entity_NPC::PlaySound(npc,0x1e,1.0,2,0,1.0); } Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Splat"); if (bVar7 != 0) { uVar8 = Random(); pEVar11 = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar8); (**(code **)(*(int *)pEVar11 + 0xc))(); Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); } bVar7 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar7 != 0) { Entity_NPC::Morph(npc,0x3b6,2,0,-1); ANM2::Play(&npc->_sprite,(byte *)"Appear",0); Entity_NPC::PlaySound(npc,0x22f,0.6,2,0,1.0); } } if ((*(int *)((int)npc + 0xb64) != 2) && (iVar10 = Entity::GetIntervalTicks ((Entity *)npc,7.0,(float)(*(uint *)((int)npc + 0x20) % 7) + 0.0), iVar10 != 0)) { uVar8 = Random(); pEVar11 = Game::Spawn(g_game,1000,0xa9,(Vector *)((int)npc + 0x33c),&g_vectorZero,(Entity *)npc, 0,uVar8); uVar8 = Random(); pAVar3 = &pEVar11[1]._sprite; (pAVar3->_filename)._buf[8] = '<'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &pEVar11[1]._sprite; (pAVar3->_filename)._buf[0xc] = '<'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; iVar10 = *(int *)pEVar11; fVar17 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + 0.5; (pEVar11->_sprite)._scale.x = fVar17; (pEVar11->_sprite)._scale.y = fVar17; (**(code **)(iVar10 + 0xc))(); } ExceptionList = local_1c; return; } //@@ 004ae4d0 NpcAI::ENTITY_DOGMA_angel /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dispatcher case type 950 variant 2; strs NukeStart/NukeLoop/RingLoop/SpreadAttack/Fizzle (Dogma phase-2 angel form) */ void __fastcall NpcAI::ENTITY_DOGMA_angel(Entity_NPC *npc) { float *pfVar1; byte bVar2; char cVar3; uint uVar4; uint randomValue; EntityPtr nuke; Entity *pEVar5; Vector *pVVar6; Vector *pVVar7; byte *pbVar8; uint randomValue; LayerState *layer; int *playerIter; void *pvVar10; MusicManager *music; Room *extraout_ECX; Room *extraout_ECX_00; Room *extraout_ECX_01; Room *extraout_ECX_02; Room *extraout_ECX_03; Room *extraout_ECX_04; Room *extraout_ECX_05; Room *extraout_ECX_06; Room *extraout_ECX_07; Room *extraout_ECX_08; Room *extraout_ECX_09; Room *extraout_ECX_10; Room *extraout_ECX_11; Room *extraout_ECX_12; Room *extraout_ECX_13; char *pcVar11; Room *extraout_ECX_14; Room *extraout_ECX_15; Room *pRVar12; Room *extraout_ECX_16; Room *extraout_ECX_17; Room *extraout_ECX_18; Room *extraout_ECX_19; int iVar13; undefined1 *nearbyCount; int iVar14; Entity_NPC *pEVar15; ANM2 *pAVar16; code *pcVar17; bool isNameLess; float fVar18; float fVar19; undefined1 auVar20 [12]; float fVar21; undefined4 uVar22; EntityRef sourceRef; EntityList_EL nearbyList; Vector local_108; Vector local_100; Room *room; Vector local_f4; Vector scratchVec; Vector local_e4; Entity_NPC *local_dc; Entity_NPC *local_d8; byte isLayerVisible; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; AnimationState *animState; uint *flagsHigh; Game *game; Manager *manager; EntityPtr *nukeRefSlot; SoundEffects *sfx; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af31b0; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)&(&projParams)[1].Spread; local_d8 = (Entity_NPC *)(npc->_health / npc->_maxHitPoints); room = g_game->_room; pEVar15 = (Entity_NPC *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_dc = pEVar15; local_24 = uVar4; if (npc->_aiCallPhase == 1) { ExceptionList = &local_1c; if (0.0 < npc->_pendingDamage) { npc->_pendingDamage = 0.0; pvVar10 = (npc->_damageEvents)._begin; local_e4.y = 0.0; iVar13 = (int)(npc->_damageEvents)._end - (int)pvVar10; iVar14 = iVar13 >> 0x1f; if (iVar13 / 0x38 + iVar14 != iVar14) { local_f4.y = 0.0; do { if ((*(int *)((int)pvVar10 + (int)local_f4.y + 0x10) == 0x3b6) && ((bool)((byte)(*(uint *)((int)local_f4.y + 0x30 + (int)pvVar10) >> 1) & 1) == ((npc->_flags & 0x20000000) != 0))) { *(undefined4 *)((int)local_f4.y + (int)pvVar10) = 0; } pfVar1 = (float *)((int)local_f4.y + (int)pvVar10); local_e4.y = (float)((int)local_e4.y + 1); local_f4.y = (float)((int)local_f4.y + 0x38); npc->_pendingDamage = *pfVar1 + npc->_pendingDamage; pvVar10 = (npc->_damageEvents)._begin; } while ((uint)local_e4.y < (undefined1 *)(((int)(npc->_damageEvents)._end - (int)pvVar10) / 0x38)); } } ENTITY_DOGMA_update_distortion(npc); if (npc->_state == 0x12) { if ((npc->_sprite)._overlayAnimState._isPlaying != 0) { pbVar8 = (byte *)0x0; if ((npc->_sprite)._layerCount != 0) { do { isLayerVisible = pbVar8 != &DAT_00000005; layer = ANM2::GetLayer(&npc->_sprite,pbVar8); pbVar8 = pbVar8 + 1; layer->_visible = isLayerVisible; } while (pbVar8 < (byte *)(npc->_sprite)._layerCount); } AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); npc->_i2 = 1; } pvVar10 = room->_Camera; if (*(char *)((int)pvVar10 + 0x8c) == '\0') { local_e4.y = *(float *)((int)pvVar10 + 0x54); pEVar15 = *(Entity_NPC **)((int)pvVar10 + 0x58); if (pEVar15 == (Entity_NPC *)local_e4.y) { if ((int)pEVar15 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_e4.y = *(float *)((int)pvVar10 + 0x54); pEVar15 = *(Entity_NPC **)((int)pvVar10 + 0x58); } iVar14 = (*(int *)((int)pvVar10 + 0x5c) + 1) % (int)local_e4.y; pEVar15 = (Entity_NPC *)((int)&pEVar15[-1]._pickupGhostsEntity + 3); *(int *)((int)pvVar10 + 0x5c) = iVar14; *(Entity_NPC **)((int)pvVar10 + 0x58) = pEVar15; } else { iVar14 = *(int *)((int)pvVar10 + 0x5c); } pfVar1 = (float *)(*(int *)((int)pvVar10 + 0x50) + (((int)(&(pEVar15->_sprite)._filename + -3) + iVar14) % (int)local_e4.y) * 8); *pfVar1 = (npc->_pos).x; pfVar1[1] = (npc->_pos).y; *(int *)((int)pvVar10 + 0x58) = *(int *)((int)pvVar10 + 0x58) + 1; *(undefined1 *)((int)pvVar10 + 0x8c) = 1; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Sound"); if (bVar2 != 0) { BossOverlay::play(2); music = &g_manager->_musicManager; music->_channels[music->_currentChannel]._enabledLayers = 0; MusicManager::EnableLayer(music,1,0); } if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); game = g_game; if (bVar2 == 0) { ExceptionList = local_1c; return; } playerIter = (g_game->_playerManager)._playerList._begin; if (playerIter != (g_game->_playerManager)._playerList._end) { do { iVar14 = *playerIter; playerIter = playerIter + 1; *(undefined1 *)(iVar14 + 0x410) = 0; } while (playerIter != (game->_playerManager)._playerList._end); } BossOverlay::play(3); MusicManager::Crossfade(&g_manager->_musicManager,0x30,0.5); manager = g_manager; if ((g_manager->_sfxManager)._volumeModifier != -10.0) { sfx = &g_manager->_sfxManager; (g_manager->_sfxManager)._volumeModifier = -10.0; SoundEffects::ClearVolumeModifier(sfx); } (manager->_sfxManager)._volumeModifierStep = 0.005; ExceptionList = local_1c; return; } if (0 < npc->_projectileDelay) { iVar13 = npc->_projectileDelay - (int)pEVar15; iVar14 = 0; if (0 < iVar13) { iVar14 = iVar13; } npc->_projectileDelay = iVar14; } if (((float)local_d8 < 0.25) && (uVar4 = Random(), (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 < 0.02 - (float)local_d8 * 0.06)) { uVar4 = Random(); bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(&PTR_s_Glitch0_00b1ebf8)[uVar4 & 3],1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } pvVar10 = (npc->_sprite)._overlayAnimState._animData; if ((pvVar10 == (void *)0x0) || (uVar4 = *(uint *)((int)pvVar10 + 0x30), uVar4 == 0)) { randomValue = 0; } else { randomValue = Random(); randomValue = randomValue % uVar4; pvVar10 = (npc->_sprite)._overlayAnimState._animData; } if (pvVar10 != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)(int)randomValue); } pbVar8 = (byte *)0x0; npc->_i2 = 1; if ((npc->_sprite)._layerCount != 0) { do { isLayerVisible = pbVar8 != &DAT_00000005; layer = ANM2::GetLayer(&npc->_sprite,pbVar8); pbVar8 = pbVar8 + 1; layer->_visible = isLayerVisible; } while (pbVar8 < (byte *)(npc->_sprite)._layerCount); } uVar4 = Random(); npc->_projectileDelay = (uVar4 & 3) + 3; } if ((npc->_sprite)._overlayAnimState._isPlaying == 0) { ExceptionList = local_1c; return; } layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000005); if (layer->_visible != 0) { if (0 < npc->_projectileDelay) { ExceptionList = local_1c; return; } pbVar8 = (byte *)0x0; if ((npc->_sprite)._layerCount != 0) { do { isLayerVisible = pbVar8 != &DAT_00000005; layer = ANM2::GetLayer(&npc->_sprite,pbVar8); pbVar8 = pbVar8 + 1; layer->_visible = isLayerVisible; } while (pbVar8 < (byte *)(npc->_sprite)._layerCount); } AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); npc->_i2 = 1; ExceptionList = local_1c; return; } if (0 < npc->_i2) { ExceptionList = local_1c; return; } pbVar8 = (byte *)0x0; if ((npc->_sprite)._layerCount == 0) { ExceptionList = local_1c; return; } do { isLayerVisible = pbVar8 == &DAT_00000005; layer = ANM2::GetLayer(&npc->_sprite,pbVar8); pbVar8 = pbVar8 + 1; layer->_visible = isLayerVisible; } while (pbVar8 < (byte *)(npc->_sprite)._layerCount); ExceptionList = local_1c; return; } if (npc->_aiCallPhase == 2) { return; } pRVar12 = room; ExceptionList = &local_1c; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); switch(npc->_state) { case 0: npc->_state = 3; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); break; case 3: npc->_friction = npc->_friction * 0.75; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x236,1.0,2,0,1.0); } if (0 < npc->_projectileCooldown) { iVar13 = npc->_projectileCooldown - (int)pEVar15; iVar14 = 0; if (0 < iVar13) { iVar14 = iVar13; } npc->_projectileCooldown = iVar14; } Entity_NPC::CalcTargetPosition(npc,&local_f4,0.0); pVVar6 = &npc->_pos; local_dc = (Entity_NPC *)(npc->_updateTime * 0.03); fVar18 = cos((float)local_dc); scratchVec.x = (fVar18 * 280.0 + local_f4.x) - pVVar6->x; fVar18 = sin((float)local_dc + (float)local_dc); scratchVec.y = (fVar18 * 0.5 * 220.0 + local_f4.y) - (npc->_pos).y; pVVar7 = Vector::Resized(&scratchVec,&local_108,1.5); fVar18 = npc->_speedMultiplier; fVar21 = pVVar7->y; (npc->_velocity).x = fVar18 * pVVar7->x + (npc->_velocity).x; (npc->_velocity).y = fVar21 * fVar18 + (npc->_velocity).y; pRVar12 = extraout_ECX_01; if (0 < npc->_projectileCooldown) break; fVar18 = ABS(local_f4.x - pVVar6->x); if (((fVar18 <= ABS(local_f4.y - (npc->_pos).y)) || (fVar18 <= 240.0)) || (randomValue = Random(), randomValue % 3 != 0)) { bVar2 = Room::IsPositionInRoom(room,pVVar6,80.0); pRVar12 = extraout_ECX_03; if (bVar2 != 0) { randomValue = Random(); if (randomValue % 0x1e == 0) { ANM2::Play(&npc->_sprite,(byte *)"NukeStart",0); npc->_state = 9; npc->_stateFrame = 0; (npc->_targetPosition).x = pVVar6->x; (npc->_targetPosition).y = (npc->_pos).y; pRVar12 = extraout_ECX_04; } else { pRVar12 = (Room *)0x1e; if (randomValue % 0x1e == 1) { ANM2::Play(&npc->_sprite,(byte *)"RingStart",0); npc->_state = 10; npc->_stateFrame = 0; (npc->_targetPosition).x = pVVar6->x; (npc->_targetPosition).y = (npc->_pos).y; Entity_NPC::PlaySound(npc,0x22a,1.0,2,0,1.0); pRVar12 = extraout_ECX_05; } } } break; } ANM2::Play(&npc->_sprite,(byte *)"SpreadAttack",0); (npc->_sprite)._flipX = pVVar6->x <= local_f4.x && local_f4.x != pVVar6->x; npc->_state = 8; pRVar12 = extraout_ECX_02; LAB_004ae898: npc->_stateFrame = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; break; case 8: case 0xd: npc->_friction = npc->_friction * 0.7; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); fVar18 = atan2f(scratchVec.y - (npc->_pos).y,scratchVec.x - (npc->_pos).x); if ((npc->_sprite)._flipX == 0) { fVar21 = 180.0; } else { fVar21 = 0.0; } local_d8 = (Entity_NPC *)approach_angle(fVar21,fVar18 * 57.295776,45.0); iVar14 = npc->_state; (npc->_v2).y = 5.0; (npc->_v2).x = (float)local_d8 + 180.0; if (iVar14 == 0xd) { nukeRefSlot = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_d8 = (Entity_NPC *)((float)local_d8 * 0.017453292); fVar18 = cos((float)local_d8); local_dc = (Entity_NPC *)(fVar18 * 15.0); fVar18 = sin((float)local_d8); nuke = *nukeRefSlot; *(Entity_NPC **)((int)nuke + 0x360) = local_dc; *(float *)((int)nuke + 0x364) = fVar18 * 15.0; local_e4.y = (float)((int)*nukeRefSlot + 0x3bc); if (*(int *)local_e4.y != 0) { local_dc = (Entity_NPC *)local_e4.y; std::multiset::erase(&local_dc); } *(int *)local_e4.y = 0; if (*nukeRefSlot != (EntityPtr)0x0) { local_dc = (Entity_NPC *)nukeRefSlot; std::multiset::erase(&local_dc); } *nukeRefSlot = (EntityPtr)0x0; iVar14 = 0x232; goto LAB_004aee3a; } } else { ProjectileParams::ProjectileParams(&projParams); randomValue = 0; local_dc = (Entity_NPC *)((float)local_d8 - 10.0); projParams.Variant = 0xd; projParams.FallingAccelModifier = -0.15; do { randomValue = Random(); local_e4.y = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 0.6 + 7.0; local_100.y = ((float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 20.0 + (float)local_dc) * 0.017453292; local_f4.x = cos(local_100.y); local_f4.x = local_f4.x * local_e4.y; fVar18 = sin(local_100.y); local_f4.y = fVar18 * local_e4.y; randomValue = Random(); projParams.Scale = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; scratchVec.x = local_f4.x + (npc->_pos).x; scratchVec.y = local_f4.y + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&scratchVec,&local_f4,0,&projParams); randomValue = randomValue + 1; } while (randomValue < 0xe); randomValue = 0; local_d8 = (Entity_NPC *)((float)local_d8 - 60.0); projParams.FallingAccelModifier = -0.17; do { randomValue = Random(); local_e4.y = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 0.3 + 4.0; local_100.y = ((float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 120.0 + (float)local_d8) * 0.017453292; local_f4.x = cos(local_100.y); local_f4.x = local_f4.x * local_e4.y; fVar18 = sin(local_100.y); local_f4.y = fVar18 * local_e4.y; randomValue = Random(); projParams.Scale = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; scratchVec.x = local_f4.x + (npc->_pos).x; scratchVec.y = local_f4.y + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&scratchVec,&local_f4,0,&projParams); randomValue = randomValue + 1; } while (randomValue < 0xe); iVar14 = 0x22c; LAB_004aee3a: Entity_NPC::PlaySound(npc,iVar14,1.0,2,0,1.0); } randomValue = Random(); Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)0x0,2,randomValue); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); pRVar12 = extraout_ECX_06; if (bVar2 != 0) { local_100.y = (npc->_v2).x * 0.017453292; local_e4.y = (npc->_v2).y; local_d8 = (Entity_NPC *)npc->_speedMultiplier; fVar18 = cos(local_100.y); (npc->_velocity).x = fVar18 * local_e4.y * (float)local_d8 + (npc->_velocity).x; fVar18 = sin(local_100.y); auVar20 = ZEXT812(0x3f4ccccd); (npc->_velocity).y = fVar18 * local_e4.y * (float)local_d8 + (npc->_velocity).y; fVar18 = npc->_speedMultiplier; if (fVar18 != 1.0) { fVar21 = auVar20._0_4_; auVar20._4_8_ = auVar20._4_8_; auVar20._0_4_ = fVar21 / ((fVar18 + fVar21) - fVar18 * fVar21); } (npc->_v2).y = auVar20._0_4_ * (npc->_v2).y; pRVar12 = extraout_ECX_07; } if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) break; } } ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; randomValue = Random(); iVar14 = randomValue % 0x1e + 0x5a; goto LAB_004afb59; case 9: npc->_friction = npc->_friction * 0.5; fVar18 = (npc->_targetPosition).y; fVar21 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar18 - fVar21; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,2,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); pRVar12 = extraout_ECX_08; if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x231,1.0,2,0,1.0); randomValue = Random(); nuke = (EntityPtr)Game::Spawn(g_game,1000,0xac,&npc->_pos,&g_vectorZero,(Entity *)npc,0,randomValue) ; if (*(EntityPtr *)((int)nuke + 0x3bc) != (EntityPtr)0x0) { local_100.y = (float)((int)nuke + 0x3bc); std::multiset::erase(&local_100.y); } *(EntityPtr *)((int)nuke + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)nuke + 0x3bc)); iVar14 = *(int *)nuke; ((Vector *)((int)nuke + 0x34c))->x = 0.0; *(float *)((int)nuke + 0x350) = -100.0; pAVar16 = (ANM2 *)((int)nuke + 0x454); (pAVar16->_filename)._buf[0] = '\0'; (pAVar16->_filename)._buf[1] = '\0'; (pAVar16->_filename)._buf[2] = '@'; (pAVar16->_filename)._buf[3] = '@'; pcVar11 = (char *)((int)nuke + 0x458); pcVar11[0] = '\0'; pcVar11[1] = '\0'; pcVar11[2] = '\0'; pcVar11[3] = '\0'; (**(code **)(iVar14 + 0xc))(); if (npc->_entityRef != (EntityPtr)0x0) { local_100.y = (float)&npc->_entityRef; std::multiset::erase(&local_100.y); } npc->_entityRef = nuke; std::multiset::insert(&npc->_entityRef); pRVar12 = extraout_ECX_09; } pAVar16 = &npc->_sprite; pvVar10 = (npc->_sprite)._animState._animData; if ((pvVar10 == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(pAVar16,(byte *)"NukeLoop",0); pvVar10 = (npc->_sprite)._animState._animData; pRVar12 = extraout_ECX_10; if (pvVar10 == (void *)0x0) break; } if (*(char *)((int)pvVar10 + 0x34) == '\0') break; nuke = npc->_entityRef; if ((nuke != (EntityPtr)0x0) && (*(int *)((int)nuke + 0x28) == 1000)) { if (-1 < *(int *)((int)nuke + 0x450)) break; Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); ANM2::Play(pAVar16,(byte *)"SpreadAttack",0); (npc->_sprite)._flipX = (npc->_pos).x <= scratchVec.x && scratchVec.x != (npc->_pos).x; npc->_state = 0xd; pRVar12 = extraout_ECX_11; goto LAB_004ae898; } ANM2::Play(pAVar16,s_Idle,0); npc->_state = 3; randomValue = Random(); iVar14 = randomValue % 0x1e + 0x8c; LAB_004afb59: npc->_projectileCooldown = iVar14; pRVar12 = (Room *)0x1e; break; case 10: iVar14 = npc->_stateFrame; pRVar12 = (Room *)&npc->_sprite; if (iVar14 == 0) { npc->_friction = 0.8; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)pRVar12,"Shoot"); pRVar12 = extraout_ECX_12; if (bVar2 != 0) { npc->_stateFrame = 1; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; uVar22 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x44000000; npc->_i1 = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar22; pRVar12 = extraout_ECX_12; } break; } if (iVar14 < 1) { npc->_friction = 0.9; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); if ((npc->_sprite)._animState._isPlaying != 0) break; } puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play((ANM2 *)pRVar12,s_Idle,0); npc->_state = 3; randomValue = Random(); iVar14 = randomValue % 0x1e + 0x8c; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xbbffffff; goto LAB_004afb59; } npc->_friction = 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play((ANM2 *)pRVar12,(byte *)"RingLoop",0); iVar14 = npc->_stateFrame; } npc->_stateFrame = (int)(&(pEVar15->_sprite)._filename + -3) + iVar14; pEVar5 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar5->_pos).x - (npc->_pos).x; scratchVec.y = (pEVar5->_pos).y - (npc->_pos).y; if (npc->_i1 == 0) { pVVar6 = Vector::Resized(&scratchVec,&local_f4,0.25); local_100.y = cos(0.2617994); fVar18 = sin(0.2617994); fVar21 = local_100.y * pVVar6->y; local_100.y = (npc->_targetPosition).x - (pVVar6->x * local_100.y - fVar18 * pVVar6->y) * npc->_speedMultiplier; local_dc = (Entity_NPC *) ((npc->_targetPosition).y - (fVar21 + pVVar6->x * fVar18) * npc->_speedMultiplier); (npc->_targetPosition).x = local_100.y; (npc->_targetPosition).y = (float)local_dc; fVar18 = (float)local_dc * (float)local_dc + local_100.y * local_100.y; if ((64.0 < fVar18) && (fVar18 = sqrtf(fVar18), 0.0 < fVar18)) { (npc->_targetPosition).y = (8.0 / fVar18) * (float)local_dc; (npc->_targetPosition).x = (8.0 / fVar18) * local_100.y; } pRVar12 = room; bVar2 = Room::IsPositionInRoom(room,&npc->_pos,0.0); if (bVar2 == 0) { pVVar6 = Room::GetCenterPos(&scratchVec); fVar18 = pVVar6->y - (npc->_pos).y; fVar21 = pVVar6->x - (npc->_pos).x; if (160000.0 < fVar18 * fVar18 + fVar21 * fVar21) { npc->_i1 = 1; } } else { } } else { pVVar6 = &npc->_targetPosition; local_d8 = (Entity_NPC *)npc->_speedMultiplier; local_108.y = scratchVec.x; local_f4.y = scratchVec.y; if (npc->_i1 == 1) { fVar18 = 0.8; if ((float)local_d8 != 1.0) { fVar18 = 0.8 / (((float)local_d8 + 0.8) - (float)local_d8 * 0.8); } local_100.y = fVar18 * pVVar6->x; local_dc = (Entity_NPC *)(fVar18 * (npc->_targetPosition).y); pVVar7 = Vector::Resized(&scratchVec,&local_e4,0.25); fVar18 = pVVar7->x; local_e4.y = (float)local_d8 * pVVar7->y + (float)local_dc; (npc->_targetPosition).y = local_e4.y; (npc->_targetPosition).x = local_100.y + (float)local_d8 * fVar18; } else { pVVar7 = Vector::Resized(&scratchVec,&local_100,0.25); local_e4.y = (float)local_d8 * pVVar7->y + (npc->_targetPosition).y; pVVar6->x = (float)local_d8 * pVVar7->x + pVVar6->x; (npc->_targetPosition).y = local_e4.y; } fVar18 = local_e4.y * local_e4.y + pVVar6->x * pVVar6->x; local_d8 = (Entity_NPC *)local_e4.y; if (fVar18 <= 64.0) { pEVar15 = (Entity_NPC *)local_e4.y; } else { fVar18 = sqrtf(fVar18); pEVar15 = (Entity_NPC *)local_e4.y; if (0.0 < fVar18) { pVVar6->x = (8.0 / fVar18) * pVVar6->x; pEVar15 = (Entity_NPC *)((float)local_d8 * (8.0 / fVar18)); (npc->_targetPosition).y = (float)pEVar15; } } if (npc->_i1 == 1) { pVVar6 = Vector::Normalized(&scratchVec,&local_100); pVVar7 = Vector::Normalized(&npc->_targetPosition,&scratchVec); if (0.9 < pVVar6->y * pVVar7->y + pVVar6->x * pVVar7->x) { npc->_i1 = 2; pEVar15 = (Entity_NPC *)(npc->_targetPosition).y; goto LAB_004af666; } } else if (npc->_i1 == 2) { LAB_004af666: if (local_108.y * (npc->_targetPosition).x + local_f4.y * (float)pEVar15 < 0.0) { npc->_i1 = 0; Entity_NPC::PlaySound(npc,0x235,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x10b,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.08; projParams.Variant = 0xd; projParams.Scale = 0.6; scratchVec.x = 11.0; scratchVec.y = 12.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projParams); projParams.CircleAngle = projParams.CircleAngle + 0.2617994; projParams.Scale = 0.8; scratchVec.x = 9.0; scratchVec.y = 12.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projParams); projParams.CircleAngle = projParams.CircleAngle + 0.2617994; projParams.Scale = 1.0; scratchVec.x = 7.0; scratchVec.y = 12.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projParams); if (0x168 < npc->_stateFrame) { npc->_stateFrame = -1; ANM2::Play(&npc->_sprite,(byte *)"RingEnd",0); } } } pRVar12 = room; } fVar18 = npc->_speedMultiplier; fVar21 = (npc->_targetPosition).x; (npc->_velocity).y = fVar18 * (npc->_targetPosition).y + (npc->_velocity).y; (npc->_velocity).x = fVar18 * fVar21 + (npc->_velocity).x; iVar14 = Entity::GetIntervalTicks((Entity *)npc,6.0,0.0); if (iVar14 != 0) { randomValue = Random(); scratchVec.x = (npc->_velocity).x * 0.5; scratchVec.y = (npc->_velocity).y * 0.5; pEVar5 = Game::Spawn(g_game,1000,0xac,&npc->_pos,&scratchVec,(Entity *)npc,2,randomValue); iVar14 = *(int *)pEVar5; (pEVar5->_posOffset).x = (npc->_posOffset).x; (pEVar5->_posOffset).y = (npc->_posOffset).y; (**(code **)(iVar14 + 0xc))(); } EntityList::QueryRadius(&pRVar12->_entityList,&nearbyList,&npc->_pos,npc->_size * 1.6,0x29); local_14 = 0.0; local_dc = (Entity_NPC *)0x0; nearbyCount = (undefined1 *)nearbyList._size; if ((undefined1 *)nearbyList._size != (undefined1 *)0x0) { do { local_e4.y = *(float *)((int)nearbyList._data + (int)local_dc * 4); if ((Entity_NPC *)local_e4.y != npc) { if ((((Entity_NPC *)local_e4.y)->_type == 1) || (((Entity_NPC *)local_e4.y)->_type == 3)) { pcVar17 = *(code **)(*(int *)local_e4.y + 0x20); EntityRef::constructor(&sourceRef,(Entity *)npc); uVar22 = 0x3f800000; } else { pcVar17 = *(code **)(*(int *)local_e4.y + 0x20); EntityRef::constructor(&sourceRef,(Entity *)npc); uVar22 = 0x42c80000; } (*pcVar17)(uVar22,0,0,&sourceRef,0x1e); fVar18 = local_e4.y; pEVar15 = (Entity_NPC *)(((Vector *)((int)local_e4.y + 0x33c))->y - (npc->_pos).y); local_d8 = (Entity_NPC *)(((Vector *)((int)local_e4.y + 0x33c))->x - (npc->_pos).x); local_e4.y = (float)pEVar15; fVar21 = sqrtf((float)pEVar15 * (float)pEVar15 + (float)local_d8 * (float)local_d8); if (0.0 < fVar21) { local_d8 = (Entity_NPC *)((float)local_d8 * (10.0 / fVar21)); local_e4.y = local_e4.y * (10.0 / fVar21); } local_f4.y = cos(1.5707964); fVar19 = sin(1.5707964); fVar21 = *(float *)((int)fVar18 + 0x39c); ((Vector *)((int)fVar18 + 0x360))->y = ((float)local_d8 * fVar19 + local_e4.y * local_f4.y) * fVar21 + ((Vector *)((int)fVar18 + 0x360))->y; ((Vector *)((int)fVar18 + 0x360))->x = ((float)local_d8 * local_f4.y - local_e4.y * fVar19) * fVar21 + ((Vector *)((int)fVar18 + 0x360))->x; nearbyCount = (undefined1 *)nearbyList._size; } local_dc = (Entity_NPC *)&local_dc->field_0x1; } while (local_dc < nearbyCount); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&nearbyList); pRVar12 = extraout_ECX_13; break; case 0x10: npc->_friction = npc->_friction * 0.6; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); Camera::SetFocusPosition(room->_Camera,&npc->_pos); Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x230,1.0,2,0,1.0); game = g_game; music = &g_manager->_musicManager; g_game->_bloomDuration = 6; game->_bloomTimer = 6; game->_bloomStrength = 0.5; music->_channels[music->_currentChannel]._enabledLayers = 0; MusicManager::EnableLayer(music,0,0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x40000000000); pRVar12 = extraout_ECX; if (bVar2 == 0) break; } ANM2::Play(&npc->_sprite,s_Idle,0); *(uint *)&npc->_flags = (uint)npc->_flags & 0x7fffffee; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh & 0xfffffff7; npc->_state = 3; npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 0; npc->_isInvicible = 0; npc->_projectileCooldown = 0; npc->_projectileDelay = 0; npc->_stateFrame = 0; pRVar12 = extraout_ECX_00; } if ((npc->_dead != 0) && (local_e4.y = 0.0, (room->_entityList)._updateEL._size != 0)) { do { pEVar15 = *(Entity_NPC **)((int)(room->_entityList)._updateEL._data + (int)local_e4.y * 4); if (pEVar15->_spawnerType == 0x3b6) { iVar14 = pEVar15->_type; if (iVar14 == 9) { *(undefined4 *)(&pEVar15->field_0x40c + 0x2c) = 0; *(int *)(&pEVar15->field_0x40c + 0x30) = 0; pEVar15->_dead = 1; } else if (iVar14 == 7) { *(undefined4 *)(&pEVar15->field_0x40c + 0x4c) = 1; } else { local_dc = pEVar15; if ((iVar14 == 1000) && (pEVar15->_variant == 0xac)) { if (pEVar15->_subtype == 0) { local_f4.y = (float)&pEVar15->_sprite; *(undefined4 *)(&pEVar15->field_0x40c + 0x44) = 0xfffffffe; pbVar8 = (pEVar15->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_004afc74: bVar2 = ANM2::SetAnimation(&pEVar15->_sprite,(byte *)"Fizzle",1); fVar18 = local_f4.y; pRVar12 = extraout_ECX_14; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)local_f4.y + 0x30)); ((AnimationState *)((int)fVar18 + 0x30))->_isPlaying = 1; pRVar12 = extraout_ECX_15; pEVar15 = local_dc; } } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar11 = "Fizzle"; do { bVar2 = *pbVar8; isNameLess = bVar2 < (byte)*pcVar11; if (bVar2 != *pcVar11) { LAB_004afc54: randomValue = -(uint)isNameLess | 1; goto LAB_004afc59; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; isNameLess = bVar2 < (byte)pcVar11[1]; if (bVar2 != pcVar11[1]) goto LAB_004afc54; pbVar8 = pbVar8 + 2; pcVar11 = pcVar11 + 2; } while (bVar2 != 0); randomValue = 0; LAB_004afc59: pRVar12 = (Room *)&pEVar15->_sprite; if ((randomValue != 0) || ((*(char *)((int)(pEVar15->_sprite)._animState._animData + 0x34) != '\0' && ((pEVar15->_sprite)._animState._isPlaying == 0)))) goto LAB_004afc74; } pEVar15->_dead = 1; } else if (pEVar15->_subtype == 1) { (**(code **)(*(int *)pEVar15 + 0x28))(uVar4); pRVar12 = extraout_ECX_16; } } else { bVar2 = Entity::is_valid_boss_enemy((Entity *)pEVar15,(int)pRVar12); pRVar12 = extraout_ECX_17; if (bVar2 != 0) { cVar3 = (**(code **)(*(int *)pEVar15 + 0x4c))(); pRVar12 = extraout_ECX_18; if (cVar3 == '\0') { pcVar17 = *(code **)(*(int *)pEVar15 + 0x24); EntityRef::constructor(&sourceRef,(Entity *)npc); (*pcVar17)(&sourceRef); pRVar12 = extraout_ECX_19; } } } } } local_e4.y = (float)((int)local_e4.y + 1); } while ((uint)local_e4.y < (uint)(room->_entityList)._updateEL._size); } ExceptionList = local_1c; return; } //@@ 004b0200 NpcAI::ENTITY_DOGMA_angel_baby /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 950.10: Appear, health 500 drained 3.5/tick to max, orbit Isaac, 1 in 20 DashStart below 100 health, dash past Isaac + 120 then DamageRadius 50 and Remove (pass6_h5) */ EntityPtr __fastcall NpcAI::ENTITY_DOGMA_angel_baby(Entity_NPC *npc) { int iVar1; byte bVar2; EntityPtr EVar3; Entity *tmpEntity; Vector *pVVar4; char *anim; uint uVar5; byte *curAnimChar; EntityPtr extraout_EAX; int iVar6; byte *expectedAnimChar; void *damageEvents; bool isCharLess; float fVar7; float fVar8; undefined1 defaultSplatColor [44]; Vector orbitOffset; Vector scratchVec; undefined1 local_2c [12]; float local_20; float local_1c; undefined1 *local_18; undefined4 local_14; byte *animData; undefined4 flagsHigh; local_14 = __security_cookie ^ (uint)(local_2c + 0x1c); if (npc->_aiCallPhase == 1) { if (0.0 < npc->_pendingDamage) { npc->_pendingDamage = 0.0; damageEvents = (npc->_damageEvents)._begin; iVar6 = (int)(npc->_damageEvents)._end - (int)damageEvents; iVar1 = iVar6 >> 0x1f; if (iVar6 / 0x38 + iVar1 != iVar1) { local_1c = 0.0; local_18 = (undefined1 *)0x0; do { fVar7 = *(float *)((int)local_1c + (int)damageEvents); if (*(int *)((int)local_1c + 0x10 + (int)damageEvents) == 0x3b6) { fVar7 = fVar7 * 10.0; *(float *)((int)local_1c + (int)damageEvents) = fVar7; } local_1c = (float)((int)local_1c + 0x38); local_18 = (undefined1 *)((int)local_18 + 1); npc->_pendingDamage = fVar7 + npc->_pendingDamage; damageEvents = (npc->_damageEvents)._begin; } while (local_18 < (uint)(((int)(npc->_damageEvents)._end - (int)damageEvents) / 0x38)); } } EVar3 = (EntityPtr)ENTITY_DOGMA_update_distortion(npc); return EVar3; } EVar3 = (EntityPtr)npc->_state; if (EVar3 == (EntityPtr)0x0) { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; EVar3 = (EntityPtr)defaultSplatColor; npc->_state = 3; npc->_health = 500.0; if ((EntityPtr)&npc->_splatColor != EVar3) { EVar3 = (EntityPtr)0x0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; } npc->_entityCollisionClass = 2; npc->_aiCallFlags = 1; return EVar3; } if (EVar3 != (EntityPtr)0x3) { if (EVar3 != (EntityPtr)0x8) { return EVar3; } npc->_friction = npc->_friction * 0.75; EVar3 = (EntityPtr)(npc->_sprite)._animState._animData; if ((EVar3 == (EntityPtr)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_18 = (undefined1 *)(tmpEntity->_pos).x; local_20 = (tmpEntity->_pos).y; (npc->_targetPosition).x = (float)local_18; (npc->_targetPosition).y = local_20; local_20 = local_20 - (npc->_pos).y; local_2c._8_4_ = (float)local_18 - (npc->_pos).x; pVVar4 = Vector::Resized((Vector *)(local_2c + 8),&scratchVec,120.0); fVar7 = (float)local_18 + pVVar4->x; (npc->_targetPosition).x = fVar7; local_20 = pVVar4->y + (npc->_targetPosition).y; (npc->_targetPosition).y = local_20; local_18 = (undefined1 *)(fVar7 - (npc->_pos).x); local_20 = local_20 - (npc->_pos).y; local_2c._8_4_ = local_18; local_1c = local_20; pVVar4 = Vector::Normalized((Vector *)(local_2c + 8),&scratchVec); (npc->_v1).x = pVVar4->x; (npc->_v1).y = pVVar4->y; if (ABS((float)local_18) <= ABS(local_1c)) { anim = "DashUp"; if (0.0 <= local_1c) { anim = "DashDown"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); } else { ANM2::Play(&npc->_sprite,(byte *)"DashRight",0); (npc->_sprite)._flipX = (float)local_18 < 0.0; } npc->_aiFloat = 0.2; EVar3 = (EntityPtr)(npc->_sprite)._animState._animData; if (EVar3 == (EntityPtr)0x0) { return (EntityPtr)0x0; } } if (*(char *)((int)EVar3 + 0x34) == '\0') { return EVar3; } local_1c = npc->_speedMultiplier; pVVar4 = &npc->_pos; fVar8 = local_1c + npc->_aiFloat; fVar7 = 10.0; if (fVar8 <= 10.0) { fVar7 = fVar8; } npc->_aiFloat = fVar7; local_2c._8_4_ = (npc->_targetPosition).x - pVVar4->x; local_20 = (npc->_targetPosition).y - (npc->_pos).y; EVar3 = (EntityPtr)Vector::Resized((Vector *)(local_2c + 8),&scratchVec,fVar7); fVar7 = *(float *)((int)EVar3 + 4); (npc->_velocity).x = local_1c * *(float *)EVar3 + (npc->_velocity).x; (npc->_velocity).y = local_1c * fVar7 + (npc->_velocity).y; if (0.0 < ((npc->_pos).y - (npc->_targetPosition).y) * (npc->_v1).y + (pVVar4->x - (npc->_targetPosition).x) * (npc->_v1).x) { uVar5 = Random(); iVar6 = 1000; tmpEntity = Game::Spawn(g_game,1000,0x90,pVVar4,&g_vectorZero,(Entity *)npc,2,uVar5); uVar5 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; iVar1 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.x = g_vectorOne.x; (tmpEntity->_sprite)._scale.y = g_vectorOne.y; (**(code **)(iVar1 + 0x40))(0x41a00000); (**(code **)(*(int *)tmpEntity + 0xc))(); Game::DamageRadius(&npc->_pos,(Entity *)npc,0,0,iVar6,50.0,g_tearFlagsNone,1.0,60.0); uVar5 = Random(); SoundEffects::PlayWithFartOverride (0x1dd,0.8,2,0, (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.2); Game::ShakeScreen(g_game,0xe); EVar3 = (EntityPtr)(**(code **)(*(int *)npc + 0x28))(); return EVar3; } return EVar3; } npc->_friction = npc->_friction * 0.9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedAnimChar = s_Idle; do { bVar2 = *curAnimChar; isCharLess = bVar2 < *expectedAnimChar; if (bVar2 != *expectedAnimChar) { LAB_004b06e8: uVar5 = -(uint)isCharLess | 1; goto LAB_004b06ed; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isCharLess = bVar2 < expectedAnimChar[1]; if (bVar2 != expectedAnimChar[1]) goto LAB_004b06e8; curAnimChar = curAnimChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar2 != 0); uVar5 = 0; LAB_004b06ed: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004b0724; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004b0724: EVar3 = (EntityPtr)(npc->_sprite)._animState._animData; if ((EVar3 != (EntityPtr)0x0) && (*(char *)((int)EVar3 + 0x34) != '\0')) { Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_2c._0_4_ = npc->_initSeed; local_2c._4_4_ = 0xf; local_2c._8_4_ = 1; local_20 = 4.06377e-44; fVar7 = RNG::RandomFloat((RNG *)local_2c); orbitOffset.y = fVar7 * 80.0 + 100.0; uVar5 = RNG::RandomInt((RNG *)local_2c,2); if (uVar5 == 0) { local_18 = &DAT_bf800000; } else { local_18 = (undefined1 *)0x3f800000; } local_1c = RNG::RandomFloat((RNG *)local_2c); local_18 = (undefined1 *)((local_1c * 2.5 + 2.5) * (float)local_18); fVar7 = RNG::RandomFloat((RNG *)local_2c); local_20 = fVar7 * 0.4 + 0.3; local_18 = (undefined1 *)((float)local_18 * npc->_updateTime * 0.017453292); local_1c = cos((float)local_18); fVar7 = sin((float)local_18); orbitOffset.x = ((orbitOffset.y * local_1c - fVar7 * 0.0) + scratchVec.x) - (npc->_pos).x; orbitOffset.y = (orbitOffset.y * fVar7 + local_1c * 0.0 + scratchVec.y) - (npc->_pos).y; pVVar4 = Vector::Resized(&orbitOffset,&scratchVec,local_20); fVar7 = npc->_speedMultiplier; fVar8 = pVVar4->y; (npc->_velocity).x = fVar7 * pVVar4->x + (npc->_velocity).x; (npc->_velocity).y = fVar7 * fVar8 + (npc->_velocity).y; EVar3 = npc->_spawnerEntity; if ((((EVar3 == (EntityPtr)0x0) || (*(int *)((int)EVar3 + 0x28) != 0x3b6)) || (*(int *)((int)EVar3 + 0x2c) != 2)) || (*(int *)((int)EVar3 + 0xb64) != 9)) { fVar7 = npc->_health; fVar8 = npc->_maxHitPoints; if (fVar8 < fVar7) { fVar7 = fVar7 - npc->_speedMultiplier * 3.5; if (fVar8 <= fVar7) { fVar8 = fVar7; } npc->_health = fVar8; fVar7 = fVar8; } if (fVar7 < 100.0) { uVar5 = Random(); EVar3 = (EntityPtr)(uVar5 / 0x14); if (uVar5 % 0x14 == 0) { ANM2::Play(&npc->_sprite,(byte *)"DashStart",0); npc->_state = 8; return extraout_EAX; } } } } return EVar3; } //@@ 004b0a30 NpcAI::ENTITY_DOGMA_tv /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 950 Dogma block 006c40c7 switches on variant-1: variant 1 -> this, variant 2 -> 004ae4d0; anims Destroyed/Shoot/Transition, ChildNPC, RemoveStatusEffects */ void __fastcall NpcAI::ENTITY_DOGMA_tv(Entity_NPC *npc) { uint *puVar1; Vector *position; int iVar2; byte bVar3; uint uVar4; Entity *spawnedEffect; Entity_NPC *child; byte *animData; byte *pbVar6; int effectLifespan; bool isLess; undefined4 uStack_44; undefined4 uStack_40; Vector VStack_3c; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; byte *animData; qword flags; float posY; float targetY; local_c = __security_cookie ^ (uint)&uStack_44; if ((npc->_dead != 0) && (npc->_state != 0x10)) { npc->_dead = 0; npc->_entityCollisionClass = 0; Entity::RemoveStatusEffects((Entity *)npc); *(uint *)&npc->_flags = (uint)npc->_flags | 0x80000011; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"Destroyed",0); } iVar2 = npc->_state; if (iVar2 != 0) { if (iVar2 == 3) { targetY = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = targetY - posY; return; } if (iVar2 != 0x10) { return; } position = &npc->_pos; targetY = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - position->x; (npc->_velocity).y = targetY - posY; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { uVar4 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,1,position,&g_vectorZero,(Entity *)npc,0,uVar4,0); local_18 = 0; VStack_3c.y = 1.0; uStack_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; local_28 = 0x3f800000; uStack_24 = 0x3f800000; uStack_20 = 0x3f800000; uStack_1c = 0x3f800000; local_14 = 0; local_10 = 0; (**(code **)(*(int *)spawnedEffect + 0x3c))(&VStack_3c.y,0xffffffff,0xff,0); spawnedEffect->_renderDepthOffset = 50.0; (**(code **)(*(int *)spawnedEffect + 0xc))(); uVar4 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x3b,position,(Vector *)((int)register0x00000010 + -0x54), (Entity *)npc,0,uVar4,0); uVar4 = Random(); *(float *)(spawnedEffect[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); uStack_2c = 0; local_28 = 0; iVar2 = *(int *)spawnedEffect; effectLifespan = uVar4 % 0xf + 0xf; uStack_24 = 0; *(int *)(spawnedEffect[1]._sprite._filename._buf + 8) = effectLifespan; VStack_3c.x = 0.0; VStack_3c.y = 0.0; uStack_34 = 0; uStack_30 = 0; *(int *)(spawnedEffect[1]._sprite._filename._buf + 0xc) = effectLifespan; uStack_44 = 0x3ecccccd; uStack_40 = 0x3f800000; (**(code **)(iVar2 + 0x3c))((int)register0x00000010 + -0x4c,0xffffffff,0xff,0,1); spawnedEffect->_renderDepthOffset = 50.0; (**(code **)(*(int *)spawnedEffect + 0xc))(); Entity_NPC::PlaySound(npc,0x237,1.0,2,0,1.0); child = Entity_NPC::ChildNPC(npc); if ((child != (Entity_NPC *)0x0) && (child = Entity_NPC::ChildNPC(npc), child->_state != 0x10) ) { child = Entity_NPC::ChildNPC(npc); child->_state = 0x10; child = Entity_NPC::ChildNPC(npc); ANM2::Play(&child->_sprite,(byte *)"Transition",0); } } child = Entity_NPC::ChildNPC(npc); if (child != (Entity_NPC *)0x0) { return; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x100000); if (bVar3 == 0) { Room::TriggerBossDeath(g_game->_room,(Entity *)npc); npc->_canShutDoors = 0; return; } return; } flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x44000000; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animData = animData; if (0xf < *(uint *)(animData + 0x14)) { animData = *(byte **)animData; } pbVar6 = s_Idle; do { bVar3 = *animData; isLess = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_004b0dd4: uVar4 = -(uint)isLess | 1; goto LAB_004b0dd9; } if (bVar3 == 0) break; bVar3 = animData[1]; isLess = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_004b0dd4; animData = animData + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004b0dd9: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004b0e0c; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004b0e0c: (npc->_posOffset).y = 20.0; npc->_renderDepthOffset = -500.0; return; } //@@ 004b0e40 std::deque::assign /* DB: 8-byte element deque copy */ int std::deque::assign(int param_1) { int *piVar1; int iVar2; uint uVar3; int iVar4; int in_ECX; uint uVar5; uint uVar6; uint uVar7; if (in_ECX != param_1) { uVar7 = *(uint *)(param_1 + 0xc); uVar5 = *(uint *)(in_ECX + 0xc); uVar6 = *(int *)(param_1 + 0x10) + uVar7; uVar3 = *(int *)(in_ECX + 0x10) + uVar5; for (; uVar7 != uVar6; uVar7 = uVar7 + 1) { if (uVar5 == uVar3) { do { push_back(*(int *)(*(int *)(param_1 + 4) + (uVar7 >> 1 & *(int *)(param_1 + 8) - 1U) * 4) + (uVar7 & 1) * 8); uVar7 = uVar7 + 1; } while (uVar7 != uVar6); return in_ECX; } iVar4 = *(int *)(*(int *)(param_1 + 4) + (uVar7 >> 1 & *(int *)(param_1 + 8) - 1U) * 4); iVar2 = *(int *)(*(int *)(in_ECX + 4) + (uVar5 >> 1 & *(int *)(in_ECX + 8) - 1U) * 4); *(undefined4 *)(iVar2 + (uVar5 & 1) * 8) = *(undefined4 *)(iVar4 + (uVar7 & 1) * 8); *(undefined4 *)(iVar2 + 4 + (uVar5 & 1) * 8) = *(undefined4 *)(iVar4 + 4 + (uVar7 & 1) * 8); uVar5 = uVar5 + 1; } for (iVar4 = uVar3 - uVar5; iVar4 != 0; iVar4 = iVar4 + -1) { piVar1 = (int *)(in_ECX + 0x10); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; } } } return in_ECX; } //@@ 004b0f50 std::deque::push_back /* DB: deque 8-byte elems, _Growmap */ void std::deque::push_back(undefined4 *param_1) { undefined4 uVar1; uint uVar2; void *pvVar3; int in_ECX; int iVar4; uint uVar5; iVar4 = *(int *)(in_ECX + 0x10); uVar2 = *(uint *)(in_ECX + 0xc); if (((uVar2 + iVar4 & 1) == 0) && (*(uint *)(in_ECX + 8) <= iVar4 + 2U >> 1)) { deque::_Growmap(iVar4); uVar2 = *(uint *)(in_ECX + 0xc); iVar4 = *(int *)(in_ECX + 0x10); } uVar2 = *(int *)(in_ECX + 8) * 2 - 1U & uVar2; uVar5 = iVar4 + uVar2; *(uint *)(in_ECX + 0xc) = uVar2; uVar2 = *(int *)(in_ECX + 8) - 1U & uVar5 >> 1; iVar4 = uVar2 * 4; if (*(int *)(*(int *)(in_ECX + 4) + uVar2 * 4) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar4 + *(int *)(in_ECX + 4)) = pvVar3; } uVar5 = uVar5 & 1; uVar1 = param_1[1]; iVar4 = *(int *)(iVar4 + *(int *)(in_ECX + 4)); *(undefined4 *)(iVar4 + uVar5 * 8) = *param_1; *(undefined4 *)(iVar4 + 4 + uVar5 * 8) = uVar1; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; return; } //@@ 004b0fe0 NpcHelper::gideon_spawn_stairs /* DB: ? only caller NpcHelper::gideon_update_death 004b3610: at grid index ECX+0xba4 (checks 0..0x1bf, "SpawnGridEntity: Grid index invalid"), sets the crawlspace room (roomList+0x205 Data = RoomConfig::GetRandomRoom type 0x10 ROOM_DUNGEON) and spawns a GridEntity_Stairs (type 0x12, operator_new(0x154), GridEntity::Init) when the cell has no collision */ void NpcHelper::gideon_spawn_stairs(void) { undefined4 *puVar1; code *pcVar2; Game *pGVar3; Room *pRVar4; RoomConfig_Room *pRVar5; uint uVar6; GridEntity *pGVar7; int in_ECX; uint uVar8; RoomDescriptor *this; RNG local_28; Room *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar3 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00af3203; local_10 = ExceptionList; ExceptionList = &local_10; if (-1 < *(int *)(in_ECX + 0xba4)) { if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } this = &g_roomDescriptorDummy; if ((uint)pGVar3->_currentDimensionIdx < 3) { this = pGVar3->_roomList + 0x205; } if (this->Data == (void *)0x0) { local_28._seed = (pGVar3->_devilAngelRoomRNG)._seed; local_28._shift3 = 0x1b; local_28._shift1 = 1; local_28._shift2 = 0x1b; Seeds::Init3((Seeds *)this,&local_28); local_18 = (Room *)&g_game->_roomConfig; local_14 = 0; if (local_28._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = (uint)local_28._seed >> ((byte)local_28._shift1 & 0x1f) ^ local_28._seed; uVar8 = uVar8 << ((byte)local_28._shift2 & 0x1f) ^ uVar8; pRVar5 = RoomConfig::GetRandomRoom ((RoomConfig *)local_18,uVar8 >> ((byte)local_28._shift3 & 0x1f) ^ uVar8,0, 0,0x10,0xd,0,-1,0,0,&local_14,1,-1); this->Data = pRVar5; } local_18 = g_game->_room; local_14 = Random(); uVar8 = *(uint *)(in_ECX + 0xba4); if (((int)uVar8 < 0) || (0x1bf < (int)uVar8)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } pRVar4 = local_18; if (uVar8 < 0x1c0) { uVar6 = Room::GetGridCollision(local_18,uVar8); if ((int)uVar6 < 1) { pGVar7 = operator_new(0x154); local_8 = 0x12; local_18 = (Room *)pGVar7; if (pGVar7 == (GridEntity *)0x0) { pGVar7 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar7); *(undefined ***)pGVar7 = IsaacRepentancePlus::GridEntity_Stairs::vftable; } local_8 = 0xffffffff; if (pGVar7 != (GridEntity *)0x0) { (pGVar7->_desc)._type = 0x12; pGVar7->_gridIndex = uVar8; puVar1 = pRVar4->_gridEntities[uVar8]; if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); } pRVar4->_gridEntities[uVar8] = pGVar7; (pGVar7->_desc)._variant = 1; (pGVar7->_desc)._varData = 0; GridEntity::Init(pGVar7,local_14); } } } } ExceptionList = local_10; return; } //@@ 004b1210 NpcHelper::gideon_choose_attack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Gideon; was Console::SubmitInput; strs Attack2Start/Attack4Start prototype: db/protos.zhl */ void __fastcall NpcHelper::gideon_choose_attack(Entity_NPC *npc) { EntityPtr EVar1; RNG rng; undefined1 *puVar2; EntityPtr EVar3; byte bVar4; uint *puVar5; uint uVar6; int iVar7; byte *curAnimName; uint outcomeCount; int iVar8; byte *wantedAnimName; char *wantedAnimNameStr; ushort newCooldown; WeightedOutcomePicker ptr; bool isLess; undefined8 uStack_40; uint uStack_38; WeightedOutcomePicker picker; undefined4 *outcomesEnd; undefined4 *outcomesCapacity; float pitch; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; uint *attack4Cooldown; Manager *manager; EntityPtr parent; int *weight; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af322d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; EVar3 = npc->_parent; EVar1 = (EntityPtr)npc; while (parent = EVar3, parent != (EntityPtr)0x0) { EVar1 = parent; EVar3 = *(EntityPtr *)((int)parent + 0x3bc); } iVar7 = *(int *)((int)EVar1 + 0x3c0); while (puVar2 = (undefined1 *)((int)register0x00000010 + -4), iVar7 != 0) { if ((EVar1 != (EntityPtr)npc) && ((*(int *)((int)EVar1 + 0xb64) == 0xb || (*(int *)((int)EVar1 + 0xb64) == 7)))) { uVar6 = Random(); attack4Cooldown = (uint *)((int)&npc->_i2 + 2); newCooldown = (short)(uVar6 % 0x96) + 0x5a; uStack_38 = (uint)newCooldown; puVar5 = &uStack_38; if (newCooldown <= *(ushort *)attack4Cooldown) { puVar5 = attack4Cooldown; } *(ushort *)attack4Cooldown = (ushort)*puVar5; puVar2 = puStack_20; break; } EVar1 = *(EntityPtr *)((int)EVar1 + 0x3c0); iVar7 = *(int *)((int)EVar1 + 0x3c0); } puStack_20 = puVar2; picker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacity = (undefined4 *)0x0; local_14 = 0; uStack_40 = (ulonglong)(uint)uStack_40; uStack_38 = 1; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_40 + 4); if ((short)npc->_i2 == 0) { uVar6 = 0; outcomeCount = (int)outcomesEnd - (int)picker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 1) { weight = (int *)((int)picker + 4 + uVar6 * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)picker + 4 + uVar6 * 8) = 0; } goto LAB_004b137f; } uVar6 = uVar6 + 1; } while (uVar6 < outcomeCount); } uStack_40 = CONCAT44(1,(uint)uStack_40); uStack_38 = 1; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_40 + 4); } else { *outcomesEnd = 1; outcomesEnd[1] = 1; outcomesEnd = outcomesEnd + 2; } } LAB_004b137f: if ((3 < npc->_stateFrame) && (*(char *)((int)&npc->_i1 + 1) == '\0')) { uVar6 = 0; outcomeCount = (int)outcomesEnd - (int)picker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 2) { weight = (int *)((int)picker + 4 + uVar6 * 8); *weight = *weight + 6; if (*weight < 0) { *(undefined4 *)((int)picker + 4 + uVar6 * 8) = 0; } goto LAB_004b13f7; } uVar6 = uVar6 + 1; } while (uVar6 < outcomeCount); } uStack_40 = CONCAT44(2,(uint)uStack_40); uStack_38 = 6; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_40 + 4); } else { *outcomesEnd = 2; outcomesEnd[1] = 6; outcomesEnd = outcomesEnd + 2; } } LAB_004b13f7: if (*(short *)((int)&npc->_i2 + 2) == 0) { iVar8 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar7 = 0; if (0 < iVar8) { iVar7 = iVar8; } if (iVar7 < 5) { uVar6 = 0; outcomeCount = (int)outcomesEnd - (int)picker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 3) { weight = (int *)((int)picker + 4 + uVar6 * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)picker + 4 + uVar6 * 8) = 0; } goto LAB_004b1488; } uVar6 = uVar6 + 1; } while (uVar6 < outcomeCount); } uStack_40 = CONCAT44(3,(uint)uStack_40); uStack_38 = 1; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_40 + 4); } else { *outcomesEnd = 3; outcomesEnd[1] = 1; outcomesEnd = outcomesEnd + 2; } } } LAB_004b1488: uVar6 = Random(); uStack_40 = 0x900000005; uStack_38 = 7; rng._shift1 = 5; rng._seed = uVar6 | 1; rng._shift2 = 9; rng._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&picker,rng); manager = g_manager; switch(uVar6) { case 0: npc->_state = 8; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004b152e: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimName = s_Attack1; do { bVar4 = *curAnimName; isLess = bVar4 < *wantedAnimName; if (bVar4 != *wantedAnimName) { LAB_004b1510: uVar6 = -(uint)isLess | 1; goto LAB_004b1515; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < wantedAnimName[1]; if (bVar4 != wantedAnimName[1]) goto LAB_004b1510; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar4 != 0); uVar6 = 0; LAB_004b1515: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004b152e; } pitch = 0.9; if (npc->_championColorIdx == 0x12) { pitch = 1.4; } else if (npc->_championColorIdx == 0x13) { pitch = 0.45; } uStack_38 = 0x136; break; case 1: npc->_state = 9; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004b162e: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack2Start",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimNameStr = "Attack2Start"; do { bVar4 = *curAnimName; isLess = bVar4 < (byte)*wantedAnimNameStr; if (bVar4 != *wantedAnimNameStr) { LAB_004b1610: uVar6 = -(uint)isLess | 1; goto LAB_004b1615; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < (byte)wantedAnimNameStr[1]; if (bVar4 != wantedAnimNameStr[1]) goto LAB_004b1610; curAnimName = curAnimName + 2; wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar4 != 0); uVar6 = 0; LAB_004b1615: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004b162e; } pitch = 0.9; *(undefined2 *)&npc->_i2 = 0x1c2; if (npc->_championColorIdx == 0x12) { pitch = 1.4; uStack_38 = 0x138; } else { if (npc->_championColorIdx == 0x13) { pitch = 0.45; } uStack_38 = 0x138; } break; case 2: pitch = 0.9; npc->_state = 10; manager = g_manager; if (npc->_championColorIdx == 0x12) { pitch = 1.4; } else if (npc->_championColorIdx == 0x13) { pitch = 0.45; } uStack_38 = 0x133; seed_fart_sound_override((int *)&uStack_38); SoundEffects::Play(&manager->_sfxManager,uStack_38,1.0,2,0,pitch,0.0); animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004b177e: bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d2e4,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimName = &DAT_00b1d2e4; do { bVar4 = *curAnimName; isLess = bVar4 < *wantedAnimName; if (bVar4 != *wantedAnimName) { LAB_004b1760: uVar6 = -(uint)isLess | 1; goto LAB_004b1765; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < wantedAnimName[1]; if (bVar4 != wantedAnimName[1]) goto LAB_004b1760; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar4 != 0); uVar6 = 0; LAB_004b1765: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004b177e; } *(undefined1 *)((int)&npc->_i1 + 1) = 1; goto switchD_004b14c5_default; case 3: pitch = 1.0; if (npc->_championColorIdx == 0x12) { pitch = 1.5; } else if (npc->_championColorIdx == 0x13) { pitch = 0.5; } uStack_38 = 0x74; seed_fart_sound_override((int *)&uStack_38); SoundEffects::Play(&manager->_sfxManager,uStack_38,1.0,2,0,pitch,0.0); animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004b1874: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack4Start",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimNameStr = "Attack4Start"; do { bVar4 = *curAnimName; isLess = bVar4 < (byte)*wantedAnimNameStr; if (bVar4 != *wantedAnimNameStr) { LAB_004b1856: uVar6 = -(uint)isLess | 1; goto LAB_004b185b; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < (byte)wantedAnimNameStr[1]; if (bVar4 != wantedAnimNameStr[1]) goto LAB_004b1856; curAnimName = curAnimName + 2; wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar4 != 0); uVar6 = 0; LAB_004b185b: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004b1874; } npc->_state = 0xb; *(undefined2 *)((int)&npc->_i2 + 2) = 600; default: goto switchD_004b14c5_default; } manager = g_manager; seed_fart_sound_override((int *)&uStack_38); SoundEffects::Play(&manager->_sfxManager,uStack_38,1.0,2,0,pitch,0.0); switchD_004b14c5_default: if (picker != (WeightedOutcomePicker)0x0) { uVar6 = (int)outcomesCapacity - (int)picker & 0xfffffff8; ptr = picker; if (0xfff < uVar6) { ptr = *(WeightedOutcomePicker *)((int)picker + -4); uVar6 = uVar6 + 0x23; if (0x1f < ((int)picker - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar6); } ExceptionList = local_1c; return; } //@@ 004b1910 NpcHelper::gideon_spawn_wave /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Gideon; was ModManager::LoadConfigs; str "No enemy wave found for Gideon" */ void __thiscall NpcHelper::gideon_spawn_wave(void *this) { code *pcVar1; uint spawnVariant; uint stageType; void **gridEntityCursor; int gridX; uint *nextEntry; int iVar3; uint *puVar4; short *roomSpawn; uint uVar5; uint in_stack_ffffff38; int in_stack_ffffff3c; Vector local_9c; undefined8 local_90; Vector local_84; uint pitCount; uint waveDifficulty; uint *entriesCapacityEnd; void *gideon; uint *entriesBegin; uint *entriesEnd; uint *local_64; uint local_60; int local_5c; uint local_58; Room *room; uint *local_50; Game *local_4c; uint spawnEntry; uint uStack_44; uint local_40 [8]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint local_14; Game *game; Manager *manager; float maxHitPoints; undefined2 spawnVariant; puStack_20 = (undefined1 *)(local_40 + 0xf); local_14 = 0xffffffff; puStack_18 = &LAB_00af326d; local_1c = ExceptionList; local_40[7] = __security_cookie ^ (uint)(local_40 + 0xc); ExceptionList = &local_1c; if (*(int *)((int)this + 0x3bc) == 0) { spawnVariant = *(uint *)((int)this + 0x410); local_4c = g_game; if (6 < spawnVariant) { spawnVariant = 6; } room = g_game->_room; uVar5 = 0; local_40[1] = 1; local_40[2] = 5; local_40[3] = 5; local_40[4] = 10; local_40[5] = 10; local_40[6] = 0xf; iVar3 = room->_gridWidth * room->_gridHeight; waveDifficulty = local_40[spawnVariant]; spawnVariant = 0; pitCount = 0; if (0 < iVar3) { gridEntityCursor = room->_gridEntities; do { if (((spawnVariant < 0x1c0) && (*gridEntityCursor != (void *)0x0)) && (*(int *)((int)*gridEntityCursor + 4) == 7)) { uVar5 = uVar5 + 1; } spawnVariant = spawnVariant + 1; gridEntityCursor = gridEntityCursor + 1; } while ((int)spawnVariant < iVar3); pitCount = uVar5; } spawnVariant = *(uint *)((int)this + 0x3dc); gideon = this; puVar4 = local_40 + 0xf; if (spawnVariant == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); spawnVariant = *(uint *)((int)this + 0x3dc); local_4c = g_game; puVar4 = (uint *)puStack_20; if (spawnVariant == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } puStack_20 = (undefined1 *)puVar4; local_4c = g_game; spawnVariant = spawnVariant >> ((byte)*(undefined4 *)((int)this + 0x3e0) & 0x1f) ^ spawnVariant; local_90 = 0x900000005; spawnVariant = spawnVariant << ((byte)*(undefined4 *)((int)this + 0x3e4) & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant >> ((byte)*(undefined4 *)((int)this + 1000) & 0x1f) ^ spawnVariant; local_5c = 7; *(uint *)((int)this + 0x3dc) = spawnVariant; puVar4 = (uint *)0x0; local_50 = (uint *)0x0; entriesBegin = (uint *)0x0; entriesEnd = (uint *)0x0; entriesCapacityEnd = (uint *)0x0; local_64 = (uint *)0x0; local_14 = 0; local_58 = 0; while (local_50 == puVar4) { local_84.y = (float)&local_4c->_roomConfig; local_60 = 0; local_9c.y = (float)Room::GetRoomShape(room); if (local_4c->_challenge == 0x2c) { stageType = Level::GetRoomStageType((Level *)local_4c,local_4c->_currentRoomIdx); uVar5 = local_4c->_stage; LAB_004b1ace: local_4c = (Game *)RoomConfig::GetStageID(uVar5,stageType,-1); } else { if (local_4c->_currentDimensionIdx != 2) { stageType = local_4c->_stageType; uVar5 = local_4c->_stage; goto LAB_004b1ace; } local_4c = (Game *)0x23; } if (spawnVariant == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } spawnVariant = spawnVariant >> ((byte)local_90 & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant << ((byte)((ulonglong)local_90 >> 0x20) & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant >> ((byte)local_5c & 0x1f) ^ spawnVariant; local_4c = RoomConfig::GetRandomRoomWithFallbackStage ((RoomConfig *)local_84.y,spawnVariant,1,(int)local_4c,0,0xb,(int)local_9c.y, in_stack_ffffff38,in_stack_ffffff3c,waveDifficulty,waveDifficulty, &local_60,0xc,local_5c); if (local_4c == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"No enemy wave found for Gideon (difficulty: %d)\n"); } local_60 = 0; if ((short)*(uint *)((int)local_4c + 0x44) != 0) { local_50 = (uint *)0x0; do { roomSpawn = (short *)(*(uint *)((int)local_4c + 0x40) + (int)local_50); if (spawnVariant == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } spawnVariant = spawnVariant >> ((byte)local_90 & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant << ((byte)((ulonglong)local_90 >> 0x20) & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant >> ((byte)local_5c & 0x1f) ^ spawnVariant; puVar4 = Spawn::PickEntry(roomSpawn, (float)((double)(int)spawnVariant + __uint_to_double_fixup[-((int)spawnVariant >> 0x1f)]) * 2.3283062e-10); spawnEntry = *puVar4; uStack_44 = puVar4[1]; local_40[0] = puVar4[2]; iVar3 = roomSpawn[1] + 1; gridX = *roomSpawn + 1; if (((gridX < 0) || (room->_gridWidth <= gridX)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { uVar5 = 0xffffffff; } else { uVar5 = room->_gridWidth * iVar3 + gridX; } if (spawnVariant == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } spawnVariant = spawnVariant >> ((byte)local_90 & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant << ((byte)((ulonglong)local_90 >> 0x20) & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant >> ((byte)local_5c & 0x1f) ^ spawnVariant; Room::TransformEntry(room,&spawnEntry,uVar5,spawnVariant); if ((int)spawnEntry < 1000) { if ((spawnEntry == 0x339) && (pitCount < 6)) { local_50 = entriesBegin; entriesEnd = entriesBegin; puVar4 = entriesBegin; goto LAB_004b1ccf; } local_40[4] = spawnEntry; local_40[5] = uStack_44; local_40[6] = local_40[0]; local_40[3] = uVar5; if (entriesEnd == entriesCapacityEnd) { std::vector::_Emplace_reallocate(entriesEnd,local_40 + 3); entriesCapacityEnd = local_64; } else { *entriesEnd = uVar5; entriesEnd[1] = spawnEntry; entriesEnd[2] = uStack_44; entriesEnd[3] = local_40[0]; entriesEnd = entriesEnd + 4; } } local_60 = local_60 + 1; local_50 = (uint *)((int)local_50 + 0x10); } while (local_60 < (ushort)*(uint *)((int)local_4c + 0x44)); local_50 = entriesBegin; puVar4 = entriesEnd; } LAB_004b1ccf: local_58 = local_58 + 1; if (9 < local_58) { if (local_50 == puVar4) goto LAB_004b1e08; break; } local_4c = g_game; } local_4c = (Game *)(local_50 + 1); do { local_84.x = (float)((int)*(uint *)((int)local_4c + -4) % room->_gridWidth) * 40.0 + 40.0; local_84.y = (float)((int)*(uint *)((int)local_4c + -4) / room->_gridWidth) * 40.0 + 120.0; Room::FindFreeTilePosition(room,&local_9c,&local_84,0.0); if (spawnVariant == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } spawnVariant = spawnVariant >> ((byte)local_90 & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant << ((byte)((ulonglong)local_90 >> 0x20) & 0x1f) ^ spawnVariant; spawnVariant = spawnVariant >> ((byte)local_5c & 0x1f) ^ spawnVariant; spawnVariant = (undefined2)*(uint *)((int)local_4c + 4); iVar3 = spawn_enemy_spawner_effect (*(uint *)local_4c,spawnVariant,&local_9c,spawnVariant,gideon, *(undefined2 *)((int)local_4c + 6),spawnVariant,spawnVariant,0xffffffff); if ((((g_game != (Game *)0x0) && (1 < *(int *)&g_game->_deathmatchManager)) && (*(uint *)local_4c == 1)) || (*(uint *)local_4c - 10 < 0x3de)) { *(uint *)(iVar3 + 0x16c) = *(uint *)(iVar3 + 0x16c) | 0x80; *(undefined4 *)(iVar3 + 0x168) = *(undefined4 *)(iVar3 + 0x168); } nextEntry = (uint *)((int)local_4c + 0x10); puVar4 = (uint *)((int)local_4c + 0xc); local_4c = (Game *)nextEntry; } while (puVar4 != entriesEnd); LAB_004b1e08: manager = g_manager; local_58 = 0x367; seed_fart_sound_override((int *)&local_58); SoundEffects::Play(&manager->_sfxManager,local_58,1.0,2,0,1.0,0.0); game = g_game; maxHitPoints = *(float *)((int)gideon + 900); *(short *)&(g_game->_hud).field_0x54b8 = (short)(int)((maxHitPoints - *(float *)((int)gideon + 0x380)) + 1.0); *(short *)&(game->_hud).field_0x54ba = (short)(int)maxHitPoints; if (local_50 != (uint *)0x0) { spawnVariant = (int)entriesCapacityEnd - (int)local_50 & 0xfffffff0; puVar4 = local_50; if (0xfff < spawnVariant) { puVar4 = (uint *)local_50[-1]; spawnVariant = spawnVariant + 0x23; if (0x1f < (uint)((int)local_50 + (-4 - (int)puVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar4,spawnVariant); } } ExceptionList = local_1c; return; } //@@ 004b1ee0 NpcAI::ENTITY_GIDEON /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 907 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GIDEON(Entity_NPC *npc) { double dVar1; short sVar2; ANM2 *pAVar3; byte bVar4; uint uVar5; int gridY; uint flagsHigh; Entity *pEVar7; Vector *pVVar8; Entity_Projectile *projectile; int iVar9; ColorMod *color; byte *animName; int gridX; int attackTimer; Entity_NPC *pEVar10; char *expectedAnim; Game *game; EntityPtr *parentSlot; int iVar11; Room *room; bool bVar12; float fVar13; float fVar14; float fVar15; float fVar16; Vector laserDir; char local_1e0 [4]; void *gideonListData; Vector local_1d8; Vector local_1d0; float deathSoundPitch; Entity_NPC *gideon; Vector local_1c0; float local_1b8; float local_1b4; Vector local_1b0; Entity_NPC *local_1a8; Room *savedRoom; ProjectileParams rainParams; undefined1 shotParams [92]; undefined4 local_9c; ColorMod local_50; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; EntityPtr chainChild; qword flags; undefined4 flagsHigh; Manager *manager; EntityPtr parentGideon; float *sizeMultiY; float speedMultiplier; game = g_game; local_14 = -NAN; puStack_18 = &LAB_00af32b0; local_1c = ExceptionList; puStack_20 = (undefined1 *)(&local_50)[1]._offset; uVar5 = __security_cookie ^ (uint)((&local_50)[1]._colorize + 1); local_24 = uVar5; ExceptionList = &local_1c; room = g_game->_room; local_1b0.y = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); iVar11 = npc->_state; npc->_friction = npc->_friction * 0.4; gideon = npc; savedRoom = room; if (npc->_aiCallPhase == 1) { if ((((iVar11 != 0) && (iVar11 != 1)) && (parentGideon = npc->_parent, parentGideon != (EntityPtr)0x0)) && (*(int *)((int)parentGideon + 0x28) == npc->_type)) { if (*(int *)((int)parentGideon + 0xb64) != 0x12) { npc->_stateFrame = *(int *)((int)parentGideon + 0x410); *(undefined1 *)&npc->_i1 = *(undefined1 *)((int)parentGideon + 0xbc0); npc->_health = *(float *)((int)parentGideon + 0x380); } if ((npc->_subtype == 0) && (*(int *)((int)parentGideon + 0x30) == 1)) { npc->_subtype = 1; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"ClosedEyes",0); flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x100000; } } iVar11 = npc->_projectileDelay; if (iVar11 < 0) { ExceptionList = local_1c; return; } iVar9 = room->_gridWidth; uVar5 = 0; do { gridY = *(int *)((int)&DAT_00b1ee44 + uVar5) + iVar11 / iVar9; gridX = *(int *)((int)&DAT_00b1ee40 + uVar5) + iVar11 % iVar9; if (((-1 < gridX) && (gridX < room->_gridWidth)) && ((-1 < gridY && (((gridY < room->_gridHeight && (flagsHigh = gridY * room->_gridWidth + gridX, flagsHigh < 0x1c0)) && (room->_gridPaths[flagsHigh] < 0x3b7)))))) { room->_gridPaths[flagsHigh] = 3999; } uVar5 = uVar5 + 8; } while (uVar5 < 0x30); ExceptionList = local_1c; return; } deathSoundPitch = 1.0; switch(iVar11) { case 0: local_1b0.y = 0.45; local_1b0.x = 1.0; Entity::SetSize((Entity *)npc,52.0,(Vector)0x3ee666663f800000,8); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; npc->_state = 3; npc->_isInvicible = 1; npc->_aiCallFlags = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; *(undefined1 *)&npc->_i1 = 1; iVar11 = Room::GetGridIndex(room,&npc->_pos); npc->_projectileDelay = iVar11; npc->_aiCounter = 0; npc->_projectileCooldown = 0; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 1) = 0; npc->_i2 = 0; if (npc->_subtype == 1) { npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"ClosedEyes",0); flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x100000; } Entity_NPC::QueryNPCsType(local_1e0,npc->_type,-1); local_14 = 0.0; fVar13 = 0.0; if (local_1d8.y != 0.0) { LAB_004b21f0: if (*(Entity_NPC **)((int)gideonListData + (int)fVar13 * 4) == npc) goto code_r0x004b21f5; parentGideon = *(EntityPtr *)((int)gideonListData + (int)fVar13 * 4); for (chainChild = *(EntityPtr *)((int)parentGideon + 0x3c0); chainChild != (EntityPtr)0x0; chainChild = *(EntityPtr *)((int)chainChild + 0x3c0)) { parentGideon = chainChild; } if (npc->_parent != (EntityPtr)0x0) { local_1b0.y = (float)&npc->_parent; std::multiset::erase(&local_1b0.y); } npc->_parent = parentGideon; std::multiset::insert(&npc->_parent); parentSlot = (EntityPtr *)((int)parentGideon + 0x3c0); if (*(int *)((int)parentGideon + 0x3c0) != 0) { local_1b0.y = (float)parentSlot; std::multiset::erase(&local_1b0.y); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); } LAB_004b228c: if (npc->_parent != (EntityPtr)0x0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x80100000; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; Entity::SetVisibleFlag((Entity *)npc,0); } if (local_1e0[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,gideonListData,0); } game = g_game; local_14 = -NAN; if (npc->_parent == (EntityPtr)0x0) { fVar13 = npc->_maxHitPoints; *(short *)&(g_game->_hud).field_0x54b8 = (short)(int)((fVar13 - npc->_health) + 1.0); *(short *)&(game->_hud).field_0x54ba = (short)(int)fVar13; } break; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); } iVar11 = npc->_aiCounter + 1; npc->_aiCounter = iVar11; if (((iVar11 < 0x1f) || ((char)npc->_i1 == '\0')) || (npc->_parent != (EntityPtr)0x0)) { if ((0x5a < iVar11) && (flagsHigh = Random(), flagsHigh % 0xf == 0)) { NpcHelper::gideon_choose_attack(npc); } } else { flagsHigh = Random(); if ((flagsHigh & 7) == 0) { Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,0.9); npc->_state = 0xd; } } break; case 6: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack2Loop",0); } ProjectileParams::ProjectileParams(&rainParams); local_50._tint[0] = 1.0; local_50._tint[1] = 1.0; local_50._tint[2] = 1.0; local_50._tint[3] = 1.0; local_50._offset[0] = 1.0; local_50._offset[1] = 0.3; local_50._colorize[0] = 0.0; local_50._colorize[1] = 0.0; local_50._colorize[2] = 0.0; local_50._colorize[3] = 0.0; local_50._offset[2] = 0.0; Color::operator_assign((Color *)&rainParams.Color,&local_50); rainParams.BulletFlags._0_4_ = 0; rainParams.BulletFlags._4_4_ = 0x80; projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&rainParams); MusicManager::RandomVector(&local_1c0); flagsHigh = Random(); local_1b0.y = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10; flagsHigh = Random(); dVar1 = __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]; (projectile->_velocity).y = local_1b0.y * 4.0 + 16.0; fVar13 = (float)((double)(int)flagsHigh + dVar1) * 2.3283064e-10 * local_1c0.x; (projectile->_velocity).x = fVar13 + fVar13; fVar13 = (npc->_pos).y; (projectile->_pos).x = local_1c0.x * 30.0 + (npc->_pos).x; (projectile->_pos).y = local_1c0.y * 10.0 + fVar13; flagsHigh = Random(); projectile->_fallingAccel = 2.0; projectile->_scale = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 + 1.0; flagsHigh = Random(); projectile->_fallingSpeed = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 53.0 - 48.0; npc->_projectileCooldown = npc->_projectileCooldown + -1; if (0 < npc->_projectileCooldown) break; ANM2::Play(&npc->_sprite,(byte *)"Attack2End",0); goto LAB_004b2651; case 7: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack4Loop",0); (**(code **)(*(int *)npc + 0x40))(0x3f800000); game = g_game; } local_1c0.y = 0.0; if ((room->_entityList)._updateEL._size != 0) { do { local_1a8 = *(Entity_NPC **) ((int)(room->_entityList)._updateEL._data + (int)local_1c0.y * 4); if (local_1a8 != npc) { if ((1 < *(int *)&game->_deathmatchManager) && (local_1a8->_type == 1)) { iVar11 = 1; goto LAB_004b2f17; } iVar11 = local_1a8->_type; if ((((iVar11 - 10U < 0x3de) && (iVar11 != 0x21)) && (iVar11 != 0x11)) && (iVar11 != 0x124)) { if (iVar11 != 0x375) { if (((iVar11 != 0x3c0) && (iVar11 != 0x3c5)) && (iVar11 != 0xf5)) goto LAB_004b2f17; goto LAB_004b2f20; } if (local_1a8->_variant == 10) goto LAB_004b2be9; LAB_004b2f17: if (local_1a8->_dead != 0) goto LAB_004b2f20; } else { LAB_004b2f20: if (((iVar11 != 1) && (iVar11 != 2)) && ((iVar11 != 4 && ((iVar11 != 9 && (iVar11 != 5)))))) { LAB_004b2be9: room = savedRoom; goto LAB_004b2bef; } } local_1d0.y = (npc->_pos).y - (local_1a8->_pos).y; local_1b8 = (npc->_pos).x - (local_1a8->_pos).x; fVar13 = local_1d0.y * local_1d0.y + local_1b8 * local_1b8; local_1b4 = 2.0 / (fVar13 * 0.0001 + 1.0); fVar14 = sqrtf(fVar13); fVar13 = local_1b8; fVar16 = local_1d0.y; if (0.0 < fVar14) { fVar16 = local_1d0.y * (1.0 / fVar14); fVar13 = local_1b8 * (1.0 / fVar14); } if (iVar11 == 1) { fVar14 = 0.8; if (local_1b4 * 1.4 <= 0.8) { fVar14 = local_1b4 * 1.4; } fVar15 = local_1a8->_mass; if (1.0 <= fVar15) { fVar15 = 1.0; } fVar14 = fVar14 / fVar15; } else if (iVar11 == 2) { fVar14 = local_1b4 * 0.7; } else if (((iVar11 == 9) && (local_1a8->_variant == 9)) && (local_1a8->_spawnerType == npc->_type)) { fVar14 = 0.6; if (0.6 <= local_1b4) { fVar14 = local_1b4; } if (0.4 <= fVar14) { fVar14 = 0.4; } } else { fVar14 = local_1b4; } fVar15 = local_1a8->_friction; room = savedRoom; if (fVar15 != 0.0) { speedMultiplier = local_1a8->_speedMultiplier; (local_1a8->_velocity).x = (fVar14 * fVar13 * speedMultiplier) / fVar15 + (local_1a8->_velocity).x; (local_1a8->_velocity).y = (fVar14 * fVar16 * speedMultiplier) / fVar15 + (local_1a8->_velocity).y; } } LAB_004b2bef: local_1c0.y = (float)((int)local_1c0.y + 1); game = g_game; } while ((uint)local_1c0.y < (uint)(room->_entityList)._updateEL._size); } local_1c0.y = 0.0; if (0 < (int)local_1b0.y) { attackTimer = npc->_projectileCooldown; local_1d0.y = 8.40779e-45; local_1b4 = 4.2039e-45; do { local_1a8 = (Entity_NPC *)attackTimer; if (((0x2d < attackTimer) && (attackTimer < 0x56)) && (local_1b8 = (float)(attackTimer / (int)local_1d0.y), attackTimer % (int)local_1d0.y == 0 )) { local_50._tint[2] = -48.0; local_50._tint[3] = -24.0; local_50._colorize[0] = 0.0; local_50._colorize[1] = 24.0; local_50._colorize[2] = 48.0; local_50._colorize[3] = 36.0; local_50._offset[0] = 12.0; local_50._offset[1] = -12.0; local_50._offset[2] = -36.0; local_1b8 = (local_50._tint[(uint)local_1b8 % 9 + 2] + 90.0) * 0.017453292; laserDir.x = cos(local_1b8); laserDir.y = sin(local_1b8); Entity_Laser::CalculateEndPoint (&local_1d8,&npc->_pos,&laserDir,&g_vectorZero,(Entity *)0x0,20.0); flagsHigh = Random(); local_1a8 = (Entity_NPC *) Game::Spawn(g_game,9,9,&local_1d8,&g_vectorZero,(Entity *)npc,0,flagsHigh); flagsHigh = Random(); dVar1 = __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]; (((Entity *)((int)local_1a8 + 0x40c))->_damageEvents)._begin = (void *)0x0; *(float *)&((Entity *)((int)local_1a8 + 0x40c))->field_0x4 = -22.0 - (float)((double)(int)flagsHigh + dVar1) * 2.3283064e-10 * 8.0; flagsHigh = Random(); (((Entity *)((int)local_1a8 + 0x40c))->_damageEvents)._end = (void *)(-0.06 - (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.030000005); flagsHigh = Random(); ((Entity *)((int)local_1a8 + 0x40c))->_variant = 0x2000; ((Entity *)((int)local_1a8 + 0x40c))->_pendingDamage = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 1.1999999 + 0.6; ((Entity *)((int)local_1a8 + 0x40c))->_subtype = 0; if ((npc->_flags & 0x80) != 0) { ((Entity *)((int)local_1a8 + 0x40c))->_variant = 0x1002000; ((Entity *)((int)local_1a8 + 0x40c))->_subtype = 0; } local_50._offset[0] = 0.0; local_50._colorize[0] = 0.0; local_50._colorize[1] = 0.0; local_50._colorize[2] = 0.0; local_50._colorize[3] = 0.0; local_50._offset[1] = 0.0; local_50._offset[2] = 0.0; local_50._tint[0] = 1.0; local_50._tint[1] = 1.0; local_50._tint[2] = 1.0; local_50._tint[3] = 0.0; (**(code **)(*(int *)local_1a8 + 0x3c))(&local_50,10,0xff,1,1); local_1a8 = (Entity_NPC *)npc->_projectileCooldown; } if ((int)local_1a8 % 6 == 0) { flagsHigh = Random(); pEVar7 = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,flagsHigh); iVar11 = *(int *)pEVar7; (pEVar7->_posOffset).x = 0.0; (pEVar7->_posOffset).y = -24.0; (**(code **)(iVar11 + 0xc))(); pEVar10 = (Entity_NPC *)npc->_projectileCooldown; } else { pEVar10 = local_1a8; } if ((int)pEVar10 % (int)local_1b4 == 0) { flagsHigh = Random(); pEVar7 = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)0x0,1,flagsHigh); iVar11 = *(int *)pEVar7; (pEVar7->_posOffset).x = 0.0; (pEVar7->_posOffset).y = -24.0; (**(code **)(iVar11 + 0xc))(); pEVar10 = (Entity_NPC *)npc->_projectileCooldown; } attackTimer = (int)&pEVar10[-1]._pickupGhostsEntity + 3; npc->_projectileCooldown = attackTimer; if (attackTimer < 1) { (**(code **)(*(int *)npc + 0x40))(0); ANM2::Play(&npc->_sprite,(byte *)"Attack4End",0); flagsHigh = 0; npc->_state = 3; npc->_aiCounter = 0; if ((room->_entityList)._updateEL._size != 0) { do { iVar11 = *(int *)((int)(room->_entityList)._updateEL._data + flagsHigh * 4); if (((*(int *)(iVar11 + 0x28) == 9) && (*(int *)(iVar11 + 0x2c) == 9)) && (*(int *)(iVar11 + 0x34) == npc->_type)) { *(undefined4 *)(iVar11 + 0x418) = 0x3e4ccccd; } flagsHigh = flagsHigh + 1; } while (flagsHigh < (uint)(room->_entityList)._updateEL._size); } break; } local_1c0.y = (float)((int)local_1c0.y + 1); } while ((int)local_1c0.y < (int)local_1b0.y); } break; case 8: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x6c,1.0,2,0,0.9); pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_1b0.x = (pEVar7->_pos).x - (npc->_pos).x; local_1b0.y = (pEVar7->_pos).y - (npc->_pos).y; pVVar8 = Vector::Normalized(&local_1b0,&local_1d8); local_1b8 = -NAN; local_1a8 = (Entity_NPC *)(pVVar8->x * 10.0); local_1b4 = pVVar8->y * 10.0; do { fVar13 = local_1b8; ProjectileParams::ProjectileParams((ProjectileParams *)shotParams); if (fVar13 == 0.0) { shotParams._44_4_ = 1.0; shotParams._48_4_ = 1.0; shotParams._52_4_ = 1.0; shotParams._56_4_ = 1.0; local_9c = 0x60; shotParams._36_4_ = 0.94; shotParams._60_4_ = 0.0; shotParams._64_4_ = 0.0; shotParams._68_4_ = 0.0; shotParams._72_4_ = 0.0; shotParams._76_4_ = 0.2; shotParams._80_4_ = 0.0; shotParams._84_4_ = fVar13; shotParams._88_4_ = fVar13; projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,shotParams); local_1b0.y = cos(0.0); fVar13 = sin(0.0); projectile->_height = -23.0; projectile->_fallingAccel = 0.0; projectile->_fallingSpeed = 0.0; projectile->_scale = 2.0; (projectile->_velocity).x = local_1b0.y * (float)local_1a8 - fVar13 * local_1b4; (projectile->_velocity).y = fVar13 * (float)local_1a8 + local_1b0.y * local_1b4; fVar13 = local_1b8; } else { local_1b0.y = (float)(int)fVar13 * 20.0 * 0.017453292; local_1c0.y = cos(local_1b0.y); fVar16 = sin(local_1b0.y); local_1d0.x = local_1c0.y * (float)local_1a8 - fVar16 * local_1b4; local_1d0.y = local_1c0.y * local_1b4 + fVar16 * (float)local_1a8; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_1d0,0,(ProjectileParams *)shotParams); } local_1b8 = (float)((int)fVar13 + 1); } while ((int)local_1b8 < 3); } goto LAB_004b2642; case 9: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { npc->_state = 6; Entity_NPC::PlaySound(npc,0x131,1.0,2,0,0.9); Entity_NPC::PlaySound(npc,0x1e3,1.5,2,0,1.0); npc->_projectileCooldown = 0x32; } break; case 10: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0xcd,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); local_1c0.y = (float)Game::Spawn(g_game,1000,0x96,&npc->_pos,&g_vectorZero,(Entity *)npc,0, npc->_initSeed); parentSlot = &((Entity *)local_1c0.y)->_parent; if (((Entity *)local_1c0.y)->_parent != (EntityPtr)0x0) { local_1b0.y = (float)parentSlot; std::multiset::erase(&local_1b0.y); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); game = g_game; pAVar3 = &((Entity *)((int)local_1c0.y + 0x40c))->_sprite; (pAVar3->_animDefaultName)._buf[8] = '\0'; (pAVar3->_animDefaultName)._buf[9] = '\0'; (pAVar3->_animDefaultName)._buf[10] = -0x4c; (pAVar3->_animDefaultName)._buf[0xb] = 'B'; Game::ShakeScreen(game,0xe); } LAB_004b2642: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_004b2651: npc->_state = 3; LAB_004b265b: npc->_aiCounter = 0; } break; case 0xb: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x130,1.0,2,0,1.0); npc->_state = 7; npc->_projectileCooldown = 0x73; } break; case 0xd: ANM2::Play(&npc->_sprite,(byte *)"Summon",0); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; npc->_stateFrame = npc->_stateFrame + 1; npc->_state = 3; NpcHelper::gideon_spawn_wave(npc); *(undefined1 *)&npc->_i1 = 0; goto LAB_004b265b; case 0x10: if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && ((ANM2::Play(&npc->_sprite,(byte *)"ClosedEyes",0), npc->_parent != (EntityPtr)0x0 || (*(int *)(npc + 1) != 0)))) { Entity_NPC::PlaySound(npc,0x89,1.0,2,0,1.0); Color::Color((Color *)&local_50); uVar5 = Random(); Game::SpawnParticles(g_game,&gideon->_pos,4,uVar5 % 3 + 0xc,9.0,color,100000.0,7); (**(code **)(*(int *)gideon + 0x28))(); ExceptionList = local_1c; return; } } room = savedRoom; if (npc->_parent == (EntityPtr)0x0) { if ((1.0 <= npc->_health) && ((char)npc->_i1 == '\0')) { iVar9 = savedRoom->_aliveEnemyCount + *(int *)&savedRoom->field_0x12c4; iVar11 = 0; if (0 < iVar9) { iVar11 = iVar9; } if (iVar11 + -1 < 1) { fVar13 = npc->_health - 1.0; *(undefined1 *)&npc->_i1 = 1; npc->_health = fVar13; if (fVar13 <= 0.0) { if ((npc->_state == 7) && (uVar5 = 0, (savedRoom->_entityList)._updateEL._size != 0)) { do { iVar11 = *(int *)((int)(savedRoom->_entityList)._updateEL._data + uVar5 * 4); if ((*(int *)(iVar11 + 0x28) == 9) && ((*(int *)(iVar11 + 0x2c) == 9 && (*(int *)(iVar11 + 0x34) == npc->_type)))) { *(undefined4 *)(iVar11 + 0x418) = 0x3e4ccccd; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)(savedRoom->_entityList)._updateEL._size); } (**(code **)(*(int *)npc + 0x40))(0); npc->_health = 0.5; Room::TriggerBossDeath(room,(Entity *)npc); npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"CloseEyes",0); npc->_canShutDoors = 0; npc->_subtype = 1; } } } } else if (*(int *)((int)npc->_parent + 0x30) == 1) { (**(code **)(*(int *)npc + 0x40))(0,uVar5); room = savedRoom; npc->_health = 0.5; Room::TriggerBossDeath(savedRoom,(Entity *)npc); npc->_state = 0x10; animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_004b3350: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"CloseEyes",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnim = "CloseEyes"; do { bVar4 = *animName; bVar12 = bVar4 < (byte)*expectedAnim; if (bVar4 != *expectedAnim) { LAB_004b3330: uVar5 = -(uint)bVar12 | 1; goto LAB_004b3335; } if (bVar4 == 0) break; bVar4 = animName[1]; bVar12 = bVar4 < (byte)expectedAnim[1]; if (bVar4 != expectedAnim[1]) goto LAB_004b3330; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004b3335: if ((uVar5 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004b3350; } npc->_canShutDoors = 0; npc->_subtype = 1; } bVar4 = Entity::IsFrame((Entity *)npc,2,npc->_index); if (bVar4 == 0) goto LAB_004b34bc; if (npc->_state != 7) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004b34bc; animName = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnim = "Attack4End"; do { bVar4 = *animName; bVar12 = bVar4 < (byte)*expectedAnim; if (bVar4 != *expectedAnim) { LAB_004b33f0: uVar5 = -(uint)bVar12 | 1; goto LAB_004b33f5; } if (bVar4 == 0) break; bVar4 = animName[1]; bVar12 = bVar4 < (byte)expectedAnim[1]; if (bVar4 != expectedAnim[1]) goto LAB_004b33f0; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar4 != 0); uVar5 = 0; LAB_004b33f5: if (uVar5 != 0) goto LAB_004b34bc; } local_1b0.y = 0.0; if ((room->_entityList)._updateEL._size != 0) { do { local_1c0.y = *(float *)((int)(room->_entityList)._updateEL._data + (int)local_1b0.y * 4); if (((Entity *)local_1c0.y)->_type == 9) { sizeMultiY = &(((Entity *)local_1c0.y)->_sizeMulti).y; pVVar8 = &((Entity *)local_1c0.y)->_sizeMulti; fVar13 = (gideon->_pos).y - (((Entity *)local_1c0.y)->_pos).y; fVar16 = (gideon->_pos).x - (((Entity *)local_1c0.y)->_pos).x; fVar16 = sqrtf(fVar13 * fVar13 + fVar16 * fVar16); npc = gideon; fVar13 = pVVar8->x; if (*sizeMultiY <= fVar13 && fVar13 != *sizeMultiY) { pVVar8 = (Vector *)sizeMultiY; } if (fVar16 < pVVar8->x * gideon->_size + *(float *)((int)local_1c0.y + 0x370)) { (**(code **)(*(int *)local_1c0.y + 0x28))(); } room = savedRoom; } local_1b0.y = (float)((int)local_1b0.y + 1); } while ((uint)local_1b0.y < (uint)(room->_entityList)._updateEL._size); } LAB_004b34bc: sVar2 = (short)npc->_i2; if (sVar2 != 0) { *(short *)&npc->_i2 = sVar2 + -1; } sVar2 = *(short *)((int)&npc->_i2 + 2); if (sVar2 != 0) { *(short *)((int)&npc->_i2 + 2) = sVar2 + -1; } bVar4 = npc->_dead; fVar13 = (npc->_targetPosition).y; fVar16 = (npc->_pos).y; fVar14 = npc->_friction; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) / fVar14; (npc->_velocity).y = (fVar13 - fVar16) / fVar14; manager = g_manager; if (bVar4 == 0) { ExceptionList = local_1c; return; } if (npc->_championColorIdx == 0x12) { deathSoundPitch = 1.5; } else if (npc->_championColorIdx == 0x13) { deathSoundPitch = 0.5; } local_1b0.y = 1.63952e-43; seed_fart_sound_override((int *)&local_1b0.y); SoundEffects::Play(&manager->_sfxManager,(int)local_1b0.y,1.0,2,0,deathSoundPitch,0.0); ExceptionList = local_1c; return; code_r0x004b21f5: fVar13 = (float)((int)fVar13 + 1); if ((uint)local_1d8.y <= (uint)fVar13) goto LAB_004b228c; goto LAB_004b21f0; } //@@ 004b3610 NpcHelper::gideon_update_death /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_NPC::Update calls it (via thunk 004b3940) for type 0x38b (907 ENTITY_GIDEON): "Death" anim, "Sound" event -> SoundEffects::Play, Game::ShakeScreen(0xe), boss jingle Music::PlayJingle(0x55), then FUN_004b0fe0 spawns the stairs */ void NpcHelper::gideon_update_death(void) { float fVar1; float fVar2; byte bVar3; ColorMod *color; Entity *explosion; ColorMod *color_00; int in_ECX; Color *pCVar4; int *gridSlot; uint uVar5; int gridSize; int unusedInt; undefined1 auStack_4c [7]; byte isDeathAnim; int soundId; float eventPitch; float pitch; Color local_38; uint local_c; Game *game; int gridEntity; Manager *manager; void *room; local_c = __security_cookie ^ (uint)auStack_4c; if (*(void **)(in_ECX + 0x7c) == (void *)0x0) { local_38._tint[0] = 0.0; local_38._colorize[1] = 2.10195e-44; local_38._colorize[0] = 0.0; } else { std::string::string((char *)&local_38,*(void **)(in_ECX + 0x7c)); } fVar2 = local_38._colorize[1]; fVar1 = local_38._tint[0]; pCVar4 = &local_38; if (0xf < (uint)local_38._colorize[1]) { pCVar4 = (Color *)local_38._tint[0]; } isDeathAnim = str_eq((byte *)pCVar4,(uint)local_38._colorize[0],(byte *)"Death",5); if (0xf < (uint)fVar2) { uVar5 = (int)fVar2 + 1; pCVar4 = (Color *)fVar1; if (0xfff < uVar5) { pCVar4 = (Color *)((Color *)((int)fVar1 + -0x2c))->_offset[2]; uVar5 = (int)fVar2 + 0x24; if ((byte *)0x1f < (byte *)((int)fVar1 + (-4 - (int)pCVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pCVar4,uVar5); } if (isDeathAnim == 0) { return; } pitch = 1.0; if (*(int *)(in_ECX + 0x7c) != 0) { bVar3 = AnimationState::IsEventTriggered((AnimationState *)(in_ECX + 0x78),(byte *)"Sound"); manager = g_manager; if (bVar3 != 0) { eventPitch = 1.0; if (*(int *)(in_ECX + 0xc64) == 0x12) { eventPitch = 1.5; } else if (*(int *)(in_ECX + 0xc64) == 0x13) { eventPitch = 0.5; } soundId = 0x89; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,eventPitch,0.0); Color::Color(&local_38); Random(); Game::SpawnParticles(g_game,(Vector *)(in_ECX + 0x33c),4,4,5.0,color,100000.0,7); } if ((*(int *)(in_ECX + 0x7c) != 0) && (*(char *)(in_ECX + 0x8c) != '\0')) { return; } } uVar5 = Random(); explosion = Game::SpawnEx(g_game,1000,1,(Vector *)(in_ECX + 0x33c),&g_vectorZero,(Entity *)0x0,0, uVar5,0); game = g_game; (explosion->_sprite)._scale.x = 2.0; (explosion->_sprite)._scale.y = 2.0; Game::ShakeScreen(game,0xe); manager = g_manager; if (*(int *)(in_ECX + 0xc64) == 0x12) { pitch = 1.5; } else if (*(int *)(in_ECX + 0xc64) == 0x13) { pitch = 0.5; } soundId = 0x89; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,pitch,0.0); Color::Color(&local_38); uVar5 = Random(); bVar3 = 7; unusedInt = 0x47c35000; Game::SpawnParticles(g_game,(Vector *)(in_ECX + 0x33c),4,uVar5 % 3 + 0xc,9.0,color_00,100000.0,7); if (*(int *)(in_ECX + 0xbc8) == 0) { uVar5 = 0; room = g_game->_room; gridSize = *(int *)((int)room + 0x10) * *(int *)((int)room + 0xc); if (0 < gridSize) { gridSlot = (int *)((int)room + 0x24); do { if ((((uVar5 < 0x1c0) && (gridEntity = *gridSlot, gridEntity != 0)) && (*(int *)(gridEntity + 4) == 0x12)) && (*(int *)(gridEntity + 8) == 1)) { return; } uVar5 = uVar5 + 1; gridSlot = gridSlot + 1; } while ((int)uVar5 < gridSize); } uVar5 = *(uint *)(in_ECX + 0xba4); if ((-1 < (int)uVar5) && (uVar5 < 0x1c0)) { *(undefined4 *)((int)room + uVar5 * 4 + 0x76c) = 900; } Music::PlayJingle((Music *)&g_manager->_musicManager,0x55,unusedInt,bVar3); gideon_spawn_stairs(); } return; } //@@ 004b3950 FUN_004b3950 void FUN_004b3950(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffff0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 004b39b0 std::vector::_Emplace_reallocate /* DB: 16-byte element realloc */ undefined4 * std::vector::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { uint uVar1; int iVar2; void *pvVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 *puVar8; int iVar9; undefined4 *puVar10; undefined4 *puVar11; void *ptr; int *in_ECX; uint uVar12; uint uVar13; undefined4 *puVar14; undefined4 *puVar15; undefined4 *puVar16; iVar2 = *in_ECX; iVar9 = in_ECX[1] - *in_ECX >> 4; if (iVar9 == 0xfffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar9 + 1; uVar12 = in_ECX[2] - *in_ECX >> 4; if (0xfffffff - (uVar12 >> 1) < uVar12) { uVar13 = 0xfffffff; } else { uVar12 = (uVar12 >> 1) + uVar12; uVar13 = uVar1; if (uVar1 <= uVar12) { uVar13 = uVar12; } if (0xfffffff < uVar13) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar10 = _Allocate(uVar13 * 0x10); puVar16 = (undefined4 *)(((int)param_1 - iVar2 & 0xfffffff0U) + (int)puVar10); uVar4 = param_2[1]; uVar5 = param_2[2]; uVar6 = param_2[3]; *puVar16 = *param_2; puVar16[1] = uVar4; puVar16[2] = uVar5; puVar16[3] = uVar6; puVar15 = (undefined4 *)in_ECX[1]; puVar14 = (undefined4 *)*in_ECX; puVar8 = puVar10; if (param_1 == puVar15) { for (; puVar14 != puVar15; puVar14 = puVar14 + 4) { uVar4 = puVar14[1]; uVar5 = puVar14[2]; uVar6 = puVar14[3]; *puVar8 = *puVar14; puVar8[1] = uVar4; puVar8[2] = uVar5; puVar8[3] = uVar6; puVar8 = puVar8 + 4; } } else { puVar11 = puVar10; puVar8 = puVar16; if (puVar14 != param_1) { do { uVar4 = *puVar14; uVar5 = puVar14[1]; uVar6 = puVar14[2]; uVar7 = puVar14[3]; puVar14 = puVar14 + 4; *puVar11 = uVar4; puVar11[1] = uVar5; puVar11[2] = uVar6; puVar11[3] = uVar7; puVar11 = puVar11 + 4; } while (puVar14 != param_1); puVar15 = (undefined4 *)in_ECX[1]; } for (; param_1 != puVar15; param_1 = param_1 + 4) { uVar4 = param_1[1]; uVar5 = param_1[2]; uVar6 = param_1[3]; puVar8[4] = *param_1; puVar8[5] = uVar4; puVar8[6] = uVar5; puVar8[7] = uVar6; puVar8 = puVar8 + 4; } } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar12 = in_ECX[2] - (int)pvVar3 & 0xfffffff0; ptr = pvVar3; if (0xfff < uVar12) { ptr = *(void **)((int)pvVar3 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar12); } *in_ECX = (int)puVar10; in_ECX[1] = (int)(puVar10 + uVar1 * 4); in_ECX[2] = (int)(puVar10 + uVar13 * 4); return puVar16; } //@@ 004b3af0 NpcHelper::heretic_spawn_afterimage /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: only caller NpcAI::ENTITY_HERETIC (2 sites in the dash states): Game::Spawn(905, variant 1/2, this pos/vel, spawner this), copies flags|0x11, color, current animation/frame and layer 0 state, state 0xd, no collision; notes/entities/pass6_h4.md lists the afterimages as unported */ Entity * NpcHelper::heretic_spawn_afterimage(void) { byte bVar1; Entity *afterimage; byte *afterimageAnimChar; uint uVar2; LayerState *afterimageLayer; LayerState *npcLayer; Entity *in_ECX; byte *****animNameData; byte *****animNameChar; bool isLess; undefined4 local_38; byte *****animName [4]; undefined4 animNameSize; uint animNameCapacity; uint securityCookie; void *local_10; undefined1 *puStack_c; byte ****local_8; undefined4 flagsHi; void *npcAnimData; local_8 = (byte ****)0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(animName + 10); ExceptionList = &local_10; afterimage = Game::Spawn(g_game,0x389,0,&in_ECX->_pos,&in_ECX->_velocity,in_ECX, (in_ECX[2]._posOffset.x == 1.54143e-44) + 1,in_ECX->_initSeed); flagsHi = *(undefined4 *)((int)&in_ECX->_flags + 4); *(int *)&afterimage->_flags = (int)in_ECX->_flags; *(undefined4 *)((int)&afterimage->_flags + 4) = flagsHi; FUN_004b6b20((afterimage->_colorParams)._begin,(in_ECX->_colorParams)._begin, (in_ECX->_colorParams)._end,local_38); flagsHi = *(undefined4 *)((int)&afterimage->_flags + 4); *(uint *)&afterimage->_flags = (uint)afterimage->_flags | 0x11; afterimage->_isInvicible = 1; *(undefined4 *)((int)&afterimage->_flags + 4) = flagsHi; npcAnimData = (in_ECX->_sprite)._animState._animData; if (npcAnimData == (void *)0x0) { animNameCapacity = 0xf; animNameSize = 0; animName[0] = (byte *****)0x0; } else { std::string::string((char *)animName,npcAnimData); } local_8 = (byte ****)0x0; animNameData = (byte *****)animName; if (0xf < animNameCapacity) { animNameData = animName[0]; } afterimageAnimChar = (afterimage->_sprite)._animState._animData; if (afterimageAnimChar != (byte *)0x0) { if (0xf < *(uint *)(afterimageAnimChar + 0x14)) { afterimageAnimChar = *(byte **)afterimageAnimChar; } animNameChar = animNameData; do { bVar1 = *afterimageAnimChar; isLess = bVar1 < *(byte *)animNameChar; if (bVar1 != *(byte *)animNameChar) { LAB_004b3c27: uVar2 = -(uint)isLess | 1; goto LAB_004b3c2c; } if (bVar1 == 0) break; bVar1 = afterimageAnimChar[1]; isLess = bVar1 < *(byte *)((int)animNameChar + 1); if (bVar1 != *(byte *)((int)animNameChar + 1)) goto LAB_004b3c27; afterimageAnimChar = afterimageAnimChar + 2; animNameChar = (byte *****)((int)animNameChar + 2); } while (bVar1 != 0); uVar2 = 0; LAB_004b3c2c: if ((uVar2 == 0) && ((*(char *)((int)(afterimage->_sprite)._animState._animData + 0x34) == '\0' || ((afterimage->_sprite)._animState._isPlaying != 0)))) goto LAB_004b3c68; } bVar1 = ANM2::SetAnimation(&afterimage->_sprite,(byte *)animNameData,1); if (bVar1 != 0) { AnimationState::Rewind(&(afterimage->_sprite)._animState); (afterimage->_sprite)._animState._isPlaying = 1; } LAB_004b3c68: local_8 = (byte ****)0xffffffff; if (0xf < animNameCapacity) { uVar2 = animNameCapacity + 1; animNameData = animName[0]; if (0xfff < uVar2) { animNameData = (byte *****)animName[0][-1]; uVar2 = animNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)animName[0] + (-4 - (int)animNameData))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(animNameData,uVar2); } animNameSize = 0; animNameCapacity = 0xf; animName[0] = (byte *****)((uint)animName[0] & 0xffffff00); if ((afterimage->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat (&(afterimage->_sprite)._animState,(in_ECX->_sprite)._animState._animFrame); } afterimageLayer = ANM2::GetLayer(&afterimage->_sprite,(byte *)0x0); npcLayer = ANM2::GetLayer(&in_ECX->_sprite,(byte *)0x0); (afterimageLayer->_color)._tint[3] = (npcLayer->_color)._tint[3]; afterimage->_entityGridCollisionClass = 0; afterimage->_entityCollisionClass = 0; afterimage[2]._posOffset.x = 1.82169e-44; *(undefined1 *)((int)&afterimage[2]._collisionDamage + 2) = *(undefined1 *)((int)&in_ECX[2]._collisionDamage + 2); *(undefined2 *)&afterimage[1].field_0x4 = 0; afterimage->_health = 0.0; afterimage->_maxHitPoints = 0.0; (**(code **)(*(int *)afterimage + 0xc))(); ExceptionList = local_10; return afterimage; } //@@ 004b3d50 FUN_004b3d50 void FUN_004b3d50(void) { char *pcVar1; char cVar2; void *pvVar3; Entity *pEVar4; uint uVar5; Entity_NPC *in_ECX; void **ppvVar6; float fVar7; float fVar8; float fVar9; pEVar4 = Entity_NPC::GetPlayerTarget(in_ECX); pcVar1 = (char *)((int)&in_ECX->_projectileCooldown + 1); *pcVar1 = *pcVar1 + '\x01'; cVar2 = *(char *)((int)&in_ECX->_projectileCooldown + 2); ppvVar6 = &g_game->_room; in_ECX->_state = 10; pvVar3 = *ppvVar6; if (cVar2 == '\0') { fVar8 = *(float *)((int)pvVar3 + 0x1c) + 80.0; } else { fVar8 = *(float *)((int)pvVar3 + 0x14) - 80.0; } (in_ECX->_pos).x = fVar8; fVar7 = (pEVar4->_pos).y; (in_ECX->_pos).y = fVar7; fVar7 = fVar7 - (pEVar4->_pos).y; fVar8 = fVar8 - (pEVar4->_pos).x; pvVar3 = *ppvVar6; fVar8 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); fVar9 = 10.0; fVar7 = *(float *)((int)pvVar3 + 0x18) + 10.0; fVar8 = fVar8 * 0.08 * (pEVar4->_velocity).y + (pEVar4->_pos).y; if (fVar8 <= fVar7) { fVar8 = fVar7; } fVar7 = *(float *)((int)pvVar3 + 0x20) - 10.0; if (fVar7 <= fVar8) { fVar8 = fVar7; } (in_ECX->_pos).y = fVar8; if (cVar2 == '\0') { fVar9 = -10.0; } cVar2 = *(char *)((int)&in_ECX->_projectileCooldown + 1); (in_ECX->_velocity).x = fVar9; (in_ECX->_velocity).y = 0.0; in_ECX->_entityCollisionClass = 4; if ((cVar2 != '\x04') || (fVar8 = in_ECX->_maxHitPoints * 0.5, fVar8 < in_ECX->_health || fVar8 == in_ECX->_health)) { *(undefined2 *)&in_ECX->_stateFrame = 0; } else { uVar5 = Random(); *(undefined2 *)&in_ECX->_stateFrame = 0; if (uVar5 % 3 == 0) { in_ECX->_state = 0xb; in_ECX->_entityCollisionClass = 0; return; } } return; } //@@ 004b3ec0 NpcHelper::heretic_count_out_fires /* DB: counts room entities 33.3 (purple fireplace) with health (+0x380) < 1.5, i.e. put out; used by NpcAI::ENTITY_HERETIC */ int NpcHelper::heretic_count_out_fires(void) { int iVar1; int *piVar2; int iVar3; int iVar4; iVar3 = 0; iVar4 = *(int *)((int)g_game->_room + 0x1264); if (iVar4 != 0) { piVar2 = *(int **)((int)g_game->_room + 0x125c); do { iVar1 = *piVar2; if (((*(int *)(iVar1 + 0x28) == 0x21) && (*(int *)(iVar1 + 0x2c) == 3)) && (*(float *)(iVar1 + 0x380) <= 1.5 && *(float *)(iVar1 + 0x380) != 1.5)) { iVar3 = iVar3 + 1; } piVar2 = piVar2 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); } return iVar3; } //@@ 004b3f10 FUN_004b3f10 void FUN_004b3f10(void) { uint *puVar1; undefined4 *puVar2; undefined4 uVar3; int iVar4; uint uVar5; uint uVar6; Entity *pEVar7; void *pvVar8; Entity_NPC *in_ECX; uint uVar9; undefined4 *puStack_20; int iStack_1c; uint local_14; Vector local_10; Entity_NPC::ClearDequeRefs(in_ECX); uVar9 = 0; do { local_10.x = (float)(&DAT_00c33c88)[uVar9 * 2] + (in_ECX->_pos).x; local_10.y = (float)(&DAT_00c33c8c)[uVar9 * 2] + (in_ECX->_pos).y; uVar6 = Random(); local_14 = uVar9 + 1; pEVar7 = Game::SpawnEx(g_game,0x340,1,&local_10,&g_vectorZero,(Entity *)in_ECX,local_14,uVar6,0) ; uVar3 = *(undefined4 *)((int)&pEVar7->_flags + 4); iVar4 = *(int *)pEVar7; *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar7->_flags + 4) = uVar3; (**(code **)(iVar4 + 0xc))(); pEVar7[2]._posOffset.x = 2.24208e-44; puStack_20 = (undefined4 *)local_10.x; (pEVar7->_targetPosition).x = local_10.x; (pEVar7->_targetPosition).y = local_10.y; AnimationState::SetAnimationData(&(pEVar7->_sprite)._overlayAnimState,(void *)0x0); (**(code **)(*(int *)pEVar7 + 0xc))(); uVar9 = (in_ECX->_entityDeque)._size; uVar6 = (in_ECX->_entityDeque)._offset; if (((uVar6 + uVar9 & 3) == 0) && ((in_ECX->_entityDeque)._mapSize <= uVar9 + 4 >> 2)) { std::deque<4byte>::_Growmap(uVar9); uVar6 = (in_ECX->_entityDeque)._offset; uVar9 = (in_ECX->_entityDeque)._size; } uVar5 = (in_ECX->_entityDeque)._mapSize; uVar6 = uVar5 * 4 - 1 & uVar6; (in_ECX->_entityDeque)._offset = uVar6; puStack_20 = (undefined4 *)(uVar6 + uVar9); uVar9 = uVar5 - 1 & (uint)puStack_20 >> 2; pvVar8 = (in_ECX->_entityDeque)._map; if (*(int *)((int)pvVar8 + uVar9 * 4) == 0) { pvVar8 = operator_new(0x10); *(void **)((int)(in_ECX->_entityDeque)._map + uVar9 * 4) = pvVar8; pvVar8 = (in_ECX->_entityDeque)._map; } *(undefined4 *)(*(int *)((int)pvVar8 + uVar9 * 4) + ((uint)puStack_20 & 3) * 4) = 0; puVar1 = &(in_ECX->_entityDeque)._size; *puVar1 = *puVar1 + 1; iStack_1c = (in_ECX->_entityDeque)._offset + (in_ECX->_entityDeque)._size; uVar9 = iStack_1c - 1U & 3; iVar4 = *(int *)((int)(in_ECX->_entityDeque)._map + (iStack_1c - 1U >> 2 & (in_ECX->_entityDeque)._mapSize - 1) * 4); puVar2 = (undefined4 *)(iVar4 + uVar9 * 4); if (*(int *)(iVar4 + uVar9 * 4) != 0) { puStack_20 = puVar2; std::multiset::erase(&puStack_20); } *puVar2 = pEVar7; std::multiset::insert(puVar2); uVar9 = local_14; } while (local_14 < 5); return; } //@@ 004b40d0 NpcHelper::heretic_choose_attack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from NpcAI::ENTITY_HERETIC state 3 once the idle wait (60, 30 below half) passes; WeightedOutcomePicker over Attack2/exit/point/idle */ void NpcHelper::heretic_choose_attack(void) { RNG rng; uint uVar1; uint outcomeCount; WeightedOutcomePicker WVar2; undefined4 *outcomesCursor; float halfHealth; undefined8 uStack_44; undefined4 uStack_3c; EntityPtr *local_38; Entity_NPC *npc; WeightedOutcomePicker outcomes; undefined4 *outcomesEnd; undefined4 *outcomesCapacityEnd; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int *weight; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af332d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; outcomes = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacityEnd = (undefined4 *)0x0; local_14 = 0; local_38 = (EntityPtr *)heretic_count_out_fires(local_24); WVar2 = (WeightedOutcomePicker)0x0; outcomesCursor = (undefined4 *)0x0; if (*(char *)((int)&npc->_projectileDelay + 1) < '\x01') { uStack_44 = CONCAT44(0xe,(undefined4)uStack_44); uStack_3c = 10; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_44 + 4); WVar2 = outcomes; outcomesCursor = outcomesEnd; } if (*(char *)((int)&npc->_projectileDelay + 2) < '\x01') { uVar1 = 0; outcomeCount = (int)outcomesCursor - (int)WVar2 >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)WVar2 + uVar1 * 8) == 9) { weight = (int *)((int)WVar2 + 4 + uVar1 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)WVar2 + 4 + uVar1 * 8) = 0; } goto LAB_004b41d2; } uVar1 = uVar1 + 1; } while (uVar1 < outcomeCount); } uStack_44 = CONCAT44(9,(undefined4)uStack_44); uStack_3c = 10; if (outcomesCursor == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesCursor,(int)&uStack_44 + 4); WVar2 = outcomes; outcomesCursor = outcomesEnd; } else { *outcomesCursor = 9; outcomesCursor[1] = 10; outcomesCursor = outcomesCursor + 2; outcomesEnd = outcomesCursor; } } LAB_004b41d2: if (*(char *)((int)&npc->_projectileDelay + 3) < '\x01') { if ((EntityPtr *)0x2 < local_38) { uVar1 = 0; outcomeCount = (int)outcomesCursor - (int)WVar2 >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)WVar2 + uVar1 * 8) == 7) { weight = (int *)((int)WVar2 + 4 + uVar1 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)WVar2 + 4 + uVar1 * 8) = 0; } goto LAB_004b4249; } uVar1 = uVar1 + 1; } while (uVar1 < outcomeCount); } uStack_44 = CONCAT44(7,(undefined4)uStack_44); uStack_3c = 10; if (outcomesCursor == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesCursor,(int)&uStack_44 + 4); WVar2 = outcomes; outcomesCursor = outcomesEnd; } else { *outcomesCursor = 7; outcomesCursor[1] = 10; outcomesEnd = outcomesCursor + 2; outcomesCursor = outcomesEnd; } } } LAB_004b4249: uVar1 = 0; outcomeCount = (int)outcomesCursor - (int)WVar2 >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)WVar2 + uVar1 * 8) == 3) { weight = (int *)((int)WVar2 + 4 + uVar1 * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)WVar2 + 4 + uVar1 * 8) = 0; } goto LAB_004b42a6; } uVar1 = uVar1 + 1; } while (uVar1 < outcomeCount); } uStack_44 = CONCAT44(3,(undefined4)uStack_44); uStack_3c = 1; if (outcomesCursor == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesCursor,(int)&uStack_44 + 4); } else { *outcomesCursor = 3; outcomesCursor[1] = 1; outcomesEnd = outcomesCursor + 2; } LAB_004b42a6: uVar1 = Random(); uStack_44 = 0x900000005; uStack_3c = 7; rng._shift1 = 5; rng._seed = uVar1 | 1; rng._shift2 = 9; rng._shift3 = 7; uVar1 = WeightedOutcomePicker::PickOutcome(&outcomes,rng); if (uVar1 == 3) { *(undefined2 *)((int)&npc->_stateFrame + 2) = 0; } else { *(undefined2 *)&npc->_stateFrame = 0xffff; npc->_state = uVar1; if (uVar1 == 7) { Entity_NPC::ClearDequeRefs(npc); if (npc->_child != (EntityPtr)0x0) { local_38 = &npc->_child; std::multiset::erase(&local_38); } halfHealth = npc->_maxHitPoints * 0.5; npc->_child = (EntityPtr)0x0; *(char *)&npc->_projectileCooldown = (npc->_health <= halfHealth && halfHealth != npc->_health) + '\x05'; } *(undefined1 *)((int)&npc->_projectileCooldown + 1) = 0; } if (outcomes != (WeightedOutcomePicker)0x0) { uVar1 = (int)outcomesCapacityEnd - (int)outcomes & 0xfffffff8; WVar2 = outcomes; if (0xfff < uVar1) { WVar2 = *(WeightedOutcomePicker *)((int)outcomes + -4); uVar1 = uVar1 + 0x23; if (0x1f < ((int)outcomes - (int)WVar2) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)WVar2,uVar1); } ExceptionList = local_1c; return; } //@@ 004b43c0 NpcAI::ENTITY_HERETIC /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 905 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HERETIC(Entity_NPC *npc) { float *pfVar1; uint *puVar2; short *psVar3; float fVar4; void *pvVar5; undefined4 uVar6; int *piVar7; EntityPtr EVar8; Game *this; byte bVar9; char cVar10; char cVar11; char cVar12; float *damageEvent; float fVar13; LayerState *layer; Entity_Player *nearestPlayer; Entity_Laser *laser; char *animName; Entity *extraout_EAX; ColorMod *color; ColorMod *pCVar14; Vector *pVVar15; Entity *pEVar16; int iVar17; short sVar18; ColorMod *pCVar19; uint uVar20; EntityPtr *pEVar21; float *extraout_ECX; float *extraout_ECX_00; uint uVar22; int iVar23; ANM2 *sprite; EntityPtr targetFire; float fVar24; undefined1 auVar25 [12]; undefined1 auVar26 [12]; undefined1 auVar27 [12]; float fVar28; undefined1 auVar29 [12]; float fVar30; undefined1 *puVar31; float dirSign; Entity_NPC *source; EntityPtr local_148; float local_144; Vector scratchVec; float alpha; Entity_NPC *local_134; Vector VStack_130; float local_128; char isDeathDone; Vector local_120; Entity *pEStack_118; Vector VStack_114; float fireScore; Entity *pEStack_108; Vector VStack_104; float chainEndX; float chainEndY; float chainDirX; EntityPtr EStack_f0; float fStack_ec; float fStack_e8; ColorMod local_e4; ProjectileParams projParams; uint local_c; Entity *linkedEntity; Manager *manager; byte *shadowLayerIndex; local_c = __security_cookie ^ (uint)&local_148; local_144 = 0.0; local_134 = npc; if (npc->_aiCallPhase == 1) { if ((0.0 < npc->_pendingDamage) && ((npc->_pendingDamageFlags & 2) != 0)) { npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { if ((((uint)damageEvent[2] & 6) != 0) && (damageEvent[6] != 1.4013e-45)) { *damageEvent = 0.0; damageEvent[2] = 0.0; damageEvent[3] = 0.0; } npc->_pendingDamage = *damageEvent + npc->_pendingDamage; *(uint *)&npc->_pendingDamageFlags = (uint)npc->_pendingDamageFlags | (uint)damageEvent[2] ; pfVar1 = damageEvent + 3; damageEvent = damageEvent + 0xe; puVar2 = (uint *)((int)&npc->_pendingDamageFlags + 4); *puVar2 = *puVar2 | (uint)*pfVar1; } while (damageEvent != (npc->_damageEvents)._end); } } if (npc->_state == 0x12) { pvVar5 = (npc->_sprite)._animState._animData; if (pvVar5 == (void *)0x0) { local_e4._tint[0] = 0.0; local_e4._colorize[1] = 2.10195e-44; local_e4._colorize[0] = 0.0; } else { std::string::string((char *)&local_e4,pvVar5); } pCVar14 = (ColorMod *)local_e4._tint[0]; local_144 = 4.2039e-45; pCVar19 = &local_e4; if (0xf < (uint)local_e4._colorize[1]) { pCVar19 = (ColorMod *)local_e4._tint[0]; } bVar9 = str_eq((byte *)pCVar19,(uint)local_e4._colorize[0],(byte *)"Death",5); if ((bVar9 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { isDeathDone = '\x01'; goto LAB_004b44fe; } } else { pCVar14 = (ColorMod *)local_e4._tint[0]; } isDeathDone = '\0'; LAB_004b44fe: if ((((uint)local_144 & 1) != 0) && (0xf < (uint)local_e4._colorize[1])) { uVar20 = (int)local_e4._colorize[1] + 1; pCVar19 = pCVar14; if (0xfff < uVar20) { pCVar19 = (ColorMod *)pCVar14[-1]._offset[2]; uVar20 = (int)local_e4._colorize[1] + 0x24; if ((byte *)0x1f < (byte *)((int)pCVar14 + (-4 - (int)pCVar19))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pCVar19,uVar20); } manager = g_manager; if (isDeathDone == '\0') { return; } local_128 = 1.0; if (npc->_championColorIdx == 0x12) { local_128 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_128 = 0.5; } local_144 = 6.76827e-43; seed_fart_sound_override((int *)&local_144); SoundEffects::Play(&manager->_sfxManager,(int)local_144,1.0,0x2d,0,local_128,0.0); local_144 = 0.0; do { uVar20 = Random(); scratchVec.x = (npc->_pos).x + 27.692308; scratchVec.y = (npc->_pos).y + 0.0; local_120.x = (float)Game::SpawnEx(g_game,1000,0x94,&scratchVec,&g_vectorZero,(Entity *)npc,1, uVar20,0); pEVar21 = &((Entity *)local_120.x)->_parent; if (((Entity *)local_120.x)->_parent != (EntityPtr)0x0) { local_134 = (Entity_NPC *)pEVar21; std::multiset::erase(&local_134); } *pEVar21 = (EntityPtr)npc; std::multiset::insert(pEVar21); fVar13 = (float)((int)local_144 + 1); *(float *)((((Entity *)((int)local_120.x + 0x40c))->_sprite)._animDefaultName._buf + 8) = (float)(int)local_144 * 90.0; local_144 = fVar13; } while ((int)fVar13 < 4); return; } sprite = &npc->_sprite; layer = ANM2::GetLayer(sprite,(byte *)0x0); fVar13 = 0.0; alpha = (layer->_color)._tint[3]; fVar30 = npc->_friction * 0.8; local_148 = (EntityPtr)((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_friction = fVar30; switch(npc->_state) { case 0: if (((*(int *)((int)g_game->_room + 8) == 5) && (*(int *)((int)g_game->_room + 0x1bb0) == 0x51)) && (-1 < npc->_spawnGridIndex)) { uVar6 = *(undefined4 *)((int)&npc->_flags + 4); npc->_visible = 0; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb | 0x11; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = uVar6; npc->_entityCollisionClass = 0; FUN_004b3f10(); uVar20 = Random(); Game::SpawnEx(g_game,1000,0xa2,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar20,0); npc->_shadowSize = 0.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; iVar17 = 6; } else { iVar17 = 3; } npc->_state = iVar17; npc->_projectileDelay = 0; npc->_aiCallFlags = npc->_aiCallFlags | 1; break; case 3: PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(sprite,s_Idle,0); } sVar18 = 0x3c; psVar3 = (short *)((int)&npc->_stateFrame + 2); *psVar3 = *psVar3 + local_148._0_2_; fVar13 = npc->_maxHitPoints * 0.5; if (npc->_health <= fVar13 && fVar13 != npc->_health) { sVar18 = 0x1e; } if (sVar18 < *(short *)((int)&npc->_stateFrame + 2)) { NpcHelper::heretic_choose_attack(); } break; case 4: PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); fVar13 = alpha - npc->_speedMultiplier * 0.04; auVar25 = ZEXT812(0x3ecccccd); if (auVar25._0_4_ <= fVar13) { auVar25._4_8_ = auVar25._4_8_; auVar25._0_4_ = fVar13; } alpha = auVar25._0_4_; ANM2::Play(sprite,(byte *)"IdleInvis",0); uVar20 = 0; local_128 = 0.0; if ((npc->_entityDeque)._size != 0) { uVar22 = (npc->_entityDeque)._offset; do { fVar13 = (float)((int)local_128 + 1); if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar22 + uVar20 >> 2) * 4) + (uVar22 + uVar20 & 3) * 4) == 0) { fVar13 = local_128; } uVar20 = uVar20 + 1; uVar22 = (npc->_entityDeque)._offset; local_128 = fVar13; } while (uVar20 < (npc->_entityDeque)._size); if (fVar13 != 0.0) break; } Entity_NPC::ClearDequeRefs(npc); npc->_state = 5; break; case 5: auVar29 = ZEXT812(0x3f800000); fVar13 = npc->_speedMultiplier * 0.04 + alpha; if (fVar13 <= auVar29._0_4_) { auVar29._4_8_ = auVar29._4_8_; auVar29._0_4_ = fVar13; } alpha = auVar29._0_4_; ANM2::Play(sprite,(byte *)"InvisEnd",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { alpha = 1.0; uVar6 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; npc->_isInvicible = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar6; npc->_state = 3; ANM2::Play(sprite,s_Idle,0); } break; case 6: npc->_visible = 1; ANM2::Play(sprite,(byte *)0xb5fbdc,0); bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Sound"); if (bVar9 != 0) { npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); } bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar9 != 0) { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); local_144 = 0.0; if ((npc->_entityDeque)._size != 0) { do { uVar20 = (npc->_entityDeque)._offset + (int)local_144; iVar17 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar20 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar20 & 3) * 4); if ((iVar17 != 0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)(iVar17 + 0x28) == 1)) || (*(int *)(iVar17 + 0x28) - 10U < 0x3de)))) { uVar20 = Random(); *(uint *)(iVar17 + 0x410) = uVar20 % 0xf + 1; } local_144 = (float)((int)local_144 + 1); } while ((uint)local_144 < (npc->_entityDeque)._size); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } break; case 7: if (npc->_child == (EntityPtr)0x0) { LAB_004b4b09: bVar9 = ANM2::WasEventTriggered(sprite,(byte *)"Shoot"); if (bVar9 != 0) goto LAB_004b5198; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7f738) && (_Init_thread_header(&DAT_00c7f738), DAT_00c7f738 == -1)) { _atexit(FUN_00b15450); _Init_thread_footer(&DAT_00c7f738); } uVar20 = 0; DAT_00c7f740 = DAT_00c7f73c; pvVar5 = g_game->_room; pEVar21 = DAT_00c7f73c; if (*(int *)((int)pvVar5 + 0x1264) != 0) { do { local_120.x = *(float *)(*(int *)((int)pvVar5 + 0x125c) + uVar20 * 4); if (((*(int *)((int)local_120.x + 0x28) == 0x21) && (*(int *)((int)local_120.x + 0x2c) == 3)) && (*(float *)((int)local_120.x + 0x380) <= 1.5 && *(float *)((int)local_120.x + 0x380) != 1.5)) { if (pEVar21 == DAT_00c7f744) { std::vector::_Emplace_reallocate(pEVar21,&local_120); pEVar21 = DAT_00c7f740; } else { *pEVar21 = (EntityPtr)local_120.x; DAT_00c7f740 = DAT_00c7f740 + 1; pEVar21 = DAT_00c7f740; } } uVar20 = uVar20 + 1; } while (uVar20 < *(uint *)((int)pvVar5 + 0x1264)); npc = local_134; } uVar20 = (npc->_entityDeque)._size; local_120.x = -1e+10; if (uVar20 == 0) { chainEndX = (npc->_pos).x; local_148 = (EntityPtr)0x0; chainEndY = (npc->_pos).y; chainDirX = 0.0; } else { uVar22 = (uVar20 + (npc->_entityDeque)._offset) - 1; iVar17 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar22 >> 2) * 4) + (uVar22 & 3) * 4); scratchVec.x = *(float *)(iVar17 + 0x33c); chainEndY = *(float *)(iVar17 + 0x340); uVar22 = (npc->_entityDeque)._mapSize - 1; chainEndX = scratchVec.x; if (uVar20 == 1) { uVar20 = (npc->_entityDeque)._offset; iVar17 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar22 & uVar20 >> 2) * 4) + (uVar20 & 3) * 4); local_148 = (EntityPtr)(*(float *)(iVar17 + 0x340) - (npc->_pos).y); chainDirX = *(float *)(iVar17 + 0x33c) - (npc->_pos).x; scratchVec.y = chainEndY; } else { scratchVec.y = (float)(npc->_entityDeque)._offset; uVar20 = ((npc->_entityDeque)._size - 1) + (int)scratchVec.y; iVar17 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar22 & uVar20 >> 2) * 4) + (uVar20 & 3) * 4); uVar20 = ((npc->_entityDeque)._size - 2) + (int)scratchVec.y; iVar23 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar20 >> 2) * 4) + (uVar20 & 3) * 4); local_148 = (EntityPtr)(*(float *)(iVar17 + 0x340) - *(float *)(iVar23 + 0x340)); chainDirX = *(float *)(iVar17 + 0x33c) - *(float *)(iVar23 + 0x33c); } } pEVar16 = Entity_NPC::GetPlayerTarget(npc); pEVar21 = DAT_00c7f73c; local_144 = (pEVar16->_pos).x; pEStack_118 = (Entity *)(pEVar16->_pos).y; if (DAT_00c7f73c == DAT_00c7f740) { LAB_004b52e5: if ((npc->_entityDeque)._size == 0) { *(undefined2 *)((int)&npc->_stateFrame + 2) = 0; npc->_state = 3; } else { npc->_state = 8; } break; } pEStack_108 = (Entity *)cos(1.5707964); fStack_e8 = sin(1.5707964); targetFire = (EntityPtr)0x0; local_144 = local_144 - chainEndX; pEStack_118 = (Entity *)((float)pEStack_118 - chainEndY); do { local_128 = 0.0; scratchVec.x = *(float *)((int)*pEVar21 + 0x33c); scratchVec.y = *(float *)((int)*pEVar21 + 0x340); nearestPlayer = Game::GetNearestPlayer(g_game,&scratchVec); fVar30 = scratchVec.x - (nearestPlayer->_pos).x; fVar13 = scratchVec.y - (nearestPlayer->_pos).y; if (fVar13 * fVar13 + fVar30 * fVar30 <= 30.0) { local_128 = -1000.0; } fVar13 = chainEndY - *(float *)((int)*pEVar21 + 0x340); fVar30 = chainEndX - *(float *)((int)*pEVar21 + 0x33c); fireScore = sqrtf(fVar13 * fVar13 + fVar30 * fVar30); uVar20 = Random(); fStack_ec = *(float *)((int)*pEVar21 + 0x340) - chainEndY; fireScore = fireScore + ((float)((double)(int)uVar20 + __uint_to_double_fixup[-((int)uVar20 >> 0x1f)]) * 2.3283064e-10 * 500.0 - 250.0) + local_128; VStack_114.x = *(float *)((int)*pEVar21 + 0x33c) - chainEndX; VStack_104.x = VStack_114.x * VStack_114.x + fStack_ec * fStack_ec; local_128 = fStack_ec; EStack_f0 = (EntityPtr)VStack_114.x; fVar13 = sqrtf(VStack_104.x); if (fVar13 <= 0.0) { fVar30 = fStack_ec; EVar8 = (EntityPtr)VStack_114.x; } else { fVar30 = local_128 * (1.0 / fVar13); EVar8 = (EntityPtr)((float)EStack_f0 * (1.0 / fVar13)); } pEVar16 = (Entity *) (fireScore - ABS(((float)EVar8 * fStack_e8 + fVar30 * (float)pEStack_108) * (float)pEStack_118 + ((float)EVar8 * (float)pEStack_108 - fVar30 * fStack_e8) * local_144)); fireScore = (float)pEVar16; if ((chainDirX != g_vectorZero.x) || ((float)local_148 != g_vectorZero.y)) { VStack_114.x = (float)local_148; fStack_ec = chainDirX; fVar13 = sqrtf((float)local_148 * (float)local_148 + chainDirX * chainDirX); if (0.0 < fVar13) { fStack_ec = chainDirX * (1.0 / fVar13); VStack_114.x = (float)local_148 * (1.0 / fVar13); } fVar13 = sqrtf(VStack_104.x); if (0.0 < fVar13) { EStack_f0 = (EntityPtr)((float)EStack_f0 * (1.0 / fVar13)); local_128 = local_128 * (1.0 / fVar13); } pEVar16 = (Entity *) (fireScore - ABS(fStack_ec * (float)EStack_f0 + VStack_114.x * local_128) * 400.0); } npc = local_134; if (local_120.x < (float)pEVar16) { targetFire = *pEVar21; local_120.x = (float)pEVar16; } pEVar21 = pEVar21 + 1; } while (pEVar21 != DAT_00c7f740); VStack_114.x = (float)targetFire; if (targetFire == (EntityPtr)0x0) goto LAB_004b52e5; pEVar21 = &local_134->_child; if (local_134->_child != (EntityPtr)0x0) { VStack_130.x = (float)pEVar21; std::multiset::erase(&VStack_130); } *pEVar21 = (EntityPtr)VStack_114.x; std::multiset::insert(pEVar21); fVar13 = *(float *)((int)npc->_child + 0x33c) - (npc->_pos).x; if (ABS(fVar13) <= ABS(*(float *)((int)npc->_child + 0x340) - (npc->_pos).y)) { animName = "PointDown"; } else { animName = "PointLeft"; if (0.0 <= fVar13) { animName = "PointRight"; } } bVar9 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar9 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } fVar13 = npc->_maxHitPoints * 0.5; uVar20 = (npc->_entityDeque)._size; if (fVar13 < npc->_health || fVar13 == npc->_health) { if (uVar20 < 3) goto LAB_004b5198; LAB_004b52cf: if ((npc->_sprite)._animState._animData != (void *)0x0) { fVar13 = 5.0; LAB_004b5193: AnimationState::SetFrameFloat(&(npc->_sprite)._animState,fVar13); goto LAB_004b5198; } } else { if ((2 < uVar20) || ('\0' < *(char *)((int)&npc->_projectileCooldown + 1))) goto LAB_004b52cf; if ((npc->_sprite)._animState._animData != (void *)0x0) { fVar13 = 3.0; goto LAB_004b5193; } } } else { if (*(int *)((int)npc->_child + 0x28) != 0x21) { local_120.x = (float)&npc->_child; std::multiset::erase(&local_120); npc->_child = (EntityPtr)0x0; goto LAB_004b4b09; } LAB_004b5198: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar9 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar9 != 0) { targetFire = npc->_child; if ((targetFire != (EntityPtr)0x0) && (*(int *)((int)targetFire + 0x28) == 0x21)) { *(int *)((int)targetFire + 0xb64) = 9; (**(code **)(*(int *)targetFire + 0xc))(); VStack_130.x = 0.0; std::deque::push_front(&VStack_130); VStack_104.x = *(float *)&npc->_child; uVar20 = ((npc->_entityDeque)._size + (npc->_entityDeque)._offset) - 1; uVar22 = uVar20 & 3; iVar17 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar20 >> 2) * 4); pEVar21 = (EntityPtr *)(iVar17 + uVar22 * 4); if (*(int *)(iVar17 + uVar22 * 4) != 0) { VStack_130.x = (float)pEVar21; std::multiset::erase(&VStack_130); } *pEVar21 = (EntityPtr)VStack_104.x; if ((EntityPtr)VStack_104.x != (EntityPtr)0x0) { std::multiset::insert(pEVar21); } } pEVar21 = &npc->_child; if (*pEVar21 != (EntityPtr)0x0) { VStack_130.x = (float)pEVar21; std::multiset::erase(&VStack_130); } *pEVar21 = (EntityPtr)0x0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } } if (((npc->_entityDeque)._size < (uint)(byte)npc->_projectileCooldown) && (iVar17 = NpcHelper::heretic_count_out_fires(), iVar17 != 0)) { sprite = &npc->_sprite; ANM2::Play(sprite,s_Idle,0); goto LAB_004b67fd; } npc->_state = 8; break; case 8: ANM2::Play(sprite,s_Attack1,0); bVar9 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero); if (bVar9 != 0) { *extraout_ECX = (npc->_pos).x; extraout_ECX[1] = (npc->_pos).y; } bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar9 != 0) { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); fVar13 = (npc->_pos).x; fVar30 = (npc->_pos).y; local_148 = (EntityPtr)0x0; VStack_114.x = 0.0; scratchVec.x = fVar13; scratchVec.y = fVar30; if ((npc->_entityDeque)._size != 0) { do { uVar20 = (npc->_entityDeque)._offset + (int)VStack_114.x; piVar7 = *(int **)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar20 >> 2) * 4) + (uVar20 & 3) * 4); if ((piVar7 != (int *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (piVar7[10] == 1)) || (piVar7[10] - 10U < 0x3de)) && (1.5 <= (float)piVar7[0xe0])))) { local_134 = (Entity_NPC *)((float)piVar7[0xcf] - fVar13); local_120.x = (float)piVar7[0xd0] - fVar30; *(undefined1 *)((int)piVar7 + 0x173) = 1; (**(code **)(*piVar7 + 0xc))(); pVVar15 = &VStack_130; bVar9 = 0; iVar17 = 0x28; VStack_130.x = 0.0; VStack_130.y = -35.0; source = npc; fVar13 = atan2f(local_120.x,(float)local_134); local_148 = (EntityPtr) Entity_Laser::ShootAngle (1,&scratchVec,fVar13 * 57.295776,iVar17,pVVar15,(Entity *)source, bVar9); fVar13 = sqrtf(local_120.x * local_120.x + (float)local_134 * (float)local_134); *(float *)((int)local_148 + 0x4d0) = fVar13; (**(code **)(*(int *)local_148 + 0x3c))(&DAT_00c34dd0,0xffffffff,0xff,0,1); *(int *)((int)local_148 + 0x358) = 0x447a0000; fVar13 = (float)piVar7[0xcf]; fVar30 = (float)piVar7[0xd0]; scratchVec.x = fVar13; scratchVec.y = fVar30; } VStack_114.x = (float)((int)VStack_114.x + 1); } while ((uint)VStack_114.x < (npc->_entityDeque)._size); if (local_148 != (EntityPtr)0x0) { *(int *)((int)local_148 + 0x4d0) = 0; goto LAB_004b5593; } } VStack_130.x = 0.0; VStack_130.y = -20.0; laser = Entity_Laser::ShootAngle(1,&npc->_pos,90.0,0x28,&VStack_130,(Entity *)npc,0); (**(code **)(*(int *)laser + 0x3c))(&DAT_00c34dd0,0xffffffff,0xff,0,1); } LAB_004b5593: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { fVar13 = npc->_maxHitPoints * 0.5; cVar10 = *(char *)((int)&npc->_projectileCooldown + 1) + '\x01'; *(char *)((int)&npc->_projectileCooldown + 1) = cVar10; if ((fVar13 < npc->_health || fVar13 == npc->_health) || (cVar10 != '\x01')) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; Entity_NPC::ClearDequeRefs(npc); *(undefined1 *)((int)&npc->_projectileDelay + 3) = 0xc; *(undefined2 *)((int)&npc->_stateFrame + 2) = 0; npc->_state = 3; } else { Entity_NPC::ClearDequeRefs(npc); npc->_state = 7; } } break; case 9: if ((short)npc->_stateFrame == -1) { fVar13 = (*(float *)((int)g_game->_room + 0x1c) + *(float *)((int)g_game->_room + 0x14)) * 0.5 ; cVar10 = fVar13 < (npc->_pos).x || fVar13 == (npc->_pos).x; *(char *)((int)&npc->_projectileCooldown + 2) = cVar10; } else { cVar10 = *(char *)((int)&npc->_projectileCooldown + 2); } npc->_entityGridCollisionClass = 0; animName = "ExitRight"; if (cVar10 == '\0') { animName = "ExitLeft"; } ANM2::Play(sprite,(byte *)animName,0); fVar13 = npc->_speedMultiplier; fVar30 = alpha - fVar13 * 0.04; alpha = 0.0; if (0.0 <= fVar30) { alpha = fVar30; } if (alpha < 0.5) { npc->_entityCollisionClass = 0; } puVar31 = (undefined1 *)0x3f800000; fVar30 = (float)(int)(short)npc->_stateFrame / 15.0; if (fVar30 <= 0.0) { fVar30 = 0.0; } if (1.0 <= fVar30) { fVar30 = 1.0; } if (*(char *)((int)&npc->_projectileCooldown + 2) == '\0') { puVar31 = &DAT_bf800000; } fVar30 = fVar30 * fVar30 * 2.4 + 0.1; (npc->_velocity).x = (float)puVar31 * fVar30 * fVar13 + (npc->_velocity).x; (npc->_velocity).y = fVar30 * 0.0 * fVar13 + (npc->_velocity).y; if ((alpha <= 0.0) && (bVar9 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-80.0), bVar9 == 0)) { (**(code **)(*(int *)npc + 0x40))(0x40000000); *(undefined1 *)((int)&npc->_projectileCooldown + 1) = 0; FUN_004b3d50(); } *(short *)&npc->_stateFrame = (short)npc->_stateFrame + local_148._0_2_; break; case 10: pEVar16 = Entity_NPC::GetPlayerTarget(npc); local_134 = (Entity_NPC *)(pEVar16->_pos).x; VStack_130.x = (pEVar16->_pos).y; animName = "ChargeRight"; if (*(char *)((int)&npc->_projectileCooldown + 2) == '\0') { animName = "ChargeLeft"; } ANM2::Play(sprite,(byte *)animName,0); if (*(char *)((int)&npc->_projectileCooldown + 2) == '\0') { puVar31 = &DAT_bf800000; } else { puVar31 = (undefined1 *)0x3f800000; } fVar13 = npc->_speedMultiplier; fVar30 = (float)puVar31 * 6.0 * fVar13 + (npc->_velocity).x; (npc->_velocity).x = fVar30; (npc->_velocity).y = fVar13 * 0.0 + (npc->_velocity).y; fVar13 = (npc->_pos).y; if (15.0 < ABS(VStack_130.x - fVar13)) { if (VStack_130.x <= fVar13) { fVar13 = -0.3; } else { fVar13 = 0.3; } fVar24 = npc->_speedMultiplier; (npc->_velocity).y = fVar13 * fVar24 + (npc->_velocity).y; (npc->_velocity).x = fVar24 * 0.0 + fVar30; } if (*(char *)((int)&npc->_projectileCooldown + 1) == '\x05') { fVar13 = 0.16; } else { fVar13 = 0.08; } auVar26 = ZEXT812(0x3f800000); cVar10 = *(char *)((int)&npc->_projectileCooldown + 2); fVar30 = (npc->_pos).x; fVar13 = fVar13 * npc->_speedMultiplier + alpha; if (fVar13 <= auVar26._0_4_) { auVar26._4_8_ = auVar26._4_8_; auVar26._0_4_ = fVar13; } alpha = auVar26._0_4_; if (cVar10 == '\0') { if (fVar30 < (float)local_134 + 120.0) goto LAB_004b5919; } else if ((float)local_134 - 120.0 < fVar30) { LAB_004b5919: animName = "ChargeEndRight"; if (cVar10 == '\0') { animName = "ChargeEndLeft"; } ANM2::Play(sprite,(byte *)animName,0); npc->_state = 0xc; *(undefined2 *)&npc->_stateFrame = 0; } break; case 0xb: Entity_NPC::GetPlayerTarget(npc); animName = "ChargeRight"; if (*(char *)((int)&npc->_projectileCooldown + 2) == '\0') { animName = "ChargeLeft"; } ANM2::Play(sprite,(byte *)animName,0); if (*(char *)((int)&npc->_projectileCooldown + 2) == '\0') { puVar31 = &DAT_bf800000; } else { puVar31 = (undefined1 *)0x3f800000; } fVar13 = npc->_speedMultiplier; (npc->_velocity).x = (float)puVar31 * 6.0 * fVar13 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 0.0 + (npc->_velocity).y; sVar18 = (short)npc->_stateFrame; if (sVar18 < 0xb) { auVar27 = ZEXT812(0x3f000000); *(short *)&npc->_stateFrame = local_148._0_2_ + sVar18; fVar13 = npc->_speedMultiplier * 0.12 + alpha; if (fVar13 <= auVar27._0_4_) { auVar27._4_8_ = auVar27._4_8_; auVar27._0_4_ = fVar13; } alpha = auVar27._0_4_; } else { fVar13 = alpha - npc->_speedMultiplier * 0.06; alpha = 0.0; if (0.0 <= fVar13) { alpha = fVar13; } if (0x1e < sVar18) { NpcHelper::heretic_spawn_afterimage(); *(char *)((int)&npc->_projectileCooldown + 2) = '\x01' - *(char *)((int)&npc->_projectileCooldown + 2); FUN_004b3d50(); sVar18 = (short)npc->_stateFrame; } *(short *)&npc->_stateFrame = local_148._0_2_ + sVar18; } break; case 0xc: bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar9 != 0) { Entity_NPC::PlaySound(npc,0x132,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); } bVar9 = ANM2::WasEventTriggered(sprite,(byte *)"Shoot"); cVar10 = *(char *)((int)&npc->_projectileCooldown + 2); if (bVar9 == 0) { if (cVar10 == '\0') { puVar31 = &DAT_bf800000; } else { puVar31 = (undefined1 *)0x3f800000; } fVar13 = npc->_speedMultiplier; (npc->_velocity).x = (float)puVar31 * 6.5 * fVar13 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 0.0 + (npc->_velocity).y; } else { alpha = 1.0; puVar31 = (undefined1 *)alpha; if (cVar10 == '\0') { puVar31 = &DAT_bf800000; } fVar13 = npc->_speedMultiplier; *(short *)&npc->_stateFrame = (short)npc->_stateFrame + local_148._0_2_; iVar17 = npc->_stateFrame; (npc->_velocity).x = (float)puVar31 * 0.3 * fVar13 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 0.0 + (npc->_velocity).y; if (10 < (short)iVar17) { if (*(char *)((int)&npc->_projectileCooldown + 1) < '\x04') { NpcHelper::heretic_spawn_afterimage(); *(char *)((int)&npc->_projectileCooldown + 2) = '\x01' - *(char *)((int)&npc->_projectileCooldown + 2); FUN_004b3d50(); } else { animName = "ChargeFinishRight"; if (*(char *)((int)&npc->_projectileCooldown + 2) == '\0') { animName = "ChargeFinishLeft"; } ANM2::Play(sprite,(byte *)animName,0); *(undefined1 *)((int)&npc->_projectileCooldown + 1) = 0; *(undefined2 *)((int)&npc->_stateFrame + 2) = 0; npc->_state = 3; *(undefined1 *)((int)&npc->_projectileDelay + 2) = 9; npc->_entityGridCollisionClass = 3; (**(code **)(*(int *)npc + 0x40))(0x3f800000); } } } break; case 0xd: cVar10 = *(char *)((int)&npc->_projectileCooldown + 2); if (npc->_subtype == 2) { if (cVar10 == '\0') { puVar31 = &DAT_bf800000; } else { puVar31 = (undefined1 *)0x3f800000; } fVar13 = npc->_speedMultiplier; (npc->_velocity).x = (float)puVar31 * 6.0 * fVar13 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 0.0 + (npc->_velocity).y; } else { fVar13 = npc->_speedMultiplier; dirSign = 1.0; fVar30 = alpha - fVar13 * 0.04; alpha = 0.0; if (0.0 <= fVar30) { alpha = fVar30; } fVar30 = (float)(int)(short)npc->_stateFrame / 15.0; if (fVar30 <= 0.0) { fVar30 = 0.0; } if (1.0 <= fVar30) { fVar30 = 1.0; } if (cVar10 == '\0') { dirSign = (float)&DAT_bf800000; } fVar30 = fVar30 * fVar30 + fVar30 * fVar30 + 0.5; (npc->_velocity).y = fVar30 * 0.0 * fVar13 + (npc->_velocity).y; (npc->_velocity).x = fVar30 * dirSign * fVar13 + (npc->_velocity).x; } if ((alpha <= 0.0) && (bVar9 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-80.0), bVar9 == 0)) { (**(code **)(*(int *)npc + 0x28))(); } *(short *)&npc->_stateFrame = (short)npc->_stateFrame + local_148._0_2_; layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_color)._tint[3] = alpha; shadowLayerIndex = (byte *)(npc->_sprite)._shadowLayerIndex; if ((int)shadowLayerIndex < 0) { return; } layer = ANM2::GetLayer(sprite,shadowLayerIndex); (layer->_color)._tint[3] = alpha; return; case 0xe: ANM2::Play(sprite,s_Attack2,0); bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar9 != 0) { Entity_NPC::PlaySound (npc,((byte)~*(byte *)((int)&npc->_projectileCooldown + 1) & 1) * 2 + 0x6a,1.0,2,0, 1.0); pEVar16 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar16->_pos).x; scratchVec.y = (pEVar16->_pos).y; ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = projParams.HeightModifier + 25.0; projParams.Scale = 2.0; projParams.FallingAccelModifier = 1.5; projParams.FallingSpeedModifier = -60.0; local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; local_e4._offset[0] = 0.2; local_e4._offset[1] = 0.3; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; local_e4._offset[2] = 1.0; Color::operator_assign((Color *)&projParams.Color,&local_e4); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 2; local_120.x = 0.0; local_120.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_120,0,&projParams); local_134 = (Entity_NPC *)0x40800000; pEStack_118 = extraout_EAX; if (extraout_EAX != (Entity *)0x0) { VStack_114.x = scratchVec.x - (npc->_pos).x; VStack_114.y = scratchVec.y - (npc->_pos).y; fStack_e8 = sqrtf(VStack_114.y * VStack_114.y + VStack_114.x * VStack_114.x); iVar17 = 0; pEStack_108 = (Entity *)(-5.0 - *(float *)&pEStack_118[1].field_0x4); local_144 = 3.0; VStack_104.x = (float)pEStack_118[1]._damageEvents._end * 10.0 + 1.0; do { VStack_130.x = fStack_e8 / local_144; fVar13 = pow(0.9,VStack_130.x); fVar13 = (fVar13 - 1.0) * -9.491221; if (fVar13 <= 0.01) { fVar13 = 0.01; } VStack_130.x = ((float)pEStack_108 - (VStack_130.x - fVar13) * VStack_104.x) / fVar13; if ((((0.0 < (float)local_134) && (-60.0 < VStack_130.x)) || (((float)local_134 < 0.0 && (VStack_130.x < -60.0)))) && (local_134 = (Entity_NPC *)((float)local_134 * -0.5), ABS((float)local_134) < 0.06125)) break; iVar17 = iVar17 + 1; local_144 = local_144 + (float)local_134; } while (iVar17 < 0x14); pVVar15 = Vector::Resized(&VStack_114,&VStack_104,local_144); (pEStack_118->_velocity).x = pVVar15->x; (pEStack_118->_velocity).y = pVVar15->y; pEStack_118[1]._damageEvents._begin = (void *)VStack_130.x; uVar20 = Random(); pEVar16 = Game::SpawnEx(g_game,1000,0x99,&scratchVec,&g_vectorZero,(Entity *)0x0,10,uVar20,0 ); Entity::SetParent(pEVar16,pEStack_118); Color::Color((Color *)&local_e4); Sprite::SetColor((Sprite *)&pEVar16->_sprite,color); (**(code **)(*(int *)pEVar16 + 0xc))(); } uVar20 = Random(); pEVar16 = Game::SpawnEx(g_game,1000,0xb,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar20,0); iVar17 = *(int *)pEVar16; (pEVar16->_sprite)._offset.x = 0.0; (pEVar16->_sprite)._offset.y = (float)&DAT_c1c80000; pEVar16->_renderDepthOffset = 4.0; (**(code **)(iVar17 + 0x3c))(&DAT_00c34dfc,0xffffffff,0xff,0,1); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { cVar10 = *(char *)((int)&npc->_projectileCooldown + 1); if (cVar10 == '\x06') { pEVar16 = Entity_NPC::GetPlayerTarget(npc); VStack_130.x = (pEVar16->_pos).x; VStack_130.y = (pEVar16->_pos).y; scratchVec.y = VStack_130.y - (npc->_pos).y; scratchVec.x = VStack_130.x - (npc->_pos).x; fVar13 = sqrtf(scratchVec.y * scratchVec.y + scratchVec.x * scratchVec.x); if (300.0 < fVar13) { Vector::Normalize(&scratchVec); VStack_130.x = scratchVec.x * 300.0 + (npc->_pos).x; VStack_130.y = scratchVec.y * 300.0 + (npc->_pos).y; } pVVar15 = Room::GetClampedPositionImpl (g_game->_room,&scratchVec,&VStack_130,10.0,10.0,10.0,10.0); (npc->_v2).x = pVVar15->x; (npc->_v2).y = pVVar15->y; (npc->_v1).x = 0.0; ANM2::Play(&npc->_sprite,(byte *)"Divebomb",0); npc->_state = 0xf; *(undefined2 *)&npc->_stateFrame = 0; } else { *(char *)((int)&npc->_projectileCooldown + 1) = cVar10 + '\x01'; ANM2::Play(&npc->_sprite,s_Attack2,1); } } break; case 0xf: bVar9 = Vector::operator_ne(&npc->_v2,&g_vectorZero); if ((bVar9 != 0) && (0x12 < (short)npc->_stateFrame)) { fVar24 = npc->_speedMultiplier * 0.011 + (npc->_v1).x; npc->_friction = fVar30 * 0.5; if (fVar24 <= fVar13) { fVar24 = fVar13; } if (1.0 <= fVar24) { fVar24 = 1.0; } (npc->_v1).x = fVar24; fVar13 = *extraout_ECX_00; fVar30 = (npc->_pos).x; fVar28 = (extraout_ECX_00[1] - (npc->_pos).y) * fVar24; (npc->_velocity).y = fVar28; fVar4 = npc->_friction; (npc->_velocity).x = ((fVar13 - fVar30) * fVar24) / fVar4; (npc->_velocity).y = fVar28 / fVar4; } if ((0x20 < (short)npc->_stateFrame) && (bVar9 = ANM2::WasEventTriggered(sprite,(byte *)"Shoot"), bVar9 == 0)) { npc->_entityCollisionClass = 0; } bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); this = g_game; if (bVar9 != 0) { npc->_entityCollisionClass = 4; Game::ShakeScreen(this,0xc); Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0); pCVar14 = (ColorMod *)Color::Color(0x3f4ccccd); Entity::MakeGroundPoofAtSelf((Entity *)npc,pCVar14,1.0); Entity_NPC::PlaySound(npc,0x1e3,1.0,0x2d,0,1.0); iVar17 = 0; do { uVar20 = Random(); pEStack_108 = Game::SpawnEx(g_game,1000,0x94,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar20 ,0); VStack_104.x = (float)&pEStack_108->_parent; if (pEStack_108->_parent != (EntityPtr)0x0) { VStack_130.x = VStack_104.x; std::multiset::erase(&VStack_130); } *(Entity_NPC **)VStack_104.x = npc; std::multiset::insert(VStack_104.x); iVar23 = iVar17 + 1; *(float *)(pEStack_108[1]._sprite._animDefaultName._buf + 8) = (float)iVar17 * 45.0; iVar17 = iVar23; } while (iVar23 < 8); (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; } bVar9 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar9 != 0) { npc->_friction = npc->_friction * 0.4; } bVar9 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar9 != 0) { Game::ShakeScreen(g_game,4); Entity_NPC::PlaySound(npc,0x1eb,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined1 *)((int)&npc->_projectileCooldown + 1) = 0; *(undefined2 *)((int)&npc->_stateFrame + 2) = 0; npc->_state = 3; *(undefined1 *)((int)&npc->_projectileDelay + 1) = 0x1e; } *(short *)&npc->_stateFrame = (short)npc->_stateFrame + local_148._0_2_; break; case 100: bVar9 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar9 != 0) { pVVar15 = MusicManager::RandomVector(&VStack_130); uVar20 = Random(); fVar13 = (float)((double)(int)uVar20 + __uint_to_double_fixup[-((int)uVar20 >> 0x1f)]) * 2.3283064e-10; scratchVec.y = fVar13 * pVVar15->y * 80.0 + (npc->_pos).y; scratchVec.x = fVar13 * pVVar15->x * 80.0 + (npc->_pos).x; uVar20 = Random(); pEVar16 = Game::SpawnEx(g_game,1000,1,&scratchVec,&g_vectorZero,(Entity *)0x0,0,uVar20,0); local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; local_e4._colorize[0] = 0.8; local_e4._colorize[1] = 0.2; local_e4._colorize[2] = 1.0; local_e4._colorize[3] = 1.0; local_e4._offset[2] = 0.0; Sprite::SetColor((Sprite *)&pEVar16->_sprite,&local_e4); (**(code **)(*(int *)pEVar16 + 0xc))(); Game::BombDamage(g_game,&scratchVec,40.0,60.0,0,(Entity *)npc,(BitSet128)ZEXT816(0),4,0); Game::ShakeScreen(g_game,8); } bVar9 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar9 != 0) { Room::TriggerBossDeath(g_game->_room,(Entity *)npc); Game::ShakeScreen(g_game,0x28); } bVar9 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Sound"); if ((bVar9 != 0) && (iVar17 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar17 != 0)) { Entity_NPC::PlaySound(npc,0x1e3,1.0,0x2d,0,1.0); local_134 = (Entity_NPC *)0x2; do { uVar20 = Random(); VStack_104.x = (float)Game::SpawnEx(g_game,1000,0x94,&npc->_pos,&g_vectorZero,(Entity *)npc, 1,uVar20,0); pEVar21 = (EntityPtr *)((int)VStack_104.x + 0x3bc); if (*(int *)((int)VStack_104.x + 0x3bc) != 0) { VStack_130.x = (float)pEVar21; std::multiset::erase(&VStack_130); } *pEVar21 = (EntityPtr)npc; std::multiset::insert(pEVar21); uVar20 = Random(); local_134 = (Entity_NPC *)((int)&local_134[-1]._pickupGhostsEntity + 3); *(float *)((int)VStack_104.x + 0x474) = (float)((double)(int)uVar20 + __uint_to_double_fixup[-((int)uVar20 >> 0x1f)]) * 2.3283064e-10 * 360.0; } while (local_134 != (Entity_NPC *)0x0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); } } sprite = &npc->_sprite; LAB_004b67fd: iVar17 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (0 < iVar17) { cVar10 = (char)npc->_projectileDelay; cVar12 = (char)iVar17; if ('\0' < cVar10) { cVar11 = cVar10 - cVar12; if (cVar10 <= iVar17) { cVar11 = '\0'; } *(char *)&npc->_projectileDelay = cVar11; } cVar10 = *(char *)((int)&npc->_projectileDelay + 1); if ('\0' < cVar10) { cVar11 = cVar10 - cVar12; if (cVar10 <= iVar17) { cVar11 = '\0'; } *(char *)((int)&npc->_projectileDelay + 1) = cVar11; } cVar10 = *(char *)((int)&npc->_projectileDelay + 2); if ('\0' < cVar10) { cVar11 = cVar10 - cVar12; if (cVar10 <= iVar17) { cVar11 = '\0'; } *(char *)((int)&npc->_projectileDelay + 2) = cVar11; } cVar10 = *(char *)((int)&npc->_projectileDelay + 3); if ('\0' < cVar10) { cVar12 = cVar10 - cVar12; if (cVar10 <= iVar17) { cVar12 = '\0'; } *(char *)((int)&npc->_projectileDelay + 3) = cVar12; } } layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_color)._tint[3] = alpha; shadowLayerIndex = (byte *)(npc->_sprite)._shadowLayerIndex; if (-1 < (int)shadowLayerIndex) { layer = ANM2::GetLayer(sprite,shadowLayerIndex); (layer->_color)._tint[3] = alpha; } fVar13 = (npc->_targetPosition).x; if ((fVar13 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { fVar30 = (npc->_targetPosition).y; fVar24 = (npc->_pos).y; fVar4 = npc->_friction; (npc->_velocity).x = (fVar13 - (npc->_pos).x) / fVar4; (npc->_velocity).y = (fVar30 - fVar24) / fVar4; } if ((npc->_dead != 0) && (uVar20 = 0, (npc->_entityDeque)._size != 0)) { do { uVar22 = uVar20 + (npc->_entityDeque)._offset; linkedEntity = *(Entity **) (*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar22 >> 2) * 4) + (uVar22 & 3) * 4); if ((linkedEntity != (Entity *)0x0) && ((linkedEntity->_type == 0x21 && (1.5 <= linkedEntity->_health)))) { linkedEntity->_dead = 1; (**(code **)(*(int *)linkedEntity + 0xc))(); } uVar20 = uVar20 + 1; } while (uVar20 < (npc->_entityDeque)._size); } return; } //@@ 004b6a90 std::deque::push_front /* DB: 4-per-block deque front insertion */ void std::deque::push_front(undefined4 *param_1) { uint uVar1; void *pvVar2; int in_ECX; int iVar3; int iVar4; iVar4 = *(int *)(in_ECX + 0x10); uVar1 = *(uint *)(in_ECX + 0xc); if (((uVar1 + iVar4 & 3) == 0) && (*(uint *)(in_ECX + 8) <= iVar4 + 4U >> 2)) { deque<4byte>::_Growmap(iVar4); uVar1 = *(uint *)(in_ECX + 0xc); iVar4 = *(int *)(in_ECX + 0x10); } uVar1 = *(int *)(in_ECX + 8) * 4 - 1U & uVar1; *(uint *)(in_ECX + 0xc) = uVar1; uVar1 = iVar4 + uVar1; iVar4 = (*(int *)(in_ECX + 8) - 1U & uVar1 >> 2) * 4; iVar3 = *(int *)(in_ECX + 4); if (*(int *)(iVar3 + iVar4) == 0) { pvVar2 = operator_new(0x10); *(void **)(iVar4 + *(int *)(in_ECX + 4)) = pvVar2; iVar3 = *(int *)(in_ECX + 4); } *(undefined4 *)(*(int *)(iVar4 + iVar3) + (uVar1 & 3) * 4) = *param_1; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; return; } //@@ 004b6b20 FUN_004b6b20 void FUN_004b6b20(int *param_1,int param_2,int param_3) { int iVar1; uint uVar2; int iVar3; uint uVar4; void *pvVar5; int iVar6; int *in_ECX; undefined4 extraout_ECX; int *piVar7; iVar6 = *in_ECX; uVar2 = (param_3 - param_2) / 0x3c; piVar7 = (int *)in_ECX[1]; if (uVar2 != 0) { if ((uint)((in_ECX[2] - (int)piVar7) / 0x3c) < uVar2) { iVar1 = ((int)piVar7 - iVar6) / 0x3c; if (0x4444444U - iVar1 < uVar2) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar1 = iVar1 + uVar2; uVar4 = FUN_004b6d70(iVar1); if (0x4444444 < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar5 = std::_Allocate(uVar4 * 0x3c); iVar3 = ((int)param_1 - iVar6) / 0x3c; FUN_004b6f40((void *)((int)pvVar5 + iVar3 * 0x3c),iVar3); if ((uVar2 == 1) && (param_1 == piVar7)) { FUN_004b6f40(pvVar5,extraout_ECX); } else { FUN_004b6dc0(iVar6,param_1,pvVar5); FUN_004b6dc0(param_1,piVar7,(void *)((int)pvVar5 + (iVar3 + uVar2) * 0x3c)); } FUN_004b6ce0(pvVar5,iVar1,uVar4); return; } if (uVar2 < (uint)(((int)piVar7 - (int)param_1) / 0x3c)) { iVar6 = FUN_004b6dc0(piVar7 + uVar2 * -0xf,piVar7,piVar7); in_ECX[1] = iVar6; FUN_004b6e40(piVar7); in_ECX = piVar7; } else { iVar6 = FUN_004b6dc0(param_1,piVar7,param_1 + uVar2 * 0xf); in_ECX[1] = iVar6; } FUN_004b6f40(param_1,in_ECX); } return; } //@@ 004b6ce0 FUN_004b6ce0 void FUN_004b6ce0(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x3c) * 0x3c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x3c; in_ECX[2] = param_1 + param_3 * 0x3c; return; } //@@ 004b6d70 FUN_004b6d70 uint FUN_004b6d70(uint param_1) { uint uVar1; int *in_ECX; uVar1 = (in_ECX[2] - *in_ECX) / 0x3c; if (0x4444444 - (uVar1 >> 1) < uVar1) { return 0x4444444; } uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } return uVar1; } //@@ 004b6dc0 FUN_004b6dc0 undefined4 * FUN_004b6dc0(undefined8 *param_1,undefined8 *param_2,undefined4 *param_3) { undefined8 *puVar1; undefined8 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined8 *puVar6; undefined4 *puVar7; undefined4 *puVar8; puVar7 = param_3; if (param_1 != param_2) { puVar6 = (undefined8 *)((int)param_1 + 0x24); puVar8 = param_3 + 1; do { puVar1 = (undefined8 *)((int)puVar6 + 0x3c); *puVar7 = *(undefined4 *)((int)puVar6 + -0x24); uVar3 = *(undefined4 *)((int)puVar6 + -0x1c); uVar4 = *(undefined4 *)(puVar6 + -3); uVar5 = *(undefined4 *)((int)puVar6 + -0x14); puVar7 = puVar7 + 0xf; *puVar8 = *(undefined4 *)(puVar6 + -4); puVar8[1] = uVar3; puVar8[2] = uVar4; puVar8[3] = uVar5; uVar3 = *(undefined4 *)((int)puVar6 + -0xc); uVar4 = *(undefined4 *)(puVar6 + -1); uVar5 = *(undefined4 *)((int)puVar6 + -4); puVar8[4] = *(undefined4 *)(puVar6 + -2); puVar8[5] = uVar3; puVar8[6] = uVar4; puVar8[7] = uVar5; *(undefined8 *)((int)param_3 + (-0x3c - (int)param_1) + (int)puVar1) = *puVar6; *(undefined4 *)((int)param_3 + (-0x34 - (int)param_1) + (int)puVar1) = *(undefined4 *)(puVar6 + 1); puVar8[0xb] = *(undefined4 *)((int)puVar6 + 0xc); puVar8[0xc] = *(undefined4 *)(puVar6 + 2); *(undefined1 *)(puVar8 + 0xd) = *(undefined1 *)((int)puVar6 + 0x14); *(undefined1 *)((int)puVar8 + 0x35) = *(undefined1 *)((int)puVar6 + 0x15); puVar2 = puVar6 + 3; puVar6 = puVar1; puVar8 = puVar8 + 0xf; } while (puVar2 != param_2); } return puVar7; } //@@ 004b6e40 FUN_004b6e40 undefined4 * FUN_004b6e40(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; if (in_EDX == in_ECX) { return param_1; } puVar5 = in_EDX + 1; puVar7 = param_1 + 1; do { puVar6 = puVar5 + -0xf; param_1 = param_1 + -0xf; puVar8 = puVar7 + -0xf; *param_1 = puVar5[-0x10]; if (puVar8 != puVar6) { uVar2 = puVar5[-0xe]; uVar3 = puVar5[-0xd]; uVar4 = puVar5[-0xc]; *puVar8 = *puVar6; puVar7[-0xe] = uVar2; puVar7[-0xd] = uVar3; puVar7[-0xc] = uVar4; uVar2 = puVar5[-10]; uVar3 = puVar5[-9]; uVar4 = puVar5[-8]; puVar7[-0xb] = puVar5[-0xb]; puVar7[-10] = uVar2; puVar7[-9] = uVar3; puVar7[-8] = uVar4; uVar2 = puVar5[-6]; puVar7[-7] = puVar5[-7]; puVar7[-6] = uVar2; puVar7[-5] = puVar5[-5]; } puVar7[-4] = puVar5[-4]; puVar7[-3] = puVar5[-3]; *(undefined1 *)(puVar7 + -2) = *(undefined1 *)(puVar5 + -2); *(undefined1 *)((int)puVar7 + -7) = *(undefined1 *)((int)puVar5 + -7); puVar1 = puVar5 + -0x10; puVar5 = puVar6; puVar7 = puVar8; } while (puVar1 != in_ECX); return param_1; } //@@ 004b6ec0 FUN_004b6ec0 undefined4 * FUN_004b6ec0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *puVar5; undefined4 *in_EDX; undefined4 *puVar6; if (in_ECX == in_EDX) { return param_1; } puVar6 = param_1 + 1; puVar5 = in_ECX + 1; do { *param_1 = puVar5[-1]; if (puVar6 != puVar5) { uVar2 = puVar5[1]; uVar3 = puVar5[2]; uVar4 = puVar5[3]; *puVar6 = *puVar5; puVar6[1] = uVar2; puVar6[2] = uVar3; puVar6[3] = uVar4; uVar2 = puVar5[5]; uVar3 = puVar5[6]; uVar4 = puVar5[7]; puVar6[4] = puVar5[4]; puVar6[5] = uVar2; puVar6[6] = uVar3; puVar6[7] = uVar4; uVar2 = puVar5[9]; puVar6[8] = puVar5[8]; puVar6[9] = uVar2; puVar6[10] = puVar5[10]; } param_1 = param_1 + 0xf; puVar6[0xb] = puVar5[0xb]; puVar6[0xc] = puVar5[0xc]; *(undefined1 *)(puVar6 + 0xd) = *(undefined1 *)(puVar5 + 0xd); *(undefined1 *)((int)puVar6 + 0x35) = *(undefined1 *)((int)puVar5 + 0x35); puVar6 = puVar6 + 0xf; puVar1 = puVar5 + 0xe; puVar5 = puVar5 + 0xf; } while (puVar1 != in_EDX); return param_1; } //@@ 004b6f40 FUN_004b6f40 undefined4 * FUN_004b6f40(undefined4 *param_1) { undefined8 *puVar1; undefined8 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined8 *in_ECX; undefined8 *in_EDX; undefined8 *puVar6; undefined4 *puVar7; undefined4 *puVar8; puVar7 = param_1; if (in_ECX != in_EDX) { puVar6 = (undefined8 *)((int)in_ECX + 0x24); puVar8 = param_1 + 1; do { puVar1 = (undefined8 *)((int)puVar6 + 0x3c); *puVar7 = *(undefined4 *)((int)puVar6 + -0x24); uVar3 = *(undefined4 *)((int)puVar6 + -0x1c); uVar4 = *(undefined4 *)(puVar6 + -3); uVar5 = *(undefined4 *)((int)puVar6 + -0x14); puVar7 = puVar7 + 0xf; *puVar8 = *(undefined4 *)(puVar6 + -4); puVar8[1] = uVar3; puVar8[2] = uVar4; puVar8[3] = uVar5; uVar3 = *(undefined4 *)((int)puVar6 + -0xc); uVar4 = *(undefined4 *)(puVar6 + -1); uVar5 = *(undefined4 *)((int)puVar6 + -4); puVar8[4] = *(undefined4 *)(puVar6 + -2); puVar8[5] = uVar3; puVar8[6] = uVar4; puVar8[7] = uVar5; *(undefined8 *)((int)param_1 + (-0x3c - (int)in_ECX) + (int)puVar1) = *puVar6; *(undefined4 *)((int)param_1 + (-0x34 - (int)in_ECX) + (int)puVar1) = *(undefined4 *)(puVar6 + 1); puVar8[0xb] = *(undefined4 *)((int)puVar6 + 0xc); puVar8[0xc] = *(undefined4 *)(puVar6 + 2); *(undefined1 *)(puVar8 + 0xd) = *(undefined1 *)((int)puVar6 + 0x14); *(undefined1 *)((int)puVar8 + 0x35) = *(undefined1 *)((int)puVar6 + 0x15); puVar2 = puVar6 + 3; puVar6 = puVar1; puVar8 = puVar8 + 0xf; } while (puVar2 != in_EDX); } return puVar7; } //@@ 004b6fc0 FUN_004b6fc0 void FUN_004b6fc0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = *param_1; if (in_ECX + 1 != param_1 + 1) { uVar1 = param_1[2]; uVar2 = param_1[3]; uVar3 = param_1[4]; in_ECX[1] = param_1[1]; in_ECX[2] = uVar1; in_ECX[3] = uVar2; in_ECX[4] = uVar3; uVar1 = param_1[6]; uVar2 = param_1[7]; uVar3 = param_1[8]; in_ECX[5] = param_1[5]; in_ECX[6] = uVar1; in_ECX[7] = uVar2; in_ECX[8] = uVar3; *(undefined8 *)(in_ECX + 9) = *(undefined8 *)(param_1 + 9); in_ECX[0xb] = param_1[0xb]; } in_ECX[0xc] = param_1[0xc]; in_ECX[0xd] = param_1[0xd]; *(undefined1 *)(in_ECX + 0xe) = *(undefined1 *)(param_1 + 0xe); *(undefined1 *)((int)in_ECX + 0x39) = *(undefined1 *)((int)param_1 + 0x39); return; } //@@ 004b7020 FUN_004b7020 void FUN_004b7020(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; *in_EDX = *param_1; uVar1 = param_1[2]; uVar2 = param_1[3]; uVar3 = param_1[4]; in_EDX[1] = param_1[1]; in_EDX[2] = uVar1; in_EDX[3] = uVar2; in_EDX[4] = uVar3; uVar1 = param_1[6]; uVar2 = param_1[7]; uVar3 = param_1[8]; in_EDX[5] = param_1[5]; in_EDX[6] = uVar1; in_EDX[7] = uVar2; in_EDX[8] = uVar3; *(undefined8 *)(in_EDX + 9) = *(undefined8 *)(param_1 + 9); in_EDX[0xb] = param_1[0xb]; in_EDX[0xc] = param_1[0xc]; in_EDX[0xd] = param_1[0xd]; *(undefined1 *)(in_EDX + 0xe) = *(undefined1 *)(param_1 + 0xe); *(undefined1 *)((int)in_EDX + 0x39) = *(undefined1 *)((int)param_1 + 0x39); return; } //@@ 004b7070 FUN_004b7070 void FUN_004b7070(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x38) = param_1; return; } //@@ 004b7080 Entity::Target /* ZHL [lua] Lua binding Entity:Target */ EntityPtr __thiscall Entity::Target(Entity *this) { return this->_target; } //@@ 004b7090 FUN_004b7090 undefined4 FUN_004b7090(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x3d4); } //@@ 004b70a0 Entity_Projectile::ChangeTimeout /* ZHL [lua] Lua binding EntityProjectile:ChangeTimeout */ int __thiscall Entity_Projectile::ChangeTimeout(Entity_Projectile *this) { return this->_changeTimeout; } //@@ 004b70b0 Level::EnterDoor /* ZHL [lua] Lua binding Level:EnterDoor */ int __thiscall Level::EnterDoor(Level *this) { return this->_enterDoor; } //@@ 004b70c0 NpcHelper::hornfel_spawn_doors /* WARNING: Removing unreachable block (ram,0x004b78c5) */ /* DB: ? spawns ENTITY_HORNFEL_DOOR (0x3c7) at sin/cos offsets 3 times; caller 0x4bc460 sits in the Hornfel helper block next to NpcHelper::hornfel_get_rail_direction prototype: db/protos.zhl */ void __cdecl NpcHelper::hornfel_spawn_doors(void) { byte isCanStep; char isConnected; uint uVar1; int iVar2; int iVar3; uint seed; EntityPtr EVar4; EntityPtr *fromIndex; undefined1 *toIndex; EntityPtr toIndex_00; EntityPtr *toIndex_01; Room *room; int iVar5; EntityPtr EVar6; EntityPtr *pEVar7; float fVar8; float fVar9; EntityPtr *doors; EntityPtr *doorsEnd; Vector spawnPos; Vector leftSpawnPos; EntityPtr local_2c; EntityPtr local_28; EntityPtr local_24; EntityPtr local_20; EntityPtr local_1c; EntityPtr local_18; EntityPtr *doorsCapacity; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af336d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; doors = (EntityPtr *)0x0; doorsEnd = (EntityPtr *)0x0; doorsCapacity = (EntityPtr *)0x0; room = g_game->_room; local_20 = *(EntityPtr *)((int)room + 0xc); local_1c = *(EntityPtr *)((int)room + 0x10); local_8 = 0; iVar5 = 1; local_2c = (EntityPtr)room; if (1 < (int)local_1c + -1) { local_28 = (EntityPtr)((int)local_20 + -2); do { fVar9 = 120.0; fVar8 = 40.0; EVar6 = *(EntityPtr *)((int)room + 0xc); if (((int)EVar6 < 1) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar5)) { iVar2 = -1; } else { iVar2 = (int)EVar6 * iVar5; } local_18 = (EntityPtr)((int)EVar6 * iVar5); if (((int)EVar6 < 2) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar5)) { iVar3 = -1; } else { iVar3 = (int)local_18 + 1; } isCanStep = RoomGridPath::can_step((EntityPtr *)((int)room + 0x7468),iVar3,iVar2); if (isCanStep != 0) { if (((int)*(EntityPtr *)((int)room + 0xc) < 1) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar5)) { local_18 = (EntityPtr)0xffffffff; } iVar2 = *(int *)((int)g_game->_room + 0xc); leftSpawnPos.x = (float)((int)local_18 % iVar2) * fVar8 + fVar8; leftSpawnPos.y = (float)((int)local_18 / iVar2) * fVar8 + fVar9; seed = Random(); local_24 = (EntityPtr) Game::Spawn(g_game,0x3c7,0,&leftSpawnPos,&g_vectorZero,(Entity *)0x0,0,seed); *(float *)((int)local_24 + 0xec) = -90.0; local_18 = (EntityPtr)cos(-1.5707964); fVar8 = sin(-1.5707964); ((Vector *)((int)local_24 + 0xdc))->x = (float)local_18 * 0.0 - fVar8 * 15.0; *(float *)((int)local_24 + 0xe0) = fVar8 * 0.0 + (float)local_18 * 15.0; if (doorsEnd == doorsCapacity) { std::vector::_Emplace_reallocate(doorsEnd,&local_24); doorsCapacity = (EntityPtr *)0x0; } else { *doorsEnd = local_24; doorsEnd = doorsEnd + 1; } fVar9 = 120.0; fVar8 = 40.0; } if ((((int)local_20 + -1 < 0) || ((int)*(EntityPtr *)((int)room + 0xc) <= (int)((int)local_20 + -1))) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar5)) { toIndex = (undefined1 *)0xffffffff; } else { toIndex = (undefined1 *)((int)local_20 + -1) + (int)*(EntityPtr *)((int)room + 0xc) * iVar5; } if ((((int)((int)local_20 + -2) < 0) || ((int)*(EntityPtr *)((int)room + 0xc) <= (int)local_28)) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar5)) { iVar2 = -1; } else { iVar2 = (int)*(EntityPtr *)((int)room + 0xc) * iVar5 + -2 + (int)local_20; } isCanStep = RoomGridPath::can_step((EntityPtr *)((int)room + 0x7468),iVar2,(int)toIndex); if (isCanStep != 0) { if ((((int)local_20 + -1 < 0) || ((int)*(EntityPtr *)((int)room + 0xc) <= (int)((int)local_20 + -1))) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar5)) { local_18 = (EntityPtr)0xffffffff; } else { local_18 = (EntityPtr) ((undefined1 *)((int)local_20 + -1) + (int)*(EntityPtr *)((int)room + 0xc) * iVar5); } iVar2 = *(int *)((int)g_game->_room + 0xc); spawnPos.x = (float)((int)local_18 % iVar2) * fVar8 + fVar8; spawnPos.y = (float)((int)local_18 / iVar2) * fVar8 + fVar9; seed = Random(); local_18 = (EntityPtr) Game::Spawn(g_game,0x3c7,0,&spawnPos,&g_vectorZero,(Entity *)0x0,0,seed); *(undefined4 *)((int)local_18 + 0xec) = 0x42b40000; local_24 = (EntityPtr)cos(1.5707964); fVar8 = sin(1.5707964); EVar6 = local_24; local_24 = local_18; *(float *)((int)local_18 + 0xdc) = (float)EVar6 * 0.0 - fVar8 * 15.0; *(float *)((int)local_18 + 0xe0) = fVar8 * 0.0 + (float)EVar6 * 15.0; if (doorsEnd == doorsCapacity) { std::vector::_Emplace_reallocate(doorsEnd,&local_24); doorsCapacity = (EntityPtr *)0x0; } else { *doorsEnd = local_18; doorsEnd = doorsEnd + 1; } } iVar5 = iVar5 + 1; } while (iVar5 < (int)local_1c + -1); } local_18 = (EntityPtr)((int)local_20 + -1); EVar6 = (EntityPtr)0x1; if (1 < (int)local_18) { do { fVar9 = 120.0; fVar8 = 40.0; if (((int)EVar6 < (int)*(EntityPtr *)((int)room + 0xc)) && (0 < (int)*(EntityPtr *)((int)room + 0x10))) { EVar4 = *(EntityPtr *)((int)room + 0xc); toIndex_00 = EVar6; LAB_004b747c: if ((int)*(EntityPtr *)((int)room + 0x10) < 2) goto LAB_004b7486; iVar5 = (int)EVar4 + (int)EVar6; } else { EVar4 = *(EntityPtr *)((int)room + 0xc); toIndex_00 = (EntityPtr)0xffffffff; if ((int)EVar6 < (int)EVar4) goto LAB_004b747c; LAB_004b7486: iVar5 = -1; } isCanStep = RoomGridPath::can_step((EntityPtr *)((int)room + 0x7468),iVar5,(int)toIndex_00); if (isCanStep != 0) { if (((int)EVar6 < (int)*(EntityPtr *)((int)room + 0xc)) && (0 < (int)*(EntityPtr *)((int)room + 0x10))) { local_20 = EVar6; } else { local_20 = (EntityPtr)0xffffffff; } iVar5 = *(int *)((int)g_game->_room + 0xc); spawnPos.x = (float)((int)local_20 % iVar5) * fVar8 + fVar8; spawnPos.y = (float)((int)local_20 / iVar5) * fVar8 + fVar9; seed = Random(); local_24 = (EntityPtr) Game::Spawn(g_game,0x3c7,0,&spawnPos,&g_vectorZero,(Entity *)0x0,0,seed); *(undefined4 *)((int)local_24 + 0xec) = 0; local_28 = (EntityPtr)cos(0.0); fVar8 = sin(0.0); EVar4 = local_28; local_28 = local_24; ((Vector *)((int)local_24 + 0xdc))->x = (float)EVar4 * 0.0 - fVar8 * 15.0; *(float *)((int)local_24 + 0xe0) = fVar8 * 0.0 + (float)EVar4 * 15.0; if (doorsEnd == doorsCapacity) { std::vector::_Emplace_reallocate(doorsEnd,&local_28); doorsCapacity = (EntityPtr *)0x0; } else { *doorsEnd = local_24; doorsEnd = doorsEnd + 1; } } EVar4 = *(EntityPtr *)((int)room + 0xc); pEVar7 = (EntityPtr *)((int)room + 0x7468); if ((((int)EVar6 < (int)EVar4) && (iVar5 = (int)local_1c + -1, -1 < iVar5)) && (iVar5 < (int)*(EntityPtr *)((int)room + 0x10))) { toIndex_01 = (EntityPtr *)(iVar5 * (int)EVar4 + (int)EVar6); LAB_004b75cf: iVar5 = (int)local_1c + -2; room = (Room *)local_2c; if ((iVar5 < 0) || ((int)*(EntityPtr *)((int)local_2c + 0x10) <= iVar5)) goto LAB_004b75e6; fromIndex = (EntityPtr *)(iVar5 * (int)EVar4 + (int)EVar6); } else { toIndex_01 = (EntityPtr *)0xffffffff; if ((int)EVar6 < (int)EVar4) goto LAB_004b75cf; LAB_004b75e6: fromIndex = (EntityPtr *)0xffffffff; } isCanStep = RoomGridPath::can_step(pEVar7,(int)fromIndex,(int)toIndex_01); if (isCanStep != 0) { local_28 = (EntityPtr)FUN_004bb230(); if (doorsEnd == doorsCapacity) { std::vector::_Emplace_reallocate(doorsEnd,&local_28); doorsCapacity = (EntityPtr *)0x0; } else { *doorsEnd = local_28; doorsEnd = doorsEnd + 1; } } EVar6 = (EntityPtr)((int)EVar6 + 1); } while ((int)EVar6 < (int)local_18); } local_18 = (EntityPtr)0x0; pEVar7 = doors; if (doorsEnd != (EntityPtr *)0x0) { do { local_18 = (EntityPtr)pEVar7; local_1c = *(EntityPtr *)local_18; EVar6 = (EntityPtr)((int)local_1c + 0x3bc); local_2c = EVar6; if ((*(int *)((int)local_1c + 0x3bc) == 0) && (pEVar7 = (EntityPtr *)((int)local_18 + 4), pEVar7 < doorsEnd)) { do { local_28 = *pEVar7; local_20 = (EntityPtr)((int)local_28 + 0x3bc); if (*(EntityPtr *)((int)local_28 + 0x3bc) == (EntityPtr)0x0) { iVar5 = (int)((*(float *)((int)local_28 + 0x33c) - 40.0) / 40.0 + 0.5); iVar2 = (int)((*(float *)((int)local_28 + 0x340) - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || ((int)*(EntityPtr *)((int)room + 0xc) <= iVar5)) || (iVar2 < 0)) || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar2)) { iVar5 = -1; } else { iVar5 = iVar2 * (int)*(EntityPtr *)((int)room + 0xc) + iVar5; } iVar3 = (int)((*(float *)((int)local_1c + 0x33c) - 40.0) / 40.0 + 0.5); iVar2 = (int)((*(float *)((int)local_1c + 0x340) - 120.0) / 40.0 + 0.5); if (((iVar3 < 0) || ((int)*(EntityPtr *)((int)room + 0xc) <= iVar3)) || ((iVar2 < 0 || ((int)*(EntityPtr *)((int)room + 0x10) <= iVar2)))) { iVar3 = -1; } else { iVar3 = iVar2 * (int)*(EntityPtr *)((int)room + 0xc) + iVar3; } isConnected = room_grid_flood_fill(iVar3,iVar5); if (isConnected != '\0') { if (*(EntityPtr *)EVar6 != (EntityPtr)0x0) { local_2c = EVar6; std::multiset::erase(&local_2c); } *(EntityPtr *)EVar6 = local_28; std::multiset::insert(EVar6); if (*(EntityPtr *)local_20 != (EntityPtr)0x0) { local_2c = local_20; std::multiset::erase(&local_2c); } *(EntityPtr *)local_20 = local_1c; std::multiset::insert(local_20); } } pEVar7 = pEVar7 + 1; } while (pEVar7 < doorsEnd); } local_18 = (EntityPtr)((int)local_18 + 4); pEVar7 = (EntityPtr *)local_18; } while ((uint)local_18 < doorsEnd); } if (doorsEnd != (EntityPtr *)0x0) { do { (**(code **)(*(int *)*doors + 0xc))(uVar1); doors = doors + 1; } while (doors < doorsEnd); } if (*(EntityPtr *)((int)room + 0x724) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x724) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x728) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x728) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x72c) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x72c) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x730) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x730) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x734) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x734) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x738) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x738) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x73c) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x73c) + 0xf4) = 0; } if (*(EntityPtr *)((int)room + 0x740) != (EntityPtr)0x0) { *(undefined4 *)((int)*(EntityPtr *)((int)room + 0x740) + 0xf4) = 0; } ExceptionList = local_10; return; } //@@ 004b78f0 NpcHelper::hornfel_remove_doors /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x004b7ba7) */ /* WARNING: Removing unreachable block (ram,0x004b7bb9) */ /* WARNING: Removing unreachable block (ram,0x004b7bc9) */ /* DB: ? from NpcHelper::hornfel_room_controller when the room is cleared (descriptor flag 1): collects ENTITY_HORNFEL_DOOR (967) entities and entities with a +0x3d4 child, spawns poof 1000.15 at each and Removes them (vtable +0x28), then sets +0xf4=1.0 on the 8 room doors (Room+0x724..+0x740) */ void NpcHelper::hornfel_remove_doors(void) { void *pvVar1; int *hornfelDoorIter; uint uVar3; int *linkedIter; uint seed; Entity *pEVar4; int *linkedIter; int *piVar6; int *local_70; int *local_64; Vector scratchVec; int *local_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *hornfelDoorIter; puStack_c = &LAB_00af33a5; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; linkedIter = (int *)0x0; local_64 = (int *)0x0; pvVar1 = g_game->_room; piVar6 = (int *)0x0; local_70 = (int *)0x0; local_8 = 1; scratchVec.y = 0.0; local_14 = uVar3; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { local_44 = *(int **)(*(int *)((int)pvVar1 + 0x125c) + (int)scratchVec.y * 4); if (local_44[10] == 0x3c7) { if (linkedIter == (int *)0x0) { std::vector::_Emplace_reallocate(0,&local_44); linkedIter = local_64; } else { *linkedIter = (int)local_44; local_64 = linkedIter + 1; linkedIter = local_64; } } if (local_44[0xf5] != 0) { if (piVar6 == (int *)0x0) { std::vector::_Emplace_reallocate(0,&local_44); piVar6 = local_70; } else { *piVar6 = (int)local_44; local_70 = piVar6 + 1; piVar6 = local_70; } } scratchVec.y = (float)((int)scratchVec.y + 1); } while ((uint)scratchVec.y < (uint)*(float *)((int)pvVar1 + 0x1264)); } local_44 = (int *)0x0; linkedIter = (int *)0x0; hornfelDoorIter = local_44; hornfelDoorIter = local_44; if (piVar6 != (int *)0x0) { do { seed = Random(); scratchVec.x = *(float *)(*linkedIter + 0x33c); scratchVec.y = *(float *)(*linkedIter + 0x340); Game::Spawn(g_game,1000,0xf,&scratchVec,&g_vectorZero,(Entity *)0x0,0,seed); (**(code **)(*(int *)*linkedIter + 0x28))(uVar3); (**(code **)(**(int **)(*linkedIter + 0x3d4) + 0x28))(); linkedIter = linkedIter + 1; hornfelDoorIter = local_44; hornfelDoorIter = local_44; } while (linkedIter != piVar6); } for (; piVar6 = local_44, hornfelDoorIter != linkedIter; hornfelDoorIter = hornfelDoorIter + 1) { local_40 = 0x3ecccccd; uStack_3c = 0x3ecccccd; uStack_38 = 0x3ecccccd; uStack_34 = 0x3f800000; local_20 = 0; local_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; uStack_24 = 0x3f800000; local_1c = 0; local_18 = 0; local_44 = hornfelDoorIter; uVar3 = Random(); scratchVec.x = *(float *)(*hornfelDoorIter + 0x33c); scratchVec.y = *(float *)(*hornfelDoorIter + 0x340); pEVar4 = Game::Spawn(g_game,1000,0xf,&scratchVec,&g_vectorZero,(Entity *)0x0,0,uVar3); (**(code **)(*(int *)pEVar4 + 0x3c))(&local_40,0xffffffff,0xff,0,1); (**(code **)(*(int *)*hornfelDoorIter + 0x28))(); hornfelDoorIter = local_44; local_44 = piVar6; } if (*(int *)((int)pvVar1 + 0x724) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x724) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x728) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x728) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x72c) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x72c) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x730) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x730) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x734) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x734) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x738) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x738) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x73c) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x73c) + 0xf4) = 0x3f800000; } if (*(int *)((int)pvVar1 + 0x740) != 0) { *(undefined4 *)(*(int *)((int)pvVar1 + 0x740) + 0xf4) = 0x3f800000; } if (local_44 != (int *)0x0) { uVar3 = -(int)local_44 & 0xfffffffc; linkedIter = local_44; if (0xfff < uVar3) { linkedIter = (int *)local_44[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_44 + (-4 - (int)linkedIter))) { local_44 = hornfelDoorIter; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } local_44 = hornfelDoorIter; operator_delete(linkedIter,uVar3); } ExceptionList = local_10; return; } //@@ 004b7c30 NpcHelper::hornfel_render_minecart /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=npc, param_1=the minecart sprite (npc->_minecart+0x48), param_2=render pos: Entity_NPC::Render calls it only for type 0x38a (ENTITY_HORNFEL 906) after Sprite::RenderLayer(1) of the cart; checks layer counts ("AnimationData is NULL", "LayerId out of bounds") and renders the remaining cart layers over the npc */ void NpcHelper::hornfel_render_minecart(int param_1,Vector *param_2) { int iVar1; int iVar2; LayerState *pLVar3; int in_ECX; int iVar4; float *pfVar5; ANM2 *this; AnimationLayer local_8c; AnimationState *local_88; undefined4 local_84; undefined1 local_80; Vector *local_7c; AnimationState *local_78; AnimationState local_74 [3]; float local_8; local_8 = (float)(__security_cookie ^ (uint)&local_74[3]._animFrame); local_7c = param_2; if (*(char *)(in_ECX + 0x171) != '\0') { if (*(int *)(param_1 + 0x34) == 0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)(*(int *)(param_1 + 0x30) + 0x80) < 2) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } iVar4 = *(int *)(param_1 + 0x34); if ((((iVar4 != 0) && (0 < *(int *)(*(int *)(param_1 + 0x30) + 0x80))) && (iVar1 = *(int *)(iVar4 + 0x3c), -1 < iVar1)) && (((iVar1 < *(int *)(iVar4 + 0x1c) && (iVar2 = *(int *)(*(int *)(param_1 + 0x38) + iVar1 * 4), -1 < iVar2)) && ((iVar4 = iVar1 * 0x10 + *(int *)(iVar4 + 0x18), iVar2 < *(int *)(iVar4 + 8) && (local_78 = (AnimationState *)(iVar2 * 0x6c + *(int *)(iVar4 + 4)), local_78 != (AnimationState *)0x0)))))) { if (*(int *)(in_ECX + 0x7c) == 0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)(*(int *)(in_ECX + 0x78) + 0x80) < 5) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } iVar4 = *(int *)(in_ECX + 0x7c); if ((((iVar4 != 0) && (3 < *(int *)(*(int *)(in_ECX + 0x78) + 0x80))) && ((iVar1 = *(int *)(iVar4 + 0x48), -1 < iVar1 && (((iVar1 < *(int *)(iVar4 + 0x1c) && (iVar2 = *(int *)(*(int *)(in_ECX + 0x80) + iVar1 * 4), -1 < iVar2)) && (iVar4 = iVar1 * 0x10 + *(int *)(iVar4 + 0x18), iVar2 < *(int *)(iVar4 + 8))))))) && (pfVar5 = (float *)(iVar2 * 0x6c + *(int *)(iVar4 + 4)), pfVar5 != (float *)0x0)) { AnimationState::copy_assign(local_74,local_78); local_88 = local_74; this = (ANM2 *)(in_ECX + 0x48); local_84 = 1; local_8c = (AnimationLayer)0x4; local_74[0]._animation = (void *)(((float)local_74[0]._animation - 0.0) + *pfVar5); local_74[0]._animData = (void *)(((float)local_74[0]._animData - 224.0) + pfVar5[1]); local_80 = 1; pLVar3 = ANM2::GetLayer(this,&DAT_00000004); pLVar3->_visible = 1; pLVar3 = ANM2::GetLayer(this,&DAT_00000004); (pLVar3->_color)._tint[3] = *(float *)(param_1 + 0xb4); AnimationLayer::RenderFrame(&local_8c,local_7c,0,&g_vectorZero,&g_vectorZero,this); pLVar3 = ANM2::GetLayer(this,&DAT_00000004); pLVar3->_visible = 0; } } } return; } //@@ 004b7e30 NpcHelper::hornfel_charge /* DB: Hornfel; strs Charge*/Idle* */ void NpcHelper::hornfel_charge(void) { ANM2 *this; float fVar1; float fVar2; char *pcVar3; int in_ECX; this = (ANM2 *)(in_ECX + 0x48); fVar1 = *(float *)(*(int *)(in_ECX + 0x3d4) + 0x360); fVar2 = *(float *)(*(int *)(in_ECX + 0x3d4) + 0x364); if (*(int *)(in_ECX + 0xb64) != 10) { if (ABS(fVar2) < ABS(fVar1)) { pcVar3 = "IdleLeft"; if (0.0 <= fVar1) { pcVar3 = "IdleRight"; } ANM2::Play(this,(byte *)pcVar3,0); return; } pcVar3 = "IdleUp"; if (0.0 <= fVar2) { pcVar3 = "IdleDown"; } ANM2::Play(this,(byte *)pcVar3,0); return; } if (ABS(fVar2) < ABS(fVar1)) { pcVar3 = "ChargeLeft"; if (0.0 <= fVar1) { pcVar3 = "ChargeRight"; } ANM2::Play(this,(byte *)pcVar3,0); return; } pcVar3 = "ChargeUp"; if (0.0 <= fVar2) { pcVar3 = "ChargeDown"; } ANM2::Play(this,(byte *)pcVar3,0); return; } //@@ 004b7ee0 NpcHelper::hornfel_pick_spawn /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from NpcHelper::hornfel_attack: builds (id,weight) outcome list (id 8 gets +3), WeightedOutcomePicker::PickOutcome, Game::Spawn the picked entity */ Entity * NpcHelper::hornfel_pick_spawn(void) { int *piVar1; undefined4 uVar2; RNG rng; uint uVar3; Entity *spawned; EntityPtr in_ECX; WeightedOutcomePicker freeBlock; uint uVar4; int iVar5; int iVar6; int iVar7; int iVar8; EntityPtr *local_44; uint rngSeed; undefined8 uStack_3c; uint uStack_34; WeightedOutcomePicker outcomes; undefined4 *outcomesEnd; undefined4 *outcomesCapacity; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; EntityPtr oldParent; EntityPtr *parentRef; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af332d; local_1c = ExceptionList; securityCookie = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; outcomes = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacity = (undefined4 *)0x0; local_14 = 0; uStack_3c = (ulonglong)(uint)uStack_3c; uStack_34 = 6; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_3c + 4); uVar3 = 0; uVar4 = (int)outcomesEnd - (int)outcomes >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomes + uVar3 * 8) == 8) { piVar1 = (int *)((int)outcomes + 4 + uVar3 * 8); *piVar1 = *piVar1 + 3; if (*piVar1 < 0) { *(undefined4 *)((int)outcomes + 4 + uVar3 * 8) = 0; } goto LAB_004b7fc7; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } uStack_3c = CONCAT44(8,(uint)uStack_3c); uStack_34 = 3; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_3c + 4); } else { *outcomesEnd = 8; outcomesEnd[1] = 3; outcomesEnd = outcomesEnd + 2; } LAB_004b7fc7: uVar3 = 0; uVar4 = (int)outcomesEnd - (int)outcomes >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomes + uVar3 * 8) == 0x10) { piVar1 = (int *)((int)outcomes + 4 + uVar3 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)((int)outcomes + 4 + uVar3 * 8) = 0; } goto LAB_004b8025; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } uStack_3c = CONCAT44(0x10,(uint)uStack_3c); uStack_34 = 1; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_3c + 4); } else { *outcomesEnd = 0x10; outcomesEnd[1] = 1; outcomesEnd = outcomesEnd + 2; } LAB_004b8025: rngSeed = Random(); rngSeed = rngSeed | 1; uStack_3c = 0x900000005; uStack_34 = 7; rng._shift1 = 5; rng._seed = rngSeed; rng._shift2 = 9; rng._shift3 = 7; uVar3 = WeightedOutcomePicker::PickOutcome(&outcomes,rng); local_14 = 0xffffffff; uStack_34 = uVar3; if (outcomes != (WeightedOutcomePicker)0x0) { uVar4 = (int)outcomesCapacity - (int)outcomes & 0xfffffff8; freeBlock = outcomes; if (0xfff < uVar4) { freeBlock = *(WeightedOutcomePicker *)((int)outcomes + -4); uVar4 = uVar4 + 0x23; if (0x1f < ((int)outcomes - (int)freeBlock) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)freeBlock,uVar4); } uVar4 = Random(); spawned = Game::Spawn(g_game,4,uVar3,(Vector *)((int)in_ECX + 0x33c),&g_vectorZero, (Entity *)in_ECX,0,uVar4); oldParent = spawned->_parent; parentRef = &spawned->_parent; spawned->_visible = 0; spawned->_entityCollisionClass = 0; spawned->_entityGridCollisionClass = 0; *(undefined4 *)&spawned[1].field_0x4 = 0x23; spawned[1]._damageEvents._begin = (void *)0x23; if (oldParent != (EntityPtr)0x0) { local_44 = parentRef; std::multiset::erase(&local_44); } *parentRef = in_ECX; if (in_ECX != (EntityPtr)0x0) { std::multiset::insert(parentRef); } if (uStack_34 == 8) { iVar5 = DAT_00c34c00; iVar6 = DAT_00c34c04; iVar7 = DAT_00c34c08; iVar8 = DAT_00c34c0c; } else { if (uStack_34 != 0x10) goto LAB_004b814e; iVar5 = DAT_00c34b90; iVar6 = DAT_00c34b94; iVar7 = DAT_00c34b98; iVar8 = DAT_00c34b9c; } spawned[1]._sprite._filename._buf[0xf] = '\x01'; spawned[1]._variant = iVar5; spawned[1]._subtype = iVar6; spawned[1]._spawnerType = iVar7; spawned[1]._spawnerVariant = iVar8; LAB_004b814e: uVar2 = *(undefined4 *)((int)&spawned->_flags + 4); *(uint *)&spawned->_flags = (uint)spawned->_flags | 0x20; *(undefined4 *)((int)&spawned->_flags + 4) = uVar2; ExceptionList = local_1c; return spawned; } //@@ 004b8190 NpcHelper::hornfel_minecart /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Hornfel; minecart anm2, "no doors to enter from!" prototype: db/protos.zhl */ void __fastcall NpcHelper::hornfel_minecart(Entity_NPC *npc) { uint uVar1; int iVar2; int iVar3; int iVar4; EntityPtr EVar5; Vector *velocity; int *piVar6; Entity_Player *player; uint rngResult; Entity *spawned; char *ptr; EntityPtr *remaining; float fVar7; float deltaX; Vector railDirOut; Vector local_60; Vector local_58; Vector local_50; EntityPtr local_48; EntityPtr *local_44; EntityPtr local_40; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ANM2 *minecartSprite; void *room; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af33dd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_48 = (EntityPtr)npc; if (npc->_state == 7) { EVar5 = npc->_entityRef; local_60.y = (float)EVar5; if (EVar5 != (EntityPtr)0x0) { local_40 = (EntityPtr)&npc->_entityRef; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); std::multiset::erase(&local_40); npc->_entityRef = (EntityPtr)0x0; goto LAB_004b8213; } } local_60.y = (float)hornfel_free_door(local_24); local_50.y = (float)g_game->_room; local_58.y = 0.0; if (*(EntityPtr *)((int)local_50.y + 0x1264) != (EntityPtr)0x0) { do { iVar4 = *(int *)((int)((Vector *)((int)local_50.y + 0x125c))->x + (int)local_58.y * 4); if (*(int *)(iVar4 + 0x28) == 0x3c7) { if (*(Entity_NPC **)(iVar4 + 0x3c4) == npc) { if (*(Entity_NPC **)(iVar4 + 0x3c4) == (Entity_NPC *)0x0) { if ((*(int *)(iVar4 + 0x3bc) == 0) || (*(int *)(*(int *)(iVar4 + 0x3bc) + 0x3c4) == 0)) goto LAB_004b8675; } else { local_40 = (EntityPtr)(iVar4 + 0x3c4); std::multiset::erase(&local_40); } iVar2 = *(int *)(iVar4 + 0x3bc); *(undefined4 *)(iVar4 + 0x3c4) = 0; if (iVar2 != 0) { if (*(int *)(iVar2 + 0x3c4) != 0) { local_40 = (EntityPtr)(iVar2 + 0x3c4); std::multiset::erase(&local_40); } *(EntityPtr *)(iVar2 + 0x3c4) = (EntityPtr)0x0; } } } LAB_004b8675: local_58.y = (float)((int)local_58.y + 1); } while ((uint)local_58.y < (uint)*(EntityPtr *)((int)local_50.y + 0x1264)); } EVar5 = (EntityPtr)local_60.y; if ((EntityPtr)local_60.y == (EntityPtr)0x0) { KAGE_LogMessage(4,(byte *)"no doors to enter from!\n"); *(undefined2 *)&npc->_stateFrame = 0xf; ExceptionList = local_1c; return; } LAB_004b8213: hornfel_get_rail_direction((Entity_NPC *)EVar5,&local_50); if ((local_50.x == g_vectorZero.x) && (local_50.y == g_vectorZero.y)) { KAGE_LogMessage(0x10,(byte *)"exit velocity is zero\n"); } if ((local_50.x != g_vectorZero.x) || (local_50.y != g_vectorZero.y)) { npc->_visible = 1; npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); local_58.y = *(float *)&npc->_minecart; if ((EntityPtr)local_58.y != (EntityPtr)0x0) { FUN_004cf0f0(1); Entity_NPC::SetMinecartPosVel ((Entity_NPC *)local_58.y,(Vector *)((int)EVar5 + 0x334),&local_50); fVar7 = *(float *)((int)local_58.y + 0x340); (npc->_pos).x = *(float *)((int)local_58.y + 0x33c); (npc->_pos).y = fVar7; hornfel_claim_target(npc); local_40 = npc->_parent; if (npc->_state == 6) { if (*(char *)((int)&npc->_projectileCooldown + 1) == '\0') { uVar1 = Random(); if (((uVar1 & 7) == 0) && ((local_40 == (EntityPtr)0x0 || (4 < *(int *)((int)local_40 + 0x45c))))) { room = g_game->_room; iVar2 = *(int *)((int)room + 0x12c0) + *(int *)((int)room + 0x12c4); iVar4 = 0; if (0 < iVar2) { iVar4 = iVar2; } iVar3 = *(int *)((int)room + 0x12c8) + *(int *)((int)room + 0x12cc); iVar2 = 0; if (0 < iVar3) { iVar2 = iVar3; } if ((iVar4 - iVar2 < 2) && (iVar4 = hornfel_free_door(), iVar4 != 0)) { local_58.y = 0.0; local_44 = (EntityPtr *) ((0x87 < *(int *)((int)g_game->_room + 0x10) * *(int *)((int)g_game->_room + 0xc)) + 2); do { local_60.y = (float)hornfel_free_door(); if ((EntityPtr)local_60.y == (EntityPtr)0x0) break; uVar1 = Random(); EVar5 = (EntityPtr) Game::Spawn(g_game,0x38a,1,&g_vectorZero,&g_vectorZero,(Entity *)npc,0,uVar1 ); *(uint *)((int)EVar5 + 0x168) = *(uint *)((int)EVar5 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar5 + 0x16c) = *(undefined4 *)((int)EVar5 + 0x16c); local_48 = EVar5; (**(code **)(*(int *)EVar5 + 0xc))(); velocity = hornfel_get_rail_direction((Entity_NPC *)local_60.y,&railDirOut); local_50.y = (float)Entity::GiveMinecart ((Entity *)EVar5,(Vector *)((int)local_60.y + 0x334), velocity); anm2Path._size = 0; minecartSprite = (ANM2 *)((int)local_50.y + 0x48); anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x21; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/965.001_hornfel minecart.anm2",0x22 ); local_14 = 0; ANM2::Load(minecartSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar1 = anm2Path._capacity + 1; ptr = (char *)anm2Path._buf._0_4_; if (0xfff < uVar1) { ptr = *(char **)(anm2Path._buf._0_4_ + -4); uVar1 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar1); } (**(code **)(*(int *)local_50.y + 0xc))(); EVar5 = local_48; if ((*(int *)((int)local_60.y + 0x3c4) == 0) && ((*(int *)((int)local_60.y + 0x3bc) == 0 || (*(int *)(*(int *)((int)local_60.y + 0x3bc) + 0x3c4) == 0)))) { *(EntityPtr *)((int)local_60.y + 0x3c4) = local_48; std::multiset::insert((EntityPtr *)((int)local_60.y + 0x3c4)); iVar4 = *(int *)((int)local_60.y + 0x3bc); if (iVar4 != 0) { local_50.y = (float)(iVar4 + 0x3c4); if (*(int *)(iVar4 + 0x3c4) != 0) { local_48 = (EntityPtr)local_50.y; std::multiset::erase(&local_48); } *(EntityPtr *)local_50.y = EVar5; std::multiset::insert(local_50.y); } } local_58.y = (float)((int)local_58.y + 1); } while ((int)local_58.y < (int)local_44); npc->_state = 0xe; uVar1 = Random(); *(undefined1 *)((int)&npc->_projectileCooldown + 1) = 100; *(short *)&npc->_projectileDelay = (short)(uVar1 % 0x1e) + 0x1e; if (local_40 == (EntityPtr)0x0) { ExceptionList = local_1c; return; } if (*(int *)((int)local_40 + 0x45c) < 0x96) { *(undefined4 *)((int)local_40 + 0x45c) = 0x96; *(undefined4 *)((int)local_40 + 0x460) = 0x96; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } EVar5 = (EntityPtr)local_60.y; } } if ((((npc->_state == 6) && (*(char *)((int)&npc->_projectileCooldown + 2) == '\0')) && (uVar1 = Random(), (uVar1 & 7) == 0)) && ((*(EntityPtr *)((int)EVar5 + 0x3bc) != (EntityPtr)0x0 && (*(EntityPtr *)((int)EVar5 + 0x3bc) != EVar5)))) { npc->_state = 10; *(undefined4 *)((int)local_58.y + 3000) = 0x3dcccccd; if (npc->_entityRef != (EntityPtr)0x0) { local_44 = &npc->_entityRef; std::multiset::erase(&local_44); } npc->_entityRef = EVar5; std::multiset::insert(&npc->_entityRef); *(undefined1 *)((int)&npc->_projectileCooldown + 2) = 100; uVar1 = Random(); *(char *)((int)&npc->_projectileDelay + 2) = (char)(uVar1 % 3) + '\x06'; ExceptionList = local_1c; return; } } if (npc->_state == 7) { npc->_state = 0xb; } else { npc->_state = 3; uVar1 = Random(); *(short *)&npc->_projectileDelay = (short)(uVar1 % 0xf) + 0xf; uVar1 = Random(); if (uVar1 % 3 == 0) { local_44 = *(EntityPtr **)((int)g_game->_room + 0x1264); if (local_44 != (EntityPtr *)0x0) { piVar6 = *(int **)((int)g_game->_room + 0x125c); uVar1 = 0; remaining = local_44; do { iVar4 = *(int *)(*piVar6 + 0x28); if ((iVar4 == 0x333) || ((iVar4 == 4 && (*(int *)(*piVar6 + 0x2c) == 0xe)))) { uVar1 = uVar1 + 1; } piVar6 = piVar6 + 1; remaining = (EntityPtr *)&remaining[-1].field_0x3; } while (remaining != (EntityPtr *)0x0); npc = (Entity_NPC *)local_48; if (3 < uVar1) { ExceptionList = local_1c; return; } } uVar1 = 0; local_40 = (EntityPtr)0x7149f2ca; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar1); uVar1 = uVar1 + 1; fVar7 = *(float *)((int)npc + 0x340) - (player->_pos).y; deltaX = ((Vector *)((int)npc + 0x33c))->x - (player->_pos).x; EVar5 = (EntityPtr)(fVar7 * fVar7 + deltaX * deltaX); if ((float)local_40 <= (float)EVar5) { EVar5 = local_40; } local_40 = EVar5; } while (uVar1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); if ((float)EVar5 <= 57600.0) { ExceptionList = local_1c; return; } } local_40 = (EntityPtr)0x2; do { uVar1 = Random(); rngResult = Random(); local_44 = (EntityPtr *) (((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292); local_48 = (EntityPtr)cos((float)local_44); fVar7 = sin((float)local_44); local_58.x = local_50.x * (float)local_48 - local_50.y * fVar7; local_58.y = local_50.y * (float)local_48 + local_50.x * fVar7; rngResult = Random(); fVar7 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14 ; local_44 = (EntityPtr *)(fVar7 + fVar7); fVar7 = cos((float)local_44); local_60.x = fVar7 * 6.0 + ((Vector *)((int)npc + 0x33c))->x; fVar7 = sin((float)local_44); local_60.y = fVar7 * 6.0 + *(float *)((int)npc + 0x340); spawned = Game::Spawn(g_game,0x333,0,&local_60,&local_58,(Entity *)npc,0,uVar1); if (spawned->_parent != (EntityPtr)0x0) { local_44 = &spawned->_parent; std::multiset::erase(&local_44); } spawned->_parent = (EntityPtr)npc; std::multiset::insert(&spawned->_parent); *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; local_40 = (EntityPtr)((int)local_40 + -1); *(undefined4 *)((int)&spawned->_flags + 4) = *(undefined4 *)((int)&spawned->_flags + 4); } while (local_40 != (EntityPtr)0x0); } } } } ExceptionList = local_1c; return; } //@@ 004b8a30 NpcHelper::hornfel_ride_minecart /* DB: SetMinecartPosVel, state 10 */ void NpcHelper::hornfel_ride_minecart(void) { undefined4 *puVar1; Entity_NPC *this; Entity_NPC *npc; qword qVar2; Game *pGVar3; float *pfVar4; void *pvVar5; int in_ECX; float fVar6; qword *pqVar7; uint uVar8; float fVar9; EntityList_EL local_2c; Vector local_1c; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af341d; local_10 = ExceptionList; this = *(Entity_NPC **)(in_ECX + 0x3d4); if ((*(int *)(in_ECX + 0xb64) == 10) && (npc = *(Entity_NPC **)(in_ECX + 0xbec), npc != (Entity_NPC *)0x0)) { if ('\0' < *(char *)(in_ECX + 0xba6)) { ExceptionList = &local_10; hornfel_get_rail_direction(npc,&local_1c); Entity_NPC::SetMinecartPosVel(this,&npc->_targetPosition,&local_1c); fVar6 = (this->_pos).x; fVar9 = (this->_pos).y; *(char *)(in_ECX + 0xba6) = *(char *)(in_ECX + 0xba6) + -1; *(float *)(in_ECX + 0x33c) = fVar6; *(float *)(in_ECX + 0x340) = fVar9; ExceptionList = local_10; return; } *(undefined4 *)(in_ECX + 0xb64) = 7; *(undefined1 *)(in_ECX + 0x171) = 0; *(undefined4 *)(in_ECX + 0x188) = 0; *(undefined2 *)(in_ECX + 0x410) = 1; *(undefined4 *)(in_ECX + 0x334) = *(undefined4 *)(in_ECX + 0x33c); *(undefined4 *)(in_ECX + 0x338) = *(undefined4 *)(in_ECX + 0x340); *(undefined4 *)(in_ECX + 0x15c) = 0; fVar6 = (this->_v2).x; fVar9 = 6.0; if (fVar6 <= 6.0) { fVar9 = fVar6; } this->_shadowSize = 0.0; (this->_v2).x = fVar9; return; } ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0xb64) = 6; *(undefined2 *)(in_ECX + 0x410) = 0x2d; *(undefined1 *)(in_ECX + 0x171) = 0; *(undefined4 *)(in_ECX + 0x188) = 0; *(undefined4 *)(in_ECX + 0x334) = *(undefined4 *)(in_ECX + 0x33c); *(undefined4 *)(in_ECX + 0x338) = *(undefined4 *)(in_ECX + 0x340); pGVar3 = g_game; *(undefined4 *)(in_ECX + 0x15c) = 0; this->_shadowSize = 0.0; EntityList::QuerySublist((EntityList *)((int)pGVar3->_room + 0x1218),&local_2c,0x333,-1,-1,0,0); uVar8 = 0; if (local_2c._size != 0) { pvVar5 = local_2c._data; do { local_1c.y = *(float *)((int)pvVar5 + uVar8 * 4); puVar1 = (undefined4 *)((int)local_1c.y + 0x3bc); if (*(int *)((int)local_1c.y + 0x3bc) == in_ECX) { fVar6 = local_1c.y; if (*(int *)((int)local_1c.y + 0x3bc) != 0) { local_14 = puVar1; std::multiset::erase(&local_14); fVar6 = local_1c.y; } local_14 = *(undefined4 **)((int)fVar6 + 0x380); local_1c.y = 3.5; *puVar1 = 0; pfVar4 = &local_1c.y; if ((float)local_14 <= 3.5) { pfVar4 = (float *)&local_14; } *(float *)((int)fVar6 + 0x380) = *pfVar4; pvVar5 = local_2c._data; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)local_2c._size); } if (local_2c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } if (local_2c._data != (void *)0x0) { uVar8 = *(uint *)((int)local_2c._data + -4); qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar8; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar2 < uVar8); free((uint *)((int)local_2c._data + -4)); } } ExceptionList = local_10; return; } //@@ 004b8ca0 NpcHelper::hornfel_attack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Hornfel; strs Attack1Double/Attack1Left... prototype: db/protos.zhl */ void __fastcall NpcHelper::hornfel_attack(Entity_NPC *npc) { RNG rng; uint uVar1; Entity *target; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar2; WeightedOutcomePicker ptr; uint uVar3; float targetDist; undefined8 uStack_48; float fStack_40; float targetDirY; WeightedOutcomePicker picker; undefined4 *outcomesEnd; undefined4 *outcomesCapacity; float *local_2c; undefined4 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *animName; float *childSlot; int dequeBlock; undefined4 *firstChildSlot; int *outcomeWeight; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af344d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; picker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacity = (undefined4 *)0x0; local_14 = 0; uStack_48 = (ulonglong)(uint)uStack_48; fStack_40 = 4.2039e-45; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_48 + 4); uVar1 = 0; uVar3 = (int)outcomesEnd - (int)picker >> 3; if (uVar3 != 0) { do { if (*(int *)((int)picker + uVar1 * 8) == 1) { outcomeWeight = (int *)((int)picker + 4 + uVar1 * 8); *outcomeWeight = *outcomeWeight + 1; if (*outcomeWeight < 0) { *(undefined4 *)((int)picker + 4 + uVar1 * 8) = 0; } goto LAB_004b8d87; } uVar1 = uVar1 + 1; } while (uVar1 < uVar3); } uStack_48 = CONCAT44(1,(uint)uStack_48); fStack_40 = 1.4013e-45; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_48 + 4); } else { *outcomesEnd = 1; outcomesEnd[1] = 1; outcomesEnd = outcomesEnd + 2; } LAB_004b8d87: if ((char)npc->_projectileCooldown == '\0') { uVar1 = 0; uVar3 = (int)outcomesEnd - (int)picker >> 3; if (uVar3 != 0) { do { if (*(int *)((int)picker + uVar1 * 8) == 2) { outcomeWeight = (int *)((int)picker + 4 + uVar1 * 8); *outcomeWeight = *outcomeWeight + 1; if (*outcomeWeight < 0) { *(undefined4 *)((int)picker + 4 + uVar1 * 8) = 0; } goto LAB_004b8df1; } uVar1 = uVar1 + 1; } while (uVar1 < uVar3); } uStack_48 = CONCAT44(2,(uint)uStack_48); fStack_40 = 1.4013e-45; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_48 + 4); } else { *outcomesEnd = 2; outcomesEnd[1] = 1; outcomesEnd = outcomesEnd + 2; } } LAB_004b8df1: uVar1 = Random(); uStack_48 = 0x900000005; fStack_40 = 9.80909e-45; rng._shift1 = 5; rng._seed = uVar1 | 1; rng._shift2 = 9; rng._shift3 = 7; uVar1 = WeightedOutcomePicker::PickOutcome(&picker,rng); target = Entity_NPC::GetPlayerTarget(npc); local_28 = (undefined4 *)((target->_pos).x - (npc->_pos).x); targetDirY = (target->_pos).y - (npc->_pos).y; targetDist = sqrtf((float)local_28 * (float)local_28 + targetDirY * targetDirY); if (0.0 < targetDist) { local_28 = (undefined4 *)((float)local_28 * (1.0 / targetDist)); targetDirY = targetDirY * (1.0 / targetDist); } *(undefined1 *)((int)&npc->_projectileDelay + 3) = 1; if (uVar1 == 0) { fStack_40 = (float)hornfel_pick_spawn(extraout_ECX); uVar1 = (npc->_entityDeque)._offset; uVar3 = uVar1 & 3; dequeBlock = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar1 >> 2) * 4); childSlot = (float *)(dequeBlock + uVar3 * 4); if (*(int *)(dequeBlock + uVar3 * 4) != 0) { local_2c = childSlot; std::multiset::erase(&local_2c); } *childSlot = fStack_40; if (fStack_40 != 0.0) { std::multiset::insert(childSlot); } if (-0.2 <= targetDirY) { if (0.0 <= (float)local_28) { animName = "Attack1Right"; } else { animName = "Attack1Left"; } LAB_004b9068: ANM2::Play(&npc->_sprite,(byte *)animName,0); } else { animName = "Attack1Left_Back"; if (0.0 <= (float)local_28) { animName = "Attack1Right_Back"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); *(undefined1 *)((int)&npc->_projectileDelay + 3) = 0; } } else { if (uVar1 != 1) { if (uVar1 == 2) { ANM2::Play(&npc->_sprite,s_Attack2,0); npc->_state = 9; *(undefined1 *)&npc->_projectileCooldown = 0x96; } goto LAB_004b9077; } local_2c = (float *)hornfel_pick_spawn(extraout_ECX); uVar1 = (npc->_entityDeque)._offset; uVar3 = uVar1 & 3; dequeBlock = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar1 >> 2) * 4); firstChildSlot = (undefined4 *)(dequeBlock + uVar3 * 4); uVar2 = 0; if (*(int *)(dequeBlock + uVar3 * 4) != 0) { local_28 = firstChildSlot; std::multiset::erase(&local_28); uVar2 = extraout_ECX_00; } *firstChildSlot = local_2c; if (local_2c != (float *)0x0) { std::multiset::insert(firstChildSlot); uVar2 = extraout_ECX_01; } local_28 = (undefined4 *)hornfel_pick_spawn(uVar2); uVar1 = (npc->_entityDeque)._offset + 1; uVar3 = uVar1 & 3; dequeBlock = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar1 >> 2) * 4); childSlot = (float *)(dequeBlock + uVar3 * 4); if (*(int *)(dequeBlock + uVar3 * 4) != 0) { local_2c = childSlot; std::multiset::erase(&local_2c); } *childSlot = (float)local_28; if (local_28 != (undefined4 *)0x0) { std::multiset::insert(childSlot); } if (-0.2 <= targetDirY) { animName = "Attack1Double"; goto LAB_004b9068; } ANM2::Play(&npc->_sprite,(byte *)"Attack1Double_Back",0); *(undefined1 *)((int)&npc->_projectileDelay + 3) = 0; } npc->_state = 8; LAB_004b9077: *(undefined1 *)((int)&npc->_projectileDelay + 2) = 0; if (picker != (WeightedOutcomePicker)0x0) { uVar1 = (int)outcomesCapacity - (int)picker & 0xfffffff8; ptr = picker; if (0xfff < uVar1) { ptr = *(WeightedOutcomePicker *)((int)picker + -4); uVar1 = uVar1 + 0x23; if (0x1f < ((int)picker - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar1); } ExceptionList = local_1c; return; } //@@ 004b90e0 NpcHelper::hornfel_launch_toward /* DB: ? ECX=npc (Hornfel), param_1=entity, param_2=target pos: sets the entity velocity toward the target with speed 10..28 scaled by distance (x0.75 for variant 8); used on segment entities and a freshly spawned bomb 4.15 in Entity_NPC::Hornfel_UpdateAI */ void NpcHelper::hornfel_launch_toward(int *param_1,float *param_2) { int *piVar1; int iVar2; int *piVar3; int in_ECX; float fVar4; float fVar5; float fVar6; float local_c; fVar6 = param_2[1]; fVar5 = *(float *)(in_ECX + 0x33c) - *param_2; fVar4 = *(float *)(in_ECX + 0x340) - fVar6; param_2 = (float *)*param_2; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); piVar3 = param_1; fVar4 = (fVar4 - 100.0) / 200.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } local_c = fVar4 * 18.0 + 10.0; if (param_1[0xb] == 8) { local_c = local_c * 0.75; } fVar6 = fVar6 - *(float *)(in_ECX + 0x340); param_2 = (float *)((float)param_2 - *(float *)(in_ECX + 0x33c)); fVar4 = sqrtf(fVar6 * fVar6 + (float)param_2 * (float)param_2); if (0.0 < fVar4) { param_2 = (float *)((float)param_2 * (1.0 / fVar4)); fVar6 = fVar6 * (1.0 / fVar4); } param_2 = (float *)((float)param_2 * local_c); piVar1 = piVar3 + 0xf2; if (*piVar1 != 0) { param_1 = piVar1; std::multiset::erase(¶m_1); } *piVar1 = in_ECX; if (in_ECX != 0) { std::multiset::insert(piVar1); } piVar1 = piVar3 + 0xef; piVar3[0xd] = *(int *)(in_ECX + 0x28); piVar3[0xe] = *(int *)(in_ECX + 0x2c); if (*piVar1 != 0) { param_1 = piVar1; std::multiset::erase(¶m_1); } *piVar1 = in_ECX; std::multiset::insert(piVar1); piVar3[0x62] = 4; *(undefined1 *)((int)piVar3 + 0x171) = 1; piVar3[0x107] = -0x3f800000; piVar3[0xd3] = 0; piVar3[0xd4] = -0x3e400000; piVar3[0xcf] = *(int *)(in_ECX + 0x33c); iVar2 = *(int *)(in_ECX + 0x340); piVar3[0x5a] = piVar3[0x5a] & 0xffffffdf; piVar3[0xd0] = iVar2; piVar3[0x5b] = piVar3[0x5b]; piVar3[0xd8] = (int)param_2; piVar3[0xd9] = (int)(fVar6 * local_c); (**(code **)(*piVar3 + 0xc))(); return; } //@@ 004b92e0 Entity_NPC::Hornfel_UpdateAI /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void Entity_NPC::Hornfel_UpdateAI(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_NPC::Hornfel_UpdateAI(Entity_NPC *this) { undefined4 uVar1; void *pvVar2; EntityPtr EVar3; undefined1 *puVar4; byte bVar5; short sVar6; LayerState *layer; Entity_NPC *newMinecart; Entity_Projectile *projectile; byte *pbVar7; EntityPtr EVar8; int iVar9; uint uVar10; Entity *pEVar11; Vector *pVVar12; uint uVar13; char *pcVar14; float *pfVar15; EntityPtr *pEVar16; EntityPtr *pEVar17; EntityPtr EVar18; Room *activeRoom; bool bVar19; float fVar20; float fVar21; float fVar22; float fVar23; float fVar24; float fVar25; Vector randomPos; EntityPtr spreadScore; Vector local_148; Vector tmpVec; EntityPtr local_138; EntityPtr local_134; EntityPtr local_130; EntityPtr local_12c; float local_128; Vector launchTarget; EntityPtr local_11c; Room *room; char isAtRailTarget; Vector scratchVec; EntityPtr local_108; EntityPtr local_104; EntityPtr local_100; EntityPtr local_fc; ProjectileParams projectileParams; undefined1 local_50 [24]; float fStack_38; float fStack_34; EntityPtr local_30; EntityPtr local_2c; EntityPtr local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af349d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_12c = this->_minecart; activeRoom = g_game->_room; room = activeRoom; local_100 = (EntityPtr)this; puVar4 = local_50 + 0x4c; switch(this->_state) { case 0: puStack_20 = local_50 + 0x4c; if (this->_variant == 0) { puStack_20 = local_50 + 0x4c; QueryNPCsType(&fStack_34,1000,0x98); local_14 = 0; if (local_28 == (EntityPtr)0x0) { uVar10 = Random(); EVar8 = (EntityPtr) Game::Spawn(g_game,1000,0x98,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,uVar10); (**(code **)(*(int *)EVar8 + 0xc))(); } else { EVar8 = *(EntityPtr *)local_30; } if (this->_parent != (EntityPtr)0x0) { local_fc = (EntityPtr)&this->_parent; std::multiset::erase(&local_fc); } this->_parent = EVar8; if (EVar8 != (EntityPtr)0x0) { std::multiset::insert(&this->_parent); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&fStack_34); } uVar1 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags & 0xfffffffb; *(undefined4 *)((int)&this->_flags + 4) = uVar1; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x3); layer->_visible = 0; layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); layer->_visible = 0; this->_stateFrame = 0; *(undefined4 *)((int)&this->_projectileCooldown + 2) = 0; *(undefined1 *)((int)&this->_projectileDelay + 2) = 0; *(undefined2 *)&this->_projectileCooldown = 0; std::deque::resize(2); uVar10 = (this->_entityDeque)._offset; *(undefined4 *) (*(int *)((int)(this->_entityDeque)._map + ((this->_entityDeque)._mapSize - 1 & uVar10 >> 2) * 4) + (uVar10 & 3) * 4) = 0; scratchVec.y = (float)(this->_entityDeque)._offset; *(undefined4 *) (*(int *)((int)(this->_entityDeque)._map + ((this->_entityDeque)._mapSize - 1 & (int)scratchVec.y + 1U >> 2) * 4) + ((int)scratchVec.y + 1U & 3) * 4) = 0; if (this->_variant == 1) { uVar1 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x140011; this->_state = 0x10; this->_isInvicible = 1; *(undefined4 *)((int)&this->_flags + 4) = uVar1; puVar4 = puStack_20; } else { local_12c = this->_minecart; if (local_12c == (EntityPtr)0x0) { newMinecart = Entity::GiveMinecart((Entity *)this,&g_vectorZero,&g_vectorZero); local_2c = (EntityPtr)0x0; local_28 = (EntityPtr)0xf; local_50._20_4_ = 0.0; local_50._20_4_ = std::_Allocate(0x30); local_2c = (EntityPtr)0x21; local_28 = (EntityPtr)0x2f; builtin_strncpy((char *)local_50._20_4_,"gfx/965.001_hornfel minecart.anm2",0x22); local_14 = 1; ANM2::Load(&newMinecart->_sprite,(std_string *)(local_50 + 0x14),1); local_14 = 0xffffffff; if (0xf < (uint)local_28) { pEVar17 = (EntityPtr *)((int)local_28 + 1); pcVar14 = (char *)local_50._20_4_; if ((EntityPtr *)0xfff < pEVar17) { pcVar14 = *(char **)(local_50._20_4_ + -4); pEVar17 = (EntityPtr *)((int)local_28 + 0x24); if ((char *)0x1f < (char *)(local_50._20_4_ + (-4 - (int)pcVar14))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar14,(uint)pEVar17); } local_12c = this->_minecart; } NpcHelper::hornfel_ride_minecart(); *(undefined2 *)((int)&this->_projectileCooldown + 1) = 0x1e1e; puVar4 = puStack_20; } break; case 3: case 0xe: pvVar2 = (this->_sprite)._animState._animData; if (((pvVar2 == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) || (puStack_20 = local_50 + 0x4c, *(char *)((int)pvVar2 + 0x34) != '\0')) { puStack_20 = local_50 + 0x4c; NpcHelper::hornfel_charge(local_24); } *(undefined4 *)((int)local_12c + 3000) = 0x3f99999a; sVar6 = (short)this->_projectileDelay; puVar4 = puStack_20; if ((0 < sVar6) && (sVar6 = sVar6 + -1, *(short *)&this->_projectileDelay = sVar6, sVar6 < 1)) { if (this->_state == 0xe) { if (*(char *)((int)&this->_projectileDelay + 3) != '\0') { ANM2::Play(&this->_sprite,(byte *)"Taunt",0); *(undefined1 *)((int)&this->_projectileCooldown + 3) = 0x96; puVar4 = puStack_20; } } else { NpcHelper::hornfel_attack(this); puVar4 = puStack_20; } } break; case 4: fVar20 = (this->_velocity).y; fVar21 = (this->_velocity).x; this->_friction = this->_friction * 0.8; if (ABS(fVar20) < ABS(fVar21)) { puStack_20 = local_50 + 0x4c; ANM2::Play(&this->_sprite,(byte *)"RunHori",0); bVar19 = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; } else { pbVar7 = (this->_sprite)._animState._animData; local_fc = (EntityPtr)&DAT_00b5fdc8; if (0.0 <= fVar20) { local_fc = (EntityPtr)0xb5fdd0; } if (pbVar7 == (byte *)0x0) { LAB_004ba3e5: puStack_20 = local_50 + 0x4c; bVar5 = ANM2::SetAnimation(&this->_sprite,(byte *)local_fc,1); if (bVar5 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; activeRoom = room; } } else { if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } EVar8 = local_fc; do { bVar5 = *pbVar7; bVar19 = bVar5 < *(byte *)EVar8; if (bVar5 != *(byte *)EVar8) { LAB_004ba3c4: uVar10 = -(uint)bVar19 | 1; goto LAB_004ba3c9; } if (bVar5 == 0) break; bVar5 = pbVar7[1]; bVar19 = bVar5 < *(byte *)((int)EVar8 + 1); if (bVar5 != *(byte *)((int)EVar8 + 1)) goto LAB_004ba3c4; pbVar7 = pbVar7 + 2; EVar8 = (EntityPtr)((int)EVar8 + 2); } while (bVar5 != 0); uVar10 = 0; LAB_004ba3c9: if ((uVar10 != 0) || ((puStack_20 = local_50 + 0x4c, *(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && (puStack_20 = local_50 + 0x4c, (this->_sprite)._animState._isPlaying == 0)))) goto LAB_004ba3e5; } bVar19 = false; } (this->_sprite)._flipX = bVar19; sVar6 = (short)this->_projectileDelay; if (0 < sVar6) { *(short *)&this->_projectileDelay = sVar6 - ((short)(int)this->_updateTime - (short)(int)this->_prevUpdateTime); } if (this->_entityRef == (EntityPtr)0x0) { local_104 = (EntityPtr)0xffffffff; } else { local_104 = (EntityPtr)NpcHelper::hornfel_next_rail_index(); } EVar8 = (EntityPtr)Room::GetGridIndex(activeRoom,&this->_pos); if ((EVar8 == local_104) || (bVar5 = Room::IsPositionInRoom(activeRoom,&this->_pos,0.0), bVar5 == 0)) { isAtRailTarget = '\x01'; } else { isAtRailTarget = '\0'; if ((this->_entityRef != (EntityPtr)0x0) && (bVar5 = Entity::IsFrame((Entity *)this,10,0), bVar5 != 0)) { bVar5 = 0; pVVar12 = Room::GetGridPosition(room,&tmpVec,(int)local_104); bVar5 = NPCAI_Pathfinder::HasPathToPos(&this->_pathfinder,pVVar12,bVar5); pEVar17 = &this->_entityRef; if (bVar5 == 0) { if (*pEVar17 != (EntityPtr)0x0) { local_100 = (EntityPtr)pEVar17; std::multiset::erase(&local_100); } *pEVar17 = (EntityPtr)0x0; } } } local_130 = this->_entityRef; if (local_130 == (EntityPtr)0x0) { if ((short)this->_projectileDelay < 1) { local_fc = (EntityPtr)0x7149f2ca; local_11c = (EntityPtr)g_game->_room; local_108 = (EntityPtr)0x0; EVar8 = (EntityPtr)0x0; local_104 = EVar8; if (*(int *)((int)local_11c + 0x1264) != 0) { do { EVar18 = *(EntityPtr *)(*(int *)((int)local_11c + 0x125c) + (int)local_108 * 4); if (*(int *)((int)EVar18 + 0x28) == 0x3c7) { fVar21 = (this->_pos).y - *(float *)((int)EVar18 + 0x340); fVar20 = (this->_pos).x - *(float *)((int)EVar18 + 0x33c); local_100 = (EntityPtr)(fVar21 * fVar21 + fVar20 * fVar20); bVar5 = NPCAI_Pathfinder::HasPathToPos(&this->_pathfinder,&this->_pos,0); if ((bVar5 == 0) || ((float)local_fc <= (float)local_100)) { EVar8 = local_104; } else { local_fc = local_100; EVar8 = EVar18; local_104 = EVar18; } } local_108 = (EntityPtr)((int)local_108 + 1); } while ((uint)local_108 < (uint)*(EntityPtr *)((int)local_11c + 0x1264)); if (EVar8 != (EntityPtr)0x0) { if (this->_entityRef != (EntityPtr)0x0) { local_100 = (EntityPtr)&this->_entityRef; std::multiset::erase(&local_100); EVar8 = local_104; } this->_entityRef = EVar8; std::multiset::insert(&this->_entityRef); } } if (this->_entityRef != (EntityPtr)0x0) { EVar8 = (EntityPtr)NpcHelper::hornfel_next_rail_index(); local_130 = this->_entityRef; goto LAB_004ba6b2; } } LAB_004ba7a3: pEVar11 = GetPlayerTarget(this); fVar20 = (this->_pos).x; fVar21 = (pEVar11->_pos).x; fVar24 = (this->_pos).y - (pEVar11->_pos).y; fVar22 = fVar20 - fVar21; fVar23 = fVar22 * _DAT_00c5c678 + fVar24 * _DAT_00c5c67c; fVar25 = 0.0; if (0.0 < fVar23) { fVar25 = fVar23; } pfVar15 = &g_vectorZero.x; if (0.0 < fVar23) { pfVar15 = (float *)&DAT_00c5c678; } fVar23 = fVar22 * _DAT_00c5c680 + fVar24 * _DAT_00c5c684; if (fVar25 < fVar23) { pfVar15 = (float *)&DAT_00c5c680; fVar25 = fVar23; } fVar23 = fVar22 * DAT_00c5c688 + fVar24 * DAT_00c5c68c; if (fVar25 < fVar23) { pfVar15 = &DAT_00c5c688; fVar25 = fVar23; } fVar22 = DAT_00c5c694 * fVar24 + fVar22 * DAT_00c5c690; if (fVar25 < fVar22) { pfVar15 = &DAT_00c5c690; fVar25 = fVar22; } fVar20 = atan2f((this->_pos).y - (fVar25 * ((Vector *)pfVar15)->y * 0.8 + (pEVar11->_pos).y), fVar20 - (fVar25 * ((Vector *)pfVar15)->x * 0.8 + fVar21)); local_11c = (EntityPtr)(fVar20 * 57.295776); local_100 = (EntityPtr)((this->_v1).x * 0.017453292); local_fc = (EntityPtr)sin((float)local_100); local_100 = (EntityPtr)cos((float)local_100); uVar10 = Random(); fVar21 = approach_angle((this->_v1).x,(float)local_11c, (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 0.5); bVar5 = this->_collidesWithGrid; fVar20 = this->_speedMultiplier; (this->_v1).x = fVar21; (this->_velocity).x = (float)local_100 * 1.2 * fVar20 + (this->_velocity).x; (this->_velocity).y = (float)local_fc * 1.2 * fVar20 + (this->_velocity).y; if (bVar5 != 0) { fVar20 = (this->_gridCollisionNormal).y; fVar21 = (this->_gridCollisionNormal).x; fVar25 = fVar20 * (float)local_fc + fVar21 * (float)local_100; fVar20 = atan2f((float)local_fc - fVar25 * (fVar20 + fVar20), (float)local_100 - fVar25 * (fVar21 + fVar21)); (this->_v1).x = fVar20 * 57.295776; } activeRoom = room; } else { EVar8 = local_104; LAB_004ba6b2: activeRoom = room; if (local_130 == (EntityPtr)0x0) goto LAB_004ba7a3; Room::GetGridPosition(room,&scratchVec,(int)EVar8); if (isAtRailTarget == '\0') { this->_entityGridCollisionClass = 5; PathFinder::FindGridPath((PathFinder *)&this->_pathfinder,&scratchVec,1.08,0,1); } else { this->_entityGridCollisionClass = 0; pVVar12 = NpcHelper::hornfel_get_rail_direction((Entity_NPC *)local_130,&tmpVec); fVar20 = this->_speedMultiplier; fVar21 = pVVar12->y; (this->_velocity).x = -pVVar12->x * fVar20 + (this->_velocity).x; (this->_velocity).y = -fVar21 * fVar20 + (this->_velocity).y; NpcHelper::hornfel_set_anim(5); iVar9 = Room::GetGridIndex(activeRoom,&this->_pos); if (iVar9 < 0) { Room::TriggerBossDeath(activeRoom,(Entity *)this); (**(code **)(*(int *)this + 0x28))(); } } } bVar5 = Room::IsPositionInRoom(activeRoom,&this->_pos,0.0); if (bVar5 == 0) { fVar20 = (this->_pos).x; fVar21 = (this->_pos).y; local_11c = (EntityPtr)((activeRoom->_topLeftPos).x - fVar20); local_100 = (EntityPtr)(fVar20 - (activeRoom->_bottomRightPos).x); local_fc = (EntityPtr)((activeRoom->_topLeftPos).y - fVar21); local_108 = (EntityPtr)(fVar21 - (activeRoom->_bottomRightPos).y); pEVar17 = &local_100; if ((float)local_100 <= (float)local_11c) { pEVar17 = &local_11c; } pEVar16 = &local_fc; if ((float)local_fc < (float)*pEVar17 || (float)local_fc == (float)*pEVar17) { pEVar16 = pEVar17; } pEVar17 = &local_108; if ((float)local_108 < (float)*pEVar16 || (float)local_108 == (float)*pEVar16) { pEVar17 = pEVar16; } fVar20 = ((float)*pEVar17 - 0.0) / 48.0; if (fVar20 <= 0.0) { fVar20 = 0.0; } if (1.0 <= fVar20) { fVar20 = 1.0; } (this->_sprite)._color._tint[3] = 1.0 - fVar20; goto LAB_004baae3; } (this->_sprite)._color._tint[3] = 1.0; puVar4 = puStack_20; break; case 6: case 7: this->_visible = 0; this->_entityCollisionClass = 0; puVar4 = local_50 + 0x4c; if (this->_child == (EntityPtr)0x0) { sVar6 = (short)this->_stateFrame; if (sVar6 == 0) { puVar4 = local_50 + 0x4c; if (*(short *)((int)&this->_stateFrame + 2) < 1) { puStack_20 = local_50 + 0x4c; NpcHelper::hornfel_minecart(this); puVar4 = puStack_20; } } else { *(short *)&this->_stateFrame = sVar6 + -1; puVar4 = local_50 + 0x4c; } } break; case 8: puStack_20 = local_50 + 0x4c; bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Sound"); if (bVar5 != 0) { PlaySound(this,0xc9,1.0,2,0,1.0); } bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if (bVar5 != 0) { PlaySound(this,0x19,1.0,2,0,1.0); pEVar11 = GetPlayerTarget(this); local_fc = (EntityPtr)(pEVar11->_pos).x; local_108 = (EntityPtr)(pEVar11->_pos).y; local_104 = (EntityPtr)(pEVar11->_velocity).x; local_128 = (pEVar11->_velocity).y; uVar10 = Random(); fVar20 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.20000002 + 0.1; local_104 = (EntityPtr)((float)local_104 * fVar20); local_128 = local_128 * fVar20; fVar20 = (this->_pos).y - (pEVar11->_pos).y; fVar21 = (this->_pos).x - (pEVar11->_pos).x; fVar20 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21); launchTarget.y = (float)local_108 + fVar20 * local_128; launchTarget.x = fVar20 * (float)local_104 + (float)local_fc; pVVar12 = Room::FindFreePickupSpawnPosition(room,&scratchVec,&launchTarget,0.0,0,0,0); fVar20 = (float)(this->_entityDeque)._offset; launchTarget.x = pVVar12->x; launchTarget.y = pVVar12->y; uVar10 = (this->_entityDeque)._mapSize; if (*(int *)(*(int *)((int)(this->_entityDeque)._map + ((this->_entityDeque)._mapSize - 1 & (uint)fVar20 >> 2) * 4) + ((uint)fVar20 & 3) * 4) == 0) { local_fc = (EntityPtr)((int)fVar20 + 1U >> 2); uVar13 = (int)fVar20 + 1U & 3; scratchVec.y = fVar20; if (*(int *)(*(int *)((int)(this->_entityDeque)._map + (uVar10 - 1 & (uint)local_fc) * 4) + uVar13 * 4) != 0) { NpcHelper::hornfel_launch_toward (*(undefined4 *) (*(int *)((int)(this->_entityDeque)._map + ((this->_entityDeque)._mapSize - 1 & (uint)local_fc) * 4) + uVar13 * 4),&launchTarget); scratchVec.y = (float)(this->_entityDeque)._offset; uVar10 = (int)scratchVec.y + 1; goto LAB_004b9d9e; } } else { NpcHelper::hornfel_launch_toward (*(undefined4 *) (*(int *)((int)(this->_entityDeque)._map + (uVar10 - 1 & (uint)fVar20 >> 2) * 4) + ((uint)fVar20 & 3) * 4),&launchTarget); uVar10 = (this->_entityDeque)._offset; LAB_004b9d9e: iVar9 = *(int *)((int)(this->_entityDeque)._map + ((this->_entityDeque)._mapSize - 1 & uVar10 >> 2) * 4); EVar8 = (EntityPtr)(iVar9 + (uVar10 & 3) * 4); if (*(int *)(iVar9 + (uVar10 & 3) * 4) != 0) { local_fc = EVar8; std::multiset::erase(&local_fc); } *(undefined4 *)EVar8 = 0; } pcVar14 = (char *)((int)&this->_projectileDelay + 2); *pcVar14 = *pcVar14 + '\x01'; } puVar4 = puStack_20; if ((((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) && (this->_state = 3, *(char *)((int)&this->_projectileDelay + 3) != '\0')) && ((*(char *)((int)&this->_projectileCooldown + 3) == '\0' && (uVar10 = Random(), puVar4 = puStack_20, uVar10 % 10 == 0)))) && (0.5 < this->_health / this->_maxHitPoints)) { ANM2::Play(&this->_sprite,(byte *)"Taunt",0); *(undefined1 *)((int)&this->_projectileCooldown + 3) = 0x96; puVar4 = puStack_20; } break; case 9: puStack_20 = local_50 + 0x4c; bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); puVar4 = puStack_20; if (bVar5 != 0) { PlaySound(this,0x19,1.0,2,0,1.0); local_130 = (EntityPtr)0x0; local_30 = (EntityPtr)0x0; local_2c = (EntityPtr)0x0; local_108 = (EntityPtr)0x0; local_28 = (EntityPtr)0x0; local_14 = 2; local_fc = (EntityPtr) ((0x87 < *(int *)((int)g_game->_room + 0x10) * *(int *)((int)g_game->_room + 0xc)) + 3); do { EVar8 = local_2c; launchTarget.y = 0.0; launchTarget.x = 0.0; if (local_130 == local_2c) { pVVar12 = Room::GetRandomPosition(room,&randomPos,40.0); launchTarget.x = pVVar12->x; launchTarget.y = pVVar12->y; } else { local_138 = (EntityPtr)0xf149f2ca; local_134 = (EntityPtr)0x8; do { EVar18 = local_130; Room::GetRandomPosition(room,&scratchVec,40.0); spreadScore = (EntityPtr)0x0; do { local_104 = (EntityPtr)(scratchVec.y - (float)*(EntityPtr *)((int)EVar18 + 4)); local_128 = scratchVec.x - (float)*(EntityPtr *)EVar18; local_11c = (EntityPtr) sqrtf((float)local_104 * (float)local_104 + local_128 * local_128); local_148.y = ABS((float)local_104); local_148.x = ABS(local_128); local_128 = local_148.x; local_104 = (EntityPtr)local_148.y; fVar20 = sqrtf(local_148.y * local_148.y + local_148.x * local_148.x); if (fVar20 <= 0.0) { fVar20 = local_128; EVar3 = local_104; } else { local_148.x = local_128 * (1.0 / fVar20); local_148.y = (float)local_104 * (1.0 / fVar20); fVar20 = local_148.x; EVar3 = (EntityPtr)local_148.y; } pVVar12 = (Vector *)&local_148.y; if (fVar20 <= (float)EVar3) { pVVar12 = &local_148; } EVar18 = (EntityPtr)((int)EVar18 + 8); spreadScore = (EntityPtr)(pVVar12->x * (float)local_11c + (float)spreadScore); } while (EVar18 != EVar8); if ((float)local_138 < (float)spreadScore) { launchTarget.x = scratchVec.x; launchTarget.y = scratchVec.y; local_138 = spreadScore; } local_134 = (EntityPtr)((int)local_134 + -1); } while (local_134 != (EntityPtr)0x0); local_134 = (EntityPtr)0x0; this = (Entity_NPC *)local_100; } pVVar12 = Room::FindFreePickupSpawnPosition(room,&tmpVec,&launchTarget,64.0,0,0,0); launchTarget.x = pVVar12->x; local_134 = (EntityPtr)pVVar12->y; launchTarget.y = (float)local_134; local_11c = (EntityPtr)launchTarget.x; uVar10 = Random(); pEVar11 = Game::Spawn(g_game,4,0xf,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)0x0 ,0,uVar10); NpcHelper::hornfel_launch_toward(pEVar11,&launchTarget); pEVar11->_entityCollisionClass = 1; if (local_2c == local_108) { std::vector::_Emplace_reallocate(local_2c,&launchTarget); local_108 = local_28; local_130 = local_30; } else { *(EntityPtr *)local_2c = local_11c; *(EntityPtr *)((int)local_2c + 4) = local_134; local_2c = (EntityPtr)((int)local_2c + 8); } local_fc = (EntityPtr) ((int)&((Entity_NPC *)((int)local_fc + -0xf54))->_pickupGhostsEntity + 3); } while (local_fc != (EntityPtr)0x0); local_14 = 0xffffffff; *(undefined2 *)((int)this + 0x412) = 0x7d; puVar4 = puStack_20; if (local_130 != (EntityPtr)0x0) { uVar10 = ((int)local_108 - (int)local_130 >> 3) * 8; EVar8 = local_130; if (0xfff < uVar10) { EVar8 = *(EntityPtr *)((int)local_130 + -4); uVar10 = uVar10 + 0x23; if (0x1f < ((int)local_130 - (int)EVar8) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar8,uVar10); puVar4 = puStack_20; } } break; case 10: puStack_20 = local_50 + 0x4c; NpcHelper::hornfel_charge(local_24); local_fc = (EntityPtr)0x41f00000; local_108 = (EntityPtr)(*(float *)((int)local_12c + 3000) + 0.08); pEVar17 = &local_fc; if ((float)local_108 <= 30.0) { pEVar17 = &local_108; } *(EntityPtr *)((int)local_12c + 3000) = *pEVar17; bVar5 = Entity::IsFrame((Entity *)this,0xf,this->_index); puVar4 = puStack_20; if ((bVar5 != 0) && (bVar5 = Room::IsPositionInRoom(activeRoom,&this->_pos,20.0), puVar4 = puStack_20, bVar5 != 0 )) { pVVar12 = MusicManager::RandomVector(&launchTarget); uVar10 = Random(); fVar20 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; scratchVec.y = fVar20 * pVVar12->y + (this->_pos).y; scratchVec.x = fVar20 * pVVar12->x + (this->_pos).x; Room::FindFreePickupSpawnPosition(room,&local_148,&scratchVec,0.0,0,0,0); uVar10 = Random(); pVVar12 = &local_148; pEVar11 = Game::Spawn(g_game,4,0,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); NpcHelper::hornfel_launch_toward(pEVar11,pVVar12); puVar4 = puStack_20; } break; case 0xb: puStack_20 = local_50 + 0x4c; ANM2::Play(&this->_sprite,(byte *)"ChargeFinish",0); bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if (bVar5 != 0) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.BulletFlags._4_4_ = projectileParams.BulletFlags._4_4_ | 8; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; projectileParams.Scale = 2.0; local_30 = (EntityPtr)0x3f800000; local_50._16_4_ = 0.0; local_50._20_4_ = (char *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = (EntityPtr)0x3e99999a; local_28 = (EntityPtr)0x0; Color::operator_assign((Color *)&projectileParams.Color,(ColorMod *)local_50); pEVar11 = GetPlayerTarget(this); local_108 = (EntityPtr)((pEVar11->_velocity).y * 0.1); local_fc = (EntityPtr)((pEVar11->_velocity).x * 0.1); fVar21 = (this->_pos).x - (pEVar11->_pos).x; fVar20 = (this->_pos).y - (pEVar11->_pos).y; fVar20 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21); scratchVec.x = (float)local_fc * fVar20 + (pEVar11->_pos).x; scratchVec.y = (float)local_108 * fVar20 + (pEVar11->_pos).y; projectile = FireBossProjectiles(this,1,&scratchVec,10.0,&projectileParams); projectile->_scale = 2.0; projectile->_fallingAccel = projectile->_fallingAccel - 0.6; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 3.0; } bVar5 = ANM2::WasEventTriggered(&this->_sprite,(byte *)"Shoot"); puVar4 = puStack_20; if (bVar5 == 0) { local_138 = (EntityPtr)(*(float *)((int)local_12c + 3000) - 0.75); local_134 = (EntityPtr)0x3f4ccccd; pEVar17 = &local_134; if (0.8 <= (float)local_138) { pEVar17 = &local_138; } *(EntityPtr *)((int)local_12c + 3000) = *pEVar17; } else { local_108 = (EntityPtr)(*(float *)((int)local_12c + 3000) + 0.1); local_fc = (EntityPtr)0x3f99999a; pEVar17 = &local_fc; if ((float)local_108 <= 1.2) { pEVar17 = &local_108; } *(EntityPtr *)((int)local_12c + 3000) = *pEVar17; } break; case 0xc: puStack_20 = local_50 + 0x4c; ANM2::Play(&this->_sprite,(byte *)"Detonate",0); bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Sound"); if (bVar5 != 0) { PlaySound(this,0xfc,1.0,2,0,1.0); } bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); puVar4 = puStack_20; if (bVar5 != 0) { PlaySound(this,0x1d5,1.0,2,0,1.0); puVar4 = puStack_20; } break; case 0xd: this->_friction = this->_friction * 0.6; if (((this->_sprite)._animState._animData == (void *)0x0) || (puVar4 = local_50 + 0x4c, (this->_sprite)._animState._isPlaying == 0)) { this->_state = 4; *(undefined2 *)&this->_projectileDelay = 0x5a; puStack_20 = local_50 + 0x4c; pEVar11 = GetPlayerTarget(this); fVar20 = atan2f((this->_pos).y - (pEVar11->_pos).y,(this->_pos).x - (pEVar11->_pos).x); (this->_v1).x = fVar20 * 57.295776; puVar4 = puStack_20; } break; case 0x10: ANM2::Play(&this->_sprite,(byte *)"DecoyIdle",0); if (0.0 < this->_pendingDamage) { if ((this->_pendingDamageFlags & 4) == 0) { pfVar15 = (this->_damageEvents)._begin; if (pfVar15 == (this->_damageEvents)._end) { fVar20 = this->_health; } else { do { if (10.0 < *pfVar15) { uVar10 = Random(); if (uVar10 % 3 == 0) { fVar20 = 3.0; } else { LAB_004b966e: fVar20 = 2.0; } LAB_004b9680: fVar20 = this->_health - fVar20; this->_health = fVar20; } else { if (0.0 < *pfVar15) { uVar10 = Random(); if (uVar10 % 3 == 0) goto LAB_004b966e; fVar20 = 1.0; goto LAB_004b9680; } fVar20 = this->_health; } pfVar15 = pfVar15 + 0xe; } while (pfVar15 != (this->_damageEvents)._end); } if (1.0 <= fVar20) { if (fVar20 < 1.5) { this->_dead = 1; } } else { this->_health = 1.0; this->_dead = 1; } } else { this->_health = 1.0; this->_dead = 1; } } goto LAB_004baae3; } puStack_20 = puVar4; LAB_004baae3: if (0 < *(short *)((int)this + 0x412)) { *(short *)((int)this + 0x412) = *(short *)((int)this + 0x412) + -1; } pfVar15 = ((std_vector *)((int)this + 8))->_begin; if (pfVar15 != *(void **)((int)this + 0xc)) { do { tmpVec.y = pfVar15[3]; if (((((((uint)pfVar15[2] & 4) != 0) && (pfVar15[6] != 1.4013e-45)) && (pfVar15[4] != 1.4013e-45)) || ((((uint)pfVar15[2] & 8) != 0 && (pfVar15[4] == *(float *)((int)this + 0x28))))) || ((pfVar15[4] == 1.4013e-42 && ((pfVar15[5] == 2.05991e-43 && (pfVar15[6] != 1.4013e-45))))) ) { *(float *)((int)this + 0x14) = *(float *)((int)this + 0x14) - *pfVar15; *pfVar15 = 0.0; } pfVar15 = pfVar15 + 0xe; } while (pfVar15 != *(void **)((int)this + 0xc)); } if (*(float *)((int)this + 0x14) <= 0.0 && *(float *)((int)this + 0x14) != 0.0) { *(float *)((int)this + 0x14) = 0.0; } iVar9 = Entity::GetIntervalTicks((Entity *)this,3.0,0.0); if (iVar9 != 0) { if (*(char *)((int)this + 0xba0) != '\0') { *(char *)((int)this + 0xba0) = *(char *)((int)this + 0xba0) + -1; } if (*(undefined1 *)((int)this + 0xba1) != '\0') { *(char *)((int)this + 0xba1) = *(undefined1 *)((int)this + 0xba1) + -1; } if (*(undefined1 *)((int)this + 0xba2) != '\0') { *(char *)((int)this + 0xba2) = *(undefined1 *)((int)this + 0xba2) + -1; } if (*(undefined1 *)((int)this + 0xba3) != '\0') { *(char *)((int)this + 0xba3) = *(undefined1 *)((int)this + 0xba3) + -1; } } if (*(byte *)((int)this + 0x173) != 0) { if (*(int *)((int)this + 0x2c) == 1) { uVar10 = Random(); pVVar12 = (Vector *)((int)this + 0x33c); Game::Spawn(g_game,1000,1,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar10); uVar10 = Random(); pEVar11 = Game::Spawn(g_game,1000,0x12,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar10); (**(code **)(*(int *)pEVar11 + 0xc))(); Game::BombDamage(g_game,pVVar12,110.0,75.0,0,(Entity *)0x0,(BitSet128)ZEXT816(0),0x1004,0); iVar9 = 6; do { uVar10 = Random(); fVar20 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc = (EntityPtr)(fVar20 + fVar20); uVar10 = Random(); local_108 = (EntityPtr) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 15.0 + 5.0); scratchVec.x = cos((float)local_fc); scratchVec.x = scratchVec.x * (float)local_108; scratchVec.y = sin((float)local_fc); scratchVec.y = scratchVec.y * (float)local_108; uVar10 = Random(); pEVar11 = Game::Spawn(g_game,4,3,(Vector *)((int)this + 0x33c),&scratchVec,(Entity *)this,0, uVar10); pEVar11->_entityCollisionClass = 1; iVar9 = iVar9 + -1; } while (iVar9 != 0); } else if ((local_12c != (EntityPtr)0x0) && (*(byte *)((int)this + 0x171) != 0)) { uVar10 = Random(); Game::Spawn(g_game,1000,1,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)0x0,0,uVar10); if (*(int *)((int)this + 0xb64) == 8) { if (*(int *)(*(int *)((int)*(void **)((int)this + 0xbf4) + (*(uint *)((int)this + 0xbf8) - 1 & *(uint *)((int)this + 0xbfc) >> 2) * 4) + (*(uint *)((int)this + 0xbfc) & 3) * 4) != 0) { pVVar12 = MusicManager::RandomVector(&tmpVec); uVar10 = Random(); fVar20 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 10.0; scratchVec.y = fVar20 * pVVar12->y + *(float *)((int)this + 0x340); scratchVec.x = fVar20 * pVVar12->x + ((Vector *)((int)this + 0x33c))->x; NpcHelper::hornfel_launch_toward (*(undefined4 *) (*(int *)((int)*(void **)((int)this + 0xbf4) + (*(uint *)((int)this + 0xbf8) - 1 & *(uint *)((int)this + 0xbfc) >> 2 ) * 4) + (*(uint *)((int)this + 0xbfc) & 3) * 4),&scratchVec); uVar10 = *(uint *)((int)this + 0xbfc) & 3; iVar9 = *(int *)((int)*(void **)((int)this + 0xbf4) + (*(uint *)((int)this + 0xbfc) >> 2 & *(uint *)((int)this + 0xbf8) - 1) * 4 ); EVar8 = (EntityPtr)(iVar9 + uVar10 * 4); if (*(int *)(iVar9 + uVar10 * 4) != 0) { local_100 = EVar8; std::multiset::erase(&local_100); } *(undefined4 *)EVar8 = 0; } tmpVec.y = *(float *)((int)this + 0xbfc); if (*(int *)(*(int *)((int)*(void **)((int)this + 0xbf4) + ((int)tmpVec.y + 1U >> 2 & *(uint *)((int)this + 0xbf8) - 1) * 4) + ((int)tmpVec.y + 1U & 3) * 4) != 0) { pVVar12 = MusicManager::RandomVector(&tmpVec); uVar13 = Random(); uVar10 = *(uint *)((int)this + 0xbfc) + 1; fVar20 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 10.0; scratchVec.y = fVar20 * pVVar12->y + *(float *)((int)this + 0x340); scratchVec.x = fVar20 * pVVar12->x + ((Vector *)((int)this + 0x33c))->x; NpcHelper::hornfel_launch_toward (*(undefined4 *) (*(int *)((int)*(void **)((int)this + 0xbf4) + (uVar10 >> 2 & *(uint *)((int)this + 0xbf8) - 1) * 4) + (uVar10 & 3) * 4),&scratchVec); uVar10 = *(uint *)((int)this + 0xbfc) + 1; uVar13 = uVar10 & 3; iVar9 = *(int *)((int)*(void **)((int)this + 0xbf4) + (uVar10 >> 2 & *(uint *)((int)this + 0xbf8) - 1) * 4); EVar8 = (EntityPtr)(iVar9 + uVar13 * 4); if (*(int *)(iVar9 + uVar13 * 4) != 0) { local_100 = EVar8; std::multiset::erase(&local_100); } *(undefined4 *)EVar8 = 0; } } NpcHelper::minecart_break(); *(int *)((int)this + 0xb64) = 0xd; ANM2::Play((ANM2 *)((int)this + 0x48),&DAT_00b1cdf8,0); pEVar17 = (EntityPtr *)((int)this + 0xbec); *(int *)((int)this + 0x184) = 5; *(byte *)((int)this + 0x173) = 0; *(float *)((int)this + 0x380) = 100.0; if (*pEVar17 != (EntityPtr)0x0) { local_100 = (EntityPtr)pEVar17; std::multiset::erase(&local_100); } *pEVar17 = (EntityPtr)0x0; *(float *)((int)this + 0x388) = 1.0; *(float *)((int)this + 0xfc) = 1.0; } } ExceptionList = local_1c; return; } //@@ 004bb0e0 Entity_NPC::Hornfel_UpdateFrame /* ZHL [exact] __thiscall void Entity_NPC::Hornfel_UpdateFrame(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_NPC::Hornfel_UpdateFrame(Entity_NPC *this) { EntityPtr npc; int iVar1; int iVar2; int iVar3; int iVar4; npc = this->_minecart; if (((this->_state == 10) && (this->_entityRef != (EntityPtr)0x0)) && (NpcHelper::hornfel_set_anim(10), *(int *)((int)this->_entityRef + 0x3bc) != 0)) { NpcHelper::hornfel_set_anim(10); } if (npc == (EntityPtr)0x0) { return; } if (this->_visible == 0) { if (*(int *)((int)npc + 0xb64) == 0) { NpcAI::ENTITY_MINECART((Entity_NPC *)npc); } *(int *)((int)npc + 0xb64) = 3; ((Vector *)((int)npc + 0x33c))->x = (this->_targetPosition).x; *(float *)((int)npc + 0x340) = (this->_targetPosition).y; ((Vector *)((int)npc + 0x360))->x = g_vectorZero.x; *(float *)((int)npc + 0x364) = g_vectorZero.y; return; } iVar1 = *(int *)((int)g_game->_room + 0xc); iVar2 = *(int *)((int)g_game->_room + 0x10); iVar4 = (int)((((Vector *)((int)npc + 0x33c))->x - 40.0) / 40.0 + 0.5); iVar3 = (int)((*(float *)((int)npc + 0x340) - 120.0) / 40.0 + 0.5); if (iVar4 < 1) { LAB_004bb1a5: if (iVar4 < 0) goto LAB_004bb1bb; LAB_004bb1a9: if (iVar1 + -1 < iVar4) goto LAB_004bb1bb; } else { if (iVar1 + -1 <= iVar4) goto LAB_004bb1a9; if (0 < iVar3) { if (iVar3 < iVar2 + -1) { return; } goto LAB_004bb1a5; } } if ((-1 < iVar3) && (iVar3 <= iVar2 + -1)) { return; } LAB_004bb1bb: NpcHelper::hornfel_ride_minecart(); return; } //@@ 004bb230 FUN_004bb230 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ Entity * FUN_004bb230(void) { int iVar1; uint seed; Entity *pEVar2; int in_ECX; int in_EDX; float fVar3; Vector local_28; float local_20; float local_1c; float local_18 [4]; float local_8; local_8 = (float)(__security_cookie ^ (uint)(local_18 + 5)); iVar1 = *(int *)((int)g_game->_room + 0xc); local_28.x = (float)(in_ECX % iVar1) * 40.0 + 40.0; local_28.y = (float)(in_ECX / iVar1) * 40.0 + 120.0; seed = Random(); pEVar2 = Game::Spawn(g_game,0x3c7,0,&local_28,&g_vectorZero,(Entity *)0x0,0,seed); local_18[0] = -90.0; local_18[1] = 0.0; local_18[2] = 90.0; local_18[3] = 180.0; local_1c = local_18[in_EDX]; (pEVar2->_sprite)._rotation = local_1c; local_1c = local_1c * 0.017453292; local_20 = cos(local_1c); fVar3 = sin(local_1c); (pEVar2->_sprite)._offset.x = local_20 * 0.0 - fVar3 * 15.0; (pEVar2->_sprite)._offset.y = fVar3 * 0.0 + local_20 * 15.0; return pEVar2; } //@@ 004bb350 NpcHelper::hornfel_free_door /* WARNING: Removing unreachable block (ram,0x004bb4fe) */ /* WARNING: Removing unreachable block (ram,0x004bb50d) */ /* WARNING: Removing unreachable block (ram,0x004bb51d) */ /* WARNING: Removing unreachable block (ram,0x004bb523) */ /* DB: a random 967 rail door free of carts (boss_approx_3) */ undefined4 NpcHelper::hornfel_free_door(void) { void *pvVar1; char *pcVar2; int iVar3; uint uVar4; int *piVar5; float fVar6; float fVar7; int *local_24; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af34dd; local_10 = ExceptionList; ExceptionList = &local_10; piVar5 = (int *)0x0; local_24 = (int *)0x0; pvVar1 = g_game->_room; local_8 = 0; local_14 = 0; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { local_18 = *(int *)(*(int *)((int)pvVar1 + 0x125c) + local_14 * 4); if (((*(int *)(local_18 + 0x28) == 0x3c7) && (*(int *)(local_18 + 0x3c4) == 0)) && ((*(int *)(local_18 + 0x3bc) == 0 || (*(int *)(*(int *)(local_18 + 0x3bc) + 0x3c4) == 0)))) { pcVar2 = g_game->_room; if (((*pcVar2 == '\0') || (g_game->_frameCount - *(int *)(pcVar2 + 0x11f0) < 0x1e)) && (iVar3 = g_game->_enterDoor, -1 < iVar3)) { if (iVar3 < 8) { fVar6 = (float)(*(int *)(pcVar2 + iVar3 * 4 + 0x744) % *(int *)(pcVar2 + 0xc)) * 40.0 + 40.0; fVar7 = (float)(*(int *)(pcVar2 + iVar3 * 4 + 0x744) / *(int *)(pcVar2 + 0xc)) * 40.0 + 120.0; } else { fVar6 = g_vectorZero.x; fVar7 = g_vectorZero.y; } fVar6 = *(float *)(local_18 + 0x33c) - fVar6; fVar7 = *(float *)(local_18 + 0x340) - fVar7; if (fVar7 * fVar7 + fVar6 * fVar6 <= 3600.0) goto LAB_004bb4af; } if (piVar5 == (int *)0x0) { std::vector::_Emplace_reallocate(0,&local_18); piVar5 = local_24; } else { *piVar5 = local_18; local_24 = piVar5 + 1; piVar5 = local_24; } } LAB_004bb4af: local_14 = local_14 + 1; } while (local_14 < *(uint *)((int)pvVar1 + 0x1264)); if (piVar5 != (int *)0x0) { if ((int)piVar5 >> 2 == 0) { ExceptionList = local_10; return uRam00000000; } uVar4 = Random(); ExceptionList = local_10; return *(undefined4 *)((uVar4 % (uint)((int)piVar5 >> 2)) * 4); } } ExceptionList = local_10; return 0; } //@@ 004bb550 NpcHelper::hornfel_get_rail_direction /* DB: Room rail byte grid +0x746c -> direction vector prototype: db/protos.zhl, confirmed by RET 4 */ Vector * NpcHelper::hornfel_get_rail_direction(Entity_NPC *npc,Vector *outDirection) { byte bVar1; void *pvVar2; float fVar3; int iVar4; uint uVar5; uint uVar6; int iVar7; fVar3 = g_vectorZero.y; pvVar2 = g_game->_room; iVar7 = (int)(((npc->_targetPosition).x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar7) && (iVar7 < *(int *)((int)pvVar2 + 0xc))) && (iVar4 = (int)(((npc->_targetPosition).y - 120.0) / 40.0 + 0.5), -1 < iVar4)) && (((iVar4 < *(int *)((int)pvVar2 + 0x10) && (uVar6 = *(int *)((int)pvVar2 + 0xc) * iVar4 + iVar7, uVar6 < 0x1c0)) && (bVar1 = *(byte *)(uVar6 + 0x746c + (int)pvVar2), bVar1 != 0xff)))) { if ((bVar1 & 0x40) == 0) { if ((bVar1 & 0x10) == 0) { uVar5 = bVar1 >> 5 & 1; } else { uVar5 = 0xffffffff; } } else { uVar5 = 0; } bVar1 = *(byte *)((int)pvVar2 + uVar6 + 0x746c); if (uVar5 != 0) { if ((bVar1 & 0xf) != 0) { if ((int)uVar5 < 0) { outDirection->x = 0.0; outDirection->y = (float)&DAT_bf800000; return outDirection; } outDirection->x = 0.0; outDirection->y = 1.0; return outDirection; } if ((int)uVar5 < 0) { outDirection->x = (float)&DAT_bf800000; outDirection->y = (float)(bVar1 & 0xf); return outDirection; } outDirection->x = 1.0; outDirection->y = 0.0; return outDirection; } } outDirection->x = g_vectorZero.x; outDirection->y = fVar3; return outDirection; } //@@ 004bb6b0 NpcHelper::hornfel_next_rail_index /* DB: ? reads Room rail data at Hornfel's _targetPosition (+0x334) grid cell (bits 0x40/0x10/0x20 direction, low nibble), returns Room::GetGridIndex of the adjacent rail tile 40 units along it; Entity_NPC::Hornfel_UpdateAI */ int NpcHelper::hornfel_next_rail_index(void) { byte bVar1; Room *this; int iVar2; uint uVar3; int in_ECX; uint uVar4; int iVar5; undefined1 *puVar6; Vector local_c; this = g_game->_room; iVar5 = (int)((*(float *)(in_ECX + 0x334) - 40.0) / 40.0 + 0.5); if ((((-1 < iVar5) && (iVar5 < this->_gridWidth)) && (iVar2 = (int)((*(float *)(in_ECX + 0x338) - 120.0) / 40.0 + 0.5), -1 < iVar2)) && (((iVar2 < this->_gridHeight && (uVar4 = this->_gridWidth * iVar2 + iVar5, uVar4 < 0x1c0)) && (bVar1 = (this->_railManager)._sprite._filename._buf[uVar4 - 0x1c0], bVar1 != 0xff)))) { if ((bVar1 & 0x40) == 0) { if ((bVar1 & 0x10) == 0) { uVar3 = bVar1 >> 5 & 1; } else { uVar3 = 0xffffffff; } } else { uVar3 = 0; } if (uVar3 != 0) { if (((this->_railManager)._sprite._filename._buf[uVar4 - 0x1c0] & 0xfU) == 0) { if ((int)uVar3 < 0) { puVar6 = &DAT_bf800000; } else { puVar6 = (undefined1 *)0x3f800000; } local_c.x = (float)puVar6 * 40.0 + *(float *)(in_ECX + 0x334); local_c.y = *(float *)(in_ECX + 0x338) + 0.0; iVar5 = Room::GetGridIndex(this,&local_c); return iVar5; } if ((int)uVar3 < 0) { puVar6 = &DAT_bf800000; } else { puVar6 = (undefined1 *)0x3f800000; } local_c.x = *(float *)(in_ECX + 0x334) + 0.0; local_c.y = (float)puVar6 * 40.0 + *(float *)(in_ECX + 0x338); iVar5 = Room::GetGridIndex(this,&local_c); return iVar5; } } return -1; } //@@ 004bb830 NpcHelper::hornfel_set_anim /* DB: ? if state==3 sets/rewinds animation s_Open if not current */ void NpcHelper::hornfel_set_anim(undefined4 param_1) { byte *pbVar1; Manager *pMVar2; byte bVar3; byte *pbVar4; uint uVar5; int in_ECX; byte *pbVar6; bool bVar7; int local_8; if (*(int *)(in_ECX + 0xb64) != 3) goto LAB_004bb903; pbVar1 = *(byte **)(in_ECX + 0x7c); if (pbVar1 == (byte *)0x0) { LAB_004bb896: bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),s_Open,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x78)); *(undefined1 *)(in_ECX + 0x8c) = 1; } } else { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pbVar6 = s_Open; do { bVar3 = *pbVar4; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_004bb880: uVar5 = -(uint)bVar7 | 1; goto LAB_004bb885; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_004bb880; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004bb885: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(in_ECX + 0x8c) == '\0')))) goto LAB_004bb896; } pMVar2 = g_manager; local_8 = 0x24; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar2->_sfxManager,local_8,0.5,10,0,1.3,0.0); *(undefined4 *)(in_ECX + 0xb64) = 4; LAB_004bb903: *(undefined4 *)(in_ECX + 0x410) = param_1; return; } //@@ 004bb920 NpcHelper::hornfel_claim_target /* DB: ? ECX = Hornfel npc: returns false when it or its _parent already has a _target (+0x3c4); else sets _target of itself and its parent to arg (EntityPtr multiset bookkeeping), returns true; called right after Entity::GiveMinecart / SetMinecartPosVel in NpcHelper::hornfel_room_controller and hornfel_minecart (arg = the minecart rider) */ undefined4 NpcHelper::hornfel_claim_target(int *param_1) { int *piVar1; int *piVar2; int iVar3; int in_ECX; piVar2 = param_1; if ((*(int *)(in_ECX + 0x3c4) != 0) || ((iVar3 = *(int *)(in_ECX + 0x3bc), iVar3 != 0 && (*(int *)(iVar3 + 0x3c4) != 0)))) { return 0; } *(int *)(in_ECX + 0x3c4) = (int)param_1; if (param_1 != (int *)0x0) { std::multiset::insert((int *)(in_ECX + 0x3c4)); iVar3 = *(int *)(in_ECX + 0x3bc); } if (iVar3 != 0) { piVar1 = (int *)(iVar3 + 0x3c4); if (*(int *)(iVar3 + 0x3c4) != 0) { param_1 = piVar1; std::multiset::erase(¶m_1); } *piVar1 = (int)piVar2; if (piVar2 != (int *)0x0) { std::multiset::insert(piVar1); } } return 1; } //@@ 004bb9b0 NpcAI::ENTITY_HORNFEL_DOOR /* NPC AI for entity type 967 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HORNFEL_DOOR(Entity_NPC *npc) { byte bVar1; int iVar2; byte *pbVar3; uint uVar4; int hornfelRow; char *pcVar5; void *room; int hornfelGridIndex; bool bVar6; float fVar7; float hornfelSpeed; float fVar8; uint local_18; float local_14; float toDoorX; int doorGridIndex; void *savedRoom; byte *animData; undefined4 flagsHigh; Manager *manager; iVar2 = npc->_state; if (iVar2 == 0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 3; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb | 0x11; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_entityCollisionClass = 0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_sortingLayer = 1; ANM2::Play(&npc->_sprite,(byte *)"Closed",0); goto LAB_004bbdf0; } if (iVar2 == 3) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Closed",0); } room = g_game->_room; doorGridIndex = (int)(((npc->_targetPosition).x - 40.0) / 40.0 + 0.5); iVar2 = (int)(((npc->_targetPosition).y - 120.0) / 40.0 + 0.5); if ((((doorGridIndex < 0) || (*(int *)((int)room + 0xc) <= doorGridIndex)) || (iVar2 < 0)) || (*(int *)((int)room + 0x10) <= iVar2)) { doorGridIndex = -1; } else { doorGridIndex = *(int *)((int)room + 0xc) * iVar2 + doorGridIndex; } local_18 = 0; savedRoom = room; if (*(int *)((int)room + 0x1264) != 0) { do { iVar2 = *(int *)(*(int *)((int)room + 0x125c) + local_18 * 4); if ((*(int *)(iVar2 + 0x28) == 0x3c5) && (*(int *)(iVar2 + 0xb64) == 4)) { hornfelGridIndex = (int)((*(float *)(iVar2 + 0x33c) - 40.0) / 40.0 + 0.5); hornfelRow = (int)((*(float *)(iVar2 + 0x340) - 120.0) / 40.0 + 0.5); if (((hornfelGridIndex < 0) || ((local_14 = *(float *)((int)room + 0xc), (int)local_14 <= hornfelGridIndex || (hornfelRow < 0)))) || (*(int *)((int)room + 0x10) <= hornfelRow)) { local_14 = *(float *)((int)room + 0xc); hornfelGridIndex = -1; } else { hornfelGridIndex = (int)local_14 * hornfelRow + hornfelGridIndex; } toDoorX = ((float)(doorGridIndex % (int)local_14) * 40.0 + 40.0) - ((float)(hornfelGridIndex % (int)local_14) * 40.0 + 40.0); local_14 = ((float)(doorGridIndex / (int)local_14) * 40.0 + 120.0) - ((float)(hornfelGridIndex / (int)local_14) * 40.0 + 120.0); fVar7 = sqrtf(toDoorX * toDoorX + local_14 * local_14); if (0.0 < fVar7) { toDoorX = toDoorX * (1.0 / fVar7); local_14 = local_14 * (1.0 / fVar7); } fVar7 = *(float *)(iVar2 + 0x360); fVar8 = *(float *)(iVar2 + 0x364); hornfelSpeed = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (0.0 < hornfelSpeed) { fVar8 = fVar8 * (1.0 / hornfelSpeed); fVar7 = fVar7 * (1.0 / hornfelSpeed); } if ((hornfelGridIndex == doorGridIndex) || ((bVar1 = RoomGridPath::can_step ((void *)((int)savedRoom + 0x7468),hornfelGridIndex,doorGridIndex), bVar1 != 0 && (0.2 < toDoorX * fVar7 + local_14 * fVar8)))) { NpcHelper::hornfel_set_anim(0xf); } room = savedRoom; } local_18 = local_18 + 1; } while (local_18 < *(uint *)((int)room + 0x1264)); } goto LAB_004bbdf0; } if (iVar2 != 4) goto LAB_004bbdf0; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Opened",0); } if ((npc->_stateFrame < 1) || (iVar2 = npc->_stateFrame + -1, npc->_stateFrame = iVar2, iVar2 != 0)) goto LAB_004bbdf0; if (npc->_state == 4) { animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004bba6e: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Close",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar3 = animData; if (0xf < *(uint *)(animData + 0x14)) { pbVar3 = *(byte **)animData; } pcVar5 = "Close"; do { bVar1 = *pbVar3; bVar6 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_004bba58: uVar4 = -(uint)bVar6 | 1; goto LAB_004bba5d; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar6 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_004bba58; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_004bba5d: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004bba6e; } manager = g_manager; local_18 = 0x23; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,local_18,0.5,10,0,1.3,0.0); npc->_state = 3; } npc->_stateFrame = 0; LAB_004bbdf0: (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; return; } //@@ 004bbe30 Entity_Pickup::Render /* ZHL [prefix40/47] __thiscall void Entity_Pickup::Render(Vector *offset); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Pickup::Render(Entity_Pickup *this,Vector *offset) { void *layerFrame; uint uVar1; uint uVar2; uint uVar3; AnimationState *attachedAnimState; int iVar4; Vector *renderPos; float pixelScale; double dVar5; double dVar6; int layerOffset; uint layerIndex; void *animData; int layers; float offsetY; if ((this->_exists != 0) && (this->_visible != 0)) { pixelScale = g_displayPixelRatio * g_screenPointScale; dVar5 = floor((double)(((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * pixelScale + 0.5)); dVar6 = floor((double)(((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * pixelScale + 0.5)); offsetY = offset->y; (this->_renderPosition).x = (float)dVar5 / pixelScale + offset->x; (this->_renderPosition).y = (float)dVar6 / pixelScale + offsetY; animData = (this->_sprite)._animState._animData; if ((animData != (void *)0x0) && (layerIndex = 0, *(int *)((int)animData + 0x1c) != 0)) { layerOffset = 0; do { renderPos = &this->_renderPosition; iVar4 = *(int *)(layerOffset + *(int *)((int)animData + 0x18)); layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,iVar4); if ((layerFrame != (void *)0x0) && (*(char *)((int)layerFrame + 0x2c) != '\0')) { if (iVar4 == 5) { uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; uVar1 = (int)this[1]._priceANM2._playbackSpeed - 1; if (*(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & uVar1) * 4) + (uVar2 & 3) * 4) != 0) { renderPos = &this->_renderPosition; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & uVar1) * 4) + (uVar2 & 3) * 4); *(undefined4 *)(iVar4 + 0xdc) = *(undefined4 *)((int)layerFrame + 0x10); *(undefined4 *)(iVar4 + 0xe0) = *(undefined4 *)((int)layerFrame + 0x14); uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; *(undefined4 *) (*(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & (int)this[1]._priceANM2._playbackSpeed - 1U) * 4) + (uVar2 & 3) * 4) + 0xec) = *(undefined4 *)((int)layerFrame + 0x5c); uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & (int)this[1]._priceANM2._playbackSpeed - 1U) * 4) + (uVar2 & 3) * 4); *(undefined4 *)(iVar4 + 0xe4) = *(undefined4 *)((int)layerFrame + 0x18); *(undefined4 *)(iVar4 + 0xe8) = *(undefined4 *)((int)layerFrame + 0x1c); uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & (int)this[1]._priceANM2._playbackSpeed - 1U) * 4) + (uVar2 & 3) * 4); if (*(char *)(iVar4 + 0x151) != '\0') { attachedAnimState = (AnimationState *)(iVar4 + 0x98); if (*(char *)(iVar4 + 0xb8) == '\0') { AnimationState::Render ((AnimationState *)(iVar4 + 0x78),renderPos,&g_vectorZero,&g_vectorZero) ; } else { AnimationState::Render(attachedAnimState,renderPos,&g_vectorZero,&g_vectorZero); attachedAnimState = (AnimationState *)(iVar4 + 0x78); } AnimationState::Render(attachedAnimState,renderPos,&g_vectorZero,&g_vectorZero); } uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & (int)this[1]._priceANM2._playbackSpeed - 1U) * 4) + (uVar2 & 3) * 4); *(float *)(iVar4 + 0xdc) = g_vectorZero.x; *(float *)(iVar4 + 0xe0) = g_vectorZero.y; uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; *(undefined4 *) (*(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar2 >> 2 & (int)this[1]._priceANM2._playbackSpeed - 1U) * 4) + (uVar2 & 3) * 4) + 0xec) = 0; uVar2 = *(uint *)&this[1]._priceANM2.field_0x108; uVar3 = uVar2 >> 2; uVar1 = (int)this[1]._priceANM2._playbackSpeed - 1; LAB_004bc385: iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + (uVar3 & uVar1) * 4) + (uVar2 & 3) * 4); *(float *)(iVar4 + 0xe4) = g_vectorOne.x; *(float *)(iVar4 + 0xe8) = g_vectorOne.y; } } else if (iVar4 == 6) { uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; uVar1 = uVar2 & 3; uVar2 = uVar2 >> 2; if (*(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2) * 4) + uVar1 * 4) != 0) { iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2) * 4) + uVar1 * 4); *(undefined4 *)(iVar4 + 0xdc) = *(undefined4 *)((int)layerFrame + 0x10); *(undefined4 *)(iVar4 + 0xe0) = *(undefined4 *)((int)layerFrame + 0x14); uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; *(undefined4 *) (*(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2 >> 2) * 4) + (uVar2 & 3) * 4) + 0xec) = *(undefined4 *)((int)layerFrame + 0x5c); uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2 >> 2) * 4) + (uVar2 & 3) * 4); *(undefined4 *)(iVar4 + 0xe4) = *(undefined4 *)((int)layerFrame + 0x18); *(undefined4 *)(iVar4 + 0xe8) = *(undefined4 *)((int)layerFrame + 0x1c); uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2 >> 2) * 4) + (uVar2 & 3) * 4); if (*(char *)(iVar4 + 0x151) != '\0') { attachedAnimState = (AnimationState *)(iVar4 + 0x98); if (*(char *)(iVar4 + 0xb8) == '\0') { AnimationState::Render ((AnimationState *)(iVar4 + 0x78),renderPos,&g_vectorZero,&g_vectorZero) ; } else { AnimationState::Render(attachedAnimState,renderPos,&g_vectorZero,&g_vectorZero); attachedAnimState = (AnimationState *)(iVar4 + 0x78); } AnimationState::Render(attachedAnimState,renderPos,&g_vectorZero,&g_vectorZero); } uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; iVar4 = *(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2 >> 2) * 4) + (uVar2 & 3) * 4); *(float *)(iVar4 + 0xdc) = g_vectorZero.x; *(float *)(iVar4 + 0xe0) = g_vectorZero.y; uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; *(undefined4 *) (*(int *)(*(int *)(*(int *)&this[1]._priceANM2._flipX + ((int)this[1]._priceANM2._playbackSpeed - 1U & uVar2 >> 2) * 4) + (uVar2 & 3) * 4) + 0xec) = 0; uVar3 = (int)this[1]._priceANM2._playbackSpeed - 1; uVar2 = *(int *)&this[1]._priceANM2.field_0x108 + 1; uVar1 = uVar2 >> 2; goto LAB_004bc385; } } else { layers = *(int *)((int)animData + 0x18); if ((((iVar4 < 0) || (*(int *)((int)(this->_sprite)._animState._animation + 0x80) <= iVar4)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), iVar4 < 0)) || (*(int *)((int)(this->_sprite)._animState._animation + 0x80) <= iVar4)) { iVar4 = 0; } else { iVar4 = *(int *)((int)(this->_sprite)._animState._layerFrames + *(int *)((int)(this->_sprite)._animState._animData + iVar4 * 4 + 0x38) * 4); } AnimationLayer::RenderFrame ((AnimationLayer *)(layers + layerOffset),renderPos,iVar4,&g_vectorZero, &g_vectorZero,&this->_sprite); } } layerIndex = layerIndex + 1; layerOffset = layerOffset + 0x10; } while (layerIndex < *(uint *)((int)animData + 0x1c)); } } return; } //@@ 004bc460 NpcHelper::hornfel_room_controller /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: effect 1000.152 update (Entity_Effect::Update case 005da269): passing carts (boss_approx_3) */ uint NpcHelper::hornfel_room_controller(void) { void *pvVar1; undefined4 uVar2; int iVar3; uint uVar4; Entity_NPC *npc; Entity *this; int *in_ECX; uint uVar5; int iVar6; Vector VStack_4c; uint auStack_44 [16]; auStack_44[0xe] = __security_cookie ^ (uint)&VStack_4c; pvVar1 = g_game->_room; if (in_ECX[0x114] == 0) { hornfel_spawn_doors(); uVar4 = Random(); in_ECX[0x114] = 1; iVar6 = uVar4 % 0xd2 + 0x96; in_ECX[0x117] = iVar6; in_ECX[0x118] = iVar6; return uVar4 / 0xd2; } if ((*(byte *)(*(int *)((int)pvVar1 + 4) + 0x44) & 1) != 0) { hornfel_remove_doors(); (**(code **)(*in_ECX + 0x28))(); } uVar5 = *(int *)((int)pvVar1 + 0x12cc) + *(int *)((int)pvVar1 + 0x12c8); uVar4 = 0; if (0 < (int)uVar5) { uVar4 = uVar5; } if ((0 < (int)uVar4) && (*(char *)((int)in_ECX + 0x173) != '\0')) { npc = (Entity_NPC *)hornfel_free_door(); if (npc != (Entity_NPC *)0x0) { hornfel_get_rail_direction(npc,&VStack_4c); if ((VStack_4c.x != g_vectorZero.x) || (VStack_4c.y != g_vectorZero.y)) { auStack_44[0] = 0x337; auStack_44[1] = 0; auStack_44[2] = 0x334; auStack_44[3] = 0; auStack_44[0xc] = 0x124; auStack_44[4] = 0x33b; auStack_44[5] = 0; auStack_44[6] = 0xe3; auStack_44[7] = 0; auStack_44[0xd] = 0; auStack_44[8] = 0x57; auStack_44[9] = 0; auStack_44[10] = 0x21; auStack_44[0xb] = 0; uVar4 = Random(); uVar5 = Random(); this = Game::SpawnEx(g_game,auStack_44[(uVar4 % 7) * 2],auStack_44[(uVar4 % 7) * 2 + 1], &g_vectorZero,&g_vectorZero,(Entity *)0x0,0,uVar5,0); uVar2 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags & 0xfffffffb; *(undefined4 *)((int)&this->_flags + 4) = uVar2; this->_spawnerType = 0x38a; Entity::GiveMinecart(this,&npc->_targetPosition,&VStack_4c); hornfel_claim_target(this); } } uVar4 = Random(); uVar5 = uVar4 % 0xd2 + 0x96; iVar6 = *(int *)((int)g_game->_room + 0x10); iVar3 = *(int *)((int)g_game->_room + 0xc); *(undefined1 *)((int)in_ECX + 0x173) = 0; uVar4 = uVar5 / 2; if (iVar6 * iVar3 < 0x88) { uVar4 = uVar5; } in_ECX[0x117] = uVar4; in_ECX[0x118] = uVar4; } return uVar4; } //@@ 004bc660 FUN_004bc660 undefined4 FUN_004bc660(void) { int *in_ECX; return CONCAT31((int3)((uint)*in_ECX >> 8),*in_ECX == in_ECX[1]); } //@@ 004bc670 EntityRef::IsCharmed /* ZHL [lua] Lua binding EntityRef:IsCharmed */ byte __thiscall EntityRef::IsCharmed(EntityRef *this) { return (byte)this->_flags & 1; } //@@ 004bc680 NpcHelper::horny_boys_pick_position /* DB: ? zeroes ECX+0x334 target, loops Room::GetRandomPosition(20) until the grid cell is valid and far enough from Game::GetNearestPlayer; two calls in NpcAI::ENTITY_HORNY_BOYS */ int NpcHelper::horny_boys_pick_position(void) { void *pvVar1; Entity_Player *pEVar2; Vector *pVVar3; undefined2 uVar4; int in_ECX; Game *pGVar5; int iVar6; int iVar7; int iVar8; uint uVar9; float fVar10; float fVar11; float fVar12; Vector local_28; float local_20; float local_1c; int local_18; float local_14; pGVar5 = g_game; local_14 = 0.0; local_18 = 6; *(float *)(in_ECX + 0x334) = g_vectorZero.x; *(float *)(in_ECX + 0x338) = g_vectorZero.y; do { Room::GetRandomPosition(pGVar5->_room,&local_28,20.0); pvVar1 = g_game->_room; iVar8 = (int)((local_28.x - 40.0) / 40.0 + 0.5); iVar7 = (int)((local_28.y - 120.0) / 40.0 + 0.5); if ((((iVar8 < 0) || (iVar6 = *(int *)((int)pvVar1 + 0xc), iVar6 <= iVar8)) || (iVar7 < 0)) || (*(int *)((int)pvVar1 + 0x10) <= iVar7)) { iVar6 = *(int *)((int)pvVar1 + 0xc); uVar9 = 0xffffffff; } else { uVar9 = iVar6 * iVar7 + iVar8; } local_28.x = (float)((int)uVar9 % iVar6) * 40.0 + 40.0; local_28.y = (float)((int)uVar9 / iVar6) * 40.0 + 120.0; local_20 = local_28.y; local_1c = local_28.x; pEVar2 = Game::GetNearestPlayer(g_game,&local_28); pGVar5 = g_game; pVVar3 = &pEVar2->_pos; fVar10 = local_1c - pVVar3->x; fVar11 = local_20 - (pEVar2->_pos).y; fVar12 = fVar11 * fVar11 + fVar10 * fVar10; if (((((20.0 <= ABS(fVar10)) && (20.0 <= ABS(fVar11))) || (160000.0 <= fVar12)) && ((40000.0 <= fVar12 && ((0x1bf < uVar9 || (pVVar3 = g_game->_room, (int)*(uint *)((int)(pVVar3 + 0xed) + (uVar9 + 1) * 4) < 500))))) ) && (fVar10 = *(float *)(in_ECX + 0x33c) - local_1c, fVar11 = *(float *)(in_ECX + 0x340) - local_20, fVar10 = fVar11 * fVar11 + fVar10 * fVar10, local_14 < fVar10)) { *(float *)(in_ECX + 0x334) = local_1c; *(float *)(in_ECX + 0x338) = local_20; local_14 = fVar10; } local_18 = local_18 + -1; } while (local_18 != 0); fVar10 = *(float *)(in_ECX + 0x334); uVar4 = (undefined2)((uint)pVVar3 >> 0x10); iVar7 = (uint)CONCAT21(uVar4,(fVar10 == g_vectorZero.x) << 6 | (NAN(fVar10) || NAN(g_vectorZero.x)) << 2 | 2U | fVar10 < g_vectorZero.x) << 8; if (fVar10 == g_vectorZero.x) { fVar10 = *(float *)(in_ECX + 0x338); iVar7 = (uint)CONCAT21(uVar4,(fVar10 == g_vectorZero.y) << 6 | (NAN(fVar10) || NAN(g_vectorZero.y)) << 2 | 2U | fVar10 < g_vectorZero.y) << 8; if (fVar10 == g_vectorZero.y) { return iVar7; } } return CONCAT31((int3)((uint)iVar7 >> 8),1); } //@@ 004bc8c0 NpcHelper::horny_boys_pull_entity /* DB: ? (slot, targetPos): entity from ring +0xbf4/+0xbf8/+0xbfc, only type 4 (bomb), sets its parent +0x3bc to npc and velocity toward target scaled 10..28 */ int * NpcHelper::horny_boys_pull_entity(undefined4 *param_1,float *param_2) { int *piVar1; undefined4 *puVar2; int iVar3; int in_ECX; uint uVar4; uint uVar5; int *piVar6; float fVar7; float fVar8; int *local_c; float local_8; local_c = *(int **)(in_ECX + 0xbfc); uVar4 = (uint)((int)param_1 + (int)local_c) >> 2; uVar5 = (int)param_1 + (int)local_c & 3; if (*(int *)(*(int *)(*(int *)(in_ECX + 0xbf4) + (*(int *)(in_ECX + 0xbf8) - 1U & uVar4) * 4) + uVar5 * 4) == 0) { return (int *)0x0; } piVar6 = *(int **)(*(int *)(*(int *)(in_ECX + 0xbf4) + (*(int *)(in_ECX + 0xbf8) - 1U & uVar4) * 4 ) + uVar5 * 4); if ((piVar6 == (int *)0x0) || (piVar6[10] != 4)) { piVar6 = (int *)0x0; } else { fVar8 = *(float *)(in_ECX + 0x33c) - *param_2; local_8 = param_2[1]; fVar7 = *(float *)(in_ECX + 0x340) - local_8; param_2 = (float *)*param_2; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); param_2 = (float *)((float)param_2 - *(float *)(in_ECX + 0x33c)); fVar7 = (fVar7 - 100.0) / 200.0; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } local_c = (int *)(fVar7 * 18.0 + 10.0); local_8 = local_8 - *(float *)(in_ECX + 0x340); fVar7 = sqrtf(local_8 * local_8 + (float)param_2 * (float)param_2); if (0.0 < fVar7) { local_8 = (1.0 / fVar7) * local_8; param_2 = (float *)((1.0 / fVar7) * (float)param_2); } param_2 = (float *)((float)param_2 * (float)local_c); piVar1 = piVar6 + 0xef; local_8 = local_8 * (float)local_c; if (*piVar1 != 0) { local_c = piVar1; std::multiset::erase(&local_c); } *piVar1 = in_ECX; if (in_ECX != 0) { std::multiset::insert(piVar1); } piVar6[0x62] = 4; *(undefined1 *)((int)piVar6 + 0x171) = 1; piVar6[0x107] = -0x3f800000; piVar6[0xd3] = 0; piVar6[0xd4] = -0x3e400000; piVar6[0xcf] = *(int *)(in_ECX + 0x33c); iVar3 = *(int *)(in_ECX + 0x340); piVar6[0x5a] = piVar6[0x5a] & 0xffffffdf; piVar6[0xd0] = iVar3; piVar6[0x5b] = piVar6[0x5b]; piVar6[0xd8] = (int)param_2; piVar6[0xd9] = (int)local_8; (**(code **)(*piVar6 + 0xc))(); } uVar4 = (int)param_1 + *(int *)(in_ECX + 0xbfc); uVar5 = uVar4 & 3; iVar3 = *(int *)(*(int *)(in_ECX + 0xbf4) + (uVar4 >> 2 & *(int *)(in_ECX + 0xbf8) - 1U) * 4); puVar2 = (undefined4 *)(iVar3 + uVar5 * 4); if (*(int *)(iVar3 + uVar5 * 4) != 0) { param_1 = puVar2; std::multiset::erase(¶m_1); } *puVar2 = 0; return piVar6; } //@@ 004bcb30 FUN_004bcb30 EntityPtr FUN_004bcb30(undefined4 param_1,uint param_2) { EntityPtr *pEVar1; int iVar2; uint seed; EntityPtr EVar3; EntityPtr in_ECX; EntityPtr *pEStack_10; uint local_c; local_c = *(uint *)((int)in_ECX + 0xbfc); if (*(int *)(*(int *)(*(int *)((int)in_ECX + 0xbf4) + (*(int *)((int)in_ECX + 0xbf8) - 1U & local_c >> 2) * 4) + (local_c & 3) * 4) != 0) { (**(code **)(**(int **)(*(int *)(*(int *)((int)in_ECX + 0xbf4) + (*(int *)((int)in_ECX + 0xbf8) - 1U & local_c >> 2) * 4) + (local_c & 3) * 4) + 0x28))(); } seed = Random(); EVar3 = (EntityPtr) Game::SpawnEx(g_game,4,param_2,(Vector *)((int)in_ECX + 0x33c),&g_vectorZero, (Entity *)in_ECX,0,seed,0); pEVar1 = (EntityPtr *)((int)EVar3 + 0x3bc); *(undefined1 *)((int)EVar3 + 0x171) = 0; *(undefined4 *)((int)EVar3 + 0x188) = 0; *(undefined4 *)((int)EVar3 + 0x184) = 0; if (*(EntityPtr *)((int)EVar3 + 0x3bc) != (EntityPtr)0x0) { pEStack_10 = pEVar1; std::multiset::erase(&pEStack_10); } *pEVar1 = in_ECX; if (in_ECX != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } *(uint *)((int)EVar3 + 0x168) = *(uint *)((int)EVar3 + 0x168) | 0x20; *(undefined4 *)((int)EVar3 + 0x16c) = *(undefined4 *)((int)EVar3 + 0x16c); local_c = *(uint *)((int)in_ECX + 0xbfc); iVar2 = *(int *)(*(int *)((int)in_ECX + 0xbf4) + (local_c >> 2 & *(int *)((int)in_ECX + 0xbf8) - 1U) * 4); pEVar1 = (EntityPtr *)(iVar2 + (local_c & 3) * 4); if (*(int *)(iVar2 + (local_c & 3) * 4) != 0) { pEStack_10 = pEVar1; std::multiset::erase(&pEStack_10); } *pEVar1 = EVar3; std::multiset::insert(pEVar1); return EVar3; } //@@ 004bcc70 NpcHelper::horny_boys_spawn_bomb /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called twice by NpcAI::ENTITY_HORNY_BOYS (0x4bd4c9, 0x4bdc52) with npc in ECX; WeightedOutcomePicker over bomb variants 6/8/16, Game::Spawn(4,variant,npc+0x33c,...,spawner=npc), sets bomb spawner multiset ref prototype: db/protos.zhl, confirmed by RET 4 */ Entity * NpcHelper::horny_boys_spawn_bomb(Entity_NPC *npc,int slot) { int iVar1; RNG rng; undefined1 *puVar2; EntityPtr EVar3; uint uVar4; WeightedOutcomePicker ptr; uint uVar5; int bombTearFlags0; int bombTearFlags1; int bombTearFlags2; int bombTearFlags3; undefined8 uStack_3c; EntityPtr *pEStack_34; WeightedOutcomePicker picker; undefined4 *outcomesEnd; undefined4 *outcomesCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; undefined4 local_14; EntityPtr *bombSlot; int *outcomeWeight; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &DAT_00af350d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; uVar4 = slot + (npc->_entityDeque)._offset; uVar5 = uVar4 >> 2; uVar4 = uVar4 & 3; puVar2 = (undefined1 *)((int)register0x00000010 + -4); if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar5) * 4) + uVar4 * 4) != 0) { pEStack_34 = (EntityPtr *)(npc->_entityDeque)._offset; (**(code **)(**(int **)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar5) * 4) + uVar4 * 4) + 0x28))(local_24); puVar2 = puStack_20; } puStack_20 = puVar2; picker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacity = (undefined4 *)0x0; local_14 = 0; uStack_3c = (ulonglong)(uint)uStack_3c; pEStack_34 = (EntityPtr *)0x6; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_3c + 4); uVar4 = 0; uVar5 = (int)outcomesEnd - (int)picker >> 3; if (uVar5 != 0) { do { if (*(int *)((int)picker + uVar4 * 8) == 8) { outcomeWeight = (int *)((int)picker + 4 + uVar4 * 8); *outcomeWeight = *outcomeWeight + 3; if (*outcomeWeight < 0) { *(undefined4 *)((int)picker + 4 + uVar4 * 8) = 0; } goto LAB_004bcda7; } uVar4 = uVar4 + 1; } while (uVar4 < uVar5); } uStack_3c = CONCAT44(8,(uint)uStack_3c); pEStack_34 = (EntityPtr *)0x3; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_3c + 4); } else { *outcomesEnd = 8; outcomesEnd[1] = 3; outcomesEnd = outcomesEnd + 2; } LAB_004bcda7: uVar4 = 0; uVar5 = (int)outcomesEnd - (int)picker >> 3; if (uVar5 != 0) { do { if (*(int *)((int)picker + uVar4 * 8) == 0x10) { outcomeWeight = (int *)((int)picker + 4 + uVar4 * 8); *outcomeWeight = *outcomeWeight + 1; if (*outcomeWeight < 0) { *(undefined4 *)((int)picker + 4 + uVar4 * 8) = 0; } goto LAB_004bce05; } uVar4 = uVar4 + 1; } while (uVar4 < uVar5); } uStack_3c = CONCAT44(0x10,(uint)uStack_3c); pEStack_34 = (EntityPtr *)0x1; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,(int)&uStack_3c + 4); } else { *outcomesEnd = 0x10; outcomesEnd[1] = 1; outcomesEnd = outcomesEnd + 2; } LAB_004bce05: uVar4 = Random(); uStack_3c = 0x900000005; pEStack_34 = (EntityPtr *)&DAT_00000007; rng._shift1 = 5; rng._seed = uVar4 | 1; rng._shift2 = 9; rng._shift3 = 7; uVar4 = WeightedOutcomePicker::PickOutcome(&picker,rng); if (uVar4 == 8) { bombTearFlags0 = DAT_00c34c00; bombTearFlags1 = DAT_00c34c04; bombTearFlags2 = DAT_00c34c08; bombTearFlags3 = DAT_00c34c0c; } else if (uVar4 == 0x10) { bombTearFlags0 = DAT_00c34b90; bombTearFlags1 = DAT_00c34b94; bombTearFlags2 = DAT_00c34b98; bombTearFlags3 = DAT_00c34b9c; } else { bombTearFlags0 = 0; bombTearFlags1 = 0; bombTearFlags2 = 0; bombTearFlags3 = 0; } uVar5 = Random(); EVar3 = (EntityPtr)Game::Spawn(g_game,4,uVar4,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); *(byte *)((int)EVar3 + 0x171) = 0; *(int *)((int)EVar3 + 0x188) = 0; *(int *)((int)EVar3 + 0x184) = 0; if (*(EntityPtr *)((int)EVar3 + 0x3bc) != (EntityPtr)0x0) { pEStack_34 = (EntityPtr *)((int)EVar3 + 0x3bc); std::multiset::erase(&pEStack_34); } *(EntityPtr *)((int)EVar3 + 0x3bc) = (EntityPtr)npc; if (npc != (Entity_NPC *)0x0) { std::multiset::insert((EntityPtr *)((int)EVar3 + 0x3bc)); } *(uint *)((int)EVar3 + 0x168) = *(uint *)((int)EVar3 + 0x168) | 0x20; *(undefined4 *)((int)EVar3 + 0x16c) = *(undefined4 *)((int)EVar3 + 0x16c); iVar1 = *(int *)EVar3; *(undefined4 *)&((Entity *)((int)EVar3 + 0x40c))->field_0x4 = 0x23; (((Entity *)((int)EVar3 + 0x40c))->_damageEvents)._begin = (void *)0x23; ((Entity *)((int)EVar3 + 0x40c))->_variant = bombTearFlags0; ((Entity *)((int)EVar3 + 0x40c))->_subtype = bombTearFlags1; ((Entity *)((int)EVar3 + 0x40c))->_spawnerType = bombTearFlags2; ((Entity *)((int)EVar3 + 0x40c))->_spawnerVariant = bombTearFlags3; (((Entity *)((int)EVar3 + 0x40c))->_sprite)._filename._buf[0xf] = '\x01'; (**(code **)(iVar1 + 0xc))(); pEStack_34 = (EntityPtr *)(npc->_entityDeque)._offset; uVar4 = (int)&pEStack_34->field_0x0 + slot; uVar5 = uVar4 & 3; iVar1 = *(int *)((int)(npc->_entityDeque)._map + (uVar4 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); bombSlot = (EntityPtr *)(iVar1 + uVar5 * 4); if (*(int *)(iVar1 + uVar5 * 4) != 0) { pEStack_34 = bombSlot; std::multiset::erase(&pEStack_34); } *bombSlot = EVar3; std::multiset::insert(bombSlot); if (picker != (WeightedOutcomePicker)0x0) { uVar4 = (int)outcomesCapacity - (int)picker & 0xfffffff8; ptr = picker; if (0xfff < uVar4) { ptr = *(WeightedOutcomePicker *)((int)picker + -4); uVar4 = uVar4 + 0x23; if (0x1f < ((int)picker - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar4); } ExceptionList = local_1c; return (Entity *)EVar3; } //@@ 004bcfd0 NpcHelper::horny_boys_render /* DB: ? Entity_NPC::Render case 0x398 (920 ENTITY_HORNY_BOYS) calls it with the NPC in ECX; parallax screen placement ((pos-60/140)*0.65 + (g_screenWidth-338)/2), renders layers 3..5 for linked segment entities from the deque +0xbf4 via AnimationState::Render */ void NpcHelper::horny_boys_render(Vector *param_1) { Vector *position; float fVar1; void *pvVar2; int iVar3; void *pvVar4; Entity *in_ECX; AnimationState *this; uint uVar5; float fVar6; double dVar7; double dVar8; uint local_5c; int local_54; Entity::Render(in_ECX,param_1); fVar6 = g_displayPixelRatio * g_screenPointScale; dVar7 = floor((double)(((((in_ECX->_posOffset).x + (in_ECX->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar6 + 0.5)); dVar8 = floor((double)(((((in_ECX->_pos).y + (in_ECX->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar6 + 0.5)); position = &in_ECX->_renderPosition; fVar1 = param_1->y; position->x = (float)dVar7 / fVar6 + param_1->x; (in_ECX->_renderPosition).y = (float)dVar8 / fVar6 + fVar1; pvVar2 = (in_ECX->_sprite)._animState._animData; if ((pvVar2 != (void *)0x0) && (local_5c = 0, *(int *)((int)pvVar2 + 0x1c) != 0)) { local_54 = 0; do { iVar3 = *(int *)(local_54 + *(int *)((int)pvVar2 + 0x18)); pvVar4 = AnimationState::GetLayerFrame(&(in_ECX->_sprite)._animState,iVar3); if ((((pvVar4 != (void *)0x0) && (*(char *)((int)pvVar4 + 0x2c) != '\0')) && (iVar3 - 3U < 3)) && (uVar5 = in_ECX[2]._dropRNG._shift2 + -3 + iVar3, iVar3 = *(int *)(*(int *)(in_ECX[2]._dropRNG._seed + (uVar5 >> 2 & in_ECX[2]._dropRNG._shift1 - 1U) * 4) + (uVar5 & 3) * 4), iVar3 != 0)) { *(undefined4 *)(iVar3 + 0xdc) = *(undefined4 *)((int)pvVar4 + 0x10); *(undefined4 *)(iVar3 + 0xe0) = *(undefined4 *)((int)pvVar4 + 0x14); *(undefined4 *)(iVar3 + 0xec) = *(undefined4 *)((int)pvVar4 + 0x5c); *(undefined4 *)(iVar3 + 0xe4) = *(undefined4 *)((int)pvVar4 + 0x18); *(undefined4 *)(iVar3 + 0xe8) = *(undefined4 *)((int)pvVar4 + 0x1c); if (*(char *)(iVar3 + 0x151) != '\0') { if (*(char *)(iVar3 + 0xb8) == '\0') { AnimationState::Render ((AnimationState *)(iVar3 + 0x78),position,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(iVar3 + 0x98); } else { AnimationState::Render ((AnimationState *)(iVar3 + 0x98),position,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(iVar3 + 0x78); } AnimationState::Render(this,position,&g_vectorZero,&g_vectorZero); } *(float *)(iVar3 + 0xdc) = g_vectorZero.x; *(float *)(iVar3 + 0xe0) = g_vectorZero.y; *(undefined4 *)(iVar3 + 0xec) = 0; *(float *)(iVar3 + 0xe4) = g_vectorOne.x; *(float *)(iVar3 + 0xe8) = g_vectorOne.y; } local_5c = local_5c + 1; local_54 = local_54 + 0x10; } while (local_5c < *(uint *)((int)pvVar2 + 0x1c)); } return; } //@@ 004bd2a0 NpcAI::ENTITY_HORNY_BOYS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 920 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HORNY_BOYS(Entity_NPC *npc) { Vector *position; undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; byte isEventTriggered; char isPositionFound; float *pfVar5; LayerState *layer; Entity *tmpEntity; void *overlayNull; int iVar6; ColorMod *color; Entity_Projectile *projectile; uint rngResult; undefined4 extraout_ECX; undefined4 extraout_ECX_00; int iVar7; uint uVar8; float fVar9; float stepY; float fVar10; float friction; float fVar11; Vector *velocity; Vector scratchVec; float local_f8; float local_f4; EntityPtr EStack_f0; EntityPtr *pEStack_ec; Vector flySpawnPos; ProjectileParams projParams; Color tmpColor; uint stackCookie; Room *room; float speedMultiplier; stackCookie = __security_cookie ^ (uint)&scratchVec; room = g_game->_room; local_f4 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_aiCallPhase == 1) { pfVar5 = (npc->_damageEvents)._begin; if (pfVar5 != (npc->_damageEvents)._end) { do { if ((((uint)pfVar5[0xc] & 3) == 0) && ((((((uint)pfVar5[2] & 4) != 0 && (pfVar5[6] != 1.4013e-45)) && (pfVar5[4] != 1.4013e-45) ) || (((((uint)pfVar5[2] & 8) != 0 && (pfVar5[4] == (float)npc->_type)) || ((pfVar5[4] == 1.4013e-42 && ((pfVar5[5] == 2.05991e-43 && (pfVar5[6] != 1.4013e-45)))))))))) { npc->_pendingDamage = npc->_pendingDamage - *pfVar5; *pfVar5 = 0.0; } pfVar5 = pfVar5 + 0xe; } while (pfVar5 != (npc->_damageEvents)._end); } if (0.0 < npc->_pendingDamage || npc->_pendingDamage == 0.0) { return; } npc->_pendingDamage = 0.0; return; } switch(npc->_state) { case 0: npc->_state = 3; Entity_NPC::ClearDequeRefs(npc); local_f4 = 0.0; std::deque::resize(3,&local_f4); npc->_entityGridCollisionClass = 3; npc->_stateFrame = 0; npc->_aiCallFlags = 1; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x3); layer->_visible = 0; layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000004); layer->_visible = 0; layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000005); layer->_visible = 0; break; case 3: npc->_friction = npc->_friction * 0.8; PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); } npc->_stateFrame = npc->_stateFrame + (int)local_f4; if (npc->_stateFrame < 0x3c) break; switch(npc->_i2) { case 0: npc->_state = 0xd; ANM2::Play(&npc->_sprite,(byte *)"SpawnFly",0); break; case 1: npc->_state = 10; ANM2::Play(&npc->_sprite,(byte *)"JuggleStart",0); npc->_stateFrame = 0; NpcHelper::horny_boys_spawn_bomb(npc,0); npc->_i1 = 0; goto switchD_004bd47d_default; case 2: npc->_state = 0xb; ANM2::Play(&npc->_sprite,(byte *)"LokiDance",0); npc->_i1 = 0; break; case 3: uVar8 = Random(); if ((uVar8 & 1) == 0) { npc->_state = 9; ANM2::Play(&npc->_sprite,(byte *)"BombPoof",0); fVar9 = npc->_maxHitPoints * 0.33; iVar6 = (uint)(npc->_health <= fVar9 && fVar9 != npc->_health) * 2 + 5; } else { npc->_state = 6; ANM2::Play(&npc->_sprite,(byte *)"TeleportUp",0); fVar9 = npc->_maxHitPoints * 0.33; iVar6 = (uint)(npc->_health <= fVar9 && fVar9 != npc->_health) * 2 + 3; } npc->_i1 = iVar6; break; default: goto switchD_004bd47d_default; } npc->_stateFrame = 0; switchD_004bd47d_default: npc->_i2 = npc->_i2 + 1; if (3 < npc->_i2) { npc->_i2 = 0; } break; case 6: npc->_friction = npc->_friction * 0.7; isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (isEventTriggered != 0) { npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (isPositionFound = NpcHelper::horny_boys_pick_position(), isPositionFound != '\0')) { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; ANM2::Play(&npc->_sprite,(byte *)"TeleportDown",0); iVar6 = FUN_004bcb30(extraout_ECX,0xf); *(undefined4 *)(iVar6 + 0x410) = 0x19; *(undefined4 *)(iVar6 + 0x414) = 0x19; npc->_state = 8; } break; case 7: npc->_friction = npc->_friction * 0.7; isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isEventTriggered != 0) { npc->_shadowSize = *(float *)((int)npc->_config + 0x24); npc->_entityCollisionClass = 4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; iVar6 = npc->_i1 + -1; npc->_i1 = iVar6; if (0 < iVar6) { ANM2::Play(&npc->_sprite,(byte *)"BombPoof",0); npc->_state = 9; npc->_stateFrame = 0; break; } goto LAB_004bd955; case 8: npc->_friction = npc->_friction * 0.7; isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (isEventTriggered != 0) { npc->_shadowSize = *(float *)((int)npc->_config + 0x24); npc->_entityCollisionClass = 4; } isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isEventTriggered != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; NpcHelper::horny_boys_pull_entity(0,&scratchVec); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; iVar6 = npc->_i1 + -1; npc->_i1 = iVar6; if (0 < iVar6) { ANM2::Play(&npc->_sprite,(byte *)"TeleportUp",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,20.0); } npc->_state = 6; npc->_stateFrame = 0; break; } goto LAB_004bd955; case 9: npc->_friction = npc->_friction * 0.7; isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (isEventTriggered != 0) { iVar6 = FUN_004bcb30(extraout_ECX_00,0x10); *(undefined4 *)(iVar6 + 0x410) = 2; *(undefined4 *)(iVar6 + 0x414) = 2; uVar4 = DAT_00c34b9c; uVar3 = DAT_00c34b98; uVar2 = DAT_00c34b94; uVar1 = DAT_00c34b90; *(undefined1 *)(iVar6 + 0x463) = 1; *(undefined4 *)(iVar6 + 0x438) = uVar1; *(undefined4 *)(iVar6 + 0x43c) = uVar2; *(undefined4 *)(iVar6 + 0x440) = uVar3; *(undefined4 *)(iVar6 + 0x444) = uVar4; } isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isEventTriggered != 0) { iVar6 = NpcHelper::horny_boys_pull_entity(0,&npc->_pos); *(undefined4 *)(iVar6 + 0x41c) = 0x40a00000; } if ((npc->_entityCollisionClass != 0) && (overlayNull = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"OverlayFrame"), overlayNull == (void *)0x0)) { npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; uVar8 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar8,0); (**(code **)(*(int *)tmpEntity + 0xc))(); } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (isPositionFound = NpcHelper::horny_boys_pick_position(), isPositionFound != '\0')) { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; ANM2::Play(&npc->_sprite,(byte *)"BombPoofBack",0); npc->_state = 7; uVar8 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar8,0); (**(code **)(*(int *)tmpEntity + 0xc))(); } break; case 10: friction = npc->_friction * 0.8; fVar9 = (npc->_velocity).x; fVar11 = 0.55; fVar10 = 0.55; npc->_friction = friction; if (fVar9 < 0.0) { fVar10 = -0.55; } pfVar5 = &(npc->_velocity).y; if (*pfVar5 <= 0.0 && *pfVar5 != 0.0) { fVar11 = -0.55; } if (friction != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = (fVar10 * speedMultiplier) / friction + fVar9; (npc->_velocity).y = (fVar11 * speedMultiplier) / friction + (npc->_velocity).y; } isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isEventTriggered != 0) { iVar6 = npc->_i1; if (((iVar6 == 1) || (iVar6 == 2)) && (scratchVec.y = (float)(npc->_entityDeque)._offset, *(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & (uint)((int)scratchVec.y + iVar6) >> 2 ) * 4) + ((int)scratchVec.y + iVar6 & 3U) * 4) == 0)) { NpcHelper::horny_boys_spawn_bomb(npc,iVar6); } else if (3 < iVar6) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); iVar6 = npc->_i1; EStack_f0 = (EntityPtr)((tmpEntity->_pos).x - (npc->_pos).x); pEStack_ec = (EntityPtr *)((tmpEntity->_pos).y - (npc->_pos).y); local_f8 = ((float)(iVar6 + -5) * 30.0 - 30.0) * 0.017453292; local_f4 = cos(local_f8); fVar9 = sin(local_f8); scratchVec.x = ((float)EStack_f0 * local_f4 - (float)pEStack_ec * fVar9) + (npc->_pos).x; scratchVec.y = (float)pEStack_ec * local_f4 + (float)EStack_f0 * fVar9 + (npc->_pos).y; iVar6 = NpcHelper::horny_boys_pull_entity((&PTR_s_LokiDance5_00b5feb8)[iVar6],&scratchVec); if (iVar6 != 0) { Entity::GetNullOffset((Entity *)npc,&scratchVec,(byte *)"BombGuide"); fVar9 = (npc->_pos).y; *(float *)(iVar6 + 0x33c) = scratchVec.x + (npc->_pos).x; *(float *)(iVar6 + 0x340) = fVar9 + 0.0; } Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); npc->_i1 = npc->_i1 + 1; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; iVar6 = npc->_i1; if (iVar6 < 3) { ANM2::Play(&npc->_sprite,(&PTR_s_Juggle0_00b5febc)[iVar6],0); npc->_i1 = npc->_i1 + 1; Entity_NPC::PlaySound(npc,0xf9,1.0,2,0,1.0); break; } if (iVar6 == 3) { ANM2::Play(&npc->_sprite,(byte *)"JuggleThrow",0); npc->_i1 = npc->_i1 + 1; break; } LAB_004bd955: ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_stateFrame = 0; npc->_i1 = 0; break; case 0xb: position = &npc->_pos; npc->_friction = npc->_friction * 0.7; Room::GetClampedPositionImpl(room,&scratchVec,position,80.0,80.0,80.0,80.0); local_f8 = (scratchVec.x - position->x) * 0.01; EStack_f0 = (EntityPtr)((scratchVec.y - (npc->_pos).y) * 0.01); fVar11 = (float)EStack_f0 * (float)EStack_f0 + local_f8 * local_f8; fVar9 = local_f8; stepY = (float)EStack_f0; if ((9.0 < fVar11) && (fVar11 = sqrtf(fVar11), fVar9 = local_f8, stepY = (float)EStack_f0, 0.0 < fVar11)) { fVar9 = local_f8 * (3.0 / fVar11); stepY = (float)EStack_f0 * (3.0 / fVar11); } fVar11 = npc->_speedMultiplier; (npc->_velocity).x = fVar9 * fVar11 + (npc->_velocity).x; (npc->_velocity).y = stepY * fVar11 + (npc->_velocity).y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_i1 < 4) { ANM2::Play(&npc->_sprite,(&PTR_s_LokiDance2_00b5feac)[npc->_i1],0); npc->_i1 = npc->_i1 + 1; } else { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_stateFrame = 0; npc->_i1 = 0; } } isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isEventTriggered == 0) goto LAB_004be326; Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.05; switch(npc->_stateFrame) { case 0: case 2: case 0x11: case 0x13: uVar8 = 6; goto LAB_004be2a6; case 1: case 8: case 0x12: uVar8 = 7; goto LAB_004be2a6; case 3: case 0xb: uVar8 = 8; LAB_004be2a6: scratchVec.y = 0.0; LAB_004be2ae: scratchVec.x = 10.0; break; case 4: case 0xf: projParams.CircleAngle = 0.2617994; scratchVec.y = 12.0; uVar8 = 9; goto LAB_004be2ae; case 5: projParams.CircleAngle = 0.0; scratchVec.x = 8.0; scratchVec.y = 8.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); projParams.CircleAngle = 0.15707964; scratchVec.x = 10.0; scratchVec.y = 8.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,9,&projParams); projParams.CircleAngle = -0.15707964; scratchVec.y = 8.0; uVar8 = 9; goto LAB_004be2ae; case 6: projParams.BulletFlags._0_4_ = 0x40000; goto LAB_004be087; case 7: projParams.BulletFlags._0_4_ = 0x80000; LAB_004be087: projParams.BulletFlags._4_4_ = 0; scratchVec.x = 8.0; LAB_004be09a: scratchVec.y = 10.0; projParams.CircleAngle = 0.0; uVar8 = 9; break; case 9: scratchVec.x = 10.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,3,&projParams); scratchVec.x = -10.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,3,&projParams); scratchVec.x = 0.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,position,&scratchVec,3,&projParams); scratchVec.x = 0.0; scratchVec.y = -10.0; uVar8 = 3; break; case 10: scratchVec.x = 7.071068; scratchVec.y = 7.071068; Entity_NPC::FireProjectiles(npc,position,&scratchVec,3,&projParams); scratchVec.x = -7.071068; scratchVec.y = 7.071068; Entity_NPC::FireProjectiles(npc,position,&scratchVec,3,&projParams); scratchVec.x = 7.071068; scratchVec.y = -7.071068; Entity_NPC::FireProjectiles(npc,position,&scratchVec,3,&projParams); scratchVec.x = -7.071068; scratchVec.y = -7.071068; uVar8 = 3; break; case 0xc: scratchVec.x = 7.071068; scratchVec.y = 7.071068; Entity_NPC::FireProjectiles(npc,position,&scratchVec,5,&projParams); scratchVec.x = -7.071068; scratchVec.y = 7.071068; Entity_NPC::FireProjectiles(npc,position,&scratchVec,5,&projParams); scratchVec.x = 7.071068; scratchVec.y = -7.071068; Entity_NPC::FireProjectiles(npc,position,&scratchVec,5,&projParams); scratchVec.x = -7.071068; scratchVec.y = -7.071068; uVar8 = 5; break; case 0xd: scratchVec.x = 6.0; goto LAB_004be09a; case 0xe: scratchVec.x = 8.0; scratchVec.y = 0.0; uVar8 = 8; break; case 0x10: scratchVec.x = 8.0; scratchVec.y = 12.0; projParams.CircleAngle = 0.0; uVar8 = 9; break; default: goto switchD_004bdfcd_default; } Entity_NPC::FireProjectiles(npc,position,&scratchVec,uVar8,&projParams); switchD_004bdfcd_default: velocity = &g_vectorZero; Color::Color(&tmpColor); tmpEntity = spawn_blood_explosion(2,position,&g_vectorZero,color,velocity); uVar8 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0; npc->_stateFrame = npc->_stateFrame + 1; LAB_004be326: isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (isEventTriggered != 0) { Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._4_4_ = projParams.BulletFlags._4_4_ | 8; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; projParams.Scale = 2.0; tmpColor._offset[0] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[1] = 0.3; tmpColor._offset[2] = 0.0; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&tmpColor); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_f8 = (tmpEntity->_pos).x; EStack_f0 = (EntityPtr)(tmpEntity->_pos).y; fVar11 = (npc->_pos).x - local_f8; fVar9 = (npc->_pos).y - (float)EStack_f0; fVar9 = sqrtf(fVar9 * fVar9 + fVar11 * fVar11); scratchVec.x = (tmpEntity->_velocity).x * 0.1 * fVar9 + local_f8; scratchVec.y = (tmpEntity->_velocity).y * 0.1 * fVar9 + (float)EStack_f0; iVar6 = 0; do { projectile = Entity_NPC::FireBossProjectiles(npc,1,&scratchVec,10.0,&projParams); iVar7 = iVar6 + 1; fVar10 = (float)iVar6; projectile->_scale = 2.0; fVar11 = 1.0 - fVar10 * 0.2; (projectile->_velocity).y = fVar11 * (projectile->_velocity).y; fVar9 = projectile->_fallingAccel; (projectile->_velocity).x = fVar11 * (projectile->_velocity).x; projectile->_fallingAccel = (fVar9 - 0.6) - fVar10 * 0.12; projectile->_fallingSpeed = (projectile->_fallingSpeed * 0.7 - 3.0) - fVar10 * 5.0; iVar6 = iVar7; } while (iVar7 < 3); } break; case 0xd: npc->_friction = npc->_friction * 0.7; isEventTriggered = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isEventTriggered != 0) { Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); flySpawnPos.x = (npc->_pos).x + 0.0; flySpawnPos.y = (npc->_pos).y + 50.0; uVar8 = Random(); EStack_f0 = (EntityPtr) Game::SpawnEx(g_game,0x19,0,&flySpawnPos,&g_vectorZero,(Entity *)npc,0,uVar8,0); *(int *)((int)EStack_f0 + 0x188) = 2; (**(code **)(*(int *)EStack_f0 + 0xc))(); local_f4 = 0.0; do { local_f8 = (float)((double)(int)local_f4 + __uint_to_double_fixup[-((int)local_f4 >> 0x1f)]) * 120.0; pEStack_ec = (EntityPtr *)(local_f8 * 0.017453292); uVar8 = Random(); fVar9 = cos((float)pEStack_ec); scratchVec.x = fVar9 * 10.0 + flySpawnPos.x; fVar9 = sin((float)pEStack_ec); scratchVec.y = fVar9 * 10.0 + flySpawnPos.y; tmpEntity = Game::SpawnEx(g_game,0x333,1,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar8,0); if (tmpEntity->_parent != (EntityPtr)0x0) { pEStack_ec = &tmpEntity->_parent; std::multiset::erase(&pEStack_ec); } tmpEntity->_parent = EStack_f0; std::multiset::insert(&tmpEntity->_parent); uVar1 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar1; iVar6 = *(int *)tmpEntity; tmpEntity[2]._prevVelocity.y = local_f8; tmpEntity->_entityCollisionClass = 2; (**(code **)(iVar6 + 0xc))(); local_f4 = (float)((int)local_f4 + 1); } while ((uint)local_f4 < 3); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0; npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); } } if (npc->_dead != 0) { uVar8 = 0; do { rngResult = Random(); local_f8 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_f8 = local_f8 + local_f8; fVar9 = cos(local_f8); scratchVec.x = fVar9 * 10.0 + (npc->_pos).x; fVar9 = sin(local_f8); scratchVec.y = fVar9 * 10.0 + (npc->_pos).y; NpcHelper::horny_boys_pull_entity(uVar8,&scratchVec); uVar8 = uVar8 + 1; } while (uVar8 < 3); } return; } //@@ 004be670 NpcHelper::query_nearest_other /* DB: nearest entity of a query list to a point, not the given one; Hush Fly spacing (boss_approx_2) */ int NpcHelper::query_nearest_other(int param_1,float param_2,float param_3) { int iVar1; int in_ECX; int *piVar2; int iVar3; int iVar4; float fVar5; float fVar6; float fVar7; iVar4 = *(int *)(in_ECX + 0xc); iVar3 = 0; fVar7 = 0.0; if (iVar4 != 0) { piVar2 = *(int **)(in_ECX + 4); do { iVar1 = *piVar2; if ((iVar1 != param_1) && ((fVar6 = param_3 - *(float *)(iVar1 + 0x340), fVar5 = param_2 - *(float *)(iVar1 + 0x33c), fVar5 = fVar6 * fVar6 + fVar5 * fVar5, fVar5 < fVar7 || (iVar3 == 0)))) { iVar3 = iVar1; fVar7 = fVar5; } piVar2 = piVar2 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); } return iVar3; } //@@ 004be6e0 PathFinder::HasDirectPath /* ZHL [lua] Lua binding PathFinder:HasDirectPath */ undefined1 PathFinder::HasDirectPath(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x72c); } //@@ 004be6f0 NpcAI::ENTITY_HUSH_BOIL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 298 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HUSH_BOIL(Entity_NPC *npc) { undefined4 uVar1; byte bVar2; int iVar3; float *damageEvent; Entity *target; uint uVar4; int iVar5; byte *animName; char *expectedAnim; bool bVar6; float fVar7; float fVar8; ProjectileParams *params; Vector shotVelocity; float aimAngle; float local_bc; float local_b8; ProjectileParams projParams; float local_8; byte *animData; local_8 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); if (npc->_state == 0) { (npc->_v1).x = 0.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; npc->_state = 3; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; iVar3 = __ftoui3(); bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shrink",1); if (bVar2 == 0) { return; } if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } AnimationState::SetFrameFloat (&(npc->_sprite)._animState,(float)(int)(-(uint)(0xdU - iVar3 != 0) & 0xdU - iVar3)); if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } (npc->_sprite)._animState._isPlaying = 0; return; } npc->_friction = npc->_friction * 0.8; if (0.0 < npc->_pendingDamage) { damageEvent = (npc->_damageEvents)._begin; fVar7 = 0.0; if (damageEvent != (npc->_damageEvents)._end) { do { shotVelocity.y = damageEvent[3]; if ((((((uint)damageEvent[2] & 4) == 0) || (damageEvent[4] == 1.4013e-45)) || (damageEvent[6] == 1.4013e-45)) || ((damageEvent[6] == 4.2039e-45 || (((uint)damageEvent[2] & 0x1000) != 0)))) { fVar7 = fVar7 + *damageEvent; } else { *damageEvent = 0.0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); if (0.0 < fVar7) { (npc->_v1).x = 0.0; } } } target = Entity_NPC::GetPlayerTarget(npc); fVar7 = (target->_pos).x - (npc->_pos).x; fVar8 = (target->_pos).y - (npc->_pos).y; local_b8 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (npc->_state == 3) { if ((npc->_flags & 0x1000a00) == 0) { fVar7 = (npc->_v1).y - 0.07692308; (npc->_v1).y = fVar7; if (fVar7 < 0.0) { (npc->_v1).y = 0.0; } uVar4 = Random(); if (uVar4 % 0x32 == 0) { if ((local_b8 < 420.0) || (uVar4 = Random(), uVar4 % 6 == 0)) { if (npc->_variant == 2) { iVar5 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar3 = 0; if (0 < iVar5) { iVar3 = iVar5; } if ((7 < iVar3) || (iVar3 = Isaac::Random(iVar3), iVar3 != 0)) goto LAB_004be955; } npc->_state = 8; } else { LAB_004be955: npc->_state = 9; } } iVar3 = __ftoui3(); bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shrink",1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)(-(uint)(0xdU - iVar3 != 0) & 0xdU - iVar3)), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } goto LAB_004bedf8; } } else if (npc->_state == 8) { fVar7 = (npc->_v1).y + 0.07692308; (npc->_v1).y = fVar7; if (fVar7 < 1.0) { (npc->_v1).y = fVar7 + 0.07692308; if (1.0 < fVar7 + 0.07692308) { (npc->_v1).y = 1.0; } iVar3 = __ftoui3(); bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shrink",1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)(-(uint)(0xdU - iVar3 != 0) & 0xdU - iVar3)), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } goto LAB_004bedf8; } animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004beb19: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animName = animData; if (0xf < *(uint *)(animData + 0x14)) { animName = *(byte **)animData; } expectedAnim = "Shoot"; do { bVar2 = *animName; bVar6 = bVar2 < (byte)*expectedAnim; if (bVar2 != *expectedAnim) { LAB_004beb03: uVar4 = -(uint)bVar6 | 1; goto LAB_004beb08; } if (bVar2 == 0) break; bVar2 = animName[1]; bVar6 = bVar2 < (byte)expectedAnim[1]; if (bVar2 != expectedAnim[1]) goto LAB_004beb03; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004beb08: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004beb19; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); Random(); ProjectileParams::ProjectileParams(&projParams); projParams.Scale = 1.6; projParams.Acceleration = 0.01; projParams.FallingAccelModifier = -0.12; projParams.HomingStrength = 1.1; target = Entity_NPC::GetPlayerTarget(npc); local_bc = (target->_pos).x; fVar7 = (target->_pos).y; uVar4 = Random(); aimAngle = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; aimAngle = aimAngle + aimAngle; uVar4 = Random(); local_b8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar8 = cos(aimAngle); local_bc = (fVar8 * local_b8 * 40.0 + local_bc) - (npc->_pos).x; fVar8 = sin(aimAngle); local_b8 = (fVar8 * local_b8 * 40.0 + fVar7) - (npc->_pos).y; fVar7 = sqrtf(local_b8 * local_b8 + local_bc * local_bc); if (fVar7 <= 0.0) { shotVelocity.x = local_bc; shotVelocity.y = local_b8; } else { shotVelocity.y = (7.5 / fVar7) * local_b8; shotVelocity.x = (7.5 / fVar7) * local_bc; } params = &projParams; uVar4 = Random(); Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVelocity,(uVar4 & 1) * 2,params); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } goto LAB_004bedf8; } animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004bedb7: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shake",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animName = animData; if (0xf < *(uint *)(animData + 0x14)) { animName = *(byte **)animData; } expectedAnim = "Shake"; do { bVar2 = *animName; bVar6 = bVar2 < (byte)*expectedAnim; if (bVar2 != *expectedAnim) { LAB_004beda1: uVar4 = -(uint)bVar6 | 1; goto LAB_004beda6; } if (bVar2 == 0) break; bVar2 = animName[1]; bVar6 = bVar2 < (byte)expectedAnim[1]; if (bVar2 != expectedAnim[1]) goto LAB_004beda1; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004beda6: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004bedb7; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } LAB_004bedf8: fVar7 = (npc->_targetPosition).y; fVar8 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar7 - fVar8; return; } //@@ 004bee40 NpcAI::ENTITY_HUSH_GAPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 297 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HUSH_GAPER(Entity_NPC *npc) { byte bVar1; undefined4 *damageEvent; byte *animName; Entity *target; Vector *targetPos; char *expectedAnim; void *pvVar2; uint uVar3; bool bVar4; Vector local_50; float soundPitch; void *vertAnim; char local_40 [12]; uint local_34; uint local_30; void *horiAnim; char local_28 [12]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00af3555; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (damageEvent[6] == npc->_type) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } if (npc->_state == 0) { if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount != *(int *)((int)g_game->_room + 0x11f0))) { *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 0x10; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004befa6: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVertAppear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animName = animData; if (0xf < *(uint *)(animData + 0x14)) { animName = *(byte **)animData; } expectedAnim = "WalkVertAppear"; do { bVar1 = *animName; bVar4 = bVar1 < (byte)*expectedAnim; if (bVar1 != *expectedAnim) { LAB_004bef93: uVar3 = -(uint)bVar4 | 1; goto LAB_004bef98; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar4 = bVar1 < (byte)expectedAnim[1]; if (bVar1 != expectedAnim[1]) goto LAB_004bef93; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004bef98: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004befa6; } animData = (npc->_sprite)._overlayAnimState._animData; if (animData == (byte *)0x0) { LAB_004bf016: bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadAppear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { animName = animData; if (0xf < *(uint *)(animData + 0x14)) { animName = *(byte **)animData; } expectedAnim = "HeadAppear"; do { bVar1 = *animName; bVar4 = bVar1 < (byte)*expectedAnim; if (bVar1 != *expectedAnim) { LAB_004bf000: uVar3 = -(uint)bVar4 | 1; goto LAB_004bf005; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar4 = bVar1 < (byte)expectedAnim[1]; if (bVar1 != expectedAnim[1]) goto LAB_004bf000; animName = animName + 2; expectedAnim = expectedAnim + 2; } while (bVar1 != 0); uVar3 = 0; LAB_004bf005: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_004bf016; } npc->_entityCollisionClass = 0; } else { npc->_state = 4; npc->_stateFrame = 0; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if ((bVar1 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } } if (npc->_state == 0x10) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_10; return; } npc->_state = 4; npc->_stateFrame = 0; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if ((bVar1 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } npc->_entityCollisionClass = 4; ExceptionList = local_10; return; } local_30 = 0xf; local_34 = 8; vertAnim = (void *)0x6b6c6157; builtin_strncpy(local_40,"Vert",5); local_18 = 0xf; local_1c = 8; horiAnim = (void *)0x6b6c6157; builtin_strncpy(local_28,"Hori",5); local_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnim,(std_string *)&vertAnim,0.1); local_8 = local_8 & 0xffffff00; if (0xf < local_18) { uVar3 = local_18 + 1; pvVar2 = horiAnim; if (0xfff < uVar3) { pvVar2 = *(void **)((int)horiAnim + -4); uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)horiAnim + (-4 - (int)pvVar2))) goto LAB_004bf1c0; } operator_delete(pvVar2,uVar3); } local_8 = 0xffffffff; local_1c = 0; local_18 = 0xf; horiAnim = (void *)((uint)horiAnim & 0xffffff00); if (0xf < local_30) { uVar3 = local_30 + 1; pvVar2 = vertAnim; if (0xfff < uVar3) { pvVar2 = *(void **)((int)vertAnim + -4); uVar3 = local_30 + 0x24; if (0x1f < (uint)((int)vertAnim + (-4 - (int)pvVar2))) { LAB_004bf1c0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } npc->_aiFloat = 0.6; if ((npc->_flags & 0x1000800) == 0) { targetPos = Entity_NPC::CalcTargetPosition(npc,&local_50,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,0.6,900,1); } else { target = Entity_NPC::GetPlayerTarget(npc); local_50.x = (target->_pos).x; local_50.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_50,0); npc->_friction = npc->_friction * 0.8; } if ((npc->_pathfinder)._hasDirectPath == 0) { ExceptionList = local_10; return; } uVar3 = Random(); manager = g_manager; if (uVar3 % 0x1e != 0) { ExceptionList = local_10; return; } soundPitch = 1.0; if (npc->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (npc->_championColorIdx == 0x13) { soundPitch = 0.5; } local_50.y = 2.31214e-43; seed_fart_sound_override((int *)&local_50.y); SoundEffects::Play(&manager->_sfxManager,(int)local_50.y,1.0,0x78,0,soundPitch,0.0); ExceptionList = local_10; return; } //@@ 004bf310 NpcAI::ENTITY_HUSH_FLY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 296 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HUSH_FLY(Entity_NPC *npc) { byte *pbVar1; byte bVar2; void *pvVar3; uint uVar4; Vector *centerPos; float fVar5; Entity *target; int *groupFly; undefined4 uVar6; int *nearestFly; int turnStep; float *pfVar7; byte extraout_CL; byte extraout_CL_00; byte *pbVar8; void *ptr; byte *wantAnimChar; undefined1 *size; qword *allocatedBytes; bool isLess; float fVar9; float fVar10; float fVar11; undefined4 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; undefined1 local_80 [24]; char groupList [4]; int groupData; void *groupSize; float frameCount; Vector local_54; float local_4c; float local_48; void *local_44; float local_40; float local_3c; std_string spritesheetPath; char *local_20 [3]; void *local_14; void *local_10; undefined1 *puStack_c; char *local_8; Game *game; qword oldAllocatedBytes; int orbitPhase; local_8 = (char *)0xffffffff; puStack_c = &LAB_00af35a5; local_10 = ExceptionList; pvVar3 = (void *)(__security_cookie ^ (uint)(local_20 + 7)); local_14 = pvVar3; ExceptionList = &local_10; if (npc->_state == 0) { npc->_entityGridCollisionClass = 0; npc->_state = 3; local_20[0] = "gfx/Monsters/Afterbirth/Monster_010_Fly_Hush_1.png"; local_20[1] = "gfx/Monsters/Afterbirth/Monster_010_Fly_Hush_2.png"; local_20[2] = "gfx/Monsters/Afterbirth/Monster_010_Fly_Hush_3.png"; uVar4 = Random(); spritesheetPath._size = 0; spritesheetPath._capacity = (uint)&DAT_0000000f; spritesheetPath._buf._0_4_ = (void *)0x0; pbVar1 = (byte *)local_20[uVar4 % 3]; pbVar8 = pbVar1; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(spritesheetPath._buf,pbVar1,(int)pbVar8 - (int)(pbVar1 + 1)); local_8 = (char *)0x0; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,0,&spritesheetPath); local_8 = (char *)0xffffffff; bVar2 = extraout_CL; if (&DAT_0000000f < spritesheetPath._capacity) { size = (undefined1 *)(spritesheetPath._capacity + 1); ptr = (void *)spritesheetPath._buf._0_4_; if ((undefined1 *)0xfff < size) { ptr = *(void **)(spritesheetPath._buf._0_4_ + -4); size = (undefined1 *)(spritesheetPath._capacity + 0x24); if (0x1f < (uint)(spritesheetPath._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,(uint)size); bVar2 = extraout_CL_00; } ANM2::LoadGraphics(&npc->_sprite,bVar2); uVar4 = Random(); game = g_game; npc->_i1 = (int)((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 1000.0); npc->_groupIdx = game->_frameCount; centerPos = Room::GetCenterPos(&local_54); (npc->_v1).x = centerPos->x; (npc->_v1).y = centerPos->y; uVar4 = Random(); *(char *)&npc->_i2 = (char)(uVar4 % 6) + '\x01'; uVar4 = Random(); *(char *)((int)&npc->_i2 + 1) = (char)(uVar4 % 6) + '\x01'; *(undefined2 *)((int)&npc->_i2 + 2) = 0x50; uVar4 = Random(); npc->_health = (float)(uVar4 % 200 + 400) + 0.0 + npc->_health; } fVar5 = npc->_maxHitPoints; if (fVar5 < npc->_health) { local_44 = (void *)(npc->_health - 4.0); pfVar7 = (float *)&local_44; if ((float)local_44 <= fVar5) { pfVar7 = &npc->_maxHitPoints; } npc->_health = *pfVar7; } fVar5 = (float)__RTDynamicCast(npc->_parent,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,pvVar3); if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { local_54.y = fVar5; Entity_NPC::QueryNPCsGroup((EntityList *)groupList,npc->_groupIdx); local_8 = (char *)0x1; NpcHelper::hush_fly_shape_build((char)npc->_i2); local_8._0_1_ = 2; NpcHelper::hush_fly_shape_build(*(undefined1 *)((int)&npc->_i2 + 1)); local_8 = (char *)CONCAT31(local_8._1_3_,3); fVar9 = npc->_speedMultiplier; frameCount = (float)g_game->_frameCount; fVar10 = (npc->_v2).y; (npc->_v1).x = fVar9 * (npc->_v2).x + (npc->_v1).x; (npc->_v1).y = fVar9 * fVar10 + (npc->_v1).y; if (*(char *)((int)&npc->_i2 + 3) == '\x01') { fVar9 = (npc->_v2).y; fVar10 = (npc->_v2).x; local_44 = (void *)sqrtf(fVar10 * fVar10 + fVar9 * fVar9); target = Entity_NPC::GetPlayerTarget(npc); local_3c = (target->_pos).x - (npc->_v1).x; local_40 = (target->_pos).y - (npc->_v1).y; fVar9 = sqrtf(local_3c * local_3c + local_40 * local_40); if (0.0 < fVar9) { local_40 = ((float)local_44 / fVar9) * local_40; local_3c = ((float)local_44 / fVar9) * local_3c; } fVar9 = (npc->_v2).x; fVar10 = (npc->_v2).y; fVar11 = local_40 - fVar10; local_40 = fVar9 + (local_3c - fVar9) * 0.1; local_3c = fVar10 + fVar11 * 0.1; fVar9 = sqrtf(local_40 * local_40 + local_3c * local_3c); if (fVar9 <= 0.0) { fVar10 = local_3c; fVar9 = local_40; } else { fVar10 = ((float)local_44 / fVar9) * local_3c; fVar9 = ((float)local_44 / fVar9) * local_40; } (npc->_v2).x = fVar9; (npc->_v2).y = fVar10; } if ((npc->_groupIdx == 1) && (fVar5 != 0.0)) { fVar9 = *(float *)((int)fVar5 + 0x340); (npc->_v1).x = *(float *)((int)fVar5 + 0x33c); (npc->_v1).y = fVar9; } local_44 = (void *)0x0; if (groupSize != (void *)0x0) { do { groupFly = (int *)__RTDynamicCast(*(undefined4 *)(groupData + (int)local_44 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if ((groupFly != (int *)0x0) && (groupFly[10] == 0x128)) { groupFly[0x2f0] = groupFly[0x2f0] + 10; uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; uVar6 = NpcHelper::query_nearest_other(groupFly,groupFly[0xcf],groupFly[0xd0]); nearestFly = (int *)__RTDynamicCast(uVar6,uVar12,pTVar13,pTVar14,uVar15); if ((nearestFly != (int *)0x0) && (nearestFly != groupFly)) { orbitPhase = groupFly[0x2f0]; local_40 = ((float)nearestFly[0x2f0] - (float)orbitPhase) * 0.006283186; local_3c = cos(local_40); fVar5 = sin(local_40); fVar5 = atan2f(fVar5,local_3c); turnStep = 0; if (fVar5 * 159.15494 < -0.0) { turnStep = 2; } if (0.0 < fVar5 * 159.15494) { turnStep = -2; } groupFly[0x2f0] = turnStep + orbitPhase; } local_48 = (float)groupFly[0x2f0] * 0.001; pfVar7 = (float *)NpcHelper::path_point_at(local_80); local_3c = frameCount * 0.017453292; local_40 = cos(local_3c); fVar5 = sin(local_3c); fVar9 = pfVar7[1] * local_40; local_40 = (*pfVar7 * local_40 - pfVar7[1] * fVar5) + (npc->_v1).x; local_4c = (fVar9 + *pfVar7 * fVar5) * 0.7 + (npc->_v1).y; pfVar7 = (float *)NpcHelper::path_point_at(local_20 + 1); local_48 = cos(local_3c); fVar5 = sin(local_3c); fVar9 = pfVar7[1] * local_48; local_48 = *pfVar7 * local_48 - pfVar7[1] * fVar5; local_3c = (fVar9 + *pfVar7 * fVar5) * 0.7; fVar5 = sin(npc->_updateTime * 0.1); fVar9 = (fVar5 + 0.5) * 0.7; fVar5 = 0.0; if (0.0 <= fVar9) { fVar5 = fVar9; } fVar9 = 1.0; if (fVar5 <= 1.0) { fVar9 = fVar5; } fVar5 = (npc->_v1).y; groupFly[0xcd] = (int)(local_40 + ((local_48 + (npc->_v1).x) - local_40) * fVar9); groupFly[0xce] = (int)(local_4c + ((local_3c + fVar5) - local_4c) * fVar9); groupFly[0x2ec] = (int)(npc->_v1).x; groupFly[0x2ed] = (int)(npc->_v1).y; groupFly[0x2ee] = (int)(npc->_v2).x; groupFly[0x2ef] = (int)(npc->_v2).y; groupFly[0x2f1] = npc->_i2; bVar2 = Room::IsPositionInRoom(g_game->_room,(Vector *)(groupFly + 0xcf),-200.0); if (bVar2 == 0) { (**(code **)(*groupFly + 0x28))(); } } local_44 = (void *)((int)local_44 + 1); } while (local_44 < groupSize); fVar5 = local_54.y; } FUN_004b3950(); FUN_004b3950(); local_8 = (char *)0xffffffff; if (groupList[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (groupData != 0) { uVar4 = *(uint *)(groupData + -4); oldAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar4; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)oldAllocatedBytes < uVar4); free((void *)(groupData + -4)); } local_8 = (char *)0xffffffff; } } local_54.y = (npc->_velocity).x; local_4c = (npc->_velocity).y; local_54.y = ((((npc->_targetPosition).x - (npc->_pos).x) + (npc->_v2).x) - local_54.y) * 0.3 + local_54.y; fVar9 = (npc->_targetPosition).y; fVar10 = (npc->_pos).y; fVar11 = (npc->_v2).y; (npc->_velocity).x = local_54.y; local_4c = (((fVar9 - fVar10) + fVar11) - local_4c) * 0.3 + local_4c; (npc->_velocity).y = local_4c; fVar9 = local_4c * local_4c + local_54.y * local_54.y; if ((100.0 < fVar9) && (fVar9 = sqrtf(fVar9), 0.0 < fVar9)) { (npc->_velocity).y = (10.0 / fVar9) * local_4c; (npc->_velocity).x = (10.0 / fVar9) * local_54.y; } fVar9 = npc->_speedMultiplier; fVar10 = npc->_friction * 0.8; npc->_friction = fVar10; fVar10 = 1.0 / fVar10; if (fVar9 != 1.0) { fVar10 = fVar10 / ((fVar9 + fVar10) - fVar9 * fVar10); } (npc->_velocity).y = fVar10 * (npc->_velocity).y; (npc->_velocity).x = fVar10 * (npc->_velocity).x; pbVar1 = (npc->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar8 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar8 = *(byte **)pbVar1; } wantAnimChar = s_Fly; do { bVar2 = *pbVar8; isLess = bVar2 < *wantAnimChar; if (bVar2 != *wantAnimChar) { LAB_004bfc45: uVar4 = -(uint)isLess | 1; goto LAB_004bfc4a; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; isLess = bVar2 < wantAnimChar[1]; if (bVar2 != wantAnimChar[1]) goto LAB_004bfc45; pbVar8 = pbVar8 + 2; wantAnimChar = wantAnimChar + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004bfc4a: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004bfc81; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Fly,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004bfc81: (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; if ((npc->_entityCollisionClass == 2) && ((fVar5 == 0.0 || (fVar10 = *(float *)((int)fVar5 + 0x340) - (npc->_pos).y, fVar9 = *(float *)((int)fVar5 + 0x33c) - (npc->_pos).x, fVar5 = npc->_size + *(float *)((int)fVar5 + 0x370), fVar5 * fVar5 < fVar10 * fVar10 + fVar9 * fVar9)))) { npc->_entityCollisionClass = 4; } ExceptionList = local_10; return; } //@@ 004bfd20 FUN_004bfd20 void FUN_004bfd20(void) { FUN_004b3950(); return; } //@@ 004bfd30 NpcAI::ENTITY_HUSH /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 407 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HUSH(Entity_NPC *npc) { byte bVar1; code *pcVar2; void *pvVar3; RNG rng; RNG rng_00; qword qVar4; undefined1 *puVar5; byte bVar6; byte *pbVar7; uint uVar8; byte *pbVar9; Entity_Player *player; byte *pbVar10; EntityList_EL *player; ANM2 *pAVar12; undefined4 *puVar13; ColorMod *other; Vector *pVVar14; char *pcVar15; Entity *unused; int iVar16; uint uVar17; WeightedOutcomePicker WVar18; float *pfVar19; EntityPtr EVar20; PlayerManager *this; Game *game; char cVar21; qword *pqVar22; uint uVar23; uint *puVar24; int iVar25; EntityPtr *pEVar26; bool bVar27; float fVar28; float fVar29; float fVar30; float fVar31; float fVar32; Entity *pEVar33; undefined1 auVar34 [12]; float *pfVar35; undefined8 uVar36; double dVar37; undefined4 uVar38; TypeDescriptor *pTVar39; TypeDescriptor *pTVar40; int *piVar41; undefined4 uVar42; Color local_2c0c; EntityRef local_2be0; EntityRef local_2bb8; Color local_2b90; Color local_2b64; Color local_2b38; Vector local_2b0c; Vector local_2b04; Vector local_2afc; Vector local_2af4; Vector local_2aec; Vector local_2ae4; Vector local_2adc; Vector local_2ad4; Vector local_2acc; EntityList_EL hushBoils; undefined1 local_2ab4 [12]; uint local_2aa8; undefined1 local_2aa4 [12]; uint local_2a98; Vector local_2a94; int local_2a8c; int local_2a88; EntityList_EL local_2a84; float local_2a74; void *local_2a70; int local_2a6c; int local_2a68; EntityList_EL local_2a64; EntityList_EL local_2a54; int local_2a44 [2]; Vector local_2a3c; undefined4 local_2a34; undefined4 local_2a30; float local_2a2c [3]; void *local_2a20; int local_2a1c; int local_2a18; int local_2a14; void *local_2a10; int local_2a0c; int local_2a08; int local_2a04; int local_2a00; Vector local_29fc; Vector local_29f4; Vector local_29ec; undefined4 local_29e4; undefined4 local_29e0; Vector local_29dc; Vector local_29d4; Vector local_29cc; Vector local_29c4; Vector local_29bc; undefined4 local_29b4; undefined4 local_29b0; undefined4 local_29ac; undefined4 local_29a8; undefined4 local_29a4; undefined4 local_29a0; undefined4 local_299c; undefined4 local_2998; undefined4 local_2994; undefined4 local_2990; undefined4 local_298c; undefined4 local_2988; undefined4 local_2984; undefined4 local_2980; undefined4 local_297c; undefined4 local_2978; EntityList_EL nearbyEntities; float local_2964; EntityList_EL effectsVariant96; EntityList_EL effectsVariant101; Vector local_2940; Vector local_2938; Vector local_2930; float local_2928; Entity *local_2924; Vector local_2920; WeightedOutcomePicker local_2918; Entity *local_2914; Entity *local_2910; Entity *local_290c; float *local_2908; EntityPtr *local_2904; Entity *local_2900; int local_28fc; uint *local_28f8; uint *local_28f4; EntityPtr local_28f0; Entity *local_28ec; EntityPtr local_28e8; WeightedOutcomePicker local_28e4; float *local_28e0; WeightedOutcomePicker local_28dc; WeightedOutcomePicker attackPicker; undefined4 *attackPickerEnd; undefined4 *attackPickerCapacity; ANM2 *local_28cc; char local_28c5; Entity *local_28c4; ProjectileParams bigShotParams; ProjectileParams wiggleShotParams; ProjectileParams curvingShotParams; undefined1 local_26c8 [92]; float local_266c; float local_2668; float local_2664; float local_2660; float local_265c; float local_2658; float local_2654; float local_2650; float local_264c; float local_2648; float local_2644; float local_2640; float local_263c; float local_2638; float local_2634; undefined1 local_2630; float local_262c; float local_2628; undefined1 local_2624; undefined1 local_2620 [8]; int local_2618 [7]; float local_25fc [16]; float afStack_25bc [3]; uint auStack_25b0 [20]; int local_2560 [2352]; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; void *local_74; undefined1 *local_70; void *local_6c; void *local_68; Vector local_64; float fStack_5c; int iStack_58; int local_54; int local_50; int iStack_4c; RNG local_48; undefined1 local_38 [8]; undefined4 *local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af3638; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; local_28f0 = (EntityPtr)npc; if (npc->_state == 0) { fVar29 = (npc->_pos).y; if (fVar29 <= 260.0) { fVar29 = 260.0; } (npc->_pos).y = fVar29; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_stateFrame = 0; npc->_i1 = 3; npc->_state = 2; pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pcVar15 = "Appear"; do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004bfe10: uVar8 = -(uint)bVar27 | 1; goto LAB_004bfe15; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004bfe10; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004bfe15: if ((uVar8 == 0) && ((puStack_20 = local_38 + 0x34, pbVar9[0x34] == 0 || (puStack_20 = local_38 + 0x34, (npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004bfe4c; } puStack_20 = local_38 + 0x34; bVar6 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004bfe4c: *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; manager = g_manager; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_entityCollisionClass = 3; npc->_sortingLayer = 0; npc->_isInvicible = 1; npc->_renderZOffset = 8000; local_28c4 = (Entity *)0x1a7; seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,2,0,1.0,0.0); ExceptionList = local_1c; return; } puVar5 = local_38 + 0x34; if (npc->_state == 2) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_004bff2d: bVar6 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); puVar5 = puStack_20; if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; puVar5 = puStack_20; } } else { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar15 = "Appear"; do { bVar6 = *pbVar9; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004bff15: uVar8 = -(uint)bVar27 | 1; goto LAB_004bff1a; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004bff15; pbVar9 = pbVar9 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004bff1a: if ((uVar8 != 0) || ((puVar5 = local_38 + 0x34, *(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && (puVar5 = local_38 + 0x34, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004bff2d; } puStack_20 = puVar5; local_28cc = *(ANM2 **)((int)g_game->_room + 0x11f8); if (*(char *)&local_28cc->_eventNames == '\0') { ring_buffer_push(&local_28cc->_overlayAnimState,&npc->_pos); *(undefined1 *)&local_28cc->_eventNames = 1; } puVar5 = puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pbVar7 = s_Idle; do { bVar6 = *pbVar9; bVar27 = bVar6 < *pbVar7; if (bVar6 != *pbVar7) { LAB_004bffe0: uVar8 = -(uint)bVar27 | 1; goto LAB_004bffe5; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < pbVar7[1]; if (bVar6 != pbVar7[1]) goto LAB_004bffe0; pbVar9 = pbVar9 + 2; pbVar7 = pbVar7 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004bffe5: if ((uVar8 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004c0016; } bVar6 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); puVar5 = puStack_20; if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; puVar5 = puStack_20; } } } LAB_004c0016: puStack_20 = puVar5; if (npc->_dead != 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); Entity::RemoveStatusEffects((Entity *)npc); Game::ShakeScreen(g_game,0x14); uVar8 = Random(); manager = g_manager; local_28c4 = (Entity *)0x1a7; local_28cc = (ANM2 *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10 * 0.4 + 0.8); seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,0x3c,0,(float)local_28cc,0.0); uVar8 = Random(); manager = g_manager; local_28c4 = (Entity *)0x1a5; local_28cc = (ANM2 *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10 * 0.4 + 0.8); seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,0x3c,0,(float)local_28cc,0.0); uVar8 = Random(); manager = g_manager; local_28c4 = (Entity *)0x1a6; local_28cc = (ANM2 *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10 * 0.4 + 0.8); seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,0x3c,0,(float)local_28cc,0.0); local_28c5 = (npc->_flags & 0x1000000000000000) != 0; local_28ec = (Entity *)0x0; local_28cc = g_game->_room; cVar21 = local_28c5; if (local_28cc[0x11]._filename._size != 0) { do { pEVar33 = *(Entity **)(*(int *)(local_28cc[0x11]._filename._buf + 8) + (int)local_28ec * 4); unused = local_28ec; local_28c4 = pEVar33; if (cVar21 == '\0') { LAB_004c026e: bVar6 = Entity::is_valid_boss_enemy(pEVar33,(int)unused); if (bVar6 != 0) { pcVar2 = *(code **)(*(int *)pEVar33 + 0x24); EntityRef::constructor(&local_2bb8,(Entity *)npc); (*pcVar2)(&local_2bb8); pEVar33 = local_28c4; } cVar21 = local_28c5; if (pEVar33->_type == 9) { pEVar33->_dead = 1; } } else { unused = (Entity *)(*(uint *)((int)&pEVar33->_flags + 4) & 0x10000000); if ((unused != (Entity *)0x0) && (pEVar33->_type != 0x12a)) goto LAB_004c026e; } local_28ec = (Entity *)&local_28ec->field_0x1; } while (local_28ec < (undefined1 *)local_28cc[0x11]._filename._size); } } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_2a64,0x129,-1,-1,0,0); local_14 = 0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&hushBoils,0x12a,-1,-1,0,0); local_14._0_1_ = '\x01'; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&npc->_pos,npc->_size, 0xffffffff); local_14._0_1_ = '\x02'; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&effectsVariant96,1000,0x60,-1,0,0); local_14._0_1_ = '\x03'; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&effectsVariant101,1000,0x65,-1,0,0); local_14 = CONCAT31(local_14._1_3_,4); fVar29 = (npc->_pos).x; local_28e8 = (EntityPtr)(fVar29 - 120.0); local_2904 = (EntityPtr *)(fVar29 + 138.46155); fVar29 = (npc->_pos).y; local_28f4 = (uint *)(fVar29 - 146.15385); local_28cc = (ANM2 *)(fVar29 + 69.230774); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&local_48,9,-1,-1,0,0); uVar8 = 0; if (local_48._shift3 != 0) { do { iVar25 = *(int *)(local_48._shift1 + uVar8 * 4); fVar28 = 0.0; fVar29 = (npc->_pos).y; fVar31 = *(float *)(iVar25 + 0x340); if (fVar31 < fVar29) { fVar32 = *(float *)(iVar25 + 0x33c) + *(float *)(iVar25 + 0x34c); fVar30 = fVar31 + *(float *)(iVar25 + 0x350); if (((((float)local_28e8 <= fVar32) && (fVar32 <= (float)local_2904)) && ((float)local_28f4 <= fVar30)) && (fVar30 <= (float)local_28cc)) { fVar28 = (fVar29 - fVar31) + 20.0; } } uVar8 = uVar8 + 1; *(float *)(iVar25 + 0x358) = fVar28; } while (uVar8 < (uint)local_48._shift3); } if ((char)local_48._seed == '\0') { local_38 = (undefined1 [8])0x0; if (g_mainHeap == (void *)0x0) { pqVar22 = &g_allocatedBytesNoHeap; } else { pqVar22 = (qword *)((int)g_mainHeap + 0x30); } if (local_48._shift1 != 0) { uVar8 = *(uint *)(local_48._shift1 + -4); qVar4 = *pqVar22; *(uint *)pqVar22 = (uint)*pqVar22 - uVar8; *(uint *)((int)pqVar22 + 4) = *(uint *)((int)pqVar22 + 4) - (uint)((uint)qVar4 < uVar8); free((void *)(local_48._shift1 + -4)); } local_14 = CONCAT31(local_14._1_3_,4); } pvVar3 = effectsVariant96._data; if ((npc->_state != 400) || (npc->_dead != 0)) { uVar8 = 0; if (effectsVariant96._size != 0) { do { local_2a8c = 0; local_2a88 = 0; local_2a84._0_4_ = 0; local_2a84._data = (void *)0x0; local_2a84._capacity = (int)g_vectorZero.x; local_2a84._size = (int)g_vectorZero.y; local_2a74 = g_vectorZero.x; local_2a70 = (void *)g_vectorZero.y; local_2a6c = 0; local_2a68 = 0; (**(code **)(**(int **)((int)pvVar3 + uVar8 * 4) + 0x24))(&local_2a8c); uVar8 = uVar8 + 1; } while (uVar8 < (uint)effectsVariant96._size); npc = (Entity_NPC *)local_28f0; } if (*(char *)((int)npc + 0x173) != '\0') goto LAB_004c5765; } iVar25 = *(int *)((int)npc + 0xb64); if (((iVar25 == 0x10) || (iVar25 == 700)) || ((iVar25 == 0x2c6 || (iVar25 == 0x2d0)))) { *(undefined4 *)((int)npc + 0x35c) = 0; *(undefined1 *)((int)npc + 0x3b0) = 1; *(undefined4 *)((int)npc + 0x354) = 8000; } else if (iVar25 != 2) { if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) != '\0')) { pbVar9 = *(byte **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar15 = "BecomeConvex"; do { bVar6 = *pbVar9; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c0650: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0655; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0650; pbVar9 = pbVar9 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0655: if (uVar8 == 0) goto LAB_004c0691; } *(undefined4 *)((int)npc + 0x35c) = 2; *(undefined1 *)((int)npc + 0x3b0) = 0; *(undefined4 *)((int)npc + 0x354) = 0; } LAB_004c0691: if (*(int *)((int)npc + 0x7c) != 0) { bVar6 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"PopOut"); manager = g_manager; if (bVar6 != 0) { *(undefined4 *)((int)npc + 0x188) = 4; *(undefined4 *)((int)npc + 0x35c) = 2; *(undefined1 *)((int)npc + 0x3b0) = 0; *(undefined4 *)((int)npc + 0x354) = 0; local_28c4 = (Entity *)0x13a; seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xf); local_28ec = (Entity *)0x0; if (0 < nearbyEntities._size) { do { pAVar12 = *(ANM2 **)((int)nearbyEntities._data + (int)local_28ec * 4); local_28c4 = (Entity *) (*(float *)pAVar12[3]._filename._buf - *(float *)((int)npc + 0x33c)); local_28e0 = (float *)(*(float *)(pAVar12[3]._filename._buf + 4) - *(float *)((int)npc + 0x340)); local_28cc = pAVar12; fVar29 = sqrtf((float)local_28c4 * (float)local_28c4 + (float)local_28e0 * (float)local_28e0); pfVar35 = local_28e0; pEVar33 = local_28c4; if (0.0 < fVar29) { pEVar33 = (Entity *)((float)local_28c4 * (1.0 / fVar29)); pfVar35 = (float *)((float)local_28e0 * (1.0 / fVar29)); } uVar8 = (pAVar12->_animDefaultName)._size; if (uVar8 == 0x12a) { pcVar2 = *(code **)(*(int *)(pAVar12->_filename)._buf + 0x24); EntityRef::constructor(&local_2be0,(Entity *)npc); (*pcVar2)(&local_2be0); bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar6 == 0) { fVar29 = *(float *)(*(int *)((int)nearbyEntities._data + (int)local_28ec * 4) + 900); local_2964 = fVar29 + fVar29 + *(float *)((int)npc + 0x380); pfVar35 = &local_2964; if (*(float *)((int)npc + 900) <= local_2964) { pfVar35 = (float *)((int)npc + 900); } *(float *)((int)npc + 0x380) = *pfVar35; } } else { if (uVar8 == 1) { fVar29 = (float)pEVar33 * 20.0; fVar31 = (float)pfVar35 * 20.0; } else { if (uVar8 != 0x129) goto LAB_004c08c8; fVar29 = (float)pEVar33 * 3.0; fVar31 = (float)pfVar35 * 3.0; } pvVar3 = pAVar12[3]._animState._animation; if ((float)pvVar3 != 0.0) { fVar28 = pAVar12[3]._overlayAnimState._animFrame; *(float *)(pAVar12[3]._animDefaultName._buf + 0xc) = (fVar29 * fVar28) / (float)pvVar3 + *(float *)(pAVar12[3]._animDefaultName._buf + 0xc); pAVar12[3]._animDefaultName._size = (uint)((fVar31 * fVar28) / (float)pvVar3 + (float)pAVar12[3]._animDefaultName._size); } } LAB_004c08c8: local_28ec = (Entity *)&local_28ec->field_0x1; } while ((int)local_28ec < nearbyEntities._size); } } if (*(int *)((int)npc + 0x7c) != 0) { bVar6 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"SkinPull"); manager = g_manager; if (bVar6 != 0) { local_28c4 = (Entity *)0x13a; seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xf); } } } player = Game::GetNearestPlayer(g_game,(Vector *)((int)npc + 0x33c)); local_28c4 = *(Entity **)((int)npc + 0x39c); fVar29 = ((Vector *)((int)npc + 0x33c))->x - (player->_pos).x; fVar31 = *(float *)((int)npc + 0x340) - (player->_pos).y; fVar29 = sqrtf(fVar29 * fVar29 + fVar31 * fVar31); if (fVar29 <= 400.0) { auVar34 = ZEXT812(0x3f7d70a4); if ((float)local_28c4 != 1.0) { fVar29 = auVar34._0_4_; auVar34._4_8_ = auVar34._4_8_; auVar34._0_4_ = fVar29 / (((float)local_28c4 + fVar29) - (float)local_28c4 * fVar29); } *(float *)((int)npc + 0xbb0) = auVar34._0_4_ * *(float *)((int)npc + 0xbb0); } else { *(float *)((int)npc + 0xbb0) = (float)local_28c4 / 30.0 + *(float *)((int)npc + 0xbb0); } local_28e0 = (float *)(*(float *)((int)npc + 0x380) / *(float *)((int)npc + 900)); fVar29 = *(float *)((int)npc + 0xbb4); if ((0.8 - fVar29 * 0.2 < (float)local_28e0) || (4.0 <= fVar29)) { local_28ec = (Entity *)(int)fVar29; } else { local_28ec = (Entity *)(int)(fVar29 + 1.0); *(float *)((int)npc + 0xbb4) = fVar29 + 1.0; *(undefined4 *)((int)npc + 0xb64) = 0x10; pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 == (byte *)0x0) { LAB_004c0ad2: bVar6 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"TurnConcave",1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pcVar15 = "TurnConcave"; do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c0ab4: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0ab9; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0ab4; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0ab9: if ((uVar8 != 0) || ((pbVar9[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_004c0ad2; } manager = g_manager; local_28c4 = (Entity *)0x1a6; seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,2,0,1.0,0.0); *(undefined4 *)((int)npc + 0x410) = 0; } fVar29 = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); *(float *)((int)npc + 0x360) = *(float *)((int)npc + 0x334) - *(float *)((int)npc + 0x33c); *(float *)((int)npc + 0x364) = fVar29; local_2900 = local_28ec; fVar29 = sqrtf(*(float *)((int)npc + 0x360) * *(float *)((int)npc + 0x360) + fVar29 * fVar29); fVar31 = 0.0; if ((2.0 < fVar29) && (0.0 < fVar29)) { *(float *)((int)npc + 0x360) = (2.0 / fVar29) * *(float *)((int)npc + 0x360); *(float *)((int)npc + 0x364) = (2.0 / fVar29) * *(float *)((int)npc + 0x364); } iVar25 = *(int *)((int)npc + 0xb64); if (iVar25 == 3) { if (0 < *(int *)((int)npc + 0x410)) { iVar16 = ((int)*(float *)((int)npc + 0x3a0) - (int)*(float *)((int)npc + 0x3a4)) + *(int *)((int)npc + 0x410); iVar25 = 0; if (0 < iVar16) { iVar25 = iVar16; } *(int *)((int)npc + 0x410) = iVar25; } pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 == (byte *)0x0) { pbVar7 = &s_empty; } else { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } } pbVar10 = (&PTR_s_FaceVanishFromLeft_00b6013c)[*(int *)((int)npc + 0xbc0)]; do { bVar6 = *pbVar7; bVar27 = bVar6 < *pbVar10; if (bVar6 != *pbVar10) { LAB_004c0c70: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0c75; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < pbVar10[1]; if (bVar6 != pbVar10[1]) goto LAB_004c0c70; pbVar7 = pbVar7 + 2; pbVar10 = pbVar10 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0c75: if (uVar8 == 0) { if ((pbVar9 != (byte *)0x0) && (*(char *)((int)npc + 0x8c) != '\0')) goto LAB_004c0f2f; pcVar15 = "FaceAppearDown"; *(undefined4 *)((int)npc + 0xbc0) = 3; pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 == (byte *)0x0) { pcVar15 = "FaceAppearDown"; } else { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c0cd0: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0cd5; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0cd0; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0cd5: if (uVar8 == 0) { if ((pbVar9[0x34] == 0) || (*(char *)((int)npc + 0x8c) != '\0')) goto LAB_004c0f2f; pcVar15 = "FaceAppearDown"; } else { pcVar15 = "FaceAppearDown"; } } LAB_004c0f18: bVar6 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)pcVar15,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { if ((pbVar9 == (byte *)0x0) || (*(char *)((int)npc + 0x8c) == '\0')) { if (local_2900 == (Entity *)0x1) { local_28cc = *(ANM2 **)((int)npc + 0x338); pVVar14 = Room::GetCenterPos(&local_2acc); if ((float)local_28cc < pVVar14->y) { pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pcVar15 = "Moving"; do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c0e87: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0e8c; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0e87; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0e8c: if (uVar8 == 0) { if ((pbVar9[0x34] != 0) && (*(char *)((int)npc + 0x8c) == '\0')) { pcVar15 = "Moving"; goto LAB_004c0f18; } goto LAB_004c0f2f; } } pcVar15 = "Moving"; goto LAB_004c0f18; } } pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pcVar15 = "Wiggle"; do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) goto LAB_004c0ef3; if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0ef3; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); LAB_004c0eef: uVar8 = 0; goto LAB_004c0ef8; } LAB_004c0f11: pcVar15 = "Wiggle"; goto LAB_004c0f18; } pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 == (byte *)0x0) { pbVar9 = &s_empty; } else if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar15 = "Moving"; do { bVar6 = *pbVar9; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c0d70: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0d75; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0d70; pbVar9 = pbVar9 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0d75: if (uVar8 == 0) { local_28cc = (ANM2 *)(*(float *)((int)npc + 0x338) + 2.0); *(ANM2 **)((int)npc + 0x338) = local_28cc; pVVar14 = Room::GetCenterPos(&local_2ad4); if (pVVar14->y <= (float)local_28cc) { pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pcVar15 = "Wiggle"; do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) goto LAB_004c0ef3; if (bVar6 == 0) goto LAB_004c0eef; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0ef3; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; goto LAB_004c0ef8; } goto LAB_004c0f11; } } } LAB_004c0f2f: if ((((*(int *)((int)npc + 0x410) < 1) || ((float)local_28e0 < 0.005)) && (*(int *)((int)npc + 0x7c) != 0)) && (*(char *)((int)npc + 0x8c) != '\0')) { pbVar9 = *(byte **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar15 = "Wiggle"; do { bVar6 = *pbVar9; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c0f94: uVar8 = -(uint)bVar27 | 1; goto LAB_004c0f99; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c0f94; pbVar9 = pbVar9 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c0f99: if (uVar8 == 0) { local_28cc = *(ANM2 **)((int)npc + 0x88); dVar37 = floor((double)(float)local_28cc); local_28cc = (ANM2 *)(float)dVar37; if (((int)dVar37 == 0) && ((uVar8 = Random(), (uVar8 & 1) == 0 || ((float)local_28e0 < 0.005)))) { attackPicker = (WeightedOutcomePicker)0x0; attackPickerEnd = (undefined4 *)0x0; attackPickerCapacity = (undefined4 *)0x0; local_14 = CONCAT31(local_14._1_3_,6); local_28f0 = *(EntityPtr *)((int)npc + 0xbc4); local_28c5 = (*(uint *)((int)npc + 0x16c) & 0x10000000) != 0; if (local_28ec < (Entity *)0x3) { if (((local_28f0 == (EntityPtr)0x258) || (local_28f0 == (EntityPtr)0x2c6)) || (local_28f0 == (EntityPtr)0x2d0)) { local_2984 = 600; puVar13 = &local_2984; local_2980 = 0x19; } else { local_297c = 600; puVar13 = &local_297c; local_2978 = 200; } std::vector<8byte>::_Emplace_reallocate(0,puVar13); } if (((undefined1 *)((int)&local_2900[-1]._luaBridgeRef + 3U) < (undefined1 *)0x3) && (local_28c5 == '\0')) { uVar8 = 0; uVar17 = (int)attackPickerEnd - (int)attackPicker >> 3; if (local_28f0 == (EntityPtr)0x64) { if (uVar17 != 0) { do { if (*(int *)((int)attackPicker + uVar8 * 8) == 100) { piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 0x32; goto LAB_004c1133; } uVar8 = uVar8 + 1; } while (uVar8 < uVar17); } local_298c = 100; local_2988 = 0x32; if (attackPickerEnd == attackPickerCapacity) { puVar13 = &local_298c; goto LAB_004c11bd; } *attackPickerEnd = 100; attackPickerEnd[1] = 0x32; attackPickerEnd = attackPickerEnd + 2; } else { if (uVar17 != 0) { LAB_004c1160: if (*(int *)((int)attackPicker + uVar8 * 8) != 100) goto code_r0x004c1166; piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 200; LAB_004c1133: if (*(int *)((int)attackPicker + 4 + uVar8 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar8 * 8) = 0; } goto LAB_004c11d6; } LAB_004c116b: local_2994 = 100; local_2990 = 200; if (attackPickerEnd == attackPickerCapacity) { puVar13 = &local_2994; LAB_004c11bd: std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,puVar13); } else { *attackPickerEnd = 100; attackPickerEnd[1] = 200; attackPickerEnd = attackPickerEnd + 2; } } } LAB_004c11d6: if (1 < (int)local_2900) { if (local_28f0 == (EntityPtr)0x12c) { LAB_004c12a6: if ((local_28f0 == (EntityPtr)0x2d0) || (2 < (uint)local_2a64._size)) goto LAB_004c12b6; } else { uVar8 = 0; uVar17 = (int)attackPickerEnd - (int)attackPicker >> 3; if (uVar17 != 0) { do { if (*(int *)((int)attackPicker + uVar8 * 8) == 300) { piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 200; if (*(int *)((int)attackPicker + 4 + uVar8 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar8 * 8) = 0; } goto LAB_004c128d; } uVar8 = uVar8 + 1; } while (uVar8 < uVar17); } local_299c = 300; local_2998 = 200; if (attackPickerEnd == attackPickerCapacity) { std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,&local_299c); } else { *attackPickerEnd = 300; attackPickerEnd[1] = 200; attackPickerEnd = attackPickerEnd + 2; } LAB_004c128d: if (((local_28f0 != (EntityPtr)0xd) && (local_28f0 != (EntityPtr)0x2bc)) && (local_28f0 != (EntityPtr)0x2c6)) goto LAB_004c12a6; LAB_004c12b6: if (local_28c5 == '\0') goto LAB_004c137c; } if (((*(uint *)((int)npc + 0x16c) & 0x10000000) == 0) || (local_2a64._size == 0)) { uVar8 = 0; uVar17 = (int)attackPickerEnd - (int)attackPicker >> 3; if (uVar17 != 0) { do { if (*(int *)((int)attackPicker + uVar8 * 8) == 0xd) { piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 100; if (*(int *)((int)attackPicker + 4 + uVar8 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar8 * 8) = 0; } goto LAB_004c137c; } uVar8 = uVar8 + 1; } while (uVar8 < uVar17); } local_29a4 = 0xd; local_29a0 = 100; if (attackPickerEnd == attackPickerCapacity) { std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,&local_29a4); } else { *attackPickerEnd = 0xd; attackPickerEnd[1] = 100; attackPickerEnd = attackPickerEnd + 2; } } } LAB_004c137c: if (2 < (int)local_2900) { if ((local_28f0 == (EntityPtr)0x2c6) || (local_28f0 == (EntityPtr)0x2d0)) { uVar17 = 0; uVar8 = (int)attackPickerEnd - (int)attackPicker >> 3; if (uVar8 != 0) { do { if (*(int *)((int)attackPicker + uVar17 * 8) == 0x2c6) { piVar41 = (int *)((int)attackPicker + 4 + uVar17 * 8); *piVar41 = *piVar41 + 0x19; goto LAB_004c1400; } uVar17 = uVar17 + 1; } while (uVar17 < uVar8); } local_29b4 = 0x2c6; local_29b0 = 0x19; if (attackPickerEnd == attackPickerCapacity) { puVar13 = &local_29b4; goto LAB_004c148d; } *attackPickerEnd = 0x2c6; attackPickerEnd[1] = 0x19; attackPickerEnd = attackPickerEnd + 2; } else { uVar17 = 0; uVar8 = (int)attackPickerEnd - (int)attackPicker >> 3; if (uVar8 != 0) { LAB_004c13b0: if (*(int *)((int)attackPicker + uVar17 * 8) != 0x2c6) goto code_r0x004c13b9; piVar41 = (int *)((int)attackPicker + 4 + uVar17 * 8); *piVar41 = *piVar41 + 100; LAB_004c1400: if (*(int *)((int)attackPicker + 4 + uVar17 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar17 * 8) = 0; } goto LAB_004c14a6; } LAB_004c13be: local_29ac = 0x2c6; local_29a8 = 100; if (attackPickerEnd == attackPickerCapacity) { puVar13 = &local_29ac; LAB_004c148d: std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,puVar13); } else { *attackPickerEnd = 0x2c6; attackPickerEnd[1] = 100; attackPickerEnd = attackPickerEnd + 2; } } LAB_004c14a6: if (12.0 < *(float *)((int)npc + 0xbb0)) { uVar8 = 0; uVar17 = (int)attackPickerEnd - (int)attackPicker >> 3; if (uVar17 != 0) { do { if (*(int *)((int)attackPicker + uVar8 * 8) == 0x2d0) { piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 0xa2c2a; if (*(int *)((int)attackPicker + 4 + uVar8 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar8 * 8) = 0; } goto LAB_004c155c; } uVar8 = uVar8 + 1; } while (uVar8 < uVar17); } local_29e4 = 0x2d0; local_29e0 = 0xa2c2a; if (attackPickerEnd == attackPickerCapacity) { std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,&local_29e4); } else { *attackPickerEnd = 0x2d0; attackPickerEnd[1] = 0xa2c2a; attackPickerEnd = attackPickerEnd + 2; } } LAB_004c155c: uVar17 = 0; uVar8 = (int)attackPickerEnd - (int)attackPicker >> 3; if (local_28f0 == (EntityPtr)0xc8) { if (uVar8 != 0) { do { if (*(int *)((int)attackPicker + uVar17 * 8) == 200) { piVar41 = (int *)((int)attackPicker + 4 + uVar17 * 8); *piVar41 = *piVar41 + 0x19; goto LAB_004c15c5; } uVar17 = uVar17 + 1; } while (uVar17 < uVar8); } local_2a54._0_4_ = 200; local_2a54._data = (void *)0x19; if (attackPickerEnd == attackPickerCapacity) { player = &local_2a54; goto LAB_004c164d; } *attackPickerEnd = 200; attackPickerEnd[1] = 0x19; attackPickerEnd = attackPickerEnd + 2; } else { if (uVar8 != 0) { LAB_004c15f0: if (*(int *)((int)attackPicker + uVar17 * 8) != 200) goto code_r0x004c15f9; piVar41 = (int *)((int)attackPicker + 4 + uVar17 * 8); *piVar41 = *piVar41 + 100; LAB_004c15c5: if (*(int *)((int)attackPicker + 4 + uVar17 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar17 * 8) = 0; } goto LAB_004c1666; } LAB_004c15fe: local_2a54._capacity = 200; local_2a54._size = 100; if (attackPickerEnd == attackPickerCapacity) { player = (EntityList_EL *)&local_2a54._capacity; LAB_004c164d: std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,player); } else { *attackPickerEnd = 200; attackPickerEnd[1] = 100; attackPickerEnd = attackPickerEnd + 2; } } } LAB_004c1666: if ((3 < (int)local_2900) && (local_28c5 == '\0')) { uVar8 = 0; uVar17 = (int)attackPickerEnd - (int)attackPicker >> 3; if (local_28f0 == (EntityPtr)0x190) { if (uVar17 != 0) { do { if (*(int *)((int)attackPicker + uVar8 * 8) == 400) { piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 0x32; goto LAB_004c17ea; } uVar8 = uVar8 + 1; } while (uVar8 < uVar17); } local_2a44[0] = 400; local_2a44[1] = 0x32; if (attackPickerEnd == attackPickerCapacity) { piVar41 = local_2a44; LAB_004c1809: std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,piVar41); } else { *attackPickerEnd = 400; attackPickerEnd[1] = 0x32; attackPickerEnd = attackPickerEnd + 2; } } else { if (uVar17 != 0) { do { if (*(int *)((int)attackPicker + uVar8 * 8) == 400) { piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 0xfa; if (*(int *)((int)attackPicker + 4 + uVar8 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar8 * 8) = 0; } goto LAB_004c178c; } uVar8 = uVar8 + 1; } while (uVar8 < uVar17); } local_2a34 = 400; local_2a30 = 0xfa; if (attackPickerEnd == attackPickerCapacity) { std::vector<8byte>::_Emplace_reallocate(attackPickerEnd,&local_2a34); } else { *attackPickerEnd = 400; attackPickerEnd[1] = 0xfa; attackPickerEnd = attackPickerEnd + 2; } LAB_004c178c: if (local_28f0 == (EntityPtr)0x10) { uVar8 = 0; uVar17 = (int)attackPickerEnd - (int)attackPicker >> 3; if (uVar17 != 0) { LAB_004c17a2: if (*(int *)((int)attackPicker + uVar8 * 8) != 400) goto code_r0x004c17ab; piVar41 = (int *)((int)attackPicker + 4 + uVar8 * 8); *piVar41 = *piVar41 + 2000; LAB_004c17ea: if (*(int *)((int)attackPicker + 4 + uVar8 * 8) < 0) { *(undefined4 *)((int)attackPicker + 4 + uVar8 * 8) = 0; } goto LAB_004c1814; } LAB_004c17b0: local_2a1c = 400; local_2a18 = 2000; if (attackPickerEnd == attackPickerCapacity) { piVar41 = &local_2a1c; goto LAB_004c1809; } *attackPickerEnd = 400; attackPickerEnd[1] = 2000; attackPickerEnd = attackPickerEnd + 2; } } } LAB_004c1814: local_48._seed = Random(); local_48._seed = local_48._seed | 1; local_48._shift1 = 5; local_48._shift2 = 9; local_48._shift3 = 7; rng._shift1 = 5; rng._seed = local_48._seed; rng._shift2 = 9; rng._shift3 = 7; uVar8 = WeightedOutcomePicker::PickOutcome(&attackPicker,rng); *(uint *)((int)npc + 0xb64) = uVar8; if (uVar8 == 100) { pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 == (byte *)0x0) { LAB_004c18ae: bVar6 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),&DAT_00b6009c,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pbVar10 = &DAT_00b6009c; do { bVar6 = *pbVar7; bVar27 = bVar6 < *pbVar10; if (bVar6 != *pbVar10) { LAB_004c1890: uVar8 = -(uint)bVar27 | 1; goto LAB_004c1895; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < pbVar10[1]; if (bVar6 != pbVar10[1]) goto LAB_004c1890; pbVar7 = pbVar7 + 2; pbVar10 = pbVar10 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c1895: if ((uVar8 != 0) || ((pbVar9[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_004c18ae; } uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = uVar8 | 1; } else { if ((uVar8 == 0x2c6) || (uVar8 == 0x2d0)) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"TurnConcave",0); pVVar14 = Room::GetRandomPosition (g_game->_room,&local_2b0c,*(float *)((int)npc + 0x370) * 1.3); *(float *)((int)npc + 0x334) = pVVar14->x; *(float *)((int)npc + 0x338) = pVVar14->y; uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = uVar8 & 0xfffffff0 | 0x10; if (*(int *)((int)npc + 0xb64) == 0x2d0) { uVar8 = Random(); uVar8 = (uVar8 & 1) + 1; } else { uVar8 = Random(); uVar8 = uVar8 % 3; } *(int *)((int)npc + 0xbc4) = *(int *)((int)npc + 0xbc4) + uVar8; local_28c4 = (Entity *)0x1a6; } else { if (uVar8 != 200) { if (uVar8 == 300) { ANM2::Play((ANM2 *)((int)npc + 0x48), (&PTR_s_FaceVanishFromLeft_00b6013c)[*(int *)((int)npc + 0xbc0)],0); uVar8 = Random(); SoundEffects::PlayWithFartOverride (0x1a7,0.5,2,0, (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8); uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = uVar8 % 3 + 1; } else if (uVar8 == 600) { ANM2::Play((ANM2 *)((int)npc + 0x48), (&PTR_s_FaceVanishFromLeft_00b6013c)[*(int *)((int)npc + 0xbc0)],0); uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = uVar8 | 1; uVar8 = Random(); SoundEffects::PlayWithFartOverride (0x1a7,0.5,2,0, (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8); } else if (uVar8 == 400) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"LaserStart",0); } else if (uVar8 == 0xd) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"OpenMouth",0); } else if (uVar8 == 500) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Puffed",0); } goto LAB_004c1b51; } ANM2::Play((ANM2 *)((int)npc + 0x48),&DAT_00b1d47c,0); local_28c4 = (Entity *)0x1a5; } manager = g_manager; seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,2,0,1.0,0.0); } LAB_004c1b51: local_14 = CONCAT31(local_14._1_3_,4); if (attackPicker != (WeightedOutcomePicker)0x0) { deallocate((void *)attackPicker,(int)attackPickerCapacity - (int)attackPicker >> 3); attackPicker = (WeightedOutcomePicker)0x0; attackPickerEnd = (undefined4 *)0x0; attackPickerCapacity = (undefined4 *)0x0; } } } } goto LAB_004c5097; } if ((((iVar25 == 600) || (iVar25 == 700)) || (iVar25 == 0x2c6)) || (iVar25 == 0x2d0)) { local_48._seed = *(uint *)((int)npc + 0xbc4); local_28c4 = (Entity *)&DAT_00000007; local_48._shift3 = 7; iVar25 = *(int *)((int)npc + 0xbc0); local_48._shift1 = 5; local_48._shift2 = 9; local_28ec = (Entity *)(&PTR_s_FaceVanishFromLeft_00b6013c)[iVar25]; local_2904 = (EntityPtr *)(&PTR_s_FaceAppearLeft_00b6015c)[iVar25]; local_28cc = (ANM2 *)(&PTR_s_AttackLoopLeft_00b6014c)[iVar25]; if (local_48._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } local_48._seed = (uint)local_48._seed >> 5 ^ local_48._seed; local_48._seed = local_48._seed << 9 ^ local_48._seed; local_48._seed = (uint)local_48._seed >> 7 ^ local_48._seed; local_28fc = (uint)local_48._seed % 3 + 1; if (local_48._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } iVar25 = 0x30; local_48._seed = (uint)local_48._seed >> 5 ^ local_48._seed; local_48._seed = local_48._seed << 9 ^ local_48._seed; local_48._seed = (uint)local_48._seed >> 7 ^ local_48._seed; local_2924 = (Entity *)((uint)local_48._seed % 3); puVar13 = (undefined4 *)local_2620; do { *puVar13 = 1; puVar13[1] = 5; puVar13[2] = 7; puVar13[3] = 0; puVar13[4] = 0x40a00000; ProjectileParams::ProjectileParams((ProjectileParams *)(puVar13 + 6)); npc = (Entity_NPC *)local_28f0; puVar13[0x30] = 0xffffffff; puVar13[9] = 0xbdb851ec; puVar13[8] = 0xc0000000; puVar13[0xb] = 0x3f99999a; puVar13[0x2d] = 0x40000000; iVar25 = iVar25 + -1; puVar13 = puVar13 + 0x32; } while (iVar25 != 0); pEVar33 = Entity_NPC::GetPlayerTarget((Entity_NPC *)local_28f0); local_290c = (Entity *)((pEVar33->_pos).x - *(float *)((int)npc + 0x33c)); local_2908 = (float *)((pEVar33->_pos).y - *(float *)((int)npc + 0x340)); local_2928 = atan2f((float)local_2908,(float)local_290c); local_28dc = (WeightedOutcomePicker)0x0; local_28e4 = (WeightedOutcomePicker)0x0; do { if (local_28e4 == (WeightedOutcomePicker)0x0) { if (*(int *)((int)npc + 0x7c) != 0) { iVar25 = 0; goto LAB_004c3d08; } } else if (local_28e4 == (WeightedOutcomePicker)0x1) { if (*(int *)((int)npc + 0x7c) != 0) { iVar25 = 1; goto LAB_004c3d08; } } else if ((local_28e4 == (WeightedOutcomePicker)0x2) && (*(int *)((int)npc + 0x7c) != 0)) { iVar25 = 2; LAB_004c3d08: pfVar35 = AnimationState::GetNullFrameById((AnimationState *)((int)npc + 0x78),iVar25); if (pfVar35 != (float *)0x0) { pEVar33 = Entity_NPC::GetPlayerTarget(npc); local_290c = (Entity *) ((pEVar33->_pos).x - (*pfVar35 / 0.65 + *(float *)((int)npc + 0x33c) + 0.0)); local_2908 = (float *)((pEVar33->_pos).y - (pfVar35[1] / 0.65 + *(float *)((int)npc + 0x340) + 23.0)); local_2928 = atan2f((float)local_2908,(float)local_290c); } } WVar18 = local_28e4; iVar25 = (int)local_28e4 * 0xc80; pEVar33 = (Entity *)(local_2620 + iVar25); local_28c4 = pEVar33; if (local_28fc == 1) { if (local_28e4 == (WeightedOutcomePicker)local_2924) goto LAB_004c3de3; } else if (local_28fc == 2) { if (local_28e4 != (WeightedOutcomePicker)local_2924) goto LAB_004c3de3; } else if (local_28fc == 3) { LAB_004c3de3: local_28e0 = (float *)0x0; iVar16 = 3; if (local_2900 == (Entity *)0x1) { iVar16 = 5; local_28e0 = (float *)0x1; } else if (local_2900 == (Entity *)0x2) { local_28e0 = (float *)0x3; iVar16 = 6; } uVar8 = RNG::RandomInt(&local_48,(iVar16 - (int)local_28e0) + 1); iVar16 = uVar8 + (int)local_28e0; local_2560[(int)WVar18 * 800] = iVar16; if (iVar16 == 0) { local_28e0 = (float *)0x0; iVar25 = 6 - local_28fc; *(int *)pEVar33 = iVar25; local_28f4 = (uint *)(iVar25 / 2); if (0 < iVar25) { local_28e8 = (EntityPtr)(local_28fc * 2 + 2); local_28f8 = auStack_25b0 + (int)WVar18 * 800; puVar24 = local_28f4; do { local_28f8[-0x10] = (uint)local_2928; local_28f8[-0x1b] = 1; local_28f8[-0x18] = 0x40e00000; if (local_28e4 == (WeightedOutcomePicker)0x0) { *local_28f8 = *local_28f8 | 0x8000000; LAB_004c3eb2: local_28f8[1] = local_28f8[1]; } else if (local_28e4 == (WeightedOutcomePicker)0x1) { *local_28f8 = *local_28f8 | 0x10000000; goto LAB_004c3eb2; } uVar17 = (*(int *)pEVar33 + (int)puVar24) * (int)local_28e8; local_28f8[-0x1a] = uVar17; uVar8 = ((int)uVar17 / local_28fc) * (int)local_28dc; local_28f8[-0x19] = uVar8; iVar25 = ((int)uVar17 / (*(int *)local_28c4 + (int)local_28f4)) * (int)local_28e0; local_28e0 = (float *)((int)local_28e0 + 1); local_28f8[-0x19] = iVar25 + uVar8; local_28f8 = local_28f8 + 0x32; puVar24 = local_28f4; pEVar33 = local_28c4; } while ((int)local_28e0 < *(int *)local_28c4); npc = (Entity_NPC *)local_28f0; } } else if (iVar16 == 1) { *(int *)pEVar33 = 4; local_28e0 = local_25fc + (int)WVar18 * 800 + 3; local_28c4 = (Entity *)local_28e4; local_25fc[(int)WVar18 * 800 + 3] = (((float)((double)(int)local_28e4 + __uint_to_double_fixup[-((int)local_28e4 >> 0x1f)]) + (float)((double)(int)local_28e4 + __uint_to_double_fixup[-((int)local_28e4 >> 0x1f)] )) * 3.1415927) / (float)local_28fc + ((float)*(int *)((int)npc + 0x410) * 4.3039823) / 30.0; if (local_28e4 == (WeightedOutcomePicker)0x2) { local_28f8 = (uint *)0x4; if (local_48._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } local_48._seed = (uint)local_48._seed >> ((byte)local_48._shift1 & 0x1f) ^ local_48._seed; local_48._seed = local_48._seed << ((byte)local_48._shift2 & 0x1f) ^ local_48._seed; local_48._seed = (uint)local_48._seed >> ((byte)local_48._shift3 & 0x1f) ^ local_48._seed; local_28c4 = (Entity *)(local_48._seed & 1); } local_28f4 = (uint *)0x0; puVar13 = (undefined4 *)(local_2620 + iVar25 + 4); local_28e8 = (EntityPtr)(local_28fc * 10); EVar20 = local_28e8; do { if (0 < (int)local_28f4) { puVar13[0xb] = (float)puVar13[-0x27] - 0.06283186; } *(EntityPtr *)(puVar13 + 1) = EVar20; if (local_28fc == 1) { *puVar13 = 4; EVar20 = (EntityPtr)0x14; puVar13[1] = 0x14; } else if (local_28fc == 2) { *puVar13 = 3; EVar20 = (EntityPtr)0x19; puVar13[1] = 0x19; } else if (local_28fc == 3) { *puVar13 = 2; EVar20 = (EntityPtr)0x1e; puVar13[1] = 0x1e; } iVar25 = (int)local_28f4 * 2; local_28f4 = (uint *)((int)local_28f4 + 1); puVar13[2] = ((int)EVar20 / local_28fc) * (int)local_28dc + iVar25; puVar13 = puVar13 + 0x32; local_28f8 = *(uint **)pEVar33; EVar20 = local_28e8; } while ((int)local_28f4 < (int)local_28f8); iVar25 = 0; npc = (Entity_NPC *)local_28f0; if (0 < (int)local_28f8) { pfVar35 = local_28e0; do { if (local_28c4 == (Entity *)0x1) { *pfVar35 = *pfVar35 * -1.0; } iVar25 = iVar25 + 1; pfVar35 = pfVar35 + 0x32; } while (iVar25 < *(int *)pEVar33); } } else if (iVar16 == 3) { local_28e8 = (EntityPtr)((int)(0x3c / (longlong)local_28fc) * (int)local_28dc); *(int *)pEVar33 = 2; local_28f8 = (uint *)0x0; do { if (local_28fc == 1) { *(undefined4 *)((int)&(pEVar33->_sprite)._filename + (int)local_28f8 * 200 + -0x44) = 0x14; } else if (local_28fc == 2) { *(undefined4 *)((int)&(pEVar33->_sprite)._filename + (int)local_28f8 * 200 + -0x44) = 0x10; } else if (local_28fc == 3) { *(undefined4 *)((int)&(pEVar33->_sprite)._filename + (int)local_28f8 * 200 + -0x44) = 0xc; } local_28f4 = (uint *)0x40000; local_28e0 = (float *)((int)local_28f8 * 200); *(float *)((int)(local_28e0 + 0xc) + (int)pEVar33) = ((float)*(int *)((int)npc + 0x410) * 0.31415927) / 30.0; if (local_28f8 != (uint *)0x0) { local_28f4 = (uint *)0x80000; } local_28c4 = (Entity *)0x0; *(undefined4 *)((int)(local_28e0 + 0xe) + (int)pEVar33) = 0x3b449ba6; *(uint *)((int)(local_28e0 + 0x1c) + (int)pEVar33) = (uint)local_28f4 | *(uint *)((int)(local_28e0 + 0x1c) + (int)pEVar33) | 0x2000; *(undefined4 *)((int)(local_28e0 + 0x1d) + (int)pEVar33) = *(undefined4 *)((int)(local_28e0 + 0x1d) + (int)pEVar33); *(undefined4 *)((int)(local_28e0 + 4) + (int)pEVar33) = 0x40800000; *(undefined4 *)((int)(local_28e0 + 9) + (int)pEVar33) = 0xbdae147b; *(undefined4 *)((int)(local_28e0 + 2) + (int)pEVar33) = 0x3c; *(uint *)((int)(local_28e0 + 3) + (int)pEVar33) = (-(uint)(local_28f8 != (uint *)0x0) & 0x1e) + (int)local_28e8; local_28f8 = (uint *)((int)local_28f8 + 1); npc = (Entity_NPC *)local_28f0; } while ((int)local_28f8 < *(int *)pEVar33); local_2900 = local_2900; } else if (iVar16 == 6) { if (local_28fc == 1) { *(int *)pEVar33 = 0x10; } else if (local_28fc == 2) { *(int *)pEVar33 = 0xc; } else if (local_28fc == 3) { *(int *)pEVar33 = 8; } local_28e8 = (EntityPtr)0x0; if (0 < *(int *)pEVar33) { local_28f4 = auStack_25b0 + (int)WVar18 * 800; pfVar35 = (float *)(local_2928 + 3.1415927); iVar25 = 0; local_28e0 = pfVar35; local_28f8 = (uint *)((int)(0x5a / (longlong)local_28fc) * (int)local_28dc); do { local_28f4[-0x1b] = 1; local_28e8 = (EntityPtr)(float)iVar25; fVar29 = (float)iVar25 * 3.1415927; local_28f4[-0x10] = (uint)((fVar29 + fVar29) / (float)*(int *)pEVar33 + (float)pfVar35); *local_28f4 = *local_28f4 | 0x40000; local_28f4[1] = local_28f4[1]; local_28c4 = (Entity *)(float)*(int *)pEVar33; if ((float)*(int *)pEVar33 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); pfVar35 = local_28e0; } iVar25 = iVar25 + 1; fVar29 = ((float)local_28e8 - 0.0) / ((float)local_28c4 - 0.0); if (fVar29 <= 0.0) { fVar29 = 0.0; } if (1.0 <= fVar29) { fVar29 = 1.0; } local_28f4[-0xe] = (uint)(fVar29 * 0.02 - 0.01); *local_28f4 = *local_28f4 | 0x2000; local_28f4[1] = local_28f4[1]; local_28f4[-0x18] = 0x40c00000; local_28f4[-0x13] = 0xbd8f5c29; local_28f4[-0x1a] = 0x5a; local_28f4[-0x19] = (uint)local_28f8; local_28f4 = local_28f4 + 0x32; } while (iVar25 < *(int *)pEVar33); npc = (Entity_NPC *)local_28f0; } } else if (iVar16 == 2) { if (local_28fc == 1) { *(int *)pEVar33 = 0x10; } else if (local_28fc == 2) { *(int *)pEVar33 = 0xc; } else if (local_28fc == 3) { *(int *)pEVar33 = 8; } local_28f4 = (uint *)0x0; if (0 < *(int *)pEVar33) { pfVar35 = local_25fc + (int)WVar18 * 800 + 3; local_28f8 = (uint *)((int)(0x5a / (longlong)local_28fc) * (int)local_28dc); iVar25 = *(int *)pEVar33; do { fVar29 = (float)(int)local_28f4 / (float)(iVar25 + -1); fVar29 = (fVar29 + fVar29) - 1.0; local_28e8 = (EntityPtr)(fVar29 + 0.0); local_28c4 = (Entity *)((1.0 - fVar29 * fVar29) + 7.0); local_28e0 = (float *)atan2f((float)local_28e8,(float)local_28c4); fVar29 = sqrtf((float)local_28e8 * (float)local_28e8 + (float)local_28c4 * (float)local_28c4); local_28f4 = (uint *)((int)local_28f4 + 1); pfVar35[-8] = fVar29; *pfVar35 = (float)local_28e0 + local_2928; pfVar35[-0xb] = 1.4013e-45; pfVar35[-10] = 1.26117e-43; pfVar35[-9] = (float)local_28f8; pfVar35 = pfVar35 + 0x32; iVar25 = *(int *)pEVar33; } while ((int)local_28f4 < iVar25); npc = (Entity_NPC *)local_28f0; } } else if (iVar16 == 4) { puVar13 = (undefined4 *)(local_2620 + iVar25 + 4); local_28e8 = (EntityPtr)((int)(0xf / (longlong)local_28fc) * (int)local_28dc); *(int *)pEVar33 = 1; local_28f4 = (uint *)0x0; do { if (local_28fc == 1) { *puVar13 = 5; } else if (local_28fc == 2) { *puVar13 = 4; } else if (local_28fc == 3) { *puVar13 = 3; } puVar13[0xb] = ((float)*(int *)((int)npc + 0x410) * 0.6911504) / 30.0; puVar13[0xe] = 0x3f83d70a; puVar13[3] = 0x40c00000; puVar13[0x1b] = puVar13[0x1b] | 0x10000000; puVar13[0x1c] = puVar13[0x1c] | 3; puVar13[0x28] = 0x69; puVar13[0x25] = 0x40000; puVar13[0x26] = 0; puVar13[0x27] = 0x40c00000; puVar13[0xd] = 0x3b449ba6; puVar13[1] = 0xf; *(EntityPtr *)(puVar13 + 2) = local_28e8; puVar13 = puVar13 + 0x32; local_28f4 = (uint *)((int)local_28f4 + 1); } while ((int)local_28f4 < *(int *)pEVar33); } else if (iVar16 == 5) { *(int *)pEVar33 = 1; local_28f4 = (uint *)0x0; local_28e8 = (EntityPtr) sqrtf((float)local_290c * (float)local_290c + (float)local_2908 * (float)local_2908); local_28e0 = (float *)(local_2620 + iVar25 + 4); do { pfVar35 = local_28e0; *local_28e0 = 8.40779e-44; if (local_28fc == 1) { local_28e0[1] = 1.12104e-43; } else if (local_28fc == 2) { local_28e0[1] = 1.68156e-43; } else if (local_28fc == 3) { local_28e0[1] = 2.24208e-43; } local_28f8 = (uint *)0xa; do { if ((float)local_28e8 <= 0.0) { pEVar33 = local_290c; pfVar19 = local_2908; } else { pEVar33 = (Entity *)((float)local_290c * (-1.0 / (float)local_28e8)); pfVar19 = (float *)((float)local_2908 * (-1.0 / (float)local_28e8)); } pfVar35[0x21] = (float)pEVar33; pfVar35[0x22] = (float)pfVar19; uVar8 = Random(); local_2940.y = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 90.0 * 0.017453292; local_30 = (undefined4 *)cos(local_2940.y); fVar29 = sin(local_2940.y); local_28f8 = (uint *)((int)local_28f8 + -1); fVar31 = pfVar35[0x22] * (float)local_30 + pfVar35[0x21] * fVar29; pfVar35[0x21] = pfVar35[0x21] * (float)local_30 - pfVar35[0x22] * fVar29; pfVar35[0x22] = fVar31; fVar29 = *(float *)((int)npc + 0x370) + 120.0; local_29cc.y = fVar31 * fVar29 * -1.0 + *(float *)((int)npc + 0x340); local_29cc.x = fVar29 * pfVar35[0x21] * -1.0 + *(float *)((int)npc + 0x33c); bVar6 = Room::IsPositionInRoom(g_game->_room,&local_29cc,20.0); } while ((bVar6 == 0) && (0 < (int)local_28f8)); if (local_28f8 == (uint *)0x0) { *local_28e0 = 0.0; } local_28e0[0x23] = -0.94; local_28e0[3] = 4.0; local_28e0[2] = (float)(((int)local_28e0[1] / local_28fc) * (int)local_28dc); local_28e0 = local_28e0 + 0x32; local_28f4 = (uint *)((int)local_28f4 + 1); } while ((int)local_28f4 < *(int *)local_28c4); } local_28dc = (WeightedOutcomePicker)((int)local_28dc + 1); } local_28e4 = (WeightedOutcomePicker)&((Entity *)local_28e4)->field_0x1; } while ((uint)local_28e4 < (undefined1 *)0x3); pbVar9 = *(byte **)((int)npc + 0x7c); if ((pbVar9 == (byte *)0x0) || (*(char *)((int)npc + 0x8c) == '\0')) { LAB_004c4ea2: if (*(int *)((int)npc + 0xb64) == 600) { if (pbVar9 == (byte *)0x0) { bVar27 = *(byte *)local_28ec == 0; LAB_004c4f0b: if (!bVar27) { LAB_004c500a: if (*(int *)((int)npc + 0xb64) == 600) { if (pbVar9 == (byte *)0x0) { bVar27 = *(byte *)local_2904 == 0; LAB_004c507b: if (bVar27) { LAB_004c507d: ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)local_28cc,0); *(undefined4 *)((int)npc + 0x410) = 0; } } else if (*(char *)((int)npc + 0x8c) == '\0') { if (*(byte *)local_2904 != 0) { pbVar9 = *(byte **)((int)npc + 0x7c); pEVar26 = local_2904; if (pbVar9 == (byte *)0x0) { pbVar9 = &s_empty; } else if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } do { bVar6 = *pbVar9; bVar27 = bVar6 < *(byte *)pEVar26; if (bVar6 != *(byte *)pEVar26) { LAB_004c5074: uVar8 = -(uint)bVar27 | 1; goto LAB_004c5079; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < (byte)pEVar26->field_0x1; if (bVar6 != pEVar26->field_0x1) goto LAB_004c5074; pbVar9 = pbVar9 + 2; pEVar26 = (EntityPtr *)&pEVar26->field_0x2; } while (bVar6 != 0); uVar8 = 0; LAB_004c5079: bVar27 = uVar8 == 0; goto LAB_004c507b; } goto LAB_004c507d; } } goto LAB_004c5097; } } else { if (*(char *)((int)npc + 0x8c) != '\0') goto LAB_004c500a; if (*(byte *)local_28ec != 0) { pbVar7 = pbVar9; pEVar33 = local_28ec; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } do { bVar6 = *pbVar7; bVar27 = bVar6 < *(byte *)pEVar33; if (bVar6 != *(byte *)pEVar33) { LAB_004c4f04: uVar8 = -(uint)bVar27 | 1; goto LAB_004c4f09; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pEVar33->field_0x1; if (bVar6 != pEVar33->field_0x1) goto LAB_004c4f04; pbVar7 = pbVar7 + 2; pEVar33 = (Entity *)&pEVar33->field_0x2; } while (bVar6 != 0); uVar8 = 0; LAB_004c4f09: bVar27 = uVar8 == 0; goto LAB_004c4f0b; } } pEVar33 = Entity_NPC::GetPlayerTarget(npc); fVar31 = (pEVar33->_pos).x - *(float *)((int)npc + 0x33c); fVar29 = (pEVar33->_pos).y - *(float *)((int)npc + 0x340); if (ABS(fVar31) <= ABS(fVar29)) { iVar25 = (uint)(0.0 <= fVar29) * 2 + 1; } else { iVar25 = 2; if (fVar31 < 0.0) { iVar25 = 0; } } local_28e8 = *(EntityPtr *)(&PTR_s_FaceAppearLeft_00b6015c + iVar25); *(int *)((int)npc + 0xbc0) = iVar25; pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar7 = pbVar9; EVar20 = local_28e8; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } do { bVar6 = *pbVar7; bVar27 = bVar6 < *(byte *)EVar20; if (bVar6 != *(byte *)EVar20) { LAB_004c4fb6: uVar8 = -(uint)bVar27 | 1; goto LAB_004c4fbb; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < *(byte *)((int)EVar20 + 1); if (bVar6 != *(byte *)((int)EVar20 + 1)) goto LAB_004c4fb6; pbVar7 = pbVar7 + 2; EVar20 = (EntityPtr)((int)EVar20 + 2); } while (bVar6 != 0); uVar8 = 0; LAB_004c4fbb: if ((uVar8 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004c5097; } bVar6 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)local_28e8,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } } else { if ((local_28cc->_filename)._buf[0] != '\0') { pbVar7 = pbVar9; pAVar12 = local_28cc; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } do { bVar6 = *pbVar7; bVar1 = (pAVar12->_filename)._buf[0]; bVar27 = bVar6 < bVar1; if (bVar6 != bVar1) { LAB_004c4940: uVar8 = -(uint)bVar27 | 1; goto LAB_004c4945; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar1 = (pAVar12->_filename)._buf[1]; bVar27 = bVar6 < bVar1; if (bVar6 != bVar1) goto LAB_004c4940; pbVar7 = pbVar7 + 2; pAVar12 = (ANM2 *)((pAVar12->_filename)._buf + 2); } while (bVar6 != 0); uVar8 = 0; LAB_004c4945: if (uVar8 != 0) { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pcVar15 = "MovingConcaveEyesOpen"; do { bVar6 = *pbVar7; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c4978: uVar8 = -(uint)bVar27 | 1; goto LAB_004c497d; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c4978; pbVar7 = pbVar7 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c497d: if (uVar8 != 0) goto LAB_004c4ea2; } } if (0 < (int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)) { local_28c4 = (Entity *)0x0; do { pEVar33 = local_28c4; local_28e0 = (float *)((int)local_28c4 * 0xc80); if (local_2560[(int)local_28c4 * 800] != -1) { local_28dc = (WeightedOutcomePicker)0x0; if (local_28c4 == (Entity *)0x0) { if (*(int *)((int)npc + 0x7c) == 0) { pfVar35 = (float *)0x0; } else { iVar25 = 0; LAB_004c4a06: pfVar35 = AnimationState::GetNullFrameById ((AnimationState *)((int)npc + 0x78),iVar25); } LAB_004c4a0e: local_28dc = (WeightedOutcomePicker)pfVar35; } else { if (local_28c4 == (Entity *)0x1) { if (*(int *)((int)npc + 0x7c) != 0) { iVar25 = 1; goto LAB_004c4a06; } pfVar35 = (float *)0x0; goto LAB_004c4a0e; } if (local_28c4 == (Entity *)0x2) { pfVar35 = (float *)0x0; if (*(int *)((int)npc + 0x7c) != 0) { iVar25 = 2; goto LAB_004c4a06; } goto LAB_004c4a0e; } } local_28e8 = (EntityPtr)0x0; if (0 < *(int *)(local_2620 + (int)local_28e0)) { pfVar35 = (float *)((int)afStack_25bc + (int)local_28e0); pfVar19 = local_28e0; do { if ((*(int *)((int)npc + 0x410) - (int)pfVar35[-0x16]) % (int)pfVar35[-0x17] == 0) { local_26c8[0] = *(byte *)(pfVar35 + -0x13); local_26c8._4_4_ = pfVar35[-0x12]; local_26c8._8_4_ = pfVar35[-0x11]; local_26c8._12_4_ = pfVar35[-0x10]; local_26c8._16_4_ = pfVar35[-0xf]; local_26c8._20_4_ = pfVar35[-0xe]; local_26c8._24_4_ = pfVar35[-0xd]; local_26c8._28_4_ = pfVar35[-0xc]; local_26c8._32_4_ = pfVar35[-0xb]; local_26c8._36_4_ = pfVar35[-10]; local_26c8._40_4_ = pfVar35[-9]; local_26c8._44_4_ = pfVar35[-8]; local_26c8._48_4_ = pfVar35[-7]; local_26c8._52_4_ = pfVar35[-6]; local_26c8._56_4_ = pfVar35[-5]; local_26c8._60_4_ = pfVar35[-4]; local_26c8._64_4_ = pfVar35[-3]; local_26c8._68_4_ = pfVar35[-2]; local_26c8._72_4_ = pfVar35[-1]; local_26c8._76_8_ = *(undefined8 *)pfVar35; local_26c8._84_4_ = pfVar35[2]; local_26c8._88_4_ = pfVar35[3]; local_266c = pfVar35[4]; local_2668 = pfVar35[5]; local_2664 = pfVar35[6]; local_2660 = pfVar35[7]; local_265c = pfVar35[8]; local_2658 = pfVar35[9]; local_2654 = pfVar35[10]; local_2650 = pfVar35[0xb]; local_264c = pfVar35[0xc]; local_2648 = pfVar35[0xd]; local_2644 = pfVar35[0xe]; local_2640 = pfVar35[0xf]; local_263c = pfVar35[0x10]; local_2638 = pfVar35[0x11]; local_2634 = pfVar35[0x12]; local_2630 = *(undefined1 *)(pfVar35 + 0x13); local_262c = pfVar35[0x14]; local_2628 = pfVar35[0x15]; local_2624 = *(undefined1 *)(pfVar35 + 0x16); local_2634 = 8.40779e-45; if (local_28c4 == (Entity *)0x0) { Color::Reset(&local_2b90); local_26c8._44_4_ = 1.0; local_26c8._48_4_ = 1.0; local_26c8._52_4_ = 1.0; local_26c8._56_4_ = 1.0; local_2b90._offset[2] = 0.0; local_26c8._84_4_ = 0.0; local_26c8._60_4_ = local_2b90._colorize[0]; local_26c8._64_4_ = local_2b90._colorize[1]; local_26c8._68_4_ = local_2b90._colorize[2]; local_26c8._72_4_ = local_2b90._colorize[3]; local_26c8._76_4_ = 0.4; LAB_004c4cd7: local_26c8._56_4_ = 1.0; local_26c8._52_4_ = 1.0; local_26c8._48_4_ = 1.0; local_26c8._44_4_ = 1.0; local_26c8._80_4_ = 0.2; } else { if (local_28c4 == (Entity *)0x1) { Color::Reset(&local_2b38); local_26c8._44_4_ = 1.0; local_26c8._48_4_ = 1.0; local_26c8._52_4_ = 1.0; local_26c8._56_4_ = 1.0; local_2b38._offset[2] = 0.4; local_26c8._84_4_ = 0.4; local_26c8._60_4_ = local_2b38._colorize[0]; local_26c8._64_4_ = local_2b38._colorize[1]; local_26c8._68_4_ = local_2b38._colorize[2]; local_26c8._72_4_ = local_2b38._colorize[3]; local_26c8._76_4_ = 0.0; goto LAB_004c4cd7; } if (local_28c4 == (Entity *)0x2) { Color::Reset(&local_2b64); local_26c8._44_4_ = 1.0; local_26c8._48_4_ = 1.0; local_26c8._52_4_ = 1.0; local_26c8._56_4_ = 1.0; local_2b64._offset[2] = 0.0; local_26c8._84_4_ = 0.0; local_26c8._60_4_ = local_2b64._colorize[0]; local_26c8._64_4_ = local_2b64._colorize[1]; local_26c8._68_4_ = local_2b64._colorize[2]; local_26c8._72_4_ = local_2b64._colorize[3]; local_26c8._76_4_ = 0.2; goto LAB_004c4cd7; } } if (local_28dc != (WeightedOutcomePicker)0x0) { local_2668 = *(float *)local_28dc / 0.65 + 0.0; local_2664 = *(float *)((int)local_28dc + 4) / 0.65 + 23.0; local_2638 = 30.0; if (*(int *)((int)npc + 0xbc0) != 1) { local_2638 = 20.0; } local_265c = local_2664 + *(float *)((int)npc + 0x340); local_2660 = local_2668 + *(float *)((int)npc + 0x33c); local_29d4.x = pfVar35[-0x15]; local_29d4.y = (float)(int)pfVar35[-0x18]; Entity_NPC::FireProjectiles (npc,(Vector *)((int)npc + 0x33c),&local_29d4,9, (ProjectileParams *)local_26c8); } pfVar19 = local_28e0; } pfVar35 = pfVar35 + 0x32; local_28e8 = (EntityPtr)((int)local_28e8 + 1); } while ((int)local_28e8 < *(int *)(local_2620 + (int)pfVar19)); pEVar33 = local_28c4; } } local_28c4 = (Entity *)&pEVar33->field_0x1; } while ((int)&pEVar33->field_0x1 < 3); iVar25 = *(int *)((int)npc + 0x410) + ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)); *(int *)((int)npc + 0x410) = iVar25; if ((0x96 < iVar25) && (*(int *)((int)npc + 0xb64) == 600)) { pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 == (byte *)0x0) { LAB_004c4e7a: bVar6 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)local_28ec,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } } else { pbVar7 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar7 = *(byte **)pbVar9; } pEVar33 = local_28ec; do { bVar6 = *pbVar7; bVar27 = bVar6 < *(byte *)pEVar33; if (bVar6 != *(byte *)pEVar33) { LAB_004c4e54: uVar8 = -(uint)bVar27 | 1; goto LAB_004c4e59; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar27 = bVar6 < (byte)pEVar33->field_0x1; if (bVar6 != pEVar33->field_0x1) goto LAB_004c4e54; pbVar7 = pbVar7 + 2; pEVar33 = (Entity *)&pEVar33->field_0x2; } while (bVar6 != 0); uVar8 = 0; LAB_004c4e59: if ((uVar8 != 0) || ((pbVar9[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_004c4e7a; } LAB_004c35fb: *(undefined4 *)((int)npc + 0xbc4) = *(undefined4 *)((int)npc + 0xb64); *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0x1e; } } } goto LAB_004c5097; } if (iVar25 == 100) { uVar8 = *(uint *)((int)npc + 0xbc4); local_48._shift1 = 5; local_48._shift2 = 9; local_28fc = 7; local_48._shift3 = 7; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; uVar8 = uVar8 >> 7 ^ uVar8; local_28ec = (Entity *)(uVar8 / 0xffffffff + uVar8); local_48._seed = uVar8; Entity_NPC::QueryNPCsGroup((EntityList *)local_2ab4,1); local_28e4 = (WeightedOutcomePicker)0x0; local_2918 = (WeightedOutcomePicker)0x0; local_28c4 = (Entity *)0x0; local_2914 = (Entity *)0x0; local_2910 = (Entity *)0x0; local_14 = CONCAT31(local_14._1_3_,8); if (local_2aa8 < 10) { local_2a14 = 0; local_2a10 = (void *)0x64; std::vector<8byte>::_Emplace_reallocate(0,&local_2a14); local_28c4 = local_2914; local_28e4 = local_2918; } uVar17 = 0; uVar23 = (int)local_28c4 - (int)local_28e4 >> 3; local_2918 = local_28e4; local_2914 = local_28c4; if (uVar23 != 0) { WVar18 = local_28e4; do { if (*(int *)WVar18 == 1) { ((int *)((int)local_28e4 + 4))[uVar17 * 2] = ((int *)((int)local_28e4 + 4))[uVar17 * 2] + 100; if (((int *)((int)local_28e4 + 4))[uVar17 * 2] < 0) { ((int *)((int)local_28e4 + 4))[uVar17 * 2] = 0; } goto LAB_004c1d65; } uVar17 = uVar17 + 1; WVar18 = (WeightedOutcomePicker)((int)WVar18 + 8); } while (uVar17 < uVar23); } local_2a0c = 1; local_2a08 = 100; if (local_28c4 == local_2910) { std::vector<8byte>::_Emplace_reallocate(local_28c4,&local_2a0c); LAB_004c1d65: local_28dc = local_2918; } else { *(undefined4 *)local_28c4 = 1; *(undefined4 *)&local_28c4->field_0x4 = 100; local_2914 = (Entity *)&local_28c4->_damageEvents; local_28dc = local_28e4; } pAVar12 = (ANM2 *)0x0; local_28cc = (ANM2 *)((int)local_2914 - (int)local_28dc >> 3); local_2918 = local_28dc; if (local_28cc != (ANM2 *)0x0) { WVar18 = local_28dc; do { if (*(int *)WVar18 == 2) { ((int *)((int)local_28dc + 4))[(int)pAVar12 * 2] = ((int *)((int)local_28dc + 4))[(int)pAVar12 * 2] + 100; if (((int *)((int)local_28dc + 4))[(int)pAVar12 * 2] < 0) { ((int *)((int)local_28dc + 4))[(int)pAVar12 * 2] = 0; } goto LAB_004c1e00; } pAVar12 = (ANM2 *)((pAVar12->_filename)._buf + 1); WVar18 = (WeightedOutcomePicker)((int)WVar18 + 8); } while (pAVar12 < local_28cc); } local_2a04 = 2; local_2a00 = 100; if (local_2914 == local_2910) { std::vector<8byte>::_Emplace_reallocate(local_2914,&local_2a04); } else { *(undefined4 *)local_2914 = 2; *(undefined4 *)&local_2914->field_0x4 = 100; local_2914 = (Entity *)&local_2914->_damageEvents; } LAB_004c1e00: uVar17 = g_game->_frameCount - *(int *)((int)npc + 0x328) & 0x80000001; if ((int)uVar17 < 0) { uVar17 = (uVar17 - 1 | 0xfffffffe) + 1; } if (uVar17 == 1) { local_28c4 = (Entity *)0x0; do { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)local_48._shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)local_48._shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_28fc & 0x1f) ^ uVar8; local_28c4 = (Entity *)&local_28c4->field_0x1; } while ((int)local_28c4 < 10); local_48._seed = uVar8; } rng_00._shift1 = local_48._shift1; rng_00._seed = local_48._seed; rng_00._shift2 = local_48._shift2; rng_00._shift3 = local_48._shift3; local_2904 = (EntityPtr *)WeightedOutcomePicker::PickOutcome(&local_2918,rng_00); local_2908 = (float *)&DAT_00000050; pEVar33 = Entity_NPC::GetPlayerTarget(npc); local_28dc = (WeightedOutcomePicker)((pEVar33->_pos).y - *(float *)((int)npc + 0x340)); local_28e4 = (WeightedOutcomePicker)((pEVar33->_pos).x - *(float *)((int)npc + 0x33c)); fVar29 = sqrtf((float)local_28dc * (float)local_28dc + (float)local_28e4 * (float)local_28e4); if (0.0 < fVar29) { local_28e4 = (WeightedOutcomePicker)((2.0 / fVar29) * (float)local_28e4); local_28dc = (WeightedOutcomePicker)((float)local_28dc * (2.0 / fVar29)); } uVar17 = g_game->_frameCount - *(int *)((int)npc + 0x328) & 0x80000001; if ((int)uVar17 < 0) { uVar17 = (uVar17 - 1 | 0xfffffffe) + 1; } if (uVar17 == 1) { local_28cc = (ANM2 *)cos(0.34906584); fVar29 = 0.34906584; } else { local_28cc = (ANM2 *)cos(-0.34906584); fVar29 = -0.34906584; } fVar29 = sin(fVar29); npc = (Entity_NPC *)local_28f0; local_2900 = (Entity *)(fVar29 * (float)local_28e4 + (float)local_28cc * (float)local_28dc); local_28dc = (WeightedOutcomePicker) ((float)local_28cc * (float)local_28e4 - fVar29 * (float)local_28dc); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)local_48._shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)local_48._shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_28fc & 0x1f) ^ uVar8; local_28c4 = (Entity *)(uVar8 % 6 + 1); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)local_48._shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)local_48._shift2 & 0x1f) ^ uVar8; local_28e0 = (float *)((uVar8 >> ((byte)local_28fc & 0x1f) ^ uVar8) % 6 + 1); local_290c = (Entity *)0x0; if (local_2904 == (EntityPtr *)0x0) { local_28c4 = (Entity *)0x2; local_28e0 = (float *)&DAT_00000006; local_2908 = (float *)(int)(*(float *)((int)local_28f0 + 0x370) + 40.0); local_28dc = (WeightedOutcomePicker)g_vectorZero.x; local_2900 = (Entity *)g_vectorZero.y; local_28ec = (Entity *)0x1; } else { local_290c = (Entity *)(uint)(local_2904 == (EntityPtr *)0x2); } Entity_NPC::QueryNPCsGroup((EntityList *)local_2aa4,(int)local_28ec); local_14 = CONCAT31(local_14._1_3_,9); if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) != '\0')) { LAB_004c216c: if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)npc + 0x48),s_Idle,0); *(undefined4 *)((int)npc + 0xbc4) = *(undefined4 *)((int)npc + 0xb64); *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0x1e; } else { uVar36 = _string_holder_c_str(); do { pbVar7 = (byte *)((ulonglong)uVar36 >> 0x20); pbVar9 = (byte *)uVar36; bVar6 = *pbVar9; bVar27 = bVar6 < *pbVar7; if (bVar6 != *pbVar7) { LAB_004c21b3: uVar8 = -(uint)bVar27 | 1; goto LAB_004c21b8; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < pbVar7[1]; if (bVar6 != pbVar7[1]) goto LAB_004c21b3; uVar36 = CONCAT44(pbVar7 + 2,pbVar9 + 2); } while (bVar6 != 0); uVar8 = 0; LAB_004c21b8: if (uVar8 == 0) { uVar8 = Random(); if ((uVar8 % 3 == 0) && (local_2a98 < 0x14)) { SoundEffects::PlayWithFartOverride(0x9e,1.0,0x1e,0,0.3); uVar8 = Random(); iVar25 = 0; local_2924 = (Entity *)((uVar8 & 3) + 1); local_28e4 = (WeightedOutcomePicker)0x0; if (local_2924 != (Entity *)0x0) { do { uVar8 = Random(); local_28e8 = (EntityPtr)(*(float *)((int)npc + 0x33c) + 0.0); local_28f4 = (uint *)(*(float *)((int)npc + 0x340) - 10.0); uVar17 = Random(); fVar29 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28cc = (ANM2 *)(fVar29 + fVar29); local_2904 = (EntityPtr *)sin((float)local_28cc); fVar29 = cos((float)local_28cc); uVar42 = 0; local_29ec.x = fVar29 * 9.5 + (float)local_28e8; pTVar40 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; local_29ec.y = (float)local_2904 * 9.5 + (float)local_28f4; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar33 = Game::Spawn(g_game,0x128,0,&local_29ec,&g_vectorZero,(Entity *)npc,0,uVar8 ); uVar38 = __RTDynamicCast(pEVar33,uVar38,pTVar39,pTVar40,uVar42); *(undefined4 *)(local_38 + (int)local_28e4 * 4 + -0x14) = uVar38; iVar25 = (int)local_28e4 + 1; local_28e4 = (WeightedOutcomePicker)iVar25; } while (iVar25 < (int)local_2924); } pEVar33 = (Entity *)(iVar25 + -1); local_28e4 = (WeightedOutcomePicker)pEVar33; if (-1 < (int)pEVar33) { local_28e8 = (EntityPtr) sqrtf((float)local_28dc * (float)local_28dc + (float)local_2900 * (float)local_2900); do { piVar41 = *(int **)(local_38 + (int)pEVar33 * 4 + -0x14); piVar41[0x5a] = piVar41[0x5a] & 0xfffffffb; piVar41[0x5b] = piVar41[0x5b]; piVar41[0x62] = 2; uVar8 = Random(); fVar29 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28cc = (ANM2 *)(fVar29 + fVar29); local_2904 = (EntityPtr *)sin((float)local_28cc); fVar29 = cos((float)local_28cc); piVar41[0xd8] = (int)(fVar29 * 30.0); piVar41[0xd9] = (int)((float)local_2904 * 30.0); if (*(int *)(((ANM2 *)(piVar41 + 0xef))->_filename)._buf != 0) { local_28cc = (ANM2 *)(piVar41 + 0xef); std::multiset::erase(&local_28cc); } *(EntityPtr *)(piVar41 + 0xef) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)(piVar41 + 0xef)); (**(code **)(*piVar41 + 0xc))(); if ((float)local_28e8 <= 0.0) { pEVar33 = local_2900; WVar18 = local_28dc; } else { fVar29 = *(float *)((int)npc + 0x370) / (float)local_28e8; pEVar33 = (Entity *)(fVar29 * (float)local_2900); WVar18 = (WeightedOutcomePicker)(fVar29 * (float)local_28dc); } fVar29 = *(float *)((int)npc + 0x340); fVar31 = *(float *)((int)npc + 0x33c); piVar41[799] = (int)local_28ec; piVar41[0x2ec] = (int)((float)WVar18 + fVar31); piVar41[0x2ed] = (int)((float)pEVar33 + fVar29); piVar41[0x2ee] = (int)local_28dc; piVar41[0x2ef] = (int)local_2900; *(char *)(piVar41 + 0x2f1) = (char)local_28c4; *(char *)((int)piVar41 + 0xbc5) = (char)local_28e0; *(char *)((int)piVar41 + 0xbc6) = (char)local_2908; *(char *)((int)piVar41 + 0xbc7) = (char)local_290c; pEVar33 = (Entity *) ((int)&((Entity *)((int)local_28e4 + -0x40c))->_luaBridgeRef + 3); local_28e4 = (WeightedOutcomePicker)pEVar33; } while (-1 < (int)pEVar33); } } } } } else { pbVar9 = *(byte **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pbVar7 = &DAT_00b6009c; do { bVar6 = *pbVar9; bVar27 = bVar6 < *pbVar7; if (bVar6 != *pbVar7) { LAB_004c2150: uVar8 = -(uint)bVar27 | 1; goto LAB_004c2155; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < pbVar7[1]; if (bVar6 != pbVar7[1]) goto LAB_004c2150; pbVar9 = pbVar9 + 2; pbVar7 = pbVar7 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c2155: if (uVar8 != 0) goto LAB_004c216c; ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SpawnFlies",0); } if (local_2aa4[0] == '\0') { local_14 = CONCAT31(local_14._1_3_,10); tracked_alloc(1,(void *)local_2aa4._4_4_,0); } if (local_2918 != (WeightedOutcomePicker)0x0) { deallocate((void *)local_2918,(int)local_2910 - (int)local_2918 >> 3); local_2918 = (WeightedOutcomePicker)0x0; local_2914 = (Entity *)0x0; local_2910 = (Entity *)0x0; } local_14 = CONCAT31(local_14._1_3_,4); if (local_2ab4[0] == '\0') { local_14._0_1_ = '\v'; tracked_alloc(1,(void *)local_2ab4._4_4_,0); local_14 = CONCAT31(local_14._1_3_,4); } goto LAB_004c5097; } if (iVar25 == 200) { if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)npc + 0x48),s_Idle,0); *(undefined4 *)((int)npc + 0xbc4) = *(undefined4 *)((int)npc + 0xb64); *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0x3c; } else { iVar25 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar25 == 10) { ProjectileParams::ProjectileParams(&bigShotParams); pfVar35 = (float *)0x0; bigShotParams.Scale = 3.0; bigShotParams.FallingAccelModifier = -0.2; bigShotParams.FallingSpeedModifier = 3.2; bigShotParams.DepthOffset = 20.0; local_28e4 = (WeightedOutcomePicker)0x0; do { if (local_28e4 == (WeightedOutcomePicker)0x0) { if (*(int *)((int)npc + 0x7c) != 0) { iVar25 = 0; goto LAB_004c269b; } LAB_004c267d: pfVar35 = (float *)0x0; local_64.x = (float)&DAT_bf800000; local_64.y = -1.5; fStack_5c = 1.0; iStack_58 = -0x40400000; local_54 = 0; local_50 = 0x3f800000; } else { if (local_28e4 == (WeightedOutcomePicker)0x1) { if (*(int *)((int)npc + 0x7c) == 0) goto LAB_004c267d; iVar25 = 1; LAB_004c269b: pfVar35 = AnimationState::GetNullFrameById((AnimationState *)((int)npc + 0x78),iVar25) ; } else if (local_28e4 == (WeightedOutcomePicker)0x2) { if (*(int *)((int)npc + 0x7c) != 0) { iVar25 = 2; goto LAB_004c269b; } local_64.x = (float)&DAT_bf800000; local_64.y = -1.5; fStack_5c = 1.0; iStack_58 = -0x40400000; local_54 = 0; local_50 = 0x3f800000; break; } local_54 = 0; local_50 = 0x3f800000; local_64.x = (float)&DAT_bf800000; local_64.y = -1.5; fStack_5c = 1.0; iStack_58 = -0x40400000; if (pfVar35 != (float *)0x0) { bigShotParams.BulletFlags._0_4_ = 0x20000000; bigShotParams.BulletFlags._4_4_ = 0; bigShotParams.HeightModifier = pfVar35[1] / 0.65 + 23.0; local_29fc.y = *(float *)((int)npc + 0x340) + 0.0; local_29fc.x = *pfVar35 / 0.65 + *(float *)((int)npc + 0x33c); Entity_NPC::FireProjectiles (npc,&local_29fc,(Vector *)(local_38 + (int)local_28e4 * 8 + -0x2c),0, &bigShotParams); } } local_28e4 = (WeightedOutcomePicker)&((Entity *)local_28e4)->field_0x1; } while ((int)local_28e4 < 3); } } goto LAB_004c5097; } if (iVar25 == 400) { bVar6 = ANM2::IsPlaying((ANM2 *)((int)npc + 0x48),(byte *)"LaserStart"); if ((bVar6 != 0) && (iVar25 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)), iVar25 == 3)) { Game::ShakeScreen(g_game,10); SoundEffects::PlayWithFartOverride(0x1a9,1.0,0x1e,0,1.0); } if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) == '\0')) { uVar36 = _string_holder_c_str(); do { pbVar7 = (byte *)((ulonglong)uVar36 >> 0x20); pbVar9 = (byte *)uVar36; bVar6 = *pbVar9; bVar27 = bVar6 < *pbVar7; if (bVar6 != *pbVar7) { LAB_004c2851: uVar8 = -(uint)bVar27 | 1; goto LAB_004c2856; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < pbVar7[1]; if (bVar6 != pbVar7[1]) goto LAB_004c2851; uVar36 = CONCAT44(pbVar7 + 2,pbVar9 + 2); } while (bVar6 != 0); uVar8 = 0; LAB_004c2856: if (uVar8 == 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"LaserLoop",0); uVar8 = Random(); *(uint *)((int)npc + 0x410) = -10 - uVar8 % 10; local_28c4 = (Entity *)0x0; do { pEVar33 = local_28c4; if (*(int *)((int)npc + 0x7c) != 0) { local_28cc = AnimationState::GetNullFrameById ((AnimationState *)((int)npc + 0x78), (uint)(local_28c4 != (Entity *)0x0)); if (local_28cc != (ANM2 *)0x0) { uVar8 = Random(); pEVar33 = Game::Spawn(g_game,1000,0x65,(Vector *)((int)npc + 0x33c),&g_vectorZero, (Entity *)npc,0,uVar8); (pEVar33->_sprite)._offset.x = *(float *)(local_28cc->_filename)._buf; (pEVar33->_sprite)._offset.y = *(float *)((local_28cc->_filename)._buf + 4); pEVar33->_renderDepthOffset = 1000.0; pAVar12 = &pEVar33[1]._sprite; (pAVar12->_filename)._buf[8] = -1; (pAVar12->_filename)._buf[9] = -1; (pAVar12->_filename)._buf[10] = -1; (pAVar12->_filename)._buf[0xb] = -1; pAVar12 = &pEVar33[1]._sprite; (pAVar12->_filename)._buf[0xc] = -1; (pAVar12->_filename)._buf[0xd] = -1; (pAVar12->_filename)._buf[0xe] = -1; (pAVar12->_filename)._buf[0xf] = -1; if (*(int *)&(pEVar33->_parent).field_0x0 != 0) { local_28cc = (ANM2 *)&pEVar33->_parent; std::multiset::erase(&local_28cc); } pEVar33->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar33->_parent); (**(code **)(*(int *)pEVar33 + 0xc))(); pEVar33 = local_28c4; } } manager = g_manager; local_28c4 = (Entity *)&pEVar33->field_0x1; } while ((int)local_28c4 < 2); local_28c4 = (Entity *)0x1a5; seed_fart_sound_override((int *)&local_28c4); SoundEffects::Play(&manager->_sfxManager,(int)local_28c4,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0x14); goto LAB_004c5097; } } bVar6 = ANM2::IsPlaying((ANM2 *)((int)npc + 0x48),(byte *)"LaserLoop"); if (bVar6 == 0) { bVar6 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)"LaserEnd"); if (bVar6 != 0) { *(undefined4 *)((int)npc + 0xbc4) = *(undefined4 *)((int)npc + 0xb64); *(undefined4 *)((int)npc + 0xb64) = 3; } } else { iVar25 = Entity::GetIntervalTicks((Entity *)npc,30.0,0.0); if ((iVar25 != 0) && (pfVar35 = ANM2::GetLayerFrame((ANM2 *)((int)npc + 0x48),2), pfVar35 != (float *)0x0)) { ProjectileParams::ProjectileParams(&wiggleShotParams); wiggleShotParams.Scale = 1.5; wiggleShotParams.FallingAccelModifier = -0.075; wiggleShotParams.FallingSpeedModifier = -3.2; wiggleShotParams.DepthOffset = 60.0; wiggleShotParams.BulletFlags._0_4_ = 0x400000; wiggleShotParams.BulletFlags._4_4_ = 0; wiggleShotParams.WiggleFrameOffset = Random(); wiggleShotParams.WiggleFrameOffset = (uint)wiggleShotParams.WiggleFrameOffset % 0xf; wiggleShotParams.PositionOffset.x = *pfVar35; wiggleShotParams.PositionOffset.y = pfVar35[1]; local_29f4.x = 3.0; local_29f4.y = 5.0; Entity_NPC::FireProjectiles (npc,(Vector *)((int)npc + 0x33c),&local_29f4,9,&wiggleShotParams); } uVar17 = 0; uVar8 = effectsVariant101._size; if (effectsVariant101._size != 0) { do { if (*(int *)((int)npc + 0x7c) != 0) { puVar13 = AnimationState::GetNullFrameById ((AnimationState *)((int)npc + 0x78),(uint)(uVar17 != 0)); if (puVar13 != (undefined4 *)0x0) { iVar25 = *(int *)((int)effectsVariant101._data + uVar17 * 4); *(undefined4 *)(iVar25 + 0xdc) = *puVar13; *(undefined4 *)(iVar25 + 0xe0) = puVar13[1]; } uVar8 = effectsVariant101._size; } uVar17 = uVar17 + 1; } while (uVar17 < uVar8); } iVar25 = *(int *)((int)npc + 0x410); if (iVar25 < 1) { if (((iVar25 < 0) && (iVar25 = iVar25 + ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)), *(int *)((int)npc + 0x410) = iVar25, iVar25 == 0)) && (effectsVariant96._size == 0)) { uVar8 = Random(); *(uint *)((int)npc + 0x410) = uVar8 % 0x78 + 0x3c; local_28e8 = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); fVar29 = ((Vector *)((int)local_28e8 + 0x33c))->x - *(float *)((int)npc + 0x33c); local_30 = (undefined4 *) (*(float *)((int)local_28e8 + 0x340) - *(float *)((int)npc + 0x340)); local_38._4_4_ = fVar29; local_28cc = (ANM2 *)sqrtf(fVar29 * fVar29 + (float)local_30 * (float)local_30); Vector::Normalized((Vector *)(local_38 + 4),&local_2940); local_2a2c[1] = local_2940.x; local_2a2c[2] = local_2940.y; local_28c4 = (Entity *)0x0; local_2a2c[0] = -local_2940.y; local_2a20 = (void *)((uint)local_2940.x ^ 0x80000000); local_28f4 = (uint *)(local_2940.x * 0.5); local_2924 = (Entity *)(local_2940.y * 0.5); do { local_2a3c.y = (float)local_28cc * ((float)local_2924 + local_2a2c[(int)local_28c4 * 2 + 1] * 0.5) + *(float *)((int)npc + 0x340); local_2a3c.x = (float)local_28cc * ((float)local_28f4 + local_2a2c[(int)local_28c4 * 2] * 0.5) + *(float *)((int)npc + 0x33c); Room::GetClampedPositionImpl(g_game->_room,&local_2a94,&local_2a3c,0.0,0.0,0.0,0.0); uVar8 = Random(); pEVar33 = Game::Spawn(g_game,1000,0x60,&local_2a94,&g_vectorZero,(Entity *)npc,0,uVar8); pAVar12 = &pEVar33[1]._sprite; (pAVar12->_filename)._buf[8] = -1; (pAVar12->_filename)._buf[9] = -1; (pAVar12->_filename)._buf[10] = -1; (pAVar12->_filename)._buf[0xb] = -1; pAVar12 = &pEVar33[1]._sprite; (pAVar12->_filename)._buf[0xc] = -1; (pAVar12->_filename)._buf[0xd] = -1; (pAVar12->_filename)._buf[0xe] = -1; (pAVar12->_filename)._buf[0xf] = -1; if (pEVar33->_parent != (EntityPtr)0x0) { local_2904 = &pEVar33->_parent; std::multiset::erase(&local_2904); } pEVar33->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar33->_parent); if (pEVar33->_target != (EntityPtr)0x0) { local_2904 = &pEVar33->_target; std::multiset::erase(&local_2904); } pEVar33->_target = local_28e8; std::multiset::insert(&pEVar33->_target); (**(code **)(*(int *)pEVar33 + 0xc))(); local_28c4 = (Entity *)&local_28c4->field_0x1; } while ((int)local_28c4 < 2); } } else { iVar25 = iVar25 - ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)); *(int *)((int)npc + 0x410) = iVar25; if (iVar25 == 10) { uVar8 = 0; if (effectsVariant101._size != 0) { do { iVar25 = uVar8 * 4; uVar8 = uVar8 + 1; *(undefined1 *)(*(int *)((int)effectsVariant101._data + iVar25) + 0x173) = 1; } while (uVar8 < (uint)effectsVariant101._size); npc = (Entity_NPC *)local_28f0; } } else if (iVar25 == 0) { if (effectsVariant96._size != 0) { uVar8 = 0; do { iVar25 = uVar8 * 4; uVar8 = uVar8 + 1; *(undefined1 *)(*(int *)((int)effectsVariant96._data + iVar25) + 0x173) = 1; } while (uVar8 < (uint)effectsVariant96._size); npc = (Entity_NPC *)local_28f0; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"LaserEnd",0); } } } goto LAB_004c5097; } if (iVar25 == 0xd) { bVar6 = ANM2::IsPlaying((ANM2 *)((int)npc + 0x48),(byte *)"OpenMouth"); if ((bVar6 != 0) && (bVar6 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),"SkinPull"), bVar6 != 0)) { SoundEffects::PlayWithFartOverride(0x1a5,1.0,2,0,1.0); } bVar6 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)"OpenMouth"); if (bVar6 != 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"OpenMouthLoop",0); uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = (uVar8 & 0xf) + 0xc; } bVar6 = ANM2::IsPlaying((ANM2 *)((int)npc + 0x48),(byte *)"OpenMouthLoop"); if (((bVar6 == 0) || ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0) < 1) ) || (uVar8 = Random(), (uVar8 & 3) != 0)) { bVar6 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)"CloseMouth"); if (bVar6 != 0) { *(undefined4 *)((int)npc + 0xb64) = 700; ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"TurnConcave",0); pVVar14 = Room::GetRandomPosition (g_game->_room,&local_2adc,*(float *)((int)npc + 0x370) * 1.3); *(float *)((int)npc + 0x334) = pVVar14->x; *(float *)((int)npc + 0x338) = pVVar14->y; uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = uVar8 | 1; } } else { uVar8 = Random(); local_2938.y = *(float *)((int)npc + 0x340) + 0.0; fVar29 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.0; if (fVar29 <= 0.0) { fVar29 = 0.0; } if (1.0 <= fVar29) { fVar29 = 1.0; } local_2938.x = (fVar29 * 8.0 - 3.0) / 0.65 + *(float *)((int)npc + 0x33c); pVVar14 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_2b04,&local_2938,0.0,1,0,0); local_2938.x = pVVar14->x; local_2938.y = pVVar14->y; pEVar33 = Entity_NPC::GetPlayerTarget(npc); local_29bc.x = (pEVar33->_pos).x - *(float *)((int)npc + 0x33c); local_29bc.y = (pEVar33->_pos).y - *(float *)((int)npc + 0x340); pVVar14 = Vector::Normalized(&local_29bc,&local_2ae4); local_30 = (undefined4 *)(pVVar14->y * 3.0); local_38._4_4_ = pVVar14->x * 3.0; uVar8 = Random(); local_28ec = Game::Spawn(g_game,0x129,3,&local_2938,(Vector *)(local_38 + 4),(Entity *)npc,0, uVar8); uVar8 = Random(); fVar29 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.0; if (fVar29 <= 0.0) { fVar29 = 0.0; } if (1.0 <= fVar29) { fVar29 = 1.0; } local_30 = (undefined4 *)((*(float *)((int)npc + 0x340) + 64.61539) - local_2938.y); local_38._4_4_ = ((fVar29 * 27.0 - 17.0) / 0.65 + *(float *)((int)npc + 0x33c)) - local_2938.x ; bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar6 != 0) { local_28ec->_health = 10.0; local_28ec->_maxHitPoints = 10.0; } local_28ec->_entityCollisionClass = 0; (**(code **)(*(int *)local_28ec + 0xc))(); pVVar14 = Vector::Resized((Vector *)(local_38 + 4),&local_2afc,7.0); (local_28ec->_velocity).x = pVVar14->x; (local_28ec->_velocity).y = pVVar14->y; iVar25 = *(int *)((int)npc + 0xbc4); if (iVar25 < 1) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"CloseMouth",0); iVar25 = *(int *)((int)npc + 0xbc4); } LAB_004c3175: *(int *)((int)npc + 0xbc4) = iVar25 + -1; } goto LAB_004c5097; } if (iVar25 == 300) { iVar25 = *(int *)((int)npc + 0xbc0); local_2908 = (float *)(&PTR_s_FaceVanishFromLeft_00b6013c)[iVar25]; pbVar9 = (&PTR_s_AttackLoopLeft_00b6014c)[iVar25]; local_28cc = (ANM2 *)(&PTR_s_FaceAppearLeft_00b6015c)[iVar25]; bVar6 = ANM2::IsPlaying((ANM2 *)((int)npc + 0x48),pbVar9); if (bVar6 == 0) { bVar6 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)local_2908); if (bVar6 == 0) { bVar6 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)local_28cc); if (bVar6 != 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),pbVar9,0); uVar8 = Random(); *(uint *)((int)npc + 0x410) = uVar8 % 0x78 + 0x3c; } } else { if (*(int *)((int)npc + 0xbc4) == 0) { pEVar33 = Entity_NPC::GetPlayerTarget(npc); local_30 = (undefined4 *)((pEVar33->_pos).y - *(float *)((int)npc + 0x340)); local_38._4_4_ = (pEVar33->_pos).x - *(float *)((int)npc + 0x33c); uVar8 = vector_to_direction((Vector *)(local_38 + 4)); } else { uVar8 = Random(); uVar8 = uVar8 & 3; } pbVar9 = (&PTR_s_FaceAppearLeft_00b6015c)[uVar8]; *(uint *)((int)npc + 0xbc0) = uVar8; ANM2::Play((ANM2 *)((int)npc + 0x48),pbVar9,0); } } else { iVar25 = Entity::GetIntervalTicks((Entity *)npc,7.0,fVar31); if (iVar25 != 0) { ProjectileParams::ProjectileParams(&curvingShotParams); if ((*(int *)((int)npc + 0xbc0) == 0) || (curvingShotParams.FallingAccelModifier = -0.17, *(int *)((int)npc + 0xbc0) == 2)) { curvingShotParams.FallingAccelModifier = -0.18; } curvingShotParams.Variant = 6; curvingShotParams.BulletFlags._0_4_ = 0x48000000; curvingShotParams.BulletFlags._4_4_ = 0; curvingShotParams.Acceleration = 1.006; Color::Color(&local_2c0c); Color::operator_assign((Color *)&curvingShotParams.Color,other); curvingShotParams.Scale = 1.5; iVar25 = 0; do { if (iVar25 == 0) { if (*(int *)((int)npc + 0x7c) != 0) { iVar16 = 0; goto LAB_004c3322; } } else if (iVar25 == 1) { if (*(int *)((int)npc + 0x7c) != 0) { iVar16 = 1; goto LAB_004c3322; } } else if (iVar25 == 2) { if (*(int *)((int)npc + 0x7c) == 0) break; iVar16 = 2; LAB_004c3322: local_28e8 = (EntityPtr) AnimationState::GetNullFrameById ((AnimationState *)((int)npc + 0x78),iVar16); EVar20 = local_28f0; if (local_28e8 != (EntityPtr)0x0) { local_a0 = 0xbf860a92; local_38._4_4_ = &local_94; local_38._0_4_ = &local_a0; local_30 = &local_88; local_9c = 0x3f860a92; local_98 = 0; local_94 = 0xbf567750; local_90 = 0x3f567750; local_8c = 0x3e0efa35; local_88 = 0xbf1c61ab; local_84 = 0x3f1c61ab; local_80 = 0xbe0efa35; local_28ec = (Entity *)(((g_game->_frameCount - *(int *)((int)npc + 0x328)) / 7) % 3); local_28e0 = *(float **)((int)npc + 0xbc0); uVar8 = curvingShotParams.BulletFlags._4_4_ & 0xfffffffe; curvingShotParams.BulletFlags._0_4_ = (uint)curvingShotParams.BulletFlags & 0xfff3ffff ; local_2904 = (EntityPtr *) ((float)((int)local_28e0 + -2) * 1.5707964 + *(float *)(*(int *)(local_38 + (int)local_28ec * 4) + iVar25 * 4)); local_28cc = (ANM2 *)((uint)local_28e0 & 1); if (local_28cc == (ANM2 *)0x0) { fVar29 = 0.0026; } else { fVar29 = 0.0014; } local_7c = 0x34; local_28c4 = (Entity *)&local_7c; if (local_28cc != (ANM2 *)0x0) { local_28c4 = (Entity *)&local_70; } local_78 = 0x28; local_74 = (void *)0x20; local_70 = &DAT_00000050; local_6c = (void *)0x44; local_68 = (void *)0x38; if (iVar25 == 1) { uVar17 = (uint)curvingShotParams.BulletFlags | 0x40000; LAB_004c34a4: curvingShotParams.ChangeFlags._0_4_ = (uint)curvingShotParams.BulletFlags | 0x400000 ; curvingShotParams.ChangeTimeout = *(int *)((int)(&(local_28c4->_sprite)._filename + -3) + (int)local_28ec * 4); curvingShotParams.WiggleFrameOffset = -curvingShotParams.ChangeTimeout; curvingShotParams.CurvingStrength = fVar29; curvingShotParams.BulletFlags._0_4_ = uVar17; curvingShotParams.BulletFlags._4_4_ = uVar8 | 1; curvingShotParams.ChangeFlags._4_4_ = uVar8; } else { curvingShotParams.BulletFlags._4_4_ = uVar8; if (iVar25 == 0) { uVar17 = (uint)curvingShotParams.BulletFlags | 0x80000; goto LAB_004c34a4; } } local_28cc = (ANM2 *)sin((float)local_2904); local_29c4.x = cos((float)local_2904); curvingShotParams.DepthOffset = 30.0; curvingShotParams.PositionOffset.x = *(float *)local_28e8 / 0.65 + 0.0; curvingShotParams.PositionOffset.y = *(float *)((int)local_28e8 + 4) / 0.65 + 23.0; if (local_28e0 != (float *)0x1) { curvingShotParams.DepthOffset = 20.0; } local_29c4.x = local_29c4.x * 6.0; local_29c4.y = (float)local_28cc * 6.0; Entity_NPC::FireProjectiles ((Entity_NPC *)EVar20,(Vector *)((int)EVar20 + 0x33c),&local_29c4,0, &curvingShotParams); npc = (Entity_NPC *)EVar20; } } iVar25 = iVar25 + 1; } while (iVar25 < 3); } iVar25 = *(int *)((int)npc + 0x410) - ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)); *(int *)((int)npc + 0x410) = iVar25; if (iVar25 < 1) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)local_2908,0); iVar25 = *(int *)((int)npc + 0xbc4); if (0 < iVar25) goto LAB_004c3175; goto LAB_004c35fb; } } goto LAB_004c5097; } if (iVar25 != 500) goto LAB_004c5097; bVar6 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar6 != 0) { *(undefined4 *)((int)npc + 0xbc4) = 500; *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0x1e; goto LAB_004c5097; } iVar25 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if ((iVar25 < 4) || (iVar25 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)), 0x14 < iVar25)) goto LAB_004c5097; SoundEffects::PlayWithFartOverride(0x136,1.0,0x14,0,1.0); pvVar3 = g_game->_room; local_2908 = *(float **)((int)pvVar3 + 0x14); local_28ec = *(Entity **)((int)pvVar3 + 0x18); local_28e0 = *(float **)((int)pvVar3 + 0x1c); local_290c = *(Entity **)((int)pvVar3 + 0x20); local_2920.x = g_vectorZero.x; local_2920.y = g_vectorZero.y; local_28dc = (WeightedOutcomePicker)0x0; local_28e4 = (WeightedOutcomePicker)0x0; uVar8 = Random(); switch(uVar8 & 3) { case 0: uVar8 = Random(); local_2920.x = (float)local_2908; local_28dc = (WeightedOutcomePicker)0xbfc90fdb; local_2920.y = ((float)local_290c - (float)local_28ec) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (float)local_28ec; local_28e4 = (WeightedOutcomePicker)0x3fc90fdb; break; case 1: uVar8 = Random(); local_2920.y = (float)local_28ec; fVar29 = ((float)local_28e0 - (float)local_2908) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_28dc = (WeightedOutcomePicker)0x0; local_28e4 = (WeightedOutcomePicker)0x40490fdb; goto LAB_004c3982; case 2: uVar8 = Random(); local_2920.x = (float)local_28e0; local_2920.y = ((float)local_290c - (float)local_28ec) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (float)local_28ec; local_28dc = (WeightedOutcomePicker)0x3fc90fdb; local_28e4 = (WeightedOutcomePicker)0x4096cbe4; break; case 3: uVar8 = Random(); fVar29 = ((float)local_28e0 - (float)local_2908) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_2920.y = (float)local_290c; local_28dc = (WeightedOutcomePicker)0x40490fdb; local_28e4 = (WeightedOutcomePicker)0x40c90fdb; LAB_004c3982: local_2920.x = fVar29 + (float)local_2908; } uVar8 = Random(); local_28cc = (ANM2 *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * ((float)local_28e4 - (float)local_28dc) + (float)local_28dc); local_2904 = (EntityPtr *)sin((float)local_28cc); local_28cc = (ANM2 *)cos((float)local_28cc); uVar8 = Random(); fVar29 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_2920.x = local_2920.x + fVar29 * (float)local_28cc * 60.0; local_2920.y = local_2920.y + fVar29 * (float)local_2904 * 60.0; uVar8 = Random(); pEVar33 = Game::Spawn(g_game,1000,0x16,&local_2920,&g_vectorZero,(Entity *)npc,0,uVar8); uVar8 = Random(); pcVar2 = *(code **)(*(int *)pEVar33 + 0xc); fVar29 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + 2.0; fVar31 = fVar29 * g_vectorOne.y; (pEVar33->_sprite)._scale.x = fVar29 * g_vectorOne.x; (pEVar33->_sprite)._scale.y = fVar31; (*pcVar2)(); Game::ShakeScreen(g_game,4); LAB_004c5097: iVar25 = *(int *)((int)npc + 0xb64); if ((((iVar25 != 0x10) && (iVar25 != 700)) && (iVar25 != 0x2c6)) && (iVar25 != 0x2d0)) goto LAB_004c5765; local_28cc = (ANM2 *)((int)npc + 0x48); if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { LAB_004c5113: local_28c5 = '\x01'; } else { pbVar9 = *(byte **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar15 = "TurnConcave"; do { bVar6 = *pbVar9; bVar27 = bVar6 < (byte)*pcVar15; if (bVar6 != *pcVar15) { LAB_004c5103: uVar8 = -(uint)bVar27 | 1; goto LAB_004c5108; } if (bVar6 == 0) break; bVar6 = pbVar9[1]; bVar27 = bVar6 < (byte)pcVar15[1]; if (bVar6 != pcVar15[1]) goto LAB_004c5103; pbVar9 = pbVar9 + 2; pcVar15 = pcVar15 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_004c5108: local_28c5 = '\0'; if (uVar8 != 0) goto LAB_004c5113; } uVar8 = 0; this = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(this->_playerList)._begin >> 2 != 0) { do { player = PlayerManager::GetPlayer(this,uVar8); local_30 = (undefined4 *)(*(float *)((int)npc + 0x370) * 0.75 + player->_size); player = PlayerManager::GetPlayer(&g_game->_playerManager,uVar8); fVar31 = *(float *)((int)npc + 0x33c) - (player->_pos).x; fVar29 = *(float *)((int)npc + 0x340) - (player->_pos).y; if (fVar29 * fVar29 + fVar31 * fVar31 < (float)local_30 * (float)local_30) { if (local_28c5 != '\0') { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"BecomeConvex",0); *(undefined4 *)((int)npc + 0xbc4) = *(undefined4 *)((int)npc + 0xb64); goto LAB_004c55ec; } break; } uVar8 = uVar8 + 1; this = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(this->_playerList)._begin >> 2)); } iVar25 = *(int *)((int)npc + 0xb64); if (iVar25 == 0x10) { *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)); LAB_004c5233: uVar8 = 0; local_28c4 = (Entity *)0x0; local_30 = g_game->_room; game = g_game; if (local_30[0x499] != 0) { do { iVar25 = *(int *)(local_30[0x497] + uVar8 * 4); if (((*(int *)(iVar25 + 0x28) == 9) && (*(int *)(iVar25 + 0x34) == *(int *)((int)npc + 0x28))) && (*(char *)(iVar25 + 0x173) == '\0')) { local_29dc.x = *(float *)(iVar25 + 0x33c); local_29dc.y = *(float *)(iVar25 + 0x340); bVar6 = Room::IsPositionInRoom(game->_room,&local_29dc,0.0); game = g_game; if (bVar6 != 0) { local_28c4 = (Entity *)&local_28c4->field_0x1; } } uVar8 = uVar8 + 1; } while (uVar8 < (uint)local_30[0x499]); } uVar8 = Random(); if ((((0 < (int)((int)local_28c4 - uVar8 % 10)) || (local_28c5 == '\0')) || (*(int *)((int)npc + 0x410) < 0x1f)) && (*(int *)((int)npc + 0x410) < 0xb5)) goto LAB_004c5765; } else { if (((iVar25 != 700) && (iVar25 != 0x2c6)) && (iVar25 != 0x2d0)) goto LAB_004c5233; bVar6 = Entity::IsFrame((Entity *)npc,10,0); if (((bVar6 != 0) && (uVar8 = Random(), (uVar8 & 7) == 0)) && ((fVar29 = sqrtf(*(float *)((int)npc + 0x360) * *(float *)((int)npc + 0x360) + *(float *)((int)npc + 0x364) * *(float *)((int)npc + 0x364)), 0.5 < fVar29 && ((uint)hushBoils._size < 10)))) { if (fVar29 <= 0.0) { local_2930.x = *(float *)((int)npc + 0x360); local_2930.y = *(float *)((int)npc + 0x364); } else { fVar29 = ((*(float *)((int)npc + 0x370) + 30.0) * -1.0) / fVar29; local_2930.y = fVar29 * *(float *)((int)npc + 0x364); local_2930.x = fVar29 * *(float *)((int)npc + 0x360); } uVar8 = Random(); fVar29 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.0; if (fVar29 <= 0.0) { fVar29 = 0.0; } if (1.0 <= fVar29) { fVar29 = 1.0; } local_30 = (undefined4 *)((fVar29 * 90.0 - 45.0) * 0.017453292); local_2940.y = cos((float)local_30); fVar29 = sin((float)local_30); fVar31 = local_2930.x * fVar29; local_2930.x = (local_2930.x * local_2940.y - local_2930.y * fVar29) + *(float *)((int)npc + 0x33c); local_2930.y = local_2930.y * local_2940.y + fVar31 + *(float *)((int)npc + 0x340); uVar8 = Random(); uVar42 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar33 = Game::Spawn(g_game,1000,0xf,&local_2930,&g_vectorZero,(Entity *)0x0,3,uVar8); __RTDynamicCast(pEVar33,uVar38,pTVar39,pTVar40,uVar42); Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); uVar8 = Random(); Game::Spawn(g_game,0x12a,0,&local_2930,&g_vectorZero,(Entity *)npc,0,uVar8); } iVar25 = *(int *)((int)npc + 0xb64); if (iVar25 == 0x2d0) { pVVar14 = Entity_NPC::CalcTargetPosition(npc,&local_2aec,0.0); *(float *)((int)npc + 0x334) = pVVar14->x; *(float *)((int)npc + 0x338) = pVVar14->y; *(undefined4 *)((int)npc + 0xbb0) = 0; iVar25 = *(int *)((int)npc + 0xb64); } if (iVar25 != 700) { if (iVar25 == 0x2c6) { fVar29 = *(float *)((int)npc + 0x340) - *(float *)((int)npc + 0x338); fVar31 = *(float *)((int)npc + 0x33c) - *(float *)((int)npc + 0x334); fVar29 = sqrtf(fVar29 * fVar29 + fVar31 * fVar31); if (10.0 <= fVar29) { iVar16 = *(int *)((int)npc + 0x410); goto joined_r0x004c56ac; } } else { if (iVar25 != 0x2d0) goto LAB_004c566c; iVar16 = *(int *)((int)npc + 0x410); joined_r0x004c56ac: if (iVar16 < 0x5b) goto LAB_004c566c; } if ((*(uint *)((int)npc + 0xbc4) & 0xf) == 0) { *(undefined4 *)((int)npc + 0x334) = *(undefined4 *)((int)npc + 0x33c); *(undefined4 *)((int)npc + 0x338) = *(undefined4 *)((int)npc + 0x340); ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"BecomeConvex",0); *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0x1e; } else { *(uint *)((int)npc + 0xbc4) = *(uint *)((int)npc + 0xbc4) - 1; uVar8 = Random(); *(uint *)((int)npc + 0xbc4) = uVar8 & 0xfffffff0 ^ *(uint *)((int)npc + 0xbc4) | 0x10; pVVar14 = Room::GetRandomPosition (g_game->_room,&local_2af4,*(float *)((int)npc + 0x370) * 1.3); *(float *)((int)npc + 0x334) = pVVar14->x; *(float *)((int)npc + 0x338) = pVVar14->y; } goto LAB_004c5765; } fVar29 = *(float *)((int)npc + 0x340) - *(float *)((int)npc + 0x338); fVar31 = *(float *)((int)npc + 0x33c) - *(float *)((int)npc + 0x334); fVar29 = sqrtf(fVar29 * fVar29 + fVar31 * fVar31); if ((10.0 <= fVar29) && (iVar16 = FUN_0041b690(0x129,0xffffffff,0xffffffff), 2 < iVar16)) { LAB_004c566c: if (local_28c5 != '\0') { if ((iVar25 == 0x2c6) || (iVar25 == 0x2d0)) { pcVar15 = "MovingConcaveEyesOpen"; } else { pcVar15 = "MovingConcave"; } ANM2::Play(local_28cc,(byte *)pcVar15,0); } goto LAB_004c5765; } } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"BecomeConvex",0); LAB_004c55ec: *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0x1e; *(undefined4 *)((int)npc + 0x334) = *(undefined4 *)((int)npc + 0x33c); *(undefined4 *)((int)npc + 0x338) = *(undefined4 *)((int)npc + 0x340); LAB_004c5765: if (effectsVariant101._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,0xc); tracked_alloc(1,effectsVariant101._data,0); } if (effectsVariant96._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,0xd); tracked_alloc(1,effectsVariant96._data,0); } if (nearbyEntities._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,0xe); tracked_alloc(1,nearbyEntities._data,0); } if (hushBoils._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,0xf); tracked_alloc(1,hushBoils._data,0); } if (local_2a64._0_1_ == '\0') { local_14 = 0x10; tracked_alloc(1,local_2a64._data,0); } ExceptionList = local_1c; return; LAB_004c0ef3: uVar8 = -(uint)bVar27 | 1; LAB_004c0ef8: if ((uVar8 != 0) || ((pbVar9[0x34] != 0 && (*(char *)((int)npc + 0x8c) == '\0')))) goto LAB_004c0f11; goto LAB_004c0f2f; code_r0x004c1166: uVar8 = uVar8 + 1; if (uVar17 <= uVar8) goto LAB_004c116b; goto LAB_004c1160; code_r0x004c13b9: uVar17 = uVar17 + 1; if (uVar8 <= uVar17) goto LAB_004c13be; goto LAB_004c13b0; code_r0x004c15f9: uVar17 = uVar17 + 1; if (uVar8 <= uVar17) goto LAB_004c15fe; goto LAB_004c15f0; code_r0x004c17ab: uVar8 = uVar8 + 1; if (uVar17 <= uVar8) goto LAB_004c17b0; goto LAB_004c17a2; } //@@ 004c5850 FUN_004c5850 void FUN_004c5850(undefined1 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined1 *in_ECX; *in_ECX = *param_1; *(undefined4 *)(in_ECX + 4) = *(undefined4 *)(param_1 + 4); *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(param_1 + 8); *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(param_1 + 0xc); *(undefined4 *)(in_ECX + 0x10) = *(undefined4 *)(param_1 + 0x10); *(undefined4 *)(in_ECX + 0x14) = *(undefined4 *)(param_1 + 0x14); *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)(param_1 + 0x18); *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(param_1 + 0x1c); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)(param_1 + 0x20); *(undefined4 *)(in_ECX + 0x24) = *(undefined4 *)(param_1 + 0x24); *(undefined4 *)(in_ECX + 0x28) = *(undefined4 *)(param_1 + 0x28); uVar1 = *(undefined4 *)(param_1 + 0x30); uVar2 = *(undefined4 *)(param_1 + 0x34); uVar3 = *(undefined4 *)(param_1 + 0x38); *(undefined4 *)(in_ECX + 0x2c) = *(undefined4 *)(param_1 + 0x2c); *(undefined4 *)(in_ECX + 0x30) = uVar1; *(undefined4 *)(in_ECX + 0x34) = uVar2; *(undefined4 *)(in_ECX + 0x38) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0x40); uVar2 = *(undefined4 *)(param_1 + 0x44); uVar3 = *(undefined4 *)(param_1 + 0x48); *(undefined4 *)(in_ECX + 0x3c) = *(undefined4 *)(param_1 + 0x3c); *(undefined4 *)(in_ECX + 0x40) = uVar1; *(undefined4 *)(in_ECX + 0x44) = uVar2; *(undefined4 *)(in_ECX + 0x48) = uVar3; *(undefined8 *)(in_ECX + 0x4c) = *(undefined8 *)(param_1 + 0x4c); *(undefined4 *)(in_ECX + 0x54) = *(undefined4 *)(param_1 + 0x54); uVar1 = *(undefined4 *)(param_1 + 0x5c); *(undefined4 *)(in_ECX + 0x58) = *(undefined4 *)(param_1 + 0x58); *(undefined4 *)(in_ECX + 0x5c) = uVar1; uVar1 = *(undefined4 *)(param_1 + 100); *(undefined4 *)(in_ECX + 0x60) = *(undefined4 *)(param_1 + 0x60); *(undefined4 *)(in_ECX + 100) = uVar1; uVar1 = *(undefined4 *)(param_1 + 0x6c); *(undefined4 *)(in_ECX + 0x68) = *(undefined4 *)(param_1 + 0x68); *(undefined4 *)(in_ECX + 0x6c) = uVar1; uVar1 = *(undefined4 *)(param_1 + 0x74); *(undefined4 *)(in_ECX + 0x70) = *(undefined4 *)(param_1 + 0x70); *(undefined4 *)(in_ECX + 0x74) = uVar1; *(undefined4 *)(in_ECX + 0x78) = *(undefined4 *)(param_1 + 0x78); *(undefined4 *)(in_ECX + 0x7c) = *(undefined4 *)(param_1 + 0x7c); uVar1 = *(undefined4 *)(param_1 + 0x84); *(undefined4 *)(in_ECX + 0x80) = *(undefined4 *)(param_1 + 0x80); *(undefined4 *)(in_ECX + 0x84) = uVar1; *(undefined4 *)(in_ECX + 0x88) = *(undefined4 *)(param_1 + 0x88); *(undefined4 *)(in_ECX + 0x8c) = *(undefined4 *)(param_1 + 0x8c); *(undefined4 *)(in_ECX + 0x90) = *(undefined4 *)(param_1 + 0x90); *(undefined4 *)(in_ECX + 0x94) = *(undefined4 *)(param_1 + 0x94); in_ECX[0x98] = param_1[0x98]; *(undefined4 *)(in_ECX + 0x9c) = *(undefined4 *)(param_1 + 0x9c); *(undefined4 *)(in_ECX + 0xa0) = *(undefined4 *)(param_1 + 0xa0); in_ECX[0xa4] = param_1[0xa4]; return; } //@@ 004c5980 FUN_004c5980 void FUN_004c5980(float *param_1,Vector *param_2) { uint seed; Entity *pEVar1; uint in_ECX; Vector *in_EDX; seed = Random(); pEVar1 = Game::Spawn(g_game,1000,2,in_EDX,param_2,(Entity *)0x0,in_ECX,seed); (pEVar1->_posOffset).x = *param_1; (pEVar1->_posOffset).y = param_1[1]; return; } //@@ 004c59d0 NpcAI::ENTITY_MATRIARCH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 413 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MATRIARCH(Entity_NPC *npc) { uint *puVar1; byte bVar2; char cVar3; Entity *tmpEntity; uint uVar4; uint uVar5; byte *pbVar6; byte *pbVar7; float *pfVar8; EntityRef *damageSource; int *piVar9; LayerState *layer; uint rngResult; EntityPtr EVar10; EntityPtr splitTwin; Vector *pVVar11; byte *pbVar12; char *pcVar13; EntityPtr *damageSource; float *pfVar15; code *extraout_EDX; int iVar16; AnimationState *animState; Room *clampRoom; EntityPtr *candidatesEnd; bool bVar17; float fVar18; float fVar19; undefined8 uVar20; undefined4 uVar21; TypeDescriptor *pTVar22; TypeDescriptor *pTVar23; undefined4 uVar24; Vector local_14c; Vector VStack_144; EntityPtr local_13c; undefined1 local_138 [12]; float local_12c; Vector VStack_128; Vector local_120; Vector local_118; EntityPtr *candidatesBegin; Vector local_10c; Vector VStack_104; float local_fc; Vector VStack_f8; EntityPtr *local_f0; ProjectileParams projParams; EntityRef damageSourceRef; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; EntityPtr *candidates; int deliriumForm; ColorMod *dimColor; Manager *manager; void *room; int *roomEntity; local_8 = 0xffffffff; puStack_c = &LAB_00af3696; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; deliriumForm = npc->_deliriumBossType; VStack_128.y = (float)g_game->_room; local_13c = (EntityPtr)npc; if (((deliriumForm == 0) && (0.0 < npc->_pendingDamage)) && (npc->_state != 0xd)) { uVar4 = npc->_i2; local_f0 = (EntityPtr *)(npc->_health - npc->_pendingDamage); if (-1 < (int)uVar4) { do { manager = g_manager; if ((3 < uVar4) || (*(float *)(&DAT_00b60170 + uVar4 * 4) * npc->_maxHitPoints <= (float)local_f0)) break; local_fc = 3.92364e-44; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,0.8,2,0,1.0,0.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_144.y = (npc->_pos).x - (tmpEntity->_pos).x; local_fc = (npc->_pos).y - (tmpEntity->_pos).y; fVar18 = sqrtf(VStack_144.y * VStack_144.y + local_fc * local_fc); if (0.0 < fVar18) { VStack_144.y = VStack_144.y * (1.0 / fVar18); local_fc = local_fc * (1.0 / fVar18); } iVar16 = (1 < npc->_i2) + 1; do { uVar4 = Random(); VStack_f8.y = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 90.0 - 45.0) * 0.017453292; VStack_104.y = cos(VStack_f8.y); fVar18 = sin(VStack_f8.y); fVar19 = VStack_104.y * local_fc; VStack_104.y = VStack_104.y * VStack_144.y - fVar18 * local_fc; VStack_f8.y = fVar18 * VStack_144.y + fVar19; local_120.x = VStack_104.y * 40.0 + (npc->_pos).x; local_120.y = VStack_f8.y * 40.0 + (npc->_pos).y; uVar4 = Random(); uVar5 = Random(); fVar18 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_14c.x = fVar18 + fVar18 + 2.0; local_14c.y = local_14c.x * VStack_f8.y; local_14c.x = local_14c.x * VStack_104.y; tmpEntity = Game::Spawn(g_game,0x49,0,&local_120,&local_14c,(Entity *)npc,1000,uVar4); local_118.x = VStack_104.y * 0.5; local_118.y = VStack_f8.y * 0.5; uVar21 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb | 0x80000000; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar21; uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&local_120,&local_118,(Entity *)0x0,4,uVar4); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; iVar16 = iVar16 + -1; } while (iVar16 != 0); if (((npc->_state == 6) && ((npc->_sprite)._animState._animData != (void *)0x0)) && ((bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar2 != 0 && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land), bVar2 == 0)))))) { pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { LAB_004c5e06: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)0xb60180,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = (byte *)0xb60180; do { bVar2 = *pbVar6; bVar17 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004c5df0: uVar4 = -(uint)bVar17 | 1; goto LAB_004c5df5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar17 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004c5df0; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004c5df5: if ((uVar4 != 0) || ((pbVar7[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_004c5e06; } fVar19 = VStack_144.y * 6.0; npc->_state = 7; fVar18 = local_fc * 6.0; LAB_004c5f07: (npc->_velocity).y = fVar18; (npc->_velocity).x = fVar19; } else if ((npc->_state != 5) && (npc->_state != 7)) { pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { LAB_004c5ebb: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Flinch",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pcVar13 = "Flinch"; do { bVar2 = *pbVar6; bVar17 = bVar2 < (byte)*pcVar13; if (bVar2 != *pcVar13) { LAB_004c5ea5: uVar4 = -(uint)bVar17 | 1; goto LAB_004c5eaa; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar17 = bVar2 < (byte)pcVar13[1]; if (bVar2 != pcVar13[1]) goto LAB_004c5ea5; pbVar6 = pbVar6 + 2; pcVar13 = pcVar13 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004c5eaa: if ((uVar4 != 0) || ((pbVar7[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_004c5ebb; } fVar19 = VStack_144.y * 20.0; npc->_state = 5; fVar18 = local_fc * 20.0; goto LAB_004c5f07; } uVar4 = npc->_i2 + 1; npc->_i2 = uVar4; npc->_i1 = npc->_i1 + 0x5a; } while (-1 < (int)uVar4); } } fVar18 = VStack_128.y; switch(npc->_state) { case 0: npc->_state = 3; npc->_i1 = 0; npc->_i2 = 0; break; case 3: pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { LAB_004c6196: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = s_Idle; do { bVar2 = *pbVar6; bVar17 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004c6180: uVar4 = -(uint)bVar17 | 1; goto LAB_004c6185; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar17 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004c6180; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004c6185: if ((uVar4 != 0) || ((pbVar7[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c6196; } npc->_friction = npc->_friction * 0.5; if (((npc->_i1 < 0x12d) || (npc->_i2 < 3)) || (uVar4 = Random(), uVar4 % 5 != 0)) { uVar4 = Random(); if (uVar4 % 0xc == 0) { Entity_NPC::QueryNPCsType(local_138,0x134,-1); local_8 = 0; uVar4 = 0; fVar18 = 0.0; uVar5 = uVar4; if (local_12c != 0.0) { do { uVar4 = uVar5 + 1; if (*(Entity_NPC **)(*(int *)(local_138._4_4_ + (int)fVar18 * 4) + 0x3bc) != npc) { uVar4 = uVar5; } fVar18 = (float)((int)fVar18 + 1); uVar5 = uVar4; } while ((uint)fVar18 < (uint)local_12c); } VStack_f8.y = (float)&g_manager->_entityConfig; local_f0 = (EntityPtr *)0x13400000; uVar5 = 100; _Find_lower_bound<>(&candidatesBegin,&local_f0); if (((*(char *)((int)local_10c.y + 0xd) == '\0') && (*(uint *)((int)local_10c.y + 0x10) < 0x13400001)) && ((void *)local_10c.y != *(void **)VStack_f8.y)) { pfVar15 = (float *)((int)local_10c.y + 0x68); } else { pfVar15 = (float *)&DAT_00000050; } if ((3 < uVar4) || (npc->_health - *pfVar15 < *(float *)(&DAT_00b60170 + npc->_i2 * 4) * npc->_maxHitPoints) ) { uVar5 = 0; } else if ((0x96 < npc->_i1) || (uVar4 == 0)) { uVar5 = 300; } iVar16 = 100; if (npc->_projectileCooldown < 1) { iVar16 = 200; } uVar4 = Random(); uVar4 = uVar4 % (iVar16 + uVar5); if (uVar4 < uVar5) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); npc->_state = 8; } else { npc->_state = 10 - (uint)(uVar4 < uVar5 + 100); } local_8 = 0xffffffff; if (local_138[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_138._4_4_,0); local_8 = 0xffffffff; } } else { uVar4 = Random(); if (uVar4 % 10 == 0) { npc->_state = 6; uVar4 = Random(); pbVar7 = s_Jump; if ((uVar4 & 1) == 0) { pbVar7 = &DAT_00b6018c; } ANM2::Play(&npc->_sprite,pbVar7,0); } } } else { ANM2::Play(&npc->_sprite,(byte *)"RageBegin",0); npc->_state = 0xd; npc->_stateFrame = 0; npc->_i1 = 400; } break; case 5: goto LAB_004c780c; case 6: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Jump); if (bVar2 != 0) { EVar10 = npc->_child; if (EVar10 == (EntityPtr)0x0) { Entity_NPC::CalcTargetPosition(npc,&local_118,0.0); VStack_104.x = local_118.x - (npc->_pos).x; VStack_104.y = local_118.y - (npc->_pos).y; local_f0 = (EntityPtr *)sqrtf(VStack_104.x * VStack_104.x + VStack_104.y * VStack_104.y); Vector::Normalize(&VStack_104); if ((float)local_f0 <= 100.0) goto code_r0x004c6473; uVar4 = Random(); if ((uVar4 & 1) == 0) { fVar19 = 45.0; } else { fVar19 = -45.0; } local_f0 = (EntityPtr *)(fVar19 * 0.017453292); VStack_f8.y = cos((float)local_f0); fVar19 = sin((float)local_f0); local_f0 = (EntityPtr *)(VStack_104.x * VStack_f8.y - VStack_104.y * fVar19); VStack_f8.y = VStack_104.y * VStack_f8.y + VStack_104.x * fVar19; local_118.x = (float)local_f0 * 128.0 + (npc->_pos).x; local_118.y = VStack_f8.y * 128.0 + (npc->_pos).y; bVar2 = Room::IsPositionInRoom((Room *)fVar18,&local_118,0.0); if (bVar2 == 0) goto code_r0x004c6473; EVar10 = (EntityPtr)VStack_f8.y; damageSource = local_f0; } else { VStack_104.x = *(float *)((int)EVar10 + 0x33c) - (npc->_pos).x; VStack_104.y = *(float *)((int)EVar10 + 0x340) - (npc->_pos).y; Vector::Normalize(&VStack_104); code_r0x004c6473: EVar10 = (EntityPtr)VStack_104.y; damageSource = (EntityPtr *)VStack_104.x; } (npc->_targetPosition).x = (float)damageSource * 6.0; (npc->_velocity).x = (float)damageSource * 6.0; (npc->_targetPosition).y = (float)EVar10 * 6.0; (npc->_velocity).y = (float)EVar10 * 6.0; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); manager = g_manager; if (bVar2 != 0) { VStack_f8.y = 6.72623e-44; seed_fart_sound_override((int *)&VStack_f8.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_f8.y,0.7,2,0,1.0,0.0); } } } animState = &(npc->_sprite)._animState; if ((((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::WasEventTriggered(animState,s_Jump), bVar2 != 0)) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar2 = AnimationState::WasEventTriggered(animState,s_Land), bVar2 == 0)))) { (npc->_sprite)._flipX = 0.0 < (npc->_targetPosition).x; goto LAB_004c7884; } LAB_004c786c: fVar18 = npc->_friction * 0.5; goto LAB_004c787c; case 7: bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Land); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x30,0.7,2,0,1.0); } bVar2 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); if ((bVar2 == 0) || (bVar2 = ANM2::WasEventTriggered(&npc->_sprite,s_Land), bVar2 != 0)) goto LAB_004c786c; goto LAB_004c7884; case 8: npc->_friction = npc->_friction * 0.5; pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { LAB_004c6756: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = s_Attack1; do { bVar2 = *pbVar6; bVar17 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004c6740: uVar4 = -(uint)bVar17 | 1; goto LAB_004c6745; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar17 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004c6740; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004c6745: if ((uVar4 != 0) || ((pbVar7[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c6756; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { VStack_f8.y = 3.71344e-43; seed_fart_sound_override((int *)&VStack_f8.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_f8.y,1.0,2,0,1.0,0.0); local_118.y = -4.0; if ((npc->_sprite)._flipX == 0) { VStack_f8.x = 20.0; } else { VStack_f8.x = -20.0; } VStack_f8.x = VStack_f8.x + (npc->_pos).x; VStack_f8.y = (npc->_pos).y - 4.0; uVar4 = Random(); if ((npc->_sprite)._flipX == 0) { local_118.x = -10.0; } else { local_118.x = 10.0; } tmpEntity = Game::Spawn(g_game,0x134,0,&VStack_f8,&local_118,(Entity *)npc,0,uVar4); damageSource = &tmpEntity->_parent; if (tmpEntity->_parent != (EntityPtr)0x0) { local_f0 = damageSource; std::multiset::erase(&local_f0); } *damageSource = (EntityPtr)npc; std::multiset::insert(damageSource); uVar21 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar21; npc_distribute_orbit_angles(); uVar4 = Random(); Game::Spawn(g_game,1000,0xf,&VStack_f8,&g_vectorZero,(Entity *)0x0,0,uVar4); local_118.x = (tmpEntity->_velocity).x * 0.3; local_118.y = (tmpEntity->_velocity).y * 0.3; uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&VStack_f8,&local_118,(Entity *)0x0,3,uVar4); manager = g_manager; local_f0 = (EntityPtr *)0x13400000; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; _Find_lower_bound<>(&candidatesBegin,&local_f0); if (((*(char *)((int)local_10c.y + 0xd) != '\0') || (0x13400000 < *(uint *)((int)local_10c.y + 0x10))) || (pfVar15 = (float *)((int)local_10c.y + 0x68), (void *)local_10c.y == (manager->_entityConfig)._entities._head)) { pfVar15 = (float *)&DAT_00000050; } fVar18 = npc->_health; VStack_f8.y = fVar18 - *pfVar15; local_f0 = (EntityPtr *) (*(float *)(&DAT_00b60170 + npc->_i2 * 4) * npc->_maxHitPoints + 1.0); pfVar8 = (float *)&local_f0; if ((float)local_f0 <= fVar18 - *pfVar15) { pfVar8 = &VStack_f8.y; } fVar19 = *pfVar8; if (fVar19 < fVar18) { damageSource = EntityRef::EntityRef(&damageSourceRef); (*extraout_EDX)(fVar18 - fVar19,0,0,damageSource,0x1e); } } goto LAB_004c7884; } goto LAB_004c7897; case 9: npc->_friction = npc->_friction * 0.5; pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { LAB_004c6a96: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Attack2,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = s_Attack2; do { bVar2 = *pbVar6; bVar17 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004c6a80: uVar4 = -(uint)bVar17 | 1; goto LAB_004c6a85; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar17 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004c6a80; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004c6a85: if ((uVar4 != 0) || ((pbVar7[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c6a96; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004c7897; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { VStack_f8.y = 2.98477e-43; seed_fart_sound_override((int *)&VStack_f8.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_f8.y,0.8,2,0,1.0,0.0); VStack_f8.y = 0.0; do { local_f0 = (EntityPtr *) ((float)((double)(int)VStack_f8.y + __uint_to_double_fixup[-((int)VStack_f8.y >> 0x1f)]) * 45.0 * 0.017453292 ); local_fc = sin((float)local_f0); fVar18 = cos((float)local_f0); local_120.y = local_fc * 16.0; local_120.x = fVar18 * 16.0 * 1.4; local_fc = local_120.y; uVar4 = Random(); local_118.x = local_120.x + (npc->_pos).x; local_118.y = local_fc + (npc->_pos).y; uVar24 = 0; pTVar23 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar22 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar21 = 0; tmpEntity = Game::Spawn(g_game,0x27,0x16,&local_118,&local_120,(Entity *)npc,2,uVar4); piVar9 = (int *)__RTDynamicCast(tmpEntity,uVar21,pTVar22,pTVar23,uVar24); damageSource = (EntityPtr *)(piVar9 + 0xef); piVar9[0x2d9] = 0; if (piVar9[0xef] != 0) { local_f0 = damageSource; std::multiset::erase(&local_f0); } *damageSource = (EntityPtr)npc; std::multiset::insert(damageSource); (**(code **)(*piVar9 + 0xc))(); local_14c.x = (float)piVar9[0xd8] * 0.3; VStack_104.x = (float)piVar9[0xcf]; local_14c.y = (float)piVar9[0xd9] * 0.3; VStack_104.y = *(float *)(piVar9 + 0xd0); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&VStack_104,&local_14c,(Entity *)0x0,3,uVar4); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; VStack_128.x = (float)piVar9[0xd8] * 0.5; VStack_144.x = (float)piVar9[0xcf]; VStack_128.y = (float)piVar9[0xd9] * 0.5; VStack_144.y = (float)piVar9[0xd0]; uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&VStack_144,&VStack_128,(Entity *)0x0,2,uVar4); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; local_138._8_4_ = (float)piVar9[0xd8] * 0.6; local_10c.x = (float)piVar9[0xcf]; local_12c = (float)piVar9[0xd9] * 0.6; local_10c.y = (float)piVar9[0xd0]; uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&local_10c,(Vector *)(local_138 + 8),(Entity *)0x0,1, uVar4); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; VStack_f8.y = (float)((int)VStack_f8.y + 1); } while ((uint)VStack_f8.y < 8); } goto LAB_004c7884; case 10: npc->_friction = npc->_friction * 0.5; pbVar7 = (npc->_sprite)._animState._animData; if (pbVar7 == (byte *)0x0) { LAB_004c6e76: bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d2e4,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar6 = *(byte **)pbVar7; } pbVar12 = &DAT_00b1d2e4; do { bVar2 = *pbVar6; bVar17 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_004c6e60: uVar4 = -(uint)bVar17 | 1; goto LAB_004c6e65; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar17 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_004c6e60; pbVar6 = pbVar6 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004c6e65: if ((uVar4 != 0) || ((pbVar7[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c6e76; } iVar16 = ANM2::GetFrame(&npc->_sprite); if (iVar16 == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_f0 = (EntityPtr *)((tmpEntity->_velocity).x * 0.1); VStack_f8.y = (tmpEntity->_velocity).y * 0.1; fVar19 = (npc->_pos).x - (tmpEntity->_pos).x; fVar18 = (npc->_pos).y - (tmpEntity->_pos).y; fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); clampRoom = (Room *)VStack_128.y; local_10c.x = (float)local_f0 * fVar18 + (tmpEntity->_pos).x; local_10c.y = fVar18 * VStack_f8.y + (tmpEntity->_pos).y; Room::GetClampedPositionImpl ((Room *)VStack_128.y,(Vector *)(local_138 + 8),&local_10c,4.0,4.0,4.0,4.0); (npc->_sprite)._flipX = (npc->_pos).x <= (float)local_138._8_4_ && (float)local_138._8_4_ != (npc->_pos).x; } else { clampRoom = (Room *)VStack_128.y; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004c7897; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { VStack_f8.y = 4.45613e-43; seed_fart_sound_override((int *)&VStack_f8.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_f8.y,1.0,2,0,0.8,0.0); manager = g_manager; VStack_f8.y = 2.97075e-43; seed_fart_sound_override((int *)&VStack_f8.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_f8.y,0.8,2,0,1.0,0.0); if ((npc->_sprite)._flipX == 0) { fVar18 = -40.0; } else { fVar18 = 40.0; } VStack_104.x = fVar18 + (npc->_pos).x; VStack_104.y = (npc->_pos).y + 3.0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_f8.y = (tmpEntity->_velocity).y * 0.1; local_f0 = (EntityPtr *)((tmpEntity->_velocity).x * 0.1); fVar19 = (npc->_pos).x - (tmpEntity->_pos).x; fVar18 = (npc->_pos).y - (tmpEntity->_pos).y; fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); local_10c.x = (float)local_f0 * fVar18 + (tmpEntity->_pos).x; local_10c.y = VStack_f8.y * fVar18 + (tmpEntity->_pos).y; Room::GetClampedPositionImpl(clampRoom,(Vector *)(local_138 + 8),&local_10c,4.0,4.0,4.0,4.0); if ((npc->_sprite)._flipX == 0) { local_fc = 180.0; } else { local_fc = 0.0; } fVar18 = atan2f(local_12c - VStack_104.y,(float)local_138._8_4_ - VStack_104.x); fVar18 = normalize_angle_degrees(fVar18 * 57.295776 - local_fc); if (fVar18 <= -45.0) { fVar18 = -45.0; } if (45.0 <= fVar18) { fVar18 = 45.0; } local_fc = (local_fc + fVar18) * 0.017453292; local_f0 = (EntityPtr *)sin(local_fc); local_120.x = cos(local_fc); local_120.x = local_120.x * 10.0; local_120.y = (float)local_f0 * 10.0; ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x500; projParams.Scale = 2.0; Entity_NPC::FireProjectiles(npc,&VStack_104,&local_120,0,&projParams); local_10c.x = 0.0; local_10c.y = -10.0; FUN_004c5980(&local_10c,&local_120); uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x3c + 0x5a; } goto LAB_004c7884; case 0xd: uVar4 = npc->_stateFrame; npc->_friction = npc->_friction * 0.5; if (uVar4 == 0) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); npc->_stateFrame = 1; pVVar11 = Entity_NPC::CalcTargetPosition(npc,&local_10c,0.0); (npc->_sprite)._flipX = (npc->_pos).x <= pVVar11->x && pVVar11->x != (npc->_pos).x; if (npc->_child != (EntityPtr)0x0) { Entity::SetParent((Entity *)npc->_child,(Entity *)0x0); *(undefined1 *)((int)npc->_child + 0x174) = 1; EVar10 = npc->_child; *(uint *)((int)EVar10 + 0x16c) = *(uint *)((int)EVar10 + 0x16c) | 0x2000; *(undefined4 *)((int)EVar10 + 0x168) = *(undefined4 *)((int)EVar10 + 0x168); dimColor = (ColorMod *)Color::Color(0x3ecccccd,0x3da3d70a,0x3d4ccccd); layer = ANM2::GetLayer((ANM2 *)((int)npc->_child + 0x48),(byte *)0x0); Color::operator_assign((Color *)&layer->_color,dimColor); uVar20 = Color::Color(0x3f4ccccd,0x3e99999a,0x3e4ccccd); (*(code *)((ulonglong)uVar20 >> 0x20))((int)uVar20,0xf,0xff,1,1); Entity::SetChild((Entity *)npc,(Entity *)0x0); } } } else if ((int)uVar4 < 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"RageLoop",0); uVar4 = npc->_stateFrame; } uVar4 = uVar4 & 0x80000007; bVar17 = uVar4 == 0; if ((int)uVar4 < 0) { bVar17 = (uVar4 - 1 | 0xfffffff8) == 0xffffffff; } if ((bVar17) && (uVar4 = Random(), (uVar4 & 1) == 0)) { SoundEffects::PlayWithFartOverride(0x109,1.0,2,0,1.0); pVVar11 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_138 + 8),0.0); local_10c.x = pVVar11->x - (npc->_pos).x; local_10c.y = pVVar11->y - (npc->_pos).y; pVVar11 = Vector::Normalized(&local_10c,&local_118); uVar4 = Random(); local_f0 = (EntityPtr *) (((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 180.0 - 90.0) * 0.017453292); VStack_128.y = cos((float)local_f0); fVar18 = sin((float)local_f0); local_f0 = (EntityPtr *)(VStack_128.y * pVVar11->x - fVar18 * pVVar11->y); VStack_128.y = VStack_128.y * pVVar11->y + fVar18 * pVVar11->x; VStack_f8.x = (float)local_f0 * 20.0 + (npc->_pos).x; VStack_f8.y = VStack_128.y * 20.0 + (npc->_pos).y; uVar4 = Random(); uVar5 = Random(); fVar18 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; local_10c.x = (float)local_f0 * fVar18; local_10c.y = VStack_128.y * fVar18; tmpEntity = Game::Spawn(g_game,0x134,0,&VStack_f8,&local_10c,(Entity *)npc,0,uVar4); fVar18 = tmpEntity->_maxHitPoints * 0.5; *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; puVar1 = (uint *)((int)&tmpEntity->_flags + 4); *puVar1 = *puVar1 | 0x2000; tmpEntity->_isKillOnTouch = 1; tmpEntity->_maxHitPoints = fVar18; tmpEntity->_health = fVar18; dimColor = (ColorMod *)Color::Color(0x3ecccccd,0x3da3d70a,0x3d4ccccd); layer = ANM2::GetLayer(&tmpEntity->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,dimColor); uVar20 = Color::Color(0x3f4ccccd,0x3e99999a,0x3e4ccccd); (*(code *)((ulonglong)uVar20 >> 0x20))((int)uVar20,0xf,0xff,1,1); uVar4 = Random(); Game::Spawn(g_game,1000,0xf,&VStack_f8,&g_vectorZero,(Entity *)0x0,0,uVar4); local_10c.x = (tmpEntity->_velocity).x * 0.3; local_10c.y = (tmpEntity->_velocity).y * 0.3; local_138._8_4_ = 0.0; local_12c = -16.0; FUN_004c5980(local_138 + 8,&local_10c); } npc->_stateFrame = npc->_stateFrame + 1; npc->_i1 = npc->_i1 + -2; if (npc->_i1 < 1) { npc->_i1 = 0; npc->_stateFrame = -1; ANM2::Play(&npc->_sprite,(byte *)"RageEnd",0); } } goto LAB_004c780c; case 0x10: npc->_friction = npc->_friction * 0.5; ANM2::Play(&npc->_sprite,(byte *)"Death",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { SoundEffects::PlayWithFartOverride(0x8d,1.0,2,0,1.0); uVar4 = Random(); Game::Spawn(g_game,1000,0x4d,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); uVar4 = 0; do { uVar5 = Random(); fVar18 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_f0 = (EntityPtr *)(fVar18 + fVar18); VStack_128.y = cos((float)local_f0); VStack_f8.y = sin((float)local_f0); local_120.x = VStack_128.y * 40.0 + (npc->_pos).x; local_120.y = VStack_f8.y * 40.0 + (npc->_pos).y; uVar5 = Random(); rngResult = Random(); fVar18 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; fVar18 = fVar18 + fVar18 + 2.0; local_10c.y = fVar18 * VStack_f8.y; local_10c.x = fVar18 * VStack_128.y; tmpEntity = Game::Spawn(g_game,(uVar4 != 0) + 0x48,0,&local_120,&local_10c,(Entity *)npc, 1000,uVar5); local_138._8_4_ = VStack_128.y * 0.5; uVar21 = *(undefined4 *)((int)&tmpEntity->_flags + 4); local_12c = VStack_f8.y * 0.5; *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb | 0x80000000; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar21; uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&local_120,(Vector *)(local_138 + 8),(Entity *)0x0,4, uVar5); uVar4 = uVar4 + 1; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -16.0; } while (uVar4 < 3); EVar10 = npc->_child; damageSource = &npc->_child; if (EVar10 != (EntityPtr)0x0) { if (*(int *)((int)EVar10 + 0x3bc) != 0) { local_f0 = (EntityPtr *)((int)EVar10 + 0x3bc); std::multiset::erase(&local_f0); } *(EntityPtr *)((int)EVar10 + 0x3bc) = (EntityPtr)0x0; if (*damageSource != (EntityPtr)0x0) { local_f0 = damageSource; std::multiset::erase(&local_f0); } *damageSource = (EntityPtr)0x0; } uVar4 = Random(); pVVar11 = &npc->_pos; tmpEntity = Game::Spawn(g_game,0x134,0,pVVar11,&g_vectorZero,(Entity *)npc,0,uVar4); if (tmpEntity->_parent != (EntityPtr)0x0) { local_f0 = &tmpEntity->_parent; std::multiset::erase(&local_f0); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); uVar21 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar21; npc_distribute_orbit_angles(); local_f0 = (EntityPtr *)npc->_maxHitPoints; Entity::RemoveStatusEffects((Entity *)npc); Entity_NPC::Morph(npc,0x1c,0,1000,-1); npc->_maxHitPoints = (float)local_f0; npc->_spawnerType = 0x19d; npc->_entityCollisionClass = 4; npc->_health = (float)local_f0 * 0.2; uVar4 = Random(); EVar10 = (EntityPtr) Game::Spawn(g_game,npc->_type,npc->_variant,pVVar11,&g_vectorZero,(Entity *)npc, npc->_subtype,uVar4); uVar4 = Random(); splitTwin = (EntityPtr) Game::Spawn(g_game,npc->_type,npc->_variant,pVVar11,&g_vectorZero,(Entity *)npc, npc->_subtype,uVar4); *(uint *)((int)EVar10 + 0x168) = *(uint *)((int)EVar10 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar10 + 0x16c) = *(undefined4 *)((int)EVar10 + 0x16c); *(uint *)((int)splitTwin + 0x168) = *(uint *)((int)splitTwin + 0x168) & 0xfffffffb; *(undefined4 *)((int)splitTwin + 0x16c) = *(undefined4 *)((int)splitTwin + 0x16c); if (npc->_child != (EntityPtr)0x0) { local_f0 = &npc->_child; std::multiset::erase(&local_f0); } npc->_child = EVar10; std::multiset::insert(&npc->_child); if (*(EntityPtr *)((int)EVar10 + 0x3bc) != (EntityPtr)0x0) { local_f0 = (EntityPtr *)((int)EVar10 + 0x3bc); std::multiset::erase(&local_f0); } *(EntityPtr *)((int)EVar10 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar10 + 0x3bc)); if (*(EntityPtr *)((int)EVar10 + 0x3c0) != (EntityPtr)0x0) { local_f0 = (EntityPtr *)((int)EVar10 + 0x3c0); std::multiset::erase(&local_f0); } *(EntityPtr *)((int)EVar10 + 0x3c0) = splitTwin; std::multiset::insert((EntityPtr *)((int)EVar10 + 0x3c0)); if (*(int *)((int)splitTwin + 0x3bc) != 0) { local_f0 = (EntityPtr *)((int)splitTwin + 0x3bc); std::multiset::erase(&local_f0); } *(EntityPtr *)((int)splitTwin + 0x3bc) = EVar10; std::multiset::insert((EntityPtr *)((int)splitTwin + 0x3bc)); uVar21 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; npc->_i1 = 0; npc->_renderZOffset = 0x5dc; *(undefined4 *)((int)&npc->_flags + 4) = uVar21; *(int *)((int)EVar10 + 0x354) = 500; *(float *)((int)EVar10 + 0x15c) = 0.34; *(undefined4 *)((int)EVar10 + 0xbc0) = 1; fVar18 = npc->_maxHitPoints; *(uint *)((int)EVar10 + 0x168) = *(uint *)((int)EVar10 + 0x168) | 0x80000000; *(float *)((int)EVar10 + 900) = fVar18; *(float *)((int)EVar10 + 0x380) = fVar18; *(undefined4 *)((int)EVar10 + 0x16c) = *(undefined4 *)((int)EVar10 + 0x16c); *(undefined4 *)((int)splitTwin + 0x354) = 0xfffffe0c; *(undefined4 *)((int)splitTwin + 0x15c) = 0x3e851eb8; *(undefined4 *)((int)splitTwin + 0xbc0) = 2; fVar18 = npc->_maxHitPoints; *(uint *)((int)splitTwin + 0x168) = *(uint *)((int)splitTwin + 0x168) | 0x80000000; *(float *)((int)splitTwin + 900) = fVar18; *(float *)((int)splitTwin + 0x380) = fVar18; *(undefined4 *)((int)splitTwin + 0x16c) = *(undefined4 *)((int)splitTwin + 0x16c); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (tmpEntity->_pos).x - (npc->_pos).x; local_10c.y = (tmpEntity->_pos).y - (npc->_pos).y; Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); pVVar11 = Vector::ToCardinal((Vector *)(local_138 + 8),&local_10c); (npc->_v1).x = pVVar11->x; (npc->_v1).y = pVVar11->y; npc->_state = 8; npc->_stateFrame = 0; (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; ExceptionList = local_10; return; } } LAB_004c5f79: if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown + -1; } if (npc->_state != 0xd) { if (0.0 < npc->_pendingDamage) { npc->_i1 = npc->_i1 + (int)(((float)npc->_i2 * 0.6 + 1.0) * npc->_pendingDamage); } if (0 < npc->_i1) { npc->_i1 = npc->_i1 + -1; } bVar2 = Entity::IsFrame((Entity *)npc,0xf,0); if (((bVar2 != 0) && (npc->_child == (EntityPtr)0x0)) && (uVar4 = Random(), (uVar4 & 1) == 0)) { fVar18 = 0.0; uVar4 = 0; local_fc = 0.0; room = g_game->_room; if (*(int *)((int)room + 0x1264) != 0) { do { roomEntity = *(int **)(*(int *)((int)room + 0x125c) + uVar4 * 4); piVar9 = roomEntity + 10; if ((*(int *)&g_game->_deathmatchManager < 2) || (*piVar9 != 1)) { if (*piVar9 - 10U < 0x3de) goto LAB_004c605b; } else { LAB_004c605b: cVar3 = (**(code **)(*roomEntity + 0x48))(); fVar18 = local_fc; if (cVar3 != '\0') { if ((*piVar9 != 0x19d) && (*piVar9 != 0x134)) { fVar18 = (float)((int)local_fc + 1); local_fc = fVar18; } } } npc = (Entity_NPC *)local_13c; uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)room + 0x1264)); if ((1 < (uint)fVar18) && (uVar4 = Random(), uVar4 % 100 != 0)) goto LAB_004c7fd1; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_138,0x134,-1,-1, 0,0); damageSource = (EntityPtr *)0x0; candidatesEnd = (EntityPtr *)0x0; candidatesBegin = (EntityPtr *)0x0; local_10c.x = 0.0; VStack_104.y = 0.0; local_10c.y = 0.0; fVar18 = 0.0; local_8 = 3; if (local_12c != 0.0) { do { local_13c = *(EntityPtr *)(local_138._4_4_ + (int)fVar18 * 4); if (*(EntityPtr *)((int)local_13c + 0x3bc) == (EntityPtr)npc) { if (candidatesEnd == damageSource) { std::vector::_Emplace_reallocate(candidatesEnd,&local_13c); damageSource = (EntityPtr *)local_10c.y; candidatesEnd = (EntityPtr *)local_10c.x; } else { *candidatesEnd = local_13c; local_10c.x = (float)(candidatesEnd + 1); candidatesEnd = (EntityPtr *)local_10c.x; } } candidates = candidatesBegin; fVar18 = (float)((int)fVar18 + 1); } while ((uint)fVar18 < (uint)local_12c); VStack_104.y = (float)damageSource; if (candidatesBegin != candidatesEnd) { uVar4 = (int)candidatesEnd - (int)candidatesBegin >> 2; if (uVar4 == 0) { uVar5 = 0; } else { uVar5 = Random(); uVar5 = uVar5 % uVar4; } EVar10 = (EntityPtr)((int)npc + 0x3c0); VStack_f8.y = *(float *)(candidates + uVar5); if (*(int *)((int)npc + 0x3c0) != 0) { local_13c = EVar10; std::multiset::erase(&local_13c); } *(float *)EVar10 = VStack_f8.y; if ((EntityPtr)VStack_f8.y != (EntityPtr)0x0) { std::multiset::insert(EVar10); } npc_distribute_orbit_angles(); } if (candidates != (EntityPtr *)0x0) { deallocate(candidates,(int)VStack_104.y - (int)candidates >> 2); } } if (local_138[0] == '\0') { local_8 = 4; tracked_alloc(1,(void *)local_138._4_4_,0); } } } LAB_004c7fd1: if ((deliriumForm == 0) && ((*(byte *)((int)npc + 0x173) != 0 || (*(float *)((int)npc + 0x380) <= *(float *)((int)npc + 900) * 0.2)))) { *(byte *)((int)npc + 0x173) = 0; *(int *)((int)npc + 0x188) = 0; *(int *)((int)npc + 0xb64) = 0x10; *(float *)((int)npc + 0x380) = *(float *)((int)npc + 900) * 0.2; } ExceptionList = local_10; return; LAB_004c780c: fVar18 = npc->_friction * 0.8; LAB_004c787c: npc->_friction = fVar18; LAB_004c7884: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_004c7897: npc->_state = 3; } goto LAB_004c5f79; } //@@ 004c8090 NpcAI::ENTITY_MEGA_SATAN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 274 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MEGA_SATAN(Entity_NPC *npc) { float *pfVar1; char cVar2; byte bVar3; uint uVar4; EntityList_EL *handQuery; int *piVar5; int iVar6; int iVar7; byte *pbVar8; Entity_NPC *pEVar9; uint uVar10; Entity *pEVar11; int iVar12; Entity_Player *pEVar13; Entity_Laser *laser; undefined3 uVar16; undefined1 *puVar14; Vector *pVVar15; EntityConfig_Entity *entityConfig; uint3 extraout_var; LayerState *layer; void *pvVar17; int *piVar18; byte *pbVar19; uint extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; qword *allocCounter; code *pcVar20; int iVar21; char *pcVar22; byte *pbVar23; uint extraout_EDX; Entity_Player *pEVar24; PlayerManager *playerManager; Entity_Player *pEVar25; undefined4 *puVar26; bool bVar27; float fVar28; undefined1 auVar29 [16]; float fVar30; float fVar31; double dVar32; undefined4 uVar33; TypeDescriptor *pTVar34; undefined8 uVar35; EntityList_EL rightHandList; EntityList_EL nearbyEntities; Vector shotPos; Vector circleShotArgs; EntityList_EL local_2b0; undefined1 local_2a0; undefined4 *local_29c; Vector local_298; Vector local_290; int *local_288; Vector local_284; Vector local_27c; Vector local_274; Vector local_26c; Vector local_264; undefined4 *local_25c; Vector local_258; code *local_250; Entity_Player *local_24c; byte local_245; Entity_Player *local_244; byte local_23d; Entity_Player *local_23c; ProjectileParams smashProjectileParams; ProjectileParams streamProjectileParams; float streamCurving [16]; int streamFrameOffsets [6]; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; float local_80; float local_7c; float local_78; float local_74; undefined4 local_70; undefined4 local_6c; undefined8 streamAngleSteps; undefined4 local_60; EntityRef killSource; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword allocatedBytes; Game *game; Manager *manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af36db; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; if (npc->_state == 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; uVar33 = *(undefined4 *)((int)&npc->_flags + 4); (npc->_sprite)._offset.x = 0.0; (npc->_sprite)._offset.y = 39.0; (npc->_pos).x = 320.0; (npc->_pos).y = 260.0; (npc->_targetPosition).x = 320.0; (npc->_targetPosition).y = 260.0; npc->_entityGridCollisionClass = 3; npc->_stateFrame = 1; npc->_i1 = 0; npc->_i2 = -1; (npc->_v2).x = -NAN; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar33; npc->_state = 2; npc->_visible = 0; } local_290.y = 0.0; local_288 = (int *)0x0; local_2a0 = 0; local_29c = (undefined4 *)0x0; local_298.x = 0.0; local_298.y = 0.0; local_14 = 0; local_24c = (Entity_Player *)npc; local_24 = uVar4; handQuery = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_2b0,0x112,1,-1,0,0); local_2a0 = 1; local_29c = handQuery->_data; local_298.x = (float)handQuery->_capacity; fVar28 = (float)handQuery->_size; local_298.y = fVar28; local_25c = local_29c; if (local_2b0._0_1_ == '\0') { local_14._0_1_ = 1; tracked_alloc(1,local_2b0._data,0); local_14 = (uint)local_14._1_3_ << 8; } if (fVar28 != 0.0) { local_290.y = (float)__RTDynamicCast(*local_25c,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0, uVar4); } handQuery = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&rightHandList,0x112,2,-1,0,0); local_2a0 = 1; local_29c = handQuery->_data; local_298.x = (float)handQuery->_capacity; fVar28 = (float)handQuery->_size; local_298.y = fVar28; local_25c = local_29c; if (rightHandList._0_1_ == '\0') { local_14._0_1_ = 2; tracked_alloc(1,rightHandList._data,0); local_14 = (uint)local_14._1_3_ << 8; } if (fVar28 == 0.0) { piVar5 = (int *)0x0; } else { piVar5 = (int *)__RTDynamicCast(*local_25c,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor); local_288 = piVar5; } local_14 = 0xffffffff; local_25c = (undefined4 *)0x1e; if (npc->_type == 0x112) { bVar27 = false; if (npc->_dead == 0) { if (npc->_state != 0x10) { if ((int *)local_290.y == (int *)0x0) { bVar3 = *(byte *)((int)&npc->_i1 + 2); if (g_game->_frameCount % 0x1e == 0) { bVar3 = bVar3 + 1; *(byte *)((int)&npc->_i1 + 2) = bVar3; } if (0x1d < bVar3) { uVar4 = Random(); local_264.x = (npc->_pos).x - 120.0; local_264.y = (npc->_pos).y + 100.0; uVar35 = 0xc5d6ac; pTVar34 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar33 = 0; pEVar11 = Game::Spawn(g_game,0x112,1,&local_264,&g_vectorZero,(Entity *)npc,0,uVar4); local_290.y = (float)__RTDynamicCast(pEVar11,uVar33,pTVar34,uVar35); (**(code **)(*(int *)local_290.y + 0xc))(); } } else { *(undefined1 *)((int)&npc->_i1 + 2) = 0; } if (piVar5 == (int *)0x0) { bVar3 = *(byte *)((int)&npc->_i1 + 3); if (g_game->_frameCount % 0x1e == 0) { bVar3 = bVar3 + 1; *(byte *)((int)&npc->_i1 + 3) = bVar3; } if (0x1d < bVar3) { uVar4 = Random(); local_274.x = (npc->_pos).x + 120.0; local_274.y = (npc->_pos).y + 100.0; uVar35 = 0xc5d6ac; pTVar34 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar33 = 0; pEVar11 = Game::Spawn(g_game,0x112,2,&local_274,&g_vectorZero,(Entity *)npc,0,uVar4); local_288 = (int *)__RTDynamicCast(pEVar11,uVar33,pTVar34,uVar35); (**(code **)(*local_288 + 0xc))(); } } else { *(undefined1 *)((int)&npc->_i1 + 3) = 0; } } goto LAB_004c84af; } } else { LAB_004c84af: bVar27 = npc->_dead == 0; } local_250 = free_exref; if (!bVar27) { if ((int *)local_290.y != (int *)0x0) { local_90 = 0; local_8c = 0; local_88 = 0; local_84 = 0; local_80 = g_vectorZero.x; local_7c = g_vectorZero.y; local_78 = g_vectorZero.x; local_74 = g_vectorZero.y; local_70 = 0; local_6c = 0; (**(code **)(*(int *)local_290.y + 0x24))(); } if (local_288 != (int *)0x0) { killSource._type = 0; killSource._variant = 0; killSource._spawnerType = 0; killSource._spawnerVariant = 0; killSource._position.x = g_vectorZero.x; killSource._position.y = g_vectorZero.y; killSource._velocity.x = g_vectorZero.x; killSource._velocity.y = g_vectorZero.y; killSource._flags = 0; killSource._entity = (void *)0x0; (**(code **)(*local_288 + 0x24))(); } npc->_state = 0x10; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; game = g_game; npc->_dead = 0; EntityList::QueryRadius ((EntityList *)((int)game->_room + 0x1218),&nearbyEntities,&npc->_pos,1000.0,2); uVar4 = 0; local_14 = 4; if (nearbyEntities._size != 0) { do { iVar7 = uVar4 * 4; uVar4 = uVar4 + 1; *(undefined1 *)(*(int *)((int)nearbyEntities._data + iVar7) + 0x173) = 1; } while (uVar4 < (uint)nearbyEntities._size); } PersistentGameData::AddBestiaryKill(&g_manager->_persistentGameData,npc->_type,npc->_variant); local_14 = 0xffffffff; if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { uVar4 = *(uint *)((int)nearbyEntities._data + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar4); free((void *)((int)nearbyEntities._data + -4)); } local_14 = 0xffffffff; } } pcVar20 = (code *)&DAT_00000008; local_25c = (undefined4 *)0x0; local_258.y = (float)&DAT_00000008; local_23c = g_game->_room; if (local_23c->_playerCostumeMap[3]._priority != 0) { uVar4 = 0; do { local_244 = *(Entity_Player **)(local_23c->_playerCostumeMap[3]._index + uVar4 * 4); piVar5 = &local_244->_type; if (((1 < *(int *)&g_game->_deathmatchManager) && (*piVar5 == 1)) || (*piVar5 - 10U < 0x3de)) { cVar2 = (**(code **)(*(int *)local_244 + 0x48))(); pcVar20 = (code *)local_258.y; if (((cVar2 != '\0') && (iVar7 = *piVar5, iVar7 != 0x362)) && (((local_244->_flags & 0x20000000) == 0 && ((iVar7 != 0x112 && (iVar7 != 0x113)))))) { local_25c = (undefined4 *)((int)local_25c + 1); if (iVar7 == 0x13) { local_258.y = (float)((int)local_258.y + -1); pcVar20 = (code *)local_258.y; } else { local_258.y = (float)((int)local_258.y + -4); pcVar20 = (code *)local_258.y; } } } uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_23c->_playerCostumeMap[3]._priority); npc = (Entity_NPC *)local_24c; } if ((int)pcVar20 < 0) { pcVar20 = (code *)0x0; } local_258.y = (float)pcVar20; if ((npc->_state != 0xd) && (npc->_type == 0x112)) { cVar2 = (char)npc->_i1; if (cVar2 == '\0') { fVar28 = npc->_maxHitPoints * 0.8; if (fVar28 < npc->_health || fVar28 == npc->_health) goto LAB_004c87f9; fVar28 = npc->_maxHitPoints * 0.75; LAB_004c8825: npc->_health = fVar28; npc->_state = 0xd; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 1) = 0; manager = g_manager; local_244 = (Entity_Player *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_244 = (Entity_Player *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_244 = (Entity_Player *)0x3f000000; } local_23c = (Entity_Player *)0xf2; seed_fart_sound_override((int *)&local_23c); SoundEffects::Play(&manager->_sfxManager,(int)local_23c,1.0,0x78,0,(float)local_244,0.0); manager = g_manager; local_244 = (Entity_Player *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_244 = (Entity_Player *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_244 = (Entity_Player *)0x3f000000; } local_23c = (Entity_Player *)0xf3; seed_fart_sound_override((int *)&local_23c); SoundEffects::Play(&manager->_sfxManager,(int)local_23c,1.0,0x78,0,(float)local_244,0.0); if ((int *)local_290.y != (int *)0x0) { *(int *)((int)local_290.y + 0xb64) = 0xd; *(int *)((int)local_290.y + 0x410) = 0; } if (local_288 != (int *)0x0) { local_288[0x2d9] = 0xd; local_288[0x104] = 0; } } else if (cVar2 == '\x01') { fVar28 = npc->_maxHitPoints * 0.6; if (npc->_health <= fVar28 && fVar28 != npc->_health) { fVar28 = npc->_maxHitPoints * 0.5; goto LAB_004c8825; } } else { LAB_004c87f9: if ((cVar2 == '\x02') && (fVar28 = npc->_maxHitPoints * 0.4, !(fVar28 < npc->_health || fVar28 == npc->_health))) { fVar28 = npc->_maxHitPoints * 0.25; goto LAB_004c8825; } } } iVar7 = npc->_state; if (iVar7 == 2) { npc->_isInvicible = 1; npc->_entityCollisionClass = 0; if (npc->_type == 0x113) { pvVar17 = (npc->_sprite)._animState._animData; if (pvVar17 == (void *)0x0) { iVar6 = -1; iVar7 = 0; } else { local_244 = (Entity_Player *)(npc->_sprite)._animState._animFrame; dVar32 = floor((double)(float)local_244); iVar7 = *(int *)((int)pvVar17 + 0x30); iVar6 = (int)dVar32; } local_23c = (Entity_Player *)(float)iVar7; local_244 = (Entity_Player *)((float)local_23c - 15.0); local_24c = (Entity_Player *)(float)iVar6; if ((float)local_244 == (float)local_23c) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar28 = ((float)local_24c - (float)local_244) / ((float)local_23c - (float)local_244); if (fVar28 <= 0.0) { fVar28 = 0.0; } if (1.0 <= fVar28) { fVar28 = 1.0; } fVar30 = (3.0 - (fVar28 + fVar28)) * fVar28 * fVar28; fVar31 = (npc->_targetPosition).y; (npc->_pos).x = ((npc->_targetPosition).x - 320.0) * fVar30 + 320.0; (npc->_pos).y = (fVar31 - 210.0) * fVar30 + 210.0; fVar31 = (npc->_targetPosition).y; fVar28 = fVar28 * -6.0 * (fVar28 - 1.0); (npc->_velocity).x = (((npc->_targetPosition).x - 320.0) / 15.0) * fVar28; (npc->_velocity).y = ((fVar31 - 210.0) / 15.0) * fVar28; if ((npc->_sprite)._animState._animData == (void *)0x0) { iVar7 = -1; } else { local_23c = (Entity_Player *)(npc->_sprite)._animState._animFrame; dVar32 = floor((double)(float)local_23c); local_23c = (Entity_Player *)(float)dVar32; iVar7 = (int)dVar32; } if ((float)iVar7 < (float)local_244) { Game::ShakeScreen(g_game,5); iVar7 = *(int *)((int)g_game->_room + 0x11f8); if (*(char *)(iVar7 + 0x8c) == '\0') { local_23c = *(Entity_Player **)(iVar7 + 0x54); pEVar13 = *(Entity_Player **)(iVar7 + 0x58); if (pEVar13 == local_23c) { if ((int)pEVar13 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_23c = *(Entity_Player **)(iVar7 + 0x54); pEVar13 = *(Entity_Player **)(iVar7 + 0x58); } iVar6 = (*(int *)(iVar7 + 0x5c) + 1) % (int)local_23c; pEVar13 = (Entity_Player *)((int)&pEVar13[-1]._replacedPlayer + 3); *(int *)(iVar7 + 0x5c) = iVar6; *(Entity_Player **)(iVar7 + 0x58) = pEVar13; } else { iVar6 = *(int *)(iVar7 + 0x5c); } iVar21 = ((int)(&(pEVar13->_sprite)._filename + -3) + iVar6) % (int)local_23c; iVar6 = *(int *)(iVar7 + 0x50); *(undefined4 *)(iVar6 + iVar21 * 8) = 0x43a00000; *(undefined4 *)(iVar6 + 4 + iVar21 * 8) = 0x43520000; *(int *)(iVar7 + 0x58) = *(int *)(iVar7 + 0x58) + 1; *(undefined1 *)(iVar7 + 0x8c) = 1; } } } pvVar17 = g_game->_room; local_24c = *(Entity_Player **)((int)pvVar17 + 0x1c38); local_23c = (Entity_Player *)((int)pvVar17 + 0x1c04); if (local_24c != (Entity_Player *)0x0) { if (*(char *)((int)pvVar17 + 0x1c48) == '\0') { pEVar9 = (Entity_NPC *)local_24c; if (0xf < (uint)((Entity_NPC *)local_24c)->_pendingDamage) { pEVar9 = *(Entity_NPC **)local_24c; } pcVar22 = "Intro"; do { local_245 = *(byte *)pEVar9; bVar27 = local_245 < (byte)*pcVar22; if (local_245 != *pcVar22) { LAB_004c8cb4: uVar4 = -(uint)bVar27 | 1; goto LAB_004c8cb9; } if (local_245 == 0) break; local_245 = pEVar9->field_0x1; bVar27 = local_245 < (byte)pcVar22[1]; if (local_245 != pcVar22[1]) goto LAB_004c8cb4; pEVar9 = (Entity_NPC *)&pEVar9->field_0x2; pcVar22 = pcVar22 + 2; } while (local_245 != 0); uVar4 = 0; LAB_004c8cb9: if (uVar4 == 0) { pEVar9 = (Entity_NPC *)local_24c; if (0xf < (uint)((Entity_NPC *)local_24c)->_pendingDamage) { pEVar9 = *(Entity_NPC **)local_24c; } pbVar23 = s_Idle2; do { local_245 = *(byte *)pEVar9; bVar27 = local_245 < *pbVar23; if (local_245 != *pbVar23) { LAB_004c8d12: uVar4 = -(uint)bVar27 | 1; goto LAB_004c8d17; } if (local_245 == 0) break; local_245 = pEVar9->field_0x1; bVar27 = local_245 < pbVar23[1]; if (local_245 != pbVar23[1]) goto LAB_004c8d12; pEVar9 = (Entity_NPC *)&pEVar9->field_0x2; pbVar23 = pbVar23 + 2; } while (local_245 != 0); uVar4 = 0; LAB_004c8d17: if (((uVar4 != 0) || ((char)((Entity_NPC *)local_24c)->_spawnerType != '\0')) && (bVar3 = ANM2::SetAnimation((ANM2 *)local_23c,s_Idle2,1), bVar3 != 0)) { AnimationState::Rewind((AnimationState *)((int)pvVar17 + 0x1c34)); *(undefined1 *)((int)pvVar17 + 0x1c48) = 1; } game = g_game; piVar5 = (g_game->_playerManager)._playerList._begin; if (piVar5 != (g_game->_playerManager)._playerList._end) { do { iVar7 = *piVar5; piVar5 = piVar5 + 1; *(undefined1 *)(iVar7 + 0x410) = 1; } while (piVar5 != (game->_playerManager)._playerList._end); } pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004c8dce: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Appear"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c8db0: uVar4 = -(uint)bVar27 | 1; goto LAB_004c8db5; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c8db0; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c8db5: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c8dce; } local_244 = (Entity_Player *)0x3f800000; npc->_visible = 1; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_244 = (Entity_Player *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_244 = (Entity_Player *)0x3f000000; } local_23c = (Entity_Player *)0xf1; seed_fart_sound_override((int *)&local_23c); SoundEffects::Play(&manager->_sfxManager,(int)local_23c,1.0,2,0,(float)local_244,0.0); } else { if (*(char *)((int)pvVar17 + 0x1c48) != '\0') goto LAB_004c8e92; LAB_004c8f34: pEVar9 = (Entity_NPC *)local_24c; if (0xf < (uint)((Entity_NPC *)local_24c)->_pendingDamage) { pEVar9 = *(Entity_NPC **)local_24c; } pbVar23 = &DAT_00b601c4; do { bVar3 = *(byte *)pEVar9; bVar27 = bVar3 < *pbVar23; if (bVar3 != *pbVar23) { LAB_004c8f61: uVar4 = -(uint)bVar27 | 1; goto LAB_004c8f66; } if (bVar3 == 0) break; bVar3 = pEVar9->field_0x1; bVar27 = bVar3 < pbVar23[1]; if (bVar3 != pbVar23[1]) goto LAB_004c8f61; pEVar9 = (Entity_NPC *)&pEVar9->field_0x2; pbVar23 = pbVar23 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c8f66: if (uVar4 == 0) { playerManager = &g_game->_playerManager; local_244 = (Entity_Player *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar17 = (playerManager->_playerList)._end; if ((int)pvVar17 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar17 = (playerManager->_playerList)._end; } piVar5 = (playerManager->_playerList)._begin; if (local_244 < (Entity_Player *)((int)pvVar17 - (int)piVar5 >> 2)) { piVar5 = piVar5 + (int)local_244; } if ((*(int *)(*piVar5 + 0x2c) == 0) && (pfVar1 = (float *)(*piVar5 + 0x340), *pfVar1 <= 540.0 && *pfVar1 != 540.0)) { pbVar23 = (byte *)local_23c->_spawnerType; if (pbVar23 == (byte *)0x0) goto LAB_004c9061; pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Intro"; goto LAB_004c9020; } local_244 = (Entity_Player *)&local_244->field_0x1; playerManager = &g_game->_playerManager; } while (local_244 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } } } else { LAB_004c8e92: pEVar9 = (Entity_NPC *)local_24c; if (0xf < (uint)((Entity_NPC *)local_24c)->_pendingDamage) { pEVar9 = *(Entity_NPC **)local_24c; } pcVar22 = "Intro"; do { local_245 = *(byte *)pEVar9; bVar27 = local_245 < (byte)*pcVar22; if (local_245 != *pcVar22) { LAB_004c8ee3: uVar4 = -(uint)bVar27 | 1; goto LAB_004c8ee8; } if (local_245 == 0) break; local_245 = pEVar9->field_0x1; bVar27 = local_245 < (byte)pcVar22[1]; if (local_245 != pcVar22[1]) goto LAB_004c8ee3; pEVar9 = (Entity_NPC *)&pEVar9->field_0x2; pcVar22 = pcVar22 + 2; } while (local_245 != 0); uVar4 = 0; LAB_004c8ee8: if (uVar4 == 0) { Game::ShakeScreen(g_game,8); game = g_game; piVar5 = (g_game->_playerManager)._playerList._begin; if (piVar5 != (g_game->_playerManager)._playerList._end) { do { iVar7 = *piVar5; piVar5 = piVar5 + 1; *(undefined1 *)(iVar7 + 0x410) = 0; } while (piVar5 != (game->_playerManager)._playerList._end); } } else if (*(char *)((int)pvVar17 + 0x1c48) == '\0') goto LAB_004c8f34; } } LAB_004c9128: if (npc->_type == 0x112) { if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) { pbVar23 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "Appear"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9180: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9185; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9180; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9185: if ((uVar4 == 0) && (iVar7 = *(int *)((int)g_game->_room + 0x11f8), *(char *)(iVar7 + 0x8c) == '\0')) { local_23c = *(Entity_Player **)(iVar7 + 0x54); pEVar13 = *(Entity_Player **)(iVar7 + 0x58); if (pEVar13 == local_23c) { if ((int)pEVar13 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_23c = *(Entity_Player **)(iVar7 + 0x54); pEVar13 = *(Entity_Player **)(iVar7 + 0x58); } iVar6 = (*(int *)(iVar7 + 0x5c) + 1) % (int)local_23c; pEVar13 = (Entity_Player *)((int)&pEVar13[-1]._replacedPlayer + 3); *(int *)(iVar7 + 0x5c) = iVar6; *(Entity_Player **)(iVar7 + 0x58) = pEVar13; } else { iVar6 = *(int *)(iVar7 + 0x5c); } iVar21 = ((int)(&(pEVar13->_sprite)._filename + -3) + iVar6) % (int)local_23c; iVar6 = *(int *)(iVar7 + 0x50); *(undefined4 *)(iVar6 + iVar21 * 8) = 0x43a00000; *(undefined4 *)(iVar6 + 4 + iVar21 * 8) = 0x43520000; *(int *)(iVar7 + 0x58) = *(int *)(iVar7 + 0x58) + 1; *(undefined1 *)(iVar7 + 0x8c) = 1; } } goto LAB_004c921d; } LAB_004c9285: iVar7 = npc->_state; goto LAB_004c928b; } LAB_004c921d: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004c9285; pbVar23 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "Appear"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9260: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9265; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9260; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9265: if (uVar4 != 0) goto LAB_004c9285; npc->_state = 3; npc->_isInvicible = 0; npc->_entityCollisionClass = 4; LAB_004c9294: uVar4 = 10; fVar28 = npc->_maxHitPoints * 0.5; if (npc->_health <= fVar28 && fVar28 != npc->_health) { uVar4 = 2; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004c942d: pbVar23 = (npc->_sprite)._animState._animData; if (npc->_type == 0x112) { if (pbVar23 != (byte *)0x0) { if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pbVar8 = s_Idle; do { bVar3 = *pbVar23; bVar27 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_004c9470: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9475; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_004c9470; pbVar23 = pbVar23 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9475: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004c960d; } uVar35 = 0x100b1bc54; } else { fVar28 = npc->_maxHitPoints; if (npc->_health <= (fVar28 + fVar28) / 3.0) { if (npc->_health <= fVar28 / 3.0) { if (pbVar23 != (byte *)0x0) { if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pbVar8 = &DAT_00b1d43c; do { bVar3 = *pbVar23; bVar27 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_004c95d0: uVar4 = -(uint)bVar27 | 1; goto LAB_004c95d5; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_004c95d0; pbVar23 = pbVar23 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c95d5: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004c960d; } uVar35 = 0x100b1d43c; } else { if (pbVar23 != (byte *)0x0) { if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pbVar8 = s_Idle2; do { bVar3 = *pbVar23; bVar27 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_004c9570: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9575; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_004c9570; pbVar23 = pbVar23 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9575: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004c960d; } uVar35 = 0x100b1d428; } } else { if (pbVar23 != (byte *)0x0) { if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pbVar8 = &DAT_00b601c4; do { bVar3 = *pbVar23; bVar27 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_004c9500: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9505; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_004c9500; pbVar23 = pbVar23 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9505: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004c960d; } uVar35 = 0x100b601c4; } } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)uVar35,(byte)((ulonglong)uVar35 >> 0x20)); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if ((npc->_sprite)._animState._isPlaying != 0) { pbVar23 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pbVar8 = s_Idle; do { bVar3 = *pbVar23; bVar27 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_004c9300: uVar10 = -(uint)bVar27 | 1; goto LAB_004c9305; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_004c9300; pbVar23 = pbVar23 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar10 = 0; LAB_004c9305: if (uVar10 == 0) { local_244 = (Entity_Player *)(npc->_sprite)._animState._animFrame; dVar32 = floor((double)(float)local_244); local_244 = (Entity_Player *)(float)dVar32; if ((((int)dVar32 == 0) && (uVar10 = Random(), uVar10 % uVar4 == 0)) && (npc->_type == 0x112)) { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 != (byte *)0x0) { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "NoseBlow"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c93a0: uVar4 = -(uint)bVar27 | 1; goto LAB_004c93a5; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c93a0; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c93a5: if ((uVar4 == 0) && ((pbVar23[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004c93dc; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"NoseBlow",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } } LAB_004c93dc: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004c942d; pbVar23 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "NoseBlow"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9420: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9425; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9420; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9425: if (uVar4 != 0) goto LAB_004c942d; } LAB_004c960d: local_23c = (Entity_Player *)0x1; if ((local_288 != (int *)0x0) && (local_288[0x2d9] != 3)) { local_23c = (Entity_Player *)(uint)(local_288[0x2d9] == 0xd); } if ((((int *)local_290.y != (int *)0x0) && (*(int *)((int)local_290.y + 0xb64) != 3)) && (*(int *)((int)local_290.y + 0xb64) != 0xd)) { local_23c = (Entity_Player *)0x0; } local_244 = (Entity_Player *)0x1; if (npc->_type == 0x113) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&local_2b0,&npc->_pos,360.0,2); local_244 = (Entity_Player *)((uint)local_244 & 0xff); if (5 < (uint)local_2b0._size) { local_244 = (Entity_Player *)0x0; } if (local_2b0._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_2b0._data != (void *)0x0) { uVar4 = *(uint *)((int)local_2b0._data + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar4); (*local_250)(); } local_14 = 0xffffffff; } } if (((char)local_23c != '\0') && ((char)local_244 != '\0')) { if ((npc->_stateFrame < 1) || ((npc->_stateFrame % 0x1e != 0 || (uVar4 = Random(), 0x45 < uVar4 % 100)))) { npc->_stateFrame = npc->_stateFrame + 1; } else { iVar7 = 0; pEVar11 = Entity_NPC::GetPlayerTarget(npc); if (ABS((pEVar11->_pos).x - (npc->_pos).x) < 120.0) { iVar7 = 0x14; pEVar11 = Entity_NPC::GetPlayerTarget(npc); fVar28 = (npc->_pos).y - (pEVar11->_pos).y; fVar31 = (npc->_pos).x - (pEVar11->_pos).x; fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); if (300.0 < fVar28) { iVar7 = 0x28; } pEVar11 = Entity_NPC::GetPlayerTarget(npc); fVar28 = (npc->_pos).y - (pEVar11->_pos).y; fVar31 = (npc->_pos).x - (pEVar11->_pos).x; fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); iVar6 = npc->_i2; iVar21 = iVar7 + 0x14; if (180.0 <= fVar28) { iVar21 = iVar7; } iVar12 = iVar21 + 0x32; if (iVar6 != 0x1000) { iVar12 = iVar21; } iVar7 = iVar12 + 0x1e; if (iVar6 != 7) { iVar7 = iVar12; } if (iVar6 == 8) { iVar7 = (int)((float)iVar7 * 0.1); } if ((npc->_v2).x == 1.12104e-44) { iVar7 = (int)((float)iVar7 * 0.6); } if (iVar6 == -1) { iVar7 = 0; } } iVar6 = npc->_i2; iVar21 = 0xaf; if (iVar6 != -1) { iVar21 = 0x19; } iVar12 = iVar21 + 0x1e; if (iVar6 != 8) { iVar12 = iVar21; } local_24c = (Entity_Player *)(iVar12 + 0x1e); if (iVar6 != 7) { local_24c = (Entity_Player *)iVar12; } if (iVar6 == 9) { local_24c = (Entity_Player *)(int)((float)(int)local_24c * 0.1); } if ((npc->_v2).x == 1.26117e-44) { local_24c = (Entity_Player *)(int)((float)(int)local_24c * 0.1); } pEVar13 = (Entity_Player *)(-(uint)(local_288 != (int *)0x0) & 0xc); local_244 = (Entity_Player *)((int)&(pEVar13->_damageEvents)._begin + 1); if ((int *)local_290.y == (int *)0x0) { local_244 = pEVar13; } if ((local_288 != (int *)0x0) || (local_23c = local_244, (int *)local_290.y != (int *)0x0)) { pEVar11 = Entity_NPC::GetPlayerTarget(npc); fVar28 = (npc->_pos).y - (pEVar11->_pos).y; fVar31 = (npc->_pos).x - (pEVar11->_pos).x; local_23c = local_244; fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); if (fVar28 < 260.0) { local_244 = (Entity_Player *)&local_244->_pendingDamage; local_23c = local_244; } } if (((npc->_v2).x == 5.74112e-42) && (npc->_i2 == 0x1001)) { fVar28 = (float)(int)local_244; local_244 = (Entity_Player *)0x14; local_23c = (Entity_Player *)(int)(fVar28 * 0.25); } else { local_244 = (Entity_Player *)0x28; if (npc->_i2 != 8) { local_244 = (Entity_Player *)0x14; } if (npc->_i2 == 7) { local_244 = (Entity_Player *)(int)((float)(int)local_244 * 0.1); } } pEVar11 = Entity_NPC::GetPlayerTarget(npc); fVar28 = (npc->_pos).y - (pEVar11->_pos).y; fVar31 = (npc->_pos).x - (pEVar11->_pos).x; fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); if (300.0 < fVar28) { local_258.y = (float)(int)((float)(int)local_258.y * 1.5); } iVar6 = 0; if (((local_288 != (int *)0x0) && ((int *)local_290.y != (int *)0x0)) && (iVar6 = 0xf, npc->_i2 == 9)) { iVar6 = 0x1e; } if (npc->_type == 0x113) { iVar7 = 0; local_24c = (Entity_Player *)0x186a0; local_23c = (Entity_Player *)0x186a0; local_250 = (code *)0x186a0; local_258.y = 1.4013e-40; local_244 = (Entity_Player *)0x186a0; LAB_004c9aae: uVar4 = Random(); uVar4 = uVar4 % (uint)local_244; } else { local_24c = (Entity_Player *)((int)local_24c + iVar7); local_23c = (Entity_Player *) ((int)(&(local_23c->_sprite)._filename + -3) + 0xcc + (int)(&((Entity_NPC *)local_24c)->_sprite + -1)); local_250 = (code *)((int)(&(local_23c->_sprite)._filename + -3) + (int)local_244); local_258.y = (float)(local_250 + (int)local_258.y); local_244 = (Entity_Player *)((int)local_258.y + iVar6); if (local_244 != (Entity_Player *)0x0) goto LAB_004c9aae; uVar4 = 0; } (npc->_v2).x = (float)npc->_i2; if ((int)uVar4 < iVar7) { npc->_state = 8; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 1) = 0; npc->_i2 = 8; } else if ((int)uVar4 < (int)local_24c) { npc->_state = 9; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 1) = 0; npc->_i2 = 9; if (npc->_type == 0x113) { *(undefined1 *)((int)&npc->_i1 + 1) = 1; } } else if ((int)uVar4 < (int)local_23c) { uVar4 = Random(); piVar5 = (int *)local_290.y; if (uVar4 % 10 < 6) { piVar5 = local_288; } piVar18 = local_288; if (piVar5 != (int *)0x0) { piVar18 = piVar5; } piVar5 = (int *)local_290.y; if (piVar18 != (int *)0x0) { piVar5 = piVar18; } if (piVar5 != (int *)0x0) { piVar5[0x2d9] = 8; piVar5[0x104] = 0; Entity_NPC::PlaySound(npc,0xef,0.6,2,0,1.0); } npc->_i2 = 0x1001; } else if ((int)uVar4 < (int)local_250) { npc->_state = 7; uVar4 = Random(); *(char *)((int)&npc->_i1 + 1) = (char)(uVar4 % 3) * '\x02' + '\x01'; npc->_stateFrame = 0; npc->_i2 = npc->_state; } else if ((int)uVar4 < (int)local_258.y) { npc->_state = 0xe; npc->_stateFrame = 0; *(undefined1 *)((int)&npc->_i1 + 1) = 0; if (local_288 != (int *)0x0) { local_288[0x2d9] = 0xe; } if ((int *)local_290.y != (int *)0x0) { *(int *)((int)local_290.y + 0xb64) = 0xe; } npc->_i2 = npc->_state; } else if ((int)uVar4 < (int)local_244) { if (local_288 != (int *)0x0) { local_288[0x104] = 0; local_288[0x2d9] = 9; } if ((int *)local_290.y != (int *)0x0) { *(int *)((int)local_290.y + 0x410) = -0x12; *(int *)((int)local_290.y + 0xb64) = 9; } Entity_NPC::PlaySound(npc,0xf1,1.0,2,0,1.0); npc->_i2 = 0x1000; } } } } else { LAB_004c928b: if (iVar7 == 3) goto LAB_004c9294; } if (npc->_state == 8) { cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); if (cVar2 == '\0') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004c9d85: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charging",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Charging"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9d67: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9d6c; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9d67; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9d6c: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c9d85; } manager = g_manager; local_244 = (Entity_Player *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_244 = (Entity_Player *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_244 = (Entity_Player *)0x3f000000; } local_23c = (Entity_Player *)0xf0; seed_fart_sound_override((int *)&local_23c); SoundEffects::Play(&manager->_sfxManager,(int)local_23c,1.2,0x3c,0,(float)local_244,0.0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined1 *)((int)&npc->_i1 + 1) = 1; } } else { if (cVar2 != '\x01') goto LAB_004c9f50; pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004c9eae: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot1",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Shoot1"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9e90: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9e95; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9e90; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9e95: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c9eae; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { local_264.x = 0.0; local_264.y = 40.0; laser = Entity_Laser::ShootAngle(6,&npc->_pos,90.0,0x28,&local_264,(Entity *)npc,0); laser->_renderDepthOffset = 10000.0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004c9f50; } npc->_state = 3; *(undefined1 *)((int)&npc->_i1 + 1) = 0; npc->_stateFrame = 0; } } LAB_004c9f50: fVar28 = 7.00649e-45; if (npc->_state == 9) { cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); local_24c = (Entity_Player *)0x96; if (cVar2 == '\0') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004c9fce: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charging",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Charging"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9fb0: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9fb5; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9fb0; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004c9fb5: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004c9fce; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined1 *)((int)&npc->_i1 + 1) = 1; } manager = g_manager; local_244 = (Entity_Player *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_244 = (Entity_Player *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_244 = (Entity_Player *)0x3f000000; } local_23c = (Entity_Player *)0xf0; seed_fart_sound_override((int *)&local_23c); SoundEffects::Play(&manager->_sfxManager,(int)local_23c,0.5,0x3c,0,(float)local_244,0.0); } else if (cVar2 == '\x01') { if (npc->_type == 0x112) { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 != (byte *)0x0) { if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "Shoot2Start"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004ca0e0: uVar4 = -(uint)bVar27 | 1; goto LAB_004ca0e5; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004ca0e0; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004ca0e5: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004ca16d; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot2Start",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { fVar28 = npc->_maxHitPoints; if (npc->_health <= (fVar28 + fVar28) / 3.0) { if (npc->_health <= fVar28 / 3.0) { pcVar22 = "Shoot3Start"; } else { pcVar22 = "Shoot2Start"; } } else { pcVar22 = "Shoot1Start"; } ANM2::Play(&npc->_sprite,(byte *)pcVar22,0); } LAB_004ca16d: iVar7 = npc->_type; if (iVar7 == 0x112) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004cb4df; uVar4 = Random(); *(char *)((int)&npc->_i1 + 1) = (char)(uVar4 % 9) + '\x02'; iVar7 = npc->_type; } if ((iVar7 == 0x113) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { uVar4 = Random(); *(char *)((int)&npc->_i1 + 1) = (char)(uVar4 % 0x1a) + '\x02'; } } else { if (0x61 < (byte)(cVar2 - 2U)) { if (cVar2 == 'd') { if (npc->_type == 0x112) { pcVar22 = "Shoot2End"; } else { fVar28 = npc->_maxHitPoints; if (npc->_health <= (fVar28 + fVar28) / 3.0) { pcVar22 = "Shoot2End"; if (npc->_health <= fVar28 / 3.0) { pcVar22 = "Shoot3End"; } } else { pcVar22 = "Shoot1End"; } } ANM2::Play(&npc->_sprite,(byte *)pcVar22,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(undefined1 *)((int)&npc->_i1 + 1) = 0; npc->_stateFrame = 0; } } goto LAB_004cb4df; } if (npc->_type == 0x112) { pcVar22 = "Shoot2Loop"; } else { fVar31 = npc->_maxHitPoints; if (npc->_health <= (fVar31 + fVar31) / 3.0) { pcVar22 = "Shoot2Loop"; if (npc->_health <= fVar31 / 3.0) { pcVar22 = "Shoot3Loop"; } } else { pcVar22 = "Shoot1Loop"; } } ANM2::Play(&npc->_sprite,(byte *)pcVar22,0); uVar4 = Random(); Entity_NPC::PlaySound(npc,0xf5,1.0,uVar4 % 0x28 + 0x1e,0,1.0); cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); local_284.y = 6.0; local_258.y = (float)&DAT_0000003c; if (cVar2 == '\x02') { local_26c.y = 8.40779e-45; local_274.y = 2.8026e-45; streamAngleSteps = 0x3c2b92a63cab92a6; streamFrameOffsets[0] = 0; streamFrameOffsets[1] = 5; if (npc->_type == 0x113) { local_284.y = 9.0; streamFrameOffsets[1] = 6; } fVar28 = (float)((uint)(npc->_type == 0x113) * 2 + 10); local_27c.y = fVar28; } else if (cVar2 == '\x03') { local_26c.y = 7.00649e-45; local_274.y = 2.8026e-45; streamAngleSteps = 0xbc80adfd3c80adfd; streamFrameOffsets[0] = 0; streamFrameOffsets[1] = 4; if (npc->_type == 0x113) { local_284.y = 9.0; streamFrameOffsets[1] = 5; } fVar28 = (float)((uint)(npc->_type == 0x113) * 2 + 8); local_27c.y = fVar28; } else { if (cVar2 == '\x04') { local_26c.y = 4.2039e-45; local_274.y = 1.4013e-45; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3e162051); streamFrameOffsets[0] = 0; if (npc->_type == 0x113) { local_284.y = 9.0; } fVar28 = 2.8026e-45; goto LAB_004cad1c; } if (cVar2 == '\x05') { local_284.y = 12.0; iVar7 = npc->_type; local_26c.y = 8.40779e-45; local_258.y = (float)&DAT_0000003c; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f20d97c); streamFrameOffsets[0] = 0; if (iVar7 == 0x113) { local_284.y = 14.400001; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3ed67750); } } else if (cVar2 == '\x06') { local_284.y = 9.0; iVar7 = npc->_type; local_26c.y = 1.12104e-44; local_258.y = 1.26117e-43; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f20d97c); streamFrameOffsets[0] = 0; if (iVar7 == 0x113) { local_284.y = 10.8; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f060a92); } } else if (cVar2 == '\a') { local_284.y = 8.0; iVar7 = npc->_type; local_26c.y = 1.26117e-44; local_258.y = 1.68156e-43; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f060a92); streamFrameOffsets[0] = 0; if (iVar7 == 0x113) { local_284.y = 9.6; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f20d97c); } } else { if (cVar2 != '\b') { if (cVar2 == '\t') { fVar28 = 2.8026e-44; local_27c.y = 2.8026e-44; local_26c.y = 4.2039e-44; local_284.y = 8.0; local_274.y = 4.2039e-45; streamAngleSteps = 0x3b16fbef3b16fbef; local_60 = 0x3b16fbef; streamFrameOffsets[0] = 0; streamFrameOffsets[1] = 3; streamFrameOffsets[2] = 6; if (npc->_type != 0x113) goto LAB_004cad22; local_284.y = 12.0; fVar28 = 4.2039e-44; local_26c.y = 2.8026e-44; streamFrameOffsets[1] = 5; streamFrameOffsets[2] = 10; } else { if (cVar2 == '\n') { fVar28 = 3.50325e-44; local_26c.y = 1.4013e-44; if (npc->_type != 0x113) { fVar28 = 4.2039e-44; } local_284.y = 4.0; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3c4de32e); streamFrameOffsets[0] = 0; goto LAB_004cad12; } if (cVar2 == '\v') { local_284.y = 3.0; fVar28 = 2.8026e-44; local_26c.y = 2.8026e-44; local_274.y = 2.8026e-45; local_24c = (Entity_Player *)0xf0; streamFrameOffsets[0] = 0; streamCurving[0] = 0.002; streamAngleSteps = 0x3a89421f3a89421f; streamFrameOffsets[1] = 10; streamCurving[1] = 0.002; } else if (cVar2 == '\f') { local_284.y = 3.0; fVar28 = 2.8026e-44; local_26c.y = 1.96182e-44; local_274.y = 2.8026e-45; local_24c = (Entity_Player *)0xf0; streamFrameOffsets[0] = 0; streamCurving[0] = 0.003; streamAngleSteps = 0x3bab92a6bbab92a6; streamFrameOffsets[1] = 0; streamCurving[1] = 0.003; } else if (cVar2 == '\r') { local_284.y = 3.0; fVar28 = 1.68156e-44; local_26c.y = 2.8026e-44; local_274.y = 2.8026e-45; local_24c = (Entity_Player *)0xf0; streamFrameOffsets[0] = 0; streamCurving[0] = 0.0035; streamAngleSteps = 0xbb09421fbb09421f; streamFrameOffsets[1] = 10; streamCurving[1] = 0.0035; } else { if (cVar2 == '\x12') { local_284.y = 3.0; fVar28 = 1.68156e-44; local_26c.y = 1.4013e-44; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3bcde32e); streamFrameOffsets[0] = 0; } else if (cVar2 == '\x13') { fVar28 = 4.2039e-45; local_26c.y = 8.40779e-45; local_284.y = 5.0; local_258.y = 1.68156e-43; local_24c = (Entity_Player *)0xf0; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f00adfd); streamFrameOffsets[0] = 0; } else if (cVar2 == '\x14') { local_284.y = 3.0; fVar28 = 7.00649e-44; local_26c.y = 3.50325e-44; streamAngleSteps = (ulonglong)streamAngleSteps._4_4_ << 0x20; streamFrameOffsets[0] = 0; } else if (cVar2 == '\x15') { local_26c.y = 4.2039e-45; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3d0ef68c); streamFrameOffsets[0] = 0; } else { if (cVar2 != '\x16') { if (cVar2 == '\x17') { fVar28 = 2.8026e-44; local_26c.y = 7.00649e-45; local_284.y = 9.0; local_274.y = 2.8026e-45; local_258.y = 1.68156e-43; streamFrameOffsets[0] = 0; streamAngleSteps = 0; streamFrameOffsets[1] = 10; } else { if (cVar2 == '\x18') { fVar28 = 2.8026e-45; local_26c.y = 5.60519e-45; local_284.y = 5.0; local_258.y = 8.54792e-44; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3fc90fdb); streamFrameOffsets[0] = 0; goto LAB_004cad12; } if (cVar2 == '\x0e') { fVar28 = 1.4013e-44; local_26c.y = 1.4013e-44; local_284.y = 4.0; local_274.y = 2.8026e-45; streamFrameOffsets[0] = 0; streamCurving[0] = 0.0035; streamAngleSteps = 0; streamFrameOffsets[1] = 5; streamCurving[1] = 0.0035; } else { if (cVar2 != '\x0f') { if (cVar2 == '\x10') { fVar28 = 1.4013e-44; local_26c.y = 1.12104e-44; local_27c.y = 1.4013e-44; local_274.y = 2.8026e-45; local_24c = (Entity_Player *)0xf0; local_284.y = 5.0; fVar31 = ((float)npc->_stateFrame - 0.0) / 240.0; if (fVar31 <= 0.0) { fVar31 = 0.0; } if (1.0 <= fVar31) { fVar31 = 1.0; } fVar31 = cos(fVar31 * 12.566371 + 0.0); local_244 = (Entity_Player *)(fVar31 * 0.0035); iVar6 = 0; streamCurving[0] = (float)local_244; streamCurving[1] = (float)local_244; iVar7 = 0; streamAngleSteps = 0; do { *(int *)((int)streamFrameOffsets + iVar7) = iVar6; iVar7 = iVar7 + 4; iVar6 = iVar6 + 5; } while (iVar6 < 10); } else { if (cVar2 != '\x11') { if (cVar2 != '\x19') { if (cVar2 == '\x1a') { fVar28 = 1.4013e-44; local_26c.y = 2.10195e-44; local_284.y = 5.0; streamFrameOffsets[0] = 0; } else { if (cVar2 == '\x1b') { local_284.y = 5.0; streamAngleSteps = (ulonglong)streamAngleSteps._4_4_ << 0x20; streamFrameOffsets[0] = 0; } else { fVar28 = 1.4013e-44; } local_26c.y = (float)((uint)(cVar2 == '\x1b') * 4 + 6); local_258.y = 2.10195e-43; if (cVar2 != '\x1b') { local_258.y = (float)&DAT_0000003c; } } goto LAB_004cad12; } fVar28 = 5.04467e-44; local_26c.y = 2.8026e-44; local_274.y = 2.8026e-45; local_284.y = 5.0; local_258.y = 5.04467e-44; streamFrameOffsets[0] = 0; streamAngleSteps = 0x3ec90fdb3ec90fdb; streamFrameOffsets[1] = 0x12; goto LAB_004cad1c; } local_26c.y = 8.40779e-45; local_274.y = 1.4013e-45; fVar28 = 2.8026e-45; local_27c.y = 2.8026e-45; local_24c = (Entity_Player *)0xf0; fVar31 = ((float)npc->_stateFrame - 0.0) / 240.0; if (fVar31 <= 0.0) { fVar31 = 0.0; } if (1.0 <= fVar31) { fVar31 = 1.0; } local_244 = (Entity_Player *)(fVar31 * 6.2831855 + 0.0); fVar31 = cos((float)local_244); streamAngleSteps = streamAngleSteps & 0xffffffff00000000; streamFrameOffsets[0] = 0; local_284.y = (fVar31 * fVar31 * 0.19999999 + 0.8) * 8.0; fVar31 = sin((float)local_244); streamCurving[0] = fVar31 * 0.007; } goto LAB_004cad22; } fVar28 = 8.40779e-45; local_26c.y = 1.4013e-44; local_274.y = 2.8026e-45; local_24c = (Entity_Player *)0xf0; local_284.y = 7.0; streamFrameOffsets[0] = 0; streamAngleSteps = 0; streamFrameOffsets[1] = 3; fVar31 = ((float)npc->_stateFrame - 0.0) / 240.0; if (fVar31 <= 0.0) { fVar31 = 0.0; } if (1.0 <= fVar31) { fVar31 = 1.0; } streamCurving[0] = 0.0035 / (1.0 - fVar31 * 0.6); streamCurving[1] = streamCurving[0]; } } goto LAB_004cad1c; } local_26c.y = 8.40779e-45; local_284.y = 9.0; local_258.y = 1.68156e-43; local_24c = (Entity_Player *)0x78; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3ec90fdb); streamFrameOffsets[0] = 0; } LAB_004cad12: local_274.y = 1.4013e-45; } } LAB_004cad1c: local_27c.y = fVar28; goto LAB_004cad22; } local_284.y = 7.0; iVar7 = npc->_type; local_26c.y = 1.68156e-44; local_258.y = 1.68156e-43; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3ed67750); streamFrameOffsets[0] = 0; if (iVar7 == 0x113) { local_284.y = 8.400001; streamAngleSteps = CONCAT44(streamAngleSteps._4_4_,0x3f3ba866); } } streamFrameOffsets[0] = 0; local_274.y = 1.4013e-45; fVar28 = (float)((uint)(iVar7 == 0x113) * 2 + 2); local_27c.y = fVar28; } LAB_004cad22: local_250 = (code *)0x0; do { pEVar13 = (Entity_Player *)npc->_stateFrame; local_264.y = (float)pEVar13; if (((int)pEVar13 - streamFrameOffsets[(int)local_250]) % (int)fVar28 == 0) { ProjectileParams::ProjectileParams(&streamProjectileParams); pEVar13 = (Entity_Player *)streamProjectileParams.BulletFlags; cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); pEVar25 = (Entity_Player *) ((uint)(Entity_Player *)streamProjectileParams.BulletFlags | 0x80); streamProjectileParams.HeightModifier = 5.0; streamProjectileParams.Scale = 1.8; streamProjectileParams.FallingAccelModifier = -0.06; streamProjectileParams.FallingSpeedModifier = -2.0; streamProjectileParams.FireDirectionLimit.x = 0.0; streamProjectileParams.FireDirectionLimit.y = 1.0; streamProjectileParams.DotProductLimit = 0.2; local_23c = streamProjectileParams.BulletFlags._4_4_; local_264.y = (float)streamProjectileParams.BulletFlags._4_4_; local_244 = pEVar25; pEVar24 = streamProjectileParams.BulletFlags._4_4_; if ((byte)(cVar2 - 2U) < 3) { streamProjectileParams.CircleAngle = (float)npc->_stateFrame * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); streamProjectileParams.BulletFlags._0_4_ = pEVar25; } else { if ((byte)(cVar2 - 5U) < 4) { uVar4 = npc->_stateFrame % (int)local_258.y - (int)local_258.y / 2; uVar10 = (int)uVar4 >> 0x1f; streamProjectileParams.CircleAngle = ((float)(int)((uVar4 ^ uVar10) - uVar10) * *(float *)((int)&streamAngleSteps + (int)local_250 * 4)) / (float)((int)local_258.y / 2); streamProjectileParams.BulletFlags._0_4_ = pEVar25; } else { if (cVar2 != '\t') { if (cVar2 == '\n') { streamProjectileParams.CircleAngle = (float)npc->_stateFrame * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); pEVar25 = (Entity_Player *) ((uint)(Entity_Player *)streamProjectileParams.BulletFlags | 0x10080); streamProjectileParams.BulletFlags._0_4_ = (Entity_Player *) ((uint)(Entity_Player *)streamProjectileParams.BulletFlags | 0x10080); } else if ((byte)(cVar2 - 0xbU) < 7) { local_23c = (Entity_Player *)0x40000; streamProjectileParams.CircleAngle = (float)npc->_stateFrame * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); if (((uint)local_250 & 1) == 0) { local_23c = (Entity_Player *)0x80000; } local_244 = streamProjectileParams.BulletFlags._4_4_; local_23c = (Entity_Player *)((uint)local_23c | (uint)pEVar25); streamProjectileParams.CurvingStrength = streamCurving[(int)local_250]; if (cVar2 == '\x0e') { streamProjectileParams.FallingAccelModifier = -0.085; pEVar25 = (Entity_Player *)((uint)local_23c | 0x400000); streamProjectileParams.BulletFlags._0_4_ = (Entity_Player *)((uint)local_23c | 0x400000); } else { pEVar25 = local_23c; streamProjectileParams.BulletFlags._0_4_ = local_23c; if (cVar2 != '\x0f') { streamProjectileParams.BulletFlags._0_4_ = local_23c; if (cVar2 != '\x11') { streamProjectileParams.FallingAccelModifier = -0.085; streamProjectileParams.BulletFlags._0_4_ = local_23c; } } } } else if ((byte)(cVar2 - 0x12U) < 3) { streamProjectileParams.CircleAngle = *(float *)((int)&streamAngleSteps + (int)local_250 * 4) * (float)npc->_stateFrame; if (cVar2 == '\x13') { streamProjectileParams.BulletFlags._0_4_ = pEVar25; fVar28 = cos(((float)npc->_stateFrame * 6.2831855) / (float)(int)local_258.y); streamProjectileParams.CircleAngle = fVar28 * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); } streamProjectileParams.FallingAccelModifier = -0.085; pEVar24 = local_23c; pEVar25 = (Entity_Player *)((uint)pEVar13 | 0x400080); streamProjectileParams.BulletFlags._0_4_ = (Entity_Player *)((uint)pEVar13 | 0x400080); streamProjectileParams.BulletFlags._4_4_ = local_23c; } else if ((byte)(cVar2 - 0x15U) < 3) { streamProjectileParams.CircleAngle = *(float *)((int)&streamAngleSteps + (int)local_250 * 4) * (float)npc->_stateFrame; if ((cVar2 == '\x16') || (cVar2 == '\x17')) { streamProjectileParams.BulletFlags._0_4_ = pEVar25; fVar28 = cos(((float)npc->_stateFrame * 6.2831855) / (float)(int)local_258.y); streamProjectileParams.CircleAngle = fVar28 * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); if (((uint)local_250 & 1) == 0) { streamProjectileParams.CircleAngle = 3.1415927 / (float)(int)local_26c.y + streamProjectileParams.CircleAngle; } } streamProjectileParams.FallingAccelModifier = -0.085; pEVar24 = local_23c; pEVar25 = (Entity_Player *)((uint)pEVar13 | 0x800080); streamProjectileParams.BulletFlags._0_4_ = (Entity_Player *)((uint)pEVar13 | 0x800080); streamProjectileParams.BulletFlags._4_4_ = local_23c; } else { if (cVar2 == '\x18') { streamProjectileParams.BulletFlags._0_4_ = pEVar25; fVar28 = cos(((float)npc->_stateFrame * 6.2831855) / (float)(int)local_258.y); streamProjectileParams.FallingAccelModifier = -0.085; streamProjectileParams.CircleAngle = fVar28 * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); goto LAB_004cae53; } streamProjectileParams.BulletFlags._0_4_ = pEVar25; if ((byte)(cVar2 - 0x19U) < 3) { if (cVar2 == '\x19') { fVar28 = cos(((float)npc->_stateFrame * 6.2831855) / (float)(int)local_258.y); streamProjectileParams.CircleAngle = fVar28 * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); if (local_250 == (code *)0x1) goto LAB_004cae53; cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); } pEVar25 = (Entity_Player *)((uint)pEVar13 | 0x200080); pEVar24 = local_23c; streamProjectileParams.BulletFlags._0_4_ = pEVar25; streamProjectileParams.BulletFlags._4_4_ = local_23c; if (cVar2 == '\x1b') { pEVar25 = (Entity_Player *)((uint)local_244 | 0x600000); streamProjectileParams.BulletFlags._4_4_ = (Entity_Player *)local_264.y; pEVar24 = (Entity_Player *)local_264.y; streamProjectileParams.BulletFlags._0_4_ = pEVar25; } } } goto LAB_004cae59; } streamProjectileParams.CircleAngle = (float)(npc->_stateFrame - npc->_stateFrame % (int)local_27c.y) * *(float *)((int)&streamAngleSteps + (int)local_250 * 4); streamProjectileParams.BulletFlags._0_4_ = pEVar25; } LAB_004cae53: pEVar24 = local_23c; } LAB_004cae59: if (((uint)pEVar25 & 0x10000) != 0) { streamProjectileParams.Color._colorize[0] = 1.0; streamProjectileParams.Color._colorize[1] = 0.4; streamProjectileParams.Color._colorize[2] = 0.0; streamProjectileParams.Color._colorize[3] = 1.0; } if (((uint)pEVar25 & 0x400000) != 0) { streamProjectileParams.Color._colorize[0] = 2.0; streamProjectileParams.Color._colorize[1] = 2.0; streamProjectileParams.Color._colorize[2] = 2.0; streamProjectileParams.Color._colorize[3] = 1.0; } if (((uint)pEVar25 & 0x200000) != 0) { streamProjectileParams.Color._colorize[0] = 0.6; streamProjectileParams.Color._colorize[1] = 0.6; streamProjectileParams.Color._colorize[2] = 0.6; streamProjectileParams.Color._colorize[3] = 1.0; } if (((uint)pEVar25 & 0x800000) != 0) { streamProjectileParams.Color._colorize[0] = 2.0; streamProjectileParams.Color._colorize[1] = 2.0; streamProjectileParams.Color._colorize[2] = 2.0; streamProjectileParams.Color._colorize[3] = 1.0; } if ((((uint)pEVar25 & 0x40000) != 0) || (((uint)pEVar25 & 0x80000) != 0)) { fVar28 = streamProjectileParams.CurvingStrength; if (((uint)pEVar25 & 0x80000) != 0) { fVar28 = streamProjectileParams.CurvingStrength * -1.0; } streamProjectileParams.Color._colorize[0] = 0.6; streamProjectileParams.Color._colorize[1] = 0.6; streamProjectileParams.Color._colorize[2] = 0.6; fVar28 = (fVar28 - -0.002) / 0.004; if (fVar28 <= 0.0) { fVar28 = 0.0; } if (1.0 <= fVar28) { fVar28 = 1.0; } streamProjectileParams.Color._colorize[3] = fVar28 + 0.0; } cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); if (((npc->_type == 0x113) && (pEVar25 == (Entity_Player *)0x80)) && (pEVar24 == (Entity_Player *)0x0)) { if ((cVar2 != '\x19') && (cVar2 != '\x03')) { if (cVar2 == '\x02') goto LAB_004caf6d; goto LAB_004caf75; } LAB_004cb343: iVar7 = streamProjectileParams.Variant; } else { LAB_004caf6d: if (cVar2 != '\x11') goto LAB_004cb343; LAB_004caf75: streamProjectileParams.Variant = 2; streamProjectileParams.Color._colorize[0] = 1.0; fVar28 = sin((float)npc->_stateFrame * 0.1); streamProjectileParams.Color._colorize[2] = 0.0; streamProjectileParams.Color._colorize[3] = 0.8; streamProjectileParams.Color._colorize[1] = fVar28 * 0.75 + 0.5; iVar7 = 2; } shotPos.y = 0.0; if (npc->_type == 0x113) { shotPos.y = 12.0; if (iVar7 == 2) { shotPos.y = 24.0; } shotPos.y = shotPos.y * 1.5384616; } shotPos.y = shotPos.y + (npc->_pos).y; circleShotArgs.x = local_284.y; circleShotArgs.y = (float)(int)local_26c.y; shotPos.x = (npc->_pos).x + 0.0; Entity_NPC::FireProjectiles(npc,&shotPos,&circleShotArgs,9,&streamProjectileParams); pEVar13 = (Entity_Player *)npc->_stateFrame; fVar28 = local_27c.y; } local_250 = local_250 + 1; } while ((int)local_250 < (int)local_274.y); if ((int)local_24c < (int)pEVar13) { *(undefined1 *)((int)&npc->_i1 + 1) = 100; } if (((npc->_flags & 0x80) != 0) && (npc->_slowingCountdown < 3)) { npc->_slowingCountdown = 3; } npc->_stateFrame = (int)&pEVar13->field_0x1; } } LAB_004cb4df: if (npc->_state == 0xd) { npc->_isInvicible = 1; npc->_entityCollisionClass = 0; if (*(undefined1 *)((int)&npc->_i1 + 1) == '\0') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004cb563: bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d5b0,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pbVar19 = &DAT_00b1d5b0; do { bVar3 = *pbVar8; bVar27 = bVar3 < *pbVar19; if (bVar3 != *pbVar19) { LAB_004cb545: uVar4 = -(uint)bVar27 | 1; goto LAB_004cb54a; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < pbVar19[1]; if (bVar3 != pbVar19[1]) goto LAB_004cb545; pbVar8 = pbVar8 + 2; pbVar19 = pbVar19 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cb54a: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cb563; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined1 *)((int)&npc->_i1 + 1) = 1; } } if (((byte)(*(undefined1 *)((int)&npc->_i1 + 1) - 1) < 9) && (ANM2::Play(&npc->_sprite,(byte *)"Hiding",0), local_25c == (undefined4 *)0x0)) { fVar28 = (float)(extraout_ECX & 0xffffff00); pcVar20 = (code *)(extraout_EDX & 0xffffff00); local_24c = (Entity_Player *)0x0; local_274.y = fVar28; local_258.y = (float)pcVar20; do { local_245 = (byte)npc->_i1; local_250 = (code *)0x0; if (local_245 == 0) { local_23d = *(undefined1 *)((int)&npc->_i1 + 1); if (local_23d == 1) { local_264.y = 0.0; local_23c = (Entity_Player *)0x2; uVar4 = 0x3f; if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } if (local_24c == (Entity_Player *)0x1) { uVar4 = 0x40; fVar28 = 1.4013e-45; LAB_004cb790: local_274.y = fVar28; } } else { if (local_23d != 2) { if (local_23d < 3) goto LAB_004cb6ab; pcVar20 = (code *)0x1; local_258.y = 1.4013e-45; goto LAB_004cbacb; } local_264.y = 0.0; local_23c = (Entity_Player *)0x2; uVar4 = 0x41; if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } if (local_24c == (Entity_Player *)0x1) { uVar4 = 0x42; LAB_004cb78e: fVar28 = (float)CONCAT31((int3)((uint)fVar28 >> 8),1); goto LAB_004cb790; } } LAB_004cb796: if (uVar4 != 0) { LAB_004cb856: local_26c.y = 0.0; local_26c.x = 0.0; local_264.y = *(float *)((int)g_game->_room + 0x1c) - 60.0; local_25c = (undefined4 *)(*(float *)((int)g_game->_room + 0x14) + 60.0); puVar14 = (undefined1 *)((int)&local_23c[-1]._replacedPlayer + 3); if ((int)puVar14 < 1) { puVar14 = (undefined1 *)0x1; } local_244 = (Entity_Player *)(float)(int)puVar14; if ((float)local_244 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar28 = ((float)(int)local_24c - 0.0) / ((float)local_244 - 0.0); if (fVar28 <= 0.0) { fVar28 = 0.0; } if (1.0 <= fVar28) { fVar28 = 1.0; } local_26c.x = (local_264.y - (float)local_25c) * fVar28 + (float)local_25c; local_26c.y = *(float *)((int)g_game->_room + 0x20) - 60.0; pVVar15 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_284,&local_26c,0.0,0,0,0); local_26c.x = pVVar15->x; local_26c.y = pVVar15->y; local_264.y = (float)Game::GetNearestPlayer(g_game,&local_26c); entityConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,uVar4,(int)local_250,0) ; fVar28 = (entityConfig->collisionRadiusMulti).y; pVVar15 = &entityConfig->collisionRadiusMulti; if ((entityConfig->collisionRadiusMulti).x <= fVar28 && fVar28 != (entityConfig->collisionRadiusMulti).x) { pVVar15 = (Vector *)&(entityConfig->collisionRadiusMulti).y; } fVar28 = local_26c.x - ((Vector *)((int)local_264.y + 0x33c))->x; fVar31 = local_26c.y - ((Vector *)((int)local_264.y + 0x33c))->y; fVar30 = pVVar15->x * entityConfig->collisionRadius + *(float *)((int)local_264.y + 0x370) + 40.0; if (fVar31 * fVar31 + fVar28 * fVar28 < fVar30 * fVar30) { local_27c.x = ((Vector *)((int)local_264.y + 0x33c))->x; local_27c.y = ((Vector *)((int)local_264.y + 0x33c))->y; pVVar15 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_298,&local_27c,fVar30,0,0,0); local_26c.x = pVVar15->x; local_26c.y = pVVar15->y; } uVar10 = Random(); pEVar11 = Game::Spawn(g_game,uVar4,(uint)local_250,&local_26c,&g_vectorZero, (Entity *)npc,0,uVar10); if (pEVar11 != (Entity *)0x0) { (**(code **)(*(int *)pEVar11 + 0xc))(); } fVar28 = local_274.y; pcVar20 = (code *)local_258.y; } } else { LAB_004cb6ab: local_23d = (byte)pcVar20; if (local_245 == 1) { local_23d = *(undefined1 *)((int)&npc->_i1 + 1); if (local_23d == 1) { fVar28 = (float)((uint)fVar28 & 0xff); local_23c = (Entity_Player *)0x1; if (local_24c == (Entity_Player *)0x0) { fVar28 = 1.4013e-45; } uVar4 = 0x33; local_250 = (code *)(uint)(local_24c == (Entity_Player *)0x0); if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } local_274.y = fVar28; goto LAB_004cb796; } if (local_23d == 2) { local_23c = (Entity_Player *)0x2; if (local_24c == (Entity_Player *)0x0) { uVar4 = 0x2f; goto LAB_004cb84c; } if (local_24c == (Entity_Player *)0x1) { uVar4 = 0x30; LAB_004cb784: local_250 = (code *)0x1; goto LAB_004cb78e; } } else { if (local_23d == 3) { local_23c = (Entity_Player *)&DAT_00000004; if (local_24c == (Entity_Player *)0x0) { uVar4 = 0x32; } else if (local_24c == (Entity_Player *)0x1) { uVar4 = 0x2e; } else { if (local_24c != (Entity_Player *)0x2) { if (local_24c == (Entity_Player *)0x3) { uVar4 = 0x31; goto LAB_004cb784; } goto LAB_004cbacb; } uVar4 = 0x34; } LAB_004cb84c: local_250 = (code *)0x1; goto LAB_004cb856; } if (3 < local_23d) { pcVar20 = (code *)CONCAT31((int3)((uint)pcVar20 >> 8),1); local_258.y = (float)pcVar20; } } } else { local_258.y = (float)pcVar20; if (local_245 == 2) { local_245 = *(undefined1 *)((int)&npc->_i1 + 1); if (local_245 == 1) { local_23c = (Entity_Player *)0x1; if (local_24c == (Entity_Player *)0x0) { uVar4 = 0x10f; LAB_004cb838: local_23c = (Entity_Player *)0x1; uVar16 = (undefined3)((uint)local_24c >> 8); local_274.y = (float)CONCAT31(uVar16,1); local_258.y = (float)CONCAT31(uVar16,local_23d); goto LAB_004cb84c; } } else if (local_245 == 2) { local_23c = (Entity_Player *)0x1; if (local_24c == (Entity_Player *)0x0) { uVar4 = 0x110; goto LAB_004cb838; } } else { pcVar20 = (code *)((uint)pcVar20 & 0xff); if (2 < local_245) { pcVar20 = (code *)0x1; } local_258.y = (float)pcVar20; } } } } LAB_004cbacb: local_24c = (Entity_Player *)((int)local_24c + 1); } while ((SUB41(fVar28,0) == '\0') && ((char)pcVar20 == '\0')); puVar14 = (undefined1 *)((int)&npc->_i1 + 1); *puVar14 = *puVar14 + '\x01'; if ((char)pcVar20 != '\0') { *(undefined1 *)((int)&npc->_i1 + 1) = 10; if ((int *)local_290.y != (int *)0x0) { *(int *)((int)local_290.y + 0x410) = 2; } if (local_288 != (int *)0x0) { local_288[0x104] = 2; } } } if (*(undefined1 *)((int)&npc->_i1 + 1) == '\n') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004cbb9a: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Reveal",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Reveal"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cbb7c: uVar4 = -(uint)bVar27 | 1; goto LAB_004cbb81; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cbb7c; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cbb81: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cbb9a; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(char *)&npc->_i1 = (char)npc->_i1 + '\x01'; npc->_isInvicible = 0; npc->_entityCollisionClass = 4; } } } iVar7 = npc->_state; if (iVar7 == 0xe) { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004cbc4e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Summon",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "Summon"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cbc30: uVar4 = -(uint)bVar27 | 1; goto LAB_004cbc35; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cbc30; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cbc35: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cbc4e; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Summon"); if (bVar3 != 0) { local_23c = (Entity_Player *)((uint)extraout_var << 8); Entity_NPC::PlaySound(npc,0xf3,1.0,0x78,0,1.0); uVar4 = Random(); pEVar24 = (Entity_Player *)(uVar4 % 5); local_24c = (Entity_Player *)0x0; pEVar13 = local_23c; local_244 = pEVar24; do { local_25c = (undefined4 *)0x0; if (pEVar24 == (Entity_Player *)0x0) { iVar7 = 1; pEVar13 = (Entity_Player *)((uint)pEVar13 & 0xff); if (local_24c == (Entity_Player *)0x0) { pEVar13 = (Entity_Player *)0x1; } uVar4 = 0x2f; if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } local_23c = pEVar13; LAB_004cbd19: local_264.y = 0.0; if (uVar4 != 0) goto LAB_004cbddb; LAB_004cc06e: pEVar24 = local_244; } else { if (pEVar24 == (Entity_Player *)0x1) { iVar7 = 2; uVar4 = 0x2e; if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } if (local_24c != (Entity_Player *)0x1) goto LAB_004cbd19; uVar4 = 0x34; local_23c = (Entity_Player *)CONCAT31(local_23c._1_3_,1); LAB_004cbddb: local_290.y = 0.0; local_290.x = 0.0; iVar7 = iVar7 + -1; local_264.y = *(float *)((int)g_game->_room + 0x1c) - 60.0; local_288 = (int *)(*(float *)((int)g_game->_room + 0x14) + 60.0); if (iVar7 < 1) { iVar7 = 1; } local_250 = (code *)(float)iVar7; if ((float)local_250 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar28 = ((float)(int)local_24c - 0.0) / ((float)local_250 - 0.0); auVar29 = ZEXT416((uint)fVar28); if (fVar28 <= 0.0) { auVar29 = ZEXT816(0); } if (1.0 <= auVar29._0_4_) { auVar29._0_4_ = 0x3f800000; } local_290.x = (local_264.y - (float)local_288) * auVar29._0_4_ + (float)local_288; local_288 = (int *)0x4; local_290.y = *(float *)((int)g_game->_room + 0x20) - 60.0; if (uVar4 != 0x13) { local_288 = (int *)0x1; } do { pVVar15 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_298,&local_290,0.0,0,0,0); local_290.x = pVVar15->x; local_290.y = pVVar15->y; if (uVar4 != 0x13) { local_264.y = (float)Game::GetNearestPlayer(g_game,&local_290); entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,uVar4,(int)local_25c,0); fVar28 = (entityConfig->collisionRadiusMulti).y; pVVar15 = &entityConfig->collisionRadiusMulti; if ((entityConfig->collisionRadiusMulti).x <= fVar28 && fVar28 != (entityConfig->collisionRadiusMulti).x) { pVVar15 = (Vector *)&(entityConfig->collisionRadiusMulti).y; } fVar28 = local_290.x - ((Vector *)((int)local_264.y + 0x33c))->x; fVar31 = local_290.y - ((Vector *)((int)local_264.y + 0x33c))->y; fVar30 = pVVar15->x * entityConfig->collisionRadius + *(float *)((int)local_264.y + 0x370) + 40.0; if (fVar31 * fVar31 + fVar28 * fVar28 < fVar30 * fVar30) { local_258.x = ((Vector *)((int)local_264.y + 0x33c))->x; local_258.y = ((Vector *)((int)local_264.y + 0x33c))->y; pVVar15 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_274,&local_258,fVar30,0,0,0); local_290.x = pVVar15->x; local_290.y = pVVar15->y; } } uVar10 = Random(); Game::Spawn(g_game,uVar4,(uint)local_25c,&local_290,&g_vectorZero,(Entity *)npc,0, uVar10); local_288 = (int *)((int)local_288 + -1); } while (local_288 != (int *)0x0); local_288 = (int *)0x0; pEVar13 = local_23c; goto LAB_004cc06e; } if (pEVar24 == (Entity_Player *)0x2) { uVar4 = 0x31; if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } iVar7 = 2; if (local_24c != (Entity_Player *)0x1) goto LAB_004cbd19; uVar4 = 0x33; iVar7 = 2; local_23c = local_24c; goto LAB_004cbddb; } if (pEVar24 == (Entity_Player *)0x3) { iVar7 = 2; uVar4 = 0x32; if (local_24c != (Entity_Player *)0x0) { uVar4 = 0; } if (local_24c != (Entity_Player *)0x1) goto LAB_004cbd19; uVar4 = 0x30; local_23c = local_24c; goto LAB_004cbddb; } if (pEVar24 == (Entity_Player *)&DAT_00000004) { iVar7 = 1; if (local_24c == (Entity_Player *)0x0) { uVar4 = 0x13; local_25c = (undefined4 *)0x1; local_23c = (Entity_Player *)0x1; goto LAB_004cbddb; } goto LAB_004cc06e; } } local_24c = (Entity_Player *)&local_24c->field_0x1; } while ((char)pEVar13 == '\0'); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { iVar7 = npc->_state; goto LAB_004cc0a0; } } } else { LAB_004cc0a0: if (iVar7 != 7) { LAB_004cc2f4: if (iVar7 != 0x10) goto LAB_004cc7d5; pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 == (byte *)0x0) { LAB_004cc367: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Death",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "Death"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc34c: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc351; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc34c; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc351: if ((uVar4 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cc367; } if ((npc->_sprite)._animState._animData == (void *)0x0) { iVar7 = -1; } else { dVar32 = floor((double)(npc->_sprite)._animState._animFrame); iVar7 = (int)dVar32; } local_264.x = 320.0; local_264.y = 210.0; local_23c = (Entity_Player *)(((float)iVar7 - 0.0) / 15.0); if ((float)local_23c <= 0.0) { local_23c = (Entity_Player *)0x0; } if (1.0 <= (float)local_23c) { local_23c = (Entity_Player *)0x3f800000; } Entity_NPC::PlaySound(npc,0xef,1.0,100,0,0.5); Game::ShakeScreen(g_game,5); iVar7 = *(int *)((int)g_game->_room + 0x11f8); iVar6 = extraout_ECX_00; if (*(char *)(iVar7 + 0x8c) == '\0') { ring_buffer_push((void *)(iVar7 + 0x50),&local_264); *(undefined1 *)(iVar7 + 0x8c) = 1; iVar6 = extraout_ECX_01; } local_25c = (undefined4 *)0x0; local_244 = g_game->_room; if (local_244->_playerCostumeMap[3]._priority != 0) { do { puVar26 = local_25c; bVar3 = Entity::is_valid_boss_enemy (*(Entity **) (local_244->_playerCostumeMap[3]._index + (int)local_25c * 4),iVar6); iVar6 = extraout_ECX_02; if (bVar3 != 0) { local_264.y = *(float *)(local_244->_playerCostumeMap[3]._index + (int)puVar26 * 4); iVar6 = ((Entity_Player *)local_264.y)->_type; if ((iVar6 != 0x112) && (iVar6 != 0x113)) { pcVar20 = *(code **)(*(int *)local_264.y + 0x24); EntityRef::constructor(&killSource,(Entity *)npc); (*pcVar20)(); iVar6 = extraout_ECX_03; puVar26 = local_25c; } } local_25c = (undefined4 *)((int)puVar26 + 1); } while (local_25c < (uint)local_244->_playerCostumeMap[3]._priority); } fVar28 = (npc->_targetPosition).y; fVar30 = (3.0 - ((float)local_23c + (float)local_23c)) * (float)local_23c * (float)local_23c; fVar31 = (npc->_targetPosition).x; (npc->_pos).x = (320.0 - fVar31) * fVar30 + fVar31; (npc->_pos).y = (210.0 - fVar28) * fVar30 + fVar28; fVar28 = (npc->_targetPosition).y; fVar31 = (float)local_23c * -6.0 * ((float)local_23c - 1.0); (npc->_velocity).x = ((320.0 - (npc->_targetPosition).x) / 15.0) * fVar31; (npc->_velocity).y = ((210.0 - fVar28) / 15.0) * fVar31; iVar7 = npc->_type; if (iVar7 == 0x112) { uVar33 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_isInvicible = 1; npc->_entityCollisionClass = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar33; Entity::RemoveStatusEffects((Entity *)npc); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar23 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "Death"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc633: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc638; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc633; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc638: if (uVar4 == 0) { iVar7 = npc->_variant; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; Entity_NPC::Morph(npc,0x113,iVar7,0,-1); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; npc->_health = npc->_maxHitPoints; uVar33 = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 2; *(undefined4 *)((int)&npc->_flags + 4) = uVar33; local_264.y = (float)(npc->_sprite)._animState._animData; if ((byte *)local_264.y != (byte *)0x0) { pbVar23 = (byte *)local_264.y; if (0xf < *(uint *)((int)local_264.y + 0x14)) { pbVar23 = *(byte **)local_264.y; } pcVar22 = "Appear"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc6e0: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc6e5; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc6e0; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc6e5: if ((uVar4 == 0) && ((*(byte *)((int)local_264.y + 0x34) == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004cc71c; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004cc71c: Entity_NPC::PlaySound(npc,0xf1,1.0,2,0,0.8); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_bitflags = layer->_bitflags | 1; ExceptionList = local_1c; return; } } iVar7 = npc->_type; } if (iVar7 == 0x113) { uVar33 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_isInvicible = 1; npc->_entityCollisionClass = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar33; Entity::RemoveStatusEffects((Entity *)npc); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar23 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar23 = *(byte **)pbVar23; } pcVar22 = "Death"; do { bVar3 = *pbVar23; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc7c5: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc7ca; } if (bVar3 == 0) break; bVar3 = pbVar23[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc7c5; pbVar23 = pbVar23 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc7ca: if (uVar4 == 0) { Entity_NPC::trigger_kill_item_effects(npc); } } } goto LAB_004cc7d5; } if (*(undefined1 *)((int)&npc->_i1 + 1) == '\x01') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 != (byte *)0x0) { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "SmashHead"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc0e8: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc0ed; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc0e8; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc0ed: if ((uVar4 == 0) && ((pbVar23[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004cc124; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SmashHead",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004cc124: if (*(undefined1 *)((int)&npc->_i1 + 1) == '\x03') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 != (byte *)0x0) { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "SmashHead3"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc163: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc168; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc163; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc168: if ((uVar4 == 0) && ((pbVar23[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004cc19f; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SmashHead3",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004cc19f: if (*(undefined1 *)((int)&npc->_i1 + 1) == '\x05') { pbVar23 = (npc->_sprite)._animState._animData; if (pbVar23 != (byte *)0x0) { pbVar8 = pbVar23; if (0xf < *(uint *)(pbVar23 + 0x14)) { pbVar8 = *(byte **)pbVar23; } pcVar22 = "SmashHead5"; do { bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004cc1e0: uVar4 = -(uint)bVar27 | 1; goto LAB_004cc1e5; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004cc1e0; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cc1e5: if ((uVar4 == 0) && ((pbVar23[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004cc21c; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SmashHead5",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004cc21c: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Smash"); if (bVar3 != 0) { Game::ShakeScreen(g_game,0xc); Entity_NPC::PlaySound(npc,0x34,0.4,2,0,1.0); ProjectileParams::ProjectileParams(&smashProjectileParams); smashProjectileParams.BulletFlags._0_4_ = (uint)smashProjectileParams.BulletFlags | 0x80; iVar7 = 0x19; cVar2 = *(undefined1 *)((int)&npc->_i1 + 1); smashProjectileParams.HeightModifier = 10.0; smashProjectileParams.Scale = 1.5; if (cVar2 != '\x03') { iVar7 = 0x32; } smashProjectileParams.VelocityMulti = 1.2; if (cVar2 == '\x05') { iVar7 = 0x14; } Entity_NPC::FireBossProjectiles(npc,iVar7,&g_vectorZero,0.0,&smashProjectileParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { iVar7 = npc->_state; goto LAB_004cc2f4; } } } npc->_state = 3; npc->_stateFrame = 0; LAB_004cc7d5: if (g_game->_frameCount % 0x3c == 0) { (npc->_targetPosition).x = 320.0; (npc->_targetPosition).y = 260.0; pEVar11 = Entity_NPC::GetPlayerTarget(npc); (npc->_targetPosition).x = (pEVar11->_pos).x; uVar4 = Random(); fVar28 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 180.0 - 90.0) + (npc->_targetPosition).x; if (fVar28 <= 220.0) { fVar28 = 220.0; } if (420.0 <= fVar28) { fVar28 = 420.0; } (npc->_targetPosition).x = fVar28; } if (npc->_state == 0xd) { (npc->_targetPosition).x = 320.0; (npc->_targetPosition).y = 260.0; } local_264.y = npc->_friction * 0.8; npc->_friction = local_264.y; fVar28 = (npc->_targetPosition).x; if ((((fVar28 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) && (npc->_state != 0x10)) && (npc->_state != 2)) { local_23c = (Entity_Player *)(npc->_targetPosition).y; local_25c = (undefined4 *)(fVar28 - (npc->_pos).x); local_244 = (Entity_Player *)((float)local_23c - (npc->_pos).y); fVar28 = sqrtf((float)local_244 * (float)local_244 + (float)local_25c * (float)local_25c); if (20.0 < fVar28) { if ((1.2 < fVar28) && (0.0 < fVar28)) { local_25c = (undefined4 *)((float)local_25c * (1.2 / fVar28)); local_244 = (Entity_Player *)((float)local_244 * (1.2 / fVar28)); } fVar28 = (npc->_velocity).x; fVar31 = (npc->_velocity).y; (npc->_velocity).x = ((float)local_25c / local_264.y - fVar28) * 0.1 + fVar28; (npc->_velocity).y = ((float)local_244 / local_264.y - fVar31) * 0.1 + fVar31; local_23c = (Entity_Player *)(npc->_targetPosition).y; } (npc->_pos).y = (float)local_23c; } ExceptionList = local_1c; return; while( true ) { bVar3 = pbVar8[1]; bVar27 = bVar3 < (byte)pcVar22[1]; if (bVar3 != pcVar22[1]) goto LAB_004c9040; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; if (bVar3 == 0) break; LAB_004c9020: bVar3 = *pbVar8; bVar27 = bVar3 < (byte)*pcVar22; if (bVar3 != *pcVar22) { LAB_004c9040: uVar4 = -(uint)bVar27 | 1; goto LAB_004c9045; } if (bVar3 == 0) break; } uVar4 = 0; LAB_004c9045: if ((uVar4 != 0) || ((pbVar23[0x34] != 0 && (local_23c->field_0x44 == '\0')))) { LAB_004c9061: bVar3 = ANM2::SetAnimation((ANM2 *)local_23c,(byte *)"Intro",1); pEVar13 = local_23c; if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)&local_23c->_subtype); pEVar13->field_0x44 = 1; } } manager = g_manager; local_244 = (Entity_Player *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_244 = (Entity_Player *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_244 = (Entity_Player *)0x3f000000; } local_23c = (Entity_Player *)0xee; seed_fart_sound_override((int *)&local_23c); SoundEffects::Play(&manager->_sfxManager,(int)local_23c,1.0,2,0,(float)local_244,0.0); MusicManager::Crossfade(&g_manager->_musicManager,0x17,0.08); goto LAB_004c9128; } //@@ 004cca10 NpcAI::ENTITY_MEGA_SATAN_hand /* DB: strs Smash/SmashHand1/Hiding/Reveal */ void __fastcall NpcAI::ENTITY_MEGA_SATAN_hand(Entity_NPC *npc) { Vector *position; void *pvVar1; ANM2 *pAVar2; byte bVar3; EntityList_EL *queryResult; byte *curAnim; uint uVar4; EntityPtr *pEVar5; byte *nameCursor; Entity *pEVar6; int iVar7; char *expectedName; byte *expectedNameB; EntityPtr *pEVar8; bool isLess; float fVar9; float dx; double dVar10; EntityRef sourceRef; EntityList_EL queryList; undefined1 isListOwned; EntityPtr *listData; int listCapacity; int listSize; EntityPtr *local_40; EntityPtr *local_3c; Entity *local_38; float local_34; float *local_30; float nearOffsetX; int *megaSatan; byte nameChar; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; AnimationState *animState; int *body; code *bodyHandDeathFn; undefined4 flagsHigh; Game *game; Manager *manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af371d; local_1c = ExceptionList; ExceptionList = &local_1c; megaSatan = (int *)0x0; local_40 = (EntityPtr *)0x0; isListOwned = 0; listData = (EntityPtr *)0x0; listCapacity = 0; listSize = 0; local_14 = 0; queryResult = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&queryList,0x112,0,-1,0,0); isListOwned = 1; listData = queryResult->_data; listCapacity = queryResult->_capacity; iVar7 = queryResult->_size; listSize = iVar7; local_3c = listData; if (queryList._0_1_ == '\0') { local_14._0_1_ = 1; tracked_alloc(1,queryList._data,0); local_14 = (uint)local_14._1_3_ << 8; } if (iVar7 != 0) { megaSatan = (int *)__RTDynamicCast(); } queryResult = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&queryList,0x112, 3 - npc->_variant,-1,0,0); isListOwned = 1; listData = queryResult->_data; listCapacity = queryResult->_capacity; iVar7 = queryResult->_size; listSize = iVar7; local_3c = listData; if (queryList._0_1_ == '\0') { local_14._0_1_ = 2; tracked_alloc(1,queryList._data,0); local_14 = (uint)local_14._1_3_ << 8; } if (iVar7 != 0) { local_40 = (EntityPtr *)__RTDynamicCast(); } manager = g_manager; local_14 = 0xffffffff; if ((npc->_dead != 0) && (npc->_stateFrame != -0x3039)) { local_30 = (float *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_30 = (float *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_30 = (float *)0x3f000000; } local_3c = (EntityPtr *)0xf2; seed_fart_sound_override((int *)&local_3c); SoundEffects::Play(&manager->_sfxManager,(int)local_3c,1.0,2,0,(float)local_30,0.0); if (megaSatan != (int *)0x0) { bodyHandDeathFn = *(code **)(*megaSatan + 0x20); EntityRef::constructor(&sourceRef,(Entity *)npc); (*bodyHandDeathFn)(); } npc->_stateFrame = -0x3039; } body = megaSatan; pEVar5 = (EntityPtr *)npc->_state; if (pEVar5 == (EntityPtr *)0x0) { *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_renderZOffset = -0x4b0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_entityGridCollisionClass = 3; if (npc->_variant == 2) { (npc->_sprite)._flipX = 1; } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; npc->_visible = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_state = 2; pEVar8 = (EntityPtr *)0x2; LAB_004ccce6: npc->_isInvicible = 1; npc->_entityCollisionClass = 0; pEVar5 = pEVar8; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { curAnim = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } expectedName = "Appear"; do { nameChar = *curAnim; isLess = nameChar < (byte)*expectedName; if (nameChar != *expectedName) { LAB_004ccd50: uVar4 = -(uint)isLess | 1; goto LAB_004ccd55; } if (nameChar == 0) break; nameChar = curAnim[1]; isLess = nameChar < (byte)expectedName[1]; if (nameChar != expectedName[1]) goto LAB_004ccd50; curAnim = curAnim + 2; expectedName = expectedName + 2; } while (nameChar != 0); uVar4 = 0; LAB_004ccd55: if (uVar4 == 0) { npc->_state = 3; pEVar5 = (EntityPtr *)0x3; npc->_isInvicible = 0; npc->_entityCollisionClass = 4; } } local_3c = pEVar8; if (megaSatan != (int *)0x0) { if ((megaSatan[0x2d9] == 1) || (*(char *)((int)megaSatan + 0x171) == '\0')) goto LAB_004ccdb0; npc->_visible = 1; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); pEVar5 = (EntityPtr *)npc->_state; goto LAB_004ccdb6; } LAB_004ccdf5: local_30 = &npc->_friction; if (pEVar5 == (EntityPtr *)0x3) { if (body != (int *)0x0) { local_3c = (EntityPtr *)0x0; local_34 = 0.0; local_38 = (Entity *)0x0; nearOffsetX = 0.0; if (npc->_variant == 1) { local_34 = -120.0; nearOffsetX = -35.0; local_38 = (Entity *)0x42f00000; LAB_004cce96: local_3c = (EntityPtr *)0x42c80000; } else if (npc->_variant == 2) { local_34 = 120.0; nearOffsetX = 35.0; local_38 = (Entity *)0x42dc0000; goto LAB_004cce96; } if (local_40 == (EntityPtr *)0x0) { nearOffsetX = 0.0; } pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (((pEVar6->_pos).y - (float)body[0xd0]) - 260.0) / 70.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } (npc->_targetPosition).x = (nearOffsetX - local_34) * fVar9 + local_34; (npc->_targetPosition).y = ((float)local_38 - (float)local_3c) * fVar9 + (float)local_3c; if (body[0x2d9] == 8) { (npc->_targetPosition).x = local_34; (npc->_targetPosition).y = (float)local_3c; } fVar9 = (float)body[0xd0]; (npc->_targetPosition).x = (float)body[0xcf] + (npc->_targetPosition).x; (npc->_targetPosition).y = fVar9 + (npc->_targetPosition).y; } curAnim = (npc->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedNameB = s_Idle; do { bVar3 = *nameCursor; isLess = bVar3 < *expectedNameB; if (bVar3 != *expectedNameB) { LAB_004ccfa0: uVar4 = -(uint)isLess | 1; goto LAB_004ccfa5; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < expectedNameB[1]; if (bVar3 != expectedNameB[1]) goto LAB_004ccfa0; nameCursor = nameCursor + 2; expectedNameB = expectedNameB + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004ccfa5: if ((uVar4 == 0) && ((curAnim[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004ccfdc; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { pEVar8 = pEVar5; if (pEVar5 == (EntityPtr *)0x2) goto LAB_004ccce6; LAB_004ccdb0: if (megaSatan == (int *)0x0) goto LAB_004ccdf5; LAB_004ccdb6: if (((body[0x2d9] != 0xd) || (pEVar5 = (EntityPtr *)npc->_state, pEVar5 == (EntityPtr *)&DAT_0000000d)) || (pEVar5 == (EntityPtr *)0x2)) goto LAB_004ccdf5; local_30 = &npc->_friction; npc->_state = 0xd; npc->_stateFrame = 0; } LAB_004ccfdc: if (npc->_state == 8) { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004cd03e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SmashHand1",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = "SmashHand1"; do { bVar3 = *nameCursor; isLess = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_004cd020: uVar4 = -(uint)isLess | 1; goto LAB_004cd025; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004cd020; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cd025: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cd03e; } if (npc->_stateFrame == 0) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (pEVar6->_pos).y; (npc->_targetPosition).x = (pEVar6->_pos).x; (npc->_targetPosition).y = fVar9; } npc->_entityCollisionClass = 0; animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"Smash"); if (bVar3 != 0) { npc->_entityCollisionClass = 4; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Smash"); game = g_game; if (bVar3 != 0) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_friction = npc->_friction * 0.1; Game::ShakeScreen(game,0xf); uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x3d,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); if (pEVar6->_parent != (EntityPtr)0x0) { local_40 = &pEVar6->_parent; std::multiset::erase(&local_40); } pEVar6->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar6->_parent); local_3c = (EntityPtr *)0x3f800000; *(float *)pEVar6[1]._sprite._filename._buf = npc->_size; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = -0x10; (pAVar2->_filename)._buf[7] = 'B'; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[8] = '\x14'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x14'; manager = g_manager; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; if (npc->_championColorIdx == 0x12) { local_3c = (EntityPtr *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_3c = (EntityPtr *)0x3f000000; } local_40 = (EntityPtr *)0x34; seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,2,0,(float)local_3c,0.0); Game::BombDamage(g_game,&npc->_pos,50.0,npc->_size,0,(Entity *)npc,g_tearFlagsNone,4,0); local_40 = (EntityPtr *)(npc->_pos).x; local_3c = (EntityPtr *)(npc->_pos).y; pvVar1 = g_game->_room; *(int *)((int)pvVar1 + 0x70fc) = *(int *)((int)pvVar1 + 0x70fc) + 1; local_38 = (Entity *)(*(uint *)((int)pvVar1 + 0x70fc) & 0x80000001); if ((int)local_38 < 0) { local_38 = (Entity *)(((int)local_38 - 1U | 0xfffffffe) + 1); } if (1 < local_38) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } iVar7 = (int)local_38 + 0x407; *(EntityPtr **)((int)pvVar1 + iVar7 * 0x1c) = local_40; *(EntityPtr **)((int)pvVar1 + iVar7 * 0x1c + 4) = local_3c; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 8) = 0; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0xc) = 0x3d4ccccd; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0x10) = 0x3ccccccd; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0x14) = 0; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0x18) = 0x19; } } } npc->_stateFrame = npc->_stateFrame + 1; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; if (megaSatan != (int *)0x0) { megaSatan[0x104] = 0; } npc->_stateFrame = 0; } } if (npc->_state == 9) { if (megaSatan == (int *)0x0) { LAB_004cd43b: if (-1 < npc->_stateFrame) { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004cd49e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SmashQuake",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = "SmashQuake"; do { bVar3 = *nameCursor; isLess = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_004cd480: uVar4 = -(uint)isLess | 1; goto LAB_004cd485; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004cd480; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cd485: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cd49e; } if ((((npc->_sprite)._animState._animData == (void *)0x0) || (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Smash"), bVar3 == 0)) && (-1 < npc->_stateFrame)) { npc->_entityCollisionClass = 0; } else { npc->_entityCollisionClass = 4; } } } else { iVar7 = npc->_variant; if (iVar7 == 1) { (npc->_targetPosition).x = -120.0; (npc->_targetPosition).y = 100.0; iVar7 = npc->_variant; } if (iVar7 == 2) { (npc->_targetPosition).x = 120.0; (npc->_targetPosition).y = 100.0; } fVar9 = (float)megaSatan[0xd0]; (npc->_targetPosition).x = (float)megaSatan[0xcf] + (npc->_targetPosition).x; (npc->_targetPosition).y = fVar9 + (npc->_targetPosition).y; pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (pEVar6->_pos).y - (npc->_targetPosition).y; dx = (pEVar6->_pos).x - (npc->_targetPosition).x; fVar9 = sqrtf(fVar9 * fVar9 + dx * dx); if ((150.0 <= fVar9) || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Smash"), bVar3 != 0)))) goto LAB_004cd43b; if (-1 < npc->_stateFrame) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (pEVar6->_pos).y; (npc->_targetPosition).x = (pEVar6->_pos).x; (npc->_targetPosition).y = fVar9; goto LAB_004cd43b; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Smash"); game = g_game; if (bVar3 != 0) { position = &npc->_pos; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_friction = npc->_friction * 0.1; Game::ShakeScreen(game,10); uVar4 = Random(); local_38 = Game::Spawn(g_game,1000,0x43,position,&g_vectorZero,(Entity *)npc,0,uVar4); local_3c = &local_38->_parent; if (local_38->_parent != (EntityPtr)0x0) { local_40 = local_3c; std::multiset::erase(&local_40); } *local_3c = (EntityPtr)npc; std::multiset::insert(local_3c); fVar9 = 1.0; bVar3 = 0; iVar7 = 2; *(float *)local_38[1]._sprite._filename._buf = npc->_size; pAVar2 = &local_38[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = -0x60; (pAVar2->_filename)._buf[7] = 'C'; pAVar2 = &local_38[1]._sprite; (pAVar2->_filename)._buf[8] = '2'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &local_38[1]._sprite; (pAVar2->_filename)._buf[0xc] = '2'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; uVar4 = Random(); Entity_NPC::PlaySound (npc,0x34,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.5,iVar7,bVar3,fVar9); Game::BombDamage(g_game,position,50.0,npc->_size,0,(Entity *)npc,g_tearFlagsNone,4,0); local_40 = (EntityPtr *)position->x; local_3c = (EntityPtr *)(npc->_pos).y; pvVar1 = g_game->_room; *(int *)((int)pvVar1 + 0x70fc) = *(int *)((int)pvVar1 + 0x70fc) + 1; local_38 = (Entity *)(*(uint *)((int)pvVar1 + 0x70fc) & 0x80000001); if ((int)local_38 < 0) { local_38 = (Entity *)(((int)local_38 - 1U | 0xfffffffe) + 1); } if (1 < local_38) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } iVar7 = (int)local_38 + 0x407; *(EntityPtr **)((int)pvVar1 + iVar7 * 0x1c) = local_40; *(EntityPtr **)((int)pvVar1 + iVar7 * 0x1c + 4) = local_3c; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 8) = 0; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0xc) = 0x3d4ccccd; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0x10) = 0x3ccccccd; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0x14) = 0; *(undefined4 *)((int)pvVar1 + iVar7 * 0x1c + 0x18) = 0x19; } } pvVar1 = (npc->_sprite)._animState._animData; if (pvVar1 == (void *)0x0) { iVar7 = 0; } else { iVar7 = *(int *)((int)pvVar1 + 0x30); } if (iVar7 * 3 + -3 <= npc->_stateFrame) { if (pvVar1 != (void *)0x0) { iVar7 = *(int *)((int)pvVar1 + 0x30); dVar10 = floor((double)(npc->_sprite)._animState._animFrame); local_40 = (EntityPtr *)(float)dVar10; local_30 = &npc->_friction; if ((int)dVar10 != iVar7 + -1) goto LAB_004cd7fc; } local_30 = &npc->_friction; npc->_state = 3; npc->_stateFrame = 0; if (megaSatan != (int *)0x0) { megaSatan[0x104] = 0; } curAnim = (npc->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedNameB = s_Idle; do { bVar3 = *nameCursor; isLess = bVar3 < *expectedNameB; if (bVar3 != *expectedNameB) { LAB_004cd7c0: uVar4 = -(uint)isLess | 1; goto LAB_004cd7c5; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < expectedNameB[1]; if (bVar3 != expectedNameB[1]) goto LAB_004cd7c0; nameCursor = nameCursor + 2; expectedNameB = expectedNameB + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cd7c5: if ((uVar4 == 0) && ((curAnim[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004cd7fc; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004cd7fc: npc->_stateFrame = npc->_stateFrame + 1; } if (npc->_state == 0xd) { npc->_isInvicible = 1; npc->_entityCollisionClass = 0; if (megaSatan != (int *)0x0) { iVar7 = npc->_variant; if (iVar7 == 1) { (npc->_targetPosition).x = -35.0; (npc->_targetPosition).y = 120.0; iVar7 = npc->_variant; } if (iVar7 == 2) { (npc->_targetPosition).x = 35.0; (npc->_targetPosition).y = 110.0; } fVar9 = (float)megaSatan[0xd0]; (npc->_targetPosition).x = (float)megaSatan[0xcf] + (npc->_targetPosition).x; (npc->_targetPosition).y = fVar9 + (npc->_targetPosition).y; } if (npc->_stateFrame == 0) { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004cd8f0: bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d5b0,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedNameB = &DAT_00b1d5b0; do { bVar3 = *nameCursor; isLess = bVar3 < *expectedNameB; if (bVar3 != *expectedNameB) { LAB_004cd8d2: uVar4 = -(uint)isLess | 1; goto LAB_004cd8d7; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < expectedNameB[1]; if (bVar3 != expectedNameB[1]) goto LAB_004cd8d2; nameCursor = nameCursor + 2; expectedNameB = expectedNameB + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cd8d7: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cd8f0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 1; } } if (npc->_stateFrame == 1) { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004cd98e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Hiding",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = "Hiding"; do { bVar3 = *nameCursor; isLess = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_004cd970: uVar4 = -(uint)isLess | 1; goto LAB_004cd975; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004cd970; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cd975: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cd98e; } if ((megaSatan != (int *)0x0) && (megaSatan[0x2d9] != 0xd)) { npc->_stateFrame = 2; } } if (npc->_stateFrame == 2) { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004cda2e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Reveal",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = "Reveal"; do { bVar3 = *nameCursor; isLess = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_004cda10: uVar4 = -(uint)isLess | 1; goto LAB_004cda15; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004cda10; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cda15: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cda2e; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_isInvicible = 0; npc->_entityCollisionClass = 4; } } } if (npc->_state != 0xe) goto LAB_004cdb1f; curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004cdade: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Summon",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = "Summon"; do { bVar3 = *nameCursor; isLess = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_004cdac0: uVar4 = -(uint)isLess | 1; goto LAB_004cdac5; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; isLess = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004cdac0; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004cdac5: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004cdade; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } npc->_entityCollisionClass = 4; LAB_004cdb1f: fVar9 = (npc->_targetPosition).x; if ((fVar9 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { local_3c = (EntityPtr *)((npc->_targetPosition).y - (npc->_pos).y); local_38 = (Entity *)(fVar9 - (npc->_pos).x); local_40 = (EntityPtr *)((float)local_3c * (float)local_3c + (float)local_38 * (float)local_38); fVar9 = sqrtf((float)local_40); fVar9 = (fVar9 - 5.0) / 25.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } local_34 = fVar9 * 0.5 + 0.5; *local_30 = local_34; fVar9 = sqrtf((float)local_40); if ((fVar9 <= 0.5) || (fVar9 <= 0.0)) { pEVar6 = local_38; pEVar5 = local_3c; } else { pEVar6 = (Entity *)((0.5 / fVar9) * (float)local_38); pEVar5 = (EntityPtr *)((float)local_3c * (0.5 / fVar9)); } if (local_34 != 0.0) { fVar9 = npc->_speedMultiplier; (npc->_velocity).x = ((float)pEVar6 * fVar9) / local_34 + (npc->_velocity).x; (npc->_velocity).y = (fVar9 * (float)pEVar5) / local_34 + (npc->_velocity).y; } fVar9 = (npc->_velocity).x; local_40 = (EntityPtr *)(npc->_velocity).y; fVar9 = sqrtf(fVar9 * fVar9 + (float)local_40 * (float)local_40); if ((5.0 < fVar9) && (0.0 < fVar9)) { (npc->_velocity).x = (5.0 / fVar9) * (npc->_velocity).x; (npc->_velocity).y = (float)local_40 * (5.0 / fVar9); } } ExceptionList = local_1c; return; } //@@ 004cdce0 FUN_004cdce0 void FUN_004cdce0(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x36c) = in_XMM1_Da; return; } //@@ 004cdcf0 std::multiset::insert /* DB: wraps tree insert; pairs with multiset::erase in EntityPtr setters */ void std::multiset::insert(undefined1 param_1) { undefined1 local_10 [12]; set::insert_unique(local_10,¶m_1); return; } //@@ 004cdd20 Room::GetBackdropType /* ZHL [lua] Lua binding Room:GetBackdropType */ int __thiscall Room::GetBackdropType(Room *this) { return this->_backdropType; } //@@ 004cdd30 FUN_004cdd30 uint FUN_004cdd30(uint param_1,int param_2) { int iVar1; int iVar2; int in_ECX; if ((0x1bf < param_1) || (0x3b6 < param_2)) { return param_1 & 0xffffff00; } iVar1 = in_ECX + param_1 * 4; iVar2 = *(int *)(iVar1 + 0x76c); if (iVar2 % 1000 < param_2) { *(int *)(iVar1 + 0x76c) = (iVar2 - iVar2 % 1000) + param_2; } return CONCAT31((int3)((uint)(iVar2 / 1000) >> 8),1); } //@@ 004cdd80 Room::RaiseGridPathAtPos /* DB: ? pos->grid idx (40px grid, y-120), raises room+0x76c[idx]%1000 path value, max 0x3b7 prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::RaiseGridPathAtPos(Room *this,Vector *pos,int pathValue) { uint uVar1; int iVar2; int iVar3; iVar3 = (int)((pos->x - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar2 = (int)((pos->y - 120.0) / 40.0 + 0.5), iVar2 < 0)) || (((this->_gridHeight <= iVar2 || (uVar1 = this->_gridWidth * iVar2 + iVar3, 0x1bf < uVar1)) || (0x3b6 < pathValue)))) { return 0; } iVar3 = this->_gridPaths[uVar1] % 1000; if (iVar3 < pathValue) { this->_gridPaths[uVar1] = (this->_gridPaths[uVar1] - iVar3) + pathValue; } return 1; } //@@ 004cde30 Entity_NPC::update_physics /* DB: ? called from Entity_NPC::Update: copies +0x3f0..+0x3f8 from child (+0x3c0) else apply_velocity 004ce120(0) + 004ce6d0, then Entity::Update and syncs child position/velocity */ void __thiscall Entity_NPC::update_physics(Entity_NPC *this) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; EntityPtr EVar6; int *piVar7; void *pvVar8; int iVar9; Game *pGVar10; int iVar11; uint uVar12; PlayerManager *pPVar13; EVar6 = this->_child; if (EVar6 == (EntityPtr)0x0) { this->_holdCountdown = 0; } else { this->_holdCountdown = *(int *)((int)EVar6 + 0x3f0); (this->_holdPosition).x = *(float *)((int)EVar6 + 0x3f4); (this->_holdPosition).y = *(float *)((int)EVar6 + 0x3f8); if (0 < this->_holdCountdown) goto LAB_004cde91; } apply_velocity(this,0); update_move_direction_anim(this); LAB_004cde91: EVar6 = this->_child; if (EVar6 != (EntityPtr)0x0) { *(float *)((int)EVar6 + 0x33c) = (this->_pos).x; *(float *)((int)EVar6 + 0x340) = (this->_pos).y; EVar6 = this->_child; *(float *)((int)EVar6 + 0x360) = (this->_velocity).x; *(float *)((int)EVar6 + 0x364) = (this->_velocity).y; *(float *)((int)this->_child + 0x36c) = this->_friction; } if (this->_variant == 10) { uVar12 = 0; pPVar13 = &g_game->_playerManager; pGVar10 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar13->_playerList)._begin >> 2 != 0) { do { pvVar8 = (pPVar13->_playerList)._end; if ((int)pvVar8 - (int)(pPVar13->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar8 = (pPVar13->_playerList)._end; pGVar10 = g_game; } piVar7 = (pPVar13->_playerList)._begin; if (uVar12 < (uint)((int)pvVar8 - (int)piVar7 >> 2)) { piVar7 = piVar7 + uVar12; } iVar11 = *piVar7; if (*(Entity_NPC **)(iVar11 + 0x3d4) == this) { fVar1 = (this->_pos).y; *(float *)(iVar11 + 0x33c) = *(float *)(iVar11 + 0x2088) + (this->_pos).x; *(float *)(iVar11 + 0x340) = *(float *)(iVar11 + 0x208c) + fVar1; *(float *)(iVar11 + 0x360) = (this->_velocity).x; *(float *)(iVar11 + 0x364) = (this->_velocity).y; *(float *)(iVar11 + 0x36c) = this->_friction; } pPVar13 = &pGVar10->_playerManager; uVar12 = uVar12 + 1; } while (uVar12 < (uint)((int)(pGVar10->_playerManager)._playerList._end - (int)(pPVar13->_playerList)._begin >> 2)); } pvVar8 = pGVar10->_room; iVar11 = (int)(((this->_pos).x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar11) && (iVar11 < *(int *)((int)pvVar8 + 0xc))) && (iVar9 = (int)(((this->_pos).y - 120.0) / 40.0 + 0.5), -1 < iVar9)) && ((iVar9 < *(int *)((int)pvVar8 + 0x10) && (uVar12 = *(int *)((int)pvVar8 + 0xc) * iVar9 + iVar11, uVar12 < 0x1c0)))) { iVar11 = *(int *)((int)pvVar8 + uVar12 * 4 + 0x76c); iVar9 = iVar11 % 1000; if (iVar9 < 900) { *(int *)((int)pvVar8 + uVar12 * 4 + 0x76c) = (iVar11 - iVar9) + 900; } } } fVar1 = (this->_pos).x; fVar2 = (this->_pos).y; fVar3 = (this->_velocity).x; fVar4 = (this->_velocity).y; fVar5 = this->_friction; Entity::Update((Entity *)this); (this->_pos).x = fVar1; (this->_pos).y = fVar2; (this->_velocity).x = fVar3; (this->_velocity).y = fVar4; this->_friction = fVar5; return; } //@@ 004ce0f0 FUN_004ce0f0 uint FUN_004ce0f0(void) { byte bVar1; uint in_ECX; if (0x1bf < in_ECX) { return 0xffffffff; } bVar1 = *(byte *)((int)g_game->_room + in_ECX + 0x746c); if (bVar1 == 0xff) { return 0xffffffff; } return bVar1 & 0xf; } //@@ 004ce120 Entity_NPC::apply_velocity /* DB: ? arg bool half-step (also called from Entity_NPC::Interpolate with 1): velocity*friction (+0x36c/+0x368), speed clamp 40 (variant 10 state 4 bonus), door TryBlowOpen/Open when charging through, Game room bounds */ void __thiscall Entity_NPC::apply_velocity(Entity_NPC *this,char param_2) { GridEntity_Door *this_00; int gridY; uint gridIdx; uint railType; int gridX; Game *game; float fVar1; float fVar2; float fVar3; Vector railDir; Vector railPoint; Vector railTangent; undefined1 local_24 [4]; float remainingSpeed; float local_1c; void *local_18; float dirY; float dirX; char isRailReversed [5]; void *curRoom; Vector *pos; byte railCell; dirY = this->_friction * (this->_velocity).y; dirX = this->_friction * (this->_velocity).x; local_18 = g_game->_room; if (param_2 == '\0') { fVar1 = this->_baseFriction; (this->_velocity).x = dirX; (this->_velocity).y = dirY; this->_friction = fVar1; } fVar1 = sqrtf(dirX * dirX + dirY * dirY); if ((this->_variant == 10) && (this->_state == 4)) { fVar1 = fVar1 + 0.5; } fVar3 = 40.0; if (fVar1 <= 40.0) { fVar3 = fVar1; } local_1c = fVar3; if ((0.0 < DAT_00c7e848) && (local_1c = DAT_00c7e848, fVar3 <= DAT_00c7e848)) { local_1c = fVar3; } if (param_2 != '\0') { local_1c = local_1c * 0.5; } railDir.x = dirX; railDir.y = dirY; remainingSpeed = local_1c; fVar1 = sqrtf(dirX * dirX + dirY * dirY); if (0.0 < fVar1) { railDir.x = dirX * (1.0 / fVar1); railDir.y = dirY * (1.0 / fVar1); dirY = railDir.y; dirX = railDir.x; } fVar1 = (this->_pos).x; pos = &this->_pos; railPoint.y = 0.0; railPoint.x = 0.0; railTangent.y = 0.0; railTangent.x = 0.0; gridX = (int)((fVar1 - 40.0) / 40.0 + 0.5); if ((((-1 < gridX) && (gridX < *(int *)((int)local_18 + 0xc))) && (gridY = (int)(((this->_pos).y - 120.0) / 40.0 + 0.5), -1 < gridY)) && (gridY < *(int *)((int)local_18 + 0x10))) { gridIdx = *(int *)((int)local_18 + 0xc) * gridY + gridX; if ((gridIdx < 0x1c0) && (railCell = *(byte *)((int)g_game->_room + gridIdx + 0x746c), railCell != 0xff)) { RailManager::get_closest_rail_point (pos,&railDir,gridIdx,railCell & 0xf,&railPoint,&railTangent,local_24,&local_1c, isRailReversed); game = g_game; pos->x = railPoint.x; (this->_pos).y = railPoint.y; fVar1 = (railTangent.x * dirX + railTangent.y * dirY) * remainingSpeed; remainingSpeed = fVar1; if (0.0 < fVar1) { do { fVar3 = 3.0; if (remainingSpeed <= 3.0) { fVar3 = remainingSpeed; } remainingSpeed = remainingSpeed - fVar3; fVar2 = dirX * fVar3 + pos->x; fVar3 = dirY * fVar3 + (this->_pos).y; pos->x = fVar2; (this->_pos).y = fVar3; gridX = (int)((fVar2 - 40.0) / 40.0 + 0.5); if (gridX < 0) { LAB_004ce466: gridIdx = 0xffffffff; LAB_004ce469: railType = 0xffffffff; } else { if (*(int *)((int)local_18 + 0xc) <= gridX) goto LAB_004ce466; gridY = (int)((fVar3 - 120.0) / 40.0 + 0.5); if ((gridY < 0) || (game = g_game, *(int *)((int)local_18 + 0x10) <= gridY)) goto LAB_004ce466; gridIdx = *(int *)((int)local_18 + 0xc) * gridY + gridX; if (0x1bf < gridIdx) goto LAB_004ce469; railCell = *(byte *)((int)g_game->_room + gridIdx + 0x746c); if (railCell == 0xff) { railType = 0xffffffff; } else { railType = railCell & 0xf; } } if (((int)gridIdx < 1) || ((int)railType < 0)) { if (param_2 == '\0') { this->_i2 = -1; } pos->x = dirX * remainingSpeed + pos->x; (this->_pos).y = dirY * remainingSpeed + (this->_pos).y; return; } if (param_2 == '\0') { this->_i2 = gridIdx; } RailManager::get_closest_rail_point (pos,&railDir,gridIdx,railType,&railPoint,&railTangent,local_24,&local_1c, isRailReversed); if (isRailReversed[0] != '\0') { railTangent.x = railTangent.x * -1.0; railTangent.y = railTangent.y * -1.0; } if ((railTangent.x == g_vectorZero.x) && (railTangent.y == g_vectorZero.y)) { if (param_2 == '\0') { this->_i2 = -1; } pos->x = dirX * remainingSpeed + pos->x; goto LAB_004ce6ae; } pos->x = railPoint.x; (this->_pos).y = railPoint.y; railDir.x = railTangent.x; railDir.y = railTangent.y; dirY = railTangent.y; dirX = railTangent.x; if ((this->_variant == 10) && (this->_state == 4)) { curRoom = game->_room; gridX = (int)(((railTangent.x * 10.0 + pos->x) - 40.0) / 40.0 + 0.5); if (((-1 < gridX) && ((((gridX < *(int *)((int)curRoom + 0xc) && (gridY = (int)(((railTangent.y * 10.0 + railPoint.y) - 120.0) / 40.0 + 0.5), -1 < gridY)) && (gridY < *(int *)((int)curRoom + 0x10))) && ((gridIdx = *(int *)((int)curRoom + 0xc) * gridY + gridX, gridIdx < 0x1c0 && (this_00 = *(GridEntity_Door **)((int)curRoom + gridIdx * 4 + 0x24), this_00 != (GridEntity_Door *)0x0)))))) && ((this_00->_desc)._type == 0x10)) { GridEntity_Door::Open(this_00); GridEntity_Door::TryBlowOpen(this_00,1,(Entity *)0x0); GridEntity_Door::TryBlowOpen(this_00,1,(Entity *)0x0); } game = g_game; } } while (0.0 < remainingSpeed); } if (param_2 == '\0') { (this->_velocity).x = dirX * fVar1; (this->_v1).x = dirX * fVar1; (this->_velocity).y = dirY * fVar1; (this->_v1).y = dirY * fVar1; return; } return; } } pos->x = dirX * local_1c + fVar1; LAB_004ce6ae: (this->_pos).y = dirY * remainingSpeed + (this->_pos).y; return; } //@@ 004ce6d0 Entity_NPC::update_move_direction_anim /* DB: ? thiscall Entity_NPC: from velocity (+0x360) computes one of 8 directions (atan2, 16 sectors), turns the stored direction (+0xbc0) one step at a time unless just spawned, then plays the matching "Move1".."Move8" animation (table PTR_s_Move1_00b1ee78); Entity_NPC::update_physics, Entity_NPC::Interpolate */ void __thiscall Entity_NPC::update_move_direction_anim(Entity_NPC *this) { uint uVar1; byte *anim; byte *pbVar2; byte bVar3; byte *pbVar4; uint uVar5; int iVar6; byte *pbVar7; bool bVar8; float fVar9; fVar9 = (this->_velocity).x; if (((fVar9 != g_vectorZero.x) || ((this->_velocity).y != g_vectorZero.y)) && (this->_state != 0x10)) { fVar9 = atan2f((this->_velocity).y,fVar9); for (fVar9 = fVar9 * -57.295776; fVar9 < 0.0; fVar9 = fVar9 + 360.0) { } for (; 360.0 <= fVar9; fVar9 = fVar9 - 360.0) { } uVar5 = (int)((fVar9 * 16.0) / 360.0 + 0.5) & 0x80000007; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffff8) + 1; } uVar1 = this->_i1; if (uVar1 != uVar5) { if (g_game->_frameCount - this->_spawnFrame < 2) { this->_i1 = uVar5; } else { iVar6 = uVar5 - uVar1; if (iVar6 < -4) { iVar6 = iVar6 + (-iVar6 - 5U & 0xfffffff8) + 8; } if (3 < iVar6) { iVar6 = iVar6 + (iVar6 + 4U >> 3) * -8; } uVar5 = uVar1 + 7; if (-1 < iVar6) { uVar5 = uVar1 + 1; } uVar5 = uVar5 & 0x80000007; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffff8) + 1; } this->_i1 = uVar5; } } } anim = (&PTR_s_Move1_00b1ee78)[this->_i1]; if (this->_state == 0x10) { bVar3 = ANM2::SetAnimation(&this->_sprite,anim,1); if (((bVar3 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; return; } } else { pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { pbVar4 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar4 = *(byte **)pbVar2; } pbVar7 = anim; do { bVar3 = *pbVar4; bVar8 = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_004ce860: uVar5 = -(uint)bVar8 | 1; goto LAB_004ce865; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar8 = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_004ce860; pbVar4 = pbVar4 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004ce865: if (uVar5 == 0) { if (pbVar2[0x34] == 0) { return; } if ((this->_sprite)._animState._isPlaying != 0) { return; } } } bVar3 = ANM2::SetAnimation(&this->_sprite,anim,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } return; } //@@ 004ce8a0 NpcAI::ENTITY_MINECART /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 965 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MINECART(Entity_NPC *npc) { uint *puVar1; float fVar2; qword qVar3; byte isInRoom; int iVar4; uint uVar5; Vector *pVVar6; Entity *dustCloud; undefined4 dustColor; Vector *pVVar7; Vector *pVVar8; float fVar9; float fVar10; undefined1 auStack_54 [4]; undefined1 local_50 [8]; Vector local_48; Vector scratchVec [6]; uint stackCookie; EntityPtr child; Game *game; Room *room; int variant; stackCookie = __security_cookie ^ (uint)auStack_54; iVar4 = npc->_state; variant = npc->_variant; if (iVar4 == 0) { iVar4 = 4; if (variant == 10) { iVar4 = 0x10; } npc->_state = iVar4; if (variant == 10) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; } qVar3 = npc->_flags; npc->_isInvicible = 1; npc->_stateFrame = 0; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x10; *(uint *)&npc->_flags = (uint)qVar3 & 0xfffffffb | 1; goto LAB_004cee6b; } if (iVar4 == 0x10) { fVar9 = (npc->_targetPosition).y; fVar10 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar9 - fVar10; goto LAB_004cee6b; } if (iVar4 != 4) { if (iVar4 == 3) { npc->_entityCollisionClass = 0; npc->_visible = 0; } goto LAB_004cee6b; } if (variant == 10) { fVar9 = (npc->_v2).x; npc->_mass = 100.0; npc->_entityCollisionClass = 4; if ((0.8 < fVar9) && (iVar4 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar4 != 0)) { uVar5 = Random(); local_50._0_4_ = (npc->_velocity).x; local_50._4_4_ = (npc->_velocity).y; pVVar6 = MusicManager::RandomVector(scratchVec); local_48.x = (float)local_50._0_4_ * 0.2 + pVVar6->x; local_48.y = (float)local_50._4_4_ * 0.2 + pVVar6->y; dustCloud = Game::SpawnEx(g_game,1000,0x3b,&npc->_pos,&local_48,(Entity *)npc,0,uVar5,0); uVar5 = Random(); *(float *)(dustCloud[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar5 = Random(); iVar4 = uVar5 % 0xf + 0xf; *(int *)(dustCloud[1]._sprite._filename._buf + 8) = iVar4; *(int *)(dustCloud[1]._sprite._filename._buf + 0xc) = iVar4; dustColor = Color::Color(0x3f000000); (**(code **)(*(int *)dustCloud + 0x3c))(dustColor,0xffffffff,0xff,0,1); uVar5 = Random(); game = g_game; fVar10 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; fVar9 = fVar10 * g_vectorOne.x; (dustCloud->_sprite)._scale.y = fVar10 * g_vectorOne.y; (dustCloud->_sprite)._scale.x = fVar9; if (*(int *)&game->_roomTransition != 0) { qVar3 = dustCloud->_flags; puVar1 = (uint *)((int)&dustCloud->_flags + 4); *puVar1 = *puVar1 | 0x1000; *(int *)&dustCloud->_flags = (int)qVar3; } (**(code **)(*(int *)dustCloud + 0xc))(); } npc->_visible = 1; npc->_friction = 0.9; pVVar6 = Vector::Normalized(&npc->_v1,scratchVec); fVar9 = (npc->_v2).x; fVar10 = pVVar6->y; (npc->_velocity).x = pVVar6->x * 1.3 * fVar9 + (npc->_velocity).x; fVar2 = (npc->_v2).x; (npc->_velocity).y = fVar10 * 1.3 * fVar9 + (npc->_velocity).y; (npc->_v2).x = fVar2 * 1.02 + 0.01; } else { if (npc->_child == (EntityPtr)0x0) { npc->_mass = 50.0; LAB_004cebfd: iVar4 = 4; } else { npc->_mass = 10000.0; if (*(int *)((int)npc->_child + 0x188) == 0) goto LAB_004cebfd; iVar4 = 0; } npc->_entityCollisionClass = iVar4; npc->_visible = 1; if (npc->_child == (EntityPtr)0x0) { LAB_004cec87: fVar9 = 0.9; } else { pVVar6 = Vector::Normalized(&npc->_v1,scratchVec); fVar9 = (npc->_v2).x; fVar10 = pVVar6->y; (npc->_velocity).x = pVVar6->x * 1.3 * fVar9 + (npc->_velocity).x; (npc->_velocity).y = fVar10 * 1.3 * fVar9 + (npc->_velocity).y; if (npc->_child == (EntityPtr)0x0) goto LAB_004cec87; fVar9 = 0.8; } npc->_friction = fVar9; } npc->_entityGridCollisionClass = 0; if ((npc->_child == (EntityPtr)0x0) && (variant != 10)) { npc->_stateFrame = npc->_stateFrame + 1; if (2 < npc->_stateFrame) { NpcHelper::minecart_break(); } } else { npc->_stateFrame = 0; } game = g_game; room = g_game->_room; isInRoom = Room::IsPositionInRoom(room,&npc->_pos,0.0); pVVar6 = &npc->_pos; if (isInRoom == 0) { fVar9 = (npc->_pos).y; local_50._0_4_ = (room->_topLeftPos).x - pVVar6->x; local_50._4_4_ = pVVar6->x - (room->_bottomRightPos).x; local_48.x = (room->_topLeftPos).y - fVar9; fVar9 = fVar9 - (room->_bottomRightPos).y; pVVar8 = (Vector *)(local_50 + 4); if ((float)local_50._4_4_ <= (float)local_50._0_4_) { pVVar8 = (Vector *)local_50; } pVVar7 = &local_48; if (local_48.x < pVVar8->x || local_48.x == pVVar8->x) { pVVar7 = pVVar8; } if (fVar9 <= pVVar7->x) { fVar9 = pVVar7->x; } fVar9 = (fVar9 - 0.0) / 48.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } fVar9 = 1.0 - fVar9; } else { fVar9 = 1.0; } (npc->_sprite)._color._tint[3] = fVar9; if (((0xf < game->_frameCount - npc->_spawnFrame) || ((*(int *)&game->_roomTransition != 0 && ((game->_roomTransition)._animation == 0x13)))) && ((child = npc->_child, child == (EntityPtr)0x0 || ((*(int *)((int)child + 0x28) != 0x38a || (*(int *)((int)child + 0x2c) != 0)))))) { if (npc->_variant == 10) { isInRoom = Room::IsPositionInRoom(room,pVVar6,-300.0); uVar5 = (uint)(isInRoom == 0); } else { uVar5 = Room::GetGridIndex(room,pVVar6); uVar5 = uVar5 >> 0x1f; } if (uVar5 != 0) { if (npc->_state == 0) { ENTITY_MINECART(npc); } npc->_state = 3; if (npc->_child != (EntityPtr)0x0) { (**(code **)(*(int *)npc->_child + 0x28))(); } (**(code **)(*(int *)npc + 0x28))(); return; } } LAB_004cee6b: if (npc->_dead != 0) { npc->_dead = 0; } return; } //@@ 004cee90 NpcHelper::minecart_break /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: plays sound 481, spawns particles, clears EntityPtr at +0x3c0; Minecart/Hornfel */ void NpcHelper::minecart_break(void) { Manager *pMVar1; uint uVar2; int *in_ECX; int *local_44; ColorMod local_40; float local_14; local_14 = (float)(__security_cookie ^ (uint)((&local_40)[1]._tint + 1)); (**(code **)(*in_ECX + 0x28))(); pMVar1 = g_manager; local_44 = (int *)0x1e1; seed_fart_sound_override((int *)&local_44); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_44,1.0,10,0,1.0,0.0); local_40._tint[0] = 1.0; local_40._tint[1] = 1.0; local_40._tint[2] = 1.0; local_40._tint[3] = 1.0; local_40._colorize[0] = 0.0; local_40._colorize[1] = 0.0; local_40._colorize[2] = 0.0; local_40._colorize[3] = 0.0; if (*(int *)((int)g_game->_room + 0x1d18) == 0x2e) { local_40._tint[0] = 0.9; local_40._tint[1] = 0.9; local_40._tint[2] = 0.9; local_40._colorize[0] = 1.0; local_40._colorize[1] = 1.0; local_40._colorize[2] = 1.0; local_40._colorize[3] = 0.7; } local_40._offset[0] = 0.0; local_40._offset[1] = 0.0; local_40._offset[2] = 0.0; uVar2 = Random(); local_44 = (int *)((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 3.0); uVar2 = Random(); Game::SpawnParticles (g_game,(Vector *)(in_ECX + 0xcf),0x1b,uVar2 % 3 + 6,(float)local_44,&local_40,100000.0, 0); if (in_ECX[0xf0] != 0) { local_44 = in_ECX + 0xf0; std::multiset::erase(&local_44); } in_ECX[0xf0] = 0; return; } //@@ 004cf030 Entity_NPC::SetMinecartPosVel /* ZHL [exact] __thiscall void Entity_NPC::SetMinecartPosVel(Vector * pos, Vector * vel); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_NPC::SetMinecartPosVel(Entity_NPC *this,Vector *pos,Vector *vel) { int iVar1; int iVar2; int iVar3; (this->_pos).x = pos->x; (this->_pos).y = pos->y; iVar3 = (int)((pos->x - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (iVar1 = *(int *)((int)g_game->_room + 0xc), iVar1 <= iVar3)) || (iVar2 = (int)((pos->y - 120.0) / 40.0 + 0.5), iVar2 < 0)) || (*(int *)((int)g_game->_room + 0x10) <= iVar2)) { iVar3 = -1; } else { iVar3 = iVar1 * iVar2 + iVar3; } this->_i2 = iVar3; (this->_velocity).x = vel->x; (this->_velocity).y = vel->y; (this->_v1).x = vel->x; (this->_v1).y = vel->y; this->_spawnGridIndex = iVar3; return; } //@@ 004cf0f0 FUN_004cf0f0 void FUN_004cf0f0(byte param_1) { Entity_NPC *in_ECX; if (in_ECX->_state == 0) { NpcAI::ENTITY_MINECART(in_ECX); } in_ECX->_state = param_1 + 3; return; } //@@ 004cf120 Entity_NPC::MinecartUpdateChild /* ZHL [exact] __thiscall void Entity_NPC::MinecartUpdateChild(Entity * child); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_NPC::MinecartUpdateChild(Entity_NPC *this,Entity *child) { Entity *pEVar1; EntityPtr EVar2; EntityPtr *pEVar3; Entity_NPC *local_8; EVar2 = this->_child; pEVar3 = &this->_child; local_8 = this; if (EVar2 != (EntityPtr)0x0) { if (*(int *)((int)EVar2 + 0x3d4) != 0) { local_8 = (Entity_NPC *)((int)EVar2 + 0x3d4); std::multiset::erase(&local_8); *(undefined4 *)((int)EVar2 + 0x3d4) = 0; EVar2 = *pEVar3; } if (EVar2 != (EntityPtr)0x0) { local_8 = (Entity_NPC *)pEVar3; std::multiset::erase(&local_8); } } pEVar1 = child; *pEVar3 = (EntityPtr)child; if (child != (Entity *)0x0) { std::multiset::insert(pEVar3); } EVar2 = pEVar1->_minecart; pEVar3 = &pEVar1->_minecart; if (EVar2 != (EntityPtr)this) { if (EVar2 != (EntityPtr)0x0) { child = (Entity *)pEVar3; std::multiset::erase(&child); } *pEVar3 = (EntityPtr)this; std::multiset::insert(pEVar3); } return; } //@@ 004cf1d0 EntityPtr::Set /* DB: swaps held entity pointer, erase/insert into refcount multiset prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntityPtr::Set(EntityPtr *this,Entity *entity) { Entity *pEVar1; pEVar1 = entity; if (*this != (EntityPtr)entity) { if (*this != (EntityPtr)0x0) { entity = (Entity *)this; std::multiset::erase(&entity); } *this = (EntityPtr)pEVar1; if (pEVar1 != (Entity *)0x0) { std::multiset::insert(this); } } return; } //@@ 004cf210 std::multiset::erase /* DB: tree equal_range by key, counts and erases nodes; used to unregister EntityPtr slot before reassigning */ int std::multiset::erase(uint *param_1) { char cVar1; int *piVar2; int *piVar3; int *piVar4; void *ptr; undefined4 *in_ECX; int *piVar5; int iVar6; int *piVar7; int *piVar8; int local_10; piVar2 = (int *)*in_ECX; piVar4 = (int *)piVar2[1]; piVar7 = piVar2; piVar8 = piVar2; if (*(char *)((int)piVar4 + 0xd) == '\0') { piVar3 = piVar4; do { if ((uint)piVar3[4] < *param_1) { piVar5 = (int *)piVar3[2]; } else { if ((*(char *)((int)piVar8 + 0xd) != '\0') && (*param_1 < (uint)piVar3[4])) { piVar8 = piVar3; } piVar5 = (int *)*piVar3; piVar7 = piVar3; } piVar3 = piVar5; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar4 = (int *)*piVar8; } if (*(char *)((int)piVar4 + 0xd) == '\0') { do { if (*param_1 < (uint)piVar4[4]) { piVar3 = (int *)*piVar4; piVar8 = piVar4; } else { piVar3 = (int *)piVar4[2]; } piVar4 = piVar3; } while (*(char *)((int)piVar3 + 0xd) == '\0'); } iVar6 = 0; local_10 = 0; piVar4 = piVar7; if (piVar7 != piVar8) { do { piVar3 = (int *)piVar4[2]; iVar6 = iVar6 + 1; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; while ((piVar4 = piVar5, cVar1 == '\0' && (piVar3 == (int *)piVar4[2]))) { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; } } } while (piVar4 != piVar8); local_10 = iVar6; } param_1 = (uint *)piVar7; if ((piVar7 == (int *)*piVar2) && (*(char *)((int)piVar8 + 0xd) != '\0')) { FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, (_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar7 != piVar8) { do { piVar2 = (int *)param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); operator_delete(ptr,0x14); } while (param_1 != (uint *)piVar8); return local_10; } return local_10; } //@@ 004cf350 std::set::clear /* DB: tree erase+reset */ void std::set::clear(void) { int iVar1; int *in_ECX; iVar1 = *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; in_ECX[1] = 0; return; } //@@ 004cf380 FUN_004cf380 void FUN_004cf380(int *param_1) { int *piVar1; int *in_ECX; piVar1 = param_1; if ((int *)*in_ECX != param_1) { if ((int *)*in_ECX != (int *)0x0) { param_1 = in_ECX; std::multiset::erase(¶m_1); } *in_ECX = (int)piVar1; if (piVar1 != (int *)0x0) { std::multiset::insert(in_ECX); } } return; } //@@ 004cf3c0 std::set::insert_unique /* DB: ECX tree (head, size): walks to the lower bound of *arg2, returns {existing node, false} on an equal key, else allocates a 0x14-byte node (key +0x10), links it, red-black rebalances and returns {node, true} (size limit 0xccccccc); called by the std::multiset::insert wrapper and Entity_Player::update_ladder */ void std::set::insert_unique(undefined4 *param_1,uint *param_2) { char cVar1; int *piVar2; undefined4 *puVar3; int *piVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined4 *puVar6; int *piVar7; undefined4 *puVar8; bool bVar9; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af374d; local_10 = ExceptionList; piVar2 = (int *)*in_ECX; bVar9 = false; local_14 = (int *)piVar2[1]; piVar7 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar4 = local_14; do { local_14 = piVar4; bVar9 = *param_2 <= (uint)local_14[4]; if (bVar9) { piVar4 = (int *)*local_14; piVar7 = local_14; } else { piVar4 = (int *)local_14[2]; } } while (*(char *)((int)piVar4 + 0xd) == '\0'); } if ((*(char *)((int)piVar7 + 0xd) == '\0') && ((uint)piVar7[4] <= *param_2)) { *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 0; return; } ExceptionList = &local_10; if (in_ECX[1] == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; puVar5 = operator_new(0x14); puVar5[4] = *param_2; *puVar5 = piVar2; puVar5[1] = piVar2; puVar5[2] = piVar2; *(undefined2 *)(puVar5 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; puVar5[1] = local_14; if (local_14 == piVar2) { *piVar2 = (int)puVar5; piVar2[1] = (int)puVar5; piVar2[2] = (int)puVar5; *(undefined1 *)(puVar5 + 3) = 1; } else { if (bVar9) { *local_14 = (int)puVar5; if (local_14 == (int *)*piVar2) { *piVar2 = (int)puVar5; } } else { local_14[2] = (int)puVar5; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)puVar5; } } cVar1 = *(char *)(puVar5[1] + 0xc); puVar8 = puVar5; while (cVar1 == '\0') { puVar3 = (undefined4 *)puVar8[1]; puVar6 = *(undefined4 **)puVar3[1]; if (puVar3 == puVar6) { puVar6 = (undefined4 *)((undefined4 *)puVar3[1])[2]; if (*(char *)(puVar6 + 3) == '\0') { LAB_004cf52a: *(undefined1 *)(puVar3 + 3) = 1; *(undefined1 *)(puVar6 + 3) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; puVar8 = *(undefined4 **)(puVar8[1] + 4); } else { if (puVar8 == (undefined4 *)puVar3[2]) { FUN_00415fe0(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar8[1] + 4)); } } else { if (*(char *)(puVar6 + 3) == '\0') goto LAB_004cf52a; if (puVar8 == (undefined4 *)*puVar3) { FUN_00415f80(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar8[1] + 4)); } cVar1 = *(char *)(puVar8[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *param_1 = puVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 004cf5b0 NpcHelper::min_min_willo_count /* DB: NpcAI::ENTITY_MIN_MIN: out EDX = room sublist count (all Willos), *param_1 = those whose parent (+0x3bc) is this Min-Min (pass6_h2.md) */ void NpcHelper::min_min_willo_count(int *param_1) { qword qVar1; uint uVar2; int in_ECX; uint *in_EDX; qword *pqVar3; EntityList_EL local_24; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1690; local_10 = ExceptionList; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_24,0x328,-1,-1,0,0); uVar2 = 0; *in_EDX = local_24._size; *param_1 = 0; if (local_24._size != 0) { do { if (*(int *)(*(int *)((int)local_24._data + uVar2 * 4) + 0x3bc) == in_ECX) { *param_1 = *param_1 + 1; } uVar2 = uVar2 + 1; } while (uVar2 < (uint)local_24._size); } if (local_24._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } if (local_24._data != (void *)0x0) { uVar2 = *(uint *)((int)local_24._data + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar2; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar2); free((void *)((int)local_24._data + -4)); } } ExceptionList = local_10; return; } //@@ 004cf690 NpcAI::ENTITY_MIN_MIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 913 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MIN_MIN(Entity_NPC *npc) { undefined4 uVar1; undefined1 *puVar2; byte isSpotFree; uint uVar4; Entity_NPC *parentNpc; Entity *pEVar5; EntityPtr EVar6; char *animName; Vector *pVVar7; float *willoSlot; int iVar8; void *pvVar9; int iVar10; ANM2 *sprite; EntityPtr EVar11; uint candidateCount; uint uVar12; float fVar13; float fVar14; Vector clampedPos; Vector local_d8; ColorMod color; int spawnCount; Vector local_a0; EntityPtr candidatesBegin; EntityPtr candidatesEnd; EntityPtr candidatesCapacity; float local_8c; EntityList_EL entityList; float local_78; float local_74; EntityPtr local_70; float local_6c; Room *room; Vector local_64; EntityList_EL npcList; float local_4c; float local_48; Entity *local_44; EntityPtr local_40; EntityPtr local_3c; EntityPtr local_38; EntityList_EL local_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; bool isSpotFree; int *roomEntity; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af37b8; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; room = g_game->_room; local_40 = (EntityPtr)npc; local_24 = uVar4; if (npc->_variant == 10) { if (npc->_state == 0) { uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; npc->_visible = 0; npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_isInvicible = 1; npc->_canShutDoors = 0; npc->_isBoss = 0; npc->_state = 3; (npc->_v1).x = 0.0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); goto switchD_004cfc53_caseD_1; } EVar6 = npc->_parent; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (EVar6 == (EntityPtr)0x0) goto switchD_004cfc53_caseD_1; fVar14 = npc->_updateTime; if (40.0 < fVar14) { fVar13 = (npc->_v1).x; if (fVar13 <= 0.0) { fVar13 = fVar13 - 0.05; } else { fVar13 = fVar13 + 0.05; } (npc->_v1).x = fVar13; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (20.0 < fVar14) { local_48 = (npc->_v1).x; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (local_48 == 0.0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); parentNpc = Entity_NPC::ParentNPC(npc); pEVar5 = Entity_NPC::GetPlayerTarget(parentNpc); fVar14 = (npc->_pos).y - (pEVar5->_pos).y; fVar13 = (npc->_pos).x - (pEVar5->_pos).x; fVar14 = sqrtf(fVar14 * fVar14 + fVar13 * fVar13); fVar14 = atan2f(((pEVar5->_pos).y + (pEVar5->_velocity).y * fVar14 * 0.1) - (npc->_pos).y, ((pEVar5->_velocity).x * fVar14 * 0.1 + (pEVar5->_pos).x) - (npc->_pos).x); fVar14 = normalize_angle_degrees(fVar14 * 57.295776 - (npc->_v2).x); if (fVar14 <= 0.0) { local_48 = -3.0; } else { local_48 = 3.0; } (npc->_v1).x = local_48; EVar6 = npc->_parent; } fVar14 = atan2f(*(float *)((int)EVar6 + 0x340) - (npc->_pos).y, *(float *)((int)EVar6 + 0x33c) - (npc->_pos).x); local_48 = local_48 * npc->_speedMultiplier; local_38 = (EntityPtr)(fVar14 * 57.295776); fVar14 = normalize_angle_degrees((npc->_v2).x - (float)local_38); if (ABS(local_48) <= ABS(fVar14)) { EVar6 = (EntityPtr)normalize_angle_degrees((npc->_v2).x + local_48); } else { EVar6 = local_38; } (npc->_v2).x = (float)EVar6; Entity_NPC::QueryNPCsType(&npcList,0x328,-1); local_14 = 0; iVar10 = 0; EVar6 = (EntityPtr)0x0; if ((EntityPtr)npcList._size == (EntityPtr)0x0) { LAB_004cf971: (**(code **)(*(int *)npc + 0x28))(); } else { do { iVar8 = *(int *)((int)npcList._data + (int)EVar6 * 4); if ((*(int *)(iVar8 + 0x30) == 0) && (*(Entity_NPC **)(iVar8 + 0x3bc) == npc)) { iVar10 = iVar10 + 1; } EVar6 = (EntityPtr)((int)EVar6 + 1); } while ((uint)EVar6 < (uint)npcList._size); if (iVar10 == 0) goto LAB_004cf971; } if (npcList._0_1_ == '\0') { local_14 = 1; tracked_alloc(1,npcList._data,0); } } local_14 = 0xffffffff; local_38 = (EntityPtr)((npc->_v2).x * 0.017453292); local_40 = (EntityPtr)sin((float)local_38); local_3c = (EntityPtr)(npc->_v2).y; fVar14 = cos((float)local_38); (npc->_velocity).x = fVar14 * (float)local_3c; (npc->_velocity).y = (float)local_3c * (float)local_40; fVar14 = (npc->_pos).y - *(float *)((int)npc->_parent + 0x340); fVar13 = (npc->_pos).x - *(float *)((int)npc->_parent + 0x33c); fVar14 = sqrtf(fVar14 * fVar14 + fVar13 * fVar13); if ((fVar14 < 14.0) && (20.0 < npc->_updateTime)) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&npcList,0x328,-1,-1,0,0) ; local_14 = 2; local_40 = (EntityPtr)0x0; if ((EntityPtr)npcList._size != (EntityPtr)0x0) { pvVar9 = npcList._data; do { iVar10 = *(int *)((int)pvVar9 + (int)local_40 * 4); if (*(int *)(iVar10 + 0x30) == 0) { EVar6 = (EntityPtr)(iVar10 + 0x3bc); if (*(Entity_NPC **)(iVar10 + 0x3bc) == npc) { local_3c = npc->_parent; if (*(Entity_NPC **)(iVar10 + 0x3bc) != (Entity_NPC *)0x0) { local_38 = EVar6; std::multiset::erase(&local_38); } *(EntityPtr *)EVar6 = local_3c; if (local_3c != (EntityPtr)0x0) { std::multiset::insert(EVar6); } pvVar9 = npcList._data; } } local_40 = (EntityPtr)((int)local_40 + 1); } while ((uint)local_40 < (uint)npcList._size); } (**(code **)(*(int *)npc + 0x28))(); local_14 = 0xffffffff; if (npcList._0_1_ == '\0') { local_14 = 3; tracked_alloc(1,npcList._data,0); local_14 = 0xffffffff; } } goto switchD_004cfc53_caseD_1; } npc->_friction = npc->_friction * 0.7; puVar2 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_i1 == 0) && (fVar14 = npc->_maxHitPoints * 0.4, puVar2 = (undefined1 *)((int)register0x00000010 + -4), npc->_health <= fVar14 && fVar14 != npc->_health)) { npc->_i1 = 1; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); game = g_game; npc->_entityCollisionClass = 0; EntityList::QuerySublist((EntityList *)((int)game->_room + 0x1218),&entityList,0x328,-1,-1,0,0); uVar12 = 0; if (entityList._size != 0) { do { iVar10 = *(int *)((int)entityList._data + uVar12 * 4); if ((*(int *)(iVar10 + 0x30) == 0) && (*(Entity_NPC **)(iVar10 + 0x3bc) == npc)) { *(undefined4 *)(iVar10 + 0xbb4) = 0x3f800000; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)entityList._size); } puVar2 = puStack_20; if (entityList._0_1_ == '\0') { local_14 = 4; tracked_alloc(1,entityList._data,0); local_14 = 0xffffffff; puVar2 = puStack_20; } } puStack_20 = puVar2; if ((0 < npc->_projectileDelay) && (0.0 < npc->_pendingDamage)) { iVar8 = (int)((float)npc->_projectileDelay - npc->_pendingDamage); iVar10 = 0; if (0 < iVar8) { iVar10 = iVar8; } npc->_projectileDelay = iVar10; } switch(npc->_state) { case 0: color._tint[0] = 1.0; color._tint[1] = 1.0; color._tint[2] = 1.0; color._tint[3] = 1.0; npc->_state = 3; color._colorize[0] = 8.0; color._colorize[1] = 6.0; color._colorize[2] = 0.0; color._colorize[3] = 1.0; color._offset[0] = 0.0; color._offset[1] = 0.0; color._offset[2] = 0.0; Color::operator_assign((Color *)&npc->_splatColor,&color); fVar14 = *(float *)((int)npc->_config + 0x24); npc->_shadowSize = fVar14 + fVar14; fVar14 = *(float *)((int)npc->_config + 0x44); npc->_mass = fVar14 + fVar14; default: goto switchD_004cfc53_caseD_1; case 3: animName = "Walk2"; if (npc->_i1 < 1) { animName = (char *)s_Walk; } ANM2::Play(&npc->_sprite,(byte *)animName,0); Entity_NPC::CalcTargetPosition(npc,&local_64,0.0); isSpotFree = Entity::HasEntityFlags((Entity *)npc,0x1000b00); if (isSpotFree == 0) { isSpotFree = Entity::IsFrame((Entity *)npc,10,0); if (isSpotFree != 0) { NpcHelper::min_min_willo_count(&local_38); if (2 < (int)local_38) goto LAB_004cfd49; iVar10 = 10; do { Room::GetRandomPosition(room,&local_a0,20.0); iVar10 = iVar10 + -1; } while (iVar10 != 0); } } else { LAB_004cfd49: (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } sprite = &npc->_sprite; if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) { fVar14 = 0.6; } else { fVar14 = 0.5; local_64.x = g_vectorZero.x; local_64.y = g_vectorZero.y; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_64,fVar14,0,1); if (((npc->_child == (EntityPtr)0x0) && (npc->_projectileDelay < 1)) && (uVar12 = Random(), (uVar12 & 3) == 0)) { NpcHelper::min_min_willo_count(&local_40); npc->_stateFrame = 0; npc->_i2 = 0; iVar10 = npc->_i1; if ((int)local_38 < (int)((uint)(0 < iVar10) * 2 + 5)) { if (((int)local_40 < (int)((uint)(0 < iVar10) * 4 + 4)) && (iVar10 = Isaac::Random((0 < iVar10) + 2), iVar10 == 0)) { npc->_state = 0xd; animName = "Spit2"; if (npc->_i1 < 1) { animName = &DAT_00b1d47c; } ANM2::Play(sprite,(byte *)animName,0); uVar12 = Random(); npc->_projectileDelay = uVar12 % 0x3c + 0xf; } else if (((int)local_40 < (int)((uint)(0 < npc->_i1) * 2 + 2)) && (uVar12 = Random(), uVar12 % 3 == 0)) { npc->_state = 0xe; animName = "Spit2"; if (npc->_i1 < 1) { animName = &DAT_00b1d47c; } ANM2::Play(sprite,(byte *)animName,0); uVar12 = Random(); npc->_projectileDelay = uVar12 % 0x5a + 0x5a; } else if ((0 < npc->_i1) && (uVar12 = Random(), (uVar12 & 3) == 0)) { npc->_state = 6; ANM2::Play(sprite,&DAT_00b1d33c,0); Entity_NPC::QueryNPCsType(&entityList,0x328,-1); local_14 = 5; uVar12 = 0; if (entityList._size != 0) { do { iVar10 = *(int *)((int)entityList._data + uVar12 * 4); if ((*(int *)(iVar10 + 0x30) == 0) && (*(Entity_NPC **)(iVar10 + 0x3bc) == npc)) { *(undefined4 *)(iVar10 + 0xb64) = 0xd; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)entityList._size); } uVar12 = Random(); local_14 = 0xffffffff; npc->_projectileDelay = uVar12 % 0x5a + 0x5a; EntityList_Query::~EntityList_Query(&entityList); } } if ((((npc->_state == 3) && (npc->_projectileCooldown < 1)) && (2 < (int)local_40)) && (uVar12 = Random(), uVar12 % 3 == 0)) { if (npc->_i1 == 0) { uVar12 = 8; } else { uVar12 = Random(); uVar12 = ~uVar12 & 1 | 8; } npc->_state = uVar12; uVar12 = Random(); npc->_projectileDelay = uVar12 % 0x5a + 0x5a; } } goto switchD_004cfc53_caseD_1; case 6: iVar10 = npc->_i2; if (iVar10 == 0) { isSpotFree = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isSpotFree != 0) { npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i2 = npc->_i2 + 1; npc->_stateFrame = 0; } goto switchD_004cfc53_caseD_1; } if (iVar10 == 1) { local_48 = 0.0; local_74 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (0 < (int)local_74) { fVar14 = (float)npc->_stateFrame; do { if ((int)fVar14 % 10 == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_34,0x328,-1,-1,0,0); uVar12 = 0; if (local_34._size != 0) { do { iVar10 = *(int *)((int)local_34._data + uVar12 * 4); if (*(int *)(iVar10 + 0x30) == 0) { *(undefined4 *)(iVar10 + 0xba0) = 0x1e; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)local_34._size); } if (local_34._0_1_ == '\0') { local_14 = 0xb; tracked_alloc(1,local_34._data,0); local_14 = 0xffffffff; } } uVar12 = *(uint *)((int)npc + 0x410); if ((int)uVar12 < 9) { if ((uVar12 & 1) == 0) { local_44 = (Entity *)0x0; local_4c = 0.0; EntityList::QuerySublist(&room->_entityList,&entityList,1000,0x9d,-1,0,0); iVar10 = entityList._size; isSpotFree = false; local_14 = 0xc; local_3c = (EntityPtr)0x0; do { if (isSpotFree) break; if (((int)local_3c < 5) && (uVar12 = Random(), uVar12 % 3 == 0)) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_8c = (pEVar5->_pos).x; local_6c = (pEVar5->_pos).y; uVar12 = Random(); fVar14 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38 = (EntityPtr)(fVar14 + fVar14); local_4c = sin((float)local_38); uVar12 = Random(); local_44 = (Entity *) ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 40.0); fVar14 = cos((float)local_38); local_a0.x = local_8c + fVar14 * (float)local_44; local_a0.y = local_6c + local_4c * (float)local_44; pVVar7 = Room::GetClampedPositionImpl (room,&clampedPos,&local_a0,30.0,30.0,30.0,30.0); } else { pVVar7 = Room::GetRandomPosition(room,&local_d8,30.0); } local_44 = (Entity *)pVVar7->y; uVar12 = 0; local_4c = pVVar7->x; isSpotFree = true; if (iVar10 != 0) { do { if (!isSpotFree) break; iVar8 = *(int *)((int)entityList._data + uVar12 * 4); if ((*(EntityPtr *)(iVar8 + 0x3bc) == (EntityPtr)npc) && (fVar13 = local_4c - *(float *)(iVar8 + 0x33c), fVar14 = (float)local_44 - *(float *)(iVar8 + 0x340), fVar13 * fVar13 + fVar14 * fVar14 < 100.0)) { isSpotFree = false; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)iVar10); } local_3c = (EntityPtr)((int)local_3c + 1); } while ((int)local_3c < 10); uVar12 = Random(); iVar10 = uVar12 % 5 + 1; spawnCount = iVar10; uVar12 = Random(); local_3c = (EntityPtr)0x0; local_38 = (EntityPtr)0x0; local_70 = (EntityPtr) ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 360.0); if (iVar10 != 0) { do { if (iVar10 == 1) { local_64.x = local_4c; local_64.y = (float)local_44; } else { local_6c = (((float)(int)local_38 * 360.0) / (float)iVar10 + (float)local_70) * 0.017453292; local_8c = sin(local_6c); fVar14 = cos(local_6c); local_64.x = local_4c + fVar14 * 30.0; local_64.y = local_8c * 30.0 * 0.6 + (float)local_44; } uVar12 = Random(); EVar6 = (EntityPtr) Game::Spawn(g_game,1000,0x9d,&local_64,&g_vectorZero,(Entity *)npc,0, uVar12); if (*(int *)((int)EVar6 + 0x3bc) != 0) { local_6c = (float)((int)EVar6 + 0x3bc); std::multiset::erase(&local_6c); } *(EntityPtr *)((int)EVar6 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar6 + 0x3bc)); if (local_3c == (EntityPtr)0x0) { *(undefined4 *)((int)EVar6 + 0x450) = 0; (**(code **)(*(int *)EVar6 + 0xc))(); local_3c = EVar6; } else { if (*(int *)((int)EVar6 + 0x3c4) != 0) { local_6c = (float)((int)EVar6 + 0x3c4); std::multiset::erase(&local_6c); } *(EntityPtr *)((int)EVar6 + 0x3c4) = local_3c; std::multiset::insert((EntityPtr *)((int)EVar6 + 0x3c4)); *(undefined4 *)((int)EVar6 + 0x450) = 0; (**(code **)(*(int *)EVar6 + 0xc))(); } local_38 = (EntityPtr)((int)local_38 + 1); iVar10 = spawnCount; } while ((int)local_38 < spawnCount); } if (entityList._0_1_ == '\0') { local_14 = 0xd; pvVar9 = entityList._data; goto LAB_004d0e69; } goto LAB_004d0e7e; } } else { if ((int)(uVar12 - 8) % 0xf != 0) goto LAB_004d0e81; EntityList::QuerySublist(&room->_entityList,&npcList,1000,0x9d,-1,0,0); EVar6 = (EntityPtr)0x0; local_3c = (EntityPtr)0x0; EVar11 = (EntityPtr)0x0; candidatesBegin = (EntityPtr)0x0; candidatesEnd = (EntityPtr)0x0; candidatesCapacity = (EntityPtr)0x0; local_14 = 0xf; local_38 = (EntityPtr)0x0; if ((EntityPtr)npcList._size == (EntityPtr)0x0) { LAB_004d0dec: *(int *)((int)npc + 0xbc4) = *(int *)((int)npc + 0xbc4) + 1; *(undefined4 *)((int)npc + 0x410) = 0; EVar6 = candidatesBegin; } else { pvVar9 = npcList._data; do { local_70 = *(EntityPtr *)((int)pvVar9 + (int)local_38 * 4); if (((*(EntityPtr *)((int)local_70 + 0x3bc) == (EntityPtr)npc) && (*(int *)((int)local_70 + 0x3c4) == 0)) && (*(int *)((int)local_70 + 0x450) == 0)) { if (EVar11 == EVar6) { std::vector<4byte>::_Emplace_reallocate(EVar11,&local_70); EVar6 = candidatesCapacity; pvVar9 = npcList._data; EVar11 = candidatesEnd; } else { *(EntityPtr *)EVar11 = local_70; candidatesEnd = (EntityPtr)((int)EVar11 + 4); EVar11 = candidatesEnd; } } local_38 = (EntityPtr)((int)local_38 + 1); } while ((uint)local_38 < (uint)npcList._size); local_70 = candidatesBegin; local_3c = EVar6; if (candidatesBegin == EVar11) goto LAB_004d0dec; candidateCount = (int)EVar11 - (int)candidatesBegin >> 2; uVar12 = 0; if (candidateCount != 0) { uVar12 = Random(); uVar12 = uVar12 % candidateCount; } iVar10 = *(int *)((int)local_70 + uVar12 * 4); EVar6 = (EntityPtr)0x0; do { iVar8 = *(int *)((int)npcList._data + (int)EVar6 * 4); if ((iVar8 == iVar10) || (*(int *)(iVar8 + 0x3c4) == iVar10)) { *(undefined4 *)(iVar8 + 0x450) = 1; } EVar6 = (EntityPtr)((int)EVar6 + 1); } while ((uint)EVar6 < (uint)npcList._size); EVar6 = local_70; npc = (Entity_NPC *)local_40; } local_14 = CONCAT31(local_14._1_3_,0xe); if (EVar6 != (EntityPtr)0x0) { uVar12 = ((int)local_3c - (int)EVar6 >> 2) * 4; EVar11 = EVar6; if (0xfff < uVar12) { EVar11 = *(EntityPtr *)((int)EVar6 + -4); uVar12 = uVar12 + 0x23; if (0x1f < ((int)EVar6 - (int)EVar11) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar11,uVar12); candidatesBegin = (EntityPtr)0x0; candidatesEnd = (EntityPtr)0x0; candidatesCapacity = (EntityPtr)0x0; } if (npcList._0_1_ == '\0') { local_14 = 0x10; pvVar9 = npcList._data; LAB_004d0e69: tracked_alloc(1,pvVar9,0); } LAB_004d0e7e: local_14 = 0xffffffff; } LAB_004d0e81: ((ColorMod *)((int)npc + 0x410))->_tint[0] = (float)((int)((ColorMod *)((int)npc + 0x410))->_tint[0] + 1); local_48 = (float)((int)local_48 + 1); fVar14 = ((ColorMod *)((int)npc + 0x410))->_tint[0]; } while ((int)local_48 < (int)local_74); } goto switchD_004cfc53_caseD_1; } if (iVar10 == 2) { npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (0x1d < npc->_stateFrame) { npc->_i2 = 3; ANM2::Play(&npc->_sprite,&DAT_00b602f0,0); Entity_NPC::QueryNPCsType(&npcList,0x328,-1); local_40 = (EntityPtr)0x0; if ((EntityPtr)npcList._size != (EntityPtr)0x0) { EVar6 = (EntityPtr)npcList._size; pvVar9 = npcList._data; do { iVar10 = *(int *)((int)pvVar9 + (int)local_40 * 4); if (((*(int *)(iVar10 + 0x30) == 0) && (*(Entity_NPC **)(iVar10 + 0x3bc) == npc)) && (*(int *)(iVar10 + 0xb64) == 0xd)) { *(undefined4 *)(iVar10 + 0xb64) = 6; NpcHelper::willo_get_target_pos(&local_64,0); willoSlot = (float *)NpcHelper::willo_slot(&local_d8,0xc); local_38 = (EntityPtr)(*willoSlot - local_64.x); local_3c = (EntityPtr)(willoSlot[1] - local_64.y); fVar14 = sqrtf((float)local_38 * (float)local_38 + (float)local_3c * (float)local_3c); if (fVar14 <= 0.0) { EVar11 = local_3c; EVar6 = local_38; } else { EVar11 = (EntityPtr)((float)local_3c * (1.0 / fVar14)); EVar6 = (EntityPtr)((float)local_38 * (1.0 / fVar14)); } *(float *)(iVar10 + 0x33c) = (float)EVar6 * 0.1 + local_64.x; *(float *)(iVar10 + 0x340) = (float)EVar11 * 0.1 + local_64.y; EVar6 = (EntityPtr)npcList._size; pvVar9 = npcList._data; } local_40 = (EntityPtr)((int)local_40 + 1); } while ((uint)local_40 < (uint)EVar6); } EntityList_Query::~EntityList_Query(&npcList); } goto switchD_004cfc53_caseD_1; } isSpotFree = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isSpotFree != 0) { npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); } break; case 8: animName = "Spin2"; if (npc->_i1 < 1) { animName = &DAT_00b602e8; } ANM2::Play(&npc->_sprite,(byte *)animName,0); if (npc->_stateFrame == 0) { Entity_NPC::QueryNPCsType(&entityList,0x328,-1); uVar12 = 0; if (entityList._size != 0) { do { iVar10 = *(int *)((int)entityList._data + uVar12 * 4); if ((*(int *)(iVar10 + 0x30) == 0) && (*(Entity_NPC **)(iVar10 + 0x3bc) == npc)) { *(undefined4 *)(iVar10 + 0xbb4) = 0x3f000000; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)entityList._size); } npc->_stateFrame = npc->_stateFrame + 1; if (entityList._0_1_ == '\0') { local_14 = 6; tracked_alloc(1,entityList._data,0); local_14 = 0xffffffff; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { isSpotFree = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (isSpotFree != 0) { Entity_NPC::PlaySound(npc,0x1e3,1.0,2,0,1.0); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&npcList,0x328,-1,-1,0,0); local_14 = 7; local_3c = (EntityPtr)0x0; if ((EntityPtr)npcList._size != (EntityPtr)0x0) { pvVar9 = npcList._data; do { EVar6 = *(EntityPtr *)((int)pvVar9 + (int)local_3c * 4); local_40 = EVar6; if ((((AnimationState *)((int)EVar6 + 0x30))->_animation == (void *)0x0) && (*(Entity_NPC **)((int)EVar6 + 0x3bc) == npc)) { local_38 = (EntityPtr)((int)EVar6 + 0x48); isSpotFree = ANM2::SetAnimation((ANM2 *)local_38,(byte *)"Attack",1); EVar11 = local_38; if (isSpotFree != 0) { AnimationState::Rewind((AnimationState *)((int)local_38 + 0x30)); *(byte *)((int)EVar11 + 0x44) = 1; EVar6 = local_40; } if (*(void **)((int)EVar6 + 0x7c) != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)((int)EVar6 + 0x78),17.0); } ((Vector *)((int)EVar6 + 0xb64))->x = 1.4013e-44; ((ColorMod *)((int)EVar6 + 0x410))->_tint[0] = 0.0; pvVar9 = npcList._data; } local_3c = (EntityPtr)((int)local_3c + 1); } while ((uint)local_3c < (uint)npcList._size); } local_14 = 0xffffffff; if (npcList._0_1_ == '\0') { local_14 = 8; LAB_004d01f3: tracked_alloc(1,npcList._data,0); local_14 = 0xffffffff; } } break; } goto LAB_004d10ed; case 9: ANM2::Play(&npc->_sprite,(byte *)"Throw",0); if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004d10ed; isSpotFree = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (isSpotFree != 0) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (npc->_pos).y - (pEVar5->_pos).y; fVar13 = (npc->_pos).x - (pEVar5->_pos).x; fVar14 = sqrtf(fVar14 * fVar14 + fVar13 * fVar13); local_64.x = ((pEVar5->_pos).x + (pEVar5->_velocity).x * fVar14 * 0.1) - (npc->_pos).x; local_64.y = ((pEVar5->_pos).y + (pEVar5->_velocity).y * fVar14 * 0.1) - (npc->_pos).y; pVVar7 = Vector::Normalized(&local_64,&local_a0); local_4c = pVVar7->x * 7.0; local_3c = (EntityPtr)(pVVar7->y * 7.0); uVar12 = Random(); pEVar5 = Game::Spawn(g_game,0x391,10,&npc->_pos,&g_vectorZero,(Entity *)local_40,0,uVar12); local_44 = pEVar5; if (pEVar5->_parent != (EntityPtr)0x0) { local_38 = (EntityPtr)&pEVar5->_parent; std::multiset::erase(&local_38); } npc = (Entity_NPC *)local_40; pEVar5->_parent = local_40; std::multiset::insert(&pEVar5->_parent); if (*(void **)((int)npc + 0x3c0) != (void *)0x0) { local_38 = (EntityPtr)((int)npc + 0x3c0); std::multiset::erase(&local_38); } *(void **)((int)npc + 0x3c0) = pEVar5; std::multiset::insert((void **)((int)npc + 0x3c0)); fVar14 = atan2f((float)local_3c,local_4c); pEVar5[2]._prevUpdateTime = fVar14 * 57.295776; fVar14 = sqrtf((float)local_3c * (float)local_3c + local_4c * local_4c); pEVar5[2]._updateTime = fVar14; Entity_NPC::QueryNPCsType(&npcList,0x328,-1); local_14 = 9; local_3c = (EntityPtr)0x0; if ((EntityPtr)npcList._size != (EntityPtr)0x0) { do { iVar10 = *(int *)((int)npcList._data + (int)local_3c * 4); if (*(int *)(iVar10 + 0x30) == 0) { EVar6 = (EntityPtr)(iVar10 + 0x3bc); if (*(EntityPtr *)EVar6 == (EntityPtr)npc) { if (*(EntityPtr *)EVar6 != (EntityPtr)0x0) { local_38 = EVar6; std::multiset::erase(&local_38); } pEVar5 = local_44; *(Entity **)EVar6 = local_44; std::multiset::insert(EVar6); } else { pEVar5 = local_44; } } local_3c = (EntityPtr)((int)local_3c + 1); } while ((uint)local_3c < (uint)npcList._size); } pEVar5->_visible = 0; (**(code **)(*(int *)pEVar5 + 0xc))(); local_14 = 0xffffffff; if (npcList._0_1_ == '\0') { local_14 = 10; goto LAB_004d01f3; } } break; case 0xd: if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004d10ed; isSpotFree = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (isSpotFree != 0) { Entity_NPC::PlaySound(npc,0x13f,1.0,2,0,1.0); local_3c = (EntityPtr)NpcHelper::min_min_spawn_willo(0); fVar14 = *(float *)((int)local_3c + 900) * 1.5; *(float *)((int)local_3c + 900) = fVar14; *(float *)((int)local_3c + 0x380) = fVar14; collect_npcs_with_same_parent(); pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_64.x = (pEVar5->_pos).x - (npc->_pos).x; local_64.y = (pEVar5->_pos).y - (npc->_pos).y; pVVar7 = Vector::Normalized(&local_64,&local_a0); local_40 = (EntityPtr)(pVVar7->x * 25.0); local_4c = pVVar7->y * 25.0; uVar12 = Random(); if ((uVar12 & 1) == 0) { fVar14 = -15.0; } else { fVar14 = 15.0; } local_38 = (EntityPtr)(fVar14 * 0.017453292); local_44 = (Entity *)cos((float)local_38); fVar14 = sin((float)local_38); EVar6 = local_3c; local_38 = (EntityPtr)((int)local_3c + 0x48); fVar13 = (float)local_40 * (float)local_44 - local_4c * fVar14; fVar14 = fVar14 * (float)local_40 + (float)local_44 * local_4c; *(float *)((int)local_3c + 0x334) = fVar13; *(float *)((int)local_3c + 0x360) = fVar13; *(float *)((int)local_3c + 0x338) = fVar14; *(float *)((int)local_3c + 0x364) = fVar14; isSpotFree = ANM2::SetAnimation((ANM2 *)local_38,(byte *)"Attack",1); EVar11 = local_38; if (isSpotFree != 0) { AnimationState::Rewind((AnimationState *)((int)local_38 + 0x30)); *(byte *)((int)EVar11 + 0x44) = 1; EVar6 = local_3c; } if (*(void **)((int)EVar6 + 0x7c) != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)((int)EVar6 + 0x78),4.0); } ((Vector *)((int)EVar6 + 0xb64))->x = 1.26117e-44; npc->_projectileCooldown = 0x2d; } break; case 0xe: if ((npc->_sprite)._animState._animData != (void *)0x0) { isSpotFree = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (isSpotFree != 0) { iVar10 = 0; do { iVar8 = NpcHelper::min_min_spawn_willo(0); *(int *)(&local_34.field_0x0 + iVar10 * 4) = iVar8; iVar10 = iVar10 + 1; fVar14 = *(float *)(iVar8 + 900) * 1.5; *(float *)(iVar8 + 900) = fVar14; *(float *)(iVar8 + 0x380) = fVar14; } while (iVar10 < 4); collect_npcs_with_same_parent(); iVar10 = 0; do { iVar8 = *(int *)(&local_34.field_0x0 + iVar10 * 4); NpcHelper::willo_get_target_pos(&local_78,0); willoSlot = (float *)NpcHelper::willo_slot(&local_a0,0xc); local_3c = (EntityPtr)(*willoSlot - local_78); local_44 = (Entity *)(willoSlot[1] - local_74); fVar14 = sqrtf((float)local_3c * (float)local_3c + (float)local_44 * (float)local_44); EVar6 = local_3c; pEVar5 = local_44; if (0.0 < fVar14) { EVar6 = (EntityPtr)((float)local_3c * (1.0 / fVar14)); pEVar5 = (Entity *)((float)local_44 * (1.0 / fVar14)); } iVar10 = iVar10 + 1; fVar14 = *(float *)(iVar8 + 0xbb0) * 1.15; *(float *)(iVar8 + 0x33c) = (float)EVar6 * fVar14 + local_78; *(float *)(iVar8 + 0x340) = (float)pEVar5 * fVar14 + local_74; } while (iVar10 < 4); npc = (Entity_NPC *)local_40; } if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (*(char *)((int)npc + 0x8c) != '\0')) goto switchD_004cfc53_caseD_1; } if (*(float *)((int)npc + 0xbc0) == 0.0) { ((Vector *)((int)npc + 0xb64))->x = 1.12104e-44; } else { uVar12 = Random(); ((Vector *)((int)npc + 0xb64))->x = (float)(~uVar12 & 1 | 8); } goto switchD_004cfc53_caseD_1; case 0x10: npc->_friction = npc->_friction * 0.6; if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004d10ed; isSpotFree = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (isSpotFree != 0) { npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); npc->_mass = *(float *)((int)npc->_config + 0x44); Entity_NPC::PlaySound(npc,0x8d,1.0,2,0,1.0); Game::ShakeScreen(g_game,6); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,&npc->_splatColor,1.0); } } if ((*(void **)((int)npc + 0x7c) == (void *)0x0) || (*(char *)((int)npc + 0x8c) == '\0')) { LAB_004d10ed: ((Vector *)((int)npc + 0xb64))->x = 4.2039e-45; } switchD_004cfc53_caseD_1: if (0 < (int)*(float *)((int)npc + 0xba0)) { *(int *)((int)npc + 0xba0) = ((int)*(float *)((int)npc + 0x3a0) - (int)*(float *)((int)npc + 0x3a4)) + (int)*(float *)((int)npc + 0xba0); } if (0 < (int)*(float *)((int)npc + 0xba4)) { *(int *)((int)npc + 0xba4) = ((int)*(float *)((int)npc + 0x3a0) - (int)*(float *)((int)npc + 0x3a4)) + (int)*(float *)((int)npc + 0xba4); } if ((*(char *)((int)npc + 0x173) != '\0') && (uVar12 = 0, (room->_entityList)._updateEL._size != 0)) { do { roomEntity = *(int **)((int)(room->_entityList)._updateEL._data + uVar12 * 4); EVar6 = *(EntityPtr *)(roomEntity + 0xef); if ((EVar6 == (EntityPtr)npc) || ((EVar6 != (EntityPtr)0x0 && (*(EntityPtr *)((int)EVar6 + 0x3bc) == (EntityPtr)npc)))) { iVar10 = roomEntity[10]; if (iVar10 == 1000) { if (roomEntity[0xb] != 0x9d) { LAB_004d11c8: if (iVar10 == 0x328) { color._tint[1] = 0.0; color._tint[2] = 0.0; color._tint[3] = 0.0; color._colorize[0] = 0.0; color._colorize[1] = g_vectorZero.x; color._colorize[2] = g_vectorZero.y; color._colorize[3] = g_vectorZero.x; color._offset[0] = g_vectorZero.y; color._offset[1] = 0.0; color._offset[2] = 0.0; (**(code **)(*roomEntity + 0x24))(color._tint + 1,uVar4); } goto LAB_004d1197; } } else if (iVar10 != 0x391) goto LAB_004d11c8; (**(code **)(*roomEntity + 0x28))(); } LAB_004d1197: uVar12 = uVar12 + 1; } while (uVar12 < (uint)(room->_entityList)._updateEL._size); } ExceptionList = local_1c; return; } //@@ 004d1290 NpcAI::ENTITY_MOM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 45 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOM(Entity_NPC *npc) { undefined4 uVar1; byte bVar2; char cVar3; uint uVar4; uint rngValue; Entity_NPC *otherMomPart; LayerState *layer; undefined1 *puVar5; Vector *pVVar6; EntityRef *pEVar7; Entity *target; ColorMod *poofColor; ColorMod *color; Entity_NPC *pEVar8; undefined4 *puVar9; Vector *roomCenter; void *pvVar10; ProjectileParams *params; Entity_NPC *extraout_ECX; Entity_NPC *extraout_ECX_00; Entity_NPC *extraout_ECX_01; Entity_NPC *extraout_ECX_02; Entity_NPC *extraout_ECX_03; Entity_Player *player; char *pcVar11; int iVar12; EntityPtr *target; code *extraout_EDX; int iVar14; int layerIdx; PlayerManager *playerManager; EntityPtr EVar15; float *doorSpot; float fVar16; float fVar17; Vector local_144; Entity *local_13c; float local_138; Vector local_134; float local_12c; EntityPtr local_128; char local_121; ProjectileParams projectileParams; undefined1 local_78 [8]; float fStack_70; float fStack_6c; float local_68 [4]; float local_58; float local_54; float local_50; undefined1 local_4c [20]; float local_38; undefined1 local_34 [12]; EntityPtr *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; int *roomEntity; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af3805; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; local_28 = (EntityPtr *)0x0; local_144.y = (float)npc->_subtype; local_134.y = (float)npc; local_24 = uVar4; rngValue = Random(); local_138 = 1.0; if ((float)(rngValue % 0x14 + 10) + 0.0 < npc->_pendingDamage) { rngValue = Random(); manager = g_manager; local_12c = local_138; local_13c = (Entity *)(rngValue % 0x1e); if (npc->_championColorIdx == 0x12) { local_12c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_12c = 0.5; } local_128 = (EntityPtr)0x61; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,(int)local_128,1.0, (int)((int)&local_13c->_pendingDamageFlags + 1),0,local_12c,0.0); } manager = g_manager; local_13c = (Entity *)npc->_state; if (local_13c == (Entity *)0x0) { if (npc->_championColorIdx == 0x12) { local_138 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_138 = 0.5; } local_128 = (EntityPtr)&DAT_00000065; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,(int)local_128,1.0,0x2d,0,local_138,0.0); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; pEVar8 = (Entity_NPC *)0x1; iVar14 = npc->_variant; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); local_121 = '\x01'; if (iVar14 == 10) { npc->_health = npc->_maxHitPoints; npc->_i1 = 0; npc->_projectileDelay = 0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 5; ExceptionList = local_1c; return; } iVar14 = 0; do { fVar17 = (float)(&DAT_00c5c698)[iVar14 * 2] - (npc->_pos).x; fVar16 = (float)(&DAT_00c5c69c)[iVar14 * 2] - (npc->_pos).y; if (fVar16 * fVar16 + fVar17 * fVar17 < 2500.0) { local_13c = (Entity *)((float)iVar14 * 90.0 * 0.017453292); (npc->_sprite)._rotation = (float)iVar14 * 90.0 - 90.0; npc->_entityGridCollisionClass = 0; local_128 = (EntityPtr)sin((float)local_13c); fVar17 = cos((float)local_13c); pEVar8 = (Entity_NPC *)0x0; local_121 = '\0'; fVar16 = (float)(&DAT_00c5c69c)[iVar14 * 2]; (npc->_pos).x = fVar17 * 15.0 + (float)(&DAT_00c5c698)[iVar14 * 2]; (npc->_pos).y = (float)local_128 * 15.0 + fVar16; uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; break; } iVar14 = iVar14 + 1; } while (iVar14 < 4); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; if ((npc->_parent == (EntityPtr)0x0) && ((char)pEVar8 != '\0')) { Entity_NPC::Morph(npc,npc->_type,10,npc->_subtype,-1); npc->_health = npc->_maxHitPoints; game = g_game; npc->_i1 = 0; npc->_projectileDelay = 0; local_128 = (EntityPtr)0x1; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_34,0x2d,-1,-1,0,0) ; local_14 = 0; local_12c = 0.0; pEVar8 = extraout_ECX; if (local_28 != (EntityPtr *)0x0) { do { pEVar8 = *(Entity_NPC **)(local_34._4_4_ + (int)local_12c * 4); if (pEVar8 != npc) { otherMomPart = (Entity_NPC *) __RTDynamicCast(pEVar8,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0) ; pEVar8 = extraout_ECX_00; if (otherMomPart->_parent == (EntityPtr)0x0) { Entity_NPC::Morph(otherMomPart,otherMomPart->_type,otherMomPart->_variant, npc->_subtype,-1); otherMomPart->_health = otherMomPart->_maxHitPoints; if (otherMomPart->_parent != (EntityPtr)0x0) { local_13c = (Entity *)&otherMomPart->_parent; std::multiset::erase(&local_13c); } otherMomPart->_parent = (EntityPtr)npc; std::multiset::insert(&otherMomPart->_parent); pEVar8 = (Entity_NPC *)((int)local_128 + 1); otherMomPart->_i1 = (int)local_128; local_128 = (EntityPtr)pEVar8; } } local_12c = (float)((int)local_12c + 1); } while ((uint)local_12c < local_28); } local_14 = 0xffffffff; if (local_34[0] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_34._4_4_,0); local_14 = 0xffffffff; pEVar8 = extraout_ECX_01; } } bVar2 = (byte)pEVar8; if ((Entity_Effect *)local_144.y == (Entity_Effect *)0x3) { layerIdx = 0; if ((npc->_sprite)._layerCount != 0) { do { if ((byte *)layerIdx != (byte *)(npc->_sprite)._shadowLayerIndex) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)layerIdx); if (layer->_layerData == (void *)0x0) { local_34._8_4_ = 0.0; local_28 = (EntityPtr *)&DAT_0000000f; local_4c._16_4_ = (undefined1 *)0x0; } else { std::string::string(local_4c + 0x10,(void *)((int)layer->_layerData + 0x20)); } fVar16 = (float)(local_34._8_4_ - 4); local_14 = 2; if ((uint)local_34._8_4_ < (uint)fVar16) { std::string::append_n(local_4c + 0x10,(int)fVar16 - local_34._8_4_,0); } else { puVar5 = local_4c + 0x10; if ((EntityPtr *)&DAT_0000000f < local_28) { puVar5 = (undefined1 *)local_4c._16_4_; } local_34._8_4_ = fVar16; puVar5[(int)fVar16] = 0; } std::string::append(local_4c + 0x10,(byte *)"_mausoleum.png",0xe); Sprite::ReplaceSpritesheet ((Sprite *)&npc->_sprite,layerIdx,(std_string *)(local_4c + 0x10)); local_14 = 0xffffffff; pEVar8 = extraout_ECX_02; if ((EntityPtr *)&DAT_0000000f < local_28) { target = (EntityPtr *)&local_28->field_0x1; puVar5 = (undefined1 *)local_4c._16_4_; if ((undefined1 *)0xfff < target) { puVar5 = *(undefined1 **)(local_4c._16_4_ + -4); target = local_28 + 9; if ((undefined1 *)0x1f < (undefined1 *)(local_4c._16_4_ + (-4 - (int)puVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar5,(uint)target); pEVar8 = extraout_ECX_03; } } bVar2 = (byte)pEVar8; layerIdx = layerIdx + 1; } while ((uint)layerIdx < (byte *)(npc->_sprite)._layerCount); } ANM2::LoadGraphics(&npc->_sprite,bVar2); } npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; if (local_121 != '\0') { playerManager = &g_game->_playerManager; local_34._8_4_ = 0x43a00000; local_28 = (EntityPtr *)0x43b90000; local_12c = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { if (local_12c == 0.0) { if ((int)(playerManager->_playerList)._end - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); } pVVar6 = (Vector *)(local_34 + 8); player = *(Entity_Player **)(playerManager->_playerList)._begin; } else { pvVar10 = (playerManager->_playerList)._end; puVar9 = (playerManager->_playerList)._begin; if ((int)pvVar10 - (int)puVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (playerManager->_playerList)._end; puVar9 = (playerManager->_playerList)._begin; } if ((uint)local_12c < (uint)((int)pvVar10 - (int)puVar9 >> 2)) { puVar9 = puVar9 + (int)local_12c; } player = (Entity_Player *)*puVar9; uVar4 = Random(); fVar16 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_144.y = fVar16 + fVar16; fVar16 = cos(local_144.y); local_134.x = fVar16 * 20.0 + 320.0; fVar16 = sin(local_144.y); pVVar6 = &local_134; local_134.y = fVar16 * 20.0 + 370.0; } Entity_Player::Teleport(player,pVVar6,0,0); playerManager = &g_game->_playerManager; local_12c = (float)((int)local_12c + 1); } while ((uint)local_12c < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } npc->_entityGridCollisionClass = 5; } npc->_state = 3; goto LAB_004d2bb9; } if ((npc->_i1 == 0) || ((npc->_parent != (EntityPtr)0x0 && (*(char *)((int)npc->_parent + 0x173) == '\0')))) { if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (local_13c != (Entity *)&DAT_00000006)) { npc->_state = 3; } if (npc->_i1 == 0) { iVar14 = 0xf; if (npc->_subtype != 2) { iVar14 = 0x28; } pcVar11 = g_game->_room; local_121 = *pcVar11; if (local_121 == '\0') { EVar15 = (EntityPtr)0xffffffff; } else { EVar15 = (EntityPtr)(g_game->_frameCount - *(int *)(pcVar11 + 0x11f0)); } local_128 = EVar15; if (((((npc->_projectileCooldown == 0) && (local_121 != '\0')) && (6 < g_game->_frameCount - *(int *)(pcVar11 + 0x11f0))) && ((iVar14 = Isaac::Random(iVar14), iVar14 == 0 || ((int)EVar15 < 0x3c)))) && (npc->_state == 3)) { uVar4 = Random(); if (((uVar4 % 3 == 0) || (npc->_subtype == 2)) || ((int)EVar15 < 0x3c)) { local_121 = '\x01'; if (0x3b < (int)EVar15) goto LAB_004d1b24; } else { local_121 = '\0'; LAB_004d1b24: doorSpot = (float *)&DAT_00c5c698; do { target = Entity_NPC::GetPlayerTarget(npc); fVar16 = (target->_pos).x - *doorSpot; fVar17 = (target->_pos).y - doorSpot[1]; if (fVar17 * fVar17 + fVar16 * fVar16 < 4900.0) goto LAB_004d1b7d; doorSpot = doorSpot + 2; } while ((int)doorSpot < 0xc5c6b8); if (local_121 == '\0') { LAB_004d1b7d: uVar4 = Random(); Entity_NPC::PlaySound(npc,0x65,1.0,uVar4 % 0x78 + 0x2d,0,1.0); npc->_projectileCooldown = 0x1e; goto LAB_004d1d16; } EVar15 = local_128; } Entity_NPC::PlaySound(npc,0x5d,1.0,2,0,1.0); if (0x3b < (int)EVar15) { target = Entity_NPC::GetPlayerTarget(npc); fVar16 = (target->_pos).y; (npc->_targetPosition).x = (target->_pos).x; } else { (npc->_targetPosition).x = (npc->_pos).x; fVar16 = (npc->_pos).y; } (npc->_targetPosition).y = fVar16; (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; if (((npc->_subtype != 3) || (0x3b >= (int)EVar15)) || (0 < npc->_projectileDelay)) { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Stomp",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } iVar14 = npc->_subtype; npc->_state = 7; npc->_stateFrame = 0; if (iVar14 == 2) { if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,10.0); iVar14 = npc->_subtype; } npc->_stateFrame = 10; } npc->_projectileCooldown = 0x50; if (iVar14 == 2) { npc->_projectileCooldown = 0x32; npc->_projectileDelay = 0; } } else { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"QuickStompBegin",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 6; npc->_i2 = 2; npc->_projectileCooldown = 0xb4; } } LAB_004d1d16: if (npc->_state == 7) { pVVar6 = &npc->_pos; pVVar6->x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; if ((((npc->_sprite)._animState._animData == (void *)0x0) || (bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 == 0)) || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,&DAT_00b1e554), bVar2 != 0)))) { iVar14 = 0; } else { iVar14 = 4; } npc->_entityCollisionClass = iVar14; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); Game::BombDamage(g_game,pVVar6,300.0,50.0,0,(Entity *)npc,g_tearFlagsNone,0x1000000,0); Game::MakeShockwave(g_game,pVVar6,0.04,0.25,0xd); poofColor = (ColorMod *)Color::Color(0x3f4ccccd); Entity::MakeGroundPoof((Entity *)npc,pVVar6,poofColor,local_138); } iVar14 = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_stateFrame = iVar14; if (((npc->_subtype == 2) && (iVar12 = ANM2::GetFrame(&npc->_sprite), 0x27 < iVar12)) && (iVar12 = ANM2::GetFrame(&npc->_sprite), iVar12 < 0x32)) { if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,50.0); iVar14 = npc->_stateFrame; } npc->_stateFrame = iVar14 + 10; } } else if (npc->_state == 6) { if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004d2118: if (npc->_i2 < 1) { npc->_state = 3; } else { iVar14 = npc->_i2 + -1; pcVar11 = "QuickStompEnd"; npc->_i2 = iVar14; if (iVar14 != 0) { pcVar11 = "QuickStomp"; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar11,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { npc->_entityCollisionClass = 4; Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); pVVar6 = &npc->_pos; Game::BombDamage(g_game,pVVar6,300.0,50.0,0,(Entity *)npc,g_tearFlagsNone,0x1000000,0); Game::MakeShockwave(g_game,pVVar6,0.04,0.25,0xd); (npc->_targetPosition).x = pVVar6->x; (npc->_targetPosition).y = (npc->_pos).y; if (npc->_i2 == 0) { Color::Color((Color *)local_78); Entity::MakeBloodPoof((Entity *)npc,pVVar6,color,local_138); local_128 = (EntityPtr)0x0; do { uVar4 = Random(); local_13c = Game::Spawn(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,10, uVar4); target = &local_13c->_parent; if (local_13c->_parent != (EntityPtr)0x0) { local_144.y = (float)target; std::multiset::erase(&local_144.y); } *target = (EntityPtr)npc; std::multiset::insert(target); EVar15 = (EntityPtr)((int)local_128 + 1); *(float *)(local_13c[1]._sprite._animDefaultName._buf + 8) = (float)(int)local_128 * 90.0; local_128 = EVar15; } while ((int)EVar15 < 4); } else { poofColor = (ColorMod *)Color::Color(0x3f4ccccd); Entity::MakeGroundPoof((Entity *)npc,pVVar6,poofColor,local_138); } } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_004d2118; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1e554); if ((bVar2 != 0) && (npc->_entityCollisionClass = 0, 0 < npc->_i2)) { target = Entity_NPC::GetPlayerTarget(npc); fVar16 = (target->_pos).y; (npc->_targetPosition).x = (target->_pos).x; (npc->_targetPosition).y = fVar16; if (npc->_i2 == 1) { local_78._0_4_ = 1.0; local_78._4_4_ = 1.0; fStack_70 = 1.0; fStack_6c = 1.0; local_58 = 1.0; local_68 = (float [4])ZEXT816(0); local_54 = 0.2; local_50 = 0.2; (**(code **)(*(int *)npc + 0x3c))(local_78,8,0xff,1,1); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004d2118; } if (npc->_entityCollisionClass == 0) { fVar16 = (npc->_targetPosition).y; fVar17 = (npc->_pos).y; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) * 0.2; (npc->_velocity).y = (fVar16 - fVar17) * 0.2; } else { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; } } else { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; } if (npc->_dead != 0) { Entity_NPC::PlaySound(npc,0x52,1.0,2,0,1.0); local_144.y = (float)g_game->_room; if (*(int *)((int)local_144.y + 0x1264) != 0) { uVar4 = 0; do { roomEntity = *(int **)(*(int *)((int)local_144.y + 0x125c) + uVar4 * 4); cVar3 = (**(code **)(*roomEntity + 0x48))(); if (cVar3 != '\0') { local_4c._16_4_ = g_vectorZero.x; local_34._0_4_ = g_vectorZero.x; local_38 = g_vectorZero.y; local_34._4_4_ = g_vectorZero.y; local_4c._0_4_ = 0; local_4c._4_4_ = 0; local_4c._8_4_ = 0; local_4c._12_4_ = 0; local_34._8_4_ = 0.0; local_28 = (EntityPtr *)0x0; (**(code **)(*roomEntity + 0x20))(0x42c80000,0,0,local_4c,0x1e); } uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)local_144.y + 0x1264)); npc = (Entity_NPC *)local_134.y; } pvVar10 = g_game->_room; *(undefined4 *)((int)pvVar10 + 0x7214) = 0x14; *(undefined4 *)((int)pvVar10 + 0x7218) = 6; uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; } } else { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; local_134.y = npc->_health; pEVar8 = Entity_NPC::ParentNPC(npc); if (pEVar8->_health <= local_134.y) { pEVar8 = Entity_NPC::ParentNPC(npc); npc->_health = pEVar8->_health; } else { local_134.y = npc->_health; pEVar8 = Entity_NPC::ParentNPC(npc); pEVar8->_health = local_134.y; } if (npc->_dead != 0) { pEVar7 = EntityRef::EntityRef((EntityRef *)(local_78 + 4)); (*extraout_EDX)(pEVar7); } if (npc->_state == 9) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Appear"), bVar2 != 0)) { iVar14 = 0x4d23e9; Entity_NPC::PlaySound(npc,0x30,1.5,2,0,1.0); local_134.y = (npc->_sprite)._rotation * 0.017453292; local_144.y = cos(local_134.y); fVar16 = sin(local_134.y); local_134.y = fVar16 * 0.0 + local_144.y * 45.0 + (npc->_pos).y; local_134.x = (local_144.y * 0.0 - fVar16 * 45.0) + (npc->_pos).x; Game::DamageRadius(&local_134,(Entity *)npc,0,0,iVar14,50.0,g_tearFlagsNone,25.0,35.0); } if (npc->_state != 9) goto LAB_004d24ab; } else { LAB_004d24ab: pvVar10 = npc->_config; if (*(float *)((int)pvVar10 + 0x38) < npc->_size) { Entity::SetSize((Entity *)npc,*(float *)((int)pvVar10 + 0x38), *(Vector *)((int)pvVar10 + 0x3c),*(int *)((int)pvVar10 + 0x48)); } } bVar2 = Entity::IsFrame((Entity *)npc,4,npc->_index); if (((bVar2 != 0) && (*(char *)g_game->_room != '\0')) && (0x3c < g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0))) { target = Entity_NPC::GetPlayerTarget(npc); local_144.y = (npc->_pos).y - ((target->_velocity).y * 10.0 + (target->_pos).y); local_12c = (npc->_pos).x - ((target->_velocity).x * 10.0 + (target->_pos).x); local_134.y = -(npc->_sprite)._rotation * 0.017453292; local_128 = (EntityPtr)cos(local_134.y); fVar16 = sin(local_134.y); if ((((46.0 < ABS(local_12c * (float)local_128 - local_144.y * fVar16)) || (90.0 < ABS(local_144.y * (float)local_128 + local_12c * fVar16))) || ((npc->_state == 9 || ((npc->_state == 0xb || (pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_state == 7)))))) || ((pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_state == 6 || ((((npc->_subtype == 3 || (uVar4 = Random(), (uVar4 & 7) != 0)) || (*(char *)g_game->_room == '\0')) || (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 0x3d)))))) { uVar4 = Random(); if (((uVar4 % 100 == 0) && (npc->_state == 3)) && (((pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_projectileDelay < 2 && (npc->_subtype != 2)) || (((pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_projectileDelay < 1 && (npc->_subtype == 2)) && (pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_projectileCooldown == 0)))))) { if ((((npc->_subtype == 3) && (pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_state != 6) ) && (*(char *)g_game->_room != '\0')) && (0x3c < g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0))) { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"EyeLaser",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } pEVar8 = Entity_NPC::ParentNPC(npc); pEVar8->_projectileDelay = pEVar8->_projectileDelay + 1; iVar14 = 0xb; } else { bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d34c,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } pEVar8 = Entity_NPC::ParentNPC(npc); pEVar8->_projectileDelay = pEVar8->_projectileDelay + 1; iVar14 = 8; } npc->_state = iVar14; if (npc->_subtype == 2) { pEVar8 = Entity_NPC::ParentNPC(npc); pEVar8->_projectileCooldown = 100; } } else { iVar12 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar14 = 0; if (0 < iVar12) { iVar14 = iVar12; } if ((7 < iVar14) || (uVar4 = Random(), uVar4 % 0x32 != 0)) { iVar12 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0) ; iVar14 = 0; if (0 < iVar12) { iVar14 = iVar12; } if ((5 < iVar14) || (iVar14 = Isaac::Random((npc->_subtype == 3) + 4), iVar14 != 0)) goto LAB_004d290a; } if (((npc->_projectileCooldown < 1) && (((npc->_state != 0xb && (pEVar8 = Entity_NPC::ParentNPC(npc), pEVar8->_projectileCooldown == 0)) && (*(char *)g_game->_room != '\0')))) && ((0x3c < g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) && (npc->_subtype != 2)))) { bVar2 = 0; uVar4 = Random(); pcVar11 = "Fat02"; if ((uVar4 & 1) == 0) { pcVar11 = "Fat01"; } ANM2::Play(&npc->_sprite,(byte *)pcVar11,bVar2); npc->_state = 10; } } } else { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"ArmOpen",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } pvVar10 = npc->_config; npc->_state = 9; Entity::SetSize((Entity *)npc,*(float *)((int)pvVar10 + 0x38) * 1.35, *(Vector *)((int)pvVar10 + 0x3c),*(int *)((int)pvVar10 + 0x48)); } } LAB_004d290a: pVVar6 = &npc->_pos; if (npc->_state == 3) { npc->_entityCollisionClass = 0; LAB_004d2921: if ((npc->_state == 0xb) && (bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"), bVar2 != 0)) { local_128 = (EntityPtr)((npc->_sprite)._rotation + 90.0); local_12c = sin((float)local_128 * 0.017453292); EVar15 = (EntityPtr) Entity_Laser::ShootAngle (1,pVVar6,(float)local_128,0x14,&g_vectorZero,(Entity *)npc,0); fVar16 = 0.0; if (0.0 <= local_12c) { fVar16 = 1000.0; } *(float *)((int)EVar15 + 0x358) = fVar16; *(byte *)((int)EVar15 + 0x4c0) = 1; *(int *)((int)EVar15 + 0x4c4) = 0; *(float *)((int)EVar15 + 0x4c8) = 6.0; *(float *)((int)EVar15 + 0x4cc) = 2.0; (**(code **)(*(int *)EVar15 + 0xc))(); local_128 = (EntityPtr) Entity_Laser::ShootAngle (1,&npc->_pos,(float)local_128,0x14,&g_vectorZero,(Entity *)npc,0); fVar16 = 0.0; if (0.0 <= local_12c) { fVar16 = 1000.0; } *(float *)((int)local_128 + 0x358) = fVar16; *(byte *)((int)local_128 + 0x4c0) = 1; *(int *)((int)local_128 + 0x4c4) = 0; *(float *)((int)local_128 + 0x4c8) = -6.0; *(float *)((int)local_128 + 0x4cc) = -2.0; (**(code **)(*(int *)local_128 + 0xc))(); local_144.y = (float)Entity_Effect::CreateTimer(FUN_004d2f50,5,0,0); local_134.y = (float)&((Entity_Effect *)local_144.y)->_child; if (((Entity_Effect *)local_144.y)->_child != (EntityPtr)0x0) { local_28 = (EntityPtr *)local_134.y; std::multiset::erase(&local_28); } *(EntityPtr *)local_134.y = EVar15; std::multiset::insert(local_134.y); local_134.y = (float)((int)local_144.y + 0x3c4); if (*(EntityPtr *)local_134.y != (EntityPtr)0x0) { local_28 = (EntityPtr *)local_134.y; std::multiset::erase(&local_28); } *(EntityPtr *)local_134.y = local_128; std::multiset::insert(local_134.y); local_144.y = (float)Entity_Effect::CreateTimer(FUN_004d2fd0,0xf,0,0); local_134.y = (float)&((Entity_Effect *)local_144.y)->_child; if (((Entity_Effect *)local_144.y)->_child != (EntityPtr)0x0) { local_28 = (EntityPtr *)local_134.y; std::multiset::erase(&local_28); } *(EntityPtr *)local_134.y = EVar15; std::multiset::insert(local_134.y); Entity::SetTarget((Entity *)local_144.y,(Entity *)local_128); } } else { if ((((npc->_sprite)._animState._animData == (void *)0x0) || (bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Appear"), bVar2 == 0)) || (bVar2 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Disappear"), bVar2 != 0)) { iVar14 = 0; } else { iVar14 = 4; } npc->_entityCollisionClass = iVar14; if (npc->_state == 10) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { roomCenter = Room::GetCenterPos(&local_134); local_138 = (npc->_pos).y - roomCenter->y; local_12c = pVVar6->x - roomCenter->x; fVar16 = sqrtf(local_138 * local_138 + local_12c * local_12c); local_12c = local_12c * (18.0 / fVar16); local_138 = local_138 * (18.0 / fVar16); if (npc->_subtype == 3) { uVar4 = Random(); uVar4 = *(uint *)(&DAT_00b6039c + (uVar4 % 6) * 4); if (uVar4 == 0x3000018) { pvVar10 = Entity_NPC::QueryNPCsType(local_34,0x18,3); target = (EntityPtr *)0x1; if (*(uint *)((int)pvVar10 + 0xc) < 2) goto LAB_004d2d35; local_121 = '\x01'; } else { target = local_28; LAB_004d2d35: local_121 = '\0'; } if (((uint)target & 1) != 0) { EntityList_Query::~EntityList_Query(local_34); } if (local_121 != '\0') { uVar4 = 0x12; } } else if (npc->_subtype == 1) { uVar4 = Random(); uVar4 = *(uint *)(&DAT_00b60388 + (uVar4 % 5) * 4); } else { uVar4 = Random(); uVar4 = *(uint *)(&DAT_00b60358 + (uVar4 % 0xc) * 4); } fVar16 = 1.0; bVar2 = 0; iVar14 = 2; rngValue = Random(); Entity_NPC::PlaySound (npc,0x109, (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8,iVar14,bVar2,fVar16); rngValue = Random(); local_34._8_4_ = (npc->_pos).x - local_12c; local_28 = (EntityPtr *)((npc->_pos).y - local_138); Game::Spawn(g_game,uVar4 & 0xffffff,uVar4 >> 0x18,(Vector *)(local_34 + 8),&g_vectorZero ,(Entity *)npc,0,rngValue); npc->_projectileCooldown = 100; } } else { if ((((npc->_state != 8) || (npc->_subtype != 2)) || (*(char *)g_game->_room == '\0')) || ((g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 0x79 || (bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"), bVar2 == 0)))) goto LAB_004d2921; target = Entity_NPC::GetPlayerTarget(npc); local_134.y = (npc->_pos).y - (target->_pos).y; local_28 = (EntityPtr *)(pVVar6->x - (target->_pos).x); fVar16 = sqrtf(local_134.y * local_134.y + (float)local_28 * (float)local_28); local_144.x = (float)local_28 * (-10.0 / fVar16); local_144.y = local_134.y * (-10.0 / fVar16); params = ProjectileParams::ProjectileParams(&projectileParams); local_34._8_4_ = local_144.x + pVVar6->x; local_28 = (EntityPtr *)(local_144.y + (npc->_pos).y); Entity_NPC::FireProjectiles(npc,(Vector *)(local_34 + 8),&local_144,2,params); } } if (((local_13c != (Entity *)npc->_state) && ((local_13c == (Entity *)&DAT_00000008 || (local_13c == (Entity *)&DAT_0000000b)))) && (npc->_subtype != 2)) { pEVar8 = Entity_NPC::ParentNPC(npc); pEVar8->_projectileDelay = pEVar8->_projectileDelay + -1; } } } else { pEVar7 = EntityRef::EntityRef((EntityRef *)local_4c); (**(code **)(*(int *)npc + 0x24))(pEVar7,uVar4); } if (0 < npc->_projectileCooldown) { iVar12 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; iVar14 = 0; if (0 < iVar12) { iVar14 = iVar12; } npc->_projectileCooldown = iVar14; } npc->_friction = npc->_friction * 0.8; LAB_004d2bb9: if ((0.0 < npc->_pendingDamage) && (puVar9 = (npc->_damageEvents)._begin, puVar9 != (npc->_damageEvents)._end)) { do { if (puVar9[4] == 0x2d) { *puVar9 = 0; } puVar9 = puVar9 + 0xe; } while (puVar9 != (npc->_damageEvents)._end); } ExceptionList = local_1c; return; } //@@ 004d2f50 FUN_004d2f50 void FUN_004d2f50(int param_1) { int iVar1; int iVar2; iVar2 = *(int *)(param_1 + 0x3c0); if ((iVar2 == 0) || (*(int *)(iVar2 + 0x28) != 7)) { iVar2 = 0; } iVar1 = *(int *)(param_1 + 0x3c4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 7)) { iVar1 = 0; } if (iVar2 != 0) { *(undefined1 *)(iVar2 + 0x4c0) = 1; *(undefined4 *)(iVar2 + 0x4c4) = 0; *(undefined4 *)(iVar2 + 0x4c8) = 0xc1400000; *(undefined4 *)(iVar2 + 0x4cc) = 0xc0000000; } if (iVar1 != 0) { *(undefined1 *)(iVar1 + 0x4c0) = 1; *(undefined4 *)(iVar1 + 0x4c4) = 0; *(undefined4 *)(iVar1 + 0x4c8) = 0x41400000; *(undefined4 *)(iVar1 + 0x4cc) = 0x40000000; } return; } //@@ 004d2fd0 FUN_004d2fd0 void FUN_004d2fd0(int param_1) { int iVar1; int iVar2; iVar2 = *(int *)(param_1 + 0x3c0); if ((iVar2 == 0) || (*(int *)(iVar2 + 0x28) != 7)) { iVar2 = 0; } iVar1 = *(int *)(param_1 + 0x3c4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 7)) { iVar1 = 0; } if (iVar2 != 0) { *(undefined1 *)(iVar2 + 0x4c0) = 1; *(undefined4 *)(iVar2 + 0x4c4) = 0; *(undefined4 *)(iVar2 + 0x4c8) = 0x41400000; *(undefined4 *)(iVar2 + 0x4cc) = 0x40000000; } if (iVar1 != 0) { *(undefined1 *)(iVar1 + 0x4c0) = 1; *(undefined4 *)(iVar1 + 0x4c4) = 0; *(undefined4 *)(iVar1 + 0x4c8) = 0xc1400000; *(undefined4 *)(iVar1 + 0x4cc) = 0xc0000000; } return; } //@@ 004d3050 FUN_004d3050 void FUN_004d3050(void) { return; } //@@ 004d3060 Entity_Projectile::CurvingStrength /* ZHL [lua] Lua binding EntityProjectile:CurvingStrength */ float10 __thiscall Entity_Projectile::CurvingStrength(Entity_Projectile *this) { return (float10)this->_curvingStrength; } //@@ 004d3070 Entity_Projectile::WiggleFrameOffset /* ZHL [lua] Lua binding EntityProjectile:WiggleFrameOffset */ int __thiscall Entity_Projectile::WiggleFrameOffset(Entity_Projectile *this) { return this->_wiggleFrameOffset; } //@@ 004d3080 EntitySaveState::constructor /* ZHL [exact] __thiscall void EntitySaveState::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall EntitySaveState::constructor(EntitySaveState *this) { *this = (EntitySaveState)0x0; this[8] = (EntitySaveState)0x0; this[9] = (EntitySaveState)0x0; this[1] = (EntitySaveState)0x0; this[2] = (EntitySaveState)0x0; this[3] = (EntitySaveState)0x0; this[4] = (EntitySaveState)0x0; this[5] = (EntitySaveState)0x0; this[6] = (EntitySaveState)0xffffffff; this[7] = (EntitySaveState)0xffffffff; this[10] = (EntitySaveState)g_vectorZero.x; this[0xb] = (EntitySaveState)g_vectorZero.y; this[0xc] = (EntitySaveState)0x0; this[0xd] = (EntitySaveState)0x0; this[0xe] = (EntitySaveState)0x0; this[0xf] = (EntitySaveState)0x0; this[0x10] = (EntitySaveState)0x0; this[0x17] = (EntitySaveState)0x0; this[0x19] = (EntitySaveState)0x0; this[0x1a] = (EntitySaveState)0x0; this[0x1b] = (EntitySaveState)0x0; this[0x1c] = (EntitySaveState)0x0; this[0x12] = (EntitySaveState)0xffffffff; this[0x13] = (EntitySaveState)0xffffffff; this[0x14] = (EntitySaveState)0x42700000; this[0x15] = (EntitySaveState)0x3f800000; this[0x16] = (EntitySaveState)0x3f800000; *(undefined1 *)(this + 0x18) = 1; return; } //@@ 004d3130 EntitySaveState::copy /* DB: field-by-field copy + two vector copies; Pickup TryFlip/Level::Init prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntitySaveState::copy(EntitySaveState *this,void *other) { EntitySaveState EVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3840; local_10 = ExceptionList; ExceptionList = &local_10; *this = *(EntitySaveState *)other; this[1] = *(EntitySaveState *)((int)other + 4); this[2] = *(EntitySaveState *)((int)other + 8); this[3] = *(EntitySaveState *)((int)other + 0xc); this[4] = *(EntitySaveState *)((int)other + 0x10); this[5] = *(EntitySaveState *)((int)other + 0x14); this[6] = *(EntitySaveState *)((int)other + 0x18); this[7] = *(EntitySaveState *)((int)other + 0x1c); *(undefined2 *)(this + 8) = *(undefined2 *)((int)other + 0x20); this[8].field_0x2 = *(undefined1 *)((int)other + 0x22); this[8].field_0x3 = *(undefined1 *)((int)other + 0x23); this[9] = *(EntitySaveState *)((int)other + 0x24); EVar1 = *(EntitySaveState *)((int)other + 0x2c); this[10] = *(EntitySaveState *)((int)other + 0x28); this[0xb] = EVar1; this[0xc] = *(EntitySaveState *)((int)other + 0x30); this[0xd] = *(EntitySaveState *)((int)other + 0x34); this[0xe] = *(EntitySaveState *)((int)other + 0x38); this[0xf] = *(EntitySaveState *)((int)other + 0x3c); this[0x10] = *(EntitySaveState *)((int)other + 0x40); EVar1 = *(EntitySaveState *)((int)other + 0x4c); this[0x12] = *(EntitySaveState *)((int)other + 0x48); this[0x13] = EVar1; this[0x14] = *(EntitySaveState *)((int)other + 0x50); this[0x15] = *(EntitySaveState *)((int)other + 0x54); this[0x16] = *(EntitySaveState *)((int)other + 0x58); this[0x17] = *(EntitySaveState *)((int)other + 0x5c); *(undefined1 *)(this + 0x18) = *(undefined1 *)((int)other + 0x60); FUN_004d7250((int)other + 100); local_8 = 0; FUN_004d7190((int)other + 0x6c); ExceptionList = local_10; return; } //@@ 004d3230 FUN_004d3230 void FUN_004d3230(undefined4 *param_1) { int iVar1; undefined4 uVar2; char cVar3; uint uVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = param_1[2]; in_ECX[3] = param_1[3]; in_ECX[4] = param_1[4]; in_ECX[5] = param_1[5]; in_ECX[6] = param_1[6]; *(undefined1 *)((int)in_ECX + 0x22) = *(undefined1 *)((int)param_1 + 0x22); in_ECX[9] = param_1[9]; in_ECX[7] = param_1[7]; *(undefined2 *)(in_ECX + 8) = *(undefined2 *)(param_1 + 8); in_ECX[10] = param_1[10]; in_ECX[0xb] = param_1[0xb]; in_ECX[0xc] = param_1[0xc]; in_ECX[0xd] = param_1[0xd]; in_ECX[0xe] = param_1[0xe]; in_ECX[0xf] = param_1[0xf]; in_ECX[0x10] = param_1[0x10]; iVar1 = param_1[0xf]; in_ECX[0x12] = iVar1; in_ECX[0x13] = iVar1 >> 0x1f; *(undefined1 *)((int)in_ECX + 0x23) = *(undefined1 *)((int)param_1 + 0x23); in_ECX[0x14] = param_1[0x14]; in_ECX[0x15] = param_1[0x15]; *(undefined1 *)(in_ECX + 0x18) = *(undefined1 *)(param_1 + 0x18); in_ECX[0x16] = param_1[0x16]; in_ECX[0x17] = param_1[0x17]; puVar5 = (undefined4 *)FUN_004d7250(param_1 + 0x19); uVar2 = puVar5[1]; puVar5[1] = in_ECX[0x1a]; in_ECX[0x1a] = uVar2; uVar2 = *puVar5; *puVar5 = in_ECX[0x19]; in_ECX[0x19] = uVar2; local_8 = 0; if (local_18 != (int *)0x0) { cVar3 = (**(code **)(*local_18 + 0xc))(uVar4); if ((cVar3 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(local_1c); } } local_8 = 0xffffffff; SharedPtr::assign(in_ECX + 0x1b,param_1 + 0x1b); ExceptionList = local_10; return; } //@@ 004d3380 Level::GetLastBossRoomListIndex /* ZHL [lua] Lua binding Level:GetLastBossRoomListIndex */ int __thiscall Level::GetLastBossRoomListIndex(Level *this) { return this->_lastBossRoomListIndex; } //@@ 004d3390 Game::SetStateFlag /* ZHL [lua] Lua binding Game:SetStateFlag */ void Game::SetStateFlag(uint param_1) { if ((int)param_1 < 1) { param_1 = 0; } if (((int)param_1 < 0x34) && (0x34 < param_1)) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } FUN_004d72b0(); return; } //@@ 004d33d0 NpcHelper::moms_heart_attack_pattern /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: NpcAI::ENTITY_MOMS_HEART calls it as (v1.y pattern, stateFrame) in states 8 / i1==5: switch(pattern) fires FireProjectiles rings, Entity_Laser::ShootAngle, "Heartbeat" event prototype: db/protos.zhl, confirmed by RET 8 */ void NpcHelper::moms_heart_attack_pattern(Entity_NPC *npc,int pattern,int stateFrame) { byte isHeartbeat; Entity *target; int iVar1; uint frameMod4; int framesLeft; uint uVar2; Entity_Laser *laser; int updateTime; uint baseBulletFlags; bool isOnBeat; float fVar3; double dVar4; float fVar5; undefined1 auStack_f8 [4]; float local_f4; float local_f0; Vector local_ec; float local_e4; float local_e0; Vector firePos; float local_d4; Vector local_d0; float rotationSpeed; Vector laserOffset; uint isPositiveRotation; ProjectileParams projParams; code *projectileCallback; uint stackCookie; stackCookie = __security_cookie ^ (uint)auStack_f8; ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = 5.0; projParams.Scale = 1.5; projParams.FallingAccelModifier = -0.06; projParams.FallingSpeedModifier = -2.0; target = Entity_NPC::GetPlayerTarget(npc); local_f4 = (target->_pos).x - (npc->_pos).x; local_e4 = (target->_pos).y - (npc->_pos).y; fVar3 = sqrtf(local_e4 * local_e4 + local_f4 * local_f4); if (fVar3 <= 0.0) { fVar5 = local_e4; fVar3 = local_f4; } else { fVar5 = local_e4 * (1.0 / fVar3); fVar3 = local_f4 * (1.0 / fVar3); } projParams.CircleAngle = atan2f(fVar5,fVar3); uVar2 = (uint)projParams.BulletFlags; iVar1 = (int)npc->_prevUpdateTime; baseBulletFlags = (uint)projParams.BulletFlags | 0x80; updateTime = (int)npc->_updateTime; firePos.x = (npc->_pos).x; firePos.y = (npc->_pos).y; switch(pattern) { case 0: fVar3 = (float)stateFrame; local_f0 = (fVar3 * fVar3 - fVar3) * 0.01 + fVar3; fVar3 = (fVar3 - 0.0) / 180.0; if (fVar3 <= 0.0) { fVar3 = 0.0; } if (1.0 <= fVar3) { fVar3 = 1.0; } if (updateTime == iVar1) { return; } local_f4 = 3.0; fVar3 = (6.0 - fVar3 * 3.0) + 0.5; projParams.BulletFlags._0_4_ = baseBulletFlags; FUN_008370b0(); if (stateFrame % (int)fVar3 != 0) { return; } fVar5 = local_f0; goto LAB_004d358e; case 1: if (updateTime == iVar1) { return; } if (stateFrame != (stateFrame / 0x12) * 0x12) { return; } dVar4 = (double)((((float)stateFrame / 30.0) / 6.0) * 6.2831855); projParams.BulletFlags._0_4_ = baseBulletFlags; libm_sse2_cos_precise(); fVar3 = 1.12104e-44; local_ec.x = 3.0; projParams.CircleAngle = ((((float)dVar4 * 10.0) / 6.0) / 30.0) * 6.2831855; break; case 2: case 3: if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } projParams.BulletFlags._0_4_ = baseBulletFlags; isHeartbeat = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Heartbeat"); if (isHeartbeat == 0) { return; } if (npc->_aiCounter == 3) { fVar3 = 5.60519e-45; } else { fVar3 = 1.4013e-44; } local_ec.x = 5.0; projParams.CircleAngle = (((float)stateFrame / 6.0) / 30.0) * 6.2831855; if (pattern == 3) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x200000; } break; case 4: if (updateTime == iVar1) { return; } if (stateFrame % 6 != 0) { return; } fVar3 = 4.2039e-45; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x200080; local_ec.x = 3.0; projParams.CircleAngle = (((float)stateFrame / 6.0) / 30.0) * 6.2831855; break; case 5: if (updateTime == iVar1) { return; } frameMod4 = stateFrame & 0x80000003; isOnBeat = frameMod4 == 0; if ((int)frameMod4 < 0) { isOnBeat = (frameMod4 - 1 | 0xfffffffc) == 0xffffffff; } if (!isOnBeat) { return; } projParams.BulletFlags._0_4_ = baseBulletFlags; fVar5 = cos(((float)stateFrame * 0.9424779) / 30.0); projParams.BulletFlags._0_4_ = uVar2 | 0x200080; fVar3 = 4.2039e-45; local_ec.x = 3.5; projParams.CircleAngle = (fVar5 * 6.2831855) / 3.0; break; case 6: if (updateTime == iVar1) { return; } uVar2 = stateFrame & 0x80000003; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xfffffffc) == 0xffffffff; } if (!isOnBeat) { return; } fVar3 = 1.4013e-45; fVar5 = ((float)npc->_stateFrame - 0.0) / 60.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } local_ec.x = fVar5 * 7.0 + 8.0; goto LAB_004d417d; case 7: if (updateTime == iVar1) { return; } uVar2 = stateFrame & 0x80000003; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xfffffffc) == 0xffffffff; } if (!isOnBeat) { return; } local_ec.x = 6.0; fVar3 = 7.00649e-45; projParams.CircleAngle = projParams.CircleAngle * -1.0; goto LAB_004d417d; case 8: projParams.BulletFlags._0_4_ = baseBulletFlags; isHeartbeat = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Heartbeat"); if (isHeartbeat == 0) { return; } projParams.FireDirectionLimit.x = 0.0; projParams.FireDirectionLimit.y = 1.0; projParams.DotProductLimit = 0.0; firePos.x = (npc->_pos).x; fVar3 = (float)((npc->_aiCounter != 3) + 7); if (npc->_aiCounter == 3) { fVar3 = 5.60519e-45; } local_ec.x = 5.0; projParams.CircleAngle = (((float)stateFrame / 6.0) / 30.0) * 6.2831855; firePos.y = *(float *)((int)g_game->_room + 0x18) + 20.0; break; case 9: if (updateTime == iVar1) { return; } if (stateFrame != 2) { return; } projParams.BulletFlags._0_4_ = baseBulletFlags; uVar2 = Random(); local_f4 = (float)(uVar2 % 0x1e + 0xf); isPositiveRotation = Random(); isPositiveRotation = isPositiveRotation & 1; uVar2 = Random(); local_d4 = 30.0; local_e0 = 90.0; local_f0 = 0.0; local_e4 = ((float)((uVar2 & 3) + 1) + 0.0) * 180.0; do { local_ec.x = (npc->_pos).x + 0.0; local_ec.y = (npc->_pos).y - local_d4; laserOffset.x = 0.0; laserOffset.y = 0.0; laser = Entity_Laser::ShootAngle (1,&local_ec,(float)(int)local_f0 * local_e0 - 135.0,0x5a,&laserOffset, (Entity *)npc,0); laser->_isActiveRotating = 1; laser->_rotationDelay = (int)local_f4; if (isPositiveRotation == 0) { local_d0.x = -local_e4; rotationSpeed = -2.0; } else { rotationSpeed = 2.0; local_d0.x = local_e4; } iVar1 = __ftoui3(); laser->_rotationDegrees = local_d0.x; laser->_rotationSpd = rotationSpeed; laser->_timeout = iVar1 + (int)local_f4 + 1; (**(code **)(*(int *)laser + 0xc))(); local_f0 = (float)((int)local_f0 + 1); } while ((int)local_f0 < 4); return; case 10: framesLeft = 0xb4 - stateFrame; local_e0 = ((float)(framesLeft * framesLeft) - (float)framesLeft) * 0.01 + (float)framesLeft; fVar3 = ((float)stateFrame - 0.0) / 180.0; if (fVar3 <= 0.0) { fVar3 = 0.0; } if (1.0 <= fVar3) { fVar3 = 1.0; } if (updateTime == iVar1) { return; } local_f4 = 3.0; fVar3 = fVar3 * 0.0 + 3.0 + 0.5; projParams.BulletFlags._0_4_ = baseBulletFlags; FUN_008370b0(); if (stateFrame % (int)fVar3 != 0) { return; } fVar5 = local_e0; LAB_004d358e: fVar3 = 2.8026e-45; projParams.CircleAngle = ((fVar5 / 6.0) / 30.0) * 6.2831855; local_ec.x = local_f4; break; case 0xb: if (updateTime == iVar1) { return; } uVar2 = stateFrame & 0x8000000f; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xfffffff0) == 0xffffffff; } if (!isOnBeat) { return; } fVar3 = 1.12104e-44; projParams.CircleAngle = (float)stateFrame * 0.62831855 * 0.0625; uVar2 = stateFrame & 0x8000001f; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xffffffe0) == 0xffffffff; } projParams.BulletFlags._0_4_ = 0x40000; if (!isOnBeat) { projParams.BulletFlags._0_4_ = 0x80000; } projParams.BulletFlags._0_4_ = baseBulletFlags | (uint)projParams.BulletFlags; local_ec.x = 5.0; break; case 0xc: case 0xd: if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } projParams.BulletFlags._0_4_ = baseBulletFlags; isHeartbeat = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Heartbeat"); if (isHeartbeat == 0) { return; } local_f4 = 6.0; projParams.FallingAccelModifier = -0.08; projParams.CircleAngle = (((float)stateFrame / 6.0) / 30.0) * 6.2831855; if ((pattern == 0xd) && (npc->_aiCounter != 3)) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x200000; } local_f0 = 4.2039e-45; if (npc->_aiCounter == 3) { local_ec.x = 0.8; } else { local_f0 = 1.12104e-44; local_ec.x = 0.5; } local_ec.x = local_ec.x * 6.0; local_ec.y = (float)(int)local_f0; Entity_NPC::FireProjectiles(npc,&firePos,&local_ec,9,&projParams); projParams.Scale = 1.0; fVar3 = local_f0; local_ec.x = local_f4; if (npc->_aiCounter == 3) { projParams.CircleAngle = (((float)-stateFrame / local_f4) / 30.0) * 6.2831855; } else { projParams.CircleAngle = 3.1415927 / (float)(int)local_f0 + projParams.CircleAngle; } break; case 0xe: if (updateTime == iVar1) { return; } uVar2 = stateFrame & 0x80000003; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xfffffffc) == 0xffffffff; } if (!isOnBeat) { return; } projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x280080; projectileCallback = FUN_004d4210; fVar3 = (float)stateFrame / 180.0 + (float)stateFrame / 180.0; projParams.CircleAngle = ((fVar3 + fVar3) * 3.1415927) / 3.0; fVar3 = 7.00649e-45; local_ec.x = 3.0; break; case 0xf: if (updateTime == iVar1) { return; } uVar2 = stateFrame & 0x80000007; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xfffffff8) == 0xffffffff; } if (!isOnBeat) { return; } projParams.Scale = 1.0; projParams.CircleAngle = 0.06981317; projectileCallback = FUN_004d43b0; local_ec.x = 6.0; local_ec.y = 8.0; projParams.BulletFlags._0_4_ = baseBulletFlags; Entity_NPC::FireProjectiles(npc,&firePos,&local_ec,9,&projParams); projParams.CircleAngle = projParams.CircleAngle - 0.13962634; projParams.WiggleFrameOffset = 0x14; fVar3 = 1.12104e-44; local_ec.x = 6.0; break; case 0x10: if (updateTime == iVar1) { return; } if (stateFrame != (stateFrame / 0x1e) * 0x1e) { return; } projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x2080; projParams.Scale = 1.0; projParams.FallingAccelModifier = -0.085; projectileCallback = FUN_004d4480; projParams.CurvingStrength = 2.0; local_ec.x = 3.0; local_ec.y = 4.0; projParams.CircleAngle = (((float)stateFrame + (float)stateFrame) * 3.1415927) / 600.0; projParams.TargetPosition.x = (npc->_pos).x; projParams.TargetPosition.y = (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&firePos,&local_ec,9,&projParams); projParams.CurvingStrength = -2.0; local_ec.x = 3.0; local_ec.y = 4.0; Entity_NPC::FireProjectiles(npc,&firePos,&local_ec,9,&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags & 0xffffdfff; projParams.CircleAngle = 0.0; projParams.Scale = 1.5; projectileCallback = (code *)0x0; fVar3 = 1.68156e-44; local_ec.x = 3.0; break; case 0x11: if (updateTime == iVar1) { return; } uVar2 = stateFrame & 0x80000007; isOnBeat = uVar2 == 0; if ((int)uVar2 < 0) { isOnBeat = (uVar2 - 1 | 0xfffffff8) == 0xffffffff; } if (!isOnBeat) { return; } projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x2080; projParams.CircleAngle = 0.0; projectileCallback = FUN_004d42f0; fVar3 = 1.12104e-44; local_ec.x = 8.0; break; case 0x12: if (updateTime == iVar1) { return; } if (stateFrame == 2) { projParams.BulletFlags._0_4_ = baseBulletFlags; uVar2 = Random(); local_f0 = (float)(uVar2 % 0x1e + 0xf); uVar2 = Random(); local_e0 = (float)(uVar2 & 1); iVar1 = 0; local_d4 = (float)((int)local_f0 + -0x39515eff); do { local_d0.x = (npc->_pos).x + 0.0; local_d0.y = (npc->_pos).y - 30.0; laserOffset.x = 0.0; laserOffset.y = 0.0; laser = Entity_Laser::ShootAngle (1,&local_d0,(float)iVar1 * 180.0 + 90.0,0x78,&laserOffset,(Entity *)npc,0 ); laser->_isActiveRotating = 1; laser->_rotationDelay = (int)local_f0; if (local_e0 == 0.0) { fVar3 = -0.3; fVar5 = -1e+09; } else { fVar3 = 0.3; fVar5 = 1e+09; } laser->_rotationDegrees = fVar5; laser->_rotationSpd = fVar3; laser->_timeout = (int)local_d4; (**(code **)(*(int *)laser + 0xc))(); iVar1 = iVar1 + 1; } while (iVar1 < 2); return; } if (stateFrame != (stateFrame / 9) * 9) { return; } local_ec.x = 8.0; fVar3 = 2.8026e-45; LAB_004d417d: projParams.BulletFlags._0_4_ = baseBulletFlags; break; default: goto switchD_004d34fb_default; } local_ec.y = (float)(int)fVar3; Entity_NPC::FireProjectiles(npc,&firePos,&local_ec,9,&projParams); switchD_004d34fb_default: return; } //@@ 004d4210 FUN_004d4210 void FUN_004d4210(int param_1,char param_2) { float fVar1; float fVar2; float fVar3; float fVar4; if (param_2 == '\0') { fVar2 = cos((*(float *)(param_1 + 0x3a4) * 6.2831855) / 30.0); fVar4 = (*(float *)(param_1 + 0x3a4) - 0.0) / 120.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } fVar3 = 1.022; if (1.0 <= fVar4) { fVar4 = 1.0; } fVar1 = *(float *)(param_1 + 0x39c); *(float *)(param_1 + 0x428) = (0.06 - fVar4 * 0.048) * fVar2; if (fVar1 != 1.0) { fVar3 = 1.022 / ((fVar1 + 1.022) - fVar1 * 1.022); } *(float *)(param_1 + 0x360) = *(float *)(param_1 + 0x360) * fVar3; *(float *)(param_1 + 0x364) = *(float *)(param_1 + 0x364) * fVar3; } return; } //@@ 004d42f0 FUN_004d42f0 void FUN_004d42f0(int param_1,char param_2) { float fVar1; float fVar2; float fVar3; if (param_2 == '\0') { fVar1 = *(float *)(param_1 + 0x360); fVar2 = cos((*(float *)(param_1 + 0x3a4) * 6.2831855) / 90.0); fVar2 = fVar2 * 10.0 * *(float *)(param_1 + 0x39c) * 0.017453292; fVar3 = cos(fVar2); fVar2 = sin(fVar2); *(float *)(param_1 + 0x360) = fVar1 * fVar3 - *(float *)(param_1 + 0x364) * fVar2; *(float *)(param_1 + 0x364) = fVar1 * fVar2 + *(float *)(param_1 + 0x364) * fVar3; } return; } //@@ 004d43b0 FUN_004d43b0 void FUN_004d43b0(int param_1,char param_2) { float fVar1; float fVar2; float fVar3; if (param_2 == '\0') { fVar1 = *(float *)(param_1 + 0x360); fVar2 = cos((((float)*(int *)(param_1 + 0x448) + *(float *)(param_1 + 0x3a4)) * 6.2831855) / 40.0 + 0.3); fVar2 = fVar2 * 7.0 * *(float *)(param_1 + 0x39c) * 0.017453292; fVar3 = cos(fVar2); fVar2 = sin(fVar2); *(float *)(param_1 + 0x360) = fVar1 * fVar3 - *(float *)(param_1 + 0x364) * fVar2; *(float *)(param_1 + 0x364) = fVar1 * fVar2 + *(float *)(param_1 + 0x364) * fVar3; } return; } //@@ 004d4480 FUN_004d4480 void FUN_004d4480(int param_1,char param_2) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; fVar1 = *(float *)(param_1 + 0x33c) - *(float *)(param_1 + 0x334); fVar3 = *(float *)(param_1 + 0x340) - *(float *)(param_1 + 0x338); if (param_2 == '\0') { fVar4 = 1.0; } else { fVar4 = 0.5; } fVar4 = *(float *)(param_1 + 0x428) * *(float *)(param_1 + 0x39c) * fVar4 * 0.017453292; fVar2 = cos(fVar4); fVar4 = sin(fVar4); fVar5 = (fVar1 * fVar2 - fVar3 * fVar4) + *(float *)(param_1 + 0x334); fVar1 = fVar3 * fVar2 + fVar1 * fVar4 + *(float *)(param_1 + 0x338); *(float *)(param_1 + 0x33c) = fVar5; *(float *)(param_1 + 0x340) = fVar1; if (param_2 == '\0') { fVar5 = fVar5 - *(float *)(param_1 + 0x334); fVar1 = fVar1 - *(float *)(param_1 + 0x338); fVar3 = sqrtf(fVar1 * fVar1 + fVar5 * fVar5); if (0.0 < fVar3) { fVar4 = sqrtf(*(float *)(param_1 + 0x364) * *(float *)(param_1 + 0x364) + *(float *)(param_1 + 0x360) * *(float *)(param_1 + 0x360)); fVar5 = fVar5 * (fVar4 / fVar3); fVar1 = fVar1 * (fVar4 / fVar3); } *(float *)(param_1 + 0x360) = fVar5; *(float *)(param_1 + 0x364) = fVar1; } return; } //@@ 004d4610 NpcHelper::moms_heart_pick_attack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: NpcAI::ENTITY_MOMS_HEART (state 4 after frame 0x1f): picks a random attack id into V1.y from ranges by subtype/variant (I1==5 -> 8), state 8, SpawnFollowingEffect198 */ Entity_Effect * NpcHelper::moms_heart_pick_attack(void) { byte finalAttack; uint attackRoll; Entity_Effect *pEVar1; Entity *in_ECX; int maxAttack; uint attackRange; int iVar2; float fVar3; Vector local_48; Vector local_40; float local_38; ColorMod splatColor; float local_8; float maxHitPoints; local_8 = (float)(__security_cookie ^ (uint)((&splatColor)[1]._tint + 1)); iVar2 = 0; maxAttack = 7; local_38 = (float)in_ECX->_subtype; if (local_38 == 1.4013e-45) { iVar2 = 10; maxAttack = 0x11; } if (*(int *)&in_ECX[2].field_0x3a8 == 5) { iVar2 = 8; attackRange = 1; } else { in_ECX[2]._posOffset.x = 1.12104e-44; pEVar1 = (Entity_Effect *)in_ECX[2]._renderZOffset; if (pEVar1 == (Entity_Effect *)0x1) { maxAttack = 3; pEVar1 = (Entity_Effect *)&DAT_0000000d; if (local_38 == 1.4013e-45) { maxAttack = 0xd; } } else if (pEVar1 == (Entity_Effect *)0x2) { pEVar1 = (Entity_Effect *)&DAT_0000000e; iVar2 = 2; if (local_38 == 1.4013e-45) { iVar2 = 0xe; } } attackRange = (maxAttack - iVar2) + 1; if (attackRange == 0) { attackRoll = 0; goto LAB_004d4664; } } attackRoll = Random(); pEVar1 = (Entity_Effect *)(attackRoll / attackRange); attackRoll = attackRoll % attackRange; LAB_004d4664: in_ECX[2]._speedMultiplier = (float)((double)(int)attackRoll + __uint_to_double_fixup[-((int)attackRoll >> 0x1f)]) + (float)iVar2; fVar3 = in_ECX->_health; maxHitPoints = in_ECX->_maxHitPoints; *(undefined4 *)&in_ECX[1].field_0x4 = 0; if (fVar3 / maxHitPoints <= 0.2) { finalAttack = 9; if (local_38 == 1.4013e-45) { finalAttack = 0x12; } fVar3 = (float)finalAttack; in_ECX[2]._speedMultiplier = fVar3; if (fVar3 == 9.0) { iVar2 = 0; local_48.y = -20.0; local_48.x = 0.0; do { splatColor._offset[0] = 0.0; splatColor._colorize[0] = 0.0; splatColor._colorize[1] = 0.0; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 0.0; splatColor._offset[1] = 0.0; splatColor._tint[0] = 0.6; splatColor._tint[1] = 0.05; splatColor._tint[2] = 0.0; splatColor._tint[3] = 0.8; splatColor._offset[2] = 0.0; local_38 = ((float)iVar2 * 90.0 - 135.0) * 0.017453292; local_40.x = cos(local_38); local_40.y = sin(local_38); pEVar1 = Entity::SpawnFollowingEffect198(in_ECX,&local_48,&local_40,0xc,&splatColor,4.0); iVar2 = iVar2 + 1; } while (iVar2 < 4); return pEVar1; } pEVar1 = (Entity_Effect *) (uint)CONCAT11((fVar3 == 18.0) << 6 | NAN(fVar3) << 2 | 2U | fVar3 < 18.0,finalAttack); if (fVar3 == 18.0) { iVar2 = 0; local_40.y = -20.0; local_40.x = 0.0; do { splatColor._offset[0] = 0.0; splatColor._colorize[0] = 0.0; splatColor._colorize[1] = 0.0; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 0.0; splatColor._offset[1] = 0.0; splatColor._tint[0] = 0.6; splatColor._tint[1] = 0.05; splatColor._tint[2] = 0.0; splatColor._tint[3] = 0.8; splatColor._offset[2] = 0.0; local_38 = ((float)iVar2 * 180.0 + 90.0) * 0.017453292; local_48.x = cos(local_38); local_48.y = sin(local_38); pEVar1 = Entity::SpawnFollowingEffect198(in_ECX,&local_40,&local_48,0xc,&splatColor,4.0); iVar2 = iVar2 + 1; } while (iVar2 < 2); } } return pEVar1; } //@@ 004d48b0 NpcAI::ENTITY_MOMS_HEART /* NPC AI for entity type 78 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOMS_HEART(Entity_NPC *npc) { undefined4 uVar1; qword qVar2; byte bVar3; char cVar4; uint uVar5; int iVar6; Entity_Player *player; Vector *pVVar7; Entity *spawned; EntityPtr childHeart; int *piVar8; int shockwaveSlot; byte *pbVar9; byte *pbVar10; uint uVar11; int iVar12; int queryIndex; char *pcVar13; uint *patternEntry; qword *heapAllocatedBytes; bool bVar14; float fVar15; EntityPtr *pEVar16; Vector followPos; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; float local_94; float local_90; float local_8c; float local_88; undefined4 local_84; undefined4 local_80; EntityPtr local_7c; EntityPtr local_78; EntityPtr local_74; EntityPtr local_70; float local_6c; float local_68; float local_64; float local_60; uint local_5c; EntityPtr local_58; int elapsedFrames; float deathPitch; Vector local_4c; Vector local_44; undefined1 local_3c [12]; code *local_30; int subtype; EntityPtr local_28; Vector local_24; float local_1c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Room *clampRoom; Entity_Familiar *familiar; Game *game; int heartPhase; Manager *manager; void *room; local_8 = 0xffffffff; puStack_c = &LAB_00af3880; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_3c + 0x38); local_28 = (EntityPtr)npc; if (npc->_variant == 10) { if (npc->_state == 0) { uVar1 = *(undefined4 *)((int)&npc->_flags + 4); npc->_entityGridCollisionClass = 0; npc->_entityCollisionClass = 0; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb | 0x40011; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; npc->_state = 3; return; } local_7c = npc->_parent; if (local_7c == (EntityPtr)0x0) { local_6c = g_vectorZero.x; local_64 = g_vectorZero.x; local_68 = g_vectorZero.y; local_60 = g_vectorZero.y; local_5c = 0; local_58 = (EntityPtr)0x0; ExceptionList = &local_10; local_78 = local_7c; local_74 = local_7c; local_70 = local_7c; (**(code **)(*(int *)npc + 0x24))(&local_7c); ExceptionList = local_10; return; } ExceptionList = &local_10; (npc->_pos).y = 255.0; iVar6 = __RTDynamicCast(local_7c,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar5); switch(*(undefined4 *)(iVar6 + 0xbc0)) { case 1: ANM2::Play(&npc->_sprite,(byte *)"Heartbeat1",0); ExceptionList = local_10; return; case 2: ANM2::Play(&npc->_sprite,(byte *)"Heartbeat2",0); ExceptionList = local_10; return; case 3: ANM2::Play(&npc->_sprite,(byte *)"Heartbeat3",0); ExceptionList = local_10; return; case 4: ANM2::Play(&npc->_sprite,(byte *)"HeartSummon",0); ExceptionList = local_10; return; case 5: ANM2::Play(&npc->_sprite,(byte *)"HeartRetracted",0); ExceptionList = local_10; return; default: ExceptionList = local_10; return; } } subtype = npc->_subtype; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; ExceptionList = &local_10; uVar5 = Random(); deathPitch = 1.0; if ((float)(uVar5 % 0x14 + 10) + 0.0 < npc->_pendingDamage) { uVar5 = Random(); Entity_NPC::PlaySound(npc,0x57,1.0,uVar5 % 0x1e + 0x19,0,1.0); } if (npc->_state == 0) { if (-1 < npc->_spawnGridIndex) { uVar5 = 0; local_44.y = (npc->_pos).x; local_30 = (code *)0x43b90000; local_3c._8_4_ = local_44.y; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { if (uVar5 == 0) { player = Game::GetPlayer(g_game,0); pVVar7 = (Vector *)(local_3c + 8); } else { player = Game::GetPlayer(g_game,uVar5); uVar11 = Random(); fVar15 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_18.y = fVar15 + fVar15; local_24.y = sin(local_18.y); fVar15 = cos(local_18.y); pVVar7 = &local_4c; local_4c.x = fVar15 * 20.0 + local_44.y; local_4c.y = local_24.y * 20.0 + 370.0; } Entity_Player::Teleport(player,pVVar7,0,0); uVar5 = uVar5 + 1; } while (uVar5 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } uVar5 = 0; room = g_game->_room; if (*(int *)((int)room + 0x1264) != 0) { do { familiar = *(Entity_Familiar **)(*(int *)((int)room + 0x125c) + uVar5 * 4); if ((familiar != (Entity_Familiar *)0x0) && (familiar->_type == 3)) { pVVar7 = Entity_Familiar::GetFollowTargetPosition(familiar,&followPos,0); (familiar->_pos).x = pVVar7->x; (familiar->_pos).y = pVVar7->y; } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)room + 0x1264)); npc = (Entity_NPC *)local_28; } } ((Vector *)((int)npc + 0x334))->x = ((Vector *)((int)npc + 0x33c))->x; *(float *)((int)npc + 0x338) = *(float *)((int)npc + 0x340); *(int *)((int)npc + 0xbc4) = -1; *(int *)((int)npc + 0xb6c) = 4; *(int *)((int)npc + 0xbc0) = 1; *(int *)((int)npc + 0xba4) = 0; ((Vector *)((int)npc + 0xbb0))->x = 100.0; *(int *)((int)npc + 0xba0) = 0; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xb64) = 3; if (subtype == 1) { fVar15 = *(float *)((int)npc + 900) * 1.4; *(float *)((int)npc + 900) = fVar15; *(float *)((int)npc + 0x380) = fVar15; } if (*(int *)((int)npc + 0x2c) != 10) { uVar5 = Random(); local_3c._8_4_ = ((Vector *)((int)npc + 0x33c))->x - 0.0; local_30 = (code *)(*(float *)((int)npc + 0x340) - -1.0); spawned = Game::SpawnEx(g_game,*(int *)((int)npc + 0x28),10,(Vector *)(local_3c + 8), &g_vectorZero,(Entity *)npc,0,uVar5,0); childHeart = (EntityPtr) __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); pEVar16 = (EntityPtr *)((int)childHeart + 0x3bc); if (*(int *)((int)childHeart + 0x3bc) != 0) { local_18.y = (float)pEVar16; std::multiset::erase(&local_18.y); } *pEVar16 = (EntityPtr)npc; std::multiset::insert(pEVar16); pEVar16 = (EntityPtr *)((int)npc + 0x3c0); if (*(EntityPtr *)((int)npc + 0x3c0) != (EntityPtr)0x0) { local_18.y = (float)pEVar16; std::multiset::erase(&local_18.y); } *pEVar16 = childHeart; std::multiset::insert(pEVar16); (**(code **)(*(int *)childHeart + 0xc))(); } } pVVar7 = (Vector *)((int)npc + 0x33c); *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; fVar15 = pVVar7->x; *(float *)((int)npc + 0x364) = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); *(float *)((int)npc + 0x360) = *(float *)((int)npc + 0x334) - fVar15; if (0.0 < *(float *)((int)npc + 0x14)) { *(float *)((int)npc + 0xbb0) = *(float *)((int)npc + 0xbb0) - 3.0; } if (*(int *)((int)npc + 0xb6c) == 3) { uVar5 = Random(); local_18.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; uVar5 = Random(); spawned = Game::SpawnEx(g_game,1000,7,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar5,0); piVar8 = (int *)__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); piVar8[0x39] = (int)local_18.y; piVar8[0x3a] = (int)local_18.y; (**(code **)(*piVar8 + 0xc))(); } iVar12 = 4 - (int)((*(float *)((int)npc + 0x380) / *(float *)((int)npc + 900)) * 3.0 + 0.95); iVar6 = 3; if (iVar12 < 3) { iVar6 = iVar12; } *(int *)((int)npc + 0xb6c) = iVar6; if (*(int *)((int)npc + 0xbc4) != iVar6) { *(undefined4 *)((int)npc + 0xba4) = 0; } local_28 = (EntityPtr)0x3c23d70a; if ((*(int *)((int)npc + 0x7c) != 0) && (bVar3 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"Heartbeat"), bVar3 != 0)) { local_1c = 0.1; iVar6 = *(int *)((int)npc + 0xb6c); local_4c.y = pVVar7->x; local_30 = *(code **)((int)npc + 0x340); local_44.y = 7.00649e-45; if (*(int *)((int)npc + 0xbc0) == 5) { LAB_004d51d1: manager = g_manager; local_24.y = 0.1; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 0.6; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.05; } local_18.y = 1.00893e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,0.5,2,0,local_24.y,0.0); local_24.y = 1.0; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 1.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.5; } local_18.y = 4.49817e-43; LAB_004d5284: manager = g_manager; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,2,0,local_24.y,0.0); } else { if ((*(int *)((int)npc + 0xbc0) == 4) || (iVar6 == 1)) { Game::ShakeScreen(g_game,3); local_1c = 0.02; local_28 = (EntityPtr)0x3c03126f; local_44.y = 6.72623e-44; goto LAB_004d51d1; } if (iVar6 == 2) { Game::ShakeScreen(g_game,3); manager = g_manager; local_1c = 0.025; local_28 = (EntityPtr)0x3c03126f; local_24.y = 0.15; local_44.y = 4.2039e-44; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 0.65; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.075; } local_18.y = 1.00893e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,0.5,2,0,local_24.y,0.0); local_24.y = 1.0; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 1.5; local_18.y = 4.51218e-43; } else { if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.5; } local_18.y = 4.51218e-43; } goto LAB_004d5284; } if (iVar6 == 3) { Game::ShakeScreen(g_game,4); manager = g_manager; local_1c = 0.03; local_28 = (EntityPtr)0x3c03126f; local_24.y = 0.2; local_44.y = 1.68156e-44; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 0.7; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.1; } local_18.y = 1.00893e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,0.5,2,0,local_24.y,0.0); local_24.y = 1.0; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 1.5; local_18.y = 4.52619e-43; } else { if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.5; } local_18.y = 4.52619e-43; } goto LAB_004d5284; } } room = g_game->_room; *(int *)((int)room + 0x70fc) = *(int *)((int)room + 0x70fc) + 1; uVar5 = *(uint *)((int)room + 0x70fc) & 0x80000001; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffe) + 1; } if (1 < uVar5) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } iVar6 = uVar5 + 0x407; *(float *)((int)room + iVar6 * 0x1c) = local_4c.y; *(code **)((int)room + iVar6 * 0x1c + 4) = local_30; *(EntityPtr *)((int)room + iVar6 * 0x1c + 0xc) = local_28; *(undefined4 *)((int)room + iVar6 * 0x1c + 8) = 0; *(float *)((int)room + iVar6 * 0x1c + 0x10) = local_1c; *(undefined4 *)((int)room + iVar6 * 0x1c + 0x14) = 0; *(float *)((int)room + iVar6 * 0x1c + 0x18) = local_44.y; } manager = g_manager; iVar6 = *(int *)((int)npc + 0xb6c); local_28 = (EntityPtr)0xb1f100; if (iVar6 - 1U < 3) { if (subtype == 1) { local_28 = (EntityPtr)(&DAT_00b1eea0 + iVar6 * 8); } else { local_28 = (EntityPtr)(iVar6 * 8 + 0xb1efc0); if (*(int *)((int)npc + 0x2c) != 1) { local_28 = (EntityPtr)(iVar6 * 8 + 0xb1eee8); } } } iVar12 = *(int *)((int)npc + 0xba4); patternEntry = (uint *)(iVar12 * 0x10 + *(int *)((int)local_28 + 4)); if (*(int *)((int)npc + 0xb64) == 3) { heartPhase = *(int *)((int)npc + 0xbc0); if (heartPhase == 5) { LAB_004d53cf: if ((*(int *)((int)npc + 0xba0) < 0x28) || (((iVar6 == 3 && (*(int *)((int)npc + 0xbc4) == 2)) && (heartPhase == 5)))) { local_24.y = 1.0; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 1.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.5; } local_18.y = 2.98477e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,2,0,local_24.y,0.0); manager = g_manager; local_24.y = 1.0; if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 1.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.5; } local_18.y = 1.26117e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,0x2d,0,local_24.y,0.0); game = g_game; *(undefined4 *)((int)npc + 0xbb0) = 0x42c80000; *(undefined4 *)((int)npc + 0xbc0) = 4; *(undefined4 *)((int)npc + 0x410) = 0; Game::ShakeScreen(game,0xf); local_30 = *(code **)((int)npc + 0x33c); local_4c.y = *(float *)((int)npc + 0x340); room = g_game->_room; *(int *)((int)room + 0x70fc) = *(int *)((int)room + 0x70fc) + 1; local_18.y = (float)(*(uint *)((int)room + 0x70fc) & 0x80000001); if ((int)local_18.y < 0) { local_18.y = (float)(((uint)&((EntityPtr *)((int)local_18.y + -4))->field_0x3 | 0xfffffffe ) + 1); } if ((EntityPtr *)0x1 < (uint)local_18.y) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } shockwaveSlot = (int)&((EntityPtr *)((int)local_18.y + 0x404))->field_0x3; *(code **)((int)room + shockwaveSlot * 0x1c) = local_30; *(float *)((int)room + shockwaveSlot * 0x1c + 4) = local_4c.y; *(undefined4 *)((int)room + shockwaveSlot * 0x1c + 8) = 0; *(undefined4 *)((int)room + shockwaveSlot * 0x1c + 0xc) = 0x3c23d70a; *(undefined4 *)((int)room + shockwaveSlot * 0x1c + 0x10) = 0x3c75c28f; *(undefined4 *)((int)room + shockwaveSlot * 0x1c + 0x14) = 0; *(undefined4 *)((int)room + shockwaveSlot * 0x1c + 0x18) = 100; iVar6 = *(int *)((int)npc + 0xba4) + 1; *(int *)((int)npc + 0xba4) = iVar6; if (*(int *)local_28 <= iVar6) { iVar6 = *(int *)local_28 + -1; if (subtype != 1) { iVar6 = 0; } LAB_004d5684: *(int *)((int)npc + 0xba4) = iVar6; } } } else if (heartPhase == 4) { if (*(int *)((int)npc + 0x410) < 0x1f) { if (iVar6 == 3) goto LAB_004d53cf; } else { NpcHelper::moms_heart_pick_attack(); } } else { *(int *)((int)npc + 0xbc0) = iVar6; *(undefined4 *)((int)npc + 0x410) = 0; fVar15 = *(float *)((int)npc + 0xbb0) - 1.0; *(float *)((int)npc + 0xbb0) = fVar15; if ((fVar15 < 0.0) && (iVar6 != 3)) { if ((subtype == 1) && ((iVar6 != 1 || (iVar12 != 0)))) { *(int *)((int)npc + 0xba4) = iVar12 + 1; if (*(int *)local_28 <= iVar12 + 1) { iVar6 = *(int *)local_28 + -1; goto LAB_004d5684; } } else { Entity_NPC::PlaySound(npc,0xd4,1.0,2,0,1.0); *(undefined4 *)((int)npc + 0xbc0) = 5; *(undefined4 *)((int)npc + 0x410) = 0; NpcHelper::moms_heart_pick_attack(); } } } } if (*(int *)((int)npc + 0xbc0) == 5) { *(undefined4 *)((int)npc + 0x188) = 0; *(undefined4 *)((int)npc + 0x15c) = 0; NpcHelper::moms_heart_attack_pattern (npc,(int)*(float *)((int)npc + 0xbb4),*(int *)((int)npc + 0x410)); if ((*patternEntry & 0xffffff) != 0) { iVar12 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar6 = 0; if (0 < iVar12) { iVar6 = iVar12; } if (((int)patternEntry[2] <= iVar6 + -2) || ((float)(int)patternEntry[3] < *(float *)((int)npc + 3000) || (float)(int)patternEntry[3] == *(float *)((int)npc + 3000))) goto LAB_004d56cb; uVar5 = Random(); uVar11 = 0; local_44.x = *(float *)((int)g_game->_room + 0x14) + 30.0; local_44.x = ((*(float *)((int)g_game->_room + 0x1c) - 30.0) - local_44.x) * (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 + local_44.x; do { if ((local_44.x < *(float *)((int)npc + 0x33c) - *(float *)((int)npc + 0x370)) || (*(float *)((int)npc + 0x33c) + *(float *)((int)npc + 0x370) < local_44.x)) break; uVar5 = Random(); uVar11 = uVar11 + 1; local_44.x = *(float *)((int)g_game->_room + 0x14) + 30.0; local_44.x = ((*(float *)((int)g_game->_room + 0x1c) - 30.0) - local_44.x) * (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 + local_44.x; } while (uVar11 < 0x14); local_44.y = *(float *)((int)g_game->_room + 0x18) + 30.0; pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_3c + 8),&local_44,0.0,0,0,0); local_44.x = pVVar7->x; local_44.y = pVVar7->y; uVar5 = Random(); Game::SpawnEx(g_game,*patternEntry & 0xffffff,(int)*patternEntry >> 0x18,&local_44, &g_vectorZero,(Entity *)npc,0,uVar5,0); } *(float *)((int)npc + 3000) = *(float *)((int)npc + 3000) + 1.0; } else if ((*(int *)((int)npc + 0xbc0) == 4) && (*(int *)((int)npc + 0x410) < 6)) { *(undefined4 *)((int)npc + 0x188) = 0; *(undefined4 *)((int)npc + 0x15c) = 0; } else { *(undefined4 *)((int)npc + 0x188) = 4; *(undefined4 *)((int)npc + 0x15c) = *(undefined4 *)(*(int *)((int)npc + 0x330) + 0x24); } LAB_004d56cb: game = g_game; iVar12 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar6 = 0; if (0 < iVar12) { iVar6 = iVar12; } if (((iVar6 < 3) && (*(int *)((int)npc + 0xb64) != 8)) || ((*(int *)((int)npc + 0xb6c) == 3 && ((*patternEntry & 0xffffff) == 0)))) { *(int *)((int)npc + 0xba0) = *(int *)((int)npc + 0xba0) - elapsedFrames; } manager = g_manager; if (*(int *)((int)npc + 0xb64) == 3) { if (*(int *)((int)npc + 0xba0) < 0) { uVar5 = *patternEntry & 0xffffff; if ((uVar5 == 0) || (*(float *)((int)npc + 0x380) / *(float *)((int)npc + 900) <= 0.2)) { if (subtype == 1) { room = game->_room; fVar15 = 0.0; uVar5 = 0; local_1c = 0.0; if (*(int *)((int)room + 0x1264) != 0) { do { iVar12 = *(int *)((int)room + 0x125c); iVar6 = *(int *)(iVar12 + uVar5 * 4); if (*(int *)(iVar6 + 0x28) == 9) { local_30 = *(code **)(iVar6 + 0x33c); local_4c.y = *(float *)(iVar6 + 0x340); clampRoom = g_game->_room; local_18.x = (float)local_30; local_18.y = local_4c.y; if (*(int *)(*(int *)((int)clampRoom->_descriptor + 0x10) + 0x48) - 9U < 4) { Room::GetClampedPositionImpl(clampRoom,&local_24,&local_18,20.0,20.0,20.0,20.0); if ((local_24.x != (float)local_30) || (local_24.y != local_4c.y)) goto LAB_004d5dd5; iVar12 = *(int *)((int)room + 0x125c); } else if (((((float)local_30 < (clampRoom->_topLeftPos).x + 20.0) || ((clampRoom->_bottomRightPos).x - 20.0 < (float)local_30)) || (local_4c.y < (clampRoom->_topLeftPos).y + 20.0)) || ((clampRoom->_bottomRightPos).y - 20.0 < local_4c.y)) { LAB_004d5dd5: fVar15 = local_1c; goto LAB_004d5dd8; } fVar15 = local_1c; if (*(int *)(*(int *)(iVar12 + uVar5 * 4) + 0x34) == *(int *)((int)npc + 0x28)) { local_1c = (float)((int)local_1c + 1); fVar15 = local_1c; } } LAB_004d5dd8: uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)room + 0x1264)); } if (0x11 < (int)fVar15) { *(undefined4 *)((int)npc + 0xba0) = 0xf; goto LAB_004d5f35; } } iVar6 = subtype; NpcHelper::moms_heart_pick_attack(); *(undefined4 *)((int)npc + 0xba0) = 0x4b; iVar12 = *(int *)((int)npc + 0xba4) + 1; *(int *)((int)npc + 0xba4) = iVar12; if (*(int *)local_28 <= iVar12) { iVar12 = *(int *)local_28 + -1; if (iVar6 != 1) { iVar12 = 0; } *(int *)((int)npc + 0xba4) = iVar12; } *(undefined4 *)((int)npc + 0xbc4) = *(undefined4 *)((int)npc + 0xb6c); } else { if (uVar5 == 0x3c) { pcVar13 = game->_room; if ((*pcVar13 != '\0') && (99 < g_game->_frameCount - *(int *)(pcVar13 + 0x11f0))) goto LAB_004d5790; LAB_004d59fd: local_1c = 180.0; } else { if (uVar5 == 0xe7) goto LAB_004d59fd; LAB_004d5790: local_1c = 40.0; } local_24.y = 1.0; local_30 = (code *)((float)*(int *)((int)npc + 0xb6c) * 0.1 + 1.0); if (*(int *)((int)npc + 0xc64) == 0x12) { local_24.y = 1.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_24.y = 0.5; } local_18.y = 3.71344e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,(float)local_30,2,0,local_24.y,0.0) ; if ((*patternEntry & 0xffffff) == 0x1c) { uVar5 = Random(); local_1c = local_1c + local_1c; local_3c._8_4_ = *(float *)((int)npc + 0x33c) + 0.0; local_30 = (code *)(local_1c + *(float *)((int)npc + 0x340)); Game::SpawnEx(g_game,*patternEntry & 0xffffff,(int)*patternEntry >> 0x18, (Vector *)(local_3c + 8),&g_vectorZero,(Entity *)npc,0,uVar5,0); uVar5 = Random(); local_3c._8_4_ = *(float *)((int)npc + 0x33c) + 0.0; local_30 = (code *)(local_1c + *(float *)((int)npc + 0x340)); Game::SpawnEx(g_game,*patternEntry & 0xffffff,(int)*patternEntry >> 0x18, (Vector *)(local_3c + 8),&g_vectorZero,(Entity *)npc,0,uVar5,0); uVar5 = Random(); local_3c._8_4_ = *(float *)((int)npc + 0x33c) + 0.0; local_30 = (code *)(local_1c + *(float *)((int)npc + 0x340)); Game::SpawnEx(g_game,*patternEntry & 0xffffff,(int)*patternEntry >> 0x18, (Vector *)(local_3c + 8),&g_vectorZero,(Entity *)npc,0,uVar5,0); } else { *(undefined4 *)((int)npc + 3000) = 0; iVar6 = 0; uVar5 = patternEntry[1]; if (0 < (int)uVar5) { do { if (uVar5 == 1) { fVar15 = 1.0; pEVar16 = (EntityPtr *)0x0; } else { local_30 = (code *)(((float)iVar6 / (float)(int)(uVar5 - 1)) * 3.1415927); local_4c.y = cos((float)local_30); fVar15 = sin((float)local_30); fVar15 = fVar15 * 0.8; pEVar16 = (EntityPtr *)local_4c.y; } local_24.x = (float)pEVar16 * local_1c + *(float *)((int)npc + 0x33c); local_24.y = fVar15 * local_1c + *(float *)((int)npc + 0x340); uVar5 = Random(); Game::SpawnEx(g_game,*patternEntry & 0xffffff,(int)*patternEntry >> 0x18,&local_24, &g_vectorZero,(Entity *)npc,0,uVar5,0); iVar6 = iVar6 + 1; *(float *)((int)npc + 3000) = *(float *)((int)npc + 3000) + 1.0; uVar5 = patternEntry[1]; } while (iVar6 < (int)uVar5); } } *(undefined4 *)((int)npc + 0xba0) = 0x4b; if (*(int *)((int)npc + 0xb6c) == 3) { iVar6 = *(int *)((int)npc + 0xba4) + 1; *(int *)((int)npc + 0xba4) = iVar6; if (*(int *)local_28 <= iVar6) { iVar6 = *(int *)local_28 + -1; if (subtype != 1) { iVar6 = 0; } *(int *)((int)npc + 0xba4) = iVar6; } } *(int *)((int)npc + 0xbc4) = *(int *)((int)npc + 0xb6c); } } } else if (*(int *)((int)npc + 0xb64) == 8) { NpcHelper::moms_heart_attack_pattern (npc,(int)*(float *)((int)npc + 0xbb4),*(int *)((int)npc + 0x410)); bVar14 = false; *(undefined4 *)((int)npc + 0xbc0) = *(undefined4 *)((int)npc + 0xb6c); if ((*(float *)((int)npc + 0xbb4) == 9.0) || (*(float *)((int)npc + 0xbb4) == 18.0)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_3c,7,1,-1,0,0); queryIndex = 0; bVar14 = false; if (local_30 != (code *)0x0) { do { if (*(int *)(*(int *)(local_3c._4_4_ + queryIndex * 4) + 0x34) == 0x4e) { bVar14 = true; break; } queryIndex = queryIndex + 1; } while ((uint)queryIndex < local_30); } if (local_3c[0] == '\0') { if (g_mainHeap == (void *)0x0) { heapAllocatedBytes = &g_allocatedBytesNoHeap; } else { heapAllocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_3c._4_4_ != (void *)0x0) { uVar5 = *(uint *)(local_3c._4_4_ + -4); qVar2 = *heapAllocatedBytes; *(uint *)heapAllocatedBytes = (uint)*heapAllocatedBytes - uVar5; *(uint *)((int)heapAllocatedBytes + 4) = *(uint *)((int)heapAllocatedBytes + 4) - (uint)((uint)qVar2 < uVar5); free((void *)(local_3c._4_4_ + -4)); } local_8 = 0xffffffff; } } if ((0xb4 < *(int *)((int)npc + 0x410)) && (!bVar14)) { *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0; } } LAB_004d5f35: switch(*(undefined4 *)((int)npc + 0xbc0)) { case 1: pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar10 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar10 = *(byte **)pbVar9; } pcVar13 = "Heartbeat1"; do { bVar3 = *pbVar10; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_004d5f82: uVar5 = -(uint)bVar14 | 1; goto LAB_004d5f87; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d5f82; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004d5f87: if ((uVar5 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004d6218; } pcVar13 = "Heartbeat1"; break; case 2: pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar10 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar10 = *(byte **)pbVar9; } pcVar13 = "Heartbeat2"; do { bVar3 = *pbVar10; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_004d5fe2: uVar5 = -(uint)bVar14 | 1; goto LAB_004d5fe7; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d5fe2; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004d5fe7: if ((uVar5 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004d6218; } pcVar13 = "Heartbeat2"; break; case 3: pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar10 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar10 = *(byte **)pbVar9; } pcVar13 = "Heartbeat3"; do { bVar3 = *pbVar10; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_004d6042: uVar5 = -(uint)bVar14 | 1; goto LAB_004d6047; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d6042; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004d6047: if ((uVar5 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004d6218; } pcVar13 = "Heartbeat3"; break; case 4: pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar10 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar10 = *(byte **)pbVar9; } pcVar13 = "HeartComedown"; do { bVar3 = *pbVar10; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_004d60a2: uVar5 = -(uint)bVar14 | 1; goto LAB_004d60a7; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d60a2; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004d60a7: if ((uVar5 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004d6218; } pcVar13 = "HeartComedown"; break; case 5: if (*(int *)((int)npc + 0x7c) != 0) { pbVar9 = *(byte **)((int)npc + 0x7c); if (*(char *)((int)npc + 0x8c) == '\0') { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar13 = "HeartRetracted"; do { bVar3 = *pbVar9; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) goto LAB_004d6140; if (bVar3 == 0) goto LAB_004d613c; bVar3 = pbVar9[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d6140; pbVar9 = pbVar9 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; } else { if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar13 = "HeartHidingHeartbeat"; do { bVar3 = *pbVar9; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) goto LAB_004d6140; if (bVar3 == 0) break; bVar3 = pbVar9[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d6140; pbVar9 = pbVar9 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); LAB_004d613c: uVar5 = 0; } goto LAB_004d6145; } goto LAB_004d61a3; default: goto LAB_004d6218; } LAB_004d61fd: bVar3 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)pcVar13,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(undefined1 *)((int)npc + 0x8c) = 1; } LAB_004d6218: manager = g_manager; if (*(char *)((int)npc + 0x173) != '\0') { if (*(int *)((int)npc + 0xc64) == 0x12) { deathPitch = 1.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { deathPitch = 0.5; } local_18.y = 1.1911e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,2,0,deathPitch,0.0); local_18.y = 0.0; local_4c.y = (float)g_game->_room; if (*(int *)((int)local_4c.y + 0x1264) != 0) { do { piVar8 = *(int **)(*(int *)((int)local_4c.y + 0x125c) + (int)local_18.y * 4); if ((((*(int *)&g_game->_deathmatchManager < 2) || (piVar8[10] != 1)) && (0x3dd < piVar8[10] - 10U)) || (((cVar4 = (**(code **)(*piVar8 + 0x48))(), cVar4 == '\0' || (piVar8[10] == 0x362)) || ((piVar8[0x5a] & 0x20000000U) != 0)))) { bVar14 = false; } else { bVar14 = true; } if (bVar14) { local_6c = *(float *)((int)npc + 0x33c); local_68 = *(float *)((int)npc + 0x340); local_30 = *(code **)(*piVar8 + 0x24); local_7c = *(EntityPtr *)((int)npc + 0x28); local_78 = *(EntityPtr *)((int)npc + 0x2c); local_74 = *(EntityPtr *)((int)npc + 0x34); local_70 = *(EntityPtr *)((int)npc + 0x38); local_64 = *(float *)((int)npc + 0x360); local_60 = *(float *)((int)npc + 0x364); if ((*(uint *)((int)npc + 0x168) & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((*(uint *)((int)npc + 0x16c) & 0x400000) == 0) { uVar11 = 0; } else { uVar11 = 4; } local_5c = uVar11 | uVar5 | (uint)((*(uint *)((int)npc + 0x168) & 0x100) != 0); local_58 = (EntityPtr)npc; (*local_30)(&local_7c); } local_18.y = (float)((int)local_18.y + 1); } while ((uint)local_18.y < (uint)*(float *)((int)local_4c.y + 0x1264)); } if (*(int **)((int)npc + 0x3c0) != (int *)0x0) { local_a4 = 0; local_a0 = 0; local_90 = g_vectorZero.y; local_88 = g_vectorZero.y; local_9c = 0; local_98 = 0; local_94 = g_vectorZero.x; local_8c = g_vectorZero.x; local_84 = 0; local_80 = 0; (**(code **)(**(int **)((int)npc + 0x3c0) + 0x24))(&local_a4); } game = g_game; room = g_game->_room; *(undefined4 *)((int)room + 0x7214) = 0x1e; *(undefined4 *)((int)room + 0x7218) = 7; iVar6 = game->_stageType; if (((iVar6 == 4) || (iVar6 == 5)) && (((*(uint *)((int)npc + 0x168) & 0x20000000) == 0 && (g_game->_currentRoomIdx == -10)))) { ENTITY_MOMS_HEART_mausoleum_death((Entity_NPC *)game); } } *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + elapsedFrames; ExceptionList = local_10; return; LAB_004d6140: uVar5 = -(uint)bVar14 | 1; LAB_004d6145: if (uVar5 == 0) { pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar10 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar10 = *(byte **)pbVar9; } pcVar13 = "HeartHidingHeartbeat"; do { bVar3 = *pbVar10; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_004d6180: uVar5 = -(uint)bVar14 | 1; goto LAB_004d6185; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d6180; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004d6185: if ((uVar5 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004d6218; } pcVar13 = "HeartHidingHeartbeat"; } else { LAB_004d61a3: pbVar9 = *(byte **)((int)npc + 0x7c); if (pbVar9 != (byte *)0x0) { pbVar10 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar10 = *(byte **)pbVar9; } pcVar13 = "HeartRetracted"; do { bVar3 = *pbVar10; bVar14 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_004d61e0: uVar5 = -(uint)bVar14 | 1; goto LAB_004d61e5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar14 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_004d61e0; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004d61e5: if ((uVar5 == 0) && ((pbVar9[0x34] == 0 || (*(char *)((int)npc + 0x8c) != '\0')))) goto LAB_004d6218; } pcVar13 = "HeartRetracted"; } goto LAB_004d61fd; } //@@ 004d64f0 NpcAI::ENTITY_MOMS_HEART_mausoleum_death /* DB: ? once from ENTITY_MOMS_HEART when stage type 4/5 (Mausoleum/Gehenna), room idx -10 and not friendly: ShakeScreen(50), sound, writes a room descriptor entry (level +0x29fbc index * 0x184 + 0x2a13c), FUN_004d7530 + EntitySaveState::copy of room entities, Game::UpdateVisibility (opens the path to Corpse) */ void __fastcall NpcAI::ENTITY_MOMS_HEART_mausoleum_death(Entity_NPC *npc) { uint *puVar1; void *pvVar2; code *pcVar3; qword qVar4; char isLastRef; undefined4 *puVar5; int *savedEntity; int iVar6; byte rngShift1; byte rngShift2; byte rngShift3; int gridWidth; uint rngResult; uint uVar7; undefined4 uVar8; int *roomDesc; undefined4 uVar9; undefined4 uVar10; float offsetDist; undefined1 local_150 [4]; undefined4 effectSaveState; undefined4 effectVariant; undefined4 local_144; undefined4 local_140; undefined4 local_13c; undefined4 uStack_138; undefined4 uStack_134; undefined4 uStack_130; undefined4 local_12c; undefined4 local_128; float effectPosX; float effectPosY; undefined4 local_11c; uint effectSeed; uint local_114; undefined4 local_110; undefined4 local_10c; undefined4 local_104; undefined4 local_100; undefined4 local_fc; undefined4 local_f8; undefined4 local_f4; undefined4 local_f0; undefined1 local_ec; undefined4 local_e8; int *piStack_e4; undefined4 uStack_e0; int *piStack_dc; undefined4 flySaveState; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; undefined4 local_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 local_b4; undefined4 local_b0; float flyPosX; float flyPosY; undefined4 local_a4; uint flySeed; uint local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined1 local_74; undefined4 local_70; int *piStack_6c; undefined4 uStack_68; int *piStack_64; undefined8 local_58; int bossRoomOffset; Game *local_48; uint innerHeight; uint innerWidth; float local_3c; float local_38; undefined8 local_30; int spawnsLeft; undefined4 local_20; float local_1c; float local_18; std_vector *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; int gridY; Manager *manager; EntitySaveState *savedEntitiesEnd; local_8 = 0xffffffff; puStack_c = &LAB_00af38bb; local_10 = ExceptionList; ExceptionList = &local_10; if ((g_game->_gameStateFlags & 0x400000000000) == 0) { Game::ShakeScreen(g_game,0x32); manager = g_manager; local_14 = (std_vector *)0x242; seed_fart_sound_override((int *)&local_14); SoundEffects::Play(&manager->_sfxManager,(int)local_14,1.8,2,0,0.8,0.0); manager = g_manager; (g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]._targetVolume = 0.0; (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._fadeRate = 0.08; (manager->_musicManager)._queuedMusicID = 0; game = g_game; qVar4 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x4000; uVar7 = 0; *(int *)&game->_gameStateFlags = (int)qVar4; do { roomDesc = (int *)((int)g_game->_roomList[0]._doors + (uVar7 - 0x1c)); if ((((roomDesc[4] != 0) && (roomDesc != *(int **)((int)g_game->_room + 4))) && (*(int *)(roomDesc[4] + 8) != 0x1d)) && (*roomDesc != -0x14)) { roomDesc[0x11] = roomDesc[0x11] | 9; roomDesc[0xf] = roomDesc[0xf] | 5; if (roomDesc[0x10] == 0) { roomDesc[0x10] = 1; } savedEntity = (int *)roomDesc[0x1d]; if (savedEntity != (int *)roomDesc[0x1e]) { do { if (*savedEntity == 5) { puVar5 = (undefined4 *)std::vector::erase(local_150,savedEntity); savedEntity = (int *)*puVar5; } else { if (*savedEntity == 0x21) { savedEntity[3] = 1; } savedEntity = savedEntity + 0x1e; } } while (savedEntity != (int *)roomDesc[0x1e]); } } uVar7 = uVar7 + 0xb8; } while (uVar7 < 0x17ac8); local_48 = g_game; iVar6 = g_game->_lastBossRoomListIdx; bossRoomOffset = iVar6 * 0xb8; pvVar2 = g_game->_roomList[iVar6].Data; if ((pvVar2 != (void *)0x0) && ((g_game->_roomList[iVar6].Flags & 1) != 0)) { innerWidth = *(byte *)((int)pvVar2 + 0x46) - 2; innerHeight = *(byte *)((int)pvVar2 + 0x47) - 2; uVar7 = g_game->_roomList[iVar6].SpawnSeed; local_14 = &g_game->_roomList[iVar6].SavedEntities; local_30 = 0xb00000001; local_30._4_4_ = 0xb; local_20 = 6; spawnsLeft = 5; uVar8 = local_30._4_4_; uVar9 = 6; do { uVar10 = local_20; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } rngShift1 = (byte)local_30; uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)uVar8 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)uVar9 & 0x1f) ^ uVar7; rngResult = 0; if (innerWidth != 0) { rngResult = uVar7 % innerWidth; } iVar6 = rngResult + 1; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar8 = local_30._4_4_; uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; rngShift2 = (byte)((ulonglong)local_30 >> 0x20); uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)uVar9 & 0x1f) ^ uVar7; rngResult = 0; if (innerHeight != 0) { rngResult = uVar7 % innerHeight; } gridY = rngResult + 1; local_c4 = 0; uStack_c0 = 0; uStack_bc = 0xffffffff; uStack_b8 = 0xffffffff; local_d0 = 0; flyPosX = g_vectorZero.x; flyPosY = g_vectorZero.y; local_cc = 0; local_c8 = 0; local_b4 = 0; local_b0 = 0; local_a4 = 0; flySeed = 0; local_9c = 0; local_98 = 0; local_94 = 0; local_8c = 0xffffffff; local_88 = 0xffffffff; local_84 = 0x42700000; local_80 = 0x3f800000; local_7c = 0x3f800000; local_78 = 0; local_74 = 1; local_70 = 0; piStack_6c = (int *)0x0; uStack_68 = 0; piStack_64 = (int *)0x0; local_8 = 0; flySaveState = 0xd; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; rngShift3 = (byte)local_20; flySeed = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; pvVar2 = g_game->_room; if (((iVar6 < 0) || (gridWidth = *(int *)((int)pvVar2 + 0xc), gridWidth <= iVar6)) || ((gridY < 0 || (*(int *)((int)pvVar2 + 0x10) <= gridY)))) { gridWidth = *(int *)((int)pvVar2 + 0xc); iVar6 = -1; } else { iVar6 = gridWidth * gridY + iVar6; } local_3c = (float)(iVar6 % gridWidth) * 40.0 + 40.0; local_1c = (float)(iVar6 / gridWidth) * 40.0 + 120.0; local_9c = flySeed; if (flySeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = flySeed >> (rngShift1 & 0x1f) ^ flySeed; local_58 = 0x100000003; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; local_18 = 1.96182e-44; uVar7 = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } rngResult = uVar7 >> 3 ^ uVar7; rngResult = rngResult << 1 ^ rngResult; rngResult = rngResult >> 0xe ^ rngResult; local_18 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283062e-10 * 3.14; local_18 = local_18 + local_18; local_38 = sin(local_18); local_18 = cos(local_18); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)local_30 & 0x1f) ^ uVar7; local_84 = 0x40400000; uStack_bc = 0xffffffff; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; savedEntitiesEnd = *(EntitySaveState **)((int)local_48->_roomList[0]._doors + bossRoomOffset + 0x5c); offsetDist = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10 * 40.0; flyPosY = offsetDist * local_38 + local_1c; flyPosX = offsetDist * local_18 + local_3c; if (savedEntitiesEnd == *(EntitySaveState **)((int)local_48->_roomList[0]._doors + bossRoomOffset + 0x60)) { std::vector::_Emplace_reallocate(savedEntitiesEnd,&flySaveState); } else { EntitySaveState::copy(savedEntitiesEnd,&flySaveState); local_14->_end = (void *)((int)local_14->_end + 0x78); } local_8 = 1; if (piStack_64 != (int *)0x0) { isLastRef = (**(code **)(*piStack_64 + 0xc))(); if ((isLastRef != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(&uStack_68); } } local_8 = 2; if (piStack_6c != (int *)0x0) { isLastRef = (**(code **)(*piStack_6c + 0xc))(); if ((isLastRef != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(&local_70); } } spawnsLeft = spawnsLeft + -1; local_8 = 0xffffffff; uVar9 = uVar10; } while (spawnsLeft != 0); spawnsLeft = 0x32; do { uVar9 = local_20; local_8 = 0xffffffff; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } rngShift1 = (byte)local_30; uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)uVar8 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)uVar10 & 0x1f) ^ uVar7; rngResult = 0; if (innerWidth != 0) { rngResult = uVar7 % innerWidth; } iVar6 = rngResult + 1; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar8 = local_30._4_4_; uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; rngShift2 = (byte)((ulonglong)local_30 >> 0x20); uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)uVar10 & 0x1f) ^ uVar7; rngResult = 0; if (innerHeight != 0) { rngResult = uVar7 % innerHeight; } gridY = rngResult + 1; local_13c = 0; uStack_138 = 0; uStack_134 = 0xffffffff; uStack_130 = 0xffffffff; effectVariant = 0; effectPosX = g_vectorZero.x; effectPosY = g_vectorZero.y; local_144 = 0; local_140 = 0; local_12c = 0; local_128 = 0; local_11c = 0; effectSeed = 0; local_114 = 0; local_110 = 0; local_10c = 0; local_104 = 0xffffffff; local_100 = 0xffffffff; local_fc = 0x42700000; local_f8 = 0x3f800000; local_f4 = 0x3f800000; local_f0 = 0; local_ec = 1; local_e8 = 0; piStack_e4 = (int *)0x0; uStack_e0 = 0; piStack_dc = (int *)0x0; local_8 = 3; effectSaveState = 1000; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; rngShift3 = (byte)local_20; uVar7 = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; effectVariant = *(undefined4 *)(&DAT_00b603b4 + (uVar7 % 3) * 4); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> (rngShift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; effectSeed = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; pvVar2 = g_game->_room; if ((((iVar6 < 0) || (gridWidth = *(int *)((int)pvVar2 + 0xc), gridWidth <= iVar6)) || (gridY < 0)) || (*(int *)((int)pvVar2 + 0x10) <= gridY)) { gridWidth = *(int *)((int)pvVar2 + 0xc); iVar6 = -1; } else { iVar6 = gridWidth * gridY + iVar6; } local_38 = (float)(iVar6 % gridWidth) * 40.0 + 40.0; local_18 = (float)(iVar6 / gridWidth) * 40.0 + 120.0; local_114 = effectSeed; if (effectSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = effectSeed >> (rngShift1 & 0x1f) ^ effectSeed; local_58 = 0x100000003; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; local_1c = 1.96182e-44; uVar7 = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } rngResult = uVar7 >> 3 ^ uVar7; rngResult = rngResult << 1 ^ rngResult; rngResult = rngResult >> 0xe ^ rngResult; local_1c = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283062e-10 * 3.14; local_1c = local_1c + local_1c; local_3c = sin(local_1c); local_1c = cos(local_1c); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)local_30 & 0x1f) ^ uVar7; uVar7 = uVar7 << (rngShift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; savedEntitiesEnd = *(EntitySaveState **)((int)local_48->_roomList[0]._doors + bossRoomOffset + 0x5c); offsetDist = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10 * 40.0; effectPosY = offsetDist * local_3c + local_18; effectPosX = offsetDist * local_1c + local_38; if (savedEntitiesEnd == *(EntitySaveState **)((int)local_48->_roomList[0]._doors + bossRoomOffset + 0x60)) { std::vector::_Emplace_reallocate(savedEntitiesEnd,&effectSaveState); } else { EntitySaveState::copy(savedEntitiesEnd,&effectSaveState); local_14->_end = (void *)((int)local_14->_end + 0x78); } local_8 = 4; if (piStack_dc != (int *)0x0) { isLastRef = (**(code **)(*piStack_dc + 0xc))(); if ((isLastRef != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(&uStack_e0); } } local_8 = 5; if (piStack_e4 != (int *)0x0) { isLastRef = (**(code **)(*piStack_e4 + 0xc))(); if ((isLastRef != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(&local_e8); } } spawnsLeft = spawnsLeft + -1; local_8 = 0xffffffff; uVar10 = uVar9; } while (spawnsLeft != 0); } Game::UpdateVisibility(g_game); } ExceptionList = local_10; return; } //@@ 004d6ee0 invoke_pending_callbacks /* DB: ? calls global fnptrs if objects at +0x70/+0x68 report ready prototype: db/protos.zhl */ void __fastcall invoke_pending_callbacks(void *owner) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)((int)owner + 0x70) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)owner + 0x70) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)((int)owner + 0x6c); } } local_8 = 1; if (*(int **)((int)owner + 0x68) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)owner + 0x68) + 0xc))(); if ((cVar1 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)((int)owner + 100); } } ExceptionList = local_10; return; } //@@ 004d6f80 std::vector::erase /* DB: ECX vector, args (out iterator, where): move-assigns every 0x78-byte EntitySaveState after where down by one (swapping the shared pointer/ANM2 ref members), destroys the last (invoke_pending_callbacks) and shrinks end by 0x78; used by NpcAI::ENTITY_MOMS_HEART_mausoleum_death and Game::spawn_bomb_crater on room save states */ void std::vector::erase(int *param_1,int param_2) { int iVar1; undefined4 uVar2; char cVar3; uint uVar4; undefined4 *puVar5; int in_ECX; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; undefined1 local_20 [4]; int *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af38e0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; puVar6 = *(undefined4 **)(in_ECX + 4); local_18 = param_2; puVar7 = (undefined4 *)(param_2 + 0x78); if (puVar7 != puVar6) { puVar8 = (undefined4 *)(param_2 + 0x68); local_14 = in_ECX; do { puVar8[-0x1a] = *puVar7; puVar8[-0x19] = puVar7[1]; puVar8[-0x18] = puVar7[2]; puVar8[-0x17] = puVar7[3]; puVar8[-0x16] = puVar7[4]; puVar8[-0x15] = puVar7[5]; puVar8[-0x14] = puVar7[6]; *(undefined1 *)((int)puVar8 + -0x46) = *(undefined1 *)((int)puVar7 + 0x22); puVar8[-0x11] = puVar7[9]; puVar8[-0x13] = puVar7[7]; *(undefined2 *)(puVar8 + -0x12) = *(undefined2 *)(puVar7 + 8); puVar8[-0x10] = puVar7[10]; puVar8[-0xf] = puVar7[0xb]; puVar8[-0xe] = puVar7[0xc]; puVar8[-0xd] = puVar7[0xd]; puVar8[-0xc] = puVar7[0xe]; puVar8[-0xb] = puVar7[0xf]; puVar8[-10] = puVar7[0x10]; iVar1 = puVar7[0xf]; puVar8[-8] = iVar1; puVar8[-7] = iVar1 >> 0x1f; *(undefined1 *)((int)puVar8 + -0x45) = *(undefined1 *)((int)puVar7 + 0x23); puVar8[-6] = puVar7[0x14]; puVar8[-5] = puVar7[0x15]; *(undefined1 *)(puVar8 + -2) = *(undefined1 *)(puVar7 + 0x18); puVar8[-4] = puVar7[0x16]; puVar8[-3] = puVar7[0x17]; puVar5 = (undefined4 *)FUN_004d7250(puVar7 + 0x19); uVar2 = puVar5[1]; puVar5[1] = *puVar8; *puVar8 = uVar2; uVar2 = *puVar5; *puVar5 = puVar8[-1]; puVar8[-1] = uVar2; local_8 = 0; if (local_1c != (int *)0x0) { cVar3 = (**(code **)(*local_1c + 0xc))(uVar4); if ((cVar3 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(local_20); } } local_8 = 0xffffffff; SharedPtr::assign(puVar8 + 1,puVar7 + 0x1b); puVar7 = puVar7 + 0x1e; puVar8 = puVar8 + 0x1e; } while (puVar7 != puVar6); puVar6 = *(undefined4 **)(local_14 + 4); in_ECX = local_14; } invoke_pending_callbacks(puVar6 + -0x1e); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -0x78; *param_1 = local_18; ExceptionList = local_10; return; } //@@ 004d7100 FUN_004d7100 void FUN_004d7100(void *param_1) { EntitySaveState *this; int in_ECX; this = *(EntitySaveState **)(in_ECX + 4); if (this == *(EntitySaveState **)(in_ECX + 8)) { std::vector::_Emplace_reallocate(this,param_1); return; } EntitySaveState::copy(this,param_1); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x78; return; } //@@ 004d7130 FUN_004d7130 void FUN_004d7130(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 004d7190 FUN_004d7190 void FUN_004d7190(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 004d71f0 FUN_004d71f0 void FUN_004d71f0(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 004d7250 FUN_004d7250 void FUN_004d7250(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 004d72b0 FUN_004d72b0 void FUN_004d72b0(uint param_1,char param_2) { uint *puVar1; uint uVar2; uint uVar3; int in_ECX; uint uVar4; uVar2 = *(uint *)(in_ECX + 4 + (param_1 >> 6) * 8); puVar1 = (uint *)(in_ECX + (param_1 >> 6) * 8); uVar3 = 1 << (param_1 & 0x1f); uVar4 = 0; if (0x1f < (param_1 & 0x3f)) { uVar4 = uVar3; } uVar3 = uVar3 ^ uVar4; if (0x3f < (param_1 & 0x3f)) { uVar4 = uVar3; } if (param_2 == '\0') { puVar1[1] = uVar2 & ~uVar4; *puVar1 = *puVar1 & ~uVar3; return; } *puVar1 = *puVar1 | uVar3; puVar1[1] = uVar2 | uVar4; return; } //@@ 004d7310 FUN_004d7310 void FUN_004d7310(void *param_1,void *param_2) { for (; param_1 != param_2; param_1 = (void *)((int)param_1 + 0x78)) { invoke_pending_callbacks(param_1); } return; } //@@ 004d7340 std::vector::_Change_array /* DB: destroys old 0x78-byte elements, frees, installs (newvec, size, cap); _Emplace_reallocate/_Reallocate_exactly */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { int *in_ECX; uint size; void *owner; void *pvVar1; owner = (void *)*in_ECX; if (owner != (void *)0x0) { pvVar1 = (void *)in_ECX[1]; if (owner != pvVar1) { do { invoke_pending_callbacks(owner); owner = (void *)((int)owner + 0x78); } while (owner != pvVar1); owner = (void *)*in_ECX; } size = ((in_ECX[2] - (int)owner) / 0x78) * 0x78; pvVar1 = owner; if (0xfff < size) { pvVar1 = *(void **)((int)owner + -4); size = size + 0x23; if (0x1f < (uint)((int)owner + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x78; in_ECX[2] = param_1 + param_3 * 0x78; return; } //@@ 004d73e0 FUN_004d73e0 void FUN_004d73e0(void *param_1,void *param_2,EntitySaveState *param_3) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af390d; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = (void *)((int)param_1 + 0x78)) { EntitySaveState::copy(param_3,param_1); param_3 = param_3 + 0x1e; ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 004d7450 FUN_004d7450 void FUN_004d7450(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x78; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 004d74a0 SharedPtr::assign /* DB: ? copy-and-swap: builds a temp smart pointer from param (FUN_004d7190), swaps the two dwords with this, releases the old control block (vfunc +0xc, deleter g_entitySaveStateReleaseFn); Entity_Player::StoreGameState/RestoreGameState, Entity_Pickup::RestoreState prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall SharedPtr::assign(void *this,void *other) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_004d7190(other); uVar1 = puVar4[1]; puVar4[1] = *(undefined4 *)((int)this + 4); *(undefined4 *)((int)this + 4) = uVar1; uVar1 = *puVar4; *puVar4 = *(undefined4 *)this; *(undefined4 *)this = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(local_1c); } } ExceptionList = local_10; return; } //@@ 004d7530 std::vector::_Emplace_reallocate /* DB: vector grow with element size 0x78 (max 0x2222222), EntitySaveState::copy into the new slot, moves halves around it; Level::Init, Room::on_leave, spawn_bomb_crater */ EntitySaveState * std::vector::_Emplace_reallocate(int param_1,void *param_2) { EntitySaveState *this; uint uVar1; int iVar2; int iVar3; void *pvVar4; int *in_ECX; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3930; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x78; if (iVar3 == 0x2222222) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = (in_ECX[2] - *in_ECX) / 0x78; if (0x2222222 - (uVar1 >> 1) < uVar1) { uVar5 = 0x2222222; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0x2222222 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = _Allocate(uVar5 * 0x78); local_8 = 0; this = (EntitySaveState *)((int)pvVar4 + ((param_1 - iVar2) / 0x78) * 0x78); EntitySaveState::copy(this,param_2); if (param_1 == in_ECX[1]) { FUN_004d73e0(*in_ECX,in_ECX[1],pvVar4); } else { _Uninitialized_copy(*in_ECX,param_1,pvVar4); _Uninitialized_copy(param_1,in_ECX[1],this + 0x1e); } _Change_array(pvVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return this; } //@@ 004d7683 Catch_All@004d7683 void Catch_All_004d7683(void) { int unaff_EBP; FUN_004d7310(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_004d7450(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 004d76c0 FUN_004d76c0 void FUN_004d76c0(void) { void *pvVar1; undefined4 *in_ECX; void *owner; pvVar1 = (void *)in_ECX[1]; for (owner = (void *)*in_ECX; owner != pvVar1; owner = (void *)((int)owner + 0x78)) { invoke_pending_callbacks(owner); } return; } //@@ 004d76f0 std::_Uninitialized_copy /* DB: EntitySaveState::copy over the range (stride 0x78), returns dest end; std::vector::_Emplace_reallocate/assign */ EntitySaveState * std::_Uninitialized_copy(void *param_1,void *param_2,EntitySaveState *param_3) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af390d; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = (void *)((int)param_1 + 0x78)) { EntitySaveState::copy(param_3,param_1); param_3 = param_3 + 0x1e; ppvVar1 = ExceptionList; } ExceptionList = local_10; return param_3; } //@@ 004d7760 FUN_004d7760 bool FUN_004d7760(void) { int in_ECX; return *(int *)(in_ECX + 0x28) == 8; } //@@ 004d7770 Entity_Effect::Scale /* ZHL [lua] Lua binding EntityEffect:Scale */ float10 __thiscall Entity_Effect::Scale(Entity_Effect *this) { return (float10)this->_scale; } //@@ 004d7780 Room::HasTriggerPressurePlates /* ZHL [lua] Lua binding Room:HasTriggerPressurePlates */ byte __thiscall Room::HasTriggerPressurePlates(Room *this) { return this->_hasTriggerPressurePlates; } //@@ 004d7790 Entity_Knife::Rotation /* ZHL [lua] Lua binding EntityKnife:Rotation */ float10 __thiscall Entity_Knife::Rotation(Entity_Knife *this) { return (float10)this->_rotation; } //@@ 004d77a0 Entity_Knife::GetKnifeVelocity /* ZHL [lua] Lua binding EntityKnife:GetKnifeVelocity */ float10 __thiscall Entity_Knife::GetKnifeVelocity(Entity_Knife *this) { return (float10)this->_knifeVelocity; } //@@ 004d77b0 NpcAI::ENTITY_SMALL_MAGGOT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 853 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SMALL_MAGGOT(Entity_NPC *npc) { void *pvVar1; code *pcVar2; float *pfVar3; byte bVar4; uint uVar5; int iVar6; byte *curAnimName; LayerState *layer; ColorMod *extraout_EAX; Vector *vecResult; uint rngResult; Entity *pEVar7; int iVar8; char *expectedAnimName; byte *expectedAnimName2; Room *room; bool bVar9; float fVar10; float fVar11; float fVar12; float fVar13; uint rngResult; double dVar15; undefined8 uVar16; EntityRef killRef; Vector randomDir2; Vector randomDir; Vector toTargetDir; Vector spawnPos; Vector toTarget; undefined8 rngShift12; EntityList_EL nearbyList; Vector splashPos; Room *currentRoom; Vector local_64; float local_5c; float local_58; float local_54; Color defaultColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; byte *animData; undefined4 flagsHigh; ColorMod *layerColor; Entity_Player *nearEntity; int *roomData; puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af395d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)((&defaultColor)[1]._colorize + 1); ExceptionList = &local_1c; room = g_game->_room; local_58 = (npc->_velocity).x; fVar13 = 0.0; fVar12 = (npc->_velocity).y; local_64.y = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); iVar6 = npc->_state; rngResult = 0x80000000; currentRoom = room; local_24 = uVar5; if (iVar6 == 0) { rngResult = npc->_initSeed; rngShift12 = 0xb00000001; local_54 = 2.24208e-44; if (-1 < npc->_spawnGridIndex) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } if ((npc->_variant == 10) && (npc->_dead == 0)) { *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; iVar6 = npc->_subtype; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); local_5c = 0.0; puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; pfVar3 = (&defaultColor)[1]._offset; if (iVar6 != 0) { do { puStack_20 = (undefined1 *)pfVar3; if (rngResult == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } rngResult = rngResult >> ((byte)rngShift12 & 0x1f) ^ rngResult; bVar4 = (byte)((ulonglong)rngShift12 >> 0x20); rngResult = rngResult << (bVar4 & 0x1f) ^ rngResult; rngResult = rngResult >> (SUB41(local_54,0) & 0x1f) ^ rngResult; local_64.y = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283062e-10 * 38.0 - 19.0; if (rngResult == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } rngResult = rngResult >> ((byte)rngShift12 & 0x1f) ^ rngResult; rngResult = rngResult << (bVar4 & 0x1f) ^ rngResult; rngResult = rngResult >> (SUB41(local_54,0) & 0x1f) ^ rngResult; spawnPos.y = local_64.y + (npc->_pos).y; spawnPos.x = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283062e-10 * 38.0 - 19.0) + (npc->_pos).x; rngResult = Random(); pEVar7 = Game::Spawn(g_game,npc->_type,0,&spawnPos,&g_vectorZero,(Entity *)0x0,0,rngResult ); flagsHigh = *(undefined4 *)((int)&pEVar7->_flags + 4); iVar6 = *(int *)pEVar7; *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar7->_flags + 4) = flagsHigh; (**(code **)(iVar6 + 0xc))(); local_5c = (float)((int)local_5c + 1); pfVar3 = (float *)puStack_20; } while ((uint)local_5c < (uint)npc->_subtype); } goto LAB_004d88cf; } npc->_state = 3; rngResult = Random(); local_64.y = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_64.y = local_64.y + local_64.y; local_5c = cos(local_64.y); fVar12 = sin(local_64.y); (npc->_pathfinder)._movementTarget.x = local_5c; (npc->_pathfinder)._movementTarget.y = fVar12; if (rngResult == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } rngResult = rngResult >> ((byte)rngShift12 & 0x1f) ^ rngResult; rngResult = rngResult << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ rngResult; (npc->_pathfinder)._moveCountdown = (rngResult >> (SUB41(local_54,0) & 0x1f) ^ rngResult) % 0x1e + 10; fVar11 = (npc->_pathfinder)._movementTarget.x; fVar12 = (npc->_pathfinder)._movementTarget.y; LAB_004d7981: fVar13 = 0.0; rngResult = 0x80000000; } else { local_54 = fVar12; if (iVar6 == 3) { if ((room->_roomType == 0x10) && (g_game->_frameCount - npc->_spawnFrame < 2)) { (npc->_pathfinder)._moveCountdown = 0; } if (npc->_collidesWithGrid == 0) { iVar6 = (npc->_pathfinder)._moveCountdown; } else { iVar6 = 0; } if ((((npc->_flags & 0xb00) != 0) || (npc->_forcedTarget != (EntityPtr)0x0)) && (5 < iVar6)) { iVar6 = 5; } iVar8 = npc->_i2; (npc->_pathfinder)._moveCountdown = iVar6 - (int)local_64.y; if (iVar8 == 0) { if (npc->_maxHitPoints < npc->_health || npc->_maxHitPoints == npc->_health) { puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; bVar4 = Entity::IsFrame((Entity *)npc,4,0); if ((bVar4 != 0) && (rngResult = Random(), (rngResult & 3) == 0)) { EntityList::QueryRadius(&room->_entityList,&nearbyList,&npc->_pos,80.0,0x29); local_14 = 0.0; local_54 = 0.0; fVar12 = (float)nearbyList._size; if ((float)nearbyList._size != 0.0) { do { nearEntity = *(Entity_Player **)((int)nearbyList._data + (int)local_54 * 4); if ((npc->_flags & 0x100) == 0) { fVar13 = (float)nearEntity->_type; if (fVar13 != 1.4013e-45) goto LAB_004d7d27; local_64.y = fVar13; bVar4 = Entity_Player::IsInvisible(nearEntity); if (bVar4 != 0) { fVar13 = local_64.y; goto LAB_004d7d21; } LAB_004d7d41: npc->_i2 = 1; break; } bVar4 = Entity::IsVulnerableEnemy((Entity *)nearEntity,(Entity *)0x0); if ((bVar4 != 0) && ((nearEntity->_flags & 0x20000000) == 0)) goto LAB_004d7d41; fVar13 = (float)nearEntity->_type; LAB_004d7d21: fVar12 = (float)nearbyList._size; LAB_004d7d27: if ((fVar13 == 1.19531e-42) && (*(int *)(nearEntity->_chargeBarSprites[4]._animDefaultName._buf + 4) == 1)) goto LAB_004d7d41; local_54 = (float)((int)local_54 + 1); } while ((uint)local_54 < (uint)fVar12); room = currentRoom; } local_14 = -NAN; if (nearbyList._0_1_ == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,nearbyList._data,0); local_14 = -NAN; } } } else { npc->_i2 = 1; puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; } } else { puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; rngResult = Random(); if (rngResult % 0x19 == 0) { npc->_i2 = 0; } } local_5c = 1.0; if ((npc->_pathfinder)._moveCountdown < 1) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_58 = (pEVar7->_pos).x; local_54 = (pEVar7->_pos).y; local_64.x = local_58; local_64.y = local_54; if ((((npc->_flags & 0x100) == 0) && (npc->_forcedTarget == (EntityPtr)0x0)) && ((npc->_i2 != 1 || (bVar4 = Room::CheckLine(room,&npc->_pos,&local_64,1,0,0,0,(Vector *)0x0), bVar4 == 0))) ) { bVar4 = Entity::HasEntityFlags((Entity *)npc,0x800); if (bVar4 != 0) { toTarget.x = local_58 - (npc->_pos).x; toTarget.y = local_54 - (npc->_pos).y; vecResult = Vector::Normalized(&toTarget,&toTargetDir); fVar13 = -vecResult->x; (npc->_pathfinder)._movementTarget.y = -vecResult->y; goto LAB_004d7f54; } bVar4 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar4 != 0) { vecResult = MusicManager::RandomVector(&randomDir); (npc->_pathfinder)._movementTarget.x = vecResult->x; (npc->_pathfinder)._movementTarget.y = vecResult->y; } } else { local_58 = local_58 - (npc->_pos).x; local_54 = local_54 - (npc->_pos).y; fVar12 = sqrtf(local_54 * local_54 + local_58 * local_58); if (fVar12 <= 0.0) { fVar13 = local_58; fVar12 = local_54; } else { fVar13 = local_58 * (1.0 / fVar12); fVar12 = local_54 * (1.0 / fVar12); } (npc->_pathfinder)._movementTarget.y = fVar12; local_5c = 2.0; LAB_004d7f54: (npc->_pathfinder)._movementTarget.x = fVar13; } fVar12 = (npc->_pathfinder)._movementTarget.y; if (((npc->_pathfinder)._movementTarget.x == g_vectorZero.x) && (fVar12 == g_vectorZero.y)) { vecResult = MusicManager::RandomVector(&randomDir2); (npc->_pathfinder)._movementTarget.x = vecResult->x; fVar12 = vecResult->y; (npc->_pathfinder)._movementTarget.y = fVar12; } local_54 = 0.0; do { iVar6 = (int)((((npc->_pathfinder)._movementTarget.x * 6.0 + (npc->_pos).x) - 40.0) / 40.0 + 0.5); iVar8 = (int)(((fVar12 * 6.0 + (npc->_pos).y) - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (iVar8 < 0)) || (room->_gridHeight <= iVar8)) { iVar6 = -1; } else { iVar6 = room->_gridWidth * iVar8 + iVar6; } rngResult = Room::GetGridCollision(room,iVar6); if (rngResult == 0) break; rngResult = Random(); local_64.y = (90.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 180.0) * 0.017453292; local_58 = cos(local_64.y); fVar11 = sin(local_64.y); fVar12 = (npc->_pathfinder)._movementTarget.y; fVar13 = (npc->_pathfinder)._movementTarget.x; local_54 = (float)((int)local_54 + 1); (npc->_pathfinder)._movementTarget.x = local_58 * fVar13 - fVar12 * fVar11; fVar12 = local_58 * fVar12 + fVar13 * fVar11; (npc->_pathfinder)._movementTarget.y = fVar12; } while ((int)local_54 < 10); rngResult = Random(); (npc->_pathfinder)._moveDirection.x = 2.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 4.0; rngResult = Random(); (npc->_pathfinder)._moveDirection.y = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.15) * local_5c; rngResult = Random(); (npc->_pathfinder)._moveCountdown = rngResult % 0x1e + 10; } fVar12 = npc->_speedMultiplier; npc->_friction = npc->_friction * 0.8; fVar13 = (npc->_pathfinder)._moveDirection.y; fVar11 = (npc->_pathfinder)._movementTarget.y; (npc->_velocity).x = fVar13 * (npc->_pathfinder)._movementTarget.x * fVar12 + (npc->_velocity).x; local_64.y = (npc->_pathfinder)._moveDirection.x * 0.017453292; (npc->_velocity).y = fVar11 * fVar13 * fVar12 + (npc->_velocity).y; local_5c = cos(local_64.y); fVar11 = sin(local_64.y); fVar12 = (npc->_pathfinder)._movementTarget.x; fVar13 = (npc->_pathfinder)._movementTarget.y; fVar10 = fVar12 * local_5c - fVar13 * fVar11; fVar12 = fVar12 * fVar11 + fVar13 * local_5c; (npc->_pathfinder)._movementTarget.x = fVar10; (npc->_pathfinder)._movementTarget.y = fVar12; if (room->_roomType == 0x10) { (npc->_pathfinder)._movementTarget.y = 0.0; fVar12 = 0.0; if (0.0 < fVar10) { (npc->_pathfinder)._movementTarget.x = 1.0; fVar11 = (npc->_pathfinder)._movementTarget.x; goto LAB_004d7981; } (npc->_pathfinder)._movementTarget.x = (float)&DAT_bf800000; } fVar11 = (npc->_pathfinder)._movementTarget.x; goto LAB_004d7981; } fVar11 = local_58; puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; if (iVar6 == 0x10) { if (npc->_i1 == 0) { fVar11 = (npc->_targetPosition).x; iVar8 = 3; (npc->_velocity).x = fVar11; (npc->_velocity).y = (npc->_targetPosition).y; iVar6 = 0; } else { iVar6 = 2; iVar8 = 4; if (npc->_spawnerType == 0x3b7) { iVar6 = 0; } } npc->_entityCollisionClass = iVar6; npc->_entityGridCollisionClass = iVar8; if (room->_roomType != 0x10) { fVar11 = (npc->_posOffset).y; if (fVar11 < -50.0) { npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; } if (npc->_i1 == 2) { layerColor = (ColorMod *)(&DAT_00c5c6b8 + ((int)npc->_updateTime % 3) * 0x2c); puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,layerColor); npc->_entityGridCollisionClass = 6; local_5c = (npc->_velocity).x; local_64.y = (npc->_velocity).y; fVar12 = sqrtf(local_64.y * local_64.y + local_5c * local_5c); if (0.0 < fVar12) { fVar12 = (npc->_v1).y / fVar12; (npc->_velocity).x = local_5c * fVar12; (npc->_velocity).y = local_64.y * fVar12; } if (npc->_collidesWithGrid != 0) { npc->_i1 = 1; Color::Color(&defaultColor); layerColor = extraout_EAX; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,layerColor); (npc->_velocity).x = (npc->_velocity).x * 0.1; (npc->_velocity).y = (npc->_velocity).y * 0.1; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfbffffff; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } } else { fVar10 = (npc->_v1).x + 0.7; fVar11 = fVar11 + fVar10; (npc->_v1).x = fVar10; (npc->_posOffset).y = fVar11; puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; if (fVar11 <= -fVar10) goto LAB_004d8544; iVar6 = npc->_entityGridCollisionClass; (npc->_posOffset).y = 0.0; (npc->_v1).x = 0.0; npc->_state = 3; puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; if (iVar6 == 4) { puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; iVar6 = Room::GetGridCollisionAtPos(room,npc->_pos); if (iVar6 != 0) { EntityRef::EntityRef(&killRef); (**(code **)(*(int *)npc + 0x24))(); goto LAB_004d7977; } } npc->_entityGridCollisionClass = 5; npc->_entityCollisionClass = 4; LAB_004d7945: Entity_NPC::PlaySound(npc,0x102,1.0,2,0,1.0); ANM2::Play(&npc->_sprite,s_Land,0); } LAB_004d7977: fVar12 = local_54; fVar11 = local_58; goto LAB_004d7981; } puStack_20 = (undefined1 *)(&defaultColor)[1]._offset; bVar4 = Room::IsBeastDungeon(room); if (bVar4 == 0) { iVar6 = 3; } else { npc->_entityCollisionClass = 0; iVar6 = 0; } npc->_entityGridCollisionClass = iVar6; fVar10 = npc->_speedMultiplier; (npc->_velocity).y = fVar10 * 0.7 + (npc->_velocity).y; (npc->_velocity).x = fVar10 * fVar13 + fVar11; if (npc->_collidesWithGrid != 0) { (npc->_posOffset).y = 0.0; (npc->_v1).x = 0.0; npc->_state = 3; npc->_entityGridCollisionClass = 5; goto LAB_004d7945; } LAB_004d8544: fVar11 = local_58; } } if (npc->_state == 0x10) { (npc->_sprite)._flipX = (npc->_velocity).x <= fVar13 && fVar13 != (npc->_velocity).x; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "Bullet"; do { bVar4 = *curAnimName; bVar9 = bVar4 < (byte)*expectedAnimName; if (bVar4 != *expectedAnimName) { LAB_004d854e: rngResult = -(uint)bVar9 | 1; goto LAB_004d8553; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; bVar9 = bVar4 < (byte)expectedAnimName[1]; if (bVar4 != expectedAnimName[1]) goto LAB_004d854e; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar4 != 0); rngResult = 0; LAB_004d8553: if (rngResult == 0) { if ((animData[0x34] != 0) && ((npc->_sprite)._animState._isPlaying == 0)) { uVar16 = 0x100b60434; goto LAB_004d8837; } goto LAB_004d884e; } } uVar16 = 0x100b60434; LAB_004d8837: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)uVar16,(byte)((ulonglong)uVar16 >> 0x20)); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pvVar1 = (npc->_sprite)._animState._animData; if (((pvVar1 == (void *)0x0) || (*(char *)((int)pvVar1 + 0x34) != '\0')) || ((npc->_sprite)._animState._isPlaying == 0)) { (npc->_sprite)._flipX = 0; if (fVar11 < fVar13) { (npc->_sprite)._flipX = 1; fVar11 = (float)((uint)fVar11 ^ rngResult); } fVar12 = atan2f(fVar12,fVar11); local_64.y = (fVar12 * 57.295776 + 22.5) / 45.0; dVar15 = floor((double)local_64.y); local_64.y = (float)dVar15; switch((int)dVar15) { case 0: animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "MoveHori"; do { bVar4 = *curAnimName; bVar9 = bVar4 < (byte)*expectedAnimName; if (bVar4 != *expectedAnimName) { LAB_004d8734: rngResult = -(uint)bVar9 | 1; goto LAB_004d8739; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; bVar9 = bVar4 < (byte)expectedAnimName[1]; if (bVar4 != expectedAnimName[1]) goto LAB_004d8734; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar4 != 0); rngResult = 0; LAB_004d8739: if (rngResult == 0) { if ((animData[0x34] != 0) && ((npc->_sprite)._animState._isPlaying == 0)) { uVar16 = 0x100b6043c; break; } goto LAB_004d884e; } } uVar16 = 0x100b6043c; break; case 1: animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "MoveDiagonalDown"; do { bVar4 = *curAnimName; bVar9 = bVar4 < (byte)*expectedAnimName; if (bVar4 != *expectedAnimName) { LAB_004d87a6: rngResult = -(uint)bVar9 | 1; goto LAB_004d87ab; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; bVar9 = bVar4 < (byte)expectedAnimName[1]; if (bVar4 != expectedAnimName[1]) goto LAB_004d87a6; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar4 != 0); rngResult = 0; LAB_004d87ab: if (rngResult == 0) { if ((animData[0x34] != 0) && ((npc->_sprite)._animState._isPlaying == 0)) { uVar16 = 0x100b60448; break; } goto LAB_004d884e; } } uVar16 = 0x100b60448; break; case -2: animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName2 = &DAT_00b6045c; do { bVar4 = *curAnimName; bVar9 = bVar4 < *expectedAnimName2; if (bVar4 != *expectedAnimName2) { LAB_004d8650: rngResult = -(uint)bVar9 | 1; goto LAB_004d8655; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; bVar9 = bVar4 < expectedAnimName2[1]; if (bVar4 != expectedAnimName2[1]) goto LAB_004d8650; curAnimName = curAnimName + 2; expectedAnimName2 = expectedAnimName2 + 2; } while (bVar4 != 0); rngResult = 0; LAB_004d8655: if (rngResult == 0) { if ((animData[0x34] == 0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004d884e; uVar16 = 0x100b6045c; break; } } uVar16 = 0x100b6045c; break; case -1: animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "MoveDiagonalUp"; do { bVar4 = *curAnimName; bVar9 = bVar4 < (byte)*expectedAnimName; if (bVar4 != *expectedAnimName) { LAB_004d86c2: rngResult = -(uint)bVar9 | 1; goto LAB_004d86c7; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; bVar9 = bVar4 < (byte)expectedAnimName[1]; if (bVar4 != expectedAnimName[1]) goto LAB_004d86c2; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar4 != 0); rngResult = 0; LAB_004d86c7: if (rngResult == 0) { if ((animData[0x34] != 0) && ((npc->_sprite)._animState._isPlaying == 0)) { uVar16 = 0x100b60464; break; } goto LAB_004d884e; } } uVar16 = 0x100b60464; break; default: animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "MoveDown"; do { bVar4 = *curAnimName; bVar9 = bVar4 < (byte)*expectedAnimName; if (bVar4 != *expectedAnimName) { LAB_004d8812: rngResult = -(uint)bVar9 | 1; goto LAB_004d8817; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; bVar9 = bVar4 < (byte)expectedAnimName[1]; if (bVar4 != expectedAnimName[1]) goto LAB_004d8812; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar4 != 0); rngResult = 0; LAB_004d8817: if ((rngResult == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004d884e; } uVar16 = 0x100b60488; } goto LAB_004d8837; } } LAB_004d884e: roomData = *(int **)((int)currentRoom->_descriptor + 0x10); if (roomData == (int *)0x0) { ExceptionList = local_1c; return; } if (roomData[2] != 0x10) { ExceptionList = local_1c; return; } if (*roomData != 0x23) { ExceptionList = local_1c; return; } if ((npc->_velocity).y <= 0.0) { ExceptionList = local_1c; return; } splashPos.y = (currentRoom->_bottomRightPos).y - 30.0; if ((npc->_pos).y <= splashPos.y) { ExceptionList = local_1c; return; } splashPos.x = (npc->_pos).x; rngResult = Random(); pEVar7 = Game::Spawn(g_game,1000,0x10,&splashPos,&g_vectorZero,(Entity *)0x0,0x42,rngResult); (**(code **)(*(int *)pEVar7 + 0xc))(); LAB_004d88cf: (**(code **)(*(int *)npc + 0x28))(uVar5); ExceptionList = local_1c; return; } //@@ 004d8910 spawn_small_maggot_jump /* DB: Game::Spawn(853 SMALL_MAGGOT) toward target, sets grid; Mama Fly/Pustule/Scourge prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl spawn_small_maggot_jump(Vector *position,float yPositionOffset,Vector *targetPosition) { float fVar1; float fVar2; code *pcVar3; uint uVar4; Entity *pEVar5; int iVar6; int iVar7; void *pvVar8; float fVar9; float fVar10; void *pvVar11; pvVar11 = g_game->_room; uVar4 = Random(); pEVar5 = Game::Spawn(g_game,0x355,0,position,&g_vectorZero,(Entity *)0x0,0,uVar4); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar5->_flags + 4) = *(undefined4 *)((int)&pEVar5->_flags + 4); iVar7 = (int)((targetPosition->x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar7) && (iVar7 < *(int *)((int)pvVar11 + 0xc))) && (iVar6 = (int)((targetPosition->y - 120.0) / 40.0 + 0.5), -1 < iVar6)) && ((iVar6 < *(int *)((int)pvVar11 + 0x10) && (uVar4 = *(int *)((int)pvVar11 + 0xc) * iVar6 + iVar7, uVar4 < 0x1c0)))) { iVar7 = *(int *)((int)pvVar11 + uVar4 * 4 + 0x76c); iVar6 = iVar7 % 1000; if (iVar6 < 900) { *(int *)((int)pvVar11 + uVar4 * 4 + 0x76c) = (iVar7 - iVar6) + 900; } } pEVar5[2]._prevVelocity.y = -8.0; fVar9 = targetPosition->x; fVar1 = targetPosition->y; fVar10 = position->x; fVar2 = position->y; iVar7 = *(int *)pEVar5; pEVar5[2]._posOffset.x = 2.24208e-44; *(undefined4 *)&pEVar5[2].field_0x3a8 = 0; fVar10 = (fVar9 - fVar10) * 0.04; fVar9 = (fVar1 - fVar2) * 0.04; (pEVar5->_targetPosition).x = fVar10; (pEVar5->_velocity).x = fVar10; (pEVar5->_targetPosition).y = fVar9; (pEVar5->_velocity).y = fVar9; (pEVar5->_posOffset).y = yPositionOffset; (**(code **)(iVar7 + 0xc))(); pvVar11 = (void *)(pEVar5->_velocity).x; pvVar8 = (void *)(pEVar5->_velocity).y; uVar4 = pEVar5->_initSeed; fVar9 = sqrtf((float)pvVar11 * (float)pvVar11 + (float)pvVar8 * (float)pvVar8); if (0.0 < fVar9) { pvVar11 = (void *)((float)pvVar11 * (1.0 / fVar9)); pvVar8 = (void *)((float)pvVar8 * (1.0 / fVar9)); } pEVar5[1]._damageEvents._end = pvVar11; pEVar5[1]._damageEvents._capacity = pvVar8; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); pEVar5 = (Entity *)(*pcVar3)(); return pEVar5; } uVar4 = uVar4 >> 5 ^ uVar4; uVar4 = uVar4 << 9 ^ uVar4; pEVar5[1]._subtype = (uVar4 >> 7 ^ uVar4) % 0x1e + 10; return pEVar5; } //@@ 004d8b50 spawn_small_maggot /* DB: Game::Spawn 853 at this pos, sets height/velocity prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl spawn_small_maggot(Vector *position,float height,Vector *velocity,float heightVelocity) { float fVar1; code *pcVar2; uint uVar3; Entity *pEVar4; float fVar5; void *pvVar6; void *pvVar7; pvVar6 = g_game->_room; uVar3 = Random(); pEVar4 = Game::Spawn(g_game,0x355,0,position,&g_vectorZero,(Entity *)0x0,0,uVar3); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = *(undefined4 *)((int)&pEVar4->_flags + 4); pEVar4[2]._prevVelocity.y = heightVelocity; fVar5 = velocity->x; (pEVar4->_targetPosition).x = fVar5; fVar1 = velocity->y; (pEVar4->_targetPosition).y = fVar1; (pEVar4->_velocity).y = fVar1; (pEVar4->_velocity).x = fVar5; pEVar4[2]._posOffset.x = 2.24208e-44; *(undefined4 *)&pEVar4[2].field_0x3a8 = 1; if (*(int *)((int)pvVar6 + 8) == 0x10) { (pEVar4->_pos).y = height + (pEVar4->_pos).y; (pEVar4->_velocity).y = heightVelocity + (pEVar4->_velocity).y; } else { (pEVar4->_posOffset).y = height; } (**(code **)(*(int *)pEVar4 + 0xc))(); pvVar6 = (void *)(pEVar4->_velocity).x; pvVar7 = (void *)(pEVar4->_velocity).y; uVar3 = pEVar4->_initSeed; fVar5 = sqrtf((float)pvVar6 * (float)pvVar6 + (float)pvVar7 * (float)pvVar7); if (0.0 < fVar5) { pvVar6 = (void *)((float)pvVar6 * (1.0 / fVar5)); pvVar7 = (void *)((float)pvVar7 * (1.0 / fVar5)); } pEVar4[1]._damageEvents._end = pvVar6; pEVar4[1]._damageEvents._capacity = pvVar7; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pEVar4 = (Entity *)(*pcVar2)(); return pEVar4; } uVar3 = uVar3 >> 5 ^ uVar3; uVar3 = uVar3 << 9 ^ uVar3; pEVar4[1]._subtype = (uVar3 >> 7 ^ uVar3) % 0x1e + 10; return pEVar4; } //@@ 004d8d10 NpcHelper::gaper_l2_spawn_maggot /* DB: ? ECX=position: Game::Spawn(0x355 ENTITY_SMALL_MAGGOT 853, 0) with velocity param_1, height param_2 (+0xbb0), speed |v| (+0xbb4), state 0x10, flag 0x4000000, extra offset when room type 16; from NpcAI::ENTITY_GAPER_L2 (param -8.0) */ void NpcHelper::gaper_l2_spawn_maggot(float *param_1,float param_2) { float fVar1; undefined4 uVar2; code *pcVar3; qword qVar4; uint uVar5; Entity *pEVar6; Vector *in_ECX; float fVar7; void *pvVar8; float in_XMM2_Da; void *pvVar9; pvVar8 = g_game->_room; uVar5 = Random(); pEVar6 = Game::Spawn(g_game,0x355,0,in_ECX,&g_vectorZero,(Entity *)0x0,0,uVar5); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; uVar2 = *(undefined4 *)((int)&pEVar6->_flags + 4); qVar4 = pEVar6->_flags; pEVar6[2]._prevVelocity.y = param_2; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar2; fVar7 = sqrtf(*param_1 * *param_1 + param_1[1] * param_1[1]); pEVar6[2]._speedMultiplier = fVar7; fVar7 = *param_1; (pEVar6->_targetPosition).x = fVar7; fVar1 = param_1[1]; (pEVar6->_targetPosition).y = fVar1; (pEVar6->_velocity).y = fVar1; (pEVar6->_velocity).x = fVar7; pEVar6[2]._posOffset.x = 2.24208e-44; *(undefined4 *)&pEVar6[2].field_0x3a8 = 2; *(uint *)&pEVar6->_flags = (uint)qVar4 | 0x4000000; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar2; if (*(int *)((int)pvVar8 + 8) == 0x10) { (pEVar6->_pos).y = in_XMM2_Da + (pEVar6->_pos).y; (pEVar6->_velocity).y = param_2 + (pEVar6->_velocity).y; } else { (pEVar6->_posOffset).y = in_XMM2_Da; } (**(code **)(*(int *)pEVar6 + 0xc))(); pvVar8 = (void *)(pEVar6->_velocity).x; pvVar9 = (void *)(pEVar6->_velocity).y; uVar5 = pEVar6->_initSeed; fVar7 = sqrtf((float)pvVar8 * (float)pvVar8 + (float)pvVar9 * (float)pvVar9); if (0.0 < fVar7) { pvVar8 = (void *)((float)pvVar8 * (1.0 / fVar7)); pvVar9 = (void *)((float)pvVar9 * (1.0 / fVar7)); } pEVar6[1]._damageEvents._end = pvVar8; pEVar6[1]._damageEvents._capacity = pvVar9; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 9 ^ uVar5; pEVar6[1]._subtype = (uVar5 >> 7 ^ uVar5) % 0x1e + 10; return; } //@@ 004d8f20 NpcHelper::adult_leech_heading /* DB: Adult Leech walk (NpcAI::ENTITY_ADULT_LEECH 004d9000): random heading within +-45 deg of horizontal, random x sign, 1 in 2 its y turned toward the player (pass6_h2.md) */ void NpcHelper::adult_leech_heading(undefined4 param_1,float param_2) { uint uVar1; float *in_ECX; int in_EDX; float fVar2; float fVar3; uVar1 = Random(); fVar2 = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 90.0 * 0.017453292; fVar3 = cos(fVar2); *in_ECX = fVar3; fVar2 = sin(fVar2); in_ECX[1] = fVar2; uVar1 = Random(); if ((uVar1 & 1) == 0) { *in_ECX = *in_ECX * -1.0; } uVar1 = Random(); if ((uVar1 & 1) == 0) { fVar2 = in_ECX[1]; if (((fVar2 < 0.0) && (param_2 < *(float *)(in_EDX + 0x340))) || ((0.0 < fVar2 && (*(float *)(in_EDX + 0x340) < param_2)))) { in_ECX[1] = fVar2 * -1.0; } } return; } //@@ 004d9000 NpcAI::ENTITY_ADULT_LEECH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 854 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ADULT_LEECH(Entity_NPC *npc) { float fVar1; float fVar2; byte bVar3; float *pfVar4; Vector *direction; int iVar5; int gridIndex; Vector *pVVar6; ColorMod *color; void *deformNull; LayerState *bodyLayer; uint rngResult; uint seed; Entity *tmpEntity; float fVar7; float dirSign; undefined1 auVar10 [12]; float fVar8; undefined1 *puVar9; undefined1 auVar11 [12]; float fVar12; Vector scratchVec; Vector scratchVec2; Room *local_11c; Vector tmpVecOut; ColorMod bloodColor; Color gibColor; ProjectileParams projParams; uint local_c; AnimationState *animState; Game *game; Room *room; local_c = __security_cookie ^ (uint)&scratchVec; local_11c = g_game->_room; bloodColor._tint[0] = 1.0; bloodColor._tint[1] = 1.0; bloodColor._tint[2] = 1.0; bloodColor._tint[3] = 1.0; bloodColor._offset[0] = 0.0; bloodColor._offset[1] = 0.0; bloodColor._offset[2] = 0.0; fVar7 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); bloodColor._colorize[0] = 2.4; bloodColor._colorize[1] = 0.7; bloodColor._colorize[2] = 0.7; bloodColor._colorize[3] = 1.0; scratchVec.x = fVar7; switch(npc->_state) { case 0: npc->_state = 3; npc->_i1 = 0; npc->_stateFrame = -1; break; case 3: if (npc->_i1 < 1) { npc->_friction = npc->_friction * 0.8; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x100); if ((bVar3 == 0) && (npc->_forcedTarget == (EntityPtr)0x0)) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x800); if (bVar3 == 0) { pVVar6 = &(npc->_pathfinder)._moveDirection; bVar3 = Vector::operator_eq(pVVar6,&g_vectorZero); if (bVar3 != 0) { scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; Entity_NPC::GetPlayerTarget(npc); pfVar4 = (float *)NpcHelper::adult_leech_heading(scratchVec.x,scratchVec.y); pVVar6->x = *pfVar4; (npc->_pathfinder)._moveDirection.y = pfVar4[1]; } fVar7 = npc->_friction; fVar8 = pVVar6->x; if (fVar7 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).y = (fVar1 * (npc->_pathfinder)._moveDirection.y * 0.7) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (fVar1 * fVar8 * 0.7) / fVar7 + (npc->_velocity).x; } iVar5 = Room::GetGridCollisionAtPos(local_11c,npc->_pos); if (iVar5 == 0) { rngResult = Random(); if (rngResult % 0x1e == 0) { scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; Entity_NPC::GetPlayerTarget(npc); pfVar4 = (float *)NpcHelper::adult_leech_heading(scratchVec.x,scratchVec.y); pVVar6->x = *pfVar4; (npc->_pathfinder)._moveDirection.y = pfVar4[1]; } if (npc->_collidesWithGrid != 0) { pVVar6->x = pVVar6->x * -1.0; (npc->_pathfinder)._moveDirection.y = (npc->_pathfinder)._moveDirection.y * -1.0; } } else { rngResult = Random(); if (rngResult % 0x1e == 0) { Room::FindFreePickupSpawnPosition(local_11c,&scratchVec,&npc->_pos,0.0,0,0,0); scratchVec2.x = scratchVec.x - (npc->_pos).x; scratchVec2.y = scratchVec.y - (npc->_pos).y; direction = Vector::Normalized(&scratchVec2,&tmpVecOut); pVVar6->x = direction->x; (npc->_pathfinder)._moveDirection.y = direction->y; } } } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); } } else { pVVar6 = Entity_NPC::CalcTargetPosition(npc,&tmpVecOut,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar6,0.7,0,1); } ANM2::Play(&npc->_sprite,(byte *)"MoveHori",0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar3 == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); pVVar6 = &npc->_pos; scratchVec.x = (tmpEntity->_pos).x - pVVar6->x; scratchVec2.x = (tmpEntity->_pos).y - (npc->_pos).y; if ((-1 < npc->_stateFrame) || ((((ABS(scratchVec2.x) <= ABS(scratchVec.x) && (ABS(scratchVec2.x) <= 80.0)) || (0.66 <= npc->_health / npc->_maxHitPoints)) || ((rngResult = Random(), rngResult % 3 != 0 || (iVar5 = Room::GetGridCollisionAtPos(local_11c,*pVVar6), room = local_11c, iVar5 != 0)) )))) { rngResult = Random(); if ((rngResult % 3 == 0) && (ABS(scratchVec2.x) < 30.0)) { Entity_NPC::PlaySound(npc,0x1fe,1.0,10,0,1.0); if (scratchVec.x <= 0.0) { dirSign = (float)&DAT_bf800000; } else { dirSign = 1.0; } (npc->_targetPosition).x = dirSign; (npc->_targetPosition).y = 0.0; npc->_state = 8; (npc->_v2).y = 0.5; } } else { npc->_stateFrame = 0; npc->_state = 6; gridIndex = Room::GetGridIndex(local_11c,pVVar6); iVar5 = room->_gridWidth; (npc->_targetPosition).x = (float)(gridIndex % iVar5) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(gridIndex / iVar5) * 40.0 + 120.0; } } } else { npc->_i1 = npc->_i1 - (int)fVar7; npc->_friction = npc->_friction * 0.9; } break; case 5: pfVar4 = &(npc->_v2).y; if (*pfVar4 <= 2.0 && *pfVar4 != 2.0) { (npc->_v2).y = 2.0; } npc->_friction = npc->_friction * 0.86; ANM2::Play(&npc->_sprite,(byte *)"MoveHori",0); scratchVec2.x = (npc->_targetPosition).x; (npc->_sprite)._flipX = scratchVec2.x < 0.0; scratchVec.x = (npc->_targetPosition).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar7 = (npc->_pos).y; fVar8 = (tmpEntity->_pos).y; if (fVar8 <= fVar7 + 10.0) { if (fVar7 - 10.0 <= fVar8) { fVar7 = scratchVec.x; } else { fVar7 = -0.12; } } else { fVar7 = 0.12; } fVar8 = (npc->_v2).y; fVar7 = fVar8 * fVar7; if (fVar7 <= -2.0) { fVar7 = -2.0; } if (2.0 <= fVar7) { fVar7 = 2.0; } fVar1 = npc->_friction; if (fVar1 == 0.0) { fVar12 = (npc->_velocity).x; } else { fVar12 = (npc->_speedMultiplier * scratchVec2.x * fVar8) / fVar1 + (npc->_velocity).x; (npc->_velocity).y = (fVar7 * npc->_speedMultiplier) / fVar1 + (npc->_velocity).y; (npc->_velocity).x = fVar12; fVar8 = (npc->_v2).y; } game = g_game; auVar11 = ZEXT812(0x40a00000); if (fVar8 + 0.2 <= auVar11._0_4_) { auVar11._4_8_ = auVar11._4_8_; auVar11._0_4_ = fVar8 + 0.2; } (npc->_v2).y = auVar11._0_4_; if (((0.0 < fVar12) && (*(float *)((int)game->_room + 0x1c) + 80.0 < (npc->_pos).x)) || ((fVar12 < 0.0 && (fVar7 = *(float *)((int)game->_room + 0x14) - 80.0, (npc->_pos).x <= fVar7 && fVar7 != (npc->_pos).x)))) { (**(code **)(*(int *)npc + 0x28))(); } break; case 6: npc->_friction = 0.8; fVar7 = (npc->_targetPosition).y; (npc->_velocity).x = (((npc->_targetPosition).x - (npc->_pos).x) * 0.3) / 0.8 + (npc->_velocity).x; (npc->_velocity).y = ((fVar7 - (npc->_pos).y) * 0.3) / 0.8 + (npc->_velocity).y; ANM2::Play(&npc->_sprite,(byte *)"Burrow",0); animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Sound"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,&DAT_00b1d3b0); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x42,1.0,2,0,1.0); npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } } npc->_stateFrame = npc->_stateFrame + (int)scratchVec.x; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if ((0x1e < npc->_stateFrame) && (rngResult = Random(), rngResult % 0xf == 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar7 = (tmpEntity->_pos).x; fVar8 = (tmpEntity->_pos).y; npc->_state = 7; npc->_entityGridCollisionClass = 5; (npc->_pos).x = fVar7; (npc->_pos).y = fVar8; npc->_stateFrame = 0; Entity_NPC::PlaySound(npc,0x1fe,1.0,10,0,1.0); } break; case 7: ANM2::Play(&npc->_sprite,(byte *)"ChargeDown",0); fVar7 = (npc->_targetPosition).x; if ((fVar7 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { if (npc->_entityGridCollisionClass == 5) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.8,0,1); } else { npc->_friction = npc->_friction * 0.8; } } else { fVar12 = npc->_friction * 0.7; npc->_friction = fVar12; fVar8 = (npc->_targetPosition).y; fVar1 = (npc->_pos).y; if (fVar12 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).x = ((fVar7 - (npc->_pos).x) * fVar2) / fVar12 + (npc->_velocity).x; (npc->_velocity).y = (fVar2 * (fVar8 - fVar1)) / fVar12 + (npc->_velocity).y; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d3b0); game = g_game; if (bVar3 != 0) { npc->_entityGridCollisionClass = 3; Game::ShakeScreen(game,0xc); Entity_NPC::PlaySound(npc,0x4d,1.0,2,0,1.0); pVVar6 = &npc->_pos; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; (npc->_targetPosition).x = pVVar6->x; (npc->_targetPosition).y = (npc->_pos).y; npc->_entityCollisionClass = 4; scratchVec.x = 0.0; scratchVec.y = -14.0; spawn_blood_explosion(4,pVVar6,&scratchVec,&bloodColor,&g_vectorZero); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.02; scratchVec.x = 8.0; scratchVec.y = 10.0; Entity_NPC::FireProjectiles(npc,pVVar6,&scratchVec,9,&projParams); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } goto LAB_004d9f3c; } } goto LAB_004d9911; case 8: npc->_friction = npc->_friction * 0.86; ANM2::Play(&npc->_sprite,(byte *)"MoveHori",0); scratchVec2.x = (npc->_targetPosition).x; (npc->_sprite)._flipX = scratchVec2.x < 0.0; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar3 == 0) { if (npc->_collidesWithGrid == 0) { scratchVec.x = (npc->_targetPosition).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar7 = (npc->_pos).y; fVar8 = (tmpEntity->_pos).y; fVar1 = (tmpEntity->_pos).x; if (fVar8 <= fVar7 + 10.0) { if (fVar7 - 10.0 <= fVar8) { fVar7 = scratchVec.x; } else { fVar7 = -0.12; } } else { fVar7 = 0.12; } fVar8 = (npc->_v2).y; fVar7 = fVar7 * fVar8; if (fVar7 <= -2.0) { fVar7 = -2.0; } if (2.0 <= fVar7) { fVar7 = 2.0; } fVar12 = npc->_friction; if (fVar12 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).x = (scratchVec2.x * fVar8 * fVar2) / fVar12 + (npc->_velocity).x; (npc->_velocity).y = (fVar2 * fVar7) / fVar12 + (npc->_velocity).y; fVar8 = (npc->_v2).y; } if ((fVar8 < 1.0) || (ABS((npc->_pos).x - fVar1) < 500.0)) { auVar10 = ZEXT812(0x40a00000); fVar8 = npc->_speedMultiplier * 0.2 + fVar8; if (fVar8 <= auVar10._0_4_) { auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar8; } (npc->_v2).y = auVar10._0_4_; } break; } } else if (npc->_collidesWithGrid == 0) goto LAB_004d9911; fVar7 = (npc->_gridCollisionVelocity).y; fVar8 = (npc->_gridCollisionVelocity).x; fVar7 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); if ((10.0 < fVar7) && (pVVar6 = Vector::Normalized(&npc->_gridCollisionVelocity,&tmpVecOut), 0.6 < (npc->_gridCollisionNormal).y * pVVar6->y + (npc->_gridCollisionNormal).x * pVVar6->x)) { Game::ShakeScreen(g_game,6); Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); fVar7 = (npc->_gridCollisionNormal).y; (npc->_velocity).x = (npc->_velocity).x - (npc->_gridCollisionNormal).x * 2.5; (npc->_velocity).y = (npc->_velocity).y - fVar7 * 2.5; npc->_i1 = 0xc; Color::Color(&gibColor); scratchVec.x = 0.0; scratchVec2.x = (npc->_targetPosition).x * 14.0 + (npc->_pos).x; scratchVec.y = -14.0; scratchVec2.y = (npc->_targetPosition).y * 14.0 + (npc->_pos).y; tmpEntity = spawn_blood_explosion(3,&scratchVec2,&scratchVec,color,&g_vectorZero); tmpEntity->_renderDepthOffset = 5.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&bloodColor,0xffffffff,0xff,0,1); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = 0.08; scratchVec2.x = (npc->_targetPosition).x * 8.0 + (npc->_pos).x; scratchVec.x = 10.0; scratchVec.y = 12.0; scratchVec2.y = (npc->_targetPosition).y * 8.0 + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&scratchVec2,&scratchVec,9,&projParams); bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"BounceOverlay",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } goto LAB_004d9911; case 9: npc->_friction = npc->_friction * 0.86; ANM2::Play(&npc->_sprite,(byte *)"Charge",0); scratchVec.x = (npc->_targetPosition).x; (npc->_sprite)._flipX = scratchVec.x < 0.0; scratchVec2.x = (npc->_velocity).x; fVar8 = (npc->_velocity).y; fVar8 = sqrtf(scratchVec2.x * scratchVec2.x + fVar8 * fVar8); if (3.0 <= fVar8) { npc->_stateFrame = 0; } else { npc->_stateFrame = npc->_stateFrame + (int)fVar7; } fVar7 = npc->_friction; fVar8 = (npc->_targetPosition).y; if (fVar7 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).x = (scratchVec.x * 3.8 * fVar1) / fVar7 + scratchVec2.x; (npc->_velocity).y = (fVar8 * 3.8 * fVar1) / fVar7 + (npc->_velocity).y; } if ((npc->_collidesWithGrid == 0) || ((npc->_targetPosition).y * (npc->_gridCollisionNormal).y + (npc->_targetPosition).x * (npc->_gridCollisionNormal).x <= 0.6)) { if (10 < npc->_stateFrame) { npc->_state = 3; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } } else { Game::ShakeScreen(g_game,0xc); Entity_NPC::PlaySound(npc,0x4d,1.0,2,0,1.0); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; fVar7 = (npc->_pos).x; (npc->_targetPosition).x = fVar7; fVar8 = (npc->_pos).y; (npc->_targetPosition).y = fVar8; scratchVec2.x = fVar7 * 14.0 + (npc->_pos).x; scratchVec.x = 0.0; scratchVec2.y = fVar8 * 14.0 + (npc->_pos).y; scratchVec.y = -14.0; spawn_blood_explosion(4,&scratchVec2,&scratchVec,&bloodColor,&g_vectorZero); ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireBossProjectiles(npc,0xc,&g_vectorZero,0.0,&projParams); npc->_state = 10; } rngResult = Random(); if ((rngResult & 1) == 0) { rngResult = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 1.4 + 0.5); } break; case 10: ANM2::Play(&npc->_sprite,(byte *)"ChargeHit",0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); if ((npc->_sprite)._flipX == 0) { puVar9 = &DAT_bf800000; } else { puVar9 = (undefined1 *)0x3f800000; } (npc->_velocity).x = (float)puVar9 * 5.0 + (npc->_velocity).x; (npc->_velocity).y = (npc->_velocity).y + 0.0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } fVar7 = (npc->_targetPosition).x; if ((fVar7 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { npc->_friction = npc->_friction * 0.9; } else { fVar12 = npc->_friction * 0.7; npc->_friction = fVar12; fVar8 = (npc->_targetPosition).y; fVar1 = (npc->_pos).y; if (fVar12 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).x = ((fVar7 - (npc->_pos).x) * fVar2) / fVar12 + (npc->_velocity).x; (npc->_velocity).y = (fVar2 * (fVar8 - fVar1)) / fVar12 + (npc->_velocity).y; } } LAB_004d9f3c: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; LAB_004d9911: npc->_state = 3; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } if ((((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && (deformNull = AnimationState::GetNullFrame(&(npc->_sprite)._overlayAnimState,(byte *)"Deform") , deformNull != (void *)0x0)) && (*(char *)((int)deformNull + 0xc) != '\0')) { bodyLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (bodyLayer->_size).x = *(float *)((int)deformNull + 0x10); (bodyLayer->_size).y = *(float *)((int)deformNull + 0x14); } if (npc->_dead != 0) { local_11c = (Room *)0x3; do { rngResult = Random(); scratchVec.x = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0; rngResult = Random(); gibColor._offset[0] = 0.0; gibColor._offset[1] = 0.0; gibColor._offset[2] = 0.0; scratchVec2.x = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 - 0.5) * 80.0 + (npc->_pos).x; scratchVec2.y = scratchVec.x + (npc->_pos).y; gibColor._tint[0] = 1.0; gibColor._tint[1] = 1.0; gibColor._tint[2] = 1.0; gibColor._tint[3] = 1.0; gibColor._colorize[0] = 0.0; gibColor._colorize[1] = 0.0; gibColor._colorize[2] = 0.0; gibColor._colorize[3] = 0.0; rngResult = Random(); scratchVec.x = -10.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 40.0; rngResult = Random(); seed = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&scratchVec2,&g_vectorZero,(Entity *)0x0, (rngResult & 1) + 3,seed); (**(code **)(*(int *)tmpEntity + 0x3c))(&gibColor,0xffffffff,0xff,0,1); local_11c = (Room *)((int)local_11c + -1); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = scratchVec.x; tmpEntity->_renderDepthOffset = 10.0; } while (local_11c != (Room *)0x0); } return; } //@@ 004da590 NpcAI::ENTITY_ROTTEN_GAPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: 10.3, from NpcAI::ENTITY_GAPER */ void __fastcall NpcAI::ENTITY_ROTTEN_GAPER(Entity_NPC *npc) { code *pcVar1; undefined1 *puVar2; byte bVar3; uint speedIndex; EntityList *groupQuery; Vector *resizedVec; Vector *pVVar4; Entity *pEVar5; int extraout_EAX; void *pvVar6; uint subTypeIndex; int killEventsBytes; uint uVar7; int iVar8; float fVar9; float fVar10; float fVar11; undefined1 auVar12 [12]; Vector local_14c; float local_144; Vector local_140; Vector local_134; float local_12c; Vector local_128; undefined1 isOtherCharmed; float local_11c; ProjectileParams projParams; void *vertAnimName; char local_68 [12]; uint vertAnimSize; uint vertAnimCapacity; void *horiAnimName; char local_50 [4]; undefined1 local_4c [12]; uint local_40; undefined1 subTypeSpeeds [16]; EntityList_EL local_2c; void *local_1c; undefined1 *puStack_18; undefined4 local_14; EntityPtr *entityRefSlot; undefined4 flagsHigh; EntityPtr followTarget; Game *game; local_2c._size = (int)(subTypeSpeeds + 0x38); local_14 = 0xffffffff; puStack_18 = &LAB_00af39ad; local_1c = ExceptionList; local_2c._capacity = __security_cookie ^ (uint)(subTypeSpeeds + 0x2c); ExceptionList = &local_1c; iVar8 = npc->_state; local_2c._0_4_ = 0x3f666666; local_2c._data = (void *)0x3ff33333; subTypeSpeeds = _DAT_00babec0; if (iVar8 == 0) { puVar2 = subTypeSpeeds + 0x38; if ((npc->_subtype == 0) && (puVar2 = subTypeSpeeds + 0x38, npc->_type == 10)) { uVar7 = npc->_initSeed; local_4c._4_8_ = 0x500000001; local_128.y = 2.24208e-44; if (uVar7 == 0) { local_2c._size = (int)(subTypeSpeeds + 0x38); KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = uVar7 >> 1 ^ uVar7; uVar7 = uVar7 << 5 ^ uVar7; Entity_NPC::Morph(npc,npc->_type,npc->_variant,(uVar7 >> 0x10 ^ uVar7) % 5 + 1,-1); puVar2 = (undefined1 *)local_2c._size; } local_2c._size = (int)puVar2; bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } npc->_state = 4; fVar9 = g_colorGreenSplat._tint[3]; fVar11 = g_colorGreenSplat._tint[2]; fVar10 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar11; (npc->_splatColor)._tint[3] = fVar9; fVar9 = g_colorGreenSplat._colorize[3]; fVar11 = g_colorGreenSplat._colorize[2]; fVar10 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar11; (npc->_splatColor)._colorize[3] = fVar9; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } goto LAB_004db039; } if ((iVar8 != 4) && (local_2c._size = (int)(subTypeSpeeds + 0x38), iVar8 != 8)) goto LAB_004db039; vertAnimCapacity = 0xf; vertAnimSize = 8; vertAnimName = (void *)0x6b6c6157; builtin_strncpy(local_68,"Vert",5); local_40 = 0xf; local_4c._8_4_ = 8; horiAnimName = (void *)0x6b6c6157; builtin_strncpy(local_50,"Hori",4); local_4c[0] = '\0'; local_14 = 1; local_2c._size = (int)(subTypeSpeeds + 0x38); Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimName,(std_string *)&vertAnimName,0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_40) { uVar7 = local_40 + 1; pvVar6 = horiAnimName; if (0xfff < uVar7) { pvVar6 = *(void **)((int)horiAnimName + -4); uVar7 = local_40 + 0x24; if (0x1f < (uint)((int)horiAnimName + (-4 - (int)pvVar6))) goto LAB_004da6e3; } operator_delete(pvVar6,uVar7); } local_14 = 0xffffffff; local_4c._4_8_ = local_4c._4_8_ & 0xffffffff; local_40 = 0xf; horiAnimName = (void *)((uint)horiAnimName & 0xffffff00); if (0xf < vertAnimCapacity) { uVar7 = vertAnimCapacity + 1; pvVar6 = vertAnimName; if (0xfff < uVar7) { pvVar6 = *(void **)((int)vertAnimName + -4); uVar7 = vertAnimCapacity + 0x24; if (0x1f < (uint)((int)vertAnimName + (-4 - (int)pvVar6))) { LAB_004da6e3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar7); } if ((((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) && ((bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1), bVar3 != 0 && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)))) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } if ((((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat (&(npc->_sprite)._overlayAnimState,(float)(int)(npc->_sprite)._animState._animFrame); } npc->_aiFloat = 0.6; if (npc->_type == 0x390) { fVar10 = npc->_speedMultiplier; npc->_friction = npc->_friction * 0.75; (npc->_velocity).x = fVar10 * 0.0 + (npc->_velocity).x; (npc->_velocity).y = (npc->_velocity).y - fVar10 * 1.0; uVar7 = Random(); if (uVar7 % 10 == 0) { Entity_NPC::PlaySound(npc,0xa5,1.0,0x28,0,1.0); } goto LAB_004db039; } Entity_NPC::CalcTargetPosition(npc,&local_134,0.0); uVar7 = npc->_subtype; if (uVar7 < 6) { subTypeIndex = -(uint)(uVar7 != 0) & uVar7; speedIndex = 5; if (subTypeIndex < 5) { speedIndex = subTypeIndex; } npc->_aiFloat = *(float *)(subTypeSpeeds + speedIndex * 4) * npc->_aiFloat; } if (uVar7 == 3) { entityRefSlot = &npc->_entityRef; if ((npc->_i1 < 1) || (iVar8 = npc->_i1 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime), npc->_i1 = iVar8, iVar8 < 1)) { if (*entityRefSlot != (EntityPtr)0x0) { local_128.y = (float)entityRefSlot; std::multiset::erase(&local_128.y); } *entityRefSlot = (EntityPtr)0x0; LAB_004da8b4: fVar10 = local_134.y - (npc->_pos).y; fVar11 = local_134.x - (npc->_pos).x; if (6400.0 < fVar10 * fVar10 + fVar11 * fVar11) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_4c,&npc->_pos, 60.0,8); uVar7 = 0; local_14 = 2; if (local_40 != 0) { do { followTarget = *(EntityPtr *)(local_4c._4_4_ + uVar7 * 4); if ((followTarget != (EntityPtr)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (iVar8 = 1, *(int *)((int)followTarget + 0x28) == 1)) || (iVar8 = *(int *)((int)followTarget + 0x28), iVar8 - 10U < 0x3de)) && ((((followTarget != (EntityPtr)npc && (iVar8 == npc->_type)) && (*(int *)((int)followTarget + 0x2c) == npc->_variant)) && (*(int *)((int)followTarget + 0x30) != npc->_subtype)))))) { local_140.y = *(float *)((int)followTarget + 0x16c); isOtherCharmed = (*(uint *)((int)followTarget + 0x168) & 0x20000000) != 0; if (((bool)isOtherCharmed == ((npc->_flags & 0x20000000) != 0)) && ((*(uint *)((int)followTarget + 0x168) & 0x10) == 0)) { if (npc->_entityRef != (EntityPtr)0x0) { local_128.y = (float)&npc->_entityRef; std::multiset::erase(&local_128.y); } npc->_entityRef = followTarget; std::multiset::insert(&npc->_entityRef); uVar7 = Random(); npc->_i1 = uVar7 % 0xf + 0x1e; break; } } uVar7 = uVar7 + 1; } while (uVar7 < local_40); } local_14 = 0xffffffff; if (local_4c[0] == '\0') { local_14 = 3; tracked_alloc(1,(void *)local_4c._4_4_,0); local_14 = 0xffffffff; } } } else if (*entityRefSlot == (EntityPtr)0x0) goto LAB_004da8b4; npc->_i2 = npc->_i2 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if ((0x3c < npc->_i2) && (uVar7 = Random(), (uVar7 & 7) == 0)) { npc->_i2 = 0; groupQuery = Entity_NPC::QueryNPCsGroup((EntityList *)local_4c,npc->_index); uVar7 = *(uint *)&groupQuery->field_0xc; EntityList_Query::~EntityList_Query(local_4c); if (uVar7 < 6) { uVar7 = Random(); pEVar5 = Game::Spawn(g_game,0x355,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar7); flagsHigh = *(undefined4 *)((int)&pEVar5->_flags + 4); iVar8 = *(int *)pEVar5; *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar5->_flags + 4) = flagsHigh; (**(code **)(iVar8 + 0xc))(); pEVar5[3]._sprite._filename._size = npc->_index; } } uVar7 = Random(); if ((uVar7 % 0x14 == 0) && (iVar8 = Entity::GetIntervalTicks((Entity *)npc,4.0,0.0), iVar8 != 0) ) { uVar7 = Random(); pEVar5 = Game::Spawn(g_game,1000,0x3f,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)pEVar5 + 0xc))(); } } if ((npc->_flags & 0x1000800) == 0) { followTarget = npc->_entityRef; if (followTarget != (EntityPtr)0x0) { local_128.x = *(float *)((int)followTarget + 0x33c); local_128.y = *(float *)((int)followTarget + 0x340); goto LAB_004dab8e; } if (npc->_subtype == 5) { pVVar4 = &npc->_pos; fVar10 = (npc->_pos).y - local_134.y; fVar11 = (npc->_pos).x - local_134.x; fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); game = g_game; fVar10 = (fVar10 - 80.0) / 100.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } npc->_aiFloat = (fVar10 * 0.25 + 0.75) * npc->_aiFloat; bVar3 = Room::CheckLine(game->_room,pVVar4,&local_134,0,0,0,0,(Vector *)0x0); if (bVar3 == 0) { iVar8 = -1; goto LAB_004dae72; } uVar7 = Random(); local_128.y = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_144 = cos(local_128.y); fVar9 = sin(local_128.y); fVar10 = (npc->_velocity).x; fVar11 = (npc->_velocity).y; local_140.x = local_144 * fVar10 - fVar9 * fVar11; local_12c = local_134.y; local_134.y = local_134.y - (npc->_pos).y; local_140.y = local_144 * fVar11 + fVar9 * fVar10; local_11c = local_134.x; local_134.x = local_134.x - pVVar4->x; fVar10 = sqrtf(local_134.x * local_134.x + local_134.y * local_134.y); resizedVec = Vector::Resized(&local_140,&local_14c,fVar10); local_140.x = (pVVar4->x + resizedVec->x) - local_11c; local_140.y = ((npc->_pos).y + resizedVec->y) - local_12c; resizedVec = Vector::Resized(&local_140,(Vector *)(local_4c + 8),60.0); local_134.x = local_11c + resizedVec->x; local_134.y = local_12c + resizedVec->y; local_140.x = local_134.x - pVVar4->x; local_140.y = local_134.y - (npc->_pos).y; pVVar4 = Vector::Normalized(&local_140,(Vector *)(local_4c + 8)); fVar10 = npc->_aiFloat; fVar11 = npc->_speedMultiplier; fVar9 = pVVar4->y; (npc->_velocity).x = fVar10 * pVVar4->x * fVar11 + (npc->_velocity).x; (npc->_velocity).y = fVar10 * fVar9 * fVar11 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.9; } else { iVar8 = 900; if (npc->_subtype == 2) { iVar8 = -1; } LAB_004dae72: PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_134,npc->_aiFloat,iVar8,1); } } else { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_128.x = (pEVar5->_pos).x; local_128.y = (pEVar5->_pos).y; LAB_004dab8e: PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_128,0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); bVar3 = Entity::IsHostileTo((Entity *)npc,pEVar5); if (((bVar3 == 0) || ((npc->_pathfinder)._hasDirectPath == 0)) || (uVar7 = Random(), uVar7 % 3 != 0)) goto LAB_004db039; } else { bVar3 = input_is_action_triggered(g_manager,10,npc->_controllerID,(Entity *)npc,0); if (bVar3 == 0) goto LAB_004db039; } Entity_NPC::PlaySound(npc,0xa5,1.0,0x28,0,1.0); LAB_004db039: if ((npc->_type == 0x390) && (npc->_dead != 0)) { pvVar6 = (npc->_killDamageEvents)._begin; killEventsBytes = (int)(npc->_killDamageEvents)._end - (int)pvVar6; local_14c.y = 0.0; iVar8 = killEventsBytes >> 0x1f; if (killEventsBytes / 0x38 + iVar8 != iVar8) { local_12c = 0.0; do { if ((*(int *)((int)pvVar6 + (int)local_12c + 0x10) == 0x390) && (*(int *)((int)pvVar6 + (int)local_12c + 0x14) == 0)) { ProjectileParams::ProjectileParams(&projParams); projParams.VelocityMulti = 0.4; Entity_NPC::FireBossProjectiles(npc,4,&g_vectorZero,10.0,&projParams); pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_11c = (pEVar5->_pos).x; local_134.y = (pEVar5->_pos).y; uVar7 = Random(); local_144 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_144 = local_144 + local_144; uVar7 = Random(); local_128.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar10 = cos(local_144); local_11c = (fVar10 * 40.0 * local_128.y + local_11c) - (npc->_pos).x; fVar10 = sin(local_144); projParams.VelocityMulti = 1.0; projParams.FallingAccelModifier = -0.06; projParams.Variant = 0xf; local_128.y = (fVar10 * 40.0 * local_128.y + local_134.y) - (npc->_pos).y; local_134.y = local_128.y * local_128.y + local_11c * local_11c; local_140.x = sqrtf(local_134.y); if (local_140.x <= 0.0) { local_140.x = local_11c; local_140.y = local_128.y; } else { auVar12 = ZEXT812(0x41c80000); if (local_140.x * 0.05 <= auVar12._0_4_) { auVar12._4_8_ = auVar12._4_8_; auVar12._0_4_ = local_140.x * 0.05; } local_140.x = auVar12._0_4_ / local_140.x; local_140.y = local_140.x * local_128.y; local_140.x = local_140.x * local_11c; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_140,0,&projParams); if (extraout_EAX != 0) { *(undefined4 *)(extraout_EAX + 0x418) = 0x3fa8f5c3; local_11c = sqrtf(local_134.y); fVar10 = sqrtf(*(float *)(extraout_EAX + 0x364) * *(float *)(extraout_EAX + 0x364) + *(float *)(extraout_EAX + 0x360) * *(float *)(extraout_EAX + 0x360)); local_11c = local_11c / fVar10; fVar10 = pow(0.9,local_11c); fVar10 = (fVar10 - 1.0) * -9.491221; if (fVar10 <= 0.01) { fVar10 = 0.01; } *(float *)(extraout_EAX + 0x414) = ((-5.0 - *(float *)(extraout_EAX + 0x410)) - (local_11c - fVar10) * 14.200001) / fVar10; } } pvVar6 = (npc->_killDamageEvents)._begin; local_12c = (float)((int)local_12c + 0x38); local_14c.y = (float)((int)local_14c.y + 1); } while ((uint)local_14c.y < (uint)(((int)(npc->_killDamageEvents)._end - (int)pvVar6) / 0x38) ); } } ExceptionList = local_1c; return; } //@@ 004db3c0 NpcHelper::twitchy_jump_target /* DB: Twitchy: Isaac + vel*.1*dist, +40 overshoot, free cell, capped 200 from it */ void NpcHelper::twitchy_jump_target(void) { Room *this; Entity *pEVar1; Vector *pVVar2; uint uVar3; Vector *in_ECX; int iVar4; Entity_NPC *in_EDX; int iVar5; float fVar6; float fVar7; float fVar8; Vector local_18; float local_10; float local_c; float local_8; this = g_game->_room; Entity_NPC::CalcTargetPosition(in_EDX,in_ECX,0.0); pEVar1 = Entity_NPC::GetPlayerTarget(in_EDX); local_8 = (pEVar1->_velocity).y; fVar7 = (in_EDX->_pos).x - (pEVar1->_pos).x; local_c = (pEVar1->_velocity).x; fVar6 = (in_EDX->_pos).y - (pEVar1->_pos).y; fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); local_c = local_c * 0.1 * fVar6 + in_ECX->x; local_8 = local_8 * 0.1 * fVar6 + in_ECX->y; in_ECX->x = local_c; in_ECX->y = local_8; local_18.y = local_8 - (in_EDX->_pos).y; local_10 = local_c - (in_EDX->_pos).x; fVar6 = sqrtf(local_18.y * local_18.y + local_10 * local_10); if (fVar6 <= 0.0) { fVar7 = local_10; fVar6 = local_18.y; } else { fVar7 = local_10 * (1.0 / fVar6); fVar6 = local_18.y * (1.0 / fVar6); } in_ECX->x = fVar7 * 40.0 + local_c; in_ECX->y = fVar6 * 40.0 + local_8; pVVar2 = Room::GetClampedPositionImpl(this,&local_18,in_ECX,0.0,0.0,0.0,0.0); local_8 = pVVar2->x; in_ECX->x = local_8; local_c = pVVar2->y; in_ECX->y = local_c; fVar7 = (in_EDX->_pos).x - local_8; fVar6 = (in_EDX->_pos).y - local_c; fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); if (fVar6 <= 200.0) { fVar6 = local_8; fVar7 = local_c; } else { local_c = local_c - (in_EDX->_pos).y; local_8 = local_8 - (in_EDX->_pos).x; fVar6 = sqrtf(local_c * local_c + local_8 * local_8); if (fVar6 <= 0.0) { fVar7 = local_8; fVar8 = local_c; } else { fVar7 = local_8 * (1.0 / fVar6); fVar8 = local_c * (1.0 / fVar6); } fVar6 = fVar7 * 200.0 + (in_EDX->_pos).x; fVar7 = fVar8 * 200.0 + (in_EDX->_pos).y; in_ECX->x = fVar6; in_ECX->y = fVar7; } iVar4 = (int)((fVar7 - 120.0) / 40.0 + 0.5); iVar5 = (int)((fVar6 - 40.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (this->_gridWidth <= iVar5)) || (iVar4 < 0)) || (this->_gridHeight <= iVar4)) { iVar5 = -1; } else { iVar5 = this->_gridWidth * iVar4 + iVar5; } uVar3 = Room::GetGridCollision(this,iVar5); if (0 < (int)uVar3) { pVVar2 = Room::FindFreeTilePosition(this,&local_18,in_ECX,64.0); in_ECX->x = pVVar2->x; in_ECX->y = pVVar2->y; } return; } //@@ 004db6a0 NpcAI::ENTITY_TWITCHY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 851 (from dispatcher 006c2990) */ Entity_Effect * __fastcall NpcAI::ENTITY_TWITCHY(Entity_NPC *npc) { float fVar1; byte bVar2; float *pfVar3; Entity *playerTarget; Vector *targetPos; char *animName; byte *curAnim; int iVar4; int iVar5; Entity_Effect *splat; void *freeBlock; byte *curAnim; byte *pbVar7; uint uVar8; Vector *pVVar9; bool isLess; float fVar10; float fVar11; float fVar12; float fVar13; double dVar14; undefined8 uVar15; Vector local_84; Vector local_7c; float local_74; float local_70; float local_6c; float local_68; Entity_NPC *local_64; float local_60; float local_5c; Vector *local_58; void *vertAnimBuf; char local_50 [12]; uint vertAnimSize; uint vertAnimCapacity; void *horiAnimBuf; char local_38 [4]; EntityList_EL local_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; Room *room; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af39fd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; pVVar9 = (Vector *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); iVar4 = npc->_state; local_64 = npc; local_58 = pVVar9; if (iVar4 == 0) { npc->_state = 4; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } fVar1 = g_colorGreenSplat._tint[3]; fVar13 = g_colorGreenSplat._tint[2]; fVar11 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar11; (npc->_splatColor)._tint[2] = fVar13; (npc->_splatColor)._tint[3] = fVar1; fVar1 = g_colorGreenSplat._colorize[3]; fVar13 = g_colorGreenSplat._colorize[2]; fVar11 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar11; (npc->_splatColor)._colorize[2] = fVar13; (npc->_splatColor)._colorize[3] = fVar1; fVar11 = g_colorGreenSplat._offset[1]; (npc->_splatColor)._offset[0] = g_colorGreenSplat._offset[0]; (npc->_splatColor)._offset[1] = fVar11; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } npc->_projectileCooldown = 0; npc->_stateFrame = 0; (npc->_v1).x = 0.0; npc->_i1 = 0; } else { if (iVar4 == 4) { if ((npc->_flags & 0x1000800) == 0) { uVar15 = 0x100000000; fVar11 = 0.6; puStack_20 = local_38 + 0x34; targetPos = Entity_NPC::CalcTargetPosition(npc,&local_84,0.0); PathFinder::FindGridPath ((PathFinder *)&npc->_pathfinder,targetPos,fVar11,(int)uVar15, (byte)((ulonglong)uVar15 >> 0x20)); } else { puStack_20 = local_38 + 0x34; playerTarget = Entity_NPC::GetPlayerTarget(npc); local_7c.x = (playerTarget->_pos).x; local_7c.y = (playerTarget->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_7c,0); npc->_friction = npc->_friction * 0.8; } if ((npc->_pathfinder)._hasDirectPath != 0) { uVar8 = Random(); manager = g_manager; if (uVar8 % 3 == 0) { local_5c = 2.34017e-43; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,0.8,0x78,0,1.0,0.0); pVVar9 = local_58; } } uVar8 = Random(); if (((uVar8 % 0x46 == 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) { curAnim = (npc->_sprite)._overlayAnimState._animData; if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } curAnim = s_Head; do { bVar2 = *curAnim; isLess = bVar2 < *curAnim; if (bVar2 != *curAnim) { LAB_004dbb56: uVar8 = -(uint)isLess | 1; goto LAB_004dbb5b; } if (bVar2 == 0) break; bVar2 = curAnim[1]; isLess = bVar2 < curAnim[1]; if (bVar2 != curAnim[1]) goto LAB_004dbb56; curAnim = curAnim + 2; curAnim = curAnim + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004dbb5b: if (uVar8 == 0) { uVar8 = Random(); animName = "HeadTwitch"; if ((uVar8 & 1) == 0) { animName = "HeadTwitch2"; } ANM2::PlayOverlay(&npc->_sprite,(byte *)animName,0); } } iVar4 = npc->_projectileCooldown; if (0 < iVar4) { iVar4 = iVar4 - (int)pVVar9; npc->_projectileCooldown = iVar4; } if (0 < npc->_i2) { npc->_i2 = npc->_i2 - (int)pVVar9; } if (((iVar4 < 1) && (uVar8 = Random(), uVar8 % 0x1e == 0)) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 == 0)) { NpcHelper::twitchy_jump_target(); fVar11 = (npc->_pos).y - local_7c.y; fVar13 = (npc->_pos).x - local_7c.x; fVar11 = sqrtf(fVar11 * fVar11 + fVar13 * fVar13); if ((fVar11 < 260.0) || (uVar8 = Random(), uVar8 % 10 == 0)) { AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,s_Jump,0); npc->_state = 6; (npc->_targetPosition).x = local_7c.x; (npc->_targetPosition).y = local_7c.y; (npc->_v1).x = 0.0; npc->_entityGridCollisionClass = 3; uVar8 = Random(); npc->_i1 = uVar8 % 3 + 1; goto LAB_004dbe52; } } } else { puStack_20 = local_38 + 0x34; if (iVar4 != 6) goto LAB_004dbe52; if (((npc->_targetPosition).x != g_vectorZero.x) || (puStack_20 = local_38 + 0x34, (npc->_targetPosition).y != g_vectorZero.y)) { puStack_20 = local_38 + 0x34; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = local_38 + 0x34; bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump); if (bVar2 != 0) { fVar12 = npc->_speedMultiplier * 0.03 + (npc->_v1).x; (npc->_v1).x = fVar12; fVar11 = (npc->_pos).y; fVar13 = (npc->_pos).x; fVar1 = (npc->_targetPosition).y; fVar10 = npc->_friction; (npc->_velocity).x = ((((npc->_targetPosition).x - fVar13) * fVar12 + fVar13) - fVar13) / fVar10; (npc->_velocity).y = (((fVar1 - fVar11) * fVar12 + fVar11) - fVar11) / fVar10; if (1.0 <= (npc->_v1).x) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } goto LAB_004db831; } } npc->_friction = npc->_friction * 0.6; } LAB_004db831: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); manager = g_manager; if (bVar2 != 0) { local_5c = 9.66896e-44; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,1.0,2,0,1.0,0.0); npc->_entityGridCollisionClass = 5; npc->_i1 = npc->_i1 + -1; if (0 < npc->_i1) { bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Jump,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,2.0); } pfVar3 = (float *)NpcHelper::twitchy_jump_target(); (npc->_targetPosition).x = *pfVar3; (npc->_targetPosition).y = pfVar3[1]; (npc->_v1).x = 0.0; npc->_entityGridCollisionClass = 3; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004dbe52; } npc->_state = 4; npc->_projectileCooldown = 5; } vertAnimCapacity = 0xf; vertAnimSize = 8; vertAnimBuf = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); local_34._size = 0xf; local_34._capacity = 8; horiAnimBuf = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",4); local_34._0_1_ = '\0'; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimBuf,(std_string *)&vertAnimBuf,0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_34._size) { uVar8 = local_34._size + 1; freeBlock = horiAnimBuf; if (0xfff < uVar8) { freeBlock = *(void **)((int)horiAnimBuf + -4); uVar8 = local_34._size + 0x24; if (0x1f < (uint)((int)horiAnimBuf + (-4 - (int)freeBlock))) goto LAB_004dba1f; } operator_delete(freeBlock,uVar8); } local_14 = 0xffffffff; local_34._capacity = 0; local_34._size = 0xf; horiAnimBuf = (void *)((uint)horiAnimBuf & 0xffffff00); if (0xf < vertAnimCapacity) { uVar8 = vertAnimCapacity + 1; freeBlock = vertAnimBuf; if (0xfff < uVar8) { freeBlock = *(void **)((int)vertAnimBuf + -4); uVar8 = vertAnimCapacity + 0x24; if (0x1f < (uint)((int)vertAnimBuf + (-4 - (int)freeBlock))) { LAB_004dba1f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar8); } vertAnimSize = 0; vertAnimCapacity = 0xf; vertAnimBuf = (void *)((uint)vertAnimBuf & 0xffffff00); if ((((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) || ((ANM2::PlayOverlay(&npc->_sprite,s_Head,0), (npc->_sprite)._overlayAnimState._animData != (void *)0x0 && ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) { curAnim = (npc->_sprite)._overlayAnimState._animData; if (curAnim == (byte *)0x0) { curAnim = &s_empty; } else if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } curAnim = s_Head; do { bVar2 = *curAnim; isLess = bVar2 < *curAnim; if (bVar2 != *curAnim) { LAB_004dbd37: uVar8 = -(uint)isLess | 1; goto LAB_004dbd3c; } if (bVar2 == 0) break; bVar2 = curAnim[1]; isLess = bVar2 < curAnim[1]; if (bVar2 != curAnim[1]) goto LAB_004dbd37; curAnim = curAnim + 2; curAnim = curAnim + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004dbd3c: if (uVar8 == 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) { iVar4 = -1; } else { local_58 = (Vector *)(npc->_sprite)._animState._animFrame; dVar14 = floor((double)(float)local_58); local_58 = (Vector *)(float)dVar14; iVar4 = (int)dVar14; } AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar4); } } } LAB_004dbe52: if ((npc->_state != 4) || (0 < npc->_i2)) goto LAB_004dc414; local_58 = &npc->_pos; EntityList::QueryRadius((EntityList *)((int)g_game->_room + 0x1218),&local_34,local_58,200.0,0xc); pVVar9 = local_58; local_14 = 2; if ((float)local_34._size != 0.0) { fVar13 = 1e+08; local_6c = 0.0; local_60 = 1e+08; local_5c = 0.0; fVar11 = (float)local_34._size; if ((float)local_34._size != 0.0) { do { fVar1 = *(float *)((int)local_34._data + (int)local_5c * 4); iVar4 = *(int *)((int)fVar1 + 0x28); if (((iVar4 == 2) || (iVar4 == 8)) || (iVar4 == 4)) { local_68 = *(float *)((int)fVar1 + 0x33c); local_70 = *(float *)((int)fVar1 + 0x340); if (iVar4 == 8) { local_58 = (Vector *)(*(float *)((int)fVar1 + 0x438) * 0.017453292); local_74 = sin((float)local_58); fVar10 = cos((float)local_58); iVar4 = *(int *)((int)fVar1 + 0x28); fVar10 = fVar10 * *(float *)((int)fVar1 + 0x448); fVar12 = *(float *)((int)fVar1 + 0x448) * local_74; fVar11 = (float)local_34._size; fVar13 = local_60; } else { fVar10 = *(float *)((int)fVar1 + 0x360); fVar12 = *(float *)((int)fVar1 + 0x364); } fVar12 = pVVar9->y - (local_70 + fVar12 * 4.0); fVar10 = pVVar9->x - (local_68 + fVar10 * 4.0); fVar10 = fVar12 * fVar12 + fVar10 * fVar10; if (iVar4 == 4) { fVar13 = fVar13 * 0.25; local_60 = fVar13; } if (fVar13 <= fVar10) goto LAB_004dbfda; local_6c = fVar1; local_60 = fVar10; } else { LAB_004dbfda: fVar10 = fVar13; } npc = local_64; local_5c = (float)((int)local_5c + 1); fVar13 = fVar10; } while ((uint)local_5c < (uint)fVar11); if ((local_6c != 0.0) && (fVar10 < 1600.0)) { local_70 = *(float *)((int)local_6c + 0x340) - (local_64->_pos).y; local_68 = *(float *)((int)local_6c + 0x33c) - (local_64->_pos).x; local_64 = (Entity_NPC *)cos(1.5707964); fVar11 = sin(1.5707964); local_6c = local_68 * (float)local_64 - fVar11 * local_70; local_68 = local_68 * fVar11 + (float)local_64 * local_70; fVar11 = sqrtf(local_68 * local_68 + local_6c * local_6c); if (0.0 < fVar11) { local_6c = (1.0 / fVar11) * local_6c; local_68 = local_68 * (1.0 / fVar11); } iVar4 = 0; local_74 = g_vectorZero.x; local_5c = g_vectorZero.y; do { uVar8 = Random(); if ((uVar8 & 1) == 0) { local_58 = (Vector *)local_6c; local_60 = local_68; } else { local_58 = (Vector *)-local_6c; local_60 = -local_68; } uVar8 = Random(); local_64 = (Entity_NPC *) (((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292); local_70 = cos((float)local_64); fVar11 = sin((float)local_64); local_64 = (Entity_NPC *)((float)local_58 * local_70 - local_60 * fVar11); local_60 = local_60 * local_70 + (float)local_58 * fVar11; uVar8 = Random(); room = g_game->_room; local_7c.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 100.0 + 60.0; local_60 = local_7c.y * local_60; local_7c.y = local_7c.y * (float)local_64; local_70 = local_60 + (npc->_pos).y; local_64 = (Entity_NPC *)(local_7c.y + (npc->_pos).x); local_58 = (Vector *)(int)(((float)local_64 - 40.0) / 40.0 + 0.5); iVar5 = (int)((local_70 - 120.0) / 40.0 + 0.5); if ((((int)local_58 < 0) || (room->_gridWidth <= (int)local_58)) || ((iVar5 < 0 || (room->_gridHeight <= iVar5)))) { pfVar3 = (float *)0xffffffff; } else { pfVar3 = (float *)((int)&local_58->x + iVar5 * room->_gridWidth); } iVar5 = 0x4dc27a; uVar8 = Room::GetGridCollision(room,(int)pfVar3); if (uVar8 == 0) { local_84.x = (float)local_64; local_84.y = local_70; bVar2 = Entity::IsPlayerInRadius((Entity *)npc,&local_84,60.0,iVar5,(int)pfVar3); if (bVar2 == 0) { local_74 = local_7c.y + (npc->_pos).x; local_5c = local_60 + (npc->_pos).y; break; } } iVar4 = iVar4 + 1; } while (iVar4 < 10); if ((local_74 != g_vectorZero.x) || (local_5c != g_vectorZero.y)) { AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_004dc368: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Jump,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnim = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } pbVar7 = s_Jump; do { bVar2 = *curAnim; isLess = bVar2 < *pbVar7; if (bVar2 != *pbVar7) { LAB_004dc34a: uVar8 = -(uint)isLess | 1; goto LAB_004dc34f; } if (bVar2 == 0) break; bVar2 = curAnim[1]; isLess = bVar2 < pbVar7[1]; if (bVar2 != pbVar7[1]) goto LAB_004dc34a; curAnim = curAnim + 2; pbVar7 = pbVar7 + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004dc34f: if ((uVar8 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004dc368; } if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,5.0); } (npc->_targetPosition).x = local_74; npc->_state = 6; (npc->_targetPosition).y = local_5c; (npc->_v1).x = 0.0; npc->_entityGridCollisionClass = 3; npc->_i1 = 1; npc->_i2 = 2; } } } } local_14 = 0xffffffff; if (local_34._0_1_ == '\0') { local_14 = 3; tracked_alloc(1,local_34._data,0); local_14 = 0xffffffff; } LAB_004dc414: uVar8 = Random(); splat = (Entity_Effect *)(uVar8 / 6); if (uVar8 % 6 == 0) { uVar8 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } ExceptionList = local_1c; return splat; } //@@ 004dc490 NpcAI::ENTITY_SPIKEBALL /* NPC AI for entity type 852 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SPIKEBALL(Entity_NPC *npc) { uint *puVar1; char *pcVar2; Vector pos; float fVar3; byte bVar4; Vector *facingDir; uint uVar5; int iVar6; RoomDescriptor *currentRoom; int iVar7; Game *game; float fVar8; float fVar9; undefined1 auVar10 [12]; undefined1 auVar11 [12]; Vector local_44; Room *local_3c; Vector local_38; undefined4 killRef; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; void *collider; Room *room; Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,g_game->_currentDimensionIdx); game = g_game; if (npc->_aiCallPhase == 3) { collider = npc->_collisionEntity; if (*(int *)((int)collider + 0x28) == 0x354) { local_3c = (Room *)(*(float *)((int)collider + 0x33c) - (npc->_pos).x); local_44.x = *(float *)((int)collider + 0x340) - (npc->_pos).y; fVar8 = sqrtf((float)local_3c * (float)local_3c + local_44.x * local_44.x); if (0.0 < fVar8) { local_3c = (Room *)((float)local_3c * (1.0 / fVar8)); local_44.x = local_44.x * (1.0 / fVar8); } facingDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_38,npc->_i1); if (0.0 < local_44.x * facingDir->y + (float)local_3c * facingDir->x) { uVar5 = npc->_i1 + 2U & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } npc->_i1 = uVar5; return; } } collider = npc->_collisionEntity; if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)collider + 0x28) == 1)) || (*(int *)((int)collider + 0x28) - 10U < 0x3de)) && (((*(uint *)((int)collider + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0)) ) { npc->_collisionResult = 0; return; } } else { local_3c = g_game->_room; npc->_friction = npc->_friction * 0.7; if (npc->_state == 0) { npc->_i1 = npc->_subtype & 3; npc->_state = 3; npc->_isInvicible = 1; npc->_aiCallFlags = 4; iVar7 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar6 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar7 < 0) || (local_3c->_gridWidth <= iVar7)) || ((iVar6 < 0 || (local_3c->_gridHeight <= iVar6)))) { iVar7 = -1; } else { iVar7 = iVar6 * local_3c->_gridWidth + iVar7; } *(uint *)&npc->_flags = (uint)npc->_flags | 0x10011; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; (npc->_pathfinder)._gridIndex = iVar7; npc->_entityGridCollisionClass = 6; fVar3 = g_colorGreenSplat._tint[3]; fVar9 = g_colorGreenSplat._tint[2]; fVar8 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar8; (npc->_splatColor)._tint[2] = fVar9; (npc->_splatColor)._tint[3] = fVar3; fVar3 = g_colorGreenSplat._colorize[3]; fVar9 = g_colorGreenSplat._colorize[2]; fVar8 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar8; (npc->_splatColor)._colorize[2] = fVar9; (npc->_splatColor)._colorize[3] = fVar3; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } npc->_i2 = 0; iVar6 = Entity_NPC::GetAliveEnemyCount(npc); if ((0 < iVar6) || (*(char *)((int)game->_room + 0x7229) != '\0')) { npc->_i2 = 1; } } else if (npc->_state == 3) { Isaac::GetAxisAlignedUnitVectorFromDir(&local_44,npc->_i1); room = local_3c; fVar8 = npc->_speedMultiplier; (npc->_velocity).x = local_44.x * 3.0 * fVar8 + (npc->_velocity).x; (npc->_velocity).y = local_44.y * 3.0 * fVar8 + (npc->_velocity).y; local_38.x = local_44.x * 20.0 + (npc->_pos).x; local_38.y = local_44.y * 20.0 + (npc->_pos).y; pos.y = local_38.y; pos.x = local_38.x; iVar6 = Room::GetGridCollisionAtPos(local_3c,pos); if (1 < iVar6) { uVar5 = npc->_i1 + 2U & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } npc->_i1 = uVar5; } ANM2::Play(&npc->_sprite,s_Idle,0); game = g_game; iVar6 = (npc->_pathfinder)._gridIndex; fVar8 = npc->_speedMultiplier; if (ABS(local_44.y) <= ABS(local_44.x)) { auVar11 = ZEXT812(0x3f666666); if (fVar8 != 1.0) { fVar9 = auVar11._0_4_; auVar11._4_8_ = auVar11._4_8_; auVar11._0_4_ = fVar9 / ((fVar8 + fVar9) - fVar8 * fVar9); } fVar8 = (npc->_velocity).y; (npc->_velocity).y = ((((float)(iVar6 / room->_gridWidth) * 40.0 + 120.0) - (npc->_pos).y) - fVar8) * (1.0 - auVar11._0_4_) + fVar8; } else { auVar10 = ZEXT812(0x3f666666); if (fVar8 != 1.0) { fVar9 = auVar10._0_4_; auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar9 / ((fVar8 + fVar9) - fVar8 * fVar9); } fVar8 = (npc->_velocity).x; (npc->_velocity).x = ((((float)(iVar6 % room->_gridWidth) * 40.0 + 40.0) - (npc->_pos).x) - fVar8) * (1.0 - auVar10._0_4_) + fVar8; } } if (((((npc->_i2 != 0) && (iVar6 = Entity_NPC::GetAliveEnemyCount(npc), iVar6 < 1)) && (pcVar2 = game->_room, *pcVar2 != '\0')) && ((0x50 < game->_frameCount - *(int *)(pcVar2 + 0x11f0) && (pcVar2[0x7229] == '\0')))) || ((currentRoom = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx, game->_currentDimensionIdx), ((uint)currentRoom->Flags >> 1 & 1) != 0 || (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar4 != 0)))) { local_20 = g_vectorZero.x; local_18 = g_vectorZero.x; local_1c = g_vectorZero.y; local_14 = g_vectorZero.y; killRef = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_10 = 0; local_c = 0; (**(code **)(*(int *)npc + 0x24))(&killRef); } if (npc->_dead != 0) { if (-1 < npc->_spawnGridIndex) { Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); std::set::insert(&local_38,&npc->_spawnGridIndex); if (npc->_dead == 0) { return; } } if (npc->_variant == 0) { uVar5 = Random(); Game::SpawnEx(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar5,0); } } } return; } //@@ 004dca90 NpcAI::ENTITY_UNBORN /* NPC AI for entity type 860 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_UNBORN(Entity_NPC *npc) { float fVar1; qword qVar2; byte bVar3; char isSteering; Vector *pVVar4; uint uVar5; Entity *target; qword *allocatedBytes; uint uVar6; float fVar7; float fVar8; float fVar9; float fVar10; double dVar11; int iVar12; EntityList_EL tears; Vector scratchVec; Vector local_54; float local_4c; float local_48; float local_44; float local_40; Room *local_3c; float local_38; float local_34; float local_30; float local_2c; float moveX; char isLandEffect; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af3a3d; local_1c = ExceptionList; local_3c = g_game->_room; isLandEffect = '\0'; switch(npc->_state) { case 0: npc->_state = 3; (npc->_v1).x = 0.0; return; default: goto switchD_004dcaef_caseD_1; case 3: ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.97; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uVar6 = Random(); manager = g_manager; if (uVar6 % 0x5a == 0) { local_40 = 1.52601e-42; seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,0x3c,0,1.0,0.0); } fVar7 = (npc->_velocity).x; fVar10 = (npc->_velocity).y; fVar7 = sqrtf(fVar7 * fVar7 + fVar10 * fVar10); fVar7 = fVar7 + fVar7; if ((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) { fVar7 = fVar7 * -1.0; } fVar7 = fVar7 + (npc->_v1).x; if (360.0 < ABS(fVar7)) { fVar7 = fmodf(fVar7,360.0); } if (fVar7 <= 180.0) { if (fVar7 < -180.0) { fVar7 = fVar7 + 360.0; } } else { fVar7 = fVar7 - 360.0; } (npc->_v1).x = fVar7; if (fVar7 < 0.0) { fVar7 = fVar7 + 360.0; } local_48 = (fVar7 * 12.0) / 360.0; dVar11 = floor((double)local_48); local_40 = (float)dVar11; bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&(npc->_sprite)._animState,(float)((int)local_40 + ((int)local_40 / 0xc) * -0xc)) , (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } if ((npc->_flags & 0x1000a00) == 0) { target = Entity_NPC::GetPlayerTarget(npc); fVar7 = (npc->_pos).y - (target->_pos).y; fVar10 = (npc->_pos).x - (target->_pos).x; fVar7 = sqrtf(fVar7 * fVar7 + fVar10 * fVar10); if ((fVar7 <= 100.0) || (500.0 <= fVar7)) { npc->_i1 = 0; } else { npc->_i1 = npc->_i1 + 1; if ((0x1e < npc->_i1) && (uVar6 = Random(), uVar6 % 0x1e == 0)) { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x - (npc->_pos).x; scratchVec.y = (target->_pos).y - (npc->_pos).y; pVVar4 = Vector::Normalized(&scratchVec,&local_54); manager = g_manager; local_40 = 1.52742e-42; (npc->_targetPosition).x = pVVar4->x; (npc->_targetPosition).y = pVVar4->y; npc->_state = 6; npc->_i1 = 0; seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,2,0,1.0,0.0); } } } if (npc->_collidesWithGrid != 0) { fVar7 = (npc->_gridCollisionVelocity).y; fVar10 = (npc->_gridCollisionVelocity).x; fVar8 = (npc->_gridCollisionNormal).x; fVar1 = (npc->_gridCollisionNormal).y; fVar9 = fVar7 * fVar1 + fVar10 * fVar8; (npc->_velocity).x = fVar10 - fVar8 * 1.4 * fVar9; (npc->_velocity).y = fVar7 - fVar1 * 1.4 * fVar9; } break; case 6: ExceptionList = &local_1c; npc->_friction = 0.8; (npc->_v1).x = 0.0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); ANM2::Play(&npc->_sprite,(byte *)"Teleport",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Effect"); if (bVar3 != 0) { npc->_shadowSize = 0.0; npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; target = Entity_NPC::GetPlayerTarget(npc); uVar6 = 0; local_30 = (target->_pos).x; local_2c = (target->_pos).y; local_40 = (npc->_targetPosition).x * 120.0 + local_30; local_38 = (npc->_targetPosition).y * 120.0 + local_2c; do { pVVar4 = &scratchVec; iVar12 = 0x3f800000; scratchVec.x = local_40; scratchVec.y = local_38; bVar3 = Room::IsPositionInRoom(local_3c,pVVar4,1.0); if ((bVar3 != 0) && (bVar3 = Entity::IsPlayerInRadius((Entity *)npc,&scratchVec,40.0,(int)pVVar4,iVar12), bVar3 == 0)) break; local_38 = (npc->_targetPosition).x; local_34 = (npc->_targetPosition).y; uVar5 = Random(); local_48 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 - 0.5; if (uVar6 < 3) { local_48 = local_48 * 90.0; } else { local_48 = local_48 * 180.0; if (6 < uVar6) { local_48 = local_48 + 180.0; } } local_48 = local_48 * 0.017453292; local_44 = cos(local_48); fVar7 = sin(local_48); uVar6 = uVar6 + 1; scratchVec.x = (local_44 * local_38 - fVar7 * local_34) * 120.0 + local_30; scratchVec.y = (fVar7 * local_38 + local_44 * local_34) * 120.0 + local_2c; local_40 = scratchVec.x; local_38 = scratchVec.y; } while (uVar6 < 10); pVVar4 = &scratchVec; iVar12 = 0x3f800000; bVar3 = Room::IsPositionInRoom(local_3c,pVVar4,1.0); if (bVar3 == 0) { ExceptionList = local_1c; return; } bVar3 = Entity::IsPlayerInRadius((Entity *)npc,&scratchVec,40.0,(int)pVVar4,iVar12); if (bVar3 == 0) { (npc->_pos).x = local_40; (npc->_pos).y = local_38; npc->_state = 7; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; case 7: ExceptionList = &local_1c; ANM2::Play(&npc->_sprite,(byte *)"TeleportEnd",0); if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004dd1cc: npc->_friction = 0.8; isSteering = isLandEffect; } else { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Effect"); if (bVar3 == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Effect"), bVar3 == 0)) goto LAB_004dd1cc; npc->_friction = 0.97; isSteering = '\x01'; } else { isLandEffect = '\x01'; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); npc->_entityCollisionClass = 4; npc->_friction = 0.97; local_48 = (npc->_velocity).x; local_44 = (npc->_velocity).y; fVar7 = sqrtf(local_48 * local_48 + local_44 * local_44); isSteering = isLandEffect; if (0.0 < fVar7) { (npc->_velocity).x = local_48 * (3.0 / fVar7); (npc->_velocity).y = local_44 * (3.0 / fVar7); } } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } if (isSteering == '\0') { ExceptionList = local_1c; return; } } Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); moveX = scratchVec.x - (npc->_pos).x; local_2c = scratchVec.y - (npc->_pos).y; fVar7 = sqrtf(moveX * moveX + local_2c * local_2c); if (0.0 < fVar7) { moveX = moveX * (1.0 / fVar7); local_2c = local_2c * (1.0 / fVar7); } local_30 = 0.0; local_40 = 256.0; EntityList::QuerySublist(&local_3c->_entityList,&tears,2,-1,-1,0,0); uVar6 = 0; local_14 = 0; if (tears._size != 0) { scratchVec.y = (npc->_pos).y; do { local_48 = *(float *)((int)tears._data + uVar6 * 4); local_44 = scratchVec.y - *(float *)((int)local_48 + 0x340); local_34 = (npc->_pos).x - *(float *)((int)local_48 + 0x33c); local_4c = local_44 * local_44 + local_34 * local_34; local_54.y = sqrtf(local_4c); fVar7 = 0.0; if ((*(float *)((int)local_48 + 0x360) == g_vectorZero.x) && (*(float *)((int)local_48 + 0x364) == g_vectorZero.y)) { LAB_004dd411: fVar7 = ((3.0 - fVar7 * 3.0) + 0.5) * local_54.y; if ((0.0 < fVar7) && (fVar7 <= local_40)) { local_40 = fVar7; local_30 = local_48; } } else { local_3c = (Room *)(*(float *)((int)local_48 + 0x360) * 0.25); local_38 = *(float *)((int)local_48 + 0x364) * 0.25; fVar7 = sqrtf((float)local_3c * (float)local_3c + local_38 * local_38); if ((1.0 < fVar7) && (0.0 < fVar7)) { local_3c = (Room *)((float)local_3c * (1.0 / fVar7)); local_38 = local_38 * (1.0 / fVar7); } fVar8 = sqrtf(local_4c); fVar7 = local_34; fVar10 = local_44; if (0.0 < fVar8) { fVar10 = local_44 * (1.0 / fVar8); fVar7 = local_34 * (1.0 / fVar8); } fVar7 = (float)local_3c * fVar7 + local_38 * fVar10; if (0.0 <= fVar7) goto LAB_004dd411; } uVar6 = uVar6 + 1; } while (uVar6 < (uint)tears._size); if (local_30 != 0.0) { local_34 = *(float *)((int)local_30 + 0x360); local_38 = *(float *)((int)local_30 + 0x364); if ((local_34 == g_vectorZero.x) && (local_38 == g_vectorZero.y)) { local_34 = (npc->_pos).x - *(float *)((int)local_30 + 0x33c); local_38 = (npc->_pos).y - *(float *)((int)local_30 + 0x340); } fVar7 = sqrtf(local_34 * local_34 + local_38 * local_38); if (0.0 < fVar7) { local_34 = (1.0 / fVar7) * local_34; local_38 = local_38 * (1.0 / fVar7); } scratchVec.y = cos(1.5707964); fVar7 = sin(1.5707964); local_3c = (Room *)(scratchVec.y * local_34 - fVar7 * local_38); local_38 = fVar7 * local_34 + scratchVec.y * local_38; if (((npc->_pos).y - *(float *)((int)local_30 + 0x340)) * local_38 + ((npc->_pos).x - *(float *)((int)local_30 + 0x33c)) * (float)local_3c < 0.0) { local_3c = (Room *)-(float)local_3c; local_38 = -local_38; } scratchVec.y = 20.0; local_44 = local_2c; local_54.y = 180.0 / (local_40 + 50.0); local_48 = moveX; pVVar4 = &scratchVec; if (local_54.y <= 20.0) { pVVar4 = &local_54; } fVar7 = sqrtf(moveX * moveX + local_2c * local_2c); if (0.0 < fVar7) { local_44 = (1.0 / fVar7) * local_2c; local_48 = (1.0 / fVar7) * moveX; } fVar7 = pVVar4->y; moveX = fVar7 * (float)local_3c + (moveX - fVar7 * local_48 * 0.1); local_2c = fVar7 * local_38 + (local_2c - fVar7 * local_44 * 0.1); } } if ((npc->_flags & 0x1000a00) == 0) { target = Entity_NPC::GetPlayerTarget(npc); moveX = moveX + (target->_velocity).x * 0.3; local_2c = (target->_velocity).y * 0.3 + local_2c; } moveX = moveX * 0.29 * npc->_speedMultiplier + (npc->_velocity).x; local_2c = local_2c * 0.29 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = moveX; (npc->_velocity).y = local_2c; fVar7 = sqrtf(moveX * moveX + local_2c * local_2c); if ((12.0 < fVar7) && (0.0 < fVar7)) { (npc->_velocity).x = moveX * (12.0 / fVar7); (npc->_velocity).y = local_2c * (12.0 / fVar7); } if (tears._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (tears._data != (void *)0x0) { uVar6 = *(uint *)((int)tears._data + -4); qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar6; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar6); free((uint *)((int)tears._data + -4)); } } switchD_004dcaef_caseD_1: ExceptionList = local_1c; return; } //@@ 004dd7f0 NpcAI::ENTITY_GASBAG /* DB: type 856; was FXLayers::AddPoopFx; strs Attack/Shoot/Sound */ void * __fastcall NpcAI::ENTITY_GASBAG(Entity_NPC *npc) { float fVar1; ANM2 *pAVar2; byte isEventTriggered; Vector *pVVar3; uint uVar4; EntityPtr armyFly; int iVar5; Entity *ringEffect; void *pvVar6; EntityPtr *pEVar7; float fVar8; undefined1 local_50 [12]; float local_44; Vector local_40; Vector local_38; EntityPtr *local_30; EntityPtr local_2c; void *room; char isBelowMaxFlies; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af3a60; local_1c = ExceptionList; ExceptionList = &local_1c; room = g_game->_room; pEVar7 = (EntityPtr *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); iVar5 = npc->_state; if (iVar5 == 0) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; local_38.y = 0.0; puStack_20 = local_50 + 0x4c; do { local_30 = (EntityPtr *) ((float)((double)(int)local_38.y + __uint_to_double_fixup[-((int)local_38.y >> 0x1f)]) * 45.0 * 0.017453292); local_2c = (EntityPtr)cos((float)local_30); fVar8 = sin((float)local_30); local_50._8_4_ = ((float)local_2c * 100.0 - fVar8 * 0.0) + (npc->_pos).x; local_44 = fVar8 * 100.0 + (float)local_2c * 0.0 + (npc->_pos).y; uVar4 = Random(); ringEffect = Game::SpawnEx(g_game,1000,0x8d,(Vector *)(local_50 + 8),&g_vectorZero, (Entity *)npc,0,uVar4,0); if (ringEffect->_parent != (EntityPtr)0x0) { local_30 = &ringEffect->_parent; std::multiset::erase(&local_30); } ringEffect->_parent = (EntityPtr)npc; std::multiset::insert(&ringEffect->_parent); iVar5 = *(int *)ringEffect; pAVar2 = &ringEffect[1]._sprite; (pAVar2->_filename)._buf[8] = '<'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &ringEffect[1]._sprite; (pAVar2->_filename)._buf[0xc] = '<'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar5 + 0xc))(); local_38.y = (float)((int)local_38.y + 1); } while ((uint)local_38.y < 8); uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x1e + 0xf; } else { local_30 = pEVar7; if (iVar5 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_projectileCooldown = npc->_projectileCooldown - (int)pEVar7; if (npc->_projectileCooldown < 1) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_50,0x364,-1,-1 ,0,0); isBelowMaxFlies = (uint)local_44 < 8; if (local_50[0] == '\0') { local_14 = 0; tracked_alloc(1,(void *)local_50._4_4_,0); local_14 = 0xffffffff; } if (isBelowMaxFlies != '\0') { npc->_projectileCooldown = 0; npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } } goto LAB_004dde15; } if (iVar5 != 8) goto LAB_004dde15; puStack_20 = local_50 + 0x4c; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = local_50 + 0x4c; isEventTriggered = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); manager = g_manager; if (isEventTriggered != 0) { local_2c = (EntityPtr)0x136; seed_fart_sound_override((int *)&local_2c); SoundEffects::Play(&manager->_sfxManager,(int)local_2c,1.0,2,0,1.0,0.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (isEventTriggered = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), manager = g_manager, isEventTriggered != 0)) { local_2c = (EntityPtr)0x6a; seed_fart_sound_override((int *)&local_2c); SoundEffects::Play(&manager->_sfxManager,(int)local_2c,1.0,2,0,1.0,0.0); manager = g_manager; local_2c = (EntityPtr)0x109; seed_fart_sound_override((int *)&local_2c); SoundEffects::Play(&manager->_sfxManager,(int)local_2c,1.0,2,0,1.0,0.0); npc->_projectileCooldown = 1; pVVar3 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_50 + 8),0.0); local_38.x = pVVar3->x - (npc->_pos).x; local_38.y = pVVar3->y - (npc->_pos).y; pVVar3 = Vector::ToCardinal(&local_40,&local_38); pEVar7 = &npc->_entityRef; (npc->_v1).x = pVVar3->x; (npc->_v1).y = pVVar3->y; if (*pEVar7 != (EntityPtr)0x0) { local_38.y = (float)pEVar7; std::multiset::erase(&local_38.y); } *pEVar7 = (EntityPtr)0x0; } } iVar5 = npc->_projectileCooldown; if ((0 < iVar5) && (0 < (int)local_30)) { do { if (iVar5 % 6 == 1) { uVar4 = Random(); fVar8 = (npc->_v1).x; fVar1 = (npc->_v1).y; local_40.x = fVar8 * 5.0; local_50._8_4_ = fVar8 * 10.0 + (npc->_pos).x; local_40.y = fVar1 * 5.0; local_44 = fVar1 * 10.0 + (npc->_pos).y; armyFly = (EntityPtr) Game::SpawnEx(g_game,0x364,0,(Vector *)(local_50 + 8),&local_40,(Entity *)npc,0, uVar4,0); *(uint *)((int)armyFly + 0x168) = *(uint *)((int)armyFly + 0x168) & 0xfffffffb; *(undefined4 *)((int)armyFly + 0x16c) = *(undefined4 *)((int)armyFly + 0x16c); local_2c = npc->_entityRef; if ((local_2c != (EntityPtr)0x0) && (*(EntityPtr *)((int)local_2c + 0x3c0) == (EntityPtr)0x0)) { local_38.y = (float)((int)armyFly + 0x3bc); if (*(EntityPtr *)((int)armyFly + 0x3bc) != (EntityPtr)0x0) { std::multiset::erase(&local_38.y); } local_38.y = (float)((int)armyFly + 0x3bc); *(EntityPtr *)local_38.y = local_2c; std::multiset::insert(local_38.y); local_2c = (EntityPtr)((int)npc->_entityRef + 0x3c0); if (*(EntityPtr *)local_2c != (EntityPtr)0x0) { local_38.y = (float)local_2c; std::multiset::erase(&local_38.y); } *(EntityPtr *)local_2c = armyFly; std::multiset::insert(local_2c); } if (npc->_entityRef != (EntityPtr)0x0) { local_38.y = (float)&npc->_entityRef; std::multiset::erase(&local_38.y); } npc->_entityRef = armyFly; std::multiset::insert(&npc->_entityRef); (**(code **)(*(int *)armyFly + 0xc))(); fVar8 = (npc->_v1).x; fVar1 = (npc->_v1).y; if (ABS(fVar8) <= ABS(fVar1)) { iVar5 = (uint)(0.0 <= fVar1) * 2 + 1; } else { iVar5 = 2; if (fVar8 < 0.0) { iVar5 = 0; } } *(int *)((int)armyFly + 0xbc0) = iVar5; *(float *)((int)armyFly + 0xbc4) = 4.2039e-44; iVar5 = npc->_projectileCooldown; } iVar5 = iVar5 + 1; local_30 = (EntityPtr *)&local_30[-1].field_0x3; npc->_projectileCooldown = iVar5; } while (local_30 != (EntityPtr *)0x0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004dde15; npc->_projectileCooldown = 0x5a; } npc->_state = 3; LAB_004dde15: fVar8 = (npc->_pos).y; iVar5 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); pvVar6 = (void *)(int)((fVar8 - 120.0) / 40.0 + 0.5); if ((((-1 < iVar5) && (iVar5 < *(int *)((int)room + 0xc))) && (-1 < (int)pvVar6)) && ((int)pvVar6 < *(int *)((int)room + 0x10))) { pvVar6 = (void *)((int)pvVar6 * *(int *)((int)room + 0xc)); uVar4 = (int)pvVar6 + iVar5; if (uVar4 < 0x1c0) { iVar5 = *(int *)((int)room + uVar4 * 4 + 0x76c); pvVar6 = (void *)(iVar5 / 1000); if (iVar5 % 1000 < 900) { *(int *)((int)room + uVar4 * 4 + 0x76c) = (iVar5 - iVar5 % 1000) + 900; fVar8 = (npc->_pos).y; pvVar6 = room; } } } fVar1 = (npc->_targetPosition).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar1 - fVar8; ExceptionList = local_1c; return pvVar6; } //@@ 004ddf00 NpcAI::ENTITY_MAMA_FLY /* DB: 61.4, from NpcAI::ENTITY_FLY */ void * __fastcall NpcAI::ENTITY_MAMA_FLY(Entity_NPC *npc) { float fVar1; byte isEventTriggered; void *pvVar2; AnimationState *this; uint uVar3; Entity *tmpEntity; void *pvVar4; EntityList_EL *pEVar5; EntityList_EL *extraout_EAX; Vector *freeTilePos; uint seed; int iVar6; int iVar7; Room *room; bool bVar8; float fVar9; float fVar10; undefined1 local_6c [12]; uint queryCount; Vector scratchPos; Vector local_54; float local_4c; Vector local_48; float local_40; float local_3c; Vector *local_38; float local_34; float local_30; float local_2c; Room *cachedRoom; byte isUnderFlyLimit; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; puStack_20 = local_6c + 0x68; local_14 = 0xffffffff; puStack_18 = &LAB_00af3a80; local_1c = ExceptionList; room = g_game->_room; if (npc->_aiCallPhase == 3) { pvVar4 = npc->_collisionEntity; if (*(int *)((int)pvVar4 + 0x28) != 0x35d) { return pvVar4; } bVar8 = (npc->_flags & 0x20000000) != 0; pvVar2 = (void *)(uint)bVar8; if (((*(uint *)((int)pvVar4 + 0x168) & 0x20000000) != 0) == bVar8) { npc->_collisionResult = 0; return pvVar2; } return pvVar2; } this = (AnimationState *)npc->_state; ExceptionList = &local_1c; cachedRoom = room; if (this == (AnimationState *)0x0) { npc->_state = 3; npc->_i1 = 0; fVar1 = g_colorGreenSplat._tint[3]; fVar9 = g_colorGreenSplat._tint[2]; fVar10 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar9; (npc->_splatColor)._tint[3] = fVar1; fVar1 = g_colorGreenSplat._colorize[3]; fVar9 = g_colorGreenSplat._colorize[2]; fVar10 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar9; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; this = (AnimationState *)g_colorGreenSplat._offset[2]; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } npc->_aiCallFlags = 4; puStack_20 = local_6c + 0x68; } else if (this == (AnimationState *)0x3) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_i2 = npc->_i2 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_54.x = (npc->_targetPosition).x; local_54.y = (npc->_targetPosition).y; if ((local_54.x == g_vectorZero.x) && (local_54.y == g_vectorZero.y)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_54.x = (tmpEntity->_pos).x; local_54.y = (tmpEntity->_pos).y; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_54,0.6,0,1); fVar10 = (npc->_targetPosition).x; if (((fVar10 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) && (fVar9 = (npc->_targetPosition).y - (npc->_pos).y, fVar10 = fVar10 - (npc->_pos).x, fVar10 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10), fVar10 < 10.0)) { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } bVar8 = 0.0 < (npc->_velocity).x; this = (AnimationState *)(uint)bVar8; (npc->_sprite)._flipX = bVar8; npc->_friction = npc->_friction * 0.8; } else { puStack_20 = local_6c + 0x68; if (this == (AnimationState *)&DAT_00000008) { npc->_friction = npc->_friction * 0.7; fVar10 = (npc->_targetPosition).y; fVar9 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar10 - fVar9; puStack_20 = local_6c + 0x68; if (((npc->_sprite)._animState._animData != (void *)0x0) && (puStack_20 = local_6c + 0x68, isEventTriggered = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"), isEventTriggered != 0)) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); npc->_entityGridCollisionClass = 5; } this = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { isEventTriggered = AnimationState::IsEventTriggered(this,(byte *)"Shoot"); this = (AnimationState *)(uint)isEventTriggered; if (isEventTriggered != 0) { this = (AnimationState *)Room::GetGridCollisionAtPos(room,npc->_pos); if (this == (AnimationState *)0x0) { uVar3 = Random(); tmpEntity = Game::Spawn(g_game,0x35d,0,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar3); flagsHigh = *(undefined4 *)((int)&tmpEntity->_flags + 4); iVar7 = *(int *)tmpEntity; *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = flagsHigh; this = (AnimationState *)(**(code **)(iVar7 + 0xc))(); } npc->_entityGridCollisionClass = 3; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004de2cd; } npc->_state = 3; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_i2 = 0; npc->_entityGridCollisionClass = 3; } } LAB_004de2cd: if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { pvVar4 = (void *)((uint)this & 0xff); if ((npc->_state != 3) || (npc->_i2 < 0x5b)) goto LAB_004de654; uVar3 = Random(); pvVar4 = (void *)(uVar3 / 10); if (uVar3 % 10 != 0) goto LAB_004de654; } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_4c = (tmpEntity->_pos).x; local_54.y = (tmpEntity->_pos).y; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_6c,0x35d,-1,-1,0,0); isUnderFlyLimit = queryCount < 10; if (local_6c[0] == '\0') { local_14 = 0; tracked_alloc(1,(void *)local_6c._4_4_,0); local_14 = 0xffffffff; } pvVar4 = (void *)(uint)isUnderFlyLimit; if (isUnderFlyLimit != 0) { local_3c = 1.4013e-44; local_38 = (Vector *)0x0; local_30 = 0.0; local_40 = 0.0; do { uVar3 = Random(); local_2c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2c = local_2c + local_2c; uVar3 = Random(); local_34 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 120.0 + 80.0; local_48.y = cos(local_2c); local_48.y = local_48.y * local_34; fVar10 = sin(local_2c); scratchPos.x = local_48.y + (npc->_pos).x; scratchPos.y = fVar10 * local_34 + (npc->_pos).y; local_48.y = (float)(int)((scratchPos.x - 40.0) / 40.0 + 0.5); iVar7 = (int)((scratchPos.y - 120.0) / 40.0 + 0.5); if (((((int)local_48.y < 0) || (cachedRoom->_gridWidth <= (int)local_48.y)) || (iVar7 < 0)) || (cachedRoom->_gridHeight <= iVar7)) { iVar6 = -1; } else { iVar6 = iVar7 * cachedRoom->_gridWidth + (int)local_48.y; } pEVar5 = (EntityList_EL *)Room::GetGridCollision(cachedRoom,iVar6); if (pEVar5 == (EntityList_EL *)0x0) { if ((((int)local_48.y < 0) || (iVar6 = cachedRoom->_gridWidth, iVar6 <= (int)local_48.y)) || ((iVar7 < 0 || (cachedRoom->_gridHeight <= iVar7)))) { iVar6 = cachedRoom->_gridWidth; iVar7 = -1; } else { iVar7 = iVar7 * iVar6 + (int)local_48.y; } scratchPos.x = (float)(iVar7 % iVar6) * 40.0 + 40.0; scratchPos.y = (float)(iVar7 / iVar6) * 40.0 + 120.0; local_34 = scratchPos.x; local_2c = scratchPos.y; local_48.y = sqrtf((local_54.y - scratchPos.y) * (local_54.y - scratchPos.y) + (local_4c - scratchPos.x) * (local_4c - scratchPos.x)); room = cachedRoom; pEVar5 = extraout_EAX; if ((float)local_38 < local_48.y) { pEVar5 = EntityList::QueryRadius (&cachedRoom->_entityList,(EntityList_EL *)local_6c,&scratchPos,24.0,8) ; uVar3 = 0; if (queryCount != 0) { do { pEVar5 = *(EntityList_EL **)(local_6c._4_4_ + uVar3 * 4); if (pEVar5[0x18]._data == &DAT_00000005) goto LAB_004de5e2; uVar3 = uVar3 + 1; } while (uVar3 < queryCount); } local_38 = (Vector *)local_48.y; local_40 = local_34; local_30 = local_2c; LAB_004de5e2: if (local_6c[0] == '\0') { local_14 = 1; pEVar5 = tracked_alloc(1,(void *)local_6c._4_4_,0); local_14 = 0xffffffff; } } } else { room = cachedRoom; } local_3c = (float)((int)local_3c + -1); } while (local_3c != 0.0); local_3c = 0.0; if ((local_40 != g_vectorZero.x) || (pvVar4 = (void *)((uint)pEVar5 & 0xff), local_30 != g_vectorZero.y)) { pvVar4 = (void *)((uint)pEVar5 & 0xff); (npc->_targetPosition).x = local_40; (npc->_targetPosition).y = local_30; npc->_i2 = 0; } } LAB_004de654: if (npc->_dead != 0) { local_38 = &npc->_pos; local_34 = 4.2039e-45; do { uVar3 = Random(); local_40 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_40 = local_40 + local_40; uVar3 = Random(); local_3c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; local_54.y = local_38->x; fVar10 = cos(local_40); local_48.x = fVar10 * local_3c * 80.0 + (npc->_pos).x; local_4c = (npc->_pos).y; local_30 = local_48.x; fVar10 = sin(local_40); local_48.y = fVar10 * local_3c * 80.0 + (npc->_pos).y; iVar7 = (int)((local_30 - 40.0) / 40.0 + 0.5); iVar6 = (int)((local_48.y - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar6 < 0)) || (room->_gridHeight <= iVar6)) { iVar7 = -1; } else { iVar7 = room->_gridWidth * iVar6 + iVar7; } local_2c = local_48.y; uVar3 = Room::GetGridCollision(room,iVar7); if ((int)uVar3 < 1) { fVar9 = local_4c; fVar10 = local_54.y; } else { freeTilePos = Room::FindFreeTilePosition(room,(Vector *)(local_6c + 8),&local_48,64.0); uVar3 = Random(); local_2c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 38.0 - 19.0; uVar3 = Random(); local_2c = local_2c + freeTilePos->y; local_30 = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 38.0 - 19.0) + freeTilePos->x; room = cachedRoom; fVar9 = (npc->_pos).y; fVar10 = local_38->x; local_48.x = local_30; local_48.y = local_2c; } local_30 = local_30 - fVar10; local_2c = local_2c - fVar9; fVar10 = sqrtf(local_30 * local_30 + local_2c * local_2c); if (0.0 < fVar10) { local_30 = local_30 * (1.0 / fVar10); local_2c = local_2c * (1.0 / fVar10); } uVar3 = Random(); local_54.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 15.0 - 30.0; uVar3 = Random(); fVar10 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 15.0; scratchPos.y = fVar10 * local_2c + (npc->_pos).y; scratchPos.x = fVar10 * local_30 + (npc->_pos).x; spawn_small_maggot_jump(&scratchPos,local_54.y,&local_48); local_34 = (float)((int)local_34 + -1); } while (local_34 != 0.0); uVar3 = Random(); local_54.y = -10.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 60.0; uVar3 = Random(); seed = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,(uVar3 & 1) + 3, seed); pvVar4 = (void *)(**(code **)(*(int *)tmpEntity + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = local_54.y; tmpEntity->_renderDepthOffset = 10.0; } ExceptionList = local_1c; return pvVar4; } //@@ 004dea40 NpcAI::ENTITY_PUSTULE /* NPC AI for entity type 861 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PUSTULE(Entity_NPC *npc) { uint *puVar1; undefined4 uVar2; float fVar3; undefined1 *puVar4; byte bVar5; uint uVar6; EntityRef *selfRef; byte *curAnimChar; Entity *tmpEntity; Vector *pVVar7; uint seed; byte *wantAnimChar; int iVar8; code *extraout_EDX; qword *allocatedBytes; int iVar9; bool isLess; float fVar10; float fVar11; EntityRef selfRefBuf; EntityList_EL maggots; Vector freeTilePos; Vector maggotPos; Vector maggotTarget; float local_40; Vector *npcPos; int maggotIndex; float randomRadius; Room *room; byte *local_2c; float local_28; char isMaggotCapReached; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; qword oldAllocatedBytes; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af3aa0; local_1c = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; room = g_game->_room; local_28 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_state != 0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_state != 3) goto LAB_004ded67; if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((int)register0x00000010 + -4), (npc->_sprite)._animState._isPlaying == 0)) { iVar9 = npc->_i1; if (iVar9 == 5) { npc->_i1 = 6; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); selfRef = EntityRef::EntityRef(&selfRefBuf); (*extraout_EDX)(selfRef,uVar6); goto LAB_004ded67; } local_2c = (&PTR_DAT_00b606ac)[iVar9]; npc->_i1 = iVar9 + 1; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; wantAnimChar = local_2c; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar5 = *curAnimChar; isLess = bVar5 < *wantAnimChar; if (bVar5 != *wantAnimChar) { LAB_004deb40: uVar6 = -(uint)isLess | 1; goto LAB_004deb45; } if (bVar5 == 0) break; bVar5 = curAnimChar[1]; isLess = bVar5 < wantAnimChar[1]; if (bVar5 != wantAnimChar[1]) goto LAB_004deb40; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar5 != 0); uVar6 = 0; LAB_004deb45: if ((uVar6 == 0) && ((puStack_20 = (undefined1 *)((int)register0x00000010 + -4), animData[0x34] == 0 || (puStack_20 = (undefined1 *)((int)register0x00000010 + -4), (npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004deb7a; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar5 = ANM2::SetAnimation(&npc->_sprite,local_2c,1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004deb7a: iVar9 = 0; if (0 < (int)local_28) { iVar8 = npc->_stateFrame; do { npc->_stateFrame = iVar8 + 1; uVar6 = Random(); iVar8 = npc->_stateFrame; if (uVar6 % 3 == 0) { iVar8 = iVar8 + 1; npc->_stateFrame = iVar8; } if ((0x23 < iVar8) && (npc->_i1 < 5)) { local_2c = (&PTR_s_Transition0_00b6065c)[npc->_i1]; npc->_stateFrame = 0; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) goto LAB_004dec44; curAnimChar = animData; wantAnimChar = local_2c; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } goto LAB_004dec00; } iVar9 = iVar9 + 1; } while (iVar9 < (int)local_28); } goto LAB_004ded67; } npc->_i1 = 0; npc->_stateFrame = 0; npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004decfe: bVar5 = ANM2::SetAnimation(&npc->_sprite,(byte *)&DAT_00b604e8,1); puVar4 = puStack_20; if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; puVar4 = puStack_20; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } wantAnimChar = (byte *)&DAT_00b604e8; do { bVar5 = *curAnimChar; isLess = bVar5 < *wantAnimChar; if (bVar5 != *wantAnimChar) { LAB_004dece0: uVar6 = -(uint)isLess | 1; goto LAB_004dece5; } if (bVar5 == 0) break; bVar5 = curAnimChar[1]; isLess = bVar5 < wantAnimChar[1]; if (bVar5 != wantAnimChar[1]) goto LAB_004dece0; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar5 != 0); uVar6 = 0; LAB_004dece5: if ((uVar6 != 0) || ((puVar4 = (undefined1 *)((int)register0x00000010 + -4), animData[0x34] != 0 && (puVar4 = (undefined1 *)((int)register0x00000010 + -4), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004decfe; } puStack_20 = puVar4; fVar3 = g_colorGreenSplat._tint[3]; fVar11 = g_colorGreenSplat._tint[2]; fVar10 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar11; (npc->_splatColor)._tint[3] = fVar3; fVar3 = g_colorGreenSplat._colorize[3]; fVar11 = g_colorGreenSplat._colorize[2]; fVar10 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar11; (npc->_splatColor)._colorize[3] = fVar3; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } uVar2 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar2; LAB_004ded67: bVar5 = npc->_dead; pVVar7 = &npc->_pos; npc->_friction = npc->_friction * 0.7; fVar10 = (npc->_targetPosition).y; fVar11 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - pVVar7->x; (npc->_velocity).y = fVar10 - fVar11; if (bVar5 != 0) { iVar9 = npc->_i1; npcPos = pVVar7; if ((0.0 < *(float *)(&DAT_00b60640 + iVar9 * 4)) && ((npc->_flags & 0x1000000) == 0)) { uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 1.4; local_28 = *(float *)(&DAT_00b60640 + npc->_i1 * 4) * fVar10 * g_vectorOne.y; local_2c = (byte *)(*(float *)(&DAT_00b60640 + npc->_i1 * 4) * fVar10 * g_vectorOne.x); uVar6 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x16,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar6,0); (tmpEntity->_sprite)._scale.x = (float)local_2c; (tmpEntity->_sprite)._scale.y = local_28; uVar2 = *(undefined4 *)(&UNK_00b6068c + npc->_i1 * 4); *(undefined4 *)(tmpEntity[1]._sprite._filename._buf + 8) = uVar2; *(undefined4 *)(tmpEntity[1]._sprite._filename._buf + 0xc) = uVar2; uVar6 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,7,pVVar7,&g_vectorZero,(Entity *)0x0,0,uVar6,0); uVar6 = Random(); iVar9 = *(int *)tmpEntity; fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; fVar10 = fVar11 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar11 * g_vectorOne.y * local_28; (tmpEntity->_sprite)._scale.x = fVar10 * (float)local_2c; (**(code **)(iVar9 + 0xc))(); iVar9 = npc->_i1; } pVVar7 = &npc->_pos; maggotIndex = 0; if (0 < *(int *)(&UNK_00b60670 + iVar9 * 4)) { do { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&maggots,0x355,-1,-1,0,0); isMaggotCapReached = 0x1f < (uint)maggots._size; if (maggots._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (maggots._data != (void *)0x0) { uVar6 = *(uint *)((int)maggots._data + -4); oldAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar6; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)oldAllocatedBytes < uVar6); free((void *)((int)maggots._data + -4)); } local_14 = 0xffffffff; } if (isMaggotCapReached != '\0') break; uVar6 = Random(); local_28 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28 = local_28 + local_28; uVar6 = Random(); randomRadius = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar10 = cos(local_28); maggotTarget.x = fVar10 * randomRadius * 80.0 + pVVar7->x; local_40 = pVVar7->y; local_2c = (byte *)maggotTarget.x; fVar10 = sin(local_28); maggotTarget.y = fVar10 * randomRadius * 80.0 + pVVar7->y; iVar9 = (int)(((float)local_2c - 40.0) / 40.0 + 0.5); iVar8 = (int)((maggotTarget.y - 120.0) / 40.0 + 0.5); if ((((iVar9 < 0) || (room->_gridWidth <= iVar9)) || (iVar8 < 0)) || (pVVar7 = &npc->_pos, room->_gridHeight <= iVar8)) { iVar9 = -1; } else { iVar9 = room->_gridWidth * iVar8 + iVar9; } local_28 = maggotTarget.y; uVar6 = Room::GetGridCollision(room,iVar9); if ((int)uVar6 < 1) { fVar10 = local_40; } else { pVVar7 = Room::FindFreeTilePosition(room,&freeTilePos,&maggotTarget,64.0); uVar6 = Random(); local_28 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 38.0 - 19.0; uVar6 = Random(); local_28 = local_28 + pVVar7->y; local_2c = (byte *)(((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 38.0 - 19.0) + pVVar7->x); pVVar7 = npcPos; fVar10 = npcPos->y; maggotTarget.x = (float)local_2c; maggotTarget.y = local_28; } local_2c = (byte *)((float)local_2c - pVVar7->x); local_28 = local_28 - fVar10; fVar10 = sqrtf((float)local_2c * (float)local_2c + local_28 * local_28); if (0.0 < fVar10) { local_2c = (byte *)((1.0 / fVar10) * (float)local_2c); local_28 = local_28 * (1.0 / fVar10); } uVar6 = Random(); local_40 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 15.0 - 30.0; uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 15.0; maggotPos.y = fVar10 * local_28 + pVVar7->y; maggotPos.x = fVar10 * (float)local_2c + pVVar7->x; spawn_small_maggot_jump(&maggotPos,local_40,&maggotTarget); maggotIndex = maggotIndex + 1; } while (maggotIndex < *(int *)(&UNK_00b60670 + npc->_i1 * 4)); } if (3 < npc->_i1) { uVar6 = Random(); local_40 = -10.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 60.0; uVar6 = Random(); seed = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0, (uVar6 & 1 ^ 1) + 3,seed); (**(code **)(*(int *)tmpEntity + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = local_40; tmpEntity->_renderDepthOffset = 10.0; if (npc->_i1 == 6) { uVar6 = Random(); tmpEntity = Game::SpawnEx(g_game,0x3d,6,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6,0); iVar9 = *(int *)tmpEntity; *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; puVar1 = (uint *)((int)&tmpEntity->_flags + 4); *puVar1 = *puVar1 | 0x400; (**(code **)(iVar9 + 0xc))(); } } } ExceptionList = local_1c; return; while( true ) { bVar5 = curAnimChar[1]; isLess = bVar5 < wantAnimChar[1]; if (bVar5 != wantAnimChar[1]) goto LAB_004dec20; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; if (bVar5 == 0) break; LAB_004dec00: bVar5 = *curAnimChar; isLess = bVar5 < *wantAnimChar; if (bVar5 != *wantAnimChar) { LAB_004dec20: uVar6 = -(uint)isLess | 1; goto LAB_004dec25; } if (bVar5 == 0) break; } uVar6 = 0; LAB_004dec25: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) { LAB_004dec44: bVar5 = ANM2::SetAnimation(&npc->_sprite,local_2c,1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } goto LAB_004ded67; } //@@ 004df3f0 NpcAI::ENTITY_EVIS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 865 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_EVIS(Entity_NPC *npc) { float fVar1; undefined4 uVar2; EntityPtr EVar3; byte bVar4; uint uVar5; EntityRef *sourceRef; int iVar6; char *animName; Entity *pEVar7; Entity_NPC *childNpc; Vector *pVVar8; uint uVar9; uint uVar10; float fVar11; float fVar12; undefined1 *puVar13; undefined1 auVar14 [12]; float fVar15; EntityPtr local_98; undefined4 local_94; EntityPtr local_90; undefined8 local_8c; Vector scratchVec; float local_7c; Vector local_78; float local_70; Vector local_6c; undefined1 local_64 [40]; undefined1 local_3c [20]; uint hitCount; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int dequeBlock; Manager *manager; Room *room; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af3add; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; local_6c.y = (float)npc; if (npc->_variant == 10) { local_78.y = (float)npc->_aiCallPhase; if ((local_78.y != 1.4013e-45) && (local_78.y != 2.8026e-45)) { puStack_20 = local_3c + 0x38; if (npc->_state == 0) { if (npc->_parent == (EntityPtr)0x0) { puStack_20 = local_3c + 0x38; (**(code **)(*(int *)npc + 0x28))(local_24); ExceptionList = local_1c; return; } puStack_20 = local_3c + 0x38; Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); uVar2 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb | 0x10000; *(undefined4 *)((int)&npc->_flags + 4) = uVar2; local_6c.y = cos(1.5707964); fVar11 = sin(1.5707964); uVar10 = 0; fVar12 = (npc->_targetPosition).y; fVar15 = (npc->_targetPosition).x; local_7c = local_6c.y * fVar15 - fVar12 * fVar11; local_6c.y = local_6c.y * fVar12 + fVar15 * fVar11; do { local_8c._0_4_ = *(float *)((int)npc->_parent + 0x33c); fVar12 = *(float *)((int)npc->_parent + 0x340); fVar15 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) / 6.0; local_8c._0_4_ = ((npc->_pos).x - (float)local_8c) * fVar15 + (float)local_8c; local_8c._4_4_ = ((npc->_pos).y - fVar12) * fVar15 + fVar12; std::deque::push_back(&local_8c); local_78.x = 0.0; local_78.y = 0.0; std::deque::push_back(&local_78); local_94 = 0xc1a00000; local_90 = (EntityPtr)0x0; std::deque::push_back(&local_94); if ((uVar10 != 0) && (uVar10 != 6)) { uVar5 = Random(); local_70 = (float)(uVar10 & 1); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 4.0; if (local_70 == 0.0) { puVar13 = &DAT_bf800000; } else { puVar13 = (undefined1 *)0x3f800000; } uVar5 = ((npc->_vectorDeque1)._offset - 3) + (npc->_vectorDeque1)._size; uVar9 = uVar5 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar5 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar6 + uVar9 * 8) = local_7c * fVar12 * (float)puVar13 + *(float *)(iVar6 + uVar9 * 8); *(float *)(iVar6 + 4 + uVar9 * 8) = local_6c.y * fVar12 * (float)puVar13 + *(float *)(iVar6 + 4 + uVar9 * 8); uVar5 = Random(); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 20.0; if (local_70 == 0.0) { puVar13 = &DAT_bf800000; } else { puVar13 = (undefined1 *)0x3f800000; } uVar5 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 2); uVar9 = uVar5 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar5 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar6 + uVar9 * 8) = local_7c * fVar12 * (float)puVar13 + *(float *)(iVar6 + uVar9 * 8); *(float *)(iVar6 + 4 + uVar9 * 8) = local_6c.y * fVar12 * (float)puVar13 + *(float *)(iVar6 + 4 + uVar9 * 8); } uVar10 = uVar10 + 1; } while (uVar10 < 7); std::deque::assign(&npc->_vectorDeque1); npc->_aiCallFlags = 3; npc->_state = 3; npc->_entityGridCollisionClass = 0; npc->_entityCollisionClass = 0; ANM2::SetFrame(&npc->_sprite,(std_string *)&DAT_00b60544,0); npc->_renderDepthOffset = npc->_renderDepthOffset + 16.0; } if (npc->_dead == 0) { ExceptionList = local_1c; return; } local_6c.y = 4.2039e-45; do { if ((int)local_6c.y + 2U < (npc->_vectorDeque1)._size) { uVar10 = (npc->_vectorDeque1)._offset; local_8c._0_4_ = 0.0; uVar5 = uVar10 + 2 + (int)local_6c.y; local_8c._4_4_ = *(float *)(*(int *)((int)(npc->_vectorDeque1)._map + (uVar5 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4) + (uVar5 & 1) * 8); uVar10 = (int)local_6c.y + uVar10; spawn_blood_explosion (1,(Vector *) (*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar10 >> 1) * 4) + (uVar10 & 1) * 8),(Vector *)&local_8c,&npc->_splatColor,&g_vectorZero); } local_6c.y = (float)((int)local_6c.y + 3); } while ((uint)local_6c.y < 0x15); ExceptionList = local_1c; return; } local_8c._4_4_ = (float)CONCAT31(local_8c._5_3_,local_78.y == 2.8026e-45); puStack_20 = local_3c + 0x38; if (local_78.y != 2.8026e-45) { if (npc->_parent == (EntityPtr)0x0) { puStack_20 = local_3c + 0x38; sourceRef = EntityRef::EntityRef((EntityRef *)local_64); (**(code **)(*(int *)npc + 0x24))(sourceRef); ExceptionList = local_1c; return; } EVar3 = npc->_target; puStack_20 = local_3c + 0x38; if (EVar3 != (EntityPtr)0x0) { fVar12 = *(float *)((int)EVar3 + 0x340); fVar15 = (npc->_pos).y; (npc->_velocity).x = *(float *)((int)EVar3 + 0x33c) - (npc->_pos).x; (npc->_velocity).y = fVar12 - fVar15; puStack_20 = local_3c + 0x38; bVar4 = Entity::IsFlying((Entity *)npc->_target); if (bVar4 == 0) { fVar12 = -10.0; } else { fVar12 = -20.0; } (npc->_posOffset).y = fVar12; } local_70 = 4.2039e-45; local_90 = (EntityPtr)g_game->_room; do { EVar3 = local_90; if (npc->_target != (EntityPtr)0x0) break; local_98 = (EntityPtr)(npc->_vectorDeque1)._offset; uVar10 = (int)local_70 + (int)local_98 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & (uint)((int)local_70 + (int)local_98) >> 1) * 4); scratchVec.x = *(float *)(iVar6 + uVar10 * 8) - (npc->_pos).x; scratchVec.y = *(float *)(iVar6 + 4 + uVar10 * 8) - (npc->_pos).y; Entity::GetCollisionCapsule((Entity *)npc,local_64,&scratchVec); EntityList::query_player_capsule_hits ((EntityList *)((int)EVar3 + 0x1218),(EntityList_EL *)(local_3c + 8),local_64,0x20 ); manager = g_manager; local_14 = 0; uVar10 = 0; if (hitCount != 0) { do { local_98 = *(EntityPtr *)(local_3c._12_4_ + uVar10 * 4); if (*(int *)((int)local_98 + 0x28) == 1) { local_7c = 1.079e-43; seed_fart_sound_override((int *)&local_7c); SoundEffects::Play(&manager->_sfxManager,(int)local_7c,0.5,2,0,1.0,0.0); Game::ShakeScreen(g_game,6); EVar3 = local_98; *(float *)((int)local_98 + 0x360) = g_vectorZero.x; *(float *)((int)local_98 + 0x364) = g_vectorZero.y; if (npc->_target != (EntityPtr)0x0) { local_98 = (EntityPtr)&npc->_target; std::multiset::erase(&local_98); } npc->_target = EVar3; std::multiset::insert(&npc->_target); break; } uVar10 = uVar10 + 1; } while (uVar10 < hitCount); } if (local_3c[8] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_3c._12_4_,0); } local_14 = 0xffffffff; local_70 = (float)((int)local_70 + 3); } while ((uint)local_70 < 0x15); } fVar12 = local_78.y; if (npc->_target == (EntityPtr)0x0) { if (local_78.y == 2.8026e-45) { fVar15 = npc->_speedMultiplier * -0.5; } else { fVar15 = 0.0; } local_78.y = (fVar15 + npc->_updateTime) / 15.0; fVar15 = pow((local_78.y + local_78.y) - 1.0,2.0); fVar15 = (1.0 - fVar15) * 200.0; if ((0.0 < local_78.y) && (fVar15 <= 0.0)) { if (fVar12 == 2.8026e-45) { ExceptionList = local_1c; return; } (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } EVar3 = npc->_parent; if (EVar3 != (EntityPtr)0x0) { fVar11 = (npc->_targetPosition).x; fVar1 = *(float *)((int)EVar3 + 0x33c); (npc->_pos).y = fVar15 * (npc->_targetPosition).y + *(float *)((int)EVar3 + 0x340); (npc->_pos).x = fVar15 * fVar11 + fVar1; if ((0.5 < local_78.y) && (fVar12 != 2.8026e-45)) { uVar10 = (npc->_vectorDeque1)._offset; fVar12 = *(float *)((int)npc->_parent + 0x340); iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); fVar15 = *(float *)((int)local_6c.y + 0x39c); fVar11 = *(float *)(iVar6 + 4 + (uVar10 & 1) * 8); uVar5 = uVar10 + 1 & 1; dequeBlock = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1 & uVar10 + 1 >> 1) * 4); *(float *)(dequeBlock + uVar5 * 8) = (*(float *)((int)npc->_parent + 0x33c) - *(float *)(iVar6 + (uVar10 & 1) * 8)) * 0.2 * fVar15 + *(float *)(dequeBlock + uVar5 * 8); *(float *)(dequeBlock + 4 + uVar5 * 8) = (fVar12 - fVar11) * 0.2 * fVar15 + *(float *)(dequeBlock + 4 + uVar5 * 8); uVar5 = ((std_deque *)((int)local_6c.y + 0xc04))->_offset; fVar12 = *(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x340); uVar10 = uVar5 + 3; uVar5 = uVar5 + 4; uVar9 = uVar10 & 1; iVar6 = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1 & uVar10 >> 1) * 4 ); fVar15 = *(float *)((int)local_6c.y + 0x39c); fVar11 = *(float *)(iVar6 + 4 + uVar9 * 8); uVar10 = uVar5 & 1; dequeBlock = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1 & uVar5 >> 1) * 4); *(float *)(dequeBlock + uVar10 * 8) = (*(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x33c) - *(float *)(iVar6 + uVar9 * 8)) * 0.2 * fVar15 + *(float *)(dequeBlock + uVar10 * 8); *(float *)(dequeBlock + 4 + uVar10 * 8) = (fVar12 - fVar11) * 0.2 * fVar15 + *(float *)(dequeBlock + 4 + uVar10 * 8); uVar5 = ((std_deque *)((int)local_6c.y + 0xc04))->_offset; uVar10 = uVar5 + 6; fVar12 = *(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x340); uVar5 = uVar5 + 7; uVar9 = uVar10 & 1; iVar6 = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar10 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4 ); uVar10 = uVar5 & 1; fVar15 = *(float *)((int)local_6c.y + 0x39c); fVar11 = *(float *)(iVar6 + 4 + uVar9 * 8); dequeBlock = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar5 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4); *(float *)(dequeBlock + uVar10 * 8) = (*(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x33c) - *(float *)(iVar6 + uVar9 * 8)) * 0.2 * fVar15 + *(float *)(dequeBlock + uVar10 * 8); *(float *)(dequeBlock + 4 + uVar10 * 8) = (fVar12 - fVar11) * 0.2 * fVar15 + *(float *)(dequeBlock + 4 + uVar10 * 8); uVar5 = ((std_deque *)((int)local_6c.y + 0xc04))->_offset; fVar12 = *(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x340); uVar10 = uVar5 + 9; uVar5 = uVar5 + 10; uVar9 = uVar10 & 1; iVar6 = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1 & uVar10 >> 1) * 4 ); uVar10 = uVar5 & 1; fVar15 = *(float *)((int)local_6c.y + 0x39c); fVar11 = *(float *)(iVar6 + 4 + uVar9 * 8); dequeBlock = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar5 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4); *(float *)(dequeBlock + uVar10 * 8) = (*(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x33c) - *(float *)(iVar6 + uVar9 * 8)) * 0.2 * fVar15 + *(float *)(dequeBlock + uVar10 * 8); *(float *)(dequeBlock + 4 + uVar10 * 8) = (fVar12 - fVar11) * 0.2 * fVar15 + *(float *)(dequeBlock + 4 + uVar10 * 8); uVar5 = ((std_deque *)((int)local_6c.y + 0xc04))->_offset; fVar12 = *(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x340); uVar10 = uVar5 + 0xc; uVar9 = uVar10 & 1; iVar6 = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar10 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4 ); fVar15 = *(float *)(iVar6 + 4 + uVar9 * 8); uVar5 = uVar5 + 0xd; uVar10 = uVar5 & 1; fVar11 = *(float *)((int)local_6c.y + 0x39c); dequeBlock = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar5 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4); *(float *)(dequeBlock + uVar10 * 8) = (*(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x33c) - *(float *)(iVar6 + uVar9 * 8)) * 0.2 * fVar11 + *(float *)(dequeBlock + uVar10 * 8); *(float *)(dequeBlock + 4 + uVar10 * 8) = (fVar12 - fVar15) * 0.2 * fVar11 + *(float *)(dequeBlock + 4 + uVar10 * 8); uVar5 = ((std_deque *)((int)local_6c.y + 0xc04))->_offset; fVar12 = *(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x340); uVar10 = uVar5 + 0xf; uVar9 = uVar10 & 1; uVar5 = uVar5 + 0x10; iVar6 = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar10 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4 ); fVar15 = *(float *)((int)local_6c.y + 0x39c); fVar11 = *(float *)(iVar6 + 4 + uVar9 * 8); uVar10 = uVar5 & 1; dequeBlock = *(int *)((int)((std_deque *)((int)local_6c.y + 0xc04))->_map + (uVar5 >> 1 & ((std_deque *)((int)local_6c.y + 0xc04))->_mapSize - 1) * 4); *(float *)(dequeBlock + uVar10 * 8) = (*(float *)((int)*(EntityPtr *)((int)local_6c.y + 0x3bc) + 0x33c) - *(float *)(iVar6 + uVar9 * 8)) * 0.2 * fVar15 + *(float *)(dequeBlock + uVar10 * 8); *(float *)(dequeBlock + 4 + uVar10 * 8) = (fVar12 - fVar11) * 0.2 * fVar15 + *(float *)(dequeBlock + 4 + uVar10 * 8); npc = (Entity_NPC *)local_6c.y; } } } EVar3 = npc->_parent; if (EVar3 == (EntityPtr)0x0) { ExceptionList = local_1c; return; } if ((npc->_vectorDeque1)._size == 0) { ExceptionList = local_1c; return; } uVar2 = *(undefined4 *)((int)EVar3 + 0x340); uVar10 = (npc->_vectorDeque1)._offset; uVar5 = uVar10 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar10 >> 1) * 4); *(undefined4 *)(iVar6 + uVar5 * 8) = *(undefined4 *)((int)EVar3 + 0x33c); *(undefined4 *)(iVar6 + 4 + uVar5 * 8) = uVar2; fVar12 = *(float *)((int)npc->_parent + 0x364); uVar10 = (npc->_vectorDeque1)._offset + 1; uVar5 = uVar10 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar6 + uVar5 * 8) = *(float *)((int)npc->_parent + 0x360) * 0.2; *(float *)(iVar6 + 4 + uVar5 * 8) = fVar12 * 0.2; uVar10 = (npc->_vectorDeque1)._offset + 2; uVar5 = uVar10 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(undefined4 *)(iVar6 + uVar5 * 8) = 0xc1a00000; *(undefined4 *)(iVar6 + 4 + uVar5 * 8) = 0; uVar10 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 3); uVar5 = uVar10 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar6 + uVar5 * 8) = (npc->_pos).x; *(float *)(iVar6 + 4 + uVar5 * 8) = (npc->_pos).y; uVar10 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 2); uVar5 = uVar10 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar6 + uVar5 * 8) = (npc->_velocity).x; *(float *)(iVar6 + 4 + uVar5 * 8) = (npc->_velocity).y; uVar10 = (npc->_vectorDeque1)._size + ((npc->_vectorDeque1)._offset - 1); uVar5 = uVar10 & 1; iVar6 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar6 + uVar5 * 8) = (npc->_posOffset).y; *(undefined4 *)(iVar6 + 4 + uVar5 * 8) = 0; Entity_NPC::UpdateCordChain(npc,SUB41(local_8c._4_4_,0)); ExceptionList = local_1c; return; } pVVar8 = &npc->_v1; fVar12 = 0.8; room = g_game->_room; iVar6 = 0; puVar13 = local_3c + 0x38; if (npc->_state != 0) { npc->_friction = npc->_friction * 0.8; Room::RaiseGridPathAtPos(room,&npc->_pos,900); iVar6 = npc->_state; puVar13 = puStack_20; } puStack_20 = puVar13; switch(iVar6) { case 0: npc->_state = 3; Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); break; case 3: std::string::string_from_cstr(local_64 + 0x10,(byte *)"WalkHori"); local_14 = 2; std::string::string_from_cstr(local_3c,(byte *)"WalkHori"); local_14 = CONCAT31(local_14._1_3_,3); Entity_NPC::AnimWalkFrame(npc,(std_string *)local_3c,(std_string *)(local_64 + 0x10),0.1); std::string::_Tidy_deallocate(local_3c); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_64 + 0x10); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.7,0); bVar4 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (bVar4 != 0) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_78.y = (pEVar7->_pos).x - (npc->_pos).x; local_8c._4_4_ = (pEVar7->_pos).y - (npc->_pos).y; if ((ABS(local_78.y) < 30.0) || ((ABS(local_8c._4_4_) < 30.0 && (fVar12 = sqrtf(local_8c._4_4_ * local_8c._4_4_ + local_78.y * local_78.y), fVar12 < 300.0 )))) { npc->_state = 8; pVVar8->x = local_78.y; (npc->_v1).y = local_8c._4_4_; } } break; case 7: npc->_friction = npc->_friction * fVar12; fVar12 = (npc->_v1).y; if (ABS(fVar12) <= ABS(pVVar8->x)) { ANM2::Play(&npc->_sprite,(byte *)"PullHoriz",0); (npc->_sprite)._flipX = pVVar8->x <= 0.0 && pVVar8->x != 0.0; } else { animName = "PullUp"; if (0.0 <= fVar12) { animName = "PullDown"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } fVar12 = npc->_aiFloat - 0.33; auVar14 = ZEXT812(0x41200000); if (auVar14._0_4_ <= fVar12) { auVar14._4_8_ = auVar14._4_8_; auVar14._0_4_ = fVar12; } npc->_aiFloat = auVar14._0_4_; childNpc = Entity_NPC::ChildNPC(npc); if (childNpc != (Entity_NPC *)0x0) { fVar12 = (npc->_aiFloat - 0.0) / 160.0; if (fVar12 <= 0.0) { fVar12 = 0.0; } if (1.0 <= fVar12) { fVar12 = 1.0; } local_8c._4_4_ = fVar12 * 6.0 + 0.0; childNpc = Entity_NPC::ChildNPC(npc); childNpc->_aiFloat = local_8c._4_4_; childNpc = Entity_NPC::ChildNPC(npc); (childNpc->_posOffset).x = 0.0; (childNpc->_posOffset).y = -24.0; break; } goto LAB_004e04a8; case 8: fVar12 = (npc->_v1).y; if (ABS(fVar12) <= ABS(pVVar8->x)) { ANM2::Play(&npc->_sprite,(byte *)"Attack01Horiz",0); (npc->_sprite)._flipX = pVVar8->x <= 0.0 && pVVar8->x != 0.0; } else { animName = "Attack01Up"; if (0.0 <= fVar12) { animName = "Attack01Down"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar12 = (npc->_pos).y - (pEVar7->_pos).y; fVar15 = (npc->_pos).x - (pEVar7->_pos).x; fVar12 = sqrtf(fVar12 * fVar12 + fVar15 * fVar15); fVar12 = fVar12 * 0.1; Vector::ToCardinal((Vector *)&local_8c,&npc->_v1); scratchVec.x = (fVar12 * (pEVar7->_velocity).x + (pEVar7->_pos).x) - (npc->_pos).x; scratchVec.y = (fVar12 * (pEVar7->_velocity).y + (pEVar7->_pos).y) - (npc->_pos).y; Vector::Normalized(&scratchVec,&local_78); local_70 = atan2f(local_8c._4_4_,(float)local_8c); local_70 = local_70 * 57.295776; fVar12 = atan2f(local_78.y,local_78.x); fVar12 = normalize_angle_degrees(fVar12 * 57.295776 - local_70); if (fVar12 <= -50.0) { fVar12 = -50.0; } if (50.0 <= fVar12) { fVar12 = 50.0; } local_8c._4_4_ = (fVar12 + local_70) * 0.017453292; local_70 = cos(local_8c._4_4_); local_7c = sin(local_8c._4_4_); uVar10 = Random(); scratchVec.x = local_70 * 10.0 + (npc->_pos).x; scratchVec.y = local_7c * 10.0 + (npc->_pos).y; pEVar7 = Game::Spawn(g_game,0x361,10,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar10); Entity::SetParent(pEVar7,(Entity *)npc); (pEVar7->_targetPosition).x = local_70; (pEVar7->_targetPosition).y = local_7c; Entity::SetChild((Entity *)npc,pEVar7); (**(code **)(*(int *)pEVar7 + 0xc))(); play_sound_with_fart_seed(0xe2,1.0,2,0,1.0); npc->_aiFloat = 160.0; } bVar4 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar4 == 0) break; LAB_004e04a8: npc->_state = 3; } childNpc = Entity_NPC::ChildNPC(npc); if ((childNpc != (Entity_NPC *)0x0) && (local_90 = childNpc->_target, local_90 != (EntityPtr)0x0)) { local_7c = (npc->_pos).y; local_70 = (npc->_pos).x; npc->_state = 7; local_7c = local_7c - *(float *)((int)local_90 + 0x340); local_70 = local_70 - *(float *)((int)local_90 + 0x33c); fVar11 = sqrtf(local_7c * local_7c + local_70 * local_70); fVar12 = local_70; fVar15 = local_7c; if (0.0 < fVar11) { fVar15 = local_7c * (1.0 / fVar11); fVar12 = local_70 * (1.0 / fVar11); } local_8c._4_4_ = fVar11 - npc->_aiFloat; local_78.y = 0.0; pVVar8 = (Vector *)&local_8c; if (local_8c._4_4_ <= 0.0) { pVVar8 = &local_78; } fVar11 = npc->_speedMultiplier; fVar12 = pVVar8->y * fVar12 * 0.14; fVar15 = pVVar8->y * fVar15 * 0.14; (npc->_velocity).x = (npc->_velocity).x - fVar12 * 0.25 * fVar11; (npc->_velocity).y = (npc->_velocity).y - fVar15 * 0.25 * fVar11; *(float *)((int)local_90 + 0x360) = fVar12 * *(float *)((int)local_90 + 0x39c) + *(float *)((int)local_90 + 0x360); *(float *)((int)local_90 + 0x364) = fVar15 * *(float *)((int)local_90 + 0x39c) + *(float *)((int)local_90 + 0x364); scratchVec.x = *(float *)((int)local_90 + 0x33c) - (npc->_pos).x; scratchVec.y = *(float *)((int)local_90 + 0x340) - (npc->_pos).y; pVVar8 = Vector::Normalized(&scratchVec,&local_6c); (npc->_v1).x = pVVar8->x; (npc->_v1).y = pVVar8->y; } ExceptionList = local_1c; return; } //@@ 004e07a0 FUN_004e07a0 void FUN_004e07a0(Vector *param_1) { EntityPtr EVar1; Entity_NPC *in_ECX; float fVar2; double dVar3; Vector local_48 [8]; if (in_ECX->_variant == 10) { Entity_NPC::render_overlay(in_ECX,param_1,0); EVar1 = in_ECX->_target; if (EVar1 != (EntityPtr)0x0) { fVar2 = g_displayPixelRatio * g_screenPointScale; dVar3 = floor((double)((((*(float *)((int)EVar1 + 0x33c) + (in_ECX->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar2 + 0.5)); local_48[0].x = (float)dVar3 / fVar2; dVar3 = floor((double)((((*(float *)((int)EVar1 + 0x340) + (in_ECX->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar2 + 0.5)); local_48[0].x = local_48[0].x + param_1->x; local_48[0].y = (float)dVar3 / fVar2 + param_1->y; Sprite::RenderLayer((Sprite *)&in_ECX->_sprite,1,local_48,&g_vectorZero,&g_vectorZero); return; } } else { Entity::Render((Entity *)in_ECX,param_1); } return; } //@@ 004e0930 NpcHelper::gutted_fatty_burst_projectiles /* DB: ? Entity_Effect::CreateTimer callback (mov ecx,0x4e0930 / call 0x60af00 inside NpcAI::ENTITY_GUTTED_FATTY 004e0dd0, type 831): 2+2 Game::SpawnEx(9 projectile) at the timer's position with random angle/speed, FallingSpeed/Accel randomised, Entity_Projectile::apply_spawn_flags */ void NpcHelper::gutted_fatty_burst_projectiles(int param_1) { float fVar1; float fVar2; uint uVar3; uint uVar4; Entity_Projectile *pEVar5; int iVar6; float fVar7; float fVar8; float fVar9; Vector local_18; Vector local_10; iVar6 = 2; fVar1 = *(float *)(param_1 + 0x33c); fVar2 = *(float *)(param_1 + 0x340); do { uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar7 = fVar7 + fVar7; fVar8 = cos(fVar7); fVar7 = sin(fVar7); uVar3 = Random(); uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_18.y = fVar9 * fVar7 * 2.8; local_18.x = fVar9 * fVar8 * 2.8; uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_10.x = fVar8 * 5.0 * fVar9 + fVar1; local_10.y = fVar7 * 5.0 * fVar9 + fVar2; pEVar5 = (Entity_Projectile *) Game::SpawnEx(g_game,9,0,&local_10,&local_18,(Entity *)0x0,0,uVar3,0); pEVar5->_spawnerType = 0x33f; uVar3 = Random(); pEVar5->_fallingAccel = 2.0; pEVar5->_scale = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 1.4; uVar3 = Random(); pEVar5->_fallingSpeed = -15.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 60.0; uVar3 = Random(); pEVar5->_height = -23.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 15.0; Entity_Projectile::apply_spawn_flags (pEVar5,*(int *)(param_1 + 0x450),*(float *)(param_1 + 0x478), *(ulonglong *)(param_1 + 0x168),(Entity *)0x0); (**(code **)(*(int *)pEVar5 + 0xc))(); iVar6 = iVar6 + -1; } while (iVar6 != 0); iVar6 = 2; do { uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar7 = fVar7 + fVar7; fVar8 = cos(fVar7); fVar7 = sin(fVar7); uVar3 = Random(); uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_10.y = fVar9 * fVar7 * 2.8; local_10.x = fVar9 * fVar8 * 2.8; uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_18.x = fVar8 * 5.0 * fVar9 + fVar1; local_18.y = fVar7 * 5.0 * fVar9 + fVar2; pEVar5 = (Entity_Projectile *) Game::SpawnEx(g_game,9,0,&local_18,&local_10,(Entity *)0x0,0,uVar3,0); pEVar5->_spawnerType = 0x33f; uVar3 = Random(); pEVar5->_fallingAccel = 2.0; pEVar5->_scale = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 1.4; uVar3 = Random(); pEVar5->_fallingSpeed = -15.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 60.0; uVar3 = Random(); pEVar5->_height = -23.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 1000.0; Entity_Projectile::apply_spawn_flags (pEVar5,*(int *)(param_1 + 0x450),*(float *)(param_1 + 0x478), *(ulonglong *)(param_1 + 0x168),(Entity *)0x0); (**(code **)(*(int *)pEVar5 + 0xc))(); iVar6 = iVar6 + -1; } while (iVar6 != 0); return; } //@@ 004e0dd0 NpcAI::ENTITY_GUTTED_FATTY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 831 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GUTTED_FATTY(Entity_NPC *npc) { uint *puVar1; EntityPtr EVar2; ANM2 *pAVar3; byte bVar4; char *nullLayerName; uint uVar5; Entity *pEVar6; LayerState *layer; Vector *controllerInput; undefined4 uVar7; ColorMod *color; Entity_Effect *burstTimer; void *pvVar8; int iVar9; int iVar10; undefined1 *size; EntityPtr *pEVar11; uint sameCharmCount; float fVar12; float fVar13; float fVar14; undefined1 auVar15 [12]; double dVar16; Vector bloodPos; Vector local_e4; Vector local_dc; float local_d4; EntityPtr *local_d0; undefined1 fattyQuery [4]; int local_c8; Vector local_c4; Vector local_bc; EntityPtr *local_b4; EntityPtr *local_b0 [2]; EntityRef local_a8; Color local_80; ulonglong walkRightAnim; undefined1 local_4c; undefined1 local_4b; undefined4 walkRightAnimSize; uint walkRightAnimCapacity; void *walkLeftAnim; char local_38 [4]; RNG local_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; Entity_NPC *otherFatty; puStack_20 = local_38 + 0x34; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00af3b43; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); pEVar11 = (EntityPtr *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_aiCallPhase == 3) { if ((EntityPtr)npc->_collisionEntity == npc->_spawnerEntity) { npc->_collisionResult = 0; return; } return; } iVar10 = npc->_variant; local_c4.y = (float)pEVar11; local_bc.y = (float)npc; if (npc->_aiCallPhase == 1) { if (iVar10 != 0) { return; } iVar10 = npc->_projectileDelay; ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; if (0 < iVar10) { puStack_20 = local_38 + 0x34; do { manager = g_manager; fVar12 = ((float)iVar10 * npc->_maxHitPoints) / 3.0; if (fVar12 < npc->_health || fVar12 == npc->_health) break; npc->_projectileDelay = iVar10 + -1; local_b0[0] = (EntityPtr *)0xed; seed_fart_sound_override((int *)local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0],1.0,2,0,1.0,0.0); nullLayerName = "RightEye"; if (npc->_projectileDelay != 1) { nullLayerName = "LeftEye"; } Entity::GetNullOffset((Entity *)npc,&local_dc,(byte *)nullLayerName); local_b0[0] = (EntityPtr *)local_dc.x; local_c4.x = local_dc.x + (npc->_pos).x; local_c4.y = (npc->_pos).y + 0.0; uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,2,&local_c4,&g_vectorZero,(Entity *)0x0,2,uVar5); (**(code **)(*(int *)pEVar6 + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0); (pEVar6->_sprite)._offset.x = 0.0; (pEVar6->_sprite)._offset.y = local_dc.y; pEVar6->_renderDepthOffset = 10.0; uVar5 = Random(); if (npc->_projectileDelay == 1) { local_e4.x = 3.0; } else { local_e4.x = -3.0; } local_bc.x = (float)local_b0[0] + (npc->_pos).x; local_e4.y = 5.0; local_bc.y = (npc->_pos).y + 0.0; pEVar6 = Game::Spawn(g_game,0x33f,10,&local_bc,&local_e4,(Entity *)npc,0,uVar5); uVar7 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar7; if (pEVar6->_parent != (EntityPtr)0x0) { local_b0[0] = &pEVar6->_parent; std::multiset::erase(local_b0); } pEVar6->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar6->_parent); (**(code **)(*(int *)pEVar6 + 0xc))(); iVar10 = npc->_projectileDelay; } while (0 < iVar10); } local_b0[0] = (EntityPtr *)((float)iVar10 * 48.0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); (layer->_cropOffset).y = (float)local_b0[0]; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_cropOffset).y = (float)local_b0[0]; ExceptionList = local_1c; return; } if (iVar10 == 0x14) { switch(npc->_state) { case 0: ExceptionList = &local_1c; npc->_state = 4; puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_controllerID == -1) { uVar5 = Random(); npc->_projectileCooldown = uVar5 % 0x96 + 0x3c; } else { npc->_projectileCooldown = 0x3c; } goto LAB_004e2ae3; default: return; case 4: goto switchD_004e110f_caseD_4; case 6: ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,&DAT_00b602e8,0); local_b0[0] = (EntityPtr *)((npc->_v1).x + 0.7); (npc->_v1).x = (float)local_b0[0]; local_bc.y = (float)local_b0[0] + (npc->_v1).y; (npc->_v1).y = local_bc.y; (npc->_posOffset).y = local_bc.y; iVar10 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar10 == 0) { fVar12 = local_bc.y; pEVar11 = local_b0[0]; } else { uVar5 = Random(); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.4; local_bc.y = fVar12 * g_vectorOne.y; local_b0[0] = (EntityPtr *)(fVar12 * g_vectorOne.x); uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); (pEVar6->_sprite)._scale.x = (float)local_b0[0]; (pEVar6->_sprite)._scale.y = local_bc.y; pAVar3 = &pEVar6[1]._sprite; (pAVar3->_filename)._buf[8] = '\x1e'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &pEVar6[1]._sprite; (pAVar3->_filename)._buf[0xc] = '\x1e'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,7,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); uVar5 = Random(); iVar10 = *(int *)pEVar6; fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; fVar12 = fVar13 * g_vectorOne.x; (pEVar6->_sprite)._scale.y = fVar13 * g_vectorOne.y * local_bc.y; (pEVar6->_sprite)._scale.x = fVar12 * (float)local_b0[0]; (**(code **)(iVar10 + 0xc))(); fVar12 = (npc->_v1).y; pEVar11 = (EntityPtr *)(npc->_v1).x; } if (-(float)pEVar11 < fVar12) { (npc->_posOffset).y = 0.0; (npc->_v1).y = 0.0; (npc->_v1).x = 0.0; npc->_state = 4; npc->_entityGridCollisionClass = 5; npc->_entityCollisionClass = 4; Entity_NPC::PlaySound(npc,0x102,1.0,2,0,1.0); ANM2::Play(&npc->_sprite,s_Land,0); spawn_blood_explosion(2,&npc->_pos,&g_vectorZero,&npc->_splatColor,&g_vectorZero); uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); fVar12 = g_vectorOne.y; fVar13 = g_vectorOne.x * 1.4; pAVar3 = &pEVar6[1]._sprite; (pAVar3->_filename)._buf[8] = '\x1e'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &pEVar6[1]._sprite; (pAVar3->_filename)._buf[0xc] = '\x1e'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; (pEVar6->_sprite)._scale.x = fVar13; (pEVar6->_sprite)._scale.y = fVar12 * 1.4; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; case 0xd: ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.6; puStack_20 = local_38 + 0x34; bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar4 != 0) { local_b0[0] = (EntityPtr *)0x109; seed_fart_sound_override((int *)local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0[0],1.0,2,0,1.0,0.0); local_c4.x = 0.0; local_c4.y = -6.0; spawn_blood_explosion(2,&npc->_pos,&local_c4,&npc->_splatColor,&g_vectorZero); local_dc.x = (npc->_pos).x + 0.0; local_dc.y = (npc->_pos).y + 10.0; uVar5 = Random(); Game::Spawn(g_game,0x17,0,&local_dc,&g_vectorZero,(Entity *)npc,0,uVar5); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 4; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } } if (iVar10 == 10) { if (npc->_state != 0) { if (npc->_state != 4) { return; } ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,s_Walk,0); if ((npc->_parent == (EntityPtr)0x0) || (*(char *)((int)npc->_parent + 0x173) != '\0')) { EntityRef::EntityRef(&local_a8); (**(code **)(*(int *)npc + 0x24))(); } uVar5 = Random(); if ((uVar5 & 3) == 0) { uVar5 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3); } local_34._seed = npc->_initSeed; local_34._shift3 = 7; local_34._shift1 = 5; local_34._shift2 = 9; Entity_NPC::CalcTargetPosition(npc,&local_c4,0.0); EVar2 = npc->_parent; if (EVar2 == (EntityPtr)0x0) { local_d0 = (EntityPtr *)local_c4.y; local_b4 = (EntityPtr *)local_c4.x; } else { fVar13 = (npc->_pos).x - local_c4.x; local_b4 = (EntityPtr *)local_c4.x; fVar12 = (npc->_pos).y - local_c4.y; local_d0 = (EntityPtr *)local_c4.y; fVar12 = sqrtf(fVar12 * fVar12 + fVar13 * fVar13); if (240.0 < fVar12) { local_b4 = *(EntityPtr **)((int)EVar2 + 0x33c); local_d0 = *(EntityPtr **)((int)EVar2 + 0x340); } } local_d4 = RNG::RandomFloat(&local_34); fVar12 = (npc->_pos).y - (float)local_d0; fVar13 = (npc->_pos).x - (float)local_b4; fVar12 = sqrtf(fVar12 * fVar12 + fVar13 * fVar13); fVar12 = (fVar12 - 200.0) / 800.0; if (fVar12 <= 0.0) { fVar12 = 0.0; } if (1.0 <= fVar12) { fVar12 = 1.0; } local_bc.y = 40.0 - fVar12 * 40.0; local_dc.x = (float)local_b4 - (npc->_pos).x; local_dc.y = (float)local_d0 - (npc->_pos).y; Vector::Normalized(&local_dc,&local_c4); if (npc->_controllerID == -1) { local_b0[0] = (EntityPtr *)local_c4.y; local_b4 = (EntityPtr *)local_c4.x; iVar10 = -1; } else { controllerInput = Entity_NPC::GetControllerInput(npc,&local_dc,0.0); iVar10 = npc->_controllerID; local_b4 = (EntityPtr *)controllerInput->x; local_b0[0] = (EntityPtr *)controllerInput->y; local_bc.y = local_bc.y * 0.5; } fVar12 = sin(((float)(g_game->_frameCount - npc->_spawnFrame) / 60.0 + local_d4) * 6.2831855); local_bc.y = fVar12 * local_bc.y * 0.017453292; local_d4 = cos(local_bc.y); fVar12 = sin(local_bc.y); fVar13 = (float)local_b0[0] * local_d4; local_b0[0] = (EntityPtr *)((float)local_b4 * local_d4 - (float)local_b0[0] * fVar12); local_b4 = (EntityPtr *)((float)local_b4 * fVar12 + fVar13); if (iVar10 == -1) { local_bc.y = 0.0; local_d4 = 0.0; local_d0 = (EntityPtr *)0x0; Entity_NPC::QueryNPCsType(&local_34,npc->_type,npc->_variant); uVar5 = 0; if (local_34._shift3 != 0) { do { otherFatty = *(Entity_NPC **)(local_34._shift1 + uVar5 * 4); if (otherFatty != npc) { local_dc.y = (npc->_pos).y - (otherFatty->_pos).y; local_e4.y = (npc->_pos).x - (otherFatty->_pos).x; fVar12 = sqrtf(local_dc.y * local_dc.y + local_e4.y * local_e4.y); if (0.0 < fVar12) { local_bc.y = (float)((int)local_bc.y + 1); fVar13 = fVar12 * 0.1 + 10.0; local_d4 = ((local_dc.y / fVar12) / fVar13) * 10.0 + local_d4; local_d0 = (EntityPtr *)(((local_e4.y / fVar12) / fVar13) * 10.0 + (float)local_d0); } } uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_34._shift3); if (0 < (int)local_bc.y) { local_c4.x = (float)local_d0 / (float)(int)local_bc.y + (float)local_b0[0]; local_c4.y = local_d4 / (float)(int)local_bc.y + (float)local_b4; Vector::Normalize(&local_c4); local_b4 = (EntityPtr *)local_c4.y; local_b0[0] = (EntityPtr *)local_c4.x; } } EntityList_Query::~EntityList_Query(&local_34); } fVar12 = npc->_speedMultiplier; (npc->_velocity).x = (float)local_b0[0] * 0.6 * fVar12 + (npc->_velocity).x; (npc->_velocity).y = (float)local_b4 * 0.6 * fVar12 + (npc->_velocity).y; npc->_friction = 0.85; ExceptionList = local_1c; return; } ExceptionList = &local_1c; *(uint *)&npc->_flags = (uint)npc->_flags | 1; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; npc->_aiCallFlags = 4; npc->_state = 4; npc->_isInvicible = 1; npc->_entityGridCollisionClass = 3; puStack_20 = local_38 + 0x34; LAB_004e2ae3: Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)&DAT_00c5c73c); ExceptionList = local_1c; return; } ExceptionList = &local_1c; Entity_NPC::UpdateChargeBar(npc,60.0,0.0,(float)npc->_projectileCooldown,1); iVar10 = npc->_state; if (iVar10 == 0) { npc->_aiCallFlags = 1; npc->_state = 4; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); if (npc->_controllerID == -1) { uVar5 = Random(); iVar10 = uVar5 % 0x96 + 0x3c; } else { iVar10 = 0x3c; } npc->_projectileCooldown = iVar10; npc->_i1 = 0; uVar5 = Random(); fVar12 = normalize_angle_degrees ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0); (npc->_v1).y = fVar12; (npc->_v1).x = fVar12; npc->_projectileDelay = 2; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); (layer->_cropOffset).y = 96.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_cropOffset).y = 96.0; goto LAB_004e2ae3; } if (iVar10 != 4) { if (iVar10 == 8) { Entity_NPC::UpdateControllerMovement(npc,0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0xd5,0.6,10,0,1.0); local_c4.x = 0.0; local_c4.y = -20.0; local_b0[0] = (EntityPtr *)((float)npc->_i2 * 0.017453292); spawn_blood_explosion (3,&npc->_pos,&local_c4,(ColorMod *)((int)local_bc.y + 0x1e4),&g_vectorZero); uVar5 = Random(); fVar12 = cos((float)local_b0[0]); local_c4.x = fVar12 * 10.0; fVar12 = sin((float)local_b0[0]); local_c4.y = fVar12 * 10.0; pEVar6 = Game::Spawn(g_game,0x33f,0x14,&npc->_pos,&local_c4,(Entity *)local_bc.y,0,uVar5); uVar7 = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar10 = *(int *)pEVar6; *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar7; (**(code **)(iVar10 + 0xc))(); pEVar6[2]._posOffset.x = 8.40779e-45; ANM2::Play(&pEVar6->_sprite,&DAT_00b602e8,1); pEVar6[2]._prevVelocity.y = -8.0; pEVar6[2]._speedMultiplier = -15.0; (pEVar6->_posOffset).y = -15.0; pEVar6->_entityCollisionClass = 2; npc = (Entity_NPC *)local_bc.y; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; if (npc->_controllerID == -1) { uVar5 = Random(); iVar10 = uVar5 % 0xb4 + 0x5a; } else { iVar10 = 0x5a; } npc->_projectileCooldown = iVar10; } npc->_friction = npc->_friction * 0.4; } goto LAB_004e26fb; } local_a8._entity = &DAT_0000000f; local_a8._flags = 8; local_a8._position.x = (float)0x6b6c6157; local_a8._position.y = (float)0x74726556; local_a8._velocity.x._0_1_ = 0; local_80._offset[2] = 2.10195e-44; local_80._offset[1] = 1.12104e-44; local_80._colorize[1] = (float)0x6b6c6157; local_80._colorize[2] = (float)0x74726556; local_80._colorize[3]._0_1_ = 0; walkRightAnimCapacity = 0xf; walkRightAnimSize = 9; walkRightAnim = 0x686769526b6c6157; local_4c = 0x74; local_4b = 0; local_34._shift3 = 0xf; local_34._shift2 = 8; walkLeftAnim = (void *)0x6b6c6157; builtin_strncpy(local_38,"Left",4); local_34._seed = local_34._seed & 0xffffff00; local_14 = 4; Entity_NPC::anim_walk_frame_4dir (npc,&walkLeftAnim,&walkRightAnim,local_80._colorize + 1,&local_a8._position,0x3dcccccd) ; local_14._0_1_ = 3; if (0xf < (uint)local_34._shift3) { uVar5 = local_34._shift3 + 1; pvVar8 = walkLeftAnim; if (0xfff < uVar5) { pvVar8 = *(void **)((int)walkLeftAnim + -4); uVar5 = local_34._shift3 + 0x24; if (0x1f < (uint)((int)walkLeftAnim + (-4 - (int)pvVar8))) goto LAB_004e20c8; } operator_delete(pvVar8,uVar5); } local_14._0_1_ = 2; local_34._shift2 = 0; local_34._shift3 = 0xf; walkLeftAnim = (void *)((uint)walkLeftAnim & 0xffffff00); if (0xf < walkRightAnimCapacity) { uVar5 = walkRightAnimCapacity + 1; pvVar8 = (void *)walkRightAnim; if (0xfff < uVar5) { pvVar8 = *(void **)((int)(void *)walkRightAnim + -4); uVar5 = walkRightAnimCapacity + 0x24; if (0x1f < (uint)((int)(void *)walkRightAnim + (-4 - (int)pvVar8))) goto LAB_004e20c8; } operator_delete(pvVar8,uVar5); } local_14._0_1_ = 1; walkRightAnimSize = 0; walkRightAnimCapacity = 0xf; walkRightAnim = walkRightAnim & 0xffffffffffffff00; if (0xf < (uint)local_80._offset[2]) { uVar5 = (int)local_80._offset[2] + 1; pvVar8 = (void *)local_80._colorize[1]; if (0xfff < uVar5) { pvVar8 = *(void **)((int)local_80._colorize[1] + -4); uVar5 = (int)local_80._offset[2] + 0x24; if (0x1f < (uint)((int)local_80._colorize[1] + (-4 - (int)pvVar8))) goto LAB_004e20c8; } operator_delete(pvVar8,uVar5); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_80._offset[1] = 0.0; local_80._offset[2] = 2.10195e-44; local_80._colorize[1] = (float)((uint)local_80._colorize[1] & 0xffffff00); if (&DAT_0000000f < local_a8._entity) { size = (undefined1 *)((int)local_a8._entity + 1); pvVar8 = (void *)local_a8._position.x; if ((undefined1 *)0xfff < size) { pvVar8 = *(void **)((int)local_a8._position.x + -4); size = (undefined1 *)((int)local_a8._entity + 0x24); if (0x1f < (uint)((int)local_a8._position.x + (-4 - (int)pvVar8))) { LAB_004e20c8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,(uint)size); } npc->_friction = npc->_friction * 0.6; if (npc->_controllerID == -1) { bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000b00); if ((bVar4 != 0) || (npc->_forcedTarget != (EntityPtr)0x0)) { npc->_i1 = 10; } bVar4 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar4 == 0) { bVar4 = Entity::HasEntityFlags((Entity *)npc,0x100); if ((bVar4 == 0) && (npc->_forcedTarget == (EntityPtr)0x0)) { bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar4 != 0) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar12 = atan2f((npc->_pos).y - (pEVar6->_pos).y,(npc->_pos).x - (pEVar6->_pos).x); (npc->_v1).x = fVar12 * 57.295776; } } else { local_dc.y = (float)Entity_NPC::GetPlayerTarget(npc); bVar4 = Entity::IsFrame((Entity *)npc,5,npc->_index); if (bVar4 != 0) { local_e4.y = (npc->_pos).x; local_b0[0] = (EntityPtr *)(npc->_pos).y; local_d4 = (npc->_velocity).x; local_d0 = (EntityPtr *)(npc->_velocity).y; local_b4 = (EntityPtr *)npc->_friction; PathFinder::Reset((PathFinder *)&npc->_pathfinder); local_dc.x = ((Vector *)((int)local_dc.y + 0x33c))->x; local_dc.y = ((Vector *)((int)local_dc.y + 0x33c))->y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_dc,1.0,900,1); fVar12 = atan2f((npc->_velocity).y,(npc->_velocity).x); (npc->_v1).x = fVar12 * 57.295776; (npc->_pos).x = local_e4.y; (npc->_pos).y = (float)local_b0[0]; (npc->_velocity).x = local_d4; (npc->_velocity).y = (float)local_d0; npc->_friction = (float)local_b4; pEVar11 = (EntityPtr *)local_c4.y; } } } else { uVar5 = Random(); if (uVar5 % 5 == 0) { uVar5 = Random(); fVar12 = normalize_angle_degrees ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0); (npc->_v1).x = fVar12; } } npc->_i1 = npc->_i1 - (int)pEVar11; local_c4.y = (npc->_v1).y * 0.017453292; local_b0[0] = (EntityPtr *)cos(local_c4.y); local_c4.y = sin(local_c4.y); fVar12 = npc->_speedMultiplier; (npc->_velocity).x = (float)local_b0[0] * 1.2 * fVar12 + (npc->_velocity).x; (npc->_velocity).y = local_c4.y * 1.2 * fVar12 + (npc->_velocity).y; fVar12 = approach_angle((npc->_v1).y,(npc->_v1).x,10.0); (npc->_v1).y = fVar12; if ((npc->_collidesWithGrid != 0) && (uVar5 = Random(), (uVar5 & 3) == 0)) { fVar12 = (npc->_gridCollisionNormal).x; fVar13 = (npc->_gridCollisionNormal).y; fVar14 = fVar13 * local_c4.y + fVar12 * (float)local_b0[0]; fVar12 = atan2f(local_c4.y - (fVar13 + fVar13) * fVar14, (float)local_b0[0] - (fVar12 + fVar12) * fVar14); (npc->_v1).x = fVar12 * 57.295776; } if (npc->_i1 < 1) { uVar5 = Random(); fVar12 = normalize_angle_degrees ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 360.0); (npc->_v1).x = fVar12; uVar5 = Random(); npc->_i1 = uVar5 % 0x78 + 0x2d; } } else { controllerInput = Entity_NPC::GetControllerInput(npc,&local_c4,0.0); fVar12 = npc->_speedMultiplier; fVar13 = controllerInput->y; (npc->_velocity).x = controllerInput->x * 1.2 * 1.25 * fVar12 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 1.2 * 1.25 * fVar12 + (npc->_velocity).y; } uVar5 = Random(); if (uVar5 % 0x50 == 0) { Entity_NPC::PlaySound(npc,0xa7,1.0,0x3c,0,0.6); } if (npc->_projectileCooldown < 1) { LAB_004e256a: sameCharmCount = 0; Entity_NPC::QueryNPCsType(&local_34,0x33f,0x14); uVar5 = 0; if (local_34._shift3 != 0) { do { if (((*(uint *)(*(int *)(local_34._shift1 + uVar5 * 4) + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0)) { sameCharmCount = sameCharmCount + 1; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_34._shift3); npc = (Entity_NPC *)local_bc.y; if (2 < sameCharmCount) { *(int *)((int)local_bc.y + 0xba0) = 0x3c; } } EntityList_Query::~EntityList_Query(&local_34); iVar10 = npc->_projectileCooldown; } else { iVar10 = npc->_projectileCooldown - (int)pEVar11; npc->_projectileCooldown = iVar10; if (iVar10 < 1) goto LAB_004e256a; } if ((iVar10 < 1) && ((npc->_controllerID == -1 || (bVar4 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar4 != 0)))) { npc->_state = 8; if (npc->_controllerID == -1) { uVar5 = Random(); npc->_i2 = uVar5 % 0x5a + 0x2d; } else { controllerInput = Entity_NPC::GetControllerMovementInput(npc,&local_c4,0.0); fVar12 = atan2f(controllerInput->y,controllerInput->x); local_c4.y = normalize_angle_degrees(fVar12 * 57.295776); if ((local_c4.y < 45.0) || (135.0 < local_c4.y)) { npc->_i2 = 0x5a; Entity_NPC::UpdateControllerMovement(npc,1); } else { dVar16 = floor((double)local_c4.y); local_c4.y = (float)dVar16; npc->_i2 = (int)dVar16; Entity_NPC::UpdateControllerMovement(npc,1); } } ANM2::Play(&npc->_sprite,(byte *)"Attack",0); npc->_stateFrame = 0; } LAB_004e26fb: if (0.0 < npc->_pendingDamage) { iVar9 = (int)(npc->_pendingDamage * 12.0); iVar10 = 1; if (1 < iVar9) { iVar10 = iVar9; } npc->_projectileCooldown = npc->_projectileCooldown - iVar10; } uVar5 = Random(); if (uVar5 % 6 == 0) { uVar5 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 1.4 + 0.5); } if (npc->_dead == 0) { ExceptionList = local_1c; return; } Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,&npc->_splatColor,1.0); uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); uVar7 = Color::Color(); (**(code **)(*(int *)pEVar6 + 0x3c))(uVar7,0xffffffff,0xff,0); (**(code **)(*(int *)pEVar6 + 0xc))(); bVar4 = Entity::HasEntityFlags((Entity *)npc,0x20000001000000); if (bVar4 != 0) { ExceptionList = local_1c; return; } local_bc.x = 0.0; local_bc.y = -28.0; local_b0[0] = (EntityPtr *)0x4; do { uVar5 = Random(); local_c4.y = (-45.0 - (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 90.0) * 0.017453292; local_dc.y = cos(local_c4.y); fVar12 = sin(local_c4.y); local_e4.x = local_dc.y * 7.0; local_e4.y = fVar12 * 7.0; pEVar6 = (Entity *)local_dc.y; Color::Color(&local_80); bloodPos.x = (float)pEVar6 * 40.0 + (npc->_pos).x; bloodPos.y = fVar12 * 40.0 + (npc->_pos).y; pEVar6 = spawn_blood_explosion(2,&bloodPos,&local_bc,color,&local_e4); uVar5 = Random(); pEVar6->_renderZOffset = 500; iVar10 = *(int *)pEVar6; (pEVar6->_sprite)._rotation = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; (**(code **)(iVar10 + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0); local_b0[0] = (EntityPtr *)&local_b0[0][-1].field_0x3; } while (local_b0[0] != (EntityPtr *)0x0); burstTimer = Entity_Effect::CreateTimer(NpcHelper::gutted_fatty_burst_projectiles,1,0xf,0); (burstTimer->_pos).x = (npc->_pos).x; (burstTimer->_pos).y = (npc->_pos).y; if (npc->_isChampion == 0) { iVar10 = -1; } else { iVar10 = npc->_championColorIdx; } burstTimer->_state = iVar10; uVar5 = *(uint *)((int)&npc->_flags + 4); *(uint *)&burstTimer->_flags = (uint)burstTimer->_flags | (uint)npc->_flags & 0x20000100; puVar1 = (uint *)((int)&burstTimer->_flags + 4); *puVar1 = *puVar1 | uVar5 & 0x400000; burstTimer->_scale = npc->_scale; (**(code **)(*(int *)burstTimer + 0xc))(); ExceptionList = local_1c; return; switchD_004e110f_caseD_4: pvVar8 = (npc->_sprite)._animState._animData; if (pvVar8 != (void *)0x0) { if (*(char *)((int)pvVar8 + 0x34) != '\0') { ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.75,0); fVar12 = npc->_speedMultiplier; auVar15 = ZEXT812(0x3f59999a); if (fVar12 != 1.0) { fVar13 = auVar15._0_4_; auVar15._4_8_ = auVar15._4_8_; auVar15._0_4_ = fVar13 / ((fVar12 + fVar13) - fVar12 * fVar13); } fVar13 = 0.8; (npc->_velocity).x = auVar15._0_4_ * (npc->_velocity).x; if (fVar12 != 1.0) { fVar13 = 0.8 / ((fVar12 + 0.8) - fVar12 * 0.8); } (npc->_velocity).y = fVar13 * (npc->_velocity).y; if ((0 < npc->_projectileCooldown) && (iVar10 = npc->_projectileCooldown - (int)pEVar11, npc->_projectileCooldown = iVar10, 0 < iVar10)) { ExceptionList = local_1c; return; } uVar5 = Random(); if (uVar5 % 0xf != 0) { ExceptionList = local_1c; return; } ANM2::Play(&npc->_sprite,s_Spawn,0); npc->_state = 0xd; uVar5 = Random(); npc->_projectileCooldown = uVar5 % 0x96 + 0x3c; Entity_NPC::QueryNPCsType(fattyQuery,npc->_type,npc->_variant); local_14 = 0; local_b0[0] = (EntityPtr *)0x0; if ((EntityPtr *)local_c4.y != (EntityPtr *)0x0) { iVar10 = local_c8; do { otherFatty = *(Entity_NPC **)(iVar10 + (int)local_b0[0] * 4); if (otherFatty != npc) { if (((otherFatty->_flags & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0)) { uVar5 = Random(); iVar9 = uVar5 % 0x96 + 0x3c; iVar10 = otherFatty->_projectileCooldown; if (otherFatty->_projectileCooldown < iVar9) { iVar10 = iVar9; } otherFatty->_projectileCooldown = iVar10; } iVar10 = local_c8; } local_b0[0] = (EntityPtr *)&local_b0[0]->field_0x1; } while (local_b0[0] < (uint)local_c4.y); } EntityList_Query::~EntityList_Query(fattyQuery); ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_004e1341; } ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,s_Idle,0); LAB_004e1341: npc->_friction = npc->_friction * 0.7; ExceptionList = local_1c; return; } //@@ 004e2b40 NpcAI::ENTITY_GAPER_L2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 850 (from dispatcher 006c2990) */ uint __fastcall NpcAI::ENTITY_GAPER_L2(Entity_NPC *npc) { float fVar1; undefined4 uVar2; byte bVar3; uint uVar4; Entity *tmpEntity; Entity_Effect *effect; uint uVar5; Vector *pVVar6; void *pvVar7; int iVar8; LayerState *headLayer; Entity_NPC *head; float *extraout_ECX; int elapsedFrames; float fVar9; float fVar10; float normalDot; Vector local_6c; Vector local_64; float local_5c; byte local_55; void *walkAnimV; char local_50 [12]; uint walkAnimVSize; uint walkAnimVCapacity; void *walkAnimH; char local_38 [12]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af3b95; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; local_64.y = 0.0; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; iVar8 = npc->_state; local_24 = uVar4; if (npc->_variant == 1) { npc->_friction = npc->_friction * 0.93; if (iVar8 == 0) { npc->_state = 4; fVar1 = fRam00c5c774; fVar9 = fRam00c5c770; fVar10 = fRam00c5c76c; if (&npc->_splatColor != (ColorMod *)&DAT_00c5c768) { (npc->_splatColor)._tint[0] = _DAT_00c5c768; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar9; (npc->_splatColor)._tint[3] = fVar1; fVar1 = fRam00c5c784; fVar9 = fRam00c5c780; fVar10 = fRam00c5c77c; (npc->_splatColor)._colorize[0] = _DAT_00c5c778; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar9; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = DAT_00c5c788; (npc->_splatColor)._offset[2] = DAT_00c5c790; } puStack_20 = local_38 + 0x34; uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x1e + 0xf; } else if (iVar8 == 4) { puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_projectileCooldown = npc->_projectileCooldown - elapsedFrames; if (npc->_projectileCooldown < 1) { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); } pVVar6 = Entity_NPC::CalcTargetPosition(npc,&local_64,0.0); local_5c = pVVar6->x - (npc->_pos).x; local_6c.y = pVVar6->y - (npc->_pos).y; if (npc->_controllerID != -1) { pVVar6 = Entity_NPC::GetControllerInput(npc,&local_64,0.0); local_5c = pVVar6->x; local_6c.y = pVVar6->y; } fVar10 = sqrtf(local_5c * local_5c + local_6c.y * local_6c.y); if (0.0 < fVar10) { fVar9 = npc->_friction; if (fVar9 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).x = (local_5c * (0.13 / fVar10) * fVar1) / fVar9 + (npc->_velocity).x; (npc->_velocity).y = (local_6c.y * (0.13 / fVar10) * fVar1) / fVar9 + (npc->_velocity).y; } } } else { puStack_20 = local_38 + 0x34; if (iVar8 == 8) { puStack_20 = local_38 + 0x34; Entity_NPC::UpdateControllerMovement(npc,0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0x92,1.0,2,0,0.9); tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar10 = (tmpEntity->_pos).x - (npc->_pos).x; fVar9 = (tmpEntity->_pos).y - (npc->_pos).y; local_6c.y = fVar10; local_64.x = fVar10; local_64.y = fVar9; local_5c = fVar9; if ((npc->_controllerID != -1) && (bVar3 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar3 != 0)) { fVar10 = *extraout_ECX; fVar9 = extraout_ECX[1]; local_6c.y = fVar10; local_64.x = fVar10; local_64.y = fVar9; local_5c = fVar9; } fVar10 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); if (0.0 < fVar10) { local_6c.y = local_6c.y * (10.0 / fVar10); local_64.y = local_5c * (10.0 / fVar10); local_64.x = local_6c.y; local_5c = local_64.y; } local_2c.x = 0.0; local_2c.y = -24.0; effect = (Entity_Effect *) spawn_blood_explosion(5,&npc->_pos,&local_2c,&npc->_splatColor,&g_vectorZero); effect->_renderDepthOffset = 1.0; Entity_Effect::FollowParent(effect,(Entity *)npc); (effect->_sprite)._flipX = 1; local_2c.x = local_6c.y * 0.3 + (npc->_pos).x; local_2c.y = local_5c * 0.3 + (npc->_pos).y; NpcHelper::gaper_l2_spawn_maggot(&local_64,0xc1000000); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_projectileCooldown = 0x2d; } } } goto LAB_004e2dbf; } if (npc->_variant != 2) { if (iVar8 == 0) { bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } npc->_state = 4; fVar1 = fRam00c5c774; fVar9 = fRam00c5c770; fVar10 = fRam00c5c76c; if (&npc->_splatColor != (ColorMod *)&DAT_00c5c768) { (npc->_splatColor)._tint[0] = _DAT_00c5c768; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar9; (npc->_splatColor)._tint[3] = fVar1; fVar1 = fRam00c5c784; fVar9 = fRam00c5c780; fVar10 = fRam00c5c77c; (npc->_splatColor)._colorize[0] = _DAT_00c5c778; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar9; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = DAT_00c5c788; (npc->_splatColor)._offset[2] = DAT_00c5c790; } } else { puStack_20 = local_38 + 0x34; if (iVar8 == 4) { walkAnimVCapacity = 0xf; walkAnimVSize = 8; walkAnimV = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); local_2c.y = 2.10195e-44; local_2c.x = 1.12104e-44; walkAnimH = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 3; puStack_20 = local_38 + 0x34; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimH,(std_string *)&walkAnimV,0.1); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < (uint)local_2c.y) { uVar4 = (int)local_2c.y + 1; pvVar7 = walkAnimH; if (0xfff < uVar4) { pvVar7 = *(void **)((int)walkAnimH + -4); uVar4 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)walkAnimH + (-4 - (int)pvVar7))) goto LAB_004e3582; } operator_delete(pvVar7,uVar4); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; walkAnimH = (void *)((uint)walkAnimH & 0xffffff00); if (0xf < walkAnimVCapacity) { uVar4 = walkAnimVCapacity + 1; pvVar7 = walkAnimV; if (0xfff < uVar4) { pvVar7 = *(void **)((int)walkAnimV + -4); uVar4 = walkAnimVCapacity + 0x24; if (0x1f < (uint)((int)walkAnimV + (-4 - (int)pvVar7))) { LAB_004e3582: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar4); } if ((((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat (&(npc->_sprite)._overlayAnimState, (float)(int)(npc->_sprite)._animState._animFrame); } local_55 = (npc->_sprite)._flipX; headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); headLayer->_flipX = local_55; npc->_aiFloat = 0.6; Entity_NPC::CalcTargetPosition(npc,&local_2c,0.0); bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar3 == 0) { iVar8 = 900; if (npc->_subtype == 2) { iVar8 = -1; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_2c,npc->_aiFloat,iVar8,1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_64.x = (tmpEntity->_pos).x; local_64.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_64,0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar3 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if (((bVar3 != 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (uVar4 = Random(), uVar4 % 3 == 0)) goto LAB_004e36d6; } else { bVar3 = Entity_NPC::IsControllerActionTriggered(npc,10); if (bVar3 != 0) { LAB_004e36d6: Entity_NPC::PlaySound(npc,0xa5,1.0,0x28,0,0.9); } } } } if ((npc->_dead != 0) && (npc->_variant == 0)) { Entity_NPC::Morph(npc,npc->_type,2,0,-1); ANM2::PlayOverlay(&npc->_sprite,(byte *)"Blood",0); npc->_health = npc->_maxHitPoints; (npc->_sprite)._overlayRenderFirst = 1; npc->_dead = 0; pVVar6 = Entity_NPC::CalcTargetPosition(npc,&local_64,0.0); fVar10 = atan2f((npc->_pos).y - pVVar6->y,(npc->_pos).x - pVVar6->x); (npc->_v1).x = fVar10 * 57.295776; uVar4 = Random(); local_6c.x = (npc->_pos).x + 0.0; local_6c.y = (npc->_pos).y - 10.0; head = (Entity_NPC *) Game::Spawn(g_game,npc->_type,1,&local_6c,&g_vectorZero,(Entity *)npc,0,uVar4); if (npc->_isChampion != 0) { Entity_NPC::MakeChampion(head,npc->_initSeed,npc->_championColorIdx,0); } uVar2 = *(undefined4 *)((int)&head->_flags + 4); *(uint *)&head->_flags = (uint)head->_flags & 0xfffffffb; *(undefined4 *)((int)&head->_flags + 4) = uVar2; uVar4 = (**(code **)(*(int *)head + 0xc))(); ExceptionList = local_1c; return uVar4; } LAB_004e2dbf: uVar4 = Random(); uVar5 = uVar4 / 10; if (uVar4 % 10 == 0) { uVar4 = Random(); effect = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.4); uVar5 = (**(code **)(*(int *)effect + 0x3c))(&DAT_00c5c768,0xffffffff,0xff,0,1); } ExceptionList = local_1c; return uVar5; } if (iVar8 == 0) { puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,(byte *)"WalkVert",0); ANM2::PlayOverlay(&npc->_sprite,(byte *)"Blood",0); (npc->_sprite)._overlayRenderFirst = 1; npc->_state = 4; fVar1 = fRam00c5c774; fVar9 = fRam00c5c770; fVar10 = fRam00c5c76c; if (&npc->_splatColor != (ColorMod *)&DAT_00c5c768) { (npc->_splatColor)._tint[0] = _DAT_00c5c768; (npc->_splatColor)._tint[1] = fVar10; (npc->_splatColor)._tint[2] = fVar9; (npc->_splatColor)._tint[3] = fVar1; fVar1 = fRam00c5c784; fVar9 = fRam00c5c780; fVar10 = fRam00c5c77c; (npc->_splatColor)._colorize[0] = _DAT_00c5c778; (npc->_splatColor)._colorize[1] = fVar10; (npc->_splatColor)._colorize[2] = fVar9; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = DAT_00c5c788; (npc->_splatColor)._offset[2] = DAT_00c5c790; } } else { puStack_20 = local_38 + 0x34; if (iVar8 != 4) goto LAB_004e33c7; walkAnimVCapacity = 0xf; walkAnimVSize = 8; walkAnimV = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); local_2c.y = 2.10195e-44; local_2c.x = 1.12104e-44; walkAnimH = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; puStack_20 = local_38 + 0x34; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimH,(std_string *)&walkAnimV,0.0); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_2c.y) { uVar5 = (int)local_2c.y + 1; pvVar7 = walkAnimH; if (0xfff < uVar5) { pvVar7 = *(void **)((int)walkAnimH + -4); uVar5 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)walkAnimH + (-4 - (int)pvVar7))) goto LAB_004e30c8; } operator_delete(pvVar7,uVar5); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; walkAnimH = (void *)((uint)walkAnimH & 0xffffff00); if (0xf < walkAnimVCapacity) { uVar5 = walkAnimVCapacity + 1; pvVar7 = walkAnimV; if (0xfff < uVar5) { pvVar7 = *(void **)((int)walkAnimV + -4); uVar5 = walkAnimVCapacity + 0x24; if (0x1f < (uint)((int)walkAnimV + (-4 - (int)pvVar7))) { LAB_004e30c8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } npc->_friction = npc->_friction * 0.8; uVar5 = Random(); fVar10 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 - 0.5; local_5c = fVar10 + fVar10 + (npc->_v1).x; (npc->_v1).x = local_5c; local_2c.y = (npc->_velocity).x; fVar10 = atan2f((npc->_velocity).y,local_2c.y); local_5c = approach_angle(local_5c,fVar10 * 57.295776,0.1); (npc->_v1).x = local_5c; local_5c = local_5c * 0.017453292; local_6c.y = cos(local_5c); fVar9 = sin(local_5c); bVar3 = npc->_collidesWithGrid; fVar10 = npc->_speedMultiplier; (npc->_velocity).x = local_6c.y * 1.2 * fVar10 + local_2c.y; (npc->_velocity).y = fVar9 * 1.2 * fVar10 + (npc->_velocity).y; if (bVar3 != 0) { fVar10 = (npc->_gridCollisionNormal).x; fVar1 = (npc->_gridCollisionNormal).y; normalDot = fVar1 * fVar9 + fVar10 * local_6c.y; fVar10 = atan2f(fVar9 - (fVar1 + fVar1) * normalDot,local_6c.y - (fVar10 + fVar10) * normalDot ); (npc->_v1).x = fVar10 * 57.295776; } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - elapsedFrames; goto LAB_004e33c7; } uVar5 = Random(); if ((uVar5 & 3) == 0) { pvVar7 = Entity_NPC::QueryNPCsType(local_38 + 4,0x355,-1); fVar10 = 1.4013e-45; if (0xf < *(uint *)((int)pvVar7 + 0xc)) goto LAB_004e3287; local_55 = 1; } else { fVar10 = local_64.y; LAB_004e3287: local_55 = 0; } if (((uint)fVar10 & 1) != 0) { EntityList_Query::~EntityList_Query(local_38 + 4); } if (local_55 != 0) { pVVar6 = MusicManager::RandomVector(&local_2c); uVar5 = Random(); fVar10 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_64.x = fVar10 + fVar10 + 2.0; local_64.y = local_64.x * pVVar6->y; local_64.x = local_64.x * pVVar6->x; spawn_small_maggot(&npc->_pos,-16.0,&local_64,-8.0); manager = g_manager; local_5c = 2.49431e-43; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,1.0,2,0,1.0,0.0); } } npc->_projectileCooldown = 0xf; LAB_004e33c7: uVar5 = Random(); if (uVar5 % 10 == 0) { uVar5 = Random(); effect = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.4); (**(code **)(*(int *)effect + 0x3c))(&DAT_00c5c768,0xffffffff,0xff,0,1,uVar4); } uVar4 = Random(); if (uVar4 % 0x14 != 0) { ExceptionList = local_1c; return uVar4 / 0x14; } iVar8 = Entity::GetIntervalTicks((Entity *)npc,4.0,0.0); if (iVar8 == 0) { ExceptionList = local_1c; return 0; } uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x3f,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); uVar4 = (**(code **)(*(int *)tmpEntity + 0xc))(); ExceptionList = local_1c; return uVar4; } //@@ 004e38c0 NpcAI::ENTITY_CHARGER_L2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 855 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CHARGER_L2(Entity_NPC *npc) { int *piVar1; byte bVar2; int iVar3; Vector *pVVar4; uint uVar5; Entity *playerTarget; void *pvVar6; int extraout_EDX; bool isChargeBlocked; float fVar7; float fVar8; Vector local_b0; Vector local_a8; Vector local_a0; Vector startPos; float startPosY; Vector local_8c; Vector local_84; float local_7c; Vector scratchVec; Entity_NPC *local_70; undefined8 moveDownAnim; undefined1 local_64; undefined1 local_63; undefined4 local_5c; uint local_58; ulonglong moveHoriAnim; undefined1 local_4c; undefined1 local_4b; undefined4 local_44; uint local_40; void *moveUpAnim; undefined2 local_38; undefined1 local_36; undefined1 local_35; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Entity_NPC *charger; Game *game; Manager *manager; Room *room; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af3bdd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; iVar3 = npc->_state; if (iVar3 == 0) { LAB_004e3dc7: npc->_state = 4; ExceptionList = local_1c; return; } local_70 = npc; if (iVar3 != 4) { if (iVar3 != 8) { return; } fVar8 = (npc->_pathfinder)._gridPathTarget.y - (npc->_pos).y; fVar7 = (npc->_pathfinder)._gridPathTarget.x - (npc->_pos).x; if (((fVar8 * fVar8 + fVar7 * fVar7) / (npc->_speedMultiplier * npc->_speedMultiplier) < 2.0) || (npc->_collidesWithGrid != 0)) { piVar1 = &(npc->_pathfinder)._moveCountdown; ExceptionList = &local_1c; *piVar1 = *piVar1 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_7c = (float)(npc->_pathfinder)._moveCountdown; } else { ExceptionList = &local_1c; (npc->_pathfinder)._moveCountdown = 0; local_7c = 0.0; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_variant == 1) && (puStack_20 = (undefined1 *)((int)register0x00000010 + -4), iVar3 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar3 != 0)) { PathFinder::Reset((PathFinder *)&npc->_pathfinder); local_8c.y = (npc->_velocity).x; bVar2 = 0; iVar3 = 900; local_84.y = (npc->_velocity).y; local_a0.y = npc->_friction; fVar7 = 10.0; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar4,fVar7,iVar3,bVar2); vector_to_direction(&npc->_v1); iVar3 = vector_to_direction(&npc->_velocity); (npc->_velocity).x = local_8c.y; fVar7 = local_7c; if (iVar3 != extraout_EDX) { fVar7 = 1.4013e-44; } (npc->_velocity).y = local_84.y; npc->_friction = local_a0.y; (npc->_pathfinder)._moveCountdown = (int)fVar7; } (npc->_pathfinder)._gridPathTarget.x = (npc->_pos).x; (npc->_pathfinder)._gridPathTarget.y = (npc->_pos).y; if (((npc->_flags & 0x1000a00) == 0) && (((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x80), bVar2 == 0 || (fVar7 = (npc->_velocity).y, fVar8 = (npc->_velocity).x, fVar7 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7), 3.0 <= fVar7)) && ((npc->_pathfinder)._moveCountdown < 6)))) { bVar2 = 0; fVar7 = atan2f((npc->_v1).y,(npc->_v1).x); uVar5 = (int)((fVar7 * 57.295776 + 360.0 + 22.5) / 45.0) & 0x80000007; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffff8) + 1; } ANM2::Play(&npc->_sprite,(&PTR_s_Attack_Right_00b60620)[uVar5],bVar2); fVar7 = npc->_friction * 0.8; npc->_friction = fVar7; if (fVar7 != 0.0) { fVar8 = npc->_speedMultiplier; (npc->_velocity).x = (fVar8 * (npc->_v1).x) / fVar7 + (npc->_velocity).x; (npc->_velocity).y = (fVar8 * (npc->_v1).y) / fVar7 + (npc->_velocity).y; } if (npc->_variant == 1) { ExceptionList = local_1c; return; } local_84.y = 0.0; local_8c.y = (npc->_v2).x - npc->_speedMultiplier * 0.033; pVVar4 = &local_8c; if (local_8c.y <= 0.0) { pVVar4 = &local_84; } (npc->_v2).x = pVVar4->y; room = g_game->_room; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&local_84,0.0); playerTarget = Entity_NPC::GetPlayerTarget(local_70); scratchVec.x = (playerTarget->_velocity).x * 16.0 + pVVar4->x; scratchVec.y = (playerTarget->_velocity).y * 16.0 + pVVar4->y; Room::GetClampedPositionImpl(room,&local_8c,&scratchVec,20.0,20.0,20.0,20.0); charger = local_70; scratchVec.y = local_8c.y - (local_70->_pos).y; scratchVec.x = local_8c.x - (local_70->_pos).x; if ((local_70->_v1).y * scratchVec.y + (local_70->_v1).x * scratchVec.x <= 0.0) { ExceptionList = local_1c; return; } fVar7 = (local_70->_v2).x; if (fVar7 <= 0.0) { ExceptionList = local_1c; return; } if (1.0 <= fVar7) { fVar7 = 1.0; } pVVar4 = Vector::Resized(&scratchVec,&local_b0,fVar7 * 0.1); fVar7 = (charger->_v1).x; scratchVec.x = charger->_speedMultiplier * pVVar4->x + fVar7; fVar8 = (charger->_v1).y; scratchVec.y = charger->_speedMultiplier * pVVar4->y + fVar8; fVar7 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); pVVar4 = Vector::Resized(&scratchVec,&local_a8,fVar7); (charger->_v1).x = pVVar4->x; (charger->_v1).y = pVVar4->y; ExceptionList = local_1c; return; } (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; goto LAB_004e3dc7; } local_58 = 0xf; local_5c = 9; moveDownAnim = 0x776f442065766f4d; local_64 = 0x6e; local_63 = 0; moveUpAnim = (void *)0x65766f4d; local_38 = 0x5520; local_28 = 0xf; local_2c = 7; local_36 = 0x70; local_35 = 0; local_40 = 0xf; local_44 = 9; moveHoriAnim = 0x726f482065766f4d; local_4c = 0x69; local_4b = 0; local_14 = 2; ExceptionList = &local_1c; NpcHelper::charger_update_move_anim(&moveHoriAnim,&moveUpAnim,&moveDownAnim,0); local_14._0_1_ = 1; if (0xf < local_40) { uVar5 = local_40 + 1; pvVar6 = (void *)moveHoriAnim; if (0xfff < uVar5) { pvVar6 = *(void **)((int)(void *)moveHoriAnim + -4); uVar5 = local_40 + 0x24; if (0x1f < (uint)((int)(void *)moveHoriAnim + (-4 - (int)pvVar6))) goto LAB_004e3f4c; } operator_delete(pvVar6,uVar5); } local_14._0_1_ = 0; local_44 = 0; local_40 = 0xf; moveHoriAnim = moveHoriAnim & 0xffffffffffffff00; if (0xf < local_28) { uVar5 = local_28 + 1; pvVar6 = moveUpAnim; if (0xfff < uVar5) { pvVar6 = *(void **)((int)moveUpAnim + -4); uVar5 = local_28 + 0x24; if (0x1f < (uint)((int)moveUpAnim + (-4 - (int)pvVar6))) goto LAB_004e3f4c; } operator_delete(pvVar6,uVar5); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_2c = 0; local_28 = 0xf; moveUpAnim = (void *)((uint)moveUpAnim & 0xffffff00); if (0xf < local_58) { uVar5 = local_58 + 1; pvVar6 = (void *)moveDownAnim; if (0xfff < uVar5) { pvVar6 = *(void **)((int)(void *)moveDownAnim + -4); uVar5 = local_58 + 0x24; if (0x1f < (uint)((int)(void *)moveDownAnim + (-4 - (int)pvVar6))) { LAB_004e3f4c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar5); } if ((npc->_variant == 1) && (0 < npc->_stateFrame)) { iVar3 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; npc->_friction = npc->_friction * 0.85; npc->_stateFrame = iVar3; if (0 < iVar3) { ExceptionList = local_1c; return; } bVar2 = 0; iVar3 = 900; npc->_stateFrame = 4; fVar7 = 2.0; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar4,fVar7,iVar3,bVar2); iVar3 = vector_to_direction(&npc->_velocity); Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,iVar3); manager = g_manager; local_7c = 3.09687e-43; seed_fart_sound_override((int *)&local_7c); SoundEffects::Play(&manager->_sfxManager,(int)local_7c,1.0,0x14,0,1.0,0.0); charger = local_70; uVar5 = iVar3 + 2U & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } ANM2::Play(&local_70->_sprite,(&PTR_s_Attack_Right_00b60610)[uVar5],0); (charger->_sprite)._flipX = 0; (charger->_v1).x = scratchVec.x * 2.0; (charger->_v1).y = scratchVec.y * 2.0; (charger->_v2).x = 2.0; charger->_state = 8; (charger->_pathfinder)._gridPathTarget.x = (charger->_pos).x; (charger->_pathfinder)._gridPathTarget.y = (charger->_pos).y; (charger->_pathfinder)._moveCountdown = 0; ExceptionList = local_1c; return; } PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.65,0); fVar7 = npc->_speedMultiplier; fVar8 = 0.9647058; npc->_friction = npc->_friction * 0.85; game = g_game; if (fVar7 != 1.0) { fVar8 = 0.9647058 / ((fVar7 + 0.9647058) - fVar7 * 0.9647058); } startPos.y = (npc->_pos).x; (npc->_velocity).y = fVar8 * (npc->_velocity).y; room = game->_room; startPosY = (npc->_pos).y; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&local_a0,0.0); playerTarget = Entity_NPC::GetPlayerTarget(local_70); local_8c.y = (playerTarget->_velocity).x; local_84.y = (playerTarget->_velocity).y; uVar5 = Random(); fVar7 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; scratchVec.y = fVar7 * local_84.y * 16.0 + pVVar4->y; scratchVec.x = fVar7 * local_8c.y * 16.0 + pVVar4->x; Room::GetClampedPositionImpl(room,&local_8c,&scratchVec,20.0,20.0,20.0,20.0); charger = local_70; local_a8.y = local_8c.x - startPos.y; local_a0.y = local_8c.x; iVar3 = local_70->_controllerID; local_84.y = local_8c.y; local_b0.y = local_8c.y - startPosY; if (iVar3 != -1) { pVVar4 = Entity_NPC::GetControllerInput(local_70,&scratchVec,0.0); iVar3 = charger->_controllerID; local_a8.y = pVVar4->x * 100.0; local_b0.y = pVVar4->y * 100.0; local_a0.y = startPos.y + local_a8.y; local_84.y = startPosY + local_b0.y; } fVar7 = atan2f(local_b0.y,local_a8.y); uVar5 = (int)((fVar7 * 57.295776 + 360.0 + 45.0) / 90.0) & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } local_8c.y = (float)(uVar5 * 2); local_70 = (Entity_NPC *)((float)(int)local_8c.y * 45.0 * 0.017453292); local_7c = cos((float)local_70); local_70 = (Entity_NPC *)sin((float)local_70); scratchVec.y = cos(1.5707964); fVar7 = sin(1.5707964); if (iVar3 == -1) { if (local_7c * local_a8.y + (float)local_70 * local_b0.y <= 0.0) { ExceptionList = local_1c; return; } if (20.0 <= ABS((local_7c * fVar7 + (float)local_70 * scratchVec.y) * local_b0.y + (local_7c * scratchVec.y - (float)local_70 * fVar7) * local_a8.y)) { ExceptionList = local_1c; return; } startPos.x = startPos.y; startPos.y = startPosY; scratchVec.x = local_a0.y; scratchVec.y = local_84.y; bVar2 = Room::CheckLine(g_game->_room,&startPos,&scratchVec,1,0,0,0,(Vector *)0x0); isChargeBlocked = bVar2 == 0; } else if ((local_a8.y == g_vectorZero.x) && (local_b0.y == g_vectorZero.y)) { isChargeBlocked = true; } else { isChargeBlocked = false; } manager = g_manager; if (isChargeBlocked) { ExceptionList = local_1c; return; } if (charger->_variant == 1) { local_84.y = 3.09687e-43; seed_fart_sound_override((int *)&local_84.y); SoundEffects::Play(&manager->_sfxManager,(int)local_84.y,1.0,0x14,0,1.0,0.0); ANM2::Play(&charger->_sprite,(&PTR_s_Attack_Right_00b60610)[(int)local_8c.y / 2],0); fVar7 = (float)local_70 + (float)local_70; local_7c = local_7c + local_7c; } else { local_84.y = 3.13891e-43; seed_fart_sound_override((int *)&local_84.y); SoundEffects::Play(&manager->_sfxManager,(int)local_84.y,1.0,0x14,0,0.9,0.0); ANM2::Play(&charger->_sprite,(&PTR_s_Attack_Right_00b60620)[(int)local_8c.y],0); fVar7 = (float)local_70 * 1.3; local_7c = local_7c * 1.3; } (charger->_v1).x = local_7c; (charger->_v1).y = fVar7; (charger->_sprite)._flipX = 0; (charger->_v2).x = 2.0; charger->_state = 8; charger->_stateFrame = 4; (charger->_pathfinder)._gridPathTarget.x = (charger->_pos).x; (charger->_pathfinder)._gridPathTarget.y = (charger->_pos).y; (charger->_pathfinder)._moveCountdown = 0; ExceptionList = local_1c; return; } //@@ 004e45c0 std::set::insert /* DB: find_node, allocates 0x14 node with key, returns pair */ void std::set::insert(int *param_1,int *param_2) { undefined8 uVar1; undefined4 uVar2; uint uVar3; undefined8 *puVar4; undefined4 *newNode; void *pvVar5; undefined4 *in_ECX; undefined1 uVar6; void *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3c1d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined8 *)find_node(local_1c,param_2); pvVar5 = *(void **)(puVar4 + 1); uVar1 = *puVar4; if ((*(char *)((int)pvVar5 + 0xd) == '\0') && (*(int *)((int)pvVar5 + 0x10) <= *param_2)) { uVar6 = 0; } else { if (in_ECX[1] == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } uVar2 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x14); newNode[4] = *param_2; iStack_24 = (int)((ulonglong)uVar1 >> 0x20); *newNode = uVar2; local_28 = (void *)uVar1; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; pvVar5 = _Tree::_Insert_node(in_ECX,local_28,iStack_24,newNode); uVar6 = 1; } *param_1 = (int)pvVar5; *(undefined1 *)(param_1 + 1) = uVar6; ExceptionList = local_10; return; } //@@ 004e4690 pow /* DB: thunk to libm_sse2_pow_precise prototype: db/protos.zhl */ float __cdecl pow(float base,float exponent) { double dVar1; dVar1 = (double)base; libm_sse2_pow_precise(); return (float)dVar1; } //@@ 004e46b0 FUN_004e46b0 void FUN_004e46b0(void) { return; } //@@ 004e46c0 FUN_004e46c0 void FUN_004e46c0(void) { return; } //@@ 004e46d0 Color::apply_to_kcolor /* DB: tint*kcolor, colorize via luma 0.2126/0.7152/0.0722, add offset prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl Color::apply_to_kcolor(KColor *outColor,ColorMod *color,KColor *input) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; fVar1 = color->_colorize[3]; fVar2 = color->_tint[3]; fVar8 = color->_tint[0] * input->_red; fVar7 = color->_tint[1] * input->_green; fVar6 = color->_tint[2] * input->_blue; fVar3 = input->_alpha; if (fVar1 != 0.0) { fVar5 = fVar7 * 0.71516 + fVar8 * 0.212671 + fVar6 * 0.072169; fVar8 = fVar8 + (fVar5 * color->_colorize[0] - fVar8) * fVar1; fVar7 = fVar7 + (fVar5 * color->_colorize[1] - fVar7) * fVar1; fVar6 = fVar6 + (fVar5 * color->_colorize[2] - fVar6) * fVar1; } fVar1 = color->_offset[2]; fVar5 = color->_offset[1]; fVar4 = color->_offset[0]; outColor->_unk = 0; outColor->_alpha = fVar2 * fVar3; outColor->_blue = fVar6 + fVar1; outColor->_green = fVar7 + fVar5; outColor->_red = fVar8 + fVar4; return; } //@@ 004e47a0 Entity::SplatColor /* ZHL [lua] Lua binding Entity:SplatColor */ ColorMod * __thiscall Entity::SplatColor(Entity *this) { return &this->_splatColor; } //@@ 004e47b0 FUN_004e47b0 bool FUN_004e47b0(void) { int in_ECX; return *(int *)(in_ECX + 0x3d4) != 0; } //@@ 004e47c0 std::vector::clear /* DB: clear(isFree): reset end or deallocate prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall std::vector::clear(void *this,byte isDeallocate) { void *pvVar1; int iVar2; void *ptr; uint size; undefined1 local_10 [12]; if (isDeallocate == 0) { *(undefined4 *)((int)this + 4) = *(undefined4 *)this; } else if (local_10 != this) { pvVar1 = *(void **)this; iVar2 = *(int *)((int)this + 8); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; if (pvVar1 != (void *)0x0) { size = iVar2 - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } } return; } //@@ 004e4830 GridEntity::GetGridIndex /* ZHL [lua] Lua binding GridEntity:GetGridIndex */ int __thiscall GridEntity::GetGridIndex(GridEntity *this) { return this->_gridIndex; } //@@ 004e4840 FUN_004e4840 int FUN_004e4840(void) { int in_ECX; return in_ECX + 0x7300; } //@@ 004e4850 Entity_NPC::EntityRef /* ZHL [lua] Lua binding EntityNPC:EntityRef */ EntityPtr __thiscall Entity_NPC::EntityRef(Entity_NPC *this) { return this->_entityRef; } //@@ 004e4860 Entity_Player::GetMovementDirection /* ZHL [lua] Lua binding EntityPlayer:GetMovementDirection */ int __thiscall Entity_Player::GetMovementDirection(Entity_Player *this) { return this->_moveDirection; } //@@ 004e4870 NpcHelper::candler_is_free_cell /* DB: NpcAI::ENTITY_CANDLER: true when the grid cell at pos (ECX) has collision 0 and is not a grid entity of type 0x17 (teleporter); gates the Attack and the fireplace 33.10 spawn; notes/entities/pass7_i2.md */ uint NpcHelper::candler_is_free_cell(void) { Room *this; void *pvVar1; float *in_ECX; int iVar2; int iVar3; this = g_game->_room; iVar3 = (int)((*in_ECX - 40.0) / 40.0 + 0.5); iVar2 = (int)((in_ECX[1] - 120.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar2 < 0)) || (this->_gridHeight <= iVar2)) { iVar3 = -1; } else { iVar3 = this->_gridWidth * iVar2 + iVar3; } pvVar1 = (void *)Room::GetGridCollision(this,iVar3); if (((((pvVar1 == (void *)0x0) && (iVar3 = (int)((*in_ECX - 40.0) / 40.0 + 0.5), -1 < iVar3)) && ((pvVar1 = (void *)this->_gridWidth, iVar3 < (int)pvVar1 && ((iVar2 = (int)((in_ECX[1] - 120.0) / 40.0 + 0.5), -1 < iVar2 && (iVar2 < this->_gridHeight) ))))) && (pvVar1 = (void *)((int)pvVar1 * iVar2 + iVar3), -1 < (int)pvVar1)) && (((0x1bf < (int)pvVar1 || (pvVar1 = this->_gridEntities[(int)pvVar1], pvVar1 == (void *)0x0)) || (*(int *)((int)pvVar1 + 4) != 0x17)))) { return CONCAT31((int3)((uint)pvVar1 >> 8),1); } return (uint)pvVar1 & 0xffffff00; } //@@ 004e4970 NpcAI::ENTITY_CANDLER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 833 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CANDLER(Entity_NPC *npc) { Vector *position; float *pfVar1; char *pcVar2; byte bVar3; char cVar4; uint uVar5; uint uVar6; Entity *pEVar7; byte *animNameCursor; int iVar8; byte *expectedName; bool bVar9; float fVar10; float fVar11; float fVar12; float signX; float fVar13; float signY; undefined4 local_6c [8]; undefined4 local_4c; undefined4 uStack_48; undefined4 local_44; char fireplaces [4]; void *fireplaceData; Vector local_38; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; qword flags; puStack_20 = fireplaces + 0x3c; local_14 = 0xffffffff; puStack_18 = &LAB_00af3c4d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(fireplaces + 0x30); ExceptionList = &local_1c; local_2c = 1.0; iVar8 = npc->_state; local_24 = uVar5; if (iVar8 != 0) { if (iVar8 != 3) { puStack_20 = fireplaces + 0x3c; if (iVar8 == 8) { npc->_friction = npc->_friction * 0.8; local_2c = 0.0; puStack_20 = fireplaces + 0x3c; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = fireplaces + 0x3c; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { uVar6 = Random(); local_28 = (((float)(uVar6 & 3) + 0.0) * 90.0 + 45.0) * 0.017453292; local_38.y = cos(local_28); local_38.y = local_38.y * 20.0; fVar10 = sin(local_28); npc->_state = 3; (npc->_velocity).x = local_38.y; (npc->_velocity).y = fVar10 * 20.0; cVar4 = NpcHelper::candler_is_free_cell(uVar5); if (cVar4 != '\0') { Entity_NPC::PlaySound(npc,0x1d7,1.0,10,0,1.0); uVar5 = Random(); pEVar7 = Game::Spawn(g_game,0x21,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); fVar10 = (pEVar7->_pos).y; (pEVar7->_targetPosition).x = (pEVar7->_pos).x; (pEVar7->_targetPosition).y = fVar10; if ((npc->_sprite)._scale.x <= 1.0) { pEVar7->_health = pEVar7->_health * 0.666; } } uVar5 = Random(); uVar6 = Random(); npc->_projectileDelay = uVar5 % 0x1e + 0xf + uVar6 % 0x1e; } } } goto LAB_004e4e87; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = fireplaces + 0x3c, (npc->_sprite)._animState._isPlaying == 0)) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = s_Idle; do { bVar3 = *animNameCursor; bVar9 = bVar3 < *expectedName; if (bVar3 != *expectedName) { LAB_004e4bb0: uVar6 = -(uint)bVar9 | 1; goto LAB_004e4bb5; } if (bVar3 == 0) break; bVar3 = animNameCursor[1]; bVar9 = bVar3 < expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004e4bb0; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar6 = 0; LAB_004e4bb5: if ((uVar6 == 0) && ((puStack_20 = fireplaces + 0x3c, animData[0x34] == 0 || (puStack_20 = fireplaces + 0x3c, (npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004e4bec; } puStack_20 = fireplaces + 0x3c; bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004e4bec: iVar8 = npc->_projectileDelay; if (0 < iVar8) { iVar8 = iVar8 + -1; npc->_projectileDelay = iVar8; } if (((iVar8 != 0) || ((npc->_flags & 0x1000a00) != 0)) || (cVar4 = NpcHelper::candler_is_free_cell(uVar5), cVar4 == '\0')) goto LAB_004e4e87; Entity_NPC::QueryNPCsType(fireplaces,0x21,10); local_14 = 0; if ((int)local_38.y < ((*(int *)((int)g_game->_room + 0x10) + -2) * (*(int *)((int)g_game->_room + 0xc) + -2)) / 5 ) { fVar10 = 0.0; if (local_38.y != 0.0) { fVar13 = 1e+10; do { iVar8 = *(int *)((int)fireplaceData + (int)fVar10 * 4); fVar10 = (float)((int)fVar10 + 1); fVar12 = (npc->_pos).y - *(float *)(iVar8 + 0x340); fVar11 = (npc->_pos).x - *(float *)(iVar8 + 0x33c); fVar11 = fVar12 * fVar12 + fVar11 * fVar11; if (fVar13 <= fVar11) { fVar11 = fVar13; } fVar13 = fVar11; } while ((uint)fVar10 < (uint)local_38.y); if (fVar11 <= 400.0) goto LAB_004e4d09; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 8; } LAB_004e4d09: local_14 = 0xffffffff; if (fireplaces[0] == '\0') { local_14 = 1; tracked_alloc(1,fireplaceData,0); local_14 = 0xffffffff; } goto LAB_004e4e87; } npc->_state = 3; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004e4d9e: bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); pcVar2 = puStack_20; if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pcVar2 = puStack_20; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = s_Idle; do { bVar3 = *animNameCursor; bVar9 = bVar3 < *expectedName; if (bVar3 != *expectedName) { LAB_004e4d80: uVar5 = -(uint)bVar9 | 1; goto LAB_004e4d85; } if (bVar3 == 0) break; bVar3 = animNameCursor[1]; bVar9 = bVar3 < expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_004e4d80; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar5 = 0; LAB_004e4d85: if ((uVar5 != 0) || ((pcVar2 = fireplaces + 0x3c, animData[0x34] != 0 && (pcVar2 = fireplaces + 0x3c, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004e4d9e; } puStack_20 = pcVar2; uVar5 = Random(); uVar6 = Random(); npc->_projectileDelay = uVar6 % 0x1e + 0xf + uVar5 % 0x1e; uVar5 = Random(); local_38.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38.y = local_38.y + local_38.y; local_28 = cos(local_38.y); fVar10 = sin(local_38.y); (npc->_velocity).x = local_28; (npc->_velocity).y = fVar10; local_4c = 0x3f4ccccd; uStack_48 = 0x3f4ccccd; local_44 = 0x3f4ccccd; if (&npc->_splatColor != (ColorMod *)local_6c) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.8; (npc->_splatColor)._offset[1] = 0.8; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.3; (npc->_splatColor)._offset[2] = 0.8; } LAB_004e4e87: position = &npc->_pos; Room::GetClampedPositionImpl(g_game->_room,&local_38,position,0.0,0.0,0.0,0.0); position->x = local_38.x; (npc->_pos).y = local_38.y; flags = npc->_flags; if (((flags & 0x200) == 0) || ((flags & 0x100) != 0)) { pfVar1 = &(npc->_velocity).y; signX = (float)&DAT_bf800000; if (0.1 < *pfVar1 || *pfVar1 == 0.1) { signY = 1.0; } else { signY = (float)&DAT_bf800000; } fVar10 = (npc->_velocity).x; if (0.0 <= fVar10) { signX = 1.0; } fVar13 = npc->_friction * 0.8; npc->_friction = fVar13; if (fVar13 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).y = (fVar11 * signY * local_2c) / fVar13 + (npc->_velocity).y; (npc->_velocity).x = (fVar11 * signX * local_2c) / fVar13 + fVar10; } if ((flags & 0x1000800) != 0) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_28 = (npc->_pos).y - (pEVar7->_pos).y; local_2c = position->x - (pEVar7->_pos).x; fVar13 = sqrtf(local_28 * local_28 + local_2c * local_2c); fVar10 = (180.0 - fVar13) * 0.02; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } if ((0.0 < fVar10) && (fVar11 = npc->_friction, fVar11 != 0.0)) { if (0.0 < fVar13) { local_28 = local_28 * (1.0 / fVar13); local_2c = local_2c * (1.0 / fVar13); } fVar13 = npc->_speedMultiplier; (npc->_velocity).x = (local_2c * fVar10 * fVar13) / fVar11 + (npc->_velocity).x; (npc->_velocity).y = (local_28 * fVar10 * fVar13) / fVar11 + (npc->_velocity).y; } } } else { npc->_friction = npc->_friction * 0.8; PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } ExceptionList = local_1c; return; } //@@ 004e50d0 NpcHelper::whipper_is_target /* DB: NpcAI::ENTITY_WHIPPER 004e5170 attack query filter (ECX npc, EDX entity): not itself; bombs (type 4) and players (1) when the npc lacks flags 0x20000100, a list of familiar variants (3.62/67/201/228/238/206/237/211); charmed/friendly: Entity::IsVulnerableEnemy; notes/entities/pass7_i1.md */ uint NpcHelper::whipper_is_target(void) { byte bVar1; uint uVar2; undefined3 extraout_var; Entity *in_ECX; Entity *in_EDX; bool bVar3; uVar2 = (uint)in_ECX->_flags & 0x20000100; bVar3 = uVar2 == 0; if (in_EDX != in_ECX) { uVar2 = in_EDX->_type; if (uVar2 == 4) { if (bVar3) goto LAB_004e5106; } else if (bVar3) { if ((uVar2 == 1) || ((uVar2 == 3 && (((((uVar2 = in_EDX->_variant, uVar2 == 0x3e || (uVar2 == 0x43)) || (uVar2 == 0xc9)) || ((uVar2 == 0xe4 || (uVar2 == 0xee)))) || ((uVar2 == 0xce || ((uVar2 == 0xed || (uVar2 == 0xd3)))))))))) goto LAB_004e5106; goto LAB_004e514f; } bVar1 = Entity::IsVulnerableEnemy(in_EDX,(Entity *)0x0); uVar2 = CONCAT31(extraout_var,bVar1); if (bVar1 != 0) { LAB_004e5106: return CONCAT31((int3)(uVar2 >> 8),1); } } LAB_004e514f: return uVar2 & 0xffffff00; } //@@ 004e5170 NpcAI::ENTITY_WHIPPER /* NPC AI for entity type 834 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WHIPPER(Entity_NPC *npc) { code *pcVar1; undefined1 *puVar2; byte bVar3; char isTarget; uint uVar4; int moveDir; byte *pbVar5; char *animName; undefined4 uVar6; Entity *pEVar7; Vector *pVVar8; void *debugShape; int iVar9; Room *hitListCursor; EntityRef *damageSourceRef; float *extraout_EDX; void **ppvVar10; uint uVar11; ANM2 *sprite; bool bVar12; float fVar13; float fVar14; float fVar15; EntityRef local_e8; EntityRef local_c0; Vector hitbox [4]; float local_78; float local_74; EntityList_EL nearbyEntities; Entity_NPC *self; undefined1 local_5c [12]; Vector *local_50; Vector local_4c; Room *local_44; Vector local_40; Vector *local_38; Vector *local_34; Entity *local_30; char local_29; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_5c + 0x58; local_14 = 0xffffffff; puStack_18 = &LAB_00af3c95; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_5c + 0x4c); ExceptionList = &local_1c; fVar14 = npc->_friction * 0.8; local_44 = g_game->_room; iVar9 = npc->_state; npc->_friction = fVar14; self = npc; if (iVar9 != 0) { if (iVar9 != 4) { puStack_20 = local_5c + 0x58; if (iVar9 != 8) goto LAB_004e5dd8; if (npc->_variant == 0) { fVar15 = 0.9; } else { fVar15 = 0.6; } npc->_friction = fVar15 * fVar14; puStack_20 = local_5c + 0x58; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_004e526e: npc->_state = 4; } else { puStack_20 = local_5c + 0x58; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x1ee,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_004e526e; } npc->_stateFrame = npc->_stateFrame + 1; goto LAB_004e5dd8; } fVar14 = (npc->_velocity).x; pVVar8 = &npc->_velocity; fVar15 = (npc->_velocity).y; local_38 = (Vector *)ABS(fVar14); iVar9 = npc->_i1; if ((float)local_38 <= ABS(fVar15)) { moveDir = (uint)(0.0 <= fVar15) * 2 + 1; } else { moveDir = 2; if (fVar14 < 0.0) { moveDir = 0; } } npc->_i1 = moveDir; if (iVar9 != moveDir) { npc->_projectileDelay = 10; } fVar15 = *(float *)((int)npc->_config + 0x44); if (fVar15 < npc->_mass) { npc->_mass = fVar15; } local_28 = 0.1; if ((npc->_isChampion != 0) && (npc->_championSpeed <= 1.0 && npc->_championSpeed != 1.0)) { local_28 = 0.05; } local_34 = pVVar8; if ((npc->_variant == 2) && (((npc->_targetPosition).x != g_vectorZero.x || ((npc->_targetPosition).y != g_vectorZero.y)) )) { pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { pbVar5 = &s_empty; } else if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } local_38 = (Vector *)strncmp_exref; puStack_20 = local_5c + 0x58; iVar9 = strncmp((char *)pbVar5,"WalkAttack",10); fVar14 = (npc->_velocity).y; if (ABS(fVar14) < ABS(pVVar8->x)) { animName = "WalkAttackHori"; bVar12 = pVVar8->x < 0.0; } else { animName = "WalkAttackUp"; if (0.0 <= fVar14) { animName = "WalkAttackDown"; } bVar12 = false; } (npc->_sprite)._flipX = bVar12; if (iVar9 == 0) { ANM2::SetAnimation(&npc->_sprite,(byte *)animName,0); } else { ANM2::Play(&npc->_sprite,(byte *)animName,0); } if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { local_30 = (Entity *)CONCAT31(local_30._1_3_,1); LAB_004e5449: local_29 = '\0'; } else { if ((npc->_sprite)._overlayAnimState._isPlaying == 0) { local_30 = (Entity *)CONCAT31(local_30._1_3_,1); goto LAB_004e5449; } local_30 = (Entity *)((uint)local_30._1_3_ << 8); uVar6 = _string_holder_c_str("HeadLaugh",9,uVar4); iVar9 = (*(code *)local_38)(uVar6); local_29 = '\x01'; if (iVar9 != 0) goto LAB_004e5449; } fVar14 = (npc->_velocity).y; fVar15 = (npc->_velocity).x; fVar14 = sqrtf(fVar15 * fVar15 + fVar14 * fVar14); if (fVar14 < local_28) { animName = "HeadLaughDown"; } else { fVar14 = (npc->_velocity).y; if (ABS(fVar14) < ABS(pVVar8->x)) { animName = "HeadLaughRight"; } else { animName = "HeadLaughUp"; if (0.0 <= fVar14) { animName = "HeadLaughDown"; } } } if (local_29 == '\0') { ANM2::PlayOverlay(&npc->_sprite,(byte *)animName,(byte)local_30); npc->_mass = 100.0; } else { ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)animName,0); npc->_mass = 100.0; } } else { fVar15 = (npc->_velocity).y; puStack_20 = local_5c + 0x58; fVar14 = sqrtf(fVar15 * fVar15 + fVar14 * fVar14); if (fVar14 < local_28) { bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkDown",1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } LAB_004e559a: bVar12 = false; } else { fVar14 = (npc->_velocity).y; if ((float)local_38 <= ABS(fVar14)) { animName = (char *)&DAT_00b1e020; if (0.0 <= fVar14) { animName = "WalkDown"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); goto LAB_004e559a; } ANM2::Play(&npc->_sprite,(byte *)"WalkHori",0); bVar12 = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } (npc->_sprite)._flipX = bVar12; if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { if (npc->_i1 == 1) { pbVar5 = (npc->_sprite)._overlayAnimState._animData; if (pbVar5 != (byte *)0x0) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } animName = "HeadUp"; do { bVar3 = *pbVar5; bVar12 = bVar3 < (byte)*animName; if (bVar3 != *animName) { LAB_004e5600: uVar4 = -(uint)bVar12 | 1; goto LAB_004e5605; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar12 = bVar3 < (byte)animName[1]; if (bVar3 != animName[1]) goto LAB_004e5600; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004e5605: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._overlayAnimState._animData + 0x34) == '\0' || ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) goto LAB_004e5660; } bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadUp",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { if (npc->_i1 == 3) { animName = "HeadDown"; } else { animName = "HeadRight"; } ANM2::PlayOverlay(&npc->_sprite,(byte *)animName,0); } } } LAB_004e5660: local_38 = (Vector *)(npc->_targetPosition).x; if (((float)local_38 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.25,0); pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_4c.x = (pEVar7->_pos).x; local_4c.y = (pEVar7->_pos).y; local_28 = local_4c.x; local_24 = local_4c.y; Isaac::GetAxisAlignedUnitVectorFromDir(&local_40,npc->_i1); local_24 = local_24 - (npc->_pos).y; local_28 = local_28 - (npc->_pos).x; fVar13 = sqrtf(local_24 * local_24 + local_28 * local_28); fVar14 = local_28; fVar15 = local_24; if (0.0 < fVar13) { fVar15 = local_24 * (1.0 / fVar13); fVar14 = local_28 * (1.0 / fVar13); } if ((0.9 < local_40.x * fVar14 + local_40.y * fVar15) && (bVar3 = Room::CheckLine(local_44,&npc->_pos,&local_4c,0,0,0,0,(Vector *)0x0), bVar3 != 0)) { (npc->_targetPosition).x = local_40.x; (npc->_targetPosition).y = local_40.y; npc->_projectileCooldown = 0; if (npc->_i1 == 1) { animName = "HeadLaughUp"; } else if (npc->_i1 == 3) { animName = "HeadLaughDown"; } else { animName = "HeadLaughRight"; } bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)animName,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } } else { local_30 = (Entity *)(npc->_velocity).x; fVar14 = (npc->_velocity).y; fVar14 = sqrtf((float)local_30 * (float)local_30 + fVar14 * fVar14); if (0.5 <= fVar14) { npc->_projectileCooldown = 0; } else { npc->_projectileCooldown = npc->_projectileCooldown + 1; } if (npc->_variant == 2) { Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_5c + 8),0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,(Vector *)(local_5c + 8),1.9,0,1); pVVar8 = Vector::ToCardinal(&local_4c,&npc->_velocity); fVar14 = sqrtf(*extraout_EDX * *extraout_EDX + extraout_EDX[1] * extraout_EDX[1]); fVar15 = fVar14 * pVVar8->y; fVar14 = pVVar8->x * fVar14; } else { fVar14 = ((float)local_38 * 1.75) / npc->_friction + (float)local_30; fVar15 = ((npc->_targetPosition).y * 1.75) / npc->_friction + (npc->_velocity).y; } (npc->_velocity).y = fVar15; iVar9 = 0x14; (npc->_velocity).x = fVar14; if (npc->_variant == 2) { iVar9 = 0x3c; } if (((iVar9 < npc->_projectileCooldown) || (npc->_collidesWithGrid != 0)) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 != 0)) { (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } npc->_mass = 80.0; } sprite = &npc->_sprite; if (npc->_variant == 2) { if ((((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) && (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"), bVar3 != 0)))) { Entity_NPC::PlaySound(npc,0x1ee,1.0,2,0,1.0); } } else if (npc->_projectileDelay < 1) { Isaac::GetAxisAlignedUnitVectorFromDir(&local_40,npc->_i1); fVar14 = 90.0; local_24 = 0.6; if (npc->_variant == 1) { fVar14 = 180.0; local_24 = 0.92; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_5c,&npc->_pos, fVar14,0xffffffff); local_14 = 0; local_38 = (Vector *)0x0; if (local_50 != (Vector *)0x0) { do { local_30 = *(Entity **)(local_5c._4_4_ + (int)local_38 * 4); isTarget = NpcHelper::whipper_is_target(); if (isTarget != '\0') { pEVar7 = (Entity *)((local_30->_pos).x - (npc->_pos).x); local_28 = (local_30->_pos).y - (npc->_pos).y; local_30 = pEVar7; fVar14 = sqrtf((float)pEVar7 * (float)pEVar7 + local_28 * local_28); if (fVar14 <= 0.0) { pEVar7 = local_30; fVar14 = local_28; } else { pEVar7 = (Entity *)((float)local_30 * (1.0 / fVar14)); fVar14 = local_28 * (1.0 / fVar14); } if (local_24 < local_40.y * fVar14 + local_40.x * (float)pEVar7) { (npc->_secondaryHitList)._end = (npc->_secondaryHitList)._begin; npc->_state = 8; (npc->_sprite)._flipX = 0; if (npc->_i1 == 1) { ANM2::Play(sprite,(byte *)"AttackUp",0); } else if (npc->_i1 == 3) { ANM2::Play(sprite,(byte *)"AttackDown",0); } else { ANM2::Play(sprite,(byte *)"AttackHori",0); (npc->_sprite)._flipX = npc->_i1 == 0; } if (npc->_i1 == 1) { animName = "HeadLaughUp"; } else if (npc->_i1 == 3) { animName = "HeadLaughDown"; } else { animName = "HeadLaughRight"; } bVar3 = ANM2::SetOverlayAnimation(sprite,(byte *)animName,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } npc->_stateFrame = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_projectileDelay = 10; fVar14 = npc->_friction; if (fVar14 != 0.0) { local_34->x = (local_40.x * 5.0) / fVar14 + local_34->x; local_34->y = (local_40.y * 5.0) / fVar14 + local_34->y; } break; } } local_38 = (Vector *)((int)&local_38->x + 1); } while (local_38 < local_50); } local_14 = 0xffffffff; if (local_5c[0] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_5c._4_4_,0); local_14 = 0xffffffff; } } else { npc->_projectileDelay = npc->_projectileDelay + -1; } goto LAB_004e5dd8; } npc->_state = 4; npc->_stateFrame = 0; npc->_i1 = 0; npc->_projectileCooldown = 0; npc->_projectileDelay = 0; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; pbVar5 = (npc->_sprite)._overlayAnimState._animData; if (pbVar5 == (byte *)0x0) { LAB_004e5d88: bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadDown",1); puVar2 = puStack_20; if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; puVar2 = puStack_20; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } animName = "HeadDown"; do { bVar3 = *pbVar5; bVar12 = bVar3 < (byte)*animName; if (bVar3 != *animName) { LAB_004e5d70: uVar4 = -(uint)bVar12 | 1; goto LAB_004e5d75; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar12 = bVar3 < (byte)animName[1]; if (bVar3 != animName[1]) goto LAB_004e5d70; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004e5d75: if ((uVar4 != 0) || ((puVar2 = local_5c + 0x58, *(char *)((int)(npc->_sprite)._overlayAnimState._animData + 0x34) != '\0' && (puVar2 = local_5c + 0x58, (npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_004e5d88; } puStack_20 = puVar2; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkDown",1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } LAB_004e5dd8: if ((npc->_variant == 2) && (uVar4 = Random(), (uVar4 & 7) == 0)) { uVar4 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.3); } Entity::GetNullCapsule((Entity *)npc,(Capsule *)hitbox,(byte *)"Hitbox"); if (local_78 <= 0.0) { if (npc->_variant == 2) { (npc->_secondaryHitList)._end = (npc->_secondaryHitList)._begin; } } else { if (((uint)g_game->_debugFlags >> 5 & 1) != 0) { debugShape = DebugRenderer::Get(&g_game->_debugRenderer,npc->_index,1); *(undefined4 *)((int)debugShape + 4) = 1; push_shape_points(debugShape,(Capsule *)hitbox); } local_4c.y = 0.0; local_4c.x = 0.0; iVar9 = (int)((hitbox[0].x - 40.0) / 40.0 + 0.5); ppvVar10 = (void **)(iVar9 + 2); local_28 = (float)(iVar9 + -2); iVar9 = (int)((hitbox[0].y - 120.0) / 40.0 + 0.5); local_40.y = (float)ppvVar10; if ((int)local_28 <= (int)ppvVar10) { local_38 = (Vector *)(iVar9 + -2); fVar14 = (float)(iVar9 + 2); local_24 = fVar14; do { local_34 = local_38; fVar15 = local_28; pVVar8 = local_38; if ((int)local_38 <= (int)fVar14) { do { if (-1 < (int)fVar15) { if ((((int)fVar15 < local_44->_gridWidth) && (-1 < (int)pVVar8)) && ((int)pVVar8 < local_44->_gridHeight)) { iVar9 = local_44->_gridWidth * (int)pVVar8 + (int)fVar15; if (-1 < iVar9) { if (iVar9 < 0x1c0) { local_30 = local_44->_gridEntities[iVar9]; } else { local_30 = (Entity *)0x0; } if (local_30 != (Entity *)0x0) { iVar9 = *(int *)((int)g_game->_room + 0xc); local_5c._8_4_ = (float)(local_30->_collisionIndex % iVar9) * 40.0 + 40.0; local_50 = (Vector *)((float)(local_30->_collisionIndex / iVar9) * 40.0 + 120.0) ; local_34 = pVVar8; Capsule::constructor ((Capsule *)&local_e8,(Vector *)(local_5c + 8),&g_vectorOne,0.0,20.0); bVar3 = Capsule::Collide((Capsule *)hitbox,(Capsule *)&local_e8,&local_4c); if (bVar3 != 0) { pcVar1 = *(code **)(*(int *)local_30 + 0x10); EntityRef::constructor(&local_c0,(Entity *)npc); (*pcVar1)(1,&local_c0); pVVar8 = local_34; } fVar15 = local_28; } } } fVar14 = local_24; } pVVar8 = (Vector *)((int)&pVVar8->x + 1); } while ((int)pVVar8 <= (int)fVar14); ppvVar10 = (void **)local_40.y; local_34 = pVVar8; } local_28 = (float)((int)fVar15 + 1); } while ((int)local_28 <= (int)ppvVar10); } EntityList::QueryRadius (&local_44->_entityList,&nearbyEntities,hitbox,local_78 + local_74,0xffffffff); local_14 = 2; local_38 = (Vector *)0x0; if (nearbyEntities._size != 0) { do { pEVar7 = *(Entity **)((int)nearbyEntities._data + (int)local_38 * 4); local_30 = pEVar7; if ((pEVar7->_size != 0.0) && (pEVar7->_entityCollisionClass != 0)) { Entity::GetCollisionCapsule(pEVar7,&local_c0,&g_vectorZero); bVar3 = Capsule::Collide((Capsule *)hitbox,(Capsule *)&local_c0,&local_4c); if (bVar3 != 0) { local_34 = (Vector *)Entity::GetHitListIndex(pEVar7); local_44 = (npc->_secondaryHitList)._end; hitListCursor = (npc->_secondaryHitList)._begin; uVar4 = (int)local_44 - (int)hitListCursor >> 2; if (0 < (int)uVar4) { do { uVar11 = uVar4 >> 1; local_40.y = (float)(hitListCursor->_gridEntities + (uVar11 - 9)); if (*(Vector **)local_40.y < local_34) { hitListCursor = (Room *)((int)local_40.y + 4); uVar11 = uVar4 + (-1 - uVar11); local_40.y = (float)hitListCursor; } uVar4 = uVar11; } while (0 < (int)uVar11); pEVar7 = local_30; npc = self; } if ((hitListCursor == local_44) || (*(Vector **)hitListCursor != local_34)) { local_24 = (pEVar7->_pos).x - (npc->_pos).x; local_28 = (pEVar7->_pos).y - (npc->_pos).y; fVar14 = sqrtf(local_24 * local_24 + local_28 * local_28); if (0.0 < fVar14) { local_28 = local_28 * (1.0 / fVar14); local_24 = local_24 * (1.0 / fVar14); } iVar9 = pEVar7->_type; if ((iVar9 == 0xf5) || (iVar9 == 0x124)) { local_29 = '\x01'; } else { local_29 = '\0'; } if (iVar9 == 4) { if ((npc->_flags & 0x100) != 0) goto LAB_004e62d4; fVar14 = pEVar7->_friction; if (fVar14 != 0.0) { (pEVar7->_velocity).x = (local_24 * 15.0) / fVar14 + (pEVar7->_velocity).x; (pEVar7->_velocity).y = (local_28 * 15.0) / fVar14 + (pEVar7->_velocity).y; } } else { if ((iVar9 != 2) || ((npc->_flags & 0x100) != 0)) { LAB_004e62d4: if ((local_29 == '\0') && (isTarget = NpcHelper::whipper_is_target(), isTarget == '\0')) { if ((*(int *)&g_game->_deathmatchManager < 2) || (pEVar7->_type != 1)) { if (0x3dd < pEVar7->_type - 10U) goto LAB_004e64fa; if ((pEVar7->_type == 0x21) && (pEVar7->_variant != 0xb)) { pcVar1 = *(code **)(*(int *)pEVar7 + 0x20); EntityRef::constructor(&local_c0,(Entity *)npc); (*pcVar1)(0x447a0000,0,0,&local_c0,0x1e); pEVar7 = local_30; } } if (npc->_variant == 2) { fVar14 = pEVar7->_friction; if (fVar14 != 0.0) { (pEVar7->_velocity).x = (local_24 * 15.0) / fVar14 + (pEVar7->_velocity).x; (pEVar7->_velocity).y = (local_28 * 15.0) / fVar14 + (pEVar7->_velocity).y; } } } else { fVar15 = 15.0; fVar14 = npc->_collisionDamage; if (npc->_variant == 1) { fVar15 = -15.0; } fVar13 = pEVar7->_friction; if (fVar13 != 0.0) { (pEVar7->_velocity).x = (local_24 * fVar15) / fVar13 + (pEVar7->_velocity).x; (pEVar7->_velocity).y = (local_28 * fVar15) / fVar13 + (pEVar7->_velocity).y; } if ((*(int *)&g_game->_deathmatchManager < 2) || (pEVar7->_type != 1)) { bVar12 = pEVar7->_type - 10U < 0x3de; } else { bVar12 = true; } local_34 = *(Vector **)(*(int *)pEVar7 + 0x20); if (bVar12) { EntityRef::constructor(&local_c0,(Entity *)npc); fVar14 = fVar14 * 10.0; damageSourceRef = &local_c0; } else { EntityRef::constructor(&local_e8,(Entity *)npc); damageSourceRef = &local_e8; } (*(code *)local_34)(fVar14,0,0,damageSourceRef,0x1e); manager = g_manager; local_34 = (Vector *)0x1ef; seed_fart_sound_override((int *)&local_34); SoundEffects::Play(&manager->_sfxManager,(int)local_34,1.0,2,0,1.0,0.0); npc->_projectileDelay = 0; if (local_29 == '\0') { pEVar7 = local_30; goto LAB_004e64e6; } } goto LAB_004e64fa; } fVar14 = sqrtf(local_24 * local_24 + local_28 * local_28); if (0.0 < fVar14) { local_24 = local_24 * (1.0 / fVar14); local_28 = local_28 * (1.0 / fVar14); } fVar14 = (pEVar7->_velocity).y; fVar15 = (pEVar7->_velocity).x; fVar14 = sqrtf(fVar15 * fVar15 + fVar14 * fVar14); (pEVar7->_velocity).x = local_24 * fVar14; (pEVar7->_velocity).y = local_28 * fVar14; } LAB_004e64e6: uVar4 = Entity::GetHitListIndex(pEVar7); sorted_vector_insert_unique(&npc->_secondaryHitList,uVar4); } } } LAB_004e64fa: local_38 = (Vector *)((int)local_38 + 1); } while (local_38 < (uint)nearbyEntities._size); } if (nearbyEntities._0_1_ == '\0') { local_14 = 3; tracked_alloc(1,nearbyEntities._data,0); ExceptionList = local_1c; return; } } ExceptionList = local_1c; return; } //@@ 004e6570 NpcAI::ENTITY_GRUDGE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 877 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GRUDGE(Entity_NPC *npc) { float fVar1; undefined4 uVar2; Vector pos; qword qVar3; byte bVar4; RoomDescriptor *roomDesc; ColorMod *other; Entity_Effect *splat; Entity_NPC **ppEVar5; Vector *randomVec; LayerState *layer; ColorMod *extraout_EAX; EntityRef *entityRef; ColorMod *color; Entity *tmpEntity; Entity_Player *player; byte extraout_CL; byte extraout_CL_00; Entity_NPC **ppEVar6; int *otherGrudgesEnd; int iVar7; byte *pbVar8; void *pvVar9; uint otherGrudgeCount; uint *puVar10; code *extraout_EDX; char *pcVar11; uint uVar12; int iVar13; Entity_NPC *entityRef; bool bVar15; float dirX; float fVar16; float dirY; float fVar17; float pushVelX; undefined8 uVar18; Color local_160; EntityRef damageSource; undefined1 local_10c [8]; float local_104; undefined1 local_e0 [8]; void *local_d8; Vector local_d4; Vector local_cc; Entity_NPC *local_c4; Entity_NPC *local_c0; Entity_NPC *local_bc; Entity_NPC *local_b8; Entity_NPC *local_b4; Entity_NPC *local_b0; Vector local_ac; Room *room; Entity_NPC *local_a0; Entity_NPC *local_9c; Entity_NPC *local_98; undefined1 local_94 [12]; float local_88; ColorMod local_68; undefined1 local_3c [16]; uint local_2c; undefined1 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Room *currentRoom; Game *game; int gridWidth; Manager *manager; code *takeDamageFn; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af3cd5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; room = g_game->_room; iVar13 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_bc = npc; Entity_NPC::GetPlayerTarget(npc); roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); local_b8 = (Entity_NPC *)((uint)roomDesc->Flags >> 1 & 0xffffff01); switch(npc->_state) { case 0: ANM2::Play(&npc->_sprite,(byte *)"No-Spikes",0); npc->_stateFrame = 5; npc->_state = 3; PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); iVar13 = (npc->_pathfinder)._gridIndex; iVar7 = room->_gridWidth; (npc->_targetPosition).x = (float)(iVar13 % iVar7) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar13 / iVar7) * 40.0 + 120.0; Room::SetGridPath(room,(npc->_pathfinder)._gridIndex,900); qVar3 = npc->_flags; puVar10 = (uint *)((int)&npc->_flags + 4); *puVar10 = *puVar10 | 8; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)qVar3 & 0xfffffffb | 0x40010001; Color::Color((Color *)local_10c); Color::operator_assign((Color *)&npc->_splatColor,other); game = g_game; (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; pcVar11 = game->_room; if (((*pcVar11 != '\0') && (game->_frameCount == *(int *)(pcVar11 + 0x11f0))) && ((char)local_b8 != '\0')) { (**(code **)(*(int *)npc + 0x28))(); } npc->_collisionDamage = 0.0; npc->_i1 = 0; npc->_i2 = 0; break; case 3: if (npc->_stateFrame < 1) { ANM2::Play(&npc->_sprite,&DAT_00b607ac,0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0xcd,1.0,2,0,1.0); if (npc->_i2 == 0) { fVar16 = 1.0; } else { fVar16 = 0.0; } npc->_collisionDamage = fVar16; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 4; } } else { npc->_stateFrame = npc->_stateFrame - iVar13; } break; case 4: if (((*(char *)((int)g_game->_room + 0x7229) != '\0') && ((char)local_b8 != '\0')) && (iVar7 = Entity_NPC::GetAliveEnemyCount(npc), iVar7 < 1)) { ANM2::Play(&npc->_sprite,&DAT_00b607b4,0); uVar2 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xbfffffff; npc->_state = 0x10; npc->_collisionDamage = 0.0; npc->_friction = npc->_friction * 0.8; *(undefined4 *)((int)&npc->_flags + 4) = uVar2; ExceptionList = local_1c; return; } iVar13 = npc->_stateFrame - iVar13; iVar7 = 0; if (0 < iVar13) { iVar7 = iVar13; } npc->_stateFrame = iVar7; if ((iVar7 < 1) && (uVar12 = 0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,uVar12); entityRef = local_bc; if ((player->_dead == 0) && (player->_entityCollisionClass != 0)) { local_a0 = (Entity_NPC *)((player->_pos).x - (npc->_pos).x); local_9c = (Entity_NPC *)((player->_pos).y - (npc->_pos).y); local_c0 = (Entity_NPC *)ABS((float)local_a0); local_c4 = (Entity_NPC *)ABS((float)local_9c); local_b4 = local_c0; local_98 = local_c0; ppEVar5 = &local_b8; if ((float)local_c0 <= (float)local_c4) { ppEVar5 = &local_b4; } local_b8 = local_c4; ppEVar6 = &local_b0; if ((float)local_c4 <= (float)local_c0) { ppEVar6 = &local_98; } local_b0 = local_c4; npc = entityRef; if (((float)*ppEVar5 <= 24.0) && (24.0 < (float)*ppEVar6)) { local_ac.x = (player->_pos).x; local_ac.y = (player->_pos).y; bVar4 = Room::CheckLine(room,&local_bc->_pos,&local_ac,1,999,0,0,(Vector *)0x0); if (bVar4 != 0) { if ((float)local_c0 <= (float)local_c4) { dirX = 0.0; if (0.0 <= (float)local_9c) { dirY = 1.0; } else { dirY = (float)&DAT_bf800000; } } else { dirY = 0.0; if (0.0 <= (float)local_a0) { dirX = 1.0; } else { dirX = (float)&DAT_bf800000; } } (entityRef->_v1).x = dirX; (entityRef->_v1).y = dirY; entityRef->_state = 8; (entityRef->_v2).x = 0.0; } } } uVar12 = uVar12 + 1; } while (uVar12 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } break; case 8: fVar16 = npc->_speedMultiplier; local_9c = (Entity_NPC *)(fVar16 + (npc->_v2).x); fVar17 = npc->_friction * 0.8; local_a0 = (Entity_NPC *)0x40800000; npc->_friction = fVar17; ppEVar5 = &local_9c; if (4.0 <= (float)local_9c) { ppEVar5 = &local_a0; } entityRef = *ppEVar5; (npc->_v2).x = (float)entityRef; fVar1 = (npc->_v1).x; if (fVar17 != 0.0) { (npc->_velocity).y = (fVar16 * (float)entityRef * (npc->_v1).y) / fVar17 + (npc->_velocity).y; (npc->_velocity).x = (fVar16 * fVar1 * (float)entityRef) / fVar17 + (npc->_velocity).x; fVar1 = (npc->_v1).x; } if (ABS(fVar1) <= ABS((npc->_v1).y)) { (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; } else { (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; } if (4.0 <= (npc->_v2).x) { if (npc->_i2 == 0) { fVar16 = 2.0; } else { fVar16 = 0.0; } npc->_collisionDamage = fVar16; } local_98 = (Entity_NPC *)(npc->_v2).y; if (0.0 < (float)local_98) { iVar13 = Entity::GetIntervalTicks((Entity *)npc,1.0,0.0); entityRef = local_98; if (iVar13 != 0) { local_98 = (Entity_NPC *)((float)local_98 / 30.0); if ((float)local_98 <= 0.0) { local_98 = (Entity_NPC *)0x0; } if (1.0 <= (float)local_98) { local_98 = (Entity_NPC *)0x3f800000; } uVar12 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.2 + (float)local_98 * 0.2); Color::operator_assign((Color *)local_94,&npc->_splatColor); local_88 = local_88 * (float)local_98; (**(code **)(*(int *)splat + 0x3c))(local_94,0xffffffff,0xff,0,1); entityRef = (Entity_NPC *)(npc->_v2).y; } local_9c = (Entity_NPC *)((float)entityRef - npc->_speedMultiplier); local_a0 = (Entity_NPC *)0x0; ppEVar5 = &local_9c; if ((float)local_9c <= 0.0) { ppEVar5 = &local_a0; } (npc->_v2).y = (float)*ppEVar5; } iVar13 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar13 != 0) { uVar12 = Random(); local_9c = (Entity_NPC *)((npc->_velocity).x * 0.2); local_a0 = (Entity_NPC *)((npc->_velocity).y * 0.2); randomVec = MusicManager::RandomVector(&local_cc); local_ac.x = randomVec->x + (float)local_9c; local_ac.y = randomVec->y + (float)local_a0; tmpEntity = Game::Spawn(g_game,1000,0x3b,&npc->_pos,&local_ac,(Entity *)npc,0,uVar12); uVar12 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar12 = Random(); iVar13 = uVar12 % 0xf + 0xf; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar13; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar13; uVar18 = Color::Color(0x3f000000); (*(code *)((ulonglong)uVar18 >> 0x20))((int)uVar18,0xffffffff,0xff,0,1); uVar12 = Random(); fVar17 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; fVar16 = fVar17 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar17 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar16; } currentRoom = room; if (npc->_collidesWithGrid != 0) { fVar16 = npc->_size + 2.0; local_ac.y = fVar16 * (npc->_v1).y + (npc->_pos).y; local_ac.x = fVar16 * (npc->_v1).x + (npc->_pos).x; pos.y = local_ac.y; pos.x = local_ac.x; iVar13 = Room::GetGridCollisionAtPos(room,pos); if (iVar13 != 0) { Game::ShakeScreen(g_game,6); Entity_NPC::PlaySound(npc,0x1e7,1.0,2,0,1.0); npc->_state = 4; if (npc->_i2 == 0) { fVar16 = 1.0; } else { fVar16 = 0.0; } npc->_collisionDamage = fVar16; PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); iVar13 = (npc->_pathfinder)._gridIndex; iVar7 = currentRoom->_gridWidth; (npc->_targetPosition).x = (float)(iVar13 % iVar7) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar13 / iVar7) * 40.0 + 120.0; Room::SetGridPath(currentRoom,(npc->_pathfinder)._gridIndex,900); npc->_stateFrame = 0xf; } } local_ac.x = npc->_speedMultiplier * (npc->_velocity).x + (npc->_pos).x; local_ac.y = npc->_speedMultiplier * (npc->_velocity).y + (npc->_pos).y; Capsule::constructor((Capsule *)(local_10c + 4),&local_ac,&npc->_sizeMulti,0.0,npc->_size); EntityList::QueryRadius (¤tRoom->_entityList,(EntityList_EL *)(local_3c + 8),(Vector *)(local_10c + 4), npc->_size + 80.0,0x28); local_14 = 0; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7f748) && (_Init_thread_header(&DAT_00c7f748), DAT_00c7f748 == -1)) { _atexit(FUN_00b15460); _Init_thread_footer(&DAT_00c7f748); } uVar12 = 0; DAT_00c7f750 = DAT_00c7f74c; otherGrudgesEnd = DAT_00c7f74c; if (local_28 != (undefined1 *)0x0) { do { local_9c = *(Entity_NPC **)(local_3c._12_4_ + uVar12 * 4); if ((local_9c->_type == 0x36d) && (local_9c != npc)) { if (otherGrudgesEnd == DAT_00c7f754) { std::vector::_Emplace_reallocate(otherGrudgesEnd,&local_9c); otherGrudgesEnd = DAT_00c7f750; } else { *otherGrudgesEnd = (int)local_9c; DAT_00c7f750 = DAT_00c7f750 + 1; otherGrudgesEnd = DAT_00c7f750; } } uVar12 = uVar12 + 1; } while (uVar12 < local_28); } local_d4.y = 0.0; local_d4.x = 0.0; local_b8 = (Entity_NPC *)0x0; if (local_28 != (undefined1 *)0x0) { LAB_004e7100: entityRef = *(Entity_NPC **)(local_3c._12_4_ + (int)local_b8 * 4); local_98 = entityRef; if ((entityRef != npc) && (((entityRef->_entityCollisionClass == 4 || (entityRef->_entityCollisionClass == 3)) && (0.0 < ((entityRef->_pos).y - (npc->_pos).y) * (npc->_v1).y + ((entityRef->_pos).x - (npc->_pos).x) * (npc->_v1).x)))) { Entity::GetCollisionCapsule((Entity *)entityRef,local_68._tint + 1,&g_vectorZero); local_9c = (Entity_NPC *)(entityRef->_velocity).x; local_a0 = (Entity_NPC *)(entityRef->_velocity).y; local_68._tint[1] = (float)local_9c * entityRef->_speedMultiplier + local_68._tint[1]; local_68._tint[2] = (float)local_a0 * entityRef->_speedMultiplier + local_68._tint[2]; bVar4 = Capsule::Collide((Capsule *)(local_10c + 4),(Capsule *)(local_68._tint + 1), &local_d4); game = g_game; if (bVar4 != 0) { iVar13 = entityRef->_type; if (iVar13 == 0x36d) { Game::ShakeScreen(g_game,6); manager = g_manager; local_98 = (Entity_NPC *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_98 = (Entity_NPC *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_98 = (Entity_NPC *)0x3f000000; } local_b0 = (Entity_NPC *)0x1e7; seed_fart_sound_override((int *)&local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0,1.0,2,0,(float)local_98,0.0); npc->_state = 4; game = g_game; if (npc->_i2 == 0) { fVar16 = 1.0; } else { fVar16 = 0.0; } npc->_collisionDamage = fVar16; pvVar9 = (npc->_pathfinder)._entity; iVar13 = (int)((*(float *)((int)pvVar9 + 0x33c) - 40.0) / 40.0 + 0.5); iVar7 = (int)((*(float *)((int)pvVar9 + 0x340) - 120.0) / 40.0 + 0.5); if (((iVar13 < 0) || (gridWidth = *(int *)((int)game->_room + 0xc), gridWidth <= iVar13) ) || ((iVar7 < 0 || (*(int *)((int)game->_room + 0x10) <= iVar7)))) { iVar13 = -1; } else { iVar13 = gridWidth * iVar7 + iVar13; } (npc->_pathfinder)._gridIndex = iVar13; iVar7 = room->_gridWidth; (npc->_targetPosition).x = (float)(iVar13 % iVar7) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar13 / iVar7) * 40.0 + 120.0; uVar12 = (npc->_pathfinder)._gridIndex; if ((uVar12 < 0x1c0) && (room->_gridPaths[uVar12] < 0x3b7)) { room->_gridPaths[uVar12] = 900; } npc->_stateFrame = 0xf; } else if (iVar13 == 0x21) { iVar13 = entityRef->_variant; if (iVar13 == 0xb) goto LAB_004e7409; if ((iVar13 != 2) && (iVar13 != 3)) { entityRef->_health = 1.0; takeDamageFn = *(code **)(*(int *)entityRef + 0x20); EntityRef::constructor(&damageSource,(Entity *)npc); (*takeDamageFn)(0x447a0000,0,0,&damageSource,0x1e); } } else { if ((iVar13 == 1) && (entityRef->_dead != 0)) { fVar16 = 0.8; bVar15 = true; } else { LAB_004e7409: fVar16 = 0.6; bVar15 = false; } fVar17 = npc->_speedMultiplier; fVar1 = fVar16; if (fVar17 != 1.0) { fVar1 = fVar16 / ((fVar16 + fVar17) - fVar16 * fVar17); } pushVelX = (float)local_9c + ((npc->_velocity).x - (float)local_9c) * fVar1; fVar17 = (float)local_a0 + ((npc->_velocity).y - (float)local_a0) * fVar1; (entityRef->_velocity).x = pushVelX; (entityRef->_velocity).y = fVar17; if ((((1 < *(int *)&game->_deathmatchManager) && (entityRef->_type == 1)) || (entityRef->_type - 10U < 0x3de)) || ((entityRef->_type == 4 || (bVar15)))) { fVar1 = entityRef->_friction; if (fVar1 != 0.0) { fVar17 = (fVar16 * ((local_104 + entityRef->_size * (npc->_v1).y) - (entityRef->_pos).y) * entityRef->_speedMultiplier) / fVar1 + (entityRef->_velocity).y; (entityRef->_velocity).x = (fVar16 * (((float)local_10c._4_4_ + entityRef->_size * (npc->_v1).x) - (entityRef->_pos).x) * entityRef->_speedMultiplier) / fVar1 + pushVelX; (entityRef->_velocity).y = fVar17; } if (entityRef->_entityGridCollisionClass != 0) { local_b4 = (entityRef->_collisionPoints)._begin; local_c0 = (Entity_NPC *) ((int)(entityRef->_collisionPoints)._end - (int)local_b4 >> 3); local_b0 = (Entity_NPC *)0x0; local_ac.y = (entityRef->_pos).y + entityRef->_speedMultiplier * fVar17 * entityRef->_friction; local_bc = (Entity_NPC *) ((entityRef->_pos).x + entityRef->_speedMultiplier * (entityRef->_velocity).x * entityRef->_friction); if (local_c0 != (Entity_NPC *)0x0) { do { local_9c = (Entity_NPC *)((float)local_bc + *(float *)local_b4); local_a0 = (Entity_NPC *)(local_ac.y + *(float *)&local_b4->field_0x4); iVar13 = (int)(((float)local_9c - 40.0) / 40.0 + 0.5); iVar7 = (int)(((float)local_a0 - 120.0) / 40.0 + 0.5); if (iVar13 < 0) { LAB_004e7673: iVar13 = -1; } else { if (((room->_gridWidth <= iVar13) || (iVar7 < 0)) || (entityRef = local_98, room->_gridHeight <= iVar7)) goto LAB_004e7673; iVar13 = room->_gridWidth * iVar7 + iVar13; } local_c4 = (Entity_NPC *)Room::GetGridCollision(room,iVar13); if (local_c4 == (Entity_NPC *)&DAT_00000004) { LAB_004e776b: if (entityRef->_type == 4) { entityRef->_stateFrame = 0; (entityRef->_pathfinder)._entity = (void *)0x0; } else if (entityRef->_type == 1) { if (((entityRef->_sprite)._animState._animData != (void *)0x0) && ((entityRef->_sprite)._animState._isPlaying != 0)) { pbVar8 = (entityRef->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar11 = "Death"; goto LAB_004e77c0; } } else { entityRef = EntityRef::EntityRef((EntityRef *)(local_94 + 4)); (*extraout_EDX)(entityRef); if ((*(byte *)((int)entityRef->_config + 0x60) & 1) != 0) { uVar12 = Random(); color = &entityRef->_splatColor; (npc->_v2).y = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 30.0 + 30.0; goto LAB_004e79ee; } } break; } if (DAT_00c7f74c != DAT_00c7f750) { uVar12 = 0; otherGrudgeCount = (int)DAT_00c7f750 - (int)DAT_00c7f74c >> 2; if (otherGrudgeCount != 0) { do { iVar13 = DAT_00c7f74c[uVar12]; fVar16 = *(float *)(iVar13 + 0x33c) - (float)local_9c; fVar17 = *(float *)(iVar13 + 0x340) - (float)local_a0; if (fVar17 * fVar17 + fVar16 * fVar16 <= *(float *)(iVar13 + 0x370) * *(float *)(iVar13 + 0x370)) goto LAB_004e776b; uVar12 = uVar12 + 1; } while (uVar12 < otherGrudgeCount); } } if (local_c4 == (Entity_NPC *)0x1) { bVar15 = entityRef->_entityGridCollisionClass == 5; } else { if (((local_c4 == (Entity_NPC *)0x2) || (local_c4 == (Entity_NPC *)0x3)) && (entityRef->_entityGridCollisionClass != 3)) goto LAB_004e776b; bVar15 = local_c4 == (Entity_NPC *)&DAT_00000004; } if (bVar15) goto LAB_004e776b; local_b0 = (Entity_NPC *)&local_b0->field_0x1; local_b4 = (Entity_NPC *)&local_b4->_damageEvents; } while (local_b0 < local_c0); } } } } } } goto LAB_004e7a16; } LAB_004e7a2c: local_14 = 0xffffffff; if (local_3c[8] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_3c._12_4_,0); local_14 = 0xffffffff; } break; case 0x10: npc->_collisionDamage = 0.0; npc->_friction = npc->_friction * 0.8; ExceptionList = local_1c; return; } if ((npc->_state == 4) || (npc->_state == 8)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar16 = atan2f((tmpEntity->_pos).y - (npc->_pos).y,(tmpEntity->_pos).x - (npc->_pos).x); local_ac.y = (float)((int)((fVar16 * 57.295776) / 45.0 + 8.5) & 0x80000007); if ((int)local_ac.y < 0) { local_ac.y = (float)(((int)local_ac.y - 1U | 0xfffffff8) + 1); } bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b60774,1); if (((bVar4 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)local_ac.y), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } } if (npc->_state != 8) { uVar12 = (npc->_pathfinder)._gridIndex; if ((uVar12 < 0x1c0) && (room->_gridPaths[uVar12] < 0x3b7)) { room->_gridPaths[uVar12] = 900; } npc->_friction = npc->_friction * 0.8; fVar16 = (npc->_targetPosition).y; fVar17 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar16 - fVar17; } player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x97); if ((player == (Entity_Player *)0x0) || (iVar13 = Entity_Player::GetTrinketMultiplier(player,0x97), iVar13 < 2)) { bVar15 = false; } else { bVar15 = true; } if ((npc->_i2 != 0) != bVar15) { iVar13 = 1 - npc->_i2; npc->_i2 = iVar13; if (iVar13 == 0) { fVar16 = 2.0; } else { fVar16 = 0.0; } npc->_collisionDamage = fVar16; pcVar11 = "gfx/Monsters/repentance/grudge_retracted.png"; local_2c = 0; if (iVar13 == 0) { pcVar11 = "gfx/Monsters/repentance/grudge.png"; } local_28 = (undefined1 *)0xf; local_3c._0_4_ = (void *)0x0; pbVar8 = (byte *)pcVar11; do { bVar4 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar4 != 0); std::string::assign(local_3c,(byte *)pcVar11,(int)pbVar8 - (int)(pcVar11 + 1)); local_14 = 2; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,0,(std_string *)local_3c); local_14 = 0xffffffff; bVar4 = extraout_CL; if (0xf < local_28) { uVar12 = (int)local_28 + 1; pvVar9 = (void *)local_3c._0_4_; if (0xfff < uVar12) { pvVar9 = *(void **)(local_3c._0_4_ + -4); uVar12 = (int)local_28 + 0x24; if (0x1f < (uint)(local_3c._0_4_ + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar12); bVar4 = extraout_CL_00; } ANM2::LoadGraphics(&npc->_sprite,bVar4); } ExceptionList = local_1c; return; while( true ) { bVar4 = pbVar8[1]; bVar15 = bVar4 < (byte)pcVar11[1]; if (bVar4 != pcVar11[1]) goto LAB_004e77e0; pbVar8 = pbVar8 + 2; pcVar11 = pcVar11 + 2; if (bVar4 == 0) break; LAB_004e77c0: bVar4 = *pbVar8; bVar15 = bVar4 < (byte)*pcVar11; if (bVar4 != *pcVar11) { LAB_004e77e0: uVar12 = -(uint)bVar15 | 1; goto LAB_004e77e5; } if (bVar4 == 0) break; } uVar12 = 0; LAB_004e77e5: if ((uVar12 == 0) && (layer = ANM2::GetLayer(&entityRef->_sprite,(byte *)0xc), layer->_visible != 0) ) { layer = ANM2::GetLayer(&entityRef->_sprite,(byte *)0xc); layer->_visible = 0; uVar12 = Random(); Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,3,uVar12); manager = g_manager; local_b4 = (Entity_NPC *)0x1e; seed_fart_sound_override((int *)&local_b4); SoundEffects::Play(&manager->_sfxManager,(int)local_b4,1.0,2,0,1.0,0.0); manager = g_manager; local_68._tint[0] = 1.0; local_68._tint[1] = 1.0; local_68._tint[2] = 1.0; local_68._tint[3] = 1.0; local_68._offset[0] = 0.0; local_68._offset[1] = 0.0; local_68._offset[2] = 0.0; local_68._colorize[0] = 0.0; local_68._colorize[1] = 0.0; local_68._colorize[2] = 0.0; local_68._colorize[3] = 0.0; local_ac.y = 1.469368e-38; _Find_lower_bound<>(local_e0,&local_ac.y); if ((*(char *)((int)local_d8 + 0xd) != '\0') || ((0xa00000 < *(uint *)((int)local_d8 + 0x10) || (puVar10 = (uint *)((int)local_d8 + 0x78), local_d8 == (manager->_entityConfig)._entities._head)))) { puVar10 = (uint *)0x60; } local_cc.x = (local_98->_pos).x; local_cc.y = (local_98->_pos).y; spawn_gibs(&local_cc,10,40.0,puVar10,(Entity *)0x0,&local_68,&g_vectorZero,1.0); uVar12 = Random(); (npc->_v2).y = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 30.0 + 30.0; Color::Color(&local_160); color = extraout_EAX; LAB_004e79ee: if (&npc->_splatColor != color) { fVar16 = color->_tint[1]; fVar17 = color->_tint[2]; fVar1 = color->_tint[3]; (npc->_splatColor)._tint[0] = color->_tint[0]; (npc->_splatColor)._tint[1] = fVar16; (npc->_splatColor)._tint[2] = fVar17; (npc->_splatColor)._tint[3] = fVar1; fVar16 = color->_colorize[1]; fVar17 = color->_colorize[2]; fVar1 = color->_colorize[3]; (npc->_splatColor)._colorize[0] = color->_colorize[0]; (npc->_splatColor)._colorize[1] = fVar16; (npc->_splatColor)._colorize[2] = fVar17; (npc->_splatColor)._colorize[3] = fVar1; fVar16 = color->_offset[1]; (npc->_splatColor)._offset[0] = color->_offset[0]; (npc->_splatColor)._offset[1] = fVar16; (npc->_splatColor)._offset[2] = color->_offset[2]; } } LAB_004e7a16: local_b8 = (Entity_NPC *)&local_b8->field_0x1; if (local_28 <= local_b8) goto LAB_004e7a2c; goto LAB_004e7100; } //@@ 004e7d10 find_nearest_enemy /* DB: ? ECX = position Vector*, EDX = out distance: EntityList::QuerySublist of the room's NPC list, skips non-enemies, flag 0x20 entities (and 0x1000a20 ones half the time), requires friendly flag 0x100 == param_1, returns the closest entity and writes its distance; callers Entity::TakeDamage, Entity_Player::TakeDamage */ int find_nearest_enemy(char param_1) { qword qVar1; uint uVar2; qword *pqVar3; float *in_EDX; int iVar4; int iVar5; uint uVar6; float fVar7; float fVar8; EntityList_EL local_38; undefined4 local_24; float *local_20; float *local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3d0d; local_10 = ExceptionList; ExceptionList = &local_10; local_20 = in_EDX; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_38,0x325,-1,-1,0,0); local_8 = 0; iVar4 = 0; fVar7 = 1e+06; uVar6 = 0; local_18 = 1e+06; if (local_38._size != 0) { do { iVar5 = *(int *)((int)local_38._data + uVar6 * 4); if ((iVar5 == 0) || (((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)(iVar5 + 0x28) != 1)) && (0x3dd < *(int *)(iVar5 + 0x28) - 10U)))) { iVar5 = 0; } local_24 = *(undefined4 *)(iVar5 + 0x16c); if ((((*(uint *)(iVar5 + 0x168) & 0x20) == 0) && (((*(uint *)(iVar5 + 0x168) & 0x1000a20) == 0 || (uVar2 = Random(), fVar7 = local_18, (uVar2 & 1) == 0)))) && ((bool)param_1 == ((*(uint *)(iVar5 + 0x168) & 0x100) != 0))) { fVar7 = local_1c[1] - *(float *)(iVar5 + 0x340); fVar8 = *local_1c - *(float *)(iVar5 + 0x33c); fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (local_18 <= fVar7) { fVar7 = local_18; } else { iVar4 = iVar5; local_18 = fVar7; } } uVar6 = uVar6 + 1; } while (uVar6 < (uint)local_38._size); } *local_20 = fVar7; if (local_38._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } if (local_38._data != (void *)0x0) { uVar6 = *(uint *)((int)local_38._data + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar6; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar6); free((uint *)((int)local_38._data + -4)); } } ExceptionList = local_10; return iVar4; } //@@ 004e7ea0 NpcAI::ENTITY_BISHOP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 805 (from dispatcher 006c2990) */ uint __fastcall NpcAI::ENTITY_BISHOP(Entity_NPC *npc) { byte bVar1; uint extraout_EAX; byte *curAnimChar; uint extraout_EAX_00; uint extraout_EAX_01; uint extraout_EAX_02; uint uVar2; byte *cmpAnimChar; char *shootAnimChar; int iVar3; uint uVar4; int gridY; bool bVar5; undefined4 local_118 [8]; undefined4 local_f8; undefined4 uStack_f4; undefined4 local_f0; ColorMod shotColor; Vector shotVelocity; EntityPtr minecart; ProjectileParams projParams; float local_8; byte *animData; float friction; int gridWidth; float posY; void *room; float targetX; float targetY; local_8 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); minecart = npc->_minecart; uVar4 = npc->_state; if (uVar4 == 0) { iVar3 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar3) && (gridWidth = *(int *)((int)g_game->_room + 0xc), iVar3 < gridWidth)) && (gridY = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), -1 < gridY)) && ((gridY < *(int *)((int)g_game->_room + 0x10) && (iVar3 = gridWidth * gridY + iVar3, -1 < iVar3)))) { (npc->_targetPosition).x = (float)(iVar3 % gridWidth) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar3 / gridWidth) * 40.0 + 120.0; } npc->_state = 3; local_f8 = 0; uStack_f4 = 0; local_f0 = 0; if (&npc->_splatColor != (ColorMod *)local_118) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.8; (npc->_splatColor)._colorize[1] = 0.78; (npc->_splatColor)._colorize[2] = 0.74; (npc->_splatColor)._colorize[3] = 1.0; } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = &DAT_00b607f4; do { bVar1 = *curAnimChar; bVar5 = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_004e8230: uVar4 = -(uint)bVar5 | 1; goto LAB_004e8235; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar5 = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_004e8230; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_004e8235: if ((uVar4 == 0) && ((uVar4 = 0, animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004e8268; } bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b607f4,1); uVar4 = (uint)bVar1; if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; uVar4 = extraout_EAX_02; } } else if (uVar4 == 3) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = s_Idle; do { bVar1 = *curAnimChar; bVar5 = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_004e8036: uVar4 = -(uint)bVar5 | 1; goto LAB_004e803b; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar5 = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_004e8036; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_004e803b: if ((uVar4 == 0) && ((uVar4 = 0, animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004e806e; } bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); uVar4 = (uint)bVar1; if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; uVar4 = extraout_EAX_00; } } LAB_004e806e: if (0.0 < npc->_pendingDamage) { uVar2 = Random(); uVar4 = uVar2 / 3; if (uVar2 % 3 != 0) { animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004e80e6: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); uVar4 = (uint)bVar1; if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; uVar4 = extraout_EAX_01; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } shootAnimChar = "Shoot"; do { bVar1 = *curAnimChar; bVar5 = bVar1 < (byte)*shootAnimChar; if (bVar1 != *shootAnimChar) { LAB_004e80d0: uVar4 = -(uint)bVar5 | 1; goto LAB_004e80d5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar5 = bVar1 < (byte)shootAnimChar[1]; if (bVar1 != shootAnimChar[1]) goto LAB_004e80d0; curAnimChar = curAnimChar + 2; shootAnimChar = shootAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_004e80d5: if ((uVar4 != 0) || ((uVar4 = 0, animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004e80e6; } npc->_state = 8; } } } else if (uVar4 == 8) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); uVar4 = (uint)bVar1; if (bVar1 != 0) { ProjectileParams::ProjectileParams(&projParams); shotColor._tint[0] = 0.99; shotColor._tint[1] = 1.0; shotColor._tint[2] = 1.0; shotColor._tint[3] = 1.0; shotColor._offset[0] = 0.15; shotColor._colorize[0] = 3.0; shotColor._colorize[1] = 3.0; shotColor._colorize[2] = 3.0; shotColor._colorize[3] = 1.0; shotColor._offset[1] = 0.15; shotColor._offset[2] = 0.2; Color::operator_assign((Color *)&projParams.Color,&shotColor); shotVelocity.x = 12.0; shotVelocity.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVelocity,6,&projParams); Entity_NPC::PlaySound(npc,0x106,1.0,2,0,1.0); uVar4 = extraout_EAX; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004e8268; } npc->_state = 3; } LAB_004e8268: targetX = (npc->_targetPosition).x; uVar2 = (uint)CONCAT11((targetX == g_vectorZero.x) << 6 | (NAN(targetX) || NAN(g_vectorZero.x)) << 2 | 2U | targetX < g_vectorZero.x, (char)uVar4); if (targetX == g_vectorZero.x) { targetY = (npc->_targetPosition).y; uVar2 = (uint)CONCAT11((targetY == g_vectorZero.y) << 6 | (NAN(targetY) || NAN(g_vectorZero.y)) << 2 | 2U | targetY < g_vectorZero.y,(char)uVar4); if (targetY == g_vectorZero.y) goto LAB_004e82ca; } targetY = (npc->_targetPosition).y; posY = (npc->_pos).y; friction = npc->_friction; (npc->_velocity).x = (targetX - (npc->_pos).x) / friction; (npc->_velocity).y = (targetY - posY) / friction; LAB_004e82ca: if (minecart == (EntityPtr)0x0) { room = g_game->_room; uVar2 = (uint)(((npc->_targetPosition).x - 40.0) / 40.0 + 0.5); if ((((-1 < (int)uVar2) && ((int)uVar2 < *(int *)((int)room + 0xc))) && (iVar3 = (int)(((npc->_targetPosition).y - 120.0) / 40.0 + 0.5), -1 < iVar3)) && ((iVar3 < *(int *)((int)room + 0x10) && (uVar4 = iVar3 * *(int *)((int)room + 0xc) + uVar2, uVar4 < 0x1c0)))) { iVar3 = *(int *)((int)room + uVar4 * 4 + 0x76c); uVar2 = iVar3 / 1000; if (iVar3 % 1000 < 900) { *(int *)((int)room + uVar4 * 4 + 0x76c) = (iVar3 - iVar3 % 1000) + 900; } } } return uVar2; } //@@ 004e8380 NpcAI::ENTITY_BABY_BEGOTTEN /* NPC AI for entity type 883 (from dispatcher 006c2990) */ undefined1 * __fastcall NpcAI::ENTITY_BABY_BEGOTTEN(Entity_NPC *npc) { byte bVar1; bool isFlipX; EntityPtr target; char *anim; undefined1 *extraout_EAX; Entity_Laser *laser; undefined1 *puVar2; uint rngResult; Vector *targetMoveDir; undefined1 *extraout_EAX_00; int iVar3; undefined1 *otherDirection; int iVar4; float *pfVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; char babies [4]; void *babiesData; Vector local_64; Vector local_5c; Vector local_54; Vector local_4c; Vector local_44; float leadAmount; EntityPtr local_38; float local_34; float local_30; float local_2c; float local_28; bool local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Entity_NPC *otherBaby; void *room; puStack_20 = babies + 0x68; local_14 = 0xffffffff; puStack_18 = &LAB_00af3a3d; local_1c = ExceptionList; ExceptionList = &local_1c; room = g_game->_room; iVar4 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if ((((-1 < iVar4) && (iVar4 < *(int *)((int)room + 0xc))) && (-1 < iVar3)) && ((iVar3 < *(int *)((int)room + 0x10) && (local_34 = (float)(*(int *)((int)room + 0xc) * iVar3 + iVar4), (uint)local_34 < 0x1c0)))) { iVar3 = *(int *)((int)room + (int)local_34 * 4 + 0x76c); local_38 = (EntityPtr)0x3e8; iVar4 = iVar3 % 1000; if (iVar4 < 900) { *(int *)((int)room + (int)local_34 * 4 + 0x76c) = (iVar3 - iVar4) + 900; } } local_54.y = (float)npc; target = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); local_38 = target; Entity_NPC::CalcTargetPosition(npc,&local_5c,0.0); local_28 = local_5c.x; local_30 = local_5c.x - (npc->_pos).x; local_2c = local_5c.y; local_34 = local_5c.y - (npc->_pos).y; local_5c.y = sqrtf(local_30 * local_30 + local_34 * local_34); puVar2 = (undefined1 *)npc->_state; if (puVar2 == (undefined1 *)0x0) { rngResult = Random(); npc->_state = 4; npc->_projectileDelay = rngResult % 0x32 + 10; ExceptionList = local_1c; return (undefined1 *)(rngResult / 0x32); } if (puVar2 != &DAT_00000004) { if (puVar2 != &DAT_00000008) { ExceptionList = local_1c; return puVar2; } if ((npc->_sprite)._animState._animData == (void *)0x0) { fVar9 = npc->_friction; } else { bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); fVar9 = npc->_friction; if (bVar1 != 0) { fVar9 = fVar9 * 0.9; npc->_friction = fVar9; fVar10 = (npc->_targetPosition).y; if (fVar9 != 0.0) { fVar6 = npc->_speedMultiplier; (npc->_velocity).x = (-(npc->_targetPosition).x * fVar6) / fVar9 + (npc->_velocity).x; (npc->_velocity).y = (-fVar10 * fVar6) / fVar9 + (npc->_velocity).y; } goto LAB_004e872b; } } npc->_friction = fVar9 * 0.7; if (((0 < npc->_i1) || (bVar1 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b1d6f4), bVar1 == 0)) && (target != (EntityPtr)0x0)) { local_5c.x = (((Vector *)((int)target + 0x360))->x * 10.0 + ((Vector *)((int)target + 0x33c))->x) - (npc->_targetPosition).x * 100.0; local_5c.y = (*(float *)((int)target + 0x364) * 10.0 + *(float *)((int)target + 0x340)) - (npc->_targetPosition).y * 100.0; Room::GetClampedPositionImpl(g_game->_room,&local_54,&local_5c,0.0,0.0,0.0,0.0); local_30 = (local_54.y - (npc->_pos).y) * 0.03; local_34 = (local_54.x - (npc->_pos).x) * 0.03; fVar6 = sqrtf(local_30 * local_30 + local_34 * local_34); fVar9 = local_34; fVar10 = local_30; if (16.0 < fVar6) { fVar9 = local_34 * (16.0 / fVar6); fVar10 = local_30 * (16.0 / fVar6); } fVar6 = npc->_friction; if (fVar6 != 0.0) { fVar7 = npc->_speedMultiplier; (npc->_velocity).y = (fVar7 * fVar10) / fVar6 + (npc->_velocity).y; (npc->_velocity).x = (fVar7 * fVar9) / fVar6 + (npc->_velocity).x; } } LAB_004e872b: if (0 < npc->_i1) { puVar2 = (undefined1 *)(((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1); npc->_i1 = (int)puVar2; if (0 < (int)puVar2) { ExceptionList = local_1c; return puVar2; } fVar9 = (npc->_targetPosition).y; if (ABS(fVar9) <= ABS((npc->_targetPosition).x)) { ANM2::Play(&npc->_sprite,(byte *)"AttackRight",0); isFlipX = (npc->_targetPosition).x <= 0.0 && (npc->_targetPosition).x != 0.0; } else { anim = "AttackUp"; if (0.0 <= fVar9) { anim = "AttackDown"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); isFlipX = false; } (npc->_sprite)._flipX = isFlipX; Entity_NPC::PlaySound(npc,0xa7,0.8,2,0,1.15); ExceptionList = local_1c; return extraout_EAX; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); puVar2 = (undefined1 *)(uint)bVar1; if (bVar1 != 0) { local_5c.x = 0.0; local_5c.y = -35.0; fVar9 = atan2f((npc->_targetPosition).y,(npc->_targetPosition).x); local_4c.x = (npc->_targetPosition).x * 18.0 + (npc->_pos).x; local_4c.y = (npc->_pos).y + 0.0; laser = Entity_Laser::ShootAngle (1,&local_4c,fVar9 * 57.295776,0xe,&local_5c,(Entity *)npc,0); laser->_scale = 0.6; Entity_Laser::ResetSpriteScale(laser); laser->_maxDistance = 160.0; pfVar5 = &(npc->_targetPosition).y; if (-0.5 < *pfVar5 || *pfVar5 == -0.5) { fVar9 = 1000.0; } else { fVar9 = -10.0; } laser->_renderDepthOffset = fVar9; puVar2 = (undefined1 *)(**(code **)(*(int *)laser + 0xc))(); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return puVar2; } } npc->_state = 4; rngResult = Random(); npc->_projectileDelay = rngResult % 0x32 + 0x1e; rngResult = Random(); puVar2 = (undefined1 *)(rngResult / 0x3c); npc->_i1 = rngResult % 0x3c + 0x1e; if (npc->_target != (EntityPtr)0x0) { local_38 = (EntityPtr)&npc->_target; puVar2 = (undefined1 *)std::multiset::erase(&local_38); } npc->_target = (EntityPtr)0x0; ExceptionList = local_1c; return puVar2; } if (ABS(local_34) <= ABS(local_30)) { anim = "IdleRight"; local_21 = local_30 < 0.0; } else { anim = "IdleUp"; local_21 = false; if (0.0 <= local_34) { anim = "IdleDown"; } } ANM2::Play(&npc->_sprite,(byte *)anim,0); (npc->_sprite)._flipX = local_21; iVar3 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; npc->_i1 = npc->_i1 - iVar3; npc->_projectileDelay = npc->_projectileDelay - iVar3; npc->_friction = npc->_friction * 0.8; fVar9 = local_2c; if ((*(int *)((int)target + 0x28) == 1) && ((npc->_flags & 0x1000a00) == 0)) { local_4c.x = *(float *)((int)target + 0x1630); local_4c.y = *(float *)((int)target + 0x1634); if ((local_4c.x != g_vectorZero.x) || (local_4c.y != g_vectorZero.y)) { local_44.y = 0.0; leadAmount = (local_4c.x * local_30 + local_4c.y * local_34) * -0.5; pfVar5 = &leadAmount; if (leadAmount <= 0.0) { pfVar5 = &local_44.y; } if (*pfVar5 <= 0.0) { local_44.x = local_28; } else { targetMoveDir = Vector::Normalized(&local_4c,&local_64); local_4c.y = cos(1.5707964); fVar9 = sin(1.5707964); fVar10 = local_4c.y * targetMoveDir->x - fVar9 * targetMoveDir->y; fVar9 = local_4c.y * targetMoveDir->y + fVar9 * targetMoveDir->x; if (0.0 < fVar10 * local_30 + fVar9 * local_34) { fVar10 = fVar10 * -1.0; fVar9 = fVar9 * -1.0; } local_4c.x = fVar10 * *pfVar5 + (local_28 - local_30 * 0.5); local_4c.y = fVar9 * *pfVar5 + (local_2c - local_34 * 0.5); Room::GetClampedPositionImpl(g_game->_room,&local_44,&local_4c,20.0,20.0,20.0,20.0); npc = (Entity_NPC *)local_54.y; fVar9 = local_44.y; } target = local_38; goto LAB_004e8bb0; } } local_44.x = local_28; LAB_004e8bb0: fVar10 = (npc->_pos).x; fVar6 = (npc->_pos).y; fVar8 = ((Vector *)((int)target + 0x33c))->x - fVar10; fVar7 = *(float *)((int)target + 0x340) - fVar6; if (1600.0 < fVar7 * fVar7 + fVar8 * fVar8) { local_28 = (local_44.x - fVar10) * 0.01; local_2c = (fVar9 - fVar6) * 0.01; fVar6 = sqrtf(local_28 * local_28 + local_2c * local_2c); fVar9 = local_28; fVar10 = local_2c; if (0.0 < fVar6) { fVar9 = local_28 * (1.0 / fVar6); fVar10 = local_2c * (1.0 / fVar6); } fVar6 = npc->_friction; if (fVar6 != 0.0) { fVar7 = npc->_speedMultiplier; (npc->_velocity).y = (fVar7 * fVar10) / fVar6 + (npc->_velocity).y; (npc->_velocity).x = (fVar7 * fVar9) / fVar6 + (npc->_velocity).x; } } puVar2 = (undefined1 *)((uint)npc->_flags & 0x1000a00); if (((puVar2 == (undefined1 *)0x0) && (puVar2 = (undefined1 *)NpcHelper::is_target_valid(target), (char)puVar2 != '\0')) && (local_5c.y < 100.0)) { rngResult = Random(); puVar2 = (undefined1 *)(rngResult & 7); if (puVar2 == (undefined1 *)0x0) { local_5c.x = ((Vector *)((int)target + 0x33c))->x - (npc->_pos).x; local_5c.y = *(float *)((int)target + 0x340) - (npc->_pos).y; Vector::ToCardinal(&local_54,&local_5c); Entity_NPC::QueryNPCsType(babies,0x373,-1); local_14 = 0; fVar9 = 0.0; if (local_64.y != 0.0) { do { otherBaby = *(Entity_NPC **)((int)babiesData + (int)fVar9 * 4); if (((otherBaby != (Entity_NPC *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (otherBaby->_type == 1)) || (otherBaby->_type - 10U < 0x3de)) && ((otherBaby != npc && (local_21 = (otherBaby->_flags & 0x20000000) != 0, local_21 == ((npc->_flags & 0x20000000) != 0))))))) && ((otherBaby->_state == 8 && (otherBaby->_target == target)))) { fVar6 = ((Vector *)((int)target + 0x33c))->x - (otherBaby->_pos).x; fVar10 = *(float *)((int)target + 0x340) - (otherBaby->_pos).y; if (ABS(fVar6) <= ABS(fVar10)) { otherDirection = (undefined1 *)((uint)(0.0 <= fVar10) * 2 + 1); } else { otherDirection = (undefined1 *)0x2; if (fVar6 < 0.0) { otherDirection = (undefined1 *)0x0; } } if (ABS(local_54.x) <= ABS(local_54.y)) { puVar2 = (undefined1 *)((uint)(0.0 <= local_54.y) * 2 + 1); } else { local_5c.y = 0.0; puVar2 = (undefined1 *)0x2; if (local_54.x < 0.0) { puVar2 = (undefined1 *)0x0; } } if (otherDirection == puVar2) goto LAB_004e8f2e; } fVar9 = (float)((int)fVar9 + 1); } while ((uint)fVar9 < (uint)local_64.y); } npc->_state = 8; (npc->_targetPosition).x = local_54.x; (npc->_targetPosition).y = local_54.y; npc->_i1 = 0x14; if (npc->_target != (EntityPtr)0x0) { local_5c.y = (float)&npc->_target; std::multiset::erase(&local_5c.y); } npc->_target = target; std::multiset::insert(&npc->_target); fVar9 = (npc->_targetPosition).y; if (ABS(fVar9) <= ABS((npc->_targetPosition).x)) { ANM2::Play(&npc->_sprite,(byte *)"ChaseRight",0); isFlipX = (npc->_targetPosition).x <= 0.0 && (npc->_targetPosition).x != 0.0; puVar2 = (undefined1 *)(uint)isFlipX; (npc->_sprite)._flipX = isFlipX; } else { anim = "ChaseUp"; if (0.0 <= fVar9) { anim = "ChaseDown"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); (npc->_sprite)._flipX = 0; puVar2 = extraout_EAX_00; } LAB_004e8f2e: if (babies[0] == '\0') { local_14 = 1; puVar2 = tracked_alloc(1,babiesData,0); ExceptionList = local_1c; return puVar2; } } } ExceptionList = local_1c; return puVar2; } //@@ 004e8fa0 Entity_NPC::UpdateCordChain /* DB: ? Evis/Vis Fatty/Dogma/Peeper Fatty cord points deque 0xc08 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::UpdateCordChain(Entity_NPC *this,byte isHalfScale) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; int iVar7; void *pvVar8; int iVar9; int iVar10; int iVar11; int iVar12; uint uVar13; uint uVar14; uint uVar15; uint uVar16; int iVar17; uint uVar18; uint uVar19; uint uVar20; uint uVar21; uint uVar22; uint uVar23; uint uVar24; float segmentLength; float segmentLength; float fVar26; float fVar27; float fVar28; float fVar29; float lerpInvT; float lerpT; float forceY; float forceX; float forceZ; float stepScale; uint pointCount; uint pointIdx; if (isHalfScale == 0) { stepScale = 1.0; } else { stepScale = 0.5; } if (this->_type == 0x3b6) { segmentLength = 16.0; } else if (this->_type == 0x361) { segmentLength = this->_aiFloat; } else { segmentLength = ((this->_v1).x + 1.0) * 10.0; } pointCount = (this->_vectorDeque1)._size; if ((this->_vectorDeque2)._size < pointCount) { std::deque::resize(pointCount); pointCount = (this->_vectorDeque1)._size; } pointIdx = 0; if (pointCount != 0) { uVar19 = pointCount; do { uVar16 = (this->_vectorDeque1)._offset; forceX = 0.0; forceY = 0.0; forceZ = 0.4; if (pointIdx != 0) { uVar13 = (pointIdx - 1) + uVar16; uVar19 = pointIdx + 2 + uVar16; uVar23 = uVar16 + pointIdx & 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar16 + pointIdx >> 1) * 4); uVar14 = uVar16 + (pointIdx - 3); uVar15 = uVar14 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar14 >> 1) * 4); fVar26 = *(float *)(iVar7 + 4 + uVar23 * 8) - *(float *)(iVar17 + 4 + uVar15 * 8); fVar29 = *(float *)(iVar7 + uVar23 * 8) - *(float *)(iVar17 + uVar15 * 8); uVar23 = uVar19 & 1; uVar19 = uVar19 >> 1; pvVar8 = (this->_vectorDeque1)._map; uVar20 = uVar13 >> 1; uVar13 = uVar13 & 1; fVar27 = *(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar19) * 4 ) + uVar23 * 8) - *(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar20) * 4 ) + uVar13 * 8); segmentLength = sqrtf(fVar26 * fVar26 + fVar29 * fVar29 + fVar27 * fVar27); fVar28 = segmentLength - segmentLength; uVar14 = pointIdx + uVar16 + 1; uVar24 = uVar14 & 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar14 >> 1) * 4); uVar14 = pointIdx + (uVar16 - 2); uVar15 = uVar14 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar14 >> 1) * 4); pvVar8 = (this->_vectorDeque1)._map; forceX = (0.0 - (fVar29 / segmentLength) * fVar28 * 0.3) - (*(float *)(iVar7 + uVar24 * 8) - *(float *)(iVar17 + uVar15 * 8)) * 0.3; forceY = (0.0 - (fVar26 / segmentLength) * fVar28 * 0.3) - (*(float *)(iVar7 + 4 + uVar24 * 8) - *(float *)(iVar17 + 4 + uVar15 * 8)) * 0.3; forceZ = (0.4 - (fVar27 / segmentLength) * fVar28 * 0.3) - (*(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar19) * 4) + 4 + uVar23 * 8) - *(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar20) * 4 ) + 4 + uVar13 * 8)) * 0.3; uVar19 = pointCount; } uVar13 = pointIdx + 3; if (uVar13 < uVar19) { uVar14 = pointIdx + 5 + uVar16; uVar19 = pointIdx + 2 + uVar16; uVar20 = uVar16 + pointIdx & 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + (uVar16 + pointIdx >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); uVar15 = uVar16 + pointIdx + 3; uVar23 = uVar15 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + (uVar15 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); fVar26 = *(float *)(iVar7 + uVar20 * 8) - *(float *)(iVar17 + uVar23 * 8); fVar29 = *(float *)(iVar7 + 4 + uVar20 * 8) - *(float *)(iVar17 + 4 + uVar23 * 8); uVar23 = uVar19 & 1; uVar19 = uVar19 >> 1; pvVar8 = (this->_vectorDeque1)._map; uVar20 = uVar14 >> 1; uVar14 = uVar14 & 1; fVar27 = *(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar19) * 4 ) + uVar23 * 8) - *(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar20) * 4 ) + uVar14 * 8); segmentLength = sqrtf(fVar26 * fVar26 + fVar29 * fVar29 + fVar27 * fVar27); fVar28 = segmentLength - segmentLength; uVar15 = pointIdx + uVar16 + 1; uVar24 = uVar15 & 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar15 >> 1) * 4); uVar16 = pointIdx + uVar16 + 4; uVar15 = uVar16 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + (uVar16 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); pvVar8 = (this->_vectorDeque1)._map; forceX = (forceX - (fVar26 / segmentLength) * fVar28 * 0.3) - (*(float *)(iVar7 + uVar24 * 8) - *(float *)(iVar17 + uVar15 * 8)) * 0.3; forceY = (forceY - (fVar29 / segmentLength) * fVar28 * 0.3) - (*(float *)(iVar7 + 4 + uVar24 * 8) - *(float *)(iVar17 + 4 + uVar15 * 8)) * 0.3; forceZ = (forceZ - (fVar27 / segmentLength) * fVar28 * 0.3) - (*(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar19) * 4) + 4 + uVar23 * 8) - *(float *)(*(int *)((int)pvVar8 + ((this->_vectorDeque1)._mapSize - 1 & uVar20) * 4 ) + 4 + uVar14 * 8)) * 0.3; } uVar16 = (this->_vectorDeque1)._offset; uVar19 = uVar16 + pointIdx; uVar15 = uVar19 & 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + (uVar19 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); uVar16 = uVar16 + pointIdx + 1; uVar14 = uVar16 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar16 >> 1) * 4); segmentLength = *(float *)(iVar17 + 4 + uVar14 * 8); fVar26 = *(float *)(iVar7 + 4 + uVar15 * 8); uVar19 = (this->_vectorDeque2)._offset + pointIdx; uVar16 = uVar19 & 1; iVar9 = *(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar19 >> 1) * 4); *(float *)(iVar9 + uVar16 * 8) = stepScale * *(float *)(iVar17 + uVar14 * 8) + *(float *)(iVar7 + uVar15 * 8); *(float *)(iVar9 + 4 + uVar16 * 8) = stepScale * segmentLength + fVar26; uVar19 = pointIdx + 1 + (this->_vectorDeque1)._offset; uVar16 = uVar19 & 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar19 >> 1) * 4); segmentLength = *(float *)(iVar7 + 4 + uVar16 * 8); uVar19 = pointIdx + 1 + (this->_vectorDeque2)._offset; uVar14 = uVar19 & 1; iVar17 = *(int *)((int)(this->_vectorDeque2)._map + (uVar19 >> 1 & (this->_vectorDeque2)._mapSize - 1) * 4); *(float *)(iVar17 + uVar14 * 8) = (forceX * stepScale + *(float *)(iVar7 + uVar16 * 8)) * 0.95 ; *(float *)(iVar17 + 4 + uVar14 * 8) = (forceY * stepScale + segmentLength) * 0.95; uVar19 = pointIdx + 2 + (this->_vectorDeque1)._offset; uVar14 = uVar19 & 1; uVar16 = pointIdx + 2 + (this->_vectorDeque2)._offset; uVar19 = uVar19 >> 1; *(float *)(*(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar16 >> 1) * 4) + (uVar16 & 1) * 8) = stepScale * *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar19) * 4) + 4 + uVar14 * 8) + *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar19) * 4) + uVar14 * 8); uVar19 = pointIdx + 2 + (this->_vectorDeque1)._offset; uVar16 = pointIdx + 2 + (this->_vectorDeque2)._offset; *(float *)(*(int *)((int)(this->_vectorDeque2)._map + (uVar16 >> 1 & (this->_vectorDeque2)._mapSize - 1) * 4) + 4 + (uVar16 & 1) * 8) = (forceZ * stepScale + *(float *)(*(int *)((int)(this->_vectorDeque1)._map + (uVar19 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4) + 4 + (uVar19 & 1) * 8)) * 0.95; uVar19 = pointIdx + 2 + (this->_vectorDeque2)._offset; uVar16 = uVar19 & 1; uVar19 = uVar19 >> 1; if (0.0 < *(float *)(*(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar19) * 4) + uVar16 * 8)) { *(undefined4 *) (*(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar19) * 4) + uVar16 * 8) = 0; uVar19 = pointIdx + 2 + (this->_vectorDeque2)._offset; *(undefined4 *) (*(int *)((int)(this->_vectorDeque2)._map + (uVar19 >> 1 & (this->_vectorDeque2)._mapSize - 1) * 4) + 4 + (uVar19 & 1) * 8) = 0; uVar19 = pointIdx + 1 + (this->_vectorDeque2)._offset; uVar16 = uVar19 & 1; iVar7 = *(int *)((int)(this->_vectorDeque2)._map + (uVar19 >> 1 & (this->_vectorDeque2)._mapSize - 1) * 4); *(float *)(iVar7 + uVar16 * 8) = *(float *)(iVar7 + uVar16 * 8) * 0.85; *(float *)(iVar7 + 4 + uVar16 * 8) = *(float *)(iVar7 + 4 + uVar16 * 8) * 0.85; } uVar19 = (this->_vectorDeque1)._offset; pointCount = (this->_vectorDeque1)._size; uVar16 = uVar19 + (pointCount - 3); iVar7 = *(int *)((int)(this->_vectorDeque1)._map + (uVar19 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); uVar14 = uVar16 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + (uVar16 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); segmentLength = *(float *)(iVar17 + 4 + uVar14 * 8) - *(float *)(iVar7 + 4 + (uVar19 & 1) * 8); fVar26 = *(float *)(iVar17 + uVar14 * 8) - *(float *)(iVar7 + (uVar19 & 1) * 8); segmentLength = sqrtf(segmentLength * segmentLength + fVar26 * fVar26); segmentLength = (segmentLength - 90.0) / 110.0; if (segmentLength <= 0.0) { segmentLength = 0.0; } if (1.0 <= segmentLength) { segmentLength = 1.0; } segmentLength = segmentLength + 0.0; if (segmentLength <= 0.0) { uVar19 = (this->_vectorDeque1)._size; } else { uVar19 = (this->_vectorDeque1)._offset; iVar17 = (this->_vectorDeque1)._size / 3 - 1; iVar7 = *(int *)((int)(this->_vectorDeque1)._map + (uVar19 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); uVar16 = (this->_vectorDeque1)._size; lerpT = ((float)(pointIdx / 3) + 0.0) / (float)((double)iVar17 + __uint_to_double_fixup[-(iVar17 >> 0x1f)]); lerpInvT = 1.0 - lerpT; fVar26 = *(float *)(iVar7 + 4 + (uVar19 & 1) * 8); uVar14 = (uVar16 - 3) + uVar19; uVar16 = (uVar19 - 1) + uVar16; uVar23 = uVar14 & 1; iVar17 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar14 >> 1) * 4); fVar27 = *(float *)(iVar17 + 4 + uVar23 * 8); uVar21 = pointIdx + 2 + uVar19; uVar20 = uVar19 + pointIdx & 1; iVar9 = *(int *)((int)(this->_vectorDeque1)._map + (uVar19 + pointIdx >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4); uVar15 = uVar21 >> 1; uVar21 = uVar21 & 1; fVar28 = *(float *)(iVar9 + 4 + uVar20 * 8); uVar14 = pointIdx + 1 + uVar19; uVar24 = uVar14 & 1; iVar10 = *(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar14 >> 1) * 4); fVar29 = *(float *)(iVar10 + 4 + uVar24 * 8); uVar14 = (this->_vectorDeque2)._offset; uVar22 = pointIdx + 2 + uVar14; uVar14 = pointIdx + 1 + uVar14; uVar18 = uVar14 >> 1; uVar14 = uVar14 & 1; iVar11 = *(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar18) * 4); fVar1 = *(float *)(iVar11 + 4 + uVar14 * 8); fVar2 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + (uVar16 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4) + (uVar16 & 1) * 8); fVar3 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar19 + 2 >> 1) * 4) + (uVar19 + 2 & 1) * 8); fVar4 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar15) * 4) + uVar21 * 8); fVar5 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & uVar15) * 4) + 4 + uVar21 * 8); fVar6 = *(float *)(*(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar22 >> 1) * 4) + 4 + (uVar22 & 1) * 8); iVar12 = *(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar18) * 4); *(float *)(iVar12 + uVar14 * 8) = *(float *)(iVar11 + uVar14 * 8) + (((lerpInvT * *(float *)(iVar7 + (uVar19 & 1) * 8) + lerpT * *(float *)(iVar17 + uVar23 * 8)) - *(float *)(iVar9 + uVar20 * 8)) * 0.8 - *(float *)(iVar10 + uVar24 * 8) * 0.8) * segmentLength * stepScale; *(float *)(iVar12 + 4 + uVar14 * 8) = fVar1 + (((lerpInvT * fVar26 + lerpT * fVar27) - fVar28) * 0.8 - fVar29 * 0.8) * segmentLength * stepScale; uVar19 = pointIdx + 2 + (this->_vectorDeque2)._offset; *(float *)(*(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar19 >> 1) * 4) + 4 + (uVar19 & 1) * 8) = (((lerpT * fVar2 + lerpInvT * fVar3) - fVar4) * 0.8 - fVar5 * 0.8) * segmentLength * stepScale + fVar6; uVar19 = (this->_vectorDeque1)._size; pointCount = uVar19; } pointIdx = uVar13; } while (uVar13 < uVar19); } if (isHalfScale == 0) { std::deque::assign(&this->_vectorDeque2); } return; } //@@ 004e9b10 Entity_NPC::render_overlay /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from NPC Render/RenderShadowLayer, static init prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_NPC::render_overlay(Entity_NPC *this,Vector *offset,byte isShadow) { float *pfVar1; void *pvVar2; Color *extraout_EAX; Color *baseColor; float *pfVar3; ColorMod *color; byte extraout_DL; byte isShadowTint; uint uVar4; uint uVar5; int layerId; uint uVar6; int iVar7; float fVar8; float fVar9; double dVar10; undefined1 auStack_134 [16]; float local_124; undefined1 local_11d; float totalLength; float local_118; float fStack_114; float local_110; float local_10c; float local_108; float cordLength; int beamLayerId; float local_fc; float local_f8; float local_f0 [2]; float local_e8; float fStack_e4; float fStack_e0; float fStack_dc; float local_d8; float fStack_d4; float fStack_d0; float fStack_cc; Color tmpColor; ColorMod headColor; ColorMod cordColor; uint local_44; local_44 = __security_cookie ^ (uint)auStack_134; if ((this->_vectorDeque2)._size != 0) { cordLength = 192.0; layerId = 2; iVar7 = this->_type; beamLayerId = 2; local_11d = 1; if (iVar7 == 0x3b6) { if ((this->_sprite)._animState._animData == (void *)0x0) { return; } pvVar2 = AnimationState::GetNullFrame(&(this->_sprite)._animState,(byte *)"CordPos"); if (pvVar2 == (void *)0x0) { return; } if (*(char *)((int)pvVar2 + 0xc) == '\0') { return; } cordLength = 76.0; } else { if (iVar7 == 0x361) { layerId = 0; local_11d = 0; } else if (iVar7 == 0x343) { layerId = 1; } beamLayerId = layerId; } if (layerId < (this->_sprite)._layerCount) { totalLength = 0.0; if (isShadow == 0) { Color::Color(&tmpColor); baseColor = extraout_EAX; isShadowTint = extraout_DL; } else { tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; baseColor = &tmpColor; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; isShadowTint = isShadow; } local_e8 = baseColor->_tint[0]; fStack_e4 = baseColor->_tint[1]; fStack_e0 = baseColor->_tint[2]; fStack_dc = baseColor->_tint[3]; cordColor._tint[0] = local_e8; cordColor._tint[1] = fStack_e4; cordColor._tint[2] = fStack_e0; cordColor._tint[3] = fStack_dc; local_d8 = baseColor->_colorize[0]; fStack_d4 = baseColor->_colorize[1]; fStack_d0 = baseColor->_colorize[2]; fStack_cc = baseColor->_colorize[3]; cordColor._colorize[0] = local_d8; cordColor._colorize[1] = fStack_d4; cordColor._colorize[2] = fStack_d0; cordColor._colorize[3] = fStack_cc; local_f0 = *(float (*) [2])baseColor->_offset; local_fc = baseColor->_offset[2]; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; if (isShadowTint == 0) { tmpColor._tint[0] = 0.3; tmpColor._tint[1] = 0.3; tmpColor._tint[2] = 0.3; } else { tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; } tmpColor._tint[3] = 1.0; headColor._tint[3] = 1.0; headColor._colorize[0] = 0.0; headColor._colorize[1] = 0.0; headColor._colorize[2] = 0.0; headColor._colorize[3] = 0.0; headColor._offset[2] = 0.0; headColor._offset[0] = 0.0; headColor._offset[1] = 0.0; iVar7 = *(int *)ThreadLocalStoragePointer; headColor._tint[0] = tmpColor._tint[0]; headColor._tint[1] = tmpColor._tint[1]; headColor._tint[2] = tmpColor._tint[2]; cordColor._offset._0_8_ = local_f0; cordColor._offset[2] = local_fc; if ((*(int *)(iVar7 + 0xc) < DAT_00c7f758) && (_Init_thread_header(), DAT_00c7f758 == -1)) { _atexit((_func_4879 *)&LAB_00b154f0); _Init_thread_footer(); } if ((*(int *)(iVar7 + 0xc) < DAT_00c7f768) && (_Init_thread_header(), DAT_00c7f768 == -1)) { _atexit((_func_4879 *)&LAB_00b15470); _Init_thread_footer(); } uVar6 = 0; DAT_00c7f760 = DAT_00c7f75c; g_npcTrailPointsEnd = DAT_00c7f76c; if ((this->_vectorDeque2)._size != 0) { do { pfVar3 = DAT_00c7f760; uVar5 = (this->_vectorDeque2)._offset + uVar6; uVar4 = uVar5 & 1; iVar7 = *(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar5 >> 1) * 4); local_118 = *(float *)(iVar7 + uVar4 * 8); fStack_114 = *(float *)(iVar7 + 4 + uVar4 * 8); local_10c = fStack_114; if (isShadow == 0) { uVar5 = (this->_vectorDeque2)._offset + 2 + uVar6; local_10c = fStack_114 + *(float *)(*(int *)((int)(this->_vectorDeque2)._map + ((this->_vectorDeque2)._mapSize - 1 & uVar5 >> 1) * 4) + (uVar5 & 1) * 8); } local_108 = g_displayPixelRatio * g_screenPointScale; local_124 = ((g_screenWidth - 338.0) * 0.5 + (local_118 - 60.0) * 0.65) * local_108 + 0.5; dVar10 = floor((double)local_124); local_f8 = (float)dVar10 / local_108; local_124 = ((g_screenHeight - 182.0) * 0.5 + (local_10c - 140.0) * 0.65) * local_108 + 0.5; dVar10 = floor((double)local_124); local_124 = (float)dVar10; local_118 = local_f8 + offset->x; fStack_114 = local_124 / local_108 + offset->y; if (pfVar3 == DAT_00c7f764) { std::vector::_Emplace_reallocate(pfVar3,&local_118); } else { *pfVar3 = local_118; DAT_00c7f760[1] = fStack_114; DAT_00c7f760 = DAT_00c7f760 + 2; } uVar6 = uVar6 + 3; } while (uVar6 < (this->_vectorDeque2)._size); } pvVar2 = g_npcTrailPointsEnd; local_118 = *DAT_00c7f75c; fStack_114 = DAT_00c7f75c[1]; local_110 = 0.0; if (g_npcTrailPointsEnd == DAT_00c7f774) { std::vector<12byte>::_Emplace_reallocate(g_npcTrailPointsEnd,&local_118); } else { *(undefined8 *)g_npcTrailPointsEnd = *(undefined8 *)DAT_00c7f75c; *(undefined4 *)((int)pvVar2 + 8) = 0; g_npcTrailPointsEnd = (void *)((int)g_npcTrailPointsEnd + 0xc); } uVar6 = 1; if (1 < ((int)DAT_00c7f760 - (int)DAT_00c7f75c >> 3) - 1U) { do { pvVar2 = g_npcTrailPointsEnd; local_f8 = DAT_00c7f75c[uVar6 * 2] * 0.4 + DAT_00c7f75c[uVar6 * 2 + -2] * 0.3 + DAT_00c7f75c[uVar6 * 2 + 2] * 0.3; fVar9 = *(float *)((int)g_npcTrailPointsEnd + -0xc) - local_f8; local_124 = DAT_00c7f75c[uVar6 * 2 + -1] * 0.3 + DAT_00c7f75c[uVar6 * 2 + 1] * 0.4 + DAT_00c7f75c[uVar6 * 2 + 3] * 0.3; fVar8 = *(float *)((int)g_npcTrailPointsEnd + -8) - local_124; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); totalLength = totalLength + fVar8; local_118 = local_f8; fStack_114 = local_124; local_110 = totalLength; if (pvVar2 == DAT_00c7f774) { std::vector<12byte>::_Emplace_reallocate(pvVar2,&local_118); } else { *(ulonglong *)pvVar2 = CONCAT44(local_124,local_f8); *(float *)((int)pvVar2 + 8) = totalLength; g_npcTrailPointsEnd = (void *)((int)g_npcTrailPointsEnd + 0xc); } uVar6 = uVar6 + 1; } while (uVar6 < ((int)DAT_00c7f760 - (int)DAT_00c7f75c >> 3) - 1U); } pvVar2 = g_npcTrailPointsEnd; pfVar1 = DAT_00c7f760; fVar8 = *(float *)((int)g_npcTrailPointsEnd + -8) - DAT_00c7f760[-1]; fVar9 = *(float *)((int)g_npcTrailPointsEnd + -0xc) - DAT_00c7f760[-2]; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); pfVar3 = pfVar1 + -2; local_118 = *pfVar3; totalLength = fVar8 + totalLength; fStack_114 = pfVar1[-1]; local_110 = totalLength; if (pvVar2 == DAT_00c7f774) { std::vector<12byte>::_Emplace_reallocate(pvVar2,&local_118); } else { *(undefined8 *)pvVar2 = *(undefined8 *)pfVar3; *(float *)((int)pvVar2 + 8) = totalLength; g_npcTrailPointsEnd = (void *)((int)g_npcTrailPointsEnd + 0xc); } local_10c = 1.0; local_108 = -NAN; fVar8 = cordLength; if (this->_type == 0x376) { if (0 < this->_projectileDelay) { local_108 = (float)(this->_projectileDelay / 2); } } else if (this->_type == 0x361) { uVar5 = 0; uVar6 = *(uint *)(*(int *)((int)(this->_sprite)._animState._animData + 0x18) + 8); if (uVar6 != 0) { pfVar3 = (float *)(*(int *)(*(int *)((int)(this->_sprite)._animState._animData + 0x18) + 4 ) + 0xc); do { if (totalLength <= *pfVar3) { if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)uVar5); } break; } uVar5 = uVar5 + 1; pfVar3 = pfVar3 + 0x1b; } while (uVar5 < uVar6); } headColor._offset[2] = local_fc; headColor._tint[0] = local_e8; headColor._tint[1] = fStack_e4; headColor._tint[2] = fStack_e0; headColor._tint[3] = fStack_dc; headColor._colorize[0] = local_d8; headColor._colorize[1] = fStack_d4; headColor._colorize[2] = fStack_d0; headColor._colorize[3] = fStack_cc; headColor._offset[0] = local_f0[0]; headColor._offset[1] = local_f0[1]; fVar8 = totalLength; if (this->_target != (EntityPtr)0x0) { local_10c = 0.9; fVar8 = totalLength; } } DAT_00c78ef0 = &this->_sprite; fVar8 = totalLength / fVar8; uVar6 = 0; DAT_00c78ef4 = beamLayerId; DAT_00c78ef8._0_1_ = local_11d; g_beamRendererPointsEnd = g_beamRendererPoints; DAT_00c78ef8._1_1_ = 1; if (1.0 <= fVar8) { fVar8 = 1.0; } iVar7 = (int)g_npcTrailPointsEnd - (int)DAT_00c7f76c >> 0x1f; if (((int)g_npcTrailPointsEnd - (int)DAT_00c7f76c) / 0xc + iVar7 != iVar7) { local_fc = fVar8 * local_10c; iVar7 = 0; do { color = &headColor; if (uVar6 != 0) { color = &cordColor; } if ((float)uVar6 == local_108) { fVar8 = 2.0; } else { fVar8 = 1.0; } BeamRenderer::Add((Vector *)(iVar7 + (int)DAT_00c7f76c),color,fVar8, local_10c - (1.0 - *(float *)(iVar7 + 8 + (int)DAT_00c7f76c) / totalLength) * local_fc); uVar6 = uVar6 + 1; iVar7 = iVar7 + 0xc; } while (uVar6 < (uint)(((int)g_npcTrailPointsEnd - (int)DAT_00c7f76c) / 0xc)); } BeamRenderer::End(); } } return; } //@@ 004ea3d0 NpcAI::ENTITY_VIS_FATTY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 886 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_VIS_FATTY(Entity_NPC *npc) { ANM2 *pAVar1; undefined1 *puVar2; byte bVar3; uint uVar4; Entity_NPC *linkedNpc; Vector *pVVar5; Entity *pEVar6; ColorMod *effectColor; float *pfVar7; char *anim; EntityPtr EVar8; ColorMod *extraout_EAX; ColorMod *extraout_EAX_00; LayerState *layer2; Entity_NPC *this; int iVar9; uint uVar10; uint uVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; Vector local_cc; Vector local_c4; byte isLayerFlipX; Vector local_b8; Vector local_b0; Vector local_a8; Vector local_a0; float local_98; Color bloodColor; std_string tmpAnimName; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 childPosY; int dstCordBlock; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af3d55; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_24 = uVar4; if (npc->_variant != 1) { puStack_20 = local_50 + 0x4c; if ((npc->_aiCallPhase == 1) && (((npc->_dead != 0 || (puStack_20 = local_50 + 0x4c, npc->_child == (EntityPtr)0x0)) && (puStack_20 = local_50 + 0x4c, npc->_i1 == 0)))) { npc->_i1 = 1; local_b0.y = 0.0; puStack_20 = local_50 + 0x4c; puVar2 = local_50 + 0x4c; if ((npc->_vectorDeque1)._size != 0) { do { puStack_20 = puVar2; local_b8.y = (float)(npc->_vectorDeque1)._offset; local_30 = 0.0; local_2c = 0.0; uVar10 = (int)local_b8.y + (int)local_b0.y & 1; local_28 = 0.0; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & (uint)((int)local_b8.y + (int)local_b0.y) >> 1) * 4); local_a8.x = *(float *)(iVar9 + uVar10 * 8); local_a8.y = *(float *)(iVar9 + 4 + uVar10 * 8); uVar10 = (int)local_b0.y + 2U + (int)local_b8.y; local_a0.y = *(float *)(*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar10 >> 1) * 4) + (uVar10 & 1) * 8); local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; uVar10 = Random(); pEVar6 = Game::Spawn(g_game,1000,2,&local_a8,&g_vectorZero,(Entity *)0x0,1,uVar10); (**(code **)(*(int *)pEVar6 + 0x3c))(local_50,0xffffffff,0xff,0,1); (pEVar6->_sprite)._offset.x = 0.0; (pEVar6->_sprite)._offset.y = local_a0.y; pEVar6->_renderDepthOffset = 10.0; uVar10 = Random(); pEVar6 = Game::Spawn(g_game,1000,7,&local_a8,&g_vectorZero,(Entity *)npc,0,uVar10); iVar9 = *(int *)pEVar6; (pEVar6->_sprite)._scale.x = 0.4; (pEVar6->_sprite)._scale.y = 0.4; (**(code **)(iVar9 + 0xc))(); local_b0.y = (float)((int)local_b0.y + 3); puVar2 = puStack_20; } while ((uint)local_b0.y < (npc->_vectorDeque1)._size); } std::deque::_Tidy(uVar4); } iVar9 = npc->_aiCallPhase; if (iVar9 == 1) { EVar8 = npc->_child; fVar12 = (npc->_pendingDamage + (npc->_v1).y) - npc->_speedMultiplier * 0.02; if (fVar12 <= 0.0) { fVar12 = 0.0; } (npc->_v1).y = fVar12; if (EVar8 != (EntityPtr)0x0) { fVar12 = (npc->_pos).x; pfVar7 = (float *)((int)EVar8 + 0x33c); isLayerFlipX = (*pfVar7 <= fVar12 && fVar12 != *pfVar7) ^ (npc->_sprite)._flipX; layer2 = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer2->_flipX = isLayerFlipX; } } else if (iVar9 != 2) { if (iVar9 == 3) { if (*(int *)((int)npc->_collisionEntity + 0x28) != 0x376) { ExceptionList = local_1c; return; } if (*(int *)((int)npc->_collisionEntity + 0x2c) == 1) { npc->_collisionResult = 0; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if ((npc->_state == 4) && (npc->_child == (EntityPtr)0x0)) { npc->_state = 0x10; npc->_projectileDelay = 0; Entity_NPC::PlaySound(npc,0x138,0.8,2,0,1.0); ANM2::Play(&npc->_sprite,(byte *)"RageStart",0); pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar12 = 0.70710677; fVar15 = 0.70710677; if (0.0 < (pEVar6->_pos).x - (npc->_pos).x) { fVar12 = -0.70710677; } if (0.0 < (pEVar6->_pos).y - (npc->_pos).y) { fVar15 = -0.70710677; } (npc->_targetPosition).x = fVar12; (npc->_targetPosition).y = fVar15; fVar12 = atan2f(fVar15,fVar12); fVar12 = fVar12 * 57.295776 + 180.0; effectColor = (ColorMod *)Color::Color(0x3f4ccccd); local_a0.y = fVar12 * 0.017453292; local_a8.y = sin(local_a0.y); local_a0.x = cos(local_a0.y); local_a0.y = local_a8.y; local_a8.x = 0.0; local_a8.y = -20.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_a8,&local_a0,0x1e,effectColor,4.0); fVar12 = npc->_maxHitPoints; if (npc->_health < fVar12) { local_a0.y = fVar12 * 0.25 + npc->_health; pfVar7 = &local_a0.y; if (fVar12 < local_a0.y) { pfVar7 = &npc->_maxHitPoints; } npc->_health = *pfVar7; } } uVar4 = Random(); if (uVar4 % 10 == 0) { uVar4 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } switch(npc->_state) { case 0: if (npc->_subtype == 0) { uVar4 = RNG::Next(&npc->_dropRNG); uVar10 = Random(); local_a0.x = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)] ) * 2.3283064e-10 * 40.0 - 20.0) + (npc->_pos).x; local_a0.y = (npc->_pos).y + 20.0; pEVar6 = Game::Spawn(g_game,0x376,1,&local_a0,&g_vectorZero,(Entity *)npc,0,uVar4); Entity::SetChild((Entity *)npc,pEVar6); Entity::SetParent(pEVar6,(Entity *)npc); npc->_subtype = 1; } npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)"WalkVert",0); ANM2::PlayOverlay(&npc->_sprite,&DAT_00b1d20c,0); layer2 = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer2->_visible = 0; if (npc->_child != (EntityPtr)0x0) { uVar4 = 0; do { local_a0.y = (npc->_pos).y; local_a0.x = (npc->_pos).x; fVar12 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) / 5.0; local_a0.y = (*(float *)((int)npc->_child + 0x340) - local_a0.y) * fVar12 + local_a0.y; local_a0.x = (*(float *)((int)npc->_child + 0x33c) - local_a0.x) * fVar12 + local_a0.x; std::deque::push_back(&local_a0); local_a8.x = 0.0; local_a8.y = 0.0; std::deque::push_back(&local_a8); local_cc.x = -20.0; local_cc.y = 0.0; std::deque::push_back(&local_cc); uVar4 = uVar4 + 1; } while (uVar4 < 6); std::deque::assign(&npc->_vectorDeque1); iVar9 = 10; do { Entity_NPC::UpdateCordChain(npc,0); iVar9 = iVar9 + -1; } while (iVar9 != 0); } npc->_aiCallFlags = npc->_aiCallFlags | 7; break; case 4: std::string::string_from_cstr(local_50 + 0x14,(byte *)"WalkVert"); local_14 = 0; std::string::string_from_cstr(tmpAnimName._buf,(byte *)"WalkHori"); local_14 = CONCAT31(local_14._1_3_,1); Entity_NPC::AnimWalkFrame(npc,&tmpAnimName,(std_string *)(local_50 + 0x14),0.1); std::string::_Tidy_deallocate(tmpAnimName._buf); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_50 + 0x14); bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar3 == 0) { bVar3 = 1; iVar9 = 900; fVar12 = 0.3; pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_b8,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar5,fVar12,iVar9,bVar3); linkedNpc = Entity_NPC::ChildNPC(npc); if (((linkedNpc != (Entity_NPC *)0x0) && (linkedNpc = Entity_NPC::ChildNPC(npc), linkedNpc->_state == 8)) && ((linkedNpc = Entity_NPC::ChildNPC(npc), 0x1a < linkedNpc->_projectileCooldown && ((uVar4 = Random(), uVar4 % 7 == 0 || (7.0 < (npc->_v1).y)))))) { (npc->_v1).y = 0.0; npc->_state = 8; Entity_NPC::PlaySound(npc,0xa7,1.0,2,0,1.0); std::string::string_from_cstr(tmpAnimName._buf,(byte *)"AttackVert"); local_14 = 2; std::string::string_from_cstr(local_50 + 0x14,(byte *)"AttackHori"); local_14 = CONCAT31(local_14._1_3_,3); Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_50 + 0x14),&tmpAnimName,0.0); std::string::_Tidy_deallocate(local_50 + 0x14); local_14 = 0xffffffff; std::string::_Tidy_deallocate(tmpAnimName._buf); } } else { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_a0.x = (pEVar6->_pos).x; local_a0.y = (pEVar6->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_a0,0); iVar9 = (npc->_pathfinder)._evadeMovementCountdown; fVar12 = npc->_friction * 0.8; npc->_friction = fVar12; if (0 < iVar9) { npc->_friction = fVar12 * 0.8; } } if (((npc->_pathfinder)._hasDirectPath != 0) && (uVar4 = Random(), uVar4 % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,1.0,0x3c,0,1.0); } break; case 8: npc->_friction = npc->_friction * 0.8; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { pVVar5 = &npc->_pos; Game::ButterBeanFart(g_game,pVVar5,120.0,(Entity *)npc,0,0); uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x22,pVVar5,&g_vectorZero,(Entity *)0x0,0,uVar4); local_30 = 0.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_50._16_4_ = 0.8; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 1.0; local_2c = 0.0; local_28 = 0.0; (**(code **)(*(int *)pEVar6 + 0x3c))(local_50,0xffffffff,0xff,0,1); uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x16,pVVar5,&g_vectorZero,(Entity *)npc,0,uVar4); fVar12 = g_vectorOne.y * 2.0; iVar9 = *(int *)pEVar6; (pEVar6->_sprite)._scale.x = g_vectorOne.x * 2.0; pAVar1 = &pEVar6[1]._sprite; (pAVar1->_filename)._buf[8] = -0x6a; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (pEVar6->_sprite)._scale.y = fVar12; pAVar1 = &pEVar6[1]._sprite; (pAVar1->_filename)._buf[0xc] = -0x6a; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (**(code **)(iVar9 + 0xc))(); (npc->_v1).x = 1.5; linkedNpc = Entity_NPC::ChildNPC(npc); if (((linkedNpc != (Entity_NPC *)0x0) && (linkedNpc->_state == 8)) && (0 < linkedNpc->_projectileCooldown)) { linkedNpc->_projectileCooldown = linkedNpc->_projectileCooldown + 0xf; } npc->_projectileDelay = 1; } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { npc->_state = 4; } break; case 0x10: bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { ANM2::Play(&npc->_sprite,(byte *)"RageDown",0); } bVar3 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if (bVar3 == 0) { npc->_friction = npc->_friction * 0.8; } else { npc->_entityGridCollisionClass = 3; fVar12 = *(float *)((int)npc->_config + 0x44); npc->_friction = 0.95; npc->_mass = fVar12 * 6.0; local_a0.x = (npc->_targetPosition).x * 0.55; local_a0.y = (npc->_targetPosition).y * 0.55; Entity::AddVelocity((Entity *)npc,&local_a0,0); anim = "RageUp"; if ((npc->_targetPosition).y <= 0.0) { anim = "RageDown"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); fVar12 = (npc->_targetPosition).x; (npc->_sprite)._flipX = fVar12 < 0.0; fVar12 = atan2f((npc->_targetPosition).y,fVar12); local_cc.y = *(float *)&npc->_entityRef; local_a8.y = fVar12 * 57.295776 + 180.0; if (((EntityPtr)local_cc.y == (EntityPtr)0x0) || (*(int *)((int)local_cc.y + 0x28) != 7)) { local_a0.x = 0.0; local_a0.y = -31.0; EVar8 = (EntityPtr) Entity_Laser::ShootAngle(1,&npc->_pos,local_a8.y,10,&local_a0,(Entity *)npc,0); local_cc.y = (float)EVar8; Entity_NPC::SetRef_bec(npc,(Entity *)EVar8); *(byte *)((int)EVar8 + 0x45d) = 1; (**(code **)(*(int *)EVar8 + 0xc))(); } bVar3 = Entity::IsFrame((Entity *)npc,2,0); if (bVar3 != 0) { uVar4 = Random(); local_98 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 20.0 + (local_a8.y - 10.0)) * 0.017453292; uVar4 = Random(); local_b0.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; fVar12 = cos(local_98); local_b8.x = fVar12 * local_b0.y + (npc->_velocity).x; local_a0.y = local_b8.x; fVar12 = sin(local_98); local_b8.y = fVar12 * local_b0.y + (npc->_velocity).y; local_98 = local_b8.y; uVar4 = Random(); local_b0.x = local_a0.y + (npc->_pos).x; local_b0.y = local_98 + (npc->_pos).y; pEVar6 = Game::Spawn(g_game,1000,0x6f,&local_b0,&local_b8,(Entity *)0x0,0,uVar4); uVar4 = Random(); fVar12 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.6; fVar15 = fVar12 * g_vectorOne.y; fVar12 = fVar12 * g_vectorOne.x; (pEVar6->_posOffset).x = 0.0; (pEVar6->_sprite)._scale.y = fVar15; (pEVar6->_posOffset).y = -31.0; (pEVar6->_sprite)._scale.x = fVar12; } fVar12 = local_cc.y; if (*(float *)((int)local_cc.y + 0x41c) != local_a8.y) { fVar15 = local_a8.y; Entity_Laser::ClearLaserSamples((Entity_Laser *)local_cc.y); Entity_NPC::SetAimAngle(this,fVar15); (**(code **)(*(int *)fVar12 + 0xc))(); } *(undefined4 *)((int)fVar12 + 0x458) = 10; if ((npc->_targetPosition).y <= 0.5) { *(undefined4 *)((int)fVar12 + 0x358) = 0x453b8000; } else { *(undefined4 *)((int)fVar12 + 0x358) = 0xc1200000; } } if (npc->_collidesWithGrid != 0) { fVar12 = (npc->_targetPosition).x; if (((0.0 < fVar12) && (0.2 < (npc->_gridCollisionNormal).x)) || ((fVar12 < 0.0 && ((npc->_gridCollisionNormal).x <= -0.2 && (npc->_gridCollisionNormal).x != -0.2)))) { (npc->_targetPosition).x = -fVar12; } fVar12 = (npc->_targetPosition).y; if (((0.0 < fVar12) && (0.2 < (npc->_gridCollisionNormal).y)) || ((fVar12 < 0.0 && (pfVar7 = &(npc->_gridCollisionNormal).y, *pfVar7 <= -0.2 && *pfVar7 != -0.2)))) { (npc->_targetPosition).y = -fVar12; } fVar12 = (npc->_gridCollisionVelocity).y; fVar15 = (npc->_gridCollisionVelocity).x; fVar12 = sqrtf(fVar15 * fVar15 + fVar12 * fVar12); Vector::Resize(&npc->_velocity,fVar12); } } fVar12 = (npc->_v1).x; if ((0.0 < fVar12) && (npc->_projectileDelay < 1)) { fVar12 = fVar12 - npc->_speedMultiplier * 0.03; if (fVar12 <= 0.0) { fVar12 = 0.0; } (npc->_v1).x = fVar12; } if (npc->_child == (EntityPtr)0x0) { ExceptionList = local_1c; return; } if (npc->_projectileDelay < 1) { ExceptionList = local_1c; return; } fVar12 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_98 = 0.0; local_b0.y = fVar12; if ((int)fVar12 < 1) { ExceptionList = local_1c; return; } do { npc->_projectileDelay = npc->_projectileDelay + 1; if ((npc->_projectileDelay & 1) == 0) { Entity_NPC::PlaySound(npc,0xb9,0.8,2,0,1.0); fVar12 = (float)(npc->_projectileDelay / 2); local_a0.y = (float)((npc->_vectorDeque1)._size / 3); if ((uint)local_a0.y <= (uint)fVar12) { npc->_projectileDelay = 0; ExceptionList = local_1c; return; } local_a8.y = (float)((int)fVar12 * 3); uVar4 = (npc->_vectorDeque1)._offset + (int)local_a8.y; uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar4 >> 1) * 4); local_c4.x = *(float *)(iVar9 + uVar10 * 8); local_c4.y = *(float *)(iVar9 + 4 + uVar10 * 8); if (fVar12 == (float)((int)local_a0.y - 1U)) { uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x16,&local_c4,&g_vectorZero,(Entity *)npc,0,uVar4); fVar12 = g_vectorOne.y * 1.5; iVar9 = *(int *)pEVar6; (pEVar6->_sprite)._scale.x = g_vectorOne.x * 1.5; pAVar1 = &pEVar6[1]._sprite; (pAVar1->_filename)._buf[8] = 'Z'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (pEVar6->_sprite)._scale.y = fVar12; pAVar1 = &pEVar6[1]._sprite; (pAVar1->_filename)._buf[0xc] = 'Z'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (**(code **)(iVar9 + 0xc))(); Color::Color((Color *)local_50); local_a0.y = (float)(npc->_vectorDeque1)._offset; uVar4 = (int)local_a8.y + 2 + (int)local_a0.y; local_b8.x = 0.0; iVar9 = 3; local_b8.y = *(float *)(*(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4) + (uVar4 & 1) * 8); pVVar5 = &local_b8; effectColor = extraout_EAX; } else { uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x16,&local_c4,&g_vectorZero,(Entity *)npc,0,uVar4); fVar12 = g_vectorOne.y * 0.5; iVar9 = *(int *)pEVar6; (pEVar6->_sprite)._scale.x = g_vectorOne.x * 0.5; pAVar1 = &pEVar6[1]._sprite; (pAVar1->_filename)._buf[8] = '<'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (pEVar6->_sprite)._scale.y = fVar12; pAVar1 = &pEVar6[1]._sprite; (pAVar1->_filename)._buf[0xc] = '<'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (**(code **)(iVar9 + 0xc))(); Color::Color(&bloodColor); local_a0.y = (float)(npc->_vectorDeque1)._offset; uVar4 = (int)local_a8.y + 2 + (int)local_a0.y; local_cc.x = 0.0; iVar9 = 2; local_cc.y = *(float *)(*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar4 >> 1) * 4) + (uVar4 & 1) * 8); pVVar5 = &local_cc; effectColor = extraout_EAX_00; } pEVar6 = spawn_blood_explosion(iVar9,&local_c4,pVVar5,effectColor,&g_vectorZero); pEVar6->_renderDepthOffset = 60.0; fVar12 = local_b0.y; } local_98 = (float)((int)local_98 + 1); } while ((int)local_98 < (int)fVar12); ExceptionList = local_1c; return; } if (npc->_child == (EntityPtr)0x0) { ExceptionList = local_1c; return; } Entity::GetNullOffset((Entity *)npc,&local_b8,(byte *)"CordPos"); uVar4 = (npc->_vectorDeque1)._offset; fVar12 = (npc->_pos).y; uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar9 + uVar10 * 8) = local_b8.x + (npc->_pos).x; *(float *)(iVar9 + 4 + uVar10 * 8) = fVar12 + 0.0; uVar4 = (npc->_vectorDeque1)._offset + 1; uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar9 + uVar10 * 8) = (npc->_velocity).x; *(float *)(iVar9 + 4 + uVar10 * 8) = (npc->_velocity).y; local_c4.y = (float)(npc->_vectorDeque1)._offset; uVar4 = (int)local_c4.y + 2U & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + ((int)local_c4.y + 2U >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar9 + uVar4 * 8) = local_b8.y; *(undefined4 *)(iVar9 + 4 + uVar4 * 8) = 0; uVar4 = ((npc->_vectorDeque1)._size - 3) + (npc->_vectorDeque1)._offset; childPosY = *(undefined4 *)((int)npc->_child + 0x340); uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(undefined4 *)(iVar9 + uVar10 * 8) = *(undefined4 *)((int)npc->_child + 0x33c); *(undefined4 *)(iVar9 + 4 + uVar10 * 8) = childPosY; uVar4 = ((npc->_vectorDeque1)._size - 2) + (npc->_vectorDeque1)._offset; fVar12 = *(float *)((int)npc->_child + 0x364); uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar4 >> 1) * 4); *(float *)(iVar9 + uVar10 * 8) = *(float *)((int)npc->_child + 0x360) * 0.2; *(float *)(iVar9 + 4 + uVar10 * 8) = fVar12 * 0.2; uVar4 = ((npc->_vectorDeque1)._size - 1) + (npc->_vectorDeque1)._offset; uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar4 >> 1) * 4); *(undefined4 *)(iVar9 + uVar10 * 8) = 0xc1a00000; *(undefined4 *)(iVar9 + 4 + uVar10 * 8) = 0; if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 2)) { local_98 = 1.4013e-45; local_b0.y = 4.2039e-45; do { uVar4 = (npc->_vectorDeque1)._offset; uVar10 = uVar4 & 1; fVar12 = *(float *)((int)npc->_child + 0x340); iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); fVar15 = *(float *)(iVar9 + 4 + uVar10 * 8); fVar14 = (float)((double)(int)local_98 + __uint_to_double_fixup[-((int)local_98 >> 0x1f)]) / 5.0; fVar16 = *(float *)(iVar9 + 4 + uVar10 * 8); uVar11 = (int)local_b0.y + uVar4 & 1; dstCordBlock = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & (int)local_b0.y + uVar4 >> 1) * 4); *(float *)(dstCordBlock + uVar11 * 8) = (*(float *)((int)npc->_child + 0x33c) - *(float *)(iVar9 + uVar10 * 8)) * fVar14 + *(float *)(iVar9 + uVar10 * 8); *(float *)(dstCordBlock + 4 + uVar11 * 8) = (fVar12 - fVar15) * fVar14 + fVar16; uVar4 = (int)local_b0.y + 1U + (npc->_vectorDeque1)._offset; uVar10 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(undefined4 *)(iVar9 + uVar10 * 8) = 0; *(undefined4 *)(iVar9 + 4 + uVar10 * 8) = 0; uVar10 = (npc->_vectorDeque1)._offset; uVar4 = uVar10 + 2; uVar11 = uVar4 & 1; iVar9 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar4 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); uVar10 = (int)local_b0.y + 2U + uVar10; uVar4 = uVar10 & 1; local_98 = (float)((int)local_98 + 1); dstCordBlock = *(int *)((int)(npc->_vectorDeque1)._map + (uVar10 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(dstCordBlock + uVar4 * 8) = (-20.0 - *(float *)(iVar9 + uVar11 * 8)) * fVar14 + *(float *)(iVar9 + uVar11 * 8); *(undefined4 *)(dstCordBlock + 4 + uVar4 * 8) = 0; local_b0.y = (float)((int)local_b0.y + 3); } while ((uint)local_b0.y < 0x12); std::deque::assign(&npc->_vectorDeque1); } else { Entity_NPC::UpdateCordChain(npc,npc->_aiCallPhase == 2); } EVar8 = npc->_child; local_a8.y = *(float *)((int)EVar8 + 0x340) - (npc->_pos).y; local_a0.y = *(float *)((int)EVar8 + 0x33c) - (npc->_pos).x; fVar12 = sqrtf(local_a8.y * local_a8.y + local_a0.y * local_a0.y); if ((((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)EVar8 + 0x28) != 1)) && (0x3dd < *(int *)((int)EVar8 + 0x28) - 10U)) || (*(int *)((int)EVar8 + 0xb64) != 8)) { fVar16 = 0.1; fVar15 = ((npc->_v1).x + 1.0) * 75.0; } else { fVar16 = 0.3; fVar15 = ((npc->_v1).x + 1.0) * 105.0; } if (fVar15 < fVar12) { fVar14 = npc->_speedMultiplier; fVar13 = (local_a0.y / fVar12) * (fVar12 - fVar15) * fVar16; fVar16 = (local_a8.y / fVar12) * (fVar12 - fVar15) * fVar16; (npc->_velocity).x = fVar13 * 0.3 * fVar14 + (npc->_velocity).x; (npc->_velocity).y = fVar16 * 0.3 * fVar14 + (npc->_velocity).y; EVar8 = npc->_child; *(float *)((int)EVar8 + 0x360) = *(float *)((int)EVar8 + 0x360) - *(float *)((int)EVar8 + 0x39c) * fVar13; *(float *)((int)EVar8 + 0x364) = *(float *)((int)EVar8 + 0x364) - *(float *)((int)EVar8 + 0x39c) * fVar16; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } npc->_friction = npc->_friction * 0.8; switch(npc->_state) { case 0: puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,(byte *)"Walk01",0); npc->_state = 4; npc->_projectileCooldown = 0xf; break; case 4: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = local_50 + 0x4c, (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,(byte *)"Walk01",0); } if (npc->_parent == (EntityPtr)0x0) { ANM2::Play(&npc->_sprite,&DAT_00b1e11c,0); fVar12 = npc->_maxHitPoints; npc->_state = 7; if (npc->_health < fVar12) { fVar15 = fVar12 * 0.25 + npc->_health; if (fVar15 <= fVar12) { fVar12 = fVar15; } npc->_health = fVar12; } break; } pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_b8,0.0); local_b0.y = pVVar5->x - (npc->_pos).x; local_a8.y = pVVar5->y - (npc->_pos).y; local_a8.x = local_b0.y; local_a0.y = local_a8.y; pEVar6 = Entity_NPC::GetPlayerTarget(npc); pVVar5 = Vector::Resized(&local_a8,&local_b8,0.8); fVar12 = npc->_speedMultiplier; fVar15 = pVVar5->y; (npc->_velocity).x = fVar12 * pVVar5->x + (npc->_velocity).x; (npc->_velocity).y = fVar15 * fVar12 + (npc->_velocity).y; fVar12 = *(float *)((int)npc->_parent + 0x340) - (pEVar6->_pos).y; fVar15 = *(float *)((int)npc->_parent + 0x33c) - (pEVar6->_pos).x; local_98 = sqrtf(fVar12 * fVar12 + fVar15 * fVar15); if (((0 < npc->_projectileCooldown) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 != 0)) || (((57600.0 <= local_98 || (uVar4 = Random(), uVar4 % 5 != 0)) && (((linkedNpc = Entity_NPC::ParentNPC(npc), (linkedNpc->_v1).y <= 7.0 || (160000.0 <= local_98)) || (uVar4 = Random(), uVar4 % 3 != 0)))))) break; npc->_state = 8; ANM2::Play(&npc->_sprite,&DAT_00b1e11c,0); local_a8.y = (pEVar6->_pos).x; local_cc.y = (pEVar6->_pos).y; fVar15 = (npc->_pos).x - local_a8.y; fVar12 = (npc->_pos).y - local_cc.y; fVar12 = sqrtf(fVar12 * fVar12 + fVar15 * fVar15); local_a8.x = ((pEVar6->_velocity).x * fVar12 * 0.2 + local_a8.y) - (npc->_pos).x; local_a8.y = ((pEVar6->_velocity).y * fVar12 * 0.2 + local_cc.y) - (npc->_pos).y; pVVar5 = Vector::Normalized(&local_a8,&local_b8); (npc->_targetPosition).x = pVVar5->x; (npc->_targetPosition).y = pVVar5->y; uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0xf + 0x1e; local_98 = local_b0.y; if (ABS(local_b0.y) <= ABS(local_a0.y)) break; goto LAB_004eaad1; case 7: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = local_50 + 0x4c, (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,&DAT_00b1e114,0); } pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_b8,0.0); fVar12 = npc->_speedMultiplier; local_98 = pVVar5->x - (npc->_pos).x; local_b0.y = pVVar5->y - (npc->_pos).y; fVar15 = 1.1764705; if (fVar12 != 1.0) { fVar15 = 1.1764705 / ((fVar12 + 1.1764705) - fVar12 * 1.1764705); } local_a0.y = fVar15 * (npc->_velocity).x; (npc->_velocity).y = fVar15 * (npc->_velocity).y; (npc->_velocity).x = local_a0.y; fVar16 = sqrtf(local_98 * local_98 + local_b0.y * local_b0.y); fVar12 = local_98; fVar15 = local_b0.y; if (0.0 < fVar16) { fVar12 = local_98 * (0.5 / fVar16); fVar15 = local_b0.y * (0.5 / fVar16); } fVar16 = npc->_friction; if (fVar16 != 0.0) { fVar14 = npc->_speedMultiplier; (npc->_velocity).x = (fVar12 * fVar14) / fVar16 + local_a0.y; (npc->_velocity).y = (fVar15 * fVar14) / fVar16 + (npc->_velocity).y; } npc->_mass = 8.0; if (ABS(local_98) <= ABS(local_b0.y)) break; LAB_004eaad1: (npc->_sprite)._flipX = local_98 < 0.0; break; case 8: if (npc->_parent == (EntityPtr)0x0) { npc->_state = 7; } else { bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x92,1.0,2,0,1.0); } iVar9 = npc->_projectileCooldown; if (iVar9 < 1) { ANM2::Play(&npc->_sprite,(byte *)"RageEnd",0); uVar4 = Random(); npc->_state = 4; npc->_projectileCooldown = uVar4 % 0x1e + 0x3c; } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,&DAT_00b1e114,0); iVar9 = npc->_projectileCooldown; } if (iVar9 < 0x14) { pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_b8,0.0); local_c4.x = pVVar5->x - *(float *)((int)npc->_parent + 0x33c); local_c4.y = pVVar5->y - *(float *)((int)npc->_parent + 0x340); pVVar5 = Vector::Normalized(&local_c4,&local_b8); local_c4.x = pVVar5->x * 0.5 * npc->_speedMultiplier + (npc->_targetPosition).x; local_c4.y = pVVar5->y * 0.5 * npc->_speedMultiplier + (npc->_targetPosition).y; pVVar5 = Vector::Normalized(&local_c4,&local_a0); (npc->_targetPosition).x = pVVar5->x; (npc->_targetPosition).y = pVVar5->y; } fVar12 = (npc->_targetPosition).y; fVar15 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_targetPosition).x * 2.6 * fVar15 + (npc->_velocity).x; (npc->_velocity).y = fVar12 * 2.6 * fVar15 + (npc->_velocity).y; } } } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } ExceptionList = local_1c; return; } //@@ 004ec240 NpcAI::ENTITY_EXORCIST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 832 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_EXORCIST(Entity_NPC *npc) { byte bVar1; int iVar2; Vector *vecResult; uint uVar3; EntityPtr tmpEntity; uint seed; Entity *pEVar4; void *freeBlock; EntityPtr *refSlot; float fVar5; float fVar6; Vector spawnPos; Vector VStack_68; float bestDistSq; Vector VStack_5c; Vector VStack_54; EntityPtr *pEStack_4c; EntityPtr EStack_48; void *walkHoriAnim; char acStack_40 [4]; EntityList_EL EStack_3c; void *walkVertAnim; char acStack_28 [4]; undefined1 auStack_24 [12]; float fStack_18; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; qword flags; uint *flagsHighPtr; Manager *manager; uStack_8 = 0xffffffff; puStack_c = &LAB_00af3da5; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(auStack_24 + 0x20); ExceptionList = &local_10; if (npc->_variant == 1) { ENTITY_FACELESS(npc); ExceptionList = local_10; return; } switch(npc->_state) { case 0: npc->_state = 4; ANM2::PlayOverlay(&npc->_sprite,s_Head,0); ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); uVar3 = Random(); npc->_i1 = uVar3 % 0x1e + 0xf; break; case 4: fStack_18 = 2.10195e-44; auStack_24._8_4_ = 1.12104e-44; walkVertAnim = (void *)0x6b6c6157; builtin_strncpy(acStack_28,"Vert",4); auStack_24[0] = '\0'; EStack_3c._size = 0xf; EStack_3c._capacity = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(acStack_40,"Hori",4); EStack_3c._0_1_ = '\0'; uStack_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&walkVertAnim,0.1); uStack_8 = uStack_8 & 0xffffff00; if (0xf < (uint)EStack_3c._size) { uVar3 = EStack_3c._size + 1; freeBlock = walkHoriAnim; if (0xfff < uVar3) { freeBlock = *(void **)((int)walkHoriAnim + -4); uVar3 = EStack_3c._size + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)freeBlock))) goto LAB_004ec3b9; } operator_delete(freeBlock,uVar3); } uStack_8 = 0xffffffff; EStack_3c._capacity = 0; EStack_3c._size = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < (uint)fStack_18) { uVar3 = (int)fStack_18 + 1; freeBlock = walkVertAnim; if (0xfff < uVar3) { freeBlock = *(void **)((int)walkVertAnim + -4); uVar3 = (int)fStack_18 + 0x24; if (0x1f < (uint)((int)walkVertAnim + (-4 - (int)freeBlock))) { LAB_004ec3b9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } ANM2::PlayOverlay(&npc->_sprite,s_Head,0); pEStack_4c = (EntityPtr *)0x0; iVar2 = Entity::GetIntervalTicks((Entity *)npc,30.0,0.0); if ((iVar2 != 0) && (uVar3 = Random(), uVar3 % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,0.8,0x78,0,1.0); } iVar2 = Entity::GetIntervalTicks((Entity *)npc,5.0,0.0); if (iVar2 != 0) { tmpEntity = npc->_entityRef; if (tmpEntity != (EntityPtr)0x0) { fVar5 = (npc->_targetPosition).y - *(float *)((int)tmpEntity + 0x340); fVar6 = (npc->_targetPosition).x - *(float *)((int)tmpEntity + 0x33c); if (6400.0 <= fVar5 * fVar5 + fVar6 * fVar6) { LAB_004ec4a2: VStack_68.y = (float)&npc->_entityRef; std::multiset::erase(&VStack_68.y); } else { bVar1 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&npc->_targetPosition,0); if (bVar1 != 0) goto LAB_004ec4bf; if (npc->_entityRef != (EntityPtr)0x0) goto LAB_004ec4a2; } npc->_entityRef = (EntityPtr)0x0; } } LAB_004ec4bf: if (npc->_entityRef == (EntityPtr)0x0) { iVar2 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (iVar2 != 0) { uVar3 = Random(); if ((EntityPtr)(uVar3 % 3) == (EntityPtr)0x0) { VStack_68.y = 0.0; bestDistSq = 40000.0; EStack_48 = (EntityPtr)(uVar3 % 3); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&EStack_3c,1000,0x90,0,0,0); uVar3 = 0; uStack_8 = 2; if (EStack_3c._size != 0) { do { tmpEntity = *(EntityPtr *)((int)EStack_3c._data + uVar3 * 4); fStack_18 = *(float *)((int)tmpEntity + 0x340); auStack_24._8_4_ = *(float *)((int)tmpEntity + 0x33c); Room::FindFreePickupSpawnPosition (g_game->_room,&VStack_5c,(Vector *)(auStack_24 + 8),0.0,0,0,0); fVar5 = (npc->_pos).x - VStack_5c.x; fVar6 = (npc->_pos).y - VStack_5c.y; VStack_54.y = fVar6 * fVar6 + fVar5 * fVar5; if (((VStack_54.y < bestDistSq) && (fVar5 = *(float *)((int)tmpEntity + 0x33c) - VStack_5c.x, fVar6 = *(float *)((int)tmpEntity + 0x340) - VStack_5c.y, fVar6 * fVar6 + fVar5 * fVar5 < 6400.0)) && (bVar1 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&VStack_5c,0), bVar1 != 0 )) { VStack_68.y = VStack_5c.x; pEStack_4c = (EntityPtr *)VStack_5c.y; bestDistSq = VStack_54.y; EStack_48 = tmpEntity; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)EStack_3c._size); refSlot = &npc->_entityRef; if (EStack_48 != (EntityPtr)0x0) { if (*refSlot != (EntityPtr)0x0) { VStack_54.y = (float)refSlot; std::multiset::erase(&VStack_54.y); } *refSlot = EStack_48; std::multiset::insert(refSlot); (npc->_targetPosition).x = VStack_68.y; (npc->_targetPosition).y = (float)pEStack_4c; } } uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&EStack_3c); } } if (npc->_entityRef != (EntityPtr)0x0) goto LAB_004ec6a6; pEVar4 = Entity_NPC::GetPlayerTarget(npc); VStack_5c.x = (pEVar4->_pos).x; VStack_5c.y = (pEVar4->_pos).y; tmpEntity = npc->_child; if (tmpEntity == (EntityPtr)0x0) { bVar1 = 0; vecResult = Entity_NPC::CalcTargetPosition(npc,(Vector *)(auStack_24 + 8),0.0); PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,vecResult,bVar1); npc->_friction = npc->_friction * 0.8; } else { VStack_54.y = *(float *)((int)tmpEntity + 0x33c); pEStack_4c = *(EntityPtr **)((int)tmpEntity + 0x340); auStack_24._8_4_ = VStack_54.y - VStack_5c.x; fStack_18 = (float)pEStack_4c - VStack_5c.y; vecResult = Vector::Resized((Vector *)(auStack_24 + 8),&VStack_68,80.0); auStack_24._8_4_ = VStack_54.y + vecResult->x; fStack_18 = (float)pEStack_4c + vecResult->y; Room::GetClampedPositionImpl (g_game->_room,&VStack_54,(Vector *)(auStack_24 + 8),5.0,5.0,5.0,5.0); VStack_5c.x = VStack_54.x; VStack_5c.y = VStack_54.y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&VStack_5c,0.85,0,1); } } else { LAB_004ec6a6: refSlot = &npc->_entityRef; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&npc->_targetPosition,0.85,0,1); fVar5 = (npc->_targetPosition).x - (npc->_pos).x; fVar6 = (npc->_targetPosition).y - (npc->_pos).y; if (fVar6 * fVar6 + fVar5 * fVar5 <= 225.0) { if (*refSlot != (EntityPtr)0x0) { VStack_54.y = (float)refSlot; std::multiset::erase(&VStack_54.y); } *refSlot = (EntityPtr)0x0; AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,(byte *)"Revive",0); npc->_state = 9; break; } } if (((npc->_i1 < 1) && (uVar3 = Random(), uVar3 % 10 == 0)) && (npc->_child == (EntityPtr)0x0)) { AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,(byte *)"Revive",0); npc->_state = 8; } break; case 8: case 9: ANM2::Play(&npc->_sprite,(byte *)"Revive",0); npc->_friction = npc->_friction * 0.6; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Revive"); if (bVar1 != 0) { if (npc->_state == 8) { Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_24 + 8),&npc->_pos,40.0,1,1,0); Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); uVar3 = Random(); tmpEntity = (EntityPtr) Game::Spawn(g_game,0x104,10,(Vector *)(auStack_24 + 8),&g_vectorZero, (Entity *)npc,0,uVar3); refSlot = &npc->_child; *(uint *)((int)tmpEntity + 0x16c) = *(uint *)((int)tmpEntity + 0x16c) | 0x400; *(undefined4 *)((int)tmpEntity + 0x168) = *(undefined4 *)((int)tmpEntity + 0x168); if (*refSlot != (EntityPtr)0x0) { VStack_54.y = (float)refSlot; std::multiset::erase(&VStack_54.y); } *refSlot = tmpEntity; std::multiset::insert(refSlot); (**(code **)(*(int *)tmpEntity + 0xc))(); } else { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_24,1000, 0x90,0,0,0); uVar3 = 0; uStack_8 = 3; if (fStack_18 != 0.0) { do { manager = g_manager; VStack_54.y = *(float *)(auStack_24._4_4_ + uVar3 * 4); fVar6 = (npc->_pos).x - (float)*(EntityPtr *)((int)VStack_54.y + 0x33c); fVar5 = (npc->_pos).y - (float)*(EntityPtr *)((int)VStack_54.y + 0x340); if (fVar5 * fVar5 + fVar6 * fVar6 < 6400.0) { EStack_48 = (EntityPtr)0x3f800000; if (npc->_championColorIdx == 0x12) { EStack_48 = (EntityPtr)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { EStack_48 = (EntityPtr)0x3f000000; } pEStack_4c = (EntityPtr *)0x109; seed_fart_sound_override((int *)&pEStack_4c); SoundEffects::Play(&manager->_sfxManager,(int)pEStack_4c,1.0,2,0,(float)EStack_48, 0.0); seed = Random(); fVar5 = VStack_54.y; spawnPos.x = *(float *)((int)VStack_54.y + 0x33c); spawnPos.y = *(float *)((int)VStack_54.y + 0x340); pEVar4 = Game::Spawn(g_game,0x104,10,&spawnPos,&g_vectorZero,(Entity *)npc,0,seed); flags = pEVar4->_flags; flagsHighPtr = (uint *)((int)&pEVar4->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x400; *(int *)&pEVar4->_flags = (int)flags; (**(code **)(*(int *)pEVar4 + 0xc))(); (**(code **)((int)*(EntityPtr *)fVar5 + 0x28))(); } uVar3 = uVar3 + 1; } while (uVar3 < (uint)fStack_18); } uStack_8 = 0xffffffff; if (auStack_24[0] == '\0') { uStack_8 = 4; tracked_alloc(1,(void *)auStack_24._4_4_,0); uStack_8 = 0xffffffff; } } uVar3 = Random(); npc->_i1 = uVar3 % 0x3c + 0x3c; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 4; } iVar2 = npc->_i1; if ((0x1e < iVar2) || ((npc->_child == (EntityPtr)0x0 && (0 < iVar2)))) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar2; } ExceptionList = local_10; return; } //@@ 004ecc10 NpcAI::ENTITY_REVENANT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 841 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_REVENANT(Entity_NPC *npc) { byte bVar1; uint flagsHigh; Entity_Projectile *projectile; Entity *playerTarget; Vector *pVVar3; LayerState *layer; byte *curAnim; char headDir; void *pvVar4; int iVar5; byte *expectedAnim; char *expectedAnimText; bool isLess; float fVar6; float fVar7; double dVar8; EntityPtr *oldParentRef; undefined *shotColor; Vector local_a0; float shotVelX; uint stageId; Vector local_90; float local_88; byte *local_84; float local_80; Vector *local_7c; byte *local_78; undefined **headAnimTable; byte isFlipX; void *walkDownAnimBuf; char local_68 [12]; undefined4 walkDownAnimSize; uint walkDownAnimCapacity; void *walkUpAnimBuf; undefined2 local_50; undefined1 local_4e; undefined4 walkUpAnimSize; uint walkUpAnimCapacity; void *walkHoriAnimBuf; char local_38 [12]; undefined4 walkHoriAnimSize; uint walkHoriAnimCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; Game *game; byte *overlayAnimData; ANM2 *sprite; game = g_game; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af3ded; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; headAnimTable = &PTR_s_HeadWalkDown_00c5c330; local_80 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_friction = npc->_friction * 0.8; if (game->_challenge == 0x2c) { flagsHigh = Level::GetRoomStageType((Level *)game,game->_currentRoomIdx); LAB_004eccbf: stageId = RoomConfig::GetStageID(game->_stage,flagsHigh,-1); } else { if (game->_currentDimensionIdx != 2) { flagsHigh = game->_stageType; puStack_20 = local_38 + 0x34; goto LAB_004eccbf; } stageId = 0x23; puStack_20 = local_38 + 0x34; } iVar5 = npc->_state; if (iVar5 == 0) { npc->_state = 4; (npc->_v1).x = 0.0; *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_stateFrame = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; overlayAnimData = (npc->_sprite)._overlayAnimState._animData; if (overlayAnimData != (byte *)0x0) { curAnim = overlayAnimData; if (0xf < *(uint *)(overlayAnimData + 0x14)) { curAnim = *(byte **)overlayAnimData; } expectedAnimText = "HeadAppear"; do { bVar1 = *curAnim; isLess = bVar1 < (byte)*expectedAnimText; if (bVar1 != *expectedAnimText) { LAB_004ed7b4: flagsHigh = -(uint)isLess | 1; goto LAB_004ed7b9; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < (byte)expectedAnimText[1]; if (bVar1 != expectedAnimText[1]) goto LAB_004ed7b4; curAnim = curAnim + 2; expectedAnimText = expectedAnimText + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_004ed7b9: if ((flagsHigh == 0) && ((overlayAnimData[0x34] == 0 || ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) goto LAB_004ed7ef; } bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadAppear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } LAB_004ed7ef: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } ExceptionList = local_1c; return; } if (iVar5 == 4) { fVar6 = (npc->_velocity).y; fVar7 = (npc->_velocity).x; if (0.01 < fVar7 * fVar7 + fVar6 * fVar6) { pVVar3 = Vector::ToCardinal(&local_90,&npc->_velocity); fVar6 = atan2f(pVVar3->y,pVVar3->x); (npc->_v1).x = fVar6 * 57.295776; } iVar5 = Entity::GetIntervalTicks((Entity *)npc,30.0,0.0); if ((iVar5 != 0) && (flagsHigh = Random(), flagsHigh % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,0.8,0x78,0,1.0); } PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.8,0); if (npc->_stateFrame < 0) { npc->_stateFrame = (int)local_80 + npc->_stateFrame; } else { playerTarget = Entity_NPC::GetPlayerTarget(npc); pVVar3 = &npc->_pos; local_a0.x = (playerTarget->_pos).x; local_a0.y = (playerTarget->_pos).y; local_80 = local_a0.y - (npc->_pos).y; local_78 = (byte *)(local_a0.x - pVVar3->x); local_88 = local_a0.y; local_7c = (Vector *)local_a0.x; fVar6 = sqrtf((float)local_78 * (float)local_78 + local_80 * local_80); if (0.0 < fVar6) { local_78 = (byte *)((float)local_78 * (1.0 / fVar6)); local_80 = local_80 * (1.0 / fVar6); } if (ABS((float)local_78) <= ABS(local_80)) { iVar5 = (uint)(0.0 <= local_80) * 2 + 1; } else { iVar5 = 2; if ((float)local_78 < 0.0) { iVar5 = 0; } } Isaac::GetAxisAlignedUnitVectorFromDir(&local_90,iVar5); fVar6 = local_88 - (npc->_pos).y; fVar7 = (float)local_7c - pVVar3->x; fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); if (((fVar6 < 256.0) && (0.9 < (float)local_78 * local_90.x + local_90.y * local_80)) && (bVar1 = Room::CheckLine(g_game->_room,pVVar3,&local_a0,3,900,0,0,(Vector *)0x0), bVar1 != 0)) { fVar6 = atan2f(local_90.y,local_90.x); (npc->_v1).x = fVar6 * 57.295776; npc->_state = 8; npc->_stateFrame = 0; } } } else if (iVar5 == 8) { if (npc->_stateFrame == 0) { LAB_004ecd6c: headAnimTable = &PTR_s_AttackStartDown_00c5c320; bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar1 == 0) { iVar5 = npc->_stateFrame; } else { Entity_NPC::PlaySound(npc,0x131,1.0,0x5a,0,1.0); Entity_NPC::PlaySound(npc,0x130,1.0,0xf,0,1.0); npc->_stateFrame = 0x3c; iVar5 = 0x3c; } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { headAnimTable = &PTR_s_Attack00_00c5c2f0; } LAB_004ecdf1: if (iVar5 < 1) goto LAB_004ed33c; } else { pvVar4 = (npc->_sprite)._overlayAnimState._animData; if (npc->_stateFrame < 1) { headAnimTable = &PTR_s_AttackEndDown_00c5c2e0; if ((pvVar4 != (void *)0x0) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) goto LAB_004ed33c; npc->_state = 4; flagsHigh = Random(); iVar5 = -0x3c - flagsHigh % 0x1e; npc->_stateFrame = iVar5; goto LAB_004ecdf1; } if ((pvVar4 == (void *)0x0) || (*(char *)((int)pvVar4 + 0x34) == '\0')) goto LAB_004ecd6c; headAnimTable = &PTR_s_Attack00_00c5c2f0; } if (0 < (int)local_80) { pVVar3 = &npc->_pos; local_7c = pVVar3; do { flagsHigh = npc->_stateFrame - 1; npc->_stateFrame = flagsHigh; if ((flagsHigh & 1) == 0) { flagsHigh = Random(); local_84 = (byte *)((((float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 - 0.5) * 10.0 + (npc->_v1).x) * 0.017453292); local_78 = (byte *)sin((float)local_84); fVar6 = cos((float)local_84); local_84 = (byte *)0x1; local_90.y = (float)local_78 * 8.0; if (npc->_variant == 1) { local_84 = (byte *)0x4; } shotVelX = fVar6 * 8.0; shotColor = &DAT_00c34d78; if (stageId != 0x20) { shotColor = &DAT_00c34e28; } local_90.x = shotVelX; local_78 = (byte *)local_90.y; local_a0.y = cos(1.5707964); local_88 = sin(1.5707964); do { flagsHigh = Random(); projectile = (Entity_Projectile *) Game::Spawn(g_game,9,2,pVVar3,&local_90,(Entity *)npc,1,flagsHigh); (**(code **)(*(int *)projectile + 0x3c))(shotColor,0xffffffff,0xff,0); projectile->_fallingSpeed = projectile->_fallingSpeed * 0.4; if (projectile->_parent != (EntityPtr)0x0) { oldParentRef = &projectile->_parent; std::multiset::erase(&oldParentRef); } projectile->_parent = (EntityPtr)npc; std::multiset::insert(&projectile->_parent); Entity_NPC::fire_projectile_from_params(npc,projectile); (**(code **)(*(int *)projectile + 0xc))(); local_84 = (byte *)((int)local_84 + -1); pVVar3 = &npc->_pos; local_90.x = shotVelX * local_a0.y - local_88 * (float)local_78; local_90.y = (float)local_78 * local_a0.y + local_88 * shotVelX; shotVelX = local_90.x; local_78 = (byte *)local_90.y; } while (local_84 != (byte *)0x0); } playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar6 = (npc->_pos).y - (playerTarget->_pos).y; fVar7 = (npc->_pos).x - (playerTarget->_pos).x; fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); pVVar3 = local_7c; fVar7 = atan2f((fVar6 * 0.1 * (playerTarget->_velocity).y + (playerTarget->_pos).y) - local_7c->y, ((playerTarget->_pos).x + fVar6 * 0.1 * (playerTarget->_velocity).x) - local_7c->x); fVar7 = fVar7 * 57.295776; fVar6 = (npc->_v1).x; if (npc->_variant == 1) { fVar7 = fVar6 + 3.0; } fVar6 = approach_angle(fVar6,fVar7,5.0); local_80 = (float)((int)local_80 + -1); (npc->_v1).x = fVar6; } while (local_80 != 0.0); local_80 = 0.0; if (npc->_stateFrame < 1) { npc->_stateFrame = -1; } } } LAB_004ed33c: walkDownAnimCapacity = 0xf; walkDownAnimSize = 8; walkDownAnimBuf = (void *)0x6b6c6157; builtin_strncpy(local_68,"Down",5); walkUpAnimBuf = (void *)0x6b6c6157; walkUpAnimCapacity = 0xf; walkUpAnimSize = 6; local_50 = 0x7055; local_4e = 0; walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnimBuf = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 2; NpcHelper::charger_update_move_anim(&walkHoriAnimBuf,&walkUpAnimBuf,&walkDownAnimBuf,0x3dcccccd); local_14._0_1_ = 1; if (0xf < walkHoriAnimCapacity) { flagsHigh = walkHoriAnimCapacity + 1; pvVar4 = walkHoriAnimBuf; if (0xfff < flagsHigh) { pvVar4 = *(void **)((int)walkHoriAnimBuf + -4); flagsHigh = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnimBuf + (-4 - (int)pvVar4))) goto LAB_004ed489; } operator_delete(pvVar4,flagsHigh); } local_14._0_1_ = 0; walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnimBuf = (void *)((uint)walkHoriAnimBuf & 0xffffff00); if (0xf < walkUpAnimCapacity) { flagsHigh = walkUpAnimCapacity + 1; pvVar4 = walkUpAnimBuf; if (0xfff < flagsHigh) { pvVar4 = *(void **)((int)walkUpAnimBuf + -4); flagsHigh = walkUpAnimCapacity + 0x24; if (0x1f < (uint)((int)walkUpAnimBuf + (-4 - (int)pvVar4))) goto LAB_004ed489; } operator_delete(pvVar4,flagsHigh); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; walkUpAnimSize = 0; walkUpAnimCapacity = 0xf; walkUpAnimBuf = (void *)((uint)walkUpAnimBuf & 0xffffff00); if (0xf < walkDownAnimCapacity) { flagsHigh = walkDownAnimCapacity + 1; pvVar4 = walkDownAnimBuf; if (0xfff < flagsHigh) { pvVar4 = *(void **)((int)walkDownAnimBuf + -4); flagsHigh = walkDownAnimCapacity + 0x24; if (0x1f < (uint)((int)walkDownAnimBuf + (-4 - (int)pvVar4))) { LAB_004ed489: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,flagsHigh); } isFlipX = (npc->_sprite)._flipX; sprite = &npc->_sprite; walkDownAnimSize = 0; walkDownAnimCapacity = 0xf; walkDownAnimBuf = (void *)((uint)walkDownAnimBuf & 0xffffff00); layer = ANM2::GetLayer(sprite,(byte *)0x0); layer->_flipX = isFlipX; (npc->_sprite)._flipX = 0; fVar6 = (npc->_v1).x; if (headAnimTable != &PTR_s_Attack00_00c5c2f0) { local_7c = (Vector *)(fVar6 * 0.017453292); local_88 = cos((float)local_7c); fVar6 = sin((float)local_7c); if (ABS(local_88) <= ABS(fVar6)) { headDir = (0.0 <= fVar6) * '\x02' + '\x01'; } else { headDir = '\x02'; if (local_88 < 0.0) { headDir = '\0'; } } if (npc->_variant == 1) { local_78 = headAnimTable[3]; layer = ANM2::GetLayer(sprite,(byte *)0x1); layer->_flipX = 0; } else if (headDir == '\x03') { local_78 = *headAnimTable; } else if (headDir == '\x01') { local_78 = headAnimTable[1]; } else { local_78 = headAnimTable[2]; isFlipX = headDir == '\0'; layer = ANM2::GetLayer(sprite,(byte *)0x2); layer->_flipX = isFlipX; layer = ANM2::GetLayer(sprite,(byte *)0x1); layer->_flipX = isFlipX; } if ((headAnimTable == &PTR_s_HeadWalkDown_00c5c330) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { bVar1 = ANM2::SetOverlayAnimation(sprite,local_78,1); if (bVar1 == 0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { ExceptionList = local_1c; return; } AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,5.0); ExceptionList = local_1c; return; } overlayAnimData = (npc->_sprite)._overlayAnimState._animData; if (overlayAnimData != (byte *)0x0) { curAnim = overlayAnimData; expectedAnim = local_78; if (0xf < *(uint *)(overlayAnimData + 0x14)) { curAnim = *(byte **)overlayAnimData; } do { bVar1 = *curAnim; isLess = bVar1 < *expectedAnim; if (bVar1 != *expectedAnim) { LAB_004ed706: flagsHigh = -(uint)isLess | 1; goto LAB_004ed70b; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < expectedAnim[1]; if (bVar1 != expectedAnim[1]) goto LAB_004ed706; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_004ed70b: if (flagsHigh == 0) { if (overlayAnimData[0x34] == 0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._overlayAnimState._isPlaying != 0) { ExceptionList = local_1c; return; } } } bVar1 = ANM2::SetOverlayAnimation(sprite,local_78,1); if (bVar1 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; ExceptionList = local_1c; return; } local_7c = (Vector *)((90.0 - fVar6) * 0.033333335 + 0.5); dVar8 = floor((double)(float)local_7c); local_7c = (Vector *)(float)dVar8; iVar5 = 3; if (npc->_variant != 1) { iVar5 = 0xc; } overlayAnimData = (npc->_sprite)._overlayAnimState._animData; local_84 = headAnimTable[((int)dVar8 + 0xc) % iVar5]; if (overlayAnimData != (byte *)0x0) { curAnim = overlayAnimData; expectedAnim = local_84; if (0xf < *(uint *)(overlayAnimData + 0x14)) { curAnim = *(byte **)overlayAnimData; } do { bVar1 = *curAnim; isLess = bVar1 < *expectedAnim; if (bVar1 != *expectedAnim) { LAB_004ed572: flagsHigh = -(uint)isLess | 1; goto LAB_004ed577; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < expectedAnim[1]; if (bVar1 != expectedAnim[1]) goto LAB_004ed572; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_004ed577: if ((flagsHigh == 0) && ((overlayAnimData[0x34] == 0 || ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) goto LAB_004ed5a2; } bVar1 = ANM2::SetOverlayAnimation(sprite,local_84,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } LAB_004ed5a2: layer = ANM2::GetLayer(sprite,(byte *)0x1); layer->_flipX = 0; layer = ANM2::GetLayer(sprite,(byte *)0x2); layer->_flipX = 0; ExceptionList = local_1c; return; } //@@ 004ed840 NpcAI::ENTITY_CULTIST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 885 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CULTIST(Entity_NPC *npc) { ANM2 *pAVar1; undefined1 *puVar2; byte bVar3; byte *animNameChar; uint uVar4; LayerState *layer; int *piVar5; Vector *pVVar6; uint angleRoll; ProjectileParams *params; Entity_Projectile *projectile; Room *room; Entity_Player *pEVar7; byte *animNameLiteral; char *animName; byte *animNameChar; float *extraout_ECX; int *listHead; int iVar9; EntityPtr EVar10; int iVar11; bool bVar12; Entity *pEVar13; float distSq; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; undefined1 local_144 [12]; undefined1 *local_138; Vector local_134; Vector local_12c; Vector local_124; Vector local_11c; EntityPtr updateFrames; Vector local_110; char isFriendly; Room *local_104; Entity_Player *local_100; EntityPtr local_fc; ProjectileParams projectileParams; undefined4 local_50; EntityRef EStack_4c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword flags; uint *flagsHigh; Manager *manager; int *nextNode; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af3e46; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; room = g_game->_room; updateFrames = (EntityPtr)((int)npc->_updateTime - (int)npc->_prevUpdateTime); isFriendly = (npc->_flags & 0x20000000) != 0; local_104 = room; if (npc->_variant == 10) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); switch(npc->_state) { case 0: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Entity_NPC::UpdateDirtColor(npc,1); bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } flags = npc->_flags; npc->_isInvicible = 1; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x11; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_stateFrame = 0x5a; npc->_state = 3; npc->_entityCollisionClass = 0; ExceptionList = local_1c; return; case 3: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); EntityList::QueryRadius (&room->_entityList,(EntityList_EL *)local_144,&npc->_pos,npc->_size,0xffffffff); uVar4 = 0; local_14 = 0; if (local_138 != (undefined1 *)0x0) { do { pEVar13 = *(Entity **)(local_144._4_4_ + uVar4 * 4); iVar9 = pEVar13->_type; if (((iVar9 == 1) || (iVar9 - 10U < 0x3de)) && (bVar3 = Entity::IsHostileTo((Entity *)npc,pEVar13), bVar3 != 0)) { npc->_state = 8; animNameChar = (npc->_sprite)._animState._animData; if (animNameChar == (byte *)0x0) goto LAB_004eda40; animNameChar = animNameChar; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animNameLiteral = &DAT_00b60954; goto LAB_004eda02; } uVar4 = uVar4 + 1; } while (uVar4 < local_138); } goto LAB_004eda5e; case 5: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((int)register0x00000010 + -4), (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); (**(code **)(*(int *)npc + 0x28))(local_24); } break; case 8: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d3b0); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,500,1.0,2,0,1.0); local_12c.y = 0.0; local_100 = (Entity_Player *)0x4cbebc20; EntityList::QueryRadius (&room->_entityList,(EntityList_EL *)local_144,&npc->_pos,npc->_size + 10.0,0x28 ); local_14 = 2; local_124.y = 0.0; if (local_138 == (undefined1 *)0x0) { EVar10 = (EntityPtr)0x0; } else { do { EVar10 = *(EntityPtr *)(local_144._4_4_ + (int)local_124.y * 4); bVar3 = Entity::IsHostileTo((Entity *)npc,(Entity *)EVar10); if ((bVar3 != 0) && (fVar16 = (npc->_pos).x - ((Vector *)((int)EVar10 + 0x33c))->x, fVar17 = (npc->_pos).y - *(float *)((int)EVar10 + 0x340), pEVar13 = (Entity *)(fVar17 * fVar17 + fVar16 * fVar16), (float)pEVar13 < (float)local_100)) { local_12c.y = (float)EVar10; local_100 = (Entity_Player *)pEVar13; } EVar10 = (EntityPtr)local_12c.y; local_124.y = (float)((int)local_124.y + 1); } while ((uint)local_124.y < local_138); if ((EntityPtr)local_12c.y != (EntityPtr)0x0) { if (npc->_entityRef != (EntityPtr)0x0) { local_fc = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_fc); } npc->_entityRef = EVar10; std::multiset::insert(&npc->_entityRef); } } if (isFriendly == '\0') { npc->_stateFrame = 0x1e; } else { npc->_stateFrame = 0x5a; if (EVar10 != (EntityPtr)0x0) { EntityRef::constructor(&EStack_4c,(Entity *)npc); Entity::AddFreeze((Entity *)EVar10,&EStack_4c,0x5a,0); } } local_14 = 0xffffffff; if (local_144[0] == '\0') { local_14 = 3; goto LAB_004eda79; } } } } goto switchD_004ed8e5_caseD_1; } switch(npc->_state) { case 0: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_variant == 0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)&DAT_00c34da4); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer->_bitflags = layer->_bitflags | 1; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x3); layer->_bitflags = layer->_bitflags | 1; layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000004); layer->_bitflags = layer->_bitflags | 1; } npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x1e + 0x1e; (npc->_v1).x = 0.0; uVar4 = Random(); (npc->_v1).y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; break; case 3: npc->_friction = npc->_friction * 0.75; local_fc = (EntityPtr)(npc->_sprite)._animState._animData; if (local_fc == (EntityPtr)0x0) { LAB_004ee10a: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { EVar10 = local_fc; if (0xf < *(uint *)((int)local_fc + 0x14)) { EVar10 = *(EntityPtr *)local_fc; } animNameChar = s_Idle; do { bVar3 = *(byte *)EVar10; bVar12 = bVar3 < *animNameChar; if (bVar3 != *animNameChar) { LAB_004ee0e4: uVar4 = -(uint)bVar12 | 1; goto LAB_004ee0e9; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)EVar10 + 1); bVar12 = bVar3 < animNameChar[1]; if (bVar3 != animNameChar[1]) goto LAB_004ee0e4; EVar10 = (EntityPtr)((int)EVar10 + 2); animNameChar = animNameChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004ee0e9: if ((uVar4 != 0) || ((puStack_20 = (undefined1 *)((int)register0x00000010 + -4), *(byte *)((int)local_fc + 0x34) != 0 && (puStack_20 = (undefined1 *)((int)register0x00000010 + -4), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004ee10a; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); local_134.y = 0.0; if (bVar3 == 0) { bVar3 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero); if (bVar3 != 0) { (npc->_v1).x = (npc->_v1).x + npc->_speedMultiplier; fVar16 = atan2f(extraout_ECX[1] - (npc->_pos).y,*extraout_ECX - (npc->_pos).x); local_fc = (EntityPtr)(fVar16 * 57.295776); Random(); uVar4 = Random(); fVar16 = approach_angle((npc->_v1).y,(float)local_fc, ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 20.0 + 3.0) * npc->_speedMultiplier); (npc->_v1).y = fVar16; local_fc = (EntityPtr)(fVar16 * 0.017453292); local_12c.y = sin((float)local_fc); uVar4 = Random(); local_124.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 1.7 + 0.7; fVar17 = cos((float)local_fc); fVar16 = npc->_speedMultiplier; fVar14 = 100.0; (npc->_velocity).x = fVar17 * local_124.y * fVar16 + (npc->_velocity).x; (npc->_velocity).y = local_12c.y * local_124.y * fVar16 + (npc->_velocity).y; if (npc->_variant == 1) { fVar14 = 576.0; } fVar16 = (npc->_targetPosition).y - (npc->_pos).y; fVar17 = (npc->_targetPosition).x - (npc->_pos).x; if (fVar16 * fVar16 + fVar17 * fVar17 < fVar14) { if (npc->_variant == 1) { if (npc->_i1 == 1) { local_100 = (Entity_Player *)Entity_NPC::GetPlayerTarget(npc); bVar3 = Entity::IsHostileTo((Entity *)npc,(Entity *)local_100); if (bVar3 != 0) { local_11c.x = (npc->_pos).x; local_11c.y = (npc->_pos).y; bVar3 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&local_11c); if (((bVar3 == 0) || (30.0 <= ABS((local_100->_pos).y - (npc->_pos).y))) || (uVar4 = Random(), uVar4 % 3 != 0)) { fVar16 = (npc->_pos).x - (local_100->_pos).x; fVar17 = (npc->_pos).y - (local_100->_pos).y; if (fVar17 * fVar17 + fVar16 * fVar16 < 10000.0) { ANM2::Play(&npc->_sprite,(byte *)"Respawn",0); npc->_state = 0xd; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_v1).x = 0.0; (npc->_v2).x = 0.0; } } else { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); npc->_state = 8; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_v1).x = 0.0; fVar16 = (npc->_pos).x; (npc->_sprite)._flipX = (local_100->_pos).x <= fVar16 && fVar16 != (local_100->_pos).x; (npc->_v2).x = 0.0; } } } } else { pEVar13 = Entity_NPC::GetPlayerTarget(npc); if (npc->_i1 == 2) { ANM2::Play(&npc->_sprite,(byte *)"Respawn",0); npc->_state = 0xd; } else { if (((npc->_i1 != 1) || (npc->_child != (EntityPtr)0x0)) || (bVar3 = Entity::IsHostileTo((Entity *)npc,pEVar13), bVar3 == 0)) goto LAB_004ee536; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); npc->_state = 8; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_v1).x = 0.0; } } LAB_004ee536: if ((npc->_state == 3) && ((60.0 < (npc->_v1).x || ((((npc->_variant == 0 && (npc->_i1 == 1)) && ((npc->_child != (EntityPtr)0x0 && (uVar4 = Random(), uVar4 % 10 == 0)))) || ((((npc->_variant == 1 && (npc->_i1 == 1)) && (0 < npc->_projectileCooldown)) && (uVar4 = Random(), uVar4 % 10 == 0)))))))) { npc->_i1 = 0; (npc->_v1).x = 0.0; } } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } if ((npc->_i1 != 0) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 != 0)) break; local_fc = (EntityPtr)0x4cbebc20; if (npc->_projectileCooldown < 1) { if (npc->_variant == 1) { pEVar13 = Entity_NPC::GetPlayerTarget(npc); local_11c.x = (pEVar13->_velocity).x * 15.0 + (pEVar13->_pos).x; local_11c.y = (pEVar13->_velocity).y * 15.0 + (pEVar13->_pos).y; npc->_i1 = 1; Room::GetClampedPositionImpl(room,&local_110,&local_11c,60.0,60.0,60.0,60.0); (npc->_targetPosition).x = local_110.x; (npc->_targetPosition).y = local_110.y; } else { uVar4 = Random(); if (((uVar4 & 3) == 0) && (*(int *)&room->field_0x7304 != 0)) { local_12c.y = 0.0; local_11c.x = 0.0; local_100 = (Entity_Player *)0x0; local_11c.y = 0.0; local_124.y = 1e+08; FUN_0042c7c0(); local_14 = 4; piVar5 = (int *)**(int **)&room->field_0x7300; if (piVar5 != *(int **)&room->field_0x7300) { room = local_104; do { if ((piVar5[4] != 0x375) || ((short)piVar5[5] != 0)) { EVar10 = *(EntityPtr *)(piVar5 + 2); pEVar13 = (Entity *)piVar5[3]; fVar16 = (npc->_pos).x - (float)EVar10; fVar17 = (npc->_pos).y - (float)pEVar13; distSq = fVar17 * fVar17 + fVar16 * fVar16; if (distSq < local_124.y) { local_12c.y = (float)EVar10; local_124.y = distSq; local_11c.x = (float)EVar10; local_11c.y = (float)pEVar13; local_100 = (Entity_Player *)pEVar13; } FUN_00429f90((EntityPtr *)(piVar5 + 2)); room = local_104; } piVar5 = (int *)*piVar5; } while (piVar5 != (int *)*(int *)&room->field_0x7300); } pEVar7 = local_100; if (local_12c.y == g_vectorZero.x) { EVar10 = (EntityPtr)local_12c.y; if ((float)local_100 != g_vectorZero.y) goto LAB_004ee7fa; } else { LAB_004ee7fa: fVar16 = 0.0; local_124.y = 0.0; piVar5 = *(int **)local_110.x; listHead = (int *)local_110.x; if (piVar5 != (int *)local_110.x) { do { fVar14 = local_12c.y - (float)piVar5[2]; nextNode = (int *)*piVar5; fVar17 = (float)pEVar7 - (float)piVar5[3]; if (25600.0 < fVar17 * fVar17 + fVar14 * fVar14) { *(int **)piVar5[1] = nextNode; *(int *)(*piVar5 + 4) = piVar5[1]; local_110.y = (float)((int)local_110.y + -1); operator_delete(piVar5,0x10); listHead = (int *)local_110.x; pEVar7 = local_100; } else { local_124.y = local_124.y + (float)piVar5[2]; local_134.y = fVar16 + (float)piVar5[3]; } piVar5 = nextNode; fVar16 = local_134.y; } while (nextNode != listHead); } EVar10 = (EntityPtr)local_12c.y; if ((EntityPtr)local_110.y != (EntityPtr)0x0) { EVar10 = (EntityPtr) (local_124.y / (float)((double)(int)local_110.y + __uint_to_double_fixup[-((int)local_110.y >> 0x1f)])); pEVar7 = (Entity_Player *) (fVar16 / (float)((double)(int)local_110.y + __uint_to_double_fixup[-((int)local_110.y >> 0x1f)])); local_11c.x = (float)EVar10; local_11c.y = (float)pEVar7; } } if (((float)EVar10 != g_vectorZero.x) || ((float)pEVar7 != g_vectorZero.y)) { npc->_i1 = 2; Room::GetClampedPositionImpl(local_104,&local_134,&local_11c,60.0,60.0,60.0,60.0); (npc->_targetPosition).x = local_134.x; (npc->_targetPosition).y = local_134.y; } local_14 = 0xffffffff; FUN_0042c780(); } } } if (npc->_i1 == 0) { pEVar13 = Entity_NPC::GetPlayerTarget(npc); local_100 = (Entity_Player *)0x0; local_124.y = (pEVar13->_pos).x; local_12c.y = (pEVar13->_pos).y; if (isFriendly == '\0') { local_134.y = (float)(local_104->_entityList)._updateEL._size; if (local_134.y != 0.0) { piVar5 = (local_104->_entityList)._updateEL._data; do { pEVar7 = (Entity_Player *)*piVar5; if ((((1 < *(int *)&g_game->_deathmatchManager) && (pEVar7->_type == 1)) || (pEVar7->_type - 10U < 0x3de)) && ((((pEVar7->_flags & 0x20000000) == 0 && (pEVar7->_entityCollisionClass != 0)) && (fVar16 = local_124.y - (pEVar7->_pos).x, fVar17 = local_12c.y - (pEVar7->_pos).y, EVar10 = (EntityPtr)(fVar17 * fVar17 + fVar16 * fVar16), (float)EVar10 < (float)local_fc)))) { local_100 = pEVar7; local_fc = EVar10; } piVar5 = piVar5 + 1; local_134.y = (float)((int)local_134.y + -1); pEVar7 = local_100; } while (local_134.y != 0.0); goto LAB_004eeab9; } LAB_004eebca: room = local_104; local_134.y = (npc->_pos).x - local_124.y; local_100 = (Entity_Player *)((npc->_pos).y - local_12c.y); uVar4 = Random(); local_110.y = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 240.0 - 120.0) * 0.017453292; local_fc = (EntityPtr)cos(local_110.y); fVar16 = sin(local_110.y); local_11c.x = (float)local_fc * local_134.y - fVar16 * (float)local_100; local_11c.y = fVar16 * local_134.y + (float)local_fc * (float)local_100; uVar4 = Random(); pVVar6 = Vector::Resized(&local_11c,(Vector *)(local_144 + 8), (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0 + 50.0); local_11c.x = local_124.y + pVVar6->x; local_11c.y = local_12c.y + pVVar6->y; } else { pEVar7 = Game::GetNearestPlayer(g_game,&npc->_pos); LAB_004eeab9: if (pEVar7 == (Entity_Player *)0x0) goto LAB_004eebca; local_110.y = (pEVar7->_pos).x; fVar16 = (pEVar7->_pos).y; local_11c.x = local_110.y - local_124.y; local_11c.y = fVar16 - local_12c.y; local_124.y = fVar16; pVVar6 = Vector::Resized(&local_11c,(Vector *)(local_144 + 8),50.0); local_fc = (EntityPtr)pVVar6->x; local_134.y = pVVar6->y; pVVar6 = MusicManager::RandomVector(&local_12c); uVar4 = Random(); fVar16 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_11c.x = fVar16 * pVVar6->x * 40.0 + local_110.y + (float)local_fc; local_11c.y = fVar16 * pVVar6->y * 40.0 + local_134.y + local_124.y; room = local_104; } Room::GetClampedPositionImpl(room,&local_110,&local_11c,60.0,60.0,60.0,60.0); (npc->_targetPosition).x = local_110.x; (npc->_targetPosition).y = local_110.y; if (npc->_variant == 1) { uVar4 = Random(); npc->_i1 = (uint)((uVar4 & 7) == 0); (npc->_v1).x = 0.0; break; } npc->_i1 = 1; } (npc->_v1).x = 0.0; break; case 8: npc->_friction = npc->_friction * 0.7; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xd,1.0,2,0,1.0); (npc->_v1).x = 1.0; if (npc->_variant == 0) { uVar4 = Random(); angleRoll = Random(); local_110.y = ((float)((double)(int)angleRoll + __uint_to_double_fixup[-((int)angleRoll >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_fc = (EntityPtr)cos(local_110.y); fVar16 = sin(local_110.y); local_11c.y = fVar16 * 0.0 + (float)local_fc * 8.0; local_11c.x = (float)local_fc * 0.0 - fVar16 * 8.0; local_134.x = (npc->_pos).x + 0.0; local_134.y = (npc->_pos).y + 5.0; EVar10 = (EntityPtr) Game::Spawn(g_game,0x199,1,&local_134,&local_11c,(Entity *)npc,0,uVar4); if (*(EntityPtr *)((int)EVar10 + 0x3bc) != (EntityPtr)0x0) { local_110.y = (float)((int)EVar10 + 0x3bc); std::multiset::erase(&local_110.y); } *(EntityPtr *)((int)EVar10 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar10 + 0x3bc)); *(uint *)((int)EVar10 + 0x168) = *(uint *)((int)EVar10 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar10 + 0x16c) = *(undefined4 *)((int)EVar10 + 0x16c); *(byte *)((int)EVar10 + 0x3b0) = 1; *(float *)((int)EVar10 + 0xbbc) = 210.0; *(int *)((int)EVar10 + 0x184) = 3; *(int *)((int)EVar10 + 0x188) = 2; (**(code **)(*(int *)EVar10 + 0xc))(); ((Vector *)((int)EVar10 + 0xb64))->x = 5.60519e-45; if (npc->_child != (EntityPtr)0x0) { local_110.y = (float)&npc->_child; std::multiset::erase(&local_110.y); } npc->_child = EVar10; std::multiset::insert(&npc->_child); room = local_104; } else { Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); (npc->_v2).x = 20.0; } } } iVar9 = npc->_variant; iVar11 = iVar9; if (iVar9 == 1) { fVar16 = (npc->_v2).x; iVar11 = 1; if ((0.0 < fVar16) && (0 < (int)updateFrames)) { local_fc = updateFrames; do { if ((npc->_sprite)._flipX == 0) { local_100 = (Entity_Player *)0x3f800000; } else { local_100 = (Entity_Player *)&DAT_bf800000; } local_124.x = (float)local_100 * fVar16 + (npc->_pos).x; local_124.y = fVar16 * 0.0 + (npc->_pos).y; bVar3 = Room::IsPositionInRoom(room,&local_124,0.0); if (bVar3 == 0) { (npc->_v2).x = 0.0; fVar16 = 0.0; } else { uVar4 = Random(); pEVar13 = Game::Spawn(g_game,1000,0x16,&local_124,&g_vectorZero,(Entity *)npc,0,uVar4); iVar9 = npc->_stateFrame; iVar11 = *(int *)pEVar13; pAVar1 = &pEVar13[1]._sprite; (pAVar1->_filename)._buf[8] = '\x1e'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; pAVar1 = &pEVar13[1]._sprite; (pAVar1->_filename)._buf[0xc] = '\x1e'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; local_134.y = (float)iVar9 * 0.07 + 0.9; (pEVar13->_sprite)._scale.x = local_134.y; (pEVar13->_sprite)._scale.y = local_134.y; (**(code **)(iVar11 + 0xc))(); bVar3 = Room::IsPositionInRoom(g_game->_room,&local_124,0.0); if (bVar3 != 0) { uVar4 = Random(); EStack_4c._velocity.y = 0.0; EStack_4c._flags = 0; EStack_4c._entity = (void *)0x0; fVar17 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar16 = (float)local_100 * fVar17; fVar17 = fVar17 * 0.0; local_11c.x = fVar16 + fVar16; local_11c.y = fVar17 + fVar17; local_50 = 0x3f800000; EStack_4c._type = 0x3f800000; EStack_4c._variant = 0x3f800000; EStack_4c._spawnerType = 0x3f800000; EStack_4c._spawnerVariant = 0; EStack_4c._position.x = 0.0; EStack_4c._position.y = 0.0; EStack_4c._velocity.x = 0.0; uVar4 = Random(); local_110.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * -16.0; local_12c.x = local_124.x - (float)local_100 * 5.0; local_12c.y = local_124.y - 0.0; uVar4 = Random(); pEVar13 = Game::Spawn(g_game,1000,2,&local_12c,&local_11c,(Entity *)0x0,2,uVar4); (**(code **)(*(int *)pEVar13 + 0x3c))(&local_50,0xffffffff,0xff,0,1); (pEVar13->_sprite)._offset.x = 0.0; (pEVar13->_sprite)._offset.y = local_110.y; pEVar13->_renderDepthOffset = 10.0; uVar4 = Random(); (pEVar13->_sprite)._rotation = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar4 = Random(); pEVar13 = Game::Spawn(g_game,1000,7,&local_124,&g_vectorZero,(Entity *)0x0,0,uVar4); iVar9 = *(int *)pEVar13; (pEVar13->_sizeMulti).x = local_134.y; (pEVar13->_sizeMulti).y = local_134.y; (**(code **)(iVar9 + 0xc))(); params = ProjectileParams::ProjectileParams(&projectileParams); local_144._8_4_ = (float)local_100 * 100.0 + (npc->_pos).x; local_138 = (undefined1 *)((npc->_pos).y + 0.0); projectile = Entity_NPC::FireBossProjectiles(npc,1,local_144 + 8,5.0,params); uVar4 = Random(); fVar16 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; (projectile->_pos).x = local_124.x - (float)local_100 * 12.0 * fVar16; (projectile->_pos).y = local_124.y - fVar16 * 0.0; room = local_104; } fVar16 = (npc->_v2).x + 40.0; (npc->_v2).x = fVar16; } local_fc = (EntityPtr)((int)local_fc + -1); } while (local_fc != (EntityPtr)0x0); iVar9 = npc->_variant; local_fc = (EntityPtr)0x0; iVar11 = iVar9; } } fVar16 = (npc->_v1).x; if (0.0 < fVar16) { if (iVar11 == 1) { if ((npc->_sprite)._flipX == 0) { fVar14 = -5.0; } else { fVar14 = 5.0; } fVar17 = npc->_speedMultiplier * 0.0 + (npc->_velocity).y; (npc->_velocity).x = fVar14 * fVar16 * npc->_speedMultiplier + (npc->_velocity).x; } else { fVar17 = npc->_speedMultiplier; (npc->_velocity).x = fVar17 * 0.0 + (npc->_velocity).x; fVar17 = (npc->_velocity).y - fVar16 * 5.0 * fVar17; } (npc->_velocity).y = fVar17; (npc->_v1).x = (npc->_v1).x - npc->_speedMultiplier * 0.1; iVar9 = npc->_variant; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; npc->_state = 3; npc->_i1 = 0; if (iVar9 != 1) break; goto LAB_004ef500; case 0xd: npc->_friction = npc->_friction * 0.7; fVar16 = (npc->_targetPosition).y; fVar17 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar16 - fVar17; puVar2 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; puVar2 = puStack_20; if (bVar3 != 0) { local_fc = (EntityPtr)&DAT_0000000d; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); if (npc->_variant == 1) { (npc->_v2).x = 5.0; } else { bVar12 = false; local_100 = (Entity_Player *)0x0; EVar10 = **(EntityPtr **)&local_104->field_0x7300; if (EVar10 != (EntityPtr)*(EntityPtr **)&local_104->field_0x7300) { room = local_104; do { if (((*(EntityPtr *)((int)EVar10 + 0x10) == (EntityPtr)0x375) && (*(short *)((int)EVar10 + 0x14) == 0)) || (fVar17 = (npc->_pos).x - ((Vector *)((int)EVar10 + 8))->x, fVar16 = (npc->_pos).y - (float)*(EntityPtr *)((int)EVar10 + 0xc), 6400.0 < fVar16 * fVar16 + fVar17 * fVar17)) { EVar10 = *(EntityPtr *)EVar10; } else { local_12c.y = (float)Game::Spawn(g_game,(uint)*(EntityPtr *)((int)EVar10 + 0x10), (uint)*(ushort *)((int)EVar10 + 0x14), (Vector *)((int)EVar10 + 8),&g_vectorZero, (Entity *)0x0,(uint)*(ushort *)((int)EVar10 + 0x16) ,(uint)*(EntityPtr *)((int)EVar10 + 0x18)); if (isFriendly != '\0') { EntityRef::constructor(&EStack_4c,(Entity *)0x0); Entity::AddCharmed((Entity *)local_12c.y,&EStack_4c,-1,0,0); } (**(code **)(*(int *)local_12c.y + 0xc))(); local_110.y = *(float *)EVar10; local_100 = (Entity_Player *)((float)local_100 + *(float *)((int)local_12c.y + 900)) ; *(float *)*(EntityPtr *)((int)EVar10 + 4) = local_110.y; *(EntityPtr *)((int)*(EntityPtr *)EVar10 + 4) = *(EntityPtr *)((int)EVar10 + 4); *(int *)&local_104->field_0x7304 = *(int *)&local_104->field_0x7304 + -1; operator_delete((void *)EVar10,0x20); bVar12 = true; if (100.0 <= (float)local_100) goto LAB_004ef738; room = local_104; EVar10 = (EntityPtr)local_110.y; } } while (EVar10 != *(EntityPtr *)&room->field_0x7300); if (bVar12) { LAB_004ef738: SoundEffects::PlayWithFartOverride(0x109,1.0,2,0,1.0); } } } room = local_104; puVar2 = puStack_20; } } puStack_20 = puVar2; if (((npc->_variant == 1) && (fVar16 = (npc->_v2).x, 0.0 < fVar16)) && (fVar16 = fVar16 - npc->_speedMultiplier, (npc->_v2).x = fVar16, fVar16 <= 0.0)) { local_124.y = (float)Entity_NPC::GetPlayerTarget(npc); local_134.y = 0.0; do { local_12c.y = ((Vector *)((int)local_124.y + 0x360))->x; local_104 = (Room *)((Vector *)((int)local_124.y + 0x360))->y; fVar16 = sqrtf(local_12c.y * local_12c.y + (float)local_104 * (float)local_104); if (0.001 <= fVar16) { if (0.0 < fVar16) { local_12c.y = (1.0 / fVar16) * local_12c.y; local_104 = (Room *)((float)local_104 * (1.0 / fVar16)); } uVar4 = Random(); local_110.y = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 160.0 - 80.0) * 0.017453292; local_fc = (EntityPtr)cos(local_110.y); fVar16 = sin(local_110.y); fVar17 = (float)local_104 * (float)local_fc; local_fc = (EntityPtr)(local_12c.y * (float)local_fc - fVar16 * (float)local_104); local_104 = (Room *)(fVar17 + fVar16 * local_12c.y); } else { uVar4 = Random(); fVar16 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_110.y = fVar16 + fVar16; local_fc = (EntityPtr)cos(local_110.y); local_104 = (Room *)sin(local_110.y); } local_110.y = ((Vector *)((int)local_124.y + 0x33c))->x; local_12c.y = ((Vector *)((int)local_124.y + 0x33c))->y; uVar4 = Random(); fVar16 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0 + 50.0; local_138 = (undefined1 *)(fVar16 * (float)local_104 + local_12c.y); local_144._8_4_ = fVar16 * (float)local_fc + local_110.y; Room::FindFreePickupSpawnPosition(room,&local_11c,(Vector *)(local_144 + 8),0.0,1,0,0); if ((isFriendly != '\0') || (pEVar7 = Game::GetNearestPlayer(g_game,&local_11c), fVar16 = local_11c.y - (pEVar7->_pos).y, fVar17 = local_11c.x - (pEVar7->_pos).x, 1600.0 < fVar16 * fVar16 + fVar17 * fVar17)) { uVar4 = Random(); pEVar13 = Game::Spawn(g_game,0x375,10,&local_11c,&g_vectorZero,(Entity *)npc,0,uVar4); Entity::SetParent(pEVar13,(Entity *)npc); (**(code **)(*(int *)pEVar13 + 0xc))(); break; } local_134.y = (float)((int)local_134.y + 1); } while ((uint)local_134.y < 10); (npc->_v2).x = 8.0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; npc->_state = 3; npc->_i1 = 0; if (npc->_variant != 1) { npc->_projectileCooldown = 0x5a; break; } LAB_004ef500: uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x3c + 0x3c; } iVar9 = npc->_projectileCooldown; if (0 < iVar9) { iVar11 = iVar9 - (int)updateFrames; iVar9 = 0; if (0 < iVar11) { iVar9 = iVar11; } npc->_projectileCooldown = iVar9; } if (npc->_variant == 1) { iVar11 = (int)((float)iVar9 - npc->_pendingDamage * 5.0); iVar9 = 0; if (0 < iVar11) { iVar9 = iVar11; } npc->_projectileCooldown = iVar9; } ExceptionList = local_1c; return; while( true ) { bVar3 = animNameChar[1]; bVar12 = bVar3 < animNameLiteral[1]; if (bVar3 != animNameLiteral[1]) goto LAB_004eda22; animNameChar = animNameChar + 2; animNameLiteral = animNameLiteral + 2; if (bVar3 == 0) break; LAB_004eda02: bVar3 = *animNameChar; bVar12 = bVar3 < *animNameLiteral; if (bVar3 != *animNameLiteral) { LAB_004eda22: uVar4 = -(uint)bVar12 | 1; goto LAB_004eda27; } if (bVar3 == 0) break; } uVar4 = 0; LAB_004eda27: if ((uVar4 != 0) || ((animNameChar[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) { LAB_004eda40: bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b60954,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004eda5e: local_14 = 0xffffffff; if (local_144[0] == '\0') { local_14 = 1; LAB_004eda79: tracked_alloc(1,(void *)local_144._4_4_,0); local_14 = 0xffffffff; } switchD_004ed8e5_caseD_1: if ((npc->_state == 5) || (npc->_stateFrame = npc->_stateFrame - (int)updateFrames, 0 < npc->_stateFrame)) goto LAB_004edd36; if (npc->_entityRef != (EntityPtr)0x0) { local_fc = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_fc); } npc->_entityRef = (EntityPtr)0x0; animNameChar = (npc->_sprite)._animState._animData; if (animNameChar == (byte *)0x0) { LAB_004edd0e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Disappear",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animNameChar; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } animName = "Disappear"; do { bVar3 = *animNameChar; bVar12 = bVar3 < (byte)*animName; if (bVar3 != *animName) { LAB_004edcf0: uVar4 = -(uint)bVar12 | 1; goto LAB_004edcf5; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; bVar12 = bVar3 < (byte)animName[1]; if (bVar3 != animName[1]) goto LAB_004edcf0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_004edcf5: if ((uVar4 != 0) || ((animNameChar[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004edd0e; } npc->_state = 5; LAB_004edd36: fVar14 = npc->_friction * 0.7; npc->_friction = fVar14; fVar16 = (npc->_targetPosition).x; fVar17 = (npc->_pos).x; (npc->_velocity).y = ((npc->_targetPosition).y - (npc->_pos).y) / fVar14; (npc->_velocity).x = (fVar16 - fVar17) / fVar14; iVar11 = (int)(((npc->_targetPosition).x - 40.0) / 40.0 + 0.5); iVar9 = (int)(((npc->_targetPosition).y - 120.0) / 40.0 + 0.5); if ((((-1 < iVar11) && (iVar11 < local_104->_gridWidth)) && (-1 < iVar9)) && ((iVar9 < local_104->_gridHeight && (local_134.y = (float)(local_104->_gridWidth * iVar9 + iVar11), (uint)local_134.y < 0x1c0)))) { iVar9 = local_104->_gridPaths[(int)local_134.y] % 1000; if (iVar9 < 900) { local_104->_gridPaths[(int)local_134.y] = (local_104->_gridPaths[(int)local_134.y] - iVar9) + 900; } } EVar10 = npc->_entityRef; if (EVar10 == (EntityPtr)0x0) { ExceptionList = local_1c; return; } fVar16 = (npc->_pos).x - *(float *)((int)EVar10 + 0x33c); fVar17 = (npc->_pos).y - *(float *)((int)EVar10 + 0x340); if (fVar17 * fVar17 + fVar16 * fVar16 <= npc->_size * npc->_size * 4.0) { fVar14 = npc->_speedMultiplier; npc->_renderDepthOffset = 20.0; fVar15 = 0.8; fVar18 = 0.8; if (fVar14 != 1.0) { fVar18 = 0.8 / ((fVar14 + 0.8) - fVar14 * 0.8); } *(float *)((int)EVar10 + 0x360) = fVar16 * 0.2 * fVar14 + *(float *)((int)EVar10 + 0x360) * fVar18; *(float *)((int)EVar10 + 0x364) = fVar17 * 0.2 * fVar14 + *(float *)((int)EVar10 + 0x364) * fVar18; fVar14 = npc->_speedMultiplier; if (fVar14 != 1.0) { fVar15 = 0.8 / ((fVar14 + 0.8) - fVar14 * 0.8); } (npc->_velocity).x = fVar15 * (npc->_velocity).x - fVar14 * fVar16 * 0.2; (npc->_velocity).y = fVar15 * (npc->_velocity).y - fVar14 * fVar17 * 0.2; ExceptionList = local_1c; return; } local_fc = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_fc); npc->_entityRef = (EntityPtr)0x0; ExceptionList = local_1c; return; } //@@ 004efb90 NpcAI::ENTITY_CLICKETY_CLACK /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 889 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CLICKETY_CLACK(Entity_NPC *npc) { byte bVar1; Vector *throwDir; Vector *pVVar2; byte *overlayAnimName; ColorMod *color; int iVar3; Entity *pEVar4; EntityRef *entityRef; uint uVar5; EntityPtr EVar6; undefined4 uVar7; ColorMod *color_00; LayerState *headLayer; Entity_NPC *parentNpc; undefined4 extraout_ECX; int cooldownLeft; byte *headAnimName; int unusedArg; void *pvVar8; int iVar9; float *rangeFloor; ANM2 *sprite; bool isNameLess; float fVar10; float fVar11; float fVar12; EntityPtr EVar13; float fVar14; EntityPtr projection; undefined8 uVar15; undefined1 *src; ColorMod *other; float bestDist; float preferredRange; float minRange; float local_188; float minRayLength; EntityPtr local_180; EntityPtr local_17c; Vector local_178; EntityPtr local_170; undefined1 isOtherFriendly; Vector scratchVec; undefined1 siblingQuery [4]; int siblingData; Vector local_158; EntityPtr local_14c; Vector local_148; void *local_13c; EntityPtr local_138; EntityPtr local_134; ProjectileParams projParams; Color tmpColor; undefined4 local_58; undefined1 auStack_54 [28]; float local_38; Vector local_34 [2]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; uint *flagsHigh; Manager *manager; EntityPtr *refSlot; int *sibling; puStack_20 = (undefined1 *)(local_34 + 6); local_14 = -NAN; puStack_18 = &LAB_00af3e98; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&local_34[4].y; ExceptionList = &local_1c; iVar9 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; pVVar2 = local_34 + 6; switch(npc->_state) { case 0: *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; uVar5 = (npc->_sprite)._layerCount; uVar7 = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 4; *(undefined4 *)((int)&npc->_flags + 4) = uVar7; npc->_projectileDelay = -0x1e; npc->_i2 = 0; pVVar2 = local_34 + 6; if (2 < uVar5) { other = (ColorMod *)&DAT_00c34e28; puStack_20 = (undefined1 *)(local_34 + 6); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); Color::operator_assign((Color *)&headLayer->_color,other); pVVar2 = (Vector *)puStack_20; } break; case 3: local_14c = (EntityPtr)0xffffffff; puStack_20 = (undefined1 *)(local_34 + 6); bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if ((bVar1 == 0) || (npc->_controllerID != -1)) { Entity_NPC::CalcTargetPosition(npc,&local_158,0.0); if (npc->_projectileDelay < 1) { EVar6 = npc->_child; if ((EVar6 == (EntityPtr)0x0) || ((bVar1 = Entity::IsEnemy((Entity *)EVar6), bVar1 != 0 && (((Vector *)((int)EVar6 + 0xb64))->x != 2.24208e-44)))) { if (EVar6 == (EntityPtr)0x0) goto LAB_004f030a; } else { local_138 = (EntityPtr)&npc->_child; std::multiset::erase(&local_138); npc->_child = (EntityPtr)0x0; LAB_004f030a: local_134 = (EntityPtr)0x0; local_170 = (EntityPtr)0x0; Entity_NPC::QueryNPCsType(auStack_54 + 0x18,0x379,-1); local_14 = 1.4013e-45; local_13c = (void *)0x0; if ((void *)local_34[0].y != (void *)0x0) { fVar10 = local_38; do { EVar6 = *(EntityPtr *)((int)fVar10 + (int)local_13c * 4); if (EVar6 != (EntityPtr)0x0) { if ((((*(int *)&g_game->_deathmatchManager < 2) || (*(EntityPtr *)((int)EVar6 + 0x28) != (EntityPtr)0x1)) && (0x3dd < (int)*(EntityPtr *)((int)EVar6 + 0x28) - 10U)) || (((EVar6 == (EntityPtr)npc || (local_148.y = *(float *)((int)EVar6 + 0x16c), (((uint)*(EntityPtr *)((int)EVar6 + 0x168) & 0x20000000) != 0) != ((npc->_flags & 0x20000000) != 0))) || ((*(EntityPtr *)((int)EVar6 + 0x3bc) != npc->_parent || (*(EntityPtr *)((int)EVar6 + 0xb64) == (EntityPtr)0x10)))))) { fVar10 = local_38; } else { fVar10 = (npc->_pos).y - (float)*(EntityPtr *)((int)EVar6 + 0x340); fVar11 = (npc->_pos).x - (float)*(EntityPtr *)((int)EVar6 + 0x33c); EVar13 = (EntityPtr)sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (((uint)*(EntityPtr *)((int)EVar6 + 0x168) & 0x10) != 0) { EVar13 = (EntityPtr)((float)EVar13 * 0.001); } fVar10 = local_38; if ((float)local_170 < (float)EVar13) { local_170 = EVar13; local_134 = EVar6; } } } local_13c = (void *)((int)local_13c + 1); } while (local_13c < (uint)local_34[0].y); if (local_134 != (EntityPtr)0x0) { refSlot = &npc->_child; if (npc->_child != (EntityPtr)0x0) { local_138 = (EntityPtr)refSlot; std::multiset::erase(&local_138); } *refSlot = local_134; std::multiset::insert(refSlot); } } local_14 = -NAN; EntityList_Query::~EntityList_Query(auStack_54 + 0x18); EVar6 = npc->_child; if (EVar6 == (EntityPtr)0x0) { minRayLength = 100.0; minRange = 100.0; fVar10 = sin(((float)(g_game->_frameCount - npc->_spawnFrame) * 3.1415927) / 15.0); preferredRange = fVar10 * 40.0 + 100.0; fVar10 = 100.0; goto LAB_004f0585; } } fVar10 = 20.0; local_158.x = *(float *)((int)EVar6 + 0x33c); local_158.y = *(float *)((int)EVar6 + 0x340); minRayLength = 20.0; minRange = 20.0; preferredRange = 20.0; } else { minRayLength = 40.0; minRange = 40.0; fVar10 = sin(((float)(g_game->_frameCount - npc->_spawnFrame) * 3.1415927) / 15.0); refSlot = &npc->_child; preferredRange = fVar10 * 80.0 + 120.0; if (*refSlot != (EntityPtr)0x0) { local_138 = (EntityPtr)refSlot; std::multiset::erase(&local_138); } fVar10 = 40.0; *refSlot = (EntityPtr)0x0; } LAB_004f0585: local_178.y = (npc->_pos).x - local_158.x; local_148.y = (npc->_pos).y - local_158.y; bestDist = 10000.0; scratchVec.y = 0.0; scratchVec.x = 0.0; local_180 = (EntityPtr)&DAT_00c5c794; local_138 = (EntityPtr)0x4; local_17c = (EntityPtr)local_158.x; local_13c = (void *)local_158.y; do { local_188 = local_148.y * *(float *)((int)local_180 + 4) + local_178.y * *(float *)local_180 ; rangeFloor = &minRange; if (fVar10 <= local_188) { rangeFloor = &local_188; } pVVar2 = Room::GetLaserTarget(g_game->_room,local_34,&local_158,(Vector *)local_180); local_134 = (EntityPtr)(pVVar2->x - (float)local_17c); local_170 = (EntityPtr)(pVVar2->y - (float)local_13c); fVar10 = sqrtf((float)local_134 * (float)local_134 + (float)local_170 * (float)local_170); if (minRayLength <= fVar10) { fVar11 = (preferredRange - *rangeFloor) * 0.2 + *rangeFloor; if ((fVar10 <= fVar11) || (fVar10 <= 0.0)) { EVar6 = local_170; } else { fVar11 = fVar11 / fVar10; local_134 = (EntityPtr)(fVar11 * (float)local_134); EVar6 = (EntityPtr)((float)local_170 * fVar11); } local_134 = (EntityPtr)((float)local_134 + (float)local_17c); local_188 = (float)local_13c + (float)EVar6; fVar11 = (npc->_pos).x - (float)local_134; fVar10 = (npc->_pos).y - local_188; fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (fVar10 < bestDist) { scratchVec.x = (float)local_134; scratchVec.y = local_188; bestDist = fVar10; } } local_180 = (EntityPtr)((int)local_180 + 8); local_138 = (EntityPtr)((int)local_138 + -1); fVar10 = minRayLength; } while (local_138 != (EntityPtr)0x0); if ((scratchVec.x == g_vectorZero.x) && (scratchVec.y == g_vectorZero.y)) { scratchVec.x = (float)local_17c; fVar11 = (float)local_17c - (npc->_pos).x; scratchVec.y = (float)local_13c; fVar10 = (float)local_13c - (npc->_pos).y; local_138 = (EntityPtr)0x0; if (ABS(fVar11) <= ABS(fVar10)) { local_134 = (EntityPtr)((uint)(0.0 <= fVar10) * 2 + 1); } else { local_134 = (EntityPtr)0x2; if (fVar11 < 0.0) { local_134 = (EntityPtr)0x0; } } } else { local_17c = (EntityPtr)((float)local_17c - (npc->_pos).x); local_158.y = (float)local_13c - (npc->_pos).y; if (ABS((float)local_17c) <= ABS(local_158.y)) { local_138 = (EntityPtr)((uint)(0.0 <= local_158.y) * 2 + 1); } else { local_138 = (EntityPtr)0x2; if ((float)local_17c < 0.0) { local_138 = (EntityPtr)0x0; } } local_158.x = (float)local_17c; local_13c = (void *)local_158.y; Isaac::GetAxisAlignedUnitVectorFromDir(&local_148,(int)local_138); EVar6 = local_138; if (npc->_projectileDelay < 0) { local_134 = (EntityPtr)vector_to_direction(&npc->_velocity); } else { local_134 = local_138; if (0 < npc->_projectileDelay) { pVVar2 = Vector::Normalized(&local_158,local_34); local_134 = EVar6; if (0.92 < local_148.y * pVVar2->y + local_148.x * pVVar2->x) { fVar10 = sqrtf((float)local_13c * (float)local_13c + (float)local_17c * (float)local_17c); if (fVar10 < 200.0) { local_134 = EVar6; bVar1 = Room::CheckLine(g_game->_room,&npc->_pos,&scratchVec,3,0,0,0,(Vector *)0x0); if (bVar1 != 0) { local_14c = EVar6; local_134 = EVar6; } } } } } } bVar1 = Room::CheckLine(g_game->_room,&npc->_pos,&scratchVec,0,0,0,0,(Vector *)0x0); if (bVar1 == 0) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.9,0,1); (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; } else { npc->_friction = npc->_friction * 0.7; local_180 = (EntityPtr)(scratchVec.x - (npc->_pos).x); local_138 = (EntityPtr)(scratchVec.y - (npc->_pos).y); fVar10 = sqrtf((float)local_180 * (float)local_180 + (float)local_138 * (float)local_138); EVar6 = local_180; EVar13 = local_138; if (0.0 < fVar10) { EVar6 = (EntityPtr)((float)local_180 * (1.0 / fVar10)); EVar13 = (EntityPtr)((float)local_138 * (1.0 / fVar10)); } local_148.y = 2.0; local_178.y = fVar10 * 0.1; pVVar2 = &local_148; if ((float)(fVar10 * 0.1) <= 2.0) { pVVar2 = &local_178; } fVar14 = (float)EVar13 * 0.9 * pVVar2->y; fVar12 = pVVar2->y * (float)EVar6 * 0.9; (npc->_v1).y = fVar14; (npc->_v1).x = fVar12; fVar10 = npc->_friction; fVar11 = npc->_speedMultiplier; (npc->_velocity).x = (fVar12 / fVar10) * fVar11 + (npc->_velocity).x; (npc->_velocity).y = (fVar14 / fVar10) * fVar11 + (npc->_velocity).y; } iVar3 = Entity::GetIntervalTicks((Entity *)npc,4.0,0.0); if (((iVar3 != 0) && (uVar5 = Random(), (uVar5 & 0xf) == 0)) && (npc->_parent != (EntityPtr)0x0)) { Entity_NPC::QueryNPCsType(auStack_54 + 0x18,0x379,-1); local_14 = 2.8026e-45; EVar6 = (EntityPtr)0x0; local_138 = (EntityPtr)0xc9742400; pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_188 = (npc->_pos).x; local_178.y = (pEVar4->_pos).y - (npc->_pos).y; local_148.y = (pEVar4->_pos).x - local_188; fVar10 = sqrtf(local_178.y * local_178.y + local_148.y * local_148.y); pvVar8 = (void *)0x0; if ((void *)local_34[0].y != (void *)0x0) { do { EVar13 = *(EntityPtr *)((int)local_38 + (int)pvVar8 * 4); if (EVar13 != (EntityPtr)0x0) { if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)EVar13 + 0x28) != 1)) { if (0x3dd < *(int *)((int)EVar13 + 0x28) - 10U) goto LAB_004f0cc7; } if (EVar13 != (EntityPtr)npc) { if (*(EntityPtr *)((int)EVar13 + 0x3bc) == npc->_parent) { if (*(int *)((int)EVar13 + 0xb64) != 0x10) { projection = (EntityPtr) ((*(float *)((int)EVar13 + 0x33c) - local_188) * (local_148.y / fVar10) + (*(float *)((int)EVar13 + 0x340) - (npc->_pos).y) * (local_178.y / fVar10)); if ((float)projection <= (float)local_138) { if (EVar6 != (EntityPtr)0x0) goto LAB_004f0cc7; } EVar6 = EVar13; local_138 = projection; } } } } LAB_004f0cc7: pvVar8 = (void *)((int)pvVar8 + 1); } while (pvVar8 < (uint)local_34[0].y); local_180 = EVar6; if (EVar6 != (EntityPtr)0x0) { local_178.y = (float)((int)npc->_parent + 0x3bc); if (*(int *)local_178.y != 0) { local_148.y = local_178.y; std::multiset::erase(&local_148.y); } *(EntityPtr *)local_178.y = EVar6; std::multiset::insert(local_178.y); npc->_state = 0xe; ANM2::Play(&npc->_sprite,(byte *)"QuickRevert",0); manager = g_manager; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; local_138 = (EntityPtr)0x13c; seed_fart_sound_override((int *)&local_138); SoundEffects::Play(&manager->_sfxManager,(int)local_138,1.0,2,0,1.5,0.0); parentNpc = Entity_NPC::ParentNPC(npc); if (parentNpc->_entityRef != (EntityPtr)0x0) { parentNpc = Entity_NPC::ParentNPC(npc); (**(code **)(*(int *)parentNpc->_entityRef + 0x28))(); } uVar5 = Random(); EVar6 = local_180; local_158.x = *(float *)((int)local_180 + 0x33c); local_158.y = *(float *)((int)local_180 + 0x340); local_170 = (EntityPtr) Game::Spawn(g_game,1000,0xaf,&local_158,&g_vectorZero,(Entity *)npc,0,uVar5) ; uVar15 = Color::Color(0x3f4ccccd); (*(code *)((ulonglong)uVar15 >> 0x20))((int)uVar15,0xffffffff,0xff,0,1); local_178.y = (float)((int)local_170 + 0x3c4); if (*(EntityPtr *)local_178.y != (EntityPtr)0x0) { local_148.y = local_178.y; std::multiset::erase(&local_148.y); } *(EntityPtr *)local_178.y = EVar6; std::multiset::insert(local_178.y); EVar6 = local_170; local_178.y = *(float *)&npc->_parent; if (*(EntityPtr *)((int)local_170 + 0x3bc) != (EntityPtr)0x0) { local_148.y = (float)((int)local_170 + 0x3bc); std::multiset::erase(&local_148.y); } *(EntityPtr *)((int)EVar6 + 0x3bc) = (EntityPtr)local_178.y; if ((EntityPtr)local_178.y != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar6 + 0x3bc)); } (**(code **)(*(int *)EVar6 + 0xc))(); parentNpc = Entity_NPC::ParentNPC(npc); local_178.y = (float)&parentNpc->_entityRef; if (parentNpc->_entityRef != (EntityPtr)0x0) { local_148.y = local_178.y; std::multiset::erase(&local_148.y); } *(EntityPtr *)local_178.y = EVar6; std::multiset::insert(local_178.y); local_14 = -NAN; EntityList_Query::~EntityList_Query(auStack_54 + 0x18); pVVar2 = (Vector *)puStack_20; break; } } local_14 = -NAN; EntityList_Query::~EntityList_Query(auStack_54 + 0x18); } npc->_friction = npc->_friction * 0.97; if ((local_14c == (EntityPtr)0xffffffff) || (0 < npc->_projectileCooldown)) { EVar6 = local_134; } else { Isaac::GetAxisAlignedUnitVectorFromDir(&local_158,(int)local_14c); local_148.x = local_158.x * 9.0; local_148.y = local_158.y * 9.0; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_148,0,&projParams); parentNpc = Entity_NPC::ParentNPC(npc); if (parentNpc == (Entity_NPC *)0x0) { LAB_004f100d: iVar3 = 0xf; } else { parentNpc = Entity_NPC::ParentNPC(npc); iVar3 = 10; if (parentNpc->_i1 != 1) goto LAB_004f100d; } npc->_projectileCooldown = iVar3; manager = g_manager; iVar3 = npc->_projectileDelay + -1; local_14c = (EntityPtr)0xf9; if (iVar3 < 1) { iVar3 = -0x3c; } npc->_projectileDelay = iVar3; seed_fart_sound_override((int *)&local_14c); SoundEffects::Play(&manager->_sfxManager,(int)local_14c,1.0,2,0,1.0,0.0); EVar6 = local_134; ANM2::PlayOverlay(&npc->_sprite,(&PTR_s_HeadLeft_00b60b30)[(int)local_134],1); } } else { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_158.x = (pEVar4->_pos).x; local_158.y = (pEVar4->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_158,0); fVar10 = npc->_friction * 0.8; npc->_friction = fVar10; npc->_friction = fVar10 * 0.97; EVar6 = (EntityPtr)0x3; } if (0 < npc->_projectileCooldown) { cooldownLeft = npc->_projectileCooldown - iVar9; iVar3 = 0; if (0 < cooldownLeft) { iVar3 = cooldownLeft; } npc->_projectileCooldown = iVar3; } if (npc->_projectileDelay < 0) { iVar9 = npc->_projectileDelay + iVar9; iVar3 = 0; if (iVar9 < 0) { iVar3 = iVar9; } if (-1 < iVar3) { iVar3 = 5; } npc->_projectileDelay = iVar3; } overlayAnimName = (npc->_sprite)._overlayAnimState._animData; if (overlayAnimName == (byte *)0x0) { bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(&PTR_s_HeadLeft_00b60b30)[(int)EVar6],1); if ((bVar1 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } else { if (0xf < *(uint *)(overlayAnimName + 0x14)) { overlayAnimName = *(byte **)overlayAnimName; } headAnimName = (&PTR_s_HeadLeft_00b60b30)[(int)EVar6]; do { bVar1 = *overlayAnimName; isNameLess = bVar1 < *headAnimName; if (bVar1 != *headAnimName) { LAB_004f1111: uVar5 = -(uint)isNameLess | 1; goto LAB_004f1116; } if (bVar1 == 0) break; bVar1 = overlayAnimName[1]; isNameLess = bVar1 < headAnimName[1]; if (bVar1 != headAnimName[1]) goto LAB_004f1111; overlayAnimName = overlayAnimName + 2; headAnimName = headAnimName + 2; } while (bVar1 != 0); uVar5 = 0; LAB_004f1116: if (uVar5 != 0) { ANM2::SetOverlayAnimation(&npc->_sprite,(&PTR_s_HeadLeft_00b60b30)[(int)EVar6],0); } } fVar10 = (npc->_velocity).y; fVar11 = (npc->_velocity).x; fVar10 = sqrtf(fVar11 * fVar11 + fVar10 * fVar10); if (0.1 <= fVar10) { iVar9 = vector_to_direction(&npc->_velocity); ANM2::Play(&npc->_sprite,(&PTR_s_WalkLeft2_00b60b20)[iVar9],0); pVVar2 = (Vector *)puStack_20; } else { ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkDown2",0); pVVar2 = (Vector *)puStack_20; } break; case 4: puStack_20 = (undefined1 *)(local_34 + 6); bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if ((bVar1 == 0) || (npc->_controllerID != -1)) { Entity_NPC::CalcTargetPosition(npc,&local_158,0.0); if ((npc->_i1 < 1) || (iVar9 = npc->_i1 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime), npc->_i1 = iVar9, iVar9 < 1)) { if (npc->_entityRef != (EntityPtr)0x0) { local_14c = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_14c); } npc->_entityRef = (EntityPtr)0x0; } parentNpc = Entity_NPC::ParentNPC(npc); if ((parentNpc == (Entity_NPC *)0x0) || (npc->_i2 != 1)) { parentNpc = Entity_NPC::ParentNPC(npc); if ((parentNpc != (Entity_NPC *)0x0) && (npc->_i2 == 2)) goto LAB_004efc82; EVar6 = npc->_entityRef; if ((EVar6 == (EntityPtr)0x0) || (bVar1 = Entity::IsEnemy((Entity *)EVar6), bVar1 != 0)) { if (EVar6 == (EntityPtr)0x0) goto LAB_004efee4; } else { local_14c = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_14c); npc->_entityRef = (EntityPtr)0x0; LAB_004efee4: EVar6 = (EntityPtr)0x0; fVar10 = local_158.y - (npc->_pos).y; fVar11 = local_158.x - (npc->_pos).x; if (6400.0 < fVar10 * fVar10 + fVar11 * fVar11) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218), (EntityList_EL *)(auStack_54 + 0x18),&npc->_pos,60.0,8); local_14 = 0.0; pvVar8 = (void *)0x0; if ((void *)local_34[0].y != (void *)0x0) { do { EVar6 = *(EntityPtr *)((int)local_38 + (int)pvVar8 * 4); if (((EVar6 != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar6 + 0x28) == 1) ) || (*(int *)((int)EVar6 + 0x28) - 10U < 0x3de)))) && (EVar6 != (EntityPtr)npc)) { local_158.y = *(float *)((int)EVar6 + 0x16c); isOtherFriendly = (*(uint *)((int)EVar6 + 0x168) & 0x20000000) != 0; if (((bool)isOtherFriendly == ((npc->_flags & 0x20000000) != 0)) && ((*(uint *)((int)EVar6 + 0x168) & 0x10) == 0)) { if (npc->_entityRef != (EntityPtr)0x0) { local_14c = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_14c); } npc->_entityRef = EVar6; std::multiset::insert(&npc->_entityRef); uVar5 = Random(); npc->_i1 = uVar5 % 0xf + 0x1e; break; } } pvVar8 = (void *)((int)pvVar8 + 1); } while (pvVar8 < (uint)local_34[0].y); } local_14 = -NAN; EntityList_Query::~EntityList_Query(auStack_54 + 0x18); EVar6 = npc->_entityRef; } } if (EVar6 != (EntityPtr)0x0) { local_158.x = *(float *)((int)EVar6 + 0x33c); local_158.y = *(float *)((int)EVar6 + 0x340); goto LAB_004f007d; } bVar1 = 1; iVar9 = 900; fVar10 = 0.75; pVVar2 = Entity_NPC::CalcTargetPosition(npc,&local_158,0.0); } else { parentNpc = Entity_NPC::ParentNPC(npc); pEVar4 = Entity_NPC::GetPlayerTarget(parentNpc); local_14c = (EntityPtr)(pEVar4->_pos).x; local_148.y = (pEVar4->_pos).y; local_148.x = (float)local_14c; local_138 = (EntityPtr)local_148.y; parentNpc = Entity_NPC::ParentNPC(npc); local_158.y = 0.0; local_178.x = (float)local_14c - (parentNpc->_pos).x; local_178.y = (float)local_138 - (parentNpc->_pos).y; local_158.x = 0.0; scratchVec.x = local_178.x + local_178.x + (float)local_14c; scratchVec.y = local_178.y + local_178.y + (float)local_138; Room::check_line_collision (&local_148,&scratchVec,npc->_entityGridCollisionClass,0,extraout_ECX,&local_158); throwDir = Vector::Normalized(&local_178,&local_148); bVar1 = 1; iVar9 = 900; pVVar2 = &scratchVec; fVar10 = 0.75; scratchVec.x = local_158.x - throwDir->x * 20.0; scratchVec.y = local_158.y - throwDir->y * 20.0; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar2,fVar10,iVar9,bVar1); } else { LAB_004efc82: pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_158.x = (pEVar4->_pos).x; local_158.y = (pEVar4->_pos).y; LAB_004f007d: PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_158,0); npc->_friction = npc->_friction * 0.8; } npc->_friction = npc->_friction * 0.97; fVar10 = (npc->_velocity).y; fVar11 = (npc->_velocity).x; fVar10 = sqrtf(fVar11 * fVar11 + fVar10 * fVar10); if (0.1 <= fVar10) { iVar9 = vector_to_direction(&npc->_velocity); ANM2::Play(&npc->_sprite,(&PTR_s_WalkLeft_00b60b00)[iVar9],0); } else { ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkDown",0); } pVVar2 = (Vector *)puStack_20; if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Footstep"); pVVar2 = (Vector *)puStack_20; } break; case 5: npc->_friction = npc->_friction * 0.5; puStack_20 = (undefined1 *)(local_34 + 6); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { play_sound_with_fart_seed(0x73,1.0,2,0,1.0); play_sound_with_fart_seed(0x50,1.0,2,0,1.0); Color::Color(&tmpColor); Entity::MakeGroundPoofAtSelf((Entity *)npc,color,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; local_158.x = 10.0; local_158.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_158,8,&projParams); npc->_projectileDelay = -0x1e; npc->_projectileCooldown = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (pVVar2 = (Vector *)puStack_20, (npc->_sprite)._animState._isPlaying == 0)) { pvVar8 = npc->_config; refSlot = &npc->_entityRef; *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh & 0xfffffff7; npc->_isInvicible = 0; npc->_mass = *(float *)((int)pvVar8 + 0x44); npc->_state = 3; if (*refSlot != (EntityPtr)0x0) { local_148.y = (float)refSlot; std::multiset::erase(&local_148.y); } *refSlot = (EntityPtr)0x0; npc->_i1 = 0; pVVar2 = (Vector *)puStack_20; } break; case 7: npc->_friction = npc->_friction * 0.3; if (((npc->_sprite)._animState._animData == (void *)0x0) || (pVVar2 = local_34 + 6, (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)(local_34 + 6); ANM2::Play(&npc->_sprite,(byte *)"StunnedLoop",0); pVVar2 = (Vector *)puStack_20; } break; case 0xd: npc->_friction = npc->_friction * 0.5; puStack_20 = (undefined1 *)(local_34 + 6); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { pvVar8 = npc->_config; *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh & 0xfffffff7; npc->_isInvicible = 0; npc->_mass = *(float *)((int)pvVar8 + 0x44); } goto LAB_004f1aa3; case 0xe: npc->_friction = npc->_friction * 0.3; puStack_20 = (undefined1 *)(local_34 + 6); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if ((((bVar1 != 0) && (parentNpc = Entity_NPC::ParentNPC(npc), parentNpc != (Entity_NPC *)0x0)) && (parentNpc = Entity_NPC::ParentNPC(npc), parentNpc->_type == 0x399)) && (parentNpc = Entity_NPC::ParentNPC(npc), parentNpc->_state == 6)) { parentNpc = Entity_NPC::ParentNPC(npc); parentNpc->_state = 3; parentNpc = Entity_NPC::ParentNPC(npc); parentNpc->_stateFrame = -1000; } LAB_004f1aa3: pVVar2 = (Vector *)puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; pvVar8 = npc->_config; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh & 0xfffffff7; npc->_isInvicible = 0; npc->_mass = *(float *)((int)pvVar8 + 0x44); npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } break; case 0x10: npc->_friction = npc->_friction * 0.5; pVVar2 = local_34 + 6; if (npc->_i2 == 99) { if (((npc->_sprite)._animState._animData == (void *)0x0) || (pVVar2 = local_34 + 6, (npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"FlameIdle",0); pVVar2 = (Vector *)puStack_20; if (npc->_i2 != 99) goto LAB_004f14d2; } puStack_20 = (undefined1 *)pVVar2; bVar1 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); pVVar2 = (Vector *)puStack_20; if ((bVar1 != 0) && (npc->_projectileCooldown < 1)) { iVar3 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); pVVar2 = (Vector *)puStack_20; if (iVar3 != 0) { parentNpc = Entity_NPC::ParentNPC(npc); pVVar2 = (Vector *)puStack_20; if (parentNpc != (Entity_NPC *)0x0) { parentNpc = Entity_NPC::ParentNPC(npc); pVVar2 = (Vector *)puStack_20; if (parentNpc->_state == 6) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar10 = (npc->_pos).x - (pEVar4->_pos).x; fVar11 = (npc->_pos).y - (pEVar4->_pos).y; pVVar2 = (Vector *)puStack_20; if (fVar11 * fVar11 + fVar10 * fVar10 < 14400.0) { ANM2::Play(&npc->_sprite,(byte *)"FlameShoot",0); npc->_projectileCooldown = 0x2d; pVVar2 = (Vector *)puStack_20; } } } } } } LAB_004f14d2: puStack_20 = (undefined1 *)pVVar2; if (0 < npc->_projectileCooldown) { iVar3 = npc->_projectileCooldown - iVar9; if (iVar3 < 0) { iVar3 = 0; } npc->_projectileCooldown = iVar3; } if (npc->_parent == (EntityPtr)0x0) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if ((bVar1 != 0) && (bVar1 = Entity::IsFriendly((Entity *)npc), bVar1 == 0)) { Entity_NPC::QueryNPCsType(siblingQuery,npc->_type,-1); local_14 = 4.2039e-45; fVar10 = 0.0; if (local_158.y != 0.0) { do { iVar3 = *(int *)(siblingData + (int)fVar10 * 4); if ((iVar3 != 0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)(iVar3 + 0x28) == 1)) || (*(int *)(iVar3 + 0x28) - 10U < 0x3de)))) { local_34[0].x = *(float *)(iVar3 + 0x16c); if (((*(uint *)(iVar3 + 0x168) & 0x20000000) == 0) && ((*(uint *)(iVar3 + 0x168) & 0x20000010) == 0)) { local_14 = -NAN; EntityList_Query::~EntityList_Query(siblingQuery); goto LAB_004f1615; } } fVar10 = (float)((int)fVar10 + 1); } while ((uint)fVar10 < (uint)local_158.y); } fVar10 = 0.0; if (local_158.y != 0.0) { iVar9 = siblingData; fVar11 = local_158.y; do { sibling = *(int **)(iVar9 + (int)fVar10 * 4); if (sibling != (int *)0x0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (sibling[10] == 1)) || (sibling[10] - 10U < 0x3de)) && ((sibling[0x5a] & 0x20000000U) == 0)) { entityRef = EntityRef::EntityRef((EntityRef *)auStack_54); (**(code **)(*sibling + 0x24))(entityRef); fVar11 = local_158.y; } iVar9 = siblingData; } fVar10 = (float)((int)fVar10 + 1); } while ((uint)fVar10 < (uint)fVar11); } EntityList_Query::~EntityList_Query(siblingQuery); ExceptionList = local_1c; return; } LAB_004f1615: npc->_stateFrame = npc->_stateFrame - iVar9; pVVar2 = (Vector *)puStack_20; if (npc->_stateFrame < 1) { ANM2::Play(&npc->_sprite,(byte *)"Regen",0); npc->_state = 0xd; pVVar2 = (Vector *)puStack_20; } } else { if (((npc->_i2 == 99) && (bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"), bVar1 != 0)) && (bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"FlameShoot"), bVar1 != 0)) { uVar5 = Random(); EVar6 = (EntityPtr)Game::Spawn(g_game,9,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); *(undefined4 *)((int)EVar6 + 0x410) = 0xc0c00000; ((std_vector *)((int)EVar6 + 0x414))->_begin = (void *)0x0; *(float *)((int)EVar6 + 0x420) = 1.0; *(int *)((int)EVar6 + 0x438) = 0; *(int *)((int)EVar6 + 0x43c) = 0x100; Entity::SetParent((Entity *)EVar6,(Entity *)npc); uVar7 = Color::Color(0); (**(code **)(*(int *)EVar6 + 0x3c))(uVar7,6,1,1,1); (**(code **)(*(int *)EVar6 + 0xc))(); uVar5 = Random(); pEVar4 = Game::Spawn(g_game,1000,0x85,&npc->_targetPosition,&g_vectorZero,(Entity *)0x0,0, uVar5); local_38 = 0.0; local_58 = 0x3f800000; auStack_54._0_4_ = 0x3f800000; auStack_54._4_4_ = 0x3f800000; auStack_54._8_4_ = 0x3f800000; auStack_54._12_4_ = 0x3f4ccccd; auStack_54._16_4_ = 0.6; auStack_54._20_4_ = 1.4; auStack_54._24_4_ = 1.0; local_34[0].x = 0.0; local_34[0].y = 0.0; (**(code **)(*(int *)pEVar4 + 0x3c))(&local_58,0xffffffff,0xff,0,1); SoundEffects::PlayWithFartOverride(0xa2,0.5,2,0,1.0); if (npc->_entityRef != (EntityPtr)0x0) { local_148.y = (float)&npc->_entityRef; std::multiset::erase(&local_148.y); } npc->_entityRef = EVar6; std::multiset::insert(&npc->_entityRef); } EVar6 = npc->_entityRef; if (((EVar6 != (EntityPtr)0x0) && (*(int *)((int)EVar6 + 0x28) == 9)) && (15.0 < *(float *)((int)EVar6 + 0x3a4))) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_158.x = (pEVar4->_pos).x - *(float *)((int)EVar6 + 0x33c); local_158.y = (pEVar4->_pos).y - *(float *)((int)EVar6 + 0x340); Vector::Resized(&local_158,&scratchVec,10.0); *(uint *)((int)EVar6 + 0x43c) = *(uint *)((int)EVar6 + 0x43c) & 0xfffffeff; *(float *)((int)EVar6 + 0x360) = scratchVec.x; *(undefined4 *)((int)EVar6 + 0x438) = *(undefined4 *)((int)EVar6 + 0x438); *(float *)((int)EVar6 + 0x364) = scratchVec.y; Color::Color(&tmpColor); local_158.x = *(float *)((int)EVar6 + 0x34c) * 0.65; scratchVec.x = *(float *)((int)EVar6 + 0x33c); scratchVec.y = *(float *)((int)EVar6 + 0x340); local_158.y = *(float *)((int)EVar6 + 0x350) * 0.65; pEVar4 = spawn_blood_explosion(5,&scratchVec,&local_158,color_00,&g_vectorZero); local_38 = 0.4; local_34[0].x = 0.3; local_58 = 0; auStack_54._0_4_ = 0; auStack_54._4_4_ = 0; auStack_54._8_4_ = 0x3f800000; local_34[0].y = 0.7; (pEVar4->_sprite)._flipX = 1; pEVar4->_renderDepthOffset = 1.0; auStack_54._12_4_ = 0; auStack_54._16_4_ = 0.0; auStack_54._20_4_ = 0.0; auStack_54._24_4_ = 0.0; (**(code **)(*(int *)pEVar4 + 0x3c))(&local_58,0xffffffff,0xff,0,1); if (4 < (uint)(pEVar4->_sprite)._layerCount) { BlendMode::SetMode(auStack_54 + 0x14,2,unusedArg); src = auStack_54 + 0x14; headLayer = ANM2::GetLayer(&pEVar4->_sprite,&DAT_00000004); copy_20_bytes(headLayer->_blendMode,src); } (**(code **)(*(int *)pEVar4 + 0xc))(); Entity_NPC::PlaySound(npc,0xf9,1.0,2,0,1.0); if (npc->_entityRef != (EntityPtr)0x0) { local_148.y = (float)&npc->_entityRef; std::multiset::erase(&local_148.y); } npc->_entityRef = (EntityPtr)0x0; } parentNpc = Entity_NPC::ParentNPC(npc); pVVar2 = (Vector *)puStack_20; if ((parentNpc != (Entity_NPC *)0x0) && (parentNpc->_state == 0xd)) { npc->_stateFrame = 0; ANM2::Play(&npc->_sprite,(byte *)"Regen",0); Sprite::SetFrame_1((Sprite *)&npc->_sprite,0xf); npc->_state = 0xd; pVVar2 = (Vector *)puStack_20; } } } puStack_20 = (undefined1 *)pVVar2; if (npc->_state == 3) { if ((npc->_sprite)._animState._animData != (void *)0x0) { local_14c = (EntityPtr) AnimationState::GetNullFrame(&(npc->_sprite)._animState,(byte *)"HeadOffset"); sprite = &npc->_sprite; if (local_14c != (EntityPtr)0x0) { headLayer = ANM2::GetLayer(sprite,(byte *)0x1); (headLayer->_pos).x = (float)*(EntityPtr *)local_14c; (headLayer->_pos).y = (float)*(EntityPtr *)((int)local_14c + 4); headLayer = ANM2::GetLayer(sprite,(byte *)0x1); (headLayer->_size).x = (float)((std_multiset *)((int)local_14c + 0x10))->_head; (headLayer->_size).y = *(float *)((int)local_14c + 0x14); local_148.y = *(float *)((int)local_14c + 0x44); headLayer = ANM2::GetLayer(sprite,(byte *)0x1); headLayer->_rotation = local_148.y; goto LAB_004f1c54; } } sprite = &npc->_sprite; headLayer = ANM2::GetLayer(sprite,(byte *)0x1); (headLayer->_pos).x = g_vectorZero.x; (headLayer->_pos).y = g_vectorZero.y; headLayer = ANM2::GetLayer(sprite,(byte *)0x1); (headLayer->_size).x = g_vectorOne.x; (headLayer->_size).y = g_vectorOne.y; headLayer = ANM2::GetLayer(sprite,(byte *)0x1); headLayer->_rotation = 0.0; } else if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (headLayer->_pos).x = g_vectorZero.x; (headLayer->_pos).y = g_vectorZero.y; headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); headLayer->_rotation = 0.0; headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (headLayer->_size).x = g_vectorOne.x; (headLayer->_size).y = g_vectorOne.y; } LAB_004f1c54: Room::RaiseGridPathAtPos(g_game->_room,&npc->_pos,900); fVar10 = (npc->_targetPosition).x; if ((fVar10 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { fVar11 = (npc->_targetPosition).y; fVar12 = (npc->_pos).y; (npc->_velocity).x = fVar10 - (npc->_pos).x; (npc->_velocity).y = fVar11 - fVar12; } if (((((npc->_dead != 0) || (npc->_state != 0x10)) || (parentNpc = Entity_NPC::ParentNPC(npc), parentNpc == (Entity_NPC *)0x0)) || (parentNpc = Entity_NPC::ParentNPC(npc), parentNpc->_state == 7)) && ((EVar6 = npc->_entityRef, EVar6 != (EntityPtr)0x0 && (*(int *)((int)EVar6 + 0x28) == 9)))) { *(undefined1 *)((int)EVar6 + 0x173) = 1; } if ((npc->_dead != 0) && (uVar5 = (uint)npc->_flags, (uVar5 & 0x10) == 0)) { if (npc->_parent == (EntityPtr)0x0) { iVar9 = npc->_subtype + -1; local_178.y = 0.0; fVar10 = (float)((double)iVar9 + __uint_to_double_fixup[-(iVar9 >> 0x1f)]); local_148.y = fVar10 + fVar10; pVVar2 = &local_148; if (local_148.y <= 0.0) { pVVar2 = &local_178; } fVar10 = pVVar2->y; if (1.0 <= fVar10) { fVar10 = 1.0; } fVar10 = 10.0 - fVar10; } else { fVar10 = *(float *)((int)npc->_config + 0x50); } npc->_health = fVar10; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; *(uint *)&npc->_flags = uVar5 | 0x11; npc->_dead = 0; Entity::RemoveStatusEffects((Entity *)npc); npc->_mass = 200.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_isInvicible = 1; npc->_state = 0x10; npc->_projectileCooldown = 0x1e; npc->_projectileDelay = -0x3c; if ((npc->_parent == (EntityPtr)0x0) || (*(Entity_NPC **)((int)npc->_parent + 0x3c0) != npc)) { ANM2::Play(&npc->_sprite,(byte *)"Collapse",0); } else { ANM2::Play(&npc->_sprite,(byte *)"FlameCollapse",0); npc->_i2 = 99; } npc->_stateFrame = 0x96; if (npc->_parent == (EntityPtr)0x0) { npc->_subtype = npc->_subtype + 1; } } ExceptionList = local_1c; return; } //@@ 004f1ec0 NpcAI::ENTITY_MAZE_ROAMER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 890 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MAZE_ROAMER(Entity_NPC *npc) { float fVar1; undefined4 uVar2; byte bVar3; EntityPtr twin; uint uVar4; int iVar5; Entity_NPC *partner; Vector *pVVar6; Entity *playerTarget; Vector *extraout_ECX; Vector *pVVar7; Vector *extraout_ECX_00; Vector *twin; float fVar8; float fVar9; undefined1 auStack_e0 [4]; Vector VStack_dc; Vector VStack_d4; Vector *pVStack_cc; Vector VStack_c8; Vector VStack_c0; ProjectileParams projParams; uint local_c; Game *game; int gridWidth; Room *room; game = g_game; local_c = __security_cookie ^ (uint)auStack_e0; switch(npc->_state) { case 0: *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; iVar5 = npc->_spawnGridIndex; uVar2 = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 4; *(undefined4 *)((int)&npc->_flags + 4) = uVar2; if (((-1 < iVar5) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x8000000000), bVar3 != 0)) && (game = g_game, npc->_subtype == 0)) { Room::GetCenterPos(&VStack_d4); VStack_dc.x = (VStack_d4.x + VStack_d4.x) - (npc->_pos).x; VStack_dc.y = (VStack_d4.y + VStack_d4.y) - (npc->_pos).y; twin = (EntityPtr) Game::SpawnEx(game,0x37a,0,&VStack_dc,&g_vectorZero,(Entity *)npc,1,npc->_initSeed,0); Entity_NPC::Morph((Entity_NPC *)twin,npc->_type,npc->_variant,1,npc->_championColorIdx); bVar3 = Entity::HasEntityFlags((Entity *)npc,0x8000000000); if (bVar3 != 0) { *(uint *)((int)twin + 0x16c) = *(uint *)((int)twin + 0x16c) | 0x80; *(undefined4 *)((int)twin + 0x168) = *(undefined4 *)((int)twin + 0x168); } (**(code **)(*(int *)twin + 0xc))(); if (npc->_child != (EntityPtr)0x0) { pVStack_cc = (Vector *)&npc->_child; std::multiset::erase(&pVStack_cc); } npc->_child = twin; std::multiset::insert(&npc->_child); pVVar6 = (Vector *)((int)twin + 0x3bc); if (*(EntityPtr *)((int)twin + 0x3bc) != (EntityPtr)0x0) { pVStack_cc = pVVar6; std::multiset::erase(&pVStack_cc); } pVVar6->x = (float)npc; std::multiset::insert(pVVar6); return; } break; case 3: VStack_d4.x = (float)&npc->_pos; Room::RaiseGridPathAtPos(g_game->_room,(Vector *)VStack_d4.x,900); playerTarget = Entity_NPC::GetPlayerTarget(npc); VStack_dc.x = (playerTarget->_pos).x; VStack_dc.y = (playerTarget->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&VStack_dc,1.0,900,1); fVar8 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; if (1.0 <= fVar9 * fVar9 + fVar8 * fVar8) { iVar5 = vector_to_direction(&npc->_velocity); npc->_i1 = iVar5; ANM2::Play(&npc->_sprite,(&PTR_s_WalkLeft2_00b60b20)[iVar5],0); } else { npc->_i1 = -1; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkDown2",0); } bVar3 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 == 0)) && ((bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar3 == 0 || (playerTarget = Entity_NPC::GetPlayerTarget(npc), playerTarget->_type != 1)))) { room = g_game->_room; playerTarget = Entity_NPC::GetPlayerTarget(npc); VStack_c8.x = (playerTarget->_pos).x; VStack_dc.x = (playerTarget->_pos).y; playerTarget = Entity_NPC::GetPlayerTarget(npc); pVStack_cc = (Vector *)(playerTarget->_velocity).x; VStack_c0.x = (playerTarget->_velocity).y; uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 16.0; VStack_c8.x = (float)pVStack_cc * fVar8 + VStack_c8.x; VStack_c8.y = VStack_c0.x * fVar8 + VStack_dc.x; Room::GetClampedPositionImpl(room,&VStack_dc,&VStack_c8,20.0,20.0,20.0,20.0); room = g_game->_room; iVar5 = (npc->_pathfinder)._gridIndex; gridWidth = room->_gridWidth; VStack_c0.x = (float)(iVar5 % gridWidth) * 40.0 + 40.0; VStack_c0.y = (float)(iVar5 / gridWidth) * 40.0 + 120.0; fVar9 = VStack_c0.x - VStack_dc.x; fVar8 = VStack_c0.y - VStack_dc.y; if ((((ABS(fVar9) < 20.0) || (ABS(fVar8) < 20.0)) && (fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9), fVar8 < 200.0)) && (bVar3 = Room::CheckLine(room,&VStack_c0,&VStack_dc,3,999,0,0,(Vector *)0x0), bVar3 != 0)) { npc->_state = 9; npc->_stateFrame = 0; VStack_d4.y = VStack_dc.y - *(float *)((int)VStack_d4.x + 4); VStack_d4.x = VStack_dc.x - *(float *)VStack_d4.x; iVar5 = vector_to_direction(&VStack_d4); npc->_i1 = iVar5; ANM2::Play(&npc->_sprite,(&PTR_s_AttackLeft2_00b60b10)[iVar5],0); return; } } break; case 4: if ((npc->_child == (EntityPtr)0x0) && (npc->_parent == (EntityPtr)0x0)) { ANM2::Play(&npc->_sprite,(byte *)"Transition",0); npc->_state = 0x10; return; } if (npc->_subtype == 0) { bVar3 = Entity::IsFrame((Entity *)npc,0x1e,npc->_index); if ((bVar3 != 0) && (uVar4 = Random(), uVar4 % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,0.8,0x78,0,1.0); } pVStack_cc = &npc->_pos; room = g_game->_room; iVar5 = Room::GetGridIndex(room,pVStack_cc); Room::SetGridPath(room,iVar5,900); PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.25,0); npc->_friction = npc->_friction * 0.8; fVar8 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; if (1.0 <= fVar9 * fVar9 + fVar8 * fVar8) { uVar4 = vector_to_direction(&npc->_velocity); npc->_i1 = uVar4; LAB_004f259c: ANM2::Play(&npc->_sprite,(&PTR_s_WalkLeft_00b60b00)[uVar4],0); } else { npc->_i1 = -1; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkDown",0); } } else { Room::GetCenterPos(&VStack_d4); fVar8 = *(float *)((int)npc->_parent + 0x33c); fVar9 = *(float *)((int)npc->_parent + 0x340); pVStack_cc = &npc->_pos; npc->_entityGridCollisionClass = 0; fVar1 = (npc->_pos).y; (npc->_velocity).x = ((VStack_d4.x + VStack_d4.x) - fVar8) - pVStack_cc->x; (npc->_velocity).y = ((VStack_d4.y + VStack_d4.y) - fVar9) - fVar1; room = game->_room; iVar5 = Room::GetGridIndex(room,pVStack_cc); Room::SetGridPath(room,iVar5,900); PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); partner = Entity_NPC::ParentNPC(npc); iVar5 = partner->_i1; npc->_i1 = iVar5; if (iVar5 != -1) { uVar4 = iVar5 + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } goto LAB_004f259c; } ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkDown",0); } bVar3 = Entity::IsFrame((Entity *)npc,3,npc->_index); if (((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 == 0)) && ((bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar3 == 0 || (playerTarget = Entity_NPC::GetPlayerTarget(npc), playerTarget->_type != 1)))) { room = g_game->_room; playerTarget = Entity_NPC::GetPlayerTarget(npc); VStack_dc.x = (playerTarget->_pos).x; VStack_c8.x = (playerTarget->_pos).y; playerTarget = Entity_NPC::GetPlayerTarget(npc); VStack_d4.x = (playerTarget->_velocity).x; VStack_c0.x = (playerTarget->_velocity).y; uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 16.0; VStack_dc.x = VStack_d4.x * fVar8 + VStack_dc.x; VStack_dc.y = VStack_c0.x * fVar8 + VStack_c8.x; Room::GetClampedPositionImpl(room,&VStack_d4,&VStack_dc,20.0,20.0,20.0,20.0); room = g_game->_room; iVar5 = (npc->_pathfinder)._gridIndex; gridWidth = room->_gridWidth; VStack_dc.x = (float)(iVar5 % gridWidth) * 40.0 + 40.0; VStack_dc.y = (float)(iVar5 / gridWidth) * 40.0 + 120.0; fVar9 = VStack_dc.x - VStack_d4.x; fVar8 = VStack_dc.y - VStack_d4.y; if ((((ABS(fVar9) < 20.0) || (ABS(fVar8) < 20.0)) && (fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9), fVar8 < 200.0)) && (bVar3 = Room::CheckLine(room,&VStack_dc,&VStack_d4,3,999,0,0,(Vector *)0x0), bVar3 != 0)) { npc->_state = 8; npc->_stateFrame = 0; VStack_dc.x = VStack_d4.x - pVStack_cc->x; VStack_dc.y = VStack_d4.y - pVStack_cc->y; iVar5 = vector_to_direction(&VStack_dc); npc->_i1 = iVar5; ANM2::Play(&npc->_sprite,(&PTR_s_AttackLeft_00b60af0)[iVar5],0); npc->_i2 = 0; partner = Entity_NPC::ChildNPC(npc); if (partner == (Entity_NPC *)0x0) { partner = Entity_NPC::ParentNPC(npc); } else { partner = Entity_NPC::ChildNPC(npc); } if (partner != (Entity_NPC *)0x0) { partner->_state = 8; partner->_stateFrame = 0; partner->_i1 = npc->_i1; partner->_i2 = 1; uVar4 = npc->_i1 + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } ANM2::Play(&partner->_sprite,(&PTR_s_AttackLeft_00b60af0)[uVar4],0); return; } } } break; case 8: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { partner = Entity_NPC::ParentNPC(npc); if (partner == (Entity_NPC *)0x0) { partner = Entity_NPC::ChildNPC(npc); } else { partner = Entity_NPC::ParentNPC(npc); } if ((npc->_i2 == 0) || (partner == (Entity_NPC *)0x0)) { if ((npc->_controllerID == -1) || (bVar3 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar3 == 0)) { playerTarget = Entity_NPC::GetPlayerTarget(npc); pVVar7 = &VStack_dc; pVVar6 = &VStack_c8; VStack_dc.x = (playerTarget->_pos).x - (npc->_pos).x; VStack_dc.y = (playerTarget->_pos).y - (npc->_pos).y; } else { pVVar6 = &VStack_c0; pVVar7 = extraout_ECX_00; } pVVar6 = Vector::Resized(pVVar7,pVVar6,10.0); VStack_d4.x = pVVar6->x; VStack_d4.y = pVVar6->y; } else { if ((partner->_controllerID == -1) || (bVar3 = Vector::operator_ne(&partner->_controllerMovement,&g_vectorZero), bVar3 == 0)) { playerTarget = Entity_NPC::GetPlayerTarget(partner); pVVar7 = &VStack_dc; pVVar6 = &VStack_c8; VStack_dc.x = (playerTarget->_pos).x - (partner->_pos).x; VStack_dc.y = (playerTarget->_pos).y - (partner->_pos).y; } else { pVVar6 = &VStack_c0; pVVar7 = extraout_ECX; } pVVar6 = Vector::Resized(pVVar7,pVVar6,10.0); VStack_d4.x = -pVVar6->x; VStack_d4.y = -pVVar6->y; } ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 0x10; Entity_NPC::PlaySound(npc,0x1ca,1.0,2,0,1.0); Entity_NPC::FireProjectiles(npc,&npc->_pos,&VStack_d4,0,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004f2a55; } npc->_state = 4; goto LAB_004f2a55; case 9: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { if ((npc->_controllerID == -1) || (bVar3 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar3 == 0)) { playerTarget = Entity_NPC::GetPlayerTarget(npc); VStack_d4.x = (playerTarget->_pos).x - (npc->_pos).x; VStack_d4.y = (playerTarget->_pos).y - (npc->_pos).y; pVVar6 = Vector::Resized(&VStack_d4,&VStack_c8,10.0); } else { pVVar6 = Vector::Resized(twin,&VStack_c0,10.0); } VStack_dc.x = pVVar6->x; VStack_dc.y = pVVar6->y; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 0x10; Entity_NPC::PlaySound(npc,0x1ca,1.0,2,0,1.0); Entity_NPC::FireProjectiles(npc,&npc->_pos,&VStack_dc,0,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004f2a55; } npc->_state = 3; LAB_004f2a55: npc->_friction = npc->_friction * 0.3; return; case 0x10: npc->_entityGridCollisionClass = 5; npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } } return; } //@@ 004f2c20 NpcAI::ENTITY_GOAT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 891 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GOAT(Entity_NPC *npc) { char cVar1; uint uVar2; undefined4 *puVar3; Vector pos; qword qVar4; undefined4 *puVar5; byte bVar6; uint uVar7; void *pvVar8; undefined4 *puVar9; Entity *target; Vector *pVVar10; char *pcVar11; Entity_Laser *laser; EntityPtr EVar12; Entity_NPC *laser; EntityPtr targetOwner; int iVar13; qword *allocatedBytes; EntityPtr extraout_EDX; EntityPtr extraout_EDX_00; int *piVar14; int iVar15; int iVar16; float fVar17; float fVar18; float fVar19; Vector beamDirLeft; Vector beamOffsetDown; Vector beamDirDown; Vector beamOffsetRight; Vector beamDirRight; Vector local_228; Vector local_220; Vector local_218; Vector local_210; undefined4 *followersByDistance; undefined4 *local_204; Vector local_200; EntityPtr local_1f8; EntityPtr local_1f4; Vector local_1f0; EntityPtr local_1e4; EntityPtr leader; byte isOtherFriendly; EntityPtr local_1d8; float local_1d4; ProjectileParams shot2Params; ProjectileParams shotParams; ColorMod warningColor; void *local_54; char local_50 [8]; undefined4 *local_48; EntityPtr local_44; EntityPtr local_40; void *local_3c; char local_38 [4]; EntityList_EL local_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; Entity_NPC *otherGoat; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af3f10; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; EVar12 = npc->_entityRef; local_1d4 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_1d8 = (EntityPtr)free_exref; local_1f0.y = (float)npc; leader = EVar12; local_24 = uVar7; if ((EVar12 == (EntityPtr)0x0) || ((((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)EVar12 + 0x28) != 1)) && (0x3dd < *(int *)((int)EVar12 + 0x28) - 10U)) || (pcVar11 = local_38 + 0x34, ((*(uint *)((int)EVar12 + 0x168) & 0x20000000) != 0) != ((npc->_flags & 0x20000000) != 0))))) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_34,npc->_type,-1,-1,0,0); EVar12 = (EntityPtr)0x0; local_14 = 0; if ((EntityPtr)local_34._size != (EntityPtr)0x0) { do { otherGoat = *(Entity_NPC **)((int)local_34._data + (int)EVar12 * 4); if (((otherGoat != (Entity_NPC *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (otherGoat->_type == 1)) || (otherGoat->_type - 10U < 0x3de)) && ((otherGoat != npc && (((otherGoat->_flags & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0))))))) && ((leader = otherGoat->_entityRef, leader != (EntityPtr)0x0 && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)leader + 0x28) == 1)) || (*(int *)((int)leader + 0x28) - 10U < 0x3de)))))) goto LAB_004f2dce; EVar12 = (EntityPtr)((int)EVar12 + 1); } while ((uint)EVar12 < (uint)local_34._size); } leader = (EntityPtr)npc; LAB_004f2dce: EVar12 = leader; if (npc->_entityRef != (EntityPtr)0x0) { local_218.y = (float)&npc->_entityRef; std::multiset::erase(&local_218.y); } npc->_entityRef = EVar12; if (EVar12 != (EntityPtr)0x0) { std::multiset::insert(&npc->_entityRef); } local_14 = 0xffffffff; npc->_projectileCooldown = 1; pcVar11 = puStack_20; if (local_34._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (local_34._data != (void *)0x0) { uVar2 = *(uint *)((int)local_34._data - 4U); qVar4 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar2; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar4 < uVar2); (*(code *)local_1d8)((uint *)((int)local_34._data - 4U),uVar7); pcVar11 = puStack_20; } } } puStack_20 = pcVar11; local_14 = 0xffffffff; local_1f4 = (EntityPtr)0x3f800000; if (EVar12 == (EntityPtr)npc) { if (npc->_i2 < 1) { if (npc->_projectileCooldown < 1) { followersByDistance = (undefined4 *)0x0; local_204 = (undefined4 *)0x0; followersByDistance = operator_new(0x18); *followersByDistance = followersByDistance; followersByDistance[1] = followersByDistance; followersByDistance[2] = followersByDistance; *(undefined2 *)(followersByDistance + 3) = 0x101; local_14 = 5; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_34,npc->_type,-1,-1,0,0); local_14 = CONCAT31(local_14._1_3_,6); local_218.y = 0.0; local_1e4 = (EntityPtr)local_34._data; if ((EntityPtr)local_34._size != (EntityPtr)0x0) { do { fVar18 = *(float *)((int)local_34._data + (int)local_218.y * 4); EVar12 = (EntityPtr)local_218.y; if (fVar18 != 0.0) { if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)fVar18 + 0x28) == 1)) || (*(int *)((int)fVar18 + 0x28) - 10U < 0x3de)) { isOtherFriendly = (*(uint *)((int)fVar18 + 0x168) & 0x20000000) != 0; bVar6 = Entity::IsFriendly((Entity *)npc); EVar12 = extraout_EDX_00; if ((isOtherFriendly == bVar6) && (EVar12 = extraout_EDX_00, *(Entity_NPC **)((int)fVar18 + 0xbec) == npc)) { if (*(int *)((int)fVar18 + 0xb64) != 4) { iVar15 = 4; goto LAB_004f3590; } local_1f0.y = *(float *)((int)fVar18 + 0x33c); local_210.y = *(float *)((int)fVar18 + 0x340); target = Entity_NPC::GetPlayerTarget(laser); fVar17 = (target->_pos).y - local_210.y; fVar19 = (target->_pos).x - local_1f0.y; local_200.x = sqrtf(fVar17 * fVar17 + fVar19 * fVar19); local_200.x = local_200.x - *(float *)((int)fVar18 + 0x380) * 20.0; local_200.y = fVar18; std::multimap::emplace(&local_220,&local_200); EVar12 = (EntityPtr)local_218.y; } } local_34._data = (void *)local_1e4; } local_218.y = (float)((int)EVar12 + 1); } while ((uint)local_218.y < (uint)local_34._size); } iVar15 = 0; puVar9 = (undefined4 *)*followersByDistance; while (puVar9 != followersByDistance) { if (iVar15 == 0) { *(undefined4 *)(puVar9[5] + 0xbc0) = 2; } else { *(uint *)(puVar9[5] + 0xbc0) = (uint)(iVar15 == 1); } if (*(int *)(puVar9[5] + 0xba4) < 4) { *(undefined4 *)(puVar9[5] + 0xba4) = 0x1e; } puVar3 = (undefined4 *)puVar9[2]; if (*(char *)((int)puVar3 + 0xd) == '\0') { cVar1 = *(char *)((int)*puVar3 + 0xd); puVar9 = puVar3; puVar3 = (undefined4 *)*puVar3; while (cVar1 == '\0') { cVar1 = *(char *)((int)*puVar3 + 0xd); puVar9 = puVar3; puVar3 = (undefined4 *)*puVar3; } } else { cVar1 = *(char *)((int)puVar9[1] + 0xd); puVar5 = (undefined4 *)puVar9[1]; puVar3 = puVar9; while ((puVar9 = puVar5, cVar1 == '\0' && (puVar3 == (undefined4 *)puVar9[2]))) { cVar1 = *(char *)((int)puVar9[1] + 0xd); puVar5 = (undefined4 *)puVar9[1]; puVar3 = puVar9; } } iVar15 = iVar15 + 1; } iVar15 = 300; LAB_004f3590: npc->_projectileCooldown = iVar15; if (local_34._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (local_1e4 != (EntityPtr)0x0) { uVar7 = *(uint *)((int)local_1e4 - 4U); qVar4 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar4 < uVar7); (*(code *)local_1d8)((uint *)((int)local_1e4 - 4U)); } } local_14 = 0xffffffff; FID_conflict__Erase_tree_>_> (&followersByDistance, (fuzzer_allocator_> *)&followersByDistance, (_Tree_node *)followersByDistance[1]); uVar7 = 0x18; puVar9 = followersByDistance; goto LAB_004f3600; } } else { EVar12 = (EntityPtr)0x0; local_204 = (undefined4 *)0x0; local_48 = (undefined4 *)0x0; local_1f8 = (EntityPtr)0x0; local_44 = (EntityPtr)0x0; local_218.y = 0.0; local_40 = (EntityPtr)0x0; local_14 = 2; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_34,npc->_type,1,-1,0,0); local_14 = CONCAT31(local_14._1_3_,3); local_1e4 = (EntityPtr)0x0; if ((EntityPtr)local_34._size == (EntityPtr)0x0) { puVar9 = (undefined4 *)0x0; } else { pvVar8 = local_34._data; EVar12 = (EntityPtr)local_34._size; do { puVar9 = *(undefined4 **)((int)pvVar8 + (int)local_1e4 * 4); if (puVar9 != (undefined4 *)0x0) { if (((1 < *(int *)&g_game->_deathmatchManager) && (puVar9[10] == 1)) || (puVar9[10] - 10 < 0x3de)) { isOtherFriendly = (puVar9[0x5a] & 0x20000000) != 0; local_204 = puVar9; bVar6 = Entity::IsFriendly((Entity *)npc); if ((isOtherFriendly == bVar6) && ((Entity_NPC *)puVar9[0x2fb] == npc)) { local_210.y = (float)puVar9[0xd0]; local_210.x = (float)puVar9[0xcf]; bVar6 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&local_210); if (bVar6 != 0) { if (puVar9[0x2d9] != 4) { local_204 = local_48; puVar9 = local_48; EVar12 = local_1f8; goto LAB_004f3030; } if (local_1f8 == (EntityPtr)local_218.y) { std::vector::_Emplace_reallocate(local_1f8,&local_204); local_218.y = (float)local_40; local_1f8 = local_44; } else { *(undefined4 **)local_1f8 = puVar9; local_1f8 = (EntityPtr)((int)local_1f8 + 4); local_44 = local_1f8; } } } else { local_1e4 = extraout_EDX; } EVar12 = (EntityPtr)local_34._size; } pvVar8 = local_34._data; } local_1e4 = (EntityPtr)((int)local_1e4 + 1); } while ((uint)local_1e4 < (uint)EVar12); local_204 = local_48; puVar9 = local_48; EVar12 = local_1f8; } LAB_004f3030: puVar3 = local_204; EVar12 = (EntityPtr)((int)EVar12 - (int)puVar9 >> 2); local_1e4 = (EntityPtr)0x0; local_1f8 = EVar12; if (EVar12 != (EntityPtr)0x0) { beamDirRight.x = 1.0; beamDirRight.y = 0.0; beamOffsetRight.x = 0.0; beamOffsetRight.y = -18.0; beamDirDown.x = 0.0; beamDirDown.y = 1.0; beamOffsetDown.x = 0.0; beamOffsetDown.y = -18.0; beamDirLeft.x = (float)&DAT_bf800000; beamDirLeft.y = 0.0; local_228.x = 0.0; local_228.y = -18.0; local_220.x = 0.0; local_220.y = (float)&DAT_bf800000; local_200.x = 0.0; local_200.y = -18.0; do { *(undefined4 *)(puVar3[(int)local_1e4] + 0xb64) = 9; local_210.y = (float)(puVar3[(int)local_1e4] + 0x48); bVar6 = ANM2::SetAnimation((ANM2 *)local_210.y,s_Attack2,1); fVar18 = local_210.y; if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)((int)local_210.y + 0x30)); ((AnimationState *)((int)fVar18 + 0x30))->_isPlaying = 1; EVar12 = local_1f8; } warningColor._colorize[0] = 0.0; warningColor._colorize[1] = 0.0; warningColor._colorize[2] = 0.0; warningColor._colorize[3] = 0.0; warningColor._offset[0] = 0.0; warningColor._offset[1] = 0.0; *(undefined4 *)(puVar3[(int)local_1e4] + 0xbc4) = 0xffffffa6; warningColor._offset[2] = 0.0; warningColor._tint[0] = 0.6; warningColor._tint[1] = 0.05; warningColor._tint[2] = 0.0; warningColor._tint[3] = 0.8; Entity::SpawnFollowingEffect198 ((Entity *)puVar3[(int)local_1e4],&beamOffsetRight,&beamDirRight,0x20, &warningColor,2.0); warningColor._colorize[0] = 0.0; warningColor._colorize[1] = 0.0; warningColor._colorize[2] = 0.0; warningColor._colorize[3] = 0.0; warningColor._offset[0] = 0.0; warningColor._offset[1] = 0.0; warningColor._offset[2] = 0.0; warningColor._tint[0] = 0.6; warningColor._tint[1] = 0.05; warningColor._tint[2] = 0.0; warningColor._tint[3] = 0.8; Entity::SpawnFollowingEffect198 ((Entity *)puVar3[(int)local_1e4],&beamOffsetDown,&beamDirDown,0x20, &warningColor,2.0); warningColor._offset[0] = 0.0; warningColor._colorize[0] = 0.0; warningColor._colorize[1] = 0.0; warningColor._colorize[2] = 0.0; warningColor._colorize[3] = 0.0; warningColor._offset[1] = 0.0; warningColor._offset[2] = 0.0; warningColor._tint[0] = 0.6; warningColor._tint[1] = 0.05; warningColor._tint[2] = 0.0; warningColor._tint[3] = 0.8; Entity::SpawnFollowingEffect198 ((Entity *)puVar3[(int)local_1e4],&local_228,&beamDirLeft,0x20,&warningColor,2.0 ); warningColor._offset[0] = 0.0; warningColor._colorize[0] = 0.0; warningColor._colorize[1] = 0.0; warningColor._colorize[2] = 0.0; warningColor._colorize[3] = 0.0; warningColor._offset[1] = 0.0; warningColor._offset[2] = 0.0; warningColor._tint[0] = 0.6; warningColor._tint[1] = 0.05; warningColor._tint[2] = 0.0; warningColor._tint[3] = 0.8; Entity::SpawnFollowingEffect198 ((Entity *)puVar3[(int)local_1e4],&local_200,&local_220,0x20,&warningColor,2.0); local_1e4 = (EntityPtr)((int)local_1e4 + 1); } while ((uint)local_1e4 < (uint)EVar12); npc = (Entity_NPC *)local_1f0.y; } *(float *)((int)npc + 0xbc4) = -NAN; if (local_34._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (local_34._data != (void *)0x0) { uVar7 = *(uint *)((int)local_34._data - 4U); qVar4 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar4 < uVar7); (*(code *)local_1d8)((uint *)((int)local_34._data - 4U)); } } local_14 = 0xffffffff; if (local_204 != (undefined4 *)0x0) { uVar7 = ((int)local_218.y - (int)local_204 >> 2) * 4; puVar9 = local_204; if (0xfff < uVar7) { puVar9 = (undefined4 *)local_204[-1]; uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)local_204 + (-4 - (int)puVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_004f3600: operator_delete(puVar9,uVar7); } EVar12 = leader; } } if (0 < *(int *)((int)npc + 0xba0)) { *(int *)((int)npc + 0xba0) = *(int *)((int)npc + 0xba0) - (int)local_1d4; } if (0 < *(int *)((int)npc + 0xba4)) { *(int *)((int)npc + 0xba4) = *(int *)((int)npc + 0xba4) - (int)local_1d4; } iVar15 = *(int *)((int)npc + 0xbc4); if (iVar15 < 0) { iVar16 = 0; if (iVar15 + (int)local_1d4 < 0) { iVar16 = iVar15 + (int)local_1d4; } LAB_004f3656: *(int *)((int)npc + 0xbc4) = iVar16; } else if (0 < iVar15) { iVar16 = 0; if (0 < iVar15 - (int)local_1d4) { iVar16 = iVar15 - (int)local_1d4; } goto LAB_004f3656; } switch(*(undefined4 *)((int)npc + 0xb64)) { case 0: *(undefined4 *)((int)npc + 0xb64) = 4; *(undefined4 *)((int)npc + 0xbc0) = 0; break; case 4: local_40 = (EntityPtr)0xf; local_44 = (EntityPtr)0x8; local_54 = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); local_34._size = 0xf; local_34._capacity = 8; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",4); local_34._0_1_ = '\0'; local_14 = 9; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)&local_54,0.1); local_14 = CONCAT31(local_14._1_3_,8); if (0xf < (uint)local_34._size) { piVar14 = (int *)(local_34._size + 1); pvVar8 = local_3c; if ((int *)0xfff < piVar14) { pvVar8 = *(void **)((int)local_3c + -4); piVar14 = (int *)(local_34._size + 0x24); if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar8))) goto LAB_004f3766; } operator_delete(pvVar8,(uint)piVar14); } local_14 = 0xffffffff; local_34._capacity = 0; local_34._size = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < (uint)local_40) { piVar14 = (int *)((int)local_40 + 1); pvVar8 = local_54; if ((int *)0xfff < piVar14) { pvVar8 = *(void **)((int)local_54 + -4); piVar14 = (int *)((int)local_40 + 0x24); if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar8))) { LAB_004f3766: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,(uint)piVar14); } if (*(int *)((int)npc + 0xf1c) == -1) { if ((*(uint *)((int)npc + 0x168) & 0x1000800) == 0) { if ((*(int *)((int)npc + 0xbc0) == 1) || (*(int *)((int)npc + 0xbc0) == 2)) { targetOwner = EVar12; if (EVar12 == (EntityPtr)0x0) goto LAB_004f3881; } else { if (EVar12 != (EntityPtr)0x0) { target = Entity_NPC::GetPlayerTarget((Entity_NPC *)EVar12); local_200.x = (target->_pos).x; local_200.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)((int)npc + 0x414),&local_200,0); *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; goto LAB_004f3c11; } LAB_004f3881: targetOwner = (EntityPtr)npc; } local_1d8 = (EntityPtr)Entity_NPC::GetPlayerTarget((Entity_NPC *)targetOwner); if (*(int *)((int)npc + 0xbc0) == 1) { if (EVar12 == (EntityPtr)0x0) { pVVar10 = Entity_NPC::CalcTargetPosition(npc,&local_228,0.0); fVar18 = 0.68; } else { local_1f0.y = *(float *)((int)local_1d8 + 0x33c); local_210.y = *(float *)((int)local_1d8 + 0x340); fVar17 = *(float *)((int)npc + 0x33c) - local_1f0.y; fVar18 = *(float *)((int)npc + 0x340) - local_210.y; fVar17 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); fVar18 = 0.68; local_200.x = ((Vector *)((int)local_1d8 + 0x360))->x * fVar17 * 0.15 + local_1f0.y; pVVar10 = &local_200; local_200.y = *(float *)((int)local_1d8 + 0x364) * fVar17 * 0.15 + local_210.y; } } else { if (EVar12 == (EntityPtr)0x0) { pVVar10 = Entity_NPC::CalcTargetPosition(npc,&local_228,0.0); } else { local_200.x = ((Vector *)((int)local_1d8 + 0x33c))->x; local_200.y = *(float *)((int)local_1d8 + 0x340); pVVar10 = &local_200; } fVar18 = 0.8; } PathFinder::FindGridPath((PathFinder *)((int)npc + 0x414),pVVar10,fVar18,900,1); if (EVar12 != (EntityPtr)0x0) { if ((((*(int *)((int)npc + 0x2c) != 1) || (uVar7 = Random(), uVar7 % 0xc != 0)) || (*(int *)((int)npc + 0xbc4) < 0)) || ((20.0 <= ABS(((Vector *)((int)local_1d8 + 0x33c))->x - *(float *)((int)npc + 0x33c)) && (20.0 <= ABS(*(float *)((int)local_1d8 + 0x340) - *(float *)((int)npc + 0x340)))))) { if (*(int *)((int)npc + 0xbc0) == 2) { uVar7 = Random(); EVar12 = local_1d8; if ((((uVar7 & 3) == 0) && (*(int *)((int)npc + 0xba4) < 1)) && (ABS(*(float *)((int)local_1d8 + 0x340) - *(float *)((int)npc + 0x340)) < 24.0)) { local_220.y = *(float *)((int)local_1d8 + 0x340); local_220.x = ((Vector *)((int)local_1d8 + 0x33c))->x; bVar6 = Room::CheckLine(g_game->_room,(Vector *)((int)npc + 0x33c),&local_220,1,900, 0,0,(Vector *)0x0); if (bVar6 != 0) { *(undefined4 *)((int)npc + 0xb64) = 6; ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"DashBegin",0); fVar18 = *(float *)((int)npc + 0x33c); pVVar10 = (Vector *)((int)EVar12 + 0x33c); *(bool *)((int)npc + 0x148) = pVVar10->x <= fVar18 && fVar18 != pVVar10->x; pVVar10 = (Vector *)((int)EVar12 + 0x33c); if (fVar18 < pVVar10->x || fVar18 == pVVar10->x) { EVar12 = local_1f4; } else { EVar12 = (EntityPtr)&DAT_bf800000; } iVar15 = 0xa7; *(EntityPtr *)((int)npc + 0x334) = EVar12; *(undefined4 *)((int)npc + 0x338) = 0; if (*(int *)((int)npc + 0x2c) == 1) { iVar15 = 0x70; } *(undefined4 *)((int)npc + 0x410) = 0; Entity_NPC::PlaySound(npc,iVar15,1.0,2,0,1.0); goto LAB_004f3c11; } } } if (((*(int *)((int)npc + 0xbc0) == 1) && (*(int *)((int)npc + 0xba4) < 1)) && (bVar6 = Entity_NPC::IsTargetInAttackRange(npc,120.0,1,7), bVar6 != 0)) { pcVar11 = "AttackHori"; *(undefined4 *)((int)npc + 0xb64) = 8; if (ABS(*(float *)((int)npc + 0x360)) <= ABS(*(float *)((int)npc + 0x364))) { pcVar11 = "AttackVert"; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)pcVar11,0); *(undefined4 *)((int)npc + 0x410) = 0; } } else if ((-1 < *(int *)((int)EVar12 + 0xbc4)) && (*(int *)((int)EVar12 + 0x3c0) == 0)) { *(undefined4 *)((int)EVar12 + 0xbc4) = 8; } } } else { target = Entity_NPC::GetPlayerTarget(npc); local_200.x = (target->_pos).x; local_200.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)((int)npc + 0x414),&local_200,0); *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; } } else { bVar6 = 1; iVar15 = 900; fVar18 = 0.8; pVVar10 = Entity_NPC::CalcTargetPosition(npc,&local_200,0.0); PathFinder::FindGridPath((PathFinder *)((int)npc + 0x414),pVVar10,fVar18,iVar15,bVar6); } LAB_004f3c11: *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.97; break; case 6: *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.7; if (*(int *)((int)npc + 0x410) == 0) { if (*(int *)((int)npc + 0x7c) == 0) { LAB_004f4463: ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"DashLoop",0); if (*(int *)((int)npc + 0x7c) != 0) goto LAB_004f4478; LAB_004f4489: if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)(*(int *)((int)npc + 0x7c) + 0x34) == '\0')) break; } else { bVar6 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); manager = g_manager; if (bVar6 != 0) { local_1d4 = 7.9874e-44; if (*(int *)((int)npc + 0x2c) == 1) { local_1d4 = 1.66755e-43; } local_1d8 = local_1f4; if (*(int *)((int)npc + 0xc64) == 0x12) { local_1d8 = (EntityPtr)0x3fc00000; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_1d8 = (EntityPtr)0x3f000000; } seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,(float)local_1d8,0.0); } if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) goto LAB_004f4463; LAB_004f4478: bVar6 = AnimationState::WasEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); if (bVar6 == 0) goto LAB_004f4489; } *(undefined4 *)((int)npc + 0x188) = 2; pvVar8 = g_game->_room; iVar15 = (int)((*(float *)((int)npc + 0x33c) - 40.0) / 40.0 + 0.5); iVar16 = (int)((*(float *)((int)npc + 0x340) - 120.0) / 40.0 + 0.5); if ((iVar15 < 0) || (((iVar13 = *(int *)((int)pvVar8 + 0xc), iVar13 <= iVar15 || (iVar16 < 0)) || (*(int *)((int)pvVar8 + 0x10) <= iVar16)))) { iVar13 = *(int *)((int)pvVar8 + 0xc); iVar15 = -1; } else { iVar15 = iVar13 * iVar16 + iVar15; } fVar18 = *(float *)((int)npc + 0x39c); fVar17 = 0.8; *(float *)((int)npc + 0x360) = *(float *)((int)npc + 0x334) * 10.0 * fVar18 + *(float *)((int)npc + 0x360); *(float *)((int)npc + 0x364) = *(float *)((int)npc + 0x338) * 10.0 * fVar18 + *(float *)((int)npc + 0x364); game = g_game; if (fVar18 != (float)local_1f4) { fVar17 = 0.8 / ((fVar18 + 0.8) - fVar18 * 0.8); } *(float *)((int)npc + 0x364) = ((((float)(iVar15 / iVar13) * 40.0 + 120.0) - *(float *)((int)npc + 0x340)) - *(float *)((int)npc + 0x364)) * ((float)local_1f4 - fVar17) + *(float *)((int)npc + 0x364); local_1f0.y = *(float *)((int)npc + 0x338) * 40.0 + *(float *)((int)npc + 0x340); local_1f0.x = *(float *)((int)npc + 0x334) * 40.0 + *(float *)((int)npc + 0x33c); pos.y = local_1f0.y; pos.x = local_1f0.x; iVar15 = Room::GetGridCollisionAtPos(game->_room,pos); if ((iVar15 != 0) || ((*(uint *)((int)npc + 0x168) & 0x1000a00) != 0)) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"DashEnd",0); *(undefined4 *)((int)npc + 0x410) = 1; } } else { *(undefined4 *)((int)npc + 0x188) = 4; if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { *(undefined4 *)((int)npc + 0xb64) = 4; *(undefined4 *)((int)npc + 0xba4) = 0x2d; if (EVar12 != (EntityPtr)0x0) { *(undefined4 *)((int)EVar12 + 0xba0) = 1; } } } break; case 8: if (*(int *)((int)npc + 0x7c) == 0) { LAB_004f41e7: *(undefined4 *)((int)npc + 0xba4) = 0x2d; goto LAB_004f41f1; } bVar6 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); if (bVar6 != 0) { if ((*(int *)((int)npc + 0xf1c) == -1) || ((fVar18 = *(float *)((int)npc + 0xf20), fVar18 == g_vectorZero.x && (*(float *)((int)npc + 0xf24) == g_vectorZero.y)))) { target = Entity_NPC::GetPlayerTarget(npc); local_1d4 = (target->_pos).x - *(float *)((int)npc + 0x33c); local_1d8 = (EntityPtr)((target->_pos).y - *(float *)((int)npc + 0x340)); fVar18 = sqrtf(local_1d4 * local_1d4 + (float)local_1d8 * (float)local_1d8); if (fVar18 <= 0.0) { local_1f0.x = local_1d4; local_1f0.y = (float)local_1d8; } else { local_1f0.y = (10.0 / fVar18) * (float)local_1d8; local_1f0.x = (10.0 / fVar18) * local_1d4; } } else { fVar18 = sqrtf(*(float *)((int)npc + 0xf24) * *(float *)((int)npc + 0xf24) + fVar18 * fVar18 ); if (fVar18 <= 0.0) { local_1f0.x = *(float *)((int)npc + 0xf20); local_1f0.y = (float)*(EntityPtr *)((int)npc + 0xf24); } else { local_1f0.y = (10.0 / fVar18) * *(float *)((int)npc + 0xf24); local_1f0.x = (10.0 / fVar18) * *(float *)((int)npc + 0xf20); } } local_218.y = local_1f0.y; local_218.x = local_1f0.x; ProjectileParams::ProjectileParams(&shotParams); manager = g_manager; iVar15 = *(int *)((int)npc + 0xc64); local_1d8 = local_1f4; if (*(int *)((int)npc + 0x2c) == 1) { if (iVar15 == 0x12) { local_1d8 = (EntityPtr)0x3fc00000; } else if (iVar15 == 0x13) { local_1d8 = (EntityPtr)0x3f000000; } local_1d4 = 1.48538e-43; seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,(float)local_1d8,0.0); uVar7 = 3; } else { if (iVar15 == 0x12) { local_1d8 = (EntityPtr)0x3fc00000; } else if (iVar15 == 0x13) { local_1d8 = (EntityPtr)0x3f000000; } local_1d4 = 2.0459e-43; seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,(float)local_1d8,0.0); uVar7 = 1; } Entity_NPC::FireProjectiles(npc,(Vector *)((int)npc + 0x33c),&local_218,uVar7,&shotParams); } if (*(int *)((int)npc + 0x7c) == 0) goto LAB_004f41e7; bVar6 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Shoot2"); if (bVar6 != 0) { if ((*(int *)((int)npc + 0xf1c) == -1) || ((fVar18 = *(float *)((int)npc + 0xf20), fVar18 == g_vectorZero.x && (*(float *)((int)npc + 0xf24) == g_vectorZero.y)))) { target = Entity_NPC::GetPlayerTarget(npc); local_1d4 = (target->_pos).x - *(float *)((int)npc + 0x33c); local_1d8 = (EntityPtr)((target->_pos).y - *(float *)((int)npc + 0x340)); fVar18 = sqrtf(local_1d4 * local_1d4 + (float)local_1d8 * (float)local_1d8); pVVar10 = &local_1f0; if (fVar18 <= 0.0) { local_1f0.x = local_1d4; local_1f0.y = (float)local_1d8; } else { local_1f0.y = (10.0 / fVar18) * (float)local_1d8; local_1f0.x = (10.0 / fVar18) * local_1d4; } } else { local_1f0.y = *(float *)((int)npc + 0xf24); fVar18 = sqrtf(local_1f0.y * local_1f0.y + fVar18 * fVar18); if (fVar18 <= 0.0) { pVVar10 = &local_210; local_210.x = *(float *)((int)npc + 0xf20); local_210.y = *(float *)((int)npc + 0xf24); } else { pVVar10 = &local_210; local_210.y = (10.0 / fVar18) * local_1f0.y; local_210.x = (10.0 / fVar18) * *(float *)((int)npc + 0xf20); } } local_210.x = pVVar10->x; local_210.y = pVVar10->y; ProjectileParams::ProjectileParams(&shot2Params); manager = g_manager; iVar15 = *(int *)((int)npc + 0xc64); if (*(int *)((int)npc + 0x2c) == 1) { if (iVar15 == 0x12) { local_1f4 = (EntityPtr)0x3fc00000; } else if (iVar15 == 0x13) { local_1f4 = (EntityPtr)0x3f000000; } local_1d4 = 1.5134e-43; seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,(float)local_1f4,0.0); uVar7 = 4; } else { if (iVar15 == 0x12) { local_1f4 = (EntityPtr)0x3fc00000; } else if (iVar15 == 0x13) { local_1f4 = (EntityPtr)0x3f000000; } local_1d4 = 2.0459e-43; seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,(float)local_1f4,0.0); uVar7 = 3; } Entity_NPC::FireProjectiles(npc,(Vector *)((int)npc + 0x33c),&local_210,uVar7,&shot2Params); } if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) goto LAB_004f41e7; goto LAB_004f4217; case 9: if (*(int *)((int)npc + 0x7c) != 0) { bVar6 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),(byte *)"Shoot"); manager = g_manager; if (bVar6 != 0) { if (*(int *)((int)npc + 0xc64) == 0x12) { local_1f4 = (EntityPtr)0x3fc00000; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_1f4 = (EntityPtr)0x3f000000; } local_1d4 = 1.70958e-43; seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,(float)local_1f4,0.0); } if (*(int *)((int)npc + 0x7c) != 0) { bVar6 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"Shoot2"); if (bVar6 != 0) { iVar15 = 0; local_200.y = -18.0; local_200.x = 0.0; do { laser = Entity_Laser::ShootAngle (1,(Vector *)((int)npc + 0x33c),(float)iVar15 * 90.0,0xf,&local_200, (Entity *)npc,0); laser->_scale = 0.75; Entity_Laser::ResetSpriteScale(laser); iVar15 = iVar15 + 1; } while (iVar15 < 4); } if ((*(int *)((int)npc + 0x7c) != 0) && (*(char *)((int)npc + 0x8c) != '\0')) goto LAB_004f4217; } } *(undefined4 *)((int)npc + 0xba4) = 0x3c; *(undefined4 *)((int)npc + 0xbc4) = 0xffffffa6; LAB_004f41f1: *(undefined4 *)((int)npc + 0xb64) = 4; if (leader != (EntityPtr)0x0) { *(undefined4 *)((int)leader + 0xba0) = 1; } LAB_004f4217: *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.6; goto LAB_004f46a3; } LAB_004f46a3: EVar12 = leader; Room::RaiseGridPathAtPos(g_game->_room,(Vector *)((int)npc + 0x33c),900); if (((*(char *)((int)npc + 0x173) != '\0') && (EVar12 != (EntityPtr)npc)) && ((*(int *)((int)npc + 0xbc0) == 1 || (*(int *)((int)npc + 0xbc0) == 2)))) { *(undefined4 *)((int)EVar12 + 0xba0) = 0xf; } ExceptionList = local_1c; return; } //@@ 004f4730 NpcAI::ENTITY_BALL_AND_CHAIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 893 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BALL_AND_CHAIN(Entity_NPC *npc) { float x; byte bVar1; byte isSameSheet; uint uVar2; uint gridSlot; LayerState *layer; int iVar3; uint uVar4; int iVar5; Entity *spawnedEffect; Entity_Player *flatFileOwner; Entity_NPC *pEVar6; bool isFlatFileBoosted; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; Entity_NPC *pEVar7; void *pvVar8; byte *strCursor; Entity_NPC *a; char *text; Vector *pVVar9; float *pfVar10; Entity_NPC *pEVar11; float fVar12; float fVar13; ANM2 *pAVar14; float fVar15; double dVar16; Vector spawnPos; Vector spawnVel; float sinAngle; float randSpeed; float randAngle; ANM2 *local_ac; Vector *local_a8; Entity_NPC *local_a4; float local_a0; float local_9c; Entity_NPC *local_98; byte isAnimSame; void *local_90; float local_8c [2]; EntityRef EStack_84; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; Entity_NPC *local_4c; float local_48; void *local_44; void *local_40; void *local_3c; float local_38; byte local_34 [8]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; uint *flagsHigh; Game *game; code *gridEntityFn; Manager *manager; qword oldFlags; Room *room; void *roomRaw; game = g_game; puStack_20 = local_34 + 0x30; local_14 = -1; puStack_18 = &LAB_00af3f4d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; uVar4 = npc->_subtype; local_ac = (ANM2 *)0x3f800000; local_98 = (Entity_NPC *)(((float)(uVar4 & 0xf) + 0.0 + 1.0) * 40.0); local_9c = ((float)(uVar4 >> 4 & 0xf) + 0.0) * 0.5; if ((uVar4 & 0x100) != 0) { local_9c = local_9c * -1.0; } local_a4 = npc; local_24 = uVar2; if (npc->_state == 0) { uVar4 = 0; npc->_i1 = -1; npc->_i2 = 0; local_90 = game->_room; do { iVar5 = (int)((((npc->_pos).x + *(float *)((int)&DAT_00c5c7b4 + uVar4)) - 40.0) / 40.0 + 0.5); iVar3 = (int)((((npc->_pos).y + *(float *)((int)&DAT_00c5c7b8 + uVar4)) - 120.0) / 40.0 + 0.5) ; if (((((-1 < iVar5) && (local_a0 = *(float *)((int)local_90 + 0xc), iVar5 < (int)local_a0)) && (-1 < iVar3)) && ((iVar3 < *(int *)((int)local_90 + 0x10) && (gridSlot = iVar3 * (int)local_a0 + iVar5, gridSlot < 0x1c0)))) && ((iVar3 = *(int *)((int)local_90 + gridSlot * 4 + 0x24), iVar3 != 0 && ((*(int *)(iVar3 + 0x3c) == 3 || ((*(int *)(iVar3 + 0x3c) == 4 && (*(int *)(iVar3 + 4) != 0xf)))))))) { iVar5 = *(int *)(iVar3 + 0x24); (npc->_targetPosition).x = (float)(iVar5 % (int)local_a0) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar5 / (int)local_a0) * 40.0 + 120.0; npc->_i1 = *(int *)(iVar3 + 0x24); break; } uVar4 = uVar4 + 8; } while (uVar4 < 0x20); bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"Chain",1); if ((bVar1 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)&DAT_00b604e8,1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_visible = 0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_wrapSMode = 1; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_wrapTMode = 0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer->_visible = 0; oldFlags = npc->_flags; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2008; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x50011; npc->_state = 3; local_90 = (void *)(npc->_targetPosition).x; if (((float)local_90 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { (npc->_v1).x = 0.0; iVar3 = 5; (npc->_v2).y = -10.0; (npc->_v1).y = -6.0; } else { local_8c[0] = (npc->_targetPosition).y; fVar15 = atan2f((npc->_pos).y - local_8c[0],(npc->_pos).x - (float)local_90); (npc->_v1).y = 0.0; (npc->_v1).x = fVar15 * 57.295776; local_a0 = fVar15 * 57.295776 * 0.017453292; local_a8 = (Vector *)sin(local_a0); fVar15 = cos(local_a0); iVar3 = 0; (npc->_pos).x = (float)local_90 + fVar15 * (float)local_98; (npc->_pos).y = (float)local_a8 * (float)local_98 + local_8c[0]; } npc->_entityGridCollisionClass = iVar3; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = -14.0; } else { puStack_20 = local_34 + 0x30; if ((npc->_state == 3) && ((local_a0 = (npc->_targetPosition).x, local_a0 != g_vectorZero.x || (puStack_20 = local_34 + 0x30, (npc->_targetPosition).y != g_vectorZero.y)))) { fVar15 = local_9c * npc->_speedMultiplier + (npc->_v1).x; puStack_20 = local_34 + 0x30; if (360.0 < ABS(fVar15)) { puStack_20 = local_34 + 0x30; fVar15 = fmodf(fVar15,360.0); } if (fVar15 <= 180.0) { if (fVar15 < -180.0) { fVar15 = fVar15 + 360.0; } } else { fVar15 = fVar15 - 360.0; } (npc->_v1).x = fVar15; fVar12 = local_9c * 0.0005 * (float)local_98; if (fVar12 <= -0.1) { fVar12 = -0.1; } if (0.1 <= fVar12) { fVar12 = 0.1; } fVar12 = (npc->_v1).y - fVar12; (npc->_v1).y = fVar12; while (fVar12 < 0.0) { fVar12 = (npc->_v1).y + (float)local_ac; (npc->_v1).y = fVar12; } while ((float)local_ac <= fVar12) { fVar12 = (npc->_v1).y - (float)local_ac; (npc->_v1).y = fVar12; } local_90 = (void *)(fVar15 * 0.017453292); local_a8 = (Vector *)sin((float)local_90); fVar13 = cos((float)local_90); fVar15 = (npc->_targetPosition).y; fVar12 = (npc->_pos).y; (npc->_velocity).x = (fVar13 * (float)local_98 + local_a0) - (npc->_pos).x; (npc->_velocity).y = ((float)local_a8 * (float)local_98 + fVar15) - fVar12; } } if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { fVar15 = (npc->_v1).x; local_34[0] = 0x49; local_34[1] = 100; local_34[2] = 0x6c; local_34[3] = 0x65; local_34[4] = 0x30; local_34[5] = 0; if (360.0 < ABS(fVar15)) { fVar15 = fmodf(fVar15,360.0); } if (fVar15 <= 180.0) { if (fVar15 < -180.0) { fVar15 = fVar15 + 360.0; } } else { fVar15 = fVar15 - 360.0; } local_8c[0] = fVar15 / 45.0 + 0.5; dVar16 = floor((double)local_8c[0]); iVar5 = (int)dVar16; iVar3 = iVar5 + 8; if (-1 < iVar5) { iVar3 = iVar5; } local_34[4] = (char)iVar3 + '0'; pvVar8 = (npc->_sprite)._animState._animData; local_8c[0] = (float)iVar3 * 45.0; if (pvVar8 == (void *)0x0) { local_38 = 2.10195e-44; local_4c = (Entity_NPC *)0x0; local_3c = (void *)0x0; } else { std::string::string((char *)&local_4c,pvVar8); } strCursor = local_34; local_98 = local_4c; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); pEVar7 = (Entity_NPC *)&local_4c; if (0xf < (uint)local_38) { pEVar7 = local_4c; } isAnimSame = str_eq((byte *)pEVar7,(uint)local_3c,local_34,(int)strCursor - (int)(local_34 + 1)) ; if (0xf < (uint)local_38) { uVar4 = (int)local_38 + 1; pEVar7 = local_98; if (0xfff < uVar4) { pEVar7 = local_98[-1]._pickupGhostsEntity; uVar4 = (int)local_38 + 0x24; if (0x1f < (uint)((int)local_98 + (-4 - (int)pEVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar7,uVar4); } if ((((isAnimSame == 0) && (bVar1 = ANM2::SetAnimation(&npc->_sprite,local_34,1), bVar1 != 0)) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } fVar15 = (npc->_v1).x; (npc->_sprite)._rotation = fVar15 - local_8c[0]; pvVar8 = (npc->_sprite)._animState._animData; if (pvVar8 != (void *)0x0) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)((float)*(int *)((int)pvVar8 + 0x30) * (npc->_v1).y)); fVar15 = (npc->_v1).x; } if (360.0 < ABS(fVar15)) { fVar15 = fmodf(fVar15,360.0); } if (fVar15 <= 180.0) { if (fVar15 < -180.0) { fVar15 = fVar15 + 360.0; } } else { fVar15 = fVar15 - 360.0; } local_8c[0] = fVar15 / 90.0 + 0.5; dVar16 = floor((double)local_8c[0]); local_8c[0] = (float)dVar16; iVar5 = (int)dVar16; iVar3 = iVar5 + 4; if (-1 < iVar5) { iVar3 = iVar5; } if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar3); } iVar3 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar3 != 0) { room = g_game->_room; iVar5 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar5 < 0) || (room->_gridWidth <= iVar5)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { iVar5 = -1; } else { iVar5 = iVar3 * room->_gridWidth + iVar5; } uVar4 = Room::GetGridCollision(room,iVar5); if ((uVar4 == 0) && (uVar4 = Random(), (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 < ABS(local_9c))) { uVar4 = Random(); local_8c[0] = (npc->_velocity).x * 0.2; local_a8 = (Vector *)((npc->_velocity).y * 0.2); uVar2 = Random(); local_a0 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_a0 = local_a0 + local_a0; fVar15 = cos(local_a0); local_8c[0] = fVar15 + local_8c[0]; fVar15 = sin(local_a0); local_2c.y = fVar15 + (float)local_a8; local_2c.x = local_8c[0]; spawnedEffect = Game::Spawn(g_game,1000,0x3b,&npc->_pos,&local_2c,(Entity *)npc,0,uVar4); uVar4 = Random(); *(float *)(spawnedEffect[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); EStack_84._velocity.y = 0.0; EStack_84._flags = 0; iVar3 = *(int *)spawnedEffect; iVar5 = uVar4 % 0xf + 0xf; EStack_84._entity = (void *)0x0; *(int *)(spawnedEffect[1]._sprite._filename._buf + 8) = iVar5; EStack_84._spawnerVariant = 0; EStack_84._position.x = 0.0; EStack_84._position.y = 0.0; EStack_84._velocity.x = 0.0; *(int *)(spawnedEffect[1]._sprite._filename._buf + 0xc) = iVar5; local_8c[1] = 0.45; EStack_84._type = 0x3ee66666; EStack_84._variant = 0x3ee66666; EStack_84._spawnerType = 0x3f000000; (**(code **)(iVar3 + 0x3c))(local_8c + 1,0xffffffff,0xff,0); uVar4 = Random(); fVar12 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; fVar15 = fVar12 * g_vectorOne.x; (spawnedEffect->_sprite)._scale.y = fVar12 * g_vectorOne.y; (spawnedEffect->_sprite)._scale.x = fVar15; } } uVar4 = npc->_i1; if ((-1 < (int)uVar4) && (((0x1bf < uVar4 || (iVar3 = *(int *)((int)g_game->_room + uVar4 * 4 + 0x24), iVar3 == 0)) || ((*(int *)(iVar3 + 0x3c) != 3 && ((*(int *)(iVar3 + 0x3c) != 4 || (*(int *)(iVar3 + 4) == 0xf)))))))) { npc->_i1 = -1; local_a8 = &npc->_pos; local_98 = (Entity_NPC *)((npc->_targetPosition).y - (npc->_pos).y); local_9c = (npc->_targetPosition).x - local_a8->x; local_2c.y = sqrtf((float)local_98 * (float)local_98 + local_9c * local_9c); if (0.0 < local_2c.y) { local_8c[0] = local_2c.y / 12.0; local_a0 = 20.0; local_9c = local_9c / local_2c.y; pfVar10 = local_8c; if (local_8c[0] <= 20.0) { pfVar10 = &local_a0; } local_98 = (Entity_NPC *)((float)local_98 / local_2c.y); local_90 = (void *)0x0; if (0.0 < local_2c.y) { do { spawnPos.x = (float)local_90 * local_9c + local_a8->x; spawnPos.y = (float)local_90 * (float)local_98 + local_a8->y; uVar4 = Random(); uVar2 = Random(); randAngle = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; randAngle = randAngle + randAngle; sinAngle = sin(randAngle); uVar2 = Random(); randSpeed = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 2.0; spawnVel.x = cos(randAngle); spawnVel.x = spawnVel.x * randSpeed; spawnVel.y = randSpeed * sinAngle; spawnedEffect = Game::Spawn(g_game,1000,0xa3,&spawnPos,&spawnVel,(Entity *)0x0,0,uVar4); (**(code **)(*(int *)spawnedEffect + 0xc))(); local_90 = (void *)((float)local_90 + *pfVar10); } while ((float)local_90 < local_2c.y); npc = local_a4; } } (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_ac = (ANM2 *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_ac = (ANM2 *)0x3f000000; } local_a4 = (Entity_NPC *)0x1f8; seed_fart_sound_override((int *)&local_a4); SoundEffects::Play(&manager->_sfxManager,(int)local_a4,1.0,2,0,(float)local_ac,0.0); bVar1 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,0.0); if (bVar1 == 0) { local_5c = 0; local_58 = 0; local_54 = 0; local_50 = 0; local_4c = (Entity_NPC *)g_vectorZero.x; local_48 = g_vectorZero.y; local_44 = (void *)g_vectorZero.x; local_40 = (void *)g_vectorZero.y; local_3c = (void *)0x0; local_38 = 0.0; (**(code **)(*(int *)npc + 0x24))(); } npc->_entityGridCollisionClass = 5; (npc->_v1).x = 0.0; (npc->_v2).y = -10.0; (npc->_v1).y = -6.0; fVar15 = (npc->_velocity).x; (npc->_sprite)._rotation = 0.0; (npc->_velocity).x = fVar15 * 3.0; (npc->_velocity).y = (npc->_velocity).y * 3.0; } goto LAB_004f5c01; } fVar15 = (npc->_v2).y; if (npc->_entityGridCollisionClass == 7) { npc->_entityCollisionClass = 0; iVar3 = 7; } else { iVar3 = 0; if (-50.0 < fVar15) { iVar3 = 4; } npc->_entityCollisionClass = iVar3; if ((fVar15 <= -1.0) || (iVar3 = 5, (npc->_v1).y < 0.0)) { iVar3 = 6; } npc->_entityGridCollisionClass = iVar3; } if ((fVar15 < 0.0) || (fVar12 = (npc->_v1).y, fVar12 < 0.0)) { LAB_004f4d90: local_9c = (npc->_v1).y; local_8c[0] = fVar15 + local_9c * npc->_speedMultiplier; local_9c = npc->_speedMultiplier * 0.8 + local_9c; (npc->_v2).y = local_8c[0]; (npc->_v1).y = local_9c; fVar15 = local_8c[0]; fVar12 = local_9c; if (iVar3 == 7) { if (10.0 < local_8c[0]) { uVar4 = Random(); Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); (**(code **)(*(int *)npc + 0x28))(uVar2); ExceptionList = local_1c; return; } } else if (0.0 < local_8c[0]) { room = g_game->_room; iVar5 = (int)((((npc->_velocity).x + (npc->_pos).x) - 40.0) / 40.0 + 0.5); iVar3 = (int)((((npc->_pos).y + (npc->_velocity).y) - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (room->_gridWidth <= iVar5)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) { iVar5 = -1; } else { iVar5 = iVar3 * room->_gridWidth + iVar5; } uVar4 = Room::GetGridCollision(room,iVar5); fVar12 = local_9c; if (uVar4 == 1) { npc->_entityGridCollisionClass = 7; fVar15 = local_8c[0]; } else { (npc->_v2).y = 0.0; fVar15 = 0.0; if (0.0 < local_9c) { if (local_9c <= 4.0) { (npc->_v1).y = 0.0; fVar12 = 0.0; } else { uVar4 = Random(); manager = g_manager; local_a0 = 1.2; local_9c = 8.14154e-43; local_a8 = (Vector *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); local_8c[0] = (npc->_v1).y * 0.1 + 0.2; pfVar10 = local_8c; if (1.2 <= local_8c[0]) { pfVar10 = &local_a0; } seed_fart_sound_override((int *)&local_9c); SoundEffects::Play(&manager->_sfxManager,(int)local_9c,*pfVar10,2,0,(float)local_a8,0.0) ; fVar12 = (local_a4->_v1).y * -0.35; fVar15 = (local_a4->_v2).y; (local_a4->_v1).y = fVar12; npc = local_a4; } } } } } else if (iVar3 == 7) goto LAB_004f4d90; fVar13 = (npc->_velocity).y; x = (npc->_velocity).x; (npc->_posOffset).y = fVar15 - 14.0; local_a8 = (Vector *)(x * x + fVar13 * fVar13); if (4.0 < (float)local_a8) { fVar15 = atan2f(fVar13,x); local_2c.x = 6.9770527e+22; fVar15 = fVar15 * 57.295776 + 90.0; local_2c.y = (float)CONCAT22(local_2c.y._2_2_,0x30); local_a0 = fVar15; if (360.0 < ABS(fVar15)) { fVar15 = fmodf(fVar15,360.0); } if (fVar15 <= 180.0) { if (fVar15 < -180.0) { fVar15 = fVar15 + 360.0; } } else { fVar15 = fVar15 - 360.0; } local_8c[0] = fVar15 / 45.0 + 0.5; dVar16 = floor((double)local_8c[0]); iVar5 = (int)dVar16; iVar3 = iVar5 + 8; if (-1 < iVar5) { iVar3 = iVar5; } local_2c.y = (float)CONCAT31(local_2c.y._1_3_,(char)iVar3 + '0'); pvVar8 = (npc->_sprite)._animState._animData; local_8c[0] = (float)iVar3 * 45.0; if (pvVar8 == (void *)0x0) { local_38 = 2.10195e-44; local_4c = (Entity_NPC *)0x0; local_3c = (void *)0x0; } else { std::string::string((char *)&local_4c,pvVar8); } pVVar9 = &local_2c; do { pfVar10 = &pVVar9->x; pVVar9 = (Vector *)((int)&pVVar9->x + 1); } while (*(char *)pfVar10 != '\0'); pEVar7 = (Entity_NPC *)&local_4c; if (0xf < (uint)local_38) { pEVar7 = local_4c; } local_a4 = local_4c; isAnimSame = str_eq((byte *)pEVar7,(uint)local_3c,(byte *)&local_2c, (int)pVVar9 - (int)((int)&local_2c.x + 1)); if (0xf < (uint)local_38) { uVar4 = (int)local_38 + 1; pEVar7 = local_a4; if (0xfff < uVar4) { pEVar7 = local_a4[-1]._pickupGhostsEntity; uVar4 = (int)local_38 + 0x24; if (0x1f < (uint)((int)local_a4 + (-4 - (int)pEVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar7,uVar4); } if (((isAnimSame == 0) && (bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)&local_2c,1), bVar1 != 0)) && (((npc->_sprite)._animState._animData != (void *)0x0 && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)))) { (npc->_sprite)._animState._isPlaying = 0; } (npc->_sprite)._rotation = local_a0 - local_8c[0]; fVar12 = (npc->_v1).y; } fVar15 = sqrtf(fVar12 * fVar12 + (float)local_a8); pAVar14 = (ANM2 *)((fVar15 - 0.5) / 3.5); local_98 = (Entity_NPC *)(fVar15 * 0.02 + (npc->_v1).x); if ((float)pAVar14 <= 0.0) { pAVar14 = (ANM2 *)0x0; } if ((float)local_ac <= (float)pAVar14) { pAVar14 = local_ac; } (npc->_v1).x = (float)local_98; npc->_friction = ((float)pAVar14 * 0.13 + 0.86) * npc->_friction; while ((float)local_98 < 0.0) { local_98 = (Entity_NPC *)((npc->_v1).x + (float)local_ac); (npc->_v1).x = (float)local_98; } while ((float)local_ac <= (float)local_98) { local_98 = (Entity_NPC *)((npc->_v1).x - (float)local_ac); (npc->_v1).x = (float)local_98; } pvVar8 = (npc->_sprite)._animState._animData; if (pvVar8 == (void *)0x0) { fVar15 = (float)local_98 * 0.0; iVar3 = -1; } else { local_8c[0] = (npc->_sprite)._animState._animFrame; dVar16 = floor((double)local_8c[0]); local_8c[0] = (float)dVar16; fVar15 = (float)*(int *)((int)pvVar8 + 0x30) * (float)local_98; iVar3 = (int)dVar16; } if (((int)fVar15 != iVar3) && (pvVar8 != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)fVar15); } LAB_004f5c01: if ((((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) || (fVar15 = (npc->_velocity).y, fVar12 = (npc->_velocity).x, 16.0 < fVar12 * fVar12 + fVar15 * fVar15)) { pvVar8 = (npc->_collisionPoints)._begin; local_a4 = (Entity_NPC *)0x0; if ((int)(npc->_collisionPoints)._end - (int)pvVar8 >> 3 != 0) { do { roomRaw = g_game->_room; iVar5 = (int)(((*(float *)((int)pvVar8 + (int)local_a4 * 8) * 1.05 + (npc->_pos).x) - 40.0) / 40.0 + 0.5); iVar3 = (int)(((*(float *)((int)pvVar8 + (int)local_a4 * 8 + 4) * 1.05 + (npc->_pos).y) - 120.0) / 40.0 + 0.5); if (((-1 < iVar5) && (iVar5 < *(int *)((int)roomRaw + 0xc))) && ((((-1 < iVar3 && ((iVar3 < *(int *)((int)roomRaw + 0x10) && (uVar4 = iVar3 * *(int *)((int)roomRaw + 0xc) + iVar5, uVar4 < 0x1c0)))) && (local_2c.y = *(float *)((int)roomRaw + uVar4 * 4 + 0x24), (int *)local_2c.y != (int *)0x0)) && ((*(int *)((int)local_2c.y + 0x24) != npc->_i1 && ((*(int *)((int)local_2c.y + 0x3c) == 3 || (*(int *)((int)local_2c.y + 0x3c) == 2)))))) )) { gridEntityFn = *(code **)(*(int *)local_2c.y + 0x14); EntityRef::constructor(&EStack_84,(Entity *)npc); (*gridEntityFn)(0); } local_a4 = (Entity_NPC *)&local_a4->field_0x1; pvVar8 = (npc->_collisionPoints)._begin; } while (local_a4 < (undefined1 *)((int)(npc->_collisionPoints)._end - (int)pvVar8 >> 3)); } } flatFileOwner = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x97); if ((flatFileOwner == (Entity_Player *)0x0) || (iVar3 = Entity_Player::GetTrinketMultiplier(flatFileOwner,0x97), iVar3 < 2)) { isFlatFileBoosted = false; } else { isFlatFileBoosted = true; } if ((npc->_i2 != 0) == isFlatFileBoosted) { ExceptionList = local_1c; return; } iVar3 = 1 - npc->_i2; npc->_i2 = iVar3; if (iVar3 == 0) { fVar15 = 2.0; } else { fVar15 = 0.0; } local_ac = &npc->_sprite; npc->_collisionDamage = fVar15; text = "gfx/Monsters/repentance/ball_and_chain_retracted.png"; local_3c = (void *)0x0; if (iVar3 == 0) { text = "gfx/Monsters/repentance/ball_and_chain.png"; } local_38 = 2.10195e-44; local_4c = (Entity_NPC *)0x0; strCursor = (byte *)text; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); std::string::assign((char *)&local_4c,(byte *)text,(int)strCursor - (int)(text + 1)); pEVar7 = local_4c; local_14 = 0; if ((npc->_sprite)._layerCount < 1) { bVar1 = extraout_CL; } else { local_2c.y = (float)(npc->_sprite)._layerState; pEVar11 = (Entity_NPC *)((int)local_2c.y + 8); pEVar6 = pEVar11; if (0xf < *(uint *)((int)local_2c.y + 0x1c)) { pEVar6 = *(Entity_NPC **)pEVar11; } a = (Entity_NPC *)&local_4c; if (0xf < (uint)local_38) { a = local_4c; } isSameSheet = str_eq((byte *)a,(uint)local_3c,(byte *)pEVar6,*(uint *)((int)local_2c.y + 0x18)); bVar1 = extraout_CL_00; if (isSameSheet == 0) { if (pEVar11 == (Entity_NPC *)&local_4c) { *(undefined1 *)((int)local_2c.y + 0x30) = 0; } else { pEVar6 = (Entity_NPC *)&local_4c; if (0xf < (uint)local_38) { pEVar6 = pEVar7; } std::string::assign((char *)pEVar11,(byte *)pEVar6,(uint)local_3c); *(undefined1 *)((int)local_ac->_layerState + 0x30) = 0; pEVar7 = local_4c; bVar1 = extraout_CL_01; } } } pAVar14 = local_ac; local_14 = -1; if (0xf < (uint)local_38) { uVar4 = (int)local_38 + 1; pEVar11 = pEVar7; if (0xfff < uVar4) { pEVar11 = pEVar7[-1]._pickupGhostsEntity; uVar4 = (int)local_38 + 0x24; if ((byte *)0x1f < (byte *)((int)pEVar7 + (-4 - (int)pEVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar11,uVar4); bVar1 = extraout_CL_02; } ANM2::LoadGraphics(pAVar14,bVar1); ExceptionList = local_1c; return; } //@@ 004f5f20 NpcHelper::ball_and_chain_render_chain /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_NPC::Render for type 0x37d (893 Ball and Chain) when pos.y past targetPosition: renders chain layer segments via Sprite::RenderLayer */ void NpcHelper::ball_and_chain_render_chain(float *param_1) { LayerState *pLVar1; ColorMod *color; ColorMod *extraout_EAX; int in_ECX; float fVar2; float fVar3; float anchorOffsetX; float anchorOffsetX; double dVar5; ColorMod *color_00; undefined1 auStack_b4 [24]; float local_9c; Vector local_98; float local_90; float local_8c; float snappedX; float dirX; float dirY; float pixelScale; Vector renderPos; Color beamColor; uint securityCookie; ANM2 *sprite; securityCookie = __security_cookie ^ (uint)auStack_b4; if ((*(float *)(in_ECX + 0x334) != g_vectorZero.x) || (*(float *)(in_ECX + 0x338) != g_vectorZero.y)) { local_8c = *(float *)(in_ECX + 0x33c) - *(float *)(in_ECX + 0x334); local_90 = *(float *)(in_ECX + 0x340) - *(float *)(in_ECX + 0x338); dirX = local_8c; dirY = local_90; fVar2 = sqrtf(local_90 * local_90 + local_8c * local_8c); if (fVar2 <= 0.0) { fVar3 = local_8c; anchorOffsetX = local_90; } else { local_90 = (1.0 / fVar2) * dirY; local_8c = (1.0 / fVar2) * dirX; fVar3 = dirX; anchorOffsetX = dirY; } anchorOffsetX = local_8c * 4.0; local_90 = (local_90 * 4.0 * 0.6 + *(float *)(in_ECX + 0x338)) - 8.0; if (0.0 < fVar2) { dirY = anchorOffsetX * (1.0 / fVar2); dirX = fVar3 * (1.0 / fVar2); } local_8c = (g_screenHeight - 182.0) * 0.5; local_98.x = (g_screenWidth - 338.0) * 0.5; pixelScale = g_displayPixelRatio * g_screenPointScale; local_9c = (((anchorOffsetX + *(float *)(in_ECX + 0x334) + 0.0) - 60.0) * 0.65 + local_98.x) * pixelScale + 0.5; dVar5 = floor((double)local_9c); snappedX = (float)dVar5 / pixelScale; local_9c = ((local_90 - 140.0) * 0.65 + local_8c) * pixelScale + 0.5; dVar5 = floor((double)local_9c); local_90 = *param_1; local_9c = param_1[1]; renderPos.x = local_90 + snappedX; renderPos.y = local_9c + (float)dVar5 / pixelScale; local_98.x = ((((*(float *)(in_ECX + 0x33c) - dirX * 10.0) + *(float *)(in_ECX + 0x34c)) - 60.0) * 0.65 + local_98.x) * pixelScale + 0.5; dVar5 = floor((double)local_98.x); snappedX = (float)dVar5 / pixelScale; local_98.x = ((((*(float *)(in_ECX + 0x340) - dirY * 10.0) + *(float *)(in_ECX + 0x350)) - 140.0 ) * 0.65 + local_8c) * pixelScale + 0.5; dVar5 = floor((double)local_98.x); sprite = (ANM2 *)(in_ECX + 0x48); local_98.x = local_90 + snappedX; local_9c = local_9c + (float)dVar5 / pixelScale; local_98.y = local_9c; local_90 = local_98.x; pLVar1 = ANM2::GetLayer(sprite,(byte *)0x1); pLVar1->_visible = 1; DAT_00c78ef4 = 1; DAT_00c78ef8._0_2_ = 1; g_beamRendererPointsEnd = g_beamRendererPoints; DAT_00c78ef0 = sprite; Color::Color(&beamColor); BeamRenderer::Add(&renderPos,color,1.0,0.0); Color::Color(&beamColor); color_00 = extraout_EAX; fVar2 = sqrtf((local_9c - renderPos.y) * (local_9c - renderPos.y) + (local_90 - renderPos.x) * (local_90 - renderPos.x)); BeamRenderer::Add(&local_98,color_00,1.0,fVar2); BeamRenderer::End(); pLVar1 = ANM2::GetLayer(sprite,(byte *)0x1); local_8c = g_displayPixelRatio; pLVar1->_visible = 0; local_8c = local_8c * g_screenPointScale; local_98.x = (((*(float *)(in_ECX + 0x334) + 0.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5 ) * local_8c + 0.5; dVar5 = floor((double)local_98.x); snappedX = (float)dVar5 / local_8c; local_98.x = (((*(float *)(in_ECX + 0x338) - 8.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_8c + 0.5; dVar5 = floor((double)local_98.x); renderPos.y = (float)dVar5 / local_8c + param_1[1]; renderPos.x = snappedX + *param_1; local_98.x = *(float *)(in_ECX + 0xec); *(undefined4 *)(in_ECX + 0xec) = 0; pLVar1 = ANM2::GetLayer(sprite,(byte *)0x2); pLVar1->_visible = 1; Sprite::RenderLayer((Sprite *)sprite,2,&renderPos,&g_vectorZero,&g_vectorZero); pLVar1 = ANM2::GetLayer(sprite,(byte *)0x2); pLVar1->_visible = 0; *(float *)(in_ECX + 0xec) = local_98.x; } return; } //@@ 004f64e0 NpcAI::ENTITY_POOFER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 892 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_POOFER(Entity_NPC *npc) { Vector *pVVar1; ANM2 *pAVar2; qword qVar3; float *pfVar4; byte bVar5; undefined1 **ppuVar6; byte *curAnimName; uint uVar7; Entity *tmpEntity; ColorMod *color; uint angleRng; int iVar8; byte *newAnimName; int extraout_EDX; undefined4 extraout_EDX_00; qword *allocCounter; int iVar9; bool bVar10; float prevInflation; float fVar11; float inflateStep; float fVar12; EntityList_EL nearbyEntities; Vector particleVelocity; float splatTintR; float splatTintA; float particleVelX; Vector local_13c; Vector targetPos; float fartPitch; Vector local_128; float local_120; float local_11c; Entity *local_118; Vector local_114; undefined1 *local_10c; byte isNearbyFriendly; undefined1 *local_104; char isHealedAny; byte *local_fc; ProjectileParams projParams; Color tmpColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; void *animData; byte *curAnimData; Manager *manager; Entity_Player *nearby; code *setColorFn; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af3f90; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&tmpColor)[1]._colorize + 1); ExceptionList = &local_1c; fVar11 = (npc->_v2).x; fartPitch = 1.0; fVar12 = npc->_pendingDamage; (npc->_v1).y = (fVar11 * 0.5 + 1.0) * fVar12 + (npc->_v1).y; if ((0.0 < fVar12) && (fVar11 < 4.0)) { prevInflation = (npc->_v2).y; npc->_pendingDamage = fVar12 * 0.01; (npc->_v2).y = fVar12 / 10.0 + prevInflation; local_104 = (npc->_damageEvents)._begin; iVar8 = (int)(npc->_damageEvents)._end - (int)local_104; iVar9 = iVar8 >> 0x1f; if (iVar8 / 0x38 + iVar9 != iVar9) { local_10c = (undefined1 *)0x0; iVar9 = 0; do { local_10c = local_10c + 1; *(float *)(local_104 + iVar9) = *(float *)(local_104 + iVar9) * 0.01; iVar9 = iVar9 + 0x38; } while (local_10c < (undefined1 *)(((int)(npc->_damageEvents)._end - (int)local_104) / 0x38)) ; fVar11 = (npc->_v2).x; } } fVar12 = (npc->_v2).y; prevInflation = fVar11; if (fVar11 <= 0.0) { prevInflation = 0.0; } if (4.0 <= prevInflation) { prevInflation = 4.0; } if (fVar11 < fVar12) { inflateStep = npc->_speedMultiplier / 12.0; if (inflateStep < ABS(fVar11 - fVar12)) { fVar12 = fVar11 + inflateStep; } if (fVar12 <= 0.0) { fVar12 = 0.0; } if (4.0 <= fVar12) { fVar12 = 4.0; } (npc->_v2).x = fVar12; fVar11 = fVar12; } if (fVar11 <= 0.0) { fVar11 = 0.0; } if (4.0 <= fVar11) { fVar11 = 4.0; } iVar9 = (int)fVar11; pfVar4 = (&tmpColor)[1]._offset; if ((int)prevInflation < iVar9) { pfVar4 = (&tmpColor)[1]._offset; if ((npc->_state == 8) && ((animData = (npc->_sprite)._animState._animData, animData == (void *)0x0 || (pfVar4 = (&tmpColor)[1]._offset, *(char *)((int)animData + 0x34) == '\0')))) { ANM2::SetAnimation(&npc->_sprite,(&PTR_s_Attack0_00b60adc)[iVar9],0); pfVar4 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar4; local_114.y = -g_vectorOne.y; local_114.x = -g_vectorOne.x; Entity::SetSize((Entity *)npc,((float)iVar9 * 0.2 + 1.0) * *(float *)((int)npc->_config + 0x38), (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); pfVar4 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar4; fVar11 = (npc->_v1).x; if (0.0 < fVar11) { local_10c = (undefined1 *)0x0; local_104 = (undefined1 *)(fVar11 - npc->_speedMultiplier / 60.0); ppuVar6 = &local_104; if ((float)local_104 <= 0.0) { ppuVar6 = &local_10c; } (npc->_v1).x = (float)*ppuVar6; } fVar11 = (npc->_v1).y; if (0.0 < fVar11) { (npc->_v1).y = (npc->_v2).x * 0.2 * npc->_speedMultiplier + fVar11; } iVar8 = npc->_state; if (iVar8 != 0) { if (iVar8 == 3) { local_fc = (&PTR_DAT_00b60ac8)[iVar9]; curAnimData = (npc->_sprite)._animState._animData; if (curAnimData == (byte *)0x0) { LAB_004f6be6: bVar5 = ANM2::SetAnimation(&npc->_sprite,local_fc,1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = curAnimData; newAnimName = local_fc; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } do { bVar5 = *curAnimName; bVar10 = bVar5 < *newAnimName; if (bVar5 != *newAnimName) { LAB_004f6bc1: uVar7 = -(uint)bVar10 | 1; goto LAB_004f6bc6; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar10 = bVar5 < newAnimName[1]; if (bVar5 != newAnimName[1]) goto LAB_004f6bc1; curAnimName = curAnimName + 2; newAnimName = newAnimName + 2; } while (bVar5 != 0); uVar7 = 0; LAB_004f6bc6: if ((uVar7 != 0) || ((curAnimData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004f6be6; } if (20.0 < (npc->_v1).y) { (npc->_v1).y = 0.0; npc->_state = 8; } goto LAB_004f68f5; } if (iVar8 != 8) goto LAB_004f68f5; local_fc = (&PTR_s_Attack0_00b60adc)[iVar9]; curAnimData = (npc->_sprite)._animState._animData; if (curAnimData == (byte *)0x0) { LAB_004f683d: bVar5 = ANM2::SetAnimation(&npc->_sprite,local_fc,1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = curAnimData; newAnimName = local_fc; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } do { bVar5 = *curAnimName; bVar10 = bVar5 < *newAnimName; if (bVar5 != *newAnimName) { LAB_004f6818: uVar7 = -(uint)bVar10 | 1; goto LAB_004f681d; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar10 = bVar5 < newAnimName[1]; if (bVar5 != newAnimName[1]) goto LAB_004f6818; curAnimName = curAnimName + 2; newAnimName = newAnimName + 2; } while (bVar5 != 0); uVar7 = 0; LAB_004f681d: if ((uVar7 != 0) || ((curAnimData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004f683d; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar5 != 0) { Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.CircleAngle = 0.0; local_114.x = 10.0; local_114.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_114,9,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004f68f5; } } npc->_state = 3; LAB_004f68f5: npc->_friction = 0.8; Entity_NPC::CalcTargetPosition(npc,&targetPos,0.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); if ((tmpEntity != (Entity *)0x0) && (tmpEntity->_type == 1)) { local_114.x = tmpEntity[5]._splatColor._colorize[0] * 80.0 + targetPos.x; local_114.y = targetPos.y + tmpEntity[5]._splatColor._colorize[1] * 80.0; Room::GetClampedPositionImpl(g_game->_room,&local_128,&local_114,0.0,0.0,0.0,0.0); targetPos.x = local_128.x; targetPos.y = local_128.y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetPos,0.4,0,1); } manager = g_manager; if (npc->_dead == 0) { ExceptionList = local_1c; return; } if ((npc->_flags & 0x1000000) != 0) { ExceptionList = local_1c; return; } local_fc = (byte *)0x8d; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.5,0.0); pVVar1 = &npc->_pos; Game::ButterBeanFart(g_game,pVVar1,120.0,(Entity *)npc,0,0); Game::ShakeScreen(g_game,8); Color::Color(&tmpColor); Entity::MakeBloodPoof((Entity *)npc,pVVar1,color,1.0); tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 0.4; Entity_NPC::MakeBloodCloud(npc,pVVar1,(ColorMod *)&tmpColor); uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x16,pVVar1,&g_vectorZero,(Entity *)npc,0,uVar7); fVar11 = g_vectorOne.y; fVar12 = g_vectorOne.x * 2.6; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (tmpEntity->_sprite)._scale.x = fVar12; (tmpEntity->_sprite)._scale.y = fVar11 * 2.6; uVar7 = Random(); local_10c = (undefined1 *)0x6; local_118 = (Entity *) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0); do { local_fc = (byte *)((float)local_118 * 0.017453292); local_104 = (undefined1 *)sin((float)local_fc); local_114.x = cos((float)local_fc); local_114.x = local_114.x * 18.0; local_114.y = (float)local_104 * 18.0; uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&npc->_pos,&local_114,(Entity *)0x0,3,uVar7); (**(code **)(*(int *)tmpEntity + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = -15.0; tmpEntity->_renderDepthOffset = 10.0; local_104 = (undefined1 *)sin((float)local_fc); local_120 = cos((float)local_fc); iVar9 = 0; do { local_11c = (float)iVar9 * 50.0 + 50.0; local_fc = (byte *)(local_11c * local_120); local_11c = (float)local_104 * local_11c; uVar7 = Random(); local_128.x = (float)local_fc + (npc->_pos).x; local_128.y = local_11c + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,0x16,&local_128,&g_vectorZero,(Entity *)npc,0,uVar7); iVar8 = iVar9 + 1; fVar11 = 2.0 - (float)iVar9 * 0.5; fVar12 = fVar11 * g_vectorOne.y; fVar11 = fVar11 * g_vectorOne.x; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; (tmpEntity->_sprite)._scale.y = fVar12; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (tmpEntity->_sprite)._scale.x = fVar11; iVar9 = iVar8; } while (iVar8 < 2); local_10c = local_10c + -1; local_118 = (Entity *)((float)local_118 + 60.0); } while (local_10c != (undefined1 *)0x0); uVar7 = Random(); fVar11 = (npc->_splatColor)._colorize[3]; local_104 = (undefined1 *)(uVar7 % 5 + 5); splatTintA = (npc->_splatColor)._tint[3]; splatTintR = (npc->_splatColor)._tint[0] * 0.61960787; local_128.y = (npc->_splatColor)._tint[1] * 0.043137256; local_114.y = (npc->_splatColor)._tint[2] * 0.05882353; if (fVar11 != 0.0) { fVar12 = local_128.y * 0.71516 + splatTintR * 0.212671 + local_114.y * 0.072169; splatTintR = splatTintR + (fVar12 * (npc->_splatColor)._colorize[0] - splatTintR) * fVar11; local_128.y = local_128.y + (fVar12 * (npc->_splatColor)._colorize[1] - local_128.y) * fVar11; local_114.y = local_114.y + (fVar12 * (npc->_splatColor)._colorize[2] - local_114.y) * fVar11; } local_114.y = local_114.y + (npc->_splatColor)._offset[2]; local_128.y = local_128.y + (npc->_splatColor)._offset[1]; splatTintR = splatTintR + (npc->_splatColor)._offset[0]; for (; local_104 != (undefined1 *)0x0; local_104 = local_104 + -1) { uVar7 = Random(); local_120 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_120 = local_120 + local_120; local_11c = sin(local_120); uVar7 = Random(); local_fc = (byte *)((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0); particleVelocity.x = cos(local_120); particleVelocity.x = particleVelocity.x * (float)local_fc; particleVelocity.y = (float)local_fc * local_11c; particleVelX = particleVelocity.x; local_fc = (byte *)particleVelocity.y; uVar7 = Random(); angleRng = Random(); local_120 = (float)((double)(int)angleRng + __uint_to_double_fixup[-((int)angleRng >> 0x1f)]) * 2.3283064e-10 * 3.14; local_120 = local_120 + local_120; local_10c = (undefined1 *)sin(local_120); angleRng = Random(); local_11c = (float)((double)(int)angleRng + __uint_to_double_fixup[-((int)angleRng >> 0x1f)]) * 2.3283064e-10 * 20.0; fVar11 = cos(local_120); local_13c.x = fVar11 * local_11c + (npc->_pos).x; local_13c.y = (float)local_10c * local_11c + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,0x3b,&local_13c,&particleVelocity,(Entity *)npc,0,uVar7); local_10c = (undefined1 *)0x3f800000; if (-particleVelX * ((tmpEntity->_pos).y - (npc->_pos).y) + ((tmpEntity->_pos).x - (npc->_pos).x) * (float)local_fc < 0.0) { local_10c = &DAT_bf800000; } local_118 = tmpEntity; uVar7 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_10c; uVar7 = Random(); iVar9 = *(int *)tmpEntity; iVar8 = uVar7 % 0xf + 0xf; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar8; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar8; setColorFn = *(code **)(iVar9 + 0x3c); uVar7 = Random(); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[0] = splatTintR; tmpColor._tint[1] = local_128.y; tmpColor._tint[2] = local_114.y; tmpColor._tint[3] = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.25 + 0.1) * splatTintA; (*setColorFn)(&tmpColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)local_118 + 0xc))(); } tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; Game::BombExplosionEffects (g_game,&npc->_pos,4.0,(BitSet128)ZEXT816(0),(ColorMod *)&tmpColor,(Entity *)npc,1.0,1,4 ,0); isHealedAny = '\0'; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&npc->_pos,160.0,0x28); local_14 = 0.0; local_fc = (byte *)0x0; if ((byte *)nearbyEntities._size != (byte *)0x0) { do { nearby = *(Entity_Player **)((int)nearbyEntities._data + (int)local_fc * 4); if ((1 < *(int *)&g_game->_deathmatchManager) && (nearby->_type == 1)) { iVar9 = 1; goto LAB_004f73bb; } iVar9 = nearby->_type; if ((((iVar9 - 10U < 0x3de) && (iVar9 != 0x21)) && (iVar9 != 0x11)) && (iVar9 != 0x124)) { if (iVar9 != 0x375) { if (((iVar9 != 0x3c0) && (iVar9 != 0x3c5)) && (iVar9 != 0xf5)) goto LAB_004f73bb; goto LAB_004f7533; } if (nearby->_variant != 10) { LAB_004f73bb: if (nearby->_dead == 0) { isNearbyFriendly = (nearby->_flags & 0x20000000) != 0; bVar5 = Entity::IsFriendly((Entity *)npc); if (isNearbyFriendly == bVar5) { tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; (**(code **)(*(int *)nearby + 0x3c))(&tmpColor,8,0xff,1,1); local_114.y = nearby->_health + 15.0; local_128.y = nearby->_maxHitPoints + nearby->_maxHitPoints; pVVar1 = &local_114; if (local_128.y <= local_114.y) { pVVar1 = &local_128; } nearby->_health = pVVar1->y; uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x31,&npc->_pos,&g_vectorZero,(Entity *)0x0,0, uVar7); Entity::GetNullOffset((Entity *)npc,&local_13c,(byte *)"OverlayEffect"); if ((local_13c.x == g_vectorZero.x) && (local_13c.y == g_vectorZero.y)) { (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -24.0; } else { (tmpEntity->_posOffset).x = local_13c.x; (tmpEntity->_posOffset).y = local_13c.y; } tmpEntity->_renderDepthOffset = 1.0; (**(code **)(*(int *)tmpEntity + 0xc))(); isHealedAny = '\x01'; goto LAB_004f75f2; } iVar9 = extraout_EDX; } goto LAB_004f7533; } } else { LAB_004f7533: if ((iVar9 == 1) && (bVar5 = Entity::IsFriendly((Entity *)npc), bVar5 != 0)) { tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; (**(code **)(*(int *)nearby + 0x3c))(&tmpColor,8,0xff,extraout_EDX_00,extraout_EDX_00); Entity_Player::AddHearts(nearby,2,0,0); uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x31,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); iVar9 = *(int *)tmpEntity; (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = -24.0; (**(code **)(iVar9 + 0xc))(); isHealedAny = '\x01'; } } LAB_004f75f2: manager = g_manager; local_fc = local_fc + 1; } while (local_fc < (uint)nearbyEntities._size); if (isHealedAny != '\0') { if (npc->_championColorIdx == 0x12) { fartPitch = 1.5; } else if (npc->_championColorIdx == 0x13) { fartPitch = 0.5; } local_104 = (undefined1 *)0x9d; seed_fart_sound_override((int *)&local_104); SoundEffects::Play(&manager->_sfxManager,(int)local_104,1.0,2,0,fartPitch,0.0); } } if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { uVar7 = *(uint *)((int)nearbyEntities._data + -4); qVar3 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar7; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar3 < uVar7); free((void *)((int)nearbyEntities._data + -4)); } } ExceptionList = local_1c; return; } //@@ 004f76f0 NpcAI::ENTITY_MOCKULUS /* NPC AI for entity type 864 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOCKULUS(Entity_NPC *npc) { uint *puVar1; byte bVar2; RoomDescriptor *roomDesc; int iVar3; float *pfVar4; float fVar5; byte *animNameCursor; LayerState *eyeLayer; void *pvVar6; byte *pbVar7; char *expectedName; Game *game; uint uVar8; PlayerManager *playerManager; bool bVar9; float fVar10; float fVar11; float fVar12; float signY; float signX; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; float local_30; float local_2c; float local_28; float local_24; undefined4 local_20; undefined4 local_1c; float local_18; float local_14; float local_10; float local_c; char isRoomCleared; byte *animData; roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); if ((((uint)roomDesc->Flags >> 1 & 1) == 0) && ((iVar3 = Entity_NPC::GetAliveEnemyCount(npc), 0 < iVar3 || (8 < *(int *)((int)g_game->_room + 0x11ec))))) { isRoomCleared = '\0'; } else { isRoomCleared = '\x01'; } playerManager = &g_game->_playerManager; uVar8 = 0; fVar12 = 100000.0; local_c = (float)((uint)local_c & 0xffffff00); local_14 = 0.0; local_10 = 100000.0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; local_18 = fVar12; if ((int)pvVar6 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (playerManager->_playerList)._end; game = g_game; fVar12 = local_10; } pfVar4 = (playerManager->_playerList)._begin; if (uVar8 < (uint)((int)pvVar6 - (int)pfVar4 >> 2)) { pfVar4 = pfVar4 + uVar8; } fVar5 = *pfVar4; fVar11 = (npc->_pos).y - *(float *)((int)fVar5 + 0x340); fVar10 = (npc->_pos).x - *(float *)((int)fVar5 + 0x33c); local_c = (float)((uint)local_c & 0xff); if (*(int *)((int)fVar5 + 0x162c) != -1) { local_c = 1.4013e-45; } fVar10 = fVar11 * fVar11 + fVar10 * fVar10; if (fVar10 < fVar12) { fVar12 = fVar10; local_10 = fVar10; } playerManager = &game->_playerManager; if (local_18 <= fVar10) { fVar5 = local_14; } uVar8 = uVar8 + 1; local_14 = fVar5; } while (uVar8 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } iVar3 = npc->_state; local_10 = 0.0; if (iVar3 == 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; npc->_isInvicible = 1; npc->_entityGridCollisionClass = 3; npc->_state = 3; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = "CloseIdle"; do { bVar2 = *animNameCursor; bVar9 = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_004f7c28: uVar8 = -(uint)bVar9 | 1; goto LAB_004f7c2d; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar9 = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f7c28; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004f7c2d: if ((uVar8 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004f7c60; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"CloseIdle",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_004f7c60; } if (iVar3 == 3) { npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = "CloseIdle"; do { bVar2 = *animNameCursor; bVar9 = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_004f7ad0: uVar8 = -(uint)bVar9 | 1; goto LAB_004f7ad5; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar9 = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f7ad0; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004f7ad5: if ((uVar8 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004f7b08; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"CloseIdle",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004f7b08: if (local_c._0_1_ == '\0') goto LAB_004f7c60; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004f7b5e: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Open,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } pbVar7 = s_Open; do { bVar2 = *animNameCursor; bVar9 = bVar2 < *pbVar7; if (bVar2 != *pbVar7) { LAB_004f7b48: uVar8 = -(uint)bVar9 | 1; goto LAB_004f7b4d; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar9 = bVar2 < pbVar7[1]; if (bVar2 != pbVar7[1]) goto LAB_004f7b48; animNameCursor = animNameCursor + 2; pbVar7 = pbVar7 + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004f7b4d: if ((uVar8 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004f7b5e; } npc->_state = 4; npc->_i1 = 10; fVar12 = (npc->_v2).y; (npc->_velocity).x = (npc->_velocity).x + (npc->_v2).x; (npc->_velocity).y = fVar12 + (npc->_velocity).y; goto LAB_004f7c60; } if (iVar3 != 4) goto LAB_004f7c60; npc->_friction = npc->_friction * 0.9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } pbVar7 = s_Idle; do { bVar2 = *animNameCursor; bVar9 = bVar2 < *pbVar7; if (bVar2 != *pbVar7) { LAB_004f78c3: uVar8 = -(uint)bVar9 | 1; goto LAB_004f78c8; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar9 = bVar2 < pbVar7[1]; if (bVar2 != pbVar7[1]) goto LAB_004f78c3; animNameCursor = animNameCursor + 2; pbVar7 = pbVar7 + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004f78c8: if ((uVar8 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004f78fb; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_004f78fb: uVar8 = Random(); if ((uVar8 & 3) == 0) { uVar8 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3); } fVar12 = (npc->_velocity).x; signX = 1.0; if (fVar12 < 0.0) { signX = (float)&DAT_bf800000; } pfVar4 = &(npc->_velocity).y; signY = 1.0; if (*pfVar4 <= 0.0 && *pfVar4 != 0.0) { signY = (float)&DAT_bf800000; } fVar5 = npc->_friction; if (fVar5 != 0.0) { fVar10 = npc->_speedMultiplier; (npc->_velocity).y = (fVar10 * signY) / fVar5 + (npc->_velocity).y; (npc->_velocity).x = (fVar10 * signX) / fVar5 + fVar12; } (npc->_v2).x = signX; (npc->_v2).y = signY; if ((0 < npc->_i1) || (local_c._0_1_ != '\0')) goto LAB_004f7c60; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004f7a36: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Close",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = "Close"; do { bVar2 = *animNameCursor; bVar9 = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_004f7a20: uVar8 = -(uint)bVar9 | 1; goto LAB_004f7a25; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar9 = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f7a20; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar8 = 0; LAB_004f7a25: if ((uVar8 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004f7a36; } npc->_state = 3; npc->_i1 = 10; LAB_004f7c60: local_c = 0.0; if (local_14 != 0.0) { local_c = *(float *)((int)local_14 + 0x33c) - (npc->_pos).x; local_14 = *(float *)((int)local_14 + 0x340) - (npc->_pos).y; fVar12 = sqrtf(local_c * local_c + local_14 * local_14); local_10 = local_14; if (0.0 < fVar12) { local_10 = local_14 * (1.0 / fVar12); local_c = local_c * (1.0 / fVar12); } local_c = local_c * 4.0; local_10 = local_10 * 4.0; } eyeLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); if (((eyeLayer->_pos).x != local_c) || ((eyeLayer->_pos).y != local_10)) { eyeLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); local_18 = npc->_speedMultiplier * 3.0; local_10 = local_10 - (eyeLayer->_pos).y; local_c = local_c - (eyeLayer->_pos).x; fVar12 = sqrtf(local_10 * local_10 + local_c * local_c); if (local_18 < fVar12) { local_c = (local_18 / fVar12) * local_c; local_10 = local_10 * (local_18 / fVar12); } eyeLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); (eyeLayer->_pos).x = local_c + (eyeLayer->_pos).x; (eyeLayer->_pos).y = local_10 + (eyeLayer->_pos).y; } if (0 < npc->_i1) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1; } if (isRoomCleared != '\0') { local_40 = 0; local_3c = 0; local_38 = 0; local_34 = 0; local_30 = g_vectorZero.x; local_2c = g_vectorZero.y; local_28 = g_vectorZero.x; local_24 = g_vectorZero.y; local_20 = 0; local_1c = 0; (**(code **)(*(int *)npc + 0x24))(&local_40); } return; } //@@ 004f7e60 NpcAI::ENTITY_MORNINGSTAR /* NPC AI for entity type 863 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MORNINGSTAR(Entity_NPC *npc) { code *pcVar1; byte bVar2; int *playerSlot; byte *curAnimChar; Vector *pathTarget; Entity *target; void *pvVar3; byte *expectedName; Game *game; uint uVar4; PlayerManager *playerManager; bool isLess; undefined1 auVar5 [12]; float pathSpeed; int iVar6; undefined1 local_24 [12]; Vector targetPos; Entity_NPC *local_10; float soundPitch; uint isAnyPlayerMoving; byte *animData; Manager *manager; Entity_NPC *self; playerManager = &g_game->_playerManager; isAnyPlayerMoving = isAnyPlayerMoving & 0xffffff00; uVar4 = 0; game = g_game; local_10 = npc; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar3 = (playerManager->_playerList)._end; if ((int)pvVar3 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (uVar4 < (uint)((int)pvVar3 - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar4; } playerManager = &game->_playerManager; isAnyPlayerMoving = isAnyPlayerMoving & 0xff; if (*(int *)(*playerSlot + 0x1624) != -1) { isAnyPlayerMoving = 1; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } self = local_10; iVar6 = local_10->_state; if (iVar6 == 0) { if (local_10->_subtype == 0) { uVar4 = local_10->_initSeed; local_24._0_8_ = 0x500000001; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> 1 ^ uVar4; uVar4 = uVar4 << 5 ^ uVar4; Entity_NPC::Morph(local_10,local_10->_type,local_10->_variant, ((uVar4 >> 0x10 ^ uVar4) & 1) + 1,-1); } } else { if (iVar6 == 3) { local_10->_friction = local_10->_friction * 0.8; if (((local_10->_sprite)._animState._animData == (void *)0x0) || ((local_10->_sprite)._animState._isPlaying == 0)) { animData = (local_10->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedName = s_Idle; do { bVar2 = *curAnimChar; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_004f8224: uVar4 = -(uint)isLess | 1; goto LAB_004f8229; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f8224; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004f8229: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((local_10->_sprite)._animState._isPlaying != 0)))) goto LAB_004f825c; } bVar2 = ANM2::SetAnimation(&local_10->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(self->_sprite)._animState); (self->_sprite)._animState._isPlaying = 1; } } LAB_004f825c: if ((char)isAnyPlayerMoving == '\0') goto LAB_004f8363; animData = (self->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004f82b6: bVar2 = ANM2::SetAnimation(&self->_sprite,&DAT_00b607ac,1); if (bVar2 != 0) { AnimationState::Rewind(&(self->_sprite)._animState); (self->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedName = &DAT_00b607ac; do { bVar2 = *curAnimChar; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_004f82a0: uVar4 = -(uint)isLess | 1; goto LAB_004f82a5; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f82a0; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004f82a5: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((self->_sprite)._animState._isPlaying == 0)))) goto LAB_004f82b6; } self->_state = 4; self->_i1 = 10; (self->_v1).x = 0.7; goto LAB_004f8363; } if (iVar6 != 4) goto LAB_004f8363; if (((local_10->_sprite)._animState._animData == (void *)0x0) || ((local_10->_sprite)._animState._isPlaying == 0)) { animData = (local_10->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedName = &DAT_00b1d6fc; do { bVar2 = *curAnimChar; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_004f7f60: uVar4 = -(uint)isLess | 1; goto LAB_004f7f65; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f7f60; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004f7f65: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((local_10->_sprite)._animState._isPlaying != 0)))) goto LAB_004f7f98; } bVar2 = ANM2::SetAnimation(&local_10->_sprite,&DAT_00b1d6fc,1); if (bVar2 != 0) { AnimationState::Rewind(&(self->_sprite)._animState); (self->_sprite)._animState._isPlaying = 1; } } LAB_004f7f98: if ((((self->_sprite)._animState._animData == (void *)0x0) || (bVar2 = AnimationState::WasEventTriggered(&(self->_sprite)._animState,(byte *)"Shoot"), bVar2 == 0)) && ((pvVar3 = (self->_sprite)._animState._animData, pvVar3 == (void *)0x0 || (*(char *)((int)pvVar3 + 0x34) == '\0')))) { bVar2 = 1; iVar6 = 900; pathSpeed = 0.3; pathTarget = Entity_NPC::CalcTargetPosition(self,(Vector *)(local_24 + 4),0.0); PathFinder::FindGridPath((PathFinder *)&self->_pathfinder,pathTarget,pathSpeed,iVar6,bVar2); } else { local_10 = (Entity_NPC *)(self->_v1).x; pathTarget = Entity_NPC::CalcTargetPosition(self,&targetPos,0.0); PathFinder::FindGridPath((PathFinder *)&self->_pathfinder,pathTarget,(float)local_10,900,1); auVar5 = ZEXT812(0x40000000); pathSpeed = self->_speedMultiplier * 0.01 + (self->_v1).x; if (pathSpeed <= auVar5._0_4_) { auVar5._4_8_ = auVar5._4_8_; auVar5._0_4_ = pathSpeed; } (self->_v1).x = auVar5._0_4_; } if (self->_controllerID == -1) { target = Entity_NPC::GetPlayerTarget(self); bVar2 = Entity::IsHostileTo((Entity *)self,target); if (((bVar2 != 0) && ((self->_pathfinder)._hasDirectPath != 0)) && (uVar4 = Random(), uVar4 % 3 == 0)) goto LAB_004f80bb; } else { bVar2 = input_is_action_triggered(g_manager,10,self->_controllerID,(Entity *)self,0); if (bVar2 != 0) { LAB_004f80bb: manager = g_manager; soundPitch = 1.0; if (self->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (self->_championColorIdx == 0x13) { soundPitch = 0.5; } local_10 = (Entity_NPC *)0x74; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,(int)local_10,1.0,0x3c,0,soundPitch,0.0); } } if ((0 < self->_i1) || ((char)isAnyPlayerMoving != '\0')) goto LAB_004f8363; animData = (self->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004f8196: bVar2 = ANM2::SetAnimation(&self->_sprite,&DAT_00b607b4,1); if (bVar2 != 0) { AnimationState::Rewind(&(self->_sprite)._animState); (self->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedName = &DAT_00b607b4; do { bVar2 = *curAnimChar; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_004f8180: uVar4 = -(uint)isLess | 1; goto LAB_004f8185; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_004f8180; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004f8185: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((self->_sprite)._animState._isPlaying == 0)))) goto LAB_004f8196; } self->_i1 = 10; } self->_state = 3; LAB_004f8363: if (0 < self->_i1) { self->_i1 = ((int)self->_prevUpdateTime - (int)self->_updateTime) + self->_i1; } return; } //@@ 004f8390 FUN_004f8390 void FUN_004f8390(void) { undefined4 *in_ECX; *in_ECX = *(undefined4 *)*in_ECX; return; } //@@ 004f83a0 std::deque::resize /* DB: Growmap/new(0x10) loop */ void std::deque::resize(uint param_1) { uint uVar1; void *pvVar2; int iVar3; int in_ECX; uint uVar4; uVar4 = *(uint *)(in_ECX + 0x10); if (uVar4 < param_1) { uVar1 = *(uint *)(in_ECX + 0xc); do { if (((uVar4 + uVar1 & 1) == 0) && (*(uint *)(in_ECX + 8) <= uVar4 + 2 >> 1)) { _Growmap(uVar4); uVar1 = *(uint *)(in_ECX + 0xc); uVar4 = *(uint *)(in_ECX + 0x10); } uVar1 = *(int *)(in_ECX + 8) * 2 - 1U & uVar1; *(uint *)(in_ECX + 0xc) = uVar1; uVar1 = uVar1 + uVar4; uVar4 = *(int *)(in_ECX + 8) - 1U & uVar1 >> 1; iVar3 = *(int *)(in_ECX + 4); if (*(int *)(iVar3 + uVar4 * 4) == 0) { pvVar2 = operator_new(0x10); *(void **)(*(int *)(in_ECX + 4) + uVar4 * 4) = pvVar2; iVar3 = *(int *)(in_ECX + 4); } iVar3 = *(int *)(iVar3 + uVar4 * 4); uVar1 = uVar1 & 1; *(undefined4 *)(iVar3 + 4 + uVar1 * 8) = 0; *(undefined4 *)(iVar3 + uVar1 * 8) = 0; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; uVar4 = *(uint *)(in_ECX + 0x10); uVar1 = *(uint *)(in_ECX + 0xc); } while (uVar4 < param_1); } while (param_1 < uVar4) { uVar4 = uVar4 - 1; *(uint *)(in_ECX + 0x10) = uVar4; if (uVar4 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; } } return; } //@@ 004f8460 FUN_004f8460 void FUN_004f8460(int *param_1,int *param_2) { int iVar1; int in_ECX; iVar1 = *param_2; *(int *)param_2[1] = iVar1; *(int *)(*param_2 + 4) = param_2[1]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -1; operator_delete(param_2,0x20); *param_1 = iVar1; return; } //@@ 004f84a0 str_ne /* DB: !str_eq */ uint str_ne(void) { uint *puVar1; byte bVar2; byte *pbVar3; undefined3 extraout_var; byte *in_ECX; byte *in_EDX; pbVar3 = in_EDX; do { bVar2 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar2 != 0); puVar1 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } bVar2 = str_eq(in_ECX,*puVar1,in_EDX,(int)pbVar3 - (int)(in_EDX + 1)); return CONCAT31(extraout_var,bVar2) ^ 1; } //@@ 004f84e0 std::vector<12byte>::_Emplace_reallocate /* DB: grow (max 0x15555555) of the global NPC trail point vector (begin DAT_00c7f76c, end g_npcTrailPointsEnd, cap DAT_00c7f774) of 12-byte {Vector, float} points; three times from Entity_NPC::render_overlay when full */ undefined8 * std::vector<12byte>::_Emplace_reallocate(undefined8 *param_1,undefined8 *param_2) { uint uVar1; undefined8 *puVar2; undefined8 *puVar3; int iVar4; undefined8 *puVar5; void *pvVar6; undefined8 *puVar7; int iVar8; uint uVar9; undefined8 *puVar10; uint uVar11; iVar8 = (int)param_1 - (int)DAT_00c7f76c; iVar4 = ((int)g_npcTrailPointsEnd - (int)DAT_00c7f76c) / 0xc; if (iVar4 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar4 + 1; uVar11 = (DAT_00c7f774 - (int)DAT_00c7f76c) / 0xc; if (0x15555555 - (uVar11 >> 1) < uVar11) { uVar9 = 0x15555555; } else { uVar11 = (uVar11 >> 1) + uVar11; uVar9 = uVar1; if (uVar1 <= uVar11) { uVar9 = uVar11; } if (0x15555555 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = _Allocate(uVar9 * 0xc); puVar3 = (undefined8 *)((int)puVar7 + (iVar8 / 0xc) * 0xc); *puVar3 = *param_2; *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(param_2 + 1); pvVar6 = g_npcTrailPointsEnd; puVar10 = puVar7; puVar2 = DAT_00c7f76c; puVar5 = g_npcTrailPointsEnd; if (param_1 == g_npcTrailPointsEnd) { for (; puVar2 != pvVar6; puVar2 = (undefined8 *)((int)puVar2 + 0xc)) { *puVar10 = *puVar2; *(undefined4 *)(puVar10 + 1) = *(undefined4 *)(puVar2 + 1); puVar10 = (undefined8 *)((int)puVar10 + 0xc); } } else { for (; g_npcTrailPointsEnd = puVar5, puVar2 != param_1; puVar2 = (undefined8 *)((int)puVar2 + 0xc)) { *puVar10 = *puVar2; *(undefined4 *)(puVar10 + 1) = *(undefined4 *)(puVar2 + 1); puVar10 = (undefined8 *)((int)puVar10 + 0xc); puVar5 = g_npcTrailPointsEnd; } if (param_1 != puVar5) { puVar10 = puVar3; do { *(undefined8 *)((int)puVar10 + 0xc) = *param_1; puVar2 = param_1 + 1; param_1 = (undefined8 *)((int)param_1 + 0xc); *(undefined4 *)((int)puVar10 + 0x14) = *(undefined4 *)puVar2; puVar10 = (undefined8 *)((int)puVar10 + 0xc); } while (param_1 != puVar5); } } if (DAT_00c7f76c != (undefined8 *)0x0) { uVar11 = ((DAT_00c7f774 - (int)DAT_00c7f76c) / 0xc) * 0xc; puVar10 = DAT_00c7f76c; if (0xfff < uVar11) { puVar10 = *(undefined8 **)((int)DAT_00c7f76c + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)DAT_00c7f76c + (-4 - (int)puVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar10,uVar11); } DAT_00c7f76c = puVar7; g_npcTrailPointsEnd = (void *)((int)puVar7 + uVar1 * 0xc); DAT_00c7f774 = uVar9 * 0xc + (int)puVar7; return puVar3; } //@@ 004f86d0 std::multimap::emplace /* DB: red-black tree insert of a 0x18-byte node (float key +0x10, value +0x14), descends with key < node key (multi, no uniqueness test), size check 0xaaaaaaa; callers NpcAI::ENTITY_GOAT (distance-sorted), 006dac00 */ void std::multimap::emplace(undefined4 *param_1,float *param_2) { float fVar1; char cVar2; int iVar3; int *piVar4; bool bVar5; uint uVar6; int *piVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af3fd5; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar3 = *in_ECX; local_8 = 0; piVar7 = operator_new(0x18); fVar1 = *param_2; piVar7[4] = (int)fVar1; piVar7[5] = (int)param_2[1]; *piVar7 = iVar3; piVar7[1] = iVar3; piVar7[2] = iVar3; *(undefined2 *)(piVar7 + 3) = 0; local_8 = 1; bVar5 = false; piVar4 = (int *)*in_ECX; piVar9 = (int *)piVar4[1]; if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar8 = piVar9; do { piVar9 = piVar8; bVar5 = fVar1 < (float)piVar9[4]; if (bVar5) { piVar8 = (int *)*piVar9; } else { piVar8 = (int *)piVar9[2]; } } while (*(char *)((int)piVar8 + 0xd) == '\0'); } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } in_ECX[1] = in_ECX[1] + 1; piVar7[1] = (int)piVar9; if (piVar9 == piVar4) { *piVar4 = (int)piVar7; piVar4[1] = (int)piVar7; piVar4[2] = (int)piVar7; *(undefined1 *)(piVar7 + 3) = 1; } else { if (bVar5) { *piVar9 = (int)piVar7; if (piVar9 == (int *)*piVar4) { *piVar4 = (int)piVar7; } } else { piVar9[2] = (int)piVar7; if (piVar9 == (int *)piVar4[2]) { piVar4[2] = (int)piVar7; } } cVar2 = *(char *)(piVar7[1] + 0xc); piVar9 = piVar7; while (cVar2 == '\0') { piVar8 = (int *)piVar9[1]; piVar10 = *(int **)piVar8[1]; if (piVar8 == piVar10) { piVar10 = (int *)((undefined4 *)piVar8[1])[2]; if ((char)piVar10[3] == '\0') goto LAB_004f881a; if (piVar9 == (int *)piVar8[2]) { FUN_00415fe0(piVar8); piVar9 = piVar8; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar9[1] + 4)); } else if ((char)piVar10[3] == '\0') { LAB_004f881a: *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(piVar10 + 3) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; piVar9 = *(int **)(piVar9[1] + 4); } else { if (piVar9 == (int *)*piVar8) { FUN_00415f80(piVar8); piVar9 = piVar8; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar9[1] + 4)); } cVar2 = *(char *)(piVar9[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 004f88a0 rng_pair_init /* DB: ? two 0x16a9de81 seeds */ void rng_pair_init(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0x16a9de81; in_ECX[5] = 0; *(undefined1 *)(in_ECX + 6) = 0; in_ECX[7] = 0x16a9de81; return; } //@@ 004f88e0 FUN_004f88e0 uint FUN_004f88e0(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); return CONCAT31((uint3)(uVar1 >> 0x11),(char)(uVar1 >> 9)) & 0xffffff01; } //@@ 004f88f0 Level::GetStateFlag /* ZHL [lua] Lua binding Level:GetStateFlag */ undefined4 __thiscall Level::GetStateFlag(Level *this,uint param_2) { uint uVar1; uint uVar2; if ((int)param_2 < 1) { param_2 = 0; } uVar2 = 0x19; if ((int)param_2 < 0x19) { uVar2 = param_2; } uVar1 = 1 << ((byte)uVar2 & 0x1f); return CONCAT31((int3)(uVar1 >> 8), (*(uint *)(this->_ventricleRazorPortals + (uVar2 >> 5) * 4 + 0x24) & uVar1) != 0); } //@@ 004f8930 FUN_004f8930 undefined4 FUN_004f8930(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x1830c); } //@@ 004f8940 PlayerManager::AnyoneHasCollectible /* DB: FirstCollectibleOwner(id,..,1) != null prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall PlayerManager::AnyoneHasCollectible(PlayerManager *this,int collectibleId) { Entity_Player *pEVar1; pEVar1 = FirstCollectibleOwner(this,collectibleId,(RNG **)this,1); return pEVar1 != (Entity_Player *)0x0; } //@@ 004f8960 NpcAI::ENTITY_QUAKE_GRIMACE /* NPC AI for entity type 804 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_QUAKE_GRIMACE(Entity_NPC *npc) { byte isStompEvent; RoomDescriptor *roomDesc; int gridIndex; int iVar1; uint subType; uint uVar2; EntityPtr minecart; Room *local_14; Entity *local_10; EntityPtr savedMinecart; uint *flagsHigh; Manager *manager; EntityPtr *parentRef; float posY; float targetY; minecart = npc->_minecart; savedMinecart = minecart; if (npc->_aiCallPhase == 1) { if (minecart != (EntityPtr)0x0) { return; } if (npc->_dead != 0) { return; } iVar1 = (npc->_pathfinder)._gridIndex; if (iVar1 < 0) { return; } Room::SetGridPath(g_game->_room,iVar1,3999); return; } local_14 = g_game->_room; roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); iVar1 = npc->_state; uVar2 = (uint)roomDesc->Flags >> 1; if (((iVar1 == 3) || (iVar1 == 8)) && ((uVar2 & 1) != 0)) { npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"CloseEyes",0); iVar1 = npc->_state; } local_10 = (Entity *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (iVar1 == 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2008; npc->_isInvicible = 1; npc->_state = 3; npc->_aiCallFlags = 1; npc->_stateFrame = 10; if (minecart == (EntityPtr)0x0) { gridIndex = Room::GetGridIndex(local_14,&npc->_pos); PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); iVar1 = local_14->_gridWidth; (npc->_targetPosition).x = (float)(gridIndex % iVar1) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(gridIndex / iVar1) * 40.0 + 120.0; } if ((uVar2 & 1) == 0) { return; } npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"CloseEyes",0); if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } AnimationState::AdvancePosition (&(npc->_sprite)._animState, *(int *)((int)(npc->_sprite)._animState._animData + 0x30) + -1); return; } if (iVar1 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_stateFrame = npc->_stateFrame - (int)local_10; if (npc->_stateFrame < 1) { npc->_state = 8; } } else if (iVar1 == 8) { ANM2::Play(&npc->_sprite,&DAT_00b1d710,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { isStompEvent = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d3b0); manager = g_manager; if (isStompEvent != 0) { local_14 = (Room *)0x34; seed_fart_sound_override((int *)&local_14); SoundEffects::Play(&manager->_sfxManager,(int)local_14,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0x10); uVar2 = Random(); local_10 = Game::SpawnEx(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar2,0); parentRef = &local_10->_parent; if (local_10->_parent != (EntityPtr)0x0) { local_14 = (Room *)parentRef; std::multiset::erase(&local_14); } *parentRef = (EntityPtr)npc; std::multiset::insert(parentRef); subType = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar2 = 3; if (subType < 3) { uVar2 = subType; } *(undefined4 *)(local_10[1]._sprite._animDefaultName._buf + 8) = *(undefined4 *)(&DAT_00b60b68 + uVar2 * 4); minecart = savedMinecart; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004f8ba7; } ANM2::Play(&npc->_sprite,s_Idle,0); npc->_stateFrame = 10; } LAB_004f8ba7: if (minecart == (EntityPtr)0x0) { targetY = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = targetY - posY; return; } return; } //@@ 004f8cc0 FUN_004f8cc0 void FUN_004f8cc0(int param_1) { uint uVar1; uint uVar2; float fVar3; float fVar4; Vector local_20; float local_18; float local_14; Vector local_10; local_18 = *(float *)(param_1 + 0x33c); local_14 = *(float *)(param_1 + 0x340); uVar1 = Random(); fVar3 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar3 = fVar3 + fVar3; local_20.x = cos(fVar3); fVar3 = sin(fVar3); uVar1 = Random(); uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 0.5; local_20.y = fVar4 * fVar3; local_10.y = fVar3 * 4.0 + local_14; local_10.x = local_20.x * 4.0 + local_18; local_20.x = fVar4 * local_20.x; Game::SpawnEx(g_game,5,0x29,&local_10,&local_20,(Entity *)0x0,0,uVar1,0); return; } //@@ 004f8df0 NpcAI::ENTITY_BOMB_GRIMACE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: type 809; was GridEntity_Fire::Update */ void __fastcall NpcAI::ENTITY_BOMB_GRIMACE(Entity_NPC *npc) { float fVar1; float fVar2; code *pcVar3; Game *pGVar4; longlong lVar5; longlong lVar6; longlong lVar7; float fVar8; Entity *entity; byte bVar9; char isBanned; uint uVar10; EntityPtr EVar11; uint uVar12; int iVar13; int *piVar14; int gridIndex; float *extraout_EAX; int unusedArg; void *pvVar15; EntityPtr *refSlot; PlayerManager *playerManager; Room *room; bool bVar16; ulonglong timeNs; undefined1 auStack_cc [7]; char isInMineshaft; uint spawnSubType; uint local_c0; int *local_bc; EntityPtr *local_b8; Entity_NPC *savedNpc; Vector local_b0; Entity *local_a4; Game *local_a0; uint local_9c; EntityPtr local_98; uint spawnType; uint spawnVariant; EntityPtr *local_8c; Room *local_88; uint spawnSeed; EntityPtr *local_80; Vector bombVelocity; Vector bombPos; int iStack_6c; int iStack_68; undefined8 local_60; undefined4 local_58; undefined1 local_54 [8]; int local_4c; Color defaultColor; RNG cardRng; uint local_c; EntityPtr bombParentRef; undefined4 flagsHigh; uint *flagsHighPtr; local_c = __security_cookie ^ (uint)auStack_cc; EVar11 = npc->_minecart; savedNpc = npc; local_98 = EVar11; if (npc->_aiCallPhase == 1) { if (EVar11 != (EntityPtr)0x0) { return; } if (npc->_dead != 0) { return; } iVar13 = (npc->_pathfinder)._gridIndex; if (iVar13 < 0) { return; } Room::SetGridPath(g_game->_room,iVar13,3999); return; } room = g_game->_room; local_88 = room; bVar9 = Level::HasAbandonedMineshaft((Level *)g_game); if (((bVar9 == 0) || (g_game->_currentDimensionIdx != 1)) || (isInMineshaft = '\x01', (g_game->_levelStateFlags & 0x400000U) != 0)) { isInMineshaft = '\0'; } iVar13 = npc->_state; if (iVar13 == 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000001; flagsHighPtr = (uint *)((int)&npc->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x2008; npc->_isInvicible = 1; npc->_aiCallFlags = 1; npc->_state = 3; if (EVar11 == (EntityPtr)0x0) { gridIndex = Room::GetGridIndex(room,&npc->_pos); PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); iVar13 = local_88->_gridWidth; (npc->_targetPosition).x = (float)(gridIndex % iVar13) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(gridIndex / iVar13) * 40.0 + 120.0; room = local_88; } if (isInMineshaft != '\0') { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } refSlot = &npc->_child; if ((npc->_child == (EntityPtr)0x0) && (isInMineshaft == '\0')) { local_b0.x = (npc->_pos).x + 0.0; local_b0.y = (npc->_pos).y + 40.0; iVar13 = Room::GetGridIndex(room,&local_b0); local_b0.x = (float)(iVar13 % room->_gridWidth) * 40.0 + 40.0; local_b0.y = (float)(iVar13 / room->_gridWidth) * 40.0 + 120.0; uVar10 = Random(); EVar11 = (EntityPtr) Game::SpawnEx(g_game,5,0x29,&local_b0,&g_vectorZero,(Entity *)npc,0,uVar10,0); if (*refSlot != (EntityPtr)0x0) { local_98 = (EntityPtr)refSlot; std::multiset::erase(&local_98); } *refSlot = EVar11; if (EVar11 != (EntityPtr)0x0) { std::multiset::insert(refSlot); } bombParentRef = (EntityPtr)((int)EVar11 + 0x3bc); if (*(EntityPtr *)((int)EVar11 + 0x3bc) != (EntityPtr)0x0) { local_98 = bombParentRef; std::multiset::erase(&local_98); } *(Entity_NPC **)bombParentRef = npc; std::multiset::insert(bombParentRef); (**(code **)(*(int *)EVar11 + 0xc))(); if (*(void **)((int)EVar11 + 0x7c) != (void *)0x0) { AnimationState::AdvancePosition ((AnimationState *)((int)EVar11 + 0x78), *(int *)((int)*(void **)((int)EVar11 + 0x7c) + 0x30) + -1); } } Color::Color(&defaultColor); if (&npc->_splatColor != (ColorMod *)extraout_EAX) { fVar1 = extraout_EAX[1]; fVar2 = extraout_EAX[2]; fVar8 = extraout_EAX[3]; (npc->_splatColor)._tint[0] = *extraout_EAX; (npc->_splatColor)._tint[1] = fVar1; (npc->_splatColor)._tint[2] = fVar2; (npc->_splatColor)._tint[3] = fVar8; fVar1 = extraout_EAX[5]; fVar2 = extraout_EAX[6]; fVar8 = extraout_EAX[7]; (npc->_splatColor)._colorize[0] = extraout_EAX[4]; (npc->_splatColor)._colorize[1] = fVar1; (npc->_splatColor)._colorize[2] = fVar2; (npc->_splatColor)._colorize[3] = fVar8; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(extraout_EAX + 8); (npc->_splatColor)._offset[2] = extraout_EAX[10]; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; return; } if (iVar13 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); if ((npc->_stateFrame < 1) || (isInMineshaft != '\0')) { if (npc->_child != (EntityPtr)0x0) { if (*(char *)((int)npc->_child + 0x173) == '\0') goto LAB_004f907a; local_8c = &npc->_child; std::multiset::erase(&local_8c); } npc->_child = (EntityPtr)0x0; npc->_stateFrame = 0x1e; } else { iVar13 = npc->_stateFrame + -1; npc->_stateFrame = iVar13; if (iVar13 == 0) { npc->_state = 8; } } } else if (iVar13 == 8) { ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar9 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar9 != 0) { Entity_NPC::PlaySound(npc,0x106,1.0,2,0,1.0); uVar10 = Random(); bombPos.x = (npc->_pos).x + 0.0; bombPos.y = (npc->_pos).y + 6.0; bombVelocity.x = 0.0; bombVelocity.y = 1.25; EVar11 = (EntityPtr) Game::SpawnEx(g_game,5,0x29,&bombPos,&bombVelocity,(Entity *)npc,0,uVar10,0); refSlot = &npc->_child; if (npc->_child != (EntityPtr)0x0) { local_80 = refSlot; std::multiset::erase(&local_80); } *refSlot = EVar11; if (EVar11 != (EntityPtr)0x0) { std::multiset::insert(refSlot); } refSlot = (EntityPtr *)((int)EVar11 + 0x3bc); if (*(EntityPtr *)((int)EVar11 + 0x3bc) != (EntityPtr)0x0) { local_8c = refSlot; std::multiset::erase(&local_8c); } *refSlot = (EntityPtr)npc; std::multiset::insert(refSlot); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004f907a; } npc->_state = 3; } LAB_004f907a: if (npc->_dead == 0) goto LAB_004f9682; spawnSeed = Random(); local_a0 = g_game; spawnSubType = 0; spawnVariant = 0x77; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&g_vectorZero,&g_vectorZero,(Entity *)0x0, (int *)&spawnSubType,&spawnSeed); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_004f9354: local_c0 = spawnSubType; } else { piVar14 = (g_game->_deathmatchManager)._type; local_bc = piVar14; uVar12 = Random(); uVar10 = spawnSubType; local_60 = 0x900000005; local_a4 = (Entity *)0x7; local_58 = 7; if (spawnType != 5) goto LAB_004f9354; if (spawnVariant < 0x12d) { if (spawnVariant == 300) { while ((local_c0 = spawnSubType, spawnSubType == 0 || (isBanned = (**(code **)(*piVar14 + 0x24))(spawnSubType), isBanned != '\0'))) { if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar12 = uVar12 >> ((byte)local_60 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)((ulonglong)local_60 >> 0x20) & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)local_a4 & 0x1f) ^ uVar12; iVar13 = ItemPool::GetCardEx(uVar12,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar12; spawnSubType = lua_callback_run_get_card(&cardRng,iVar13,1,1,0); } } else { if (spawnVariant == 0x46) { local_9c = spawnSubType >> 0xb; do { local_c0 = spawnSubType; if (spawnSubType != 0) { pcVar3 = *(code **)(*piVar14 + 0x28); iVar13 = ItemPool::GetPillEffect(&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0) ; isBanned = (*pcVar3)(iVar13); if (isBanned == '\0') goto LAB_004f91ad; piVar14 = local_bc; } if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar12 = uVar12 >> ((byte)local_60 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)((ulonglong)local_60 >> 0x20) & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)local_a4 & 0x1f) ^ uVar12; spawnSubType = ItemPool::GetPill(uVar12); spawnSubType = spawnSubType | (local_9c & 1) << 0xb; } while( true ); } if (spawnVariant != 100) goto LAB_004f9354; local_c0 = spawnSubType; if (spawnSubType == 0x19) { LAB_004f918d: bVar16 = false; } else { local_9c = spawnSubType; std::set::find_node(local_54,&local_9c); if (((*(char *)(local_4c + 0xd) == '\0') && (*(int *)(local_4c + 0x10) <= (int)uVar10)) && (local_4c != piVar14[8])) goto LAB_004f918d; bVar16 = true; } if ((uVar10 == 0) || (bVar16)) { spawnSubType = (**(code **)(*piVar14 + 0x84))(0); local_c0 = spawnSubType; } } } else { if (spawnVariant != 0x15e) goto LAB_004f9354; while ((local_c0 = spawnSubType, spawnSubType == 0 || (isBanned = (**(code **)(*piVar14 + 0x2c))(spawnSubType), isBanned != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } LAB_004f91ad: npc = savedNpc; } local_a4 = EntityFactory::Create(local_a0->_entityFactory,spawnType,0); if (local_a4 != (Entity *)0x0) { timeNs = GetTimeNs(); entity = local_a4; uVar10 = (uint)(timeNs >> 0x20); lVar5 = (timeNs & 0xffffffff) * 0x431bde82; local_b8 = (EntityPtr *)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_b0.x = (float)(lVar6 + lVar5); lVar5 = (ulonglong)uVar10 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar6 >> 0x20), (uint)(&local_b8->field_0x0 + CARRY4((uint)lVar5,(uint)lVar6))), (int)((ulonglong)(lVar6 + lVar5) >> 0x20)); uVar10 = (uint)((ulonglong)lVar5 >> 0x20); refSlot = &local_a4->_spawnerEntity; local_bc = (int *)((uint)lVar5 >> 0x12 | uVar10 * 0x4000); local_88 = (Room *)(uVar10 >> 0x12); local_a4->_spawnerType = 0; local_a4->_spawnerVariant = 0; if (*refSlot != (EntityPtr)0x0) { local_b8 = refSlot; std::multiset::erase(&local_b8); } iVar13 = *(int *)entity; *refSlot = (EntityPtr)0x0; (entity->_pos).x = g_vectorZero.x; (entity->_pos).y = g_vectorZero.y; (entity->_velocity).x = g_vectorZero.x; (entity->_velocity).y = g_vectorZero.y; (**(code **)(iVar13 + 4))(spawnType,spawnVariant,local_c0,spawnSeed); pGVar4 = local_a0; pvVar15 = local_a0->_room; iVar13 = *(int *)((int)pvVar15 + 0x1214); *(int *)((int)pvVar15 + 0x1214) = iVar13 + 1; entity->_index = iVar13; EntityList::AddEntity((EntityList *)((int)pvVar15 + 0x1218),entity); bVar9 = Game::ShouldEraseEnemy(entity); if (bVar9 != 0) { Entity::RemoveWithPoof(entity,unusedArg); } if ((entity->_exists != 0) && ((pGVar4->_proceduralItemManager)._proceduralItems._begin != (pGVar4->_proceduralItemManager)._proceduralItems._end)) { iStack_68 = entity->_variant; iStack_6c = entity->_type; std::map::find(&local_a0,&iStack_6c); pGVar4 = (pGVar4->_proceduralItemManager)._spawnTriggerTargets._head; if (local_a0 == pGVar4) { local_b0.x = (float)entity->_type; local_b0.y = -NAN; piVar14 = (int *)std::map::find(&local_c0,&local_b0); local_a0 = (Game *)*piVar14; if (local_a0 == pGVar4) goto LAB_004f9595; } uVar10 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar15 = (playerManager->_playerList)._end; if ((int)pvVar15 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar15 = (playerManager->_playerList)._end; } piVar14 = (playerManager->_playerList)._begin; if (uVar10 < (uint)((int)pvVar15 - (int)piVar14 >> 2)) { piVar14 = piVar14 + uVar10; } trigger_set_dispatch((void *)(*piVar14 + 0x1fc8),6,entity,&g_vectorZero,&g_vectorZero); uVar10 = uVar10 + 1; playerManager = &g_game->_playerManager; } while (uVar10 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_004f9595: timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar5 = (timeNs & 0xffffffff) * 0x431bde82; local_9c = (uint)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar10 * 0x431bde82; local_b8 = (EntityPtr *)lVar6; lVar7 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_b0.x = (float)(lVar7 + lVar5); lVar6 = lVar6 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar7 >> 0x20), local_9c + CARRY4((uint)lVar5,(uint)lVar7)), (int)((ulonglong)(lVar7 + lVar5) >> 0x20)); uVar12 = (uint)((ulonglong)lVar6 >> 0x20); piVar14 = (int *)((uint)lVar6 >> 0x12 | uVar12 * 0x4000); uVar10 = (int)piVar14 - (int)local_bc; bVar16 = CARRY4((uint)g_entitySpawnTimeMs,uVar10); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar10; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar12 >> 0x12) - (int)local_88) - (uint)(piVar14 < local_bc)) + (uint)bVar16; npc = savedNpc; } local_a4[1]._pendingDamage = (float)FUN_004f8cc0; *(undefined4 *)&local_a4[1]._pendingDamageFlags = 1; *(undefined4 *)((int)&local_a4[1]._pendingDamageFlags + 4) = 10; (local_a4->_pos).x = (npc->_pos).x; (local_a4->_pos).y = (npc->_pos).y; (**(code **)(*(int *)local_a4 + 0xc))(); Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); std::set::insert(&local_b0,&npc->_spawnGridIndex); LAB_004f9682: if (local_98 == (EntityPtr)0x0) { fVar1 = (npc->_targetPosition).y; fVar2 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar1 - fVar2; return; } return; } //@@ 004f9920 Entity_NPC::ThrowRockSpider /* ZHL [exact] static cleanup Entity_NPC* Entity_NPC::ThrowRockSpider(Vector* pos, Vector* targetPos, Entity* spanwer, int variant, float yPosOffset); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ Entity_NPC * __cdecl Entity_NPC::ThrowRockSpider (Vector *pos,Vector *targetPos,Entity *spanwer,int variant,float yPosOffset) { float *pfVar1; float fVar2; uint seed; Entity_NPC *this; uint type; uint uVar3; float fVar4; EntityRef local_30; if (variant == 1) { uVar3 = 1; } else if (variant == 2) { uVar3 = 2; } else { if (variant == 3) { type = 0x21; uVar3 = 0xb; goto LAB_004f996a; } uVar3 = 0; } type = 0x332; LAB_004f996a: seed = Random(); this = (Entity_NPC *)Game::SpawnEx(g_game,type,uVar3,pos,&g_vectorZero,spanwer,0,seed,0); *(uint *)&this->_flags = (uint)this->_flags & 0xfffffffb; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); if ((spanwer != (Entity *)0x0) && ((spanwer->_flags & 0x100) != 0)) { local_30._type = 0; local_30._variant = 0; local_30._spawnerType = 0; local_30._spawnerVariant = 0; local_30._position.x = g_vectorZero.x; local_30._position.y = g_vectorZero.y; local_30._velocity.x = g_vectorZero.x; local_30._velocity.y = g_vectorZero.y; local_30._flags = 0; local_30._entity = (void *)0x0; Entity::AddCharmed((Entity *)this,&local_30,-1,0,0); } (**(code **)(*(int *)this + 0xc))(); (this->_posOffset).x = 0.0; (this->_posOffset).y = yPosOffset; uVar3 = Random(); fVar4 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 - 0.5; (this->_v1).x = (fVar4 + fVar4) - 4.0; pfVar1 = &(this->_posOffset).y; fVar4 = *pfVar1; fVar2 = *pfVar1; (this->_velocity).x = targetPos->x; (this->_velocity).y = targetPos->y; this->_state = 0x10; if (fVar2 <= -50.0 && fVar4 != -50.0) { this->_entityGridCollisionClass = 3; this->_entityCollisionClass = 0; } return this; } //@@ 004f9ad0 NpcAI::ENTITY_ROCK_SPIDER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 818 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ROCK_SPIDER(Entity_NPC *npc) { Vector pos; byte bVar1; Entity_Player *burstingSackOwner; EntityRef *sourceRef; LayerState *layer; Vector *pVVar2; uint uVar3; int iVar4; Entity *spawned; ColorMod *other; char isChasing; int iVar5; Entity_NPC *this; float fVar6; float *damageEvent; float fVar7; float fVar8; float fVar9; Vector *velocity; undefined1 local_70 [8]; float fStack_68; float fStack_64; float local_60; float fStack_5c; float fStack_58; float fStack_54; float local_50; float local_4c; float local_48; Vector local_44; Vector local_3c; Vector local_34; Room *room; float local_28; char isBurstingSack; float local_20; float local_1c; char isRefreshHealthLook; undefined4 local_14; qword flags; undefined4 flagsHigh; uint *flagsHighPtr; Manager *manager; ColorMod *splatColor; local_14 = __security_cookie ^ (uint)(local_70 + 0x60); burstingSackOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x179,(RNG **)&g_game->_playerManager,1); isBurstingSack = burstingSackOwner != (Entity_Player *)0x0; isRefreshHealthLook = '\0'; fVar6 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); room = g_game->_room; local_1c = 1.0; local_20 = fVar6; switch(npc->_state) { case 0: if (npc->_subtype == 0) { npc->_subtype = (uint)npc->_initSeed % 3 + 1; (**(code **)(*(int *)npc + 100))(); } if ((*(char *)room == '\0') || (g_game->_frameCount - room->_enterFrame < 2)) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"IdleRock",0); isRefreshHealthLook = npc->_type == 0x21; if (((bool)isRefreshHealthLook) || (npc->_variant == 2)) { splatColor = (ColorMod *)&DAT_00c34d4c; } else { local_50 = 0.11764707; local_60 = 0.0; fStack_5c = 0.0; fStack_58 = 0.0; fStack_54 = 0.0; splatColor = (ColorMod *)local_70; local_70._0_4_ = 0.0; local_70._4_4_ = 0.0; fStack_68 = 0.0; fStack_64 = 1.0; if (npc->_variant == 1) { local_4c = 0.14901961; local_48 = 0.23529413; } else { local_4c = 0.08627451; local_48 = 0.07058824; } } Color::operator_assign((Color *)&npc->_splatColor,splatColor); flags = npc->_flags; (npc->_v1).x = 0.0; if ((flags & 4) != 0) { uVar3 = Random(); Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar3); flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } goto LAB_004fa057; case 3: npc->_friction = npc->_friction * 0.6; if (((npc->_controllerID != -1) && (pVVar2 = Entity_NPC::GetControllerInput(npc,&local_34,0.0), pVVar2->x == g_vectorZero.x)) && (pVVar2->y == g_vectorZero.y)) { npc->_stateFrame = 0; } if (0 < (int)fVar6) { do { iVar4 = npc->_stateFrame; iVar5 = iVar4 + 1; npc->_stateFrame = iVar5; if ((npc->_variant == 1) || (npc->_variant == 2)) { iVar5 = iVar4 + 2; npc->_stateFrame = iVar5; } if (((iVar5 == 0xc) || (iVar5 == 0x18)) || ((iVar5 == 0x24 || ((npc->_controllerID != -1 || (npc->_forcedTarget != (EntityPtr)0x0))) ))) { Entity_NPC::CalcTargetPosition(npc,&local_3c,60.0); if (isBurstingSack == '\0') { if ((npc->_variant == 1) || (npc->_variant == 2)) { uVar3 = Random(); uVar3 = uVar3 & 3; } else { uVar3 = Random(); uVar3 = uVar3 % 6; } if (uVar3 == 0) goto LAB_004fa229; isRefreshHealthLook = '\x01'; isChasing = '\x01'; } else { LAB_004fa229: isChasing = '\0'; } iVar4 = npc->_controllerID; if (iVar4 != -1) { isRefreshHealthLook = '\x01'; pVVar2 = Entity_NPC::GetControllerInput(npc,&local_34,0.0); iVar4 = npc->_controllerID; local_3c.x = pVVar2->x * 100.0 + (npc->_pos).x; local_3c.y = pVVar2->y * 100.0 + (npc->_pos).y; isChasing = isRefreshHealthLook; } if (((npc->_forcedTarget == (EntityPtr)0x0) && ((npc->_flags & 0x100) == 0)) && (iVar5 = 0, isChasing == '\0')) { do { uVar3 = Random(); local_1c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1c = local_1c + local_1c; local_28 = cos(local_1c); fVar6 = sin(local_1c); (npc->_targetPosition).x = local_28; (npc->_targetPosition).y = fVar6; local_44.x = local_28 * 20.0 + (npc->_pos).x; local_44.y = fVar6 * 20.0 + (npc->_pos).y; bVar1 = Room::CheckLine(room,&npc->_pos,&local_44,1,999,0,0,(Vector *)0x0); if (bVar1 != 0) break; iVar5 = iVar5 + 1; } while (iVar5 < 10); } else { if (((iVar4 == -1) && (npc->_forcedTarget == (EntityPtr)0x0)) && (bVar1 = Room::CheckLine(room,&npc->_pos,&local_3c,1,999,0,0,(Vector *)0x0), bVar1 == 0)) { PathFinder::Reset((PathFinder *)&npc->_pathfinder); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_3c,1.0,0,1); local_1c = (npc->_velocity).x; local_28 = (npc->_velocity).y; } else { local_1c = local_3c.x - (npc->_pos).x; local_28 = local_3c.y - (npc->_pos).y; } fVar6 = sqrtf(local_1c * local_1c + local_28 * local_28); if (fVar6 <= 0.0) { fVar7 = local_1c; fVar6 = local_28; } else { fVar7 = local_1c * (1.0 / fVar6); fVar6 = local_28 * (1.0 / fVar6); } (npc->_targetPosition).x = fVar7; (npc->_targetPosition).y = fVar6; uVar3 = Random(); local_1c = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 * 0.017453292; local_28 = cos(local_1c); fVar8 = sin(local_1c); fVar6 = (npc->_targetPosition).x; fVar7 = (npc->_targetPosition).y; (npc->_targetPosition).x = fVar6 * local_28 - fVar7 * fVar8; (npc->_targetPosition).y = fVar7 * local_28 + fVar6 * fVar8; } fVar6 = local_20; } uVar3 = Random(); if (((uVar3 & 1) == 0) && ((npc->_stateFrame & 1U) != 0)) { npc->_stateFrame = npc->_stateFrame + 1; } fVar6 = (float)((int)fVar6 + -1); local_20 = fVar6; } while (fVar6 != 0.0); } if ((npc->_controllerID != -1) && (0x28 < npc->_stateFrame)) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) { ANM2::Play(&npc->_sprite,s_Idle,0); } else { ANM2::Play(&npc->_sprite,s_Walk,0); fVar6 = 3.0; if (isBurstingSack == '\0') { if (npc->_variant == 1) { fVar6 = 5.1000004; } else if (npc->_variant == 2) { if (npc->_spawnerType == 0x38b) { fVar6 = 1.6; } else { fVar6 = 1.8; } fVar6 = fVar6 * 3.0; } } fVar7 = npc->_speedMultiplier; fVar8 = (npc->_targetPosition).y; fVar9 = fVar6 * (npc->_targetPosition).x * fVar7 + (npc->_velocity).x; (npc->_velocity).x = fVar9; (npc->_velocity).y = fVar8 * fVar6 * fVar7 + (npc->_velocity).y; (npc->_sprite)._flipX = fVar9 <= 0.0; } if (0x2f < npc->_stateFrame) { npc->_stateFrame = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } break; case 7: ANM2::Play(&npc->_sprite,(byte *)"Appear",0); npc->_friction = npc->_friction * 0.6; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } break; case 0x10: ANM2::Play(&npc->_sprite,(byte *)"IdleRock",0); fVar6 = (npc->_v1).x; npc->_mass = 100.0; fVar7 = fVar6 * npc->_speedMultiplier + (npc->_posOffset).y; (npc->_posOffset).y = fVar7; if (0.0 < fVar7) { pos = npc->_pos; (npc->_posOffset).y = 0.0; iVar4 = Room::GetGridCollisionAtPos(room,pos); if (iVar4 != 0) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_70 + 4)); (**(code **)(*(int *)npc + 0x24))(sourceRef); break; } (npc->_velocity).x = (npc->_velocity).x * 0.8; (npc->_velocity).y = (npc->_velocity).y * 0.8; fVar6 = (npc->_v1).x; if (ABS(fVar6) <= local_1c) { fVar6 = 0.0; } else { fVar6 = fVar6 * -0.3; } } fVar7 = (npc->_posOffset).y; if (-50.0 <= fVar7) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = (uint)(-4.0 <= fVar7) * 2 + 3; } else { npc->_entityGridCollisionClass = 3; npc->_entityCollisionClass = 0; } iVar4 = npc->_type; (npc->_v1).x = npc->_speedMultiplier * 0.5 + fVar6; if (iVar4 == 0x21) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHighPtr = (uint *)((int)&npc->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x10; npc->_isInvicible = 1; bVar1 = Entity::IsFrame((Entity *)npc,0x1e,0); if ((bVar1 != 0) && (uVar3 = Random(), uVar3 % 3 != 0)) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_70 + 4)); (**(code **)(*(int *)npc + 0x20))(0x3f800000,0,0,sourceRef,0x1e); } if (0.0 < npc->_pendingDamage) { if ((npc->_pendingDamageFlags & 0x1000004) == 0) { damageEvent = (npc->_damageEvents)._begin; if (damageEvent == (npc->_damageEvents)._end) { fVar6 = npc->_health; } else { do { if (10.0 < *damageEvent) { uVar3 = Random(); if (uVar3 % 3 == 0) { fVar6 = 3.0; } else { LAB_004f9ecb: fVar6 = 2.0; } LAB_004f9edd: fVar6 = npc->_health - fVar6; npc->_health = fVar6; } else { if (0.0 < *damageEvent) { uVar3 = Random(); if (uVar3 % 3 == 0) goto LAB_004f9ecb; fVar6 = local_1c; goto LAB_004f9edd; } fVar6 = npc->_health; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } if (fVar6 < local_1c) { npc->_health = 1.0; fVar6 = local_1c; } isRefreshHealthLook = '\x01'; if (fVar6 < 1.5) goto LAB_004f9f2e; } else { npc->_health = 1.0; LAB_004f9f2e: manager = g_manager; local_20 = 3.65739e-43; seed_fart_sound_override((int *)&local_20); SoundEffects::Play(&manager->_sfxManager,(int)local_20,0.85,2,0,1.0,0.0); sourceRef = EntityRef::EntityRef((EntityRef *)(local_70 + 4)); (**(code **)(*(int *)npc + 0x24))(sourceRef); } isRefreshHealthLook = '\x01'; } iVar4 = Entity_NPC::GetAliveEnemyCount(npc); if ((iVar4 < 1) && (*(int *)((int)g_game->_room + 0x11ec) < 3)) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_70 + 4)); (**(code **)(*(int *)npc + 0x24))(sourceRef); } } if ((npc->_entityGridCollisionClass == 5) && (ABS((npc->_v1).x) < 0.6)) { if (npc->_type == 0x21) { fVar6 = *(float *)((int)npc->_config + 0x44); npc->_friction = npc->_friction * 0.9; } else { fVar6 = (npc->_velocity).y; fVar7 = (npc->_velocity).x; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); if ((2.0 <= fVar6) || (uVar3 = Random(), (uVar3 & 3) != 0)) goto LAB_004fa057; npc->_state = 7; fVar6 = *(float *)((int)npc->_config + 0x44); } npc->_mass = fVar6; } LAB_004fa057: if (isRefreshHealthLook != '\0') { local_20 = npc->_health / npc->_maxHitPoints; if (local_20 <= 0.0) { local_20 = 0.0; } if (local_1c <= local_20) { local_20 = local_1c; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_size).x = local_20; (layer->_size).y = local_20; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = 1.0; fVar6 = local_20 * 0.8 + 0.2; (layer->_color)._tint[0] = local_20 * 0.5 + 0.5; (layer->_color)._tint[1] = fVar6; (layer->_color)._tint[2] = fVar6; } } if (((npc->_variant == 2) || (npc->_type == 0x21)) && (uVar3 = Random(), uVar3 % 5 == 0)) { uVar3 = Random(); local_3c.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * -1.2800001; uVar3 = Random(); local_28 = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 0.4; uVar3 = Random(); local_20 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20 = local_20 + local_20; uVar3 = Random(); local_1c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; fVar6 = cos(local_20); local_34.x = fVar6 * local_1c * 4.0 + (npc->_pos).x; fVar6 = sin(local_20); local_34.y = fVar6 * local_1c * 4.0 + (npc->_pos).y; uVar3 = Random(); local_44.x = (npc->_velocity).x * 0.2 + local_28; local_44.y = (npc->_velocity).y * 0.2 + local_3c.y; Game::Spawn(g_game,1000,0x42,&local_34,&local_44,(Entity *)0x0,0,uVar3); } if ((npc->_dead != 0) && (npc->_type != 0x21)) { iVar5 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar4 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar5 < 0) || ((room->_gridWidth <= iVar5 || (iVar4 < 0)))) || (room->_gridHeight <= iVar4)) { iVar5 = -1; } else { iVar5 = iVar4 * room->_gridWidth + iVar5; } pVVar2 = &npc->_pos; uVar3 = Room::GetGridCollision(room,iVar5); if (uVar3 == 0) { if (npc->_variant != 1) { if (npc->_variant == 2) { local_34.x = (npc->_velocity).x * 0.5; local_34.y = (npc->_velocity).y * 0.5; spawned = Game::Spawn(g_game,0x21,0xb,pVVar2,&local_34,(Entity *)npc,npc->_subtype, npc->_initSeed); flagsHigh = *(undefined4 *)((int)&spawned->_flags + 4); iVar4 = *(int *)spawned; *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; *(undefined4 *)((int)&spawned->_flags + 4) = flagsHigh; (**(code **)(iVar4 + 0xc))(); (spawned->_posOffset).y = (float)&DAT_bf800000; uVar3 = Random(); spawned[2]._prevVelocity.y = -1.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; } else { Entity_NPC::PlayDeathEffects(); Entity_NPC::Morph(npc,0x55,0,0,-1); npc->_state = 0; npc->_health = npc->_maxHitPoints; npc->_dead = 0; Color::Color((Color *)local_70); Color::operator_assign((Color *)&npc->_splatColor,other); iVar4 = *(int *)npc; (npc->_posOffset).x = g_vectorZero.x; (npc->_posOffset).y = g_vectorZero.y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; (**(code **)(iVar4 + 0xc))(); } goto LAB_004faa25; } uVar3 = npc->_initSeed; velocity = &npc->_velocity; } else { if (npc->_variant != 1) goto LAB_004faa25; Room::FindFreePickupSpawnPosition(room,&local_34,pVVar2,0.0,0,0,0); uVar3 = npc->_initSeed; pVVar2 = &local_34; velocity = &g_vectorZero; } Game::Spawn(g_game,5,10,pVVar2,velocity,(Entity *)0x0,3,uVar3); } LAB_004faa25: damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { if (((uint)damageEvent[2] & 2) != 0) { npc->_pendingDamage = npc->_pendingDamage - *damageEvent; *damageEvent = 0.0; bVar1 = Entity::IsType((Entity *)npc,0x332,0,-1); if (bVar1 != 0) { Entity_NPC::Morph(this,0x332,2,npc->_subtype,-1); } } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } return; } //@@ 004faad0 NpcAI::ENTITY_FACELESS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 827 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FACELESS(Entity_NPC *npc) { float fVar1; char *pcVar2; byte bVar3; Entity *pEVar4; Vector *pVVar5; ColorMod *other; LayerState *layer; uint uVar6; void *pvVar7; Vector *nearEntity; Room *room; int iVar8; ANM2 *sprite; float fVar9; float fVar10; RNG rng; Vector local_138; Vector local_130; Room *local_128; Vector local_124; Vector local_11c; float local_114; ProjectileParams projParams; undefined1 local_68 [24]; float local_50; undefined1 local_4c; float local_44; float local_40; void *local_3c; char local_38 [12]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; float friction; Entity_Player *nearEntity; int spawnFrame; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af4015; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; rng._shift1 = 5; rng._shift2 = 9; room = g_game->_room; rng._seed = npc->_initSeed + npc->_index; rng._shift3 = 7; local_128 = room; pcVar2 = local_38 + 0x34; switch(npc->_state) { case 0: npc->_state = 3; npc->_i1 = 0; (npc->_v1).x = 0.0; npc->_stateFrame = 0; puStack_20 = local_38 + 0x34; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); pcVar2 = puStack_20; if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); pcVar2 = puStack_20; } break; case 3: case 8: local_40 = 2.10195e-44; local_44 = 1.12104e-44; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; local_50 = (float)0x74726556; local_4c = 0; local_28 = 0xf; local_2c = 8; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; puStack_20 = local_38 + 0x34; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_68 + 0x14),0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_28) { uVar6 = local_28 + 1; pvVar7 = local_3c; if (0xfff < uVar6) { pvVar7 = *(void **)((int)local_3c + -4); uVar6 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar7))) goto LAB_004facd8; } operator_delete(pvVar7,uVar6); } local_14 = 0xffffffff; local_2c = 0; local_28 = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < (uint)local_40) { uVar6 = (int)local_40 + 1; pvVar7 = (void *)local_68._20_4_; if (0xfff < uVar6) { pvVar7 = *(void **)(local_68._20_4_ + -4); uVar6 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)pvVar7))) { LAB_004facd8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar6); } if (npc->_state == 8) { Entity_NPC::UpdateControllerMovement(npc,0); bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar3 != 0) { if (npc->_type == 0x340) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_130.x = (pEVar4->_pos).x - (npc->_pos).x; local_130.y = (pEVar4->_pos).y - (npc->_pos).y; Vector::Normalized(&local_130,&local_124); bVar3 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero); if (bVar3 == 0) { local_114 = local_124.y; local_124.y = local_124.x; } else { pVVar5 = Vector::Normalized(nearEntity,&local_138); local_124.y = pVVar5->x; local_114 = pVVar5->y; } ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x2800; Color::Color((Color *)local_68); Color::operator_assign((Color *)&projParams.Color,other); projParams.TargetPosition.x = (npc->_pos).x; pVVar5 = &npc->_pos; projParams.TargetPosition.y = (npc->_pos).y; local_11c.x = local_124.y * 7.0; projParams.GridCollision = 0; local_11c.y = local_114 * 7.0; Entity_NPC::FireProjectiles(npc,pVVar5,&local_11c,0,&projParams); local_130.x = -local_11c.x; local_130.y = -local_11c.y; Entity_NPC::FireProjectiles(npc,pVVar5,&local_130,0,&projParams); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,0xb,pVVar5,&g_vectorZero,(Entity *)0x0,0,uVar6); iVar8 = *(int *)pEVar4; (pEVar4->_sprite)._offset.x = 0.0; (pEVar4->_sprite)._offset.y = -14.0; pEVar4->_renderDepthOffset = 4.0; (**(code **)(iVar8 + 0x3c))(&DAT_00c34dfc,0xffffffff,0xff,0,1); room = local_128; } else { if (npc->_variant == 1) { ProjectileParams::ProjectileParams(&projParams); projParams.CircleAngle = 0.0; projParams.Scale = 1.3; projParams.FallingAccelModifier = -0.06; local_11c.x = 8.0; local_11c.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_11c,9,&projParams); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,0xb,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6); (pEVar4->_sprite)._offset.y = -16.0; } else { ProjectileParams::ProjectileParams(&projParams); projParams.CircleAngle = 0.0; local_11c.x = 7.0; local_11c.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_11c,9,&projParams); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,0xb,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6); (pEVar4->_sprite)._offset.y = -14.0; } pEVar4->_renderDepthOffset = 4.0; (pEVar4->_sprite)._offset.x = 0.0; } Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); fVar9 = (npc->_v1).x - 7.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } (npc->_v1).x = fVar9; } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } npc->_state = 3; } } else if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { iVar8 = ANM2::GetFrame(&npc->_sprite); AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar8); } if (npc->_stateFrame == 0) { if ((npc->_controllerID != -1) || (npc->_health <= npc->_maxHitPoints && npc->_maxHitPoints != npc->_health)) { LAB_004fb22f: npc->_stateFrame = 1; } else { local_124.y = 0.0; if ((room->_entityList)._updateEL._size != 0) { do { nearEntity = *(Entity_Player **) ((int)(room->_entityList)._updateEL._data + (int)local_124.y * 4); if ((npc->_flags & 0x100) == 0) { if ((nearEntity->_type == 1) && (bVar3 = Entity_Player::IsInvisible(nearEntity), bVar3 == 0)) goto LAB_004fb17a; } else { bVar3 = Entity::IsVulnerableEnemy((Entity *)nearEntity,(Entity *)0x0); if ((bVar3 != 0) && ((nearEntity->_flags & 0x20000000) == 0)) { LAB_004fb17a: fVar9 = (npc->_pos).y - (nearEntity->_pos).y; fVar10 = (npc->_pos).x - (nearEntity->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); if (fVar9 < 80.0) goto LAB_004fb22f; } } if (((nearEntity->_type == 0x33b) && (*(int *)&nearEntity->_isControlsEnabled != 0)) && (fVar9 = (npc->_pos).y - (nearEntity->_pos).y, fVar10 = (npc->_pos).x - (nearEntity->_pos).x, fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10), fVar9 < 80.0)) goto LAB_004fb22f; local_124.y = (float)((int)local_124.y + 1); room = local_128; } while ((uint)local_124.y < (uint)(local_128->_entityList)._updateEL._size); } } } uVar6 = Random(); if (uVar6 % 6 == 0) { uVar6 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { if (npc->_stateFrame == 0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); goto LAB_004fb2f1; } if ((npc->_type == 0x340) && (npc->_controllerID == -1)) { Entity_NPC::CalcTargetPosition(npc,&local_11c,0.0); pEVar4 = Entity_NPC::GetPlayerTarget(npc); bVar3 = Entity::IsFrame((Entity *)npc,0x1e,npc->_index); if (bVar3 != 0) { fVar9 = (pEVar4->_velocity).y; (npc->_v2).x = (pEVar4->_velocity).x; (npc->_v2).y = fVar9; } bVar3 = Room::CheckLine(local_128,&npc->_pos,&local_11c,0,0,0,0,(Vector *)0x0); if (bVar3 == 0) { bVar3 = 1; iVar8 = 900; fVar9 = 0.6; pVVar5 = &local_11c; goto LAB_004fb5ae; } local_130.y = (npc->_pos).x - local_11c.x; local_124.y = (npc->_pos).y - local_11c.y; iVar8 = g_game->_frameCount; spawnFrame = npc->_spawnFrame; fVar9 = RNG::RandomFloat(&rng); local_114 = (float)(iVar8 - spawnFrame); local_128 = (Room *)(fVar9 * local_114); fVar9 = RNG::RandomFloat(&rng); local_114 = (fVar9 * 360.0 + (float)local_128 + (float)local_128) * 0.017453292; local_128 = (Room *)cos(local_114); local_114 = sin(local_114); fVar9 = sqrtf(local_124.y * local_124.y + local_130.y * local_130.y); fVar9 = fVar9 * 0.5; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (64.0 <= fVar9) { fVar9 = 64.0; } local_11c.x = ((float)local_128 * fVar9 - local_114 * 0.0) + local_11c.x; npc->_friction = npc->_friction * 0.8; local_11c.y = local_114 * fVar9 + (float)local_128 * 0.0 + local_11c.y; local_130.x = local_11c.x - (npc->_pos).x; local_130.y = local_11c.y - (npc->_pos).y; pVVar5 = Vector::Normalized(&local_130,&local_138); local_130.x = pVVar5->x * 0.8; local_130.y = pVVar5->y * 0.8; Entity::AddVelocity_divided((Entity *)npc,&local_130,0); } else { bVar3 = 1; iVar8 = 900; fVar9 = 0.6; pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_138,0.0); LAB_004fb5ae: PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar5,fVar9,iVar8,bVar3); } } else { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_11c.x = (pEVar4->_pos).x; local_11c.y = (pEVar4->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_11c,0); LAB_004fb2f1: npc->_friction = npc->_friction * 0.8; } if (npc->_state != 8) { if (npc->_controllerID == -1) { if (npc->_spawnerType != 0x38a) { fVar9 = sqrtf((npc->_v1).x); local_124.y = fVar9 * 0.08 + 0.008; if (npc->_type == 0x340) { local_124.y = local_124.y * 0.33; } if (npc->_minecart != (EntityPtr)0x0) { local_124.y = local_124.y * 0.65; } if (((npc->_type == 0x33b) && (npc->_variant == 1)) && (0 < npc->_stateFrame)) { local_124.y = 1.0; } uVar6 = Random(); if ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 <= local_124.y) goto LAB_004fb6b6; } } else { bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar3 != 0) { Entity_NPC::UpdateControllerMovement(npc,1); LAB_004fb6b6: ANM2::PlayOverlay(&npc->_sprite,(byte *)"Attack",0); npc->_state = 8; } } } pcVar2 = puStack_20; if ((npc->_type == 0x33b) && (npc->_variant == 1)) { iVar8 = Entity::GetIntervalTicks((Entity *)npc,50.0,(float)((uint)npc->_index % 0x32) + 0.0); pcVar2 = puStack_20; if (iVar8 != 0) { uVar6 = Random(); pcVar2 = puStack_20; if ((uVar6 & 1) == 0) { Entity_NPC::PlaySound(npc,3,0.7,2,0,1.0); pcVar2 = puStack_20; } } } break; case 5: puStack_20 = local_38 + 0x34; ANM2::PlayOverlay(&npc->_sprite,(byte *)"Transition",0); bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar3 != 0) { SoundEffects::PlayWithFartOverride(0x1e,1.0,2,0,1.0); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,0x93,&npc->_pos,&g_vectorZero,(Entity *)0x0,1,uVar6); (**(code **)(*(int *)pEVar4 + 0xc))(); (pEVar4->_sprite)._offset.x = 0.0; (pEVar4->_sprite)._offset.y = -20.0; (**(code **)(*(int *)pEVar4 + 0x40))(0); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,3,uVar6); (**(code **)(*(int *)pEVar4 + 0x3c))(&DAT_00c34da4,0xffffffff,0xff,0,1); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,7,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6); (**(code **)(*(int *)pEVar4 + 0x3c))(&DAT_00c34da4,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar4 + 0xc))(); uVar6 = Random(); for (local_124.y = (float)(uVar6 % 5 + 3); local_124.y != 0.0; local_124.y = (float)((int)local_124.y + -1)) { uVar6 = Random(); local_130.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_130.y = local_130.y + local_130.y; fVar9 = cos(local_130.y); local_138.x = fVar9 * npc->_size * 0.5 + (npc->_pos).x; fVar9 = sin(local_130.y); local_138.y = fVar9 * npc->_size * 0.5 + (npc->_pos).y; uVar6 = Random(); local_114 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_114 = local_114 + local_114; uVar6 = Random(); local_128 = (Room *)((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0); local_11c.x = cos(local_114); local_11c.x = local_11c.x * (float)local_128; local_11c.y = sin(local_114); local_11c.y = local_11c.y * (float)local_128; uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,5,&local_138,&local_11c,(Entity *)0x0,0,uVar6); (**(code **)(*(int *)pEVar4 + 0x3c))(&DAT_00c34dfc,0xffffffff,0xff,0,1); fVar1 = fRam00c34e08; fVar10 = fRam00c34e04; fVar9 = fRam00c34e00; if (&pEVar4->_splatColor != (ColorMod *)&DAT_00c34dfc) { (pEVar4->_splatColor)._tint[0] = _DAT_00c34dfc; (pEVar4->_splatColor)._tint[1] = fVar9; (pEVar4->_splatColor)._tint[2] = fVar10; (pEVar4->_splatColor)._tint[3] = fVar1; fVar1 = fRam00c34e18; fVar10 = fRam00c34e14; fVar9 = fRam00c34e10; (pEVar4->_splatColor)._colorize[0] = _DAT_00c34e0c; (pEVar4->_splatColor)._colorize[1] = fVar9; (pEVar4->_splatColor)._colorize[2] = fVar10; (pEVar4->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(pEVar4->_splatColor)._offset = DAT_00c34e1c; (pEVar4->_splatColor)._offset[2] = DAT_00c34e24; } (**(code **)(*(int *)pEVar4 + 0xc))(); } } sprite = &npc->_sprite; if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || (pcVar2 = puStack_20, (npc->_sprite)._overlayAnimState._isPlaying == 0)) { layer = ANM2::GetLayer(sprite,(byte *)0x0); layer->_visible = 1; npc->_state = 3; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; ANM2::SetFrame(sprite,(std_string *)"WalkVert",0); bVar3 = ANM2::SetOverlayAnimation(sprite,s_Head,1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_stateFrame = 1; pcVar2 = puStack_20; } break; case 0x10: pcVar2 = local_38 + 0x34; if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { LAB_004fb768: puStack_20 = pcVar2; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_visible = 0; if (npc->_subtype - 1U < 5) { iVar8 = npc->_subtype + -1; } else { iVar8 = 1; } ANM2::PlayOverlay(&npc->_sprite,(&PTR_s_Summon1_00b60b77_1_00b60b40)[iVar8],0); if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { ANM2::PlayOverlay(&npc->_sprite,(&PTR_s_SummonLoop1_00b60b54)[iVar8],0); } } else { bVar3 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._overlayAnimState); pcVar2 = puStack_20; if (bVar3 == 0) goto LAB_004fb768; } pcVar2 = puStack_20; if ((0 < npc->_stateFrame) && (iVar8 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame, npc->_stateFrame = iVar8, iVar8 < 1)) { npc->_state = 5; } } puStack_20 = pcVar2; if ((((npc->_dead != 0) && (-25.0 < npc->_health)) && (uVar6 = Random(), (uVar6 & 1) == 0)) && ((npc->_type != 0x33b || (npc->_variant != 1)))) { uVar6 = Random(); Entity_NPC::Morph(npc,0xb,(uint)(uVar6 % 3 == 0),0,-1); npc->_health = npc->_maxHitPoints; npc->_dead = 0; } fVar9 = (npc->_v1).x; if (0.0 < npc->_pendingDamage) { fVar9 = fVar9 + npc->_pendingDamage; (npc->_v1).x = fVar9; } if (0.0 < fVar9) { fVar10 = fVar9 - 0.11; if (fVar9 - 0.11 <= 0.0) { fVar10 = 0.0; } (npc->_v1).x = fVar10; } fVar9 = (npc->_targetPosition).x; if ((fVar9 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { fVar10 = (npc->_targetPosition).y; fVar1 = (npc->_pos).y; friction = npc->_friction; (npc->_velocity).x = (fVar9 - (npc->_pos).x) / friction; (npc->_velocity).y = (fVar10 - fVar1) / friction; } ExceptionList = local_1c; return; } //@@ 004fbd10 NpcAI::ENTITY_DANNY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 820 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DANNY(Entity_NPC *npc) { float fVar1; byte bVar2; Entity *pEVar3; EntityList *groupQuery; Entity_NPC *rockSpider; uint rngValue; Vector *targetPos; byte *animName; uint uVar4; void *stringBuf; int iVar5; char *pcVar6; int *roomEntityIt; int iVar7; bool bVar8; float fVar9; float fVar10; undefined4 local_168 [8]; undefined4 local_148; undefined4 uStack_144; undefined4 local_140; Vector local_13c; Vector aimDir; float local_12c; Vector local_128; Vector local_120; float local_118; float local_114; ProjectileParams projParams; undefined4 creepColor; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 local_58; std_string sStack_54; void *horiAnimName; char local_38 [12]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; void *room; int roomEntity; ColorMod *splatColor; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af4055; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; room = g_game->_room; iVar7 = npc->_state; if (iVar7 != 0) { if (iVar7 != 4) { if (iVar7 == 8) { npc->_friction = npc->_friction * 0.7; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = local_38 + 0x34; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { local_58 = 0; sStack_54._buf[0] = '\0'; sStack_54._buf[1] = '\0'; sStack_54._buf[2] = '\0'; sStack_54._buf[3] = '\0'; sStack_54._buf[4] = '\0'; sStack_54._buf[5] = '\0'; sStack_54._buf[6] = '\0'; sStack_54._buf[7] = '\0'; sStack_54._buf[8] = '\0'; sStack_54._buf[9] = '\0'; sStack_54._buf[10] = '\0'; sStack_54._buf[0xb] = '\0'; sStack_54._buf[0xc] = '\0'; sStack_54._buf[0xd] = '\0'; sStack_54._buf[0xe] = '\0'; sStack_54._buf[0xf] = '\0'; sStack_54._size = 0; sStack_54._capacity = 0; creepColor = 0x3f0c8c8d; uStack_64 = 0x3ef6f6f7; uStack_60 = 0x3ef6f6f7; uStack_5c = 0x3f800000; Entity_NPC::PlaySound(npc,0x6c,1.0,10,0,1.1); pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_120.x = (pEVar3->_pos).x; local_120.y = (pEVar3->_pos).y; local_118 = local_120.y; local_114 = local_120.x; Entity_NPC::UpdateControllerMovement(npc,0); if (npc->_controllerID == -1) { local_128.x = local_114; local_128.y = local_118; } else { local_120.x = (npc->_controllerMovement).x * 100.0 + (npc->_pos).x; local_120.y = (npc->_controllerMovement).y * 100.0 + (npc->_pos).y; local_128.x = local_120.x; local_128.y = local_120.y; } local_128.x = local_128.x - (npc->_pos).x; local_128.y = local_128.y - (npc->_pos).y; Vector::Normalized(&local_128,&aimDir); if (npc->_variant == 1) { groupQuery = Entity_NPC::QueryNPCsGroup((EntityList *)(local_38 + 4),npc->_index); uVar4 = 1 - *(int *)&groupQuery->field_0xc; local_12c = (float)(-(uint)(uVar4 != 0) & uVar4); EntityList_Query::~EntityList_Query(local_38 + 4); iVar7 = 0; do { uVar4 = Random(); local_114 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 * 0.017453292; local_118 = cos(local_114); fVar9 = sin(local_114); local_114 = local_118 * aimDir.x - fVar9 * aimDir.y; local_118 = fVar9 * aimDir.x + local_118 * aimDir.y; local_128.x = local_114 * 4.0 + (npc->_pos).x; local_128.y = local_118 * 4.0 + (npc->_pos).y; uVar4 = Random(); local_120.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 9.0 + 1.0; local_120.y = local_120.x * local_118; local_120.x = local_120.x * local_114; if (iVar7 < (int)local_12c) { rockSpider = Entity_NPC::ThrowRockSpider (&local_128,&local_120,(Entity *)npc,2,-15.0); rockSpider->_groupIdx = npc->_index; } else { Entity_NPC::ThrowRockSpider(&local_128,&local_120,(Entity *)npc,3,-15.0); } iVar7 = iVar7 + 1; } while (iVar7 < 4); iVar7 = 6; do { uVar4 = Random(); local_114 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 * 0.017453292; local_118 = cos(local_114); fVar9 = sin(local_114); local_12c = local_118 * aimDir.x - fVar9 * aimDir.y; local_118 = fVar9 * aimDir.x + local_118 * aimDir.y; uVar4 = Random(); local_128.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; local_114 = npc->_size; uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_13c.y = local_114 * local_118 * fVar9 + (npc->_pos).y; local_13c.x = local_114 * local_12c * fVar9 + (npc->_pos).x; uVar4 = Random(); local_120.x = local_128.y * local_12c; local_120.y = local_128.y * local_118; pEVar3 = Game::Spawn(g_game,1000,0x42,&local_13c,&local_120,(Entity *)0x0,0,uVar4); (pEVar3->_posOffset).x = (pEVar3->_posOffset).x + 0.0; iVar5 = *(int *)pEVar3; (pEVar3->_posOffset).y = (pEVar3->_posOffset).y - 14.0; (**(code **)(iVar5 + 0xc))(); iVar7 = iVar7 + -1; } while (iVar7 != 0); } else { ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 9; groupQuery = Entity_NPC::QueryNPCsGroup((EntityList *)(local_38 + 4),npc->_index); uVar4 = 2 - *(int *)&groupQuery->field_0xc; uVar4 = -(uint)(uVar4 != 0) & uVar4; EntityList_Query::~EntityList_Query(local_38 + 4); Entity_NPC::FireBossProjectiles(npc,6 - uVar4,&local_120,1.0,&projParams); if (0 < (int)uVar4) { do { rngValue = Random(); local_128.y = ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 * 0.017453292; local_114 = cos(local_128.y); fVar9 = sin(local_128.y); local_128.y = local_114 * aimDir.x - fVar9 * aimDir.y; local_114 = fVar9 * aimDir.x + local_114 * aimDir.y; local_120.x = local_128.y * 4.0 + (npc->_pos).x; local_120.y = local_114 * 4.0 + (npc->_pos).y; rngValue = Random(); local_13c.x = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0; local_13c.y = local_13c.x * local_114; local_13c.x = local_13c.x * local_128.y; rockSpider = Entity_NPC::ThrowRockSpider (&local_120,&local_13c,(Entity *)npc,0,-15.0); rockSpider->_groupIdx = npc->_index; uVar4 = uVar4 - 1; } while (uVar4 != 0); } local_114 = 7.00649e-45; do { uVar4 = Random(); local_128.y = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 * 0.017453292; local_118 = cos(local_128.y); fVar9 = sin(local_128.y); local_12c = local_118 * aimDir.y; local_118 = local_118 * aimDir.x - fVar9 * aimDir.y; local_12c = fVar9 * aimDir.x + local_12c; uVar4 = Random(); local_120.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; local_128.y = npc->_size; uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_2c.y = local_128.y * local_12c * fVar9 + (npc->_pos).y; local_2c.x = local_128.y * local_118 * fVar9 + (npc->_pos).x; uVar4 = Random(); local_13c.x = local_120.y * local_118; local_13c.y = local_120.y * local_12c; pEVar3 = Game::Spawn(g_game,1000,0x23,&local_2c,&local_13c,(Entity *)0x0,99,uVar4); (pEVar3->_posOffset).x = (pEVar3->_posOffset).x + 0.0; iVar7 = *(int *)pEVar3; (pEVar3->_posOffset).y = (pEVar3->_posOffset).y - 14.0; (**(code **)(iVar7 + 0x3c))(&creepColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar3 + 0xc))(); local_114 = (float)((int)local_114 + -1); } while (local_114 != 0.0); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_004fcbaa; } npc->_state = 4; } goto LAB_004fcbaa; } sStack_54._capacity = 0xf; sStack_54._size = 8; builtin_strncpy(sStack_54._buf,"WalkVert",8); sStack_54._buf._8_4_ = sStack_54._buf._8_4_ & 0xffffff00; local_2c.y = 2.10195e-44; local_2c.x = 1.12104e-44; horiAnimName = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; puStack_20 = local_38 + 0x34; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimName,&sStack_54,0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_2c.y) { uVar4 = (int)local_2c.y + 1; stringBuf = horiAnimName; if (0xfff < uVar4) { stringBuf = *(void **)((int)horiAnimName + -4); uVar4 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)horiAnimName + (-4 - (int)stringBuf))) goto LAB_004fc752; } operator_delete(stringBuf,uVar4); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; horiAnimName = (void *)((uint)horiAnimName & 0xffffff00); if (0xf < sStack_54._capacity) { uVar4 = sStack_54._capacity + 1; stringBuf = (void *)sStack_54._buf._0_4_; if (0xfff < uVar4) { stringBuf = *(void **)(sStack_54._buf._0_4_ + -4); uVar4 = sStack_54._capacity + 0x24; if (0x1f < (uint)(sStack_54._buf._0_4_ + (-4 - (int)stringBuf))) { LAB_004fc752: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(stringBuf,uVar4); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID == -1)) { bVar2 = 1; iVar7 = 0; fVar9 = 0.6; targetPos = Entity_NPC::CalcTargetPosition(npc,&local_2c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,fVar9,iVar7,bVar2); } else { pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_2c.x = (pEVar3->_pos).x; local_2c.y = (pEVar3->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_2c,0); npc->_friction = npc->_friction * 0.8; } if (((npc->_pathfinder)._hasDirectPath != 0) && (uVar4 = Random(), uVar4 % 3 == 0)) { Entity_NPC::PlaySound(npc,0xa7,0.8,0x78,0,1.0); } Entity_NPC::UpdateChargeBar(npc,150.0,0.0,(float)npc->_stateFrame,1); iVar7 = npc->_stateFrame; if (0 < iVar7) { iVar7 = iVar7 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_stateFrame = iVar7; } if ((npc->_v1).x <= 6.0) { LAB_004fc898: if (0 < iVar7) goto LAB_004fcbaa; } else if (0 < iVar7) { iVar7 = iVar7 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_stateFrame = iVar7; goto LAB_004fc898; } if (npc->_controllerID == -1) { uVar4 = Random(); if ((uVar4 % 0x3c != 0) && (((npc->_v1).x <= 6.0 || (uVar4 = Random(), uVar4 % 0x14 != 0)))) goto LAB_004fcbaa; } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar2 == 0) goto LAB_004fcbaa; } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if ((bVar2 != 0) || (npc->_spawnerType == 0x38a)) goto LAB_004fcbaa; pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_120.y = (pEVar3->_pos).x; fVar10 = (npc->_pos).x - local_120.y; fVar9 = (npc->_pos).y - (pEVar3->_pos).y; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); if ((200.0 <= fVar9) && (((400.0 <= fVar9 || (uVar4 = Random(), uVar4 % 10 != 0)) && (npc->_controllerID == -1)))) goto LAB_004fcbaa; iVar7 = *(int *)((int)room + 0x1264); iVar5 = 0; if (npc->_variant == 1) { if (iVar7 != 0) { roomEntityIt = *(int **)((int)room + 0x125c); do { if ((*(int *)(*roomEntityIt + 0x28) == 0x21) && (*(int *)(*roomEntityIt + 0x2c) == 2)) { iVar5 = iVar5 + 1; } roomEntityIt = roomEntityIt + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); goto LAB_004fca03; } } else if (iVar7 != 0) { roomEntityIt = *(int **)((int)room + 0x125c); do { roomEntity = *roomEntityIt; if (*(int *)(roomEntity + 0x28) == 0x55) { bVar8 = *(int *)(roomEntity + 0x2c) == 0; } else { bVar8 = *(int *)(roomEntity + 0x28) == 0x332; } if (bVar8) { iVar5 = iVar5 + 1; } roomEntityIt = roomEntityIt + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); LAB_004fca03: if (8 < iVar5) goto LAB_004fcbaa; } Entity_NPC::UpdateControllerMovement(npc,1); fVar9 = (npc->_pos).x; if (npc->_controllerID == -1) { fVar10 = local_120.y; } else { fVar10 = (npc->_controllerMovement).x * 100.0 + fVar9; } (npc->_sprite)._flipX = fVar10 < fVar9; npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); npc->_stateFrame = 0x96; goto LAB_004fcbaa; } npc->_state = 4; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_004fcad6: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); pcVar6 = puStack_20; if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pcVar6 = puStack_20; } } else { animName = animData; if (0xf < *(uint *)(animData + 0x14)) { animName = *(byte **)animData; } pcVar6 = "WalkVert"; do { bVar2 = *animName; bVar8 = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_004fcab8: uVar4 = -(uint)bVar8 | 1; goto LAB_004fcabd; } if (bVar2 == 0) break; bVar2 = animName[1]; bVar8 = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_004fcab8; animName = animName + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004fcabd: if ((uVar4 != 0) || ((pcVar6 = local_38 + 0x34, animData[0x34] != 0 && (pcVar6 = local_38 + 0x34, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_004fcad6; } puStack_20 = pcVar6; fVar1 = fRam00c34d58; fVar10 = fRam00c34d54; fVar9 = fRam00c34d50; splatColor = &npc->_splatColor; if (npc->_variant == 1) { if (splatColor != (ColorMod *)&DAT_00c34d4c) { splatColor->_tint[0] = _DAT_00c34d4c; (npc->_splatColor)._tint[1] = fVar9; (npc->_splatColor)._tint[2] = fVar10; (npc->_splatColor)._tint[3] = fVar1; fVar1 = fRam00c34d68; fVar10 = fRam00c34d64; fVar9 = fRam00c34d60; (npc->_splatColor)._colorize[0] = _DAT_00c34d5c; (npc->_splatColor)._colorize[1] = fVar9; (npc->_splatColor)._colorize[2] = fVar10; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = DAT_00c34d6c; fVar9 = DAT_00c34d74; goto LAB_004fcb81; } } else { local_148 = 0; uStack_144 = 0; local_140 = 0; if (splatColor != (ColorMod *)local_168) { fVar9 = 0.0; splatColor->_tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 0.1; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; LAB_004fcb81: (npc->_splatColor)._offset[2] = fVar9; } } if (npc->_controllerID == -1) { uVar4 = Random(); iVar7 = uVar4 % 10 + 10; } else { iVar7 = 10; } npc->_stateFrame = iVar7; LAB_004fcbaa: fVar9 = (npc->_v1).x; if (0.0 < npc->_pendingDamage) { fVar9 = npc->_pendingDamage + fVar9; (npc->_v1).x = fVar9; } if (0.0 < fVar9) { fVar9 = fVar9 - npc->_speedMultiplier * 0.11; if (fVar9 <= 0.0) { fVar9 = 0.0; } (npc->_v1).x = fVar9; } ExceptionList = local_1c; return; } //@@ 004fcc20 NpcAI::ENTITY_BLASTER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 821 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BLASTER(Entity_NPC *npc) { byte bVar1; float *damageEvent; Entity *pEVar2; Vector *aimTarget; uint flagsHigh; void *pvVar4; undefined1 *size; float fVar5; float fVar6; undefined4 local_a0 [11]; Vector local_74; Vector local_6c; undefined1 local_64 [20]; float local_50; undefined1 local_4c; int local_44; undefined1 *local_40; void *local_3c; char local_38 [12]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; float *damageEventsEnd; undefined4 flagsHigh; int state; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af2a25; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); if (npc->_aiCallPhase == 1) { damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { if (((uint)damageEvent[2] & 0x1000004) == 0) { fVar5 = *damageEvent; npc->_pendingDamage = npc->_pendingDamage - fVar5 * 0.75; *damageEvent = *damageEvent - fVar5 * 0.75; } } if (0.0 < npc->_pendingDamage || npc->_pendingDamage == 0.0) { return; } npc->_pendingDamage = 0.0; return; } state = npc->_state; if (state == 0) { ExceptionList = &local_1c; npc->_state = 4; puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,(byte *)"WalkVert",0); if (&npc->_splatColor != (ColorMod *)local_a0) { (npc->_splatColor)._offset[0] = 0.11764707; (npc->_splatColor)._offset[1] = 0.11764707; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.11764707; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } npc->_aiCallFlags = 1; ExceptionList = local_1c; return; } if (state != 4) { if (state != 8) { return; } ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; Entity_NPC::SpawnControlTarget(npc,0,-1.0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { Entity_NPC::PlaySound(npc,0x1e2,1.0,10,0,1.0); pEVar2 = Entity_NPC::GetPlayerTarget(npc); local_74.y = (npc->_pos).x; local_6c.y = (npc->_pos).y; fVar5 = local_6c.y - (pEVar2->_pos).y; fVar6 = local_74.y - (pEVar2->_pos).x; fVar5 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); local_6c.x = (pEVar2->_velocity).x * fVar5 * 0.1 + (pEVar2->_pos).x; fVar5 = (pEVar2->_velocity).y * fVar5 * 0.1 + (pEVar2->_pos).y; if (npc->_controllerID != -1) { aimTarget = Entity_NPC::GetAimTargetPosition(npc,&local_2c); local_6c.x = aimTarget->x; fVar5 = aimTarget->y; } local_6c.y = fVar5 - local_6c.y; local_6c.x = local_6c.x - local_74.y; if ((npc->_sprite)._flipX == 0) { if (local_6c.x <= 0.0) { local_6c.x = 0.0; } } else if (0.0 <= local_6c.x) { local_6c.x = 0.0; } Vector::Normalize(&local_6c); (npc->_targetPosition).x = local_6c.x; (npc->_targetPosition).y = local_6c.y; npc->_stateFrame = 5; flagsHigh = Random(); local_74.x = local_6c.x * 10.0; local_2c.x = local_6c.x * 5.0 + (npc->_pos).x; local_74.y = local_6c.y * 10.0; local_2c.y = local_6c.y * 5.0 + (npc->_pos).y; pEVar2 = Game::Spawn(g_game,0x333,0,&local_2c,&local_74,(Entity *)npc,0,flagsHigh); flagsHigh = *(undefined4 *)((int)&pEVar2->_flags + 4); *(uint *)&pEVar2->_flags = (uint)pEVar2->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar2->_flags + 4) = flagsHigh; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x100); if (bVar1 != 0) { EntityRef::constructor((EntityRef *)local_64,(Entity *)0x0); Entity::AddCharmed(pEVar2,(EntityRef *)local_64,-1,0,0); } (**(code **)(*(int *)pEVar2 + 0xc))(); pEVar2[2]._posOffset.x = 2.24208e-44; pEVar2->_health = 0.1; *(undefined4 *)&pEVar2[2].field_0x3a8 = 0x3c; } if (npc->_stateFrame < 1) { fVar5 = npc->_friction * 0.7; } else { fVar5 = npc->_speedMultiplier; npc->_stateFrame = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; fVar6 = (npc->_targetPosition).y; (npc->_velocity).x = (npc->_velocity).x - (npc->_targetPosition).x * 4.0 * fVar5; (npc->_velocity).y = (npc->_velocity).y - fVar6 * 4.0 * fVar5; fVar5 = npc->_friction * 0.9; } npc->_friction = fVar5; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } local_40 = &DAT_0000000f; local_44 = 8; local_64[0x10] = 'W'; local_64[0x11] = 'a'; local_64[0x12] = 'l'; local_64[0x13] = 'k'; local_50 = (float)0x74726556; local_4c = 0; local_2c.y = 2.10195e-44; local_2c.x = 1.12104e-44; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; ExceptionList = &local_1c; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_64 + 0x10),0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_2c.y) { flagsHigh = (int)local_2c.y + 1; pvVar4 = local_3c; if (0xfff < flagsHigh) { pvVar4 = *(void **)((int)local_3c + -4); flagsHigh = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar4))) goto LAB_004fd11b; } operator_delete(pvVar4,flagsHigh); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; local_3c = (void *)((uint)local_3c & 0xffffff00); if (&DAT_0000000f < local_40) { size = local_40 + 1; pvVar4 = (void *)local_64._16_4_; if ((undefined1 *)0xfff < size) { pvVar4 = *(void **)(local_64._16_4_ + -4); size = local_40 + 0x24; if (0x1f < (uint)(local_64._16_4_ + (-4 - (int)pvVar4))) { LAB_004fd11b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,(uint)size); } npc->_friction = npc->_friction * 0.7; if (((npc->_flags & 0x20000000) == 0) || (npc->_controllerID != -1)) { bVar1 = 0; } else { bVar1 = 1; } PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,bVar1); Entity_NPC::SpawnControlTarget(npc,0,-1.0); if (npc->_controllerID == -1) { flagsHigh = Random(); if (flagsHigh % 0x46 != 0) { ExceptionList = local_1c; return; } } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar1 == 0) { ExceptionList = local_1c; return; } aimTarget = Entity_NPC::GetAimTargetPosition(npc,&local_2c); bVar1 = Vector::operator_ne(aimTarget,&npc->_pos); if (bVar1 == 0) { ExceptionList = local_1c; return; } } bVar1 = Entity::HasEntityFlags((Entity *)npc,0xa00); if (bVar1 == 0) { pvVar4 = Entity_NPC::QueryNPCsType(local_38 + 4,0x333,0); flagsHigh = *(uint *)((int)pvVar4 + 0xc); EntityList_Query::~EntityList_Query(local_38 + 4); if (flagsHigh < 4) { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); pEVar2 = Entity_NPC::GetPlayerTarget(npc); fVar5 = (pEVar2->_pos).x; if (npc->_controllerID != -1) { aimTarget = Entity_NPC::GetAimTargetPosition(npc,&local_2c); fVar5 = aimTarget->x; } (npc->_sprite)._flipX = fVar5 < (npc->_pos).x; } } ExceptionList = local_1c; return; } //@@ 004fd280 quakey_timer_callback /* DB: callback passed to Entity_Effect::CreateTimer (mov ecx,0x4fd280 at 0x4fd8af, 12 repeats) by NpcAI::ENTITY_QUAKEY; timer effect at offset (12-count)/12*150 along dir +0x334, Room::GetClampedPositionImpl, Game::SpawnEx(9,9,...) projectiles with apply_spawn_flags */ void quakey_timer_callback(int param_1) { uint uVar1; uint uVar2; Entity_Projectile *projectile; float fVar3; float fVar4; Vector local_28; Vector local_20; Vector local_18; Vector local_10; fVar3 = ((float)(0xc - *(int *)(param_1 + 0x428)) / 12.0) * 150.0; local_28.y = fVar3 * *(float *)(param_1 + 0x338) + *(float *)(param_1 + 0x340); local_28.x = fVar3 * *(float *)(param_1 + 0x334) + *(float *)(param_1 + 0x33c); Room::GetClampedPositionImpl(g_game->_room,&local_20,&local_28,20.0,20.0,20.0,20.0); uVar1 = Random(); local_28.x = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28.x = local_28.x + local_28.x; fVar3 = cos(local_28.x); local_28.x = sin(local_28.x); uVar1 = Random(); uVar2 = Random(); local_18.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.0; local_18.y = local_18.x * local_28.x; local_18.x = local_18.x * fVar3; uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 80.0; local_10.y = fVar4 * local_28.x + local_20.y; local_10.x = fVar4 * fVar3 + local_20.x; projectile = (Entity_Projectile *) Game::SpawnEx(g_game,9,9,&local_10,&local_18,(Entity *)0x0,0,uVar1,0); uVar1 = Random(); projectile->_scale = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; projectile->_height = projectile->_height - 400.0; projectile->_fallingAccel = projectile->_fallingAccel + 2.0; uVar1 = Random(); projectile->_spawnerType = 0x337; *(undefined4 *)&projectile->_projectileFlags = 0x8000000; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = 0; projectile->_acceleration = 0.95; projectile->_fallingSpeed = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 10.0 + projectile->_fallingSpeed; Entity_Projectile::apply_spawn_flags (projectile,*(int *)(param_1 + 0x450),*(float *)(param_1 + 0x478), *(ulonglong *)(param_1 + 0x168),(Entity *)0x0); (**(code **)(*(int *)projectile + 0xc))(); return; } //@@ 004fd540 NpcAI::ENTITY_QUAKEY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 823 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_QUAKEY(Entity_NPC *npc) { code *pcVar1; byte bVar2; Entity_Player *player; Entity_Effect *shockwaveTimer; Entity *target; int iVar3; Vector *pVVar4; Vector *pVVar5; byte *curAnimName; void *pvVar6; char *walkAnimName; uint uVar7; undefined1 *size; bool bVar8; float fVar9; float fVar10; undefined4 local_160 [11]; Vector local_134; AnimationState *local_12c; Vector scratchVec; Entity_Player *local_120; float local_11c; float local_118; float local_114; ProjectileParams projParams; undefined1 local_64 [20]; float local_50; undefined1 local_4c; int local_44; undefined1 *local_40; void *local_3c; char local_38 [12]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; AnimationState *animState; uint *flagsHi; Manager *manager; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af2a65; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; Entity_NPC::UpdateChargeBar(npc,120.0,0.0,(float)npc->_projectileCooldown,1); iVar3 = npc->_state; if (iVar3 != 0) { if (iVar3 == 4) { local_40 = &DAT_0000000f; local_44 = 8; local_64[0x10] = 'W'; local_64[0x11] = 'a'; local_64[0x12] = 'l'; local_64[0x13] = 'k'; local_50 = (float)0x74726556; local_4c = 0; local_28 = 0xf; local_2c = 8; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_64 + 0x10),0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_28) { uVar7 = local_28 + 1; pvVar6 = local_3c; if (0xfff < uVar7) { pvVar6 = *(void **)((int)local_3c + -4); uVar7 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar6))) goto LAB_004fdb6a; } operator_delete(pvVar6,uVar7); } local_14 = 0xffffffff; local_2c = 0; local_28 = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (&DAT_0000000f < local_40) { size = local_40 + 1; pvVar6 = (void *)local_64._16_4_; if ((undefined1 *)0xfff < size) { pvVar6 = *(void **)(local_64._16_4_ + -4); size = local_40 + 0x24; if (0x1f < (uint)(local_64._16_4_ + (-4 - (int)pvVar6))) { LAB_004fdb6a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,(uint)size); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { bVar2 = 1; iVar3 = 900; fVar9 = 0.3; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar4,fVar9,iVar3,bVar2); if (npc->_spawnerType != 0x38a) { if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } target = Entity_NPC::GetPlayerTarget(npc); local_120 = (Entity_Player *)(target->_pos).x; local_114 = (target->_pos).y; if (npc->_projectileCooldown < 1) { if (npc->_controllerID == -1) { fVar10 = (npc->_pos).x - (float)local_120; fVar9 = (npc->_pos).y - local_114; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); if (((120.0 <= fVar9) || (uVar7 = Random(), uVar7 % 0xf != 0)) && (uVar7 = Random(), uVar7 % 0x78 != 0)) goto LAB_004fde34; } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar2 == 0) && (bVar2 = Entity_NPC::IsControllerActionPressed(npc,9), bVar2 == 0) ) goto LAB_004fde34; } ANM2::Play(&npc->_sprite,s_Jump,0); npc->_state = 8; scratchVec.x = (float)local_120 - (npc->_pos).x; scratchVec.y = local_114 - (npc->_pos).y; pVVar5 = Vector::Normalized(&scratchVec,&local_134); iVar3 = npc->_controllerID; pVVar4 = &npc->_targetPosition; fVar9 = pVVar5->y; pVVar4->x = pVVar5->x * 12.0; (npc->_targetPosition).y = fVar9 * 12.0; if (iVar3 != -1) { pVVar5 = Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.0); fVar9 = pVVar5->x; (npc->_targetPosition).y = pVVar5->y * 12.0; pVVar4->x = fVar9 * 12.0; bVar2 = Vector::operator_eq(pVVar4,&g_vectorZero); if (bVar2 != 0) { pVVar5 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); fVar9 = pVVar5->y; pVVar4->x = pVVar5->x * 12.0; (npc->_targetPosition).y = fVar9 * 12.0; } } npc->_projectileCooldown = 0x78; } } } else { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); iVar3 = (npc->_pathfinder)._evadeMovementCountdown; fVar9 = npc->_friction * 0.8; npc->_friction = fVar9; if (0 < iVar3) { npc->_friction = fVar9 * 0.8; } } LAB_004fde34: if ((npc->_pathfinder)._hasDirectPath == 0) { ExceptionList = local_1c; return; } uVar7 = Random(); if (uVar7 % 3 == 0) { Entity_NPC::PlaySound(npc,0x74,1.0,0x3c,0,1.0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (iVar3 != 8) { ExceptionList = local_1c; return; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { local_12c = animState; bVar2 = AnimationState::IsEventTriggered(animState,s_Jump); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0xf9,1.0,10,0,1.0); fVar9 = npc->_speedMultiplier; fVar10 = (npc->_targetPosition).y; (npc->_velocity).x = fVar9 * (npc->_targetPosition).x + (npc->_velocity).x; (npc->_velocity).y = fVar10 * fVar9 + (npc->_velocity).y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; local_12c = animState; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { local_118 = 7.28675e-44; seed_fart_sound_override((int *)&local_118); SoundEffects::Play(&manager->_sfxManager,(int)local_118,1.0,0x14,0,1.0,0.0); Game::ShakeScreen(g_game,0xe); Game::MakeShockwave(g_game,&npc->_pos,0.035,0.03,10); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 9; local_134.x = 10.0; local_134.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_134,8,&projParams); if (((npc->_flags & 0x20000000) == 0) && (local_114 = 0.0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,(uint)local_114); local_11c = (player->_pos).y - (npc->_pos).y; local_118 = (player->_pos).x - (npc->_pos).x; local_120 = player; fVar9 = sqrtf(local_11c * local_11c + local_118 * local_118); if (fVar9 < 150.0) { if (fVar9 <= 0.0) { scratchVec.x = local_118; scratchVec.y = local_11c; } else { scratchVec.x = local_118 * (1.0 / fVar9); scratchVec.y = local_11c * (1.0 / fVar9); } scratchVec.x = scratchVec.x * 3.0; scratchVec.y = scratchVec.y * 3.0; pcVar1 = *(code **)(*(int *)player + 0x54); EntityRef::constructor((EntityRef *)local_64,(Entity *)npc); (*pcVar1)(local_64,&scratchVec,0x41100000); } local_114 = (float)((int)local_114 + 1); } while ((uint)local_114 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } if (npc->_spawnerType != 0x38b) { Entity_NPC::GetPlayerTarget(npc); shockwaveTimer = Entity_Effect::CreateTimer(quakey_timer_callback,2,0xc,0); (shockwaveTimer->_pos).x = (npc->_pos).x; (shockwaveTimer->_pos).y = (npc->_pos).y; target = Entity_NPC::GetPlayerTarget(npc); local_114 = (target->_pos).x - (npc->_pos).x; local_11c = (target->_pos).y - (npc->_pos).y; fVar9 = sqrtf(local_114 * local_114 + local_11c * local_11c); if (fVar9 <= 0.0) { fVar10 = local_114; fVar9 = local_11c; } else { fVar10 = local_114 * (1.0 / fVar9); fVar9 = local_11c * (1.0 / fVar9); } (shockwaveTimer->_targetPosition).x = fVar10; (shockwaveTimer->_targetPosition).y = fVar9; if (shockwaveTimer->_parent != (EntityPtr)0x0) { local_120 = (Entity_Player *)&shockwaveTimer->_parent; std::multiset::erase(&local_120); } shockwaveTimer->_parent = (EntityPtr)npc; std::multiset::insert(&shockwaveTimer->_parent); if (npc->_isChampion == 0) { iVar3 = -1; } else { iVar3 = npc->_championColorIdx; } shockwaveTimer->_state = iVar3; uVar7 = *(uint *)((int)&npc->_flags + 4); *(uint *)&shockwaveTimer->_flags = (uint)shockwaveTimer->_flags | (uint)npc->_flags & 0x20000100; flagsHi = (uint *)((int)&shockwaveTimer->_flags + 4); *flagsHi = *flagsHi | uVar7 & 0x100000; shockwaveTimer->_scale = npc->_scale; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::WasEventTriggered(local_12c,(byte *)"Shoot"), bVar2 != 0)) { fVar9 = npc->_friction * 0.6; goto LAB_004fda65; } } } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) { fVar9 = 0.9; } else { fVar9 = 0.6; } fVar9 = fVar9 * npc->_friction; LAB_004fda65: npc->_friction = fVar9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } npc->_state = 4; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } walkAnimName = "WalkVert"; do { bVar2 = *curAnimName; bVar8 = bVar2 < (byte)*walkAnimName; if (bVar2 != *walkAnimName) { LAB_004fdeb8: uVar7 = -(uint)bVar8 | 1; goto LAB_004fdebd; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; bVar8 = bVar2 < (byte)walkAnimName[1]; if (bVar2 != walkAnimName[1]) goto LAB_004fdeb8; curAnimName = curAnimName + 2; walkAnimName = walkAnimName + 2; } while (bVar2 != 0); uVar7 = 0; LAB_004fdebd: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004fdef4; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_004fdef4: if (&npc->_splatColor != (ColorMod *)local_160) { (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.8; (npc->_splatColor)._colorize[1] = 0.78; (npc->_splatColor)._colorize[2] = 0.74; (npc->_splatColor)._colorize[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } ExceptionList = local_1c; return; } //@@ 004fdf80 NpcAI::ENTITY_MOLE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Unable to use type for symbol mole */ /* NPC AI for entity type 829 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOLE(Entity_NPC *npc) { ANM2 *pAVar1; byte bVar2; uint forcedCurses; uint preventedCurses; undefined4 *damageEvent; ColorMod *color; Entity *tmpEntity; Vector *tmpVec; ColorMod *color_00; byte *pbVar3; uint uVar4; EntityPtr EVar5; ColorMod *color_01; char *animName; byte *pbVar6; undefined1 *effectIdx; int iVar7; code *extraout_EDX; int iVar8; Room *room; bool bVar9; float fVar10; float fVar11; float fVar12; double dVar13; Vector calcTarget; Vector controllerInput; Room *savedRoom; float local_128; Vector local_124; byte *local_11c; Vector local_118; int local_110; byte *local_10c; EntityPtr local_108; char isDarkRoom; EntityPtr local_100; EntityPtr local_fc; ProjectileParams projParams; undefined1 local_50 [12]; undefined1 local_44 [20]; undefined1 local_30 [8]; undefined1 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; EntityPtr mole; uint curses; Game *game; int *gridEntity; Manager *manager; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00af408d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_30 + 0x20); ExceptionList = &local_1c; local_30._0_4_ = 7.00649e-45; local_30._4_4_ = 1.26117e-44; savedRoom = g_game->_room; uVar4 = g_game->_debugCurses; curses = g_game->_curses; local_44._16_4_ = npc->_initSeed + npc->_index; local_28 = &DAT_00000007; local_fc = (EntityPtr)npc; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); mole = local_fc; room = savedRoom; if ((~preventedCurses & (forcedCurses | uVar4 | curses) & 1) == 0) { fVar10 = g_game->_darknessStrength * g_game->_darknessModifier; } else { fVar10 = 1.0; } if (((*(uint *)((int)savedRoom->_descriptor + 0x44) >> 9 & 1) != 0) || (isDarkRoom = '\0', 0.8 < fVar10)) { isDarkRoom = '\x01'; } local_110 = *(int *)((int)local_fc + 0x2c); if (((*(int *)((int)local_fc + 0x28) == 0x33d) && (0.0 < *(float *)((int)local_fc + 0x14))) && (damageEvent = *(undefined4 **)((int)local_fc + 8), damageEvent != *(undefined4 **)((int)local_fc + 0xc))) { do { if (((*(byte *)(damageEvent + 0xc) & 1) == 0) && ((damageEvent[4] == *(int *)((int)local_fc + 0x28) || (damageEvent[6] == *(int *)((int)local_fc + 0x28))))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != *(undefined4 **)((int)local_fc + 0xc)); } Entity_NPC::UpdateChargeBar ((Entity_NPC *)local_fc,150.0,0.0,(float)*(int *)((int)local_fc + 0x410),1); *(undefined4 *)((int)mole + 0xf30) = 0; *(undefined4 *)((int)mole + 0xf34) = 0x3f800000; switch(*(undefined4 *)((int)mole + 0xb64)) { case 0: *(undefined4 *)((int)mole + 0xb64) = 4; *(undefined4 *)((int)mole + 0x188) = 0; *(undefined4 *)((int)mole + 0x15c) = 0; *(float *)((int)mole + 3000) = g_vectorZero.x; *(float *)((int)mole + 0xbbc) = g_vectorZero.y; break; case 3: if (*(int *)((int)mole + 0x7c) == 0) { LAB_004fe66f: local_fc = (EntityPtr)((int)mole + 0x78); iVar7 = Room::GetGridIndex(room,(Vector *)((int)mole + 0x33c)); local_108 = local_fc; EVar5 = local_fc; if ((-1 < iVar7) && (iVar7 < 0x1c0)) { room->_gridPaths[iVar7] = 900; } } else { local_108 = (EntityPtr)((int)mole + 0x78); bVar2 = AnimationState::WasEventTriggered ((AnimationState *)((int)mole + 0x78),(byte *)"Shoot"); EVar5 = (EntityPtr)((int)mole + 0x78); if (bVar2 == 0) goto LAB_004fe66f; } if ((*(int *)((int)mole + 0x7c) == 0) || (bVar2 = AnimationState::IsEventTriggered((AnimationState *)EVar5,(byte *)"Shoot"), bVar2 == 0)) { EVar5 = local_108; } else { *(undefined4 *)((int)mole + 0x15c) = *(undefined4 *)(*(int *)((int)mole + 0x330) + 0x24); *(float *)((int)mole + 0x334) = g_vectorZero.x; *(float *)((int)mole + 0x338) = g_vectorZero.y; local_fc = (EntityPtr)0x0; local_11c = (byte *)Room::GetGridIndex(room,(Vector *)((int)mole + 0x33c)); local_110 = 0; local_10c = local_11c; do { if (*(int *)((int)mole + 0xf1c) == -1) { uVar4 = Random(); if ((uVar4 & 3) == 0) { tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)mole,&calcTarget,0.0); local_128 = tmpVec->x; local_124.y = tmpVec->y; local_124.x = local_128; } else { uVar4 = Random(); local_118.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_118.y = local_118.y + local_118.y; fVar10 = cos(local_118.y); local_128 = fVar10 * 90.0 + *(float *)((int)mole + 0x33c); local_124.x = local_128; fVar10 = sin(local_118.y); local_124.y = fVar10 * 90.0 + *(float *)((int)mole + 0x340); } } else { tmpVec = Entity_NPC::GetControllerInput((Entity_NPC *)mole,&controllerInput,0.0); fVar10 = 120.0 - (float)local_110 * 5.0; local_124.y = fVar10 * tmpVec->y + *(float *)((int)mole + 0x340); local_128 = fVar10 * tmpVec->x + *(float *)((int)mole + 0x33c); local_124.x = local_128; } local_118.y = local_124.y; if ((*(int *)((int)mole + 0xf1c) == -1) || (3 < local_110)) { tmpVec = Room::FindFreeTilePosition(room,(Vector *)(local_30 + 4),&local_124,64.0); local_128 = tmpVec->x; local_118.y = tmpVec->y; local_124.x = local_128; } fVar11 = *(float *)((int)mole + 0x33c) - local_128; fVar10 = *(float *)((int)mole + 0x340) - local_118.y; local_124.y = local_118.y; local_100 = (EntityPtr)sqrtf(fVar10 * fVar10 + fVar11 * fVar11); local_128 = (float)(int)((local_128 - 40.0) / 40.0 + 0.5); local_118.y = (float)(int)((local_118.y - 120.0) / 40.0 + 0.5); if (((((((int)local_128 < 0) || (room->_gridWidth <= (int)local_128)) || ((int)local_118.y < 0)) || ((room->_gridHeight <= (int)local_118.y || (uVar4 = (int)local_118.y * room->_gridWidth + (int)local_128, 0x1bf < uVar4)))) || (room->_gridPaths[uVar4] < 500)) && (((bVar2 = NPCAI_Pathfinder::HasPathToPos ((NPCAI_Pathfinder *)((int)mole + 0x414),&local_124,0), bVar2 != 0 && ((float)local_100 < 120.0)) && ((float)local_fc < (float)local_100)))) { local_fc = local_100; if (((((int)local_128 < 0) || (room->_gridWidth <= (int)local_128)) || ((int)local_118.y < 0)) || (room->_gridHeight <= (int)local_118.y)) { local_11c = (byte *)0xffffffff; } else { local_11c = (byte *)((int)local_118.y * room->_gridWidth + (int)local_128); } if (*(int *)((int)mole + 0xf1c) != -1) break; } local_110 = local_110 + 1; } while (local_110 < 10); if (local_10c != local_11c) { bVar2 = Room::CanSpawnObstacleAtPosition(room,(int)local_10c,0); manager = g_manager; if (bVar2 != 0) { local_fc = (EntityPtr)0x89; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); rng_pair_init(); local_44._0_4_ = 1.96182e-44; uVar4 = Random(); local_44._8_4_ = ((uVar4 & 1) + 1) * 0x7d; local_44._16_4_ = Random(); local_28 = (undefined1 *)Random(); room = savedRoom; Room::SpawnGridEntityDesc(savedRoom,(int)local_10c,(GridEntityDesc *)local_44); if (((local_10c < (byte *)0x1c0) && (gridEntity = room->_gridEntities[(int)local_10c], gridEntity != (int *)0x0)) && (gridEntity[1] == 0xe)) { gridEntity[6] = 1; (**(code **)(*gridEntity + 4))(); } Color::Color((Color *)local_50); Game::SpawnParticles(g_game,(Vector *)((int)mole + 0x33c),4,4,5.0,color_01,100000.0,0); } } iVar7 = room->_gridWidth; *(float *)((int)mole + 0x338) = (float)((int)local_11c / iVar7) * 40.0 + 120.0; *(float *)((int)mole + 0x334) = (float)((int)local_11c % iVar7) * 40.0 + 40.0; *(undefined4 *)((int)mole + 0xbb0) = 0; if (*(float *)((int)mole + 0x340) < *(float *)((int)mole + 0x338) || *(float *)((int)mole + 0x340) == *(float *)((int)mole + 0x338)) { *(undefined4 *)((int)mole + 0x184) = 0; EVar5 = local_108; } else { if (*(int *)((int)mole + 0x7c) == 0) { local_fc = (EntityPtr)0xffffffff; LAB_004fec25: bVar2 = ANM2::SetAnimation((ANM2 *)((int)mole + 0x48),(byte *)"JumpBack",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)mole + 0x78)); *(undefined1 *)((int)mole + 0x8c) = 1; } } else { dVar13 = floor((double)*(float *)((int)mole + 0x88)); local_100 = (EntityPtr)(float)dVar13; pbVar3 = *(byte **)((int)mole + 0x7c); local_fc = (EntityPtr)(int)dVar13; if (pbVar3 == (byte *)0x0) { pbVar6 = &s_empty; } else { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } } animName = "JumpBack"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_004fec03: uVar4 = -(uint)bVar9 | 1; goto LAB_004fec08; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_004fec03; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004fec08: if ((uVar4 != 0) || (((pbVar3 != (byte *)0x0 && (pbVar3[0x34] != 0)) && (*(char *)((int)mole + 0x8c) == '\0')))) goto LAB_004fec25; } EVar5 = local_108; if (*(int *)((int)mole + 0x7c) != 0) { AnimationState::SetFrameFloat((AnimationState *)local_108,(float)(int)local_fc); } *(undefined4 *)((int)mole + 0xf30) = 0; *(undefined1 **)((int)mole + 0xf34) = &DAT_bf800000; *(undefined4 *)((int)mole + 0x184) = 0; } } if (*(int *)((int)mole + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered((AnimationState *)EVar5,(byte *)"Shoot2"); if (bVar2 != 0) { *(undefined4 *)((int)mole + 0x15c) = 0; *(undefined4 *)((int)mole + 0x188) = 0; *(undefined4 *)((int)mole + 0x184) = 5; } if ((*(int *)((int)mole + 0x7c) != 0) && (*(char *)((int)mole + 0x8c) != '\0')) break; } *(undefined4 *)((int)mole + 0xb64) = 4; *(float *)((int)mole + 0x334) = g_vectorZero.x; *(float *)((int)mole + 0x338) = g_vectorZero.y; break; case 4: Entity_NPC::CalcTargetPosition((Entity_NPC *)mole,&local_118,0.0); local_100 = (EntityPtr)Entity_NPC::GetPlayerTarget((Entity_NPC *)mole); bVar2 = Entity::IsFrame((Entity *)mole,0x1e,*(int *)((int)mole + 0x20)); if (bVar2 != 0) { fVar10 = ((Vector *)((int)local_100 + 0x360))->y; *(float *)((int)mole + 3000) = ((Vector *)((int)local_100 + 0x360))->x; *(float *)((int)mole + 0xbbc) = fVar10; } if ((*(int *)((int)mole + 0xf1c) == -1) && (bVar2 = Room::CheckLine(room,(Vector *)((int)mole + 0x33c),&local_118,0,0,0,0,(Vector *)0x0) , bVar2 != 0)) { fVar10 = *(float *)((int)mole + 0x340) - local_118.y; fVar11 = *(float *)((int)mole + 0x33c) - local_118.x; local_fc = (EntityPtr)sqrtf(fVar10 * fVar10 + fVar11 * fVar11); local_10c = *(byte **)((int)mole + 3000); local_11c = *(byte **)((int)mole + 0xbbc); local_100 = (EntityPtr)RNG::RandomFloat((RNG *)(local_44 + 0x10)); fVar10 = (float)local_100 * 0.4 + 0.0; local_118.x = (float)local_10c * (float)local_fc * fVar10 + local_118.x; local_118.y = (float)local_11c * (float)local_fc * fVar10 + local_118.y; fVar11 = *(float *)((int)mole + 0x33c) - local_118.x; fVar10 = *(float *)((int)mole + 0x340) - local_118.y; fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); local_10c = (byte *)0x43000000; if (128.0 <= fVar10 * 0.5) { local_10c = (byte *)(fVar10 * 0.5); } iVar7 = g_game->_frameCount; iVar8 = *(int *)((int)mole + 0x328); if (0.0 <= (float)local_10c) { local_10c = (byte *)0x0; } fVar10 = RNG::RandomFloat((RNG *)(local_44 + 0x10)); local_100 = (EntityPtr)(fVar10 * (float)(iVar7 - iVar8)); fVar10 = RNG::RandomFloat((RNG *)(local_44 + 0x10)); local_100 = (EntityPtr)((fVar10 * 360.0 + (float)local_100 + (float)local_100) * 0.017453292); local_fc = (EntityPtr)cos((float)local_100); fVar10 = sin((float)local_100); local_118.x = ((float)local_fc * (float)local_10c - fVar10 * 0.0) + local_118.x; local_118.y = local_118.y + fVar10 * (float)local_10c + (float)local_fc * 0.0; local_100 = (EntityPtr)(*(float *)((int)mole + 0x36c) * 0.8); *(EntityPtr *)((int)mole + 0x36c) = local_100; local_124.x = local_118.x - *(float *)((int)mole + 0x33c); local_124.y = local_118.y - *(float *)((int)mole + 0x340); tmpVec = Vector::Normalized(&local_124,(Vector *)(local_30 + 4)); fVar10 = tmpVec->x; room = savedRoom; if ((float)local_100 != 0.0) { *(float *)((int)mole + 0x364) = (*(float *)((int)mole + 0x39c) * tmpVec->y * 0.8) / (float)local_100 + *(float *)((int)mole + 0x364); *(float *)((int)mole + 0x360) = (*(float *)((int)mole + 0x39c) * fVar10 * 0.8) / (float)local_100 + *(float *)((int)mole + 0x360); } } else { PathFinder::FindGridPath((PathFinder *)((int)mole + 0x414),&local_118,0.8,499,1); } tmpVec = Entity_NPC::CalcTargetPosition((Entity_NPC *)mole,(Vector *)(local_30 + 4),0.0); fVar11 = tmpVec->x - *(float *)((int)mole + 0x33c); fVar10 = tmpVec->y - *(float *)((int)mole + 0x340); local_100 = (EntityPtr)(fVar11 * fVar11 + fVar10 * fVar10); if (*(int *)((int)mole + 0xf1c) == -1) { uVar4 = Random(); if ((uVar4 % 10 == 0) && (((float)local_100 < 8100.0 || ((0x5a < *(int *)((int)mole + 0x410) && ((float)local_100 < 40000.0)))))) goto LAB_004ff144; } else { bVar2 = Entity_NPC::IsControllerActionPressed((Entity_NPC *)mole,9); if ((bVar2 != 0) || ((bVar2 = Entity_NPC::IsTargetInAttackRange((Entity_NPC *)mole,1000.0,0,7), bVar2 != 0 || (0x96 < *(int *)((int)mole + 0x410))))) { LAB_004ff144: local_fc = (EntityPtr)Room::GetGridIndex(room,(Vector *)((int)mole + 0x33c)); if (((-1 < (int)local_fc) && (iVar7 = Room::GetGridCollisionAtPos(room,*(Vector *)((int)mole + 0x33c)), iVar7 == 0)) && (((*(int *)((int)mole + 0xf1c) != -1 || (0x1bf < (int)local_fc)) || (room->_gridPaths[(int)local_fc] < 500)))) { iVar7 = room->_gridWidth; fVar10 = (float)((int)local_fc % iVar7) * 40.0 + 40.0; *(float *)((int)mole + 0x33c) = fVar10; *(float *)((int)mole + 0x340) = (float)((int)local_fc / iVar7) * 40.0 + 120.0; *(undefined4 *)((int)mole + 0xb64) = 6; *(float *)((int)mole + 0x334) = fVar10; *(undefined4 *)((int)mole + 0x338) = *(undefined4 *)((int)mole + 0x340); animName = "DigOut2"; if (isDarkRoom == '\0') { animName = "DigOut"; } *(undefined4 *)((int)mole + 0x410) = 0; ANM2::Play((ANM2 *)((int)mole + 0x48),(byte *)animName,0); Entity_NPC::UpdateDirtColor((Entity_NPC *)mole,1); break; } if (((0x96 < *(int *)((int)mole + 0x410)) && (*(int *)((int)mole + 0xf1c) != -1)) && (iVar7 = (int)((ulonglong)((longlong)*(int *)((int)mole + 0x410) * -0x77777777) >> 0x20) + *(int *)((int)mole + 0x410), (iVar7 >> 4) - (iVar7 >> 0x1f) < (((int)*(float *)((int)mole + 0x3a4) - (int)*(float *)((int)mole + 0x3a0)) + *(int *)((int)mole + 0x410)) / 0x1e)) { EntityRef::EntityRef((EntityRef *)(local_50 + 4)); (*extraout_EDX)(); } } } *(int *)((int)mole + 0x410) = *(int *)((int)mole + 0x410) + ((int)*(float *)((int)mole + 0x3a4) - (int)*(float *)((int)mole + 0x3a0)); EntityList::QuerySublist(&room->_entityList,(EntityList_EL *)(local_44 + 0x10),1000,0x92,-1,0,0) ; local_14 = 0; tmpVec = (Vector *)((int)mole + 0x33c); effectIdx = (undefined1 *)0x0; if (local_28 != (undefined1 *)0x0) { do { iVar7 = *(int *)(local_30._0_4_ + (int)effectIdx * 4); fVar10 = *(float *)((int)mole + 0x340) - *(float *)(iVar7 + 0x340); fVar11 = tmpVec->x - *(float *)(iVar7 + 0x33c); if (fVar10 * fVar10 + fVar11 * fVar11 < 144.0) goto LAB_004ff42c; effectIdx = effectIdx + 1; } while (effectIdx < local_28); } uVar4 = Random(); Game::Spawn(g_game,1000,0x92,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar4); if (local_110 == 1) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x3e,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar4); game = g_game; tmpEntity->_renderDepthOffset = 10.0; Game::BombDamage(game,tmpVec,10.0,20.0,0,*(Entity **)((int)mole + 0x3bc),g_tearFlagsNone, 0x1000000,0); manager = g_manager; local_fc = (EntityPtr)0x89; seed_fart_sound_override((int *)&local_fc); SoundEffects::Play(&manager->_sfxManager,(int)local_fc,1.0,2,0,1.0,0.0); } LAB_004ff42c: local_14 = 0xffffffff; if (local_44[0x10] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_30._0_4_,0); local_14 = 0xffffffff; } break; case 6: Entity_NPC::SpawnControlTarget((Entity_NPC *)mole,0,-1.0); if (*(int *)((int)mole + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered((AnimationState *)((int)mole + 0x78),(byte *)"Shoot") ; if ((bVar2 != 0) && (*(undefined4 *)((int)mole + 0x188) = 4, local_110 == 1)) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x3d,(Vector *)((int)mole + 0x33c),&g_vectorZero, (Entity *)mole,0,uVar4); if (tmpEntity->_parent != (EntityPtr)0x0) { local_fc = (EntityPtr)&tmpEntity->_parent; std::multiset::erase(&local_fc); } tmpEntity->_parent = mole; std::multiset::insert(&tmpEntity->_parent); *(undefined4 *)tmpEntity[1]._sprite._filename._buf = *(undefined4 *)((int)mole + 0x370); pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[4] = '\0'; (pAVar1->_filename)._buf[5] = '\0'; (pAVar1->_filename)._buf[6] = 'H'; (pAVar1->_filename)._buf[7] = 'B'; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[8] = '\x05'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[0xc] = '\x05'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; Entity_NPC::PlaySound((Entity_NPC *)mole,0x34,1.0,2,0,1.0); Game::ShakeScreen(g_game,4); color = (ColorMod *)Color::Color(0x3f19999a); Entity::MakeGroundPoof((Entity *)mole,(Vector *)((int)mole + 0x33c),color,1.0); } if ((*(int *)((int)mole + 0x7c) != 0) && (*(char *)((int)mole + 0x8c) != '\0')) break; } if (*(int *)((int)mole + 0xf1c) == -1) { uVar4 = Random(); bVar2 = uVar4 % 10 == 0; } else { tmpVec = Entity_NPC::GetAimTargetPosition((Entity_NPC *)mole,&local_124); bVar2 = Vector::operator_ne(tmpVec,(Vector *)((int)mole + 0x33c)); } if (bVar2 == 0) { if (*(int *)((int)mole + 0xf1c) != -1) { pbVar3 = &DAT_00b6018c; *(undefined4 *)((int)mole + 0xb64) = 3; if (isDarkRoom == '\0') { pbVar3 = s_Jump; } ANM2::Play((ANM2 *)((int)mole + 0x48),pbVar3,0); } } else { *(undefined4 *)((int)mole + 0xb64) = 8; *(undefined4 *)((int)mole + 0xbc4) = 0; } break; case 8: Entity_NPC::SpawnControlTarget((Entity_NPC *)mole,0,-1.0); ANM2::Play((ANM2 *)((int)mole + 0x48),(byte *)"Shoot",0); if ((*(int *)((int)mole + 0x7c) != 0) && (bVar2 = AnimationState::IsEventTriggered ((AnimationState *)((int)mole + 0x78),(byte *)"Shoot"), bVar2 != 0)) { tmpEntity = Entity_NPC::GetPlayerTarget((Entity_NPC *)mole); local_11c = (byte *)(tmpEntity->_pos).x; local_108 = (EntityPtr)(tmpEntity->_pos).y; if (*(int *)((int)mole + 0xf1c) != -1) { tmpVec = Entity_NPC::GetAimTargetPosition((Entity_NPC *)mole,&local_124); local_11c = (byte *)tmpVec->x; local_108 = (EntityPtr)tmpVec->y; } ProjectileParams::ProjectileParams(&projParams); if (local_110 == 1) { projParams.Scale = 1.4; } else { projParams.Spread = 0.4; } local_10c = (byte *)((float)local_11c - *(float *)((int)mole + 0x33c)); local_108 = (EntityPtr)((float)local_108 - *(float *)((int)mole + 0x340)); fVar10 = sqrtf((float)local_10c * (float)local_10c + (float)local_108 * (float)local_108); if (fVar10 <= 0.0) { pbVar3 = local_10c; EVar5 = local_108; } else { pbVar3 = (byte *)((float)local_10c * (1.0 / fVar10)); EVar5 = (EntityPtr)((1.0 / fVar10) * (float)local_108); } local_124.x = (float)pbVar3 * 8.0; local_124.y = (float)EVar5 * 8.0; Entity_NPC::FireProjectiles ((Entity_NPC *)mole,(Vector *)((int)mole + 0x33c),&local_124,2,&projParams); Color::Color((Color *)local_50); local_124.x = *(float *)((int)mole + 0xe4) * 0.0; local_124.y = *(float *)((int)mole + 0xe8) * -20.0; spawn_blood_explosion(2,(Vector *)((int)mole + 0x33c),&local_124,color_00,&g_vectorZero); if (local_110 != 1) { fVar10 = 1.2; } else { fVar10 = 1.0; } iVar7 = 0x6c; if (local_110 != 1) { iVar7 = 0x9e; } Entity_NPC::PlaySound((Entity_NPC *)mole,iVar7,1.0,2,0,fVar10); *(bool *)((int)mole + 0x148) = (float)local_11c < *(float *)((int)mole + 0x33c); } if (local_110 == 1) { if (*(int *)((int)mole + 0x7c) != 0) { bVar2 = AnimationState::IsEventTriggered ((AnimationState *)((int)mole + 0x78),(byte *)"Shoot2"); if ((bVar2 != 0) && (*(int *)((int)mole + 0xbc4) < 3)) { bVar2 = ANM2::SetAnimation((ANM2 *)((int)mole + 0x48),(byte *)"Shoot",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)mole + 0x78)); *(undefined1 *)((int)mole + 0x8c) = 1; } *(int *)((int)mole + 0xbc4) = *(int *)((int)mole + 0xbc4) + 1; } goto LAB_004fe597; } } else { LAB_004fe597: if ((*(int *)((int)mole + 0x7c) != 0) && (*(char *)((int)mole + 0x8c) != '\0')) break; } local_10c = &DAT_00b6018c; *(undefined4 *)((int)mole + 0xb64) = 3; if (isDarkRoom == '\0') { local_10c = s_Jump; } pbVar3 = *(byte **)((int)mole + 0x7c); if (pbVar3 != (byte *)0x0) { if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar6 = local_10c; do { bVar2 = *pbVar3; bVar9 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_004fe605: uVar4 = -(uint)bVar9 | 1; goto LAB_004fe60a; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar9 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_004fe605; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_004fe60a: if ((uVar4 == 0) && ((*(char *)(*(int *)((int)mole + 0x7c) + 0x34) == '\0' || (*(char *)((int)mole + 0x8c) != '\0')))) break; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)mole + 0x48),local_10c,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)mole + 0x78)); *(undefined1 *)((int)mole + 0x8c) = 1; } } Entity_NPC::UpdateDirtColor((Entity_NPC *)mole,0); fVar10 = *(float *)((int)mole + 0x334); if ((fVar10 != g_vectorZero.x) || (*(float *)((int)mole + 0x338) != g_vectorZero.y)) { if (*(int *)((int)mole + 0xb64) == 3) { fVar11 = *(float *)((int)mole + 0xbb0) + 0.04; if (fVar11 <= 0.0) { fVar11 = 0.0; } *(float *)((int)mole + 0x36c) = *(float *)((int)mole + 0x36c) * 0.4; if (1.0 <= fVar11) { fVar11 = 1.0; } *(float *)((int)mole + 0xbb0) = fVar11; fVar12 = (*(float *)((int)mole + 0x338) - *(float *)((int)mole + 0x340)) * fVar11; *(float *)((int)mole + 0x364) = fVar12; *(float *)((int)mole + 0x360) = ((fVar10 - *(float *)((int)mole + 0x33c)) * fVar11) / *(float *)((int)mole + 0x36c); *(float *)((int)mole + 0x364) = fVar12 / *(float *)((int)mole + 0x36c); } else { *(float *)((int)mole + 0x36c) = *(float *)((int)mole + 0x36c) * 0.8; *(float *)((int)mole + 0x364) = *(float *)((int)mole + 0x338) - *(float *)((int)mole + 0x340); *(float *)((int)mole + 0x360) = fVar10 - *(float *)((int)mole + 0x33c); iVar8 = (int)((*(float *)((int)mole + 0x33c) - 40.0) / 40.0 + 0.5); iVar7 = (int)((*(float *)((int)mole + 0x340) - 120.0) / 40.0 + 0.5); if ((((-1 < iVar8) && (iVar8 < savedRoom->_gridWidth)) && (-1 < iVar7)) && (((iVar7 < savedRoom->_gridHeight && (iVar8 = iVar7 * savedRoom->_gridWidth + iVar8, -1 < iVar8)) && (iVar8 < 0x1c0)))) { savedRoom->_gridPaths[iVar8] = 900; } } } ExceptionList = local_1c; return; } //@@ 004ff620 NpcAI::ENTITY_GYRO /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 824 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GYRO(Entity_NPC *npc) { Room *pRVar1; byte bVar2; Vector *controllerInput; Entity_Effect *splat; int iVar3; char *strBuf; std_string *currentAnimName; byte *animNameCursor; Entity_NPC *this; uint uVar4; undefined *allocSize; Entity *pEVar5; float *damageEvent; bool bVar6; Room *pRVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; double dVar13; undefined1 auStack_e8 [3]; char cStack_e5; Vector local_e4; Room *local_dc; Room *local_d8; Vector local_d4; Entity *local_cc; Vector local_c8; float playbackSpeed; float savedPosX; float savedPosY; float savedVelX; undefined4 local_b0 [8]; undefined4 local_90; undefined4 uStack_8c; undefined4 local_88; undefined4 auStack_84 [8]; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; byte local_58 [44]; char *pcStack_2c; char *pcStack_28; undefined *puStack_24; char *pcStack_20; undefined *puStack_1c; undefined *puStack_18; undefined4 *puStack_14; undefined *puStack_10; uint local_c; void *animData; undefined1 *animNameStart; float collisionVelX; char nameChar; local_c = __security_cookie ^ (uint)auStack_e8; local_e4.x = 0.0; pEVar5 = (Entity *)0x0; playbackSpeed = 1.0; local_d8 = g_game->_room; local_d4.x = 0.0; Entity_NPC::UpdateChargeBar(npc,-30.0,0.0,(float)npc->_i2,1); iVar3 = npc->_state; if (iVar3 == 0) { npc->_state = 4; npc->_i1 = 0; npc->_stateFrame = 0; uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } (npc->_v1).x = fVar8; (npc->_v1).y = 0.0; npc->_i2 = 0; npc->_projectileCooldown = 0; if (npc->_variant == 1) { local_90 = 0x3e109091; uStack_8c = 0x3df8f8f9; local_88 = 0x3de0e0e1; if (&npc->_splatColor != (ColorMod *)local_b0) { (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.14117648; (npc->_splatColor)._offset[1] = 0.12156863; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.10980392; } } } else if (iVar3 == 4) { npc->_friction = npc->_friction * 0.8; if ((((npc->_flags & 0x1000b00) == 0) && (pRVar7 = (Room *)&npc->_controllerID, npc->_controllerID == -1)) && (npc->_forcedTarget == (EntityPtr)0x0)) { if (0 < npc->_stateFrame) goto LAB_004ffbfb; iVar3 = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + npc->_stateFrame; npc->_stateFrame = iVar3; if (-1 < iVar3) { local_cc = Entity_NPC::GetPlayerTarget(npc); local_e4.x = (local_cc->_pos).x; local_e4.y = (local_cc->_pos).y; bVar2 = Room::CheckLine(local_d8,&npc->_pos,&local_e4,0,0,0,0,(Vector *)0x0); if ((bVar2 == 0) || (uVar4 = Random(), uVar4 % 3 != 0)) { uVar4 = Random(); fVar8 = normalize_angle_degrees ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0); } else { fVar8 = atan2f((local_cc->_pos).y - (npc->_pos).y,(local_cc->_pos).x - (npc->_pos).x); fVar8 = fVar8 * 57.295776; } (npc->_v1).y = fVar8; uVar4 = Random(); iVar3 = uVar4 % 0x28 + 10; goto LAB_00500130; } } else { npc->_stateFrame = 10; LAB_004ffbfb: pRVar7 = (Room *)&npc->_controllerID; local_cc = (Entity *)0x3f800000; local_dc = pRVar7; if (*(int *)pRVar7 == -1) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar2 == 0) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x100); if ((bVar2 == 0) && (npc->_forcedTarget == (EntityPtr)0x0)) { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar2 != 0) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); fVar8 = atan2f((npc->_pos).y - (pEVar5->_pos).y,(npc->_pos).x - (pEVar5->_pos).x); (npc->_v1).y = fVar8 * 57.295776; } } else { local_d4.x = (float)Entity_NPC::GetPlayerTarget(npc); bVar2 = Entity::IsFrame((Entity *)npc,5,npc->_index); if (bVar2 != 0) { savedPosX = (npc->_pos).x; savedPosY = (npc->_pos).y; savedVelX = (npc->_velocity).x; local_c8.x = (npc->_velocity).y; local_e4.x = npc->_friction; PathFinder::Reset((PathFinder *)&npc->_pathfinder); local_d4.y = ((Vector *)((int)local_d4.x + 0x33c))->y; local_d4.x = (float)((Vector *)((int)local_d4.x + 0x33c))->x; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_d4,1.0,900,1); fVar8 = atan2f((npc->_velocity).y,(npc->_velocity).x); (npc->_v1).y = fVar8 * 57.295776; (npc->_pos).x = savedPosX; (npc->_pos).y = savedPosY; (npc->_velocity).x = savedVelX; (npc->_velocity).y = local_c8.x; npc->_friction = local_e4.x; pRVar7 = local_dc; } } } else { uVar4 = Random(); if (uVar4 % 5 == 0) { uVar4 = Random(); fVar8 = normalize_angle_degrees ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0); (npc->_v1).y = fVar8; } } } else { controllerInput = Entity_NPC::GetControllerInput(npc,&local_e4,0.1); if ((controllerInput->x != g_vectorZero.x) || (controllerInput->y != g_vectorZero.y)) { controllerInput = Entity_NPC::GetControllerInput(npc,&local_e4,0.0); fVar8 = atan2f(controllerInput->y,controllerInput->x); (npc->_v1).y = fVar8 * 57.295776; } controllerInput = Entity_NPC::GetControllerInput(npc,&local_e4,0.0); local_cc = (Entity *) sqrtf(controllerInput->x * controllerInput->x + controllerInput->y * controllerInput->y); } npc->_stateFrame = npc->_stateFrame + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); local_e4.x = (npc->_v1).x * 0.017453292; local_d4.x = cos(local_e4.x); local_e4.x = sin(local_e4.x); fVar8 = npc->_speedMultiplier; (npc->_velocity).x = local_d4.x * 1.2 * (float)local_cc * fVar8 + (npc->_velocity).x; (npc->_velocity).y = local_e4.x * 1.2 * (float)local_cc * fVar8 + (npc->_velocity).y; if (*(int *)pRVar7 == -1) { fVar8 = 10.0; } else { fVar8 = 20.0; } fVar8 = approach_angle((npc->_v1).x,(npc->_v1).y,fVar8); (npc->_v1).x = fVar8; if ((npc->_collidesWithGrid != 0) && (uVar4 = Random(), (uVar4 & 3) == 0)) { fVar8 = (npc->_gridCollisionNormal).x; fVar12 = (npc->_gridCollisionNormal).y; fVar11 = fVar12 * local_e4.x + fVar8 * local_d4.x; fVar8 = atan2f(local_e4.x - (fVar12 + fVar12) * fVar11,local_d4.x - (fVar8 + fVar8) * fVar11 ); (npc->_v1).y = fVar8 * 57.295776; } pRVar1 = local_dc; if ((npc->_stateFrame < 1) && (pRVar7 = local_dc, npc->_variant == 0)) { uVar4 = Random(); iVar3 = -(uVar4 % 0x1e); pRVar7 = pRVar1; LAB_00500130: npc->_stateFrame = iVar3; } } fVar8 = (npc->_velocity).y; fVar12 = (npc->_velocity).x; fVar8 = sqrtf(fVar12 * fVar12 + fVar8 * fVar8); if (fVar8 <= 0.1) { local_d4.x = (float)s_Idle; } else { local_d4.x = (float)s_Walk; playbackSpeed = fVar8 * 0.5; if (fVar8 * 0.5 <= 0.0) { playbackSpeed = 0.0; } if (1.0 <= playbackSpeed) { playbackSpeed = 1.0; } } if (npc->_i2 < 0) { npc->_i2 = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + npc->_i2; } else if ((npc->_flags & 0x1000a00) == 0) { local_e4.x = (float)Entity_NPC::GetPlayerTarget(npc); if (*(int *)pRVar7 == -1) { local_c8.x = (((Entity *)local_e4.x)->_pos).x; local_c8.y = (((Entity *)local_e4.x)->_pos).y; bVar2 = Room::CheckLine(local_d8,&npc->_pos,&local_c8,0,0,0,0,(Vector *)0x0); } else { bVar2 = Entity_NPC::IsControllerActionPressed(npc,9); } if (bVar2 != 0) { local_dc = (Room *)(((Vector *)((int)local_e4.x + 0x33c))->x - (npc->_pos).x); local_cc = (Entity *)(((Vector *)((int)local_e4.x + 0x33c))->y - (npc->_pos).y); local_e4.x = (npc->_v1).x * 0.017453292; local_d8 = (Room *)cos(local_e4.x); pEVar5 = (Entity *)sin(local_e4.x); if (*(int *)pRVar7 != -1) { local_dc = local_d8; local_cc = pEVar5; } if ((0.7 < (float)pEVar5 * (float)local_cc + (float)local_d8 * (float)local_dc) && ((*(int *)pRVar7 != -1 || (uVar4 = Random(), uVar4 % 0xe == 0)))) { fVar8 = atan2f((float)local_cc,(float)local_dc); (npc->_v1).x = fVar8 * 57.295776; (npc->_v1).y = fVar8 * 57.295776; npc->_state = 8; Entity_NPC::PlaySound(npc,0x12d,1.0,0x1e,0,1.0); iVar3 = 0x3c; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (npc->_variant == 1) { iVar3 = 0x50; } npc->_i2 = iVar3; } } } uVar4 = Random(); pEVar5 = (Entity *)local_d4.x; if (uVar4 % 6 == 0) { uVar4 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); pEVar5 = (Entity *)local_d4.x; if (npc->_variant == 1) { local_58[0] = 0; local_58[1] = 0; local_58[2] = 0; local_58[3] = 0; local_58[4] = 0; local_58[5] = 0; local_58[6] = 0; local_58[7] = 0; local_58[8] = 0; local_58[9] = 0; local_58[10] = 0; local_58[0xb] = 0; local_58[0xc] = 0; local_58[0xd] = 0; local_58[0xe] = 0x80; local_58[0xf] = 0x3f; local_58[0x20] = 0x91; local_58[0x21] = 0x90; local_58[0x22] = 0x10; local_58[0x23] = 0x3e; local_58[0x10] = 0; local_58[0x11] = 0; local_58[0x12] = 0; local_58[0x13] = 0; local_58[0x14] = 0; local_58[0x15] = 0; local_58[0x16] = 0; local_58[0x17] = 0; local_58[0x18] = 0; local_58[0x19] = 0; local_58[0x1a] = 0; local_58[0x1b] = 0; local_58[0x1c] = 0; local_58[0x1d] = 0; local_58[0x1e] = 0; local_58[0x1f] = 0; local_58[0x24] = 0xf9; local_58[0x25] = 0xf8; local_58[0x26] = 0xf8; local_58[0x27] = 0x3d; local_58[0x28] = 0xe1; local_58[0x29] = 0xe0; local_58[0x2a] = 0xe0; local_58[0x2b] = 0x3d; (**(code **)(*(int *)splat + 0x3c))(local_58,0xffffffff,0xff,0); pEVar5 = (Entity *)local_d4.x; } } } else if (iVar3 == 8) { local_d4.x = (float)&DAT_00b1dd28; npc->_friction = npc->_friction * 0.96; local_d8 = (Room *)((npc->_v1).x * 0.017453292); local_dc = (Room *)cos((float)local_d8); local_d8 = (Room *)sin((float)local_d8); fVar8 = npc->_speedMultiplier; if (npc->_variant == 1) { (npc->_velocity).x = (float)local_dc * fVar8 + (npc->_velocity).x; pRVar7 = local_d8; } else { (npc->_velocity).x = (float)local_dc * 0.9 * fVar8 + (npc->_velocity).x; pRVar7 = (Room *)((float)local_d8 * 0.9); } (npc->_velocity).y = (float)pRVar7 * fVar8 + (npc->_velocity).y; pEVar5 = Entity_NPC::GetPlayerTarget(npc); fVar8 = atan2f((pEVar5->_pos).y - (npc->_pos).y,(pEVar5->_pos).x - (npc->_pos).x); (npc->_v1).y = fVar8 * 57.295776; fVar8 = 5.0; if (npc->_controllerID != -1) { controllerInput = Entity_NPC::GetControllerInput(npc,&local_e4,0.1); if ((controllerInput->x != g_vectorZero.x) || (controllerInput->y != g_vectorZero.y)) { controllerInput = Entity_NPC::GetControllerInput(npc,&local_e4,0.0); fVar8 = atan2f(controllerInput->y,controllerInput->x); (npc->_v1).y = fVar8 * 57.295776; } controllerInput = Entity_NPC::GetControllerInput(npc,&local_e4,0.0); fVar8 = sqrtf(controllerInput->x * controllerInput->x + controllerInput->y * controllerInput->y); fVar8 = fVar8 * 5.0; } fVar8 = approach_angle((npc->_v1).x,(npc->_v1).y,fVar8); (npc->_v1).x = fVar8; if (npc->_collidesWithGrid != 0) { fVar8 = (npc->_gridCollisionNormal).x; fVar12 = (npc->_gridCollisionNormal).y; fVar11 = fVar8 * (float)local_dc + (float)local_d8 * fVar12; if (0.4 <= fVar11) { if ((npc->_variant != 1) && (10 < npc->_i2)) { npc->_i2 = 10; } Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); fVar8 = (npc->_gridCollisionVelocity).y; collisionVelX = (npc->_gridCollisionVelocity).x; fVar12 = (npc->_gridCollisionNormal).x; fVar11 = (npc->_gridCollisionNormal).y; fVar10 = fVar8 * fVar11; fVar11 = fVar11 * 1.4; fVar9 = collisionVelX * fVar12; fVar12 = fVar12 * 1.4; } else { fVar8 = atan2f((float)local_d8 - (fVar12 + fVar12) * fVar11, (float)local_dc - (fVar8 + fVar8) * fVar11); (npc->_v1).x = fVar8 * 57.295776; Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); fVar8 = (npc->_gridCollisionVelocity).y; collisionVelX = (npc->_gridCollisionVelocity).x; fVar12 = (npc->_gridCollisionNormal).x; fVar11 = (npc->_gridCollisionNormal).y; fVar10 = fVar8 * fVar11; fVar11 = fVar11 * 1.8; fVar9 = collisionVelX * fVar12; fVar12 = fVar12 * 1.8; } (npc->_velocity).y = fVar8 - fVar11 * (fVar10 + fVar9); (npc->_velocity).x = collisionVelX - fVar12 * (fVar10 + fVar9); } npc->_i2 = npc->_i2 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); if ((npc->_i2 < 1) || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 != 0)) { if (npc->_controllerID == -1) { uVar4 = Random(); uVar4 = uVar4 % 0x1e; } else { uVar4 = 0; } npc->_i2 = -0x1e - uVar4; npc->_state = 4; } pEVar5 = (Entity *)&DAT_00b1dd28; if (((npc->_variant == 1) && (bVar2 = Entity::IsFrame((Entity *)npc,4,npc->_index), bVar2 != 0)) && (uVar4 = Random(), (uVar4 & 3) == 0)) { uVar4 = Random(); pEVar5 = Game::SpawnEx(g_game,0x21,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4,0); uVar4 = Random(); fVar8 = (pEVar5->_pos).y; pEVar5->_health = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.4) * pEVar5->_health; (pEVar5->_targetPosition).x = (pEVar5->_pos).x; (pEVar5->_targetPosition).y = fVar8; pEVar5 = (Entity *)local_d4.x; } uVar4 = Random(); if (uVar4 % 3 == 0) { uVar4 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); if (npc->_variant == 1) { local_58[0] = 0; local_58[1] = 0; local_58[2] = 0; local_58[3] = 0; local_58[4] = 0; local_58[5] = 0; local_58[6] = 0; local_58[7] = 0; local_58[8] = 0; local_58[9] = 0; local_58[10] = 0; local_58[0xb] = 0; local_58[0xc] = 0; local_58[0xd] = 0; local_58[0xe] = 0x80; local_58[0xf] = 0x3f; local_58[0x20] = 0x91; local_58[0x21] = 0x90; local_58[0x22] = 0x10; local_58[0x23] = 0x3e; local_58[0x10] = 0; local_58[0x11] = 0; local_58[0x12] = 0; local_58[0x13] = 0; local_58[0x14] = 0; local_58[0x15] = 0; local_58[0x16] = 0; local_58[0x17] = 0; local_58[0x18] = 0; local_58[0x19] = 0; local_58[0x1a] = 0; local_58[0x1b] = 0; local_58[0x1c] = 0; local_58[0x1d] = 0; local_58[0x1e] = 0; local_58[0x1f] = 0; local_58[0x24] = 0xf9; local_58[0x25] = 0xf8; local_58[0x26] = 0xf8; local_58[0x27] = 0x3d; local_58[0x28] = 0xe1; local_58[0x29] = 0xe0; local_58[0x2a] = 0xe0; local_58[0x2b] = 0x3d; (**(code **)(*(int *)splat + 0x3c))(local_58,0xffffffff,0xff,0); } } } if ((0.0 < npc->_pendingDamage) && (npc->_projectileCooldown < 1)) { iVar3 = 10; if (npc->_controllerID != -1) { iVar3 = 5; } npc->_projectileCooldown = iVar3; } iVar3 = npc->_projectileCooldown; if (0 < iVar3) { if (7 < iVar3) { npc->_friction = npc->_friction * 0.6; } npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar3; } if (pEVar5 == (Entity *)0x0) goto LAB_005008bc; animNameStart = &pEVar5->field_0x1; do { nameChar = *(char *)pEVar5; pEVar5 = (Entity *)&pEVar5->field_0x1; } while (nameChar != '\0'); animData = (npc->_sprite)._animState._animData; if (animData == (void *)0x0) { pcStack_2c = (char *)0x0; puStack_18 = (undefined *)0xf; puStack_1c = (undefined *)0x0; } else { std::string::string((char *)&pcStack_2c,animData); } strBuf = (char *)&pcStack_2c; if ((undefined *)0xf < puStack_18) { strBuf = pcStack_2c; } iVar3 = strncmp(strBuf,(char *)local_d4.x,(int)pEVar5 - (int)animNameStart); cStack_e5 = iVar3 == 0; if ((undefined *)0xf < puStack_18) { allocSize = puStack_18 + 1; strBuf = pcStack_2c; if ((undefined *)0xfff < allocSize) { strBuf = *(char **)(pcStack_2c + 0xfffffffc); allocSize = puStack_18 + 0x24; if ((char *)0x1f < pcStack_2c + (-4 - (int)strBuf)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(strBuf,(uint)allocSize); } if ((cStack_e5 == '\0') || ((npc->_sprite)._animState._animData == (void *)0x0)) { iVar3 = -1; } else { dVar13 = floor((double)(npc->_sprite)._animState._animFrame); iVar3 = (int)dVar13; } local_e4.x = (npc->_v1).x / 45.0 + 0.5; dVar13 = floor((double)local_e4.x); local_e4.x = (float)dVar13; uVar4 = (int)dVar13 + 8U & 0x80000007; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffff8) + 1; } pcStack_2c = "Left"; pcStack_28 = "LeftDown"; puStack_24 = &DAT_00b1cddc; pcStack_20 = "LeftDown"; puStack_1c = &DAT_00b1cdf0; puStack_18 = &DAT_00b60c20; puStack_14 = &DAT_00b1cde4; puStack_10 = &DAT_00b60c20; npc->_i1 = uVar4; sprintf(local_58,&DAT_00b60c28); fVar8 = (npc->_v1).x; if ((fVar8 < -90.0) || (90.0 < fVar8)) { bVar2 = 0; } else { bVar2 = 1; } (npc->_sprite)._flipX = bVar2; bVar6 = false; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_005007f3: cStack_e5 = '\x01'; if (bVar6) goto LAB_005007fc; LAB_00500841: ANM2::Play(&npc->_sprite,local_58,0); if ((-1 < iVar3) && ((npc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)iVar3); } } else { currentAnimName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)&pcStack_2c); local_e4.x = 4.2039e-45; if (0xf < currentAnimName->_capacity) { currentAnimName = *(std_string **)currentAnimName->_buf; } animNameCursor = local_58; do { bVar2 = currentAnimName->_buf[0]; bVar6 = bVar2 < *animNameCursor; if (bVar2 != *animNameCursor) { LAB_005007e0: uVar4 = -(uint)bVar6 | 1; goto LAB_005007e5; } if (bVar2 == 0) break; bVar2 = currentAnimName->_buf[1]; bVar6 = bVar2 < animNameCursor[1]; if (bVar2 != animNameCursor[1]) goto LAB_005007e0; currentAnimName = (std_string *)(currentAnimName->_buf + 2); animNameCursor = animNameCursor + 2; } while (bVar2 != 0); uVar4 = 0; LAB_005007e5: if (uVar4 != 0) { bVar6 = true; goto LAB_005007f3; } cStack_e5 = '\0'; LAB_005007fc: if ((undefined *)0xf < puStack_18) { allocSize = puStack_18 + 1; strBuf = pcStack_2c; if ((undefined *)0xfff < allocSize) { strBuf = *(char **)(pcStack_2c + 0xfffffffc); allocSize = puStack_18 + 0x24; if ((char *)0x1f < pcStack_2c + (-4 - (int)strBuf)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(strBuf,(uint)allocSize); } if (cStack_e5 != '\0') goto LAB_00500841; } (npc->_sprite)._playbackSpeed = playbackSpeed; local_e4.x = (npc->_v1).x * 0.017453292; local_c8.x = cos(local_e4.x); fVar8 = sin(local_e4.x); (npc->_forwardVector).x = local_c8.x; (npc->_forwardVector).y = fVar8; LAB_005008bc: damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { if (((uint)damageEvent[2] & 2) != 0) { npc->_pendingDamage = npc->_pendingDamage - *damageEvent; *damageEvent = 0.0; bVar2 = Entity::IsType((Entity *)npc,0x338,0,-1); if (bVar2 != 0) { Entity_NPC::Morph(this,0x338,1,0,-1); uStack_64 = 0x3e109091; uStack_60 = 0x3df8f8f9; uStack_5c = 0x3de0e0e1; if (&npc->_splatColor != (ColorMod *)auStack_84) { (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.14117648; (npc->_splatColor)._offset[1] = 0.12156863; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.10980392; } } } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } return; } //@@ 00500990 NpcAI::ENTITY_FIRE_WORM /* NPC AI for entity type 825 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FIRE_WORM(Entity_NPC *npc) { byte bVar1; int iVar2; Vector *pVVar3; Entity *pEVar4; uint uVar5; EntityRef *pEVar6; float fVar7; float fVar8; Vector VStack_48; Vector VStack_40; Vector VStack_38; EntityRef killRef; float friction; EntityPtr *parentSlot; Room *room; int *roomData; room = g_game->_room; switch(npc->_state) { case 0: npc->_state = 3; pVVar3 = &npc->_pos; (npc->_targetPosition).x = pVVar3->x; (npc->_targetPosition).y = (npc->_pos).y; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)&DAT_00c34d4c); iVar2 = Entity_NPC::FindTargetPit(pVVar3,pVVar3,0xffffffff); if (iVar2 < 0) { (**(code **)(*(int *)npc + 0x28))(); } else { npc->_i1 = iVar2; if (iVar2 < 0x1c0) { *(undefined2 *)((int)room->_gridPaths + iVar2 * 2 + 0x700) = 5; iVar2 = npc->_i1; } fVar8 = (float)(iVar2 % room->_gridWidth) * 40.0 + 40.0; fVar7 = (float)(iVar2 / room->_gridWidth) * 40.0 + 120.0; pVVar3->x = fVar8; (npc->_targetPosition).x = fVar8; (npc->_pos).y = fVar7; (npc->_targetPosition).y = fVar7; } break; case 3: ANM2::Play(&npc->_sprite,(byte *)"DigIn",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = -1; if (npc->_pendingDamage < npc->_health) { npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_entityCollisionClass = 0; npc->_visible = 0; } else { npc->_state = 6; } } break; case 4: iVar2 = Room::GetGridIndex(room,&npc->_pos); pVVar3 = Entity_NPC::CalcTargetPosition(npc,&VStack_38,0.0); VStack_38.x = (float)Entity_NPC::FindTargetPit(&npc->_pos,pVVar3,iVar2); if ((int)VStack_38.x < 0) { (**(code **)(*(int *)npc + 0x28))(); return; } VStack_48.x = (float)((int)VStack_38.x % room->_gridWidth) * 40.0 + 40.0; VStack_40.x = (float)((int)VStack_38.x / room->_gridWidth) * 40.0 + 120.0; pEVar4 = Entity_NPC::GetPlayerTarget(npc); iVar2 = Room::GetGridCollisionAtPos(room,pEVar4->_pos); fVar7 = (npc->_pos).y - (pEVar4->_pos).y; fVar8 = (npc->_pos).x - (pEVar4->_pos).x; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); uVar5 = Random(); if (((uVar5 & 1) == 0) && (((iVar2 != 1 || (100.0 < fVar7)) && (fVar7 < 1000.0)))) { (npc->_targetPosition).x = VStack_48.x; (npc->_targetPosition).y = VStack_40.x; (npc->_pos).x = VStack_48.x; (npc->_pos).y = VStack_40.x; } if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y) ) { npc->_i1 = (int)VStack_38.x; if ((uint)VStack_38.x < 0x1c0) { *(undefined2 *)((int)room->_gridPaths + (int)VStack_38.x * 2 + 0x700) = 5; } npc->_state = 6; npc->_visible = 1; } break; case 6: ANM2::Play(&npc->_sprite,(byte *)"DigOut",0); uVar5 = npc->_i1; npc->_entityCollisionClass = 4; if (-1 < (int)uVar5) { roomData = *(int **)((int)room->_descriptor + 0x10); if (((roomData != (int *)0x0) && (roomData[2] == 0x10)) && (*roomData == 0x23)) { LAB_00500f32: pEVar6 = EntityRef::EntityRef(&killRef); (**(code **)(*(int *)npc + 0x24))(pEVar6); return; } if (room->_gridEntities[uVar5] == (void *)0x0) { if ((room->_gridPaths[uVar5] < 3000) || (3999 < room->_gridPaths[uVar5])) goto LAB_00500f32; } else if (*(int *)((int)room->_gridEntities[uVar5] + 0x3c) != 1) goto LAB_00500f32; if (uVar5 < 0x1c0) { *(undefined2 *)((int)room->_gridPaths + uVar5 * 2 + 0x700) = 5; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); VStack_48.x = (pEVar4->_pos).x; VStack_48.y = (pEVar4->_pos).y; VStack_40.x = VStack_48.y; VStack_38.x = VStack_48.x; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar1 == 0) { pVVar3 = &npc->_pos; bVar1 = Room::CheckLine(room,pVVar3,&VStack_48,3,999,0,0,(Vector *)0x0); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); VStack_38.x = VStack_38.x - pVVar3->x; VStack_38.y = VStack_40.x - (npc->_pos).y; Vector::Normalized(&VStack_38,&VStack_40); uVar5 = Random(); VStack_38.x = VStack_40.x * 14.0; VStack_48.x = VStack_40.x * 10.0 + pVVar3->x; VStack_38.y = VStack_40.y * 14.0; VStack_48.y = VStack_40.y * 10.0 + (npc->_pos).y; pEVar4 = Game::SpawnEx(g_game,0x21,10,&VStack_48,&VStack_38,(Entity *)npc,1,uVar5,0); parentSlot = &pEVar4->_parent; if (pEVar4->_parent != (EntityPtr)0x0) { VStack_38.x = (float)parentSlot; std::multiset::erase(&VStack_38); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); } } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 3; } fVar7 = (npc->_targetPosition).x; if ((fVar7 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { fVar8 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; friction = npc->_friction; (npc->_velocity).x = fVar7 - fVar8; npc->_friction = friction * 0.8; } return; } //@@ 00500f70 NpcAI::ENTITY_HARDY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 826 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HARDY(Entity_NPC *npc) { Vector pos; byte bVar1; int iVar2; GridEntity *hitGrid; uint uVar3; uint uVar4; EntityRef *sourceRef; Vector *vecResult; float *damageEvent; uint uVar5; Entity *tmpEntity; float fVar6; Entity_Player *pEVar7; Room *pRVar8; code *pcVar9; float fVar10; undefined1 auStack_138 [4]; code *pcStack_134; Room *local_130; Vector VStack_12c; Vector VStack_124; Vector VStack_11c; Vector VStack_114; Vector VStack_10c; ColorMod CStack_104; ProjectileParams projParams; byte animName [32]; uint local_c; float *damageEventsEnd; Manager *manager; float speedMultiplier; local_c = __security_cookie ^ (uint)auStack_138; local_130 = g_game->_room; npc->_friction = npc->_friction * 0.95; switch(npc->_state) { case 0: CStack_104._tint[0] = 0.0; CStack_104._tint[1] = 0.0; CStack_104._tint[2] = 0.0; CStack_104._tint[3] = 1.0; npc->_stateFrame = 0; npc->_state = 3; CStack_104._colorize[0] = 0.0; CStack_104._colorize[1] = 0.0; CStack_104._colorize[2] = 0.0; CStack_104._colorize[3] = 0.0; CStack_104._offset[0] = 0.11764706; CStack_104._offset[1] = 0.11764706; CStack_104._offset[2] = 0.11764706; Color::operator_assign((Color *)&npc->_splatColor,&CStack_104); break; case 3: sprintf(animName,(byte *)"Idle%d"); ANM2::Play(&npc->_sprite,animName,0); if (0 < npc->_stateFrame) { npc->_stateFrame = npc->_stateFrame + -1; } uVar5 = Random(); if (((uVar5 % 5 == 0) && (bVar1 = Entity::IsFrame((Entity *)npc,5,npc->_index), bVar1 != 0)) && (npc->_stateFrame < 1)) { npc->_i2 = 0; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar1 == 0) { bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar1 == 0) { npc->_state = 8; } else { npc->_i1 = 0; npc->_state = 6; sprintf(animName,(byte *)"Slide%d"); ANM2::Play(&npc->_sprite,animName,0); vecResult = MusicManager::RandomVector(&VStack_114); (npc->_velocity).x = vecResult->x; (npc->_velocity).y = vecResult->y; } } else { npc->_i1 = 0; npc->_state = 6; sprintf(animName,(byte *)"Slide%d"); ANM2::Play(&npc->_sprite,animName,0); vecResult = Entity_NPC::CalcTargetPosition(npc,&VStack_114,1.0); fVar6 = vecResult->y; fVar10 = (npc->_pos).y; (npc->_velocity).x = vecResult->x - (npc->_pos).x; (npc->_velocity).y = fVar6 - fVar10; } } npc->_friction = npc->_friction * 0.5; break; case 4: case 6: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { sprintf(animName,(byte *)"Slide%d"); } ANM2::Play(&npc->_sprite,animName,0); iVar2 = npc->_i1 + 1; npc->_i1 = iVar2; if ((npc->_i2 < 1) || (iVar2 < 0x1e)) { pcStack_134 = (code *)(npc->_velocity).x; VStack_124.x = (npc->_velocity).y; fVar6 = sqrtf((float)pcStack_134 * (float)pcStack_134 + VStack_124.x * VStack_124.x); pEVar7 = (Entity_Player *)VStack_124.x; pcVar9 = pcStack_134; if (0.0 < fVar6) { pEVar7 = (Entity_Player *)(VStack_124.x * (1.0 / fVar6)); pcVar9 = (code *)((float)pcStack_134 * (1.0 / fVar6)); } fVar6 = npc->_friction; if (fVar6 != 0.0) { fVar10 = npc->_speedMultiplier; (npc->_velocity).y = (fVar10 * (float)pEVar7 * 0.7) / fVar6 + (npc->_velocity).y; (npc->_velocity).x = (fVar10 * (float)pcVar9 * 0.7) / fVar6 + (npc->_velocity).x; } } else { fVar6 = (npc->_velocity).y; fVar10 = (npc->_velocity).x; fVar6 = sqrtf(fVar10 * fVar10 + fVar6 * fVar6); if (fVar6 < 1.0) { npc->_state = 3; } else if (fVar6 < 9.0) { npc->_friction = npc->_friction * 0.8; } } uVar5 = Random(); if ((uVar5 & 1) == 0) { CStack_104._offset[0] = 0.0; CStack_104._colorize[0] = 0.0; CStack_104._colorize[1] = 0.0; CStack_104._colorize[2] = 0.0; CStack_104._colorize[3] = 0.0; CStack_104._offset[1] = 0.0; CStack_104._offset[2] = 0.0; CStack_104._tint[0] = 0.54901963; CStack_104._tint[1] = 0.48235294; CStack_104._tint[2] = 0.48235294; CStack_104._tint[3] = 1.0; MusicManager::RandomVector(&VStack_12c); uVar5 = Random(); fVar6 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; pcStack_134 = (code *)(fVar6 + fVar6 + 1.0); uVar5 = Random(); fVar6 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; VStack_124.x = VStack_12c.x * fVar6 * npc->_size + (npc->_pos).x; VStack_124.y = VStack_12c.y * fVar6 * npc->_size + (npc->_pos).y; uVar5 = Random(); VStack_11c.x = VStack_12c.x * (float)pcStack_134; VStack_11c.y = VStack_12c.y * (float)pcStack_134; tmpEntity = Game::SpawnEx(g_game,1000,0x23,&VStack_124,&VStack_11c,(Entity *)0x0,0,uVar5,0); iVar2 = *(int *)tmpEntity; (tmpEntity->_posOffset).x = (npc->_posOffset).x; (tmpEntity->_posOffset).y = (npc->_posOffset).y; (**(code **)(iVar2 + 0x3c))(&CStack_104,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); } if (npc->_collidesWithGrid != 0) { VStack_12c.x = (npc->_gridCollisionNormal).x * npc->_size + (npc->_gridCollisionVelocity).x + (npc->_pos).x; VStack_12c.y = (npc->_gridCollisionVelocity).y + (npc->_pos).y + (npc->_gridCollisionNormal).y * npc->_size; pos.y = VStack_12c.y; pos.x = VStack_12c.x; pcStack_134 = (code *)Room::GetGridCollisionAtPos(local_130,pos); if (((npc->_state != 6) && (vecResult = Vector::Normalized(&npc->_gridCollisionVelocity,&VStack_114), manager = g_manager, 0.5 < (npc->_gridCollisionNormal).y * vecResult->y + (npc->_gridCollisionNormal).x * vecResult->x)) && ((pcStack_134 == (code *)0x3 || (pcStack_134 == (code *)&DAT_00000004)))) { pcStack_134 = (code *)0x34; seed_fart_sound_override((int *)&pcStack_134); SoundEffects::Play(&manager->_sfxManager,(int)pcStack_134,1.0,0x1e,0,1.0,0.0); Game::ShakeScreen(g_game,0xc); hitGrid = Room::GetGridEntityFromPos(local_130,&VStack_12c); if (hitGrid != (GridEntity *)0x0) { CStack_104._colorize[0] = (npc->_pos).x; CStack_104._colorize[1] = (npc->_pos).y; pcStack_134 = *(code **)(*(int *)hitGrid + 0x14); CStack_104._tint[0] = (float)npc->_type; CStack_104._tint[2] = (float)npc->_spawnerType; CStack_104._tint[3] = (float)npc->_spawnerVariant; CStack_104._tint[1] = (float)npc->_variant; CStack_104._colorize[2] = (npc->_velocity).x; CStack_104._colorize[3] = (npc->_velocity).y; local_130 = (Room *)(uint)((npc->_flags & 0x100) != 0); if ((npc->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar3 = 0; } else { uVar3 = 4; } CStack_104._offset[0] = (float)(uVar3 | uVar5 | (uint)local_130); CStack_104._offset[1] = (float)npc; (*pcStack_134)(0,&CStack_104); } tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_12c.x = (tmpEntity->_pos).x; VStack_12c.y = (tmpEntity->_pos).y; bVar1 = Entity::IsFriendly((Entity *)npc); if ((bVar1 == 0) && (uVar5 = 0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { VStack_124.x = (float)Game::GetPlayer(g_game,uVar5); pcStack_134 = (code *)((((Entity_Player *)VStack_124.x)->_pos).y - (npc->_pos).y); local_130 = (Room *)((((Entity_Player *)VStack_124.x)->_pos).x - (npc->_pos).x); fVar6 = sqrtf((float)pcStack_134 * (float)pcStack_134 + (float)local_130 * (float)local_130); if (fVar6 <= 0.0) { pRVar8 = local_130; pcVar9 = pcStack_134; } else { pRVar8 = (Room *)((float)local_130 * (1.0 / fVar6)); pcVar9 = (code *)((float)pcStack_134 * (1.0 / fVar6)); } if (fVar6 < 90.0) { VStack_11c.y = (float)pcVar9 * 3.0; CStack_104._colorize[1] = (npc->_pos).y; VStack_11c.x = (float)pRVar8 * 3.0; pcStack_134 = *(code **)(*(int *)VStack_124.x + 0x54); CStack_104._colorize[0] = (npc->_pos).x; CStack_104._tint[0] = (float)npc->_type; CStack_104._tint[1] = (float)npc->_variant; CStack_104._tint[2] = (float)npc->_spawnerType; CStack_104._tint[3] = (float)npc->_spawnerVariant; CStack_104._colorize[2] = (npc->_velocity).x; CStack_104._colorize[3] = (npc->_velocity).y; local_130 = (Room *)(uint)((npc->_flags & 0x100) != 0); if ((npc->_flags & 0x20000000) == 0) { uVar3 = 0; } else { uVar3 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } CStack_104._offset[0] = (float)(uVar4 | uVar3 | (uint)local_130); CStack_104._offset[1] = (float)npc; (*pcStack_134)(&CStack_104,&VStack_11c,0x40c00000); } uVar5 = uVar5 + 1; } while (uVar5 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } if (npc->_subtype == 0) { npc->_subtype = 1; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 9; VStack_12c.x = 10.0; VStack_12c.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&VStack_12c,8,&projParams); } else if (npc->_subtype == 1) { npc->_subtype = 2; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 9; VStack_11c.x = 10.0; VStack_11c.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&VStack_11c,8,&projParams); Entity_NPC::FireBossProjectiles(npc,6,&VStack_12c,0.0,&projParams); } else { sourceRef = EntityRef::EntityRef((EntityRef *)&CStack_104); (**(code **)(*(int *)npc + 0x24))(sourceRef); ProjectileParams::ProjectileParams(&projParams); projParams.Scale = projParams.Scale * 1.2; projParams.Variant = 9; projParams.BulletFlags._0_4_ = 0x10000; projParams.BulletFlags._4_4_ = 0; Entity_NPC::FireBossProjectiles(npc,8,&VStack_12c,0.0,&projParams); uVar5 = Random(); local_130 = (Room *)((uVar5 & 1) + 2); do { VStack_11c.x = -(npc->_gridCollisionNormal).x; VStack_12c.x = -(npc->_gridCollisionNormal).y; uVar5 = Random(); pcStack_134 = (code *)(((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 120.0 * 0.017453292); VStack_124.x = cos((float)pcStack_134); fVar6 = sin((float)pcStack_134); fVar10 = VStack_124.x * VStack_12c.x; VStack_12c.x = VStack_124.x * VStack_11c.x - fVar6 * VStack_12c.x; VStack_124.x = fVar10 + fVar6 * VStack_11c.x; VStack_114.x = VStack_12c.x * 20.0 + (npc->_pos).x; VStack_114.y = VStack_124.x * 20.0 + (npc->_pos).y; uVar5 = Random(); fVar6 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; VStack_10c.y = fVar6 + fVar6 + 1.0; VStack_10c.x = VStack_12c.x * VStack_10c.y; VStack_10c.y = VStack_124.x * VStack_10c.y; Entity_NPC::ThrowRockSpider(&VStack_114,&VStack_10c,(Entity *)npc,0,-10.0); local_130 = (Room *)((int)local_130 + -1); } while (local_130 != (Room *)0x0); } npc->_state = 0x10; } npc->_i2 = npc->_i2 + 1; } if (4 < npc->_i2) { npc->_friction = npc->_friction * 0.6; } break; case 8: sprintf(animName,(byte *)"Attack%d"); ANM2::Play(&npc->_sprite,animName,0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Slide"), bVar1 != 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_114.x = (tmpEntity->_pos).x - (npc->_pos).x; VStack_114.y = (tmpEntity->_pos).y - (npc->_pos).y; vecResult = Vector::Normalized(&VStack_114,&VStack_10c); fVar6 = npc->_friction; fVar10 = vecResult->x; if (fVar6 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * vecResult->y * 20.0) / fVar6 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * fVar10 * 20.0) / fVar6 + (npc->_velocity).x; } Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.1); npc->_i1 = 0; npc->_state = 4; } break; case 0x10: sprintf(animName,(byte *)"Hit%d"); ANM2::Play(&npc->_sprite,animName,0); npc->_friction = npc->_friction * 0.6; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_stateFrame = 0x3c; npc->_state = 3; } } damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { if (((uint)damageEvent[2] & 0x1000004) != 0) { npc->_pendingDamage = npc->_pendingDamage - *damageEvent; fVar6 = *damageEvent; *damageEvent = fVar6 * 2.5; npc->_pendingDamage = fVar6 * 2.5 + npc->_pendingDamage; } } if (npc->_dead != 0) { uVar5 = Random(); tmpEntity = Game::SpawnEx(g_game,0xd9,0,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); fVar6 = tmpEntity->_maxHitPoints + tmpEntity->_maxHitPoints; tmpEntity->_maxHitPoints = fVar6; tmpEntity->_health = fVar6; } if (npc->_state != 0x10) { (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } return; } //@@ 00501e10 NpcHelper::bouncer_death_gib /* DB: Entity_Effect::CreateTimer callback (3 calls, 4 apart) in NpcAI::ENTITY_BOUNCER 00501f30 inflated death: a 1000.2 blood gib at the timer position, velocity RandomVector * 12 rand, sprite offset y -26 (pass9_u2) */ void NpcHelper::bouncer_death_gib(int param_1) { uint uVar1; Entity *pEVar2; float fVar3; Vector local_20; float local_18; float local_14; Vector local_10; uVar1 = Random(); local_20.x = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20.x = local_20.x + local_20.x; uVar1 = Random(); local_18 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 12.0; local_14 = cos(local_20.x); local_14 = local_14 * local_18; local_10.x = local_14; fVar3 = sin(local_20.x); local_18 = fVar3 * local_18; local_10.y = local_18; uVar1 = Random(); local_20.x = *(float *)(param_1 + 0x33c); local_20.y = *(float *)(param_1 + 0x340); pEVar2 = Game::SpawnEx(g_game,1000,2,&local_20,&local_10,(Entity *)0x0,3,uVar1,0); (pEVar2->_sprite)._offset.x = local_14 + 0.0; (pEVar2->_sprite)._offset.y = local_18 - 26.0; return; } //@@ 00501f30 NpcAI::ENTITY_BOUNCER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 822 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BOUNCER(Entity_NPC *npc) { double dVar1; byte bVar2; Vector *targetPos; char *pcVar3; LayerState *layer; Entity_Effect *gibTimer; ProjectileParams *params; uint uVar4; Entity_Projectile *projectile; void *freeBlock; float inflateDelay; float fVar5; Vector shotVelocity; Vector projVelocity; Vector scratchPos; undefined1 *local_1ac; ProjectileParams deathParams; ProjectileParams burstParams; void *walkVertAnim; char local_50 [12]; uint walkVertAnimSize; uint walkVertAnimCapacity; void *walkHoriAnim; char local_38 [12]; uint walkHoriAnimSize; uint walkHoriAnimCapacity; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; float pendingDamage; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af40f5; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; local_1ac = (undefined1 *)0x3f800000; pcVar3 = local_38 + 0x34; switch(npc->_state) { case 0: puStack_20 = local_38 + 0x34; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAppear",0); bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } npc->_state = 3; npc->_stateFrame = 0; uVar4 = Random(); (npc->_v1).x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 6.0; pcVar3 = puStack_20; break; case 3: bVar2 = 0; puStack_20 = local_38 + 0x34; targetPos = Entity_NPC::CalcTargetPosition(npc,&scratchPos,0.0); PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,targetPos,bVar2); if ((0 < (npc->_pathfinder)._evadeMovementCountdown) && (10 < g_game->_frameCount - npc->_spawnFrame)) { uVar4 = Random(); Entity_NPC::PlaySound(npc,0x8f,1.0,uVar4 % 100 + 0x2d,0,1.0); } walkVertAnimCapacity = 0xf; walkVertAnimSize = 8; walkVertAnim = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&walkVertAnim,0.1); local_14 = local_14 & 0xffffff00; if (0xf < walkHoriAnimCapacity) { uVar4 = walkHoriAnimCapacity + 1; freeBlock = walkHoriAnim; if (0xfff < uVar4) { freeBlock = *(void **)((int)walkHoriAnim + -4); uVar4 = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)freeBlock))) goto LAB_00502184; } operator_delete(freeBlock,uVar4); } local_14 = 0xffffffff; walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < walkVertAnimCapacity) { uVar4 = walkVertAnimCapacity + 1; freeBlock = walkVertAnim; if (0xfff < uVar4) { freeBlock = *(void **)((int)walkVertAnim + -4); uVar4 = walkVertAnimCapacity + 0x24; if (0x1f < (uint)((int)walkVertAnim + (-4 - (int)freeBlock))) { LAB_00502184: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadWalkVert",1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } else { pcVar3 = "HeadWalkHori"; if (ABS((npc->_velocity).x) <= ABS((npc->_velocity).y)) { pcVar3 = "HeadWalkVert"; } ANM2::PlayOverlay(&npc->_sprite,(byte *)pcVar3,0); } if ((((0x1e < g_game->_frameCount - npc->_spawnFrame) && (0 < (npc->_pathfinder)._evadeMovementCountdown)) && ((npc->_v1).x <= 0.0)) && (uVar4 = Random(), uVar4 % 0x14 == 0)) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadInflate",0); npc->_state = 8; } inflateDelay = (npc->_v1).x; if (0.0 < inflateDelay) { inflateDelay = inflateDelay - 0.033333335; pendingDamage = npc->_pendingDamage; (npc->_v1).x = inflateDelay; if (0.0 < pendingDamage) { inflateDelay = inflateDelay - pendingDamage / 3.5; if (inflateDelay <= 0.0) { inflateDelay = 0.0; } (npc->_v1).x = inflateDelay; } } npc->_friction = npc->_friction * 0.8; pcVar3 = puStack_20; break; case 8: walkVertAnimCapacity = 0xf; walkVertAnimSize = 8; walkVertAnim = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 3; puStack_20 = local_38 + 0x34; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&walkVertAnim,0.1); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < walkHoriAnimCapacity) { uVar4 = walkHoriAnimCapacity + 1; freeBlock = walkHoriAnim; if (0xfff < uVar4) { freeBlock = *(void **)((int)walkHoriAnim + -4); uVar4 = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)freeBlock))) goto LAB_00502394; } operator_delete(freeBlock,uVar4); } local_14 = 0xffffffff; walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < walkVertAnimCapacity) { uVar4 = walkVertAnimCapacity + 1; freeBlock = walkVertAnim; if (0xfff < uVar4) { freeBlock = *(void **)((int)walkVertAnim + -4); uVar4 = walkVertAnimCapacity + 0x24; if (0x1f < (uint)((int)walkVertAnim + (-4 - (int)freeBlock))) { LAB_00502394: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); } bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Inflate"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x1e4,1.0,0x1e,0,1.0); npc->_state = 0x10; npc->_size = npc->_size * 1.5; } goto LAB_00502522; case 0x10: walkVertAnimCapacity = 0xf; walkVertAnimSize = 8; walkVertAnim = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 5; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&walkVertAnim,0.1); local_14 = CONCAT31(local_14._1_3_,4); if (0xf < walkHoriAnimCapacity) { uVar4 = walkHoriAnimCapacity + 1; freeBlock = walkHoriAnim; if (0xfff < uVar4) { freeBlock = *(void **)((int)walkHoriAnim + -4); uVar4 = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)freeBlock))) goto LAB_005024de; } operator_delete(freeBlock,uVar4); } local_14 = 0xffffffff; walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < walkVertAnimCapacity) { uVar4 = walkVertAnimCapacity + 1; freeBlock = walkVertAnim; if (0xfff < uVar4) { freeBlock = *(void **)((int)walkVertAnim + -4); uVar4 = walkVertAnimCapacity + 0x24; if (0x1f < (uint)((int)walkVertAnim + (-4 - (int)freeBlock))) { LAB_005024de: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); } walkVertAnimSize = 0; walkVertAnimCapacity = 0xf; walkVertAnim = (void *)((uint)walkVertAnim & 0xffffff00); if (npc->_stateFrame != 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::SetOverlayFrame(&npc->_sprite,(byte *)"HeadWalkInflated",0); } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadWalkInflated",0); } if ((g_game->_frameCount - npc->_spawnFrame & 1U) != 0) { local_1ac = &DAT_bf800000; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_pos).x = (float)local_1ac; Entity_NPC::CalcTargetPosition(npc,&scratchPos,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchPos,0.9,900,1); pcVar3 = puStack_20; break; } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_stateFrame = 1; } LAB_00502522: npc->_friction = npc->_friction * 0.6; pcVar3 = puStack_20; } puStack_20 = pcVar3; manager = g_manager; if (npc->_dead != 0) { if (npc->_state == 0x10) { local_1ac = (undefined1 *)0x8d; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.5,0.0); Game::ShakeScreen(g_game,6); Game::ButterBeanFart(g_game,&npc->_pos,120.0,(Entity *)npc,0,0); gibTimer = Entity_Effect::CreateTimer(NpcHelper::bouncer_death_gib,3,4,0); (gibTimer->_pos).x = (npc->_pos).x; (gibTimer->_pos).y = (npc->_pos).y; Game::ShakeScreen(g_game,8); params = ProjectileParams::ProjectileParams(&burstParams); Entity_NPC::FireBossProjectiles(npc,0xc,&g_vectorZero,0.0,params); local_1ac = (undefined1 *)0x16; do { uVar4 = Random(); inflateDelay = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; inflateDelay = inflateDelay + inflateDelay; pendingDamage = cos(inflateDelay); inflateDelay = sin(inflateDelay); uVar4 = Random(); scratchPos.x = pendingDamage * 5.0 + (npc->_pos).x; fVar5 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; projVelocity.x = pendingDamage * 15.0 * fVar5; scratchPos.y = inflateDelay * 5.0 + (npc->_pos).y; projVelocity.y = inflateDelay * 15.0 * fVar5; uVar4 = Random(); projectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,&scratchPos,&projVelocity,(Entity *)npc,0,uVar4); uVar4 = Random(); projectile->_fallingSpeed = 0.0; projectile->_height = -22.0 - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 8.0; uVar4 = Random(); projectile->_fallingAccel = -0.06 - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.030000005; uVar4 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]; projectile->_acceleration = 0.9; *(undefined4 *)&projectile->_projectileFlags = 0; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = 0x20; projectile->_scale = (float)((double)(int)uVar4 + dVar1) * 2.3283064e-10 * 1.1999999 + 0.6; Entity_NPC::fire_projectile_from_params(npc,projectile); (**(code **)(*(int *)projectile + 0xc))(); local_1ac = local_1ac + -1; } while (local_1ac != (undefined1 *)0x0); } else if ((npc->_flags & 0x1000000) == 0) { params = ProjectileParams::ProjectileParams(&deathParams); shotVelocity.x = 10.0; shotVelocity.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVelocity,7,params); } } ExceptionList = local_1c; return; } //@@ 00502980 NpcAI::ENTITY_FLESH_MAIDEN /* NPC AI for entity type 880 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FLESH_MAIDEN(Entity_NPC *npc) { byte bVar1; int iVar2; float *pfVar3; uint rngResult; Vector *pVVar4; byte *curAnimName; char *anim; float *pfVar5; LayerState *headLayer; Entity *target; float fVar6; float fVar7; float fVar8; float fVar9; undefined4 local_5c [8]; undefined4 local_3c; undefined4 uStack_38; undefined4 local_34; Vector local_30; float local_28; float local_24; float local_20; float local_1c; float local_18; float local_14; float local_10; float local_c; char isAlreadySwinging; void *animData; iVar2 = 4; npc->_friction = npc->_friction * 0.7; if ((npc->_flags & 0x20000100) == 0) { iVar2 = 2; } npc->_entityCollisionClass = iVar2; iVar2 = npc->_state; if (iVar2 == 0) { local_3c = 0; uStack_38 = 0; local_34 = 0; if (&npc->_splatColor != (ColorMod *)local_5c) { (npc->_splatColor)._tint[0] = 0.9; (npc->_splatColor)._tint[1] = 0.9; (npc->_splatColor)._tint[2] = 0.9; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = (float)0x3f666666; (npc->_splatColor)._colorize[1] = (float)0x3f666666; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 0.3; (npc->_splatColor)._offset[2] = 0.0; } npc->_i1 = (npc->_initSeed & 1U) * 2 + -1; } else { if (iVar2 == 3) { rngResult = Random(); local_20 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 20.0 + 110.0; rngResult = Random(); local_1c = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 20.0 + 110.0; if ((npc->_flags & 0x1000a00) == 0) { target = Entity_NPC::GetPlayerTarget(npc); local_18 = (target->_velocity).x; local_14 = (target->_velocity).y; fVar8 = (npc->_pos).y - (target->_pos).y; fVar7 = (npc->_pos).x - (target->_pos).x; fVar8 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); local_18 = local_18 * 0.1 * fVar8 + (target->_pos).x; local_14 = local_14 * 0.1 * fVar8 + (target->_pos).y; } else { pVVar4 = Entity_NPC::CalcTargetPosition(npc,&local_30,0.0); local_18 = pVVar4->x; local_14 = pVVar4->y; } local_c = local_14 - (npc->_pos).y; local_10 = local_18 - (npc->_pos).x; fVar8 = sqrtf(local_c * local_c + local_10 * local_10); local_10 = local_10 / fVar8; local_c = local_c / fVar8; if (local_20 * 1.33 <= fVar8) { local_24 = (float)npc->_i1 * 90.0 * 0.017453292; local_28 = cos(local_24); fVar8 = sin(local_24); fVar7 = (local_28 * local_c + fVar8 * local_10) * local_1c + local_c * local_20 + (npc->_pos).y; fVar8 = (local_28 * local_10 - fVar8 * local_c) * local_1c + local_10 * local_20 + (npc->_pos).x; } else { fVar7 = sqrtf(local_1c * local_1c + local_20 * local_20); fVar8 = fVar7 * local_10 + (npc->_pos).x; fVar7 = fVar7 * local_c + (npc->_pos).y; } (npc->_targetPosition).x = fVar8; (npc->_targetPosition).y = fVar7; local_1c = (npc->_pos).x; (npc->_v2).x = local_1c; local_c = (npc->_pos).y; (npc->_v2).y = local_c; local_10 = (npc->_targetPosition).x; local_28 = local_10 - (npc->_pos).x; local_30.y = (npc->_targetPosition).y; local_20 = local_30.y - (npc->_pos).y; local_24 = cos(1.5707964); fVar8 = sin(1.5707964); fVar9 = local_28 * local_24 - local_20 * fVar8; fVar6 = local_20 * local_24 + local_28 * fVar8; fVar8 = (local_30.y - local_c) * 0.75 + local_c; fVar7 = (local_10 - local_1c) * 0.75 + local_1c; if ((local_14 - (npc->_pos).y) * fVar6 + (local_18 - (npc->_pos).x) * fVar9 <= 0.0) { fVar8 = fVar8 + fVar6; fVar7 = fVar7 + fVar9; } else { fVar8 = fVar8 - fVar6; fVar7 = fVar7 - fVar9; } (npc->_v1).x = fVar7; (npc->_v1).y = fVar8; curAnimName = (npc->_sprite)._animState._animData; if (curAnimName == (byte *)0x0) { curAnimName = &s_empty; } else if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } iVar2 = strncmp((char *)curAnimName,"Swing",5); fVar8 = (npc->_pos).x; isAlreadySwinging = iVar2 == 0; anim = "SwingLeft"; if (fVar8 < (npc->_targetPosition).x || fVar8 == (npc->_targetPosition).x) { anim = "SwingRight"; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)anim,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadLook",1); if ((bVar1 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } if ((isAlreadySwinging != '\0') && ((npc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,8.0); } npc->_state = 4; npc->_i1 = -npc->_i1; npc->_aiFloat = 0.0; goto LAB_0050318c; } if (iVar2 != 4) goto LAB_0050318c; pfVar5 = &npc->_aiFloat; fVar8 = npc->_speedMultiplier * 0.035 + *pfVar5; *pfVar5 = fVar8; (npc->_posOffset).y = 9.0 - (fVar8 - 0.5) * 9.0 * (fVar8 - 0.5) * 4.0; if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y) ) { fVar8 = cos(fVar8 * 3.1415927); local_20 = (npc->_v1).y; local_1c = (1.0 - fVar8) * 0.5; local_18 = atan2f((npc->_v2).y - local_20,(npc->_v2).x - (npc->_v1).x); local_18 = local_18 * 57.295776; fVar7 = (npc->_v1).x - (npc->_v2).x; fVar8 = (npc->_v1).y - (npc->_v2).y; local_14 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); fVar7 = (npc->_v1).x - (npc->_targetPosition).x; fVar8 = (npc->_v1).y - (npc->_targetPosition).y; local_c = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); fVar8 = atan2f((npc->_targetPosition).y - local_20,(npc->_targetPosition).x - (npc->_v1).x); fVar8 = angle_difference(local_18,fVar8 * 57.295776); local_c = (local_c - local_14) * local_1c + local_14; local_20 = (fVar8 * local_1c + local_18) * 0.017453292; fVar8 = cos(local_20); local_1c = (fVar8 * local_c + (npc->_v1).x) - (npc->_pos).x; fVar6 = sin(local_20); bVar1 = npc->_collidesWithGrid; fVar8 = (npc->_v1).y; fVar7 = (npc->_pos).y; (npc->_velocity).x = local_1c; (npc->_velocity).y = (fVar6 * local_c + fVar8) - fVar7; if (bVar1 != 0) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; local_20 = 0.8; pfVar3 = &local_20; if (0.8 < *pfVar5 || *pfVar5 == 0.8) { pfVar3 = pfVar5; } *pfVar5 = *pfVar3; } } fVar8 = *pfVar5; if (0.8 < fVar8) { animData = (npc->_sprite)._animState._animData; if (animData == (void *)0x0) { iVar2 = 0; } else { iVar2 = *(int *)((int)animData + 0x30); } local_20 = (float)(iVar2 + -10); local_1c = fVar8; iVar2 = ANM2::GetFrame(&npc->_sprite); if (iVar2 < (int)local_20) { fVar8 = *pfVar5; if (animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)local_20); fVar8 = *pfVar5; } } else { fVar8 = local_1c; } } if (fVar8 <= 1.0) goto LAB_0050318c; (npc->_posOffset).y = 0.0; } npc->_state = 3; LAB_0050318c: if (0 < npc->_i2) { npc->_i2 = npc->_i2 + -1; } if ((npc->_sprite)._animState._animData != (void *)0x0) { pfVar5 = AnimationState::GetNullFrame(&(npc->_sprite)._animState,(byte *)"HeadPos"); if (pfVar5 != (float *)0x0) { headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (headLayer->_pos).x = *pfVar5; (headLayer->_pos).y = pfVar5[1]; headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (headLayer->_size).x = pfVar5[4]; (headLayer->_size).y = pfVar5[5]; local_30.y = pfVar5[0x11]; headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); headLayer->_rotation = local_30.y; target = Entity_NPC::GetPlayerTarget(npc); local_20 = (target->_pos).y - (npc->_pos).y; local_1c = (target->_pos).x - (npc->_pos).x; fVar8 = sqrtf(local_20 * local_20 + local_1c * local_1c); if (fVar8 <= 0.0) { fVar7 = local_1c; fVar8 = local_20; } else { fVar7 = local_1c * (1.0 / fVar8); fVar8 = local_20 * (1.0 / fVar8); } if (fVar8 < 0.924) { if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { if (0.0 <= fVar8) { iVar2 = 2; if (fVar7 < 0.0) { iVar2 = 0; } AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar2); return; } AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,3.0); } } else if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,1.0); return; } } } return; } //@@ 00503300 NpcAI::ENTITY_BOMBGAGGER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 844 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BOMBGAGGER(Entity_NPC *npc) { byte bVar1; Vector *pVVar2; int iVar3; uint rngValue; Entity *pEVar4; void *pvVar5; uint uVar6; float fVar7; float fVar8; float fVar9; Vector smokeVelocity; Vector local_90; Vector local_88; float bombVelocityY; float bombVelocityX; EntityPtr *local_78; Vector scratchVec; undefined4 local_68 [5]; void *local_54; char local_50 [8]; char local_48 [8]; uint local_40; void *local_3c; char local_38 [12]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; AnimationState *animState; EntityPtr child; EntityPtr *childRef; Room *room; ColorMod *smokeColor; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af2a25; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); iVar3 = npc->_state; if (iVar3 == 0) { npc->_state = 4; npc->_i2 = 0; return; } ExceptionList = &local_1c; if (iVar3 == 4) { child = npc->_child; if (child == (EntityPtr)0x0) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } else { scratchVec.x = *(float *)((int)child + 0x33c); scratchVec.y = *(float *)((int)child + 0x340); puStack_20 = local_38 + 0x34; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,1); } local_40 = 0xf; local_48[4] = '\b'; local_48[5] = '\0'; local_48[6] = '\0'; local_48[7] = '\0'; local_54 = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); local_28 = 0xf; local_2c = 8; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)&local_54,0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_28) { uVar6 = local_28 + 1; pvVar5 = local_3c; if (0xfff < uVar6) { pvVar5 = *(void **)((int)local_3c + -4); uVar6 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar5))) goto LAB_005038c6; } operator_delete(pvVar5,uVar6); } local_14 = 0xffffffff; local_2c = 0; local_28 = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar6 = local_40 + 1; pvVar5 = local_54; if (0xfff < uVar6) { pvVar5 = *(void **)((int)local_54 + -4); uVar6 = local_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar5))) { LAB_005038c6: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar6); } npc->_friction = npc->_friction * 0.8; if (npc->_child == (EntityPtr)0x0) { if ((npc->_flags & 0x20000000) != 0) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::IsEnemy(pEVar4); if ((bVar1 == 0) || (4 < npc->_i2)) goto LAB_00503a6d; } if ((npc->_projectileCooldown < 1) && (uVar6 = Random(), uVar6 % 5 == 0)) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar8 = (pEVar4->_pos).y - (npc->_pos).y; fVar9 = (pEVar4->_pos).x - (npc->_pos).x; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); if ((300.0 <= fVar8) || (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 != 0)) { npc->_projectileCooldown = 3; } else { room = g_game->_room; pEVar4 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar4->_pos).x; scratchVec.y = (pEVar4->_pos).y; bVar1 = Room::CheckLine(room,&scratchVec,&npc->_pos,2,0,0,0,(Vector *)0x0); if (bVar1 == 0) { npc->_projectileCooldown = 7; } else { npc->_projectileCooldown = 0x4b; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"AttackStart",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 8; (npc->_sprite)._flipX = 0; npc->_stateFrame = 0; } } } else { npc->_projectileCooldown = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); } } } else { puStack_20 = local_38 + 0x34; if (iVar3 == 8) { npc->_friction = npc->_friction * 0.7; pvVar5 = (npc->_sprite)._animState._animData; if (npc->_stateFrame == 0) { animState = &(npc->_sprite)._animState; puStack_20 = local_38 + 0x34; if ((pvVar5 != (void *)0x0) && (puStack_20 = local_38 + 0x34, bVar1 = AnimationState::IsEventTriggered(animState,(byte *)"Sound1"), bVar1 != 0)) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(animState,(byte *)"Sound2"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00503a6d; } npc->_stateFrame = 1; pVVar2 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_88.x = pVVar2->x - (npc->_pos).x; local_88.y = pVVar2->y - (npc->_pos).y; iVar3 = vector_to_direction(&local_88); ANM2::Play(&npc->_sprite,(&PTR_s_AttackLeft_00b60af0)[iVar3],0); npc->_i1 = iVar3; } else { puStack_20 = local_38 + 0x34; if ((pvVar5 != (void *)0x0) && (puStack_20 = local_38 + 0x34, bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { fVar9 = 1.0; bVar1 = 0; iVar3 = 2; fVar8 = 1.0; uVar6 = Random(); Entity_NPC::PlaySound(npc,(uVar6 & 1) + 0xb,fVar8,iVar3,bVar1,fVar9); pVVar2 = Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,npc->_i1); local_88.x = pVVar2->x * 10.0; local_88.y = pVVar2->y * 10.0; bombVelocityY = local_88.y; bombVelocityX = local_88.x; uVar6 = Random(); local_90.x = bombVelocityX + (npc->_pos).x; local_90.y = bombVelocityY + (npc->_pos).y; child = (EntityPtr)Game::Spawn(g_game,4,0x11,&local_90,&local_88,(Entity *)npc,0,uVar6); childRef = &npc->_child; if (npc->_child != (EntityPtr)0x0) { local_78 = childRef; std::multiset::erase(&local_78); } *childRef = child; if (child != (EntityPtr)0x0) { std::multiset::insert(childRef); } local_90.y = bombVelocityX * 0.4; local_78 = (EntityPtr *)0x6; local_88.y = bombVelocityY * 0.4; do { uVar6 = Random(); rngValue = Random(); fVar8 = ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; fVar9 = cos(fVar8); fVar8 = sin(fVar8); rngValue = Random(); fVar7 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)] ) * 2.3283064e-10; fVar7 = fVar7 + fVar7 + 0.6; smokeVelocity.x = (bombVelocityX * fVar9 - bombVelocityY * fVar8) * fVar7; scratchVec.x = local_90.y + (npc->_pos).x; smokeVelocity.y = (bombVelocityX * fVar8 + bombVelocityY * fVar9) * fVar7; scratchVec.y = local_88.y + (npc->_pos).y; pEVar4 = Game::Spawn(g_game,1000,99,&scratchVec,&smokeVelocity,(Entity *)0x0,1,uVar6); uVar6 = Random(); smokeColor = &(pEVar4->_sprite)._color; local_48[0] = '\0'; local_48[1] = '\0'; local_48[2] = '\0'; local_48[3] = '\0'; local_48[4] = '\0'; local_48[5] = '\0'; local_48[6] = '\0'; local_48[7] = '\0'; local_40 = 0; fVar9 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 1.0; fVar8 = (pEVar4->_sprite)._scale.x; (pEVar4->_sprite)._scale.y = fVar9 * (pEVar4->_sprite)._scale.y; (pEVar4->_sprite)._scale.x = fVar9 * fVar8; if (smokeColor != (ColorMod *)local_68) { (pEVar4->_sprite)._color._colorize[0] = 0.0; (pEVar4->_sprite)._color._colorize[1] = 0.0; (pEVar4->_sprite)._color._colorize[2] = 0.0; (pEVar4->_sprite)._color._colorize[3] = 0.0; (pEVar4->_sprite)._color._offset[0] = 0.0; (pEVar4->_sprite)._color._offset[1] = 0.0; smokeColor->_tint[0] = 0.4; (pEVar4->_sprite)._color._tint[1] = 0.42; (pEVar4->_sprite)._color._tint[2] = 0.25; (pEVar4->_sprite)._color._tint[3] = 1.0; (pEVar4->_sprite)._color._offset[2] = 0.0; } (**(code **)(*(int *)pEVar4 + 0xc))(); local_78 = (EntityPtr *)&local_78[-1].field_0x3; } while (local_78 != (EntityPtr *)0x0); npc->_i2 = npc->_i2 + 1; local_78 = (EntityPtr *)0x0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } } } } LAB_00503a6d: if ((((npc->_dead != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (pvVar5 = AnimationState::GetNullFrame(&(npc->_sprite)._animState,&DAT_00b1ce1c), pvVar5 != (void *)0x0)) && (*(char *)((int)pvVar5 + 0xc) != '\0')) { uVar6 = Random(); Game::Spawn(g_game,4,0x11,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6); } ExceptionList = local_1c; return; } //@@ 00503af0 NpcAI::ENTITY_DUST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: type 882; was PlayerHUD::RenderActiveItem */ void __fastcall NpcAI::ENTITY_DUST(Entity_NPC *npc) { byte bVar1; Entity_Player *nearestPlayer; LayerState *layer; int iVar2; Entity *playerTarget; char *anim; Vector *pVVar3; byte *layerIndex; float fVar4; float fVar5; float fVar6; undefined1 auStack_c4 [16]; float fStack_b4; byte isAllowPits; byte isAvoidDoors; Vector randomPos; Entity_NPC *savedNpc; Vector local_80; float bestPosY; float bestDistSq; Entity_Effect *local_70; ColorMod splatColor; float local_14; Entity_NPC *dust; undefined4 flagsHi; code *setColorFn; local_14 = (float)(__security_cookie ^ (uint)((&splatColor)[1]._tint + 1)); local_80.y = (float)g_game->_room; savedNpc = npc; if (npc->_aiCallPhase == 1) { if (((npc->_flags & 0x20000000) == 0) && (npc->_state != 0x10)) { nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos); if (nearestPlayer == (Entity_Player *)0x0) { fVar4 = 0.0; } else { fVar4 = (npc->_pos).y - (nearestPlayer->_pos).y; fVar5 = (npc->_pos).x - (nearestPlayer->_pos).x; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); fVar4 = 1.0 - (fVar4 - 80.0) / 120.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } } } else { fVar4 = 1.0; } layerIndex = (byte *)0x0; (npc->_v1).x = fVar4; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_color)._tint[3] = (npc->_v1).x; } while (layerIndex < (byte *)(npc->_sprite)._layerCount); } if (npc->_state != 0x10) { iVar2 = 0; if (0.02 < (npc->_v1).x) { iVar2 = 4; } npc->_entityCollisionClass = iVar2; return; } } else { switch(npc->_state) { case 0: npc->_aiCallFlags = 1; npc->_state = 2; (npc->_v1).y = npc->_maxHitPoints * 0.66; splatColor._colorize[0] = 0.0; splatColor._colorize[1] = 0.0; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 0.0; (npc->_v1).x = 0.0; splatColor._tint[0] = 0.0; splatColor._tint[1] = 0.0; splatColor._tint[2] = 0.0; splatColor._tint[3] = 0.3; splatColor._offset[0] = 0.82; splatColor._offset[1] = 0.82; splatColor._offset[2] = 0.8; Color::operator_assign((Color *)&npc->_splatColor,&splatColor); layerIndex = (byte *)0x0; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_color)._tint[3] = 0.0; } while (layerIndex < (byte *)(npc->_sprite)._layerCount); } ANM2::Play(&npc->_sprite,(byte *)"Appear",0); flagsHi = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHi; return; case 2: npc->_friction = npc->_friction * 0.6; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; return; } break; case 3: npc->_friction = npc->_friction * 0.8; local_70 = (Entity_Effect *)((npc->_v1).x * 1.35); if ((float)local_70 <= 0.35) { local_70 = (Entity_Effect *)0x3eb33333; } playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar4 = (playerTarget->_pos).y - (npc->_pos).y; fVar5 = (playerTarget->_pos).x - (npc->_pos).x; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); bVar1 = 1; fVar5 = 0.0; fVar4 = (fVar4 - 0.0) / 80.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } fVar4 = (fVar4 * 0.39999998 + 0.6) * (float)local_70; pVVar3 = Entity_NPC::CalcTargetPosition(npc,&local_80,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar3,fVar4,(int)fVar5,bVar1); fVar4 = npc->_health; if ((npc->_v1).y <= fVar4) { fVar4 = (npc->_velocity).y; pVVar3 = &npc->_velocity; if (ABS(fVar4) < ABS(pVVar3->x)) { ANM2::Play(&npc->_sprite,(byte *)"WalkHori",0); (npc->_sprite)._flipX = pVVar3->x <= 0.0 && pVVar3->x != 0.0; } else { anim = (char *)&DAT_00b1e020; if (0.0 <= fVar4) { anim = "WalkDown"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); (npc->_sprite)._flipX = 0; } } else { fVar5 = npc->_maxHitPoints; do { fVar6 = (npc->_v1).y - fVar5 * 0.33; (npc->_v1).y = fVar6; } while (fVar4 < fVar6); npc->_state = 0x10; npc->_entityCollisionClass = 0; ANM2::Play(&npc->_sprite,&DAT_00b1d534,0); (npc->_sprite)._flipX = 0; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; npc->_i1 = 0x5a; } pVVar3 = Vector::ToCardinal(&local_80,&npc->_velocity); (npc->_forwardVector).x = pVVar3->x; (npc->_forwardVector).y = pVVar3->y; iVar2 = Entity::GetIntervalTicks((Entity *)npc,6.0,0.0); if ((iVar2 != 0) && (0.0 < (npc->_v1).x)) { local_70 = Entity_NPC::MakeSplat(npc,0.5); setColorFn = *(code **)(*(int *)local_70 + 0x3c); Color::Color(); Color::operator_assign((Color *)auStack_c4,&savedNpc->_splatColor); FUN_004072e0(); (*setColorFn)(); return; } break; case 0x10: npc->_friction = npc->_friction * 0.6; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d534); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x50,0.7,2,0,1.5); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return; } } fVar4 = local_80.y; if (0 < npc->_i1) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1; } bestDistSq = 0.0; iVar2 = 4; bestPosY = 0.0; local_70 = (Entity_Effect *)0x0; do { isAvoidDoors = 0; isAllowPits = 0; bVar1 = 0; fVar5 = 0.0; fStack_b4 = 7.370094e-39; pVVar3 = Room::GetRandomPosition((Room *)fVar4,&randomPos,0.0); fStack_b4 = 7.370111e-39; Room::FindFreePickupSpawnPosition ((Room *)fVar4,&local_80,pVVar3,fVar5,bVar1,isAllowPits,isAvoidDoors); nearestPlayer = Game::GetNearestPlayerEx(&local_80,0,0,0); dust = savedNpc; if ((nearestPlayer != (Entity_Player *)0x0) && (fVar5 = local_80.x - (nearestPlayer->_pos).x, fVar6 = local_80.y - (nearestPlayer->_pos).y, fVar5 = fVar6 * fVar6 + fVar5 * fVar5, bestDistSq < fVar5)) { local_70 = (Entity_Effect *)local_80.x; bestPosY = local_80.y; bestDistSq = fVar5; } iVar2 = iVar2 + -1; } while (iVar2 != 0); if ((40000.0 < bestDistSq) || (savedNpc->_i1 < 1)) { (savedNpc->_pos).x = (float)local_70; (savedNpc->_pos).y = bestPosY; ANM2::Play(&savedNpc->_sprite,(byte *)"Appear",0); dust->_state = 2; } } } return; } //@@ 005041d0 NpcAI::ENTITY_BIG_BONY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 830 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BIG_BONY(Entity_NPC *npc) { uint *puVar1; float fVar2; byte bVar3; uint damageRoll; EntityRef *killSource; Vector *pVVar4; Entity *pEVar5; std_string *curAnimName; void *pvVar6; uint freeSize; char *anim; float fVar7; float fVar8; int iVar9; undefined4 local_cc [11]; undefined4 local_a0 [11]; Vector local_74; Vector local_6c; undefined1 local_64 [20]; float local_50; undefined1 local_4c; int vertAnimSize; uint vertAnimCapacity; void *walkAnimName; char local_38 [12]; uint walkAnimSize; uint walkAnimCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword flags; Manager *manager; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af413d; local_1c = ExceptionList; freeSize = __security_cookie ^ (uint)(local_38 + 0x28); iVar9 = npc->_state; local_24 = freeSize; if (npc->_variant != 10) { if (iVar9 == 0) { ExceptionList = &local_1c; npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)"WalkVert",0); if (&npc->_splatColor == (ColorMod *)local_cc) { ExceptionList = local_1c; return; } (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.8; (npc->_splatColor)._colorize[1] = 0.78; (npc->_splatColor)._colorize[2] = 0.74; (npc->_splatColor)._colorize[3] = 1.0; ExceptionList = local_1c; return; } if (iVar9 != 4) { if (iVar9 != 8) { return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.6; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = local_38 + 0x34; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xf9,1.0,10,0,0.8); pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_6c.x = (pEVar5->_pos).x - (npc->_pos).x; local_6c.y = (pEVar5->_pos).y - (npc->_pos).y; pVVar4 = Vector::Normalized(&local_6c,&local_74); local_6c.x = pVVar4->x * 8.0; local_6c.y = pVVar4->y * 8.0; freeSize = Random(); pEVar5 = Game::Spawn(g_game,0x33e,10,&npc->_pos,&local_6c,(Entity *)npc,0,freeSize); (**(code **)(*(int *)pEVar5 + 0xc))(); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } npc->_state = 4; ExceptionList = local_1c; return; } vertAnimCapacity = 0xf; vertAnimSize = 8; local_64[0x10] = 'W'; local_64[0x11] = 'curAnimName'; local_64[0x12] = 'l'; local_64[0x13] = 'k'; local_50 = (float)0x74726556; local_4c = 0; walkAnimCapacity = 0xf; walkAnimSize = 8; walkAnimName = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimName,(std_string *)(local_64 + 0x10),0.1); local_14 = local_14 & 0xffffff00; if (0xf < walkAnimCapacity) { freeSize = walkAnimCapacity + 1; pvVar6 = walkAnimName; if (0xfff < freeSize) { pvVar6 = *(void **)((int)walkAnimName + -4); freeSize = walkAnimCapacity + 0x24; if (0x1f < (uint)((int)walkAnimName + (-4 - (int)pvVar6))) goto LAB_0050472a; } operator_delete(pvVar6,freeSize); } local_14 = 0xffffffff; walkAnimSize = 0; walkAnimCapacity = 0xf; walkAnimName = (void *)((uint)walkAnimName & 0xffffff00); if (0xf < vertAnimCapacity) { freeSize = vertAnimCapacity + 1; pvVar6 = (void *)local_64._16_4_; if (0xfff < freeSize) { pvVar6 = *(void **)(local_64._16_4_ + -4); freeSize = vertAnimCapacity + 0x24; if (0x1f < (uint)(local_64._16_4_ + (-4 - (int)pvVar6))) { LAB_0050472a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,freeSize); } if ((npc->_flags & 0x1000800) == 0) { bVar3 = 1; iVar9 = 900; fVar7 = 0.3; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&local_6c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar4,fVar7,iVar9,bVar3); if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown + -1; } pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_6c.y = (pEVar5->_pos).x; local_74.y = (pEVar5->_pos).y; if ((npc->_projectileCooldown < 1) && (((fVar8 = (npc->_pos).x - local_6c.y, fVar7 = (npc->_pos).y - local_74.y, fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8), fVar7 < 120.0 && (freeSize = Random(), freeSize % 0xf == 0)) || (freeSize = Random(), freeSize % 0x78 == 0)))) { curAnimName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState, (std_string *)(local_64 + 0x10)); local_14 = 2; puVar1 = &curAnimName->_size; if (0xf < curAnimName->_capacity) { curAnimName = *(std_string **)curAnimName->_buf; } bVar3 = str_eq((byte *)curAnimName,*puVar1,(byte *)"WalkHori",8); anim = "AttackHori"; if (bVar3 == 0) { anim = "AttackVert"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); local_14 = 0xffffffff; if (0xf < vertAnimCapacity) { freeSize = vertAnimCapacity + 1; pvVar6 = (void *)local_64._16_4_; if (0xfff < freeSize) { pvVar6 = *(void **)(local_64._16_4_ + -4); freeSize = vertAnimCapacity + 0x24; if (0x1f < (uint)(local_64._16_4_ + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,freeSize); } npc->_state = 8; local_6c.x = local_6c.y - (npc->_pos).x; local_6c.y = local_74.y - (npc->_pos).y; pVVar4 = Vector::Normalized(&local_6c,&local_74); fVar7 = pVVar4->x; fVar8 = pVVar4->y; npc->_projectileCooldown = 0x78; (npc->_targetPosition).x = fVar7 * 12.0; (npc->_targetPosition).y = fVar8 * 12.0; } } else { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_6c.x = (pEVar5->_pos).x; local_6c.y = (pEVar5->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_6c,0); iVar9 = (npc->_pathfinder)._evadeMovementCountdown; fVar7 = npc->_friction * 0.8; npc->_friction = fVar7; if (0 < iVar9) { npc->_friction = fVar7 * 0.8; } } if ((npc->_pathfinder)._hasDirectPath == 0) { ExceptionList = local_1c; return; } freeSize = Random(); if (freeSize % 3 == 0) { Entity_NPC::PlaySound(npc,0x74,1.0,0x3c,0,1.0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (iVar9 == 0) { flags = npc->_flags; puVar1 = (uint *)((int)&npc->_flags + 4); ExceptionList = &local_1c; *puVar1 = *puVar1 | 0x400; npc->_state = 4; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x20d0011; puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,&DAT_00b1d6fc,0); pvVar6 = (npc->_sprite)._animState._animData; if (pvVar6 != (void *)0x0) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)((uint)(npc->_dropRNG)._seed % *(uint *)((int)pvVar6 + 0x30))); } if (&npc->_splatColor != (ColorMod *)local_a0) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.8; (npc->_splatColor)._colorize[1] = 0.78; (npc->_splatColor)._colorize[2] = 0.74; (npc->_splatColor)._colorize[3] = 1.0; } npc->_aiFloat = 8.0; npc->_i1 = 8; npc->_isKillOnTouch = 1; ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; if (npc->_pendingDamage <= 0.0) goto LAB_005043b0; local_6c.y = 1.0; puStack_20 = local_38 + 0x34; damageRoll = Random(); if (damageRoll % 3 == 0) { fVar7 = 2.0; } else { fVar7 = local_6c.y; } if ((npc->_pendingDamageFlags & 4) == 0) { if (0.0 < fVar7) goto LAB_00504349; fVar7 = npc->_health; } else { fVar7 = 4.0; LAB_00504349: fVar7 = npc->_health - fVar7; if (fVar7 <= 1.0) { fVar7 = 1.0; } npc->_health = fVar7; } (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; if (fVar7 <= 1.0) { killSource = EntityRef::EntityRef((EntityRef *)local_64); (**(code **)(*(int *)npc + 0x24))(killSource); ExceptionList = local_1c; return; } LAB_005043b0: bVar3 = npc->_collidesWithGrid; (npc->_posOffset).y = -15.0; npc->_entityGridCollisionClass = 6; manager = g_manager; if (bVar3 != 0) { local_6c.y = 6.99248e-43; seed_fart_sound_override((int *)&local_6c.y); SoundEffects::Play(&manager->_sfxManager,(int)local_6c.y,0.5,2,0,1.5,0.0); npc->_i1 = npc->_i1 + -1; if (npc->_i1 < 1) { killSource = EntityRef::EntityRef((EntityRef *)local_64); (**(code **)(*(int *)npc + 0x24))(killSource,freeSize); } } local_74.y = (npc->_velocity).x; if ((local_74.y == g_vectorZero.x) && ((npc->_velocity).y == g_vectorZero.y)) { pVVar4 = MusicManager::RandomVector(&local_6c); (npc->_velocity).x = pVVar4->x; local_6c.y = pVVar4->y; (npc->_velocity).y = local_6c.y; local_74.y = (npc->_velocity).x; } else { local_6c.y = (npc->_velocity).y; } fVar7 = sqrtf(local_74.y * local_74.y + local_6c.y * local_6c.y); if (fVar7 <= 0.0) { fVar8 = local_74.y; fVar7 = local_6c.y; } else { fVar7 = npc->_aiFloat / fVar7; fVar8 = local_74.y * fVar7; fVar7 = local_6c.y * fVar7; } fVar2 = (npc->_v1).y; (npc->_velocity).y = fVar7; (npc->_velocity).x = fVar8; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8 + fVar2 * fVar2); fVar7 = fVar7 / 10.0; if (fVar7 <= 0.1) { fVar7 = 0.1; } if (2.0 <= fVar7) { fVar7 = 2.0; } (npc->_sprite)._playbackSpeed = fVar7; ExceptionList = local_1c; return; } //@@ 00504a40 NpcAI::ENTITY_DUSTY_DEATHS_HEAD /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 887 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DUSTY_DEATHS_HEAD(Entity_NPC *npc) { code *pcVar1; byte bVar2; Entity *spawned; int iVar3; uint rngResult; byte *curAnimName; byte *wantedAnimName; uint uVar4; int dustTimeout; Game *game; bool isLess; float fVar5; float fVar6; undefined4 local_98 [8]; undefined4 local_78; undefined4 uStack_74; undefined4 local_70; Vector dustVelocity; undefined1 local_60 [8]; float local_58; float dustVelocityY; float dustVelocityX; float local_4c; Entity *local_48; undefined1 *local_44; undefined4 dustColor; undefined4 local_3c; undefined4 local_38; float dustAlpha; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; uint *flagsHigh; Vector *pos; game = g_game; local_14 = __security_cookie ^ (uint)(local_60 + 0x50); if (npc->_subtype == 0) { local_48 = (Entity *)&DAT_bf800000; } else { local_48 = (Entity *)0x3f800000; } uVar4 = npc->_initSeed; local_60 = (undefined1 [8])0x1b00000005; local_44 = (undefined1 *)0x19; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> 5 ^ uVar4; uVar4 = uVar4 << 0x1b ^ uVar4; uVar4 = uVar4 >> 0x19 ^ uVar4; local_4c = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 3.1415927; local_4c = local_4c + local_4c; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> 5 ^ uVar4; uVar4 = uVar4 << 0x1b ^ uVar4; uVar4 = uVar4 >> 0x19 ^ uVar4; local_44 = (undefined1 *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 3.0 + 5.0); fVar5 = (npc->_pos).x; fVar6 = (*(float *)((int)g_game->_room + 0x1c) + 120.0) - fVar5; fVar5 = (fVar5 - *(float *)((int)g_game->_room + 0x14)) + 120.0; if (fVar5 <= fVar6) { fVar6 = fVar5; } fVar5 = fVar6 / 100.0; if (fVar6 / 100.0 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } (npc->_sprite)._color._tint[3] = fVar5; if (npc->_state != 0) { if (npc->_state == 4) { fVar5 = npc->_friction * 0.6; npc->_friction = fVar5; if (fVar5 != 0.0) { fVar6 = npc->_speedMultiplier; (npc->_velocity).x = ((float)local_48 * 1.6 * fVar6) / fVar5 + (npc->_velocity).x; (npc->_velocity).y = (fVar6 * 0.0) / fVar5 + (npc->_velocity).y; } fVar5 = sin((npc->_updateTime * 3.1415927) / 30.0 + local_4c); iVar3 = npc->_i1; (npc->_velocity).y = fVar5 * (float)local_44; if ((iVar3 == 0) && (150.0 <= npc->_updateTime)) { npc->_i1 = 1; uVar4 = RNG::Next(&npc->_dropRNG); spawned = Game::Spawn(g_game,npc->_type,npc->_variant,&npc->_targetPosition,&g_vectorZero, (Entity *)npc,npc->_subtype,uVar4); (**(code **)(*(int *)spawned + 0xc))(); game = g_game; } } fVar5 = (npc->_pos).x; if (npc->_subtype == 0) { if (fVar5 < *(float *)((int)game->_room + 0x14) - 120.0) { LAB_005050d3: (**(code **)(*(int *)npc + 0x28))(); return; } } else if (*(float *)((int)game->_room + 0x1c) + 120.0 < fVar5) goto LAB_005050d3; if (game->_frameCount - npc->_spawnFrame < 2) { return; } iVar3 = Entity_NPC::GetAliveEnemyCount(npc); if (0 < iVar3) { return; } if ((*(char *)((int)game->_room + 0x7229) != '\0') && (8 < *(int *)((int)game->_room + 0x11ec))) { return; } if (npc->_dead != 0) { return; } npc->_state = 0x12; npc->_stateFrame = 0; Entity_NPC::PlaySound(npc,0x13c,1.0,0x3c,0,1.0); game = g_game; npc->_entityCollisionClass = 0; npc->_shadowSize = 0.0; bVar2 = Room::IsPositionInRoom(game->_room,&npc->_pos,0.0); if (bVar2 == 0) { return; } uVar4 = Random(); local_4c = (float)(uVar4 % 3 + 2); if (local_4c == 0.0) { return; } do { uVar4 = Random(); fVar5 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44 = (undefined1 *)(fVar5 + fVar5); uVar4 = Random(); local_48 = (Entity *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 5.0); dustVelocity.x = cos((float)local_44); dustVelocity.x = dustVelocity.x * (float)local_48; dustVelocityX = dustVelocity.x; dustVelocity.y = sin((float)local_44); dustVelocity.y = dustVelocity.y * (float)local_48; dustVelocityY = dustVelocity.y; uVar4 = Random(); rngResult = Random(); fVar5 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44 = (undefined1 *)(fVar5 + fVar5); rngResult = Random(); local_48 = (Entity *) ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 20.0); fVar5 = cos((float)local_44); local_60._4_4_ = fVar5 * (float)local_48 + (npc->_pos).x; fVar5 = sin((float)local_44); local_58 = fVar5 * (float)local_48 + (npc->_pos).y; spawned = Game::Spawn(g_game,1000,0x3b,(Vector *)(local_60 + 4),&dustVelocity,(Entity *)npc,0, uVar4); local_44 = (undefined1 *)0x3f800000; if (((spawned->_pos).y - (npc->_pos).y) * -dustVelocityX + ((spawned->_pos).x - (npc->_pos).x) * dustVelocityY < 0.0) { local_44 = &DAT_bf800000; } (spawned->_sprite)._offset.x = 0.0; (spawned->_sprite)._offset.y = -20.0; local_48 = spawned; uVar4 = Random(); *(float *)(spawned[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_44; uVar4 = Random(); iVar3 = *(int *)spawned; dustTimeout = uVar4 % 0xf + 0xf; *(int *)(spawned[1]._sprite._filename._buf + 8) = dustTimeout; *(int *)(spawned[1]._sprite._filename._buf + 0xc) = dustTimeout; pcVar1 = *(code **)(iVar3 + 0x3c); uVar4 = Random(); dustColor = 0x3f800000; local_3c = 0x3f800000; local_38 = 0x3f800000; local_20 = 0; local_1c = 0; local_18 = 0; local_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; dustAlpha = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; (*pcVar1)(&dustColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)local_48 + 0xc))(); local_4c = (float)((int)local_4c + -1); } while (local_4c != 0.0); return; } npc->_state = 4; curAnimName = (npc->_sprite)._animState._animData; if (curAnimName != (byte *)0x0) { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } wantedAnimName = s_Idle; do { bVar2 = *curAnimName; isLess = bVar2 < *wantedAnimName; if (bVar2 != *wantedAnimName) { LAB_00505130: uVar4 = -(uint)isLess | 1; goto LAB_00505135; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; isLess = bVar2 < wantedAnimName[1]; if (bVar2 != wantedAnimName[1]) goto LAB_00505130; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00505135: if ((uVar4 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00505173; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } game = g_game; LAB_00505173: pos = &npc->_pos; npc->_entityGridCollisionClass = 0; (npc->_sprite)._flipX = npc->_subtype != 0; npc->_entityCollisionClass = 2; fVar5 = pos->x; (npc->_targetPosition).x = pos->x; (npc->_targetPosition).y = (npc->_pos).y; local_78 = 0; uStack_74 = 0; local_70 = 0; iVar3 = *(int *)((int)game->_room + 0xc); flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; npc->_isInvicible = 1; fVar6 = (float)(iVar3 * 0x28); pos->x = fVar5 - (float)local_48 * fVar6; (npc->_pos).y = (npc->_pos).y - fVar6 * 0.0; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb | 1; if (&npc->_splatColor != (ColorMod *)local_98) { (npc->_splatColor)._colorize[0] = (float)0x3f333333; (npc->_splatColor)._colorize[1] = (float)0x3f333333; (npc->_splatColor)._colorize[2] = (float)0x3f333333; (npc->_splatColor)._colorize[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } fVar5 = cos(local_4c); (npc->_pos).y = (npc->_pos).y - fVar5 * (float)local_44 * 9.549296; return; } //@@ 005052a0 NpcAI::ENTITY_NECRO /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 828 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_NECRO(Entity_NPC *npc) { EntityPtr EVar1; byte bVar2; uint uVar3; Entity_Projectile *projectile; Entity *pEVar4; ColorMod *color; LayerState *layer; Vector *freePos; int iVar5; int iVar6; int iVar7; float fVar8; Entity *pEVar9; Entity *local_9c; int frameDelta; Vector scratchVec; Vector awayDir; Vector local_84; Vector local_7c; Vector local_74; Vector local_6c; ColorMod tmpColor; Color bloodColor; uint local_c; EntityPtr *childRef; Game *game; Manager *manager; Room *room; game = g_game; local_c = __security_cookie ^ (uint)&local_9c; frameDelta = (int)npc->_updateTime - (int)npc->_prevUpdateTime; npc->_friction = npc->_friction * 0.7; room = game->_room; iVar5 = npc->_state; if (iVar5 != 0) { if (iVar5 == 3) { ANM2::Play(&npc->_sprite,(byte *)"Shake",0); if (npc->_projectileDelay < 1) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_74.x = (pEVar4->_pos).x; local_74.y = (pEVar4->_pos).y; awayDir.x = (npc->_pos).x - local_74.x; awayDir.y = (npc->_pos).y - local_74.y; fVar8 = sqrtf(awayDir.x * awayDir.x + awayDir.y * awayDir.y); if (0.0 < fVar8) { awayDir.x = (1.0 / fVar8) * awayDir.x; awayDir.y = awayDir.y * (1.0 / fVar8); } if ((awayDir.x != g_vectorZero.x) || (awayDir.y != g_vectorZero.y)) { iVar5 = 0; do { uVar3 = Random(); local_9c = (Entity *) (((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 270.0 - 135.0) * 0.017453292); local_84.x = cos((float)local_9c); local_9c = (Entity *)sin((float)local_9c); uVar3 = Random(); fVar8 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 120.0 + 60.0; scratchVec.x = (local_84.x * awayDir.x - (float)local_9c * awayDir.y) * fVar8 + (npc->_pos).x; local_9c = (Entity *) (((float)local_9c * awayDir.x + local_84.x * awayDir.y) * fVar8 + (npc->_pos).y); scratchVec.y = (float)local_9c; local_84.x = scratchVec.x; if (*(int *)(*(int *)((int)room->_descriptor + 0x10) + 0x48) - 9U < 4) { Room::GetClampedPositionImpl(room,&local_7c,&scratchVec,0.0,0.0,0.0,0.0); if ((local_7c.x == local_84.x) && (local_7c.y == (float)local_9c)) goto LAB_005059d2; } else if (((room->_topLeftPos).x + 0.0 <= scratchVec.x) && (((scratchVec.x <= (room->_bottomRightPos).x - 0.0 && ((room->_topLeftPos).y + 0.0 <= (float)local_9c)) && ((float)local_9c <= (room->_bottomRightPos).y - 0.0)))) { LAB_005059d2: iVar6 = (int)(((float)local_9c - 120.0) / 40.0 + 0.5); iVar7 = (int)((local_84.x - 40.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar6 < 0)) || (room->_gridHeight <= iVar6)) { iVar7 = -1; } else { iVar7 = room->_gridWidth * iVar6 + iVar7; } iVar6 = 0x505a2c; uVar3 = Room::GetGridCollision(room,iVar7); if (uVar3 != 0) { iVar7 = 0; iVar6 = 0; freePos = Room::FindFreePickupSpawnPosition(room,&local_6c,&scratchVec,10.0,1,0,0); scratchVec.x = freePos->x; scratchVec.y = freePos->y; } bVar2 = Entity::IsPlayerInRadius((Entity *)npc,&scratchVec,150.0,iVar6,iVar7); if ((bVar2 == 0) && (bVar2 = Room::CheckLine(room,&scratchVec,&local_74,3,0,0,0,(Vector *)0x0), bVar2 != 0)) { fVar8 = scratchVec.x; pEVar4 = (Entity *)scratchVec.y; goto LAB_00505aae; } } iVar5 = iVar5 + 1; } while (iVar5 < 10); fVar8 = 0.0; pEVar4 = (Entity *)0x0; LAB_00505aae: if ((fVar8 != g_vectorZero.x) || ((float)pEVar4 != g_vectorZero.y)) { (npc->_targetPosition).x = fVar8; (npc->_targetPosition).y = (float)pEVar4; npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } } } goto LAB_00505b19; } if (iVar5 != 8) goto LAB_00505b19; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Summon"); if (bVar2 != 0) { uVar3 = Random(); projectile = (Entity_Projectile *) Game::SpawnEx(g_game,9,1,&npc->_targetPosition,&g_vectorZero,(Entity *)npc,0, uVar3,0); EVar1 = projectile->_parent; childRef = &projectile->_parent; projectile->_height = -6.0; projectile->_fallingSpeed = 0.0; projectile->_scale = 1.0; *(undefined4 *)&projectile->_projectileFlags = 0; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = 0x100; if (EVar1 != (EntityPtr)0x0) { local_9c = (Entity *)childRef; std::multiset::erase(&local_9c); } *childRef = (EntityPtr)npc; std::multiset::insert(childRef); Entity_NPC::fire_projectile_from_params(npc,projectile); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 0.0; (**(code **)(*(int *)projectile + 0x3c))(&tmpColor,6,1,1,1); (**(code **)(*(int *)projectile + 0xc))(); uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x85,&npc->_targetPosition,&g_vectorZero,(Entity *)0x0,0, uVar3,0); tmpColor._tint[3] = 0.0; local_7c.y = 1.0; local_74.x = 1.0; local_74.y = 1.0; local_6c.x = 1.0; local_6c.y = 0.8; tmpColor._tint[0] = 0.6; tmpColor._tint[1] = 1.4; tmpColor._tint[2] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; (**(code **)(*(int *)pEVar4 + 0x3c))(&local_7c.y,0xffffffff,0xff,0,1); manager = g_manager; local_9c = (Entity *)0xa2; seed_fart_sound_override((int *)&local_9c); SoundEffects::Play(&manager->_sfxManager,(int)local_9c,0.5,2,0,1.0,0.0); childRef = &npc->_child; if (npc->_child != (EntityPtr)0x0) { local_9c = (Entity *)childRef; std::multiset::erase(&local_9c); } *childRef = (EntityPtr)projectile; std::multiset::insert(childRef); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { EVar1 = npc->_child; childRef = &npc->_child; if ((EVar1 != (EntityPtr)0x0) && (*(int *)((int)EVar1 + 0x28) == 9)) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar4->_pos).x - *(float *)((int)EVar1 + 0x33c); scratchVec.y = (pEVar4->_pos).y - *(float *)((int)EVar1 + 0x340); Vector::Resized(&scratchVec,&local_84,10.0); *(uint *)((int)EVar1 + 0x43c) = *(uint *)((int)EVar1 + 0x43c) & 0xfffffeff; *(float *)((int)EVar1 + 0x360) = local_84.x; *(undefined4 *)((int)EVar1 + 0x438) = *(undefined4 *)((int)EVar1 + 0x438); *(float *)((int)EVar1 + 0x364) = local_84.y; Color::Color(&bloodColor); scratchVec.x = *(float *)((int)EVar1 + 0x34c) * 0.65; local_84.x = *(float *)((int)EVar1 + 0x33c); local_84.y = *(float *)((int)EVar1 + 0x340); scratchVec.y = *(float *)((int)EVar1 + 0x350) * 0.65; pEVar4 = spawn_blood_explosion(5,&local_84,&scratchVec,color,&g_vectorZero); tmpColor._offset[0] = 0.4; tmpColor._offset[1] = 0.3; tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; tmpColor._offset[2] = 0.7; pEVar9 = (Entity *)0x0; (pEVar4->_sprite)._flipX = 1; pEVar4->_renderDepthOffset = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; local_9c = pEVar4; (**(code **)(*(int *)pEVar4 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); uVar3 = g_graphicsManager_flags; if (4 < (uint)(pEVar4->_sprite)._layerCount) { pEVar4 = pEVar9; layer = ANM2::GetLayer(&pEVar9->_sprite,&DAT_00000004); iVar5 = 1; if ((uVar3 & 4) == 0) { iVar5 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar5; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; } (**(code **)(*(int *)pEVar4 + 0xc))(); Entity_NPC::PlaySound(npc,0xf9,1.0,2,0,1.0); if (*childRef != (EntityPtr)0x0) { local_9c = (Entity *)childRef; std::multiset::erase(&local_9c); } *childRef = (EntityPtr)0x0; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00505b19; } } } npc->_state = 3; if (npc->_controllerID == -1) { uVar3 = Random(); uVar3 = uVar3 % 0x1e; } else { uVar3 = 0; } npc->_projectileDelay = uVar3; LAB_00505b19: if (0 < npc->_projectileDelay) { npc->_projectileDelay = npc->_projectileDelay - frameDelta; } return; } //@@ 00505b40 pow_wrapper /* DB: calls pow */ void pow_wrapper(void) { float in_XMM0_Da; float in_XMM1_Da; pow(in_XMM0_Da,in_XMM1_Da); return; } //@@ 00505b50 set_byte_0x101 /* DB: ? ICF-foldable setter this+0x101 */ void set_byte_0x101(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x101) = param_1; return; } //@@ 00505b60 Entity::GetColor /* ZHL [lua] Lua binding Entity:GetColor */ ColorMod * __thiscall Entity::GetColor(Entity *this) { return &(this->_sprite)._color; } //@@ 00505b70 Entity::InitSeed /* ZHL [lua] Lua binding Entity:InitSeed */ int __thiscall Entity::InitSeed(Entity *this) { return this->_initSeed; } //@@ 00505b80 _Entity_NPC::GetColorWithFlash /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ? copies Color, multiplies when +0xc>0; NPC ResetColor/Update */ undefined4 * _Entity_NPC::GetColorWithFlash(undefined4 *param_1) { int in_ECX; Color *this; ColorMod *other; undefined4 local_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined8 local_40; undefined4 local_38; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; if (*(float *)(in_ECX + 0xc) <= 0.0) { local_34 = *(undefined4 *)(in_ECX + 0x14); uStack_30 = *(undefined4 *)(in_ECX + 0x18); uStack_2c = *(undefined4 *)(in_ECX + 0x1c); uStack_28 = *(undefined4 *)(in_ECX + 0x20); local_38 = *(undefined4 *)(in_ECX + 0x3c); local_24 = *(undefined4 *)(in_ECX + 0x24); uStack_20 = *(undefined4 *)(in_ECX + 0x28); uStack_1c = *(undefined4 *)(in_ECX + 0x2c); uStack_18 = *(undefined4 *)(in_ECX + 0x30); local_40 = *(undefined8 *)(in_ECX + 0x34); } else { Color::Color(in_ECX); Color::__mul(this,other); local_34 = local_60; uStack_30 = uStack_5c; uStack_2c = uStack_58; uStack_28 = uStack_54; local_24 = local_50; uStack_20 = uStack_4c; uStack_1c = uStack_48; uStack_18 = uStack_44; } *param_1 = local_34; param_1[1] = uStack_30; param_1[2] = uStack_2c; param_1[3] = uStack_28; param_1[4] = local_24; param_1[5] = uStack_20; param_1[6] = uStack_1c; param_1[7] = uStack_18; *(undefined8 *)(param_1 + 8) = local_40; param_1[10] = local_38; return param_1; } //@@ 00505c30 RoomDescriptor::HasWater /* ZHL [lua] Lua binding RoomDescriptor:HasWater */ uint __thiscall RoomDescriptor::HasWater(RoomDescriptor *this) { return CONCAT31((uint3)((uint)this->Flags >> 0xd),(char)((uint)this->Flags >> 5)) & 0xffffff01; } //@@ 00505c40 Room::HasWaterPits /* ZHL [lua] Lua binding Room:HasWaterPits */ uint Room::HasWaterPits(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); return CONCAT31((uint3)(uVar1 >> 0xd),(char)(uVar1 >> 5)) & 0xffffff01; } //@@ 00505c50 Room::GetWaterCurrent /* ZHL [lua] Lua binding Room:GetWaterCurrent */ void __thiscall Room::GetWaterCurrent(Room *this,float *param_2) { float fVar1; fVar1 = (this->_waterCurrent).y; *param_2 = (this->_waterCurrent).x; param_2[1] = fVar1; return; } //@@ 00505c70 Level::GetStartingRoomIndex /* ZHL [lua] Lua binding Level:GetStartingRoomIndex */ int __thiscall Level::GetStartingRoomIndex(Level *this) { return this->_startingRoomIndex; } //@@ 00505c80 Entity_Player::GetActiveItem /* ZHL [exact] __thiscall int Entity_Player::GetActiveItem(int slot); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetActiveItem(Entity_Player *this,int slot) { if ((uint)slot < 4) { return this->_activeDesc[slot]._charge; } return 0; } //@@ 00505ca0 FUN_00505ca0 int FUN_00505ca0(void) { int in_ECX; if (*(int *)(in_ECX + 0x13e0) == 0) { return 0; } return (int)*(float *)(*(int *)(in_ECX + 0x13e0) + 0xc); } //@@ 00505cc0 Entity_Player::AreControlsEnabled /* ZHL [lua] Lua binding EntityPlayer:AreControlsEnabled prototype: db/protos.zhl */ byte __thiscall Entity_Player::AreControlsEnabled(Entity_Player *this) { if ((this->_isControlsEnabled == 0) || (0 < this->_controlsCooldown)) { return 0; } return 1; } //@@ 00505ce0 FUN_00505ce0 ScoreSheet * FUN_00505ce0(void) { return &g_game->_scoreSheet; } //@@ 00505cf0 Entity_Familiar::Coins /* ZHL [lua] Lua binding EntityFamiliar:Coins */ int __thiscall Entity_Familiar::Coins(Entity_Familiar *this) { return this->_coins; } //@@ 00505d00 NpcAI::ENTITY_STONE_EYE /* NPC AI for entity type 201 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_STONE_EYE(Entity_NPC *npc) { uint *puVar1; void *pvVar2; float fVar3; byte bVar4; int gridY; uint uVar5; float *extraout_EAX; EntityPtr EVar6; int iVar7; float10 fVar8; float fVar9; float fVar10; double dVar11; float angle; Vector local_88; Vector local_80; Vector local_78; Color splatColor [2]; EntityPtr *childField; Room *room; EVar6 = npc->_minecart; if (npc->_state == 0) { (npc->_targetPosition).x = (npc->_pos).x; fVar9 = (npc->_pos).y; *(uint *)&npc->_flags = (uint)npc->_flags | 1; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; (npc->_targetPosition).y = fVar9; npc->_isInvicible = 1; (npc->_v1).x = 0.0; npc->_state = 4; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rotate",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if (EVar6 == (EntityPtr)0x0) { pvVar2 = g_game->_room; iVar7 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if (((((-1 < iVar7) && (iVar7 < *(int *)((int)pvVar2 + 0xc))) && (gridY = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), -1 < gridY)) && ((gridY < *(int *)((int)pvVar2 + 0x10) && (uVar5 = gridY * *(int *)((int)pvVar2 + 0xc) + iVar7, uVar5 < 0x1c0)))) && (*(int *)((int)pvVar2 + uVar5 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)pvVar2 + uVar5 * 4 + 0x76c) = 0x3b6; } } Color::Color(splatColor); if (&npc->_splatColor != (ColorMod *)extraout_EAX) { fVar9 = extraout_EAX[1]; fVar10 = extraout_EAX[2]; fVar3 = extraout_EAX[3]; (npc->_splatColor)._tint[0] = *extraout_EAX; (npc->_splatColor)._tint[1] = fVar9; (npc->_splatColor)._tint[2] = fVar10; (npc->_splatColor)._tint[3] = fVar3; fVar9 = extraout_EAX[5]; fVar10 = extraout_EAX[6]; fVar3 = extraout_EAX[7]; (npc->_splatColor)._colorize[0] = extraout_EAX[4]; (npc->_splatColor)._colorize[1] = fVar9; (npc->_splatColor)._colorize[2] = fVar10; (npc->_splatColor)._colorize[3] = fVar3; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(extraout_EAX + 8); (npc->_splatColor)._offset[2] = extraout_EAX[10]; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; return; } if ((npc->_dead != 0) && (EVar6 == (EntityPtr)0x0)) { room = g_game->_room; uVar5 = Room::GetGridIndex(room,&npc->_pos); if ((uVar5 < 0x1c0) && (room->_gridPaths[uVar5] < 0x3b7)) { room->_gridPaths[uVar5] = 900; } } npc->_friction = npc->_friction * 0.8; fVar9 = (npc->_targetPosition).y; fVar10 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar9 - fVar10; if (npc->_state != 4) { if (npc->_state != 3) { return; } iVar7 = ANM2::GetFrame(&npc->_sprite); if (iVar7 != 0) { return; } LAB_005062ff: if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } (npc->_sprite)._animState._isPlaying = 0; return; } pvVar2 = (npc->_sprite)._animState._animData; if ((pvVar2 == (void *)0x0) || (*(char *)((int)pvVar2 + 0x34) == '\0')) { bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rotate",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } iVar7 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar7 < 1) { npc->_state = 3; goto LAB_005062ff; } } if (npc->_controllerID == -1) { angle = (npc->_v1).x + 2.0; } else { Entity_NPC::GetControllerMovementInput(npc,&local_88,0.1); if ((local_88.x == g_vectorZero.x) && (local_88.y == g_vectorZero.y)) { angle = (npc->_v1).x; goto LAB_00506056; } fVar9 = atan2f(local_88.y,local_88.x); local_88.x = fVar9 * 57.295776 * 0.5; dVar11 = floor((double)local_88.x); local_88.x = (float)dVar11; angle = approach_angle((npc->_v1).x,(local_88.x + local_88.x) - 90.0,2.0); (npc->_v1).x = angle; if (0.0 <= angle) goto LAB_00506056; angle = angle + 360.0; } (npc->_v1).x = angle; LAB_00506056: if (360.0 < angle) { angle = angle - 360.0; (npc->_v1).x = angle; } local_88.x = angle * 0.017453292; fVar9 = sin(local_88.x); local_80 = (Vector)(double)fVar9; fVar9 = cos(local_88.x); local_78 = (Vector)(double)(fVar9 * 0.5); fVar8 = (float10)_CIatan2(); pvVar2 = (npc->_sprite)._animState._animData; local_78 = (Vector)(double)fVar8; local_88.x = (float)fVar8 * 57.295776; if ((pvVar2 == (void *)0x0) || (AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)((float)*(int *)((int)pvVar2 + 0x30) * ((angle + 15.0) / 360.0))), (npc->_sprite)._animState._animData == (void *)0x0)) { iVar7 = -1; } else { dVar11 = floor((double)(npc->_sprite)._animState._animFrame); iVar7 = (int)dVar11; } childField = &npc->_child; if (npc->_child == (EntityPtr)0x0) { uVar5 = Random(); if (uVar5 % 3 == 0) { local_80.x = 0.0; local_80.y = -20.0; fVar9 = ((float)((iVar7 + 1) / 3) * 30.0 + 180.0) * 0.017453292 - 1.5707964; fVar10 = cos(fVar9); local_78.x = fVar10 * 20.0 + (npc->_pos).x; fVar9 = sin(fVar9); local_78.y = fVar9 * 14.0 + (npc->_pos).y; EVar6 = (EntityPtr) Entity_Laser::ShootAngle(2,&local_78,local_88.x + 90.0,2,&local_80,(Entity *)npc,0); if (*childField != (EntityPtr)0x0) { local_88.x = (float)childField; std::multiset::erase(); } *childField = EVar6; if (EVar6 != (EntityPtr)0x0) { std::multiset::insert(); } *(int *)((int)EVar6 + 0x184) = 6; *(byte *)((int)EVar6 + 0x518) = 1; (**(code **)(*(int *)EVar6 + 0xc))(); } } else { iVar7 = __RTDynamicCast(npc->_child,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor); fVar9 = local_88.x + 90.0; *(undefined4 *)(iVar7 + 0x420) = *(undefined4 *)(iVar7 + 0x41c); *(float *)(iVar7 + 0x418) = fVar9; *(float *)(iVar7 + 0x41c) = fVar9; *(float *)(iVar7 + 0xec) = fVar9 - 90.0; } iVar7 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar7 < 1) { npc->_state = 3; Entity_NPC::PlaySound(npc,0xd4,0.5,2,0,1.0); return; } return; } //@@ 00506320 NpcAI::ENTITY_CONSTANT_STONE_SHOOTER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 202 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CONSTANT_STONE_SHOOTER(Entity_NPC *npc) { uint *puVar1; float fVar2; float fVar3; undefined4 uVar4; byte *pbVar5; float fVar6; byte bVar7; RoomDescriptor *roomDesc; int iVar8; char *animName; float *extraout_EAX; byte *curAnimChar; uint uVar9; float *bulletNullFrame; ProjectileParams *params; byte *wantAnimChar; bool isLess; Color splatColor; Vector bulletPos; Vector local_c0; byte *local_b8; ProjectileParams projParams; float local_8; Game *game; int gridWidth; local_8 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); if (npc->_aiCallPhase == 1) { if (npc->_minecart != (EntityPtr)0x0) { return; } if (npc->_dead != 0) { return; } iVar8 = (npc->_pathfinder)._gridIndex; if (iVar8 < 0) { return; } Room::SetGridPath(g_game->_room,iVar8,3999); return; } iVar8 = npc->_state; if (iVar8 != 0) { if (iVar8 != 3) { if (iVar8 != 8) { if ((iVar8 == 0x10) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { if ((npc->_variant == 10) || (npc->_variant == 0xb)) { animName = "ClosedEyes1"; if (npc->_subtype != 0) { animName = "ClosedEyes2"; } bVar7 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { ANM2::Play(&npc->_sprite,(byte *)"ClosedEyes",0); } } goto LAB_00506b10; } if ((npc->_variant == 10) || (npc->_variant == 0xb)) { if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00506a0e: npc->_state = 3; npc->_subtype = (uint)(npc->_subtype == 0); } else { bVar7 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar7 != 0) { Entity_NPC::PlaySound(npc,0x106,1.0,0,0,1.0); params = ProjectileParams::ProjectileParams(&projParams); local_c0.x = 10.0; local_c0.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_c0,(npc->_subtype != 0) + 6,params); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_00506a0e; } roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); if ((((uint)roomDesc->Flags >> 1 & 1) != 0) || (((npc->_variant == 10 && (iVar8 = Entity_NPC::GetAliveEnemyCount(npc), iVar8 < 1)) && (*(int *)((int)g_game->_room + 0x11ec) < 1)))) { animName = "CloseEyes1"; if (npc->_subtype != 0) { animName = "CloseEyes2"; } bVar7 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 0x10; } goto LAB_00506b10; } ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.101; projParams.HeightModifier = 13.0; projParams.VelocityMulti = projParams.VelocityMulti * 1.07; bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { local_b8 = (byte *)g_vectorZero.x; bulletPos.y = g_vectorZero.y; bulletNullFrame = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"Bullet"); if (bulletNullFrame == (float *)0x0) { pbVar5 = local_b8; } else { bulletPos.y = bulletNullFrame[1] / 0.65; pbVar5 = (byte *)(*bulletNullFrame / 0.65); } local_c0.x = (npc->_v1).x * 7.0; bulletPos.x = (float)pbVar5 + (npc->_pos).x; bulletPos.y = bulletPos.y + (npc->_pos).y; local_c0.y = (npc->_v1).y * 7.0; Entity_NPC::FireProjectiles(npc,&bulletPos,&local_c0,0,&projParams); Entity_NPC::PlaySound(npc,0x106,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; switch(npc->_subtype) { case 0: animName = "IdleDown"; break; case 1: animName = "IdleUp"; break; case 2: animName = "IdleLeft"; break; case 3: animName = "IdleRight"; break; default: goto LAB_0050694d; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } LAB_0050694d: roomDesc = Game::GetCurrentRoomDesc(g_game); if (((uint)roomDesc->Flags >> 1 & 1) != 0) { ANM2::Play(&npc->_sprite,(byte *)"CloseEyes",0); npc->_state = 0x10; } goto LAB_00506b10; } if ((npc->_variant == 10) || (npc->_variant == 0xb)) { local_b8 = &DAT_00b601c4; pbVar5 = (npc->_sprite)._animState._animData; if (npc->_subtype != 0) { local_b8 = s_Idle2; } if (pbVar5 == (byte *)0x0) { LAB_0050670c: bVar7 = ANM2::SetAnimation(&npc->_sprite,local_b8,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = pbVar5; wantAnimChar = local_b8; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnimChar = *(byte **)pbVar5; } do { bVar7 = *curAnimChar; isLess = bVar7 < *wantAnimChar; if (bVar7 != *wantAnimChar) { LAB_005066f0: uVar9 = -(uint)isLess | 1; goto LAB_005066f5; } if (bVar7 == 0) break; bVar7 = curAnimChar[1]; isLess = bVar7 < wantAnimChar[1]; if (bVar7 != wantAnimChar[1]) goto LAB_005066f0; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar7 != 0); uVar9 = 0; LAB_005066f5: if ((uVar9 != 0) || ((pbVar5[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0050670c; } if (npc->_projectileCooldown < 1) { animName = "ShootAndRotate1"; npc->_state = 8; if (npc->_subtype != 0) { animName = "ShootAndRotate2"; } bVar7 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { switch(npc->_subtype) { case 0: animName = "IdleLeft"; break; case 1: animName = "IdleUp"; break; case 2: animName = "IdleRight"; break; case 3: animName = "IdleDown"; break; default: goto LAB_00506629; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } LAB_00506629: if (npc->_projectileCooldown < 1) { npc->_state = 8; switch(npc->_subtype) { case 0: ANM2::Play(&npc->_sprite,(byte *)"ShootLeft",0); break; case 1: ANM2::Play(&npc->_sprite,(byte *)"ShootUp",0); break; case 2: ANM2::Play(&npc->_sprite,(byte *)"ShootRight",0); break; case 3: ANM2::Play(&npc->_sprite,(byte *)"ShootDown",0); } } } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } goto LAB_00506b10; } PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); game = g_game; iVar8 = (npc->_pathfinder)._gridIndex; gridWidth = *(int *)((int)g_game->_room + 0xc); npc->_isInvicible = 1; npc->_aiCallFlags = 1; (npc->_targetPosition).x = (float)(iVar8 % gridWidth) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar8 / gridWidth) * 40.0 + 120.0; *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000001; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x2008; switch(npc->_subtype) { case 0: (npc->_v1).x = (float)&DAT_bf800000; (npc->_v1).y = 0.0; break; case 1: (npc->_v1).y = (float)&DAT_bf800000; goto LAB_00506470; case 2: (npc->_v1).x = 1.0; (npc->_v1).y = 0.0; break; case 3: (npc->_v1).y = 1.0; LAB_00506470: (npc->_v1).x = 0.0; } npc->_state = 3; if ((npc->_variant == 10) || (npc->_variant == 0xb)) { npc->_projectileCooldown = 0x16; roomDesc = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx,game->_currentDimensionIdx); if ((((uint)roomDesc->Flags >> 1 & 1) != 0) || (((npc->_variant == 10 && (iVar8 = Entity_NPC::GetAliveEnemyCount(npc), iVar8 < 1)) && (*(int *)((int)g_game->_room + 0x11ec) < 1)))) { animName = "ClosedEyes1"; if (npc->_subtype != 0) { animName = "ClosedEyes2"; } bVar7 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar7 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_00506546; } } else { npc->_projectileCooldown = 0x14; roomDesc = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx,game->_currentDimensionIdx); if (((uint)roomDesc->Flags >> 1 & 1) != 0) { ANM2::Play(&npc->_sprite,(byte *)"ClosedEyes",0); LAB_00506546: uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; npc->_state = 0x10; } } Color::Color(&splatColor); if (&npc->_splatColor != (ColorMod *)extraout_EAX) { fVar2 = extraout_EAX[1]; fVar3 = extraout_EAX[2]; fVar6 = extraout_EAX[3]; (npc->_splatColor)._tint[0] = *extraout_EAX; (npc->_splatColor)._tint[1] = fVar2; (npc->_splatColor)._tint[2] = fVar3; (npc->_splatColor)._tint[3] = fVar6; fVar2 = extraout_EAX[5]; fVar3 = extraout_EAX[6]; fVar6 = extraout_EAX[7]; (npc->_splatColor)._colorize[0] = extraout_EAX[4]; (npc->_splatColor)._colorize[1] = fVar2; (npc->_splatColor)._colorize[2] = fVar3; (npc->_splatColor)._colorize[3] = fVar6; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(extraout_EAX + 8); (npc->_splatColor)._offset[2] = extraout_EAX[10]; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; LAB_00506b10: if ((npc->_dead != 0) && (-1 < npc->_spawnGridIndex)) { Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); std::set::insert(&local_c0,&npc->_spawnGridIndex); } fVar2 = (npc->_targetPosition).y; fVar3 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar2 - fVar3; return; } //@@ 00506bd0 NpcAI::ENTITY_FLY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 13 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FLY(Entity_NPC *npc) { float fVar1; float fVar2; code *pcVar3; ANM2 *pAVar4; char cVar5; byte bVar6; uint uVar7; ColorMod *other; Entity_Player *player; EntityRef *refPtr; int3 extraout_var; Entity_Projectile *projectile; undefined4 uVar8; int3 extraout_var_00; Entity *secondFly; Entity *pEVar9; void *bombTimer; byte *animName; int iVar10; int3 extraout_var_01; EntityPtr *player; Vector *pVVar12; ProjectileParams *projParams; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; ProjectileParams *params; undefined4 extraout_ECX_04; undefined4 extraout_ECX_05; undefined4 extraout_ECX_06; undefined4 extraout_ECX_07; undefined4 extraout_ECX_08; byte *expectedAnimName; float *extraout_ECX_09; float *extraout_ECX_10; int extraout_ECX_11; code *extraout_EDX; int *extraout_EDX_00; EntityPtr *projectile; bool isNameLess; float fVar14; float fVar15; float fVar16; EntityPtr EVar17; EntityPtr dirX; EntityRef sourceRef; Vector targetPos; undefined1 local_2cc [12]; int fireplaceCount; undefined1 local_2bc [8]; float fStack_2b4; float fStack_2b0; float local_2ac; float fStack_2a8; float fStack_2a4; float fStack_2a0; float local_29c; float local_298; float local_294; Vector local_290; Vector local_288; Vector local_280; Vector local_278; Vector scratchVec; Vector local_268; Vector local_260; float local_258; EntityPtr local_254; EntityPtr local_250; char isSkatoleActive; ProjectileParams ringDeathParams; ProjectileParams shotParams; undefined1 local_108; ProjectileParams deathParams; Color projColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; byte *animData; Manager *manager; Room *room; puStack_20 = (undefined1 *)(&projColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af4180; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)((&projColor)[1]._colorize + 1); ExceptionList = &local_1c; local_268.y = (float)npc; local_24 = uVar7; if (npc->_type == 0x3d) { iVar10 = npc->_variant; if ((iVar10 == 5) || (iVar10 == 6)) { ENTITY_BULB(npc); ExceptionList = local_1c; return; } if (iVar10 == 4) { puStack_20 = (undefined1 *)(&projColor)[1]._offset; ENTITY_MAMA_FLY(npc); ExceptionList = local_1c; return; } } puStack_20 = (undefined1 *)(&projColor)[1]._offset; if (npc->_state == 0) { npc->_entityGridCollisionClass = 3; (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; npc->_state = 3; if (npc->_type == 0x3d) { if (npc->_variant == 1) { local_29c = -0.19607845; local_2ac = 0.0; fStack_2a8 = 0.0; fStack_2a4 = 0.0; fStack_2a0 = 0.0; local_298 = 0.50980395; local_2bc._0_4_ = 0.5; local_2bc._4_4_ = 0.5; fStack_2b4 = 0.5; fStack_2b0 = 1.0; local_294 = 0.19607845; puStack_20 = (undefined1 *)(&projColor)[1]._offset; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_2bc); } else { puStack_20 = (undefined1 *)(&projColor)[1]._offset; if (npc->_variant == 3) { puStack_20 = (undefined1 *)(&projColor)[1]._offset; other = (ColorMod *)Color::Color(0x3f800000); Color::operator_assign((Color *)&npc->_splatColor,other); } } } else { puStack_20 = (undefined1 *)(&projColor)[1]._offset; if (npc->_type == 0x333) { local_29c = 0.11764707; local_2ac = 0.0; fStack_2a8 = 0.0; fStack_2a4 = 0.0; fStack_2a0 = 0.0; local_298 = 0.11764707; local_2bc._0_4_ = 0.0; local_2bc._4_4_ = 0.0; fStack_2b4 = 0.0; fStack_2b0 = 1.0; local_294 = 0.11764707; puStack_20 = (undefined1 *)(&projColor)[1]._offset; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_2bc); if (npc->_variant == 1) { uVar8 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; npc->_isInvicible = 1; npc->_entityGridCollisionClass = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar8; } } } npc->_i1 = 0; } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1); if ((player == (Entity_Player *)0x0) || ((npc->_flags & 0x20000000) != 0)) { isSkatoleActive = '\0'; } else { isSkatoleActive = '\x01'; if (npc->_type == 0x12) { Entity_NPC::Morph(npc,0xd,0,0,-1); } } player = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); iVar10 = extraout_ECX; if ((player != (Entity_Player *)0x0) && (npc->_dead == 0)) { iVar10 = npc->_type; if ((iVar10 == 0x12) || (((iVar10 == 0xd || (iVar10 == 0xd6)) || (iVar10 == 0xf9)))) { award_fly_kill_points(&g_game->_scoreSheet,(Entity *)npc); (**(code **)(*(int *)npc + 0x28))(); Entity_Player::AddBlueFlies(player,1,&npc->_pos,(Entity *)0x0); iVar10 = extraout_ECX_03; } else { cVar5 = (**(code **)(*(int *)npc + 0x4c))(uVar7); iVar10 = extraout_ECX_00; if (cVar5 == '\0') { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x20000000); iVar10 = extraout_ECX_01; if (bVar6 == 0) { EntityRef::constructor(&sourceRef,(Entity *)player); Entity::AddCharmed((Entity *)npc,&sourceRef,-1,1,0); iVar10 = extraout_ECX_02; } } } } if (((npc->_type == 0x3d) && (npc->_controllerID != -1)) && (bVar6 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,iVar10), bVar6 != 0)) { refPtr = EntityRef::EntityRef((EntityRef *)(local_2bc + 4)); (*extraout_EDX)(refPtr); } local_258 = 8.0; if (npc->_dead != 0) { if (npc->_type == 0x3d) { iVar10 = npc->_variant; if (iVar10 == 0) { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar6 == 0) { ProjectileParams::ProjectileParams(&deathParams); bVar6 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar6) == 0 || extraout_var < 0) { local_278.x = 8.0; } else { local_278.x = 10.0; } local_278.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_278,6,params); } } else if (iVar10 == 1) { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar6 == 0) { projParams = ProjectileParams::ProjectileParams(&deathParams); pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_278.x = (pEVar9->_pos).x; local_278.y = (pEVar9->_pos).y; projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_278,10.0,projParams); fVar14 = projectile->_fallingAccel; fVar16 = (projectile->_velocity).x; fVar1 = (projectile->_velocity).y; uVar8 = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 2; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = uVar8; projectile->_fallingAccel = fVar14 - 0.3; fVar14 = projectile->_fallingSpeed; projectile->_scale = 1.6; (projectile->_velocity).x = fVar16 * 0.55; (projectile->_velocity).y = fVar1 * 0.55; projectile->_fallingSpeed = fVar14 * 0.7 - 13.0; Color::Color(&projColor); projColor._colorize[0] = 0.4; projColor._colorize[1] = 2.0; projColor._colorize[2] = 0.5; projColor._colorize[3] = 1.0; (**(code **)(*extraout_EDX_00 + 0x3c))(extraout_ECX_04,0xffffffff,0xff,0,1); } } else if (iVar10 == 2) { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar6 == 0) { uVar7 = Random(); pVVar12 = &npc->_pos; pEVar9 = Game::Spawn(g_game,1000,0x6e,pVVar12,&g_vectorZero,(Entity *)npc,0,uVar7); iVar10 = *(int *)pEVar9; (pEVar9->_posOffset).x = 0.0; (pEVar9->_posOffset).y = -15.0; (**(code **)(iVar10 + 0xc))(); fVar14 = 0.0; uVar8 = Color::Color(0x3f4ccccd); local_260.x = pVVar12->x + fVar14; local_260.y = (npc->_pos).y + fVar14; local_278.x = 1.0; local_278.y = 0.0; NpcHelper::spawn_tracer_effect198(extraout_ECX_05,uVar8,0x40800000); fVar14 = 0.0; uVar8 = Color::Color(0x3f4ccccd); local_260.x = pVVar12->x + fVar14; local_260.y = (npc->_pos).y + fVar14; local_278.x = 0.0; local_278.y = 1.0; NpcHelper::spawn_tracer_effect198(extraout_ECX_06,uVar8,0x40800000); fVar14 = 0.0; uVar8 = Color::Color(0x3f4ccccd); local_260.x = pVVar12->x + fVar14; local_260.y = (npc->_pos).y + fVar14; local_278.x = (float)&DAT_bf800000; local_278.y = 0.0; NpcHelper::spawn_tracer_effect198(extraout_ECX_07,uVar8,0x40800000); fVar14 = 0.0; uVar8 = Color::Color(0x3f4ccccd); local_288.x = pVVar12->x + fVar14; local_288.y = (npc->_pos).y + fVar14; local_278.x = 0.0; local_278.y = (float)&DAT_bf800000; NpcHelper::spawn_tracer_effect198(extraout_ECX_08,uVar8,0x40800000); } } else if (iVar10 == 3) { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar6 == 0) { ProjectileParams::ProjectileParams(&deathParams); Color::operator_assign((Color *)&deathParams.Color,(ColorMod *)&DAT_00c34e54); bVar6 = Game::IsHardMode(); if (CONCAT31(extraout_var_00,bVar6) == 0 || extraout_var_00 < 0) { local_288.x = 8.0; } else { local_288.x = 10.0; } local_288.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_288,7,&deathParams); uVar7 = Random(); pEVar9 = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); iVar10 = *(int *)pEVar9; (pEVar9->_sprite)._scale.x = 4.0; (pEVar9->_sprite)._scale.y = 4.0; pAVar4 = &pEVar9[1]._sprite; (pAVar4->_filename)._buf[8] = -0x3e; (pAVar4->_filename)._buf[9] = '\x01'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &pEVar9[1]._sprite; (pAVar4->_filename)._buf[0xc] = -0x3e; (pAVar4->_filename)._buf[0xd] = '\x01'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (**(code **)(iVar10 + 0xc))(); } } else if ((iVar10 == 7) && (bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar6 == 0)) { ProjectileParams::ProjectileParams(&deathParams); deathParams.Scale = 1.8; deathParams.BulletFlags._0_4_ = 0; deathParams.BulletFlags._4_4_ = 0x40; deathParams.CircleAngle = 0.0; local_288.x = 8.0; local_288.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_288,9,&deathParams); } } else if (((npc->_type == 0x50) && (-20.0 < npc->_health)) && (isSkatoleActive == '\0')) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_254 = (EntityPtr)((pEVar9->_pos).y - (npc->_pos).y); local_250 = (EntityPtr)((pEVar9->_pos).x - (npc->_pos).x); fVar14 = sqrtf((float)local_254 * (float)local_254 + (float)local_250 * (float)local_250); if (fVar14 <= 0.0) { pVVar12 = MusicManager::RandomVector(&scratchVec); local_260.x = pVVar12->x * 10.0; fVar16 = pVVar12->y; } else { fVar16 = (float)local_250 / fVar14; local_260.x = -(((float)local_254 / fVar14) * 10.0); } local_260.y = fVar16 * 10.0; local_254 = (EntityPtr)local_260.x; local_250 = (EntityPtr)local_260.y; uVar7 = Random(); local_288.x = (float)local_254 + (npc->_pos).x; local_288.y = (float)local_250 + (npc->_pos).y; pEVar9 = Game::Spawn(g_game,0x12,0,&local_288,&local_260,(Entity *)npc,0,uVar7); uVar7 = Random(); local_278.x = g_vectorZero.x - (float)local_254; local_278.y = g_vectorZero.y - (float)local_250; local_260.x = ((Vector *)((int)local_268.y + 0x33c))->x - (float)local_254; local_260.y = ((Vector *)((int)local_268.y + 0x33c))->y - (float)local_250; secondFly = Game::Spawn(g_game,0x12,0,&local_260,&local_278,(Entity *)local_268.y,0,uVar7); uVar8 = *(undefined4 *)((int)&pEVar9->_flags + 4); *(uint *)&pEVar9->_flags = (uint)pEVar9->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar9->_flags + 4) = uVar8; uVar8 = *(undefined4 *)((int)&secondFly->_flags + 4); *(uint *)&secondFly->_flags = (uint)secondFly->_flags & 0xfffffffb; *(undefined4 *)((int)&secondFly->_flags + 4) = uVar8; (**(code **)(*(int *)pEVar9 + 0xc))(); (**(code **)(*(int *)secondFly + 0xc))(); npc = (Entity_NPC *)local_268.y; } } if (0 < npc->_i1) { local_250 = (EntityPtr)(npc->_maxHitPoints / 60.0 + npc->_health); player = &local_250; if (npc->_maxHitPoints <= (float)local_250) { player = (EntityPtr *)&npc->_maxHitPoints; } npc->_health = (float)*player; npc->_i1 = npc->_i1 + -1; } if ((npc->_dead != 0) && (npc->_type == 0x333)) { uVar7 = Random(); pEVar9 = Game::Spawn(g_game,4,0xe,&npc->_pos,&npc->_velocity,(Entity *)npc,0,uVar7); ANM2::Play(&pEVar9->_sprite,(byte *)"Appear",0); if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,8.0); } local_254 = npc->_parent; if (pEVar9->_parent != (EntityPtr)0x0) { local_250 = (EntityPtr)&pEVar9->_parent; std::multiset::erase(&local_250); } pEVar9->_parent = local_254; if (local_254 != (EntityPtr)0x0) { std::multiset::insert(&pEVar9->_parent); } uVar7 = Random(); bombTimer = (void *)(0x3c - uVar7 % 0xf); *(void **)&pEVar9[1].field_0x4 = bombTimer; pEVar9[1]._damageEvents._begin = bombTimer; } iVar10 = npc->_type; if (((iVar10 == 0xd) || (iVar10 == 0x50)) || ((iVar10 == 0x3d || (iVar10 == 0x12)))) { animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00507880: bVar6 = ANM2::SetAnimation(&npc->_sprite,s_Fly,1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animName = animData; if (0xf < *(uint *)(animData + 0x14)) { animName = *(byte **)animData; } expectedAnimName = s_Fly; do { bVar6 = *animName; isNameLess = bVar6 < *expectedAnimName; if (bVar6 != *expectedAnimName) { LAB_00507862: uVar7 = -(uint)isNameLess | 1; goto LAB_00507867; } if (bVar6 == 0) break; bVar6 = animName[1]; isNameLess = bVar6 < expectedAnimName[1]; if (bVar6 != expectedAnimName[1]) goto LAB_00507862; animName = animName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar6 != 0); uVar7 = 0; LAB_00507867: if ((uVar7 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00507880; } if (npc->_type == 0x3d) { (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } } else if (iVar10 == 0xe) { if ((uint)npc->_state < 5) { ANM2::Play(&npc->_sprite,s_Fly,0); } else if ((npc->_state == 8) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { npc->_state = 4; } } else if (((iVar10 == 0xd6) || (iVar10 == 0xf9)) || ((iVar10 == 0x333 && (npc->_state == 3)))) { ANM2::Play(&npc->_sprite,s_Idle,0); } if ((npc->_type == 0xd) && (uVar7 = Random(), uVar7 % 1000 == 0)) { room = g_game->_room; iVar10 = Room::GetGridIndex(room,&npc->_pos); if ((-1 < iVar10) && (((iVar10 < 0x1c0 && (local_250 = *(EntityPtr *)(room->_gridEntities + iVar10), local_250 != (EntityPtr)0x0)) && (*(EntityPtr *)((int)local_250 + 4) == (EntityPtr)0xe)))) { pcVar3 = *(code **)((int)*(EntityPtr *)local_250 + 0x10); EntityRef::constructor(&sourceRef,(Entity *)npc); (*pcVar3)(1,&sourceRef); Entity_NPC::Morph(npc,0xe,0,0,-1); npc->_health = npc->_maxHitPoints; } } if ((npc->_type == 0xe) && (isSkatoleActive == '\0')) { if ((npc->_projectileCooldown < 1) && (bVar6 = Entity_NPC::IsTargetInAttackRange(npc,200.0,0,7), bVar6 != 0)) { iVar10 = 0x23; if (npc->_variant == 2) { iVar10 = 0x3f; } npc->_projectileCooldown = iVar10; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); npc->_state = 8; Entity_NPC::UpdateControllerMovement(npc,1); bVar6 = Vector::operator_eq(&npc->_controllerMovement,&g_vectorZero); if (bVar6 == 0) { fVar14 = *extraout_ECX_09; } else { pEVar9 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (pEVar9->_pos).x - (npc->_pos).x; } (npc->_sprite)._flipX = fVar14 < 0.0; } if (((npc->_state == 8) && (Entity_NPC::UpdateControllerMovement(npc,0), (npc->_sprite)._animState._animData != (void *)0x0)) && (bVar6 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar6 != 0)) { EVar17 = (EntityPtr)&npc->_pos; bVar6 = Vector::operator_eq(&npc->_controllerMovement,&g_vectorZero); if (bVar6 == 0) { local_280.x = *extraout_ECX_10; local_280.y = extraout_ECX_10[1]; } else { pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_280.x = (pEVar9->_pos).x - ((Vector *)EVar17)->x; local_280.y = (pEVar9->_pos).y - (npc->_pos).y; } local_254 = (EntityPtr)&local_280; local_260.x = local_280.x; local_260.y = local_280.y; local_250 = EVar17; if (npc->_variant == 2) { ProjectileParams::ProjectileParams(&shotParams); shotParams.Scale = 1.4; shotParams.FallingAccelModifier = -0.15; shotParams.FallingSpeedModifier = 1.0; shotParams.Spread = 1.2; shotParams.BulletFlags._0_4_ = 0; shotParams.BulletFlags._4_4_ = 0x400000; local_108 = 1; fVar14 = sqrtf(local_260.y * local_260.y + local_260.x * local_260.x); if (0.0 < fVar14) { local_260.y = (7.0 / fVar14) * local_260.y; local_260.x = (7.0 / fVar14) * local_260.x; } projParams = &shotParams; uVar7 = 4; EVar17 = local_250; } else { fVar14 = local_280.y; fVar16 = local_280.x; bVar6 = Game::IsHardMode(); if (CONCAT31(extraout_var_01,bVar6) == 0 || extraout_var_01 < 0) { local_258 = 7.0; } else if (extraout_ECX_11 != 1) { local_258 = 10.0; } fVar14 = sqrtf(fVar14 * fVar14 + fVar16 * fVar16); if (0.0 < fVar14) { local_260.x = (local_258 / fVar14) * *(float *)local_254; local_260.y = *(float *)((int)local_254 + 4) * (local_258 / fVar14); } projParams = ProjectileParams::ProjectileParams(&shotParams); uVar7 = (uint)(npc->_variant == 1); } Entity_NPC::FireProjectiles(npc,(Vector *)EVar17,&local_260,uVar7,projParams); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); } if (0 < npc->_projectileCooldown) { npc->_friction = npc->_friction * 0.8; fVar14 = (npc->_v1).x; npc->_projectileCooldown = npc->_projectileCooldown - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); (npc->_v1).x = fVar14 * 0.7; (npc->_v1).y = (npc->_v1).y * 0.7; } } if (npc->_spawnerType == 0x66) { if (npc->_subtype == 0) goto LAB_00507cdf; ENTITY_FLY_isaac_spawned(npc); } else { if (npc->_spawnerType == 0x369) { ENTITY_FLY_orbit_parent(npc); ExceptionList = local_1c; return; } LAB_00507cdf: iVar10 = npc->_type; if (iVar10 == 0x333) { if (npc->_state != 3) { if (npc->_state == 0x10) { if (npc->_stateFrame == -1) { npc->_friction = npc->_friction * 0.85; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_mass <= 50.0 && npc->_mass != 50.0) { local_268.y = (npc->_velocity).x; local_258 = (npc->_velocity).y; fVar14 = sqrtf(local_268.y * local_268.y + local_258 * local_258); if (0.0 < fVar14) { (npc->_velocity).x = local_268.y * (10.0 / fVar14); (npc->_velocity).y = local_258 * (10.0 / fVar14); } npc->_mass = 50.0; } ANM2::Play(&npc->_sprite,(byte *)"Cannonball",0); npc->_stateFrame = npc->_stateFrame + 1; if ((0x2d < npc->_stateFrame) || (fVar14 = (npc->_velocity).y, fVar16 = (npc->_velocity).x, fVar14 = sqrtf(fVar16 * fVar16 + fVar14 * fVar14), fVar14 < 5.0)) { ANM2::Play(&npc->_sprite,(byte *)"Deploy",0); npc->_stateFrame = -1; npc->_mass = *(float *)((int)npc->_config + 0x44); } manager = g_manager; if (npc->_collidesWithGrid == 0) { ExceptionList = local_1c; return; } fVar14 = (npc->_gridCollisionVelocity).y; fVar16 = (npc->_gridCollisionVelocity).x; fVar1 = (npc->_gridCollisionNormal).x; fVar2 = (npc->_gridCollisionNormal).y; local_268.y = 5.60519e-44; fVar15 = fVar14 * fVar2 + fVar16 * fVar1; (npc->_velocity).x = fVar16 - (fVar1 + fVar1) * fVar15; (npc->_velocity).y = fVar14 - (fVar2 + fVar2) * fVar15; seed_fart_sound_override((int *)&local_268.y); SoundEffects::Play(&manager->_sfxManager,(int)local_268.y,1.0,2,0,1.0,0.0); ExceptionList = local_1c; return; } goto LAB_005084a6; } if (npc->_variant == 1) { EVar17 = npc->_parent; npc->_isInvicible = 1; if (EVar17 == (EntityPtr)0x0) { refPtr = EntityRef::EntityRef((EntityRef *)(local_2bc + 4)); (**(code **)(*(int *)npc + 0x24))(refPtr); local_258 = (npc->_v1).x * 0.017453292; fVar14 = cos(local_258); local_250 = (EntityPtr)(fVar14 * 15.0); fVar14 = sin(local_258); (npc->_velocity).x = (float)local_250; (npc->_velocity).y = fVar14 * 15.0; uVar7 = Random(); pEVar9 = Game::Spawn(g_game,4,0xe,&npc->_pos,&npc->_velocity,(Entity *)npc,0,uVar7); ANM2::Play(&pEVar9->_sprite,(byte *)"Appear",0); Sprite::SetFrame_1((Sprite *)&pEVar9->_sprite,8); Entity::SetParent(pEVar9,(Entity *)*(EntityPtr *)((int)local_268.y + 0x3bc)); uVar7 = Random(); bombTimer = (void *)(0x3c - uVar7 % 0xf); *(void **)&pEVar9[1].field_0x4 = bombTimer; pEVar9[1]._damageEvents._begin = bombTimer; ExceptionList = local_1c; return; } fVar14 = normalize_angle_degrees(npc->_speedMultiplier * 5.0 + (npc->_v1).x); (npc->_v1).x = fVar14; local_268.y = fVar14 * 0.017453292; fVar14 = cos(local_268.y); local_258 = fVar14 * 40.0 + *(float *)((int)EVar17 + 0x33c); fVar14 = sin(local_268.y); fVar16 = fVar14 * 40.0 + *(float *)((int)EVar17 + 0x340); (npc->_targetPosition).x = local_258; (npc->_targetPosition).y = fVar16; fVar14 = (npc->_pos).y; (npc->_velocity).x = local_258 - (npc->_pos).x; (npc->_velocity).y = fVar16 - fVar14; ExceptionList = local_1c; return; } } bVar6 = Entity::IsFrame((Entity *)npc,3,0); if (bVar6 != 0) { if ((((iVar10 == 0x12) || (iVar10 == 0x50)) || (iVar10 == 0xd6)) || ((iVar10 == 0xf9 || (iVar10 == 0x333)))) { EVar17 = npc->_parent; if ((EVar17 != (EntityPtr)0x0) && (npc->_controllerID == -1)) { local_258 = *(float *)((int)EVar17 + 0x340) - (npc->_pos).y; local_268.y = *(float *)((int)EVar17 + 0x33c) - (npc->_pos).x; local_250 = (EntityPtr)sqrtf(local_258 * local_258 + local_268.y * local_268.y); if ((float)local_250 < 260.0) { fVar14 = sin((float)g_game->_frameCount * 0.02); EVar17 = local_250; local_254 = (EntityPtr)0xc0a00000; local_280.y = 5.0; local_250 = (EntityPtr)((float)local_250 - (fVar14 * 5.0 + 65.0)); player = &local_250; if ((float)local_250 <= -5.0) { player = &local_254; } projectile = (EntityPtr *)&local_280.y; if ((float)*player <= 5.0 && (float)*player != 5.0) { projectile = player; } scratchVec.y = ((float)*projectile * local_258 * 0.5) / (float)EVar17; scratchVec.x = ((float)*projectile * local_268.y * 0.5) / (float)EVar17; Entity::AddVelocity_divided((Entity *)npc,&scratchVec,0); scratchVec.y = ((local_268.y * 0.2) / (ABS(-(float)*projectile) + 2.0)) / npc->_friction; scratchVec.x = -((local_258 * 0.2) / (ABS(-(float)*projectile) + 2.0)) / npc->_friction; Entity::AddVelocity_divided((Entity *)npc,&scratchVec,0); iVar10 = npc->_type; } } if (iVar10 != 0x12) goto LAB_005082c0; } else { LAB_005082c0: if (((iVar10 != 0x3d) && (iVar10 != 0x50)) && ((iVar10 != 0xd6 && (((iVar10 != 0xf9 && (iVar10 != 0x333)) && (isSkatoleActive == '\0')))))) { pVVar12 = MusicManager::RandomVector(&local_268); uVar7 = Random(); local_280.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; uVar7 = Random(); fVar14 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * local_280.y * 240.0; room = g_game->_room; scratchVec.y = fVar14 * pVVar12->y + (npc->_pos).y; scratchVec.x = fVar14 * pVVar12->x + (npc->_pos).x; iVar10 = Room::GetGridIndex(room,&scratchVec); if (((-1 < iVar10) && (iVar10 < 0x1c0)) && ((room->_gridEntities[iVar10] != (void *)0x0 && (*(int *)((int)room->_gridEntities[iVar10] + 4) == 0xe)))) { pVVar12 = Room::GetGridPosition(room,&local_290,iVar10); (npc->_targetPosition).x = pVVar12->x; (npc->_targetPosition).y = pVVar12->y; } uVar7 = Random(); if (uVar7 % 100 == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_2cc,0x21, -1,-1,0,0); local_14 = 0.0; if (fireplaceCount != 0) { iVar10 = Isaac::Random(fireplaceCount); iVar10 = *(int *)(local_2cc._4_4_ + iVar10 * 4); fVar14 = *(float *)(iVar10 + 0x340); (npc->_targetPosition).x = *(float *)(iVar10 + 0x33c); (npc->_targetPosition).y = fVar14; } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_2cc); } goto LAB_005084a6; } } pVVar12 = Entity_NPC::CalcTargetPosition(npc,&targetPos,0.0); (npc->_targetPosition).x = pVVar12->x; (npc->_targetPosition).y = pVVar12->y; } } LAB_005084a6: if (((npc->_type == 0xd) || (npc->_type == 0xe)) && ((npc->_spawnerType != 0x66 || (npc->_subtype == 0)))) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } if ((((npc->_flags & 0x1000800) != 0) && (bVar6 = Entity::HasEntityFlags((Entity *)npc,0x720), bVar6 == 0)) && (npc->_controllerID == -1)) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); fVar14 = (npc->_pos).y - (pEVar9->_pos).y; fVar16 = (npc->_pos).x - (pEVar9->_pos).x; fVar14 = sqrtf(fVar14 * fVar14 + fVar16 * fVar16); if (fVar14 < 400.0) { local_258 = 100.0; if (200.0 < fVar14) { local_258 = 100.0 - ((fVar14 - 200.0) / 200.0) * 100.0; } local_268.y = 220.0; if (npc->_collidesWithGrid != 0) { local_268.y = 360.0; } pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_250 = (EntityPtr)((npc->_pos).x - (pEVar9->_pos).x); local_254 = (EntityPtr)((npc->_pos).y - (pEVar9->_pos).y); uVar7 = Random(); local_280.y = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * local_268.y - local_268.y * 0.5) * 0.017453292; local_268.y = cos(local_280.y); fVar14 = sin(local_280.y); scratchVec.x = local_268.y * (float)local_250 - (float)local_254 * fVar14; scratchVec.y = (float)local_254 * local_268.y + fVar14 * (float)local_250; pVVar12 = Vector::Resized(&scratchVec,(Vector *)(local_2cc + 8),local_258); fVar14 = pVVar12->x; fVar16 = (npc->_pos).x; (npc->_targetPosition).y = pVVar12->y + (npc->_pos).y; (npc->_targetPosition).x = fVar14 + fVar16; (npc->_v1).x = (npc->_v1).x * 0.5; (npc->_v1).y = (npc->_v1).y * 0.5; } } if ((npc->_spawnerType != 0x66) || (npc->_subtype == 0)) { if ((((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) && (iVar10 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar10 != 0)) { iVar10 = npc->_type; local_268.y = 30.0; if (((iVar10 == 0x12) || (iVar10 == 0x50)) || ((iVar10 == 0xd6 || ((iVar10 == 0xf9 || (iVar10 == 0x333)))))) { local_268.y = 25.0; } if ((iVar10 == 0x3d) || (1.1 < (npc->_sprite)._scale.x)) { local_268.y = 15.0; } local_254 = (EntityPtr)((npc->_targetPosition).x - (npc->_pos).x); fVar14 = (npc->_targetPosition).y - (npc->_pos).y; if (npc->_controllerID == -1) { if (((iVar10 == 0xd6) || (iVar10 == 0x333)) && (isSkatoleActive == '\0')) { fVar16 = -fVar14; EVar17 = local_254; LAB_005088a1: fVar14 = fVar14 + (float)EVar17; local_254 = (EntityPtr)(fVar16 + (float)local_254); } else if ((iVar10 == 0xf9) && (isSkatoleActive == '\0')) { EVar17 = (EntityPtr)-(float)local_254; fVar16 = fVar14; goto LAB_005088a1; } local_250 = (EntityPtr)(fVar14 * 0.5); if (npc->_parent != (EntityPtr)0x0) { local_254 = (EntityPtr)((float)local_254 * 0.2); local_250 = (EntityPtr)((float)local_250 * 0.2); } } else { pVVar12 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); iVar10 = npc->_type; local_254 = (EntityPtr)(pVVar12->x * 100.0); local_250 = (EntityPtr)(pVVar12->y * 100.0); } fVar14 = sqrtf((float)local_254 * (float)local_254 + (float)local_250 * (float)local_250); EVar17 = local_250; dirX = local_254; if (0.0 < fVar14) { dirX = (EntityPtr)((float)local_254 / fVar14); EVar17 = (EntityPtr)((float)local_250 / fVar14); } if (npc->_isKillOnTouch != 0) { npc->_friction = npc->_friction * 0.9; } if (((iVar10 != 0x12) && (iVar10 != 0x3d)) && ((iVar10 != 0x50 && (((iVar10 != 0xd6 && (iVar10 != 0xf9)) && (iVar10 != 0x333)))))) { (npc->_v1).x = (npc->_v1).x * 0.7; (npc->_v1).y = (npc->_v1).y * 0.7; iVar10 = npc->_type; } if (local_268.y < fVar14) { scratchVec.y = (fVar14 - local_268.y) * 0.08; if (1.2 <= scratchVec.y) { scratchVec.y = 1.2; } if ((((iVar10 == 0xd6) || (iVar10 == 0xf9)) || (iVar10 == 0x333)) && (isSkatoleActive == '\0')) { scratchVec.y = scratchVec.y + scratchVec.y; } scratchVec.x = (float)dirX * scratchVec.y; scratchVec.y = (float)EVar17 * scratchVec.y; Entity::AddVelocity_divided((Entity *)npc,&scratchVec,0); } } iVar10 = npc->_type; if (((iVar10 == 0xd6) || (iVar10 == 0xf9)) || (iVar10 == 0x333)) { if (((npc->_collidesWithGrid != 0) && (uVar7 = Random(), uVar7 % 3 == 0)) && (bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar6 == 0)) { uVar7 = Random(); pVVar12 = Vector::Resized(&npc->_gridCollisionNormal,&local_268, -2.0 - (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 1.5); (npc->_v2).x = pVVar12->x; (npc->_v2).y = pVVar12->y; } fVar14 = (npc->_v2).y; fVar16 = (npc->_v2).x; if (fVar16 * fVar16 + fVar14 * fVar14 <= 1.0) { (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; } else { Entity::AddVelocity_divided((Entity *)npc,&npc->_v2,0); (npc->_v2).x = (npc->_v2).x * 0.9; (npc->_v2).y = (npc->_v2).y * 0.9; } } } if (npc->_entityGridCollisionClass == 0) { pVVar12 = &npc->_pos; bVar6 = Room::IsPositionInRoom(g_game->_room,pVVar12,npc->_size); if (bVar6 != 0) { local_280.x = pVVar12->x; local_280.y = (npc->_pos).y; iVar10 = Room::GetGridCollisionAtPos(g_game->_room,*pVVar12); if (iVar10 < 4) { npc->_entityGridCollisionClass = 3; } } } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { if (npc->_controllerID == -1) { uVar7 = Random(); if (uVar7 % 5 == 0) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar9->_pos).x - (npc->_pos).x; scratchVec.y = (pEVar9->_pos).y - (npc->_pos).y; pVVar12 = Vector::Normalized(&scratchVec,&local_280); fVar14 = npc->_speedMultiplier; fVar16 = pVVar12->y; (npc->_velocity).x = pVVar12->x * 0.7 * fVar14 + (npc->_velocity).x; (npc->_velocity).y = fVar16 * 0.7 * fVar14 + (npc->_velocity).y; } } else { iVar10 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar10 != 0) { Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); fVar14 = npc->_speedMultiplier; (npc->_velocity).x = scratchVec.x * 1.1 * fVar14 + (npc->_velocity).x; (npc->_velocity).y = scratchVec.y * 1.1 * fVar14 + (npc->_velocity).y; } } } uVar7 = g_game->_frameCount & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } if (uVar7 == 1) { pVVar12 = MusicManager::RandomVector(&scratchVec); fVar14 = pVVar12->y; (npc->_v1).x = (pVVar12->x * 0.6 + (npc->_v1).x) * 0.4; (npc->_v1).y = (fVar14 * 0.6 + (npc->_v1).y) * 0.4; } if (g_game->_frameCount % 3 != 2) goto LAB_00508ebc; if (npc->_spawnerType != 0x43) { fVar14 = (npc->_pos).y; if (230.0 <= fVar14) { if (420.0 < fVar14) { fVar14 = (npc->_v1).y - 0.06; goto LAB_00508df8; } } else { fVar14 = (npc->_v1).y + 0.06; LAB_00508df8: (npc->_v1).y = fVar14; } fVar14 = (npc->_pos).x; if (fVar14 <= 540.0) { if (80.0 <= fVar14) goto LAB_00508e40; fVar14 = (npc->_v1).x + 0.06; } else { fVar14 = (npc->_v1).x - 0.06; } (npc->_v1).x = fVar14; } LAB_00508e40: fVar14 = npc->_friction; fVar16 = (npc->_v1).x; fVar1 = (npc->_v1).y; if (fVar14 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).y = (fVar2 * (fVar1 + fVar1)) / fVar14 + (npc->_velocity).y; (npc->_velocity).x = (fVar2 * (fVar16 + fVar16)) / fVar14 + (npc->_velocity).x; fVar14 = npc->_friction; } npc->_friction = fVar14 * 0.6; LAB_00508ebc: if (((npc->_type == 0xf9) && (npc->_dead != 0)) && (bVar6 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar6 == 0)) { projParams = ProjectileParams::ProjectileParams(&ringDeathParams); local_290.x = 8.0; local_290.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_290,9,projParams); } ExceptionList = local_1c; return; } //@@ 00508f40 NpcAI::ENTITY_GAPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 10 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GAPER(Entity_NPC *npc) { uint *puVar1; float fVar2; undefined1 *puVar3; byte bVar4; uint uVar5; undefined4 *damageEvent; float *extraout_EAX; float *frame; LayerState *layer; int iVar6; Entity *tmpEntity; ProjectileParams *projParams; Vector *tmpVec; int *effect; char *animName; Vector *this; float *extraout_ECX; void *freeBlock; uint uVar7; ANM2 *pAVar8; float fVar9; float fVar10; undefined4 uVar11; int iVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; undefined4 local_218 [8]; undefined4 local_1f8; undefined4 uStack_1f4; undefined4 local_1f0; Vector spinShotVelocity; Vector local_1e4; Vector local_1dc; Vector local_1d4; Vector scratchVec; Vector local_1c4; float *local_1bc; ProjectileParams spinShotParams; ProjectileParams shotParams; std_string walkHoriAnim; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_50 + 0x4c; local_14 = -1; puStack_18 = &LAB_00af41c5; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_24 = uVar5; if ((npc->_type == 10) && (npc->_variant == 3)) { puStack_20 = local_50 + 0x4c; ENTITY_ROTTEN_GAPER(npc); ExceptionList = local_1c; return; } if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (damageEvent[6] == npc->_type) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } puVar3 = local_50 + 0x4c; if (npc->_state == 0) { iVar6 = npc->_type; npc->_state = 4; npc->_stateFrame = 0; if (iVar6 == 0x12e) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 8; npc->_isInvicible = 1; puVar3 = local_50 + 0x4c; } else { puVar3 = local_50 + 0x4c; if ((iVar6 != 0xd0) && (puVar3 = local_50 + 0x4c, iVar6 != 0x101)) { if ((iVar6 == 10) && (npc->_variant == 2)) { puStack_20 = local_50 + 0x4c; ANM2::PlayOverlay(&npc->_sprite,s_Head,0); puVar3 = puStack_20; } else { bVar4 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); puVar3 = puStack_20; if ((bVar4 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); puVar3 = puStack_20; } } } } puStack_20 = puVar3; if ((npc->_type == 0xd0) && (npc->_variant == 2)) { (npc->_sprite)._overlayRenderFirst = 1; ANM2::PlayOverlay(&npc->_sprite,&DAT_00b60d60,0); } bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar4 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } puVar3 = puStack_20; if (npc->_type == 0xfc) { local_1f8 = 0; uStack_1f4 = 0; local_1f0 = 0; if (&npc->_splatColor != (ColorMod *)local_218) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.1; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } } else if (npc->_type == 0x12e) { npc->_entityCollisionClass = 2; Color::Color((Color *)local_50); if (&npc->_splatColor != (ColorMod *)extraout_EAX) { fVar9 = extraout_EAX[1]; fVar10 = extraout_EAX[2]; fVar2 = extraout_EAX[3]; (npc->_splatColor)._tint[0] = *extraout_EAX; (npc->_splatColor)._tint[1] = fVar9; (npc->_splatColor)._tint[2] = fVar10; (npc->_splatColor)._tint[3] = fVar2; fVar9 = extraout_EAX[5]; fVar10 = extraout_EAX[6]; fVar2 = extraout_EAX[7]; (npc->_splatColor)._colorize[0] = extraout_EAX[4]; (npc->_splatColor)._colorize[1] = fVar9; (npc->_splatColor)._colorize[2] = fVar10; (npc->_splatColor)._colorize[3] = fVar2; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(extraout_EAX + 8); (npc->_splatColor)._offset[2] = extraout_EAX[10]; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; uVar7 = Random(); npc->_i1 = uVar7 % 0x3c + 0x5a; puVar3 = puStack_20; if (((npc->_variant == 10) && (ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadIdle",0), puVar3 = puStack_20, (npc->_sprite)._animState._animData != (void *)0x0)) && (local_1bc = AnimationState::GetNullFrameById(&(npc->_sprite)._animState,2), puVar3 = puStack_20, local_1bc != (float *)0x0)) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_pos).x = *local_1bc; (layer->_pos).y = local_1bc[1]; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_size).x = local_1bc[4]; (layer->_size).y = local_1bc[5]; puVar3 = puStack_20; } } } puStack_20 = puVar3; if (((npc->_type == 0xd0) && (npc->_variant == 2)) && (((npc->_sprite)._animState._animData != (void *)0x0 && (((frame = AnimationState::GetNullFrame(&(npc->_sprite)._animState,(byte *)"FirePos"), frame != (float *)0x0 && (*(char *)(frame + 3) != '\0')) && (layer = ANM2::GetLayer(&npc->_sprite,&DAT_00b60d60), layer != (LayerState *)0x0)))))) { (layer->_pos).x = *frame; (layer->_pos).y = frame[1]; (layer->_size).x = frame[4]; (layer->_size).y = frame[5]; } iVar6 = npc->_state; if (iVar6 == 0) { ExceptionList = local_1c; return; } if (npc->_dead != 0) { if (npc->_health <= -25.0) { ExceptionList = local_1c; return; } uVar5 = Random(); if ((uVar5 & 1) != 0) { ExceptionList = local_1c; return; } iVar6 = npc->_type; if (iVar6 == 10) { uVar5 = Random(); if ((uVar5 % 3 == 0) && (npc->_variant != 2)) { iVar6 = 1; } else { iVar6 = 0; } Entity_NPC::Morph(npc,0xb,iVar6,0,-1); npc->_dead = 0; uVar5 = Random(); npc->_health = npc->_maxHitPoints; npc->_projectileCooldown = uVar5 % 0x14 + 0x14; ExceptionList = local_1c; return; } if (iVar6 == 0xd0) { if (npc->_variant == 1) { Entity_NPC::Morph(npc,0xd2,0,0,-1); npc->_dead = 0; npc->_health = npc->_maxHitPoints; ExceptionList = local_1c; return; } if (npc->_variant == 2) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x21,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); fVar9 = (tmpEntity->_pos).y; (tmpEntity->_targetPosition).x = (tmpEntity->_pos).x; (tmpEntity->_targetPosition).y = fVar9; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (iVar6 != 0x101) { ExceptionList = local_1c; return; } if (npc->_variant == 0) { Entity_NPC::Morph(npc,0xd0,0,0,-1); npc->_dead = 0; npc->_health = npc->_maxHitPoints; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } iVar12 = npc->_type; if ((iVar12 == 0xd0) || (iVar12 == 0x101)) { if (iVar6 == 4) { if (npc->_stateFrame < 100) { npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } tmpEntity = Entity_NPC::GetPlayerTarget(npc); if (npc->_controllerID == -1) { bVar4 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if (((bVar4 == 0) || (fVar9 = (tmpEntity->_pos).x - (npc->_pos).x, fVar10 = (tmpEntity->_pos).y - (npc->_pos).y, 40000.0 <= fVar10 * fVar10 + fVar9 * fVar9 )) || (uVar7 = Random(), uVar7 % 0x78 != 0)) goto LAB_00509511; } else { bVar4 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar4 == 0) { tmpVec = Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.1); bVar4 = Vector::operator_ne(tmpVec,&g_vectorZero); if (bVar4 == 0) goto LAB_00509511; } } if (99 < npc->_stateFrame) { Entity_NPC::PlaySound(npc,0xa7,1.0,5,0,1.0); fVar9 = (npc->_velocity).x; fVar10 = (npc->_velocity).y; npc->_state = 8; npc->_stateFrame = 0; if ((ABS(fVar10) < ABS(fVar9)) && (0.01 < fVar9 * fVar9 + fVar10 * fVar10)) { ANM2::Play(&npc->_sprite,(byte *)"AttackHori",0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; Entity_NPC::UpdateControllerMovement(npc,1); ExceptionList = local_1c; return; } ANM2::Play(&npc->_sprite,(byte *)"AttackVert",0); Entity_NPC::UpdateControllerMovement(npc,1); ExceptionList = local_1c; return; } } else if (iVar6 == 8) { Entity_NPC::UpdateControllerMovement(npc,0); if ((npc->_type == 0x101) && (npc->_variant == 0)) { bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Target"); if (bVar4 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1c4.x = (tmpEntity->_pos).x - (npc->_pos).x; local_1c4.y = (tmpEntity->_pos).y - (npc->_pos).y; tmpVec = Vector::Normalized(&local_1c4,&scratchVec); (npc->_targetPosition).x = tmpVec->x; (npc->_targetPosition).y = tmpVec->y; } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (((bVar4 != 0) && (npc->_controllerID != -1)) && (bVar4 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar4 != 0)) { tmpVec = Vector::Normalized(this,&local_1d4); (npc->_targetPosition).x = tmpVec->x; (npc->_targetPosition).y = tmpVec->y; } bVar4 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar4 != 0) && (bVar4 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b1d6f4), manager = g_manager, bVar4 == 0)) { iVar6 = npc->_stateFrame; if (iVar6 == 0) { local_1bc = (float *)0xd4; seed_fart_sound_override((int *)&local_1bc); SoundEffects::Play(&manager->_sfxManager,(int)local_1bc,0.7,2,0,1.0,0.0); manager = g_manager; local_1bc = (float *)0x25; seed_fart_sound_override((int *)&local_1bc); SoundEffects::Play(&manager->_sfxManager,(int)local_1bc,1.0,2,0,1.0,0.0); iVar6 = npc->_stateFrame; } local_1c4.y = (float)iVar6 * 25.0 * (npc->_targetPosition).y + (npc->_pos).y; local_1c4.x = (float)iVar6 * 25.0 * (npc->_targetPosition).x + (npc->_pos).x; uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x17,&local_1c4,&g_vectorZero,(Entity *)npc,0,uVar5); iVar6 = npc->_stateFrame; iVar12 = *(int *)tmpEntity; pAVar8 = &tmpEntity[1]._sprite; (pAVar8->_filename)._buf[8] = '\x0f'; (pAVar8->_filename)._buf[9] = '\0'; (pAVar8->_filename)._buf[10] = '\0'; (pAVar8->_filename)._buf[0xb] = '\0'; pAVar8 = &tmpEntity[1]._sprite; (pAVar8->_filename)._buf[0xc] = '\x0f'; (pAVar8->_filename)._buf[0xd] = '\0'; (pAVar8->_filename)._buf[0xe] = '\0'; (pAVar8->_filename)._buf[0xf] = '\0'; local_1bc = (float *)((float)iVar6 * 0.07 + 0.9); (tmpEntity->_sprite)._scale.x = (float)local_1bc; (tmpEntity->_sprite)._scale.y = (float)local_1bc; (**(code **)(iVar12 + 0xc))(); bVar4 = Room::IsPositionInRoom(g_game->_room,&local_1c4,0.0); if (bVar4 != 0) { uVar5 = Random(); local_30 = 0.08; local_2c = 0.5; local_28 = 0.01; local_1e4.x = 0.0; local_1dc.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10; local_1dc.y = local_1dc.x * (npc->_targetPosition).y; local_1dc.x = local_1dc.x * (npc->_targetPosition).x; local_1dc.y = local_1dc.y + local_1dc.y; local_1dc.x = local_1dc.x + local_1dc.x; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; local_50._8_4_ = 0.0; local_50._12_4_ = 1.0; uVar5 = Random(); local_1e4.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * -16.0; scratchVec.x = local_1c4.x - (npc->_targetPosition).x * 5.0; scratchVec.y = local_1c4.y - (npc->_targetPosition).y * 5.0; tmpEntity = spawn_blood_explosion (2,&scratchVec,&local_1e4,(ColorMod *)local_50,&local_1dc); uVar5 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,7,&local_1c4,&g_vectorZero,(Entity *)0x0,0,uVar5); local_30 = 0.08; (tmpEntity->_sizeMulti).x = (float)local_1bc; (tmpEntity->_sizeMulti).y = (float)local_1bc; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; local_50._8_4_ = 0.0; local_50._12_4_ = 0.5; local_2c = 0.5; local_28 = 0.01; (**(code **)(*(int *)tmpEntity + 0x3c))(local_50,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); } npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } LAB_00509e31: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00509e54; } else if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar4 != 0) { if (npc->_type == 0x101) { local_1bc = (float *)0xd5; seed_fart_sound_override((int *)&local_1bc); SoundEffects::Play(&manager->_sfxManager,(int)local_1bc,1.0,2,0,1.0,0.0); ProjectileParams::ProjectileParams(&shotParams); shotParams.BulletFlags._0_4_ = (uint)shotParams.BulletFlags | 3; shotParams.Scale = 1.5; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1c4.x = (tmpEntity->_pos).x - (npc->_pos).x; local_1c4.y = (tmpEntity->_pos).y - (npc->_pos).y; if ((npc->_controllerID != -1) && (bVar4 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar4 != 0)) { local_1c4.x = *extraout_ECX; local_1c4.y = extraout_ECX[1]; } projParams = &shotParams; uVar5 = 0; tmpVec = Vector::Resized(&local_1c4,&scratchVec,7.0); Entity_NPC::FireProjectiles(npc,&npc->_pos,tmpVec,uVar5,projParams); } else { tmpVec = &npc->_pos; Game::ButterBeanFart(g_game,tmpVec,120.0,(Entity *)npc,1,0); if (npc->_variant == 1) { projParams = ProjectileParams::ProjectileParams(&shotParams); scratchVec.x = 8.0; scratchVec.y = 6.0; Entity_NPC::FireProjectiles(npc,tmpVec,&scratchVec,9,projParams); } else if (npc->_variant == 2) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x21,10,tmpVec,&g_vectorZero,(Entity *)npc,0,uVar5); fVar9 = (tmpEntity->_pos).y; (tmpEntity->_targetPosition).x = (tmpEntity->_pos).x; (tmpEntity->_targetPosition).y = fVar9; } } } goto LAB_00509e31; } npc->_state = 4; npc->_stateFrame = 0; LAB_00509e54: npc->_friction = npc->_friction * 0.4; ExceptionList = local_1c; return; } } else if ((iVar12 == 0x11c) && (iVar6 == 8)) { Entity_NPC::UpdateControllerMovement(npc,0); bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar4 != 0) { if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1c4.x = (tmpEntity->_pos).x - (npc->_pos).x; local_1c4.y = (tmpEntity->_pos).y - (npc->_pos).y; } else { local_1c4.x = (npc->_controllerMovement).x; local_1c4.y = (npc->_controllerMovement).y; } projParams = ProjectileParams::ProjectileParams(&shotParams); tmpVec = Vector::Resized(&local_1c4,&scratchVec,7.0); Entity_NPC::FireProjectiles(npc,&npc->_pos,tmpVec,0,projParams); } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; ANM2::SetOverlayFrame(&npc->_sprite,s_Head,0); } npc->_friction = npc->_friction * 0.4; } LAB_00509511: if ((npc->_type != 0x12e) || (iVar6 = 0x12e, npc->_state != 0x10)) { local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = (void *)0x0; std::string::assign(local_50 + 0x14,(byte *)"WalkVert",8); local_14 = 0; walkHoriAnim._size = 0; walkHoriAnim._capacity = 0xf; walkHoriAnim._buf._0_4_ = (void *)0x0; std::string::assign(walkHoriAnim._buf,(byte *)"WalkHori",8); local_14._0_1_ = 1; Entity_NPC::AnimWalkFrame(npc,&walkHoriAnim,(std_string *)(local_50 + 0x14),0.1); local_14 = (uint)local_14._1_3_ << 8; if (0xf < walkHoriAnim._capacity) { uVar7 = walkHoriAnim._capacity + 1; freeBlock = (void *)walkHoriAnim._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(void **)(walkHoriAnim._buf._0_4_ + -4); uVar7 = walkHoriAnim._capacity + 0x24; if (0x1f < (uint)(walkHoriAnim._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_0050961d; } operator_delete(freeBlock,uVar7); } local_14 = -1; walkHoriAnim._size = 0; walkHoriAnim._capacity = 0xf; walkHoriAnim._buf._0_4_ = walkHoriAnim._buf._0_4_ & 0xffffff00; if (0xf < (uint)local_28) { uVar7 = (int)local_28 + 1; freeBlock = (void *)local_50._20_4_; if (0xfff < uVar7) { freeBlock = *(void **)(local_50._20_4_ + -4); uVar7 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)freeBlock))) { LAB_0050961d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } iVar6 = npc->_type; } npc->_aiFloat = 0.6; if ((iVar6 == 0xd0) || (iVar6 == 0x101)) { npc->_aiFloat = 0.3; if ((iVar6 == 0xd0) && (npc->_variant == 2)) { npc->_aiFloat = 0.33; } } else if (iVar6 == 0x12e) { if (npc->_variant == 10) { npc->_aiFloat = 0.48000002; } } else if (iVar6 == 0xfc) { npc->_aiFloat = 0.90000004; } else if ((npc->_variant == 1) || (iVar6 == 0x11c)) { npc->_aiFloat = 0.498; } else if (npc->_variant == 2) { npc->_aiFloat = 0.5478; ANM2::PlayOverlay(&npc->_sprite,s_Head,0); } else { iVar6 = Sprite::GetOverlayFrame((Sprite *)&npc->_sprite,uVar5); if (0 < iVar6) { npc->_aiFloat = 0.72; } } if ((npc->_flags & 0x1000800) == 0) { local_1bc = (float *)npc->_aiFloat; iVar6 = 900; if (npc->_type == 0x12e) { iVar6 = 100; } tmpVec = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,tmpVec,(float)local_1bc,iVar6,1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); fVar9 = npc->_friction * 0.8; npc->_friction = fVar9; if (((npc->_type == 0xd0) || (npc->_type == 0x101)) && (0 < (npc->_pathfinder)._evadeMovementCountdown)) { npc->_friction = fVar9 * 0.8; } } if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar4 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if (((bVar4 != 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (uVar5 = Random(), uVar5 % 3 == 0)) goto LAB_0050a077; } else { bVar4 = Entity_NPC::IsControllerActionTriggered(npc,10); if (bVar4 != 0) { LAB_0050a077: iVar6 = npc->_type; if ((iVar6 == 0xd0) || (iVar6 == 0x101)) { fVar9 = 1.0; iVar12 = 0x3c; iVar6 = 0x74; } else if (iVar6 == 0x12e) { if ((npc->_state == 0x10) || (npc->_variant == 10)) goto LAB_0050a131; uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.9; iVar12 = 0x3c; iVar6 = 0x32; } else { fVar9 = 1.0; iVar12 = 0x28; iVar6 = 0xa5; } Entity_NPC::PlaySound(npc,iVar6,1.0,iVar12,0,fVar9); } } LAB_0050a131: if (((((npc->_variant == 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (iVar6 = npc->_type, iVar6 != 0xd0)) && ((iVar6 != 0x101 && (iVar6 != 0x12e)))) && (iVar6 = Sprite::GetOverlayFrame((Sprite *)&npc->_sprite), iVar6 < 1)) { ANM2::PlayOverlay(&npc->_sprite,s_Head,1); } if (npc->_type == 0x11c) { iVar6 = Entity::GetIntervalTicks((Entity *)npc,7.0,(float)((uint)npc->_index % 7) + 0.0); if (iVar6 != 0) { uVar5 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; tmpEntity = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); effect = (int *)__RTDynamicCast(tmpEntity,uVar11,pTVar13,pTVar14,uVar15); uVar5 = Random(); effect[0x117] = 0x14; effect[0x118] = 0x14; fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2; effect[0x39] = (int)fVar9; effect[0x3a] = (int)fVar9; (**(code **)(*effect + 0xc))(); } if ((npc->_state == 4) && (npc->_projectileCooldown < 1)) { if (npc->_controllerID == -1) { if ((((npc->_pathfinder)._hasDirectPath != 0) && (uVar5 = Random(), uVar5 % 0x1e == 0)) && (tmpEntity = Entity_NPC::GetPlayerTarget(npc), fVar10 = (npc->_pos).x - (tmpEntity->_pos).x, fVar9 = (npc->_pos).y - (tmpEntity->_pos).y , fVar9 * fVar9 + fVar10 * fVar10 < 40000.0)) { npc->_projectileCooldown = 0x3c; goto LAB_0050a310; } } else { Entity_NPC::UpdateControllerMovement(npc,1); bVar4 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero); if (bVar4 != 0) { npc->_projectileCooldown = 0x2d; LAB_0050a310: npc->_state = 8; ANM2::PlayOverlay(&npc->_sprite,(byte *)"Attack",0); } } } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } } if (npc->_type != 0x12e) { ExceptionList = local_1c; return; } iVar6 = Entity_NPC::GetAliveEnemyCount(npc); if ((iVar6 < 1) && ((*(char *)((int)g_game->_room + 0x7229) == '\0' || (*(int *)((int)g_game->_room + 0x11ec) < 9) ))) { iVar6 = npc->_state; if (iVar6 != 0x12) { npc->_state = 0x12; npc->_stateFrame = 0; npc->_entityCollisionClass = 0; if (npc->_variant != 10) { ExceptionList = local_1c; return; } AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_size).x = g_vectorOne.x; (layer->_size).y = g_vectorOne.y; goto LAB_0050a623; } } else { iVar6 = npc->_state; } if (iVar6 == 4) { if (npc->_variant == 10) { animName = "ShootAndRotate1"; if (npc->_i2 != 1) { animName = "ShootAndRotate2"; } ANM2::PlayOverlay(&npc->_sprite,(byte *)animName,0); bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x106,1.0,0,0,1.0); ProjectileParams::ProjectileParams(&spinShotParams); fVar9 = (npc->_velocity).x; fVar10 = (npc->_velocity).y; spinShotParams.HeightModifier = -15.0; spinShotParams.FallingAccelModifier = 0.3; local_1d4.x = fVar9 + fVar9 + (npc->_pos).x; spinShotVelocity.x = 10.0; spinShotVelocity.y = 0.0; local_1d4.y = fVar10 + fVar10 + (npc->_pos).y; Entity_NPC::FireProjectiles (npc,&local_1d4,&spinShotVelocity,(npc->_i2 != 1) + 6,&spinShotParams); } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_i2 = 1 - npc->_i2; } } else if ((npc->_i1 < 1) || (iVar6 = npc->_i1 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime), npc->_i1 = iVar6, iVar6 < 1)) { npc->_state = 0x10; ANM2::Play(&npc->_sprite,&DAT_00b1e10c,0); uVar5 = Random(); npc->_i1 = ((uVar5 & 3) + 2) * 0x15; } } else if (iVar6 == 0x10) { (npc->_velocity).x = (npc->_velocity).x * 0.0; (npc->_velocity).y = (npc->_velocity).y * 0.0; iVar6 = npc->_i1; if (0 < iVar6) { iVar6 = iVar6 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_i1 = iVar6; } if (iVar6 < 1) { npc->_state = 4; uVar5 = Random(); npc->_i1 = uVar5 % 0x3c + 0x5a; } } LAB_0050a623: if ((npc->_variant == 10) && (npc->_state != 0x12)) { pAVar8 = &npc->_sprite; frame = ANM2::GetLayerFrame(pAVar8,2); if ((frame == (float *)0x0) || (*(char *)(frame + 3) == '\0')) { layer = ANM2::GetLayer(pAVar8,(byte *)0x1); layer->_visible = 0; } else { layer = ANM2::GetLayer(pAVar8,(byte *)0x1); layer->_visible = 1; layer = ANM2::GetLayer(pAVar8,(byte *)0x1); (layer->_pos).x = *frame; (layer->_pos).y = frame[1]; layer = ANM2::GetLayer(pAVar8,(byte *)0x1); (layer->_size).x = frame[4]; (layer->_size).y = frame[5]; } } ExceptionList = local_1c; return; } //@@ 0050a6b0 NpcAI::ENTITY_EMBRYO /* NPC AI for entity type 77 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_EMBRYO(Entity_NPC *npc) { AnimationState *this; byte *pbVar1; byte bVar2; Entity *pEVar3; uint uVar4; byte *pbVar5; char *pcVar6; bool bVar7; int framedelay; float pitch; Vector local_c; if (npc->_state == 0) { npc->_state = 3; return; } npc->_friction = npc->_friction * 0.8; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0050a704: if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } else { pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_c.x = (pEVar3->_pos).x; local_c.y = (pEVar3->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_c,0); npc->_friction = npc->_friction * 0.8; } } else { bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Landed"); if (bVar2 == 0) goto LAB_0050a704; } this = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(this,(byte *)"Landed"); if (bVar2 != 0) { pitch = 1.0; bVar2 = 0; framedelay = 2; uVar4 = Random(); Entity_NPC::PlaySound (npc,0xcd,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)] ) * 2.3283064e-10 * 0.3 + 0.4,framedelay,bVar2,pitch); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::WasEventTriggered(this,(byte *)"Landed"); if (bVar2 != 0) { npc->_friction = npc->_friction * 0.7; } } } pbVar1 = (npc->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar5 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar5 = *(byte **)pbVar1; } pcVar6 = "Walk Sad"; do { bVar2 = *pbVar5; bVar7 = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_0050a842: uVar4 = -(uint)bVar7 | 1; goto LAB_0050a847; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar7 = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_0050a842; pbVar5 = pbVar5 + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0050a847: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0050a87a; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Walk Sad",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0050a87a: (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; return; } //@@ 0050a8a0 NpcAI::ENTITY_ETERNALFLY /* NPC AI for entity type 96 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ETERNALFLY(Entity_NPC *npc) { byte isInRoom; uint uVar1; int iVar2; void *pvVar3; int rampFrame; EntityPtr parent; EntityPtr *parentRef; int iVar4; bool bVar5; float fVar6; float followLerp; float local_40; float local_3c; EntityPtr *local_38; float orbitCos; EntityRef shrinkSource; undefined4 flagsHigh; uint *flagsHighPtr; float oldX; float oldY; float targetY; if (npc->_state == 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHighPtr = (uint *)((int)&npc->_flags + 4); *flagsHighPtr = *flagsHighPtr | 8; npc->_entityCollisionClass = 2; npc->_entityGridCollisionClass = 0; npc->_isInvicible = 1; npc->_state = 4; uVar1 = Random(); npc->_i1 = 0; npc->_projectileDelay = 0; npc->_i2 = 0; npc->_stateFrame = uVar1 % 10; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } parent = npc->_parent; parentRef = &npc->_parent; if (((parent != (EntityPtr)0x0) && (uVar1 = *(uint *)((int)parent + 0x168), (uVar1 & 0x1000000) != 0)) && ((npc->_flags & 0x1000000) == 0)) { shrinkSource._type = *(int *)((int)parent + 0x28); shrinkSource._position.x = *(float *)((int)parent + 0x33c); shrinkSource._position.y = *(float *)((int)parent + 0x340); shrinkSource._variant = *(int *)((int)parent + 0x2c); shrinkSource._spawnerType = *(int *)((int)parent + 0x34); shrinkSource._spawnerVariant = *(int *)((int)parent + 0x38); shrinkSource._velocity.x = *(float *)((int)parent + 0x360); shrinkSource._velocity.y = *(float *)((int)parent + 0x364); local_3c = (float)(uint)((uVar1 & 0x100) != 0); local_40 = 2.8026e-45; if ((uVar1 & 0x20000000) == 0) { local_40 = 0.0; } if ((*(uint *)((int)parent + 0x16c) & 0x400000) == 0) { uVar1 = 0; } else { uVar1 = 4; } shrinkSource._flags = uVar1 | (uint)local_40 | (uint)local_3c; shrinkSource._entity = (void *)parent; Entity::AddShrink((Entity *)npc,&shrinkSource,*(int *)((int)parent + 0x23c),1,1); if (0 < npc->_shrinkCountdown) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x1000000; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_shrinkStatus1 = npc->_shrinkStatus2; } } bVar5 = npc->_state == 0x10; parent = *parentRef; if (parent == (EntityPtr)0x0) { parent = (EntityPtr)0x0; if (npc->_projectileDelay == 1) { bVar5 = true; } else { pvVar3 = g_game->_room; iVar2 = (int)(((npc->_targetPosition).x - 40.0) / 40.0 + 0.5); if ((-1 < iVar2) && (iVar2 < *(int *)((int)pvVar3 + 0xc))) { fVar6 = ((npc->_targetPosition).y - 120.0) / 40.0 + 0.5; iVar4 = (int)fVar6; if ((-1 < iVar4) && (parent = npc->_parent, (int)fVar6 < *(int *)((int)pvVar3 + 0x10))) { iVar2 = *(int *)((int)pvVar3 + 0xc) * iVar4 + iVar2; if ((iVar2 < 0) || (((iVar2 < 0x1c0 && (iVar2 = *(int *)((int)pvVar3 + iVar2 * 4 + 0x24), iVar2 != 0)) && ((*(int *)(iVar2 + 4) != 0xe || (*(int *)(iVar2 + 0x3c) != 0)))))) goto LAB_0050ab0a; bVar5 = true; } } } LAB_0050ab3e: local_3c = 0.02; local_40 = 60.0; local_38 = (EntityPtr *)0x42480000; } else { fVar6 = *(float *)((int)parent + 0x340); (npc->_targetPosition).x = *(float *)((int)parent + 0x33c); (npc->_targetPosition).y = fVar6; npc->_projectileDelay = 1; if ((*parentRef != (EntityPtr)0x0) && (iVar2 = __RTDynamicCast(*parentRef,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar2 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } parent = *parentRef; if (*(char *)((int)parent + 0x173) != '\0') { bVar5 = true; } LAB_0050ab0a: local_40 = 25.0; local_3c = 0.04; local_38 = (EntityPtr *)0x41a00000; if ((parent == (EntityPtr)0x0) || (*(int *)((int)parent + 0x28) == 0x5a)) goto LAB_0050ab3e; } parentRef = &npc->_parent; if (bVar5) { if ((npc->_i1 < 1) || (isInRoom = Room::IsPositionInRoom(g_game->_room,&npc->_targetPosition,-10.0), isInRoom == 0) ) { (**(code **)(*(int *)npc + 0x28))(); return; } npc->_entityGridCollisionClass = 3; Entity_NPC::Morph(npc,0x12,0,0,-1); if (*parentRef != (EntityPtr)0x0) { local_38 = parentRef; std::multiset::erase(&local_38); } *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; flagsHighPtr = (uint *)((int)&npc->_flags + 4); *flagsHighPtr = *flagsHighPtr & 0xfffffff7; *parentRef = (EntityPtr)0x0; npc->_isInvicible = 0; npc->_entityCollisionClass = 4; return; } if (parent != (EntityPtr)0x0) { if (*(int *)((int)parent + 0x7c) == 0) { pvVar3 = (void *)0x0; } else { pvVar3 = AnimationState::GetNullFrame ((AnimationState *)((int)parent + 0x78),(byte *)"OverlayEffect"); parent = *parentRef; } if ((parent != (EntityPtr)0x0) && ((pvVar3 == (void *)0x0 || (*(char *)((int)pvVar3 + 0xc) == '\0')))) { bVar5 = true; goto LAB_0050ad2e; } } bVar5 = false; LAB_0050ad2e: iVar2 = npc->_state; if (iVar2 == 4) { ANM2::Play(&npc->_sprite,s_Fly,0); if (bVar5) { npc->_entityCollisionClass = 0; npc->_state = 6; npc->_i1 = 0; } else { local_3c = (float)g_game->_frameCount * local_3c * 3.1415927 + ((float)npc->_stateFrame * 3.1415927) / 10.0; if ((npc->_stateFrame & 1U) == 0) { local_3c = -local_3c; } orbitCos = cos(local_3c); fVar6 = sin(local_3c); parent = *parentRef; iVar2 = 0x5a; if ((parent != (EntityPtr)0x0) && (*(int *)((int)parent + 0x28) == 0x5a)) { iVar2 = 0x1e; } iVar4 = npc->_i1; rampFrame = iVar2; if (iVar4 < iVar2) { rampFrame = iVar4; } npc->_i1 = iVar4 + 1; if ((parent == (EntityPtr)0x0) || (*(int *)((int)parent + 0x28) != 0x66)) { followLerp = 0.5; } else { followLerp = 1.0; } oldX = (npc->_pos).x; oldY = (npc->_pos).y; targetY = (npc->_targetPosition).y; (npc->_pos).x = ((orbitCos * local_40 * ((float)rampFrame / (float)iVar2) + (npc->_targetPosition).x) - oldX) * followLerp + oldX; (npc->_pos).y = ((fVar6 * (float)local_38 * ((float)rampFrame / (float)iVar2) + targetY) - oldY) * followLerp + oldY; } npc->_friction = npc->_friction * 0.9; } else if (iVar2 == 6) { ANM2::Play(&npc->_sprite,(byte *)"TeleportOut",0); (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_shadowSize = 0.0; } if (!bVar5) { npc->_state = 7; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); return; } } else if (iVar2 == 7) { ANM2::Play(&npc->_sprite,(byte *)"TeleportIn",0); (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_entityCollisionClass = 2; npc->_state = 4; return; } } return; } //@@ 0050af90 NpcAI::ENTITY_GUSHER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 11 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GUSHER(Entity_NPC *npc) { float fVar1; Vector targetPos; byte bVar2; uint uVar3; undefined4 *damageEvent; byte *animNameChar; Vector *moveInput; Entity *tmpEntity; int iVar4; ColorMod *color; Entity_Effect *effect; void *pvVar5; char *expectedAnimChar; bool bVar6; float fVar7; undefined4 local_164 [8]; undefined4 local_144; undefined4 uStack_140; undefined4 local_13c; Vector local_138; Vector local_130; ProjectileParams projParams; undefined1 local_7c [24]; float local_64; undefined1 local_60; float local_58; float local_54; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; void *pvStack_3c; char acStack_38 [4]; uint uStack_34; char local_30 [8]; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *overlayAnimData; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4205; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_30 + 0x20); if (npc->_state == 0) { ExceptionList = &local_1c; npc->_state = 4; if (npc->_type == 0xee) { local_144 = 0xbe48c8ca; uStack_140 = 0x3f028283; local_13c = 0x3e48c8ca; if (&npc->_splatColor != (ColorMod *)local_164) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = -0.19607845; (npc->_splatColor)._offset[1] = 0.50980395; (npc->_splatColor)._tint[0] = 0.5; (npc->_splatColor)._tint[1] = 0.5; (npc->_splatColor)._tint[2] = 0.5; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.19607845; } } puStack_20 = local_30 + 0x2c; uVar3 = Random(); npc->_projectileCooldown = uVar3 % 0x14 + 0x14; if (((npc->_variant == 0) && (npc->_type == 0xb)) || (npc->_type == 0xee)) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"Blood",0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if ((npc->_dead != 0) && (npc->_type == 0xd2)) { if (npc->_health <= -25.0) { return; } ExceptionList = &local_1c; puStack_20 = local_30 + 0x2c; uVar3 = Random(); if ((uVar3 & 1) == 0) { Entity_NPC::Morph(npc,0xd3,0,0,-1); npc->_dead = 0; npc->_health = npc->_maxHitPoints; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } ExceptionList = &local_1c; if ((npc->_type == 0xee) && (0.0 < npc->_pendingDamage)) { damageEvent = (npc->_damageEvents)._begin; if (damageEvent != (npc->_damageEvents)._end) { do { local_130.y = (float)damageEvent[3]; if (((((damageEvent[2] & 4) != 0) && (((uint)damageEvent[0xc] >> 1 & 1) == 0)) && (damageEvent[4] != 1)) && (((damageEvent[6] != 1 && (damageEvent[6] != 3)) && ((damageEvent[2] & 0x1000) == 0)))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } } local_28 = 0xf; local_30[4] = '\b'; local_30[5] = '\0'; local_30[6] = '\0'; local_30[7] = '\0'; pvStack_3c = (void *)0x6b6c6157; builtin_strncpy(acStack_38,"Vert",4); uStack_34 = uStack_34 & 0xffffff00; local_54 = 2.10195e-44; local_58 = 1.12104e-44; local_7c[0x14] = 'W'; local_7c[0x15] = 'a'; local_7c[0x16] = 'l'; local_7c[0x17] = 'k'; local_64 = (float)0x69726f48; local_60 = 0; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_7c + 0x14),(std_string *)&pvStack_3c,0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_54) { uVar3 = (int)local_54 + 1; pvVar5 = (void *)local_7c._20_4_; if (0xfff < uVar3) { pvVar5 = *(void **)(local_7c._20_4_ + -4); uVar3 = (int)local_54 + 0x24; if (0x1f < (uint)(local_7c._20_4_ + (-4 - (int)pvVar5))) goto LAB_0050b233; } operator_delete(pvVar5,uVar3); } local_14 = 0xffffffff; local_58 = 0.0; local_54 = 2.10195e-44; local_7c._20_4_ = local_7c._20_4_ & 0xffffff00; if (0xf < local_28) { uVar3 = local_28 + 1; pvVar5 = pvStack_3c; if (0xfff < uVar3) { pvVar5 = *(void **)((int)pvStack_3c + -4); uVar3 = local_28 + 0x24; if (0x1f < (uint)((int)pvStack_3c + (-4 - (int)pvVar5))) { LAB_0050b233: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar3); } iVar4 = npc->_type; if (((npc->_variant != 0) || (iVar4 != 0xb)) && (iVar4 != 0xee)) { if (iVar4 == 0xd2) { if (((npc->_projectileCooldown < 1) && ((npc->_flags & 0x1000a00) == 0)) && ((npc->_controllerID == -1 || ((bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar2 != 0 || (bVar2 = Entity_NPC::IsControllerActionPressed(npc,9), bVar2 != 0)))))) { fVar7 = (npc->_velocity).y; fVar1 = (npc->_velocity).x; fVar7 = sqrtf(fVar1 * fVar1 + fVar7 * fVar7); if (0.0 < fVar7) { if (npc->_controllerID == -1) { uVar3 = Random(); uVar3 = uVar3 % 0x1e; } else { uVar3 = 0; } npc->_projectileCooldown = uVar3 + 0x1e; ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = projParams.HeightModifier - 15.0; projParams.FallingSpeedModifier = 5.0; projParams.PositionOffset.x = 0.0; projParams.PositionOffset.y = 5.0; uVar3 = Random(); Entity_NPC::FireBossProjectiles(npc,uVar3 % 3 + 3,&g_vectorZero,10.0,&projParams); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); } } else { npc->_projectileCooldown = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); } } else if (iVar4 == 0x118) { overlayAnimData = (npc->_sprite)._overlayAnimState._animData; if (overlayAnimData != (byte *)0x0) { animNameChar = overlayAnimData; if (0xf < *(uint *)(overlayAnimData + 0x14)) { animNameChar = *(byte **)overlayAnimData; } expectedAnimChar = "Spiders"; do { bVar2 = *animNameChar; bVar6 = bVar2 < (byte)*expectedAnimChar; if (bVar2 != *expectedAnimChar) { LAB_0050b6f0: uVar3 = -(uint)bVar6 | 1; goto LAB_0050b6f5; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar6 = bVar2 < (byte)expectedAnimChar[1]; if (bVar2 != expectedAnimChar[1]) goto LAB_0050b6f0; animNameChar = animNameChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0050b6f5: if ((uVar3 == 0) && ((overlayAnimData[0x34] == 0 || ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) goto LAB_0050b72c; } bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"Spiders",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } goto LAB_0050b72c; } overlayAnimData = (npc->_sprite)._overlayAnimState._animData; if (overlayAnimData == (byte *)0x0) { LAB_0050b2be: bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"Blood",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { animNameChar = overlayAnimData; if (0xf < *(uint *)(overlayAnimData + 0x14)) { animNameChar = *(byte **)overlayAnimData; } expectedAnimChar = "Blood"; do { bVar2 = *animNameChar; bVar6 = bVar2 < (byte)*expectedAnimChar; if (bVar2 != *expectedAnimChar) { LAB_0050b2a0: uVar3 = -(uint)bVar6 | 1; goto LAB_0050b2a5; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar6 = bVar2 < (byte)expectedAnimChar[1]; if (bVar2 != expectedAnimChar[1]) goto LAB_0050b2a0; animNameChar = animNameChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0050b2a5: if ((uVar3 != 0) || ((overlayAnimData[0x34] != 0 && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_0050b2be; } if ((npc->_projectileCooldown < 1) && ((npc->_flags & 0x1000a00) == 0)) { if ((npc->_controllerID == -1) || (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar2 != 0)) { local_138.y = g_vectorZero.x; local_130.y = g_vectorZero.y; if (npc->_controllerID == -1) { fVar7 = (npc->_velocity).x; fVar1 = (npc->_velocity).y; fVar7 = sqrtf(fVar7 * fVar7 + fVar1 * fVar1); if (0.0 < fVar7) { local_138.y = (npc->_velocity).x / fVar7; local_130.y = (npc->_velocity).y / fVar7; } } else { moveInput = Entity_NPC::GetControllerMovementInput(npc,&local_130,0.1); local_138.y = moveInput->x; local_130.y = moveInput->y; } if ((local_138.y != g_vectorZero.x) || (local_130.y != g_vectorZero.y)) { if (npc->_type == 0xb) { if (npc->_controllerID == -1) { uVar3 = Random(); uVar3 = uVar3 % 0x14; } else { uVar3 = 0; } npc->_projectileCooldown = uVar3 + 0x28; } ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = 0.3; projParams.FallingSpeedModifier = -5.0; if (npc->_type == 0xee) { if (npc->_controllerID == -1) { uVar3 = Random(); uVar3 = uVar3 % 0x1e; } else { uVar3 = 0; } projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 2; npc->_projectileCooldown = uVar3 + 0x3c; projParams.Color._colorize[0] = 0.4; projParams.Color._colorize[1] = 2.0; projParams.Color._colorize[2] = 0.5; projParams.Color._colorize[3] = 1.0; } uVar3 = Level::GetStageID(); if ((uVar3 == 6) || (uVar3 == 0x1b)) { projParams.Variant = 4; } else if (uVar3 == 0x1c) { projParams.Variant = 3; } local_138.x = local_138.y * 5.0; local_138.y = local_130.y * 5.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_138,0,&projParams); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); } } } else { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } LAB_0050b72c: npc->_friction = npc->_friction * 0.75; if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130.x = (tmpEntity->_pos).x; local_130.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_130,0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } iVar4 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (iVar4 != 0) { iVar4 = npc->_type; if (iVar4 == 0xd3) { if ((npc->_flags & 0x1000000) == 0) { uVar3 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); uVar3 = Random(); iVar4 = *(int *)tmpEntity; fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2; (tmpEntity->_sprite)._scale.x = fVar7; (tmpEntity->_sprite)._scale.y = fVar7; (**(code **)(iVar4 + 0xc))(); } } else { if (iVar4 == 0xd2) { uVar3 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.4); iVar4 = npc->_type; } if (iVar4 == 0xee) { uVar3 = Random(); effect = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2); local_30[0] = '\0'; local_30[1] = '\0'; local_30[2] = '\0'; local_30[3] = '\0'; local_30[4] = '\0'; local_30[5] = '\0'; local_30[6] = '\0'; local_30[7] = '?'; local_40 = 0; pvStack_3c = (void *)0x0; acStack_38[0] = '\0'; acStack_38[1] = '\0'; acStack_38[2] = '\0'; acStack_38[3] = '\0'; uStack_34 = 0; local_50 = 0; uStack_4c = 0x3f800000; uStack_48 = 0; uStack_44 = 0x3f800000; local_28 = 0; (**(code **)(*(int *)effect + 0x3c))(&local_50,0xffffffff,0xff,0,1); } else { uVar3 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2); } } } iVar4 = npc->_type; if (iVar4 == 0x118) { if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; ExceptionList = local_1c; return; } iVar4 = Entity_NPC::GetAliveEnemyCount(npc); if ((iVar4 < 5) && ((npc->_controllerID == -1 || (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar2 != 0)))) { local_130.x = g_vectorZero.x; local_130.y = g_vectorZero.y; if ((npc->_controllerID != -1) && ((Entity_NPC::GetControllerMovementInput(npc,&local_138,0.1), local_138.x != g_vectorZero.x || (local_138.y != g_vectorZero.y)))) { local_130.x = local_138.x * 80.0 + (npc->_pos).x; local_130.y = local_138.y * 80.0 + (npc->_pos).y; } targetPos.y = local_130.y; targetPos.x = local_130.x; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos,0,-30.0); Entity_NPC::PlaySound(npc,0xb5,0.5,2,0,1.0); Color::Color((Color *)local_7c); local_130.x = 0.0; local_130.y = -10.0; effect = (Entity_Effect *)spawn_blood_explosion(1,&npc->_pos,&local_130,color,&g_vectorZero); effect->_renderDepthOffset = 1.0; Entity_Effect::FollowParent(effect,(Entity *)npc); if (npc->_controllerID == -1) { uVar3 = Random(); iVar4 = ((uVar3 & 1) + 1) * 0x5a; } else { iVar4 = 0x5a; } npc->_projectileCooldown = iVar4; } iVar4 = npc->_type; } if ((((iVar4 == 0xd2) || (iVar4 == 0xd3)) && (iVar4 = Entity::GetIntervalTicks((Entity *)npc,50.0,(float)((uint)npc->_index % 0x32) + 0.0), iVar4 != 0)) && (uVar3 = Random(), (uVar3 & 1) == 0)) { Entity_NPC::PlaySound(npc,3,0.7,2,0,1.0); } ExceptionList = local_1c; return; } //@@ 0050bbe0 NpcAI::ENTITY_MULLIGAN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 16 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MULLIGAN(Entity_NPC *npc) { byte bVar1; int iVar2; EntityRef *pEVar3; char *anim; int3 extraout_var; Entity *pEVar4; int3 extraout_var_00; ProjectileParams *params; void *pvVar5; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; ProjectileParams *params_00; code *extraout_EDX; uint uVar6; undefined1 *size; float fVar7; float fVar8; Vector spawnPos; Vector targetPos; uint spawnType; float spawnDist; float spawnAngle; Vector local_118; ProjectileParams projParams; undefined1 local_64 [20]; float local_50; undefined1 local_4c; int local_44; undefined1 *local_40; void *local_3c; char local_38 [12]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Vector *npcPos; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af4245; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); if (npc->_state == 0) { npc->_state = 4; return; } ExceptionList = &local_1c; Entity_NPC::CalcTargetPosition(npc,&targetPos,0.0); if (npc->_state != 4) { if ((npc->_state == 5) && ((npc->_friction = npc->_friction * 0.8, (npc->_sprite)._overlayAnimState._animData == (void *)0x0 || ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) { npcPos = &npc->_pos; Game::BombDamage(g_game,npcPos,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); uVar6 = Random(); Game::Spawn(g_game,1000,1,npcPos,&g_vectorZero,(Entity *)0x0,0,uVar6); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,0x12,npcPos,&g_vectorZero,(Entity *)0x0,0,uVar6); (**(code **)(*(int *)pEVar4 + 0xc))(); ProjectileParams::ProjectileParams(&projParams); bVar1 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar1) == 0 || extraout_var < 0) { local_118.x = 7.0; } else { local_118.x = 10.0; } local_118.y = 0.0; Entity_NPC::FireProjectiles(npc,npcPos,&local_118,6,params_00); pEVar3 = EntityRef::EntityRef((EntityRef *)local_64); (**(code **)(*(int *)npc + 0x24))(pEVar3); } goto LAB_0050c0b8; } if (npc->_variant == 2) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetPos,1.2,0,1); if (npc->_controllerID == -1) { iVar2 = Entity::GetIntervalTicks((Entity *)npc,5.0,0.0); if ((iVar2 != 0) && (pEVar4 = Entity_NPC::GetPlayerTarget(npc), fVar7 = (pEVar4->_pos).x - (npc->_pos).x, fVar8 = (pEVar4->_pos).y - (npc->_pos).y, fVar8 * fVar8 + fVar7 * fVar7 < 1600.0)) goto LAB_0050bcfa; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar1 != 0) { LAB_0050bcfa: pEVar3 = EntityRef::EntityRef((EntityRef *)local_64); (*extraout_EDX)(pEVar3); } } fVar7 = npc->_friction * 0.9; } else { if (npc->_controllerID == -1) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::IsHostileTo((Entity *)npc,pEVar4); if (bVar1 != 0) goto LAB_0050bd4c; PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,1); } else { LAB_0050bd4c: PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&targetPos,0); if (npc->_controllerID == -1) { if ((0 < (npc->_pathfinder)._evadeMovementCountdown) && (10 < g_game->_frameCount - npc->_spawnFrame)) goto LAB_0050bd9a; } else { bVar1 = Entity_NPC::IsControllerActionTriggered(npc,10); if (bVar1 != 0) { LAB_0050bd9a: uVar6 = Random(); Entity_NPC::PlaySound(npc,0x8f,1.0,uVar6 % 100 + 0x2d,0,1.0); } } } fVar7 = npc->_friction * 0.8; } npc->_friction = fVar7; local_40 = &DAT_0000000f; local_44 = 8; local_64[0x10] = 'W'; local_64[0x11] = 'a'; local_64[0x12] = 'l'; local_64[0x13] = 'k'; local_50 = (float)0x74726556; local_4c = 0; local_28 = 0xf; local_2c = 8; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_64 + 0x10),0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_28) { uVar6 = local_28 + 1; pvVar5 = local_3c; if (0xfff < uVar6) { pvVar5 = *(void **)((int)local_3c + -4); uVar6 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar5))) goto LAB_0050bebd; } operator_delete(pvVar5,uVar6); } local_14 = 0xffffffff; local_2c = 0; local_28 = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (&DAT_0000000f < local_40) { size = local_40 + 1; pvVar5 = (void *)local_64._16_4_; if ((undefined1 *)0xfff < size) { pvVar5 = *(void **)(local_64._16_4_ + -4); size = local_40 + 0x24; if (0x1f < (uint)(local_64._16_4_ + (-4 - (int)pvVar5))) { LAB_0050bebd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,(uint)size); } if (((npc->_pathfinder)._evadeMovementCountdown < 1) || (anim = "WalkOpenEye", npc->_variant == 2) ) { anim = (char *)s_Walk; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)anim,1); iVar2 = extraout_ECX_00; if ((bVar1 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); iVar2 = extraout_ECX_01; } } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)anim,0); iVar2 = extraout_ECX; } if (npc->_controllerID == -1) { if ((npc->_collidesWithGrid == 0) || (uVar6 = Random(), uVar6 % 300 != 0)) goto LAB_0050c0b8; } else { bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,iVar2); if (bVar1 == 0) goto LAB_0050c0b8; } if (npc->_variant != 2) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"Explode",0); npc->_state = 5; } LAB_0050c0b8: fVar7 = 10.0; if (npc->_dead != 0) { if (npc->_variant == 2) { if ((npc->_flags & 0x1000000) == 0) { npcPos = &npc->_pos; Game::BombDamage(g_game,npcPos,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); uVar6 = Random(); Game::Spawn(g_game,1000,1,npcPos,&g_vectorZero,(Entity *)0x0,0,uVar6); uVar6 = Random(); pEVar4 = Game::Spawn(g_game,1000,0x12,npcPos,&g_vectorZero,(Entity *)0x0,0,uVar6); (**(code **)(*(int *)pEVar4 + 0xc))(); } } else if (npc->_variant == 1) { bVar1 = Game::IsHardMode(); if (CONCAT31(extraout_var_00,bVar1) == 0 || extraout_var_00 < 0) { fVar7 = 7.0; } local_118.y = 0.0; local_118.x = fVar7; params = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_118,7,params); uVar6 = Random(); Game::Spawn(g_game,4,3,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6); } else if (-10.0 < npc->_health) { fVar7 = (float)(4 - npc->_championRegenCount); local_118.y = 0.0; if (0 < (int)fVar7) { local_118.y = fVar7; } if (0 < (int)local_118.y) { do { uVar6 = Random(); spawnType = 0xd; if (uVar6 % 0xb < 8) { if (uVar6 % 0xb == 7) { spawnType = 0xe; } } else { spawnType = 0x12; } uVar6 = Random(); spawnAngle = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; spawnAngle = spawnAngle + spawnAngle; uVar6 = Random(); spawnDist = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 6.0; uVar6 = Random(); fVar7 = cos(spawnAngle); spawnPos.x = fVar7 * spawnDist + (npc->_pos).x; fVar7 = sin(spawnAngle); spawnPos.y = fVar7 * spawnDist + (npc->_pos).y; pEVar4 = Game::Spawn(g_game,spawnType,0,&spawnPos,&g_vectorZero,(Entity *)npc,0,uVar6); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; local_118.y = (float)((int)local_118.y + -1); *(undefined4 *)((int)&pEVar4->_flags + 4) = *(undefined4 *)((int)&pEVar4->_flags + 4); } while (local_118.y != 0.0); } } } ExceptionList = local_1c; return; } //@@ 0050c370 NpcAI::ENTITY_HIVE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 22 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HIVE(Entity_NPC *npc) { Entity_NPC *pEVar1; undefined1 *puVar2; byte bVar3; Entity *tmpEntity; ColorMod *color; int iVar4; uint uVar5; Vector *pVVar6; uint uVar7; uint seed; void *pvVar8; EntityPtr EVar9; int baseSpawnCount; int iVar10; float fVar11; double dVar12; undefined4 uVar13; TypeDescriptor *pTVar14; undefined8 uVar15; Vector freeSpawnPos; Vector spawnPos; Vector ringSpawnPos; Vector local_84; Entity_NPC *local_7c; float local_78; Vector local_74; EntityPtr local_6c; undefined1 local_68 [24]; float local_50; undefined1 local_4c; float local_44; float local_40; void *local_3c; char local_38 [4]; undefined1 local_34 [12]; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; bool isAttackWanted; Room *room; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af4295; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; local_7c = npc; if (npc->_state == 0) { if (npc->_type == 0x331) { puStack_20 = local_34 + 0x30; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAppear",0); if (npc->_variant == 1) { (npc->_posOffset).y = -6.0; npc->_entityGridCollisionClass = 6; } } npc->_state = 4; (npc->_v1).x = 0.0; ExceptionList = local_1c; return; } if (npc->_state == 4) { puStack_20 = local_34 + 0x30; if (npc->_controllerID == -1) { puStack_20 = local_34 + 0x30; tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar3 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if (bVar3 != 0) goto LAB_0050c43c; PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,1); } else { LAB_0050c43c: bVar3 = 0; pVVar6 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_34 + 8),0.0); PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,pVVar6,bVar3); if (npc->_controllerID == -1) { bVar3 = 0 < (npc->_pathfinder)._evadeMovementCountdown; } else { bVar3 = Entity_NPC::IsControllerActionTriggered(npc,10); } if (bVar3 != 0) { uVar5 = Random(); Entity_NPC::PlaySound(npc,0x8f,1.0,uVar5 % 100 + 0x2d,0,1.0); } } if ((npc->_type == 0x331) && (npc->_variant == 1)) { ANM2::Play(&npc->_sprite,(byte *)"WalkVert",0); fVar11 = (npc->_velocity).x; if (ABS((npc->_velocity).y) < ABS(fVar11)) { (npc->_sprite)._flipX = fVar11 < 0.0; } } else { local_40 = 2.10195e-44; local_44 = 1.12104e-44; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; local_50 = (float)0x74726556; local_4c = 0; local_28 = 2.10195e-44; local_34._8_4_ = 1.12104e-44; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",4); local_34[0] = '\0'; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_68 + 0x14),0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_28) { uVar5 = (int)local_28 + 1; pvVar8 = local_3c; if (0xfff < uVar5) { pvVar8 = *(void **)((int)local_3c + -4); uVar5 = (int)local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar8))) goto LAB_0050c5ea; } operator_delete(pvVar8,uVar5); } local_14 = 0xffffffff; local_34._8_4_ = 0.0; local_28 = 2.10195e-44; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < (uint)local_40) { uVar5 = (int)local_40 + 1; pvVar8 = (void *)local_68._20_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(local_68._20_4_ + -4); uVar5 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)pvVar8))) { LAB_0050c5ea: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar5); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadWalk",1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadWalk",0); } fVar11 = npc->_friction * 0.8; npc->_friction = fVar11; if ((npc->_type == 0x16) && (npc->_variant == 1)) { npc->_friction = fVar11 * 0.95; } } else { puVar2 = local_34 + 0x30; if ((npc->_type == 0x16) && ((npc->_variant == 2 || (puVar2 = local_34 + 0x30, npc->_variant == 3)))) { local_40 = 2.10195e-44; local_44 = 1.12104e-44; local_4c = 0; npc->_friction = npc->_friction * 0.8; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; local_50 = (float)0x74726556; local_28 = 2.10195e-44; local_34._8_4_ = 1.12104e-44; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",4); local_34[0] = '\0'; local_14 = 3; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_68 + 0x14),0.1); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < (uint)local_28) { uVar5 = (int)local_28 + 1; pvVar8 = local_3c; if (0xfff < uVar5) { pvVar8 = *(void **)((int)local_3c + -4); uVar5 = (int)local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar8))) goto LAB_0050c792; } operator_delete(pvVar8,uVar5); } local_14 = 0xffffffff; local_34._8_4_ = 0.0; local_28 = 2.10195e-44; local_3c = (void *)((uint)local_3c & 0xffffff00); puVar2 = puStack_20; if (0xf < (uint)local_40) { uVar5 = (int)local_40 + 1; pvVar8 = (void *)local_68._20_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(local_68._20_4_ + -4); uVar5 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)pvVar8))) { LAB_0050c792: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar5); puVar2 = puStack_20; } } puStack_20 = puVar2; bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,(npc->_type == 0xcd) + 0x9e,1.0,2,0,1.0); if (npc->_type == 0x16) { iVar4 = npc->_variant; if (iVar4 == 1) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,0x17,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); fVar11 = tmpEntity->_maxHitPoints * 0.5; tmpEntity->_maxHitPoints = fVar11; tmpEntity->_health = fVar11; goto LAB_0050cab0; } if (iVar4 == 2) { if ((npc->_sprite)._flipX == 0) { local_74.x = 8.0; } else { local_74.x = -8.0; } local_74.y = 0.0; local_6c = (EntityPtr)local_74.x; uVar5 = Random(); local_84.x = (float)local_6c + (npc->_pos).x; local_84.y = (npc->_pos).y + 0.0; tmpEntity = Game::Spawn(g_game,0x26,1,&local_84,&local_74,(Entity *)npc,1,uVar5); uVar13 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar13; Color::Color((Color *)local_68); local_84.x = npc->_scale * 0.0; local_84.y = npc->_scale * -20.0; spawn_blood_explosion(2,&npc->_pos,&local_84,color,&local_74); } else { if (iVar4 != 3) goto LAB_0050ca5e; EVar9 = (EntityPtr)0x0; local_78 = 8.40779e-45; do { uVar5 = Random(); local_6c = (EntityPtr) Game::Spawn(g_game,0xde,0,&npc->_pos,&g_vectorZero,(Entity *)npc,1,uVar5); if (EVar9 == (EntityPtr)0x0) { EVar9 = local_6c; } local_84.y = (float)((int)local_6c + 0x3bc); if (*(EntityPtr *)((int)local_6c + 0x3bc) != (EntityPtr)0x0) { local_74.y = local_84.y; std::multiset::erase(); } *(EntityPtr *)local_84.y = EVar9; if (EVar9 != (EntityPtr)0x0) { std::multiset::insert(); } *(uint *)((int)local_6c + 0x168) = *(uint *)((int)local_6c + 0x168) & 0xfffffffb; *(undefined4 *)((int)local_6c + 0x16c) = *(undefined4 *)((int)local_6c + 0x16c); uVar5 = Random(); local_78 = (float)((int)local_78 + -1); *(float *)((int)local_6c + 0x380) = (float)(uVar5 % 100 + 200) + 0.0 + *(float *)((int)local_6c + 0x380); } while (local_78 != 0.0); local_78 = 0.0; } } else if (npc->_type == 0x331) { if (npc->_variant == 1) { uVar5 = Random(); uVar7 = 0x328; } else { uVar5 = Random(); uVar7 = 0x32a; } tmpEntity = Game::Spawn(g_game,uVar7,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); uVar13 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar13; } else { LAB_0050ca5e: uVar5 = Random(); uVar15 = 0xc5d6ac; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; uVar7 = 0x55; if (npc->_type == 0x16) { uVar7 = 0x12; } tmpEntity = Game::Spawn(g_game,uVar7,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); tmpEntity = (Entity *)__RTDynamicCast(tmpEntity,uVar13,pTVar14,uVar15); tmpEntity->_isKillOnTouch = 1; LAB_0050cab0: *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; } } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; } } iVar4 = Entity_NPC::GetAliveEnemyCount(npc); local_74.y = 7.00649e-45; if ((npc->_type == 0x16) && (npc->_variant == 3)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_34,0xde,-1,-1,1,0) ; fVar11 = 0.0; if (local_28 != 0.0) { do { iVar10 = *(int *)(local_34._4_4_ + (int)fVar11 * 4); if ((*(int *)(iVar10 + 0x3bc) != iVar10) && (*(uint *)(iVar10 + 0x3ec) % (uint)local_74.y == 0)) { iVar4 = iVar4 + -1; } fVar11 = (float)((int)fVar11 + 1); } while ((uint)fVar11 < (uint)local_28); npc = local_7c; } if (local_34[0] == '\0') { local_14 = 4; tracked_alloc(1,(void *)local_34._4_4_,0); local_14 = 0xffffffff; } } if (((npc->_v1).x - npc->_speedMultiplier <= 0.0) && (uVar5 = Random(), (int)(uVar5 % 5 + 4) <= iVar4)) { uVar5 = Random(); (npc->_v1).x = (float)(uVar5 % 0x32 + 0x14) + 0.0 + (npc->_v1).x; } if ((0 < (npc->_pathfinder)._evadeMovementCountdown) || (npc->_controllerID != -1)) { fVar11 = (npc->_v1).x; if (0.0 < fVar11) { (npc->_v1).x = fVar11 - npc->_speedMultiplier; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_6c = (EntityPtr)((tmpEntity->_pos).x - (npc->_pos).x); fVar11 = (tmpEntity->_pos).y - (npc->_pos).y; fVar11 = sqrtf(fVar11 * fVar11 + (float)local_6c * (float)local_6c); if (npc->_controllerID == -1) { isAttackWanted = fVar11 < 300.0; iVar4 = -1; } else { pVVar6 = Entity_NPC::GetControllerMovementInput(npc,(Vector *)(local_34 + 8),0.1); if ((pVVar6->x == g_vectorZero.x) && (pVVar6->y == g_vectorZero.y)) { iVar4 = npc->_controllerID; isAttackWanted = false; } else { iVar4 = npc->_controllerID; isAttackWanted = true; } } if ((!isAttackWanted) || ((npc->_flags & 0x1000a00) != 0)) { (npc->_v1).x = 3.0; } else { if (iVar4 == -1) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_74.x = (tmpEntity->_pos).x; local_74.y = (tmpEntity->_pos).y; bVar3 = Room::CheckLine(room,&local_74,&npc->_pos,2,0,0,0,(Vector *)0x0); if (bVar3 == 0) { (npc->_v1).x = 7.0; goto LAB_0050ce7b; } } fVar11 = 75.0; (npc->_v1).x = 75.0; if (npc->_type == 0xcd) { if (npc->_controllerID == -1) { uVar5 = Random(); fVar11 = (npc->_v1).x; uVar5 = uVar5 % 0x14; } else { uVar5 = 0; } (npc->_v1).x = (float)(uVar5 + 0x37) + 0.0 + fVar11; } if ((npc->_type == 0x16) && (npc->_variant == 3)) { (npc->_v1).x = 210.0; } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar11 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_74,0.1); (npc->_controllerMovement).x = local_74.x; fVar11 = local_74.y; } (npc->_controllerMovement).y = fVar11; EVar9 = (EntityPtr)(npc->_controllerMovement).x; if (((float)EVar9 != g_vectorZero.x) || (fVar11 != g_vectorZero.y)) { local_6c = EVar9; } bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadAttack",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } npc->_state = 8; (npc->_sprite)._flipX = (float)local_6c < 0.0; } } } LAB_0050ce7b: if ((npc->_dead != 0) && (-20.0 < npc->_health)) { iVar4 = Entity_NPC::GetAliveEnemyCount(npc); local_74.y = 4.0 / ((float)iVar4 * 0.2 + 1.0); dVar12 = ceil((double)local_74.y); local_74.y = (float)dVar12; iVar4 = npc->_type; baseSpawnCount = (int)dVar12; iVar10 = baseSpawnCount; if (iVar4 == 0x16) { iVar4 = npc->_variant; if ((iVar4 == 1) || (iVar4 == 2)) { uVar5 = Random(); iVar4 = (uVar5 & 1) + 1; if (iVar4 < baseSpawnCount) { iVar10 = iVar4; } } else if (iVar4 == 3) { iVar10 = 1; } } else if (iVar4 == 0xcd) { iVar10 = 1; } else if (iVar4 == 0x331) { iVar10 = 1; if (1 < baseSpawnCount + -1) { iVar10 = baseSpawnCount + -1; } } fVar11 = (float)(iVar10 - npc->_championRegenCount); local_74.y = 0.0; if (0 < (int)fVar11) { local_74.y = fVar11; } if (0 < (int)local_74.y) { do { local_6c = (EntityPtr)0x0; if (npc->_type == 0x16) { if (npc->_variant == 3) { local_7c = (Entity_NPC *)0x0; do { uVar5 = Random(); uVar7 = Random(); fVar11 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_6c = (EntityPtr)(fVar11 + fVar11); uVar7 = Random(); local_78 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 5.0; fVar11 = cos((float)local_6c); ringSpawnPos.x = fVar11 * local_78 + (npc->_pos).x; fVar11 = sin((float)local_6c); pEVar1 = local_7c; ringSpawnPos.y = fVar11 * local_78 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,*(uint *)(&DAT_00b615d0 + (int)local_7c), *(uint *)(&DAT_00b615d4 + (int)local_7c),&ringSpawnPos, &g_vectorZero,(Entity *)npc,0,uVar5); local_7c = (Entity_NPC *)((int)pEVar1 + 8); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); } while (local_7c < &DAT_00000068); } else { uVar5 = Random(); local_78 = 1.82169e-44; if (uVar5 % 0xb < 8) { if (uVar5 % 0xb == 7) { local_78 = 1.96182e-44; } } else { local_78 = 2.52234e-44; } if (npc->_variant == 1) { local_78 = 3.22299e-44; local_6c = (EntityPtr)0x1; } else if (npc->_variant == 2) { local_78 = 1.079e-43; local_6c = (EntityPtr)0x0; } uVar5 = Random(); fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; local_7c = (Entity_NPC *)(fVar11 + fVar11); uVar5 = Random(); local_84.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 6.0; if (local_84.y <= 2.0) { local_84.y = 2.0; } uVar5 = Random(); fVar11 = cos((float)local_7c); spawnPos.x = fVar11 * local_84.y + (npc->_pos).x; fVar11 = sin((float)local_7c); spawnPos.y = fVar11 * local_84.y + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,(uint)local_78,(uint)local_6c,&spawnPos,&g_vectorZero, (Entity *)npc,0,uVar5); uVar13 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar13; if (npc->_variant == 1) { fVar11 = tmpEntity->_maxHitPoints * 0.5; tmpEntity->_maxHitPoints = fVar11; tmpEntity->_health = fVar11; } } } else { if (npc->_type == 0x331) { if (npc->_variant != 1) { pVVar6 = Room::FindFreePickupSpawnPosition (g_game->_room,&freeSpawnPos,&npc->_pos,80.0,1, 0.0 < g_game->_room->_waterAmount,0); uVar5 = Random(); fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_84.y = fVar11 + fVar11; fVar11 = cos(local_84.y); local_34._8_4_ = fVar11 * 10.0 + pVVar6->x; fVar11 = sin(local_84.y); local_28 = fVar11 * 10.0 + pVVar6->y; Entity_NPC::ThrowLeech(&npc->_pos,(Entity *)npc,-10.0,(Vector *)(local_34 + 8),0); goto LAB_0050d323; } seed = Random(); uVar5 = 0; uVar7 = 0x328; } else { uVar5 = Random(); uVar5 = uVar5 & 1; seed = Random(); uVar7 = 0x5e; if (uVar5 != 0) { uVar7 = 0x1d; } } tmpEntity = Game::Spawn(g_game,uVar7,uVar5,&npc->_pos,&g_vectorZero,(Entity *)npc,0,seed); *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; } LAB_0050d323: local_74.y = (float)((int)local_74.y + -1); } while (local_74.y != 0.0); } } if (npc->_controllerID != -1) { npc->_friction = 1.0; } ExceptionList = local_1c; return; } //@@ 0050d370 NpcAI::ENTITY_CLOTTY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 15 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CLOTTY(Entity_NPC *npc) { code *pcVar1; void **ppvVar2; byte bVar3; uint uVar4; uint rngValue; int iVar5; Entity_Effect *splat; byte *nameCursor; int aliveEnemyCount; Vector *pVVar6; Entity *pEVar7; int *spawnedGlobin; int3 extraout_var; int3 extraout_var_00; float fVar8; byte *expectedName; char *expectedNameStr; void *allocBlock; float extraout_EDX; uint extraout_EDX_00; float *damageEvent; bool bVar9; float fVar10; undefined4 uVar11; TypeDescriptor *pTVar12; TypeDescriptor *pTVar13; undefined4 uVar14; undefined4 local_1b0 [8]; undefined4 local_190; undefined4 uStack_18c; undefined4 local_188; undefined4 local_184 [8]; undefined4 local_164; undefined4 uStack_160; undefined4 local_15c; undefined4 local_158 [8]; undefined4 local_138; undefined4 uStack_134; undefined4 local_130; Vector spawnPos; float local_124; float local_120; float local_11c; Vector local_118; ProjectileParams projParams; undefined1 local_68 [24]; float fStack_50; float fStack_4c; float local_48; float local_44; float local_40; void *local_3c [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; byte *curAnim; Manager *manager; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00af42d5; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; local_164 = 0; uStack_160 = 0; local_15c = 0; local_24 = uVar4; ppvVar2 = local_3c + 0xe; if (npc->_state == 0) { if (npc->_type == 0x368) { local_138 = 0x3e828283; uStack_134 = 0x3e24a4a5; local_130 = 0x3e0c8c8d; if (&npc->_splatColor != (ColorMod *)local_158) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.25490198; (npc->_splatColor)._offset[1] = 0.16078432; (npc->_splatColor)._offset[2] = 0.13725491; } rngValue = (npc->_dropRNG)._seed; puStack_20 = (undefined1 *)(local_3c + 0xe); if (rngValue == 0) { puStack_20 = (undefined1 *)(local_3c + 0xe); KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); rngValue = (npc->_dropRNG)._seed; if (rngValue == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } rngValue = rngValue >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ rngValue; rngValue = rngValue << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ rngValue; rngValue = rngValue >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ rngValue; (npc->_dropRNG)._seed = rngValue; npc->_i1 = rngValue & 1; ppvVar2 = (void **)puStack_20; } else if (npc->_variant == 1) { ppvVar2 = local_3c + 0xe; if (&npc->_splatColor != (ColorMod *)local_184) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.02; (npc->_splatColor)._tint[1] = 0.05; (npc->_splatColor)._tint[2] = 0.05; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; ppvVar2 = local_3c + 0xe; } } else { ppvVar2 = local_3c + 0xe; if (npc->_variant == 3) { local_68._0_4_ = 0.0; local_68._4_4_ = 0.0; local_68._8_4_ = 0.0; local_68._12_4_ = 1.0; local_48 = 0.14117648; local_44 = 0.12156863; local_68._16_4_ = 0.0; local_68._20_4_ = (void *)0x0; fStack_50 = 0.0; fStack_4c = 0.0; local_40 = 0.10980392; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_68); ppvVar2 = (void **)puStack_20; } } } puStack_20 = (undefined1 *)ppvVar2; iVar5 = Entity::GetIntervalTicks((Entity *)npc,5.0,(float)((uint)npc->_index % 5) + 0.0); if (iVar5 != 0) { rngValue = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.7 + 0.5); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1,uVar4); } if ((npc->_dead != 0) && (npc->_type == 0x11a)) { fVar8 = (float)(2 - npc->_championRegenCount); local_120 = 0.0; if (0 < (int)fVar8) { local_120 = fVar8; } if (0 < (int)local_120) { do { uVar4 = Random(); rngValue = Random(); local_11c = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_11c = local_11c + local_11c; local_124 = sin(local_11c); fVar8 = cos(local_11c); spawnPos.x = fVar8 * 20.0 + (npc->_pos).x; spawnPos.y = local_124 * 20.0 + (npc->_pos).y; Game::Spawn(g_game,0xf,0,&spawnPos,&g_vectorZero,(Entity *)npc,0,uVar4); local_120 = (float)((int)local_120 + -1); } while (local_120 != 0.0); } } iVar5 = npc->_state; npc->_friction = npc->_friction * 0.9; if ((iVar5 == 3) || (iVar5 == 4)) { (npc->_v1).x = 30.0; if (npc->_type == 0x11a) { (npc->_v1).x = 45.0; } else if ((npc->_type == 0xf) && (npc->_variant == 3)) { (npc->_v1).x = 15.0; } if ((((npc->_controllerID == -1) || (fVar8 = (npc->_velocity).y, fVar10 = (npc->_velocity).x, fVar8 = sqrtf(fVar10 * fVar10 + fVar8 * fVar8), 0.5 <= fVar8)) || (pVVar6 = Entity_NPC::GetControllerInput(npc,&local_118,0.1), pVVar6->x != g_vectorZero.x)) || (pVVar6->y != g_vectorZero.y)) { local_40 = 2.10195e-44; local_44 = 4.2039e-45; local_68._20_4_ = (void *)0x706f48; local_28 = 0xf; local_2c = 3; local_3c[0] = (void *)0x706f48; local_14 = (void *)0x1; Entity_NPC::AnimWalkFrame(npc,(std_string *)local_3c,(std_string *)(local_68 + 0x14),0.5); local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_28) { uVar4 = local_28 + 1; allocBlock = local_3c[0]; if (0xfff < uVar4) { allocBlock = *(void **)((int)local_3c[0] + -4); uVar4 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c[0] + (-4 - (int)allocBlock))) goto LAB_0050e18d; } operator_delete(allocBlock,uVar4); } local_14 = (void *)0xffffffff; local_2c = 0; local_28 = 0xf; local_3c[0] = (void *)((uint)local_3c[0] & 0xffffff00); if (0xf < (uint)local_40) { uVar4 = (int)local_40 + 1; allocBlock = (void *)local_68._20_4_; if (0xfff < uVar4) { allocBlock = *(void **)(local_68._20_4_ + -4); uVar4 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)allocBlock))) { LAB_0050e18d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar4); } } else { curAnim = (npc->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = s_Idle; do { bVar3 = *nameCursor; bVar9 = bVar3 < *expectedName; if (bVar3 != *expectedName) { LAB_0050e060: uVar4 = -(uint)bVar9 | 1; goto LAB_0050e065; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; bVar9 = bVar3 < expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_0050e060; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0050e065: if ((uVar4 == 0) && ((curAnim[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0050e19d; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0050e19d: local_118.y = *(float *)((int)&npc->_flags + 4); if ((((npc->_flags & 0x1000800) == 0) || ((npc->_flags & 0x720) != 0)) || (npc->_controllerID != -1)) { bVar3 = PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); if (((bVar3 != 0) && ((npc->_flags & 0x200) == 0)) && ((npc->_controllerID == -1 || ((bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar3 != 0 || (bVar3 = Entity_NPC::IsControllerActionPressed(npc,9), bVar3 != 0)))))) { if ((npc->_type == 0xf) && (npc->_variant == 3)) { iVar5 = npc->_i2; if (2 < iVar5) { npc->_i2 = 0; goto LAB_0050e38d; } } else { iVar5 = npc->_i2; } npc->_state = 8; npc->_i2 = iVar5 + 1; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar8 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_118,0.1); (npc->_controllerMovement).x = local_118.x; fVar8 = local_118.y; } (npc->_controllerMovement).y = fVar8; curAnim = (npc->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedNameStr = "Attack"; do { bVar3 = *nameCursor; bVar9 = bVar3 < (byte)*expectedNameStr; if (bVar3 != *expectedNameStr) { LAB_0050e351: uVar4 = -(uint)bVar9 | 1; goto LAB_0050e356; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; bVar9 = bVar3 < (byte)expectedNameStr[1]; if (bVar3 != expectedNameStr[1]) goto LAB_0050e351; nameCursor = nameCursor + 2; expectedNameStr = expectedNameStr + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0050e356: if ((uVar4 == 0) && ((curAnim[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0050e38d; } bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_118.x = (pEVar7->_pos).x; local_118.y = (pEVar7->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_118,0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } LAB_0050e38d: if (npc->_type == 0x11a) { npc->_friction = npc->_friction * 0.85; } goto LAB_0050e3ae; } if (iVar5 != 8) { uVar4 = Random(); npc->_state = (~uVar4 & 1) * 4 + 4; (npc->_v1).x = 30.0; if ((npc->_type == 0xf) && (npc->_variant == 3)) { (npc->_v1).x = 15.0; } curAnim = (npc->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedName = &DAT_00b1de1c; do { bVar3 = *nameCursor; bVar9 = bVar3 < *expectedName; if (bVar3 != *expectedName) { LAB_0050d754: uVar4 = -(uint)bVar9 | 1; goto LAB_0050d759; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; bVar9 = bVar3 < expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_0050d754; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0050d759: if ((uVar4 == 0) && ((curAnim[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0050e3ae; } bVar3 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1de1c,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_0050e3ae; } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) || ((uVar4 = Random(), uVar4 % 0x1e != 0 && ((npc->_v1).x <= 0.0)))) { npc->_state = 4; } else { curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0050d82e: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } expectedNameStr = "Attack"; do { bVar3 = *nameCursor; bVar9 = bVar3 < (byte)*expectedNameStr; if (bVar3 != *expectedNameStr) { LAB_0050d810: uVar4 = -(uint)bVar9 | 1; goto LAB_0050d815; } if (bVar3 == 0) break; bVar3 = nameCursor[1]; bVar9 = bVar3 < (byte)expectedNameStr[1]; if (bVar3 != expectedNameStr[1]) goto LAB_0050d810; nameCursor = nameCursor + 2; expectedNameStr = expectedNameStr + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0050d815: if ((uVar4 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0050d82e; } allocBlock = (npc->_sprite)._animState._animData; if (npc->_type == 0x11a) { if ((allocBlock != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0x30,0.8,2,0,1.0); fVar8 = (float)npc->_controllerID; iVar5 = -1; local_11c = fVar8; if (((npc->_controllerMovement).x != g_vectorZero.x) || ((npc->_controllerMovement).y != g_vectorZero.y)) { iVar5 = vector_to_direction(&npc->_controllerMovement); fVar8 = extraout_EDX; } if (fVar8 == -NAN) { uVar4 = Random(); if ((uVar4 & 3) != 0) goto LAB_0050dbc0; uVar4 = Random(); bVar9 = uVar4 % 3 == 0; } else { if ((iVar5 == 0) || (iVar5 == 2)) { LAB_0050dbc0: ProjectileParams::ProjectileParams(&projParams); uVar4 = Random(); local_118.x = 10.0; local_118.y = 6.0; projParams.CircleAngle = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0 - 180.0; LAB_0050dea3: uVar4 = 9; goto LAB_0050deac; } bVar9 = iVar5 != -1; } if ((bVar9) && (aliveEnemyCount = Entity_NPC::GetAliveEnemyCount(npc), aliveEnemyCount < 5)) { if (local_11c == -NAN) { uVar4 = Random(); bVar9 = uVar4 % 3 == 0; } else { bVar9 = iVar5 == 1; } if (bVar9) { uVar4 = Random(); pVVar6 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_118,&npc->_pos,40.0,0,0,0); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; pEVar7 = Game::Spawn(g_game,0x18,0,pVVar6,&g_vectorZero,(Entity *)npc,0,uVar4); spawnedGlobin = (int *)__RTDynamicCast(pEVar7,uVar11,pTVar12,pTVar13,uVar14); ANM2::Play((ANM2 *)(spawnedGlobin + 0x12),(byte *)"ReGen",0); spawnedGlobin[0x2d9] = 3; (**(code **)(*spawnedGlobin + 0xc))(); } else { uVar4 = Random(); pVVar6 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_118,&npc->_pos,40.0,0,0,0); Game::Spawn(g_game,0xf,0,pVVar6,&g_vectorZero,(Entity *)npc,0,uVar4); } } else { local_11c = 5.60519e-45; do { uVar4 = Random(); rngValue = Random(); local_120 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_120 = local_120 + local_120; rngValue = Random(); local_124 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 40.0; fVar8 = cos(local_120); local_118.x = fVar8 * local_124 + (npc->_pos).x; fVar8 = sin(local_120); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_118.y = fVar8 * local_124 + (npc->_pos).y; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; pEVar7 = Game::Spawn(g_game,1000,0x16,&local_118,&g_vectorZero,(Entity *)npc,0,uVar4); iVar5 = __RTDynamicCast(pEVar7,uVar11,pTVar12,pTVar13,uVar14); uVar4 = Random(); local_11c = (float)((int)local_11c + -1); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.0; fVar10 = fVar8 * g_vectorOne.y; fVar8 = fVar8 * g_vectorOne.x; *(undefined4 *)(iVar5 + 0x45c) = 0xd2; *(float *)(iVar5 + 0xe8) = fVar10; *(undefined4 *)(iVar5 + 0x460) = 0xd2; *(float *)(iVar5 + 0xe4) = fVar8; } while (local_11c != 0.0); local_11c = 0.0; } } } else if (npc->_type == 0x368) { if ((allocBlock != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { local_118.x = 0.0; local_118.y = -20.0; spawn_blood_explosion(2,&npc->_pos,&local_118,&npc->_splatColor,&g_vectorZero); manager = g_manager; local_11c = 2.32616e-43; seed_fart_sound_override((int *)&local_11c); SoundEffects::Play(&manager->_sfxManager,(int)local_11c,1.0,2,0,1.0,0.0); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 3; projParams.BulletFlags._4_4_ = 0; projParams.CurvingStrength = 0.012; projParams.FallingAccelModifier = -0.02; if (npc->_i1 == 0) { projParams.BulletFlags._0_4_ = 0x80000; projParams.CircleAngle = -0.9424779; } else { projParams.BulletFlags._0_4_ = 0x40000; projParams.CircleAngle = 0.9424779; } local_118.x = 8.0; local_118.y = 4.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_118,9,&projParams); npc->_i1 = 1 - npc->_i1; } } else if ((allocBlock != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { local_118.x = 0.0; local_118.y = -20.0; spawn_blood_explosion(2,&npc->_pos,&local_118,&npc->_splatColor,&g_vectorZero); manager = g_manager; local_11c = 2.32616e-43; seed_fart_sound_override((int *)&local_11c); SoundEffects::Play(&manager->_sfxManager,(int)local_11c,1.0,2,0,1.0,0.0); if (npc->_variant == 3) { ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = 0.02; uVar4 = Random(); projParams.CircleAngle = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.1415927 * 0.05; bVar3 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar3) == 0 || extraout_var < 0) { local_118.x = 7.0; } else { local_118.x = 8.0; } local_118.y = 4.0; goto LAB_0050dea3; } ProjectileParams::ProjectileParams(&projParams); iVar5 = npc->_variant; if ((iVar5 != 0) && ((iVar5 == 1 || ((iVar5 != 2 && (iVar5 == 1)))))) { Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34e54); } bVar3 = Game::IsHardMode(); if (CONCAT31(extraout_var_00,bVar3) == 0 || extraout_var_00 < 0) { local_118.x = 7.0; } else { local_118.x = 10.0; } local_118.y = 0.0; uVar4 = extraout_EDX_00; LAB_0050deac: Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_118,uVar4,&projParams); } } (npc->_v1).x = (npc->_v1).x - npc->_speedMultiplier; LAB_0050e3ae: if (npc->_type == 0xf) { if (*(float *)((int)g_game->_room + 0x7240) <= 0.2) { if (((npc->_variant == 0) || (npc->_variant == 3)) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (((uint)damageEvent[2] & 2) != 0) { npc->_pendingDamage = npc->_pendingDamage - *damageEvent; *damageEvent = 0.0; if (npc->_variant == 0) { Entity_NPC::Morph(npc,0xf,3,0,-1); local_190 = 0x3e109091; uStack_18c = 0x3df8f8f9; local_188 = 0x3de0e0e1; if (&npc->_splatColor != (ColorMod *)local_1b0) { (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.14117648; (npc->_splatColor)._offset[1] = 0.12156863; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.10980392; } } } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } } else if (npc->_variant == 3) { Entity_NPC::Morph(npc,0xf,0,0,-1); } } ExceptionList = local_1c; return; } //@@ 0050e4d0 NpcAI::ENTITY_GLOBIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 24 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GLOBIN(Entity_NPC *npc) { undefined1 *flagsHighPtr; byte bVar2; uint uVar3; int iVar4; uint uVar5; ColorMod *extraout_EAX; ColorMod *other; ColorMod *other_00; Entity *pEVar6; Vector *pVVar7; int *piVar8; Entity_Effect *splat; void *pvVar9; uint splitChance; float fVar10; float fVar11; undefined1 auVar12 [12]; float fVar13; undefined4 uVar14; TypeDescriptor *pTVar15; TypeDescriptor *pTVar16; undefined4 uVar17; Vector splitSpawnPos; Vector local_a4; float splitDirX; Vector local_98; Vector local_90; int *local_88; Entity_NPC *local_84; char isSplitting; undefined1 local_7c [24]; float fStack_64; float fStack_60; float local_5c; float fStack_58; float local_54; undefined1 local_50 [24]; float local_38; RNG local_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *flagsHighPtr; Game *game; Room *room; qword savedFlags; code *setColorFn; game = g_game; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4315; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_50 + 0x40); if (npc->_aiCallPhase == 1) { if (npc->_i1 < 1) { return; } iVar4 = npc->_i1 + -1; npc->_i1 = iVar4; if (iVar4 < 1) { npc->_isInvicible = 0; return; } return; } ExceptionList = &local_1c; local_84 = npc; local_24 = uVar3; if (npc->_state == 0) { if (npc->_variant == 3) { puStack_20 = local_50 + 0x4c; uVar5 = Game::GetStageID(g_game,(byte)npc); if (uVar5 == 0x20) { Color::Color((Color *)local_50); other = extraout_EAX; } else { local_54 = DAT_00c34dcc; other = (ColorMod *)local_7c; local_7c._0_4_ = _DAT_00c34da4; local_7c._4_4_ = fRam00c34da8; local_7c._8_4_ = fRam00c34dac; local_7c._12_4_ = fRam00c34db0; local_7c._16_4_ = _DAT_00c34db4; local_7c._20_4_ = pvRam00c34db8; fStack_64 = fRam00c34dbc; fStack_60 = fRam00c34dc0; local_5c = (float)DAT_00c34dc4; fStack_58 = DAT_00c34dc4._4_4_; } Color::operator_assign((Color *)&npc->_splatColor,other); npc->_aiCallFlags = npc->_aiCallFlags | 1; } else { puStack_20 = local_50 + 0x4c; if (npc->_variant == 2) { puStack_20 = local_50 + 0x4c; Color::Color((Color *)local_7c); Color::operator_assign((Color *)&npc->_splatColor,other_00); } } (npc->_v1).x = npc->_health; npc->_state = 4; if (npc->_subtype != 10) { ExceptionList = local_1c; return; } uVar5 = (uint)npc->_flags; if ((uVar5 & 4) != 0) { *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = uVar5 & 0xfffffffb; uVar5 = Random(); uVar17 = 0; pTVar16 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar14 = 0; pEVar6 = Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); local_88 = (int *)__RTDynamicCast(pEVar6,uVar14,pTVar15,pTVar16,uVar17,uVar3); local_88[0xd3] = (int)(npc->_posOffset).x; local_88[0xd4] = (int)(npc->_posOffset).y; local_88[0xd6] = (int)((npc->_posOffset).y + 1.0); if (npc->_isChampion != 0) { setColorFn = *(code **)(*local_88 + 0x3c); uVar14 = _Entity_NPC::GetColorWithFlash(local_7c); (*setColorFn)(uVar14,0xffffffff,0xff,0,1); } (**(code **)(*local_88 + 0xc))(); } ANM2::Play(&npc->_sprite,(byte *)"ReGen",0); npc->_state = 3; ExceptionList = local_1c; return; } splitDirX = 0.0; flagsHighPtr = local_50 + 0x4c; if ((npc->_type == 0x116) && (flagsHighPtr = local_50 + 0x4c, 5.0 < (npc->_v1).x - npc->_health)) { (npc->_v1).x = npc->_health; room = game->_room; pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_98.x = (npc->_pos).x; local_98.y = (npc->_pos).y; local_98.x = local_98.x + ((pEVar6->_pos).x - local_98.x) * 0.75; local_98.y = local_98.y + ((pEVar6->_pos).y - local_98.y) * 0.75; pVVar7 = Room::FindFreePickupSpawnPosition(room,&local_a4,&local_98,0.0,0,0,0); Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)local_84,*pVVar7,0,-30.0); npc = local_84; Entity_NPC::PlaySound(local_84,0xb5,0.25,2,0,1.0); flagsHighPtr = puStack_20; } puStack_20 = flagsHighPtr; if (((npc->_dead != 0) && (npc->_type == 0x18)) && (npc->_variant == 2)) { uVar5 = Random(); uVar17 = 0; pTVar16 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar14 = 0; pEVar6 = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); piVar8 = (int *)__RTDynamicCast(pEVar6,uVar14,pTVar15,pTVar16,uVar17,uVar3); if (piVar8[0xef] != 0) { local_90.y = (float)(piVar8 + 0xef); std::multiset::erase(&local_90.y); } piVar8[0xef] = (int)npc; std::multiset::insert(piVar8 + 0xef); fVar13 = g_vectorOne.x * 2.0; fVar11 = g_vectorOne.y * 2.0; piVar8[0x117] = 0xd2; piVar8[0x39] = (int)fVar13; piVar8[0x118] = 0xd2; piVar8[0x3a] = (int)fVar11; (**(code **)(*piVar8 + 0xc))(); } if (npc->_state == 4) { uVar3 = Random(); if (uVar3 % 10 == 0) { uVar3 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } local_54 = 2.10195e-44; fStack_58 = 1.12104e-44; local_7c[0x14] = 'W'; local_7c[0x15] = 'a'; local_7c[0x16] = 'l'; local_7c[0x17] = 'k'; fStack_64 = (float)0x74726556; fStack_60 = (float)((uint)fStack_60 & 0xffffff00); local_34._shift3 = 0xf; local_34._shift2 = 8; local_50[0x14] = 'W'; local_50[0x15] = 'a'; local_50[0x16] = 'l'; local_50[0x17] = 'k'; local_38 = (float)0x69726f48; local_34._seed = local_34._seed & 0xffffff00; local_14 = 1; Entity_NPC::AnimWalkFrame (npc,(std_string *)(local_50 + 0x14),(std_string *)(local_7c + 0x14),0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_34._shift3) { uVar3 = local_34._shift3 + 1; pvVar9 = (void *)local_50._20_4_; if (0xfff < uVar3) { pvVar9 = *(void **)(local_50._20_4_ + -4); uVar3 = local_34._shift3 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar9))) goto LAB_0050ea3b; } operator_delete(pvVar9,uVar3); } local_14 = 0xffffffff; local_34._shift2 = 0; local_34._shift3 = 0xf; local_50._20_4_ = local_50._20_4_ & 0xffffff00; if (0xf < (uint)local_54) { uVar3 = (int)local_54 + 1; pvVar9 = (void *)local_7c._20_4_; if (0xfff < uVar3) { pvVar9 = *(void **)(local_7c._20_4_ + -4); uVar3 = (int)local_54 + 0x24; if (0x1f < (uint)(local_7c._20_4_ + (-4 - (int)pvVar9))) { LAB_0050ea3b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar3); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { if (npc->_type == 0x116) { piVar8 = (int *)0x3f19999a; } else if (npc->_variant == 1) { piVar8 = (int *)0x3f8ccccd; } else { if (npc->_variant == 3) { local_34._seed = npc->_initSeed; local_34._shift1 = 0xb; local_34._shift2 = 7; local_34._shift3 = 0xc; if (npc->_subtype != 0) { fVar11 = RNG::RandomFloat(&local_34); piVar8 = (int *)(fVar11 * 0.25 + 0.65); local_90.y = (float)piVar8; goto LAB_0050eb28; } } piVar8 = (int *)0x3f400000; } LAB_0050eb28: bVar2 = 1; iVar4 = 0; pVVar7 = Entity_NPC::CalcTargetPosition(npc,&local_a4,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar7,(float)piVar8,iVar4,bVar2); } else { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_98.x = (pEVar6->_pos).x; local_98.y = (pEVar6->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_98,0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); bVar2 = Entity::IsHostileTo((Entity *)npc,pEVar6); if (((bVar2 != 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (uVar3 = Random(), uVar3 % 3 == 0)) goto LAB_0050eb9d; } else { bVar2 = Entity_NPC::IsControllerActionTriggered(npc,10); if (bVar2 != 0) { LAB_0050eb9d: Entity_NPC::PlaySound(npc,0xa5,1.0,0x28,0,1.0); } } npc->_friction = npc->_friction * 0.97; (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } else { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_88 = (int *)((pEVar6->_pos).x - (npc->_pos).x); local_90.y = (pEVar6->_pos).y - (npc->_pos).y; if (npc->_variant == 1) { if (npc->_controllerID != -1) { pVVar7 = Entity_NPC::GetControllerInput(npc,&local_a4,0.1); local_88 = (int *)(pVVar7->x * 10.0); local_90.y = pVVar7->y * 10.0; } fVar11 = sqrtf((float)local_88 * (float)local_88 + local_90.y * local_90.y); if ((fVar11 < 200.0) && (0.01 < fVar11)) { fVar13 = npc->_friction; if (fVar13 != 0.0) { fVar10 = npc->_speedMultiplier; (npc->_velocity).x = (-(float)local_88 * (0.5 / fVar11) * fVar10) / fVar13 + (npc->_velocity).x; (npc->_velocity).y = (-local_90.y * (0.5 / fVar11) * fVar10) / fVar13 + (npc->_velocity).y ; } } fVar11 = npc->_friction * 0.83; } else { fVar11 = npc->_friction * 0.7; } npc->_friction = fVar11; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Regen"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x1d,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0050ed8a; } npc->_state = 4; } LAB_0050ed8a: if (npc->_dead == 0) { ExceptionList = local_1c; return; } if (npc->_type == 0x116) { uVar3 = Random(); Game::Spawn(g_game,0x118,0,&npc->_pos,&g_vectorZero,(Entity *)local_84,0,uVar3); uVar3 = Random(); pVVar7 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_a4,&npc->_pos,40.0,0,0,0); Game::Spawn(g_game,0x117,0,pVVar7,&g_vectorZero,(Entity *)local_84,0,uVar3); ExceptionList = local_1c; return; } if (npc->_variant != 3) { if (npc->_state != 4) { ExceptionList = local_1c; return; } npc->_dead = 0; npc->_health = 10.0; ANM2::Play(&npc->_sprite,(byte *)"ReGen",0); npc->_state = 3; if (npc->_variant != 2) { ExceptionList = local_1c; return; } iVar4 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar4 < 7) { uVar3 = Random(); pEVar6 = Game::Spawn(g_game,0x55,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); uVar14 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar14; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } local_34._seed = npc->_initSeed; local_34._shift1 = 0xb; local_34._shift2 = 7; local_34._shift3 = 0x10; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x20000000000000); if (bVar2 == 0) { iVar4 = 0xf; if (*(int *)((int)g_game->_room + 8) == 5) { iVar4 = 0x19; } splitChance = iVar4 * npc->_subtype; uVar5 = RNG::RandomInt(&local_34,100); uVar3 = 99; if (splitChance < 99) { uVar3 = splitChance; } if (uVar5 <= uVar3) goto LAB_0050ef86; fVar11 = (npc->_velocity).x; fVar13 = (npc->_velocity).y; if (0.01 <= fVar11 * fVar11 + fVar13 * fVar13) { local_90.y = cos(1.5707964); fVar10 = sin(1.5707964); fVar11 = (npc->_velocity).x; fVar13 = (npc->_velocity).y; local_98.x = fVar11 * local_90.y - fVar13 * fVar10; local_98.y = fVar13 * local_90.y + fVar11 * fVar10; pVVar7 = Vector::Normalized(&local_98,&local_90); } else { pVVar7 = MusicManager::RandomVector(&local_a4); } splitDirX = pVVar7->x; local_84 = (Entity_NPC *)pVVar7->y; npc->_dead = 0; isSplitting = '\x01'; if (npc->_state != 4) { local_88 = (int *)0x28; isSplitting = '\x01'; goto LAB_0050efb6; } } else { LAB_0050ef86: isSplitting = '\0'; if (npc->_state != 4) { ExceptionList = local_1c; return; } npc->_dead = 0; local_84 = (Entity_NPC *)0x0; } local_88 = (int *)((4 - npc->_subtype) * 10); LAB_0050efb6: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"ReGen",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if ((0 < (int)local_88) && ((npc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)local_88); } fVar11 = npc->_maxHitPoints * 0.6; npc->_state = 3; auVar12 = ZEXT812(0x3f800000); if (auVar12._0_4_ <= fVar11) { auVar12._4_8_ = auVar12._4_8_; auVar12._0_4_ = fVar11; } npc->_maxHitPoints = auVar12._0_4_; npc->_health = auVar12._0_4_; if (isSplitting != '\0') { npc->_subtype = npc->_subtype + 1; npc->_isInvicible = 1; npc->_i1 = 2; uVar3 = RNG::Next(&local_34); npc->_initSeed = uVar3; uVar3 = RNG::Next(&local_34); local_a4.x = splitDirX * 4.0; local_a4.y = (float)local_84 * 4.0; splitSpawnPos.x = local_a4.x + (npc->_pos).x; splitSpawnPos.y = local_a4.y + (npc->_pos).y; local_98.y = local_a4.y; local_90.y = local_a4.x; pEVar6 = Game::Spawn(g_game,npc->_type,npc->_variant,&splitSpawnPos,&local_a4,(Entity *)npc,0, uVar3); fVar11 = npc->_maxHitPoints; pEVar6->_health = fVar11; pEVar6->_maxHitPoints = fVar11; ANM2::Play(&pEVar6->_sprite,(byte *)"ReGen",0); if ((0 < (int)local_88) && ((pEVar6->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pEVar6->_sprite)._animState,(float)(int)local_88); } iVar4 = npc->_subtype; *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; pEVar6->_subtype = iVar4; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); pEVar6[2]._posOffset.x = 4.2039e-45; Color::operator_assign((Color *)&pEVar6->_splatColor,&npc->_splatColor); flagsHighPtr = (uint *)((int)&pEVar6->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x400; savedFlags = pEVar6->_flags; pEVar6[3]._baitedCountdown = pEVar6[3]._baitedCountdown | 1; pEVar6->_isInvicible = 1; *(undefined4 *)&pEVar6[2].field_0x3a8 = 1; *(int *)&pEVar6->_flags = (int)savedFlags; fVar11 = (npc->_pos).x; (npc->_velocity).x = splitDirX * -4.0; (npc->_velocity).y = (float)local_84 * -4.0; (npc->_pos).x = fVar11 - local_90.y; (npc->_pos).y = (npc->_pos).y - local_98.y; } ExceptionList = local_1c; return; } //@@ 0050f280 NpcAI::ENTITY_BOOMFLY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 25 (from dispatcher 006c2990) */ uint __fastcall NpcAI::ENTITY_BOOMFLY(Entity_NPC *npc) { float *pfVar1; ANM2 *pAVar2; byte bVar3; uint uVar4; uint extraout_EAX; Entity_Player *player; uint uVar5; Entity *tmpEntity; Vector *tmpVec; EntityRef *entityRef; ColorMod *Color; uint extraout_EAX_00; ProjectileParams *params; uint extraout_EAX_01; int iVar6; int3 extraout_var; uint extraout_EAX_02; int3 extraout_var_00; uint extraout_EAX_03; undefined4 uVar7; ProjectileParams *params_00; code *extraout_EDX; int iVar8; bool isAlive; float fVar9; float fVar10; float fVar11; float fVar12; undefined1 auStack_138 [4]; float local_134; Vector local_130; float local_128; Vector local_124; float local_11c; Vector local_118; undefined4 local_110 [8]; undefined4 local_f0; undefined4 uStack_ec; undefined4 local_e8; Color local_e4; ProjectileParams projParams; uint local_c; ColorMod *effectColor; Game *game; Room *room; local_c = __security_cookie ^ (uint)auStack_138; if (npc->_state == 0) { iVar6 = npc->_variant; if (iVar6 == 3) { local_f0 = 0x3f800000; uStack_ec = 0x3f038384; local_e8 = 0x3b808081; if (&npc->_splatColor != (ColorMod *)local_110) { (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.1; (npc->_splatColor)._offset[0] = 1.0; (npc->_splatColor)._offset[1] = 0.5137255; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.003921569; } } else if (iVar6 == 4) { uVar7 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; *(undefined4 *)((int)&npc->_flags + 4) = uVar7; } else if (iVar6 == 5) { ::Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); } npc->_state = 4; npc->_entityGridCollisionClass = 3; uVar4 = Random(); local_134 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_134 = local_134 + local_134; local_128 = cos(local_134); fVar9 = sin(local_134); (npc->_velocity).x = local_128; (npc->_velocity).y = fVar9; return extraout_EAX; } player = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); if (player == (Entity_Player *)0x0) { LAB_0050f4ca: isAlive = npc->_dead == 0; } else { isAlive = false; if (npc->_dead == 0) { if ((npc->_flags & 0x20000000) == 0) { local_e4._tint[0] = (float)player->_type; local_e4._colorize[0] = (player->_pos).x; local_e4._colorize[1] = (player->_pos).y; local_e4._tint[1] = (float)player->_variant; local_e4._tint[2] = (float)player->_spawnerType; local_e4._tint[3] = (float)player->_spawnerVariant; local_e4._colorize[2] = (player->_velocity).x; local_e4._colorize[3] = (player->_velocity).y; local_128 = (float)(uint)((player->_flags & 0x100) != 0); if ((player->_flags & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } if ((player->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } local_e4._offset[0] = (float)(uVar5 | uVar4 | (uint)local_128); local_e4._offset[1] = (float)player; Entity::AddCharmed((Entity *)npc,(EntityRef *)&local_e4,-1,1,0); } goto LAB_0050f4ca; } } if (isAlive) { if (npc->_state == 5) { bVar3 = npc->_collidesWithGrid; (npc->_velocity).x = (npc->_targetPosition).x; (npc->_velocity).y = (npc->_targetPosition).y; if (bVar3 != 0) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_state = 4; } } else if (npc->_state == 0x10) { fVar9 = (npc->_posOffset).y; fVar12 = npc->_speedMultiplier; fVar10 = (npc->_v1).x - fVar9 * 0.1 * fVar12; (npc->_v1).x = fVar10; fVar11 = 0.7; (npc->_posOffset).y = fVar10 * fVar12 + fVar9; if (fVar12 != 1.0) { fVar11 = 0.7 / ((fVar12 + 0.7) - fVar12 * 0.7); } fVar9 = (npc->_sprite)._scale.x; fVar9 = (1.0 - fVar9) * (1.0 - fVar11) + fVar9; fVar12 = fVar9 * g_vectorOne.x; (npc->_sprite)._scale.y = fVar9 * g_vectorOne.y; (npc->_sprite)._scale.x = fVar12; fVar9 = (npc->_targetPosition).y; fVar12 = (npc->_pos).y; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) * 0.1; (npc->_velocity).y = (fVar9 - fVar12) * 0.1; } } fVar9 = npc->_friction * 0.9; local_128 = 0.0; npc->_friction = fVar9; if (npc->_state != 8) { if (npc->_state == 9) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { entityRef = EntityRef::EntityRef((EntityRef *)&local_e4); (*extraout_EDX)(entityRef); ::Color::Color(&local_e4); Game::BombExplosionEffects (g_game,&npc->_pos,80.0,(BitSet128)ZEXT816(0),Color,(Entity *)npc,1.5,0,4,0); Game::ShakeScreen(g_game,10); local_11c = 0.0; do { fVar9 = local_11c; uVar4 = Random(); local_134 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.8 + ((float)(int)fVar9 - 0.4)) * 36.0 * 0.017453292; local_130.x = sin(local_134); uVar4 = Random(); uVar5 = Random(); local_118.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 10.0; local_124.x = cos(local_134); local_124.x = local_124.x * local_118.x; local_124.y = local_130.x * local_118.x; tmpEntity = Game::SpawnEx(g_game,1000,0x3b,&npc->_pos,&local_124,(Entity *)npc,0,uVar4,0); uVar4 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar4 = Random(); local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; iVar6 = *(int *)tmpEntity; iVar8 = uVar4 % 0xf + 0xf; local_e4._offset[2] = 0.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar8; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar8; local_e4._tint[0] = 0.8; local_e4._tint[1] = 0.68; local_e4._tint[2] = 0.65; local_e4._tint[3] = 0.6; (**(code **)(iVar6 + 0x3c))(&local_e4,0xffffffff,0xff,0,1); fVar9 = g_vectorOne.y; fVar12 = g_vectorOne.x * 2.0; tmpEntity->_renderZOffset = -600; (tmpEntity->_sprite)._scale.x = fVar12; (tmpEntity->_sprite)._scale.y = fVar9 * 2.0; local_11c = (float)((int)local_11c + 1); } while ((int)local_11c < 10); iVar6 = 0; do { local_130.x = (float)iVar6 * 90.0 * 0.017453292; local_118.x = sin(local_130.x); local_130.x = cos(local_130.x); uVar4 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0xbb,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4, 0); iVar8 = *(int *)tmpEntity; (tmpEntity->_targetPosition).x = local_130.x; (tmpEntity->_targetPosition).y = local_118.x; (**(code **)(iVar8 + 0xc))(); iVar6 = iVar6 + 1; } while (iVar6 < 4); local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; local_e4._offset[2] = 0.0; Entity::MakeGroundPoof((Entity *)npc,&npc->_pos,(ColorMod *)&local_e4,1.0); game = g_game; g_game->_bloomDuration = 6; game->_bloomTimer = 6; game->_bloomStrength = 1.0; fVar9 = npc->_friction; } npc->_friction = fVar9 * 0.6; } else { ANM2::Play(&npc->_sprite,s_Fly,0); if ((npc->_variant == 4) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 == 0)) { if (npc->_controllerID == -1) { bVar3 = Entity::IsFrame((Entity *)npc,3,npc->_index); if ((bVar3 == 0) || ((bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar3 != 0 && (tmpEntity = Entity_NPC::GetPlayerTarget(npc), tmpEntity->_type == 1)))) goto LAB_0050fd83; room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_134 = (tmpEntity->_pos).x; local_11c = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130.x = (tmpEntity->_velocity).x; local_118.x = (tmpEntity->_velocity).y; uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 16.0; local_124.x = local_134 + local_130.x * fVar9; local_124.y = local_11c + local_118.x * fVar9; Room::GetClampedPositionImpl(room,&local_130,&local_124,20.0,20.0,20.0,20.0); fVar12 = (npc->_pos).x - local_130.x; fVar9 = (npc->_pos).y - local_130.y; if (((20.0 <= ABS(fVar12)) && (20.0 <= ABS(fVar9))) || ((fVar9 = sqrtf(fVar9 * fVar9 + fVar12 * fVar12), 200.0 <= fVar9 || (bVar3 = Room::CheckLine(g_game->_room,&npc->_pos,&local_130,3,999,0,0,(Vector *)0x0), bVar3 == 0)))) goto LAB_0050fd83; } else { bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar3 == 0) goto LAB_0050fd83; Entity_NPC::UpdateControllerMovement(npc,1); } npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } } goto LAB_0050fd83; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0050f798: npc->_state = 4; } else { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if ((bVar3 != 0) && (npc->_variant == 4)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130.y = (tmpEntity->_pos).y - (npc->_pos).y; fVar9 = (npc->_controllerMovement).x; if ((fVar9 != g_vectorZero.x) || (local_130.x = (tmpEntity->_pos).x - (npc->_pos).x, (npc->_controllerMovement).y != g_vectorZero.y)) { local_130.y = (npc->_controllerMovement).y; local_130.x = fVar9; } ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; ::Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c5c7d4); Entity_NPC::PlaySound(npc,0xf9,1.0,2,0,1.0); tmpVec = Vector::Normalized(&local_130,&local_124); local_130.x = tmpVec->x * 10.0; local_130.y = tmpVec->y * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_130,0,&projParams); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0050f798; } npc->_friction = npc->_friction * 0.8; LAB_0050fd83: if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { local_11c = 0.45; if (npc->_variant == 2) { local_11c = 0.4; } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1); if ((player != (Entity_Player *)0x0) && ((npc->_flags & 0x20000000) == 0)) { local_11c = 0.25; } local_134 = local_11c; if ((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) { local_134 = -local_11c; } pfVar1 = &(npc->_velocity).y; if (*pfVar1 <= 0.0 && *pfVar1 != 0.0) { local_11c = -local_11c; } fVar9 = local_11c; fVar12 = local_134; if (npc->_controllerID != -1) { local_130.x = sqrtf(local_11c * local_11c + local_134 * local_134); tmpVec = Entity_NPC::GetControllerInput(npc,&local_124,0.0); fVar9 = local_11c + local_130.x * 0.5 * tmpVec->y; fVar12 = local_134 + local_130.x * 0.5 * tmpVec->x; } fVar10 = npc->_friction; if (fVar10 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).x = (fVar12 * fVar11) / fVar10 + (npc->_velocity).x; (npc->_velocity).y = (fVar9 * fVar11) / fVar10 + (npc->_velocity).y; } if (((npc->_flags & 0x1000800) != 0) && (npc->_controllerID == -1)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_134 = -((tmpEntity->_pos).x - (npc->_pos).x); local_11c = -((tmpEntity->_pos).y - (npc->_pos).y); fVar12 = sqrtf(local_134 * local_134 + local_11c * local_11c); fVar9 = (120.0 - fVar12) * 0.02; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } if (fVar12 <= 0.0) { fVar10 = local_11c; fVar9 = local_134; } else { fVar10 = (fVar9 / fVar12) * local_11c; fVar9 = local_134 * (fVar9 / fVar12); } fVar12 = npc->_friction; if (fVar12 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).x = (fVar9 * fVar11) / fVar12 + (npc->_velocity).x; (npc->_velocity).y = (fVar10 * fVar11) / fVar12 + (npc->_velocity).y; } } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } if ((npc->_controllerID != -1) && (bVar3 = input_is_action_triggered(g_manager,9,npc->_controllerID,(Entity *)npc,0), bVar3 != 0) ) { local_e4._tint[0] = 0.0; local_e4._tint[1] = 0.0; local_e4._tint[2] = 0.0; local_e4._tint[3] = 0.0; local_e4._colorize[0] = g_vectorZero.x; local_e4._colorize[1] = g_vectorZero.y; local_e4._colorize[2] = g_vectorZero.x; local_e4._colorize[3] = g_vectorZero.y; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; (**(code **)(*(int *)npc + 0x24))(&local_e4); } uVar4 = npc->_variant; if (npc->_dead == 0) { if ((uVar4 == 5) && (uVar4 = (uint)npc->_flags & 0x4000, uVar4 == 0)) { bVar3 = Game::IsPaused(g_game); uVar4 = (uint)bVar3; if ((bVar3 == 0) && (uVar4 = 0, (int)((npc->_prevUpdateTime + 0.0) / -10.0) != (int)((npc->_updateTime + 0.0) / -10.0))) { uVar4 = Random(); uVar5 = Random(); local_134 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_134 = local_134 + local_134; uVar5 = Random(); local_128 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar9 = cos(local_134); local_130.x = fVar9 * local_128; fVar9 = sin(local_134); local_124.x = local_130.x + local_130.x; local_124.y = fVar9 * local_128 + fVar9 * local_128; tmpEntity = Game::SpawnEx(g_game,1000,0x8d,&npc->_pos,&local_124,(Entity *)npc,0,uVar4,0); iVar6 = *(int *)tmpEntity; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; fVar9 = g_vectorOne.y * 0.7; (tmpEntity->_sprite)._scale.x = g_vectorOne.x * 0.7; (tmpEntity->_sprite)._scale.y = fVar9; uVar4 = (**(code **)(iVar6 + 0xc))(); } } return uVar4; } if (uVar4 == 0) { if ((npc->_flags & 0x1000000) == 0) { Game::BombExplosionEffects (g_game,&npc->_pos,40.0,(BitSet128)ZEXT816(0),&npc->_color,(Entity *)npc,1.0,1,4,0); return extraout_EAX_00; } return 0; } if (uVar4 == 2) { if ((npc->_flags & 0x1000000) != 0) { return 0; } tmpVec = &npc->_pos; Game::BombExplosionEffects (g_game,tmpVec,40.0,(BitSet128)ZEXT816(0),&npc->_color,(Entity *)npc,1.0,1,4,0); params = ProjectileParams::ProjectileParams(&projParams); if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { local_124.x = 10.0; } else { local_124.x = 8.0; } local_124.y = 0.0; Entity_NPC::FireProjectiles(npc,tmpVec,&local_124,6,params); uVar4 = Random(); if (uVar4 % 3 != 0) { return uVar4 / 3; } local_130.x = tmpVec->x; local_130.y = (npc->_pos).y; uVar4 = Room::GetGridCollisionAtPos(g_game->_room,*tmpVec); if (uVar4 == 0) { uVar4 = Random(); tmpEntity = Game::SpawnEx(g_game,0x17,1,tmpVec,&g_vectorZero,(Entity *)npc,0,uVar4,0); uVar4 = (**(code **)(*(int *)tmpEntity + 0xc))(); fVar9 = tmpEntity->_maxHitPoints * 0.5; tmpEntity->_maxHitPoints = fVar9; tmpEntity->_health = fVar9; return uVar4; } return uVar4; } if (uVar4 == 3) { if ((npc->_flags & 0x1000000) != 0) { return 0; } ProjectileParams::ProjectileParams(&projParams); local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; projParams.Scale = 2.0; projParams.FallingAccelModifier = 1.0; projParams.FallingSpeedModifier = 0.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; local_e4._offset[0] = 1.0; local_e4._offset[1] = 0.3; local_e4._offset[2] = 0.0; ::Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&local_e4); uVar4 = 8; if (npc->_subtype != 0) { uVar4 = 0x10; } projParams.BulletFlags._4_4_ = projParams.BulletFlags._4_4_ | uVar4; Entity_NPC::FireProjectiles(npc,&npc->_pos,&g_vectorZero,0,&projParams); return extraout_EAX_01; } if (uVar4 == 4) { Random(); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_124.x = (tmpEntity->_pos).x - (npc->_pos).x; local_124.y = (tmpEntity->_pos).y - (npc->_pos).y; iVar6 = vector_to_direction(&local_124); switch(iVar6) { case 0: local_128 = 3.1415927; break; case 1: local_128 = -1.5707964; break; case 2: break; case 3: local_128 = 1.5707964; break; default: uVar4 = Random(); local_128 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; } ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; projParams.CircleAngle = local_128; ::Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c5c7d4); bVar3 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar3) == 0 || extraout_var < 0) { local_124.x = 9.0; } else { local_124.x = 10.0; } local_124.y = 3.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_124,9,&projParams); return extraout_EAX_02; } if (uVar4 == 5) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar3 != 0) { return (uint)bVar3; } local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; local_e4._tint[0] = 1.0; local_e4._tint[1] = 1.0; local_e4._tint[2] = 1.0; local_e4._tint[3] = 1.0; local_e4._offset[2] = 0.0; local_e4._colorize[0] = 1.0; local_e4._colorize[1] = 1.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.5; Game::BombExplosionEffects (g_game,&npc->_pos,40.0,(BitSet128)ZEXT816(0),(ColorMod *)&local_e4,(Entity *)npc,1.0, 1,4,0); if (npc->_spawnerType != 0x38e) { ProjectileParams::ProjectileParams(&projParams); ::Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34ed8); local_124.x = 10.0; local_124.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_124,9,&projParams); } uVar4 = 0; do { uVar5 = Random(); local_134 = (((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 16.0 - 8.0) + (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 45.0 ) * 0.017453292; uVar5 = Random(); local_128 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 13.0; local_124.x = cos(local_134); local_124.x = local_124.x * local_128; local_124.y = sin(local_134); local_124.y = local_124.y * local_128; uVar5 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x8d,&npc->_pos,&local_124,(Entity *)npc,0,uVar5,0); uVar7 = 0x96; if (npc->_spawnerType != 0x38e) { uVar7 = 300; } *(undefined4 *)(tmpEntity[1]._sprite._filename._buf + 8) = uVar7; *(undefined4 *)(tmpEntity[1]._sprite._filename._buf + 0xc) = uVar7; uVar5 = (**(code **)(*(int *)tmpEntity + 0xc))(); uVar4 = uVar4 + 1; } while (uVar4 < 8); return uVar5; } if (uVar4 != 6) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar3 != 0) { return (uint)bVar3; } ProjectileParams::ProjectileParams(&projParams); bVar3 = Game::IsHardMode(); if (CONCAT31(extraout_var_00,bVar3) == 0 || extraout_var_00 < 0) { local_124.x = 8.0; } else { local_124.x = 10.0; } local_124.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_124,9,params_00); return extraout_EAX_03; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar3 != 0) { return (uint)bVar3; } if (npc->_state == 9) { return 0; } npc->_state = 9; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Explode",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_entityCollisionClass = 0; npc->_dead = 0; Entity::RemoveStatusEffects((Entity *)npc); npc->_isInvicible = 1; local_134 = 0.0; do { Isaac::GetAxisAlignedUnitVectorFromDir(&local_118,(int)local_134); uVar4 = Random(); local_124.x = (npc->_pos).x + 0.0; local_124.y = (npc->_pos).y - 30.0; tmpEntity = Game::SpawnEx(g_game,1000,0xc6,&local_124,&g_vectorZero,(Entity *)0x0,0,uVar4,0); if (tmpEntity->_parent != (EntityPtr)0x0) { local_130.x = (float)&tmpEntity->_parent; std::multiset::erase(&local_130); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); fVar9 = (tmpEntity->_pos).x; effectColor = &(tmpEntity->_sprite)._color; fVar12 = (tmpEntity->_pos).y; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; local_e4._offset[2] = 0.0; fVar10 = (npc->_pos).x; fVar11 = (npc->_pos).y; *(undefined1 *)&tmpEntity[1]._sprite._filename._size = 1; tmpEntity[1]._sprite._filename._capacity = (uint)(fVar9 - fVar10); *(float *)tmpEntity[1]._sprite._animDefaultName._buf = fVar12 - fVar11; if (effectColor != (ColorMod *)&local_e4) { (tmpEntity->_sprite)._color._colorize[0] = 0.0; (tmpEntity->_sprite)._color._colorize[1] = 0.0; (tmpEntity->_sprite)._color._colorize[2] = 0.0; (tmpEntity->_sprite)._color._colorize[3] = 0.0; (tmpEntity->_sprite)._color._offset[0] = 0.0; (tmpEntity->_sprite)._color._offset[1] = 0.0; effectColor->_tint[0] = 0.8; (tmpEntity->_sprite)._color._tint[1] = 0.4; (tmpEntity->_sprite)._color._tint[2] = 0.05; (tmpEntity->_sprite)._color._tint[3] = 1.0; (tmpEntity->_sprite)._color._offset[2] = 0.0; } iVar6 = *(int *)tmpEntity; (tmpEntity->_targetPosition).x = local_118.x; (tmpEntity->_targetPosition).y = local_118.y; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = '\x19'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x19'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar6 + 0xc))(); local_134 = (float)((int)local_134 + 1); } while ((int)local_134 < 4); return (uint)local_134; } //@@ 00510ae0 NpcAI::ENTITY_MAW /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 26 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MAW(Entity_NPC *npc) { Vector *position; byte bVar1; uint uVar2; Entity *pEVar3; int iVar4; Vector *pVVar5; int3 extraout_var; ColorMod *color; Entity_Effect *bloodEffect; byte *animNameCursor; ProjectileParams *params; float *extraout_ECX; byte *idleNameCursor; bool bVar6; float fVar7; float fVar8; float local_124; float local_120; Vector local_11c; Vector local_114; undefined4 effectColor; undefined4 uStack_108; undefined4 uStack_104; undefined4 uStack_100; undefined4 local_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined4 local_ec; undefined4 local_e8; undefined4 local_e4; ProjectileParams projParams; Color bloodColor; uint local_c; void *animData; byte *currentAnim; undefined4 *parentSlot; float speedMultiplier; local_c = __security_cookie ^ (uint)&local_124; if (npc->_state == 0) { npc->_state = 4; if (npc->_variant != 2) { return; } uVar2 = Random(); pEVar3 = Game::SpawnEx(g_game,0x60,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar2,0); iVar4 = __RTDynamicCast(pEVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); parentSlot = (undefined4 *)(iVar4 + 0x3bc); if (*(int *)(iVar4 + 0x3bc) != 0) { local_114.x = (float)parentSlot; std::multiset::erase(&local_114); } *parentSlot = npc; std::multiset::insert(parentSlot); return; } position = &npc->_pos; local_114.x = 10.0; pVVar5 = Room::GetClampedPositionImpl(g_game->_room,&local_11c,position,30.0,0.0,10.0,0.0); position->x = pVVar5->x; (npc->_pos).y = pVVar5->y; uVar2 = Random(); if (uVar2 % 10 == 0) { uVar2 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.4); } pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_11c,0.0); local_124 = pVVar5->x - position->x; local_120 = pVVar5->y - (npc->_pos).y; if (npc->_controllerID != -1) { pVVar5 = Entity_NPC::GetControllerInput(npc,&local_11c,0.0); local_124 = pVVar5->x; local_120 = pVVar5->y; } if (npc->_state == 4) { animData = (npc->_sprite)._animState._animData; if ((animData == (void *)0x0) || (*(char *)((int)animData + 0x34) == '\0')) { ANM2::Play(&npc->_sprite,s_Idle,0); } if (((npc->_variant != 1) && (npc->_projectileCooldown < 1)) && (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,200.0,0,7), bVar1 != 0)) { npc->_state = 8; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_projectileCooldown = 0x1c; Entity_NPC::UpdateControllerMovement(npc,1); if (npc->_controllerID == -1) { (npc->_sprite)._flipX = local_124 < 0.0; } else { (npc->_sprite)._flipX = (npc->_controllerMovement).x <= 0.0 && (npc->_controllerMovement).x != 0.0; } } fVar7 = sqrtf(local_124 * local_124 + local_120 * local_120); if (0.0 < fVar7) { fVar7 = 0.13 / fVar7; if (npc->_variant == 1) { fVar7 = fVar7 * 3.0; } fVar8 = npc->_friction; if (fVar8 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * local_120 * fVar7) / fVar8 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * local_124 * fVar7) / fVar8 + (npc->_velocity).x; } } } else if (npc->_state == 8) { Entity_NPC::UpdateControllerMovement(npc,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { iVar4 = 0xb2; if (npc->_variant != 2) { iVar4 = 0x92; } Entity_NPC::PlaySound(npc,iVar4,1.0,2,0,1.0); pEVar3 = Entity_NPC::GetPlayerTarget(npc); fVar7 = (pEVar3->_pos).x - position->x; fVar8 = (pEVar3->_pos).y - (npc->_pos).y; local_124 = fVar8; local_120 = fVar7; local_11c.x = fVar7; local_11c.y = fVar8; if ((npc->_controllerID != -1) && (bVar1 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar1 != 0)) { fVar7 = *extraout_ECX; fVar8 = extraout_ECX[1]; local_124 = fVar8; local_120 = fVar7; local_11c.x = fVar7; local_11c.y = fVar8; } bVar1 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar1) == 0 || extraout_var < 0) { local_114.x = 7.0; } fVar7 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); if (0.0 < fVar7) { local_11c.x = local_120 * (local_114.x / fVar7); local_11c.y = local_124 * (local_114.x / fVar7); } Color::Color(&bloodColor); local_114.x = 0.0; local_114.y = -24.0; bloodEffect = (Entity_Effect *) spawn_blood_explosion(5,position,&local_114,color,&g_vectorZero); bloodEffect->_renderDepthOffset = 1.0; Entity_Effect::FollowParent(bloodEffect,(Entity *)npc); (bloodEffect->_sprite)._flipX = 1; ProjectileParams::ProjectileParams(&projParams); if (npc->_variant == 2) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; uStack_100 = 0x3f19999a; projParams.Scale = 1.5; local_fc = 0x3f4ccccd; uStack_f8 = 0x3e19999a; uStack_f4 = 0x3f800000; uStack_f0 = 0x3f800000; local_ec = 0x3e851eb8; local_e8 = 0x3d4ccccd; local_e4 = 0x3ecccccd; } else { uStack_100 = 0x3ecccccd; local_ec = 0x3f19999a; local_fc = 0; uStack_f8 = 0; uStack_f4 = 0; uStack_f0 = 0; local_e8 = 0x3dcccccd; local_e4 = 0x3dcccccd; } uStack_104 = 0x3f800000; uStack_108 = 0x3f800000; effectColor = 0x3f800000; (**(code **)(*(int *)bloodEffect + 0x3c))(&effectColor,0xffffffff,0xff,0,1); Entity_NPC::FireProjectiles(npc,position,&local_11c,0,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_005110ee; } npc->_state = 4; currentAnim = (npc->_sprite)._animState._animData; if (currentAnim != (byte *)0x0) { animNameCursor = currentAnim; if (0xf < *(uint *)(currentAnim + 0x14)) { animNameCursor = *(byte **)currentAnim; } idleNameCursor = s_Idle; do { bVar1 = *animNameCursor; bVar6 = bVar1 < *idleNameCursor; if (bVar1 != *idleNameCursor) { LAB_005110b0: uVar2 = -(uint)bVar6 | 1; goto LAB_005110b5; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; bVar6 = bVar1 < idleNameCursor[1]; if (bVar1 != idleNameCursor[1]) goto LAB_005110b0; animNameCursor = animNameCursor + 2; idleNameCursor = idleNameCursor + 2; } while (bVar1 != 0); uVar2 = 0; LAB_005110b5: if ((uVar2 == 0) && ((currentAnim[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_005110ee; } bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_005110ee: if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } npc->_friction = npc->_friction * 0.93; if (((npc->_dead != 0) && (npc->_variant == 1)) && ((npc->_flags & 0x1000000) == 0)) { params = ProjectileParams::ProjectileParams(&projParams); local_11c.x = 8.0; local_11c.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_11c,6,params); Entity_NPC::PlaySound(npc,0x92,1.0,2,0,1.0); } return; } //@@ 005111b0 NpcAI::ENTITY_HOST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: type 27 + 859 Floating Host; sig matched as Entity::TeleportToRandomPosition */ Entity * __fastcall NpcAI::ENTITY_HOST(Entity_NPC *npc) { byte bVar1; float *pfVar2; byte *animName; uint flagsHigh; Vector *pVVar4; Entity *pEVar5; Vector *resultVec; uint uVar6; ColorMod *color; Entity *extraout_EAX; int iVar7; char *pcVar8; Vector *this; uint uVar9; char isShelled; int iVar10; AnimationState *pAVar11; bool bVar12; float fVar13; Entity_Player *pEVar14; float fVar15; float pushY; undefined1 auStack_13c [7]; char isShelledSaved; Entity_Player *local_134; AnimationState *local_130; AnimationState *local_12c; Vector local_128; Vector scratchVec; Vector local_118; uint numProjectiles; int knockbackSource; int local_108; int local_104; int local_100; float local_fc; float local_f8; float local_f4; float local_f0; uint local_ec; Entity_NPC *local_e8; ColorMod effectColor; ProjectileParams projParams; undefined1 local_20; uint local_c; undefined4 flagsHigh; Game *game; Manager *manager; EntityPtr *parentRef; float speedMultiplier; local_c = __security_cookie ^ (uint)auStack_13c; if ((npc->_type == 0x35b) || ((npc->_variant != 1 && (npc->_subtype != 99)))) { isShelled = '\x01'; } else { isShelled = '\0'; } isShelledSaved = isShelled; if (npc->_state == 0) { npc->_state = 3; npc->_stateFrame = 0; bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); pEVar5 = (Entity *)(uint)bVar1; if ((bVar1 != 0) && (pEVar5 = (Entity *)0x0, (npc->_sprite)._animState._animData != (void *)0x0) ) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0); pEVar5 = (npc->_sprite)._animState._animData; if (pEVar5 != (Entity *)0x0) { (npc->_sprite)._animState._isPlaying = 0; } } if (isShelled == '\0') { return pEVar5; } npc->_isInvicible = 1; return pEVar5; } npc->_isInvicible = 0; if ((isShelled != '\0') && (0.0 < npc->_pendingDamage)) { local_12c = (AnimationState *)0x0; if (((npc->_state == 3) || ((((npc->_sprite)._animState._animData == (void *)0x0 || (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Open), bVar1 == 0) ) || (bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Close"), bVar1 != 0)))) && (pfVar2 = (npc->_damageEvents)._begin, pfVar2 != (npc->_damageEvents)._end)) { do { scratchVec.y = pfVar2[3]; if (((uint)pfVar2[2] & 0x8000) == 0) { if (((uint)pfVar2[2] & 0x408080) == 0) { local_12c = (AnimationState *)((float)local_12c + *pfVar2); } *pfVar2 = 0.0; } pfVar2 = pfVar2 + 0xe; } while (pfVar2 != (npc->_damageEvents)._end); } if ((npc->_state == 3) && (0.0 < (float)local_12c)) { fVar13 = (npc->_v2).x - npc->_pendingDamage * 0.05; iVar7 = npc->_stateFrame + (int)(npc->_pendingDamage + 0.5) / 2; if (fVar13 <= 0.0) { fVar13 = 0.0; } iVar10 = 10; if (iVar7 < 10) { iVar10 = iVar7; } npc->_stateFrame = iVar10; (npc->_v2).x = fVar13; if (20.0 < (float)local_12c) { ANM2::Play(&npc->_sprite,(byte *)"Bombed",0); (npc->_v2).x = 0.0; } } } if (npc->_controllerID != -1) { if ((npc->_flags & 0x10) == 0) { LAB_00511463: fVar13 = (npc->_v2).y - (npc->_speedMultiplier * 3.0) / 150.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } (npc->_v2).y = fVar13; if (isShelled == '\0') { (npc->_v2).y = 0.0; fVar13 = 0.0; } } else { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { animName = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pcVar8 = "Bombed"; do { bVar1 = *animName; bVar12 = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00511400: flagsHigh = -(uint)bVar12 | 1; goto LAB_00511405; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar12 = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00511400; animName = animName + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_00511405: if (flagsHigh == 0) goto LAB_00511463; } if (isShelled == '\0') goto LAB_00511463; local_118.x = (float)(Entity_Player *)0x3f800000; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar1 == 0) { pEVar14 = (Entity_Player *)local_118.x; } else { pEVar14 = (Entity_Player *)0x40000000; } fVar13 = ((float)pEVar14 * npc->_speedMultiplier) / 150.0 + (npc->_v2).y; if (1.0 <= fVar13) { fVar13 = 1.0; } (npc->_v2).y = fVar13; } Entity_NPC::UpdateChargeBar(npc,1.0,0.0,fVar13,1); } if (npc->_type == 0x35b) { fVar13 = npc->_friction * 0.9; npc->_friction = fVar13; if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { local_12c = (AnimationState *)0x3f0ccccd; local_134 = (Entity_Player *)0x3f0ccccd; fVar15 = 0.55; if ((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) { local_12c = (AnimationState *)0xbf0ccccd; fVar15 = -0.55; } pfVar2 = &(npc->_velocity).y; pushY = 0.55; if (*pfVar2 <= 0.0 && *pfVar2 != 0.0) { local_134 = (Entity_Player *)0xbf0ccccd; pushY = -0.55; } if (npc->_controllerID != -1) { pVVar4 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); fVar15 = sqrtf((float)local_12c * (float)local_12c + (float)local_134 * (float)local_134); fVar13 = npc->_friction; pushY = (float)local_134 + fVar15 * 0.5 * pVVar4->y; fVar15 = fVar15 * 0.5 * pVVar4->x + (float)local_12c; } if (fVar13 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * pushY) / fVar13 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * fVar15) / fVar13 + (npc->_velocity).x; } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } } else { npc->_friction = npc->_friction * 0.7; } pEVar5 = Entity_NPC::GetPlayerTarget(npc); iVar7 = npc->_variant; pVVar4 = &npc->_pos; numProjectiles = 5; local_134 = (Entity_Player *)((pEVar5->_pos).x - pVVar4->x); if (iVar7 != 1) { numProjectiles = 2; } iVar10 = 0; local_128.x = (float)CONCAT31(local_128.x._1_3_,iVar7 == 3); if (iVar7 != 3) { iVar10 = 3; } ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.05; projParams.VelocityMulti = 1.07; if (npc->_type == 0x35b) { projParams.VelocityMulti = 1.2; local_20 = 1; } iVar7 = npc->_state; if (iVar7 == 3) { if (isShelledSaved != '\0') { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } if (npc->_stateFrame < 1) { ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_controllerID == -1) { bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200); if ((bVar1 != 0) || (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar1 != 0)) { flagsHigh = Random(); if (flagsHigh % 0x32 == 0) { npc->_state = 9; npc->_stateFrame = 0; return (Entity *)(flagsHigh / 0x32); } return (Entity *)(flagsHigh / 0x32); } bVar1 = Entity::IsFrame((Entity *)npc,7,npc->_index); if (bVar1 != 0) { if (npc->_projectileCooldown < 1) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); scratchVec.y = (pEVar5->_pos).y; scratchVec.x = (pEVar5->_pos).x; fVar15 = scratchVec.x - pVVar4->x; fVar13 = scratchVec.y - (npc->_pos).y; if (fVar15 * fVar15 + fVar13 * fVar13 < 57600.0) { if (npc->_championColorIdx != 8) { bVar1 = Room::CheckLine(g_game->_room,pVVar4,&scratchVec,iVar10,999,0, SUB41(local_128.x,0),(Vector *)0x0); pEVar5 = (Entity *)(uint)bVar1; if (bVar1 == 0) goto LAB_00511f68; } npc->_projectileCooldown = 7; npc->_state = 8; npc->_stateFrame = 0; return pEVar5; } } else { npc->_projectileCooldown = npc->_projectileCooldown + -1; } } } else if ((1.0 <= (npc->_v2).y) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { (npc->_controllerMovement).x = g_vectorZero.x; (npc->_controllerMovement).y = g_vectorZero.y; npc->_state = 8; npc->_stateFrame = 0; npc->_projectileCooldown = 0x46; } } LAB_00511f68: game = g_game; pEVar5 = (Entity *)((uint)npc->_flags & 0x4000); if (pEVar5 == (Entity *)0x0) { bVar1 = Game::IsPaused(g_game); pEVar5 = (Entity *)(uint)bVar1; if (((bVar1 == 0) && (iVar7 = game->_frameCount + npc->_index, pEVar5 = (Entity *)(iVar7 / 7), iVar7 % 7 == 0)) && (pEVar5 = (Entity *)npc->_stateFrame, 0 < (int)pEVar5)) { pEVar5 = (Entity *)((int)&pEVar5[-1]._luaBridgeRef + 3); npc->_stateFrame = (int)pEVar5; } } return pEVar5; } if (iVar7 != 8) { if ((Entity *)(iVar7 + -9) != (Entity *)0x0) { return (Entity *)(iVar7 + -9); } if (isShelledSaved != '\0') { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffef; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Open), bVar1 != 0 || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Close"), bVar1 != 0)))))) { Entity_NPC::PlaySound(npc,0xa6,1.0,2,0,1.0); } npc->_stateFrame = npc->_stateFrame + 1; ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); pEVar5 = (Entity *)(uint)((float)local_134 < 0.0); (npc->_sprite)._flipX = (float)local_134 < 0.0; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; return pEVar5; } return pEVar5; } if (isShelledSaved != '\0') { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffef; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } pAVar11 = &(npc->_sprite)._animState; local_12c = pAVar11; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(pAVar11,s_Open); local_130 = pAVar11; if (bVar1 == 0) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(pAVar11,(byte *)"Close"); local_130 = pAVar11; local_12c = pAVar11; if (bVar1 != 0) goto LAB_005117e8; } } else { LAB_005117e8: local_130 = pAVar11; Entity_NPC::PlaySound(npc,0xa6,1.0,2,0,1.0); local_12c = local_130; pAVar11 = local_130; } } if ((npc->_controllerID != -1) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((bVar1 = AnimationState::WasEventTriggered(pAVar11,(byte *)"Shoot"), bVar1 == 0 && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar1 = AnimationState::WasEventTriggered(pAVar11,(byte *)"Close"), bVar1 == 0)))))))) { bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar1 == 0) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); resultVec = Entity_NPC::GetAimTargetPosition(npc,&scratchVec); fVar13 = resultVec->y - (npc->_pos).y; (npc->_controllerMovement).x = resultVec->x - pVVar4->x; } else { (npc->_controllerMovement).x = g_vectorZero.x; fVar13 = g_vectorZero.y; } (npc->_controllerMovement).y = fVar13; } npc->_stateFrame = npc->_stateFrame + 1; ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); if (npc->_controllerID == -1) { pEVar14 = local_134; } else { pEVar14 = (Entity_Player *)(npc->_controllerMovement).x; } (npc->_sprite)._flipX = (float)pEVar14 < 0.0; if (npc->_variant == 3) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00511e87; bVar1 = AnimationState::IsEventTriggered(pAVar11,(byte *)"Close"); manager = g_manager; if (bVar1 != 0) { local_130 = (AnimationState *)0x34; seed_fart_sound_override((int *)&local_130); SoundEffects::Play(&manager->_sfxManager,(int)local_130,1.0,10,0,1.0,0.0); pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_128.x = (pEVar5->_pos).x - pVVar4->x; local_128.y = (pEVar5->_pos).y - (npc->_pos).y; Vector::Normalized(&local_128,&local_118); if (npc->_controllerID == -1) { local_130 = (AnimationState *)local_118.y; local_134 = (Entity_Player *)local_118.x; } else { bVar1 = Vector::operator_eq(&npc->_controllerMovement,&g_vectorZero); if (bVar1 == 0) { resultVec = Vector::Normalized(this,&local_128); } else { resultVec = MusicManager::RandomVector(&scratchVec); } local_134 = (Entity_Player *)resultVec->x; local_130 = (AnimationState *)resultVec->y; } flagsHigh = Random(); scratchVec.x = (float)local_134 * 20.0 + pVVar4->x; scratchVec.y = (float)local_130 * 20.0 + (npc->_pos).y; local_128.x = (float)Game::SpawnEx(g_game,1000,0x48,&scratchVec,&g_vectorZero,(Entity *)npc,2, flagsHigh,0); parentRef = &((Entity *)local_128.x)->_parent; if (((Entity *)local_128.x)->_parent != (EntityPtr)0x0) { local_118.x = (float)parentRef; std::multiset::erase(&local_118); } *parentRef = (EntityPtr)npc; std::multiset::insert(parentRef); fVar13 = atan2f((float)local_130,(float)local_134); *(float *)((((Entity *)((int)local_128.x + 0x40c))->_sprite)._animDefaultName._buf + 8) = fVar13 * 57.295776; Color::Color(0x3f800000); flagsHigh = Random(); local_128.x = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 3.0 + 4.0; flagsHigh = Random(); Game::SpawnParticles(g_game,pVVar4,0x23,(flagsHigh & 3) + 5,local_128.x,&effectColor,100000.0,0); Game::ShakeScreen(g_game,0xc); bVar1 = Entity::IsFriendly((Entity *)npc); if ((bVar1 == 0) && (flagsHigh = 0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { local_118.x = (float)Game::GetPlayer(g_game,flagsHigh); local_134 = (Entity_Player *)((((Entity_Player *)local_118.x)->_pos).y - (npc->_pos).y); local_130 = (AnimationState *)((((Entity_Player *)local_118.x)->_pos).x - (npc->_pos).x); fVar13 = sqrtf((float)local_134 * (float)local_134 + (float)local_130 * (float)local_130); if (fVar13 <= 0.0) { pAVar11 = local_130; pEVar14 = local_134; } else { pAVar11 = (AnimationState *)((float)local_130 * (1.0 / fVar13)); pEVar14 = (Entity_Player *)((float)local_134 * (1.0 / fVar13)); } if (fVar13 < 120.0) { scratchVec.y = (float)pEVar14 * 3.0; local_f8 = (npc->_pos).y; scratchVec.x = (float)pAVar11 * 3.0; local_128.x = *(float *)((int)*(EntityPtr *)local_118.x + 0x54); local_fc = (npc->_pos).x; knockbackSource = npc->_type; local_108 = npc->_variant; local_104 = npc->_spawnerType; local_100 = npc->_spawnerVariant; local_f4 = (npc->_velocity).x; local_f0 = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } local_ec = uVar6 | uVar9 | (uint)((npc->_flags & 0x100) != 0); local_e8 = npc; (*(code *)local_128.x)(&knockbackSource,&scratchVec,0x41100000); } flagsHigh = flagsHigh + 1; } while (flagsHigh < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } pAVar11 = local_12c; } } pVVar4 = &npc->_pos; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(pAVar11,(byte *)"Shoot"); pEVar5 = (Entity *)(uint)bVar1; if (bVar1 != 0) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_130 = (AnimationState *)((pEVar5->_pos).x - pVVar4->x); local_134 = (Entity_Player *)((pEVar5->_pos).y - (npc->_pos).y); if (npc->_controllerID != -1) { local_130 = (AnimationState *)(npc->_controllerMovement).x; local_134 = (Entity_Player *)(npc->_controllerMovement).y; } if (((float)local_130 != g_vectorZero.x) || (pEVar5 = (Entity *)((uint)pEVar5 & 0xff), (float)local_134 != g_vectorZero.y)) { fVar13 = sqrtf((float)local_134 * (float)local_134 + (float)local_130 * (float)local_130); if (fVar13 <= 0.0) { local_128.x = (float)local_130; local_128.y = (float)local_134; } else { local_128.y = (7.0 / fVar13) * (float)local_134; local_128.x = (7.0 / fVar13) * (float)local_130; } Entity_NPC::FireProjectiles(npc,pVVar4,&local_128,numProjectiles,&projParams); Color::Color((Color *)&effectColor); scratchVec.x = 0.0; scratchVec.y = -6.0; pEVar5 = spawn_blood_explosion(1,pVVar4,&scratchVec,color,&g_vectorZero); (pEVar5->_sprite)._scale.x = 0.75; (pEVar5->_sprite)._scale.y = 0.75; pEVar5->_renderDepthOffset = 1.0; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return pEVar5; } } LAB_00511e87: npc->_state = 3; npc->_stateFrame = 0; ANM2::Play(&npc->_sprite,s_Idle,0); return extraout_EAX; } //@@ 00512110 NpcAI::ENTITY_BRAIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 32 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BRAIN(Entity_NPC *npc) { byte bVar1; uint uVar2; Entity_Effect *splat; int iVar3; byte *curAnimChar; Vector *pVVar4; Entity *tmpEntity; int *piVar5; ColorMod *Color; byte *cmpAnimChar; int iVar6; Manager *manager; bool isLess; float fVar7; float fVar8; undefined1 *puVar9; undefined1 auVar10 [12]; undefined1 auVar11 [12]; undefined1 auVar12 [12]; float fVar13; undefined1 auStack_98 [4]; Vector VStack_94; Vector VStack_8c; char isCreepTick; float fStack_80; Vector VStack_7c; Vector VStack_74; Vector VStack_6c; undefined4 local_64 [11]; Color explosionColor; uint local_c; byte *animData; Room *room; void *roomPtr; local_c = __security_cookie ^ (uint)auStack_98; if (npc->_state == 0) { npc->_state = 4; if (npc->_type != 0x12d) { return; } if (&npc->_splatColor != (ColorMod *)local_64) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.19607845; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } npc->_entityGridCollisionClass = 3; return; } if ((((npc->_flags & 0x4000) == 0) && (bVar1 = Game::IsPaused(g_game), bVar1 == 0)) && ((int)((npc->_prevUpdateTime + 0.0) / -3.0) != (int)((npc->_updateTime + 0.0) / -3.0))) { uVar2 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.39 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } roomPtr = g_game->_room; iVar6 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar6) && (iVar6 < *(int *)((int)roomPtr + 0xc))) && ((iVar3 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), -1 < iVar3 && ((iVar3 < *(int *)((int)roomPtr + 0x10) && (uVar2 = iVar3 * *(int *)((int)roomPtr + 0xc) + iVar6, uVar2 < 0x1c0)))))) && (*(int *)((int)roomPtr + uVar2 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)roomPtr + uVar2 * 4 + 0x76c) = 900; } animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0051234e: bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = s_Walk; do { bVar1 = *curAnimChar; isLess = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_00512330: uVar2 = -(uint)isLess | 1; goto LAB_00512335; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_00512330; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00512335: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0051234e; } PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); if (npc->_state == 4) { if (npc->_type == 0x117) { bVar1 = 1; iVar6 = 900; fVar13 = 0.5; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&VStack_94,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar4,fVar13,iVar6,bVar1); (npc->_sprite)._flipX = 0.0 < (npc->_velocity).x; } else { if (npc->_type == 0x12d) { fVar13 = npc->_speedMultiplier; auVar10 = ZEXT812(0x3f4ccccd); if (fVar13 != 1.0) { fVar8 = auVar10._0_4_; auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar8 / ((fVar13 + fVar8) - fVar13 * fVar8); } fVar13 = npc->_updateTime; fVar8 = npc->_prevUpdateTime; (npc->_velocity).y = auVar10._0_4_ * (npc->_velocity).y; (npc->_velocity).x = auVar10._0_4_ * (npc->_velocity).x; piVar5 = &npc->_stateFrame; *piVar5 = *piVar5 + ((int)fVar8 - (int)fVar13); if ((*piVar5 < 0) || (npc->_collidesWithGrid != 0)) { uVar2 = Random(); npc->_stateFrame = uVar2 % 0x5a; uVar2 = Random(); pVVar4 = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_94,uVar2 & 3); VStack_8c.x = cos(0.7853982); fVar7 = sin(0.7853982); fVar13 = pVVar4->x; fVar8 = pVVar4->y; (npc->_targetPosition).x = VStack_8c.x * pVVar4->x - fVar7 * pVVar4->y; (npc->_targetPosition).y = fVar7 * fVar13 + VStack_8c.x * fVar8; } if (npc->_controllerID != -1) { pVVar4 = Entity_NPC::GetControllerInput(npc,&VStack_94,0.0); VStack_8c.x = pVVar4->x; (npc->_targetPosition).x = VStack_8c.x; VStack_74.x = pVVar4->y; (npc->_targetPosition).y = VStack_74.x; bVar1 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero); if (bVar1 != 0) { fStack_80 = cos(-0.7853982); fVar13 = sin(-0.7853982); VStack_94.x = fStack_80 * VStack_8c.x - VStack_74.x * fVar13; VStack_94.y = VStack_8c.x * fVar13 + VStack_74.x * fStack_80; pVVar4 = Vector::ToCardinal(&VStack_6c,&VStack_94); fStack_80 = cos(0.7853982); VStack_94.x = sin(0.7853982); VStack_7c.x = pVVar4->y; fVar8 = sqrtf(VStack_74.x * VStack_74.x + VStack_8c.x * VStack_8c.x); fVar13 = pVVar4->x; (npc->_targetPosition).x = (fVar13 * fStack_80 - VStack_7c.x * VStack_94.x) * fVar8; (npc->_targetPosition).y = (VStack_7c.x * fStack_80 + fVar13 * VStack_94.x) * fVar8; } } fVar13 = (npc->_targetPosition).y; fVar8 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_targetPosition).x * 0.5 * fVar8 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 0.5 * fVar8 + (npc->_velocity).y; iVar6 = Entity::GetIntervalTicks((Entity *)npc,7.0,(float)((uint)npc->_index % 7) + 0.0); if (((iVar6 == 0) || (npc->_controllerID != -1)) || (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 != 0)) goto LAB_00512e92; room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_7c.x = (tmpEntity->_pos).x; VStack_8c.x = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_94.x = (tmpEntity->_velocity).x; fStack_80 = (tmpEntity->_velocity).y; uVar2 = Random(); fVar13 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0; VStack_94.x = VStack_94.x * fVar13 + VStack_7c.x; VStack_94.y = fStack_80 * fVar13 + VStack_8c.x; Room::GetClampedPositionImpl(room,&VStack_7c,&VStack_94,20.0,20.0,20.0,20.0); VStack_8c.x = (npc->_pos).x - VStack_7c.x; VStack_8c.y = (npc->_pos).y - VStack_7c.y; fStack_80 = VStack_8c.x; VStack_7c.x = VStack_8c.y; VStack_94.x = cos(0.7853982); fVar13 = sin(0.7853982); if (((20.0 <= ABS(VStack_94.x * fStack_80 - VStack_7c.x * fVar13)) && (20.0 <= ABS(VStack_94.x * VStack_7c.x + fStack_80 * fVar13))) || (fVar13 = sqrtf(VStack_7c.x * VStack_7c.x + fStack_80 * fStack_80), 200.0 <= fVar13)) goto LAB_00512e92; pVVar4 = Vector::Resized(&VStack_8c,&VStack_6c,-1.0); manager = g_manager; VStack_8c.x = 1.5148e-42; (npc->_targetPosition).x = pVVar4->x; (npc->_targetPosition).y = pVVar4->y; npc->_state = 8; seed_fart_sound_override((int *)&VStack_8c); iVar6 = 2; } else { VStack_94.y = (npc->_pathfinder)._movementTarget.y; VStack_94.x = (npc->_pathfinder)._movementTarget.x; PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.75,0); fVar13 = npc->_speedMultiplier; auVar12 = ZEXT812(0x3f59999a); if (fVar13 != 1.0) { fVar8 = auVar12._0_4_; auVar12._4_8_ = auVar12._4_8_; auVar12._0_4_ = fVar8 / ((fVar13 + fVar8) - fVar13 * fVar8); } auVar11 = ZEXT812(0x3f4ccccd); (npc->_velocity).x = auVar12._0_4_ * (npc->_velocity).x; if (fVar13 != 1.0) { fVar8 = auVar11._0_4_; auVar11._4_8_ = auVar11._4_8_; auVar11._0_4_ = fVar8 / ((fVar13 + fVar8) - fVar13 * fVar8); } iVar6 = npc->_type; (npc->_velocity).y = auVar11._0_4_ * (npc->_velocity).y; if ((iVar6 == 0x20) && (bVar1 = Vector::operator_ne(&VStack_94,&(npc->_pathfinder)._movementTarget), manager = g_manager, bVar1 != 0)) { VStack_8c.x = 1.5134e-42; seed_fart_sound_override((int *)&VStack_8c); SoundEffects::Play(&manager->_sfxManager,(int)VStack_8c.x,1.0,0x1e,0,1.0,0.0); } bVar1 = Entity::IsFrame((Entity *)npc,7,npc->_index); if (((bVar1 == 0) || (npc->_controllerID != -1)) || (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 != 0)) goto LAB_00512e92; room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_7c.x = (tmpEntity->_pos).x; VStack_8c.x = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_94.x = (tmpEntity->_velocity).x; fStack_80 = (tmpEntity->_velocity).y; uVar2 = Random(); fVar13 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0; VStack_94.x = VStack_94.x * fVar13 + VStack_7c.x; VStack_94.y = fStack_80 * fVar13 + VStack_8c.x; Room::GetClampedPositionImpl(room,&VStack_8c,&VStack_94,20.0,20.0,20.0,20.0); room = g_game->_room; iVar6 = (npc->_pathfinder)._gridIndex; iVar3 = room->_gridWidth; VStack_74.x = (float)(iVar6 % iVar3) * 40.0 + 40.0; VStack_74.y = (float)(iVar6 / iVar3) * 40.0 + 120.0; fStack_80 = VStack_74.x - VStack_8c.x; VStack_94.x = VStack_74.y - VStack_8c.y; VStack_7c.x = ABS(fStack_80); if ((((20.0 <= VStack_7c.x) && (20.0 <= ABS(VStack_94.x))) || (fVar13 = sqrtf(VStack_94.x * VStack_94.x + fStack_80 * fStack_80), 200.0 <= fVar13)) || (bVar1 = Room::CheckLine(room,&VStack_74,&VStack_8c,0,0,0,0,(Vector *)0x0), bVar1 == 0)) goto LAB_00512e92; if (VStack_7c.x <= ABS(VStack_94.x)) { (npc->_targetPosition).x = 0.0; if (0.0 <= VStack_94.x) { puVar9 = &DAT_bf800000; } else { puVar9 = (undefined1 *)0x3f800000; } (npc->_targetPosition).y = (float)puVar9; } else { (npc->_targetPosition).y = 0.0; if (0.0 <= fStack_80) { (npc->_targetPosition).x = (float)&DAT_bf800000; } else { (npc->_targetPosition).x = 1.0; } } npc->_state = 8; manager = g_manager; if (npc->_type != 0x20) goto LAB_00512e92; VStack_8c.x = 1.5134e-42; seed_fart_sound_override((int *)&VStack_8c); iVar6 = 0x1e; } SoundEffects::Play(&manager->_sfxManager,(int)VStack_8c.x,1.0,iVar6,0,1.0,0.0); } } else if ((((npc->_collidesWithGrid == 0) && ((npc->_flags & 0x1000b00) == 0)) && (npc->_forcedTarget == (EntityPtr)0x0)) && (npc->_controllerID == -1)) { fVar13 = npc->_friction * 0.8; npc->_friction = fVar13; if (fVar13 != 0.0) { fVar8 = npc->_speedMultiplier; (npc->_velocity).x = (fVar8 * (npc->_targetPosition).x) / fVar13 + (npc->_velocity).x; (npc->_velocity).y = (fVar8 * (npc->_targetPosition).y) / fVar13 + (npc->_velocity).y; } if (npc->_type != 0x12d) { iVar6 = (npc->_pathfinder)._gridIndex; iVar3 = *(int *)((int)g_game->_room + 0xc); if (ABS((npc->_velocity).x) <= ABS((npc->_velocity).y)) { (npc->_pos).x = ((float)(iVar6 % iVar3) * 40.0 + 40.0) * 0.1 + (npc->_pos).x * 0.9; } else { (npc->_pos).y = (npc->_pos).y * 0.9 + ((float)(iVar6 / iVar3) * 40.0 + 120.0) * 0.1; } } } else { (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } LAB_00512e92: uVar2 = npc->_index; iVar6 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar6 < 5) { uVar2 = uVar2 % 0xc; iVar3 = Entity::GetIntervalTicks((Entity *)npc,12.0,(float)uVar2 + 0.0); fVar13 = 12.0; iVar6 = uVar2 + 6; } else { uVar2 = uVar2 % 0x18; iVar3 = Entity::GetIntervalTicks((Entity *)npc,24.0,(float)uVar2 + 0.0); fVar13 = 24.0; iVar6 = uVar2 + 0xc; } isCreepTick = 0 < iVar3; iVar6 = Entity::GetIntervalTicks((Entity *)npc,fVar13,(float)iVar6 + 0.0); if (((npc->_flags & 0x1000000) == 0) && ((isCreepTick != '\0' || ((fVar13 = (npc->_velocity).y, fVar8 = (npc->_velocity).x, 9.0 < fVar8 * fVar8 + fVar13 * fVar13 && (0 < iVar6)))))) { uVar2 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,(npc->_type == 0x12d) + 0x16,&npc->_pos,&g_vectorZero, (Entity *)npc,0,uVar2,0); piVar5 = (int *)__RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); piVar5[0x39] = 0x3f9d70a4; piVar5[0x3a] = 0x3f9d70a4; piVar5[0x11d] = 0; (**(code **)(*piVar5 + 0xc))(); } if (((npc->_dead != 0) && (npc->_type == 0x12d)) && ((npc->_flags & 0x1000000) == 0)) { ::Color::Color(&explosionColor); Game::BombExplosionEffects (g_game,&npc->_pos,40.0,g_tearFlagPoison,Color,(Entity *)npc,1.0,1,4,0); } return; } //@@ 00513080 NpcAI::ENTITY_HORF /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 12 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HORF(Entity_NPC *npc) { byte bVar1; Entity *pEVar2; undefined4 extraout_EAX; uint uVar3; byte *curAnimChar; char *cmpAnimChar; bool bVar4; float fVar5; undefined1 auStack_124 [2]; undefined1 auStack_122 [2]; float local_120; float local_11c; Vector local_118; float local_110; undefined4 championEffectColor; undefined4 uStack_108; undefined4 uStack_104; undefined4 uStack_100; undefined4 uStack_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 uStack_e4; ProjectileParams projParams; Color effectColor; uint local_c; byte *animData; int effectVtable; Manager *manager; float npcX; EntityPtr *parentRef; local_c = __security_cookie ^ (uint)auStack_124; npc->_friction = npc->_friction * 0.7; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar5 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_118,0.1); if ((local_118.x == g_vectorZero.x) && (local_118.y == g_vectorZero.y)) goto LAB_0051314c; (npc->_controllerMovement).x = local_118.x; fVar5 = local_118.y; } (npc->_controllerMovement).y = fVar5; } LAB_0051314c: if ((npc->_projectileCooldown < 1) && (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,200.0,0,7), bVar1 != 0)) { if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { bVar1 = 1; } else { bVar1 = 0; } npc->_projectileCooldown = (-(uint)bVar1 & 0xfffffff2) + 0x1c; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar5 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_118,0.1); (npc->_controllerMovement).x = local_118.x; fVar5 = local_118.y; } (npc->_controllerMovement).y = fVar5; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { pEVar2 = Entity_NPC::GetPlayerTarget(npc); local_110 = (pEVar2->_pos).x - (npc->_pos).x; local_118.y = (pEVar2->_pos).y - (npc->_pos).y; if ((npc->_controllerID != -1) && ((fVar5 = (npc->_controllerMovement).x, fVar5 != g_vectorZero.x || ((npc->_controllerMovement).y != g_vectorZero.y)))) { local_118.y = (npc->_controllerMovement).y; local_110 = fVar5; } if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { local_11c = 10.0; } else { local_11c = 7.0; } local_120 = local_118.y; local_118.x = local_110; fVar5 = sqrtf(local_118.y * local_118.y + local_110 * local_110); if (0.0 < fVar5) { local_118.y = (local_11c / fVar5) * local_120; local_118.x = (local_11c / fVar5) * local_110; } Color::Color(&effectColor); uVar3 = Random(); pEVar2 = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,5,uVar3); (**(code **)(*(int *)pEVar2 + 0x3c))(extraout_EAX,0xffffffff,0xff,0); parentRef = &pEVar2->_parent; (pEVar2->_sprite)._offset.x = 0.0; (pEVar2->_sprite)._offset.y = -10.0; pEVar2->_renderDepthOffset = 1.0; if (*parentRef != (EntityPtr)0x0) { std::multiset::erase(auStack_124 + -0x10); } *parentRef = (EntityPtr)npc; std::multiset::insert(parentRef); fVar5 = (pEVar2->_pos).x; npcX = (npc->_pos).x; *(float *)pEVar2[1]._sprite._animDefaultName._buf = (pEVar2->_pos).y - (npc->_pos).y; pEVar2[1]._sprite._filename._capacity = (uint)(fVar5 - npcX); (pEVar2->_sprite)._flipX = 1; effectVtable = *(int *)pEVar2; local_120 = 1.0; local_11c = 1.0; local_118.x = 1.0; local_118.y = 0.4; *(undefined1 *)&pEVar2[1]._sprite._filename._size = 1; uStack_100 = 0x3f19999a; uStack_fc = 0x3dcccccd; local_110 = 0.0; championEffectColor = 0; uStack_108 = 0; uStack_104 = 0; uStack_f8 = 0x3dcccccd; (**(code **)(effectVtable + 0x3c))(&local_120,0xffffffff,0xff,0,1); ProjectileParams::ProjectileParams(&projParams); if (npc->_type == 0xf8) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; championEffectColor = 0x3f800000; uStack_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_100 = 0x3f19999a; uStack_fc = 0x3f4ccccd; uStack_f8 = 0x3e19999a; uStack_f4 = 0x3f800000; uStack_f0 = 0x3f800000; uStack_ec = 0x3e851eb8; uStack_e8 = 0x3d4ccccd; uStack_e4 = 0x3ecccccd; (**(code **)(*(int *)pEVar2 + 0x3c))(&championEffectColor,0xffffffff,0xff,0); } Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_118,0,&projParams); manager = g_manager; if (npc->_championColorIdx == 0x12) { local_11c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_11c = 0.5; } local_120 = 2.0459e-43; seed_fart_sound_override((int *)&local_120); SoundEffects::Play(&manager->_sfxManager,(int)local_120,1.0,2,0,local_11c,0.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return; } } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = "Shake"; do { bVar1 = *curAnimChar; bVar4 = bVar1 < (byte)*cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_00513580: uVar3 = -(uint)bVar4 | 1; goto LAB_00513585; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar4 = bVar1 < (byte)cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_00513580; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00513585: if (uVar3 == 0) { if (animData[0x34] == 0) { return; } if ((npc->_sprite)._animState._isPlaying != 0) { return; } } } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shake",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } return; } //@@ 005135d0 NpcAI::ENTITY_KNIGHT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 41 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_KNIGHT(Entity_NPC *npc) { byte bVar1; char isAnimDifferent; uint uVar2; undefined4 *damageEvent; int iVar3; Vector *pVVar4; ColorMod *color; Entity *pEVar5; Vector *targetDir; int *piVar6; void *pvVar7; undefined1 *puVar8; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int extraout_ECX_05; int iVar9; EntityPtr pon; byte *anim; bool isChargeOver; float fVar10; float fVar11; float fVar12; EntityPtr *pEVar13; undefined4 uVar14; TypeDescriptor *pTVar15; TypeDescriptor *pTVar16; undefined4 uVar17; EntityPtr *local_94; Vector local_90; EntityPtr *local_88; char isResetCooldown; Vector local_80; undefined1 *local_78; Vector local_74; char isBlackKnight; Color tmpColor; undefined1 local_3c [16]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; EntityPtr candidatePon; uint *flagsHigh; Manager *manager; void *pathEntity; float *posOffsetY; Room *room; pvVar7 = ExceptionList; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af434d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; local_94 = (EntityPtr *)0x0; if ((npc->_type == 0x29) && (npc->_variant == 4)) { damageEvent = (npc->_damageEvents)._begin; isBlackKnight = '\x01'; if (damageEvent != (npc->_damageEvents)._end) { do { if (((damageEvent[4] == 1000) && (damageEvent[5] == 0x93)) && (damageEvent[6] != 1)) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } fVar11 = (npc->_posOffset).y; if ((fVar11 < 0.0) || ((npc->_v2).x <= 0.0 && (npc->_v2).x != 0.0)) { fVar10 = (npc->_v2).x; fVar11 = fVar10 + fVar11; (npc->_v2).x = fVar10 + 1.1; (npc->_posOffset).y = fVar11; if (0.0 < fVar11) { (npc->_posOffset).y = 0.0; (npc->_v2).x = 0.0; } } } else { isBlackKnight = '\0'; } iVar3 = npc->_type; local_24 = uVar2; if (npc->_state == 0) { npc->_state = 4; if (iVar3 == 0xfe) { npc->_entityGridCollisionClass = 3; ExceptionList = pvVar7; return; } if (iVar3 != 0x29) { ExceptionList = pvVar7; return; } if (npc->_variant != 3) { ExceptionList = pvVar7; return; } puStack_20 = local_3c + 0x38; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_3c + 8),0x348,-1, -1,0,0); local_14 = 0; pon = (EntityPtr)0x0; fVar11 = 0.0; if (local_2c.y != 0.0) { do { candidatePon = *(EntityPtr *)(local_3c._12_4_ + (int)fVar11 * 4); if (*(int *)((int)candidatePon + 0x3bc) == 0) { fVar12 = (npc->_pos).y - *(float *)((int)candidatePon + 0x340); fVar10 = (npc->_pos).x - *(float *)((int)candidatePon + 0x33c); pEVar13 = (EntityPtr *)(fVar12 * fVar12 + fVar10 * fVar10); if (pon != (EntityPtr)0x0) { if (local_80.y <= (float)pEVar13) goto LAB_00513799; } pon = candidatePon; local_80.y = (float)pEVar13; } LAB_00513799: fVar11 = (float)((int)fVar11 + 1); } while ((uint)fVar11 < (uint)local_2c.y); if (pon != (EntityPtr)0x0) { if (npc->_child != (EntityPtr)0x0) { local_94 = &npc->_child; std::multiset::erase(&local_94); } npc->_child = pon; std::multiset::insert(&npc->_child); pEVar13 = (EntityPtr *)((int)pon + 0x3bc); if (*(int *)((int)pon + 0x3bc) != 0) { local_94 = pEVar13; std::multiset::erase(&local_94); } *pEVar13 = (EntityPtr)npc; std::multiset::insert(pEVar13); } } *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; npc->_isInvicible = 1; if (local_3c[8] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_3c._12_4_,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } puVar8 = local_3c + 0x38; if ((iVar3 == 0x29) && (puVar8 = local_3c + 0x38, npc->_variant == 3)) { *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; npc->_isInvicible = 1; puVar8 = local_3c + 0x38; if (((npc->_targetPosition).x == g_vectorZero.x) && (puVar8 = local_3c + 0x38, (npc->_targetPosition).y == g_vectorZero.y)) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,1); puVar8 = puStack_20; } puStack_20 = puVar8; if ((npc->_child == (EntityPtr)0x0) || (puVar8 = puStack_20, *(char *)((int)npc->_child + 0x173) != '\0')) { tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[1] = g_vectorZero.x; tmpColor._colorize[2] = g_vectorZero.y; tmpColor._colorize[3] = g_vectorZero.x; tmpColor._offset[0] = g_vectorZero.y; (**(code **)(*(int *)npc + 0x24))(tmpColor._tint + 1,uVar2); puVar8 = puStack_20; } } puStack_20 = puVar8; pvVar7 = g_game->_room; iVar9 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if ((((-1 < iVar9) && (iVar9 < *(int *)((int)pvVar7 + 0xc))) && (-1 < iVar3)) && ((iVar3 < *(int *)((int)pvVar7 + 0x10) && (uVar2 = iVar3 * *(int *)((int)pvVar7 + 0xc) + iVar9, uVar2 < 0x1c0)))) { local_78 = (undefined1 *)0x3e8; piVar6 = (int *)((int)pvVar7 + (uVar2 + 0x1db) * 4); iVar3 = *piVar6; iVar9 = iVar3 % 1000; if (iVar9 < 900) { *piVar6 = (iVar3 - iVar9) + 900; pvVar7 = g_game->_room; } } pathEntity = (npc->_pathfinder)._entity; fVar11 = (*(float *)((int)pathEntity + 0x33c) - 40.0) / 40.0 + 0.5; fVar10 = (*(float *)((int)pathEntity + 0x340) - 120.0) / 40.0 + 0.5; local_88 = (EntityPtr *)(int)fVar11; if ((((int)fVar11 < 0) || (*(int *)((int)pvVar7 + 0xc) <= (int)local_88)) || (((int)fVar10 < 0 || (*(int *)((int)pvVar7 + 0x10) <= (int)fVar10)))) { iVar3 = -1; } else { iVar3 = *(int *)((int)pvVar7 + 0xc) * (int)fVar10 + (int)fVar11; } pVVar4 = &npc->_pos; local_74.y = 0.8; fVar11 = 0.75; (npc->_pathfinder)._gridIndex = iVar3; iVar3 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; if (npc->_type == 0x29) { iVar9 = npc->_variant; if (iVar9 == 1) { fVar11 = 1.25; } else if (iVar9 == 2) { fVar11 = 0.6; } else if (iVar9 == 3) { local_74.y = 0.88; } else if (iVar9 == 4) { fVar11 = 0.66; } } if ((npc->_state == 4) || (npc->_state == 7)) { puVar8 = (undefined1 *)0x3f800000; local_78 = (undefined1 *)0x3f800000; if (npc->_type == 0xfe) { iVar9 = npc->_stateFrame - iVar3; local_90.y = 1.0; npc->_stateFrame = iVar9; if (npc->_controllerID == -1) { pEVar5 = (Entity *)0x3f800000; if ((iVar3 != 0) && (iVar9 < 1)) { uVar2 = Random(); npc->_stateFrame = uVar2 % 0xf + 0x1e; uVar2 = Random(); npc->_i1 = uVar2 & 3; iVar3 = extraout_ECX_00; pEVar5 = (Entity *)local_90.y; } } else { Entity_NPC::GetControllerInput(npc,&local_80,0.0); uVar2 = Random(); npc->_stateFrame = uVar2 % 0xf + 0x1e; if (ABS(local_80.x) <= ABS(local_80.y)) { iVar3 = (uint)(0.0 <= local_80.y) * 2 + 1; } else { iVar3 = 2; if (local_80.x < 0.0) { iVar3 = 0; } } npc->_i1 = iVar3; pEVar5 = (Entity *)sqrtf(local_80.x * local_80.x + local_80.y * local_80.y); iVar3 = extraout_ECX; } switch(npc->_i1) { case 0: fVar10 = (npc->_velocity).x - (float)pEVar5 * 0.75 * npc->_speedMultiplier; (npc->_velocity).y = (float)pEVar5 * 0.0 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fVar10; if (npc->_collidesWithGrid != 0) { npc->_i1 = 2; fVar10 = pVVar4->x - fVar10; LAB_005143d7: pVVar4->x = fVar10; (npc->_pos).y = (npc->_pos).y - (npc->_velocity).y; } break; case 1: fVar11 = npc->_speedMultiplier; fVar10 = (float)pEVar5 * 0.0 * fVar11 + (npc->_velocity).x; (npc->_velocity).x = fVar10; (npc->_velocity).y = (npc->_velocity).y - (float)pEVar5 * 0.75 * fVar11; if (npc->_collidesWithGrid != 0) { npc->_i1 = 3; LAB_005143cf: fVar10 = pVVar4->x - fVar10; goto LAB_005143d7; } break; case 2: fVar10 = (float)pEVar5 * 0.75 * npc->_speedMultiplier + (npc->_velocity).x; (npc->_velocity).y = (float)pEVar5 * 0.0 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fVar10; if (npc->_collidesWithGrid != 0) { npc->_i1 = 0; goto LAB_005143cf; } break; case 3: fVar11 = npc->_speedMultiplier; fVar10 = (float)pEVar5 * 0.0 * fVar11 + (npc->_velocity).x; (npc->_velocity).x = fVar10; (npc->_velocity).y = (float)pEVar5 * 0.75 * fVar11 + (npc->_velocity).y; if (npc->_collidesWithGrid != 0) { npc->_i1 = 1; goto LAB_005143cf; } } switchD_00514372_default: puVar8 = (undefined1 *)local_74.y; } else { if (isBlackKnight == '\0') { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,fVar11,0); iVar3 = extraout_ECX_04; goto switchD_00514372_default; } if ((0.0 < (npc->_v2).x || (npc->_v2).x == 0.0) && (posOffsetY = &(npc->_posOffset).y, 0.0 < *posOffsetY || *posOffsetY == 0.0)) { if (-1 < npc->_projectileDelay) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,fVar11,0); iVar3 = extraout_ECX_01; if (isBlackKnight != '\0') { if (npc->_state == 7) { iVar9 = Entity::GetIntervalTicks((Entity *)npc,20.0,0.0); iVar3 = extraout_ECX_02; if (iVar9 != 0) { uVar2 = Random(); iVar3 = 10; if (uVar2 % 10 == 0) { npc->_projectileDelay = 0; npc->_state = 7; } } } else { iVar3 = npc->_projectileDelay + 1; npc->_projectileDelay = iVar3; if (((npc->_flags & 0x1000a00) != 0) || ((0x5a < iVar3 && (uVar2 = Random(), uVar2 % 0x14 == 0)))) { npc->_state = 4; } pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_80.x = (pEVar5->_pos).x; local_80.y = (pEVar5->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_80,0.66,0,1); pVVar4 = Vector::ToCardinal(&local_2c,&npc->_velocity); fVar11 = (npc->_velocity).y; fVar10 = (npc->_velocity).x; fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); fVar11 = pVVar4->x; (npc->_velocity).y = fVar10 * pVVar4->y; (npc->_velocity).x = fVar10 * fVar11; iVar3 = extraout_ECX_03; } } goto switchD_00514372_default; } puVar8 = (undefined1 *)0x3f6147ae; npc->_projectileDelay = npc->_projectileDelay + 1; } } npc->_friction = (float)puVar8 * npc->_friction; if (npc->_type == 0x29) { uVar2 = Random(); iVar3 = 100; if (uVar2 % 100 == 0) { iVar9 = npc->_variant; if ((iVar9 == 0) || (iVar9 == 4)) { local_74.y = 1.5162e-42; } else { if ((iVar9 != 1) && (iVar9 != 2)) goto LAB_00514744; local_74.y = 1.51761e-42; } LAB_0051470a: manager = g_manager; seed_fart_sound_override((int *)&local_74.y); SoundEffects::Play(&manager->_sfxManager,(int)local_74.y,1.0,0x3c,0,1.0,0.0); iVar3 = extraout_ECX_05; } } else if (npc->_type == 0xfe) { uVar2 = Random(); iVar3 = 100; if (uVar2 % 100 == 0) { local_74.y = 1.51901e-42; goto LAB_0051470a; } } LAB_00514744: if ((isBlackKnight != '\0') && (((npc->_projectileDelay < 0 || ((npc->_posOffset).y < 0.0)) || ((npc->_v2).x < 0.0)))) goto LAB_00514879; if (npc->_controllerID != -1) { bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,iVar3); if ((bVar1 != 0) && ((Entity_NPC::GetControllerInput(npc,&local_80,0.1), local_80.x != g_vectorZero.x || (local_80.y != g_vectorZero.y)))) { pVVar4 = Vector::ToCardinal(&local_2c,&local_80); (npc->_targetPosition).x = pVVar4->x; (npc->_targetPosition).y = pVVar4->y; npc->_state = 8; } if (((npc->_variant == 1) || (npc->_type == 0x11b)) && (npc->_state == 8)) { (npc->_targetPosition).x = (npc->_targetPosition).x * 1.65; (npc->_targetPosition).y = (npc->_targetPosition).y * 1.65; } (npc->_targetPosition).x = (npc->_targetPosition).x * 1.35; (npc->_targetPosition).y = (npc->_targetPosition).y * 1.35; goto LAB_00514879; } bVar1 = Entity::IsFrame((Entity *)npc,3,npc->_index); if ((bVar1 == 0) || ((npc->_flags & 0x1000a00) != 0)) goto LAB_00514879; room = g_game->_room; pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_88 = (EntityPtr *)(pEVar5->_pos).x; local_80.y = (pEVar5->_pos).y; pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_90.y = (pEVar5->_velocity).x; local_74.y = (pEVar5->_velocity).y; uVar2 = Random(); fVar11 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0; local_90.x = local_90.y * fVar11 + (float)local_88; local_90.y = local_74.y * fVar11 + local_80.y; Room::GetClampedPositionImpl(room,&local_74,&local_90,20.0,20.0,20.0,20.0); room = g_game->_room; iVar3 = (npc->_pathfinder)._gridIndex; iVar9 = room->_gridWidth; local_2c.x = (float)(iVar3 % iVar9) * 40.0 + 40.0; local_2c.y = (float)(iVar3 / iVar9) * 40.0 + 120.0; local_88 = (EntityPtr *)(local_2c.x - local_74.x); local_80.y = local_2c.y - local_74.y; local_90.y = ABS((float)local_88); if ((((local_90.y < 20.0) || (ABS(local_80.y) < 20.0)) && (fVar11 = sqrtf(local_80.y * local_80.y + (float)local_88 * (float)local_88), fVar11 < 200.0 )) && ((bVar1 = Room::CheckLine(room,&local_2c,&local_74,0,0,0,0,(Vector *)0x0), bVar1 != 0 || (npc->_type == 0xfe)))) { if (local_90.y <= ABS(local_80.y)) { (npc->_targetPosition).x = 0.0; if (0.0 <= local_80.y) { local_74.y = (float)&DAT_bf800000; } else { local_74.y = 1.0; } (npc->_targetPosition).y = local_74.y; local_78 = (undefined1 *)0x0; } else { (npc->_targetPosition).y = 0.0; if (0.0 <= (float)local_88) { local_78 = &DAT_bf800000; puVar8 = local_78; } else { puVar8 = (undefined1 *)0x3f800000; } (npc->_targetPosition).x = (float)puVar8; local_74.y = 0.0; } bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar1 != 0) { (npc->_targetPosition).x = -(float)local_78; (npc->_targetPosition).y = -local_74.y; } npc->_state = 8; npc->_projectileDelay = 0; if ((npc->_type == 0x29) && (npc->_variant == 4)) { (npc->_targetPosition).x = (npc->_targetPosition).x * 0.7; (npc->_targetPosition).y = (npc->_targetPosition).y * 0.7; } } if ((npc->_variant != 1) && (npc->_type != 0x11b)) goto LAB_00514879; if (npc->_state == 8) { (npc->_targetPosition).x = (npc->_targetPosition).x * 1.65; (npc->_targetPosition).y = (npc->_targetPosition).y * 1.65; goto LAB_00514879; } LAB_00514c11: fVar11 = (npc->_velocity).x; fVar10 = (npc->_velocity).y; if (ABS(fVar11) <= ABS(fVar10)) goto LAB_005148ab; LAB_00514c36: puVar8 = (undefined1 *)0x2; anim = &DAT_00b60d94; if (fVar11 < 0.0) { puVar8 = (undefined1 *)0x0; } local_78 = puVar8; } else { if (isBlackKnight != '\0') { if (npc->_collidesWithGrid != 0) { fVar11 = (npc->_gridCollisionVelocity).y; fVar10 = (npc->_gridCollisionVelocity).x; fVar11 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (8.0 < fVar11) { pVVar4 = Vector::Normalized(&npc->_gridCollisionVelocity,&local_2c); if (0.9 < (npc->_gridCollisionNormal).y * pVVar4->y + (npc->_gridCollisionNormal).x * pVVar4->x) { Game::ShakeScreen(g_game,4); manager = g_manager; local_78 = (undefined1 *)0x30; seed_fart_sound_override((int *)&local_78); SoundEffects::Play(&manager->_sfxManager,(int)local_78,0.6,2,0,1.0,0.0); manager = g_manager; local_78 = (undefined1 *)0x1e3; seed_fart_sound_override((int *)&local_78); SoundEffects::Play(&manager->_sfxManager,(int)local_78,0.7,0x2d,0,1.0,0.0); room = g_game->_room; iVar9 = Room::GetGridIndex(room,&npc->_pos); iVar3 = room->_gridWidth; pVVar4 = &g_vectorZero; local_80.x = (float)(iVar9 % iVar3) * 40.0 + 40.0; local_80.y = (float)(iVar9 / iVar3) * 40.0 + 120.0; Color::Color(&tmpColor); spawn_blood_explosion(2,&npc->_pos,&g_vectorZero,color,pVVar4); uVar2 = Random(); pEVar5 = Game::Spawn(g_game,1000,0xf,&local_80,&g_vectorZero,(Entity *)0x0,0,uVar2); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 2.0; tmpColor._colorize[1] = 0.5; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; (**(code **)(*(int *)pEVar5 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar5 + 0xc))(); local_78 = (undefined1 *)0xffffffff; do { uVar2 = Random(); pEVar5 = Game::Spawn(g_game,1000,0x94,&local_80,&g_vectorZero,(Entity *)npc,0,uVar2); tmpColor._offset[0] = 0.0; tmpColor._tint[0] = 2.0; tmpColor._tint[1] = 2.0; tmpColor._tint[2] = 2.0; tmpColor._tint[3] = 1.0; tmpColor._offset[1] = (float)&DAT_bf800000; tmpColor._offset[2] = (float)&DAT_bf800000; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; local_90.y = (float)pEVar5; (**(code **)(*(int *)pEVar5 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); pEVar13 = &pEVar5->_parent; if (pEVar5->_parent != (EntityPtr)0x0) { local_88 = pEVar13; std::multiset::erase(&local_88); } *pEVar13 = (EntityPtr)npc; std::multiset::insert(pEVar13); fVar11 = atan2f((npc->_targetPosition).y,(npc->_targetPosition).x); puVar8 = local_78 + 1; *(float *)((((Entity *)((int)local_90.y + 0x40c))->_sprite)._animDefaultName._buf + 8) = fVar11 * 57.295776 + 180.0 + (float)(int)local_78 * 90.0; local_78 = puVar8; } while ((int)puVar8 < 2); (npc->_v2).x = -5.0; fVar11 = (npc->_gridCollisionNormal).y; fVar10 = (npc->_gridCollisionNormal).x; fVar12 = fVar11 * (npc->_gridCollisionVelocity).y + fVar10 * (npc->_gridCollisionVelocity).x; fVar10 = (npc->_velocity).x - fVar12 * fVar10 * 5.0; (npc->_velocity).x = fVar10; (npc->_velocity).y = (npc->_velocity).y - fVar12 * fVar11 * 5.0; npc->_projectileDelay = -0x2d; (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; if (npc->_collidesWithGrid != 0) { (npc->_velocity).x = fVar10 * 0.01; (npc->_velocity).y = (npc->_velocity).y * 0.01; } } } } fVar11 = (npc->_velocity).y; fVar10 = (npc->_velocity).x; fVar11 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); local_90.y = (fVar11 - 8.0) * 0.125; if ((0.0 < local_90.y) && (bVar1 = Entity::IsFrame((Entity *)npc,3,0), bVar1 != 0)) { tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._colorize[3] = local_90.y + 0.05; tmpColor._colorize[0] = 3.0; tmpColor._colorize[1] = 0.3; tmpColor._colorize[2] = 0.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; (**(code **)(*(int *)npc + 0x3c))(&tmpColor,3,1,1,1); } } pVVar4 = &npc->_pos; if (npc->_state != 4) { if ((npc->_collidesWithGrid == 0) && (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 == 0)) { if (npc->_type == 0x11b) { if (npc->_controllerID == -1) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_88 = (EntityPtr *)(pEVar5->_pos).x; local_90.y = (pEVar5->_pos).y; targetDir = Vector::Resized(&npc->_targetPosition,&local_2c,40.0); isChargeOver = (local_90.y - ((npc->_pos).y - targetDir->y)) * (npc->_velocity).y + ((float)local_88 - (pVVar4->x - targetDir->x)) * (npc->_velocity).x < 0.0 ; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); isChargeOver = bVar1 == 0; } if (isChargeOver) goto LAB_005141ad; } npc->_friction = local_74.y * npc->_friction; Entity::AddVelocity_divided((Entity *)npc,&npc->_targetPosition,0); if ((isBlackKnight != '\0') && (fVar11 = (npc->_targetPosition).y, fVar10 = (npc->_targetPosition).x, fVar11 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11), fVar11 < 4.0)) { targetDir = Vector::Normalized(&npc->_targetPosition,&local_2c); fVar11 = npc->_speedMultiplier; fVar10 = targetDir->y; (npc->_targetPosition).x = targetDir->x * 0.07 * fVar11 + (npc->_targetPosition).x; (npc->_targetPosition).y = fVar10 * 0.07 * fVar11 + (npc->_targetPosition).y; } Room::GetGridPosition(g_game->_room,&local_80,(npc->_pathfinder)._gridIndex); if (ABS((npc->_velocity).x) <= ABS((npc->_velocity).y)) { pVVar4->x = local_80.x * 0.1 + pVVar4->x * 0.9; } else { (npc->_pos).y = local_80.y * 0.1 + (npc->_pos).y * 0.9; } } else { LAB_005141ad: bVar1 = npc->_collidesWithGrid; (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; if (bVar1 != 0) { (npc->_velocity).x = (npc->_velocity).x * 0.01; (npc->_velocity).y = (npc->_velocity).y * 0.01; } } } LAB_00514879: if (npc->_state != 8) goto LAB_00514c11; fVar11 = (npc->_targetPosition).x; fVar10 = (npc->_targetPosition).y; if (ABS(fVar10) < ABS(fVar11)) goto LAB_00514c36; LAB_005148ab: if (0.0 <= fVar10) { anim = &DAT_00b1cddc; puVar8 = (undefined1 *)0x3; } else { anim = (byte *)&DAT_00b1cde4; puVar8 = (undefined1 *)0x1; } } pVVar4 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_2c,(int)puVar8); (npc->_forwardVector).x = pVVar4->x; (npc->_forwardVector).y = pVVar4->y; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } if (isBlackKnight != '\0') { ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)local_3c); local_94 = (EntityPtr *)0x1; isAnimDifferent = str_ne(); if ((isAnimDifferent != '\0') || ((fVar11 = (npc->_velocity).x, ABS((npc->_velocity).y) < ABS(fVar11) && ((bool)(npc->_sprite)._flipX != fVar11 < 0.0)))) { isResetCooldown = '\x01'; goto LAB_00514d05; } } isResetCooldown = '\0'; LAB_00514d05: if (((uint)local_94 & 1) != 0) { std::string::_Tidy_deallocate(local_3c); } if (isResetCooldown != '\0') { npc->_projectileCooldown = 0xf; } if ((isBlackKnight == '\0') || (((0.0 < (npc->_v2).x || (npc->_v2).x == 0.0 && (posOffsetY = &(npc->_posOffset).y, 0.0 < *posOffsetY || *posOffsetY == 0.0)) && (-1 < npc->_projectileDelay)))) { fVar11 = (npc->_velocity).x; fVar10 = (npc->_velocity).y; if (0.01 <= fVar11 * fVar11 + fVar10 * fVar10) { if (ABS(fVar11) <= ABS((npc->_velocity).y)) { ANM2::Play(&npc->_sprite,anim,0); } else { ANM2::Play(&npc->_sprite,anim,0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } } else if ((npc->_sprite)._animState._animData != (void *)0x0) { (npc->_sprite)._animState._isPlaying = 0; AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0); } } if (((npc->_type == 0x11b) && (bVar1 = Entity::IsFrame((Entity *)npc,7,npc->_index), bVar1 != 0)) && ((npc->_flags & 0x1000000) == 0)) { uVar2 = Random(); uVar17 = 0; pTVar16 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar14 = 0; pEVar5 = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar2); piVar6 = (int *)__RTDynamicCast(pEVar5,uVar14,pTVar15,pTVar16,uVar17); fVar11 = g_vectorOne.y * 0.5; piVar6[0x39] = (int)(g_vectorOne.x * 0.5); piVar6[0x117] = 0x14; piVar6[0x3a] = (int)fVar11; piVar6[0x118] = 0x14; (**(code **)(*piVar6 + 0xc))(); } if (((npc->_dead != 0) && (npc->_type == 0x29)) && (npc->_variant == 2)) { uVar2 = Random(); pVVar4 = MusicManager::RandomVector(&local_90); local_2c.x = pVVar4->x * 10.0 + (npc->_pos).x; local_2c.y = pVVar4->y * 10.0 + (npc->_pos).y; pon = (EntityPtr)Game::Spawn(g_game,0x348,0,&local_2c,&g_vectorZero,(Entity *)0x0,0,uVar2); if (npc->_isChampion != 0) { Entity_NPC::Morph((Entity_NPC *)pon,*(int *)((int)pon + 0x28),*(int *)((int)pon + 0x2c), *(int *)((int)pon + 0x30),npc->_championColorIdx); } if (*(EntityPtr *)((int)pon + 0x3bc) != (EntityPtr)0x0) { local_80.y = (float)((int)pon + 0x3bc); std::multiset::erase(&local_80.y); } *(EntityPtr *)((int)pon + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)pon + 0x3bc)); if (npc->_child != (EntityPtr)0x0) { local_80.y = (float)&npc->_child; std::multiset::erase(&local_80.y); } npc->_child = pon; std::multiset::insert(&npc->_child); *(uint *)((int)pon + 0x168) = *(uint *)((int)pon + 0x168) & 0xfffffffb; *(undefined4 *)((int)pon + 0x16c) = *(undefined4 *)((int)pon + 0x16c); (**(code **)(*(int *)pon + 0xc))(); Entity_NPC::Morph(npc,npc->_type,3,npc->_subtype,0); npc->_dead = 0; } ExceptionList = local_1c; return; } //@@ 00515010 FUN_00515010 uint FUN_00515010(void) { Room *this; int iVar1; uint uVar2; float *in_ECX; int iVar3; uint index; this = g_game->_room; iVar3 = (int)((*in_ECX - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar1 = (int)((in_ECX[1] - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (this->_gridHeight <= iVar1)) { uVar2 = Room::GetGridCollision(this,-1); } else { index = this->_gridWidth * iVar1 + iVar3; uVar2 = Room::GetGridCollision(this,index); if (index < 0x1c0) { if (this->_gridPaths[index] == 0x3b6) { uVar2 = 3; } return uVar2; } } return uVar2; } //@@ 005150b0 room_grid_line_direction /* DB: ? (EDX from, param_1 to, ECX out Vector): both in room and in the same grid row or column, walks the tiles between them and returns the unit step (-1/0/1 per axis) if none has grid collision or gridPath > 650, else zero vector; NpcAI::ENTITY_GUTS after Room::CheckLine */ float * room_grid_line_direction(Vector *param_1) { Room *this; float fVar1; byte bVar2; int iVar3; int iVar4; float *in_ECX; int iVar5; int iVar6; Vector *in_EDX; uint uVar7; int iVar8; int iVar9; int local_c; this = g_game->_room; bVar2 = Room::IsPositionInRoom(this,in_EDX,0.0); if (bVar2 != 0) { bVar2 = Room::IsPositionInRoom(this,param_1,0.0); if (bVar2 != 0) { iVar3 = (int)((in_EDX->x - 40.0) / 40.0 + 0.5); iVar9 = (int)((in_EDX->y - 120.0) / 40.0 + 0.5); iVar5 = (int)((param_1->x - 40.0) / 40.0 + 0.5); iVar8 = (int)((param_1->y - 120.0) / 40.0 + 0.5); if (iVar3 == iVar5) { if (iVar9 != iVar8) goto LAB_00515190; } else if (iVar9 == iVar8) { LAB_00515190: uVar7 = iVar8 - iVar9 >> 0x1f; iVar6 = (iVar8 - iVar9 ^ uVar7) - uVar7; uVar7 = iVar5 - iVar3 >> 0x1f; iVar4 = (iVar5 - iVar3 ^ uVar7) - uVar7; if (iVar4 < iVar6) { iVar4 = iVar6; } if (iVar3 < iVar5) { iVar5 = 1; } else { iVar5 = (iVar3 <= iVar5) - 1; } if (iVar9 < iVar8) { iVar8 = 1; } else { iVar8 = (iVar9 <= iVar8) - 1; } local_c = 0; if (0 < iVar4 + -1) { do { iVar9 = iVar9 + iVar8; iVar3 = iVar5 + iVar3; if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar9 < 0)) || (this->_gridHeight <= iVar9)) { iVar6 = -1; } else { iVar6 = this->_gridWidth * iVar9 + iVar3; } uVar7 = Room::GetGridCollision(this,iVar6); if ((uVar7 != 0) || ((((-1 < iVar3 && (iVar3 < this->_gridWidth)) && ((-1 < iVar9 && ((iVar9 < this->_gridHeight && (uVar7 = this->_gridWidth * iVar9 + iVar3, uVar7 < 0x1c0)))))) && (0x28a < this->_gridPaths[uVar7])))) goto LAB_00515170; local_c = local_c + 1; } while (local_c < iVar4 + -1); } *in_ECX = (float)iVar5; in_ECX[1] = (float)iVar8; return in_ECX; } } } LAB_00515170: fVar1 = g_vectorZero.y; *in_ECX = g_vectorZero.x; in_ECX[1] = fVar1; return in_ECX; } //@@ 00515290 FUN_00515290 float10 FUN_00515290(float *param_1,undefined4 param_2,int param_3) { float *pfVar1; float fVar2; float fVar3; float fVar4; Vector local_20; Vector local_18; Vector local_10; local_20.y = 0.0; local_20.x = 0.0; local_10.x = *(float *)(param_3 + 0x33c); local_10.y = *(float *)(param_3 + 0x340); local_18.x = *(float *)(param_3 + 0x360) * 5.0 + *(float *)(param_3 + 0x33c); local_18.y = *(float *)(param_3 + 0x364) * 5.0 + *(float *)(param_3 + 0x340); Room::CheckLine(g_game->_room,&local_10,&local_18,1,0,0,0,&local_20); pfVar1 = (float *)room_grid_line_direction(&local_20); if ((*pfVar1 == g_vectorZero.x) && (pfVar1[1] == g_vectorZero.y)) { fVar4 = 2.0; } else { fVar4 = 0.01; } fVar3 = *(float *)(param_3 + 0x340) - param_1[1]; fVar2 = *(float *)(param_3 + 0x33c) - *param_1; return (float10)((fVar3 * fVar3 + fVar2 * fVar2) * fVar4); } //@@ 005153b0 NpcAI::ENTITY_GUTS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 40 (from dispatcher 006c2990) */ undefined4 * __fastcall NpcAI::ENTITY_GUTS(Entity_NPC *npc) { Vector pos; byte bVar1; RoomDescriptor *roomDesc; LayerState *layer; byte *animNameChar; uint uVar2; undefined4 *puVar3; int iVar4; Vector *pVVar5; int nextDir; float *lineDir; int iVar6; int newDir; Entity *pEVar7; ProjectileParams *params; uint uVar8; ColorMod *color; Entity_Effect *splat; char *animName; byte *animNameLiteral; Room *pRVar9; byte *pbVar10; bool bVar11; float fVar12; float fVar13; float fVar14; undefined1 auVar15 [12]; undefined1 auStack_190 [4]; Room *local_18c; char isActive; float local_184; Vector local_180; Vector local_174; Vector local_16c; float local_164; Vector local_160; EntityPtr *local_158; float local_154; EntityPtr target; Room *local_14c; Vector cardinalDir; undefined4 local_13c [11]; undefined4 local_110 [22]; ProjectileParams projectileParams; uint local_c; qword flags; uint *flagsHigh; Manager *manager; EntityPtr *targetSlot; local_c = __security_cookie ^ (uint)auStack_190; roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); iVar4 = npc->_type; local_164 = (float)((uint)roomDesc->Flags >> 1 & 0xffffff01); if (iVar4 == 0xda) { isActive = SUB41(local_164,0) == '\0'; if ((npc->_dead != 0) && (-1 < npc->_spawnGridIndex)) { Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); std::set::insert(&local_180,&npc->_spawnGridIndex); iVar4 = npc->_type; } } else { isActive = '\x01'; } if (iVar4 == 0x28) { bVar11 = npc->_variant == 2; } else { bVar11 = iVar4 == 0x35e; } if (bVar11) { if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { iVar4 = (npc->_sprite)._layerCount; } else { local_174.x = (float)AnimationState::GetNullFrame (&(npc->_sprite)._overlayAnimState,(byte *)"Deform"); iVar4 = (npc->_sprite)._layerCount; if ((Room *)local_174.x != (Room *)0x0) { pbVar10 = (byte *)0x0; if (iVar4 != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar10); (layer->_pos).x = *(float *)local_174.x; (layer->_pos).y = (float)*(void **)((int)local_174.x + 4); layer = ANM2::GetLayer(&npc->_sprite,pbVar10); (layer->_size).x = *(float *)((int)local_174.x + 0x10); (layer->_size).y = ((Vector *)((int)local_174.x + 0x14))->x; local_158 = ((void **)((int)local_174.x + 0x24))[8]; layer = ANM2::GetLayer(&npc->_sprite,pbVar10); pbVar10 = pbVar10 + 1; layer->_rotation = (float)local_158; } while (pbVar10 < (byte *)(npc->_sprite)._layerCount); } goto LAB_00515571; } } pbVar10 = (byte *)0x0; if (iVar4 != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar10); (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; layer = ANM2::GetLayer(&npc->_sprite,pbVar10); (layer->_size).x = g_vectorOne.x; (layer->_size).y = g_vectorOne.y; layer = ANM2::GetLayer(&npc->_sprite,pbVar10); pbVar10 = pbVar10 + 1; layer->_rotation = 0.0; } while (pbVar10 < (byte *)(npc->_sprite)._layerCount); } } LAB_00515571: target = (EntityPtr)0x0; iVar4 = npc->_type; if (iVar4 == 0x28) { if (npc->_variant == 2) { local_180.y = *(float *)((int)&npc->_flags + 4); flags = npc->_flags; if (((((flags & 0x1000a00) == 0) && ((flags & 0x4000) == 0)) && (bVar1 = Game::IsPaused(g_game), bVar1 == 0)) && ((~(byte)g_game->_frameCount & 1) != 0)) { if ((flags & 0x100) == 0) { LAB_00515626: target = (EntityPtr) Game::GetNearestTargetPlayer (&npc->_pos,(Entity *)npc,(npc->_flags & 0x20000000) != 0, (byte)((uint)npc->_decoyTargetTimer >> 0x1f) ^ 1,FUN_00515290,5000.0); } else { target = (EntityPtr)Game::GetNearestEnemy(FUN_00515290); if (target == (EntityPtr)0x0) { target = (EntityPtr)0x0; goto LAB_00515626; } } targetSlot = &npc->_target; if (npc->_target != (EntityPtr)0x0) { local_158 = targetSlot; std::multiset::erase(&local_158); } *targetSlot = target; if (target == (EntityPtr)0x0) goto LAB_0051569c; std::multiset::insert(targetSlot); } else { LAB_0051569c: target = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); } local_184 = ((Vector *)((int)target + 0x33c))->x - (npc->_pos).x; local_18c = (Room *)(*(float *)((int)target + 0x340) - (npc->_pos).y); fVar12 = sqrtf(local_184 * local_184 + (float)local_18c * (float)local_18c); if (0.0 < fVar12) { local_184 = local_184 * (1.0 / fVar12); local_18c = (Room *)((float)local_18c * (1.0 / fVar12)); } local_184 = local_184 + local_184; local_18c = (Room *)((float)local_18c + (float)local_18c); if ((npc->_sprite)._flipX != 0) { local_184 = -local_184; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_pos).x = local_184 + (layer->_pos).x; (layer->_pos).y = (float)local_18c + (layer->_pos).y; iVar4 = npc->_type; } if (iVar4 != 0x28) goto LAB_0051577b; LAB_0051590a: pbVar10 = (npc->_sprite)._animState._animData; if (pbVar10 != (byte *)0x0) { animNameChar = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { animNameChar = *(byte **)pbVar10; } animNameLiteral = &DAT_00b1e758; do { bVar1 = *animNameChar; bVar11 = bVar1 < *animNameLiteral; if (bVar1 != *animNameLiteral) { LAB_00515940: uVar2 = -(uint)bVar11 | 1; goto LAB_00515945; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar11 = bVar1 < animNameLiteral[1]; if (bVar1 != animNameLiteral[1]) goto LAB_00515940; animNameChar = animNameChar + 2; animNameLiteral = animNameLiteral + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00515945: if ((uVar2 == 0) && ((pbVar10[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0051597c; } animName = &DAT_00b1e758; LAB_00515965: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { LAB_0051577b: if (iVar4 == 0x35e) goto LAB_0051590a; if (iVar4 == 0xda) { if (((g_game->_frameCount - npc->_spawnFrame < 0x1e) || (local_164._0_1_ != '\0')) || (bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar1 != 0)) { pbVar10 = (npc->_sprite)._animState._animData; if (pbVar10 == (byte *)0x0) { LAB_005158e0: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"No-Spikes",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { animNameChar = *(byte **)pbVar10; } animName = "No-Spikes"; do { bVar1 = *animNameChar; bVar11 = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_005158c2: uVar2 = -(uint)bVar11 | 1; goto LAB_005158c7; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar11 = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_005158c2; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_005158c7: if ((uVar2 != 0) || ((pbVar10[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_005158e0; } npc->_collisionDamage = 0.0; goto LAB_0051597c; } if (g_game->_frameCount - npc->_spawnFrame == 0x1e) { Entity_NPC::PlaySound(npc,0xcd,1.5,2,0,1.0); npc->_collisionDamage = *(float *)((int)npc->_config + 0x28); } pbVar10 = (npc->_sprite)._animState._animData; if (pbVar10 == (byte *)0x0) { LAB_0051587d: animName = "Spikes"; } else { animNameChar = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { animNameChar = *(byte **)pbVar10; } animName = "Spikes"; do { bVar1 = *animNameChar; bVar11 = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_00515850: uVar2 = -(uint)bVar11 | 1; goto LAB_00515855; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar11 = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_00515850; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00515855: if (uVar2 != 0) goto LAB_0051587d; if ((pbVar10[0x34] == 0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0051597c; animName = "Spikes"; } goto LAB_00515965; } } LAB_0051597c: if (npc->_state == 0) { npc->_i1 = -1; *(undefined1 *)&npc->_i2 = 0; npc->_projectileCooldown = 0x3c; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; (npc->_sprite)._flipX = 1; puVar3 = (undefined4 *)npc->_type; npc->_state = 4; npc->_aiFloat = 1.0; fVar13 = g_colorGreenSplat._tint[3]; fVar14 = g_colorGreenSplat._tint[2]; fVar12 = g_colorGreenSplat._tint[1]; if (puVar3 == (undefined4 *)0x28) { if (npc->_variant != 2) goto LAB_00515a85; puVar3 = local_13c; if (&npc->_splatColor == (ColorMod *)puVar3) goto LAB_00515a85; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._colorize[0] = 0.2; (npc->_splatColor)._colorize[1] = 0.2; (npc->_splatColor)._colorize[2] = 0.2; (npc->_splatColor)._colorize[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; puVar3 = (undefined4 *)0x0; } else { if ((puVar3 != (undefined4 *)0x35e) || (&npc->_splatColor == &g_colorGreenSplat)) goto LAB_00515a85; (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar12; (npc->_splatColor)._tint[2] = fVar14; (npc->_splatColor)._tint[3] = fVar13; fVar13 = g_colorGreenSplat._colorize[3]; fVar14 = g_colorGreenSplat._colorize[2]; fVar12 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar12; (npc->_splatColor)._colorize[2] = fVar14; (npc->_splatColor)._colorize[3] = fVar13; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; puVar3 = (undefined4 *)g_colorGreenSplat._offset[2]; } (npc->_splatColor)._offset[2] = (float)puVar3; LAB_00515a85: if (npc->_type == 0xda) { flags = npc->_flags; puVar3 = local_110; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 1; npc->_isInvicible = 1; if (&npc->_splatColor != (ColorMod *)puVar3) { puVar3 = (undefined4 *)0x0; (npc->_splatColor)._tint[0] = 1.0; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 1.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; } uVar2 = npc->_subtype; if (uVar2 != 0) { if (4 < uVar2) { uVar2 = 4; } puVar3 = (undefined4 *)(4 - uVar2); npc->_i1 = (int)puVar3; } (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; return puVar3; } if ((isActive != '\0') && (g_game->_frameCount == npc->_spawnFrame)) { npc->_friction = npc->_friction * 0.6; return (undefined4 *)0x0; } pRVar9 = (Room *)npc->_i1; if (((int)pRVar9 < 0) && (isActive != '\0')) { npc->_i1 = 0; local_174.x = 0.0; do { fVar12 = local_174.x; local_16c.x = (float)((&DAT_00b61590)[(int)local_174.x * 2] * 0x28) + (npc->_pos).x; local_16c.y = (float)((&DAT_00b61594)[(int)local_174.x * 2] * 0x28) + (npc->_pos).y; iVar4 = FUN_00515010(); if (iVar4 != 0) { pRVar9 = (Room *)local_174.x; goto LAB_00515c77; } local_174.x = (float)((int)fVar12 + 1); npc->_i1 = (int)local_174.x; } while ((int)local_174.x < 4); uVar2 = Random(); npc->_i1 = (int)(uVar2 & 3); pRVar9 = (Room *)(uVar2 & 3); LAB_00515c77: fVar12 = npc->_friction * 0.6; } else if (isActive == '\0') { fVar12 = npc->_friction * 0.9; npc->_entityGridCollisionClass = 5; } else { fVar12 = npc->_friction * 0.6; } npc->_friction = fVar12; fVar12 = (npc->_targetPosition).x; if ((fVar12 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { LAB_00515d80: local_18c = pRVar9; } else { local_18c = pRVar9; if ((isActive != '\0') && ((npc->_projectileCooldown != -1 && (-10.0 < ((npc->_pos).y - (npc->_targetPosition).y) * (float)(int)(&DAT_00b61594)[(int)pRVar9 * 2] + (float)(int)(&DAT_00b61590)[(int)pRVar9 * 2] * ((npc->_pos).x - fVar12))))) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; pRVar9 = (Room *)npc->_i1; goto LAB_00515d80; } } if ((((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) && (isActive != '\0')) { local_160.x = (npc->_pos).x; pRVar9 = (Room *)((int)local_18c * 2); iVar4 = (&DAT_00b61590)[(int)local_18c * 2]; local_160.y = (npc->_pos).y; iVar6 = (&DAT_00b61590) [(int)pRVar9->_gridEntities + (uint)(*(char *)((int)&npc->_i2 + 1) != '\0') * 2 + -0x23] ; local_16c.x = (float)((iVar4 + iVar6) * -0x28) + local_160.x; local_16c.y = (float)((iVar4 - iVar6) * 0x28) + local_160.y; local_160.x = local_160.x - (float)(iVar6 * 0x28); local_160.y = (float)(iVar4 * 0x28) + local_160.y; local_174.x = (float)pRVar9; local_16c.x = (float)FUN_00515010(); local_184 = (float)FUN_00515010(); local_18c = (Room *)0xffffffff; if (((npc->_controllerID != -1) && (-1 < npc->_projectileCooldown)) && ((Entity_NPC::GetControllerInput(npc,&local_160,0.1), local_160.x != g_vectorZero.x || (local_160.y != g_vectorZero.y)))) { pVVar5 = Vector::ToCardinal(&cardinalDir,&local_160); local_18c = (Room *)0x0; if (ABS(pVVar5->x) <= ABS(pVVar5->y)) { if (pVVar5->y < 0.0) { local_18c = (Room *)0x2; } } else { local_18c = (Room *)((uint)(pVVar5->x < 0.0) * 2 + 1); } local_164 = cos(1.5707964); fVar13 = sin(1.5707964); fVar12 = pVVar5->x; fVar14 = pVVar5->y; local_158 = (EntityPtr *)(local_164 * fVar12 - fVar13 * fVar14); local_164 = local_164 * fVar14 + fVar13 * fVar12; uVar2 = (int)local_18c + (4 - npc->_i1) & 0x80000001; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffe) + 1; } if (uVar2 == 1) { local_14c = (Room *)(npc->_pos).x; local_160.x = (npc->_pos).y; local_180.x = fVar12 * 40.0 + (float)local_14c; local_180.y = fVar14 * 40.0 + local_160.x; iVar4 = FUN_00515010(); if (iVar4 == 0) { local_180.x = ((float)local_158 + pVVar5->x) * 40.0 + (npc->_pos).x; local_180.y = (local_164 + pVVar5->y) * 40.0 + (npc->_pos).y; iVar4 = FUN_00515010(); if (iVar4 == 0) { local_180.x = (pVVar5->x - (float)local_158) * 40.0 + (float)local_14c; local_180.y = (pVVar5->y - local_164) * 40.0 + local_160.x; iVar4 = FUN_00515010(); if (iVar4 == 0) goto LAB_005160b9; } if (local_18c != (Room *)npc->_i1) { npc->_i1 = (int)local_18c; *(undefined1 *)&npc->_i2 = 1; pRVar9 = (Room *)((int)local_18c * 2); goto LAB_005160bd; } } } LAB_005160b9: pRVar9 = (Room *)local_174.x; } LAB_005160bd: if ((((EntityPtr *)local_16c.x == (EntityPtr *)0x0) || (local_184 != 0.0)) || (((char)npc->_i2 != '\0' || ((npc->_projectileCooldown < 0 || ((Room *)npc->_i1 == local_18c)))))) { local_174.x = (float)g_game->_room; iVar6 = (int)((((float)((&DAT_00b61590)[(int)pRVar9] * 0x28) + (npc->_pos).x) - 40.0) / 40.0 + 0.5); iVar4 = (int)((((float)((&DAT_00b61594)[(int)pRVar9] * 0x28) + (npc->_pos).y) - 120.0) / 40.0 + 0.5); if ((iVar6 < 0) || (((((Room *)local_174.x)->_gridWidth <= iVar6 || (iVar4 < 0)) || (((Room *)local_174.x)->_gridHeight <= iVar4)))) { uVar8 = 0xffffffff; uVar2 = Room::GetGridCollision((Room *)local_174.x,-1); LAB_00516240: if (uVar2 == 0) { iVar4 = *(int *)((int)local_174.x + 0xc); (npc->_targetPosition).x = (float)((int)uVar8 % iVar4) * 40.0 + 40.0; (npc->_targetPosition).y = (float)((int)uVar8 / iVar4) * 40.0 + 120.0; *(undefined1 *)&npc->_i2 = 0; pRVar9 = (Room *)npc->_i1; goto LAB_0051634c; } } else { uVar8 = ((Room *)local_174.x)->_gridWidth * iVar4 + iVar6; uVar2 = Room::GetGridCollision((Room *)local_174.x,uVar8); if ((0x1bf < uVar8) || (((int *)((int)local_174.x + 0x76c))[uVar8] != 0x3b6)) goto LAB_00516240; } if (npc->_projectileCooldown == -2) { npc->_projectileCooldown = 0x3c; if ((npc->_i1 == 0) || (animName = "HitHori", npc->_i1 == 2)) { animName = "HitVert"; } ANM2::PlayOverlay(&npc->_sprite,(byte *)animName,0); manager = g_manager; local_174.x = 1.0; if (npc->_championColorIdx == 0x12) { local_174.x = 1.5; } else if (npc->_championColorIdx == 0x13) { local_174.x = 0.5; } local_158 = (EntityPtr *)0x48; seed_fart_sound_override((int *)&local_158); SoundEffects::Play(&manager->_sfxManager,(int)local_158,1.0,2,0,local_174.x,0.0); npc->_aiFloat = 0.1; } if (-1 < (int)local_18c) { uVar2 = (int)local_18c + (4 - npc->_i1) & 0x80000001; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffe) + 1; } if (uVar2 == 1) { npc->_i1 = (int)local_18c; pRVar9 = local_18c; goto LAB_0051634c; } } pRVar9 = (Room *)(npc->_i1 + 1 + (uint)(*(char *)((int)&npc->_i2 + 1) != '\0') * 2); npc->_i1 = (int)pRVar9; } else { pRVar9 = (Room *)((int)((Room *)npc->_i1)->_gridEntities + (uint)(*(char *)((int)&npc->_i2 + 1) == '\0') * 2 + -0x23); npc->_i1 = (int)pRVar9; *(undefined1 *)&npc->_i2 = 1; } } else { pRVar9 = local_18c; } LAB_0051634c: if ((int)pRVar9 < 4) { if ((int)pRVar9 < 0) { nextDir = (int)&pRVar9->_descriptor; goto LAB_0051635d; } } else { nextDir = (int)&pRVar9[-1]._isPickupVisionInvalid; LAB_0051635d: npc->_i1 = nextDir; } fVar12 = (npc->_targetPosition).x; if (((fVar12 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) || (isActive == '\0')) goto LAB_00516602; local_16c.x = (npc->_pos).x - fVar12; local_160.x = (npc->_pos).y - (npc->_targetPosition).y; fVar12 = sqrtf(local_160.x * local_160.x + local_16c.x * local_16c.x); if (npc->_projectileCooldown != -1) { if (fVar12 < 10.0) { LAB_00516438: (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } else if (2.0 <= ABS(fVar12 - (npc->_v1).x)) { (npc->_v1).x = fVar12; (npc->_v1).y = 0.0; } else { fVar14 = (npc->_v1).y + 0.033333335; (npc->_v1).y = fVar14; if (0.25 <= fVar14) goto LAB_00516438; } } fVar14 = 3.0; if (npc->_type == 0x28) { if (npc->_variant == 1) { fVar14 = 3.3; } else if (npc->_variant == 2) { fVar14 = 2.45; } } fVar13 = npc->_friction; fVar12 = (fVar14 * npc->_aiFloat) / fVar12; if (fVar13 != 0.0) { fVar14 = npc->_speedMultiplier; (npc->_velocity).x = (-local_16c.x * fVar12 * fVar14) / fVar13 + (npc->_velocity).x; (npc->_velocity).y = (-local_160.x * fVar12 * fVar14) / fVar13 + (npc->_velocity).y; } fVar12 = (npc->_targetPosition).x; if ((fVar12 != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { fVar14 = npc->_speedMultiplier; fVar13 = 0.6; if (ABS(local_160.x) <= ABS(local_16c.x)) { if (fVar14 != 1.0) { fVar13 = 0.6 / ((fVar14 + 0.6) - fVar14 * 0.6); } (npc->_velocity).y = ((npc->_targetPosition).y - (npc->_pos).y) * 0.4 * fVar14 + fVar13 * (npc->_velocity).y; } else { if (fVar14 != 1.0) { fVar13 = 0.6 / ((fVar14 + 0.6) - fVar14 * 0.6); } (npc->_velocity).x = (fVar12 - (npc->_pos).x) * 0.4 * fVar14 + fVar13 * (npc->_velocity).x; } } LAB_00516602: if ((npc->_type == 0x28) && (npc->_variant == 2)) { iVar4 = npc->_projectileCooldown; if (iVar4 == 0) { local_18c = (Room *)0x0; local_184 = 0.0; if (npc->_controllerID == -1) { if (target != (EntityPtr)0x0) { local_160.x = ((Vector *)((int)target + 0x33c))->x; local_180.x = ((Vector *)((int)target + 0x360))->x * 5.0 + ((Vector *)((int)target + 0x33c))->x; local_180.y = *(float *)((int)target + 0x364) * 5.0 + *(float *)((int)target + 0x340); local_160.y = *(float *)((int)target + 0x340); local_16c.y = 0.0; local_16c.x = 0.0; Room::CheckLine(g_game->_room,&local_160,&local_180,1,0,0,0,&local_16c); lineDir = (float *)room_grid_line_direction(&local_16c); local_184 = *lineDir; local_18c = (Room *)lineDir[1]; } } else { Entity_NPC::GetControllerMovementInput(npc,&local_16c,0.1); if ((local_16c.x != g_vectorZero.x) || (local_16c.y != g_vectorZero.y)) { pVVar5 = Vector::ToCardinal(&cardinalDir,&local_16c); local_14c = g_game->_room; local_160.x = pVVar5->y * 40.0 + (npc->_pos).y; local_16c.x = pVVar5->x * 40.0 + (npc->_pos).x; pos.y = local_160.x; pos.x = local_16c.x; local_158 = (EntityPtr *)local_16c.x; local_154 = local_160.x; iVar4 = Room::GetGridCollisionAtPos(local_14c,pos); if (iVar4 == 0) { local_180.x = local_16c.x; local_180.y = local_160.x; iVar4 = Room::GetGridPathFromPos(local_14c,&local_180); if (iVar4 < 0x3b6) { local_184 = pVVar5->x; local_18c = (Room *)pVVar5->y; } } } } if ((local_184 != g_vectorZero.x) || ((float)local_18c != g_vectorZero.y)) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"ChargeStart",0); pRVar9 = g_game->_room; iVar6 = Room::GetGridIndex(pRVar9,&npc->_pos); iVar4 = pRVar9->_gridWidth; newDir = 0; (npc->_targetPosition).y = (float)(iVar6 / iVar4) * 40.0 + 120.0; (npc->_targetPosition).x = (float)(iVar6 % iVar4) * 40.0 + 40.0; npc->_projectileCooldown = -1; (npc->_v2).x = local_184; (npc->_v2).y = (float)local_18c; npc->_aiFloat = 1.0; if (ABS(local_184) <= ABS((float)local_18c)) { if ((float)local_18c < 0.0) { newDir = 2; } npc->_i1 = newDir; } else { npc->_i1 = (uint)(local_184 < 0.0) * 2 + 1; } } } else if (iVar4 == -1) { fVar12 = npc->_aiFloat - npc->_speedMultiplier * 0.1; if (fVar12 <= 0.1) { fVar12 = 0.1; } npc->_aiFloat = fVar12; if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"ChargeLoop",0); local_180.x = (npc->_v2).x * 40.0 + (npc->_targetPosition).x; pRVar9 = g_game->_room; local_180.y = (npc->_v2).y * 40.0 + (npc->_targetPosition).y; iVar6 = Room::GetGridIndex(pRVar9,&local_180); iVar4 = pRVar9->_gridWidth; (npc->_targetPosition).x = (float)(iVar6 % iVar4) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar6 / iVar4) * 40.0 + 120.0; npc->_projectileCooldown = -2; npc->_aiFloat = 1.8; } } else if ((iVar4 == -2) && (iVar4 = Entity::GetIntervalTicks((Entity *)npc,4.0,0.0), iVar4 != 0)) { Entity_NPC::PlaySound(npc,0xb9,0.4,2,0,0.7); } iVar4 = npc->_projectileCooldown; if (-1 < iVar4) { if (npc->_aiFloat < 1.0) { fVar12 = npc->_speedMultiplier * 0.05 + npc->_aiFloat; auVar15 = ZEXT812(0x3f800000); if (fVar12 <= auVar15._0_4_) { auVar15._4_8_ = auVar15._4_8_; auVar15._0_4_ = fVar12; } npc->_aiFloat = auVar15._0_4_; } if (0 < iVar4) { iVar4 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar4; iVar6 = 0; if (0 < iVar4) { iVar6 = iVar4; } npc->_projectileCooldown = iVar6; } } } if (npc->_type == 0x35e) { if (npc->_projectileDelay < 0x1e) { npc->_projectileDelay = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + npc->_projectileDelay; } else if ((npc->_controllerID == -1) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { uVar2 = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0xb,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2,0); (pEVar7->_posOffset).x = 0.0; (pEVar7->_posOffset).y = -14.0; if (pEVar7->_parent != (EntityPtr)0x0) { local_16c.x = (float)&pEVar7->_parent; std::multiset::erase(&local_16c); } pEVar7->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar7->_parent); *(undefined4 *)&pEVar7[1].field_0x44 = 1; pEVar7->_renderDepthOffset = 5.0; pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_174.x = (pEVar7->_pos).x - (npc->_pos).x; local_164 = (pEVar7->_pos).y - (npc->_pos).y; fVar12 = sqrtf(local_174.x * local_174.x + local_164 * local_164); if (0.0 < fVar12) { local_174.x = local_174.x * (1.0 / fVar12); local_164 = local_164 * (1.0 / fVar12); } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar12 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_180,0.1); (npc->_controllerMovement).x = local_180.x; fVar12 = local_180.y; } (npc->_controllerMovement).y = fVar12; pRVar9 = (Room *)(npc->_controllerMovement).x; if (((float)pRVar9 != g_vectorZero.x) || (fVar12 != g_vectorZero.y)) { local_164 = (npc->_controllerMovement).y; local_174.x = (float)pRVar9; } params = ProjectileParams::ProjectileParams(&projectileParams); local_180.x = local_174.x * 10.0; local_180.y = local_164 * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_180,0,params); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } npc->_projectileDelay = 0; } } iVar4 = 5; if (npc->_variant == 1) { iVar4 = 2; } if ((npc->_variant == 2) && (iVar4 = 4, npc->_projectileCooldown == -2)) { iVar4 = 1; } puVar3 = (undefined4 *)npc->_type; if (((puVar3 == (undefined4 *)0x28) || (puVar3 == (undefined4 *)0x35e)) && (puVar3 = (undefined4 *)((uint)npc->_flags & 0x4000), puVar3 == (undefined4 *)0x0)) { bVar1 = Game::IsPaused(g_game); puVar3 = (undefined4 *)(uint)bVar1; if ((bVar1 == 0) && (iVar6 = g_game->_frameCount + npc->_index, puVar3 = (undefined4 *)(iVar6 / iVar4), iVar6 % iVar4 == 0)) { if (npc->_variant == 1) { uVar2 = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar2,0); puVar3 = (undefined4 *) __RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); fVar12 = g_vectorOne.y; fVar14 = g_vectorOne.x * 0.1; puVar3[0x11e] = 0x3f400000; puVar3[0x117] = 0x14; puVar3[0x39] = fVar14; puVar3[0x118] = 0x14; puVar3[0x3a] = fVar12 * 0.1; return puVar3; } if (npc->_variant == 2) { if (iVar4 == 1) { local_14c = (Room *)((uint)(npc->_v2).x ^ 0x80000000); local_158 = (EntityPtr *)((uint)(npc->_v2).y ^ 0x80000000); uVar2 = Random(); uVar8 = Random(); local_16c.x = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_160.x = cos(local_16c.x); local_16c.x = sin(local_16c.x); uVar8 = Random(); local_174.y = (float)local_158 * 4.0 + (npc->_pos).y; fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 8.0 + 2.0; local_174.x = (float)local_14c * 4.0 + (npc->_pos).x; local_180.y = (local_160.x * (float)local_158 + local_16c.x * (float)local_14c) * fVar12; local_180.x = (local_160.x * (float)local_14c - local_16c.x * (float)local_158) * fVar12; pEVar7 = Game::SpawnEx(g_game,1000,99,&local_174,&local_180,(Entity *)0x0,1,uVar2,0); uVar2 = Random(); fVar14 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 1.0; fVar12 = (pEVar7->_sprite)._scale.y; (pEVar7->_sprite)._scale.x = fVar14 * (pEVar7->_sprite)._scale.x; (pEVar7->_sprite)._scale.y = fVar14 * fVar12; color = (ColorMod *)Color::Color(0x3f800000); Sprite::SetColor((Sprite *)&pEVar7->_sprite,color); (**(code **)(*(int *)pEVar7 + 0xc))(); } uVar2 = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar2,0); iVar4 = __RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); fVar12 = g_vectorOne.y; fVar14 = g_vectorOne.x * 0.1; *(undefined4 *)(iVar4 + 0x478) = 0x3f400000; *(undefined4 *)(iVar4 + 0x45c) = 0x96; *(float *)(iVar4 + 0xe4) = fVar14; *(undefined4 *)(iVar4 + 0x460) = 0x96; *(float *)(iVar4 + 0xe8) = fVar12 * 0.1; } uVar2 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.7); puVar3 = (undefined4 *) (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } } return puVar3; } //@@ 00517150 NpcAI::ENTITY_BOIL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 30 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BOIL(Entity_NPC *npc) { byte bVar1; uint uVar2; Entity *tmpEntity; int iVar3; byte *animNameCursor; ProjectileParams *params; Entity_Projectile *projectile; Vector *pVVar4; int gridIndex; float *pfVar5; int extraout_ECX; int extraout_ECX_00; char *expectedName; undefined4 extraout_ECX_01; Room *room; bool isLess; float fVar6; float fVar7; undefined1 auVar8 [12]; float fVar9; float fVar10; undefined1 auStack_15c [3]; byte isTargetInRange; Vector scratchVec; Vector local_14c; Vector freeSpawnPos; undefined4 local_13c [11]; undefined4 local_110 [11]; Color projColor; ProjectileParams projParams; uint local_c; byte *animData; local_c = __security_cookie ^ (uint)auStack_15c; if (npc->_state == 0) { if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { uVar2 = Random(); fVar9 = npc->_maxHitPoints * 0.8; if (fVar9 <= 7.0) { fVar9 = 7.0; } fVar9 = (fVar9 - 7.0) * (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 + 7.0; } else { fVar9 = 7.0; } npc->_health = fVar9; (npc->_v1).x = 0.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; if (npc->_variant == 1) { if (&npc->_splatColor == (ColorMod *)local_13c) { return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.5; (npc->_splatColor)._tint[0] = 0.2; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 0.2; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; return; } if (npc->_variant != 2) { return; } if (&npc->_splatColor == (ColorMod *)local_110) { return; } (npc->_splatColor)._offset[0] = 1.0; (npc->_splatColor)._offset[1] = 1.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 1.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } npc->_friction = npc->_friction * 0.8; if (0.0 < npc->_pendingDamage) { pfVar5 = (npc->_damageEvents)._begin; fVar9 = 0.0; if (pfVar5 != (npc->_damageEvents)._end) { do { scratchVec.y = pfVar5[3]; if ((((((uint)pfVar5[2] & 4) == 0) || (((uint)pfVar5[0xc] >> 1 & 1) != 0)) || (pfVar5[4] == 1.4013e-45)) || (((pfVar5[6] == 1.4013e-45 || (pfVar5[6] == 4.2039e-45)) || (((uint)pfVar5[2] & 0x1000) != 0)))) { fVar9 = fVar9 + *pfVar5; } else { *pfVar5 = 0.0; } pfVar5 = pfVar5 + 0xe; } while (pfVar5 != (npc->_damageEvents)._end); if (0.0 < fVar9) { (npc->_v1).x = 0.0; } } } tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar9 = (tmpEntity->_pos).y - (npc->_pos).y; fVar7 = (tmpEntity->_pos).x - (npc->_pos).x; local_14c.x = sqrtf(fVar9 * fVar9 + fVar7 * fVar7); fVar9 = npc->_maxHitPoints; if (npc->_health < fVar9) { fVar7 = (npc->_v1).x; fVar10 = npc->_speedMultiplier; fVar6 = fVar7 * 1.2 * fVar10 + npc->_health; npc->_health = fVar6; pfVar5 = &npc->_health; if (fVar9 < fVar6) { pfVar5 = &npc->_maxHitPoints; } npc->_health = *pfVar5; if (npc->_spawnerType == 0x24) { fVar9 = 0.01; } else { fVar9 = 0.02; } (npc->_v1).x = fVar10 * fVar9 + fVar7; if (npc->_variant == 2) { fVar9 = 0.8; if (fVar10 != 1.0) { fVar9 = 0.8 / ((fVar10 + 0.8) - fVar10 * 0.8); } (npc->_v1).x = fVar9 * (npc->_v1).x; } auVar8 = ZEXT812(0x3f4ccccd); if (fVar10 != 1.0) { fVar9 = auVar8._0_4_; auVar8._4_8_ = auVar8._4_8_; auVar8._0_4_ = fVar9 / ((fVar10 + fVar9) - fVar10 * fVar9); } (npc->_v1).x = auVar8._0_4_ * (npc->_v1).x; iVar3 = __ftoui3(); bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shrink",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)(-(uint)(0xdU - iVar3 != 0) & 0xdU - iVar3)), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } } else { if ((npc->_state == 3) && ((npc->_flags & 0x1000a00) == 0)) { if (npc->_controllerID == -1) { uVar2 = Random(); iVar3 = 0x32; if ((uVar2 % 0x32 != 0) || ((230.0 <= local_14c.x && (uVar2 = Random(), iVar3 = extraout_ECX_00, (uVar2 & 3) != 0))) ) { isTargetInRange = 0; } else { isTargetInRange = 1; } } else { isTargetInRange = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); iVar3 = extraout_ECX; } if ((npc->_controllerID == -1) || (bVar1 = input_is_action_pressed(10,npc->_controllerID,(Entity *)npc,iVar3), bVar1 == 0)) { if (isTargetInRange != 0) { if ((npc->_variant == 2) && ((iVar3 = Entity_NPC::GetAliveEnemyCount(npc), 7 < iVar3 || (iVar3 = Isaac::Random(iVar3), iVar3 != 0)))) goto LAB_00517491; npc->_state = 8; Entity_NPC::UpdateControllerMovement(npc,1); } } else { LAB_00517491: npc->_state = 9; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shrink",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } goto LAB_00517d94; } animData = (npc->_sprite)._animState._animData; if (npc->_state != 8) { if (animData == (byte *)0x0) { LAB_00517c1a: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shake",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = "Shake"; do { bVar1 = *animNameCursor; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_00517c04: uVar2 = -(uint)isLess | 1; goto LAB_00517c09; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00517c04; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00517c09: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00517c1a; } goto LAB_00517bb5; } if (animData == (byte *)0x0) { LAB_00517549: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = "Shoot"; do { bVar1 = *animNameCursor; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_00517533: uVar2 = -(uint)isLess | 1; goto LAB_00517538; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00517533; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00517538: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00517549; } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar9 = g_vectorZero.y; LAB_005175d0: (npc->_controllerMovement).y = fVar9; } else { Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.1); if ((scratchVec.x != g_vectorZero.x) || (scratchVec.y != g_vectorZero.y)) { (npc->_controllerMovement).x = scratchVec.x; fVar9 = scratchVec.y; goto LAB_005175d0; } } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00517d8a; bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { uVar2 = Random(); if ((250.0 - (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 20.0 <= local_14c.x) || (isTargetInRange = '\x01', npc->_spawnerType == 0x24)) { isTargetInRange = '\0'; } if (npc->_variant == 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); if (isTargetInRange == '\0') { local_14c.x = g_vectorZero.x; local_14c.y = g_vectorZero.y; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_14c.x = (tmpEntity->_pos).x; local_14c.y = (tmpEntity->_pos).y; } scratchVec.x = local_14c.x; scratchVec.y = local_14c.y; if (((npc->_controllerMovement).x != g_vectorZero.x) || ((npc->_controllerMovement).y != g_vectorZero.y)) { scratchVec.x = local_14c.x * 100.0 + (npc->_pos).x; scratchVec.y = local_14c.y * 100.0 + (npc->_pos).y; } params = ProjectileParams::ProjectileParams(&projParams); uVar2 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar2 & 1) + 3,&scratchVec,10.0,params); } else if (npc->_variant == 1) { Entity_NPC::PlaySound(npc,0xd5,0.7,2,0,1.0); npc->_projectileCooldown = -0x32; if (isTargetInRange == '\0') { local_14c.x = g_vectorZero.x; local_14c.y = g_vectorZero.y; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_14c.x = (tmpEntity->_pos).x; local_14c.y = (tmpEntity->_pos).y; } scratchVec.x = local_14c.x; scratchVec.y = local_14c.y; if (((npc->_controllerMovement).x != g_vectorZero.x) || ((npc->_controllerMovement).y != g_vectorZero.y)) { scratchVec.x = local_14c.x * 100.0 + (npc->_pos).x; scratchVec.y = local_14c.y * 100.0 + (npc->_pos).y; } params = ProjectileParams::ProjectileParams(&projParams); projectile = Entity_NPC::FireBossProjectiles(npc,1,&scratchVec,10.0,params); fVar9 = (projectile->_velocity).y; fVar7 = (projectile->_velocity).x * 0.55; *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 2; fVar9 = fVar9 * 0.55; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = *(undefined4 *)((int)&projectile->_projectileFlags + 4); projectile->_scale = 1.6; scratchVec.x = fVar9; local_14c.x = fVar7; if (isTargetInRange != '\0') { uVar2 = Random(); fVar9 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 + 0.6; fVar7 = local_14c.x * fVar9; fVar9 = scratchVec.x * fVar9; } fVar10 = projectile->_fallingAccel; (projectile->_velocity).x = fVar7; (projectile->_velocity).y = fVar9; projectile->_fallingAccel = fVar10 - 0.3; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 13.0; Color::Color(&projColor); projColor._colorize[0] = 0.4; projColor._colorize[1] = 2.0; projColor._colorize[2] = 0.5; projColor._colorize[3] = 1.0; (**(code **)(*(int *)projectile + 0x3c))(extraout_ECX_01,0xffffffff,0xff,0,1); } else { Entity_NPC::PlaySound(npc,0xb5,1.0,2,0,1.0); fVar9 = (npc->_controllerMovement).x; if ((fVar9 == g_vectorZero.x) && ((npc->_controllerMovement).y == g_vectorZero.y)) { pVVar4 = &npc->_pos; if (isTargetInRange == '\0') { fVar9 = 100.0; goto LAB_00517a8a; } room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar9 = 70.0; local_14c.x = ((tmpEntity->_pos).x + pVVar4->x) * 0.5; local_14c.y = ((tmpEntity->_pos).y + (npc->_pos).y) * 0.5; pVVar4 = &local_14c; } else { local_14c.x = fVar9 * 80.0 + (npc->_pos).x; local_14c.y = (npc->_controllerMovement).y * 80.0 + (npc->_pos).y; pVVar4 = &local_14c; fVar9 = 0.0; LAB_00517a8a: room = g_game->_room; } pVVar4 = Room::FindFreePickupSpawnPosition(room,&freeSpawnPos,pVVar4,fVar9,0,0,0); scratchVec.x = pVVar4->x; scratchVec.y = pVVar4->y; uVar2 = Random(); tmpEntity = Game::SpawnEx(g_game,0x55,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar2,0); iVar3 = __RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); room = g_game->_room; gridIndex = Room::GetGridIndex(room,&scratchVec); Room::SetGridPath(room,gridIndex,900); fVar9 = *(float *)(iVar3 + 0x33c); *(float *)(iVar3 + 0x334) = fVar9; fVar7 = *(float *)(iVar3 + 0x340); *(float *)(iVar3 + 0x338) = fVar7; fVar10 = (npc->_pos).x; *(float *)(iVar3 + 0x33c) = fVar10; fVar6 = (npc->_pos).y; *(float *)(iVar3 + 0x340) = fVar6; *(float *)(iVar3 + 0x350) = *(float *)(iVar3 + 0x350) - 10.0; *(undefined4 *)(iVar3 + 0xb64) = 6; fVar10 = (fVar9 - fVar10) * 0.04; *(undefined4 *)(iVar3 + 0xbbc) = 0xc1000000; fVar9 = (fVar7 - fVar6) * 0.04; *(float *)(iVar3 + 0x360) = fVar10; *(float *)(iVar3 + 0xbb0) = fVar10; *(float *)(iVar3 + 0x364) = fVar9; *(float *)(iVar3 + 0xbb4) = fVar9; } } LAB_00517bb5: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00517d94; } LAB_00517d8a: npc->_state = 3; LAB_00517d94: fVar9 = (npc->_targetPosition).y; fVar7 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar9 - fVar7; return; } //@@ 00517de0 NpcAI::ENTITY_MRMAW /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 35 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MRMAW(Entity_NPC *npc) { byte bVar1; uint uVar2; Entity *tmpEntity; EntityPtr EVar3; int iVar4; Entity_NPC *linkedNpc; Entity_NPC *head; Vector *pVVar5; std_string *anim; LayerState *bodyLayer; ProjectileParams *params; void *pvVar6; int iVar7; float fVar8; float fVar9; float fVar10; undefined4 uVar11; TypeDescriptor *pTVar12; TypeDescriptor *pTVar13; undefined4 uVar14; Vector local_11c; float local_114; float local_110; Vector local_10c; EntityPtr *local_104; ProjectileParams projParams; std_string animName; std_string horiAnimName; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Room *room; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af43ad; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; iVar4 = npc->_variant; if (npc->_state == 0) { if ((iVar4 == 0) || (iVar4 == 2)) { ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uVar2 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; tmpEntity = Game::Spawn(g_game,0x23,npc->_variant + 1,&npc->_pos,&g_vectorZero,(Entity *)npc,0 ,uVar2); EVar3 = (EntityPtr)__RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); if (*(int *)((int)EVar3 + 0x3c0) != 0) { local_104 = (EntityPtr *)((int)EVar3 + 0x3c0); std::multiset::erase(&local_104); } *(int *)((int)EVar3 + 0x3c0) = (int)npc; std::multiset::insert((int *)((int)EVar3 + 0x3c0)); *(int *)((int)EVar3 + 0x188) = 2; *(int *)((int)EVar3 + 0x184) = 3; if (npc->_parent != (EntityPtr)0x0) { local_104 = &npc->_parent; std::multiset::erase(&local_104); } npc->_parent = EVar3; std::multiset::insert(&npc->_parent); *(int *)((int)EVar3 + 0x358) = 0x41200000; (**(code **)(*(int *)EVar3 + 0xc))(); local_110 = 0.0; do { uVar2 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; tmpEntity = Game::Spawn(g_game,0x23,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar2); iVar4 = __RTDynamicCast(tmpEntity,uVar11,pTVar12,pTVar13,uVar14); if (*(int *)(iVar4 + 0x3bc) != 0) { local_104 = (EntityPtr *)(iVar4 + 0x3bc); std::multiset::erase(&local_104); } *(undefined4 *)(iVar4 + 0x3bc) = npc; std::multiset::insert((undefined4 *)(iVar4 + 0x3bc)); *(undefined4 *)(iVar4 + 0x188) = 0; iVar7 = (int)local_110 + 1; *(undefined4 *)(iVar4 + 0x15c) = 0; *(undefined4 *)(iVar4 + 0x354) = 2000; *(uint *)(iVar4 + 0x168) = *(uint *)(iVar4 + 0x168) & 0xfffffffb | 0x40000; *(undefined4 *)(iVar4 + 0x16c) = *(undefined4 *)(iVar4 + 0x16c); *(undefined1 *)(iVar4 + 0x171) = 0; *(float *)(iVar4 + 0xbb0) = (float)(int)local_110; local_110 = (float)iVar7; } while (iVar7 < 8); } npc->_state = 4; ExceptionList = local_1c; return; } if ((iVar4 == 1) || (iVar4 == 3)) { ExceptionList = &local_1c; uVar2 = Random(); if (uVar2 % 10 == 0) { uVar2 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } if ((npc->_dead == 0) && ((uVar2 = Random(), uVar2 % 1000 != 0 || ((linkedNpc = Entity_NPC::ChildNPC(npc), linkedNpc != (Entity_NPC *)0x0 && (linkedNpc = Entity_NPC::ChildNPC(npc), linkedNpc->_controllerID != -1)))))) { if (npc->_child != (EntityPtr)0x0) { fVar10 = npc->_updateTime; fVar9 = npc->_prevUpdateTime; linkedNpc = Entity_NPC::ChildNPC(npc); iVar7 = linkedNpc->_projectileCooldown - ((int)fVar10 - (int)fVar9); iVar4 = -0x1e; if (-0x1e < iVar7) { iVar4 = iVar7; } linkedNpc = Entity_NPC::ChildNPC(npc); linkedNpc->_projectileCooldown = iVar4; linkedNpc = Entity_NPC::ChildNPC(npc); if (linkedNpc->_state != 4) { linkedNpc = Entity_NPC::ChildNPC(npc); if (linkedNpc->_state != 8) { ExceptionList = local_1c; return; } linkedNpc = Entity_NPC::ChildNPC(npc); local_114 = (linkedNpc->_pos).y - (npc->_pos).y; local_10c.y = (linkedNpc->_pos).x - (npc->_pos).x; local_104 = (EntityPtr *)sqrtf(local_114 * local_114 + local_10c.y * local_10c.y); if (((float)local_104 < 5.0) && (linkedNpc = Entity_NPC::ChildNPC(npc), linkedNpc->_projectileCooldown < 0xf)) { linkedNpc = Entity_NPC::ChildNPC(npc); linkedNpc->_state = 4; ExceptionList = local_1c; return; } if ((float)local_104 <= 0.0) { ExceptionList = local_1c; return; } linkedNpc = Entity_NPC::ChildNPC(npc); fVar10 = npc->_friction; fVar9 = ((float)linkedNpc->_projectileCooldown - -30.0) / 45.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } fVar9 = (1.4 - fVar9 * 0.7) / (float)local_104; if (fVar10 != 0.0) { fVar8 = npc->_speedMultiplier; (npc->_velocity).y = (fVar8 * fVar9 * local_114) / fVar10 + (npc->_velocity).y; (npc->_velocity).x = (fVar8 * fVar9 * local_10c.y) / fVar10 + (npc->_velocity).x; } linkedNpc = Entity_NPC::ChildNPC(npc); npc->_friction = ((float)linkedNpc->_projectileCooldown * 0.0028 + 0.9) * npc->_friction; ExceptionList = local_1c; return; } linkedNpc = Entity_NPC::ChildNPC(npc); if (linkedNpc->_controllerID == -1) { bVar1 = Entity::IsFrame((Entity *)npc,4,0); if (bVar1 == 0) { ExceptionList = local_1c; return; } if ((npc->_flags & 0x1000a00) != 0) { ExceptionList = local_1c; return; } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.y = (tmpEntity->_pos).x; local_114 = (tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar10 = ((tmpEntity->_velocity).x * 3.0 + local_10c.y) - (npc->_pos).x; local_114 = ((tmpEntity->_velocity).y * 3.0 + local_114) - (npc->_pos).y; local_10c.y = local_114 * local_114 + fVar10 * fVar10; if (16900.0 <= local_10c.y) { ExceptionList = local_1c; return; } if ((fVar10 == g_vectorZero.x) && (local_114 == g_vectorZero.y)) { ExceptionList = local_1c; return; } room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_11c.x = (tmpEntity->_pos).x; local_11c.y = (tmpEntity->_pos).y; bVar1 = Room::CheckLine(room,&npc->_pos,&local_11c,2,0,0,0,(Vector *)0x0); if (bVar1 == 0) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); fVar8 = sqrtf(local_10c.y); fVar9 = npc->_friction; (npc->_velocity).y = ((14.0 / fVar8) * local_114) / fVar9; (npc->_velocity).x = ((14.0 / fVar8) * fVar10) / fVar9; } else { if ((npc->_flags & 0x1000a00) != 0) { ExceptionList = local_1c; return; } linkedNpc = Entity_NPC::ChildNPC(npc); Entity_NPC::UpdateControllerMovement(linkedNpc,1); linkedNpc = Entity_NPC::ChildNPC(npc); bVar1 = Vector::operator_ne(&linkedNpc->_controllerMovement,&g_vectorZero); if (bVar1 == 0) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); linkedNpc = Entity_NPC::ChildNPC(npc); pVVar5 = Vector::Resized(&linkedNpc->_controllerMovement,&local_10c,14.0); fVar10 = npc->_friction; fVar9 = pVVar5->y; (npc->_velocity).x = pVVar5->x / fVar10; (npc->_velocity).y = fVar9 / fVar10; } linkedNpc = Entity_NPC::ChildNPC(npc); linkedNpc->_projectileCooldown = 0x1e; linkedNpc = Entity_NPC::ChildNPC(npc); linkedNpc->_state = 8; ExceptionList = local_1c; return; } } else if (npc->_child != (EntityPtr)0x0) { linkedNpc = Entity_NPC::ChildNPC(npc); Entity_NPC::Morph(linkedNpc,0xb,0,0,npc->_championColorIdx); linkedNpc->_health = linkedNpc->_maxHitPoints; linkedNpc->_entityCollisionClass = 4; if (npc->_variant == 3) { bodyLayer = ANM2::GetLayer(&linkedNpc->_sprite,(byte *)0x0); (bodyLayer->_color)._tint[0] = 1.0784315; (bodyLayer->_color)._tint[1] = 0.882353; (bodyLayer->_color)._tint[2] = 0.882353; } else { bodyLayer = ANM2::GetLayer(&linkedNpc->_sprite,(byte *)0x0); (bodyLayer->_color)._tint[0] = 1.3882353; (bodyLayer->_color)._tint[1] = 1.3882353; (bodyLayer->_color)._tint[2] = 1.3882353; } (bodyLayer->_color)._tint[3] = 1.0; } if ((npc->_dead != 0) && (npc->_variant == 3)) { params = ProjectileParams::ProjectileParams(&projParams); local_10c.x = 8.0; local_10c.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_10c,6,params); Entity_NPC::PlaySound(npc,0x92,1.0,2,0,1.0); } uVar11 = *(undefined4 *)((int)&npc->_flags + 4); iVar4 = npc->_championColorIdx; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(undefined4 *)((int)&npc->_flags + 4) = uVar11; Entity_NPC::Morph(npc,0x1a,(uint)(npc->_variant != 1),0,iVar4); npc->_entityCollisionClass = 4; npc->_health = npc->_maxHitPoints; ExceptionList = local_1c; return; } if (iVar4 == 10) { EVar3 = npc->_parent; if (((EVar3 == (EntityPtr)0x0) || (*(int *)((int)EVar3 + 0x28) != 0x23)) || (*(int *)((int)EVar3 + 0x3bc) == 0)) { ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); (**(code **)(*(int *)npc + 0x28))(local_24); ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); linkedNpc = Entity_NPC::ParentNPC(npc); if (linkedNpc->_state != 8) { npc->_visible = 0; ExceptionList = local_1c; return; } linkedNpc = Entity_NPC::ParentNPC(npc); if (linkedNpc->_parent == (EntityPtr)0x0) { ExceptionList = local_1c; return; } npc->_visible = 1; linkedNpc = Entity_NPC::ParentNPC(npc); head = Entity_NPC::ParentNPC(npc); head = Entity_NPC::ParentNPC(head); local_11c.y = (linkedNpc->_pos).x - (head->_pos).x; local_104 = (EntityPtr *)((linkedNpc->_pos).y - (head->_pos).y); local_110 = (7.0 - (npc->_v1).x) * 0.125; linkedNpc = Entity_NPC::ParentNPC(npc); fVar10 = local_11c.y * local_11c.y; (npc->_pos).x = (linkedNpc->_pos).x - local_110 * local_11c.y; local_11c.y = ABS((npc->_v1).x - 4.0); fVar10 = sqrtf((float)local_104 * (float)local_104 + fVar10); fVar10 = 100.0 - fVar10; if (fVar10 <= 0.0) { fVar10 = 0.0; } local_11c.y = (fVar10 * (16.0 - local_11c.y * local_11c.y)) / 100.0; linkedNpc = Entity_NPC::ParentNPC(npc); (npc->_pos).y = local_11c.y + (((linkedNpc->_pos).y - local_110 * (float)local_104) - 31.0) + (npc->_v1).x + 5.0; ExceptionList = local_1c; return; } if ((iVar4 != 0) && (iVar4 != 2)) { return; } if (npc->_state != 4) { ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.7; if (npc->_controllerID == -1) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); anim = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,&animName); local_14 = 4; ANM2::SetFrame(&npc->_sprite,anim,0); local_14 = 0xffffffff; if (0xf < animName._capacity) { uVar2 = animName._capacity + 1; pvVar6 = (void *)animName._buf._0_4_; if (0xfff < uVar2) { pvVar6 = *(void **)(animName._buf._0_4_ + -4); uVar2 = animName._capacity + 0x24; if (0x1f < (uint)(animName._buf._0_4_ + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar2); } animName._size = 0; animName._capacity = 0xf; animName._buf._0_8_ = animName._buf._0_8_ & 0xffffffffffffff00; } } else { builtin_strncpy(animName._buf + 8,"yVert",6); animName._capacity = 0xf; animName._size = 0xd; builtin_strncpy(animName._buf,"MrMawBod",8); builtin_strncpy(horiAnimName._buf + 8,"yHori",6); horiAnimName._capacity = 0xf; horiAnimName._size = 0xd; builtin_strncpy(horiAnimName._buf,"MrMawBod",8); local_14 = 3; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Entity_NPC::AnimWalkFrame(npc,&horiAnimName,&animName,0.1); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < horiAnimName._capacity) { uVar2 = horiAnimName._capacity + 1; pvVar6 = (void *)horiAnimName._buf._0_4_; if (0xfff < uVar2) { pvVar6 = *(void **)(horiAnimName._buf._0_4_ + -4); uVar2 = horiAnimName._capacity + 0x24; if (0x1f < (uint)(horiAnimName._buf._0_4_ + (-4 - (int)pvVar6))) goto LAB_00518619; } operator_delete(pvVar6,uVar2); } local_14 = 0xffffffff; horiAnimName._size = 0; horiAnimName._capacity = 0xf; horiAnimName._buf._0_8_ = horiAnimName._buf._0_8_ & 0xffffffffffffff00; if (0xf < animName._capacity) { uVar2 = animName._capacity + 1; pvVar6 = (void *)animName._buf._0_4_; if (0xfff < uVar2) { pvVar6 = *(void **)(animName._buf._0_4_ + -4); uVar2 = animName._capacity + 0x24; if (0x1f < (uint)(animName._buf._0_4_ + (-4 - (int)pvVar6))) { LAB_00518619: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar2); } if (npc->_variant == 2) { fVar10 = 0.4; } else { fVar10 = 0.3; } bVar1 = 1; iVar4 = 900; pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_10c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar5,fVar10,iVar4,bVar1); } goto LAB_005186e7; } builtin_strncpy(animName._buf + 8,"yVert",6); animName._capacity = 0xf; animName._size = 0xd; builtin_strncpy(animName._buf,"MrMawBod",8); builtin_strncpy(horiAnimName._buf + 8,"yHori",6); horiAnimName._capacity = 0xf; horiAnimName._size = 0xd; builtin_strncpy(horiAnimName._buf,"MrMawBod",8); local_14 = 1; ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Entity_NPC::AnimWalkFrame(npc,&horiAnimName,&animName,0.1); local_14 = local_14 & 0xffffff00; if (0xf < horiAnimName._capacity) { uVar2 = horiAnimName._capacity + 1; pvVar6 = (void *)horiAnimName._buf._0_4_; if (0xfff < uVar2) { pvVar6 = *(void **)(horiAnimName._buf._0_4_ + -4); uVar2 = horiAnimName._capacity + 0x24; if (0x1f < (uint)(horiAnimName._buf._0_4_ + (-4 - (int)pvVar6))) goto LAB_00518300; } operator_delete(pvVar6,uVar2); } local_14 = 0xffffffff; horiAnimName._size = 0; horiAnimName._capacity = 0xf; horiAnimName._buf._0_8_ = horiAnimName._buf._0_8_ & 0xffffffffffffff00; if (0xf < animName._capacity) { uVar2 = animName._capacity + 1; pvVar6 = (void *)animName._buf._0_4_; if (0xfff < uVar2) { pvVar6 = *(void **)(animName._buf._0_4_ + -4); uVar2 = animName._capacity + 0x24; if (0x1f < (uint)(animName._buf._0_4_ + (-4 - (int)pvVar6))) { LAB_00518300: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar2); } bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if ((bVar1 == 0) || (npc->_controllerID != -1)) { if (npc->_variant == 2) { fVar10 = 0.8; } else { fVar10 = 0.6; } bVar1 = 1; iVar4 = 900; pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_10c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar5,fVar10,iVar4,bVar1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (tmpEntity->_pos).x; local_10c.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_10c,0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if ((((bVar1 != 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (npc->_variant == 0)) && (uVar2 = Random(), uVar2 % 3 == 0)) goto LAB_0051840e; } else { bVar1 = Entity_NPC::IsControllerActionTriggered(npc,10); if (bVar1 != 0) { LAB_0051840e: Entity_NPC::PlaySound(npc,0xa5,1.0,0x28,0,1.0); } } if (npc->_parent != (EntityPtr)0x0) { local_11c.y = (npc->_velocity).x; local_104 = (EntityPtr *)(npc->_pos).x; local_114 = (npc->_pos).y; fVar10 = (npc->_velocity).y; linkedNpc = Entity_NPC::ParentNPC(npc); local_110 = (linkedNpc->_pos).x; local_10c.y = (linkedNpc->_pos).y; linkedNpc = Entity_NPC::ParentNPC(npc); (linkedNpc->_velocity).x = (local_11c.y + (float)local_104) - local_110; (linkedNpc->_velocity).y = (fVar10 + local_114) - local_10c.y; linkedNpc = Entity_NPC::ParentNPC(npc); (linkedNpc->_sprite)._flipX = (npc->_sprite)._flipX; } LAB_005186e7: if (npc->_dead == 0) { if (npc->_parent == (EntityPtr)0x0) { iVar4 = npc->_variant; Entity_NPC::Morph(npc,0xb,0,0,npc->_championColorIdx); npc->_health = npc->_maxHitPoints; bodyLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (bodyLayer->_color)._tint[3] = 1.0; if (iVar4 == 3) { (bodyLayer->_color)._tint[0] = 1.0784315; (bodyLayer->_color)._tint[1] = 0.882353; (bodyLayer->_color)._tint[2] = 0.882353; } else { (bodyLayer->_color)._tint[0] = 1.3882353; (bodyLayer->_color)._tint[1] = 1.3882353; (bodyLayer->_color)._tint[2] = 1.3882353; } } } else if (npc->_parent != (EntityPtr)0x0) { linkedNpc = Entity_NPC::ParentNPC(npc); Entity_NPC::Morph(linkedNpc,0x1a,(uint)(npc->_variant != 0),0,npc->_championColorIdx); linkedNpc->_entityCollisionClass = 4; linkedNpc->_health = linkedNpc->_maxHitPoints; } ExceptionList = local_1c; return; } //@@ 00518e20 NpcAI::ENTITY_SWARMER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 91 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SWARMER(Entity_NPC *npc) { undefined1 *puVar1; uint *puVar2; float fVar3; uint flagsHigh; byte bVar5; uint uVar6; ColorMod *extraout_EAX; ColorMod *splatColor; Entity *pEVar7; Vector *movementInput; int iVar8; LayerState *layer; int extraout_EAX_00; ColorMod *color; Entity_Effect *bloodEffect; ProjectileParams *params; float *pfVar9; Entity_Laser *laser; std_string *currentAnim; Entity_Player *skatoleOwner; Vector *pVVar10; char isBigShot; float *extraout_ECX; byte *pbVar11; void *pvVar12; byte *******pppppppbVar13; int lifetime; Entity_NPC *pEVar14; byte *pbVar15; Entity_NPC *pEVar16; float fVar17; float fVar18; Entity *pEVar19; Vector local_190; Vector local_188; Vector local_180; float aimY; Vector local_174; Vector local_16c; uint cleanupFlags; Vector local_160; Entity *local_154; char local_14d; float zero; Entity *local_148; char isPlanetoid; ProjectileParams projectileParams; void *currentAnimName [4]; uint currentAnimNameSize; uint currentAnimNameCapacity; undefined8 shootDownName; undefined1 local_78; undefined1 local_77; undefined4 shootDownNameSize; uint shootDownNameCapacity; byte *******shootUpName; undefined2 local_64; undefined1 local_62; undefined1 local_61; undefined4 shootUpNameSize; uint shootUpNameCapacity; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *animName; undefined4 flagsHigh; Game *game; code *setColorFn; pvVar12 = ExceptionList; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4442; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_154 = (Entity *)0x0; cleanupFlags = 0; if ((npc->_type != 0xe5) || (isPlanetoid = '\x01', npc->_variant != 1)) { isPlanetoid = '\0'; } local_160.y = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_16c.y = (float)npc; if ((npc->_aiCallPhase == 1) || (npc->_aiCallPhase == 2)) { uVar6 = (npc->_entityDeque)._size; if (uVar6 != 0) { while (flagsHigh = (npc->_entityDeque)._offset, *(int *)(*(int *)((int)(npc->_entityDeque)._map + (flagsHigh >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (flagsHigh & 3) * 4) == 0) { uVar6 = uVar6 - 1; (npc->_entityDeque)._size = uVar6; if (uVar6 == 0) goto LAB_0051a9d4; puVar2 = &(npc->_entityDeque)._offset; *puVar2 = *puVar2 + 1; } do { flagsHigh = (npc->_entityDeque)._size; uVar6 = ((npc->_entityDeque)._offset + flagsHigh) - 1; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar6 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar6 & 3) * 4) != 0) goto LAB_0051a9de; flagsHigh = flagsHigh - 1; (npc->_entityDeque)._size = flagsHigh; } while (flagsHigh != 0); LAB_0051a9d4: (npc->_entityDeque)._offset = 0; } LAB_0051a9de: local_160.y = (float)(npc->_entityDeque)._proxy; for (uVar6 = (npc->_entityDeque)._offset; uVar6 != (npc->_entityDeque)._offset + (npc->_entityDeque)._size; uVar6 = uVar6 + 1) { if ((int *)local_160.y == (int *)0x0) { iVar8 = 0; } else { iVar8 = *(int *)local_160.y; } iVar8 = *(int *)(*(int *)(*(int *)(iVar8 + 4) + (uVar6 >> 2 & *(int *)(iVar8 + 8) - 1U) * 4) + (uVar6 & 3) * 4); if (((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 9)) && (npc->_dead != 0)) { *(uint *)(iVar8 + 0x43c) = *(uint *)(iVar8 + 0x43c) & 0xfeffffff; *(undefined4 *)(iVar8 + 0x438) = *(undefined4 *)(iVar8 + 0x438); *(undefined4 *)(iVar8 + 0x418) = 0xbd23d70a; *(undefined4 *)(iVar8 + 0x430) = 0; } } if (npc->_dead == 0) { ExceptionList = pvVar12; return; } Entity_NPC::ClearDequeRefs(npc); ExceptionList = local_1c; return; } if (npc->_state == 0) { npc->_state = 4; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; npc->_stateFrame = 0; npc->_entityGridCollisionClass = 3; puStack_20 = local_50 + 0x4c; uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_154 = (Entity *)(fVar17 + fVar17); local_148 = (Entity *)cos((float)local_154); fVar17 = sin((float)local_154); (npc->_velocity).x = (float)local_148; (npc->_velocity).y = fVar17; if (npc->_type == 0x5b) { splatColor = (ColorMod *)local_50; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_30 = 0.0; local_50._16_4_ = 0.6; local_50._20_4_ = (void *)0x3ecccccd; fStack_38 = 0.4; fStack_34 = 1.0; local_2c = 0.0; local_28 = 0.0; } else { if (npc->_type != 0xe6) goto LAB_00518fda; Color::Color((Color *)local_50); splatColor = extraout_EAX; } Color::operator_assign((Color *)&npc->_splatColor,splatColor); LAB_00518fda: if (isPlanetoid != '\0') { npc->_aiCallFlags = npc->_aiCallFlags | 3; } ExceptionList = local_1c; return; } npc->_friction = npc->_friction * 0.77; puStack_20 = local_50 + 0x4c; pEVar7 = Entity_NPC::GetPlayerTarget(npc); pVVar10 = &npc->_pos; aimY = (pEVar7->_pos).y - (npc->_pos).y; local_154 = (Entity *)((pEVar7->_pos).x - pVVar10->x); zero = 0.0; local_148 = (Entity *)0x0; local_180.y = 0.0; if (isPlanetoid == '\0') { LAB_00519079: local_14d = '\0'; } else { bVar5 = Entity_NPC::IsControllerActionPressed(npc,9); local_14d = '\x01'; if (bVar5 == 0) goto LAB_00519079; } if (npc->_controllerID != -1) { movementInput = Entity_NPC::GetControllerMovementInput(npc,&local_174,0.1); local_180.y = movementInput->x; local_148 = (Entity *)movementInput->y; if ((isPlanetoid != '\0') && (bVar5 = Entity_NPC::IsControllerActionPressed(npc,9), bVar5 != 0)) { local_180.y = zero; local_148 = (Entity *)0x3f800000; } local_154 = (Entity *)(local_180.y * 100.0); aimY = (float)local_148 * 100.0; } local_188.y = (1.0 - npc->_health / npc->_maxHitPoints) * 0.1; iVar8 = Entity::GetIntervalTicks((Entity *)npc,5.0,zero); if (((iVar8 == 0) && (local_180.y == g_vectorZero.x)) && ((float)local_148 == g_vectorZero.y)) { if (npc->_stateFrame == 0) { (npc->_sprite)._flipX = (npc->_velocity).x <= zero && zero != (npc->_velocity).x; } } else { if (((isPlanetoid != '\0') && ((npc->_entityDeque)._size < 3)) && (uVar6 = Random(), uVar6 % 10 == 0)) { local_188.y = local_188.y + 0.1; } if (npc->_type == 0x5b) { fVar17 = 1.0 - local_188.y * 4.0; npc->_shadowSize = fVar17 * *(float *)((int)npc->_config + 0x24); local_190.y = fVar17 * g_vectorOne.x; local_174.y = fVar17 * g_vectorOne.y; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_size).x = local_190.y; (layer->_size).y = local_174.y; } pEVar16 = (Entity_NPC *)local_16c.y; if ((((((npc->_controllerID == -1) || (local_180.y != g_vectorZero.x)) || ((float)local_148 != g_vectorZero.y)) && ((npc->_v1).x <= local_188.y * 100.0 && local_188.y * 100.0 != (npc->_v1).x)) || (local_14d != '\0')) && (npc->_projectileCooldown == 0)) { pvVar12 = (npc->_sprite)._animState._animData; if ((pvVar12 != (void *)0x0) && (*(char *)((int)pvVar12 + 0x34) != '\0')) { (npc->_v1).x = (npc->_v1).x + 1.0; } iVar8 = npc->_type; if (iVar8 == 0x5b) { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } else if (((iVar8 == 0xe5) || (iVar8 == 0xfd)) || (iVar8 == 0xe6)) { if (isPlanetoid == '\0') { animName = "ShootUp"; pEVar16 = npc; if (zero <= aimY) { animName = "ShootDown"; } } else { local_174.y = (float)(npc->_entityDeque)._proxy; pEVar14 = (Entity_NPC *)(npc->_entityDeque)._offset; local_190.y = (float)((int)(&(pEVar14->_sprite)._filename + -3) + (npc->_entityDeque)._size); local_148 = (Entity *)0x0; while (pEVar14 != (Entity_NPC *)local_190.y) { if ((Entity_NPC *)local_174.y == (Entity_NPC *)0x0) { iVar8 = 0; } else { iVar8 = *(int *)local_174.y; } iVar8 = *(int *)(*(int *)(*(int *)(iVar8 + 4) + ((uint)pEVar14 >> 2 & *(int *)(iVar8 + 8) - 1U) * 4) + ((uint)pEVar14 & 3) * 4); if ((iVar8 == 0) || (*(int *)(iVar8 + 0x28) != 9)) { iVar8 = 0; } pEVar14 = (Entity_NPC *)&pEVar14->field_0x1; pEVar7 = (Entity *)&local_148->field_0x1; if (iVar8 == 0) { pEVar7 = local_148; } local_148 = pEVar7; } if (*(int *)((int)local_16c.y + 0xf1c) == -1) { if (((int)local_148 < 3) || (((uVar6 = Random(), uVar6 % 3 != 0 && ((int)local_148 < 6)) && (local_188.y <= 0.05) ))) { isBigShot = '\0'; } else { isBigShot = '\x01'; } } else { isBigShot = local_14d; } pVVar10 = (Vector *)((int)pEVar16 + 0x33c); animName = "Shoot"; if (isBigShot != '\0') { animName = &DAT_00b60df0; } } ANM2::Play(&pEVar16->_sprite,(byte *)animName,0); (pEVar16->_targetPosition).x = (float)local_154; (pEVar16->_targetPosition).y = aimY; npc = pEVar16; } (npc->_sprite)._flipX = (float)local_154 < zero; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; pEVar16 = (Entity_NPC *)g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_16c,0.1); (npc->_controllerMovement).x = local_16c.x; pEVar16 = (Entity_NPC *)local_16c.y; } (npc->_controllerMovement).y = (float)pEVar16; } } if (((npc->_type == 0x5b) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar5 != 0)) { Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); if ((npc->_sprite)._flipX == 0) { local_148 = (Entity *)0x3f800000; } else { local_148 = (Entity *)&DAT_bf800000; } uVar6 = Random(); local_16c.y = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_174.y = cos(local_16c.y); fVar17 = sin(local_16c.y); local_16c.y = (float)local_148 * local_174.y - fVar17 * zero; local_148 = (Entity *)((float)local_148 * fVar17 + local_174.y * zero); uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 3.0; local_190.y = fVar17 * (float)local_148; local_190.x = fVar17 * local_16c.y; local_174.y = local_190.y; local_16c.y = local_190.x; uVar6 = Random(); local_188.x = pVVar10->x + zero; local_188.y = pVVar10->y - 34.0; local_148 = Game::Spawn(g_game,1000,0x3b,&local_188,&local_190,(Entity *)npc,0,uVar6); local_180.y = 1.0; if (((local_148->_pos).x - pVVar10->x) * local_174.y + ((local_148->_pos).y - pVVar10->y) * -local_16c.y < zero) { local_180.y = (float)&DAT_bf800000; } uVar6 = Random(); pEVar7 = local_148; *(float *)(local_148[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * local_180.y; uVar6 = Random(); iVar8 = *(int *)pEVar7; lifetime = uVar6 % 0xf + 0xf; *(int *)(pEVar7[1]._sprite._filename._buf + 8) = lifetime; *(int *)(pEVar7[1]._sprite._filename._buf + 0xc) = lifetime; setColorFn = *(code **)(iVar8 + 0x3c); uVar6 = Random(); local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_30 = 0.0; local_2c = 0.0; local_28 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = (void *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_50._12_4_ = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; (*setColorFn)(local_50,0xffffffff,0xff,0,1); (**(code **)(*(int *)local_148 + 0xc))(); fVar17 = (npc->_v1).x; if (npc->_controllerID == -1) { fVar18 = (npc->_v1).y; } else { fVar18 = fVar17 - 0.1; (npc->_v1).y = fVar18; } if (fVar18 < fVar17) { do { uVar6 = Random(); local_16c.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 1.0 + (npc->_v1).y; (npc->_v1).y = local_16c.y; iVar8 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar8 < 7) { uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; fVar17 = cos(fVar17 + fVar17); local_174.x = (float)local_154 * 0.1 + fVar17 * 10.0; uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; fVar17 = sin(fVar17 + fVar17); local_174.y = aimY * 0.1 + fVar17 * 10.0; uVar6 = Random(); Game::Spawn(g_game,0xe,0,&npc->_pos,&local_174,(Entity *)npc,0,uVar6); pEVar16 = (Entity_NPC *)(npc->_v1).y; } else { pEVar16 = (Entity_NPC *)local_16c.y; } } while ((float)pEVar16 < (npc->_v1).x); } } if (npc->_controllerID != -1) { fVar17 = (npc->_v1).x; if (-2.0 < fVar17) { local_174.y = -2.0; local_16c.y = fVar17 - npc->_speedMultiplier / 60.0; pVVar10 = &local_16c; if (local_16c.y <= -2.0) { pVVar10 = &local_174; } (npc->_v1).x = pVVar10->y; } pvVar12 = (npc->_sprite)._animState._animData; if ((pvVar12 == (void *)0x0) || (*(char *)((int)pvVar12 + 0x34) == '\0')) { Entity_NPC::UpdateControllerMovement(npc,0); bVar5 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero); if (bVar5 != 0) { (npc->_targetPosition).x = *extraout_ECX; (npc->_targetPosition).y = extraout_ECX[1]; } } } iVar8 = npc->_type; if (iVar8 == 0x5b) { uVar6 = Random(); if (((uVar6 % 100 == 0) && (iVar8 = Entity_NPC::GetAliveEnemyCount(npc), iVar8 < 10)) && (bVar5 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar5 == 0)) { uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; fVar17 = sin(fVar17 + fVar17); local_16c.y = fVar17 * 10.0; uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; local_174.x = cos(fVar17 + fVar17); local_174.x = local_174.x * 10.0; local_174.y = local_16c.y; uVar6 = Random(); pEVar7 = Game::Spawn(g_game,0x12,0,&npc->_pos,&local_174,(Entity *)npc,0,uVar6); flagsHigh = *(undefined4 *)((int)&pEVar7->_flags + 4); *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar7->_flags + 4) = flagsHigh; } } else if ((((((iVar8 == 0xe5) || (iVar8 == 0xfd)) || (iVar8 == 0xe6)) && (npc->_controllerID == -1) ) && ((uVar6 = Random(), uVar6 % 100 == 0 || (((isPlanetoid != '\0' && ((npc->_entityDeque)._size < 5)) && (uVar6 = Random(), uVar6 % 0x28 == 0)))))) && ((bVar5 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar5 == 0 && (npc->_projectileCooldown == 0)))) { if (isPlanetoid == '\0') { animName = "ShootUp"; if (zero <= aimY) { animName = "ShootDown"; } } else { animName = "Shoot"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); (npc->_targetPosition).y = aimY; (npc->_targetPosition).x = (float)local_154; (npc->_sprite)._flipX = (float)local_154 < zero; } pVVar10 = &npc->_pos; npc->_stateFrame = (int)(&((ANM2 *)((int)local_160.y + 0x48))->_filename + -3) + npc->_stateFrame; fVar17 = (npc->_v2).x; if (zero < fVar17) { (npc->_v2).x = fVar17 - npc->_speedMultiplier; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { iVar8 = npc->_type; if (iVar8 != 0x5b) goto LAB_00519d09; animName = (char *)s_Idle; LAB_00519d56: ANM2::Play(&npc->_sprite,(byte *)animName,0); LAB_00519d5b: npc->_stateFrame = 0; } else if ((((npc->_flags & 0x1000a00) != 0) && (npc->_type != 0x5b)) && (bVar5 = Entity::IsFrame((Entity *)npc,0xf,npc->_index), bVar5 != 0)) { iVar8 = npc->_type; LAB_00519d09: if (((iVar8 == 0xe5) || (iVar8 == 0xfd)) || (iVar8 == 0xe6)) { if (isPlanetoid == '\0') { if (zero <= aimY) { animName = "FloatDown"; } else { animName = "FloatUp"; } } else { animName = "Float"; } goto LAB_00519d56; } goto LAB_00519d5b; } iVar8 = npc->_type; if (iVar8 == 0xe5) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar5 != 0)) { if (isPlanetoid == '\0') { Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); params = ProjectileParams::ProjectileParams(&projectileParams); local_160.x = 10.0; local_160.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar10,&local_160,9,params); } else { bVar5 = ANM2::IsPlaying(&npc->_sprite,&DAT_00b60df0); game = g_game; if (bVar5 == 0) { uVar6 = Random(); pEVar7 = (Entity *)((uVar6 & 1) + 1); local_148 = pEVar7; uVar6 = Random(); local_154 = (Entity *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0); local_174.y = 360.0 / (float)(int)pEVar7; ProjectileParams::ProjectileParams(&projectileParams); projectileParams.BulletFlags._0_4_ = 0x3000; if ((npc->_initSeed & 1) == 0) { projectileParams.BulletFlags._0_4_ = 0x2800; } projectileParams.TargetPosition.x = (npc->_pos).x; projectileParams.TargetPosition.y = (npc->_pos).y; projectileParams.BulletFlags._4_4_ = 0x1000000; if (pEVar7 != (Entity *)0x0) { do { local_160.y = (float)local_154 * 0.017453292; local_16c.y = sin(local_160.y); fVar17 = cos(local_160.y); local_190.x = fVar17 * 8.0; local_190.y = local_16c.y * 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_190,0,&projectileParams); *(undefined4 *)(extraout_EAX_00 + 0x430) = 0x42a00000; *(undefined4 *)(extraout_EAX_00 + 0x414) = 0; *(undefined4 *)(extraout_EAX_00 + 0x418) = 0xbdc28f5c; if (*(int *)(extraout_EAX_00 + 0x3bc) != 0) { local_160.y = (float)(extraout_EAX_00 + 0x3bc); std::multiset::erase(&local_160.y); } *(undefined4 *)(extraout_EAX_00 + 0x3bc) = npc; std::multiset::insert((undefined4 *)(extraout_EAX_00 + 0x3bc)); local_160.y = 0.0; std::deque::push_front(&local_160.y); local_160.y = (float)((npc->_entityDeque)._offset + (npc->_entityDeque)._size); puVar1 = (undefined1 *) ((int)&((Entity_NPC *)((int)local_160.y + -0xf54))->_pickupGhostsEntity + 3); uVar6 = (uint)puVar1 & 3; iVar8 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & (uint)puVar1 >> 2) * 4); local_16c.y = (float)(iVar8 + uVar6 * 4); if (*(int *)(iVar8 + uVar6 * 4) != 0) { local_160.y = local_16c.y; std::multiset::erase(&local_160.y); } *(int *)local_16c.y = extraout_EAX_00; std::multiset::insert(local_16c.y); local_148 = (Entity *)((int)&local_148[-1]._luaBridgeRef + 3); local_154 = (Entity *)(local_174.y + (float)local_154); } while (local_148 != (Entity *)0x0); } Color::Color((Color *)local_50); local_160.x = 0.0; local_160.y = -18.0; bloodEffect = (Entity_Effect *) spawn_blood_explosion(3,&npc->_pos,&local_160,color,&g_vectorZero); Entity_Effect::FollowParent(bloodEffect,(Entity *)npc); bloodEffect->_renderDepthOffset = -10.0; Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); } else { (npc->_v2).x = 60.0; Game::ButterBeanFart(game,pVVar10,120.0,(Entity *)npc,1,0); local_160.y = (float)(npc->_entityDeque)._proxy; for (local_180.y = (float)(npc->_entityDeque)._offset; (undefined1 *)local_180.y != (undefined1 *)((npc->_entityDeque)._size + (npc->_entityDeque)._offset); local_180.y = (float)((int)local_180.y + 1)) { if ((Entity_NPC *)local_160.y == (Entity_NPC *)0x0) { iVar8 = 0; } else { iVar8 = *(int *)local_160.y; } iVar8 = *(int *)(*(int *)(*(int *)(iVar8 + 4) + ((uint)local_180.y >> 2 & *(int *)(iVar8 + 8) - 1U) * 4) + ((uint)local_180.y & 3) * 4); if ((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 9)) { local_148 = *(Entity **)(iVar8 + 0x364); local_154 = *(Entity **)(iVar8 + 0x360); *(undefined4 *)(iVar8 + 0x430) = 0; *(undefined4 *)(iVar8 + 0x410) = 0xc1b80000; *(undefined4 *)(iVar8 + 0x414) = 0; *(undefined4 *)(iVar8 + 0x418) = 0xbdae147b; fVar17 = sqrtf((float)local_148 * (float)local_148 + (float)local_154 * (float)local_154); if (fVar17 <= zero) { pEVar19 = local_148; pEVar7 = local_154; } else { pEVar19 = (Entity *)((float)local_148 * (10.0 / fVar17)); pEVar7 = (Entity *)((float)local_154 * (10.0 / fVar17)); } *(uint *)(iVar8 + 0x43c) = *(uint *)(iVar8 + 0x43c) & 0xfeffffff; *(Entity **)(iVar8 + 0x360) = pEVar7; *(Entity **)(iVar8 + 0x364) = pEVar19; *(undefined4 *)(iVar8 + 0x438) = *(undefined4 *)(iVar8 + 0x438); } } Entity_NPC::ClearDequeRefs(npc); } } } } else if (iVar8 == 0xfd) { bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar5 != 0) { Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projectileParams); projectileParams.BulletFlags._0_4_ = (uint)projectileParams.BulletFlags | 1; local_160.x = 10.0; local_160.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar10,&local_160,9,&projectileParams); } } else if (iVar8 == 0xe6) { if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown + -1; } bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if ((bVar5 != 0) && (bVar5 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),pVVar10), bVar5 != 0) ) { pfVar9 = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"ShootPos"); local_160.y = pfVar9[1] / 0.65; local_160.x = *pfVar9 / 0.65; fVar17 = atan2f((npc->_targetPosition).y,(npc->_targetPosition).x); laser = Entity_Laser::ShootAngle(2,pVVar10,fVar17 * 57.295776,3,&local_160,(Entity *)npc,0); if (zero <= aimY) { fVar17 = 3000.0; } else { fVar17 = -10.0; } laser->_renderDepthOffset = fVar17; (**(code **)(*(int *)laser + 0xc))(); npc->_projectileCooldown = 0x3c; } } uVar6 = cleanupFlags; if (npc->_type == 0xe6) { shootUpName = (byte *******)0x6f6f6853; local_64 = 0x5574; shootUpNameCapacity = 0xf; shootUpNameSize = 7; local_62 = 0x70; local_61 = 0; local_14 = 0; local_154 = (Entity *)(cleanupFlags | 1); currentAnim = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState, (std_string *)(local_50 + 0x14)); local_14 = 1; puVar2 = ¤tAnim->_size; pppppppbVar13 = (byte *******)&shootUpName; if (0xf < shootUpNameCapacity) { pppppppbVar13 = shootUpName; } if (0xf < currentAnim->_capacity) { currentAnim = *(std_string **)currentAnim->_buf; } cleanupFlags = uVar6 | 3; bVar5 = str_eq((byte *)currentAnim,*puVar2,(byte *)pppppppbVar13,7); uVar6 = uVar6 | 3; if (bVar5 == 0) goto LAB_0051a432; pbVar15 = (byte *)shootDownName; LAB_0051a4b1: local_14d = '\x01'; } else { LAB_0051a432: shootDownNameCapacity = 0xf; shootDownNameSize = 9; shootDownName = 0x776f44746f6f6853; local_78 = 0x6e; local_77 = 0; local_14 = 2; local_154 = (Entity *)(uVar6 | 4); currentAnim = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState, (std_string *)currentAnimName); cleanupFlags = uVar6 | 0xc; pbVar15 = (byte *)shootDownName; pbVar11 = (byte *)&shootDownName; if (0xf < shootDownNameCapacity) { pbVar11 = (byte *)shootDownName; } puVar2 = ¤tAnim->_size; if (0xf < currentAnim->_capacity) { currentAnim = *(std_string **)currentAnim->_buf; } bVar5 = str_eq((byte *)currentAnim,*puVar2,pbVar11,9); local_14d = '\0'; if (bVar5 != 0) goto LAB_0051a4b1; } if ((cleanupFlags & 8) != 0) { cleanupFlags = cleanupFlags & 0xfffffff7; if (0xf < currentAnimNameCapacity) { uVar6 = currentAnimNameCapacity + 1; pvVar12 = currentAnimName[0]; if (0xfff < uVar6) { pvVar12 = *(void **)((int)currentAnimName[0] + -4); uVar6 = currentAnimNameCapacity + 0x24; if (0x1f < (uint)((int)currentAnimName[0] + (-4 - (int)pvVar12))) goto LAB_0051a5f7; } operator_delete(pvVar12,uVar6); } currentAnimNameSize = 0; currentAnimNameCapacity = 0xf; currentAnimName[0] = (void *)((uint)currentAnimName[0] & 0xffffff00); } local_14 = 1; if (((cleanupFlags & 4) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffb, 0xf < shootDownNameCapacity)) { uVar6 = shootDownNameCapacity + 1; pbVar11 = pbVar15; if (0xfff < uVar6) { pbVar11 = *(byte **)(pbVar15 + -4); uVar6 = shootDownNameCapacity + 0x24; if ((byte *)0x1f < pbVar15 + (-4 - (int)pbVar11)) goto LAB_0051a5f7; } operator_delete(pbVar11,uVar6); } local_14 = 0; if ((cleanupFlags & 2) != 0) { cleanupFlags = cleanupFlags & 0xfffffffd; if (0xf < (uint)local_28) { uVar6 = (int)local_28 + 1; pvVar12 = (void *)local_50._20_4_; if (0xfff < uVar6) { pvVar12 = *(void **)(local_50._20_4_ + -4); uVar6 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar12))) goto LAB_0051a5f7; } operator_delete(pvVar12,uVar6); } local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = local_50._20_4_ & 0xffffff00; } local_14 = 0xffffffff; if (((cleanupFlags & 1) != 0) && (0xf < shootUpNameCapacity)) { uVar6 = shootUpNameCapacity + 1; pppppppbVar13 = shootUpName; if (0xfff < uVar6) { pppppppbVar13 = (byte *******)shootUpName[-1]; uVar6 = shootUpNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)shootUpName + (-4 - (int)pppppppbVar13))) { LAB_0051a5f7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar13,uVar6); } if (local_14d == '\0') { fVar17 = npc->_friction * 0.9; } else { fVar17 = npc->_friction * 0.2; } npc->_friction = fVar17; if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { local_154 = (Entity *)0x3ee66666; skatoleOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1); if ((skatoleOwner == (Entity_Player *)0x0) || ((npc->_type != 0x5b || (bVar5 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar5 != 0)))) { local_148 = (Entity *)0x3ee66666; } else { local_148 = (Entity *)0x3e800000; local_154 = (Entity *)0x3e800000; } if (isPlanetoid != '\0') { local_154 = (Entity *)((float)local_148 * 1.8); local_148 = local_154; } pEVar7 = local_148; if ((npc->_velocity).x <= zero && zero != (npc->_velocity).x) { local_148 = (Entity *)((uint)local_148 ^ 0x80000000); } pfVar9 = &(npc->_velocity).y; if (*pfVar9 <= zero && zero != *pfVar9) { pEVar7 = (Entity *)((uint)pEVar7 ^ 0x80000000); local_154 = pEVar7; } pEVar19 = local_148; if (npc->_controllerID != -1) { pVVar10 = Entity_NPC::GetControllerInput(npc,&local_160,zero); fVar17 = sqrtf((float)local_154 * (float)local_154 + (float)local_148 * (float)local_148); pEVar7 = (Entity *)((float)local_154 + fVar17 * 0.5 * pVVar10->y); pEVar19 = (Entity *)(fVar17 * 0.5 * pVVar10->x + (float)local_148); } fVar17 = npc->_friction; if (fVar17 != zero) { fVar18 = npc->_speedMultiplier; (npc->_velocity).x = ((float)pEVar19 * fVar18) / fVar17 + (npc->_velocity).x; (npc->_velocity).y = ((float)pEVar7 * fVar18) / fVar17 + (npc->_velocity).y; } if (((npc->_flags & 0x1000800) != 0) && (npc->_controllerID == -1)) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_160.y = -((pEVar7->_pos).y - (npc->_pos).y); local_160.x = -((pEVar7->_pos).x - (npc->_pos).x); fVar17 = sqrtf(local_160.y * local_160.y + local_160.x * local_160.x); fVar17 = (80.0 - fVar17) * 0.02; if (fVar17 <= zero) { fVar17 = zero; } if (1.0 <= fVar17) { fVar17 = 1.0; } pVVar10 = Vector::Resized(&local_160,&local_180,fVar17); fVar17 = npc->_friction; if (fVar17 != zero) { fVar18 = npc->_speedMultiplier; fVar3 = pVVar10->y; (npc->_velocity).x = (fVar18 * pVVar10->x) / fVar17 + (npc->_velocity).x; (npc->_velocity).y = (fVar18 * fVar3) / fVar17 + (npc->_velocity).y; } } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } if (npc->_dead == 0) { ExceptionList = local_1c; return; } if (npc->_type != 0x5b) { ExceptionList = local_1c; return; } if (npc->_championRegenCount == 0) { uVar6 = Random(); pEVar7 = Game::Spawn(g_game,0x19,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6); pEVar7->_entityGridCollisionClass = 3; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } //@@ 0051aaa0 NpcAI::ENTITY_GURGLE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 87 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GURGLE(Entity_NPC *npc) { byte bVar1; uint uVar2; undefined4 *damageEvent; uint uVar3; Entity *tmpEntity; int *splat; Vector *pVVar4; ProjectileParams *params; Entity_Projectile *projectile; ColorMod *color; byte *animNameChar; void *freeBlock; undefined4 extraout_ECX; byte *targetAnimChar; bool isLess; float fVar5; int iVar6; undefined4 uVar7; TypeDescriptor *pTVar8; int framedelay; TypeDescriptor *pTVar9; undefined4 uVar10; undefined4 local_198 [11]; undefined4 local_16c [11]; Vector local_140; Vector local_138; Vector scratchVec; ProjectileParams projParams; undefined1 local_7c [24]; float fStack_64; float fStack_60; float local_58; float local_54; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; float fallingSpeed; float projVelY; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4485; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_50 + 0x40); iVar6 = npc->_state; if (iVar6 == 0) { color = &npc->_splatColor; npc->_state = 4; if (color != (ColorMod *)local_16c) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = -0.19607845; (npc->_splatColor)._offset[1] = 0.50980395; color->_tint[0] = 0.5; (npc->_splatColor)._tint[1] = 0.5; (npc->_splatColor)._tint[2] = 0.5; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.19607845; } if (npc->_variant != 1) { return; } if (color == (ColorMod *)local_198) { return; } color->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.1; (npc->_splatColor)._offset[0] = 1.0; (npc->_splatColor)._offset[1] = 0.5137255; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.003921569; return; } stackCookie = uVar2; if (npc->_dead != 0) { if (npc->_health <= -25.0) { return; } ExceptionList = &local_1c; puStack_20 = local_50 + 0x4c; uVar2 = Random(); if (0xe < uVar2 % 100) { ExceptionList = local_1c; return; } if (npc->_variant == 0) { Entity_NPC::Morph(npc,0xee,0,0,-1); npc->_dead = 0; npc->_health = npc->_maxHitPoints; uVar2 = Random(); npc->_projectileCooldown = uVar2 % 0x14 + 0x14; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } ExceptionList = &local_1c; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { local_140.y = (float)damageEvent[3]; if (((damageEvent[2] & 6) != 0) && ((((((uint)damageEvent[0xc] >> 1 & 1) == 0 && (damageEvent[4] != 1)) && (damageEvent[6] != 1)) && ((damageEvent[6] != 3 && ((damageEvent[2] & 0x1000) == 0)))))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); iVar6 = npc->_state; } if (iVar6 == 4) { puStack_20 = local_50 + 0x4c; uVar3 = Random(); if (uVar3 % 10 == 0) { uVar3 = Random(); local_138.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; uVar3 = Random(); scratchVec.x = (npc->_pos).x + 0.0; scratchVec.y = (npc->_pos).y + 1.0; uVar10 = 0; pTVar9 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar7 = 0; tmpEntity = Game::Spawn(g_game,1000,7,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar3); splat = (int *)__RTDynamicCast(tmpEntity,uVar7,pTVar8,pTVar9,uVar10,uVar2); splat[0x39] = (int)local_138.y; splat[0x3a] = (int)local_138.y; if (npc->_variant == 0) { local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; color = (ColorMod *)local_50; local_2c = 0.5; local_50._0_4_ = 0.0; local_50._4_4_ = 1.0; local_50._8_4_ = 0.0; local_50._12_4_ = 1.0; local_28 = 0.0; } else { color = &npc->_splatColor; } (**(code **)(*splat + 0x3c))(color,0xffffffff,0xff,0,1); (**(code **)(*splat + 0xc))(); } local_28 = 2.10195e-44; local_2c = 1.12104e-44; local_50[0x14] = 'W'; local_50[0x15] = 'a'; local_50[0x16] = 'l'; local_50[0x17] = 'k'; fStack_38 = (float)0x69726f48; fStack_34 = (float)((uint)fStack_34 & 0xffffff00); local_54 = 2.10195e-44; local_58 = 1.12104e-44; local_7c[0x14] = 'W'; local_7c[0x15] = 'a'; local_7c[0x16] = 'l'; local_7c[0x17] = 'k'; fStack_64 = (float)0x69726f48; fStack_60 = (float)((uint)fStack_60 & 0xffffff00); local_14 = 1; Entity_NPC::AnimWalkFrame (npc,(std_string *)(local_7c + 0x14),(std_string *)(local_50 + 0x14),0.1); local_14 = local_14 & 0xffffff00; if (0xf < (uint)local_54) { uVar2 = (int)local_54 + 1; freeBlock = (void *)local_7c._20_4_; if (0xfff < uVar2) { freeBlock = *(void **)(local_7c._20_4_ + -4); uVar2 = (int)local_54 + 0x24; if (0x1f < (uint)(local_7c._20_4_ + (-4 - (int)freeBlock))) goto LAB_0051aea6; } operator_delete(freeBlock,uVar2); } local_14 = 0xffffffff; local_58 = 0.0; local_54 = 2.10195e-44; local_7c._20_4_ = local_7c._20_4_ & 0xffffff00; if (0xf < (uint)local_28) { uVar2 = (int)local_28 + 1; freeBlock = (void *)local_50._20_4_; if (0xfff < uVar2) { freeBlock = *(void **)(local_50._20_4_ + -4); uVar2 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)freeBlock))) { LAB_0051aea6: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { bVar1 = 1; iVar6 = 0; fVar5 = 0.6; pVVar4 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar4,fVar5,iVar6,bVar1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if (((bVar1 == 0) || ((npc->_pathfinder)._hasDirectPath == 0)) || (uVar2 = Random(), uVar2 % 3 != 0)) goto LAB_0051aff5; } else { bVar1 = input_is_action_triggered(g_manager,10,npc->_controllerID,(Entity *)npc,0); if (bVar1 == 0) goto LAB_0051aff5; } if (npc->_variant == 0) { framedelay = 0x28; iVar6 = 0xa5; } else { if ((npc->_variant != 1) || (uVar2 = Random(), uVar2 % 3 != 0)) goto LAB_0051aff5; framedelay = 0x78; iVar6 = 0xa7; } Entity_NPC::PlaySound(npc,iVar6,1.0,framedelay,0,1.0); LAB_0051aff5: (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; if (npc->_controllerID == -1) { uVar2 = Random(); bVar1 = uVar2 % 0x3c == 0; } else { bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if (bVar1 == 0) { ExceptionList = local_1c; return; } if (npc->_spawnerType == 0x38a) { ExceptionList = local_1c; return; } if ((npc->_flags & 0x1000a00) != 0) { ExceptionList = local_1c; return; } Entity_NPC::UpdateControllerMovement(npc,1); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_138.y = (npc->_pos).x - (tmpEntity->_pos).x; fVar5 = (npc->_pos).y - (tmpEntity->_pos).y; if (npc->_controllerID != -1) { local_138.y = (npc->_controllerMovement).x; fVar5 = (npc->_controllerMovement).y; } if (16900.0 <= fVar5 * fVar5 + local_138.y * local_138.y) { ExceptionList = local_1c; return; } npc->_stateFrame = 0; npc->_state = 8; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } (npc->_sprite)._flipX = 0.0 < local_138.y; ExceptionList = local_1c; return; } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar5 = g_vectorZero.y; puStack_20 = local_50 + 0x4c; } else { Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.1); if ((scratchVec.x == g_vectorZero.x) && (scratchVec.y == g_vectorZero.y)) goto LAB_0051b1a4; (npc->_controllerMovement).x = scratchVec.x; fVar5 = scratchVec.y; } (npc->_controllerMovement).y = fVar5; LAB_0051b1a4: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_138.x = (tmpEntity->_pos).x; local_138.y = (tmpEntity->_pos).y; if ((npc->_controllerID != -1) && ((fVar5 = (npc->_controllerMovement).x, fVar5 != g_vectorZero.x || ((npc->_controllerMovement).y != g_vectorZero.y)))) { local_138.x = fVar5 * 150.0 + (npc->_pos).x; local_138.y = (npc->_controllerMovement).y * 150.0 + (npc->_pos).y; } Entity_NPC::PlaySound(npc,0xd5,0.7,2,0,1.0); params = ProjectileParams::ProjectileParams(&projParams); projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_138,10.0,params); iVar6 = npc->_variant; uVar2 = (uint)projectile->_projectileFlags; uVar3 = *(uint *)((int)&projectile->_projectileFlags + 4); projectile->_scale = 1.6; if (iVar6 == 1) { *(uint *)((int)&projectile->_projectileFlags + 4) = uVar3 | 8; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; *(uint *)&projectile->_projectileFlags = uVar2; local_30 = 1.0; local_2c = 0.3; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_28 = 0.0; (**(code **)(*(int *)projectile + 0x3c))(local_50,0xffffffff,0xff,0,1); color = &(projectile->_sprite)._color; if ((npc->_sprite)._flipX == 0) { scratchVec.x = 8.0; } else { scratchVec.x = -8.0; } pVVar4 = &local_138; local_138.x = (npc->_pos).x + 0.0; local_138.y = (npc->_pos).y + 2.0; } else { *(uint *)((int)&projectile->_projectileFlags + 4) = uVar3; *(uint *)&projectile->_projectileFlags = uVar2 | 2; Color::Color((Color *)local_7c); local_7c._16_4_ = 0.4; local_7c._20_4_ = 2.0; fStack_64 = 0.5; fStack_60 = 1.0; (**(code **)(*(int *)projectile + 0x3c))(extraout_ECX,0xffffffff,0xff,0,1); if ((npc->_sprite)._flipX == 0) { scratchVec.x = 8.0; } else { scratchVec.x = -8.0; } color = (ColorMod *)local_7c; pVVar4 = &local_140; local_140.x = (npc->_pos).x + 0.0; local_140.y = (npc->_pos).y + 2.0; } scratchVec.y = -15.0; spawn_blood_explosion(2,pVVar4,&scratchVec,color,&g_vectorZero); fVar5 = (projectile->_velocity).x; projVelY = (projectile->_velocity).y; projectile->_fallingAccel = projectile->_fallingAccel - 0.6; fallingSpeed = projectile->_fallingSpeed; (projectile->_velocity).x = fVar5 * 0.55; (projectile->_velocity).y = projVelY * 0.55; projectile->_fallingSpeed = fallingSpeed * 0.7 - 3.0; } npc->_friction = npc->_friction * 0.7; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } targetAnimChar = s_Idle; do { bVar1 = *animNameChar; isLess = bVar1 < *targetAnimChar; if (bVar1 != *targetAnimChar) { LAB_0051b510: uVar2 = -(uint)isLess | 1; goto LAB_0051b515; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < targetAnimChar[1]; if (bVar1 != targetAnimChar[1]) goto LAB_0051b510; animNameChar = animNameChar + 2; targetAnimChar = targetAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0051b515: if (uVar2 == 0) { if (animData[0x34] == 0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._isPlaying != 0) { ExceptionList = local_1c; return; } } } bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } ExceptionList = local_1c; return; } //@@ 0051b570 NpcAI::ENTITY_WALKINGBOIL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 88 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WALKINGBOIL(Entity_NPC *npc) { byte bVar1; undefined4 *damageEvent; Entity *pEVar2; int iVar3; byte *curAnimChar; ProjectileParams *pPVar4; Entity_Projectile *projectile; Vector *pVVar5; int gridIndex; void *freePtr; char *animName; undefined4 extraout_ECX; Vector *outPos; Room *room; uint uVar6; bool isLess; float fVar7; float fVar8; float fVar9; undefined4 uVar10; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; Vector freePosNear; undefined4 local_18c [11]; undefined4 local_160 [11]; Vector freePos; Entity_NPC *local_12c; Vector local_128; Vector local_120; char isAimedAtPlayer; ProjectileParams projParams; undefined1 local_68 [24]; float fStack_50; float fStack_4c; uint vertAnimSize; uint vertAnimCapacity; void *walkAnimName; char local_38 [12]; uint walkAnimSize; uint walkAnimCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; float npcY; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af44c5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); if (npc->_state == 0) { npc->_state = 4; if (npc->_variant == 1) { if (&npc->_splatColor == (ColorMod *)local_160) { return; } (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.5; (npc->_splatColor)._tint[0] = 0.2; (npc->_splatColor)._tint[1] = 1.0; (npc->_splatColor)._tint[2] = 0.2; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } if (npc->_variant != 2) { return; } if (&npc->_splatColor == (ColorMod *)local_18c) { return; } (npc->_splatColor)._offset[0] = 1.0; (npc->_splatColor)._offset[1] = 1.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 1.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } ExceptionList = &local_1c; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { local_120.y = (float)damageEvent[3]; if (((damageEvent[2] & 4) != 0) && ((((((uint)damageEvent[0xc] >> 1 & 1) == 0 && (damageEvent[4] != 1)) && (damageEvent[6] != 1)) && ((damageEvent[6] != 3 && ((damageEvent[2] & 0x1000) == 0)))))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } npc->_friction = npc->_friction * 0.75; local_12c = npc; pEVar2 = Entity_NPC::GetPlayerTarget(npc); fVar7 = (pEVar2->_pos).y - (npc->_pos).y; fVar8 = (pEVar2->_pos).x - (npc->_pos).x; local_128.y = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (npc->_state == 4) { if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } else { pEVar2 = Entity_NPC::GetPlayerTarget(npc); local_120.x = (pEVar2->_pos).x; local_120.y = (pEVar2->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_120,0); npc->_friction = npc->_friction * 0.8; } vertAnimCapacity = 0xf; vertAnimSize = 8; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; fStack_50 = (float)0x74726556; fStack_4c = (float)((uint)fStack_4c & 0xffffff00); walkAnimCapacity = 0xf; walkAnimSize = 8; walkAnimName = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimName,(std_string *)(local_68 + 0x14),0.1); local_14 = local_14 & 0xffffff00; if (0xf < walkAnimCapacity) { uVar6 = walkAnimCapacity + 1; freePtr = walkAnimName; if (0xfff < uVar6) { freePtr = *(void **)((int)walkAnimName + -4); uVar6 = walkAnimCapacity + 0x24; if (0x1f < (uint)((int)walkAnimName + (-4 - (int)freePtr))) goto LAB_0051b8ad; } operator_delete(freePtr,uVar6); } local_14 = 0xffffffff; walkAnimSize = 0; walkAnimCapacity = 0xf; walkAnimName = (void *)((uint)walkAnimName & 0xffffff00); if (0xf < vertAnimCapacity) { uVar6 = vertAnimCapacity + 1; freePtr = (void *)local_68._20_4_; if (0xfff < uVar6) { freePtr = *(void **)(local_68._20_4_ + -4); uVar6 = vertAnimCapacity + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)freePtr))) { LAB_0051b8ad: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar6); } if (npc->_controllerID == -1) { uVar6 = Random(); bVar1 = uVar6 % 0x32 == 0; } else { bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if ((((bVar1 != 0) && ((npc->_flags & 0x1000a00) == 0)) && ((npc->_controllerID != -1 || ((local_128.y < 230.0 || (uVar6 = Random(), (uVar6 & 3) == 0)))))) && ((npc->_variant != 2 || ((iVar3 = Entity_NPC::GetAliveEnemyCount(npc), iVar3 < 8 && (iVar3 = Isaac::Random(iVar3), iVar3 == 0)))))) { if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; local_120.y = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_120,0.1); (npc->_controllerMovement).x = local_120.x; } (npc->_controllerMovement).y = local_120.y; npc->_state = 8; } npc->_projectileCooldown = 0; ExceptionList = local_1c; return; } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar7 = g_vectorZero.y; LAB_0051ba2e: (npc->_controllerMovement).y = fVar7; } else { Entity_NPC::GetControllerMovementInput(npc,&local_120,0.1); if ((local_120.x != g_vectorZero.x) || (local_120.y != g_vectorZero.y)) { (npc->_controllerMovement).x = local_120.x; fVar7 = local_120.y; goto LAB_0051ba2e; } } animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0051ba8e: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } animName = "Shoot"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_0051ba70: uVar6 = -(uint)isLess | 1; goto LAB_0051ba75; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_0051ba70; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0051ba75: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0051ba8e; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0051c00c; bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { uVar6 = Random(); if ((250.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 20.0 <= local_128.y) || (npc->_spawnerType == 0x24)) { isAimedAtPlayer = '\0'; local_128.x = g_vectorZero.x; local_128.y = g_vectorZero.y; } else { isAimedAtPlayer = '\x01'; pEVar2 = Entity_NPC::GetPlayerTarget(npc); local_128.x = (pEVar2->_pos).x; local_128.y = (pEVar2->_pos).y; } local_120.x = local_128.x; local_120.y = local_128.y; if (npc->_controllerID != -1) { fVar7 = (npc->_controllerMovement).x; if ((fVar7 == g_vectorZero.x) && ((npc->_controllerMovement).y == g_vectorZero.y)) { } else { local_120.y = (npc->_controllerMovement).y * 150.0 + (npc->_pos).y; local_120.x = fVar7 * 150.0 + (npc->_pos).x; } } if (npc->_variant == 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); pPVar4 = ProjectileParams::ProjectileParams(&projParams); uVar6 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar6 & 1) + 3,&local_120,10.0,pPVar4); } else if (npc->_variant == 1) { Entity_NPC::PlaySound(npc,0xd5,0.7,2,0,1.0); pPVar4 = ProjectileParams::ProjectileParams(&projParams); projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_120,10.0,pPVar4); fVar7 = (projectile->_velocity).y; fVar8 = (projectile->_velocity).x * 0.55; *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 2; fVar7 = fVar7 * 0.55; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = *(undefined4 *)((int)&projectile->_projectileFlags + 4); projectile->_scale = 1.6; local_12c = (Entity_NPC *)fVar8; local_128.y = fVar7; if (isAimedAtPlayer != '\0') { uVar6 = Random(); fVar7 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.6; fVar8 = (float)local_12c * fVar7; fVar7 = local_128.y * fVar7; } fVar9 = projectile->_fallingAccel; (projectile->_velocity).x = fVar8; (projectile->_velocity).y = fVar7; projectile->_fallingAccel = fVar9 - 0.3; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 13.0; Color::Color((Color *)local_68); local_68._16_4_ = 0.4; local_68._20_4_ = 2.0; fStack_50 = 0.5; fStack_4c = 1.0; (**(code **)(*(int *)projectile + 0x3c))(extraout_ECX,0xffffffff,0xff,0,1); } else { Entity_NPC::PlaySound(npc,0xb5,1.0,2,0,1.0); pVVar5 = &npc->_pos; if (npc->_controllerID == -1) { if (isAimedAtPlayer == '\0') { fVar7 = 100.0; outPos = &freePosNear; goto LAB_0051bec3; } room = g_game->_room; pEVar2 = Entity_NPC::GetPlayerTarget(npc); pVVar5 = &local_120; fVar7 = 70.0; local_120.x = ((pEVar2->_pos).x + (npc->_pos).x) * 0.5; outPos = &freePos; local_120.y = ((pEVar2->_pos).y + (npc->_pos).y) * 0.5; } else { local_120.x = (npc->_controllerMovement).x * 80.0 + pVVar5->x; fVar7 = 0.0; local_120.y = (npc->_controllerMovement).y * 80.0 + (npc->_pos).y; pVVar5 = &local_120; outPos = &freePos; LAB_0051bec3: room = g_game->_room; } pVVar5 = Room::FindFreePickupSpawnPosition(room,outPos,pVVar5,fVar7,0,0,0); local_128.x = pVVar5->x; local_128.y = pVVar5->y; uVar6 = Random(); uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; pEVar2 = Game::Spawn(g_game,0x55,0,&local_128,&g_vectorZero,(Entity *)npc,0,uVar6); iVar3 = __RTDynamicCast(pEVar2,uVar10,pTVar11,pTVar12,uVar13); room = g_game->_room; gridIndex = Room::GetGridIndex(room,&local_128); Room::SetGridPath(room,gridIndex,900); fVar7 = *(float *)(iVar3 + 0x33c); *(float *)(iVar3 + 0x334) = fVar7; fVar8 = *(float *)(iVar3 + 0x340); *(float *)(iVar3 + 0x338) = fVar8; fVar9 = (local_12c->_pos).x; *(float *)(iVar3 + 0x33c) = fVar9; npcY = (local_12c->_pos).y; *(float *)(iVar3 + 0x340) = npcY; *(float *)(iVar3 + 0x350) = *(float *)(iVar3 + 0x350) - 30.0; *(undefined4 *)(iVar3 + 0xb64) = 6; fVar9 = (fVar7 - fVar9) * 0.04; *(undefined4 *)(iVar3 + 0xbbc) = 0xc1000000; fVar7 = (fVar8 - npcY) * 0.04; *(float *)(iVar3 + 0x360) = fVar9; *(float *)(iVar3 + 0xbb0) = fVar9; *(float *)(iVar3 + 0x364) = fVar7; *(float *)(iVar3 + 0xbb4) = fVar7; npc = local_12c; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } LAB_0051c00c: npc->_state = 4; ExceptionList = local_1c; return; } //@@ 0051c040 NpcAI::ENTITY_MEMBRAIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 57 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MEMBRAIN(Entity_NPC *npc) { Entity_NPC *pEVar1; byte bVar2; Entity *pEVar3; int iVar4; Vector *pVVar5; uint uVar6; Entity_Effect *splat; float fVar7; float fVar8; float fVar9; uint type; undefined4 local_130 [11]; EntityList_EL dips; Vector local_f4; Vector *npcPos; Vector local_e8; float local_e0; float local_dc; Vector local_d8; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; AnimationState *animState; undefined4 flagsHigh; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af44f0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; if (npc->_state == 0) { iVar4 = npc->_type; npc->_state = 4; if (iVar4 == 0xdf) { if (&npc->_splatColor == (ColorMod *)local_130) { return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.25490198; (npc->_splatColor)._offset[1] = 0.16078432; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.13725491; iVar4 = npc->_type; } fVar9 = g_colorGreenSplat._tint[3]; fVar8 = g_colorGreenSplat._tint[2]; fVar7 = g_colorGreenSplat._tint[1]; if (iVar4 != 0x39) { return; } if (npc->_variant != 2) { return; } if (&npc->_splatColor == &g_colorGreenSplat) { return; } (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar7; (npc->_splatColor)._tint[2] = fVar8; (npc->_splatColor)._tint[3] = fVar9; fVar9 = g_colorGreenSplat._colorize[3]; fVar8 = g_colorGreenSplat._colorize[2]; fVar7 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar7; (npc->_splatColor)._colorize[2] = fVar8; (npc->_splatColor)._colorize[3] = fVar9; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; return; } ExceptionList = &local_1c; npc->_friction = npc->_friction * 0.8; local_d8.y = (float)npc; if (npc->_state != 4) { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0051c731: npc->_state = 4; } else { bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x30,0.8,2,0,1.0); } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0051c731; bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar2 != 0) { if (npc->_type == 0x39) { ProjectileParams::ProjectileParams(&projParams); projParams.Scale = 1.4; if (npc->_variant == 2) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x2000; projParams.BulletFlags._4_4_ = projParams.BulletFlags._4_4_ | 0x400; projParams.FallingAccelModifier = -0.07; projParams.CircleAngle = 0.3926991; local_d8.x = 8.0; local_d8.y = 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_d8,9,&projParams); } else { local_d8.x = 10.0; local_d8.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_d8,8,&projParams); } } else if (npc->_type == 0xdf) { iVar4 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar4 < 6) { if (npc->_controllerID == -1) { uVar6 = Random(); bVar2 = uVar6 % 7 != 0; } else { bVar2 = Vector::operator_eq(&npc->_controllerMovement,&g_vectorZero); } if (bVar2 == 0) goto LAB_0051c54e; pVVar5 = MusicManager::RandomVector(&local_e8); local_e0 = pVVar5->x * 30.0; local_dc = pVVar5->y * 30.0; uVar6 = Random(); pVVar5 = &npc->_pos; local_e8.x = local_e0 + pVVar5->x; local_e8.y = local_dc + (npc->_pos).y; npcPos = pVVar5; pEVar3 = Game::SpawnEx(g_game,0xd9,0,&local_e8,&g_vectorZero,(Entity *)npc,0,uVar6,0); flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; uVar6 = Random(); local_e8.x = pVVar5->x - local_e0; local_e8.y = (npc->_pos).y - local_dc; pEVar3 = Game::SpawnEx(g_game,0xd9,0,&local_e8,&g_vectorZero,(Entity *)npc,0,uVar6,0); flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; } else { LAB_0051c54e: ProjectileParams::ProjectileParams(&projParams); projParams.Scale = 1.4; projParams.Variant = 3; npcPos = &npc->_pos; local_e8.x = 10.0; local_e8.y = 0.0; Entity_NPC::FireProjectiles(npc,npcPos,&local_e8,8,&projParams); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&dips,0xd9,-1,-1,0,0) ; if (dips._size != 0) { local_f4.y = 0.0; uVar6 = 0; do { iVar4 = *(int *)((int)dips._data + uVar6 * 4); local_e0 = *(float *)(iVar4 + 0x33c) - npcPos->x; local_dc = *(float *)(iVar4 + 0x340) - npcPos->y; fVar7 = sqrtf(local_e0 * local_e0 + local_dc * local_dc); local_e8.y = 150.0 - fVar7; pVVar5 = &local_f4; if (0.0 <= 150.0 - fVar7) { pVVar5 = &local_e8; } fVar8 = local_e0; fVar9 = local_dc; if (0.0 < fVar7) { fVar7 = (pVVar5->y * 0.1) / fVar7; fVar9 = local_dc * fVar7; fVar8 = local_e0 * fVar7; } fVar7 = *(float *)(iVar4 + 0x36c); if (fVar7 != 0.0) { *(float *)(iVar4 + 0x364) = (*(float *)(iVar4 + 0x39c) * fVar9) / fVar7 + *(float *)(iVar4 + 0x364); *(float *)(iVar4 + 0x360) = (*(float *)(iVar4 + 0x39c) * fVar8) / fVar7 + *(float *)(iVar4 + 0x360); } uVar6 = uVar6 + 1; } while (uVar6 < (uint)dips._size); npc = (Entity_NPC *)local_d8.y; } if (dips._0_1_ == '\0') { local_14 = 0.0; tracked_alloc(1,dips._data,0); local_14 = -NAN; } } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0051c731; } npc->_stateFrame = npc->_stateFrame + 1; goto LAB_0051c741; } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } else { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); pEVar3 = Entity_NPC::GetPlayerTarget(npc); local_d8.x = (pEVar3->_pos).x; local_d8.y = (pEVar3->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_d8,0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { uVar6 = Random(); if ((uVar6 % 0x1e == 0) && (iVar4 = Entity_NPC::GetAliveEnemyCount(npc), iVar4 < 8)) goto LAB_0051c250; } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar2 == 0) && (bVar2 = Entity_NPC::IsControllerActionPressed(npc,9), bVar2 == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Wiggle",0); goto LAB_0051c741; } LAB_0051c250: if ((npc->_flags & 0x1000a00) == 0) { npc->_state = 8; npc->_stateFrame = 0; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; pEVar1 = (Entity_NPC *)g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_d8,0.1); (npc->_controllerMovement).x = local_d8.x; pEVar1 = (Entity_NPC *)local_d8.y; } (npc->_controllerMovement).y = (float)pEVar1; } } ANM2::Play(&npc->_sprite,(byte *)"Wiggle",0); LAB_0051c741: if ((npc->_type == 0xdf) && (uVar6 = Random(), uVar6 % 10 == 0)) { uVar6 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } if ((npc->_dead != 0) && (npc->_championRegenCount == 0)) { uVar6 = Random(); fVar7 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d8.y = fVar7 + fVar7; local_dc = cos(local_d8.y); local_dc = local_dc * 10.0; local_e0 = sin(local_d8.y); local_e0 = local_e0 * 10.0; if (npc->_type == 0x39) { if (npc->_variant == 0) { uVar6 = Random(); local_d8.x = local_dc + (npc->_pos).x; local_d8.y = local_e0 + (npc->_pos).y; Game::SpawnEx(g_game,0x20,0,&local_d8,&g_vectorZero,(Entity *)npc,0,uVar6,0); uVar6 = Random(); local_d8.x = (npc->_pos).x - local_dc; pVVar5 = &local_d8; local_d8.y = (npc->_pos).y - local_e0; type = 0x20; } else if (npc->_variant == 2) { uVar6 = Random(); local_d8.x = local_dc + (npc->_pos).x; local_d8.y = local_e0 + (npc->_pos).y; Game::SpawnEx(g_game,0x35e,0,&local_d8,&g_vectorZero,(Entity *)npc,0,uVar6,0); uVar6 = Random(); local_d8.x = (npc->_pos).x - local_dc; pVVar5 = &local_d8; local_d8.y = (npc->_pos).y - local_e0; type = 0x35e; } else { uVar6 = Random(); local_d8.x = local_dc + (npc->_pos).x; local_d8.y = local_e0 + (npc->_pos).y; Game::SpawnEx(g_game,0x28,0,&local_d8,&g_vectorZero,(Entity *)npc,0,uVar6,0); uVar6 = Random(); local_d8.x = (npc->_pos).x - local_dc; pVVar5 = &local_d8; local_d8.y = (npc->_pos).y - local_e0; type = 0x28; } } else { if (npc->_type != 0xdf) { ExceptionList = local_1c; return; } uVar6 = Random(); local_d8.x = local_dc + (npc->_pos).x; local_d8.y = local_e0 + (npc->_pos).y; Game::SpawnEx(g_game,0xdc,0,&local_d8,&g_vectorZero,(Entity *)npc,0,uVar6,0); uVar6 = Random(); local_f4.x = (npc->_pos).x - local_dc; pVVar5 = &local_f4; local_f4.y = (npc->_pos).y - local_e0; type = 0xdc; } Game::SpawnEx(g_game,type,0,pVVar5,&g_vectorZero,(Entity *)npc,0,uVar6,0); } ExceptionList = local_1c; return; } //@@ 0051cb30 NpcAI::ENTITY_HANGER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 90 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HANGER(Entity_NPC *npc) { code *pcVar1; byte bVar2; uint uVar3; Entity *pEVar4; int iVar5; byte *curAnimName; Vector *pVVar6; Vector *pVVar7; byte *expectedAnimName; bool isLess; float fVar8; float fVar9; byte *expectedAnimName; undefined4 uVar11; TypeDescriptor *pTVar12; TypeDescriptor *pTVar13; undefined4 uVar14; undefined4 local_104 [8]; undefined4 local_e4; undefined4 uStack_e0; undefined4 local_dc; undefined1 local_d4 [8]; float local_cc; float local_c8; byte *local_c4; ProjectileParams projParams; float local_14; Manager *manager; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); if (npc->_state == 0) { npc->_state = 4; uVar3 = Random(); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; pEVar4 = Game::Spawn(g_game,0x60,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3); iVar5 = __RTDynamicCast(pEVar4,uVar11,pTVar12,pTVar13,uVar14); expectedAnimName = (byte *)(iVar5 + 0x3bc); if (*(int *)(iVar5 + 0x3bc) != 0) { local_c4 = expectedAnimName; std::multiset::erase(&local_c4); } *(Entity_NPC **)expectedAnimName = npc; std::multiset::insert(expectedAnimName); local_e4 = 0; uStack_e0 = 0; local_dc = 0; if (&npc->_splatColor != (ColorMod *)local_104) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.4; (npc->_splatColor)._tint[1] = 0.2; (npc->_splatColor)._tint[2] = 0.2; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } uVar3 = npc->_initSeed; local_d4 = (undefined1 [8])0x900000005; local_c4 = (byte *)0x7; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 5 ^ uVar3; uVar3 = (uVar3 >> 7 ^ uVar3) & 3; npc->_i1 = uVar3; expectedAnimName = (npc->_sprite)._animState._animData; local_c4 = (&PTR_s_Head01_00b61570)[uVar3]; if (expectedAnimName != (byte *)0x0) { curAnimName = expectedAnimName; expectedAnimName = local_c4; if (0xf < *(uint *)(expectedAnimName + 0x14)) { curAnimName = *(byte **)expectedAnimName; } do { bVar2 = *curAnimName; isLess = bVar2 < *expectedAnimName; if (bVar2 != *expectedAnimName) { LAB_0051ccd7: uVar3 = -(uint)isLess | 1; goto LAB_0051ccdc; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; isLess = bVar2 < expectedAnimName[1]; if (bVar2 != expectedAnimName[1]) goto LAB_0051ccd7; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0051ccdc: if ((uVar3 == 0) && ((expectedAnimName[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0051cd14; } bVar2 = ANM2::SetAnimation(&npc->_sprite,local_c4,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0051cd14: pVVar7 = &npc->_pos; pVVar6 = Room::GetClampedPositionImpl (g_game->_room,(Vector *)(local_d4 + 4),pVVar7,30.0,0.0,10.0,0.0); pVVar7->x = pVVar6->x; (npc->_pos).y = pVVar6->y; uVar3 = Random(); if (uVar3 % 10 == 0) { uVar3 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.4); } if (npc->_state != 8) { pVVar6 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_d4 + 4),10.0); local_c8 = pVVar6->x - pVVar7->x; local_c4 = (byte *)(pVVar6->y - (npc->_pos).y); if (npc->_controllerID != -1) { pVVar7 = Entity_NPC::GetControllerInput(npc,(Vector *)(local_d4 + 4),0.0); local_c8 = pVVar7->x * 100.0; local_c4 = (byte *)(pVVar7->y * 100.0); } if (((npc->_projectileCooldown < 1) || (iVar5 = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime), npc->_projectileCooldown = iVar5, iVar5 < 1)) && (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,260.0,0,7), bVar2 != 0)) { if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; local_cc = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,(Vector *)(local_d4 + 4),0.1); (npc->_controllerMovement).x = (float)local_d4._4_4_; } (npc->_controllerMovement).y = local_cc; bVar2 = ANM2::SetAnimation(&npc->_sprite,(&PTR_s_AttackHead01_00b61580)[npc->_i1],1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } if (npc->_controllerID == -1) { fVar8 = local_c8; } else { fVar8 = (npc->_controllerMovement).x; } (npc->_sprite)._flipX = 0.0 < fVar8; uVar3 = Random(); npc->_state = 8; npc->_projectileCooldown = ((uVar3 & 1) + 6) * 7; } local_cc = npc->_friction; if (0.01 < ABS(local_cc)) { fVar8 = sqrtf(local_c8 * local_c8 + (float)local_c4 * (float)local_c4); if (ABS(fVar8) <= 0.1) { fVar8 = 0.0; } else { fVar8 = 0.13 / fVar8; } if (local_cc != 0.0) { fVar9 = npc->_speedMultiplier; (npc->_velocity).x = (local_c8 * fVar8 * fVar9) / local_cc + (npc->_velocity).x; (npc->_velocity).y = ((float)local_c4 * fVar8 * fVar9) / local_cc + (npc->_velocity).y; } } goto LAB_0051d2c9; } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar8 = g_vectorZero.y; LAB_0051ce35: (npc->_controllerMovement).y = fVar8; } else { Entity_NPC::GetControllerMovementInput(npc,(Vector *)(local_d4 + 4),0.1); if (((float)local_d4._4_4_ != g_vectorZero.x) || (local_cc != g_vectorZero.y)) { (npc->_controllerMovement).x = (float)local_d4._4_4_; fVar8 = local_cc; goto LAB_0051ce35; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { local_c8 = 1.0; if (npc->_championColorIdx == 0x12) { local_c8 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_c8 = 0.5; } local_c4 = (byte *)0xb2; seed_fart_sound_override((int *)&local_c4); SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,2,0,local_c8,0.0); ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = projParams.HeightModifier - 20.0; projParams.FallingSpeedModifier = projParams.FallingSpeedModifier + 2.0; pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_c8 = (pEVar4->_pos).x - (npc->_pos).x; local_c4 = (byte *)((pEVar4->_pos).y - (npc->_pos).y); if (npc->_controllerID != -1) { local_c8 = (npc->_controllerMovement).x * 100.0; local_c4 = (byte *)((npc->_controllerMovement).y * 100.0); } fVar8 = sqrtf(local_c8 * local_c8 + (float)local_c4 * (float)local_c4); if (fVar8 <= 0.0) { fVar9 = local_c8; expectedAnimName = local_c4; } else { fVar9 = local_c8 * (1.0 / fVar8); expectedAnimName = (byte *)((float)local_c4 * (1.0 / fVar8)); } local_cc = (float)expectedAnimName * 7.0; local_d4._4_4_ = fVar9 * 7.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(local_d4 + 4),2,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0051d2c9; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(&PTR_s_Head01_00b61570)[npc->_i1],1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 4; LAB_0051d2c9: npc->_friction = npc->_friction * 0.93; return; } //@@ 0051d300 NpcAI::ENTITY_GURDY_JR /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 99 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GURDY_JR(Entity_NPC *npc) { float fVar1; float fVar2; Manager *pMVar3; void *pvVar4; undefined1 *puVar5; uint seed; int iVar6; Vector *pVVar7; int iVar8; Vector local_118; Vector local_10c; Entity_NPC *local_104; int local_100; float local_fc; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; pvVar4 = ExceptionList; pMVar3 = g_manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00af4530; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; iVar8 = npc->_state; local_104 = npc; if (iVar8 == 0) { npc->_state = 3; npc->_stateFrame = 0; if (npc->_subtype != 1) { ExceptionList = pvVar4; return; } if (npc->_spawnerType == npc->_type) { ExceptionList = pvVar4; return; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); seed = Random(); local_118.x = (npc->_pos).x + 24.0; local_118.y = (npc->_pos).y + 0.0; Game::Spawn(g_game,npc->_type,npc->_variant,&local_118,&npc->_velocity,(Entity *)npc, npc->_subtype,seed); (npc->_pos).x = (npc->_pos).x - 24.0; (npc->_pos).y = (npc->_pos).y - 0.0; ExceptionList = local_1c; return; } puVar5 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_dead != 0) { local_fc = 1.0; if (npc->_championColorIdx == 0x12) { local_fc = 1.5; } else if (npc->_championColorIdx == 0x13) { local_fc = 0.5; } local_100 = 0x75; seed_fart_sound_override(&local_100); SoundEffects::Play(&pMVar3->_sfxManager,local_100,1.2,2,0,local_fc,0.0); iVar8 = npc->_state; puVar5 = puStack_20; } puStack_20 = puVar5; if (iVar8 == 8) { iVar6 = Entity::GetIntervalTicks((Entity *)npc,5.0,0.0); if (iVar6 != 0) { npc->_friction = npc->_friction * 0.97; goto LAB_0051d4e2; } } else { npc->_friction = npc->_friction * 0.8; } local_fc = 0.2; if (7 < iVar8 - 3U) { if (npc->_controllerID != -1) { pVVar7 = Entity_NPC::GetControllerInput(npc,&local_10c,0.0); fVar1 = npc->_speedMultiplier; fVar2 = pVVar7->y; (npc->_velocity).x = local_fc * pVVar7->x * fVar1 + (npc->_velocity).x; (npc->_velocity).y = fVar2 * local_fc * fVar1 + (npc->_velocity).y; } ExceptionList = local_1c; return; } LAB_0051d4e2: local_fc = 0.2; /* WARNING: Could not recover jumptable at 0x0051d4ed. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)(&PTR_LAB_0051e0c8)[iVar8 + -3])(); return; } //@@ 0051e0f0 NpcAI::ENTITY_URIEL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 271 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_URIEL(Entity_NPC *npc) { float *pfVar1; void *pvVar2; undefined1 *puVar3; byte bVar4; uint uVar5; LayerState *layer; byte *angelMatch; Entity *tmpEntity; Vector *pVVar6; int iVar7; uint attackRoll; ColorMod *effectColor; Entity_Laser *laser; undefined4 *extraout_ECX; float *extraout_ECX_00; byte *angelMatch; char *pcVar9; bool isLess; float fVar10; float fVar11; float fVar12; undefined4 *puVar13; undefined4 *puVar14; undefined4 uVar15; TypeDescriptor *pTVar16; TypeDescriptor *pTVar17; undefined4 uVar18; Vector moveInput; Vector controllerInput; float local_14c; Vector local_148; Vector local_140; Vector local_138; Vector local_130; undefined4 *local_128 [12]; ProjectileParams params; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; pvVar2 = ExceptionList; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af456d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; iVar7 = npc->_state; local_24 = uVar5; if (iVar7 == 0) { npc->_state = 4; npc->_stateFrame = 0; if (npc->_variant != 1) { ExceptionList = pvVar2; return; } local_138.y = 0.0; bVar4 = 0; puStack_20 = local_50 + 0x4c; puVar3 = local_50 + 0x4c; if ((npc->_sprite)._layerCount != 0) { do { angelMatch = (byte *)local_138.y; layer = ANM2::GetLayer(&npc->_sprite,(byte *)local_138.y); if (layer->_layerData == (void *)0x0) { local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = (undefined4 *)0x0; } else { std::string::string(local_50 + 0x14,(void *)((int)layer->_layerData + 0x20)); } local_14 = 0; local_130.y = (float)(local_50 + 0x14); if (0xf < (uint)local_28) { local_130.y = (float)local_50._20_4_; } local_128[0] = (undefined4 *)local_50._20_4_; puVar14 = (undefined4 *)local_50._20_4_; if (4 < (uint)local_2c) { local_140.y = (float)(((int)local_2c - 4U) + (int)local_130.y); angelMatch = memchr((void *)local_130.y,0x41,(int)local_140.y - (int)local_130.y); if (angelMatch != (byte *)0x0) { do { local_14c = 1.4013e-45; pcVar9 = "Angel"; angelMatch = angelMatch; if (*(int *)angelMatch == 0x65676e41) { angelMatch = angelMatch + 4; local_14c = -NAN; pcVar9 = "l"; } isLess = *angelMatch < (byte)*pcVar9; if ((*angelMatch == *pcVar9) && ((local_14c == -NAN || (((isLess = angelMatch[1] < (byte)pcVar9[1], angelMatch[1] == pcVar9[1] && (isLess = angelMatch[2] < (byte)pcVar9[2], angelMatch[2] == pcVar9[2])) && (isLess = angelMatch[3] < (byte)pcVar9[3], angelMatch[3] == pcVar9[3])))))) { uVar5 = 0; } else { uVar5 = -(uint)isLess | 1; } if (uVar5 == 0) { if ((int)angelMatch - (int)local_130.y != -1) { fVar12 = (float)((int)local_2c - 4); if ((uint)local_2c < (uint)fVar12) { std::string::append_n(local_50 + 0x14,(int)fVar12 - (int)local_2c,0); } else { puVar14 = (undefined4 *)(local_50 + 0x14); if (0xf < (uint)local_28) { puVar14 = local_128[0]; } local_2c = fVar12; *(undefined1 *)((int)puVar14 + (int)fVar12) = 0; } std::string::append(local_50 + 0x14,(byte *)"Black.png",9); angelMatch = (byte *)local_138.y; Sprite::ReplaceSpritesheet ((Sprite *)&npc->_sprite,(int)local_138.y, (std_string *)(local_50 + 0x14)); puVar14 = (undefined4 *)local_50._20_4_; goto LAB_0051e296; } break; } angelMatch = memchr(angelMatch + 1,0x41,(int)local_140.y - (int)(angelMatch + 1)); } while (angelMatch != (byte *)0x0); angelMatch = (byte *)local_138.y; } puVar14 = local_128[0]; } LAB_0051e296: local_14 = 0xffffffff; if (0xf < (uint)local_28) { uVar5 = (int)local_28 + 1; puVar13 = puVar14; if (0xfff < uVar5) { puVar13 = (undefined4 *)puVar14[-1]; uVar5 = (int)local_28 + 0x24; if ((undefined1 *)0x1f < (undefined1 *)((int)puVar14 + (-4 - (int)puVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar13,uVar5); puVar14 = extraout_ECX; } bVar4 = (byte)puVar14; local_138.y = (float)(angelMatch + 1); puVar3 = puStack_20; } while ((uint)local_138.y < (byte *)(npc->_sprite)._layerCount); } puStack_20 = puVar3; ANM2::LoadGraphics(&npc->_sprite,bVar4); ExceptionList = local_1c; return; } fVar12 = (float)npc->_stateFrame; local_14c = 1.0; npc->_friction = 0.8; npc->_stateFrame = (int)fVar12 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_138.y = 0.0; local_130.y = fVar12; if (iVar7 != 4) { if (iVar7 == 8) { puStack_20 = local_50 + 0x4c; Entity_NPC::UpdateControllerMovement(npc,0); if (npc->_i1 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Shield",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_0051f203; } npc->_i1 = 1; goto LAB_0051f203; } ANM2::Play(&npc->_sprite,(byte *)"SpreadShot",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { ProjectileParams::ProjectileParams(¶ms); params.HeightModifier = -17.0; params.FallingSpeedModifier = 1.3; Entity_NPC::PlaySound(npc,0x10b,0.5,2,0,1.0); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); if (npc->_type == 0x10f) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_130.x = (tmpEntity->_pos).x - (npc->_pos).x; local_130.y = (tmpEntity->_pos).y - (npc->_pos).y; bVar4 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero); if (bVar4 != 0) { local_130.x = *extraout_ECX_00; local_130.y = extraout_ECX_00[1]; } Vector::Normalize(&local_130); local_148.x = local_130.x * 8.0; uVar5 = 5; pVVar6 = &local_148; local_148.y = local_130.y * 8.0; } else { if (npc->_type != 0x110) goto LAB_0051ed69; local_130.x = 10.0; uVar5 = 9; pVVar6 = &local_130; local_130.y = 12.0; } Entity_NPC::FireProjectiles(npc,&npc->_pos,pVVar6,uVar5,¶ms); } LAB_0051ed69: if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying != 0) goto LAB_0051f203; } } npc->_i1 = 0; npc->_stateFrame = 0; } else { if ((iVar7 != 9) && (iVar7 != 10)) { puStack_20 = local_50 + 0x4c; if (iVar7 != 0xd) goto LAB_0051f203; if (npc->_i1 == 0) { puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,(byte *)"Shield",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = 1; npc->_stateFrame = 0; } goto LAB_0051f203; } puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,&DAT_00b60e98,0); if ((((int)local_130.y / 10 < npc->_stateFrame / 10) && (npc->_stateFrame < 0x14)) && (iVar7 = Entity_NPC::GetAliveEnemyCount(npc), iVar7 < 3)) { Entity_NPC::PlaySound(npc,0x109,1.5,2,0,1.0); uVar5 = Random(); uVar18 = 0; pTVar17 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar16 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar15 = 0; tmpEntity = Game::Spawn(g_game,0x26,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); __RTDynamicCast(tmpEntity,uVar15,pTVar16,pTVar17,uVar18); } goto LAB_0051ed69; } if (npc->_i1 == 0) { if ((npc->_type != 0x110) || (pcVar9 = "Charging2", iVar7 != 10)) { pcVar9 = "Charging"; } puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,(byte *)pcVar9,0); if (0x19 < npc->_stateFrame) { npc->_i1 = 1; npc->_stateFrame = 0; } if (npc->_controllerID != -1) { Entity_NPC::GetControllerInput(npc,&local_130,0.0); if (npc->_type == 0x10f) { fVar12 = local_130.x * 0.375; fVar11 = local_130.y * 0.375; } else { fVar12 = local_130.x; fVar11 = local_130.y; if (npc->_type == 0x110) { fVar12 = local_130.x * 0.4125; fVar11 = local_130.y * 0.4125; } } fVar10 = npc->_speedMultiplier; (npc->_velocity).x = fVar12 * fVar10 + (npc->_velocity).x; (npc->_velocity).y = fVar11 * fVar10 + (npc->_velocity).y; } goto LAB_0051f203; } ANM2::Play(&npc->_sprite,(byte *)"LaserShot",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { if (npc->_type == 0x10f) { local_130.x = (npc->_pos).x + 0.0; local_130.y = (npc->_pos).y + 5.0; local_148.x = 0.0; local_148.y = -50.0; if (npc->_state == 9) { fVar12 = 90.0; } else { laser = Entity_Laser::ShootAngle(5,&local_130,45.0,0x1e,&local_148,(Entity *)npc,0); laser->_entityGridCollisionClass = 0; (**(code **)(*(int *)laser + 0xc))(uVar5); local_130.x = (npc->_pos).x + 0.0; local_130.y = (npc->_pos).y + 5.0; fVar12 = 135.0; } local_148.y = -50.0; local_148.x = 0.0; laser = Entity_Laser::ShootAngle(5,&local_130,fVar12,0x1e,&local_148,(Entity *)npc,0); laser->_entityGridCollisionClass = 0; (**(code **)(*(int *)laser + 0xc))(); } else if (npc->_type == 0x110) { local_148.x = 0.0; puVar14 = (undefined4 *)0x0; local_148.y = -50.0; do { local_128[0] = puVar14; if (npc->_state == 10) { local_128[0] = (undefined4 *)((float)puVar14 + 45.0); } local_130.y = ((float)local_128[0] * 3.1415927) / 180.0; fVar12 = cos(local_130.y); local_140.x = fVar12 * 7.0 + (npc->_pos).x; fVar12 = sin(local_130.y); local_140.y = fVar12 * 7.0 + (npc->_pos).y; laser = Entity_Laser::ShootAngle (5,&local_140,(float)local_128[0],0x1e,&local_148,(Entity *)npc,0); laser->_entityGridCollisionClass = 0; (**(code **)(*(int *)laser + 0xc))(); puVar14 = (undefined4 *)(local_138.y + 90.0); local_138.y = (float)puVar14; } while ((float)puVar14 < 360.0); } } } if (npc->_stateFrame < 0x33) goto LAB_0051f203; npc->_i1 = 0; } npc->_state = 4; goto LAB_0051f203; } puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,(byte *)"Float",0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_128[0] = (undefined4 *)((tmpEntity->_pos).x - (npc->_pos).x); local_138.y = (tmpEntity->_pos).y - (npc->_pos).y; if ((ABS(local_138.y) < ABS((float)local_128[0])) && (local_138.y = local_138.y * -1.2, npc->_type == 0x10f)) { fVar10 = sqrtf((float)local_128[0] * (float)local_128[0] + local_138.y * local_138.y); fVar11 = (npc->_pos).y; local_138.y = (float)((uint)fVar10 ^ 0x80000000); if (fVar11 - *(float *)((int)g_game->_room + 0x18) < 30.0) { local_138.y = 0.0; } if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (fVar11 - 320.0 < 30.0)) { local_138.y = 0.0; } } fVar11 = sqrtf(local_138.y * local_138.y + (float)local_128[0] * (float)local_128[0]); puVar13 = (undefined4 *)local_138.y; puVar14 = local_128[0]; if (0.0 < fVar11) { puVar13 = (undefined4 *)(local_138.y * (1.0 / fVar11)); puVar14 = (undefined4 *)((float)local_128[0] * (1.0 / fVar11)); } if (npc->_controllerID != -1) { pVVar6 = Entity_NPC::GetControllerInput(npc,&controllerInput,0.0); puVar14 = (undefined4 *)pVVar6->x; puVar13 = (undefined4 *)pVVar6->y; } if (npc->_type == 0x10f) { puVar14 = (undefined4 *)((float)puVar14 * 1.5); puVar13 = (undefined4 *)((float)puVar13 * 1.5); } else if (npc->_type == 0x110) { puVar14 = (undefined4 *)((float)puVar14 * 1.65); puVar13 = (undefined4 *)((float)puVar13 * 1.65); } fVar11 = npc->_speedMultiplier; local_128[0] = (undefined4 *)0xffffffff; (npc->_velocity).x = fVar11 * (float)puVar14 + (npc->_velocity).x; (npc->_velocity).y = fVar11 * (float)puVar13 + (npc->_velocity).y; if (npc->_controllerID == -1) { LAB_0051e633: if (npc->_stateFrame / 0x1e <= (int)fVar12 / 0x1e) goto LAB_0051f203; uVar5 = Random(); if (uVar5 % 3 != 0) goto LAB_0051f203; } else { pVVar6 = Entity_NPC::GetControllerMovementInput(npc,&moveInput,0.1); if ((pVVar6->x == g_vectorZero.x) && (pVVar6->y == g_vectorZero.y)) { bVar4 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar4 != 0) { puVar14 = (undefined4 *)0x1; goto LAB_0051e615; } bVar4 = Entity_NPC::IsControllerActionPressed(npc,10); if (bVar4 != 0) { puVar14 = (undefined4 *)0x2; goto LAB_0051e615; } bVar4 = Entity_NPC::IsControllerActionPressed(npc,8); if (((bVar4 != 0) && (npc->_type == 0x110)) && (iVar7 = Entity_NPC::GetAliveEnemyCount(npc), iVar7 < 3)) { puVar14 = (undefined4 *)0x3; goto LAB_0051e615; } puVar14 = (undefined4 *)0xffffffff; } else { puVar14 = (undefined4 *)0x0; LAB_0051e615: local_128[0] = puVar14; } if (npc->_controllerID == -1) goto LAB_0051e633; if ((int)puVar14 < 0) goto LAB_0051f203; } uVar5 = 3; if ((npc->_type == 0x110) && (iVar7 = Entity_NPC::GetAliveEnemyCount(npc), iVar7 < 3)) { uVar5 = 4; } attackRoll = Random(); puVar14 = (undefined4 *)(attackRoll % uVar5); if (((npc->_type == 0x10f) && ((puVar14 == (undefined4 *)0x1 || (puVar14 == (undefined4 *)0x2)))) && (tmpEntity = Entity_NPC::GetPlayerTarget(npc), (tmpEntity->_pos).y - (npc->_pos).y < 0.0)) { puVar14 = (undefined4 *)0x0; } puVar13 = local_128[0]; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar12 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_130,0.1); (npc->_controllerMovement).x = local_130.x; puVar14 = puVar13; fVar12 = local_130.y; } (npc->_controllerMovement).y = fVar12; if (puVar14 == (undefined4 *)0x0) { npc->_state = 8; npc->_i1 = 0; npc->_stateFrame = 0; goto LAB_0051f203; } if (puVar14 == (undefined4 *)0x1) { npc->_state = 9; npc->_i1 = 0; npc->_stateFrame = 0; if (npc->_type != 0x10f) { if (npc->_type == 0x110) { local_128[0] = (undefined4 *)0x0; do { local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = (undefined4 *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_50._0_4_ = 0.6; local_50._4_4_ = 0.6; local_50._8_4_ = 0.0; local_50._12_4_ = 0.8; local_28 = 0.0; local_130.y = (float)local_128[0] * 0.017453292; local_140.x = cos(local_130.y); local_140.y = sin(local_130.y); local_130.y = ((float)local_128[0] * 3.1415927) / 180.0; fVar12 = cos(local_130.y); local_138.x = fVar12 * 7.0 + 0.0; fVar12 = sin(local_130.y); local_138.y = fVar12 * 7.0 - 50.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_138,&local_140,0x20,(ColorMod *)local_50,4.0); local_128[0] = (undefined4 *)((float)local_128[0] + 90.0); } while ((float)local_128[0] < 360.0); } goto LAB_0051f203; } effectColor = (ColorMod *)Color::Color(0x3f4ccccd); local_130.x = cos(1.5707964); fVar12 = 1.5707964; } else { if (puVar14 != (undefined4 *)0x2) { if (puVar14 == (undefined4 *)0x3) { npc->_state = 0xd; npc->_i1 = 0; npc->_stateFrame = 0; } goto LAB_0051f203; } npc->_state = 10; npc->_i1 = 0; npc->_stateFrame = 0; if (npc->_type != 0x10f) { if (npc->_type == 0x110) { local_138.y = 0.0; do { local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = (undefined4 *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_50._0_4_ = 0.6; local_50._4_4_ = 0.6; local_50._8_4_ = 0.0; local_50._12_4_ = 0.8; local_28 = 0.0; local_128[0] = (undefined4 *)(local_138.y + 45.0); local_130.y = (float)local_128[0] * 0.017453292; local_140.x = cos(local_130.y); local_140.y = sin(local_130.y); local_128[0] = (undefined4 *)(((float)local_128[0] * 3.1415927) / 180.0); fVar12 = cos((float)local_128[0]); local_148.x = fVar12 * 7.0 + 0.0; fVar12 = sin((float)local_128[0]); local_148.y = fVar12 * 7.0 - 50.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_148,&local_140,0x20,(ColorMod *)local_50,4.0); local_138.y = local_138.y + 90.0; } while (local_138.y < 360.0); } goto LAB_0051f203; } effectColor = (ColorMod *)Color::Color(0x3f4ccccd); local_130.x = cos(0.7853982); local_130.y = sin(0.7853982); local_140.x = 0.0; local_140.y = -40.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_140,&local_130,0x20,effectColor,4.0); effectColor = (ColorMod *)Color::Color(0x3f4ccccd); local_130.x = cos(2.3561945); fVar12 = 2.3561945; } local_130.y = sin(fVar12); local_140.x = 0.0; local_140.y = -40.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_140,&local_130,0x20,effectColor,4.0); LAB_0051f203: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1dd68); manager = g_manager; if (bVar4 != 0) { if (npc->_championColorIdx == 0x12) { local_14c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_14c = 0.5; } local_128[0] = (undefined4 *)0x113; seed_fart_sound_override((int *)local_128); SoundEffects::Play(&manager->_sfxManager,(int)local_128[0],0.65,2,0,local_14c,0.0); } } if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) && (pfVar1 = &(npc->_pos).y, *pfVar1 <= 320.0 && *pfVar1 != 320.0)) { (npc->_pos).y = 320.0; } ExceptionList = local_1c; return; } //@@ 0051f2f0 NpcAI::ENTITY_HEART /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 92 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HEART(Entity_NPC *npc) { byte bVar1; char *anim; Entity *pEVar2; int iVar3; ProjectileParams *projParams; Entity_Effect *splat; void *pvVar4; EntityPtr *extraout_ECX; EntityPtr *pathStartPtr; float *extraout_ECX_00; uint uVar5; int iVar6; int iVar7; EntityPtr controlledEntitySlot; bool bVar8; bool bVar9; float fVar10; float fVar11; float fVar12; EntityPtr EVar13; Vector *pVVar14; undefined1 *sideSign; EntityRef sourceRef; undefined1 visitedGridSet [8]; Entity_NPC *selfNpc; float candidateDy; float playerDistScore; float blockedPenalty; char local_13c [4]; void *local_138 [2]; uint local_130; Vector *local_12c; int gridPathLimit; float bestTargetY; float bestTargetX; EntityPtr linkedHeart; Vector local_118; Vector *local_110; float local_10c; byte isPlayerLineClear; Vector local_104; Vector targetPos; EntityPtr local_f4; byte isCharmed; float local_ec; Vector *local_e8; Vector local_e4; EntityPtr local_dc; EntityPtr local_d8; EntityPtr local_d4; ProjectileParams params; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; int *evadeCountdownPtr; float *evadeDistancePtr; Room *room; code *takeDamageFn; puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af45b0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(¶ms)[1].Spread; ExceptionList = &local_1c; EVar13 = (EntityPtr)npc->_state; selfNpc = npc; if (EVar13 == (EntityPtr)0x0) { if (((npc->_type == 0x5c) && (npc->_variant == 1)) && (npc->_entityRef == (EntityPtr)0x0)) { local_d4 = (EntityPtr)(1 - npc->_subtype); local_dc = (EntityPtr)0xc9742400; local_d8 = EVar13; puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); Entity_NPC::QueryNPCsType(local_13c,0x5c,1); local_14 = 0.0; local_ec = 0.0; if (local_130 != 0) { pvVar4 = local_138[0]; do { EVar13 = *(EntityPtr *)((int)pvVar4 + (int)local_ec * 4); if ((EVar13 != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar13 + 0x28) == 1)) || (*(int *)((int)EVar13 + 0x28) - 10U < 0x3de)))) { if (((*(EntityPtr *)((int)EVar13 + 0x30) == local_d4) && (*(int *)((int)EVar13 + 0x3c0) == 0)) && (*(int *)((int)EVar13 + 0xbec) == 0)) { fVar10 = (npc->_pos).y - *(float *)((int)EVar13 + 0x340); fVar12 = (npc->_pos).x - *(float *)((int)EVar13 + 0x33c); fVar10 = sqrtf(fVar10 * fVar10 + fVar12 * fVar12); if ((local_d8 == (EntityPtr)0x0) || ((float)local_dc < 1000.0 - fVar10)) { local_dc = (EntityPtr)(1000.0 - fVar10); local_d8 = EVar13; } } pvVar4 = local_138[0]; } EVar13 = local_d8; local_ec = (float)((int)local_ec + 1); } while ((uint)local_ec < local_130); if (local_d8 != (EntityPtr)0x0) { if (*(int *)((int)local_d8 + 0xbec) != 0) { local_d4 = (EntityPtr)((int)local_d8 + 0xbec); std::multiset::erase(&local_d4); } *(undefined4 *)((int)EVar13 + 0xbec) = npc; std::multiset::insert((undefined4 *)((int)EVar13 + 0xbec)); if (npc->_entityRef != (EntityPtr)0x0) { local_d4 = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_d4); } npc->_entityRef = EVar13; std::multiset::insert(&npc->_entityRef); if (*(int *)((int)EVar13 + 0x3c0) != 0) { local_d4 = (EntityPtr)((int)EVar13 + 0x3c0); std::multiset::erase(&local_d4); } *(undefined4 *)((int)EVar13 + 0x3c0) = npc; std::multiset::insert((undefined4 *)((int)EVar13 + 0x3c0)); if (npc->_parent != (EntityPtr)0x0) { local_d4 = (EntityPtr)&npc->_parent; std::multiset::erase(&local_d4); } npc->_parent = EVar13; std::multiset::insert(&npc->_parent); if ((npc->_child != (EntityPtr)0x0) && (bVar1 = Entity::IsEnemy((Entity *)npc->_child), bVar1 != 0)) { local_f4 = (EntityPtr)((int)npc->_child + 0xbec); if (*(EntityPtr *)local_f4 != (EntityPtr)0x0) { local_d4 = local_f4; std::multiset::erase(&local_d4); } *(EntityPtr *)local_f4 = EVar13; std::multiset::insert(local_f4); } } } if (local_13c[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,local_138[0],0); } } npc->_state = 4; ExceptionList = local_1c; return; } if (EVar13 == (EntityPtr)0x4) { anim = "HeartBeat"; if (npc->_type == 0x5c) { anim = "Heart"; } puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)anim,0); pEVar2 = Entity_NPC::GetPlayerTarget(npc); targetPos.x = (pEVar2->_pos).x; targetPos.y = (pEVar2->_pos).y; if ((npc->_type == 0x5c) && (npc->_variant == 1)) { EVar13 = npc->_entityRef; linkedHeart = EVar13; if ((EVar13 == (EntityPtr)0x0) || (bVar1 = Entity::IsEnemy((Entity *)EVar13), bVar1 == 0)) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetPos,1.0,900,1); } else { if (npc->_controllerID == -1) { if (*(int *)((int)EVar13 + 0xf1c) == -1) { isCharmed = Entity::HasEntityFlags((Entity *)npc,0x100); fVar10 = targetPos.x - (npc->_pos).x; fVar12 = targetPos.y - (npc->_pos).y; local_110 = &npc->_pos; local_e8 = (Vector *)sqrtf(fVar10 * fVar10 + fVar12 * fVar12); if ((npc->_pathfinder)._evadeMovementCountdown < 1) { LAB_0051f797: pathStartPtr = (EntityPtr *)&npc->_pos; } else { bVar1 = Vector::operator_ne(&(npc->_pathfinder)._movementTarget,&g_vectorZero); pathStartPtr = extraout_ECX; if (bVar1 == 0) goto LAB_0051f797; } local_118.x = *(float *)pathStartPtr; local_118.y = *(float *)(pathStartPtr + 1); local_f4 = (EntityPtr)local_118.y; local_d4 = (EntityPtr)local_118.x; if ((*(int *)((int)EVar13 + 0xb50) < 1) || (bVar1 = Vector::operator_ne((Vector *)((int)EVar13 + 0x418),&g_vectorZero), bVar1 == 0)) { local_12c = (Vector *)((Vector *)((int)EVar13 + 0x33c))->x; local_104.y = *(float *)((int)EVar13 + 0x340); } else { local_12c = (Vector *)*extraout_ECX_00; local_104.y = *(float *)(extraout_ECX_00 + 1); } fVar12 = 20.0; fVar10 = (npc->_pathfinder)._evadeDistance; if (fVar10 <= 20.0) { fVar12 = fVar10; } gridPathLimit = 0; (npc->_pathfinder)._evadeDistance = fVar12; local_104.x = (float)local_12c; local_e4.x = (float)local_12c; local_e4.y = local_104.y; local_dc = (EntityPtr)local_104.y; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x100); if ((bVar1 != 0) || (npc->_forcedTarget != (EntityPtr)0x0)) { gridPathLimit = 900; } bVar1 = Entity::IsFrame((Entity *)npc,0xe,npc->_index); if (bVar1 != 0) { Room::CheckLine(g_game->_room,&npc->_pos,&targetPos,1,gridPathLimit,0,0,(Vector *)0x0) ; if (isCharmed == 0) { bVar9 = (float)local_e8 == 170.0; bVar8 = 170.0 < (float)local_e8; } else { bVar9 = (float)local_e8 == 340.0; bVar8 = (float)local_e8 < 340.0; } if ((((bVar8 || bVar9) && (fVar10 = sqrtf((local_104.y - (float)local_f4) * (local_104.y - (float)local_f4) + (local_104.x - (float)local_d4) * (local_104.x - (float)local_d4)), 60.0 <= fVar10)) && ((fVar10 <= 180.0 || (uVar5 = Random(), (uVar5 & 3) != 0)))) && (bVar1 = Room::CheckLine(g_game->_room,&local_118,&local_e4,3,999,0,0,(Vector *)0x0 ), bVar1 != 0)) { if (npc->_subtype == 1) { sideSign = &DAT_bf800000; } else { sideSign = (undefined1 *)0x3f800000; } if (((npc->_pos).x - ((Vector *)((int)linkedHeart + 0x33c))->x) * (float)sideSign <= 4.0) { evadeCountdownPtr = &(npc->_pathfinder)._evadeMovementCountdown; *evadeCountdownPtr = *evadeCountdownPtr + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); goto LAB_0051fa05; } } if ((npc->_pathfinder)._evadeMovementCountdown < 1) { (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; } (npc->_pathfinder)._evadeMovementCountdown = 3; } LAB_0051fa05: bVar1 = Entity::IsFrame((Entity *)npc,0x1e,npc->_index); if (bVar1 != 0) { std::set::clear(); } if ((npc->_pathfinder)._evadeMovementCountdown < 1) { *(undefined4 *)&(npc->_pathfinder).field_0x740 = 0; (npc->_pathfinder)._evadeDistance = (npc->_pathfinder)._evadeDistance * 0.9; PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,1); npc->_friction = npc->_friction * 0.9; } else { bVar1 = Vector::operator_eq(&(npc->_pathfinder)._movementTarget,&g_vectorZero); if ((bVar1 != 0) || (20.0 < (npc->_pathfinder)._evadeDistance)) { EVar13 = npc->_entityRef; local_f4 = *(EntityPtr *)((int)EVar13 + 0x340); fVar12 = *(float *)((int)EVar13 + 0x33c) - local_110->x; fVar10 = (float)local_f4 - local_110->y; local_d4 = (EntityPtr)sqrtf(fVar10 * fVar10 + fVar12 * fVar12); fVar12 = targetPos.x - (npc->_pos).x; fVar10 = targetPos.y - (npc->_pos).y; fVar10 = sqrtf(fVar10 * fVar10 + fVar12 * fVar12); local_d8 = (EntityPtr)0x3f800000; if (npc->_subtype == 1) { sideSign = &DAT_bf800000; } else { sideSign = (undefined1 *)local_d8; } fVar12 = (npc->_pos).x; local_10c = 0.0; pVVar14 = (Vector *)(fVar12 - *(float *)((int)EVar13 + 0x33c)); if ((float)sideSign * (float)pVVar14 <= 0.0) { if (((float)local_d4 <= fVar10) || (250.0 <= fVar10)) { local_104.y = (npc->_pos).y - (float)local_f4; local_104.x = (float)pVVar14; } else { local_104.y = (npc->_pos).y - targetPos.y; local_104.x = (float)(fVar12 - targetPos.x); } pVVar14 = Vector::Normalized(&local_104,&local_118); local_d8 = (EntityPtr)pVVar14->x; local_10c = pVVar14->y; } else if (npc->_subtype != 1) { local_d8 = (EntityPtr)&DAT_bf800000; } if (ABS(ABS((float)local_d8) - ABS(local_10c)) < 0.25) { uVar5 = Random(); if ((uVar5 & 1) == 0) { local_d8 = (EntityPtr)((float)local_d8 * 0.5); } else { local_10c = local_10c * 0.5; } } fVar10 = npc->_friction; if (fVar10 != 0.0) { fVar12 = npc->_speedMultiplier; (npc->_velocity).x = ((float)local_d8 * 1.5 * fVar12) / fVar10 + (npc->_velocity).x; (npc->_velocity).y = (local_10c * 1.5 * fVar12) / fVar10 + (npc->_velocity).y; } local_f4 = (EntityPtr)0xc9742400; local_d8 = (EntityPtr)((float)local_d8 * 30.0 + (npc->_pos).x); local_10c = local_10c * 30.0 + (npc->_pos).y; bestTargetX = g_vectorZero.x; bestTargetY = g_vectorZero.y; local_ec = 0.0; if (0.0 < 7.0 - (npc->_pathfinder)._evadeDistance * 0.3) { do { uVar5 = Random(); local_e8 = (Vector *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 450.0 + 30.0); uVar5 = Random(); fVar10 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d4 = (EntityPtr)(fVar10 + fVar10); fVar10 = cos((float)local_d4); local_110 = (Vector *)(fVar10 * (float)local_e8 + (float)local_d8); local_104.x = (float)local_110; fVar10 = sin((float)local_d4); local_104.y = fVar10 * 0.5 * (float)local_e8 + local_10c; iVar6 = (int)(((float)local_110 - 40.0) / 40.0 + 0.5); iVar3 = (int)((local_104.y - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (iVar7 = *(int *)((int)g_game->_room + 0xc), iVar7 <= iVar6)) || (iVar3 < 0)) || (*(int *)((int)g_game->_room + 0x10) <= iVar3)) { pVVar14 = (Vector *)0xffffffff; } else { pVVar14 = (Vector *)(iVar7 * iVar3 + iVar6); } local_e8 = pVVar14; std::set::find_node(local_138,&local_e8); if (((*(char *)(local_130 + 0xd) == '\0') && (*(int *)(local_130 + 0x10) <= (int)pVVar14)) && (local_130 != *(uint *)&npc->field_0xb5c)) { local_ec = local_ec - 0.7; } else { std::set::insert(visitedGridSet,&local_e8); room = g_game->_room; iVar3 = room->_gridWidth; local_104.x = (float)((int)local_e8 % iVar3) * 40.0 + 40.0; local_104.y = (float)((int)local_e8 / iVar3) * 40.0 + 120.0; iVar7 = (int)((local_104.x - 40.0) / 40.0 + 0.5); iVar6 = (int)((local_104.y - 120.0) / 40.0 + 0.5); if (((iVar7 < 0) || (iVar3 <= iVar7)) || ((iVar6 < 0 || (room->_gridHeight <= iVar6)))) { iVar7 = -1; } else { iVar7 = iVar3 * iVar6 + iVar7; } local_e8 = (Vector *)local_104.x; local_d4 = (EntityPtr)local_104.y; uVar5 = Room::GetGridCollision(room,iVar7); if (uVar5 == 0) { bVar1 = Room::CheckLine(room,&npc->_pos,&local_104,1,gridPathLimit, (npc->_pathfinder)._canCrushRocks,0,(Vector *)0x0); if (bVar1 != 0) { if (npc->_subtype == 1) { sideSign = &DAT_bf800000; } else { sideSign = (undefined1 *)0x3f800000; } if (((float)local_e8 - (float)local_12c) * (float)sideSign <= 4.0) { isPlayerLineClear = Room::CheckLine(g_game->_room,&targetPos,&local_104,3,999,0,0, (Vector *)0x0); bVar1 = Room::CheckLine(g_game->_room,&local_e4,&local_104,3,999,0,0, (Vector *)0x0); if (isCharmed == 0) { sideSign = (undefined1 *)0x3f800000; } else { sideSign = &DAT_bf800000; } if (bVar1 == 0) { blockedPenalty = 90000.0; } else { blockedPenalty = 0.0; } local_110 = (Vector *)0x0; if ((isCharmed == 0) && (isPlayerLineClear == 0)) { local_110 = (Vector *)0x471c4000; } candidateDy = (float)local_d4 - targetPos.y; local_118.y = (float)local_e8 - targetPos.x; local_12c = (Vector *)local_e4.x; local_dc = (EntityPtr)local_e4.y; playerDistScore = (candidateDy * candidateDy + local_118.y * local_118.y) * (float)sideSign * 0.25; fVar10 = sqrtf(((float)local_d4 - local_e4.y) * ((float)local_d4 - local_e4.y) + ((float)local_e8 - local_e4.x) * ((float)local_e8 - local_e4.x)); fVar10 = pow(fVar10 - 170.0,2.0); EVar13 = (EntityPtr) ((((playerDistScore - fVar10) - (((float)local_dc - targetPos.y) * candidateDy + ((float)local_12c - targetPos.x) * local_118.y)) - blockedPenalty) + (float)local_110); if ((float)local_f4 < (float)EVar13) { bestTargetX = (float)local_e8; bestTargetY = (float)local_d4; local_f4 = EVar13; } } } if ((bestTargetX != g_vectorZero.x) || (bestTargetY != g_vectorZero.y)) { (npc->_pathfinder)._movementTarget.y = bestTargetY; (npc->_pathfinder)._movementTarget.x = bestTargetX; fVar10 = (npc->_pathfinder)._evadeDistance; if (fVar10 < 20.0) { (npc->_pathfinder)._evadeDistance = fVar10 * 0.5; } } } } local_ec = local_ec + 1.0; } while (local_ec < 7.0 - (npc->_pathfinder)._evadeDistance * 0.3); } } pVVar14 = &(npc->_pathfinder)._movementTarget; bVar1 = Vector::operator_ne(pVVar14,&g_vectorZero); if (bVar1 != 0) { bVar1 = Entity::IsFrame((Entity *)npc,10,npc->_index); if (bVar1 != 0) { bVar1 = Room::CheckLine(g_game->_room,&targetPos,pVVar14,1,gridPathLimit, (npc->_pathfinder)._canCrushRocks,0,(Vector *)0x0); if ((bVar1 == 0) || (evadeDistancePtr = &(npc->_pathfinder)._evadeDistance, 20.0 < *evadeDistancePtr || *evadeDistancePtr == 20.0)) { fVar10 = pVVar14->x; fVar12 = (npc->_pathfinder)._movementTarget.y; fVar11 = targetPos.y - fVar12; if ((40000.0 <= fVar11 * fVar11 + (targetPos.x - fVar10) * (targetPos.x - fVar10)) && (fVar12 = (float)local_dc - fVar12, 3600.0 <= fVar12 * fVar12 + ((float)local_12c - fVar10) * ((float)local_12c - fVar10))) { if (npc->_subtype == 1) { sideSign = &DAT_bf800000; } else { sideSign = (undefined1 *)0x3f800000; } if ((fVar10 - (float)local_12c) * (float)sideSign <= 0.0) goto LAB_0052037e; } } pVVar14->x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; } LAB_0052037e: bVar1 = Vector::operator_ne(pVVar14,&g_vectorZero); if (bVar1 != 0) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar14,1.079,0,1); } } } EVar13 = linkedHeart; } else { bVar1 = Entity_NPC::IsControllerActionPressed((Entity_NPC *)EVar13,0xb); if (bVar1 == 0) { npc->_controllerID = *(int *)((int)EVar13 + 0xf1c); PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&targetPos,0); npc->_controllerID = -1; } else { npc->_friction = npc->_friction * 0.5; } } } else { PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&targetPos,0); } iVar3 = Entity::GetIntervalTicks((Entity *)npc,12.0,0.0); if (iVar3 != 0) { ProjectileParams::ProjectileParams(¶ms); local_e4.x = ((Vector *)((int)EVar13 + 0x33c))->x - (npc->_pos).x; local_e4.y = *(float *)((int)EVar13 + 0x340) - (npc->_pos).y; params.BulletFlags._0_4_ = 0; params.BulletFlags._4_4_ = 0x200; params.Scale = 0.6; params.FallingAccelModifier = -0.09; Vector::Normalized(&local_e4,&local_104); local_e4.x = local_104.x * 7.0; local_e4.y = local_104.y * 7.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_e4,0,¶ms); } } } else { PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&targetPos,0); } npc->_friction = npc->_friction * 0.8; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } uVar5 = *(uint *)((int)&npc->_flags + 4) & 0x10000000; if ((uVar5 == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { if (npc->_controllerID == -1) { bVar1 = Entity::IsFrame((Entity *)npc,3,0); } else { bVar1 = input_is_action_pressed(8,npc->_controllerID,(Entity *)npc,uVar5); } if ((bVar1 != 0) && ((npc->_flags & 0x1000a00) == 0)) { if ((npc->_type == 0x5c) && (npc->_variant == 1)) { if (npc->_entityRef == (EntityPtr)0x0) { if (0 < npc->_projectileCooldown) goto LAB_005205e8; npc->_state = 8; npc->_stateFrame = 0; npc->_projectileCooldown = 10; } } else { LAB_005205e8: if ((npc->_controllerID != -1) || (fVar10 = targetPos.x - (npc->_pos).x, fVar12 = targetPos.y - (npc->_pos).y, fVar12 * fVar12 + fVar10 * fVar10 < 10000.0)) { npc->_state = 8; npc->_stateFrame = 0; } } } } } else { npc->_friction = npc->_friction * 0.7; ANM2::Play(&npc->_sprite,(byte *)"HeartAttack",0); if (npc->_controllerID != -1) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,0.2,0,1); } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_005209b3: npc->_state = 4; } else { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { pVVar14 = &npc->_pos; if (npc->_type == 0x62) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); if (npc->_subtype == 1) { ProjectileParams::ProjectileParams(¶ms); params.BulletFlags._0_4_ = (uint)params.BulletFlags | 1; local_e4.x = 0.0; local_e4.y = -20.0; pEVar2 = spawn_blood_explosion(4,pVVar14,&local_e4,&npc->_splatColor,&g_vectorZero); (**(code **)(*(int *)pEVar2 + 0x3c))(&DAT_00c34da4,0xffffffff,0xff,0,1); projParams = ¶ms; local_e4.x = 8.0; uVar5 = 6; } else { local_e4.x = 0.0; local_e4.y = -20.0; spawn_blood_explosion(4,pVVar14,&local_e4,&npc->_splatColor,&g_vectorZero); projParams = ProjectileParams::ProjectileParams(¶ms); local_e4.x = 12.0; uVar5 = 8; } local_e4.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar14,&local_e4,uVar5,projParams); uVar5 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 + 0.6); uVar5 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.6); uVar5 = Random(); local_dc = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10); uVar5 = Random(); local_dc = (EntityPtr)((float)local_dc * 3.1415927); fVar10 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; fVar10 = cos(fVar10 + fVar10); local_118.y = fVar10 * 10.0 + (npc->_pos).x; fVar12 = sin((float)local_dc + (float)local_dc); fVar10 = (npc->_pos).y; (splat->_pos).x = local_118.y; (splat->_pos).y = fVar12 * 10.0 + 12.0 + fVar10; } else { local_e4.x = 0.0; local_e4.y = -20.0; spawn_blood_explosion(2,pVVar14,&local_e4,&npc->_splatColor,&g_vectorZero); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); projParams = ProjectileParams::ProjectileParams(¶ms); local_e4.x = 12.0; local_e4.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar14,&local_e4,7 - (npc->_variant != 1),projParams); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_005209b3; } npc->_stateFrame = npc->_stateFrame + 1; } if (npc->_dead == 0) { ExceptionList = local_1c; return; } if (npc->_controllerID != -1) { local_dc = npc->_entityRef; if ((((local_dc == (EntityPtr)0x0) || (bVar1 = Entity::IsEnemy((Entity *)local_dc), bVar1 == 0)) || (*(byte *)((int)local_dc + 0x173) != 0)) || (*(int *)((int)local_dc + 0xf1c) != -1)) { EVar13 = npc->_child; local_d4 = EVar13; if (((EVar13 == (EntityPtr)0x0) || (*(int *)((int)EVar13 + 0x28) != 0x61)) || ((*(byte *)((int)EVar13 + 0x173) != 0 || ((*(int *)((int)EVar13 + 0xf1c) != -1 || (EVar13 == (EntityPtr)npc)))))) goto LAB_00520bd2; local_f4 = (EntityPtr)0x0; pvVar4 = (g_game->_playerManager)._extraPlayers._begin; if ((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar4 >> 2 != 0) { do { iVar3 = *(int *)((int)pvVar4 + (int)local_f4 * 4); if (*(int *)(iVar3 + 0x1618) == npc->_controllerID) { controlledEntitySlot = (EntityPtr)(iVar3 + 0x3c4); if (*(Entity_NPC **)(iVar3 + 0x3c4) == npc) { if (*(Entity_NPC **)(iVar3 + 0x3c4) != (Entity_NPC *)0x0) { local_118.y = (float)controlledEntitySlot; std::multiset::erase(&local_118.y); EVar13 = local_d4; } *(EntityPtr *)controlledEntitySlot = EVar13; std::multiset::insert(controlledEntitySlot); EVar13 = local_d4; } } local_f4 = (EntityPtr)((int)local_f4 + 1); pvVar4 = (g_game->_playerManager)._extraPlayers._begin; } while ((uint)local_f4 < (uint)((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar4 >> 2)); } } else { if (local_dc == (EntityPtr)npc) goto LAB_00520bd2; local_d4 = (EntityPtr)0x0; pvVar4 = (g_game->_playerManager)._extraPlayers._begin; EVar13 = local_dc; if ((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar4 >> 2 != 0) { do { iVar3 = *(int *)((int)pvVar4 + (int)local_d4 * 4); if (*(int *)(iVar3 + 0x1618) == npc->_controllerID) { controlledEntitySlot = (EntityPtr)(iVar3 + 0x3c4); if (*(Entity_NPC **)(iVar3 + 0x3c4) == npc) { if (*(Entity_NPC **)(iVar3 + 0x3c4) != (Entity_NPC *)0x0) { local_118.y = (float)controlledEntitySlot; std::multiset::erase(&local_118.y); EVar13 = local_dc; } *(EntityPtr *)controlledEntitySlot = EVar13; std::multiset::insert(controlledEntitySlot); EVar13 = local_dc; } } local_d4 = (EntityPtr)((int)local_d4 + 1); pvVar4 = (g_game->_playerManager)._extraPlayers._begin; } while ((uint)local_d4 < (uint)((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar4 >> 2)); } } *(int *)((int)EVar13 + 0xf1c) = npc->_controllerID; npc->_controllerID = -1; } LAB_00520bd2: if (((npc->_dead != 0) && (npc->_spawnerType == 0x1c)) && (npc->_parent != (EntityPtr)0x0)) { Entity_NPC::PlaySound(npc,0x75,0.5,2,0,1.0); takeDamageFn = *(code **)(*(int *)npc->_parent + 0x20); EntityRef::constructor(&sourceRef,(Entity *)selfNpc); (*takeDamageFn)(0x42200000,0,0,&sourceRef,0x1e); } ExceptionList = local_1c; return; } //@@ 00520c60 NpcAI::ENTITY_STONEHEAD /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 42 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_STONEHEAD(Entity_NPC *npc) { EntityPtr *pEVar1; int iVar2; undefined4 uVar3; byte bVar4; float *extraout_EAX; RoomDescriptor *roomDesc; ColorMod *color; float *laserPosNull; EntityPtr laser; EntityPtr **ppEVar5; Vector *pVVar6; Entity *target; Vector *aimPos; int3 extraout_var; uint uVar7; char *expectedAnimChar; int iVar8; EntityPtr **ppEVar9; int iVar10; uint uVar11; bool bVar12; float fVar13; float fVar14; float fVar15; float aimDirY; byte *pbVar16; Vector local_114; EntityPtr *local_10c; EntityPtr *local_108; float pushDirX; Vector local_100; float local_f8; Vector *local_f4; Vector local_f0; EntityPtr *local_e8; char isActive; Color splatColor; ProjectileParams projParams; float local_8; local_8 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); local_f0.y = (float)npc; if (npc->_aiCallPhase == 1) { if (npc->_minecart != (EntityPtr)0x0) { return; } if (npc->_dead != 0) { return; } iVar8 = (npc->_pathfinder)._gridIndex; if (iVar8 < 0) { return; } Room::SetGridPath(g_game->_room,iVar8,3999); return; } iVar8 = npc->_state; if (iVar8 == 0) { PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); iVar10 = (npc->_pathfinder)._gridIndex; iVar2 = *(int *)((int)g_game->_room + 0xc); npc->_isInvicible = 1; npc->_aiCallFlags = 1; (npc->_targetPosition).x = (float)(iVar10 % iVar2) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar10 / iVar2) * 40.0 + 120.0; uVar11 = *(uint *)((int)&npc->_flags + 4); uVar7 = (uint)npc->_flags | 0x40000001; iVar10 = npc->_type; *(uint *)&npc->_flags = uVar7; *(uint *)((int)&npc->_flags + 4) = uVar11 | 8; if (iVar10 != 0x2a) { *(uint *)&npc->_flags = uVar7; *(uint *)((int)&npc->_flags + 4) = uVar11 | 0x2008; } npc->_state = 3; if (iVar10 == 0xeb) { ANM2::Play(&npc->_sprite,(byte *)"Effect",0); ANM2::PlayOverlay(&npc->_sprite,(byte *)"Sucking",0); } Color::Color(&splatColor); if (&npc->_splatColor != (ColorMod *)extraout_EAX) { fVar15 = extraout_EAX[1]; fVar13 = extraout_EAX[2]; fVar14 = extraout_EAX[3]; (npc->_splatColor)._tint[0] = *extraout_EAX; (npc->_splatColor)._tint[1] = fVar15; (npc->_splatColor)._tint[2] = fVar13; (npc->_splatColor)._tint[3] = fVar14; fVar15 = extraout_EAX[5]; fVar13 = extraout_EAX[6]; fVar14 = extraout_EAX[7]; (npc->_splatColor)._colorize[0] = extraout_EAX[4]; (npc->_splatColor)._colorize[1] = fVar15; (npc->_splatColor)._colorize[2] = fVar13; (npc->_splatColor)._colorize[3] = fVar14; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(extraout_EAX + 8); (npc->_splatColor)._offset[2] = extraout_EAX[10]; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; } roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); isActive = '\x01'; iVar10 = npc->_type; uVar11 = (uint)roomDesc->Flags >> 1; if (iVar10 == 0xeb) { if (((uVar11 & 1) == 0) || (isActive = '\0', npc->_state == 0x10)) goto LAB_005210b1; npc->_state = 0x10; AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,(byte *)"TurnOff",0); if (iVar8 == 0) { uVar3 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar3; Sprite::SetLastFrame((Sprite *)&npc->_sprite); return; } } else { if (iVar10 == 0xec) { iVar10 = npc->_stateFrame % 0xf0; if (iVar10 == 0) { if ((uVar11 & 1) != 0) goto LAB_00520f05; ANM2::Play(&npc->_sprite,(byte *)"TurnOn",0); } else if (((0x95 < iVar10) || ((uVar11 & 1) != 0)) && ((iVar10 == 0x96 || ((uVar11 & 1) != 0))) ) { LAB_00520f05: if (npc->_state != 0x10) { if ((uVar11 & 1) != 0) { npc->_state = 0x10; } AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,(byte *)"TurnOff",0); if (iVar8 == 0) { uVar3 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar3; Sprite::SetLastFrame((Sprite *)&npc->_sprite); } } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar16 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar16 + 0x14)) { pbVar16 = *(byte **)pbVar16; } expectedAnimChar = "TurnOn"; do { bVar4 = *pbVar16; bVar12 = bVar4 < (byte)*expectedAnimChar; if (bVar4 != *expectedAnimChar) { LAB_00520f96: uVar7 = -(uint)bVar12 | 1; goto LAB_00520f9b; } if (bVar4 == 0) break; bVar4 = pbVar16[1]; bVar12 = bVar4 < (byte)expectedAnimChar[1]; if (bVar4 != expectedAnimChar[1]) goto LAB_00520f96; pbVar16 = pbVar16 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00520f9b: if (uVar7 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Effect",0); ANM2::PlayOverlay(&npc->_sprite,(byte *)"Sucking",0); } } if (((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) { pbVar16 = (npc->_sprite)._overlayAnimState._animData; if (0xf < *(uint *)(pbVar16 + 0x14)) { pbVar16 = *(byte **)pbVar16; } expectedAnimChar = "Sucking"; do { bVar4 = *pbVar16; bVar12 = bVar4 < (byte)*expectedAnimChar; if (bVar4 != *expectedAnimChar) { LAB_00521010: uVar7 = -(uint)bVar12 | 1; goto LAB_00521015; } if (bVar4 == 0) break; bVar4 = pbVar16[1]; bVar12 = bVar4 < (byte)expectedAnimChar[1]; if (bVar4 != expectedAnimChar[1]) goto LAB_00521010; pbVar16 = pbVar16 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00521015: if (uVar7 == 0) { isActive = '\x01'; goto LAB_005210b1; } } } else if (iVar10 == 0xcb) { LAB_00521058: if ((uVar11 & 1) == 0) goto LAB_005210b1; if (npc->_state != 0x10) goto LAB_00521065; } else if (npc->_state != 0x10) { iVar10 = Entity_NPC::GetAliveEnemyCount(npc); if ((0 < iVar10) || (0 < *(int *)((int)g_game->_room + 0x11ec))) goto LAB_00521058; LAB_00521065: npc->_state = 0x10; AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); ANM2::Play(&npc->_sprite,(byte *)"CloseEyes",0); if (iVar8 == 0) { uVar3 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar3; Sprite::SetLastFrame((Sprite *)&npc->_sprite); } } isActive = '\0'; LAB_005210b1: if (iVar8 == 0) { return; } } bVar4 = npc->_dead; local_100.y = (float)&npc->_pos; fVar15 = (npc->_targetPosition).y; fVar13 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - ((Vector *)local_100.y)->x; (npc->_velocity).y = fVar15 - fVar13; if ((bVar4 != 0) && (-1 < npc->_spawnGridIndex)) { Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); std::set::insert(&local_114,&npc->_spawnGridIndex); } iVar8 = npc->_type; if (isActive == '\0') { if ((iVar8 != 0xcb) || ((uVar11 & 1) == 0)) goto LAB_00521a96; pbVar16 = (byte *)"CloseEyes"; } else { if (iVar8 != 0x2a) { if ((iVar8 == 0xeb) || (iVar8 == 0xec)) { local_114.y = (float)g_game->_room; if (*(int *)((int)local_114.y + 0x1264) != 0) { uVar11 = 0; pVVar6 = &npc->_pos; do { iVar8 = *(int *)(*(int *)((int)local_114.y + 0x125c) + uVar11 * 4); if ((*(char *)(iVar8 + 0x173) == '\0') && (((iVar10 = *(int *)(iVar8 + 0x28), iVar10 == 1 || (iVar10 == 2)) || (iVar10 == 9)))) { pushDirX = *(float *)(iVar8 + 0x33c); fVar15 = *(float *)(iVar8 + 0x340); if ((iVar10 == 1) && (iVar2 = *(int *)(iVar8 + 0x1e68), iVar2 != 0)) { fVar14 = pushDirX - *(float *)(iVar2 + 0x33c); fVar13 = fVar15 - *(float *)(iVar2 + 0x340); if (fVar13 * fVar13 + fVar14 * fVar14 < 2704.0) { pushDirX = (pushDirX + *(float *)(iVar2 + 0x33c)) * 0.5; fVar15 = (fVar15 + *(float *)(iVar2 + 0x340)) * 0.5; } } local_108 = (EntityPtr *)pVVar6->x; local_10c = (EntityPtr *)pVVar6->y; pushDirX = (float)local_108 - pushDirX; local_f4 = (Vector *)((float)local_10c - fVar15); fVar15 = sqrtf((float)local_f4 * (float)local_f4 + pushDirX * pushDirX); if (0.0 < fVar15) { pushDirX = (1.0 / fVar15) * pushDirX; local_f4 = (Vector *)((float)local_f4 * (1.0 / fVar15)); } local_f8 = 0.9; local_e8 = (EntityPtr *)0x3f666666; if (iVar10 == 1) { local_f8 = 0.6; local_e8 = (EntityPtr *)0x3f19999a; } fVar15 = (float)local_10c - *(float *)(iVar8 + 0x340); fVar13 = (float)local_108 - *(float *)(iVar8 + 0x33c); fVar13 = sqrtf(fVar15 * fVar15 + fVar13 * fVar13); fVar15 = *(float *)(iVar8 + 0x36c); local_108 = (EntityPtr *)0x0; local_10c = (EntityPtr *)(((300.0 - fVar13) * local_f8) / 300.0); ppEVar9 = &local_10c; if ((float)local_10c <= 0.0) { ppEVar9 = &local_108; } ppEVar5 = &local_e8; if ((float)*ppEVar9 <= local_f8 && local_f8 != (float)*ppEVar9) { ppEVar5 = ppEVar9; } pEVar1 = *ppEVar5; if (fVar15 != 0.0) { *(float *)(iVar8 + 0x364) = (*(float *)(iVar8 + 0x39c) * (float)pEVar1 * (float)local_f4) / fVar15 + *(float *)(iVar8 + 0x364); *(float *)(iVar8 + 0x360) = (*(float *)(iVar8 + 0x39c) * (float)pEVar1 * pushDirX) / fVar15 + *(float *)(iVar8 + 0x360); } } uVar11 = uVar11 + 1; pVVar6 = (Vector *)local_100.y; } while (uVar11 < *(uint *)((int)local_114.y + 0x1264)); npc = (Entity_NPC *)local_f0.y; } } else if (iVar8 == 0xcb) { if (3 < (uint)npc->_subtype) { KAGE_LogMessage(0x10,(byte *)"Brimstone Head can only have 0-3 subtypes!"); } if (npc->_state == 3) { uVar7 = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar11 = 3; if (uVar7 < 3) { uVar11 = uVar7; } ANM2::Play(&npc->_sprite,(&PTR_s_IdleLeft_00b61560)[uVar11],0); if (((*(char *)g_game->_room != '\0') && (iVar8 = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0), 0x1e < iVar8)) && (iVar8 % 0x5a == 0)) { npc->_state = 8; color = (ColorMod *)Color::Color(0x3f4ccccd); local_e8 = (EntityPtr *) (((float)((double)npc->_subtype + __uint_to_double_fixup[-(npc->_subtype >> 0x1f)]) * 90.0 - 180.0) * 0.017453292); local_f0.x = cos((float)local_e8); local_f0.y = sin((float)local_e8); local_100.x = 0.0; local_100.y = -6.0; Entity::SpawnFollowingEffect198((Entity *)npc,&local_100,&local_f0,0x1a,color,4.0); } } else if (npc->_state == 8) { uVar7 = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar11 = 3; if (uVar7 < 3) { uVar11 = uVar7; } ANM2::Play(&npc->_sprite,(&PTR_s_ShootLeft_00b61540)[uVar11],0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { laserPosNull = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"LaserPos"); local_f0.x = *laserPosNull / 0.65; local_f0.y = laserPosNull[1] / 0.65; laser = (EntityPtr) Entity_Laser::ShootAngle (1,&npc->_pos, (float)((double)npc->_subtype + __uint_to_double_fixup[-(npc->_subtype >> 0x1f)]) * 90.0 - 180.0,0xf,&local_f0,(Entity *)npc,0); if (npc->_subtype == 1) { fVar15 = -10.0; } else { fVar15 = 10.0; } *(float *)((int)laser + 0x358) = fVar15; (**(code **)(*(int *)laser + 0xc))(); pEVar1 = &npc->_target; if (npc->_target != (EntityPtr)0x0) { local_e8 = pEVar1; std::multiset::erase(&local_e8); } *pEVar1 = laser; std::multiset::insert(pEVar1); } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (npc->_target == (EntityPtr)0x0)) { npc->_state = 3; } } } goto LAB_00521a96; } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } Entity_NPC::SpawnControlTarget(npc,0,-1.0); if (npc->_projectileCooldown < 1) { if (npc->_controllerID == -1) { bVar4 = Entity_NPC::IsTargetInAttackRange(npc,200.0,0,7); } else { bVar4 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar4 == 0) goto LAB_0052176b; pVVar6 = Entity_NPC::GetAimTargetPosition(npc,&local_f0); bVar4 = Vector::operator_ne(pVVar6,&g_vectorZero); } if (bVar4 != 0) { npc->_projectileCooldown = 0x54; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Shoot",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } LAB_0052176b: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar4 != 0)) { Entity_NPC::PlaySound(npc,0x106,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.101; projParams.HeightModifier = 13.0; local_e8 = (EntityPtr *)0x41200000; if (npc->_variant == 1) { local_f0.y = projParams.VelocityMulti * 0.55; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 2; projParams.Scale = 1.6; projParams.FallingSpeedModifier = -30.5; projParams.FallingAccelModifier = 0.92; projParams.Color._colorize[0] = 0.4; projParams.Color._colorize[1] = 2.0; projParams.Color._colorize[2] = 0.5; projParams.Color._colorize[3] = 1.0; projParams.VelocityMulti = local_f0.y; if (npc->_controllerID != -1) { pVVar6 = Entity_NPC::GetAimTargetPosition(npc,&local_114); fVar15 = (npc->_pos).y - pVVar6->y; fVar13 = (npc->_pos).x - pVVar6->x; fVar15 = sqrtf(fVar15 * fVar15 + fVar13 * fVar13); local_f0.y = fVar15 / (local_f0.y * 10.0); fVar15 = pow(0.9,local_f0.y); projParams.FallingSpeedModifier = (fVar15 - 1.0) * -9.491221; if (projParams.FallingSpeedModifier <= 0.01) { projParams.FallingSpeedModifier = 0.01; } projParams.FallingSpeedModifier = (5.0 - (local_f0.y - projParams.FallingSpeedModifier) * 10.2) / projParams.FallingSpeedModifier; if (projParams.FallingSpeedModifier <= -38.0) { projParams.FallingSpeedModifier = -38.0; } if (-5.0 <= projParams.FallingSpeedModifier) { projParams.FallingSpeedModifier = -5.0; } } } pVVar6 = &npc->_pos; uVar11 = 3; if (npc->_variant != 2) { uVar11 = 0; } target = Entity_NPC::GetPlayerTarget(npc); fVar15 = pVVar6->x; fVar13 = (npc->_pos).y; fVar14 = (target->_pos).x - fVar15; aimDirY = (target->_pos).y - fVar13; local_100.x = fVar14; local_100.y = aimDirY; local_f8 = fVar14; local_f4 = (Vector *)aimDirY; if (npc->_controllerID != -1) { aimPos = Entity_NPC::GetAimTargetPosition(npc,&local_f0); bVar4 = Vector::operator_ne(aimPos,pVVar6); if (bVar4 != 0) { aimPos = Entity_NPC::GetAimTargetPosition(npc,&local_f0); aimDirY = aimPos->y - fVar13; fVar14 = aimPos->x - fVar15; local_100.x = fVar14; local_100.y = aimDirY; local_f8 = fVar14; local_f4 = (Vector *)aimDirY; } } bVar4 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar4) == 0 || extraout_var < 0) { local_e8 = (EntityPtr *)0x40e00000; } fVar15 = sqrtf(aimDirY * aimDirY + fVar14 * fVar14); if (0.0 < fVar15) { local_100.x = local_f8 * ((float)local_e8 / fVar15); local_100.y = (float)local_f4 * ((float)local_e8 / fVar15); } Entity_NPC::FireProjectiles(npc,pVVar6,&local_100,uVar11,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00521a96; pbVar16 = s_Idle; } ANM2::Play(&npc->_sprite,pbVar16,0); LAB_00521a96: npc->_stateFrame = npc->_stateFrame + 1; return; } //@@ 00521ab0 NpcAI::ENTITY_POKY /* NPC AI for entity type 44 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_POKY(Entity_NPC *npc) { float fVar1; char *pcVar2; byte bVar3; RoomDescriptor *roomDesc; float *extraout_EAX; Vector *cardinalDir; Entity *target; int iVar4; uint randomValue; int iVar5; undefined1 *dashDirY; float fVar6; float fVar7; undefined1 homeSpeed [12]; Vector local_58; Vector local_50; float local_48; Vector local_44; Vector local_3c; Color defaultColor; uint *flagsHigh; Game *game; void *initRoom; bool isSettled; qword oldFlags; Room *room; roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); local_50.x = (float)((uint)roomDesc->Flags >> 1 & 0xffffff01); if (npc->_state == 0) { oldFlags = npc->_flags; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; npc->_state = 4; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x10001; game = g_game; initRoom = g_game->_room; local_58.x = (float)(int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if (((((int)local_58.x < 0) || (iVar4 = *(int *)((int)initRoom + 0xc), iVar4 <= (int)local_58.x) ) || (iVar5 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), iVar5 < 0)) || (*(int *)((int)initRoom + 0x10) <= iVar5)) { iVar4 = *(int *)((int)initRoom + 0xc); iVar5 = -1; } else { iVar5 = iVar4 * iVar5 + (int)local_58.x; } (npc->_v1).x = (float)(iVar5 % iVar4) * 40.0 + 40.0; (npc->_v1).y = (float)(iVar5 / iVar4) * 40.0 + 120.0; pcVar2 = game->_room; if (((*pcVar2 != '\0') && (game->_frameCount == *(int *)(pcVar2 + 0x11f0))) && (local_50.x._0_1_ != '\0')) { (**(code **)(*(int *)npc + 0x28))(); } Color::Color(&defaultColor); if (&npc->_splatColor != (ColorMod *)extraout_EAX) { fVar6 = extraout_EAX[1]; fVar7 = extraout_EAX[2]; fVar1 = extraout_EAX[3]; (npc->_splatColor)._tint[0] = *extraout_EAX; (npc->_splatColor)._tint[1] = fVar6; (npc->_splatColor)._tint[2] = fVar7; (npc->_splatColor)._tint[3] = fVar1; fVar6 = extraout_EAX[5]; fVar7 = extraout_EAX[6]; fVar1 = extraout_EAX[7]; (npc->_splatColor)._colorize[0] = extraout_EAX[4]; (npc->_splatColor)._colorize[1] = fVar6; (npc->_splatColor)._colorize[2] = fVar7; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = *(undefined8 *)(extraout_EAX + 8); (npc->_splatColor)._offset[2] = extraout_EAX[10]; } (npc->_splatColor)._colorize[0] = 1.0; (npc->_splatColor)._colorize[1] = 1.0; (npc->_splatColor)._colorize[2] = 1.0; (npc->_splatColor)._colorize[3] = 1.0; return; } PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); iVar4 = npc->_state; if (iVar4 != 4) { if (iVar4 == 8) { if ((npc->_collidesWithGrid == 0) && (npc->_collidesWithEntity == 0)) { fVar6 = npc->_friction * 0.8; npc->_friction = fVar6; if (fVar6 != 0.0) { fVar7 = npc->_speedMultiplier; (npc->_velocity).x = (fVar7 * (npc->_targetPosition).x) / fVar6 + (npc->_velocity).x; (npc->_velocity).y = (fVar7 * (npc->_targetPosition).y) / fVar6 + (npc->_velocity).y; } iVar4 = (npc->_pathfinder)._gridIndex; fVar6 = npc->_speedMultiplier; iVar5 = *(int *)((int)g_game->_room + 0xc); fVar7 = 0.5; if (ABS((npc->_targetPosition).x) <= ABS((npc->_targetPosition).y)) { (npc->_pos).x = (npc->_pos).x * 0.5 + ((float)(iVar4 % iVar5) * 40.0 + 40.0) * 0.5; if (fVar6 != 1.0) { fVar7 = 0.5 / ((fVar6 + 0.5) - fVar6 * 0.5); } (npc->_velocity).x = fVar7 * (npc->_velocity).x; } else { (npc->_pos).y = (npc->_pos).y * 0.5 + ((float)(iVar4 / iVar5) * 40.0 + 120.0) * 0.5; if (fVar6 != 1.0) { fVar7 = 0.5 / ((fVar6 + 0.5) - fVar6 * 0.5); } (npc->_velocity).y = fVar7 * (npc->_velocity).y; } } else { (npc->_pathfinder)._movementTarget.x = g_vectorZero.x; (npc->_pathfinder)._movementTarget.y = g_vectorZero.y; (npc->_pathfinder)._moveDirection.x = g_vectorZero.x; (npc->_pathfinder)._moveDirection.y = g_vectorZero.y; npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } } else if (iVar4 == 0x10) { ANM2::Play(&npc->_sprite,(byte *)"No-Spikes",0); npc->_collisionDamage = 0.0; npc->_friction = npc->_friction * 0.9; } goto LAB_0052232c; } isSettled = true; if (npc->_variant == 0) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.0,0); } else { local_58.x = (npc->_pos).y - (npc->_v1).y; local_50.x = (npc->_pos).x - (npc->_v1).x; fVar6 = sqrtf(local_58.x * local_58.x + local_50.x * local_50.x); if (fVar6 == 0.0) { fVar6 = 0.001; } homeSpeed = ZEXT812(0x3fe66666); if (fVar6 / 10.0 <= homeSpeed._0_4_) { homeSpeed._4_8_ = homeSpeed._4_8_; homeSpeed._0_4_ = fVar6 / 10.0; } fVar6 = homeSpeed._0_4_ / fVar6; isSettled = homeSpeed._0_4_ < 0.4; fVar7 = npc->_friction; if (fVar7 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).x = (-local_50.x * fVar6 * fVar1) / fVar7 + (npc->_velocity).x; (npc->_velocity).y = (-local_58.x * fVar6 * fVar1) / fVar7 + (npc->_velocity).y; } } iVar4 = npc->_controllerID; npc->_friction = npc->_friction * 0.8; if ((((iVar4 == -1) && (bVar3 = Entity::IsFrame((Entity *)npc,3,npc->_index), bVar3 == 0)) || (!isSettled)) || ((npc->_updateTime <= 30.0 || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 != 0)))) goto LAB_0052232c; if (iVar4 == -1) { room = g_game->_room; target = Entity_NPC::GetPlayerTarget(npc); local_58.x = (target->_pos).x; local_44.x = (target->_pos).y; target = Entity_NPC::GetPlayerTarget(npc); local_50.x = (target->_velocity).x; local_48 = (target->_velocity).y; randomValue = Random(); fVar6 = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 16.0; local_50.y = fVar6 * local_48 + local_44.x; local_50.x = fVar6 * local_50.x + local_58.x; Room::GetClampedPositionImpl(room,&local_58,&local_50,20.0,20.0,20.0,20.0); room = g_game->_room; iVar4 = (npc->_pathfinder)._gridIndex; iVar5 = room->_gridWidth; local_3c.x = (float)(iVar4 % iVar5) * 40.0 + 40.0; local_3c.y = (float)(iVar4 / iVar5) * 40.0 + 120.0; local_50.x = local_3c.x - local_58.x; local_44.x = local_3c.y - local_58.y; local_48 = ABS(local_50.x); if (((local_48 < 20.0) || (ABS(local_44.x) < 20.0)) && ((fVar6 = sqrtf(local_44.x * local_44.x + local_50.x * local_50.x), fVar6 < 200.0 && (bVar3 = Room::CheckLine(room,&local_3c,&local_58,0,0,0,0,(Vector *)0x0), bVar3 != 0)))) { if (local_48 <= ABS(local_44.x)) { (npc->_targetPosition).x = 0.0; if (0.0 <= local_44.x) { dashDirY = &DAT_bf800000; } else { dashDirY = (undefined1 *)0x3f800000; } (npc->_targetPosition).y = (float)dashDirY; } else { (npc->_targetPosition).y = 0.0; if (0.0 <= local_50.x) { (npc->_targetPosition).x = (float)&DAT_bf800000; } else { (npc->_targetPosition).x = 1.0; } } LAB_00522092: npc->_state = 8; } } else { if (npc->_variant != 1) goto LAB_0052232c; Entity_NPC::GetControllerInput(npc,&local_44,0.1); if ((local_44.x != g_vectorZero.x) || (local_44.y != g_vectorZero.y)) { cardinalDir = Vector::ToCardinal(&local_3c,&local_44); (npc->_targetPosition).x = cardinalDir->x; (npc->_targetPosition).y = cardinalDir->y; goto LAB_00522092; } } if ((npc->_variant == 1) && (npc->_state == 8)) { (npc->_targetPosition).x = (npc->_targetPosition).x * 2.7225; (npc->_targetPosition).y = (npc->_targetPosition).y * 2.7225; } LAB_0052232c: iVar4 = Entity_NPC::GetAliveEnemyCount(npc); if (((((iVar4 < 1) && (pcVar2 = g_game->_room, *pcVar2 != '\0')) && (0x50 < g_game->_frameCount - *(int *)(pcVar2 + 0x11f0))) && ((npc->_variant != 1 && (pcVar2[0x7229] == '\0')))) || ((roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx), ((uint)roomDesc->Flags >> 1 & 1) != 0 || (bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar3 != 0)))) { npc->_state = 0x10; } if (npc->_dead != 0) { if (-1 < npc->_spawnGridIndex) { Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); std::set::insert(&local_3c,&npc->_spawnGridIndex); if (npc->_dead == 0) { return; } } if (npc->_variant == 0) { randomValue = Random(); Game::SpawnEx(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)npc,2,randomValue,0); } } return; } //@@ 00522430 NpcAI::ENTITY_LUMP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 56 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_LUMP(Entity_NPC *npc) { Room *pRVar1; byte bVar2; Vector *pVVar3; int iVar4; uint uVar5; Entity *target; Entity_Player *nearestPlayer; EntityRef *damageSource; ColorMod *color; int unused; int iVar6; float fVar7; float fVar8; Vector *unused2; Vector overlayOffset; Vector local_108; Vector local_100; Vector local_f4; char isSeekTarget; ProjectileParams projParams; undefined1 local_40 [44]; undefined4 local_14; Manager *manager; void *room; local_14 = __security_cookie ^ (uint)(local_40 + 0x30); if (npc->_state == 0) { (npc->_v1).x = 90.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; local_f4.y = (float)CONCAT31(local_f4.y._1_3_,1); goto LAB_00522ec2; } npc->_i1 = npc->_i1 + 1; isSeekTarget = '\x01'; npc->_friction = npc->_friction * 0.7; if (((npc->_state == 3) && (ANM2::Play(&npc->_sprite,(byte *)"Shake",0), npc->_state == 3)) && (0x23 < (uint)npc->_i1)) { if (npc->_controllerID == -1) { uVar5 = Random(); if (uVar5 % 0x32 != 0) goto LAB_00522543; } else { bVar2 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar2 == 0) { pVVar3 = Entity_NPC::GetControllerInput(npc,&local_f4,0.4); bVar2 = Vector::operator_ne(pVVar3,&g_vectorZero); if (bVar2 == 0) goto LAB_00522543; } } npc->_state = 4; } LAB_00522543: if ((npc->_controllerID == -1) || (npc->_visible != 0)) { room = g_game->_room; iVar6 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar6) && ((iVar6 < *(int *)((int)room + 0xc) && (iVar4 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), -1 < iVar4)))) && (iVar4 < *(int *)((int)room + 0x10))) && ((uVar5 = iVar4 * *(int *)((int)room + 0xc) + iVar6, uVar5 < 0x1c0 && (*(int *)((int)room + uVar5 * 4 + 0x76c) < 0x3b7)))) { *(undefined4 *)((int)room + uVar5 * 4 + 0x76c) = 900; } } if (npc->_controllerID != -1) { fVar7 = (npc->_v1).x; if (fVar7 < 90.0) { Entity_NPC::UpdateChargeBar(npc,0.0,90.0,fVar7,1); } else if ((npc->_chargeBarSprite)._loaded != 0) { (npc->_chargeBarSprite)._color._tint[3] = 0.0; } } if ((((npc->_projectileCooldown < 1) || (iVar6 = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime), npc->_projectileCooldown = iVar6, iVar6 < 1)) && (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,260.0,0,7), bVar2 != 0)) && ((npc->_controllerID == -1 || (npc->_state == 3)))) { ANM2::Play(&npc->_sprite,&DAT_00b1d47c,0); npc->_visible = 1; target = Entity_NPC::GetPlayerTarget(npc); local_f4.y = (target->_pos).x - (npc->_pos).x; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; local_108.y = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&local_108,0.1); (npc->_controllerMovement).x = local_108.x; } (npc->_controllerMovement).y = local_108.y; pRVar1 = (Room *)local_f4.y; if (npc->_controllerID != -1) { pRVar1 = (Room *)(npc->_controllerMovement).x; } (npc->_sprite)._flipX = 0.0 < (float)pRVar1; npc->_state = 8; npc->_projectileCooldown = 0x3f; } PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); if (npc->_visible != 0) { fVar7 = npc->_speedMultiplier + (npc->_v1).x; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (90.0 <= fVar7) { fVar7 = 90.0; } (npc->_v1).x = fVar7; } local_108.y = 1.0; if (npc->_state == 4) { ANM2::Play(&npc->_sprite,&DAT_00b1d5b0,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_visible = 0; npc->_entityCollisionClass = 0; if (npc->_controllerID == -1) { Room::GetRandomPosition(g_game->_room,&local_f4,20.0); nearestPlayer = Game::GetNearestPlayer(g_game,&local_f4); local_f4.x = local_f4.x - (nearestPlayer->_pos).x; fVar7 = local_f4.y - (nearestPlayer->_pos).y; fVar8 = fVar7 * fVar7 + local_f4.x * local_f4.x; if ((((20.0 <= ABS(local_f4.x)) && (20.0 <= ABS(fVar7))) || (160000.0 <= fVar8)) && (40000.0 <= fVar8)) { pRVar1 = g_game->_room; uVar5 = Room::GetClampedGridIndex(pRVar1,&local_f4); if ((0x1bf < uVar5) || (pRVar1->_gridPaths[uVar5] < 500)) { iVar6 = pRVar1->_gridWidth; (npc->_targetPosition).x = (float)((int)uVar5 % iVar6) * 40.0 + 40.0; (npc->_targetPosition).y = (float)((int)uVar5 / iVar6) * 40.0 + 120.0; } } uVar5 = Random(); if (uVar5 % 0x14 == 0) { npc->_state = 6; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); npc->_visible = 1; Entity_NPC::UpdateDirtColor(npc,1); npc->_i1 = 0; if (npc->_projectileCooldown < 0xc) { npc->_projectileCooldown = 0xc; } } goto LAB_00522941; } } else { LAB_00522941: if (npc->_controllerID == -1) goto LAB_00522b94; } if ((npc->_visible == 0) || ((pVVar3 = Entity::GetNullOffset((Entity *)npc,&overlayOffset,(byte *)"OverlayEffect"), pVVar3->x == g_vectorZero.x && (pVVar3->y == g_vectorZero.y)))) { Entity_NPC::SpawnControlTarget(npc,2,-1.0); fVar7 = (npc->_v1).x - npc->_speedMultiplier; (npc->_v1).x = fVar7; if (fVar7 <= -30.0) { (npc->_v1).x = 0.0; damageSource = EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x20))(0x40a00000,0,0,damageSource,0x1e); Color::Color((Color *)local_40); local_f4.y = 1.4013e-45; spawn_gibs(&npc->_pos,1,20.0,(uint *)&local_f4.y,(Entity *)npc,color,&g_vectorZero,1.0); Entity_NPC::PlaySound(npc,0x4d,0.5,2,0,2.0); } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,3.0,0,1); isSeekTarget = '\0'; if (((npc->_controllerID != -1) && (bVar2 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,unused), bVar2 != 0)) || (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar2 != 0)) { local_100.x = (npc->_pos).x; pVVar3 = &npc->_pos; local_100.y = (npc->_pos).y; local_f4.y = (float)g_game->_room; iVar6 = Room::GetGridCollisionAtPos((Room *)local_f4.y,npc->_pos); if (iVar6 == 0) { iVar4 = 0x522b06; unused2 = pVVar3; iVar6 = Room::GetGridPathFromPos((Room *)local_f4.y,pVVar3); if ((iVar6 < 900) && (bVar2 = Entity::IsPlayerInRadius((Entity *)npc,pVVar3,60.0,iVar4,(int)unused2), bVar2 == 0)) { (npc->_targetPosition).x = pVVar3->x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 6; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); npc->_visible = 1; Entity_NPC::UpdateDirtColor(npc,1); } } } fVar7 = (npc->_velocity).x; if (1.0 < ABS(fVar7)) { (npc->_sprite)._flipX = 0.0 < fVar7; } } } else { npc->_entityCollisionClass = 4; } LAB_00522b94: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); manager = g_manager; if (bVar2 != 0) { local_100.y = 1.0; if (npc->_championColorIdx == 0x12) { local_100.y = 1.5; } else if (npc->_championColorIdx == 0x13) { local_100.y = 0.5; } local_f4.y = 1.00893e-43; seed_fart_sound_override((int *)&local_f4.y); SoundEffects::Play(&manager->_sfxManager,(int)local_f4.y,1.0,2,0,local_100.y,0.0); } } if ((npc->_state == 8) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 == 0)))) { Entity_NPC::UpdateControllerMovement(npc,0); } if ((npc->_controllerID == -1) || (npc->_state != 6)) { LAB_00522cad: if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00522e54; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 != 0) { if (npc->_championColorIdx == 0x12) { local_108.y = 1.5; } else if (npc->_championColorIdx == 0x13) { local_108.y = 0.5; } local_f4.y = 3.16693e-43; seed_fart_sound_override((int *)&local_f4.y); SoundEffects::Play(&manager->_sfxManager,(int)local_f4.y,1.0,2,0,local_108.y,0.0); target = Entity_NPC::GetPlayerTarget(npc); local_f4.y = (target->_pos).x - (npc->_pos).x; local_100.y = (target->_pos).y - (npc->_pos).y; if (npc->_controllerID != -1) { local_f4.y = (npc->_controllerMovement).x; local_100.y = (npc->_controllerMovement).y; } local_108.y = local_100.y; local_100.x = local_f4.y; fVar7 = sqrtf(local_f4.y * local_f4.y + local_100.y * local_100.y); if (0.0 < fVar7) { local_100.x = local_f4.y * (7.0 / fVar7); local_100.y = local_108.y * (7.0 / fVar7); } ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_100,2,&projParams); npc->_i1 = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_00522e54; } else { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00522e54; AnimationState::AdvancePosition (&(npc->_sprite)._animState, *(int *)((int)(npc->_sprite)._animState._animData + 0x30) + -1); } goto LAB_00522cad; } LAB_00522e54: if (npc->_state == 6) { npc->_state = 3; } else if (npc->_state == 8) { npc->_state = 4 - (uint)((uint)npc->_i1 < 0x24); } } if (isSeekTarget != '\0') { fVar7 = (npc->_targetPosition).y; fVar8 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar7 - fVar8; } local_f4.y = (float)((uint)local_f4.y & 0xffffff00); LAB_00522ec2: Entity_NPC::UpdateDirtColor(npc,SUB41(local_f4.y,0)); return; } //@@ 00522ef0 NpcAI::ENTITY_EYE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 60 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_EYE(Entity_NPC *npc) { byte bVar1; int gridY; Entity *tmpEntity; Vector *pVVar2; uint uVar3; LayerState *layer; float *pupilPosNull; Entity_Laser *laser; int iVar4; uint uVar5; uint uVar6; float fVar7; float fVar8; float fVar9; undefined1 auStack_68 [4]; Vector scratchVec; float local_5c; Vector local_58; float local_50; Vector local_4c; float local_44; Vector tmpVecOut; int gridCollideInfo; int local_34; int local_30; int local_2c; float local_28; float local_24; float local_20; float local_1c; uint local_18; Entity_NPC *local_14; uint local_c; void *animData; ColorMod *color; Game *game; int *gridEntity; int gridWidth; Room *room; ANM2 *sprite; game = g_game; local_c = __security_cookie ^ (uint)auStack_68; local_14 = npc; if (npc->_variant != 2) { fVar7 = (npc->_pos).x; iVar4 = (int)((fVar7 - 40.0) / 40.0 + 0.5); if ((((iVar4 < 0) || (gridWidth = *(int *)((int)g_game->_room + 0xc), gridWidth <= iVar4)) || (gridY = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), gridY < 0)) || (*(int *)((int)g_game->_room + 0x10) <= gridY)) { local_5c = -NAN; } else { local_5c = (float)(gridWidth * gridY + iVar4); } if (npc->_state == 0) { (npc->_targetPosition).x = fVar7; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; (npc->_v1).x = 0.0; if (npc->_variant == 0) { bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Eye Open",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rotate",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } } game = g_game; local_28 = (npc->_pos).x; local_24 = (npc->_pos).y; npc->_renderZOffset = -3000; local_58.x = (float)game->_room; gridCollideInfo = npc->_type; local_34 = npc->_variant; local_30 = npc->_spawnerType; local_2c = npc->_spawnerVariant; local_20 = (npc->_velocity).x; local_1c = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } local_18 = uVar5 | uVar6 | (uint)((npc->_flags & 0x100) != 0); if (0x1bf < (uint)local_5c) { return; } gridEntity = *(int **)((int)local_58.x + (int)local_5c * 4 + 0x24); if (gridEntity == (int *)0x0) { return; } (**(code **)(*gridEntity + 0x14))(0,&gridCollideInfo); return; } npc->_friction = npc->_friction * 0.8; fVar8 = (npc->_targetPosition).y; fVar9 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - fVar7; (npc->_velocity).y = fVar8 - fVar9; if (((uint)local_5c < 0x1c0) && (*(int *)((int)game->_room + (int)local_5c * 4 + 0x76c) < 0x3b7) ) { *(undefined4 *)((int)game->_room + (int)local_5c * 4 + 0x76c) = 900; } if (npc->_state == 4) { if (npc->_controllerID == -1) { pVVar2 = Entity_NPC::CalcTargetPosition(npc,&tmpVecOut,0.0); local_58.x = (npc->_pos).x - pVVar2->x; local_4c.x = (npc->_pos).y - pVVar2->y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar7 = (tmpEntity->_velocity).x; fVar8 = (tmpEntity->_velocity).y; local_50 = local_4c.x - (fVar8 + fVar8); if (local_50 == 0.0) { local_50 = 0.001; } iVar4 = npc->_variant + 1; fVar8 = local_58.x * local_58.x; local_5c = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * 3.0 + 3.0; local_58.x = local_58.x - (fVar7 + fVar7); fVar7 = sqrtf(local_4c.x * local_4c.x + fVar8); local_5c = local_5c - fVar7 / 330.0; fVar7 = atan2f(local_50,local_58.x); fVar8 = local_5c; for (fVar7 = (fVar7 * 57.295776 - (npc->_v1).x) + 180.0; 180.0 < fVar7; fVar7 = fVar7 - 360.0) { } for (; fVar7 < -180.0; fVar7 = fVar7 + 360.0) { } if ((fVar7 <= local_5c) && (local_5c = -local_5c, local_5c <= fVar7)) { local_5c = fVar7; } if ((((ABS(local_5c) < fVar8 * 0.5) && (uVar6 = Random(), uVar6 % 10 == 0)) && (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200), bVar1 == 0)) && ((bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar1 == 0 && (bVar1 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&npc->_pos), bVar1 != 0)))) { if (npc->_variant == 0) { ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)"ShootOverlay",0); } npc->_state = 8; npc->_stateFrame = 0; if (npc->_variant == 0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); scratchVec.x = (layer->_pos).x * 2.5; scratchVec.y = (layer->_pos).y * 2.5; } else { pupilPosNull = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"PupilPos"); scratchVec.x = *pupilPosNull + 0.0; scratchVec.y = pupilPosNull[1] - 8.0; } color = (ColorMod *)Color::Color(0x3f4ccccd); local_58.x = (npc->_v1).x * 0.017453292; local_4c.x = cos(local_58.x); local_4c.y = sin(local_58.x); Entity::SpawnFollowingEffect198((Entity *)npc,&scratchVec,&local_4c,0xf,color,4.0); } (npc->_v1).x = local_5c + (npc->_v1).x; } else { Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.1); if ((scratchVec.x != g_vectorZero.x) || (scratchVec.y != g_vectorZero.y)) { iVar4 = npc->_variant + 1; local_58.x = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * 3.0 + 3.0 ; fVar7 = atan2f(scratchVec.y,scratchVec.x); fVar7 = approach_angle((npc->_v1).x,fVar7 * 57.295776,local_58.x); (npc->_v1).x = fVar7; } bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if ((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 == 0)) { if (npc->_variant == 0) { ANM2::Play(&npc->_sprite,(byte *)"Shoot",0); } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)"ShootOverlay",0); } npc->_state = 8; npc->_stateFrame = 0; } } fVar7 = (npc->_v1).x; if (npc->_variant == 0) { local_50 = fVar7 * 0.017453292; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); fVar7 = cos(local_50); (layer->_pos).x = fVar7 * 6.0; fVar7 = sin(local_50); (layer->_pos).y = fVar7 * 6.0; } else { fVar7 = normalize_angle_degrees(fVar7 + 105.0); animData = (npc->_sprite)._animState._animData; if (animData != (void *)0x0) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)((float)*(int *)((int)animData + 0x30) * ((fVar7 + 180.0) / 360.0)) ); } } goto LAB_0052400c; } if (npc->_state == 8) { if (npc->_variant == 0) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); } else { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); } if (bVar1 != 0) { scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; if (npc->_variant == 0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); fVar8 = (layer->_pos).y * 2.5; scratchVec.x = (layer->_pos).x * 2.5 + scratchVec.x; local_4c.x = g_vectorZero.x; local_4c.y = g_vectorZero.y; fVar7 = (npc->_v1).x; } else { local_58.x = (npc->_v1).x; local_4c.x = 0.0; local_4c.y = -20.0; pupilPosNull = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"PupilPos"); fVar8 = pupilPosNull[1] / 0.65 - -20.0; scratchVec.x = (*pupilPosNull / 0.65 - 0.0) + scratchVec.x; fVar7 = local_58.x; } scratchVec.y = fVar8 + scratchVec.y; iVar4 = 8; if (npc->_variant == 0) { iVar4 = 3; } laser = Entity_Laser::ShootAngle (2 - (uint)(npc->_variant != 0),&scratchVec,fVar7,iVar4,&local_4c, (Entity *)npc,0); laser->_renderDepthOffset = 3000.0; (**(code **)(*(int *)laser + 0xc))(); } if (npc->_variant != 0) { if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); } goto LAB_0052400c; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0052400c; npc->_state = 4; } else if ((((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) || (npc->_state = 4, npc->_variant != 0)) goto LAB_0052400c; ANM2::Play(&npc->_sprite,(byte *)"Eye Opened",0); LAB_0052400c: if (npc->_variant != 1) { return; } if ((npc->_sprite)._overlayAnimState._isPlaying == 0) { return; } local_58.x = (float)AnimationState::GetNullFrame (&(npc->_sprite)._overlayAnimState,(byte *)"Deform"); if ((float *)local_58.x == (float *)0x0) { return; } if (*(char *)((int)local_58.x + 0xc) == '\0') { return; } sprite = &npc->_sprite; layer = ANM2::GetLayer(sprite,(byte *)0x0); fVar7 = local_58.x; (layer->_pos).x = *(float *)local_58.x; (layer->_pos).y = *(float *)((int)local_58.x + 4); layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_size).x = *(float *)((int)fVar7 + 0x10); (layer->_size).y = *(float *)((int)fVar7 + 0x14); color = (ColorMod *)((int)fVar7 + 0x18); layer = ANM2::GetLayer(sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,color); return; } iVar4 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if (((iVar4 < 0) || (gridWidth = *(int *)((int)g_game->_room + 0xc), gridWidth <= iVar4)) || ((gridY = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5), gridY < 0 || (*(int *)((int)g_game->_room + 0x10) <= gridY)))) { uVar6 = 0xffffffff; } else { uVar6 = gridWidth * gridY + iVar4; } local_5c = (float)uVar6; if (npc->_state == 0) { LAB_00523589: (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); local_28 = (npc->_pos).x; local_24 = (npc->_pos).y; local_4c.x = (float)g_game->_room; gridCollideInfo = npc->_type; local_34 = npc->_variant; local_30 = npc->_spawnerType; local_2c = npc->_spawnerVariant; local_20 = (npc->_velocity).x; local_1c = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } local_58.x = (float)(*(uint *)((int)&npc->_flags + 4) & 0x400000); if (local_58.x == 0.0) { uVar3 = 0; } else { uVar3 = 4; } local_18 = uVar3 | uVar5 | (uint)((npc->_flags & 0x100) != 0); if ((uVar6 < 0x1c0) && (gridEntity = *(int **)((int)local_4c.x + uVar6 * 4 + 0x24), gridEntity != (int *)0x0)) { (**(code **)(*gridEntity + 0x14))(0,&gridCollideInfo); } if (npc->_controllerID == -1) { uVar6 = Random(); iVar4 = uVar6 % 0x3c + 0xf; } else { iVar4 = 0x1e; } npc->_projectileCooldown = iVar4; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_bitflags = layer->_bitflags | 1; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer->_bitflags = layer->_bitflags | 1; return; } Entity_NPC::SpawnControlTarget(npc,0,-1.0); iVar4 = npc->_state; if (iVar4 == 0) goto LAB_00523589; if (iVar4 == 3) { npc->_projectileCooldown = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); if ((0 < npc->_projectileCooldown) || (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 != 0)) goto LAB_005234da; if (npc->_controllerID != -1) { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar1 == 0) goto LAB_005234da; pVVar2 = Entity_NPC::GetAimTargetPosition(npc,&tmpVecOut); bVar1 = Vector::operator_ne(pVVar2,&g_vectorZero); if (bVar1 == 0) goto LAB_005234da; } ANM2::Play(&npc->_sprite,(byte *)"Attack",0); npc->_state = 8; npc->_i1 = 0; goto LAB_005234da; } if (iVar4 != 8) goto LAB_005234da; if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { Entity_NPC::PlaySound(npc,0x110,0.5,2,0,1.5); tmpEntity = Entity_NPC::GetPlayerTarget(npc); iVar4 = npc->_i1; scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; if (iVar4 == 0) { scratchVec.x = (tmpEntity->_velocity).x * 5.0 + scratchVec.x; scratchVec.y = (tmpEntity->_velocity).y * 5.0 + scratchVec.y; } else if (iVar4 == 1) { local_44 = (tmpEntity->_velocity).x; local_58.x = (tmpEntity->_velocity).y; pVVar2 = MusicManager::RandomVector(&tmpVecOut); local_50 = pVVar2->x; local_4c.x = pVVar2->y; uVar6 = Random(); fVar7 = local_58.x * 15.0; fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; scratchVec.x = local_50 * 100.0 * fVar8 + local_44 * 15.0 + scratchVec.x; fVar9 = local_4c.x * 100.0; LAB_005232b5: scratchVec.y = fVar9 * fVar8 + fVar7 + scratchVec.y; } else if (iVar4 == 2) { local_4c.x = (tmpEntity->_velocity).x; local_50 = (tmpEntity->_velocity).y; pVVar2 = MusicManager::RandomVector(&tmpVecOut); local_58.x = pVVar2->x; local_44 = pVVar2->y; uVar6 = Random(); fVar7 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; scratchVec.x = local_58.x * 70.0 * fVar7 + local_4c.x * 20.0 + scratchVec.x; scratchVec.y = local_44 * 70.0 * fVar7 + local_50 * 20.0 + scratchVec.y; } else if (iVar4 == 3) { local_4c.x = (tmpEntity->_velocity).x; local_50 = (tmpEntity->_velocity).y; pVVar2 = MusicManager::RandomVector(&tmpVecOut); local_58.x = pVVar2->x; local_44 = pVVar2->y; uVar6 = Random(); fVar7 = local_50 * 30.0; fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; scratchVec.x = local_58.x * 50.0 * fVar8 + local_4c.x * 30.0 + scratchVec.x; fVar9 = local_44 * 50.0; goto LAB_005232b5; } game = g_game; Room::GetClampedPositionImpl(g_game->_room,&local_58,&scratchVec,20.0,20.0,20.0,20.0); scratchVec.x = local_58.x; scratchVec.y = local_58.y; if (npc->_controllerID != -1) { pVVar2 = Entity_NPC::GetAimTargetPosition(npc,&tmpVecOut); scratchVec.x = pVVar2->x; scratchVec.y = pVVar2->y; } room = game->_room; iVar4 = Room::GetGridIndex(room,&scratchVec); Room::SetGridPath(room,iVar4,900); uVar6 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x13,&scratchVec,&g_vectorZero,(Entity *)npc,2,uVar6,0); local_58.x = -g_vectorOne.x; local_58.y = -g_vectorOne.y; Entity::SetSize(tmpEntity,10.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); (**(code **)(*(int *)tmpEntity + 0x40))(0x40e00000); (**(code **)(*(int *)tmpEntity + 0xc))(); npc->_i1 = npc->_i1 + 1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; if (npc->_controllerID == -1) { uVar6 = Random(); npc->_projectileCooldown = uVar6 % 0x3c + 0x3c; } else { npc->_projectileCooldown = 0x3c; } } LAB_005234da: if (0.0 < npc->_pendingDamage) { npc->_projectileCooldown = npc->_projectileCooldown + (int)(npc->_pendingDamage * -10.0); } game = g_game; npc->_friction = npc->_friction * 0.8; fVar7 = (npc->_targetPosition).y; fVar8 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar7 - fVar8; if (((uint)local_5c < 0x1c0) && (*(int *)((int)game->_room + (int)local_5c * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)game->_room + (int)local_5c * 4 + 0x76c) = 900; return; } return; } //@@ 005240a0 NpcAI::ENTITY_PARA_BITE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 58 (from dispatcher 006c2990) */ uint __fastcall NpcAI::ENTITY_PARA_BITE(Entity_NPC *npc) { float fVar1; code *pcVar2; byte bVar3; uint uVar4; Entity_Player *nearestPlayer; uint extraout_EAX; byte *moveAnim; Entity *target; Vector *aimTarget; uint uVar5; int unused; float fVar6; double dVar7; Vector pos; Vector shotPos; Vector shotVelocity; Vector targetPos; Vector evadeFrom; Vector aimPos; Vector local_d0; float local_c4; ProjectileParams projParams; float local_14; int gridWidth; bool isFacingLeft; Manager *manager; Room *room; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); local_c4 = (float)npc->_state; if (local_c4 == 0.0) { Entity_NPC::UpdateDirtColor(npc,1); uVar4 = (npc->_dropRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (npc->_dropRNG)._seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar4 = uVar4 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar4; (npc->_dropRNG)._seed = uVar4; npc->_state = 4; npc->_projectileCooldown = uVar4 % 0x14 + 5; return (uVar4 / 0x14) * 0x14; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } Entity_NPC::SpawnControlTarget(npc,0,-1.0); if ((npc->_state == 6) && (ANM2::Play(&npc->_sprite,(byte *)"DigIn",0), npc->_controllerID == -1)) { Room::GetRandomPosition(g_game->_room,&local_d0,20.0); nearestPlayer = Game::GetNearestPlayer(g_game,&local_d0); fVar6 = local_d0.y - (nearestPlayer->_pos).y; local_d0.x = local_d0.x - (nearestPlayer->_pos).x; fVar6 = fVar6 * fVar6 + local_d0.x * local_d0.x; if ((16900.0 < fVar6) && (fVar6 < 1e+06)) { room = g_game->_room; uVar4 = Room::GetGridIndex(room,&local_d0); if ((0x1bf < uVar4) || (room->_gridPaths[uVar4] < 500)) { gridWidth = room->_gridWidth; (npc->_targetPosition).x = (float)((int)uVar4 % gridWidth) * 40.0 + 40.0; (npc->_targetPosition).y = (float)((int)uVar4 / gridWidth) * 40.0 + 120.0; } } } fVar6 = (float)npc->_state; if (((local_c4 != fVar6) && (local_c4 == 8.40779e-45)) && (((npc->_targetPosition).x != g_vectorZero.x || ((npc->_targetPosition).y != g_vectorZero.y)))) { Entity_NPC::UpdateDirtColor(npc,1); (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; npc->_state = 0x10; ANM2::Play(&npc->_sprite,(byte *)"DigOut",0); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; Entity_NPC::ClearChild(npc); fVar6 = (float)npc->_state; } if (fVar6 == 2.24208e-44) { if ((npc->_sprite)._animState._animData != (void *)0x0) { dVar7 = floor((double)(npc->_sprite)._animState._animFrame); local_c4 = (float)dVar7; if (2 < (int)dVar7) goto LAB_0052439d; } LAB_00524463: uVar4 = 0; } else { if ((fVar6 == 8.40779e-45) && ((npc->_sprite)._animState._animData != (void *)0x0)) { dVar7 = floor((double)(npc->_sprite)._animState._animFrame); local_c4 = (float)dVar7; if (7 < (int)dVar7) goto LAB_00524463; } LAB_0052439d: uVar4 = 4; } npc->_entityCollisionClass = uVar4; if (fVar6 == 2.24208e-44) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_005243ee; dVar7 = floor((double)(npc->_sprite)._animState._animFrame); uVar4 = (uint)dVar7; if (uVar4 != 3) goto LAB_005243ee; LAB_005244b4: manager = g_manager; local_d0.y = 1.0; if (npc->_championColorIdx == 0x12) { local_d0.y = 1.5; } else if (npc->_championColorIdx == 0x13) { local_d0.y = 0.5; } local_c4 = 1.00893e-43; seed_fart_sound_override((int *)&local_c4); SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,2,0,local_d0.y,0.0); fVar6 = (float)npc->_state; uVar4 = extraout_EAX; } else if (fVar6 == 8.40779e-45) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_005243ee; dVar7 = floor((double)(npc->_sprite)._animState._animFrame); uVar4 = (uint)dVar7; if (uVar4 != 7) goto LAB_005243ee; goto LAB_005244b4; } if (fVar6 == 5.60519e-45) { Entity_NPC::UpdateDirtColor(npc,0); uVar4 = Random(); if (uVar4 % 10 == 0) { uVar4 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } local_c4 = *(float *)((int)&npc->_flags + 4); if (((npc->_flags & 0x200) != 0) && (npc->_controllerID == -1)) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); fVar6 = (npc->_velocity).y; fVar1 = (npc->_velocity).x; moveAnim = s_Idle; if (1.0 < fVar1 * fVar1 + fVar6 * fVar6) { moveAnim = s_Walk; } ANM2::Play(&npc->_sprite,moveAnim,0); isFacingLeft = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; (npc->_sprite)._flipX = isFacingLeft; return (uint)isFacingLeft; } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { target = Entity_NPC::GetPlayerTarget(npc); targetPos.x = (target->_pos).x; targetPos.y = (target->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetPos,0.8,0,1); if (npc->_variant == 1) { if (npc->_projectileCooldown < 1) { fVar6 = (npc->_velocity).x; fVar1 = (npc->_velocity).y; fVar6 = sqrtf(fVar6 * fVar6 + fVar1 * fVar1); local_c4 = g_vectorZero.x; local_d0.y = g_vectorZero.y; if (0.0 < fVar6) { local_c4 = (npc->_velocity).x / fVar6; local_d0.y = (npc->_velocity).y / fVar6; } if ((local_c4 != g_vectorZero.x) || (local_d0.y != g_vectorZero.y)) { uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x14 + 0x28; ProjectileParams::ProjectileParams(&projParams); shotPos.x = (npc->_pos).x + (npc->_velocity).x; shotVelocity.x = local_c4 * 7.0; shotPos.y = (npc->_velocity).y + (npc->_pos).y; shotVelocity.y = local_d0.y * 7.0; projParams.FallingAccelModifier = 0.3; projParams.FallingSpeedModifier = -5.0; projParams.HeightModifier = 5.0; Entity_NPC::FireProjectiles(npc,&shotPos,&shotVelocity,0,&projParams); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); } } else { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } } } else { target = Entity_NPC::GetPlayerTarget(npc); evadeFrom.x = (target->_pos).x; evadeFrom.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&evadeFrom,0); npc->_friction = npc->_friction * 0.8; } fVar6 = (npc->_velocity).y; fVar1 = (npc->_velocity).x; moveAnim = s_Idle; if (1.0 < fVar1 * fVar1 + fVar6 * fVar6) { moveAnim = s_Walk; } ANM2::Play(&npc->_sprite,moveAnim,0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; if (npc->_controllerID == -1) { uVar4 = Random(); uVar5 = uVar4 / 0x1e; if (uVar4 % 0x1e != 0) { return uVar5; } if ((npc->_pathfinder)._hasDirectPath == 0) { npc->_state = 6; return uVar5; } return uVar5; } bVar3 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,unused); if (bVar3 == 0) { return 0; } aimTarget = Entity_NPC::GetAimTargetPosition(npc,&aimPos); if ((aimPos.x == g_vectorZero.x) && (aimPos.y == g_vectorZero.y)) { return (uint)aimTarget & 0xff; } pos.y = aimPos.y; pos.x = aimPos.x; uVar4 = Room::GetGridCollisionAtPos(g_game->_room,pos); if (uVar4 != 0) { return uVar4; } bVar3 = Entity::IsPlayerInRadius((Entity *)npc,&aimPos,80.0,(int)pos.x,(int)pos.y); if (bVar3 == 0) { npc->_state = 6; (npc->_targetPosition).x = aimPos.x; (npc->_targetPosition).y = aimPos.y; return 0; } return (uint)bVar3; } LAB_005243ee: npc->_friction = npc->_friction * 0.7; return uVar4; } //@@ 00524a10 NpcAI::ENTITY_FRED /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 59 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FRED(Entity_NPC *npc) { Vector pos; byte bVar1; undefined4 *damageEvent; byte *curAnimChar; uint uVar2; Vector *controllerInput; Vector *pVVar3; byte *pbVar4; ProjectileParams *pPVar5; Entity_Player *nearestPlayer; Entity *target; Entity_Projectile *projectile; byte *cmpAnimChar; char *animName; float *extraout_ECX; int iVar6; bool bVar7; float fVar8; float fVar9; Vector local_e0; Vector local_d8; Vector local_d0; Vector local_c8; ProjectileParams projParams; float local_14; float fallingSpeed; undefined4 projFlagsHigh; Room *room; int state; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); iVar6 = npc->_state; if (iVar6 == 0) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 0x10; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::UpdateDirtColor(npc,1); npc->_shadowSize = 0.0; return; } if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { local_c8.y = (float)damageEvent[3]; if (((damageEvent[2] & 4) != 0) && ((((((uint)damageEvent[0xc] >> 1 & 1) == 0 && (damageEvent[4] != 1)) && (damageEvent[6] != 1)) && ((damageEvent[6] != 3 && ((damageEvent[2] & 0x1000) == 0)))))) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); iVar6 = npc->_state; } npc->_friction = npc->_friction * 0.65; if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && ((npc->_state = 3, iVar6 != 3 && (iVar6 == 6)))) { npc->_state = 0x10; pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_00524bb6: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b60f4c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { curAnimChar = *(byte **)pbVar4; } cmpAnimChar = &DAT_00b60f4c; do { bVar1 = *curAnimChar; bVar7 = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_00524b98: uVar2 = -(uint)bVar7 | 1; goto LAB_00524b9d; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar7 = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_00524b98; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00524b9d: if ((uVar2 != 0) || ((pbVar4[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00524bb6; } Entity_NPC::UpdateDirtColor(npc,1); } Entity_NPC::CalcTargetPosition(npc,&local_c8,0.0); pVVar3 = &npc->_pos; local_c8.y = (npc->_pos).y - local_c8.y; local_d8.y = pVVar3->x - local_c8.x; local_d0.y = sqrtf(local_c8.y * local_c8.y + local_d8.y * local_d8.y); iVar6 = npc->_projectileCooldown; if (0 < iVar6) { iVar6 = iVar6 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_projectileCooldown = iVar6; } state = npc->_state; if (state == 3) { if (((npc->_flags & 0x1000000000000000) == 0) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { if (npc->_controllerID == -1) { uVar2 = Random(); if (uVar2 % 0x1e == 0) goto LAB_00524ce8; } else if ((iVar6 < 1) && (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { LAB_00524ce8: if ((npc->_flags & 0x1000a00) == 0) { if (npc->_controllerID == -1) { iVar6 = -1; } else { Entity_NPC::UpdateControllerMovement(npc,1); local_c8.y = (npc->_controllerMovement).y * 100.0; local_d8.y = (npc->_controllerMovement).x * 100.0; local_d0.y = sqrtf(local_c8.y * local_c8.y + local_d8.y * local_d8.y); iVar6 = npc->_controllerID; } if (local_d0.y < 200.0) { ANM2::Play(&npc->_sprite,(byte *)"Attack",iVar6 != -1); npc->_state = 8; npc->_projectileCooldown = 0x3c; } } } } if (npc->_controllerID == -1) { uVar2 = Random(); bVar7 = uVar2 % 0x14 == 0; } else { controllerInput = Entity_NPC::GetControllerInput(npc,&local_e0,0.1); if ((controllerInput->x == g_vectorZero.x) && (controllerInput->y == g_vectorZero.y)) { bVar7 = false; } else { bVar7 = true; } } if (bVar7) { if (npc->_controllerID == -1) { local_d8.x = (npc->_pos).x - local_d8.y * (100.0 / local_d0.y); local_d8.y = (npc->_pos).y - local_c8.y * (100.0 / local_d0.y); pVVar3 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_c8,&local_d8,0.0,0,0,0); (npc->_targetPosition).x = pVVar3->x; fVar9 = pVVar3->y; } else { pVVar3 = Entity_NPC::GetControllerInput(npc,&local_e0,0.1); fVar9 = pVVar3->y; (npc->_targetPosition).x = pVVar3->x * 100.0 + (npc->_pos).x; fVar9 = fVar9 * 100.0 + (npc->_pos).y; } (npc->_targetPosition).y = fVar9; pbVar4 = (npc->_sprite)._animState._animData; if ((npc->_pos).y <= fVar9) { if (pbVar4 != (byte *)0x0) { if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } animName = "JumpDownHead"; do { bVar1 = *pbVar4; bVar7 = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_00524fa0: uVar2 = -(uint)bVar7 | 1; goto LAB_00524fa5; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar7 = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_00524fa0; pbVar4 = pbVar4 + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00524fa5: if ((uVar2 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00524fdd; } animName = "JumpDownHead"; LAB_00524fc2: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (pbVar4 == (byte *)0x0) { LAB_00524f5f: animName = "JumpUpHead"; goto LAB_00524fc2; } if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } animName = "JumpUpHead"; do { bVar1 = *pbVar4; bVar7 = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_00524f40: uVar2 = -(uint)bVar7 | 1; goto LAB_00524f45; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar7 = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_00524f40; pbVar4 = pbVar4 + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00524f45: if ((uVar2 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00524f5f; } LAB_00524fdd: (npc->_v1).x = 0.0; npc->_state = 6; goto LAB_00525619; } LAB_00525589: if ((((npc->_state == 6) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land), bVar1 != 0)) || ((npc->_state == 0x10 && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar1 == 0)))))) { npc->_entityCollisionClass = 0; pVVar3->x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; goto LAB_00525619; } npc->_entityCollisionClass = 4; fVar8 = (npc->_targetPosition).x - pVVar3->x; fVar9 = (npc->_targetPosition).y - (npc->_pos).y; } else { if (state != 6) { if (state == 0x10) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar1 != 0) ) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } } else { if (state != 8) goto LAB_00525619; Entity_NPC::UpdateControllerMovement(npc,0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { target = Entity_NPC::GetPlayerTarget(npc); local_c8.x = (target->_pos).x; local_c8.y = (target->_pos).y; if ((npc->_controllerID != -1) && (bVar1 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar1 != 0)) { local_c8.x = *extraout_ECX * 100.0 + pVVar3->x; local_c8.y = extraout_ECX[1] * 100.0 + (npc->_pos).y; } Entity_NPC::PlaySound(npc,0xd5,0.7,2,0,1.0); pPVar5 = ProjectileParams::ProjectileParams(&projParams); projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_c8,10.0,pPVar5); fVar9 = (projectile->_velocity).x; fVar8 = (projectile->_velocity).y; projFlagsHigh = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 2; projectile->_fallingAccel = projectile->_fallingAccel - 0.3; fallingSpeed = projectile->_fallingSpeed; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = projFlagsHigh; projectile->_scale = 1.6; projectile->_fallingSpeed = fallingSpeed * 0.7 - 13.0; (projectile->_velocity).x = fVar9 * 0.55; (projectile->_velocity).y = fVar8 * 0.55; } } goto LAB_00525589; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar1 == 0)) goto LAB_00525619; npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); if (bVar1 != 0) { Entity_NPC::UpdateDirtColor(npc,1); npc->_shadowSize = 0.0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land), bVar1 != 0)) { if ((((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) && ((bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000), bVar1 == 0 || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)))) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar1 == 0) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); pPVar5 = ProjectileParams::ProjectileParams(&projParams); local_d8.x = 7.0; local_d8.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar3,&local_d8,6,pPVar5); } } if (npc->_controllerID == -1) { Room::GetRandomPosition(g_game->_room,&local_c8,20.0); nearestPlayer = Game::GetNearestPlayer(g_game,&local_c8); fVar8 = local_c8.y - (nearestPlayer->_pos).y; fVar9 = local_c8.x - (nearestPlayer->_pos).x; fVar9 = fVar8 * fVar8 + fVar9 * fVar9; if ((16900.0 < fVar9) && (fVar9 < 1e+06)) { room = g_game->_room; uVar2 = Room::GetGridIndex(room,&local_c8); if ((0x1bf < uVar2) || (room->_gridPaths[uVar2] < 500)) { iVar6 = room->_gridWidth; (npc->_targetPosition).x = (float)((int)uVar2 % iVar6) * 40.0 + 40.0; (npc->_targetPosition).y = (float)((int)uVar2 / iVar6) * 40.0 + 120.0; } } } else { Entity_NPC::SpawnControlTarget(npc,2,-1.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,3.0,0,1); Entity_NPC::GetAimTargetPosition(npc,&local_d0); room = g_game->_room; pos.y = local_d0.y; pos.x = local_d0.x; fVar9 = local_d0.x; fVar8 = local_d0.y; iVar6 = Room::GetGridCollisionAtPos(room,pos); if (iVar6 == 0) { local_c8.y = local_d0.x; } else { fVar8 = 0.0; fVar9 = 0.0; pVVar3 = Room::FindFreePickupSpawnPosition(room,&local_e0,&local_d0,40.0,1,0,0); local_c8.y = pVVar3->x; local_d0.y = pVVar3->y; } local_d8.y = local_d0.y; local_d0.x = local_c8.y; bVar1 = Entity::IsPlayerInRadius((Entity *)npc,&local_d0,80.0,(int)fVar9,(int)fVar8); if (bVar1 == 0) { (npc->_targetPosition).x = local_c8.y; (npc->_targetPosition).y = local_d8.y; } } goto LAB_00525619; } } if (npc->_controllerID != -1) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,1.0,0,1); goto LAB_00525619; } fVar9 = (npc->_v1).x * 1.07 + 0.005; if (1.0 <= fVar9) { fVar9 = 1.0; } (npc->_v1).x = fVar9; fVar8 = ((npc->_targetPosition).x - pVVar3->x) * fVar9; fVar9 = ((npc->_targetPosition).y - (npc->_pos).y) * fVar9; } (npc->_velocity).y = fVar9; (npc->_velocity).x = fVar8; LAB_00525619: Entity_NPC::UpdateDirtColor(npc,0); return; } //@@ 00525650 NpcAI::ENTITY_DOPLE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 53 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DOPLE(Entity_NPC *npc) { undefined4 uVar1; byte bVar2; Vector *pVVar3; uint uVar4; LayerState *layer; char *walkAnim; int iVar5; float fVar6; float fVar7; float fVar8; float fVar9; Vector local_104; float local_fc; Vector local_f8; Entity *targetPlayer; Vector local_ec; int local_e4; float inputX; Entity *local_dc; float local_d8; float inputY; Vector local_d0; float local_c8; bool isFlipX; ProjectileParams params; float local_14; local_14 = (float)(__security_cookie ^ (uint)&(¶ms)[1].CircleAngle); local_e4 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; if (npc->_state == 0) { *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; iVar5 = npc->_variant; uVar1 = *(undefined4 *)((int)&npc->_flags + 4); npc->_projectileDelay = 0; npc->_projectileCooldown = 0; npc->_state = 4; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; if (iVar5 == 0) { npc->_i2 = 1; npc->_entityGridCollisionClass = 5; return; } npc->_entityGridCollisionClass = 3; return; } local_dc = Entity_NPC::GetPlayerTarget(npc); if ((local_dc == (Entity *)0x0) || (local_dc->_type != 1)) { fVar6 = (local_dc->_velocity).x; fVar9 = (local_dc->_velocity).y; targetPlayer = (Entity *)0x0; if (ABS(fVar6) <= ABS(fVar9)) { fVar9 = (float)((uint)(0.0 <= fVar9) * 2 + 1); } else { fVar9 = 2.8026e-45; if (fVar6 < 0.0) { fVar9 = 0.0; } } } else { fVar9 = local_dc[5]._splatColor._tint[2]; targetPlayer = local_dc; } inputX = 0.0; inputY = 0.0; local_d8 = 1.0; if (npc->_controllerID == -1) { npc->_friction = npc->_friction * 0.75; local_d0.y = (local_dc->_pos).x; local_ec.y = (local_dc->_pos).y; Room::GetCenterPos(&local_f8); local_c8 = (float)((int)fVar9 + 2U & 0x80000003); if ((int)local_c8 < 0) { local_c8 = (float)(((int)local_c8 - 1U | 0xfffffffc) + 1); } if (((npc->_flags & 0x200) != 0) && (local_c8 = (float)((int)local_c8 + 2U & 0x80000003), (int)local_c8 < 0)) { local_c8 = (float)(((int)local_c8 - 1U | 0xfffffffc) + 1); } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; (npc->_pos).x = local_f8.x * 2.0 - local_d0.y; (npc->_pos).y = local_f8.y * 2.0 - local_ec.y; fVar6 = -(local_dc->_velocity).x; fVar9 = -(local_dc->_velocity).y; (npc->_velocity).x = fVar6 + fVar6; (npc->_velocity).y = fVar9 + fVar9; } else { Entity_NPC::GetControllerInput(npc,&local_d0,0.0); inputX = local_d0.x; inputY = local_d0.y; local_c8 = (npc->_velocity).x * 0.5; (npc->_velocity).x = local_c8; local_dc = (Entity *)((npc->_velocity).y * 0.5); (npc->_velocity).y = (float)local_dc; fVar6 = sqrtf(0.775); local_ec.y = inputX * 0.5; iVar5 = 2; local_d0.y = inputY * 0.5; local_f8.y = fVar6; do { if ((inputX != 0.0) || (inputY != 0.0)) { local_104.y = local_c8 * inputX + (float)local_dc * inputY; local_fc = local_104.y * inputY; local_104.y = local_104.y * inputX; fVar6 = sqrtf(0.8); local_dc = (Entity *)(((float)local_dc - local_fc) * fVar6 + local_fc); local_c8 = (local_c8 - local_104.y) * fVar6 + local_104.y; fVar6 = local_f8.y; } fVar9 = npc->_speedMultiplier; fVar7 = ((float)local_dc * inputY + local_c8 * inputX) * -0.2; if (fVar7 <= 0.0) { fVar7 = 0.0; } fVar8 = (fVar7 + 3.0) * 0.4; fVar8 = (fVar8 * 0.25 - fVar8) * 0.0 + fVar8; fVar7 = fVar6; if (fVar9 != local_d8) { fVar7 = fVar6 / ((fVar9 + fVar6) - fVar9 * fVar6); } local_dc = (Entity *)((local_d0.y * fVar8 * fVar9 + (float)local_dc) * fVar7); local_c8 = (local_ec.y * fVar8 * fVar9 + local_c8) * fVar7; (npc->_velocity).y = (float)local_dc; (npc->_velocity).x = local_c8; iVar5 = iVar5 + -1; } while (iVar5 != 0); (npc->_velocity).x = local_c8 + local_c8; (npc->_velocity).y = (float)local_dc + (float)local_dc; pVVar3 = Entity_NPC::GetControllerMovementInput(npc,&local_d0,0.1); if ((pVVar3->x == g_vectorZero.x) && (pVVar3->y == g_vectorZero.y)) { fVar6 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; if (fVar9 * fVar9 + fVar6 * fVar6 <= 0.01) { local_c8 = 4.2039e-45; } else if (ABS(fVar9) <= ABS(fVar6)) { local_c8 = (float)((uint)(0.0 <= fVar6) * 2 + 1); } else { local_c8 = 2.8026e-45; if (fVar9 < 0.0) { local_c8 = 0.0; } } } else { pVVar3 = Entity_NPC::GetControllerMovementInput(npc,&local_d0,0.1); if (ABS(pVVar3->x) <= ABS(pVVar3->y)) { local_c8 = (float)((uint)(0.0 <= pVVar3->y) * 2 + 1); } else { local_c8 = 2.8026e-45; if (pVVar3->x < 0.0) { local_c8 = 0.0; } } } } fVar6 = local_c8; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - local_e4; } if (0 < npc->_projectileDelay) { npc->_projectileDelay = npc->_projectileDelay - local_e4; } if (npc->_controllerID == -1) { if (targetPlayer != (Entity *)0x0) { if (*(int *)&targetPlayer[4]._isInvicible == 0) { iVar5 = 0; } else { iVar5 = (int)*(float *)(*(int *)&targetPlayer[4]._isInvicible + 0xc); } if (npc->_i1 < iVar5) goto LAB_00525d33; goto LAB_00525f84; } } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar2 != 0) { LAB_00525d33: if (((npc->_flags & 0x1000800) == 0) && (npc->_projectileCooldown < 1)) { ProjectileParams::ProjectileParams(¶ms); params.FallingSpeedModifier = 1.0; params.FallingAccelModifier = -0.101; params.Scale = 1.4; Isaac::GetAxisAlignedUnitVectorFromDir(&local_d0,(int)fVar6); if (npc->_controllerID != -1) { pVVar3 = Entity_NPC::GetControllerMovementInput(npc,&local_f8,0.1); pVVar3 = Vector::ToCardinal(&local_104,pVVar3); local_d0.x = pVVar3->x; local_d0.y = pVVar3->y; } fVar9 = (npc->_velocity).x * 0.6; fVar7 = (npc->_velocity).y * 0.6; fVar6 = fVar7 * local_d0.y + fVar9 * local_d0.x; fVar8 = local_d0.y * fVar6; fVar6 = local_d0.x * fVar6; if (fVar6 * local_d0.x + fVar8 * local_d0.y < 0.0) { fVar9 = fVar9 - fVar6; fVar7 = fVar7 - fVar8; } local_ec.x = (npc->_pos).x; local_d0.x = local_d0.x * 10.0 + fVar9; local_ec.y = (npc->_pos).y; local_d0.y = local_d0.y * 10.0 + fVar7; if (npc->_i2 != 0) { uVar4 = Random(); fVar6 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.3; local_ec.x = local_ec.x - (float)npc->_i2 * local_d0.y * fVar6; local_ec.y = local_ec.y - (float)npc->_i2 * local_d0.x * fVar6; } if (npc->_variant == 1) { npc->_projectileCooldown = 0x1e; uVar4 = 2; } else { if (npc->_controllerID != -1) { npc->_projectileCooldown = 10; } uVar4 = 0; } Entity_NPC::FireProjectiles(npc,&local_ec,&local_d0,uVar4,¶ms); npc->_projectileDelay = 3; npc->_i2 = -npc->_i2; } } if (targetPlayer != (Entity *)0x0) { LAB_00525f84: if (*(int *)&targetPlayer[4]._isInvicible == 0) { iVar5 = 0; } else { iVar5 = (int)*(float *)(*(int *)&targetPlayer[4]._isInvicible + 0xc); } npc->_i1 = iVar5; } } local_e4 = npc->_projectileDelay; if (local_c8 == 4.2039e-45) { local_d0.y = 2.8026e-45; if (local_e4 < 1) { local_d0.y = 0.0; } bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadDown",1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)(int)local_d0.y); } } else if (local_c8 == 1.4013e-45) { bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadUp",1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { iVar5 = 2; if (local_e4 < 1) { iVar5 = 0; } AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar5); } } else { bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadHori",1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { iVar5 = 2; if (local_e4 < 1) { iVar5 = 0; } AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar5); } isFlipX = local_c8 == 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_flipX = isFlipX; } if (npc->_controllerID != -1) { iVar5 = npc->_variant; walkAnim = "WalkDown"; if (iVar5 != 1) { walkAnim = "WalkVert"; } isFlipX = false; if ((inputX == g_vectorZero.x) && (inputY == g_vectorZero.y)) { if (iVar5 != 1) { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)walkAnim,1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } goto LAB_00526181; } } else if (ABS(inputX) <= ABS(inputY)) { if ((iVar5 == 1) && (walkAnim = (char *)&DAT_00b1e020, 0.0 <= inputY)) { walkAnim = "WalkDown"; } } else { walkAnim = "WalkHori"; isFlipX = inputX < 0.0; } ANM2::Play(&npc->_sprite,(byte *)walkAnim,0); LAB_00526181: layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); local_d0.y = local_d8; layer->_flipX = isFlipX; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { fVar6 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; fVar6 = sqrtf(fVar9 * fVar9 + fVar6 * fVar6); if (2.3 <= fVar6) { local_d8 = local_d0.y; } else { fVar9 = (fVar6 - local_d8) / 1.3; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (local_d8 <= fVar9) { fVar9 = local_d8; } local_d0.y = fVar9 * 0.5 + 0.5; } if (6.0 < fVar6) { local_d0.y = (fVar6 - 6.0) * 0.25; if (local_d0.y <= 0.0) { local_d0.y = 0.0; } if (local_d8 <= local_d0.y) { local_d0.y = local_d8; } local_d0.y = local_d0.y + local_d8; } } (npc->_sprite)._playbackSpeed = local_d0.y; return; } fVar6 = (npc->_velocity).x; fVar9 = (npc->_velocity).y; fVar6 = sqrtf(fVar6 * fVar6 + fVar9 * fVar9); if (local_d8 <= fVar6) { fVar6 = (npc->_velocity).y; if (ABS(fVar6) < ABS((npc->_velocity).x)) { ANM2::Play(&npc->_sprite,(byte *)"WalkHori",0); isFlipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = isFlipX; return; } if (npc->_variant != 0) { if (fVar6 <= 0.0) { walkAnim = (char *)&DAT_00b1e020; } else { walkAnim = "WalkDown"; } goto LAB_00526455; } } else { fVar6 = ABS((npc->_pos).x - (npc->_targetPosition).x); if ((fVar6 < local_d8) && (ABS((npc->_pos).y - (npc->_targetPosition).y) < local_d8)) { if (npc->_variant == 0) { ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); return; } walkAnim = (char *)&DAT_00b1e020; if (local_c8 != 1.4013e-45) { walkAnim = "WalkDown"; } ANM2::SetFrame(&npc->_sprite,(std_string *)walkAnim,0); return; } fVar9 = ABS((npc->_pos).y - (npc->_targetPosition).y); if (fVar9 < fVar6) { ANM2::Play(&npc->_sprite,(byte *)"WalkHori",0); isFlipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_flipX = isFlipX; return; } if (npc->_variant != 0) { if (fVar9 <= 0.0) { walkAnim = "WalkDown"; } else { walkAnim = (char *)&DAT_00b1e020; } goto LAB_00526455; } } walkAnim = "WalkVert"; LAB_00526455: ANM2::Play(&npc->_sprite,(byte *)walkAnim,0); return; } //@@ 00526470 NpcAI::ENTITY_HOPPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 29 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HOPPER(Entity_NPC *npc) { int *piVar1; float fVar2; void *pvVar3; void *pvVar4; short sVar5; undefined1 *puVar6; Room *pRVar7; undefined4 uVar8; RNG rng; Vector pos; Vector pos_00; ANM2 *pAVar9; Manager *pMVar10; byte bVar11; char cVar12; ColorMod *other; Vector *pVVar13; ColorMod *color; ProjectileParams *pPVar14; ColorMod *extraout_EAX; ColorMod *color_00; ColorMod *color_01; byte *pbVar15; int iVar16; Vector *pVVar17; uint uVar18; Entity *pEVar19; undefined4 *puVar20; EntityRef *pEVar21; byte *pbVar22; Vector *extraout_ECX; Vector *extraout_ECX_00; void *pvVar23; void **ppvVar24; char *anim; undefined4 *puVar25; bool bVar26; float fVar27; float fVar28; char *anim_00; uint uVar29; undefined4 local_31c [8]; undefined4 local_2fc; undefined4 uStack_2f8; undefined4 local_2f4; undefined4 local_2f0 [11]; int local_2c4; Vector scratchVec; Vector local_2b8; Vector local_2b0; uint local_2a8; undefined1 auStack_2a4 [8]; Vector *pVStack_29c; Vector local_298; Vector local_290; byte local_285; float local_284; WeightedOutcomePicker local_280; Vector local_27c; undefined1 local_274 [8]; Vector *local_26c; Vector *local_268; Vector local_264; byte *local_25c; Vector local_258; undefined1 local_250 [8]; ProjectileParams local_248; ProjectileParams local_1a0; undefined1 local_108; ProjectileParams local_f8; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pvVar23 = ExceptionList; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af45f0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_2b8.y = (float)npc; if (npc->_state == 0) { iVar16 = npc->_type; npc->_state = 3; if (iVar16 != 0x56) { if (iVar16 != 0x1d) { if (iVar16 == 0x36) { local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 1.0; local_30 = 0.14117648; local_2c = 0.12156863; local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_28 = 0.10980392; puStack_20 = local_50 + 0x4c; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_50); ExceptionList = local_1c; return; } if (iVar16 == 0xf6) { if (npc->_variant == 1) { puStack_20 = local_50 + 0x4c; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)&DAT_00c34da4); ExceptionList = local_1c; return; } ExceptionList = pvVar23; return; } if (iVar16 != 0x22) { ExceptionList = pvVar23; return; } if (npc->_variant == 1) { Color::Color((Color *)local_50); Color::operator_assign((Color *)&npc->_splatColor,other); ExceptionList = local_1c; return; } ExceptionList = pvVar23; return; } if (npc->_variant != 2) { ExceptionList = pvVar23; return; } } if (&npc->_splatColor == (ColorMod *)local_2f0) { ExceptionList = pvVar23; return; } (npc->_splatColor)._tint[0] = 0.4; (npc->_splatColor)._tint[1] = 0.2; (npc->_splatColor)._tint[2] = 0.2; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; ExceptionList = pvVar23; return; } if (((((npc->_flags & 0x800000000000) != 0) && (npc->_knockbackCountdown == 1)) && (((npc->_targetPosition).x != g_vectorZero.x || ((npc->_targetPosition).y != g_vectorZero.y))) ) && (npc->_state == 4)) { npc->_state = 3; npc->_stateFrame = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } puVar20 = (npc->_damageEvents)._begin; ppvVar24 = (npc->_damageEvents)._end; puStack_20 = local_50 + 0x4c; if ((void **)puVar20 != ppvVar24) { local_25c = (byte *)(puVar20 + 0xe); pbVar15 = local_25c; local_27c.y = (float)puVar20; puStack_20 = local_50 + 0x4c; do { if ((*(uint *)((int)pbVar15 + -0x30) & 2) == 0) { LAB_005267e3: puVar20 = puVar20 + 0xe; pbVar22 = (byte *)((int)pbVar15 + 0x38); local_27c.y = (float)puVar20; local_25c = pbVar22; } else { if (((Room *)npc)->_gridEntities[1] == &DAT_0000001d) { if (((Room *)npc)->_gridEntities[2] != (void *)0x0) goto LAB_005267e3; local_274._4_4_ = (float)((Room *)npc)->_gridEntities[0xd7] / (float)((Room *)npc)->_gridEntities[0xd8] ; Entity_NPC::Morph(npc,0x36,0,0,-1); local_2fc = 0x3e109091; uStack_2f8 = 0x3df8f8f9; local_2f4 = 0x3de0e0e1; if ((ColorMod *)(((Room *)npc)->_gridEntities + 0x70) != (ColorMod *)local_31c) { ((ColorMod *)(((Room *)npc)->_gridEntities + 0x70))->_tint[0] = 0.0; ((Room *)npc)->_gridEntities[0x71] = (void *)0x0; ((Room *)npc)->_gridEntities[0x72] = (void *)0x0; ((Room *)npc)->_gridEntities[0x73] = (void *)0x3f800000; ((Room *)npc)->_gridEntities[0x78] = (void *)0x3e109091; ((Room *)npc)->_gridEntities[0x79] = (void *)0x3df8f8f9; ((Room *)npc)->_gridEntities[0x74] = (void *)0x0; ((Room *)npc)->_gridEntities[0x75] = (void *)0x0; ((Room *)npc)->_gridEntities[0x76] = (void *)0x0; ((Room *)npc)->_gridEntities[0x77] = (void *)0x0; ((Room *)npc)->_gridEntities[0x7a] = (void *)0x3de0e0e1; } ((Room *)npc)->_gridEntities[0xd7] = (void *)((float)local_274._4_4_ * (float)((Room *)npc)->_gridEntities[0xd8]); pbVar15 = local_25c; } else if (((Room *)npc)->_gridEntities[1] != (undefined1 *)0x36) goto LAB_005267e3; local_250._4_4_ = ((Room *)npc)->_gridWidth; pVVar13 = (Vector *)local_250._4_4_; pbVar22 = pbVar15; if (pbVar15 != (byte *)local_250._4_4_) { puVar20 = (undefined4 *)((int)pbVar15 + -0xc); puVar25 = (undefined4 *)pbVar15; do { puVar20[-0xb] = *puVar25; puVar25 = puVar25 + 0xe; puVar20[-9] = puVar20[5]; puVar20[-8] = puVar20[6]; puVar20[-7] = puVar20[7]; puVar20[-6] = puVar20[8]; puVar20[-5] = puVar20[9]; puVar20[-4] = puVar20[10]; puVar20[-3] = puVar20[0xb]; puVar20[-2] = puVar20[0xc]; puVar20[-1] = puVar20[0xd]; *puVar20 = puVar20[0xe]; puVar20[1] = puVar20[0xf]; puVar20[2] = puVar20[0x10]; puVar20 = puVar20 + 0xe; } while (puVar25 != (undefined4 *)local_250._4_4_); pVVar13 = *(void **)((int)local_2b8.y + 0xc); pbVar22 = local_25c; puVar20 = (undefined4 *)local_27c.y; npc = (Entity_NPC *)local_2b8.y; } ppvVar24 = (void **)(pVVar13 + -7); ((Room *)npc)->_gridWidth = (int)ppvVar24; local_274._4_4_ = pbVar15; } pbVar15 = pbVar22; } while ((void **)puVar20 != ppvVar24); } puVar6 = ((Room *)npc)->_gridEntities[1]; local_25c = s_Idle; local_27c.y = (float)&DAT_00b1de1c; if (puVar6 == (undefined1 *)0x56) { local_25c = &DAT_00b1cddc; local_27c.y = 1.6335519e-38; anim = "ShootDown"; } else if (puVar6 == (undefined1 *)0x131) { anim = "Attack"; } else { anim = (char *)&s_empty; if ((puVar6 == &DAT_0000001d) && (((Room *)npc)->_gridEntities[2] == (void *)0x3)) { local_25c = s_Idle2; uVar29 = ((Room *)npc)->_gridPaths[0x115] & 1; local_274._4_4_ = &DAT_00b1de1c; if (uVar29 == 0) { local_25c = s_Idle; } local_27c.y = (float)&DAT_00b60f70; if (uVar29 == 0) { local_27c.y = (float)&DAT_00b1de1c; } } } if (((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) == 0)) && (iVar16 = ((Room *)npc)->_gridPaths[0xfe], iVar16 != 5)) { if (iVar16 == 3) { anim_00 = (char *)local_25c; } else if (iVar16 == 6) { anim_00 = "BigJumpUp"; } else { if (iVar16 != 7) goto LAB_005268cd; anim_00 = "BigJumpDown"; } ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),(byte *)anim_00,0); } LAB_005268cd: puVar6 = ((Room *)npc)->_gridEntities[1]; local_268 = (Vector *)0x0; local_284 = 0.0; local_264.y = 0.0; if (puVar6 == &DAT_0000001d) { pvVar23 = ((Room *)npc)->_gridEntities[2]; if (pvVar23 == (void *)0x1) goto LAB_00526934; if (pvVar23 == (void *)0x2) { local_264.y = (float)&DAT_00000008; } else if (pvVar23 == (void *)0x3) { local_264.y = 3.64338e-44; } } else if (puVar6 == (undefined1 *)0xf6) { LAB_00526934: if (*(int *)&((Room *)npc)->field_0xf1c == -1) { uVar29 = Random(); local_284 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 * 50.0; uVar29 = Random(); local_264.y = (float)&DAT_0000000f; local_284 = local_284 + (float)local_268 + (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 * 70.0; } else { local_284 = 120.0; local_264.y = (float)&DAT_0000000f; } } else if (puVar6 == (undefined1 *)0x36) { if (*(int *)&((Room *)npc)->field_0xf1c == -1) { uVar29 = Random(); local_284 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 * 50.0 + (float)local_268; } else { local_284 = 50.0; } } local_2b0.y = local_284 * 1.3 + 130.0; if (((Room *)npc)->_gridEntities[1] == (undefined1 *)0xf6) { bVar26 = ((Room *)npc)->_gridEntities[2] == (void *)0x1; LAB_00526a65: if (bVar26) { local_2b0.y = local_2b0.y * 0.7; } } else if (((Room *)npc)->_gridEntities[1] == &DAT_0000001d) { bVar26 = ((Room *)npc)->_gridEntities[2] == (void *)0x2; goto LAB_00526a65; } if (*(int *)&((Room *)npc)->field_0xf1c != -1) { pVVar13 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.1); if ((pVVar13->x == g_vectorZero.x) && (pVVar13->y == g_vectorZero.y)) { pVVar17 = local_268; } else { local_250._4_4_ = (float)((Room *)npc)->_gridPaths[0x113] + 1.0; pVVar13 = (Vector *)(local_250 + 4); local_274._4_4_ = (undefined4 *)0x41f00000; pVVar17 = (Vector *)(local_274 + 4); if ((float)local_250._4_4_ <= 30.0) { pVVar17 = pVVar13; } pVVar17 = (Vector *)pVVar17->x; } ((Room *)npc)->_gridPaths[0x113] = (int)pVVar17; iVar16 = ((Room *)npc)->_gridPaths[0xfe]; if ((iVar16 == 3) || (iVar16 == 8)) { LAB_00526b38: Entity_NPC::SpawnControlTarget(npc,1,local_2b0.y); pVVar13 = extraout_ECX_00; } else if ((iVar16 == 4) && (((Room *)npc)->_gridEntities[0x16] != (void *)0x0)) { bVar11 = AnimationState::WasEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Land); pVVar13 = extraout_ECX; if (bVar11 != 0) goto LAB_00526b38; } if ((((((Room *)npc)->_gridPaths[0xfe] == 3) || (((Room *)npc)->_gridPaths[0xfe] == 4)) && (*(int *)&((Room *)npc)->field_0xf1c != -1)) && (bVar11 = input_is_action_pressed (9,*(int *)&((Room *)npc)->field_0xf1c,(Entity *)npc,(int)pVVar13), bVar11 != 0)) { ((Room *)npc)->_gridPaths[0x114] = 0x3f800000; } } Entity_NPC::CalcTargetPosition(npc,&local_290,60.0); local_274._4_4_ = ((Room *)npc)->_gridEntities + 0xc6; local_26c = (Vector *)(local_290.x - (float)((Vector *)local_274._4_4_)->x); local_258.y = local_290.y - (float)((Room *)npc)->_gridEntities[199]; iVar16 = ((Room *)npc)->_gridPaths[0xfe]; if (iVar16 == 3) { if ((((((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x == g_vectorZero.x) && ((float)((Room *)npc)->_gridEntities[0xc5] == g_vectorZero.y)) && ((((Room *)npc)->_gridEntities[1] == (void *)0x56 || (((Room *)npc)->_gridEntities[1] == (void *)0x131)))) && (((uint)((Room *)npc)->_gridEntities[0x51] & 0x1000a00) == 0)) { if (((Room *)npc)->_gridPaths[0x10d] < 1) { if (*(int *)&((Room *)npc)->field_0xf1c == -1) { bVar11 = (float)local_26c * (float)local_26c + local_258.y * local_258.y < 40000.0; } else { bVar11 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if ((bVar11 != 0) && ((*(int *)&((Room *)npc)->field_0xf1c != -1 || (bVar11 = Room::CheckLine(g_game->_room,(Vector *)(((Room *)npc)->_gridEntities + 0xc6), &local_290,3,999,0,0,(Vector *)0x0), bVar11 != 0)))) { Entity_NPC::UpdateControllerMovement(npc,1); ((Room *)npc)->_gridPaths[0x10d] = 2; ((Room *)npc)->_gridPaths[0xfe] = 8; bVar11 = ANM2::SetAnimation((ANM2 *)(((Room *)npc)->_gridEntities + 9),(byte *)anim,1); if (bVar11 != 0) { AnimationState::Rewind((AnimationState *)(((Room *)npc)->_gridEntities + 0x15)); *(byte *)(((Room *)npc)->_gridEntities + 0x1a) = 1; } ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; } iVar16 = ((Room *)npc)->_gridPaths[0xfe]; goto LAB_00526d06; } ((Room *)npc)->_gridPaths[0x10d] = ((Room *)npc)->_gridPaths[0x10d] - ((int)(float)((Room *)npc)->_gridEntities[0xe0] - (int)(float)((Room *)npc)->_gridEntities[0xdf]); } } else { LAB_00526d06: if (iVar16 == 8) { if (*(int *)&((Room *)npc)->field_0xf1c == -1) { ((Vector *)&((Room *)npc)->field_0xf20)->x = g_vectorZero.x; fVar27 = g_vectorZero.y; LAB_00526d99: *(float *)&((Room *)npc)->field_0xf24 = fVar27; } else { Entity_NPC::GetControllerMovementInput(npc,&local_298,0.1); if ((local_298.x != g_vectorZero.x) || (local_298.y != g_vectorZero.y)) { ((Vector *)&((Room *)npc)->field_0xf20)->x = local_298.x; fVar27 = local_298.y; goto LAB_00526d99; } } if (((Room *)npc)->_gridEntities[0x16] != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),(byte *)"Shoot") ; pMVar10 = g_manager; if (bVar11 != 0) { pVStack_29c = (Vector *)0x3f800000; if (((Room *)npc)->_gridPaths[0x13e] == 0x12) { pVStack_29c = (Vector *)0x3fc00000; } else if (((Room *)npc)->_gridPaths[0x13e] == 0x13) { pVStack_29c = (Vector *)0x3f000000; } local_250._4_4_ = 2.49431e-43; seed_fart_sound_override((int *)(local_250 + 4)); SoundEffects::Play(&pMVar10->_sfxManager,local_250._4_4_,1.0,2,0,(float)pVStack_29c,0.0); if ((*(int *)&((Room *)npc)->field_0xf1c != -1) && ((pVVar13 = (Vector *)((Vector *)&((Room *)npc)->field_0xf20)->x, (float)pVVar13 != g_vectorZero.x || (*(float *)&((Room *)npc)->field_0xf24 != g_vectorZero.y)))) { local_258.y = *(float *)&((Room *)npc)->field_0xf24; local_26c = pVVar13; } if (((Room *)npc)->_gridEntities[1] == (void *)0xf6) { ProjectileParams::ProjectileParams(&local_f8); local_f8.Color._tint[0] = 0.5; local_f8.Color._tint[1] = 0.0; local_f8.Color._tint[2] = 0.5; local_f8.Color._tint[3] = 1.0; local_f8.BulletFlags._0_4_ = (uint)local_f8.BulletFlags | 0x2800; local_f8.Color._colorize[0] = 0.0; local_f8.Color._colorize[1] = 0.0; local_f8.Color._colorize[2] = 0.0; local_f8.Color._colorize[3] = 0.0; local_f8.Color._offset[1] = (float)local_268; local_f8.Color._offset[0] = (float)local_268; local_f8.TargetPosition.x = ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; local_f8.TargetPosition.y = (float)((Room *)npc)->_gridEntities[199]; local_f8.Color._offset[2] = 0.0; pVStack_29c = local_26c; local_f8.GridCollision = 0; local_250._4_4_ = local_258.y; fVar27 = sqrtf((float)local_26c * (float)local_26c + local_258.y * local_258.y); if (fVar27 <= (float)local_268) { pVVar13 = (Vector *)local_250._4_4_; pVVar17 = pVStack_29c; } else { pVVar13 = (Vector *)((1.0 / fVar27) * local_258.y); pVVar17 = (Vector *)((1.0 / fVar27) * (float)local_26c); } local_298.x = (float)pVVar17 * 7.0; local_298.y = (float)pVVar13 * 7.0; Entity_NPC::FireProjectiles (npc,(Vector *)(((Room *)npc)->_gridEntities + 0xc6),&local_298,0,&local_f8); pPVar14 = &local_f8; scratchVec.x = -local_298.x; scratchVec.y = -local_298.y; pVVar13 = &scratchVec; uVar29 = 0; } else { pVStack_29c = local_26c; local_250._4_4_ = local_258.y; fVar27 = sqrtf((float)local_26c * (float)local_26c + local_258.y * local_258.y); if (fVar27 <= (float)local_268) { pVVar13 = (Vector *)local_250._4_4_; } else { pVStack_29c = (Vector *)((1.0 / fVar27) * (float)local_26c); pVVar13 = (Vector *)((1.0 / fVar27) * local_258.y); } local_298.x = (float)pVStack_29c * 7.0; local_298.y = (float)pVVar13 * 7.0; if (((Room *)npc)->_gridEntities[1] == (void *)0x131) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&local_248); scratchVec.x = local_298.x + ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; scratchVec.y = local_298.y + (float)((Room *)npc)->_gridEntities[199]; local_248.Scale = 0.5; Entity_NPC::FireBossProjectiles(npc,5,&scratchVec,10.0,&local_248); *(bool *)(((Room *)npc)->_gridEntities + 0x49) = (float)pVStack_29c < (float)local_268 ; goto LAB_00527174; } pPVar14 = ProjectileParams::ProjectileParams(&local_248); uVar29 = 1; pVVar13 = &local_298; } Entity_NPC::FireProjectiles (npc,(Vector *)(((Room *)npc)->_gridEntities + 0xc6),pVVar13,uVar29,pPVar14); } LAB_00527174: if ((((Room *)npc)->_gridEntities[0x16] != (void *)0x0) && (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) != 0)) goto LAB_005271b7; } ((Room *)npc)->_gridPaths[0xfe] = 3; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; } } LAB_005271b7: fVar27 = local_264.y; iVar16 = ((Room *)npc)->_gridPaths[0xfe]; local_2c4 = 3; if (iVar16 == 6) { if (((Room *)npc)->_gridEntities[0x16] == (void *)0x0) { iVar16 = *(int *)&((Room *)npc)->field_0xf1c; } else { bVar11 = AnimationState::WasEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Jump); iVar16 = *(int *)&((Room *)npc)->field_0xf1c; if (bVar11 != 0) { pvVar23 = (void *)0x0; fVar27 = (float)((Room *)npc)->_gridPaths[0x111] + 0.02; ((Room *)npc)->_gridEntities[0x59] = (void *)0x0; if (iVar16 != -1) { pvVar23 = (void *)0x3; } ((Room *)npc)->_gridEntities[0x58] = pvVar23; ((Room *)npc)->_gridPaths[0x111] = (int)fVar27; if (iVar16 == -1) { fVar28 = ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x; fVar2 = ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; ((Room *)npc)->_gridEntities[199] = (void *)((1.0 - fVar27) * (float)((Room *)npc)->_gridEntities[199] + fVar27 * (float)((Room *)npc)->_gridEntities[0xc5]); ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x = (1.0 - fVar27) * fVar2 + fVar27 * fVar28; } else { Entity_NPC::apply_controller_movement(npc); ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; ((Room *)npc)->_gridEntities[0xc5] = ((Room *)npc)->_gridEntities[199]; } if ((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) == 0)) { ((Room *)npc)->_gridPaths[0xfe] = 7; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; ((Room *)npc)->_gridEntities[0xcc] = (void *)0x0; } goto LAB_005283ec; } } ((Room *)npc)->_gridEntities[0x59] = &DAT_00000004; ((Room *)npc)->_gridEntities[0x58] = &DAT_00000005; ((Room *)npc)->_gridEntities[0xd2] = (void *)((float)((Room *)npc)->_gridEntities[0xd2] * 0.8); if (iVar16 != -1) { PathFinder::FindGridPath ((PathFinder *)(((Room *)npc)->_gridEntities + 0xfc),&g_vectorZero,0.5,0,1); } } else { if (iVar16 == 7) { if ((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (bVar11 = AnimationState::WasEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Land), bVar11 == 0)) { pvVar23 = (void *)0x0; fVar27 = (float)((Room *)npc)->_gridPaths[0x111] + 0.02; bVar26 = *(int *)&((Room *)npc)->field_0xf1c == -1; ((Room *)npc)->_gridEntities[0x59] = (void *)0x0; if (!bVar26) { pvVar23 = (void *)0x3; } ((Room *)npc)->_gridEntities[0x58] = pvVar23; ((Room *)npc)->_gridPaths[0x111] = (int)fVar27; if (bVar26) { fVar28 = ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x; fVar2 = ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; ((Room *)npc)->_gridEntities[199] = (void *)((1.0 - fVar27) * (float)((Room *)npc)->_gridEntities[199] + fVar27 * (float)((Room *)npc)->_gridEntities[0xc5]); ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x = (1.0 - fVar27) * fVar2 + fVar27 * fVar28; } else { Entity_NPC::apply_controller_movement(npc); ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; ((Room *)npc)->_gridEntities[0xc5] = ((Room *)npc)->_gridEntities[199]; } } else { ((Room *)npc)->_gridEntities[0x59] = &DAT_00000004; ((Room *)npc)->_gridEntities[0x58] = &DAT_00000005; ((Room *)npc)->_gridEntities[0xd2] = (void *)((float)((Room *)npc)->_gridEntities[0xd2] * 0.8); } if (((Room *)npc)->_gridEntities[0x16] != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Land); if (bVar11 != 0) { Entity_NPC::PlaySound(npc,0x45,2.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); if ((((Room *)npc)->_gridEntities[1] == (void *)0x22) && (((Room *)npc)->_gridEntities[2] == (void *)0x1)) { uVar29 = Random(); pEVar19 = Game::Spawn(g_game,1000,0x1a,(Vector *)(((Room *)npc)->_gridEntities + 0xc6), &g_vectorZero,(Entity *)npc,0,uVar29); fVar27 = g_vectorOne.y * 2.0; iVar16 = *(int *)pEVar19; (pEVar19->_sprite)._scale.x = g_vectorOne.x * 2.0; pAVar9 = &pEVar19[1]._sprite; (pAVar9->_filename)._buf[8] = ','; (pAVar9->_filename)._buf[9] = '\x01'; (pAVar9->_filename)._buf[10] = '\0'; (pAVar9->_filename)._buf[0xb] = '\0'; (pEVar19->_sprite)._scale.y = fVar27; pAVar9 = &pEVar19[1]._sprite; (pAVar9->_filename)._buf[0xc] = ','; (pAVar9->_filename)._buf[0xd] = '\x01'; (pAVar9->_filename)._buf[0xe] = '\0'; (pAVar9->_filename)._buf[0xf] = '\0'; (**(code **)(iVar16 + 0xc))(); pEVar19 = spawn_blood_explosion (2,(Vector *)(((Room *)npc)->_gridEntities + 0xc6),&g_vectorZero, (ColorMod *)(((Room *)npc)->_gridEntities + 0x70),&g_vectorZero); pEVar19->_renderDepthOffset = -10.0; ProjectileParams::ProjectileParams(&local_1a0); Color::operator_assign((Color *)&local_1a0.Color,(ColorMod *)&DAT_00c34e54); local_1a0.Scale = 0.7; Entity_NPC::FireBossProjectiles(npc,6,&g_vectorZero,10.0,&local_1a0); } else { pVVar13 = &g_vectorZero; Color::Color((Color *)local_50); pEVar19 = spawn_blood_explosion (2,(Vector *)(((Room *)npc)->_gridEntities + 0xc6),&g_vectorZero, color,pVVar13); pEVar19->_renderDepthOffset = -10.0; pPVar14 = ProjectileParams::ProjectileParams(&local_1a0); if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { local_274._0_4_ = (Room *)0x41400000; } else { local_274._0_4_ = (Room *)0x41100000; } local_274._4_4_ = (Vector *)0x0; Entity_NPC::FireProjectiles (npc,(Vector *)(((Room *)npc)->_gridEntities + 0xc6),(Vector *)local_274,6, pPVar14); } } if ((((Room *)npc)->_gridEntities[0x16] != (void *)0x0) && (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) != 0)) goto LAB_005283ec; } ((Room *)npc)->_gridPaths[0xfe] = 3; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; goto LAB_005283ec; } if (iVar16 == 3) { if ((((int)((Room *)npc)->_gridEntities[0xfb] < (int)local_264.y) || (((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x != g_vectorZero.x)) || ((float)((Room *)npc)->_gridEntities[0xc5] != g_vectorZero.y)) goto LAB_005283ec; local_264.y = (float)local_268; local_264.x = (float)local_268; if (*(int *)&((Room *)npc)->field_0xf1c == -1) { if (local_2b0.y * local_2b0.y <= (float)local_26c * (float)local_26c + local_258.y * local_258.y) { pVVar13 = MusicManager::RandomVector((Vector *)local_250); local_264.y = (local_284 + 95.0) * pVVar13->y + (float)((Room *)npc)->_gridEntities[199]; local_264.x = (local_284 + 95.0) * pVVar13->x + ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; } else { local_264.x = local_290.x + ((float)local_26c * local_284) / 200.0; pVStack_29c = (Vector *)(local_290.y + (local_258.y * local_284) / 200.0); local_264.y = (float)pVStack_29c; local_250._4_4_ = local_264.x; if (((Room *)npc)->_gridEntities[1] == (void *)0x36) { pEVar19 = Entity_NPC::GetPlayerTarget(npc); local_264.x = (pEVar19->_velocity).x * 5.0 + (float)local_250._4_4_; local_264.y = (float)pVStack_29c + (pEVar19->_velocity).y * 5.0; } } fVar27 = 5.0; pVVar13 = &local_264; LAB_00527921: pVVar13 = Room::GetClampedPosition(g_game->_room,(Vector *)(auStack_2a4 + 4),pVVar13,fVar27) ; local_264.y = (float)pVVar13->y; local_264.x = (float)pVVar13->x; } else if ((((Vector *)fVar27 == (Vector *)0x0) && (10.0 < (float)((Room *)npc)->_gridPaths[0x113])) || (cVar12 = Entity_NPC::is_controller_input_idle(npc), cVar12 != '\0')) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,(Vector *)(auStack_2a4 + 4)); uVar8 = local_274._4_4_; pVStack_29c = (Vector *)(pVVar13->y - *(float *)(local_274._4_4_ + 4)); local_250._4_4_ = pVVar13->x - (float)*(void **)local_274._4_4_; fVar27 = sqrtf((float)pVStack_29c * (float)pVStack_29c + (float)local_250._4_4_ * (float)local_250._4_4_); if (10.0 < fVar27) { local_250._0_4_ = (float)*(void **)uVar8 + (float)local_250._4_4_; local_250._4_4_ = *(float *)(uVar8 + 4) + (float)pVStack_29c; fVar27 = 10.0; pVVar13 = (Vector *)local_250; goto LAB_00527921; } local_264.y = g_vectorZero.y; local_264.x = g_vectorZero.x; } if ((local_264.x == g_vectorZero.x) && (local_264.y == g_vectorZero.y)) { pVVar13 = (Vector *)0x3; } else { pos.y = local_264.y; pos.x = local_264.x; pVVar13 = (Vector *)Room::GetGridCollisionAtPos(g_game->_room,pos); } if (((Room *)npc)->_gridEntities[1] == (void *)0x348) { if (*(int *)&((Room *)npc)->field_0xf1c == -1) { local_250._4_4_ = &g_game->_room; iVar16 = Room::GetGridPathFromPos(*(Room **)local_250._4_4_,&local_264); uVar8 = local_274._4_4_; pVStack_29c = (Vector *)0x0; if (199 < iVar16) { pVVar13 = (Vector *)0x2; } do { bVar26 = pVVar13 == (Vector *)0x0; pVVar13 = (Vector *)0x0; if (bVar26) break; pRVar7 = *(void **)local_250._4_4_; uVar29 = Random(); fVar27 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_274._4_4_ = fVar27 + fVar27; local_25c = (byte *)sin((float)local_274._4_4_); local_250._4_4_ = local_284 + 95.0; fVar27 = cos((float)local_274._4_4_); local_2b0.x = fVar27 * (float)local_250._4_4_ + (float)*(void **)uVar8; local_2b0.y = (float)local_25c * (float)local_250._4_4_ + *(float *)(uVar8 + 4); Room::GetClampedPositionImpl(pRVar7,&local_258,&local_2b0,0.0,0.0,0.0,(float)local_268); local_264.x = local_258.x; local_250._4_4_ = &g_game->_room; local_264.y = local_258.y; pRVar7 = *(Room **)local_250._4_4_; pos_00.y = local_258.y; pos_00.x = local_258.x; local_274._4_4_ = Room::GetGridCollisionAtPos(pRVar7,pos_00); iVar16 = Room::GetGridPathFromPos(pRVar7,&local_264); pVVar13 = (Vector *)local_274._4_4_; if (199 < iVar16) { pVVar13 = (Vector *)0x2; } pVStack_29c = (Vector *)((int)&pVStack_29c->x + 1); } while (pVStack_29c < (Vector *)0xa); npc = (Entity_NPC *)local_2b8.y; goto LAB_00527b52; } LAB_00527b5b: bVar11 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } else { LAB_00527b52: if (*(int *)&((Room *)npc)->field_0xf1c != -1) goto LAB_00527b5b; uVar29 = Random(); bVar11 = uVar29 % 3 == 0; } if (((bVar11 == 0) || (((Room *)npc)->_gridEntities[1] != (void *)0xf6)) || (bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar11 != 0)) { if (pVVar13 == (Vector *)0x0) { pRVar7 = g_game->_room; iVar16 = Room::GetGridIndex(pRVar7,&local_264); if (-1 < iVar16) { pVVar13 = Room::GetGridPosition(pRVar7,&local_2b8,iVar16); ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = pVVar13->x; ((Room *)npc)->_gridEntities[0xc5] = (void *)pVVar13->y; ((Room *)npc)->_gridPaths[0xfe] = 4; ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),(byte *)local_27c.y,1); if (0x270e < (int)((Room *)npc)->_gridEntities[0xfb]) { Sprite::SetFrame_1((Sprite *)(((Room *)npc)->_gridEntities + 9),4); } ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; } } } else { Entity_NPC::UpdateControllerMovement(npc,1); ((Room *)npc)->_gridPaths[0xfe] = 8; ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),(byte *)"Appear",1); ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; } goto LAB_005283ec; } if (iVar16 != 4) goto LAB_005283ec; pvVar23 = ((Room *)npc)->_gridEntities[0x16]; if (pvVar23 == (void *)0x0) { local_258.y = 0.0; } else { local_258.y = (float)CONCAT31((int3)((uint)pvVar23 >> 8),*(undefined1 *)((int)pvVar23 + 0x34)) ; } pVVar13 = (Vector *)(((Room *)npc)->_gridEntities + 0xc6); local_27c.y = ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x - pVVar13->x; pVStack_29c = (Vector *) ((float)((Room *)npc)->_gridEntities[0xc5] - (float)((Room *)npc)->_gridEntities[199]); local_274._0_4_ = local_27c.y; local_274._4_4_ = pVStack_29c; local_2b8.y = sqrtf(local_27c.y * local_27c.y + (float)pVStack_29c * (float)pVStack_29c); if (local_258.y._0_1_ == '\0') { if (((Room *)npc)->_gridEntities[0x16] != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Land); if (bVar11 == 0) goto switchD_00527fc8_default; Entity_NPC::PlaySound(npc,0x45,1.0,2,0,1.0); puVar6 = ((Room *)npc)->_gridEntities[1]; if (puVar6 == (undefined1 *)0x348) { uVar29 = Random(); pEVar19 = Game::Spawn(g_game,1000,0x16,pVVar13,&g_vectorZero,(Entity *)npc,0,uVar29); fVar27 = g_vectorOne.y * 1.25; iVar16 = *(int *)pEVar19; (pEVar19->_sprite)._scale.x = g_vectorOne.x * 1.25; (pEVar19->_sprite)._scale.y = fVar27; (**(code **)(iVar16 + 0xc))(); pVVar17 = &g_vectorZero; Color::Color((Color *)local_50); color_00 = extraout_EAX; LAB_00527e22: pEVar19 = spawn_blood_explosion(2,pVVar13,&g_vectorZero,color_00,pVVar17); pEVar19->_renderDepthOffset = -10.0; pRVar7 = g_game->_room; iVar16 = Room::GetGridIndex(pRVar7,(Vector *)(((Room *)npc)->_gridEntities + 0xc6)); Room::SetGridPath(pRVar7,iVar16,900); } else { if (puVar6 == (undefined1 *)0x22) { if (((Room *)npc)->_gridEntities[2] == (void *)0x1) { uVar29 = Random(); pEVar19 = Game::Spawn(g_game,1000,0x1a,pVVar13,&g_vectorZero,(Entity *)npc,0,uVar29); fVar27 = g_vectorOne.y * 1.5; iVar16 = *(int *)pEVar19; (pEVar19->_sprite)._scale.x = g_vectorOne.x * 1.5; pAVar9 = &pEVar19[1]._sprite; (pAVar9->_filename)._buf[8] = ','; (pAVar9->_filename)._buf[9] = '\x01'; (pAVar9->_filename)._buf[10] = '\0'; (pAVar9->_filename)._buf[0xb] = '\0'; (pEVar19->_sprite)._scale.y = fVar27; pAVar9 = &pEVar19[1]._sprite; (pAVar9->_filename)._buf[0xc] = ','; (pAVar9->_filename)._buf[0xd] = '\x01'; (pAVar9->_filename)._buf[0xe] = '\0'; (pAVar9->_filename)._buf[0xf] = '\0'; (**(code **)(iVar16 + 0xc))(); pVVar17 = &g_vectorZero; color_00 = (ColorMod *)(((Room *)npc)->_gridEntities + 0x70); goto LAB_00527e22; } goto switchD_00527fc8_default; } if (puVar6 != &DAT_0000001d) goto switchD_00527fc8_default; if (((Room *)npc)->_gridEntities[2] == (void *)0x2) { bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar11 == 0) { uVar29 = Random(); pEVar19 = Game::Spawn(g_game,1000,0x19,pVVar13,&g_vectorZero,(Entity *)npc,0,uVar29); fVar27 = g_vectorOne.y * 0.8; iVar16 = *(int *)pEVar19; (pEVar19->_sprite)._scale.x = g_vectorOne.x * 0.8; pAVar9 = &pEVar19[1]._sprite; (pAVar9->_filename)._buf[8] = -0x6a; (pAVar9->_filename)._buf[9] = '\0'; (pAVar9->_filename)._buf[10] = '\0'; (pAVar9->_filename)._buf[0xb] = '\0'; (pEVar19->_sprite)._scale.y = fVar27; pAVar9 = &pEVar19[1]._sprite; (pAVar9->_filename)._buf[0xc] = -0x6a; (pAVar9->_filename)._buf[0xd] = '\0'; (pAVar9->_filename)._buf[0xe] = '\0'; (pAVar9->_filename)._buf[0xf] = '\0'; (**(code **)(iVar16 + 0xc))(); pRVar7 = g_game->_room; iVar16 = Room::GetGridIndex(pRVar7,(Vector *)(((Room *)npc)->_gridEntities + 0xc6)); Room::SetGridPath(pRVar7,iVar16,900); } goto switchD_00527fc8_default; } if (((Room *)npc)->_gridEntities[2] != (void *)0x3) goto switchD_00527fc8_default; pVVar17 = &g_vectorZero; Color::Color((Color *)local_50); pEVar19 = spawn_blood_explosion(2,pVVar13,&g_vectorZero,color_01,pVVar17); pEVar19->_renderDepthOffset = -10.0; Entity_NPC::MakeSplat(npc,1.0); pRVar7 = g_game->_room; iVar16 = Room::GetGridIndex(pRVar7,(Vector *)(((Room *)npc)->_gridEntities + 0xc6)); Room::SetGridPath(pRVar7,iVar16,900); ProjectileParams::ProjectileParams(&local_1a0); local_108 = 1; local_1a0.CircleAngle = 0.0; local_1a0.FallingAccelModifier = -0.07; switch(((Room *)npc)->_gridPaths[0x115]) { case 0: local_250._0_4_ = 8.0; local_250._4_4_ = (Vector *)0x0; uVar29 = 6; goto LAB_0052802d; case 1: local_250._4_4_ = (Vector *)0x40c00000; break; case 2: local_250._0_4_ = 8.0; local_250._4_4_ = (Vector *)0x41000000; goto LAB_00528024; case 3: local_250._4_4_ = (Vector *)0x41400000; break; default: goto switchD_00527fc8_default; } local_250._0_4_ = 10.0; LAB_00528024: uVar29 = 9; LAB_0052802d: Entity_NPC::FireProjectiles (npc,(Vector *)(((Room *)npc)->_gridEntities + 0xc6),(Vector *)local_250,uVar29, &local_1a0); } switchD_00527fc8_default: if ((((Room *)npc)->_gridEntities[0x16] != (void *)0x0) && (bVar11 = AnimationState::WasEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Jump), bVar11 != 0)) { ((Room *)npc)->_gridEntities[0x58] = (void *)0x3; ((Room *)npc)->_gridEntities[0x59] = (void *)0x2; goto LAB_005280c3; } } local_27c.y = local_27c.y * 0.1; ((Room *)npc)->_gridEntities[0x58] = &DAT_00000005; ((Room *)npc)->_gridEntities[0x59] = &DAT_00000004; pVStack_29c = (Vector *)((float)pVStack_29c * 0.1); local_274._0_4_ = local_27c.y; local_274._4_4_ = pVStack_29c; } LAB_005280c3: pbVar15 = local_25c; if ((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) == 0)) { ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),local_25c,0); local_258.y = (float)CONCAT31(local_258.y._1_3_,1); } if (((((Room *)npc)->_gridEntities[1] == (void *)0x348) && (((Room *)npc)->_gridEntities[0x16] != (void *)0x0)) && (bVar11 = AnimationState::WasEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Land), bVar11 != 0)) { uVar29 = Random(); local_258.y = (float)((uint)local_258.y & 0xff); if (uVar29 % 3 != 0) { local_258.y = 1.4013e-45; } } if (((local_2b8.y < 10.0) || (((fVar27 = ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x, fVar27 = sqrtf(fVar27 * fVar27 + (float)((Room *)npc)->_gridEntities[0xd0] * (float)((Room *)npc)->_gridEntities[0xd0]), fVar27 < 0.75 || (0x1e < (int)((Room *)npc)->_gridEntities[0xfb])) && (uVar29 = Random(), uVar29 % 10 == 0) ))) && (local_258.y._0_1_ != '\0')) { ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; ((Room *)npc)->_gridPaths[0xfe] = 3; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),pbVar15,0); } if (((Room *)npc)->_gridEntities[1] == &DAT_0000001d) { if (((((Room *)npc)->_gridEntities[2] == (void *)0x2) && (bVar11 = Sprite::IsEventTriggered((Sprite *)(((Room *)npc)->_gridEntities + 9),s_Land), bVar11 != 0)) && (uVar29 = Random(), uVar29 % 3 == 0)) { ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; ((Room *)npc)->_gridPaths[0xfe] = 3; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x270f; ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),pbVar15,0); } else if (((((Room *)npc)->_gridEntities[1] == &DAT_0000001d) && (((Room *)npc)->_gridEntities[2] == (void *)0x3)) && (bVar11 = Sprite::IsEventTriggered ((Sprite *)(((Room *)npc)->_gridEntities + 9),s_Land), bVar11 != 0 )) { if (((Room *)npc)->_gridPaths[0x115] < 3) { uVar29 = ((Room *)npc)->_gridPaths[0x115] + 1; ((Room *)npc)->_gridPaths[0x115] = uVar29; pbVar15 = s_Idle2; ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; if ((uVar29 & 1) == 0) { pbVar15 = s_Idle; } ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; ((Room *)npc)->_gridPaths[0xfe] = 3; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x270f; ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),pbVar15,0); } else { ((Room *)npc)->_gridPaths[0x115] = 0; } } } pvVar23 = ((Room *)npc)->_gridEntities[0xd2]; if (30.0 <= local_2b8.y) { if ((float)pvVar23 != (float)local_268) { pvVar4 = ((Room *)npc)->_gridEntities[0xde]; pvVar3 = ((Room *)npc)->_gridEntities[0xd0]; ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x = (local_27c.y * 0.05 * (float)pvVar4) / (float)pvVar23 + ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x; ((Room *)npc)->_gridEntities[0xd0] = (void *)(((float)pVStack_29c * 0.05 * (float)pvVar4) / (float)pvVar23 + (float)pvVar3); } } else { pVVar13 = Vector::Normalized((Vector *)local_274,&local_27c); pvVar23 = ((Room *)npc)->_gridEntities[0xd2]; if ((float)pvVar23 != (float)local_268) { fVar27 = pVVar13->x; fVar28 = ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x; ((Room *)npc)->_gridEntities[0xd0] = (void *)(((float)((Room *)npc)->_gridEntities[0xde] * pVVar13->y) / (float)pvVar23 + (float)((Room *)npc)->_gridEntities[0xd0]); ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x = ((float)((Room *)npc)->_gridEntities[0xde] * fVar27) / (float)pvVar23 + fVar28; } } if (((Room *)npc)->_gridEntities[1] == (void *)0x131) { *(bool *)(((Room *)npc)->_gridEntities + 0x49) = ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x <= (float)local_268 && (float)local_268 != ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x; } } LAB_005283ec: if (((((Room *)npc)->_gridEntities[1] == (void *)0x22) && (pVVar13 = (Vector *)(((Room *)npc)->_gridEntities + 0xc4), ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x == g_vectorZero.x)) && ((float)((Room *)npc)->_gridEntities[0xc5] == g_vectorZero.y)) { if (*(int *)&((Room *)npc)->field_0xf1c == -1) { uVar29 = Random(); bVar26 = uVar29 % 7 == 0; } else { bVar26 = (float)local_268 < (float)((Room *)npc)->_gridPaths[0x114]; } if ((bVar26) && (((uint)((Room *)npc)->_gridEntities[0x51] & 0x1000a00) == 0)) { pVVar13->x = local_290.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)local_290.y; ((Room *)npc)->_gridPaths[0x114] = 0; local_290.x = pVVar13->x; local_290.y = (float)((Room *)npc)->_gridEntities[0xc5]; local_2b8.y = (float)g_game->_room; iVar16 = Room::GetGridCollisionAtPos((Room *)local_2b8.y,*pVVar13); if (iVar16 != 0) { pVVar17 = Room::FindFreePickupSpawnPosition ((Room *)local_2b8.y,&local_290,pVVar13,120.0,0,0,0); pVVar13->x = pVVar17->x; ((Room *)npc)->_gridEntities[0xc5] = (void *)pVVar17->y; } ((Room *)npc)->_gridPaths[0x111] = 0; ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; ((Room *)npc)->_gridPaths[0xfe] = 6; } } if (((Room *)npc)->_gridPaths[0xfe] == 3) { ((Room *)npc)->_gridEntities[0x58] = &DAT_00000005; } pVVar13 = (Vector *)(((Room *)npc)->_gridEntities + 0xc6); if ((((Room *)npc)->_gridEntities[1] == (void *)0xf6) && (((Room *)npc)->_gridEntities[2] == (void *)0x1)) { local_27c.y = (float)g_game->_room; uVar29 = Room::GetGridIndex((Room *)local_27c.y,pVVar13); if ((uVar29 < 0x1c0) && (499 < ((int *)((int)local_27c.y + 0x76c))[uVar29])) { LAB_005285ae: iVar16 = ((Room *)npc)->_gridPaths[0xfe]; } else { uVar29 = Room::GetGridIndex((Room *)local_27c.y,pVVar13); iVar16 = ((Room *)npc)->_gridPaths[0xfe]; if (uVar29 < 0x1c0) { ((int *)((int)local_27c.y + 0x76c))[uVar29] = 500; goto LAB_005285ae; } } if (iVar16 == 0x10) { if (*(EntityPtr *)(((Room *)npc)->_gridEntities + 0xe6) == (EntityPtr)0x0) { uVar29 = Random(); Game::Spawn(g_game,1000,0xf,pVVar13,&g_vectorZero,(Entity *)0x0,0,uVar29); (**(code **)(*(int *)npc + 0x28))(); } } else { if ((*(byte *)((int)((Room *)npc)->_gridEntities + 0x14f) != 0) && (*(EntityPtr *)(((Room *)npc)->_gridEntities + 0xe6) != (EntityPtr)0x0)) { bVar11 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar11 == 0) { pvVar23 = ((Room *)npc)->_gridEntities[0xd2]; *(byte *)((int)((Room *)npc)->_gridEntities + 0x14f) = 0; ((Room *)npc)->_gridEntities[0xd7] = ((Room *)npc)->_gridEntities[0xd8]; ((Room *)npc)->_gridPaths[0xfe] = 0x10; *(byte *)(((Room *)npc)->_gridEntities + 0xe3) = 1; ((Room *)npc)->_gridEntities[0x59] = (void *)0x0; ((Room *)npc)->_gridEntities[0x58] = &DAT_00000005; ((Room *)npc)->_gridEntities[0xd2] = (void *)((float)pvVar23 * 0.3); Entity::RemoveStatusEffects((Entity *)npc); } scratchVec.x = 0.0; scratchVec.y = -5.0; spawn_blood_explosion (3,pVVar13,&scratchVec,(ColorMod *)(((Room *)npc)->_gridEntities + 0x70), &g_vectorZero); } if (((Room *)npc)->_gridPaths[0xfe] == 2) { ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),(byte *)"Regen",0); if ((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) == 0)) { *(byte *)(((Room *)npc)->_gridEntities + 0xe3) = 0; ((Room *)npc)->_gridPaths[0xfe] = 3; ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; ((Room *)npc)->_gridEntities[0x59] = &DAT_00000004; } } else if (((Room *)npc)->_gridPaths[0xfe] == 0x10) { ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),&DAT_00b60f6c,0); } } } if ((((Room *)npc)->_gridPaths[0xfe] == 3) && ((((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x != g_vectorZero.x || ((float)((Room *)npc)->_gridEntities[0xc5] != g_vectorZero.y)))) { ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = g_vectorZero.x; ((Room *)npc)->_gridEntities[0xc5] = (void *)g_vectorZero.y; } if ((((Room *)npc)->_gridEntities[1] != &DAT_0000001d) || (((Room *)npc)->_gridEntities[2] != (void *)0x2)) goto LAB_00528e5a; if (((Room *)npc)->_gridPaths[0xfe] == 5) { ((Room *)npc)->_gridEntities[0x59] = (void *)0x0; pvVar23 = ((Room *)npc)->_gridEntities[0xc5]; pvVar4 = ((Room *)npc)->_gridEntities[199]; ((Vector *)(((Room *)npc)->_gridEntities + 0xcf))->x = ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x - pVVar13->x; ((Room *)npc)->_gridEntities[0xd0] = (void *)((float)pvVar23 - (float)pvVar4); if ((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (bVar11 = AnimationState::IsEventTriggered ((AnimationState *)(((Room *)npc)->_gridEntities + 0x15),s_Jump), bVar11 == 0)) { if (-1 < (int)((Room *)npc)->_gridEntities[0xfb]) goto LAB_0052883d; } else { Entity_NPC::PlaySound(npc,0xed,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xb5,1.0,2,0,1.0); ((Room *)npc)->_gridEntities[0xfb] = (void *)0x0; LAB_0052883d: local_26c = (Vector *) ((int)(float)((Room *)npc)->_gridEntities[0xe0] - (int)(float)((Room *)npc)->_gridEntities[0xdf]); if (0 < (int)local_26c) { do { pvVar23 = (void *)((int)((Room *)npc)->_gridEntities[0xfb] + 1); ((Room *)npc)->_gridEntities[0xfb] = pvVar23; if ((int)pvVar23 < 0xf) { if ((int)pvVar23 % local_2c4 != 2) goto LAB_0052888b; LAB_005288b6: sVar5 = *(short *)((int)((Room *)npc)->_gridPaths + 0x50a); if (0 < sVar5) { uVar18 = (int)sVar5 + 1; uVar29 = 3; if ((int)uVar18 < 3) { uVar29 = uVar18; } if ((uVar29 != 0) && (uVar18 = Random(), uVar18 % uVar29 != 0)) goto LAB_00528d74; } uVar29 = RNG::Next((RNG *)(((Room *)npc)->_gridEntities + 0xee)); uVar18 = Random(); fVar27 = (float)((double)(int)uVar18 + __uint_to_double_fixup[-((int)uVar18 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2b8.y = fVar27 + fVar27; local_274._4_4_ = sin(local_2b8.y); fVar27 = cos(local_2b8.y); scratchVec.x = fVar27 + ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; scratchVec.y = (float)local_274._4_4_ + (float)((Room *)npc)->_gridEntities[199]; pEVar19 = Game::Spawn(g_game,0x374,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar29); local_280 = (WeightedOutcomePicker)0x0; local_27c.x = 0.0; local_27c.y = 0.0; uVar8 = *(undefined4 *)((int)&pEVar19->_flags + 4); *(uint *)&pEVar19->_flags = (uint)pEVar19->_flags | 0x40000000; *(undefined4 *)((int)&pEVar19->_flags + 4) = uVar8; local_14 = 0; local_298.x = 0.0; local_298.y = 4.2039e-45; std::vector<8byte>::_Emplace_reallocate(0,&local_298); fVar27 = 0.0; local_258.y = (float)((int)local_27c.x - (int)local_280 >> 3); if (local_258.y != 0.0) { do { if (*(int *)((int)local_280 + (int)fVar27 * 8) == 1) { piVar1 = (int *)((int)local_280 + 4 + (int)fVar27 * 8); *piVar1 = *piVar1 + 2; if (*piVar1 < 0) { *(undefined4 *)((int)local_280 + 4 + (int)fVar27 * 8) = 0; } goto LAB_00528a93; } fVar27 = (float)((int)fVar27 + 1); } while ((uint)fVar27 < (uint)local_258.y); } local_290.x = 1.4013e-45; local_290.y = 2.8026e-45; if (local_27c.x == local_27c.y) { std::vector<8byte>::_Emplace_reallocate(local_27c.x,&local_290); } else { *(undefined4 *)local_27c.x = 1; *(void **)((int)local_27c.x + 4) = (void *)0x2; local_27c.x = (float)((int)local_27c.x + 8); } LAB_00528a93: puVar20 = (undefined4 *)0x0; local_258.y = (float)((int)local_27c.x - (int)local_280 >> 3); if ((Vector *)local_258.y != (Vector *)0x0) { do { if (*(int *)((int)local_280 + (int)puVar20 * 8) == 2) { piVar1 = (int *)((int)local_280 + 4 + (int)puVar20 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)((int)local_280 + 4 + (int)puVar20 * 8) = 0; } goto LAB_00528b17; } puVar20 = (undefined4 *)((int)puVar20 + 1); } while (puVar20 < (uint)local_258.y); } local_250._0_4_ = 2.8026e-45; local_250._4_4_ = (Vector *)0x1; if (local_27c.x == local_27c.y) { std::vector<8byte>::_Emplace_reallocate(local_27c.x,local_250); } else { *(undefined4 *)local_27c.x = 2; *(void **)((int)local_27c.x + 4) = (void *)0x1; local_27c.x = (float)((int)local_27c.x + 8); } LAB_00528b17: uVar29 = Random(); fVar27 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2b8.y = fVar27 + fVar27; local_25c = (byte *)sin(local_2b8.y); local_2b0.y = cos(local_2b8.y); local_2a8 = Random(); local_2a8 = local_2a8 | 1; auStack_2a4 = (undefined1 [8])0x900000005; pVStack_29c = (Vector *)&DAT_00000007; rng._shift1 = 5; rng._seed = local_2a8; rng._shift2 = 9; rng._shift3 = 7; uVar29 = WeightedOutcomePicker::PickOutcome(&local_280,rng); if (uVar29 == 0) { ANM2::Play(&pEVar19->_sprite,(byte *)"HopShort",0); if ((pEVar19->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar19->_sprite)._animState,4.0); } uVar29 = Random(); fVar27 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 + 5.0; LAB_00528c7d: fVar28 = local_2b0.y * fVar27; pbVar15 = (byte *)((float)local_25c * fVar27); } else { if (uVar29 == 1) { ANM2::Play(&pEVar19->_sprite,&DAT_00b1de1c,0); if ((pEVar19->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar19->_sprite)._animState,5.0); } uVar29 = Random(); fVar27 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10; fVar27 = fVar27 + fVar27 + 8.0; goto LAB_00528c7d; } if (uVar29 == 2) { ANM2::Play(&pEVar19->_sprite,(byte *)"HopLong",0); if ((pEVar19->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar19->_sprite)._animState,6.0); } uVar29 = Random(); fVar27 = (float)((double)(int)uVar29 + __uint_to_double_fixup[-((int)uVar29 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 10.0; goto LAB_00528c7d; } fVar28 = local_2b0.y; pbVar15 = local_25c; } local_14 = 0xffffffff; (pEVar19->_targetPosition).x = fVar28; (pEVar19->_targetPosition).y = (float)pbVar15; pEVar19[2]._posOffset.x = 8.40779e-45; (pEVar19->_velocity).x = fVar28; (pEVar19->_velocity).y = (float)pbVar15; if (local_280 != (WeightedOutcomePicker)0x0) { deallocate((void *)local_280,(int)local_27c.y - (int)local_280 >> 3); local_280 = (WeightedOutcomePicker)0x0; local_27c.x = 0.0; local_27c.y = 0.0; } } else { if ((int)pvVar23 < 0x20) { LAB_0052888b: if ((int)pvVar23 % 6 == 1) goto LAB_005288b6; } if (((int)pvVar23 < 0x3d) && ((int)pvVar23 % 0xf == 0)) goto LAB_005288b6; } LAB_00528d74: local_26c = (Vector *)((int)&local_26c[-1].y + 3); } while (local_26c != (Vector *)0x0); local_26c = (Vector *)0x0; } } if ((((Room *)npc)->_gridEntities[0x16] == (void *)0x0) || (*(byte *)(((Room *)npc)->_gridEntities + 0x1a) == 0)) { pEVar21 = EntityRef::EntityRef((EntityRef *)(local_50 + 4)); (**(code **)(*(int *)npc + 0x24))(pEVar21); } } if (((*(byte *)((int)((Room *)npc)->_gridEntities + 0x14f) != 0) && (((Room *)npc)->_gridPaths[0xfe] != 5)) && (((Room *)npc)->_gridPaths[0xfe] != 0x12)) { ANM2::Play((ANM2 *)(((Room *)npc)->_gridEntities + 9),&DAT_00b60f6c,0); ((Room *)npc)->_gridPaths[0xfe] = 5; local_285 = Entity::HasEntityFlags((Entity *)npc,0x1000000); Entity::RemoveStatusEffects((Entity *)npc); if (local_285 != 0) { EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); Entity::AddShrink((Entity *)npc,(EntityRef *)(local_50 + 4),-0x96,0,0); } ((Room *)npc)->_gridEntities[0xfb] = (void *)0xffffffff; *(byte *)(((Room *)npc)->_gridEntities + 0xe3) = 1; *(byte *)((int)((Room *)npc)->_gridEntities + 0x14f) = 0; ((Room *)npc)->_gridEntities[0xd7] = (void *)0x3dcccccd; ((Vector *)(((Room *)npc)->_gridEntities + 0xc4))->x = ((Vector *)(((Room *)npc)->_gridEntities + 0xc6))->x; ((Room *)npc)->_gridEntities[0xc5] = ((Room *)npc)->_gridEntities[199]; } LAB_00528e5a: ((Room *)npc)->_gridEntities[0xfb] = (void *)((int)((Room *)npc)->_gridEntities[0xfb] + ((int)(float)((Room *)npc)->_gridEntities[0xe0] - (int)(float)((Room *)npc)->_gridEntities[0xdf])); ((Room *)npc)->_gridEntities[0xd2] = (void *)((float)((Room *)npc)->_gridEntities[0xd2] * 0.7); ExceptionList = local_1c; return; } //@@ 00528ec0 NpcHelper::migraine_timer_spawn /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? NpcAI::ENTITY_SPIDER passes 0x528ec0 as the callback of Entity_Effect::CreateTimer(interval 4, 3 times) for type 0x365 (Migraine); callback(Entity*) spawns around the entity pos (inlined Game::Spawn) */ void NpcHelper::migraine_timer_spawn(int param_1) { code *pcVar1; longlong lVar2; longlong lVar3; longlong lVar4; float fVar5; byte isErased; char cVar6; uint uVar7; uint uVar8; int *piVar9; void *pvVar10; Entity *pEVar11; int iVar12; int unusedArg; int unusedArg_00; uint uVar13; uint uVar14; PlayerManager *playerManager; bool bVar15; float fVar16; float fVar17; ulonglong timeNs; EntityPtr *pEVar18; float local_124; Entity *local_120; Game *local_11c; void *local_118; float local_114; float local_110; float local_10c; uint local_108; uint local_104; float spawnVelX; float fStack_fc; Game *local_f4; int owner; Vector spawnPos; uint local_e4; uint local_e0; Vector local_d4; uint uStack_cc; uint spawnSeed; void *pvStack_c4; EntityPtr *apEStack_bc [4]; Vector particleVel; EntityPtr *local_a4; Vector spawnVel [2]; int iStack_8c; uint uStack_88; int iStack_84; undefined4 uStack_80; Vector bloodVel [2]; undefined4 uStack_6c; undefined4 local_68; undefined4 uStack_64; undefined4 local_60 [5]; undefined1 auStack_4c [8]; int local_44; int local_3c; undefined1 auStack_30 [8]; int iStack_28; int iStack_24; undefined4 uStack_20; uint stackCookie; Game *game; EntityPtr *spawnerRef; ColorMod *spriteColor; stackCookie = __security_cookie ^ (uint)&local_124; spawnPos.x = *(float *)(param_1 + 0x33c); spawnPos.y = *(float *)(param_1 + 0x340); owner = param_1; uVar7 = Random(); fVar16 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_120 = (Entity *)(fVar16 + fVar16); uVar7 = Random(); local_110 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 6.0; spawnVelX = cos((float)local_120); spawnVelX = spawnVelX * local_110; spawnVel[0].x = spawnVelX; fVar16 = sin((float)local_120); local_118 = (void *)(fVar16 * local_110); spawnVel[0].y = (float)local_118; spawnSeed = Random(); local_11c = g_game; local_114 = 0.0; local_e4 = 3; local_f4 = (Game *)&DAT_00000004; lua_callback_run_pre_entity_spawn ((int *)&local_f4,(int *)&local_e4,&spawnPos,spawnVel,(Entity *)0x0,(int *)&local_114, &spawnSeed); uVar7 = local_e4; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0052926a: local_124 = local_114; } else { pEVar11 = (g_game->_deathmatchManager)._type; local_120 = pEVar11; uVar8 = Random(); fVar16 = local_114; local_68 = 5; uStack_64 = 9; local_110 = 9.80909e-45; local_60[0] = 7; if (local_f4 != (Game *)&DAT_00000005) goto LAB_0052926a; if (uVar7 < 0x12d) { if (uVar7 == 300) { while ((local_124 = local_114, local_114 == 0.0 || (cVar6 = (**(code **)(*(int *)pEVar11 + 0x24))(), cVar6 != '\0'))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)local_68 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)uStack_64 & 0x1f) ^ uVar8; uVar8 = uVar8 >> (SUB41(local_110,0) & 0x1f) ^ uVar8; iVar12 = ItemPool::GetCardEx(uVar8,0x19,10,10,1); iStack_28 = 5; iStack_24 = 9; uStack_20 = 7; auStack_30._4_4_ = uVar8; local_114 = (float)lua_callback_run_get_card((RNG *)(auStack_30 + 4),iVar12,1,1,0); } } else { if (uVar7 == 0x46) { local_d4.x = (float)((uint)local_114 >> 0xb); do { local_124 = local_114; if (local_114 != 0.0) { pcVar1 = *(code **)(*(int *)pEVar11 + 0x28); ItemPool::GetPillEffect(&g_game->_itemPool,(uint)local_114,(Entity_Player *)0x0); cVar6 = (*pcVar1)(); if (cVar6 == '\0') goto LAB_00529272; pEVar11 = local_120; } if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)local_68 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)uStack_64 & 0x1f) ^ uVar8; uVar8 = uVar8 >> (SUB41(local_110,0) & 0x1f) ^ uVar8; uVar7 = ItemPool::GetPill(uVar8); local_114 = (float)(uVar7 | ((uint)local_d4.x & 1) << 0xb); } while( true ); } if (uVar7 != 100) goto LAB_0052926a; local_124 = local_114; if (local_114 == 3.50325e-44) { LAB_005290ba: bVar15 = false; } else { local_d4.x = local_114; std::set::find_node(); if (((*(char *)(local_3c + 0xd) == '\0') && (*(int *)(local_3c + 0x10) <= (int)fVar16)) && (local_3c != pEVar11->_index)) goto LAB_005290ba; bVar15 = true; } if ((fVar16 == 0.0) || (bVar15)) { local_124 = (float)(**(code **)(*(int *)pEVar11 + 0x84))(); local_114 = local_124; } } } else { if (uVar7 != 0x15e) goto LAB_0052926a; while ((local_124 = local_114, local_114 == 0.0 || (cVar6 = (**(code **)(*(int *)pEVar11 + 0x2c))(), cVar6 != '\0'))) { local_114 = (float)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_00529272: local_120 = EntityFactory::Create(local_11c->_entityFactory,(uint)local_f4,0); if (local_120 == (Entity *)0x0) goto LAB_00529568; timeNs = GetTimeNs(); pEVar11 = local_120; local_108 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_104 = (uint)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)local_108 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_d4.y = (float)(lVar3 + lVar2); lVar2 = (ulonglong)local_108 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), local_104 + CARRY4((uint)lVar2,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar2) >> 0x20)); local_e0 = (uint)((ulonglong)lVar2 >> 0x20); pEVar18 = &local_120->_spawnerEntity; local_10c = (float)((uint)lVar2 >> 0x12 | local_e0 * 0x4000); local_e0 = local_e0 >> 0x12; local_120->_spawnerType = 0; local_120->_spawnerVariant = 0; if (*pEVar18 != (EntityPtr)0x0) { local_a4 = pEVar18; std::multiset::erase(); } iVar12 = *(int *)pEVar11; *pEVar18 = (EntityPtr)0x0; (pEVar11->_pos).x = spawnPos.x; (pEVar11->_pos).y = spawnPos.y; (pEVar11->_velocity).x = spawnVelX; (pEVar11->_velocity).y = (float)local_118; (**(code **)(iVar12 + 4))(local_f4,local_e4); game = local_11c; pvVar10 = local_11c->_room; iVar12 = *(int *)((int)pvVar10 + 0x1214); *(int *)((int)pvVar10 + 0x1214) = iVar12 + 1; pEVar11->_index = iVar12; EntityList::AddEntity((EntityList *)((int)pvVar10 + 0x1218),pEVar11); isErased = Game::ShouldEraseEnemy(pEVar11); if (isErased != 0) { Entity::RemoveWithPoof(pEVar11,unusedArg); } if ((pEVar11->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { uStack_88 = pEVar11->_variant; iStack_8c = pEVar11->_type; std::map::find(); pvVar10 = (game->_proceduralItemManager)._spawnTriggerTargets._head; if (pvStack_c4 == pvVar10) { iStack_84 = pEVar11->_type; uStack_80 = 0xffffffff; piVar9 = (int *)std::map::find(); pvStack_c4 = (void *)*piVar9; if (pvStack_c4 == pvVar10) goto LAB_005294e4; } uVar7 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (playerManager->_playerList)._end; } piVar9 = (playerManager->_playerList)._begin; if (uVar7 < (uint)((int)pvVar10 - (int)piVar9 >> 2)) { piVar9 = piVar9 + uVar7; } trigger_set_dispatch((void *)(*piVar9 + 0x1fc8),6,pEVar11,&spawnPos,spawnVel); uVar7 = uVar7 + 1; playerManager = &g_game->_playerManager; } while (uVar7 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_005294e4: timeNs = GetTimeNs(); uVar7 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_104 = (uint)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar7 * 0x431bde82; local_108 = (uint)lVar3; lVar4 = (ulonglong)uVar7 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_d4.y = (float)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_104 + CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); fVar16 = (float)((uint)lVar3 >> 0x12 | uVar8 * 0x4000); uVar7 = (int)fVar16 - (int)local_10c; bVar15 = CARRY4((uint)g_entitySpawnTimeMs,uVar7); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar7; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar8 >> 0x12) - local_e0) - (uint)((uint)fVar16 < (uint)local_10c)) + (uint)bVar15; LAB_00529568: bloodVel[0].x = spawnVelX * 0.4; bloodVel[0].y = (float)local_118 * 0.4; pvVar10 = (void *)(*(int *)(owner + 0x428) * -7 + 0x42); *(void **)&local_120[1].field_0x4 = pvVar10; local_120[1]._damageEvents._begin = pvVar10; uVar7 = Random(); pEVar11 = Game::Spawn(g_game,1000,2,&spawnPos,bloodVel,(Entity *)0x0,1,uVar7); (**(code **)(*(int *)pEVar11 + 0x3c))(&DAT_00c5c800,0xffffffff,0xff); (pEVar11->_sprite)._offset.x = 0.0; (pEVar11->_sprite)._offset.y = -5.0; pEVar11->_renderDepthOffset = 10.0; uVar7 = Random(); local_11c = (Game *)((uVar7 & 1) + 1); do { if (local_11c == (Game *)0x0) { return; } uVar7 = Random(); fVar16 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_f4 = (Game *)(fVar16 + fVar16); fVar16 = cos((float)local_f4); local_d4.x = fVar16 * 12.0 * 0.5 + spawnVelX; fVar16 = sin((float)local_f4); local_d4.y = fVar16 * 12.0 * 0.5 + fStack_fc; uVar7 = Random(); fVar16 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar16 = fVar16 + fVar16; uVar7 = Random(); local_114 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; fVar17 = cos(fVar16); pvStack_c4 = (void *)(fVar17 * local_114); particleVel.x = (float)pvStack_c4; local_10c = sin(fVar16); local_10c = local_10c * local_114; particleVel.y = local_10c; local_104 = Random(); local_f4 = g_game; pEVar18 = (EntityPtr *)0x0; local_124 = 7.00649e-45; local_120 = (Entity *)0x3e8; lua_callback_run_pre_entity_spawn ((int *)&local_120,(int *)&local_124,&local_d4,&particleVel,(Entity *)0x0, (int *)(apEStack_bc + -0x1f),&local_104); fVar16 = local_124; if (1 < *(int *)&g_game->_deathmatchManager) { piVar9 = (g_game->_deathmatchManager)._type; uVar7 = Random(); uStack_6c = 5; local_68 = 9; local_114 = 9.80909e-45; uStack_64 = 7; if (local_120 == (Entity *)&DAT_00000005) { if ((uint)fVar16 < 0x12d) { if (fVar16 == 4.2039e-43) { while ((pEVar18 == (EntityPtr *)0x0 || (cVar6 = (**(code **)(*piVar9 + 0x24))(pEVar18), cVar6 != '\0'))) { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = uVar7 >> ((byte)uStack_6c & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)local_68 & 0x1f) ^ uVar7; uVar7 = uVar7 >> (SUB41(local_114,0) & 0x1f) ^ uVar7; iVar12 = ItemPool::GetCardEx(uVar7,0x19,10,10,1); auStack_30._4_4_ = 5; iStack_28 = 9; iStack_24 = 7; auStack_30._0_4_ = uVar7; pEVar18 = (EntityPtr *)lua_callback_run_get_card((RNG *)auStack_30,iVar12,1,1,0); } } else { if (fVar16 == 9.80909e-44) { uVar8 = (uint)pEVar18 >> 0xb; do { if (pEVar18 != (EntityPtr *)0x0) { pcVar1 = *(code **)(*piVar9 + 0x28); iVar12 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)pEVar18,(Entity_Player *)0x0); cVar6 = (*pcVar1)(iVar12); if (cVar6 == '\0') goto LAB_00529a2e; } if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = uVar7 >> ((byte)uStack_6c & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)local_68 & 0x1f) ^ uVar7; uVar7 = uVar7 >> (SUB41(local_114,0) & 0x1f) ^ uVar7; uVar13 = ItemPool::GetPill(uVar7); pEVar18 = (EntityPtr *)(uVar13 | (uVar8 & 1) << 0xb); } while( true ); } if (fVar16 == 1.4013e-43) { if (pEVar18 == (EntityPtr *)0x19) { LAB_00529876: bVar15 = false; } else { local_a4 = pEVar18; std::set::find_node(auStack_4c,&local_a4); if (((*(char *)(local_44 + 0xd) == '\0') && (*(int *)(local_44 + 0x10) <= (int)pEVar18)) && (local_44 != piVar9[8])) goto LAB_00529876; bVar15 = true; } if ((pEVar18 == (EntityPtr *)0x0) || (bVar15)) { pEVar18 = (EntityPtr *)(**(code **)(*piVar9 + 0x84))(0); } } } } else if (fVar16 == 4.90454e-43) { while ((pEVar18 == (EntityPtr *)0x0 || (cVar6 = (**(code **)(*piVar9 + 0x2c))(pEVar18), cVar6 != '\0'))) { pEVar18 = (EntityPtr *)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } } LAB_00529a2e: pEVar11 = EntityFactory::Create(local_f4->_entityFactory,(uint)local_120,0); if (pEVar11 != (Entity *)0x0) { timeNs = GetTimeNs(); uVar7 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar7 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_114 = (float)(lVar3 + lVar2); lVar2 = (ulonglong)uVar7 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar2) >> 0x20)); uStack_cc = (uint)((ulonglong)lVar2 >> 0x20); spawnerRef = &pEVar11->_spawnerEntity; uVar7 = (uint)lVar2 >> 0x12 | uStack_cc * 0x4000; uStack_cc = uStack_cc >> 0x12; pEVar11->_spawnerType = 0; pEVar11->_spawnerVariant = 0; if (*spawnerRef != (EntityPtr)0x0) { apEStack_bc[0] = spawnerRef; std::multiset::erase(apEStack_bc); } iVar12 = *(int *)pEVar11; *spawnerRef = (EntityPtr)0x0; (pEVar11->_pos).x = local_d4.x; (pEVar11->_pos).y = local_d4.y; (pEVar11->_velocity).x = (float)pvStack_c4; (pEVar11->_velocity).y = local_10c; (**(code **)(iVar12 + 4))(local_120,local_124,pEVar18,local_104); game = local_f4; pvVar10 = local_f4->_room; iVar12 = *(int *)((int)pvVar10 + 0x1214); *(int *)((int)pvVar10 + 0x1214) = iVar12 + 1; pEVar11->_index = iVar12; EntityList::AddEntity((EntityList *)((int)pvVar10 + 0x1218),pEVar11); isErased = Game::ShouldEraseEnemy(pEVar11); if (isErased != 0) { Entity::RemoveWithPoof(pEVar11,unusedArg_00); } if ((pEVar11->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { iStack_84 = pEVar11->_variant; uVar8 = pEVar11->_type; uStack_88 = uVar8; std::map::find(&local_118,&uStack_88); if (local_118 == (game->_proceduralItemManager)._spawnTriggerTargets._head) { local_e0 = 0xffffffff; local_e4 = uVar8; piVar9 = (int *)std::map::find(local_60,&local_e4); local_118 = (void *)*piVar9; if (local_118 == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_00529ca4; } uVar8 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (playerManager->_playerList)._end; } piVar9 = (playerManager->_playerList)._begin; if (uVar8 < (uint)((int)pvVar10 - (int)piVar9 >> 2)) { piVar9 = piVar9 + uVar8; } trigger_set_dispatch((void *)(*piVar9 + 0x1fc8),6,pEVar11,&local_d4,&particleVel); uVar8 = uVar8 + 1; playerManager = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00529ca4: timeNs = GetTimeNs(); uVar8 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; pvStack_c4 = (void *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0x431bde82; local_10c = (float)lVar3; lVar4 = (ulonglong)uVar8 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_f4 = (Game *)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)pvStack_c4 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar14 = (uint)((ulonglong)lVar3 >> 0x20); uVar8 = (uint)lVar3 >> 0x12 | uVar14 * 0x4000; uVar13 = uVar8 - uVar7; bVar15 = CARRY4((uint)g_entitySpawnTimeMs,uVar13); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar13; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar14 >> 0x12) - uStack_cc) - (uint)(uVar8 < uVar7)) + (uint)bVar15; } (**(code **)(*(int *)pEVar11 + 0x3c))(&DAT_00c5c800,0xffffffff,0xff,0,1); spriteColor = &(pEVar11->_sprite)._color; if (&pEVar11->_splatColor != spriteColor) { fVar16 = (pEVar11->_sprite)._color._tint[1]; fVar17 = (pEVar11->_sprite)._color._tint[2]; fVar5 = (pEVar11->_sprite)._color._tint[3]; (pEVar11->_splatColor)._tint[0] = spriteColor->_tint[0]; (pEVar11->_splatColor)._tint[1] = fVar16; (pEVar11->_splatColor)._tint[2] = fVar17; (pEVar11->_splatColor)._tint[3] = fVar5; fVar16 = (pEVar11->_sprite)._color._colorize[1]; fVar17 = (pEVar11->_sprite)._color._colorize[2]; fVar5 = (pEVar11->_sprite)._color._colorize[3]; (pEVar11->_splatColor)._colorize[0] = (pEVar11->_sprite)._color._colorize[0]; (pEVar11->_splatColor)._colorize[1] = fVar16; (pEVar11->_splatColor)._colorize[2] = fVar17; (pEVar11->_splatColor)._colorize[3] = fVar5; *(undefined8 *)(pEVar11->_splatColor)._offset = *(undefined8 *)(pEVar11->_sprite)._color._offset; (pEVar11->_splatColor)._offset[2] = (pEVar11->_sprite)._color._offset[2]; } (**(code **)(*(int *)pEVar11 + 0xc))(); local_11c = (Game *)((int)local_11c + -1); } while( true ); } //@@ 00529da0 NpcAI::ENTITY_SPIDER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 85 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SPIDER(Entity_NPC *npc) { Vector pos; byte bVar1; char isInputIdle; Entity_Player *burstingSackOwner; Vector *pVVar2; int collisionClass; EntityRef *killSource; byte *animName; uint uVar3; int iVar4; Entity *burstingSackOwner; Entity *secondSpider; Vector *resultVec; Entity_Effect *timer; void *ptr; byte *pbVar6; byte *pbVar7; undefined1 *size; float fVar8; bool bVar9; float fVar10; float fVar11; Vector clampedPos; Vector local_78; Vector local_70; Vector local_68; Vector local_60; Vector local_58; char isPassive; char local_4d; EntityRef local_4c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; AnimationState *animState; undefined4 flagsHigh; Game *game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af462d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; burstingSackOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x179,(RNG **)&g_game->_playerManager,1); if ((burstingSackOwner == (Entity_Player *)0x0) || ((npc->_flags & 0x20000000) != 0)) { isPassive = '\0'; local_60.y = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); } else { local_4d = '\x01'; fVar8 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if ((npc->_state == 0) || (isPassive = '\x01', local_60.y = fVar8, g_game->_frameCount - npc->_spawnFrame == 1)) { local_4c._position.x = (float)0x656e695f; local_4c._entity = &DAT_0000000f; local_4c._flags = 6; local_4c._position.y._0_2_ = 0x7472; local_4c._position.y._2_1_ = 0; local_14 = 0; _NpcHelper::spider_load_graphics(&local_4c._position); local_14 = 0xffffffff; isPassive = local_4d; local_60.y = fVar8; if (&DAT_0000000f < local_4c._entity) { size = (undefined1 *)((int)local_4c._entity + 1); ptr = (void *)local_4c._position.x; if ((undefined1 *)0xfff < size) { ptr = *(void **)((int)local_4c._position.x + -4); size = (undefined1 *)((int)local_4c._entity + 0x24); if (0x1f < (uint)((int)local_4c._position.x + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,(uint)size); isPassive = local_4d; local_60.y = fVar8; } } } iVar4 = npc->_state; if (iVar4 == 0) { npc->_state = 4; npc->_stateFrame = 0; ExceptionList = local_1c; return; } if (((npc->_flags & 0x20000000) == 0) || (npc->_controllerID == -1)) { pVVar2 = Room::GetClampedPositionImpl(g_game->_room,&clampedPos,&npc->_pos,20.0,0.0,10.0,0.0); (npc->_pos).x = pVVar2->x; (npc->_pos).y = pVVar2->y; iVar4 = npc->_state; } collisionClass = 4; if (iVar4 == 6) { collisionClass = 0; } npc->_entityCollisionClass = collisionClass; if ((((npc->_type == 0xfa) || (npc->_type == 0x365)) && (npc->_controllerID != -1)) && (bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,iVar4), bVar1 != 0)) { killSource = EntityRef::EntityRef(&local_4c); (**(code **)(*(int *)npc + 0x24))(killSource); } if (npc->_state != 6) { if (((npc->_dead == 0) || (npc->_type != 0x5e)) || (npc->_health <= -20.0)) { if (npc->_state == 4) { Entity_NPC::CalcTargetPosition(npc,&local_58,60.0); pVVar2 = &npc->_pos; local_68.y = local_58.x - pVVar2->x; iVar4 = npc->_type; local_78.y = local_58.y - (npc->_pos).y; if (((iVar4 == 0xd7) || (iVar4 == 0xfa)) || (iVar4 == 0x365)) { local_4d = '\x01'; Entity_NPC::SpawnControlTarget(npc,0,110.0); } else { local_4d = '\0'; } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { ANM2::Play(&npc->_sprite,s_Idle,0); iVar4 = npc->_stateFrame; npc->_stateFrame = (int)local_60.y + iVar4; if (0xd < iVar4) { if (npc->_controllerID == -1) { if (isPassive == '\0') { local_78.y = sqrtf(local_68.y * local_68.y + local_78.y * local_78.y); uVar3 = Random(); if ((((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 100.0 + 100.0 <= local_78.y) && (npc->_forcedTarget == (EntityPtr)0x0)) || ((bVar1 = Room::CheckLine(g_game->_room,pVVar2,&local_58,1,0,0,0,(Vector *)0x0), bVar1 == 0 && (npc->_entityGridCollisionClass != 3)))) goto LAB_0052a81b; burstingSackOwner = Entity_NPC::GetPlayerTarget(npc); fVar8 = npc->_size; local_58.x = (burstingSackOwner->_velocity).x * 10.0 + local_58.x; local_58.y = (burstingSackOwner->_velocity).y * 10.0 + local_58.y; Room::GetClampedPositionImpl (g_game->_room,&local_70,&local_58,fVar8,fVar8,fVar8,fVar8); local_60.y = local_70.x; local_58.x = local_70.x; local_68.y = local_70.y; local_58.y = local_70.y; (npc->_targetPosition).x = local_70.x; (npc->_targetPosition).y = local_70.y; } else { LAB_0052a81b: pVVar2 = MusicManager::RandomVector(&local_70); uVar3 = Random(); game = g_game; fVar8 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 40.0 + 70.0; local_58.y = fVar8 * pVVar2->y + (npc->_pos).y; local_58.x = fVar8 * pVVar2->x + (npc->_pos).x; pVVar2 = Room::GetClampedPositionImpl (g_game->_room,&local_78,&local_58,70.0,40.0,60.0,60.0); local_60.y = pVVar2->x; local_68.y = pVVar2->y; local_78.y = (float)game->_room; local_58.x = local_60.y; local_58.y = local_68.y; iVar4 = Room::GetGridCollisionAtPos((Room *)local_78.y,*pVVar2); if (iVar4 == 0) { bVar1 = Room::CheckLine((Room *)local_78.y,&local_58,&npc->_pos,0,0,0,0, (Vector *)0x0); local_68.y = local_58.y; local_60.y = local_58.x; if (bVar1 == 0) { uVar3 = Random(); if (uVar3 % 0x14 == 0) { fVar8 = (npc->_pos).x; fVar10 = (npc->_pos).y; local_70.x = local_60.y * 0.1 + fVar8 * 0.9; local_70.y = local_68.y * 0.1 + fVar10 * 0.9; local_78.x = local_60.y * 0.9 + fVar8 * 0.1; local_78.y = local_68.y * 0.9 + fVar10 * 0.1; bVar1 = Room::CheckLine(g_game->_room,&local_78,&local_70,1,0,0,0, (Vector *)0x0); if (bVar1 != 0) goto LAB_0052a9e7; } } else { LAB_0052a9e7: (npc->_targetPosition).x = local_60.y; (npc->_targetPosition).y = local_68.y; npc->_stateFrame = 0xf; } } } iVar4 = npc->_type; if ((((iVar4 == 0xd7) || (iVar4 == 0xfa)) || (iVar4 == 0x365)) && ((uVar3 = Random(), uVar3 % 3 == 0 && (pos.y = local_58.y, pos.x = local_58.x, iVar4 = Room::GetGridCollisionAtPos(g_game->_room,pos), iVar4 == 0)))) { (npc->_targetPosition).x = local_60.y; (npc->_targetPosition).y = local_68.y; npc->_state = 6; bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Jump,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else { if ((local_4d != '\0') && (isInputIdle = Entity_NPC::is_controller_input_idle(npc), isInputIdle != '\0')) { resultVec = Entity_NPC::GetAimTargetPosition(npc,&local_70); local_58.x = resultVec->x; local_58.y = resultVec->y; iVar4 = Room::GetGridCollisionAtPos(g_game->_room,*resultVec); if (iVar4 == 0) { pVVar2 = Entity_NPC::GetAimTargetPosition(npc,&local_58); (npc->_targetPosition).x = pVVar2->x; (npc->_targetPosition).y = pVVar2->y; npc->_state = 6; bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Jump,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } goto LAB_0052abef; } } resultVec = Entity_NPC::GetControllerInput(npc,&local_78,0.1); bVar1 = Vector::operator_ne(resultVec,&g_vectorZero); if (bVar1 != 0) { (npc->_targetPosition).x = pVVar2->x; (npc->_targetPosition).y = (npc->_pos).y; npc->_stateFrame = 8; } } } } else { npc->_stateFrame = npc->_stateFrame - (int)local_60.y; animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_0052aafe: bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = animName; if (0xf < *(uint *)(animName + 0x14)) { pbVar6 = *(byte **)animName; } pbVar7 = s_Walk; do { bVar1 = *pbVar6; bVar9 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_0052aae0: uVar3 = -(uint)bVar9 | 1; goto LAB_0052aae5; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar9 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_0052aae0; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0052aae5: if ((uVar3 != 0) || ((animName[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0052aafe; } local_60.y = 6.0; if (npc->_type == 0x365) { local_60.y = 4.5; } if (npc->_controllerID == -1) { local_70.x = (npc->_targetPosition).x - (npc->_pos).x; local_70.y = (npc->_targetPosition).y - (npc->_pos).y; fVar8 = sqrtf(local_70.y * local_70.y + local_70.x * local_70.x); if ((fVar8 < 14.0) || ((fVar8 = (npc->_velocity).y, fVar10 = (npc->_velocity).x, fVar8 = sqrtf(fVar10 * fVar10 + fVar8 * fVar8), fVar8 < 3.0 && (npc->_stateFrame < 0)))) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_stateFrame = 0; } pVVar2 = Vector::Normalized(&local_70,&local_68); fVar8 = npc->_friction; fVar10 = pVVar2->x; if (fVar8 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).y = (fVar11 * local_60.y * pVVar2->y) / fVar8 + (npc->_velocity).y; (npc->_velocity).x = (fVar11 * local_60.y * fVar10) / fVar8 + (npc->_velocity).x; } } else { PathFinder::FindGridPath ((PathFinder *)&npc->_pathfinder,&g_vectorZero,local_60.y * 0.8,0,1); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; if (-1 < npc->_stateFrame) { pVVar2 = Entity_NPC::GetControllerInput(npc,&local_60,0.1); bVar1 = Vector::operator_eq(pVVar2,&g_vectorZero); if (bVar1 == 0) goto LAB_0052abdf; } (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_stateFrame = 0; } LAB_0052abdf: (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } } } else { Entity_NPC::CalcTargetPosition(npc,&local_58,0.0); local_68.y = local_58.y - (npc->_pos).y; local_60.y = local_58.x - (npc->_pos).x; fVar8 = sqrtf(local_68.y * local_68.y + local_60.y * local_60.y); if (fVar8 <= 0.0) { pVVar2 = MusicManager::RandomVector(&local_70); local_58.x = pVVar2->x * 10.0; local_60.y = pVVar2->y; } else { local_60.y = local_60.y / fVar8; local_58.x = -((local_68.y / fVar8) * 10.0); } local_58.y = local_60.y * 10.0; local_68.y = local_58.x; local_60.y = local_58.y; uVar3 = Random(); local_78.x = local_68.y + (npc->_pos).x; local_78.y = local_60.y + (npc->_pos).y; burstingSackOwner = Game::Spawn(g_game,0x55,0,&local_78,&local_58,(Entity *)npc,0,uVar3); uVar3 = Random(); local_58.x = g_vectorZero.x - local_68.y; local_58.y = g_vectorZero.y - local_60.y; local_70.x = (npc->_pos).x - local_68.y; local_70.y = (npc->_pos).y - local_60.y; secondSpider = Game::Spawn(g_game,0x55,0,&local_70,&local_58,(Entity *)npc,0,uVar3); flagsHigh = *(undefined4 *)((int)&burstingSackOwner->_flags + 4); *(uint *)&burstingSackOwner->_flags = (uint)burstingSackOwner->_flags & 0xfffffffb; *(undefined4 *)((int)&burstingSackOwner->_flags + 4) = flagsHigh; flagsHigh = *(undefined4 *)((int)&secondSpider->_flags + 4); *(uint *)&secondSpider->_flags = (uint)secondSpider->_flags & 0xfffffffb; *(undefined4 *)((int)&secondSpider->_flags + 4) = flagsHigh; } LAB_0052abef: npc->_friction = npc->_friction * 0.6; goto LAB_0052ac07; } iVar4 = npc->_type; if (((iVar4 != 0xd7) && (iVar4 != 0xfa)) && (iVar4 != 0x365)) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { animName = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pbVar6 = s_Jump; do { bVar1 = *animName; bVar9 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_0052a034: uVar3 = -(uint)bVar9 | 1; goto LAB_0052a039; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar9 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_0052a034; animName = animName + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0052a039: if (uVar3 == 0) { ANM2::Play(&npc->_sprite,(byte *)"InAir",0); } } (npc->_velocity).x = (npc->_v1).x; (npc->_velocity).y = (npc->_v1).y; fVar8 = npc->_speedMultiplier; fVar11 = fVar8 * 0.7 + (npc->_v2).y; (npc->_v2).y = fVar11; fVar10 = fVar8 * fVar11 + (npc->_posOffset).y; (npc->_posOffset).y = fVar10; if (-fVar11 * fVar8 < fVar10) { (npc->_posOffset).y = 0.0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_stateFrame = npc->_stateFrame + 1; npc->_state = 4; } goto LAB_0052ac07; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0052a20f: iVar4 = 5; collisionClass = 4; } else { bVar1 = AnimationState::IsEventTriggered(animState,s_Jump); if (bVar1 != 0) { fVar10 = ((npc->_targetPosition).y - (npc->_pos).y) * 0.08; fVar8 = ((npc->_targetPosition).x - (npc->_pos).x) * 0.08; (npc->_velocity).y = fVar10; (npc->_v1).y = fVar10; (npc->_velocity).x = fVar8; (npc->_v1).x = fVar8; (npc->_v2).y = -4.0; npc->_stateFrame = 0; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0052a20f; bVar1 = AnimationState::WasEventTriggered(animState,s_Jump); if (bVar1 != 0) { fVar8 = npc->_speedMultiplier; fVar10 = fVar8 * 0.7 + (npc->_v2).y; (npc->_v2).y = fVar10; (npc->_posOffset).y = fVar8 * fVar10 + (npc->_posOffset).y; } if ((((npc->_sprite)._animState._animData == (void *)0x0) || (bVar1 = AnimationState::WasEventTriggered(animState,s_Jump), bVar1 == 0)) || (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar1 = AnimationState::WasEventTriggered(animState,s_Land), bVar1 != 0)))) goto LAB_0052a20f; collisionClass = 0; (npc->_velocity).x = (npc->_v1).x; (npc->_velocity).y = (npc->_v1).y; iVar4 = 3; } npc->_entityCollisionClass = collisionClass; npc->_entityGridCollisionClass = iVar4; if ((((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::WasEventTriggered(animState,s_Land), bVar1 != 0)) && (-(npc->_v2).y * npc->_speedMultiplier < (npc->_posOffset).y)) { (npc->_posOffset).y = 0.0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_stateFrame = npc->_stateFrame + 1; } if (((((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) && (npc->_friction = npc->_friction * 0.8, (npc->_sprite)._animState._animData != (void *)0x0)) && ((npc->_sprite)._animState._isPlaying == 0)) { animName = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pbVar6 = s_Jump; do { bVar1 = *animName; bVar9 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_0052a320: uVar3 = -(uint)bVar9 | 1; goto LAB_0052a325; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar9 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_0052a320; animName = animName + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0052a325: if (uVar3 == 0) { npc->_state = 4; } } LAB_0052ac07: if (npc->_dead != 0) { if (npc->_type == 0xfa) { if ((npc->_flags & 0x1000000) == 0) { pVVar2 = &npc->_pos; Game::BombDamage(g_game,pVVar2,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); Game::spawn_bomb_crater(g_game,pVVar2,(Entity *)0x0,1.0); uVar3 = Random(); Game::Spawn(g_game,1000,1,pVVar2,&g_vectorZero,(Entity *)0x0,0,uVar3); } } else if (npc->_type == 0x365) { timer = Entity_Effect::CreateTimer(NpcHelper::migraine_timer_spawn,4,3,0); iVar4 = *(int *)timer; (timer->_pos).x = (npc->_pos).x; (timer->_pos).y = (npc->_pos).y; (**(code **)(iVar4 + 0xc))(); } } ExceptionList = local_1c; return; } //@@ 0052ae30 NpcAI::ENTITY_BABY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 38 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BABY(Entity_NPC *npc) { void *pvVar1; byte bVar2; int iVar3; uint uVar4; Vector *tmpVec; int3 extraout_var; byte *curAnimNameChar; Entity *playerTarget; byte *pbVar5; ProjectileParams **ppPVar6; Vector *pVVar7; int extraout_ECX; float *extraout_ECX_00; byte *targetAnimNameChar; Vector *extraout_ECX_01; int gridX; bool bVar8; float fVar9; float fVar10; float avoidY; undefined1 *rotation; float avoidX; float fVar11; float fVar12; float fVar13; Vector aimPos; undefined1 local_10c [12]; float local_100; Vector local_fc; int frameDelta; Vector local_f0; float local_e8; float local_e4; ProjectileParams *local_e0; ProjectileParams *local_dc; float local_d8; float local_d4; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; Room *room; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af4670; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; ExceptionList = &local_1c; if ((npc->_type == 0x26) && (npc->_variant == 3)) { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ENTITY_WRINKLY_BABY(npc); ExceptionList = local_1c; return; } if (npc->_state == 0) { puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,&DAT_00b1d6fc,0); npc->_state = 4; ExceptionList = local_1c; return; } pVVar7 = &npc->_pos; frameDelta = (int)npc->_updateTime - (int)npc->_prevUpdateTime; gridX = (int)((pVVar7->x - 40.0) / 40.0 + 0.5); pvVar1 = g_game->_room; iVar3 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if (((((-1 < gridX) && (gridX < *(int *)((int)pvVar1 + 0xc))) && (-1 < iVar3)) && ((iVar3 < *(int *)((int)pvVar1 + 0x10) && (uVar4 = iVar3 * *(int *)((int)pvVar1 + 0xc) + gridX, uVar4 < 0x1c0)))) && (*(int *)((int)pvVar1 + uVar4 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)pvVar1 + uVar4 * 4 + 0x76c) = 900; } npc->_friction = npc->_friction * 0.7; Entity_NPC::CalcTargetPosition(npc,&local_f0,0.0); local_e8 = local_f0.x - pVVar7->x; local_e4 = local_f0.y - (npc->_pos).y; local_fc.x = local_e8; local_fc.y = local_e4; if (npc->_controllerID != -1) { tmpVec = Entity_NPC::GetControllerInput(npc,(Vector *)(local_10c + 8),0.0); local_e8 = tmpVec->x * 100.0; local_e4 = tmpVec->y * 100.0; local_fc.x = local_e8; local_fc.y = local_e4; } iVar3 = npc->_state; rotation = &DAT_bf800000; local_fc.x = local_e8; local_fc.y = local_e4; if (iVar3 == 4) { npc->_entityCollisionClass = 4; if (npc->_type == 0x103) { uVar4 = Random(); manager = g_manager; if (uVar4 % 0x5a == 0) { local_d8 = 1.5078e-42; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,0x3c,0,1.0,0.0); } if (npc->_projectileDelay < 1) { if (npc->_controllerID == -1) { uVar4 = Random(); if (uVar4 % 0x14 != 0) goto LAB_0052b128; playerTarget = Entity_NPC::GetPlayerTarget(npc); bVar2 = Entity::IsHostileTo((Entity *)npc,playerTarget); } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if (bVar2 != 0) { npc->_state = 8; if (npc->_controllerID == -1) { uVar4 = Random(); iVar3 = uVar4 % 0x1e + 0x14; } else { iVar3 = 0x32; } npc->_projectileCooldown = iVar3; Entity_NPC::SpawnControlTarget(npc,0,-1.0); } } LAB_0052b128: if (0 < npc->_projectileDelay) { npc->_projectileDelay = npc->_projectileDelay - frameDelta; } } else { uVar4 = Random(); if (uVar4 % 10 == 0) { uVar4 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2); } if ((npc->_projectileCooldown < 1) && (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,200.0,0,7), bVar2 != 0)) { npc->_projectileCooldown = 0x23; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::UpdateControllerMovement(npc,1); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { Entity_NPC::UpdateControllerMovement(npc,0); Entity_NPC::PlaySound(npc,0x2c,0.85,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = -0.05; projParams.VelocityMulti = 1.07; if (npc->_variant == 2) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; projParams.Scale = 1.5; LAB_0052b276: local_d4 = 0.0; } else { if ((npc->_variant != 1) || (npc->_subtype == 1)) goto LAB_0052b276; local_d4 = 2.8026e-45; } bVar2 = Game::IsHardMode(); if ((CONCAT31(extraout_var,bVar2) == 0 || extraout_var < 0) || (extraout_ECX != 0)) { local_d8 = 8.0; } else { local_d8 = 10.0; } playerTarget = Entity_NPC::GetPlayerTarget(npc); local_f0.x = (playerTarget->_pos).x - (npc->_pos).x; local_f0.y = (playerTarget->_pos).y - (npc->_pos).y; if ((npc->_controllerID != -1) && (bVar2 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar2 != 0)) { local_f0.x = *extraout_ECX_00; local_f0.y = extraout_ECX_00[1]; } Vector::Normalize(&local_f0); local_f0.x = local_f0.x * local_d8; local_f0.y = local_f0.y * local_d8; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_f0,(uint)local_d4,&projParams); } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - frameDelta; } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { curAnimNameChar = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnimNameChar = *(byte **)pbVar5; } targetAnimNameChar = &DAT_00b1d6fc; do { bVar2 = *curAnimNameChar; bVar8 = bVar2 < *targetAnimNameChar; if (bVar2 != *targetAnimNameChar) { LAB_0052b3d0: uVar4 = -(uint)bVar8 | 1; goto LAB_0052b3d5; } if (bVar2 == 0) break; bVar2 = curAnimNameChar[1]; bVar8 = bVar2 < targetAnimNameChar[1]; if (bVar2 != targetAnimNameChar[1]) goto LAB_0052b3d0; curAnimNameChar = curAnimNameChar + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0052b3d5: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0052b40c; } bVar2 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d6fc,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0052b40c: if (0.0 < npc->_pendingDamage) { (npc->_v1).x = 20.0; } if (((ABS(local_e8) < 20.0) || (ABS(local_e4) < 20.0)) && (fVar9 = sqrtf(local_e4 * local_e4 + local_e8 * local_e8), fVar9 < 400.0)) { (npc->_v1).x = (npc->_v1).x + 1.0; } uVar4 = Random(); iVar3 = npc->_controllerID; fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.1 + (npc->_v1).x; (npc->_v1).x = fVar9; if (iVar3 == -1) { if (20.0 < fVar9) { fVar9 = 0.0; LAB_0052b56c: do { if ((((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) || (local_d4 = (float)((int)fVar9 + 1), 1 < (int)fVar9)) break; uVar4 = Random(); local_d8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d8 = local_d8 + local_d8; uVar4 = Random(); local_e0 = (ProjectileParams *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 250.0 + 60.0); fVar9 = cos(local_d8); local_dc = (ProjectileParams *)(fVar9 * (float)local_e0 + (npc->_pos).x); fVar9 = sin(local_d8); local_e0 = (ProjectileParams *)(fVar9 * (float)local_e0 + (npc->_pos).y); playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar11 = (playerTarget->_pos).x - (float)local_dc; fVar9 = (playerTarget->_pos).y - (float)local_e0; if (npc->_variant == 1) { fVar9 = sqrtf(fVar9 * fVar9 + fVar11 * fVar11); if ((50.0 < fVar9) && (fVar9 < 120.0)) goto LAB_0052b723; } else if ((20.0 < ABS(fVar11)) && ((20.0 < ABS(fVar9) && (fVar9 = sqrtf(fVar9 * fVar9 + fVar11 * fVar11), 200.0 < fVar9)))) goto LAB_0052b723; fVar9 = local_d4; } while( true ); } fVar9 = 0.1; if ((40.0 < (npc->_v1).x) && (bVar2 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero), bVar2 != 0)) { npc->_state = 6; npc->_stateFrame = 0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Vanish",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_shadowSize = 0.0; if (npc->_type == 0x103) { local_dc = (ProjectileParams *)0x436; goto LAB_0052b8bd; } goto LAB_0052bd03; } } else { bVar2 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar2 == 0) goto LAB_0052bd03; npc->_state = 6; npc->_stateFrame = 0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Vanish",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } fVar9 = 0.1; npc->_shadowSize = 0.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; } } else { if (iVar3 == 6) { if ((npc->_controllerID != -1) && (bVar2 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero), bVar2 != 0)) { Entity_NPC::SpawnControlTarget(npc,2,(float)rotation); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,4.0,0,1); (npc->_targetPosition).x = pVVar7->x; (npc->_targetPosition).y = (npc->_pos).y; } pVVar7 = &npc->_targetPosition; npc->_entityCollisionClass = 0; if (0x18 < npc->_stateFrame) { bVar2 = Vector::operator_ne(pVVar7,&g_vectorZero); pVVar7 = extraout_ECX_01; if (bVar2 != 0) { npc->_shadowSize = *(float *)((int)npc->_config + 0x24); bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Vanish2",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_stateFrame = 0; (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; (npc->_v1).x = 0.0; Entity_NPC::ClearChild(npc); if (npc->_type != 0x103) goto LAB_0052bd03; local_dc = (ProjectileParams *)0x437; LAB_0052b8bd: manager = g_manager; seed_fart_sound_override((int *)&local_dc); SoundEffects::Play(&manager->_sfxManager,(int)local_dc,1.0,2,0,1.0,0.0); goto LAB_0052bd03; } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar2 = Vector::operator_eq(pVVar7,&g_vectorZero); fVar9 = 0.1; if (bVar2 != 0) { npc->_state = 4; } goto LAB_0052bd11; } } else if (iVar3 == 8) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); local_e0 = (ProjectileParams *)0x0; if (0 < frameDelta) { do { if (npc->_projectileCooldown < 1) { npc->_state = 4; npc->_projectileDelay = 0x1e; break; } iVar3 = npc->_projectileCooldown + -1; npc->_projectileCooldown = iVar3; if (iVar3 % 10 == 0) { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } playerTarget = Entity_NPC::GetPlayerTarget(npc); local_d4 = (playerTarget->_pos).x; local_d8 = (playerTarget->_pos).y; playerTarget = Entity_NPC::GetPlayerTarget(npc); pVVar7 = &npc->_pos; local_d4 = local_d4 + (playerTarget->_velocity).x * 5.0; local_d8 = local_d8 + (playerTarget->_velocity).y * 5.0; if (npc->_controllerID != -1) { pvVar1 = npc->_aimTargetEffect; if (pvVar1 == (void *)0x0) { aimPos.x = pVVar7->x; tmpVec = &aimPos; aimPos.y = (npc->_pos).y; } else { local_f0.x = *(float *)((int)pvVar1 + 0x33c); tmpVec = &local_f0; local_f0.y = *(float *)((int)pvVar1 + 0x340); } local_d4 = tmpVec->x; local_d8 = tmpVec->y; } local_d4 = local_d4 - pVVar7->x; local_d8 = local_d8 - (npc->_pos).y; local_dc = ProjectileParams::ProjectileParams(&projParams); fVar9 = sqrtf(local_d4 * local_d4 + local_d8 * local_d8); if (fVar9 <= 0.0) { local_100 = local_d8; local_10c._8_4_ = local_d4; } else { local_100 = local_d8 * (1.0 / fVar9); local_10c._8_4_ = local_d4 * (1.0 / fVar9); } local_10c._8_4_ = (float)local_10c._8_4_ * 10.0; local_100 = local_100 * 10.0; Entity_NPC::FireProjectiles(npc,pVVar7,(Vector *)(local_10c + 8),0,local_dc); manager = g_manager; if (npc->_type == 0x103) { local_dc = (ProjectileParams *)0x435; seed_fart_sound_override((int *)&local_dc); SoundEffects::Play(&manager->_sfxManager,(int)local_dc,1.0,2,0,1.0,0.0); } } local_e0 = (ProjectileParams *)&local_e0->field_0x1; } while ((int)local_e0 < frameDelta); } } LAB_0052bd03: fVar9 = 0.1; } LAB_0052bd11: if ((npc->_type == 0x103) && (fVar11 = (npc->_v2).x, fVar11 < 0.0)) { local_e0 = (ProjectileParams *)0x0; local_dc = (ProjectileParams *)(npc->_speedMultiplier * fVar9 + fVar11); ppPVar6 = &local_dc; if (0.0 <= (float)local_dc) { ppPVar6 = &local_e0; } (npc->_v2).x = (float)*ppPVar6; } if (npc->_projectileCooldown < 1) { local_d4 = local_e4 * local_e4 + local_e8 * local_e8; fVar10 = sqrtf(local_d4); fVar9 = local_e4; fVar11 = local_e8; if (0.0 < fVar10) { fVar9 = local_e4 * (1.0 / fVar10); fVar11 = local_e8 * (1.0 / fVar10); } fVar10 = npc->_friction; if (fVar10 != 0.0) { fVar12 = npc->_speedMultiplier; (npc->_velocity).y = (fVar12 * fVar9 * 0.33) / fVar10 + (npc->_velocity).y; (npc->_velocity).x = (fVar12 * fVar11 * 0.33) / fVar10 + (npc->_velocity).x; } if (npc->_type != 0x103) goto LAB_0052c2c4; if (npc->_controllerID == -1) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_10c,&npc->_pos, 100.0,4); local_14 = 0.0; if (local_100 != 0.0) { fVar9 = 0.0; local_dc = (ProjectileParams *)g_vectorZero.x; local_e0 = (ProjectileParams *)g_vectorZero.y; local_e4 = 0.0; if (local_d4 <= 0.0) { local_d4 = 0.0; } if (10000.0 <= local_d4) { local_d4 = 10000.0; } local_d4 = local_d4 / 10000.0; fVar11 = local_100; avoidX = g_vectorZero.x; avoidY = g_vectorZero.y; if (local_100 != 0.0) { do { iVar3 = *(int *)(local_10c._4_4_ + (int)fVar9 * 4); fVar13 = (npc->_pos).x - *(float *)(iVar3 + 0x33c); fVar12 = (npc->_pos).y - *(float *)(iVar3 + 0x340); local_d8 = *(float *)(iVar3 + 0x364); fVar10 = *(float *)(iVar3 + 0x360); if (0.0 < fVar13 * fVar10 + fVar12 * local_d8) { local_f0.y = 1.0 - (fVar12 * fVar12 + fVar13 * fVar13) / 10000.0; local_e8 = -fVar10; if (fVar12 * -fVar10 + fVar13 * local_d8 < 0.0) { local_d8 = -local_d8; local_e8 = fVar10; } uVar4 = Random(); local_fc.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar11 = sqrtf(local_d8 * local_d8 + local_e8 * local_e8); if (fVar11 <= 0.0) { fVar10 = local_e8; fVar11 = local_d8; } else { fVar11 = ((local_fc.y + local_fc.y + 2.0) * local_f0.y * local_d4) / fVar11; fVar10 = local_e8 * fVar11; fVar11 = local_d8 * fVar11; } avoidX = fVar11 + (float)local_dc; avoidY = fVar10 + (float)local_e0; local_e4 = (float)((int)local_e4 + 1); fVar11 = local_100; local_e0 = (ProjectileParams *)avoidY; local_dc = (ProjectileParams *)avoidX; } fVar9 = (float)((int)fVar9 + 1); } while ((uint)fVar9 < (uint)fVar11); if (0 < (int)local_e4) { fVar9 = npc->_speedMultiplier; (npc->_velocity).x = (avoidX / (float)(int)local_e4) * fVar9 + (npc->_velocity).x; (npc->_velocity).y = (avoidY / (float)(int)local_e4) * fVar9 + (npc->_velocity).y; } } } if (local_10c[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_10c._4_4_,0); } goto LAB_0052c2c4; } bVar2 = Entity_NPC::IsControllerActionPressed(npc,8); fVar9 = (npc->_v2).x; if (bVar2 == 0) { if (0.0 < fVar9) { (npc->_v2).x = (float)&DAT_bf800000; } goto LAB_0052c2c4; } if (fVar9 < 0.0) goto LAB_0052c2c4; local_e0 = (ProjectileParams *)npc->_speedMultiplier; local_dc = (ProjectileParams *)((float)local_e0 * 0.05 + fVar9); if (1.0 <= (float)local_dc) { local_dc = (ProjectileParams *)0x3f800000; } (npc->_v2).x = (float)local_dc; pVVar7 = Vector::Normalized(&local_fc,(Vector *)(local_10c + 8)); fVar9 = npc->_friction; if (fVar9 == 0.0) goto LAB_0052c2c4; fVar11 = ((float)local_e0 * pVVar7->y * 1.6 * (1.0 - (float)local_dc)) / fVar9; fVar9 = ((float)local_e0 * pVVar7->x * 1.6 * (1.0 - (float)local_dc)) / fVar9; } else { if (npc->_controllerID == -1) goto LAB_0052c2c4; fVar9 = sqrtf(local_e4 * local_e4 + local_e8 * local_e8); if (0.0 < fVar9) { local_e4 = local_e4 * (1.0 / fVar9); local_e8 = local_e8 * (1.0 / fVar9); } fVar9 = npc->_friction; if (fVar9 == 0.0) goto LAB_0052c2c4; fVar11 = (npc->_speedMultiplier * local_e4 * 0.1) / fVar9; fVar9 = (npc->_speedMultiplier * local_e8 * 0.1) / fVar9; } (npc->_velocity).y = fVar11 + (npc->_velocity).y; (npc->_velocity).x = fVar9 + (npc->_velocity).x; LAB_0052c2c4: npc->_stateFrame = npc->_stateFrame + frameDelta; ExceptionList = local_1c; return; LAB_0052b723: room = g_game->_room; local_d8 = (float)(int)(((float)local_dc - 40.0) / 40.0 + 0.5); iVar3 = (int)(((float)local_e0 - 120.0) / 40.0 + 0.5); if ((-1 < (int)local_d8) && ((((int)local_d8 < room->_gridWidth && (-1 < iVar3)) && (iVar3 < room->_gridHeight)))) { local_dc = (ProjectileParams *)(room->_gridWidth * iVar3); pbVar5 = &((ProjectileParams *)(&local_dc->Color + -1))->GridCollision + (int)local_d8; fVar9 = local_d4; if (((int)pbVar5 < 0) || (((int)pbVar5 < 0x1c0 && (499 < (int)room->_gridEntities[(int)(&local_dc->Color + 9) + 0x1a + (int)local_d8])))) goto LAB_0052b56c; uVar4 = Room::GetGridCollision(room,(int)pbVar5); fVar9 = local_d4; if (uVar4 != 0) goto LAB_0052b56c; iVar3 = room->_gridWidth; pbVar5 = &((ProjectileParams *)(&local_dc->Color + -1))->GridCollision + (int)local_d8; (npc->_targetPosition).x = (float)((int)pbVar5 % iVar3) * 40.0 + 40.0; (npc->_targetPosition).y = (float)((int)pbVar5 / iVar3) * 40.0 + 120.0; } fVar9 = local_d4; goto LAB_0052b56c; } //@@ 0052c2f0 NpcAI::ENTITY_VIS_chubber_projectile /* DB: called from NpcAI::ENTITY_VIS when npc->_variant==0x16 (Chubber projectile); atan2f/normalize_angle_degrees aiming, IsPositionInRoom, ANM2::Play */ void __fastcall NpcAI::ENTITY_VIS_chubber_projectile(Entity_NPC *npc) { byte isInRoom; EntityRef *sourceRef; LayerState *layer; int framesLeft; int iVar1; float fVar2; float fVar3; float fVar4; EntityRef nullSource; float speedScale; float toParentX; float local_14; EntityPtr parent; if (npc->_state == 0) { (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; npc->_state = 4; npc->_stateFrame = 0; npc->_health = 0.0; npc->_maxHitPoints = 0.0; npc->_entityGridCollisionClass = 0; npc->_canShutDoors = 0; return; } if (npc->_subtype == 1) { (npc->_velocity).x = (npc->_v1).x; (npc->_velocity).y = (npc->_v1).y; isInRoom = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-80.0); if (isInRoom == 0) { (**(code **)(*(int *)npc + 0x28))(); } } else { iVar1 = npc->_stateFrame; parent = npc->_parent; speedScale = 1.0 - (float)iVar1 / 21.0; if ((parent == (EntityPtr)0x0) || (0.0 <= speedScale)) { fVar3 = speedScale * (npc->_v1).x; fVar2 = speedScale * (npc->_v1).y; } else { local_14 = *(float *)((int)parent + 0x340) - (npc->_pos).y; toParentX = *(float *)((int)parent + 0x33c) - (npc->_pos).x; fVar2 = sqrtf(local_14 * local_14 + toParentX * toParentX); if (fVar2 <= 0.0) { fVar3 = local_14; fVar4 = toParentX; } else { fVar2 = (fVar2 - 20.0) / fVar2; fVar3 = fVar2 * local_14; fVar4 = toParentX * fVar2; } iVar1 = 0x2b - iVar1; framesLeft = 1; if (1 < iVar1) { framesLeft = iVar1; } fVar2 = (fVar3 / (float)framesLeft) * -speedScale; fVar3 = (fVar4 / (float)framesLeft) * -speedScale; } (npc->_velocity).x = fVar3; (npc->_velocity).y = fVar2; if (npc->_parent == (EntityPtr)0x0) { sourceRef = EntityRef::EntityRef(&nullSource); (**(code **)(*(int *)npc + 0x24))(sourceRef); return; } iVar1 = npc->_stateFrame; if (0x2a < iVar1) { (**(code **)(*(int *)npc + 0x28))(); iVar1 = npc->_stateFrame; } npc->_stateFrame = iVar1 + 1; } fVar2 = (npc->_velocity).x; fVar3 = (npc->_velocity).y; if (ABS(fVar2) <= ABS(fVar3)) { iVar1 = (uint)(0.0 <= fVar3) * 2 + 1; } else { iVar1 = 2; if (fVar2 < 0.0) { iVar1 = 0; } } local_14 = (float)iVar1; if (0.001 <= fVar3 * fVar3 + fVar2 * fVar2) { (npc->_sprite)._flipX = iVar1 == 0; switch(iVar1) { default: ANM2::Play(&npc->_sprite,&DAT_00b60fe4,0); break; case 1: ANM2::Play(&npc->_sprite,(byte *)&DAT_00b1cde4,0); break; case 3: ANM2::Play(&npc->_sprite,&DAT_00b1cddc,0); } } else { fVar2 = (npc->_v1).x; fVar3 = (npc->_v1).y; if (ABS(fVar2) <= ABS(fVar3)) { (npc->_sprite)._flipX = 0; if (0.0 <= fVar3) { ANM2::Play(&npc->_sprite,&DAT_00b1cddc,0); iVar1 = 3; } else { ANM2::Play(&npc->_sprite,(byte *)&DAT_00b1cde4,0); iVar1 = 1; } } else if (0.0 <= fVar2) { (npc->_sprite)._flipX = 0; ANM2::Play(&npc->_sprite,&DAT_00b60fe4,0); iVar1 = 2; } else { (npc->_sprite)._flipX = 1; ANM2::Play(&npc->_sprite,&DAT_00b60fe4,0); iVar1 = 0; } } if (npc->_subtype == 0) { return; } fVar2 = (npc->_v1).x; fVar3 = (npc->_v1).y; fVar4 = fVar3 * (npc->_velocity).y + fVar2 * (npc->_velocity).x; local_14 = atan2f(fVar3 * fVar4,fVar2 * fVar4); local_14 = local_14 * 57.295776; fVar2 = local_14; switch(iVar1) { case 0: fVar2 = 180.0 - local_14; goto LAB_0052c6d2; case 1: fVar2 = local_14 + 90.0; break; case 3: fVar2 = local_14 - 90.0; } LAB_0052c6d2: local_14 = normalize_angle_degrees(fVar2); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = local_14; return; } //@@ 0052c720 NpcAI::ENTITY_VIS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 39 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_VIS(Entity_NPC *npc) { float fVar1; float fVar2; undefined4 uVar3; undefined1 *puVar4; byte bVar5; LayerState *layer; ColorMod *tmpColor; EntityConfig_Entity *effectConfig; Entity *pEVar6; uint uVar7; Vector *vec; int3 extraout_var; ProjectileParams *params; EntityPtr EVar8; Entity_Laser *laser; Vector *pVVar9; byte extraout_CL; byte extraout_CL_00; byte unused; void *pvVar10; ProjectileParams *params_00; float *extraout_ECX; uint uVar11; Manager *manager; EntityConfig *entityConfig; float fVar12; float fVar13; int iVar14; undefined4 uVar15; TypeDescriptor *pTVar16; char *pcVar17; Entity_NPC *source; TypeDescriptor *pTVar18; undefined4 uVar19; Vector local_140; float aimX; Vector local_134; float local_12c; EntityPtr *local_128; Vector local_124; EntityPtr local_11c; Vector scratchVec; ProjectileParams projParams; undefined1 splatColorParams [20]; void *tmpString; char local_50 [12]; uint tmpStringSize; uint tmpStringCapacity; void *walkAnim; int local_38; char local_34; undefined1 local_30 [4]; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; float *dirY; Game *game; Room *room; EntityPtr *targetSlot; pvVar10 = ExceptionList; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00af46bd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_30 + 0x20); ExceptionList = &local_1c; if (npc->_variant == 0x16) { puStack_20 = local_30 + 0x2c; ENTITY_VIS_chubber_projectile(npc); ExceptionList = local_1c; return; } if (npc->_state == 0) { npc->_state = 4; manager = g_manager; if (npc->_spawnerType != 0x109) { puStack_20 = local_30 + 0x2c; effectConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,1000,0x32,1); if (effectConfig != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(&manager->_entityConfig,effectConfig); manager = g_manager; } local_11c = (EntityPtr)0x700100; entityConfig = &manager->_entityConfig; _Find_lower_bound<>(local_30,&local_11c); if (((*(char *)((int)local_2c.y + 0xd) == '\0') && (*(uint *)((int)local_2c.y + 0x10) < 0x700101)) && ((void *)local_2c.y != (entityConfig->_entities)._head)) { effectConfig = (EntityConfig_Entity *)((int)local_2c.y + 0x18); } else { effectConfig = EntityConfig::GetEntity(entityConfig,7,0,0); } if (effectConfig == (EntityConfig_Entity *)0x0) { ExceptionList = local_1c; return; } EntityConfig::PreloadResources(entityConfig,effectConfig); ExceptionList = local_1c; return; } if (npc->_type != 0x27) { ExceptionList = pvVar10; return; } if (npc->_variant != 0) { ExceptionList = pvVar10; return; } puStack_20 = local_30 + 0x2c; tmpString = std::_Allocate(0x30); tmpStringSize = 0x2c; tmpStringCapacity = 0x2f; builtin_strncpy(tmpString,"gfx/Monsters/Classic/Monster_176_CageVis.png",0x2d); local_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,1,(std_string *)&tmpString); local_14 = 0xffffffff; bVar5 = extraout_CL; if (0xf < tmpStringCapacity) { uVar11 = tmpStringCapacity + 1; pcVar17 = tmpString; if (0xfff < uVar11) { pcVar17 = *(char **)((int)tmpString + -4); uVar11 = tmpStringCapacity + 0x24; if ((char *)0x1f < (char *)((int)tmpString + (-4 - (int)pcVar17))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar17,uVar11); bVar5 = extraout_CL_00; } ANM2::LoadGraphics(&npc->_sprite,bVar5); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[0] = 0.47058827; (layer->_color)._tint[1] = 0.50980395; (layer->_color)._tint[2] = 0.50980395; (layer->_color)._tint[3] = 1.0; tmpColor = ColorParams::set_from_bytes ((ColorParams *)splatColorParams,10,0x50,10,0xff,100,100,0x50); Color::operator_assign((Color *)&npc->_splatColor,tmpColor); manager = g_manager; effectConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,1000,0x32,2); if (effectConfig != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(&manager->_entityConfig,effectConfig); } TextureCache::Preload("gfx/Effects/Effect_018_CageLaserEffects.png"); ExceptionList = local_1c; return; } puVar4 = local_30 + 0x2c; if (npc->_controllerID == -1) { room = g_game->_room; uVar11 = Room::GetGridIndex(room,&npc->_pos); puVar4 = puStack_20; if ((uVar11 < 0x1c0) && (room->_gridPaths[uVar11] < 0x3b7)) { room->_gridPaths[uVar11] = 900; } } puStack_20 = puVar4; pEVar6 = Entity_NPC::GetPlayerTarget(npc); pVVar9 = &npc->_pos; local_11c = (EntityPtr)((pEVar6->_pos).x - pVVar9->x); local_12c = (pEVar6->_pos).y - (npc->_pos).y; iVar14 = npc->_state; scratchVec.x = (float)local_11c; scratchVec.y = local_12c; if (iVar14 == 4) { tmpStringCapacity = 0xf; tmpStringSize = 8; tmpString = (void *)0x6b6c6157; builtin_strncpy(local_50,"Hori",5); local_2c.y = 2.10195e-44; local_2c.x = 1.12104e-44; walkAnim = (void *)0x6b6c6157; local_38._0_1_ = 'H'; local_38._1_1_ = 'o'; local_38._2_1_ = 'r'; local_38._3_1_ = 'i'; local_34 = '\0'; local_14 = 2; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnim,(std_string *)&tmpString,0.1); local_14 = CONCAT31(local_14._1_3_,1); if ((void *)0xf < (uint)local_2c.y) { uVar11 = (int)local_2c.y + 1; pvVar10 = walkAnim; if (0xfff < uVar11) { pvVar10 = *(void **)((int)walkAnim + -4); uVar11 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)walkAnim + (-4 - (int)pvVar10))) goto LAB_0052cad0; } operator_delete(pvVar10,uVar11); } local_14 = 0xffffffff; local_2c.x = 0.0; local_2c.y = 2.10195e-44; walkAnim = (void *)((uint)walkAnim & 0xffffff00); if (0xf < tmpStringCapacity) { uVar11 = tmpStringCapacity + 1; pvVar10 = tmpString; if (0xfff < uVar11) { pvVar10 = *(void **)((int)tmpString + -4); uVar11 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar10))) { LAB_0052cad0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar11); } if (npc->_controllerID == -1) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.7,0); } else { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,0.7,0,1); } iVar14 = npc->_controllerID; if ((iVar14 != -1) || (bVar5 = Entity::IsFrame((Entity *)npc,3,npc->_index), bVar5 != 0)) { if (npc->_type == 0x31) { if (iVar14 == -1) { uVar11 = Random(); uVar7 = Random(); if (uVar7 % 7 == 0) { local_128 = (EntityPtr *) sqrtf((float)local_11c * (float)local_11c + local_12c * local_12c); uVar11 = Random(); if ((float)local_128 < (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 130.0 + 70.0) goto LAB_0052cbe2; } else if (uVar11 % 10 != 0) goto LAB_0052d8a5; } else { bVar5 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar5 != 0) { LAB_0052cbe2: npc->_state = 8; npc->_stateFrame = 0; goto LAB_0052d8a5; } } } bVar5 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar5 == 0) { if (npc->_controllerID == -1) { if (((20.0 <= ABS((float)local_11c)) && (20.0 <= ABS(local_12c))) || (fVar13 = sqrtf(local_12c * local_12c + (float)local_11c * (float)local_11c), 400.0 <= fVar13)) goto LAB_0052d8a5; bVar5 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&npc->_pos); } else { bVar5 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if (bVar5 != 0) { if (npc->_controllerID == -1) { vec = &scratchVec; pVVar9 = &local_124; } else { vec = Entity_NPC::GetControllerMovementInput(npc,&local_134,0.0); pVVar9 = &local_140; } pVVar9 = Vector::ToCardinal(pVVar9,vec); (npc->_v1).x = pVVar9->x; (npc->_v1).y = pVVar9->y; iVar14 = npc->_variant; npc->_state = (iVar14 == 2) + 9; if (iVar14 != 2) { if (npc->_type == 0x344) { Game::GetStageID(g_game,(byte)iVar14); } tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = 0.0; scratchVec.y = -20.0; Entity::SpawnFollowingEffect198((Entity *)npc,&scratchVec,&npc->_v1,0x1c,tmpColor,4.0); uVar11 = 0x80000000; if (npc->_type == 0x27) { if ((npc->_variant == 1) || (npc->_variant == 3)) { LAB_0052ce0e: tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = (float)((uint)(npc->_v1).x ^ uVar11); scratchVec.y = (float)((uint)(npc->_v1).y ^ uVar11); local_124.x = 0.0; local_124.y = -20.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_124,&scratchVec,0x1c,tmpColor,4.0); if (npc->_type != 0x27) goto LAB_0052cfa4; } uVar11 = 0x80000000; if (npc->_variant == 3) { tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = (float)((uint)(npc->_v1).y ^ uVar11); scratchVec.y = (npc->_v1).x; local_124.x = 0.0; local_124.y = -20.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_124,&scratchVec,0x1c,tmpColor,4.0); tmpColor = (ColorMod *)Color::Color(0x3f4ccccd); scratchVec.x = (npc->_v1).y; scratchVec.y = -(npc->_v1).x; local_124.x = 0.0; local_124.y = -20.0; Entity::SpawnFollowingEffect198 ((Entity *)npc,&local_124,&scratchVec,0x1c,tmpColor,4.0); } } else if ((npc->_type == 0x31) && (npc->_variant == 1)) goto LAB_0052ce0e; } LAB_0052cfa4: npc->_stateFrame = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; if (npc->_state == 10) { if (ABS((npc->_v1).x) <= 0.0) { dirY = &(npc->_v1).y; if (0.0 < *dirY || *dirY == 0.0) { pcVar17 = "Attack03Down"; } else { pcVar17 = "Attack03Up"; } goto LAB_0052d02b; } pcVar17 = "Attack03Horiz"; LAB_0052cffc: ANM2::Play(&npc->_sprite,(byte *)pcVar17,0); (npc->_sprite)._flipX = (npc->_v1).x <= 0.0 && (npc->_v1).x != 0.0; } else { sprintf_s(&DAT_00c7f778,0x40,(byte *)"Attack%02uUp"); sprintf_s(&DAT_00c7f7b8,0x40,(byte *)"Attack%02uDown"); sprintf_s(&DAT_00c7f7f8,0x40,(byte *)"Attack%02uHoriz"); if (0.0 < ABS((npc->_v1).x)) { pcVar17 = &DAT_00c7f7f8; goto LAB_0052cffc; } dirY = &(npc->_v1).y; if (0.0 < *dirY || *dirY == 0.0) { pcVar17 = &DAT_00c7f7b8; } else { pcVar17 = &DAT_00c7f778; } LAB_0052d02b: ANM2::Play(&npc->_sprite,(byte *)pcVar17,0); } if ((npc->_controllerID != -1) && ((npc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,8.0); } } } } } else if (iVar14 == 8) { ANM2::Play(&npc->_sprite,(byte *)"FatAttack",0); if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0052d893: npc->_state = 4; } else { bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar5 == 0) goto LAB_0052d884; ProjectileParams::ProjectileParams(&projParams); bVar5 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar5) == 0 || extraout_var < 0) { scratchVec.x = 8.0; } else { scratchVec.x = 12.0; } scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,pVVar9,&scratchVec,8,params_00); if (npc->_variant == 1) { params = ProjectileParams::ProjectileParams(&projParams); pEVar6 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar6->_pos).x; scratchVec.y = (pEVar6->_pos).y; Entity_NPC::FireBossProjectiles(npc,5,&scratchVec,0.0,params); } } } else if (iVar14 == 9) { if (npc->_type == 0x344) { if (npc->_controllerID == -1) { if ((5 < npc->_stateFrame) && (bVar5 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero), bVar5 != 0)) { local_11c = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); targetSlot = &npc->_target; fVar13 = *(float *)((int)local_11c + 0x340); (npc->_targetPosition).x = ((Vector *)((int)local_11c + 0x33c))->x; (npc->_targetPosition).y = fVar13; if (*targetSlot != (EntityPtr)0x0) { local_128 = targetSlot; std::multiset::erase(&local_128); } *targetSlot = local_11c; std::multiset::insert(targetSlot); } } else { Entity_NPC::SpawnControlTarget(npc,0,-1.0); bVar5 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero); if (bVar5 == 0) { fVar13 = npc->_speedMultiplier; fVar12 = 0.9; if (fVar13 != 1.0) { fVar12 = 0.9 / ((fVar13 + 0.9) - fVar13 * 0.9); } fVar12 = 1.0 - fVar12; pVVar9 = Entity_NPC::GetAimTargetPosition(npc,&local_134); fVar13 = (npc->_targetPosition).x; fVar1 = (npc->_targetPosition).y; fVar2 = pVVar9->x; (npc->_targetPosition).y = (pVVar9->y - fVar1) * fVar12 + fVar1; (npc->_targetPosition).x = (fVar2 - fVar13) * fVar12 + fVar13; } else { pVVar9 = Entity_NPC::GetAimTargetPosition(npc,&local_134); (npc->_targetPosition).x = pVVar9->x; (npc->_targetPosition).y = pVVar9->y; } } } bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar5 == 0) { LAB_0052d884: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0052d893; } else { fVar13 = (npc->_v1).y; if (-0.5 <= fVar13) { local_11c = (EntityPtr)0x453b8000; } else { local_11c = (EntityPtr)0xc1200000; } fVar12 = (npc->_v1).x; pVVar9 = &scratchVec; local_124.y = (npc->_pos).y + 0.0; bVar5 = 0; local_124.x = fVar12 * 6.0 + (npc->_pos).x; iVar14 = 0x20; scratchVec.x = 0.0; scratchVec.y = -20.0; source = npc; fVar13 = atan2f(fVar13,fVar12); EVar8 = (EntityPtr) Entity_Laser::ShootAngle (1,&local_124,fVar13 * 57.295776,iVar14,pVVar9,(Entity *)source,bVar5); *(EntityPtr *)((int)EVar8 + 0x358) = local_11c; if (npc->_type == 0x344) { if (npc->_child != (EntityPtr)0x0) { local_128 = &npc->_child; std::multiset::erase(&local_128); } npc->_child = EVar8; std::multiset::insert(&npc->_child); game = g_game; fVar13 = (npc->_targetPosition).y; ((Vector *)((int)EVar8 + 0x334))->x = (npc->_targetPosition).x; *(float *)((int)EVar8 + 0x338) = fVar13; uVar11 = Game::GetStageID(game,unused); if (uVar11 != 0x20) { (**(code **)(*(int *)EVar8 + 0x3c))(&DAT_00c34dd0,0xffffffff,0xff,0,1); } uVar3 = DAT_00c34b7c; uVar19 = DAT_00c34b78; uVar15 = DAT_00c34b74; *(undefined4 *)&((BitSet128 *)((int)EVar8 + 0x428))->_l = DAT_00c34b70; *(undefined4 *)((int)EVar8 + 0x42c) = uVar15; *(undefined4 *)((int)EVar8 + 0x430) = uVar19; *(undefined4 *)((int)EVar8 + 0x434) = uVar3; } (**(code **)(*(int *)EVar8 + 0xc))(); if (npc->_type == 0x27) { if ((npc->_variant == 1) || (npc->_variant == 3)) goto LAB_0052d4e8; } else { if ((npc->_type != 0x31) || (npc->_variant != 1)) goto LAB_0052d8a5; LAB_0052d4e8: local_128 = (EntityPtr *)((uint)(npc->_v1).x ^ 0x80000000); scratchVec.x = 0.0; scratchVec.y = -20.0; fVar13 = atan2f(-(npc->_v1).y,(float)local_128); local_124.y = (npc->_pos).y + 0.0; local_124.x = (float)local_128 * 6.0 + (npc->_pos).x; laser = Entity_Laser::ShootAngle (1,&local_124,fVar13 * 57.295776,0x20,&scratchVec,(Entity *)npc,0); dirY = &(npc->_v1).y; if (-0.5 < *dirY || *dirY == -0.5) { fVar13 = -10.0; } else { fVar13 = 3000.0; } laser->_renderDepthOffset = fVar13; (**(code **)(*(int *)laser + 0xc))(); if (npc->_type != 0x27) goto LAB_0052d8a5; } if (npc->_variant == 3) { scratchVec.x = 0.0; scratchVec.y = -20.0; fVar13 = atan2f(-(npc->_v1).x,(npc->_v1).y); local_124.x = (npc->_pos).x - (npc->_v1).y * 6.0; local_124.y = (npc->_pos).y + 0.0; laser = Entity_Laser::ShootAngle (1,&local_124,fVar13 * 57.295776,0x20,&scratchVec,(Entity *)npc,0); dirY = &(npc->_v1).y; if ((*dirY <= -0.5 && *dirY != -0.5) || (0.5 < (npc->_v1).x)) { fVar13 = -10.0; } else { fVar13 = 3000.0; } laser->_renderDepthOffset = fVar13; (**(code **)(*(int *)laser + 0xc))(); scratchVec.x = 0.0; scratchVec.y = -20.0; fVar13 = atan2f((npc->_v1).x,-(npc->_v1).y); local_124.y = (npc->_pos).y + 0.0; local_124.x = (npc->_v1).y * 6.0 + (npc->_pos).x; laser = Entity_Laser::ShootAngle (1,&local_124,fVar13 * 57.295776,0x20,&scratchVec,(Entity *)npc,0); dirY = &(npc->_v1).y; if ((*dirY <= -0.5 && *dirY != -0.5) || ((npc->_v1).x <= -0.5 && (npc->_v1).x != -0.5)) { laser->_renderDepthOffset = -10.0; (**(code **)(*(int *)laser + 0xc))(); } else { laser->_renderDepthOffset = 3000.0; (**(code **)(*(int *)laser + 0xc))(); } } } } else if (iVar14 == 10) { bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar5 == 0) goto LAB_0052d884; scratchVec.y = (npc->_v1).y * 16.0; scratchVec.x = (npc->_v1).x * 16.0 * 1.4; uVar11 = Random(); uVar19 = 0; pTVar18 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar16 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar15 = 0; pEVar6 = Game::Spawn(g_game,npc->_type,0x16,pVVar9,&scratchVec,(Entity *)npc,0,uVar11); pEVar6 = (Entity *)__RTDynamicCast(pEVar6,uVar15,pTVar16,pTVar18,uVar19); pEVar6[2]._posOffset.x = 0.0; Entity::SetParent(pEVar6,(Entity *)npc); if (ABS((npc->_v1).y) < ABS((npc->_v1).x)) { (pEVar6->_pos).x = (pEVar6->_pos).x + 0.0; (pEVar6->_pos).y = (pEVar6->_pos).y + 0.1; } (**(code **)(*(int *)pEVar6 + 0xc))(); } LAB_0052d8a5: fVar13 = 0.4; if (npc->_type != 0x344) goto LAB_0052db02; if (((npc->_child == (EntityPtr)0x0) || (*(int *)((int)npc->_child + 0x28) != 7)) && (npc->_state != 9)) { bVar5 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero); if (bVar5 != 0) { *extraout_ECX = g_vectorZero.x; extraout_ECX[1] = g_vectorZero.y; Entity::SetTarget((Entity *)npc,(Entity *)0x0); } goto LAB_0052db02; } EVar8 = npc->_target; if (EVar8 == (EntityPtr)0x0) { if (npc->_controllerID != -1) { iVar14 = npc->_controllerID; pVVar9 = Entity_NPC::GetAimTargetPosition(npc,&local_134); goto LAB_0052d935; } } else { iVar14 = npc->_controllerID; if (iVar14 == -1) { scratchVec.x = (float)*(EntityPtr *)((int)EVar8 + 0x33c); pVVar9 = &scratchVec; scratchVec.y = *(float *)((int)EVar8 + 0x340); } else { pVVar9 = Entity_NPC::GetAimTargetPosition(npc,&local_134); } LAB_0052d935: aimX = pVVar9->x; scratchVec.y = (npc->_targetPosition).x; local_124.y = pVVar9->y; local_140.y = (npc->_targetPosition).y; local_134.x = aimX - scratchVec.y; local_134.y = local_124.y - local_140.y; local_12c = 2.0; if (iVar14 != -1) { local_12c = fVar13; } local_140.y = local_140.y - (npc->_pos).y; local_140.x = scratchVec.y - (npc->_pos).x; local_128 = (EntityPtr *)local_134.y; local_11c = (EntityPtr)local_134.x; pVVar9 = Vector::Normalized(&local_140,&local_2c); fVar12 = (npc->_v1).y * pVVar9->y + pVVar9->x * (npc->_v1).x; fVar13 = local_12c; if (fVar12 < 0.0) { fVar13 = local_12c * (fVar12 + 1.0); } if (0.01 < (float)local_128 * (float)local_128 + (float)local_11c * (float)local_11c) { pVVar9 = Vector::Resized(&local_134,&local_2c,fVar13); (npc->_targetPosition).x = scratchVec.y + pVVar9->x; local_124.y = pVVar9->y + (npc->_targetPosition).y; } else { (npc->_targetPosition).x = aimX; } (npc->_targetPosition).y = local_124.y; } EVar8 = npc->_child; if ((EVar8 != (EntityPtr)0x0) && (*(int *)((int)EVar8 + 0x28) == 7)) { fVar13 = (npc->_targetPosition).y; *(float *)((int)EVar8 + 0x334) = (npc->_targetPosition).x; *(float *)((int)EVar8 + 0x338) = fVar13; } LAB_0052db02: npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_friction = npc->_friction * 0.8; ExceptionList = local_1c; return; } //@@ 0052db50 NpcAI::ENTITY_MAGGOT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 21 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MAGGOT(Entity_NPC *npc) { float *pfVar1; ANM2 *pAVar2; byte bVar3; uint uVar4; EntityRef *sourceRef; int3 extraout_var; undefined4 *puVar5; int iVar6; Vector *pVVar7; Entity *pEVar8; void *pvVar9; ProjectileParams *pPVar10; byte *animName; char *pcVar11; Entity_NPC *pEVar12; Vector *unitDir; Entity_Effect *splat; int *piVar13; ProjectileParams *params; uint uVar14; int unused; int extraout_ECX; code *extraout_EDX; int iVar15; uint uVar16; float fVar17; float fVar18; float fVar19; undefined1 frictionScale [12]; Room *pRVar20; Sprite *pSVar21; float fVar22; float fVar23; undefined1 *puVar24; char *pcVar25; undefined4 local_2a0 [11]; undefined4 local_274 [11]; char isChargerSubtype1; char *local_244; Room *local_240; float local_23c; byte local_236; char isDankCharger; Entity_NPC *local_234; char *local_230; uint animDir; ProjectileParams projParams; undefined1 local_17c [12]; float local_170; ProjectileParams burstParams; char *walkAnimNames [4]; RNG local_98; undefined4 *local_88; Vector local_84; byte *local_7c; Vector local_78; char *local_70; Vector local_6c; EntityList_EL local_64; char *local_54; Vector local_50; char *local_48; Vector local_44; char *local_3c; Vector local_38; char *local_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; Game *game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af4705; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_234 = npc; local_24 = uVar4; if (((npc->_type == 0x17) && (npc->_variant == 0)) && (npc->_subtype == 1)) { isChargerSubtype1 = '\x01'; puVar24 = (undefined1 *)((int)register0x00000010 + -4); } else { isChargerSubtype1 = '\0'; puVar24 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_type == 0x37) && (puVar24 = (undefined1 *)((int)register0x00000010 + -4), npc->_variant != 0)) { puVar24 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_controllerID != -1) { bVar3 = input_is_action_pressed(8,npc->_controllerID,(Entity *)npc,(int)npc); puVar24 = puStack_20; if (bVar3 != 0) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_17c + 4)); (*extraout_EDX)(sourceRef,uVar4); puVar24 = puStack_20; } } } } puStack_20 = puVar24; if (npc->_dead != 0) { if (npc->_type == 0x37) { if ((npc->_variant != 0) && ((npc->_flags & 0x1000000) == 0)) { Game::BombDamage(g_game,&npc->_pos,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); uVar4 = Random(); Game::Spawn(g_game,1000,1,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); } } else if (((npc->_type == 0x17) && (npc->_variant == 1)) && ((npc->_flags & 0x1000000) == 0)) { ProjectileParams::ProjectileParams(&projParams); bVar3 = Game::IsHardMode(); if (CONCAT31(extraout_var,bVar3) == 0 || extraout_var < 0) { local_2c.x = 8.0; } else { local_2c.x = 10.0; } local_2c.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_2c,7,params); } } if (((npc->_type == 0xed) && (npc->_isBoss != 0)) && ((npc->_subtype == 2 && (puVar5 = (npc->_damageEvents)._begin, puVar5 != (npc->_damageEvents)._end)))) { do { if (((puVar5[2] & 4) != 0) && (puVar5[6] == npc->_type)) { *puVar5 = 0x40a00000; } puVar5 = puVar5 + 0xe; } while (puVar5 != (npc->_damageEvents)._end); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_64,0x191,-1,-1,1,0); local_14 = 0; if (local_64._size != 0) { uVar16 = 0; pvVar9 = local_64._data; uVar4 = local_64._size; do { if (*(int *)(*(int *)((int)pvVar9 + uVar16 * 4) + 0xb64) == 0x10) { uVar16 = uVar16 + 1; } else { if (uVar4 <= uVar16) { KAGE_LogMessage(0x10,(byte *)"EL: invalid index for remove\n"); pvVar9 = local_64._data; } uVar4 = uVar4 - 1; for (uVar14 = uVar16; uVar14 < uVar4; uVar14 = uVar14 + 1) { *(undefined4 *)((int)pvVar9 + uVar14 * 4) = *(undefined4 *)((int)pvVar9 + uVar14 * 4 + 4); } local_64._size = uVar4; } } while (uVar16 < uVar4); npc = local_234; } pVVar7 = &npc->_pos; local_240 = (Room *)pVVar7; NpcHelper::query_nearest_other(0); local_230 = (char *)__RTDynamicCast(); if (local_64._0_1_ == '\0') { local_14 = 1; tracked_alloc(1,local_64._data,0); } local_14 = 0xffffffff; if (npc->_state == 0) { iVar6 = npc->_type; if (iVar6 == 0x37) { if (npc->_variant == 2) { uVar4 = Random(); Game::Spawn(g_game,0x60,0,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar4); iVar6 = __RTDynamicCast(); puVar5 = (undefined4 *)(iVar6 + 0x3bc); if (*(int *)(iVar6 + 0x3bc) != 0) { local_44.y = (float)puVar5; std::multiset::erase(&local_44.y); } *puVar5 = npc; std::multiset::insert(puVar5); iVar6 = npc->_type; } if (iVar6 == 0x37) { npc->_entityGridCollisionClass = 3; npc->_state = 4; goto LAB_0052dffb; } } npc->_state = 4; if ((((iVar6 == 0xed) && (npc->_isBoss != 0)) && (npc->_spawnerType == 0)) && (npc->_subtype == 1)) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_64,0xed,1,-1,0,0); local_14 = 2; iVar15 = 0; uVar4 = 0; iVar6 = iVar15; if (local_64._size != 0) { do { iVar6 = iVar15 + 1; if (*(int *)(*(int *)((int)local_64._data + uVar4 * 4) + 0x34) != 0) { iVar6 = iVar15; } uVar4 = uVar4 + 1; iVar15 = iVar6; } while (uVar4 < (uint)local_64._size); npc = local_234; } iVar6 = (iVar6 + 1) / 2 + iVar6; if (local_64._size < iVar6) { local_230 = (char *)(iVar6 - local_64._size); do { uVar16 = Random(); uVar4 = npc->_subtype; pVVar7 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_2c,(Vector *)local_240,60.0,0,0,0); npc = local_234; pEVar8 = Game::Spawn(g_game,local_234->_type,local_234->_variant,pVVar7,&g_vectorZero, (Entity *)local_234,uVar4,uVar16); (**(code **)(*(int *)pEVar8 + 0xc))(); local_230 = local_230 + -1; } while (local_230 != (char *)0x0); } if (local_64._0_1_ == '\0') { local_14 = 3; tracked_alloc(1,local_64._data,0); } } LAB_0052dffb: if (npc->_type == 0xed) { if ((npc->_variant == 2) && (&npc->_splatColor != (ColorMod *)local_274)) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.6; (npc->_splatColor)._offset[1] = 0.4; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } } else if (((npc->_type == 0x17) && (npc->_variant == 2)) && (&npc->_splatColor != (ColorMod *)local_2a0)) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } ExceptionList = local_1c; return; } local_236 = 0; local_244 = (char *)0x3f19999a; if (local_230 == (char *)0x0) { LAB_0052e24c: (npc->_sprite)._offset.x = 0.0; (npc->_sprite)._offset.y = 0.0; npc->_renderZOffset = 0; (npc->_sprite)._rotation = 0.0; } else { local_23c = *(float *)(local_230 + 0x33c) - pVVar7->x; local_44.y = *(float *)(local_230 + 0x340) / 0.6 - (npc->_pos).y / 0.6; fVar17 = sqrtf(local_44.y * local_44.y + local_23c * local_23c); fVar19 = *(float *)(local_230 + 0x370); if (fVar17 < fVar19 * 1.3) { npc->_renderZOffset = 0x578; fVar19 = *(float *)(local_230 + 0x370); } if (fVar19 <= fVar17) goto LAB_0052e24c; local_236 = 1; local_23c = (local_23c / fVar19) * 35.0 * (1.0 - ABS(local_44.y / fVar19)); local_44.y = 1.0 - (fVar17 / fVar19) * (fVar17 / fVar19); fVar19 = local_23c; if (*(int *)(local_230 + 0x7c) != 0) { pvVar9 = AnimationState::GetNullFrame((AnimationState *)(local_230 + 0x78),(byte *)"ClimbPos") ; fVar19 = local_23c; if (pvVar9 != (void *)0x0) { fVar19 = *(float *)((int)pvVar9 + 4); (npc->_sprite)._offset.x = 0.0; (npc->_sprite)._offset.y = local_44.y * fVar19; fVar19 = local_23c * (*(float *)((int)pvVar9 + 4) / 26.0); } } (npc->_sprite)._rotation = fVar19; npc->_friction = npc->_friction * 0.85; } iVar6 = npc->_type; if (((iVar6 == 0x17) || (iVar6 == 0x37)) || (local_240 = (Room *)((uint)local_240 & 0xffffff00), iVar6 == 0xed)) { local_240 = (Room *)CONCAT31(local_240._1_3_,1); } pEVar8 = Entity_NPC::GetPlayerTarget(npc); if (((pEVar8->_type == 1) && ((npc->_flags & 0x20000000) != 0)) && ((npc->_controllerID == -1 && (local_240 = (Room *)((uint)local_240 & 0xff), *(int *)&g_game->_deathmatchManager < 2)))) { local_240 = (Room *)0x0; } iVar6 = npc->_type; if (iVar6 == 0x15) { local_244 = (char *)0x3f400000; } else if (iVar6 == 0x37) { local_244 = (char *)0x3f59999a; } else if ((iVar6 == 0x1f) || (iVar6 == 0xf3)) { local_244 = (char *)0x3f3851ec; } else if ((iVar6 == 0x17) && (npc->_variant == 1)) { local_244 = (char *)0x3f0a3d71; } fVar19 = 0.85; pRVar20 = g_game->_room; iVar6 = (int)((pVVar7->x - 40.0) / 40.0 + 0.5); iVar15 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (pRVar20->_gridWidth <= iVar6)) || (iVar15 < 0)) || (pRVar20->_gridHeight <= iVar15)) { local_23c = -NAN; } else { local_23c = (float)(iVar6 + pRVar20->_gridWidth * iVar15); } Room::RaiseGridPathAtPos(pRVar20,pVVar7,900); local_30 = "Move Hori"; local_2c.x = 1.6716224e-38; local_2c.y = 1.6716207e-38; local_88 = (undefined4 *)&DAT_00b60d94; local_84.x = (float)&DAT_00b1cde4; local_84.y = (float)&DAT_00b1cddc; local_64._data = "DashHori"; local_64._capacity = 0xb1edac; local_64._size = 0xb1edb4; local_3c = "Attack Hori"; local_38.x = 1.6716112e-38; local_38.y = 1.6716017e-38; local_70 = "Move Hori"; local_6c.x = 1.6720002e-38; local_6c.y = 1.6720002e-38; local_54 = "Attack Hori"; local_50.x = 1.6716017e-38; local_50.y = 1.6716017e-38; walkAnimNames[0] = "WalkVert"; walkAnimNames[1] = "WalkVert"; walkAnimNames[2] = "WalkLeft"; walkAnimNames[3] = "WalkRight"; local_98._seed = 0xb5fca8; local_98._shift1 = 0xb5fcb4; local_98._shift2 = 0xb5fc6c; local_98._shift3 = 0xb5fc24; local_7c = (byte *)0xb610e8; local_78.x = 1.6720108e-38; local_78.y = 1.6720091e-38; local_48 = "Recover Hori"; local_44.x = 1.6720164e-38; local_44.y = 1.6720142e-38; if ((npc->_type != 0x17) || (isDankCharger = '\x01', npc->_variant != 2)) { isDankCharger = '\0'; } iVar6 = npc->_state; if (iVar6 == 5) { if (((npc->_v1).x == g_vectorZero.x) && ((npc->_v1).y == g_vectorZero.y)) { (npc->_v1).x = (npc->_targetPosition).x; (npc->_v1).y = (npc->_targetPosition).y; } fVar19 = npc->_friction * 0.9; npc->_friction = fVar19; if (fVar19 == 0.0) { fVar17 = (npc->_velocity).x; } else { fVar18 = npc->_speedMultiplier; fVar17 = (fVar18 * (npc->_v1).x) / fVar19 + (npc->_velocity).x; (npc->_velocity).x = fVar17; (npc->_velocity).y = (fVar18 * (npc->_v1).y) / fVar19 + (npc->_velocity).y; } if ((fVar17 <= 0.0) || (pVVar7->x <= *(float *)((int)g_game->_room + 0x1c) + 80.0)) { if (0.0 <= fVar17) { ExceptionList = local_1c; return; } fVar19 = *(float *)((int)g_game->_room + 0x14) - 80.0; if (fVar19 < pVVar7->x || fVar19 == pVVar7->x) { ExceptionList = local_1c; return; } } (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } animDir = 0; if (npc->_type == 0xed) { fVar17 = (npc->_velocity).x; fVar18 = (npc->_velocity).y; if (ABS(fVar17) <= ABS(fVar18)) { animDir = (uint)(0.0 <= fVar18); } else { animDir = (0.0 <= fVar17) + 2; } } else { if ((iVar6 == 8) || ((isDankCharger != '\0' && (iVar6 == 0x10)))) { iVar15 = 0xbb0; } else { iVar15 = 0x360; } fVar17 = *(float *)((int)(&(npc->_sprite)._filename + -3) + iVar15); fVar18 = *(float *)((npc->_sprite)._filename._buf + iVar15 + -0x44); if (ABS(fVar17) <= ABS(fVar18)) { animDir = (0.0 <= fVar18) + 1; } else if ((iVar6 != 9) && ((npc->_sprite)._flipX = fVar17 < 0.0, fVar17 < 0.0)) { (npc->_sprite)._rotation = (npc->_sprite)._rotation * -1.0; iVar6 = npc->_state; } } if (iVar6 == 3) { npc->_friction = npc->_friction * fVar19; if (npc->_type == 0xed) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { if (npc->_variant == 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); pPVar10 = ProjectileParams::ProjectileParams(&projParams); local_2c.x = 7.5; local_2c.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar7,&local_2c,9,pPVar10); } else if (npc->_variant == 2) { iVar6 = Entity_NPC::GetAliveEnemyCount(npc); local_23c = 0.0; if (iVar6 < 9) { local_23c = 5.60519e-45; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if (bVar3 != 0) { iVar6 = Entity::CountRelatedEntities((Entity *)npc,0xd9,2,unused,(void *)0x0); if (4 - iVar6 <= (int)local_23c) { local_23c = (float)(4 - iVar6); } } if ((int)local_23c < 1) { Game::ButterBeanFart(g_game,pVVar7,120.0,(Entity *)npc,1,0); } else { local_230 = (char *)0x0; do { local_44.y = (float)(int)local_230 * 0.25 * 360.0 * 0.017453292; local_240 = (Room *)sin(local_44.y); local_44.y = cos(local_44.y); uVar4 = Random(); local_2c.x = local_44.y * 10.0; local_2c.y = (float)local_240 * 10.0; fVar19 = npc->_size + 5.0; local_38.y = (float)local_240 * fVar19 + (npc->_pos).y; local_38.x = fVar19 * local_44.y + pVVar7->x; local_240 = (Room *)local_2c.y; local_44.y = local_2c.x; pEVar8 = Game::Spawn(g_game,0xd9,2,&local_38,&local_2c,(Entity *)npc,0,uVar4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; fVar19 = pEVar8->_friction; *(undefined4 *)((int)&pEVar8->_flags + 4) = *(undefined4 *)((int)&pEVar8->_flags + 4); if (fVar19 != 0.0) { fVar17 = pEVar8->_speedMultiplier; (pEVar8->_velocity).x = (local_44.y * fVar17) / fVar19 + (pEVar8->_velocity).x; (pEVar8->_velocity).y = (fVar17 * (float)local_240) / fVar19 + (pEVar8->_velocity).y; } pEVar8->_health = 0.1; (**(code **)(*(int *)pEVar8 + 0xc))(); local_230 = local_230 + 1; } while ((int)local_230 < (int)local_23c); Entity_NPC::PlaySound(npc,0xed,0.8,10,0,1.0); } } else if (npc->_subtype == 0) { local_230 = (char *)0x0; uVar4 = Random(); if (uVar4 % 3 != 0) { do { uVar4 = Random(); fVar19 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44.y = fVar19 + fVar19; local_240 = (Room *)cos(local_44.y); local_44.y = sin(local_44.y); uVar4 = Random(); local_2c.x = (float)local_240 + (float)local_240; local_38.x = (float)local_240 * 40.0 + pVVar7->x; local_2c.y = local_44.y + local_44.y; local_38.y = local_44.y * 40.0 + (npc->_pos).y; pEVar8 = Game::Spawn(g_game,0x12,0,&local_38,&local_2c,(Entity *)npc,0,uVar4); local_230 = local_230 + 1; flagsHigh = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = flagsHigh; uVar4 = Random(); } while (local_230 < (char *)(uVar4 % 3)); } } } goto LAB_0052eadd; } } else { LAB_0052eadd: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00530392; } LAB_00530388: npc->_state = 4; LAB_00530392: pVVar7 = &npc->_pos; } else { if (iVar6 != 4) { if (iVar6 == 8) { if (isDankCharger == '\0') { fVar19 = pVVar7->x; fVar17 = (npc->_pathfinder)._gridPathTarget.x - fVar19; fVar18 = (npc->_pathfinder)._gridPathTarget.y - (npc->_pos).y; if (2.0 <= (fVar18 * fVar18 + fVar17 * fVar17) / (npc->_speedMultiplier * npc->_speedMultiplier)) { (npc->_pathfinder)._moveCountdown = 0; } else { piVar13 = &(npc->_pathfinder)._moveCountdown; *piVar13 = *piVar13 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } bVar3 = npc->_collidesWithGrid; (npc->_pathfinder)._gridPathTarget.x = fVar19; (npc->_pathfinder)._gridPathTarget.y = (npc->_pos).y; if ((((bVar3 != 0) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 != 0)) || ((bVar3 = Entity::HasEntityFlags((Entity *)npc,0x80), bVar3 != 0 && (fVar19 = (npc->_velocity).y, fVar17 = (npc->_velocity).x, fVar19 = sqrtf(fVar17 * fVar17 + fVar19 * fVar19), fVar19 < 3.0)))) || ((5 < (npc->_pathfinder)._moveCountdown || (local_236 != 0)))) { NPCAI_Pathfinder::ResetMovementTarget(&npc->_pathfinder); if (npc->_type != 0xed) goto LAB_00530388; ANM2::Play(&npc->_sprite,&DAT_00b1d6f4,0); npc->_state = 3; } else { if (npc->_type == 0x17) { fVar19 = 0.8; } else { fVar19 = 0.9; } npc->_friction = fVar19 * npc->_friction; Entity::AddVelocity_divided((Entity *)npc,&npc->_v1,0); if ((npc->_type == 0x17) && (npc->_variant == 3)) { pfVar1 = &(npc->_v1).y; pcVar11 = "Attack Up"; if (0.0 < *pfVar1 || *pfVar1 == 0.0) { pcVar11 = "Attack Down"; } ANM2::Play(&npc->_sprite,(byte *)pcVar11,0); local_2c.y = (npc->_v1).x; (npc->_sprite)._flipX = local_2c.y < 0.0; local_38.y = cos(1.5707964); fVar17 = sin(1.5707964); fVar19 = (npc->_v1).y; local_38.x = local_2c.y * local_38.y - fVar19 * fVar17; local_38.y = fVar19 * local_38.y + local_2c.y * fVar17; Vector::Normalized(&local_38,&local_2c); Room::GetGridPosition(g_game->_room,&local_38,(int)local_23c); if (npc->_controllerID == -1) { pSVar21 = (Sprite *)local_38.x; pRVar20 = (Room *)local_38.y; } else { pSVar21 = (Sprite *)(npc->_v2).x; pRVar20 = (Room *)(npc->_v2).y; } fVar19 = (npc->_pos).y; local_44.y = (pVVar7->x - ((float)pSVar21 - 20.0)) * local_2c.x + (fVar19 - ((float)pRVar20 - 0.0)) * local_2c.y; pSVar21 = (Sprite *) ((fVar19 - ((float)pRVar20 + 0.0)) * local_2c.y + (pVVar7->x - ((float)pSVar21 + 20.0)) * local_2c.x); if (ABS((float)pSVar21) <= ABS(local_44.y)) { local_44.y = (float)pSVar21; } fVar19 = (npc->_velocity).y; fVar17 = (npc->_velocity).x; fVar22 = fVar17 * local_2c.x + fVar19 * local_2c.y; fVar23 = fVar22 * local_2c.y; fVar22 = fVar22 * local_2c.x; fVar18 = Math::timescale_factor(0.7,npc->_speedMultiplier); pVVar7 = &npc->_pos; (npc->_velocity).x = fVar17 - (local_44.y * local_2c.x + fVar22) * (1.0 - fVar18); (npc->_velocity).y = fVar19 - (1.0 - fVar18) * (fVar23 + local_44.y * local_2c.y); goto LAB_005303a6; } Room::GetGridPosition(g_game->_room,&local_2c,(int)local_23c); if (npc->_controllerID == -1) { pSVar21 = (Sprite *)local_2c.x; pRVar20 = (Room *)local_2c.y; } else { pSVar21 = (Sprite *)(npc->_v2).x; pRVar20 = (Room *)(npc->_v2).y; } iVar6 = npc->_type; if (iVar6 != 0xed) { fVar18 = ABS((npc->_v1).x); fVar17 = ABS((npc->_v1).y); fVar19 = Math::timescale_factor(0.7,npc->_speedMultiplier); iVar6 = extraout_ECX; if (fVar17 <= fVar18) { fVar17 = (npc->_velocity).y; (npc->_velocity).y = (((float)pRVar20 - (npc->_pos).y) - fVar17) * (1.0 - fVar19) + fVar17; } else { fVar17 = (npc->_velocity).x; (npc->_velocity).x = (((float)pSVar21 - pVVar7->x) - fVar17) * (1.0 - fVar19) + fVar17; } } if (iVar6 == 0x37) { ANM2::Play(&npc->_sprite,(&local_64._data)[animDir],0); } else if (iVar6 == 0xed) { ANM2::Play(&npc->_sprite,(byte *)walkAnimNames[animDir + 4],0); } else { ANM2::Play(&npc->_sprite,(byte *)(&local_3c)[animDir],0); } } } else { npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)(&local_3c)[animDir],0); } puVar24 = &DAT_bf800000; bVar3 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if (bVar3 != 0) { if (npc->_collidesWithGrid != 0) { (npc->_v1).x = (npc->_v1).x * (float)puVar24; (npc->_v1).y = (npc->_v1).y * (float)puVar24; } local_2c.y = (npc->_v1).x; fVar19 = (npc->_v1).y; fVar19 = sqrtf(local_2c.y * local_2c.y + fVar19 * fVar19); if ((npc->_stateFrame < 0x2e) || (2.0 <= fVar19)) { npc->_friction = 1.0; fVar18 = Math::timescale_factor(0.19999999,npc->_speedMultiplier); game = g_game; fVar19 = (npc->_velocity).x; fVar17 = (npc->_velocity).y; (npc->_velocity).y = (1.0 - fVar18) * ((npc->_v1).y - fVar17) + fVar17; (npc->_velocity).x = fVar19 + (1.0 - fVar18) * (local_2c.y - fVar19); fVar19 = ((float)npc->_stateFrame - 10.0) / 70.0; if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } fVar19 = 1.0 - fVar19 * 0.060000002; (npc->_v1).y = fVar19 * (npc->_v1).y; (npc->_v1).x = fVar19 * (npc->_v1).x; Room::GetGridPosition(game->_room,&local_2c,(int)local_23c); if (npc->_controllerID == -1) { pSVar21 = (Sprite *)local_2c.x; pRVar20 = (Room *)local_2c.y; } else { pSVar21 = (Sprite *)(npc->_v2).x; pRVar20 = (Room *)(npc->_v2).y; } if (ABS((npc->_velocity).y) <= ABS((npc->_velocity).x)) { (npc->_pos).y = (float)pRVar20 * 0.1 + (npc->_pos).y * 0.9; } else { pVVar7->x = (float)pSVar21 * 0.1 + pVVar7->x * 0.9; } ANM2::Play(&npc->_sprite,(byte *)(&local_3c)[animDir],0); } else { NPCAI_Pathfinder::ResetMovementTarget(&npc->_pathfinder); ANM2::Play(&npc->_sprite,(byte *)(&local_48)[animDir],0); npc->_state = 0x10; } uVar4 = Random(); if (uVar4 % 10 == 0) { uVar4 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (**(code **)(*(int *)splat + 0x3c))(); } bVar3 = Entity::IsFrame((Entity *)npc,3,0); if ((bVar3 == 0) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar3 == 0)) { uVar4 = Random(); Game::Spawn(g_game,1000,0x1a,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar4); pEVar8 = (Entity *)__RTDynamicCast(); Entity::SetParent(pEVar8,(Entity *)npc); fVar17 = g_vectorOne.x * 0.8; iVar6 = *(int *)pEVar8; fVar19 = g_vectorOne.y * 0.8; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; (pEVar8->_sprite)._scale.x = fVar17; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (pEVar8->_sprite)._scale.y = fVar19; (**(code **)(iVar6 + 0xc))(); } } } goto LAB_00530392; } if (iVar6 == 9) { npc->_friction = npc->_friction * fVar19; Entity_NPC::UpdateControllerMovement(npc,0); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x13f,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); pEVar12 = (Entity_NPC *)0x2; projParams.HeightModifier = 14.0; projParams.FallingSpeedModifier = -0.1; projParams.FallingAccelModifier = -0.101; local_234 = (Entity_NPC *)0x2; if (npc->_controllerID == -1) { iVar6 = npc->_i1; if (iVar6 == 0) { if ((npc->_sprite)._flipX != 0) { local_234 = (Entity_NPC *)0x0; } } else if (iVar6 == 1) { local_234 = (Entity_NPC *)0x1; } else { if (iVar6 == 2) { pEVar12 = (Entity_NPC *)0x3; } local_234 = pEVar12; } } else { local_234 = (Entity_NPC *)vector_to_direction(&npc->_controllerMovement); (npc->_sprite)._flipX = 0; if (local_234 == (Entity_NPC *)0x1) { animDir = 1; } else if (local_234 == (Entity_NPC *)0x3) { animDir = 2; } else { animDir = 0; (npc->_sprite)._flipX = local_234 == (Entity_NPC *)0x0; } if (npc->_type == 0x1f) { animName = (byte *)(&local_3c)[animDir]; } else { animName = (byte *)(&local_54)[animDir]; } bVar3 = ANM2::IsPlaying(&npc->_sprite,animName); if (bVar3 == 0) { if (npc->_type == 0x1f) { animName = (byte *)(&local_3c)[animDir]; } else { animName = (byte *)(&local_54)[animDir]; } ANM2::SetAnimation(&npc->_sprite,animName,0); } } if ((npc->_type == 0x1f) && (npc->_variant == 1)) { ProjectileParams::ProjectileParams(&burstParams); burstParams.HeightModifier = 10.0; Isaac::GetAxisAlignedUnitVectorFromDir(&local_50,(int)local_234); local_230 = (char *)0x0; local_44.y = 1.4013e-44; do { burstParams.BulletFlags._0_4_ = 0x8000000; burstParams.BulletFlags._4_4_ = 0; burstParams.Scale = 1.7 - (float)(int)local_230 * 0.1; burstParams.Acceleration = 1.0 - (float)(int)local_230 * 0.03; burstParams.FallingAccelModifier = (float)(int)local_44.y * 0.005 - 0.08; uVar4 = Random(); local_2c.y = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 - 0.5) * (float)(int)local_230 * 0.017453292; local_38.y = cos(local_2c.y); fVar19 = sin(local_2c.y); local_6c.x = (local_38.y * local_50.x - fVar19 * local_50.y) * 18.0; local_6c.y = (fVar19 * local_50.x + local_38.y * local_50.y) * 18.0; Entity_NPC::FireProjectiles(npc,pVVar7,&local_6c,0,&burstParams); local_44.y = (float)((int)&((Sprite *)((int)local_44.y + -0x114))->_bitflags + 3); local_230 = local_230 + 1; } while (0 < (int)local_44.y); } else { unitDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_38,(int)local_234); local_2c.x = unitDir->x * 8.0; local_2c.y = unitDir->y * 8.0; Entity_NPC::FireProjectiles(npc,pVVar7,&local_2c,0,&projParams); if (npc->_type == 0xf3) { unitDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_38,(int)local_234); local_2c.x = -unitDir->x * 8.0; local_2c.y = -unitDir->y * 8.0; Entity_NPC::FireProjectiles(npc,pVVar7,&local_2c,0,&projParams); } } } } else { if (iVar6 != 0x10) { if (iVar6 == 0xd) { npc->_friction = npc->_friction * 0.8; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x25,1.0,2,0,1.0); if (npc->_i1 == 0) { iVar6 = 2; if ((npc->_sprite)._flipX != 0) { iVar6 = 0; } } else { iVar6 = (uint)(npc->_i1 != 1) * 2 + 1; } unitDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_38,iVar6); local_2c.y = -unitDir->x; local_38.y = (float)((uint)unitDir->y ^ 0x80000000); uVar4 = RNG::Next(&npc->_dropRNG); local_50.x = local_2c.y * 8.0 + pVVar7->x; local_2c.x = local_2c.y * 6.0; local_50.y = local_38.y * 8.0 + (npc->_pos).y; local_2c.y = local_38.y * 6.0; pEVar8 = Game::Spawn(g_game,0xd9,0,&local_50,&local_2c,(Entity *)npc,0,uVar4); flagsHigh = *(undefined4 *)((int)&pEVar8->_flags + 4); iVar6 = *(int *)pEVar8; *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = flagsHigh; (**(code **)(iVar6 + 0xc))(); Entity::SetChild((Entity *)npc,pEVar8); } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) goto LAB_00530388; } goto LAB_00530392; } npc->_friction = npc->_friction * 0.8; } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); pVVar7 = &npc->_pos; if (bVar3 != 0) { npc->_state = 4; } goto LAB_005303a6; } iVar6 = npc->_type; pSVar21 = (Sprite *)&npc->_sprite; local_44.y = (float)pSVar21; if (iVar6 == 0x37) { animName = (byte *)(&local_88)[animDir]; } else if (iVar6 == 0xed) { animName = (byte *)walkAnimNames[animDir]; } else if (iVar6 == 0xf3) { animName = (byte *)(&local_70)[animDir]; } else { animName = (byte *)(&local_30)[animDir]; } ANM2::Play((ANM2 *)pSVar21,animName,0); if (local_230 == (char *)0x0) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,(float)local_244,0); } else { local_2c.x = *(float *)(local_230 + 0x33c); local_2c.y = *(float *)(local_230 + 0x340); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_2c,(float)local_244 * 1.4,0,1) ; pVVar7 = Vector::ToCardinal(&local_2c,&npc->_velocity); fVar19 = (npc->_velocity).y; fVar17 = (npc->_velocity).x; fVar17 = sqrtf(fVar17 * fVar17 + fVar19 * fVar19); fVar19 = pVVar7->x; (npc->_velocity).y = fVar17 * pVVar7->y; (npc->_velocity).x = fVar17 * fVar19; pSVar21 = (Sprite *)local_44.y; npc = local_234; } fVar19 = npc->_speedMultiplier; frictionScale = ZEXT812(0x3f76f6f6); npc->_friction = npc->_friction * 0.85; if (fVar19 != 1.0) { fVar17 = frictionScale._0_4_; frictionScale._4_8_ = frictionScale._4_8_; frictionScale._0_4_ = fVar17 / ((fVar19 + fVar17) - fVar19 * fVar17); } iVar6 = npc->_type; (npc->_velocity).y = frictionScale._0_4_ * (npc->_velocity).y; if (((iVar6 == 0x1f) && (npc->_variant == 1)) && (bVar3 = Sprite::IsEventTriggered(pSVar21,"Shoot"), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); pPVar10 = ProjectileParams::ProjectileParams(&projParams); uVar4 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar4 & 1) + 3,&g_vectorZero,10.0,pPVar10); } if ((char)local_240 == '\0') { LAB_0052f52a: if ((npc->_type == 0x1f) || (npc->_type == 0xf3)) { if (npc->_controllerID == -1) { uVar4 = Random(); bVar3 = uVar4 % 0x23 == 0; } else { bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if ((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 == 0)) { Entity_NPC::UpdateControllerMovement(npc,1); npc->_state = 9; npc->_stateFrame = 0; if (npc->_type == 0x1f) { animName = (byte *)(&local_3c)[animDir]; } else { animName = (byte *)(&local_54)[animDir]; } ANM2::Play(&npc->_sprite,animName,1); pVVar7 = &npc->_pos; npc->_i1 = animDir; goto LAB_005303a6; } } goto LAB_00530392; } if (npc->_controllerID == -1) { bVar3 = Entity::IsFrame((Entity *)npc,4,npc->_index); } else { bVar3 = Entity_NPC::IsControllerActionPressed(npc,9); } if (bVar3 == 0) goto LAB_0052f52a; local_2c.y = 0.0; if (npc->_type == 0x37) { local_2c.y = 2.8026e-45; } pRVar20 = g_game->_room; Room::GetGridPosition(pRVar20,&local_6c,(int)local_23c); pVVar7 = Entity_NPC::CalcTargetPosition(local_234,&local_84,0.0); pEVar8 = Entity_NPC::GetPlayerTarget(local_234); local_44.y = (pEVar8->_velocity).x; local_240 = (Room *)(pEVar8->_velocity).y; uVar4 = Random(); fVar19 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_50.y = fVar19 * (float)local_240 * 16.0 + pVVar7->y; local_50.x = fVar19 * local_44.y * 16.0 + pVVar7->x; Room::GetClampedPosition(pRVar20,&local_38,&local_50,20.0); npc = local_234; if (local_230 != (char *)0x0) { local_38.x = *(float *)(local_230 + 0x33c); local_38.y = *(float *)(local_230 + 0x340); } local_244 = (char *)(local_38.x - local_6c.x); local_230 = (char *)(local_38.y - local_6c.y); local_240 = (Room *)local_38.y; local_50.x = (float)local_244; local_50.y = (float)local_230; local_44.y = local_38.x; if (local_234->_controllerID != -1) { pVVar7 = Entity_NPC::GetControllerInput(local_234,&local_84,0.0); local_50.x = pVVar7->x * 100.0; local_50.y = pVVar7->y * 100.0; } iVar6 = npc->_type; local_244 = (char *)local_50.x; local_230 = (char *)local_50.y; if ((iVar6 == 0x17) && (npc->_variant == 3)) { local_234 = (Entity_NPC *)cos(0.7853982); fVar19 = sin(0.7853982); local_2c.x = (float)local_244 * (float)local_234 - (float)local_230 * fVar19; local_2c.y = (float)local_244 * fVar19 + (float)local_230 * (float)local_234; if (((ABS(local_2c.x) < 20.0) || (ABS(local_2c.y) < 20.0)) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar3 == 0)) { pVVar7 = Vector::ToCardinal(&local_38,&local_2c); local_244 = (char *)cos(-0.7853982); fVar19 = sin(-0.7853982); local_230 = (char *)((float)local_244 * pVVar7->x - fVar19 * pVVar7->y); local_244 = (char *)((float)local_244 * pVVar7->y + fVar19 * pVVar7->x); local_234 = (Entity_NPC *)cos(1.5707964); fVar19 = sin(1.5707964); local_2c.y = (float)g_game->_room; local_78.y = (float)local_230 * (float)local_234 - (float)local_244 * fVar19; local_234 = (Entity_NPC *)((float)local_230 * fVar19 + (float)local_244 * (float)local_234); Room::GetGridPosition((Room *)local_2c.y,&local_38,(int)local_23c); pVVar7 = &npc->_pos; local_84.y = local_38.x - 20.0; local_50.y = local_38.x + 20.0; local_6c.y = local_38.y - 0.0; local_38.y = local_38.y + 0.0; fVar19 = (npc->_pos).y; local_23c = (fVar19 - local_38.y) * (float)local_234 + (pVVar7->x - local_50.y) * local_78.y ; fVar19 = (fVar19 - local_6c.y) * (float)local_234 + (pVVar7->x - local_84.y) * local_78.y; if (ABS(local_23c) <= ABS(fVar19)) { pcVar11 = (char *)local_50.y; fVar19 = local_23c; pRVar20 = (Room *)local_38.y; } else { pcVar11 = (char *)local_84.y; pRVar20 = (Room *)local_6c.y; } pcVar25 = (char *)((npc->_pos).y - fVar19 * (float)local_234); local_78.x = pVVar7->x - fVar19 * local_78.y; fVar19 = (local_44.y - (float)pcVar11) * local_78.y + ((float)local_240 - (float)pRVar20) * (float)local_234; fVar17 = local_44.y - fVar19 * local_78.y; local_44.y = ((float)local_240 - fVar19 * (float)local_234) - (float)local_244 * 10.0; local_44.x = fVar17 - (float)local_230 * 10.0; local_78.y = (float)pcVar25; if ((npc->_controllerID != -1) || (bVar3 = Room::CheckLine((Room *)local_2c.y,&local_78,&local_44,1,0,0,0,(Vector *)0x0), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0xe0,1.0,0x14,0,1.0); (npc->_v1).x = (float)local_230 * 1.3; (npc->_v1).y = (float)local_244 * 1.3; npc->_state = 8; npc->_stateFrame = 0; (npc->_v2).x = pVVar7->x; (npc->_v2).y = (npc->_pos).y; (npc->_pathfinder)._gridPathTarget.x = pVVar7->x; (npc->_pathfinder)._gridPathTarget.y = (npc->_pos).y; (npc->_pathfinder)._moveCountdown = 0; } goto LAB_005303a6; } goto LAB_00530392; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (((bVar3 != 0) || (local_236 != 0)) || ((npc->_controllerID == -1 && ((((20.0 <= ABS((float)local_244) && (20.0 <= ABS((float)local_230))) || ((40000.0 <= (float)local_230 * (float)local_230 + (float)local_244 * (float)local_244 && (iVar6 != 0x37)))) || (bVar3 = Room::CheckLine(g_game->_room,&local_6c,&local_38,(int)local_2c.y,0,0,0, (Vector *)0x0), bVar3 == 0)))))) goto LAB_00530392; if (npc->_type == 0x37) { iVar6 = 0xdd; LAB_0052f360: iVar15 = 0x14; } else { if (npc->_type != 0xed) { iVar6 = 0xe0; goto LAB_0052f360; } Entity_NPC::PlaySound(npc,0x39,1.0,0x14,0,1.0); iVar6 = 0x3af; iVar15 = 2; } Entity_NPC::PlaySound(npc,iVar6,1.0,iVar15,0,1.0); pVVar7 = Vector::ToCardinal(&local_2c,&local_50); if (npc->_type == 0x37) { fVar19 = 1.55; } else { fVar19 = 1.3; } fVar17 = fVar19 * pVVar7->y; fVar19 = fVar19 * pVVar7->x; (npc->_v1).y = fVar17; (npc->_v1).x = fVar19; if (npc->_type == 0xed) { if ((npc->_isBoss == 0) || (npc->_subtype != 1)) goto LAB_0052f41d; (npc->_v1).x = fVar19 * 1.5; fVar17 = fVar17 * 1.5; LAB_0052f441: (npc->_v1).y = fVar17; } else { if ((npc->_type == 0x17) && (npc->_variant == 1)) { (npc->_v1).x = fVar19 * 0.9; fVar17 = fVar17 * 0.9; goto LAB_0052f441; } LAB_0052f41d: if (isDankCharger != '\0') { (npc->_v1).x = fVar19 * 14.0; fVar17 = fVar17 * 14.0; goto LAB_0052f441; } } pVVar7 = &npc->_pos; npc->_state = 8; (npc->_pathfinder)._gridPathTarget.x = pVVar7->x; (npc->_pathfinder)._gridPathTarget.y = (npc->_pos).y; (npc->_pathfinder)._moveCountdown = 0; npc->_stateFrame = 0; (npc->_v2).x = pVVar7->x; (npc->_v2).y = (npc->_pos).y; if (isDankCharger != '\0') { fVar19 = (npc->_v1).x; fVar17 = (npc->_v1).y; if (ABS(fVar19) <= ABS(fVar17)) { animDir = (0.0 <= fVar17) + 1; } else { animDir = 0; (npc->_sprite)._flipX = fVar19 < 0.0; if (fVar19 < 0.0) { (npc->_sprite)._rotation = (npc->_sprite)._rotation * -1.0; ANM2::Play(&npc->_sprite,local_7c,0); goto LAB_005303a6; } } ANM2::Play(&npc->_sprite,(&local_7c)[animDir],0); } } LAB_005303a6: npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_type == 0xed) { (npc->_forwardVector).x = 0.0; fVar19 = 1.0; } else { if (((npc->_type == 0x17) && (npc->_variant == 3)) && (npc->_state == 8)) { unitDir = Vector::Normalized(&npc->_v1,&local_2c); } else { if (animDir == 1) { iVar6 = 1; } else if (animDir == 2) { iVar6 = 3; } else { iVar6 = 2; if ((npc->_sprite)._flipX != 0) { iVar6 = 0; } } unitDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_2c,iVar6); } (npc->_forwardVector).x = unitDir->x; fVar19 = unitDir->y; } (npc->_forwardVector).y = fVar19; if ((npc->_type == 0xed) && (fVar19 = (npc->_velocity).y, fVar17 = (npc->_velocity).x, 9.0 < fVar17 * fVar17 + fVar19 * fVar19)) { iVar6 = Entity::GetIntervalTicks((Entity *)npc,5.0,0.0); if (iVar6 != 0) { uVar4 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.39 + 0.2); (**(code **)(*(int *)splat + 0x3c))(); } if ((npc->_variant == 0) || (npc->_state == 8)) { local_236 = npc->_isBoss; if ((local_236 == 0) || (npc->_subtype == 0)) { iVar6 = Entity::GetIntervalTicks((Entity *)npc,5.0,0.0); if (iVar6 != 0) { local_44.y = 3.08286e-44; if (npc->_variant == 2) { local_44.y = 1.31722e-43; uVar4 = Random(); if (uVar4 % 3 == 0) { uVar4 = Random(); local_2c.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 1.0; uVar4 = Random(); Entity_NPC::PlaySound (npc,0x25,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.5,2,0,local_2c.y); } } uVar4 = Random(); Game::Spawn(g_game,1000,(uint)local_44.y,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar4); piVar13 = (int *)__RTDynamicCast(); piVar13[0x39] = 0x3f9d70a4; piVar13[0x3a] = 0x3f9d70a4; piVar13[0x11d] = 0; (**(code **)(*piVar13 + 0xc))(); if (npc->_isChampion == 0) { if (npc->_variant != 2) { Color::operator_assign((Color *)local_17c,&npc->_color); local_170 = 1.0; (**(code **)(*piVar13 + 0x3c))(); } } else { (**(code **)(*piVar13 + 0x3c))(); } goto LAB_00530723; } if (local_236 == 0) goto LAB_00530723; } if ((npc->_subtype == 2) && (iVar6 = Entity::GetIntervalTicks((Entity *)npc,15.0,0.0), iVar6 != 0)) { uVar4 = Random(); pEVar8 = Game::Spawn(g_game,4,3,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar4); pEVar8->_entityCollisionClass = 1; pRVar20 = g_game->_room; iVar6 = Room::GetGridIndex(pRVar20,&npc->_pos); Room::SetGridPath(pRVar20,iVar6,900); } } } LAB_00530723: if ((((npc->_dead != 0) && (npc->_type == 0x1f)) && (npc->_variant == 1)) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar3 == 0)) { ProjectileParams::ProjectileParams(&burstParams); burstParams.TargetPosition.x = (npc->_pos).x; burstParams.TargetPosition.y = (npc->_pos).y; burstParams.Scale = 1.25; burstParams.FallingAccelModifier = -0.07; burstParams.CircleAngle = 0.0; burstParams.BulletFlags._0_4_ = 0x800; burstParams.BulletFlags._4_4_ = 0; local_2c.x = 8.0; local_2c.y = 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_2c,9,&burstParams); burstParams.CircleAngle = 0.3926991; burstParams.BulletFlags._0_4_ = 0x1000; burstParams.BulletFlags._4_4_ = 0; local_2c.x = 8.0; local_2c.y = 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_2c,9,&burstParams); } if (isChargerSubtype1 == '\0') { ExceptionList = local_1c; return; } if (npc->_state != 4) { ExceptionList = local_1c; return; } local_98._seed = npc->_initSeed; local_240 = (Room *)0x0; local_230 = (char *)0x0; local_98._shift1 = 2; local_98._shift2 = 7; local_98._shift3 = 0x19; fVar17 = RNG::RandomFloat(&local_98); fVar19 = (npc->_velocity).y; local_2c.y = fVar17 * 15.0 + 15.0; fVar17 = (npc->_velocity).x; fVar19 = sqrtf(fVar17 * fVar17 + fVar19 * fVar19); local_38.y = fVar19 + 0.4; if (local_38.y <= 0.8) { local_38.y = 0.8; } if (2.0 <= local_38.y) { local_38.y = 2.0; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_64,npc->_type,npc->_variant, npc->_subtype,0,0); local_234 = (Entity_NPC *)0x0; if ((char *)local_64._size != (char *)0x0) { do { pEVar12 = *(Entity_NPC **)((int)local_64._data + (int)local_234 * 4); if (((pEVar12 != (Entity_NPC *)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (pEVar12->_type == 1)) || (pEVar12->_type - 10U < 0x3de)))) && (pEVar12 != npc)) { local_6c.y = (npc->_pos).y - (pEVar12->_pos).y; local_50.y = (npc->_pos).x - (pEVar12->_pos).x; fVar19 = sqrtf(local_6c.y * local_6c.y + local_50.y * local_50.y); if (((0.0 < fVar19) && (fVar19 < local_2c.y)) && (0.1 < local_38.y)) { local_230 = (char *)(local_38.y * (local_50.y / fVar19) + (float)local_230); local_240 = (Room *)(local_38.y * (local_6c.y / fVar19) + (float)local_240); } } local_234 = (Entity_NPC *)((int)local_234 + 1); } while (local_234 < (uint)local_64._size); } fVar19 = npc->_speedMultiplier; (npc->_velocity).y = fVar19 * (float)local_240 + (npc->_velocity).y; (npc->_velocity).x = fVar19 * (float)local_230 + (npc->_velocity).x; if (local_64._0_1_ == '\0') { local_14 = 4; tracked_alloc(1,local_64._data,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } //@@ 00530a80 NpcAI::ENTITY_FAT_SACK /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 209 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FAT_SACK(Entity_NPC *npc) { float fVar1; Vector pos; char *pcVar2; byte bVar3; uint uVar4; Vector *pVVar5; Entity *pEVar6; int iVar7; Vector *freePos; ProjectileParams *params; uint rngValue; void *freePtr; float fVar8; undefined4 uVar9; TypeDescriptor *pTVar10; TypeDescriptor *pTVar11; undefined4 uVar12; Vector splashPos; float splashAngle; Vector local_110; Vector local_108; ProjectileParams projParams; void *walkVertName; char local_50 [12]; uint walkVertSize; uint walkVertCapacity; void *walkHoriName; char local_38 [12]; uint walkHoriSize; uint walkHoriCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af4745; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_38 + 0x28); if (npc->_state == 0) { LAB_00531321: npc->_state = 4; ExceptionList = local_1c; return; } local_24 = uVar4; if (npc->_dead != 0) { if (npc->_health <= -25.0) { return; } ExceptionList = &local_1c; puStack_20 = local_38 + 0x34; uVar4 = Random(); if (uVar4 % 3 == 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; Entity_NPC::Morph(npc,0xd2,0,0,-1); npc->_dead = 0; npc->_health = npc->_maxHitPoints; uVar4 = Random(); npc->_projectileCooldown = uVar4 % 0x14 + 0x14; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } ExceptionList = &local_1c; pcVar2 = local_38 + 0x34; if (npc->_controllerID != -1) { pVVar5 = Entity_NPC::GetControllerInput(npc,&local_108,0.1); pcVar2 = puStack_20; if ((pVVar5->x == g_vectorZero.x) && (pVVar5->y == g_vectorZero.y)) { (npc->_v2).x = 0.0; } else { local_110.y = (npc->_v2).x + 1.0; local_108.y = 30.0; pVVar5 = &local_108; if (local_110.y <= 30.0) { pVVar5 = &local_110; } (npc->_v2).x = pVVar5->y; } } puStack_20 = pcVar2; if (npc->_state != 4) { if (10 < npc->_stateFrame) { iVar7 = npc->_controllerID; fVar8 = (npc->_v1).x + 0.02; if (1.0 <= fVar8) { fVar8 = 1.0; } (npc->_v1).x = fVar8; if (iVar7 == -1) { fVar1 = (npc->_targetPosition).x; (npc->_pos).y = (1.0 - fVar8) * (npc->_pos).y + fVar8 * (npc->_targetPosition).y; (npc->_pos).x = fVar8 * fVar1 + (1.0 - fVar8) * (npc->_pos).x; } else { bVar3 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b1d3b0); if (bVar3 == 0) { Entity_NPC::apply_controller_movement(npc,uVar4); } else { pVVar5 = Entity_NPC::GetControllerInput(npc,&local_108,0.0); fVar8 = npc->_speedMultiplier; fVar1 = pVVar5->y; (npc->_velocity).x = pVVar5->x * 0.1 * fVar8 + (npc->_velocity).x; (npc->_velocity).y = fVar1 * 0.1 * fVar8 + (npc->_velocity).y; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; } } npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_state == 6) { ANM2::Play(&npc->_sprite,s_Jump,0); npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 7; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_state != 7) { ExceptionList = local_1c; return; } ANM2::Play(&npc->_sprite,s_Land,0); npc->_friction = npc->_friction * 0.7; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Splash"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); Random(); params = ProjectileParams::ProjectileParams(&projParams); local_108.x = 12.0; local_108.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_108,9,params); local_108.y = 7.00649e-45; do { uVar4 = Random(); rngValue = Random(); splashAngle = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; splashAngle = splashAngle + splashAngle; rngValue = Random(); local_110.y = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 50.0; fVar8 = cos(splashAngle); splashPos.x = fVar8 * local_110.y + (npc->_pos).x; fVar8 = sin(splashAngle); uVar12 = 0; pTVar11 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; splashPos.y = fVar8 * local_110.y + (npc->_pos).y; pTVar10 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar9 = 0; pEVar6 = Game::Spawn(g_game,1000,0x16,&splashPos,&g_vectorZero,(Entity *)npc,0,uVar4); iVar7 = __RTDynamicCast(pEVar6,uVar9,pTVar10,pTVar11,uVar12); local_108.y = (float)((int)local_108.y + -1); fVar8 = g_vectorOne.y * 2.0; *(float *)(iVar7 + 0xe4) = g_vectorOne.x * 2.0; *(float *)(iVar7 + 0xe8) = fVar8; } while (local_108.y != 0.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d3b0); if (bVar3 != 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; Entity_NPC::PlaySound(npc,0x48,2.0,2,0,1.0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } goto LAB_00531321; } walkVertCapacity = 0xf; walkVertSize = 8; walkVertName = (void *)0x6b6c6157; builtin_strncpy(local_50,"Vert",5); walkHoriCapacity = 0xf; walkHoriSize = 8; walkHoriName = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriName,(std_string *)&walkVertName,0.1); local_14 = local_14 & 0xffffff00; if (0xf < walkHoriCapacity) { uVar4 = walkHoriCapacity + 1; freePtr = walkHoriName; if (0xfff < uVar4) { freePtr = *(void **)((int)walkHoriName + -4); uVar4 = walkHoriCapacity + 0x24; if (0x1f < (uint)((int)walkHoriName + (-4 - (int)freePtr))) goto LAB_00530ce4; } operator_delete(freePtr,uVar4); } local_14 = 0xffffffff; walkHoriSize = 0; walkHoriCapacity = 0xf; walkHoriName = (void *)((uint)walkHoriName & 0xffffff00); if (0xf < walkVertCapacity) { uVar4 = walkVertCapacity + 1; freePtr = walkVertName; if (0xfff < uVar4) { freePtr = *(void **)((int)walkVertName + -4); uVar4 = walkVertCapacity + 0x24; if (0x1f < (uint)((int)walkVertName + (-4 - (int)freePtr))) { LAB_00530ce4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar4); } npc->_aiFloat = 0.3; if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_108,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar5,0.3,900,1); } else { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_108.x = (pEVar6->_pos).x; local_108.y = (pEVar6->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_108,0); iVar7 = (npc->_pathfinder)._evadeMovementCountdown; fVar8 = npc->_friction * 0.8; npc->_friction = fVar8; if (0 < iVar7) { npc->_friction = fVar8 * 0.8; } } uVar4 = Random(); if (uVar4 % 0x32 == 0) { Entity_NPC::PlaySound(npc,0x74,0.8,0x28,0,1.0); } if (npc->_controllerID == -1) { uVar4 = Random(); bVar3 = uVar4 % 0x32 == 0; } else { bVar3 = Entity_NPC::IsControllerActionPressed(npc,9); } if (bVar3 == 0) { ExceptionList = local_1c; return; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar3 != 0) { ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0x26,1.0,2,0,1.0); npc->_state = 6; pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_108.y = (pEVar6->_pos).x; local_110.y = (pEVar6->_pos).y; pEVar6 = Entity_NPC::GetPlayerTarget(npc); game = g_game; pVVar5 = &npc->_targetPosition; local_110.y = (pEVar6->_velocity).y * 10.0 + local_110.y; local_110.x = (pEVar6->_velocity).x * 10.0 + local_108.y; pVVar5->x = local_110.x; (npc->_targetPosition).y = local_110.y; local_108.y = (float)game->_room; pos.y = local_110.y; pos.x = local_110.x; iVar7 = Room::GetGridCollisionAtPos((Room *)local_108.y,pos); if (iVar7 != 0) { freePos = Room::FindFreePickupSpawnPosition((Room *)local_108.y,&local_110,pVVar5,120.0,0,0,0); pVVar5->x = freePos->x; (npc->_targetPosition).y = freePos->y; } (npc->_v1).x = 0.0; npc->_stateFrame = 0; ExceptionList = local_1c; return; } //@@ 00531350 NpcAI::ENTITY_COD_WORM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 221 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_COD_WORM(Entity_NPC *npc) { float fVar1; undefined4 uVar2; byte bVar3; Entity *target; uint uVar4; ProjectileParams *params; float *damageEvent; int iVar5; float fVar6; float fVar7; int iVar8; Vector *outInput; float soundPitch; float local_c0; Vector local_bc; ProjectileParams projParams; float local_8; void *animData; bool isShielded; Manager *manager; Room *room; local_8 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); if (npc->_state == 0) { npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_isInvicible = 1; return; } npc->_isInvicible = 0; fVar6 = (npc->_targetPosition).x; fVar7 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; fVar1 = npc->_friction; (npc->_velocity).x = fVar6 - fVar7; iVar8 = npc->_state; npc->_friction = fVar1 * 0.7; soundPitch = 1.0; if (iVar8 == 3) { ANM2::Play(&npc->_sprite,(byte *)"Pulse",0); if (0 < npc->_stateFrame) { npc->_stateFrame = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; } if (npc->_controllerID == -1) { target = Entity_NPC::GetPlayerTarget(npc); fVar6 = (target->_pos).y - (npc->_pos).y; fVar7 = (target->_pos).x - (npc->_pos).x; if (fVar6 * fVar6 + fVar7 * fVar7 <= 22500.0) { room = g_game->_room; target = Entity_NPC::GetPlayerTarget(npc); local_bc.x = (target->_pos).x; local_bc.y = (target->_pos).y; bVar3 = Room::CheckLine(room,&npc->_pos,&local_bc,3,999,0,0,(Vector *)0x0); if (bVar3 != 0) goto LAB_00531517; } if (0 < npc->_stateFrame) goto LAB_00531517; } else if (((npc->_v1).x < 1.0) && (bVar3 = Entity_NPC::IsControllerActionPressed(npc,9), bVar3 == 0)) { LAB_00531517: if ((npc->_flags & 0x200) == 0) goto LAB_005317cb; } npc->_state = 6; uVar4 = Random(); npc->_stateFrame = uVar4 % 0x28 + 0x50; ANM2::Play(&npc->_sprite,(byte *)"DigOut",0); } else if (iVar8 == 8) { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); Entity_NPC::UpdateControllerMovement(npc,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); target = Entity_NPC::GetPlayerTarget(npc); local_bc.x = (target->_pos).x; local_bc.y = (target->_pos).y; if (npc->_controllerID != -1) { local_bc.x = (npc->_controllerMovement).x * 180.0 + (npc->_pos).x; local_bc.y = (npc->_controllerMovement).y * 180.0 + (npc->_pos).y; } params = ProjectileParams::ProjectileParams(&projParams); uVar4 = Random(); local_c0 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0; uVar4 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar4 & 3) + 5,&local_bc,local_c0,params); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_005317cb; } npc->_state = 3; ANM2::Play(&npc->_sprite,(byte *)"Pulse",0); } else if (iVar8 == 6) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"PulseOut",0); } iVar8 = npc->_stateFrame + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_stateFrame = iVar8; if (npc->_controllerID == -1) { if (iVar8 < 1) goto LAB_00531770; } else { animData = (npc->_sprite)._animState._animData; if ((((animData != (void *)0x0) && (*(char *)((int)animData + 0x34) != '\0')) && ((npc->_v1).x <= 0.8 && (npc->_v1).x != 0.8)) && ((bVar3 = Entity_NPC::IsControllerActionPressed(npc,9), bVar3 != 0 || (bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar3 != 0)))) { LAB_00531770: npc->_state = 7; ANM2::Play(&npc->_sprite,(byte *)"DigIn",0); fVar6 = (npc->_v1).x - 0.2; if (fVar6 <= 0.0) { fVar6 = 0.0; } (npc->_v1).x = fVar6; } } } else if ((iVar8 == 7) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { npc->_state = 3; } LAB_005317cb: iVar8 = npc->_state; if ((((iVar8 == 3) || (iVar8 == 8)) || (iVar8 == 7)) || ((iVar8 == 6 && ((animData = (npc->_sprite)._animState._animData, animData == (void *)0x0 || (*(char *)((int)animData + 0x34) == '\0')))))) { isShielded = true; } else { isShielded = false; } if (npc->_pendingDamage <= 0.0) { LAB_00531891: if (npc->_controllerID == -1) goto LAB_005319d4; } else { fVar6 = 0.0; if ((isShielded) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (((uint)damageEvent[2] & 0x8000) == 0) { fVar6 = fVar6 + *damageEvent; *damageEvent = 0.0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } if (npc->_controllerID == -1) { if ((((npc->_state == 3) || (npc->_state == 8)) && (0.0 < fVar6)) && ((npc->_flags & 0x1000800) == 0)) { npc->_state = 8; iVar8 = npc->_stateFrame + (int)fVar6 * 2; iVar5 = 0x1e; if (iVar8 < 0x1e) { iVar5 = iVar8; } npc->_stateFrame = iVar5; } goto LAB_00531891; } } outInput = (Vector *)0x1; iVar8 = 0x5318ba; Entity_NPC::UpdateChargeBar(npc,1.0,0.0,(npc->_v1).x,1); if (npc->_state == 3) { outInput = (Vector *)&DAT_00000007; iVar8 = 0; bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar3 != 0) { if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar6 = g_vectorZero.y; } else { outInput = &local_bc; iVar8 = 0x531913; Entity_NPC::GetControllerMovementInput(npc,outInput,0.1); (npc->_controllerMovement).x = local_bc.x; fVar6 = local_bc.y; } (npc->_controllerMovement).y = fVar6; npc->_state = 8; } } if (isShielded) { bVar3 = Entity::IsPlayerInRadius((Entity *)npc,&npc->_pos,150.0,iVar8,(int)outInput); fVar6 = (npc->_v1).x; fVar7 = npc->_speedMultiplier / 150.0; if (bVar3 == 0) { fVar6 = fVar6 + fVar7; if (1.0 <= fVar6) { fVar6 = 1.0; } (npc->_v1).x = fVar6; } else { fVar6 = fVar6 - fVar7; if (fVar6 <= 0.0) { fVar6 = 0.0; } (npc->_v1).x = fVar6; } } else { fVar6 = (npc->_v1).x - (npc->_speedMultiplier * 1.5) / 150.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } (npc->_v1).x = fVar6; } LAB_005319d4: uVar4 = (uint)npc->_flags; uVar2 = *(undefined4 *)((int)&npc->_flags + 4); if (npc->_state == 6) { uVar4 = uVar4 & 0xffffffef; } else { uVar4 = uVar4 | 0x10; } *(uint *)&npc->_flags = uVar4; *(undefined4 *)((int)&npc->_flags + 4) = uVar2; if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b61110); manager = g_manager; if (bVar3 == 0) { return; } if (npc->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (npc->_championColorIdx == 0x13) { soundPitch = 0.5; } local_c0 = 2.8026e-45; seed_fart_sound_override((int *)&local_c0); SoundEffects::Play(&manager->_sfxManager,(int)local_c0,1.0,2,0,soundPitch,0.0); return; } //@@ 00531ab0 NpcAI::ENTITY_BABY_LONG_LEGS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 206 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BABY_LONG_LEGS(Entity_NPC *npc) { byte bVar1; Entity_Player *burstingSackOwner; Entity *target; int iVar2; void *pvVar3; uint uVar4; bool isStartAttack; float rngFloat; Vector oppositeVelocity; Vector local_118; char isPassive; Vector scratchVec; ProjectileParams projParams; void *walkAnimVert; char local_50; uint local_44; uint local_40; void *walkAnimHori; char local_38; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af4745; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; burstingSackOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x179,(RNG **)&g_game->_playerManager,1); if ((burstingSackOwner == (Entity_Player *)0x0) || ((npc->_flags & 0x20000000) != 0)) { isPassive = '\0'; } else { isPassive = '\x01'; } iVar2 = npc->_state; if (iVar2 == 0) { npc->_state = 4; ExceptionList = local_1c; return; } if (iVar2 == 4) { (npc->_sprite)._playbackSpeed = 1.0; local_118.y = *(float *)((int)&npc->_flags + 4); if (npc->_type == 0xce) { if (((npc->_flags & 0x200) == 0) && (isPassive == '\0')) { if (npc->_controllerID == -1) { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); } else { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.65,900,1); } uVar4 = 100; if (npc->_variant == 1) { uVar4 = 200; } iVar2 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar2 < 6) { if (npc->_controllerID == -1) { if ((((npc->_pathfinder)._evadeMovementCountdown < 1) && (iVar2 = Isaac::Random(uVar4 >> 1), iVar2 == 0)) || (iVar2 = Isaac::Random(uVar4), iVar2 == 0)) goto LAB_00531c82; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if ((bVar1 != 0) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { LAB_00531c82: bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); isStartAttack = bVar1 == 0; LAB_00531dd2: if (isStartAttack) goto LAB_00531dd4; } } } } else { LAB_00531de0: if (npc->_controllerID == -1) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } else { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.65,900,1); } } } else if ((npc->_flags & 0x1000800) == 0) { bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200); if ((bVar1 != 0) || (isPassive != '\0')) goto LAB_00531de0; target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.65,900,1); if (npc->_controllerID == -1) { if ((npc->_pathfinder)._hasDirectPath != 0) { uVar4 = Random(); isStartAttack = uVar4 % 0x32 == 0; goto LAB_00531dd2; } } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if ((bVar1 != 0) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { LAB_00531dd4: npc->_state = 8; } } } else if (npc->_controllerID == -1) { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); } else { target = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (target->_pos).x; scratchVec.y = (target->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.65,900,1); } local_40 = 0xf; local_44 = 4; walkAnimVert = (void *)0x6b6c6157; local_50 = '\0'; local_28 = 0xf; local_2c = 4; walkAnimHori = (void *)0x6b6c6157; local_38 = '\0'; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimHori,(std_string *)&walkAnimVert,0.1); if (0xf < local_28) { uVar4 = local_28 + 1; pvVar3 = walkAnimHori; if (0xfff < uVar4) { pvVar3 = *(void **)((int)walkAnimHori + -4); uVar4 = local_28 + 0x24; if (0x1f < (uint)((int)walkAnimHori + (-4 - (int)pvVar3))) goto LAB_00531ef4; } operator_delete(pvVar3,uVar4); } local_2c = 0; local_28 = 0xf; walkAnimHori = (void *)((uint)walkAnimHori & 0xffffff00); if (0xf < local_40) { uVar4 = local_40 + 1; pvVar3 = walkAnimVert; if (0xfff < uVar4) { pvVar3 = *(void **)((int)walkAnimVert + -4); uVar4 = local_40 + 0x24; if (0x1f < (uint)((int)walkAnimVert + (-4 - (int)pvVar3))) { LAB_00531ef4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } npc->_friction = 0.8; ExceptionList = local_1c; return; } if (iVar2 != 8) { ExceptionList = local_1c; return; } if (npc->_type == 0xce) { ANM2::Play(&npc->_sprite,(byte *)"Lay Egg",0); if (npc->_controllerID != -1) { (npc->_sprite)._playbackSpeed = 1.5; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b61144); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x9f,1.0,2,0,1.0); if (npc->_variant == 0) { MusicManager::RandomVector(&scratchVec); uVar4 = Random(); Game::Spawn(g_game,0x55,0,&npc->_pos,&scratchVec,(Entity *)npc,0,uVar4); uVar4 = Random(); if (uVar4 % 0x14 == 0) { uVar4 = Random(); oppositeVelocity.x = -scratchVec.x; oppositeVelocity.y = -scratchVec.y; Game::Spawn(g_game,0x55,0,&npc->_pos,&oppositeVelocity,(Entity *)npc,0,uVar4); } } else if (npc->_variant == 1) { uVar4 = Random(); Game::Spawn(g_game,0x1e,2,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); uVar4 = Random(); Game::Spawn(g_game,1000,0x19,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar4); } } LAB_00532175: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053218e; } } else { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); if (npc->_controllerID != -1) { (npc->_sprite)._playbackSpeed = 1.5; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); iVar2 = npc->_variant; projParams.FallingAccelModifier = 0.5; projParams.FallingSpeedModifier = -10.0; projParams.HeightModifier = 10.0; uVar4 = Random(); local_118.y = 0.0; rngFloat = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; local_118.x = rngFloat + rngFloat + 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_118,8 - (iVar2 != 0),&projParams); } goto LAB_00532175; } } npc->_state = 4; LAB_0053218e: npc->_friction = npc->_friction * 0.5; ExceptionList = local_1c; return; } //@@ 005321d0 NpcAI::ENTITY_MOBILE_HOST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 204 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOBILE_HOST(Entity_NPC *npc) { byte bVar1; int cappedStateFrame; byte *animNameChar; Entity *tmpEntity; Vector *aimTargetPos; ProjectileParams *params; float *pfVar2; ColorMod *color; void *pvVar3; int cappedStateFrame; char *expectedName; uint uVar5; bool isLess; float fVar6; float fVar7; Vector local_114; Vector local_10c; ProjectileParams projParams; undefined1 local_58 [24]; float local_40; undefined1 local_3c; float local_34; float local_30; void *walkHoriAnim; char local_28 [12]; uint walkHoriAnimSize; uint walkHoriAnimCapacity; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 flagsHigh; bool isArmoredHost; local_8 = 0xffffffff; puStack_c = &LAB_00af4785; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_28 + 0x24); if ((npc->_type == 0xcc) && (npc->_subtype != 99)) { isArmoredHost = true; } else { isArmoredHost = false; } if (npc->_state == 0) { npc->_state = 4; npc->_stateFrame = 0; if (!isArmoredHost) { return; } npc->_isInvicible = 1; return; } pvVar3 = (npc->_sprite)._overlayAnimState._animData; ExceptionList = &local_10; npc->_isInvicible = 0; if (pvVar3 == (void *)0x0) { ANM2::PlayOverlay(&npc->_sprite,s_Idle,0); } local_30 = 2.10195e-44; local_34 = 1.12104e-44; local_58[0x14] = 'W'; local_58[0x15] = 'a'; local_58[0x16] = 'l'; local_58[0x17] = 'k'; local_40 = (float)0x74726556; local_3c = 0; walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_28,"Hori",5); local_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)(local_58 + 0x14),0.1); local_8 = local_8 & 0xffffff00; if (0xf < walkHoriAnimCapacity) { uVar5 = walkHoriAnimCapacity + 1; pvVar3 = walkHoriAnim; if (0xfff < uVar5) { pvVar3 = *(void **)((int)walkHoriAnim + -4); uVar5 = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)pvVar3))) goto LAB_00532340; } operator_delete(pvVar3,uVar5); } local_8 = 0xffffffff; walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < (uint)local_30) { uVar5 = (int)local_30 + 1; pvVar3 = (void *)local_58._20_4_; if (0xfff < uVar5) { pvVar3 = *(void **)(local_58._20_4_ + -4); uVar5 = (int)local_30 + 0x24; if (0x1f < (uint)(local_58._20_4_ + (-4 - (int)pvVar3))) { LAB_00532340: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar5); } if ((isArmoredHost) && (0.0 < npc->_pendingDamage)) { local_10c.y = 0.0; if (((npc->_state == 4) || ((npc->_state == 8 && ((bVar1 = AnimationState::WasEventTriggered (&(npc->_sprite)._overlayAnimState,(byte *)"Invincible"), bVar1 != 0 || (bVar1 = AnimationState::WasEventTriggered (&(npc->_sprite)._overlayAnimState,(byte *)"Destructible"), bVar1 == 0) ))))) && (pfVar2 = (npc->_damageEvents)._begin, pfVar2 != (npc->_damageEvents)._end)) { do { local_114.y = pfVar2[3]; if (((uint)pfVar2[2] & 0x8000) == 0) { if (((uint)pfVar2[2] & 0x408000) == 0) { local_10c.y = local_10c.y + *pfVar2; } *pfVar2 = 0.0; } pfVar2 = pfVar2 + 0xe; } while (pfVar2 != (npc->_damageEvents)._end); } if ((npc->_state == 4) && (0.0 < local_10c.y)) { fVar6 = (npc->_v2).x - npc->_pendingDamage * 0.05; cappedStateFrame = npc->_stateFrame + (int)(npc->_pendingDamage + 0.5) / 2; if (fVar6 <= 0.0) { fVar6 = 0.0; } cappedStateFrame = 10; if (cappedStateFrame < 10) { cappedStateFrame = cappedStateFrame; } npc->_stateFrame = cappedStateFrame; (npc->_v2).x = fVar6; if (20.0 < local_10c.y) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"Bombed",0); (npc->_v2).x = 0.0; } } } if (npc->_controllerID != -1) { if ((npc->_flags & 0x10) == 0) { LAB_00532567: fVar6 = (npc->_v2).y - (npc->_speedMultiplier + npc->_speedMultiplier) / 90.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } (npc->_v2).y = fVar6; if (!isArmoredHost) { (npc->_v2).y = 0.0; fVar6 = 0.0; } } else { if (((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) { animNameChar = (npc->_sprite)._overlayAnimState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } expectedName = "Bombed"; do { bVar1 = *animNameChar; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_00532500: uVar5 = -(uint)isLess | 1; goto LAB_00532505; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00532500; animNameChar = animNameChar + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00532505: if (uVar5 == 0) goto LAB_00532567; } if (!isArmoredHost) goto LAB_00532567; local_10c.y = 1.0; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar1 == 0) { fVar6 = local_10c.y; } else { fVar6 = 2.0; } fVar6 = (fVar6 * npc->_speedMultiplier) / 90.0 + (npc->_v2).y; if (1.0 <= fVar6) { fVar6 = 1.0; } (npc->_v2).y = fVar6; } Entity_NPC::UpdateChargeBar(npc,1.0,0.0,fVar6,1); } cappedStateFrame = npc->_state; if (cappedStateFrame != 4) { if (cappedStateFrame == 9) { bVar1 = AnimationState::IsEventTriggered (&(npc->_sprite)._overlayAnimState,(byte *)"Destructible"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0xa6,1.0,2,0,1.0); } npc->_stateFrame = npc->_stateFrame + 1; if (isArmoredHost) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffef; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } ANM2::PlayOverlay(&npc->_sprite,(byte *)"Shoot",0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); (npc->_sprite)._flipX = (tmpEntity->_pos).x - (npc->_pos).x < 0.0; if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; ANM2::PlayOverlay(&npc->_sprite,s_Idle,0); } } else { if (cappedStateFrame != 8) { ExceptionList = local_10; return; } bVar1 = AnimationState::IsEventTriggered (&(npc->_sprite)._overlayAnimState,(byte *)"Destructible"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0xa6,1.0,2,0,1.0); } if ((npc->_controllerID != -1) && (bVar1 = AnimationState::WasEventTriggered (&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"), bVar1 == 0)) { bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (bVar1 == 0) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); aimTargetPos = Entity_NPC::GetAimTargetPosition(npc,&local_114); fVar6 = aimTargetPos->y - (npc->_pos).y; (npc->_controllerMovement).x = aimTargetPos->x - (npc->_pos).x; } else { (npc->_controllerMovement).x = g_vectorZero.x; fVar6 = g_vectorZero.y; } (npc->_controllerMovement).y = fVar6; } npc->_stateFrame = npc->_stateFrame + 1; if (isArmoredHost) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffef; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } ANM2::PlayOverlay(&npc->_sprite,(byte *)"Shoot",0); if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar6 = (tmpEntity->_pos).x - (npc->_pos).x; } else { fVar6 = (npc->_controllerMovement).x; } (npc->_sprite)._flipX = fVar6 < 0.0; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar1 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (tmpEntity->_pos).x - (npc->_pos).x; local_10c.y = (tmpEntity->_pos).y - (npc->_pos).y; if (npc->_controllerID != -1) { local_10c.x = (npc->_controllerMovement).x; local_10c.y = (npc->_controllerMovement).y; } if ((local_10c.x != g_vectorZero.x) || (local_10c.y != g_vectorZero.y)) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); fVar6 = sqrtf(local_10c.y * local_10c.y + local_10c.x * local_10c.x); if (0.0 < fVar6) { local_10c.x = local_10c.x * (7.0 / fVar6); local_10c.y = local_10c.y * (7.0 / fVar6); } params = ProjectileParams::ProjectileParams(&projParams); uVar5 = 5; if (npc->_type == 0xcc) { uVar5 = 2; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_10c,uVar5,params); } } bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,&DAT_00b1d534); if ((bVar1 != 0) && ((npc->_controllerID == -1 || (bVar1 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar1 != 0)))) { pfVar2 = AnimationState::GetNullFrame(&(npc->_sprite)._overlayAnimState,(byte *)"PoofPos"); fVar6 = g_vectorZero.x; fVar7 = g_vectorZero.y; if (pfVar2 != (float *)0x0) { fVar6 = *pfVar2; fVar7 = pfVar2[1]; } Color::Color((Color *)local_58); local_10c.x = 0.0; local_10c.y = -6.0; local_114.x = fVar6 / 0.65 + (npc->_pos).x; local_114.y = fVar7 / 0.65 + (npc->_pos).y; tmpEntity = spawn_blood_explosion(1,&local_114,&local_10c,color,&g_vectorZero); (tmpEntity->_sprite)._scale.x = 0.75; (tmpEntity->_sprite)._scale.y = 0.75; tmpEntity->_renderDepthOffset = 100.0; } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; ANM2::PlayOverlay(&npc->_sprite,s_Idle,0); (npc->_v2).y = 0.0; } } fVar6 = npc->_friction * 0.5; goto LAB_00532cc9; } local_114.y = *(float *)((int)&npc->_flags + 4); if (isArmoredHost) { *(uint *)&npc->_flags = (uint)npc->_flags | 0x10; *(float *)((int)&npc->_flags + 4) = local_114.y; } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (tmpEntity->_pos).x; local_10c.y = (tmpEntity->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_10c,0.5,300,1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (tmpEntity->_pos).x; local_10c.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_10c,0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } if (npc->_stateFrame < 1) { ANM2::PlayOverlay(&npc->_sprite,s_Idle,0); } if (npc->_controllerID == -1) { if (npc->_stateFrame < 1) { if ((((npc->_flags & 0x200) != 0) || (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar1 != 0)) && (uVar5 = Random(), uVar5 % 0x32 == 0)) { npc->_state = 9; npc->_stateFrame = 0; } if ((((npc->_stateFrame < 1) && (uVar5 = Random(), uVar5 % 3 == 0)) && ((npc->_projectileCooldown < 1 || (cappedStateFrame = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime), npc->_projectileCooldown = cappedStateFrame, cappedStateFrame < 1)))) && (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,240.0,0,7), bVar1 != 0)) goto LAB_005327b6; } } else if ((1.0 <= (npc->_v2).y) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { (npc->_controllerMovement).x = g_vectorZero.x; (npc->_controllerMovement).y = g_vectorZero.y; LAB_005327b6: npc->_projectileCooldown = 0x46; npc->_stateFrame = 0; npc->_state = 8; } if (((npc->_state != 8) && (cappedStateFrame = Entity::GetIntervalTicks((Entity *)npc,7.0,0.0), cappedStateFrame != 0)) && (0 < npc->_stateFrame)) { npc->_stateFrame = npc->_stateFrame + -1; } fVar6 = npc->_friction * 0.8; LAB_00532cc9: npc->_friction = fVar6; ExceptionList = local_10; return; } //@@ 00532cf0 NpcAI::ENTITY_DEATHS_HEAD /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 212 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DEATHS_HEAD(Entity_NPC *npc) { float fVar1; byte bVar2; uint uVar3; EntityPtr aura; Entity_Player *player; uint uVar4; int iVar5; Entity_Effect *laserWarning; Vector *pVVar6; Entity *pEVar7; Entity_Laser *laser; int aliveEnemies; int extraout_ECX; int extraout_ECX_00; EntityPtr *player; float fVar9; float fVar10; undefined1 auStack_148 [4]; float local_144; float local_140; EntityPtr *local_13c; Vector local_138; float local_130; Vector local_12c; Vector local_124; EntityPtr *frameDelta; Vector ringPos; undefined4 local_110 [8]; undefined4 local_f0; undefined4 uStack_ec; undefined4 local_e8; ColorMod local_e4; ProjectileParams projParams; uint local_c; uint *flagsHighPtr; float speedMult; float *velocityY; local_c = __security_cookie ^ (uint)auStack_148; player = (EntityPtr *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); iVar5 = npc->_state; frameDelta = player; if (iVar5 == 0) { npc->_state = 4; npc->_entityGridCollisionClass = 3; if (((npc->_type == 0xd4) && (npc->_variant != 1)) && (npc->_variant != 4)) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHighPtr = (uint *)((int)&npc->_flags + 4); *flagsHighPtr = *flagsHighPtr | 8; npc->_isInvicible = 1; } uVar3 = Random(); fVar9 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_13c = (EntityPtr *)(fVar9 + fVar9); local_130 = cos((float)local_13c); fVar9 = sin((float)local_13c); (npc->_velocity).x = local_130; (npc->_velocity).y = fVar9; iVar5 = npc->_type; if (iVar5 != 0x11e) { local_f0 = 0x3dcccccd; uStack_ec = 0x3dcccccd; local_e8 = 0x3dcccccd; if (&npc->_splatColor != (ColorMod *)local_110) { (npc->_splatColor)._offset[0] = 0.1; (npc->_splatColor)._offset[1] = 0.1; (npc->_splatColor)._tint[0] = 0.15; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.1; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; iVar5 = npc->_type; } } if (iVar5 != 0xd4) { return; } if (npc->_variant != 2) { return; } uVar3 = Random(); aura = (EntityPtr) Game::SpawnEx(g_game,1000,0x7b,&npc->_pos,&g_vectorZero,(Entity *)npc,3,uVar3,0); ((Vector *)((int)aura + 0xdc))->x = 0.0; *(float *)((int)aura + 0xe0) = -15.0; if (*(EntityPtr *)((int)aura + 0x3bc) != (EntityPtr)0x0) { local_13c = (EntityPtr *)((int)aura + 0x3bc); std::multiset::erase(&local_13c); } *(EntityPtr *)((int)aura + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)aura + 0x3bc)); fVar9 = ((Vector *)((int)aura + 0x33c))->x; fVar10 = (npc->_pos).x; fVar1 = (npc->_pos).y; player = &npc->_child; *(undefined1 *)((int)aura + 0x464) = 1; *(float *)((int)aura + 0x468) = fVar9 - fVar10; *(float *)((std_string *)((int)aura + 0x46c))->_buf = *(float *)((int)aura + 0x340) - fVar1; if (*player != (EntityPtr)0x0) { local_13c = player; std::multiset::erase(&local_13c); } *player = aura; std::multiset::insert(player); return; } fVar9 = npc->_friction * 0.9; npc->_friction = fVar9; if (iVar5 == 4) { ANM2::Play(&npc->_sprite,s_Idle,0); if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { fVar9 = 0.45; local_144 = 0.45; if ((npc->_type == 0xd4) && (npc->_variant == 4)) { fVar9 = 0.35999998; local_144 = 0.35999998; } fVar10 = -fVar9; local_140 = fVar9; if ((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) { local_140 = fVar10; } velocityY = &(npc->_velocity).y; if (*velocityY <= 0.0 && *velocityY != 0.0) { fVar9 = fVar10; local_144 = fVar10; } fVar10 = local_140; if (npc->_controllerID != -1) { pVVar6 = Entity_NPC::GetControllerInput(npc,&local_12c,0.0); fVar10 = sqrtf(local_140 * local_140 + local_144 * local_144); fVar9 = local_144 + fVar10 * 0.5 * pVVar6->y; fVar10 = fVar10 * 0.5 * pVVar6->x + local_140; } fVar1 = npc->_friction; if (fVar1 != 0.0) { speedMult = npc->_speedMultiplier; (npc->_velocity).y = (speedMult * fVar9) / fVar1 + (npc->_velocity).y; (npc->_velocity).x = (speedMult * fVar10) / fVar1 + (npc->_velocity).x; } } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } if (npc->_type == 0xd4) { if (npc->_variant == 2) { uVar3 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar3); if ((player->_entityCollisionClass != 0) && (fVar10 = (npc->_pos).x - (player->_pos).x, fVar9 = (npc->_pos).y - (player->_pos).y, fVar9 * fVar9 + fVar10 * fVar10 < 4900.0)) { local_e4._tint[0] = (float)npc->_type; local_e4._colorize[0] = (npc->_pos).x; local_e4._colorize[1] = (npc->_pos).y; local_e4._tint[1] = (float)npc->_variant; local_e4._tint[2] = (float)npc->_spawnerType; local_e4._tint[3] = (float)npc->_spawnerVariant; local_e4._colorize[2] = (npc->_velocity).x; local_e4._colorize[3] = (npc->_velocity).y; local_144 = (float)(uint)((npc->_flags & 0x100) != 0); local_140 = 2.8026e-45; if ((npc->_flags & 0x20000000) == 0) { local_140 = 0.0; } if ((npc->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } local_e4._offset[0] = (float)(uVar4 | (uint)local_140 | (uint)local_144); local_e4._offset[1] = (float)npc; Entity::AddFear((Entity *)player,(EntityRef *)&local_e4,-0x2d,0); } uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } else if (npc->_variant == 3) { if (npc->_controllerID == -1) { bVar2 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&npc->_pos); if ((bVar2 != 0) && (uVar3 = 0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,uVar3); if (player->_entityCollisionClass != 0) { local_138.x = ((player->_velocity).x * 5.0 + (player->_pos).x) - (npc->_pos).x; local_138.y = ((player->_velocity).y * 5.0 + (player->_pos).y) - (npc->_pos).y; if ((ABS(local_138.x) <= 24.0) || (ABS(local_138.y) <= 24.0)) { iVar5 = vector_to_direction(&local_138); if (iVar5 != -1) { npc->_i1 = iVar5; npc->_state = 8; (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; bVar2 = ANM2::SetAnimation(&npc->_sprite,(&PTR_s_AttackLeft_00b60af0)[npc->_i1], 1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } uVar3 = Random(); local_138.x = (npc->_pos).x + 0.0; local_138.y = (npc->_pos).y - 20.0; laserWarning = (Entity_Effect *) Game::SpawnEx(g_game,1000,0xc6,&local_138,&g_vectorZero, (Entity *)0x0,0,uVar3,0); Entity_Effect::FollowParent(laserWarning,(Entity *)npc); local_e4._offset[0] = 0.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; local_e4._offset[1] = 0.0; local_e4._offset[2] = 0.0; local_e4._tint[0] = 0.6; local_e4._tint[1] = 0.05; local_e4._tint[2] = 0.0; local_e4._tint[3] = 0.6; Sprite::SetColor((Sprite *)&laserWarning->_sprite,&local_e4); fVar9 = g_vectorOne.x * 4.0; (laserWarning->_sprite)._scale.y = g_vectorOne.y * 4.0; (laserWarning->_sprite)._scale.x = fVar9; pVVar6 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_12c,npc->_i1); fVar9 = pVVar6->y; iVar5 = *(int *)laserWarning; (laserWarning->_targetPosition).x = pVVar6->x; (laserWarning->_targetPosition).y = fVar9; laserWarning->_timeout = 0x17; laserWarning->_lifespan = 0x17; (**(code **)(iVar5 + 0xc))(); } break; } } uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } else if ((npc->_projectileCooldown < 1) && ((Entity_NPC::GetControllerMovementInput(npc,&local_138,0.1), local_138.x != g_vectorZero.x || (local_138.y != g_vectorZero.y)))) { npc->_state = 8; iVar5 = vector_to_direction(&local_138); npc->_i1 = iVar5; (npc->_v1).x = (npc->_velocity).x; (npc->_v1).y = (npc->_velocity).y; bVar2 = ANM2::SetAnimation(&npc->_sprite,(&PTR_s_AttackLeft_00b60af0)[npc->_i1],1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } } else if (((npc->_variant == 4) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar2 == 0)) && (npc->_projectileCooldown < 1)) { if (npc->_controllerID == -1) { bVar2 = Entity::IsFrame((Entity *)npc,6,0); if (bVar2 == 0) goto LAB_0053398b; pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (npc->_pos).y - (pEVar7->_pos).y; fVar10 = (npc->_pos).x - (pEVar7->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); fVar10 = (npc->_pos).x - (fVar9 * 0.1 * (pEVar7->_velocity).x + (pEVar7->_pos).x); fVar9 = (npc->_pos).y - (fVar9 * 0.1 * (pEVar7->_velocity).y + (pEVar7->_pos).y); if (10000.0 <= fVar9 * fVar9 + fVar10 * fVar10) goto LAB_0053398b; } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar2 == 0) && (bVar2 = Entity_NPC::IsControllerActionPressed(npc,9), bVar2 == 0)) goto LAB_0053398b; } npc->_state = 8; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_projectileCooldown = 0; } } goto LAB_0053398b; } if ((iVar5 != 8) || (npc->_friction = fVar9 * 0.6, npc->_type != 0xd4)) goto LAB_0053398b; if (npc->_variant == 3) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { Entity::GetNullOffset((Entity *)npc,&local_138,(byte *)"LaserPos"); local_124.y = (npc->_pos).y; local_124.x = (npc->_pos).x + local_138.x; local_138.x = 0.0; laser = Entity_Laser::ShootAngle (1,&local_124,(float)npc->_i1 * 90.0 + 180.0,0x10,&local_138,(Entity *)npc ,0); if (npc->_i1 == 1) { fVar9 = -10.0; } else { fVar9 = 3000.0; } laser->_renderDepthOffset = fVar9; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053398b; } npc->_projectileCooldown = 0x3c; } else { if (npc->_variant != 4) goto LAB_0053398b; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) { iVar5 = npc->_projectileCooldown; if (iVar5 + 6U < 6) goto LAB_00533802; } else { Entity_NPC::PlaySound(npc,0x6a,1.0,2,0,1.0); npc->_projectileCooldown = -1; iVar5 = -1; LAB_00533802: if (0 < (int)player) { local_13c = player; do { if (iVar5 == -1) { local_140 = 40.0; local_130 = 5.60519e-45; LAB_00533838: iVar5 = 0; local_138.x = (float)(int)local_130; do { local_124.x = (((float)iVar5 * 360.0) / local_138.x) * 0.017453292; local_144 = cos(local_124.x); local_144 = local_144 * local_140; local_124.x = sin(local_124.x); ringPos.x = local_144 + (npc->_pos).x; local_124.x = local_124.x * local_140; ringPos.y = local_124.x + (npc->_pos).y; bVar2 = Room::IsPositionInRoom(g_game->_room,&ringPos,10.0); if (bVar2 != 0) { uVar3 = Random(); local_12c.x = local_144 + (npc->_pos).x; local_12c.y = local_124.x + (npc->_pos).y; pEVar7 = Game::SpawnEx(g_game,1000,0x93,&local_12c,&g_vectorZero,(Entity *)npc,0, uVar3,0); (**(code **)(*(int *)pEVar7 + 0xc))(); } iVar5 = iVar5 + 1; } while (iVar5 < (int)local_130); iVar5 = npc->_projectileCooldown; } else if (iVar5 == -6) { local_140 = 80.0; local_130 = 1.12104e-44; goto LAB_00533838; } iVar5 = iVar5 + -1; local_13c = (EntityPtr *)&local_13c[-1].field_0x3; npc->_projectileCooldown = iVar5; } while (local_13c != (EntityPtr *)0x0); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053398b; npc->_projectileCooldown = 0x1e; } npc->_state = 4; LAB_0053398b: if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - (int)frameDelta; } aliveEnemies = Entity_NPC::GetAliveEnemyCount(npc); iVar5 = extraout_ECX; if ((aliveEnemies < 1) && ((((*(char *)((int)g_game->_room + 0x7229) == '\0' || (*(int *)((int)g_game->_room + 0x11ec) < 9)) && (npc->_state != 0x12)) && ((npc->_type != 0xd4 || (npc->_variant != 1)))))) { npc->_state = 0x12; npc->_stateFrame = 0; Entity_NPC::PlaySound(npc,0x13c,1.0,0x3c,0,1.0); npc->_entityCollisionClass = 0; iVar5 = extraout_ECX_00; } if (((npc->_type == 0x11e) && (npc->_controllerID != -1)) && (bVar2 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,iVar5), bVar2 != 0)) { local_e4._tint[0] = 0.0; local_e4._tint[1] = 0.0; local_e4._tint[2] = 0.0; local_e4._tint[3] = 0.0; local_e4._colorize[0] = g_vectorZero.x; local_e4._colorize[1] = g_vectorZero.y; local_e4._colorize[2] = g_vectorZero.x; local_e4._colorize[3] = g_vectorZero.y; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; (**(code **)(*(int *)npc + 0x24))(&local_e4); } if ((((npc->_dead != 0) || (npc->_state == 0x12)) && (npc->_type == 0x11e)) && ((npc->_flags & 0x1000000) == 0)) { ProjectileParams::ProjectileParams(&projParams); uVar3 = Random(); local_12c.x = 7.0; local_12c.y = 6.0; projParams.CircleAngle = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 360.0 - 180.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_12c,9,&projParams); } return; } //@@ 00533b80 NpcAI::ENTITY_MOMS_HAND /* NPC AI for entity type 213 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOMS_HAND(Entity_NPC *npc) { byte bVar1; uint savedFlagsHigh; undefined4 *puVar3; uint uVar4; Entity *tmpEntity; byte *animNameChar; Entity_Player *player; Vector *vecResult; uint uVar5; int unused; char *animName; byte *targetAnimChar; int iVar6; bool isLess; float fVar7; float fVar8; float soundPitch; undefined4 *local_48; uint flagsHigh; float local_3c; Vector tmpVec; EntityRef sourceRef; byte *animData; Game *game; Manager *manager; Room *room; undefined4 savedFlagsHigh; int *startingRoomIdx; iVar6 = npc->_state; if (iVar6 == 0) { npc->_state = 4; npc->_entityGridCollisionClass = 0; npc->_entityCollisionClass = 0; savedFlagsHigh = Random(); npc->_stateFrame = -(savedFlagsHigh % 0x96); bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"JumpDown",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; soundPitch = 1.0; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; npc->_shadowSize = 0.0; manager = g_manager; if (npc->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (npc->_championColorIdx == 0x13) { soundPitch = 0.5; } local_48 = (undefined4 *)0x54; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&manager->_sfxManager,(int)local_48,1.0,10,0,soundPitch,0.0); Game::ShakeScreen(g_game,10); return; } local_3c = 0.0; if ((0.0 < npc->_pendingDamage) && (puVar3 = (npc->_damageEvents)._begin, puVar3 != (npc->_damageEvents)._end)) { do { if (((puVar3[2] & 4) != 0) && (puVar3[4] == 0x11f)) { *puVar3 = 0; } puVar3 = puVar3 + 0xe; } while (puVar3 != (npc->_damageEvents)._end); iVar6 = npc->_state; } npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_friction = npc->_friction * 0.6; if (((iVar6 == 6) || (iVar6 == 4)) || (iVar6 == 7)) { savedFlagsHigh = (uint)npc->_flags; flagsHigh = *(uint *)((int)&npc->_flags + 4); if (((savedFlagsHigh & 0x100) != 0) && (npc->_charmedCountdown < 3)) { sourceRef._type = npc->_type; sourceRef._position.x = (npc->_pos).x; sourceRef._position.y = (npc->_pos).y; sourceRef._flags = 3; sourceRef._variant = npc->_variant; sourceRef._spawnerType = npc->_spawnerType; sourceRef._velocity.x = (npc->_velocity).x; sourceRef._velocity.y = (npc->_velocity).y; sourceRef._spawnerVariant = npc->_spawnerVariant; if ((savedFlagsHigh & 0x20000000) == 0) { sourceRef._flags = 1; } if ((flagsHigh & 0x400000) == 0) { savedFlagsHigh = 0; } else { savedFlagsHigh = 4; } sourceRef._flags = sourceRef._flags | savedFlagsHigh; sourceRef._entity = npc; Entity::AddCharmed((Entity *)npc,&sourceRef,1,0,0); savedFlagsHigh = (uint)npc->_flags; flagsHigh = *(uint *)((int)&npc->_flags + 4); } if (((savedFlagsHigh & 0x200) != 0) && (npc->_confusionCountdown < 3)) { sourceRef._type = npc->_type; sourceRef._position.x = (npc->_pos).x; sourceRef._position.y = (npc->_pos).y; sourceRef._variant = npc->_variant; sourceRef._spawnerType = npc->_spawnerType; sourceRef._spawnerVariant = npc->_spawnerVariant; sourceRef._velocity.x = (npc->_velocity).x; sourceRef._velocity.y = (npc->_velocity).y; if ((savedFlagsHigh & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((flagsHigh & 0x400000) == 0) { uVar4 = 0; } else { uVar4 = 4; } sourceRef._flags = uVar4 | uVar5 | (uint)((savedFlagsHigh & 0x100) != 0); sourceRef._entity = npc; Entity::AddConfusion((Entity *)npc,&sourceRef,1,0); savedFlagsHigh = (uint)npc->_flags; flagsHigh = *(uint *)((int)&npc->_flags + 4); } if (((savedFlagsHigh & 0x800) != 0) && (npc->_fearCountdown < 3)) { sourceRef._type = npc->_type; sourceRef._position.x = (npc->_pos).x; sourceRef._position.y = (npc->_pos).y; sourceRef._variant = npc->_variant; sourceRef._spawnerType = npc->_spawnerType; sourceRef._spawnerVariant = npc->_spawnerVariant; sourceRef._velocity.x = (npc->_velocity).x; sourceRef._velocity.y = (npc->_velocity).y; if ((savedFlagsHigh & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((flagsHigh & 0x400000) == 0) { uVar4 = 0; } else { uVar4 = 4; } sourceRef._flags = uVar4 | uVar5 | (uint)((savedFlagsHigh & 0x100) != 0); sourceRef._entity = npc; Entity::AddFear((Entity *)npc,&sourceRef,1,0); savedFlagsHigh = (uint)npc->_flags; flagsHigh = *(uint *)((int)&npc->_flags + 4); } if (((savedFlagsHigh & 0x1000000) != 0) && (npc->_shrinkCountdown < 3)) { sourceRef._type = npc->_type; sourceRef._position.x = (npc->_pos).x; sourceRef._position.y = (npc->_pos).y; sourceRef._variant = npc->_variant; sourceRef._spawnerType = npc->_spawnerType; sourceRef._spawnerVariant = npc->_spawnerVariant; sourceRef._velocity.x = (npc->_velocity).x; sourceRef._velocity.y = (npc->_velocity).y; if ((savedFlagsHigh & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((flagsHigh & 0x400000) == 0) { uVar4 = 0; } else { uVar4 = 4; } sourceRef._flags = uVar4 | uVar5 | (uint)((savedFlagsHigh & 0x100) != 0); sourceRef._entity = npc; Entity::AddShrink((Entity *)npc,&sourceRef,1,0,0); } } iVar6 = npc->_state; if (iVar6 == 4) { iVar6 = npc->_stateFrame; fVar8 = ((float)iVar6 / 90.0) * 0.43333334; npc->_shadowSize = fVar8; if (0.43333334 < fVar8) { npc->_shadowSize = 0.43333334; } soundPitch = 1.0; if (npc->_controllerID == -1) { if (iVar6 < 0x4e) { if ((npc->_flags & 0x1000a00) == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar7 = (tmpEntity->_pos).x + 0.0; fVar8 = (tmpEntity->_pos).y + 1.0; } else { vecResult = Entity_NPC::CalcTargetPosition(npc,&tmpVec,0.0); local_48 = (undefined4 *)(vecResult->x - (npc->_pos).x); local_3c = vecResult->y - (npc->_pos).y; fVar8 = (float)local_48 * (float)local_48 + local_3c * local_3c; if (fVar8 <= 0.0) goto LAB_00534257; fVar7 = sqrtf(fVar8); if (fVar7 <= 0.0) { fVar8 = local_3c; puVar3 = local_48; } else { fVar8 = (1.0 / fVar7) * local_3c; puVar3 = (undefined4 *)((float)local_48 * (1.0 / fVar7)); } fVar7 = (float)puVar3 + (npc->_pos).x; fVar8 = fVar8 + (npc->_pos).y; } (npc->_pos).y = fVar8; (npc->_pos).x = fVar7; } } else { if (iVar6 < 0x5a) { fVar8 = 1.6; } else { fVar8 = 0.1; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,fVar8,0,1); if ((npc->_controllerID != -1) && (bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,unused), bVar1 != 0)) { npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime) * 2; } } LAB_00534257: manager = g_manager; if (0x59 < npc->_stateFrame) { if (npc->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (npc->_championColorIdx == 0x13) { soundPitch = 0.5; } local_3c = 2.8026e-45; seed_fart_sound_override((int *)&local_3c); SoundEffects::Play(&manager->_sfxManager,(int)local_3c,1.0,2,0,soundPitch,0.0); npc->_state = 7; npc->_stateFrame = 0; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"JumpDown",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 7; } goto LAB_0053479c; } if (iVar6 == 7) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); if ((bVar1 != 0) && (Entity_NPC::PlaySound(npc,0x30,1.0,2,0,1.0), npc->_type == 0x11f)) { savedFlagsHigh = Random(); do { uVar5 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5, 0); iVar6 = __RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); puVar3 = (undefined4 *)(iVar6 + 0x3bc); if (*(int *)(iVar6 + 0x3bc) != 0) { local_48 = puVar3; std::multiset::erase(&local_48); } *puVar3 = npc; std::multiset::insert(puVar3); *(float *)(iVar6 + 0x474) = local_3c; local_3c = local_3c + 360.0 / ((float)((savedFlagsHigh & 1) + 3) + 0.0); } while (local_3c < 360.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land); if (bVar1 != 0) { npc->_entityCollisionClass = 4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053479c; } } npc->_state = 3; npc->_stateFrame = 0; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } animName = "Stunned"; do { bVar1 = *animNameChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_005344c0: savedFlagsHigh = -(uint)isLess | 1; goto LAB_005344c5; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_005344c0; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar1 != 0); savedFlagsHigh = 0; LAB_005344c5: if ((savedFlagsHigh == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053479c; } animName = "Stunned"; } else { if (iVar6 != 3) { if (iVar6 == 6) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar1 != 0 )) { npc->_entityCollisionClass = 0; npc->_shadowSize = npc->_shadowSize * 0.7; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053479c; } else { if (iVar6 != 0x10) goto LAB_0053479c; savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; npc->_isInvicible = 1; npc->_health = npc->_maxHitPoints; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00534676: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b60954,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } targetAnimChar = &DAT_00b60954; do { bVar1 = *animNameChar; isLess = bVar1 < *targetAnimChar; if (bVar1 != *targetAnimChar) { LAB_00534660: savedFlagsHigh = -(uint)isLess | 1; goto LAB_00534665; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < targetAnimChar[1]; if (bVar1 != targetAnimChar[1]) goto LAB_00534660; animNameChar = animNameChar + 2; targetAnimChar = targetAnimChar + 2; } while (bVar1 != 0); savedFlagsHigh = 0; LAB_00534665: if ((savedFlagsHigh != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_00534676; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053479c; savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; npc->_isInvicible = 0; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; if ((npc->_i1 == 1) && (npc->_i2 == 0)) { savedFlagsHigh = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,savedFlagsHigh); if (0 < *(int *)&player->field_0x189c) { player->_isControlsEnabled = 1; player->_entityCollisionClass = 4; *(undefined4 *)&player->field_0x189c = 0; } savedFlagsHigh = savedFlagsHigh + 1; } while (savedFlagsHigh < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } game = g_game; startingRoomIdx = &g_game->_startingRoomIdx; g_game->_leaveDoor = -1; Game::StartRoomTransition(game,*startingRoomIdx,-1,1,(Entity_Player *)0x0,-1); } npc->_entityCollisionClass = 0; npc->_shadowSize = npc->_shadowSize * 0.7; } npc->_state = 4; npc->_stateFrame = 0; ANM2::SetFrame(&npc->_sprite,(std_string *)"JumpDown",0); goto LAB_0053479c; } if (npc->_stateFrame < 0x33) goto LAB_0053479c; npc->_state = 6; npc->_stateFrame = 0; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } targetAnimChar = &DAT_00b1e0e4; do { bVar1 = *animNameChar; isLess = bVar1 < *targetAnimChar; if (bVar1 != *targetAnimChar) { LAB_00534550: savedFlagsHigh = -(uint)isLess | 1; goto LAB_00534555; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < targetAnimChar[1]; if (bVar1 != targetAnimChar[1]) goto LAB_00534550; animNameChar = animNameChar + 2; targetAnimChar = targetAnimChar + 2; } while (bVar1 != 0); savedFlagsHigh = 0; LAB_00534555: if ((savedFlagsHigh == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053479c; } animName = &DAT_00b1e0e4; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0053479c: if ((npc->_dead != 0) && (npc->_type == 0x11f)) { savedFlagsHigh = Random(); iVar6 = (savedFlagsHigh & 1) + 2; do { room = g_game->_room; savedFlagsHigh = Random(); vecResult = Room::FindFreePickupSpawnPosition (room,&tmpVec,&npc->_pos, (float)((double)(int)savedFlagsHigh + __uint_to_double_fixup[-((int)savedFlagsHigh >> 0x1f)]) * 2.3283064e-10 * 80.0,0,0,0); Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,*vecResult,0,-30.0); iVar6 = iVar6 + -1; } while (iVar6 != 0); } return; } //@@ 00534860 NpcAI::ENTITY_DIP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 217 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DIP(Entity_NPC *npc) { byte bVar1; Entity_Player *owner; int iVar2; uint uVar3; Entity_Effect *splat; EntityRef *selfRef; Entity *target; Vector *vecResult; int iVar4; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; bool bVar5; float fVar6; float fVar7; float fVar8; float fVar9; EntityRef local_150; undefined4 local_128 [11]; undefined4 local_fc [11]; Vector local_d0; Vector local_c8; float local_c0; Vector local_bc; ProjectileParams projParams; float local_8; ColorMod *splatColor; local_8 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); if (((npc->_dead == 0) && ((owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x240,(RNG **)&g_game->_playerManager,1), owner != (Entity_Player *)0x0 || (bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xa3), bVar1 != 0)))) && ((owner = PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0x240,npc->_initSeed,(RNG **)0x0), owner != (Entity_Player *)0x0 || (owner = PlayerManager::RandomTrinketOwner (&g_game->_playerManager,0xa3,npc->_initSeed,(RNG **)0x0), owner != (Entity_Player *)0x0)))) { npc->_entityCollisionClass = 0; (**(code **)(*(int *)npc + 0x28))(); iVar4 = 0; if (npc->_type == 0xd9) { iVar2 = npc->_variant; if ((iVar2 == 1) || (iVar2 == 3)) { iVar4 = 2; } else if (iVar2 == 2) { Entity_Familiar::ThrowDip(0x14,&npc->_pos,(Entity *)owner); return; } } Entity_Familiar::ThrowDip(iVar4,&npc->_pos,(Entity *)owner); return; } iVar4 = npc->_state; if (iVar4 == 0) { splatColor = &npc->_splatColor; npc->_state = 3; if (splatColor != (ColorMod *)local_fc) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.25490198; (npc->_splatColor)._offset[1] = 0.16078432; splatColor->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.13725491; } if (npc->_variant != 2) { return; } if (splatColor == (ColorMod *)local_128) { return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.6; (npc->_splatColor)._offset[1] = 0.4; splatColor->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; return; } if (((npc->_type != 0x366) && ((npc->_type != 0xd9 || (npc->_variant != 3)))) || (iVar2 = 6, *(float *)((int)g_game->_room + 0x7240) <= 0.0)) { iVar2 = 5; } npc->_entityGridCollisionClass = iVar2; if ((iVar4 != 3) && (iVar4 != 0x10)) { if (iVar4 == 4) { ANM2::Play(&npc->_sprite,&DAT_00b1d6fc,0); npc->_friction = npc->_friction * 0.95; if (npc->_type == 0x366) { iVar4 = ANM2::GetFrame(&npc->_sprite); if ((iVar4 == 10) && ((uVar3 = Random(), uVar3 % 3 == 0 || (npc->_controllerID != -1)))) { npc->_state = 0x10; } else if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } } else { fVar6 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; if (fVar9 * fVar9 + fVar6 * fVar6 < 1.0) { npc->_state = 3; } } } goto LAB_00535042; } ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_state == 0x10) { LAB_00534bfc: npc->_state = 4; if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { if (npc->_type == 0x366) { uVar3 = Random(); if (uVar3 % 3 == 0) { target = Entity_NPC::GetPlayerTarget(npc); local_bc.x = (target->_pos).x - (npc->_pos).x; local_bc.y = (target->_pos).y - (npc->_pos).y; vecResult = Vector::Normalized(&local_bc,&local_c8); } else { vecResult = MusicManager::RandomVector(&local_d0); } local_c0 = vecResult->x; local_bc.y = vecResult->y; if (npc->_controllerID != -1) { vecResult = Entity_NPC::GetControllerInput(npc,&local_d0,0.0); local_c0 = vecResult->x; local_bc.y = vecResult->y; } uVar3 = Random(); fVar6 = *(float *)((int)g_game->_room + 0x7460); fVar9 = *(float *)((int)g_game->_room + 0x7464); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 5.0; fVar8 = fVar7 * local_bc.y; fVar7 = fVar7 * local_c0; if ((fVar6 != g_vectorZero.x) || (fVar9 != g_vectorZero.y)) { fVar7 = fVar7 - fVar6 * 8.0; fVar8 = fVar8 - fVar9 * 8.0; } goto LAB_00534cc0; } MusicManager::RandomVector(&local_bc); if (npc->_controllerID == -1) { local_c0 = local_bc.y; local_bc.y = local_bc.x; } else { vecResult = Entity_NPC::GetControllerInput(npc,&local_d0,0.0); local_bc.y = vecResult->x; local_c0 = vecResult->y; } uVar3 = Random(); bVar5 = npc->_variant == 1; fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; fVar9 = fVar6 * local_c0; fVar6 = fVar6 * local_bc.y; LAB_00534fb7: if (bVar5) goto LAB_00534fb9; LAB_00534fc7: fVar7 = npc->_friction; if (fVar7 == 0.0) goto LAB_00535017; fVar9 = (npc->_speedMultiplier * fVar9) / fVar7; (npc->_velocity).x = (npc->_speedMultiplier * fVar6) / fVar7 + (npc->_velocity).x; } else { if (npc->_type != 0x366) { target = Entity_NPC::GetPlayerTarget(npc); local_bc.x = (npc->_pos).x - (target->_pos).x; local_bc.y = (npc->_pos).y - (target->_pos).y; vecResult = Vector::Normalized(&local_bc,&local_c8); uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; fVar9 = fVar6 * vecResult->y; fVar6 = fVar6 * vecResult->x; if (npc->_variant != 1) { bVar5 = npc->_variant == 2; goto LAB_00534fb7; } LAB_00534fb9: fVar6 = fVar6 + fVar6; fVar9 = fVar9 + fVar9; goto LAB_00534fc7; } target = Entity_NPC::GetPlayerTarget(npc); local_bc.x = (npc->_pos).x - (target->_pos).x; local_bc.y = (npc->_pos).y - (target->_pos).y; vecResult = Vector::Normalized(&local_bc,&local_c8); uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 5.0; fVar8 = fVar7 * vecResult->y; fVar7 = fVar7 * vecResult->x; LAB_00534cc0: fVar6 = npc->_friction; if (fVar6 == 0.0) goto LAB_00535017; fVar9 = (fVar8 * npc->_speedMultiplier) / fVar6; (npc->_velocity).x = (fVar7 * npc->_speedMultiplier) / fVar6 + (npc->_velocity).x; } (npc->_velocity).y = fVar9 + (npc->_velocity).y; } else { if (npc->_controllerID == -1) { uVar3 = Random(); bVar5 = uVar3 % 10 == 0; } else { vecResult = Entity_NPC::GetControllerInput(npc,&local_c8,0.1); if ((vecResult->x == g_vectorZero.x) && (vecResult->y == g_vectorZero.y)) { bVar5 = false; } else { bVar5 = true; } } if (bVar5) goto LAB_00534bfc; } LAB_00535017: if (npc->_type == 0x366) { fVar6 = npc->_friction * 0.9; } else { fVar6 = npc->_friction * 0.8; } npc->_friction = fVar6; LAB_00535042: (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; uVar3 = Random(); iVar4 = extraout_ECX; if (uVar3 % 10 == 0) { uVar3 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); iVar4 = extraout_ECX_00; } if ((0.0 < npc->_pendingDamage) && (uVar3 = Random(), iVar4 = extraout_ECX_01, (uVar3 & 1) == 0)) { Entity_NPC::PlaySound(npc,0x3c,0.8,0xf,0,1.0); iVar4 = extraout_ECX_02; } if ((((npc->_type == 0xd9) && (npc->_variant == 3)) && (npc->_controllerID != -1)) && (bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,iVar4), bVar1 != 0)) { selfRef = EntityRef::EntityRef(&local_150); (**(code **)(*(int *)npc + 0x24))(selfRef); } if (((npc->_dead != 0) && (npc->_type == 0xd9)) && ((npc->_variant == 3 && ((npc->_flags & 0x1000000) == 0)))) { target = Entity_NPC::GetPlayerTarget(npc); local_bc.y = (target->_pos).x; local_c0 = (target->_pos).y; fVar9 = (npc->_pos).x - local_bc.y; fVar6 = (npc->_pos).y - local_c0; fVar6 = sqrtf(fVar6 * fVar6 + fVar9 * fVar9); local_bc.x = ((target->_velocity).x * 0.1 * fVar6 + local_bc.y) - (npc->_pos).x; local_bc.y = ((target->_velocity).y * 0.1 * fVar6 + local_c0) - (npc->_pos).y; vecResult = Vector::Normalized(&local_bc,&local_d0); local_c8.y = vecResult->y * 10.0; local_c8.x = vecResult->x * 10.0; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 5; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_c8,0,&projParams); } return; } //@@ 00535280 NpcAI::ENTITY_SQUIRT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Exceeded maximum restarts with more pending */ /* NPC AI for entity type 220 (from dispatcher 006c2990) */ Entity * __fastcall NpcAI::ENTITY_SQUIRT(Entity_NPC *npc) { EntityPtr *pEVar1; float fVar2; undefined4 uVar3; code *pcVar4; longlong lVar5; longlong lVar6; longlong lVar7; byte bVar8; char cVar9; int iVar10; uint uVar11; Entity *tmpEntity; Vector *pVVar12; Vector *pVVar13; Entity_Effect *splat; void *pvVar14; EntityRef *ref; Entity *spawnedNpc; int *piVar15; int unusedArg; uint uVar16; uint uVar17; PlayerManager *playerManager; int iVar18; Game *game; void **ppvVar19; bool bVar20; float fVar21; float fVar22; ulonglong uVar23; byte addEnemyKillScore; undefined1 auStack_2bc [4]; uint creepVariant; float local_2b4; uint creepSubtype; Game *spawnGame; Entity *local_2a8; int *local_2a4; uint uStack_2a0; float local_298; void **ppvStack_294; uint uStack_290; Vector *pVStack_288; undefined4 local_284; uint creepType; void *triggerIt; EntityPtr npcSaved; Vector slideDirAlt; Vector slideDir; Vector dashDir; uint collectibleKey; EntityPtr *spawnerPtrRef; EntityPtr *parentPtrRef; EntityRef charmSource; Vector childSpawnPos; Vector clotRightPos; Vector clotLeftPos; Vector dipRightPos; Vector dipLeftPos; Vector slideAltToTarget; Vector slideAltToAim; Vector slideToTarget; Vector slideToAim; Vector dashToTarget; Vector dashToAim; int triggerKeyType; int triggerKeyVariant; int triggerKeyTypeOnly [2]; Vector local_1c0 [2]; undefined8 rngShifts; undefined4 rngShift3; EntityRef brimstoneSource; EntityRef shrinkSource; float fStack_154; float fStack_150; float fStack_14c; float fStack_148; float fStack_144; float fStack_140; float fStack_13c; float fStack_138; float fStack_134; float fStack_130; float fStack_12c; float fStack_128; float fStack_124; float fStack_120; float fStack_11c; float fStack_118; undefined1 auStack_114 [4]; undefined1 auStack_110 [8]; int iStack_108; undefined1 local_104 [44]; undefined1 local_d8 [44]; Vector controllerInput; Vector calcTargetPos; Vector randomDir; Vector local_94; Vector local_8c; Vector local_84; Vector local_7c; Vector local_74; Vector local_6c; Vector local_64; Vector local_5c; Vector local_54; Vector local_4c; EntityRef charmRef; RNG cardRng; void *local_c; ProceduralItemManager *proceduralItemManager; EntityPtr spawner; ColorMod *splatColor; local_c = (void *)(__security_cookie ^ (uint)auStack_2bc); iVar18 = npc->_state; if (iVar18 == 0) { splatColor = &npc->_splatColor; npc->_state = 3; if (npc->_variant != 1) { if ((Entity *)splatColor == (Entity *)local_104) { return (Entity *)local_104; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.25490198; (npc->_splatColor)._offset[1] = 0.16078432; splatColor->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.13725491; return (Entity *)0x3e0c8c8d; } if ((Entity *)splatColor == (Entity *)local_d8) { return (Entity *)local_d8; } splatColor->_tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; return (Entity *)0x0; } if ((npc->_type != 0x367) || (iVar10 = 6, *(float *)((int)g_game->_room + 0x7240) <= 0.0)) { iVar10 = 5; } npc->_entityGridCollisionClass = iVar10; npcSaved = (EntityPtr)npc; if ((npc->_dead != 0) && (npc->_championRegenCount == 0)) { if (npc->_type == 0x367) { iVar18 = 2; do { uVar11 = Random(); fVar21 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2a8 = (Entity *)(fVar21 + fVar21); local_2a4 = (int *)cos((float)local_2a8); local_2b4 = sin((float)local_2a8); uVar11 = Random(); childSpawnPos.x = (float)local_2a4 * 10.0 + (npc->_pos).x; childSpawnPos.y = local_2b4 * 10.0 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,0x366,0,&childSpawnPos,&g_vectorZero,(Entity *)npc,0,uVar11 ,0); uVar11 = Random(); fVar21 = tmpEntity->_friction; fVar22 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10; fVar22 = fVar22 + fVar22 + 4.0; if (fVar21 != 0.0) { fVar2 = tmpEntity->_speedMultiplier; (tmpEntity->_velocity).y = (fVar2 * local_2b4 * fVar22) / fVar21 + (tmpEntity->_velocity).y; (tmpEntity->_velocity).x = (fVar2 * (float)local_2a4 * fVar22) / fVar21 + (tmpEntity->_velocity).x; } uVar3 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar3; iVar10 = *(int *)tmpEntity; tmpEntity[2]._posOffset.x = 5.60519e-45; tmpEntity = (Entity *)(**(code **)(iVar10 + 0xc))(); iVar18 = iVar18 + -1; } while (iVar18 != 0); return tmpEntity; } if (npc->_variant == 1) { uVar11 = Random(); clotRightPos.x = (npc->_pos).x + 10.0; clotRightPos.y = (npc->_pos).y + 0.0; Game::SpawnEx(g_game,0xf,1,&clotRightPos,&g_vectorZero,(Entity *)npc,0,uVar11,0); uVar11 = Random(); clotLeftPos.x = (npc->_pos).x - 10.0; clotLeftPos.y = (npc->_pos).y + 0.0; tmpEntity = Game::SpawnEx(g_game,0xf,1,&clotLeftPos,&g_vectorZero,(Entity *)npc,0,uVar11,0); return tmpEntity; } uVar11 = Random(); dipRightPos.x = (npc->_pos).x + 10.0; dipRightPos.y = (npc->_pos).y + 0.0; Game::SpawnEx(g_game,0xd9,0,&dipRightPos,&g_vectorZero,(Entity *)npc,0,uVar11,0); uVar11 = Random(); dipLeftPos.x = (npc->_pos).x - 10.0; dipLeftPos.y = (npc->_pos).y + 0.0; tmpEntity = Game::SpawnEx(g_game,0xd9,0,&dipLeftPos,&g_vectorZero,(Entity *)npc,0,uVar11,0); return tmpEntity; } npc->_friction = npc->_friction * 0.95; if (iVar18 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_controllerID == -1) { uVar11 = Random(); if (uVar11 % 5 == 0) { bVar8 = Entity::IsFrame((Entity *)npc,5,npc->_index); bVar20 = bVar8 == 0; goto LAB_005357e2; } } else { pVVar12 = Entity_NPC::GetControllerInput(npc,&controllerInput,0.1); if ((pVVar12->x == g_vectorZero.x) && (pVVar12->y == g_vectorZero.y)) { bVar20 = true; } else { bVar20 = false; } LAB_005357e2: if (!bVar20) { local_284 = *(undefined4 *)((int)&npc->_flags + 4); if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { npc->_state = 8; npc->_i1 = 0; } else { (npc->_v1).x = 0.0; npc->_state = 4; npc->_i1 = 0; pVVar12 = MusicManager::RandomVector(&randomDir); (npc->_velocity).x = pVVar12->x; (npc->_velocity).y = pVVar12->y; } } else { (npc->_v1).x = 0.0; npc->_state = 4; npc->_i1 = 0; pVVar12 = Entity_NPC::CalcTargetPosition(npc,&calcTargetPos,1.0); fVar21 = pVVar12->y; fVar22 = (npc->_pos).y; (npc->_velocity).x = pVVar12->x - (npc->_pos).x; (npc->_velocity).y = fVar21 - fVar22; } } } fVar21 = npc->_friction * 0.7; LAB_00535fbb: npc->_friction = fVar21; } else if ((iVar18 == 4) || (iVar18 == 6)) { ANM2::Play(&npc->_sprite,(byte *)"Slide",0); if (npc->_type != 0x367) { local_2a8 = (Entity *)npc->_speedMultiplier; fVar21 = (float)local_2a8 + (npc->_v1).x; (npc->_v1).x = fVar21; if (10.0 <= fVar21) { fVar21 = (npc->_velocity).y; fVar22 = (npc->_velocity).x; fVar21 = fVar22 * fVar22 + fVar21 * fVar21; if (1.0 <= fVar21) { if (fVar21 < 9.0) { npc->_friction = npc->_friction * 0.8; } } else { npc->_state = 3; } } else { pVVar12 = Vector::Resized(&npc->_velocity,local_1c0,0.5); fVar21 = npc->_friction; if (fVar21 != 0.0) { fVar22 = pVVar12->y; (npc->_velocity).x = ((float)local_2a8 * pVVar12->x) / fVar21 + (npc->_velocity).x; (npc->_velocity).y = ((float)local_2a8 * fVar22) / fVar21 + (npc->_velocity).y; } } iVar18 = npc->_i1; if (npc->_collidesWithGrid != 0) { iVar18 = iVar18 + 1; npc->_i1 = iVar18; } if (iVar18 < 5) goto LAB_00535fc3; LAB_00535fab: fVar21 = npc->_friction * 0.85; goto LAB_00535fbb; } iVar18 = npc->_state; if (iVar18 == 6) { Entity_NPC::SpawnControlTarget(npc,1,-1.0); iVar18 = npc->_state; } local_2a8 = (Entity *)npc->_speedMultiplier; fVar21 = (float)local_2a8 + (npc->_v1).x; (npc->_v1).x = fVar21; local_298 = fVar21; if (10.0 <= fVar21) { fVar22 = (npc->_velocity).y; fVar2 = (npc->_velocity).x; if (fVar2 * fVar2 + fVar22 * fVar22 < 9.0) { bVar20 = iVar18 == 6; iVar18 = 3; if (bVar20) { iVar18 = 9; } npc->_state = iVar18; } } else { pVVar12 = Vector::Resized(&npc->_velocity,&local_54,0.5); fVar21 = npc->_friction; if (fVar21 == 0.0) { fVar21 = local_298; } else { fVar22 = pVVar12->y; (npc->_velocity).x = ((float)local_2a8 * pVVar12->x) / fVar21 + (npc->_velocity).x; (npc->_velocity).y = (fVar22 * (float)local_2a8) / fVar21 + (npc->_velocity).y; iVar18 = npc->_state; fVar21 = (npc->_v1).x; } } if (iVar18 == 6) { fVar22 = 8.0; } else { fVar22 = 40.0; } if (fVar22 < fVar21) goto LAB_00535fab; } else { if (iVar18 != 8) { if (iVar18 == 9) { ANM2::Play(&npc->_sprite,&DAT_00b1d554,0); Entity_NPC::SpawnControlTarget(npc,1,-1.0); bVar8 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Slide"); if (bVar8 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); pVVar12 = &npc->_pos; dashToTarget.x = (tmpEntity->_pos).x - pVVar12->x; dashToTarget.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalized(&dashToTarget,&dashDir); if (npc->_controllerID != -1) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,&local_6c); bVar8 = Vector::operator_ne(pVVar13,pVVar12); if (bVar8 != 0) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,&local_64); dashToAim.x = pVVar13->x - pVVar12->x; dashToAim.y = pVVar13->y - (npc->_pos).y; pVVar12 = Vector::Normalized(&dashToAim,&local_5c); dashDir.x = pVVar12->x; dashDir.y = pVVar12->y; } } fVar21 = npc->_friction; if (fVar21 != 0.0) { (npc->_velocity).x = (dashDir.x * 20.0) / fVar21 + (npc->_velocity).x; (npc->_velocity).y = (dashDir.y * 20.0) / fVar21 + (npc->_velocity).y; } Entity_NPC::PlaySound(npc,0x39,1.0,100,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (npc->_v1).x = 0.0; npc->_state = 4; } } goto LAB_00535fc3; } ANM2::Play(&npc->_sprite,&DAT_00b1d53c,0); Entity_NPC::SpawnControlTarget(npc,1,-1.0); bVar8 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Slide"); if (bVar8 != 0) { pVVar12 = &npc->_pos; if (npc->_type == 0x367) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); slideAltToTarget.x = (tmpEntity->_pos).x - pVVar12->x; slideAltToTarget.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalized(&slideAltToTarget,&slideDirAlt); if (npc->_controllerID != -1) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,&local_94); bVar8 = Vector::operator_ne(pVVar13,pVVar12); if (bVar8 != 0) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,&local_8c); slideAltToAim.x = pVVar13->x - pVVar12->x; slideAltToAim.y = pVVar13->y - (npc->_pos).y; pVVar12 = Vector::Normalized(&slideAltToAim,&local_84); slideDirAlt.x = pVVar12->x; slideDirAlt.y = pVVar12->y; fVar21 = slideDirAlt.x; fVar22 = slideDirAlt.y; goto LAB_00535af6; } } fVar21 = slideDirAlt.x; fVar22 = slideDirAlt.y; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); slideToTarget.x = (tmpEntity->_pos).x - pVVar12->x; slideToTarget.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalized(&slideToTarget,&slideDir); if (npc->_controllerID != -1) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,&local_4c); bVar8 = Vector::operator_ne(pVVar13,pVVar12); if (bVar8 != 0) { pVVar13 = Entity_NPC::GetAimTargetPosition(npc,&local_7c); slideToAim.x = pVVar13->x - pVVar12->x; slideToAim.y = pVVar13->y - (npc->_pos).y; pVVar12 = Vector::Normalized(&slideToAim,&local_74); fVar21 = pVVar12->x; fVar22 = pVVar12->y; slideDir.x = fVar21; slideDir.y = fVar22; goto LAB_00535af6; } } fVar21 = slideDir.x; fVar22 = slideDir.y; } LAB_00535af6: fVar2 = npc->_friction; (npc->_velocity).y = (fVar22 * 20.0) / fVar2 + (npc->_velocity).y; (npc->_velocity).x = (fVar21 * 20.0) / fVar2 + (npc->_velocity).x; Entity_NPC::PlaySound(npc,0x39,1.0,100,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (npc->_v1).x = 0.0; npc->_state = (uint)(npc->_type == 0x367) * 2 + 4; } } LAB_00535fc3: uVar11 = Random(); if (uVar11 % 10 == 0) { uVar11 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } bVar20 = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; tmpEntity = (Entity *)(uint)bVar20; (npc->_sprite)._flipX = bVar20; if ((npc->_state == 9) && (npc->_controllerID == -1)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar21 = (npc->_pos).x; bVar20 = (tmpEntity->_pos).x <= fVar21 && fVar21 != (tmpEntity->_pos).x; tmpEntity = (Entity *)(uint)bVar20; (npc->_sprite)._flipX = bVar20; } game = g_game; if (npc->_variant != 1) { return tmpEntity; } if ((npc->_flags & 0x4000) != 0) { return (Entity *)0x0; } bVar8 = Game::IsPaused(g_game); if (bVar8 != 0) { return (Entity *)(uint)bVar8; } if (game->_frameCount % 3 != 0) { return (Entity *)(game->_frameCount / 3); } tmpEntity = (Entity *)npc->_state; if (tmpEntity != (Entity *)&DAT_00000004) { if (tmpEntity != (Entity *)&DAT_00000008) { return tmpEntity; } bVar8 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Slide"); if (bVar8 == 0) { return (Entity *)0x0; } } local_298 = (float)Random(); game = g_game; pVStack_288 = &npc->_pos; spawnGame = g_game; creepSubtype = 0; creepVariant = 0x1a; creepType = 1000; lua_callback_run_pre_entity_spawn ((int *)&creepType,(int *)&creepVariant,pVStack_288,&g_vectorZero,(Entity *)npc, (int *)&creepSubtype,(uint *)&local_298); local_2b4 = (float)creepType; if (1 < *(int *)&g_game->_deathmatchManager) { piVar15 = (g_game->_deathmatchManager)._type; local_2a4 = piVar15; pvVar14 = (void *)Random(); uVar11 = creepSubtype; rngShifts = 0x900000005; uStack_2a0 = 7; rngShift3 = 7; if (local_2b4 == 7.00649e-45) { if (creepVariant < 0x12d) { if (creepVariant == 300) { while ((creepSubtype == 0 || (cVar9 = (**(code **)(*piVar15 + 0x24))(creepSubtype), cVar9 != '\0'))) { if (pvVar14 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); tmpEntity = (Entity *)(*pcVar4)(); return tmpEntity; } uVar11 = (uint)pvVar14 >> ((byte)rngShifts & 0x1f) ^ (uint)pvVar14; uVar11 = uVar11 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar11; pvVar14 = (void *)(uVar11 >> ((byte)uStack_2a0 & 0x1f) ^ uVar11); iVar18 = ItemPool::GetCardEx((int)pvVar14,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)pvVar14; creepSubtype = lua_callback_run_get_card(&cardRng,iVar18,1,1,0); } } else { if (creepVariant == 0x46) { uStack_290 = creepSubtype >> 0xb; do { if (creepSubtype != 0) { pcVar4 = *(code **)(*piVar15 + 0x28); iVar18 = ItemPool::GetPillEffect (&g_game->_itemPool,creepSubtype,(Entity_Player *)0x0); cVar9 = (*pcVar4)(iVar18); if (cVar9 == '\0') goto LAB_0053620f; piVar15 = local_2a4; } local_2a8 = (Entity *)&g_game->_itemPool; if (pvVar14 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); tmpEntity = (Entity *)(*pcVar4)(); return tmpEntity; } uVar11 = (uint)pvVar14 >> ((byte)rngShifts & 0x1f) ^ (uint)pvVar14; uVar11 = uVar11 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar11; pvVar14 = (void *)(uVar11 >> ((byte)uStack_2a0 & 0x1f) ^ uVar11); creepSubtype = ItemPool::GetPill((uint)pvVar14); creepSubtype = creepSubtype | (uStack_290 & 1) << 0xb; } while( true ); } if (creepVariant == 100) { if (creepSubtype == 0x19) { LAB_005361ed: bVar20 = false; } else { collectibleKey = creepSubtype; std::set::find_node(auStack_110,&collectibleKey); if (((*(char *)(iStack_108 + 0xd) == '\0') && (*(int *)(iStack_108 + 0x10) <= (int)uVar11)) && (iStack_108 != piVar15[8])) goto LAB_005361ed; bVar20 = true; } if ((uVar11 == 0) || (bVar20)) { creepSubtype = (**(code **)(*piVar15 + 0x84))(0); } } } } else if (creepVariant == 0x15e) { while ((creepSubtype == 0 || (cVar9 = (**(code **)(*piVar15 + 0x2c))(creepSubtype), cVar9 != '\0'))) { creepSubtype = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0053620f: game = spawnGame; } if (((npc->_flags & 0x20000000) != 0) && (local_2b4 == 1.4013e-42)) { switch(creepVariant) { case 0x536418: /* WARNING: This code block may not be properly labeled as switch case */ creepVariant = 0x2d; } } local_2a8 = EntityFactory::Create(game->_entityFactory,(uint)local_2b4,0); if (local_2a8 == (Entity *)0x0) goto LAB_00536c4e; uVar23 = GetTimeNs(); spawner = npcSaved; tmpEntity = local_2a8; uVar16 = (uint)(uVar23 >> 0x20); lVar5 = (uVar23 & 0xffffffff) * 0x431bde82; uStack_2a0 = (uint)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar16 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)((ulonglong)lVar6 >> 0x20); uVar11 = uStack_2a0 + CARRY4((uint)lVar5,(uint)lVar6); lVar5 = (ulonglong)uVar16 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar11),uVar17 + uVar11); uStack_290 = (uint)((ulonglong)lVar5 >> 0x20); pEVar1 = &local_2a8->_spawnerEntity; local_2a4 = (int *)((uint)lVar5 >> 0x12 | uStack_290 * 0x4000); local_2a8->_spawnerType = *(int *)((int)npcSaved + 0x28); uStack_290 = uStack_290 >> 0x12; local_2a8->_spawnerVariant = *(int *)((int)npcSaved + 0x2c); if (*pEVar1 != (EntityPtr)0x0) { spawnerPtrRef = pEVar1; std::multiset::erase(&spawnerPtrRef); } *pEVar1 = spawner; std::multiset::insert(pEVar1); fVar21 = local_2b4; (tmpEntity->_pos).x = ((Vector *)((int)spawner + 0x33c))->x; (tmpEntity->_pos).y = *(float *)((int)spawner + 0x340); iVar18 = *(int *)tmpEntity; (tmpEntity->_velocity).x = g_vectorZero.x; (tmpEntity->_velocity).y = g_vectorZero.y; (**(code **)(iVar18 + 4))(local_2b4,creepVariant,creepSubtype,local_298); pvVar14 = spawnGame->_room; iVar18 = *(int *)((int)pvVar14 + 0x1214); *(int *)((int)pvVar14 + 0x1214) = iVar18 + 1; tmpEntity->_index = iVar18; EntityList::AddEntity((EntityList *)((int)pvVar14 + 0x1218),tmpEntity); bVar8 = Entity::IsActiveEnemy((Entity *)spawner,1); if (bVar8 != 0) { if ((*(uint *)((int)spawner + 0x16c) & 0x10000000) == 0) { bVar8 = Entity::HasEntityFlags((Entity *)spawner,0x20000000); if (bVar8 != 0) { addEnemyKillScore = 0; bVar8 = 0; iVar18 = -1; ref = EntityRef::EntityRef(&charmRef); Entity::AddCharmed(tmpEntity,ref,iVar18,bVar8,addEnemyKillScore); } } else { uVar11 = *(uint *)((int)&tmpEntity->_flags + 4); uVar3 = (undefined4)tmpEntity->_flags; *(undefined4 *)&tmpEntity->_flags = uVar3; *(uint *)((int)&tmpEntity->_flags + 4) = uVar11 | 0x10000000; if ((fVar21 != 1.26117e-44) && (fVar21 != 9.80909e-45)) { *(undefined4 *)&tmpEntity->_flags = uVar3; *(uint *)((int)&tmpEntity->_flags + 4) = uVar11 | 0x10000020; } charmSource._entity = *(void **)((int)spawner + 0x264); if (charmSource._entity == (void *)0x0) { charmSource._type = 0; charmSource._variant = 0; charmSource._spawnerType = 0; charmSource._spawnerVariant = 0; fStack_154 = g_vectorZero.x; fStack_150 = g_vectorZero.y; charmSource._position.x = g_vectorZero.x; charmSource._position.y = g_vectorZero.y; fStack_14c = g_vectorZero.x; fStack_148 = g_vectorZero.y; charmSource._velocity.x = g_vectorZero.x; charmSource._velocity.y = g_vectorZero.y; LAB_005366e2: local_2b4 = 0.0; if (charmSource._entity != (void *)0x0) goto LAB_005366ee; local_2b4 = 0.0; LAB_00536710: uStack_2a0 = 0; if (charmSource._entity != (void *)0x0) goto LAB_0053671c; LAB_00536735: uVar11 = 0; } else { charmSource._type = *(int *)((int)charmSource._entity + 0x28); charmSource._position.x = *(float *)((int)charmSource._entity + 0x33c); charmSource._position.y = *(float *)((int)charmSource._entity + 0x340); charmSource._variant = *(int *)((int)charmSource._entity + 0x2c); charmSource._spawnerType = *(int *)((int)charmSource._entity + 0x34); charmSource._spawnerVariant = *(int *)((int)charmSource._entity + 0x38); charmSource._velocity.x = *(float *)((int)charmSource._entity + 0x360); charmSource._velocity.y = *(float *)((int)charmSource._entity + 0x364); fStack_124 = charmSource._position.x; fStack_120 = charmSource._position.y; fStack_11c = charmSource._velocity.x; fStack_118 = charmSource._velocity.y; if ((*(uint *)((int)charmSource._entity + 0x168) & 0x100) == 0) goto LAB_005366e2; local_2b4 = 1.4013e-45; LAB_005366ee: if ((*(uint *)((int)charmSource._entity + 0x168) & 0x20000000) == 0) goto LAB_00536710; uStack_2a0 = 2; LAB_0053671c: if ((*(uint *)((int)charmSource._entity + 0x16c) & 0x400000) == 0) goto LAB_00536735; uVar11 = 4; } charmSource._flags = uVar11 | uStack_2a0 | (uint)local_2b4; Entity::AddCharmed(tmpEntity,&charmSource,-1,0,0); if ((int)fVar21 - 10U < 0x3de) { ANM2::LoadDeliriumForm(&tmpEntity->_sprite,(int)fVar21,creepVariant,1); } } uStack_2a0 = __RTDynamicCast(spawner,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); spawnedNpc = (Entity *) __RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if ((uStack_2a0 != 0) && (spawnedNpc != (Entity *)0x0)) { bVar8 = Entity::HasEntityFlags(spawnedNpc,1); if (bVar8 == 0) { bVar8 = Entity::HasEntityFlags((Entity *)spawner,0x100000000000000); if (bVar8 != 0) { brimstoneSource._type = 0; brimstoneSource._variant = 0; brimstoneSource._spawnerType = 0; brimstoneSource._spawnerVariant = 0; fStack_144 = g_vectorZero.x; fStack_140 = g_vectorZero.y; brimstoneSource._position.x = g_vectorZero.x; brimstoneSource._position.y = g_vectorZero.y; fStack_13c = g_vectorZero.x; fStack_138 = g_vectorZero.y; brimstoneSource._velocity.x = g_vectorZero.x; brimstoneSource._velocity.y = g_vectorZero.y; brimstoneSource._flags = 0; brimstoneSource._entity = (void *)0x0; Entity::AddBrimstoneMark(spawnedNpc,&brimstoneSource,0x5a); } bVar8 = Entity::HasEntityFlags((Entity *)spawner,0x1000000); if (bVar8 != 0) { shrinkSource._type = 0; shrinkSource._variant = 0; shrinkSource._spawnerType = 0; shrinkSource._spawnerVariant = 0; fStack_134 = g_vectorZero.x; fStack_130 = g_vectorZero.y; shrinkSource._position.x = g_vectorZero.x; shrinkSource._position.y = g_vectorZero.y; fStack_12c = g_vectorZero.x; fStack_128 = g_vectorZero.y; shrinkSource._velocity.x = g_vectorZero.x; shrinkSource._velocity.y = g_vectorZero.y; shrinkSource._flags = 0; shrinkSource._entity = (void *)0x0; Entity::AddShrink(spawnedNpc,&shrinkSource,0x5a,0,0); if (0 < spawnedNpc->_shrinkCountdown) { uVar3 = *(undefined4 *)((int)&spawnedNpc->_flags + 4); *(uint *)&spawnedNpc->_flags = (uint)spawnedNpc->_flags | 0x1000000; *(undefined4 *)((int)&spawnedNpc->_flags + 4) = uVar3; spawnedNpc->_shrinkStatus1 = spawnedNpc->_shrinkStatus2; } } } uVar11 = uStack_2a0; fVar22 = *(float *)(uStack_2a0 + 0xf48) * spawnedNpc[3]._pendingDamage; pcVar4 = *(code **)(*(int *)spawnedNpc + 0x4c); spawnedNpc[3]._pendingDamage = fVar22; fVar22 = fVar22 * spawnedNpc->_shrinkStatus1; fVar21 = fVar22 * g_vectorOne.x; (spawnedNpc->_sprite)._scale.y = fVar22 * g_vectorOne.y; (spawnedNpc->_sprite)._scale.x = fVar21; spawnedNpc[3]._burnTickDamage = spawnedNpc[3]._burnTickDamage * *(float *)(uStack_2a0 + 0xf48) ; spawnedNpc[3]._poisonTickDamage = spawnedNpc[3]._poisonTickDamage * *(float *)(uStack_2a0 + 0xf44); spawnedNpc->_maxHitPoints = spawnedNpc->_maxHitPoints * *(float *)(uStack_2a0 + 0xf44); spawnedNpc->_health = spawnedNpc->_health * *(float *)(uStack_2a0 + 0xf44); cVar9 = (*pcVar4)(); if (cVar9 != '\0') { pvVar14 = *(void **)(uVar11 + 0xf54); ppvVar19 = &spawnedNpc[3]._config; if (*ppvVar19 != pvVar14) { if (*ppvVar19 != (void *)0x0) { ppvStack_294 = ppvVar19; std::multiset::erase(&ppvStack_294); } *ppvVar19 = pvVar14; if (pvVar14 != (void *)0x0) { std::multiset::insert(ppvVar19); } } } } } bVar8 = Game::ShouldEraseEnemy(tmpEntity); if (bVar8 != 0) { Entity::RemoveWithPoof(tmpEntity,unusedArg); } if ((tmpEntity->_exists != 0) && ((spawnGame->_proceduralItemManager)._proceduralItems._begin != (spawnGame->_proceduralItemManager)._proceduralItems._end)) { triggerKeyVariant = tmpEntity->_variant; proceduralItemManager = &spawnGame->_proceduralItemManager; triggerKeyType = tmpEntity->_type; std::map::find(&triggerIt,&triggerKeyType); pvVar14 = (proceduralItemManager->_spawnTriggerTargets)._head; if (triggerIt == pvVar14) { triggerKeyTypeOnly[0] = tmpEntity->_type; triggerKeyTypeOnly[1] = 0xffffffff; piVar15 = (int *)std::map::find(auStack_114,triggerKeyTypeOnly); triggerIt = (void *)*piVar15; if (triggerIt == pvVar14) goto LAB_00536bc0; } uVar11 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar14 = (playerManager->_playerList)._end; if ((int)pvVar14 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar14 = (playerManager->_playerList)._end; } piVar15 = (playerManager->_playerList)._begin; if (uVar11 < (uint)((int)pvVar14 - (int)piVar15 >> 2)) { piVar15 = piVar15 + uVar11; } trigger_set_dispatch((void *)(*piVar15 + 0x1fc8),6,tmpEntity,pVStack_288,&g_vectorZero); uVar11 = uVar11 + 1; playerManager = &g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00536bc0: uVar23 = GetTimeNs(); uVar11 = (uint)(uVar23 >> 0x20); lVar5 = (uVar23 & 0xffffffff) * 0x431bde82; ppvStack_294 = (void **)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar11 * 0x431bde82; pVStack_288 = (Vector *)lVar6; lVar7 = (ulonglong)uVar11 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); local_1c0[0].x = (float)(lVar7 + lVar5); lVar6 = lVar6 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar7 >> 0x20), (int)ppvStack_294 + (uint)CARRY4((uint)lVar5,(uint)lVar7)), (int)((ulonglong)(lVar7 + lVar5) >> 0x20)); uVar16 = (uint)((ulonglong)lVar6 >> 0x20); piVar15 = (int *)((uint)lVar6 >> 0x12 | uVar16 * 0x4000); uVar11 = (int)piVar15 - (int)local_2a4; bVar20 = CARRY4((uint)g_entitySpawnTimeMs,uVar11); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar11; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar16 >> 0x12) - uStack_290) - (uint)(piVar15 < local_2a4)) + (uint)bVar20; npc = (Entity_NPC *)npcSaved; LAB_00536c4e: piVar15 = (int *)__RTDynamicCast(local_2a8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); pEVar1 = (EntityPtr *)(piVar15 + 0xef); if (piVar15[0xef] != 0) { parentPtrRef = pEVar1; std::multiset::erase(&parentPtrRef); } *pEVar1 = (EntityPtr)npc; std::multiset::insert(pEVar1); fVar21 = g_vectorOne.y; piVar15[0x39] = (int)g_vectorOne.x; piVar15[0x3a] = (int)fVar21; piVar15[0x117] = 0x3c; piVar15[0x118] = 0x3c; tmpEntity = (Entity *)(**(code **)(*piVar15 + 0xc))(); return tmpEntity; } //@@ 00536d00 NpcAI::ENTITY_SWINGER /* NPC AI for entity type 216 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SWINGER(Entity_NPC *npc) { float fVar1; float fVar2; byte isConfused; uint rngResult; EntityPtr EVar3; Entity *tmpEntity; int *chainLink; EntityRef *killSource; Entity_NPC *pEVar4; int iVar5; double trigResult; float fVar6; float fVar7; float fVar8; EntityPtr *local_40; int *eraseSlot; Vector scratchVec; EntityRef entityRef; EntityPtr child; undefined4 flagsHigh; float posY; iVar5 = npc->_variant; if (npc->_state == 0) { if ((iVar5 == 1) && (npc->_parent == (EntityPtr)0x0)) { Entity_NPC::Morph(npc,npc->_type,0,npc->_subtype,npc->_championColorIdx); iVar5 = npc->_variant; npc->_health = npc->_maxHitPoints; } *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 4; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; if (iVar5 == 0) { ANM2::Play(&npc->_sprite,&DAT_00b1d734,0); rngResult = Random(); EVar3 = (EntityPtr) Game::SpawnEx(g_game,npc->_type,1,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngResult,0 ); scratchVec.x = (float)EVar3; if (*(EntityPtr *)((int)EVar3 + 0x3bc) != (EntityPtr)0x0) { local_40 = (EntityPtr *)((int)EVar3 + 0x3bc); std::multiset::erase(&local_40); } *(EntityPtr *)((int)EVar3 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar3 + 0x3bc)); if (npc->_child != (EntityPtr)0x0) { local_40 = &npc->_child; std::multiset::erase(&local_40); } npc->_child = EVar3; std::multiset::insert(&npc->_child); (**(code **)(*(int *)EVar3 + 0xc))(); local_40 = (EntityPtr *)0x0; do { rngResult = Random(); tmpEntity = Game::SpawnEx(g_game,npc->_type,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0, rngResult,0); chainLink = (int *)__RTDynamicCast(tmpEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0) ; if (chainLink[0xef] != 0) { eraseSlot = chainLink + 0xef; std::multiset::erase(&eraseSlot); } chainLink[0xef] = (int)npc; std::multiset::insert(chainLink + 0xef); if (chainLink[0xf0] != 0) { eraseSlot = chainLink + 0xf0; std::multiset::erase(&eraseSlot); } *(EntityPtr *)(chainLink + 0xf0) = (EntityPtr)scratchVec.x; std::multiset::insert((EntityPtr *)(chainLink + 0xf0)); chainLink[0x5a] = chainLink[0x5a] & 0xfffffffb; chainLink[0x5b] = chainLink[0x5b]; chainLink[0x2ed] = (int)((float)(int)local_40 / 11.0); (**(code **)(*chainLink + 0xc))(); chainLink[0x5a] = chainLink[0x5a] | 0x40000; chainLink[0x5b] = chainLink[0x5b]; local_40 = (EntityPtr *)&local_40->field_0x1; } while ((int)local_40 < 0xc); return; } if (iVar5 == 1) { ANM2::Play(&npc->_sprite,s_Head,0); (npc->_v1).x = 0.0; npc->_entityGridCollisionClass = 0; return; } if (iVar5 == 10) { ANM2::Play(&npc->_sprite,&DAT_00b1d20c,0); npc->_renderZOffset = -500; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; return; } } else if (iVar5 == 0) { scratchVec.y = *(float *)((int)&npc->_flags + 4); if (npc->_child == (EntityPtr)0x0) { *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(float *)((int)&npc->_flags + 4) = scratchVec.y; killSource = EntityRef::EntityRef(&entityRef); (**(code **)(*(int *)npc + 0x24))(killSource); rngResult = Random(); pEVar4 = (Entity_NPC *) Game::SpawnEx(g_game,0x18,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngResult,0); (**(code **)(*(int *)pEVar4 + 0xc))(); Entity_NPC::TransferControl(npc,pEVar4); return; } npc->_friction = 0.7; if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { if (((npc->_flags & 0x200) == 0) || (npc->_controllerID != -1)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,0.25,100,1); } else { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); } } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (tmpEntity->_pos).x; scratchVec.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } rngResult = Random(); if (rngResult % 10 == 0) { rngResult = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); return; } } else { if (iVar5 == 1) { EVar3 = npc->_parent; if (EVar3 == (EntityPtr)0x0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; killSource = EntityRef::EntityRef(&entityRef); (**(code **)(*(int *)npc + 0x24))(killSource); rngResult = Random(); pEVar4 = (Entity_NPC *) Game::SpawnEx(g_game,0x1a,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngResult,0); (**(code **)(*(int *)pEVar4 + 0xc))(); Entity_NPC::TransferControl(npc,pEVar4); } else { local_40 = (EntityPtr *)((npc->_speedMultiplier * 100.0) / 60.0 + (npc->_v2).y); if (100.0 <= (float)local_40) { local_40 = (EntityPtr *)0x42c80000; } (npc->_v2).y = (float)local_40; trigResult = (double)(npc->_v1).x; libm_sse2_cos_precise(); scratchVec.x = ((float)trigResult * (float)local_40 + *(float *)((int)EVar3 + 0x33c)) - (npc->_pos).x; trigResult = (double)(npc->_v1).x; libm_sse2_sin_precise(); fVar6 = *(float *)((int)EVar3 + 0x340); fVar1 = (npc->_pos).y; (npc->_velocity).x = scratchVec.x; (npc->_velocity).y = ((float)trigResult * (float)local_40 + fVar6) - fVar1; pEVar4 = Entity_NPC::ParentNPC(npc); if (pEVar4 == (Entity_NPC *)0x0) { fVar6 = 0.0; } else { Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.0); fVar6 = scratchVec.x * 0.5; if (fVar6 <= -0.5) { fVar6 = -0.5; } if (0.5 <= fVar6) { fVar6 = 0.5; } } fVar1 = (npc->_v2).x; fVar2 = npc->_speedMultiplier; fVar7 = fVar2 * 0.05; if (fVar7 < ABS(fVar1 - fVar6)) { if (fVar6 <= fVar1) { fVar6 = fVar1 - fVar7; } else { fVar6 = fVar7 + fVar1; } } (npc->_v2).x = fVar6; fVar6 = ((fVar6 + 1.0) * fVar2 * 3.1415927) / 50.0 + (npc->_v1).x; (npc->_v1).x = fVar6; while (6.2831855 < fVar6) { fVar6 = (npc->_v1).x - 6.2831855; (npc->_v1).x = fVar6; } isConfused = Entity::HasEntityFlags((Entity *)npc,0x200); if (isConfused != 0) { EVar3 = npc->_parent; *(uint *)((int)EVar3 + 0x168) = *(uint *)((int)EVar3 + 0x168) | 0x200; *(undefined4 *)((int)EVar3 + 0x16c) = *(undefined4 *)((int)EVar3 + 0x16c); iVar5 = npc->_confusionCountdown; pEVar4 = Entity_NPC::ParentNPC(npc); pEVar4->_confusionCountdown = iVar5; npc->_friction = 0.7; return; } } npc->_friction = 0.7; return; } if (iVar5 == 10) { EVar3 = npc->_parent; if ((EVar3 != (EntityPtr)0x0) && (child = npc->_child, child != (EntityPtr)0x0)) { fVar6 = (npc->_v1).y; fVar1 = *(float *)((int)EVar3 + 0x340); fVar2 = (npc->_sprite)._offset.y; fVar7 = *(float *)((int)child + 0x340); fVar8 = ABS(fVar6 - 0.5) + ABS(fVar6 - 0.5); posY = (npc->_pos).y; (npc->_velocity).x = (((*(float *)((int)EVar3 + 0x33c) - (npc->_sprite)._offset.x) - *(float *)((int)child + 0x33c)) * fVar6 + *(float *)((int)child + 0x33c) + 0.0) - (npc->_pos).x; (npc->_velocity).y = (((fVar1 - fVar2) - fVar7) * fVar6 + (1.0 - fVar8 * fVar8) * 10.0 + fVar7 + 7.0) - posY ; return; } (**(code **)(*(int *)npc + 0x28))(); } } return; } //@@ 005374a0 NpcAI::ENTITY_WIZOOB /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 219 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WIZOOB(Entity_NPC *npc) { byte bVar1; byte *curAnimChar; Vector *pVVar2; int iVar3; uint uVar4; Entity *target; ColorMod *color; float *shootPosNull; Entity_Laser *laser; char *animName; byte *cmpAnimChar; bool isLess; float fVar5; float fVar6; undefined4 local_128 [11]; Vector local_fc; Vector local_f4 [6]; ProjectileParams projParams; float local_14; byte *animData; undefined4 flagsHigh; float npcX; Room *room; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); iVar3 = npc->_state; if (iVar3 == 0) { npc->_state = 0xd; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"AppearDown",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; iVar3 = npc->_type; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; if (iVar3 == 0x11d) { return; } if (&npc->_splatColor == (ColorMod *)local_128) { return; } (npc->_splatColor)._offset[0] = 0.8; (npc->_splatColor)._offset[1] = 0.8; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.3; (npc->_splatColor)._offset[2] = 0.8; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } if (npc->_controllerID == -1) { LAB_00537625: if (iVar3 == 0xd) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 0x10; LAB_00537652: animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_005376a6: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"VanishDown",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } animName = "VanishDown"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_00537688: uVar4 = -(uint)isLess | 1; goto LAB_0053768d; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_00537688; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar4 = 0; LAB_0053768d: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_005376a6; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; goto LAB_005376ea; } iVar3 = npc->_state; } } else if (iVar3 == 0x10) goto LAB_00537652; if (iVar3 != 3) { if (iVar3 != 4) { if (iVar3 != 8) { if ((iVar3 == 9) && ((ANM2::Play(&npc->_sprite,(&PTR_s_VanishLeft_00b61550)[npc->_i1],0), (npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { npc->_state = 3; npc->_stateFrame = 0x3c; (npc->_v2).x = 0.0; } goto LAB_00537dd5; } npc->_entityCollisionClass = 2; animData = (npc->_sprite)._animState._animData; local_f4[0].y = (float)(&PTR_s_ShootLeft_00b61540)[npc->_i1]; if (animData == (byte *)0x0) { LAB_00537b93: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)local_f4[0].y,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; cmpAnimChar = (byte *)local_f4[0].y; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar1 = *curAnimChar; isLess = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_00537b70: uVar4 = -(uint)isLess | 1; goto LAB_00537b75; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_00537b70; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_00537b75: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_00537b93; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if ((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar1 == 0)) { if (npc->_type == 0x11d) { shootPosNull = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"ShootPos"); local_fc.x = *shootPosNull / 0.65; local_fc.y = shootPosNull[1] / 0.65; fVar5 = normalize_angle_degrees((float)npc->_i1 * 90.0 - 180.0); laser = Entity_Laser::ShootAngle(1,&npc->_pos,fVar5,0x19,&local_fc,(Entity *)npc,0); if (npc->_i1 == 1) { laser->_renderDepthOffset = -10.0; (**(code **)(*(int *)laser + 0xc))(); } else { laser->_renderDepthOffset = 3000.0; (**(code **)(*(int *)laser + 0xc))(); } } else { Entity_NPC::PlaySound(npc,0x107,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); shootPosNull = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"ShootPos"); projParams.PositionOffset.x = *shootPosNull / 0.65; projParams.HeightModifier = shootPosNull[1] / 0.65; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 0x10; projParams.PositionOffset.y = 0.0; projParams.VelocityMulti = 1.5; projParams.FallingSpeedModifier = projParams.FallingSpeedModifier + 10.0; uVar4 = Random(); Entity_NPC::FireBossProjectiles (npc,(uVar4 & 3) + 6,&npc->_targetPosition,7.0,&projParams); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00537dd5; } npc->_state = 9; goto LAB_00537dd5; } npc->_visible = 1; animData = (npc->_sprite)._animState._animData; local_f4[0].y = (float)(&PTR_s_AppearLeft_00b61530)[npc->_i1]; if (animData == (byte *)0x0) { LAB_00537acf: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)local_f4[0].y,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; cmpAnimChar = (byte *)local_f4[0].y; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar1 = *curAnimChar; isLess = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_00537ab0: uVar4 = -(uint)isLess | 1; goto LAB_00537ab5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_00537ab0; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_00537ab5: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00537acf; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 8; } goto LAB_00537dd5; } } else { Entity_NPC::UpdateChargeBar(npc,1.0,0.0,(npc->_v2).x,1); iVar3 = npc->_state; fVar5 = (npc->_v2).x; if (iVar3 != 3) { fVar5 = fVar5 - npc->_speedMultiplier / 90.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } (npc->_v2).x = fVar5; goto LAB_00537625; } fVar5 = npc->_speedMultiplier / 150.0 + fVar5; if (1.0 <= fVar5) { fVar5 = 1.0; } (npc->_v2).x = fVar5; } LAB_005376ea: npc->_entityCollisionClass = 0; npc->_visible = 0; if (npc->_controllerID == -1) { if (npc->_stateFrame < 1) { uVar4 = Random(); if (uVar4 % 0x1e == 0) { room = g_game->_room; target = Entity_NPC::GetPlayerTarget(npc); local_f4[0].x = (target->_pos).x; local_f4[0].y = (target->_pos).y; pVVar2 = Room::FindFreePickupSpawnPosition(room,&local_fc,local_f4,120.0,1,0,0); (npc->_pos).x = pVVar2->x; (npc->_pos).y = pVVar2->y; npc->_state = 4; target = Entity_NPC::GetPlayerTarget(npc); fVar5 = (target->_pos).x; fVar6 = (target->_pos).y; (npc->_targetPosition).x = fVar5; (npc->_targetPosition).y = fVar6; fVar5 = fVar5 - (npc->_pos).x; fVar6 = fVar6 - (npc->_pos).y; if (ABS(fVar5) <= ABS(fVar6)) { iVar3 = (uint)(0.0 <= fVar6) * 2 + 1; } else { iVar3 = 2; if (fVar5 < 0.0) { iVar3 = 0; } } npc->_i1 = iVar3; if (npc->_type == 0x11d) { color = (ColorMod *)Color::Color(0x3f4ccccd); fVar5 = normalize_angle_degrees((float)npc->_i1 * 90.0 - 180.0); local_f4[0].y = fVar5 * 0.017453292; local_fc.x = cos(local_f4[0].y); local_fc.y = sin(local_f4[0].y); local_f4[0].x = 0.0; local_f4[0].y = -26.0; Entity::SpawnFollowingEffect198((Entity *)npc,local_f4,&local_fc,0x1e,color,4.0); } } } else { npc->_stateFrame = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; } } else { Entity_NPC::SpawnControlTarget(npc,2,-1.0); npc->_friction = npc->_friction * 0.95; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,1.4,0,1); if ((1.0 <= (npc->_v2).x) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { npc->_state = 4; pVVar2 = Entity_NPC::GetControllerMovementInput(npc,&local_fc,0.0); fVar6 = pVVar2->x * 160.0; fVar5 = pVVar2->y * 160.0; if ((fVar6 == g_vectorZero.x) && (fVar5 == g_vectorZero.y)) { pVVar2 = MusicManager::RandomVector(&local_fc); fVar6 = pVVar2->x * 160.0; fVar5 = pVVar2->y * 160.0; } npcX = (npc->_pos).x; (npc->_targetPosition).y = fVar5 + (npc->_pos).y; (npc->_targetPosition).x = fVar6 + npcX; if (ABS(fVar6) <= ABS(fVar5)) { npc->_i1 = (uint)(0.0 <= fVar5) * 2 + 1; } else { iVar3 = 2; if (fVar6 < 0.0) { iVar3 = 0; } npc->_i1 = iVar3; } } } LAB_00537dd5: if ((npc->_controllerID == -1) || (npc->_state != 3)) { npc->_friction = npc->_friction * 0.1; } return; } //@@ 00537e20 NpcAI::ENTITY_NERVE_ENDING /* NPC AI for entity type 231 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_NERVE_ENDING(Entity_NPC *npc) { byte bVar1; Entity *target; Vector *pVVar2; float *damageEvent; float fVar3; float fVar4; float fVar5; float fVar6; undefined1 auVar7 [13]; undefined1 in_stack_ffffffc8 [16]; undefined1 auVar8 [16]; undefined1 auVar9 [16]; undefined1 auVar10 [16]; undefined1 auVar11 [16]; undefined1 auVar12 [16]; Vector local_20; undefined8 local_18; void *animData; float *damageEventsEnd; undefined4 flagsHigh; Manager *manager; auVar8._0_12_ = in_stack_ffffffc8._0_12_; if (npc->_state == 0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x80000000; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; return; } fVar4 = (npc->_targetPosition).x; fVar3 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; fVar5 = npc->_friction; (npc->_velocity).x = fVar4 - fVar3; npc->_friction = fVar5 * 0.5; if (npc->_type == 0xe7) { if (npc->_variant != 0) { auVar8._12_4_ = 0x537eef; target = Entity_NPC::GetPlayerTarget(npc); auVar9._0_8_ = auVar8._0_8_; animData = (npc->_sprite)._animState._animData; fVar4 = (target->_pos).x - (npc->_pos).x; fVar3 = (target->_pos).y - (npc->_pos).y; if ((animData != (void *)0x0) && (*(char *)((int)animData + 0x34) != '\0')) { if (npc->_controllerID != -1) { auVar9._8_4_ = 0x537f43; auVar9._12_4_ = &local_20; pVVar2 = Entity_NPC::GetControllerMovementInput(npc,&local_20,0.1); fVar4 = pVVar2->x; fVar3 = pVVar2->y; } if (((fVar4 != 0.0) && (ABS(fVar3) < 20.0)) && (ABS(fVar4) < 80.0)) { animData = (npc->_sprite)._animState._animData; if (fVar4 <= 0.0) { if (animData == (void *)0x0) { local_18._4_4_ = (float)CONCAT31(local_18._5_3_,1); } else { local_18._4_4_ = (float)CONCAT31(local_18._5_3_,(npc->_sprite)._animState._isPlaying == 0); } auVar12._8_4_ = "SwingLeft"; auVar12._0_8_ = auVar9._0_8_; auVar12._12_4_ = local_18._4_4_; auVar7 = auVar12._0_13_; } else if (animData == (void *)0x0) { local_18._4_4_ = (float)CONCAT31(local_18._5_3_,1); auVar10._8_4_ = "SwingRight"; auVar10._0_8_ = auVar9._0_8_; auVar10._12_4_ = local_18._4_4_; auVar7 = auVar10._0_13_; } else { local_18._4_4_ = (float)CONCAT31(local_18._5_3_,(npc->_sprite)._animState._isPlaying == 0); auVar11._8_4_ = "SwingRight"; auVar11._0_8_ = auVar9._0_8_; auVar11._12_4_ = local_18._4_4_; auVar7 = auVar11._0_13_; } ANM2::Play(&npc->_sprite,auVar7._8_4_,auVar7[0xc]); } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b1d3b0); manager = g_manager; if (bVar1 != 0) { local_18._4_4_ = 3.48923e-43; seed_fart_sound_override((int *)((int)&local_18 + 4)); SoundEffects::Play(&manager->_sfxManager,(int)local_18._4_4_,1.0,2,0,1.0,0.0); manager = g_manager; local_18._4_4_ = 3.61535e-43; seed_fart_sound_override((int *)((int)&local_18 + 4)); SoundEffects::Play(&manager->_sfxManager,(int)local_18._4_4_,1.0,2,0,0.8,0.0); fVar4 = (npc->_pos).x; fVar3 = (npc->_pos).y; fVar5 = fVar4 - 40.0; fVar4 = fVar4 + 40.0; fVar6 = fVar3 - 20.0; fVar3 = fVar3 + 20.0; bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"SwingRight"); pVVar2 = &local_20; if (bVar1 == 0) { local_18._0_4_ = -40.0; local_18._4_4_ = 0.0; pVVar2 = (Vector *)&local_18; } else { local_20.x = 40.0; local_20.y = 0.0; } local_20.x = fVar4 + pVVar2->x; local_18._0_4_ = fVar5 + pVVar2->x; local_20.y = fVar3 + pVVar2->y; local_18._4_4_ = fVar6 + pVVar2->y; apply_tear_effects_in_rect(&local_18,&local_20,npc); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053816a; } } ANM2::Play(&npc->_sprite,s_Idle,0); } LAB_0053816a: if (npc->_type == 0x3c4) { npc->_health = npc->_maxHitPoints; damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { (npc->_v1).x = (npc->_v1).x + *damageEvent; } } return; } //@@ 005381c0 NpcAI::ENTITY_SKINBALL /* NPC AI for entity type 232 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SKINBALL(Entity_NPC *npc) { float fVar1; byte bVar2; uint rngResult; Entity *target; Vector *pVVar3; int iVar4; int extraout_ECX; int extraout_ECX_00; int iVar5; float fVar6; float fVar7; Vector controllerInput; Vector scratchVec; float orbitDist; Vector local_30; undefined1 *local_28; float local_24; float local_20; undefined1 *local_1c; float local_18; float chargeDirX; Manager *manager; iVar5 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; rngResult = Random(); local_1c = (undefined1 *)(rngResult % 0x1e); if (npc->_state == 0) { npc->_state = 4; npc->_entityGridCollisionClass = 0; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = -20.0; rngResult = Random(); fVar6 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28 = (undefined1 *)(fVar6 + fVar6); local_24 = cos((float)local_28); fVar6 = sin((float)local_28); (npc->_v1).x = local_24; (npc->_v1).y = fVar6; npc->_stateFrame = (int)local_1c; return; } Room::GetClampedPositionImpl(g_game->_room,&scratchVec,&npc->_pos,0.0,0.0,0.0,0.0); if ((scratchVec.x != (npc->_pos).x) || (scratchVec.y != (npc->_pos).y)) { npc->_stateFrame = (int)local_1c; rngResult = Random(); fVar6 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28 = (undefined1 *)(fVar6 + fVar6); local_24 = cos((float)local_28); fVar6 = sin((float)local_28); (npc->_v1).x = local_24; (npc->_v1).y = fVar6; npc->_state = 4; } Room::GetClampedPositionImpl(g_game->_room,&scratchVec,&npc->_pos,0.0,0.0,0.0,0.0); (npc->_pos).x = scratchVec.x; (npc->_pos).y = scratchVec.y; if (npc->_state != 4) { if (npc->_state == 8) { ANM2::Play(&npc->_sprite,&DAT_00b1dd28,0); fVar7 = npc->_friction * 0.6; npc->_friction = fVar7; fVar6 = (npc->_v2).x; if (fVar7 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).y = (fVar1 * (npc->_v2).y * 3.5) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (fVar1 * fVar6 * 3.5) / fVar7 + (npc->_velocity).x; } npc->_stateFrame = npc->_stateFrame - iVar5; if (npc->_stateFrame < 1) { npc->_state = 4; npc->_stateFrame = (int)local_1c; } } return; } ANM2::Play(&npc->_sprite,s_Idle,0); iVar4 = npc->_stateFrame; if (0 < iVar5) { local_28 = (undefined1 *)0x14; do { if (iVar4 % (int)local_28 == 0) { rngResult = Random(); local_24 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_24 = local_24 + local_24; local_20 = cos(local_24); fVar6 = sin(local_24); (npc->_v1).x = local_20; (npc->_v1).y = fVar6; iVar4 = npc->_stateFrame; } iVar4 = iVar4 + 1; npc->_stateFrame = iVar4; iVar5 = iVar5 + -1; } while (iVar5 != 0); } Entity_NPC::UpdateChargeBar(npc,0.0,100.0,(float)iVar4,0); target = Entity_NPC::GetPlayerTarget(npc); fVar6 = (npc->_pos).y - (target->_pos).y; fVar7 = (npc->_pos).x - (target->_pos).x; orbitDist = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); orbitDist = orbitDist * 0.85; Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_1c = (undefined1 *)0x42c80000; local_20 = 50.0; fVar6 = sqrtf(12500.0); if (0.0 < fVar6) { local_1c = (undefined1 *)((1.0 / fVar6) * 100.0); local_20 = (1.0 / fVar6) * 50.0; } local_24 = 100.0; local_28 = (undefined1 *)0xc2480000; if (0.0 < fVar6) { local_28 = (undefined1 *)((1.0 / fVar6) * -50.0); local_24 = (1.0 / fVar6) * 100.0; } target = Entity_NPC::GetPlayerTarget(npc); local_30.y = (npc->_pos).y; chargeDirX = ((target->_velocity).x * 20.0 + scratchVec.x) - (npc->_pos).x; local_18 = ((target->_velocity).y * 20.0 + scratchVec.y) - local_30.y; fVar6 = sqrtf(chargeDirX * chargeDirX + local_18 * local_18); if (0.0 < fVar6) { chargeDirX = (1.0 / fVar6) * chargeDirX; local_18 = local_18 * (1.0 / fVar6); } if (npc->_controllerID == -1) { iVar5 = -1; iVar4 = extraout_ECX; fVar6 = local_30.y; } else { pVVar3 = Entity_NPC::GetControllerInput(npc,&local_30,0.1); chargeDirX = pVVar3->x; local_18 = pVVar3->y; fVar6 = sqrtf(chargeDirX * chargeDirX + local_18 * local_18); if (0.0 < fVar6) { chargeDirX = (1.0 / fVar6) * chargeDirX; local_18 = local_18 * (1.0 / fVar6); } iVar5 = npc->_controllerID; iVar4 = extraout_ECX_00; fVar6 = (npc->_pos).y; } if (100 < npc->_stateFrame) { if (iVar5 == -1) { fVar7 = (npc->_pos).x - scratchVec.x; fVar6 = sqrtf((fVar6 - scratchVec.y) * (fVar6 - scratchVec.y) + fVar7 * fVar7); if (((((80.0 < fVar6) && (fVar6 < 160.0)) && (npc->_stateFrame % 3 == 0)) && (rngResult = Random(), (rngResult & 1) != 0)) && (((0.98 < (float)local_1c * chargeDirX + local_20 * local_18 || (0.98 < local_24 * chargeDirX + (float)local_28 * local_18)) || ((0.98 < -local_20 * local_18 - (float)local_1c * chargeDirX || (0.98 < -(float)local_28 * local_18 - local_24 * chargeDirX)))))) goto LAB_005387f7; } else { bVar2 = input_is_action_pressed(9,iVar5,(Entity *)npc,iVar4); if ((bVar2 != 0) && ((pVVar3 = Entity_NPC::GetControllerInput(npc,&controllerInput,0.1), pVVar3->x != g_vectorZero.x || (pVVar3->y != g_vectorZero.y)))) { LAB_005387f7: manager = g_manager; local_1c = (undefined1 *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_1c = (undefined1 *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_1c = (undefined1 *)0x3f000000; } local_28 = (undefined1 *)0x92; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,(float)local_1c,0.0); npc->_state = 8; npc->_stateFrame = 0x14; (npc->_v2).x = chargeDirX; (npc->_v2).y = local_18; } } } target = Entity_NPC::GetPlayerTarget(npc); local_1c = (undefined1 *) (((target->_velocity).x * 20.0 + scratchVec.x + orbitDist * (npc->_v1).x) - (npc->_pos).x); local_18 = ((target->_velocity).y * 20.0 + scratchVec.y + orbitDist * (npc->_v1).y) - (npc->_pos).y; if (npc->_controllerID != -1) { pVVar3 = Entity_NPC::GetControllerInput(npc,&controllerInput,0.0); local_18 = pVVar3->y * 100.0; local_1c = (undefined1 *)(pVVar3->x * 100.0); } bVar2 = (npc->_sprite)._flipX; if (bVar2 == 0) { if ((float)local_1c < -40.0) goto LAB_00538965; LAB_0053897e: local_28 = (undefined1 *)0x3f800000; } else { if (40.0 < (float)local_1c) { LAB_00538965: (npc->_sprite)._flipX = bVar2 == 0; if (bVar2 != 0) goto LAB_0053897e; } local_28 = &DAT_bf800000; } fVar6 = sqrtf((float)local_1c * (float)local_1c + local_18 * local_18); if (0.0 < fVar6) { local_1c = (undefined1 *)((float)local_1c * (1.0 / fVar6)); } if ((((float)local_28 < 0.0) && (-1.0 <= (float)local_1c)) || ((0.0 < (float)local_28 && ((float)local_1c <= 1.0)))) { local_1c = local_28; } if (0.0 < fVar6) { local_18 = local_18 * (1.0 / fVar6); } fVar6 = npc->_speedMultiplier; if (npc->_controllerID == -1) { fVar7 = 0.1; } else { fVar7 = 0.3; } fVar7 = 1.0 - fVar7; if (fVar6 != 1.0) { fVar7 = fVar7 / ((fVar7 + fVar6) - fVar7 * fVar6); } fVar6 = (npc->_velocity).x; fVar1 = (npc->_velocity).y; (npc->_velocity).x = ((float)local_1c * 3.0 - fVar6) * (1.0 - fVar7) + fVar6; (npc->_velocity).y = (local_18 * 3.0 - fVar1) * (1.0 - fVar7) + fVar1; return; } //@@ 00538b70 NpcAI::ENTITY_SKINNY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 226 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SKINNY(Entity_NPC *npc) { int iVar1; byte bVar2; uint flagsHigh; Entity *pEVar4; int iVar5; char *pcVar6; Vector *resultVec; std_string *anim; Vector *pVVar7; Vector *extraout_ECX; Vector *this; void *stringBuf; float fVar8; float fVar9; Vector local_134; Vector local_12c; Vector local_124; Vector local_11c; bool isFlipped; ProjectileParams projParams; undefined1 local_68 [24]; float fStack_50; float fStack_4c; float local_48; float local_44; float local_40; void *horiAnimName; char local_38 [12]; uint horiAnimSize; uint horiAnimCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 flagsHigh; Room *room; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af47cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; iVar5 = npc->_type; if ((iVar5 == 0xe2) && (npc->_variant == 2)) { puStack_20 = local_38 + 0x34; ENTITY_SKINNY_crispy(npc); ExceptionList = local_1c; return; } iVar1 = npc->_state; if (iVar1 == 0) { npc->_state = 4; puStack_20 = local_38 + 0x34; if (iVar5 == 0xe2) { puStack_20 = local_38 + 0x34; ANM2::PlayOverlay(&npc->_sprite,s_Head,0); iVar5 = npc->_type; } if ((iVar5 != 0xe3) && (iVar5 != 0x115)) { ExceptionList = local_1c; return; } *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); if (iVar5 == 0x115) { local_48 = 0.0; local_68._16_4_ = 0.0; local_68._20_4_ = (void *)0x0; fStack_50 = 0.0; fStack_4c = 0.0; local_44 = 0.0; local_40 = 0.0; local_68._0_4_ = 0.3; local_68._4_4_ = 0.3; local_68._8_4_ = 0.3; local_68._12_4_ = 1.0; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_68); iVar5 = npc->_type; } if (iVar5 != 0xe3) { ExceptionList = local_1c; return; } if (npc->_variant != 1) { ExceptionList = local_1c; return; } (npc->_sprite)._overlayRenderFirst = 1; bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,&DAT_00b611b0,1); if (bVar2 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; ExceptionList = local_1c; return; } if (iVar1 == 4) { if (iVar5 == 0xe2) { puStack_20 = local_38 + 0x34; bVar2 = Entity::IsFrame((Entity *)npc,0x14,npc->_index); if ((bVar2 != 0) && (flagsHigh = Random(), flagsHigh % 3 == 0)) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); bVar2 = Entity::IsHostileTo((Entity *)npc,pEVar4); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,(uint)(npc->_variant == 0) * 2 + 0xa5,0.8,0x78,0,1.0); } } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if ((bVar2 == 0) || (npc->_controllerID != -1)) { bVar2 = 1; iVar5 = 900; fVar9 = 0.5; pVVar7 = Entity_NPC::CalcTargetPosition(npc,&local_11c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar7,fVar9,iVar5,bVar2); } else { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_11c.x = (pEVar4->_pos).x; local_11c.y = (pEVar4->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_11c,0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } local_40 = 2.10195e-44; local_44 = 1.12104e-44; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; fStack_50 = (float)0x74726556; fStack_4c = (float)((uint)fStack_4c & 0xffffff00); horiAnimCapacity = 0xf; horiAnimSize = 8; horiAnimName = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&horiAnimName,(std_string *)(local_68 + 0x14),0.1) ; local_14 = local_14 & 0xffffff00; if (0xf < horiAnimCapacity) { flagsHigh = horiAnimCapacity + 1; stringBuf = horiAnimName; if (0xfff < flagsHigh) { stringBuf = *(void **)((int)horiAnimName + -4); flagsHigh = horiAnimCapacity + 0x24; if (0x1f < (uint)((int)horiAnimName + (-4 - (int)stringBuf))) goto LAB_00538eab; } operator_delete(stringBuf,flagsHigh); } local_14 = 0xffffffff; horiAnimSize = 0; horiAnimCapacity = 0xf; horiAnimName = (void *)((uint)horiAnimName & 0xffffff00); if (0xf < (uint)local_40) { flagsHigh = (int)local_40 + 1; stringBuf = (void *)local_68._20_4_; if (0xfff < flagsHigh) { stringBuf = *(void **)(local_68._20_4_ + -4); flagsHigh = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)stringBuf))) { LAB_00538eab: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(stringBuf,flagsHigh); } bVar2 = Entity::IsFrame((Entity *)npc,7,npc->_index); pcVar6 = puStack_20; if ((bVar2 != 0) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000), pcVar6 = puStack_20, bVar2 == 0)) { flagsHigh = Random(); Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,flagsHigh); iVar5 = __RTDynamicCast(); fVar9 = g_vectorOne.y; fVar8 = g_vectorOne.x * 0.1; *(undefined4 *)(iVar5 + 0x478) = 0x3f000000; *(undefined4 *)(iVar5 + 0x45c) = 0x1e; *(float *)(iVar5 + 0xe4) = fVar8; *(undefined4 *)(iVar5 + 0x460) = 0x1e; *(float *)(iVar5 + 0xe8) = fVar9 * 0.1; pcVar6 = puStack_20; } } else { if ((iVar5 != 0xe3) && (pcVar6 = local_38 + 0x34, iVar5 != 0x115)) goto LAB_00539959; puStack_20 = local_38 + 0x34; bVar2 = Entity::IsFrame((Entity *)npc,0x1e,npc->_index); if ((bVar2 != 0) && (flagsHigh = Random(), flagsHigh % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,0.8,0x78,0,1.0); } local_11c.y = (float)&npc->_pos; room = g_game->_room; iVar5 = Room::GetGridIndex(room,(Vector *)local_11c.y); Room::SetGridPath(room,iVar5,900); PathFinder::UpdateGridIndex((PathFinder *)&npc->_pathfinder); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.25,0); fVar9 = (npc->_velocity).x; fVar8 = (npc->_velocity).y; if (1.0 <= fVar9 * fVar9 + fVar8 * fVar8) { fVar8 = (npc->_velocity).y; if (ABS(fVar9) <= ABS(fVar8)) { if (fVar8 <= 0.0) { pcVar6 = (char *)&DAT_00b1e020; } else { pcVar6 = "WalkDown"; } ANM2::Play(&npc->_sprite,(byte *)pcVar6,0); } else if ((npc->_type == 0xe3) && (npc->_variant == 1)) { pcVar6 = "WalkLeft"; if (0.0 <= fVar9) { pcVar6 = "WalkRight"; } ANM2::Play(&npc->_sprite,(byte *)pcVar6,0); (npc->_sprite)._flipX = 0; } else { ANM2::Play(&npc->_sprite,(byte *)"WalkHori",0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } } else { ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkDown",0); } if (npc->_controllerID == -1) { bVar2 = Entity::IsFrame((Entity *)npc,3,npc->_index); pcVar6 = puStack_20; if ((((bVar2 == 0) || (npc->_spawnerType == 0x38a)) || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), pcVar6 = puStack_20, bVar2 != 0)) || ((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar2 != 0 && (pEVar4 = Entity_NPC::GetPlayerTarget(npc), pcVar6 = puStack_20, pEVar4->_type == 1)))) goto LAB_00539959; room = g_game->_room; pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_134.y = (pEVar4->_pos).x; local_124.y = (pEVar4->_pos).y; pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (pEVar4->_velocity).x; local_12c.y = (pEVar4->_velocity).y; flagsHigh = Random(); fVar8 = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 16.0; local_134.x = fVar9 * fVar8 + local_134.y; local_134.y = local_12c.y * fVar8 + local_124.y; Room::GetClampedPositionImpl(room,&local_124,&local_134,20.0,20.0,20.0,20.0); room = g_game->_room; iVar5 = (npc->_pathfinder)._gridIndex; iVar1 = room->_gridWidth; local_12c.x = (float)(iVar5 % iVar1) * 40.0 + 40.0; local_12c.y = (float)(iVar5 / iVar1) * 40.0 + 120.0; fVar8 = local_12c.x - local_124.x; fVar9 = local_12c.y - local_124.y; if (((20.0 <= ABS(fVar8)) && (pcVar6 = puStack_20, 20.0 <= ABS(fVar9))) || ((fVar9 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8), pcVar6 = puStack_20, 200.0 <= fVar9 || (bVar2 = Room::CheckLine(room,&local_12c,&local_124,3,999,0,0,(Vector *)0x0), pcVar6 = puStack_20, bVar2 == 0)))) goto LAB_00539959; npc->_state = 8; npc->_stateFrame = 0; local_124.x = local_124.x - *(float *)local_11c.y; pVVar7 = (Vector *)(local_124.y - *(float *)((int)local_11c.y + 4)); if (ABS((float)pVVar7) < ABS(local_124.x)) { if ((npc->_type == 0xe3) && (npc->_variant == 1)) { isFlipped = false; pcVar6 = "AttackLeft"; if (0.0 <= local_124.x) { pcVar6 = "AttackRight"; } } else { pcVar6 = "AttackHori"; isFlipped = local_124.x < 0.0; } ANM2::Play(&npc->_sprite,(byte *)pcVar6,0); (npc->_sprite)._flipX = isFlipped; pcVar6 = puStack_20; goto LAB_00539959; } } else { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); pcVar6 = puStack_20; if (bVar2 != 0) goto LAB_00539959; bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar2 == 0) { bVar2 = Entity_NPC::IsControllerActionPressed(npc,9); pcVar6 = puStack_20; if (bVar2 == 0) goto LAB_00539959; pVVar7 = Entity_NPC::GetAimTargetPosition(npc,&local_11c); bVar2 = Vector::operator_ne(pVVar7,&npc->_pos); pcVar6 = puStack_20; if (bVar2 == 0) goto LAB_00539959; } Entity_NPC::SpawnControlTarget(npc,0,160.0); npc->_state = 8; npc->_stateFrame = 0; Entity_NPC::UpdateControllerMovement(npc,1); pVVar7 = Entity_NPC::GetAimTargetPosition(npc,&local_124); bVar2 = Vector::operator_ne(pVVar7,&npc->_pos); if (bVar2 == 0) { local_11c.x = (npc->_controllerMovement).x; local_11c.y = (npc->_controllerMovement).y; } else { pVVar7 = Entity_NPC::GetAimTargetPosition(npc,&local_12c); local_11c.x = pVVar7->x - (npc->_pos).x; local_11c.y = pVVar7->y - (npc->_pos).y; } pVVar7 = (Vector *)local_11c.y; if (ABS(local_11c.y) < ABS(local_11c.x)) { if ((npc->_type == 0xe3) && (npc->_variant == 1)) { isFlipped = false; pcVar6 = "AttackLeft"; if (0.0 <= local_11c.x) { pcVar6 = "AttackRight"; } } else { pcVar6 = "AttackHori"; isFlipped = local_11c.x < 0.0; } ANM2::Play(&npc->_sprite,(byte *)pcVar6,0); (npc->_sprite)._flipX = isFlipped; pcVar6 = puStack_20; goto LAB_00539959; } } if ((float)pVVar7 <= 0.0) { ANM2::Play(&npc->_sprite,(byte *)"AttackUp",0); pcVar6 = puStack_20; } else { ANM2::Play(&npc->_sprite,(byte *)"AttackDown",0); pcVar6 = puStack_20; } } goto LAB_00539959; } pcVar6 = local_38 + 0x34; if (iVar1 != 8) goto LAB_00539959; Entity_NPC::SpawnControlTarget(npc,0,160.0); resultVec = Entity_NPC::GetAimTargetPosition(npc,&local_11c); pVVar7 = &npc->_pos; local_11c.x = resultVec->x - pVVar7->x; local_11c.y = resultVec->y - (npc->_pos).y; if ((local_11c.x != g_vectorZero.x) || (local_11c.y != g_vectorZero.y)) { resultVec = Vector::Normalized(&local_11c,&local_124); (npc->_controllerMovement).x = resultVec->x; (npc->_controllerMovement).y = resultVec->y; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_005398a3: if ((npc->_type == 0x115) && (npc->_stateFrame < 2)) { anim = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)(local_68 + 0x14)); local_14 = 2; if (0xf < anim->_capacity) { anim = *(std_string **)anim->_buf; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)anim,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } local_14 = 0xffffffff; if (0xf < (uint)local_40) { flagsHigh = (int)local_40 + 1; stringBuf = (void *)local_68._20_4_; if (0xfff < flagsHigh) { stringBuf = *(void **)(local_68._20_4_ + -4); flagsHigh = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)stringBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(stringBuf,flagsHigh); } npc->_stateFrame = npc->_stateFrame + 1; } else { npc->_state = 4; } } else { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { if ((npc->_controllerID == -1) || (bVar2 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar2 == 0)) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); this = &local_11c; resultVec = &local_12c; local_11c.x = (pEVar4->_pos).x - pVVar7->x; local_11c.y = (pEVar4->_pos).y - (npc->_pos).y; } else { resultVec = &local_124; this = extraout_ECX; } resultVec = Vector::Resized(this,resultVec,10.0); local_134.x = resultVec->x; local_134.y = resultVec->y; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; if (npc->_type == 0x115) { projParams.Color._tint[0] = 0.4; projParams.Color._tint[1] = 0.4; projParams.Color._tint[2] = 0.4; projParams.Color._tint[3] = 1.0; } else if ((npc->_type == 0xe3) && (npc->_variant == 1)) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (npc->_pos).y - (pEVar4->_pos).y; fVar8 = pVVar7->x - (pEVar4->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8); resultVec = Entity_NPC::GetAimTargetPosition(npc,&local_11c); bVar2 = Vector::operator_ne(resultVec,pVVar7); if (bVar2 != 0) { resultVec = Entity_NPC::GetAimTargetPosition(npc,&local_11c); fVar9 = (npc->_pos).y - resultVec->y; fVar8 = pVVar7->x - resultVec->x; fVar9 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8); if (fVar9 <= 20.0) { fVar9 = 20.0; } if (240.0 <= fVar9) { fVar9 = 240.0; } } local_12c.y = fVar9 / 10.0; projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x2000; fVar9 = pow(0.9,local_12c.y); local_124.y = 0.01; local_11c.y = (fVar9 - 1.0) * -9.491221; pVVar7 = &local_11c; if (local_11c.y <= 0.01) { pVVar7 = &local_124; } flagsHigh = Random(); projParams.FallingAccelModifier = 1.0; projParams.FallingSpeedModifier = ((float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8) * ((18.0 - (local_12c.y - pVVar7->y) * 11.0) / pVVar7->y); } Entity_NPC::PlaySound(npc,0xf9,1.0,2,0,1.0); Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_134,0,&projParams); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_005398a3; } npc->_friction = npc->_friction * 0.3; pcVar6 = puStack_20; LAB_00539959: puStack_20 = pcVar6; if (npc->_dead != 0) { if (npc->_type == 0xe2) { if (npc->_variant == 1) { flagsHigh = Random(); if ((flagsHigh & 1) == 0) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); Entity_NPC::Morph(npc,0xe3,0,0,-1); npc->_health = npc->_maxHitPoints; npc->_dead = 0; } else if (npc->_championRegenCount == 0) { pVVar7 = MusicManager::RandomVector(&local_124); local_12c.x = pVVar7->x + pVVar7->x; local_12c.y = pVVar7->y + pVVar7->y; local_124.y = local_12c.y; local_11c.y = local_12c.x; flagsHigh = Random(); pEVar4 = Game::Spawn(g_game,0x12,0,&npc->_pos,&local_12c,(Entity *)npc,0,flagsHigh); flagsHigh = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = flagsHigh; flagsHigh = Random(); if ((flagsHigh & 1) == 0) { flagsHigh = Random(); local_11c.x = -local_11c.y; local_11c.y = -local_124.y; pEVar4 = Game::Spawn(g_game,0x12,0,&npc->_pos,&local_11c,(Entity *)npc,0,flagsHigh); flagsHigh = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = flagsHigh; } } } } else if ((npc->_type == 0x115) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar2 == 0)) { pVVar7 = &npc->_pos; Game::BombDamage(g_game,pVVar7,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); Game::spawn_bomb_crater(g_game,pVVar7,(Entity *)0x0,1.0); flagsHigh = Random(); Game::Spawn(g_game,1000,1,pVVar7,&g_vectorZero,(Entity *)0x0,0,flagsHigh); } } npc->_friction = npc->_friction * 0.8; ExceptionList = local_1c; return; } //@@ 00539b90 NpcAI::ENTITY_HOMUNCULUS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 228 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HOMUNCULUS(Entity_NPC *npc) { char *pcVar1; byte bVar2; uint uVar3; uint uVar4; Entity *pEVar5; int *piVar6; Vector *pVVar7; uint rngResult; byte *animNameCh; Vector *pVVar8; ProjectileParams *params; byte *expectedNameCh; void *pvVar9; int iVar10; int iVar11; bool bVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; float topWallY; undefined4 uVar19; TypeDescriptor *pTVar20; TypeDescriptor *pTVar21; undefined4 uVar22; undefined4 local_160 [11]; Vector outVec; Vector scratchVec; Vector local_124; void *local_11c; Entity_NPC *local_118; char isLeashTaut; ProjectileParams projParams; undefined1 local_68 [24]; float local_50; undefined1 local_4c; float local_44; float local_40; void *local_3c; char local_38 [12]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *curOverlayAnimData; Game *game; int gridWidth; EntityPtr parent; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00af2a65; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; iVar10 = npc->_state; local_118 = npc; local_24 = uVar3; if (iVar10 == 0) { npc->_state = 3; if (npc->_variant == 0) { npc->_stateFrame = 0; puStack_20 = local_38 + 0x34; bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"Awaken",1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } game = g_game; if (((npc->_spawnerType == 0x109) && (npc->_spawnerVariant == 1)) && (npc->_type == 0xfb)) { npc->_i2 = 1; } else { pVVar7 = &npc->_pos; npc->_i2 = 0; npc->_i1 = -1; pvVar9 = game->_room; fVar14 = pVVar7->x; fVar16 = *(float *)((int)pvVar9 + 0x14) - 20.0; topWallY = *(float *)((int)pvVar9 + 0x18) + 0.0; fVar17 = *(float *)((int)pvVar9 + 0x1c) + 20.0; fVar18 = *(float *)((int)pvVar9 + 0x20) + 40.0; fVar13 = ABS(fVar16 - fVar14); fVar15 = 10000.0; if (fVar13 < 10000.0) { fVar14 = (npc->_pos).y; (npc->_targetPosition).x = fVar16; (npc->_targetPosition).y = fVar14; fVar14 = (npc->_pos).x; fVar15 = fVar13; } fVar13 = ABS(fVar17 - fVar14); if (fVar13 < fVar15) { fVar14 = (npc->_pos).y; (npc->_targetPosition).x = fVar17; (npc->_targetPosition).y = fVar14; fVar14 = (npc->_pos).x; fVar15 = fVar13; } fVar13 = (npc->_pos).y; if (ABS(topWallY - fVar13) < fVar15) { (npc->_targetPosition).x = fVar14; (npc->_targetPosition).y = topWallY; fVar14 = (npc->_pos).x; fVar15 = (topWallY - 20.0) - fVar13; fVar13 = (npc->_pos).y; fVar15 = ABS(fVar15); } if (ABS(fVar18 - fVar13) < fVar15) { (npc->_targetPosition).x = fVar14; (npc->_targetPosition).y = fVar18; fVar15 = ABS((fVar18 - 20.0) - fVar13); } if (40.0 < fVar15) { local_11c = game->_room; uVar3 = 0; pVVar8 = &npc->_pos; do { iVar11 = (int)(((pVVar7->x + *(float *)((int)&DAT_00c5c82c + uVar3)) - 40.0) / 40.0 + 0.5); iVar10 = (int)(((pVVar8->y + *(float *)((int)&DAT_00c5c830 + uVar3)) - 120.0) / 40.0 + 0.5); if (-1 < iVar11) { gridWidth = *(int *)((int)local_11c + 0xc); npc = local_118; if ((((iVar11 < gridWidth) && (-1 < iVar10)) && ((iVar10 < *(int *)((int)local_11c + 0x10) && ((uVar4 = gridWidth * iVar10 + iVar11, uVar4 < 0x1c0 && (iVar10 = *(int *)((int)local_11c + uVar4 * 4 + 0x24), iVar10 != 0)))))) && (*(int *)(iVar10 + 0x3c) == 3)) { iVar11 = *(int *)(iVar10 + 0x24); (local_118->_targetPosition).x = (float)(iVar11 % gridWidth) * 40.0 + 40.0; (local_118->_targetPosition).y = (float)(iVar11 / gridWidth) * 40.0 + 120.0; local_118->_i1 = *(int *)(iVar10 + 0x24); break; } } uVar3 = uVar3 + 8; } while (uVar3 < 0x20); pVVar7 = &npc->_pos; } local_118 = (Entity_NPC *)((npc->_targetPosition).y - pVVar7->y); local_124.y = (npc->_targetPosition).x - pVVar7->x; fVar14 = sqrtf((float)local_118 * (float)local_118 + local_124.y * local_124.y); if (100.0 < fVar14) { fVar15 = npc->_speedMultiplier; fVar14 = (100.0 / fVar14 - 1.0) * 0.01; (npc->_velocity).x = local_124.y * fVar14 * fVar15 + (npc->_velocity).x; (npc->_velocity).y = (float)local_118 * fVar14 * fVar15 + (npc->_velocity).y; } local_11c = (void *)0x0; local_118 = (Entity_NPC *)0x7; do { if ((npc->_i1 < 0) || (local_11c != (void *)0x0)) { uVar3 = Random(); uVar22 = 0; pTVar21 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar20 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar19 = 0; pEVar5 = Game::Spawn(g_game,npc->_type,10,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar3); piVar6 = (int *)__RTDynamicCast(pEVar5,uVar19,pTVar20,pTVar21,uVar22); if (piVar6[0xef] != 0) { local_124.y = (float)(piVar6 + 0xef); std::multiset::erase(&local_124.y); } piVar6[0xef] = (int)npc; std::multiset::insert(piVar6 + 0xef); piVar6[0xcd] = (int)(npc->_targetPosition).x; fVar14 = (npc->_targetPosition).y; piVar6[0x5a] = piVar6[0x5a] & 0xfffffffb; piVar6[0xce] = (int)fVar14; piVar6[0x5b] = piVar6[0x5b]; piVar6[0x2ed] = (int)((float)(int)local_11c / 7.0); if (-1 < npc->_i1) { piVar6[0x37] = 0; piVar6[0x38] = (int)((float)(int)local_118 + (float)(int)local_118); } (**(code **)(*piVar6 + 0xc))(); pVVar7 = &npc->_pos; } local_118 = (Entity_NPC *)((int)local_118 - 1); local_11c = (void *)((int)local_11c + 1); } while (local_118 < 0x80000000); } } else if (npc->_variant == 10) { puStack_20 = local_38 + 0x34; ANM2::Play(&npc->_sprite,(byte *)"UmbilicalCord",0); uVar19 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; npc->_renderZOffset = -1000; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar19; } if (npc->_type != 0xfb) { ExceptionList = local_1c; return; } if (&npc->_splatColor == (ColorMod *)local_160) { ExceptionList = local_1c; return; } (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.1; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; ExceptionList = local_1c; return; } if (iVar10 == 3) { if (npc->_variant == 0) { puStack_20 = local_38 + 0x34; if (npc->_stateFrame == 0) { puStack_20 = local_38 + 0x34; bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"Awaken",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } npc->_stateFrame = npc->_stateFrame + 1; } pcVar1 = puStack_20; if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; npc->_stateFrame = 0; } } else { pcVar1 = local_38 + 0x34; if (npc->_variant == 10) { parent = npc->_parent; if ((parent == (EntityPtr)0x0) || (*(int *)((int)parent + 0xb64) == 8)) { puStack_20 = local_38 + 0x34; if (npc->_type == 0xe4) { puStack_20 = local_38 + 0x34; uVar4 = Random(); pVVar7 = MusicManager::RandomVector(&scratchVec); rngResult = Random(); npc = local_118; uVar22 = 0; pTVar21 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar20 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar19 = 0; fVar14 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 20.0; local_124.y = fVar14 * pVVar7->y + (local_118->_pos).y; local_124.x = fVar14 * pVVar7->x + (local_118->_pos).x; pEVar5 = Game::Spawn(g_game,1000,0x16,&local_124,&g_vectorZero,(Entity *)local_118,0, uVar4); iVar10 = __RTDynamicCast(pEVar5,uVar19,pTVar20,pTVar21,uVar22); uVar4 = Random(); fVar15 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 + 0.25; fVar14 = fVar15 * g_vectorOne.x; *(float *)(iVar10 + 0xe8) = fVar15 * g_vectorOne.y; *(float *)(iVar10 + 0xe4) = fVar14; } (**(code **)(*(int *)npc + 0x28))(uVar3); pcVar1 = puStack_20; } else { fVar14 = (npc->_v1).y; fVar15 = *(float *)((int)parent + 0x340); fVar13 = (npc->_sprite)._offset.y; fVar16 = (npc->_targetPosition).y; fVar18 = ABS(fVar14 - 0.5) + ABS(fVar14 - 0.5); fVar17 = (npc->_targetPosition).x; (npc->_pos).x = ((*(float *)((int)parent + 0x33c) - (npc->_sprite)._offset.x) - fVar17) * fVar14 + fVar17 + 0.0; (npc->_pos).y = (1.0 - fVar18 * fVar18) * 10.0 + ((fVar15 - fVar13) - fVar16) * fVar14 + fVar16 + 7.0 ; npc->_friction = 0.0; pcVar1 = local_38 + 0x34; } } } } else if (iVar10 == 4) { curOverlayAnimData = (npc->_sprite)._overlayAnimState._animData; if (curOverlayAnimData == (byte *)0x0) { LAB_0053a41e: puStack_20 = local_38 + 0x34; bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { animNameCh = curOverlayAnimData; if (0xf < *(uint *)(curOverlayAnimData + 0x14)) { animNameCh = *(byte **)curOverlayAnimData; } expectedNameCh = s_Head; do { bVar2 = *animNameCh; bVar12 = bVar2 < *expectedNameCh; if (bVar2 != *expectedNameCh) { LAB_0053a400: uVar3 = -(uint)bVar12 | 1; goto LAB_0053a405; } if (bVar2 == 0) break; bVar2 = animNameCh[1]; bVar12 = bVar2 < expectedNameCh[1]; if (bVar2 != expectedNameCh[1]) goto LAB_0053a400; animNameCh = animNameCh + 2; expectedNameCh = expectedNameCh + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053a405: if ((uVar3 != 0) || ((puStack_20 = local_38 + 0x34, curOverlayAnimData[0x34] != 0 && (puStack_20 = local_38 + 0x34, (npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_0053a41e; } if (((npc->_spawnerType == 0x109) && (npc->_spawnerVariant == 1)) && (npc->_type == 0xfb)) { npc->_state = 8; pcVar1 = puStack_20; } else { if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { bVar2 = 1; iVar10 = 0; fVar14 = 1.5; pVVar7 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar7,fVar14,iVar10,bVar2); } else { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_124.x = (pEVar5->_pos).x; local_124.y = (pEVar5->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_124,0); if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.8; } } local_118 = (Entity_NPC *)(npc->_pos).x; local_11c = (void *)(npc->_velocity).x; local_124.y = (npc->_targetPosition).x; isLeashTaut = '\0'; fVar15 = ((float)local_118 + (float)local_11c) - local_124.y; fVar14 = ((npc->_velocity).y + (npc->_pos).y) - (npc->_targetPosition).y; if (10000.0 < fVar14 * fVar14 + fVar15 * fVar15) { scratchVec.x = (float)local_118 - local_124.y; if (npc->_controllerID == -1) { npc->_friction = npc->_friction * 0.2; scratchVec.y = (npc->_pos).y - (npc->_targetPosition).y; pVVar7 = Vector::Normalized(&scratchVec,&outVec); fVar14 = pVVar7->y; fVar15 = (npc->_targetPosition).y; (npc->_pos).x = pVVar7->x * 100.0 + local_124.y; (npc->_pos).y = fVar14 * 100.0 + fVar15; } else { npc->_friction = npc->_friction * 0.85; scratchVec.y = (npc->_pos).y - (npc->_targetPosition).y; pVVar7 = Vector::Normalized(&scratchVec,&outVec); fVar14 = npc->_speedMultiplier; fVar15 = pVVar7->x; (npc->_velocity).y = ((pVVar7->y * 100.0 + (npc->_targetPosition).y) - (npc->_pos).y) * 0.8 * fVar14 + (npc->_velocity).y; (npc->_velocity).x = (float)local_11c + ((local_124.y + fVar15 * 100.0) - (float)local_118) * 0.8 * fVar14 ; } isLeashTaut = '\x01'; } bVar2 = Entity_NPC::IsControllerActionTriggered(npc,9); if (((bVar2 != 0) && (isLeashTaut != '\0')) && (uVar3 = Random(), (uVar3 & 3) == 0)) { npc->_i2 = 1; } iVar10 = npc->_stateFrame; npc->_stateFrame = iVar10 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if ((isLeashTaut == '\0') || (((((*(int *)((int)g_game->_room + 0x1bb0) == 0x35 || (uVar3 = Random(), iVar10 <= (int)(uVar3 % 0x1e + 0x3c))) || (bVar2 = Entity::IsFrame((Entity *)npc,0x1e,npc->_index), bVar2 == 0)) || (uVar3 = Random(), uVar3 % 5 != 0)) && (npc->_i2 < 1)))) { iVar10 = npc->_i1; pcVar1 = puStack_20; if (iVar10 < 0) goto LAB_0053a9ee; pvVar9 = g_game->_room; piVar6 = *(int **)(*(int *)((int)pvVar9 + 4) + 0x10); if (((piVar6 == (int *)0x0) || (piVar6[2] != 0x10)) || (*piVar6 != 0x23)) { iVar11 = *(int *)((int)pvVar9 + iVar10 * 4 + 0x24); if (iVar11 == 0) { iVar10 = *(int *)((int)pvVar9 + iVar10 * 4 + 0x76c); if (iVar10 < 3000) { if (iVar10 < 1000) goto LAB_0053a7d1; } else if (iVar10 < 4000) goto LAB_0053a7d1; goto LAB_0053a9ee; } if (1 < *(int *)(iVar11 + 0x3c)) goto LAB_0053a9ee; } } LAB_0053a7d1: npc->_state = 8; pVVar7 = &npc->_targetPosition; if (npc->_i1 < 0) { pVVar8 = Room::GetClampedPositionImpl(g_game->_room,&outVec,pVVar7,30.0,0.0,10.0,0.0); (npc->_targetPosition).x = pVVar8->x; (npc->_targetPosition).y = pVVar8->y; } else { local_124.y = pVVar7->x; scratchVec.x = (npc->_pos).x - local_124.y; scratchVec.y = (npc->_pos).y - (npc->_targetPosition).y; pVVar8 = Vector::Resized(&scratchVec,&outVec,60.0); (npc->_targetPosition).x = local_124.y + pVVar8->x; (npc->_targetPosition).y = pVVar8->y + (npc->_targetPosition).y; } params = ProjectileParams::ProjectileParams(&projParams); scratchVec.x = 10.0; scratchVec.y = 6.0; Entity_NPC::FireProjectiles(npc,pVVar7,&scratchVec,9,params); game = g_game; pcVar1 = puStack_20; if (npc->_type == 0xfb) { g_game->_darknessStrength = 1.0; game->_darknessTimeout = 0x96; } } } else { pcVar1 = local_38 + 0x34; if (iVar10 == 8) { pcVar1 = local_38 + 0x34; if (npc->_type == 0xfb) { Color::operator_assign((Color *)local_68,&(npc->_sprite)._color); local_68._12_4_ = (float)local_68._12_4_ - 0.1; Sprite::SetColor((Sprite *)&npc->_sprite,(ColorMod *)local_68); npc->_visible = 0.0 < (float)local_68._12_4_; pcVar1 = puStack_20; } puStack_20 = pcVar1; bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar2 == 0) { bVar2 = 1; iVar10 = 900; fVar14 = 2.0; pVVar7 = Entity_NPC::CalcTargetPosition(npc,&outVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar7,fVar14,iVar10,bVar2); pcVar1 = puStack_20; } else { pEVar5 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar5->_pos).x; scratchVec.y = (pEVar5->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); pcVar1 = puStack_20; if (0 < (npc->_pathfinder)._evadeMovementCountdown) { npc->_friction = npc->_friction * 0.9; } } } } LAB_0053a9ee: puStack_20 = pcVar1; if ((npc->_flags & 0x200) != 0) { npc->_friction = npc->_friction * 0.8; } if (npc->_variant == 0) { local_40 = 2.10195e-44; local_44 = 1.12104e-44; local_4c = 0; npc->_friction = npc->_friction * 0.8; local_68[0x14] = 'W'; local_68[0x15] = 'a'; local_68[0x16] = 'l'; local_68[0x17] = 'k'; local_50 = (float)0x74726556; local_28 = 0xf; local_2c = 8; local_3c = (void *)0x6b6c6157; builtin_strncpy(local_38,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&local_3c,(std_string *)(local_68 + 0x14),0.1); if (0xf < local_28) { uVar3 = local_28 + 1; pvVar9 = local_3c; if (0xfff < uVar3) { pvVar9 = *(void **)((int)local_3c + -4); uVar3 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar9))) goto LAB_0053ab08; } operator_delete(pvVar9,uVar3); } local_2c = 0; local_28 = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < (uint)local_40) { uVar3 = (int)local_40 + 1; pvVar9 = (void *)local_68._20_4_; if (0xfff < uVar3) { pvVar9 = *(void **)(local_68._20_4_ + -4); uVar3 = (int)local_40 + 0x24; if (0x1f < (uint)(local_68._20_4_ + (-4 - (int)pvVar9))) { LAB_0053ab08: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar3); } } ExceptionList = local_1c; return; } //@@ 0053ab40 NpcAI::ENTITY_OOB /* NPC AI for entity type 224 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_OOB(Entity_NPC *npc) { byte bVar1; uint uVar2; Vector *pVVar3; byte *pbVar4; byte *pbVar5; char *expectedAnimChar; int iVar6; bool isCharLess; float fVar7; float fVar8; float moveDirY; float moveDirX; Vector scratchVec; undefined4 defaultSplatColor [12]; float speedMultiplier; iVar6 = npc->_state; npc->_entityCollisionClass = 2; if (iVar6 == 0) { npc->_entityGridCollisionClass = 3; npc->_state = 4; if (npc->_controllerID == -1) { uVar2 = Random(); uVar2 = uVar2 % 0x2d; } else { uVar2 = 0; } npc->_i1 = uVar2 + 0x1e; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; if (&npc->_splatColor == (ColorMod *)defaultSplatColor) { return; } (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.1; (npc->_splatColor)._tint[0] = 0.5; (npc->_splatColor)._tint[1] = 0.1; (npc->_splatColor)._tint[2] = 0.1; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.1; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; return; } if (iVar6 == 4) { ANM2::Play(&npc->_sprite,s_Walk,0); pVVar3 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,10.0); moveDirX = pVVar3->x - (npc->_pos).x; moveDirY = pVVar3->y - (npc->_pos).y; if (npc->_controllerID != -1) { pVVar3 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); moveDirX = pVVar3->x * 100.0; moveDirY = pVVar3->y * 100.0; } if (((npc->_flags & 0x200) != 0) && (npc->_controllerID == -1)) { iVar6 = npc->_index; uVar2 = Random(); bVar1 = Entity::IsFrame((Entity *)npc,uVar2 % 0x1e + 0xf,iVar6); if ((bVar1 == 0) && (npc->_collidesWithGrid == 0)) { moveDirX = (npc->_v1).x; moveDirY = (npc->_v1).y; } else { (npc->_v1).x = moveDirX; (npc->_v1).y = moveDirY; } fVar8 = moveDirY * moveDirY + moveDirX * moveDirX; if (((fVar8 < 400.0) && (fVar8 != 0.0)) && (fVar8 = sqrtf(fVar8), 0.0 < fVar8)) { moveDirY = moveDirY * (20.0 / fVar8); moveDirX = (20.0 / fVar8) * moveDirX; } } scratchVec.x = npc->_friction * 0.8; moveDirY = moveDirY * 3.0; npc->_friction = scratchVec.x; fVar8 = sqrtf(moveDirX * moveDirX + moveDirY * moveDirY); if (fVar8 <= 0.0) { fVar7 = moveDirX; fVar8 = moveDirY; } else { fVar7 = (1.0 / fVar8) * moveDirX; fVar8 = moveDirY * (1.0 / fVar8); } if (scratchVec.x != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = (fVar7 * speedMultiplier) / scratchVec.x + (npc->_velocity).x; (npc->_velocity).y = (fVar8 * speedMultiplier) / scratchVec.x + (npc->_velocity).y; } if ((npc->_flags & 0x1000a00) != 0) goto LAB_0053aff1; if (-1 < npc->_i1) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1; } if (npc->_controllerID == -1) { if ((20.0 <= ABS(moveDirY)) || (npc->_updateTime <= 45.0)) goto LAB_0053aeb3; LAB_0053af1a: (npc->_sprite)._flipX = moveDirX < 0.0; bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_entityGridCollisionClass = 2; npc->_state = 8; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar1 != 0) goto LAB_0053af1a; LAB_0053aeb3: if (-1 < npc->_i1) goto LAB_0053aff1; if (npc->_controllerID == -1) { LAB_0053af94: uVar2 = Random(); iVar6 = uVar2 % 0x2d + 0x1e; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,8); if (bVar1 == 0) goto LAB_0053aff1; if (npc->_controllerID == -1) goto LAB_0053af94; iVar6 = 0x1e; } npc->_i1 = iVar6; bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Spawn,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 0xd; } npc->_stateFrame = 0; (npc->_velocity).x = 0.0; (npc->_velocity).y = 0.0; LAB_0053aff1: fVar8 = (npc->_velocity).x; if ((fVar8 < 0.0) && ((npc->_sprite)._flipX == 0)) { (npc->_sprite)._flipX = 1; return; } if ((0.0 < fVar8) && ((npc->_sprite)._flipX != 0)) { (npc->_sprite)._flipX = 0; return; } return; } if (iVar6 != 8) { if (iVar6 != 0xd) { return; } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 == 0) { return; } scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; iVar6 = Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); if (iVar6 == 0) { Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); uVar2 = Random(); Game::SpawnEx(g_game,0x20,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar2,0); return; } return; } goto LAB_0053b213; } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { pbVar4 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar4 = *(byte **)pbVar5; } expectedAnimChar = "Charge Shake"; do { bVar1 = *pbVar4; isCharLess = bVar1 < (byte)*expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_0053b0a8: uVar2 = -(uint)isCharLess | 1; goto LAB_0053b0ad; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isCharLess = bVar1 < (byte)expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_0053b0a8; pbVar4 = pbVar4 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0053b0ad: if ((uVar2 == 0) && ((pbVar5[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053b0e4; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge Shake",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0053b0e4: if ((npc->_sprite)._animState._animData != (void *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { LAB_0053b12c: bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 == 0) goto LAB_0053b15c; } else { pbVar5 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } expectedAnimChar = "Charge Shake"; do { bVar1 = *pbVar5; isCharLess = bVar1 < (byte)*expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_0053b123: uVar2 = -(uint)isCharLess | 1; goto LAB_0053b128; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; isCharLess = bVar1 < (byte)expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_0053b123; pbVar5 = pbVar5 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0053b128: if (uVar2 != 0) goto LAB_0053b12c; } if ((npc->_sprite)._flipX == 0) { (npc->_velocity).x = 25.0; } else { (npc->_velocity).x = (float)&DAT_c1c80000; } } LAB_0053b15c: fVar8 = (npc->_velocity).x; if ((fVar8 <= 0.0) || ((npc->_pos).x <= *(float *)((int)g_game->_room + 0x1c) + 160.0)) { if ((fVar8 < 0.0) && (fVar7 = *(float *)((int)g_game->_room + 0x14) - 160.0, (npc->_pos).x <= fVar7 && fVar7 != (npc->_pos).x)) { fVar7 = *(float *)((int)g_game->_room + 0x1c) + 160.0; goto LAB_0053b1c6; } } else { fVar7 = *(float *)((int)g_game->_room + 0x14) - 160.0; LAB_0053b1c6: npc->_stateFrame = npc->_stateFrame + 1; (npc->_pos).x = fVar7; } if (npc->_stateFrame < 1) { return; } if ((0.0 <= fVar8) || (fVar7 = (npc->_targetPosition).x, fVar7 < (npc->_pos).x || fVar7 == (npc->_pos).x)) { if (fVar8 <= 0.0) { return; } fVar8 = (npc->_pos).x; if (fVar8 < (npc->_targetPosition).x || fVar8 == (npc->_targetPosition).x) { return; } } npc->_entityGridCollisionClass = 3; LAB_0053b213: npc->_state = 4; return; } //@@ 0053b2f0 NpcAI::ENTITY_BLACK_MAW /* NPC AI for entity type 225 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BLACK_MAW(Entity_NPC *npc) { byte bVar1; Vector *vecResult; uint uVar2; int iVar3; byte *curAnimName; byte *pbVar4; char *cmpName; bool isLess; float fVar5; float chargeVelocityX; float fVar6; float moveDirY; Vector local_44; Vector scratchVec; undefined4 local_34 [12]; float speedMultiplier; iVar3 = npc->_state; if (iVar3 == 0) { npc->_entityGridCollisionClass = 3; npc->_state = 4; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; if (&npc->_splatColor == (ColorMod *)local_34) { return; } (npc->_splatColor)._tint[0] = 0.1; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; return; } if (0 < npc->_i1) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1; } if (iVar3 == 4) { ANM2::Play(&npc->_sprite,s_Walk,0); vecResult = Entity_NPC::CalcTargetPosition(npc,&scratchVec,10.0); local_44.x = vecResult->x - (npc->_pos).x; moveDirY = vecResult->y - (npc->_pos).y; if (npc->_controllerID != -1) { vecResult = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); local_44.x = vecResult->x * 100.0; moveDirY = vecResult->y * 100.0; } if (((npc->_flags & 0x200) != 0) && (npc->_controllerID == -1)) { iVar3 = npc->_index; uVar2 = Random(); bVar1 = Entity::IsFrame((Entity *)npc,uVar2 % 0x1e + 0xf,iVar3); if ((bVar1 == 0) && (npc->_collidesWithGrid == 0)) { local_44.x = (npc->_v1).x; moveDirY = (npc->_v1).y; } else { (npc->_v1).x = local_44.x; (npc->_v1).y = moveDirY; } fVar5 = local_44.x * local_44.x + moveDirY * moveDirY; if (((fVar5 < 400.0) && (fVar5 != 0.0)) && (fVar5 = sqrtf(fVar5), 0.0 < fVar5)) { local_44.x = local_44.x * (20.0 / fVar5); moveDirY = moveDirY * (20.0 / fVar5); } } scratchVec.x = npc->_friction * 0.8; npc->_friction = scratchVec.x; fVar5 = sqrtf(local_44.x * local_44.x + moveDirY * moveDirY); if (fVar5 <= 0.0) { fVar6 = moveDirY; fVar5 = local_44.x; } else { fVar6 = (1.0 / fVar5) * moveDirY; fVar5 = (1.0 / fVar5) * local_44.x; } if (scratchVec.x != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = (fVar5 * speedMultiplier) / scratchVec.x + (npc->_velocity).x; (npc->_velocity).y = (fVar6 * speedMultiplier) / scratchVec.x + (npc->_velocity).y; } (npc->_sprite)._flipX = local_44.x < 0.0; if ((npc->_flags & 0x1000a00) != 0) goto LAB_0053b985; if (npc->_controllerID == -1) { if ((ABS(moveDirY) < 20.0) && (45.0 < npc->_updateTime)) goto LAB_0053b679; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar1 != 0) { LAB_0053b679: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 8; (npc->_velocity).y = 0.0; (npc->_velocity).x = 0.0; npc->_stateFrame = 0; npc->_entityGridCollisionClass = 2; goto LAB_0053b985; } } if (npc->_controllerID == -1) { uVar2 = Random(); if (uVar2 % 0x78 != 0) goto LAB_0053b985; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,8); if ((bVar1 == 0) || (0 < npc->_i1)) goto LAB_0053b985; } iVar3 = Entity_NPC::GetAliveEnemyCount(npc); if (iVar3 < 8) { bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Summon",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 0xd; (npc->_velocity).y = 0.0; (npc->_velocity).x = 0.0; npc->_stateFrame = 0; npc->_i1 = 0x5a; } goto LAB_0053b985; } if (iVar3 != 8) { if (iVar3 == 9) { bVar1 = (npc->_sprite)._flipX; (npc->_velocity).y = 0.0; if (bVar1 == 0) { fVar5 = 18.0; } else { fVar5 = -18.0; } (npc->_velocity).x = fVar5; if ((npc->_stateFrame < 1) || (((0.0 <= fVar5 || (fVar6 = (npc->_targetPosition).x, fVar6 < (npc->_pos).x || fVar6 == (npc->_pos).x)) && ((fVar5 <= 0.0 || (fVar5 = (npc->_pos).x, fVar5 < (npc->_targetPosition).x || fVar5 == (npc->_targetPosition).x)))))) goto LAB_0053b985; } else { if (iVar3 != 0xd) goto LAB_0053b985; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Summon"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); uVar2 = Random(); vecResult = MusicManager::RandomVector(&local_44); scratchVec.x = vecResult->x * 20.0 + (npc->_pos).x; scratchVec.y = vecResult->y * 20.0 + (npc->_pos).y; Game::SpawnEx(g_game,0x37,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar2,0); } goto LAB_0053b985; } } npc->_entityGridCollisionClass = 3; npc->_state = 4; goto LAB_0053b985; } (npc->_velocity).y = 0.0; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pbVar4 = (npc->_sprite)._animState._animData; if (pbVar4 != (byte *)0x0) { curAnimName = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { curAnimName = *(byte **)pbVar4; } cmpName = "Charge Shake"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*cmpName; if (bVar1 != *cmpName) { LAB_0053b7d7: uVar2 = -(uint)isLess | 1; goto LAB_0053b7dc; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)cmpName[1]; if (bVar1 != cmpName[1]) goto LAB_0053b7d7; curAnimName = curAnimName + 2; cmpName = cmpName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0053b7dc: if ((uVar2 == 0) && ((pbVar4[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053b813; } bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Charge Shake",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0053b813: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_0053b88b: chargeVelocityX = (npc->_velocity).x; } else { pbVar4 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } cmpName = "Charge Shake"; do { bVar1 = *pbVar4; isLess = bVar1 < (byte)*cmpName; if (bVar1 != *cmpName) { LAB_0053b852: uVar2 = -(uint)isLess | 1; goto LAB_0053b857; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < (byte)cmpName[1]; if (bVar1 != cmpName[1]) goto LAB_0053b852; pbVar4 = pbVar4 + 2; cmpName = cmpName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0053b857: if (uVar2 != 0) goto LAB_0053b88b; if ((npc->_sprite)._flipX == 0) { chargeVelocityX = 25.0; (npc->_velocity).x = 25.0; } else { chargeVelocityX = (float)&DAT_c1c80000; (npc->_velocity).x = (float)&DAT_c1c80000; } } if (((0.0 < chargeVelocityX) && (*(float *)((int)g_game->_room + 0x1c) + 200.0 < (npc->_pos).x)) || ((chargeVelocityX < 0.0 && ((npc->_pos).x <= -200.0 && (npc->_pos).x != -200.0)))) { bVar1 = (npc->_sprite)._flipX; npc->_state = 9; npc->_stateFrame = npc->_stateFrame + 1; (npc->_sprite)._flipX = bVar1 == 0; } LAB_0053b985: if ((npc->_dead != 0) && ((npc->_flags & 0x1000000) == 0)) { vecResult = &npc->_pos; Game::BombDamage(g_game,vecResult,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); Game::spawn_bomb_crater(g_game,vecResult,(Entity *)0x0,1.0); uVar2 = Random(); Game::SpawnEx(g_game,1000,1,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar2,0); } return; } //@@ 0053bae0 NpcAI::ENTITY_RING_OF_FLIES /* NPC AI for entity type 222 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_RING_OF_FLIES(Entity_NPC *npc) { uint uVar1; Entity_Player *player; float *newHealth; Vector *pVVar2; Entity_NPC *parentNpc; int selfSlot; int selfSlotSaved; int ringSize; float fVar3; float fVar4; float fVar5; EntityList_EL ringFlies; Vector local_24; float local_1c; EntityPtr *ringFlyData; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; EntityPtr *parentRef; EntityPtr ringFly; local_8 = 0xffffffff; puStack_c = &LAB_00af480d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; player = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); if ((player != (Entity_Player *)0x0) && (npc->_dead == 0)) { award_fly_kill_points(&g_game->_scoreSheet,(Entity *)npc); (**(code **)(*(int *)npc + 0x28))(uVar1); Entity_Player::AddBlueFlies(player,1,&npc->_pos,(Entity *)0x0); ExceptionList = local_10; return; } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1); if ((player != (Entity_Player *)0x0) && ((npc->_flags & 0x20000000) == 0)) { Entity_NPC::Morph(npc,0xd,0,0,-1); fVar3 = g_vectorZero.x; (npc->_v2).x = g_vectorZero.x; fVar4 = g_vectorZero.y; (npc->_v2).y = g_vectorZero.y; (npc->_v1).x = fVar3; (npc->_v1).y = fVar4; ExceptionList = local_10; return; } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&ringFlies,0xde,-1,-1,1,0); local_8 = 0; parentRef = &npc->_parent; ringFlyData = ringFlies._data; if (((*parentRef == (EntityPtr)0x0) && (ringFlies._size != 0)) && (ringFly = *(EntityPtr *)ringFlies._data, *parentRef = ringFly, ringFly != (EntityPtr)0x0)) { std::multiset::insert(parentRef); } if (npc->_subtype == 1) { fVar3 = npc->_maxHitPoints; if (fVar3 < npc->_health) { local_24.y = npc->_health - 4.0; newHealth = &local_24.y; if (local_24.y <= fVar3) { newHealth = &npc->_maxHitPoints; } npc->_health = *newHealth; } } if (npc->_state == 0) { ringFly = npc->_parent; npc->_entityGridCollisionClass = 0; if ((EntityPtr)npc == ringFly) { (npc->_targetPosition).x = (npc->_pos).x; fVar3 = (npc->_pos).y; } else { (npc->_targetPosition).x = ((Vector *)((int)ringFly + 0x334))->x; fVar3 = *(float *)((int)ringFly + 0x338); } (npc->_targetPosition).y = fVar3; npc->_i1 = 1; (npc->_v1).y = 40.0; npc->_state = 4; } else if (npc->_state == 4) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Fly,0); } pVVar2 = Entity_NPC::CalcTargetPosition(npc,&local_24,0.0); uVar1 = 0; fVar3 = 0.0; ringSize = 0; local_14 = 0.0; selfSlot = 0; local_1c = pVVar2->x - (npc->_pos).x; local_24.y = pVVar2->y - (npc->_pos).y; selfSlotSaved = selfSlot; if (ringFlies._size != 0) { do { ringFly = ringFlyData[uVar1]; selfSlot = ringSize; if ((EntityPtr)npc != ringFly) { selfSlot = selfSlotSaved; } if (*(EntityPtr *)((int)ringFly + 0x3bc) == npc->_parent) { fVar3 = fVar3 + *(float *)((int)ringFly + 0x39c); ringSize = ringSize + 1; } uVar1 = uVar1 + 1; selfSlotSaved = selfSlot; } while (uVar1 < (uint)ringFlies._size); local_14 = fVar3; if (0 < ringSize) { local_14 = fVar3 / (float)ringSize; } } ringFly = npc->_parent; if (ringFly == (EntityPtr)npc) { if (npc->_controllerID == -1) { fVar3 = sqrtf(local_1c * local_1c + local_24.y * local_24.y); if (fVar3 <= 0.0) { fVar3 = local_1c; } else { local_24.y = (1.0 / fVar3) * local_24.y; fVar3 = local_1c * (1.0 / fVar3); } fVar4 = npc->_speedMultiplier; (npc->_targetPosition).x = (fVar3 + fVar3) * fVar4 + (npc->_targetPosition).x; (npc->_targetPosition).y = (local_24.y + local_24.y) * fVar4 + (npc->_targetPosition).y; } else { pVVar2 = Entity_NPC::GetControllerInput(npc,&local_24,0.0); fVar3 = npc->_speedMultiplier; fVar4 = pVVar2->y; (npc->_targetPosition).x = pVVar2->x * 2.5 * fVar3 + (npc->_targetPosition).x; (npc->_targetPosition).y = fVar4 * 2.5 * fVar3 + (npc->_targetPosition).y; } fVar3 = (npc->_v1).y; if (npc->_i1 == 0) { fVar3 = fVar3 - 0.5; (npc->_v1).y = fVar3; if (fVar3 < 40.0) { npc->_i1 = 1; } } else { fVar3 = fVar3 + 0.5; (npc->_v1).y = fVar3; if (70.0 < fVar3) { npc->_i1 = 0; } } fVar3 = (npc->_v2).x - local_14 * 0.09424778; (npc->_v2).x = fVar3; while (fVar3 < -3.1415927) { fVar3 = (npc->_v2).x + 6.2831855; (npc->_v2).x = fVar3; } } else if (ringFly != (EntityPtr)0x0) { (npc->_targetPosition).x = ((Vector *)((int)ringFly + 0x334))->x; (npc->_targetPosition).y = *(float *)((int)ringFly + 0x338); parentNpc = Entity_NPC::ParentNPC(npc); (npc->_v1).y = (parentNpc->_v1).y; parentNpc = Entity_NPC::ParentNPC(npc); (npc->_v2).x = (parentNpc->_v2).x; } local_24.y = ((float)selfSlot * 6.2831855) / (float)ringSize; (npc->_v1).x = local_24.y; local_24.y = local_24.y + (npc->_v2).x; local_1c = sin(local_24.y); local_14 = (npc->_v1).y; fVar3 = cos(local_24.y); fVar4 = (fVar3 * local_14 + (npc->_targetPosition).x) - (npc->_pos).x; fVar3 = (local_14 * local_1c + (npc->_targetPosition).y) - (npc->_pos).y; fVar5 = fVar4 * fVar4 + fVar3 * fVar3; local_24.y = fVar4; local_14 = fVar3; if (100.0 < fVar5) { fVar5 = sqrtf(fVar5); fVar3 = local_14; fVar4 = local_24.y; if (0.0 < fVar5) { fVar3 = local_14 * (1.0 / fVar5); fVar4 = local_24.y * (1.0 / fVar5); } fVar4 = fVar4 * 6.0; fVar3 = fVar3 * 6.0; } (npc->_velocity).y = fVar3; (npc->_velocity).x = fVar4; ringFlies._data = ringFlyData; } if (ringFlies._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,ringFlies._data,0); } ExceptionList = local_10; return; } //@@ 0053c0d0 NpcAI::ENTITY_WALL_CREEP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 240 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WALL_CREEP(Entity_NPC *npc) { Entity_NPC *other; void *room; byte bVar2; uint uVar3; ProjectileParams *fireParams; Entity_Laser *laser; Vector *pVVar4; int iVar5; Vector *pVVar6; Entity *pEVar7; byte *pbVar8; byte *pbVar9; ColorMod *pCVar10; byte *pbVar11; char *animName; code *takeDamageFn; bool bVar12; float fVar13; float fVar14; float fVar15; float fVar16; EntityRef playerHitSource; undefined1 local_1fc [12]; uint queryCount; Vector tmpVec; Vector local_1e4; float local_1dc; float local_1d8; float local_1d4; float local_1d0; Vector local_1cc; float local_1c4; Vector local_1c0; Vector local_1b8; float local_1b0; char isSoyCreep; ProjectileParams projParams; EntityRef enemyHitSource; ProjectileParams sprayParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; EntityRef *damageSource; Game *game; Manager *manager; void *room; int state; room = ExceptionList; game = g_game; puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af4840; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)&(&sprayParams)[1].Spread; ExceptionList = &local_1c; fVar13 = npc->_updateTime; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; room = game->_room; local_1dc = *(float *)((int)room + 0x14) + 5.0; local_1c4 = *(float *)((int)room + 0x18) + 5.0; local_1d8 = *(float *)((int)room + 0x1c) - 5.0; local_1e4.y = *(float *)((int)room + 0x20) - 5.0; local_1d0 = (float)((int)fVar13 - (int)npc->_prevUpdateTime); iVar5 = npc->_type; if ((iVar5 == 0xf0) && ((npc->_variant == 1 || (npc->_variant == 3)))) { isSoyCreep = '\x01'; } else { isSoyCreep = '\0'; } state = npc->_state; local_24 = uVar3; if (state == 0) { fVar13 = (npc->_pos).x; fVar14 = 10000.0; if (ABS(local_1dc - fVar13) < 10000.0) { fVar15 = (npc->_pos).y; fVar14 = ABS(local_1dc - fVar13); (npc->_targetPosition).x = local_1dc; (npc->_targetPosition).y = fVar15; npc->_i1 = 3; npc->_entityGridCollisionClass = 2; (npc->_sprite)._rotation = -90.0; if (npc->_type != 0xf1) { (npc->_posOffset).x = 0.0; (npc->_posOffset).y = (float)&DAT_c1c80000; } (npc->_sizeMulti).x = 1.8; (npc->_v1).x = 0.0; (npc->_v1).y = 5.0; fVar13 = (npc->_pos).x; } if (ABS(local_1d8 - fVar13) < fVar14) { fVar14 = (npc->_pos).y; (npc->_targetPosition).x = local_1d8; (npc->_targetPosition).y = fVar14; npc->_i1 = 4; npc->_entityGridCollisionClass = 2; (npc->_sprite)._rotation = 90.0; if (npc->_type != 0xf1) { (npc->_posOffset).x = 0.0; (npc->_posOffset).y = (float)&DAT_c1c80000; } (npc->_sizeMulti).x = 1.8; (npc->_v1).x = 0.0; (npc->_v1).y = 5.0; fVar14 = ABS(local_1d8 - fVar13); } fVar13 = (npc->_pos).y; fVar15 = local_1c4 - fVar13; if (ABS(fVar15) < fVar14) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = local_1c4; npc->_i1 = 1; npc->_entityGridCollisionClass = 1; (npc->_sprite)._rotation = 0.0; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = 0.0; (npc->_v1).x = 5.0; (npc->_v1).y = 0.0; fVar13 = (npc->_pos).y; fVar14 = ABS(fVar15); } if (ABS(local_1e4.y - fVar13) < fVar14) { (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = local_1e4.y; npc->_i1 = 2; npc->_entityGridCollisionClass = 1; (npc->_sprite)._rotation = 180.0; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = 0.0; (npc->_v1).x = 5.0; (npc->_v1).y = 0.0; } (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } pbVar11 = s_Walk; do { bVar2 = *pbVar8; bVar12 = bVar2 < *pbVar11; if (bVar2 != *pbVar11) { LAB_0053e2e0: uVar3 = -(uint)bVar12 | 1; goto LAB_0053e2e5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < pbVar11[1]; if (bVar2 != pbVar11[1]) goto LAB_0053e2e0; pbVar8 = pbVar8 + 2; pbVar11 = pbVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053e2e5: if ((uVar3 == 0) && ((pbVar9[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053e31c; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0053e31c: npc->_state = 4; fVar15 = fRam00c34db0; fVar14 = fRam00c34dac; fVar13 = fRam00c34da8; if (npc->_type != 0xf0) { ExceptionList = local_1c; return; } if (npc->_variant != 2) { ExceptionList = local_1c; return; } if (&npc->_splatColor == (ColorMod *)&DAT_00c34da4) { ExceptionList = local_1c; return; } (npc->_splatColor)._tint[0] = _DAT_00c34da4; (npc->_splatColor)._tint[1] = fVar13; (npc->_splatColor)._tint[2] = fVar14; (npc->_splatColor)._tint[3] = fVar15; fVar15 = fRam00c34dc0; fVar14 = fRam00c34dbc; fVar13 = fRam00c34db8; (npc->_splatColor)._colorize[0] = _DAT_00c34db4; (npc->_splatColor)._colorize[1] = fVar13; (npc->_splatColor)._colorize[2] = fVar14; (npc->_splatColor)._colorize[3] = fVar15; *(undefined8 *)(npc->_splatColor)._offset = DAT_00c34dc4; (npc->_splatColor)._offset[2] = DAT_00c34dcc; ExceptionList = local_1c; return; } if (state != 4) { if (state != 8) { ExceptionList = room; return; } if (iVar5 != 0xf0) { if (iVar5 == 0xf1) { puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) goto LAB_0053cd7e; fVar13 = 0.0; local_1c0.y = 0.0; switch(npc->_i1) { case 1: fVar13 = 90.0; break; case 2: fVar13 = -90.0; break; case 3: break; case 4: fVar13 = 180.0; break; default: goto switchD_0053c3eb_default; } local_1c0.y = fVar13; switchD_0053c3eb_default: if (npc->_variant == 1) { local_1e4.y = (local_1c0.y + 90.0) * 0.017453292; local_1d0 = cos(local_1e4.y); fVar13 = sin(local_1e4.y); local_1d0 = local_1d0 + local_1d0; local_1e4.y = fVar13 + fVar13; local_1b8.x = ((npc->_posOffset).x + (npc->_pos).x) - local_1d0; local_1b8.y = ((npc->_posOffset).y + (npc->_pos).y) - local_1e4.y; laser = Entity_Laser::ShootAngle (1,&local_1b8,local_1c0.y - 30.0,0x2d,&g_vectorZero,(Entity *)npc,0); laser->_renderDepthOffset = 1000.0; (**(code **)(*(int *)laser + 0xc))(uVar3); pVVar4 = &local_1b8; local_1b8.x = (npc->_pos).x + (npc->_posOffset).x + local_1d0; local_1b8.y = (npc->_posOffset).y + (npc->_pos).y + local_1e4.y; fVar13 = local_1c0.y + 30.0; } else { pVVar4 = &local_1c0; local_1c0.x = (npc->_posOffset).x + (npc->_pos).x; fVar13 = local_1c0.y; local_1c0.y = (npc->_posOffset).y + (npc->_pos).y; } laser = Entity_Laser::ShootAngle(1,pVVar4,fVar13,0x2d,&g_vectorZero,(Entity *)npc,0); laser->_renderDepthOffset = 1000.0; (**(code **)(*(int *)laser + 0xc))(); goto LAB_0053cd5e; } if (iVar5 != 0xf2) goto LAB_0053cd7e; puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) goto LAB_0053c369; local_1c4 = g_vectorZero.x; local_1b8.x = g_vectorZero.x; local_1c0.y = g_vectorZero.y; local_1b8.y = g_vectorZero.y; switch(npc->_i1) { case 1: local_1c0.y = 4.0; local_1b8.y = 8.0; break; case 2: local_1c0.y = -12.0; local_1b8.y = -8.0; break; case 3: local_1b8.x = 8.0; goto LAB_0053c2a8; case 4: local_1c4 = g_vectorZero.x + 4.0; local_1b8.x = -8.0; LAB_0053c2a8: local_1c0.y = 0.0; } fireParams = ProjectileParams::ProjectileParams(&projParams); local_1cc.x = local_1c4 + (npc->_pos).x; local_1cc.y = local_1c0.y + (npc->_pos).y; Room::GetClampedPositionImpl(g_game->_room,&local_1e4,&local_1cc,5.0,5.0,5.0,5.0); Entity_NPC::FireProjectiles(npc,&local_1e4,&local_1b8,2,fireParams); Entity_NPC::PlaySound(npc,0x13d,1.0,2,0,1.0); LAB_0053c369: uVar3 = Random(); if ((uVar3 & 1) == 0) { if (npc->_i1 < 3) { (npc->_v1).x = -(npc->_v1).x; } else { (npc->_v1).y = -(npc->_v1).y; } } goto LAB_0053cd7e; } if (isSoyCreep != '\0') { if (npc->_projectileCooldown < 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); } } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)"AttackLoop",0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x13d,1.0,2,0,1.2); npc->_projectileCooldown = 0x5a; } if (((npc->_controllerID != -1) && (npc->_projectileCooldown - 2U < 0x49)) && (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar2 == 0)) { npc->_projectileCooldown = 1; } local_1e4.y = (float)((npc->_variant == 3) + 2); local_1b0 = 0.0; if (0 < (int)local_1d0) { do { if (npc->_projectileCooldown < 1) break; iVar5 = npc->_projectileCooldown + -1; npc->_projectileCooldown = iVar5; if (iVar5 < 1) { ANM2::Play(&npc->_sprite,(byte *)"AttackEnd",0); npc->_projectileCooldown = -1; break; } if (iVar5 % (int)local_1e4.y != 1) goto LAB_0053cbba; local_1cc.x = (npc->_pos).x; local_1cc.y = (npc->_pos).y; local_1b8.y = 0.0; local_1b8.x = 0.0; switch(npc->_i1) { case 1: local_1b8.y = 8.0; local_1cc.y = local_1cc.y + 4.0; break; case 2: local_1b8.y = -8.0; local_1cc.y = local_1cc.y + 10.0; break; case 3: local_1b8.x = 8.0; goto LAB_0053c776; case 4: local_1cc.x = local_1cc.x + 4.0; local_1b8.x = -8.0; LAB_0053c776: local_1cc.y = local_1cc.y - 10.0; } ProjectileParams::ProjectileParams(&sprayParams); sprayParams.HeightModifier = sprayParams.HeightModifier + 12.0; uVar3 = Random(); sprayParams.FallingSpeedModifier = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 - 0.5; sprayParams.FallingSpeedModifier = sprayParams.FallingSpeedModifier + sprayParams.FallingSpeedModifier; sprayParams.FallingAccelModifier = sprayParams.FallingAccelModifier - 0.12; uVar3 = Random(); sprayParams.Color._colorize[0] = 1.0; sprayParams.Color._colorize[1] = 1.0; sprayParams.Color._colorize[2] = 1.0; sprayParams.Color._colorize[3] = 1.0; sprayParams.Variant = 4; sprayParams.Color._offset[2] = 0.5; local_1d4 = local_1b8.y; sprayParams.Scale = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.15 + 0.15; sprayParams.Color._tint[0] = 1.0; sprayParams.Color._tint[1] = 1.0; sprayParams.Color._tint[2] = 1.0; sprayParams.Color._tint[3] = 1.0; sprayParams.Color._offset[0] = 0.8; sprayParams.Color._offset[1] = 0.7; local_1c0.y = local_1b8.x; fVar13 = sqrtf(local_1b8.x * local_1b8.x + local_1b8.y * local_1b8.y); if (0.0 < fVar13) { local_1c0.y = (1.0 / fVar13) * local_1c0.y; local_1d4 = local_1d4 * (1.0 / fVar13); } local_1d8 = cos(1.5707964); local_1dc = sin(1.5707964); uVar3 = Random(); fireParams = &sprayParams; pVVar4 = &local_1b8; fVar13 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 - 0.5; local_1cc.x = (local_1d8 * local_1c0.y - local_1d4 * local_1dc) * fVar13 * 4.0 + local_1cc.x; local_1cc.y = (local_1dc * local_1c0.y + local_1d4 * local_1d8) * fVar13 * 4.0 + local_1cc.y; if (npc->_variant == 3) { sprayParams.Scale = sprayParams.Scale + 0.1; uVar3 = 4; sprayParams.Spread = 2.0; local_1cc.x = local_1b8.x * 0.25 + local_1cc.x; pVVar6 = (Vector *)(local_1fc + 8); local_1cc.y = local_1b8.y * 0.25 + local_1cc.y; } else { uVar3 = 0; pVVar6 = &tmpVec; } pVVar6 = Room::GetClampedPositionImpl(g_game->_room,pVVar6,&local_1cc,3.0,3.0,3.0,3.0); Entity_NPC::FireProjectiles(npc,pVVar6,pVVar4,uVar3,fireParams); uVar3 = Random(); pEVar7 = Game::Spawn(g_game,1000,0x50,&local_1cc,&g_vectorZero,(Entity *)0x0,0,uVar3); uVar3 = Random(); pCVar10 = &(pEVar7->_sprite)._color; (pEVar7->_sprite)._rotation = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 360.0; if (pCVar10 != &sprayParams.Color) { pCVar10->_tint[0] = sprayParams.Color._tint[0]; (pEVar7->_sprite)._color._tint[1] = sprayParams.Color._tint[1]; (pEVar7->_sprite)._color._tint[2] = sprayParams.Color._tint[2]; (pEVar7->_sprite)._color._tint[3] = sprayParams.Color._tint[3]; (pEVar7->_sprite)._color._colorize[0] = sprayParams.Color._colorize[0]; (pEVar7->_sprite)._color._colorize[1] = sprayParams.Color._colorize[1]; (pEVar7->_sprite)._color._colorize[2] = sprayParams.Color._colorize[2]; (pEVar7->_sprite)._color._colorize[3] = sprayParams.Color._colorize[3]; (pEVar7->_sprite)._color._offset[0] = sprayParams.Color._offset[0]; (pEVar7->_sprite)._color._offset[1] = sprayParams.Color._offset[1]; (pEVar7->_sprite)._color._offset[2] = sprayParams.Color._offset[2]; } (pEVar7->_posOffset).x = 0.0; (pEVar7->_posOffset).y = -11.0; pEVar7->_renderDepthOffset = 15.0; manager = g_manager; local_1c4 = 2.14399e-43; seed_fart_sound_override((int *)&local_1c4); SoundEffects::Play(&manager->_sfxManager,(int)local_1c4,1.0,2,0,1.2,0.0); LAB_0053cbba: local_1b0 = (float)((int)local_1b0 + 1); } while ((int)local_1b0 < (int)local_1d0); } } goto LAB_0053cd47; } puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) goto LAB_0053cd47; local_1c4 = g_vectorZero.x; local_1b8.x = g_vectorZero.x; local_1c0.y = g_vectorZero.y; local_1b8.y = g_vectorZero.y; switch(npc->_i1) { case 1: local_1c0.y = 4.0; local_1b8.y = 8.0; break; case 2: local_1c0.y = -12.0; local_1b8.y = -8.0; break; case 3: local_1b8.x = 8.0; goto LAB_0053cc96; case 4: local_1c4 = g_vectorZero.x + 4.0; local_1b8.x = -8.0; LAB_0053cc96: local_1c0.y = -5.0; } ProjectileParams::ProjectileParams(&projParams); if (npc->_variant == 2) { projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 1; projParams.HomingStrength = 0.8; } fireParams = &projParams; local_1cc.x = local_1c4 + (npc->_pos).x; uVar3 = 0; pVVar4 = &local_1b8; local_1cc.y = local_1c0.y + (npc->_pos).y; pVVar6 = Room::GetClampedPosition(g_game->_room,&tmpVec,&local_1cc,5.0); Entity_NPC::FireProjectiles(npc,pVVar6,pVVar4,uVar3,fireParams); LAB_0053cd47: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"), bVar2 != 0)) { LAB_0053cd5e: Entity_NPC::PlaySound(npc,0x13d,1.0,2,0,1.0); } LAB_0053cd7e: fVar13 = (npc->_targetPosition).y; fVar14 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar13 - fVar14; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; npc->_mass = *(float *)((int)npc->_config + 0x44); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); if ((npc->_sprite)._animState._animData == (void *)0x0) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } pbVar11 = s_Walk; do { bVar2 = *pbVar8; bVar12 = bVar2 < *pbVar11; if (bVar2 != *pbVar11) { LAB_0053ce20: uVar3 = -(uint)bVar12 | 1; goto LAB_0053ce25; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < pbVar11[1]; if (bVar2 != pbVar11[1]) goto LAB_0053ce20; pbVar8 = pbVar8 + 2; pbVar11 = pbVar11 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053ce25: if ((uVar3 == 0) && ((puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2), pbVar9[0x34] == 0 || (puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053ce5c; } puStack_20 = (undefined1 *)((&sprayParams)[1].Color._tint + 2); bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0053ce5c: pVVar4 = &npc->_pos; pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_1b0 = 1.0; local_1d4 = pVVar4->x - (pEVar7->_pos).x; local_1c0.y = (npc->_pos).y - (pEVar7->_pos).y; iVar5 = npc->_controllerID; if (iVar5 != -1) { pVVar6 = Entity_NPC::GetControllerInput(npc,&tmpVec,0.0); local_1d4 = -pVVar6->x; local_1c0.y = -pVVar6->y; local_1b0 = sqrtf(local_1d4 * local_1d4 + local_1c0.y * local_1c0.y); local_1d4 = local_1d4 * 100.0; iVar5 = npc->_controllerID; local_1c0.y = local_1c0.y * 100.0; } switch(npc->_i1) { case 1: (npc->_pos).y = local_1c4; break; case 2: (npc->_pos).y = local_1e4.y; break; case 3: fVar13 = local_1dc; goto LAB_0053cf8a; case 4: fVar13 = local_1d8; LAB_0053cf8a: pVVar4->x = fVar13; } if (iVar5 == -1) { if ((npc->_flags & 0x1000800) == 0) { pVVar6 = Entity_NPC::CalcTargetPosition(npc,&tmpVec,0.0); (npc->_targetPosition).x = pVVar6->x; fVar13 = pVVar6->y; } else { fVar13 = local_1d4 * local_1d4 + local_1c0.y * local_1c0.y; if ((fVar13 != 0.0) && (fVar13 = sqrtf(fVar13), 0.0 < fVar13)) { local_1d4 = local_1d4 * (50.0 / fVar13); local_1c0.y = local_1c0.y * (50.0 / fVar13); } fVar13 = local_1c0.y + (npc->_pos).y; (npc->_targetPosition).x = local_1d4 + pVVar4->x; } } else { fVar13 = (npc->_pos).y - local_1c0.y; (npc->_targetPosition).x = pVVar4->x - local_1d4; } (npc->_targetPosition).y = fVar13; iVar5 = npc->_type; if (npc->_i1 < 3) { if ((iVar5 == 0xf2) && (npc->_controllerID == -1)) { fVar14 = npc->_size + local_1dc; fVar15 = local_1d8 - npc->_size; fVar13 = pVVar4->x; if (pVVar4->x <= fVar14) { fVar13 = fVar14; } if (fVar15 <= fVar13) { fVar13 = fVar15; } if (fVar13 != pVVar4->x) { (npc->_v1).x = -(npc->_v1).x; pVVar4->x = fVar13; } fVar13 = (npc->_v1).x; fVar14 = (npc->_v1).y; LAB_0053d219: fVar14 = fVar14 * 0.25; fVar13 = fVar13 * 0.25; LAB_0053d229: (npc->_velocity).y = fVar14; goto LAB_0053d231; } fVar14 = (npc->_targetPosition).x; fVar15 = pVVar4->x; fVar13 = (npc->_v1).x; if (((fVar14 < fVar15) && (0.0 < fVar13)) || ((fVar15 < fVar14 && (fVar13 < 0.0)))) { fVar13 = -fVar13; (npc->_v1).x = fVar13; } if (10.0 < ABS(fVar14 - fVar15)) { switch(iVar5) { case 0xf0: fVar14 = (npc->_v1).y; if (isSoyCreep == '\0') { fVar14 = fVar14 * local_1b0; fVar13 = fVar13 * local_1b0; } else { fVar13 = fVar13 * 0.7 * local_1b0; fVar14 = fVar14 * 0.7 * local_1b0; } goto LAB_0053d229; case 0xf1: fVar13 = fVar13 * local_1b0 * 0.5; (npc->_velocity).y = local_1b0 * (npc->_v1).y * 0.5; break; case 0xf2: fVar13 = fVar13 * local_1b0; fVar14 = local_1b0 * (npc->_v1).y; goto LAB_0053d219; default: goto switchD_0053d16f_caseD_f3; case 0x130: fVar13 = fVar13 * local_1b0; (npc->_velocity).y = local_1b0 * (npc->_v1).y; } LAB_0053d231: (npc->_velocity).x = fVar13; } switchD_0053d16f_caseD_f3: fVar13 = (npc->_v1).x; if (npc->_i1 == 1) { (npc->_sprite)._flipX = 0.0 < fVar13; } else { (npc->_sprite)._flipX = fVar13 < 0.0; } goto LAB_0053d4ab; } if ((iVar5 == 0xf2) && (npc->_controllerID == -1)) { fVar15 = npc->_size + local_1c4; fVar16 = local_1e4.y - npc->_size; fVar13 = (npc->_pos).y; fVar14 = fVar13; if (fVar13 <= fVar15) { fVar14 = fVar15; } if (fVar16 <= fVar14) { fVar14 = fVar16; } if (fVar14 != fVar13) { (npc->_v1).y = -(npc->_v1).y; (npc->_pos).y = fVar14; } fVar13 = (npc->_v1).y; (npc->_velocity).x = (npc->_v1).x * 0.25; (npc->_velocity).y = fVar13 * 0.25; goto switchD_0053d3b4_caseD_f3; } fVar13 = 15.0; if (iVar5 == 0xf0) { fVar13 = 5.0; } else if (iVar5 == 0xf1) { fVar13 = -10.0; } if (npc->_controllerID != -1) { fVar13 = 0.0; } fVar13 = fVar13 + (npc->_targetPosition).y; fVar14 = (npc->_pos).y; fVar15 = (npc->_v1).y; if (((fVar13 < fVar14) && (0.0 < fVar15)) || ((fVar14 < fVar13 && (fVar15 < 0.0)))) { (npc->_v1).y = -fVar15; } if (ABS(fVar13 - fVar14) <= 10.0) goto switchD_0053d3b4_caseD_f3; switch(iVar5) { case 0xf0: fVar13 = (npc->_v1).x; fVar14 = (npc->_v1).y; if (isSoyCreep != '\0') { fVar13 = fVar13 * 0.7; fVar14 = fVar14 * 0.7; } fVar13 = fVar13 * local_1b0; fVar14 = fVar14 * local_1b0; break; case 0xf1: fVar14 = local_1b0 * (npc->_v1).y * 0.5; fVar13 = local_1b0 * (npc->_v1).x * 0.5; goto LAB_0053d3d6; case 0xf2: fVar14 = local_1b0 * (npc->_v1).y * 0.25; fVar13 = local_1b0 * (npc->_v1).x * 0.25; break; default: goto switchD_0053d3b4_caseD_f3; case 0x130: fVar14 = local_1b0 * (npc->_v1).y; fVar13 = local_1b0 * (npc->_v1).x; LAB_0053d3d6: (npc->_velocity).x = fVar13; (npc->_velocity).y = fVar14; goto switchD_0053d3b4_caseD_f3; } (npc->_velocity).y = fVar14; (npc->_velocity).x = fVar13; switchD_0053d3b4_caseD_f3: fVar13 = (npc->_v1).y; if (npc->_i1 == 3) { bVar12 = fVar13 < 0.0; } else { bVar12 = 0.0 < fVar13; } (npc->_sprite)._flipY = !bVar12 && fVar13 != 0.0; LAB_0053d4ab: if (npc->_type == 0x130) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar9 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } animName = "Attack"; do { bVar2 = *pbVar9; bVar12 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0053d500: uVar3 = -(uint)bVar12 | 1; goto LAB_0053d505; } if (bVar2 == 0) break; bVar2 = pbVar9[1]; bVar12 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0053d500; pbVar9 = pbVar9 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053d505: if (uVar3 == 0) { npc->_i2 = 2; } else if ((npc->_sprite)._animState._isPlaying == 0) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { pbVar9 = &s_empty; } else if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } animName = "PutAway"; do { bVar2 = *pbVar9; bVar12 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0053d560: uVar3 = -(uint)bVar12 | 1; goto LAB_0053d565; } if (bVar2 == 0) break; bVar2 = pbVar9[1]; bVar12 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0053d560; pbVar9 = pbVar9 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053d565: if (uVar3 == 0) { npc->_i2 = 0; } } } local_1b0 = 60.0; if (npc->_i1 < 3) { if (npc->_i1 == 1) { local_1b0 = 80.0; } } else { local_1b0 = 70.0; } if (npc->_i2 == 2) { iVar5 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if ((iVar5 != 0) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar2 == 0)) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_1fc,pVVar4, local_1b0,0xffffffff); local_14 = 0.0; local_1d8 = 0.0; if (queryCount != 0) { do { other = *(Entity_NPC **)(local_1fc._4_4_ + (int)local_1d8 * 4); local_1e4.y = (float)other; if ((other->_entityCollisionClass != 0) && (other != npc)) { local_1b0 = (npc->_pos).x - (other->_pos).x; local_1cc.y = (npc->_pos).y - (other->_pos).y; local_1dc = (npc->_sprite)._rotation * 0.017453292; local_1c4 = cos(local_1dc); fVar13 = sin(local_1dc); if (ABS(local_1c4 * local_1b0 - fVar13 * local_1cc.y) < 25.0) { iVar5 = other->_type; if ((iVar5 == 1) || (iVar5 == 3)) { bVar2 = Entity::IsHostileTo((Entity *)npc,(Entity *)other); if (bVar2 == 0) { iVar5 = other->_type; goto LAB_0053d734; } takeDamageFn = *(code **)(*(int *)other + 0x20); EntityRef::constructor(&playerHitSource,(Entity *)npc); fVar13 = npc->_collisionDamage; damageSource = &playerHitSource; } else { LAB_0053d734: if ((((*(int *)&g_game->_deathmatchManager < 2) || (iVar5 != 1)) && (0x3dd < iVar5 - 10U)) || (bVar2 = Entity::IsHostileTo((Entity *)npc,(Entity *)other), bVar2 == 0)) goto LAB_0053d78b; takeDamageFn = *(code **)(*(int *)other + 0x20); EntityRef::constructor(&enemyHitSource,(Entity *)npc); damageSource = &enemyHitSource; fVar13 = 5.0; } (*takeDamageFn)(fVar13,0,0,damageSource,0x1e); } } LAB_0053d78b: local_1d8 = (float)((int)local_1d8 + 1); } while ((uint)local_1d8 < queryCount); } if (local_1fc[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_1fc._4_4_,0); } local_14 = -NAN; } if ((npc->_i2 == 2) && (npc->_projectileCooldown < 1)) { npc->_projectileCooldown = 0x78; (npc->_v2).x = (npc->_pos).x; (npc->_v2).y = (npc->_pos).y; Entity_NPC::PlaySound(npc,0x13d,1.0,2,0,1.0); } } iVar5 = 0; fVar13 = (float)((uint)(npc->_i1 < 3) * 4 + 0x6a); local_1c4 = fVar13; if (0 < (int)local_1d0) { uVar3 = npc->_projectileCooldown; do { if ((int)uVar3 < 1) break; if (((int)fVar13 < (int)uVar3) && ((uVar3 & 1) == 0)) { local_1cc.y = ((npc->_sprite)._rotation + 90.0) * 0.017453292; local_1e4.y = cos(local_1cc.y); local_1d8 = sin(local_1cc.y); local_1cc.y = cos(1.5707964); local_1dc = sin(1.5707964); uVar3 = Random(); fVar14 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 - 0.5; fVar13 = (float)((0x78 - npc->_projectileCooldown) / 2) * 40.0; local_1b8.x = (local_1e4.y * local_1cc.y - local_1d8 * local_1dc) * fVar14 * 20.0 + local_1e4.y * fVar13 + (npc->_v2).x; local_1b8.y = (local_1e4.y * local_1dc + local_1d8 * local_1cc.y) * fVar14 * 20.0 + local_1d8 * fVar13 + (npc->_v2).y; uVar3 = Random(); pEVar7 = Game::Spawn(g_game,1000,0x16,&local_1b8,&g_vectorZero,(Entity *)npc,0,uVar3); (**(code **)(*(int *)pEVar7 + 0xc))(); uVar3 = npc->_projectileCooldown; fVar13 = local_1c4; } if (0 < (int)uVar3) { uVar3 = uVar3 - 1; npc->_projectileCooldown = uVar3; } iVar5 = iVar5 + 1; } while (iVar5 < (int)local_1d0); } } fVar13 = (npc->_velocity).y; fVar14 = (npc->_velocity).x; if (fVar14 * fVar14 + fVar13 * fVar13 <= 0.0001) { if (npc->_type == 0x130) { if (npc->_i2 == 2) { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } animName = "AttackLoopIdle"; do { bVar2 = *pbVar8; bVar12 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0053dbe0: uVar3 = -(uint)bVar12 | 1; goto LAB_0053dbe5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0053dbe0; pbVar8 = pbVar8 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053dbe5: if (uVar3 == 0) { if ((pbVar9[0x34] != 0) && ((npc->_sprite)._animState._isPlaying == 0)) { animName = "AttackLoopIdle"; goto LAB_0053db73; } goto LAB_0053dc4b; } } animName = "AttackLoopIdle"; goto LAB_0053db73; } if (npc->_i2 == 0) goto LAB_0053dc18; } else { LAB_0053dc18: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } } } else { if (npc->_type == 0x130) { if (npc->_i2 != 2) { if (npc->_i2 != 0) goto LAB_0053dc4b; pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } pbVar11 = s_Walk; do { bVar2 = *pbVar8; bVar12 = bVar2 < *pbVar11; if (bVar2 != *pbVar11) goto LAB_0053db46; if (bVar2 == 0) goto LAB_0053db42; bVar2 = pbVar8[1]; bVar12 = bVar2 < pbVar11[1]; if (bVar2 != pbVar11[1]) goto LAB_0053db46; pbVar8 = pbVar8 + 2; pbVar11 = pbVar11 + 2; } while (bVar2 != 0); uVar3 = 0; goto LAB_0053db4b; } goto LAB_0053db6c; } pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } animName = "AttackLoopWalk"; do { bVar2 = *pbVar8; bVar12 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0053da90: uVar3 = -(uint)bVar12 | 1; goto LAB_0053da95; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0053da90; pbVar8 = pbVar8 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053da95: if (uVar3 == 0) { if ((pbVar9[0x34] == 0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0053dc4b; animName = "AttackLoopWalk"; goto LAB_0053db73; } } animName = "AttackLoopWalk"; } else { pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } pbVar11 = s_Walk; do { bVar2 = *pbVar8; bVar12 = bVar2 < *pbVar11; if (bVar2 != *pbVar11) goto LAB_0053db46; if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < pbVar11[1]; if (bVar2 != pbVar11[1]) goto LAB_0053db46; pbVar8 = pbVar8 + 2; pbVar11 = pbVar11 + 2; } while (bVar2 != 0); LAB_0053db42: uVar3 = 0; LAB_0053db4b: if ((uVar3 == 0) && ((pbVar9[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053dc4b; } LAB_0053db6c: animName = (char *)s_Walk; } LAB_0053db73: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0053dc4b: iVar5 = npc->_stateFrame; if (-1 < iVar5) { iVar5 = iVar5 - (int)local_1d0; npc->_stateFrame = iVar5; } if (npc->_type != 0x130) { if (-1 < iVar5) { ExceptionList = local_1c; return; } if (((npc->_flags & 0x200) != 0) && (uVar3 = Random(), uVar3 % 100 != 0)) { ExceptionList = local_1c; return; } if ((npc->_flags & 0x1000800) != 0) { ExceptionList = local_1c; return; } if (npc->_controllerID == -1) { bVar2 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&npc->_pos); if ((bVar2 == 0) && (npc->_type != 0xf2)) { ExceptionList = local_1c; return; } } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar2 == 0) { ExceptionList = local_1c; return; } } npc->_state = 8; if (npc->_type == 0xf1) { fVar13 = 0.0; switch(npc->_i1) { case 1: fVar13 = 90.0; break; case 2: fVar13 = -90.0; break; case 4: fVar13 = 180.0; } pCVar10 = (ColorMod *)Color::Color(0x3f4ccccd); local_1cc.y = fVar13 * 0.017453292; local_1b8.x = cos(local_1cc.y); local_1b8.y = sin(local_1cc.y); Entity::SpawnFollowingEffect198((Entity *)npc,&g_vectorZero,&local_1b8,0x12,pCVar10,4.0); } if (isSoyCreep == '\0') { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } else { ANM2::Play(&npc->_sprite,(byte *)"AttackStart",0); npc->_projectileCooldown = 0; } if (npc->_controllerID == -1) { uVar3 = Random(); uVar3 = uVar3 % 0x2d; } else { uVar3 = 0; } npc->_mass = 200.0; npc->_stateFrame = uVar3 + 0xf; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; ExceptionList = local_1c; return; } local_1cc.y = (npc->_sprite)._rotation * 0.017453292; local_1d0 = cos(local_1cc.y); local_1d0 = local_1d0 * local_1d4; fVar13 = sin(local_1cc.y); local_1d0 = local_1d0 - fVar13 * local_1c0.y; if (npc->_controllerID == -1) { bVar2 = ABS(local_1d0) < 25.0; } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if ((bVar2 == 0) || (npc->_i2 != 0)) { if (npc->_controllerID == -1) { bVar12 = 25.0 <= ABS(local_1d0); } else { bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); bVar12 = bVar2 == 0; } if (!bVar12) { ExceptionList = local_1c; return; } if (npc->_i2 != 2) { ExceptionList = local_1c; return; } pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } animName = "PutAway"; do { bVar2 = *pbVar8; bVar12 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0053de51: uVar3 = -(uint)bVar12 | 1; goto LAB_0053de56; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0053de51; pbVar8 = pbVar8 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053de56: if ((uVar3 == 0) && ((pbVar9[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053de8d; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"PutAway",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0053de8d: npc->_i2 = 3; ExceptionList = local_1c; return; } Entity_NPC::PlaySound(npc,0xd,1.0,2,0,1.0); pbVar9 = (npc->_sprite)._animState._animData; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar8 = *(byte **)pbVar9; } animName = "Attack"; do { bVar2 = *pbVar8; bVar12 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_0053dd90: uVar3 = -(uint)bVar12 | 1; goto LAB_0053dd95; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar12 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_0053dd90; pbVar8 = pbVar8 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0053dd95: if ((uVar3 == 0) && ((pbVar9[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0053ddcc; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0053ddcc: npc->_i2 = 1; ExceptionList = local_1c; return; LAB_0053db46: uVar3 = -(uint)bVar12 | 1; goto LAB_0053db4b; } //@@ 0053e4a0 NpcAI::ENTITY_ROUND_WORM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 244 (from dispatcher 006c2990) */ EntityPtr * __fastcall NpcAI::ENTITY_ROUND_WORM(Entity_NPC *npc) { float *pfVar1; ANM2 *pAVar2; float fVar3; byte bVar4; EntityRef *sourceRef; EntityPtr *pEVar5; uint uVar6; EntityPtr segment; uint extraout_EAX; Vector *pVVar7; Entity_Player *nearestPlayer; uint extraout_EAX_00; Entity *sourceRef; Entity *playerTarget; uint extraout_EAX_01; ProjectileParams *projParams; Entity_Projectile *projectile; uint extraout_EAX_02; uint extraout_EAX_03; uint extraout_EAX_04; Vector *pVVar9; uint extraout_EAX_05; uint extraout_EAX_06; ColorMod *color; uint rngResult; uint extraout_EAX_07; EntityPtr rootSegment; int iVar10; undefined4 extraout_ECX; int npcType; int *extraout_EDX; void **roomSlot; float fVar11; float fVar12; EntityPtr *unused2; undefined1 auStack_138 [4]; EntityPtr *local_134; Vector local_130; Vector local_124; void **local_11c; Entity_NPC *local_118; Vector local_114; float local_10c; Vector local_108; Vector *local_100; byte isLineClear; Vector scratchVec; Vector local_ec; Color local_e4; ProjectileParams params; EntityPtr *local_c; Entity_NPC *childNpc; undefined4 flagsHigh; Game *game; Room *room; void *roomData; local_c = (EntityPtr *)(__security_cookie ^ (uint)auStack_138); if (npc->_aiCallPhase == 1) { iVar10 = npc->_type; pEVar5 = local_c; npcType = iVar10; if (((iVar10 == 0x114) && (npcType = 0x114, 0.0 < npc->_pendingDamage)) && (pEVar5 = (npc->_damageEvents)._begin, pEVar5 != (npc->_damageEvents)._end)) { do { if (((*(byte *)(pEVar5 + 0xc) & 1) == 0) && ((pEVar5[4] == (EntityPtr)npc->_type || (pEVar5[6] == (EntityPtr)npc->_type)))) { *pEVar5 = (EntityPtr)0x0; } pEVar5 = pEVar5 + 0xe; } while (pEVar5 != (npc->_damageEvents)._end); iVar10 = npc->_type; npcType = iVar10; } if (npcType != 0xf4) { return pEVar5; } if (((npc->_variant == 3) && (0.0 < npc->_pendingDamage)) && (pEVar5 = (npc->_damageEvents)._begin, pEVar5 != (npc->_damageEvents)._end)) { do { scratchVec.y = *(float *)(pEVar5 + 3); if (((((((uint)pEVar5[2] & 6) != 0) && (((uint)pEVar5[0xc] >> 1 & 1) == 0)) && (pEVar5[4] != (EntityPtr)0x1)) && ((pEVar5[6] != (EntityPtr)0x1 && (pEVar5[6] != (EntityPtr)0x3)))) && (((uint)pEVar5[2] & 0x1000) == 0)) { *pEVar5 = (EntityPtr)0x0; } pEVar5 = pEVar5 + 0xe; } while (pEVar5 != (npc->_damageEvents)._end); iVar10 = npc->_type; if (iVar10 != 0xf4) { return pEVar5; } } if (npc->_variant != 2) { return pEVar5; } if (npc->_subtype == 1) { segment = npc->_parent; rootSegment = (EntityPtr)npc; if (npc->_parent != (EntityPtr)0x0) { do { rootSegment = segment; segment = *(EntityPtr *)((int)rootSegment + 0x3bc); } while (*(EntityPtr *)((int)rootSegment + 0x3bc) != (EntityPtr)0x0); iVar10 = npc->_type; } pEVar5 = (EntityPtr *)0x0; if (((*(int *)((int)rootSegment + 0x28) != iVar10) || (*(int *)((int)rootSegment + 0x2c) != 2) ) || (*(int *)((int)rootSegment + 0x30) != 0)) { sourceRef = EntityRef::EntityRef((EntityRef *)&local_e4); pEVar5 = (EntityPtr *)(**(code **)(*(int *)npc + 0x24))(sourceRef); } } pVVar7 = (Vector *)0x0; if (npc->_subtype == 0) { local_10c = 1e+10; segment = (EntityPtr)npc; do { fVar11 = *(float *)((int)segment + 0x380); if (local_10c <= *(float *)((int)segment + 0x380)) { fVar11 = local_10c; } local_10c = fVar11; pfVar1 = (float *)((int)segment + 0x14); segment = *(EntityPtr *)((int)segment + 0x3c0); pVVar9 = (Vector *)*pfVar1; if (*pfVar1 <= (float)pVVar7) { pVVar9 = pVVar7; } pVVar7 = pVVar9; } while (segment != (EntityPtr)0x0); local_10c = (float)pVVar7 + local_10c; segment = (EntityPtr)npc; local_118 = (Entity_NPC *)pVVar7; do { *(float *)((int)segment + 0x380) = local_10c; local_e4._tint[0] = 0.0; local_e4._tint[1] = 0.0; local_e4._tint[2] = 0.0; local_e4._tint[3] = 0.0; local_e4._colorize[0] = g_vectorZero.x; local_e4._colorize[1] = g_vectorZero.y; local_e4._colorize[2] = g_vectorZero.x; local_e4._colorize[3] = g_vectorZero.y; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; pEVar5 = (EntityPtr *) (**(code **)(*(int *)segment + 0x20))(local_118,0x2000,0,&local_e4,0x1e); segment = *(EntityPtr *)((int)segment + 0x3c0); } while (segment != (EntityPtr)0x0); } if (npc->_dead == 0) { return pEVar5; } segment = npc->_parent; while (rootSegment = segment, rootSegment != (EntityPtr)0x0) { npc = (Entity_NPC *)rootSegment; segment = *(EntityPtr *)((int)rootSegment + 0x3bc); } do { local_e4._tint[0] = 0.0; local_e4._tint[1] = 0.0; local_e4._tint[2] = 0.0; local_e4._tint[3] = 0.0; local_e4._colorize[0] = g_vectorZero.x; local_e4._colorize[1] = g_vectorZero.y; local_e4._colorize[2] = g_vectorZero.x; local_e4._colorize[3] = g_vectorZero.y; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; pEVar5 = (EntityPtr *)(**(code **)(*(int *)npc + 0x24))(&local_e4); npc = *(Entity_NPC **)((int)npc + 0x3c0); } while ((EntityPtr)npc != (EntityPtr)0x0); return pEVar5; } if (npc->_dead != 0) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; return local_c; } Entity_NPC::UpdateChargeBar(npc,90.0,0.0,(float)npc->_i2,1); uVar6 = npc->_state; if (uVar6 == 0) { npc->_state = 6; local_100 = &npc->_pos; (npc->_targetPosition).x = local_100->x; (npc->_targetPosition).y = (npc->_pos).y; Entity_NPC::UpdateDirtColor(npc,1); local_108.x = (float)&npc->_type; npc->_aiCallFlags = 1; if (npc->_type != 0xf4) { return (EntityPtr *)local_108.x; } local_ec.x = (float)&npc->_variant; if (npc->_variant != 2) { return (EntityPtr *)local_ec.x; } if (npc->_subtype != 0) { return (EntityPtr *)local_ec.x; } roomSlot = &g_game->_room; Room::RaiseGridPathAtPos(*roomSlot,local_100,900); local_118 = (Entity_NPC *)&(npc->_pos).y; local_10c = 7.00649e-45; local_114.x = 1.4013e-42; do { room = *roomSlot; uVar6 = Random(); fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_11c = (void **)(fVar11 + fVar11); uVar6 = Random(); local_134 = (EntityPtr *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 20.0); fVar11 = cos((float)local_11c); local_124.x = fVar11 * (float)local_134 + local_100->x; fVar11 = sin((float)local_11c); local_124.y = fVar11 * (float)local_134 + *(float *)local_118; Room::GetClampedPositionImpl(room,&scratchVec,&local_124,10.0,10.0,10.0,10.0); Room::FindFreePickupSpawnPosition(g_game->_room,&local_130,&scratchVec,0.0,1,0,0); uVar6 = Random(); fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_134 = (EntityPtr *)(fVar11 + fVar11); uVar6 = Random(); local_11c = (void **)((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10); fVar11 = cos((float)local_134); local_130.x = fVar11 * 15.0 * (float)local_11c + local_130.x; fVar11 = sin((float)local_134); local_130.y = fVar11 * 15.0 * (float)local_11c + local_130.y; uVar6 = Random(); segment = (EntityPtr) Game::SpawnEx(g_game,*(uint *)local_108.x,*(uint *)local_ec.x,&local_130, &g_vectorZero,(Entity *)0x0,1,uVar6,0); if (*(EntityPtr *)((int)segment + 0x3bc) != (EntityPtr)0x0) { local_134 = (EntityPtr *)((int)segment + 0x3bc); std::multiset::erase(&local_134); } *(EntityPtr *)((int)segment + 0x3bc) = (EntityPtr)npc; if ((EntityPtr)npc != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)segment + 0x3bc)); } pEVar5 = (EntityPtr *)((int)npc + 0x3c0); if (*(int *)((int)npc + 0x3c0) != 0) { local_134 = pEVar5; std::multiset::erase(&local_134); } *pEVar5 = segment; std::multiset::insert(pEVar5); (**(code **)(*(int *)segment + 0xc))(); roomSlot = &g_game->_room; roomData = *roomSlot; iVar10 = (int)((*(float *)((int)segment + 0x33c) - 40.0) / 40.0 + 0.5); pEVar5 = (EntityPtr *)(int)((*(float *)((int)segment + 0x340) - 120.0) / 40.0 + 0.5); if (-1 < iVar10) { if (((iVar10 < *(int *)((int)roomData + 0xc)) && (-1 < (int)pEVar5)) && ((int)pEVar5 < *(int *)((int)roomData + 0x10))) { local_134 = (EntityPtr *)((int)pEVar5 * *(int *)((int)roomData + 0xc) + iVar10); pEVar5 = local_134; if (local_134 < (EntityPtr *)0x1c0) { iVar10 = *(int *)((int)roomData + (int)local_134 * 4 + 0x76c); pEVar5 = (EntityPtr *)(iVar10 / (int)local_114.x); if (iVar10 % (int)local_114.x < 900) { *(int *)((int)roomData + (int)local_134 * 4 + 0x76c) = (iVar10 - iVar10 % (int)local_114.x) + 900; pEVar5 = local_134; } } } } local_10c = (float)((int)local_10c + -1); npc = (Entity_NPC *)segment; local_11c = roomSlot; } while (local_10c != 0.0); return pEVar5; } if (uVar6 == 6) { ANM2::Play(&npc->_sprite,(byte *)"DigIn",0); uVar6 = extraout_EAX; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_pendingDamage < npc->_health) { npc->_state = 4; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_entityCollisionClass = 0; npc->_visible = 0; } else { npc->_state = 8; npc->_i1 = 0; } } } else if (uVar6 == 4) { if (((npc->_type != 0xf4) || (npc->_variant != 2)) || (npc->_subtype != 1)) { if (npc->_controllerID == -1) { if (npc->_stateFrame < 1) { roomData = g_game->_room; local_108.x = *(float *)((int)roomData + 0x14); local_114.x = *(float *)((int)roomData + 0x1c); local_118 = *(Entity_NPC **)((int)roomData + 0x18); local_ec.x = *(float *)((int)roomData + 0x20); pVVar7 = MusicManager::RandomVector(&scratchVec); uVar6 = Random(); game = g_game; fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 250.0 + 60.0; local_114.x = (local_114.x + local_108.x) * 0.5 + fVar11 * pVVar7->x; local_114.y = (local_ec.x + (float)local_118) * 0.5 + fVar11 * pVVar7->y; Room::GetClampedPositionImpl(g_game->_room,&local_124,&local_114,20.0,20.0,20.0,20.0); local_114.x = local_124.x; local_114.y = local_124.y; pVVar7 = Room::FindFreePickupSpawnPosition(game->_room,&scratchVec,&local_114,0.0,1,0,0); local_114.x = pVVar7->x; local_134 = (EntityPtr *)pVVar7->y; local_114.y = (float)local_134; local_10c = local_114.x; nearestPlayer = Game::GetNearestPlayer(g_game,&local_114); fVar12 = (float)local_134 - (nearestPlayer->_pos).y; fVar11 = local_10c - (nearestPlayer->_pos).x; local_114.x = fVar12 * fVar12 + fVar11 * fVar11; uVar6 = Random(); if ((((uVar6 & 1) == 0) && (10000.0 < local_114.x)) && (local_114.x < 1e+06)) { (npc->_targetPosition).x = local_10c; (npc->_targetPosition).y = (float)local_134; (npc->_pos).x = local_10c; (npc->_pos).y = (float)local_134; } } } else { npc->_i2 = npc->_i2 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,3.0,0,1); bVar4 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar4 != 0) || (0x59 < npc->_i2)) { pEVar5 = (EntityPtr *)(npc->_pos).x; pVVar7 = &npc->_pos; unused2 = (EntityPtr *)(npc->_pos).y; local_130.x = (float)pEVar5; local_130.y = (float)unused2; iVar10 = Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); if ((iVar10 != 0) || (bVar4 = Entity::IsPlayerInRadius((Entity *)npc,pVVar7,80.0,(int)pEVar5,(int)unused2), bVar4 != 0)) { Room::FindFreePickupSpawnPosition(g_game->_room,&local_130,pVVar7,0.0,1,0,0); fVar11 = (npc->_pos).y - local_130.y; fVar12 = pVVar7->x - local_130.x; fVar11 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); if (30.0 <= fVar11) { if (0x77 < npc->_i2) { npc->_i2 = 0x5a; sourceRef = EntityRef::EntityRef((EntityRef *)&local_e4); (**(code **)(*(int *)npc + 0x20))(0x40600000,0,0,sourceRef,0x1e); } goto LAB_0053efd1; } pVVar7->x = local_130.x; (npc->_pos).y = local_130.y; } (npc->_targetPosition).x = pVVar7->x; (npc->_targetPosition).y = (npc->_pos).y; } } LAB_0053efd1: if (0 < npc->_stateFrame) { npc->_stateFrame = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; } bVar4 = Vector::operator_ne(&npc->_targetPosition,&g_vectorZero); uVar6 = (uint)bVar4; if (bVar4 != 0) { npc->_state = 8; npc->_i1 = 0; npc->_visible = 1; Entity_NPC::UpdateDirtColor(npc,1); npc->_i2 = 0; uVar6 = extraout_EAX_00; } } } else if (uVar6 == 8) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); pAVar2 = &npc->_sprite; ANM2::Play(pAVar2,(byte *)"DigOut",0); iVar10 = npc->_variant; npc->_entityCollisionClass = 4; if ((iVar10 == 1) || (iVar10 == 3)) { bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar2,"PreShoot"); if ((bVar4 != 0) && ((npc->_controllerID == -1 && (bVar4 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&npc->_pos), bVar4 == 0)))) { npc->_state = 6; } bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar2,"Shoot"); if (bVar4 != 0) { iVar10 = 1; if (npc->_variant != 3) { iVar10 = 10; } npc->_i1 = iVar10; Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); } uVar6 = npc->_i1; if (0 < (int)uVar6) { local_118 = (Entity_NPC *)0x41f00000; npc->_i1 = uVar6 - 1; if (npc->_variant == 3) { local_118 = (Entity_NPC *)0x42a00000; } sourceRef = Entity_NPC::GetPlayerTarget(npc); local_114.x = (sourceRef->_pos).x; local_108.x = (sourceRef->_pos).y; fVar12 = (npc->_pos).x - local_114.x; fVar11 = (npc->_pos).y - local_108.x; fVar11 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); local_124.x = (sourceRef->_velocity).x * 0.2 * fVar11 + local_114.x; local_124.y = (sourceRef->_velocity).y * 0.2 * fVar11 + local_108.x; Room::GetClampedPositionImpl(g_game->_room,&local_130,&local_124,4.0,4.0,4.0,4.0); pVVar7 = MusicManager::RandomVector(&scratchVec); uVar6 = Random(); fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar12 = fVar11 * pVVar7->y * (float)local_118 + local_130.y; fVar11 = fVar11 * pVVar7->x * (float)local_118 + local_130.x; if (npc->_controllerID != -1) { pVVar7 = Entity_NPC::GetAimTargetPosition(npc,&scratchVec); fVar11 = pVVar7->x; fVar12 = pVVar7->y; } pVVar7 = &npc->_pos; local_ec.x = (fVar11 - (npc->_pos).x) * 0.025; local_ec.y = (fVar12 - (npc->_pos).y) * 0.025; ProjectileParams::ProjectileParams(¶ms); uVar6 = Random(); params.HeightModifier = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 25.0; uVar6 = Random(); params.FallingAccelModifier = 1.5; params.FallingSpeedModifier = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 8.0 - 56.0; uVar6 = Random(); params.Scale = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 0.5; if (npc->_variant == 3) { params.BulletFlags._0_4_ = 2; params.BulletFlags._4_4_ = 0; params.Scale = 1.6; params.Color._colorize[0] = 0.4; params.Color._colorize[1] = 2.0; params.Color._colorize[2] = 0.5; params.Color._colorize[3] = 1.0; local_124.x = 0.0; uVar6 = Random(); local_130.x = 0.0; local_130.y = -30.0; local_124.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * -2.0; spawn_blood_explosion(2,pVVar7,&local_130,¶ms.Color,&local_124); } Entity_NPC::FireProjectiles(npc,pVVar7,&local_ec,0,¶ms); uVar6 = npc->_i1 / 6; fVar11 = (float)(npc->_i1 % 6); if ((fVar11 == 0.0) && (npc->_variant != 3)) { local_124.x = fVar11; uVar6 = Random(); local_124.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * -2.0; Color::Color(&local_e4); local_130.x = 0.0; local_130.y = -30.0; sourceRef = spawn_blood_explosion(1,pVVar7,&local_130,color,&local_124); uVar6 = Random(); (sourceRef->_sprite)._rotation = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0; rngResult = Random(); uVar6 = -((int)rngResult >> 0x1f); fVar11 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar12 = fVar11 * g_vectorOne.y; fVar11 = fVar11 * g_vectorOne.x; sourceRef->_renderZOffset = 100; (sourceRef->_sprite)._scale.y = fVar12; (sourceRef->_sprite)._scale.x = fVar11; } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 6; } } else { if ((((npc->_type == 0xf4) && (iVar10 == 2)) && (npc->_child != (EntityPtr)0x0)) && (bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar2,&DAT_00b61210), bVar4 != 0)) { local_118 = Entity_NPC::ChildNPC(npc); local_11c = (void **)0x0; do { uVar6 = Random(); local_10c = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_10c = local_10c + local_10c; uVar6 = Random(); local_134 = (EntityPtr *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 250.0 + 60.0); fVar11 = cos(local_10c); local_108.x = fVar11 * (float)local_134 + (npc->_pos).x; fVar11 = sin(local_10c); game = g_game; local_108.y = fVar11 * (float)local_134 + (npc->_pos).y; Room::GetClampedPositionImpl(g_game->_room,&local_124,&local_108,20.0,20.0,20.0,20.0); local_108.x = local_124.x; local_108.y = local_124.y; pVVar7 = Room::FindFreePickupSpawnPosition(game->_room,&scratchVec,&local_108,0.0,1,0,0); uVar6 = Random(); local_10c = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_10c = local_10c + local_10c; uVar6 = Random(); local_134 = (EntityPtr *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10); fVar11 = cos(local_10c); local_100 = (Vector *)(fVar11 * 15.0 * (float)local_134 + pVVar7->x); fVar11 = sin(local_10c); local_108.x = (float)local_100; local_114.x = fVar11 * 15.0 * (float)local_134 + pVVar7->y; local_108.y = local_114.x; nearestPlayer = Game::GetNearestPlayer(g_game,&local_108); fVar12 = local_114.x - (nearestPlayer->_pos).y; fVar11 = (float)local_100 - (nearestPlayer->_pos).x; fVar11 = fVar12 * fVar12 + fVar11 * fVar11; if (10000.0 < fVar11) { pEVar5 = (EntityPtr *)local_114.x; pVVar7 = local_100; if (((int)local_11c < 2) || (fVar11 < 1e+06)) goto LAB_0053f35a; } local_11c = (void **)((int)local_11c + 1); } while ((int)local_11c < 10); pVVar7 = MusicManager::RandomVector(&scratchVec); pEVar5 = (EntityPtr *)(pVVar7->y * 26.0 + (npc->_pos).y); pVVar7 = (Vector *)(pVVar7->x * 26.0 + (npc->_pos).x); LAB_0053f35a: childNpc = local_118; (local_118->_targetPosition).x = (float)pVVar7; (local_118->_targetPosition).y = (float)pEVar5; (local_118->_pos).x = (float)pVVar7; (local_118->_pos).y = (float)pEVar5; local_118->_state = 8; local_118->_visible = 1; local_118 = (Entity_NPC *)&local_118->_targetPosition; Entity_NPC::UpdateDirtColor(childNpc,1); childNpc->_i2 = 0; } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); uVar6 = (uint)bVar4; if (bVar4 != 0) { sourceRef = Entity_NPC::GetPlayerTarget(npc); local_124.y = (sourceRef->_velocity).y * 10.0; local_124.x = (sourceRef->_velocity).x * 10.0; local_114.x = local_124.y * local_124.y + local_124.x * local_124.x; local_11c = (void **)local_124.x; local_100 = (Vector *)local_124.y; if (100.0 < local_114.x) { local_130.x = (sourceRef->_pos).x; local_130.y = (sourceRef->_pos).y; pVVar7 = Room::GetLaserTarget(g_game->_room,&scratchVec,&local_130,&local_124); fVar11 = (sourceRef->_pos).y - pVVar7->y; fVar12 = (sourceRef->_pos).x - pVVar7->x; fVar11 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); local_108.x = fVar11 - 8.0; fVar11 = sqrtf(local_114.x); if (local_108.x < fVar11) { local_11c = (void **)((float)local_11c * (local_108.x / fVar11)); local_100 = (Vector *)((float)local_100 * (local_108.x / fVar11)); } } playerTarget = Entity_NPC::GetPlayerTarget(npc); local_124.x = (sourceRef->_pos).x + (float)local_11c; local_130.x = (playerTarget->_pos).x; local_130.y = (playerTarget->_pos).y; local_124.y = (float)local_100 + (sourceRef->_pos).y; Room::GetClampedPositionImpl(g_game->_room,&local_114,&local_124,20.0,20.0,20.0,20.0); if (npc->_controllerID != -1) { pVVar7 = Entity_NPC::GetAimTargetPosition(npc,&scratchVec); local_130.x = pVVar7->x; local_130.y = pVVar7->y; local_114.x = local_130.x; local_114.y = local_130.y; } local_108.x = local_114.x - (npc->_pos).x; local_108.y = local_114.y - (npc->_pos).y; pVVar7 = &npc->_pos; bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); uVar6 = (uint)bVar4; if (bVar4 == 0) { iVar10 = npc->_type; if (iVar10 == 0xff) { ProjectileParams::ProjectileParams(¶ms); params.TargetPosition.x = pVVar7->x; params.BulletFlags._0_4_ = (uint)params.BulletFlags | 0x800; params.TargetPosition.y = (npc->_pos).y; local_124.x = 10.0; local_124.y = 5.0; Entity_NPC::FireProjectiles(npc,pVVar7,&local_124,6,¶ms); Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); uVar6 = extraout_EAX_01; } else if (iVar10 == 0x114) { projParams = ProjectileParams::ProjectileParams(¶ms); if (npc->_type == 0x121) { fVar11 = 8.0; } else { fVar11 = 10.0; } projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_130,fVar11,projParams); fVar11 = (projectile->_velocity).x; fVar12 = (projectile->_velocity).y; flagsHigh = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 2; projectile->_fallingAccel = projectile->_fallingAccel - 0.3; fVar3 = projectile->_fallingSpeed; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = flagsHigh; projectile->_scale = 1.6; projectile->_fallingSpeed = fVar3 * 0.7 - 13.0; projectile->_height = projectile->_height - 20.0; (projectile->_velocity).x = fVar11 * 0.55; (projectile->_velocity).y = fVar12 * 0.55; Color::Color(&local_e4); local_e4._colorize[0] = 0.4; local_e4._colorize[1] = 2.0; local_e4._colorize[2] = 0.5; local_e4._colorize[3] = 1.0; (**(code **)(*extraout_EDX + 0x3c))(extraout_ECX,0xffffffff,0xff,0,1); Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); uVar6 = extraout_EAX_02; } else if (iVar10 == 0x121) { if (npc->_controllerID == -1) { bVar4 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),pVVar7); uVar6 = (uint)bVar4; if (bVar4 == 0) goto LAB_0053ff4c; } isLineClear = Room::CheckLine(g_game->_room,pVVar7,&local_114,3,999,0,0,(Vector *)0x0); uVar6 = Random(); if (((uVar6 % 100 < 0x4b) || (isLineClear == 0)) && (iVar10 = Entity_NPC::GetAliveEnemyCount(npc), iVar10 < 7)) { uVar6 = Random(); sourceRef = Game::SpawnEx(g_game,0x100,0,pVVar7,&g_vectorZero,(Entity *)npc,0,uVar6,0); flagsHigh = *(undefined4 *)((int)&sourceRef->_flags + 4); *(uint *)&sourceRef->_flags = (uint)sourceRef->_flags & 0xfffffffb; *(undefined4 *)((int)&sourceRef->_flags + 4) = flagsHigh; Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); uVar6 = extraout_EAX_03; } else { projParams = ProjectileParams::ProjectileParams(¶ms); if (npc->_type == 0x121) { fVar11 = 8.0; } else { fVar11 = 10.0; } projectile = Entity_NPC::FireBossProjectiles(npc,1,&local_130,fVar11,projParams); projectile->_scale = 1.0; Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); uVar6 = extraout_EAX_04; } } else if (((iVar10 == 0xf4) && (npc->_variant == 2)) && (npc->_subtype == 0)) { ProjectileParams::ProjectileParams(¶ms); params.BulletFlags._0_4_ = 0; params.BulletFlags._4_4_ = 0x40; params.Scale = 2.0; pVVar9 = Vector::Normalized(&local_108,&scratchVec); local_124.y = pVVar9->y * 10.0; local_124.x = pVVar9->x * 10.0; Entity_NPC::FireProjectiles(npc,pVVar7,&local_124,0,¶ms); Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); uVar6 = extraout_EAX_05; } else { if (npc->_controllerID == -1) { bVar4 = Room::CheckLine(g_game->_room,pVVar7,&local_114,3,999,0,0,(Vector *)0x0); uVar6 = (uint)bVar4; if (bVar4 == 0) goto LAB_0053ff4c; } projParams = ProjectileParams::ProjectileParams(¶ms); pVVar7 = Vector::Normalized(&local_108,&scratchVec); local_124.y = pVVar7->y * 10.0; local_124.x = pVVar7->x * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_124,0,projParams); Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); uVar6 = extraout_EAX_06; } } } } LAB_0053ff4c: if ((npc->_type == 0x114) && (uVar6 = uVar6 & 0xff, (npc->_sprite)._animState._animFrame == 0.0) ) { uVar6 = Random(); sourceRef = Game::SpawnEx(g_game,1000,0x3d,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6,0); if (sourceRef->_parent != (EntityPtr)0x0) { local_114.x = (float)&sourceRef->_parent; std::multiset::erase(&local_114); } sourceRef->_parent = (EntityPtr)npc; std::multiset::insert(&sourceRef->_parent); *(float *)sourceRef[1]._sprite._filename._buf = npc->_size; pAVar2 = &sourceRef[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = 'H'; (pAVar2->_filename)._buf[7] = 'B'; pAVar2 = &sourceRef[1]._sprite; (pAVar2->_filename)._buf[8] = '\x05'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &sourceRef[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x05'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); uVar6 = extraout_EAX_07; } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && ((npc->_state = 6, npc->_type == 0xf4 && (npc->_variant == 2)))) { npc->_stateFrame = 0x2d; } } fVar11 = (npc->_targetPosition).x; pEVar5 = (EntityPtr *) (uint)CONCAT11((fVar11 == g_vectorZero.x) << 6 | (NAN(fVar11) || NAN(g_vectorZero.x)) << 2 | 2U | fVar11 < g_vectorZero.x, (char)uVar6); if (fVar11 == g_vectorZero.x) { fVar12 = (npc->_targetPosition).y; pEVar5 = (EntityPtr *) (uint)CONCAT11((fVar12 == g_vectorZero.y) << 6 | (NAN(fVar12) || NAN(g_vectorZero.y)) << 2 | 2U | fVar12 < g_vectorZero.y ,(char)uVar6); if (fVar12 == g_vectorZero.y) goto LAB_0054009c; } fVar12 = (npc->_targetPosition).y; fVar3 = (npc->_pos).y; (npc->_velocity).x = fVar11 - (npc->_pos).x; (npc->_velocity).y = fVar12 - fVar3; LAB_0054009c: npc->_friction = npc->_friction * 0.8; return pEVar5; } //@@ 005400d0 NpcAI::ENTITY_DART_FLY /* NPC AI for entity type 256 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DART_FLY(Entity_NPC *npc) { Entity_Player *pEVar1; uint uVar2; Vector *pVVar3; Entity *pEVar4; float fVar5; float fVar6; double dVar7; float fVar8; float local_1c; Vector local_18; Vector local_10; pEVar1 = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); if ((pEVar1 != (Entity_Player *)0x0) && (npc->_dead == 0)) { award_fly_kill_points(&g_game->_scoreSheet,(Entity *)npc); (**(code **)(*(int *)npc + 0x28))(); Entity_Player::AddBlueFlies(pEVar1,1,&npc->_pos,(Entity *)0x0); return; } pEVar1 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1); if ((pEVar1 != (Entity_Player *)0x0) && ((npc->_flags & 0x20000000) == 0)) { Entity_NPC::Morph(npc,0xd,0,0,-1); fVar5 = g_vectorZero.x; (npc->_v2).x = g_vectorZero.x; fVar8 = g_vectorZero.y; (npc->_v2).y = g_vectorZero.y; (npc->_v1).x = fVar5; (npc->_v1).y = fVar8; return; } if (npc->_state == 0) { npc->_stateFrame = 0; npc->_state = 4; uVar2 = Random(); fVar5 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; (npc->_v1).x = (fVar5 + fVar5) * 3.1415927; return; } if (npc->_state == 4) { fVar5 = (npc->_v1).x + 0.18849558; (npc->_v1).x = fVar5; if (6.2831855 <= fVar5) { (npc->_v1).x = fVar5 - 6.2831855; } pVVar3 = Entity_NPC::CalcTargetPosition(npc,&local_10,0.0); local_10.x = pVVar3->y - (npc->_pos).y; local_18.x = pVVar3->x - (npc->_pos).x; fVar6 = sqrtf(local_10.x * local_10.x + local_18.x * local_18.x); pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar5 = (pEVar4->_velocity).x; fVar8 = (pEVar4->_velocity).y; if (npc->_controllerID == -1) { local_18.x = (fVar5 + fVar5) * fVar6 * 0.25 + local_18.x; local_18.y = (fVar8 + fVar8) * fVar6 * 0.25 + local_10.x; pVVar3 = Vector::Normalized(&local_18,&local_10); dVar7 = (double)((npc->_v1).x * 0.5); libm_sse2_cos_precise(); local_1c = (float)dVar7 * 10.0 + pVVar3->x * 15.0 * 0.9; dVar7 = (double)(npc->_v1).x; libm_sse2_sin_precise(); fVar8 = (float)dVar7 * 10.0; fVar5 = pVVar3->y * 15.0 * 0.9; } else { pVVar3 = Entity_NPC::GetControllerInput(npc,&local_10,0.0); dVar7 = (double)((npc->_v1).x * 0.5); libm_sse2_cos_precise(); local_1c = (float)dVar7 * 6.0 + pVVar3->x * 15.0 * 1.2; dVar7 = (double)(npc->_v1).x; libm_sse2_sin_precise(); fVar8 = (float)dVar7 * 6.0; fVar5 = pVVar3->y * 15.0 * 1.2; } fVar6 = local_1c * 0.75 * 0.9 * 0.033333335 * npc->_speedMultiplier + (npc->_velocity).x; local_10.x = (fVar8 + fVar5) * 0.75 * 0.9 * 0.033333335 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fVar6; (npc->_velocity).y = local_10.x; fVar5 = sqrtf(local_10.x * local_10.x + fVar6 * fVar6); if ((8.0 < fVar5) && (0.0 < fVar5)) { (npc->_velocity).y = (8.0 / fVar5) * local_10.x; (npc->_velocity).x = (8.0 / fVar5) * fVar6; } npc->_friction = npc->_friction * 0.95; } ANM2::Play(&npc->_sprite,s_Fly,0); (npc->_sprite)._flipX = 0.0 < (npc->_velocity).x; return; } //@@ 00540510 NpcAI::ENTITY_FAT_BAT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 258 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FAT_BAT(Entity_NPC *npc) { byte bVar1; Vector *pVVar2; uint uVar3; int count; Vector *shotDir; float fVar4; float fVar5; float fVar6; EntityList_EL nearbyBats; float avoidX; int avoidCount; float local_f0; Vector local_ec; Vector local_e4; Vector local_dc; float local_d4; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; int nearbyBat; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af4880; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; if (npc->_state == 0) { npc->_state = 4; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = -30.0; return; } ExceptionList = &local_1c; Entity_NPC::CalcTargetPosition(npc,&local_ec,0.0); pVVar2 = &npc->_pos; local_f0 = local_ec.x - pVVar2->x; local_e4.y = local_ec.y - (npc->_pos).y; local_dc.x = local_f0; local_dc.y = local_e4.y; if (npc->_state != 4) { if (npc->_state == 8) { ANM2::Play(&npc->_sprite,(byte *)"Shooting",0); Entity_NPC::UpdateControllerMovement(npc,0); if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar1 != 0)) { npc->_state = 4; shotDir = &npc->_controllerMovement; if ((shotDir->x == g_vectorZero.x) && ((npc->_controllerMovement).y == g_vectorZero.y)) { shotDir = &local_dc; } local_d4 = shotDir->x; local_dc.y = shotDir->y; local_ec.y = (float)ProjectileParams::ProjectileParams(&projParams); fVar6 = sqrtf(local_dc.y * local_dc.y + local_d4 * local_d4); if (fVar6 <= 0.0) { local_e4.x = local_d4; local_e4.y = local_dc.y; } else { local_e4.y = (10.0 / fVar6) * local_dc.y; local_e4.x = (10.0 / fVar6) * local_d4; } Entity_NPC::FireProjectiles(npc,pVVar2,&local_e4,0,(ProjectileParams *)local_ec.y); Entity_NPC::PlaySound(npc,0x92,1.0,2,0,1.0); } } goto LAB_00540d89; } ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_controllerID != -1) { pVVar2 = Entity_NPC::GetControllerInput(npc,&local_ec,0.0); fVar6 = npc->_speedMultiplier; fVar4 = pVVar2->y; (npc->_velocity).x = pVVar2->x * 0.45 * fVar6 + (npc->_velocity).x; (npc->_velocity).y = fVar4 * 0.45 * fVar6 + (npc->_velocity).y; if ((npc->_projectileCooldown == 0) && (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { Entity_NPC::UpdateControllerMovement(npc,1); npc->_state = 8; npc->_projectileCooldown = 0x1e; } goto LAB_00540d89; } fVar4 = local_e4.y * _DAT_00c5c850 + local_f0 * _DAT_00c5c84c; fVar6 = -50.0; if (-50.0 < fVar4) { fVar6 = fVar4; } fVar5 = local_e4.y * _DAT_00c5c858 + local_f0 * _DAT_00c5c854; fVar4 = fVar6; if (fVar6 < fVar5) { fVar4 = fVar5; } uVar3 = (uint)(fVar6 < fVar5); fVar6 = local_e4.y * DAT_00c5c860 + local_f0 * DAT_00c5c85c; if (fVar4 < fVar6) { uVar3 = 2; fVar4 = fVar6; } if (fVar4 < local_e4.y * DAT_00c5c868 + local_f0 * DAT_00c5c864) { uVar3 = 3; } fVar6 = *(float *)(&DAT_00c5c84c + uVar3 * 8) * local_f0 + *(float *)(&DAT_00c5c850 + uVar3 * 8) * local_e4.y; local_d4 = -(*(float *)(&DAT_00c5c84c + uVar3 * 8) * fVar6); local_dc.y = -(*(float *)(&DAT_00c5c850 + uVar3 * 8) * fVar6); if ((((npc->_projectileCooldown == 0) && (uVar3 = Random(), uVar3 % 0xf == 0)) && (fVar6 = (local_ec.x + local_d4) - pVVar2->x, fVar4 = (local_ec.y + local_dc.y) - (npc->_pos).y, fVar4 * fVar4 + fVar6 * fVar6 < 1600.0)) && (local_f0 * local_f0 + local_e4.y * local_e4.y < 562500.0)) { npc->_state = 8; npc->_projectileCooldown = 0x1e; } local_d4 = (local_ec.x + local_d4 * 0.8) - pVVar2->x; local_dc.y = (local_ec.y + local_dc.y * 0.8) - (npc->_pos).y; fVar6 = sqrtf(local_d4 * local_d4 + local_dc.y * local_dc.y); game = g_game; if (fVar6 <= 0.0) { fVar4 = local_d4; fVar6 = local_dc.y; } else { fVar4 = (0.45 / fVar6) * local_d4; fVar6 = (0.45 / fVar6) * local_dc.y; } fVar5 = npc->_speedMultiplier; (npc->_velocity).x = fVar4 * fVar5 + (npc->_velocity).x; (npc->_velocity).y = fVar6 * fVar5 + (npc->_velocity).y; EntityList::QueryRadius((EntityList *)((int)game->_room + 0x1218),&nearbyBats,pVVar2,100.0,4); local_14 = 0.0; if (nearbyBats._size != 0) { count = 0; uVar3 = 0; avoidCount = 0; local_f0 = local_f0 * local_f0 + local_e4.y * local_e4.y; if (local_f0 <= 0.0) { local_f0 = 0.0; } if (10000.0 <= local_f0) { local_f0 = 10000.0; } local_f0 = local_f0 / 10000.0; avoidX = g_vectorZero.x; local_e4.y = g_vectorZero.y; if (nearbyBats._size != 0) { do { nearbyBat = *(int *)((int)nearbyBats._data + uVar3 * 4); fVar6 = (npc->_pos).x - *(float *)(nearbyBat + 0x33c); fVar4 = (npc->_pos).y - *(float *)(nearbyBat + 0x340); local_dc.y = *(float *)(nearbyBat + 0x364); if (0.0 < *(float *)(nearbyBat + 0x360) * fVar6 + local_dc.y * fVar4) { local_ec.y = 1.0 - (fVar4 * fVar4 + fVar6 * fVar6) / 10000.0; local_d4 = -*(float *)(nearbyBat + 0x360); if (local_d4 * fVar4 + local_dc.y * fVar6 < 0.0) { local_dc.y = -local_dc.y; local_d4 = -local_d4; } fVar6 = sqrtf(local_d4 * local_d4 + local_dc.y * local_dc.y); if (fVar6 <= 0.0) { fVar4 = local_d4; fVar6 = local_dc.y; } else { fVar6 = (local_ec.y * 0.5 * local_f0) / fVar6; fVar4 = local_d4 * fVar6; fVar6 = local_dc.y * fVar6; } avoidX = fVar6 + avoidX; local_e4.y = fVar4 + local_e4.y; count = avoidCount + 1; avoidCount = count; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)nearbyBats._size); if (0 < count) { if (npc->_collidesWithGrid != 0) { uVar3 = Random(); if ((uVar3 & 1) == 0) { fVar4 = -(avoidX / (float)avoidCount); fVar5 = -(local_e4.y / (float)avoidCount); fVar6 = npc->_speedMultiplier; (npc->_velocity).x = (fVar4 + fVar4) * fVar6 + (npc->_velocity).x; (npc->_velocity).y = (fVar5 + fVar5) * fVar6 + (npc->_velocity).y; goto LAB_00540c00; } count = avoidCount; } fVar6 = npc->_speedMultiplier; (npc->_velocity).x = (avoidX / (float)count) * fVar6 + (npc->_velocity).x; (npc->_velocity).y = (local_e4.y / (float)count) * fVar6 + (npc->_velocity).y; } } } LAB_00540c00: if (nearbyBats._0_1_ == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,nearbyBats._data,0); } LAB_00540d89: npc->_friction = npc->_friction * 0.8; if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } ExceptionList = local_1c; return; } //@@ 00540df0 NpcAI::ENTITY_SWARM /* NPC AI for entity type 281 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SWARM(Entity_NPC *npc) { uint subType; code *pcVar1; EntityPtr *pEVar2; qword qVar3; byte bVar4; uint uVar5; uint spawnSeed; uint rngResult; Entity *spawnedFly; int iVar6; Entity_Player *player; Vector *pVVar7; byte *animNameChar; ScoreSheet *scoreSheet; void *listData; byte *expectedNameChar; qword *allocatedBytes; EntityPtr leader; bool isLess; float fVar8; float fVar9; undefined1 *orbitSign; EntityPtr *spawnedFly; float pushY; EntityList_EL nearby; undefined1 local_30 [12]; float local_24; EntityPtr *local_20; EntityPtr *local_1c; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; Entity_NPC *childFly; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00af48bd; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; if (npc->_state == 0) { if (npc->_parent == (EntityPtr)0x0) { local_14 = 5.60519e-45; do { spawnSeed = (npc->_dropRNG)._seed; if (spawnSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); spawnSeed = (npc->_dropRNG)._seed; if (spawnSeed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } spawnSeed = spawnSeed >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ spawnSeed; spawnSeed = spawnSeed << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ spawnSeed; spawnSeed = spawnSeed >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ spawnSeed; (npc->_dropRNG)._seed = spawnSeed; subType = npc->_subtype; rngResult = Random(); fVar8 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20 = (EntityPtr *)(fVar8 + fVar8); local_1c = (EntityPtr *)sin((float)local_20); fVar8 = cos((float)local_20); local_30._8_4_ = fVar8 * 10.0 + (npc->_pos).x; local_24 = (float)local_1c * 10.0 + (npc->_pos).y; spawnedFly = Game::Spawn(g_game,npc->_type,npc->_variant,(Vector *)(local_30 + 8), &g_vectorZero,(Entity *)npc,subType,spawnSeed); spawnedFly = &spawnedFly->_parent; if (spawnedFly->_parent != (EntityPtr)0x0) { local_20 = spawnedFly; std::multiset::erase(&local_20); } *spawnedFly = (EntityPtr)npc; std::multiset::insert(spawnedFly); (**(code **)(*(int *)spawnedFly + 0xc))(); local_14 = (float)((int)local_14 + -1); } while (local_14 != 0.0); } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; } if (npc->_controllerID != -1) { if ((npc->_parent != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(npc->_parent,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar5), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } if (npc->_parent != (EntityPtr)0x0) { iVar6 = __RTDynamicCast(npc->_parent,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar5); if (iVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } Entity_NPC::TransferControl(npc,(Entity_NPC *)npc->_parent); } } player = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); if ((player != (Entity_Player *)0x0) && (npc->_dead == 0)) { scoreSheet = &g_game->_scoreSheet; npc->_entityCollisionClass = 0; award_fly_kill_points(scoreSheet,(Entity *)npc); (**(code **)(*(int *)npc + 0x28))(); Entity_Player::AddBlueFlies(player,1,&npc->_pos,(Entity *)0x0); ExceptionList = local_10; return; } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1); if ((player != (Entity_Player *)0x0) && ((npc->_flags & 0x20000000) == 0)) { Entity_NPC::Morph(npc,0xd,0,0,-1); fVar8 = g_vectorZero.x; (npc->_v2).x = g_vectorZero.x; fVar9 = g_vectorZero.y; (npc->_v2).y = g_vectorZero.y; (npc->_v1).x = fVar8; (npc->_v1).y = fVar9; ExceptionList = local_10; return; } if (npc->_state == 0) { npc->_state = 4; ExceptionList = local_10; return; } if ((npc->_flags & 0x800000000000) != 0) { fVar8 = (npc->_pos).y; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = fVar8; } if ((npc->_parent == (EntityPtr)0x0) && (npc->_dead != 0)) { leader = (EntityPtr)0x0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_30,npc->_type, npc->_variant,-1,1,0); fVar8 = 0.0; local_8 = 0; if (local_24 != 0.0) { listData = (void *)local_30._4_4_; do { childFly = *(Entity_NPC **)((int)listData + (int)fVar8 * 4); if ((childFly != npc) && (childFly->_parent == (EntityPtr)npc)) { local_1c = &childFly->_parent; if (childFly->_parent != (EntityPtr)0x0) { local_20 = local_1c; std::multiset::erase(&local_20); listData = (void *)local_30._4_4_; } *local_1c = leader; if (leader == (EntityPtr)0x0) { leader = *(EntityPtr *)((int)listData + (int)fVar8 * 4); } else { std::multiset::insert(local_1c); listData = (void *)local_30._4_4_; } } fVar8 = (float)((int)fVar8 + 1); } while ((uint)fVar8 < (uint)local_24); if (leader != (EntityPtr)0x0) { fVar8 = (npc->_targetPosition).y; *(float *)((int)leader + 0x334) = (npc->_targetPosition).x; *(float *)((int)leader + 0x338) = fVar8; if (npc->_controllerID != -1) { Entity_NPC::TransferControl(npc,(Entity_NPC *)leader); } } } local_8 = 0xffffffff; if (local_30[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_30._4_4_,0); local_8 = 0xffffffff; } } if (npc->_state == 4) { fVar8 = npc->_speedMultiplier; fVar9 = (npc->_v1).x; (npc->_velocity).y = fVar8 * (npc->_v1).y + (npc->_velocity).y; (npc->_velocity).x = fVar8 * fVar9 + (npc->_velocity).x; local_1c = (EntityPtr *)(npc->_targetPosition).x; leader = npc->_parent; local_20 = (EntityPtr *)(npc->_targetPosition).y; if (leader == (EntityPtr)0x0) { if (npc->_controllerID == -1) { pVVar7 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_30 + 8),0.0); local_14 = pVVar7->x - (npc->_pos).x; local_18 = pVVar7->y - (npc->_pos).y; fVar8 = sqrtf(local_14 * local_14 + local_18 * local_18); if (fVar8 <= 0.0) { fVar8 = local_14; } else { local_18 = (5.0 / fVar8) * local_18; fVar8 = (5.0 / fVar8) * local_14; } fVar9 = npc->_speedMultiplier; (npc->_targetPosition).y = fVar9 * local_18 + (npc->_targetPosition).y; (npc->_targetPosition).x = fVar9 * fVar8 + (npc->_targetPosition).x; } else { pVVar7 = Entity_NPC::GetControllerInput(npc,(Vector *)(local_30 + 8),0.0); fVar8 = npc->_speedMultiplier; fVar9 = pVVar7->y; (npc->_targetPosition).x = fVar8 * pVVar7->x * 6.0 + (npc->_targetPosition).x; (npc->_targetPosition).y = fVar8 * fVar9 * 6.0 + (npc->_targetPosition).y; } } else { local_1c = *(EntityPtr **)((int)leader + 0x334); local_20 = *(EntityPtr **)((int)leader + 0x338); } uVar5 = npc->_index; if ((uVar5 & 1) == 0) { orbitSign = (undefined1 *)0x3f800000; } else { orbitSign = &DAT_bf800000; } local_18 = ((float)(g_game->_frameCount - npc->_spawnFrame) * (float)orbitSign * 5.0 + (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 25.0) * 0.017453292; local_24 = sin(local_18); uVar5 = Random(); local_14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.8; fVar9 = cos(local_18); game = g_game; fVar8 = (npc->_pos).y; (npc->_v1).x = ((float)local_1c - (npc->_pos).x) * 0.03 + fVar9 * local_14; (npc->_v1).y = ((float)local_20 - fVar8) * 0.03 + local_14 * local_24; EntityList::QueryRadius((EntityList *)((int)game->_room + 0x1218),&nearby,&npc->_pos,50.0,8); uVar5 = 0; if (nearby._size != 0) { listData = nearby._data; do { iVar6 = *(int *)((int)listData + uVar5 * 4); if ((uint)npc->_index <= *(uint *)(iVar6 + 0x20)) { local_20 = (EntityPtr *)((npc->_pos).x - *(float *)(iVar6 + 0x33c)); local_1c = (EntityPtr *)((npc->_pos).y - *(float *)(iVar6 + 0x340)); fVar8 = sqrtf((float)local_20 * (float)local_20 + (float)local_1c * (float)local_1c); spawnedFly = local_20; pushY = (float)local_1c; if (0.0 < fVar8) { fVar8 = ((1.0 - fVar8 / 50.0) * 0.75) / fVar8; spawnedFly = (EntityPtr *)((float)local_20 * fVar8); pushY = (float)local_1c * fVar8; } fVar8 = npc->_speedMultiplier; (npc->_velocity).y = fVar8 * pushY + (npc->_velocity).y; (npc->_velocity).x = fVar8 * (float)spawnedFly + (npc->_velocity).x; *(float *)(iVar6 + 0x360) = *(float *)(iVar6 + 0x360) - (float)spawnedFly; *(float *)(iVar6 + 0x364) = *(float *)(iVar6 + 0x364) - pushY; listData = nearby._data; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)nearby._size); } if ((npc->_parent == (EntityPtr)0x0) && (uVar5 = 0, nearby._size != 0)) { do { iVar6 = *(int *)((int)nearby._data + uVar5 * 4); if (*(int *)(iVar6 + 0x3bc) == 0) { local_24 = (npc->_targetPosition).x; local_1c = (EntityPtr *)((npc->_targetPosition).y - *(float *)(iVar6 + 0x338)); local_20 = (EntityPtr *)(local_24 - *(float *)(iVar6 + 0x334)); fVar8 = (float)local_20 * (float)local_20 + (float)local_1c * (float)local_1c; if (fVar8 < 10000.0) { fVar8 = sqrtf(fVar8); if (fVar8 <= 0.0) { spawnedFly = local_20; pEVar2 = local_1c; } else { fVar8 = ((1.0 - fVar8 / 100.0) * 0.5) / fVar8; spawnedFly = (EntityPtr *)((float)local_20 * fVar8); pEVar2 = (EntityPtr *)((float)local_1c * fVar8); } (npc->_targetPosition).y = (float)pEVar2 + (npc->_targetPosition).y; (npc->_targetPosition).x = local_24 + (float)spawnedFly; } } uVar5 = uVar5 + 1; } while (uVar5 < (uint)nearby._size); } npc->_friction = npc->_friction * 0.8; if (nearby._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (nearby._data != (void *)0x0) { uVar5 = *(uint *)((int)nearby._data + -4); qVar3 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar3 < uVar5); free((void *)((int)nearby._data + -4)); } local_8 = 0xffffffff; } } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedNameChar = s_Fly; do { bVar4 = *animNameChar; isLess = bVar4 < *expectedNameChar; if (bVar4 != *expectedNameChar) { LAB_005417a0: uVar5 = -(uint)isLess | 1; goto LAB_005417a5; } if (bVar4 == 0) break; bVar4 = animNameChar[1]; isLess = bVar4 < expectedNameChar[1]; if (bVar4 != expectedNameChar[1]) goto LAB_005417a0; animNameChar = animNameChar + 2; expectedNameChar = expectedNameChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_005417a5: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_005417d8; } bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Fly,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_005417d8: (npc->_sprite)._flipX = 0.0 < (npc->_velocity).x; ExceptionList = local_10; return; } //@@ 00541810 NpcAI::ENTITY_DUKIE /* NPC AI for entity type 288 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DUKIE(Entity_NPC *npc) { byte bVar1; uint rngResult; int iVar2; Entity *dartFly; Vector *pVVar3; float fVar4; float accelY; Vector local_20; Vector local_18; Vector local_10; undefined4 flagsHigh; float friction; float speedMultiplier; float *velocityY; if (npc->_state == 0) { npc->_state = 4; npc->_entityGridCollisionClass = 3; rngResult = Random(); local_18.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_18.x = local_18.x + local_18.x; local_20.x = cos(local_18.x); fVar4 = sin(local_18.x); (npc->_velocity).x = local_20.x; (npc->_velocity).y = fVar4; npc->_projectileCooldown = 0x3c; return; } Entity_NPC::UpdateChargeBar(npc,90.0,0.0,(float)npc->_projectileCooldown,1); npc->_friction = npc->_friction * 0.9; if (npc->_state == 4) { ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_projectileCooldown < 1) { if (npc->_controllerID == -1) { rngResult = Random(); if ((rngResult % 10 != 0) || (iVar2 = Entity_NPC::GetAliveEnemyCount(npc), 7 < iVar2)) goto LAB_00541b8f; } else { bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar1 == 0) && (bVar1 = Entity_NPC::IsControllerActionPressed(npc,9), bVar1 == 0)) goto LAB_00541b8f; } bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar1 == 0) { npc->_state = 8; } } } else if (npc->_state == 8) { ANM2::Play(&npc->_sprite,(byte *)"Cough",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); rngResult = Random(); pVVar3 = MusicManager::RandomVector(&local_10); local_18.x = pVVar3->x * 3.5 + (npc->_velocity).x; local_18.y = pVVar3->y * 3.5 + (npc->_velocity).y; local_20.x = (npc->_pos).x + 0.0; local_20.y = (npc->_pos).y + 40.0; dartFly = Game::SpawnEx(g_game,0x100,0,&local_20,&local_18,(Entity *)npc,0,rngResult,0); flagsHigh = *(undefined4 *)((int)&dartFly->_flags + 4); *(uint *)&dartFly->_flags = (uint)dartFly->_flags & 0xfffffffb; *(undefined4 *)((int)&dartFly->_flags + 4) = flagsHigh; rngResult = Random(); if (rngResult % 3 == 0) { rngResult = Random(); pVVar3 = MusicManager::RandomVector(&local_10); local_18.x = pVVar3->x * 3.5 + (npc->_velocity).x; local_18.y = pVVar3->y * 3.5 + (npc->_velocity).y; local_20.x = (npc->_pos).x + 0.0; local_20.y = (npc->_pos).y + 40.0; dartFly = Game::SpawnEx(g_game,0x100,0,&local_20,&local_18,(Entity *)npc,0,rngResult,0); flagsHigh = *(undefined4 *)((int)&dartFly->_flags + 4); *(uint *)&dartFly->_flags = (uint)dartFly->_flags & 0xfffffffb; *(undefined4 *)((int)&dartFly->_flags + 4) = flagsHigh; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00541b8f; } npc->_state = 4; if (npc->_controllerID == -1) { rngResult = Random(); iVar2 = rngResult % 0x1e + 0x5a; } else { iVar2 = 0x5a; } npc->_projectileCooldown = iVar2; } LAB_00541b8f: if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } if (((npc->_flags & 0x200) != 0) && (npc->_controllerID == -1)) { PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); return; } fVar4 = 0.3; accelY = 0.3; local_20.x = 0.3; local_18.x = 0.3; if ((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) { fVar4 = -0.3; local_20.x = -0.3; } velocityY = &(npc->_velocity).y; if (*velocityY <= 0.0 && *velocityY != 0.0) { accelY = -0.3; local_18.x = -0.3; } if (npc->_controllerID != -1) { pVVar3 = Entity_NPC::GetControllerInput(npc,&local_10,0.0); fVar4 = sqrtf(local_20.x * local_20.x + local_18.x * local_18.x); accelY = local_18.x + fVar4 * 0.5 * pVVar3->y; fVar4 = fVar4 * 0.5 * pVVar3->x + local_20.x; } friction = npc->_friction; if (friction != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * accelY) / friction + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * fVar4) / friction + (npc->_velocity).x; } return; } //@@ 00541ce0 NpcAI::ENTITY_MEATBALL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 290 (from dispatcher 006c2990) */ Entity_Effect * __fastcall NpcAI::ENTITY_MEATBALL(Entity_NPC *npc) { code *pcVar1; float fVar2; longlong lVar3; longlong lVar4; longlong lVar5; byte bVar6; char cVar7; Vector *pVVar8; Entity *pEVar9; int iVar10; Vector *pVVar11; ProjectileParams *params; uint uVar12; uint uVar13; float *pfVar14; int *piVar15; Entity_Effect *pEVar16; uint uVar17; int unusedArg; void *pvVar18; uint uVar19; float unaff_EBX; float unaff_ESI; PlayerManager *playerManager; bool bVar20; ulonglong timeNs; Entity *local_1ac; void *local_1a8; undefined1 auStack_1a4 [8]; float local_19c [2]; int morphVariant; uint local_190; uint uStack_18c; Vector local_184; Game *pGStack_17c; uint uStack_174; EntityPtr *pEStack_170; uint uStack_16c; float fStack_168; float afStack_158 [3]; Entity_NPC *self; Vector *npcPos; Vector moveInput; Vector scratchVec; Vector VStack_134; Vector VStack_12c; Vector VStack_124; undefined4 uStack_11c; undefined1 auStack_118 [4]; undefined1 auStack_114 [8]; int iStack_10c; RNG cardRng [2]; undefined4 uStack_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; ProjectileParams projParams; Entity_Effect *local_c; Game *game; Room *room; EntityPtr *spawnerRef; local_c = (Entity_Effect *)(__security_cookie ^ (uint)&local_1ac); if (npc->_state == 0) { npc->_state = 4; return local_c; } self = npc; pVVar8 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); pVVar11 = &npc->_pos; local_1ac = (Entity *)(pVVar8->y - (npc->_pos).y); local_1a8 = (void *)(pVVar8->x - pVVar11->x); local_184.x = (float)local_1a8; local_184.y = (float)local_1ac; npcPos = pVVar11; Entity_NPC::UpdateChargeBar(npc,60.0,0.0,(float)npc->_projectileCooldown,1); iVar10 = npc->_state; if (iVar10 != 4) { if (iVar10 == 0x10) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); ANM2::Play(&npc->_sprite,(byte *)"Charge",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { uVar17 = Random(); npc->_stateFrame = 0; npc->_state = uVar17 & 1 | 8; if (npc->_controllerID == -1) { pvVar18 = local_1a8; pEVar9 = local_1ac; } else { pVVar8 = Entity_NPC::GetAimTargetPosition(npc,&scratchVec); local_184.x = pVVar8->x - pVVar11->x; local_184.y = pVVar8->y - (npc->_pos).y; pvVar18 = (void *)local_184.x; pEVar9 = (Entity *)local_184.y; if (100.0 <= local_184.y * local_184.y + local_184.x * local_184.x) { npc->_state = 9; } else { npc->_state = 8; } } if (((float)pvVar18 != g_vectorZero.x) || ((float)pEVar9 != g_vectorZero.y)) { (npc->_sprite)._flipX = (float)pvVar18 < 0.0; } pVVar11 = Vector::Normalized(&local_184,&scratchVec); (npc->_targetPosition).x = pVVar11->x; (npc->_targetPosition).y = pVVar11->y; Entity_NPC::PlaySound(npc,(npc->_state != 8) + 0xb,1.0,2,0,1.0); } } else if (iVar10 == 8) { ANM2::Play(&npc->_sprite,(byte *)"Shoot1",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } iVar10 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (((iVar10 != 0) && (bVar6 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"), bVar6 != 0)) && (bVar6 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b1d6f4), bVar6 == 0)) { params = ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,10.0,params); } } else if (iVar10 == 9) { ANM2::Play(&npc->_sprite,(byte *)"Shoot2",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } bVar6 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (((bVar6 != 0) && (bVar6 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b1d6f4), bVar6 == 0)) && (local_190 = (int)npc->_updateTime - (int)npc->_prevUpdateTime, 0 < (int)local_190)) { iVar10 = npc->_stateFrame; do { uVar17 = local_190; local_19c[0] = (float)iVar10 * 25.0 * (npc->_targetPosition).y + pVVar11->y; auStack_1a4._4_4_ = (float)iVar10 * 25.0 * (npc->_targetPosition).x + pVVar11->x; uVar12 = Random(); pEVar9 = Game::SpawnEx(g_game,1000,0x16,(Vector *)(auStack_1a4 + 4),&g_vectorZero, (Entity *)npc,0,uVar12,0); iVar10 = *(int *)pEVar9; (pEVar9->_sprite)._scale.x = 1.0; (pEVar9->_sprite)._scale.y = 1.0; (**(code **)(iVar10 + 0xc))(); room = g_game->_room; if (*(int *)(*(int *)((int)room->_descriptor + 0x10) + 0x48) - 9U < 4) { Room::GetClampedPositionImpl (room,&VStack_134,(Vector *)(auStack_1a4 + 4),0.0,0.0,0.0,0.0); if ((VStack_134.x != (float)auStack_1a4._4_4_) || (VStack_134.y != local_19c[0])) goto LAB_005422e4; LAB_005425f7: bVar20 = true; } else { if (((room->_topLeftPos).x + 0.0 <= (float)auStack_1a4._4_4_) && ((((float)auStack_1a4._4_4_ <= (room->_bottomRightPos).x - 0.0 && ((room->_topLeftPos).y + 0.0 <= local_19c[0])) && (local_19c[0] <= (room->_bottomRightPos).y - 0.0)))) goto LAB_005425f7; LAB_005422e4: bVar20 = false; } if (bVar20) { uVar17 = Random(); uStack_c4 = 0; uStack_c0 = 0; uStack_bc = 0; VStack_12c.x = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10; VStack_12c.y = VStack_12c.x * (npc->_targetPosition).y; VStack_12c.x = VStack_12c.x * (npc->_targetPosition).x; VStack_12c.y = VStack_12c.y + VStack_12c.y; VStack_12c.x = VStack_12c.x + VStack_12c.x; uStack_e4 = 0x3f800000; uStack_e0 = 0x3f800000; uStack_dc = 0x3f800000; uStack_d8 = 0x3f800000; uStack_d4 = 0; uStack_d0 = 0; uStack_cc = 0; uStack_c8 = 0; uVar17 = Random(); fStack_168 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * -16.0; VStack_124.y = local_19c[0] - (npc->_targetPosition).y * 5.0; VStack_124.x = (float)auStack_1a4._4_4_ - (npc->_targetPosition).x * 5.0; uVar17 = Random(); pEVar9 = Game::Spawn(g_game,1000,2,&VStack_124,&VStack_12c,(Entity *)0x0,2,uVar17); (**(code **)(*(int *)pEVar9 + 0x3c))(&uStack_e4,0xffffffff,0xff); (pEVar9->_sprite)._offset.x = 0.0; (pEVar9->_sprite)._offset.y = (float)pGStack_17c; pEVar9->_renderDepthOffset = 10.0; uVar17 = Random(); (pEVar9->_sprite)._rotation = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 360.0; local_184.y = (float)Random(); pGStack_17c = g_game; uVar12 = 0; local_190 = 7; local_19c[0] = 1.4013e-42; lua_callback_run_pre_entity_spawn ((int *)local_19c,(int *)&local_190,(Vector *)(auStack_1a4 + -0x10), &g_vectorZero,(Entity *)0x0,(int *)(auStack_1a4 + -0x1c),(uint *)&local_184.y ); uVar17 = local_190; if (1 < *(int *)&g_game->_deathmatchManager) { piVar15 = (g_game->_deathmatchManager)._type; uVar13 = Random(); VStack_124.x = 7.00649e-45; VStack_124.y = 1.26117e-44; local_1ac = (Entity *)&DAT_00000007; uStack_11c = 7; if (local_19c[0] == 7.00649e-45) { if (uVar17 < 0x12d) { if (uVar17 == 300) { while ((uVar12 == 0 || (cVar7 = (**(code **)(*piVar15 + 0x24))(uVar12), cVar7 != '\0'))) { if (uVar13 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pEVar16 = (Entity_Effect *)(*pcVar1)(); return pEVar16; } uVar13 = uVar13 >> (VStack_124.x._0_1_ & 0x1f) ^ uVar13; uVar13 = uVar13 << (VStack_124.y._0_1_ & 0x1f) ^ uVar13; uVar13 = uVar13 >> ((byte)local_1ac & 0x1f) ^ uVar13; iVar10 = ItemPool::GetCardEx(uVar13,0x19,10,10,1); cardRng[0]._shift1 = 5; cardRng[0]._shift2 = 9; cardRng[0]._shift3 = 7; cardRng[0]._seed = uVar13; uVar12 = lua_callback_run_get_card(cardRng,iVar10,1,1,0); } } else { if (uVar17 == 0x46) { uStack_18c = uVar12 >> 0xb; do { if (uVar12 != 0) { pcVar1 = *(code **)(*piVar15 + 0x28); iVar10 = ItemPool::GetPillEffect (&g_game->_itemPool,uVar12,(Entity_Player *)0x0); cVar7 = (*pcVar1)(iVar10); if (cVar7 == '\0') goto LAB_005427b6; } if (uVar13 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pEVar16 = (Entity_Effect *)(*pcVar1)(); return pEVar16; } uVar13 = uVar13 >> (VStack_124.x._0_1_ & 0x1f) ^ uVar13; uVar13 = uVar13 << (VStack_124.y._0_1_ & 0x1f) ^ uVar13; uVar13 = uVar13 >> ((byte)local_1ac & 0x1f) ^ uVar13; uVar12 = ItemPool::GetPill(uVar13); uVar12 = uVar12 | (uStack_18c & 1) << 0xb; } while( true ); } if (uVar17 == 100) { uVar17 = uVar12; if (uVar12 == 0x19) { LAB_005425fe: bVar20 = false; } else { uStack_174 = uVar12; std::set::find_node(auStack_114,&uStack_174); if (((*(char *)(iStack_10c + 0xd) == '\0') && (*(int *)(iStack_10c + 0x10) <= (int)uVar12)) && (iStack_10c != piVar15[8])) goto LAB_005425fe; bVar20 = true; } if ((uVar12 == 0) || (uVar12 = uVar17, bVar20)) { uVar12 = (**(code **)(*piVar15 + 0x84))(0); } } } } else if (uVar17 == 0x15e) { while ((uVar12 == 0 || (cVar7 = (**(code **)(*piVar15 + 0x2c))(uVar12), cVar7 != '\0'))) { uVar12 = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } } LAB_005427b6: local_1ac = EntityFactory::Create(pGStack_17c->_entityFactory,(uint)local_19c[0],0); if (local_1ac != (Entity *)0x0) { timeNs = GetTimeNs(); pEVar9 = local_1ac; uStack_18c = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; auStack_1a4._4_4_ = SUB84((ulonglong)lVar3 >> 0x20,0); lVar4 = (ulonglong)uStack_18c * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)((ulonglong)lVar4 >> 0x20); uVar17 = auStack_1a4._4_4_ + (uint)CARRY4((uint)lVar3,(uint)lVar4); lVar3 = (ulonglong)uStack_18c * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar17),uVar13 + uVar17); uStack_16c = (uint)((ulonglong)lVar3 >> 0x20); spawnerRef = &local_1ac->_spawnerEntity; uVar17 = (uint)lVar3 >> 0x12 | uStack_16c * 0x4000; uStack_16c = uStack_16c >> 0x12; local_1ac->_spawnerType = 0; local_1ac->_spawnerVariant = 0; if (*spawnerRef != (EntityPtr)0x0) { pEStack_170 = spawnerRef; std::multiset::erase(&pEStack_170); } iVar10 = *(int *)pEVar9; *spawnerRef = (EntityPtr)0x0; (pEVar9->_pos).x = unaff_ESI; (pEVar9->_pos).y = unaff_EBX; (pEVar9->_velocity).x = g_vectorZero.x; (pEVar9->_velocity).y = g_vectorZero.y; (**(code **)(iVar10 + 4))(local_19c[0],local_190,uVar12,local_184.y); game = pGStack_17c; pvVar18 = pGStack_17c->_room; iVar10 = *(int *)((int)pvVar18 + 0x1214); *(int *)((int)pvVar18 + 0x1214) = iVar10 + 1; pEVar9->_index = iVar10; EntityList::AddEntity((EntityList *)((int)pvVar18 + 0x1218),pEVar9); bVar6 = Game::ShouldEraseEnemy(pEVar9); if (bVar6 != 0) { Entity::RemoveWithPoof(pEVar9,unusedArg); } if ((pEVar9->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { VStack_12c.x = (float)pEVar9->_variant; fVar2 = (float)pEVar9->_type; VStack_134.y = fVar2; std::map::find(&local_1a8,&VStack_134.y); if (local_1a8 == (game->_proceduralItemManager)._spawnTriggerTargets._head) { afStack_158[1] = -NAN; afStack_158[0] = fVar2; pfVar14 = (float *)std::map::find(auStack_118,afStack_158); local_1a8 = (void *)*pfVar14; if (local_1a8 == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_00542a21; } uVar12 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar18 = (playerManager->_playerList)._end; if ((int)pvVar18 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar18 = (playerManager->_playerList)._end; } piVar15 = (playerManager->_playerList)._begin; if (uVar12 < (uint)((int)pvVar18 - (int)piVar15 >> 2)) { piVar15 = piVar15 + uVar12; } trigger_set_dispatch ((void *)(*piVar15 + 0x1fc8),6,pEVar9,(Vector *)(auStack_1a4 + -0x10), &g_vectorZero); uVar12 = uVar12 + 1; playerManager = &g_game->_playerManager; } while (uVar12 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00542a21: timeNs = GetTimeNs(); uVar12 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; uStack_18c = (uint)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar12 * 0x431bde82; auStack_1a4._4_4_ = SUB84(lVar4,0); lVar5 = (ulonglong)uVar12 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); pGStack_17c = (Game *)(lVar5 + lVar3); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), uStack_18c + CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar19 = (uint)((ulonglong)lVar4 >> 0x20); uVar12 = (uint)lVar4 >> 0x12 | uVar19 * 0x4000; uVar13 = uVar12 - uVar17; bVar20 = CARRY4((uint)g_entitySpawnTimeMs,uVar13); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar13; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar19 >> 0x12) - uStack_16c) - (uint)(uVar12 < uVar17)) + (uint)bVar20; } (**(code **)(*(int *)local_1ac + 0xc))(); npc = self; uVar17 = local_190; pVVar11 = npcPos; } npc->_stateFrame = npc->_stateFrame + 1; local_190 = uVar17 - 1; iVar10 = npc->_stateFrame; } while (local_190 != 0); } } goto LAB_00542acf; } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } PathFinder::MoveRandomly((PathFinder *)&npc->_pathfinder,0); ANM2::Play(&npc->_sprite,s_Idle,0); if (npc->_controllerID != -1) { pVVar8 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); local_1a8 = (void *)pVVar8->x; local_1ac = (Entity *)pVVar8->y; if (((float)local_1a8 != g_vectorZero.x) || ((float)local_1ac != g_vectorZero.y)) { (npc->_sprite)._flipX = (float)local_1a8 < 0.0; } } if (npc->_controllerID == -1) { if (90000.0 <= (float)local_1ac * (float)local_1ac + (float)local_1a8 * (float)local_1a8) goto LAB_00542acf; room = g_game->_room; pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_184.x = (pEVar9->_pos).x; local_184.y = (pEVar9->_pos).y; bVar6 = Room::CheckLine(room,pVVar11,&local_184,3,999,0,0,(Vector *)0x0); if ((bVar6 == 0) || (uVar17 = Random(), uVar17 % 0x14 != 0)) goto LAB_00542acf; } else { bVar6 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar6 == 0) && (bVar6 = Entity_NPC::IsControllerActionPressed(npc,9), bVar6 == 0)) goto LAB_00542acf; } if (npc->_projectileCooldown < 1) { bVar20 = npc->_controllerID == -1; iVar10 = 0x5a; npc->_state = 0x10; if (!bVar20) { iVar10 = 0x3c; } npc->_projectileCooldown = iVar10; if (bVar20) { pvVar18 = local_1a8; pEVar9 = local_1ac; } else { pVVar11 = Entity_NPC::GetControllerMovementInput(npc,&moveInput,0.0); pvVar18 = (void *)pVVar11->x; pEVar9 = (Entity *)pVVar11->y; } if (((float)pvVar18 != g_vectorZero.x) || ((float)pEVar9 != g_vectorZero.y)) { (npc->_sprite)._flipX = (float)pvVar18 < 0.0; } } LAB_00542acf: game = g_game; pEVar16 = (Entity_Effect *)((uint)npc->_flags & 0x4000); if (pEVar16 == (Entity_Effect *)0x0) { bVar6 = Game::IsPaused(g_game); pEVar16 = (Entity_Effect *)(uint)bVar6; if ((bVar6 == 0) && (pEVar16 = (Entity_Effect *)(game->_frameCount / 7), game->_frameCount % 7 == 0)) { uVar17 = Random(); pEVar16 = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.4); } } if (npc->_dead != 0) { local_190 = 0x1b; morphVariant = 0; Entity_NPC::Redirect((int *)&local_190,&morphVariant); pEVar16 = (Entity_Effect *)0x0; if (local_190 != 0) { Entity_NPC::Morph(npc,local_190,morphVariant,0,-1); pEVar16 = (Entity_Effect *)npc->_maxHitPoints; npc->_dead = 0; npc->_health = (float)pEVar16; npc->_stateFrame = 0; npc->_projectileCooldown = 0; npc->_state = 3; } } npc->_friction = npc->_friction * 0.8; return pEVar16; } //@@ 00542be0 NpcAI::ENTITY_MUSHROOM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 300 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MUSHROOM(Entity_NPC *npc) { byte bVar1; int iVar2; uint rngResult; float *damageEvent; ProjectileParams *projectileParams; float fVar3; Vector scratchVec; ProjectileParams projectileParamsBuf; float local_8; float *damageEventsEnd; float posY; local_8 = (float)(__security_cookie ^ (uint)&(&projectileParamsBuf)[1].CircleAngle); iVar2 = npc->_state; if (iVar2 == 0) { npc->_state = 3; if (npc->_controllerID == -1) { rngResult = Random(); iVar2 = (rngResult % 5 + 1) * 0x1e; } else { iVar2 = 0x1e; } npc->_stateFrame = iVar2; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; return; } if ((0.0 < npc->_pendingDamage) && (iVar2 == 3)) { damageEvent = (npc->_damageEvents)._begin; damageEventsEnd = (npc->_damageEvents)._end; if (damageEvent != damageEventsEnd) { do { *damageEvent = *damageEvent * 0.25; damageEvent = damageEvent + 0xe; } while (damageEvent != damageEventsEnd); iVar2 = npc->_state; } } switch(iVar2) { case 3: if (npc->_i1 == 0) { ANM2::Play(&npc->_sprite,&DAT_00b1d5b0,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_i1 = npc->_i1 + 1; } } else { ANM2::Play(&npc->_sprite,(byte *)"Blocking",0); npc->_stateFrame = npc->_stateFrame + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); if ((npc->_stateFrame < 1) && (((npc->_controllerID == -1 || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) || (bVar1 = Entity_NPC::IsControllerActionPressed(npc,9), bVar1 != 0)))) { rngResult = Random(); npc->_state = rngResult & 1 | 8; if (npc->_controllerID != -1) { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); npc->_state = (bVar1 != 0) + 8; Entity_NPC::UpdateControllerMovement(npc,1); } } } default: goto LAB_00543055; case 8: case 9: if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar3 = g_vectorZero.y; code_r0x00542e09: (npc->_controllerMovement).y = fVar3; } else { Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.1); if ((scratchVec.x != g_vectorZero.x) || (scratchVec.y != g_vectorZero.y)) { (npc->_controllerMovement).x = scratchVec.x; fVar3 = scratchVec.y; goto code_r0x00542e09; } } if ((npc->_controllerID != -1) && ((fVar3 = (npc->_controllerMovement).x, fVar3 != g_vectorZero.x || ((npc->_controllerMovement).y != g_vectorZero.y)))) { fVar3 = atan2f((npc->_controllerMovement).y,fVar3); npc->_state = ((int)((fVar3 * 57.295776 + 360.0 + 22.5) / 45.0) & 1U) + 8; } ANM2::Play(&npc->_sprite,(byte *)"Reveal",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); projectileParams = ProjectileParams::ProjectileParams(&projectileParamsBuf); scratchVec.x = 7.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles (npc,&npc->_pos,&scratchVec,(npc->_state == 9) + 6,projectileParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00543055; } if (npc->_controllerID == -1) { rngResult = Random(); npc->_state = 0x10; iVar2 = (rngResult % 3 + 1) * 0x1e; } else { iVar2 = 0x1e; npc->_state = 0x10; } break; case 0x10: if (0 < npc->_stateFrame) { ANM2::Play(&npc->_sprite,(byte *)"Revealed",0); npc->_stateFrame = npc->_stateFrame + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); if (npc->_stateFrame < 1) { if ((npc->_controllerID != -1) && ((bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0 || (bVar1 = Entity_NPC::IsControllerActionPressed(npc,9), bVar1 != 0)))) { npc->_stateFrame = 1; } if (npc->_stateFrame < 1) { Entity_NPC::PlaySound(npc,0x26,0.5,2,0,1.0); } } goto LAB_00543055; } ANM2::Play(&npc->_sprite,&DAT_00b1d5b0,0); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00543055; npc->_state = 3; if (npc->_controllerID == -1) { rngResult = Random(); iVar2 = (rngResult % 5 + 1) * 0x1e; } else { iVar2 = 0x1e; } } npc->_stateFrame = iVar2; LAB_00543055: npc->_friction = npc->_friction * 0.8; fVar3 = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar3 - posY; return; } //@@ 005430d0 NpcAI::ENTITY_BLISTER /* NPC AI for entity type 303 (from dispatcher 006c2990) */ float __fastcall NpcAI::ENTITY_BLISTER(Entity_NPC *npc) { undefined4 uVar1; byte bVar2; uint rngResult; float fVar3; EntityPtr jumpTarget; Vector *pVVar4; float extraout_EAX; int animFrame; float extraout_EAX_00; float extraout_EAX_01; Entity_NPC *sack; float extraout_EAX_02; int iVar5; float fVar6; undefined1 auVar7 [12]; EntityPtr *pEVar8; Vector local_28; EntityPtr *local_20; float local_1c; Vector local_18; Vector spawnVelocity; void *animData; int *stateFrame; fVar3 = (float)npc->_state; if (fVar3 == 0.0) { npc->_state = 4; rngResult = Random(); npc->_stateFrame = rngResult % 0x1e; return (float)(rngResult / 0x1e); } if (fVar3 == 5.60519e-45) { ANM2::Play(&npc->_sprite,s_Idle,0); fVar3 = (float)(int)npc->_updateTime; stateFrame = &npc->_stateFrame; *stateFrame = *stateFrame + ((int)npc->_prevUpdateTime - (int)fVar3); if ((*stateFrame < 0) || (npc->_controllerID != -1)) { jumpTarget = npc->_child; if (jumpTarget == (EntityPtr)0x0) { jumpTarget = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); } fVar3 = (npc->_pos).x - ((Vector *)((int)jumpTarget + 0x33c))->x; pEVar8 = (EntityPtr *)((npc->_pos).y - *(float *)((int)jumpTarget + 0x340)); if (npc->_controllerID == -1) { if (ABS(fVar3) <= ABS((float)pEVar8)) { local_28.x = 0.0; (npc->_targetPosition).x = -0.0; if ((float)pEVar8 <= 0.0) { local_20 = (EntityPtr *)0xc2200000; if (-40.0 <= (float)pEVar8) { local_20 = pEVar8; } } else { local_20 = (EntityPtr *)0x42200000; if ((float)pEVar8 <= 40.0) { local_20 = pEVar8; } } fVar3 = -(float)local_20; } else { local_20 = (EntityPtr *)0x0; if (fVar3 <= 0.0) { auVar7 = ZEXT812(0xc2200000); if (auVar7._0_4_ <= fVar3) { auVar7._4_8_ = auVar7._4_8_; auVar7._0_4_ = fVar3; } } else { auVar7 = ZEXT812(0x42200000); if (fVar3 <= auVar7._0_4_) { auVar7._4_8_ = auVar7._4_8_; auVar7._0_4_ = fVar3; } } local_28.x = auVar7._0_4_; (npc->_targetPosition).x = -local_28.x * 0.2; fVar3 = -0.0; } (npc->_targetPosition).y = fVar3 * 0.2; LAB_0054334f: rngResult = Random(); bVar2 = (byte)(rngResult / 10); if (rngResult % 10 == 0) { LAB_00543365: if (npc->_child == (EntityPtr)0x0) { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); pVVar4 = Entity_NPC::GetControllerMovementInput(npc,&local_18,0.0); if ((pVVar4->x != g_vectorZero.x) || (fVar3 = (float)((uint)pVVar4 & 0xff), pVVar4->y != g_vectorZero.y)) { pVVar4 = Entity_NPC::GetControllerMovementInput(npc,&local_28,0.0); (npc->_targetPosition).x = pVVar4->x; fVar3 = pVVar4->y; (npc->_targetPosition).y = fVar3; } goto LAB_0054326e; } } } else { pVVar4 = Entity_NPC::GetControllerInput(npc,&local_18,0.0); iVar5 = npc->_controllerID; local_28.x = -pVVar4->x * 40.0; local_20 = (EntityPtr *)(-pVVar4->y * 40.0); (npc->_targetPosition).x = -local_28.x * 0.2; (npc->_targetPosition).y = -(float)local_20 * 0.2; if (iVar5 == -1) goto LAB_0054334f; bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar2 != 0) || (bVar2 = Entity_NPC::IsControllerActionPressed(npc,9), bVar2 != 0)) goto LAB_00543365; } if ((local_28.x != g_vectorZero.x) || (fVar3 = (float)(uint)bVar2, (float)local_20 != g_vectorZero.y)) { npc->_state = 6; ANM2::Play(&npc->_sprite,&DAT_00b1de1c,0); fVar3 = extraout_EAX; } } LAB_0054326e: fVar6 = npc->_friction * 0.6; } else if (fVar3 == 8.40779e-45) { animData = (npc->_sprite)._animState._animData; if (animData == (void *)0x0) { iVar5 = 0; } else { iVar5 = *(int *)((int)animData + 0x30); } animFrame = ANM2::GetFrame(&npc->_sprite); fVar6 = 1.0 - (float)animFrame / (float)iVar5; fVar3 = (npc->_targetPosition).x; (npc->_velocity).y = fVar6 * (npc->_targetPosition).y; (npc->_velocity).x = fVar6 * fVar3; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_00543497: npc->_state = 4; rngResult = Random(); fVar3 = (float)(rngResult / 0x1e); npc->_stateFrame = rngResult % 0x1e; } else { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); fVar3 = (float)(uint)bVar2; if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x45,1.0,2,0,1.0); fVar3 = extraout_EAX_00; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_00543497; } fVar6 = npc->_friction * 0.9; } else { if (fVar3 != 1.12104e-44) goto LAB_00543664; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0054362e: npc->_state = 4; rngResult = Random(); fVar3 = (float)(rngResult / 0x1e); npc->_stateFrame = rngResult % 0x1e; } else { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); fVar3 = (float)(uint)bVar2; if (bVar2 != 0) { rngResult = Random(); pVVar4 = Vector::Resized(&npc->_targetPosition,&spawnVelocity,4.0); local_18.x = (npc->_pos).x + 0.0; local_18.y = (npc->_pos).y + 1.0; local_28.x = (float)Game::SpawnEx(g_game,0x194,1,&local_18,pVVar4,(Entity *)npc,0,rngResult, 0); pEVar8 = (EntityPtr *)((int)local_28.x + 0x3c8); *(uint *)((int)local_28.x + 0x168) = *(uint *)((int)local_28.x + 0x168) & 0xfffffffb; *(undefined4 *)((int)local_28.x + 0x16c) = *(undefined4 *)((int)local_28.x + 0x16c); if (*pEVar8 != (EntityPtr)0x0) { local_20 = pEVar8; std::multiset::erase(&local_20); } *pEVar8 = (EntityPtr)npc; std::multiset::insert(pEVar8); pEVar8 = &npc->_child; if (npc->_child != (EntityPtr)0x0) { local_20 = pEVar8; std::multiset::erase(&local_20); } *pEVar8 = (EntityPtr)local_28.x; std::multiset::insert(pEVar8); rngResult = Random(); Entity_NPC::PlaySound (npc,0x19e,1.0,2,0, (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); fVar3 = extraout_EAX_01; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0054362e; } fVar6 = npc->_friction * 0.7; } npc->_friction = fVar6; LAB_00543664: if (npc->_dead != 0) { local_20 = (EntityPtr *)(npc->_pos).x; local_1c = (npc->_pos).y; fVar3 = (float)Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); if ((fVar3 == 0.0) && (npc->_championRegenCount == 0)) { rngResult = RNG::Next(&npc->_dropRNG); sack = (Entity_NPC *) Game::SpawnEx(g_game,0x1e,2,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngResult,0); fVar3 = sack->_maxHitPoints; uVar1 = *(undefined4 *)((int)&sack->_flags + 4); *(uint *)&sack->_flags = (uint)sack->_flags & 0xfffffffb; *(undefined4 *)((int)&sack->_flags + 4) = uVar1; sack->_health = fVar3 * 0.5; Entity_NPC::TransferControl(npc,sack); fVar3 = extraout_EAX_02; } } return fVar3; } //@@ 00543720 NpcAI::ENTITY_PORTAL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 306 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PORTAL(Entity_NPC *npc) { uint *puVar1; void **ppvVar2; Game *pGVar3; code *pcVar4; byte bVar5; uint uVar6; LayerState *layer; int iVar7; uint spawnRoll; Entity *spawnedEnemy; EntityConfig_Entity *entityConfig; float *healthSource; EntityRef *ref; int *entityIt; ANM2 *sprite; float fVar8; double dVar9; undefined4 spawnRoll; int iVar11; undefined8 uVar12; float local_80; float local_7c; byte isAltStage; float fStack_74; Entity_NPC *portal; float fStack_6c; float renderScale; undefined4 local_64 [8]; undefined4 local_44; undefined4 uStack_40; undefined4 local_3c; EntityRef EStack_38; undefined4 uStack_10; uint local_c; void *room; local_c = __security_cookie ^ (uint)&local_80; portal = npc; if (npc->_state == 0) { npc->_state = 3; npc->_entityCollisionClass = 2; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x2000; *(int *)&npc->_flags = (int)npc->_flags; if (npc->_variant == 0) { (npc->_posOffset).x = 0.0; (npc->_posOffset).y = -30.0; } npc->_renderZOffset = 0x28; local_44 = 0x3f1c9c9d; uStack_40 = 0x3e8c8c8d; local_3c = 0x3f3bbbbc; if (&npc->_splatColor != (ColorMod *)local_64) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.6117647; (npc->_splatColor)._offset[1] = 0.27450982; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.73333335; } uVar6 = (npc->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (npc->_dropRNG)._seed; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar6 = uVar6 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar6; (npc->_dropRNG)._seed = uVar6; npc->_i2 = 0xf; npc->_i1 = uVar6 % 5 + 1; return; } iVar11 = npc->_variant; if (iVar11 == 0) { iVar11 = g_game->_stage; if (iVar11 < 0xb) { if (iVar11 == 9) goto LAB_00543939; } else if (iVar11 != 0xc) { LAB_00543939: (**(code **)(*(int *)npc + 0x28))(); iVar11 = npc->_variant; goto LAB_00543941; } LAB_0054389b: sprite = &npc->_sprite; } else { LAB_00543941: pGVar3 = g_game; if (iVar11 != 1) goto LAB_0054389b; renderScale = g_displayPixelRatio * g_screenPointScale; local_7c = g_screenWidth; room = g_game->_room; local_80 = ((g_screenWidth - 338.0) * 0.5 + ((portal->_pos).x - 60.0) * 0.65) * renderScale + 0.5; dVar9 = floor((double)local_80); fStack_6c = (float)dVar9 / renderScale; local_80 = g_screenHeight; fStack_74 = ((g_screenHeight - 182.0) * 0.5 + ((portal->_pos).y - 140.0) * 0.65) * renderScale + 0.5; dVar9 = floor((double)fStack_74); fStack_74 = (float)dVar9; local_7c = (local_7c * 0.5 - (fStack_6c + *(float *)((int)room + 0x1204) + (pGVar3->_screenShakeOffset).x)) / (g_screenPointScale * 30.0); local_80 = (local_80 * 0.5 - (fStack_74 / renderScale + *(float *)((int)room + 0x1208) + (pGVar3->_screenShakeOffset).y)) / (g_screenPointScale * 30.0); fVar8 = sqrtf(local_80 * local_80 + local_7c * local_7c); npc = portal; if ((1.5 < fVar8) && (0.0 < fVar8)) { local_7c = (1.5 / fVar8) * local_7c; local_80 = local_80 * (1.5 / fVar8); } sprite = &portal->_sprite; layer = ANM2::GetLayer(sprite,(byte *)0x2); (layer->_pos).x = local_7c; (layer->_pos).y = local_80; layer = ANM2::GetLayer(sprite,(byte *)0x3); (layer->_pos).x = local_7c + local_7c; (layer->_pos).y = local_80 + local_80; layer = ANM2::GetLayer(sprite,&DAT_00000004); (layer->_pos).x = local_7c * 3.0; (layer->_pos).y = local_80 * 3.0; } if (npc->_state == 3) { ANM2::Play(sprite,s_Idle,0); if (npc->_i2 < 1) { local_80 = 0.0; iVar11 = *(int *)((int)g_game->_room + 0x1264); if (iVar11 != 0) { entityIt = *(int **)((int)g_game->_room + 0x125c); do { iVar7 = *entityIt; if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar7 + 0x28) == 1)) || (*(int *)(iVar7 + 0x28) - 10U < 0x3de)) && (*(Entity_NPC **)(iVar7 + 0x3c8) == portal) ) { local_80 = (float)((int)local_80 + 1); } entityIt = entityIt + 1; iVar11 = iVar11 + -1; npc = portal; } while (iVar11 != 0); } if ((int)local_80 < (int)(4 - (uint)(npc->_variant != 1))) { npc->_state = 8; if (npc->_variant == 1) { uVar6 = Random(); npc->_i2 = uVar6 % 0x1e + 0x3c; bVar5 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"SpawnOverlay",1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0xa2,1.0,2,0,1.0); goto LAB_00544123; } uVar6 = Random(); iVar11 = uVar6 % 0x3c + 0x5a; } else { uVar6 = Random(); iVar11 = uVar6 % 0x1e + 0x3c; } npc->_i2 = iVar11; } goto LAB_00544123; } if (npc->_state != 8) goto LAB_00544123; if ((npc->_variant == 0) || (bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"), bVar5 != 0)) { local_80 = 0.0; local_7c = 0.0; if (npc->_variant == 1) { uVar6 = 6; if (npc->_subtype == 0) { uVar6 = 0xb; } uVar6 = RNG::RandomInt(&npc->_dropRNG,uVar6); local_80 = *(float *)(&DAT_00b614d8 + uVar6 * 8); local_7c = *(float *)(&DAT_00b614dc + uVar6 * 8); } else { isAltStage = g_game->_stageType != 0; iVar11 = g_game->_stage; if (iVar11 == 0xc) { iVar7 = Room::GetRoomConfigStage(g_game->_room); iVar11 = 1; if (2 < iVar7 - 1U) { if (iVar7 - 4U < 3) { iVar11 = 3; } else if (iVar7 - 7U < 3) { iVar11 = 5; } else if (iVar7 - 10U < 3) { iVar11 = 7; } else { if (iVar7 == 0xf) { isAltStage = 1; } else { if (iVar7 != 0xe) goto LAB_00543c18; isAltStage = 0; } iVar11 = 10; } } } LAB_00543c18: bVar5 = Game::IsGreedMode(g_game); if (bVar5 == 0) { switch(iVar11 + -1) { case 0: case 1: uVar6 = 0; if (g_game->_stageType == 4) { uVar6 = 6; } else if (g_game->_stageType == 5) { uVar6 = 7; } break; case 2: case 3: goto LAB_00543c3a; case 4: case 5: goto LAB_00543c41; case 6: case 7: goto LAB_00543c48; default: goto LAB_00543c96; case 9: uVar6 = (isAltStage ^ 1) + 4; if (7 < uVar6) goto LAB_00543d30; } } else { switch(iVar11 + -1) { case 0: uVar6 = 0; break; case 1: LAB_00543c3a: uVar6 = 1; break; case 2: LAB_00543c41: uVar6 = 2; break; case 3: LAB_00543c48: uVar6 = 3; break; case 4: uVar6 = 5; break; default: LAB_00543c96: uVar6 = 4; } } spawnRoll = RNG::RandomInt(&npc->_dropRNG,7); local_7c = 0.0; local_80 = *(float *)(&DAT_00b613e0 + (spawnRoll + uVar6 * 7) * 4); if (local_80 == 7.70714e-44) { if (uVar6 == 4) { local_7c = 2.8026e-45; } else if (uVar6 == 5) { local_7c = 1.4013e-45; } } else if (local_80 == 2.9147e-43) { local_7c = 1.4013e-45; } else if (local_80 == 3.64338e-43) { local_7c = 1.4013e-44; } else if (local_80 == 2.97075e-43) { bVar5 = Entity::HasEntityFlags((Entity *)npc,0x100); local_7c = (float)(uint)(bVar5 != 0); } } LAB_00543d30: uVar6 = RNG::Next(&npc->_dropRNG); spawnedEnemy = Game::SpawnEx(g_game,(uint)local_80,(uint)local_7c,&npc->_pos,&g_vectorZero, (Entity *)npc,0,uVar6,0); entityConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,(int)local_80,(int)local_7c,0); if ((entityConfig != (EntityConfig_Entity *)0x0) && (entityConfig->canBeChampion != 0)) { spawnedEnemy[3].field_0x3f = npc->_isChampion; *(int *)&spawnedEnemy[3].field_0x40 = npc->_championColorIdx; } (**(code **)(*(int *)spawnedEnemy + 100))(); healthSource = &spawnedEnemy->_maxHitPoints; if (spawnedEnemy->_health <= spawnedEnemy->_maxHitPoints && spawnedEnemy->_maxHitPoints != spawnedEnemy->_health) { healthSource = &spawnedEnemy->_health; } spawnedEnemy->_health = *healthSource; if ((npc->_flags & 0x100) != 0) { uVar12 = 0; iVar11 = -1; ref = EntityRef::EntityRef(&EStack_38); Entity::AddCharmed(spawnedEnemy,ref,iVar11,(byte)uVar12,(byte)((ulonglong)uVar12 >> 0x20)); } if (npc->_variant == 1) { *(uint *)&spawnedEnemy->_flags = (uint)spawnedEnemy->_flags & 0xfffffffb; puVar1 = (uint *)((int)&spawnedEnemy->_flags + 4); *puVar1 = *puVar1 | 0x400; uVar6 = Random(); fStack_6c = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; fStack_74 = cos(fStack_6c); fVar8 = sin(fStack_6c); EStack_38._flags = 0x3f21a1a2; EStack_38._entity = (void *)0x3ec4c4c5; uStack_10 = 0x3f6feff0; spawnRoll = 0x1e; (spawnedEnemy->_velocity).x = fStack_74 * 0.0 - fVar8 * 4.0; (spawnedEnemy->_velocity).y = fVar8 * 0.0 + fStack_74 * 4.0; } else { EStack_38._flags = 0; EStack_38._entity = (void *)0x0; uStack_10 = 0; spawnRoll = 0x32; } EStack_38._position.x = 0.0; EStack_38._position.y = 0.0; EStack_38._velocity.x = 0.0; EStack_38._velocity.y = 0.0; EStack_38._type = 0; EStack_38._variant = 0; EStack_38._spawnerType = 0; EStack_38._spawnerVariant = 0x3f800000; (**(code **)(*(int *)spawnedEnemy + 0x3c))(&EStack_38,spawnRoll,0x14,0x100000001); (**(code **)(*(int *)spawnedEnemy + 0xc))(); if (npc->_variant == 0) { Entity_NPC::PlaySound(npc,0x1c,1.0,2,0,1.0); npc->_i1 = npc->_i1 + -1; ShockwaveParams::ShockwaveParams(&EStack_38); EStack_38._type = (int)((npc->_pos).x + (npc->_posOffset).x); pGVar3 = g_game->_room; EStack_38._variant = (int)((npc->_pos).y + (npc->_posOffset).y); EStack_38._velocity.x = 1.4013e-44; EStack_38._position.x = 0.015; ppvVar2 = &pGVar3->_roomList[0x9d].Data; *ppvVar2 = (void *)((int)*ppvVar2 + 1); EStack_38._spawnerVariant = 0x3cf5c28f; uVar6 = (uint)pGVar3->_roomList[0x9d].Data & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } Game::SetShockwaveParams(pGVar3,uVar6,&EStack_38); goto LAB_00543fc2; } LAB_00543fc8: if (((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) goto LAB_00544123; } else { LAB_00543fc2: if (npc->_variant != 0) goto LAB_00543fc8; } npc->_state = 3; LAB_00544123: if (0 < npc->_i2) { npc->_i2 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i2; } if (npc->_i1 < 1) { (**(code **)(*(int *)npc + 0x28))(); } fVar8 = npc->_friction; (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; npc->_friction = fVar8 * 0.7; return; } //@@ 005441e0 NpcHelper::tarboy_is_creep_near /* DB: ? ECX is the Tar Boy, EDX a Vector*; true when a creep 1000.26 (1000.45 too for a friendly one, flag 0x20000000) lies within 26 (676 squared) of the point; NpcAI::ENTITY_TARBOY 005442a0 gates Attack2 on it at Isaac's lead */ uint NpcHelper::tarboy_is_creep_near(void) { uint uVar1; int iVar2; bool bVar3; Game *pGVar4; int in_ECX; uint uVar5; float *in_EDX; int *piVar6; float fVar7; float fVar8; if ((in_ECX == 0) || ((*(uint *)(in_ECX + 0x168) & 0x20000000) == 0)) { bVar3 = false; } else { bVar3 = true; } uVar5 = 0; uVar1 = *(uint *)((int)g_game->_room + 0x1264); pGVar4 = g_game; if (uVar1 != 0) { piVar6 = *(int **)((int)g_game->_room + 0x125c); do { pGVar4 = (Game *)*piVar6; if ((pGVar4->_roomList[0].OverrideData == (void *)0x3e8) && (((iVar2 = pGVar4->_roomList[0].AllowedDoors, iVar2 == 0x1a || ((bVar3 && (iVar2 == 0x2d))) ) && (fVar8 = *in_EDX - *(float *)&pGVar4->_roomList[4].TotalMoneySpent, fVar7 = in_EDX[1] - (float)pGVar4->_roomList[4].GreedSubType, fVar8 * fVar8 + fVar7 * fVar7 < 676.0)))) { return CONCAT31((int3)((uint)pGVar4 >> 8),1); } uVar5 = uVar5 + 1; piVar6 = piVar6 + 1; } while (uVar5 < uVar1); } return (uint)pGVar4 & 0xffffff00; } //@@ 005442a0 NpcAI::ENTITY_TARBOY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Exceeded maximum restarts with more pending */ /* NPC AI for entity type 307 (from dispatcher 006c2990) */ EntityPtr __fastcall NpcAI::ENTITY_TARBOY(Entity_NPC *npc) { Vector *position; code *pcVar1; undefined4 uVar2; longlong lVar3; longlong lVar4; undefined1 auVar5 [16]; EntityPtr *pEVar6; byte bVar7; char cVar8; EntityPtr EVar9; void *gridIdx; uint uVar10; Vector *pVVar11; Entity *spawned; void *gridIdx; EntityRef *sourceRef; int *piVar13; Entity_Player *player; int unusedArg; PlayerManager *playerManager; int iVar14; uint uVar15; uint uVar16; int iVar17; Game *pGVar18; bool bVar19; float fVar20; float fVar21; Room *pRVar22; ulonglong uVar23; int in_stack_fffffd38; undefined1 in_stack_fffffd40 [16]; undefined1 auVar24 [16]; undefined1 auVar25 [16]; undefined1 auVar26 [16]; undefined1 auVar27 [16]; undefined1 auVar28 [16]; undefined1 auVar29 [16]; undefined1 auVar30 [16]; undefined1 auVar31 [16]; undefined1 auVar32 [16]; undefined1 auVar33 [16]; undefined1 auVar34 [16]; undefined1 auVar35 [16]; undefined1 auVar36 [16]; undefined1 auVar37 [16]; undefined1 auVar38 [16]; undefined1 auVar39 [16]; undefined1 auVar40 [16]; undefined1 auVar41 [16]; undefined1 auVar42 [16]; undefined1 auVar43 [16]; undefined1 auVar44 [16]; undefined1 auVar45 [16]; undefined1 auVar46 [16]; undefined1 auVar47 [16]; undefined1 auVar48 [16]; undefined1 auVar49 [16]; undefined1 auVar50 [16]; undefined1 auVar51 [16]; undefined1 auVar52 [16]; undefined1 auVar53 [16]; undefined1 auVar54 [16]; undefined1 auVar55 [16]; undefined1 auVar56 [16]; undefined1 auVar59 [12]; undefined1 auVar57 [16]; undefined1 auVar58 [16]; undefined1 auStack_2a8 [4]; Room *local_2a4; uint local_2a0; Game *local_29c; Room *local_298; EntityPtr local_294; void *local_290; Room *local_28c; int *local_288; Room *local_284; char isCreepNear; Entity *local_27c; EntityPtr *local_278; EntityPtr *local_274; Room *local_270; void *local_26c; Vector leadPos; EntityPtr local_260; int iStack_25c; float local_258; float local_254; void **local_250; Vector *local_24c; int local_248; undefined4 uStack_244; Vector childPos; Vector local_238 [2]; undefined8 local_228; undefined4 local_21c; undefined4 local_218; undefined4 local_214; undefined4 local_210; float local_20c; float local_208; float local_204; float local_200; undefined4 local_1fc; undefined4 local_1f8; int local_1e8; undefined4 local_1e4 [8]; int prevState; int iStack_1c0; int local_1bc; Vector aimPos; Vector controllerInput; Vector targetPos; Vector randomPos; Vector moveInput; EntityRef charmSource; EntityRef brimstoneMarkSource; EntityRef shrinkSource; EntityRef damageSource; EntityRef charmerRef; RNG cardRng; ProjectileParams projParams; uint local_c; int gridWidth; std_set *spawnTriggerTargets; local_c = __security_cookie ^ (uint)auStack_2a8; auVar24._0_12_ = in_stack_fffffd40._0_12_; local_260 = (EntityPtr)npc; if (npc->_subtype == 1) { EVar9 = npc->_parent; npc->_entityCollisionClass = 0; if ((EVar9 == (EntityPtr)0x0) || (*(char *)((int)EVar9 + 0x172) == '\0')) { local_21c = 0; local_218 = 0; local_214 = 0; local_210 = 0; local_20c = g_vectorZero.x; local_208 = g_vectorZero.y; local_204 = g_vectorZero.x; local_200 = g_vectorZero.y; local_1fc = 0; local_1f8 = 0; EVar9 = (EntityPtr)(**(code **)(*(int *)npc + 0x24))(); return EVar9; } return EVar9; } position = &npc->_pos; gridIdx = g_game->_room; local_290 = (void *)(int)((position->x - 40.0) / 40.0 + 0.5); iVar14 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if ((((((-1 < (int)local_290) && ((int)local_290 < *(int *)((int)gridIdx + 0xc))) && (-1 < iVar14) ) && ((iVar14 < *(int *)((int)gridIdx + 0x10) && (gridIdx = (void *)(*(int *)((int)gridIdx + 0xc) * iVar14 + (int)local_290), -1 < (int)gridIdx)))) && ((int)gridIdx < 0x1c0)) && (*(int *)((int)gridIdx + (int)gridIdx * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)gridIdx + (int)gridIdx * 4 + 0x76c) = 900; } auVar24._12_4_ = 0x54441d; local_2a4 = (Room *)Entity_NPC::GetPlayerTarget(npc); auVar25._0_8_ = auVar24._0_8_; auVar25._8_4_ = 0x544440; auVar25._12_4_ = 1; Entity_NPC::UpdateChargeBar(npc,90.0,0.0,(float)npc->_i2,1); auVar59 = auVar25._0_12_; prevState = npc->_state; npc->_friction = npc->_friction * 0.8; auVar39._0_8_ = auVar25._0_8_; if (prevState == 0) { if (&npc->_splatColor != (ColorMod *)local_1e4) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; } npc->_state = 3; iStack_1c0 = prevState; local_1bc = prevState; ANM2::Play(&npc->_sprite,s_Idle,0); (npc->_targetPosition).x = position->x; EVar9 = (EntityPtr)(npc->_pos).y; (npc->_targetPosition).y = (float)EVar9; if (npc->_controllerID == -1) { uVar10 = Random(); npc->_i1 = uVar10 % 0x28 + 0x14; return (EntityPtr)(uVar10 / 0x28); } npc->_i1 = 2; return EVar9; } if (prevState == 3) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { auVar26._8_4_ = s_Idle; auVar26._0_8_ = 0x54455900000000; auVar26._12_4_ = 0; ANM2::Play(&npc->_sprite,s_Idle,0); auVar39._0_8_ = auVar26._0_8_; } auVar27._8_4_ = 0x54456a; auVar27._0_8_ = auVar39._0_8_; auVar27._12_4_ = 0; Entity_NPC::SpawnControlTarget(npc,0,-1.0); auVar30._0_12_ = auVar27._0_12_; if (npc->_i1 != 0) goto LAB_00545594; if (npc->_controllerID == -1) { auVar30._12_4_ = 0x544667; uVar10 = Random(); auVar59 = auVar30._0_12_; if ((uVar10 & 7) != 0) { LAB_005445a6: if (npc->_controllerID != -1) { pVVar11 = Entity_NPC::GetControllerInput(npc,&controllerInput,0.1); bVar7 = Vector::operator_ne(pVVar11,&g_vectorZero); if (bVar7 == 0) goto LAB_00545594; } local_288 = (int *)g_vectorZero.x; local_294 = (EntityPtr)g_vectorZero.y; fVar20 = (float)local_2a4->_gridEntities[199] - (npc->_pos).y; fVar21 = ((Vector *)(local_2a4->_gridEntities + 0xc6))->x - position->x; fVar20 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21); if (fVar20 <= 120.0) { uVar10 = Random(); if ((uVar10 & 0xf) == 0) { pVVar11 = Room::GetRandomPosition(g_game->_room,&randomPos,20.0); goto LAB_00544648; } } else { pVVar11 = Entity_NPC::CalcTargetPosition(npc,&targetPos,0.0); LAB_00544648: local_288 = (int *)pVVar11->x; local_294 = (EntityPtr)pVVar11->y; } if (npc->_controllerID == -1) { if (((float)local_288 != g_vectorZero.x) || ((float)local_294 != g_vectorZero.y)) { local_29c = (Game *)g_vectorZero.x; local_2a4 = (Room *)g_vectorZero.y; local_28c = g_game->_room; local_290 = (void *)0x501502f9; local_2a0 = (local_28c->_entityList)._updateEL._size; pGVar18 = (Game *)g_vectorZero.x; pRVar22 = (Room *)g_vectorZero.y; if (local_2a0 != 0) { local_298 = (local_28c->_entityList)._updateEL._data; do { iVar14 = *(int *)local_298; if ((iVar14 != 0) && (*(int *)(iVar14 + 0x28) == 1000)) { if (*(int *)(iVar14 + 0x2c) == 0x1a) { LAB_00544a90: local_250 = *(void ***)(iVar14 + 0x33c); local_27c = *(Entity **)(iVar14 + 0x340); iVar14 = (int)(((float)local_250 - 40.0) / 40.0 + 0.5); iVar17 = (int)(((float)local_27c - 120.0) / 40.0 + 0.5); if ((((iVar14 < 0) || (gridWidth = local_28c->_gridWidth, gridWidth <= iVar14)) || (iVar17 < 0)) || ((local_28c->_gridHeight <= iVar17 || (iVar14 = iVar17 * gridWidth + iVar14, iVar14 < 0)))) { pGVar18 = local_29c; pRVar22 = local_2a4; } else { local_274 = (EntityPtr *)((float)(iVar14 % gridWidth) * 40.0 + 40.0); local_284 = (Room *)((float)(iVar14 / gridWidth) * 40.0 + 120.0); uVar10 = Room::GetGridCollision(local_28c,iVar14); pGVar18 = local_29c; pRVar22 = local_2a4; if ((((uVar10 == 0) && (((float)local_27c - (float)local_284) * ((float)local_27c - (float)local_284) + ((float)local_250 - (float)local_274) * ((float)local_250 - (float)local_274) < 100.0)) && ((0x14 < *(int *)(*(int *)local_298 + 0x45c) && (((0x1bf < iVar14 || (local_28c->_gridPaths[iVar14] < 400)) && (fVar21 = (npc->_pos).x - (float)local_274, fVar20 = (npc->_pos).y - (float)local_284, 120.0 < fVar20 * fVar20 + fVar21 * fVar21)))))) && (gridIdx = (void *)(((float)local_288 - (float)local_274) * ((float)local_288 - (float)local_274) + ((float)local_294 - (float)local_284) * ((float)local_294 - (float)local_284)), (float)gridIdx < (float)local_290)) { local_29c = (Game *)local_274; local_2a4 = local_284; pGVar18 = (Game *)local_274; local_290 = gridIdx; pRVar22 = local_284; } } } else if ((npc->_flags & 0x20000000) != 0) { if (*(int *)(iVar14 + 0x2c) == 0x2d) goto LAB_00544a90; } } local_298 = (Room *)((int)local_298 + 4); local_2a0 = local_2a0 - 1; } while (local_2a0 != 0); local_2a0 = 0; } if (((float)pGVar18 != g_vectorZero.x) || ((float)pRVar22 != g_vectorZero.y)) { ANM2::Play(&npc->_sprite,(byte *)"Teleport",0); npc->_state = 4; (npc->_v1).x = (float)local_29c; (npc->_v1).y = (float)local_2a4; } } } else { ANM2::Play(&npc->_sprite,(byte *)"Teleport",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,6.0); } npc->_state = 4; (npc->_v1).x = position->x; (npc->_v1).y = (npc->_pos).y; } goto LAB_00545594; } } else { auVar28._0_8_ = auVar27._0_8_; auVar28._8_4_ = 0x54458d; auVar28._12_4_ = 9; bVar7 = Entity_NPC::IsControllerActionPressed(npc,9); auVar59 = auVar28._0_12_; if (bVar7 == 0) { auVar29._0_8_ = auVar28._0_8_; auVar29._8_4_ = 0x54459e; auVar29._12_4_ = 8; bVar7 = Entity_NPC::IsControllerActionPressed(npc,8); auVar59 = auVar29._0_12_; if (bVar7 == 0) goto LAB_005445a6; } } local_27c = (Entity *)((Vector *)(local_2a4->_gridEntities + 0xc6))->x; local_290 = local_2a4->_gridEntities[199]; fVar20 = position->x - (float)local_27c; fVar21 = (npc->_pos).y - (float)local_290; local_28c = (Room *)(fVar21 * fVar21 + fVar20 * fVar20); auVar31._12_4_ = 0x5446ba; auVar31._0_12_ = auVar59; fVar20 = sqrtf((float)local_28c); leadPos.x = ((Vector *)(local_2a4->_gridEntities + 0xcf))->x * 0.1 * fVar20 + (float)local_27c; leadPos.y = (float)local_2a4->_gridEntities[0xd0] * 0.1 * fVar20 + (float)local_290; auVar32._0_12_ = auVar31._0_12_; auVar32._12_4_ = 0x544709; fVar20 = sqrtf((float)local_28c); auVar36._0_12_ = auVar32._0_12_; if (npc->_controllerID == -1) { auVar36._12_4_ = 0x544761; isCreepNear = NpcHelper::tarboy_is_creep_near(); auVar37._0_12_ = auVar36._0_12_; if ((60.0 < fVar20) && (fVar20 < 280.0)) { auVar37._12_4_ = 0x544788; uVar10 = Random(); auVar39._0_8_ = auVar37._0_8_; uVar10 = uVar10 % 5; goto LAB_00544793; } } else { auVar33._0_8_ = auVar32._0_8_; auVar33._8_4_ = 0x544724; auVar33._12_4_ = &aimPos; pVVar11 = Entity_NPC::GetAimTargetPosition(npc,&aimPos); leadPos.x = pVVar11->x; leadPos.y = pVVar11->y; auVar34._0_12_ = auVar33._0_12_; auVar34._12_4_ = 0x544744; isCreepNear = NpcHelper::tarboy_is_creep_near(); auVar35._0_8_ = auVar34._0_8_; auVar35._8_4_ = 0x544751; auVar35._12_4_ = 8; bVar7 = Entity_NPC::IsControllerActionPressed(npc,8); auVar39._0_8_ = auVar35._0_8_; uVar10 = (uint)bVar7; LAB_00544793: if (((uVar10 != 0) && (auVar38._8_4_ = leadPos.x, auVar38._0_8_ = auVar39._0_8_, auVar38._12_4_ = leadPos.y, iVar14 = Room::GetGridCollisionAtPos(g_game->_room,auVar38._8_8_), iVar14 == 0)) && (isCreepNear != '\0')) { ANM2::Play(&npc->_sprite,s_Attack2,0); fVar20 = position->x; npc->_state = 9; (npc->_sprite)._flipX = leadPos.x < fVar20; EVar9 = npc->_child; if ((EVar9 != (EntityPtr)0x0) && (*(char *)((int)EVar9 + 0x172) != '\0')) { (**(code **)(*(int *)EVar9 + 0x28))(); } uVar10 = RNG::Next(&npc->_dropRNG); spawned = Game::SpawnEx(g_game,npc->_type,npc->_variant,&leadPos,&g_vectorZero,(Entity *)npc ,1,uVar10,0); local_294 = (EntityPtr)__RTDynamicCast(spawned); *(void **)((int)local_294 + 0x16c) = (void *)((uint)*(void **)((int)local_294 + 0x16c) | 0x2008); *(void **)((int)local_294 + 0x168) = (void *)((uint)*(void **)((int)local_294 + 0x168) & 0xfffffffb | 1); local_27c = (Entity *)((int)local_294 + 0x3bc); if (*(void **)((int)local_294 + 0x3bc) != (void *)0x0) { local_250 = (void **)local_27c; std::multiset::erase(); } *(Entity_NPC **)local_27c = npc; std::multiset::insert(); *(void **)((int)local_294 + 0x188) = (void *)0x0; Color::assign(); if (npc->_child != (EntityPtr)0x0) { local_274 = &npc->_child; std::multiset::erase(); } npc->_child = local_294; std::multiset::insert(); *(int *)((int)local_294 + 0xb64) = 3; ANM2::SetFrame((ANM2 *)((int)local_294 + 0x48),(std_string *)"Mouth",0); goto LAB_00545594; } } if ((npc->_controllerID == -1) || (bVar7 = Entity_NPC::IsControllerActionPressed(npc,9), bVar7 != 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); fVar20 = position->x; npc->_state = 8; (npc->_sprite)._flipX = leadPos.x < fVar20; } LAB_00545594: fVar20 = (npc->_targetPosition).y; fVar21 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar20 - fVar21; } else { if (prevState != 4) { if (prevState == 6) { bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; if (npc->_controllerID == -1) { uVar10 = Random(); iVar14 = uVar10 % 0x28 + 0x14; } else { iVar14 = 2; } LAB_0054558e: npc->_i1 = iVar14; } } else if (prevState == 8) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { local_284 = local_2a4->_gridEntities[199]; fVar21 = position->x - ((Vector *)(local_2a4->_gridEntities + 0xc6))->x; fVar20 = (npc->_pos).y - (float)local_284; fVar20 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21); local_258 = ((Vector *)(local_2a4->_gridEntities + 0xcf))->x * 0.1 * fVar20 + ((Vector *)(local_2a4->_gridEntities + 0xc6))->x; local_254 = (float)local_2a4->_gridEntities[0xd0] * 0.1 * fVar20 + (float)local_284; if (npc->_controllerID != -1) { pVVar11 = Entity_NPC::GetAimTargetPosition(npc,local_238); local_258 = pVVar11->x; local_254 = pVVar11->y; } (npc->_sprite)._flipX = local_258 < position->x; ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = 8; projParams.BulletFlags._4_4_ = 0; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34e54); projParams.Scale = 0.7; Entity_NPC::FireBossProjectiles(npc,6,&local_258,10.0,&projParams); Entity_NPC::PlaySound(npc,0xe2,1.0,0xf,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_00545563: npc->_state = 3; if (npc->_controllerID == -1) { uVar10 = Random(); iVar14 = uVar10 % 0x28 + 0xf; } else { iVar14 = 2; } goto LAB_0054558e; } } else if (prevState == 9) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); if (npc->_child != (EntityPtr)0x0) { iVar14 = ANM2::GetFrame(&npc->_sprite); if (*(int *)((int)npc->_child + 0x7c) != 0) { AnimationState::SetFrameFloat((AnimationState *)((int)npc->_child + 0x78),(float)iVar14) ; } } bVar7 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar7 != 0) { in_stack_fffffd38 = 0x545490; Entity_NPC::PlaySound(npc,0x107,1.0,2,0,1.0); } bVar7 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((((bVar7 != 0) && (bVar7 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"ShootEnd"), bVar7 == 0)) && (npc->_child != (EntityPtr)0x0)) && ((*(char *)((int)npc->_child + 0x172) != '\0' && (iVar14 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar14 != 0)))) { childPos.x = *(float *)((int)npc->_child + 0x33c); childPos.y = *(float *)((int)npc->_child + 0x340); Game::DamageRadius(&childPos,(Entity *)npc,0,0,in_stack_fffffd38,50.0,g_tearFlagsNone,8.0, 12.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (npc->_child != (EntityPtr)0x0) { (**(code **)(*(int *)npc->_child + 0x28))(); } goto LAB_00545563; } } goto LAB_00545594; } if ((npc->_sprite)._animState._animData != (void *)0x0) { auVar39._8_4_ = 0x544d31; auVar39._12_4_ = "Shoot"; bVar7 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); auVar59 = auVar39._0_12_; if (bVar7 != 0) { auVar40._0_8_ = auVar39._0_8_; auVar40._8_4_ = 0; auVar40._12_4_ = 0x3f800000; auVar41._8_8_ = auVar40._8_8_; auVar41._0_8_ = 0x200000000; auVar42._4_12_ = auVar41._4_12_; auVar42._0_4_ = 0x3f800000; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); auVar59 = auVar42._0_12_; } } uVar23 = auVar59._0_8_; if (npc->_controllerID == -1) { local_284 = g_game->_room; iVar14 = Room::GetGridIndex(local_284,&npc->_v1); if (-1 < iVar14) { Room::SetGridPath(local_284,iVar14,900); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { fVar20 = (npc->_v1).x; position->x = fVar20; fVar21 = (npc->_v1).y; (npc->_pos).y = fVar21; (npc->_targetPosition).x = fVar20; (npc->_targetPosition).y = fVar21; ANM2::Play(&npc->_sprite,(byte *)"TeleportEnd",0); fVar20 = position->x; npc->_state = 6; (npc->_sprite)._flipX = ((Vector *)(local_2a4->_gridEntities + 0xc6))->x <= fVar20 && fVar20 != ((Vector *)(local_2a4->_gridEntities + 0xc6))->x; } goto LAB_00545594; } if (npc->_entityCollisionClass != 0) goto LAB_00545594; npc->_i2 = npc->_i2 + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (0x78 < npc->_i2) { npc->_i2 = 0x5a; auVar43._12_4_ = 0x544dbb; auVar43._0_12_ = auVar59; sourceRef = EntityRef::EntityRef(&damageSource); auVar44._0_8_ = auVar43._0_8_; auVar44._8_4_ = sourceRef; auVar44._12_4_ = 0x1e; auVar5._8_8_ = 0; auVar5._0_8_ = auVar44._8_8_; auVar45._12_4_ = 0; auVar45._0_12_ = SUB1612(auVar5 << 0x40,4); auVar45 = auVar45 << 0x20; (**(code **)(*(int *)npc + 0x20))(0x41200000,0); auVar46._0_8_ = auVar45._0_8_; auVar46._8_4_ = &g_vectorZero; auVar46._12_4_ = 0x3f800000; auVar47._8_8_ = auVar46._8_8_; auVar47._4_4_ = &npc->_splatColor; local_284 = (Room *)0x1; auVar47._0_4_ = npc; spawn_gibs(position,1,20.0,(uint *)&local_284,(Entity *)npc,&npc->_splatColor,&g_vectorZero, 1.0); auVar48._0_8_ = auVar47._0_8_; auVar48._8_4_ = 0; auVar48._12_4_ = 0x40000000; auVar49._8_8_ = auVar48._8_8_; auVar49._0_8_ = 0x200000000; auVar50._4_12_ = auVar49._4_12_; auVar50._0_4_ = 0x3f000000; Entity_NPC::PlaySound(npc,0x4d,0.5,2,0,2.0); uVar23 = auVar50._0_8_; } auVar51._8_4_ = 0; auVar51._0_8_ = uVar23; auVar51._12_4_ = 1; auVar52._8_8_ = auVar51._8_8_; auVar52._0_8_ = 0x4000000000000000; auVar53._12_4_ = 0; auVar53._0_12_ = auVar52._4_12_; auVar53 = auVar53 << 0x20; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,2.0,0,1); fVar20 = (npc->_velocity).x; if (fVar20 != 0.0) { (npc->_sprite)._flipX = 0.0 < fVar20; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { auVar54._0_8_ = auVar53._0_8_; auVar54._8_4_ = 0x544e8c; auVar54._12_4_ = &moveInput; pVVar11 = Entity_NPC::GetControllerInput(npc,&moveInput,0.1); auVar55._0_8_ = auVar54._0_8_; auVar55._8_4_ = 0x544e98; auVar55._12_4_ = &g_vectorZero; bVar7 = Vector::operator_eq(pVVar11,&g_vectorZero); if (((bVar7 != 0) && (fVar20 = (npc->_velocity).y, fVar21 = (npc->_velocity).x, fVar21 * fVar21 + fVar20 * fVar20 < 1.0)) || (0x59 < npc->_i2)) { local_258 = position->x; local_254 = (npc->_pos).y; local_294 = (EntityPtr)g_game->_room; auVar56._0_8_ = auVar55._0_8_; auVar56._8_4_ = local_258; auVar56._12_4_ = local_254; iVar14 = Room::GetGridCollisionAtPos((Room *)local_294,auVar56._8_8_); if (iVar14 == 0) { cVar8 = NpcHelper::tarboy_is_creep_near(); if (cVar8 == '\0') { local_2a4 = *(Room **)((int)local_294 + 0x1264); local_298 = (Room *)g_vectorZero.x; local_29c = (Game *)g_vectorZero.y; local_290 = (void *)0x44c80000; pRVar22 = (Room *)g_vectorZero.x; pGVar18 = (Game *)g_vectorZero.y; if (local_2a4 != (Room *)0x0) { local_28c = *(void **)((int)local_294 + 0x125c); do { iVar14 = *(int *)local_28c; if (iVar14 != 0) { if (*(int *)(iVar14 + 0x28) == 1000) { if (*(int *)(iVar14 + 0x2c) == 0x1a) { LAB_00544fac: iVar17 = (int)((*(float *)(iVar14 + 0x33c) - 40.0) / 40.0 + 0.5); iVar14 = (int)((*(float *)(iVar14 + 0x340) - 120.0) / 40.0 + 0.5); if ((((-1 < iVar17) && (local_284 = *(Room **)((int)local_294 + 0xc), iVar17 < (int)local_284)) && (-1 < iVar14)) && ((iVar14 < *(int *)((int)local_294 + 0x10) && (iVar17 = (int)local_284 * iVar14 + iVar17, -1 < iVar17)))) { iVar14 = iVar17 / (int)local_284; local_284 = (Room *)((float)(iVar17 % (int)local_284) * 40.0 + 40.0); local_274 = (EntityPtr *)((float)iVar14 * 40.0 + 120.0); uVar10 = Room::GetGridCollision((Room *)local_294,iVar17); if (uVar10 == 0) { fVar20 = (npc->_pos).x - (float)local_284; fVar21 = (npc->_pos).y - (float)local_274; gridIdx = (void *)(fVar21 * fVar21 + fVar20 * fVar20); if ((float)local_290 <= (float)gridIdx) { pRVar22 = local_298; pGVar18 = local_29c; } else { local_298 = local_284; local_29c = (Game *)local_274; pRVar22 = local_284; local_290 = gridIdx; pGVar18 = (Game *)local_274; } goto LAB_005450da; } } pRVar22 = local_298; pGVar18 = local_29c; } else if ((npc->_flags & 0x20000000) != 0) { if (*(int *)(iVar14 + 0x2c) == 0x2d) goto LAB_00544fac; } } } LAB_005450da: local_28c = (Room *)&local_28c->_descriptor; local_2a4 = (Room *)&local_2a4[-1].field_0x7897; } while (local_2a4 != (Room *)0x0); local_2a4 = (Room *)0x0; } if (((float)pRVar22 == g_vectorZero.x) && ((float)pGVar18 == g_vectorZero.y)) goto LAB_005455bd; (npc->_pos).x = (float)pRVar22; (npc->_pos).y = (float)pGVar18; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; ANM2::Play(&npc->_sprite,(byte *)"TeleportEnd",0); npc->_state = 6; npc->_i2 = 0; } } } } LAB_005455bd: if (0 < npc->_i1) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1; } iVar14 = npc->_state; if (iVar14 != 0) { if ((npc->_flags & 0x4000) != 0) { return (EntityPtr)0x0; } EVar9._0_1_ = Game::IsPaused(g_game); EVar9._1_3_ = 0; if (EVar9._0_1_ != 0) { return EVar9; } EVar9 = (EntityPtr)(g_game->_frameCount + npc->_index & 0x80000007); if ((int)EVar9 < 0) { EVar9 = (EntityPtr)(((int)EVar9 - 1U | 0xfffffff8) + 1); } if (EVar9 != (EntityPtr)0x0) { return EVar9; } if ((npc->_controllerID == -1) && (iVar14 == 4)) { return (EntityPtr)0x0; } } local_294 = (EntityPtr)Random(); pGVar18 = g_game; local_24c = &npc->_targetPosition; local_29c = g_game; local_2a4 = (Room *)0x0; local_2a0 = 0x1a; local_28c = (Room *)0x3e8; lua_callback_run_pre_entity_spawn ((int *)&local_28c,(int *)&local_2a0,local_24c,&g_vectorZero,(Entity *)npc, (int *)&local_2a4,(uint *)&local_294); local_298 = local_28c; if (1 < *(int *)&g_game->_deathmatchManager) { local_288 = (g_game->_deathmatchManager)._type; gridIdx = (void *)Random(); piVar13 = local_288; local_228 = 0x900000005; local_28c = (Room *)0x7; local_290 = gridIdx; if (local_298 == (Room *)0x5) { if (local_2a0 < 0x12d) { if (local_2a0 == 300) { while ((local_2a4 == (Room *)0x0 || (cVar8 = (**(code **)(*local_288 + 0x24))(), cVar8 != '\0'))) { if (gridIdx == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); EVar9 = (EntityPtr)(*pcVar1)(); return EVar9; } uVar10 = (uint)gridIdx >> ((byte)local_228 & 0x1f) ^ (uint)gridIdx; uVar10 = uVar10 << ((byte)((ulonglong)local_228 >> 0x20) & 0x1f) ^ uVar10; gridIdx = (void *)(uVar10 >> ((byte)local_28c & 0x1f) ^ uVar10); iVar14 = ItemPool::GetCardEx((int)gridIdx,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)gridIdx; local_2a4 = (Room *)lua_callback_run_get_card(&cardRng,iVar14,1,1,0); } goto LAB_00545776; } if (local_2a0 == 0x46) { local_284 = (Room *)((uint)local_2a4 >> 0xb); do { if (local_2a4 != (Room *)0x0) { pcVar1 = *(code **)(*local_288 + 0x28); ItemPool::GetPillEffect(&g_game->_itemPool,(uint)local_2a4,(Entity_Player *)0x0); cVar8 = (*pcVar1)(); if (cVar8 == '\0') goto LAB_00545776; gridIdx = local_290; } local_270 = (Room *)&g_game->_itemPool; if (gridIdx == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); EVar9 = (EntityPtr)(*pcVar1)(); return EVar9; } uVar10 = (uint)gridIdx >> ((byte)local_228 & 0x1f) ^ (uint)gridIdx; uVar10 = uVar10 << ((byte)((ulonglong)local_228 >> 0x20) & 0x1f) ^ uVar10; gridIdx = (void *)(uVar10 >> ((byte)local_28c & 0x1f) ^ uVar10); local_290 = gridIdx; uVar10 = ItemPool::GetPill((uint)gridIdx); local_2a4 = (Room *)(uVar10 | ((uint)local_284 & 1) << 0xb); } while( true ); } if (local_2a0 != 100) goto LAB_0054577e; if (local_2a4 == (Room *)0x19) { LAB_0054575a: bVar19 = false; } else { local_270 = local_2a4; std::set::find_node(); if (((*(char *)(local_1e8 + 0xd) == '\0') && (*(int *)(local_1e8 + 0x10) <= (int)local_2a4)) && (local_1e8 != piVar13[8])) goto LAB_0054575a; bVar19 = true; } if ((local_2a4 == (Room *)0x0) || (bVar19)) { local_2a4 = (Room *)(**(code **)(*piVar13 + 0x84))(); } } else { if (local_2a0 != 0x15e) goto LAB_0054577e; while ((local_2a4 == (Room *)0x0 || (cVar8 = (**(code **)(*piVar13 + 0x2c))(), cVar8 != '\0'))) { local_2a4 = (Room *)ItemPool::GetTrinket(&g_game->_itemPool,0); } npc = (Entity_NPC *)local_260; } LAB_00545776: } LAB_0054577e: pGVar18 = local_29c; } if (((*(uint *)((int)npc + 0x168) & 0x20000000) != 0) && (local_298 == (Room *)0x3e8)) { switch(local_2a0) { case 0x545994: /* WARNING: This code block may not be properly labeled as switch case */ local_2a0 = 0x2d; } } local_27c = EntityFactory::Create(pGVar18->_entityFactory,(uint)local_298,0); lVar3 = CONCAT44(local_270,local_26c); if (local_27c == (Entity *)0x0) goto LAB_00545ede; uVar23 = GetTimeNs(); EVar9 = local_260; spawned = local_27c; uVar16 = (uint)(uVar23 >> 0x20); lVar3 = (uVar23 & 0xffffffff) * 0x431bde82; lVar4 = (ulonglong)uVar16 * 0xd7b634db; local_26c = (void *)((ulonglong)lVar4 >> 0x20); uVar23 = lVar4 + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar15 = (uint)(uVar23 >> 0x20); lVar4 = lVar3 + (uVar23 & 0xffffffff); local_248 = (int)lVar4; uVar10 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = (ulonglong)uVar16 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar15,uVar10),uVar15 + uVar10); uVar10 = (uint)((ulonglong)lVar4 >> 0x20); local_288 = (int *)((uint)lVar4 >> 0x12 | uVar10 * 0x4000); local_290 = (void *)(uVar10 >> 0x12); local_27c->_spawnerType = *(int *)((int)local_260 + 0x28); local_27c->_spawnerVariant = *(int *)((int)local_260 + 0x2c); local_278 = &local_27c->_spawnerEntity; pEVar6 = (EntityPtr *)((ulonglong)lVar3 >> 0x20); if (*local_278 != (EntityPtr)0x0) { std::multiset::erase(); pEVar6 = local_278; } local_278 = pEVar6; spawned->_spawnerEntity = EVar9; std::multiset::insert(); (spawned->_pos).x = ((Vector *)((int)EVar9 + 0x334))->x; (spawned->_pos).y = *(float *)((int)EVar9 + 0x338); iVar14 = *(int *)spawned; (spawned->_velocity).x = g_vectorZero.x; (spawned->_velocity).y = g_vectorZero.y; (**(code **)(iVar14 + 4))(); gridIdx = local_29c->_room; iVar14 = *(int *)((int)gridIdx + 0x1214); *(int *)((int)gridIdx + 0x1214) = iVar14 + 1; spawned->_index = iVar14; EntityList::AddEntity((EntityList *)((int)gridIdx + 0x1218),spawned); bVar7 = Entity::IsActiveEnemy((Entity *)EVar9,1); if (bVar7 != 0) { if ((*(uint *)((int)EVar9 + 0x16c) & 0x10000000) == 0) { bVar7 = Entity::HasEntityFlags((Entity *)EVar9,0x20000000); if (bVar7 != 0) { auVar59 = SUB1612(ZEXT816(0xffffffff00000000),4); sourceRef = EntityRef::EntityRef(&charmerRef); Entity::AddCharmed(spawned,sourceRef,auVar59._0_4_,auVar59[4],auVar59[8]); } } else { uVar10 = *(uint *)((int)&spawned->_flags + 4); uVar2 = (undefined4)spawned->_flags; *(undefined4 *)&spawned->_flags = uVar2; *(uint *)((int)&spawned->_flags + 4) = uVar10 | 0x10000000; if ((local_298 != (Room *)0x9) && (local_298 != (Room *)0x7)) { *(undefined4 *)&spawned->_flags = uVar2; *(uint *)((int)&spawned->_flags + 4) = uVar10 | 0x10000020; } EntityRef::constructor(&charmSource,*(void **)((int)EVar9 + 0x264)); Entity::AddCharmed(spawned,&charmSource,-1,0,0); if ((undefined1 *)((int)&local_298[-1]._beastBlastForce + 2U) < (undefined1 *)0x3de) { ANM2::LoadDeliriumForm(&spawned->_sprite,(int)local_298,local_2a0,1); } } local_28c = (Room *)__RTDynamicCast(EVar9,0); local_294 = (EntityPtr)__RTDynamicCast(spawned); if ((local_28c != (Room *)0x0) && (local_294 != (EntityPtr)0x0)) { auVar57._8_4_ = 1; auVar57._0_8_ = 0x545c0800000000; auVar57._12_4_ = 0; bVar7 = Entity::HasEntityFlags((Entity *)local_294,1); if (bVar7 == 0) { auVar58._0_8_ = auVar57._0_8_; auVar58._8_4_ = 0; auVar58._12_4_ = 0x1000000; bVar7 = Entity::HasEntityFlags((Entity *)EVar9,auVar58._8_8_); if (bVar7 != 0) { EntityRef::constructor(&brimstoneMarkSource,(Entity *)0x0); Entity::AddBrimstoneMark((Entity *)local_294,&brimstoneMarkSource,0x5a); } bVar7 = Entity::HasEntityFlags((Entity *)EVar9,0x1000000); if (bVar7 == 0) goto LAB_00545ca9; EntityRef::constructor(&shrinkSource,(Entity *)0x0); EVar9 = local_294; Entity::AddShrink((Entity *)local_294,&shrinkSource,0x5a,0,0); if (0 < *(int *)((int)EVar9 + 0x23c)) { *(uint *)((int)EVar9 + 0x168) = *(uint *)((int)EVar9 + 0x168) | 0x1000000; *(undefined4 *)((int)EVar9 + 0x16c) = *(undefined4 *)((int)EVar9 + 0x16c); *(float *)((int)EVar9 + 0x3b4) = *(float *)((int)EVar9 + 0x3b8); } } else { LAB_00545ca9: EVar9 = local_294; } fVar21 = ((Entity *)((int)EVar9 + 0xc24))->_pendingDamage * *(float *)&local_28c->field_0xf48; ((Entity *)((int)EVar9 + 0xc24))->_pendingDamage = fVar21; fVar21 = fVar21 * *(float *)((int)EVar9 + 0x3b4); fVar20 = fVar21 * g_vectorOne.x; *(float *)((int)EVar9 + 0xe8) = fVar21 * g_vectorOne.y; ((Vector *)((int)EVar9 + 0xe4))->x = fVar20; ((Entity *)((int)EVar9 + 0xc24))->_burnTickDamage = ((Entity *)((int)EVar9 + 0xc24))->_burnTickDamage * *(float *)&local_28c->field_0xf48; ((Entity *)((int)EVar9 + 0xc24))->_poisonTickDamage = ((Entity *)((int)EVar9 + 0xc24))->_poisonTickDamage * *(float *)&local_28c->field_0xf44; *(float *)((int)EVar9 + 900) = *(float *)((int)EVar9 + 900) * *(float *)&local_28c->field_0xf44; *(float *)((int)EVar9 + 0x380) = *(float *)((int)EVar9 + 0x380) * *(float *)&local_28c->field_0xf44; cVar8 = (**(code **)(*(int *)EVar9 + 0x4c))(); if (cVar8 != '\0') { Entity_NPC::set_entity_ptr_f54(); } } } bVar7 = Game::ShouldEraseEnemy(spawned); if (bVar7 != 0) { Entity::RemoveWithPoof(spawned,unusedArg); } if ((spawned->_exists != 0) && ((local_29c->_proceduralItemManager)._proceduralItems._begin != (local_29c->_proceduralItemManager)._proceduralItems._end)) { iStack_25c = spawned->_variant; spawnTriggerTargets = &(local_29c->_proceduralItemManager)._spawnTriggerTargets; local_260 = (EntityPtr)spawned->_type; std::map::find(); if (local_26c == spawnTriggerTargets->_head) { local_248 = spawned->_type; uStack_244 = 0xffffffff; piVar13 = (int *)std::map::find(); if ((void *)*piVar13 == spawnTriggerTargets->_head) goto LAB_00545e4c; } uVar10 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { player = PlayerManager::GetPlayer(playerManager,uVar10); trigger_set_dispatch(&player->_proceduralItems,6,spawned,local_24c,&g_vectorZero); uVar10 = uVar10 + 1; playerManager = &g_game->_playerManager; } while (uVar10 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00545e4c: uVar23 = GetTimeNs(); local_260 = SUB84(uVar23 >> 0x20,0); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82; local_278 = (EntityPtr *)((ulonglong)lVar4 >> 0x20); local_24c = (Vector *)((ulonglong)(uint)local_260 * 0xd7b634db >> 0x20); lVar3 = (ulonglong)(uint)local_260 * 0x431bde82; uVar23 = (ulonglong)(uint)local_260 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar16 = (uint)(uVar23 >> 0x20); lVar4 = lVar4 + (uVar23 & 0xffffffff); local_238[0].x = (float)lVar4; uVar10 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar16,uVar10),uVar16 + uVar10); uVar16 = (uint)((ulonglong)lVar4 >> 0x20); piVar13 = (int *)((uint)lVar4 >> 0x12 | uVar16 * 0x4000); uVar10 = (int)piVar13 - (int)local_288; bVar19 = CARRY4((uint)g_entitySpawnTimeMs,uVar10); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar10; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar16 >> 0x12) - (int)local_290) - (uint)(piVar13 < local_288)) + (uint)bVar19; LAB_00545ede: local_270 = (Room *)((ulonglong)lVar3 >> 0x20); local_26c = (void *)lVar3; piVar13 = (int *)__RTDynamicCast(local_27c,0); piVar13[0x117] = 0x1e; piVar13[0x118] = 0x1e; fVar20 = g_vectorOne.x * 2.0; piVar13[0x3a] = (int)(g_vectorOne.y * 2.0); piVar13[0x39] = (int)fVar20; EVar9 = (EntityPtr)(**(code **)(*piVar13 + 0xc))(); return EVar9; } //@@ 00545f70 NpcAI::ENTITY_FISTULOID /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 308 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FISTULOID(Entity_NPC *npc) { EntityPtr EVar1; code *pcVar2; byte bVar3; Entity *pEVar4; Vector *pVVar5; ProjectileParams *params; Entity_NPC *spawnedNpc; EntityRef *damageSourceRef; float extraout_ECX; float extraout_ECX_00; float extraout_ECX_01; float extraout_ECX_02; float extraout_ECX_03; float extraout_ECX_04; float extraout_ECX_05; float extraout_ECX_06; float extraout_ECX_07; float extraout_ECX_08; float extraout_ECX_09; undefined4 *extraout_ECX_10; float extraout_ECX_11; float extraout_ECX_12; float extraout_ECX_13; float extraout_ECX_14; float extraout_ECX_15; float extraout_ECX_16; float extraout_ECX_17; float extraout_ECX_18; float extraout_ECX_19; float extraout_ECX_20; uint uVar6; code *extraout_EDX; code *extraout_EDX_00; int controllerId; float fVar7; undefined1 *ejectDirY; float fVar8; undefined1 *ejectDirX; float fVar9; undefined4 uVar10; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; EntityRef decaySource; EntityRef burstSource; EntityRef damageSource; char sameTypeNpcs [4]; undefined8 local_11c; uint sameTypeCount; Vector local_110; Vector local_108; Vector local_100; undefined1 local_f8 [12]; float local_ec; float local_e8; Vector local_e4; float local_dc; float local_d8; char isOrbiting; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; AnimationState *animState; Manager *manager; Entity_NPC *otherFistuloid; float speedMult; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af48f0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; if (((npc->_parent == (EntityPtr)0x0) || (*(Entity_NPC **)((int)npc->_parent + 0x3c0) == npc)) || (isOrbiting = '\x01', npc->_controllerID != -1)) { isOrbiting = '\0'; } if (npc->_state == 0) { npc->_state = 4; npc->_i1 = 0; return; } ExceptionList = &local_1c; pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar7 = (float)npc->_state; local_100.y = (float)pEVar4; if (fVar7 == 5.60519e-45) { ANM2::Play(&npc->_sprite,s_Idle,0); if (isOrbiting == '\0') { local_dc = (float)npc->_initSeed; local_108.y = 9.80909e-45; local_11c = 0x900000005; Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_f8 + 8),0.0); EVar1 = npc->_parent; if (EVar1 == (EntityPtr)0x0) { local_e4.y = local_ec; local_d8 = (float)local_f8._8_4_; } else { fVar8 = (npc->_pos).x - (float)local_f8._8_4_; local_d8 = (float)local_f8._8_4_; fVar7 = (npc->_pos).y - local_ec; local_e4.y = local_ec; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (240.0 < fVar7) { local_e4.y = *(float *)((int)EVar1 + 0x340); local_d8 = *(float *)((int)EVar1 + 0x33c); } } if (local_dc == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_dc >> ((byte)local_11c & 0x1f) ^ (uint)local_dc; uVar6 = uVar6 << ((byte)((ulonglong)local_11c >> 0x20) & 0x1f) ^ uVar6; uVar6 = uVar6 >> (SUB41(local_108.y,0) & 0x1f) ^ uVar6; fVar8 = (npc->_pos).x - local_d8; local_dc = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10; fVar7 = (npc->_pos).y - local_e4.y; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); local_d8 = local_d8 - (npc->_pos).x; fVar7 = (fVar7 - 200.0) / 800.0; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } local_e8 = 40.0 - fVar7 * 40.0; local_e4.y = local_e4.y - (npc->_pos).y; fVar7 = sqrtf(local_e4.y * local_e4.y + local_d8 * local_d8); if (0.0 < fVar7) { local_d8 = (1.0 / fVar7) * local_d8; local_e4.y = local_e4.y * (1.0 / fVar7); } controllerId = npc->_controllerID; if (controllerId != -1) { pVVar5 = Entity_NPC::GetControllerInput(npc,(Vector *)(local_f8 + 8),0.0); controllerId = npc->_controllerID; local_d8 = pVVar5->x; local_e4.y = pVVar5->y; local_e8 = local_e8 * 0.5; } fVar7 = sin(((float)(g_game->_frameCount - npc->_spawnFrame) / 60.0 + local_dc) * 6.2831855); local_dc = fVar7 * local_e8 * 0.017453292; local_108.y = cos(local_dc); fVar7 = sin(local_dc); local_ec = fVar7 * local_d8 + local_108.y * local_e4.y; local_110.y = local_108.y * local_d8 - fVar7 * local_e4.y; fVar7 = extraout_ECX_00; fVar8 = local_110.y; fVar9 = local_ec; if (controllerId == -1) { local_e8 = 0.0; local_dc = 0.0; local_108.y = 0.0; Entity_NPC::QueryNPCsType(sameTypeNpcs,npc->_type,npc->_variant); uVar6 = 0; fVar7 = extraout_ECX_01; if (sameTypeCount != 0) { do { otherFistuloid = *(Entity_NPC **)((int)(void *)local_11c + uVar6 * 4); if (otherFistuloid != npc) { local_d8 = (npc->_pos).y - (otherFistuloid->_pos).y; local_e4.y = (npc->_pos).x - (otherFistuloid->_pos).x; fVar8 = sqrtf(local_d8 * local_d8 + local_e4.y * local_e4.y); fVar7 = extraout_ECX_02; if (0.0 < fVar8) { local_e8 = (float)((int)local_e8 + 1); fVar9 = fVar8 * 0.1 + 10.0; local_108.y = ((local_e4.y / fVar8) / fVar9) * 10.0 + local_108.y; local_dc = ((local_d8 / fVar8) / fVar9) * 10.0 + local_dc; } } uVar6 = uVar6 + 1; } while (uVar6 < sameTypeCount); } local_e4.y = local_110.y; local_d8 = local_ec; if (0 < (int)local_e8) { local_e4.y = local_108.y / (float)(int)local_e8 + local_110.y; local_d8 = local_dc / (float)(int)local_e8 + local_ec; fVar8 = sqrtf(local_e4.y * local_e4.y + local_d8 * local_d8); fVar7 = extraout_ECX_03; if (0.0 < fVar8) { local_e4.y = local_e4.y * (1.0 / fVar8); local_d8 = local_d8 * (1.0 / fVar8); } } fVar8 = local_e4.y; fVar9 = local_d8; if (sameTypeNpcs[0] == '\0') { local_14 = 0.0; tracked_alloc(1,(void *)local_11c,0); local_14 = -NAN; fVar7 = extraout_ECX_04; fVar8 = local_e4.y; fVar9 = local_d8; } } speedMult = npc->_speedMultiplier; fVar8 = fVar8 * 0.7 * speedMult + (npc->_velocity).x; (npc->_velocity).x = fVar8; (npc->_velocity).y = fVar9 * 0.7 * speedMult + (npc->_velocity).y; pEVar4 = (Entity *)local_100.y; } else { fVar8 = (npc->_velocity).x; fVar7 = extraout_ECX; } (npc->_sprite)._flipX = 0.0 < fVar8; if ((npc->_flags & 0x1000a00) == 0) { if (npc->_i1 < 1) { if (npc->_controllerID == -1) { EVar1 = npc->_spawnerEntity; if ((((EVar1 != (EntityPtr)0x0) && (*(int *)((int)EVar1 + 0x28) == 0x19d)) && (*(int *)((int)EVar1 + 0xb64) == 9)) || (fVar8 = (npc->_pos).x - (pEVar4->_pos).x, fVar9 = (npc->_pos).y - (pEVar4->_pos).y, 10000.0 <= fVar9 * fVar9 + fVar8 * fVar8)) goto LAB_00546aa6; uVar6 = Random(); fVar7 = 7.00649e-45; if (uVar6 % 5 != 0) goto LAB_00546aa6; } else { bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); fVar7 = extraout_ECX_05; if (bVar3 == 0) goto LAB_00546aa6; } pVVar5 = &npc->_controllerMovement; if (npc->_controllerID == -1) { pVVar5->x = g_vectorZero.x; fVar7 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,(Vector *)(local_f8 + 8),0.1); pVVar5->x = (float)local_f8._8_4_; fVar7 = local_ec; } (npc->_controllerMovement).y = fVar7; npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); fVar7 = extraout_ECX_06; if (npc->_controllerID != -1) { bVar3 = Vector::operator_ne(pVVar5,&g_vectorZero); fVar7 = extraout_ECX_07; if (bVar3 != 0) { fVar8 = ((Vector *)((int)local_100.y + 0x33c))->x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar8 && fVar8 != (npc->_pos).x; goto LAB_00546aa6; } } (npc->_sprite)._flipX = 0.0 < pVVar5->x; } else { fVar7 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_i1 = npc->_i1 - (int)fVar7; } } goto LAB_00546aa6; } if (fVar7 != 1.12104e-44) { if (fVar7 == 7.00649e-45) { npc->_entityCollisionClass = 0; fVar8 = (npc->_targetPosition).x; fVar9 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; (npc->_velocity).x = fVar8 - fVar9; npc->_friction = npc->_friction * 0.5; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); fVar7 = extraout_ECX_13; if (bVar3 != 0) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar3 == 0) { uVar6 = Random(); local_f8._8_4_ = (npc->_v1).x * 12.0; local_ec = (npc->_v1).y * 12.0; uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; pEVar4 = Game::Spawn(g_game,0x27,0x16,&npc->_pos,(Vector *)(local_f8 + 8),(Entity *)npc, 1,uVar6); spawnedNpc = (Entity_NPC *)__RTDynamicCast(pEVar4,uVar10,pTVar11,pTVar12,uVar13); spawnedNpc->_state = 0; (**(code **)(*(int *)spawnedNpc + 0xc))(); } damageSourceRef = EntityRef::EntityRef(&burstSource); (*extraout_EDX)(damageSourceRef); fVar7 = extraout_ECX_14; } } } goto LAB_00546aa6; } Entity_NPC::UpdateControllerMovement(npc,0); animState = &(npc->_sprite)._animState; fVar7 = extraout_ECX_08; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); fVar7 = extraout_ECX_09; if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); local_f8._8_4_ = ((Vector *)((int)local_100.y + 0x33c))->x - (npc->_pos).x; local_ec = ((Vector *)((int)local_100.y + 0x33c))->y - (npc->_pos).y; Vector::Normalized((Vector *)(local_f8 + 8),&local_110); if ((npc->_controllerID == -1) || (bVar3 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar3 == 0)) { local_dc = local_110.y; } else { local_110.x = (float)*extraout_ECX_10; local_dc = (float)extraout_ECX_10[1]; } (npc->_v2).x = local_110.x; (npc->_v2).y = local_dc; local_100.y = local_110.x; params = ProjectileParams::ProjectileParams(&projParams); local_108.x = local_100.y * 10.0; local_108.y = local_dc * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_108,0,params); (npc->_sprite)._flipX = 0.0 < local_100.y; fVar7 = extraout_ECX_11; } } if (isOrbiting == '\0') { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"Shoot"); fVar7 = extraout_ECX_12; if (bVar3 != 0) { fVar8 = (npc->_v2).y; fVar9 = npc->_speedMultiplier; (npc->_velocity).x = -(npc->_v2).x * 1.2 * fVar9 + (npc->_velocity).x; (npc->_velocity).y = -fVar8 * 1.2 * fVar9 + (npc->_velocity).y; } goto LAB_0054695e; } } else { LAB_0054695e: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00546aa6; } npc->_state = 4; npc->_i1 = 0x1e; LAB_00546aa6: manager = g_manager; if (isOrbiting == '\0') { npc->_entityGridCollisionClass = 3; npc->_friction = 0.9; } else { EVar1 = npc->_parent; npc->_entityGridCollisionClass = 0; uVar6 = manager->_framecount & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } local_ec = (npc->_v1).x - ((float)(int)uVar6 * 0.5 + (float)g_game->_frameCount) * 0.5 * 3.1415927 * 0.035; fVar7 = sin(local_ec); local_e4.y = fVar7 * 90.0 * 0.84; fVar7 = cos(local_ec); local_ec = *(float *)((int)EVar1 + 0x360); local_110.y = *(float *)((int)EVar1 + 0x364); local_e4.y = ((local_e4.y + *(float *)((int)EVar1 + 0x340)) - (local_110.y + (npc->_pos).y)) * 0.5; local_100.y = ((fVar7 * 90.0 + *(float *)((int)EVar1 + 0x33c)) - (local_ec + (npc->_pos).x)) * 0.5; fVar7 = sqrtf(local_100.y * local_100.y + local_e4.y * local_e4.y); if ((fVar7 <= 10.0) || (fVar7 <= 0.0)) { pEVar4 = (Entity *)local_100.y; fVar7 = local_e4.y; } else { pEVar4 = (Entity *)(local_100.y * (10.0 / fVar7)); fVar7 = local_e4.y * (10.0 / fVar7); } fVar8 = npc->_friction; (npc->_velocity).x = (local_ec + (float)pEVar4) / fVar8; (npc->_velocity).y = (local_110.y + fVar7) / fVar8; fVar7 = extraout_ECX_15; } if (npc->_isKillOnTouch != 0) { bVar3 = Entity::IsFrame((Entity *)npc,4,0); fVar7 = extraout_ECX_16; if (bVar3 != 0) { uVar6 = Random(); fVar7 = extraout_ECX_17; if ((uVar6 & 1) == 0) { damageSourceRef = EntityRef::EntityRef(&decaySource); (*extraout_EDX_00)(npc->_maxHitPoints * 0.4,0,0,damageSourceRef,0x1e); fVar7 = extraout_ECX_18; } } } if (((npc->_dead == 0) && (EVar1 = npc->_parent, EVar1 != (EntityPtr)0x0)) && ((*(int *)((int)EVar1 + 0x28) == 0x19d && (*(Entity_NPC **)((int)EVar1 + 0x3c0) == npc)))) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_f8,&npc->_pos, npc->_size,2); local_14 = 1.4013e-45; fVar7 = 0.0; if (local_ec != 0.0) { do { pEVar4 = *(Entity **)(local_f8._4_4_ + (int)fVar7 * 4); if ((pEVar4->_spawnerType == 0x19d) && ((pEVar4[1]._variant & 0x100U) != 0)) { pcVar2 = *(code **)(*(int *)npc + 0x20); EntityRef::constructor(&damageSource,pEVar4); (*pcVar2)(npc->_maxHitPoints,0,0,&damageSource,0x1e); fVar7 = extraout_ECX_19; break; } fVar7 = (float)((int)fVar7 + 1); } while ((uint)fVar7 < (uint)local_ec); } local_14 = -NAN; if (local_f8[0] == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,(void *)local_f8._4_4_,0); local_14 = -NAN; fVar7 = extraout_ECX_20; } } if (((npc->_controllerID != -1) && (bVar3 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,(int)fVar7), bVar3 != 0)) && (npc->_state != 5)) { damageSource._type = 0; damageSource._variant = 0; damageSource._spawnerType = 0; damageSource._spawnerVariant = 0; damageSource._position.x = g_vectorZero.x; damageSource._position.y = g_vectorZero.y; damageSource._velocity.x = g_vectorZero.x; damageSource._velocity.y = g_vectorZero.y; damageSource._flags = 0; damageSource._entity = (void *)0x0; (**(code **)(*(int *)npc + 0x24))(&damageSource); } if (npc->_dead != 0) { if (isOrbiting != '\0') { npc_distribute_orbit_angles(); } EVar1 = npc->_parent; if ((EVar1 != (EntityPtr)0x0) && (*(int *)((int)EVar1 + 0x28) == 0x19d)) { *(int *)((int)EVar1 + 0xbc0) = *(int *)((int)EVar1 + 0xbc0) + 0x96; } if (((npc->_dead != 0) && (npc->_state != 5)) && (npc->_state != 0x12)) { pVVar5 = Entity_NPC::CalcTargetPosition(npc,&local_110,0.0); local_ec = pVVar5->x - (npc->_pos).x; local_110.y = pVVar5->y - (npc->_pos).y; fVar7 = local_ec; fVar8 = local_110.y; if (npc->_controllerID != -1) { pVVar5 = Entity_NPC::GetControllerInput(npc,&local_100,0.0); bVar3 = Vector::operator_ne(pVVar5,&g_vectorZero); if (bVar3 == 0) { fVar7 = local_ec; fVar8 = local_110.y; } else { pVVar5 = Entity_NPC::GetControllerInput(npc,&local_e4,0.0); fVar7 = pVVar5->x; fVar8 = pVVar5->y; } } ejectDirY = (undefined1 *)0x0; if (ABS(fVar7) <= ABS(fVar8)) { ejectDirX = (undefined1 *)0x0; if (fVar8 <= 0.0) { ejectDirY = &DAT_bf800000; } else { ejectDirY = (undefined1 *)0x3f800000; } } else if (fVar7 <= 0.0) { ejectDirX = &DAT_bf800000; } else { ejectDirX = (undefined1 *)0x3f800000; } (npc->_v1).x = (float)ejectDirX; (npc->_v1).y = (float)ejectDirY; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; ANM2::Play(&npc->_sprite,(byte *)"Eject",0); npc->_state = 5; Entity::RemoveStatusEffects((Entity *)npc); npc->_isInvicible = 1; npc->_dead = 0; npc->_health = 0.1; npc->_stateFrame = -1; } } ExceptionList = local_1c; return; } //@@ 00547040 npc_distribute_orbit_angles /* DB: spreads V1 angles 2pi/n among siblings; Matriarch/Fistuloid */ void npc_distribute_orbit_angles(void) { int iVar1; qword qVar2; uint in_ECX; uint uVar3; qword *pqVar4; uint uVar5; void *pvVar6; void *ptr; int *piVar7; int iVar8; int *piVar9; double dVar10; float fVar11; EntityList_EL local_3c; void *local_2c; int *local_28; int *local_24; uint local_20; uint local_1c; int *local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af4935; local_10 = ExceptionList; if (*(int *)(in_ECX + 0x3bc) == 0) { return; } piVar9 = (int *)0x0; local_2c = (void *)0x0; piVar7 = (int *)0x0; local_18 = (int *)0x0; local_28 = (int *)0x0; local_24 = (int *)0x0; local_8 = 0; local_14 = 360.0; ExceptionList = &local_10; local_1c = in_ECX; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_3c,0x134,-1,-1,0,0); local_8 = CONCAT31(local_8._1_3_,1); uVar5 = 0; uVar3 = local_3c._size; if (local_3c._size == 0) { pvVar6 = (void *)0x0; } else { do { local_18 = *(int **)((int)local_3c._data + uVar5 * 4); if ((((local_18[0xef] == *(int *)(local_1c + 0x3bc)) && (local_18 != *(int **)(*(int *)(local_1c + 0x3bc) + 0x3c0))) && (*(char *)((int)local_18 + 0x173) == '\0')) && (local_18[0x2d9] != 5)) { if (piVar7 == piVar9) { std::vector::_Emplace_reallocate(piVar7,&local_18); uVar3 = local_3c._size; piVar9 = local_24; } else { *piVar7 = (int)local_18; local_28 = piVar7 + 1; } fVar11 = (float)local_18[0x2ec]; if (local_14 <= (float)local_18[0x2ec]) { fVar11 = local_14; } piVar7 = local_28; local_14 = fVar11; } uVar5 = uVar5 + 1; } while (uVar5 < uVar3); pvVar6 = local_2c; local_18 = piVar9; } local_20 = (int)piVar7 - (int)pvVar6 >> 2; fVar11 = 6.2831855 / (float)((double)(int)local_20 + __uint_to_double_fixup[-((int)piVar7 - (int)pvVar6 >> 0x1f)]); if (1 < local_20) { uVar3 = 0; if (3 < local_20) { local_1c = local_20 - 3; iVar8 = 2; piVar7 = (int *)((int)pvVar6 + 8); do { dVar10 = (double)(int)uVar3; iVar1 = (int)uVar3 >> 0x1f; uVar3 = uVar3 + 4; *(float *)(piVar7[-2] + 0xbb0) = (float)(dVar10 + __uint_to_double_fixup[-iVar1]) * fVar11 + local_14; *(float *)(piVar7[-1] + 0xbb0) = (float)((double)(iVar8 + -1) + __uint_to_double_fixup[-(iVar8 + -1 >> 0x1f)]) * fVar11 + local_14; *(float *)(*piVar7 + 0xbb0) = (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) * fVar11 + local_14; iVar1 = iVar8 + 1; iVar8 = iVar8 + 4; piVar9 = piVar7 + 1; piVar7 = piVar7 + 4; *(float *)(*piVar9 + 0xbb0) = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) * fVar11 + local_14; } while (uVar3 < local_1c); piVar9 = local_18; if (local_20 <= uVar3) goto LAB_005472a3; } do { dVar10 = (double)(int)uVar3; iVar1 = (int)uVar3 >> 0x1f; iVar8 = uVar3 * 4; uVar3 = uVar3 + 1; *(float *)(*(int *)((int)pvVar6 + iVar8) + 0xbb0) = (float)(dVar10 + __uint_to_double_fixup[-iVar1]) * fVar11 + local_14; } while (uVar3 < local_20); } LAB_005472a3: if (local_3c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (local_3c._data != (void *)0x0) { uVar3 = *(uint *)((int)local_3c._data + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar3; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar3); free((uint *)((int)local_3c._data + -4)); } } if (pvVar6 != (void *)0x0) { uVar3 = (int)piVar9 - (int)pvVar6 & 0xfffffffc; ptr = pvVar6; if (0xfff < uVar3) { ptr = *(void **)((int)pvVar6 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } ExceptionList = local_10; return; } //@@ 00547330 NpcAI::ENTITY_GUSH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 309 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GUSH(Entity_NPC *npc) { uint3 uVar1; byte isInRoom; uint uVar2; uint rngResult; Entity *spawned; int *creep; int iVar3; qword *allocCounter; int iVar4; float fVar5; float fVar6; undefined4 uVar7; TypeDescriptor *pTVar8; TypeDescriptor *pTVar9; undefined4 uVar10; undefined4 local_bc [8]; int state; int iStack_98; int local_94; EntityList_EL creeps; EntityList_EL nearbyCreeps; float radiusRoll; float angle; int *local_68; uint isOwnCreepNear; int *local_60; Vector spawnPos; float local_54; undefined4 splatColor; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword allocatedBytes; void *currentRoom; uint *flagsHigh; Game *game; Room *room; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af4975; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; currentRoom = g_game->_room; iVar4 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if (((((-1 < iVar4) && (iVar4 < *(int *)((int)currentRoom + 0xc))) && (-1 < iVar3)) && ((iVar3 < *(int *)((int)currentRoom + 0x10) && (iVar4 = *(int *)((int)currentRoom + 0xc) * iVar3 + iVar4, -1 < iVar4)))) && ((iVar4 < 0x1c0 && (*(int *)((int)currentRoom + iVar4 * 4 + 0x76c) < 0x3b7)))) { *(undefined4 *)((int)currentRoom + iVar4 * 4 + 0x76c) = 900; } state = npc->_state; local_24 = uVar2; if (state == 0) { if (&npc->_splatColor != (ColorMod *)local_bc) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; iStack_98 = state; local_94 = state; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); rngResult = Random(); flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2000; *(int *)&npc->_flags = (int)npc->_flags; npc->_i1 = rngResult % 10 + 1; rngResult = Random(); uVar10 = 0; pTVar9 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar7 = 0; spawned = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngResult); creep = (int *)__RTDynamicCast(spawned,uVar7,pTVar8,pTVar9,uVar10,uVar2); creep[0x117] = 0x1e; creep[0x118] = 0x1e; if (creep[0xef] != 0) { local_60 = creep + 0xef; std::multiset::erase(&local_60); } creep[0xef] = (int)npc; std::multiset::insert(creep + 0xef); fVar5 = g_vectorOne.x * 2.0; creep[0x3a] = (int)(g_vectorOne.y * 2.0); creep[0x39] = (int)fVar5; (**(code **)(*creep + 0xc))(); } else { if (state == 3) { ANM2::Play(&npc->_sprite,&DAT_00b612a0,0); game = g_game; fVar5 = (npc->_targetPosition).y; fVar6 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar5 - fVar6; EntityList::QuerySublist((EntityList *)((int)game->_room + 0x1218),&creeps,1000,0x1a,-1,0,0); local_14 = 0; local_54 = 0.0; if ((float)creeps._size != 0.0) { do { iVar4 = __RTDynamicCast(*(undefined4 *)((int)creeps._data + (int)local_54 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0,uVar2) ; if (*(Entity_NPC **)(iVar4 + 0x3bc) == npc) { iVar3 = *(int *)(iVar4 + 0x45c); if (iVar3 < 0x1f) { *(undefined4 *)(iVar4 + 0x45c) = 0x1e; *(undefined4 *)(iVar4 + 0x460) = 0x1e; } else { fVar5 = ((float)iVar3 - 45.0) / -15.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } fVar6 = fVar5 * 1.5 * g_vectorOne.x; *(float *)(iVar4 + 0xe8) = fVar5 * 1.5 * g_vectorOne.y; *(float *)(iVar4 + 0xe4) = fVar6; if (iVar3 == 0x1f) { rngResult = Random(); spawnPos.x = *(float *)(iVar4 + 0x33c); spawnPos.y = *(float *)(iVar4 + 0x340); spawned = Game::Spawn(g_game,1000,7,&spawnPos,&g_vectorZero,(Entity *)npc,0, rngResult); rngResult = Random(); local_30 = 0; local_2c = 0; local_28 = 0; iVar4 = *(int *)spawned; fVar6 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar5 = fVar6 * g_vectorOne.x; (spawned->_sprite)._scale.y = fVar6 * g_vectorOne.y; (spawned->_sprite)._scale.x = fVar5; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; splatColor = 0; uStack_4c = 0; uStack_48 = 0; uStack_44 = 0x3f800000; (**(code **)(iVar4 + 0x3c))(&splatColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawned + 0xc))(); } } } local_54 = (float)((int)local_54 + 1); } while ((uint)local_54 < (uint)creeps._size); } if (npc->_i1 < 1) { if ((uint)creeps._size < 0x100) { uVar2 = Random(); local_54 = 200.0; local_60 = (int *)0x1; npc->_i1 = uVar2 % 10 + 1; do { uVar2 = Random(); radiusRoll = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; uVar2 = Random(); angle = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; angle = angle + angle; local_68 = (int *)sin(angle); fVar5 = cos(angle); game = g_game; spawnPos.x = fVar5 * radiusRoll * radiusRoll * local_54 + (npc->_pos).x; spawnPos.y = (float)local_68 * radiusRoll * radiusRoll * local_54 + (npc->_pos).y; isInRoom = Room::IsPositionInRoom(g_game->_room,&spawnPos,0.0); if (isInRoom != 0) { room = game->_room; iVar3 = (int)((spawnPos.x - 40.0) / 40.0 + 0.5); iVar4 = (int)((spawnPos.y - 120.0) / 40.0 + 0.5); if (((iVar3 < 0) || (room->_gridWidth <= iVar3)) || ((iVar4 < 0 || (room->_gridHeight <= iVar4)))) { iVar3 = -1; } else { iVar3 = iVar4 * room->_gridWidth + iVar3; } uVar2 = Room::GetGridCollision(room,iVar3); if (uVar2 == 0) { isOwnCreepNear = isOwnCreepNear & 0xffffff00; EntityList::QuerySublist(&room->_entityList,&nearbyCreeps,1000,0x1a,-1,0,0); uVar1 = local_14._1_3_; local_14 = CONCAT31(local_14._1_3_,1); uVar2 = 0; if (nearbyCreeps._size != 0) { do { iVar4 = *(int *)((int)nearbyCreeps._data + uVar2 * 4); fVar5 = spawnPos.x - *(float *)(iVar4 + 0x33c); fVar6 = spawnPos.y - *(float *)(iVar4 + 0x340); fVar5 = fVar6 * fVar6 + fVar5 * fVar5; if ((fVar5 < 5625.0) && (isOwnCreepNear = isOwnCreepNear & 0xff, *(Entity_NPC **)(iVar4 + 0x3bc) == npc)) { isOwnCreepNear = 1; } if (fVar5 < 1600.0) goto LAB_005479b2; uVar2 = uVar2 + 1; } while (uVar2 < (uint)nearbyCreeps._size); if ((char)isOwnCreepNear != '\0') { uVar2 = Random(); uVar10 = 0; pTVar9 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar7 = 0; spawned = Game::Spawn(g_game,1000,0x1a,&spawnPos,&g_vectorZero,(Entity *)npc,0, uVar2); creep = (int *)__RTDynamicCast(spawned,uVar7,pTVar8,pTVar9,uVar10); creep[0x117] = 0x2d; creep[0x118] = 0x2d; if (creep[0xef] != 0) { local_68 = creep + 0xef; std::multiset::erase(&local_68); } creep[0xef] = (int)npc; std::multiset::insert(creep + 0xef); fVar5 = g_vectorOne.y * 2.0; creep[0x39] = (int)(g_vectorOne.x * 2.0); creep[0x3a] = (int)fVar5; (**(code **)(*creep + 0xc))(); creep[0x39] = (int)g_vectorZero.x; creep[0x3a] = (int)g_vectorZero.y; if (nearbyCreeps._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,2); tracked_alloc(1,nearbyCreeps._data,0); } break; } } LAB_005479b2: local_14 = (uint)local_14._1_3_ << 8; if (nearbyCreeps._0_1_ == '\0') { local_14._0_1_ = 3; local_14._1_3_ = uVar1; tracked_alloc(1,nearbyCreeps._data,0); local_14 = (uint)local_14._1_3_ << 8; } } } local_54 = local_54 + 100.0; local_60 = (int *)((int)local_60 + 1); } while ((int)local_60 < 0xb); } } else { npc->_i1 = npc->_i1 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } if (creeps._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (creeps._data != (void *)0x0) { uVar2 = *(uint *)((int)creeps._data + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((uint *)((int)creeps._data + -4)); } } } npc->_friction = 0.8; } ExceptionList = local_1c; return; } //@@ 00547b60 NpcAI::ENTITY_LEPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: type 310; was GameOver::Show */ void __fastcall NpcAI::ENTITY_LEPER(Entity_NPC *npc) { ANM2 *pAVar1; byte bVar2; Vector *pVVar3; int newCountdown; Entity *tmpEntity; uint rngResult; std_string *pngFilename; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; void *freeBlock; undefined4 *puVar4; uint uVar5; int iVar6; char *srcChars; float fVar7; double dVar8; undefined8 uVar9; Vector fleshVelocity; Vector fleshPos; Vector scratchVec; float local_70; float local_6c; float local_68; float local_64; float pushDirX; float local_5c; undefined4 bloodColor; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 local_48; std_string sStack_44; std_string tmpString; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 fleshFlagsHigh; local_8 = 0xffffffff; puStack_c = &LAB_00af49d5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&tmpString)[1]._size; ExceptionList = &local_10; if (npc->_variant == 1) { NpcHelper::leper_flesh_ai(npc); ExceptionList = local_10; return; } iVar6 = npc->_state; if (iVar6 == 0) { npc->_i1 = 0; LAB_00547fd2: npc->_state = 4; } else if (iVar6 == 4) { if (((npc->_i1 < 1) && (npc->_subtype != 3)) && (npc->_controllerID == -1)) { bVar2 = 0; pVVar3 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,pVVar3,bVar2); if ((0 < (npc->_pathfinder)._evadeMovementCountdown) && (10 < g_game->_frameCount - npc->_spawnFrame)) { uVar5 = Random(); Entity_NPC::PlaySound(npc,0x8f,1.0,uVar5 % 100 + 0x2d,0,1.0); } iVar6 = npc->_i1; if (iVar6 < 0) { newCountdown = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + iVar6; iVar6 = 0; if (newCountdown < 0) { iVar6 = newCountdown; } npc->_i1 = iVar6; } if (((iVar6 == 0) && ((npc->_pathfinder)._evadeMovementCountdown < 1)) && (uVar5 = Random(), uVar5 % 10 == 0)) { npc->_i1 = 0x5a; } npc->_friction = npc->_friction * 0.8; } else { fVar7 = 0.5; if (npc->_subtype == 2) { fVar7 = 0.7; } else if (npc->_subtype == 3) { fVar7 = 0.9; } uVar9 = 0x100000000; pVVar3 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath ((PathFinder *)&npc->_pathfinder,pVVar3,fVar7,(int)uVar9, (byte)((ulonglong)uVar9 >> 0x20)); newCountdown = npc->_i1 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_friction = npc->_friction * 0.9; iVar6 = 0; if (0 < newCountdown) { iVar6 = newCountdown; } npc->_i1 = iVar6; if (iVar6 == 0) { uVar5 = Random(); npc->_i1 = -0x1e - uVar5 % 0x3c; } } tmpString._capacity = 0xf; tmpString._size = 8; builtin_strncpy(tmpString._buf,"WalkVert",9); sStack_44._capacity = 0xf; sStack_44._size = 8; builtin_strncpy(sStack_44._buf,"WalkHori",8); sStack_44._buf._8_4_ = sStack_44._buf._8_4_ & 0xffffff00; local_8 = 1; Entity_NPC::AnimWalkFrame(npc,&sStack_44,&tmpString,0.1); local_8 = local_8 & 0xffffff00; if (0xf < sStack_44._capacity) { uVar5 = sStack_44._capacity + 1; puVar4 = (undefined4 *)sStack_44._buf._0_4_; if (0xfff < uVar5) { puVar4 = *(undefined4 **)(sStack_44._buf._0_4_ + 0xfffffffc); uVar5 = sStack_44._capacity + 0x24; if (0x1f < (uint)(sStack_44._buf._0_4_ + (-4 - (int)puVar4))) goto LAB_00547f6c; } operator_delete(puVar4,uVar5); } local_8 = 0xffffffff; sStack_44._size = 0; sStack_44._capacity = 0xf; sStack_44._buf._0_4_ = sStack_44._buf._0_4_ & 0xffffff00; if (0xf < tmpString._capacity) { uVar5 = tmpString._capacity + 1; freeBlock = (void *)tmpString._buf._0_4_; if (0xfff < uVar5) { freeBlock = *(void **)(tmpString._buf._0_4_ + -4); uVar5 = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_00547f6c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar5); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Walk,1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } else { ANM2::PlayOverlay(&npc->_sprite,s_Walk,0); } } else if (iVar6 == 0x10) { tmpString._capacity = 0xf; tmpString._size = 8; tmpString._buf[8] = '\0'; npc->_friction = npc->_friction * 0.8; builtin_strncpy(tmpString._buf,"WalkVert",8); sStack_44._capacity = 0xf; sStack_44._size = 8; builtin_strncpy(sStack_44._buf,"WalkHori",8); sStack_44._buf._8_4_ = sStack_44._buf._8_4_ & 0xffffff00; local_8 = 3; Entity_NPC::AnimWalkFrame(npc,&sStack_44,&tmpString,0.1); local_8 = CONCAT31(local_8._1_3_,2); if (0xf < sStack_44._capacity) { uVar5 = sStack_44._capacity + 1; puVar4 = (undefined4 *)sStack_44._buf._0_4_; if (0xfff < uVar5) { puVar4 = *(undefined4 **)(sStack_44._buf._0_4_ + 0xfffffffc); uVar5 = sStack_44._capacity + 0x24; if (0x1f < (uint)(sStack_44._buf._0_4_ + (-4 - (int)puVar4))) goto LAB_00547cb0; } operator_delete(puVar4,uVar5); } local_8 = 0xffffffff; sStack_44._size = 0; sStack_44._capacity = 0xf; sStack_44._buf._0_4_ = sStack_44._buf._0_4_ & 0xffffff00; if (0xf < tmpString._capacity) { uVar5 = tmpString._capacity + 1; freeBlock = (void *)tmpString._buf._0_4_; if (0xfff < uVar5) { freeBlock = *(void **)(tmpString._buf._0_4_ + -4); uVar5 = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_00547cb0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar5); } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) goto LAB_00547fd2; } bVar2 = Entity::IsFrame((Entity *)npc,10,0); if (bVar2 != 0) { iVar6 = npc->_subtype; if (iVar6 == 3) { uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x16,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5); uVar5 = Random(); iVar6 = *(int *)tmpEntity; fVar7 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2; (tmpEntity->_sprite)._scale.x = fVar7; (tmpEntity->_sprite)._scale.y = fVar7; (**(code **)(iVar6 + 0xc))(); pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[8] = '\x1e'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[0xc] = '\x1e'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; iVar6 = npc->_subtype; } if (iVar6 != 0) { uVar5 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.4); } } iVar6 = npc->_i1; if ((0 < iVar6) && (fVar7 = npc->_pendingDamage, 0.0 < fVar7)) { local_5c = fVar7 + fVar7; dVar8 = ceil((double)local_5c); local_5c = (float)dVar8; iVar6 = iVar6 - (int)dVar8; newCountdown = 1; if (1 < iVar6) { newCountdown = iVar6; } npc->_i1 = newCountdown; } uVar5 = npc->_subtype; local_64 = (float)uVar5; if ((uVar5 < 3) && (0.0 < npc->_pendingDamage)) { local_70 = npc->_health - npc->_pendingDamage; do { if (((float)((double)(int)(3 - uVar5) + __uint_to_double_fixup[-((int)(3 - uVar5) >> 0x1f)]) * npc->_maxHitPoints) / (float)((double)(int)(4 - uVar5) + __uint_to_double_fixup[-((int)(4 - uVar5) >> 0x1f)]) < local_70) break; npc->_subtype = uVar5 + 1; Entity::BloodExplode((Entity *)npc); pVVar3 = &npc->_pos; tmpEntity = Entity_NPC::GetPlayerTarget(npc); pushDirX = pVVar3->x - (tmpEntity->_pos).x; local_5c = (npc->_pos).y - (tmpEntity->_pos).y; fVar7 = sqrtf(pushDirX * pushDirX + local_5c * local_5c); if (0.0 < fVar7) { pushDirX = pushDirX * (1.0 / fVar7); local_5c = local_5c * (1.0 / fVar7); } fVar7 = npc->_speedMultiplier; (npc->_velocity).x = pushDirX * 10.0 * fVar7 + (npc->_velocity).x; (npc->_velocity).y = local_5c * 10.0 * fVar7 + (npc->_velocity).y; uVar5 = Random(); rngResult = Random(); local_68 = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 90.0 - 45.0) * 0.017453292; local_6c = cos(local_68); fVar7 = sin(local_68); local_68 = local_5c * local_6c + pushDirX * fVar7; local_6c = pushDirX * local_6c - local_5c * fVar7; rngResult = Random(); fleshVelocity.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; fleshVelocity.y = local_68 * fleshVelocity.x; fleshVelocity.x = local_6c * fleshVelocity.x; fleshPos.x = pushDirX * 20.0 + pVVar3->x; fleshPos.y = local_5c * 20.0 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,0x136,1,&fleshPos,&fleshVelocity,(Entity *)npc,0,uVar5); fleshFlagsHigh = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; scratchVec.x = (tmpEntity->_velocity).x; *(undefined4 *)((int)&tmpEntity->_flags + 4) = fleshFlagsHigh; scratchVec.x = scratchVec.x * 0.3; sStack_44._buf[0xc] = '\0'; sStack_44._buf[0xd] = '\0'; sStack_44._buf[0xe] = '\0'; sStack_44._buf[0xf] = '\0'; scratchVec.y = (tmpEntity->_velocity).y * 0.3; sStack_44._size = 0; bloodColor = 0x3f800000; uStack_54 = 0x3f800000; uStack_50 = 0x3f800000; uStack_4c = 0x3f800000; sStack_44._capacity = 0; local_48 = 0; sStack_44._buf._0_4_ = (undefined4 *)0x0; sStack_44._buf[4] = '\0'; sStack_44._buf[5] = '\0'; sStack_44._buf[6] = '\0'; sStack_44._buf[7] = '\0'; sStack_44._buf[8] = '\0'; sStack_44._buf[9] = '\0'; sStack_44._buf[10] = '\0'; sStack_44._buf[0xb] = '\0'; uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,pVVar3,&scratchVec,(Entity *)0x0,2,uVar5); (**(code **)(*(int *)tmpEntity + 0x3c))(&bloodColor,0xffffffff,0xff,0); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = -6.0; tmpEntity->_renderDepthOffset = 1.0; uVar5 = npc->_subtype; } while (uVar5 < 3); if ((uint)local_64 < uVar5) { iVar6 = npc->_variant; npc->_variant = -1; Entity_NPC::Morph(npc,npc->_type,iVar6,uVar5,-1); npc->_state = 0x10; ANM2::PlayOverlay(&npc->_sprite,(byte *)"Transition",0); } } if (npc->_dead != 0) { uVar5 = Random(); local_64 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_64 = local_64 + local_64; local_70 = sin(local_64); local_64 = cos(local_64); uVar5 = Random(); rngResult = Random(); fleshPos.y = local_70 * 20.0 + (npc->_pos).y; fVar7 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; fleshPos.x = local_64 * 20.0 + (npc->_pos).x; scratchVec.y = fVar7 + fVar7 + 2.0; scratchVec.x = local_64 * scratchVec.y; scratchVec.y = local_70 * scratchVec.y; tmpEntity = Game::Spawn(g_game,0x136,1,&fleshPos,&scratchVec,(Entity *)npc,0,uVar5); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = *(undefined4 *)((int)&tmpEntity->_flags + 4); if (npc->_health <= -25.0) { ExceptionList = local_10; return; } uVar5 = Random(); if ((uVar5 & 1) != 0) { ExceptionList = local_10; return; } Entity_NPC::Morph(npc,0xb,0,0,-1); sStack_44._buf._0_4_ = std::_Allocate(0x40); sStack_44._size = 0x3f; sStack_44._capacity = 0x3f; srcChars = "resources/gfx/Monsters/Classic/Monster_000_Bodies02_scarred.png"; puVar4 = (undefined4 *)sStack_44._buf._0_4_; for (iVar6 = 0xf; iVar6 != 0; iVar6 = iVar6 + -1) { *puVar4 = *(undefined4 *)srcChars; srcChars = srcChars + 4; puVar4 = puVar4 + 1; } *(undefined2 *)puVar4 = *(undefined2 *)srcChars; *(char *)((int)puVar4 + 2) = srcChars[2]; *(undefined1 *)(sStack_44._buf._0_4_ + 0x3f) = 0; local_8 = 4; pngFilename = (std_string *) Menu_Character::ChangeCharacterPage((Menu_Character *)npc,&tmpString,&sStack_44); local_8._0_1_ = 5; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,0,pngFilename); local_8 = CONCAT31(local_8._1_3_,4); bVar2 = extraout_CL; if (0xf < tmpString._capacity) { uVar5 = tmpString._capacity + 1; freeBlock = (void *)tmpString._buf._0_4_; if (0xfff < uVar5) { freeBlock = *(void **)(tmpString._buf._0_4_ + -4); uVar5 = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_005486bd; } operator_delete(freeBlock,uVar5); bVar2 = extraout_CL_00; } local_8 = 0xffffffff; tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = tmpString._buf._0_4_ & 0xffffff00; if (0xf < sStack_44._capacity) { uVar5 = sStack_44._capacity + 1; puVar4 = (undefined4 *)sStack_44._buf._0_4_; if (0xfff < uVar5) { puVar4 = *(undefined4 **)(sStack_44._buf._0_4_ + -4); uVar5 = sStack_44._capacity + 0x24; if (0x1f < (uint)(sStack_44._buf._0_4_ + (-4 - (int)puVar4))) { LAB_005486bd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar4,uVar5); bVar2 = extraout_CL_01; } ANM2::LoadGraphics(&npc->_sprite,bVar2); npc->_dead = 0; uVar5 = Random(); npc->_health = npc->_maxHitPoints; npc->_projectileCooldown = uVar5 % 0x14 + 0x14; } ExceptionList = local_10; return; } //@@ 00548720 NpcHelper::leper_flesh_ai /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Leper 310.1 body (called from NpcAI::ENTITY_LEPER with ECX = npc); death aimed shot at 10 prototype: db/protos.zhl */ void __fastcall NpcHelper::leper_flesh_ai(Entity_NPC *npc) { code *pcVar1; byte bVar2; Vector *pVVar3; uint uVar4; byte *pbVar5; uint uVar6; Entity *pEVar7; byte *expectedName; int extraout_ECX; int extraout_ECX_00; int unused; bool isLess; float fVar8; float fVar9; undefined4 sourceRef; undefined4 local_114; undefined4 local_110; undefined4 local_10c; float local_108; float local_104; float local_100; float local_fc; undefined4 local_f8; undefined4 local_f4; float local_f0; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 uStack_e4; Vector local_d4; float local_cc; byte *local_c8; float local_c4; ProjectileParams projParams; float local_14; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); if (npc->_state != 0) { if (npc->_state == 4) { npc->_friction = npc->_friction * 0.95; pVVar3 = Entity_NPC::CalcTargetPosition(npc,&local_d4,0.0); local_c8 = (byte *)(pVVar3->y - (npc->_pos).y); local_c4 = pVVar3->x - (npc->_pos).x; fVar8 = sqrtf((float)local_c8 * (float)local_c8 + local_c4 * local_c4); if (0.0 < fVar8) { local_c4 = local_c4 * (1.0 / fVar8); local_c8 = (byte *)((float)local_c8 * (1.0 / fVar8)); } if (npc->_controllerID != -1) { pVVar3 = Entity_NPC::GetControllerInput(npc,&local_d4,0.0); local_c4 = pVVar3->x; local_c8 = (byte *)pVVar3->y; } uVar4 = Random(); local_cc = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_cc = local_cc + local_cc; local_d4.y = cos(local_cc); fVar9 = sin(local_cc); fVar8 = npc->_speedMultiplier; (npc->_velocity).y = (fVar9 + fVar9 + (float)local_c8) * 0.15 * fVar8 + (npc->_velocity).y; (npc->_velocity).x = (local_d4.y + local_d4.y + local_c4) * 0.15 * fVar8 + (npc->_velocity).x; } goto LAB_00548a4b; } uVar4 = npc->_initSeed; local_c4 = 2.10195e-44; local_d4.y = (float)&npc->_sprite; uStack_ec = 2; uStack_e8 = 5; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> 2 ^ uVar4; uVar4 = uVar4 << 5 ^ uVar4; uVar4 = uVar4 >> 0xf ^ uVar4; local_c8 = (&PTR_DAT_00b614c0)[uVar4 % 6]; pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_005489d8: bVar2 = ANM2::SetAnimation(&npc->_sprite,local_c8,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } expectedName = local_c8; do { bVar2 = *pbVar5; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_005489b8: uVar6 = -(uint)isLess | 1; goto LAB_005489bd; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_005489b8; pbVar5 = pbVar5 + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar6 = 0; LAB_005489bd: if ((uVar6 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_005489d8; } npc->_state = 4; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> ((byte)uStack_ec & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)uStack_e8 & 0x1f) ^ uVar4; (npc->_sprite)._flipX = ~((byte)(uVar4 >> (SUB41(local_c4,0) & 0x1f)) ^ (byte)uVar4) & 1; npc->_isKillOnTouch = 1; LAB_00548a4b: bVar2 = Entity::IsFrame((Entity *)npc,10,0); if (bVar2 != 0) { uVar4 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.4); } bVar2 = Entity::IsFrame((Entity *)npc,6,0); local_f0 = 0.3; uStack_ec = 0; uStack_e8 = 0; uStack_e4 = 0; unused = extraout_ECX; if (bVar2 != 0) { uVar4 = Random(); local_d4.y = (npc->_velocity).x; local_cc = (npc->_velocity).y; uVar6 = Random(); fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c8 = (byte *)(fVar8 + fVar8); uVar6 = Random(); local_c4 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar8 = cos((float)local_c8); local_d4.x = fVar8 * local_c4 * 3.0 + local_d4.y * local_f0; fVar8 = sin((float)local_c8); local_d4.y = fVar8 * local_c4 * 3.0 + local_cc * local_f0; pEVar7 = Game::Spawn(g_game,1000,0x6f,&npc->_pos,&local_d4,(Entity *)0x0,0,uVar4); uVar4 = Random(); (pEVar7->_sprite)._playbackSpeed = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.5; local_cc = npc->_scale * g_vectorOne.y; local_d4.y = npc->_scale * g_vectorOne.x; uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.6; (pEVar7->_sprite)._scale.x = local_d4.y * 0.5 * fVar8; (pEVar7->_sprite)._scale.y = local_cc * 0.5 * fVar8; (pEVar7->_posOffset).x = 0.0; (pEVar7->_posOffset).y = -22.0; pEVar7->_renderZOffset = -400; unused = extraout_ECX_00; } if ((npc->_controllerID != -1) && (bVar2 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,unused), bVar2 != 0)) { sourceRef = 0; local_114 = 0; local_110 = 0; local_10c = 0; local_108 = g_vectorZero.x; local_104 = g_vectorZero.y; local_100 = g_vectorZero.x; local_fc = g_vectorZero.y; local_f8 = 0; local_f4 = 0; (**(code **)(*(int *)npc + 0x24))(&sourceRef); } if ((npc->_dead != 0) && ((npc->_flags & 0x1000000) == 0)) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_c8 = (byte *)(pEVar7->_velocity).x; fVar8 = (npc->_pos).y - (pEVar7->_pos).y; local_c4 = (pEVar7->_velocity).y; fVar9 = (npc->_pos).x - (pEVar7->_pos).x; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); local_c8 = (byte *)(((float)local_c8 * 0.1 * fVar8 + (pEVar7->_pos).x) - (npc->_pos).x); local_c4 = (local_c4 * 0.1 * fVar8 + (pEVar7->_pos).y) - (npc->_pos).y; fVar8 = sqrtf(local_c4 * local_c4 + (float)local_c8 * (float)local_c8); if (fVar8 <= 0.0) { pbVar5 = local_c8; fVar8 = local_c4; } else { pbVar5 = (byte *)((float)local_c8 * (1.0 / fVar8)); fVar8 = local_c4 * (1.0 / fVar8); } local_d4.x = (float)pbVar5 * 10.0; local_d4.y = fVar8 * 10.0; ProjectileParams::ProjectileParams(&projParams); projParams.Color._offset[2] = 0.0; projParams.Color._tint[0] = 1.0; projParams.Color._tint[1] = 1.0; projParams.Color._tint[2] = 1.0; projParams.Color._tint[3] = 1.0; projParams.Color._offset._0_8_ = ZEXT48((uint)local_f0); projParams.Color._colorize[0] = 0.0; projParams.Color._colorize[1] = 0.0; projParams.Color._colorize[2] = 0.0; projParams.Color._colorize[3] = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_d4,0,&projParams); } return; } //@@ 00548f30 Entity_NPC::FindTargetPit /* ZHL [exact] static int Entity_NPC::FindTargetPit(Vector* Pos1, Vector* Pos2, unsigned int PitIndex); */ uint Entity_NPC::FindTargetPit(float *param_1,float *param_2,uint param_3) { uint uVar1; int index; int iVar2; int gridWidth; int row; float pitX; float pos2Distance; float pitY; uint bestIndex; uint gridIndex; float bestScore; short *gridPath; void **gridEntitySlot; float score; void *gridEntity; Room *room; room = g_game->_room; bestIndex = 0xffffffff; bestScore = -1e+06; gridWidth = room->_gridWidth; gridIndex = 0; if (gridWidth * room->_gridHeight < 1) { return 0xffffffff; } gridPath = (short *)&room->field_0xe6c; gridEntitySlot = room->_gridEntities; do { if ((((gridIndex < 0x1c0) && (gridEntity = *gridEntitySlot, gridEntity != (void *)0x0)) && (*(int *)((int)gridEntity + 4) == 7)) && ((*(int *)((int)gridEntity + 0xc) == 0 && (*gridPath == 0)))) { iVar2 = *(int *)((int)g_game->_room + 0xc); pitX = (float)(*(int *)((int)gridEntity + 0x24) % iVar2) * 40.0 + 40.0; pitY = (float)(*(int *)((int)gridEntity + 0x24) / iVar2) * 40.0 + 120.0; pos2Distance = sqrtf((param_2[1] - pitY) * (param_2[1] - pitY) + (*param_2 - pitX) * (*param_2 - pitX)); score = sqrtf((param_1[1] - pitY) * (param_1[1] - pitY) + (*param_1 - pitX) * (*param_1 - pitX)); score = 2000.0 - score; if (-1 < (int)param_3) { if (pos2Distance < 60.0) goto LAB_0054926c; score = score - pos2Distance * 3.0; if (param_3 == gridIndex) { score = score - 2000.0; } iVar2 = (int)(((pitX + 40.0) - 40.0) / 40.0 + 0.5); row = (int)(((pitY + 0.0) - 120.0) / 40.0 + 0.5); if (((iVar2 < 0) || (gridWidth <= iVar2)) || ((row < 0 || (room->_gridHeight <= row)))) { gridWidth = room->_gridWidth; iVar2 = -1; } else { iVar2 = gridWidth * row + iVar2; } uVar1 = Room::GetGridCollision(room,iVar2); if (uVar1 == 1) { iVar2 = (int)(((pitX - 40.0) - 40.0) / 40.0 + 0.5); if ((((iVar2 < 0) || (gridWidth <= iVar2)) || (row < 0)) || (room->_gridHeight <= row)) { iVar2 = -1; } else { iVar2 = iVar2 + row * gridWidth; } uVar1 = Room::GetGridCollision(room,iVar2); if (uVar1 == 1) { iVar2 = (int)(((pitX + 0.0) - 40.0) / 40.0 + 0.5); row = (int)(((pitY + 40.0) - 120.0) / 40.0 + 0.5); if (((iVar2 < 0) || (gridWidth <= iVar2)) || ((row < 0 || (room->_gridHeight <= row)))) { index = -1; } else { index = row * gridWidth + iVar2; } uVar1 = Room::GetGridCollision(room,index); if (uVar1 == 1) { if (((iVar2 < 0) || (gridWidth <= iVar2)) || ((row < 0 || (room->_gridHeight <= row))) ) { iVar2 = -1; } else { iVar2 = iVar2 + row * gridWidth; } uVar1 = Room::GetGridCollision(room,iVar2); if (uVar1 == 1) { score = score + 200.0; } } } } uVar1 = Random(); score = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 500.0 + score; } if (bestScore < score) { bestIndex = gridIndex; bestScore = score; } } LAB_0054926c: gridWidth = room->_gridWidth; gridIndex = gridIndex + 1; gridEntitySlot = gridEntitySlot + 1; gridPath = gridPath + 1; if (gridWidth * room->_gridHeight <= (int)gridIndex) { return bestIndex; } } while( true ); } //@@ 005492c0 NpcAI::ENTITY_MR_MINE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: type 311; was Entity_Familiar::Render (ICF); strs DigIn/DigOut/Shoot */ void __fastcall NpcAI::ENTITY_MR_MINE(Entity_NPC *npc) { undefined4 uVar1; byte bVar2; uint uVar3; Entity *pEVar4; int iVar5; byte *curAnimChar; Vector *pVVar6; Vector *targetPos; float *layerFrame; Entity_NPC *parentNpc; LayerState *layer; char *wantedAnimChar; int iVar7; Room *room; bool bVar8; float fVar9; float fVar10; float fVar11; double dVar12; undefined1 auStack_174 [56]; float local_13c; undefined4 *local_138; float local_134; Vector local_130; Vector local_128; Vector local_120; EntityRef sourceRef; ProjectileParams projectileParams; uint local_44; byte *animData; int newCooldown; EntityPtr parent; void *pitGrid; local_44 = __security_cookie ^ (uint)auStack_174; iVar5 = npc->_state; local_130.x = (float)g_game->_room; uVar3 = npc->_variant; if (iVar5 != 0) { if (9 < uVar3) { if (uVar3 != 10) { return; } parent = npc->_parent; if ((parent != (EntityPtr)0x0) && (*(int *)((int)parent + 0x28) == 0x137)) { layerFrame = ANM2::GetLayerFrame((ANM2 *)((int)parent + 0x48),1); if ((layerFrame == (float *)0x0) || (*(char *)(layerFrame + 3) == '\0')) { parentNpc = Entity_NPC::ParentNPC(npc); (npc->_pos).x = (parentNpc->_targetPosition).x; (npc->_pos).y = (parentNpc->_targetPosition).y; npc->_visible = 0; return; } local_128.x = *layerFrame / 0.65; local_13c = layerFrame[1]; fVar9 = (npc->_v1).x; npc->_visible = 1; local_138 = (undefined4 *)((7.0 - fVar9) * 0.125); parentNpc = Entity_NPC::ParentNPC(npc); local_134 = (parentNpc->_pos).x; local_130.x = (parentNpc->_pos).y; parentNpc = Entity_NPC::ParentNPC(npc); local_134 = (local_134 + local_128.x) - (parentNpc->_targetPosition).x; local_130.x = (local_130.x + 0.0) - (parentNpc->_targetPosition).y; parentNpc = Entity_NPC::ParentNPC(npc); fVar9 = (parentNpc->_targetPosition).x; fVar10 = (npc->_pos).x; (npc->_velocity).y = ((float)local_138 * local_130.x + (parentNpc->_targetPosition).y) - (npc->_pos).y; (npc->_velocity).x = ((float)local_138 * local_134 + fVar9) - fVar10; local_13c = local_13c / 0.65 - 14.0; (npc->_posOffset).y = local_13c * (float)local_138 + 14.0; local_128.x = (1.0 - (float)local_138) * -1000.0; dVar12 = floor((double)local_128.x); local_128.x = (float)dVar12; iVar5 = thunk_FUN_00af0780(); npc->_renderZOffset = iVar5; fVar9 = sqrtf(local_13c * local_13c + local_130.x * local_130.x + local_134 * local_134); local_128.x = fVar9 * (float)local_138 * 0.025; if (local_128.x <= 0.0) { local_128.x = 0.0; } if (1.0 <= local_128.x) { local_128.x = 1.0; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = local_128.x; return; } goto LAB_00549753; } if (npc->_dead != 0) { if ((npc->_flags & 0x1000000) == 0) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.CircleAngle = 0.0; local_128.x = 8.0; local_128.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_128,9,&projectileParams); Entity_NPC::PlaySound(npc,0x92,1.0,2,0,1.0); return; } return; } if (((*(char *)local_130.x != '\0') && (g_game->_frameCount == ((Room *)local_130.x)->_enterFrame)) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar2 != 0)) { npc->_state = 3; ANM2::Play(&npc->_sprite,(byte *)"DigIn",0); Sprite::SetLastFrame((Sprite *)&npc->_sprite); iVar5 = npc->_state; npc->_i1 = -1; npc->_i2 = -1; npc->_entityCollisionClass = 0; } iVar7 = npc->_projectileCooldown; if (0 < iVar7) { newCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar7; iVar7 = 0; if (0 < newCooldown) { iVar7 = newCooldown; } npc->_projectileCooldown = iVar7; } if (iVar5 == 3) { uVar3 = npc->_i1; if ((int)uVar3 < 0) { LAB_00549638: iVar5 = npc->_i2; pVVar6 = Entity_NPC::CalcTargetPosition(npc,&local_120,0.0); uVar3 = Entity_NPC::FindTargetPit(&npc->_pos,pVVar6,iVar5); npc->_i1 = uVar3; if ((int)uVar3 < 0) { iVar5 = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_stateFrame = iVar5; if ((0x1e < iVar5) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar2 == 0)) { LAB_00549753: (**(code **)(*(int *)npc + 0x28))(); return; } goto LAB_00549e64; } } else { if (((0x1bf < uVar3) || (pitGrid = ((void **)((int)local_130.x + 0x24))[uVar3], pitGrid == (void *)0x0)) || ((*(int *)((int)pitGrid + 4) != 7 || (*(int *)((int)pitGrid + 0x3c) != 1)))) { npc->_i1 = -1; goto LAB_00549638; } if ((int)uVar3 < 0) goto LAB_00549638; } room = (Room *)local_130.x; npc->_stateFrame = 0; fVar10 = (float)((int)uVar3 % *(int *)((int)local_130.x + 0xc)) * 40.0 + 40.0; fVar9 = (float)((int)uVar3 / *(int *)((int)local_130.x + 0xc)) * 40.0 + 120.0; (npc->_targetPosition).x = fVar10; (npc->_pos).x = fVar10; (npc->_targetPosition).y = fVar9; (npc->_pos).y = fVar9; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; npc->_state = 6; ANM2::Play(&npc->_sprite,(byte *)"DigOut",0); npc->_i2 = npc->_i1; } else if (iVar5 == 6) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); room = (Room *)local_130.x; if (bVar2 != 0) { npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); if ((0.0 < *(float *)((int)local_130.x + 0x7240)) || ((*(uint *)((int)*(void **)((int)local_130.x + 4) + 0x44) >> 5 & 1) != 0)) { uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,99,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3,0); fVar9 = g_vectorOne.y * 1.5; iVar5 = *(int *)pEVar4; (pEVar4->_sprite)._scale.x = g_vectorOne.x * 1.5; (pEVar4->_sprite)._scale.y = fVar9; (**(code **)(iVar5 + 0xc))(); uVar3 = Random(); for (iVar5 = uVar3 % 6 + 4; iVar5 != 0; iVar5 = iVar5 + -1) { uVar3 = Random(); local_13c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_13c = local_13c + local_13c; uVar3 = Random(); local_134 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; fVar9 = cos(local_13c); local_138 = (undefined4 *)(fVar9 * local_134 * 4.0); local_128.x = (float)local_138; fVar9 = sin(local_13c); local_13c = fVar9 * local_134 * 4.0; local_128.y = local_13c; uVar3 = Random(); local_130.x = (float)local_138 + (npc->_pos).x; local_130.y = local_13c + (npc->_pos).y; pEVar4 = Game::SpawnEx(g_game,1000,99,&local_130,&local_128,(Entity *)npc,1,uVar3,0); (**(code **)(*(int *)pEVar4 + 0xc))(); } } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_projectileCooldown = 0xc; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 4; npc->_stateFrame = 0; } } else if (iVar5 == 7) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); room = (Room *)local_130.x; if (bVar2 != 0) { npc->_entityCollisionClass = 0; npc->_shadowSize = 0.0; if ((0.0 < *(float *)((int)local_130.x + 0x7240)) || ((*(uint *)((int)*(void **)((int)local_130.x + 4) + 0x44) >> 5 & 1) != 0)) { uVar3 = Random(); iVar5 = uVar3 % 6 + 4; if (iVar5 != 0) { do { uVar3 = Random(); local_13c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_13c = local_13c + local_13c; uVar3 = Random(); local_134 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10; fVar9 = cos(local_13c); local_138 = (undefined4 *)(fVar9 * local_134 * 4.0); local_128.x = (float)local_138; fVar9 = sin(local_13c); local_13c = fVar9 * local_134 * 4.0; local_128.y = local_13c; uVar3 = Random(); local_120.x = (float)local_138 + (npc->_pos).x; local_120.y = local_13c + (npc->_pos).y; pEVar4 = Game::SpawnEx(g_game,1000,99,&local_120,&local_128,(Entity *)npc,1,uVar3,0); (**(code **)(*(int *)pEVar4 + 0xc))(); uVar3 = Random(); fVar10 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 + 1.0; fVar9 = fVar10 * g_vectorOne.x; (pEVar4->_sprite)._scale.y = fVar10 * g_vectorOne.y; (pEVar4->_sprite)._scale.x = fVar9; iVar5 = iVar5 + -1; } while (iVar5 != 0); room = (Room *)local_130.x; } } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; } } else { if (iVar5 == 4) { if (0 < iVar7) { iVar7 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar7; iVar5 = 0; if (0 < iVar7) { iVar5 = iVar7; } npc->_projectileCooldown = iVar5; } pEVar4 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (npc->_pos).x; pVVar6 = &npc->_pos; (npc->_sprite)._flipX = (pEVar4->_pos).x <= fVar9 && fVar9 != (pEVar4->_pos).x; bVar2 = Entity::IsFrame((Entity *)npc,4,0); if (((bVar2 != 0) && (npc->_projectileCooldown < 1)) && ((npc->_flags & 0x1000a00) == 0)) { pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_138 = (undefined4 *)(pEVar4->_pos).x; local_13c = (pEVar4->_pos).y; pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_134 = ((pEVar4->_velocity).x * 3.0 + (float)local_138) - pVVar6->x; local_13c = ((pEVar4->_velocity).y * 3.0 + local_13c) - (npc->_pos).y; local_138 = (undefined4 *)(local_13c * local_13c + local_134 * local_134); if ((float)local_138 < 16900.0) { room = g_game->_room; pEVar4 = Entity_NPC::GetPlayerTarget(npc); local_120.x = (pEVar4->_pos).x; local_120.y = (pEVar4->_pos).y; bVar2 = Room::CheckLine(room,pVVar6,&local_120,2,0,0,0,(Vector *)0x0); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); fVar10 = sqrtf((float)local_138); fVar9 = npc->_friction; (npc->_velocity).y = ((14.0 / fVar10) * local_13c) / fVar9; (npc->_velocity).x = ((14.0 / fVar10) * local_134) / fVar9; (npc->_sprite)._flipX = local_134 < 0.0; npc->_state = 8; npc->_stateFrame = 0; npc->_projectileCooldown = 0x1e; } } } iVar5 = npc->_stateFrame; if (iVar5 < 0x10) { LAB_00549db8: if ((999 < iVar5) || ((bVar2 = Entity::HasEntityFlags((Entity *)npc,0x20000000), bVar2 != 0 && (uVar3 = Random(), uVar3 % 0x32 == 0)))) goto LAB_00549de3; } else { uVar3 = Random(); if (uVar3 % 0x1e != 0) { iVar5 = npc->_stateFrame; goto LAB_00549db8; } LAB_00549de3: iVar5 = npc->_i1; targetPos = Entity_NPC::CalcTargetPosition(npc,&local_120,0.0); iVar5 = Entity_NPC::FindTargetPit(pVVar6,targetPos,iVar5); if (-1 < iVar5) { npc->_i1 = iVar5; npc->_stateFrame = 0; ANM2::Play(&npc->_sprite,(byte *)"DigIn",0); npc->_state = 7; } } if ((0 < npc->_stateFrame) || (0.0 < npc->_pendingDamage)) { npc->_stateFrame = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + npc->_stateFrame; } } else if (iVar5 == 8) { local_13c = (npc->_targetPosition).y - (npc->_pos).y; local_138 = (undefined4 *)((npc->_targetPosition).x - (npc->_pos).x); fVar9 = sqrtf(local_13c * local_13c + (float)local_138 * (float)local_138); if ((5.0 <= fVar9) || (0xe < iVar7)) { fVar10 = npc->_friction; if (fVar10 != 0.0) { fVar11 = npc->_speedMultiplier; (npc->_velocity).x = ((float)local_138 * (0.7 / fVar9) * fVar11) / fVar10 + (npc->_velocity).x; (npc->_velocity).y = (local_13c * (0.7 / fVar9) * fVar11) / fVar10 + (npc->_velocity).y; iVar7 = npc->_projectileCooldown; fVar10 = npc->_friction; } fVar9 = npc->_speedMultiplier; fVar11 = (float)iVar7 * 0.0028 + 0.9; if (fVar9 != 1.0) { fVar11 = fVar11 / ((fVar11 + fVar9) - fVar11 * fVar9); } npc->_friction = fVar10 * fVar11; } else { uVar3 = Random(); iVar7 = npc->_projectileCooldown; npc->_state = 4; npc->_stateFrame = -(uint)(uVar3 % 5 != 0) & 1000; } npc->_projectileCooldown = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar7; room = (Room *)local_130.x; goto LAB_00549e6d; } LAB_00549e64: room = (Room *)local_130.x; } LAB_00549e6d: if ((npc->_state != 8) && ((fVar9 = (npc->_targetPosition).x, fVar9 != g_vectorZero.x || ((npc->_targetPosition).y != g_vectorZero.y)))) { fVar10 = (npc->_targetPosition).y; fVar11 = (npc->_pos).y; (npc->_velocity).x = fVar9 - (npc->_pos).x; (npc->_velocity).y = fVar10 - fVar11; } uVar3 = npc->_i1; if ((((-1 < (int)uVar3) && (npc->_state != 3)) && (uVar3 < 0x1c0)) && ((room->_gridEntities[uVar3] != (void *)0x0 && (*(int *)((int)room->_gridEntities[uVar3] + 4) == 7)))) { *(undefined2 *)((int)room->_gridPaths + uVar3 * 2 + 0x700) = 5; } if (((npc->_entityCollisionClass == 0) || (((npc->_targetPosition).x == g_vectorZero.x && ((npc->_targetPosition).y == g_vectorZero.y) ))) || (iVar5 = Room::GetGridCollisionAtPos(room,npc->_targetPosition), iVar5 == 1)) { return; } EntityRef::EntityRef(&sourceRef); (**(code **)(*(int *)npc + 0x24))(); return; } if (9 < uVar3) goto LAB_0054949f; local_13c = (float)0; do { uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,0x137,10,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar3,0); iVar5 = __RTDynamicCast(pEVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor); if (*(int *)(iVar5 + 0x3bc) != 0) { local_138 = (undefined4 *)(iVar5 + 0x3bc); std::multiset::erase(); } *(undefined4 *)(iVar5 + 0x3bc) = npc; std::multiset::insert(); *(undefined4 *)(iVar5 + 0x188) = 0; iVar7 = (int)local_13c + 1; *(undefined4 *)(iVar5 + 0x15c) = 0; *(undefined4 *)(iVar5 + 0x354) = 0xffffff9c; *(uint *)(iVar5 + 0x168) = *(uint *)(iVar5 + 0x168) & 0xfffffffb | 0x40000; *(undefined4 *)(iVar5 + 0x16c) = *(undefined4 *)(iVar5 + 0x16c); *(undefined1 *)(iVar5 + 0x171) = 0; *(float *)(iVar5 + 0xbb0) = (float)(int)local_13c; local_13c = (float)iVar7; } while (iVar7 < 8); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; uVar1 = *(undefined4 *)((int)&npc->_flags + 4); npc->_entityCollisionClass = 0; npc->_i1 = -1; npc->_i2 = -1; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00549467: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"DigIn",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } wantedAnimChar = "DigIn"; do { bVar2 = *curAnimChar; bVar8 = bVar2 < (byte)*wantedAnimChar; if (bVar2 != *wantedAnimChar) { LAB_00549451: uVar3 = -(uint)bVar8 | 1; goto LAB_00549456; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; bVar8 = bVar2 < (byte)wantedAnimChar[1]; if (bVar2 != wantedAnimChar[1]) goto LAB_00549451; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00549456: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00549467; } if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(npc->_sprite)._animState, *(int *)((int)(npc->_sprite)._animState._animData + 0x30) + -1); } LAB_0054949f: npc->_state = 3; return; } //@@ 0054a350 NpcAI::ENTITY_SKINNY_crispy /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from NpcAI::ENTITY_SKINNY when type 0xe2 variant 2 (Crispy); strs HeadAngry/HeadTransition/WalkHori/WalkVert */ void __fastcall NpcAI::ENTITY_SKINNY_crispy(Entity_NPC *npc) { byte bVar1; uint uVar2; byte *pbVar3; byte *pbVar4; uint uVar5; Entity *target; Vector *vecResult; Entity_Effect *splat; LayerState *layer; byte *expectedName; char *pcVar6; void *pvVar7; bool isLess; float fVar8; float fVar9; int pathMarker; ColorMod burnColor; Vector local_80; Vector local_78; Vector local_70; float burnLevel; void *walkHoriAnim; char local_60 [12]; uint walkHoriAnimSize; uint walkHoriAnimCapacity; undefined4 sourceRef; undefined4 local_48; undefined4 local_44; undefined4 local_40; void *local_3c; float local_38; float local_34; float local_30; uint local_2c; uint local_28; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ColorMod *splatColor; pvVar7 = ExceptionList; puStack_20 = local_60 + 0x5c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4a15; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_60 + 0x50); ExceptionList = &local_1c; stackCookie = uVar2; if (npc->_state == 0) { npc->_state = 4; pbVar4 = (npc->_sprite)._overlayAnimState._animData; if (pbVar4 != (byte *)0x0) { pbVar3 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar3 = *(byte **)pbVar4; } expectedName = s_Head; do { bVar1 = *pbVar3; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0054a3e3: uVar2 = -(uint)isLess | 1; goto LAB_0054a3e8; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0054a3e3; pbVar3 = pbVar3 + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0054a3e8: if (uVar2 == 0) { if (pbVar4[0x34] == 0) { ExceptionList = pvVar7; return; } if ((npc->_sprite)._overlayAnimState._isPlaying != 0) { ExceptionList = pvVar7; return; } } } puStack_20 = local_60 + 0x5c; bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,s_Head,1); if (bVar1 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; ExceptionList = local_1c; return; } fVar8 = npc->_maxHitPoints; fVar9 = npc->_health; local_78.y = fVar8 * 0.4; burnLevel = fVar8 * 0.9; local_70.y = fVar9; pcVar6 = local_60 + 0x5c; if (local_78.y == burnLevel) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar9 = npc->_health; fVar8 = npc->_maxHitPoints; pcVar6 = puStack_20; } puStack_20 = pcVar6; burnLevel = (local_70.y - local_78.y) / (burnLevel - local_78.y); if (burnLevel <= 0.0) { burnLevel = 0.0; } if (1.0 <= burnLevel) { burnLevel = 1.0; } burnLevel = 1.0 - burnLevel; local_78.y = burnLevel * 0.5 + 0.6; if (fVar9 < fVar8 * 0.5) { if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { if ((npc->_sprite)._overlayAnimState._isPlaying != 0) { pbVar4 = (npc->_sprite)._overlayAnimState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pbVar3 = s_Head; do { bVar1 = *pbVar4; isLess = bVar1 < *pbVar3; if (bVar1 != *pbVar3) { LAB_0054a540: uVar5 = -(uint)isLess | 1; goto LAB_0054a545; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < pbVar3[1]; if (bVar1 != pbVar3[1]) goto LAB_0054a540; pbVar4 = pbVar4 + 2; pbVar3 = pbVar3 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_0054a545: if (uVar5 == 0) { pbVar4 = (npc->_sprite)._overlayAnimState._animData; if (pbVar4 != (byte *)0x0) { pbVar3 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar3 = *(byte **)pbVar4; } pcVar6 = "HeadTransition"; do { bVar1 = *pbVar3; isLess = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_0054a582: uVar5 = -(uint)isLess | 1; goto LAB_0054a587; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; isLess = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_0054a582; pbVar3 = pbVar3 + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_0054a587: if ((uVar5 == 0) && ((pbVar4[0x34] == 0 || ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) goto LAB_0054a5be; } bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadTransition",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } } LAB_0054a5be: if (((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && ((npc->_sprite)._overlayAnimState._isPlaying != 0)) goto LAB_0054a64c; } pbVar4 = (npc->_sprite)._overlayAnimState._animData; if (pbVar4 != (byte *)0x0) { pbVar3 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar3 = *(byte **)pbVar4; } pcVar6 = "HeadAngry"; do { bVar1 = *pbVar3; isLess = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_0054a610: uVar5 = -(uint)isLess | 1; goto LAB_0054a615; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; isLess = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_0054a610; pbVar3 = pbVar3 + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_0054a615: if ((uVar5 == 0) && ((pbVar4[0x34] == 0 || ((npc->_sprite)._overlayAnimState._isPlaying != 0)))) goto LAB_0054a64c; } bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadAngry",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } LAB_0054a64c: if (npc->_state == 4) { bVar1 = Entity::IsFrame((Entity *)npc,0x14,npc->_index); if ((bVar1 != 0) && (uVar5 = Random(), uVar5 % 3 == 0)) { Entity_NPC::PlaySound(npc,0xa7,0.8,0x78,0,1.0); } target = Entity_NPC::GetPlayerTarget(npc); Entity_NPC::CalcTargetPosition(npc,&local_70,0.0); local_80.x = (local_70.x + (target->_velocity).x * 10.0) - (npc->_pos).x; local_80.y = (local_70.y + (target->_velocity).y * 10.0) - (npc->_pos).y; if (npc->_controllerID == -1) { bVar1 = Room::CheckLine(g_game->_room,&npc->_pos,&local_70,0,0,0,0,(Vector *)0x0); if (bVar1 == 0) { bVar1 = 1; pathMarker = 900; fVar8 = local_78.y; vecResult = Entity_NPC::CalcTargetPosition(npc,&local_80,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,vecResult,fVar8,pathMarker,bVar1); } else { vecResult = Vector::Normalized(&local_80,&local_78); fVar8 = npc->_speedMultiplier; fVar9 = vecResult->y; (npc->_velocity).x = vecResult->x * 0.65 * fVar8 + (npc->_velocity).x; (npc->_velocity).y = fVar9 * 0.65 * fVar8 + (npc->_velocity).y; } } else { vecResult = Entity_NPC::GetControllerInput(npc,&local_80,0.0); fVar8 = npc->_speedMultiplier; fVar9 = vecResult->y; (npc->_velocity).x = vecResult->x * 0.65 * fVar8 + (npc->_velocity).x; (npc->_velocity).y = fVar9 * 0.65 * fVar8 + (npc->_velocity).y; } uVar5 = Random(); if ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 < burnLevel * 0.2) { uVar5 = Random(); local_78.y = -15.0 - (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 15.0; uVar5 = Random(); local_70.y = local_78.y + (npc->_pos).y; local_70.x = ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 16.0 - 8.0) + (npc->_pos).x; uVar5 = Random(); local_78.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * -1.6 - 0.8; uVar5 = Random(); local_80.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.4 - 0.2; local_80.y = local_78.y; uVar5 = Random(); Game::Spawn(g_game,1000,0x42,&local_70,&local_80,(Entity *)npc,0,uVar5); } local_28 = 0xf; local_2c = 8; local_3c = (void *)0x6b6c6157; local_38 = (float)0x74726556; local_34 = (float)((uint)local_34 & 0xffffff00); walkHoriAnimCapacity = 0xf; walkHoriAnimSize = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_60,"Hori",5); local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&local_3c,0.1); local_14 = local_14 & 0xffffff00; if (0xf < walkHoriAnimCapacity) { uVar5 = walkHoriAnimCapacity + 1; pvVar7 = walkHoriAnim; if (0xfff < uVar5) { pvVar7 = *(void **)((int)walkHoriAnim + -4); uVar5 = walkHoriAnimCapacity + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)pvVar7))) goto LAB_0054aa5b; } operator_delete(pvVar7,uVar5); } local_14 = 0xffffffff; walkHoriAnimSize = 0; walkHoriAnimCapacity = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < local_28) { uVar5 = local_28 + 1; pvVar7 = local_3c; if (0xfff < uVar5) { pvVar7 = *(void **)((int)local_3c + -4); uVar5 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar7))) { LAB_0054aa5b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } splatColor = &npc->_splatColor; burnColor._offset[0] = 0.0; burnColor._offset[1] = 0.0; burnColor._offset[2] = 0.0; burnColor._tint[0] = 1.0 - burnLevel * 0.9; burnColor._tint[3] = 1.0; burnColor._tint[1] = 1.0 - burnLevel * 0.8; if (splatColor != &burnColor) { (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; splatColor->_tint[0] = burnColor._tint[0]; (npc->_splatColor)._tint[1] = burnColor._tint[1]; (npc->_splatColor)._tint[2] = burnColor._tint[1]; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._offset[2] = 0.0; } burnColor._tint[2] = burnColor._tint[1]; bVar1 = Entity::IsFrame((Entity *)npc,2,npc->_index); if ((bVar1 != 0) && (uVar5 = Random(), uVar5 % 5 == 0)) { uVar5 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.4); (**(code **)(*(int *)splat + 0x3c))(splatColor,0xffffffff,0xff,0,1); } } bVar1 = Entity::IsFrame((Entity *)npc,0x1e,(uint)npc->_initSeed % 0x1e); if (bVar1 != 0) { sourceRef = 0; local_48 = 0; local_44 = 0; local_40 = 0; local_3c = (void *)g_vectorZero.x; local_38 = g_vectorZero.y; local_34 = g_vectorZero.x; local_30 = g_vectorZero.y; local_2c = 0; local_28 = 0; (**(code **)(*(int *)npc + 0x20))(0x3f800000,0,0,&sourceRef,0x1e,uVar2); } local_78.y = 1.0 - burnLevel; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (layer->_color)._tint[3] = local_78.y; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = 1.0; (layer->_color)._tint[0] = 1.0 - burnLevel * 0.9; fVar8 = 1.0 - burnLevel * 0.8; (layer->_color)._tint[1] = fVar8; (layer->_color)._tint[2] = fVar8; if ((0.3 < burnLevel) && (npc->_collidesWithGrid != 0)) { local_70.y = (npc->_velocity).x; local_78.y = (npc->_velocity).y; fVar8 = sqrtf(local_70.y * local_70.y + local_78.y * local_78.y); if (0.0 < fVar8) { local_70.y = (1.0 / fVar8) * local_70.y; (npc->_velocity).y = (1.0 / fVar8) * local_78.y; (npc->_velocity).x = local_70.y; } fVar8 = (npc->_gridCollisionVelocity).y; fVar9 = (npc->_gridCollisionVelocity).x; fVar8 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8); (npc->_velocity).x = local_70.y * fVar8; (npc->_velocity).y = fVar8 * (npc->_velocity).y; } npc->_friction = (burnLevel * 0.15 + 0.8) * npc->_friction; ExceptionList = local_1c; return; } //@@ 0054ad80 NpcAI::ENTITY_ARMYFLY /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 868 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ARMYFLY(Entity_NPC *npc) { undefined4 *puVar1; EntityPtr EVar2; Vector pos; Vector pos_00; Vector pos_01; Vector pos_02; Vector pos_03; bool bVar3; byte bVar4; uint uVar5; Entity_Player *player; EntityPtr segment; Entity_NPC *childNpc; int iVar6; uint uVar7; Entity *target; Vector *dirVec; int iVar8; void *listData; PlayerManager *playerManager; float fVar9; EntityPtr nextSegment; int gridX; int extraout_EDX; Room *room; bool bVar10; EntityPtr *childNpc; float fVar12; undefined1 local_38 [12]; float local_2c; Vector local_28; EntityPtr local_20; EntityPtr *local_1c; float local_18; Room *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 childGroupIdx; bool isChainFree; EntityPtr *parentChildSlot; local_8 = 0xffffffff; puStack_c = &LAB_00af4a55; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_38 + 0x34); ExceptionList = &local_10; local_14 = g_game->_room; playerManager = &g_game->_playerManager; npc->_friction = npc->_friction * 0.8; player = PlayerManager::FirstCollectibleOwner(playerManager,9,(RNG **)playerManager,1); if ((player != (Entity_Player *)0x0) && ((npc->_flags & 0x20000000) == 0)) { Entity_NPC::Morph(npc,0xd,0,0,-1); fVar9 = g_vectorZero.x; (npc->_v2).x = g_vectorZero.x; fVar12 = g_vectorZero.y; (npc->_v2).y = g_vectorZero.y; (npc->_v1).x = fVar9; (npc->_v1).y = fVar12; ExceptionList = local_10; return; } player = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); if ((player != (Entity_Player *)0x0) && (npc->_dead == 0)) { award_fly_kill_points(&g_game->_scoreSheet,(Entity *)npc); (**(code **)(*(int *)npc + 0x28))(); Entity_Player::AddBlueFlies(player,1,&npc->_pos,(Entity *)0x0); ExceptionList = local_10; return; } if (npc->_controllerID != -1) { if (npc->_parent == (EntityPtr)0x0) { if ((npc->_dead != 0) && (childNpc = Entity_NPC::ChildNPC(npc), childNpc != (Entity_NPC *)0x0) ) { Entity_NPC::ChildNPC(npc); for (segment = (EntityPtr)Entity_NPC::ChildNPC(npc); segment != (EntityPtr)0x0; segment = *(EntityPtr *)((int)segment + 0x3c0)) { if (*(byte *)((int)segment + 0x173) == 0) goto LAB_0054af68; nextSegment = *(EntityPtr *)((int)segment + 0x3c0); if ((nextSegment != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(nextSegment,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } } } } else { segment = (EntityPtr)Entity::GetLastParent((Entity *)npc); if ((segment != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)segment + 0x28) == 1)) || (*(int *)((int)segment + 0x28) - 10U < 0x3de)))) { LAB_0054af68: Entity_NPC::TransferControl(npc,(Entity_NPC *)segment); } } } if (npc->_state == 0) { npc->_groupIdx = npc->_index; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_38,npc->_type, npc->_variant,-1,0,0); local_8 = 0; local_1c = (EntityPtr *)((int)local_2c + -1); if (-1 < (int)local_1c) { listData = (void *)local_38._4_4_; do { childNpc = local_1c; segment = *(EntityPtr *)((int)listData + (int)local_1c * 4); if (((segment != (EntityPtr)npc) && (*(EntityPtr *)((int)segment + 0x3bc) != (EntityPtr)npc) ) && (*(EntityPtr *)((int)segment + 0x3c0) == (EntityPtr)0x0)) { fVar9 = (npc->_pos).y - *(float *)((int)segment + 0x340); fVar12 = (npc->_pos).x - ((Vector *)((int)segment + 0x33c))->x; fVar9 = sqrtf(fVar9 * fVar9 + fVar12 * fVar12); if (fVar9 < 42.0) { isChainFree = true; nextSegment = segment; do { if (!isChainFree) goto LAB_0054b9e4; bVar10 = nextSegment != (EntityPtr)npc; nextSegment = *(EntityPtr *)((int)nextSegment + 0x3bc); bVar3 = false; if (bVar10) { bVar3 = isChainFree; } isChainFree = bVar3; } while (nextSegment != (EntityPtr)0x0); if (isChainFree) { childNpc = &npc->_parent; if (npc->_parent != (EntityPtr)0x0) { local_28.y = (float)childNpc; std::multiset::erase(&local_28.y); } *childNpc = segment; std::multiset::insert(childNpc); childNpc = local_1c; } } LAB_0054b9e4: listData = (void *)local_38._4_4_; } local_1c = (EntityPtr *)&childNpc[-1].field_0x3; } while (-1 < (int)local_1c); } if (local_38[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_38._4_4_,0); } local_8 = 0xffffffff; if (npc->_parent != (EntityPtr)0x0) { iVar6 = __RTDynamicCast(npc->_parent,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } local_20 = npc->_parent; childNpc = (EntityPtr *)((int)local_20 + 0x3c0); if (*(int *)((int)local_20 + 0x3c0) != 0) { local_28.y = (float)childNpc; std::multiset::erase(&local_28.y); } *childNpc = (EntityPtr)npc; std::multiset::insert(childNpc); nextSegment = npc->_parent; segment = (EntityPtr)npc; while (EVar2 = nextSegment, EVar2 != (EntityPtr)0x0) { segment = EVar2; nextSegment = *(EntityPtr *)((int)EVar2 + 0x3bc); } puVar1 = (undefined4 *)((int)segment + 0x20); do { *(undefined4 *)((int)segment + 0xc7c) = *puVar1; nextSegment = *(EntityPtr *)((int)segment + 0x3c0); if ((nextSegment != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(nextSegment,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } segment = *(EntityPtr *)((int)segment + 0x3c0); } while (segment != (EntityPtr)0x0); std::deque::push_back((void *)((int)local_20 + 0xc04),&npc->_pos); } npc->_state = 4; npc->_i1 = -1; npc->_i2 = 10; goto LAB_0054bb27; } if (npc->_state != 4) goto LAB_0054bb27; ANM2::Play(&npc->_sprite,s_Fly,0); Entity_NPC::FollowParentSegment(npc,1,40.0,8.0); childNpc = &npc->_parent; if (npc->_parent != (EntityPtr)0x0) { if ((npc->_flags & 0x220) == 0) goto LAB_0054bb27; parentChildSlot = (EntityPtr *)((int)npc->_parent + 0x3c0); if (*parentChildSlot != (EntityPtr)0x0) { local_1c = parentChildSlot; std::multiset::erase(&local_1c); } *parentChildSlot = (EntityPtr)0x0; if (*childNpc != (EntityPtr)0x0) { local_1c = childNpc; std::multiset::erase(&local_1c); } *childNpc = (EntityPtr)0x0; segment = (EntityPtr)npc; do { *(int *)((int)segment + 0xc7c) = npc->_index; nextSegment = *(EntityPtr *)((int)segment + 0x3c0); if ((nextSegment != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(nextSegment,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } segment = *(EntityPtr *)((int)segment + 0x3c0); } while (segment != (EntityPtr)0x0); if (*childNpc != (EntityPtr)0x0) goto LAB_0054bb27; } if (npc->_i1 < 0) { segment = npc->_child; if (segment == (EntityPtr)0x0) { uVar7 = Random(); } else { local_38._8_4_ = (npc->_pos).x - *(float *)((int)segment + 0x33c); local_2c = (npc->_pos).y - *(float *)((int)segment + 0x340); Random(); iVar6 = vector_to_direction((Vector *)(local_38 + 8)); uVar7 = iVar6 + -1 + extraout_EDX; } npc->_i1 = uVar7 & 3; } if (((npc->_controllerID == -1) && (bVar4 = Entity::IsFrame((Entity *)npc,4,0), bVar4 != 0)) && (uVar7 = Random(), (uVar7 & 7) == 0)) { EntityList::QueryRadius(&local_14->_entityList,(EntityList_EL *)local_38,&npc->_pos,42.0,8); local_8 = 2; fVar9 = 0.0; if (local_2c != 0.0) { iVar6 = npc->_variant; LAB_0054b140: segment = *(EntityPtr *)(local_38._4_4_ + (int)fVar9 * 4); if ((*(int *)((int)segment + 0x28) != npc->_type) || ((iVar6 != -1 && (*(int *)((int)segment + 0x2c) != iVar6)))) goto LAB_0054b175; if ((*(int *)((int)segment + 0xc7c) == npc->_groupIdx) || (*(int *)((int)segment + 0x3c0) != 0)) { iVar6 = npc->_variant; goto LAB_0054b175; } nextSegment = (EntityPtr)npc; do { *(undefined4 *)((int)nextSegment + 0xc7c) = *(undefined4 *)((int)segment + 0xc7c); EVar2 = *(EntityPtr *)((int)nextSegment + 0x3c0); if ((EVar2 != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(EVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } nextSegment = *(EntityPtr *)((int)nextSegment + 0x3c0); } while (nextSegment != (EntityPtr)0x0); childNpc = &npc->_parent; if (npc->_parent != (EntityPtr)0x0) { local_1c = childNpc; std::multiset::erase(&local_1c); } *childNpc = segment; std::multiset::insert(childNpc); if (*(int *)((int)segment + 0x3c0) != 0) { local_1c = (EntityPtr *)((int)segment + 0x3c0); std::multiset::erase(&local_1c); } *(undefined4 *)((int)segment + 0x3c0) = npc; std::multiset::insert((undefined4 *)((int)segment + 0x3c0)); std::deque::_Tidy(); std::deque::push_back((void *)((int)segment + 0xc04),&npc->_pos); } LAB_0054b24d: local_8 = 0xffffffff; if (npc->_parent != (EntityPtr)0x0) { if (local_38[0] == '\0') { local_8 = 3; tracked_alloc(1,(void *)local_38._4_4_,0); local_8 = 0xffffffff; } goto LAB_0054bb27; } if (local_38[0] == '\0') { local_8 = 4; tracked_alloc(1,(void *)local_38._4_4_,0); local_8 = 0xffffffff; } } if (npc->_i2 < 1) { target = Entity_NPC::GetPlayerTarget(npc); local_20 = (EntityPtr)((target->_pos).y - (npc->_pos).y); local_28.y = (target->_pos).x - (npc->_pos).x; fVar9 = sqrtf((float)local_20 * (float)local_20 + local_28.y * local_28.y); if ((fVar9 <= 600.0) && ((npc->_flags & 0x200) == 0)) { uVar7 = Random(); if (uVar7 % 3 == 0) { iVar6 = 3; local_18 = (float)npc->_i1; local_1c = (EntityPtr *)0xc47a0000; do { fVar9 = (float)(npc->_i1 + iVar6 & 0x80000003); if ((int)fVar9 < 0) { fVar9 = (float)(((int)fVar9 - 1U | 0xfffffffc) + 1); } Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)(local_38 + 8),(int)fVar9); fVar12 = (((float)local_38._8_4_ * 40.0 + (npc->_pos).x) - 40.0) / 40.0 + 0.5; gridX = (int)fVar12; iVar8 = (int)(((local_2c * 40.0 + (npc->_pos).y) - 120.0) / 40.0 + 0.5); if ((((gridX < 0) || (local_14->_gridWidth <= gridX)) || (iVar8 < 0)) || (local_14->_gridHeight <= iVar8)) { iVar8 = -1; } else { iVar8 = iVar8 * local_14->_gridWidth + (int)fVar12; } uVar7 = Room::GetGridCollision(local_14,iVar8); if ((uVar7 != 4) && (childNpc = (EntityPtr *) ((float)local_20 * local_2c + local_28.y * (float)local_38._8_4_), (float)local_1c < (float)childNpc)) { local_1c = childNpc; local_18 = fVar9; } iVar6 = iVar6 + 1; } while (iVar6 < 6); if (local_18 != (float)npc->_i1) { npc->_i1 = (int)local_18; uVar7 = Random(); iVar6 = uVar7 % 0xf + 8; goto LAB_0054b2c4; } } goto LAB_0054b2ca; } uVar7 = Random(); if ((uVar7 % 5 != 0) && (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x200), bVar4 == 0)) goto LAB_0054b2ca; uVar7 = npc->_i1 + 1U & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } dirVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_28,uVar7); room = local_14; local_2c = dirVec->y * 40.0 + (npc->_pos).y; local_38._8_4_ = dirVec->x * 40.0 + (npc->_pos).x; pos.y = local_2c; pos.x = (float)local_38._8_4_; iVar6 = Room::GetGridCollisionAtPos(local_14,pos); uVar7 = npc->_i1 + 3U & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } dirVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_28,uVar7); local_2c = dirVec->y * 40.0 + (npc->_pos).y; local_38._8_4_ = dirVec->x * 40.0 + (npc->_pos).x; pos_00.y = local_2c; pos_00.x = (float)local_38._8_4_; local_28.y = (float)Room::GetGridCollisionAtPos(room,pos_00); uVar7 = Random(); if ((((uVar7 & 1) == 0) || (iVar6 == 4)) && ((undefined1 *)local_28.y != &DAT_00000004)) { uVar7 = npc->_i1 + 3; } else { uVar7 = npc->_i1 + 1; } uVar7 = uVar7 & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } npc->_i1 = uVar7; uVar7 = Random(); npc->_i2 = uVar7 % 0xf + 8; } else { iVar6 = npc->_i2 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); LAB_0054b2c4: npc->_i2 = iVar6; LAB_0054b2ca: room = local_14; } if (npc->_controllerID == -1) { uVar7 = npc->_i1; if (uVar7 < 4) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80020) && (_Init_thread_header(&DAT_00c80020), DAT_00c80020 == -1)) { _DAT_00c80024 = &DAT_bf800000; _DAT_00c80028 = 0; uRam00c8002c = 0; puRam00c80030 = &DAT_bf800000; _DAT_00c80034 = 0x3f800000; uRam00c80038 = 0; uRam00c8003c = 0; uRam00c80040 = 0x3f800000; _Init_thread_footer(&DAT_00c80020); } local_18 = *(float *)(&DAT_00c80024 + uVar7 * 8); local_14 = *(Room **)(&DAT_00c80028 + uVar7 * 8); } else { local_18 = g_vectorZero.x; local_14 = (Room *)g_vectorZero.y; } local_38._8_4_ = local_18 * 40.0 + (npc->_pos).x; local_2c = (float)local_14 * 40.0 + (npc->_pos).y; pos_01.y = local_2c; pos_01.x = (float)local_38._8_4_; iVar6 = Room::GetGridCollisionAtPos(room,pos_01); if (iVar6 == 4) { uVar7 = npc->_i1 + 1U & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } dirVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_28,uVar7); local_38._8_4_ = dirVec->x * 40.0 + (npc->_pos).x; local_2c = dirVec->y * 40.0 + (npc->_pos).y; pos_02.y = local_2c; pos_02.x = (float)local_38._8_4_; iVar6 = Room::GetGridCollisionAtPos(room,pos_02); uVar7 = npc->_i1 + 3U & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } dirVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_28,uVar7); local_38._8_4_ = dirVec->x * 40.0 + (npc->_pos).x; local_2c = dirVec->y * 40.0 + (npc->_pos).y; pos_03.y = local_2c; pos_03.x = (float)local_38._8_4_; iVar8 = Room::GetGridCollisionAtPos(room,pos_03); uVar7 = Random(); if ((((uVar7 & 1) == 0) || (iVar6 == 4)) && (iVar8 != 4)) { uVar7 = npc->_i1 + 3; } else { uVar7 = npc->_i1 + 1; } uVar7 = uVar7 & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } npc->_i1 = uVar7; } if ((npc->_flags & 0x200) == 0) { fVar9 = sin(((float)(g_game->_frameCount - npc->_spawnFrame) * 3.1415927) / 10.0); local_28.y = fVar9 * 20.0 * 0.017453292; local_20 = (EntityPtr)cos(local_28.y); fVar9 = sin(local_28.y); fVar12 = (local_18 * (float)local_20 - (float)local_14 * fVar9) * 1.6 * npc->_speedMultiplier; fVar9 = ((float)local_14 * (float)local_20 + local_18 * fVar9) * 1.6 * npc->_speedMultiplier; } else { fVar9 = sin(((float)(g_game->_frameCount - npc->_spawnFrame) * 3.1415927) / 10.0); local_28.y = fVar9 * 40.0 * 0.017453292; local_20 = (EntityPtr)cos(local_28.y); fVar9 = sin(local_28.y); fVar12 = (local_18 * (float)local_20 - (float)local_14 * fVar9) * 1.6 * 0.6 * npc->_speedMultiplier; fVar9 = ((float)local_14 * (float)local_20 + local_18 * fVar9) * 1.6 * 0.6 * npc->_speedMultiplier; } (npc->_velocity).x = fVar12 + (npc->_velocity).x; (npc->_velocity).y = fVar9 + (npc->_velocity).y; } else { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,1.6,0); } LAB_0054bb27: if ((npc->_dead != 0) && (npc->_child != (EntityPtr)0x0)) { iVar6 = __RTDynamicCast(npc->_child,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar5); if (iVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } PathFinder::Reset((PathFinder *)((int)npc->_child + 0x414)); if ((npc->_child != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(npc->_child,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } segment = npc->_child; childGroupIdx = *(undefined4 *)((int)segment + 0xc7c); if ((segment != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(segment,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } for (segment = npc->_child; segment != (EntityPtr)0x0; segment = *(EntityPtr *)((int)segment + 0x3c0)) { *(undefined4 *)((int)segment + 0xc7c) = childGroupIdx; nextSegment = *(EntityPtr *)((int)segment + 0x3c0); if ((nextSegment != (EntityPtr)0x0) && (iVar6 = __RTDynamicCast(nextSegment,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Child invalid downcast\n"); } } } ExceptionList = local_10; return; LAB_0054b175: fVar9 = (float)((int)fVar9 + 1); if ((uint)local_2c <= (uint)fVar9) goto LAB_0054b24d; goto LAB_0054b140; } //@@ 0054bca0 NpcAI::ENTITY_BULB /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 61.5/61.6, from NpcAI::ENTITY_FLY; strs Dash/FlyLit */ void __fastcall NpcAI::ENTITY_BULB(Entity_NPC *npc) { byte isStatusAffected; Entity_Player *player; float fVar1; int iVar2; Vector *dir; float *dashDistPtr; ProjectileParams *params; char *anim; uint uVar3; void *elapsedFrames; int dashFrames; float fVar4; float fVar5; float fVar6; float fVar7; undefined1 splatColor [8]; float fStack_11c; float fStack_118; float local_114; float fStack_110; float fStack_10c; float fStack_108; float local_104; float local_100; float local_fc; Vector normalized; Entity_Player *target; Entity_NPC *local_ec; void *local_e8; Vector local_e4; float local_dc; int *local_d8; float local_d4; Vector scratchVec; bool isAggressive; ProjectileParams projParams; float local_14; uint activeItem; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); local_ec = npc; player = PlayerManager::GetRandomPlayer (&g_game->_playerManager,(int)&g_game->_playerManager,npc->_initSeed); if ((player != (Entity_Player *)0x0) && (npc->_dead == 0)) { EntityRef::constructor((EntityRef *)(splatColor + 4),(Entity *)player); Entity::AddCharmed((Entity *)npc,(EntityRef *)(splatColor + 4),-1,1,0); } player = (Entity_Player *)Entity_NPC::GetPlayerTarget(npc); uVar3 = (uint)npc->_flags; scratchVec.y = *(float *)((int)&npc->_flags + 4); target = player; if ((((uVar3 & 0x100) == 0) && (npc->_forcedTarget == (EntityPtr)0x0)) && (npc->_variant != 6)) { isAggressive = false; if (player->_type == 1) { fVar1 = 0.0; uVar3 = 0; local_d4 = 0.0; local_d8 = &player->_activeDesc[0]._charge; do { activeItem = ((ActiveItemDesc *)(local_d8 + -2))->_item; if (g_game == (Game *)0x0) { if (-1 < (int)activeItem) goto LAB_0054bde5; } else { if ((int)activeItem < 0) { if (((int)activeItem < 0) && (local_e8 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~activeItem < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)local_e8 >> 2)) { iVar2 = **(int **)((int)local_e8 + ~activeItem * 4); } else { iVar2 = 0; } LAB_0054be1e: if (iVar2 != 0) { iVar2 = Entity_Player::GetActiveMaxCharge(player,uVar3); if (0 < iVar2) { iVar2 = Entity_Player::GetActiveMaxCharge(player,uVar3); if (iVar2 == 1) { local_d4 = (float)((int)local_d4 + 1); fVar1 = local_d4; } else { local_d4 = (float)((int)local_d4 + *local_d8); fVar1 = local_d4; } goto LAB_0054be66; } } } else { LAB_0054bde5: player = target; if ((int)activeItem < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) { iVar2 = *(int *)((int)(g_manager->_itemConfig)._collectibles._begin + activeItem * 4); goto LAB_0054be1e; } } fVar1 = local_d4; } LAB_0054be66: uVar3 = uVar3 + 1; local_d8 = local_d8 + 8; } while (uVar3 < 4); isAggressive = 0 < (int)fVar1; uVar3 = (uint)local_ec->_flags; scratchVec.y = *(float *)((int)&local_ec->_flags + 4); npc = local_ec; } } else { isAggressive = true; } if (((uVar3 & 0x20000000) == 0) && (player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,9,(RNG **)&g_game->_playerManager,1), player != (Entity_Player *)0x0)) { isAggressive = false; LAB_0054becf: anim = "FlyLit"; if (npc->_projectileCooldown < 1) { anim = (char *)s_Fly; } } else { if (isAggressive == false) goto LAB_0054becf; anim = &DAT_00b1dd28; } elapsedFrames = (void *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_e8 = elapsedFrames; switch(npc->_state) { case 0: npc->_state = 3; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; uVar3 = Random(); npc->_i1 = uVar3 % 0x3c + 10; uVar3 = Random(); npc->_projectileCooldown = 0; npc->_entityCollisionClass = 2; npc->_i2 = (uVar3 & 1) * 2 + -1; if (npc->_variant == 5) { splatColor._0_4_ = 0.0; splatColor._4_4_ = 0.0; fStack_11c = 0.0; fStack_118 = 0.6; local_104 = 0.7; local_100 = 0.7; local_114 = 0.0; fStack_110 = 0.0; fStack_10c = 0.0; fStack_108 = 0.0; local_fc = 0.0; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)splatColor); } break; case 3: ANM2::Play(&npc->_sprite,(byte *)anim,0); npc->_friction = npc->_friction * 0.85; if (isAggressive == false) { fVar1 = 5.0; } else { fVar1 = 2.0; } iVar2 = Entity::GetIntervalTicks((Entity *)npc,fVar1,0.0); if (iVar2 != 0) { fVar1 = npc->_speedMultiplier; fVar5 = (npc->_v1).y; (npc->_velocity).x = (npc->_velocity).x - fVar1 * (npc->_v1).x; (npc->_velocity).y = (npc->_velocity).y - fVar5 * fVar1; dir = MusicManager::RandomVector(&scratchVec); uVar3 = Random(); fVar5 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 1.0; fVar4 = fVar5 * dir->y; fVar5 = fVar5 * dir->x; (npc->_v1).y = fVar4; (npc->_v1).x = fVar5; fVar1 = npc->_speedMultiplier; (npc->_velocity).y = fVar1 * fVar4 + (npc->_velocity).y; (npc->_velocity).x = fVar1 * fVar5 + (npc->_velocity).x; elapsedFrames = local_e8; } player = target; fVar1 = (float)((int)elapsedFrames * 2); if (isAggressive == false) { fVar1 = (float)elapsedFrames; } npc->_i1 = npc->_i1 - (int)fVar1; if (npc->_i1 < 1) { if (isAggressive == false) { fVar1 = (npc->_pos).y - (target->_pos).y; fVar5 = (npc->_pos).x - (target->_pos).x; fVar1 = sqrtf(fVar1 * fVar1 + fVar5 * fVar5); if ((100.0 <= fVar1) || (uVar3 = Random(), uVar3 % 3 == 0)) { dir = MusicManager::RandomVector(&normalized); uVar3 = Random(); fVar5 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 + 30.0; fVar4 = fVar5 * dir->y; fVar5 = fVar5 * dir->x; (npc->_v1).y = fVar4; (npc->_v1).x = fVar5; fVar1 = (npc->_pos).y; (npc->_targetPosition).x = fVar5 + (npc->_pos).x; (npc->_targetPosition).y = fVar4 + fVar1; Vector::Normalize(&npc->_v1); } else { scratchVec.x = (player->_pos).x - (npc->_pos).x; scratchVec.y = (player->_pos).y - (npc->_pos).y; dir = Vector::Normalized(&scratchVec,&normalized); local_e4.y = (float)npc->_i2 * 60.0 * 0.017453292; local_dc = cos(local_e4.y); fVar1 = sin(local_e4.y); scratchVec.y = (npc->_pos).y - (local_dc * dir->y + fVar1 * dir->x) * 60.0; scratchVec.x = (npc->_pos).x - (local_dc * dir->x - fVar1 * dir->y) * 60.0; Room::GetClampedPositionImpl(g_game->_room,&local_e4,&scratchVec,8.0,8.0,8.0,8.0); (npc->_targetPosition).x = local_e4.x; (npc->_targetPosition).y = local_e4.y; scratchVec.x = (npc->_targetPosition).x - (npc->_pos).x; scratchVec.y = (npc->_targetPosition).y - (npc->_pos).y; dir = Vector::Normalized(&scratchVec,&normalized); (npc->_v1).x = dir->x; (npc->_v1).y = dir->y; } uVar3 = Random(); npc->_i1 = uVar3 % 0x18 + 6; npc->_stateFrame = 6; fVar1 = (npc->_pos).x; fVar5 = (npc->_targetPosition).x; fVar4 = (npc->_targetPosition).x; npc->_i2 = -npc->_i2; npc->_state = 4; (npc->_sprite)._flipX = fVar4 <= fVar1 && fVar1 != fVar5; fVar1 = (npc->_v1).y; fVar5 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_v1).x * 4.0 * fVar5 + (npc->_velocity).x; (npc->_velocity).y = fVar1 * 4.0 * fVar5 + (npc->_velocity).y; } else { Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_e4.y = (npc->_pos).y - scratchVec.y; local_e4.x = (npc->_pos).x - scratchVec.x; local_e8 = (void *)scratchVec.x; local_d8 = (int *)local_e4.x; local_d4 = local_e4.y; local_ec = (Entity_NPC *)sqrtf(local_e4.y * local_e4.y + local_e4.x * local_e4.x); dir = Vector::Normalized(&local_e4,&normalized); uVar3 = Random(); local_e4.y = (float)local_ec * 0.4; local_dc = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 + 20.0; dashDistPtr = &local_dc; if (local_dc <= (float)local_ec * 0.4) { dashDistPtr = &local_e4.y; } local_d8 = (int *)((float)local_d8 - *dashDistPtr * dir->x); local_d4 = local_d4 - *dashDistPtr * dir->y; local_e4.y = (float)npc->_i2 * 75.0 * 0.017453292; local_dc = cos(local_e4.y); fVar1 = sin(local_e4.y); local_e4.x = (local_dc * (float)local_d8 - fVar1 * local_d4) + (float)local_e8; local_e4.y = local_dc * local_d4 + fVar1 * (float)local_d8 + scratchVec.y; isStatusAffected = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if (((isStatusAffected != 0) || (80.0 <= (float)local_ec)) || (uVar3 = Random(), (uVar3 & 1) != 0)) { Room::GetClampedPositionImpl(g_game->_room,&scratchVec,&local_e4,8.0,8.0,8.0,8.0); (npc->_targetPosition).x = scratchVec.x; (npc->_targetPosition).y = scratchVec.y; scratchVec.x = (npc->_targetPosition).x - (npc->_pos).x; scratchVec.y = (npc->_targetPosition).y - (npc->_pos).y; dir = Vector::Normalized(&scratchVec,&normalized); dashFrames = 6; (npc->_v1).x = dir->x; (npc->_v1).y = dir->y; uVar3 = Random(); iVar2 = uVar3 % 0x14 + 5; } else { scratchVec.x = (npc->_pos).x; local_e8 = (void *)((target->_velocity).x * (float)local_ec * 0.025 + (target->_pos).x); scratchVec.y = (npc->_pos).y; fVar1 = (float)local_e8 - scratchVec.x; fVar5 = ((target->_velocity).y * (float)local_ec * 0.025 + (target->_pos).y) - scratchVec.y; scratchVec.x = fVar1 + fVar1 + scratchVec.x; scratchVec.y = fVar5 + fVar5 + scratchVec.y; (npc->_targetPosition).x = scratchVec.x; (npc->_targetPosition).y = scratchVec.y; scratchVec.x = scratchVec.x - (npc->_pos).x; scratchVec.y = scratchVec.y - (npc->_pos).y; dir = Vector::Normalized(&scratchVec,&normalized); dashFrames = 8; (npc->_v1).x = dir->x; (npc->_v1).y = dir->y; uVar3 = Random(); iVar2 = uVar3 % 0x32 + 0x1e; } npc->_i1 = iVar2; npc->_stateFrame = dashFrames; fVar1 = (npc->_pos).x; npc->_i2 = -npc->_i2; npc->_state = 8; (npc->_sprite)._flipX = (float)local_e8 < fVar1; fVar1 = (npc->_v1).y; fVar5 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_v1).x * 8.0 * fVar5 + (npc->_velocity).x; (npc->_velocity).y = fVar1 * 8.0 * fVar5 + (npc->_velocity).y; } } break; case 4: ANM2::Play(&npc->_sprite,(byte *)anim,0); npc->_friction = npc->_friction * 0.85; fVar1 = (npc->_v1).x; fVar5 = (npc->_v1).y; local_e4.y = (fVar1 + fVar1) * npc->_speedMultiplier + (npc->_velocity).x; local_dc = (fVar5 + fVar5) * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = local_e4.y; (npc->_velocity).y = local_dc; fVar1 = sqrtf(local_e4.y * local_e4.y + local_dc * local_dc); if ((12.0 < fVar1) && (0.0 < fVar1)) { (npc->_velocity).y = (12.0 / fVar1) * local_dc; (npc->_velocity).x = (12.0 / fVar1) * local_e4.y; } iVar2 = npc->_stateFrame - (int)elapsedFrames; npc->_stateFrame = iVar2; fVar1 = (npc->_v1).y; fVar5 = (npc->_v1).x; if ((0.0 <= ((npc->_targetPosition).y - (npc->_pos).y) * fVar1 + ((npc->_targetPosition).x - (npc->_pos).x) * fVar5) && (0 < iVar2)) break; fVar5 = -fVar5; fVar1 = -fVar1; fVar4 = npc->_speedMultiplier; (npc->_velocity).x = (fVar5 + fVar5) * fVar4 + (npc->_velocity).x; (npc->_velocity).y = (fVar1 + fVar1) * fVar4 + (npc->_velocity).y; goto LAB_0054cbfb; case 6: case 8: ANM2::Play(&npc->_sprite,(byte *)anim,0); npc->_friction = npc->_friction * 0.85; local_dc = (npc->_v1).y * 8.0 * npc->_speedMultiplier + (npc->_velocity).y; local_e4.y = (npc->_v1).x * 8.0 * npc->_speedMultiplier + (npc->_velocity).x; (npc->_velocity).y = local_dc; (npc->_velocity).x = local_e4.y; fVar1 = sqrtf(local_dc * local_dc + local_e4.y * local_e4.y); if ((20.0 < fVar1) && (0.0 < fVar1)) { (npc->_velocity).y = (20.0 / fVar1) * local_dc; (npc->_velocity).x = (20.0 / fVar1) * local_e4.y; } if (npc->_collidesWithGrid != 0) { fVar1 = (npc->_v1).y; fVar5 = (npc->_v1).x; fVar6 = -(npc->_gridCollisionNormal).x; fVar7 = -(npc->_gridCollisionNormal).y; fVar4 = fVar1 * fVar7 + fVar5 * fVar6; fVar4 = fVar4 + fVar4; (npc->_v1).y = fVar1 - fVar4 * fVar7; (npc->_v1).x = fVar5 - fVar4 * fVar6; } iVar2 = npc->_stateFrame + (int)elapsedFrames * -2; npc->_stateFrame = iVar2; fVar1 = (npc->_v1).y; fVar5 = (npc->_v1).x; if ((0.0 <= ((npc->_targetPosition).y - (npc->_pos).y) * fVar1 + ((npc->_targetPosition).x - (npc->_pos).x) * fVar5) && (0 < iVar2)) break; fVar4 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_velocity).x - fVar5 * 8.0 * fVar4; (npc->_velocity).y = (npc->_velocity).y - fVar1 * 8.0 * fVar4; LAB_0054cbfb: npc->_state = 3; (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; } if (((npc->_dead != 0) && (npc->_variant == 6)) && ((npc->_flags & 0x1000000) == 0)) { ProjectileParams::ProjectileParams(&projParams); params = ProjectileParams::ProjectileParams(&projParams); scratchVec.x = 10.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,6,params); } return; } //@@ 0054ccc0 NpcHelper::bulb_player_collision /* DB: (Entity_Player*): Entity_NPC::HandleCollision for variant 6 (61.6 Bulb): 1 dmg to players (10 to familiars), bounces back (V1 negated, state 6), AddActiveCharge(charge/3) + HUD::FlashChargeBar, PlayExtraAnimation */ void NpcHelper::bulb_player_collision(Entity_Player *param_1) { EntityRef *sourceRef; uint uVar1; int chargeChange; Entity *effect; int in_ECX; uint uVar2; uint proceduralIdx; Game *game; bool bVar3; float fVar4; float fVar5; int itemConfig; Vector local_3c; int npc; EntityRef damageSource; Manager *manager; if (*(int *)(in_ECX + 0x2c) == 6) { if ((param_1->_type == 1) || (param_1->_type == 3)) { damageSource._position.x = *(float *)(in_ECX + 0x33c); damageSource._position.y = *(float *)(in_ECX + 0x340); damageSource._type = *(int *)(in_ECX + 0x28); damageSource._spawnerType = *(int *)(in_ECX + 0x34); damageSource._spawnerVariant = *(int *)(in_ECX + 0x38); damageSource._velocity.x = *(float *)(in_ECX + 0x360); damageSource._velocity.y = *(float *)(in_ECX + 0x364); damageSource._variant = 6; local_3c.x = (float)(uint)((*(uint *)(in_ECX + 0x168) & 0x100) != 0); if ((*(uint *)(in_ECX + 0x168) & 0x20000000) == 0) { uVar2 = 0; } else { uVar2 = 2; } if ((*(uint *)(in_ECX + 0x16c) & 0x400000) == 0) { uVar1 = 0; } else { uVar1 = 4; } damageSource._flags = uVar1 | uVar2 | (uint)local_3c.x; (**(code **)(*(int *)param_1 + 0x20))(0x3f800000,0,0,&damageSource,0x1e); } else { sourceRef = EntityRef::EntityRef(&damageSource); (**(code **)(*(int *)param_1 + 0x20))(0x41200000,0,0,sourceRef,0x1e); } *(undefined4 *)(in_ECX + 0xb64) = 6; fVar4 = *(float *)(in_ECX + 0xbb0); fVar5 = *(float *)(in_ECX + 0xbb4); *(float *)(in_ECX + 0xbb0) = -fVar4; *(float *)(in_ECX + 0xbb4) = -fVar5; *(undefined4 *)(in_ECX + 0x410) = 4; *(float *)(in_ECX + 0x334) = -fVar4 * 80.0 + *(float *)(in_ECX + 0x33c); *(float *)(in_ECX + 0x338) = -fVar5 * 80.0 + *(float *)(in_ECX + 0x340); *(float *)(in_ECX + 0x360) = *(float *)(in_ECX + 0xbb0) * 16.0 * *(float *)(in_ECX + 0x39c) + *(float *)(in_ECX + 0x360) ; *(float *)(in_ECX + 0x364) = *(float *)(in_ECX + 0xbb4) * 16.0 * *(float *)(in_ECX + 0x39c) + *(float *)(in_ECX + 0x364) ; return; } if ((param_1 == (Entity_Player *)0x0) || (param_1->_type != 1)) { return; } *(undefined4 *)(in_ECX + 0xb64) = 6; fVar4 = -*(float *)(in_ECX + 0xbb0); fVar5 = -*(float *)(in_ECX + 0xbb4); *(undefined4 *)(in_ECX + 0x410) = 4; *(float *)(in_ECX + 0xbb0) = fVar4; *(float *)(in_ECX + 0xbb4) = fVar5; *(float *)(in_ECX + 0x338) = fVar5 * 80.0 + *(float *)(in_ECX + 0x340); *(float *)(in_ECX + 0x334) = fVar4 * 80.0 + *(float *)(in_ECX + 0x33c); *(float *)(in_ECX + 0x360) = fVar4 * 16.0 * *(float *)(in_ECX + 0x39c) + *(float *)(in_ECX + 0x360); *(float *)(in_ECX + 0x364) = fVar5 * 16.0 * *(float *)(in_ECX + 0x39c) + *(float *)(in_ECX + 0x364); npc = in_ECX; Entity_Player::PlayExtraAnimation(param_1,&DAT_00b1d3b0); Entity_Player::ResetItemState(param_1); uVar2 = 0; game = g_game; do { uVar1 = param_1->_activeDesc[uVar2]._item; if (game == (Game *)0x0) { if (-1 < (int)uVar1) goto LAB_0054cfd6; LAB_0054d012: itemConfig = 0; } else if ((int)uVar1 < 0) { proceduralIdx = ~uVar1; bVar3 = -1 < (int)uVar1; uVar1 = proceduralIdx; if ((bVar3) || ((int)(game->_proceduralItemManager)._proceduralItems._end - (int)(game->_proceduralItemManager)._proceduralItems._begin >> 2 <= (int)proceduralIdx)) goto LAB_0054d012; itemConfig = **(int **)((int)(game->_proceduralItemManager)._proceduralItems._begin + proceduralIdx * 4); } else { LAB_0054cfd6: if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2 <= (int)uVar1) goto LAB_0054d012; itemConfig = *(int *)((int)(g_manager->_itemConfig)._collectibles._begin + uVar1 * 4); game = g_game; } if (uVar2 == 3) { local_3c.x = 0.0; } else if (((uVar2 == 2) && (param_1->_activeDesc[2]._item == 0x244)) && (game->_challenge == 0x2c)) { local_3c.x = 0.0; } else { local_3c.x = (float)Entity_Player::GetCollectibleMaxCharge (param_1,param_1->_activeDesc[uVar2]._item, param_1->_activeDesc[uVar2]._varData,uVar1); game = g_game; } if (((itemConfig != 0) && (0 < (int)local_3c.x)) && ((uVar2 < 4 && (0 < param_1->_activeDesc[uVar2]._charge)))) { chargeChange = Entity_Player::GetActiveMaxCharge(param_1,uVar2); if (chargeChange == 1) { chargeChange = -1000; } else if ((int)local_3c.x < 0xd) { chargeChange = -2; } else { chargeChange = (int)((ulonglong)((longlong)(int)local_3c.x * 0x55555555) >> 0x20) - (int)local_3c.x; chargeChange = (chargeChange >> 1) - (chargeChange >> 0x1f); } Entity_Player::AddActiveCharge(param_1,chargeChange,uVar2,0,0,0); HUD::FlashChargeBar(&g_game->_hud,param_1,uVar2); manager = g_manager; local_3c.x = 6.9084e-43; seed_fart_sound_override((int *)&local_3c); SoundEffects::Play(&manager->_sfxManager,(int)local_3c.x,1.0,2,0,1.0,0.0); uVar2 = Random(); local_3c.x = (param_1->_pos).x; local_3c.y = (param_1->_pos).y; effect = Game::SpawnEx(g_game,1000,0x31,&local_3c,&g_vectorZero,(Entity *)0x0,3,uVar2,0); (effect->_sprite)._offset.x = 0.0; (effect->_sprite)._offset.y = -24.0; effect->_renderDepthOffset = 1.0; *(int *)(npc + 0xba0) = *(int *)(npc + 0xba0) + 1; return; } uVar2 = uVar2 + 1; if (3 < uVar2) { return; } } while( true ); } //@@ 0054d1b0 FUN_0054d1b0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ int FUN_0054d1b0(int param_1) { int *piVar1; uint uVar2; int in_ECX; uint uVar3; int iVar4; uint uVar5; int iVar6; uVar2 = *(uint *)(in_ECX + 0xbfc); piVar1 = *(int **)(in_ECX + 0xbf0); uVar3 = *(int *)(in_ECX + 0xc00) + uVar2; while( true ) { if (uVar2 == uVar3) { return 0; } if (piVar1 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *piVar1; } uVar5 = uVar2 >> 2; iVar6 = (uVar2 & 3) * 4; if (*(int *)(iVar6 + *(int *)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & uVar5) * 4)) == param_1) break; uVar2 = uVar2 + 1; } if (piVar1 == (int *)0x0) { return *(int *)(_DAT_00000004 + (_DAT_00000008 - 1U & uVar5) * 4) + iVar6; } return *(int *)(*(int *)(*piVar1 + 4) + (*(int *)(*piVar1 + 8) - 1U & uVar5) * 4) + iVar6; } //@@ 0054d250 NpcAI::ENTITY_BUTT_SLICKER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 878 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BUTT_SLICKER(Entity_NPC *npc) { EntityPtr EVar1; ANM2 *pAVar2; float *pfVar3; byte bVar4; byte *pbVar5; uint uVar6; void *dequeBlock; Vector *pVVar7; byte *pbVar8; int *piVar9; Entity *tmpEntity; Entity_Effect *splat; char *animName; int gridX; EntityPtr rootParent; EntityPtr EVar10; Entity_NPC *pEVar11; EntityPtr *pEVar12; int iVar13; uint uVar14; bool bVar15; float fVar16; float fVar17; undefined1 extraout_var [12]; float fVar18; undefined8 uVar21; undefined1 auVar19 [16]; undefined1 auVar20 [16]; EntityRef sourceRef; int *local_144; uint blockIndex; int bestPriority; float deltaY; float deltaX; uint isFriendlyValue; Entity_NPC *self; Vector local_128; undefined1 local_120 [12]; EntityPtr *local_114 [2]; Vector local_10c; int *chainQueue; int chainQueueMap; uint chainQueueMapSize; uint chainQueueOffset; int chainQueueSize; int *local_f0; int *local_ec; char isFriendly; Entity_NPC *local_e4; EntityPtr local_e0; EntityPtr local_dc; Entity_NPC *local_d8; EntityPtr local_d4; ProjectileParams projectileParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; int gridWidth; EntityPtr nextParent; puStack_20 = (undefined1 *)((&projectileParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af4a9b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&projectileParams)[1].Spread; ExceptionList = &local_1c; self = npc; if (npc->_state != 0) { pfVar3 = (&projectileParams)[1].Color._tint + 2; if (npc->_state != 4) goto LAB_0054e549; isFriendly = (npc->_flags & 0x20000000) != 0; isFriendlyValue = (uint)(byte)isFriendly; pfVar3 = (&projectileParams)[1].Color._tint + 2; if (npc->_parent == (EntityPtr)0x0) { uVar6 = Random(); pfVar3 = (float *)puStack_20; if (uVar6 % 0x78 != 0) { Entity_NPC::PlaySound(npc,0x43d,1.0,0x78,0,1.0); pfVar3 = (float *)puStack_20; } } puStack_20 = (undefined1 *)pfVar3; if (0 < npc->_projectileCooldown) { bVar4 = Entity::IsFrame((Entity *)npc,2,0); if ((bVar4 != 0) && (uVar6 = Random(), uVar6 % 3 == 0)) { uVar6 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6); if ((tmpEntity == (Entity *)0x0) || (tmpEntity->_type != 1000)) { tmpEntity = (Entity *)0x0; } if (tmpEntity->_parent != (EntityPtr)0x0) { local_dc = (EntityPtr)&tmpEntity->_parent; std::multiset::erase(&local_dc); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); fVar17 = g_vectorOne.x * 0.8; iVar13 = *(int *)tmpEntity; fVar18 = g_vectorOne.y * 0.8; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; (tmpEntity->_sprite)._scale.x = fVar17; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (tmpEntity->_sprite)._scale.y = fVar18; (**(code **)(iVar13 + 0xc))(); } uVar6 = Random(); if (uVar6 % 0xf == 0) { uVar6 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.3); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } } if (npc->_i2 < 1) { if (npc->_projectileCooldown < 1) { bVar4 = Entity::IsFrame((Entity *)npc,3,0); if ((bVar4 != 0) && (EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_120, &npc->_pos,120.0,8), local_120[0] == '\0')) { local_14 = 0.0; tracked_alloc(1,(void *)local_120._4_4_,0); local_14 = -NAN; } } else { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,2.0,0); } else { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&npc->_targetPosition,2.0,0,1); fVar18 = (npc->_pos).y - (npc->_targetPosition).y; fVar17 = (npc->_pos).x - (npc->_targetPosition).x; fVar18 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); if (20.0 < fVar18) { pVVar7 = Vector::ToCardinal((Vector *)(local_120 + 8),&npc->_velocity); fVar18 = (npc->_velocity).y; fVar17 = (npc->_velocity).x; fVar17 = sqrtf(fVar17 * fVar17 + fVar18 * fVar18); fVar18 = pVVar7->x; (npc->_velocity).y = fVar17 * pVVar7->y; (npc->_velocity).x = fVar17 * fVar18; npc = self; } } fVar18 = ((Vector *)((int)npc + 0x360))->x; if (ABS(fVar18) <= ABS(*(float *)((int)npc + 0x364))) { if (0.0 <= *(float *)((int)npc + 0x364)) { local_d4 = (EntityPtr)0x3; animName = "WalkDown"; } else { animName = (char *)&DAT_00b1e020; local_d4 = (EntityPtr)0x1; } } else if (0.0 <= fVar18) { animName = "WalkHori"; local_d4 = (EntityPtr)0x2; } else { animName = "WalkHori"; local_d4 = (EntityPtr)0x0; } pbVar8 = *(void **)((int)npc + 0x7c); if (pbVar8 == (byte *)0x0) { LAB_0054d8ac: bVar4 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(byte *)((int)npc + 0x8c) = 1; } } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar5 = (byte *)animName; do { bVar4 = *pbVar8; bVar15 = bVar4 < *pbVar5; if (bVar4 != *pbVar5) { LAB_0054d891: uVar6 = -(uint)bVar15 | 1; goto LAB_0054d896; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar15 = bVar4 < pbVar5[1]; if (bVar4 != pbVar5[1]) goto LAB_0054d891; pbVar8 = pbVar8 + 2; pbVar5 = pbVar5 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_0054d896: if ((uVar6 != 0) || ((*(char *)((int)*(void **)((int)npc + 0x7c) + 0x34) != '\0' && (*(byte *)((int)npc + 0x8c) == 0)))) goto LAB_0054d8ac; } *(bool *)((int)npc + 0x148) = local_d4 == (EntityPtr)0x0; local_e0 = (EntityPtr)((Vector *)((int)npc + 0x360))->x; local_e4 = *(Entity_NPC **)((int)npc + 0x364); fVar18 = sqrtf((float)local_e0 * (float)local_e0 + (float)local_e4 * (float)local_e4); game = g_game; if (fVar18 <= 0.0) { uVar21 = 0; EVar10 = local_e0; pEVar11 = local_e4; } else { uVar21 = SUB128(ZEXT812(0x3f800000),4); fVar18 = SUB124(ZEXT812(0x3f800000),0) / fVar18; EVar10 = (EntityPtr)((float)local_e0 * fVar18); pEVar11 = (Entity_NPC *)(fVar18 * (float)local_e4); } fVar17 = 40.0; local_dc = (EntityPtr)g_game->_room; fVar18 = (float)EVar10 * 40.0 + ((Vector *)((int)npc + 0x33c))->x; auVar19._0_4_ = (float)pEVar11 * 40.0 + *(float *)((int)npc + 0x340); auVar19._4_8_ = uVar21; auVar19._12_4_ = 0; EntityRef::constructor(&sourceRef,(Entity *)npc); iVar13 = (int)((auVar19._0_4_ - 120.0) / fVar17 + 0.5); gridX = (int)((fVar18 - fVar17) / fVar17 + 0.5); if (((((-1 < gridX) && (gridWidth = *(int *)((int)game->_room + 0xc), gridX < gridWidth)) && (-1 < iVar13)) && ((iVar13 < *(int *)((int)game->_room + 0x10) && (uVar6 = iVar13 * gridWidth + gridX, uVar6 < 0x1c0)))) && (piVar9 = *(int **)((int)local_dc + (uVar6 + 9) * 4), piVar9 != (int *)0x0)) { (**(code **)(*piVar9 + 0x10))(1,&sourceRef); } *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; goto LAB_0054dd59; } EVar10 = (EntityPtr)Entity_NPC::ParentNPC(npc); local_e0 = (EntityPtr)0x0; do { if (EVar10 == (EntityPtr)0x0) break; pEVar12 = (EntityPtr *)((int)EVar10 + 0x3bc); if ((*pEVar12 != (EntityPtr)0x0) && (iVar13 = __RTDynamicCast(*pEVar12,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar13 == 0)) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } if (*pEVar12 == (EntityPtr)0x0) break; iVar13 = __RTDynamicCast(*pEVar12,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar13 == 0) { KAGE_LogMessage(0x10,(byte *)"m_Parent invalid downcast\n"); } EVar10 = *pEVar12; local_e0 = (EntityPtr)((int)local_e0 + 1); } while ((uint)local_e0 < 0x14); local_dc = (EntityPtr)(npc->_velocity).x; local_f0 = (int *)(npc->_velocity).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_120._8_4_ = (tmpEntity->_pos).x; local_114[0] = (EntityPtr *)(tmpEntity->_pos).y; local_d8 = (Entity_NPC *)local_120._8_4_; local_d4 = (EntityPtr)local_114[0]; bVar4 = Room::CheckLine(g_game->_room,&npc->_pos,(Vector *)(local_120 + 8),0,0,0,0,(Vector *)0x0 ); if (bVar4 == 0) { bVar4 = 1; iVar13 = 0; fVar18 = 0.9; pVVar7 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_120 + 8),0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar7,fVar18,iVar13,bVar4); fVar18 = (npc->_velocity).y; } else { npc->_friction = 0.9; local_d4 = (EntityPtr)((float)local_d4 - (npc->_pos).y); local_d8 = (Entity_NPC *)((float)local_d8 - (npc->_pos).x); fVar18 = sqrtf((float)local_d4 * (float)local_d4 + (float)local_d8 * (float)local_d8); pEVar11 = local_d8; if (0.0 < fVar18) { pEVar11 = (Entity_NPC *)((float)local_d8 * (1.0 / fVar18)); local_d4 = (EntityPtr)((float)local_d4 * (1.0 / fVar18)); } fVar18 = ((float)local_d4 * 0.65 * npc->_speedMultiplier) / 0.9 + (npc->_velocity).y; (npc->_velocity).x = ((float)pEVar11 * 0.65 * npc->_speedMultiplier) / 0.9 + (npc->_velocity).x; (npc->_velocity).y = fVar18; } fVar17 = (npc->_velocity).x; fVar16 = npc->_speedMultiplier; (npc->_v1).y = (fVar18 - (float)local_f0) / fVar16; (npc->_v1).x = (fVar17 - (float)local_dc) / fVar16; fVar18 = (npc->_velocity).x; fVar17 = (npc->_velocity).y; if (ABS(fVar18) <= ABS(fVar17)) { if (0.0 <= fVar17) { local_d4 = (EntityPtr)0x3; animName = "WalkDown"; } else { animName = (char *)&DAT_00b1e020; local_d4 = (EntityPtr)0x1; } } else if (0.0 <= fVar18) { animName = "WalkHori"; local_d4 = (EntityPtr)0x2; } else { animName = "WalkHori"; local_d4 = (EntityPtr)0x0; } pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0054dd2b: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar5 = (byte *)animName; do { bVar4 = *pbVar8; bVar15 = bVar4 < *pbVar5; if (bVar4 != *pbVar5) { LAB_0054dd10: uVar6 = -(uint)bVar15 | 1; goto LAB_0054dd15; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar15 = bVar4 < pbVar5[1]; if (bVar4 != pbVar5[1]) goto LAB_0054dd10; pbVar8 = pbVar8 + 2; pbVar5 = pbVar5 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_0054dd15: if ((uVar6 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0054dd2b; } (npc->_sprite)._flipX = local_d4 == (EntityPtr)0x0; LAB_0054dd59: bVar4 = Entity::IsFrame((Entity *)npc,2,0); if (((bVar4 != 0) && (*(int *)((int)npc + 0xba0) < 1)) && ((uint)*(int *)((int)npc + 0xbc4) < 8) ) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_120, (Vector *)((int)npc + 0x33c), *(float *)((int)npc + 0x370) + *(float *)((int)npc + 0x370),8); local_14 = 1.4013e-45; local_e0 = (EntityPtr)0x447a0000; local_e4 = (Entity_NPC *)0x0; local_d8 = (Entity_NPC *)0x0; local_ec = (int *)0x0; local_d4 = local_e0; if (local_114[0] != (EntityPtr *)0x0) { do { pEVar11 = *(Entity_NPC **)(local_120._4_4_ + (int)local_ec * 4); if ((pEVar11 == (Entity_NPC *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (pEVar11->_type != 1)) && (0x3dd < pEVar11->_type - 10U)))) { pEVar11 = (Entity_NPC *)0x0; LAB_0054de47: uVar6 = 0; if (pEVar11 != (Entity_NPC *)0x0) goto LAB_0054de51; LAB_0054df39: EVar10 = local_d4; } else { if ((pEVar11->_flags & 0x20000000) == 0) goto LAB_0054de47; uVar6 = 1; LAB_0054de51: if (((pEVar11 == npc) || (pEVar11->_type != *(int *)((int)npc + 0x28))) || ((pEVar11->_dead != 0 || ((isFriendlyValue != uVar6 || (7 < (uint)pEVar11->_i2)))))) goto LAB_0054df39; fVar18 = (pEVar11->_pos).y - *(float *)((int)npc + 0x340); fVar17 = (pEVar11->_pos).x - ((Vector *)((int)npc + 0x33c))->x; local_dc = (EntityPtr)sqrtf(fVar18 * fVar18 + fVar17 * fVar17); auVar20._4_4_ = 0; auVar20._0_4_ = local_dc; auVar20._8_4_ = extraout_var._4_4_; auVar20._12_4_ = extraout_var._8_4_; pEVar12 = &local_dc; if ((float)local_d4 <= (float)local_dc) { pEVar12 = &local_e0; } EVar10 = *pEVar12; local_e0 = EVar10; local_d4 = EVar10; iVar13 = FUN_0054d1b0(pEVar11); if (iVar13 == 0) { fVar18 = auVar20._0_4_; EVar10 = local_d4; if ((fVar18 <= pEVar11->_size + *(float *)((int)npc + 0x370)) && ((float)local_e4 < fVar18)) { local_e4 = (Entity_NPC *)fVar18; local_d8 = pEVar11; } } } local_ec = (int *)((int)local_ec + 1); } while (local_ec < local_114[0]); if ((local_d8 != (Entity_NPC *)0x0) && (*(float *)((int)npc + 0x370) <= (float)EVar10 && (float)EVar10 != *(float *)((int)npc + 0x370))) { local_e0 = (EntityPtr)FUN_0054d1b0(0); EVar10 = (EntityPtr)FUN_0054d1b0(0); if ((local_e0 != (EntityPtr)0x0) && (EVar10 != (EntityPtr)0x0)) { if (*(int *)local_e0 != 0) { local_dc = local_e0; std::multiset::erase(&local_dc); } *(Entity_NPC **)local_e0 = local_d8; std::multiset::insert(local_e0); if (*(int *)EVar10 != 0) { local_dc = EVar10; std::multiset::erase(&local_dc); } *(Entity_NPC **)EVar10 = npc; std::multiset::insert(EVar10); } } } local_14 = -NAN; if (local_120[0] == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,(void *)local_120._4_4_,0); local_14 = -NAN; } } *(int *)((int)npc + 0xbc4) = 0; local_ec = ((std_deque *)((int)npc + 0xbf0))->_proxy; local_f0 = *(int **)((int)npc + 0xbfc); local_e0 = (EntityPtr)0x0; local_e4 = (Entity_NPC *)0x0; local_dc = (EntityPtr)0x0; local_d4 = (EntityPtr)0x0; bestPriority = *(int *)((int)npc + 0xbc0); LAB_0054e07c: do { if (local_f0 == (int *)(*(uint *)((int)npc + 0xc00) + *(uint *)((int)npc + 0xbfc))) goto LAB_0054e441; if (local_ec == (int *)0x0) { iVar13 = 0; } else { iVar13 = *local_ec; } blockIndex = (uint)local_f0 >> 2; local_128.y = (float)(((uint)local_f0 & 3) * 4); EVar10 = *(EntityPtr *) ((int)local_128.y + *(int *)(*(int *)(iVar13 + 4) + (*(int *)(iVar13 + 8) - 1U & blockIndex) * 4)); if (EVar10 != (EntityPtr)0x0) { if (((*(int *)((int)EVar10 + 0x28) == *(int *)((int)npc + 0x28)) && (*(byte *)((int)EVar10 + 0x173) == 0)) && (((*(uint *)((int)EVar10 + 0x168) & 0x20000000) != 0) == isFriendlyValue)) { deltaY = *(float *)((int)EVar10 + 0x390) - *(float *)((int)npc + 0x390); deltaX = ((Vector *)((int)EVar10 + 0x38c))->x - ((Vector *)((int)npc + 0x38c))->x; local_114[0] = (EntityPtr *)(deltaY * deltaY + deltaX * deltaX); local_d8 = (Entity_NPC *)sqrtf((float)local_114[0]); piVar9 = *(int **)((int)npc + 0xc10); uVar6 = (int)local_d4 + (int)piVar9; fVar18 = *(float *)((int)npc + 0x370) + *(float *)((int)EVar10 + 0x370) + 40.0; if ((float)local_d8 <= fVar18) { *(undefined4 *) (*(int *)((int)*(void **)((int)npc + 0xc08) + (uVar6 >> 1 & *(uint *)((int)npc + 0xc0c) - 1) * 4) + (uVar6 & 1) * 8) = 0; local_128.y = (float)piVar9; } else { iVar13 = *(int *)((int)*(void **)((int)npc + 0xc08) + (uVar6 >> 1 & *(uint *)((int)npc + 0xc0c) - 1) * 4); *(float *)(iVar13 + (uVar6 & 1) * 8) = ((float)local_d8 - fVar18) * *(float *)((int)npc + 0x39c) + *(float *)(iVar13 + (uVar6 & 1) * 8); local_10c.y = *(float *)((int)npc + 0xc10); if (30.0 < *(float *)(*(int *)((int)*(void **)((int)npc + 0xc08) + ((uint)((int)local_d4 + (int)local_10c.y) >> 1 & *(uint *)((int)npc + 0xc0c) - 1) * 4) + ((int)local_d4 + (int)local_10c.y & 1U) * 8)) { local_10c.y = (float)FUN_0054d1b0(npc); if ((int *)local_10c.y != (int *)0x0) { if (*(int *)local_10c.y != 0) { local_144 = (int *)local_10c.y; std::multiset::erase(&local_144); } *(int *)local_10c.y = 0; } if (local_ec == (int *)0x0) { iVar13 = 0; } else { iVar13 = *local_ec; } local_10c.y = (float)(*(int *)(*(int *)(iVar13 + 4) + (*(int *)(iVar13 + 8) - 1U & blockIndex) * 4) + (int)local_128.y); if (*(int *)local_10c.y != 0) { local_128.y = local_10c.y; std::multiset::erase(&local_128.y); } *(int *)local_10c.y = 0; } } local_d8 = (Entity_NPC *) (((float)local_d8 - (*(float *)((int)npc + 0x370) + *(float *)((int)EVar10 + 0x370))) * 0.05); if ((float)local_d8 < 0.0) { local_d8 = (Entity_NPC *)((float)local_d8 + (float)local_d8); } fVar16 = sqrtf((float)local_114[0]); fVar18 = deltaX; fVar17 = deltaY; if (0.0 < fVar16) { fVar17 = deltaY * (1.0 / fVar16); fVar18 = deltaX * (1.0 / fVar16); } *(int *)((int)npc + 0xbc4) = *(int *)((int)npc + 0xbc4) + 1; iVar13 = *(int *)((int)EVar10 + 0xbc0); local_e4 = (Entity_NPC *)(fVar18 * (float)local_d8 + (float)local_e4); local_e0 = (EntityPtr)(fVar17 * (float)local_d8 + (float)local_e0); if (bestPriority < iVar13) { EVar1 = *(EntityPtr *)((int)EVar10 + 0x3bc); rootParent = EVar10; if (EVar1 != (EntityPtr)0x0) { nextParent = EVar1; do { rootParent = nextParent; nextParent = *(EntityPtr *)((int)rootParent + 0x3bc); } while (*(EntityPtr *)((int)rootParent + 0x3bc) != (EntityPtr)0x0); iVar13 = *(int *)((int)EVar10 + 0xbc0); } if (((rootParent != (EntityPtr)npc) && (EVar1 != (EntityPtr)npc)) && (EVar10 != (EntityPtr)npc)) { local_f0 = (int *)((int)local_f0 + 1); local_d4 = (EntityPtr)((int)local_d4 + 1); bestPriority = iVar13; local_dc = EVar10; goto LAB_0054e07c; } } } else { if (local_ec == (int *)0x0) { iVar13 = 0; } else { iVar13 = *local_ec; } iVar13 = *(int *)(*(int *)(iVar13 + 4) + (*(int *)(iVar13 + 8) - 1U & blockIndex) * 4); pEVar12 = (EntityPtr *)(iVar13 + (int)local_128.y); if (*(int *)(iVar13 + (int)local_128.y) != 0) { local_114[0] = pEVar12; std::multiset::erase(local_114); } *pEVar12 = (EntityPtr)0x0; } } local_f0 = (int *)((int)local_f0 + 1); local_d4 = (EntityPtr)((int)local_d4 + 1); } while( true ); } npc->_entityGridCollisionClass = 5; npc->_entityCollisionClass = 4; fVar16 = fRam00c5c878; fVar17 = fRam00c5c874; fVar18 = fRam00c5c870; if (&npc->_splatColor != (ColorMod *)&DAT_00c5c86c) { (npc->_splatColor)._tint[0] = _DAT_00c5c86c; (npc->_splatColor)._tint[1] = fVar18; (npc->_splatColor)._tint[2] = fVar17; (npc->_splatColor)._tint[3] = fVar16; fVar16 = fRam00c5c888; fVar17 = fRam00c5c884; fVar18 = fRam00c5c880; (npc->_splatColor)._colorize[0] = _DAT_00c5c87c; (npc->_splatColor)._colorize[1] = fVar18; (npc->_splatColor)._colorize[2] = fVar17; (npc->_splatColor)._colorize[3] = fVar16; fVar18 = DAT_00c5c88c._4_4_; (npc->_splatColor)._offset[0] = (float)DAT_00c5c88c; (npc->_splatColor)._offset[1] = fVar18; (npc->_splatColor)._offset[2] = DAT_00c5c894; } pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0054d34e: puStack_20 = (undefined1 *)((&projectileParams)[1].Color._tint + 2); bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkDown",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar5 = *(byte **)pbVar8; } animName = "WalkDown"; do { bVar4 = *pbVar5; bVar15 = bVar4 < (byte)*animName; if (bVar4 != *animName) { LAB_0054d330: uVar6 = -(uint)bVar15 | 1; goto LAB_0054d335; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar15 = bVar4 < (byte)animName[1]; if (bVar4 != animName[1]) goto LAB_0054d330; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar4 != 0); uVar6 = 0; LAB_0054d335: if ((uVar6 != 0) || ((puStack_20 = (undefined1 *)((&projectileParams)[1].Color._tint + 2), pbVar8[0x34] != 0 && (puStack_20 = (undefined1 *)((&projectileParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0054d34e; } npc->_state = 4; local_dc = (EntityPtr)0x0; std::deque::resize(8,&local_dc); fVar18 = (float)(npc->_vectorDeque1)._size; bVar15 = false; if ((uint)fVar18 < 8) { local_d4 = (EntityPtr)fVar18; do { uVar6 = (npc->_vectorDeque1)._offset; if (((uVar6 + (int)local_d4 & 1) == 0) && ((npc->_vectorDeque1)._mapSize <= (int)local_d4 + 2U >> 1)) { std::deque::_Growmap(local_d4); local_d4 = (EntityPtr)(npc->_vectorDeque1)._size; uVar6 = (npc->_vectorDeque1)._offset; } uVar14 = (npc->_vectorDeque1)._mapSize; uVar6 = uVar6 & uVar14 * 2 - 1; (npc->_vectorDeque1)._offset = uVar6; local_f0 = (int *)(uVar6 + (int)local_d4); local_dc = (EntityPtr)((uint)local_f0 >> 1 & uVar14 - 1); dequeBlock = (npc->_vectorDeque1)._map; if (*(int *)((int)dequeBlock + (int)local_dc * 4) == 0) { dequeBlock = operator_new(0x10); *(void **)((int)(npc->_vectorDeque1)._map + (int)local_dc * 4) = dequeBlock; dequeBlock = (npc->_vectorDeque1)._map; } iVar13 = *(int *)((int)dequeBlock + (int)local_dc * 4); *(undefined4 *)(iVar13 + ((uint)local_f0 & 1) * 8) = 0; *(undefined4 *)(iVar13 + 4 + ((uint)local_f0 & 1) * 8) = 0; local_d4 = (EntityPtr)((npc->_vectorDeque1)._size + 1); (npc->_vectorDeque1)._size = (uint)local_d4; } while ((uint)local_d4 < 8); fVar18 = (float)(npc->_vectorDeque1)._size; bVar15 = (uint)fVar18 < 8; } pfVar3 = (float *)puStack_20; if (!bVar15 && fVar18 != 1.12104e-44) { do { fVar18 = (float)((int)fVar18 - 1); (npc->_vectorDeque1)._size = (uint)fVar18; if (fVar18 == 0.0) { (npc->_vectorDeque1)._offset = 0; break; } } while (8 < (uint)fVar18); } LAB_0054e549: puStack_20 = (undefined1 *)pfVar3; if (npc->_dead != 0) { chainQueue = (int *)0x0; chainQueueMap = 0; chainQueueMapSize = 0; chainQueueOffset = 0; chainQueueSize = 0; chainQueue = operator_new(8); chainQueue[1] = 0; *chainQueue = (int)&chainQueue; local_14 = 4.2039e-45; if (((chainQueueOffset + chainQueueSize & 3) == 0) && (chainQueueMapSize <= chainQueueSize + 4U >> 2)) { std::deque<4byte>::_Growmap(chainQueueOffset); } chainQueueOffset = chainQueueOffset & chainQueueMapSize * 4 - 1; local_114[0] = (EntityPtr *)(chainQueueOffset + chainQueueSize); uVar6 = (uint)local_114[0] >> 2 & chainQueueMapSize - 1; if (*(int *)(chainQueueMap + uVar6 * 4) == 0) { dequeBlock = operator_new(0x10); *(void **)(chainQueueMap + uVar6 * 4) = dequeBlock; } local_ec = (int *)0x0; *(Entity_NPC **)(*(int *)(chainQueueMap + uVar6 * 4) + ((uint)local_114[0] & 3) * 4) = npc; chainQueueSize = chainQueueSize + 1; local_10c.y = 0.0; local_10c.x = 0.0; if (chainQueueSize != 0) { do { uVar6 = (chainQueueOffset + chainQueueSize) - 1; iVar13 = chainQueueSize + -1; local_e4 = *(Entity_NPC **) (*(int *)(chainQueueMap + (uVar6 >> 2 & chainQueueMapSize - 1) * 4) + (uVar6 & 3) * 4); uVar6 = chainQueueOffset; if (iVar13 == 0) { uVar6 = 0; } local_114[0] = (local_e4->_entityDeque)._proxy; chainQueueOffset = uVar6; chainQueueSize = iVar13; for (local_e0 = (EntityPtr)(local_e4->_entityDeque)._offset; local_e0 != (EntityPtr)((local_e4->_entityDeque)._offset + (local_e4->_entityDeque)._size); local_e0 = (EntityPtr)((int)local_e0 + 1)) { if (local_114[0] == (EntityPtr *)0x0) { EVar10 = (EntityPtr)0x0; } else { EVar10 = *local_114[0]; } local_dc = *(EntityPtr *) (*(int *)(*(int *)((int)EVar10 + 4) + ((uint)local_e0 >> 2 & *(int *)((int)EVar10 + 8) - 1U) * 4) + ((uint)local_e0 & 3) * 4); if (local_dc != (EntityPtr)0x0) { if ((uVar6 + iVar13 & 3) == 0) { if (chainQueueMapSize <= iVar13 + 4U >> 2) { std::deque<4byte>::_Growmap(chainQueueMapSize); iVar13 = chainQueueSize; uVar6 = chainQueueOffset; } } chainQueueOffset = uVar6 & chainQueueMapSize * 4 - 1; uVar14 = chainQueueOffset + iVar13; uVar6 = chainQueueMapSize - 1 & uVar14 >> 2; if (*(int *)(chainQueueMap + uVar6 * 4) == 0) { dequeBlock = operator_new(0x10); *(void **)(chainQueueMap + uVar6 * 4) = dequeBlock; } pEVar11 = local_e4; *(EntityPtr *)(*(int *)(chainQueueMap + uVar6 * 4) + (uVar14 & 3) * 4) = local_dc; iVar13 = chainQueueSize + 1; chainQueueSize = iVar13; local_f0 = (int *)FUN_0054d1b0(local_dc); piVar9 = (int *)FUN_0054d1b0(pEVar11); if (local_f0 != (int *)0x0) { if (*local_f0 != 0) { local_128.y = (float)local_f0; std::multiset::erase(&local_128.y); } *local_f0 = 0; iVar13 = chainQueueSize; } if (piVar9 != (int *)0x0) { if (*piVar9 != 0) { local_128.y = (float)piVar9; std::multiset::erase(&local_128.y); } *piVar9 = 0; iVar13 = chainQueueSize; } uVar6 = chainQueueOffset; } } local_10c.x = (local_e4->_pos).x + local_10c.x; local_10c.y = (local_e4->_pos).y + local_10c.y; local_ec = (int *)((int)local_ec + 1); local_e4->_i2 = 0; uVar6 = Random(); piVar9 = local_ec; pEVar11 = self; local_e4->_projectileCooldown = uVar6 % 0x3c + 0x1e; if (local_e4 != self) { fVar18 = local_e4->_maxHitPoints; fVar17 = fVar18 * 0.25 + local_e4->_health; if (fVar17 <= fVar18) { fVar18 = fVar17; } local_e4->_health = fVar18; } } while (chainQueueSize != 0); npc = self; if (1 < (int)local_ec) { local_d4 = (EntityPtr)(float)(int)local_ec; local_10c.x = local_10c.x / (float)local_d4; local_10c.y = local_10c.y / (float)local_d4; ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Color._offset[2] = DAT_00c34e7c; local_d4 = (EntityPtr)((float)local_d4 * 0.25 + 1.0); local_128.x = 10.0; local_128.y = 0.0; projectileParams.Color._tint[0] = _DAT_00c34e54; projectileParams.Color._tint[1] = fRam00c34e58; projectileParams.Color._tint[2] = fRam00c34e5c; projectileParams.Color._tint[3] = fRam00c34e60; projectileParams.Color._colorize[0] = _DAT_00c34e64; projectileParams.Color._colorize[1] = fRam00c34e68; projectileParams.Color._colorize[2] = fRam00c34e6c; projectileParams.Color._colorize[3] = fRam00c34e70; projectileParams.Color._offset[0] = (float)DAT_00c34e74; projectileParams.Color._offset[1] = DAT_00c34e74._4_4_; Entity_NPC::FireProjectiles (pEVar11,&local_10c,&local_128,(uint)(3 < (int)piVar9) * 2 + 6,&projectileParams); uVar6 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x1a,&pEVar11->_pos,&g_vectorZero,(Entity *)pEVar11,0, uVar6); fVar18 = (float)local_d4 * g_vectorOne.x; iVar13 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.y = (float)local_d4 * g_vectorOne.y; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = ','; (pAVar2->_filename)._buf[9] = '\x01'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; (tmpEntity->_sprite)._scale.x = fVar18; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = ','; (pAVar2->_filename)._buf[0xd] = '\x01'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar13 + 0xc))(); uVar6 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&pEVar11->_pos,&g_vectorZero,(Entity *)0x0,2,uVar6); (**(code **)(*(int *)tmpEntity + 0x3c))(&pEVar11->_splatColor,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = g_vectorZero.x; (tmpEntity->_sprite)._offset.y = g_vectorZero.y; tmpEntity->_renderDepthOffset = -10.0; uVar6 = Random(); splat = Entity_NPC::MakeSplat (self,((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.6) * (float)local_d4); (**(code **)(*(int *)splat + 0x3c))(&pEVar11->_splatColor,0xffffffff,0xff,0,1); npc = self; } } std::deque<4byte>::~deque(); } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown + -1; } ExceptionList = local_1c; return; LAB_0054e441: if (*(EntityPtr *)((int)npc + 0x3bc) != (EntityPtr)0x0) { local_114[0] = (EntityPtr *)((int)npc + 0x3bc); std::multiset::erase(local_114); } *(EntityPtr *)((int)npc + 0x3bc) = local_dc; if (local_dc != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)npc + 0x3bc)); } bVar4 = Entity::IsFrame((Entity *)npc,10,0); if (bVar4 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar18 = *(float *)((int)npc + 0x390) - (tmpEntity->_pos).y; fVar17 = ((Vector *)((int)npc + 0x38c))->x - (tmpEntity->_pos).x; fVar18 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); *(int *)((int)npc + 0xbc0) = 10000 - (int)(fVar18 + fVar18); if ((isFriendly == '\0') && ((*(uint *)((int)npc + 0x168) & 0x1000b00) != 0)) { uVar6 = Random(); *(int *)((int)npc + 0xbc0) = *(int *)((int)npc + 0xbc0) - (uVar6 % 200 + 200); } } fVar18 = ((Vector *)((int)npc + 0x360))->x; *(float *)((int)npc + 0x364) = *(float *)((int)npc + 0x39c) * (float)local_e0 + *(float *)((int)npc + 0x364); ((Vector *)((int)npc + 0x360))->x = *(float *)((int)npc + 0x39c) * (float)local_e4 + fVar18; pfVar3 = (float *)puStack_20; goto LAB_0054e549; } //@@ 0054eb80 NpcAI::ENTITY_NEEDLE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 881 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_NEEDLE(Entity_NPC *npc) { uint *puVar1; uint uVar2; Vector *vecResult; int iVar3; ProjectileParams *params; byte *anim; float *trailFront; Entity_Player *nearestPlayer; LayerState *layer; Entity *surfaceEffect; ColorMod *color; undefined4 extraout_ECX; float fVar4; float fVar5; undefined1 auStack_10c [4]; Vector scratchVec; Vector local_100; float local_f8; float local_f4; Entity_NPC *local_f0; Vector outVec; Color particleColor; ProjectileParams projParams; uint local_c; undefined4 flagsHigh; Game *game; int nextStateFrame; void *room; float speedMultiplier; local_c = __security_cookie ^ (uint)auStack_10c; local_f0 = npc; if (npc->_aiCallPhase == 3) { if (*(int *)((int)npc->_collisionEntity + 0x28) != 4) { return; } if (0 < npc->_i1) { return; } local_f8 = (npc->_v2).x; fVar4 = (npc->_v2).y; local_f4 = local_f8 * local_f8; fVar4 = sqrtf(fVar4 * fVar4 + local_f4); if (fVar4 <= 0.4) { return; } npc->_i1 = 0x1e; (npc->_v1).x = (npc->_v1).x - 4.0; local_100.x = (npc->_v2).y; fVar4 = sqrtf(local_100.x * local_100.x + local_f4); if (fVar4 <= 0.0) { return; } local_100.x = (0.4 / fVar4) * local_100.x; (npc->_v2).x = local_f8 * (0.4 / fVar4); } else { if (npc->_state == 0) { npc->_visible = 0; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_state = 3; uVar2 = Random(); npc->_aiCallFlags = npc->_aiCallFlags | 4; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_stateFrame = -0x1e - uVar2 % 0x3c; uVar2 = (uint)npc->_flags & 0xfffffffb; *(uint *)&npc->_flags = uVar2; if (npc->_variant == 1) { *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; *(uint *)&npc->_flags = uVar2 | 0x10000; } } if (0 < npc->_i1) { npc->_i1 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_i1; } if (npc->_state == 3) { iVar3 = npc->_stateFrame; npc->_entityGridCollisionClass = 0; npc->_friction = npc->_friction * 0.95; if (iVar3 < 1) { npc->_entityCollisionClass = 0; npc->_visible = 0; if (iVar3 < 0) { nextStateFrame = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + iVar3; iVar3 = 0; if (nextStateFrame < 0) { iVar3 = nextStateFrame; } npc->_stateFrame = iVar3; } if (iVar3 == 0) { room = g_game->_room; local_100.x = *(float *)((int)room + 0x14); local_f4 = *(float *)((int)room + 0x1c); scratchVec.x = *(float *)((int)room + 0x18); local_f8 = *(float *)((int)room + 0x20); vecResult = MusicManager::RandomVector(&outVec); uVar2 = Random(); game = g_game; fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 250.0 + 60.0; local_100.x = (local_100.x + local_f4) * 0.5 + fVar4 * vecResult->x; local_100.y = (local_f8 + scratchVec.x) * 0.5 + fVar4 * vecResult->y; Room::GetClampedPositionImpl(g_game->_room,&scratchVec,&local_100,20.0,20.0,20.0,20.0); local_100.x = scratchVec.x; local_100.y = scratchVec.y; vecResult = Room::FindFreePickupSpawnPosition(game->_room,&outVec,&local_100,0.0,1,0,0); local_100.x = vecResult->x; local_100.y = vecResult->y; local_f8 = local_100.x; local_f4 = local_100.y; nearestPlayer = Game::GetNearestPlayer(g_game,&local_100); fVar5 = local_f4 - (nearestPlayer->_pos).y; fVar4 = local_f8 - (nearestPlayer->_pos).x; scratchVec.x = fVar5 * fVar5 + fVar4 * fVar4; uVar2 = Random(); if ((((uVar2 & 1) == 0) && (14400.0 < scratchVec.x)) && (scratchVec.x < 57600.0)) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; (npc->_targetPosition).x = local_f8; (npc->_targetPosition).y = local_f4; (npc->_pos).x = local_f8; (npc->_pos).y = local_f4; Entity_NPC::UpdateDirtColor(npc,0); Entity_NPC::PlaySound(npc,2,0.8,2,0,1.0); ANM2::Play(&npc->_sprite,(byte *)"DigOut",0); npc->_stateFrame = 1; npc->_entityCollisionClass = 4; npc->_visible = 1; } } } else { fVar4 = (npc->_targetPosition).y; fVar5 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar4 - fVar5; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { vecResult = Entity_NPC::CalcTargetPosition(npc,&outVec,0.0); local_100.x = vecResult->y - (npc->_pos).y; scratchVec.x = vecResult->x - (npc->_pos).x; fVar4 = sqrtf(local_100.x * local_100.x + scratchVec.x * scratchVec.x); (npc->_velocity).x = (scratchVec.x / fVar4) * 8.0; (npc->_velocity).y = (local_100.x / fVar4) * 8.0; (npc->_v1).y = 2.0; (npc->_v1).x = -5.0; npc->_state = 6; npc->_entityGridCollisionClass = 3; (npc->_v2).x = scratchVec.x / fVar4; (npc->_v2).y = local_100.x / fVar4; std::deque::_Tidy(); std::deque::_Tidy(); std::deque::push_back(&npc->_vectorDeque1,&npc->_pos); scratchVec.y = (npc->_v1).y; scratchVec.x = 0.0; std::deque::push_back(&npc->_vectorDeque2,&scratchVec); npc->_shadowSize = *(float *)((int)npc->_config + 0x24); Entity_NPC::PlaySound(npc,0x1d0,0.8,4,0,1.2); npc->_projectileDelay = 4; } } } else if (npc->_state == 6) { npc->_visible = 1; if (((0.0 < (npc->_v1).x) && (-6.0 < (npc->_v1).y)) && (npc->_entityCollisionClass == 4)) { npc->_entityCollisionClass = 0; npc->_shadowSize = 0.0; Entity_NPC::PlaySound(npc,0x42,0.8,4,0,1.2); } if (npc->_collidesWithGrid != 0) { fVar4 = (npc->_v2).y; fVar5 = (npc->_v2).x; fVar4 = sqrtf(fVar5 * fVar5 + fVar4 * fVar4); vecResult = Vector::Resized(&npc->_velocity,&scratchVec,fVar4); (npc->_v2).x = vecResult->x; (npc->_v2).y = vecResult->y; } iVar3 = 4; if (-6.0 < (npc->_v1).y) { iVar3 = 0; } npc->_entityCollisionClass = iVar3; if (((0 < npc->_projectileDelay) && (iVar3 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileDelay, npc->_projectileDelay = iVar3, iVar3 < 1)) && (npc->_variant == 1)) { params = ProjectileParams::ProjectileParams(&projParams); scratchVec.x = 7.0; scratchVec.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,7,params); } anim = s_Idle; if ((npc->_velocity).y < 0.0) { anim = (byte *)"IdleBack"; } ANM2::Play(&npc->_sprite,anim,0); trailFront = (float *)std::deque::front(extraout_ECX); fVar4 = (npc->_pos).x - *trailFront; fVar5 = (npc->_pos).y - trailFront[1]; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if ((3.0 < fVar4) || (16.0 < (npc->_v1).y)) { std::deque::push_back(&npc->_vectorDeque1,&npc->_pos); scratchVec.y = (npc->_v1).y; scratchVec.x = 0.0; std::deque::push_back(&npc->_vectorDeque2,&scratchVec); } uVar2 = (npc->_vectorDeque1)._size; while (0x14 < uVar2) { uVar2 = uVar2 - 1; (npc->_vectorDeque1)._size = uVar2; if (uVar2 == 0) { (npc->_vectorDeque1)._offset = 0; } puVar1 = &(npc->_vectorDeque2)._size; *puVar1 = *puVar1 - 1; if (*puVar1 == 0) { (npc->_vectorDeque2)._offset = 0; } } if (8.0 < (npc->_v1).y) { npc->_state = 3; npc->_entityGridCollisionClass = 0; uVar2 = Random(); npc->_visible = 0; npc->_stateFrame = -0x14 - uVar2 % 0x28; } fVar5 = npc->_friction * 0.6; npc->_friction = fVar5; fVar4 = (npc->_v2).x; if (fVar5 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * (npc->_v2).y * 3.2) / fVar5 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * fVar4 * 3.2) / fVar5 + (npc->_velocity).x; } } if (npc->_state == 6) { fVar4 = npc->_speedMultiplier; scratchVec.x = (npc->_v1).y; fVar5 = fVar4 * 0.4 + (npc->_v1).x; (npc->_v1).x = fVar5; fVar4 = fVar5 * fVar4 + scratchVec.x; (npc->_v1).y = fVar4; (npc->_posOffset).y = fVar4; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); npc = local_f0; layer->_visible = fVar4 <= -6.0; if (scratchVec.x <= -6.0 != (local_f0->_v1).y <= -6.0) { uVar2 = Random(); surfaceEffect = Game::SpawnEx(g_game,1000,0x92,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2,0); surfaceEffect->_renderDepthOffset = 4.0; Color::Color(&particleColor); Game::SpawnParticles(g_game,&npc->_pos,4,3,5.0,color,100000.0,0x20000); } } else { (npc->_posOffset).y = 0.0; (npc->_v1).y = 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_visible = 1; } if (npc->_pendingDamage <= 0.0) { return; } if (0 < npc->_i1) { return; } npc->_i1 = 10; (npc->_v1).x = (npc->_v1).x - 3.0; local_f0 = (Entity_NPC *)(npc->_v2).x; scratchVec.x = (npc->_v2).y; fVar4 = sqrtf((float)local_f0 * (float)local_f0 + scratchVec.x * scratchVec.x); if (fVar4 <= 0.4) { return; } (npc->_v2).x = (float)local_f0 * 0.8; local_100.x = scratchVec.x * 0.8; } (npc->_v2).y = local_100.x; return; } //@@ 0054f670 NpcHelper::needle_render /* DB: Entity_NPC::Render calls it for type 0x371 (881 Needle/Pasty): ANM2::GetLayer + distance math (burrow render) */ void NpcHelper::needle_render(void) { float fVar1; double dVar2; int iVar3; float *pfVar4; int iVar5; LayerState *layer; int in_ECX; int iVar6; uint uVar7; int iVar8; int iVar9; uint uVar10; uint heightIndex; int segmentCount; float *segmentPosCursor; uint trailIndex; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float prevHeight; float remainingSpacing; Vector prevPos; byte *layerIndex; int segmentsLeft; float segmentData [7]; int *trailHeights; int *trailPositions; uint trailStart; if ((*(int *)(in_ECX + 0xb64) == 6) && (2 < *(uint *)(in_ECX + 200))) { pfVar4 = segmentData; iVar6 = 2; do { pfVar4 = pfVar4 + 2; pfVar4[1] = 0.0; *pfVar4 = 0.0; iVar6 = iVar6 + -1; } while (iVar6 != 0); segmentCount = 0; remainingSpacing = 15.0; trailStart = *(uint *)(in_ECX + 0xc10); prevPos.x = *(float *)(in_ECX + 0x33c); prevPos.y = *(float *)(in_ECX + 0x340); prevHeight = *(float *)(in_ECX + 0xbb4); iVar6 = *(int *)((int)g_game->_room + 0x12bc); trailPositions = *(int **)(in_ECX + 0xc04); heightIndex = *(uint *)(in_ECX + 0xc24); trailHeights = *(int **)(in_ECX + 0xc18); iVar8 = *(int *)(in_ECX + 0xc14); trailIndex = trailStart; while (trailIndex != trailStart + iVar8) { if (trailPositions == (int *)0x0) { iVar5 = 0; } else { iVar5 = *trailPositions; } iVar3 = (trailIndex & 1) * 8; pfVar4 = (float *)(*(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & trailIndex >> 1) * 4) + iVar3); fVar14 = *pfVar4 - prevPos.x; fVar12 = pfVar4[1] - prevPos.y; if (trailHeights == (int *)0x0) { iVar5 = 0; } else { iVar5 = *trailHeights; } uVar7 = heightIndex >> 1; iVar9 = (heightIndex & 1) * 8; fVar15 = *(float *)(*(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & uVar7) * 4) + 4 + iVar9) - prevHeight; fVar11 = sqrtf(fVar12 * fVar12 + fVar14 * fVar14 + fVar15 * fVar15); remainingSpacing = remainingSpacing - fVar11; if (0.0 < remainingSpacing) { if (trailPositions == (int *)0x0) { iVar5 = 0; } else { iVar5 = *trailPositions; } pfVar4 = (float *)(*(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & trailIndex >> 1) * 4) + iVar3); prevPos.x = *pfVar4; prevPos.y = pfVar4[1]; if (trailHeights == (int *)0x0) { iVar5 = 0; } else { iVar5 = *trailHeights; } trailIndex = trailIndex + 1; heightIndex = heightIndex + 1; prevHeight = *(float *)(*(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & uVar7) * 4) + 4 + iVar9); } else { fVar11 = (fVar11 + remainingSpacing) / fVar11; prevPos.x = fVar14 * fVar11 + prevPos.x; prevPos.y = fVar12 * fVar11 + prevPos.y; prevHeight = fVar11 * fVar15 + prevHeight; segmentData[segmentCount * 2 + 2] = prevPos.x; segmentData[segmentCount * 2 + 3] = prevPos.y; segmentData[segmentCount] = prevHeight; segmentCount = segmentCount + 1; remainingSpacing = 15.0; if (1 < segmentCount) goto LAB_0054f962; uVar10 = heightIndex - 1; uVar7 = trailIndex - 1; if (trailIndex <= trailStart) { uVar10 = heightIndex; uVar7 = trailIndex; } trailIndex = uVar7 + 1; heightIndex = uVar10 + 1; } } if (segmentCount < 2) { pfVar4 = segmentData + segmentCount; for (iVar8 = 2 - segmentCount; iVar8 != 0; iVar8 = iVar8 + -1) { *pfVar4 = prevHeight; pfVar4 = pfVar4 + 1; } do { segmentData[segmentCount * 2 + 2] = prevPos.x; segmentData[segmentCount * 2 + 3] = prevPos.y; segmentCount = segmentCount + 1; } while (segmentCount < 2); } LAB_0054f962: pfVar4 = segmentData; segmentPosCursor = segmentData; segmentsLeft = 2; layerIndex = (byte *)0x1; do { segmentPosCursor = segmentPosCursor + 2; fVar12 = *segmentPosCursor; fVar14 = segmentPosCursor[1]; fVar11 = *(float *)(in_ECX + 0x33c); fVar15 = *(float *)(in_ECX + 0x340); fVar1 = *pfVar4; fVar13 = *(float *)(in_ECX + 0x350); if (iVar6 == 5) { fVar13 = -fVar13; } layer = ANM2::GetLayer((ANM2 *)(in_ECX + 0x48),layerIndex); (layer->_pos).x = (fVar12 - fVar11) * 0.65; (layer->_pos).y = ((fVar14 - fVar15) + (fVar1 - fVar13)) * 0.65; dVar2 = __uint_to_double_fixup[-((int)layerIndex >> 0x1f)]; fVar12 = *pfVar4; layer = ANM2::GetLayer((ANM2 *)(in_ECX + 0x48),layerIndex); pfVar4 = pfVar4 + 1; layer->_visible = fVar12 <= -6.0 - (float)((double)(int)layerIndex + dVar2) * 3.0; layerIndex = layerIndex + 1; segmentsLeft = segmentsLeft + -1; } while (segmentsLeft != 0); } return; } //@@ 0054fa80 NpcAI::ENTITY_WRINKLY_BABY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 38.3, from NpcAI::ENTITY_BABY */ ColorMod * __fastcall NpcAI::ENTITY_WRINKLY_BABY(Entity_NPC *npc) { char isInputIdle; byte bVar1; Vector *pVVar2; ColorMod *pCVar3; int dashDirection; Entity *target; undefined3 extraout_var; uint rngResult; Entity_NPC *extraout_ECX; Entity_NPC *extraout_ECX_00; Entity_NPC *extraout_ECX_01; Entity_NPC *extraout_ECX_02; Entity_NPC *extraout_ECX_03; Entity_NPC *extraout_ECX_04; Entity_NPC *extraout_ECX_05; Entity_NPC *extraout_ECX_06; Entity_NPC *extraout_ECX_07; Entity_NPC *extraout_ECX_08; Entity_NPC *extraout_ECX_09; Entity_NPC *extraout_ECX_10; Entity_NPC *unused; Entity_NPC *extraout_ECX_11; Entity_NPC *extraout_ECX_12; Vector *this; Entity_NPC *extraout_ECX_13; float frameDelta; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; ColorMod bloodColor; Vector scratchVec; Vector VStack_d0; Entity *pEStack_c8; float fStack_c4; Vector VStack_c0; float local_b8; ProjectileParams params; float local_8; void *animData; local_8 = (float)(__security_cookie ^ (uint)&(¶ms)[1].CircleAngle); frameDelta = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); unused = npc; local_b8 = frameDelta; switch(npc->_state) { case 0: npc->_state = 4; bloodColor._colorize[0] = 0.0; bloodColor._colorize[1] = 0.0; bloodColor._colorize[2] = 0.0; bloodColor._colorize[3] = 0.0; bloodColor._offset[0] = 0.0; bloodColor._tint[0] = 0.5; bloodColor._tint[1] = 0.1; bloodColor._tint[2] = 0.1; bloodColor._tint[3] = 1.0; bloodColor._offset[1] = 0.1; bloodColor._offset[2] = 0.1; pCVar3 = Color::operator_assign((Color *)&npc->_splatColor,&bloodColor); if (npc->_controllerID == -1) { rngResult = Random(); npc->_i2 = rngResult % 10 + 5; return (ColorMod *)(rngResult / 10); } npc->_i2 = 5; return pCVar3; default: break; case 4: npc->_entityCollisionClass = 4; npc->_friction = npc->_friction * 0.7; ANM2::Play(&npc->_sprite,&DAT_00b1d6fc,0); pEStack_c8 = Entity_NPC::GetPlayerTarget(npc); Entity_NPC::CalcTargetPosition(npc,&VStack_d0,0.0); local_b8 = (npc->_pos).x; fStack_c4 = (npc->_pos).y; fVar4 = local_b8 - VStack_d0.x; fVar5 = fStack_c4 - VStack_d0.y; fVar7 = VStack_d0.x; fVar8 = VStack_d0.y; if (fVar5 * fVar5 + fVar4 * fVar4 < 14400.0) { VStack_c0.x = fVar4; VStack_c0.y = fVar5; pVVar2 = Vector::Resized(&VStack_c0,&scratchVec,120.0); fVar7 = VStack_d0.x + pVVar2->x; fVar8 = VStack_d0.y + pVVar2->y; } if (npc->_controllerID == -1) { if ((fVar7 != local_b8) || (fVar8 != fStack_c4)) { VStack_c0.x = fVar7 - local_b8; VStack_c0.y = fVar8 - fStack_c4; pVVar2 = Vector::Normalized(&VStack_c0,&scratchVec); goto LAB_0054fcc5; } } else { pVVar2 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); LAB_0054fcc5: fVar7 = npc->_friction; fVar8 = pVVar2->x; if (fVar7 != 0.0) { fVar4 = npc->_speedMultiplier; (npc->_velocity).y = (pVVar2->y * 0.33 * fVar4) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (fVar8 * 0.33 * fVar4) / fVar7 + (npc->_velocity).x; } } fVar7 = (npc->_pos).y - (pEStack_c8->_pos).y; fVar8 = (npc->_pos).x - (pEStack_c8->_pos).x; pEStack_c8 = (Entity *)sqrtf(fVar7 * fVar7 + fVar8 * fVar8); unused = extraout_ECX; if (((npc->_flags & 0x1000a00) != 0) || (0 < npc->_i2)) break; if (npc->_controllerID == -1) { target = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::IsHostileTo((Entity *)npc,target); unused = extraout_ECX_03; if (bVar1 == 0) break; rngResult = Random(); unused = extraout_ECX_04; if ((rngResult & 3) != 0) break; if (120.0 <= (float)pEStack_c8) { if (280.0 <= (float)pEStack_c8) break; goto LAB_0054fe8c; } } else { isInputIdle = Entity_NPC::is_controller_input_idle(); unused = extraout_ECX_00; if (isInputIdle != '\0') { pVVar2 = Entity_NPC::GetAimTargetPosition(npc,&scratchVec); fVar7 = (npc->_pos).y - pVVar2->y; fVar8 = (npc->_pos).x - pVVar2->x; unused = extraout_ECX_01; if (100.0 < fVar7 * fVar7 + fVar8 * fVar8) { LAB_0054fe8c: ANM2::Play(&npc->_sprite,(byte *)"DashStart",0); npc->_state = 7; unused = extraout_ECX_07; break; } } if (npc->_aimTargetEffect != (void *)0x0) break; bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); unused = extraout_ECX_02; if (bVar1 == 0) break; Entity_NPC::UpdateControllerMovement(npc,1); } ANM2::Play(&npc->_sprite,(byte *)"Attack",0); unused = extraout_ECX_05; if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,3.0); unused = extraout_ECX_06; } npc->_state = 8; break; case 7: fVar7 = npc->_friction; npc->_entityCollisionClass = 2; animData = (npc->_sprite)._animState._animData; if (animData == (void *)0x0) { npc->_friction = fVar7 * 0.7; LAB_005501fc: target = Entity_NPC::GetPlayerTarget(npc); VStack_c0.x = (target->_pos).x; VStack_c0.y = (target->_pos).y; (npc->_targetPosition).x = VStack_c0.x; (npc->_targetPosition).y = VStack_c0.y; if (npc->_controllerID != -1) { pVVar2 = Entity_NPC::GetAimTargetPosition(npc,&scratchVec); (npc->_targetPosition).x = pVVar2->x; (npc->_targetPosition).y = pVVar2->y; Entity_NPC::ClearChild(npc); VStack_c0.x = (npc->_targetPosition).x; VStack_c0.y = (npc->_targetPosition).y; } VStack_c0.x = VStack_c0.x - (npc->_pos).x; VStack_c0.y = VStack_c0.y - (npc->_pos).y; pVVar2 = Vector::Normalized(&VStack_c0,&scratchVec); (npc->_v1).x = pVVar2->x; (npc->_v1).y = pVVar2->y; dashDirection = vector_to_direction(&npc->_v1); ANM2::Play(&npc->_sprite,(&PTR_s_DashHori_00b613cc)[dashDirection],0); (npc->_sprite)._flipX = dashDirection == 0; unused = extraout_ECX_11; } else { if (*(char *)((int)animData + 0x34) != '\0') { npc->_friction = fVar7 * 0.85; fStack_c4 = (npc->_v1).x * 3.75 * npc->_speedMultiplier + (npc->_velocity).x; local_b8 = (npc->_v1).y * 3.75 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fStack_c4; (npc->_velocity).y = local_b8; pEStack_c8 = (Entity *)cos(1.5707964); fVar4 = sin(1.5707964); fVar7 = (npc->_v1).x; fVar8 = (npc->_v1).y; fVar6 = fVar7 * (float)pEStack_c8 - fVar8 * fVar4; fVar5 = fVar8 * (float)pEStack_c8 + fVar7 * fVar4; fVar4 = fVar8 * local_b8 + fVar7 * fStack_c4; fVar7 = fVar7 * fVar4; fVar8 = fVar8 * fVar4; (npc->_velocity).x = fVar7; (npc->_velocity).y = fVar8; fVar4 = ((npc->_pos).y - (npc->_targetPosition).y) * fVar5 + ((npc->_pos).x - (npc->_targetPosition).x) * fVar6; (npc->_velocity).y = fVar8 - fVar4 * fVar5; (npc->_velocity).x = fVar7 - fVar4 * fVar6; unused = extraout_ECX_08; if (20.0 <= ((npc->_targetPosition).y - (npc->_pos).y) * (npc->_v1).y + ((npc->_targetPosition).x - (npc->_pos).x) * (npc->_v1).x) break; npc->_entityCollisionClass = 4; if ((npc->_controllerID == -1) || (bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar1 != 0)) { Entity_NPC::UpdateControllerMovement(npc,1); npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); unused = extraout_ECX_10; break; } (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_i2 = 0xf; goto LAB_005500dd; } npc->_friction = fVar7 * 0.7; if ((npc->_sprite)._animState._isPlaying == 0) goto LAB_005501fc; } frameDelta = local_b8; break; case 8: npc->_friction = npc->_friction * 0.7; if (npc->_controllerID != -1) { pVVar2 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); fVar7 = npc->_friction; fVar8 = pVVar2->y; if (fVar7 != 0.0) { fVar4 = npc->_speedMultiplier; (npc->_velocity).x = (pVVar2->x * 0.1 * fVar4) / fVar7 + (npc->_velocity).x; (npc->_velocity).y = (fVar8 * 0.1 * fVar4) / fVar7 + (npc->_velocity).y; } } Entity_NPC::UpdateControllerMovement(npc,0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); unused = extraout_ECX_12; if (bVar1 != 0) { target = Entity_NPC::GetPlayerTarget(npc); VStack_c0.x = (target->_pos).x - (npc->_pos).x; VStack_c0.y = (target->_pos).y - (npc->_pos).y; Vector::Normalized(&VStack_c0,&VStack_d0); if ((npc->_controllerID != -1) && (bVar1 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar1 != 0)) { pVVar2 = Vector::Normalized(this,&scratchVec); VStack_d0.x = pVVar2->x; VStack_d0.y = pVVar2->y; } (npc->_sprite)._flipX = VStack_d0.x < 0.0; fStack_c4 = VStack_d0.x; local_b8 = VStack_d0.y; Entity_NPC::PlaySound(npc,0x2c,0.85,2,0,0.9); ProjectileParams::ProjectileParams(¶ms); params.Spread = 0.6; bVar1 = Game::IsHardMode(); if ((float)CONCAT31(extraout_var,bVar1) <= 0.0) { VStack_c0.y = 8.0; } else { VStack_c0.y = 10.0; } VStack_c0.x = VStack_c0.y * fStack_c4; VStack_d0.x = fStack_c4 * 4.0 + (npc->_pos).x; VStack_c0.y = local_b8 * VStack_c0.y; VStack_d0.y = local_b8 * 4.0 + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&VStack_d0,&VStack_c0,2,¶ms); unused = extraout_ECX_13; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; if (npc->_controllerID == -1) { rngResult = Random(); npc->_i2 = rngResult % 0x1e + 0xf; } else { npc->_i2 = 0xf; } LAB_005500dd: ANM2::Play(&npc->_sprite,&DAT_00b1d6fc,0); npc->_state = 4; unused = extraout_ECX_09; } if ((((npc->_state == 4) || (animData = (npc->_sprite)._animState._animData, animData == (void *)0x0)) || (*(char *)((int)animData + 0x34) == '\0')) && ((npc->_aimTargetEffect != (void *)0x0 || (((npc->_controllerID != -1 && (bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,(int)unused), bVar1 != 0 )) && ((pVVar2 = Entity_NPC::GetControllerInput(npc,&scratchVec,0.1), pVVar2->x != g_vectorZero.x || (pVVar2->y != g_vectorZero.y)))))))) { Entity_NPC::SpawnControlTarget(npc,1,-1.0); } pCVar3 = (ColorMod *)npc->_i2; if (0 < (int)pCVar3) { pCVar3 = (ColorMod *)((int)pCVar3 - (int)frameDelta); npc->_i2 = (int)pCVar3; } return pCVar3; } //@@ 005505c0 NpcAI::ENTITY_SWARM_SPIDER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 884 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SWARM_SPIDER(Entity_NPC *npc) { Entity_NPC *pEVar1; EntityPtr spawner; code *pcVar2; RNG rng; byte bVar3; Entity_Player *sackOwner; uint uVar4; byte *animNameChar; void *pvVar5; Vector *destPos; uint uVar6; byte *expectedAnimName; char *expectedAnimText; undefined4 *size; int iVar7; bool isLess; float fVar8; float fVar9; Vector local_68; uint pickerSeed; undefined1 auStack_5c [8]; float fStack_54; Entity_NPC *self; char isBurstingSackActive; float local_48; float local_44; float local_40; void *graphicsSuffix; undefined2 local_38; undefined1 local_36; EntityList_EL local_34; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; AnimationState *animState; undefined4 flagsHigh; int *outcomeWeight; puStack_20 = auStack_5c + 0x58; local_14 = 0xffffffff; puStack_18 = &LAB_00af4aed; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(auStack_5c + 0x4c); ExceptionList = &local_1c; self = npc; sackOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x179,(RNG **)&g_game->_playerManager,1); if ((sackOwner == (Entity_Player *)0x0) || ((npc->_flags & 0x20000000) != 0)) { isBurstingSackActive = '\0'; } else { isBurstingSackActive = '\x01'; if ((npc->_state == 0) || (g_game->_frameCount - npc->_spawnFrame == 1)) { graphicsSuffix = (void *)0x656e695f; local_34._size = (int)&DAT_0000000f; local_34._capacity = (int)&DAT_00000006; local_38 = 0x7472; local_36 = 0; local_14 = 0; _NpcHelper::spider_load_graphics(&graphicsSuffix); local_14 = 0xffffffff; if (&DAT_0000000f < (uint)local_34._size) { size = (undefined4 *)(local_34._size + 1); pvVar5 = graphicsSuffix; if ((undefined4 *)0xfff < size) { pvVar5 = *(void **)((int)graphicsSuffix + -4); size = (undefined4 *)(local_34._size + 0x24); if (0x1f < (uint)((int)graphicsSuffix + (-4 - (int)pvVar5))) goto LAB_00551116; } operator_delete(pvVar5,(uint)size); } local_34._capacity = 0; local_34._size = 0xf; graphicsSuffix = (void *)((uint)graphicsSuffix & 0xffffff00); } } iVar7 = npc->_state; if (iVar7 == 0) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimName = s_Idle; do { bVar3 = *animNameChar; isLess = bVar3 < *expectedAnimName; if (bVar3 != *expectedAnimName) { LAB_00551161: uVar4 = -(uint)isLess | 1; goto LAB_00551166; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; isLess = bVar3 < expectedAnimName[1]; if (bVar3 != expectedAnimName[1]) goto LAB_00551161; animNameChar = animNameChar + 2; expectedAnimName = expectedAnimName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00551166: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_005511a0; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; npc = self; } LAB_005511a0: npc->_state = 3; npc->_entityCollisionClass = 2; if (npc->_subtype != 0) { local_48 = 0.0; do { uVar4 = (npc->_dropRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (npc->_dropRNG)._seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar4 = uVar4 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar4; (npc->_dropRNG)._seed = uVar4; spawner = npc->_spawnerEntity; uVar6 = Random(); fStack_54 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0; uVar6 = Random(); npc = self; local_68.x = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) + (self->_pos).x; local_68.y = fStack_54 + (self->_pos).y; Game::Spawn(g_game,self->_type,self->_variant,&local_68,&g_vectorZero,(Entity *)spawner,0, uVar4); local_48 = (float)((int)local_48 + 1); } while ((uint)local_48 < (uint)npc->_subtype); uVar4 = Random(); fStack_54 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0; uVar4 = Random(); npc->_subtype = 0; (npc->_pos).x = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) + (npc->_pos).x; (npc->_pos).y = fStack_54 + (npc->_pos).y; } ExceptionList = local_1c; return; } if (iVar7 != 3) { if (iVar7 != 6) { ExceptionList = local_1c; return; } if ((npc->_flags & 0x40000000) == 0) { npc->_friction = npc->_friction * 0.7; } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,s_Jump); if (bVar3 == 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0055082f; bVar3 = AnimationState::IsEventTriggered(animState,s_Land); if (bVar3 != 0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xbfffffff; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } } else { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000000; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; (npc->_velocity).x = (npc->_targetPosition).x; (npc->_velocity).y = (npc->_targetPosition).y; uVar4 = Random(); Entity_NPC::PlaySound (npc,0x102,0.4,2,0, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.8); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { bVar3 = AnimationState::WasEventTriggered(animState,s_Land); if (bVar3 == 0) { ExceptionList = local_1c; return; } uVar4 = Random(); if ((uVar4 & 3) != 0) { ExceptionList = local_1c; return; } } } LAB_0055082f: animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimName = s_Idle; do { bVar3 = *animNameChar; isLess = bVar3 < *expectedAnimName; if (bVar3 != *expectedAnimName) { LAB_00550865: uVar4 = -(uint)isLess | 1; goto LAB_0055086a; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; isLess = bVar3 < expectedAnimName[1]; if (bVar3 != expectedAnimName[1]) goto LAB_00550865; animNameChar = animNameChar + 2; expectedAnimName = expectedAnimName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0055086a: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_005508a4; } bVar3 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; npc = self; } LAB_005508a4: npc->_state = 3; ExceptionList = local_1c; return; } npc->_friction = npc->_friction * 0.7; Entity_NPC::CalcTargetPosition(npc,(Vector *)(auStack_5c + 4),0.0); if (isBurstingSackActive == '\0') { local_44 = (float)auStack_5c._4_4_; local_40 = fStack_54; } else { local_40 = 0.0; local_48 = 0.0; local_44 = 0.0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_34,npc->_type,-1,-1,0,0); uVar4 = 0; local_14 = 1; if (local_34._size == 0) { LAB_005509e9: destPos = (Vector *)(auStack_5c + 4); auStack_5c._4_4_ = local_48; fStack_54 = local_40; } else { pvVar5 = local_34._data; do { pEVar1 = *(Entity_NPC **)((int)pvVar5 + uVar4 * 4); if (pEVar1 != npc) { if (((pEVar1->_flags & 0x20000000) == 0) && (fVar8 = (npc->_pos).y - (pEVar1->_pos).y, fVar9 = (npc->_pos).x - (pEVar1->_pos).x, fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9), local_44 < fVar8)) { local_44 = fVar8; iVar7 = *(int *)((int)local_34._data + uVar4 * 4); local_48 = *(float *)(iVar7 + 0x33c); local_40 = *(float *)(iVar7 + 0x340); } pvVar5 = local_34._data; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_34._size); if (0.0 <= local_44) goto LAB_005509e9; destPos = Room::GetRandomPosition(g_game->_room,(Vector *)(auStack_5c + 4),0.0); } local_44 = destPos->x; local_40 = destPos->y; local_14 = 0xffffffff; if (local_34._0_1_ == '\0') { local_14 = 2; tracked_alloc(1,local_34._data,0); local_14 = 0xffffffff; } } local_44 = local_44 - (npc->_pos).x; local_40 = local_40 - (npc->_pos).y; local_48 = sqrtf(local_44 * local_44 + local_40 * local_40); if (local_48 <= 0.0) { ExceptionList = local_1c; return; } uVar4 = 4; if (200.0 < local_48) { uVar4 = 0x14; } uVar6 = Random(); if ((uVar6 % uVar4 == 0) || (local_48 < 100.0)) { uVar4 = Random(); if ((uVar4 & 1) == 0) { uVar4 = Random(); if ((uVar4 & 1) == 0) { local_68.y = 90.0; } else { local_68.y = -90.0; } local_68.y = local_68.y * 0.017453292; fStack_54 = cos(local_68.y); fVar8 = sin(local_68.y); fVar9 = local_44 * fVar8; local_44 = local_44 * fStack_54 - local_40 * fVar8; local_40 = local_40 * fStack_54 + fVar9; } else { local_44 = -local_44; local_40 = -local_40; } } local_44 = local_44 / local_48; local_34._data = (void *)0x0; local_34._capacity = 0; local_34._size = 0; local_40 = local_40 / local_48; local_14 = 3; iVar7 = 2; fStack_54 = 2.8026e-45; auStack_5c = (undefined1 [8])((ulonglong)auStack_5c & 0xffffffff); if (local_48 < 100.0) { fStack_54 = 7.00649e-45; } std::vector<8byte>::_Emplace_reallocate(0,auStack_5c + 4); uVar4 = 0; uVar6 = local_34._capacity - (int)local_34._data >> 3; if (uVar6 != 0) { do { if (*(int *)((int)local_34._data + uVar4 * 8) == 1) { outcomeWeight = (int *)((int)local_34._data + uVar4 * 8 + 4); *outcomeWeight = *outcomeWeight + 3; if (*outcomeWeight < 0) { *(undefined4 *)((int)local_34._data + uVar4 * 8 + 4) = 0; } goto LAB_00550c3d; } uVar4 = uVar4 + 1; } while (uVar4 < uVar6); } auStack_5c._4_4_ = 1; fStack_54 = 4.2039e-45; if (local_34._capacity == local_34._size) { std::vector<8byte>::_Emplace_reallocate(local_34._capacity,auStack_5c + 4); } else { *(undefined4 *)local_34._capacity = 1; *(undefined4 *)(local_34._capacity + 4) = 3; local_34._capacity = local_34._capacity + 8; } LAB_00550c3d: if (100.0 < local_48) { if (200.0 < local_48) { iVar7 = 9; } uVar6 = local_34._capacity - (int)local_34._data >> 3; uVar4 = 0; if (uVar6 != 0) { do { if (*(int *)((int)local_34._data + uVar4 * 8) == 2) { outcomeWeight = (int *)((int)local_34._data + uVar4 * 8 + 4); *outcomeWeight = *outcomeWeight + iVar7; if (*outcomeWeight < 0) { *(undefined4 *)((int)local_34._data + uVar4 * 8 + 4) = 0; } goto LAB_00550caf; } uVar4 = uVar4 + 1; } while (uVar4 < uVar6); } auStack_5c._4_4_ = 2; fStack_54 = (float)iVar7; if (local_34._capacity == local_34._size) { std::vector<8byte>::_Emplace_reallocate(local_34._capacity,auStack_5c + 4); } else { *(undefined4 *)local_34._capacity = 2; *(int *)(local_34._capacity + 4) = iVar7; local_34._capacity = local_34._capacity + 8; } } LAB_00550caf: pickerSeed = Random(); pickerSeed = pickerSeed | 1; auStack_5c = (undefined1 [8])0x900000005; fStack_54 = 9.80909e-45; rng._shift1 = 5; rng._seed = pickerSeed; rng._shift2 = 9; rng._shift3 = 7; uVar4 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)&local_34._data,rng); pEVar1 = self; if (uVar4 == 0) { animData = (self->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00550fdf: bVar3 = ANM2::SetAnimation(&self->_sprite,(byte *)"HopShort",1); if (bVar3 != 0) { AnimationState::Rewind(&(pEVar1->_sprite)._animState); (pEVar1->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimText = "HopShort"; do { bVar3 = *animNameChar; isLess = bVar3 < (byte)*expectedAnimText; if (bVar3 != *expectedAnimText) { LAB_00550fc1: uVar4 = -(uint)isLess | 1; goto LAB_00550fc6; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; isLess = bVar3 < (byte)expectedAnimText[1]; if (bVar3 != expectedAnimText[1]) goto LAB_00550fc1; animNameChar = animNameChar + 2; expectedAnimText = expectedAnimText + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00550fc6: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((self->_sprite)._animState._isPlaying == 0)))) goto LAB_00550fdf; } uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 + 5.0; local_68.y = fVar8 * local_44; local_40 = local_40 * fVar8; uVar4 = Random(); fStack_54 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 90.0 - 45.0) * 0.017453292; local_48 = cos(fStack_54); fVar9 = sin(fStack_54); fVar8 = local_68.y * local_48 - local_40 * fVar9; fVar9 = local_40 * local_48 + local_68.y * fVar9; } else if (uVar4 == 1) { animData = (self->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00550e9e: bVar3 = ANM2::SetAnimation(&self->_sprite,&DAT_00b1de1c,1); if (bVar3 != 0) { AnimationState::Rewind(&(pEVar1->_sprite)._animState); (pEVar1->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimName = &DAT_00b1de1c; do { bVar3 = *animNameChar; isLess = bVar3 < *expectedAnimName; if (bVar3 != *expectedAnimName) { LAB_00550e80: uVar4 = -(uint)isLess | 1; goto LAB_00550e85; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; isLess = bVar3 < expectedAnimName[1]; if (bVar3 != expectedAnimName[1]) goto LAB_00550e80; animNameChar = animNameChar + 2; expectedAnimName = expectedAnimName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00550e85: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((self->_sprite)._animState._isPlaying == 0)))) goto LAB_00550e9e; } uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar8 = fVar8 + fVar8 + 8.0; local_68.y = fVar8 * local_44; local_40 = local_40 * fVar8; uVar4 = Random(); fStack_54 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_48 = cos(fStack_54); fVar9 = sin(fStack_54); fVar8 = local_68.y * local_48 - local_40 * fVar9; fVar9 = local_40 * local_48 + local_68.y * fVar9; } else if (uVar4 == 2) { animData = (self->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00550d55: bVar3 = ANM2::SetAnimation(&self->_sprite,(byte *)"HopLong",1); if (bVar3 != 0) { AnimationState::Rewind(&(pEVar1->_sprite)._animState); (pEVar1->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimText = "HopLong"; do { bVar3 = *animNameChar; isLess = bVar3 < (byte)*expectedAnimText; if (bVar3 != *expectedAnimText) { LAB_00550d37: uVar4 = -(uint)isLess | 1; goto LAB_00550d3c; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; isLess = bVar3 < (byte)expectedAnimText[1]; if (bVar3 != expectedAnimText[1]) goto LAB_00550d37; animNameChar = animNameChar + 2; expectedAnimText = expectedAnimText + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00550d3c: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((self->_sprite)._animState._isPlaying == 0)))) goto LAB_00550d55; } uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 10.0; local_68.y = fVar8 * local_44; local_40 = local_40 * fVar8; uVar4 = Random(); fStack_54 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292; local_48 = cos(fStack_54); fVar9 = sin(fStack_54); fVar8 = local_68.y * local_48 - local_40 * fVar9; fVar9 = local_40 * local_48 + local_68.y * fVar9; } else { fVar8 = local_44; fVar9 = local_40; } (pEVar1->_targetPosition).x = fVar8; (pEVar1->_targetPosition).y = fVar9; pEVar1->_state = 6; if (local_34._data == (void *)0x0) { ExceptionList = local_1c; return; } uVar4 = local_34._size - (int)local_34._data & 0xfffffff8; pvVar5 = local_34._data; if (0xfff < uVar4) { pvVar5 = *(void **)((int)local_34._data + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_34._data + (-4 - (int)pvVar5))) { LAB_00551116: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar4); ExceptionList = local_1c; return; } //@@ 005513a0 NpcAI::ENTITY_COHORT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 857 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_COHORT(Entity_NPC *npc) { byte bVar1; byte *anim; Vector *calcTargetPos; Vector *pVVar2; Entity_Effect *landEffect; undefined4 effectColor; Entity *target; Entity_Projectile *projectile; uint uVar3; float fVar4; int iVar5; int childCount; float fVar6; float fVar7; Vector VStack_1c0; char npcQuery [4]; void *npcQueryData; Vector VStack_1b0; Vector VStack_1a8; float jumpTargetX; Vector targetVec; byte isLineOfSight; ProjectileParams deathParams; ProjectileParams projParams; uint local_14; void *local_10; undefined1 *puStack_c; float fStack_8; Manager *manager; fStack_8 = -NAN; puStack_c = &LAB_00af4b30; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&projParams)[1].CurvingStrength; ExceptionList = &local_10; VStack_1b0.y = (float)g_game->_room; fVar4 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); VStack_1a8.y = fVar4; switch(npc->_state) { case 0: npc->_state = 3; npc->_stateFrame = 0; npc->_i1 = 0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; default: goto LAB_00551c99; case 3: npc->_friction = npc->_friction * 0.8; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_stateFrame = npc->_stateFrame + (int)fVar4; if (8 < npc->_stateFrame) { target = Entity_NPC::GetPlayerTarget(npc); pVVar2 = &npc->_pos; targetVec.x = (target->_pos).x; targetVec.y = (target->_pos).y; isLineOfSight = Room::CheckLine((Room *)VStack_1b0.y,pVVar2,&targetVec,3,0,0,0,(Vector *)0x0); uVar3 = Random(); if ((uVar3 % 3 == 0) || ((4 < npc->_i1 && (uVar3 = Random(), uVar3 % 3 != 0)))) { jumpTargetX = pVVar2->x; fVar6 = (npc->_pos).y - targetVec.y; fVar6 = sqrtf(fVar6 * fVar6 + (jumpTargetX - targetVec.x) * (jumpTargetX - targetVec.x)); if (fVar6 < 420.0) { (npc->_sprite)._flipX = 0.0 < targetVec.x - jumpTargetX; uVar3 = Random(); if (((uVar3 & 1) == 0) && (isLineOfSight != 0)) { iVar5 = 8; anim = s_Attack1; } else { iVar5 = 9; anim = s_Attack2; } ANM2::Play(&npc->_sprite,anim,0); npc->_state = iVar5; npc->_i1 = 0; goto LAB_00551c99; } } bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000a00); if ((bVar1 == 0) && (bVar1 = Room::CheckLine((Room *)VStack_1b0.y,pVVar2,&targetVec,0,0,0,0,(Vector *)0x0), bVar1 == 0)) { VStack_1c0.y = npc->_friction; pVVar2 = &npc->_velocity; fVar4 = pVVar2->x; fVar6 = (npc->_velocity).y; pVVar2->x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; PathFinder::Reset((PathFinder *)&npc->_pathfinder); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetVec,1.0,0,1); bVar1 = Vector::operator_ne(pVVar2,&g_vectorZero); if (bVar1 == 0) { calcTargetPos = Entity_NPC::CalcTargetPosition(npc,&VStack_1b0,0.0); jumpTargetX = calcTargetPos->x; VStack_1b0.y = calcTargetPos->y; } else { jumpTargetX = pVVar2->x * 300.0 + (npc->_pos).x; VStack_1b0.y = (npc->_velocity).y * 300.0 + (npc->_pos).y; } pVVar2->x = fVar4; (npc->_velocity).y = fVar6; npc->_friction = VStack_1c0.y; fVar4 = VStack_1a8.y; } else { pVVar2 = Entity_NPC::CalcTargetPosition(npc,&VStack_1a8,0.0); jumpTargetX = pVVar2->x; VStack_1b0.y = pVVar2->y; } ANM2::Play(&npc->_sprite,s_Jump,0); VStack_1a8.x = jumpTargetX - (npc->_pos).x; VStack_1a8.y = VStack_1b0.y - (npc->_pos).y; pVVar2 = Vector::Normalized(&VStack_1a8,&VStack_1c0); (npc->_targetPosition).x = pVVar2->x; fVar6 = pVVar2->y; npc->_i1 = npc->_i1 + (int)fVar4; (npc->_targetPosition).y = fVar6; npc->_state = 6; } goto LAB_00551c99; case 6: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar1 == 0 || (bVar1 = ANM2::WasEventTriggered(&npc->_sprite,s_Land), bVar1 != 0)))) { npc->_entityCollisionClass = 4; npc->_friction = npc->_friction * 0.8; } else { npc->_entityCollisionClass = 0; fVar4 = (npc->_targetPosition).y; fVar6 = npc->_friction; fVar7 = ((npc->_targetPosition).x * 1.5) / fVar6 + (npc->_velocity).x; (npc->_velocity).x = fVar7; (npc->_velocity).y = (fVar4 * 1.5) / fVar6 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.9; (npc->_sprite)._flipX = 0.0 < fVar7; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Land); manager = g_manager; if (bVar1 != 0) { VStack_1b0.y = 6.72623e-44; seed_fart_sound_override((int *)&VStack_1b0.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_1b0.y,0.5,2,0,1.0,0.0); uVar3 = Random(); landEffect = (Entity_Effect *) Game::Spawn(g_game,1000,0x10,&npc->_pos,&g_vectorZero,(Entity *)npc,2,uVar3); uVar3 = Random(); (landEffect->_sprite)._offset.x = 0.0; (landEffect->_sprite)._flipX = ~(byte)uVar3 & 1; (landEffect->_sprite)._offset.y = 15.0; effectColor = Color::Color(0x3f333333); (**(code **)(*(int *)landEffect + 0x3c))(effectColor,0xffffffff,0xff,0,1); Entity_Effect::FollowParent(landEffect,(Entity *)npc); (**(code **)(*(int *)landEffect + 0xc))(); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00551c99; } npc->_entityCollisionClass = 4; break; case 8: npc->_friction = npc->_friction * 0.8; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x6c,1.0,2,0,1.0); target = Entity_NPC::GetPlayerTarget(npc); targetVec.x = (target->_pos).x - (npc->_pos).x; targetVec.y = (target->_pos).y - (npc->_pos).y; Vector::Normalized(&targetVec,&VStack_1a8); ProjectileParams::ProjectileParams(&projParams); projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x60; projParams.Acceleration = 0.94; projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&projParams); projectile->_height = -23.0; projectile->_fallingAccel = 0.0; (projectile->_velocity).x = VStack_1a8.x * 10.0; projectile->_fallingSpeed = 0.0; (projectile->_velocity).y = VStack_1a8.y * 10.0; projectile->_scale = 2.0; } LAB_00551c76: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_00551c99; } break; case 9: npc->_friction = npc->_friction * 0.8; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); target = Entity_NPC::GetPlayerTarget(npc); targetVec.x = (target->_pos).x; targetVec.y = (target->_pos).y; ProjectileParams::ProjectileParams(&projParams); Entity_NPC::FireBossProjectiles(npc,0x12,&targetVec,0.0,&projParams); Entity_NPC::QueryNPCsType(npcQuery,0x18,-1); fStack_8 = 0.0; iVar5 = 0; uVar3 = 0; childCount = iVar5; if ((Room *)VStack_1b0.y != (Room *)0x0) { do { iVar5 = childCount + 1; if (*(Entity_NPC **)(*(int *)((int)npcQueryData + uVar3 * 4) + 0x3c8) != npc) { iVar5 = childCount; } uVar3 = uVar3 + 1; childCount = iVar5; } while (uVar3 < (uint)VStack_1b0.y); } if (((uint)VStack_1b0.y < (Room *)0xa) && (iVar5 < 4)) { projParams.Variant = 0xb; projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x400; projectile = Entity_NPC::FireBossProjectiles(npc,1,&targetVec,3.0,&projParams); VStack_1a8.y = -10.0; VStack_1c0.y = projectile->_fallingSpeed; pVVar2 = &VStack_1a8; if (projectile->_fallingSpeed <= -10.0) { pVVar2 = &VStack_1c0; } projectile->_fallingSpeed = pVVar2->y; } fStack_8 = -NAN; if (npcQuery[0] == '\0') { fStack_8 = 1.4013e-45; tracked_alloc(1,npcQueryData,0); fStack_8 = -NAN; } } goto LAB_00551c76; } } npc->_state = 3; npc->_stateFrame = 0; LAB_00551c99: if (npc->_dead != 0) { ProjectileParams::ProjectileParams(&deathParams); deathParams.Variant = 0xb; deathParams.BulletFlags._0_4_ = 0; deathParams.BulletFlags._4_4_ = 0x400; Entity_NPC::FireBossProjectiles(npc,4,&g_vectorZero,10.0,&deathParams); } ExceptionList = local_10; return; } //@@ 00551d30 NpcAI::ENTITY_GENERIC_PROP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 960 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GENERIC_PROP(Entity_NPC *npc) { int iVar1; byte bVar2; byte *curAnimName; uint uVar3; Entity_Player *player; Entity *spawned; std_string *defaultAnimCursor; byte *cmpName; bool isLess; float fVar4; float fVar5; RNG rng; Entity_NPC *savedNpc; float local_50; Vector scratchVec; byte cmpChar; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; byte *animData; GridEntity_Door *door; qword flags; uint *flagsHighPtr; Game *game; void *room; int targetRoomType; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; savedNpc = npc; if (npc->_state == 0) { npc->_state = 3; scratchVec.y = (float)&(npc->_sprite)._animDefaultName; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; if (0xf < (npc->_sprite)._animDefaultName._capacity) { scratchVec.y = *(float *)((std_string *)scratchVec.y)->_buf; } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; defaultAnimCursor = (std_string *)scratchVec.y; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } do { bVar2 = *curAnimName; isLess = bVar2 < (byte)defaultAnimCursor->_buf[0]; if (bVar2 != defaultAnimCursor->_buf[0]) { LAB_00552201: uVar3 = -(uint)isLess | 1; goto LAB_00552206; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; isLess = bVar2 < (byte)defaultAnimCursor->_buf[1]; if (bVar2 != defaultAnimCursor->_buf[1]) goto LAB_00552201; curAnimName = curAnimName + 2; defaultAnimCursor = (std_string *)(defaultAnimCursor->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_00552206: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0055223f; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)scratchVec.y,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0055223f: game = g_game; flags = npc->_flags; flagsHighPtr = (uint *)((int)&npc->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x2008; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x44250011; npc->_isInvicible = 1; if (game->_currentDimensionIdx == 2) { local_40 = 0x3f800000; uStack_3c = 0x3f800000; uStack_38 = 0x3f800000; uStack_34 = 0x3f800000; local_30 = 0x3f800000; fStack_2c = 1.0; fStack_28 = 1.0; fStack_24 = 0.2; local_20 = 0.0; local_1c = 0; local_18 = 0; (**(code **)(*(int *)npc + 0x3c))(&local_40,0xffffffff,0xff,0,1); } return; } if (npc->_state != 3) { return; } if ((((npc->_variant != 4) && (npc->_variant != 3)) || (g_game->_stage != 0xd)) || (g_game->_stageType != 1)) goto LAB_0055215a; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00551e05: bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle2,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } cmpName = s_Idle2; do { cmpChar = *curAnimName; isLess = cmpChar < *cmpName; if (cmpChar != *cmpName) { LAB_00551de7: uVar3 = -(uint)isLess | 1; goto LAB_00551dec; } if (cmpChar == 0) break; cmpChar = curAnimName[1]; isLess = cmpChar < cmpName[1]; if (cmpChar != cmpName[1]) goto LAB_00551de7; curAnimName = curAnimName + 2; cmpName = cmpName + 2; } while (cmpChar != 0); uVar3 = 0; LAB_00551dec: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00551e05; } if (((npc->_variant == 4) && (npc->_i1 == 0)) && (4 < g_game->_frameCount - npc->_spawnFrame)) { local_50 = (npc->_pos).x + 0.0; uVar3 = 0; scratchVec.y = (npc->_pos).y + 100.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar3); if (((player->_variant == 0) && (player->_dead == 0)) && (ABS((player->_pos).y - scratchVec.y) <= 120.0)) { fVar5 = (player->_prevPosition).x; if (((fVar5 < local_50 - 10.0) && (local_50 - 10.0 <= (player->_pos).x)) || (((local_50 + 10.0 < fVar5 && ((player->_pos).x <= local_50 + 10.0)) || (fVar5 = ((npc->_pos).x + 0.0) - fVar5, fVar4 = ((npc->_pos).y + 60.0) - (player->_prevPosition).y, fVar4 * fVar4 + fVar5 * fVar5 <= 6400.0)))) { rng._seed = npc->_initSeed; npc->_i1 = 1; rng._shift1 = 1; rng._shift2 = 0xb; rng._shift3 = 0x10; uVar3 = RNG::Next(&rng); scratchVec.x = (npc->_pos).x - 8.0; scratchVec.y = (npc->_pos).y + 40.0; spawned = Game::Spawn(g_game,0x3b6,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar3); fVar5 = (npc->_pos).y; iVar1 = *(int *)spawned; (spawned->_targetPosition).x = (npc->_pos).x; (spawned->_targetPosition).y = fVar5; (**(code **)(iVar1 + 0xc))(); game = g_game; entity_vector_set_flag_410(&g_game->_playerManager,0); room = game->_room; uVar3 = 0; if (*(int *)((int)room + 0x1264) != 0) { do { scratchVec.y = *(float *)(*(int *)((int)room + 0x125c) + uVar3 * 4); if (*(int *)((int)scratchVec.y + 0x28) == 4) { fStack_2c = g_vectorZero.x; fStack_24 = g_vectorZero.x; fStack_28 = g_vectorZero.y; local_20 = g_vectorZero.y; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_30 = 0; local_1c = 0; local_18 = 0; (**(code **)(*(int *)scratchVec.y + 0x24))(&uStack_3c); } uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)room + 0x1264)); npc = savedNpc; } local_50 = 0.0; scratchVec.y = 2.56157e-42; do { local_50 = (float)((int)local_50 + 1); if ((((uint)local_50 < 9) && (door = *(GridEntity_Door **)((int)scratchVec.y + (int)g_game->_room), door != (GridEntity_Door *)0x0)) && ((door->_desc)._state != 1)) { (door->_desc)._state = 1; GridEntity_Door::UpdateAnimation(door); iVar1 = door->_currentRoomType; if (((((iVar1 == 7) || (targetRoomType = door->_targetRoomType, targetRoomType == 7) ) || (iVar1 == 8)) || ((targetRoomType == 8 || (iVar1 == 0x1d)))) || (targetRoomType == 0x1d)) { std::string::assign((door->_openAnimation)._buf,s_Open,4); } } scratchVec.y = (float)((int)scratchVec.y + 4); } while ((int)scratchVec.y < 0x744); MusicManager::Crossfade(&g_manager->_musicManager,0x43,0.04); break; } } uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } LAB_0055215a: fVar5 = (npc->_targetPosition).y; fVar4 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar5 - fVar4; return; } //@@ 005522d0 NpcAI::ENTITY_SHADY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 888 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SHADY(Entity_NPC *npc) { byte bVar1; Vector *pVVar2; ColorMod *color; uint uVar3; Entity *target; Vector *direction; ColorMod *color_00; void *allocBlock; int iVar4; float fVar5; float fVar6; int iVar7; Vector VStack_120; AnimationState *pAStack_118; Vector VStack_114; Vector VStack_10c; ProjectileParams projParams; undefined1 auStack_58 [28]; float fStack_3c; float fStack_38; float fStack_34; float fStack_30; std_string animName; uint local_14; void *local_10; undefined1 *puStack_c; uint uStack_8; AnimationState *animState; Manager *manager; EntityPtr *parentRef; uStack_8 = 0xffffffff; puStack_c = &LAB_00af4b85; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&animName)[1]._size; ExceptionList = &local_10; switch(npc->_state) { case 0: npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)"WalkVert",0); auStack_58._0_4_ = 0.0; auStack_58._4_4_ = 0.0; auStack_58._8_4_ = 0.0; auStack_58._12_4_ = 1.0; fStack_38 = 0.0; fStack_34 = 0.0; auStack_58._16_4_ = 0.0; auStack_58._20_4_ = 0.0; auStack_58._24_4_ = 0.0; fStack_3c = 0.0; fStack_30 = 0.0; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)auStack_58); break; case 4: fStack_30 = 2.10195e-44; fStack_34 = 1.12104e-44; auStack_58._20_4_ = 2.8576617e+26; auStack_58._24_4_ = 7.681831e+31; fStack_3c = (float)((uint)fStack_3c & 0xffffff00); animName._capacity = 0xf; animName._size = 8; builtin_strncpy(animName._buf,"WalkHori",8); animName._buf._8_2_ = animName._buf._8_2_ & 0xff00; uStack_8 = 1; Entity_NPC::AnimWalkFrame(npc,&animName,(std_string *)(auStack_58 + 0x14),0.1); uStack_8 = uStack_8 & 0xffffff00; if (0xf < animName._capacity) { uVar3 = animName._capacity + 1; allocBlock = (void *)animName._buf._0_4_; if (0xfff < uVar3) { allocBlock = *(void **)(animName._buf._0_4_ + -4); uVar3 = animName._capacity + 0x24; if (0x1f < (uint)(animName._buf._0_4_ + (-4 - (int)allocBlock))) goto LAB_0055244c; } operator_delete(allocBlock,uVar3); } uStack_8 = 0xffffffff; animName._size = 0; animName._capacity = 0xf; animName._buf._0_8_ = animName._buf._0_8_ & 0xffffffffffffff00; if (0xf < (uint)fStack_30) { uVar3 = (int)fStack_30 + 1; allocBlock = (void *)auStack_58._20_4_; if (0xfff < uVar3) { allocBlock = *(void **)(auStack_58._20_4_ + -4); uVar3 = (int)fStack_30 + 0x24; if (0x1f < (uint)(auStack_58._20_4_ + (-4 - (int)allocBlock))) { LAB_0055244c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar3); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { bVar1 = 1; iVar7 = 900; fVar5 = 0.3; pVVar2 = Entity_NPC::CalcTargetPosition(npc,&VStack_10c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar2,fVar5,iVar7,bVar1); if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } if (0 < npc->_projectileDelay) { npc->_projectileDelay = npc->_projectileDelay - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } target = Entity_NPC::GetPlayerTarget(npc); VStack_114.y = (target->_pos).x; pAStack_118 = (AnimationState *)(target->_pos).y; if (npc->_projectileCooldown < 1) { if (npc->_controllerID == -1) { fVar6 = (npc->_pos).x - VStack_114.y; fVar5 = (npc->_pos).y - (float)pAStack_118; fVar5 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if (((fVar5 < 120.0) && (uVar3 = Random(), uVar3 % 10 == 0)) || (uVar3 = Random(), uVar3 % 0x28 == 0)) goto LAB_0055263d; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar1 != 0) { LAB_0055263d: ANM2::Play(&npc->_sprite,s_Jump,0); npc->_state = 8; VStack_10c.x = VStack_114.y - (npc->_pos).x; VStack_10c.y = (float)pAStack_118 - (npc->_pos).y; direction = Vector::Normalized(&VStack_10c,&VStack_120); pVVar2 = &npc->_targetPosition; fVar5 = direction->y; pVVar2->x = direction->x * 12.0; (npc->_targetPosition).y = fVar5 * 12.0; if (npc->_controllerID != -1) { direction = Entity_NPC::GetControllerMovementInput(npc,&VStack_10c,0.0); fVar5 = direction->x; (npc->_targetPosition).y = direction->y * 12.0; pVVar2->x = fVar5 * 12.0; bVar1 = Vector::operator_eq(pVVar2,&g_vectorZero); if (bVar1 != 0) { direction = Entity_NPC::GetControllerInput(npc,&VStack_10c,0.0); fVar5 = direction->y; pVVar2->x = direction->x * 12.0; (npc->_targetPosition).y = fVar5 * 12.0; } } npc->_projectileCooldown = 0x78; goto LAB_0055286f; } } } if (npc->_projectileDelay < 1) { if (npc->_controllerID == -1) { uVar3 = Random(); bVar1 = uVar3 % 10 == 0; } else { bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); } if (bVar1 != 0) { fStack_30 = 2.10195e-44; fStack_34 = 1.4013e-44; auStack_58._20_4_ = 2.818364e+20; auStack_58._24_4_ = 6.328546e+22; fStack_3c = (float)CONCAT13(fStack_3c._3_1_,0x7472); animName._capacity = 0xf; animName._size = 10; builtin_strncpy(animName._buf,"AttackHori",0xb); uStack_8 = 3; Entity_NPC::AnimWalkFrame(npc,&animName,(std_string *)(auStack_58 + 0x14),0.0); uStack_8 = CONCAT31(uStack_8._1_3_,2); if (0xf < animName._capacity) { uVar3 = animName._capacity + 1; allocBlock = (void *)animName._buf._0_4_; if (0xfff < uVar3) { allocBlock = *(void **)(animName._buf._0_4_ + -4); uVar3 = animName._capacity + 0x24; if (0x1f < (uint)(animName._buf._0_4_ + (-4 - (int)allocBlock))) goto LAB_0055284b; } operator_delete(allocBlock,uVar3); } uStack_8 = 0xffffffff; animName._size = 0; animName._capacity = 0xf; animName._buf._0_8_ = animName._buf._0_8_ & 0xffffffffffffff00; if (0xf < (uint)fStack_30) { uVar3 = (int)fStack_30 + 1; allocBlock = (void *)auStack_58._20_4_; if (0xfff < uVar3) { allocBlock = *(void **)(auStack_58._20_4_ + -4); uVar3 = (int)fStack_30 + 0x24; if (0x1f < (uint)(auStack_58._20_4_ + (-4 - (int)allocBlock))) { LAB_0055284b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar3); } npc->_state = 9; npc->_projectileDelay = 100; } } } else { target = Entity_NPC::GetPlayerTarget(npc); VStack_10c.x = (target->_pos).x; VStack_10c.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&VStack_10c,0); iVar7 = (npc->_pathfinder)._evadeMovementCountdown; fVar5 = npc->_friction * 0.8; npc->_friction = fVar5; if (0 < iVar7) { npc->_friction = fVar5 * 0.8; } } LAB_0055286f: if (((npc->_pathfinder)._hasDirectPath != 0) && (uVar3 = Random(), uVar3 % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,1.0,0x3c,0,1.0); } break; case 8: animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { pAStack_118 = animState; bVar1 = AnimationState::IsEventTriggered(animState,s_Jump); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0xf9,1.0,10,0,1.0); fVar5 = npc->_speedMultiplier; (npc->_velocity).x = fVar5 * (npc->_targetPosition).x + (npc->_velocity).x; (npc->_velocity).y = fVar5 * (npc->_targetPosition).y + (npc->_velocity).y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; pAStack_118 = animState; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); manager = g_manager; if (bVar1 != 0) { VStack_114.y = 7.28675e-44; seed_fart_sound_override((int *)&VStack_114.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_114.y,1.0,0x14,0,1.0,0.0); Game::ShakeScreen(g_game,0xe); Game::MakeShockwave(g_game,&npc->_pos,0.035,0.03,10); Color::Color((Color *)auStack_58); Entity::MakeBloodPoof((Entity *)npc,&npc->_pos,color,1.0); iVar7 = 0; do { uVar3 = Random(); VStack_10c.y = (float)Game::Spawn(g_game,1000,0x48,&npc->_pos,&g_vectorZero, (Entity *)npc,10,uVar3); parentRef = &((Entity *)VStack_10c.y)->_parent; if (((Entity *)VStack_10c.y)->_parent != (EntityPtr)0x0) { VStack_114.y = (float)parentRef; std::multiset::erase(&VStack_114.y); } *parentRef = (EntityPtr)npc; std::multiset::insert(parentRef); iVar4 = iVar7 + 1; *(float *)((((Entity *)((int)VStack_10c.y + 0x40c))->_sprite)._animDefaultName._buf + 8) = (float)iVar7 * 90.0; iVar7 = iVar4; } while (iVar4 < 4); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::WasEventTriggered(pAStack_118,(byte *)"Shoot"), bVar1 != 0)) goto LAB_00552cbe; } } if (((npc->_targetPosition).x == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y) ) { fVar5 = npc->_friction * 0.9; } else { fVar5 = npc->_friction * 0.6; } goto LAB_00552cce; case 9: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), manager = g_manager, bVar1 != 0)) { VStack_114.y = 2.98477e-43; seed_fart_sound_override((int *)&VStack_114.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_114.y,1.0,2,0,1.0,0.0); target = Entity_NPC::GetPlayerTarget(npc); pVVar2 = &npc->_pos; VStack_10c.x = (target->_pos).x - pVVar2->x; VStack_10c.y = (target->_pos).y - (npc->_pos).y; direction = Vector::Normalized(&VStack_10c,&VStack_114); VStack_120.y = direction->y * 10.0; VStack_120.x = direction->x * 10.0; VStack_10c.y = VStack_120.y * 0.4; VStack_10c.x = VStack_120.x * 0.4; Color::Color((Color *)auStack_58); VStack_114.x = 0.0; VStack_114.y = (float)&DAT_c1c80000; spawn_blood_explosion(3,pVVar2,&VStack_114,color_00,&VStack_10c); ProjectileParams::ProjectileParams(&projParams); projParams.Scale = 2.0; auStack_58._16_4_ = 0.0; auStack_58._20_4_ = 0.0; auStack_58._24_4_ = 0.0; fStack_3c = 0.0; projParams.FallingAccelModifier = -0.08; projParams.BulletFlags._0_4_ = 0; projParams.BulletFlags._4_4_ = 0x800000; auStack_58._0_4_ = &DAT_bf800000; auStack_58._4_4_ = &DAT_bf800000; auStack_58._8_4_ = &DAT_bf800000; auStack_58._12_4_ = 1.0; fStack_38 = 1.0; fStack_34 = 0.0; fStack_30 = 0.0; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)auStack_58); Entity_NPC::FireProjectiles(npc,pVVar2,&VStack_120,0,&projParams); } LAB_00552cbe: fVar5 = npc->_friction * 0.6; LAB_00552cce: npc->_friction = fVar5; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 4; } } ExceptionList = local_10; return; } //@@ 00552d30 NpcAI::ENTITY_BLOOD_PUPPY /* NPC AI for entity type 802 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BLOOD_PUPPY(Entity_NPC *npc) { byte bVar1; char isBridged; uint flagsHigh; EntityRef *killRef; float *pfVar3; EntityPtr tmpEntity; Vector *vecResult; int iVar4; char *animName; void *animData; uint gridCollision; GridEntity *game; int iVar6; char *slowAnimName; bool bVar7; float fVar8; float fVar9; float stepY; float fVar10; float fVar11; EntityRef local_b8; Capsule local_90; float local_8c; int local_88; int local_84; float local_80; float local_7c; float local_78; float local_74; uint local_70; Entity_NPC *local_6c; float npcX; undefined1 local_64 [12]; EntityPtr local_58; int elapsedFrames; EntityPtr targetPlayer; Vector local_4c; Room *room; Vector scratchVec; Vector local_38; float local_30; GridEntity *local_2c; EntityPtr local_28; bool local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; float stepX; undefined4 flagsHigh; Game *game; Manager *manager; Entity_NPC *nearbyEntity; EntityPtr parent; float targetSpeedMultiplier; puStack_20 = local_64 + 0x60; local_14 = 0xffffffff; puStack_18 = &LAB_00af4bb0; local_1c = ExceptionList; flagsHigh = __security_cookie ^ (uint)(local_64 + 0x54); ExceptionList = &local_1c; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; room = g_game->_room; if (npc->_aiCallPhase == 1) { if (((g_game->_frameCount - npc->_spawnFrame < 5) && (tmpEntity = npc->_parent, tmpEntity != (EntityPtr)0x0)) && (*(int *)((int)tmpEntity + 0x28) == 3)) { npc->_i2 = *(int *)((int)tmpEntity + 0xd7c); } if (((npc->_type == 0x322) && (npc->_dead == 0)) && (npc->_parent == (EntityPtr)0x0)) { puStack_20 = local_64 + 0x60; killRef = EntityRef::EntityRef(&local_b8); (**(code **)(*(int *)npc + 0x24))(killRef); } if (npc->_pendingDamage <= 0.0) { ExceptionList = local_1c; return; } npc->_pendingDamage = 0.0; pfVar3 = (npc->_damageEvents)._begin; if (pfVar3 == (npc->_damageEvents)._end) { ExceptionList = local_1c; return; } do { fVar8 = pfVar3[2]; if (((((uint)fVar8 & 0x1000086) != 0) && (((uint)pfVar3[0xc] >> 1 & 1) == 0)) && ((pfVar3[4] != 1.4013e-45 && (((pfVar3[6] != 1.4013e-45 && (pfVar3[6] != 4.2039e-45)) && (((uint)fVar8 & 0x1000) == 0)) )))) { *pfVar3 = 0.0; goto LAB_00552ee8; } if (((((uint)fVar8 & 8) == 0) || (((uint)pfVar3[0xc] >> 1 & 1) != 0)) || ((pfVar3[4] == 1.4013e-45 || (pfVar3[4] == 4.2039e-45)))) { fVar8 = pfVar3[4]; if (fVar8 == 1.26117e-44) { fVar8 = *pfVar3 * 0.01; goto LAB_00552ee4; } if (fVar8 == 4.2039e-45) { if (pfVar3[5] == 3.37713e-43) goto LAB_00552ec7; } else { if (fVar8 == 1.12384e-42) { LAB_00552ec7: fVar8 = *pfVar3 * 0.01; goto LAB_00552ee4; } if ((int)fVar8 - 10U < 0x3de) { fVar8 = *pfVar3 * 0.1; goto LAB_00552ee4; } } } else { fVar8 = *pfVar3 * 0.01; LAB_00552ee4: *pfVar3 = fVar8; } LAB_00552ee8: fVar8 = *pfVar3; pfVar3 = pfVar3 + 0xe; npc->_pendingDamage = npc->_pendingDamage + fVar8; if (pfVar3 == (npc->_damageEvents)._end) { ExceptionList = local_1c; return; } } while( true ); } switch(npc->_state) { case 0: flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10; npc->_state = 3; npc->_aiCallFlags = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; break; case 3: goto switchD_00552f2c_caseD_3; case 8: animData = (npc->_sprite)._animState._animData; if ((animData == (void *)0x0) || (puStack_20 = local_64 + 0x60, (npc->_sprite)._animState._isPlaying == 0)) { if (npc->_i1 == 1) { animName = "Attack Up"; LAB_00553858: puStack_20 = local_64 + 0x60; ANM2::Play(&npc->_sprite,(byte *)animName,0); bVar7 = false; } else { if (npc->_i1 == 3) { animName = "Attack Down"; goto LAB_00553858; } puStack_20 = local_64 + 0x60; ANM2::Play(&npc->_sprite,(byte *)"Attack Hori",0); bVar7 = npc->_i1 == 0; } (npc->_sprite)._flipX = bVar7; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; iVar4 = npc->_variant; npc->_stateFrame = 0; (npc->_v1).x = 5.0; if (iVar4 == 0) { fVar8 = 1.1; } else { fVar8 = 0.9; } play_sound_with_fart_seed(0x73,1.0,2,0,fVar8); animData = (npc->_sprite)._animState._animData; if (animData != (void *)0x0) goto LAB_005538cd; } else { LAB_005538cd: if (*(char *)((int)animData + 0x34) != '\0') { Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,npc->_i1); if ((npc->_collidesWithGrid != 0) && (npc->_variant == 1)) { pfVar3 = (npc->_collisionPoints)._begin; isBridged = '\0'; local_21 = false; if (pfVar3 != (npc->_collisionPoints)._end) { do { fVar8 = (((npc->_gridCollisionVelocity).x * 0.5 + (npc->_pos).x + *pfVar3) - 40.0) / 40.0 + 0.5; iVar6 = (int)fVar8; iVar4 = (int)((((npc->_gridCollisionVelocity).y * 0.5 + (npc->_pos).y + pfVar3[1]) - 120.0) / 40.0 + 0.5); if (-1 < iVar6) { if ((((iVar6 < room->_gridWidth) && (-1 < iVar4)) && (iVar4 < room->_gridHeight)) && (iVar4 = room->_gridWidth * iVar4 + (int)fVar8, -1 < iVar4)) { if (iVar4 < 0x1c0) { local_2c = room->_gridEntities[iVar4]; } else { local_2c = (GridEntity *)0x0; } gridCollision = Room::GetGridCollision(room,iVar4); if (((gridCollision == 3) || (gridCollision == 2)) && ((local_2c != (GridEntity *)0x0 && (local_2c->_collisionClass == 3)))) { local_80 = (npc->_pos).x; local_7c = (npc->_pos).y; local_4c.y = *(float *)(*(int *)local_2c + 0x14); local_90 = (Capsule)npc->_type; local_8c = (float)npc->_variant; local_88 = npc->_spawnerType; local_84 = npc->_spawnerVariant; local_78 = (npc->_velocity).x; local_74 = (npc->_velocity).y; local_28 = (EntityPtr)0x2; if ((npc->_flags & 0x20000000) == 0) { local_28 = (EntityPtr)0x0; } if ((npc->_flags & 0x40000000000000) == 0) { local_70 = 0; } else { local_70 = 4; } local_70 = (uint)((npc->_flags & 0x100) != 0) | (uint)local_28 | local_70; local_6c = npc; isBridged = (*(code *)local_4c.y)(0,&local_90,flagsHigh); if (isBridged != '\0') { local_28 = (EntityPtr)g_game->_room; local_30 = *(float *)((int)local_28 + 0xc); fVar11 = (float)(local_2c->_gridIndex % (int)local_30) * 40.0 + 40.0; fVar8 = (float)(local_2c->_gridIndex / (int)local_30) * 40.0 + 120.0; fVar9 = fVar11 - (npc->_pos).x; fVar10 = fVar8 - (npc->_pos).y; if (ABS(fVar9) <= ABS(fVar10)) { stepX = 0.0; if (0.0 <= fVar10) { stepY = 1.0; } else { stepY = (float)&DAT_bf800000; } } else { stepY = 0.0; if (0.0 <= fVar9) { stepX = 1.0; } else { stepX = (float)&DAT_bf800000; } } iVar6 = (int)(((stepX * 40.0 + fVar11) - 40.0) / 40.0 + 0.5); iVar4 = (int)(((fVar8 + stepY * 40.0) - 120.0) / 40.0 + 0.5); if (((-1 < iVar6) && (iVar6 < (int)local_30)) && ((-1 < iVar4 && ((iVar4 < *(int *)((int)local_28 + 0x10) && (iVar6 = iVar4 * (int)local_30 + iVar6, -1 < iVar6)))))) { if (iVar6 < 0x1c0) { game = room->_gridEntities[iVar6]; } else { game = (GridEntity *)0x0; } Room::TryMakeBridge((Room *)local_28,game,local_2c); } local_21 = true; isBridged = '\x01'; goto LAB_00553c13; } } } isBridged = local_21; } LAB_00553c13: pfVar3 = pfVar3 + 2; } while (pfVar3 != (npc->_collisionPoints)._end); if (isBridged != '\0') { npc->_stateFrame = 0; fVar8 = (npc->_gridCollisionVelocity).y; (npc->_velocity).x = (npc->_gridCollisionVelocity).x * 0.5; (npc->_velocity).y = fVar8 * 0.5; } } } local_4c.x = npc->_speedMultiplier * (npc->_velocity).x + (npc->_pos).x; local_38.y = npc->_size * 1.2; local_4c.y = npc->_speedMultiplier * (npc->_velocity).y + (npc->_pos).y; Capsule::constructor((Capsule *)&local_b8,&local_4c,&npc->_sizeMulti,0.0,local_38.y); EntityList::QueryRadius (&room->_entityList,(EntityList_EL *)local_64,(Vector *)&local_b8, local_38.y + 80.0,8); local_4c.y = 0.0; local_4c.x = 0.0; local_28 = (EntityPtr)0x0; if (local_58 != (EntityPtr)0x0) { do { nearbyEntity = *(Entity_NPC **)(local_64._4_4_ + (int)local_28 * 4); if (((nearbyEntity != npc) && (nearbyEntity->_type != 0x322)) && ((nearbyEntity->_entityCollisionClass == 4 || (nearbyEntity->_entityCollisionClass == 3)))) { fVar8 = (nearbyEntity->_pos).x; fVar9 = (nearbyEntity->_pos).y; if (0.0 < scratchVec.x * (fVar8 - (npc->_pos).x) + (fVar9 - (npc->_pos).y) * scratchVec.y) { local_38.x = fVar8 + g_vectorZero.x; local_38.y = fVar9 + g_vectorZero.y; Capsule::constructor (&local_90,&local_38,&nearbyEntity->_sizeMulti, (nearbyEntity->_sprite)._rotation,nearbyEntity->_size); local_90 = (Capsule)((float)local_90 + nearbyEntity->_speedMultiplier * (nearbyEntity->_velocity).x); local_8c = local_8c + nearbyEntity->_speedMultiplier * (nearbyEntity->_velocity).y; bVar1 = Capsule::Collide((Capsule *)&local_b8,&local_90,&local_4c); game = g_game; if ((bVar1 != 0) && ((((1 < *(int *)&g_game->_deathmatchManager && (nearbyEntity->_type == 1)) || (nearbyEntity->_type - 10U < 0x3de)) || (nearbyEntity->_type == 4)))) { fVar8 = npc->_speedMultiplier; if (fVar8 == 1.0) { fVar8 = 0.6; } else { fVar8 = 0.6 / ((fVar8 + 0.6) - fVar8 * 0.6); } fVar9 = (nearbyEntity->_velocity).x; fVar10 = (nearbyEntity->_velocity).y; fVar11 = (npc->_velocity).y; fVar9 = ((npc->_velocity).x - fVar9) * fVar8 + fVar9; (nearbyEntity->_velocity).x = fVar9; (nearbyEntity->_velocity).y = (fVar11 - fVar10) * fVar8 + fVar10; if (((1 < *(int *)&game->_deathmatchManager) && (nearbyEntity->_type == 1)) || ((nearbyEntity->_type - 10U < 0x3de || (nearbyEntity->_type == 4)))) { fVar8 = nearbyEntity->_size; fVar10 = nearbyEntity->_friction; fVar11 = (nearbyEntity->_pos).x; if (fVar10 != 0.0) { targetSpeedMultiplier = nearbyEntity->_speedMultiplier; (nearbyEntity->_velocity).y = ((((float)local_b8._variant + fVar8 * scratchVec.y) - (nearbyEntity->_pos).y) * 0.6 * targetSpeedMultiplier) / fVar10 + (nearbyEntity->_velocity).y; (nearbyEntity->_velocity).x = fVar9 + ((((float)local_b8._type + fVar8 * scratchVec.x) - fVar11) * 0.6 * targetSpeedMultiplier) / fVar10; } } } } } local_28 = (EntityPtr)((int)local_28 + 1); } while ((uint)local_28 < (uint)local_58); } if (local_64[0] == '\0') { local_14 = 0; tracked_alloc(1,(void *)local_64._4_4_,0); local_14 = 0xffffffff; } fVar8 = (npc->_pos).x; fVar9 = fVar8 - (npc->_targetPosition).x; fVar10 = (npc->_pos).y - (npc->_targetPosition).y; local_21 = false; if (npc->_speedMultiplier * 4.0 * npc->_speedMultiplier <= fVar10 * fVar10 + fVar9 * fVar9) { npc->_stateFrame = 0; } else { npc->_stateFrame = npc->_stateFrame + elapsedFrames; local_21 = 6 < npc->_stateFrame; } (npc->_targetPosition).x = fVar8; (npc->_targetPosition).y = (npc->_pos).y; if (((npc->_variant == 1) && (tmpEntity = npc->_target, tmpEntity != (EntityPtr)0x0)) && ((bVar1 = Entity::IsEnemy((Entity *)tmpEntity), bVar1 != 0 && (((bVar1 = Entity::HasEntityFlags((Entity *)tmpEntity,0x20000000), bVar1 == 0 && ((*(float *)((int)tmpEntity + 0x340) - (npc->_pos).y) * scratchVec.y + (((Vector *)((int)tmpEntity + 0x33c))->x - (npc->_pos).x) * scratchVec.x < -80.0)) && (flagsHigh = Random(), (flagsHigh & 7) == 0)))))) { local_21 = true; npc->_projectileCooldown = 0xf; if (npc->_i1 == 1) { animName = "AttackStop Up"; } else { if (npc->_i1 != 3) { ANM2::Play(&npc->_sprite,(byte *)"AttackStop Hori",0); (npc->_sprite)._flipX = npc->_i1 == 0; goto LAB_00554103; } animName = "AttackStop Down"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); (npc->_sprite)._flipX = 0; } LAB_00554103: flagsHigh = Random(); if ((flagsHigh & 1) == 0) { flagsHigh = Random(); Entity_NPC::MakeSplat (npc,(float)((double)npc->_variant + __uint_to_double_fixup[-(npc->_variant >> 0x1f)]) * 0.3 + (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.3); } fVar8 = npc->_speedMultiplier; fVar9 = (npc->_v1).x - fVar8 * 0.1; if (fVar9 <= 3.0) { fVar9 = 3.0; } (npc->_v1).x = fVar9; (npc->_velocity).x = fVar9 * scratchVec.x * fVar8 + (npc->_velocity).x; (npc->_velocity).y = fVar9 * scratchVec.y * fVar8 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.85; if (local_21 == false) break; local_38.y = (float)&npc->_target; npc->_state = 3; if (npc->_target != (EntityPtr)0x0) { std::multiset::erase(&local_38.y); } goto LAB_00554221; } } fVar8 = npc->_friction * 0.7; goto LAB_00554263; case 0xd: npc->_friction = npc->_friction * 0.8; bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar1 != 0) { local_28 = (EntityPtr)0x10c; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); flagsHigh = RNG::Next(&npc->_dropRNG); local_38.y = (float)((npc->_variant != 1) + 1); vecResult = MusicManager::RandomVector(&scratchVec); local_4c.x = vecResult->x + 0.0; local_4c.y = vecResult->y - 5.0; Game::SpawnEx(g_game,5,10,&npc->_pos,&local_4c,(Entity *)npc,(uint)local_38.y,flagsHigh,0); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; npc->_state = 3; if (npc->_target != (EntityPtr)0x0) { local_38.y = (float)&npc->_target; std::multiset::erase(&local_38.y); npc->_target = (EntityPtr)0x0; npc->_stateFrame = 0; (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; break; } LAB_00554221: npc->_target = (EntityPtr)0x0; npc->_stateFrame = 0; (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; break; case 0x10: npc->_state = 3; npc->_projectileCooldown = 0x1e; npc->_entityCollisionClass = 0; (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; npc->_stateFrame = 0; npc->_projectileDelay = 0; switchD_00552f2c_caseD_3: animData = (npc->_sprite)._animState._animData; if (((animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) && (*(char *)((int)animData + 0x34) == '\0')) { fVar8 = npc->_friction * 0.88; npc->_visible = 1; LAB_00554263: npc->_friction = fVar8; break; } npc->_visible = 1; puStack_20 = local_64 + 0x60; Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); tmpEntity = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); local_4c.y = ((Vector *)((int)tmpEntity + 0x33c))->x; local_38.y = *(float *)((int)tmpEntity + 0x340); if (*(int *)((int)tmpEntity + 0x28) == 3) { targetPlayer = *(EntityPtr *)((int)tmpEntity + 0x410); } else { targetPlayer = (EntityPtr)0x0; if (*(int *)((int)tmpEntity + 0x28) == 1) { targetPlayer = tmpEntity; } } local_28 = tmpEntity; bVar1 = Entity::IsEnemy((Entity *)tmpEntity); if ((bVar1 == 0) || (flagsHigh = Random(), flagsHigh % 0xf != 0)) { (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; } else { vecResult = MusicManager::RandomVector((Vector *)(local_64 + 8)); flagsHigh = Random(); fVar9 = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10; fVar8 = vecResult->x; (npc->_v2).y = fVar9 * vecResult->y * 18.0; (npc->_v2).x = fVar9 * fVar8 * 18.0; tmpEntity = local_28; } npcX = (npc->_pos).x; local_58 = (EntityPtr)(scratchVec.x - npcX); fVar8 = scratchVec.y - (npc->_pos).y; local_21 = true; local_2c = (GridEntity *)scratchVec.x; local_30 = scratchVec.y; local_28 = (EntityPtr) (1.2 - (float)((double)npc->_variant + __uint_to_double_fixup[-(npc->_variant >> 0x1f)]) * 0.15); scratchVec.y = fVar8; if (targetPlayer == (EntityPtr)0x0) { LAB_00553202: if (0.0 < (float)local_58 * (float)local_58 + scratchVec.y * scratchVec.y) { scratchVec.x = (float)local_2c + (npc->_v2).x; scratchVec.y = local_30 + (npc->_v2).y; goto LAB_0055323d; } } else { bVar1 = Entity_Player::AreControlsEnabled((Entity_Player *)targetPlayer); if (bVar1 == 0) { npc->_projectileDelay = 0xf; } else if (npc->_projectileDelay < 1) goto LAB_00553202; scratchVec.x = npcX - (float)local_2c; local_21 = false; scratchVec.y = (npc->_pos).y - local_30; vecResult = Vector::Resized(&scratchVec,(Vector *)(local_64 + 8),80.0); scratchVec.x = (float)local_2c + vecResult->x; scratchVec.y = local_30 + vecResult->y; LAB_0055323d: PathFinder::FindGridPath ((PathFinder *)&npc->_pathfinder,&scratchVec,(float)local_28 * 0.83,0,1); } flagsHigh = Random(); if ((flagsHigh & 3) == 0) { flagsHigh = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.3 + (float)((double)npc->_variant + __uint_to_double_fixup[-(npc->_variant >> 0x1f)]) * 0.3); } if (((npc->_projectileCooldown < 1) || (iVar4 = npc->_projectileCooldown - elapsedFrames, npc->_projectileCooldown = iVar4, iVar4 < 1)) && (npc->_entityCollisionClass == 0)) { npc->_entityCollisionClass = 4; } npc->_friction = npc->_friction * 0.9; fVar8 = (npc->_velocity).y; fVar9 = (npc->_velocity).x; fVar8 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8); if (2.0 <= fVar8) { iVar4 = vector_to_direction(&npc->_velocity); npc->_i1 = iVar4; if (iVar4 == 1) { animName = "Move Up"; } else { if (iVar4 != 3) { ANM2::Play(&npc->_sprite,(byte *)"Move Hori",0); bVar7 = npc->_i1 == 0; goto LAB_005533b3; } animName = "Move Down"; } LAB_005533ac: ANM2::Play(&npc->_sprite,(byte *)animName,0); bVar7 = false; } else { if (npc->_i1 == 1) { animName = "Idle Up"; goto LAB_005533ac; } if (npc->_i1 == 3) { animName = "Idle Down"; goto LAB_005533ac; } ANM2::Play(&npc->_sprite,(byte *)"Idle Hori",0); bVar7 = npc->_i1 == 0; } LAB_005533b3: (npc->_sprite)._flipX = bVar7; parent = npc->_parent; if ((parent != (EntityPtr)0x0) && (*(int *)((int)parent + 0x28) == 3)) { iVar4 = *(int *)((int)parent + 0xd7c); if (npc->_i2 < 0x19) { if (0x18 < iVar4) { npc->_i2 = 0x19; goto LAB_00553447; } } else if (npc->_i2 < 0x23) { if (0x22 < iVar4) { npc->_i2 = 0x23; goto LAB_00553447; } } else if ((npc->_i2 / 10 < iVar4 / 10) && (iVar4 = (iVar4 / 10) * 10, npc->_i2 = iVar4, iVar4 != 0x28)) { LAB_00553447: bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Spawn,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 0xd; break; } } if (((((float)local_2c != local_4c.y) || (local_30 != local_38.y)) || (0 < npc->_projectileCooldown)) || ((local_21 == false || (flagsHigh = Random(), (flagsHigh & 3) != 0)))) break; local_38.x = (float)local_2c; local_38.y = local_30; bVar1 = Entity::IsEnemy((Entity *)tmpEntity); if (bVar1 == 0) { fVar8 = local_30; game = local_2c; } else { local_2c = *(GridEntity **)((int)tmpEntity + 0x360); fVar9 = (npc->_pos).x - *(float *)((int)tmpEntity + 0x33c); local_30 = *(float *)((int)tmpEntity + 0x364); fVar8 = (npc->_pos).y - *(float *)((int)tmpEntity + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); local_38.x = (float)local_2c * fVar8 * 0.1 + *(float *)((int)tmpEntity + 0x33c); local_38.y = local_30 * fVar8 * 0.1 + *(float *)((int)tmpEntity + 0x340); fVar8 = local_38.y; game = (GridEntity *)local_38.x; } local_4c.y = fVar8 - (npc->_pos).y; local_4c.x = (float)game - (npc->_pos).x; fVar8 = ABS(local_4c.y); if (ABS(local_4c.x) <= ABS(local_4c.y)) { fVar8 = ABS(local_4c.x); } if ((*(float *)((int)tmpEntity + 0x370) + 18.0 <= fVar8) || (bVar1 = Room::CheckLine(room,&npc->_pos,&local_38,(npc->_variant != 0) + 1,0,0,0, (Vector *)0x0), bVar1 == 0)) break; local_38.y = (float)vector_to_direction(&local_4c); npc->_i1 = (int)local_38.y; npc->_state = 8; bVar1 = Entity::IsEnemy((Entity *)tmpEntity); if ((bVar1 == 0) || (bVar1 = Entity::HasEntityFlags((Entity *)tmpEntity,0x20000000), bVar1 != 0) ) { bVar7 = false; } else { bVar7 = true; } if ((EntityPtr *)local_38.y == (EntityPtr *)0x1) { animName = "AttackStartQuick Up"; slowAnimName = "AttackStart Up"; LAB_00553669: if (!bVar7) { animName = slowAnimName; } ANM2::Play(&npc->_sprite,(byte *)animName,0); bVar7 = false; } else { if ((EntityPtr *)local_38.y == (EntityPtr *)0x3) { animName = "AttackStartQuick Down"; slowAnimName = "AttackStart Down"; goto LAB_00553669; } animName = "AttackStartQuick Hori"; if (!bVar7) { animName = "AttackStart Hori"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); bVar7 = npc->_i1 == 0; } (npc->_sprite)._flipX = bVar7; if (npc->_target != (EntityPtr)0x0) { local_38.y = (float)&npc->_target; std::multiset::erase(&local_38.y); } npc->_target = tmpEntity; std::multiset::insert(&npc->_target); npc->_projectileCooldown = 0x1e; } if (0 < npc->_projectileDelay) { iVar6 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileDelay; iVar4 = 0; if (0 < iVar6) { iVar4 = iVar6; } npc->_projectileDelay = iVar4; } ExceptionList = local_1c; return; } //@@ 005542e0 NpcAI::ENTITY_DARK_ESAU /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 866 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DARK_ESAU(Entity_NPC *npc) { void *pvVar1; EntityPtr EVar2; byte bVar3; int iVar4; byte *pbVar5; uint uVar6; EntityPtr EVar7; Entity_Player *pEVar8; Vector *pVVar9; uint uVar10; LayerState *layer; ColorMod *other; Entity *pEVar11; undefined4 uVar12; char *animName; int iVar13; int unusedArg; bool bVar14; float fVar15; float fVar16; float fVar17; float fVar18; float fVar19; float fVar20; float fVar21; float fVar22; undefined1 *src; undefined1 blendMode [4]; undefined1 local_190 [12]; uint local_184; Vector local_180; float local_178; EntityPtr local_174; Entity_Player *ownerPlayer; Vector local_16c; Entity *local_164; Vector local_160; char local_155; EntityPtr local_154; ProjectileParams projectileParams; ColorMod poofColor; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword flags; uint *flagsHigh; Game *game; Manager *manager; EntityPtr *parentSlot; float parentX; code *takeDamageFn; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4be0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; ownerPlayer = (Entity_Player *)0x0; local_164 = (Entity *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); EVar7 = npc->_spawnerEntity; if (((EVar7 != (EntityPtr)0x0) && (*(int *)((int)EVar7 + 0x28) == 1)) && (ownerPlayer = (Entity_Player *)(EntityPtr)0x0, *(Entity_NPC **)((int)EVar7 + 0x1fc0) == npc)) { ownerPlayer = (Entity_Player *)EVar7; } pEVar8 = ownerPlayer; local_16c.y = (float)npc; if (npc->_aiCallPhase == 1) { if (0.0 < npc->_pendingDamage) { pvVar1 = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; (npc->_damageEvents)._end = pvVar1; } if ((npc->_state == 8) || (puStack_20 = local_50 + 0x4c, npc->_state == 9)) { pvVar1 = (npc->_sprite)._animState._animData; puStack_20 = local_50 + 0x4c; if ((pvVar1 != (void *)0x0) && (puStack_20 = local_50 + 0x4c, *(char *)((int)pvVar1 + 0x34) != '\0')) { (npc->_hitList)._end = (npc->_hitList)._begin; puStack_20 = local_50 + 0x4c; iVar4 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); game = g_game; if (iVar4 != 0) { iVar4 = _get_index_plus_one_if_kind_4_5(); local_154 = (EntityPtr)((float)iVar4 + 9.0); EntityList::QueryRadius ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_190,&npc->_pos ,50.0,10); local_14 = 0; local_164 = (Entity *)0x0; if (local_184 != 0) { do { pEVar11 = local_164; bVar3 = Entity::IsVulnerableEnemy (*(Entity **)(local_190._4_4_ + (int)local_164 * 4),(Entity *)0x0); if (((bVar3 == 0) || (local_16c.y = *(float *)(local_190._4_4_ + (int)pEVar11 * 4), (Entity_NPC *)local_16c.y == npc)) || ((((Entity_NPC *)local_16c.y)->_flags & 0x20000000) != 0)) { iVar4 = *(int *)(local_190._4_4_ + (int)pEVar11 * 4); if (((*(int *)(iVar4 + 0x28) == 9) && (*(char *)(iVar4 + 0x173) == '\0')) && ((*(uint *)(iVar4 + 0x438) & 0x80000000) == 0)) { *(undefined4 *)(iVar4 + 0x438) = 0; *(undefined4 *)(iVar4 + 0x43c) = 0; *(undefined1 *)(iVar4 + 0x173) = 1; } } else { takeDamageFn = *(code **)(*(int *)local_16c.y + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); (*takeDamageFn)(local_154,0x40000000,0,local_50 + 4,0x1e); pEVar11 = *(Entity **)(local_190._4_4_ + (int)local_164 * 4); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc->_parent); Entity::AddBurn(pEVar11,(EntityRef *)(local_50 + 4),0x96,5.0,0); pEVar11 = local_164; } local_164 = (Entity *)((int)pEVar11 + 1); } while (local_164 < local_184); } local_14 = 0xffffffff; if (local_190[0] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_190._4_4_,0); local_14 = 0xffffffff; } } } } if (npc->_state != 0x12) { ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } if ((npc->_sprite)._animState._isPlaying == 0) { ExceptionList = local_1c; return; } pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { pbVar5 = &s_empty; } else if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } animName = "Death"; do { bVar3 = *pbVar5; bVar14 = bVar3 < (byte)*animName; if (bVar3 != *animName) { LAB_005545e0: uVar6 = -(uint)bVar14 | 1; goto LAB_005545e5; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar14 = bVar3 < (byte)animName[1]; if (bVar3 != animName[1]) goto LAB_005545e0; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar3 != 0); uVar6 = 0; LAB_005545e5: if (uVar6 != 0) { ExceptionList = local_1c; return; } bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); manager = g_manager; if (bVar3 != 0) { local_154 = (EntityPtr)0x269; seed_fart_sound_override((int *)&local_154); SoundEffects::Play(&manager->_sfxManager,(int)local_154,1.0,2,0,1.0,0.0); } if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 == 0) { ExceptionList = local_1c; return; } uVar6 = Random(); local_164 = Game::Spawn(g_game,1000,0x7f,&npc->_pos,&g_vectorZero,(Entity *)npc->_spawnerEntity, 2,uVar6); fVar17 = (npc->_pos).y; parentSlot = &local_164->_parent; (local_164->_targetPosition).x = (npc->_pos).x; (local_164->_targetPosition).y = fVar17; if (*parentSlot != (EntityPtr)0x0) { local_154 = (EntityPtr)parentSlot; std::multiset::erase(&local_154); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); (**(code **)(*(int *)local_164 + 0xc))(); local_154 = npc->_spawnerEntity; if (local_154 == (EntityPtr)0x0) { ExceptionList = local_1c; return; } takeDamageFn = *(code **)(*(int *)local_154 + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)npc); (*takeDamageFn)(0,0x12002000,0,local_50 + 4,0x1e); ExceptionList = local_1c; return; } if (npc->_aiCallPhase == 3) { puStack_20 = local_50 + 0x4c; iVar4 = __RTDynamicCast(ownerPlayer,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0,local_24); if ((iVar4 != 0) && (*(char *)(iVar4 + 0x20a9) != '\0')) { ExceptionList = local_1c; return; } pEVar11 = npc->_collisionEntity; if (((*(int *)&g_game->_deathmatchManager < 2) || (pEVar11->_type != 1)) && (0x3dd < pEVar11->_type - 10U)) { ExceptionList = local_1c; return; } bVar3 = EntityList::HitListContains((EntityList *)&npc->_hitList,pEVar11); if (bVar3 == 0) { uVar6 = Entity::GetHitListIndex(npc->_collisionEntity); sorted_vector_insert_unique(&npc->_hitList,uVar6); takeDamageFn = *(code **)(*(int *)npc->_collisionEntity + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)local_16c.y); (*takeDamageFn)(0x41f00000,0,0,local_50 + 4,0x1e); *(int *)((int)local_16c.y + 0xb80) = 0; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_variant != 0) { iVar4 = npc->_state; if (iVar4 == 0) { play_sound_with_fart_seed(0x268,1.0,2,0,1.0); ANM2::Play(&npc->_sprite,(byte *)"HoleOpen",0); flags = npc->_flags; npc->_state = 3; npc->_stateFrame = 0; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2008; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x11; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_canShutDoors = 0; npc->_sortingLayer = 0; } else if (iVar4 == 3) { puStack_20 = local_50 + 0x4c; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Game::ShakeScreen(g_game,6); } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { ANM2::Play(&npc->_sprite,(byte *)"HoleIdle",0); } iVar4 = npc->_stateFrame + (int)local_164; npc->_stateFrame = iVar4; if (0x96 < iVar4) { ANM2::Play(&npc->_sprite,(byte *)"HoleClose",0); npc->_state = 0x10; } } else if (iVar4 == 0x10) { puStack_20 = local_50 + 0x4c; bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { (**(code **)(*(int *)npc + 0x28))(); } } goto LAB_00556228; } if ((ownerPlayer == (Entity_Player *)0x0) || ((ownerPlayer->_isControlsEnabled != 0 && (ownerPlayer->_controlsCooldown < 1)))) { local_155 = '\0'; } else { local_155 = '\x01'; } iVar4 = npc->_state; if (((iVar4 == 8) || (puStack_20 = local_50 + 0x4c, iVar4 == 9)) && (puStack_20 = local_50 + 0x4c, local_155 != '\0')) { npc->_state = 3; puStack_20 = local_50 + 0x4c; ANM2::Play(&npc->_sprite,s_Idle,0); iVar4 = npc->_state; npc->_i1 = 0x3c; } if ((((iVar4 != 0xd) && (iVar4 != 5)) && ((bVar3 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-40.0), bVar3 != 0 && ((pEVar8 != (Entity_Player *)0x0 && (pEVar8->_type == 1)))))) && ((bVar3 = Entity_Player::HasCollectible(pEVar8,0x26b,0), bVar3 != 0 && (npc->_child == (EntityPtr)0x0)))) { if (npc->_state == 0) { bVar3 = Entity::HasEntityFlags((Entity *)npc,4); if (bVar3 == 0) { uVar6 = Random(); local_160.x = (npc->_pos).x + 10.0; local_160.y = (npc->_pos).y + 0.0; EVar7 = (EntityPtr) Game::Spawn(g_game,0x362,0,&local_160,&g_vectorZero,(Entity *)pEVar8,1,uVar6); if (npc->_child != (EntityPtr)0x0) { local_154 = (EntityPtr)&npc->_child; std::multiset::erase(&local_154); } npc->_child = EVar7; if (EVar7 != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } if (*(EntityPtr *)((int)EVar7 + 0x3bc) != (EntityPtr)0x0) { local_154 = (EntityPtr)((int)EVar7 + 0x3bc); std::multiset::erase(&local_154); } *(EntityPtr *)((int)EVar7 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar7 + 0x3bc)); *(uint *)((int)EVar7 + 0x168) = *(uint *)((int)EVar7 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar7 + 0x16c) = *(undefined4 *)((int)EVar7 + 0x16c); (**(code **)(*(int *)EVar7 + 0xc))(); } } else if (npc->_state == 0x10) { bVar3 = ANM2::IsPlaying(&npc->_sprite,(byte *)"Appear"); if ((bVar3 != 0) && (iVar4 = ANM2::GetFrame(&npc->_sprite), iVar4 < 6)) { uVar6 = Random(); local_160.x = (npc->_pos).x + 10.0; local_160.y = (npc->_pos).y + 0.0; EVar7 = (EntityPtr) Game::Spawn(g_game,0x362,0,&local_160,&g_vectorZero,(Entity *)pEVar8,1,uVar6); if (npc->_child != (EntityPtr)0x0) { local_154 = (EntityPtr)&npc->_child; std::multiset::erase(&local_154); } npc->_child = EVar7; if (EVar7 != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } if (*(EntityPtr *)((int)EVar7 + 0x3bc) != (EntityPtr)0x0) { local_154 = (EntityPtr)((int)EVar7 + 0x3bc); std::multiset::erase(&local_154); } *(EntityPtr *)((int)EVar7 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar7 + 0x3bc)); *(uint *)((int)EVar7 + 0x168) = *(uint *)((int)EVar7 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar7 + 0x16c) = *(undefined4 *)((int)EVar7 + 0x16c); (**(code **)(*(int *)EVar7 + 0xc))(); ANM2::Play((ANM2 *)((int)EVar7 + 0x48),(byte *)"Appear",0); iVar4 = ANM2::GetFrame(&npc->_sprite); if (*(void **)((int)EVar7 + 0x7c) != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)((int)EVar7 + 0x78),(float)iVar4); } *(uint *)((int)EVar7 + 0x168) = *(uint *)((int)EVar7 + 0x168) | 0x10; *(undefined4 *)((int)EVar7 + 0x16c) = *(undefined4 *)((int)EVar7 + 0x16c); *(float *)((int)EVar7 + 0x15c) = 0.0; local_174 = npc->_entityRef; if (*(EntityPtr *)((int)EVar7 + 0xbec) != (EntityPtr)0x0) { local_154 = (EntityPtr)((int)EVar7 + 0xbec); std::multiset::erase(&local_154); } *(EntityPtr *)((int)EVar7 + 0xbec) = local_174; if (local_174 != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar7 + 0xbec)); } ((Vector *)((int)EVar7 + 0xb64))->x = 2.24208e-44; *(int *)((int)EVar7 + 0x188) = 0; *(int *)((int)EVar7 + 0x184) = 0; (npc->_pos).x = (npc->_pos).x - 10.0; } } else { npc->_state = 0xd; ANM2::Play(&npc->_sprite,(byte *)"Split",0); } } EVar7 = npc->_parent; if ((((EVar7 == (EntityPtr)0x0) || (bVar3 = Entity::IsEnemy((Entity *)EVar7), bVar3 == 0)) && (EVar7 = npc->_child, EVar7 == (EntityPtr)0x0)) || (((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)EVar7 + 0x28) != 1)) && (0x3dd < *(int *)((int)EVar7 + 0x28) - 10U)))) { EVar7 = (EntityPtr)0x0; } switch(npc->_state) { case 0: bVar3 = Entity::HasEntityFlags((Entity *)npc,4); if (bVar3 == 0) { ANM2::Play(&npc->_sprite,s_Idle,0); iVar4 = 4; iVar13 = 3; } else { ANM2::Play(&npc->_sprite,(byte *)"Appear",0); flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x10; npc->_shadowSize = 0.0; uVar6 = Random(); EVar7 = (EntityPtr) Game::Spawn(g_game,npc->_type,1,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6); if (*(EntityPtr *)((int)EVar7 + 0x3c0) != (EntityPtr)0x0) { local_154 = (EntityPtr)((int)EVar7 + 0x3c0); std::multiset::erase(&local_154); } *(EntityPtr *)((int)EVar7 + 0x3c0) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar7 + 0x3c0)); if (npc->_entityRef != (EntityPtr)0x0) { local_154 = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_154); } npc->_entityRef = EVar7; std::multiset::insert(&npc->_entityRef); (**(code **)(*(int *)EVar7 + 0xc))(); iVar4 = 0; iVar13 = 0x10; } npc->_state = iVar13; npc->_entityCollisionClass = iVar4; npc->_entityGridCollisionClass = 0; uVar12 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x80100011; *(undefined4 *)((int)&npc->_flags + 4) = uVar12; game = g_game; npc->_aiCallFlags = 5; npc->_isInvicible = 1; EntityList::AddPersistentEntity((EntityList *)((int)game->_room + 0x1218),(Entity *)npc); break; case 3: pvVar1 = (npc->_sprite)._animState._animData; fVar17 = npc->_friction; if (pvVar1 == (void *)0x0) { npc->_friction = fVar17 * 0.9; ANM2::Play(&npc->_sprite,s_Idle,0); } else if (*(char *)((int)pvVar1 + 0x34) == '\0') { npc->_friction = fVar17 * 0.9; if ((npc->_sprite)._animState._isPlaying == 0) { ANM2::Play(&npc->_sprite,s_Idle,0); } } else { npc->_friction = fVar17 * 0.8; pEVar8 = ownerPlayer; if (ownerPlayer == (Entity_Player *)0x0) { pEVar8 = (Entity_Player *)Entity_NPC::GetPlayerTarget(npc); } local_16c.y = (float)pEVar8; Entity_NPC::CalcTargetPosition(npc,&local_160,0.0); local_154 = (EntityPtr)(npc->_pos).x; local_174 = (EntityPtr)local_160.x; local_180.y = local_160.x - (float)local_154; fVar19 = local_160.y - (npc->_pos).y; local_178 = local_160.y; fVar17 = sqrtf(fVar19 * fVar19 + local_180.y * local_180.y); if (0 < npc->_i1) { npc->_i1 = npc->_i1 - (int)local_164; } fVar15 = npc->_friction * 0.8; npc->_projectileDelay = npc->_projectileDelay + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); fVar22 = 40.0; npc->_friction = fVar15; local_164 = (Entity *)0x40400000; if (local_155 != '\0') { fVar22 = 80.0; } EVar2 = npc->_parent; if (EVar2 != (EntityPtr)0x0) { fVar21 = (npc->_pos).y; parentX = *(float *)((int)EVar2 + 0x33c); fVar20 = fVar21 - *(float *)((int)EVar2 + 0x340); fVar18 = (float)local_154 - ((Vector *)((int)local_16c.y + 0x33c))->x; fVar16 = fVar21 - ((Vector *)((int)local_16c.y + 0x33c))->y; if (fVar20 * fVar20 + ((float)local_154 - parentX) * ((float)local_154 - parentX) < fVar18 * fVar18 + fVar16 * fVar16) { local_178 = *(float *)((int)EVar2 + 0x340); fVar22 = 20.0; local_160.x = parentX; local_174 = (EntityPtr)parentX; if (90000.0 < (local_178 - fVar21) * (local_178 - fVar21) + (parentX - (float)local_154) * (parentX - (float)local_154)) { local_164 = (Entity *)0x40800000; } } } local_160.x = (float)local_154 - local_160.x; local_160.y = (npc->_pos).y - local_178; pVVar9 = Vector::Resized(&local_160,(Vector *)(local_190 + 8),fVar22); local_174 = (EntityPtr)((float)local_174 + pVVar9->x); local_178 = local_178 + pVVar9->y; fVar21 = (float)local_174 - (float)local_154; fVar22 = local_178 - (npc->_pos).y; local_160.x = fVar21 * 0.01; local_160.y = fVar22 * 0.01; fVar22 = sqrtf(fVar21 * fVar21 + fVar22 * fVar22); fVar22 = (fVar22 - 0.0) / 200.0; if (fVar22 <= 0.0) { fVar22 = 0.0; } if (1.0 <= fVar22) { fVar22 = 1.0; } pVVar9 = Vector::Resized(&local_160,(Vector *)(local_190 + 8), ((float)local_164 - 0.0) * fVar22 + 0.0); if (fVar15 != 0.0) { fVar22 = npc->_speedMultiplier; fVar21 = pVVar9->y; (npc->_velocity).x = (fVar22 * pVVar9->x) / fVar15 + (npc->_velocity).x; (npc->_velocity).y = (fVar21 * fVar22) / fVar15 + (npc->_velocity).y; } iVar4 = __RTDynamicCast(ownerPlayer,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); if ((((iVar4 == 0) || (*(char *)(iVar4 + 0x20a9) == '\0')) && (npc->_i1 < 1)) && (((EVar7 == (EntityPtr)0x0 || (((*(int *)((int)EVar7 + 0xb64) == 3 && (*(int *)((int)EVar7 + 0xbc0) < 1)) && (fVar15 = (float)local_174 - *(float *)((int)EVar7 + 0x33c), fVar22 = local_178 - *(float *)((int)EVar7 + 0x340), fVar22 * fVar22 + fVar15 * fVar15 < 40000.0)))) && ((local_155 == '\0' && (fVar17 < 120.0)))))) { fVar17 = ABS(fVar19); if (ABS(local_180.y) <= ABS(fVar19)) { fVar17 = ABS(local_180.y); } if (fVar17 < 20.0) { ANM2::Play(&npc->_sprite,(byte *)"Charge",0); npc->_state = 8; npc->_stateFrame = 0; Entity::SetTarget((Entity *)npc,(Entity *)local_16c.y); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); if (EVar7 != (EntityPtr)0x0) { ANM2::Play((ANM2 *)((int)EVar7 + 0x48),(byte *)"Charge",0); *(undefined4 *)((int)EVar7 + 0xb64) = 8; *(undefined4 *)((int)EVar7 + 0x410) = 0; Entity::SetTarget((Entity *)EVar7,(Entity *)local_16c.y); *(float *)((int)EVar7 + 0x334) = g_vectorZero.x; *(float *)((int)EVar7 + 0x338) = g_vectorZero.y; } } } } break; case 5: ANM2::Play(&npc->_sprite,(byte *)"Chained",0); fVar17 = npc->_friction * 0.8; EVar7 = npc->_spawnerEntity; npc->_friction = fVar17; if (EVar7 == (EntityPtr)0x0) { EVar7 = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); fVar17 = npc->_friction; } fVar19 = *(float *)((int)EVar7 + 0x33c); fVar15 = *(float *)((int)EVar7 + 0x340); npc->_friction = fVar17 * 0.8; local_160.x = (fVar19 - (npc->_pos).x) * 0.01; local_160.y = (fVar15 - (npc->_pos).y) * 0.01; pVVar9 = Vector::Resized(&local_160,(Vector *)(local_190 + 8),1.4); local_160.x = -pVVar9->x; local_160.y = -pVVar9->y; Entity::AddVelocity_divided((Entity *)npc,&local_160,0); if ((npc->_entityRef == (EntityPtr)0x0) || (*(char *)((int)npc->_entityRef + 0x173) != '\0')) { ANM2::Play(&npc->_sprite,(byte *)"Charge",0); Sprite::SetLastFrame((Sprite *)&npc->_sprite); npc->_state = 9; npc->_stateFrame = 0x1e; Entity::SetTarget((Entity *)npc,(Entity *)EVar7); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } break; case 8: case 9: bVar3 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if (bVar3 == 0) { iVar4 = Room::GetFrameCount(g_game->_room); if (iVar4 < 3) { ANM2::Play(&npc->_sprite,(byte *)"DashEnd",0); npc->_state = 3; npc->_i1 = 0x1e; } else { npc->_friction = npc->_friction * 0.8; if (npc->_target == (EntityPtr)0x0) { pEVar11 = Entity_NPC::GetPlayerTarget(npc); local_154 = (EntityPtr)(pEVar11->_pos).x; local_16c.y = (pEVar11->_pos).y; } else { pVVar9 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(local_190 + 8),0.0); bVar3 = 0; local_154 = (EntityPtr)pVVar9->x; local_16c.y = pVVar9->y; local_160.x = ((float)local_154 - (npc->_pos).x) * 0.01; local_160.y = (local_16c.y - (npc->_pos).y) * 0.01; pVVar9 = Vector::Resized(&local_160,(Vector *)(local_190 + 8),0.2); Entity::AddVelocity_divided((Entity *)npc,pVVar9,bVar3); } if (-1 < npc->_stateFrame) { iVar4 = npc->_stateFrame + (int)local_164; npc->_stateFrame = iVar4; if (0xe < iVar4) { fVar17 = local_16c.y; EVar7 = local_154; bVar3 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero); if (bVar3 != 0) { local_160.x = (float)EVar7 - (npc->_pos).x; local_160.y = fVar17 - (npc->_pos).y; pVVar9 = Vector::Normalized(&local_160,(Vector *)(local_190 + 8)); (npc->_targetPosition).x = pVVar9->x; (npc->_targetPosition).y = pVVar9->y; } } local_160.x = (npc->_pos).x - (float)local_154; local_160.y = (npc->_pos).y - local_16c.y; pVVar9 = Vector::Resized(&local_160,(Vector *)(local_190 + 8),0.8); fVar17 = npc->_speedMultiplier; fVar19 = pVVar9->y; (npc->_velocity).x = fVar17 * pVVar9->x + (npc->_velocity).x; (npc->_velocity).y = fVar19 * fVar17 + (npc->_velocity).y; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { fVar17 = (npc->_targetPosition).y; if (ABS((npc->_targetPosition).x) <= ABS(fVar17)) { animName = "DashUp"; if (0.0 <= fVar17) { animName = "DashDown"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); bVar14 = false; } else { ANM2::Play(&npc->_sprite,(byte *)"DashHori",0); bVar14 = (npc->_targetPosition).x <= 0.0 && (npc->_targetPosition).x != 0.0; } (npc->_sprite)._flipX = bVar14; iVar4 = npc->_stateFrame; if (-1 < iVar4) { Entity_NPC::PlaySound(npc,0x77,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1e3,1.0,2,0,1.0); iVar4 = npc->_stateFrame; } iVar13 = 0; if (iVar4 < 0) { iVar13 = -iVar4; } npc->_stateFrame = iVar13; } } } else { fVar17 = npc->_speedMultiplier; npc->_friction = npc->_friction * 0.8; fVar19 = (npc->_targetPosition).x; (npc->_velocity).y = (npc->_targetPosition).y * 6.0 * fVar17 + (npc->_velocity).y; (npc->_velocity).x = fVar19 * 6.0 * fVar17 + (npc->_velocity).x; iVar4 = Entity::GetIntervalTicks((Entity *)npc,3.0,0.0); if (iVar4 != 0) { EVar7 = (EntityPtr)0x3f800000; local_154 = (EntityPtr)0x3f800000; if (ownerPlayer != (Entity_Player *)0x0) { bVar3 = Entity_Player::IsLocalPlayer(ownerPlayer); if (bVar3 == 0) { FUN_00925df0(); local_154 = EVar7; } } fVar17 = (npc->_posOffset).x; fVar19 = (npc->_pos).x; local_180.y = (npc->_pos).y; fVar15 = (npc->_posOffset).y; pVVar9 = Entity::GetNullOffset((Entity *)npc,(Vector *)(local_190 + 8),&DAT_00b613c0); local_16c.y = local_180.y + fVar15 + pVVar9->y; local_16c.x = fVar19 + fVar17 + pVVar9->x; uVar6 = Random(); local_180.y = (npc->_velocity).y * 0.1; local_160.x = (npc->_velocity).x * 0.1 + 0.0; uVar10 = Random(); local_160.y = (-2.0 - (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 6.0) + local_180.y; pEVar11 = Game::Spawn(g_game,1000,0x3b,&local_16c,&local_160,(Entity *)npc,0,uVar6); BlendMode::SetMode(blendMode,2,unusedArg); src = blendMode; layer = ANM2::GetLayer(&pEVar11->_sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,src); other = (ColorMod *)Color::Color(local_154); layer = ANM2::GetLayer(&pEVar11->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,other); uVar6 = Random(); *(float *)(pEVar11[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar6 = Random(); iVar4 = uVar6 % 10 + 10; *(int *)(pEVar11[1]._sprite._filename._buf + 8) = iVar4; *(int *)(pEVar11[1]._sprite._filename._buf + 0xc) = iVar4; uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.4; fVar19 = fVar17 * g_vectorOne.y; fVar17 = fVar17 * g_vectorOne.x; pEVar11->_renderZOffset = -2000; (pEVar11->_sprite)._scale.y = fVar19; (pEVar11->_sprite)._scale.x = fVar17; } npc->_stateFrame = npc->_stateFrame + (int)local_164; Room::GetClampedPosition(g_game->_room,&local_160,&npc->_pos,-100.0); bVar3 = Vector::operator_ne(&local_160,&npc->_pos); if (bVar3 == 0) { LAB_00555a07: local_155 = '\0'; } else { local_180.x = local_160.x - (npc->_pos).x; local_180.y = local_160.y - (npc->_pos).y; pVVar9 = Vector::Normalized(&local_180,(Vector *)(local_190 + 8)); local_155 = '\x01'; if (0.0 <= pVVar9->y * (npc->_targetPosition).y + (npc->_targetPosition).x * pVVar9->x) goto LAB_00555a07; } game = g_game; if ((npc->_collidesWithGrid == 0) && (iVar4 = Room::GetFrameCount(g_game->_room), 2 < iVar4)) { local_180.y = 8.40779e-44; iVar4 = 0xc; if (npc->_state == 9) { iVar4 = 0x3c; } if ((npc->_stateFrame <= iVar4) && (((npc->_stateFrame < 0xd || (npc->_state != 9)) || (local_155 == '\0')))) break; } iVar4 = Room::GetFrameCount(game->_room); if (iVar4 < 3) { (npc->_velocity).x = (npc->_velocity).x * 0.4; (npc->_velocity).y = (npc->_velocity).y * 0.4; } ANM2::Play(&npc->_sprite,(byte *)"DashEnd",0); npc->_state = 3; npc->_i1 = 0x5a; } break; case 0xd: npc->_friction = npc->_friction * 0.7; if (((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (ownerPlayer != (Entity_Player *)0x0)) && (npc->_child == (EntityPtr)0x0)) { uVar6 = Random(); local_160.x = (npc->_pos).x + 10.0; local_160.y = (npc->_pos).y + 0.0; pEVar11 = Game::Spawn(g_game,0x362,0,&local_160,&g_vectorZero,(Entity *)npc->_spawnerEntity,1, uVar6); npc = (Entity_NPC *)local_16c.y; Entity::SetChild((Entity *)local_16c.y,pEVar11); Entity::SetParent(pEVar11,(Entity *)npc); uVar12 = *(undefined4 *)((int)&pEVar11->_flags + 4); iVar4 = *(int *)pEVar11; *(uint *)&pEVar11->_flags = (uint)pEVar11->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar11->_flags + 4) = uVar12; (**(code **)(iVar4 + 0xc))(); ((Vector *)((int)npc + 0x33c))->x = ((Vector *)((int)npc + 0x33c))->x - 10.0; ((Vector *)((int)npc + 0x33c))->y = ((Vector *)((int)npc + 0x33c))->y - 0.0; ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Charge",0); Sprite::SetLastFrame((Sprite *)((int)npc + 0x48)); *(int *)((int)npc + 0xb64) = 8; *(int *)((int)npc + 0x410) = -8; Entity::SetTarget((Entity *)npc,(Entity *)0x0); ((Vector *)((int)npc + 0x334))->x = (float)&DAT_bf800000; ((Vector *)((int)npc + 0x334))->y = 0.0; uVar12 = Color::Color(0x3f800000); (**(code **)(*(int *)npc + 0x3c))(uVar12,0x14,0xff,1,1); ANM2::Play(&pEVar11->_sprite,(byte *)"Charge",0); Sprite::SetLastFrame((Sprite *)&pEVar11->_sprite); pEVar11[2]._posOffset.x = 1.12104e-44; *(undefined4 *)&pEVar11[1].field_0x4 = 0xfffffff8; Entity::SetTarget(pEVar11,(Entity *)0x0); (pEVar11->_targetPosition).x = 1.0; (pEVar11->_targetPosition).y = 0.0; uVar12 = Color::Color(0x3f800000); (**(code **)(*(int *)pEVar11 + 0x3c))(uVar12,0x14,0xff,1,1); poofColor._tint[0] = 0.2; poofColor._tint[1] = 0.2; poofColor._tint[2] = 0.2; poofColor._tint[3] = 0.6; poofColor._offset[0] = 0.0; poofColor._colorize[0] = 1.0; poofColor._colorize[1] = 1.0; poofColor._colorize[2] = 1.0; poofColor._colorize[3] = 1.0; poofColor._offset[1] = 0.0; poofColor._offset[2] = 0.0; Entity::MakeGroundPoofAtSelf((Entity *)npc,&poofColor,1.0); Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1e3,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x250,1.0,2,0,0.6); } break; case 0x10: npc->_friction = npc->_friction * 0.8; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); Game::ShakeScreen(g_game,10); npc->_entityCollisionClass = 4; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); npc->_stateFrame = 0xc; } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (((bVar3 != 0) && (iVar4 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar4 != 0)) && ((0 < npc->_stateFrame && ((ownerPlayer == (Entity_Player *)0x0 || (bVar3 = Entity_Player::AreControlsEnabled((Entity_Player *)npc->_spawnerEntity), bVar3 != 0)))))) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Variant = 2; projectileParams.BulletFlags._0_4_ = 0x80; projectileParams.BulletFlags._4_4_ = 0; projectileParams.FallingAccelModifier = 0.3; if (npc->_subtype != 0) { local_50._0_4_ = 2.0; local_50._4_4_ = 1.2; fStack_48 = 1.2; fStack_44 = 1.0; local_30 = 0.0; local_2c = -0.5; local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_28 = -0.2; Color::operator_assign((Color *)&projectileParams.Color,(ColorMod *)local_50); } local_160.x = 8.0; local_160.y = 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_160,9,&projectileParams); npc->_stateFrame = npc->_stateFrame + -1; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { Entity_NPC::SetRef_bec(npc,(Entity *)0x0); npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); } } EVar7 = npc->_entityRef; if ((EVar7 != (EntityPtr)0x0) && (*(int *)((int)EVar7 + 0x28) == 0x362)) { fVar17 = *(float *)((int)EVar7 + 0x33c); fVar19 = *(float *)((int)EVar7 + 0x340); if (npc->_child == (EntityPtr)0x0) { if (npc->_parent != (EntityPtr)0x0) { fVar17 = fVar17 + 10.0; } } else { fVar17 = fVar17 - 10.0; } fVar15 = (npc->_pos).y; (npc->_velocity).x = fVar17 - (npc->_pos).x; (npc->_velocity).y = fVar19 - fVar15; } LAB_00556228: if (npc->_dead != 0) { (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } ExceptionList = local_1c; return; } //@@ 005562b0 NpcAI::ENTITY_PEEPER_FATTY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 835 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_PEEPER_FATTY(Entity_NPC *npc) { Entity *entity; void *pvVar1; byte bVar2; Entity_NPC *parentNpc; EntityPtr EVar3; Vector *tmpVec; int iVar4; uint uVar5; Vector *tmpVec2; uint uVar6; LayerState *layer; ProjectileParams *params; char *eyeNullName; uint uVar7; int iVar8; float fVar9; float fVar10; undefined1 *sideSign; float fVar11; float fVar12; double dVar13; Vector local_170; float lookTargetX; EntityPtr local_164; Vector local_160; Vector local_158; float local_150; Vector local_14c; Vector local_144; ProjectileParams projParams; EntityRef local_94; char animNameA [24]; char animNameB [24]; char animNameC [24]; byte idleAnimName [8]; Vector scratchVec; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; uint *flagsHigh; Game *game; EntityPtr lookTarget; pvVar1 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00af4c55; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(idleAnimName + 0x20); iVar8 = npc->_aiCallPhase; if ((iVar8 == 1) || (iVar8 == 2)) { if (npc->_variant != 10) { return; } EVar3 = npc->_parent; if ((EVar3 == (EntityPtr)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)EVar3 + 0x28) != 1)) && (0x3dd < *(int *)((int)EVar3 + 0x28) - 10U)))) { if (iVar8 == 1) { ExceptionList = &local_10; EntityRef::EntityRef(&local_94); (**(code **)(*(int *)npc + 0x24))(); ExceptionList = local_10; return; } return; } ExceptionList = &local_10; tmpVec = Entity::GetNullOffset((Entity *)npc,&scratchVec,(byte *)"CordPos"); uVar5 = (npc->_vectorDeque1)._offset; fVar10 = (npc->_posOffset).y; fVar12 = (npc->_pos).y; uVar6 = uVar5 & 1; fVar9 = tmpVec->y; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar5 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar8 + uVar6 * 8) = (npc->_posOffset).x + tmpVec->x + (npc->_pos).x; *(float *)(iVar8 + 4 + uVar6 * 8) = fVar12 + 0.0; uVar5 = (npc->_vectorDeque1)._offset + 1; uVar6 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar5 >> 1) * 4); *(float *)(iVar8 + uVar6 * 8) = (npc->_velocity).x; *(float *)(iVar8 + 4 + uVar6 * 8) = (npc->_velocity).y; uVar5 = (npc->_vectorDeque1)._offset + 2; uVar6 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar5 >> 1) * 4); *(float *)(iVar8 + uVar6 * 8) = fVar10 + fVar9; *(undefined4 *)(iVar8 + 4 + uVar6 * 8) = 0; parentNpc = Entity_NPC::ParentNPC(npc); eyeNullName = "LeftEye"; if (npc->_subtype != 0) { eyeNullName = "RightEye"; } Entity::GetNullOffset((Entity *)parentNpc,&local_144,(byte *)eyeNullName); uVar5 = ((npc->_vectorDeque1)._size - 3) + (npc->_vectorDeque1)._offset; fVar10 = *(float *)((int)npc->_parent + 0x340); uVar6 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar5 >> 1) * 4); *(float *)(iVar8 + uVar6 * 8) = *(float *)((int)npc->_parent + 0x33c) + local_144.x; *(float *)(iVar8 + 4 + uVar6 * 8) = fVar10 + 0.0; uVar5 = ((npc->_vectorDeque1)._size - 2) + (npc->_vectorDeque1)._offset; fVar10 = *(float *)((int)npc->_parent + 0x364); uVar6 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar5 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar8 + uVar6 * 8) = *(float *)((int)npc->_parent + 0x360) * 0.2; *(float *)(iVar8 + 4 + uVar6 * 8) = fVar10 * 0.2; uVar5 = ((npc->_vectorDeque1)._size - 1) + (npc->_vectorDeque1)._offset; uVar6 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar5 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar8 + uVar6 * 8) = local_144.y; *(undefined4 *)(iVar8 + 4 + uVar6 * 8) = 0; if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 2)) { local_14c.y = 1.4013e-45; local_150 = 4.2039e-45; do { uVar5 = (npc->_vectorDeque1)._offset; uVar6 = uVar5 & 1; fVar10 = *(float *)((int)npc->_parent + 0x340); iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar5 >> 1) * 4); fVar11 = (float)((double)(int)local_14c.y + __uint_to_double_fixup[-((int)local_14c.y >> 0x1f)]) / 5.0; fVar12 = *(float *)(iVar8 + 4 + uVar6 * 8); fVar9 = *(float *)(iVar8 + 4 + uVar6 * 8); uVar7 = (int)local_150 + uVar5 & 1; iVar4 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & (int)local_150 + uVar5 >> 1) * 4); *(float *)(iVar4 + uVar7 * 8) = ((*(float *)((int)npc->_parent + 0x33c) + local_144.x) - *(float *)(iVar8 + uVar6 * 8)) * fVar11 + *(float *)(iVar8 + uVar6 * 8); *(float *)(iVar4 + 4 + uVar7 * 8) = ((fVar10 + 0.0) - fVar12) * fVar11 + fVar9; uVar5 = (int)local_150 + 1U + (npc->_vectorDeque1)._offset; uVar6 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar5 >> 1) * 4); *(undefined4 *)(iVar8 + uVar6 * 8) = 0; *(undefined4 *)(iVar8 + 4 + uVar6 * 8) = 0; uVar6 = (npc->_vectorDeque1)._offset; uVar5 = uVar6 + 2; uVar7 = uVar5 & 1; iVar8 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar5 >> 1) * 4); uVar6 = (int)local_150 + 2U + uVar6; uVar5 = uVar6 & 1; iVar4 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar6 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4); *(float *)(iVar4 + uVar5 * 8) = (local_144.y - *(float *)(iVar8 + uVar7 * 8)) * fVar11 + *(float *)(iVar8 + uVar7 * 8); *(undefined4 *)(iVar4 + 4 + uVar5 * 8) = 0; local_150 = (float)((int)local_150 + 3); local_14c.y = (float)((int)local_14c.y + 1); } while ((uint)local_150 < 0x12); std::deque::assign(); } else { Entity_NPC::UpdateCordChain(npc,npc->_aiCallPhase == 2); } local_14c.y = (*(float *)((int)npc->_parent + 0x340) + 0.0) - (npc->_pos).y; local_144.y = (*(float *)((int)npc->_parent + 0x33c) + local_144.x) - (npc->_pos).x; fVar10 = sqrtf(local_14c.y * local_14c.y + local_144.y * local_144.y); if (75.0 < fVar10) { fVar12 = npc->_speedMultiplier; (npc->_velocity).x = (local_144.y / fVar10) * (fVar10 - 75.0) * 0.1 * 0.3 * fVar12 + (npc->_velocity).x; (npc->_velocity).y = (local_14c.y / fVar10) * (fVar10 - 75.0) * 0.1 * 0.3 * fVar12 + (npc->_velocity).y; ExceptionList = local_10; return; } ExceptionList = local_10; return; } if (iVar8 == 3) { if (npc->_variant != 10) { return; } if ((EntityPtr)npc->_collisionEntity == npc->_parent) { npc->_collisionResult = 0; return; } return; } if (npc->_variant != 10) { local_158.y = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); ExceptionList = &local_10; Entity_NPC::UpdateChargeBar(npc,60.0,0.0,(float)npc->_projectileCooldown,1); iVar8 = npc->_state; if (iVar8 == 0) { npc->_state = 4; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); if (npc->_controllerID == -1) { uVar5 = Random(); iVar8 = uVar5 % 0x96 + 0x3c; } else { iVar8 = 0x3c; } npc->_projectileCooldown = iVar8; local_144.y = 0.0; std::deque::resize(2,&local_144.y); uVar5 = 0; do { uVar6 = RNG::Next(&npc->_dropRNG); if (uVar5 == 0) { scratchVec.x = -30.0; } else { scratchVec.x = 30.0; } scratchVec.x = scratchVec.x + (npc->_pos).x; scratchVec.y = (npc->_pos).y + 30.0; EVar3 = (EntityPtr) Game::Spawn(g_game,0x343,10,&scratchVec,&g_vectorZero,(Entity *)npc,uVar5,uVar6); uVar6 = (npc->_entityDeque)._offset + uVar5; uVar7 = uVar6 & 3; iVar8 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar6 >> 2) * 4); local_14c.y = (float)(iVar8 + uVar7 * 4); if (*(int *)(iVar8 + uVar7 * 4) != 0) { local_144.y = local_14c.y; std::multiset::erase(); } *(EntityPtr *)local_14c.y = EVar3; if (EVar3 != (EntityPtr)0x0) { std::multiset::insert(); } if (*(EntityPtr *)((int)EVar3 + 0x3bc) != (EntityPtr)0x0) { local_144.y = (float)((int)EVar3 + 0x3bc); std::multiset::erase(); } *(Entity_NPC **)((int)EVar3 + 0x3bc) = npc; std::multiset::insert(); (**(code **)(*(int *)EVar3 + 0xc))(); uVar5 = uVar5 + 1; } while (uVar5 < 2); ExceptionList = local_10; return; } if (iVar8 != 4) { if (iVar8 != 8) { ExceptionList = local_10; return; } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Game::ButterBeanFart(g_game,&npc->_pos,120.0,(Entity *)npc,1,0); params = ProjectileParams::ProjectileParams(&projParams); local_170.x = 8.0; local_170.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_170,9,params); } bVar2 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar2 != 0) { npc->_state = 4; npc->_stateFrame = 0; if (npc->_controllerID == -1) { uVar5 = Random(); iVar8 = uVar5 % 0x96 + 0x3c; } else { iVar8 = 0x3c; } npc->_projectileCooldown = iVar8; } npc->_friction = npc->_friction * 0.4; ExceptionList = local_10; return; } std::string::string_from_cstr((char *)&local_94._position,(byte *)"WalkVert"); local_8 = 0; std::string::string_from_cstr(animNameA,(byte *)"WalkVert"); local_8._0_1_ = 1; std::string::string_from_cstr(animNameB,(byte *)"WalkRight"); local_8._0_1_ = 2; std::string::string_from_cstr(animNameC,(byte *)"WalkLeft"); local_8 = CONCAT31(local_8._1_3_,3); Entity_NPC::anim_walk_frame_4dir (npc,animNameC,animNameB,animNameA,&local_94._position,0x3dcccccd); std::string::_Tidy_deallocate(animNameC); std::string::_Tidy_deallocate(animNameB); std::string::_Tidy_deallocate(animNameA); local_8 = 0xffffffff; std::string::_Tidy_deallocate((char *)&local_94._position); if (npc->_controllerID == -1) { fVar10 = (npc->_pos).x; fVar12 = (npc->_pos).y; fVar9 = 1e+08; local_14c.y = 0.0; local_160.x = fVar10; local_160.y = fVar12; if ((npc->_entityDeque)._size != 0) { do { uVar5 = (uint)((undefined1 *)local_14c.y + (npc->_entityDeque)._offset) & 3; uVar6 = (uint)((undefined1 *)local_14c.y + (npc->_entityDeque)._offset) >> 2; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar6) * 4) + uVar5 * 4) != 0) { iVar8 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar6) * 4) + uVar5 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)(iVar8 + 0x28) != 1)) { if (0x3dd < *(int *)(iVar8 + 0x28) - 10U) goto LAB_0055717f; } fVar11 = *(float *)(*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar6) * 4) + uVar5 * 4) + 3000); if (fVar11 < fVar9) { iVar8 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar6) * 4) + uVar5 * 4); fVar10 = *(float *)(iVar8 + 0x33c); fVar12 = *(float *)(iVar8 + 0x340); fVar9 = fVar11; local_160.x = fVar10; local_160.y = fVar12; } } LAB_0055717f: local_14c.y = (float)((int)local_14c.y + 1); } while ((uint)local_14c.y < (undefined1 *)(npc->_entityDeque)._size); if (fVar9 < 1e+08) { fVar11 = 0.5; if (0.0 < fVar9) { fVar12 = fVar12 - (npc->_pos).y; fVar10 = fVar10 - (npc->_pos).x; fVar10 = sqrtf(fVar12 * fVar12 + fVar10 * fVar10); local_14c.y = 0.5; local_144.y = fVar10 / 100.0; tmpVec = &local_144; if (0.5 <= fVar10 / 100.0) { tmpVec = &local_14c; } fVar11 = tmpVec->y; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_160,fVar11,900,1); goto LAB_00557237; } } PathFinder::update_chase_movement(); } else { npc->_friction = npc->_friction * 0.6; tmpVec = Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); fVar10 = npc->_speedMultiplier; fVar12 = tmpVec->y; (npc->_velocity).x = tmpVec->x * 1.2 * 1.25 * fVar10 + (npc->_velocity).x; (npc->_velocity).y = fVar12 * 1.2 * 1.25 * fVar10 + (npc->_velocity).y; } LAB_00557237: uVar5 = Random(); if (uVar5 % 0x28 == 0) { Entity_NPC::PlaySound(npc,0xa7,1.0,0x3c,0,1.0); } if ((0 < npc->_projectileCooldown) && (iVar8 = npc->_projectileCooldown - (int)local_158.y, npc->_projectileCooldown = iVar8, 0 < iVar8)) { ExceptionList = local_10; return; } if (((npc->_controllerID == -1) && (uVar5 = Random(), uVar5 % 0x3c == 0)) || (bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar2 != 0)) { npc->_state = 8; std::string::string_from_cstr(animNameC,(byte *)"AttackVert"); local_8 = 4; std::string::string_from_cstr(animNameB,(byte *)"AttackVert"); local_8._0_1_ = 5; std::string::string_from_cstr(animNameA,(byte *)"AttackRight"); local_8._0_1_ = 6; std::string::string_from_cstr((char *)&local_94._position,(byte *)"AttackLeft"); local_8 = CONCAT31(local_8._1_3_,7); Entity_NPC::anim_walk_frame_4dir(npc,&local_94._position,animNameA,animNameB,animNameC,0); std::string::_Tidy_deallocate((char *)&local_94._position); std::string::_Tidy_deallocate(animNameA); std::string::_Tidy_deallocate(animNameB); std::string::_Tidy_deallocate(animNameC); npc->_stateFrame = 0; ExceptionList = local_10; return; } ExceptionList = local_10; return; } if (npc->_state == 0) { ExceptionList = &local_10; *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; npc->_aiCallFlags = 7; npc->_isInvicible = 1; npc->_entityGridCollisionClass = 3; npc->_state = 4; (npc->_posOffset).y = -20.0; ANM2::Play(&npc->_sprite,s_Idle2,0); npc->_aiFloat = 90.0; (npc->_v2).x = 10000.0; fVar10 = (npc->_pos).y; (npc->_targetPosition).x = (npc->_pos).x + 0.0; (npc->_targetPosition).y = fVar10 + 100.0; ANM2::PlayOverlay(&npc->_sprite,&DAT_00b1d20c,0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_visible = 0; if (npc->_parent == (EntityPtr)0x0) { ExceptionList = local_10; return; } bVar2 = Entity::IsEnemy((Entity *)npc->_parent); if (bVar2 == 0) { ExceptionList = local_10; return; } (npc->_sprite)._flipX = npc->_subtype == 0; tmpVec = Entity::GetNullOffset((Entity *)npc,&scratchVec,(byte *)"CordPos"); local_158.y = tmpVec->x + (npc->_posOffset).x + (npc->_pos).x; local_160.y = (npc->_pos).y + 0.0; local_14c.y = (npc->_posOffset).y + tmpVec->y; parentNpc = Entity_NPC::ParentNPC(npc); eyeNullName = "LeftEye"; if (npc->_subtype != 0) { eyeNullName = "RightEye"; } Entity::GetNullOffset((Entity *)parentNpc,&local_144,(byte *)eyeNullName); uVar5 = 0; local_170.y = local_144.y - local_14c.y; local_164 = (EntityPtr)((*(float *)((int)npc->_parent + 0x33c) + local_144.x) - local_158.y); local_150 = (*(float *)((int)npc->_parent + 0x340) + 0.0) - local_160.y; do { local_144.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) / 5.0; std::deque::push_back(); std::deque::push_back(); scratchVec.y = 0.0; scratchVec.x = local_144.y * local_170.y + local_14c.y; std::deque::push_back(); uVar5 = uVar5 + 1; } while (uVar5 < 6); std::deque::assign(); iVar8 = 10; do { Entity_NPC::UpdateCordChain(npc,0); iVar8 = iVar8 + -1; } while (iVar8 != 0); ExceptionList = local_10; return; } if (npc->_state != 4) { return; } ExceptionList = &local_10; npc->_friction = npc->_friction * 0.95; if (npc->_parent == (EntityPtr)0x0) { ExceptionList = pvVar1; return; } bVar2 = Entity::IsEnemy((Entity *)npc->_parent); if (bVar2 == 0) { ExceptionList = local_10; return; } parentNpc = Entity_NPC::ParentNPC(npc); EVar3 = (EntityPtr)Entity_NPC::GetPlayerTarget(parentNpc); local_164 = EVar3; parentNpc = Entity_NPC::ParentNPC(npc); Entity_NPC::CalcTargetPosition(parentNpc,&local_144,0.0); local_14c.y = npc->_aiFloat * 0.017453292; local_170.y = cos(local_14c.y); local_160.y = sin(local_14c.y); iVar8 = npc->_projectileDelay; if (0 < iVar8) { iVar8 = iVar8 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_projectileDelay = iVar8; } fVar10 = (npc->_pos).x; fVar12 = (npc->_pos).y; fVar9 = fVar10 - local_144.x; fVar11 = fVar12 - local_144.y; if (40000.0 <= fVar11 * fVar11 + fVar9 * fVar9) { LAB_005564af: if (npc->_entityRef == (EntityPtr)0x0) { iVar4 = Entity::GetIntervalTicks((Entity *)npc,3.0,0.0); if ((iVar4 != 0) && (iVar8 < 1)) { uVar5 = 0; fVar10 = *(float *)((int)g_game->_room + 0x1264); local_150 = fVar10; if (fVar10 != 0.0) { local_144.y = *(float *)((int)g_game->_room + 0x125c); do { entity = *(Entity **)((int)local_144.y + uVar5 * 4); iVar8 = entity->_type; if (((((iVar8 == 1) || ((fVar10 = local_150, iVar8 - 10U < 0x3de && (iVar8 != npc->_type)))) || (iVar8 == 5)) || (iVar8 == 4)) && (entity->_dead == 0)) { local_158.y = (entity->_pos).x; fVar10 = (entity->_pos).y; fVar9 = *(float *)((int)npc->_parent + 0x33c) - local_158.y; fVar12 = *(float *)((int)npc->_parent + 0x340) - fVar10; if (14400.0 < fVar12 * fVar12 + fVar9 * fVar9) { local_158.y = local_158.y - (npc->_pos).x; local_14c.y = fVar10 - (npc->_pos).y; fVar10 = sqrtf(local_158.y * local_158.y + local_14c.y * local_14c.y); if (fVar10 <= 0.0) { fVar12 = local_14c.y; fVar10 = local_158.y; } else { fVar12 = local_14c.y * (1.0 / fVar10); fVar10 = local_158.y * (1.0 / fVar10); } if (0.85 < local_170.y * fVar10 + local_160.y * fVar12) { Entity_NPC::SetRef_bec(npc,entity); break; } } fVar10 = local_150; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)fVar10); } EVar3 = local_164; } } } else { local_144.x = local_144.x - fVar10; local_144.y = local_144.y - fVar12; tmpVec = Vector::Normalized(&local_144,&scratchVec); if (local_160.y * tmpVec->y + local_170.y * tmpVec->x <= 0.85) goto LAB_005564af; Entity_NPC::SetRef_bec(npc,(Entity *)EVar3); } lookTarget = npc->_entityRef; if (lookTarget == (EntityPtr)0x0) { local_14c.y = (npc->_targetPosition).x; local_164 = (EntityPtr)(npc->_targetPosition).y; } else { local_14c.y = *(float *)((int)lookTarget + 0x33c); local_164 = *(EntityPtr *)((int)lookTarget + 0x340); } fVar12 = local_14c.y - (npc->_pos).x; fVar10 = (float)local_164 - (npc->_pos).y; lookTargetX = local_14c.y; local_158.y = (float)local_164; if (((80.0 <= fVar10 * fVar10 + fVar12 * fVar12) || (uVar5 = Random(), uVar5 % 0x14 != 0)) || (npc->_entityRef == EVar3)) { if (npc->_subtype == 0) { sideSign = (undefined1 *)0x3f800000; } else { sideSign = &DAT_bf800000; } local_144.x = local_14c.y - *(float *)((int)npc->_parent + 0x33c); local_144.y = local_158.y - *(float *)((int)npc->_parent + 0x340); local_14c.y = (float)sideSign; tmpVec = Vector::Normalized(&local_144,&scratchVec); if (local_14c.y * tmpVec->x <= 0.1) goto LAB_0055677f; } Entity_NPC::SetRef_bec(npc,(Entity *)0x0); npc->_projectileCooldown = 0; npc->_projectileDelay = 0x2d; LAB_0055677f: local_14c.y = (npc->_pos).x; fVar10 = (float)local_164 - (npc->_pos).y; fVar10 = sqrtf((lookTargetX - local_14c.y) * (lookTargetX - local_14c.y) + fVar10 * fVar10); lookTarget = npc->_entityRef; (npc->_v2).x = fVar10; if (lookTarget != (EntityPtr)0x0) { fVar10 = fVar10 * 0.5; (npc->_v2).x = fVar10; } if (lookTarget == EVar3) { local_144.x = lookTargetX; tmpVec = &local_144; (npc->_v2).x = fVar10 * 0.0; local_144.y = (float)local_164; fVar10 = (npc->_pos).y; } else { local_158.x = local_14c.y - lookTargetX; local_144.y = (npc->_pos).y; local_158.y = local_144.y - (float)local_164; tmpVec2 = Vector::Resized(&local_158,&scratchVec,40.0); local_158.x = lookTargetX + tmpVec2->x; tmpVec = &local_158; local_158.y = (float)local_164 + tmpVec2->y; fVar10 = local_144.y; } bVar2 = 0; local_14c.x = tmpVec->x - local_14c.y; local_14c.y = tmpVec->y - fVar10; tmpVec2 = Vector::Resized(&local_14c,&scratchVec,0.25); Entity::AddVelocity((Entity *)npc,tmpVec2,bVar2); local_14c.x = tmpVec->x - (npc->_pos).x; local_14c.y = tmpVec->y - (npc->_pos).y; tmpVec = Vector::Resized(&local_14c,&scratchVec,0.5); fVar10 = atan2f(npc->_speedMultiplier * tmpVec->y + local_160.y, npc->_speedMultiplier * tmpVec->x + local_170.y); fVar10 = fVar10 * 57.295776; npc->_aiFloat = fVar10; if (npc->_projectileCooldown < 1) { uVar5 = 0; do { if (npc->_subtype == 0) { local_14c.y = (float)&DAT_bf800000; } else { local_14c.y = 1.0; } uVar6 = Random(); local_144.y = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 220.0 - 110.0) * 0.017453292; local_158.y = cos(local_144.y); fVar10 = sin(local_144.y); game = g_game; EVar3 = npc->_parent; fVar12 = local_14c.y * local_158.y - fVar10 * 0.0; fVar9 = local_14c.y * fVar10 + local_158.y * 0.0; fVar10 = *(float *)((int)EVar3 + 0x340); (npc->_targetPosition).x = fVar12 * 200.0 + *(float *)((int)EVar3 + 0x33c); (npc->_targetPosition).y = fVar9 * 200.0 + fVar10; local_160.x = fVar12 * 80.0 + *(float *)((int)EVar3 + 0x33c); local_160.y = fVar9 * 80.0 + *(float *)((int)EVar3 + 0x340); bVar2 = Room::IsPositionInRoom(game->_room,&local_160,0.0); } while ((bVar2 == 0) && (uVar5 = uVar5 + 1, uVar5 < 10)); uVar5 = Random(); fVar10 = npc->_aiFloat; iVar8 = uVar5 % 0x3c + 0xf; } else { iVar8 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_projectileCooldown; } npc->_projectileCooldown = iVar8; fVar10 = normalize_angle_degrees(fVar10); local_144.y = fVar10 / 45.0 + 0.5; dVar13 = floor((double)local_144.y); local_144.y = (float)dVar13; uVar5 = 4 - (int)dVar13; if (npc->_subtype != 0) { uVar5 = (int)dVar13 + 8; } uVar5 = uVar5 & 0x80000007; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffff8) + 1; } if (uVar5 < 8) { sprintf_s(idleAnimName,0x10,(byte *)"Idle%d"); ANM2::Play(&npc->_sprite,idleAnimName,0); } ExceptionList = local_10; return; } //@@ 005579b0 FUN_005579b0 void FUN_005579b0(Vector *param_1) { uint uVar1; Entity_NPC *this; Entity *in_ECX; uint uVar2; if (in_ECX->_variant == 0) { Entity::Render(in_ECX,param_1); if (in_ECX[2]._dropRNG._shift3 != 0) { uVar2 = 0; do { uVar1 = in_ECX[2]._dropRNG._shift2 + uVar2; this = *(Entity_NPC **) (*(int *)(in_ECX[2]._dropRNG._seed + (uVar1 >> 2 & in_ECX[2]._dropRNG._shift1 - 1U) * 4) + (uVar1 & 3) * 4); if ((this != (Entity_NPC *)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (this->_type == 1)) || (this->_type - 10U < 0x3de)))) { Entity_NPC::render_overlay(this,param_1,0); } uVar2 = uVar2 + 1; } while (uVar2 < 2); return; } } else { Entity::Render(in_ECX,param_1); } return; } //@@ 00557a60 std::deque<4byte>::~deque /* DB: ? deque _Tidy (pops size [4] with trivial elements, frees 16-byte blocks in the map [1]/[2]) then frees the 8-byte container proxy [0]; local deque in NpcAI::ENTITY_BUTT_SLICKER and others; element size not provable (16-byte blocks fit int or Vector) */ void std::deque<4byte>::~deque(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; uint size; int iVar2; iVar2 = in_ECX[4]; if (iVar2 != 0) { do { iVar2 = iVar2 + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; } iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x10); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 00557b00 std::set::find /* DB: set find_node, returns end if not found; used by HasCollectible */ void std::set::find(int *param_1,int *param_2) { int *in_ECX; undefined1 local_10 [8]; int local_8; find_node(local_10,param_2); if ((*(char *)(local_8 + 0xd) == '\0') && (*(int *)(local_8 + 0x10) <= *param_2)) { *param_1 = local_8; return; } *param_1 = *in_ECX; return; } //@@ 00557b50 FUN_00557b50 void FUN_00557b50(uint param_1) { uint *in_ECX; *in_ECX = param_1 & 0x3fff; return; } //@@ 00557b70 FUN_00557b70 void FUN_00557b70(byte *param_1) { uint *puVar1; byte bVar2; byte *in_ECX; byte *pbVar3; pbVar3 = param_1; do { bVar2 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar2 != 0); puVar1 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } std::string::find(in_ECX,*puVar1,0,param_1,(int)pbVar3 - (int)(param_1 + 1)); return; } //@@ 00557bb0 FUN_00557bb0 bool FUN_00557bb0(int *param_1) { int *in_ECX; return *in_ECX == *param_1; } //@@ 00557bd0 std::string::find /* DB: memchr substring search prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ uint __cdecl std::string::find(byte *haystack,uint haystackSize,uint start,byte *needle,uint needleSize) { byte bVar1; int iVar2; uint uVar3; byte *pbVar4; uint uVar5; byte *pbVar6; byte *pbVar7; bool bVar8; if ((needleSize <= haystackSize) && (start <= haystackSize - needleSize)) { if (needleSize == 0) { return start; } iVar2 = (haystackSize + 1) - needleSize; bVar1 = *needle; for (pbVar4 = memchr(haystack + start,(int)(char)bVar1, (size_t)(haystack + (iVar2 - (int)(haystack + start)))); pbVar4 != (byte *)0x0; pbVar4 = memchr(pbVar4 + 1,(int)(char)bVar1,(size_t)(haystack + (iVar2 - (int)(pbVar4 + 1))) )) { pbVar6 = needle; pbVar7 = pbVar4; uVar5 = needleSize; while (uVar3 = uVar5 - 4, 3 < uVar5) { if (*(int *)pbVar7 != *(int *)pbVar6) goto LAB_00557c56; pbVar7 = pbVar7 + 4; pbVar6 = pbVar6 + 4; uVar5 = uVar3; } if (uVar3 == 0xfffffffc) { LAB_00557c8a: uVar5 = 0; } else { LAB_00557c56: bVar8 = *pbVar7 < *pbVar6; if ((*pbVar7 == *pbVar6) && ((uVar3 == 0xfffffffd || ((bVar8 = pbVar7[1] < pbVar6[1], pbVar7[1] == pbVar6[1] && ((uVar3 == 0xfffffffe || ((bVar8 = pbVar7[2] < pbVar6[2], pbVar7[2] == pbVar6[2] && ((uVar3 == 0xffffffff || (bVar8 = pbVar7[3] < pbVar6[3], pbVar7[3] == pbVar6[3])))))) )))))) goto LAB_00557c8a; uVar5 = -(uint)bVar8 | 1; } if (uVar5 == 0) { return (int)pbVar4 - (int)haystack; } } } return 0xffffffff; } //@@ 00557cd0 Entity_Tear::Scale /* ZHL [lua] Lua binding EntityTear:Scale */ float10 __thiscall Entity_Tear::Scale(Entity_Tear *this) { return (float10)this->_fScale; } //@@ 00557ce0 collect_npcs_with_same_parent /* DB: ? npcs with matching 0x3bc parent; Min-Min/Willo */ void collect_npcs_with_same_parent(void) { qword qVar1; void *pvVar2; uint uVar3; qword *pqVar4; uint *puVar5; uint uVar6; uint *puVar7; float x; float fVar8; EntityList_EL local_4c; uint *local_3c; uint *local_38; uint *local_34; float local_30; uint local_2c; uint *local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af4c95; local_1c = ExceptionList; ExceptionList = &local_1c; local_3c = (uint *)0x0; puVar5 = (uint *)0x0; local_28 = (uint *)0x0; local_38 = (uint *)0x0; local_34 = (uint *)0x0; local_14 = 0; local_24 = 360.0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_4c,0x328,-1,-1,0,0); local_14 = CONCAT31(local_14._1_3_,1); uVar6 = 0; if (local_4c._size == 0) { puVar7 = (uint *)0x0; } else { pvVar2 = local_4c._data; uVar3 = local_4c._size; do { local_2c = *(uint *)((int)pvVar2 + uVar6 * 4); if (*(int *)(local_2c + 0x30) == 0) { if (*(char *)(local_2c + 0x173) == '\0') { if (*(int *)(local_2c + 0x3bc) == *(int *)((int)local_30 + 0x3bc)) { if (puVar5 == local_28) { std::vector::_Emplace_reallocate(puVar5,&local_2c); local_28 = local_34; } else { *puVar5 = local_2c; local_38 = puVar5 + 1; } fVar8 = *(float *)(local_2c + 3000); if (local_24 <= *(float *)(local_2c + 3000)) { fVar8 = local_24; } pvVar2 = local_4c._data; uVar3 = local_4c._size; puVar5 = local_38; local_24 = fVar8; } else { pvVar2 = local_4c._data; uVar3 = local_4c._size; } } } puVar7 = local_3c; uVar6 = uVar6 + 1; } while (uVar6 < uVar3); if (local_3c != puVar5) { uVar6 = (int)puVar5 - (int)local_3c >> 2; fVar8 = 6.2831855 / (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)puVar5 - (int)local_3c >> 0x1f)]); local_30 = fVar8; if (1 < uVar6) { local_2c = 0; do { x = (float)((double)(int)local_2c + __uint_to_double_fixup[-((int)local_2c >> 0x1f)]) * fVar8 + local_24; if (360.0 < ABS(x)) { x = fmodf(x,360.0); fVar8 = local_30; } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } puVar5 = puVar7 + local_2c; local_2c = local_2c + 1; *(float *)(*puVar5 + 3000) = x; } while (local_2c < uVar6); } } } if (local_4c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (local_4c._data != (void *)0x0) { uVar6 = *(uint *)((int)local_4c._data + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar6; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar6); free((uint *)((int)local_4c._data + -4)); } } if (puVar7 != (uint *)0x0) { uVar6 = (int)local_28 - (int)puVar7 & 0xfffffffc; puVar5 = puVar7; if (0xfff < uVar6) { puVar5 = (uint *)puVar7[-1]; uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)puVar7 + (-4 - (int)puVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar5,uVar6); } ExceptionList = local_1c; return; } //@@ 00557f70 NpcHelper::willo_slot /* DB: Willo helper */ float * NpcHelper::willo_slot(float *param_1,int param_2) { uint uVar1; int in_ECX; float fVar2; float fVar3; float local_14; float local_10; float local_c; willo_get_target_pos(&local_10,&local_14); uVar1 = g_manager->_framecount & 0x80000001; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffe) + 1; } if (*(int *)(in_ECX + 0xb64) == 8) { local_14 = *(float *)(in_ECX + 0xbbc); } else { local_14 = *(float *)(in_ECX + 3000); } fVar2 = *(float *)(in_ECX + 0xbb4) * *(float *)(in_ECX + 0xbb0); local_14 = local_14 - ((float)(int)uVar1 * 0.5 + (float)g_game->_frameCount + (float)param_2) * 0.5 * 3.1415927 * 0.035; fVar3 = cos(local_14); *param_1 = fVar3 * fVar2 + local_10; fVar3 = sin(local_14); param_1[1] = fVar3 * fVar2 * 0.84 + local_c; return param_1; } //@@ 00558070 NpcHelper::willo_get_target_pos /* DB: parent pos or player average */ void NpcHelper::willo_get_target_pos(float *param_1,float *param_2) { int *piVar1; int iVar2; int *piVar3; int in_ECX; int iVar4; int *piVar5; float fVar6; float fVar7; float fVar8; float fVar9; float local_8; iVar4 = *(int *)(in_ECX + 0x3bc); if (iVar4 != 0) { if (param_2 != (float *)0x0) { *param_2 = 0.0; iVar4 = *(int *)(in_ECX + 0x3bc); } fVar9 = *(float *)(iVar4 + 0x340); *param_1 = *(float *)(iVar4 + 0x33c); param_1[1] = fVar9; return; } iVar4 = 0; fVar9 = 0.0; local_8 = 0.0; piVar1 = (g_game->_playerManager)._playerList._end; piVar5 = (g_game->_playerManager)._playerList._begin; fVar6 = g_vectorZero.x; fVar8 = g_vectorZero.y; for (piVar3 = piVar5; piVar3 != piVar1; piVar3 = piVar3 + 1) { iVar2 = *piVar3; if ((*(int *)(iVar2 + 0x2c) == 0) && (*(int *)(iVar2 + 0x13c0) != 0x23)) { fVar6 = fVar6 + *(float *)(iVar2 + 0x33c); fVar8 = fVar8 + *(float *)(iVar2 + 0x340); iVar4 = iVar4 + 1; } } fVar6 = fVar6 / (float)iVar4; fVar8 = fVar8 / (float)iVar4; if (param_2 != (float *)0x0) { if (1 < iVar4) { for (; piVar5 != piVar1; piVar5 = piVar5 + 1) { iVar4 = *piVar5; if ((*(int *)(iVar4 + 0x2c) == 0) && (*(int *)(iVar4 + 0x13c0) != 0x23)) { fVar7 = fVar6 - *(float *)(iVar4 + 0x33c); fVar9 = fVar8 - *(float *)(iVar4 + 0x340); fVar9 = sqrtf(fVar9 * fVar9 + fVar7 * fVar7); if (fVar9 <= local_8) { fVar9 = local_8; } local_8 = fVar9; } } } *param_2 = fVar9; } *param_1 = fVar6; param_1[1] = fVar8; return; } //@@ 005581b0 NpcHelper::willo_orbit /* DB: Willo helper */ void NpcHelper::willo_orbit(void) { int iVar1; int *piVar2; int in_ECX; int iVar3; float fVar4; float fVar5; float local_1c; float local_18; float local_14; float local_10; float local_c; float local_8; if (*(int *)(in_ECX + 0x30) == 0) { willo_slot(&local_1c,0); local_c = *(float *)(in_ECX + 0x33c); fVar4 = local_18 - *(float *)(in_ECX + 0x340); fVar4 = sqrtf(fVar4 * fVar4 + (local_1c - local_c) * (local_1c - local_c)); if ((fVar4 < 20.0) && (*(int *)(in_ECX + 0xba4) == 1)) { *(undefined4 *)(in_ECX + 0xba4) = 0; } iVar3 = *(int *)(in_ECX + 0x3bc); if (iVar3 == 0) { iVar3 = 0; local_10 = g_vectorZero.x; local_14 = g_vectorZero.y; for (piVar2 = (g_game->_playerManager)._playerList._begin; piVar2 != (g_game->_playerManager)._playerList._end; piVar2 = piVar2 + 1) { iVar1 = *piVar2; if (*(int *)(iVar1 + 0x2c) == 0) { iVar3 = iVar3 + 1; fVar4 = *(float *)(iVar1 + 0x360) / *(float *)(iVar1 + 0x36c); fVar5 = *(float *)(iVar1 + 0x364) / *(float *)(iVar1 + 0x36c); local_10 = local_10 + fVar4 + fVar4; local_14 = local_14 + fVar5 + fVar5; } } local_10 = local_10 / (float)iVar3; local_14 = local_14 / (float)iVar3; } else { fVar4 = *(float *)(iVar3 + 0x360) / *(float *)(iVar3 + 0x36c); fVar5 = *(float *)(iVar3 + 0x364) / *(float *)(iVar3 + 0x36c); local_10 = fVar4 + fVar4 + g_vectorZero.x; local_14 = fVar5 + fVar5 + g_vectorZero.y; } local_8 = (local_1c - (local_c + local_10)) * 0.5; local_c = (local_18 - (local_14 + *(float *)(in_ECX + 0x340))) * 0.5; fVar4 = sqrtf(local_c * local_c + local_8 * local_8); if (10.0 < fVar4) { if (fVar4 <= 0.0) { local_8 = local_8 * 10.0; local_c = local_c * 10.0; } else { local_8 = local_8 * (1.0 / fVar4) * 10.0; local_c = local_c * (1.0 / fVar4) * 10.0; } } *(float *)(in_ECX + 0x360) = (local_8 + local_10) / *(float *)(in_ECX + 0x36c); *(float *)(in_ECX + 0x364) = (local_c + local_14) / *(float *)(in_ECX + 0x36c); } return; } //@@ 005583d0 NpcHelper::willo_attack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Willo helper; str Shoot */ void NpcHelper::willo_attack(void) { Manager *pMVar1; byte bVar2; Entity *pEVar3; Entity_NPC *in_ECX; float fVar4; Vector local_c4; float local_bc; float local_b8; ProjectileParams local_b4; float local_8; local_8 = (float)(__security_cookie ^ (uint)&(&local_b4)[1].CircleAngle); if (((in_ECX->_sprite)._animState._animData == (void *)0x0) || ((in_ECX->_sprite)._animState._isPlaying == 0)) { in_ECX->_state = 3; return; } bVar2 = AnimationState::IsEventTriggered(&(in_ECX->_sprite)._animState,&DAT_00b6166c); pMVar1 = g_manager; if (bVar2 != 0) { local_b8 = 1.0; if (in_ECX->_championColorIdx == 0x12) { local_b8 = 1.5; } else if (in_ECX->_championColorIdx == 0x13) { local_b8 = 0.5; } local_bc = 6.60012e-43; seed_fart_sound_override((int *)&local_bc); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_bc,1.0,2,0,local_b8,0.0); } if ((in_ECX->_sprite)._animState._animData == (void *)0x0) { return; } bVar2 = AnimationState::IsEventTriggered(&(in_ECX->_sprite)._animState,(byte *)"Shoot"); pMVar1 = g_manager; if (bVar2 == 0) { return; } local_b8 = 1.0; if (in_ECX->_championColorIdx == 0x12) { local_b8 = 1.5; } else if (in_ECX->_championColorIdx == 0x13) { local_b8 = 0.5; } local_bc = 2.14399e-43; seed_fart_sound_override((int *)&local_bc); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_bc,1.0,2,0,local_b8,0.0); pEVar3 = Entity_NPC::GetPlayerTarget(in_ECX); ProjectileParams::ProjectileParams(&local_b4); local_bc = ((pEVar3->_pos).x + (pEVar3->_velocity).x) - (in_ECX->_pos).x; local_b8 = ((pEVar3->_pos).y + (pEVar3->_velocity).y) - (in_ECX->_pos).y; fVar4 = sqrtf(local_bc * local_bc + local_b8 * local_b8); local_c4.x = local_bc; local_c4.y = local_b8; if (0.0 < fVar4) { local_c4.y = local_b8 * (1.0 / fVar4); local_c4.x = local_bc * (1.0 / fVar4); } local_c4.x = local_c4.x * 10.0; local_b4.Color._offset[2] = DAT_00c33cd8; local_c4.y = local_c4.y * 10.0; local_b4.Variant = 4; local_b4.Color._tint[0] = _DAT_00c33cb0; local_b4.Color._tint[1] = fRam00c33cb4; local_b4.Color._tint[2] = fRam00c33cb8; local_b4.Color._tint[3] = fRam00c33cbc; local_b4.BulletFlags._0_4_ = 0x2000; local_b4.BulletFlags._4_4_ = 0; local_b4.Color._colorize[0] = _DAT_00c33cc0; local_b4.Color._colorize[1] = fRam00c33cc4; local_b4.Color._colorize[2] = fRam00c33cc8; local_b4.Color._colorize[3] = fRam00c33ccc; local_b4.Color._offset[0] = (float)DAT_00c33cd0; local_b4.Color._offset[1] = DAT_00c33cd0._4_4_; if ((in_ECX->_parent == (EntityPtr)0x0) && (in_ECX->_subtype == 0)) { local_b4.FallingSpeedModifier = local_b4.FallingSpeedModifier + 4.0; } Entity_NPC::FireProjectiles(in_ECX,&in_ECX->_pos,&local_c4,0,&local_b4); return; } //@@ 005586b0 NpcAI::ENTITY_WILLO /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 808 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WILLO(Entity_NPC *npc) { qword qVar1; byte bVar2; int iVar3; float *pfVar4; float *targetPos; Vector *dir; uint uVar5; Entity *splash; int iVar6; int iVar7; float fVar8; float fVar9; float fVar10; undefined1 auStack_154 [8]; Vector VStack_14c; undefined1 auStack_144 [4]; float targetY; Vector VStack_13c; char willoQuery [4]; void *willoData; uint willoCount; Vector VStack_124; float offsetY; float offsetX; ProjectileParams projParams; undefined4 diveSplashColor; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 splashColor; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uint *flagsHi; void *willos; uStack_8 = 0xffffffff; puStack_c = &LAB_00af4cc0; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar7 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; if (0 < npc->_projectileCooldown) { iVar6 = npc->_projectileCooldown - iVar7; iVar3 = 0; if (0 < iVar6) { iVar3 = iVar6; } npc->_projectileCooldown = iVar3; } VStack_13c.y = (float)npc; switch(npc->_state) { case 0: qVar1 = npc->_flags; flagsHi = (uint *)((int)&npc->_flags + 4); *flagsHi = *flagsHi | 0x2000; (npc->_v1).x = 120.0; (npc->_v1).y = 1.0; npc->_projectileDelay = 0x28; *(int *)&npc->_flags = (int)qVar1; collect_npcs_with_same_parent(); if ((*(char *)g_game->_room != '\0') && (g_game->_frameCount == *(int *)((int)g_game->_room + 0x11f0))) { Entity_NPC::QueryNPCsType(willoQuery,0x328,-1); willos = willoData; uVar5 = 0; if (willoCount != 0) { do { iVar7 = *(int *)((int)willos + uVar5 * 4); NpcHelper::willo_get_target_pos(&VStack_124,0); pfVar4 = (float *)NpcHelper::willo_slot(auStack_154,0xc); VStack_14c.y = VStack_124.x; offsetX = *pfVar4 - VStack_124.x; offsetY = pfVar4[1] - VStack_124.y; targetY = VStack_124.y; fVar8 = sqrtf(offsetX * offsetX + offsetY * offsetY); fVar9 = offsetX; fVar10 = offsetY; if (0.0 < fVar8) { fVar10 = offsetY * (1.0 / fVar8); fVar9 = offsetX * (1.0 / fVar8); } uVar5 = uVar5 + 1; fVar8 = *(float *)(iVar7 + 0xbb0) * 1.15; *(float *)(iVar7 + 0x340) = targetY + fVar10 * fVar8; *(float *)(iVar7 + 0x33c) = VStack_14c.y + fVar9 * fVar8; } while (uVar5 < willoCount); npc = (Entity_NPC *)VStack_13c.y; } if (willoQuery[0] == '\0') { uStack_8 = 0; tracked_alloc(1,willoData,0); uStack_8 = 0xffffffff; } } npc->_state = 3; break; case 3: ANM2::Play(&npc->_sprite,s_Fly,0); NpcHelper::willo_orbit(); if (1 < npc->_projectileDelay) { iVar7 = npc->_projectileDelay - iVar7; iVar3 = 1; if (1 < iVar7) { iVar3 = iVar7; } npc->_projectileDelay = iVar3; } uVar5 = Random(); if (uVar5 % 9 == 0) { if (npc->_subtype != 1) { if ((0 < npc->_projectileCooldown) || (pfVar4 = &(npc->_posOffset).y, *pfVar4 <= 0.0 && *pfVar4 != 0.0)) break; pfVar4 = (float *)NpcHelper::willo_slot(auStack_154,0); fVar9 = pfVar4[1] - (npc->_pos).y; fVar10 = *pfVar4 - (npc->_pos).x; if ((400.0 < fVar9 * fVar9 + fVar10 * fVar10) || ((bVar2 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,0.0), bVar2 == 0 || (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000a00), bVar2 != 0)))) break; Entity_NPC::QueryNPCsType(willoQuery,0x328,-1); uVar5 = 0; if (willoCount != 0) { do { iVar7 = *(int *)((int)willoData + uVar5 * 4); if (((*(int *)(iVar7 + 0x30) == 0) && (*(char *)(iVar7 + 0x173) == '\0')) && ((*(int *)(iVar7 + 0xb64) == 8 || (*(int *)(iVar7 + 0xb64) == 9)))) { EntityList_Query::~EntityList_Query(willoQuery); goto LAB_00558f6c; } uVar5 = uVar5 + 1; } while (uVar5 < willoCount); } if (willoQuery[0] == '\0') { uStack_8 = 1; tracked_alloc(1,willoData,0); uStack_8 = 0xffffffff; } } fVar9 = (npc->_v2).x; npc->_state = 8; (npc->_v2).y = fVar9; } break; case 6: ANM2::Play(&npc->_sprite,(byte *)"UnderwaterSpawn",0); npc->_entityCollisionClass = 0; NpcHelper::willo_orbit(); iVar7 = ANM2::GetFrame(&npc->_sprite); if (iVar7 == 1) { uVar5 = Random(); splash = Game::SpawnEx(g_game,1000,0x85,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); uStack_20 = 0x3f800000; uStack_1c = 0x3f40c0c2; uStack_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; splashColor = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0x3f800000; uStack_18 = 0x3b808081; (**(code **)(*(int *)splash + 0x3c))(&splashColor,0xffffffff,0xff,0,1); npc->_visible = 1; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_entityCollisionClass = 4; } break; case 7: ANM2::Play(&npc->_sprite,(byte *)"UnderwaterAttack",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { uVar5 = Random(); splash = Game::SpawnEx(g_game,1000,0x85,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); uStack_20 = 0x3f800000; uStack_1c = 0x3f40c0c2; uStack_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; splashColor = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0x3f800000; uStack_18 = 0x3b808081; (**(code **)(*(int *)splash + 0x3c))(&splashColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)npc + 0x28))(); } else { iVar7 = ANM2::GetFrame(&npc->_sprite); if (iVar7 == 1) { uVar5 = Random(); splash = Game::SpawnEx(g_game,1000,0x85,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); uStack_20 = 0x3f800000; uStack_1c = 0x3f40c0c2; uStack_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; splashColor = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0x3f800000; uStack_18 = 0x3b808081; (**(code **)(*(int *)splash + 0x3c))(&splashColor,0xffffffff,0xff,0,1); } NpcHelper::willo_attack(); } fVar9 = (npc->_targetPosition).y; fVar10 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar9 - fVar10; break; case 8: ANM2::Play(&npc->_sprite,(byte *)"Attack",0); NpcHelper::willo_attack(); NpcHelper::willo_orbit(); break; case 9: NpcHelper::willo_attack(); fVar9 = (npc->_targetPosition).x; (npc->_velocity).x = (npc->_targetPosition).x; (npc->_velocity).y = (npc->_targetPosition).y; (npc->_targetPosition).x = fVar9 * 0.9; (npc->_targetPosition).y = (npc->_targetPosition).y * 0.9; break; case 10: NpcHelper::willo_orbit(local_14); iVar7 = npc->_stateFrame; npc->_stateFrame = iVar7 + 1; fVar9 = ((float)(iVar7 + 1) - 0.0) * 0.0625; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } fVar9 = sin(fVar9 * 3.1415927 + 0.0); (npc->_v1).y = fVar9 * 0.8 + 1.0; if (((iVar7 == 2) || (iVar7 == 5)) || (iVar7 == 8)) { Entity_NPC::PlaySound(npc,0x99,1.0,2,0,1.0); pfVar4 = (float *)NpcHelper::willo_slot(auStack_154,0); targetPos = (float *)NpcHelper::willo_get_target_pos(auStack_144,0); VStack_124.x = *pfVar4 - *targetPos; VStack_124.y = pfVar4[1] - targetPos[1]; dir = Vector::Normalized(&VStack_124,&VStack_14c); VStack_13c.y = dir->y * 8.0; VStack_13c.x = dir->x * 8.0; ProjectileParams::ProjectileParams(&projParams); Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c33cb0); projParams.Variant = 4; projParams.BulletFlags._0_4_ = 0x2000; projParams.BulletFlags._4_4_ = 0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&VStack_13c,0,&projParams); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (npc->_v1).y = 1.0; npc->_state = 3; } break; case 0xd: npc->_friction = npc->_friction * 0.5; ANM2::Play(&npc->_sprite,(byte *)"UnderwaterDive",0); if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && (npc->_entityCollisionClass != 0)) { uVar5 = Random(); splash = Game::SpawnEx(g_game,1000,0x85,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); uStack_4c = 0x3f800000; uStack_48 = 0x3f40c0c2; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; uStack_50 = 0; diveSplashColor = 0; uStack_68 = 0; uStack_64 = 0; uStack_60 = 0x3f800000; uStack_44 = 0x3b808081; (**(code **)(*(int *)splash + 0x3c))(&diveSplashColor,0xffffffff,0xff,0,1); npc->_entityCollisionClass = 0; npc->_visible = 0; npc->_shadowSize = 0.0; } } LAB_00558f6c: if (npc->_dead != 0) { collect_npcs_with_same_parent(); } ExceptionList = local_10; return; } //@@ 00558fe0 NpcHelper::min_min_spawn_willo /* DB: Game::SpawnEx type 0x328 (808 ENTITY_WILLO) with spawner EDX, clears flag 4, sets +0xbb0/+0xbb4; param_1 == 0 -> state 6 + "UnderwaterSpawn", else "UnderwaterAttack"; only caller NpcAI::ENTITY_MIN_MIN */ Entity * NpcHelper::min_min_spawn_willo(byte param_1) { byte bVar1; uint flagsHigh; Entity *willo; byte *curAnimName; Vector *in_ECX; char *targetAnimName; EntityPtr in_EDX; bool bVar3; float in_XMM2_Da; EntityPtr *eraseKey; float v1X; Vector *spawnPos; byte *animData; undefined4 flagsHigh; EntityPtr *parentSlot; v1X = in_XMM2_Da; spawnPos = in_ECX; flagsHigh = Random(); willo = Game::SpawnEx(g_game,0x328,0,in_ECX,&g_vectorZero,(Entity *)in_EDX,(uint)param_1,flagsHigh,0); if (in_EDX != (EntityPtr)0x0) { parentSlot = &willo->_parent; if (willo->_parent != (EntityPtr)0x0) { eraseKey = parentSlot; std::multiset::erase(&eraseKey); } *parentSlot = in_EDX; std::multiset::insert(parentSlot); } *(uint *)&willo->_flags = (uint)willo->_flags & 0xfffffffb; flagsHigh = *(undefined4 *)((int)&willo->_flags + 4); willo[2]._prevVelocity.y = v1X; willo[2]._speedMultiplier = 1.0; *(undefined4 *)((int)&willo->_flags + 4) = flagsHigh; if (param_1 == 0) { willo[2]._posOffset.x = 8.40779e-45; animData = (willo->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } targetAnimName = "UnderwaterSpawn"; do { bVar1 = *curAnimName; bVar3 = bVar1 < (byte)*targetAnimName; if (bVar1 != *targetAnimName) { LAB_00559170: flagsHigh = -(uint)bVar3 | 1; goto LAB_00559175; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar3 = bVar1 < (byte)targetAnimName[1]; if (bVar1 != targetAnimName[1]) goto LAB_00559170; curAnimName = curAnimName + 2; targetAnimName = targetAnimName + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_00559175: if (flagsHigh == 0) { if (animData[0x34] == 0) { return willo; } if ((willo->_sprite)._animState._isPlaying != 0) { return willo; } } } bVar1 = ANM2::SetAnimation(&willo->_sprite,(byte *)"UnderwaterSpawn",1); if (bVar1 != 0) { AnimationState::Rewind(&(willo->_sprite)._animState); (willo->_sprite)._animState._isPlaying = 1; } return willo; } willo[2]._posOffset.x = 9.80909e-45; animData = (willo->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } targetAnimName = "UnderwaterAttack"; do { bVar1 = *curAnimName; bVar3 = bVar1 < (byte)*targetAnimName; if (bVar1 != *targetAnimName) { LAB_005590d0: flagsHigh = -(uint)bVar3 | 1; goto LAB_005590d5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar3 = bVar1 < (byte)targetAnimName[1]; if (bVar1 != targetAnimName[1]) goto LAB_005590d0; curAnimName = curAnimName + 2; targetAnimName = targetAnimName + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_005590d5: if ((flagsHigh == 0) && ((animData[0x34] == 0 || ((willo->_sprite)._animState._isPlaying != 0)))) goto LAB_00559108; } bVar1 = ANM2::SetAnimation(&willo->_sprite,(byte *)"UnderwaterAttack",1); if (bVar1 != 0) { AnimationState::Rewind(&(willo->_sprite)._animState); (willo->_sprite)._animState._isPlaying = 1; } LAB_00559108: (willo->_targetPosition).x = spawnPos->x; (willo->_targetPosition).y = spawnPos->y; willo[2]._prevPosition.x = 0.0; return willo; } //@@ 005591c0 NpcAI::ENTITY_WILLO_L2_find_target /* DB: ? ECX=npc (Willo L2): picks the nearest valid enemy in the room entity list (skips non-active types 0x21, 0x11, 0x124, friendly/charmed, specific bosses) and stores it in npc->_entityRef; twice from NpcAI::ENTITY_WILLO_L2 when it has no target */ EntityPtr __fastcall NpcAI::ENTITY_WILLO_L2_find_target(Entity_NPC *npc) { EntityPtr EVar1; int iVar2; EntityPtr EVar3; EntityPtr *pEVar4; bool bVar5; float fVar6; float fVar7; float fVar8; EntityPtr *local_c; Entity_NPC *local_8; fVar8 = 1e+09; EVar3 = (EntityPtr)0x0; local_c = *(EntityPtr **)((int)g_game->_room + 0x1264); if (local_c != (EntityPtr *)0x0) { pEVar4 = *(EntityPtr **)((int)g_game->_room + 0x125c); do { EVar1 = *pEVar4; if ((EVar1 != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (iVar2 = 1, *(int *)((int)EVar1 + 0x28) == 1) ) || (iVar2 = *(int *)((int)EVar1 + 0x28), iVar2 - 10U < 0x3de)))) { if ((*(int *)&g_game->_deathmatchManager < 2) || (iVar2 != 1)) { if ((iVar2 - 10U < 0x3de) && (((iVar2 != 0x21 && (iVar2 != 0x11)) && (iVar2 != 0x124)))) { if (iVar2 == 0x375) { bVar5 = *(int *)((int)EVar1 + 0x2c) == 10; } else { if ((iVar2 == 0x3c0) || (iVar2 == 0x3c5)) goto LAB_00559375; bVar5 = iVar2 == 0xf5; } if (!bVar5) goto LAB_00559298; } } else { LAB_00559298: if ((((((*(char *)((int)EVar1 + 0x173) == '\0') && (iVar2 != 0x328)) && (iVar2 != 0x346)) && ((iVar2 != 0x32a && (iVar2 != 0xd)))) && ((iVar2 != 0x32f && (iVar2 != 0x32e)))) && ((iVar2 != 0x32b || (*(int *)((int)EVar1 + 0x188) != 0)))) { if (((*(uint *)((int)EVar1 + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0)) { fVar7 = (npc->_pos).y - *(float *)((int)EVar1 + 0x340); fVar6 = (npc->_pos).x - *(float *)((int)EVar1 + 0x33c); fVar6 = fVar7 * fVar7 + fVar6 * fVar6; if (fVar6 < fVar8) { EVar3 = EVar1; fVar8 = fVar6; } } } } } LAB_00559375: pEVar4 = pEVar4 + 1; local_c = (EntityPtr *)&local_c[-1].field_0x3; } while (local_c != (EntityPtr *)0x0); } pEVar4 = &npc->_entityRef; local_8 = npc; if (npc->_entityRef != (EntityPtr)0x0) { local_c = pEVar4; std::multiset::erase(&local_c); } *pEVar4 = EVar3; if (EVar3 != (EntityPtr)0x0) { std::multiset::insert(pEVar4); } return EVar3; } //@@ 005593c0 NpcAI::ENTITY_WILLO_L2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 838 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_WILLO_L2(Entity_NPC *npc) { float *pfVar1; uint *puVar2; float fVar3; void *pvVar4; byte bVar5; int *piVar6; byte *anim; EntityPtr foundTarget; float *pfVar7; Vector *targetPos; Entity *playerTarget; LayerState *glowLayer; int iVar8; EntityPtr target; uint uVar9; float fVar10; EntityPtr *pEVar11; float lerpFactor; float fVar12; float fVar13; EntityList_EL nearbyWillos; float oldVelocityY; float oldVelocityX; Vector local_f8; Vector local_f0; float orbitVelX; float local_e4; float local_e0; float local_dc; float local_d8; EntityPtr *local_d4; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; Entity_NPC *otherWillo; int *projectileCooldown; pvVar4 = ExceptionList; local_14 = -NAN; puStack_18 = &LAB_00af4cf0; local_1c = ExceptionList; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_24 = __security_cookie ^ (uint)&(&projParams)[1].Spread; if (npc->_aiCallPhase == 3) { pvVar4 = npc->_collisionEntity; if (((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)pvVar4 + 0x28) != 1)) && (0x3dd < *(int *)((int)pvVar4 + 0x28) - 10U)) { return; } if (((*(uint *)((int)pvVar4 + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0)) { npc->_collisionResult = 0; return; } return; } iVar8 = npc->_projectileCooldown; projectileCooldown = &npc->_projectileCooldown; ExceptionList = &local_1c; if (0 < iVar8) { iVar8 = iVar8 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); *projectileCooldown = iVar8; } if ((npc->_flags & 0x1000a00) != 0) { local_d4 = (EntityPtr *)0xa; piVar6 = (int *)&local_d4; if (9 < iVar8) { piVar6 = projectileCooldown; } *projectileCooldown = *piVar6; } iVar8 = npc->_state; if (iVar8 == 0) { ENTITY_WILLO_L2_find_target(npc); target = npc->_entityRef; foundTarget = (EntityPtr)0x0; if (target != (EntityPtr)0x0) { local_d8 = (npc->_pos).y - *(float *)((int)target + 0x340); local_d4 = (EntityPtr *)((npc->_pos).x - *(float *)((int)target + 0x33c)); fVar10 = sqrtf(local_d8 * local_d8 + (float)local_d4 * (float)local_d4); if (fVar10 <= 0.0) { fVar12 = local_d8; pEVar11 = local_d4; } else { fVar10 = (*(float *)((int)target + 0x370) + 40.0) / fVar10; fVar12 = local_d8 * fVar10; pEVar11 = (EntityPtr *)((float)local_d4 * fVar10); } fVar10 = *(float *)((int)target + 0x340); (npc->_pos).x = (float)pEVar11 + *(float *)((int)target + 0x33c); (npc->_pos).y = fVar12 + fVar10; foundTarget = npc->_entityRef; } npc->_projectileDelay = 0x28; npc->_state = 3; npc->_aiCallFlags = 4; npc->_entityGridCollisionClass = 0; puVar2 = (uint *)((int)&npc->_flags + 4); *puVar2 = *puVar2 | 0x2000; npc->_i1 = (uint)(foundTarget != (EntityPtr)0x0); *(int *)&npc->_flags = (int)npc->_flags; uVar9 = g_graphicsManager_flags; glowLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x3); iVar8 = 1; if ((uVar9 & 4) == 0) { iVar8 = 6; } glowLayer->_blendMode[0] = 0; glowLayer->_blendMode[1] = iVar8; glowLayer->_blendMode[2] = 1; glowLayer->_blendMode[3] = 1; glowLayer->_blendMode[4] = 1; ExceptionList = local_1c; return; } if ((iVar8 != 3) && (iVar8 != 8)) { ExceptionList = pvVar4; return; } anim = s_Fly; if (iVar8 != 3) { anim = (byte *)"Attack"; } ANM2::Play(&npc->_sprite,anim,0); target = npc->_entityRef; npc->_friction = npc->_friction * 0.9; if (target == (EntityPtr)0x0) { ENTITY_WILLO_L2_find_target(npc); target = npc->_entityRef; npc->_i1 = (uint)(target != (EntityPtr)0x0); if (target == (EntityPtr)0x0) { foundTarget = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); if (npc->_entityRef != (EntityPtr)0x0) { local_d4 = &npc->_entityRef; std::multiset::erase(&local_d4); } npc->_entityRef = foundTarget; target = (EntityPtr)0x0; if (foundTarget != (EntityPtr)0x0) { std::multiset::insert(&npc->_entityRef); target = npc->_entityRef; } pfVar1 = &npc->_health; local_d4 = (EntityPtr *)(npc->_maxHitPoints * 0.5); pfVar7 = (float *)&local_d4; if (*pfVar1 <= (float)local_d4) { pfVar7 = pfVar1; } *pfVar1 = *pfVar7; if (target == (EntityPtr)0x0) goto LAB_00559bd3; } } local_d4 = (EntityPtr *)(*(float *)((int)target + 0x370) + 20.0); local_dc = *(float *)((int)target + 0x38c) - (npc->_pos).x; local_e0 = *(float *)((int)target + 0x390) - (npc->_pos).y; if (npc->_i1 != 0) { (npc->_velocity).x = (npc->_velocity).x - (npc->_v1).x; (npc->_velocity).y = (npc->_velocity).y - (npc->_v1).y; } local_e4 = sqrtf(local_e0 * local_e0 + local_dc * local_dc); if (local_e4 == 0.0) { local_e4 = 0.1; } local_dc = local_dc / local_e4; local_e0 = local_e0 / local_e4; local_d8 = cos(1.5707964); fVar10 = sin(1.5707964); pEVar11 = &npc->_entityRef; fVar12 = (local_e4 - (float)local_d4) * 0.05; orbitVelX = local_d8 * local_dc - fVar10 * local_e0; oldVelocityY = (npc->_velocity).y; local_d8 = local_d8 * local_e0 + fVar10 * local_dc; oldVelocityX = (npc->_velocity).x; if (fVar12 <= -2.0) { fVar12 = -2.0; } local_e4 = (local_e4 - (float)local_d4) / 300.0; if (2.0 <= fVar12) { fVar12 = 2.0; } local_f8.y = fVar12 * local_dc * 0.5; local_f0.y = fVar12 * local_e0 * 0.5; fVar10 = 6.0 - (oldVelocityY * local_d8 + oldVelocityX * orbitVelX); if (local_e4 <= 0.0) { local_e4 = 0.0; } if (fVar10 <= 0.0) { fVar10 = 0.0; } if (3.0 <= fVar10) { fVar10 = 3.0; } orbitVelX = orbitVelX * fVar10; local_d8 = local_d8 * fVar10; if (1.0 <= local_e4) { local_e4 = 1.0; } if (npc->_i1 == 0) { fVar10 = 1.0 - local_e4; iVar8 = 0; } else { fVar10 = local_e0 * (float)local_d4; local_e0 = (*(float *)((int)*pEVar11 + 0x33c) - local_dc * (float)local_d4) - (npc->_pos).x; local_dc = (*(float *)((int)*pEVar11 + 0x340) - fVar10) - (npc->_pos).y; fVar10 = sqrtf(local_e0 * local_e0 + local_dc * local_dc); if ((fVar10 <= 15.0) || (fVar10 <= 0.0)) { fVar12 = local_e0; fVar13 = local_dc; } else { fVar12 = local_e0 * (15.0 / fVar10); fVar13 = local_dc * (15.0 / fVar10); } fVar3 = npc->_speedMultiplier; fVar10 = 1.0 - local_e4; lerpFactor = 1.0 - fVar10 * 0.5; if (fVar3 != 1.0) { lerpFactor = lerpFactor / ((fVar3 + lerpFactor) - fVar3 * lerpFactor); } (npc->_velocity).x = oldVelocityX + (fVar12 - oldVelocityX) * (1.0 - lerpFactor); (npc->_velocity).y = oldVelocityY + (fVar13 - oldVelocityY) * (1.0 - lerpFactor); iVar8 = npc->_i1; } fVar12 = (local_f8.y + orbitVelX) * npc->_speedMultiplier + (npc->_velocity).x; fVar13 = (local_f0.y + local_d8) * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fVar12; (npc->_velocity).y = fVar13; if (iVar8 == 0) { (npc->_v1).x = g_vectorZero.x; (npc->_v1).y = g_vectorZero.y; } else { fVar3 = *(float *)((int)*pEVar11 + 0x364); (npc->_velocity).x = fVar12 + fVar10 * *(float *)((int)*pEVar11 + 0x360); (npc->_velocity).y = fVar10 * fVar3 + fVar13; fVar12 = *(float *)((int)*pEVar11 + 0x364); (npc->_v1).x = fVar10 * *(float *)((int)*pEVar11 + 0x360); (npc->_v1).y = fVar10 * fVar12; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyWillos,&npc->_pos,120.0,8); uVar9 = 0; if (nearbyWillos._size != 0) { do { otherWillo = *(Entity_NPC **)((int)nearbyWillos._data + uVar9 * 4); if ((((otherWillo != (Entity_NPC *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (iVar8 = 1, otherWillo->_type == 1)) || (iVar8 = otherWillo->_type, iVar8 - 10U < 0x3de)) && ((otherWillo != npc && (iVar8 == npc->_type)))))) && (((otherWillo->_flags & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0))) && (otherWillo->_entityRef == npc->_entityRef)) { local_f8.y = (npc->_pos).y - (otherWillo->_pos).y; local_f0.y = (npc->_pos).x - (otherWillo->_pos).x; fVar10 = sqrtf(local_f8.y * local_f8.y + local_f0.y * local_f0.y); if (0.0 < fVar10) { fVar13 = fVar10 * 0.1 + 10.0; fVar12 = npc->_speedMultiplier; (npc->_velocity).x = ((local_f0.y / fVar10) / fVar13) * 10.0 * fVar12 + (npc->_velocity).x ; (npc->_velocity).y = ((local_f8.y / fVar10) / fVar13) * 10.0 * fVar12 + (npc->_velocity).y ; } } uVar9 = uVar9 + 1; } while (uVar9 < (uint)nearbyWillos._size); } if (nearbyWillos._0_1_ == '\0') { local_14 = 0.0; tracked_alloc(1,nearbyWillos._data,0); local_14 = -NAN; } LAB_00559bd3: if (((npc->_state != 3) || (uVar9 = Random(), uVar9 % 9 != 0)) || ((0 < npc->_projectileCooldown || (targetPos = Entity_NPC::CalcTargetPosition(npc,&local_f8,0.0), fVar10 = (npc->_pos).x - targetPos->x, fVar12 = (npc->_pos).y - targetPos->y, 57600.0 <= fVar12 * fVar12 + fVar10 * fVar10)))) { if (npc->_state == 8) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b6166c); manager = g_manager; if (bVar5 != 0) { local_d4 = (EntityPtr *)0x1d7; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar5 != 0) { local_d4 = (EntityPtr *)0x99; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); playerTarget = Entity_NPC::GetPlayerTarget(npc); ProjectileParams::ProjectileParams(&projParams); local_d4 = (EntityPtr *) (((playerTarget->_pos).x + (playerTarget->_velocity).x) - (npc->_pos).x); local_d8 = ((playerTarget->_pos).y + (playerTarget->_velocity).y) - (npc->_pos).y; fVar10 = sqrtf((float)local_d4 * (float)local_d4 + local_d8 * local_d8); if (fVar10 <= 0.0) { pEVar11 = local_d4; local_f0.y = local_d8; } else { pEVar11 = (EntityPtr *)((float)local_d4 * (1.0 / fVar10)); local_f0.y = local_d8 * (1.0 / fVar10); } local_f0.y = local_f0.y * 10.0; local_f0.x = (float)pEVar11 * 10.0; projParams.Color._offset[2] = DAT_00c33cd8; projParams.Color._tint[0] = _DAT_00c33cb0; projParams.Color._tint[1] = fRam00c33cb4; projParams.Color._tint[2] = fRam00c33cb8; projParams.Color._tint[3] = fRam00c33cbc; projParams.Variant = 4; projParams.Color._colorize[0] = _DAT_00c33cc0; projParams.Color._colorize[1] = fRam00c33cc4; projParams.Color._colorize[2] = fRam00c33cc8; projParams.Color._colorize[3] = fRam00c33ccc; projParams.Color._offset[0] = (float)DAT_00c33cd0; projParams.Color._offset[1] = DAT_00c33cd0._4_4_; projParams.BulletFlags._0_4_ = 0x2000; projParams.BulletFlags._4_4_ = 0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_f0,0,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } } npc->_state = 3; npc->_projectileCooldown = 0x2d; } } else { npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"Attack",0); } ExceptionList = local_1c; return; } //@@ 0055a010 NpcAI::ENTITY_BLURB /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 813 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BLURB(Entity_NPC *npc) { byte isBurst; Entity *pEVar2; Vector *targetPos; uint uVar3; void *freeBlock; uint variant; float fVar4; float fVar5; int iVar6; int framedelay; Vector local_104; Vector scratchVec; float local_f4; byte isHostile; ProjectileParams projParams; std_string walkVertAnim; std_string walkHoriAnim; void *local_10; undefined1 *puStack_c; uint uStack_8; bool isBurst; Manager *manager; uStack_8 = 0xffffffff; puStack_c = &LAB_00af4d35; local_10 = ExceptionList; ExceptionList = &local_10; isBurst = false; pEVar2 = Entity_NPC::GetPlayerTarget(npc); isHostile = Entity::IsHostileTo((Entity *)npc,pEVar2); switch(npc->_state) { case 0: npc->_state = 4; npc->_stateFrame = 0; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAppear",0); isBurst = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((isBurst != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } break; case 4: case 8: case 0x10: walkVertAnim._capacity = 0xf; walkVertAnim._size = 8; builtin_strncpy(walkVertAnim._buf,"WalkVert",9); walkHoriAnim._capacity = 0xf; walkHoriAnim._size = 8; builtin_strncpy(walkHoriAnim._buf,"WalkHori",9); uStack_8 = 1; Entity_NPC::AnimWalkFrame(npc,&walkHoriAnim,&walkVertAnim,0.1); uStack_8 = uStack_8 & 0xffffff00; if (0xf < walkHoriAnim._capacity) { uVar3 = walkHoriAnim._capacity + 1; freeBlock = (void *)walkHoriAnim._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(void **)(walkHoriAnim._buf._0_4_ + -4); uVar3 = walkHoriAnim._capacity + 0x24; if (0x1f < (walkHoriAnim._buf._0_4_ - (int)freeBlock) - 4U) goto code_r0x0055a1b7; } operator_delete(freeBlock,uVar3); } uStack_8 = 0xffffffff; walkHoriAnim._size = 0; walkHoriAnim._capacity = 0xf; walkHoriAnim._buf._0_4_ = walkHoriAnim._buf._0_4_ & 0xffffff00; if (0xf < walkVertAnim._capacity) { uVar3 = walkVertAnim._capacity + 1; freeBlock = (void *)walkVertAnim._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(void **)(walkVertAnim._buf._0_4_ + -4); uVar3 = walkVertAnim._capacity + 0x24; if (0x1f < (walkVertAnim._buf._0_4_ - (int)freeBlock) - 4U) { code_r0x0055a1b7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } iVar6 = npc->_state; if (iVar6 == 4) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadFull",0); npc->_aiFloat = 0.3; if (npc->_controllerID == -1) { if (0.5 < npc->_health / npc->_maxHitPoints) { targetPos = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); fVar4 = (npc->_pos).y - targetPos->y; fVar5 = (npc->_pos).x - targetPos->x; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if (100.0 <= fVar4) goto code_r0x0055a2fc; if (isHostile == 0) goto code_r0x0055a3fa; } code_r0x0055a28f: npc->_stateFrame = 4; npc->_state = 8; if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar4 = g_vectorZero.y; } else { Entity_NPC::GetControllerMovementInput(npc,&scratchVec,0.1); (npc->_controllerMovement).x = scratchVec.x; fVar4 = scratchVec.y; } (npc->_controllerMovement).y = fVar4; } else { isBurst = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (isBurst != 0) goto code_r0x0055a28f; } code_r0x0055a2fc: if (((isHostile != 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (uVar3 = Random(), uVar3 % 3 == 0)) { framedelay = 0x78; fVar4 = 0.8; iVar6 = 0xa7; code_r0x0055a3f3: Entity_NPC::PlaySound(npc,iVar6,fVar4,framedelay,0,1.0); } } else if (iVar6 == 8) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAttack",0); npc->_aiFloat = 0.1; if (0 < npc->_stateFrame) { iVar6 = npc->_stateFrame + -1; isBurst = false; npc->_stateFrame = iVar6; if (iVar6 < 1) { isBurst = true; } } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 0x10; } } else if (iVar6 == 0x10) { ANM2::PlayOverlay(&npc->_sprite,s_Head,0); npc->_aiFloat = 0.72; if (((isHostile == 0) || ((npc->_pathfinder)._hasDirectPath == 0)) || (uVar3 = Random(), uVar3 % 3 != 0)) goto code_r0x0055a3fa; framedelay = 0x28; fVar4 = 1.0; iVar6 = 0xa5; goto code_r0x0055a3f3; } code_r0x0055a3fa: if ((npc->_flags & 0x1000800) == 0) { Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchVec,npc->_aiFloat,900,1); } else { pEVar2 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar2->_pos).x; scratchVec.y = (pEVar2->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&scratchVec,0); npc->_friction = npc->_friction * 0.8; } } if (npc->_dead != 0) { if ((npc->_state == 4) || ((npc->_state == 8 && (0 < npc->_stateFrame)))) { isBurst = true; } if ((-25.0 < npc->_health) && (uVar3 = Random(), (uVar3 & 1) == 0)) { uVar3 = Random(); Entity_NPC::Morph(npc,0xb,(uint)(uVar3 % 3 == 0),0,-1); npc->_health = npc->_maxHitPoints; npc->_dead = 0; } } manager = g_manager; if (!isBurst) { ExceptionList = local_10; return; } local_104.y = 1.0; if (npc->_championColorIdx == 0x12) { local_104.y = 1.5; } else if (npc->_championColorIdx == 0x13) { local_104.y = 0.5; } local_f4 = 3.16693e-43; seed_fart_sound_override((int *)&local_f4); SoundEffects::Play(&manager->_sfxManager,(int)local_f4,1.0,2,0,local_104.y,0.0); ProjectileParams::ProjectileParams(&projParams); variant = 0xb; uVar3 = Level::GetStageID(); if (uVar3 == 0x1b) { projParams.Variant = 4; } else { if (uVar3 != 0x1c) goto LAB_0055a5ce; projParams.Variant = 3; } variant = 0xc; LAB_0055a5ce: pEVar2 = Entity_NPC::GetPlayerTarget(npc); local_f4 = (pEVar2->_pos).x; scratchVec.y = (pEVar2->_pos).y; if ((npc->_controllerID != -1) && ((fVar4 = (npc->_controllerMovement).x, fVar4 != g_vectorZero.x || ((npc->_controllerMovement).y != g_vectorZero.y)))) { local_f4 = fVar4 * 120.0 + (npc->_pos).x; scratchVec.y = (npc->_controllerMovement).y * 120.0 + (npc->_pos).y; } fVar5 = (npc->_pos).x - local_f4; fVar4 = (npc->_pos).y - scratchVec.y; local_104.y = scratchVec.y; scratchVec.x = local_f4; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if (100.0 < fVar4) { local_f4 = local_f4 - (npc->_pos).x; local_104.y = local_104.y - (npc->_pos).y; fVar4 = sqrtf(local_f4 * local_f4 + local_104.y * local_104.y); if (fVar4 <= 0.0) { fVar5 = local_f4; fVar4 = local_104.y; } else { fVar5 = (1.0 / fVar4) * local_f4; fVar4 = (1.0 / fVar4) * local_104.y; } scratchVec.x = fVar5 * 100.0 + (npc->_pos).x; scratchVec.y = fVar4 * 100.0 + (npc->_pos).y; } uVar3 = Random(); Entity_NPC::FireBossProjectiles(npc,uVar3 % 3 + 7,&scratchVec,3.0,&projParams); uVar3 = Random(); local_104.x = (npc->_pos).x + 0.0; local_104.y = (npc->_pos).y + 1.0; pEVar2 = Game::Spawn(g_game,1000,variant,&local_104,&g_vectorZero,(Entity *)npc,0,uVar3); iVar6 = *(int *)pEVar2; (pEVar2->_posOffset).x = 0.0; (pEVar2->_posOffset).y = -20.0; (**(code **)(iVar6 + 0xc))(); ExceptionList = local_10; return; } //@@ 0055a850 NpcHelper::bubbles_death_geyser_tick /* DB: Entity_Effect::CreateTimer callback (ECX=0x55a850, delay 1, 15 times) from NpcAI::ENTITY_BUBBLES death: per call 2+2 projectiles at rand*2.8, FallingAccel 2, FallingSpeed -15-60r, scale 1.4r, height -23-15r / -23-1000r; notes/entities/pass7_i3.md */ void NpcHelper::bubbles_death_geyser_tick(int param_1) { uint projVariant; uint rngResult; uint rngFactor; Entity_Projectile *projectile; float originX; float cosAngle; float randScale; int highShotsLeft; int lowShotsLeft; Vector local_18; Vector local_10; float originX; float originY; originX = *(float *)(param_1 + 0x33c); originY = *(float *)(param_1 + 0x340); projVariant = Level::GetStageID(); if (projVariant == 0x1b) { projVariant = 4; } else if (projVariant == 0x1c) { projVariant = 3; } else { projVariant = 0; } lowShotsLeft = 2; do { rngResult = Random(); originX = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; originX = originX + originX; cosAngle = cos(originX); originX = sin(originX); rngResult = Random(); rngFactor = Random(); randScale = (float)((double)(int)rngFactor + __uint_to_double_fixup[-((int)rngFactor >> 0x1f)]) * 2.3283064e-10; local_18.y = randScale * originX * 2.8; local_18.x = randScale * cosAngle * 2.8; rngFactor = Random(); randScale = (float)((double)(int)rngFactor + __uint_to_double_fixup[-((int)rngFactor >> 0x1f)]) * 2.3283064e-10; local_10.x = cosAngle * 5.0 * randScale + originX; local_10.y = originX * 5.0 * randScale + originY; projectile = (Entity_Projectile *) Game::SpawnEx(g_game,9,projVariant,&local_10,&local_18,(Entity *)0x0,0,rngResult,0) ; projectile->_spawnerType = 0x326; rngResult = Random(); projectile->_fallingAccel = 2.0; projectile->_scale = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 1.4; rngResult = Random(); projectile->_fallingSpeed = -15.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 60.0; rngResult = Random(); projectile->_height = -23.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 15.0; Entity_Projectile::apply_spawn_flags (projectile,*(int *)(param_1 + 0x450),*(float *)(param_1 + 0x478), *(ulonglong *)(param_1 + 0x168),(Entity *)0x0); (**(code **)(*(int *)projectile + 0xc))(); lowShotsLeft = lowShotsLeft + -1; } while (lowShotsLeft != 0); highShotsLeft = 2; do { rngResult = Random(); originX = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; originX = originX + originX; cosAngle = cos(originX); originX = sin(originX); rngResult = Random(); rngFactor = Random(); randScale = (float)((double)(int)rngFactor + __uint_to_double_fixup[-((int)rngFactor >> 0x1f)]) * 2.3283064e-10; local_10.y = randScale * originX * 2.8; local_10.x = randScale * cosAngle * 2.8; rngFactor = Random(); randScale = (float)((double)(int)rngFactor + __uint_to_double_fixup[-((int)rngFactor >> 0x1f)]) * 2.3283064e-10; local_18.x = cosAngle * 5.0 * randScale + originX; local_18.y = originX * 5.0 * randScale + originY; projectile = (Entity_Projectile *) Game::SpawnEx(g_game,9,projVariant,&local_18,&local_10,(Entity *)0x0,0,rngResult,0) ; projectile->_spawnerType = 0x326; rngResult = Random(); projectile->_fallingAccel = 2.0; projectile->_scale = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 1.4; rngResult = Random(); projectile->_fallingSpeed = -15.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 60.0; rngResult = Random(); projectile->_height = -23.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 1000.0; Entity_Projectile::apply_spawn_flags (projectile,*(int *)(param_1 + 0x450),*(float *)(param_1 + 0x478), *(ulonglong *)(param_1 + 0x168),(Entity *)0x0); (**(code **)(*(int *)projectile + 0xc))(); highShotsLeft = highShotsLeft + -1; } while (highShotsLeft != 0); return; } //@@ 0055ad20 NpcAI::ENTITY_BUBBLES /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 806 (from dispatcher 006c2990) */ Entity_Projectile * __fastcall NpcAI::ENTITY_BUBBLES(Entity_NPC *npc) { uint *puVar1; byte bVar2; Vector *pVVar3; uint uVar4; Entity_Projectile *pEVar5; Entity *pEVar6; Entity_Effect *geyserTimer; int iVar7; void *pvVar8; uint delay; float fVar9; float fVar10; Vector dropPos; Entity_NPC *bubbles; Vector scratchVec; Vector local_1e0; float local_1d8; Vector *local_1d4; ProjectileParams burstParams; ProjectileParams shotParams; undefined4 local_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 local_6c; void *pvStack_68; char acStack_64 [4]; uint uStack_60; char local_5c [8]; uint local_54; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; void *pvStack_3c; char acStack_38 [4]; uint uStack_34; char local_30 [8]; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined *geyserColor; Manager *manager; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4d75; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_30 + 0x20); ExceptionList = &local_1c; iVar7 = npc->_state; bubbles = npc; if (iVar7 == 0) { npc->_state = 4; npc->_stateFrame = 0; npc->_i1 = 0; npc->_i2 = 0; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (bVar2 == 0) { ExceptionList = local_1c; return (Entity_Projectile *)0x0; } if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return (Entity_Projectile *)0x0; } AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0); pEVar5 = (npc->_sprite)._animState._animData; if (pEVar5 == (Entity_Projectile *)0x0) { ExceptionList = local_1c; return (Entity_Projectile *)0x0; } (npc->_sprite)._animState._isPlaying = 0; ExceptionList = local_1c; return pEVar5; } if (iVar7 != 4) { puStack_20 = local_30 + 0x2c; if (iVar7 != 8) goto LAB_0055b14f; puStack_20 = local_30 + 0x2c; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0055add8: npc->_state = 4; npc->_stateFrame = 0; } else { puStack_20 = local_30 + 0x2c; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { Game::ButterBeanFart(g_game,&npc->_pos,120.0,(Entity *)npc,1,0); npc->_i1 = 0xc; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0055add8; } npc->_friction = npc->_friction * 0.4; goto LAB_0055b14f; } if (npc->_stateFrame < 100) { iVar7 = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_stateFrame = iVar7; puStack_20 = local_30 + 0x2c; if (99 < iVar7) goto LAB_0055ae33; } else { LAB_0055ae33: if (npc->_controllerID == -1) { puStack_20 = local_30 + 0x2c; pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar10 = (pEVar6->_pos).x - (npc->_pos).x; fVar9 = (pEVar6->_pos).y - (npc->_pos).y; if ((fVar9 * fVar9 + fVar10 * fVar10 < 40000.0) && (uVar4 = Random(), uVar4 % 0x78 == 0)) goto LAB_0055afb1; } else { puStack_20 = local_30 + 0x2c; bVar2 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar2 != 0) || (bVar2 = Entity_NPC::IsControllerActionPressed(npc,9), bVar2 != 0)) { LAB_0055afb1: Entity_NPC::PlaySound(npc,0xa7,1.0,5,0,1.0); fVar10 = (npc->_velocity).x; fVar9 = (npc->_velocity).y; npc->_state = 8; npc->_stateFrame = 0; if (ABS(fVar10) <= ABS(fVar9)) { ANM2::Play(&npc->_sprite,(byte *)"AttackVert",0); } else { ANM2::Play(&npc->_sprite,(byte *)"AttackHori",0); (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; } goto LAB_0055b14f; } } } local_54 = 0xf; local_5c[4] = '\b'; local_5c[5] = '\0'; local_5c[6] = '\0'; local_5c[7] = '\0'; pvStack_68 = (void *)0x6b6c6157; builtin_strncpy(acStack_64,"Vert",4); uStack_60 = uStack_60 & 0xffffff00; local_28 = 0xf; local_30[4] = '\b'; local_30[5] = '\0'; local_30[6] = '\0'; local_30[7] = '\0'; pvStack_3c = (void *)0x6b6c6157; builtin_strncpy(acStack_38,"Hori",4); uStack_34 = uStack_34 & 0xffffff00; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&pvStack_3c,(std_string *)&pvStack_68,0.1); local_14 = local_14 & 0xffffff00; if (0xf < local_28) { uVar4 = local_28 + 1; pvVar8 = pvStack_3c; if (0xfff < uVar4) { pvVar8 = *(void **)((int)pvStack_3c + -4); uVar4 = local_28 + 0x24; if (0x1f < (uint)((int)pvStack_3c + (-4 - (int)pvVar8))) goto LAB_0055af53; } operator_delete(pvVar8,uVar4); } local_14 = 0xffffffff; local_30[4] = '\0'; local_30[5] = '\0'; local_30[6] = '\0'; local_30[7] = '\0'; local_28 = 0xf; pvStack_3c = (void *)((uint)pvStack_3c & 0xffffff00); if (0xf < local_54) { uVar4 = local_54 + 1; pvVar8 = pvStack_68; if (0xfff < uVar4) { pvVar8 = *(void **)((int)pvStack_68 + -4); uVar4 = local_54 + 0x24; if (0x1f < (uint)((int)pvStack_68 + (-4 - (int)pvVar8))) { LAB_0055af53: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar4); } npc->_aiFloat = 0.3; if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { pVVar3 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar3,0.3,900,1); } else { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_1e0.x = (pEVar6->_pos).x; local_1e0.y = (pEVar6->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_1e0,0); iVar7 = (npc->_pathfinder)._evadeMovementCountdown; fVar10 = npc->_friction * 0.8; npc->_friction = fVar10; if (0 < iVar7) { npc->_friction = fVar10 * 0.8; } } pEVar6 = Entity_NPC::GetPlayerTarget(npc); bVar2 = Entity::IsHostileTo((Entity *)npc,pEVar6); if (((bVar2 != 0) && ((npc->_pathfinder)._hasDirectPath != 0)) && (uVar4 = Random(), uVar4 % 3 == 0)) { Entity_NPC::PlaySound(npc,0x74,1.0,0x3c,0,1.0); } LAB_0055b14f: Entity_NPC::UpdateChargeBar(npc,0.0,100.0,(float)npc->_stateFrame,1); if (npc->_i2 < 1) { pEVar5 = (npc->_damageEvents)._begin; if (pEVar5 != (npc->_damageEvents)._end) { pvVar8 = (npc->_damageEvents)._end; local_1d4 = (Vector *)(*(float *)((int)pvVar8 + -0x14) - (npc->_pos).y); local_1d8 = *(float *)((int)pvVar8 + -0x18) - (npc->_pos).x; fVar10 = (float)local_1d4 * (float)local_1d4 + local_1d8 * local_1d8; if (0.01 <= fVar10) { fVar10 = sqrtf(fVar10); if (0.0 < fVar10) { local_1d4 = (Vector *)((1.0 / fVar10) * (float)local_1d4); local_1d8 = local_1d8 * (1.0 / fVar10); } } else { pVVar3 = MusicManager::RandomVector(&scratchVec); local_1d4 = (Vector *)pVVar3->y; local_1d8 = pVVar3->x; } uVar4 = Random(); fVar10 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 40.0; local_1e0.x = local_1d8 * fVar10 + (npc->_pos).x; local_1e0.y = (float)local_1d4 * fVar10 + (npc->_pos).y; ProjectileParams::ProjectileParams(&shotParams); uVar4 = Level::GetStageID(); if (uVar4 == 0x1b) { shotParams.Variant = 4; } else if (uVar4 == 0x1c) { shotParams.Variant = 3; } shotParams.Scale = 0.6; Entity_NPC::FireBossProjectiles(npc,1,&local_1e0,1.0,&shotParams); uVar4 = Random(); pEVar5 = (Entity_Projectile *)(uVar4 / 0x14); npc->_i2 = uVar4 % 0x14 + 0x14; } } else { pEVar5 = (Entity_Projectile *)(npc->_i2 - 1); npc->_i2 = (int)pEVar5; } manager = g_manager; if (0 < npc->_i1) { local_1d4 = (Vector *)0xb9; seed_fart_sound_override((int *)&local_1d4); SoundEffects::Play(&manager->_sfxManager,(int)local_1d4,1.0,2,0,1.0,0.0); ProjectileParams::ProjectileParams(&burstParams); uVar4 = Level::GetStageID(); if (uVar4 == 0x1b) { burstParams.Variant = 4; } else if (uVar4 == 0x1c) { burstParams.Variant = 3; } burstParams.Scale = 0.6; pEVar5 = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,3.0,&burstParams); npc->_i1 = npc->_i1 + -1; } if (npc->_dead != 0) { uVar4 = Random(); local_1d4 = &npc->_pos; pEVar6 = Game::Spawn(g_game,1000,0x84,local_1d4,&g_vectorZero,(Entity *)0x0,0,uVar4); uVar4 = Level::GetStageID(); if (uVar4 == 0x1c) { local_5c[0] = '\0'; local_5c[1] = '\0'; local_5c[2] = '\0'; local_5c[3] = '\0'; local_6c = 0; pvStack_68 = (void *)0x0; acStack_64[0] = '\0'; acStack_64[1] = '\0'; acStack_64[2] = '\0'; acStack_64[3] = '\0'; uStack_60 = 0; local_5c[4] = '\0'; local_5c[5] = '\0'; local_5c[6] = '\0'; local_5c[7] = '\0'; local_54 = 0; local_7c = 0x3f000000; uStack_78 = 0x3ecccccd; uStack_74 = 0x3e4ccccd; uStack_70 = 0x3f800000; (**(code **)(*(int *)pEVar6 + 0x3c))(&local_7c,0xffffffff,0xff,0,1); } (**(code **)(*(int *)pEVar6 + 0xc))(); pEVar5 = (Entity_Projectile *)(*(uint *)((int)&npc->_flags + 4) & 0x200000); if ((npc->_flags & 0x1000000) == 0 && pEVar5 == (Entity_Projectile *)0x0) { uVar4 = 4; do { delay = uVar4; uVar4 = Random(); local_1d8 = (-45.0 - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 90.0) * 0.017453292; local_1e0.y = cos(local_1d8); fVar10 = sin(local_1d8); scratchVec.x = local_1e0.y * 7.0; local_30[0] = '\0'; local_30[1] = '\0'; local_30[2] = '\0'; local_30[3] = '\0'; local_30[4] = '\0'; local_30[5] = '\0'; local_30[6] = '\0'; local_30[7] = '\0'; local_28 = 0; scratchVec.y = fVar10 * 7.0; dropPos.x = local_1e0.y * 40.0 + local_1d4->x; dropPos.y = fVar10 * 40.0 + local_1d4->y; local_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f800000; local_40 = 0; pvStack_3c = (void *)0x0; acStack_38[0] = '\0'; acStack_38[1] = '\0'; acStack_38[2] = '\0'; acStack_38[3] = '\0'; uStack_34 = 0; uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,2,&dropPos,&scratchVec,(Entity *)0x0,2,uVar4); (**(code **)(*(int *)pEVar6 + 0x3c))(&local_50,0xffffffff,0xff,0,1); (pEVar6->_sprite)._offset.x = 0.0; (pEVar6->_sprite)._offset.y = -28.0; pEVar6->_renderDepthOffset = 10.0; uVar4 = Random(); pEVar6->_renderZOffset = 500; (pEVar6->_sprite)._rotation = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar4 = Level::GetStageID(); if (uVar4 == 0x1c) { geyserColor = &DAT_00c33d08; } else { geyserColor = &DAT_00c33cdc; } (**(code **)(*(int *)pEVar6 + 0x3c))(geyserColor,0xffffffff,0xff,0,1); uVar4 = delay - 1; } while (uVar4 != 0); geyserTimer = Entity_Effect::CreateTimer(NpcHelper::bubbles_death_geyser_tick,delay,0xf,0); (geyserTimer->_pos).x = local_1d4->x; (geyserTimer->_pos).y = local_1d4->y; if (bubbles->_isChampion == 0) { iVar7 = -1; } else { iVar7 = bubbles->_championColorIdx; } geyserTimer->_state = iVar7; uVar4 = *(uint *)((int)&bubbles->_flags + 4); *(uint *)&geyserTimer->_flags = (uint)geyserTimer->_flags | (uint)bubbles->_flags & 0x20000100 ; puVar1 = (uint *)((int)&geyserTimer->_flags + 4); *puVar1 = *puVar1 | uVar4 & 0x400000; geyserTimer->_scale = bubbles->_scale; pEVar5 = (Entity_Projectile *)(**(code **)(*(int *)geyserTimer + 0xc))(); } } ExceptionList = local_1c; return pEVar5; } //@@ 0055b740 NpcAI::ENTITY_SMALL_LEECH /* NPC AI for entity type 810 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SMALL_LEECH(Entity_NPC *npc) { byte bVar1; uint uVar2; LayerState *layer; char *animName; int elapsedFrames; Vector *vecResult; ANM2 *sprite; float fVar3; float fVar4; float fVar5; float fVar6; EntityPtr EVar7; float hopDirX; undefined1 local_30 [12]; EntityPtr *local_24; Vector local_20; EntityPtr local_18; char isWaterRoom; Game *game; void *room; game = g_game; fVar4 = *(float *)((int)g_game->_room + 0x7240); isWaterRoom = 0.0 < fVar4; if (npc->_state != 6) { npc->_entityGridCollisionClass = (byte)isWaterRoom + 5; } if ((((g_manager->_optionsConfig)._enableWaterSurface == 0) || (fVar4 <= 0.0)) || ((npc->_posOffset).y <= -3.0)) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; LAB_0055b857: (layer->_color)._tint[3] = 1.0; } else { sprite = &npc->_sprite; uVar2 = Game::GetStageID(game,isWaterRoom); if (uVar2 == 0x1c) { layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_color)._tint[0] = 1.4; (layer->_color)._tint[1] = 1.4; (layer->_color)._tint[2] = 1.4; goto LAB_0055b857; } layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_color)._tint[0] = 5.0; (layer->_color)._tint[1] = 5.0; (layer->_color)._tint[2] = 5.0; (layer->_color)._tint[3] = 1.0; layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_color)._colorize[0] = 1.0; (layer->_color)._colorize[1] = 1.0; (layer->_color)._colorize[2] = 1.0; (layer->_color)._colorize[3] = 0.6; } sprite = &npc->_sprite; switch(npc->_state) { case 0: npc->_entityGridCollisionClass = 6; npc->_state = 3; (npc->_v1).x = 0.0; (npc->_v1).y = 0.0; ANM2::Play(sprite,(byte *)"SwimRight",0); return; case 3: if (isWaterRoom == '\0') { npc->_friction = npc->_friction * 0.7; if (npc->_controllerID == -1) { uVar2 = Random(); uVar2 = ~uVar2 & 1; } else { vecResult = Entity_NPC::GetControllerInput(npc,(Vector *)(local_30 + 8),0.1); bVar1 = Vector::operator_ne(vecResult,&g_vectorZero); uVar2 = (uint)bVar1; } if (uVar2 == 0) { return; } vecResult = Entity_NPC::CalcTargetPosition(npc,&local_20,0.0); local_30._8_4_ = vecResult->x - (npc->_pos).x; local_24 = (EntityPtr *)(vecResult->y - (npc->_pos).y); if (((float)local_30._8_4_ == g_vectorZero.x) && ((float)local_24 == g_vectorZero.y)) { vecResult = MusicManager::RandomVector(&local_20); local_24 = (EntityPtr *)vecResult->y; hopDirX = vecResult->x; } else { Vector::Normalize((Vector *)(local_30 + 8)); hopDirX = (float)local_30._8_4_; } local_20.y = (float)local_24; if (npc->_controllerID != -1) { local_24 = (EntityPtr *)hopDirX; vecResult = Entity_NPC::GetControllerInput(npc,&local_20,0.1); local_20.y = vecResult->y; hopDirX = (float)vecResult->x; } local_24 = (EntityPtr *)hopDirX; if (((float)local_24 == g_vectorZero.x) && (local_20.y == g_vectorZero.y)) { return; } if (npc->_controllerID == -1) { uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; fVar4 = fVar4 + fVar4 + 2.0; } else { fVar4 = 4.0; } fVar6 = npc->_friction; if (fVar6 != 0.0) { fVar3 = npc->_speedMultiplier; (npc->_velocity).y = (fVar3 * local_20.y * fVar4) / fVar6 + (npc->_velocity).y; (npc->_velocity).x = (fVar3 * (float)local_24 * fVar4) / fVar6 + (npc->_velocity).x; } if (ABS((float)local_24) <= ABS(local_20.y)) { if (local_20.y <= 0.0) { if (0.0 <= local_20.y) goto LAB_0055c43a; animName = "HopUp"; } else { animName = "HopDown"; } } else if ((float)local_24 <= 0.0) { if (0.0 <= (float)local_24) goto LAB_0055c43a; animName = "HopLeft"; } else { animName = "HopRight"; } bVar1 = ANM2::SetAnimation(sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0055c43a: npc->_state = 7; return; } if ((npc->_controllerID != -1) && (npc->_parent != (EntityPtr)0x0)) { local_24 = &npc->_parent; std::multiset::erase(&local_24); npc->_parent = (EntityPtr)0x0; } if (((npc->_v1).y == 0.0) && (npc->_parent != (EntityPtr)0x0)) { uVar2 = Random(); EVar7 = npc->_parent; (npc->_v1).y = *(float *)((int)EVar7 + 0x370) + 20.0 + (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 40.0; fVar4 = atan2f((npc->_pos).y - *(float *)((int)EVar7 + 0x340), (npc->_pos).x - *(float *)((int)EVar7 + 0x33c)); (npc->_v2).x = fVar4 * 57.295776; uVar2 = Random(); if ((uVar2 & 1) == 0) { local_24 = (EntityPtr *)0x3f800000; } else { local_24 = (EntityPtr *)&DAT_bf800000; } uVar2 = Random(); (npc->_v2).y = ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 + 4.0) * (float)local_24; } if ((0.0 < npc->_pendingDamage) && (uVar2 = Random(), (uVar2 & 1) == 0)) { uVar2 = Random(); Entity_NPC::PlaySound (npc,0xdd,0.8,10,0, (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.3); } local_20.y = *(float *)&npc->_parent; if ((EntityPtr)local_20.y == (EntityPtr)0x0) { EVar7 = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); LAB_0055be2a: local_24 = (EntityPtr *)(*(float *)((int)EVar7 + 0x340) - (npc->_pos).y); local_30._8_4_ = ((Vector *)((int)EVar7 + 0x33c))->x - (npc->_pos).x; Vector::Normalized((Vector *)(local_30 + 8),&local_20); bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar1 == 0) { local_18 = (EntityPtr)local_20.y; local_20.y = local_20.x; } else { local_30._4_4_ = 1; local_30._8_4_ = 9; elapsedFrames = (g_game->_frameCount - npc->_spawnFrame) * 0x3ff; local_30._0_4_ = ((int)(elapsedFrames + (elapsedFrames >> 0x1f & 3U)) >> 2) + npc->_initSeed ; local_24 = (EntityPtr *)0x1d; RNG::Next((RNG *)local_30); fVar4 = RNG::RandomFloat((RNG *)local_30); local_24 = (EntityPtr *)(fVar4 * 360.0 * 0.017453292); local_20.y = cos((float)local_24); local_18 = (EntityPtr)sin((float)local_24); } bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar1 != 0) { local_20.y = local_20.y * -1.0; local_18 = (EntityPtr)((float)local_18 * -1.0); } if (npc->_controllerID != -1) { vecResult = Entity_NPC::GetControllerInput(npc,(Vector *)(local_30 + 8),0.0); local_20.y = vecResult->x; local_18 = (EntityPtr)vecResult->y; } if (npc->_subtype == 1) { local_20.y = local_20.y * 0.75; local_18 = (EntityPtr)((float)local_18 * 0.75); } fVar4 = npc->_speedMultiplier; fVar3 = fVar4 * 0.016 + (npc->_v1).x; fVar6 = 0.35; if (fVar3 <= 0.35) { fVar6 = fVar3; } (npc->_v1).x = fVar6; (npc->_velocity).x = fVar6 * local_20.y * fVar4 + (npc->_velocity).x; (npc->_velocity).y = fVar6 * (float)local_18 * fVar4 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.96; if ((local_20.y != g_vectorZero.x) || ((float)local_18 != g_vectorZero.y)) { if (ABS(local_20.y) <= ABS((float)local_18)) { if ((float)local_18 <= 0.0) { if (0.0 <= (float)local_18) goto LAB_0055c07d; animName = "SwimUp"; } else { animName = "SwimDown"; } } else if (0.0 < local_20.y) { animName = "SwimRight"; } else { if (0.0 <= local_20.y) goto LAB_0055c07d; animName = "SwimLeft"; } ANM2::Play(sprite,(byte *)animName,0); } LAB_0055c07d: if (npc->_controllerID != -1) { fVar4 = sqrtf((float)local_18 * (float)local_18 + local_20.y * local_20.y); if (npc->_subtype == 1) { fVar4 = fVar4 / 0.75; } (npc->_sprite)._playbackSpeed = fVar4 * 0.5 + 0.5; } } else { local_24 = (EntityPtr *)normalize_angle_degrees((npc->_v2).y + (npc->_v2).x); (npc->_v2).x = (float)local_24; fVar4 = *(float *)((int)local_20.y + 0x340) - (npc->_pos).y; fVar6 = ((Vector *)((int)local_20.y + 0x33c))->x - (npc->_pos).x; fVar4 = sqrtf(fVar4 * fVar4 + fVar6 * fVar6); if ((npc->_v1).y + 30.0 < fVar4) { (npc->_v1).x = 0.5; EVar7 = (EntityPtr)local_20.y; goto LAB_0055be2a; } local_24 = (EntityPtr *)((float)local_24 * 0.017453292); fVar4 = cos((float)local_24); local_18 = (EntityPtr) ((fVar4 * (npc->_v1).y + ((Vector *)((int)local_20.y + 0x33c))->x) - (npc->_pos).x) ; fVar4 = sin((float)local_24); local_24 = (EntityPtr *) ((fVar4 * (npc->_v1).y + *(float *)((int)local_20.y + 0x340)) - (npc->_pos).y); fVar4 = sqrtf((float)local_24 * (float)local_24 + (float)local_18 * (float)local_18); EVar7 = local_18; if ((20.0 < fVar4) && (0.0 < fVar4)) { EVar7 = (EntityPtr)((float)local_18 * (20.0 / fVar4)); local_24 = (EntityPtr *)((float)local_24 * (20.0 / fVar4)); } fVar4 = npc->_speedMultiplier; fVar6 = 0.35000002; if (fVar4 != 1.0) { fVar6 = 0.35000002 / ((fVar4 + 0.35000002) - fVar4 * 0.35000002); } fVar4 = (npc->_velocity).x; fVar3 = (npc->_velocity).y; fVar5 = *(float *)((int)local_20.y + 0x364); (npc->_velocity).x = (((float)EVar7 + ((Vector *)((int)local_20.y + 0x360))->x) - fVar4) * (1.0 - fVar6) + fVar4; (npc->_velocity).y = (((float)local_24 + fVar5) - fVar3) * (1.0 - fVar6) + fVar3; npc->_friction = npc->_friction * 0.85; if ((npc->_v2).y <= 0.0) { fVar4 = -90.0; } else { fVar4 = 90.0; } local_24 = (EntityPtr *)((fVar4 + (npc->_v2).x) * 0.017453292); local_20.y = cos((float)local_24); fVar4 = sin((float)local_24); if (ABS(local_20.y) <= ABS(fVar4)) { if (fVar4 <= 0.0) { if (fVar4 < 0.0) { ANM2::Play(sprite,(byte *)"SwimUp",0); } } else { ANM2::Play(sprite,(byte *)"SwimDown",0); } } else if (0.0 < local_20.y) { ANM2::Play(sprite,(byte *)"SwimRight",0); } else if (local_20.y < 0.0) { ANM2::Play(sprite,(byte *)"SwimLeft",0); } } fVar4 = (npc->_velocity).x; room = g_game->_room; fVar3 = fVar4 * npc->_friction + (npc->_pos).x; fVar6 = npc->_friction * (npc->_velocity).y + (npc->_pos).y; if (((fVar4 < 0.0) && (fVar3 < *(float *)((int)room + 0x14) + 10.0)) || ((0.0 < fVar4 && (*(float *)((int)room + 0x1c) - 10.0 < fVar3)))) { (npc->_velocity).x = fVar4 * -0.6; } fVar4 = (npc->_velocity).y; if (((fVar4 < 0.0) && (fVar6 < *(float *)((int)room + 0x18) + 20.0)) || ((0.0 < fVar4 && (*(float *)((int)room + 0x20) - 4.0 < fVar6)))) { (npc->_velocity).y = fVar4 * -0.6; } local_24 = (EntityPtr *)(10.0 / npc->_friction); fVar4 = (npc->_velocity).x; local_20.y = (npc->_velocity).y; fVar4 = sqrtf(fVar4 * fVar4 + local_20.y * local_20.y); if (((float)local_24 < fVar4) && (0.0 < fVar4)) { (npc->_velocity).x = ((float)local_24 / fVar4) * (npc->_velocity).x; (npc->_velocity).y = local_20.y * ((float)local_24 / fVar4); return; } break; case 6: npc->_entityGridCollisionClass = 3; npc->_entityCollisionClass = 0; fVar4 = (npc->_v2).x; (npc->_velocity).x = fVar4; (npc->_velocity).y = (npc->_v2).y; fVar6 = npc->_speedMultiplier; fVar5 = fVar6 * 0.7 + (npc->_v1).x; (npc->_v1).x = fVar5; fVar3 = fVar5 * fVar6 + (npc->_posOffset).y; (npc->_posOffset).y = fVar3; if (fVar3 <= -fVar5 * fVar6) { animName = "SwimRight"; if (fVar4 < 0.0) { animName = "SwimLeft"; } ANM2::Play(sprite,(byte *)animName,0); return; } (npc->_posOffset).y = 0.0; (npc->_v1).x = 0.0; (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_entityGridCollisionClass = 6; npc->_entityCollisionClass = 4; npc->_state = 3; return; case 7: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land); if (bVar1 != 0) { npc->_friction = npc->_friction * 0.7; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { return; } } npc->_state = 3; } return; } //@@ 0055c4c0 Entity_NPC::ThrowLeech /* ZHL [exact] static cleanup Entity_NPC* Entity_NPC::ThrowLeech(Vector* pos, Entity* spanwer, float yPosOffset, Vector* targetPos, bool big); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity_NPC * __cdecl Entity_NPC::ThrowLeech (Vector *position,Entity *spawner,float yPositionOffset,Vector *targetPosition,byte isBig) { float fVar1; void *pvVar2; undefined4 uVar3; uint seed; Entity_NPC *pEVar4; int iVar5; int iVar6; int iVar7; float fVar8; float fVar9; float fVar10; pvVar2 = g_game->_room; seed = Random(); pEVar4 = (Entity_NPC *) Game::SpawnEx(g_game,0x32a,0,position,&g_vectorZero,spawner,(uint)isBig,seed,0); uVar3 = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar3; fVar8 = targetPosition->x; (pEVar4->_targetPosition).x = fVar8; fVar9 = targetPosition->y; (pEVar4->_targetPosition).y = fVar9; iVar6 = (int)((fVar8 - 40.0) / 40.0 + 0.5); iVar5 = (int)((fVar9 - 120.0) / 40.0 + 0.5); if ((((-1 < iVar6) && (iVar6 < *(int *)((int)pvVar2 + 0xc))) && (-1 < iVar5)) && (((iVar5 < *(int *)((int)pvVar2 + 0x10) && (iVar6 = *(int *)((int)pvVar2 + 0xc) * iVar5 + iVar6, -1 < iVar6)) && (iVar6 < 0x1c0)))) { iVar5 = *(int *)((int)pvVar2 + iVar6 * 4 + 0x76c); iVar7 = iVar5 % 1000; if (iVar7 < 900) { *(int *)((int)pvVar2 + iVar6 * 4 + 0x76c) = (iVar5 - iVar7) + 900; } } (pEVar4->_v1).x = -8.0; (pEVar4->_v1).y = 0.0; fVar8 = (pEVar4->_targetPosition).x; fVar9 = (pEVar4->_targetPosition).y; fVar10 = (pEVar4->_pos).x; fVar1 = (pEVar4->_pos).y; pEVar4->_state = 6; (pEVar4->_posOffset).y = yPositionOffset; fVar10 = (fVar8 - fVar10) * 0.04; fVar8 = (fVar9 - fVar1) * 0.04; (pEVar4->_v2).x = fVar10; (pEVar4->_velocity).x = fVar10; (pEVar4->_v2).y = fVar8; (pEVar4->_velocity).y = fVar8; if (isBig != 0) { fVar8 = pEVar4->_maxHitPoints + pEVar4->_maxHitPoints; fVar9 = g_vectorOne.y * 1.25; (pEVar4->_sprite)._scale.x = g_vectorOne.x * 1.25; pEVar4->_maxHitPoints = fVar8; (pEVar4->_sprite)._scale.y = fVar9; pEVar4->_health = fVar8; } return pEVar4; } //@@ 0055c6a0 FUN_0055c6a0 undefined4 FUN_0055c6a0(float *param_1) { int in_ECX; float fVar1; fVar1 = *(float *)(in_ECX + 0xbb0); if (360.0 < ABS(fVar1)) { fVar1 = fmodf(fVar1,360.0); } if (fVar1 <= 180.0) { if (fVar1 < -180.0) { fVar1 = fVar1 + 360.0; } } else { fVar1 = fVar1 - 360.0; } if ((-135.0 <= fVar1) && (fVar1 < -45.0)) { *param_1 = fVar1 + 90.0; return 1; } if ((-45.0 <= fVar1) && (fVar1 < 45.0)) { *param_1 = fVar1; return 2; } if ((45.0 <= fVar1) && (fVar1 < 135.0)) { *param_1 = fVar1 - 90.0; return 3; } fVar1 = fVar1 - 180.0; if (360.0 < ABS(fVar1)) { fVar1 = fmodf(fVar1,360.0); } if (180.0 < fVar1) { *param_1 = fVar1 - 360.0; return 0; } if (fVar1 < -180.0) { fVar1 = fVar1 + 360.0; } *param_1 = fVar1; return 0; } //@@ 0055c810 NpcAI::ENTITY_STRIDER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 814 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_STRIDER(Entity_NPC *npc) { byte *cstr; byte bVar1; int dirIndex; std_string *str; Entity *target; Vector *pVVar2; void *pvVar3; uint uVar4; float fVar5; float fVar6; Vector local_44; Vector local_3c; float local_34; char isSameAnim; void *currentAnim [5]; uint currentAnimCapacity; void *local_14; local_14 = (void *)(__security_cookie ^ (uint)(currentAnim + 7)); local_44.y = 0.0; switch(npc->_state) { case 0: npc->_entityGridCollisionClass = 6; (npc->_posOffset).y = -8.0; (npc->_v1).x = 90.0; break; default: goto switchD_0055c84d_caseD_1; case 3: dirIndex = FUN_0055c6a0(&local_44.y); ANM2::Play(&npc->_sprite,(&PTR_s_IdleLeft_00b61560)[dirIndex],0); (npc->_sprite)._rotation = local_44.y; if (npc->_controllerID == -1) { uVar4 = Random(); if ((uVar4 & 3) != 0) goto switchD_0055c84d_caseD_1; target = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::HasEntityFlags((Entity *)npc,0x200); if (bVar1 == 0) { uVar4 = Random(); if ((uVar4 & 1) == 0) { local_3c.y = (target->_pos).y; local_3c.x = (target->_pos).x; bVar1 = Room::CheckLine(g_game->_room,&npc->_pos,&local_3c,3,0,0,0,(Vector *)0x0); if (bVar1 != 0) { (npc->_v2).x = g_vectorZero.x; (npc->_v2).y = g_vectorZero.y; npc->_state = 4; goto switchD_0055c84d_caseD_1; } } uVar4 = Random(); if (uVar4 % 3 != 0) goto switchD_0055c84d_caseD_1; } pVVar2 = MusicManager::RandomVector(&local_3c); } else { pVVar2 = Entity_NPC::GetControllerInput(npc,&local_3c,0.1); if ((pVVar2->x == g_vectorZero.x) && (pVVar2->y == g_vectorZero.y)) goto switchD_0055c84d_caseD_1; pVVar2 = Entity_NPC::GetControllerInput(npc,&local_3c,0.1); } (npc->_v2).x = pVVar2->x; (npc->_v2).y = pVVar2->y; npc->_state = 4; goto switchD_0055c84d_caseD_1; case 4: local_34 = (float)FUN_0055c6a0(&local_3c.y); pvVar3 = (npc->_sprite)._animState._animData; if ((pvVar3 == (void *)0x0) || (*(char *)((int)pvVar3 + 0x34) == '\0')) { cstr = (&PTR_s_WalkLeft_00b60b00)[(int)local_34]; str = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)currentAnim); local_44.y = 1.4013e-45; bVar1 = str_eq_cstr(str,cstr); if (bVar1 == 0) goto LAB_0055caf8; isSameAnim = '\x01'; LAB_0055cb02: if (0xf < currentAnimCapacity) { uVar4 = currentAnimCapacity + 1; pvVar3 = currentAnim[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)currentAnim[0] + -4); uVar4 = currentAnimCapacity + 0x24; if (0x1f < (uint)((int)currentAnim[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } } else { LAB_0055caf8: isSameAnim = '\0'; if (((uint)local_44.y & 1) != 0) goto LAB_0055cb02; } if (isSameAnim == '\0') { ANM2::Play(&npc->_sprite,(&PTR_s_WalkLeft_00b60b00)[(int)local_34],0); } else { ANM2::SetAnimation(&npc->_sprite,(&PTR_s_WalkLeft_00b60b00)[(int)local_34],0); } (npc->_sprite)._rotation = local_3c.y; if (npc->_controllerID != -1) { Entity_NPC::GetControllerInput(npc,&local_3c,0.1); if ((local_3c.x == g_vectorZero.x) && (local_3c.y == g_vectorZero.y)) { fVar5 = npc->_speedMultiplier; fVar6 = 0.97; if (fVar5 != 1.0) { fVar6 = 0.97 / ((fVar5 + 0.97) - fVar5 * 0.97); } (npc->_v2).y = fVar6 * (npc->_v2).y; (npc->_v2).x = fVar6 * (npc->_v2).x; } else { (npc->_v2).x = local_3c.x; (npc->_v2).y = local_3c.y; } } local_34 = (npc->_v2).x; local_44.y = (npc->_v2).y; if ((local_34 == g_vectorZero.x) && (local_44.y == g_vectorZero.y)) { target = Entity_NPC::GetPlayerTarget(npc); local_3c.x = (target->_pos).x - (npc->_pos).x; local_3c.y = (target->_pos).y - (npc->_pos).y; pVVar2 = Vector::Normalized(&local_3c,&local_44); local_34 = pVVar2->x; local_44.y = pVVar2->y; bVar1 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar1 != 0) { local_34 = local_34 * -1.0; local_44.y = local_44.y * -1.0; } } if (((npc->_flags & 0x200) != 0) && (npc->_controllerID == -1)) { local_34 = local_34 * 0.5; local_44.y = local_44.y * 0.5; } local_3c.y = (npc->_v1).x; fVar6 = atan2f(local_44.y,local_34); fVar5 = (npc->_v1).x; fVar6 = fVar6 * 57.295776 - fVar5; if (360.0 < ABS(fVar6)) { fVar6 = fmodf(fVar6,360.0); fVar5 = local_3c.y; } if (fVar6 <= 180.0) { if (fVar6 < -180.0) { fVar6 = fVar6 + 360.0; } } else { fVar6 = fVar6 - 360.0; } fVar5 = fVar6 * 0.2 + fVar5; if (360.0 < ABS(fVar5)) { fVar5 = fmodf(fVar5,360.0); } if (fVar5 <= 180.0) { if (fVar5 < -180.0) { fVar5 = fVar5 + 360.0; } } else { fVar5 = fVar5 - 360.0; } (npc->_v1).x = fVar5; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b616e4); if (bVar1 != 0) { if (npc->_controllerID == -1) { uVar4 = Random(); fVar5 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 6.0; } else { fVar5 = 9.0; } fVar6 = npc->_speedMultiplier; (npc->_velocity).x = local_34 * fVar5 * fVar6 + (npc->_velocity).x; (npc->_velocity).y = local_44.y * fVar5 * fVar6 + (npc->_velocity).y; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto switchD_0055c84d_caseD_1; } break; case 6: npc->_entityGridCollisionClass = 3; npc->_entityCollisionClass = 0; (npc->_velocity).x = (npc->_v2).x; (npc->_velocity).y = (npc->_v2).y; fVar5 = npc->_speedMultiplier * 0.7 + (npc->_v1).x; fVar6 = npc->_speedMultiplier * fVar5; (npc->_v1).x = fVar5; fVar5 = fVar6 + (npc->_posOffset).y; (npc->_posOffset).y = fVar5; if (fVar5 + fVar6 <= -8.0) { ANM2::Play(&npc->_sprite,(byte *)"IdleDown",0); goto switchD_0055c84d_caseD_1; } (npc->_v1).x = 90.0; (npc->_posOffset).y = -8.0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; npc->_entityGridCollisionClass = 6; npc->_entityCollisionClass = 4; } npc->_state = 3; switchD_0055c84d_caseD_1: npc->_friction = npc->_friction * 0.95; return; } //@@ 0055cef0 Entity_NPC::ThrowStrider /* ZHL [exact] static cleanup Entity_NPC* Entity_NPC::ThrowStrider(Vector* pos, Entity* spanwer, Vector* targetPos); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ Entity_NPC * __cdecl Entity_NPC::ThrowStrider(Vector *pos,Entity *spanwer,Vector *targetPos) { float fVar1; float fVar2; undefined4 uVar3; void *pvVar4; Game *pGVar5; uint seed; Entity_NPC *pEVar6; int iVar7; int iVar8; float fVar9; float fVar10; seed = Random(); pEVar6 = (Entity_NPC *)Game::SpawnEx(g_game,0x32e,0,pos,&g_vectorZero,spanwer,0,seed,0); pGVar5 = g_game; uVar3 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar3; fVar9 = targetPos->x; (pEVar6->_targetPosition).x = fVar9; fVar1 = targetPos->y; (pEVar6->_targetPosition).y = fVar1; pvVar4 = pGVar5->_room; iVar8 = (int)((fVar9 - 40.0) / 40.0 + 0.5); if ((((-1 < iVar8) && (iVar8 < *(int *)((int)pvVar4 + 0xc))) && (iVar7 = (int)((fVar1 - 120.0) / 40.0 + 0.5), -1 < iVar7)) && (((iVar7 < *(int *)((int)pvVar4 + 0x10) && (iVar8 = *(int *)((int)pvVar4 + 0xc) * iVar7 + iVar8, -1 < iVar8)) && (iVar8 < 0x1c0)))) { iVar7 = *(int *)((int)pvVar4 + iVar8 * 4 + 0x76c); if (iVar7 < 0x385) { *(undefined4 *)((int)pvVar4 + iVar8 * 4 + 0x76c) = 900; } else if (iVar7 - 3000U < 0x385) { *(undefined4 *)((int)pvVar4 + iVar8 * 4 + 0x76c) = 0xf3c; } } (pEVar6->_posOffset).y = -8.0; (pEVar6->_v1).x = -8.0; fVar9 = (pEVar6->_targetPosition).x; fVar1 = (pEVar6->_targetPosition).y; fVar10 = (pEVar6->_pos).x; fVar2 = (pEVar6->_pos).y; pEVar6->_state = 6; pEVar6->_entityGridCollisionClass = 3; fVar10 = (fVar9 - fVar10) * 0.04; pEVar6->_entityCollisionClass = 0; fVar9 = (fVar1 - fVar2) * 0.04; (pEVar6->_v2).x = fVar10; (pEVar6->_velocity).x = fVar10; (pEVar6->_v2).y = fVar9; (pEVar6->_velocity).y = fVar9; return pEVar6; } //@@ 0055d070 NpcHelper::polty_target_set /* DB: NpcAI::ENTITY_POLTY: grid index param_1 unless gridPaths(+0xe6c) > 0 there -> npc I2 (+0xbc4), returns 1; notes/entities/pass7_i3.md */ undefined4 NpcHelper::polty_target_set(int param_1) { int in_ECX; if ((-1 < param_1) && (param_1 < 0x1c0)) { if (0 < *(short *)((int)g_game->_room + param_1 * 2 + 0xe6c)) { return 0; } } *(int *)(in_ECX + 0xbc4) = param_1; return 1; } //@@ 0055d0b0 NpcHelper::polty_is_target_liftable /* DB: NpcAI::ENTITY_POLTY: spawner a pickup (type 5) or Room::CanPickupGridEntity(I2); variant 0 snaps pos to the cell, zero velocity; notes/entities/pass7_i3.md */ uint NpcHelper::polty_is_target_liftable(void) { Room *this; int iVar1; byte bVar2; undefined3 extraout_var; uint uVar3; int in_ECX; int extraout_EDX; float fVar4; uVar3 = *(uint *)(in_ECX + 0x3c8); if ((uVar3 == 0) || (*(int *)(uVar3 + 0x28) != 5)) { if (*(int *)(in_ECX + 0xbc4) < 0) { LAB_0055d16d: return uVar3 & 0xffffff00; } this = g_game->_room; bVar2 = Room::CanPickupGridEntity(this,*(int *)(in_ECX + 0xbc4)); uVar3 = CONCAT31(extraout_var,bVar2); if (bVar2 == 0) goto LAB_0055d16d; if (*(int *)(in_ECX + 0x2c) == 1) goto LAB_0055d104; iVar1 = this->_gridWidth; uVar3 = extraout_EDX / iVar1; fVar4 = (float)(int)uVar3 * 40.0 + 120.0; *(float *)(in_ECX + 0x33c) = (float)(extraout_EDX % iVar1) * 40.0 + 40.0; } else { fVar4 = *(float *)(uVar3 + 0x340); *(undefined4 *)(in_ECX + 0x33c) = *(undefined4 *)(uVar3 + 0x33c); } *(float *)(in_ECX + 0x340) = fVar4; *(float *)(in_ECX + 0x360) = g_vectorZero.x; *(float *)(in_ECX + 0x364) = g_vectorZero.y; LAB_0055d104: return CONCAT31((int3)(uVar3 >> 8),1); } //@@ 0055d180 NpcHelper::polty_is_pot_cell /* DB: NpcAI::ENTITY_POLTY init: grid type 6 or 0x1a with state 1 (an urn/pot) and polty_target_set -> pos on the cell; notes/entities/pass7_i3.md */ uint NpcHelper::polty_is_pot_cell(uint param_1) { int iVar1; Game *pGVar2; uint in_EAX; int iVar3; int in_ECX; pGVar2 = g_game; if (param_1 < 0x1c0) { in_EAX = *(uint *)((int)g_game->_room + param_1 * 4 + 0x24); if ((in_EAX != 0) && (((*(int *)(in_EAX + 4) == 6 || (*(int *)(in_EAX + 4) == 0x1a)) && (*(int *)(in_EAX + 0xc) == 1)))) { in_EAX = polty_target_set(param_1); if ((char)in_EAX != '\0') { iVar1 = *(int *)((int)pGVar2->_room + 0xc); iVar3 = (int)param_1 / iVar1; *(float *)(in_ECX + 0x33c) = (float)((int)param_1 % iVar1) * 40.0 + 40.0; *(float *)(in_ECX + 0x340) = (float)iVar3 * 40.0 + 120.0; return CONCAT31((int3)((uint)iVar3 >> 8),1); } } } return in_EAX & 0xffffff00; } //@@ 0055d230 NpcAI::ENTITY_POLTY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 816 (from dispatcher 006c2990) */ EntityPtr __fastcall NpcAI::ENTITY_POLTY(Entity_NPC *npc) { EntityPtr *pEVar1; ushort uVar2; code *pcVar3; ANM2 other; byte bVar4; char cVar5; float *damageEvent; EntityPtr extraout_EAX; Entity_Player *nearestPlayer; void *pvVar6; byte *pbVar7; byte *pbVar8; EntityPtr extraout_EAX_00; ColorMod *color; Entity_Effect *liftedEntity; Entity *pEVar9; Vector *pVVar10; uint uVar11; EntityPtr EVar12; EntityPtr extraout_EAX_01; EntityPtr EVar13; byte *pbVar14; int iVar15; char *pcVar16; int iVar17; int extraout_EDX; int extraout_EDX_00; uint uVar18; Room *roomPtr; int iVar19; bool bVar20; float fVar21; undefined1 auVar22 [12]; float fVar23; void **ppvVar24; ANM2 aAStackY_8d28 [128]; undefined1 in_stack_fffffdec [240]; float fVar25; Vector *pVVar26; float fVar27; undefined4 uVar28; undefined1 auStack_f4 [4]; Vector local_f0; Room *room; EntityPtr heldEntity; float local_e0; char isFriendly; void **local_d8; Vector local_d4; float fStack_cc; int state; Vector local_c4; Vector local_bc; float fStack_b4; int variant; float fStack_ac; float fStack_a8; Vector local_a4; void *gridEntity; float bestScore; float targetX; undefined4 auStack_90 [8]; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; EntityRef EStack_64; undefined4 uStack_3c; Color splatColor; uint local_c; local_c = __security_cookie ^ (uint)auStack_f4; roomPtr = g_game->_room; EVar12 = npc->_entityRef; isFriendly = (npc->_flags & 0x20000000) != 0; variant = npc->_variant; local_e0 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if ((((uint)damageEvent[2] & 4) != 0) && ((damageEvent[4] != 1.4013e-45 && (damageEvent[6] != 1.4013e-45)))) { fVar21 = npc->_pendingDamage - *damageEvent; if (fVar21 <= 0.0) { fVar21 = 0.0; } npc->_pendingDamage = fVar21; *damageEvent = 0.0; damageEvent[2] = 0.0; damageEvent[3] = 0.0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } room = roomPtr; heldEntity = EVar12; if ((variant == 1) && ((npc->_entityDeque)._size == 0)) { local_c4.x = 0.0; std::deque::resize(); } state = npc->_state; switch(state) { case 0: npc->_state = 3; uStack_70 = 0x3f4ccccd; uStack_6c = 0x3f4ccccd; uStack_68 = 0x3f4ccccd; if (&npc->_splatColor != (ColorMod *)auStack_90) { (npc->_splatColor)._offset[0] = 0.8; (npc->_splatColor)._offset[1] = 0.8; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.3; (npc->_splatColor)._offset[2] = 0.8; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } EVar12 = npc->_spawnerEntity; npc->_stateFrame = 0; npc->_i1 = 0; if (EVar12 != (EntityPtr)0x0) { if (*(int *)((int)EVar12 + 0x28) == 5) { EVar12 = *(EntityPtr *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(EntityPtr *)((int)&npc->_flags + 4) = EVar12; npc->_state = 8; return EVar12; } return EVar12; } if (*(char *)roomPtr == '\0') { return (EntityPtr)0x0; } EVar12 = (EntityPtr)(g_game->_frameCount - roomPtr->_enterFrame); if (EVar12 != (EntityPtr)0x0) { return EVar12; } if (variant == 1) { uVar28 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar28; npc->_state = 2; npc->_visible = 0; uVar11 = Random(); npc->_entityCollisionClass = 0; npc->_stateFrame = uVar11 % 0x1e + 0x1e; ANM2::SetFrame(&npc->_sprite,(std_string *)"SpecialAppear",0); return extraout_EAX; } iVar17 = Room::GetGridIndex(roomPtr,&npc->_pos); iVar15 = iVar17 / roomPtr->_gridWidth; iVar17 = iVar17 % roomPtr->_gridWidth; if (iVar15 < room->_gridHeight + -1) { Room::GetGridIndexByTile(room,iVar17,iVar15 + 1); cVar5 = NpcHelper::polty_is_pot_cell(); if (cVar5 != '\0') goto LAB_0055d567; } if (0 < iVar15) { Room::GetGridIndexByTile(room,iVar17,iVar15 + -1); cVar5 = NpcHelper::polty_is_pot_cell(); if (cVar5 != '\0') goto LAB_0055d567; } if (0 < iVar17) { Room::GetGridIndexByTile(room,iVar17 + -1,iVar15); cVar5 = NpcHelper::polty_is_pot_cell(); if (cVar5 != '\0') goto LAB_0055d567; } EVar12 = (EntityPtr)(room->_gridWidth + -1); if (iVar17 < (int)EVar12) { Room::GetGridIndexByTile(room,iVar17 + 1,iVar15); EVar12 = (EntityPtr)NpcHelper::polty_is_pot_cell(); if (EVar12._0_1_ != '\0') goto LAB_0055d567; } iVar15 = 0; iVar17 = room->_gridHeight * room->_gridWidth; if (iVar17 < 1) { return EVar12; } while (EVar12 = (EntityPtr)NpcHelper::polty_is_pot_cell(), EVar12._0_1_ == '\0') { iVar15 = iVar15 + 1; if (iVar17 <= iVar15) { return EVar12; } } LAB_0055d567: uVar28 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar28; npc->_state = 0x10; npc->_visible = 0; uVar11 = Random(); npc->_entityCollisionClass = 0; npc->_stateFrame = uVar11 % 0x1e + 0x1e; return (EntityPtr)(uVar11 / 0x1e); case 1: case 5: case 6: case 7: case 0xb: case 0xc: case 0xe: case 0xf: if (state == 0x10) goto LAB_0055f8e3; default: heldEntity = EVar12; if (state == 2) goto LAB_0055f8e3; break; case 2: if ((npc->_controllerID != -1) && ((pVVar10 = Entity_NPC::GetControllerInput(npc,&local_f0,0.1), pVVar10->x != g_vectorZero.x || (pVVar10->y != g_vectorZero.y)))) { npc->_stateFrame = 0; } if (npc->_stateFrame < 1) { nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos); fVar21 = (npc->_pos).y - (nearestPlayer->_pos).y; fVar23 = (npc->_pos).x - (nearestPlayer->_pos).x; if (80.0 < fVar21 * fVar21 + fVar23 * fVar23) { if (npc->_visible == 0) { npc->_visible = 1; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"SpecialAppear",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"PickupThrow"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0xa2,1.0,2,0,1.0); } pvVar6 = Sprite::GetNullFrame((Sprite *)&npc->_sprite,(byte *)"OverlayEffect"); if ((pvVar6 != (void *)0x0) && (*(char *)((int)pvVar6 + 0xc) != '\0')) { npc->_entityCollisionClass = 4; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_entityCollisionClass = 4; npc->_state = 3; } } } else { npc->_stateFrame = npc->_stateFrame - (int)local_e0; } goto LAB_0055f8e3; case 3: pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0055d898: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pbVar14 = s_Idle; do { bVar4 = *pbVar7; bVar20 = bVar4 < *pbVar14; if (bVar4 != *pbVar14) { LAB_0055d882: uVar11 = -(uint)bVar20 | 1; goto LAB_0055d887; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < pbVar14[1]; if (bVar4 != pbVar14[1]) goto LAB_0055d882; pbVar7 = pbVar7 + 2; pbVar14 = pbVar14 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055d887: if ((uVar11 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0055d898; } roomPtr = room; iVar17 = npc->_i2; if (-1 < iVar17) { bVar4 = Room::CanPickupGridEntity(room,iVar17); iVar17 = extraout_EDX; if (bVar4 == 0) { npc->_i2 = -1; iVar17 = -1; } } iVar15 = variant; if (npc->_controllerID == -1) { if (((iVar17 == -1) && (bVar4 = Entity::IsFrame((Entity *)npc,10,0), bVar4 != 0)) && (bVar4 = Entity::HasEntityFlags((Entity *)npc,0x1000800), bVar4 == 0)) { bestScore = 1e+10; local_e0 = -NAN; pEVar9 = Entity_NPC::GetPlayerTarget(npc); fStack_ac = 0.0; fVar21 = (pEVar9->_pos).x; EVar12 = (EntityPtr)(pEVar9->_pos).y; local_f0.x = (float)(roomPtr->_gridHeight * roomPtr->_gridWidth); local_a4.x = (float)EVar12; targetX = fVar21; if (0 < (int)local_f0.x) { local_d8 = roomPtr->_gridEntities; local_c4.x = (float)&roomPtr->field_0xe6c; do { fVar23 = fStack_ac; if (((0x1bf < (uint)fStack_ac) || (*(short *)local_c4.x == 0)) && (bVar4 = Room::CanPickupGridEntity(roomPtr,(int)fStack_ac), bVar4 != 0)) { iVar17 = roomPtr->_gridWidth; fStack_cc = (float)((int)fVar23 % iVar17) * 40.0 + 40.0; fStack_b4 = (float)((int)fVar23 / iVar17) * 40.0 + 120.0; if ((uint)fVar23 < 0x1c0) { gridEntity = *local_d8; } else { gridEntity = (void *)0x0; } fVar25 = (npc->_pos).x; fVar27 = (npc->_pos).y; if (variant == 1) { fStack_cc = fStack_cc - fVar21; fStack_b4 = fStack_b4 - (float)EVar12; fStack_ac = fVar21 - fVar25; fStack_a8 = (float)EVar12 - fVar27; fVar21 = sqrtf(fStack_ac * fStack_ac + fStack_a8 * fStack_a8); if (fVar21 <= 0.0) { fVar21 = fStack_a8; } else { fStack_ac = fStack_ac * (1.0 / fVar21); fVar21 = fStack_a8 * (1.0 / fVar21); } EVar12 = (EntityPtr)0x447a0000; fVar21 = fVar21 * fStack_b4 + fStack_ac * fStack_cc; roomPtr = room; if (fVar21 <= 0.1) { fVar21 = 0.1; } } else { fVar27 = fVar27 - fStack_b4; fVar25 = fVar25 - fStack_cc; local_d4.x = sqrtf(fVar27 * fVar27 + fVar25 * fVar25); iVar19 = (int)(((fStack_b4 + 0.0) - 120.0) / 40.0 + 0.5); iVar15 = (int)(((fStack_cc - 40.0) - 40.0) / 40.0 + 0.5); if (((iVar15 < 0) || (iVar17 <= iVar15)) || ((iVar19 < 0 || (room->_gridHeight <= iVar19)))) { iVar15 = -1; } else { iVar15 = iVar19 * iVar17 + iVar15; } local_bc.x = (float)Room::GetGridCollision(room,iVar15); iVar15 = (int)(((fStack_cc + 40.0) - 40.0) / 40.0 + 0.5); if ((((iVar15 < 0) || (iVar17 <= iVar15)) || (iVar19 < 0)) || (room->_gridHeight <= iVar19)) { iVar15 = -1; } else { iVar15 = iVar19 * iVar17 + iVar15; } fStack_a8 = (float)Room::GetGridCollision(room,iVar15); iVar19 = (int)(((fStack_cc + 0.0) - 40.0) / 40.0 + 0.5); iVar15 = (int)(((fStack_b4 - 40.0) - 120.0) / 40.0 + 0.5); if (((iVar19 < 0) || (iVar17 <= iVar19)) || ((iVar15 < 0 || (room->_gridHeight <= iVar15)))) { fStack_cc = (float)Room::GetGridCollision(room,-1); if ((-1 < iVar19) && (iVar19 < iVar17)) goto LAB_0055dd01; LAB_0055dd15: iVar19 = -1; } else { fStack_cc = (float)Room::GetGridCollision(room,iVar15 * iVar17 + iVar19); LAB_0055dd01: iVar15 = (int)(((fStack_b4 + 40.0) - 120.0) / 40.0 + 0.5); if ((iVar15 < 0) || (room->_gridHeight <= iVar15)) goto LAB_0055dd15; iVar19 = iVar15 * iVar17 + iVar19; } roomPtr = room; uVar11 = Room::GetGridCollision(room,iVar19); fVar21 = (float)(int)(uVar11 + (int)fStack_cc + (int)fStack_a8 + (int)local_bc.x) / 12.0 + 1.0; fVar23 = fStack_ac; EVar12 = (EntityPtr)local_d4.x; } fVar21 = (float)EVar12 / fVar21; iVar17 = *(int *)((int)gridEntity + 4); if ((iVar17 == 6) || (iVar17 == 0x1a)) { fVar21 = fVar21 * 0.2; } else if ((iVar17 == 5) || (iVar17 == 0xc)) { fVar21 = fVar21 * 0.4; } else if (iVar17 == 0xe) { fVar21 = fVar21 * 0.7; } else if ((iVar17 == 4) || (iVar17 == 0x16)) { fVar21 = fVar21 * 3.0; } if ((int)local_e0 < 0) { LAB_0055ddb8: local_e0 = fVar23; bestScore = fVar21; } else if (fVar21 < bestScore) goto LAB_0055ddb8; fVar21 = targetX; EVar12 = (EntityPtr)local_a4.x; } fStack_ac = (float)((int)fVar23 + 1); local_c4.x = (float)((int)local_c4.x + 2); local_d8 = local_d8 + 1; } while ((int)fStack_ac < (int)local_f0.x); if (-1 < (int)local_e0) { NpcHelper::polty_target_set(); } } if ((npc->_i2 < 0) && (isFriendly == '\0')) { npc->_i1 = npc->_i1 + 1; if (5 < npc->_i1) { npc->_i2 = -2; npc->_entityGridCollisionClass = 0; } } else { npc->_i1 = 0; } } if (((npc->_flags & 0x1000a00) != 0) && (uVar11 = Random(), uVar11 % 6 == 0)) { npc->_i2 = -1; } } else { if (variant == 1) { Entity_NPC::SpawnControlTarget(npc,0,-1.0); } bVar4 = Entity_NPC::IsControllerActionPressed(npc,9); if (bVar4 != 0) { if (iVar15 == 1) { pVVar10 = Entity_NPC::GetAimTargetPosition(npc,&local_f0); } else { local_f0.x = (npc->_pos).x; local_f0.y = (npc->_pos).y; pVVar10 = &local_f0; } iVar17 = Room::GetGridIndex(roomPtr,pVVar10); bVar4 = Room::CanPickupGridEntity(roomPtr,iVar17); if (bVar4 != 0) { npc->_i2 = extraout_EDX_00; } } } iVar17 = npc->_i2; if (-1 < iVar17) { if (variant == 1) { uVar11 = Random(); if (uVar11 % 10 == 0) { local_f0.y = (npc->_pos).y; local_f0.x = (npc->_pos).x; bVar4 = Camera::IsPosVisible(*(Camera **)((int)g_game->_room + 0x11f8),&local_f0); if (bVar4 != 0) { npc->_state = 0xd; ANM2::Play(&npc->_sprite,(byte *)"TeleStart",0); npc->_stateFrame = 0; EVar12 = heldEntity; goto LAB_0055f03c; } } } else if ((npc->_controllerID != -1) || ((fVar21 = (npc->_velocity).y, fVar23 = (npc->_velocity).x, fVar21 = sqrtf(fVar23 * fVar23 + fVar21 * fVar21), fVar21 < 1.0 && (iVar15 = *(int *)((int)g_game->_room + 0xc), fVar21 = ((float)(iVar17 % iVar15) * 40.0 + 40.0) - (npc->_pos).x, fVar23 = ((float)(iVar17 / iVar15) * 40.0 + 120.0) - (npc->_pos).y, fVar23 * fVar23 + fVar21 * fVar21 < 64.0)))) { npc->_state = 9; EVar12 = heldEntity; goto LAB_0055f03c; } } LAB_0055f01e: EVar12 = heldEntity; goto LAB_0055f03c; case 4: pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0055e010: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"PickupIdle",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar16 = "PickupIdle"; do { bVar4 = *pbVar8; bVar20 = bVar4 < (byte)*pcVar16; if (bVar4 != *pcVar16) { LAB_0055dff8: uVar11 = -(uint)bVar20 | 1; goto LAB_0055dffd; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar20 = bVar4 < (byte)pcVar16[1]; if (bVar4 != pcVar16[1]) goto LAB_0055dff8; pbVar8 = pbVar8 + 2; pcVar16 = pcVar16 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055dffd: if ((uVar11 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0055e010; } if (EVar12 == (EntityPtr)0x0) { npc->_state = 3; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pbVar14 = s_Idle; do { bVar4 = *pbVar7; bVar20 = bVar4 < *pbVar14; if (bVar4 != *pbVar14) { LAB_0055e080: uVar11 = -(uint)bVar20 | 1; goto LAB_0055e085; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < pbVar14[1]; if (bVar4 != pbVar14[1]) goto LAB_0055e080; pbVar7 = pbVar7 + 2; pbVar14 = pbVar14 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055e085: if ((uVar11 == 0) && ((EVar12 = (EntityPtr)0x0, pbVar8[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0055e0b1; } EVar12._0_1_ = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); EVar12._1_3_ = 0; if (EVar12._0_1_ != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; EVar12 = extraout_EAX_00; } goto LAB_0055e0b1; } break; case 8: pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0055e12e: pcVar16 = "PickupFirst"; goto LAB_0055e135; } pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pcVar16 = "PickupFirst"; do { bVar4 = *pbVar7; bVar20 = bVar4 < (byte)*pcVar16; if (bVar4 != *pcVar16) { LAB_0055e110: uVar11 = -(uint)bVar20 | 1; goto LAB_0055e115; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < (byte)pcVar16[1]; if (bVar4 != pcVar16[1]) goto LAB_0055e110; pbVar7 = pbVar7 + 2; pcVar16 = pcVar16 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055e115: if ((uVar11 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0055e12e; break; case 9: pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pcVar16 = "Pickup"; do { bVar4 = *pbVar7; bVar20 = bVar4 < (byte)*pcVar16; if (bVar4 != *pcVar16) { LAB_0055e190: uVar11 = -(uint)bVar20 | 1; goto LAB_0055e195; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < (byte)pcVar16[1]; if (bVar4 != pcVar16[1]) goto LAB_0055e190; pbVar7 = pbVar7 + 2; pcVar16 = pcVar16 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055e195: if ((uVar11 == 0) && ((pbVar8[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) break; } pcVar16 = "Pickup"; LAB_0055e135: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar16,1); if (bVar4 == 0) goto LAB_0055f01e; AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; break; case 10: pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0055e20e: bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Throw",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pcVar16 = "Throw"; do { bVar4 = *pbVar7; bVar20 = bVar4 < (byte)*pcVar16; if (bVar4 != *pcVar16) { LAB_0055e1f0: uVar11 = -(uint)bVar20 | 1; goto LAB_0055e1f5; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < (byte)pcVar16[1]; if (bVar4 != pcVar16[1]) goto LAB_0055e1f0; pbVar7 = pbVar7 + 2; pcVar16 = pcVar16 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055e1f5: if ((uVar11 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0055e20e; } if (npc->_controllerID == -1) { (npc->_controllerMovement).x = g_vectorZero.x; fVar21 = g_vectorZero.y; LAB_0055e291: (npc->_controllerMovement).y = fVar21; } else { Entity_NPC::GetControllerMovementInput(npc,&local_f0,0.1); if ((local_f0.x != g_vectorZero.x) || (local_f0.y != g_vectorZero.y)) { (npc->_controllerMovement).x = local_f0.x; fVar21 = local_f0.y; goto LAB_0055e291; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"PickupThrow"); if ((bVar4 != 0) && (EVar12 != (EntityPtr)0x0)) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_f0.x = ((pEVar9->_velocity).x * 4.0 + (pEVar9->_pos).x + (npc->_velocity).x * 4.0) - (npc->_pos).x; local_f0.y = ((pEVar9->_velocity).y * 4.0 + (pEVar9->_pos).y + (npc->_velocity).y * 4.0) - (npc->_pos).y; pVVar10 = Vector::Normalized(&local_f0,&local_d4); iVar17 = *(int *)((int)EVar12 + 0x28); fVar21 = (npc->_velocity).x; if (iVar17 == 5) { fVar23 = (npc->_velocity).y; local_c4.y = fVar23 * 0.2; fVar25 = fVar21 * 0.2; } else { fVar23 = (npc->_velocity).y; local_c4.y = fVar23; fVar25 = fVar21; } local_c4.x = fVar25 + pVVar10->x * 10.0; local_c4.y = local_c4.y + pVVar10->y * 10.0; if (npc->_controllerID != -1) { local_c4.x = (npc->_controllerMovement).x * 10.0 + fVar21; local_c4.y = (npc->_controllerMovement).y * 10.0 + fVar23; } if ((iVar17 == 1000) && (*(int *)((int)EVar12 + 0x2c) == 0x88)) { NpcHelper::Polty_SpawnRockProjectile(); iVar15 = *(int *)EVar12; LAB_0055e41c: (**(code **)(iVar15 + 0x28))(); } else { iVar15 = *(int *)EVar12; if (iVar17 != 5) goto LAB_0055e41c; local_f0.x = *(float *)(iVar15 + 0x54); EStack_64._position.x = (npc->_pos).x; EStack_64._position.y = (npc->_pos).y; EStack_64._type = npc->_type; EStack_64._variant = npc->_variant; EStack_64._spawnerType = npc->_spawnerType; EStack_64._spawnerVariant = npc->_spawnerVariant; EStack_64._velocity.x = (npc->_velocity).x; EStack_64._velocity.y = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { uVar11 = 0; } else { uVar11 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar18 = 0; } else { uVar18 = 4; } EStack_64._flags = uVar18 | uVar11 | (uint)((npc->_flags & 0x100) != 0); EStack_64._entity = npc; (*(code *)local_f0.x)(); if (*(EntityPtr *)((int)EVar12 + 0x3bc) != (EntityPtr)0x0) { local_f0.x = (float)((int)EVar12 + 0x3bc); std::multiset::erase(); } pEVar1 = &npc->_entityRef; *(int *)((int)EVar12 + 0x3bc) = 0; if (*pEVar1 != (EntityPtr)0x0) { local_f0.x = (float)pEVar1; std::multiset::erase(); } *pEVar1 = (EntityPtr)0x0; } heldEntity = (EntityPtr)0x0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0055f01e; } npc->_state = 3; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0055e5e7: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pbVar14 = s_Idle; do { bVar4 = *pbVar7; bVar20 = bVar4 < *pbVar14; if (bVar4 != *pbVar14) { LAB_0055e5d1: uVar11 = -(uint)bVar20 | 1; goto LAB_0055e5d6; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < pbVar14[1]; if (bVar4 != pbVar14[1]) goto LAB_0055e5d1; pbVar7 = pbVar7 + 2; pbVar14 = pbVar14 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055e5d6: if ((uVar11 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0055e5e7; } npc->_entityCollisionClass = 4; npc->_visible = 1; EVar12 = heldEntity; goto LAB_0055f03c; case 0xd: EVar12 = npc->_child; pEVar1 = &npc->_child; if (EVar12 != (EntityPtr)0x0) { if ((*(int *)((int)EVar12 + 0x28) != 9) || (*(int *)((int)EVar12 + 0x2c) != 8)) { local_f0.x = (float)pEVar1; std::multiset::erase(); *pEVar1 = (EntityPtr)0x0; goto LAB_0055e65d; } LAB_0055e84f: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pcVar16 = "TeleLoop"; do { bVar4 = *pbVar7; bVar20 = bVar4 < (byte)*pcVar16; if (bVar4 != *pcVar16) { LAB_0055e894: uVar11 = -(uint)bVar20 | 1; goto LAB_0055e899; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < (byte)pcVar16[1]; if (bVar4 != pcVar16[1]) goto LAB_0055e894; pbVar7 = pbVar7 + 2; pcVar16 = pcVar16 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055e899: if ((uVar11 == 0) && ((pbVar8[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0055e8d0; } bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"TeleLoop",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_0055e8d0: if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"PickupThrow") , bVar4 == 0)) { iVar17 = npc->_stateFrame; if (0 < iVar17) goto LAB_0055e906; } else { npc->_stateFrame = 1; iVar17 = 1; LAB_0055e906: roomPtr = room; EVar12 = *pEVar1; npc->_friction = npc->_friction * 0.6; if (EVar12 == (EntityPtr)0x0) { iVar15 = room->_gridWidth; npc->_stateFrame = (int)local_e0 + iVar17; local_f0.x = (float)(npc->_i2 % iVar15) * 40.0 + 40.0; local_d4.x = (float)(npc->_i2 / iVar15) * 40.0 + 120.0; if (6 < (int)local_e0 + iVar17) { local_bc.x = local_f0.x - (npc->_pos).x; local_bc.y = local_d4.x - (npc->_pos).y; Vector::Resized(&local_bc,&local_c4,1.0); liftedEntity = Room::PickupGridEntity(roomPtr,npc->_i2); local_bc.x = (float)NpcHelper::Polty_SpawnRockProjectile(); *(float *)((int)local_bc.x + 0x33c) = local_f0.x; *(float *)((int)local_bc.x + 0x340) = local_d4.x; *(int *)((int)local_bc.x + 0x418) = -0x4099999a; *(int *)((int)local_bc.x + 0x414) = 0; *(int *)((int)local_bc.x + 0x410) = -0x3f000000; (**(code **)(*(int *)liftedEntity + 0x28))(); fVar21 = local_bc.x; *(uint *)((int)local_bc.x + 0x438) = *(uint *)((int)local_bc.x + 0x438) | 0x2000; *(int *)((int)local_bc.x + 0x43c) = *(int *)((int)local_bc.x + 0x43c); if (*pEVar1 != (EntityPtr)0x0) { local_f0.x = (float)pEVar1; std::multiset::erase(); } *pEVar1 = (EntityPtr)fVar21; std::multiset::insert(); uVar11 = (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar11 & 3) * 4) != 0) { uVar11 = (npc->_entityDeque)._offset; local_d4.x = (float)(*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar11 & 3) * 4) + 0x3c4); if (*(EntityPtr *)local_d4.x != (EntityPtr)0x0) { local_f0.x = local_d4.x; std::multiset::erase(); } *(float *)local_d4.x = fVar21; std::multiset::insert(); } } } else { local_f0.x = (npc->_pos).x - *(float *)((int)EVar12 + 0x33c); local_f0.y = (npc->_pos).y - *(float *)((int)EVar12 + 0x340); fVar21 = sqrtf(*(float *)((int)EVar12 + 0x360) * *(float *)((int)EVar12 + 0x360) + *(float *)((int)EVar12 + 0x364) * *(float *)((int)EVar12 + 0x364)); auVar22 = ZEXT812(0x41b00000); fVar21 = fVar21 * 1.1 + 0.6; if (fVar21 <= auVar22._0_4_) { auVar22._4_8_ = auVar22._4_8_; auVar22._0_4_ = fVar21; } pVVar10 = Vector::Resized(&local_f0,&local_d4,auVar22._0_4_); *(float *)((int)EVar12 + 0x360) = pVVar10->x; *(float *)((int)EVar12 + 0x364) = pVVar10->y; EVar12 = *pEVar1; if ((EVar12 != (EntityPtr)0x0) && (*(int *)((int)EVar12 + 0x28) == 9)) { *(float *)((int)EVar12 + 0x414) = (-20.0 - *(float *)((int)EVar12 + 0x410)) * 0.2; EVar12 = *pEVar1; } bVar4 = Entity::IsFrame((Entity *)npc,4,0); if (bVar4 != 0) { EStack_64._type = 0x3f4ccccd; EStack_64._variant = 0x3f4ccccd; EStack_64._spawnerType = 0x3f4ccccd; EStack_64._spawnerVariant = 0x3f800000; EStack_64._flags = 0x3e4ccccd; EStack_64._entity = (Entity_NPC *)0x0; uStack_3c = 0x3ecccccd; EStack_64._position.x = 0.0; EStack_64._position.y = 0.0; EStack_64._velocity.x = 0.0; EStack_64._velocity.y = 0.0; (**(code **)(*(int *)EVar12 + 0x3c))(); EVar12 = *pEVar1; } fVar21 = (npc->_pos).x - *(float *)((int)EVar12 + 0x33c); fVar23 = (npc->_pos).y - *(float *)((int)EVar12 + 0x340); if (fVar23 * fVar23 + fVar21 * fVar21 < 3600.0) { Color::Color(&splatColor); Sprite::SetColor((Sprite *)((int)EVar12 + 0x48),color); uVar11 = Random(); iVar17 = 0; uVar28._0_1_ = 0; uVar28._1_1_ = 0; uVar28._2_2_ = 0; fVar27 = 0.0; pVVar26 = &g_vectorZero; pVVar10 = &npc->_pos; fVar25 = 1.90577e-43; fVar23 = 1.4013e-42; fVar21 = 7.890242e-39; EVar12 = (EntityPtr) Game::SpawnEx(g_game,1000,0x88,pVVar10,&g_vectorZero,(Entity *)0x0,0,uVar11,0); heldEntity = EVar12; ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x214),(ANM2 *)((int)*pEVar1 + 0x48)); other._championColor._colorize[3] = fVar21; other._filename._buf[0] = in_stack_fffffdec[0]; other._filename._buf[1] = in_stack_fffffdec[1]; other._filename._buf[2] = in_stack_fffffdec[2]; other._filename._buf[3] = in_stack_fffffdec[3]; other._filename._buf[4] = in_stack_fffffdec[4]; other._filename._buf[5] = in_stack_fffffdec[5]; other._filename._buf[6] = in_stack_fffffdec[6]; other._filename._buf[7] = in_stack_fffffdec[7]; other._filename._buf[8] = in_stack_fffffdec[8]; other._filename._buf[9] = in_stack_fffffdec[9]; other._filename._buf[10] = in_stack_fffffdec[10]; other._filename._buf[0xb] = in_stack_fffffdec[0xb]; other._filename._buf[0xc] = in_stack_fffffdec[0xc]; other._filename._buf[0xd] = in_stack_fffffdec[0xd]; other._filename._buf[0xe] = in_stack_fffffdec[0xe]; other._filename._buf[0xf] = in_stack_fffffdec[0xf]; other._filename._size = in_stack_fffffdec._16_4_; other._filename._capacity = in_stack_fffffdec._20_4_; other._animDefaultName._buf[0] = in_stack_fffffdec[0x18]; other._animDefaultName._buf[1] = in_stack_fffffdec[0x19]; other._animDefaultName._buf[2] = in_stack_fffffdec[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffdec[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffdec[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffdec[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffdec[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffdec[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffdec[0x20]; other._animDefaultName._buf[9] = in_stack_fffffdec[0x21]; other._animDefaultName._buf[10] = in_stack_fffffdec[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffdec[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffdec[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffdec[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffdec[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffdec[0x27]; other._animDefaultName._size = in_stack_fffffdec._40_4_; other._animDefaultName._capacity = in_stack_fffffdec._44_4_; other._animState._animation = (void *)in_stack_fffffdec._48_4_; other._animState._animData = (void *)in_stack_fffffdec._52_4_; other._animState._layerFrames = (void *)in_stack_fffffdec._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffdec._60_4_; other._animState._animFrame = (float)in_stack_fffffdec._64_4_; other._animState._isPlaying = in_stack_fffffdec[0x44]; other._animState._21_3_ = in_stack_fffffdec._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffdec._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffdec._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffdec._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffdec._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffdec._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffdec._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffdec._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffdec[100]; other._overlayAnimState._21_3_ = in_stack_fffffdec._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffdec._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffdec._108_4_; other._overlayRenderFirst = in_stack_fffffdec[0x70]; other._113_3_ = in_stack_fffffdec._113_3_; other._animData = (void *)in_stack_fffffdec._116_4_; other._animCount = in_stack_fffffdec._120_4_; other._layerState = (void *)in_stack_fffffdec._124_4_; other._layerCount = in_stack_fffffdec._128_4_; other._nullLayerNames = (void *)in_stack_fffffdec._132_4_; other._numNullLayers = in_stack_fffffdec._136_4_; other._eventNames = (void *)in_stack_fffffdec._140_4_; other._numEvents = in_stack_fffffdec._144_4_; other._offset.x = (float)in_stack_fffffdec._148_4_; other._offset.y = (float)in_stack_fffffdec._152_4_; other._scale.x = (float)in_stack_fffffdec._156_4_; other._scale.y = (float)in_stack_fffffdec._160_4_; other._rotation = (float)in_stack_fffffdec._164_4_; other._color._tint[0] = (float)in_stack_fffffdec._168_4_; other._color._tint[1] = (float)in_stack_fffffdec._172_4_; other._color._tint[2] = (float)in_stack_fffffdec._176_4_; other._color._tint[3] = (float)in_stack_fffffdec._180_4_; other._color._colorize[0] = (float)in_stack_fffffdec._184_4_; other._color._colorize[1] = (float)in_stack_fffffdec._188_4_; other._color._colorize[2] = (float)in_stack_fffffdec._192_4_; other._color._colorize[3] = (float)in_stack_fffffdec._196_4_; other._color._offset[0] = (float)in_stack_fffffdec._200_4_; other._color._offset[1] = (float)in_stack_fffffdec._204_4_; other._color._offset[2] = (float)in_stack_fffffdec._208_4_; other._championColor._tint[0] = (float)in_stack_fffffdec._212_4_; other._championColor._tint[1] = (float)in_stack_fffffdec._216_4_; other._championColor._tint[2] = (float)in_stack_fffffdec._220_4_; other._championColor._tint[3] = (float)in_stack_fffffdec._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffdec._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffdec._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffdec._236_4_; other._championColor._offset[0] = fVar23; other._championColor._offset[1] = fVar25; other._championColor._offset[2] = (float)pVVar10; other._256_4_ = pVVar26; other._playbackSpeed = fVar27; other._264_1_ = (char)uVar28; other._loaded = SUB41(uVar28,1); other._266_2_ = SUB42(uVar28,2); other._shadowLayerIndex = uVar11; other._bitflags = iVar17; ANM2::operator_assign((ANM2 *)((int)EVar12 + 0x48),other); uVar2 = *(ushort *)((int)*pEVar1 + 0x32); *(uint *)&((BitSet128 *)((int)EVar12 + 0x420))->_l = (uint)uVar2; *(uint *)((int)EVar12 + 0x424) = (uint)*(ushort *)((int)*pEVar1 + 0x30); *(int *)((int)EVar12 + 0x430) = *(int *)((int)*pEVar1 + 0x3ec); *(undefined4 *)((int)EVar12 + 0x428) = 0; if ((float)(uint)uVar2 == 1.96182e-44) { *(int *)((int)EVar12 + 0x428) = (int)*(float *)((int)*pEVar1 + 0x380); } ((Vector *)((int)EVar12 + 0x33c))->x = (npc->_pos).x; *(float *)((int)EVar12 + 0x340) = (npc->_pos).y; if (*(EntityPtr *)((int)EVar12 + 0x3bc) != (EntityPtr)0x0) { local_f0.x = (float)((int)EVar12 + 0x3bc); std::multiset::erase(); } *(Entity_NPC **)((int)EVar12 + 0x3bc) = npc; std::multiset::insert(); if (npc->_entityRef != (EntityPtr)0x0) { local_f0.x = (float)&npc->_entityRef; std::multiset::erase(); } npc->_entityRef = EVar12; std::multiset::insert(); uVar11 = (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar11 >> 2) * 4) + (uVar11 & 3) * 4) != 0) { uVar11 = (npc->_entityDeque)._offset; (**(code **)(**(int **)(*(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar11 & 3) * 4) + 0x28))(); uVar11 = (npc->_entityDeque)._offset; uVar18 = uVar11 & 3; iVar17 = *(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); local_d4.x = (float)(iVar17 + uVar18 * 4); if (*(int *)(iVar17 + uVar18 * 4) != 0) { local_f0.x = local_d4.x; std::multiset::erase(); } *(EntityPtr *)local_d4.x = (EntityPtr)0x0; } fVar21 = npc->_speedMultiplier; fVar23 = *(float *)((int)*pEVar1 + 0x364); (npc->_velocity).x = *(float *)((int)*pEVar1 + 0x360) * 0.5 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = fVar23 * 0.5 * fVar21 + (npc->_velocity).y; (**(code **)(*(int *)*pEVar1 + 0x28))(); if (*pEVar1 != (EntityPtr)0x0) { local_f0.x = (float)pEVar1; std::multiset::erase(); } *pEVar1 = (EntityPtr)0x0; ANM2::Play(&npc->_sprite,(byte *)"Pickup",0); npc->_state = 9; goto LAB_0055f03c; } } uVar11 = (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar11 & 3) * 4) == 0) { EVar12 = *pEVar1; if (EVar12 == (EntityPtr)0x0) { local_f0.x = (float)(npc->_i2 % room->_gridWidth) * 40.0 + 40.0; local_f0.y = (float)(npc->_i2 / room->_gridWidth) * 40.0 + 120.0; } else { local_f0.x = *(float *)((int)EVar12 + 0x33c); local_f0.y = *(float *)((int)EVar12 + 0x340); } local_c4.x = local_f0.x; local_c4.y = local_f0.y; uVar11 = Random(); EVar12 = (EntityPtr) Game::SpawnEx(g_game,1000,0xaf,&local_c4,&g_vectorZero,(Entity *)npc,0,uVar11,0); if (EVar12 != (EntityPtr)0x0) { local_d4.x = *(float *)pEVar1; EVar13 = (EntityPtr)((int)EVar12 + 0x3c4); if (*(EntityPtr *)EVar13 != (EntityPtr)0x0) { local_f0.x = (float)EVar13; std::multiset::erase(); } *(float *)EVar13 = local_d4.x; if ((EntityPtr)local_d4.x != (EntityPtr)0x0) { std::multiset::insert(); } } if (*(int *)((int)EVar12 + 0x3bc) != 0) { local_f0.x = (float)((int)EVar12 + 0x3bc); std::multiset::erase(); } *(Entity_NPC **)((int)EVar12 + 0x3bc) = npc; std::multiset::insert(); (**(code **)(*(int *)EVar12 + 0xc))(); uVar11 = (npc->_entityDeque)._offset; uVar18 = uVar11 & 3; iVar17 = *(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); EVar13 = (EntityPtr)(iVar17 + uVar18 * 4); if (*(int *)(iVar17 + uVar18 * 4) != 0) { local_f0.x = (float)EVar13; std::multiset::erase(); } *(EntityPtr *)EVar13 = EVar12; std::multiset::insert(); } } goto LAB_0055f01e; } LAB_0055e65d: EVar12 = npc->_spawnerEntity; if ((EVar12 != (EntityPtr)0x0) && (*(int *)((int)EVar12 + 0x28) == 5)) { fVar21 = *(float *)((int)EVar12 + 0x340); (npc->_pos).x = *(float *)((int)EVar12 + 0x33c); (npc->_pos).y = fVar21; LAB_0055e82f: (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; goto LAB_0055e84f; } uVar11 = npc->_i2; if ((-1 < (int)uVar11) && (uVar11 < 0x1c0)) { iVar17 = *(int *)((int)g_game->_room + uVar11 * 4 + 0x24); if ((iVar17 != 0) && (*(int *)(iVar17 + 0x3c) != 0)) { iVar15 = *(int *)(iVar17 + 4); if (((((iVar15 == 2) || (iVar15 == 4)) || (iVar15 == 5)) || ((iVar15 == 6 || (iVar15 == 0x1a)))) || ((iVar15 == 0x16 || (iVar15 == 0x1b)))) { LAB_0055e7e9: if (npc->_variant == 1) goto LAB_0055e84f; iVar17 = *(int *)((int)g_game->_room + 0xc); (npc->_pos).x = (float)((int)uVar11 % iVar17) * 40.0 + 40.0; (npc->_pos).y = (float)((int)uVar11 / iVar17) * 40.0 + 120.0; goto LAB_0055e82f; } if (iVar15 == 0xc) { if (*(uint *)(iVar17 + 0xc) < 4) goto LAB_0055e7e9; } else if ((iVar15 == 0xe) && (*(int *)(iVar17 + 0xc) != 1000)) goto LAB_0055e7e9; } } uVar11 = (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar11 & 3) * 4) != 0) { (**(code **)(**(int **)(*(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar11 & 3) * 4) + 0x28))(); uVar11 = (npc->_entityDeque)._offset; uVar18 = uVar11 & 3; iVar17 = *(int *)((int)(npc->_entityDeque)._map + (uVar11 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); EVar12 = (EntityPtr)(iVar17 + uVar18 * 4); if (*(int *)(iVar17 + uVar18 * 4) != 0) { local_f0.x = (float)EVar12; std::multiset::erase(); } *(int *)EVar12 = 0; } npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); npc->_entityCollisionClass = 4; npc->_visible = 1; EVar12 = heldEntity; goto LAB_0055f03c; case 0x10: cVar5 = NpcHelper::polty_is_target_liftable(); if (cVar5 != '\0') { if (npc->_controllerID != -1) { pVVar10 = Entity_NPC::GetControllerInput(npc,&local_f0,0.1); bVar4 = Vector::operator_ne(pVVar10,&g_vectorZero); if (bVar4 != 0) { npc->_stateFrame = 0; } } if (npc->_stateFrame < 1) { npc->_visible = 1; ANM2::Play(&npc->_sprite,(byte *)"PotAppear",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 8; npc->_entityCollisionClass = 4; } } else { npc->_stateFrame = npc->_stateFrame - (int)local_e0; } goto LAB_0055f8e3; } npc->_state = 3; pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_0055d786: bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } pbVar14 = s_Idle; do { bVar4 = *pbVar7; bVar20 = bVar4 < *pbVar14; if (bVar4 != *pbVar14) { LAB_0055d768: uVar11 = -(uint)bVar20 | 1; goto LAB_0055d76d; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar20 = bVar4 < pbVar14[1]; if (bVar4 != pbVar14[1]) goto LAB_0055d768; pbVar7 = pbVar7 + 2; pbVar14 = pbVar14 + 2; } while (bVar4 != 0); uVar11 = 0; LAB_0055d76d: if ((uVar11 != 0) || ((pbVar8[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0055d786; } npc->_entityCollisionClass = 4; npc->_visible = 1; goto LAB_0055f8e3; } LAB_0055f03c: iVar17 = npc->_i2; if (iVar17 == -2) { if (npc->_controllerID == -1) { Entity_NPC::CalcTargetPosition(npc,&local_f0,0.0); local_d8 = (void **)((npc->_pos).y - local_f0.y); local_e0 = (npc->_pos).x - local_f0.x; fVar21 = sqrtf((float)local_d8 * (float)local_d8 + local_e0 * local_e0); if (fVar21 <= 0.7) { fVar21 = local_e0; ppvVar24 = local_d8; } else { fVar23 = local_e0; ppvVar24 = local_d8; if (0.0 < fVar21) { ppvVar24 = (void **)((float)local_d8 * (1.0 / fVar21)); fVar23 = local_e0 * (1.0 / fVar21); } fVar21 = fVar23 * 0.7; ppvVar24 = (void **)((float)ppvVar24 * 0.7); } fVar23 = npc->_speedMultiplier; (npc->_velocity).y = fVar23 * (float)ppvVar24 + (npc->_velocity).y; (npc->_velocity).x = fVar23 * fVar21 + (npc->_velocity).x; npc->_friction = npc->_friction * 0.95; bVar4 = Room::IsPositionInRoom(room,&npc->_pos,-400.0); if (bVar4 == 0) { if (EVar12 != (EntityPtr)0x0) { (**(code **)(*(int *)EVar12 + 0x28))(); heldEntity = (EntityPtr)0x0; } (**(code **)(*(int *)npc + 0x28))(); } goto LAB_0055f16e; } LAB_0055f50e: pVVar10 = Entity_NPC::GetControllerInput(npc,&local_bc,0.0); iVar17 = state; fVar21 = npc->_speedMultiplier; fVar23 = pVVar10->y; (npc->_velocity).x = pVVar10->x * 0.7 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = fVar23 * 0.7 * fVar21 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.95; if ((state != 10) && (EVar12 != (EntityPtr)0x0)) { bVar4 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar4 != 0) { Entity_NPC::UpdateControllerMovement(npc,1); npc->_state = 10; } } } else if (iVar17 < 0) { if (npc->_controllerID != -1) goto LAB_0055f50e; Entity_NPC::CalcTargetPosition(npc,&local_d4,0.0); iVar17 = state; local_d8 = (void **)(local_d4.x - (npc->_pos).x); local_e0 = local_d4.y - (npc->_pos).y; if ((((state != 10) && (EVar12 != (EntityPtr)0x0)) && (uVar11 = Random(), (uVar11 & 3) == 0)) && (fVar23 = local_d4.x - ((npc->_velocity).x * 4.0 + (npc->_pos).x), fVar21 = local_d4.y - ((npc->_velocity).y * 4.0 + (npc->_pos).y), fVar21 = sqrtf(fVar21 * fVar21 + fVar23 * fVar23), fVar21 <= 150.0)) { npc->_state = 10; } fVar23 = sqrtf((float)local_d8 * (float)local_d8 + local_e0 * local_e0); ppvVar24 = local_d8; fVar21 = local_e0; if (0.0 < fVar23) { ppvVar24 = (void **)((float)local_d8 * (1.0 / fVar23)); fVar21 = local_e0 * (1.0 / fVar23); } local_f0.x = (local_d4.x - (float)ppvVar24 * 100.0) - (npc->_pos).x; local_d4.x = (local_d4.y - fVar21 * 100.0) - (npc->_pos).y; local_bc.x = local_f0.x; local_bc.y = local_d4.x; fVar21 = sqrtf(local_f0.x * local_f0.x + local_d4.x * local_d4.x); if (fVar21 <= 0.7) { EVar13 = (EntityPtr)local_d4.x; EVar12 = (EntityPtr)local_f0.x; } else { Vector::Normalize(&local_bc); EVar13 = (EntityPtr)(local_bc.y * 0.7); EVar12 = (EntityPtr)(local_bc.x * 0.7); } fVar21 = npc->_speedMultiplier; (npc->_velocity).x = (float)EVar12 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = (float)EVar13 * fVar21 + (npc->_velocity).y; LAB_0055f4e4: npc->_friction = npc->_friction * 0.95; } else { if (npc->_state != 0xd) { if (npc->_controllerID == -1) { if (variant == 1) { pEVar9 = Entity_NPC::GetPlayerTarget(npc); Room::GetGridPosition(room,&local_f0,npc->_i2); local_d4.x = (pEVar9->_pos).x - local_f0.x; local_d4.y = (pEVar9->_pos).y - local_f0.y; pVVar10 = Vector::Resized(&local_d4,&local_bc,120.0); local_f0.x = (pEVar9->_pos).x + pVVar10->x; local_f0.y = (pEVar9->_pos).y + pVVar10->y; pVVar10 = Room::GetClampedPosition(room,&local_d4,&local_f0,0.0); } else { pVVar10 = Room::GetGridPosition(room,&local_f0,iVar17); } local_d4.x = pVVar10->y - (npc->_pos).y; local_bc.x = pVVar10->x - (npc->_pos).x; local_a4.x = local_bc.x; local_a4.y = local_d4.x; local_f0.x = sqrtf(local_d4.x * local_d4.x + local_bc.x * local_bc.x); if (local_f0.x <= 0.7) { EVar13 = (EntityPtr)local_bc.x; EVar12 = (EntityPtr)local_d4.x; } else { Vector::Normalize(&local_a4); EVar13 = (EntityPtr)(local_a4.x * 0.7); EVar12 = (EntityPtr)(local_a4.y * 0.7); } fVar21 = npc->_speedMultiplier; iVar17 = state; if (40.0 <= local_f0.x) { (npc->_velocity).y = fVar21 * (float)EVar12 + (npc->_velocity).y; (npc->_velocity).x = fVar21 * (float)EVar13 + (npc->_velocity).x; goto LAB_0055f4e4; } (npc->_velocity).x = ((float)EVar13 + (float)EVar13) * fVar21 + (npc->_velocity).x; (npc->_velocity).y = ((float)EVar12 + (float)EVar12) * fVar21 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.7; goto LAB_0055f172; } pVVar10 = Entity_NPC::GetControllerInput(npc,&local_bc,0.0); fVar21 = npc->_speedMultiplier; fVar23 = pVVar10->y; (npc->_velocity).x = pVVar10->x * 0.7 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = fVar23 * 0.7 * fVar21 + (npc->_velocity).y; npc->_friction = npc->_friction * 0.95; } LAB_0055f16e: iVar17 = state; } LAB_0055f172: EVar12 = heldEntity; (npc->_sprite)._flipX = 0.0 < (npc->_velocity).x; if ((iVar17 != 8) && (iVar17 != 9)) goto LAB_0055f8e3; if ((heldEntity == (EntityPtr)0x0) && (cVar5 = NpcHelper::polty_is_target_liftable(), cVar5 == '\0')) { LAB_0055f7df: npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); EVar12 = extraout_EAX_01; LAB_0055e0b1: npc->_entityCollisionClass = 4; npc->_visible = 1; return EVar12; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"PickupThrow"); if (bVar4 != 0) { EVar13 = npc->_spawnerEntity; pEVar1 = &npc->_spawnerEntity; if ((EVar13 == (EntityPtr)0x0) || (*(int *)((int)EVar13 + 0x28) != 5)) { if (EVar12 != (EntityPtr)0x0) { (**(code **)(*(int *)EVar12 + 0x28))(); } EVar12 = (EntityPtr)Room::PickupGridEntity(room,npc->_i2); if (EVar12 == (EntityPtr)0x0) { KAGE_LogMessage(4,(byte *)"polty lost target rock (failed to pick up)\n"); goto LAB_0055f7df; } EVar13 = (EntityPtr)((int)EVar12 + 0x3bc); ((Vector *)((int)EVar12 + 0x33c))->x = (npc->_pos).x; *(float *)((int)EVar12 + 0x340) = (npc->_pos).y; if (*(int *)EVar13 != 0) { local_f0.x = (float)EVar13; std::multiset::erase(); } *(Entity_NPC **)EVar13 = npc; std::multiset::insert(); if (npc->_entityRef != (EntityPtr)0x0) { local_f0.x = (float)&npc->_entityRef; std::multiset::erase(); } npc->_entityRef = EVar12; std::multiset::insert(); } else { *(undefined4 *)((int)EVar13 + 0x188) = 0; EVar13 = *pEVar1; *(float *)((int)EVar13 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar13 + 0x340) = (npc->_pos).y; Entity::SetParent((Entity *)*pEVar1,(Entity *)npc); *(undefined1 *)((int)*pEVar1 + 0x171) = 0; local_d4.x = *(float *)pEVar1; if (npc->_entityRef != (EntityPtr)0x0) { local_f0.x = (float)&npc->_entityRef; std::multiset::erase(); } npc->_entityRef = (EntityPtr)local_d4.x; if ((EntityPtr)local_d4.x != (EntityPtr)0x0) { std::multiset::insert(); } if (*pEVar1 != (EntityPtr)0x0) { local_f0.x = (float)pEVar1; std::multiset::erase(); } *pEVar1 = (EntityPtr)0x0; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_0055f8e3; } npc->_state = 4; npc->_entityCollisionClass = 4; if ((((EVar12 == (EntityPtr)0x0) || (*(int *)((int)EVar12 + 0x28) != 1000)) || (((fVar21 = *(float *)&((BitSet128 *)((int)EVar12 + 0x420))->_l, fVar21 != 5.60519e-45 && (fVar21 != 3.08286e-44)) || (isFriendly != '\0')))) || (npc->_controllerID != -1)) { npc->_i2 = -1; } else { npc->_i2 = -2; npc->_entityGridCollisionClass = 0; } LAB_0055f8e3: EVar13 = (EntityPtr)npc->_i2; if ((-1 < (int)EVar13) && ((uint)EVar13 < 0x1c0)) { *(undefined2 *)((int)room->_gridPaths + (int)EVar13 * 2 + 0x700) = 2; } if (npc->_dead != 0) { EVar13 = (EntityPtr)npc->_state; if (((EVar13 == (EntityPtr)0x8) || (EVar13 == (EntityPtr)0x10)) && ((uVar11 = npc->_i2, -1 < (int)uVar11 && (uVar11 < 0x1c0)))) { local_f0.x = *(float *)((int)g_game->_room + uVar11 * 4 + 0x24); EVar13 = (EntityPtr)0x0; if ((EntityPtr)local_f0.x != (EntityPtr)0x0) { pcVar3 = *(code **)((int)*(EntityPtr *)local_f0.x + 0x14); EntityRef::constructor(&EStack_64,(Entity *)npc); EVar13 = (EntityPtr)(*pcVar3)(); } } if (EVar12 != (EntityPtr)0x0) { if (*(int *)((int)EVar12 + 0x28) == 5) { local_f0.x = (npc->_velocity).x * 0.7; local_f0.y = (npc->_velocity).y * 0.7; pcVar3 = *(code **)(*(int *)EVar12 + 0x54); EntityRef::constructor(&EStack_64,(Entity *)npc); EVar13 = (EntityPtr)(*pcVar3)(); if (*(EntityPtr *)((int)EVar12 + 0x3bc) != (EntityPtr)0x0) { local_f0.x = (float)((int)EVar12 + 0x3bc); EVar13 = (EntityPtr)std::multiset::erase(); } *(EntityPtr *)((int)EVar12 + 0x3bc) = (EntityPtr)0x0; pEVar1 = &npc->_entityRef; if (*pEVar1 != (EntityPtr)0x0) { local_f0.x = (float)pEVar1; EVar13 = (EntityPtr)std::multiset::erase(); } *pEVar1 = (EntityPtr)0x0; } else { if (*(int *)((int)EVar12 + 0x28) == 1000) { local_f0.x = (npc->_velocity).x * 0.7; local_f0.y = (npc->_velocity).y * 0.7; NpcHelper::Polty_SpawnRockProjectile(); } EVar13 = (EntityPtr)(**(code **)(*(int *)EVar12 + 0x28))(); } } if (variant == 1) { uVar11 = (npc->_entityDeque)._offset; EVar13 = *(EntityPtr *) ((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar11 >> 2) * 4); if (*(int *)((int)EVar13 + (uVar11 & 3) * 4) != 0) { EVar13 = (EntityPtr) (**(code **)(**(int **)(*(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar11 >> 2) * 4) + (uVar11 & 3) * 4) + 0x28))(); } EVar12 = npc->_child; if ((EVar12 != (EntityPtr)0x0) && (*(int *)((int)EVar12 + 0x28) == 9)) { EVar13 = *(EntityPtr *)((int)EVar12 + 0x43c); *(uint *)((int)EVar12 + 0x438) = *(uint *)((int)EVar12 + 0x438) & 0xffffdfff; *(undefined4 *)((int)EVar12 + 0x418) = 0x3f4ccccd; *(EntityPtr *)((int)EVar12 + 0x43c) = EVar13; } } } return EVar13; } //@@ 0055fb60 NpcAI::ENTITY_SUB_HORF /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 812 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SUB_HORF(Entity_NPC *npc) { byte isSplatFrame; uint rngResult; Vector *pVVar1; int iVar2; int fireInterval; float fVar3; float fVar4; float accelX; double dVar5; Vector local_e4; float facingX; float local_d8; Vector scratchVec; float local_cc; char isWaterStage; float local_c4; ProjectileParams projParams; float local_14; void *damageEventsEnd; float speedMultiplier; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); local_d8 = ((npc->_v1).x + 90.0) * 0.017453292; facingX = cos(local_d8); local_d8 = sin(local_d8); iVar2 = *(int *)((int)g_game->_room + 0x1d18); local_e4.y = (float)Level::GetStageID(); if ((((iVar2 == 0x1f) || (iVar2 == 6)) || (local_e4.y == 3.78351e-44)) || (isWaterStage = '\0', local_e4.y == 3.92364e-44)) { isWaterStage = '\x01'; } if (0.0 < npc->_pendingDamage) { if ((npc->_damageEvents)._begin != (npc->_damageEvents)._end) { damageEventsEnd = (npc->_damageEvents)._end; local_cc = (npc->_pos).x - *(float *)((int)damageEventsEnd + -0x18); local_c4 = (npc->_pos).y - *(float *)((int)damageEventsEnd + -0x14); fVar3 = sqrtf(local_cc * local_cc + local_c4 * local_c4); if (fVar3 <= 0.0) { fVar3 = local_cc; } else { local_c4 = local_c4 * (1.0 / fVar3); fVar3 = local_cc * (1.0 / fVar3); } (npc->_velocity).x = fVar3; (npc->_velocity).y = local_c4; } local_c4 = (npc->_velocity).y; fVar3 = (npc->_velocity).x; if (fVar3 * fVar3 + local_c4 * local_c4 < 1e-06) { rngResult = Random(); local_c4 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c4 = local_c4 + local_c4; local_cc = cos(local_c4); local_c4 = sin(local_c4); (npc->_velocity).x = local_cc; (npc->_velocity).y = local_c4; fVar3 = local_cc; } fVar3 = sqrtf(local_c4 * local_c4 + fVar3 * fVar3); if ((fVar3 < 8.0) && (0.0 < fVar3)) { (npc->_velocity).x = (8.0 / fVar3) * (npc->_velocity).x; (npc->_velocity).y = local_c4 * (8.0 / fVar3); } npc->_stateFrame = 0xf; } iVar2 = npc->_state; if (iVar2 == 0) { npc->_entityGridCollisionClass = 6; npc->_state = 0x10; (npc->_v1).x = 0.0; return; } if (iVar2 == 0x10) { ANM2::Play(&npc->_sprite,(byte *)"AppearEnd",0); if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) || (0.0 < npc->_pendingDamage)) { npc->_state = 3; return; } } else if (iVar2 == 3) { fVar3 = (npc->_v1).x - 180.0; if (360.0 < ABS(fVar3)) { fVar3 = fmodf(fVar3,360.0); } if (fVar3 <= 180.0) { if (fVar3 < -180.0) { fVar3 = fVar3 + 360.0; } } else { fVar3 = fVar3 - 360.0; } local_c4 = ((fVar3 + 180.0) * 12.0) / 360.0; dVar5 = floor((double)local_c4); local_c4 = (float)dVar5; iVar2 = (int)dVar5; if (iVar2 < 0) { iVar2 = 0; } ANM2::Play(&npc->_sprite,(&PTR_s_Shake00_00b618d8)[iVar2 % 0xc],0); if (0.0 < npc->_pendingDamage) { rngResult = Random(); if (rngResult % 3 == 0) { if (npc->_variant == 1) { fVar3 = 0.85; } else { fVar3 = 1.0; } Entity_NPC::PlaySound(npc,0x92,1.0,10,0,fVar3); } } if ((npc->_variant == 1) && (npc->_stateFrame < 1)) { pVVar1 = Entity_NPC::CalcTargetPosition(npc,&local_e4,0.0); local_c4 = pVVar1->x - (npc->_pos).x; local_cc = pVVar1->y - (npc->_pos).y; if (npc->_controllerID != -1) { pVVar1 = Entity_NPC::GetControllerInput(npc,&local_e4,0.0); local_c4 = pVVar1->x; local_cc = pVVar1->y; } fVar3 = sqrtf(local_c4 * local_c4 + local_cc * local_cc); if (0.0 < fVar3) { fVar4 = npc->_friction; accelX = local_c4 * (0.2 / fVar3); fVar3 = local_cc * (0.2 / fVar3); if (fVar4 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * fVar3) / fVar4 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * accelX) / fVar4 + (npc->_velocity).x; } fVar3 = atan2f(local_d8 + fVar3 * 0.4,facingX + accelX * 0.4); (npc->_v1).x = fVar3 * 57.295776 - 90.0; } fVar3 = (npc->_velocity).y; fVar4 = (npc->_velocity).x; fVar3 = sqrtf(fVar4 * fVar4 + fVar3 * fVar3); if (8.0 < fVar3) { npc->_stateFrame = 0xf; } fVar3 = npc->_friction * 0.9; } else { if (npc->_controllerID != -1) { Entity_NPC::GetControllerInput(npc,&scratchVec,0.0); if ((scratchVec.x != g_vectorZero.x) || (scratchVec.y != g_vectorZero.y)) { fVar3 = (npc->_velocity).x; fVar4 = (npc->_velocity).y; local_c4 = sqrtf(fVar3 * fVar3 + fVar4 * fVar4); local_c4 = local_c4 / 0.97; if (local_c4 <= 1.0) { local_c4 = 1.0; } local_cc = scratchVec.x * 0.2 * npc->_speedMultiplier + (npc->_velocity).x; scratchVec.y = scratchVec.y * 0.2 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = local_cc; (npc->_velocity).y = scratchVec.y; fVar3 = sqrtf(scratchVec.y * scratchVec.y + local_cc * local_cc); if ((local_c4 < fVar3) && (0.0 < fVar3)) { (npc->_velocity).x = local_cc * (local_c4 / fVar3); (npc->_velocity).y = scratchVec.y * (local_c4 / fVar3); } } } scratchVec.y = (npc->_velocity).x; fVar3 = (npc->_velocity).y; scratchVec.y = scratchVec.y * scratchVec.y; fVar3 = sqrtf(fVar3 * fVar3 + scratchVec.y); fVar3 = fVar3 + fVar3; if ((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) { fVar3 = fVar3 * -1.0; } fVar3 = fVar3 + (npc->_v1).x; if (360.0 < ABS(fVar3)) { fVar3 = fmodf(fVar3,360.0); } if (fVar3 <= 180.0) { if (fVar3 < -180.0) { fVar3 = fVar3 + 360.0; } } else { fVar3 = fVar3 - 360.0; } (npc->_v1).x = fVar3; fVar3 = (npc->_velocity).y; fVar3 = sqrtf(fVar3 * fVar3 + scratchVec.y); if (1.0 <= fVar3) { npc->_stateFrame = 0xf; } else if (0 < npc->_stateFrame) { npc->_stateFrame = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; } if (fVar3 <= 0.01) { iVar2 = 0; } else { if (npc->_variant == 1) { fVar4 = 5.0; } else { fVar4 = 20.0; } fireInterval = 1; if (1 < (int)(fVar4 / fVar3)) { fireInterval = (int)(fVar4 / fVar3); } iVar2 = npc->_i1; if ((int)((float)fireInterval + (float)fireInterval) < iVar2) { ProjectileParams::ProjectileParams(&projParams); if (isWaterStage != '\0') { projParams.Variant = (local_e4.y != 3.92364e-44) + 3; } projParams.VelocityMulti = 0.7; if (npc->_variant == 1) { projParams.FallingAccelModifier = -0.1; projParams.Scale = 1.4; } scratchVec.x = facingX; scratchVec.y = local_d8; Vector::Normalize(&scratchVec); scratchVec.x = scratchVec.x * 10.0; scratchVec.y = scratchVec.y * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,0,&projParams); Entity_NPC::PlaySound(npc,0x99,1.0,2,0,1.0); npc->_i1 = 0; iVar2 = 0; } iVar2 = iVar2 + 1; } npc->_i1 = iVar2; fVar3 = npc->_friction * 0.97; } npc->_friction = fVar3; if (isWaterStage == '\0') { fVar3 = (npc->_velocity).y; fVar4 = (npc->_velocity).x; fVar3 = sqrtf(fVar4 * fVar4 + fVar3 * fVar3); if (2.0 < fVar3) { isSplatFrame = Entity::IsFrame((Entity *)npc,7,0); if (isSplatFrame != 0) { rngResult = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.1); } } } } return; } //@@ 00560570 NpcAI::ENTITY_DEEP_GAPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 811 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DEEP_GAPER(Entity_NPC *npc) { byte bVar1; uint uVar2; RoomDescriptor *roomDesc; uint seed; Entity *tmpEntity; Vector *pVVar3; void *pvVar4; float speed; int iVar5; int unused2; Vector leechPos; float pitch; void *walkAnimVert; char acStack_40 [12]; uint uStack_34; uint uStack_30; void *walkAnimHori; char acStack_28 [4]; undefined1 auStack_24 [12]; float fStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; undefined4 flagsHigh; Game *game; Manager *manager; qword oldFlags; uStack_8 = 0xffffffff; puStack_c = &LAB_00af4db5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(auStack_24 + 0x20); ExceptionList = &local_10; local_14 = uVar2; switch(npc->_state) { case 0: if (npc->_subtype == 0) { auStack_24._0_4_ = npc->_initSeed; auStack_24._4_8_ = 0x500000001; fStack_18 = 2.24208e-44; uVar2 = RNG::RandomInt((RNG *)auStack_24,3); if (uVar2 == 0) { uVar2 = RNG::RandomInt((RNG *)auStack_24,6); Entity_NPC::Morph(npc,npc->_type,npc->_variant,uVar2 + 1,-1); } } if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount != *(int *)((int)g_game->_room + 0x11f0))) { npc->_state = 4; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); ANM2::PlayOverlay(&npc->_sprite,s_Head,0); npc->_entityCollisionClass = 4; } else { oldFlags = npc->_flags; npc->_entityCollisionClass = 0; npc->_visible = 0; npc->_canShutDoors = 0; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 3; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x11; npc->_i1 = npc->_championColorIdx; npc->_championColorIdx = -1; } break; case 3: if (npc->_controllerID != -1) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&g_vectorZero,1.0,0,1); Entity_NPC::SpawnControlTarget(npc,2,-1.0); } if (npc->_canShutDoors == 0) { if ((((npc->_flags & 0x20000000) != 0) || ((iVar5 = Entity_NPC::GetAliveEnemyCount(npc), iVar5 < 1 && (*(int *)((int)g_game->_room + 0x11ec) < 9)))) || (roomDesc = Game::GetCurrentRoomDesc(g_game), ((uint)roomDesc->Flags >> 1 & 1) != 0)) { npc->_canShutDoors = 1; npc->_stateFrame = 0; } break; } if (npc->_controllerID != -1) { Entity_NPC::UpdateChargeBar(npc,90.0,0.0,(float)npc->_stateFrame,1); } iVar5 = 4; bVar1 = Entity::IsFrame((Entity *)npc,4,0); if (bVar1 == 0) { LAB_00560795: if (npc->_controllerID != -1) { unused2 = 9; iVar5 = 0x5607ab; bVar1 = Entity_NPC::IsControllerActionPressed(npc,9); if ((bVar1 != 0) || (0x5a < npc->_stateFrame)) goto LAB_005607bc; } } else { unused2 = 0x560788; uVar2 = Random(); if (((uVar2 & 7) != 0) && (npc->_stateFrame < 0x5b)) goto LAB_00560795; LAB_005607bc: bVar1 = Entity::IsPlayerInRadius((Entity *)npc,&npc->_pos,60.0,iVar5,unused2); if (bVar1 == 0) { if ((npc->_chargeBarSprite)._loaded != 0) { (npc->_chargeBarSprite)._color._tint[3] = 0.0; } npc->_state = 8; ANM2::Play(&npc->_sprite,(&PTR_s_Ambush1_00b61908)[npc->_initSeed & 1],0); game = g_game; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_visible = 1; npc->_isInvicible = 0; npc->_championColorIdx = npc->_i1; Level::UpdateBackwardsPathStages(game->_room); } } npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); break; case 4: uStack_30 = 0xf; uStack_34 = 8; walkAnimVert = (void *)0x6b6c6157; builtin_strncpy(acStack_40,"Vert",5); fStack_18 = 2.10195e-44; auStack_24._8_4_ = 8; walkAnimHori = (void *)0x6b6c6157; builtin_strncpy(acStack_28,"Hori",4); auStack_24._0_4_ = auStack_24._0_4_ & 0xffffff00; uStack_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkAnimHori,(std_string *)&walkAnimVert,0.1); uStack_8 = uStack_8 & 0xffffff00; if (0xf < (uint)fStack_18) { uVar2 = (int)fStack_18 + 1; pvVar4 = walkAnimHori; if (0xfff < uVar2) { pvVar4 = *(void **)((int)walkAnimHori + -4); uVar2 = (int)fStack_18 + 0x24; if (0x1f < (uint)((int)walkAnimHori + (-4 - (int)pvVar4))) goto LAB_00560a99; } operator_delete(pvVar4,uVar2); } uStack_8 = 0xffffffff; auStack_24._4_8_ = auStack_24._4_8_ & 0xffffffff; fStack_18 = 2.10195e-44; walkAnimHori = (void *)((uint)walkAnimHori & 0xffffff00); if (0xf < uStack_30) { uVar2 = uStack_30 + 1; pvVar4 = walkAnimVert; if (0xfff < uVar2) { pvVar4 = *(void **)((int)walkAnimVert + -4); uVar2 = uStack_30 + 0x24; if (0x1f < (uint)((int)walkAnimVert + (-4 - (int)pvVar4))) { LAB_00560a99: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } if (((npc->_flags & 0x1000800) == 0) || (npc->_controllerID != -1)) { bVar1 = 1; iVar5 = 900; speed = 0.6; pVVar3 = Entity_NPC::CalcTargetPosition(npc,(Vector *)(auStack_24 + 8),0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar3,speed,iVar5,bVar1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fStack_18 = (tmpEntity->_pos).y; auStack_24._8_4_ = (tmpEntity->_pos).x; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,(Vector *)(auStack_24 + 8),0); npc->_friction = npc->_friction * 0.8; } if (npc->_controllerID == -1) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); bVar1 = Entity::IsHostileTo((Entity *)npc,tmpEntity); if (((bVar1 == 0) || ((npc->_pathfinder)._hasDirectPath == 0)) || (uVar2 = Random(), uVar2 % 3 != 0)) break; } else { bVar1 = Entity_NPC::IsControllerActionPressed(npc,10); if (bVar1 == 0) break; } manager = g_manager; pitch = 1.0; if (npc->_championColorIdx == 0x12) { pitch = 1.5; } else if (npc->_championColorIdx == 0x13) { pitch = 0.5; } fStack_18 = 2.31214e-43; seed_fart_sound_override((int *)&fStack_18); SoundEffects::Play(&manager->_sfxManager,(int)fStack_18,1.0,0x28,0,pitch,0.0); break; case 8: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Splash"); if (bVar1 != 0) { seed = Random(); tmpEntity = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,seed); (**(code **)(*(int *)tmpEntity + 0xc))(uVar2); manager = g_manager; fStack_18 = 6.64215e-43; seed_fart_sound_override((int *)&fStack_18); pitch = 1.0; SoundEffects::Play(&manager->_sfxManager,(int)fStack_18,1.0,10,0,1.0,0.0); manager = g_manager; if (npc->_championColorIdx == 0x12) { pitch = 1.5; } else if (npc->_championColorIdx == 0x13) { pitch = 0.5; } fStack_18 = 2.31214e-43; seed_fart_sound_override((int *)&fStack_18); SoundEffects::Play(&manager->_sfxManager,(int)fStack_18,1.0,0x28,0,pitch,0.0); npc->_entityCollisionClass = 4; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 4; ANM2::SetFrame(&npc->_sprite,(std_string *)"WalkVert",0); ANM2::PlayOverlay(&npc->_sprite,s_Head,0); } if ((npc->_dead != 0) && (npc->_subtype == 6)) { bVar1 = 0; pVVar3 = Room::FindFreePickupSpawnPosition (g_game->_room,&leechPos,&npc->_pos,80.0,1,0.0 < g_game->_room->_waterAmount, 0); Entity_NPC::ThrowLeech(&npc->_pos,(Entity *)npc,-30.0,pVVar3,bVar1); } ExceptionList = local_10; return; } //@@ 00560ca0 NpcAI::ENTITY_FLY_TRAP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 873 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FLY_TRAP(Entity_NPC *npc) { byte bVar1; uint uVar2; Vector *targetPos; Entity *spawned; byte *animNameChar; int unused; byte *expectedChar; uint i; int effectTimeout; qword *allocCounter; uint flagsHigh; bool bVar4; float fVar5; float pushDirY; int iVar6; Vector shootTargetPos; char flyList [4]; int flyListData; uint flyListSize; Vector local_5c; Vector local_54; float local_4c; EntityPtr *local_48; float local_44 [2]; EntityList_EL local_3c; EntityList_EL EStack_2c; EntityList_EL local_1c; undefined1 *puStack_c; float local_8; qword allocatedBytes; byte *animData; undefined4 flagsHigh; float flyMass; Manager *manager; EntityPtr *parentSlot; code *setColorFn; local_8 = -NAN; puStack_c = &LAB_00af4ded; local_1c._size = (int)ExceptionList; local_1c._capacity = __security_cookie ^ (uint)(local_44 + 0x10); ExceptionList = &local_1c._size; flagsHigh = 0; Entity_NPC::QueryNPCsSpawnerType((EntityList *)flyList,npc->_type,0,1); local_8 = 0.0; i = 0; uVar2 = flagsHigh; if (flyListSize != 0) { do { flagsHigh = uVar2 + 1; if (*(Entity_NPC **)(*(int *)(flyListData + i * 4) + 0x3bc) != npc) { flagsHigh = uVar2; } i = i + 1; uVar2 = flagsHigh; } while (i < flyListSize); } switch(npc->_state) { case 0: flagsHigh = Random(); uVar2 = 0; local_44[0] = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 360.0; do { flagsHigh = Random(); local_4c = ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 120.0 + local_44[0]) * 0.017453292; local_48 = (EntityPtr *)sin(local_4c); fVar5 = cos(local_4c); local_54.x = fVar5 * 20.0 + (npc->_pos).x; local_54.y = (float)local_48 * 20.0 + (npc->_pos).y; spawned = Game::Spawn(g_game,0x12,0,&local_54,&g_vectorZero,(Entity *)npc,0,flagsHigh); parentSlot = &spawned->_parent; if (spawned->_parent != (EntityPtr)0x0) { local_48 = parentSlot; std::multiset::erase(&local_48); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); uVar2 = uVar2 + 1; } while (uVar2 < 3); npc->_state = 4; npc->_entityGridCollisionClass = 3; break; case 4: animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00560e9e: bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Walk,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedChar = s_Walk; do { bVar1 = *animNameChar; bVar4 = bVar1 < *expectedChar; if (bVar1 != *expectedChar) { LAB_00560e80: uVar2 = -(uint)bVar4 | 1; goto LAB_00560e85; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < expectedChar[1]; if (bVar1 != expectedChar[1]) goto LAB_00560e80; animNameChar = animNameChar + 2; expectedChar = expectedChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00560e85: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00560e9e; } bVar1 = 1; iVar6 = 0; fVar5 = 0.25; targetPos = Entity_NPC::CalcTargetPosition(npc,&local_5c,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,fVar5,iVar6,bVar1); if (0 < npc->_i1) break; if (npc->_controllerID == -1) { if ((2 < flagsHigh) && (uVar2 = Random(), uVar2 % 0x28 == 0)) goto LAB_00560f69; } else { bVar1 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,unused); if (bVar1 != 0) { LAB_00560f69: npc->_state = 9; break; } } if (npc->_controllerID == -1) { if (((flagsHigh < 3) && (uVar2 = Random(), uVar2 % 0x14 == 0)) || ((flagsHigh < 6 && (flagsHigh = Random(), flagsHigh % 0x50 == 0)))) { npc->_state = 8; } } else { bVar1 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if ((bVar1 != 0) && (flagsHigh < 6)) { npc->_state = 8; } } break; case 8: animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00561009: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d53c,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedChar = &DAT_00b1d53c; do { bVar1 = *animNameChar; bVar4 = bVar1 < *expectedChar; if (bVar1 != *expectedChar) { LAB_00560ff3: flagsHigh = -(uint)bVar4 | 1; goto LAB_00560ff8; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < expectedChar[1]; if (bVar1 != expectedChar[1]) goto LAB_00560ff3; animNameChar = animNameChar + 2; expectedChar = expectedChar + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_00560ff8: if ((flagsHigh != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00561009; } bVar1 = 1; iVar6 = 0; fVar5 = 0.25; targetPos = Entity_NPC::CalcTargetPosition(npc,&shootTargetPos,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,fVar5,iVar6,bVar1); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { flagsHigh = Random(); fVar5 = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 3.14; local_48 = (EntityPtr *)(fVar5 + fVar5); local_44[0] = sin((float)local_48); local_48 = (EntityPtr *)cos((float)local_48); flagsHigh = Random(); local_54.x = (float)local_48 * 10.0; local_54.y = local_44[0] * 10.0; local_5c.x = (float)local_48 + (float)local_48 + (npc->_pos).x; local_5c.y = local_44[0] + local_44[0] + (npc->_pos).y; spawned = Game::Spawn(g_game,0x12,0,&local_5c,&local_54,(Entity *)npc,0,flagsHigh); flagsHigh = *(undefined4 *)((int)&spawned->_flags + 4); parentSlot = &spawned->_parent; *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; *(undefined4 *)((int)&spawned->_flags + 4) = flagsHigh; if (*parentSlot != (EntityPtr)0x0) { local_48 = parentSlot; std::multiset::erase(&local_48); } *parentSlot = (EntityPtr)npc; std::multiset::insert(parentSlot); manager = g_manager; local_4c = 1.0; if (npc->_championColorIdx == 0x12) { local_4c = 1.5; } else if (npc->_championColorIdx == 0x13) { local_4c = 0.5; } local_44[0] = 2.21405e-43; seed_fart_sound_override((int *)local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44[0],1.0,2,0,local_4c,0.0); flagsHigh = Random(); spawned = Game::Spawn(g_game,1000,0x3b,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,flagsHigh); flagsHigh = Random(); *(float *)(spawned[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; flagsHigh = Random(); iVar6 = *(int *)spawned; effectTimeout = flagsHigh % 0xf + 0xf; *(int *)(spawned[1]._sprite._filename._buf + 8) = effectTimeout; *(int *)(spawned[1]._sprite._filename._buf + 0xc) = effectTimeout; setColorFn = *(code **)(iVar6 + 0x3c); flagsHigh = Random(); local_44[1] = 1.0; local_3c._0_4_ = 0x3f800000; local_3c._data = (void *)0x3f800000; EStack_2c._size = 0; local_1c._0_4_ = 0; local_1c._data = (void *)0x0; local_3c._size = 0; EStack_2c._0_4_ = 0; EStack_2c._data = (void *)0x0; EStack_2c._capacity = 0; local_3c._capacity = (int)((float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (*setColorFn)(local_44 + 1,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawned + 0xc))(); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 4; break; case 9: animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00561359: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d554,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedChar = &DAT_00b1d554; do { bVar1 = *animNameChar; bVar4 = bVar1 < *expectedChar; if (bVar1 != *expectedChar) { LAB_00561343: flagsHigh = -(uint)bVar4 | 1; goto LAB_00561348; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < expectedChar[1]; if (bVar1 != expectedChar[1]) goto LAB_00561343; animNameChar = animNameChar + 2; expectedChar = expectedChar + 2; } while (bVar1 != 0); flagsHigh = 0; LAB_00561348: if ((flagsHigh != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00561359; } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_005614c0: npc->_state = 4; } else { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar1 != 0) { flagsHigh = 0; npc->_i1 = 0x50; if (flyListSize != 0) { do { iVar6 = *(int *)(flyListData + flagsHigh * 4); if (*(Entity_NPC **)(iVar6 + 0x3bc) == npc) { local_44[0] = *(float *)(iVar6 + 0x33c) - (npc->_pos).x; local_4c = *(float *)(iVar6 + 0x340) - (npc->_pos).y; fVar5 = sqrtf(local_44[0] * local_44[0] + local_4c * local_4c); if (fVar5 <= 0.0) { pushDirY = local_4c; fVar5 = local_44[0]; } else { pushDirY = (1.0 / fVar5) * local_4c; fVar5 = local_44[0] * (1.0 / fVar5); } flyMass = *(float *)(iVar6 + 0x36c); if (flyMass != 0.0) { *(float *)(iVar6 + 0x360) = (fVar5 * 10.0 * *(float *)(iVar6 + 0x39c)) / flyMass + *(float *)(iVar6 + 0x360); *(float *)(iVar6 + 0x364) = (pushDirY * 10.0 * *(float *)(iVar6 + 0x39c)) / flyMass + *(float *)(iVar6 + 0x364); } } flagsHigh = flagsHigh + 1; } while (flagsHigh < flyListSize); } Game::ButterBeanFart(g_game,&npc->_pos,120.0,(Entity *)npc,1,0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_005614c0; } npc->_friction = npc->_friction * 0.8; } if (0 < npc->_i1) { npc->_i1 = npc->_i1 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); } if (flyList[0] == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (flyListData != 0) { flagsHigh = *(uint *)(flyListData + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - flagsHigh; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < flagsHigh); free((void *)(flyListData + -4)); } } ExceptionList = (void *)local_1c._size; return; } //@@ 00561580 NpcAI::ENTITY_FLY_orbit_parent /* DB: ? called from NpcAI::ENTITY_FLY, npc only; steers toward target +0x3bc, timing from Entity_NPC::ParentNPC I1 (>0x28), QueryNPCsSpawnerType */ void __fastcall NpcAI::ENTITY_FLY_orbit_parent(Entity_NPC *npc) { float fVar1; Entity_NPC *tmpNpc; void *siblingData; uint i; float fVar2; float fVar3; float fVar4; float fVar5; char siblings [4]; void *siblingsData; uint siblingCount; float local_30; float local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; EntityPtr parent; Vector *targetPos; puStack_20 = siblings + 0x3c; local_14 = -1; puStack_18 = &LAB_00af4e20; local_1c = ExceptionList; ExceptionList = &local_1c; parent = npc->_parent; if ((parent == (EntityPtr)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)parent + 0x28) != 1)) && (0x3dd < *(int *)((int)parent + 0x28) - 10U)))) { npc->_spawnerType = 0; } else { local_28 = *(float *)((int)parent + 0x33c) - (npc->_pos).x; local_24 = *(float *)((int)parent + 0x340) - (npc->_pos).y; fVar2 = sqrtf(local_28 * local_28 + local_24 * local_24); if (0.0 < fVar2) { local_28 = local_28 * (1.0 / fVar2); local_24 = local_24 * (1.0 / fVar2); } local_2c = 40.0; local_28 = -local_28; local_30 = 6.0; tmpNpc = Entity_NPC::ParentNPC(npc); if (0 < tmpNpc->_i1) { tmpNpc = Entity_NPC::ParentNPC(npc); if (0x28 < tmpNpc->_i1) { local_2c = 600.0; } tmpNpc = Entity_NPC::ParentNPC(npc); local_30 = (ABS((float)(tmpNpc->_i1 + -0x28)) * 10.0) / 30.0; } targetPos = &npc->_targetPosition; fVar2 = local_28 - local_24; targetPos->x = local_28 + local_24; (npc->_targetPosition).y = fVar2; local_28 = targetPos->x; local_24 = fVar2; fVar2 = sqrtf(local_28 * local_28 + fVar2 * fVar2); if (0.0 < fVar2) { local_28 = local_28 * (local_2c / fVar2); (npc->_targetPosition).y = (local_2c / fVar2) * local_24; targetPos->x = local_28; } local_28 = local_28 + *(float *)((int)npc->_parent + 0x33c); local_2c = *(float *)((int)npc->_parent + 0x340) + (npc->_targetPosition).y; targetPos->x = local_28; (npc->_targetPosition).y = local_2c; local_28 = local_28 - (npc->_pos).x; local_2c = local_2c - (npc->_pos).y; fVar3 = sqrtf(local_28 * local_28 + local_2c * local_2c); fVar2 = local_2c; fVar5 = local_28; if ((local_30 < fVar3) && (0.0 < fVar3)) { fVar2 = (local_30 / fVar3) * local_2c; fVar5 = (local_30 / fVar3) * local_28; } fVar3 = npc->_speedMultiplier; fVar4 = 0.39999998; if (fVar3 != 1.0) { fVar4 = 0.39999998 / ((fVar3 + 0.39999998) - fVar3 * 0.39999998); } fVar3 = (npc->_velocity).x; fVar1 = (npc->_velocity).y; npc->_entityGridCollisionClass = 0; (npc->_velocity).x = fVar3 + (fVar5 - fVar3) * (1.0 - fVar4); (npc->_velocity).y = fVar1 + (fVar2 - fVar1) * (1.0 - fVar4); Entity_NPC::QueryNPCsSpawnerType((EntityList *)siblings,*(int *)((int)npc->_parent + 0x28),0,1); i = 0; if (siblingCount != 0) { siblingData = siblingsData; do { tmpNpc = *(Entity_NPC **)((int)siblingData + i * 4); if (tmpNpc != npc) { if (tmpNpc->_parent == npc->_parent) { local_30 = (tmpNpc->_pos).x - (npc->_pos).x; local_2c = (tmpNpc->_pos).y - (npc->_pos).y; fVar2 = sqrtf(local_30 * local_30 + local_2c * local_2c); fVar5 = 1.0 / (fVar2 * 0.1 + 1.0); if (fVar2 <= 0.0) { fVar3 = local_30; fVar2 = local_2c; } else { fVar3 = local_30 * (1.0 / fVar2); fVar2 = local_2c * (1.0 / fVar2); } fVar4 = npc->_friction; siblingData = siblingsData; if (fVar4 != 0.0) { fVar1 = npc->_speedMultiplier; (npc->_velocity).x = (fVar5 * -fVar3 * fVar1) / fVar4 + (npc->_velocity).x; (npc->_velocity).y = (fVar5 * -fVar2 * fVar1) / fVar4 + (npc->_velocity).y; } } else { siblingData = siblingsData; } } i = i + 1; } while (i < siblingCount); } if (siblings[0] == '\0') { local_14 = 0; tracked_alloc(1,siblingsData,0); ExceptionList = local_1c; return; } } ExceptionList = local_1c; return; } //@@ 00561a20 NpcAI::ENTITY_FARTIGAN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: type 874 (gas dwarf); was Entity_NPC::moms_heart_mausoleum_death */ void __fastcall NpcAI::ENTITY_FARTIGAN(Entity_NPC *npc) { int iVar1; ANM2 *pAVar2; byte bVar3; uint uVar4; Entity *tmpEntity; EntityRef *sourceRef; Vector *facingDir; void *freeBlock; code *extraout_EDX; undefined1 *freeSize; code *extraout_EDX_00; float fVar5; float fVar6; Vector targetPos; Vector shotVelocity; Vector cloudVelocity; Vector local_124; float local_11c; char isSelfDetonated; ProjectileParams projParams; undefined1 local_6c [8]; float fStack_64; float fStack_60; float local_5c; void *pvStack_58; float fStack_54; float fStack_50; float local_4c; float local_48; undefined1 *local_44; undefined1 local_40 [24]; float fStack_28; float fStack_24; float local_20; float local_1c; float local_18; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af4e65; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_40 + 0x3c); if (npc->_state == 0) { npc->_state = 4; return; } ExceptionList = &local_10; stackCookie = uVar4; Entity_NPC::CalcTargetPosition(npc,&targetPos,0.0); iVar1 = npc->_state; isSelfDetonated = '\0'; if (iVar1 == 4) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetPos,1.2,0,1); bVar3 = Entity::IsFrame((Entity *)npc,5,0); if ((bVar3 != 0) && (tmpEntity = Entity_NPC::GetPlayerTarget(npc), fVar5 = (tmpEntity->_pos).x - (npc->_pos).x, fVar6 = (tmpEntity->_pos).y - (npc->_pos).y, fVar6 * fVar6 + fVar5 * fVar5 < 1600.0)) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_6c + 4)); (*extraout_EDX)(sourceRef); isSelfDetonated = '\x01'; } local_44 = &DAT_0000000f; local_48 = 1.12104e-44; fStack_50 = (float)((uint)fStack_50 & 0xffffff00); npc->_friction = npc->_friction * 0.9; pvStack_58 = (void *)0x6b6c6157; fStack_54 = (float)0x74726556; local_18 = 2.10195e-44; local_1c = 1.12104e-44; local_40[0x14] = 'W'; local_40[0x15] = 'a'; local_40[0x16] = 'l'; local_40[0x17] = 'k'; fStack_28 = (float)0x69726f48; fStack_24 = (float)((uint)fStack_24 & 0xffffff00); local_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_40 + 0x14),(std_string *)&pvStack_58,0.1); local_8 = local_8 & 0xffffff00; if (0xf < (uint)local_18) { uVar4 = (int)local_18 + 1; freeBlock = (void *)local_40._20_4_; if (0xfff < uVar4) { freeBlock = *(void **)(local_40._20_4_ + -4); uVar4 = (int)local_18 + 0x24; if (0x1f < (uint)(local_40._20_4_ + (-4 - (int)freeBlock))) goto LAB_00561c0c; } operator_delete(freeBlock,uVar4); } local_8 = 0xffffffff; local_1c = 0.0; local_18 = 2.10195e-44; local_40._20_4_ = local_40._20_4_ & 0xffffff00; if (&DAT_0000000f < local_44) { freeSize = local_44 + 1; freeBlock = pvStack_58; if ((undefined1 *)0xfff < freeSize) { freeBlock = *(void **)((int)pvStack_58 + -4); freeSize = local_44 + 0x24; if (0x1f < (uint)((int)pvStack_58 + (-4 - (int)freeBlock))) { LAB_00561c0c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,(uint)freeSize); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar3 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"HeadWalk",1); if ((bVar3 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } } else { ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadWalk",0); } if (npc->_i1 < 1) { if (npc->_controllerID == -1) { if (((npc->_pathfinder)._hasDirectPath == 0) || (uVar4 = Random(), (uVar4 & 0xf) != 0)) goto LAB_005620e2; } else { bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7); if (bVar3 == 0) goto LAB_005620e2; } npc->_state = 8; Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); facingDir = &local_124; if ((npc->_sprite)._flipX == 0) { cloudVelocity.x = 1.0; cloudVelocity.y = 0.0; facingDir = &cloudVelocity; } else { local_124.x = (float)&DAT_bf800000; local_124.y = 0.0; } cloudVelocity.x = facingDir->x; cloudVelocity.y = facingDir->y; uVar4 = Random(); local_11c = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292; local_124.y = cos(local_11c); fVar5 = sin(local_11c); local_11c = local_124.y * cloudVelocity.y; local_124.y = local_124.y * cloudVelocity.x - fVar5 * cloudVelocity.y; local_11c = fVar5 * cloudVelocity.x + local_11c; uVar4 = Random(); fVar5 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 10.0; cloudVelocity.x = local_124.y * fVar5; cloudVelocity.y = local_11c * fVar5; uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8d,&npc->_pos,&cloudVelocity,(Entity *)npc,1,uVar4); iVar1 = *(int *)tmpEntity; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[8] = -0x4c; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &tmpEntity[1]._sprite; (pAVar2->_filename)._buf[0xc] = -0x4c; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar1 + 0xc))(); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&npc->_pos,&npc->_velocity,(Entity *)0x0,1,uVar4); uVar4 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; ANM2::Play(&tmpEntity->_sprite,&DAT_00b1d534,0); local_6c._0_4_ = 1.0; local_6c._4_4_ = 1.0; fStack_64 = 1.0; fStack_60 = 1.0; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = (float)&DAT_c1c80000; tmpEntity->_renderZOffset = 500; local_5c = 1.2; pvStack_58 = (void *)0x3fb33333; fStack_54 = 0.6; fStack_50 = 1.0; local_4c = 0.0; local_48 = 0.0; local_44 = (undefined1 *)0x0; Sprite::SetColor((Sprite *)&tmpEntity->_sprite,(ColorMod *)local_6c); } } else if (iVar1 == 8) { PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&targetPos,1.0,0,1); local_44 = &DAT_0000000f; local_48 = 1.12104e-44; fStack_50 = (float)((uint)fStack_50 & 0xffffff00); npc->_friction = npc->_friction * 0.9; pvStack_58 = (void *)0x6b6c6157; fStack_54 = (float)0x74726556; local_18 = 2.10195e-44; local_1c = 1.12104e-44; local_40[0x14] = 'W'; local_40[0x15] = 'a'; local_40[0x16] = 'l'; local_40[0x17] = 'k'; fStack_28 = (float)0x69726f48; fStack_24 = (float)((uint)fStack_24 & 0xffffff00); local_8 = 3; Entity_NPC::AnimWalkFrame(npc,(std_string *)(local_40 + 0x14),(std_string *)&pvStack_58,0.1); local_8 = CONCAT31(local_8._1_3_,2); if (0xf < (uint)local_18) { uVar4 = (int)local_18 + 1; freeBlock = (void *)local_40._20_4_; if (0xfff < uVar4) { freeBlock = *(void **)(local_40._20_4_ + -4); uVar4 = (int)local_18 + 0x24; if (0x1f < (uint)(local_40._20_4_ + (-4 - (int)freeBlock))) goto LAB_00562061; } operator_delete(freeBlock,uVar4); } local_8 = 0xffffffff; local_1c = 0.0; local_18 = 2.10195e-44; local_40._20_4_ = local_40._20_4_ & 0xffffff00; if (&DAT_0000000f < local_44) { freeSize = local_44 + 1; freeBlock = pvStack_58; if ((undefined1 *)0xfff < freeSize) { freeBlock = *(void **)((int)pvStack_58 + -4); freeSize = local_44 + 0x24; if (0x1f < (uint)((int)pvStack_58 + (-4 - (int)freeBlock))) { LAB_00562061: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,(uint)freeSize); } ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadAttack",0); if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 4; } } else if ((iVar1 == 5) && ((npc->_friction = npc->_friction * 0.8, (npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { sourceRef = EntityRef::EntityRef((EntityRef *)(local_6c + 4)); (*extraout_EDX_00)(sourceRef,uVar4); } LAB_005620e2: if ((npc->_dead != 0) && (local_20 = (float)((uint)npc->_flags & 0x1000000), local_20 == 0.0)) { if (isSelfDetonated == '\0') { ProjectileParams::ProjectileParams(&projParams); shotVelocity.x = (npc->_velocity).x * 0.3; shotVelocity.y = (npc->_velocity).y * 0.3; projParams.BulletFlags._0_4_ = (uint)projParams.BulletFlags | 2; projParams.Color._colorize[0] = 1.5; projParams.Color._colorize[1] = 2.0; projParams.Color._colorize[2] = 0.5; projParams.Color._colorize[3] = 1.0; projParams.FallingAccelModifier = 0.3; projParams.FallingSpeedModifier = -5.0; local_124.y = shotVelocity.x; local_11c = shotVelocity.y; fVar5 = sqrtf(shotVelocity.y * shotVelocity.y + shotVelocity.x * shotVelocity.x); if ((4.0 < fVar5) && (0.0 < fVar5)) { shotVelocity.y = (4.0 / fVar5) * local_11c; shotVelocity.x = (4.0 / fVar5) * local_124.y; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVelocity,0,&projParams); } else { local_40._16_4_ = 0.0; local_40._20_4_ = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; local_40._0_4_ = 0.9; local_40._4_4_ = 1.0; local_40._8_4_ = 0.5; local_40._12_4_ = 1.0; local_1c = local_20; local_18 = local_20; Game::BombExplosionEffects (g_game,&npc->_pos,40.0,(BitSet128)ZEXT816(0),(ColorMod *)local_40,(Entity *)npc,1.0 ,1,4,0); } } ExceptionList = local_10; return; } //@@ 00562290 NpcAI::ENTITY_POOT_MINE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 875 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_POOT_MINE(Entity_NPC *npc) { int iVar1; ANM2 *pAVar2; undefined1 *puVar3; byte bVar4; uint uVar5; Vector *input; EntityRef *sourceRef; Entity *effect; uint rngResult; byte *curAnimChar; LayerState *layer; char *wantedAnimChar; code *extraout_EDX; bool bVar6; float fVar7; float fVar8; float fVar9; float fVar10; undefined1 auVar11 [12]; float *pfVar12; EntityList_EL nearby; Vector local_9c; Vector local_94; Vector local_8c; float local_84; float *local_80; ColorMod explosionColor; undefined4 local_50; EntityRef local_4c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *damageEventsEnd; Entity_NPC *nearbyEntity; ColorMod *particleColor; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af4ea0; local_1c = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_84 = 0.0; local_80 = (float *)0x0; local_24 = uVar5; puVar3 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_controllerID != -1) { bVar4 = input_is_action_pressed(9,npc->_controllerID,(Entity *)npc,(int)npc); if (bVar4 != 0) { local_4c._type = 0; local_4c._variant = 0; local_4c._spawnerType = 0; local_4c._spawnerVariant = 0; local_4c._position.x = g_vectorZero.x; local_4c._position.y = g_vectorZero.y; local_4c._velocity.x = g_vectorZero.x; local_4c._velocity.y = g_vectorZero.y; local_4c._flags = 0; local_4c._entity = (void *)0x0; (**(code **)(*(int *)npc + 0x24))(&local_4c,uVar5); } input = Entity_NPC::GetControllerInput(npc,&local_94,0.1); if ((((input->x != g_vectorZero.x) || (input->y != g_vectorZero.y)) && (npc->_pendingDamage <= 0.0)) && (npc->_state == 3)) { sourceRef = EntityRef::EntityRef(&local_4c); (*extraout_EDX)(0x40000000,0,0,sourceRef,0x1e); } puVar3 = puStack_20; } puStack_20 = puVar3; if (0.0 < npc->_pendingDamage) { damageEventsEnd = (npc->_damageEvents)._end; if ((npc->_damageEvents)._begin != damageEventsEnd) { local_80 = (float *)((npc->_pos).x - *(float *)((int)damageEventsEnd + -0x18)); local_84 = (npc->_pos).y - *(float *)((int)damageEventsEnd + -0x14); } if (local_84 * local_84 + (float)local_80 * (float)local_80 < 1e-06) { uVar5 = Random(); fVar7 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_80 = (float *)(fVar7 + fVar7); local_84 = sin((float)local_80); local_80 = (float *)cos((float)local_80); } fVar7 = sqrtf(local_84 * local_84 + (float)local_80 * (float)local_80); if (0.0 < fVar7) { local_80 = (float *)((1.0 / fVar7) * (float)local_80); local_84 = local_84 * (1.0 / fVar7); } } iVar1 = npc->_state; npc->_friction = npc->_friction * 0.7; if (iVar1 != 0) { if (iVar1 != 3) { if (iVar1 == 8) { if ((npc->_controllerID != -1) && ((input = Entity_NPC::GetControllerInput(npc,&local_94,0.1), input->x != g_vectorZero.x || (input->y != g_vectorZero.y)))) { input = Entity_NPC::GetControllerInput(npc,&local_94,0.1); input = Vector::Normalized(input,&local_9c); (npc->_targetPosition).x = input->x; (npc->_targetPosition).y = input->y; } bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x25,1.0,2,0,1.0); uVar5 = Random(); local_8c.x = (npc->_targetPosition).x * -2.0; local_8c.y = (npc->_targetPosition).y * -2.0; effect = Game::Spawn(g_game,1000,0x8d,&npc->_pos,&local_8c,(Entity *)npc,1,uVar5); iVar1 = *(int *)effect; pAVar2 = &effect[1]._sprite; (pAVar2->_filename)._buf[8] = -1; (pAVar2->_filename)._buf[9] = -1; (pAVar2->_filename)._buf[10] = -1; (pAVar2->_filename)._buf[0xb] = -1; pAVar2 = &effect[1]._sprite; (pAVar2->_filename)._buf[0xc] = -1; (pAVar2->_filename)._buf[0xd] = -1; (pAVar2->_filename)._buf[0xe] = -1; (pAVar2->_filename)._buf[0xf] = -1; (**(code **)(iVar1 + 0xc))(); local_8c.x = (npc->_pos).x - (npc->_targetPosition).x * 40.0; local_8c.y = (npc->_pos).y - (npc->_targetPosition).y * 40.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearby,&local_8c,60.0,0xffffffff); local_14 = 0; uVar5 = 0; if (nearby._size != 0) { do { nearbyEntity = *(Entity_NPC **)((int)nearby._data + uVar5 * 4); if (nearbyEntity != npc) { fVar7 = (npc->_targetPosition).y; (nearbyEntity->_velocity).x = (nearbyEntity->_velocity).x - (npc->_targetPosition).x * 10.0; (nearbyEntity->_velocity).y = (nearbyEntity->_velocity).y - fVar7 * 10.0; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)nearby._size); } local_84 = 8.40779e-45; do { uVar5 = Random(); rngResult = Random(); local_8c.y = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_80 = (float *)cos(local_8c.y); fVar8 = sin(local_8c.y); fVar7 = (npc->_targetPosition).x; fVar9 = (npc->_targetPosition).y; local_8c.y = -((float)local_80 * fVar7 - fVar8 * fVar9); local_80 = (float *)-((float)local_80 * fVar9 + fVar8 * fVar7); rngResult = Random(); local_9c.y = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 20.0 + 6.0; local_9c.x = local_8c.y * local_9c.y; local_9c.y = (float)local_80 * local_9c.y; local_94.x = (npc->_pos).x - (npc->_targetPosition).x * 4.0; local_94.y = (npc->_pos).y - (npc->_targetPosition).y * 4.0; effect = Game::Spawn(g_game,1000,99,&local_94,&local_9c,(Entity *)0x0,1,uVar5); uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 1.0; fVar7 = (effect->_sprite)._scale.y; particleColor = &(effect->_sprite)._color; local_4c._velocity.y = 0.0; (effect->_sprite)._scale.x = fVar9 * (effect->_sprite)._scale.x; local_4c._flags = 0; (effect->_sprite)._scale.y = fVar9 * fVar7; local_4c._entity = (void *)0x0; if (particleColor != (ColorMod *)&local_50) { (effect->_sprite)._color._colorize[0] = 0.0; (effect->_sprite)._color._colorize[1] = 0.0; (effect->_sprite)._color._colorize[2] = 0.0; (effect->_sprite)._color._colorize[3] = 0.0; (effect->_sprite)._color._offset[0] = 0.0; (effect->_sprite)._color._offset[1] = 0.0; particleColor->_tint[0] = 0.4; (effect->_sprite)._color._tint[1] = 0.42; (effect->_sprite)._color._tint[2] = 0.25; (effect->_sprite)._color._tint[3] = 1.0; (effect->_sprite)._color._offset[2] = 0.0; } (**(code **)(*(int *)effect + 0xc))(); local_84 = (float)((int)local_84 + -1); } while (local_84 != 0.0); local_14 = 0xffffffff; if (nearby._0_1_ == '\0') { local_14 = 1; tracked_alloc(1,nearby._data,0); local_14 = 0xffffffff; } } bVar4 = AnimationState::WasEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot") ; if (bVar4 != 0) { if (npc->_collidesWithGrid != 0) { local_84 = (npc->_gridCollisionVelocity).y; fVar7 = (npc->_gridCollisionVelocity).x; fVar9 = (npc->_gridCollisionNormal).x; fVar8 = (npc->_gridCollisionNormal).y; fVar10 = local_84 * fVar8 + fVar7 * fVar9; local_80 = (float *)(fVar7 - fVar9 * 1.8 * fVar10); local_84 = local_84 - fVar8 * 1.8 * fVar10; (npc->_velocity).x = (float)local_80; (npc->_velocity).y = local_84; fVar7 = sqrtf((float)local_80 * (float)local_80 + local_84 * local_84); if (fVar7 <= 0.0) { pfVar12 = local_80; fVar7 = local_84; } else { pfVar12 = (float *)((float)local_80 * (1.0 / fVar7)); fVar7 = local_84 * (1.0 / fVar7); } (npc->_targetPosition).x = (float)pfVar12; (npc->_targetPosition).y = fVar7; } fVar7 = npc->_friction; fVar9 = (npc->_v1).y; fVar8 = (npc->_targetPosition).x; if (fVar7 != 0.0) { fVar10 = npc->_speedMultiplier; (npc->_velocity).y = (fVar10 * fVar9 * (npc->_targetPosition).y) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (fVar10 * fVar9 * fVar8) / fVar7 + (npc->_velocity).x; fVar9 = (npc->_v1).y; } fVar7 = npc->_speedMultiplier; auVar11 = ZEXT812(0x3f4ccccd); if (fVar7 != 1.0) { fVar8 = auVar11._0_4_; auVar11._4_8_ = auVar11._4_8_; auVar11._0_4_ = fVar8 / ((fVar7 + fVar8) - fVar7 * fVar8); } (npc->_v1).y = auVar11._0_4_ * fVar9; } if (((npc->_sprite)._overlayAnimState._animData == (void *)0x0) || ((npc->_sprite)._overlayAnimState._isPlaying == 0)) { npc->_state = 3; } } goto LAB_00562d95; } curAnimChar = (npc->_sprite)._overlayAnimState._animData; if (curAnimChar == (byte *)0x0) { LAB_00562b68: bVar4 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"IdleOverlay",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } wantedAnimChar = "IdleOverlay"; do { bVar4 = *curAnimChar; bVar6 = bVar4 < (byte)*wantedAnimChar; if (bVar4 != *wantedAnimChar) { LAB_00562b50: uVar5 = -(uint)bVar6 | 1; goto LAB_00562b55; } if (bVar4 == 0) break; bVar4 = curAnimChar[1]; bVar6 = bVar4 < (byte)wantedAnimChar[1]; if (bVar4 != wantedAnimChar[1]) goto LAB_00562b50; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00562b55: if ((uVar5 != 0) || ((*(char *)((int)(npc->_sprite)._overlayAnimState._animData + 0x34) != '\0' && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_00562b68; } if (((float)local_80 == g_vectorZero.x) && (local_84 == g_vectorZero.y)) goto LAB_00562d95; npc->_state = 8; curAnimChar = (npc->_sprite)._overlayAnimState._animData; if (curAnimChar == (byte *)0x0) { LAB_00562c09: bVar4 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"PootOverlay",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } wantedAnimChar = "PootOverlay"; do { bVar4 = *curAnimChar; bVar6 = bVar4 < (byte)*wantedAnimChar; if (bVar4 != *wantedAnimChar) { LAB_00562bf1: uVar5 = -(uint)bVar6 | 1; goto LAB_00562bf6; } if (bVar4 == 0) break; bVar4 = curAnimChar[1]; bVar6 = bVar4 < (byte)wantedAnimChar[1]; if (bVar4 != wantedAnimChar[1]) goto LAB_00562bf1; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00562bf6: if ((uVar5 != 0) || ((*(char *)((int)(npc->_sprite)._overlayAnimState._animData + 0x34) != '\0' && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_00562c09; } if ((npc->_controllerID == -1) || ((input = Entity_NPC::GetControllerInput(npc,&local_94,0.1), input->x == g_vectorZero.x && (input->y == g_vectorZero.y)))) { pfVar12 = local_80; fVar7 = local_84; } else { input = Entity_NPC::GetControllerInput(npc,&local_94,0.1); input = Vector::Normalized(input,&local_9c); pfVar12 = (float *)input->x; fVar7 = input->y; } (npc->_targetPosition).y = fVar7; (npc->_targetPosition).x = (float)pfVar12; (npc->_v1).y = 4.0; (npc->_sprite)._flipX = (float)pfVar12 < 0.0; goto LAB_00562d95; } npc->_state = 3; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Reference",1); if (((bVar4 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } curAnimChar = (npc->_sprite)._overlayAnimState._animData; if (curAnimChar == (byte *)0x0) { LAB_00562d66: bVar4 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"IdleOverlay",1); if (bVar4 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } wantedAnimChar = "IdleOverlay"; do { bVar4 = *curAnimChar; bVar6 = bVar4 < (byte)*wantedAnimChar; if (bVar4 != *wantedAnimChar) { LAB_00562d48: uVar5 = -(uint)bVar6 | 1; goto LAB_00562d4d; } if (bVar4 == 0) break; bVar4 = curAnimChar[1]; bVar6 = bVar4 < (byte)wantedAnimChar[1]; if (bVar4 != wantedAnimChar[1]) goto LAB_00562d48; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00562d4d: if ((uVar5 != 0) || ((*(char *)((int)(npc->_sprite)._overlayAnimState._animData + 0x34) != '\0' && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_00562d66; } npc->_entityGridCollisionClass = 6; LAB_00562d95: local_80 = AnimationState::GetNullFrameById(&(npc->_sprite)._overlayAnimState,1); if (local_80 != (float *)0x0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_pos).x = *local_80; (layer->_pos).y = local_80[1]; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_size).x = local_80[4]; (layer->_size).y = local_80[5]; local_8c.y = local_80[0x11]; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); pfVar12 = local_80; layer->_rotation = local_8c.y; bVar4 = __ftoui3(); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState,(float)(byte)((0.0 < pfVar12[6]) + (bVar4 & 7) * '\x02') ); } } if ((npc->_dead != 0) && (explosionColor._offset[0] = (float)((uint)npc->_flags & 0x1000000), explosionColor._offset[0] == 0.0)) { explosionColor._tint[0] = 1.0; explosionColor._tint[1] = 1.0; explosionColor._tint[2] = 1.0; explosionColor._tint[3] = 1.0; explosionColor._colorize[0] = 1.0; explosionColor._colorize[1] = 1.0; explosionColor._colorize[2] = 0.0; explosionColor._colorize[3] = 0.5; explosionColor._offset[1] = explosionColor._offset[0]; explosionColor._offset[2] = explosionColor._offset[0]; Game::BombExplosionEffects (g_game,&npc->_pos,25.0,(BitSet128)ZEXT816(0),&explosionColor,(Entity *)npc,1.0,1,4,0) ; } ExceptionList = local_1c; return; } //@@ 00562f00 NpcAI::ENTITY_DUMP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 876 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_DUMP(Entity_NPC *npc) { char *pcVar1; byte bVar2; Vector *pVVar3; EntityPtr spoutEffect; Vector *clampedFrame; Entity_Projectile *projectile; float *damageEvent; uint rngValue; Entity *tmpEntity; Entity_Effect *splat; LayerState *headLayer; Entity_NPC *head; byte *anim; int iVar4; float fVar5; float fVar6; float fVar7; float fVar8; undefined1 auVar9 [12]; float knockDirY; float fVar10; undefined1 auStack_f8 [4]; undefined1 local_f4 [8]; Vector VStack_ec; ColorMod splatColor; ProjectileParams projectileParams; uint local_c; float knockDirX; float *damageEventsEnd; undefined4 flagsHigh; void *lastDamageEventEnd; Manager *manager; EntityPtr oldParent; local_c = __security_cookie ^ (uint)auStack_f8; local_f4._0_4_ = (&PTR_s_HeadWalk0_00b618b4)[(uint)npc->_initSeed % 3]; if ((npc->_variant == 1) && ((npc->_sprite)._overlayAnimState._animData == (void *)0x0)) { bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Reference",1); if ((bVar2 != 0) && (((npc->_sprite)._animState._animData != (void *)0x0 && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)))) { (npc->_sprite)._animState._isPlaying = 0; } ANM2::PlayOverlay(&npc->_sprite,(byte *)"WalkOverlay",0); } switch(npc->_state) { case 0: npc->_state = 4; splatColor._colorize[0] = 0.0; splatColor._colorize[1] = 0.0; splatColor._colorize[2] = 0.0; splatColor._colorize[3] = 0.0; npc->_stateFrame = 0; splatColor._tint[0] = 0.0; splatColor._tint[1] = 0.0; splatColor._tint[2] = 0.0; splatColor._tint[3] = 1.0; splatColor._offset[0] = 0.25490198; splatColor._offset[1] = 0.16078432; splatColor._offset[2] = 0.13725491; Color::operator_assign((Color *)&npc->_splatColor,&splatColor); if (npc->_variant == 1) { ANM2::SetFrame(&npc->_sprite,(std_string *)"Reference",0); ANM2::PlayOverlay(&npc->_sprite,(byte *)"WalkOverlay",0); (npc->_v1).x = 0.0; } else { bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,anim,1); if ((bVar2 != 0) && ((npc->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,0.0); } ANM2::SetFrame(&npc->_sprite,(std_string *)s_Walk,0); } break; case 4: if (npc->_variant == 1) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"WalkOverlay",0); } else { ANM2::Play(&npc->_sprite,s_Walk,0); ANM2::PlayOverlay(&npc->_sprite,(byte *)local_f4._0_4_,0); bVar2 = (npc->_pathfinder)._hasDirectPath; (npc->_sprite)._flipX = (npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0; if ((bVar2 != 0) && (rngValue = Random(), rngValue % 6 == 0)) { Entity_NPC::PlaySound(npc,0xa7,1.0,0x5a,0,1.0); } } if ((npc->_flags & 0x1000800) == 0) { Entity_NPC::CalcTargetPosition(npc,&VStack_ec,0.0); local_f4._4_4_ = (npc->_velocity).x; local_f4._0_4_ = (npc->_velocity).y; if (npc->_variant == 1) { fVar6 = 0.78; } else { fVar6 = 0.4; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&VStack_ec,fVar6,900,1); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_f4._4_4_ = (npc->_velocity).x; local_f4._0_4_ = (npc->_velocity).y; VStack_ec.x = (tmpEntity->_pos).x; VStack_ec.y = (tmpEntity->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&VStack_ec,0); npc->_friction = npc->_friction * 0.8; } fVar6 = (npc->_velocity).y - (float)local_f4._0_4_; fVar8 = (npc->_velocity).x - (float)local_f4._4_4_; if ((npc->_variant == 1) && ((fVar8 != g_vectorZero.x || (fVar6 != g_vectorZero.y)))) { fVar6 = atan2f(fVar6,fVar8); (npc->_v1).x = fVar6 * 57.295776 - 90.0; } break; case 8: fVar6 = npc->_speedMultiplier; auVar9 = ZEXT812(0x3f000000); if (fVar6 != 1.0) { fVar8 = auVar9._0_4_; auVar9._4_8_ = auVar9._4_8_; auVar9._0_4_ = fVar8 / ((fVar6 + fVar8) - fVar6 * fVar8); } fVar6 = (npc->_velocity).x; fVar10 = 1.0 - auVar9._0_4_; fVar8 = (npc->_velocity).y; fVar5 = (npc->_v2).y; (npc->_velocity).x = fVar6 + fVar10 * ((npc->_v2).x - fVar6); (npc->_velocity).y = fVar8 + fVar10 * (fVar5 - fVar8); manager = g_manager; if (npc->_collidesWithGrid == 0) { fVar6 = (npc->_v2).y; } else { local_f4._0_4_ = 1.00893e-43; seed_fart_sound_override((int *)local_f4); SoundEffects::Play(&manager->_sfxManager,local_f4._0_4_,1.0,2,0,1.0,0.0); fVar6 = (npc->_gridCollisionVelocity).y; fVar8 = (npc->_gridCollisionVelocity).x; fVar5 = (npc->_gridCollisionNormal).x; fVar10 = (npc->_gridCollisionNormal).y; fVar7 = fVar6 * fVar10 + fVar8 * fVar5; (npc->_velocity).x = fVar8 - fVar5 * 1.8 * fVar7; (npc->_velocity).y = fVar6 - fVar10 * 1.8 * fVar7; pVVar3 = Vector::Normalized(&npc->_velocity,&VStack_ec); fVar6 = (npc->_v2).y; fVar8 = (npc->_v2).x; fVar5 = sqrtf(fVar8 * fVar8 + fVar6 * fVar6); fVar6 = fVar5 * pVVar3->y; fVar8 = pVVar3->x; (npc->_v2).y = fVar6; (npc->_v2).x = fVar5 * fVar8; } local_f4._0_4_ = (npc->_v2).x; fVar8 = sqrtf((float)local_f4._0_4_ * (float)local_f4._0_4_ + fVar6 * fVar6); fVar6 = npc->_speedMultiplier; fVar8 = (fVar8 - 1.0) / 10.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } fVar8 = fVar8 * 0.195 + 0.8; if (fVar6 != 1.0) { fVar8 = fVar8 / ((fVar8 + fVar6) - fVar8 * fVar6); } local_f4._0_4_ = (float)local_f4._0_4_ * fVar8; (npc->_v2).x = (float)local_f4._0_4_; (npc->_v2).y = fVar8 * (npc->_v2).y; fVar6 = (npc->_velocity).y; fVar8 = (npc->_velocity).x; fVar6 = sqrtf(fVar8 * fVar8 + fVar6 * fVar6); fVar6 = fVar6 + (npc->_v1).x; if (360.0 < ABS(fVar6)) { fVar6 = fmodf(fVar6,360.0); } if (fVar6 <= 180.0) { if (fVar6 < -180.0) { fVar6 = fVar6 + 360.0; } } else { fVar6 = fVar6 - 360.0; } (npc->_v1).x = fVar6; fVar6 = (npc->_v2).y; fVar6 = sqrtf((float)local_f4._0_4_ * (float)local_f4._0_4_ + fVar6 * fVar6); if (fVar6 < 0.25) { npc->_state = 4; } break; case 0x10: if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); } if (npc->_child == (EntityPtr)0x0) { rngValue = Random(); spoutEffect = (EntityPtr) Game::SpawnEx(g_game,1000,0x9b,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngValue ,0); oldParent = *(EntityPtr *)((int)spoutEffect + 0x3bc); pcVar1 = (char *)((int)spoutEffect + 0x478); pcVar1[0] = '\x0e'; pcVar1[1] = 't'; pcVar1[2] = -0x26; pcVar1[3] = ';'; if (oldParent != (EntityPtr)0x0) { local_f4._4_4_ = (EntityPtr *)((int)spoutEffect + 0x3bc); std::multiset::erase(local_f4 + 4); } *(EntityPtr *)((int)spoutEffect + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)spoutEffect + 0x3bc)); (**(code **)(*(int *)spoutEffect + 0xc))(); if (npc->_child != (EntityPtr)0x0) { local_f4._4_4_ = &npc->_child; std::multiset::erase(local_f4 + 4); } npc->_child = spoutEffect; std::multiset::insert(&npc->_child); } if (npc->_entityCollisionClass == 0) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); return; } } else { local_f4._0_4_ = 0.0; VStack_ec.x = 7.00649e-45; local_f4._4_4_ = (BADTYPE)(((npc->_maxHitPoints - npc->_health) * 6.0) / npc->_maxHitPoints); pVVar3 = (Vector *)(local_f4 + 4); if ((int)local_f4._4_4_ < 1) { pVVar3 = (Vector *)local_f4; } clampedFrame = &VStack_ec; if ((int)pVVar3->x < 5) { clampedFrame = pVVar3; } fVar6 = clampedFrame->x; if (1 < (int)fVar6) { npc->_canShutDoors = 0; } if (4 < (int)fVar6) { npc->_shadowSize = 0.0; } ANM2::Play(&npc->_sprite,(&PTR_s_Spout0_00b618c0)[(int)fVar6],0); VStack_ec.x = 0.0; local_f4._0_4_ = (byte *)npc->_maxHitPoints; local_f4._4_4_ = npc->_health - npc->_maxHitPoints / 150.0; pVVar3 = &VStack_ec; if (0.0 <= (float)local_f4._4_4_) { pVVar3 = (Vector *)(local_f4 + 4); } local_f4._4_4_ = pVVar3->x; npc->_health = (float)local_f4._4_4_; if (((float)local_f4._4_4_ <= 0.0) || (npc->_dead != 0)) { npc->_health = 0.001; npc->_dead = 0; ANM2::Play(&npc->_sprite,&DAT_00b61844,0); local_f4._4_4_ = npc->_health; local_f4._0_4_ = npc->_maxHitPoints; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10011; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_entityCollisionClass = 0; } fVar6 = npc->_speedMultiplier + (npc->_v1).y; (npc->_v1).y = fVar6; if ((float)local_f4._0_4_ == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar6 = (npc->_v1).y; } fVar8 = ((float)local_f4._4_4_ - 0.0) / ((float)local_f4._0_4_ - 0.0); if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } VStack_ec.x = 30.0 / (fVar8 * 13.0 + 2.0); if (VStack_ec.x <= fVar6) { do { (npc->_v1).y = fVar6 - VStack_ec.x; ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Variant = 3; projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,10.0,&projectileParams); (projectile->_velocity).x = (projectile->_velocity).x * 0.5; local_f4._0_4_ = (byte *)0x3f800000; (projectile->_velocity).y = (projectile->_velocity).y * 0.5; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_f4._0_4_ = (byte *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_f4._0_4_ = (byte *)0x3f000000; } local_f4._4_4_ = (EntityPtr *)0x99; seed_fart_sound_override((int *)(local_f4 + 4)); SoundEffects::Play(&manager->_sfxManager,local_f4._4_4_,1.0,2,0,(float)local_f4._0_4_,0.0) ; fVar6 = (npc->_v1).y; } while (VStack_ec.x <= fVar6); } } fVar6 = (npc->_targetPosition).x; fVar8 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; (npc->_velocity).x = fVar6 - fVar8; if (0.0 < npc->_pendingDamage) { npc->_pendingDamage = 0.0; damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { fVar6 = *damageEvent; *damageEvent = fVar6 * 0.1; npc->_pendingDamage = fVar6 * 0.1 + npc->_pendingDamage; } } } iVar4 = 8; if (npc->_state == 8) { iVar4 = 3; } if ((((npc->_flags & 0x4000) == 0) && (bVar2 = Game::IsPaused(g_game), bVar2 == 0)) && ((g_game->_frameCount + npc->_index) % iVar4 == 0)) { rngValue = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x5e,&npc->_pos,&g_vectorZero,(Entity *)npc,0,rngValue,0); rngValue = Random(); iVar4 = *(int *)tmpEntity; fVar8 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.25 + 0.75; fVar6 = fVar8 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar8 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar6; (**(code **)(iVar4 + 0xc))(); rngValue = Random(); if (rngValue % 3 == 0) { rngValue = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.3); (**(code **)(*(int *)splat + 0x3c))(&DAT_00c5c898,0xffffffff,0xff,0,1); } } iVar4 = npc->_variant; if (iVar4 == 0) { if ((npc->_pendingDamage <= 0.0) || ((npc->_damageEvents)._begin == (npc->_damageEvents)._end)) goto LAB_00563c1e; lastDamageEventEnd = (npc->_damageEvents)._end; local_f4._0_4_ = (npc->_pos).y - *(float *)((int)lastDamageEventEnd + -0x14); local_f4._4_4_ = (npc->_pos).x - *(float *)((int)lastDamageEventEnd + -0x18); fVar6 = (float)local_f4._0_4_ * (float)local_f4._0_4_ + (float)local_f4._4_4_ * (float)local_f4._4_4_; if (fVar6 <= 0.0001) goto LAB_00563c1e; fVar6 = sqrtf(fVar6); if (fVar6 <= 0.0) { knockDirY = (float)local_f4._0_4_; knockDirX = (float)local_f4._4_4_; } else { knockDirY = (float)local_f4._0_4_ * (1.0 / fVar6); knockDirX = (float)local_f4._4_4_ * (1.0 / fVar6); } (npc->_v2).x = knockDirX * 14.0; (npc->_v2).y = knockDirY * 14.0; iVar4 = npc->_variant; } if ((iVar4 == 1) && (local_f4._4_4_ = AnimationState::GetNullFrameById(&(npc->_sprite)._overlayAnimState,1), (EntityPtr *)local_f4._4_4_ != (EntityPtr *)0x0)) { headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (headLayer->_pos).x = (float)*(EntityPtr *)local_f4._4_4_; (headLayer->_pos).y = (float)*(EntityPtr *)(local_f4._4_4_ + 4); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (headLayer->_size).x = (float)*(EntityPtr *)(local_f4._4_4_ + 0x10); (headLayer->_size).y = (float)*(EntityPtr *)(local_f4._4_4_ + 0x14); VStack_ec.x = *(float *)(local_f4._4_4_ + 0x44); headLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); headLayer->_rotation = VStack_ec.x; if ((npc->_sprite)._animState._animData != (void *)0x0) { iVar4 = __ftoui3(); AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)iVar4); } } LAB_00563c1e: if (((npc->_dead != 0) && (npc->_variant == 0)) && (npc->_state != 0x10)) { npc->_health = npc->_maxHitPoints; npc->_state = 0x10; npc->_dead = 0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_entityCollisionClass = 2; VStack_ec.y = 0.0; VStack_ec.x = 0.0; npc->_size = *(float *)((int)npc->_config + 0x38) * 0.5; rngValue = RNG::Next(&npc->_dropRNG); head = (Entity_NPC *) Game::SpawnEx(g_game,npc->_type,npc->_variant + 1,&npc->_pos,&VStack_ec,(Entity *)npc,0, rngValue,0); if (npc->_isChampion != 0) { Entity_NPC::Morph(head,head->_type,head->_variant,head->_subtype,npc->_championColorIdx); } flagsHigh = *(undefined4 *)((int)&head->_flags + 4); *(uint *)&head->_flags = (uint)head->_flags & 0xfffffffb; *(undefined4 *)((int)&head->_flags + 4) = flagsHigh; (**(code **)(*(int *)head + 0xc))(); head->_state = 8; (head->_v2).x = (npc->_v2).x; (head->_v2).y = (npc->_v2).y; (head->_velocity).x = (npc->_v2).x; (head->_velocity).y = (npc->_v2).y; ANM2::PlayOverlay(&head->_sprite,(byte *)"FallOverlay",0); Entity_NPC::TransferControl(npc,head); } return; } //@@ 00563da0 NpcAI::ENTITY_BLOATY /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 879 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_BLOATY(Entity_NPC *npc) { float *pfVar1; ANM2 *pAVar2; byte bVar3; uint uVar4; uint uVar5; Entity *pEVar6; ProjectileParams *params; Entity_Projectile *projectile; Vector *input; byte *curAnimChar; float *extraout_ECX; void *pvVar7; byte *wantedAnimChar; int iVar8; bool bVar9; float fVar10; float fVar11; int iVar12; float fVar13; Vector effectVelocity; Entity_NPC *savedNpc; int elapsedTicks; float local_14c; Vector local_148; float local_140; Entity *local_13c; Vector local_138; float local_130; byte *local_12c; ProjectileParams projectileParams; undefined4 deathColor; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 local_6c; std_string sStack_68; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; AnimationState *animState; Game *game; Room *room; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af4ee5; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; iVar8 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; savedNpc = npc; elapsedTicks = iVar8; local_24 = uVar4; Entity_NPC::UpdateChargeBar(npc,60.0,0.0,(float)npc->_projectileCooldown,1); iVar12 = npc->_state; if (iVar12 == 0) { npc->_state = 4; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } if (npc->_controllerID == -1) { uVar4 = Random(); iVar12 = uVar4 % 0x96 + 0x3c; } else { iVar12 = 0x3c; } npc->_projectileCooldown = iVar12; npc->_i1 = 0; uVar4 = Random(); fVar11 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; if (360.0 < ABS(fVar11)) { fVar11 = fmodf(fVar11,360.0); } if (fVar11 <= 180.0) { if (fVar11 < -180.0) { fVar11 = fVar11 + 360.0; } } else { fVar11 = fVar11 - 360.0; } (npc->_v1).y = fVar11; (npc->_v1).x = fVar11; ExceptionList = local_1c; return; } if (iVar12 == 4) { local_28 = 2.10195e-44; local_2c = 1.12104e-44; local_50[0x14] = 'W'; local_50[0x15] = 'a'; local_50[0x16] = 'l'; local_50[0x17] = 'k'; fStack_38 = (float)0x74726556; fStack_34 = (float)((uint)fStack_34 & 0xffffff00); sStack_68._capacity = 0xf; sStack_68._size = 8; builtin_strncpy(sStack_68._buf,"WalkHori",8); sStack_68._buf._8_4_ = sStack_68._buf._8_4_ & 0xffffff00; local_14 = 1; Entity_NPC::AnimWalkFrame(npc,&sStack_68,(std_string *)(local_50 + 0x14),0.1); local_14 = local_14 & 0xffffff00; if (0xf < sStack_68._capacity) { uVar5 = sStack_68._capacity + 1; pvVar7 = (void *)sStack_68._buf._0_4_; if (0xfff < uVar5) { pvVar7 = *(void **)(sStack_68._buf._0_4_ + -4); uVar5 = sStack_68._capacity + 0x24; if (0x1f < (uint)(sStack_68._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_0056458d; } operator_delete(pvVar7,uVar5); } local_14 = 0xffffffff; sStack_68._size = 0; sStack_68._capacity = 0xf; sStack_68._buf._0_4_ = sStack_68._buf._0_4_ & 0xffffff00; if (0xf < (uint)local_28) { uVar5 = (int)local_28 + 1; pvVar7 = (void *)local_50._20_4_; if (0xfff < uVar5) { pvVar7 = *(void **)(local_50._20_4_ + -4); uVar5 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar7))) { LAB_0056458d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } npc->_friction = npc->_friction * 0.6; if (npc->_controllerID == -1) { local_148.y = *(float *)((int)&npc->_flags + 4); if (((npc->_flags & 0x1000b00) != 0) || (npc->_forcedTarget != (EntityPtr)0x0)) { npc->_i1 = 10; } if ((npc->_flags & 0x200) == 0) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x100); if ((bVar3 == 0) && (npc->_forcedTarget == (EntityPtr)0x0)) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000800); if (bVar3 != 0) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); fVar11 = atan2f((npc->_pos).y - (pEVar6->_pos).y,(npc->_pos).x - (pEVar6->_pos).x); (npc->_v1).x = fVar11 * 57.295776; } } else { local_13c = Entity_NPC::GetPlayerTarget(npc); bVar3 = Entity::IsFrame((Entity *)npc,5,npc->_index); if (bVar3 != 0) { local_140 = (npc->_pos).x; local_12c = (byte *)(npc->_pos).y; local_14c = (npc->_velocity).x; local_130 = (npc->_velocity).y; local_138.y = npc->_friction; PathFinder::Reset((PathFinder *)&npc->_pathfinder); local_148.x = (local_13c->_pos).x; local_148.y = (local_13c->_pos).y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_148,1.0,900,1); fVar11 = atan2f((npc->_velocity).y,(npc->_velocity).x); (npc->_v1).x = fVar11 * 57.295776; (npc->_pos).x = local_140; (npc->_pos).y = (float)local_12c; (npc->_velocity).x = local_14c; (npc->_velocity).y = local_130; npc->_friction = local_138.y; iVar8 = elapsedTicks; } } } else { uVar5 = Random(); if (uVar5 % 5 == 0) { uVar5 = Random(); fVar11 = normalize_angle_degrees ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0); (npc->_v1).x = fVar11; } } npc->_i1 = npc->_i1 - iVar8; local_138.y = (npc->_v1).y * 0.017453292; local_12c = (byte *)cos(local_138.y); local_138.y = sin(local_138.y); fVar11 = npc->_speedMultiplier; (npc->_velocity).x = (float)local_12c * 1.2 * fVar11 + (npc->_velocity).x; (npc->_velocity).y = local_138.y * 1.2 * fVar11 + (npc->_velocity).y; fVar11 = approach_angle((npc->_v1).y,(npc->_v1).x,10.0); (npc->_v1).y = fVar11; if ((npc->_collidesWithGrid != 0) && (uVar5 = Random(), (uVar5 & 3) == 0)) { fVar11 = (npc->_gridCollisionNormal).x; fVar13 = (npc->_gridCollisionNormal).y; fVar10 = fVar13 * local_138.y + fVar11 * (float)local_12c; fVar11 = atan2f(local_138.y - (fVar13 + fVar13) * fVar10, (float)local_12c - (fVar11 + fVar11) * fVar10); (npc->_v1).x = fVar11 * 57.295776; } if (npc->_i1 < 1) { uVar5 = Random(); fVar11 = normalize_angle_degrees ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0); (npc->_v1).x = fVar11; uVar5 = Random(); npc->_i1 = uVar5 % 0x78 + 0x2d; } } else { input = Entity_NPC::GetControllerInput(npc,&local_148,0.0); fVar11 = npc->_speedMultiplier; fVar13 = input->y; (npc->_velocity).x = input->x * 1.2 * 1.25 * fVar11 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 1.2 * 1.25 * fVar11 + (npc->_velocity).y; } uVar5 = Random(); if (uVar5 % 0x14 == 0) { Entity_NPC::PlaySound(npc,0xa7,1.0,0x3c,0,1.0); } if (((0 < npc->_projectileCooldown) && (iVar8 = npc->_projectileCooldown - iVar8, npc->_projectileCooldown = iVar8, 0 < iVar8)) || ((npc->_controllerID != -1 && (bVar3 = Entity_NPC::IsTargetInAttackRange(npc,1000.0,0,7), bVar3 == 0)))) goto LAB_00564d05; npc->_state = 8; if (npc->_controllerID == -1) { local_12c = (byte *)0x0; do { local_138.y = atan2f((npc->_velocity).y,(npc->_velocity).x); uVar5 = Random(); fVar11 = ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 90.0 + local_138.y * 57.295776) - 45.0; if (360.0 < ABS(fVar11)) { fVar11 = fmodf(fVar11,360.0); } game = g_game; if (fVar11 <= 180.0) { if (fVar11 < -180.0) { fVar11 = fVar11 + 360.0; } } else { fVar11 = fVar11 - 360.0; } uVar5 = (int)(fVar11 / 45.0 + 8.0) & 0x80000007; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffff8) + 1; } npc->_i2 = uVar5; room = game->_room; local_138.y = (float)(int)uVar5 * 45.0 * 0.017453292; fVar11 = cos(local_138.y); local_148.x = fVar11 * 80.0 + (npc->_pos).x; fVar11 = sin(local_138.y); local_148.y = fVar11 * 80.0 + (npc->_pos).y; bVar3 = Room::IsPositionInRoom(room,&local_148,0.0); } while ((bVar3 == 0) && (local_12c = (byte *)((int)local_12c + 1), local_12c < 8)); } else { input = Entity_NPC::GetControllerMovementInput(npc,&local_148,0.0); fVar11 = atan2f(input->y,input->x); fVar11 = normalize_angle_degrees((fVar11 * 57.295776) / 45.0); uVar5 = (int)(fVar11 + 8.0) & 0x80000007; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffff8) + 1; } npc->_i2 = uVar5; Entity_NPC::UpdateControllerMovement(npc,1); } animData = (npc->_sprite)._animState._animData; local_12c = (&PTR_s_AttackRight_00b61894)[npc->_i2]; if (animData == (byte *)0x0) { LAB_00564cc4: bVar3 = ANM2::SetAnimation(&npc->_sprite,local_12c,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; wantedAnimChar = local_12c; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar3 = *curAnimChar; bVar9 = bVar3 < *wantedAnimChar; if (bVar3 != *wantedAnimChar) { LAB_00564ca1: uVar5 = -(uint)bVar9 | 1; goto LAB_00564ca6; } if (bVar3 == 0) break; bVar3 = curAnimChar[1]; bVar9 = bVar3 < wantedAnimChar[1]; if (bVar3 != wantedAnimChar[1]) goto LAB_00564ca1; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00564ca6: if ((uVar5 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00564cc4; } (npc->_sprite)._flipX = npc->_i2 - 3U < 3; npc->_stateFrame = 0; goto LAB_00564d05; } if (iVar12 != 8) goto LAB_00564d05; Entity_NPC::UpdateControllerMovement(npc,0); animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_0056445a: npc->_state = 4; npc->_stateFrame = 0; if (npc->_controllerID == -1) { uVar5 = Random(); iVar12 = uVar5 % 0x96 + 0x3c; } else { iVar12 = 0x3c; } npc->_projectileCooldown = iVar12; } else { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar3 != 0) { fVar13 = 1.0; bVar3 = 0; iVar12 = 10; fVar11 = 1.0; uVar5 = Random(); Entity_NPC::PlaySound(npc,(~uVar5 & 1) + 0xb,fVar11,iVar12,bVar3,fVar13); Entity_NPC::PlaySound(npc,0xd5,0.6,10,0,1.0); } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_0056445a; bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"Shoot"); if (bVar3 != 0) { fVar11 = (float)npc->_i2 * 45.0; if ((npc->_controllerID != -1) && (local_130 = fVar11, bVar3 = Vector::operator_ne(&npc->_controllerMovement,&g_vectorZero), bVar3 != 0)) { fVar11 = atan2f(extraout_ECX[1],*extraout_ECX); fVar11 = approach_angle(local_130,fVar11 * 57.295776,45.0); } local_130 = fVar11 * 0.017453292; local_14c = cos(local_130); local_12c = (byte *)sin(local_130); local_130 = 0.0; if (0 < elapsedTicks) { do { if (7 < npc->_stateFrame) break; iVar12 = npc->_stateFrame + 1; npc->_stateFrame = iVar12; fVar11 = (float)iVar12 * 25.0; local_138.y = fVar11 * (float)local_12c + (npc->_pos).y; local_138.x = fVar11 * local_14c + (npc->_pos).x; uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x17,&local_138,&g_vectorZero,(Entity *)npc,0,uVar5); iVar12 = npc->_stateFrame; iVar8 = *(int *)pEVar6; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; local_13c = (Entity *)((float)iVar12 * 0.07 + 0.9); (pEVar6->_sprite)._scale.x = (float)local_13c; (pEVar6->_sprite)._scale.y = (float)local_13c; (**(code **)(iVar8 + 0xc))(); bVar3 = Room::IsPositionInRoom(g_game->_room,&local_138,0.0); if (bVar3 != 0) { uVar5 = Random(); local_30 = 0.08; local_2c = 0.5; local_28 = 0.01; effectVelocity.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; effectVelocity.y = effectVelocity.x * (npc->_targetPosition).y; effectVelocity.x = effectVelocity.x * (npc->_targetPosition).x; effectVelocity.y = effectVelocity.y + effectVelocity.y; effectVelocity.x = effectVelocity.x + effectVelocity.x; local_50._16_4_ = 0.0; local_50._20_4_ = (void *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; local_50._8_4_ = 0.0; local_50._12_4_ = 1.0; uVar5 = Random(); local_140 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * -16.0; local_148.x = local_138.x - (npc->_targetPosition).x * 5.0; local_148.y = local_138.y - (npc->_targetPosition).y * 5.0; uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,2,&local_148,&effectVelocity,(Entity *)0x0,2,uVar5); (**(code **)(*(int *)pEVar6 + 0x3c))(local_50,0xffffffff,0xff,0,1); (pEVar6->_sprite)._offset.x = 0.0; (pEVar6->_sprite)._offset.y = local_140; pEVar6->_renderDepthOffset = 10.0; uVar5 = Random(); game = g_game; (pEVar6->_sprite)._rotation = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; pfVar1 = (float *)((int)game->_room + 0x7240); if (*pfVar1 <= 0.2 && *pfVar1 != 0.2) { uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,7,&local_138,&g_vectorZero,(Entity *)0x0,0,uVar5); (pEVar6->_sizeMulti).x = (float)local_13c; (pEVar6->_sizeMulti).y = (float)local_13c; Color::Reset((Color *)local_50); local_30 = 0.08; local_50._0_4_ = 0.0; local_50._4_4_ = 0.0; local_50._8_4_ = 0.0; local_50._12_4_ = 0.5; local_2c = 0.5; local_28 = 0.01; (**(code **)(*(int *)pEVar6 + 0x3c))(local_50,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar6 + 0xc))(); } } if ((npc->_stateFrame & 1) == 0) { params = ProjectileParams::ProjectileParams(&projectileParams); projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,10.0,params); projectile->_scale = projectile->_scale * 0.65; uVar5 = Random(); local_13c = (Entity *) (((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292); local_140 = cos((float)local_13c); local_13c = (Entity *)sin((float)local_13c); uVar5 = Random(); fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 4.0; (projectile->_velocity).x = (local_14c * local_140 - (float)local_12c * (float)local_13c) * fVar11; (projectile->_velocity).y = (local_14c * (float)local_13c + (float)local_12c * local_140) * fVar11; Color::Reset((Color *)local_50); local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_50._16_4_ = 0.4; local_50._20_4_ = (void *)0x40000000; fStack_38 = 0.5; fStack_34 = 1.0; (**(code **)(*(int *)projectile + 0x3c))(local_50,0xffffffff,0xff,0,1); } local_130 = (float)((int)local_130 + 1); } while ((int)local_130 < elapsedTicks); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0056445a; } npc->_friction = npc->_friction * 0.4; LAB_00564d05: if (0.0 < npc->_pendingDamage) { iVar8 = (int)(npc->_pendingDamage * 8.0); iVar12 = 1; if (1 < iVar8) { iVar12 = iVar8; } npc->_projectileCooldown = npc->_projectileCooldown - iVar12; } if (npc->_dead != 0) { uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); sStack_68._buf[0xc] = '\0'; sStack_68._buf[0xd] = '\0'; sStack_68._buf[0xe] = '\0'; sStack_68._buf[0xf] = '\0'; deathColor = 0x3f800000; uStack_78 = 0x3f800000; uStack_74 = 0x3f800000; uStack_70 = 0x3f800000; local_6c = 0x3e800000; sStack_68._buf[0] = -0x33; sStack_68._buf[1] = -0x34; sStack_68._buf[2] = 'L'; sStack_68._buf[3] = '?'; sStack_68._buf[4] = '3'; sStack_68._buf[5] = '3'; sStack_68._buf[6] = -0x4d; sStack_68._buf[7] = '>'; sStack_68._buf[8] = '\0'; sStack_68._buf[9] = '\0'; sStack_68._buf[10] = -0x80; sStack_68._buf[0xb] = '?'; sStack_68._size = 0; sStack_68._capacity = 0; (**(code **)(*(int *)pEVar6 + 0x3c))(&deathColor,0xffffffff,0xff,0,1,uVar4); (**(code **)(*(int *)pEVar6 + 0xc))(); uVar4 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x17,&npc->_pos,&g_vectorZero,(Entity *)savedNpc,0,uVar4); iVar12 = *(int *)pEVar6; (pEVar6->_sprite)._scale.x = 2.0; (pEVar6->_sprite)._scale.y = 2.0; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[8] = 'Z'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[0xc] = 'Z'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar12 + 0xc))(); } ExceptionList = local_1c; return; } //@@ 00564f30 NpcAI::ENTITY_FISSURE /* NPC AI for entity type 815 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FISSURE(Entity_NPC *npc) { byte bVar1; uint uVar2; Vector *controllerInput; Entity *target; EntityRef *damageSourceRef; void *newDequeBlock; byte *animNameChar; int iVar3; byte *wantedAnimChar; bool bVar4; float fVar5; float fVar6; float fVar7; EntityRef damageSource; Vector local_38; Vector local_30; float trailHeight; float trailVelocityX; uint dequeIndex; void *local_1c; float local_18; float local_14; byte *animData; uint *dequeSize; uint dequeSlotCount; float speedMultiplier; float *velocityY; if (npc->_state != 0) { if (npc->_state != 6) { return; } npc->_friction = npc->_friction * 0.9; local_18 = (npc->_targetPosition).x; if ((local_18 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { uVar2 = Random(); fVar5 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1c = (void *)(fVar5 + fVar5); local_18 = cos((float)local_1c); local_18 = local_18 * 4.0; fVar5 = sin((float)local_1c); (npc->_velocity).x = local_18; (npc->_velocity).y = fVar5 * 4.0; local_14 = 1.0; fVar5 = sqrtf(2.0); if (0.0 < fVar5) { local_14 = 1.0 / fVar5; } local_14 = local_14 * 0.8; (npc->_targetPosition).x = local_14; (npc->_targetPosition).y = local_14; local_18 = local_14; } else { local_14 = (npc->_targetPosition).y; } if (((npc->_velocity).x <= 0.0 && (npc->_velocity).x != 0.0) != local_18 < 0.0) { local_18 = -local_18; } velocityY = &(npc->_velocity).y; if ((*velocityY <= 0.0 && *velocityY != 0.0) != local_14 < 0.0) { local_14 = -local_14; } fVar5 = local_18; fVar6 = local_14; if (npc->_controllerID != -1) { controllerInput = Entity_NPC::GetControllerInput(npc,&local_30,0.0); fVar5 = sqrtf(local_18 * local_18 + local_14 * local_14); fVar6 = fVar5 * 0.5 * controllerInput->y + local_14; fVar5 = fVar5 * 0.5 * controllerInput->x + local_18; } fVar7 = npc->_friction; if (fVar7 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).y = (speedMultiplier * fVar6) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (speedMultiplier * fVar5) / fVar7 + (npc->_velocity).x; } if (((npc->_flags & 0x1000800) != 0) && (npc->_controllerID == -1)) { target = Entity_NPC::GetPlayerTarget(npc); local_14 = -((target->_pos).y - (npc->_pos).y); local_18 = -((target->_pos).x - (npc->_pos).x); fVar6 = sqrtf(local_14 * local_14 + local_18 * local_18); fVar5 = local_18; if (0.0 < fVar6) { fVar7 = (120.0 - fVar6) * 0.02; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } fVar5 = local_18 * (fVar7 / fVar6); local_14 = local_14 * (fVar7 / fVar6); } fVar6 = npc->_friction; if (fVar6 != 0.0) { fVar7 = npc->_speedMultiplier; (npc->_velocity).y = (fVar7 * local_14) / fVar6 + (npc->_velocity).y; (npc->_velocity).x = (fVar7 * fVar5) / fVar6 + (npc->_velocity).x; } } bVar4 = npc->_entityGridCollisionClass != 7; local_14 = (npc->_v1).y; if (bVar4) { fVar5 = 0.36; } else { fVar5 = 0.18; } fVar6 = npc->_speedMultiplier; fVar7 = fVar6 * fVar5 + (npc->_v1).x; (npc->_v1).x = fVar7; fVar5 = fVar7 * fVar6 + local_14; (npc->_v1).y = fVar5; (npc->_posOffset).y = fVar5; if (bVar4) { if ((-6.0 < fVar5) && (0.0 < fVar7)) { local_38.x = (npc->_pos).x; local_38.y = (npc->_pos).y; iVar3 = Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); if (iVar3 == 1) { local_38.x = g_vectorOne.x * 18.0; local_38.y = g_vectorOne.y * 18.0; spawn_rock_particles(&npc->_pos,&local_38); npc->_entityGridCollisionClass = 7; } else if (npc->_updateTime <= 180.0) { (npc->_v1).y = -6.0; (npc->_v1).x = -5.0; local_38.x = g_vectorOne.x * 18.0; local_38.y = g_vectorOne.y * 18.0; spawn_rock_particles(&npc->_pos,&local_38); Entity_NPC::PlaySound(npc,0x102,1.0,2,0,1.0); } else { damageSourceRef = EntityRef::EntityRef(&damageSource); (**(code **)(*(int *)npc + 0x24))(damageSourceRef); } } } else if (30.0 < fVar5) { (**(code **)(*(int *)npc + 0x28))(); } iVar3 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_30.y = 0.0; if (iVar3 < 1) { return; } local_38.y = (float)iVar3; do { local_30.y = (float)((int)local_30.y + 1); local_18 = (float)(npc->_vectorDeque1)._offset; trailVelocityX = (npc->_velocity).x; trailHeight = ((npc->_v1).y - local_14) * ((float)(int)local_30.y / local_38.y) + local_14; if ((((uint)local_18 & 1) == 0) && ((npc->_vectorDeque1)._mapSize <= (npc->_vectorDeque1)._size + 2 >> 1)) { std::deque::_Growmap(iVar3); local_18 = (float)(npc->_vectorDeque1)._offset; } uVar2 = (npc->_vectorDeque1)._mapSize; dequeSlotCount = uVar2 * 2; dequeIndex = dequeSlotCount - 1 & (uint)local_18; (npc->_vectorDeque1)._offset = dequeIndex; if (dequeIndex == 0) { dequeIndex = dequeSlotCount; } dequeIndex = dequeIndex - 1; local_18 = (float)(dequeIndex >> 1 & uVar2 - 1); local_1c = (npc->_vectorDeque1)._map; if (*(int *)((int)local_1c + (int)local_18 * 4) == 0) { newDequeBlock = operator_new(0x10); *(void **)((int)(npc->_vectorDeque1)._map + (int)local_18 * 4) = newDequeBlock; local_1c = (npc->_vectorDeque1)._map; } iVar3 = *(int *)((int)local_1c + (int)local_18 * 4); *(float *)(iVar3 + (dequeIndex & 1) * 8) = trailVelocityX; *(float *)(iVar3 + 4 + (dequeIndex & 1) * 8) = trailHeight; dequeSize = &(npc->_vectorDeque1)._size; *dequeSize = *dequeSize + 1; (npc->_vectorDeque1)._offset = dequeIndex; uVar2 = (npc->_vectorDeque1)._size; do { if (uVar2 < 0x15) goto LAB_00565560; uVar2 = uVar2 - 1; (npc->_vectorDeque1)._size = uVar2; } while (uVar2 != 0); (npc->_vectorDeque1)._offset = 0; LAB_00565560: iVar3 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; if (iVar3 <= (int)local_30.y) { return; } } while( true ); } (npc->_v1).x = -6.0; (npc->_v1).y = 10.0; (npc->_posOffset).y = 10.0; npc->_state = 6; animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } wantedAnimChar = s_Idle; do { bVar1 = *animNameChar; bVar4 = bVar1 < *wantedAnimChar; if (bVar1 != *wantedAnimChar) { LAB_005655f0: uVar2 = -(uint)bVar4 | 1; goto LAB_005655f5; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < wantedAnimChar[1]; if (bVar1 != wantedAnimChar[1]) goto LAB_005655f0; animNameChar = animNameChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_005655f5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0056562c; } bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0056562c: local_38.y = (npc->_v1).y; local_38.x = 0.0; std::deque::push_back(&npc->_vectorDeque1,&local_38); local_38.y = (npc->_v1).y; local_38.x = 0.0; std::deque::push_back(&npc->_vectorDeque1,&local_38); return; } //@@ 00565680 Entity_NPC::render_v1_layer_frames /* DB: ? called once from Entity_NPC::Render: picks layer frames from V1 (+0xbb0) range 0..4 vs >4, AnimationState::AdvanceLayerPosition, "LayerId out of bounds" */ void __thiscall Entity_NPC::render_v1_layer_frames(Entity_NPC *this) { float fVar1; float fVar2; LayerState *pLVar3; LayerState *layer1; uint segment2Index; int layerId; ANM2 *sprite; float fVar4; float fVar5; float layer2Height; float layer1Height; void *animData; int renderMode; float *segment1Y; uint segmentIndex; fVar5 = (this->_v1).x; renderMode = *(int *)((int)g_game->_room + 0x12bc); if (0.0 <= fVar5) { animData = (this->_sprite)._animState._animData; if (fVar5 <= 4.0) { if ((animData == (void *)0x0) || ((*(int *)((int)(this->_sprite)._animState._animation + 0x80) < 1 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_sprite)._animState._animation + 0x80) < 1)))) goto LAB_005657ec; animData = (this->_sprite)._animState._animData; layerId = *(int *)((int)animData + 0x38); if ((animData == (void *)0x0) || ((layerId < 0 || (*(int *)((int)animData + 0x1c) <= layerId)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar5 = 0.0; } else { if ((animData == (void *)0x0) || ((*(int *)((int)(this->_sprite)._animState._animation + 0x80) < 1 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_sprite)._animState._animation + 0x80) < 1)))) goto LAB_005657ec; animData = (this->_sprite)._animState._animData; layerId = *(int *)((int)animData + 0x38); if ((animData == (void *)0x0) || ((layerId < 0 || (*(int *)((int)animData + 0x1c) <= layerId)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar5 = 2.0; } } else { if (((this->_sprite)._animState._animData == (void *)0x0) || ((*(int *)((int)(this->_sprite)._animState._animation + 0x80) < 1 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_sprite)._animState._animation + 0x80) < 1)))) goto LAB_005657ec; animData = (this->_sprite)._animState._animData; layerId = *(int *)((int)animData + 0x38); if ((animData == (void *)0x0) || ((layerId < 0 || (*(int *)((int)animData + 0x1c) <= layerId)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar5 = 1.0; } *(undefined4 *)((int)(this->_sprite)._animState._layerFrames + layerId * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,layerId,fVar5); LAB_005657ec: fVar5 = (this->_posOffset).y; layer2Height = fVar5; layer1Height = fVar5; if (1 < (this->_vectorDeque1)._size) { segmentIndex = (this->_vectorDeque1)._offset + 1; fVar4 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + (segmentIndex >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4) + 4 + (segmentIndex & 1) * 8); fVar1 = (this->_v1).y; pLVar3 = ANM2::GetLayer(&this->_sprite,(byte *)0x2); (pLVar3->_pos).x = 0.0; (pLVar3->_pos).y = (fVar4 - fVar1) * 0.65; layer1 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); (layer1->_pos).x = (pLVar3->_pos).x; (layer1->_pos).y = (pLVar3->_pos).y; segmentIndex = (this->_vectorDeque1)._offset + 1; layer1Height = (*(float *)(*(int *)((int)(this->_vectorDeque1)._map + (segmentIndex >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4) + 4 + (segmentIndex & 1) * 8) + (this->_posOffset).y) - (this->_v1).y ; layer2Height = layer1Height; if (2 < (this->_vectorDeque1)._size) { segmentIndex = (this->_vectorDeque1)._offset + 2; fVar4 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + (segmentIndex >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4) + 4 + (segmentIndex & 1) * 8); fVar1 = (this->_v1).y; pLVar3 = ANM2::GetLayer(&this->_sprite,(byte *)0x2); (pLVar3->_pos).x = 0.0; (pLVar3->_pos).y = (fVar4 - fVar1) * 0.65; segment2Index = (this->_vectorDeque1)._offset; segmentIndex = segment2Index + 1; segment2Index = segment2Index + 2; fVar4 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & segment2Index >> 1) * 4) + 4 + (segment2Index & 1) * 8); segment1Y = (float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & segmentIndex >> 1) * 4) + 4 + (segmentIndex & 1) * 8); fVar1 = *segment1Y; fVar2 = *segment1Y; pLVar3 = ANM2::GetLayer(&this->_sprite,(byte *)0x2); pLVar3->_flipY = fVar2 <= fVar4 && fVar4 != fVar1; segmentIndex = (this->_vectorDeque1)._offset + 2; fVar4 = *(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & segmentIndex >> 1) * 4) + (segmentIndex & 1) * 8); pLVar3 = ANM2::GetLayer(&this->_sprite,(byte *)0x2); pLVar3->_flipX = 0.0 < fVar4; segmentIndex = (this->_vectorDeque1)._offset + 2; if (*(float *)(*(int *)((int)(this->_vectorDeque1)._map + (segmentIndex >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4) + (segmentIndex & 1) * 8) <= 0.0) { fVar4 = 3.0; } else { fVar4 = -3.0; } pLVar3 = ANM2::GetLayer(&this->_sprite,(byte *)0x2); (pLVar3->_pos).x = fVar4; segmentIndex = (this->_vectorDeque1)._offset + 2; layer2Height = (*(float *)(*(int *)((int)(this->_vectorDeque1)._map + ((this->_vectorDeque1)._mapSize - 1 & segmentIndex >> 1) * 4) + 4 + (segmentIndex & 1) * 8) + (this->_posOffset).y) - (this->_v1).y; } } sprite = &this->_sprite; pLVar3 = ANM2::GetLayer(sprite,(byte *)0x0); if (renderMode == 5) { fVar5 = (fVar5 - 2.0) / 78.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; pLVar3 = ANM2::GetLayer(sprite,(byte *)0x1); fVar5 = (layer1Height - 2.0) / 78.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; pLVar3 = ANM2::GetLayer(sprite,(byte *)0x2); fVar5 = (layer2Height - 2.0) / 78.0; } else { fVar5 = (fVar5 - -2.0) / 18.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; pLVar3 = ANM2::GetLayer(sprite,(byte *)0x1); fVar5 = (layer1Height - -2.0) / 18.0; if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; pLVar3 = ANM2::GetLayer(sprite,(byte *)0x2); fVar5 = (layer2Height - -2.0) / 18.0; } if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; return; } //@@ 00565bc0 NpcAI::ENTITY_HENRY /* NPC AI for entity type 837 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_HENRY(Entity_NPC *npc) { Vector *pVVar1; int iVar2; Game *pGVar3; Manager *pMVar4; int iVar5; uint seed; Entity *pEVar6; float fVar7; float fVar8; Entity_NPC *local_c [2]; iVar5 = npc->_state; local_c[0] = npc; if (iVar5 == 0) { pVVar1 = &npc->_pos; iVar5 = Entity_NPC::FindTargetPit(pVVar1,pVVar1,0xffffffff); pGVar3 = g_game; if (iVar5 < 0) { (**(code **)(*(int *)npc + 0x28))(); return; } if (iVar5 < 0x1c0) { *(undefined2 *)((int)g_game->_room + iVar5 * 2 + 0xe6c) = 5; } iVar2 = *(int *)((int)pGVar3->_room + 0xc); fVar8 = (float)(iVar5 % iVar2) * 40.0 + 40.0; fVar7 = (float)(iVar5 / iVar2) * 40.0 + 120.0; (npc->_targetPosition).x = fVar8; pVVar1->x = fVar8; (npc->_targetPosition).y = fVar7; (npc->_pos).y = fVar7; npc->_state = 3; npc->_entityGridCollisionClass = 0; } else if (iVar5 == 3) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_stateFrame = npc->_stateFrame + ((int)npc->_updateTime - (int)npc->_prevUpdateTime); pMVar4 = g_manager; if (0x1e < npc->_stateFrame) { local_c[0] = (Entity_NPC *)0x18c; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_c[0],1.0,2,0,1.0,0.0); ANM2::Play(&npc->_sprite,(byte *)"Leave",0); npc->_state = 8; } } else if (iVar5 == 8) { iVar5 = Entity::GetIntervalTicks((Entity *)npc,4.0,0.0); if (iVar5 != 0) { seed = Random(); pEVar6 = Game::SpawnEx(g_game,1000,0x85,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,seed,0); (**(code **)(*(int *)pEVar6 + 0xc))(); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); } } fVar7 = (npc->_targetPosition).y; fVar8 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar7 - fVar8; return; } //@@ 00565dd0 FUN_00565dd0 void FUN_00565dd0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x35c) = param_1; return; } //@@ 00565de0 FUN_00565de0 void FUN_00565de0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x424) = param_1; return; } //@@ 00565e00 NpcAI::ENTITY_MOTHER_worm /* DB: 912.30 by the 912 variant table (boss_approx_3) */ void __fastcall NpcAI::ENTITY_MOTHER_worm(Entity_NPC *npc) { EntityPtr EVar1; qword qVar2; byte bVar3; uint uVar4; uint uVar5; EntityPtr segment; int iVar6; Vector *toTarget; int iVar7; uint uVar8; uint uVar9; int iVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; float chainY; float local_34; float velX; float dirY; float dirX; Vector local_20; Vector local_18; std_deque *local_10; uint *flagsHi; EntityPtr *segmentSlot; std_deque *trail; int *trailProxy; if (npc->_state == 0) { qVar2 = npc->_flags; flagsHi = (uint *)((int)&npc->_flags + 4); *flagsHi = *flagsHi | 0x2008; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)qVar2 & 0xfffffffb | 0x80100011; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_state = 3; npc->_visible = 0; uVar4 = Random(); uVar4 = uVar4 % 3 + 6; Entity_NPC::ClearDequeRefs(npc); local_20.x = 0.0; std::deque::resize(uVar4,&local_20); uVar9 = 0; if (uVar4 == 0) { return; } do { uVar5 = Random(); segment = (EntityPtr) Game::SpawnEx(g_game,9,0,&npc->_pos,&g_vectorZero,(Entity *)npc->_spawnerEntity,0, uVar5,0); EVar1 = npc->_spawnerEntity; if (*(EntityPtr *)((int)segment + 0x3bc) != (EntityPtr)0x0) { local_20.x = (float)((int)segment + 0x3bc); std::multiset::erase(&local_20); } *(EntityPtr *)((int)segment + 0x3bc) = EVar1; if (EVar1 != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)segment + 0x3bc)); } (**(code **)(*(int *)segment + 0x3c))(&DAT_00c34cf4,0xffffffff,0xff,0,1); *(undefined4 *)((int)segment + 0x438) = 0x2000; *(undefined4 *)((int)segment + 0x43c) = 0; *(undefined4 *)((int)segment + 0x418) = 0xbdc8b439; uVar5 = Random(); if (uVar9 == 0) { fVar15 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.6; } else { fVar15 = (1.7 - (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 0.1) + (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2; } *(float *)((int)segment + 0x420) = fVar15 * npc->_scale; uVar5 = (npc->_entityDeque)._offset + uVar9; uVar8 = uVar5 & 3; iVar10 = *(int *)((int)(npc->_entityDeque)._map + (uVar5 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); segmentSlot = (EntityPtr *)(iVar10 + uVar8 * 4); if (*(int *)(iVar10 + uVar8 * 4) != 0) { local_20.x = (float)segmentSlot; std::multiset::erase(&local_20); } *segmentSlot = segment; std::multiset::insert(segmentSlot); uVar9 = uVar9 + 1; } while (uVar9 < uVar4); return; } uVar4 = (npc->_entityDeque)._offset; local_20.x = (float)(npc->_entityDeque)._proxy; uVar9 = (npc->_entityDeque)._size + uVar4; iVar10 = 0; while (uVar4 != uVar9) { if ((int *)local_20.x == (int *)0x0) { iVar7 = 0; } else { iVar7 = *(int *)local_20.x; } iVar7 = *(int *)(*(int *)(*(int *)(iVar7 + 4) + (*(int *)(iVar7 + 8) - 1U & uVar4 >> 2) * 4) + (uVar4 & 3) * 4); if ((iVar7 == 0) || (*(int *)(iVar7 + 0x28) != 9)) { iVar7 = 0; } uVar4 = uVar4 + 1; iVar6 = iVar10 + 1; if (iVar7 == 0) { iVar6 = iVar10; } iVar10 = iVar6; } if (iVar10 == 0) { (**(code **)(*(int *)npc + 0x28))(); return; } iVar10 = npc->_projectileDelay; if (-100 < iVar10) { iVar10 = iVar10 - ((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_projectileDelay = iVar10; } if ((npc->_spawnerEntity != (EntityPtr)0x0) && (*(char *)((int)npc->_spawnerEntity + 0x173) == '\0')) { if (0 < iVar10) { fVar15 = (npc->_velocity).y; fVar11 = (npc->_velocity).x; local_10 = (std_deque *)sqrtf(fVar11 * fVar11 + fVar15 * fVar15); fVar15 = ((float)iVar10 - 0.0) / 15.0; if (fVar15 <= 0.0) { fVar15 = 0.0; } if (1.0 <= fVar15) { fVar15 = 1.0; } uVar4 = Random(); fVar11 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20.x = fVar11 + fVar11; fVar11 = cos(local_20.x); fVar12 = sin(local_20.x); uVar4 = Random(); dirX = (npc->_velocity).x; fVar13 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar16 = (fVar11 + fVar11) * fVar13 + dirX; dirY = (npc->_velocity).y; fVar12 = (fVar12 + fVar12) * fVar13 + dirY; fVar11 = sqrtf(dirX * dirX + dirY * dirY); if (0.0 < fVar11) { dirX = (npc->_velocity).x * (1.0 / fVar11); dirY = (npc->_velocity).y * (1.0 / fVar11); } fVar11 = cos(npc->_updateTime * 0.1); local_20.x = fVar11 * 60.0 * 0.017453292; local_18.x = cos(local_20.x); fVar11 = sin(local_20.x); fVar13 = local_18.x * dirY; fVar14 = (fVar15 * 0.120000005 + 0.88) * (float)local_10; local_18.x = (local_18.x * dirX - fVar11 * dirY) + fVar16; local_20.x = fVar11 * dirX + fVar13 + fVar12; (npc->_velocity).x = local_18.x; (npc->_velocity).y = local_20.x; fVar15 = sqrtf(local_20.x * local_20.x + local_18.x * local_18.x); if (0.0 < fVar15) { if (fVar14 <= 5.0) { fVar14 = 5.0; } (npc->_velocity).x = local_18.x * (fVar14 / fVar15); (npc->_velocity).y = local_20.x * (fVar14 / fVar15); } goto LAB_00566573; } velX = (npc->_velocity).x; local_34 = (npc->_velocity).y; local_10 = (std_deque *)sqrtf(velX * velX + local_34 * local_34); EVar1 = npc->_target; fVar15 = ((float)iVar10 - 0.0) / -30.0; if (fVar15 <= 0.0) { fVar15 = 0.0; } if (1.0 <= fVar15) { fVar15 = 1.0; } if (EVar1 != (EntityPtr)0x0) { local_18.y = *(float *)((int)EVar1 + 0x340) - (npc->_pos).y; local_18.x = *(float *)((int)EVar1 + 0x33c) - (npc->_pos).x; if (-0x1e < iVar10) { toTarget = Vector::Resized(&local_18,&local_20,1.0); velX = velX + toTarget->x; (npc->_velocity).x = velX; local_34 = toTarget->y + (npc->_velocity).y; (npc->_velocity).y = local_34; } } fVar11 = (fVar15 * 0.100000024 + 1.0) * (float)local_10; fVar15 = sqrtf(local_34 * local_34 + velX * velX); if (0.0 < fVar15) { if (14.0 <= fVar11) { fVar11 = 14.0; } (npc->_velocity).x = velX * (fVar11 / fVar15); (npc->_velocity).y = local_34 * (fVar11 / fVar15); } if ((-0x3c < npc->_projectileDelay) || (bVar3 = Room::IsPositionInRoom(g_game->_room,&npc->_pos,-10.0), bVar3 != 0)) goto LAB_00566573; } (**(code **)(*(int *)npc + 0x28))(); LAB_00566573: if (npc->_dead == 0) { trail = &npc->_vectorDeque1; local_10 = trail; std::deque::push_back(trail,&npc->_pos); uVar4 = (npc->_vectorDeque1)._size; do { if (uVar4 < 0x41) goto LAB_00566630; uVar4 = uVar4 - 1; (npc->_vectorDeque1)._size = uVar4; } while (uVar4 != 0); (npc->_vectorDeque1)._offset = 0; LAB_00566630: uVar4 = (npc->_vectorDeque1)._offset; fVar15 = (npc->_pos).x; fVar11 = (npc->_pos).y; trailProxy = trail->_proxy; local_20.x = 0.0; if ((npc->_entityDeque)._size != 0) { uVar9 = uVar4 + 1; chainY = fVar11; local_34 = fVar15; if (uVar4 == (npc->_vectorDeque1)._size + uVar4) { uVar9 = uVar4; } do { uVar4 = (npc->_entityDeque)._offset + (int)local_20.x; iVar10 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar4 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar4 & 3) * 4); if ((iVar10 != 0) && (*(int *)(iVar10 + 0x28) == 9)) { *(float *)(iVar10 + 0x360) = fVar15 - *(float *)(iVar10 + 0x33c); *(float *)(iVar10 + 0x364) = fVar11 - *(float *)(iVar10 + 0x340); fVar12 = npc->_scale * 10.0; uVar4 = local_10->_offset; uVar5 = local_10->_size; while ((uVar9 != uVar4 + uVar5 && (0.0 < fVar12))) { if (trailProxy == (int *)0x0) { iVar10 = 0; } else { iVar10 = *trailProxy; } iVar10 = *(int *)(*(int *)(iVar10 + 4) + (*(int *)(iVar10 + 8) - 1U & uVar9 >> 1) * 4); fVar11 = *(float *)(iVar10 + 4 + (uVar9 & 1) * 8) - fVar11; fVar15 = *(float *)(iVar10 + (uVar9 & 1) * 8) - fVar15; fVar13 = sqrtf(fVar11 * fVar11 + fVar15 * fVar15); if (fVar12 < fVar13) { if (0.0 < fVar13) { fVar15 = fVar15 * (fVar12 / fVar13); fVar11 = fVar11 * (fVar12 / fVar13); } fVar12 = 0.0; fVar15 = local_34 + fVar15; fVar11 = chainY + fVar11; chainY = fVar11; local_34 = fVar15; } else { fVar12 = fVar12 - fVar13; uVar9 = uVar9 + 1; fVar15 = local_34 + fVar15; fVar11 = chainY + fVar11; chainY = fVar11; local_34 = fVar15; } } } local_20.x = (float)((int)local_20.x + 1); } while ((uint)local_20.x < (npc->_entityDeque)._size); } } else { uVar4 = 0; if ((npc->_entityDeque)._size != 0) { do { uVar9 = (npc->_entityDeque)._offset + uVar4; iVar10 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar9 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar9 & 3) * 4); if ((iVar10 != 0) && (*(int *)(iVar10 + 0x28) == 9)) { *(undefined4 *)(iVar10 + 0x438) = 0; *(undefined4 *)(iVar10 + 0x43c) = 0; *(undefined1 *)(iVar10 + 0x173) = 1; } uVar4 = uVar4 + 1; } while (uVar4 < (npc->_entityDeque)._size); return; } } return; } //@@ 00566810 NpcAI::ENTITY_MOTHER_ball /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 912.100 by the 912 variant table (boss_approx_3) */ void __fastcall NpcAI::ENTITY_MOTHER_ball(Entity_NPC *npc) { byte isVulnerable; char cVar1; uint uVar2; LayerState *layer; int iVar3; Vector *pVVar4; Entity *tmpEntity; Vector *normalizedDir; EntityRef *damageSource; uint savedFlagsHigh; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; float fVar6; float fVar7; float spinSpeed; undefined1 *puVar8; float fVar9; undefined1 auStack_110 [4]; Vector local_10c; Vector *local_104; Vector scratchVec; undefined1 local_f8 [8]; float local_f0; Vector tmpVec; ColorMod local_e4; ProjectileParams projectileParams; undefined1 uStack_20; uint local_c; void *collisionPoints; float *configMass; uint *flagsHigh; bool isFloorBounce; Manager *manager; qword oldFlags; EntityPtr parent; ColorMod *pulseColor; undefined4 savedFlagsHigh; local_c = __security_cookie ^ (uint)auStack_110; if (npc->_aiCallPhase == 3) { tmpEntity = npc->_collisionEntity; iVar3 = tmpEntity->_type; local_e4._offset[1] = (float)npc; if (iVar3 == 1) { local_10c.x = (tmpEntity->_pos).y - (npc->_pos).y; local_f8._0_4_ = (tmpEntity->_pos).x - (npc->_pos).x; fVar6 = sqrtf(local_10c.x * local_10c.x + (float)local_f8._0_4_ * (float)local_f8._0_4_); if (fVar6 <= 0.0) { fVar6 = (float)local_f8._0_4_; } else { local_10c.x = (10.0 / fVar6) * local_10c.x; fVar6 = (10.0 / fVar6) * (float)local_f8._0_4_; } fVar7 = tmpEntity->_speedMultiplier; (tmpEntity->_velocity).y = local_10c.x * fVar7 + (tmpEntity->_velocity).y; (tmpEntity->_velocity).x = fVar6 * fVar7 + (tmpEntity->_velocity).x; local_e4._colorize[0] = (npc->_pos).x; local_e4._colorize[1] = (npc->_pos).y; local_e4._colorize[2] = (npc->_velocity).x; local_10c.x = *(float *)(*(int *)npc->_collisionEntity + 0x20); local_e4._tint[0] = (float)npc->_type; local_e4._tint[1] = (float)npc->_variant; local_e4._tint[2] = (float)npc->_spawnerType; local_e4._tint[3] = (float)npc->_spawnerVariant; local_e4._colorize[3] = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { savedFlagsHigh = 0; } else { savedFlagsHigh = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_e4._offset[0] = (float)(savedFlagsHigh | (npc->_flags & 0x100) != 0 | uVar2); (*(code *)local_10c.x)(npc->_collisionDamage,0,0,&local_e4,0x1e); npc->_collisionResult = 0; return; } if (iVar3 == 3) { iVar3 = tmpEntity->_variant; if ((((iVar3 != 0x3e) && (iVar3 != 0x43)) && (iVar3 != 0xd3)) && (iVar3 != 100)) { return; } local_f8._0_4_ = (tmpEntity->_pos).y - (npc->_pos).y; local_10c.x = (tmpEntity->_pos).x - (npc->_pos).x; fVar7 = sqrtf((float)local_f8._0_4_ * (float)local_f8._0_4_ + local_10c.x * local_10c.x); fVar6 = (float)local_f8._0_4_; if (0.0 < fVar7) { local_10c.x = local_10c.x * (10.0 / fVar7); fVar6 = (float)local_f8._0_4_ * (10.0 / fVar7); } fVar7 = tmpEntity->_speedMultiplier; (tmpEntity->_velocity).x = local_10c.x * fVar7 + (tmpEntity->_velocity).x; (tmpEntity->_velocity).y = fVar6 * fVar7 + (tmpEntity->_velocity).y; local_e4._colorize[0] = (npc->_pos).x; local_e4._colorize[1] = (npc->_pos).y; local_e4._colorize[2] = (npc->_velocity).x; local_10c.x = *(float *)(*(int *)npc->_collisionEntity + 0x20); local_e4._tint[0] = (float)npc->_type; local_e4._tint[1] = (float)npc->_variant; local_e4._tint[2] = (float)npc->_spawnerType; local_e4._tint[3] = (float)npc->_spawnerVariant; local_e4._colorize[3] = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { savedFlagsHigh = 0; } else { savedFlagsHigh = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_e4._offset[0] = (float)(uVar2 | savedFlagsHigh | (uint)((npc->_flags & 0x100) != 0)); (*(code *)local_10c.x)(npc->_collisionDamage,0,0,&local_e4,0x1e); npc->_collisionResult = 0; return; } if (0x3dd < iVar3 - 10U) { return; } if (npc->_subtype != 0) { return; } isVulnerable = Entity::IsVulnerableEnemy(tmpEntity,(Entity *)0x0); if ((isVulnerable != 0) && (cVar1 = (**(code **)(*(int *)npc->_collisionEntity + 0x4c))(), cVar1 == '\0')) { local_e4._colorize[0] = (npc->_pos).x; local_e4._colorize[1] = (npc->_pos).y; local_e4._colorize[2] = (npc->_velocity).x; local_10c.x = *(float *)(*(int *)npc->_collisionEntity + 0x20); local_e4._tint[0] = (float)npc->_type; local_e4._tint[1] = (float)npc->_variant; local_e4._tint[2] = (float)npc->_spawnerType; local_e4._tint[3] = (float)npc->_spawnerVariant; local_e4._colorize[3] = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { savedFlagsHigh = 0; } else { savedFlagsHigh = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_e4._offset[0] = (float)(uVar2 | savedFlagsHigh | (uint)((npc->_flags & 0x100) != 0)); (*(code *)local_10c.x)(0x42200000,0,0,&local_e4,0x1e); } npc->_collisionResult = 0; return; } if (npc->_state == 0) { oldFlags = npc->_flags; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2008; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x80100011; npc->_aiCallFlags = 4; savedFlagsHigh = Random(); npc->_state = 3; npc->_entityCollisionClass = 4; npc->_renderDepthOffset = 60.0; (npc->_v1).x = (float)((double)(int)savedFlagsHigh + __uint_to_double_fixup[-((int)savedFlagsHigh >> 0x1f)]) * 2.3283064e-10 * 360.0; fVar9 = g_colorGreenSplat._tint[3]; fVar7 = g_colorGreenSplat._tint[2]; fVar6 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar6; (npc->_splatColor)._tint[2] = fVar7; (npc->_splatColor)._tint[3] = fVar9; fVar9 = g_colorGreenSplat._colorize[3]; fVar7 = g_colorGreenSplat._colorize[2]; fVar6 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar6; (npc->_splatColor)._colorize[2] = fVar7; (npc->_splatColor)._colorize[3] = fVar9; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } iVar3 = npc->_subtype; if (iVar3 == 0) { ANM2::Play(&npc->_sprite,s_Idle,0); iVar3 = *(int *)npc; (npc->_posOffset).y = -35.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._colorize[3] = 0.0; local_e4._offset[0] = 0.0; local_e4._offset[1] = 0.0; local_e4._offset[2] = 0.0; local_e4._tint[0] = 0.03; local_e4._tint[1] = 0.03; local_e4._tint[2] = 0.03; local_e4._tint[3] = 1.0; (**(code **)(iVar3 + 0x3c))(&local_e4,6,0xff,1,1); savedFlagsHigh = 0; fVar6 = g_vectorOne.y * 0.8; (npc->_sprite)._scale.x = g_vectorOne.x * 0.8; (npc->_sprite)._scale.y = fVar6; collisionPoints = (npc->_collisionPoints)._begin; if ((int)(npc->_collisionPoints)._end - (int)collisionPoints >> 3 == 0) { return; } do { *(float *)((int)collisionPoints + savedFlagsHigh * 8) = *(float *)((int)collisionPoints + savedFlagsHigh * 8) * 0.3; *(float *)((int)collisionPoints + savedFlagsHigh * 8 + 4) = *(float *)((int)collisionPoints + savedFlagsHigh * 8 + 4) * 0.3; savedFlagsHigh = savedFlagsHigh + 1; } while (savedFlagsHigh < (uint)((int)(npc->_collisionPoints)._end - (int)(npc->_collisionPoints)._begin >> 3)); return; } if (iVar3 == 1) { ANM2::Play(&npc->_sprite,s_Idle2,0); (npc->_posOffset).y = -18.0; npc->_stateFrame = 3000; return; } if (iVar3 == 2) { ANM2::Play(&npc->_sprite,&DAT_00b1d43c,0); (npc->_posOffset).y = -12.0; savedFlagsHigh = Random(); (npc->_sprite)._flipX = ~(byte)savedFlagsHigh & 1; npc->_stateFrame = 0x1e; return; } return; } if (npc->_dead != 0) { return; } if (npc->_subtype != 0) { if (npc->_subtype == 1) { fVar6 = (npc->_velocity).y; fVar7 = (npc->_velocity).x; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); puVar8 = (undefined1 *)(fVar6 * 1.5); if (32.0 <= (float)puVar8) { puVar8 = &DAT_42000000; } local_104 = (Vector *) normalize_angle_degrees((float)puVar8 * npc->_speedMultiplier + (npc->_v1).x); (npc->_v1).x = (float)local_104; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = (float)local_104; iVar3 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; npc->_stateFrame = iVar3; if (((npc->_collidesWithGrid != 0) || (iVar3 < 1)) && (npc->_dead == 0)) { savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; damageSource = EntityRef::EntityRef((EntityRef *)&local_e4); (**(code **)(*(int *)npc + 0x24))(damageSource); ENTITY_MOTHER_ball_burst(npc); } npc->_entityGridCollisionClass = 3; iVar3 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar3 == 0) { return; } if (npc->_entityRef != (EntityPtr)0x0) { return; } savedFlagsHigh = Random(); scratchVec.x = (npc->_velocity).x * 0.5; scratchVec.y = (npc->_velocity).y * 0.5; pVVar4 = MusicManager::RandomVector(&tmpVec); local_104 = (Vector *)pVVar4->x; local_10c.x = pVVar4->y; uVar2 = Random(); fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; local_f8._4_4_ = (float)local_104 * 13.0 * fVar6 + (npc->_pos).x; local_f0 = local_10c.x * 13.0 * fVar6 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,1000,0x6f,(Vector *)(local_f8 + 4),&scratchVec,(Entity *)npc, 0,savedFlagsHigh,0); (tmpEntity->_posOffset).x = (npc->_posOffset).x; (tmpEntity->_posOffset).y = (npc->_posOffset).y; Color::Color(0x3f5eb852); local_e4._offset[0] = 0.5493272; local_e4._offset[1] = 0.6969627; local_e4._offset[2] = 0.45951557; (**(code **)(*(int *)tmpEntity + 0x3c))(extraout_ECX_00,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._scale.x = 1.2; (tmpEntity->_sprite)._scale.y = 1.2; (tmpEntity->_sprite)._playbackSpeed = 0.7; } else { fVar6 = (npc->_updateTime - 0.0) / 60.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } npc->_friction = (1.0 - fVar6 * 0.3) * npc->_friction; fVar6 = (npc->_velocity).y; fVar7 = (npc->_velocity).x; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); puVar8 = (undefined1 *)(fVar6 * 1.5); if (32.0 <= (float)puVar8) { puVar8 = &DAT_42000000; } local_104 = (Vector *) normalize_angle_degrees((float)puVar8 * npc->_speedMultiplier + (npc->_v1).x); (npc->_v1).x = (float)local_104; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = (float)local_104; iVar3 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + npc->_stateFrame; npc->_stateFrame = iVar3; if (((npc->_collidesWithGrid != 0) || (iVar3 < 1)) && (npc->_dead == 0)) { savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; damageSource = EntityRef::EntityRef((EntityRef *)&local_e4); (**(code **)(*(int *)npc + 0x24))(damageSource); ENTITY_MOTHER_ball_burst(npc); } npc->_entityGridCollisionClass = 3; iVar3 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar3 == 0) { return; } if (npc->_entityRef != (EntityPtr)0x0) { return; } savedFlagsHigh = Random(); scratchVec.x = (npc->_velocity).x * 0.5; scratchVec.y = (npc->_velocity).y * 0.5; pVVar4 = MusicManager::RandomVector(&tmpVec); local_104 = (Vector *)pVVar4->x; local_10c.x = pVVar4->y; uVar2 = Random(); fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; local_f8._4_4_ = (float)local_104 * 8.0 * fVar6 + (npc->_pos).x; local_f0 = local_10c.x * 8.0 * fVar6 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,1000,0x6f,(Vector *)(local_f8 + 4),&scratchVec,(Entity *)npc, 0,savedFlagsHigh,0); (tmpEntity->_posOffset).x = (npc->_posOffset).x; (tmpEntity->_posOffset).y = (npc->_posOffset).y; Color::Color(0x3f5eb852); local_e4._offset[0] = 0.5493272; local_e4._offset[1] = 0.6969627; local_e4._offset[2] = 0.45951557; (**(code **)(*(int *)tmpEntity + 0x3c))(extraout_ECX_01,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._scale.x = 1.0; (tmpEntity->_sprite)._scale.y = 1.0; (tmpEntity->_sprite)._playbackSpeed = 1.0; } tmpEntity->_renderDepthOffset = -50.0; (**(code **)(*(int *)tmpEntity + 0xc))(); return; } fVar6 = (npc->_targetPosition).y; local_104 = &npc->_targetPosition; fVar7 = (npc->_targetPosition).x; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); fVar6 = fVar6 - 2.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } local_10c.x = fVar6 + 0.0; fVar6 = local_10c.x * 6.0 + 1.0; if (local_10c.x == 1.0) { fVar6 = fVar6 + fVar6; } fVar6 = sin(((npc->_updateTime + npc->_updateTime) * 3.1415927) / (fVar6 * 30.0)); pulseColor = &local_e4; local_e4._colorize[3] = 0.0; local_e4._offset[0] = (fVar6 + 1.0) * 0.5 * local_10c.x; local_e4._offset[2] = local_e4._offset[0] * 0.25; local_e4._tint[0] = 1.0 - local_e4._offset[2]; local_e4._tint[1] = 1.0 - local_e4._offset[0] * 0.2; local_e4._tint[2] = 1.0 - local_e4._offset[0] * 0.3; local_e4._tint[3] = 1.0; local_e4._colorize[0] = 0.0; local_e4._colorize[1] = 0.0; local_e4._colorize[2] = 0.0; local_e4._offset[1] = local_e4._offset[0] * 0.5; local_e4._offset[0] = local_e4._offset[0] * 0.35; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,pulseColor); local_f8._0_4_ = 1.0; local_10c.x = npc->_speedMultiplier * 0.04 + (npc->_sprite)._scale.x; pVVar4 = &local_10c; if (1.0 <= local_10c.x) { pVVar4 = (Vector *)local_f8; } fVar6 = pVVar4->x * g_vectorOne.x; (npc->_sprite)._scale.y = pVVar4->x * g_vectorOne.y; (npc->_sprite)._scale.x = fVar6; fVar6 = (npc->_velocity).y; fVar7 = (npc->_velocity).x; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); spinSpeed = fVar6 * 1.5; if (32.0 <= spinSpeed) { spinSpeed = (float)&DAT_42000000; } local_10c.x = normalize_angle_degrees(spinSpeed * npc->_speedMultiplier + (npc->_v1).x); (npc->_v1).x = local_10c.x; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_rotation = local_10c.x; npc->_friction = npc->_friction * 0.85; fVar6 = npc->_speedMultiplier; fVar7 = (npc->_targetPosition).y; (npc->_velocity).x = fVar6 * (npc->_targetPosition).x + (npc->_velocity).x; (npc->_velocity).y = fVar7 * fVar6 + (npc->_velocity).y; iVar3 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar3 != 0) { savedFlagsHigh = Random(); local_f8._4_4_ = (npc->_velocity).x * 0.5; local_f0 = (npc->_velocity).y * 0.5; pVVar4 = MusicManager::RandomVector(&tmpVec); local_10c.x = pVVar4->x; local_f8._0_4_ = pVVar4->y; uVar2 = Random(); fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; scratchVec.x = local_10c.x * 30.0 * fVar6 + (npc->_pos).x; scratchVec.y = (float)local_f8._0_4_ * 30.0 * fVar6 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,1000,0x6f,&scratchVec,(Vector *)(local_f8 + 4),(Entity *)npc,0, savedFlagsHigh,0); (tmpEntity->_posOffset).x = (npc->_posOffset).x; (tmpEntity->_posOffset).y = (npc->_posOffset).y; Color::Color(0x3f5eb852); local_e4._offset[0] = 0.5493272; local_e4._offset[1] = 0.6969627; local_e4._offset[2] = 0.45951557; (**(code **)(*(int *)tmpEntity + 0x3c))(extraout_ECX,0xffffffff,0xff,0,1); iVar3 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.x = 2.0; (tmpEntity->_sprite)._scale.y = 2.0; (tmpEntity->_sprite)._playbackSpeed = 0.5; tmpEntity->_renderDepthOffset = -50.0; (**(code **)(iVar3 + 0xc))(); } if ((npc->_target == (EntityPtr)0x0) || (configMass = (float *)((int)npc->_config + 0x44), npc->_mass < *configMass || npc->_mass == *configMass)) goto LAB_0056750b; if ((npc->_targetPosition).y <= 0.0) { parent = npc->_parent; if (parent == (EntityPtr)0x0) goto LAB_0056750b; local_10c.x = *(float *)((int)parent + 0x33c) - (npc->_pos).x; local_10c.y = *(float *)((int)parent + 0x340) - (npc->_pos).y; Vector::Normalize(&local_10c); if (-0.2 <= local_10c.y) goto LAB_0056750b; fVar6 = (npc->_targetPosition).x; scratchVec.x = local_10c.x * 3.0 * npc->_speedMultiplier + fVar6; fVar7 = (npc->_targetPosition).y; scratchVec.y = local_10c.y * 3.0 * npc->_speedMultiplier + fVar7; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); pVVar4 = (Vector *)(local_f8 + 4); } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (tmpEntity->_pos).x - (npc->_pos).x; local_10c.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalize(&local_10c); if (local_10c.y <= 0.2) goto LAB_0056750b; fVar6 = (npc->_targetPosition).x; scratchVec.x = local_10c.x * 3.0 * npc->_speedMultiplier + fVar6; fVar7 = (npc->_targetPosition).y; scratchVec.y = local_10c.y * 3.0 * npc->_speedMultiplier + fVar7; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); pVVar4 = &tmpVec; } pVVar4 = Vector::Resized(&scratchVec,pVVar4,fVar6); (npc->_targetPosition).x = pVVar4->x; (npc->_targetPosition).y = pVVar4->y; LAB_0056750b: if (npc->_collidesWithGrid != 0) { if (((npc->_gridCollisionNormal).y <= 0.0) || (0.8 <= ABS((npc->_gridCollisionNormal).x))) { isFloorBounce = false; } else { isFloorBounce = true; } if (npc->_dead == 0) { if (isFloorBounce) { Game::ShakeScreen(g_game,8); manager = g_manager; local_10c.x = 3.92364e-44; seed_fart_sound_override((int *)&local_10c); SoundEffects::Play(&manager->_sfxManager,(int)local_10c.x,0.8,2,0,1.0,0.0); ProjectileParams::ProjectileParams(&projectileParams); projectileParams.FallingAccelModifier = -0.08; uStack_20 = 1; projectileParams.Scale = 2.0; Color::operator_assign((Color *)&projectileParams.Color,(ColorMod *)&DAT_00c34ed8); projectileParams.CircleAngle = 0.0; scratchVec.x = 8.0; scratchVec.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projectileParams); Color::operator_assign((Color *)&projectileParams.Color,(ColorMod *)&DAT_00c34d20); projectileParams.Scale = 1.5; scratchVec.x = 6.0; scratchVec.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec,9,&projectileParams); } else { Game::ShakeScreen(g_game,4); manager = g_manager; local_10c.x = 4.2039e-44; seed_fart_sound_override((int *)&local_10c); SoundEffects::Play(&manager->_sfxManager,(int)local_10c.x,0.8,2,0,1.0,0.0); } pVVar4 = local_104; local_104 = (Vector *)sqrtf(local_104->x * local_104->x + local_104->y * local_104->y); fVar6 = (npc->_gridCollisionNormal).x; fVar7 = (npc->_gridCollisionNormal).y; fVar9 = fVar6 * pVVar4->x + fVar7 * pVVar4->y; scratchVec.x = pVVar4->x - (fVar6 + fVar6) * fVar9; scratchVec.y = pVVar4->y - (fVar7 + fVar7) * fVar9; normalizedDir = Vector::Normalized(&scratchVec,&tmpVec); fVar7 = 0.3; pVVar4->x = normalizedDir->x; local_10c.x = normalizedDir->y; pVVar4->y = local_10c.x; fVar6 = (npc->_targetPosition).y; if (ABS(fVar6) < 0.3) { if (fVar6 <= 0.0) { fVar7 = -0.3; } (npc->_targetPosition).y = fVar7; Vector::Normalize(pVVar4); local_10c.x = pVVar4->y; } fVar6 = sqrtf(local_10c.x * local_10c.x + pVVar4->x * pVVar4->x); if (0.0 < fVar6) { pVVar4->x = ((float)local_104 / fVar6) * pVVar4->x; pVVar4->y = local_10c.x * ((float)local_104 / fVar6); } fVar6 = (npc->_gridCollisionVelocity).y; fVar7 = (npc->_gridCollisionVelocity).x; fVar6 = sqrtf(fVar7 * fVar7 + fVar6 * fVar6); pVVar4 = Vector::Resized(pVVar4,&tmpVec,fVar6); (npc->_velocity).x = pVVar4->x; (npc->_velocity).y = pVVar4->y; npc->_mass = *(float *)((int)npc->_config + 0x44); return; } } return; } //@@ 00567d50 NpcAI::ENTITY_MOTHER_ball_burst /* WARNING: Type propagation algorithm not settling */ /* DB: the 912.100 ball pops: called by ENTITY_MOTHER and the ball AI when npc+0xbec is 912.100; sound 0x1c, spawn_blood_explosion, ShakeScreen(10), spawn_gibs, spawn_small_maggot */ void __fastcall NpcAI::ENTITY_MOTHER_ball_burst(Entity_NPC *npc) { int iVar1; Entity_NPC *pEVar2; EntityRef *sourceRef; int iVar3; uint uVar4; Entity *spawned; code *extraout_EDX; int iVar5; code *extraout_EDX_00; code *extraout_EDX_01; Vector *npcPos; int iVar6; int iVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; EntityRef damageSource; Vector spawnPos; Vector spawnVelocity; Vector splatPos; Vector local_58; Vector local_50; Vector local_48; Vector local_40; Entity_NPC *local_38; float local_34; float local_30; EntityPtr *local_2c; float local_28; undefined1 *local_24; undefined1 *local_20; float local_1c; Vector *local_18; float local_14; float local_10; float local_c [2]; void *currentRoom; EntityPtr entityRef; EntityPtr *entityRefSlot; Manager *manager; Room *room; int *roomData; entityRef = npc->_entityRef; local_38 = npc; if (npc->_subtype != 0) { if (npc->_subtype != 1) { if (entityRef == (EntityPtr)0x0) { uVar4 = Random(); spawn_small_maggot(&npc->_pos,-15.0,&g_vectorZero, -8.0 - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 4.0); return; } sourceRef = EntityRef::EntityRef(&damageSource); (*extraout_EDX_01)(0x41f00000,0,0,sourceRef,0x1e); return; } if (entityRef != (EntityPtr)0x0) { if (*(int *)((int)entityRef + 0x188) != 0) { sourceRef = EntityRef::EntityRef(&damageSource); (*extraout_EDX_00)(0x42700000,0,0,sourceRef,0x1e); } manager = g_manager; local_c[0] = 3.92364e-44; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&manager->_sfxManager,(int)local_c[0],1.0,2,0,1.0,0.0); local_40.x = (npc->_velocity).x * 0.5; local_40.y = (npc->_velocity).y * 0.5; spawn_blood_explosion(4,&npc->_pos,&npc->_posOffset,&npc->_splatColor,&local_40); Game::ShakeScreen(g_game,10); return; } local_34 = 0.0; do { pEVar2 = local_38; local_2c = (EntityPtr *)((float)(int)local_34 * 60.0 * 0.017453292); local_c[0] = cos((float)local_2c); fVar10 = sin((float)local_2c); local_1c = (pEVar2->_pos).x; local_18 = (Vector *)(pEVar2->_pos).y; room = g_game->_room; local_14 = local_c[0] * 0.0 - fVar10; local_30 = fVar10 * 0.0 + local_c[0]; iVar7 = (int)((local_1c - 40.0) / 40.0 + 0.5); local_50.y = (local_30 * 120.0 + (float)local_18) - (float)local_18; iVar5 = (int)(((float)local_18 - 120.0) / 40.0 + 0.5); local_2c = (EntityPtr *)((local_14 * 120.0 + local_1c) - local_1c); local_10 = 0.0; local_28 = (float)((uint)(0.0 < (float)local_2c) * 2 + -1); local_c[0] = (float)((uint)(0.0 < local_50.y) * 2 + -1); if (((float)local_2c != g_vectorZero.x) || (local_50.y != g_vectorZero.y)) { local_20 = (undefined1 *)(iVar5 * 0x28); local_24 = (undefined1 *)(iVar7 * 0x28); local_48.y = (float)((int)local_c[0] * 0x28); local_58.y = (float)((int)local_28 * 0x28); do { if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar5 < 0)) || (room->_gridHeight <= iVar5)) { iVar6 = -1; } else { iVar6 = iVar5 * room->_gridWidth + iVar7; } uVar4 = Room::GetGridCollision(room,iVar6); if ((uVar4 == 4) || (uVar4 == 5)) break; fVar10 = INFINITY; if ((float)local_2c == 0.0) { fVar11 = INFINITY; } else { fVar11 = ((float)(int)(local_24 + ((int)local_28 + 2) * 0x14) - local_1c) / (float)local_2c; } if (local_50.y != 0.0) { fVar10 = ((float)(int)(local_20 + ((int)local_c[0] + 6) * 0x14) - (float)local_18) / local_50.y; } if (fVar10 <= fVar11) { iVar5 = iVar5 + (int)local_c[0]; local_20 = (undefined1 *)local_48.y + (int)local_20; } else { iVar7 = iVar7 + (int)local_28; local_24 = local_24 + (int)local_58.y; fVar10 = fVar11; } local_10 = fVar10 + local_10; local_1c = local_10 * (float)local_2c + (local_38->_pos).x; local_18 = (Vector *)(local_10 * local_50.y + (local_38->_pos).y); } while (local_10 < 1.0); } if (1.0 <= local_10) { uVar4 = Random(); pEVar2 = local_38; local_40.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 3.0; local_40.y = local_40.x * local_30; local_40.x = local_40.x * local_14; splatPos.x = local_14 * 4.0 + (local_38->_pos).x; splatPos.y = local_30 * 4.0 + (local_38->_pos).y; uVar4 = Random(); spawned = Game::Spawn(g_game,1000,2,&splatPos,&local_40,(Entity *)0x0,4,uVar4); (**(code **)(*(int *)spawned + 0x3c))(&pEVar2->_splatColor,0xffffffff,0xff,0,1); (spawned->_sprite)._offset.x = (pEVar2->_posOffset).x; (spawned->_sprite)._offset.y = (pEVar2->_posOffset).y; spawned->_renderDepthOffset = 10.0; uVar4 = Random(); spawnVelocity.x = local_14 * 10.0; spawnVelocity.y = local_30 * 10.0; spawnPos.x = local_14 * 6.0 + (pEVar2->_pos).x; spawnPos.y = local_30 * 6.0 + (pEVar2->_pos).y; spawned = Game::Spawn(g_game,0x390,100,&spawnPos,&spawnVelocity, (Entity *)pEVar2->_spawnerEntity,2,uVar4); (spawned->_targetPosition).x = local_14; (spawned->_targetPosition).y = local_30; entityRefSlot = &spawned[2]._minecart; entityRef = pEVar2->_entityRef; if (spawned[2]._minecart != (EntityPtr)0x0) { local_48.y = (float)entityRefSlot; std::multiset::erase(&local_48.y); } *entityRefSlot = entityRef; if (entityRef != (EntityPtr)0x0) { std::multiset::insert(entityRefSlot); } (**(code **)(*(int *)spawned + 0xc))(); if (*entityRefSlot != (EntityPtr)0x0) { *(undefined4 *)&spawned[1].field_0x4 = 4; } } local_34 = (float)((int)local_34 + 1); if (5 < (int)local_34) { return; } } while( true ); } local_30 = 1.0; if (entityRef != (EntityPtr)0x0) { if (*(int *)((int)entityRef + 0x188) != 0) { sourceRef = EntityRef::EntityRef(&damageSource); (*extraout_EDX)(0x43c80000,0,0,sourceRef,0x1e); } local_30 = 1.5; } local_18 = &npc->_pos; local_c[0] = 0.0; do { npcPos = local_18; local_34 = (float)(int)local_c[0] * 45.0 * 0.017453292; local_10 = cos(local_34); fVar8 = sin(local_34); fVar10 = npcPos->x; fVar11 = npcPos->y; local_28 = fVar8 * 0.0 + local_10; currentRoom = g_game->_room; local_10 = (local_10 * 0.0 - fVar8) * local_30; iVar5 = (int)((fVar10 - 40.0) / 40.0 + 0.5); fVar12 = (local_28 * 160.0 + fVar11) - fVar11; fVar13 = (local_10 * 160.0 + fVar10) - fVar10; fVar8 = 0.0; iVar7 = (uint)(0.0 < fVar13) * 2; local_14 = (float)(iVar7 + -1); iVar6 = (int)((fVar11 - 120.0) / 40.0 + 0.5); local_20 = (undefined1 *)((uint)(0.0 < fVar12) * 2 + -1); if ((fVar13 != g_vectorZero.x) || (fVar12 != g_vectorZero.y)) { roomData = *(int **)(*(int *)((int)currentRoom + 4) + 0x10); local_24 = (undefined1 *)(iVar6 * 0x28); local_1c = (float)(iVar5 * 0x28); local_2c = (EntityPtr *)((int)local_20 * 0x28); local_34 = (float)((int)local_14 * 0x28); do { if ((((iVar5 < 0) || (*(int *)((int)currentRoom + 0xc) <= iVar5)) || (iVar6 < 0)) || (*(int *)((int)currentRoom + 0x10) <= iVar6)) { iVar3 = -1; } else { iVar3 = iVar6 * *(int *)((int)currentRoom + 0xc) + iVar5; } if (((roomData == (int *)0x0) || (roomData[2] != 0x10)) || (*roomData != 0x23)) { if (iVar3 < 0) { iVar3 = 4; } else { iVar1 = *(int *)((int)currentRoom + iVar3 * 4 + 0x24); if (iVar1 == 0) { iVar1 = *(int *)((int)currentRoom + iVar3 * 4 + 0x76c); if (iVar1 - 3000U < 1000) { iVar3 = 1; } else { iVar3 = 0; if (999 < iVar1) { iVar3 = 3; } } } else { iVar3 = *(int *)(iVar1 + 0x3c); } } } else { iVar3 = 0; } if ((iVar3 == 4) || (iVar3 == 5)) break; fVar9 = INFINITY; if (fVar13 == 0.0) { fVar10 = INFINITY; } else { fVar10 = ((float)((int)local_1c + (iVar7 + 1) * 0x14) - fVar10) / fVar13; } if (fVar12 != 0.0) { fVar9 = ((float)(int)(local_24 + ((int)local_20 * 5 + 0x1e) * 4) - fVar11) / fVar12; } if (fVar9 <= fVar10) { iVar6 = iVar6 + (int)local_20; local_24 = &local_2c->field_0x0 + (int)local_24; } else { iVar5 = iVar5 + (int)local_14; local_1c = (float)((int)local_1c + (int)local_34); fVar9 = fVar10; } fVar8 = fVar8 + fVar9; fVar10 = fVar8 * fVar13 + local_18->x; fVar11 = fVar8 * fVar12 + local_18->y; } while (fVar8 < 1.0); npcPos = local_18; } if (1.0 <= fVar8) { uVar4 = Random(); local_48.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 3.0; local_48.y = local_48.x * local_28; local_48.x = local_48.x * local_10; local_58.x = local_10 * 4.0 + npcPos->x; local_58.y = local_28 * 4.0 + npcPos->y; uVar4 = Random(); spawned = Game::Spawn(g_game,1000,2,&local_58,&local_48,(Entity *)0x0,4,uVar4); pEVar2 = local_38; (**(code **)(*(int *)spawned + 0x3c))(&local_38->_splatColor,0xffffffff,0xff,0,1); (spawned->_sprite)._offset.x = (pEVar2->_posOffset).x; (spawned->_sprite)._offset.y = (pEVar2->_posOffset).y; spawned->_renderDepthOffset = 10.0; uVar4 = Random(); local_50.x = local_10 * 10.0; local_50.y = local_28 * 10.0; local_40.x = local_10 * 6.0 + npcPos->x; local_40.y = local_28 * 6.0 + npcPos->y; spawned = Game::Spawn(g_game,0x390,100,&local_40,&local_50,(Entity *)pEVar2->_spawnerEntity,1, uVar4); (spawned->_targetPosition).x = local_10; (spawned->_targetPosition).y = local_28; entityRefSlot = &spawned[2]._minecart; entityRef = pEVar2->_entityRef; if (spawned[2]._minecart != (EntityPtr)0x0) { local_2c = entityRefSlot; std::multiset::erase(&local_2c); } *entityRefSlot = entityRef; if (entityRef != (EntityPtr)0x0) { std::multiset::insert(entityRefSlot); } (**(code **)(*(int *)spawned + 0xc))(); if (*entityRefSlot != (EntityPtr)0x0) { uVar4 = Random(); *(uint *)&spawned[1].field_0x4 = uVar4 % 6 + 8; } } local_c[0] = (float)((int)local_c[0] + 1); if (7 < (int)local_c[0]) { spawn_gibs(local_18,10,40.0,(uint *)((int)local_38->_config + 0x60),(Entity *)local_38, &local_38->_splatColor,&g_vectorZero,3.0); manager = g_manager; local_c[0] = 3.92364e-44; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&manager->_sfxManager,(int)local_c[0],1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0x12); return; } } while( true ); } //@@ 005688c0 NpcHelper::mother_set_collision_class /* DB: ECX = Mother npc: sets _entityCollisionClass (0x188) to arg; for subtype 0 also on the two linked parts from the deque at +0xbf4 (indices +0xbfc+1/+2); NpcAI::ENTITY_MOTHER sets 4 / 0 on anim events, mother_spawn_parts sets 0 */ void NpcHelper::mother_set_collision_class(undefined4 param_1) { uint uVar1; int in_ECX; uint uVar2; int iVar3; *(undefined4 *)(in_ECX + 0x188) = param_1; if (*(int *)(in_ECX + 0x30) == 0) { iVar3 = *(int *)(in_ECX + 0xbfc); uVar2 = iVar3 + 1U & 3; uVar1 = iVar3 + 1U >> 2; if (*(int *)(*(int *)(*(int *)(in_ECX + 0xbf4) + (*(int *)(in_ECX + 0xbf8) - 1U & uVar1) * 4) + uVar2 * 4) != 0) { *(undefined4 *) (*(int *)(*(int *)(*(int *)(in_ECX + 0xbf4) + (*(int *)(in_ECX + 0xbf8) - 1U & uVar1) * 4) + uVar2 * 4) + 0x188) = param_1; iVar3 = *(int *)(in_ECX + 0xbfc); } uVar1 = iVar3 + 2U >> 2; uVar2 = iVar3 + 2U & 3; if (*(int *)(*(int *)(*(int *)(in_ECX + 0xbf4) + (*(int *)(in_ECX + 0xbf8) - 1U & uVar1) * 4) + uVar2 * 4) != 0) { *(undefined4 *) (*(int *)(*(int *)(*(int *)(in_ECX + 0xbf4) + (*(int *)(in_ECX + 0xbf8) - 1U & uVar1) * 4) + uVar2 * 4) + 0x188) = param_1; } } return; } //@@ 00568980 FUN_00568980 void FUN_00568980(char param_1) { int *piVar1; int iVar2; code *pcVar3; char cVar4; Entity *in_ECX; uint uVar5; EntityRef local_38; void *local_10; Entity *local_c; uVar5 = 0; local_10 = g_game->_room; local_c = in_ECX; if (*(int *)((int)local_10 + 0x1264) != 0) { do { piVar1 = *(int **)(*(int *)((int)local_10 + 0x125c) + uVar5 * 4); iVar2 = piVar1[10]; if (iVar2 == 9) { piVar1[0x10e] = 0; piVar1[0x10f] = 0; *(undefined1 *)((int)piVar1 + 0x173) = 1; } else if ((param_1 == '\0') && ((((((1 < *(int *)&g_game->_deathmatchManager && (iVar2 == 1)) || (iVar2 - 10U < 0x3de)) && ((cVar4 = (**(code **)(*piVar1 + 0x48))(), cVar4 != '\0' && (piVar1[10] != 0x362))) ) && ((piVar1[0x5a] & 0x20000000U) == 0)) || (((piVar1[10] == 0x390 && (piVar1[0xb] != 0)) && (piVar1[0xb] != 10)))))) { piVar1[0x5a] = piVar1[0x5a] | 0x40000; piVar1[0x5b] = piVar1[0x5b]; pcVar3 = *(code **)(*piVar1 + 0x24); EntityRef::constructor(&local_38,local_c); (*pcVar3)(&local_38); } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)local_10 + 0x1264)); } return; } //@@ 00568a90 NpcAI::ENTITY_MOTHER_start_transition /* DB: ? ECX=npc (Mother subtype 0) when _dead: FUN_00568980(0), Room +0x7214=20/+0x7218=6, SetAnimation "Transition" + Rewind on the ANM2 at +0x48 unless already set (+0x8c), then revives every NPC in its deque (+0xbf4..): _dead=0, health 1e-5, invincible, RemoveStatusEffects, flags |= 0x11; twice from NpcAI::ENTITY_MOTHER */ void __fastcall NpcAI::ENTITY_MOTHER_start_transition(Entity_NPC *npc) { void *pvVar1; byte *pbVar2; Entity *this; undefined4 uVar3; Manager *pMVar4; byte bVar5; byte *pbVar6; uint uVar7; char *pcVar8; bool bVar9; uint local_8; FUN_00568980(0); pvVar1 = g_game->_room; *(undefined4 *)((int)pvVar1 + 0x7214) = 0x14; *(undefined4 *)((int)pvVar1 + 0x7218) = 6; pbVar2 = (npc->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { pbVar6 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar6 = *(byte **)pbVar2; } pcVar8 = "Transition"; do { bVar5 = *pbVar6; bVar9 = bVar5 < (byte)*pcVar8; if (bVar5 != *pcVar8) { LAB_00568af7: uVar7 = -(uint)bVar9 | 1; goto LAB_00568afc; } if (bVar5 == 0) break; bVar5 = pbVar6[1]; bVar9 = bVar5 < (byte)pcVar8[1]; if (bVar5 != pcVar8[1]) goto LAB_00568af7; pbVar6 = pbVar6 + 2; pcVar8 = pcVar8 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_00568afc: if ((uVar7 == 0) && ((pbVar2[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00568b2f; } bVar5 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Transition",1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_00568b2f: uVar7 = 0; if ((npc->_entityDeque)._size != 0) { do { local_8 = (npc->_entityDeque)._offset; this = *(Entity **) (*(int *)((int)(npc->_entityDeque)._map + (local_8 + uVar7 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (local_8 + uVar7 & 3) * 4); if ((this != (Entity *)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (this->_type == 1)) || (this->_type - 10U < 0x3de)))) { (this->_damageEvents)._end = (this->_damageEvents)._begin; this->_pendingDamage = 0.0; *(undefined4 *)&this->_pendingDamageFlags = 0; *(undefined4 *)((int)&this->_pendingDamageFlags + 4) = 0; this->_dead = 0; this->_entityCollisionClass = 0; this->_health = 1e-05; this[2]._posOffset.x = 2.24208e-44; this->_isInvicible = 1; Entity::RemoveStatusEffects(this); uVar3 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x11; *(undefined4 *)((int)&this->_flags + 4) = uVar3; } uVar7 = uVar7 + 1; } while (uVar7 < (npc->_entityDeque)._size); } (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_health = 1e-05; npc->_state = 0x10; npc->_i1 = 0; npc->_isInvicible = 1; Entity::RemoveStatusEffects((Entity *)npc); uVar3 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; pMVar4 = g_manager; *(undefined4 *)((int)&npc->_flags + 4) = uVar3; local_8 = 0x26a; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&pMVar4->_sfxManager,local_8,1.0,2,0,1.0,0.0); return; } //@@ 00568cc0 NpcHelper::mother_spawn_parts /* DB: ? called from NpcAI::ENTITY_MOTHER; spawns three ENTITY_MOTHER (0x390) variant 0 children with subtypes 1,2,3 parented to the npc, SetVisibleFlag/SetSize */ void NpcHelper::mother_spawn_parts(void) { EntityPtr EVar1; Entity *part2; EntityPtr in_ECX; uint uVar2; uint blockSlot; EntityPtr *childRef; float offsetY; Vector part3Pos; Vector part2Pos; Vector part1Pos; EntityPtr local_24; float local_20; EntityPtr local_1c; EntityPtr *local_18; Entity *local_14; int dequeBlock; qword flags; part1Pos.x = DAT_00c33d3c + *(float *)((int)in_ECX + 0x33c); part1Pos.y = DAT_00c33d40 + *(float *)((int)in_ECX + 0x340); EVar1 = (EntityPtr) Game::Spawn(g_game,0x390,0,&part1Pos,&g_vectorZero,(Entity *)in_ECX,1, *(uint *)((int)in_ECX + 0x3ec)); offsetY = *(float *)((int)in_ECX + 0x350) - DAT_00c33d40; ((Vector *)((int)EVar1 + 0x34c))->x = *(float *)((int)in_ECX + 0x34c) - DAT_00c33d3c; *(float *)((int)EVar1 + 0x350) = offsetY; local_24 = EVar1; mother_set_collision_class(0); *(byte *)((int)EVar1 + 0x3b0) = 1; *(uint *)((int)EVar1 + 0x168) = *(uint *)((int)EVar1 + 0x168) & 0xfffffffb | 0x80100011; *(undefined4 *)((int)EVar1 + 0x16c) = *(undefined4 *)((int)EVar1 + 0x16c); Entity::SetVisibleFlag((Entity *)EVar1,0); if (*(EntityPtr *)((int)EVar1 + 0x3bc) != (EntityPtr)0x0) { local_14 = (Entity *)((int)EVar1 + 0x3bc); std::multiset::erase(&local_14); } *(EntityPtr *)((int)EVar1 + 0x3bc) = in_ECX; std::multiset::insert((EntityPtr *)((int)EVar1 + 0x3bc)); (**(code **)(*(int *)EVar1 + 0xc))(); part2Pos.x = DAT_00c33d44 + *(float *)((int)in_ECX + 0x33c); part2Pos.y = DAT_00c33d48 + *(float *)((int)in_ECX + 0x340); part2 = Game::Spawn(g_game,0x390,0,&part2Pos,&g_vectorZero,(Entity *)in_ECX,2, *(uint *)((int)in_ECX + 0x3ec)); local_20 = -g_vectorOne.x; local_1c = (EntityPtr)-g_vectorOne.y; local_14 = part2; Entity::SetSize(part2,70.0,(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1 ); offsetY = *(float *)((int)in_ECX + 0x350) - DAT_00c33d48; (part2->_posOffset).x = *(float *)((int)in_ECX + 0x34c) - DAT_00c33d44; (part2->_posOffset).y = offsetY; if (part2->_parent != (EntityPtr)0x0) { local_18 = &part2->_parent; std::multiset::erase(&local_18); } part2->_parent = in_ECX; std::multiset::insert(&part2->_parent); flags = part2->_flags; *(undefined4 *)((int)&part2->_flags + 4) = *(undefined4 *)((int)&part2->_flags + 4); *(uint *)&part2->_flags = (uint)flags & 0xfffffffb | 0x80000000; (**(code **)(*(int *)part2 + 0xc))(); part3Pos.x = DAT_00c33d4c + *(float *)((int)in_ECX + 0x33c); part3Pos.y = DAT_00c33d50 + *(float *)((int)in_ECX + 0x340); EVar1 = (EntityPtr) Game::Spawn(g_game,0x390,0,&part3Pos,&g_vectorZero,(Entity *)in_ECX,3, *(uint *)((int)in_ECX + 0x3ec)); local_20 = -g_vectorOne.x; local_1c = (EntityPtr)-g_vectorOne.y; Entity::SetSize((Entity *)EVar1,70.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); offsetY = *(float *)((int)in_ECX + 0x350) - DAT_00c33d50; *(float *)((int)EVar1 + 0x34c) = *(float *)((int)in_ECX + 0x34c) - DAT_00c33d4c; *(float *)((int)EVar1 + 0x350) = offsetY; if (*(int *)((int)EVar1 + 0x3bc) != 0) { local_18 = (EntityPtr *)((int)EVar1 + 0x3bc); std::multiset::erase(&local_18); } *(EntityPtr *)((int)EVar1 + 0x3bc) = in_ECX; std::multiset::insert((int)EVar1 + 0x3bc); *(undefined4 *)((int)EVar1 + 0x16c) = *(undefined4 *)((int)EVar1 + 0x16c); *(uint *)((int)EVar1 + 0x168) = *(uint *)((int)EVar1 + 0x168) & 0xfffffffb | 0x80000000; (**(code **)(*(int *)EVar1 + 0xc))(); local_18 = (EntityPtr *)0x0; std::deque::resize(3,&local_18); uVar2 = *(uint *)((int)in_ECX + 0xbfc) & 3; dequeBlock = *(int *)(*(int *)((int)in_ECX + 0xbf4) + (*(uint *)((int)in_ECX + 0xbfc) >> 2 & *(int *)((int)in_ECX + 0xbf8) - 1U) * 4); local_1c = (EntityPtr)(dequeBlock + uVar2 * 4); if (*(int *)(dequeBlock + uVar2 * 4) != 0) { local_18 = (EntityPtr *)local_1c; std::multiset::erase(&local_18); } *(EntityPtr *)local_1c = local_24; std::multiset::insert(local_1c); uVar2 = *(int *)((int)in_ECX + 0xbfc) + 1; blockSlot = uVar2 & 3; dequeBlock = *(int *)(*(int *)((int)in_ECX + 0xbf4) + (uVar2 >> 2 & *(int *)((int)in_ECX + 0xbf8) - 1U) * 4); local_1c = (EntityPtr)(dequeBlock + blockSlot * 4); if (*(int *)(dequeBlock + blockSlot * 4) != 0) { local_24 = local_1c; std::multiset::erase(&local_24); } *(Entity **)local_1c = local_14; std::multiset::insert(local_1c); uVar2 = *(int *)((int)in_ECX + 0xbfc) + 2; blockSlot = uVar2 & 3; dequeBlock = *(int *)(*(int *)((int)in_ECX + 0xbf4) + (uVar2 >> 2 & *(int *)((int)in_ECX + 0xbf8) - 1U) * 4); local_1c = (EntityPtr)(dequeBlock + blockSlot * 4); if (*(int *)(dequeBlock + blockSlot * 4) != 0) { local_24 = local_1c; std::multiset::erase(&local_24); } *(EntityPtr *)local_1c = EVar1; std::multiset::insert(local_1c); local_1c = (EntityPtr)((int)in_ECX + 0x3c0); if (*(int *)((int)in_ECX + 0x3c0) != 0) { local_24 = local_1c; std::multiset::erase(&local_24); } part2 = local_14; *(Entity **)local_1c = local_14; std::multiset::insert(local_1c); childRef = &part2->_child; if (part2->_child != (EntityPtr)0x0) { local_24 = (EntityPtr)childRef; std::multiset::erase(&local_24); } *childRef = EVar1; std::multiset::insert(childRef); return; } //@@ 00569170 NpcAI::ENTITY_MOTHER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 912 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOTHER(Entity_NPC *npc) { float *pfVar1; byte isIgnored; uint uVar3; EntityRef *pEVar4; Vector *pVVar5; LayerState *layer; Entity *pEVar6; char *pcVar7; int extraout_EAX; void *pvVar8; ColorMod *color; Entity *pEVar9; int *piVar10; undefined4 *puVar11; EntityPtr *pEVar12; Entity_Laser *laser; std_string *animName; ColorMod *color_00; int iVar13; int iVar14; Game *game; EntityPtr EVar15; ANM2 *pAVar16; int unused; uint uVar17; char isFastScrape; code *extraout_EDX; undefined1 *puVar18; int extraout_EDX_00; int extraout_EDX_01; PlayerManager *playerManager; byte *pbVar19; code *pcVar20; Entity_NPC *pEVar21; Room *room; ColorMod *splatColor; float fVar22; float fVar23; float fVar24; float fVar25; byte teleportTwinPlayers; undefined4 uVar26; EntityRef local_204; Capsule local_1dc [10]; Vector bottomWallPos; Vector local_1ac; undefined1 local_1a4 [12]; undefined1 *local_198; float innerTop; EntityPtr local_190; Vector local_18c; Room *currentRoom; float roomRight; float roomLeft; EntityPtr local_178; undefined1 local_174 [12]; undefined1 *local_168; Vector local_164; Entity_NPC *mother; Vector local_158; Vector local_150; Vector local_148; EntityPtr local_140; Vector local_13c; Entity_NPC *local_134; char local_12d; int elapsedFrames; Entity *local_128; Entity *local_124; ProjectileParams projParams; undefined1 local_78 [8]; float fStack_70; float fStack_6c; float local_68; float fStack_64; float fStack_60; float fStack_5c; float local_58; float local_54; float local_50; undefined1 local_4c [20]; float local_38; undefined1 local_34 [4]; float local_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Entity_Familiar *familiar; bool isIgnored; Manager *manager; Entity_Player *player; fVar25 = g_colorGreenSplat._tint[3]; fVar23 = g_colorGreenSplat._tint[2]; fVar22 = g_colorGreenSplat._tint[1]; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af4f53; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; room = g_game->_room; local_124 = (Entity *)(room->_topLeftPos).y; roomLeft = (room->_topLeftPos).x; innerTop = (float)local_124 + 40.0; roomRight = (room->_bottomRightPos).x; bottomWallPos.y = (room->_bottomRightPos).y; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_140 = (EntityPtr)((float)local_124 - 40.0); fVar24 = 80.0; bottomWallPos.x = roomLeft - 80.0; currentRoom = room; mother = npc; local_134 = (Entity_NPC *)bottomWallPos.y; local_24 = uVar3; if (npc->_aiCallPhase == 1) { if (npc->_subtype == 0) { puStack_20 = local_34 + 0x30; if (npc->_dead != 0) { puStack_20 = local_34 + 0x30; ENTITY_MOTHER_start_transition(npc); } } else { puStack_20 = local_34 + 0x30; if (npc->_subtype != 1) { EVar15 = npc->_parent; if (EVar15 == (EntityPtr)0x0) { puStack_20 = local_34 + 0x30; pEVar4 = EntityRef::EntityRef((EntityRef *)(local_78 + 4)); (**(code **)(*(int *)npc + 0x24))(pEVar4); } else { if (*(float *)((int)EVar15 + 0x380) <= npc->_health) { npc->_health = *(float *)((int)EVar15 + 0x380); } else { *(float *)((int)EVar15 + 0x380) = npc->_health; } puStack_20 = local_34 + 0x30; if (npc->_dead != 0) { puStack_20 = local_34 + 0x30; pEVar4 = EntityRef::EntityRef((EntityRef *)(local_78 + 4)); (*extraout_EDX)(pEVar4); ENTITY_MOTHER_start_transition((Entity_NPC *)npc->_parent); room = currentRoom; } } } } if (npc->_subtype == 0) { pvVar8 = room->_Camera; local_150.x = (roomRight + roomLeft) * 0.5; local_150.y = ((float)local_134 - (float)local_124) * 0.43 + (float)local_124; if (*(char *)((int)pvVar8 + 0x8c) == '\0') { ring_buffer_push((void *)((int)pvVar8 + 0x50),&local_150); *(undefined1 *)((int)pvVar8 + 0x8c) = 1; } } if (0.0 < npc->_pendingDamage) { npc->_pendingDamage = 0.0; pvVar8 = (npc->_damageEvents)._begin; local_124 = (Entity *)0x0; iVar13 = (int)(npc->_damageEvents)._end - (int)pvVar8; iVar14 = iVar13 >> 0x1f; if (iVar13 / 0x38 + iVar14 == iVar14) { ExceptionList = local_1c; return; } iVar14 = 0; do { if (((*(int *)(iVar14 + 0x10 + (int)pvVar8) == npc->_type) || (*(int *)(iVar14 + 0x18 + (int)pvVar8) == npc->_type)) && ((bool)((byte)(*(uint *)(iVar14 + 0x30 + (int)pvVar8) >> 1) & 1) == ((npc->_flags & 0x20000000) != 0))) { *(undefined4 *)(iVar14 + (int)pvVar8) = 0; } pfVar1 = (float *)(iVar14 + (int)pvVar8); local_124 = (Entity *)((int)local_124 + 1); iVar14 = iVar14 + 0x38; npc->_pendingDamage = npc->_pendingDamage + *pfVar1; pvVar8 = (npc->_damageEvents)._begin; } while (local_124 < (uint)(((int)(npc->_damageEvents)._end - (int)pvVar8) / 0x38)); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (npc->_state == 0) { if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar22; (npc->_splatColor)._tint[2] = fVar23; (npc->_splatColor)._tint[3] = fVar25; fVar25 = g_colorGreenSplat._colorize[3]; fVar23 = g_colorGreenSplat._colorize[2]; fVar22 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar22; (npc->_splatColor)._colorize[2] = fVar23; (npc->_splatColor)._colorize[3] = fVar25; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } npc->_aiCallFlags = 1; if (npc->_subtype == 0) { puStack_20 = local_34 + 0x30; pVVar5 = Room::GetCenterPos(&local_2c); (npc->_pos).x = pVVar5->x; (npc->_pos).y = innerTop; (npc->_posOffset).y = 80.0; npc->_renderZOffset = 8000; uVar3 = 0; do { Room::RemoveDoor(room,uVar3); game = g_game; uVar3 = uVar3 + 1; } while (uVar3 < 8); playerManager = &g_game->_playerManager; local_124 = (Entity *)0x0; *(undefined4 *)((int)room->_descriptor + 0x18) = 0; pvVar8 = game->_room; local_150.y = *(float *)((int)pvVar8 + 0x20) - 120.0; local_150.x = (*(float *)((int)pvVar8 + 0x1c) + *(float *)((int)pvVar8 + 0x14)) * 0.5; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar8 = (playerManager->_playerList)._end; if ((int)pvVar8 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar8 = (playerManager->_playerList)._end; game = g_game; } puVar11 = (playerManager->_playerList)._begin; if (local_124 < (uint)((int)pvVar8 - (int)puVar11 >> 2)) { puVar11 = puVar11 + (int)local_124; } player = (Entity_Player *)*puVar11; teleportTwinPlayers = 0; isIgnored = 0; pVVar5 = (Vector *) PlayerManager::get_player_start_position (local_174 + 8,player,&local_150,&game->_playerManager); Entity_Player::Teleport(player,pVVar5,isIgnored,teleportTwinPlayers); playerManager = &g_game->_playerManager; local_124 = (Entity *)((int)local_124 + 1); game = g_game; } while (local_124 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } pEVar6 = game->_room; local_140 = (EntityPtr)0x0; local_128 = pEVar6; if (pEVar6[4]._burnCountdown != 0) { do { familiar = *(Entity_Familiar **)(pEVar6[4]._midasFreezeCountdown + (int)local_140 * 4); if ((familiar != (Entity_Familiar *)0x0) && (familiar->_type == 3)) { pVVar5 = Entity_Familiar::GetFollowTargetPosition(familiar,&local_2c,0); (familiar->_pos).x = pVVar5->x; (familiar->_pos).y = pVVar5->y; } local_140 = (EntityPtr)((int)local_140 + 1); } while ((uint)local_140 < (uint)pEVar6[4]._burnCountdown); } npc = mother; NpcHelper::mother_spawn_parts(); uVar3 = Random(); local_124 = Game::Spawn(g_game,1000,0x8c,&bottomWallPos,&g_vectorZero,(Entity *)0x0,0,uVar3); local_2c.x = 0.0; pAVar16 = &local_124->_sprite; local_2c.y = (float)&DAT_0000000f; local_4c._16_4_ = 0.0; local_140 = (EntityPtr)pAVar16; local_4c._16_4_ = std::_Allocate(0x30); local_2c.x = 5.46506e-44; local_2c.y = (float)&DAT_0000002f; builtin_strncpy((char *)local_4c._16_4_,"gfx/backdrop/07x_corpse_bottomwall.anm2",0x28); local_14 = 0; ANM2::Load(pAVar16,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; if (&DAT_0000000f < (uint)local_2c.y) { puVar18 = (undefined1 *)((int)local_2c.y + 1); pcVar7 = (char *)local_4c._16_4_; if ((undefined1 *)0xfff < puVar18) { pcVar7 = *(char **)(local_4c._16_4_ + -4); puVar18 = (undefined1 *)((int)local_2c.y + 0x24); if ((char *)0x1f < (char *)(local_4c._16_4_ + (-4 - (int)pcVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar7,(uint)puVar18); } EVar15 = local_140; pbVar19 = (byte *)0x1; if (1 < (uint)(local_124->_sprite)._layerCount) { do { layer = ANM2::GetLayer((ANM2 *)EVar15,pbVar19); pbVar19 = pbVar19 + 1; layer->_visible = 0; } while (pbVar19 < (byte *)(local_124->_sprite)._layerCount); npc = mother; } EVar15 = local_140; isIgnored = ANM2::SetAnimation((ANM2 *)local_140,s_Idle,1); if (((isIgnored != 0) && (*(void **)((int)EVar15 + 0x34) != (void *)0x0)) && (AnimationState::SetFrameFloat((AnimationState *)((int)EVar15 + 0x30),0.0), *(void **)((int)EVar15 + 0x34) != (void *)0x0)) { *(byte *)((int)EVar15 + 0x44) = 0; } layer = ANM2::GetLayer((ANM2 *)EVar15,(byte *)0x0); layer->_blendMode[0] = 0; layer->_blendMode[1] = 0; layer->_blendMode[2] = 2; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; local_124->_sortingLayer = 0; uVar3 = Random(); pEVar6 = Game::Spawn(g_game,1000,0x8c,&bottomWallPos,&g_vectorZero,(Entity *)0x0,0,uVar3); pAVar16 = &pEVar6->_sprite; local_2c.x = 0.0; local_2c.y = (float)&DAT_0000000f; local_4c._16_4_ = (void *)0x0; local_128 = pEVar6; std::string::assign(local_4c + 0x10,(byte *)"gfx/backdrop/07x_corpse_bottomwall.anm2",0x27); local_14 = 1; ANM2::Load(pAVar16,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; if (&DAT_0000000f < (uint)local_2c.y) { puVar18 = (undefined1 *)((int)local_2c.y + 1); pvVar8 = (void *)local_4c._16_4_; if ((undefined1 *)0xfff < puVar18) { pvVar8 = *(void **)(local_4c._16_4_ + -4); puVar18 = (undefined1 *)((int)local_2c.y + 0x24); if (0x1f < (uint)(local_4c._16_4_ + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,(uint)puVar18); } layer = ANM2::GetLayer(pAVar16,(byte *)0x0); layer->_visible = 0; isIgnored = ANM2::SetAnimation(pAVar16,s_Idle,1); if (((isIgnored != 0) && ((pEVar6->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(pEVar6->_sprite)._animState,0.0), (pEVar6->_sprite)._animState._animData != (void *)0x0)) { (pEVar6->_sprite)._animState._isPlaying = 0; } manager = g_manager; local_140 = (EntityPtr)0x270; local_128->_sortingLayer = 1; npc->_i2 = 0; seed_fart_sound_override((int *)&local_140); SoundEffects::Play(&manager->_sfxManager,(int)local_140,1.0,2,0,1.0,0.0); } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; goto LAB_0056c6a7; } if (npc->_subtype != 0) goto LAB_0056c6a7; fVar22 = 1.0; puVar18 = local_34 + 0x30; switch(npc->_state) { case 3: puStack_20 = local_34 + 0x30; isIgnored = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (isIgnored != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); fVar22 = 1.0; fVar24 = 80.0; } iVar14 = npc->_stateFrame; if (0 < iVar14) { iVar14 = iVar14 - elapsedFrames; npc->_stateFrame = iVar14; } EVar15 = npc->_entityRef; if (EVar15 == (EntityPtr)0x0) { if (npc->_i2 == -1) { isIgnored = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); puVar18 = puStack_20; if (isIgnored != 0) { npc->_i2 = 0; play_sound_with_fart_seed(0x26e,fVar22,2,0,1.0); ANM2::Play(&npc->_sprite,(byte *)"GroundPound3",0); npc->_state = 0xc; npc->_stateFrame = 0; puVar18 = puStack_20; } } else if (npc->_i2 < 1) { puVar18 = puStack_20; if (iVar14 < 1) { if (npc->_updateTime < (float)(npc->_i1 * 0x654 + 0x474)) { local_124 = (Entity *)Entity_NPC::GetAliveEnemyCount(npc); uVar3 = Random(); if ((uVar3 % 6 == 0) && (2 < npc->_championTimer)) { npc->_state = 0x13; ANM2::Play(&npc->_sprite,(byte *)"Shoot1",0); play_sound_with_fart_seed(0x26f,1.0,2,0,1.0); npc->_championTimer = -1; } else { uVar3 = Random(); if (uVar3 % 3 == 0) { npc->_state = 10; uVar3 = Random(); pcVar7 = "WristAttackLeft"; if ((uVar3 & 1) == 0) { pcVar7 = "WristAttackRight"; } ANM2::Play(&npc->_sprite,(byte *)pcVar7,0); play_sound_with_fart_seed(0x276,1.0,2,0,1.0); } else { iVar14 = Isaac::Random(((int)local_124 < 4) + 2); if ((iVar14 == 0) && ((int)local_124 < 0xf)) { npc->_state = 9; uVar3 = Random(); pcVar7 = "GroundPound"; if ((uVar3 & 1) == 0) { pcVar7 = "GroundPound2"; } ANM2::Play(&npc->_sprite,(byte *)pcVar7,0); isIgnored = ANM2::IsPlaying(&npc->_sprite,(byte *)"GroundPound"); play_sound_with_fart_seed((isIgnored ^ 1) + 0x26c,1.0,2,0,1.0); } else { npc->_state = 8; uVar3 = Random(); pcVar7 = "ThrowKnife"; if ((uVar3 & 1) == 0) { pcVar7 = "ThrowKnife2"; } ANM2::Play(&npc->_sprite,(byte *)pcVar7,0); } } } npc->_championTimer = npc->_championTimer + 1; npc->_stateFrame = 0; puVar18 = puStack_20; } else { npc->_state = 0xd; npc->_i1 = npc->_i1 + 1; ANM2::Play(&npc->_sprite,(byte *)"SummonBegin",0); npc->_stateFrame = 0; npc->_i2 = 0; puVar18 = puStack_20; } } } else { isIgnored = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); puVar18 = puStack_20; if (isIgnored != 0) { Entity_NPC::QueryNPCsType(local_34,0x390,0x14); pvVar8 = (void *)0x0; local_14 = 2; iVar14 = 0; if ((void *)local_2c.y != (void *)0x0) { local_124 = (Entity *)0x0; fVar22 = (npc->_pos).y + 140.0; do { iVar13 = *(int *)((int)local_30 + (int)pvVar8 * 4); pfVar1 = (float *)(iVar13 + 0x340); if (*pfVar1 <= fVar22 && fVar22 != *pfVar1) { fVar23 = (npc->_pos).x; pfVar1 = (float *)(iVar13 + 0x33c); if (fVar23 < *pfVar1 || fVar23 == *pfVar1) { local_124 = (Entity *)((int)local_124 + 1); } else { iVar14 = iVar14 + 1; } } pvVar8 = (void *)((int)pvVar8 + 1); } while (pvVar8 < (uint)local_2c.y); if ((0 < iVar14) || (0 < (int)local_124)) { local_128 = (Entity *)0xb61958; pbVar19 = (byte *)"ScrapeAttack2"; if (iVar14 <= (int)local_124) { pbVar19 = (byte *)"ScrapeAttack"; } ANM2::Play(&npc->_sprite,pbVar19,0); npc->_state = 0xb; npc->_projectileCooldown = 1 - npc->_projectileCooldown; } } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_34); puVar18 = puStack_20; } } } else { fVar23 = 13.0; local_124 = (Entity *)((npc->_pos).y + fVar24); fVar22 = *(float *)(*(int *)((int)EVar15 + 0x330) + 0x44); local_12d = '\0'; isFastScrape = '\0'; if (*(float *)((int)EVar15 + 0x37c) < fVar22 + 6.0) { pEVar6 = local_124; if (*(float *)((int)EVar15 + 0x37c) == fVar22) { fVar22 = sqrtf(*(float *)((int)EVar15 + 0x334) * *(float *)((int)EVar15 + 0x334) + *(float *)((int)EVar15 + 0x338) * *(float *)((int)EVar15 + 0x338)); EVar15 = npc->_entityRef; pEVar6 = local_124; if (fVar22 < 3.0) { fVar23 = 13.0; isFastScrape = local_12d; } else { fVar23 = 15.0; isFastScrape = '\x01'; } } } else { pEVar6 = (Entity *)((float)local_124 - 140.0); } fVar22 = *(float *)((int)EVar15 + 0x39c) / npc->_speedMultiplier; fVar25 = *(float *)((int)EVar15 + 0x360) * fVar23 * fVar22 + *(float *)((int)EVar15 + 0x33c); puVar18 = puStack_20; if ((*(float *)((int)EVar15 + 0x364) < 0.0) && (*(float *)((int)EVar15 + 0x364) * fVar23 * fVar22 + *(float *)((int)EVar15 + 0x340) < (float)pEVar6)) { fVar22 = (roomRight + roomLeft) * 0.5; if (isFastScrape == '\0') { pcVar7 = "ScrapeAttack2"; if (fVar22 <= fVar25) { pcVar7 = "ScrapeAttack"; } ANM2::Play(&npc->_sprite,(byte *)pcVar7,1); npc->_state = 0xb; uVar3 = Random(); iVar14 = uVar3 % 3 + 0x26c; } else { pcVar7 = "GroundPound2"; if (fVar22 <= fVar25) { pcVar7 = "GroundPound"; } ANM2::Play(&npc->_sprite,(byte *)pcVar7,1); npc->_state = 9; isIgnored = ANM2::IsPlaying(&npc->_sprite,(byte *)"GroundPound"); iVar14 = (isIgnored ^ 1) + 0x26c; } LAB_0056c1b5: play_sound_with_fart_seed(iVar14,1.0,2,0,1.0); puVar18 = puStack_20; } } break; case 5: puStack_20 = local_34 + 0x30; isIgnored = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); puVar18 = puStack_20; if (isIgnored != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; puVar18 = puStack_20; } break; case 8: pAVar16 = &npc->_sprite; puStack_20 = local_34 + 0x30; isIgnored = Sprite::IsEventTriggered((Sprite *)pAVar16,"Sound"); if (isIgnored != 0) { SoundEffects::PlayWithFartOverride(0x272,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x21c,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); } isIgnored = Sprite::IsEventTriggered((Sprite *)pAVar16,"Shoot"); if (isIgnored != 0) { SoundEffects::PlayWithFartOverride(0x273,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0xfc,1.2,2,0,0.8); SoundEffects::PlayWithFartOverride(0x12d,1.0,2,0,1.0); pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); local_128 = (Entity *)(npc->_pos).x; local_158.y = pVVar5->x; local_124 = (Entity *)(npc->_pos).y; local_134 = (Entity_NPC *)pVVar5->y; uVar3 = Random(); local_18c.x = (float)local_128 + local_158.y + 0.0; local_150.x = 0.0; local_150.y = 15.0; local_18c.y = (float)local_124 + (float)local_134 + 60.0; pEVar6 = Game::Spawn(g_game,1000,0xb6,&local_18c,&local_150,(Entity *)npc,0,uVar3); Entity::SetParent(pEVar6,(Entity *)npc); (**(code **)(*(int *)pEVar6 + 0xc))(); LAB_0056a092: pAVar16 = &npc->_sprite; } goto LAB_0056a095; case 9: puStack_20 = local_34 + 0x30; if (npc->_entityRef != (EntityPtr)0x0) { puStack_20 = local_34 + 0x30; pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); EVar15 = npc->_entityRef; local_150.x = (pVVar5->x + (npc->_pos).x + 0.0) - *(float *)((int)EVar15 + 0x33c); local_150.y = (pVVar5->y + (npc->_pos).y + 80.0) - *(float *)((int)EVar15 + 0x340); pVVar5 = Vector::Resized(&local_150,&local_2c,10.0); fVar22 = *(float *)((int)EVar15 + 0x334); local_150.x = fVar22 + pVVar5->x; fVar23 = *(float *)((int)EVar15 + 0x338); local_150.y = fVar23 + pVVar5->y; fVar22 = sqrtf(fVar23 * fVar23 + fVar22 * fVar22); pVVar5 = Vector::Resized(&local_150,(Vector *)(local_174 + 8),fVar22); fVar22 = pVVar5->y; *(float *)((int)EVar15 + 0x334) = pVVar5->x; *(float *)((int)EVar15 + 0x338) = fVar22; } pAVar16 = &npc->_sprite; isIgnored = Sprite::IsEventTriggered((Sprite *)pAVar16,"Shoot"); if (isIgnored != 0) { SoundEffects::PlayWithFartOverride(0x34,1.0,2,0,1.0); Game::ShakeScreen(g_game,0xc); pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); EVar15 = npc->_entityRef; local_164.x = (npc->_pos).x + pVVar5->x + 0.0; local_164.y = pVVar5->y + (npc->_pos).y + 60.0; local_158.y = local_164.y; local_128 = (Entity *)local_164.x; if (EVar15 == (EntityPtr)0x0) { pVVar5 = Room::GetCenterPos((Vector *)(local_174 + 8)); local_150.x = pVVar5->x - (float)local_128; local_150.y = pVVar5->y - local_158.y; Vector::Normalized(&local_150,&local_148); uVar3 = 0xfffffffa; do { local_124 = (Entity *)((((float)(int)uVar3 * 80.0) / 6.0) * 0.017453292); local_128 = (Entity *)cos((float)local_124); local_158.y = sin((float)local_124); uVar17 = Random(); fVar23 = local_148.x * (float)local_128; fVar22 = local_148.y * (float)local_128; local_128 = (Entity *)(uVar3 & 1); local_13c.y = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)] ) * 2.3283064e-10 * 6.0 + 3.0; local_13c.x = (fVar23 - local_148.y * local_158.y) * local_13c.y; local_13c.y = (local_148.x * local_158.y + fVar22) * local_13c.y; if (local_128 != (Entity *)0x0) { local_150.x = local_164.x + local_13c.x; local_150.y = local_164.y + local_13c.y; spawn_small_maggot(&local_150,-15.0,&local_13c,-8.0); } if (local_128 == (Entity *)0x0) { local_128 = (Entity *)cos((float)local_124); fVar22 = sin((float)local_124); local_13c.x = ((float)local_128 * local_148.x - local_148.y * fVar22) * 14.0; local_13c.y = (local_148.x * fVar22 + (float)local_128 * local_148.y) * 14.0; ProjectileParams::ProjectileParams(&projParams); local_18c.x = local_13c.x + local_164.x; projParams.FallingAccelModifier = -0.04; local_18c.y = local_13c.y + local_164.y; projParams.Scale = 1.4; Entity_NPC::FireProjectiles(npc,&local_18c,&local_13c,0,&projParams); *(undefined4 *)(extraout_EAX + 0x30) = 1; } uVar3 = uVar3 + 1; } while ((int)uVar3 < 7); } else { *(uint *)((int)EVar15 + 0x168) = *(uint *)((int)EVar15 + 0x168) | 0x40000; *(undefined4 *)((int)EVar15 + 0x16c) = *(undefined4 *)((int)EVar15 + 0x16c); pcVar20 = *(code **)(*(int *)npc->_entityRef + 0x24); EntityRef::constructor((EntityRef *)local_4c,(Entity *)mother); (*pcVar20)(local_4c); npc = mother; EVar15 = mother->_entityRef; if ((*(int *)((int)EVar15 + 0x28) == 0x390) && (*(int *)((int)EVar15 + 0x2c) == 100)) { ENTITY_MOTHER_ball_burst((Entity_NPC *)EVar15); } FUN_00568980(1); } Entity::MakeBloodPoof((Entity *)npc,&local_164,&npc->_splatColor,1.0); Game::MakeShockwave(g_game,&local_164,0.04,0.025,0xd); goto LAB_0056a092; } LAB_0056a095: isIgnored = ANM2::IsFinishedImpl(pAVar16,&s_empty); puVar18 = puStack_20; if (isIgnored != 0) { LAB_0056a0ab: ANM2::Play(pAVar16,s_Idle,0); LAB_0056a0b7: npc->_state = 3; npc->_stateFrame = 0x32; puVar18 = puStack_20; } break; case 10: puStack_20 = local_34 + 0x30; isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (isIgnored != 0) { play_sound_with_fart_seed(0x283,1.0,2,0,1.0); } isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isIgnored != 0) { pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); local_198 = (undefined1 *)0xc1a00000; local_128 = (Entity *)0x0; local_1a4._8_4_ = 0.0; local_124 = (Entity *)&DAT_0000000f; local_148.x = (npc->_pos).x + pVVar5->x + 0.0; local_148.y = pVVar5->y + (npc->_pos).y + 60.0; do { fVar22 = ((float)(int)local_128 - 0.0) / 7.0; if (fVar22 <= 0.0) { fVar22 = 0.0; } if (1.0 <= fVar22) { fVar22 = 1.0; } local_158.y = (fVar22 * 120.0 + 30.0) * 0.017453292; local_134 = (Entity_NPC *)cos(local_158.y); local_158.y = sin(local_158.y); uVar3 = Random(); uVar17 = Random(); local_150.x = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 6.0; local_150.y = local_150.x * local_158.y; local_150.x = local_150.x * (float)local_134; local_164.y = (float)local_134 * 4.0; local_13c.y = local_158.y * 4.0; local_18c.x = local_164.y + local_148.x; local_18c.y = local_13c.y + local_148.y; pEVar6 = Game::Spawn(g_game,0x390,0x1e,&local_18c,&local_150,(Entity *)npc,0,uVar3); local_178 = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); if (pEVar6->_target != (EntityPtr)0x0) { local_190 = (EntityPtr)&pEVar6->_target; std::multiset::erase(&local_190); } pEVar6->_target = local_178; if (local_178 != (EntityPtr)0x0) { std::multiset::insert(&pEVar6->_target); } pEVar6[2]._prevPosition.x = (float)local_124; uVar3 = Random(); iVar14 = *(int *)pEVar6; fVar23 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.7; pEVar6[3]._pendingDamage = fVar23; fVar23 = fVar23 * pEVar6->_shrinkStatus1; fVar22 = fVar23 * g_vectorOne.x; (pEVar6->_sprite)._scale.y = fVar23 * g_vectorOne.y; (pEVar6->_sprite)._scale.x = fVar22; (**(code **)(iVar14 + 0xc))(); uVar3 = Random(); local_1ac.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 6.0; local_1ac.y = local_1ac.x * local_158.y; local_1ac.x = local_1ac.x * (float)local_134; local_174._8_4_ = local_148.x + local_164.y; local_168 = (undefined1 *)(local_148.y + local_13c.y); spawn_blood_explosion (3,(Vector *)(local_174 + 8),(Vector *)(local_1a4 + 8),&npc->_splatColor, &local_1ac); local_124 = (Entity *)((int)local_124 + 8); local_128 = (Entity *)&local_128->field_0x1; } while ((int)local_124 < 0x4f); local_174._8_4_ = 0.0; local_168 = (undefined1 *)0x40c00000; local_13c.y = 7.00649e-45; spawn_gibs(&local_148,6,40.0,(uint *)&local_13c.y,(Entity *)npc,&npc->_splatColor, (Vector *)(local_174 + 8),2.5); play_sound_with_fart_seed(0x284,1.0,2,0,1.0); fVar22 = 1.0; isIgnored = 0; iVar14 = 2; uVar3 = Random(); play_sound_with_fart_seed((~uVar3 & 1) * 2 + 0x278,1.0,iVar14,isIgnored,fVar22); } isIgnored = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); puVar18 = puStack_20; if (isIgnored != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_stateFrame = 0x5a; puVar18 = puStack_20; } break; case 0xb: puStack_20 = local_34 + 0x30; isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); puVar18 = puStack_20; if (isIgnored == 0) break; Game::ShakeScreen(g_game,8); Entity::GetNullCapsule((Entity *)npc,(Capsule *)local_4c,(byte *)"ShootPos"); if (0.0 < local_2c.x) { fVar22 = (npc->_posOffset).x; fVar23 = (npc->_posOffset).y; local_4c._0_4_ = (float)local_4c._0_4_ + fVar22; local_4c._4_4_ = (float)local_4c._4_4_ + fVar23; local_4c._8_4_ = (float)local_4c._8_4_ + fVar22; local_4c._12_4_ = (float)local_4c._12_4_ + fVar23; local_4c._16_4_ = (float)local_4c._16_4_ + fVar22; local_38 = local_38 + fVar23; fVar22 = local_2c.x; isIgnored = Game::GetDebugFlag(g_game,5); if (isIgnored != 0) { pvVar8 = Entity::GetDebugShape((Entity *)npc,1); *(undefined4 *)((int)pvVar8 + 4) = 1; push_shape_points(pvVar8,(Capsule *)local_4c); fVar22 = local_2c.x; } EntityList::QueryRadius (&room->_entityList,(EntityList_EL *)local_1a4,(Vector *)local_4c, local_2c.y + fVar22,0xffffffff); local_14 = 3; local_124 = (Entity *)0x0; if (local_198 != (undefined1 *)0x0) { do { pEVar21 = *(Entity_NPC **)(local_1a4._4_4_ + (int)local_124 * 4); local_134 = pEVar21; if (((pEVar21 != npc) && (pEVar21->_entityCollisionClass != 0)) && (pEVar21->_entityGridCollisionClass != 4)) { if ((pEVar21->_type == 0x390) && (pEVar21->_variant == 100)) { isIgnored = true; } else { isIgnored = false; } if (!isIgnored) { Entity::GetCollisionCapsule((Entity *)pEVar21,local_1dc,&g_vectorZero); local_168 = (undefined1 *)0x0; local_174._8_4_ = 0.0; isIgnored = Capsule::Collide((Capsule *)local_4c,local_1dc,(Vector *)(local_174 + 8)); if (isIgnored != 0) { local_128 = (Entity *)((pEVar21->_pos).x - (npc->_pos).x); local_158.y = (pEVar21->_pos).y - (npc->_pos).y; fVar22 = sqrtf((float)local_128 * (float)local_128 + local_158.y * local_158.y); if (fVar22 <= 0.0) { pvVar8 = (void *)local_158.y; pEVar6 = local_128; } else { pvVar8 = (void *)((1.0 / fVar22) * local_158.y); pEVar6 = (Entity *)((1.0 / fVar22) * (float)local_128); } (pEVar21->_velocity).x = (float)pEVar6 * 10.0 + (pEVar21->_velocity).x; (pEVar21->_velocity).y = (float)pvVar8 * 10.0 + (pEVar21->_velocity).y; if ((pEVar21->_type == 1) || (pEVar21->_type == 3)) { pcVar20 = *(code **)(*(int *)pEVar21 + 0x20); EntityRef::constructor((EntityRef *)(local_78 + 4),(Entity *)npc); pEVar4 = (EntityRef *)(local_78 + 4); uVar26 = 0x40000000; } else { pcVar20 = *(code **)(*(int *)pEVar21 + 0x20); EntityRef::constructor(&local_204,(Entity *)npc); pEVar4 = &local_204; uVar26 = 0x42c80000; } (*pcVar20)(uVar26,0,0,pEVar4,0x1e); pEVar21 = local_134; } manager = g_manager; if ((pEVar21->_type == 0x390) && (pEVar21->_variant == 0x14)) { local_128 = (Entity *)0x282; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,(int)local_128,1.0,2,0,1.0,0.0); } } } local_124 = (Entity *)((int)local_124 + 1); } while (local_124 < local_198); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_1a4); } if ((npc->_entityRef != (EntityPtr)0x0) && (fVar22 = (npc->_pos).y + 150.0, pfVar1 = (float *)((int)npc->_entityRef + 0x340), *pfVar1 <= fVar22 && fVar22 != *pfVar1)) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_148.x = (pEVar6->_pos).x - *(float *)((int)npc->_entityRef + 0x33c); local_148.y = (pEVar6->_pos).y - *(float *)((int)npc->_entityRef + 0x340); Vector::Normalize(&local_148); play_sound_with_fart_seed(0x4d,1.0,2,0,1.0); pVVar5 = Vector::Resized(&local_148,&local_2c,16.0); EVar15 = npc->_entityRef; *(float *)((int)EVar15 + 0x360) = pVVar5->x; *(float *)((int)EVar15 + 0x364) = pVVar5->y; EVar15 = npc->_entityRef; fVar22 = sqrtf(*(float *)((int)EVar15 + 0x334) * *(float *)((int)EVar15 + 0x334) + *(float *)((int)EVar15 + 0x338) * *(float *)((int)EVar15 + 0x338)); fVar22 = fVar22 + 0.15; if (3.0 <= fVar22) { fVar22 = 3.0; } pVVar5 = Vector::Resized(&local_148,(Vector *)(local_174 + 8),fVar22); fVar22 = pVVar5->y; *(float *)((int)EVar15 + 0x334) = pVVar5->x; *(float *)((int)EVar15 + 0x338) = fVar22; EVar15 = npc->_entityRef; if (*(float *)((int)EVar15 + 0x37c) == *(float *)((int)*(void **)((int)EVar15 + 0x330) + 0x44) ) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); Entity::SetTarget((Entity *)EVar15,pEVar6); } } goto LAB_0056a0b7; case 0xc: puStack_20 = local_34 + 0x30; isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b619dc); if (isIgnored != 0) { (npc->_targetPosition).y = innerTop; NpcHelper::mother_set_collision_class(4); } isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isIgnored != 0) { (npc->_v1).x = (npc->_pos).y; (npc->_v1).y = 0.0; SoundEffects::PlayWithFartOverride(0x34,1.0,2,0,1.0); Game::ShakeScreen(g_game,0xc); pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); local_13c.x = pVVar5->x + (npc->_pos).x + 0.0; local_13c.y = pVVar5->y + (npc->_pos).y + 60.0; Entity::MakeBloodPoof((Entity *)npc,&local_13c,&npc->_splatColor,1.0); Game::MakeShockwave(g_game,&local_13c,0.04,0.025,0xd); pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos2"); local_13c.x = (npc->_pos).x + pVVar5->x + 0.0; local_13c.y = pVVar5->y + (npc->_pos).y + 60.0; Entity::MakeBloodPoof((Entity *)npc,&local_13c,&npc->_splatColor,1.0); Game::MakeShockwave(g_game,&local_13c,0.04,0.025,0xd); } isIgnored = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((isIgnored != 0) || (isIgnored = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), isIgnored != 0)) { (npc->_v1).x = npc->_speedMultiplier * 20.0 + (npc->_v1).x; iVar14 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar14 != 0) { Entity_NPC::QueryNPCsType(local_34,0x390,0x14); local_14 = 4; local_158.y = 0.0; if ((void *)local_2c.y != (void *)0x0) { fVar22 = local_30; pvVar8 = (void *)local_2c.y; do { pEVar6 = *(Entity **)((int)fVar22 + (int)local_158.y * 4); local_128 = pEVar6; if (pEVar6 != (Entity *)0x0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (pEVar6->_type == 1)) || (pEVar6->_type - 10U < 0x3de)) && (fVar22 = (npc->_v1).x, pfVar1 = &(pEVar6->_pos).y, *pfVar1 <= fVar22 && fVar22 != *pfVar1)) { uVar3 = Random(); local_174._8_4_ = (pEVar6->_pos).x; local_168 = (undefined1 *)(pEVar6->_pos).y; pEVar9 = Game::Spawn(g_game,1000,0x3e,(Vector *)(local_174 + 8),&g_vectorZero, (Entity *)npc,0,uVar3); (**(code **)(*(int *)pEVar9 + 0xc))(); uVar26 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags | 0x40000; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar26; pcVar20 = *(code **)(*(int *)pEVar6 + 0x24); EntityRef::constructor((EntityRef *)(local_78 + 4),(Entity *)npc); (*pcVar20)(local_78 + 4); ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = 1.5; uVar3 = Random(); projParams.HeightModifier = projParams.HeightModifier - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 8.0; uVar3 = Random(); projParams.Variant = 0xf; local_1a4._8_4_ = (local_128->_pos).x; local_198 = (undefined1 *)(local_128->_pos).y; projParams.FallingSpeedModifier = (-3.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0) - (npc->_v1).y; Entity_NPC::FireProjectiles (npc,(Vector *)(local_1a4 + 8),&g_vectorZero,0,&projParams); (npc->_v1).y = (npc->_v1).y + 3.0; pvVar8 = (void *)local_2c.y; } fVar22 = local_30; } local_158.y = (float)((int)local_158.y + 1); } while ((uint)local_158.y < pvVar8); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_34); } } isIgnored = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (isIgnored != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); } npc->_stateFrame = npc->_stateFrame + elapsedFrames; isIgnored = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); puVar18 = puStack_20; if ((isIgnored != 0) && (0x2d < extraout_EDX_00)) { npc->_state = 3; npc->_stateFrame = 0x32; } break; case 0xd: puStack_20 = local_34 + 0x30; isIgnored = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (-1 < npc->_stateFrame) { if (isIgnored != 0) { ANM2::Play(&npc->_sprite,(byte *)"LaserAttackLoop",0); } isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b619dc); if (isIgnored != 0) { (npc->_targetPosition).y = (float)local_140; NpcHelper::mother_set_collision_class(0); } isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (isIgnored != 0) { play_sound_with_fart_seed(0x274,1.0,2,0,1.0); } isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isIgnored != 0) { uVar3 = Random(); npc->_i2 = 1; npc->_projectileCooldown = uVar3 & 1; (npc->_v1).x = 30.0; } isIgnored = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((isIgnored != 0) || (isIgnored = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), isIgnored != 0)) { Game::ShakeScreen(g_game,4); iVar14 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if (iVar14 != 0) { local_13c.y = roomLeft + 20.0; uVar3 = Random(); local_158.x = ((roomRight - 20.0) - local_13c.y) * (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 + local_13c.y; local_158.y = (float)local_134 - 20.0; uVar3 = Random(); local_158.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 40.0 + local_158.y; Color::Color((Color *)local_78); Game::SpawnParticles(g_game,&local_158,4,1,6.0,color,100000.0,0x20000); uVar3 = Random(); if (uVar3 % 3 == 0) { spawn_blood_explosion(2,&local_158,&g_vectorZero,&g_colorGreenSplat,&g_vectorZero); } } } iVar14 = npc->_stateFrame + elapsedFrames; npc->_stateFrame = iVar14; puVar18 = puStack_20; if (0x78 < iVar14) { ANM2::Play(&npc->_sprite,(byte *)"LaserAttackEnd",0); npc->_state = 3; npc->_stateFrame = -1; puVar18 = puStack_20; } break; } puVar18 = puStack_20; if (isIgnored == 0) break; pAVar16 = &npc->_sprite; goto LAB_0056a0ab; case 0x10: puStack_20 = local_34 + 0x30; isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (isIgnored != 0) { iVar14 = npc->_i1; if (((iVar14 == 0) || (iVar14 == 1)) || (iVar14 == 3)) { piVar10 = (int *)FUN_0044bc90(1); if (*piVar10 == 0) { piVar10 = (int *)FUN_0044bc90(2); if (*piVar10 != 0) { puVar11 = (undefined4 *)FUN_0044bc90(2); (**(code **)(*(int *)*puVar11 + 0x28))(uVar3); uVar26 = 2; goto LAB_0056b7ea; } } else { puVar11 = (undefined4 *)FUN_0044bc90(1); (**(code **)(*(int *)*puVar11 + 0x28))(); uVar26 = 1; LAB_0056b7ea: pEVar12 = (EntityPtr *)FUN_0044bc90(uVar26); EntityPtr::SetReference(pEVar12,(Entity *)0x0); } local_13c.y = (npc->_posOffset).x + (npc->_pos).x; local_164.y = (npc->_pos).y + (npc->_posOffset).y; pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); local_18c.x = local_13c.y + pVVar5->x; local_18c.y = local_164.y + pVVar5->y; spawn_gibs(&local_18c,9,40.0,(uint *)((int)npc->_config + 0x60),(Entity *)npc, &npc->_splatColor,&g_vectorZero,1.0); spawn_blood_explosion(4,&local_18c,&g_vectorZero,&npc->_splatColor,&g_vectorZero); play_sound_with_fart_seed(0x8d,1.0,2,0,1.0); iVar14 = npc->_i1; } if (iVar14 == 2) { local_13c.y = (npc->_posOffset).x + (npc->_pos).x; local_174._8_4_ = 0.0; local_168 = (undefined1 *)0xc1200000; local_164.y = (npc->_pos).y + (npc->_posOffset).y; pVVar5 = Entity::GetNullOffset((Entity *)npc,&local_2c,(byte *)"ShootPos"); local_150.x = (local_13c.y + pVVar5->x) - 0.0; local_150.y = (local_164.y + pVVar5->y) - -10.0; laser = Entity_Laser::ShootAngle (6,&local_150,90.0,0x2f,(Vector *)(local_174 + 8),(Entity *)npc,0); local_58 = 0.0; local_78._0_4_ = 1.0; local_78._4_4_ = 1.0; fStack_70 = 1.0; fStack_6c = 1.0; local_54 = 0.0; local_68 = 2.0; fStack_64 = 2.2; fStack_60 = 1.0; fStack_5c = 1.0; local_50 = 0.0; (**(code **)(*(int *)laser + 0x3c))(local_78,0xffffffff,0xff,0,1); laser->_renderDepthOffset = 1000.0; Entity_NPC::MakeBloodCloud(npc,&local_150,&npc->_splatColor); iVar14 = npc->_i1; room = currentRoom; } if (iVar14 == 3) { Entity_NPC::MakeBloodCloud(npc,&npc->_pos,&npc->_splatColor); piVar10 = (int *)FUN_0044bc90(0); if (*piVar10 != 0) { puVar11 = (undefined4 *)FUN_0044bc90(0); Entity::SetParent((Entity *)*puVar11,(Entity *)0x0); FUN_0044bc90(0); animName = ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState, (std_string *)(local_4c + 0x10)); local_14 = 5; Sprite::Play(animName,0); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_4c + 0x10); piVar10 = (int *)FUN_0044bc90(0); iVar14 = *piVar10; iVar13 = ANM2::GetFrame(&npc->_sprite); Sprite::SetFrame_1((Sprite *)(iVar14 + 0x48),iVar13); fVar23 = DAT_00c33d3c + (npc->_targetPosition).x; fVar22 = DAT_00c33d40 + (npc->_targetPosition).y; piVar10 = (int *)FUN_0044bc90(0); iVar14 = *piVar10; *(float *)(iVar14 + 0x334) = fVar23; *(float *)(iVar14 + 0x338) = fVar22; piVar10 = (int *)FUN_0044bc90(0); *(undefined4 *)(*piVar10 + 0x358) = 0x42c80000; } Entity_NPC::Morph(npc,0x390,10,0,-1); pEVar12 = (EntityPtr *)FUN_0044bc90(0); EntityPtr::SetReference(pEVar12,(Entity *)0x0); ANM2::Play(&npc->_sprite,(byte *)"ChargeLoop",0); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; npc->_state = 0x10; npc->_i1 = 0; npc->_i2 = 0; npc->_health = npc->_maxHitPoints; uVar26 = *(undefined4 *)((int)&npc->_flags + 4); (npc->_velocity).x = 0.0; (npc->_velocity).y = 16.0; npc->_entityCollisionClass = 4; *(undefined4 *)((int)&npc->_flags + 4) = uVar26; npc->_isInvicible = 0; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = 60.0; local_174._8_4_ = (npc->_pos).x + 0.0; local_168 = (undefined1 *)((npc->_pos).y + 100.0); Camera::SetFocusPosition(currentRoom->_Camera,(Vector *)(local_174 + 8)); ExceptionList = local_1c; return; } npc->_i1 = iVar14 + 1; } if (((npc->_i1 == 3) && (isIgnored = Entity::IsFrame((Entity *)npc,2,0), isIgnored != 0)) && (local_134 = (Entity_NPC *)0x1, 1 < room->_gridHeight + -1)) { LAB_0056bc51: iVar14 = room->_gridWidth; local_12d = '\0'; local_128 = (Entity *)0x1; if (iVar14 + -1 < 2) goto LAB_0056c068; while ((((((-1 < (int)local_128 && ((int)local_128 < iVar14)) && (-1 < (int)local_134)) && (((int)local_134 < room->_gridHeight && (iVar14 = (int)(&(local_128->_sprite)._filename + -3) + iVar14 * (int)local_134, -1 < iVar14)))) && (local_124 = room->_gridEntities[iVar14], local_124 != (Entity *)0x0)) && (*(int *)((int)local_124 + 4) == 0xf))) { Color::Color((Color *)local_78); iVar14 = *(int *)((int)g_game->_room + 0xc); local_174._8_4_ = (float)(*(int *)(extraout_EDX_01 + 0x24) % iVar14) * 40.0 + 40.0; local_168 = (undefined1 *) ((float)(*(int *)(extraout_EDX_01 + 0x24) / iVar14) * 40.0 + 120.0); Game::SpawnParticles(g_game,(Vector *)(local_174 + 8),4,1,6.0,color_00,100000.0,0); uVar3 = Random(); if (uVar3 % 3 == 0) { iVar14 = *(int *)((int)g_game->_room + 0xc); local_190 = (EntityPtr)((float)(*(int *)((int)local_124 + 0x24) % iVar14) * 40.0 + 40.0); local_158.y = (float)(*(int *)((int)local_124 + 0x24) / iVar14) * 40.0 + 120.0; uVar3 = Random(); local_13c.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_13c.y = local_13c.y + local_13c.y; local_178 = (EntityPtr)sin(local_13c.y); uVar3 = Random(); local_164.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 40.0; fVar22 = cos(local_13c.y); local_1a4._8_4_ = fVar22 * local_164.y + (float)local_190; local_198 = (undefined1 *)(local_158.y + (float)local_178 * local_164.y); spawn_blood_explosion (2,(Vector *)(local_1a4 + 8),&g_vectorZero,&g_colorGreenSplat,&g_vectorZero); } uVar3 = Random(); iVar14 = *(int *)((int)g_game->_room + 0xc); local_1ac.x = (float)(*(int *)((int)local_124 + 0x24) % iVar14) * 40.0 + 40.0; local_1ac.y = (float)(*(int *)((int)local_124 + 0x24) / iVar14) * 40.0 + 120.0; pEVar6 = Game::Spawn(g_game,1000,7,&local_1ac,&g_vectorZero,(Entity *)mother,0,uVar3); uVar3 = Random(); splatColor = &mother->_splatColor; iVar14 = *(int *)pEVar6; fVar23 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 + 2.0; fVar22 = fVar23 * g_vectorOne.x; (pEVar6->_sprite)._scale.y = fVar23 * g_vectorOne.y; (pEVar6->_sprite)._scale.x = fVar22; (**(code **)(iVar14 + 0x3c))(splatColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar6 + 0xc))(); pEVar6 = local_124; local_13c.y = 1.4013e-45; iVar14 = *(int *)((int)g_game->_room + 0xc); local_2c.x = (float)(*(int *)((int)local_124 + 0x24) % iVar14) * 40.0 + 40.0; local_2c.y = (float)(*(int *)((int)local_124 + 0x24) / iVar14) * 40.0 + 120.0; spawn_gibs(&local_2c,2,40.0,(uint *)&local_13c.y,(Entity *)0x0,splatColor,&g_vectorZero,1.0) ; room = currentRoom; uVar3 = *(uint *)((int)pEVar6 + 0x24); if (((uVar3 < 0x1c0) && (puVar11 = currentRoom->_gridEntities[uVar3], puVar11 != (undefined4 *)0x0)) && (puVar11[1] != 1)) { currentRoom->_gridPaths[uVar3] = 900; currentRoom->_gridEntities[uVar3] = (void *)0x0; (**(code **)*puVar11)(1); } iVar14 = room->_gridWidth; local_128 = (Entity *)&local_128->field_0x1; local_12d = '\x01'; if (iVar14 + -1 <= (int)local_128) goto LAB_0056c080; } if (local_12d == '\0') goto LAB_0056c068; LAB_0056c080: pEVar21 = local_134; iVar14 = Room::GetGridIndexByTile(room,0,(int)local_134); Room::GetGridPosition(room,(Vector *)(local_174 + 8),iVar14); SoundEffects::PlayWithFartOverride2(0x4d,unused,2,0,1.0,1.0); EntityList::QuerySublist(&room->_entityList,(EntityList_EL *)local_174,1000,0x8c,-1,0,0); local_14 = 6; local_128 = (Entity *)0x0; if (local_168 != (undefined1 *)0x0) { pvVar8 = (void *)local_174._4_4_; puVar18 = local_168; do { piVar10 = *(int **)((int)pvVar8 + (int)local_128 * 4); if ((piVar10 != (int *)0x0) && (piVar10[10] == 1000)) { if (pEVar21 == (Entity_NPC *)(room->_gridHeight + -1)) { (**(code **)(*piVar10 + 0x28))(); puVar18 = local_168; } else { piVar10[0xcf] = (int)((float)piVar10[0xcf] + 0.0); piVar10[0xd0] = (int)((float)piVar10[0xd0] + 40.0); } pvVar8 = (void *)local_174._4_4_; } local_128 = (Entity *)&local_128->field_0x1; } while (local_128 < puVar18); } Room::update_bounds(room,0); local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_174); LAB_0056c187: npc = mother; } puVar18 = puStack_20; if ((npc->_sprite)._animState._animData != (void *)0x0) { isIgnored = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); puVar18 = puStack_20; if (isIgnored != 0) { iVar14 = 0xd4; goto LAB_0056c1b5; } } break; case 0x13: isIgnored = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); puVar18 = puStack_20; if (isIgnored != 0) { pEVar6 = Entity_NPC::GetPlayerTarget(npc); local_164.y = (pEVar6->_pos).x - (npc->_pos).x; local_178 = (EntityPtr)((pEVar6->_pos).y - (npc->_pos).y); local_13c.y = local_164.y * 0.0 + (float)local_178; local_148.x = local_164.y; local_148.y = (float)local_178; fVar22 = sqrtf((float)local_178 * (float)local_178 + local_164.y * local_164.y); if (local_13c.y < fVar22 * 0.5) { fVar22 = fVar22 * 0.5 - local_13c.y; local_148.y = fVar22 + (float)local_178; local_148.x = fVar22 * 0.0 + local_164.y; } play_sound_with_fart_seed(0xd5,1.0,2,0,1.0); Entity_NPC::MakeBloodCloud(npc,&npc->_pos,&npc->_splatColor); uVar3 = Random(); pVVar5 = Vector::Resized(&local_148,&local_2c,16.0); pEVar6 = Game::Spawn(g_game,0x390,100,&npc->_pos,pVVar5,(Entity *)npc,0,uVar3); pVVar5 = Vector::Resized(&local_148,(Vector *)(local_174 + 8),2.0); fVar22 = pVVar5->y; (pEVar6->_targetPosition).x = pVVar5->x; (pEVar6->_targetPosition).y = fVar22; Entity::SetParent(pEVar6,(Entity *)npc); Entity_NPC::SetRef_bec(npc,pEVar6); pEVar9 = Entity_NPC::GetPlayerTarget(npc); Entity::SetTarget(pEVar6,pEVar9); (**(code **)(*(int *)pEVar6 + 0xc))(); goto LAB_0056a0b7; } } puStack_20 = puVar18; iVar14 = npc->_i2; if (0 < iVar14) { if (0 < elapsedFrames) { do { room = currentRoom; iVar14 = npc->_i2; fVar23 = (npc->_v1).x + 1.0; (npc->_v1).x = fVar23; fVar22 = 20.0 - (float)iVar14 * 0.5; if (fVar22 <= 6.0) { fVar22 = 6.0; } if (fVar22 <= fVar23) { iVar14 = 10; local_178 = (EntityPtr)(roomLeft + 20.0); local_148.y = 0.0; local_148.x = 0.0; local_164.y = (roomRight - 20.0) - (float)local_178; local_190 = (EntityPtr)(bottomWallPos.y + 40.0); local_128 = (Entity *)(int)(((float)local_190 - 120.0) / 40.0 + 0.5); while( true ) { uVar3 = Random(); local_148.y = (float)local_190; local_148.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * local_164.y + (float)local_178; iVar13 = (int)((local_148.x - 40.0) / 40.0 + 0.5); if (((iVar13 < 0) || (room->_gridWidth <= iVar13)) || ((int)local_128 < 0)) break; if (((room->_gridHeight <= (int)local_128) || (uVar3 = (int)local_128 * room->_gridWidth + iVar13, 0x1bf < uVar3)) || ((room->_gridPaths[uVar3] < 0x65 || (iVar14 = iVar14 + -1, iVar14 < 1)))) break; } Room::RaiseGridPathAtPos(room,&local_148,900); manager = g_manager; local_128 = (Entity *)0x281; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,(int)local_128,1.0,2,0,1.0,0.0); uVar3 = Random(); npc = mother; pEVar6 = Game::Spawn(g_game,0x390,0x14,&local_148,&g_vectorZero,(Entity *)mother,0,uVar3); fVar22 = npc->_size; fVar23 = (npc->_pos).y; iVar14 = *(int *)pEVar6; (pEVar6->_targetPosition).x = local_148.x; (pEVar6->_targetPosition).y = (fVar22 + fVar23) - 40.0; (**(code **)(iVar14 + 0xc))(); npc->_i2 = npc->_i2 + 1; iVar14 = npc->_i2; (npc->_v1).x = 0.0; } elapsedFrames = elapsedFrames + -1; } while (elapsedFrames != 0); } manager = g_manager; if (0x22 < iVar14) { npc->_i2 = -1; local_128 = (Entity *)0x275; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,(int)local_128,1.0,2,0,1.0,0.0); } } if ((npc->_targetPosition).y == (float)local_140) { local_124 = (Entity *)(npc->_pos).y; if (innerTop == (float)local_140) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar22 = ((float)local_124 - innerTop) / ((float)local_140 - innerTop); if (fVar22 <= 0.0) { fVar22 = 0.0; } if (1.0 <= fVar22) { fVar22 = 1.0; } fVar22 = fVar22 + 0.0; } else { fVar22 = 0.0; } pbVar19 = (byte *)0x0; if ((npc->_sprite)._layerCount != 0) { local_124 = (Entity *)((uint)fVar22 ^ 0x80000000); local_13c.y = 1.0 - fVar22 * 0.5; do { layer = ANM2::GetLayer(&npc->_sprite,pbVar19); (layer->_color)._tint[0] = local_13c.y; (layer->_color)._tint[1] = local_13c.y; (layer->_color)._tint[2] = local_13c.y; (layer->_color)._tint[3] = 1.0; layer = ANM2::GetLayer(&npc->_sprite,pbVar19); pbVar19 = pbVar19 + 1; (layer->_color)._colorize[0] = 1.0; (layer->_color)._colorize[1] = 1.0; (layer->_color)._colorize[2] = 1.0; (layer->_color)._colorize[3] = (float)local_124; } while (pbVar19 < (byte *)(npc->_sprite)._layerCount); } local_140 = npc->_entityRef; if (((local_140 != (EntityPtr)0x0) && (*(float *)((int)*(void **)((int)local_140 + 0x330) + 0x44) + 6.0 <= *(float *)((int)local_140 + 0x37c))) && ((*(float *)((int)local_140 + 0x364) <= 0.0 && *(float *)((int)local_140 + 0x364) != 0.0 && (fVar22 = (npc->_pos).y + 100.0, *(float *)((int)local_140 + 0x340) <= fVar22 && fVar22 != *(float *)((int)local_140 + 0x340))) )) { if ((*(int *)((int)local_140 + 0x28) == 0x390) && (*(int *)((int)local_140 + 0x2c) == 100)) { Entity_NPC::SetRef_bec((Entity_NPC *)local_140,(Entity *)npc); local_140 = npc->_entityRef; if (*(byte *)((int)local_140 + 0x173) == 0) { ENTITY_MOTHER_ball_burst((Entity_NPC *)local_140); local_140 = npc->_entityRef; } } pcVar20 = *(code **)(*(int *)local_140 + 0x24); EntityRef::constructor((EntityRef *)(local_78 + 4),(Entity *)npc); (*pcVar20)(local_78 + 4); if (npc->_state != 0x10) { ANM2::Play(&npc->_sprite,(byte *)"Stunned",0); npc->_state = 5; } } LAB_0056c6a7: EVar15 = npc->_parent; pVVar5 = &npc->_velocity; if (EVar15 == (EntityPtr)0x0) { fVar22 = (npc->_targetPosition).y; fVar23 = (npc->_targetPosition).x; } else { uVar17 = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar3 = 3; if (uVar17 < 3) { uVar3 = uVar17; } fVar22 = *(float *)((int)EVar15 + 0x338) + *(float *)(&DAT_00c33d38 + uVar3 * 8); fVar23 = *(float *)((int)EVar15 + 0x334) + *(float *)(&DAT_00c33d34 + uVar3 * 8); } fVar25 = (npc->_pos).y; pVVar5->x = fVar23 - (npc->_pos).x; (npc->_velocity).y = fVar22 - fVar25; if (npc->_parent == (EntityPtr)0x0) { iVar14 = npc->_entityCollisionClass; } else { iVar14 = *(int *)((int)npc->_parent + 0x188); } if (iVar14 == 0) { pVVar5->x = pVVar5->x * 0.5; (npc->_velocity).y = (npc->_velocity).y * 0.5; } ExceptionList = local_1c; return; LAB_0056c068: local_134 = (Entity_NPC *)&local_134->field_0x1; if (room->_gridHeight + -1 <= (int)local_134) goto LAB_0056c187; goto LAB_0056bc51; } //@@ 0056c7c0 FUN_0056c7c0 void FUN_0056c7c0(void) { int in_ECX; *(undefined4 *)(in_ECX + 0xbc0) = 0; *(undefined4 *)(in_ECX + 0xbc4) = 0; *(undefined4 *)(in_ECX + 0x410) = 0; *(undefined4 *)(in_ECX + 0xba4) = 0; *(undefined4 *)(in_ECX + 0xba0) = 0; return; } //@@ 0056c800 NpcHelper::mother_2_slam_burst /* DB: ? ECX=npc, arg &npc->_velocity: clamped position, sfx 0x288 (with seed_fart_sound_override), Game::ShakeScreen 12, spawns effect 1000.2 with random angle/height and green splat color; called twice from NpcAI::ENTITY_MOTHER_2 after the same sfx */ void NpcHelper::mother_2_slam_burst(float *param_1) { uint rngResult; Entity *spawnedEffect; uint uVar1; int in_ECX; int iVar2; int iVar3; float fVar4; Vector local_3c; Vector local_34; Vector slamPos; float local_24; float local_20; float local_1c; float local_18; float backDirX; Manager *manager; Room::GetClampedPositionImpl (g_game->_room,&slamPos,(Vector *)(in_ECX + 0x33c),10.0,10.0,10.0,10.0); manager = g_manager; local_18 = 1.079e-43; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,(int)local_18,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xc); rngResult = Random(); spawnedEffect = Game::Spawn(g_game,1000,2,&slamPos,&g_vectorZero,(Entity *)0x0,4,rngResult); rngResult = Random(); (spawnedEffect->_sprite)._rotation = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 360.0; rngResult = Random(); (spawnedEffect->_posOffset).x = 0.0; (spawnedEffect->_posOffset).y = -10.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 20.0; (**(code **)(*(int *)spawnedEffect + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawnedEffect + 0xc))(); local_18 = param_1[1]; backDirX = *param_1; fVar4 = sqrtf(local_18 * local_18 + backDirX * backDirX); if (0.0 < fVar4) { local_18 = local_18 * (1.0 / fVar4); backDirX = backDirX * (1.0 / fVar4); } backDirX = -backDirX; local_18 = -local_18; iVar2 = 0xc; do { iVar3 = iVar2; rngResult = Random(); local_20 = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 - 0.5) * 90.0 * 0.017453292; local_1c = cos(local_20); fVar4 = sin(local_20); local_20 = local_18 * local_1c + backDirX * fVar4; local_1c = backDirX * local_1c - local_18 * fVar4; rngResult = Random(); local_24 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 10.0 + 20.0; rngResult = Random(); fVar4 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; local_3c.y = fVar4 * local_20 * 5.0 + slamPos.y; local_3c.x = fVar4 * local_1c * 5.0 + slamPos.x; rngResult = Random(); local_34.x = local_24 * local_1c; local_34.y = local_24 * local_20; spawnedEffect = Game::Spawn(g_game,1000,4,&local_3c,&local_34,(Entity *)0x0,0,rngResult); (**(code **)(*(int *)spawnedEffect + 0xc))(); iVar2 = iVar3 + -1; } while (iVar2 != 0); iVar3 = iVar3 + 0xb; do { rngResult = Random(); local_24 = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 - 0.5) * 90.0 * 0.017453292; local_20 = cos(local_24); fVar4 = sin(local_24); local_1c = local_18 * local_20 + backDirX * fVar4; local_20 = backDirX * local_20 - local_18 * fVar4; rngResult = Random(); local_24 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 25.0 + 5.0; rngResult = Random(); fVar4 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; local_34.y = fVar4 * local_1c * 5.0 + slamPos.y; local_34.x = fVar4 * local_20 * 5.0 + slamPos.x; rngResult = Random(); uVar1 = Random(); if (uVar1 % 5 == 0) { uVar1 = 0; } else { uVar1 = Random(); uVar1 = (~uVar1 & 1) + 3; } local_3c.x = local_24 * local_20; local_3c.y = local_24 * local_1c; spawnedEffect = Game::Spawn(g_game,1000,2,&local_34,&local_3c,(Entity *)0x0,uVar1,rngResult); rngResult = Random(); (spawnedEffect->_posOffset).x = 0.0; (spawnedEffect->_posOffset).y = -10.0; iVar2 = *(int *)spawnedEffect; (spawnedEffect->_sprite)._rotation = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 360.0; (**(code **)(iVar2 + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawnedEffect + 0xc))(); iVar3 = iVar3 + -1; } while (iVar3 != 0); return; } //@@ 0056cd60 NpcAI::ENTITY_MOTHER_2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: 912.10 by the 912 variant table at 006c4964 (boss_approx_3) */ void __fastcall NpcAI::ENTITY_MOTHER_2(Entity_NPC *npc) { float fVar1; float fVar2; double dVar3; code *pcVar4; Vector sizeMulti; undefined1 *puVar5; byte bVar6; char cVar7; byte *pbVar8; uint uVar9; Vector *tmpVec; float *pfVar10; ColorMod *color; Entity_Effect *bloodCloud; Entity_Projectile *shot; Entity *tmpEntity; void *pvVar11; float *edgeDistance; LayerState *layer; ColorMod *color_00; undefined4 uVar12; char *animName; ANM2 *sprite; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 extraout_ECX_03; uint uVar13; Room *room; int iVar14; Entity_NPC **layerAlpha; bool bVar15; bool bVar16; float fVar17; Entity_NPC *pEVar18; Entity_NPC *pEVar19; Entity_NPC *pEVar20; float fVar21; EntityRef damageSource; ProjectileParams spinBaseParams; undefined1 local_1c0; Vector spawnVelocity; Vector spawnPos; Vector local_1a0; Vector local_198; Vector local_190; Vector local_188; Entity_NPC *local_180; Room *local_17c; float local_178; float local_174; float local_170; Entity_NPC *local_16c; Entity_NPC *local_168; float local_164; Entity_NPC *local_160; Entity_NPC *local_15c; ProjectileParams params; Color effectColor; ColorMod tintColor; char local_54 [4]; undefined1 local_50 [8]; void *local_48; Vector local_44; undefined1 local_3c [16]; Vector scratchVec; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af4f9d; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; local_198.y = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); room = g_game->_room; local_174 = (room->_topLeftPos).x; local_170 = (room->_topLeftPos).y; local_15c = (Entity_NPC *)(room->_bottomRightPos).x; local_16c = (Entity_NPC *)(room->_bottomRightPos).y; local_17c = room; local_168 = npc; puVar5 = local_3c + 0x38; if (((npc->_sprite)._animState._animData != (void *)0x0) && (puVar5 = local_3c + 0x38, (npc->_sprite)._animState._isPlaying != 0)) { pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { pbVar8 = &s_empty; } else if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } animName = "Death"; do { bVar6 = *pbVar8; bVar15 = bVar6 < (byte)*animName; if (bVar6 != *animName) { LAB_0056ce60: uVar9 = -(uint)bVar15 | 1; goto LAB_0056ce65; } if (bVar6 == 0) break; bVar6 = pbVar8[1]; bVar15 = bVar6 < (byte)animName[1]; if (bVar6 != animName[1]) goto LAB_0056ce60; pbVar8 = pbVar8 + 2; animName = animName + 2; } while (bVar6 != 0); uVar9 = 0; LAB_0056ce65: puVar5 = local_3c + 0x38; if (uVar9 == 0) { bVar6 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); if (bVar6 == 0) { puVar5 = puStack_20; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar6 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); puVar5 = puStack_20; if (bVar6 != 0) { local_164 = 9.03838e-43; goto LAB_0056ceab; } } } else { local_164 = 8.67404e-43; LAB_0056ceab: manager = g_manager; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); room = local_17c; puVar5 = puStack_20; } } puStack_20 = puVar5; puVar5 = puStack_20; } puStack_20 = puVar5; sprite = &npc->_sprite; switch(npc->_state) { case 0: npc->_i1 = 0; npc->_i2 = 0; npc->_stateFrame = 0; npc->_projectileDelay = 0; npc->_projectileCooldown = 0; goto LAB_0056fb63; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(sprite,s_Idle,0); } bVar6 = 1; iVar14 = 900; fVar21 = 0.2; tmpVec = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,tmpVec,fVar21,iVar14,bVar6); npc->_projectileCooldown = npc->_projectileCooldown - (int)local_198.y; if ((npc->_projectileCooldown < 1) && ((uVar9 = Random(), uVar9 % 0xf == 0 || (npc->_projectileCooldown < -0x3c)))) { uVar9 = Random(); manager = g_manager; uVar9 = uVar9 & 3; if (uVar9 == 0) { npc->_state = 0xc; local_164 = 9.05239e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); ANM2::Play(&npc->_sprite,&DAT_00b1e0e4,0); npc->_stateFrame = 0; npc->_i1 = 0; npc->_projectileCooldown = 0xf0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } else if (uVar9 == 1) { npc->_state = 10; ANM2::Play(&npc->_sprite,(byte *)"ShootBegin",0); npc->_stateFrame = 0; npc->_projectileCooldown = 0xf0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar21 = atan2f((tmpEntity->_pos).y - (npc->_pos).y,(tmpEntity->_pos).x - (npc->_pos).x); (npc->_v1).x = fVar21 * 57.295776; } else if (uVar9 == 2) { npc->_state = 9; local_164 = 8.92627e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); npc->_i1 = 0; uVar9 = Random(); npc->_stateFrame = 0; npc->_i2 = uVar9 & 3; npc->_projectileCooldown = 0x5a; } else { local_164 = 8.91226e-43; seed_fart_sound_override((int *)&local_164); SoundEffects::Play(&manager->_sfxManager,(int)local_164,1.0,2,0,1.0,0.0); ANM2::Play(&npc->_sprite,(byte *)"SpinBegin",0); npc->_state = 8; npc->_stateFrame = 0; npc->_projectileCooldown = 0x5a; } } break; case 6: fVar21 = npc->_speedMultiplier; fVar17 = 0.8; npc->_friction = npc->_friction * 0.85; game = g_game; if (fVar21 != 1.0) { fVar17 = 0.8 / ((fVar21 + 0.8) - fVar21 * 0.8); } fVar1 = (npc->_targetPosition).x; fVar2 = (npc->_pos).x; (npc->_velocity).y = fVar21 * (npc->_targetPosition).y * 4.5 + (npc->_velocity).y; (npc->_velocity).x = ((fVar1 - fVar2) - (npc->_velocity).x) * (1.0 - fVar17) + (npc->_velocity).x; Game::ShakeScreen(game,3); fVar21 = (npc->_pos).y; local_1a0.y = 0.0; local_160 = (Entity_NPC *)(fVar21 - (float)local_16c); local_180 = (Entity_NPC *)(local_170 - fVar21); pfVar10 = (float *)&local_160; if ((float)local_160 <= (float)local_180) { pfVar10 = (float *)&local_180; } edgeDistance = &local_1a0.y; if (0.0 < (float)*pfVar10) { edgeDistance = pfVar10; } local_180 = (Entity_NPC *)0x0; local_160 = (Entity_NPC *)(1.0 - (float)*edgeDistance * 0.005); layerAlpha = &local_160; if ((float)local_160 <= 0.0) { layerAlpha = &local_180; } local_188.y = 0.0; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,(byte *)local_188.y); (layer->_color)._tint[3] = (float)*layerAlpha; local_188.y = (float)((int)local_188.y + 1); } while ((uint)local_188.y < (byte *)(npc->_sprite)._layerCount); } scratchVec.x = DAT_00c5c8e0 + (npc->_pos).x; scratchVec.y = DAT_00c5c8e4 * (npc->_targetPosition).y + (npc->_pos).y; Room::GetFloorColorAt(g_game->_room,(KColor *)local_50,&scratchVec,npc->_size); bVar6 = Entity::IsFrame((Entity *)npc,2,0); if (bVar6 != 0) { local_168 = (Entity_NPC *)0x0; do { pEVar18 = local_168; local_180 = (Entity_NPC *)(&DAT_00c5c8d0)[(int)local_168 * 2]; local_1a0.y = (float)(&DAT_00c5c8d4)[(int)local_168 * 2]; local_44.y = (npc->_targetPosition).y; local_160 = (Entity_NPC *)(npc->_pos).x; local_164 = (npc->_pos).y; uVar9 = Random(); fVar21 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_188.y = fVar21 + fVar21; uVar9 = Random(); local_178 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 20.0; fVar21 = cos(local_188.y); local_198.x = fVar21 * local_178 + (float)local_160 + (float)local_180; fVar21 = sin(local_188.y); local_198.y = fVar21 * local_178 + local_1a0.y * local_44.y + local_164; if ((pEVar18 == (Entity_NPC *)0x0) || (pEVar18 == (Entity_NPC *)&DAT_00000004)) { uVar9 = Random(); scratchVec.x = (float)(&DAT_00c5c8d0)[(int)pEVar18 * 2] * 0.06; scratchVec.y = (npc->_targetPosition).y * 3.0; tmpEntity = Game::Spawn(g_game,1000,2,&local_198,&scratchVec,(Entity *)0x0,4,uVar9); uVar9 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar9 = Random(); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -5.0 - (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 10.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); pEVar18 = local_168; } uVar9 = Random(); if (uVar9 % 6 == 0) { Color::Color(&effectColor); Game::SpawnParticles(g_game,&local_198,4,2,6.0,color_00,100000.0,0x20000); } local_168 = (Entity_NPC *)&pEVar18->field_0x1; } while (local_168 < &DAT_00000005); } manager = g_manager; fVar21 = (npc->_targetPosition).y; if (ABS(fVar21) == 1.0) { fVar17 = (npc->_pos).y; if (fVar21 <= 0.0) { fVar17 = fVar17 - 20.0; bVar15 = local_170 == fVar17; bVar16 = local_170 < fVar17; } else { fVar17 = fVar17 + 20.0; bVar15 = fVar17 == (float)local_16c; bVar16 = fVar17 < (float)local_16c; } if (!(bVar16 || bVar15)) { local_188.y = 9.24857e-44; seed_fart_sound_override((int *)&local_188.y); SoundEffects::Play(&manager->_sfxManager,(int)local_188.y,1.0,2,0,1.0,0.0); (npc->_targetPosition).y = (npc->_targetPosition).y * 0.95; NpcHelper::mother_2_slam_burst(&npc->_velocity,extraout_ECX_02); fVar21 = (npc->_targetPosition).y; } } if ((0.0 < fVar21) && ((float)local_16c + 400.0 < (npc->_pos).y)) { ANM2::Play(&npc->_sprite,(byte *)"ChargeUpLoop",0); (npc->_targetPosition).y = (float)&DAT_bf800000; local_188.y = 8.96831e-44; fVar21 = ((float)local_15c - (npc->_targetPosition).x) + local_174; (npc->_pos).x = fVar21; (npc->_targetPosition).x = fVar21; (npc->_pos).y = (float)local_16c + 90.0; (npc->_velocity).x = 0.0; (npc->_velocity).y = -8.0; manager = g_manager; seed_fart_sound_override((int *)&local_188.y); SoundEffects::Play(&manager->_sfxManager,(int)local_188.y,1.0,2,0,1.0,0.0); manager = g_manager; local_188.y = 9.08041e-43; seed_fart_sound_override((int *)&local_188.y); SoundEffects::Play(&manager->_sfxManager,(int)local_188.y,1.0,2,0,1.0,0.0); NpcHelper::mother_2_slam_burst(&npc->_velocity,extraout_ECX_03); break; } if ((0.0 <= fVar21) || (pfVar10 = &(npc->_pos).y, local_170 - 400.0 < *pfVar10 || local_170 - 400.0 == *pfVar10)) break; tmpVec = Room::GetCenterPos(&scratchVec); fVar21 = tmpVec->x; (npc->_pos).x = fVar21; fVar17 = tmpVec->y; (npc->_pos).y = fVar17; (npc->_targetPosition).x = fVar21; (npc->_targetPosition).y = fVar17; ANM2::Play(&npc->_sprite,(byte *)"JumpDown",0); play_sound_with_fart_seed(0x27b,1.0,2,0,1.0); pbVar8 = (byte *)0x0; npc->_state = 7; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 3; if ((npc->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar8); pbVar8 = pbVar8 + 1; (layer->_color)._tint[3] = 1.0; } while (pbVar8 < (byte *)(npc->_sprite)._layerCount); } pvVar11 = npc->_config; iVar14 = *(int *)((int)pvVar11 + 0x48); fVar21 = *(float *)((int)pvVar11 + 0x40); fVar17 = *(float *)((int)pvVar11 + 0x3c); goto LAB_0056f026; case 7: npc->_friction = npc->_friction * 0.85; fVar21 = (npc->_targetPosition).y; fVar17 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar21 - fVar17; bVar6 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar6 != 0) { npc->_entityCollisionClass = 4; play_sound_with_fart_seed(0x289,1.0,2,0,1.0); play_sound_with_fart_seed(0x27e,1.0,2,0,1.0); Game::ShakeScreen(g_game,0x12); uVar9 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x10,&npc->_pos,&g_vectorZero,(Entity *)npc,3,uVar9); fVar21 = g_vectorOne.y * 2.0; iVar14 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.x = g_vectorOne.x * 2.0; (tmpEntity->_sprite)._scale.y = fVar21; (**(code **)(iVar14 + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); uVar9 = Random(); (tmpEntity->_sprite)._flipX = ~(byte)uVar9 & 1; (**(code **)(*(int *)tmpEntity + 0xc))(); local_15c = (Entity_NPC *)0x0; do { local_160 = (Entity_NPC *) ((float)((double)(int)local_15c + __uint_to_double_fixup[-((int)local_15c >> 0x1f)]) * 360.0 * 0.0625 * 0.017453292); local_188.y = cos((float)local_160); local_178 = sin((float)local_160); uVar9 = Random(); spawnPos.x = local_188.y * 80.0 + (npc->_pos).x; spawnPos.y = local_178 * 80.0 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,0x48,&spawnPos,&g_vectorZero,(Entity *)npc,2,uVar9); if (tmpEntity->_parent != (EntityPtr)0x0) { local_160 = (Entity_NPC *)&tmpEntity->_parent; std::multiset::erase(&local_160); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); fVar21 = atan2f(local_178,local_188.y); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = fVar21 * 57.295776; if (((uint)local_15c & 1) == 0) { uVar12 = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags | 0x400000; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar12; uVar12 = 6; } else { uVar12 = 4; } *(undefined4 *)(tmpEntity[1]._sprite._filename._buf + 8) = uVar12; *(undefined4 *)(tmpEntity[1]._sprite._filename._buf + 0xc) = uVar12; (**(code **)(*(int *)tmpEntity + 0xc))(); local_15c = (Entity_NPC *)((int)&local_15c->field_0x0 + 1); } while (local_15c < (AnimationState *)0x10); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 0; npc->_stateFrame = 0; } break; case 8: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x1b8,1.0,1.0); ANM2::Play(&npc->_sprite,(byte *)"SpinLoop",0); npc->_friction = 0.7; if ((npc->_sprite)._animState._animData != (void *)0x0) goto LAB_0056d247; LAB_0056d258: pvVar11 = (npc->_sprite)._animState._animData; if ((pvVar11 == (void *)0x0) || (*(char *)((int)pvVar11 + 0x34) == '\0')) break; } else { npc->_friction = 0.7; LAB_0056d247: bVar6 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar6 == 0) goto LAB_0056d258; } local_16c = (Entity_NPC *)0x0; if (0 < (int)local_198.y) { uVar9 = npc->_stateFrame; do { uVar9 = uVar9 + 1; npc->_stateFrame = uVar9; if ((int)uVar9 % 3 == 0) { uVar9 = Random(); pEVar18 = local_168; local_188.y = 1.4013e-45; if ((uVar9 & 1) != 0) { local_188.y = (float)&DAT_00000004; } tmpVec = &local_168->_pos; spawn_gibs(tmpVec,1,40.0,(uint *)&local_188.y,(Entity *)local_168,&npc->_splatColor, &g_vectorZero,3.0); uVar9 = Random(); local_178 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_178 = local_178 + local_178; local_164 = cos(local_178); local_178 = sin(local_178); uVar9 = Random(); spawnVelocity.y = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 8.0 + 4.0; spawnVelocity.x = spawnVelocity.y * local_164; spawnPos.x = local_164 * 70.0 + tmpVec->x; spawnVelocity.y = spawnVelocity.y * local_178; spawnPos.y = local_178 * 70.0 + (pEVar18->_pos).y; uVar9 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&spawnPos,&spawnVelocity,(Entity *)0x0,2,uVar9); (**(code **)(*(int *)tmpEntity + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = -50.0; tmpEntity->_renderDepthOffset = 10.0; uVar9 = local_168->_stateFrame; npc = local_168; } uVar13 = uVar9 & 0x80000003; bVar15 = uVar13 == 0; if ((int)uVar13 < 0) { bVar15 = (uVar13 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar15) { ProjectileParams::ProjectileParams(&spinBaseParams); spinBaseParams.Color._offset[2] = DAT_00c34d1c; spinBaseParams.Color._tint[0] = _DAT_00c34cf4; spinBaseParams.Color._tint[1] = fRam00c34cf8; spinBaseParams.Color._tint[2] = fRam00c34cfc; spinBaseParams.Color._tint[3] = fRam00c34d00; spinBaseParams.Color._colorize[0] = _DAT_00c34d04; spinBaseParams.Color._colorize[1] = fRam00c34d08; spinBaseParams.Color._colorize[2] = fRam00c34d0c; spinBaseParams.Color._colorize[3] = fRam00c34d10; spinBaseParams.Color._offset[0] = (float)DAT_00c34d14; spinBaseParams.Color._offset[1] = DAT_00c34d14._4_4_; uVar9 = Random(); spinBaseParams.ChangeFlags._0_4_ = (uint)spinBaseParams.ChangeFlags | 0x8000020; spinBaseParams.FallingAccelModifier = -0.095; local_1c0 = 1; spinBaseParams.BulletFlags._0_4_ = 0x20; spinBaseParams.BulletFlags._4_4_ = 1; spinBaseParams.ChangeTimeout = 10; spinBaseParams.Acceleration = 1.03; spinBaseParams.Scale = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.7; uVar9 = npc->_stateFrame & 0x80000007; bVar15 = uVar9 == 0; if ((int)uVar9 < 0) { bVar15 = (uVar9 - 1 | 0xfffffff8) == 0xffffffff; } if (bVar15) { spinBaseParams.WiggleFrameOffset = 0x1e; } local_164 = 4.0; local_15c = (Entity_NPC *)0x40800000; if (npc->_stateFrame % 0xc == 0) { local_164 = 2.8; spinBaseParams.Scale = spinBaseParams.Scale * 0.7; spinBaseParams.ChangeTimeout = 0x28; local_15c = (Entity_NPC *)0x40400000; spinBaseParams.Acceleration = 1.05; } local_170 = 0.0; do { local_178 = ((float)npc->_stateFrame * 360.0 * 0.132 + (float)(int)local_170 * 120.0) * 0.017453292; local_174 = cos(local_178); fVar21 = sin(local_178); local_178 = fVar21; FUN_004c5850(&spinBaseParams); iVar14 = 0; local_190.y = fVar21 * 60.0 + (npc->_pos).y; local_190.x = local_174 * 60.0 + (npc->_pos).x; local_44.y = (float)((uint)local_174 ^ 0x80000000); fVar17 = 0.0; if (0.0 < (float)local_15c) { local_174 = local_174 * local_164; local_160 = (Entity_NPC *)(fVar21 * local_164); local_180 = (Entity_NPC *)((float)local_15c - 1.0); local_17c = (Room *)(local_174 * 1.5); local_1a0.y = (float)local_160 * 1.5; do { if (fVar17 == (float)local_180) { params.Scale = params.Scale * 0.6; } scratchVec.x = local_174; scratchVec.y = (float)local_160; Entity_NPC::FireProjectiles(npc,&local_190,&scratchVec,0,¶ms); params.WiggleFrameOffset = params.WiggleFrameOffset + 2; params.ChangeTimeout = params.ChangeTimeout + -1; fVar21 = ((float)params.WiggleFrameOffset + (float)params.WiggleFrameOffset) * 3.1415927; fVar21 = cos((fVar21 + fVar21) / 30.0); iVar14 = iVar14 + 1; local_190.x = fVar21 * local_178 * 3.0 + (float)local_17c + local_190.x; local_190.y = local_44.y * fVar21 * 3.0 + local_1a0.y + local_190.y; params.Scale = params.Scale * 1.25; fVar17 = (float)iVar14; } while (fVar17 < (float)local_15c); } local_170 = (float)((int)local_170 + 1); } while ((int)local_170 < 3); uVar9 = npc->_stateFrame; } if (0xd1 < (int)uVar9) { ANM2::Play(&npc->_sprite,(byte *)"SpinEnd",0); npc->_stateFrame = 0; goto LAB_0056fb63; } local_16c = (Entity_NPC *)&local_16c->field_0x1; } while ((int)local_16c < (int)local_198.y); } break; case 9: npc->_friction = npc->_friction * 0.7; if (npc->_stateFrame == 0) { npc->_stateFrame = 1; ANM2::Play(sprite,(&PTR_s_SwipeLeft_00b61a74)[npc->_i2],1); iVar14 = npc->_i2; if (iVar14 == 0) { local_174 = (float)local_15c + 20.0; local_168 = (Entity_NPC *)&DAT_bf800000; } else { if (iVar14 != 2) { if (iVar14 == 1) { local_16c = (Entity_NPC *)((float)local_16c + 20.0); local_168 = (Entity_NPC *)&DAT_bf800000; } else { local_16c = (Entity_NPC *)(local_170 - 20.0); local_168 = (Entity_NPC *)0x3f800000; } tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_1a0,0.0); local_198.y = fmodf(tmpVec->x - local_174,80.0); local_198.y = local_198.y + local_174; if (local_198.y < (float)local_15c) { do { uVar9 = Random(); scratchVec.x = local_198.y; scratchVec.y = (float)local_16c; tmpEntity = Game::Spawn(g_game,1000,0xbe,&scratchVec,&g_vectorZero,(Entity *)npc,0, uVar9); if (tmpEntity->_parent != (EntityPtr)0x0) { local_160 = (Entity_NPC *)&tmpEntity->_parent; std::multiset::erase(&local_160); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); iVar14 = *(int *)tmpEntity; (tmpEntity->_targetPosition).x = 0.0; (tmpEntity->_targetPosition).y = (float)local_168; (**(code **)(iVar14 + 0xc))(); local_198.y = local_198.y + 80.0; } while (local_198.y < (float)local_15c); } goto LAB_0056dbba; } local_174 = local_174 - 20.0; local_168 = (Entity_NPC *)0x3f800000; } tmpVec = Entity_NPC::CalcTargetPosition(npc,&local_188,0.0); fVar21 = fmodf(tmpVec->y - local_170,80.0); local_15c = (Entity_NPC *)(fVar21 + local_170); if ((float)local_15c < (float)local_16c) { do { uVar9 = Random(); scratchVec.x = local_174; scratchVec.y = (float)local_15c; tmpEntity = Game::Spawn(g_game,1000,0xbe,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar9); if (tmpEntity->_parent != (EntityPtr)0x0) { local_160 = (Entity_NPC *)&tmpEntity->_parent; std::multiset::erase(&local_160); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); iVar14 = *(int *)tmpEntity; (tmpEntity->_targetPosition).x = (float)local_168; (tmpEntity->_targetPosition).y = 0.0; (**(code **)(iVar14 + 0xc))(); local_15c = (Entity_NPC *)((float)local_15c + 80.0); } while ((float)local_15c < (float)local_16c); } } LAB_0056dbba: pEVar18 = (Entity_NPC *)&(npc->_sprite)._animState; local_15c = pEVar18; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar6 = AnimationState::IsEventTriggered((AnimationState *)pEVar18,(byte *)"Sound"); if (bVar6 != 0) { uVar9 = Random(); play_sound_with_fart_seed(uVar9 % 3 + 0x26c,1.0,2,0,1.0); local_15c = pEVar18; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar6 = AnimationState::IsEventTriggered((AnimationState *)pEVar18,&DAT_00b6166c); if (bVar6 != 0) { EntityList::QuerySublist (&local_17c->_entityList,(EntityList_EL *)(local_3c + 8),1000,0xbe,-1,0,0); uVar9 = 0; if ((Entity_NPC *)scratchVec.y != (Entity_NPC *)0x0) { do { iVar14 = *(int *)(local_3c._12_4_ + uVar9 * 4); if ((((iVar14 != 0) && (*(int *)(iVar14 + 0x28) == 1000)) && (*(Entity_NPC **)(iVar14 + 0x3bc) == npc)) && (*(int *)(iVar14 + 0x450) < 2)) { *(undefined4 *)(iVar14 + 0x450) = 2; } uVar9 = uVar9 + 1; } while (uVar9 < (uint)scratchVec.y); pEVar18 = local_15c; } if (local_3c[8] == '\0') { local_14 = 0; tracked_alloc(1,(void *)local_3c._12_4_,0); local_14 = 0xffffffff; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar6 = AnimationState::IsEventTriggered((AnimationState *)pEVar18,(byte *)"Shoot"); manager = g_manager; if (bVar6 != 0) { local_168 = (Entity_NPC *)0x1e; seed_fart_sound_override((int *)&local_168); SoundEffects::Play(&manager->_sfxManager,(int)local_168,1.0,2,0,1.0,0.0); EntityList::QuerySublist (&local_17c->_entityList,(EntityList_EL *)(local_50 + 4),1000,0xbe,-1,0,0); local_14 = 1; local_168 = (Entity_NPC *)0x0; if ((undefined1 *)local_44.y != (undefined1 *)0x0) { pvVar11 = local_48; do { pEVar18 = *(Entity_NPC **)((int)pvVar11 + (int)local_168 * 4); local_160 = pEVar18; if (((pEVar18 != (Entity_NPC *)0x0) && (pEVar18->_type == 1000)) && ((pEVar18->_parent == (EntityPtr)npc && (*(int *)&(pEVar18->_pathfinder).field_0x3c < 3)))) { if (npc->_i1 == 4) { uVar9 = 0; pvVar11 = g_game->_room; if (*(int *)((int)pvVar11 + 0x1264) != 0) { do { iVar14 = *(int *)(*(int *)((int)pvVar11 + 0x125c) + uVar9 * 4); if (*(int *)(iVar14 + 0x28) == 9) { *(undefined4 *)(iVar14 + 0x438) = 0; *(undefined4 *)(iVar14 + 0x43c) = 0; *(undefined1 *)(iVar14 + 0x173) = 1; } uVar9 = uVar9 + 1; } while (uVar9 < *(uint *)((int)pvVar11 + 0x1264)); } } *(undefined4 *)&(pEVar18->_pathfinder).field_0x3c = 3; uVar9 = Random(); spawnPos.y = (pEVar18->_pos).y; spawnPos.x = (pEVar18->_pos).x; scratchVec.x = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0; scratchVec.y = scratchVec.x * (pEVar18->_targetPosition).y; scratchVec.x = scratchVec.x * (pEVar18->_targetPosition).x; spawn_blood_explosion (2,&spawnPos,&pEVar18->_posOffset,&npc->_splatColor,&scratchVec); uVar9 = Random(); local_180 = (Entity_NPC *)0x1; fVar21 = (local_160->_targetPosition).x; fVar17 = (local_160->_targetPosition).y; spawnVelocity.x = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 4.0; spawnVelocity.y = spawnVelocity.x * fVar17; spawnVelocity.x = spawnVelocity.x * fVar21; local_190.x = fVar21 * 40.0 + (local_160->_pos).x; local_190.y = fVar17 * 40.0 + (local_160->_pos).y; spawn_gibs(&local_190,3,40.0,(uint *)&local_180,(Entity *)0x0,&npc->_splatColor, &spawnVelocity,1.0); pvVar11 = local_48; } local_168 = (Entity_NPC *)&local_168->field_0x1; } while (local_168 < (uint)local_44.y); } tmpVec = Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,npc->_i2); game = g_game; fVar21 = npc->_speedMultiplier; fVar17 = tmpVec->y; (npc->_velocity).x = tmpVec->x * 10.0 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = fVar17 * 10.0 * fVar21 + (npc->_velocity).y; Game::ShakeScreen(game,7); local_14 = 0xffffffff; if (local_50[4] == '\0') { local_14 = 2; tracked_alloc(1,local_48,0); local_14 = 0xffffffff; } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } } } iVar14 = npc->_i1 + 1; npc->_i1 = iVar14; if (iVar14 < 5) { if (iVar14 == 4) { uVar9 = npc->_i2 + 2; } else { uVar9 = Random(); uVar9 = (~uVar9 & 1) * 2 + npc->_i2 + 1; } uVar9 = uVar9 & 0x80000003; if ((int)uVar9 < 0) { uVar9 = (uVar9 - 1 | 0xfffffffc) + 1; } } else { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; uVar9 = 0; npc->_i1 = 0; } npc->_i2 = uVar9; npc->_stateFrame = 0; break; case 10: npc->_friction = npc->_friction * 0.6; bVar6 = ANM2::IsFinishedImpl(sprite,&s_empty); if (npc->_stateFrame < 0) { if (bVar6 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar21 = (tmpEntity->_pos).x - (npc->_pos).x; if (ABS(fVar21) <= ABS((tmpEntity->_pos).y - (npc->_pos).y)) { animName = "ShootBegin"; } else { animName = "ShootLeftBegin"; if (0.0 <= fVar21) { animName = "ShootRightBegin"; } } ANM2::Play(&npc->_sprite,(byte *)animName,0); npc->_state = 0xb; npc->_stateFrame = 0; } } else { if (bVar6 != 0) { ANM2::Play(&npc->_sprite,(byte *)"ShootLoop",0); } bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar6 != 0) { SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x280,1.0,1.0); } bVar6 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar6 != 0) || (bVar6 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), bVar6 != 0)) { tmpVec = Room::GetCenterPos(&scratchVec); local_180 = (Entity_NPC *)((tmpVec->y - (npc->_pos).y) * 0.01); local_160 = (Entity_NPC *)((tmpVec->x - (npc->_pos).x) * 0.01); fVar21 = sqrtf((float)local_180 * (float)local_180 + (float)local_160 * (float)local_160); pEVar18 = local_160; pEVar19 = local_180; if ((0.8 < fVar21) && (0.0 < fVar21)) { pEVar18 = (Entity_NPC *)((float)local_160 * (0.8 / fVar21)); pEVar19 = (Entity_NPC *)((float)local_180 * (0.8 / fVar21)); } fVar21 = npc->_speedMultiplier; (npc->_velocity).y = fVar21 * (float)pEVar19 + (npc->_velocity).y; (npc->_velocity).x = fVar21 * (float)pEVar18 + (npc->_velocity).x; local_15c = (Entity_NPC *)npc->_speedMultiplier; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_15c = (Entity_NPC *)((float)local_15c + (float)local_15c); fVar21 = atan2f((tmpEntity->_pos).y - (npc->_pos).y,(tmpEntity->_pos).x - (npc->_pos).x); fVar21 = approach_angle((npc->_v1).x,fVar21 * 57.295776,(float)local_15c); (npc->_v1).x = fVar21; local_160 = (Entity_NPC *)(fVar21 * 0.017453292); local_180 = (Entity_NPC *)0x3c8efa35; local_178 = cos((float)local_160); local_188.y = sin((float)local_160); Game::ShakeScreen(g_game,4); local_170 = 0.0; if ((local_17c->_entityList)._updateEL._size != 0) { do { pEVar18 = *(Entity_NPC **) ((int)(local_17c->_entityList)._updateEL._data + (int)local_170 * 4); local_160 = pEVar18; if ((pEVar18 != npc) && (((bVar6 = Entity::IsActiveEnemy((Entity *)pEVar18,0), bVar6 != 0 || (pEVar18->_type == 1)) || (pEVar18->_type == 2)))) { local_15c = (Entity_NPC *)(npc->_pos).x; local_168 = (Entity_NPC *)((pEVar18->_pos).x - (float)local_15c); local_16c = (Entity_NPC *)(npc->_pos).y; local_164 = (pEVar18->_pos).y - (float)local_16c; fVar21 = sqrtf((float)local_168 * (float)local_168 + local_164 * local_164); if (fVar21 <= 0.0) { fVar17 = local_164; pEVar19 = local_168; } else { fVar17 = local_164 * (1.0 / fVar21); pEVar19 = (Entity_NPC *)((float)local_168 * (1.0 / fVar21)); } if (0.9 <= local_178 * (float)pEVar19 + local_188.y * fVar17) { local_168 = (Entity_NPC *)((float)local_16c - (pEVar18->_pos).y); local_15c = (Entity_NPC *)((float)local_15c - (pEVar18->_pos).x); fVar21 = (float)local_168 * (float)local_168 + (float)local_15c * (float)local_15c; local_174 = 2.0 / (fVar21 * 0.0001 + 1.0); fVar21 = sqrtf(fVar21); pEVar19 = local_15c; pEVar20 = local_168; if (0.0 < fVar21) { pEVar19 = (Entity_NPC *)((float)local_15c * (1.0 / fVar21)); pEVar20 = (Entity_NPC *)((float)local_168 * (1.0 / fVar21)); } if (pEVar18->_type == 1) { fVar21 = 0.8; if (local_174 * 1.4 <= 0.8) { fVar21 = local_174 * 1.4; } fVar17 = pEVar18->_mass; if (1.0 <= fVar17) { fVar17 = 1.0; } fVar21 = fVar21 / fVar17; } else { fVar21 = local_174; if (pEVar18->_type == 2) { fVar21 = local_174 * 0.7; } } fVar17 = pEVar18->_friction; if (fVar17 == 0.0) { pEVar19 = local_16c; } else { fVar1 = pEVar18->_speedMultiplier; (pEVar18->_velocity).y = (fVar21 * 0.2 * (float)pEVar20 * fVar1) / fVar17 + (pEVar18->_velocity).y; (pEVar18->_velocity).x = (fVar21 * 0.2 * (float)pEVar19 * fVar1) / fVar17 + (pEVar18->_velocity).x; pEVar19 = (Entity_NPC *)(npc->_pos).y; } fVar21 = (npc->_pos).x - (pEVar18->_pos).x; fVar17 = (float)pEVar19 - (pEVar18->_pos).y; if (fVar17 * fVar17 + fVar21 * fVar21 < 400.0) { if ((((*(int *)&g_game->_deathmatchManager < 2) || (pEVar18->_type != 1)) && (0x3dd < pEVar18->_type - 10U)) || (cVar7 = (**(code **)(*(int *)pEVar18 + 0x4c))(), cVar7 != '\0')) { if (pEVar18->_type == 2) { (**(code **)(*(int *)pEVar18 + 0x28))(); } } else { pcVar4 = *(code **)(*(int *)pEVar18 + 0x24); EntityRef::constructor(&damageSource,(Entity *)npc); (*pcVar4)(&damageSource); } } } } local_170 = (float)((int)local_170 + 1); } while ((uint)local_170 < (uint)(local_17c->_entityList)._updateEL._size); } if (0 < (int)local_198.y) { local_160 = (Entity_NPC *)0x3; do { npc->_stateFrame = npc->_stateFrame + 1; iVar14 = npc->_stateFrame; if (iVar14 % (int)local_160 == 0) { uVar9 = Random(); scratchVec.x = local_178 * 800.0 + (npc->_pos).x; scratchVec.y = local_188.y * 800.0 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,0x97,&scratchVec,&g_vectorZero,(Entity *)0x0,0, uVar9); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -24.0; fVar21 = (npc->_pos).y; (tmpEntity->_targetPosition).x = (npc->_pos).x; (tmpEntity->_targetPosition).y = fVar21; Color::Reset(&effectColor); effectColor._tint[0] = 0.5; effectColor._tint[1] = 0.6; effectColor._tint[2] = 0.3; effectColor._tint[3] = 1.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&effectColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar9 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)0x0,1, uVar9); uVar9 = Random(); dVar3 = __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]; fVar21 = (npc->_v1).x; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -24.0; (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar9 + dVar3) * 2.3283064e-10 * 60.0 + (fVar21 - 30.0); Color::Reset(&effectColor); effectColor._tint[0] = 0.5; effectColor._tint[1] = 0.6; effectColor._tint[2] = 0.3; effectColor._tint[3] = 1.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&effectColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); iVar14 = npc->_stateFrame; } if ((iVar14 < 0x1f) || (0x77 < iVar14)) { LAB_0056eb53: if (0xb3 < iVar14) { npc->_stateFrame = -1; ANM2::Play(&npc->_sprite,(byte *)"ShootEnd",0); } } else if (iVar14 % 3 == 0) { uVar9 = Random(); local_168 = (Entity_NPC *) (((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 40.0 + ((npc->_v1).x - 20.0)) * (float)local_180); uVar9 = Random(); local_164 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)] ) * 2.3283064e-10 * 400.0 + 280.0; fVar21 = cos((float)local_168); local_44.x = fVar21 * local_164 + (npc->_pos).x; fVar21 = sin((float)local_168); local_44.y = fVar21 * local_164 + (npc->_pos).y; uVar9 = Random(); tmpEntity = Game::Spawn(g_game,9,0,&local_44,&g_vectorZero,(Entity *)npc,0,uVar9); local_1a0.y = (float)tmpEntity; uVar9 = Random(); pfVar10 = (float *)&DAT_00c34d20; if ((uVar9 & 1) == 0) { pfVar10 = (float *)&DAT_00c34ed8; } tintColor._tint[0] = *pfVar10; tintColor._tint[1] = pfVar10[1]; tintColor._tint[2] = pfVar10[2]; tintColor._tint[3] = pfVar10[3]; tintColor._colorize[0] = pfVar10[4]; tintColor._colorize[1] = pfVar10[5]; tintColor._colorize[2] = pfVar10[6]; tintColor._colorize[3] = pfVar10[7]; tintColor._offset._0_8_ = *(undefined8 *)(pfVar10 + 8); tintColor._offset[2] = pfVar10[10]; (**(code **)(*(int *)tmpEntity + 0x3c))(&tintColor,0xffffffff,0xff,0,1); bVar6 = Room::IsPositionInRoom(local_17c,&local_44,10.0); if (bVar6 == 0) { tintColor._tint[3] = 0.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&tintColor,0x1e,0xff,1,1); iVar14 = 0x2080; } else { Color::Color(&effectColor); Game::SpawnParticles(g_game,&local_44,4,1,6.0,color,100000.0,0x20000); uVar9 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&local_44,&g_vectorZero,(Entity *)0x0,2,uVar9) ; (**(code **)(*(int *)tmpEntity + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); iVar14 = 0x80; (tmpEntity->_sprite)._offset.x = g_vectorZero.x; (tmpEntity->_sprite)._offset.y = g_vectorZero.y; tmpEntity->_renderDepthOffset = 10.0; tmpEntity = (Entity *)local_1a0.y; } tmpEntity[1]._variant = iVar14; tmpEntity[1]._subtype = 0x100000; if (tmpEntity->_parent != (EntityPtr)0x0) { local_1a0.y = (float)&tmpEntity->_parent; std::multiset::erase(&local_1a0.y); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); tmpEntity->_renderDepthOffset = 120.0; fVar21 = (npc->_pos).y; (tmpEntity->_targetPosition).x = (npc->_pos).x; (tmpEntity->_targetPosition).y = fVar21; tmpEntity[1]._damageEvents._end = (void *)0xbd4ccccd; uVar9 = Random(); *(undefined4 *)&tmpEntity[1]._pendingDamageFlags = 0x3e99999a; tmpEntity->_friction = 0.88; uVar13 = uVar9 % 3 + 5; uVar9 = 0xd; if (uVar13 < 0xd) { uVar9 = uVar13; } tmpEntity[1]._pendingDamage = ((float)uVar9 - 3.0) / 3.0; iVar14 = npc->_stateFrame; goto LAB_0056eb53; } local_198.y = (float)((int)local_198.y + -1); } while (local_198.y != 0.0); local_198.y = 0.0; } } } break; case 0xb: npc->_friction = npc->_friction * 0.7; if (npc->_stateFrame == 0) { bVar6 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar6 != 0) { play_sound_with_fart_seed(0x27f,1.0,2,0,1.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); tmpVec = &npc->_pos; local_190.x = (tmpEntity->_pos).x - tmpVec->x; local_190.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalize(&local_190); bloodCloud = Entity_NPC::MakeBloodCloud(npc,tmpVec,&npc->_splatColor); (bloodCloud->_posOffset).x = 0.0; (bloodCloud->_posOffset).y = -15.0; ProjectileParams::ProjectileParams(¶ms); Color::operator_assign((Color *)¶ms.Color,&g_colorGreenSplat); params.BulletFlags._0_4_ = 0; params.BulletFlags._4_4_ = 0x200000; shot = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,¶ms); shot->_height = -23.0; shot->_fallingAccel = -0.08; (shot->_velocity).x = local_190.x * 14.0; (shot->_velocity).y = local_190.y * 14.0; shot->_fallingSpeed = 0.0; shot->_homingStrength = 0.5; shot->_subtype = 0x6a; shot->_scale = 1.0; tintColor._tint[0] = 1.0; tintColor._tint[1] = 1.0; tintColor._tint[2] = 1.0; tintColor._tint[3] = 1.0; tintColor._colorize[0] = 2.0; tintColor._colorize[1] = 4.0; tintColor._colorize[2] = 1.0; tintColor._colorize[3] = 1.0; tintColor._offset[0] = 0.0; tintColor._offset[1] = 0.0; tintColor._offset[2] = 0.0; scratchVec.x = 0.0; scratchVec.y = -20.0; spawn_blood_explosion(4,tmpVec,&scratchVec,&tintColor,&g_vectorZero); (npc->_velocity).x = local_190.x * -15.0 + (npc->_velocity).x; (npc->_velocity).y = local_190.y * -15.0 + (npc->_velocity).y; } bVar6 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar6 != 0) { ANM2::GetAnimation((ANM2 *)&(npc->_sprite)._animState,(std_string *)local_3c); local_14 = 3; FUN_0056ff00(local_3c,0,(int)scratchVec.x + -5,extraout_ECX); local_14 = CONCAT31(local_14._1_3_,4); std::string::append(local_54,&DAT_00b1c00c,3); npc->_state = 3; npc->_i1 = 0; npc->_i2 = 0; npc->_stateFrame = 0; std::string::_Tidy_deallocate(local_54); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_3c); } } break; case 0xc: npc->_friction = npc->_friction * 0.6; bVar6 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar6 != 0) { npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; play_sound_with_fart_seed(0x48,3.0,2,0,1.0); } bVar6 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar6 == 0) break; iVar14 = npc->_stateFrame + (int)local_198.y; npc->_stateFrame = iVar14; if ((0x1e < iVar14) && (bVar6 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero), bVar6 != 0)) { local_170 = local_170 - 90.0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar21 = ((float)local_15c + local_174) * 0.5; if (fVar21 < (tmpEntity->_pos).x || fVar21 == (tmpEntity->_pos).x) { fVar21 = (float)local_15c - 140.0; } else { fVar21 = local_174 + 140.0; } (npc->_pos).x = fVar21; (npc->_pos).y = local_170; (npc->_targetPosition).x = fVar21; (npc->_targetPosition).y = 1.0; scratchVec.x = 0.0; scratchVec.y = (float)&DAT_bf800000; NpcHelper::mother_2_slam_burst(&scratchVec,extraout_ECX_00); iVar14 = npc->_stateFrame; } if (iVar14 < 0x3d) break; ANM2::Play(&npc->_sprite,(byte *)"ChargeLoop",0); (npc->_velocity).x = 0.0; (npc->_velocity).y = 8.0; play_sound_with_fart_seed(0x40,1.0,2,0,1.0); play_sound_with_fart_seed(0x287,1.0,2,0,1.0); npc->_entityCollisionClass = 4; npc->_state = 6; NpcHelper::mother_2_slam_burst(&npc->_velocity,extraout_ECX_01); pvVar11 = npc->_config; iVar14 = *(int *)((int)pvVar11 + 0x48); fVar17 = *(float *)((int)pvVar11 + 0x3c) * 1.18; fVar21 = *(float *)((int)pvVar11 + 0x40); local_190.x = fVar17; local_190.y = fVar21; LAB_0056f026: sizeMulti.y = fVar21; sizeMulti.x = fVar17; Entity::SetSize((Entity *)npc,*(float *)((int)pvVar11 + 0x38),sizeMulti,iVar14); break; case 0x10: scratchVec.x = (npc->_pos).x + 0.0; scratchVec.y = (npc->_pos).y + 100.0; Camera::SetFocusPosition(room->_Camera,&scratchVec); iVar14 = npc->_stateFrame; npc->_friction = 0.9; if (iVar14 == 0) { play_sound_with_fart_seed(0x271,1.0,2,0,1.0); iVar14 = npc->_stateFrame; } npc->_stateFrame = iVar14 + (int)local_198.y; if (0x1e < iVar14 + (int)local_198.y) { ANM2::Play(&npc->_sprite,(byte *)"ChargeEnd",0); } bVar6 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar6 == 0) break; FUN_0056c7c0(); LAB_0056fb63: npc->_state = 3; } bVar6 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x280); manager = g_manager; if (bVar6 != 0) { if (npc->_dead == 0) { if (npc->_state != 10) { fVar21 = SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x280); local_160 = (Entity_NPC *)(fVar21 - 0.0667); SFXManager::SetAmbientSound(&manager->_sfxManager,0x280,(float)local_160,1.0); } } else { SFXManager::Stop(&g_manager->_sfxManager,0x280); } } bVar6 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x1b8); manager = g_manager; if (bVar6 != 0) { if (npc->_dead == 0) { if (npc->_state != 8) { fVar21 = SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x1b8); local_160 = (Entity_NPC *)(fVar21 - 0.15); SFXManager::SetAmbientSound(&manager->_sfxManager,0x1b8,(float)local_160,1.0); } } else { SFXManager::Stop(&g_manager->_sfxManager,0x1b8); } } ExceptionList = local_1c; return; } //@@ 0056fcf0 NpcHelper::mother_render /* DB: ECX=npc; only caller Entity_NPC::Render case 0x390 (912 ENTITY_MOTHER); for variant 0 maps pos into wall/background space ((pos-(60,140))*0.65 + (screen-(338,182))/2 * g_displayPixelRatio), copies color to the parent, Sprite::RenderLayer, then Entity::Render */ void NpcHelper::mother_render(Vector *param_1) { undefined4 *puVar1; float fVar2; undefined8 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; undefined4 uVar13; undefined4 uVar14; undefined4 uVar15; EntityPtr EVar16; EntityPtr in_ECX; int layerId; float fVar17; double dVar18; double dVar19; undefined4 local_6c [26]; if (*(int *)((int)in_ECX + 0x2c) == 0) { fVar17 = g_displayPixelRatio * g_screenPointScale; dVar18 = floor((double)((((((Vector *)((int)in_ECX + 0x34c))->x + ((Vector *)((int)in_ECX + 0x33c))->x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar17 + 0.5)); dVar19 = floor((double)((((*(float *)((int)in_ECX + 0x340) + *(float *)((int)in_ECX + 0x350)) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar17 + 0.5)); fVar2 = param_1->y; ((Vector *)((int)in_ECX + 0x1a4))->x = (float)dVar18 / fVar17 + param_1->x; *(float *)((int)in_ECX + 0x1a8) = (float)dVar19 / fVar17 + fVar2; layerId = *(int *)((int)in_ECX + 0x30); if ((layerId == 0) || (EVar16 = *(EntityPtr *)((int)in_ECX + 0x3bc), *(EntityPtr *)((int)in_ECX + 0x3bc) == (EntityPtr)0x0)) { EVar16 = in_ECX; } uVar5 = *(undefined4 *)((int)EVar16 + 0xf0); uVar6 = *(undefined4 *)((int)EVar16 + 0xf4); uVar7 = *(undefined4 *)((int)EVar16 + 0xf8); uVar8 = *(undefined4 *)((int)EVar16 + 0xfc); uVar4 = *(undefined4 *)((int)EVar16 + 0x118); puVar1 = (undefined4 *)((int)EVar16 + 0xf0); uVar9 = *(undefined4 *)((int)EVar16 + 0x100); uVar10 = *(undefined4 *)((int)EVar16 + 0x104); uVar11 = *(undefined4 *)((int)EVar16 + 0x108); uVar12 = *(undefined4 *)((int)EVar16 + 0x10c); uVar3 = *(undefined8 *)((int)EVar16 + 0x110); if (puVar1 != (undefined4 *)((int)in_ECX + 0xf0)) { uVar13 = *(undefined4 *)((int)in_ECX + 0xf4); uVar14 = *(undefined4 *)((int)in_ECX + 0xf8); uVar15 = *(undefined4 *)((int)in_ECX + 0xfc); *puVar1 = *(undefined4 *)((int)in_ECX + 0xf0); *(undefined4 *)((int)EVar16 + 0xf4) = uVar13; *(undefined4 *)((int)EVar16 + 0xf8) = uVar14; *(undefined4 *)((int)EVar16 + 0xfc) = uVar15; uVar13 = *(undefined4 *)((int)in_ECX + 0x104); uVar14 = *(undefined4 *)((int)in_ECX + 0x108); uVar15 = *(undefined4 *)((int)in_ECX + 0x10c); *(undefined4 *)((int)EVar16 + 0x100) = *(undefined4 *)((int)in_ECX + 0x100); *(undefined4 *)((int)EVar16 + 0x104) = uVar13; *(undefined4 *)((int)EVar16 + 0x108) = uVar14; *(undefined4 *)((int)EVar16 + 0x10c) = uVar15; *(undefined8 *)((int)EVar16 + 0x110) = *(undefined8 *)((int)in_ECX + 0x110); *(undefined4 *)((int)EVar16 + 0x118) = *(undefined4 *)((int)in_ECX + 0x118); layerId = *(int *)((int)in_ECX + 0x30); } Sprite::RenderLayer((Sprite *)((int)EVar16 + 0x48),layerId,(Vector *)((int)in_ECX + 0x1a4), &g_vectorZero,&g_vectorZero); if (puVar1 != local_6c) { *puVar1 = uVar5; *(undefined4 *)((int)EVar16 + 0xf4) = uVar6; *(undefined4 *)((int)EVar16 + 0xf8) = uVar7; *(undefined4 *)((int)EVar16 + 0xfc) = uVar8; *(undefined4 *)((int)EVar16 + 0x100) = uVar9; *(undefined4 *)((int)EVar16 + 0x104) = uVar10; *(undefined4 *)((int)EVar16 + 0x108) = uVar11; *(undefined4 *)((int)EVar16 + 0x10c) = uVar12; *(undefined8 *)((int)EVar16 + 0x110) = uVar3; *(undefined4 *)((int)EVar16 + 0x118) = uVar4; return; } } else { Entity::Render((Entity *)in_ECX,param_1); } return; } //@@ 0056ff00 FUN_0056ff00 void FUN_0056ff00(undefined4 *param_1,uint param_2,uint param_3) { char *in_ECX; uint uVar1; in_ECX[0] = '\0'; in_ECX[1] = '\0'; in_ECX[2] = '\0'; in_ECX[3] = '\0'; in_ECX[0x10] = '\0'; in_ECX[0x11] = '\0'; in_ECX[0x12] = '\0'; in_ECX[0x13] = '\0'; in_ECX[0x14] = '\x0f'; in_ECX[0x15] = '\0'; in_ECX[0x16] = '\0'; in_ECX[0x17] = '\0'; if ((uint)param_1[4] < param_2) { /* WARNING: Subroutine does not return */ FUN_00499950(); } uVar1 = param_1[4] - param_2; if (uVar1 < param_3) { param_3 = uVar1; } if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } std::string::assign(in_ECX,(byte *)((int)param_1 + param_2),param_3); return; } //@@ 0056ff60 FUN_0056ff60 bool FUN_0056ff60(uint param_1) { int in_ECX; return (*(uint *)(in_ECX + 0x3a0) & param_1) != 0; } //@@ 0056ff80 Level::GetRoomCount /* ZHL [lua] Lua binding Level:GetRoomCount */ int __thiscall Level::GetRoomCount(Level *this) { return this->_roomCount; } //@@ 0056ff90 Entity_Player::IsItemQueueEmpty /* ZHL [lua] Lua binding EntityPlayer:IsItemQueueEmpty */ bool __thiscall Entity_Player::IsItemQueueEmpty(Entity_Player *this) { return (this->_queuedItem)._item == (void *)0x0; } //@@ 0056ffa0 NpcAI::ENTITY_MOTHERS_SHADOW /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 867 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOTHERS_SHADOW(Entity_NPC *npc) { undefined4 uVar1; uint *puVar2; qword qVar3; undefined1 *puVar4; byte bVar5; uint uVar6; Entity *tmpEntity; Entity_Player *player; RoomConfig_Room *newRoomConfig; undefined4 *entryCursor; int iVar7; Vector *tmpVec; ColorMod *other; LayerState *layer; EntityPtr *pEVar8; int roomFrameCount; Game *pGVar9; undefined4 *entryEnd; ANM2 *sprite; Entity_NPC *player; uint uVar11; int *sprite; float fVar12; float fVar13; Game *pGVar14; float fVar15; EntityPtr EVar16; Entity_NPC *pEVar17; Vector aimDir; undefined4 local_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 local_80; int iStack_7c; Vector VStack_78; Vector local_70; Vector local_68; Entity_NPC *local_60; EntityPtr local_5c; float local_58; Game *local_54; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; float speedMultiplier; manager = g_manager; pGVar9 = g_game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af4fe5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; iVar7 = npc->_state; local_54 = (Game *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_60 = npc; if (npc->_aiCallPhase == 1) { if ((iVar7 == 3) || (iVar7 == 8)) { if (*(char *)g_game->_room == '\0') { roomFrameCount = -1; } else { roomFrameCount = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0); } npc->_entityCollisionClass = (uint)(0x2c < roomFrameCount); } if (iVar7 != 0x10) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Game::ShakeScreen(pGVar9,4); if (npc->_state != 5) { uVar6 = Random(); if (uVar6 % 3 == 0) { Room::GetRandomPosition(g_game->_room,&VStack_78,0.0); uVar6 = Random(); tmpEntity = Game::Spawn(g_game,1000,4,&VStack_78,&g_vectorZero,(Entity *)0x0, *(uint *)((int)g_game->_room + 0x1d18) | 0x20000,uVar6); uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8; fVar12 = fVar13 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar13 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar12; uVar6 = Random(); local_30 = 0; local_2c = 0; local_28 = 0; iVar7 = *(int *)tmpEntity; *(float *)&tmpEntity[1].field_0x4 = -200.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 80.0; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0; (**(code **)(iVar7 + 0x3c))(&local_50,0xf,0xff,1,1); (**(code **)(*(int *)tmpEntity + 0xc))(); } manager = g_manager; if (g_game->_currentDimensionIdx == 0) { npc->_state = 5; npc->_stateFrame = 0; local_54 = (Game *)0x2cd; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,1.0,2,0,1.0,0.0); manager = g_manager; local_54 = (Game *)0x242; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,1.0,2,0,1.0,0.0); pGVar9 = g_game; npc->_visible = 0; npc->_entityCollisionClass = 0; npc->_canShutDoors = 1; bVar5 = Level::HasAbandonedMineshaft((Level *)pGVar9); if (((bVar5 != 0) && (iVar7 = *(int *)(*(int *)((int)g_game->_room + 4) + 0x10), *(int *)(iVar7 + 8) == 1)) && (*(int *)(iVar7 + 0x10) == 10)) { uVar11 = 0; uVar6 = 0x724; pGVar9 = g_game; do { uVar11 = uVar11 + 1; if (uVar11 < 9) { iVar7 = *(int *)(uVar6 + (int)pGVar9->_room); if (((iVar7 != 0) && ((*(uint *)(iVar7 + 0x3a0) >> 5 & 1) != 0)) && (*(int *)(iVar7 + 8) != 4)) { GridEntity_Door::Bar(); pGVar9 = g_game; } } uVar6 = uVar6 + 4; } while (uVar6 < 0x744); } } } } } else { switch(iVar7) { case 0: qVar3 = npc->_flags; puVar2 = (uint *)((int)&npc->_flags + 4); *puVar2 = *puVar2 | 8; npc->_isInvicible = 1; *(uint *)&npc->_flags = (uint)qVar3 & 0xfffffffb | 0xc4100011; npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_visible = 0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); ANM2::SetFrame(&npc->_sprite,(std_string *)"Appear",0); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; EntityList::AddPersistentEntity((EntityList *)((int)g_game->_room + 0x1218),(Entity *)npc); npc->_entityGridCollisionClass = 0; npc->_aiCallFlags = 1; npc->_i1 = 0; if (npc->_spawnGridIndex < 0) { ANM2::Play(&npc->_sprite,s_Idle,0); uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xbbffffff; npc->_state = 3; npc->_i1 = 0x3c; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; npc->_entityCollisionClass = 1; npc->_canShutDoors = 0; npc->_stateFrame = 0; } else { uVar11 = 0; uVar6 = *(uint *)((int)g_game->_room + 0x1264); if (uVar6 != 0) { pEVar8 = *(EntityPtr **)((int)g_game->_room + 0x125c); do { EVar16 = *pEVar8; if ((*(int *)((int)EVar16 + 0x28) == 5) && (*(int *)((int)EVar16 + 0x2c) == 100)) { pEVar8 = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { local_60 = (Entity_NPC *)pEVar8; std::multiset::erase(&local_60); } *pEVar8 = EVar16; std::multiset::insert(pEVar8); ExceptionList = local_1c; return; } uVar11 = uVar11 + 1; pEVar8 = pEVar8 + 1; } while (uVar11 < uVar6); } } break; case 2: if (npc->_projectileDelay < 1) { sprite = &npc->_sprite; fVar12 = (npc->_targetPosition).y; fVar13 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar12 - fVar13; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar5 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar5 != 0) { Entity_NPC::QueryNPCsType(&local_80,0x21,-1); iVar7 = iStack_7c; fVar12 = 0.0; local_14 = 1; if (VStack_78.y != 0.0) { do { pEVar17 = *(Entity_NPC **)(iVar7 + (int)fVar12 * 4); if (((1 < *(int *)&g_game->_deathmatchManager) && (pEVar17->_type == 1)) || (pEVar17->_type - 10U < 0x3de)) { Entity_NPC::Morph(pEVar17,0x21,1,0,-1); *(undefined4 *)(*(int *)(iVar7 + (int)fVar12 * 4) + 0xb64) = 9; (**(code **)(**(int **)(iVar7 + (int)fVar12 * 4) + 0xc))(); } fVar12 = (float)((int)fVar12 + 1); } while ((uint)fVar12 < (uint)VStack_78.y); npc = local_60; } manager = g_manager; local_54 = (Game *)0x2ca; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,1.0,2,0,1.0,0.0); local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_80); sprite = &npc->_sprite; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(sprite,s_Idle,0); uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xbbffffff; npc->_state = 3; npc->_i1 = 0x3c; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; npc->_entityCollisionClass = 1; npc->_canShutDoors = 0; pGVar9 = g_game; local_54 = g_game; local_58 = 0.0; g_game->_levelStateFlags = g_game->_levelStateFlags | 0x400000; if (0 < pGVar9->_nbRooms) { local_5c = (EntityPtr)0x0; do { if (*(int *)((int)pGVar9->_roomList[0]._doors + (int)local_5c + -0x10) == 1) { puVar2 = *(uint **)((int)pGVar9->_roomList[0]._doors + (int)local_5c + -0xc); if (((puVar2 != (uint *)0x0) && (puVar2[2] == 1)) && (puVar2[4] == 0x1e)) { newRoomConfig = RoomConfig::GetRoomByStageTypeAndVariant (&pGVar9->_roomConfig,*puVar2,1,puVar2[3] + 1,-1); *(RoomConfig_Room **)((int)pGVar9->_roomList[0]._doors + (int)local_5c + -0xc) = newRoomConfig; pEVar17 = *(Entity_NPC **) ((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x70); player = *(Entity_NPC **) ((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x6c); local_60 = pEVar17; if (player != pEVar17) { do { invoke_pending_callbacks(player); player = (Entity_NPC *)&(player->_sprite)._animState; } while (player != pEVar17); player = *(Entity_NPC **) ((int)local_54->_roomList[0]._doors + (int)local_5c + 0x6c); pGVar9 = local_54; } *(Entity_NPC **)((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x70) = player; pEVar17 = *(Entity_NPC **) ((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x5c); player = *(Entity_NPC **) ((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x58); local_60 = pEVar17; if (player != pEVar17) { do { invoke_pending_callbacks(player); player = (Entity_NPC *)&(player->_sprite)._animState; } while (player != pEVar17); player = *(Entity_NPC **) ((int)local_54->_roomList[0]._doors + (int)local_5c + 0x58); pGVar9 = local_54; } *(Entity_NPC **)((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x5c) = player; entryCursor = *(undefined4 **) ((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x4c); local_90 = 0; uStack_8c = 0; entryEnd = (undefined4 *) ((*(int *)((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x50) - (int)entryCursor & 0xffffffe0U) + (int)entryCursor); uStack_88 = 0; uStack_84 = 0; local_80 = 0x16a9de81; iStack_7c = 0; VStack_78.x = (float)((uint)VStack_78.x & 0xffffff00); VStack_78.y = 2.7443842e-25; for (; entryCursor != entryEnd; entryCursor = entryCursor + 8) { *entryCursor = 0; entryCursor[1] = 0; entryCursor[2] = 0; entryCursor[3] = 0; entryCursor[4] = 0x16a9de81; entryCursor[5] = 0; entryCursor[6] = VStack_78.x; entryCursor[7] = 0x16a9de81; } *(undefined4 **)((int)pGVar9->_roomList[0]._doors + (int)local_5c + 0x50) = entryEnd; sprite = (int *)((int)pGVar9->_roomList[0]._doors + (int)local_5c + 100); iVar7 = *sprite; FID_conflict__Erase_tree_>_> (sprite,(fuzzer_allocator_> *)sprite, *(_Tree_node **)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; sprite[1] = 0; *(undefined4 *)((int)local_54->_roomList[0]._doors + (int)local_5c + 0x24) = 0; local_54 = g_game; pGVar9 = g_game; } } local_58 = (float)((int)local_58 + 1); local_5c = (EntityPtr)((int)local_5c + 0xb8); } while ((int)local_58 < pGVar9->_nbRooms); } } } else { iVar7 = npc->_projectileDelay + -1; npc->_projectileDelay = iVar7; if (iVar7 < 1) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); bVar5 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_visible = 1; Entity_NPC::QueryNPCsType(&local_80,0x21,-1); fVar12 = 0.0; local_14 = 0; if (VStack_78.y != 0.0) { do { *(undefined1 *)(*(int *)(iStack_7c + (int)fVar12 * 4) + 0x173) = 1; (**(code **)(**(int **)(iStack_7c + (int)fVar12 * 4) + 0xc))(); fVar12 = (float)((int)fVar12 + 1); } while ((uint)fVar12 < (uint)VStack_78.y); } EntityList_Query::~EntityList_Query(&local_80); } } break; case 3: npc->_visible = 1; npc->_friction = npc->_friction * 0.8; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_5c = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); Entity_NPC::CalcTargetPosition(npc,&local_70,0.0); local_60 = (Entity_NPC *)(npc->_pos).x; local_68.y = local_70.x - (float)local_60; fVar12 = local_70.y - (npc->_pos).y; local_58 = sqrtf(local_68.y * local_68.y + fVar12 * fVar12); iVar7 = npc->_i1; if (0 < iVar7) { iVar7 = iVar7 - (int)local_54; npc->_i1 = iVar7; } local_54 = (Game *)(npc->_friction * 0.8); npc->_projectileDelay = npc->_projectileDelay + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_friction = (float)local_54; fVar12 = (npc->_pos).y; fVar15 = *(float *)((int)local_5c + 0x340) - fVar12; fVar13 = ((Vector *)((int)local_5c + 0x33c))->x - (float)local_60; fVar13 = fVar15 * fVar15 + fVar13 * fVar13; if (6400.0 < fVar13) { local_68.x = local_68.y * 0.01; local_68.y = (local_70.y - fVar12) * 0.01; fVar12 = sqrtf(fVar13); fVar12 = (fVar12 - 0.0) / 600.0; if (fVar12 <= 0.0) { fVar12 = 0.0; } if (1.0 <= fVar12) { fVar12 = 1.0; } tmpVec = Vector::Resized(&local_68,&VStack_78,fVar12 * 6.0 + 0.0); if ((float)local_54 != 0.0) { fVar12 = npc->_speedMultiplier; fVar13 = tmpVec->y; (npc->_velocity).x = (fVar12 * tmpVec->x) / (float)local_54 + (npc->_velocity).x; (npc->_velocity).y = (fVar12 * fVar13) / (float)local_54 + (npc->_velocity).y; iVar7 = npc->_i1; } } if ((iVar7 < 1) && (local_58 < 200.0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack",0); pEVar8 = &npc->_target; npc->_state = 8; npc->_stateFrame = 0; if (npc->_target != (EntityPtr)0x0) { local_68.y = (float)pEVar8; std::multiset::erase(&local_68.y); } *pEVar8 = local_5c; std::multiset::insert(pEVar8); (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } break; case 5: iVar7 = (int)local_54->_roomList[0]._doors + npc->_stateFrame + -0x30; npc->_stateFrame = iVar7; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (0x1d < iVar7) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); (**(code **)(*(int *)npc + 0x28))(local_24); } Game::ShakeScreen(g_game,0xe); break; case 8: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_stateFrame == 0) { local_58 = 1.00193e-42; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); seed_fart_sound_override((int *)&local_58); SoundEffects::Play(&manager->_sfxManager,(int)local_58,1.0,2,0,1.0,0.0); } pGVar9 = local_54; bVar5 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"ShootEnd"); if (bVar5 == 0) { bVar5 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar5 == 0) || (bVar5 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"ShootEnd"), bVar5 != 0)) { npc->_friction = npc->_friction * 0.8; if (npc->_target == (EntityPtr)0x0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); pGVar14 = (Game *)(tmpEntity->_pos).x; EVar16 = (EntityPtr)(tmpEntity->_pos).y; } else { tmpVec = Entity_NPC::CalcTargetPosition(npc,&VStack_78,0.0); local_5c = (EntityPtr)tmpVec->y; local_54 = (Game *)tmpVec->x; local_60 = (Entity_NPC *)((npc->_pos).y - (float)local_5c); local_58 = (npc->_pos).x - (float)local_54; fVar12 = sqrtf((float)local_60 * (float)local_60 + local_58 * local_58); if (fVar12 <= 0.0) { pEVar17 = local_60; fVar12 = local_58; } else { pEVar17 = (Entity_NPC *)((float)local_60 * (180.0 / fVar12)); fVar12 = local_58 * (180.0 / fVar12); } fVar13 = npc->_friction; fVar15 = (npc->_pos).y; if (fVar13 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = ((((float)local_54 + fVar12) - (npc->_pos).x) * 0.01 * speedMultiplier) / fVar13 + (npc->_velocity).x; (npc->_velocity).y = ((((float)local_5c + (float)pEVar17) - fVar15) * 0.01 * speedMultiplier) / fVar13 + (npc->_velocity).y; } pGVar14 = local_54; EVar16 = local_5c; } iVar7 = (int)pGVar9->_roomList[0]._doors + npc->_stateFrame + -0x30; npc->_stateFrame = iVar7; if ((0xe < iVar7) && (bVar5 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero), bVar5 != 0)) { VStack_78.x = (float)pGVar14 - (npc->_pos).x; VStack_78.y = (float)EVar16 - (npc->_pos).y; tmpVec = Vector::Normalized(&VStack_78,&aimDir); (npc->_targetPosition).x = tmpVec->x; (npc->_targetPosition).y = tmpVec->y; } bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar5 != 0) { npc->_stateFrame = 0; } } else { bVar5 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar5 != 0) { local_58 = 1.00333e-42; seed_fart_sound_override((int *)&local_58); SoundEffects::Play(&manager->_sfxManager,(int)local_58,1.0,2,0,1.0,0.0); } fVar12 = npc->_speedMultiplier; npc->_friction = npc->_friction * 0.8; fVar13 = (npc->_targetPosition).x; (npc->_velocity).y = (npc->_targetPosition).y * 6.0 * fVar12 + (npc->_velocity).y; (npc->_velocity).x = fVar13 * 6.0 * fVar12 + (npc->_velocity).x; iVar7 = Entity::GetIntervalTicks((Entity *)npc,3.0,0.0); if (iVar7 != 0) { local_58 = (npc->_posOffset).x; local_5c = (EntityPtr)(npc->_pos).x; local_68.y = (npc->_pos).y; local_60 = (Entity_NPC *)(npc->_posOffset).y; tmpVec = Entity::GetNullOffset((Entity *)npc,&local_70,&DAT_00b613c0); VStack_78.y = local_68.y + (float)local_60 + tmpVec->y; VStack_78.x = local_58 + (float)local_5c + tmpVec->x; uVar6 = Random(); local_68.y = (npc->_velocity).y * 0.1; local_70.x = (npc->_velocity).x * 0.1 + 0.0; uVar11 = Random(); local_70.y = (-2.0 - (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 6.0) + local_68.y; tmpEntity = Game::Spawn(g_game,1000,0x3b,&VStack_78,&local_70,(Entity *)npc,0,uVar6); other = (ColorMod *)Color::Color(0x3f800000); layer = ANM2::GetLayer(&tmpEntity->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,other); uVar6 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar6 = Random(); iVar7 = uVar6 % 10 + 10; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar7; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar7; uVar6 = Random(); fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.5; fVar13 = fVar12 * g_vectorOne.y; fVar12 = fVar12 * g_vectorOne.x; tmpEntity->_renderZOffset = -2000; (tmpEntity->_sprite)._scale.y = fVar13; (tmpEntity->_sprite)._scale.x = fVar12; } npc->_stateFrame = (int)local_54->_roomList[0]._doors + npc->_stateFrame + -0x30; } } else { npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_i1 = 0x5a; } } break; case 0x10: (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; manager = g_manager; EVar16 = npc->_entityRef; if (((EVar16 == (EntityPtr)0x0) || (*(char *)((int)EVar16 + 0x173) != '\0')) || (*(int *)((int)EVar16 + 0x30) == 0)) { puVar4 = (undefined1 *)((int)register0x00000010 + -4); if (npc->_i1 == 0) { npc->_i1 = 1; MusicManager::Crossfade(&manager->_musicManager,0x42,0.08); puVar4 = puStack_20; if (0x75 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60) { (g_manager->_musicManager)._queuedMusicID = 0x75; } } puStack_20 = puVar4; uVar6 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar6); if ((player->_queuedItem)._item != (void *)0x0) { ExceptionList = local_1c; return; } uVar6 = uVar6 + 1; } while (uVar6 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } npc->_state = 2; npc->_projectileDelay = 0x1e; } } } ExceptionList = local_1c; return; } //@@ 00571170 FUN_00571170 void FUN_00571170(void) { void *pvVar1; int *in_ECX; void *owner; pvVar1 = (void *)in_ECX[1]; owner = (void *)*in_ECX; if (owner == pvVar1) { in_ECX[1] = (int)owner; return; } do { invoke_pending_callbacks(owner); owner = (void *)((int)owner + 0x78); } while (owner != pvVar1); in_ECX[1] = *in_ECX; return; } //@@ 005711a0 std::vector<32byte>::_Clear_and_reserve_geometric /* DB: ECX vector of 0x20-byte elements (max 0x7ffffff): frees old storage and allocates max(1.5x cap, n) leaving size 0, used before memmove in Game_StateSlot::operator_assign, GameState::copy_room_list, Level::generate_boss_room (MSVC vector::assign helper) */ void std::vector<32byte>::_Clear_and_reserve_geometric(uint param_1) { int iVar1; void *pvVar2; int *in_ECX; uint uVar3; uint uVar4; if (0x7ffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar1 = *in_ECX; uVar3 = in_ECX[2] - iVar1 >> 5; if (0x7ffffff - (uVar3 >> 1) < uVar3) { uVar4 = 0x7ffffff; } else { uVar4 = (uVar3 >> 1) + uVar3; if (uVar4 < param_1) { uVar4 = param_1; } } if (iVar1 != 0) { FUN_00571230(iVar1,uVar3); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x7ffffff < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar2 = _Allocate(uVar4 * 0x20); *in_ECX = (int)pvVar2; in_ECX[1] = (int)pvVar2; in_ECX[2] = (int)((int)pvVar2 + uVar4 * 0x20); return; } //@@ 00571230 FUN_00571230 void FUN_00571230(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x20; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 00571280 NpcAI::ENTITY_POOP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 245 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_POOP(Entity_NPC *npc) { uint *puVar1; undefined4 *puVar2; code *pcVar3; ANM2 *pAVar4; qword qVar5; byte bVar6; uint uVar7; EntityRef *pEVar8; EntityPtr EVar9; EntityPtr *pEVar10; int *extraout_EAX; int *lastDamageSource; Entity_Player *player; Entity *effect; uint uVar11; uint rngResult; byte *curAnimChar; Vector *randomDir; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; char isJustInitialized; byte *pbVar12; void *pvVar13; int iVar14; byte *stateAnimChar; undefined1 *size; int iVar15; bool bVar16; float fVar17; float newStage; float fVar18; float newHealth; char *pcVar19; EntityRef sourceRef; char local_10d; Entity_NPC *savedNpc; Vector local_108; Vector local_100; char isStageChanged; EntityPtr local_f4; float local_f0; EntityPtr local_ec; undefined1 local_e8 [20]; float fStack_d4; undefined4 uStack_d0; float fStack_cc; undefined8 local_c8; undefined1 local_c0 [20]; float local_ac; byte spritesheetPath [132]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; puStack_20 = spritesheetPath + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00af502b; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(spritesheetPath + 0x98); local_ec = (EntityPtr)npc->_aiCallPhase; isStageChanged = '\0'; local_10d = '\0'; savedNpc = npc; local_24 = uVar7; if (local_ec == (EntityPtr)0x3) { if ((npc->_flags & 0x400000000000000) == 0) { return; } ExceptionList = &local_1c; puStack_20 = spritesheetPath + 0xa4; bVar6 = Entity::IsActiveEnemy(npc->_collisionEntity,0); if (bVar6 == 0) { ExceptionList = local_1c; return; } pEVar8 = EntityRef::EntityRef(&sourceRef); (**(code **)(*(int *)npc + 0x24))(pEVar8,uVar7); local_100.x = 0.0; local_100.y = 0.0; if (npc->_variant == 0xb) { local_f4 = (EntityPtr)0x1000000; } else { local_f4 = (EntityPtr)0x0; } local_ec = (EntityPtr)0x0; pcVar3 = *(code **)(*(int *)npc->_collisionEntity + 0x20); EVar9 = (EntityPtr)savedNpc; if (savedNpc->_spawnerEntity != (EntityPtr)0x0) { EVar9 = savedNpc->_spawnerEntity; } EntityRef::constructor(&sourceRef,(Entity *)EVar9); (*pcVar3)(0x41700000,local_f4,local_ec,&sourceRef,0x1e); pvVar13 = savedNpc->_collisionEntity; savedNpc->_collisionResult = 0; fVar18 = (savedNpc->_velocity).y; *(float *)((int)pvVar13 + 0x360) = (savedNpc->_velocity).x * 0.5 + *(float *)((int)pvVar13 + 0x360); *(float *)((int)pvVar13 + 0x364) = fVar18 * 0.5 + *(float *)((int)pvVar13 + 0x364); ExceptionList = local_1c; return; } if (local_ec == (EntityPtr)0x1) { ExceptionList = &local_1c; pbVar12 = spritesheetPath + 0xa4; if ((1.0 < npc->_health) && (pbVar12 = spritesheetPath + 0xa4, npc->_variant == 0xe)) { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x400000000000000); if (bVar6 == 0) { fVar18 = 15.0; } else { fVar18 = 2.0; } iVar15 = Entity::GetIntervalTicks((Entity *)npc,fVar18,0.0); pbVar12 = puStack_20; if (iVar15 != 0) { fVar18 = (float)Random(); local_100.y = fVar18; uVar7 = Random(); randomDir = MusicManager::RandomVector(&local_108); uVar11 = Random(); npc = savedNpc; fVar18 = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10; fVar17 = fVar18 * randomDir->y; fVar18 = fVar18 * randomDir->x; local_ac = fVar17 + fVar17 + (savedNpc->_velocity).y; local_c0._16_4_ = fVar18 + fVar18 + (savedNpc->_velocity).x; effect = Game::Spawn(g_game,1000,0x8d,&savedNpc->_pos,(Vector *)(local_c0 + 0x10), (Entity *)0x0,uVar7 & 1,(uint)local_100.y); iVar15 = *(int *)effect; effect->_spawnerType = 1; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[8] = '<'; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[0xc] = '<'; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (**(code **)(iVar15 + 0xc))(); pbVar12 = puStack_20; } } puStack_20 = pbVar12; if (npc->_variant == 0x10) { if (npc->_health <= 1.0) { pEVar10 = &npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { *(undefined1 *)((int)npc->_entityRef + 0x171) = 1; local_108.y = (float)((int)*pEVar10 + 0x3bc); if (*(EntityPtr *)local_108.y != (EntityPtr)0x0) { local_100.y = local_108.y; std::multiset::erase(&local_100.y); } *(EntityPtr *)local_108.y = (EntityPtr)0x0; if (*pEVar10 != (EntityPtr)0x0) { local_100.y = (float)pEVar10; std::multiset::erase(&local_100.y); } *pEVar10 = (EntityPtr)0x0; } } else { bVar6 = Entity::IsFrame((Entity *)npc,3,0); if ((bVar6 != 0) && (local_108.y = 0.0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,(uint)local_108.y); fVar18 = (npc->_pos).y - (player->_pos).y; fVar17 = (npc->_pos).x - (player->_pos).x; fVar18 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); if (fVar18 < player->_size + 70.0) { iVar14 = player->_hallowedGroundCountdown; iVar15 = iVar14 + 4; if (4 < iVar15) { iVar15 = 4; } player->_hallowedGroundCountdown = iVar15; if (0 < iVar14 != 0 < iVar15) { player->_cacheFlags = player->_cacheFlags | 99; Entity_Player::EvaluateItems(); } } local_108.y = (float)((int)local_108.y + 1); } while ((uint)local_108.y < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } if (npc->_entityRef == (EntityPtr)0x0) { uVar7 = Random(); EVar9 = (EntityPtr) Game::Spawn(g_game,1000,0x70,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); Entity_Effect::FollowParent((Entity_Effect *)EVar9,(Entity *)npc); iVar15 = *(int *)EVar9; ((Vector *)((int)EVar9 + 0xdc))->x = 0.0; *(float *)((int)EVar9 + 0xe0) = -4.0; *(int *)((int)EVar9 + 0x354) = 10000; (**(code **)(iVar15 + 0xc))(); if (npc->_entityRef != (EntityPtr)0x0) { local_100.y = (float)&npc->_entityRef; std::multiset::erase(&local_100.y); } npc->_entityRef = EVar9; std::multiset::insert(&npc->_entityRef); } } } if (npc->_variant == 0xf) { if ((npc->_flags & 0x400000000000000) == 0) { fVar18 = 15.0; } else { fVar18 = 2.0; } iVar15 = Entity::GetIntervalTicks((Entity *)npc,fVar18,0.0); if (iVar15 != 0) { uVar7 = Random(); effect = Game::Spawn(g_game,1000,0x2d,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); effect->_spawnerType = 1; uVar7 = Random(); iVar15 = *(int *)effect; fVar18 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar17 = fVar18 * g_vectorOne.y; fVar18 = fVar18 * g_vectorOne.x; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[8] = '<'; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; (effect->_sprite)._scale.y = fVar17; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[0xc] = '<'; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (effect->_sprite)._scale.x = fVar18; (**(code **)(iVar15 + 0xc))(); npc = savedNpc; } } LAB_0057272c: if ((npc->_flags & 0x400000000000000) == 0) { ExceptionList = local_1c; return; } if (local_ec == (EntityPtr)0x2) { (npc->_posOffset).y = (npc->_v1).y * npc->_speedMultiplier * 0.5 + (npc->_v1).x; ExceptionList = local_1c; return; } (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; fVar18 = (npc->_v1).y; fVar17 = fVar18 + 2.0; fVar18 = fVar18 * npc->_speedMultiplier + (npc->_v1).x; (npc->_v1).x = fVar18; (npc->_v1).y = fVar17; if (npc->_variant == 0xb) { fVar17 = fVar17 + 0.8; (npc->_v1).y = fVar17; } if (-26.0 <= fVar18) { npc->_entityGridCollisionClass = (fVar17 < -3.0) + 5; } else { npc->_entityGridCollisionClass = 3; } if (0.0 <= fVar18) { qVar5 = npc->_flags; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 & 0xfbffffff; *(int *)&npc->_flags = (int)qVar5; iVar15 = 0x1e7; (npc->_velocity).x = (npc->_velocity).x * 0.6; (npc->_velocity).y = (npc->_velocity).y * 0.6; if (npc->_variant != 0xb) { iVar15 = 0x45; } Entity_NPC::PlaySound(npc,iVar15,1.0,2,0,1.0); sprintf(local_c0 + 8,(byte *)"State%d"); bVar6 = ANM2::SetAnimation(&npc->_sprite,local_c0 + 8,1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; npc = savedNpc; } (npc->_v1).x = 0.0; fVar18 = 0.0; (npc->_v1).y = 0.0; npc->_entityGridCollisionClass = 5; npc->_entityCollisionClass = 4; } (npc->_posOffset).y = fVar18; ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = spritesheetPath + 0xa4; if (local_ec == (EntityPtr)0x2) goto LAB_0057272c; puStack_20 = spritesheetPath + 0xa4; if (((npc->_flags & 0x400) != 0) && (puStack_20 = spritesheetPath + 0xa4, npc->_variant == 0)) { npc->_variant = 1; puStack_20 = spritesheetPath + 0xa4; local_e8._16_4_ = std::_Allocate(0x20); local_c8._0_4_ = 0x1b; local_c8._4_4_ = (void *)0x1f; builtin_strncpy((char *)local_e8._16_4_,"gfx/grid/grid_poop_gold.png",0x1c); local_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,0,(std_string *)(local_e8 + 0x10)); local_14 = 0xffffffff; bVar6 = extraout_CL; if (&DAT_0000000f < local_c8._4_4_) { size = local_c8._4_4_ + 1; pcVar19 = (char *)local_e8._16_4_; if ((undefined1 *)0xfff < size) { pcVar19 = *(char **)(local_e8._16_4_ + -4); size = local_c8._4_4_ + 0x24; if ((char *)0x1f < (char *)(local_e8._16_4_ + (-4 - (int)pcVar19))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar19,(uint)size); bVar6 = extraout_CL_00; } ANM2::LoadGraphics(&npc->_sprite,bVar6); isStageChanged = '\x01'; } if (npc->_state != 0) { bVar6 = Entity::HasEntityFlags((Entity *)npc,0x400000000000000); if (bVar6 == 0) { local_ec = npc->_spawnerEntity; npc->_friction = npc->_friction * 0.5; if ((((local_ec != (EntityPtr)0x0) && (*(uint *)((int)local_ec + 0x28) == 1)) && (npc->_variant == 0xc)) && ((bVar6 = Entity::IsFrame((Entity *)npc,0x3c,0), bVar6 != 0 && (1.0 < npc->_health)))) { if ((npc->_entityDeque)._size < 3) { local_108.y = 0.0; std::deque::resize(3,&local_108.y); } uVar7 = 0; fVar18 = (float)(npc->_entityDeque)._offset; do { local_ac = fVar18; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + ((int)local_ac + uVar7 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + ((int)local_ac + uVar7 & 3) * 4) == 0) { local_f4 = (EntityPtr) Entity_Player::AddBlueFlies ((Entity_Player *)local_ec,1,&npc->_pos,(Entity *)0x0); if (local_f4 != (EntityPtr)0x0) { local_ac = (float)(npc->_entityDeque)._offset; uVar11 = (int)local_ac + uVar7 & 3; iVar15 = *(int *)((int)(npc->_entityDeque)._map + ((int)local_ac + uVar7 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); local_ec = (EntityPtr)(iVar15 + uVar11 * 4); if (*(int *)(iVar15 + uVar11 * 4) != 0) { local_108.y = (float)local_ec; std::multiset::erase(&local_108.y); } EVar9 = local_f4; *(EntityPtr *)local_ec = local_f4; std::multiset::insert(local_ec); if (*(int *)((int)EVar9 + 0x3bc) != 0) { local_108.y = (float)((int)EVar9 + 0x3bc); std::multiset::erase(&local_108.y); } *(Entity_NPC **)((int)EVar9 + 0x3bc) = npc; std::multiset::insert((int)EVar9 + 0x3bc); Entity_Familiar::AddToOrbit((Entity_Familiar *)EVar9,1); } break; } uVar7 = uVar7 + 1; fVar18 = (float)(npc->_entityDeque)._offset; } while (uVar7 < 3); } } if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y) ) { Room::RaiseGridPathAtPos(g_game->_room,&npc->_targetPosition,900); fVar18 = (npc->_targetPosition).y; fVar17 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar18 - fVar17; } if (((npc->_dead == 0) && (1.0 < npc->_health)) && (npc->_controllerID != -1)) { Entity_NPC::GetControllerInput(npc,&local_100,0.1); if ((local_100.x == g_vectorZero.x) && (local_100.y == g_vectorZero.y)) { (npc->_v2).x = 0.0; } else { fVar18 = npc->_friction; local_ec = (EntityPtr)0x0; local_108.y = 1.0 - (npc->_v2).x; pEVar10 = (EntityPtr *)&local_108.y; if (local_108.y <= 0.0) { pEVar10 = &local_ec; } EVar9 = *pEVar10; if (fVar18 != 0.0) { fVar17 = npc->_speedMultiplier; (npc->_velocity).y = (fVar17 * local_100.y * (float)*pEVar10) / fVar18 + (npc->_velocity).y; (npc->_velocity).x = (fVar17 * local_100.x * (float)EVar9) / fVar18 + (npc->_velocity).x; } fVar18 = npc->_speedMultiplier * 0.2 + (npc->_v1).x; if (1.0 <= fVar18) { fVar18 = 1.0; } (npc->_v2).x = fVar18; } } npc->_pendingDamage = 0.0; fVar18 = 0.0; pvVar13 = (npc->_damageEvents)._begin; iVar14 = (int)(npc->_damageEvents)._end - (int)pvVar13; iVar15 = iVar14 >> 0x1f; if (iVar14 / 0x38 + iVar15 != iVar15) { local_ec = (EntityPtr)0x0; local_108.y = 0.0; do { if ((*(int *)((int)pvVar13 + (int)((int)local_ec + 0x10)) == 1000) && (*(int *)((int)pvVar13 + (int)((int)local_ec + 0x14)) == 0x33)) { *(undefined4 *)((int)pvVar13 + (int)local_ec) = 0; } local_108.y = (float)((int)local_108.y + 1); fVar18 = *(float *)((int)pvVar13 + (int)local_ec) + npc->_pendingDamage; local_ec = (EntityPtr)((int)local_ec + 0x38); npc->_pendingDamage = fVar18; pvVar13 = (npc->_damageEvents)._begin; } while ((uint)local_108.y < (uint)(((int)(npc->_damageEvents)._end - (int)pvVar13) / 0x38)); } fVar17 = 6.0 - npc->_health; if (fVar17 <= 1.0) { fVar17 = 1.0; } if (5.0 <= fVar17) { fVar17 = 5.0; } local_f4 = (EntityPtr)(int)fVar17; if ((npc->_dead != 0) || (0.0 < fVar18)) { local_f0 = 1.0; if ((npc->_dead != 0) || ((npc->_pendingDamageFlags & 4) != 0)) { local_f0 = 4.0; } uVar7 = Random(); if (uVar7 % 3 == 0) { local_f0 = local_f0 + 1.0; } if (((npc->_variant != 1) && (npc->_variant != 0xb)) && (uVar7 = Random(), uVar7 % 3 == 0)) { local_f0 = local_f0 + 1.0; } if ((npc->_variant == 1) || (fVar18 = local_f0, npc->_variant == 0xb)) { uVar7 = Random(); fVar18 = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.2) * local_f0; } pvVar13 = (npc->_damageEvents)._begin; iVar15 = ((int)(npc->_damageEvents)._end - (int)pvVar13) / 0x38; if (iVar15 == 0) { EntityRef::constructor((EntityRef *)local_e8,(Entity *)0x0); lastDamageSource = extraout_EAX; } else { lastDamageSource = (int *)((int)pvVar13 + iVar15 * 0x38 + -0x28); local_e8._0_4_ = *lastDamageSource; local_e8._4_4_ = lastDamageSource[1]; local_e8._8_4_ = lastDamageSource[2]; local_e8._12_4_ = lastDamageSource[3]; puVar2 = (undefined4 *)((int)pvVar13 + iVar15 * 0x38 + -0x18); local_e8._16_4_ = (char *)*puVar2; fStack_d4 = (float)puVar2[1]; uStack_d0 = (float)puVar2[2]; fStack_cc = (float)puVar2[3]; lastDamageSource = (int *)local_e8; local_c8 = *(undefined8 *)((int)pvVar13 + iVar15 * 0x38 + -8); } sourceRef._type = *lastDamageSource; sourceRef._variant = lastDamageSource[1]; sourceRef._spawnerType = lastDamageSource[2]; sourceRef._spawnerVariant = lastDamageSource[3]; sourceRef._position.x = (float)lastDamageSource[4]; sourceRef._position.y = (float)lastDamageSource[5]; sourceRef._velocity.x = (float)lastDamageSource[6]; sourceRef._velocity.y = (float)lastDamageSource[7]; sourceRef._flags = lastDamageSource[8]; sourceRef._entity = (void *)lastDamageSource[9]; if (0.0 < fVar18) { fVar17 = npc->_health; iVar15 = 0; newHealth = fVar17 - fVar18; isStageChanged = '\x01'; if (newHealth <= 1.0) { newHealth = 1.0; } newStage = 6.0 - newHealth; npc->_health = newHealth; if (newStage <= 1.0) { newStage = 1.0; } if (5.0 <= newStage) { newStage = 5.0; } local_f0 = (float)(int)newStage; switch(npc->_variant) { case 1: iVar15 = 3; break; case 0xb: iVar15 = 0xc; break; case 0xc: iVar15 = 2; break; case 0xd: iVar15 = 0xd; break; case 0xe: iVar15 = 0xe; break; case 0xf: iVar15 = 5; break; case 0x10: iVar15 = 6; } local_ec = (EntityPtr)&npc->_pos; local_100 = npc->_pos; spawn_poop_rewards(npc->_initSeed,(int)((5.0 - fVar17) * 250.0),(int)(fVar18 * 250.0),0, (npc->_pos).y,&sourceRef); if ((int)local_f4 < (int)local_f0) { if (local_f4 == (EntityPtr)0x0) { uVar7 = 0; } else { uVar7 = Random(); uVar7 = uVar7 % (uint)local_f4; } local_100 = *(Vector *)local_ec; GridEntity_Poop::spawn_hit_gibs(uVar7 + 1); game = g_game; uVar7 = Random(); player = PlayerManager::RandomCollectibleOwner (&game->_playerManager,0x240,uVar7,(RNG **)0x0); EVar9 = local_ec; local_100.y = (float)player; local_108.y = (float)((int)local_f0 - (int)local_f4); if ((player != (Entity_Player *)0x0) && (0 < (int)local_108.y)) { do { if ((local_f0 == 7.00649e-45) || ((bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,2), bVar6 != 0 || (uVar7 = Random(), (uVar7 & 1) == 0)))) { spawn_dip_at(iVar15,(Vector *)EVar9,(Entity *)local_100.y,&g_vectorZero); } local_108.y = (float)((int)local_108.y + -1); } while ((EntityPtr)local_108.y != (EntityPtr)0x0); } npc = savedNpc; } if ((local_f0 == 7.00649e-45) && ((int)local_f4 < 5)) { local_100 = npc->_pos; GridEntity_Poop::destroy_effects(); local_100 = npc->_pos; GridEntity_Poop::spawn_drops(&local_100,iVar15,npc->_initSeed,0,0,&sourceRef); if (npc->_variant == 0xd) { uVar7 = Random(); effect = Game::Spawn(g_game,1000,0x33,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); iVar15 = *(int *)effect; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[8] = -0x6a; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[0xc] = -0x6a; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (**(code **)(iVar15 + 0xc))(); } else if (npc->_variant == 0xe) { uVar7 = Random(); local_f0 = 0.0; local_100.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)] ) * 2.3283064e-10 * 360.0; do { fVar18 = local_f0; uVar7 = Random(); local_f4 = (EntityPtr) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)] ) * 2.3283064e-10 * 30.0 + (((float)(int)fVar18 * 45.0 + local_100.y) - 15.0)); uVar7 = Random(); uVar11 = Random(); local_f4 = (EntityPtr)((float)local_f4 * 0.017453292); rngResult = Random(); fVar18 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; local_108.y = fVar18 + fVar18 + 8.0; local_c0._16_4_ = cos((float)local_f4); local_c0._16_4_ = (float)local_c0._16_4_ * local_108.y; local_ac = sin((float)local_f4); local_ac = local_ac * local_108.y; effect = Game::Spawn(g_game,1000,0x8d,(Vector *)local_ec,(Vector *)(local_c0 + 0x10), (Entity *)0x0,uVar11 & 1,uVar7); iVar15 = *(int *)effect; effect->_spawnerType = 1; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[8] = -0x6a; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &effect[1]._sprite; (pAVar4->_filename)._buf[0xc] = -0x6a; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (**(code **)(iVar15 + 0xc))(); local_f0 = (float)((int)local_f0 + 1); } while ((int)local_f0 < 8); npc = savedNpc; } if ((npc->_minecart != (EntityPtr)0x0) || ((npc->_flags & 0x400000000000000) != 0)) { (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } } } pvVar13 = (npc->_damageEvents)._begin; npc->_dead = 0; (npc->_damageEvents)._end = pvVar13; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; } if (isStageChanged == '\0') { ExceptionList = local_1c; return; } isJustInitialized = local_10d; goto LAB_005721d7; } qVar5 = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)qVar5 & 0xfffffffb | 0x20d0011; npc->_aiCallFlags = 7; switch(npc->_variant) { case 1: sprintf(spritesheetPath,(byte *)"gfx/grid/grid_poop_gold.png"); break; default: RNG::RandomInt(&npc->_dropRNG,3); pcVar19 = "gfx/grid/grid_poop_%d.png"; goto LAB_00571615; case 0xb: sprintf(spritesheetPath,(byte *)"gfx/grid/grid_poop_stone.png"); break; case 0xc: sprintf(spritesheetPath,(byte *)"gfx/grid/grid_poop_corn.png"); break; case 0xd: sprintf(spritesheetPath,(byte *)"gfx/grid/grid_poop_flaming.png"); break; case 0xe: sprintf(spritesheetPath,(byte *)"gfx/grid/grid_poop_stinky.png"); break; case 0xf: sprintf(spritesheetPath,(byte *)"gfx/grid/grid_poop_black.png"); break; case 0x10: RNG::RandomInt(&npc->_dropRNG,3); pcVar19 = "gfx/grid/grid_poop_white_%d.png"; LAB_00571615: sprintf(spritesheetPath,(byte *)pcVar19); } pbVar12 = spritesheetPath; local_c0._16_4_ = 0.0; local_ac = 2.10195e-44; local_c0._0_4_ = (void *)0x0; do { bVar6 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar6 != 0); std::string::assign(local_c0,spritesheetPath,(int)pbVar12 - (int)(spritesheetPath + 1)); local_14 = 1; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,0,(std_string *)local_c0); local_14 = 0xffffffff; bVar6 = extraout_CL_01; if (0xf < (uint)local_ac) { uVar7 = (int)local_ac + 1; pvVar13 = (void *)local_c0._0_4_; if (0xfff < uVar7) { pvVar13 = *(void **)(local_c0._0_4_ + -4); uVar7 = (int)local_ac + 0x24; if (0x1f < (uint)(local_c0._0_4_ + (-4 - (int)pvVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar13,uVar7); bVar6 = extraout_CL_02; } ANM2::LoadGraphics(&npc->_sprite,bVar6); uVar7 = RNG::RandomInt(&npc->_dropRNG,2); (npc->_sprite)._flipX = uVar7 != 0; if ((npc->_variant == 0xd) && (1.0 < npc->_health)) { uVar7 = Random(); EVar9 = (EntityPtr)Game::Spawn(g_game,1000,0x33,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar7); Entity_Effect::FollowParent((Entity_Effect *)EVar9,(Entity *)npc); *(int *)((int)EVar9 + 0x45c) = -1; *(int *)((int)EVar9 + 0x460) = -1; if (npc->_entityRef != (EntityPtr)0x0) { local_108.y = (float)&npc->_entityRef; std::multiset::erase(&local_108.y); } npc->_entityRef = EVar9; std::multiset::insert(&npc->_entityRef); (**(code **)(*(int *)EVar9 + 0xc))(); *(byte *)((int)EVar9 + 0x171) = 0; } npc->_state = 3; isJustInitialized = '\x01'; LAB_005721d7: fVar18 = 6.0 - npc->_health; if (fVar18 <= 1.0) { fVar18 = 1.0; } if (5.0 <= fVar18) { fVar18 = 5.0; } local_100.y = (float)(int)fVar18; if (((float)(int)fVar18 == 1.4013e-45) && (isJustInitialized != '\0')) { bVar6 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar6 == 0) { ExceptionList = local_1c; return; } AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; ExceptionList = local_1c; return; } sprintf((byte *)&uStack_d0,(byte *)"State%d"); pbVar12 = (npc->_sprite)._animState._animData; if (pbVar12 != (byte *)0x0) { curAnimChar = pbVar12; if (0xf < *(uint *)(pbVar12 + 0x14)) { curAnimChar = *(byte **)pbVar12; } stateAnimChar = (byte *)&uStack_d0; do { bVar6 = *curAnimChar; bVar16 = bVar6 < *stateAnimChar; if (bVar6 != *stateAnimChar) { LAB_00572280: uVar7 = -(uint)bVar16 | 1; goto LAB_00572285; } if (bVar6 == 0) break; bVar6 = curAnimChar[1]; bVar16 = bVar6 < stateAnimChar[1]; if (bVar6 != stateAnimChar[1]) goto LAB_00572280; curAnimChar = curAnimChar + 2; stateAnimChar = stateAnimChar + 2; } while (bVar6 != 0); uVar7 = 0; LAB_00572285: if ((uVar7 == 0) && ((pbVar12[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_005722c4; } bVar6 = ANM2::SetAnimation(&npc->_sprite,(byte *)&uStack_d0,1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; npc = savedNpc; } LAB_005722c4: if (local_100.y == 7.00649e-45) { npc->_entityCollisionClass = 0; npc->_sortingLayer = 0; npc->_renderZOffset = 0xc1c; } ExceptionList = local_1c; return; } //@@ 005729a0 FUN_005729a0 void FUN_005729a0(int *param_1) { int *piVar1; int *piVar2; int iVar3; int *piVar4; int in_ECX; piVar4 = *(int **)(in_ECX + 0xbec); piVar1 = (int *)(in_ECX + 0xbec); if ((piVar4 != (int *)0x0) && (piVar4[10] == 1000)) { if ((char)param_1 == '\0') { piVar4[0x117] = 10; piVar2 = piVar4 + 0xf1; piVar4[0x118] = 10; iVar3 = *(int *)(*(int *)(in_ECX + 0x3c0) + 0x340); piVar4[0xcf] = *(int *)(*(int *)(in_ECX + 0x3c0) + 0x33c); piVar4[0xd0] = iVar3; piVar4[0xd3] = 0; piVar4[0xd4] = -0x3ec00000; if (*piVar2 != 0) { param_1 = piVar2; std::multiset::erase(¶m_1); } *piVar2 = 0; } else { (**(code **)(*piVar4 + 0x28))(); } if (*piVar1 != 0) { param_1 = piVar1; std::multiset::erase(¶m_1); } *piVar1 = 0; } return; } //@@ 00572a70 NpcHelper::clutch_find_farthest_orbital /* DB: ? QuerySublist of room entities: enemies with spawner (+0x3bc) == the Clutch, same friendliness, not its child, +0xbc4 != 99, not flag 0x10; returns the farthest one; only caller NpcAI::ENTITY_CLUTCH */ EntityPtr NpcHelper::clutch_find_farthest_orbital(void) { qword qVar1; byte bVar2; void *pvVar3; qword *pqVar4; Entity *in_ECX; byte extraout_DL; EntityPtr EVar5; uint uVar6; float fVar7; float fVar8; EntityList_EL local_38; undefined4 local_24; float local_1c; EntityPtr local_18; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1840; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = (EntityPtr)0x0; local_1c = 0.0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_38,0x379,-1,-1,0,0); uVar6 = 0; EVar5 = (EntityPtr)0x0; if (local_38._size != 0) { pvVar3 = local_38._data; do { EVar5 = *(EntityPtr *)((int)pvVar3 + uVar6 * 4); if (EVar5 != (EntityPtr)0x0) { if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)EVar5 + 0x28) == 1)) || (*(int *)((int)EVar5 + 0x28) - 10U < 0x3de)) { local_24 = *(undefined4 *)((int)EVar5 + 0x16c); bVar2 = Entity::IsFriendly(in_ECX); if (((extraout_DL == bVar2) && (*(Entity **)((int)EVar5 + 0x3bc) == in_ECX)) && ((EVar5 != in_ECX->_child && ((*(int *)((int)EVar5 + 0xbc4) != 99 && (fVar7 = (in_ECX->_pos).y - *(float *)((int)EVar5 + 0x340), fVar8 = (in_ECX->_pos).x - *(float *)((int)EVar5 + 0x33c), fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8), (*(uint *)((int)EVar5 + 0x168) & 0x10) == 0)))))) { pvVar3 = local_38._data; if (local_1c < fVar7) { local_1c = fVar7; local_18 = EVar5; } goto LAB_00572bab; } } pvVar3 = local_38._data; } LAB_00572bab: uVar6 = uVar6 + 1; EVar5 = local_18; } while (uVar6 < (uint)local_38._size); } if (local_38._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (local_38._data != (void *)0x0) { uVar6 = *(uint *)((int)local_38._data + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar6; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar6); free((uint *)((int)local_38._data + -4)); } } ExceptionList = local_10; return EVar5; } //@@ 00572c10 FUN_00572c10 void FUN_00572c10(int param_1) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; char *pcVar5; bool bVar6; *(undefined4 *)(param_1 + 0x380) = *(undefined4 *)(param_1 + 900); pbVar1 = *(byte **)(param_1 + 0x7c); if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Regen"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_00572c60: uVar4 = -(uint)bVar6 | 1; goto LAB_00572c65; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_00572c60; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00572c65: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(param_1 + 0x8c) != '\0')))) goto LAB_00572c98; } bVar2 = ANM2::SetAnimation((ANM2 *)(param_1 + 0x48),(byte *)"Regen",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(param_1 + 0x78)); *(undefined1 *)(param_1 + 0x8c) = 1; } LAB_00572c98: if (*(int *)(param_1 + 0x7c) != 0) { AnimationState::SetFrameFloat((AnimationState *)(param_1 + 0x78),15.0); } *(undefined4 *)(param_1 + 0xb64) = 0xd; return; } //@@ 00572cc0 NpcHelper::clutch_spawn_fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? called from NpcAI::ENTITY_CLUTCH with the target NPC: sets its flag |0x10, Game::Spawn(33,13 ...) fireplace variant 13 at target pos, loads "gfx/009.002_Fire Projectile.anm2", plays "Flickering", EntityRef parent */ void NpcHelper::clutch_spawn_fire(int *param_1) { float fVar1; float fVar2; byte bVar3; uint uVar4; Entity *fire; byte *pbVar5; LayerState *layer; uint angleRoll; EntityPtr in_ECX; char *pcVar6; undefined1 *size; bool bVar7; float fVar8; Vector spawnPos; Vector local_64; ANM2 *local_5c; int *local_58; EntityPtr local_54; Entity *local_50; undefined1 local_4c [32]; int animPathSize; undefined1 *animPathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; code *addFlagsFn; ANM2 *fireSprite; EntityPtr *parentSlot; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af506d; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; local_58 = param_1; param_1[0x5a] = param_1[0x5a] | 0x10; param_1[0x5b] = param_1[0x5b]; addFlagsFn = *(code **)(*param_1 + 0x24); local_54 = in_ECX; local_24 = uVar4; EntityRef::constructor((EntityRef *)local_4c,(Entity *)in_ECX); (*addFlagsFn)(local_4c,uVar4); uVar4 = Random(); local_64.x = (float)local_58[0xcf]; local_64.y = (float)local_58[0xd0]; fire = Game::Spawn(g_game,0x21,0xd,&local_64,&g_vectorZero,(Entity *)in_ECX,0,uVar4); animPathSize = 0; fireSprite = &fire->_sprite; animPathCapacity = &DAT_0000000f; local_4c._16_4_ = 0.0; local_5c = fireSprite; local_50 = fire; local_4c._16_4_ = std::_Allocate(0x30); animPathSize = 0x20; animPathCapacity = &DAT_0000002f; builtin_strncpy((char *)local_4c._16_4_,"gfx/009.002_Fire Projectile.anm2",0x21); local_14 = 0; ANM2::Load(fireSprite,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; if (&DAT_0000000f < animPathCapacity) { size = animPathCapacity + 1; pcVar6 = (char *)local_4c._16_4_; if ((undefined1 *)0xfff < size) { pcVar6 = *(char **)(local_4c._16_4_ + -4); size = animPathCapacity + 0x24; if ((char *)0x1f < (char *)(local_4c._16_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,(uint)size); } pbVar5 = (fire->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pcVar6 = "Flickering"; do { bVar3 = *pbVar5; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_00572e46: uVar4 = -(uint)bVar7 | 1; goto LAB_00572e4b; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_00572e46; pbVar5 = pbVar5 + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00572e4b: if ((uVar4 == 0) && ((*(char *)((int)(fire->_sprite)._animState._animData + 0x34) == '\0' || ((fire->_sprite)._animState._isPlaying != 0)))) goto LAB_00572e7c; } bVar3 = ANM2::SetAnimation(fireSprite,(byte *)"Flickering",1); if (bVar3 != 0) { AnimationState::Rewind(&(fire->_sprite)._animState); (fire->_sprite)._animState._isPlaying = 1; } LAB_00572e7c: fireSprite = local_5c; pbVar5 = (byte *)0x0; if ((local_50->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(fireSprite,pbVar5); fVar2 = fRam00c34e34; fVar1 = fRam00c34e30; fVar8 = fRam00c34e2c; if (&layer->_color != (ColorMod *)&DAT_00c34e28) { (layer->_color)._tint[0] = _DAT_00c34e28; (layer->_color)._tint[1] = fVar8; (layer->_color)._tint[2] = fVar1; (layer->_color)._tint[3] = fVar2; fVar2 = fRam00c34e44; fVar1 = fRam00c34e40; fVar8 = fRam00c34e3c; (layer->_color)._colorize[0] = _DAT_00c34e38; (layer->_color)._colorize[1] = fVar8; (layer->_color)._colorize[2] = fVar1; (layer->_color)._colorize[3] = fVar2; *(undefined8 *)(layer->_color)._offset = DAT_00c34e48; (layer->_color)._offset[2] = DAT_00c34e50; } pbVar5 = pbVar5 + 1; } while (pbVar5 < (byte *)(local_50->_sprite)._layerCount); in_ECX = local_54; } (**(code **)(*(int *)local_50 + 0xc))(); local_50 = (Entity *)0x2; do { uVar4 = Random(); local_54 = (EntityPtr)local_58[0xcf]; local_64.y = (float)local_58[0xd0]; angleRoll = Random(); fVar8 = (float)((double)(int)angleRoll + __uint_to_double_fixup[-((int)angleRoll >> 0x1f)]) * 2.3283064e-10 * 3.14; local_5c = (ANM2 *)(fVar8 + fVar8); fVar8 = cos((float)local_5c); spawnPos.x = fVar8 * 10.0 + (float)local_54; fVar8 = sin((float)local_5c); spawnPos.y = fVar8 * 10.0 + local_64.y; local_54 = (EntityPtr) Game::Spawn(g_game,0x399,1,&spawnPos,&g_vectorZero,(Entity *)in_ECX,0,uVar4); parentSlot = (EntityPtr *)((int)local_54 + 0x3bc); if (*(EntityPtr *)((int)local_54 + 0x3bc) != (EntityPtr)0x0) { local_64.y = (float)parentSlot; std::multiset::erase(&local_64.y); } *parentSlot = in_ECX; if (in_ECX != (EntityPtr)0x0) { std::multiset::insert(parentSlot); } uVar4 = Random(); local_50 = (Entity *)((int)local_50 + -1); *(float *)((int)local_54 + 0xbb0) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; } while (local_50 != (Entity *)0x0); ExceptionList = local_1c; return; } //@@ 00573030 NpcAI::ENTITY_CLUTCH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 921 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_CLUTCH(Entity_NPC *npc) { EntityPtr EVar1; code *pcVar2; byte bVar3; uint uVar4; Entity_NPC *childNpc; Entity_NPC *parentNpc; Entity *pEVar5; EntityPtr *pEVar6; void *pvVar7; LayerState *layer; void *pvVar8; Vector *pVVar9; float *pfVar10; undefined4 *eraseResult; int extraout_ECX; int extraout_ECX_00; undefined4 extraout_ECX_01; int extraout_ECX_02; char *animName; int *extraout_EDX; undefined1 *puVar11; int *piVar12; uint uVar13; int iVar14; EntityPtr *pEVar15; EntityPtr EVar16; int iVar17; byte *pbVar18; ColorMod *layerColor; bool bVar19; float fVar20; float fVar21; float fVar22; float fVar23; undefined8 uVar24; uint uVar25; void *pvVar26; EntityRef damageSource; float jitterSin; Vector local_190; float local_188; float local_184; uint local_180; void *local_17c; float local_178; uint local_174; Vector local_170; float local_168; float local_164; EntityPtr local_160; int *local_15c; EntityPtr local_158; EntityPtr local_154; EntityPtr candidateOrbitals; Vector local_14c; EntityPtr local_144; Entity *local_140; EntityList_EL orbitalQuery; byte local_129; uint local_128; EntityPtr local_124; ProjectileParams projParams; undefined1 local_78 [8]; float fStack_70; float fStack_6c; float local_68; float fStack_64; float fStack_60; float fStack_5c; float local_58; float fStack_54; float local_50; undefined1 local_4c [32]; int anm2PathSize; undefined1 *anm2PathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Entity_NPC *orbital; float *damageEventsEnd; ANM2 *fireSprite; Manager *manager; std_deque *trailDeque; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af510d; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; local_128 = npc->_aiCallPhase; local_160 = (EntityPtr)npc; local_24 = uVar4; if (local_128 == 4) { std::deque::resize((npc->_vectorDeque2)._size); if ((npc->_vectorDeque2)._size != 0) { uVar13 = (npc->_vectorDeque1)._offset; pvVar7 = (npc->_vectorDeque1)._proxy; iVar17 = (npc->_vectorDeque2)._size + (npc->_vectorDeque2)._offset; pvVar26 = (npc->_vectorDeque2)._proxy; uVar25 = (npc->_vectorDeque2)._offset; pvVar8 = (npc->_vectorDeque2)._proxy; LAB_00575082: FUN_00575fe0(pvVar8,0,uVar25,pvVar26,0,iVar17,pvVar7,0,uVar13,uVar4); } LAB_00575092: if (((npc->_state == 8) || (npc->_state == 9)) && ((((npc->_sprite)._animState._animData != (void *)0x0 && (bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) || ((pvVar7 = (npc->_sprite)._animState._animData, pvVar7 != (void *)0x0 && (*(char *)((int)pvVar7 + 0x34) != '\0')))))) { local_129 = '\x01'; } else { local_129 = '\0'; } pVVar9 = Entity::GetNullOffset((Entity *)npc,&local_14c,(byte *)"Trail"); local_164 = (npc->_pos).x + pVVar9->x; local_158 = (EntityPtr)(pVVar9->y + (npc->_pos).y); if (local_129 == '\0') { fVar21 = sin((npc->_updateTime * 3.1415927) / 15.0); local_14c.y = (float)local_158 + 0.0; local_14c.x = fVar21 * 6.0 + local_164; local_190.x = g_vectorZero.x + 0.0; local_190.y = g_vectorZero.y + 1.5; } else { local_124 = (EntityPtr)cos(1.5707964); fVar20 = sin(1.5707964); fVar21 = (npc->_velocity).y; fVar22 = (npc->_velocity).x; fVar23 = fVar21 * (float)local_124; local_124 = (EntityPtr)(fVar22 * (float)local_124 - fVar21 * fVar20); local_144 = (EntityPtr)(fVar23 + fVar22 * fVar20); fVar21 = sin(npc->_updateTime * 3.1415927 * 0.25); local_14c.x = local_164 + (float)local_124 * fVar21; local_14c.y = (float)local_158 + (float)local_144 * fVar21; local_190.x = (float)local_124 * 0.33 * fVar21 + g_vectorZero.x; local_190.y = (float)local_144 * 0.33 * fVar21 + g_vectorZero.y; } local_164 = local_14c.x; local_158 = (EntityPtr)local_14c.y; if ((npc->_sprite)._animState._animData == (void *)0x0) { local_140 = (void *)0x0; } else { local_140 = AnimationState::GetNullFrame(&(npc->_sprite)._animState,(byte *)"Trail"); } local_124 = (EntityPtr)0x3f800000; if (local_128 == 2) { local_168 = 0.5; } else { local_168 = 1.0; } local_168 = local_168 * npc->_speedMultiplier; local_15c = (int *)(npc->_vectorDeque1)._offset; piVar12 = (npc->_vectorDeque1)._proxy; while (local_15c < (npc->_vectorDeque1)._size + (npc->_vectorDeque1)._offset) { if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } local_180 = (int)local_15c + 1U >> 1; local_154 = (EntityPtr)((int)local_15c + 1U & 1); iVar17 = *(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & local_180) * 4); fVar21 = *(float *)(iVar17 + 4 + (int)local_154 * 8); if (piVar12 == (int *)0x0) { iVar14 = 0; } else { iVar14 = *piVar12; } local_17c = (void *)((uint)local_15c & 1); local_174 = (uint)local_15c >> 1; iVar14 = *(int *)(*(int *)(iVar14 + 4) + (*(int *)(iVar14 + 8) - 1U & local_174) * 4); *(float *)(iVar14 + (int)local_17c * 8) = local_168 * *(float *)(iVar17 + (int)local_154 * 8) + *(float *)(iVar14 + (int)local_17c * 8); *(float *)(iVar14 + 4 + (int)local_17c * 8) = local_168 * fVar21 + *(float *)(iVar14 + 4 + (int)local_17c * 8); if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } local_184 = *(float *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & local_180) * 4); if (piVar12 == (int *)0x0) { local_178 = 0.0; } else { local_178 = (float)*piVar12; } local_144 = (EntityPtr)((int)local_15c + 2U & 1); local_160 = (EntityPtr)((int)local_15c + 2U >> 1); local_170.y = *(float *)(*(int *)(*(int *)((int)local_178 + 4) + (*(int *)((int)local_178 + 8) - 1U & (uint)local_160) * 4) + (int)local_144 * 8) * 0.08 + 0.9; if (local_168 != 1.0) { local_170.y = local_170.y / ((local_170.y + local_168) - local_170.y * local_168); } local_188 = local_170.y * *(float *)((int)local_184 + (int)local_154 * 8); local_170.y = local_170.y * *(float *)((int)local_184 + 4 + (int)local_154 * 8); uVar4 = Random(); local_184 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_184 = local_184 + local_184; jitterSin = sin(local_184); uVar4 = Random(); local_178 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar21 = cos(local_184); if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } fVar22 = *(float *)(*(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & (uint)local_160) * 4) + (int)local_144 * 8); if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } iVar17 = *(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & local_180) * 4); *(float *)(iVar17 + (int)local_154 * 8) = local_188 + fVar22 * fVar21 * local_178 * 0.3 * local_168; *(float *)(iVar17 + 4 + (int)local_154 * 8) = local_170.y + fVar22 * jitterSin * local_178 * 0.3 * local_168; if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } local_188 = 0.0; local_170.y = *(float *)(*(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & (uint)local_160) * 4) + (int)local_144 * 8) - local_168 * 0.08; pfVar10 = &local_170.y; if (local_170.y <= 0.0) { pfVar10 = &local_188; } if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } *(float *)(*(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & (uint)local_160) * 4) + (int)local_144 * 8) = *pfVar10; if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } iVar17 = *(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & local_174) * 4); fVar21 = (float)local_158 - *(float *)(iVar17 + 4 + (int)local_17c * 8); fVar22 = local_164 - *(float *)(iVar17 + (int)local_17c * 8); fVar21 = sqrtf(fVar21 * fVar21 + fVar22 * fVar22); fVar22 = 40.0; if (40.0 < fVar21) { fVar20 = Math::timescale_factor(0.6,local_168); fVar22 = fVar20 * (fVar21 - fVar22) + fVar22; if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } iVar17 = *(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & local_174) * 4); fVar20 = *(float *)(iVar17 + 4 + (int)local_17c * 8); if (piVar12 == (int *)0x0) { iVar14 = 0; } else { iVar14 = *piVar12; } iVar14 = *(int *)(*(int *)(iVar14 + 4) + (*(int *)(iVar14 + 8) - 1U & local_174) * 4); *(float *)(iVar14 + (int)local_17c * 8) = local_164 + ((*(float *)(iVar17 + (int)local_17c * 8) - local_164) * fVar22) / fVar21; *(float *)(iVar14 + 4 + (int)local_17c * 8) = (float)local_158 + ((fVar20 - (float)local_158) * fVar22) / fVar21; } if (piVar12 == (int *)0x0) { iVar17 = 0; } else { iVar17 = *piVar12; } if ((0.0 < *(float *)(*(int *)(*(int *)(iVar17 + 4) + (*(int *)(iVar17 + 8) - 1U & (uint)local_160) * 4) + (int)local_144 * 8)) || (local_128 == 2)) { local_15c = (int *)((int)local_15c + 3); } else { eraseResult = (undefined4 *) std::deque::erase (&orbitalQuery._data,piVar12,0,local_15c,piVar12,0, (int)local_15c + 3); piVar12 = (int *)*eraseResult; local_15c = (int *)eraseResult[2]; } } if ((local_128 != 2) && ((trailDeque = &npc->_vectorDeque1, (npc->_vectorDeque1)._size == 0 || (uVar4 = (npc->_vectorDeque1)._offset, uVar13 = uVar4 & 1, iVar17 = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar4 >> 1) * 4), fVar21 = (float)local_158 - *(float *)(iVar17 + 4 + uVar13 * 8), fVar22 = local_164 - *(float *)(iVar17 + uVar13 * 8), 8.0 < fVar21 * fVar21 + fVar22 * fVar22)))) { if (local_140 != (void *)0x0) { local_124 = *(EntityPtr *)((int)local_140 + 0x10); } uVar4 = Random(); local_170.y = 0.0; local_170.x = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.6) * (float)local_124; std::deque::push_back(trailDeque,&local_170); std::deque::push_back(trailDeque,&local_190); std::deque::push_back(trailDeque,&local_14c); } if ((local_140 == (void *)0x0) || (*(char *)((int)local_140 + 0xc) == '\0')) { local_58 = 0.0; fStack_54 = 0.0; local_50 = 0.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layerColor = &layer->_color; if (layerColor == (ColorMod *)local_78) goto LAB_0057597a; layerColor->_tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 0.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(fStack_54,local_58); fVar21 = local_50; } else { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layerColor = &layer->_color; if (layerColor == (ColorMod *)((int)local_140 + 0x18)) goto LAB_0057597a; fVar21 = *(float *)((int)local_140 + 0x1c); fVar22 = *(float *)((int)local_140 + 0x20); fVar20 = *(float *)((int)local_140 + 0x24); layerColor->_tint[0] = *(float *)((int)local_140 + 0x18); (layer->_color)._tint[1] = fVar21; (layer->_color)._tint[2] = fVar22; (layer->_color)._tint[3] = fVar20; fVar21 = *(float *)((int)local_140 + 0x2c); fVar22 = *(float *)((int)local_140 + 0x30); fVar20 = *(float *)((int)local_140 + 0x34); (layer->_color)._colorize[0] = *(float *)((int)local_140 + 0x28); (layer->_color)._colorize[1] = fVar21; (layer->_color)._colorize[2] = fVar22; (layer->_color)._colorize[3] = fVar20; *(undefined8 *)(layer->_color)._offset = *(undefined8 *)((int)local_140 + 0x38); fVar21 = *(float *)((int)local_140 + 0x40); } layerColor->_offset[2] = fVar21; LAB_0057597a: layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); if (&layer->_color == layerColor) { ExceptionList = local_1c; return; } fVar21 = layerColor->_tint[1]; fVar22 = layerColor->_tint[2]; fVar20 = layerColor->_tint[3]; (layer->_color)._tint[0] = layerColor->_tint[0]; (layer->_color)._tint[1] = fVar21; (layer->_color)._tint[2] = fVar22; (layer->_color)._tint[3] = fVar20; fVar21 = layerColor->_colorize[1]; fVar22 = layerColor->_colorize[2]; fVar20 = layerColor->_colorize[3]; (layer->_color)._colorize[0] = layerColor->_colorize[0]; (layer->_color)._colorize[1] = fVar21; (layer->_color)._colorize[2] = fVar22; (layer->_color)._colorize[3] = fVar20; *(undefined8 *)(layer->_color)._offset = *(undefined8 *)layerColor->_offset; (layer->_color)._offset[2] = layerColor->_offset[2]; ExceptionList = local_1c; return; } if (local_128 == 2) { puStack_20 = local_4c + 0x48; std::deque::resize((npc->_vectorDeque1)._size); if ((npc->_vectorDeque1)._size != 0) { uVar13 = (npc->_vectorDeque2)._offset; pvVar7 = (npc->_vectorDeque2)._proxy; iVar17 = (npc->_vectorDeque1)._size + (npc->_vectorDeque1)._offset; pvVar26 = (npc->_vectorDeque1)._proxy; uVar25 = (npc->_vectorDeque1)._offset; pvVar8 = (npc->_vectorDeque1)._proxy; goto LAB_00575082; } goto LAB_00575092; } iVar14 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; puStack_20 = local_4c + 0x48; local_174 = Entity::GetIntervalTicks((Entity *)npc,15.0,0.0); iVar17 = npc->_state; if ((((iVar17 == 3) || (iVar17 == 8)) || ((iVar17 == 7 && (bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"), iVar17 = extraout_ECX, bVar3 == 0)))) && (npc->_health <= npc->_maxHitPoints * 0.25)) { ANM2::Play(&npc->_sprite,(byte *)"Transition",0); npc->_state = 0x10; npc->_entityCollisionClass = 2; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); FUN_005729a0(1); iVar17 = extraout_ECX_00; } switch(npc->_state) { case 0: local_78._0_4_ = 0.8; local_78._4_4_ = 0.75; fStack_70 = 1.0; fStack_6c = 0.5; local_58 = 0.0; local_68 = 2.1; fStack_64 = 1.7; fStack_60 = 2.5; fStack_5c = 1.0; fStack_54 = 0.0; local_50 = 0.0; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)local_78); npc->_state = 3; npc->_aiCallFlags = 10; ANM2::PlayOverlay(&npc->_sprite,(byte *)"Trail",0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_visible = 0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layer->_visible = 0; npc->_entityCollisionClass = 2; npc->_entityGridCollisionClass = 3; local_140 = (Entity *)0x1; Entity_NPC::QueryNPCsType(&orbitalQuery,0x379,-1); local_14 = 0; local_128 = 0; pEVar5 = (Entity *)0x1; if (orbitalQuery._size != 0) { pvVar7 = orbitalQuery._data; do { iVar17 = *(int *)((int)pvVar7 + local_128 * 4); if (iVar17 != 0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar17 + 0x28) == 1)) || (*(int *)(iVar17 + 0x28) - 10U < 0x3de)) && ((((*(uint *)(iVar17 + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0) && (*(int *)(iVar17 + 0x3bc) == 0)))) { *(undefined4 *)(iVar17 + 0x3bc) = npc; std::multiset::insert((undefined4 *)(iVar17 + 0x3bc)); fVar21 = *(float *)(iVar17 + 900) * 1.75; *(Entity **)(iVar17 + 0xbc4) = local_140; *(float *)(iVar17 + 900) = fVar21; *(float *)(iVar17 + 0x380) = fVar21; local_140 = (Entity *)&local_140->field_0x1; } pvVar7 = orbitalQuery._data; } local_128 = local_128 + 1; } while (local_128 < (uint)orbitalQuery._size); pEVar5 = local_140; } npc->_i1 = (int)pEVar5; local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&orbitalQuery); break; case 3: ANM2::Play(&npc->_sprite,s_Idle,0); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); iVar17 = npc->_stateFrame; if (-1 < iVar17) { iVar17 = iVar17 + iVar14; npc->_stateFrame = iVar17; } npc->_friction = npc->_friction * 0.9; if ((0xf < iVar17) || (iVar17 < 0)) { local_154 = npc->_parent; if (((local_154 == (EntityPtr)0x0) || (*(int *)((int)local_154 + 0x28) != 0x379)) && (local_154 = (EntityPtr)NpcHelper::clutch_find_farthest_orbital(extraout_ECX_01), local_154 == (EntityPtr)0x0)) { ANM2::Play(&npc->_sprite,(byte *)"Transition",0); npc->_state = 0x10; FUN_005729a0(1); } else { EVar16 = local_154; fVar21 = (npc->_pos).y; npc->_state = 8; if (ABS(*(float *)((int)local_154 + 0x33c) - (npc->_pos).x) <= ABS(*(float *)((int)local_154 + 0x340) - fVar21)) { animName = "MoveStartUp"; if (fVar21 <= *(float *)((int)local_154 + 0x340)) { animName = "MoveStartDown"; } } else { animName = "MoveStart"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); if (npc->_child != (EntityPtr)0x0) { local_124 = (EntityPtr)&npc->_child; std::multiset::erase(&local_124); } npc->_child = EVar16; std::multiset::insert(&npc->_child); manager = g_manager; if (npc->_stateFrame < 0) { if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,29.0); } npc->_entityCollisionClass = 2; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); } else { local_128 = 0x13c; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,1.0,2,0,1.5,0.0); FUN_005729a0(0); uVar4 = Random(); EVar16 = local_154; local_14c.x = *(float *)((int)local_154 + 0x33c); local_14c.y = *(float *)((int)local_154 + 0x340); local_158 = (EntityPtr) Game::Spawn(g_game,1000,0xaf,&local_14c,&g_vectorZero,(Entity *)npc,0,uVar4); uVar24 = Color::Color(0x3f4ccccd); (*(code *)((ulonglong)uVar24 >> 0x20))((int)uVar24,0xffffffff,0xff,0,1); local_144 = (EntityPtr)((int)local_158 + 0x3c4); if (*(EntityPtr *)local_144 != (EntityPtr)0x0) { local_124 = local_144; std::multiset::erase(&local_124); } *(EntityPtr *)local_144 = EVar16; std::multiset::insert(local_144); local_144 = (EntityPtr)((int)local_158 + 0x3bc); if (*(EntityPtr *)local_144 != (EntityPtr)0x0) { local_124 = local_144; std::multiset::erase(&local_124); } *(Entity_NPC **)local_144 = npc; std::multiset::insert(local_144); (**(code **)(*(int *)local_158 + 0xc))(); if (npc->_entityRef != (EntityPtr)0x0) { local_124 = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_124); } npc->_entityRef = local_158; std::multiset::insert(&npc->_entityRef); } if (*(int *)((int)EVar16 + 0xb64) != 0x10) { *(undefined4 *)((int)EVar16 + 0xb64) = 7; ANM2::Play((ANM2 *)((int)EVar16 + 0x48),(byte *)"Stunned",0); fVar21 = g_vectorZero.y; *(float *)((int)EVar16 + 0x334) = g_vectorZero.x; *(float *)((int)EVar16 + 0x338) = fVar21; } (npc->_sprite)._flipX = (npc->_pos).x <= *(float *)((int)EVar16 + 0x33c) && *(float *)((int)EVar16 + 0x33c) != (npc->_pos).x; } iVar17 = 0; if (npc->_stateFrame < 0) { iVar17 = 0x1e; } npc->_stateFrame = iVar17; } break; case 4: PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); npc->_stateFrame = npc->_stateFrame + iVar14; npc->_friction = npc->_friction * 0.9; if (8 < npc->_stateFrame) { pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_14c.x = (pEVar5->_pos).x; local_14c.y = (pEVar5->_pos).y; local_144 = (EntityPtr)local_14c.y; local_124 = (EntityPtr)local_14c.x; bVar3 = Vector::operator_ne(&local_14c,&g_vectorZero); if (bVar3 != 0) { npc->_state = 9; ANM2::Play(&npc->_sprite,(byte *)"MoveStart2",0); fVar21 = (npc->_pos).x; fVar22 = (npc->_pos).x; (npc->_targetPosition).x = (float)local_124; (npc->_targetPosition).y = (float)local_144; (npc->_sprite)._flipX = fVar22 <= (float)local_124 && (float)local_124 != fVar21; LAB_00574b41: npc->_stateFrame = 0; } } break; case 6: EVar16 = npc->_child; npc->_friction = npc->_friction * 0.9; if (((EVar16 == (EntityPtr)0x0) || (*(byte *)((int)EVar16 + 0x173) != 0)) || (bVar3 = Entity::HasEntityFlags((Entity *)EVar16,0x10), iVar17 = extraout_ECX_02, bVar3 != 0) ) { if (npc->_entityCollisionClass == 0) { EVar16 = (EntityPtr)NpcHelper::clutch_find_farthest_orbital(iVar17); local_154 = EVar16; if (EVar16 == (EntityPtr)0x0) { ANM2::Play(&npc->_sprite,&DAT_00b61c10,0); npc->_state = 7; npc->_stateFrame = 0; (npc->_v1).x = 80.0; } else { if (npc->_parent != (EntityPtr)0x0) { local_124 = (EntityPtr)&npc->_parent; std::multiset::erase(&local_124); } npc->_parent = EVar16; std::multiset::insert(&npc->_parent); manager = g_manager; npc->_state = 0xb; local_128 = 0x13c; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,1.0,2,0,1.5,0.0); FUN_005729a0(1); uVar4 = Random(); local_14c.x = *(float *)((int)local_154 + 0x33c); local_14c.y = *(float *)((int)local_154 + 0x340); EVar16 = (EntityPtr) Game::Spawn(g_game,1000,0xaf,&local_14c,&g_vectorZero,(Entity *)npc,0,uVar4); uVar24 = Color::Color(0x3f4ccccd); (*(code *)((ulonglong)uVar24 >> 0x20))((int)uVar24,0xffffffff,0xff,0,1); if (*(EntityPtr *)((int)EVar16 + 0x3c4) != (EntityPtr)0x0) { local_124 = (EntityPtr)((int)EVar16 + 0x3c4); std::multiset::erase(&local_124); } *(EntityPtr *)((int)EVar16 + 0x3c4) = local_154; std::multiset::insert((EntityPtr *)((int)EVar16 + 0x3c4)); if (*(EntityPtr *)((int)EVar16 + 0x3bc) != (EntityPtr)0x0) { local_124 = (EntityPtr)((int)EVar16 + 0x3bc); std::multiset::erase(&local_124); } *(EntityPtr *)((int)EVar16 + 0x3bc) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar16 + 0x3bc)); (**(code **)(*(int *)EVar16 + 0xc))(); if (npc->_entityRef != (EntityPtr)0x0) { local_124 = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_124); } npc->_entityRef = EVar16; std::multiset::insert(&npc->_entityRef); ANM2::Play(&npc->_sprite,(byte *)"Unpossess",0); } npc->_entityCollisionClass = 2; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); pEVar5 = Entity_NPC::GetPlayerTarget(npc); local_14c.x = (npc->_pos).x - (pEVar5->_pos).x; local_14c.y = (npc->_pos).y - (pEVar5->_pos).y; pVVar9 = Vector::Normalized(&local_14c,&local_190); fVar21 = pVVar9->y; (npc->_velocity).x = pVVar9->x * 20.0 + (npc->_velocity).x; (npc->_velocity).y = fVar21 * 20.0 + (npc->_velocity).y; } else { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_stateFrame = 0xf; npc->_entityCollisionClass = 2; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); } } else { fVar21 = *(float *)((int)EVar16 + 0x340); fVar22 = (npc->_pos).y; (npc->_velocity).x = ((Vector *)((int)EVar16 + 0x33c))->x - (npc->_pos).x; (npc->_velocity).y = fVar21 - fVar22; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); manager = g_manager; if (bVar3 != 0) { local_128 = 0xa2; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,1.0,2,0,1.5,0.0); } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::ChildNPC(npc); manager = g_manager; local_128 = 0x1cd; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,1.0,2,0,1.5,0.0); npc->_entityCollisionClass = 0; npc->_shadowSize = 0.0; childNpc = Entity_NPC::ChildNPC(npc); childNpc->_state = 5; childNpc = Entity_NPC::ChildNPC(npc); ANM2::Play(&childNpc->_sprite,(byte *)"Transition",0); childNpc = Entity_NPC::ChildNPC(npc); parentNpc = Entity_NPC::ParentNPC(npc); if ((childNpc == parentNpc) && (childNpc = Entity_NPC::ChildNPC(npc), (childNpc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(childNpc->_sprite)._animState,29.0); } } } break; case 7: npc->_friction = npc->_friction * 0.8; if (npc->_stateFrame == 0) { npc->_stateFrame = 1; Entity_NPC::QueryNPCsType(&orbitalQuery,0x379,-1); local_14 = 1; local_168 = 0.0; if (orbitalQuery._size != 0) { pvVar7 = orbitalQuery._data; uVar4 = orbitalQuery._size; do { EVar16 = *(EntityPtr *)((int)pvVar7 + (int)local_168 * 4); local_154 = EVar16; if (EVar16 != (EntityPtr)0x0) { if (((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)EVar16 + 0x28) == 1)) || (*(int *)((int)EVar16 + 0x28) - 10U < 0x3de)) && ((*(EntityPtr *)((int)EVar16 + 0x3bc) == (EntityPtr)npc && (*(int *)((int)EVar16 + 0xb64) == 0x10)))) && (*(int *)((int)EVar16 + 0xbc4) == 99) ) { local_124 = (EntityPtr)((int)EVar16 + 0x48); *(undefined4 *)((int)EVar16 + 0xbc4) = 0; pbVar18 = *(byte **)((int)EVar16 + 0x7c); if (pbVar18 == (byte *)0x0) { LAB_00573ef6: bVar3 = ANM2::SetAnimation((ANM2 *)((int)EVar16 + 0x48),(byte *)"Collapse",1); EVar1 = local_124; if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)local_124 + 0x30)); *(undefined1 *)((int)EVar1 + 0x44) = 1; EVar16 = local_154; } } else { if (0xf < *(uint *)(pbVar18 + 0x14)) { pbVar18 = *(byte **)pbVar18; } animName = "Collapse"; do { bVar3 = *pbVar18; bVar19 = bVar3 < (byte)*animName; if (bVar3 != *animName) { LAB_00573ed6: uVar4 = -(uint)bVar19 | 1; goto LAB_00573edb; } if (bVar3 == 0) break; bVar3 = pbVar18[1]; bVar19 = bVar3 < (byte)animName[1]; if (bVar3 != animName[1]) goto LAB_00573ed6; pbVar18 = pbVar18 + 2; animName = animName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00573edb: if ((uVar4 != 0) || ((*(char *)(*(int *)((int)EVar16 + 0x7c) + 0x34) != '\0' && (*(char *)((int)EVar16 + 0x8c) == '\0')))) goto LAB_00573ef6; } if (*(int *)((int)EVar16 + 0x7c) != 0) { AnimationState::AdvancePosition ((AnimationState *)((int)EVar16 + 0x78), *(int *)(*(int *)((int)EVar16 + 0x7c) + 0x30) + -1); } manager = g_manager; local_128 = 0x105; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,0.85,2,0,1.0,0.0); uVar4 = Random(); local_14c.x = *(float *)((int)local_154 + 0x33c); local_14c.y = *(float *)((int)local_154 + 0x340); local_140 = Game::Spawn(g_game,1000,0xf,&local_14c,&g_vectorZero,(Entity *)0x0,0,uVar4 ); fireSprite = &local_140->_sprite; anm2PathSize = 0; anm2PathCapacity = &DAT_0000000f; local_4c._16_4_ = (void *)0x0; local_124 = (EntityPtr)fireSprite; std::string::assign(local_4c + 0x10,(byte *)"gfx/033.010_Movable Fireplace.anm2",0x22) ; local_14._0_1_ = 2; ANM2::Load(fireSprite,(std_string *)(local_4c + 0x10),1); local_14 = CONCAT31(local_14._1_3_,1); if (&DAT_0000000f < anm2PathCapacity) { puVar11 = anm2PathCapacity + 1; pvVar7 = (void *)local_4c._16_4_; if ((undefined1 *)0xfff < puVar11) { pvVar7 = *(void **)(local_4c._16_4_ + -4); puVar11 = anm2PathCapacity + 0x24; if (0x1f < (uint)(local_4c._16_4_ + (-4 - (int)pvVar7))) goto LAB_00574161; } operator_delete(pvVar7,(uint)puVar11); } pEVar5 = local_140; pbVar18 = (byte *)0x0; if ((local_140->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&pEVar5->_sprite,pbVar18); fVar20 = fRam00c34e34; fVar22 = fRam00c34e30; fVar21 = fRam00c34e2c; if (&layer->_color != (ColorMod *)&DAT_00c34e28) { (layer->_color)._tint[0] = _DAT_00c34e28; (layer->_color)._tint[1] = fVar21; (layer->_color)._tint[2] = fVar22; (layer->_color)._tint[3] = fVar20; fVar20 = fRam00c34e44; fVar22 = fRam00c34e40; fVar21 = fRam00c34e3c; (layer->_color)._colorize[0] = _DAT_00c34e38; (layer->_color)._colorize[1] = fVar21; (layer->_color)._colorize[2] = fVar22; (layer->_color)._colorize[3] = fVar20; fVar21 = DAT_00c34e48._4_4_; (layer->_color)._offset[0] = (float)DAT_00c34e48; (layer->_color)._offset[1] = fVar21; (layer->_color)._offset[2] = DAT_00c34e50; } pbVar18 = pbVar18 + 1; } while (pbVar18 < (byte *)(pEVar5->_sprite)._layerCount); npc = (Entity_NPC *)local_160; } ANM2::Play((ANM2 *)local_124,(byte *)"Disappear",0); (**(code **)(*(int *)local_140 + 0xc))(); uVar4 = orbitalQuery._size; } pvVar7 = orbitalQuery._data; } local_168 = (float)((int)local_168 + 1); } while ((uint)local_168 < uVar4); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&orbitalQuery); } fVar21 = *(float *)((int)npc + 0xbb0); if (fVar21 <= 0.0) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"StunEnd",0); Entity::SetParent((Entity *)npc,(Entity *)0x0); Entity::SetChild((Entity *)npc,(Entity *)0x0); bVar3 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x10b,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x139,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1a2,2.0,2,0,1.0); Game::ShakeScreen(g_game,0x10); Game::MakeShockwave(g_game,(Vector *)((int)npc + 0x33c),0.035,0.025,10); } bVar3 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),(byte *)"Shoot"); if ((bVar3 != 0) && (iVar17 = Entity::GetIntervalTicks((Entity *)npc,8.0,0.0), iVar17 != 0)) { EVar16 = (EntityPtr)0x0; candidateOrbitals = (EntityPtr)0x0; local_14c.x = 0.0; local_14c.y = 0.0; local_14 = 3; Entity_NPC::QueryNPCsType(&orbitalQuery,0x379,-1); local_14 = CONCAT31(local_14._1_3_,4); local_128 = 0; if (orbitalQuery._size != 0) { pvVar7 = orbitalQuery._data; uVar4 = orbitalQuery._size; do { EVar1 = *(EntityPtr *)((int)pvVar7 + local_128 * 4); if (EVar1 != (EntityPtr)0x0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(EntityPtr *)((int)EVar1 + 0x28) == (EntityPtr)0x1)) || ((int)*(EntityPtr *)((int)EVar1 + 0x28) - 10U < 0x3de)) && (local_124 = EVar1, *(EntityPtr *)((int)EVar1 + 0xb64) == (EntityPtr)0x10)) { if (((((uint)*(EntityPtr *)((int)EVar1 + 0x168) & 0x20000000) != 0) == ((*(uint *)((int)npc + 0x168) & 0x20000000) != 0)) && (*(EntityPtr *)((int)EVar1 + 0x3bc) == (EntityPtr)npc)) { if (EVar16 == (EntityPtr)local_14c.y) { std::vector::_Emplace_reallocate(EVar16,&local_124); EVar16 = (EntityPtr)local_14c.x; } else { *(EntityPtr *)EVar16 = EVar1; local_14c.x = (float)((int)EVar16 + 4); EVar16 = (EntityPtr)local_14c.x; } } uVar4 = orbitalQuery._size; } pvVar7 = orbitalQuery._data; } local_128 = local_128 + 1; } while (local_128 < uVar4); if (candidateOrbitals != EVar16) { iVar17 = Isaac::Random((int)EVar16 - (int)candidateOrbitals >> 2); FUN_00572c10(*(EntityPtr *)((int)candidateOrbitals + iVar17 * 4)); } } EntityList_Query::~EntityList_Query(&orbitalQuery); local_14 = 0xffffffff; FID_conflict__Tidy(&candidateOrbitals); } if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { Entity_NPC::QueryNPCsType(&orbitalQuery,0x379,-1); uVar4 = 0; local_14 = 5; if (orbitalQuery._size != 0) { pvVar7 = orbitalQuery._data; do { iVar17 = *(int *)((int)pvVar7 + uVar4 * 4); if (iVar17 != 0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar17 + 0x28) == 1)) || (*(int *)(iVar17 + 0x28) - 10U < 0x3de)) && (((*(int *)(iVar17 + 0xb64) == 0x10 && (((*(uint *)(iVar17 + 0x168) & 0x20000000) != 0) == ((*(uint *)((int)npc + 0x168) & 0x20000000) != 0))) && (*(EntityPtr *)(iVar17 + 0x3bc) == (EntityPtr)npc)))) { FUN_00572c10(iVar17); } pvVar7 = orbitalQuery._data; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)orbitalQuery._size); } ANM2::Play((ANM2 *)((int)npc + 0x48),s_Idle,0); *(undefined4 *)((int)npc + 0xb64) = 3; *(undefined4 *)((int)npc + 0x410) = 0; local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&orbitalQuery); } } else { if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"StunLoop",0); fVar21 = *(float *)((int)npc + 0xbb0); } pEVar15 = (EntityPtr *)((int)npc + 0x14); local_124 = (EntityPtr)(*(float *)((int)npc + 0x39c) * 0.1); pEVar6 = &local_124; if ((float)local_124 < (float)*pEVar15 || (float)local_124 == (float)*pEVar15) { pEVar6 = pEVar15; } *(float *)((int)npc + 0xbb0) = fVar21 - (float)*pEVar6; } break; case 8: npc->_friction = npc->_friction * 0.9; if (npc->_child == (EntityPtr)0x0) { ANM2::Play(&npc->_sprite,s_Idle,0); npc->_state = 3; npc->_stateFrame = 0xf; break; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"MoveLoop",0); } npc->_stateFrame = npc->_stateFrame + iVar14; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; if (bVar3 != 0) { local_128 = 0x2bd; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,1.0,2,0,1.0,0.0); FUN_005729a0(0); } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar3 == 0) && ((pvVar7 = (npc->_sprite)._animState._animData, pvVar7 == (void *)0x0 || (*(char *)((int)pvVar7 + 0x34) == '\0')))) break; local_144 = (EntityPtr)0x41f00000; local_124 = (EntityPtr)((float)npc->_stateFrame * 0.8); pEVar15 = &local_124; if (30.0 <= (float)local_124) { pEVar15 = &local_144; } local_17c = (void *)(*(float *)((int)npc->_child + 0x33c) - (npc->_pos).x); local_178 = *(float *)((int)npc->_child + 0x340) - (npc->_pos).y; (npc->_velocity).x = (float)local_17c; (npc->_velocity).y = local_178; fVar21 = sqrtf((float)local_17c * (float)local_17c + local_178 * local_178); if (20.0 <= fVar21) { if (((float)*pEVar15 < fVar21) && (0.0 < fVar21)) { fVar21 = (float)*pEVar15 / fVar21; (npc->_velocity).y = fVar21 * local_178; (npc->_velocity).x = fVar21 * (float)local_17c; } break; } ANM2::Play(&npc->_sprite,(byte *)"Possess",0); npc->_state = 6; npc->_stateFrame = 0; goto LAB_00574b58; case 9: bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { ANM2::Play(&npc->_sprite,(byte *)"MoveLoop2",0); } npc->_stateFrame = npc->_stateFrame + iVar14; bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar3 != 0) || (bVar3 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), bVar3 != 0)) { local_144 = (EntityPtr)0x41f00000; fVar20 = ((npc->_targetPosition).x - (npc->_pos).x) * 0.5; local_124 = (EntityPtr)((float)npc->_stateFrame * 1.2); fVar21 = (npc->_targetPosition).y; fVar22 = (npc->_pos).y; (npc->_velocity).x = fVar20; pEVar15 = &local_124; if (30.0 <= (float)local_124) { pEVar15 = &local_144; } fVar21 = (fVar21 - fVar22) * 0.5; (npc->_velocity).y = fVar21; fVar21 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21); if (fVar21 < 20.0) { ANM2::Play(&npc->_sprite,(byte *)"AttackStart",0); npc->_state = 10; goto LAB_00574b41; } if ((float)*pEVar15 < fVar21) { Vector::Resize(&npc->_velocity,(float)*pEVar15); } } break; case 10: npc->_friction = npc->_friction * 0.9; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,700,0.8,2,0,1.5); ProjectileParams::ProjectileParams(&projParams); projParams.CircleAngle = 0.0; if ((npc->_stateFrame & 1) == 0) { projParams.CircleAngle = 0.5235988; } projParams.Variant = 2; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34e28); local_14c.x = 9.0; local_14c.y = 6.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_14c,9,&projParams); npc->_stateFrame = npc->_stateFrame + 1; } bVar3 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar3 != 0) { if (5 < npc->_stateFrame) { ANM2::Play(&npc->_sprite,s_Idle2,0); npc->_state = 4; goto LAB_00574b41; } ANM2::Play(&npc->_sprite,(byte *)"Attack",1); } break; case 0xb: npc->_friction = npc->_friction * 0.8; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = -1000; } break; case 0x10: npc->_friction = npc->_friction * 0.8; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x10b,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x139,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1a2,1.5,2,0,1.0); Game::ShakeScreen(g_game,0x10); Game::MakeShockwave(g_game,&npc->_pos,0.035,0.025,10); } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar3 != 0) && (iVar17 = Entity::GetIntervalTicks((Entity *)npc,8.0,0.0), iVar17 != 0)) { EVar16 = (EntityPtr)0x0; candidateOrbitals = (EntityPtr)0x0; local_14c.x = 0.0; local_14c.y = 0.0; local_14 = 6; Entity_NPC::QueryNPCsType(&orbitalQuery,0x379,-1); local_14 = CONCAT31(local_14._1_3_,7); local_128 = 0; if (orbitalQuery._size != 0) { pvVar7 = orbitalQuery._data; uVar4 = orbitalQuery._size; do { EVar1 = *(EntityPtr *)((int)pvVar7 + local_128 * 4); if (EVar1 != (EntityPtr)0x0) { if (((1 < *(int *)&g_game->_deathmatchManager) && (*(EntityPtr *)((int)EVar1 + 0x28) == (EntityPtr)0x1)) || ((int)*(EntityPtr *)((int)EVar1 + 0x28) - 10U < 0x3de)) { local_124 = EVar1; if (((((uint)*(EntityPtr *)((int)EVar1 + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0)) && (*(EntityPtr *)((int)EVar1 + 0x3bc) == (EntityPtr)npc)) { if (EVar16 == (EntityPtr)local_14c.y) { std::vector::_Emplace_reallocate(EVar16,&local_124); EVar16 = (EntityPtr)local_14c.x; } else { *(EntityPtr *)EVar16 = EVar1; local_14c.x = (float)((int)EVar16 + 4); EVar16 = (EntityPtr)local_14c.x; } } uVar4 = orbitalQuery._size; } pvVar7 = orbitalQuery._data; } local_128 = local_128 + 1; } while (local_128 < uVar4); if (candidateOrbitals != EVar16) { iVar17 = Isaac::Random((int)EVar16 - (int)candidateOrbitals >> 2); NpcHelper::clutch_spawn_fire(*(EntityPtr *)((int)candidateOrbitals + iVar17 * 4)); } } EntityList_Query::~EntityList_Query(&orbitalQuery); local_14 = 0xffffffff; FID_conflict__Tidy(&candidateOrbitals); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { Entity_NPC::QueryNPCsType(&orbitalQuery,0x379,-1); uVar4 = 0; local_14 = 8; if (orbitalQuery._size != 0) { pvVar7 = orbitalQuery._data; do { iVar17 = *(int *)((int)pvVar7 + uVar4 * 4); if (iVar17 != 0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar17 + 0x28) == 1)) || (*(int *)(iVar17 + 0x28) - 10U < 0x3de)) && (((*(int *)(iVar17 + 0xb64) == 0x10 && (((*(uint *)(iVar17 + 0x168) & 0x20000000) != 0) == ((npc->_flags & 0x20000000) != 0))) && (*(Entity_NPC **)(iVar17 + 0x3bc) == npc))) ) { NpcHelper::clutch_spawn_fire(iVar17); } pvVar7 = orbitalQuery._data; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)orbitalQuery._size); } ANM2::Play(&npc->_sprite,s_Idle2,0); npc->_state = 4; npc->_stateFrame = 0; local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&orbitalQuery); } else { npc->_pendingDamage = 0.0; damageEventsEnd = (npc->_damageEvents)._end; for (pfVar10 = (npc->_damageEvents)._begin; pfVar10 != damageEventsEnd; pfVar10 = pfVar10 + 0xe) { fVar21 = *pfVar10; *pfVar10 = fVar21 * 0.1; npc->_pendingDamage = fVar21 * 0.1 + npc->_pendingDamage; } } } if (local_174 != 0) { LAB_00574b58: iVar17 = 1; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&orbitalQuery,0x379,-1,-1,0,0); uVar4 = 0; iVar14 = iVar17; if (orbitalQuery._size != 0) { do { orbital = *(Entity_NPC **)((int)orbitalQuery._data + uVar4 * 4); iVar17 = iVar14; if ((orbital != (Entity_NPC *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (orbital->_type == 1)) || (orbital->_type - 10U < 0x3de)) && ((orbital->_parent == (EntityPtr)npc && (orbital->_state != 0x10)))))) { if (orbital == *(Entity_NPC **)((int)npc + 0x3c0)) { orbital->_i2 = 0; } else { iVar17 = iVar14 + 1; orbital->_i2 = iVar14; } } uVar4 = uVar4 + 1; iVar14 = iVar17; } while (uVar4 < (uint)orbitalQuery._size); } *(int *)((int)npc + 0xbc0) = iVar17; if (orbitalQuery._0_1_ == '\0') { local_14 = 9; tracked_alloc(1,orbitalQuery._data,0); local_14 = 0xffffffff; } } if (*(char *)((int)npc + 0x173) != '\0') { local_154 = (EntityPtr)0x0; local_17c = g_game->_room; if (*(int *)((int)local_17c + 0x1264) != 0) { do { piVar12 = *(int **)(*(int *)((int)local_17c + 0x125c) + (int)local_154 * 4); if ((piVar12 == (int *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (iVar17 = 1, piVar12[10] != 1)) && (iVar17 = piVar12[10], 0x3dd < iVar17 - 10U)))) { iVar17 = piVar12[10]; LAB_00574f1b: if ((iVar17 == 9) && (*(EntityPtr *)(piVar12 + 0xef) == (EntityPtr)npc)) { piVar12[0x10e] = 0; piVar12[0x10f] = 0; *(undefined1 *)((int)piVar12 + 0x173) = 1; } } else { local_129 = (piVar12[0x5a] & 0x20000000U) != 0; local_15c = piVar12; bVar3 = Entity::IsFriendly((Entity *)npc); piVar12 = extraout_EDX; if (local_129 != bVar3) goto LAB_00574f1b; if (iVar17 == 0x379) { if (*(EntityPtr *)(extraout_EDX + 0xef) != (EntityPtr)npc) { LAB_00574d28: bVar19 = false; goto LAB_00574d2a; } extraout_EDX[0x5a] = extraout_EDX[0x5a] | 0x10; extraout_EDX[0x5b] = extraout_EDX[0x5b]; pcVar2 = *(code **)(*extraout_EDX + 0x24); EntityRef::constructor((EntityRef *)(local_78 + 4),(Entity *)npc); (*pcVar2)(local_78 + 4); } else { if ((iVar17 != 0x21) || (extraout_EDX[0xb] != 0xd)) goto LAB_00574d28; bVar19 = true; LAB_00574d2a: if (bVar19) { pcVar2 = *(code **)(*extraout_EDX + 0x24); EntityRef::constructor((EntityRef *)local_4c,(Entity *)npc); (*pcVar2)(local_4c); manager = g_manager; local_128 = 0x105; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,0.85,2,0,1.0,0.0); uVar4 = Random(); local_14c.x = *(float *)(local_15c + 0xcf); local_14c.y = *(float *)(local_15c + 0xd0); local_140 = Game::Spawn(g_game,1000,0xf,&local_14c,&g_vectorZero,(Entity *)0x0,0,uVar4 ); fireSprite = &local_140->_sprite; anm2PathSize = 0; anm2PathCapacity = &DAT_0000000f; local_4c._16_4_ = (void *)0x0; local_124 = (EntityPtr)fireSprite; std::string::assign(local_4c + 0x10,(byte *)"gfx/033.010_Movable Fireplace.anm2",0x22) ; local_14 = 10; ANM2::Load(fireSprite,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; if (&DAT_0000000f < anm2PathCapacity) { puVar11 = anm2PathCapacity + 1; pvVar7 = (void *)local_4c._16_4_; if ((undefined1 *)0xfff < puVar11) { pvVar7 = *(void **)(local_4c._16_4_ + -4); puVar11 = anm2PathCapacity + 0x24; if (0x1f < (uint)(local_4c._16_4_ + (-4 - (int)pvVar7))) { LAB_00574161: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,(uint)puVar11); } pEVar5 = local_140; pbVar18 = (byte *)0x0; if ((local_140->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&pEVar5->_sprite,pbVar18); fVar20 = fRam00c34e34; fVar22 = fRam00c34e30; fVar21 = fRam00c34e2c; if (&layer->_color != (ColorMod *)&DAT_00c34e28) { (layer->_color)._tint[0] = _DAT_00c34e28; (layer->_color)._tint[1] = fVar21; (layer->_color)._tint[2] = fVar22; (layer->_color)._tint[3] = fVar20; fVar20 = fRam00c34e44; fVar22 = fRam00c34e40; fVar21 = fRam00c34e3c; (layer->_color)._colorize[0] = _DAT_00c34e38; (layer->_color)._colorize[1] = fVar21; (layer->_color)._colorize[2] = fVar22; (layer->_color)._colorize[3] = fVar20; fVar21 = DAT_00c34e48._4_4_; (layer->_color)._offset[0] = (float)DAT_00c34e48; (layer->_color)._offset[1] = fVar21; (layer->_color)._offset[2] = DAT_00c34e50; } pbVar18 = pbVar18 + 1; } while (pbVar18 < (byte *)(pEVar5->_sprite)._layerCount); npc = (Entity_NPC *)local_160; } ANM2::Play((ANM2 *)local_124,(byte *)"Disappear",0); (**(code **)(*(int *)local_140 + 0xc))(); } else if (((iVar17 == 0x399) && (extraout_EDX[0xb] == 1)) && (*(EntityPtr *)(extraout_EDX + 0xef) == (EntityPtr)npc)) { pcVar2 = *(code **)(*extraout_EDX + 0x24); EntityRef::constructor(&damageSource,(Entity *)npc); (*pcVar2)(&damageSource); } } } local_154 = (EntityPtr)((int)local_154 + 1); } while ((uint)local_154 < (uint)*(EntityPtr *)((int)local_17c + 0x1264)); } } ExceptionList = local_1c; return; } //@@ 00575a10 NpcHelper::clutch_render /* DB: Entity_NPC::Render switch case 0x399 (ENTITY_CLUTCH 921); walks a deque of points at +0xc04 setting ANM2 layer 1/2 rotation (atan2f) and RenderFrame for each chain segment prototype: db/protos.zhl, confirmed by RET 4 */ void NpcHelper::clutch_render(Entity_NPC *npc,Vector *offset) { LayerState *pLVar1; float *pfVar2; int iVar3; int iVar4; int iVar5; void *layerFrames; int pointSlotOffset; int iVar6; void *animData; int pointIndex; uint pointBlock; uint nextPointBlock; float *nextPoint; float flipSign; float deltaX; float fVar7; double dVar8; double dVar9; int layerOffset; uint nextPointIndex; byte *layerId; float segmentStretch; Vector segmentPos [8]; ANM2 *animation; int *pointDeque; if (npc->_variant == 0) { pLVar1 = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); if ((0.0 < (pLVar1->_color)._tint[3]) && ((npc->_vectorDeque1)._size != 0)) { pLVar1 = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); pLVar1->_visible = 1; pLVar1 = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); layerId = (byte *)0x1; layerOffset = 0x3c; pLVar1->_visible = 1; pointBlock = (npc->_vectorDeque1)._offset; do { pointDeque = (npc->_vectorDeque1)._proxy; nextPointIndex = pointBlock + 3; pointIndex = pointBlock; while( true ) { pointBlock = (npc->_vectorDeque1)._offset; if (((npc->_vectorDeque1)._size - 3) + pointBlock <= (uint)pointIndex) break; if (pointDeque == (int *)0x0) { iVar3 = 0; } else { iVar3 = *pointDeque; } pointBlock = (uint)pointIndex >> 1; pointSlotOffset = (pointIndex & 1U) * 8; pfVar2 = (float *)(*(int *)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & pointBlock) * 4) + pointSlotOffset) ; if (pointDeque == (int *)0x0) { iVar3 = 0; } else { iVar3 = *pointDeque; } nextPointBlock = nextPointIndex >> 1; fVar7 = g_displayPixelRatio * g_screenPointScale; iVar6 = (nextPointIndex & 1) * 8; nextPoint = (float *)(*(int *)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & nextPointBlock) * 4) + iVar6); dVar8 = floor((double)((((*pfVar2 + *nextPoint) * 0.5 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar7 + 0.5)); dVar9 = floor((double)((((pfVar2[1] + nextPoint[1]) * 0.5 - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar7 + 0.5)); segmentPos[0].x = (float)dVar8 / fVar7 + offset->x; segmentPos[0].y = (float)dVar9 / fVar7 + offset->y; if (pointDeque == (int *)0x0) { iVar3 = 0; } else { iVar3 = *pointDeque; } if (pointDeque == (int *)0x0) { iVar5 = 0; } else { iVar5 = *pointDeque; } iVar3 = (int)(8.0 - (*(float *)(*(int *)(*(int *)(iVar5 + 4) + (nextPointIndex + 2 >> 1 & *(int *)(iVar5 + 8) - 1U) * 4) + (nextPointIndex + 2 & 1) * 8) + *(float *)(*(int *)(*(int *)(iVar3 + 4) + (nextPointIndex - 1 >> 1 & *(int *)(iVar3 + 8) - 1U ) * 4) + (nextPointIndex + 1 & 1) * 8)) * 0.5 * 8.0 ); if (iVar3 == 7) { segmentStretch = 1.0; LAB_00575d73: pLVar1 = ANM2::GetLayer(&npc->_sprite,layerId); (pLVar1->_size).x = segmentStretch; (pLVar1->_size).y = 1.0; if ((npc->_sprite)._flipX == 0) { flipSign = 1.0; } else { flipSign = (float)&DAT_bf800000; } if (pointDeque == (int *)0x0) { iVar5 = 0; } else { iVar5 = *pointDeque; } pfVar2 = (float *)(*(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & nextPointBlock) * 4) + iVar6); if (pointDeque == (int *)0x0) { iVar6 = 0; } else { iVar6 = *pointDeque; } iVar6 = *(int *)(*(int *)(iVar6 + 4) + (*(int *)(iVar6 + 8) - 1U & pointBlock) * 4); fVar7 = atan2f(pfVar2[1] - *(float *)(iVar6 + 4 + pointSlotOffset), *pfVar2 - *(float *)(iVar6 + pointSlotOffset)); pLVar1 = ANM2::GetLayer(&npc->_sprite,layerId); pLVar1->_rotation = fVar7 * 57.295776 * flipSign; if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar3); } if ((npc->_sprite)._loaded != 0) { if ((npc->_sprite)._overlayRenderFirst == 0) { animData = (npc->_sprite)._animState._animData; if (((animData != (void *)0x0) && (animation = (npc->_sprite)._animState._animation, (int)layerId < animation->_layerCount)) && (iVar3 = *(int *)(layerOffset + (int)animData), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)animData + 0x18)), segmentPos, *(int *)((int)(npc->_sprite)._animState._layerFrames + iVar3 * 4), &g_vectorZero,&g_vectorZero,animation); } animData = (npc->_sprite)._overlayAnimState._animData; if (((animData != (void *)0x0) && (animation = (npc->_sprite)._overlayAnimState._animation, (int)layerId < animation->_layerCount)) && (iVar3 = *(int *)(layerOffset + (int)animData), -1 < iVar3)) { layerFrames = (npc->_sprite)._overlayAnimState._layerFrames; goto LAB_00575ed0; } } else { animData = (npc->_sprite)._overlayAnimState._animData; if (((animData != (void *)0x0) && (animation = (npc->_sprite)._overlayAnimState._animation, (int)layerId < animation->_layerCount)) && (iVar3 = *(int *)(layerOffset + (int)animData), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)animData + 0x18)), segmentPos, *(int *)((int)(npc->_sprite)._overlayAnimState._layerFrames + iVar3 * 4 ),&g_vectorZero,&g_vectorZero,animation); } animData = (npc->_sprite)._animState._animData; if (((animData != (void *)0x0) && (animation = (npc->_sprite)._animState._animation, (int)layerId < animation->_layerCount)) && (iVar3 = *(int *)(layerOffset + (int)animData), -1 < iVar3)) { layerFrames = (npc->_sprite)._animState._layerFrames; LAB_00575ed0: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)animData + 0x18)), segmentPos,*(int *)((int)layerFrames + iVar3 * 4),&g_vectorZero, &g_vectorZero,animation); } } } pointIndex = pointIndex + 3; nextPointIndex = nextPointIndex + 3; } else { if (pointDeque == (int *)0x0) { iVar5 = 0; } else { iVar5 = *pointDeque; } iVar5 = *(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & pointBlock) * 4); if (pointDeque == (int *)0x0) { iVar4 = 0; } else { iVar4 = *pointDeque; } pfVar2 = (float *)(*(int *)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & nextPointBlock) * 4) + iVar6); fVar7 = pfVar2[1] - *(float *)(iVar5 + 4 + pointSlotOffset); deltaX = *pfVar2 - *(float *)(iVar5 + pointSlotOffset); fVar7 = sqrtf(fVar7 * fVar7 + deltaX * deltaX); segmentStretch = (fVar7 * 0.5) / (float)(8 - iVar3); if (segmentStretch <= 1.0) { segmentStretch = 1.0; } if (3.0 <= segmentStretch) { segmentStretch = 3.0; } if (iVar3 < 8) goto LAB_00575d73; pointIndex = pointIndex + 3; nextPointIndex = nextPointIndex + 3; } } layerId = layerId + 1; layerOffset = layerOffset + 4; } while (layerOffset < 0x41); pLVar1 = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); pLVar1->_visible = 0; pLVar1 = ANM2::GetLayer(&npc->_sprite,(byte *)0x2); pLVar1->_visible = 0; } } Entity::Render((Entity *)npc,offset); return; } //@@ 00575fe0 FUN_00575fe0 undefined4 * FUN_00575fe0(int *param_1,undefined4 param_2,uint param_3,undefined4 param_4,undefined4 param_5, uint param_6,int *param_7,undefined4 param_8,uint param_9) { int iVar1; int iVar2; undefined4 *in_ECX; uint uVar3; int iVar4; uint uVar5; int local_8; if (param_1 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *param_1; } if (param_7 == (int *)0x0) { local_8 = 0; } else { local_8 = *param_7; } if (param_3 != param_6) { do { uVar3 = param_3 >> 1; uVar5 = param_3 & 1; param_3 = param_3 + 1; iVar1 = *(int *)(*(int *)(iVar4 + 4) + (uVar3 & *(int *)(iVar4 + 8) - 1U) * 4); iVar2 = *(int *)(*(int *)(local_8 + 4) + (param_9 >> 1 & *(int *)(local_8 + 8) - 1U) * 4); *(undefined4 *)(iVar2 + (param_9 & 1) * 8) = *(undefined4 *)(iVar1 + uVar5 * 8); *(undefined4 *)(iVar2 + 4 + (param_9 & 1) * 8) = *(undefined4 *)(iVar1 + 4 + uVar5 * 8); param_9 = param_9 + 1; } while (param_3 != param_6); } *in_ECX = param_7; in_ECX[1] = 0; in_ECX[2] = param_9; return in_ECX; } //@@ 00576090 NpcHelper::raglich_pick_target_pos /* DB: ? NpcAI::ENTITY_RAGLICH only caller (twice, before GetPlayerTarget): GetAxisAlignedUnitVectorFromDir, Room::GetGridIndex, GetClampedPositionImpl, IsPositionInRoom */ void NpcHelper::raglich_pick_target_pos(void) { Room *this; Vector *pVVar1; Game *pGVar2; byte bVar3; int in_ECX; int iVar4; uint uVar5; int iVar6; int iVar7; float in_XMM1_Da; Vector local_34; Vector local_2c; Vector local_24; Vector local_1c; Vector local_14; Vector local_c; uVar5 = *(char *)(in_ECX + 0xbc2) + 4 + (int)*(short *)(in_ECX + 0xbc0) & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } local_c.y = in_XMM1_Da; Isaac::GetAxisAlignedUnitVectorFromDir(&local_24,uVar5); Isaac::GetAxisAlignedUnitVectorFromDir(&local_1c,(int)*(short *)(in_ECX + 0xbc0)); pGVar2 = g_game; local_14.y = (*(float *)(in_ECX + 0x340) - *(float *)(in_ECX + 0x338)) * local_1c.y + (*(float *)(in_ECX + 0x33c) - *(float *)(in_ECX + 0x334)) * local_1c.x; local_14.x = local_1c.x * local_14.y; local_14.y = local_1c.y * local_14.y; *(float *)(in_ECX + 0x360) = ((local_24.x * local_c.y + 0.0) - local_14.x * 0.1) * *(float *)(in_ECX + 0xbb4) * *(float *)(in_ECX + 0x39c) + *(float *)(in_ECX + 0x360); *(float *)(in_ECX + 0x364) = ((local_24.y * local_c.y + 0.0) - local_14.y * 0.1) * *(float *)(in_ECX + 0xbb4) * *(float *)(in_ECX + 0x39c) + *(float *)(in_ECX + 0x364); this = pGVar2->_room; local_14.x = *(float *)(in_ECX + 0x33c) - local_14.x; local_14.y = *(float *)(in_ECX + 0x340) - local_14.y; Room::GetClampedPositionImpl(this,&local_2c,&local_14,10.0,10.0,10.0,10.0); local_14.y = local_24.x * 40.0; local_24.y = local_24.y * 40.0; local_c.x = local_2c.x + local_14.y; local_c.y = local_2c.y + local_24.y; bVar3 = Room::IsPositionInRoom(this,&local_c,0.0); if (bVar3 == 0) { uVar5 = ((int)*(short *)(in_ECX + 0xbc0) - (int)*(char *)(in_ECX + 0xbc2)) + 4U & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } *(short *)(in_ECX + 0xbc0) = (short)uVar5; iVar7 = (int)((local_2c.x - 40.0) / 40.0 + 0.5); iVar6 = (int)((local_2c.y - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (iVar4 = this->_gridWidth, iVar4 <= iVar7)) || (iVar6 < 0)) || (this->_gridHeight <= iVar6)) { iVar4 = this->_gridWidth; iVar7 = -1; } else { iVar7 = iVar4 * iVar6 + iVar7; } iVar6 = iVar7 / iVar4; iVar7 = iVar7 % iVar4; } else { if (3 < *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48) - 9U) goto LAB_00576404; local_34.x = local_2c.x - local_1c.x * 40.0; local_34.y = local_2c.y - local_1c.y * 40.0; local_1c.y = local_34.y; local_c.y = local_34.x; bVar3 = Room::IsPositionInRoom(this,&local_34,0.0); if (bVar3 == 0) goto LAB_00576404; local_34.x = local_c.y - local_14.y; local_34.y = local_1c.y - local_24.y; bVar3 = Room::IsPositionInRoom(this,&local_34,0.0); if (bVar3 != 0) goto LAB_00576404; uVar5 = *(short *)(in_ECX + 0xbc0) + 4 + (int)*(char *)(in_ECX + 0xbc2) & 0x80000003; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffc) + 1; } *(short *)(in_ECX + 0xbc0) = (short)uVar5; iVar7 = Room::GetGridIndex(this,&local_2c); iVar6 = iVar7 / this->_gridWidth; iVar7 = iVar7 % this->_gridWidth; } *(float *)(in_ECX + 0x338) = (float)iVar6 * 40.0 + 120.0; *(float *)(in_ECX + 0x334) = (float)iVar7 * 40.0 + 40.0; LAB_00576404: local_1c.y = 1.0; local_24.y = *(float *)(in_ECX + 0x39c) * 0.1 + *(float *)(in_ECX + 0xbb4); pVVar1 = &local_24; if (1.0 <= local_24.y) { pVVar1 = &local_1c; } *(float *)(in_ECX + 0xbb4) = pVVar1->y; return; } //@@ 00576450 NpcHelper::raglich_slam_spawn_grid /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from NpcAI::ENTITY_RAGLICH: when arm state ==1 sets friction 0.5, velocity to target, ShakeScreen(14), Game::BombDamage, SpawnParticles, new GridEntity + GridEntity::Init at landing index ("SpawnGridEntity: Grid index invalid") prototype: db/protos.zhl */ void __fastcall NpcHelper::raglich_slam_spawn_grid(Entity_NPC *npc) { byte bVar1; uint uVar2; int gridX; GridEntity *pit; byte *animNameChar; int gridY; byte *wantedAnimChar; int gridIndex; bool isLess; Vector particlePos; Vector rightDamagePos; Vector local_68; int gridYCopy; uint gridSeed; Vector local_58; int column; void *room; Vector slamOffset; ColorMod particleColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; byte *animData; qword flags; int *gridAtIndex; undefined4 *oldGrid; float posY; float targetY; local_8 = -NAN; puStack_c = &LAB_00af5157; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(&particleColor)[1]._colorize; local_14 = uVar2; if (npc->_state != 0) { if (npc->_state != 3) { return; } ExceptionList = &local_10; npc->_friction = 0.5; targetY = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = targetY - posY; Entity::GetNullOffset((Entity *)npc,&slamOffset,&DAT_00b1d3b0); if ((slamOffset.x != g_vectorZero.x) || (slamOffset.y != g_vectorZero.y)) { if (npc->_i1 == 0) { npc->_i1 = 1; Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0); Game::ShakeScreen(g_game,0xe); } local_68.x = slamOffset.x + (npc->_pos).x; local_68.y = slamOffset.y + (npc->_pos).y; Game::BombDamage(g_game,&local_68,10.0,20.0,0,(Entity *)npc,(BitSet128)ZEXT816(0),0x1000000,0) ; local_58.x = slamOffset.x + ((npc->_pos).x - 40.0); local_58.y = slamOffset.y + (npc->_pos).y + 0.0; Game::BombDamage(g_game,&local_58,10.0,20.0,0,(Entity *)npc,(BitSet128)ZEXT816(0),0x1000000,0) ; rightDamagePos.x = slamOffset.x + (npc->_pos).x + 40.0; rightDamagePos.y = slamOffset.y + (npc->_pos).y + 0.0; Game::BombDamage(g_game,&rightDamagePos,10.0,20.0,0,(Entity *)npc,(BitSet128)ZEXT816(0), 0x1000000,0); gridX = (int)(((slamOffset.x + (npc->_pos).x) - 40.0) / 40.0 + 0.5); gridY = (int)(((slamOffset.y + (npc->_pos).y) - 120.0) / 40.0 + 0.5); column = gridX + -1; local_58.y = (float)(gridX + 1); gridYCopy = gridY; if (column <= (int)local_58.y) { do { gridX = column; room = g_game->_room; if ((((-1 < column) && (column < *(int *)((int)room + 0xc))) && (-1 < gridY)) && ((gridY < *(int *)((int)room + 0x10) && (gridIndex = *(int *)((int)room + 0xc) * gridY + column, -1 < gridIndex)))) { gridSeed = Random(); if (gridIndex < 0x1c0) { if (*(int *)((int)room + gridIndex * 4 + 0x76c) < 0x385) { pit = operator_new(0x158); local_8 = 8.40779e-45; local_68.y = (float)pit; if (pit == (GridEntity *)0x0) { pit = (GridEntity *)0x0; } else { GridEntity::GridEntity(pit); *(undefined ***)pit = IsaacRepentancePlus::GridEntity_Pit::vftable; } local_8 = -NAN; if (pit != (GridEntity *)0x0) { (pit->_desc)._type = 7; pit->_gridIndex = gridIndex; oldGrid = *(undefined4 **)((int)room + gridIndex * 4 + 0x24); if (oldGrid != (undefined4 *)0x0) { (**(code **)*oldGrid)(1); } *(GridEntity **)((int)room + gridIndex * 4 + 0x24) = pit; (pit->_desc)._variant = 0; (pit->_desc)._varData = 0; GridEntity::Init(pit,gridSeed); } gridX = column; } gridAtIndex = *(int **)((int)g_game->_room + gridIndex * 4 + 0x24); if ((gridAtIndex != (int *)0x0) && (gridAtIndex[1] == 7)) { (**(code **)(*gridAtIndex + 4))(); } } else { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } particleColor._tint[0] = 1.0; particleColor._tint[1] = 1.0; particleColor._tint[2] = 1.0; particleColor._tint[3] = 1.0; particleColor._offset[0] = 0.0; particleColor._offset[1] = 0.0; particleColor._colorize[0] = 0.0; particleColor._colorize[1] = 0.0; particleColor._colorize[2] = 0.0; particleColor._colorize[3] = 0.0; particlePos.x = slamOffset.x + (npc->_pos).x; particlePos.y = slamOffset.y + (npc->_pos).y; particleColor._offset[2] = 0.0; Game::SpawnParticles(g_game,&particlePos,4,4,6.0,&particleColor,100000.0,0); gridY = gridYCopy; } column = gridX + 1; } while (column <= (int)local_58.y); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(uVar2); ExceptionList = local_10; return; } ExceptionList = local_10; return; } animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } wantedAnimChar = &DAT_00b61c98; do { bVar1 = *animNameChar; isLess = bVar1 < *wantedAnimChar; if (bVar1 != *wantedAnimChar) { LAB_00576910: uVar2 = -(uint)isLess | 1; goto LAB_00576915; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < wantedAnimChar[1]; if (bVar1 != wantedAnimChar[1]) goto LAB_00576910; animNameChar = animNameChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00576915: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_00576948; } ExceptionList = &local_10; bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b61c98,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_00576948: flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0xc4000011; npc->_state = 3; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; ExceptionList = local_10; return; } //@@ 005769b0 NpcAI::ENTITY_RAGLICH /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 919 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_RAGLICH(Entity_NPC *npc) { char cVar1; EntityPtr this; float *pfVar2; byte bVar3; uint uVar4; Entity *pEVar5; byte *animName; uint cmpResult; int iVar6; Entity_Laser *brimstoneLaser; int iVar7; EntityPtr **speedSource; void *queryData; Vector *resultPos; undefined1 *puVar8; undefined **moveAnimTable; EntityPtr *expectedName; int unused; float *extraout_EDX; float *damageEvent; Room *room; bool isLess; float fVar9; float frictionFactor; undefined1 auVar10 [12]; float fVar11; undefined1 auVar12 [12]; char npcQuery [4]; void *queryEntities; undefined1 *queryCount; Room *local_f4; EntityPtr *local_f0; Vector scratchVec; float local_e4; float local_e0; Vector scratchVec2; EntityPtr *local_d4; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; short dashDir; Manager *manager; float posY; int *queriedNpc; float targetY; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af51b1; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)&(&projParams)[1].Spread; ExceptionList = &local_1c; local_24 = uVar4; if (npc->_variant == 1) { NpcHelper::raglich_slam_spawn_grid(npc); ExceptionList = local_1c; return; } damageEvent = (npc->_damageEvents)._begin; fVar9 = 0.0; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); pfVar2 = (&projParams)[1].Color._tint + 2; if (damageEvent != (npc->_damageEvents)._end) { do { if (damageEvent[4] == (float)npc->_type) { bVar3 = Entity::IsFriendly((Entity *)npc); damageEvent = extraout_EDX; if (((byte)((uint)extraout_EDX[0xc] >> 1) & 1) == bVar3) { npc->_pendingDamage = npc->_pendingDamage - *extraout_EDX; *extraout_EDX = 0.0; } } damageEvent = damageEvent + 0xe; pfVar2 = (float *)puStack_20; } while (damageEvent != (npc->_damageEvents)._end); } puStack_20 = (undefined1 *)pfVar2; if (npc->_pendingDamage <= fVar9 && fVar9 != npc->_pendingDamage) { npc->_pendingDamage = 0.0; } room = g_game->_room; local_e0 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_f4 = room; if (npc->_aiCallPhase == 1) { if (npc->_state != 1) { ExceptionList = local_1c; return; } local_e4 = 1.0; if (((((npc->_sprite)._animState._animData == (void *)0x0) || (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) || ((npc->_sprite)._animState._animData == (void *)0x0)) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_entityCollisionClass = 4; if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00576b75; } bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); manager = g_manager; if (bVar3 != 0) { if (npc->_championColorIdx == 0x12) { local_e4 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_e4 = 0.5; } local_d4 = (EntityPtr *)0x131; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,local_e4,0.0); room = local_f4; } LAB_00576b75: if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); if (bVar3 == 0) { ExceptionList = local_1c; return; } if ((int)local_e0 < 1) { ExceptionList = local_1c; return; } do { npc->_stateFrame = npc->_stateFrame + 1; iVar7 = npc->_stateFrame; if (((iVar7 == 10) || (iVar7 == 0x14)) || ((iVar7 == 0x1e || (iVar7 == 0x28)))) { Room::GetRandomPosition(room,&scratchVec2,0.0); uVar4 = Random(); pEVar5 = Game::Spawn(g_game,0xf0,2,&scratchVec2,&g_vectorZero,(Entity *)npc,0,uVar4); (**(code **)(*(int *)pEVar5 + 0xc))(); manager = g_manager; local_d4 = (EntityPtr *)0x109; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); } local_e0 = (float)((int)local_e0 + -1); room = local_f4; } while (local_e0 != 0.0); ExceptionList = local_1c; return; } bVar3 = *(byte *)((int)&npc->_i1 + 3); if (((-1 < (char)bVar3) && (bVar3 < 3)) && (fVar9 = *(float *)(&DAT_00b61e64 + (char)bVar3 * 4) * npc->_maxHitPoints, npc->_health <= fVar9 && fVar9 != npc->_health)) { *(byte *)((int)&npc->_i1 + 3) = bVar3 + 1; Entity::BloodExplode((Entity *)npc); cVar1 = *(char *)((int)&npc->_i1 + 3); if (cVar1 == '\x01') { bVar3 = ANM2::SetAnimation(&npc->_sprite,(&PTR_s_SummonLeft_00b61e70)[(short)npc->_i1],1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } npc->_state = 0xe; Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); } else { if (cVar1 != '\x02') goto LAB_00576d85; bVar3 = ANM2::SetAnimation(&npc->_sprite,(&PTR_s_SummonArmLeft_00b61e80)[(short)npc->_i1],1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); npc->_state = 0xf; } npc->_stateFrame = 0; } LAB_00576d85: if (0 < npc->_projectileDelay) { npc->_projectileDelay = npc->_projectileDelay - (int)local_e0; } if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - (int)local_e0; } switch(npc->_state) { case 0: npc->_entityCollisionClass = 0; npc->_aiCallFlags = 1; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)&DAT_00c34da4); npc->_state = 3; (npc->_posOffset).x = 0.0; (npc->_posOffset).y = 17.0; iVar7 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); if (((iVar7 < 0) || (iVar6 = room->_gridWidth, iVar6 <= iVar7)) || (room->_gridHeight < 2)) { iVar6 = room->_gridWidth; iVar7 = -1; } else { iVar7 = iVar7 + iVar6; } (npc->_targetPosition).x = (float)(iVar7 % iVar6) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar7 / iVar6) * 40.0 + 120.0; npc->_i1 = 0xff0003; uVar4 = Random(); npc->_projectileDelay = uVar4 % 0x3c + 0x3c; goto LAB_00578464; default: goto switchD_00576dbf_caseD_1; case 3: moveAnimTable = &PTR_s_MoveLeftUp_00c5c340; if (*(char *)((int)&npc->_i1 + 2) < '\x01') { moveAnimTable = &PTR_s_MoveLeftDown_00c5c350; } local_d4 = (EntityPtr *)moveAnimTable[(short)npc->_i1]; animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_00576f1b: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)local_d4,1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedName = local_d4; do { bVar3 = *animName; isLess = bVar3 < *(byte *)expectedName; if (bVar3 != *(byte *)expectedName) { LAB_00576f00: cmpResult = -(uint)isLess | 1; goto LAB_00576f05; } if (bVar3 == 0) break; bVar3 = animName[1]; isLess = bVar3 < (byte)expectedName->field_0x1; if (bVar3 != expectedName->field_0x1) goto LAB_00576f00; animName = animName + 2; expectedName = (EntityPtr *)&expectedName->field_0x2; } while (bVar3 != 0); cmpResult = 0; LAB_00576f05: if ((cmpResult != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_00576f1b; } npc->_friction = npc->_friction * 0.6; NpcHelper::raglich_pick_target_pos(uVar4); Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec2,(int)(short)npc->_i1); pEVar5 = Entity_NPC::GetPlayerTarget(npc); fVar9 = (npc->_pos).y - (pEVar5->_pos).y; fVar11 = (npc->_pos).x - (pEVar5->_pos).x; fVar9 = sqrtf(fVar9 * fVar9 + fVar11 * fVar11); local_f4 = (Room *)((fVar9 * 0.1 * (pEVar5->_velocity).y + (pEVar5->_pos).y) - (npc->_pos).y); local_e4 = (fVar9 * 0.1 * (pEVar5->_velocity).x + (pEVar5->_pos).x) - (npc->_pos).x; local_d4 = (EntityPtr *)cos(1.5707964); fVar9 = sin(1.5707964); if ((24.0 <= ABS(((float)local_d4 * scratchVec2.x - scratchVec2.y * fVar9) * local_e4 + (fVar9 * scratchVec2.x + (float)local_d4 * scratchVec2.y) * (float)local_f4)) || (0 < npc->_projectileCooldown)) { if (npc->_projectileDelay < 1) { npc->_state = 8; ANM2::Play(&npc->_sprite,(&PTR_s_BrimstoneLeft_00b61e24)[(short)npc->_i1],0); npc->_stateFrame = 0; } } else { cVar1 = *(char *)((int)&npc->_i1 + 3); dashDir = (short)npc->_i1; if (cVar1 == '\0') { animName = (&PTR_s_DashLeft_00b61e44)[dashDir]; } else { animName = (&PTR_s_DashAltLeft_00b61e54)[dashDir]; } npc->_state = (cVar1 != '\0') + 6; ANM2::Play(&npc->_sprite,animName,0); } iVar7 = Entity::GetIntervalTicks((Entity *)npc,30.0,0.0); if (iVar7 == 0) { ExceptionList = local_1c; return; } uVar4 = Random(); if (uVar4 % 5 != 0) { ExceptionList = local_1c; return; } Entity_NPC::QueryNPCsType(npcQuery,0xf0,-1); uVar4 = 0; local_14 = 0.0; iVar7 = 0; if (queryCount != (undefined1 *)0x0) { do { iVar6 = iVar7 + 1; if (*(Entity_NPC **)(*(int *)((int)queryEntities + uVar4 * 4) + 0x3c8) != npc) { iVar6 = iVar7; } uVar4 = uVar4 + 1; iVar7 = iVar6; } while (uVar4 < queryCount); if (1 < iVar6) goto LAB_005771ba; } npc->_state = 0xd; ANM2::Play(&npc->_sprite,(&PTR_s_SummonLeft_00b61e70)[(short)npc->_i1],0); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,20.0); } npc->_stateFrame = 0; LAB_005771ba: if (npcQuery[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,queryEntities,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; case 6: case 7: npc->_friction = 0.6; if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"DashStart"), bVar3 == 0)) { if (npc->_stateFrame == 1) goto LAB_0057747b; } else { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); npc->_stateFrame = 1; (npc->_v1).y = 18.0; LAB_0057747b: iVar7 = ANM2::GetFrame(&npc->_sprite); if ((((iVar7 != 0x1a) || (npc->_state != 7)) || (((npc->_sprite)._animState._animData != (void *)0x0 && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,33.0), npc->_stateFrame == 1))) ) && (((npc->_sprite)._animState._animData != (void *)0x0 && (bVar3 = AnimationState::IsEventTriggered (&(npc->_sprite)._animState,(byte *)"DashEnd"), bVar3 != 0)))) { if (npc->_state == 7) { if ((&PTR_s_TurnDownFromLeft_00b61e34)[(short)npc->_i1] == (byte *)0x0) { ANM2::Play(&npc->_sprite,(byte *)"DashAltShoot",0); (npc->_v1).y = (npc->_v1).y * 0.5; npc->_stateFrame = 4; } else { ANM2::Play(&npc->_sprite,(&PTR_s_TurnDownFromLeft_00b61e34)[(short)npc->_i1],0); npc->_stateFrame = 3; } } else { local_e4 = (npc->_pos).x; local_e0 = (npc->_pos).y; npc->_stateFrame = 2; scratchVec2.x = local_e4; scratchVec2.y = local_e0; Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,(int)(short)npc->_i1); local_d4 = (EntityPtr *)(scratchVec.x * 40.0); local_f0 = (EntityPtr *)(scratchVec.y * 40.0); scratchVec.x = (float)local_d4 + local_e4; scratchVec.y = local_e0 + (float)local_f0; bVar3 = Room::IsPositionInRoom(room,&scratchVec,0.0); while (bVar3 != 0) { local_e4 = (float)local_d4 + local_e4; local_e0 = local_e0 + (float)local_f0; scratchVec.x = local_e4 + (float)local_d4; scratchVec.y = (float)local_f0 + local_e0; scratchVec2.x = local_e4; scratchVec2.y = local_e0; bVar3 = Room::IsPositionInRoom(room,&scratchVec,0.0); } iVar6 = Room::GetGridIndex(room,&scratchVec2); iVar7 = room->_gridWidth; (npc->_targetPosition).x = (float)(iVar6 % iVar7) * 40.0 + 40.0; (npc->_targetPosition).y = (float)(iVar6 / iVar7) * 40.0 + 120.0; uVar4 = (int)(short)npc->_i1 + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } *(short *)&npc->_i1 = (short)uVar4; } } } iVar7 = npc->_stateFrame; if (iVar7 == 1) { Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec2,(int)(short)npc->_i1); fVar9 = (npc->_v1).y; fVar11 = npc->_speedMultiplier; (npc->_velocity).x = scratchVec2.x * fVar9 * fVar11 + (npc->_velocity).x; (npc->_velocity).y = scratchVec2.y * fVar9 * fVar11 + (npc->_velocity).y; iVar7 = npc->_state; fVar11 = (npc->_v1).y - npc->_speedMultiplier * 0.4; fVar9 = 8.0; if (8.0 <= fVar11) { fVar9 = fVar11; } (npc->_v1).y = fVar9; if (((iVar7 != 6) || (iVar7 = ANM2::GetFrame(&npc->_sprite), 0x4f < iVar7)) || (resultPos = Room::GetCenterPos(&scratchVec), ((npc->_pos).y - resultPos->y) * scratchVec2.y + ((npc->_pos).x - resultPos->x) * scratchVec2.x <= 0.0)) goto LAB_00577f90; if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,80.0); goto LAB_00577f90; } } else { if (iVar7 == 2) { local_f4 = (Room *)npc->_speedMultiplier; auVar12 = ZEXT812(0x41400000); fVar9 = (float)local_f4 * 0.2 + (npc->_v1).y; if (fVar9 <= auVar12._0_4_) { auVar12._4_8_ = auVar12._4_8_; auVar12._0_4_ = fVar9; } local_e4 = auVar12._0_4_; (npc->_v1).y = local_e4; local_f0 = (EntityPtr *)(((npc->_targetPosition).x - (npc->_pos).x) * 0.05); local_d4 = (EntityPtr *)(((npc->_targetPosition).y - (npc->_pos).y) * 0.05); fVar9 = sqrtf((float)local_d4 * (float)local_d4 + (float)local_f0 * (float)local_f0); if ((local_e4 < fVar9) && (0.0 < fVar9)) { local_d4 = (EntityPtr *)((local_e4 / fVar9) * (float)local_d4); local_f0 = (EntityPtr *)((local_e4 / fVar9) * (float)local_f0); } (npc->_velocity).x = (float)local_f0 * (float)local_f4 + (npc->_velocity).x; (npc->_velocity).y = (float)local_d4 * (float)local_f4 + (npc->_velocity).y; } else if (iVar7 == 3) { Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec2,(int)(short)npc->_i1); fVar9 = (npc->_v1).y; fVar11 = npc->_speedMultiplier; (npc->_velocity).x = scratchVec2.x * fVar9 * fVar11 + (npc->_velocity).x; (npc->_velocity).y = fVar9 * scratchVec2.y * fVar11 + (npc->_velocity).y; fVar9 = (npc->_v1).y - (npc->_speedMultiplier + npc->_speedMultiplier); auVar10 = ZEXT812(0x40000000); if (auVar10._0_4_ <= fVar9) { auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar9; } (npc->_v1).y = auVar10._0_4_; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"DashAltShoot",0); npc->_stateFrame = 4; } } else if (iVar7 == 4) { Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec2,(int)(short)npc->_i1); fVar9 = (npc->_v1).y; fVar11 = npc->_speedMultiplier; local_f0 = (EntityPtr *)0x3f800000; (npc->_velocity).x = fVar9 * scratchVec2.x * fVar11 + (npc->_velocity).x; (npc->_velocity).y = fVar9 * scratchVec2.y * fVar11 + (npc->_velocity).y; local_d4 = (EntityPtr *)((npc->_v1).y - npc->_speedMultiplier); speedSource = &local_f0; if (1.0 <= (float)local_d4) { speedSource = &local_d4; } (npc->_v1).y = (float)*speedSource; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 == 0) { bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot2"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x6a,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 2; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34e28); scratchVec2.x = 10.0; scratchVec2.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec2,6,&projParams); Entity_NPC::QueryNPCsType(npcQuery,0x21,3); local_14 = 4.2039e-45; local_d4 = (EntityPtr *)0x0; if (queryCount != (undefined1 *)0x0) { queryData = queryEntities; puVar8 = queryCount; do { iVar7 = *(int *)((int)queryData + (int)local_d4 * 4); if (iVar7 != 0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar7 + 0x28) == 1)) || (*(int *)(iVar7 + 0x28) - 10U < 0x3de)) && ((*(int *)(iVar7 + 0x34) == npc->_type && (*(int *)(iVar7 + 0xb64) == 8)))) { scratchVec.x = *(float *)(iVar7 + 0x33c); scratchVec.y = *(float *)(iVar7 + 0x340); scratchVec2.x = 10.0; scratchVec2.y = 0.0; Entity_NPC::FireProjectiles(npc,&scratchVec,&scratchVec2,6,&projParams); bVar3 = ANM2::SetOverlayAnimation((ANM2 *)(iVar7 + 0x48),(byte *)"Shoot",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar7 + 0x98)); *(undefined1 *)(iVar7 + 0xac) = 1; } puVar8 = queryCount; } queryData = queryEntities; } local_d4 = (EntityPtr *)&local_d4->field_0x1; } while (local_d4 < puVar8); } goto LAB_00577db9; } } else { Entity_NPC::PlaySound(npc,0x68,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 2; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)&DAT_00c34e28); scratchVec2.x = 10.0; scratchVec2.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&scratchVec2,7,&projParams); Entity_NPC::QueryNPCsType(npcQuery,0x21,3); local_14 = 2.8026e-45; local_d4 = (EntityPtr *)0x0; if (queryCount != (undefined1 *)0x0) { queryData = queryEntities; puVar8 = queryCount; do { iVar7 = *(int *)((int)queryData + (int)local_d4 * 4); if (iVar7 != 0) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar7 + 0x28) == 1)) || (*(int *)(iVar7 + 0x28) - 10U < 0x3de)) && ((*(int *)(iVar7 + 0x34) == npc->_type && (*(int *)(iVar7 + 0xb64) == 8)))) { scratchVec.x = *(float *)(iVar7 + 0x33c); scratchVec.y = *(float *)(iVar7 + 0x340); scratchVec2.x = 10.0; scratchVec2.y = 0.0; Entity_NPC::FireProjectiles(npc,&scratchVec,&scratchVec2,7,&projParams); bVar3 = ANM2::SetOverlayAnimation((ANM2 *)(iVar7 + 0x48),(byte *)"Shoot",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar7 + 0x98)); *(undefined1 *)(iVar7 + 0xac) = 1; } puVar8 = queryCount; } queryData = queryEntities; } local_d4 = (EntityPtr *)&local_d4->field_0x1; } while (local_d4 < puVar8); } LAB_00577db9: local_14 = -NAN; EntityList_Query::~EntityList_Query(npcQuery); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(&PTR_s_DashLeft_00b61e44)[(short)npc->_i1],1); local_e4 = (npc->_pos).x; local_e0 = (npc->_pos).y; scratchVec2.x = local_e4; scratchVec2.y = local_e0; Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,(int)(short)npc->_i1); room = local_f4; local_f0 = (EntityPtr *)(scratchVec.x * 40.0); local_d4 = (EntityPtr *)(scratchVec.y * 40.0); scratchVec.x = (float)local_f0 + local_e4; scratchVec.y = (float)local_d4 + local_e0; bVar3 = Room::IsPositionInRoom(local_f4,&scratchVec,0.0); while (bVar3 != 0) { local_e4 = (float)local_f0 + local_e4; local_e0 = (float)local_d4 + local_e0; scratchVec.x = local_e4 + (float)local_f0; scratchVec.y = local_e0 + (float)local_d4; scratchVec2.x = local_e4; scratchVec2.y = local_e0; bVar3 = Room::IsPositionInRoom(room,&scratchVec,0.0); } iVar7 = Room::GetGridIndex(room,&scratchVec2); resultPos = Room::GetGridPosition(room,&scratchVec2,iVar7); (npc->_targetPosition).x = resultPos->x; (npc->_targetPosition).y = resultPos->y; uVar4 = (int)(short)npc->_i1 + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } *(short *)&npc->_i1 = (short)uVar4; Sprite::SetFrame_1((Sprite *)&npc->_sprite,0x5a); npc->_stateFrame = 2; } } LAB_00577f90: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } cVar1 = *(char *)((int)&npc->_i1 + 2); npc->_state = 3; *(char *)((int)&npc->_i1 + 2) = -cVar1; npc->_projectileCooldown = 0x3c; break; case 8: npc->_friction = 0.6; iVar7 = npc->_i1; if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); } NpcHelper::raglich_pick_target_pos(uVar4); iVar6 = (int)(short)npc->_i1; if (iVar6 != (short)iVar7) { ANM2::SetAnimation(&npc->_sprite,(&PTR_s_BrimstoneLeft_00b61e24)[iVar6],0); this = npc->_child; if ((this != (EntityPtr)0x0) && (*(int *)((int)this + 0x28) == 7)) { Entity_NPC::SetAimAngle((Entity_NPC *)this,(float)(int)(short)npc->_i1 * 90.0 - 180.0); if ((short)npc->_i1 == 1) { fVar9 = -10.0; } else { fVar9 = 3000.0; } *(float *)((int)this + 0x358) = fVar9; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); npc->_stateFrame = 0; fVar9 = (float)(int)(short)npc->_i1; scratchVec2.x = 0.0; scratchVec2.y = -24.0; (npc->_v1).x = fVar9 * 90.0 - 180.0; brimstoneLaser = Entity_Laser::ShootAngle (1,&npc->_pos,fVar9 * 90.0 - 180.0,0x2d,&scratchVec2,(Entity *)npc,0); if ((short)npc->_i1 == 1) { fVar9 = -10.0; } else { fVar9 = 3000.0; } brimstoneLaser->_renderDepthOffset = fVar9; (**(code **)(*(int *)brimstoneLaser + 0x3c))(&DAT_00c34dd0,0xffffffff,0xff,0,1); if (npc->_child != (EntityPtr)0x0) { local_d4 = &npc->_child; std::multiset::erase(&local_d4); } npc->_child = (EntityPtr)brimstoneLaser; std::multiset::insert(&npc->_child); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } } npc->_state = 3; npc->_stateFrame = 0; uVar4 = Random(); npc->_projectileDelay = uVar4 % 0x3c + 0x3c; ExceptionList = local_1c; return; case 0xd: npc->_friction = npc->_friction * 0.6; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Room::GetRandomPosition(room,&scratchVec2,0.0); uVar4 = Random(); pEVar5 = Game::Spawn(g_game,0xf0,2,&scratchVec2,&g_vectorZero,(Entity *)npc,0,uVar4); (**(code **)(*(int *)pEVar5 + 0xc))(); SoundEffects::PlayWithFartOverride2(0x109,unused,2,0,1.0,1.0); } goto LAB_00578084; case 0xe: npc->_friction = npc->_friction * 0.6; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::QueryNPCsType(npcQuery,0x21,3); local_14 = 5.60519e-45; if (0 < (int)local_e0) { local_f0 = (EntityPtr *)0x6; fVar9 = local_e0; do { iVar7 = npc->_stateFrame; npc->_stateFrame = iVar7 + 1; if ((iVar7 % (int)local_f0 == 0) && (queryCount != (undefined1 *)0x0)) { uVar4 = 0; do { queriedNpc = *(int **)((int)queryEntities + uVar4 * 4); if ((queriedNpc != (int *)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (queriedNpc[10] == 1)) || (queriedNpc[10] - 10U < 0x3de)) && ((queriedNpc[0xd] == npc->_type && ((float)queriedNpc[0xe0] <= 1.0)))))) { queriedNpc[0x2d9] = 9; (**(code **)(*queriedNpc + 0xc))(); break; } uVar4 = uVar4 + 1; } while (uVar4 < queryCount); } fVar9 = (float)((int)fVar9 + -1); } while (fVar9 != 0.0); } if (npcQuery[0] == '\0') { local_14 = 7.00649e-45; tracked_alloc(1,queryEntities,0); } } LAB_00578084: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } npc->_state = 3; break; case 0xf: npc->_friction = npc->_friction * 0.6; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"DashStart"); if (bVar3 != 0) { resultPos = Room::GetCenterPos(&scratchVec2); (npc->_targetPosition).x = resultPos->x; (npc->_targetPosition).y = resultPos->y; (npc->_targetPosition).y = (npc->_targetPosition).y - 120.0; } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"DashStart"); if (bVar3 != 0) { frictionFactor = Math::timescale_factor(0.9,npc->_speedMultiplier); fVar9 = (npc->_velocity).y; fVar11 = (npc->_velocity).x; targetY = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (((npc->_targetPosition).x - (npc->_pos).x) - fVar11) * (1.0 - frictionFactor) + fVar11; (npc->_velocity).y = ((targetY - posY) - fVar9) * (1.0 - frictionFactor) + fVar9; } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar3 != 0) { uVar4 = Random(); scratchVec2.x = (npc->_targetPosition).x - 200.0; scratchVec2.y = (npc->_targetPosition).y + 0.0; pEVar5 = Game::Spawn(g_game,0x397,1,&scratchVec2,&g_vectorZero,(Entity *)npc,0,uVar4); (**(code **)(*(int *)pEVar5 + 0xc))(); uVar4 = Random(); scratchVec2.x = (npc->_targetPosition).x + 200.0; scratchVec2.y = (npc->_targetPosition).y + 0.0; pEVar5 = Game::Spawn(g_game,0x397,1,&scratchVec2,&g_vectorZero,(Entity *)npc,0,uVar4); (pEVar5->_sprite)._flipX = 1; (**(code **)(*(int *)pEVar5 + 0xc))(); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } FUN_00812ea0(&npc->_pos,&local_f0,&local_d4); if ((((int)local_f0 < 0) || (room->_gridWidth <= (int)local_f0)) || (room->_gridHeight < 2)) { puVar8 = (undefined1 *)0xffffffff; } else { puVar8 = &local_f0->field_0x0 + room->_gridWidth; } resultPos = Room::GetGridPosition(room,&scratchVec,(int)puVar8); (npc->_targetPosition).x = resultPos->x; (npc->_targetPosition).y = resultPos->y; *(undefined2 *)&npc->_i1 = 3; *(undefined1 *)((int)&npc->_i1 + 2) = 0xff; npc->_state = 3; } (npc->_v1).y = 0.0; LAB_00578464: npc->_stateFrame = 0; switchD_00576dbf_caseD_1: ExceptionList = local_1c; return; } //@@ 005784c0 Entity_Effect::Rotation /* ZHL [lua] Lua binding EntityEffect:Rotation */ float10 __thiscall Entity_Effect::Rotation(Entity_Effect *this) { return (float10)this->_rotation; } //@@ 005784d0 Room::StopRain /* ZHL [lua] Lua binding Room:StopRain */ void __thiscall Room::StopRain(Room *this) { this->_isRainStopped = 1; return; } //@@ 005784e0 FUN_005784e0 void FUN_005784e0(void) { Entity_NPC *in_ECX; float fVar1; float in_XMM1_Da; Vector local_10; float local_8; Entity_NPC::CalcTargetPosition(in_ECX,&local_10,0.0); local_8 = local_10.x - (in_ECX->_pos).x; local_10.y = local_10.y - (in_ECX->_pos).y; fVar1 = sqrtf(local_8 * local_8 + local_10.y * local_10.y); if (0.0 < fVar1) { local_8 = local_8 * (1.0 / fVar1); local_10.y = local_10.y * (1.0 / fVar1); } fVar1 = in_ECX->_speedMultiplier; (in_ECX->_velocity).x = local_8 * in_XMM1_Da * fVar1 + (in_ECX->_velocity).x; (in_ECX->_velocity).y = local_10.y * in_XMM1_Da * fVar1 + (in_ECX->_velocity).y; return; } //@@ 005785a0 NpcHelper::rainmaker_drop_timer_launch /* DB: ? Entity_Effect::CreateTimer callback set up in NpcHelper::rainmaker_spawn_homing_drop (mov ecx,0x5785a0 / call 0x60af00 at 578975): for the projectile child (type 9) clears flag 0x100, aims at the target (+0x3c4, leading by its velocity * this+0x478) or a random angle */ void NpcHelper::rainmaker_drop_timer_launch(int param_1) { int iVar1; int iVar2; uint uVar3; float fVar4; float fVar5; float fVar6; float fVar7; float local_1c; float local_18; iVar1 = *(int *)(param_1 + 0x3bc); if (iVar1 == 0) { return; } if (*(int *)(iVar1 + 0x28) != 9) { return; } fVar6 = *(float *)(param_1 + 0x474); iVar2 = *(int *)(param_1 + 0x3c4); fVar5 = *(float *)(param_1 + 0x478); *(uint *)(iVar1 + 0x43c) = *(uint *)(iVar1 + 0x43c) & 0xfffffeff; *(undefined4 *)(iVar1 + 0x438) = *(undefined4 *)(iVar1 + 0x438); if (iVar2 == 0) { uVar3 = Random(); fVar5 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar5 = fVar5 + fVar5; local_18 = cos(fVar5); local_1c = sin(fVar5); } else { local_18 = *(float *)(iVar2 + 0x33c); local_1c = *(float *)(iVar2 + 0x340); if (fVar5 <= 0.0) { fVar7 = *(float *)(iVar1 + 0x33c); } else { fVar7 = *(float *)(iVar1 + 0x33c); fVar4 = *(float *)(iVar1 + 0x340) - local_1c; fVar4 = sqrtf(fVar4 * fVar4 + (fVar7 - local_18) * (fVar7 - local_18)); local_1c = local_1c + fVar4 * *(float *)(iVar2 + 0x364) * fVar5; local_18 = local_18 + fVar4 * *(float *)(iVar2 + 0x360) * fVar5; } local_1c = local_1c - *(float *)(iVar1 + 0x340); local_18 = local_18 - fVar7; fVar5 = sqrtf(local_18 * local_18 + local_1c * local_1c); if (0.0 < fVar5) { local_1c = local_1c * (1.0 / fVar5); local_18 = (1.0 / fVar5) * local_18; } } if (0.0 < fVar6) { uVar3 = Random(); fVar5 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; fVar6 = ((fVar5 + fVar5) - 1.0) * fVar6 * 0.017453292; fVar5 = cos(fVar6); fVar6 = sin(fVar6); fVar7 = fVar6 * local_18; local_18 = fVar5 * local_18 - fVar6 * local_1c; local_1c = fVar7 + fVar5 * local_1c; } *(float *)(iVar1 + 0x360) = local_18 * 10.0; *(float *)(iVar1 + 0x364) = local_1c * 10.0; return; } //@@ 00578820 NpcHelper::rainmaker_spawn_homing_drop /* DB: ? ECX=npc (Rainmaker), param_1 position: Game::Spawn projectile 9.4 (height -6, FallingSpeed fields), effect 1000.133 splash, sfx 0x99, then Entity_Effect::CreateTimer linking the projectile and the player target (+0x3bc/+0x3c4) with params 4/5; twice from NpcAI::ENTITY_RAINMAKER */ EntityPtr NpcHelper::rainmaker_spawn_homing_drop (Vector *param_1,undefined4 param_2,Entity_Effect *param_3,float param_4, float param_5) { Manager *pMVar1; uint uVar2; uint seed; EntityPtr EVar3; Entity *pEVar4; Entity_Effect *pEVar5; EntityPtr EVar6; EntityPtr in_ECX; EntityPtr *pEVar7; EntityPtr *local_1c; EntityPtr local_18; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af51f5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; seed = Random(); EVar3 = (EntityPtr)Game::Spawn(g_game,9,4,param_1,&g_vectorZero,(Entity *)in_ECX,0,seed); EVar6 = *(EntityPtr *)((int)EVar3 + 0x3bc); pEVar7 = (EntityPtr *)((int)EVar3 + 0x3bc); *(undefined4 *)((int)EVar3 + 0x410) = 0xc0c00000; ((std_vector *)((int)EVar3 + 0x414))->_begin = (void *)0x0; *(float *)((int)EVar3 + 0x420) = 1.0; *(int *)((int)EVar3 + 0x438) = 0; *(int *)((int)EVar3 + 0x43c) = 0x100; if (EVar6 != (EntityPtr)0x0) { local_1c = pEVar7; std::multiset::erase(&local_1c); } *pEVar7 = in_ECX; if (in_ECX != (EntityPtr)0x0) { std::multiset::insert(pEVar7); } (**(code **)(*(int *)EVar3 + 0xc))(uVar2); uVar2 = Random(); Game::Spawn(g_game,1000,0x85,param_1,&g_vectorZero,(Entity *)0x0,0,uVar2); pMVar1 = g_manager; param_1 = (Vector *)0x99; seed_fart_sound_override((int *)¶m_1); SoundEffects::Play(&pMVar1->_sfxManager,(int)param_1,1.0,2,0,1.0,0.0); local_18 = EVar3; std::multiset::insert(&local_18); local_8 = 0; pEVar4 = Entity_NPC::GetPlayerTarget((Entity_NPC *)in_ECX); local_14 = (Entity *)0x0; if (pEVar4 != (Entity *)0x0) { local_14 = pEVar4; std::multiset::insert(&local_14); } local_8 = CONCAT31(local_8._1_3_,1); pEVar5 = Entity_Effect::CreateTimer(rainmaker_drop_timer_launch,(uint)param_3,0,0); param_3 = pEVar5; if (pEVar5->_parent != (EntityPtr)0x0) { param_1 = (Vector *)&pEVar5->_parent; std::multiset::erase(¶m_1); } pEVar5->_parent = EVar3; std::multiset::insert(&pEVar5->_parent); EVar6 = (EntityPtr)Entity_NPC::GetPlayerTarget((Entity_NPC *)in_ECX); pEVar7 = &pEVar5->_target; if (pEVar5->_target != (EntityPtr)0x0) { param_1 = (Vector *)pEVar7; std::multiset::erase(¶m_1); } *pEVar7 = EVar6; if (EVar6 != (EntityPtr)0x0) { std::multiset::insert(pEVar7); } param_3->_rotation = param_4; param_3->_scale = param_5; if (local_14 != (Entity *)0x0) { param_1 = (Vector *)&local_14; std::multiset::erase(¶m_1); local_14 = (Entity *)0x0; } if (local_18 != (EntityPtr)0x0) { param_1 = (Vector *)&local_18; std::multiset::erase(¶m_1); } ExceptionList = local_10; return EVar3; } //@@ 00578a70 NpcAI::ENTITY_RAINMAKER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 902 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_RAINMAKER(Entity_NPC *npc) { byte bVar1; uint uVar2; byte *animNameChar; Vector *direction; Entity *tmpEntity; void *listData; undefined4 extraout_ECX; undefined4 extraout_ECX_00; byte *expectedNameChar; float *pfVar3; bool isLess; float fVar4; float fVar5; AnimationState *pAVar6; int iVar7; Vector local_fc; Vector local_f4; undefined1 local_ec [12]; float local_e0; AnimationState *local_dc; float local_d8; Room *room; ProjectileParams params; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; byte *animData; Manager *manager; EntityPtr oldParent; EntityPtr *projectile; puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af5230; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)&(¶ms)[1].Spread; ExceptionList = &local_1c; room = g_game->_room; npc->_friction = npc->_friction * 0.7; local_24 = uVar2; switch(npc->_state) { case 0: npc->_state = 3; break; case 3: puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,s_Walk,0); FUN_005784e0(uVar2); uVar2 = Random(); if (uVar2 % 0x14 == 0) { npc->_projectileCooldown = 0; npc->_i1 = 0; uVar2 = Random(); if (uVar2 % 3 == 0) { npc->_state = 8; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_ec._8_4_ = (tmpEntity->_pos).x - (npc->_pos).x; local_e0 = (tmpEntity->_pos).y - (npc->_pos).y; direction = Vector::Normalized((Vector *)(local_ec + 8),&local_f4); if ((ABS(direction->y) < 0.25) || (uVar2 = Random(), (uVar2 & 1) == 0)) { npc->_i2 = 0; } else { npc->_i2 = 1; } } else { npc->_state = (uVar2 % 3 != 1) + 9; } } break; case 8: if (-1 < npc->_projectileCooldown) { puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,s_Attack1,0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack1End",0); npc->_projectileCooldown = -1; } else { iVar7 = npc->_projectileCooldown; if (((iVar7 < 0xc) || (0x11 < iVar7 + -0xc)) || (local_d8 = (float)((iVar7 + -0xc) / 3), iVar7 + -0xc != (int)local_d8 * 3)) { npc->_projectileCooldown = iVar7 + 1; } else { iVar7 = -1; do { local_dc = (AnimationState *)(npc->_pos).y; if (npc->_i2 == 1) { local_fc.y = (((float)(int)local_d8 * 180.0) / 6.0 + (float)iVar7 * 90.0 + 90.0) * 0.017453292; fVar4 = cos(local_fc.y); local_f4.y = fVar4 * 70.0 + (npc->_pos).x; fVar4 = sin(local_fc.y); local_ec._8_4_ = local_f4.y; local_e0 = fVar4 * 70.0 + (float)local_dc; } else { local_e0 = (float)local_dc + 0.0; local_ec._8_4_ = (float)((int)local_d8 + 1) * (float)iVar7 * 30.0 + (npc->_pos).x; } bVar1 = Room::IsPositionInRoom(room,(Vector *)(local_ec + 8),1.0); if (bVar1 != 0) { Entity_NPC::GetPlayerTarget(npc); NpcHelper::rainmaker_spawn_homing_drop (local_ec + 8,extraout_ECX,(9 - (int)local_d8) * 8,0,0x3d4ccccd); } iVar7 = iVar7 + 2; } while (iVar7 < 2); npc->_projectileCooldown = npc->_projectileCooldown + 1; } } break; } puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { iVar7 = 0x19; LAB_00578e40: Entity_NPC::PlaySound(npc,iVar7,1.0,2,0,1.0); } goto LAB_00578e47; case 9: iVar7 = npc->_projectileCooldown; if (iVar7 == 0) { puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)"Attack2Begin",0); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack2Loop",0); npc->_projectileCooldown = 1; } break; } if (0 < iVar7) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (iVar7 < 0x96) { puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack2Loop",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)"Attack2End",0); npc->_projectileCooldown = -1; } } else { puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); if (iVar7 % 10 == 0) { puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); Entity_NPC::GetPlayerTarget(npc); direction = MusicManager::RandomVector(&local_f4); local_ec._8_4_ = direction->x * 60.0 + (npc->_pos).x; local_e0 = direction->y * 60.0 + (npc->_pos).y; NpcHelper::rainmaker_spawn_homing_drop (local_ec + 8,extraout_ECX_00,0x2d,0x40a00000,0x3cf5c28f); iVar7 = npc->_projectileCooldown; } npc->_projectileCooldown = iVar7 + 1; FUN_005784e0(uVar2); } break; } puStack_20 = (undefined1 *)((¶ms)[1].Color._tint + 2); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x19,1.0,2,0,1.0); ProjectileParams::ProjectileParams(¶ms); params.Variant = 4; local_ec._8_4_ = (EntityPtr *)0x41200000; local_e0 = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,(Vector *)(local_ec + 8),8,¶ms); } bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b61e90); if (bVar1 != 0) { iVar7 = 0xc9; goto LAB_00578e40; } LAB_00578e47: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } break; case 10: animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_005790b3: bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d2e4,1); pfVar3 = (float *)puStack_20; if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; pfVar3 = (float *)puStack_20; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedNameChar = &DAT_00b1d2e4; do { bVar1 = *animNameChar; isLess = bVar1 < *expectedNameChar; if (bVar1 != *expectedNameChar) { LAB_00579095: uVar2 = -(uint)isLess | 1; goto LAB_0057909a; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < expectedNameChar[1]; if (bVar1 != expectedNameChar[1]) goto LAB_00579095; animNameChar = animNameChar + 2; expectedNameChar = expectedNameChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0057909a: if ((uVar2 != 0) || ((pfVar3 = (¶ms)[1].Color._tint + 2, animData[0x34] != 0 && (pfVar3 = (¶ms)[1].Color._tint + 2, (npc->_sprite)._animState._isPlaying == 0)))) goto LAB_005790b3; } puStack_20 = (undefined1 *)pfVar3; if (((2 < npc->_projectileCooldown) && (uVar2 = npc->_projectileCooldown - 2, (int)uVar2 < 0x12) ) && ((uVar2 & 1) == 0)) { direction = MusicManager::RandomVector(&local_fc); local_ec._8_4_ = direction->x * 60.0 + (npc->_pos).x; local_e0 = direction->y * 60.0 + (npc->_pos).y; uVar2 = Random(); tmpEntity = Game::Spawn(g_game,9,4,(Vector *)(local_ec + 8),&g_vectorZero,(Entity *)npc,1, uVar2); oldParent = tmpEntity->_parent; *(undefined4 *)&tmpEntity[1].field_0x4 = 0xc0c00000; tmpEntity[1]._damageEvents._begin = (void *)0x0; tmpEntity[1]._pendingDamage = 1.0; if (oldParent != (EntityPtr)0x0) { local_f4.y = (float)&tmpEntity->_parent; std::multiset::erase(&local_f4.y); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar2 = Random(); Game::Spawn(g_game,1000,0x85,(Vector *)(local_ec + 8),&g_vectorZero,(Entity *)0x0,0,uVar2); uVar2 = Random(); Game::Spawn(g_game,1000,0x85,(Vector *)(local_ec + 8),&g_vectorZero,(Entity *)0x0,1,uVar2); manager = g_manager; local_d8 = 2.14399e-43; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); } pAVar6 = &(npc->_sprite)._animState; local_dc = pAVar6; if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_005793de: EntityList::QuerySublist(&room->_entityList,(EntityList_EL *)local_ec,9,-1,-1,0,0); local_14 = 0.0; local_fc.y = 0.0; if (local_e0 != 0.0) { listData = (void *)local_ec._4_4_; do { projectile = *(EntityPtr **)((int)listData + (int)local_fc.y * 4); local_f4.y = (float)projectile; if (((projectile != (EntityPtr *)0x0) && (*(int *)(projectile + 10) == 9)) && ((*(int *)(projectile + 0xc) == 1 && (*(Entity_NPC **)(projectile + 0xef) == npc)))) { projectile[0x61] = (EntityPtr)0x0; local_d8 = (npc->_pos).y - *(float *)(projectile + 0xd0); local_dc = (AnimationState *)((npc->_pos).x - *(float *)(projectile + 0xcf)); fVar4 = sqrtf(local_d8 * local_d8 + (float)local_dc * (float)local_dc); if (fVar4 <= 4.0) { pAVar6 = local_dc; fVar4 = local_d8; } else if (fVar4 <= 0.0) { pAVar6 = (AnimationState *)((float)local_dc * 4.0); fVar4 = local_d8 * 4.0; } else { pAVar6 = (AnimationState *)((float)local_dc * (1.0 / fVar4) * 4.0); fVar4 = (1.0 / fVar4) * local_d8 * 4.0; } projectile[0xd9] = (EntityPtr)(fVar4 / *(float *)(projectile + 0xdb)); projectile[0xd8] = (EntityPtr)((float)pAVar6 / *(float *)(projectile + 0xdb)); projectile[0x105] = (EntityPtr)((-95.0 - *(float *)(projectile + 0x104)) * 0.28); if (ABS(*(float *)(projectile + 0x104) - -95.0) < 4.0) { fVar4 = (npc->_pos).y - *(float *)(projectile + 0xd0); fVar5 = (npc->_pos).x - *(float *)(projectile + 0xcf); fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); manager = g_manager; if (fVar4 < 9.0) { local_d8 = 2.5924e-43; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); ((undefined1 *)((int)local_f4.y + 0x170))[3] = 1; uVar2 = Random(); npc->_i1 = (uVar2 & 1) + npc->_i1 + 2; } } listData = (void *)local_ec._4_4_; } local_fc.y = (float)((int)local_fc.y + 1); } while ((uint)local_fc.y < (uint)local_e0); } if (local_ec[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_ec._4_4_,0); } } else { bVar1 = AnimationState::IsEventTriggered(pAVar6,&DAT_00b61e90); if (bVar1 != 0) { Entity_NPC::PlaySound(npc,0x1e5,1.0,2,0,1.0); local_dc = pAVar6; } if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_005793de; bVar1 = AnimationState::IsEventTriggered(pAVar6,(byte *)"Shoot"); manager = g_manager; if (bVar1 != 0) { local_d8 = 6.81031e-43; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); ProjectileParams::ProjectileParams(¶ms); local_f4.y = (float)&DAT_00000004; pfVar3 = &local_f4.y; if (4 < npc->_i1) { pfVar3 = (float *)&npc->_i1; } params.HeightModifier = -72.0; params.Variant = 4; Entity_NPC::FireBossProjectiles(npc,(int)*pfVar3,&g_vectorZero,2.0,¶ms); uVar2 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xd,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2); iVar7 = *(int *)tmpEntity; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -95.0; (tmpEntity->_sprite)._scale.x = 2.0; (tmpEntity->_sprite)._scale.y = 2.0; (**(code **)(iVar7 + 0xc))(); } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar1 = AnimationState::WasEventTriggered(local_dc,(byte *)"Shoot"), bVar1 == 0)) goto LAB_005793de; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; } npc->_projectileCooldown = npc->_projectileCooldown + 1; } if (npc->_dead != 0) { uVar2 = 0; if ((room->_entityList)._updateEL._size != 0) { do { iVar7 = *(int *)((int)(room->_entityList)._updateEL._data + uVar2 * 4); if ((*(int *)(iVar7 + 0x28) == 9) && (*(Entity_NPC **)(iVar7 + 0x3bc) == npc)) { *(undefined1 *)(iVar7 + 0x173) = 1; } uVar2 = uVar2 + 1; } while (uVar2 < (uint)(room->_entityList)._updateEL._size); } room->_isRainStopped = 1; } ExceptionList = local_1c; return; } //@@ 00579700 FUN_00579700 void FUN_00579700(void) { int *in_ECX; undefined1 local_14 [4]; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0a50; local_10 = ExceptionList; ExceptionList = &local_10; if (*in_ECX != 0) { std::multiset::erase(local_14); *in_ECX = 0; } ExceptionList = local_10; return; } //@@ 00579760 FUN_00579760 undefined4 FUN_00579760(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x458); } //@@ 00579770 NpcHelper::ReapCreep_CountOtherEnemies /* DB: room enemy count without bosses, Reap Creep summon/dash gates (monster-fidelity-6) */ int NpcHelper::ReapCreep_CountOtherEnemies(void) { void *pvVar1; int iVar2; int iVar3; int iVar4; pvVar1 = g_game->_room; iVar2 = *(int *)((int)pvVar1 + 0x12c8) + *(int *)((int)pvVar1 + 0x12cc); iVar4 = *(int *)((int)pvVar1 + 0x12c4) + *(int *)((int)pvVar1 + 0x12c0); iVar3 = 0; if (0 < iVar2) { iVar3 = iVar2; } iVar2 = 0; if (0 < iVar4) { iVar2 = iVar4; } return iVar2 - iVar3; } //@@ 005797b0 NpcHelper::ReapCreep_ThinLaser /* DB: Attack3 thin beam: laser variant 1, timeout 100, SetActiveRotation after 30 ticks (monster-fidelity-6) */ Entity_Laser * NpcHelper::ReapCreep_ThinLaser(void) { Entity_Laser *pEVar1; Entity *in_ECX; undefined1 *puVar2; float in_XMM2_Da; float in_XMM3_Da; Vector local_20; Vector local_18; float local_10; float local_c; local_20.x = (in_ECX->_pos).x + 0.0; local_20.y = (in_ECX->_pos).y + 4.0; local_18.x = 0.0; local_18.y = -32.0; local_10 = in_XMM2_Da; local_c = in_XMM3_Da; pEVar1 = Entity_Laser::ShootAngle(1,&local_20,in_XMM2_Da,100,&local_18,in_ECX,0); if (local_c <= local_10) { puVar2 = &DAT_bf800000; } else { puVar2 = (undefined1 *)0x3f800000; } pEVar1->_isActiveRotating = 1; pEVar1->_rotationDelay = 0x1e; pEVar1->_rotationSpd = (float)puVar2; pEVar1->_renderDepthOffset = 1000.0; pEVar1->_rotationDegrees = local_c - local_10; (**(code **)(*(int *)pEVar1 + 0xc))(); return pEVar1; } //@@ 00579890 NpcAI::ENTITY_REAP_CREEP /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 900 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_REAP_CREEP(Entity_NPC *npc) { code *pcVar1; longlong lVar2; longlong lVar3; Vector targetPos; Room *pRVar4; char cVar5; byte bVar6; uint uVar7; Entity *pEVar8; float fVar9; int iVar10; int *piVar11; byte *pbVar12; float *damageEvent; Entity_Laser *child; Vector *pVVar13; Vector *freeTilePos; byte unused; int unusedArg; void *pvVar14; byte *pbVar15; int spreadCenter; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; uint uVar16; uint uVar17; int extraout_EDX; PlayerManager *playerManager; byte *pbVar18; bool bVar19; float fVar20; float fVar21; ulonglong uVar22; byte isAllowPits; char *pcVar23; byte isAvoidDoors; int *local_328; byte *pbStack_324; char cStack_31d; Vector VStack_31c; Room *room; float pickupSubtype; float fStack_30c; float fStack_308; void *pvStack_304; Vector VStack_300; Vector local_2f8; Vector VStack_2f0; Vector VStack_2e8; Vector VStack_2e0; float frictionScale; Vector VStack_2d4; Vector VStack_2cc; uint pickupVariant; Vector VStack_2c0; Vector VStack_2b8; int landSoundId; int deathSoundId; Vector pickupPos; float collectibleKey; EntityPtr *spawnerPtrRef; Vector pickupVelocity; int triggerKeyType; int triggerKeyVariant; int triggerKeyTypeOnly; undefined4 triggerKeyAnyVariant; Vector leftWallSpawnPos; Vector rightWallSpawnPos; Vector triteSpawnPos; Vector triteTargetPos; undefined8 rngShifts; undefined4 rngShift3; undefined1 auStack_250 [4]; undefined1 auStack_24c [8]; int iStack_244; Vector freeTriteTarget; Vector freeSpiderTarget; Vector randomRoomPos; Vector spiderOffsetDir; Vector fountainOffsetDir; RNG cardRng; ProjectileParams spreadParams; ProjectileParams rainParams; ProjectileParams fountainParams; uint local_c; AnimationState *animState; char currentStrafeDir; float *damageEventsEnd; Game *game; Manager *manager; std_set *spawnTriggerTargets; EntityPtr *spawnerPtr; ANM2 *sprite; manager = g_manager; game = g_game; local_c = __security_cookie ^ (uint)&local_328; frictionScale = 0.6; room = g_game->_room; local_328 = (int *)0x3f000000; iVar10 = npc->_state; local_2f8.x = (float)npc; if (((iVar10 == 0x10) || (cVar5 = *(char *)((int)&npc->_i1 + 1), '\x01' < cVar5)) || (fVar20 = ((float)(2 - cVar5) * npc->_maxHitPoints) / 3.0, fVar20 < npc->_health || fVar20 == npc->_health)) { switch(iVar10) { case 0: (npc->_sprite)._overlayRenderFirst = 1; fVar20 = (npc->_pos).x; npc->_state = 6; npc->_entityGridCollisionClass = 0; fVar9 = *(float *)((int)game->_room + 0x18); (npc->_targetPosition).x = fVar20; (npc->_targetPosition).y = fVar9 + 8.0; npc->_i1 = 0; npc->_i2 = 0; npc->_stateFrame = 0; npc->_projectileCooldown = 0; (npc->_v1).x = 0.0; (npc->_v1).y = 0.0; npc->_projectileDelay = 0; break; case 3: cVar5 = *(char *)((int)&npc->_i1 + 1); sprite = &npc->_sprite; if (cVar5 == '\0') { local_328 = (int *)0x3f800000; ANM2::Play(sprite,&DAT_00b601c4,0); if (npc->_projectileCooldown < 1) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); iVar10 = NpcHelper::ReapCreep_CountOtherEnemies(); if ((iVar10 < 1) && (uVar7 = Random(), (uVar7 & 3) != 0)) { pcVar23 = "Summon1"; iVar10 = 0xd; } else { pcVar23 = "Attack1Start"; iVar10 = 8; } npc->_state = iVar10; npc->_projectileCooldown = 0; LAB_0057a756: ANM2::Play(&npc->_sprite,(byte *)pcVar23,0); pcVar23 = (char *)((int)&npc->_i1 + 3); *pcVar23 = *pcVar23 + '\x01'; } else { npc->_projectileCooldown = npc->_projectileCooldown + -1; } } else if (cVar5 == '\x01') { local_328 = (int *)0x3f333333; ANM2::Play(sprite,s_Idle2,0); if (npc->_projectileCooldown < 1) { Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); iVar10 = NpcHelper::ReapCreep_CountOtherEnemies(); if ((iVar10 < 1) && (uVar7 = Random(), (uVar7 & 1) != 0)) { npc->_state = 0xe; pcVar23 = "Summon2"; npc->_projectileCooldown = 0; } else { npc->_state = 9; npc->_projectileCooldown = 0; uVar7 = Random(); npc->_i2 = uVar7 & 1; pcVar23 = (char *)s_Attack2; } goto LAB_0057a756; } npc->_projectileCooldown = npc->_projectileCooldown + -1; } else { local_328 = (int *)0x3f800000; ANM2::Play(sprite,&DAT_00b1d43c,0); if (npc->_projectileCooldown < 1) { if (((*(char *)((int)&npc->_i1 + 3) == '\0') || (uVar7 = Random(), (uVar7 & 3) == 0)) && (iVar10 = NpcHelper::ReapCreep_CountOtherEnemies(), iVar10 < 3)) { pcVar23 = "DashRightStart"; fVar20 = (npc->_pos).x; npc->_state = 7; npc->_projectileCooldown = 0; fVar9 = ABS(fVar20 - (room->_topLeftPos).x); fVar20 = ABS(fVar20 - (room->_bottomRightPos).x); if (fVar20 < fVar9) { pcVar23 = "DashLeftStart"; } *(char *)((int)&npc->_i1 + 2) = (fVar9 <= fVar20) * '\x02' + -1; } else { npc->_state = 10; npc->_projectileCooldown = 0; uVar7 = Random(); npc->_i2 = uVar7 & 1; Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); pcVar23 = "Attack3Start"; } ANM2::Play(&npc->_sprite,(byte *)pcVar23,0); pcVar23 = (char *)((int)&npc->_i1 + 3); *pcVar23 = *pcVar23 + '\x01'; } else { npc->_projectileCooldown = npc->_projectileCooldown + -1; } } break; case 6: pbVar18 = (npc->_sprite)._animState._animData; if (pbVar18 == (byte *)0x0) { LAB_0057a438: bVar6 = ANM2::SetAnimation(&npc->_sprite,s_Jump,1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar18 + 0x14)) { pbVar18 = *(byte **)pbVar18; } pbVar12 = s_Jump; do { bVar6 = *pbVar18; bVar19 = bVar6 < *pbVar12; if (bVar6 != *pbVar12) { LAB_0057a420: uVar7 = -(uint)bVar19 | 1; goto LAB_0057a425; } if (bVar6 == 0) break; bVar6 = pbVar18[1]; bVar19 = bVar6 < pbVar12[1]; if (bVar6 != pbVar12[1]) goto LAB_0057a420; pbVar18 = pbVar18 + 2; pbVar12 = pbVar12 + 2; } while (bVar6 != 0); uVar7 = 0; LAB_0057a425: if ((uVar7 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0057a438; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar6 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,s_Jump), bVar6 != 0)) { Entity_NPC::PlaySound(npc,0xe,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || (bVar6 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land), bVar6 == 0)) { bVar6 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); if (bVar6 != 0) { fVar20 = (npc->_targetPosition).y; fVar9 = (npc->_pos).y; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) * 0.25; (npc->_velocity).y = (fVar20 - fVar9) * 0.25; bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Land); manager = g_manager; if (bVar6 != 0) { pbStack_324 = (byte *)0x30; seed_fart_sound_override((int *)&pbStack_324); SoundEffects::Play(&manager->_sfxManager,(int)pbStack_324,1.0,2,0,1.0,0.0); (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } } } else { fVar20 = (npc->_targetPosition).y; fVar9 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar20 - fVar9; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar7 = Random(); frictionScale = npc->_friction * frictionScale; npc->_projectileCooldown = uVar7 % 0x1e + 0x1e; goto LAB_0057bdca; } } frictionScale = npc->_friction * frictionScale; goto LAB_0057bdca; case 7: if (*(char *)((int)&npc->_i1 + 2) == '\0') { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar7 = Random(); npc->_projectileCooldown = uVar7 % 0x1e + 0x1e; } } else { bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar6 != 0) { Entity_NPC::PlaySound(npc,0x73,1.0,2,0,1.0); } bVar6 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar6 != 0) || (bVar6 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), bVar6 != 0)) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { pcVar23 = "DashLeftLoop"; if (-1 < *(char *)((int)&npc->_i1 + 2)) { pcVar23 = "DashRightLoop"; } ANM2::Play(&npc->_sprite,(byte *)pcVar23,0); } cVar5 = *(char *)((int)&npc->_i1 + 2); fVar20 = (npc->_velocity).x; fVar9 = (float)(int)cVar5; fVar21 = fVar20 + (npc->_pos).x + fVar9 * fVar9; if (((cVar5 < '\0') && (fVar21 < (room->_topLeftPos).x)) || (('\0' < cVar5 && ((room->_bottomRightPos).x <= fVar21 && fVar21 != (room->_bottomRightPos).x)))) { (npc->_velocity).x = fVar20 * -1.0; Entity_NPC::PlaySound(npc,0x34,2.0,2,0,1.0); Game::ShakeScreen(g_game,0xf); npc->_projectileCooldown = 0x16; ANM2::Play(&npc->_sprite,(byte *)"DashEnd",0); *(undefined1 *)((int)&npc->_i1 + 2) = 0; } else { (npc->_velocity).x = fVar9 * npc->_speedMultiplier * 8.0 + fVar20; } } } if (0 < npc->_projectileCooldown) { if ((npc->_projectileCooldown & 1U) == 0) { isAvoidDoors = 0; isAllowPits = 0; bVar6 = 0; fVar20 = 64.0; pVVar13 = Room::GetRandomPosition(room,&randomRoomPos,10.0); Room::FindFreePickupSpawnPosition (room,&VStack_2e0,pVVar13,fVar20,bVar6,isAllowPits,isAvoidDoors); uVar7 = Random(); if ((uVar7 % 3 == 0) && (iVar10 = NpcHelper::ReapCreep_CountOtherEnemies(), iVar10 < 4)) { uVar7 = Game::GetStageID(g_game,unused); pVVar13 = MusicManager::RandomVector(&spiderOffsetDir); local_2f8.x = VStack_2e0.x - pVVar13->x * 20.0; local_2f8.y = VStack_2e0.y - pVVar13->y * 20.0; if ((uVar7 == 0x1d) || (uVar7 == 0x1e)) { Entity_NPC::ThrowRockSpider(&local_2f8,&g_vectorZero,(Entity *)npc,0,-400.0); } else { targetPos.y = local_2f8.y; targetPos.x = local_2f8.x; Entity_NPC::ThrowSpider(&local_2f8,(Entity *)npc,targetPos,0,-400.0); } } else { ProjectileParams::ProjectileParams(&rainParams); uVar7 = Random(); rainParams.HeightModifier = -400.0; rainParams.FallingAccelModifier = 2.0; rainParams.Scale = 1.2 - (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.40000004; uVar7 = Random(); rainParams.Variant = 9; rainParams.FallingSpeedModifier = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 0.0; Entity_NPC::FireProjectiles(npc,&VStack_2e0,&g_vectorZero,0,&rainParams); } } npc->_projectileCooldown = npc->_projectileCooldown + -1; } frictionScale = 0.8; break; case 8: uVar7 = npc->_projectileCooldown; if (uVar7 == 0) { local_328 = (int *)0x0; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { Entity_NPC::PlaySound(npc,0x13d,1.0,2,0,0.8); npc->_projectileCooldown = 0x3c; ANM2::Play(&npc->_sprite,(byte *)"Attack1Fire",0); } } else { if ((int)uVar7 < 1) { local_328 = (int *)0x0; goto LAB_0057aad1; } if ((uVar7 & 1) == 0) { Entity_NPC::GetPlayerTarget(npc); uVar7 = Random(); local_2f8.x = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; VStack_2c0.x = cos(1.5707964); VStack_2c0.x = VStack_2c0.x * 12.0; VStack_2c0.y = sin(1.5707964); VStack_2c0.y = VStack_2c0.y * 12.0; ProjectileParams::ProjectileParams(&fountainParams); fountainParams.HeightModifier = -24.0; fountainParams.Scale = 1.8 - local_2f8.x * 0.79999995; fountainParams.FallingSpeedModifier = 2.0; local_2f8.x = (npc->_pos).x; VStack_2e0.x = (npc->_pos).y; pVVar13 = MusicManager::RandomVector(&fountainOffsetDir); uVar7 = Random(); fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; VStack_2cc.x = fVar20 * pVVar13->x * 13.0 + local_2f8.x + 0.0; VStack_2cc.y = pVVar13->y * fVar20 * 13.0 + VStack_2e0.x + 5.0; Entity_NPC::FireProjectiles(npc,&VStack_2cc,&VStack_2c0,0,&fountainParams); Entity_NPC::PlaySound(npc,0x99,1.0,2,0,1.0); uVar7 = npc->_projectileCooldown; } npc->_projectileCooldown = uVar7 - 1; if ((int)(uVar7 - 1) < 1) { ANM2::Play(&npc->_sprite,(byte *)"Attack1End",0); npc->_projectileCooldown = -1; } } break; case 9: local_328 = (int *)0x0; bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar6 != 0) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); npc->_projectileCooldown = 1; pEVar8 = Entity_NPC::GetPlayerTarget(npc); fVar20 = atan2f((pEVar8->_pos).y - (npc->_pos).y,(pEVar8->_pos).x - (npc->_pos).x); local_2f8.x = fVar20 * 57.295776; uVar7 = Random(); fVar20 = local_2f8.x + ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 20.0; (npc->_v1).y = fVar20; if ((fVar20 < 30.0) || (150.0 < fVar20)) { fVar20 = (pEVar8->_pos).y; fVar20 = atan2f(((fVar20 - fVar20) + (fVar20 - fVar20) + fVar20) - (npc->_pos).y, (pEVar8->_pos).x - (npc->_pos).x); fVar20 = fVar20 * 57.295776; if (fVar20 <= 75.0) { fVar20 = 75.0; } if (105.0 <= fVar20) { fVar20 = 105.0; } (npc->_v1).y = fVar20 - 360.0; } } bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"EndShoot"); if (bVar6 == 0) { if (0 < npc->_projectileCooldown) { uVar7 = npc->_projectileCooldown + 1; npc->_projectileCooldown = uVar7; if ((uVar7 & 1) != 0) { if ((npc->_i2 == 0) || (fVar20 = (npc->_v1).y, fVar20 < 0.0)) { fVar20 = (npc->_v1).y; cStack_31d = '\0'; } else { cStack_31d = '\x01'; } iVar10 = (int)uVar7 / 2; if (cStack_31d == '\0') { pbStack_324 = (byte *)0x1e; spreadCenter = 4 - iVar10; if (90.0 <= fVar20) { spreadCenter = iVar10 + -4; } spreadCenter = spreadCenter * 0xd; } else { pbStack_324 = &DAT_00000014; spreadCenter = (4 - iVar10) * 8; if (90.0 <= fVar20) { spreadCenter = iVar10 * 8 + -0x20; } } VStack_2e0.x = (float)(spreadCenter + 0x2d); pbVar18 = (byte *)(spreadCenter + -0x2d); if ((int)pbVar18 <= (int)VStack_2e0.x) { do { local_2f8.x = ((float)(int)pbVar18 + (npc->_v1).y) * 0.017453292; VStack_2e8.x = cos(local_2f8.x); VStack_2e8.x = VStack_2e8.x * 8.0; VStack_2e8.y = sin(local_2f8.x); VStack_2e8.y = VStack_2e8.y * 8.0; ProjectileParams::ProjectileParams(&spreadParams); uVar7 = Random(); if (cStack_31d == '\0') { if (uVar7 % 10 != 0) { spreadParams.Scale = 1.1; spreadParams.HeightModifier = -24.0; spreadParams.FallingSpeedModifier = 1.5; goto LAB_0057ae8c; } } else { spreadParams.HeightModifier = -24.0; spreadParams.FallingAccelModifier = 0.3; spreadParams.Scale = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.9 + frictionScale; uVar7 = Random(); spreadParams.FallingSpeedModifier = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 17.0 - 12.0; uVar7 = Random(); fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; VStack_2e8.y = fVar20 * VStack_2e8.y; VStack_2e8.x = fVar20 * VStack_2e8.x; LAB_0057ae8c: VStack_300.x = VStack_2e8.x * 3.0 + (npc->_pos).x; VStack_300.y = VStack_2e8.y * 3.0 + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&VStack_300,&VStack_2e8,0,&spreadParams); } pbVar18 = pbVar18 + (int)pbStack_324; } while ((int)pbVar18 <= (int)VStack_2e0.x); } } } } else { npc->_projectileCooldown = 0; } LAB_0057aad1: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar7 = Random(); npc->_projectileCooldown = uVar7 % 0x3c + 0x3c; } break; case 10: sprite = &npc->_sprite; local_328 = (int *)0x0; if (npc->_projectileCooldown < 1) { bVar6 = Sprite::IsEventTriggered((Sprite *)sprite,"Close"); if (bVar6 != 0) { Entity_NPC::GetPlayerTarget(npc); uVar7 = Random(); npc->_i2 = uVar7 & 1; iVar10 = -10; if ((uVar7 & 1) == 0) { iVar10 = -0x1e; } npc->_projectileCooldown = iVar10; Entity_NPC::PlaySound(npc,(uint)(npc->_i2 != 1) * 2 + 0x136,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(sprite,(byte *)"Attack3Charge",0); } if ((npc->_projectileCooldown < 0) && (iVar10 = npc->_projectileCooldown + 1, npc->_projectileCooldown = iVar10, iVar10 == 0)) { ANM2::Play(sprite,(byte *)"Attack3BeamStart",0); npc->_projectileCooldown = 1; } } else { if (npc->_projectileCooldown != 1) goto LAB_0057b179; bVar6 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); if (bVar6 != 0) { if (npc->_i2 == 0) { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); pEVar8 = (Entity *)NpcHelper::ReapCreep_ThinLaser(extraout_ECX); Entity::SetChild((Entity *)npc,pEVar8); NpcHelper::ReapCreep_ThinLaser(extraout_ECX_00); NpcHelper::ReapCreep_ThinLaser(extraout_ECX_01); NpcHelper::ReapCreep_ThinLaser(extraout_ECX_02); } else { Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); VStack_2d4.x = 0.0; VStack_2f0.x = (npc->_pos).x + 0.0; VStack_2d4.y = -32.0; VStack_2f0.y = (npc->_pos).y + 4.0; child = Entity_Laser::ShootAngle(0xb,&VStack_2f0,90.0,0x32,&VStack_2d4,(Entity *)npc,0); child->_renderDepthOffset = 1000.0; (**(code **)(*(int *)child + 0xc))(); Entity::SetChild((Entity *)npc,(Entity *)child); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack3BeamLoop",0); } if (npc->_child != (EntityPtr)0x0) { if (npc->_i2 == 0) { local_328 = (int *)0x3ecccccd; } else { local_328 = (int *)0x3ed70a3d; } } bVar6 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); if ((bVar6 != 0) && (((extraout_EDX == 0 || (*(int *)(extraout_EDX + 0x28) != 7)) || (*(int *)(extraout_EDX + 0x458) < 5)))) { ANM2::Play(&npc->_sprite,(byte *)"Attack3End",0); npc->_projectileCooldown = 2; } } break; case 0xd: local_328 = (int *)0x0; bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar6 != 0) { Entity_NPC::PlaySound(npc,0x7a,1.0,2,0,1.0); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar7 = Random(); npc->_projectileCooldown = uVar7 % 0x1e + 0x1e; uVar7 = Random(); fStack_308 = (room->_topLeftPos).x; VStack_31c.x = (room->_topLeftPos).y; pbStack_324 = (byte *)(room->_bottomRightPos).x; VStack_300.x = (room->_bottomRightPos).y; if (uVar7 % 5 < 2) { uVar7 = Random(); VStack_31c.x = VStack_31c.x + 20.0; uVar17 = Random(); leftWallSpawnPos.x = fStack_308; pVVar13 = &leftWallSpawnPos; leftWallSpawnPos.y = ((VStack_300.x - 20.0) - VStack_31c.x) * (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 + VStack_31c.x; } else if (uVar7 % 5 < 4) { uVar7 = Random(); VStack_31c.x = VStack_31c.x + 20.0; uVar17 = Random(); rightWallSpawnPos.x = (float)pbStack_324; pVVar13 = &rightWallSpawnPos; rightWallSpawnPos.y = ((VStack_300.x - 20.0) - VStack_31c.x) * (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 + VStack_31c.x; } else { uVar7 = Random(); fStack_308 = fStack_308 + 20.0; uVar17 = Random(); pVVar13 = &VStack_31c; VStack_31c.y = VStack_300.x; VStack_31c.x = (((float)pbStack_324 - 20.0) - fStack_308) * (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 + fStack_308; } pEVar8 = Game::SpawnEx(g_game,0xf0,0,pVVar13,&g_vectorZero,(Entity *)0x0,0,uVar7,0); (**(code **)(*(int *)pEVar8 + 0xc))(); Entity_NPC::PlaySound(npc,0x109,1.0,2,0,1.0); } break; case 0xe: local_328 = (int *)0x0; bVar6 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar6 != 0) { Entity_NPC::PlaySound(npc,0x10,1.0,2,0,1.0); pVVar13 = &npc->_pos; uVar7 = Random(); if ((uVar7 & 1) == 0) { fStack_30c = 4.2039e-45; do { uVar7 = Random(); pbStack_324 = (byte *)(((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 90.0 + 45.0) * 0.017453292); uVar7 = Random(); pvStack_304 = (void *)((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10); fVar20 = cos((float)pbStack_324); VStack_2b8.x = fVar20 * (float)pvStack_304 * 200.0 + pVVar13->x; fVar20 = sin((float)pbStack_324); VStack_2b8.y = fVar20 * (float)pvStack_304 * 200.0 + (npc->_pos).y; freeTilePos = Room::FindFreeTilePosition(room,&freeSpiderTarget,&VStack_2b8,64.0); Entity_NPC::ThrowSpider(pVVar13,(Entity *)npc,*freeTilePos,0,-32.0); fStack_30c = (float)((int)fStack_30c + -1); } while (fStack_30c != 0.0); fStack_30c = 0.0; } else { uVar7 = Random(); triteSpawnPos.x = pVVar13->x + 0.0; triteSpawnPos.y = (npc->_pos).y + 4.0; pEVar8 = Game::SpawnEx(g_game,0x1d,1,&triteSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar7,0) ; uVar7 = Random(); pbStack_324 = (byte *)(((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 90.0 + 45.0) * 0.017453292); uVar7 = Random(); pvStack_304 = (void *)((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 200.0 + 100.0); fVar20 = cos((float)pbStack_324); triteTargetPos.x = fVar20 * (float)pvStack_304 + (npc->_pos).x; fVar20 = sin((float)pbStack_324); triteTargetPos.y = fVar20 * (float)pvStack_304 + (npc->_pos).y; pVVar13 = Room::FindFreeTilePosition(room,&freeTriteTarget,&triteTargetPos,64.0); fVar20 = pVVar13->y; (pEVar8->_targetPosition).x = pVVar13->x; (pEVar8->_targetPosition).y = fVar20; pEVar8[2]._posOffset.x = 5.60519e-45; *(undefined4 *)&pEVar8[1].field_0x4 = 5; ANM2::Play(&pEVar8->_sprite,&DAT_00b1de1c,1); Sprite::SetFrame_1((Sprite *)&pEVar8->_sprite,5); } } LAB_0057b179: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar7 = Random(); npc->_projectileCooldown = uVar7 % 0x1e + 0x1e; } break; case 0x10: goto code_r0x0057a2df; } } else { if (iVar10 == 6) { landSoundId = 0x30; seed_fart_sound_override(&landSoundId); SoundEffects::Play(&manager->_sfxManager,landSoundId,1.0,2,0,1.0,0.0); (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); manager = g_manager; deathSoundId = 0x1e; seed_fart_sound_override(&deathSoundId); SoundEffects::Play(&manager->_sfxManager,deathSoundId,1.0,2,0,1.0,0.0); uVar7 = Random(); pEVar8 = Game::SpawnEx(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,3,uVar7,0); iVar10 = *(int *)pEVar8; (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -24.0; (**(code **)(iVar10 + 0xc))(); uVar7 = Random(); pEVar8 = Game::SpawnEx(g_game,1000,7,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7,0); (**(code **)(*(int *)pEVar8 + 0xc))(); uVar7 = Random(); for (pbStack_324 = (byte *)(uVar7 % 3 + 8); pbStack_324 != (byte *)0x0; pbStack_324 = pbStack_324 + -1) { uVar7 = Random(); fStack_30c = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; fStack_30c = fStack_30c + fStack_30c; fVar20 = cos(fStack_30c); pickupPos.x = fVar20 * 0.5 * npc->_size + (npc->_pos).x; fVar20 = sin(fStack_30c); pickupPos.y = fVar20 * 0.5 * npc->_size + (npc->_pos).y; uVar7 = Random(); fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; VStack_300.x = fVar20 + fVar20; uVar7 = Random(); VStack_2d4.x = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; VStack_2e8.x = cos(VStack_300.x); VStack_2e8.x = VStack_2e8.x * VStack_2d4.x; pickupVelocity.x = VStack_2e8.x; VStack_2e0.x = sin(VStack_300.x); VStack_2e0.x = VStack_2e0.x * VStack_2d4.x; pickupVelocity.y = VStack_2e0.x; fStack_30c = (float)Random(); VStack_2d4.x = (float)g_game; pickupSubtype = 0.0; pickupVariant = 5; fStack_308 = 1.4013e-42; lua_callback_run_pre_entity_spawn ((int *)&fStack_308,(int *)&pickupVariant,&pickupPos,&pickupVelocity,(Entity *)0x0, (int *)&pickupSubtype,(uint *)&fStack_30c); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00579eed: VStack_31c.x = pickupSubtype; } else { local_328 = (g_game->_deathmatchManager)._type; fVar9 = (float)Random(); fVar20 = pickupSubtype; rngShifts = 0x900000005; VStack_300.x = 9.80909e-45; rngShift3 = 7; VStack_2f0.x = fVar9; if (fStack_308 != 7.00649e-45) goto LAB_00579eed; if (pickupVariant < 0x12d) { if (pickupVariant == 300) { while ((VStack_31c.x = pickupSubtype, pickupSubtype == 0.0 || (cVar5 = (**(code **)(*local_328 + 0x24))(pickupSubtype), cVar5 != '\0'))) { if (VStack_2f0.x == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = (uint)VStack_2f0.x >> ((byte)rngShifts & 0x1f) ^ (uint)VStack_2f0.x; uVar7 = uVar7 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar7; fVar20 = (float)(uVar7 >> (SUB41(VStack_300.x,0) & 0x1f) ^ uVar7); VStack_2f0.x = fVar20; iVar10 = ItemPool::GetCardEx((int)fVar20,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)fVar20; pickupSubtype = (float)lua_callback_run_get_card(&cardRng,iVar10,1,1,0); } } else { if (pickupVariant == 0x46) { VStack_2cc.x = (float)((uint)pickupSubtype >> 0xb); do { if (pickupSubtype != 0.0) { pcVar1 = *(code **)(*local_328 + 0x28); VStack_31c.x = pickupSubtype; iVar10 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)pickupSubtype,(Entity_Player *)0x0); cVar5 = (*pcVar1)(iVar10); if (cVar5 == '\0') goto LAB_00579ef5; fVar9 = VStack_2f0.x; } VStack_31c.x = (float)&g_game->_itemPool; if (fVar9 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = (uint)fVar9 >> ((byte)rngShifts & 0x1f) ^ (uint)fVar9; uVar7 = uVar7 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar7; fVar9 = (float)(uVar7 >> (SUB41(VStack_300.x,0) & 0x1f) ^ uVar7); VStack_2f0.x = fVar9; uVar7 = ItemPool::GetPill((uint)fVar9); pickupSubtype = (float)(uVar7 | ((uint)VStack_2cc.x & 1) << 0xb); } while( true ); } if (pickupVariant != 100) goto LAB_00579eed; VStack_31c.x = pickupSubtype; if (pickupSubtype == 3.50325e-44) { LAB_00579d23: bVar19 = false; } else { collectibleKey = pickupSubtype; std::set::find_node(auStack_24c,&collectibleKey); if (((*(char *)(iStack_244 + 0xd) == '\0') && (*(int *)(iStack_244 + 0x10) <= (int)fVar20)) && (iStack_244 != local_328[8])) goto LAB_00579d23; bVar19 = true; } if ((fVar20 == 0.0) || (bVar19)) { VStack_31c.x = (float)(**(code **)(*local_328 + 0x84))(0); pickupSubtype = VStack_31c.x; } } } else { if (pickupVariant != 0x15e) goto LAB_00579eed; while ((VStack_31c.x = pickupSubtype, pickupSubtype == 0.0 || (cVar5 = (**(code **)(*local_328 + 0x2c))(pickupSubtype), cVar5 != '\0'))) { pickupSubtype = (float)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_00579ef5: VStack_300.x = (float)EntityFactory::Create (*(void **)((int)VStack_2d4.x + 0x26580),(uint)fStack_308,0); lVar2 = CONCAT44(VStack_2cc.x,VStack_2c0.x); if ((Entity *)VStack_300.x == (Entity *)0x0) { pEVar8 = (Entity *)0x0; } else { uVar22 = GetTimeNs(); fVar20 = VStack_300.x; uVar17 = (uint)(uVar22 >> 0x20); lVar2 = (uVar22 & 0xffffffff) * 0x431bde82; VStack_2c0.x = (float)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar17 * 0xd7b634db; VStack_2cc.x = (float)((ulonglong)lVar3 >> 0x20); uVar22 = lVar3 + ((uVar22 & 0xffffffff) * 0xd7b634db >> 0x20); uVar16 = (uint)(uVar22 >> 0x20); lVar2 = lVar2 + (uVar22 & 0xffffffff); VStack_2b8.x = (float)lVar2; uVar7 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = (ulonglong)uVar17 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar16,uVar7),uVar16 + uVar7); uVar7 = (uint)((ulonglong)lVar2 >> 0x20); VStack_2f0.x = (float)((uint)lVar2 >> 0x12 | uVar7 * 0x4000); local_328 = (int *)(uVar7 >> 0x12); spawnerPtr = (EntityPtr *)((int)VStack_300.x + 0x3c8); *(int *)((int)VStack_300.x + 0x34) = 0; *(int *)((int)VStack_300.x + 0x38) = 0; if (*spawnerPtr != (EntityPtr)0x0) { spawnerPtrRef = spawnerPtr; std::multiset::erase(&spawnerPtrRef); } iVar10 = *(int *)fVar20; *spawnerPtr = (EntityPtr)0x0; ((Vector *)((int)fVar20 + 0x33c))->x = pickupPos.x; ((Vector *)((int)fVar20 + 0x33c))->y = pickupPos.y; ((Vector *)((int)fVar20 + 0x360))->x = VStack_2e8.x; ((Vector *)((int)fVar20 + 0x360))->y = VStack_2e0.x; (**(code **)(iVar10 + 4))(fStack_308,pickupVariant,VStack_31c.x,fStack_30c); pvVar14 = *(void **)((int)VStack_2d4.x + 0x18300); iVar10 = *(int *)((int)pvVar14 + 0x1214); *(int *)((int)pvVar14 + 0x1214) = iVar10 + 1; *(int *)((int)fVar20 + 0x20) = iVar10; EntityList::AddEntity((EntityList *)((int)pvVar14 + 0x1218),(Entity *)fVar20); bVar6 = Game::ShouldEraseEnemy((Entity *)fVar20); if (bVar6 != 0) { Entity::RemoveWithPoof((Entity *)fVar20,unusedArg); } if ((*(byte *)((int)fVar20 + 0x172) != 0) && ((((ProceduralItemManager *)((int)VStack_2d4.x + 0x67758))->_proceduralItems)._begin != (((ProceduralItemManager *)((int)VStack_2d4.x + 0x67758))->_proceduralItems)._end)) { triggerKeyVariant = *(int *)((int)fVar20 + 0x2c); iVar10 = *(int *)((int)fVar20 + 0x28); spawnTriggerTargets = &((ProceduralItemManager *)((int)VStack_2d4.x + 0x67758))->_spawnTriggerTargets; triggerKeyType = iVar10; std::map::find(&pvStack_304,&triggerKeyType); if (pvStack_304 == spawnTriggerTargets->_head) { triggerKeyAnyVariant = 0xffffffff; triggerKeyTypeOnly = iVar10; piVar11 = (int *)std::map::find(auStack_250,&triggerKeyTypeOnly); pvStack_304 = (void *)*piVar11; if (pvStack_304 == spawnTriggerTargets->_head) goto LAB_0057a17c; } uVar7 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar14 = (playerManager->_playerList)._end; if ((int)pvVar14 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar14 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (uVar7 < (uint)((int)pvVar14 - (int)piVar11 >> 2)) { piVar11 = piVar11 + uVar7; } trigger_set_dispatch ((void *)(*piVar11 + 0x1fc8),6,(Entity *)VStack_300.x,&pickupPos, &pickupVelocity); uVar7 = uVar7 + 1; playerManager = &g_game->_playerManager; } while (uVar7 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0057a17c: uVar22 = GetTimeNs(); fStack_30c = (float)(uVar22 >> 0x20); lVar3 = (uVar22 & 0xffffffff) * 0x431bde82; VStack_2e8.x = (float)((ulonglong)lVar3 >> 0x20); VStack_2e0.x = (float)((ulonglong)(uint)fStack_30c * 0xd7b634db >> 0x20); lVar2 = (ulonglong)(uint)fStack_30c * 0x431bde82; uVar22 = (ulonglong)(uint)fStack_30c * 0xd7b634db + ((uVar22 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar22 >> 0x20); lVar3 = lVar3 + (uVar22 & 0xffffffff); VStack_2b8.x = (float)lVar3; uVar7 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar7),uVar17 + uVar7); uVar17 = (uint)((ulonglong)lVar3 >> 0x20); fVar20 = (float)((uint)lVar3 >> 0x12 | uVar17 * 0x4000); uVar7 = (int)fVar20 - (int)VStack_2f0.x; bVar19 = CARRY4((uint)g_entitySpawnTimeMs,uVar7); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar7; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar17 >> 0x12) - (int)local_328) - (uint)((uint)fVar20 < (uint)VStack_2f0.x)) + (uint)bVar19; pEVar8 = (Entity *)VStack_300.x; npc = (Entity_NPC *)local_2f8.x; } VStack_2cc.x = (float)((ulonglong)lVar2 >> 0x20); VStack_2c0.x = (float)lVar2; iVar10 = *(int *)pEVar8; (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -24.0; (**(code **)(iVar10 + 0xc))(); } cVar5 = *(char *)((int)&npc->_i1 + 1); if ((char)npc->_i1 == '\0') { pbStack_324 = (&PTR_s_Transition1_00b61f74)[cVar5]; } else { pbStack_324 = (&PTR_s_Transition1Alt_00b61f6c)[cVar5]; } pbVar18 = (npc->_sprite)._animState._animData; if (pbVar18 == (byte *)0x0) { LAB_0057a2ae: bVar6 = ANM2::SetAnimation(&npc->_sprite,pbStack_324,1); if (bVar6 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar12 = pbVar18; pbVar15 = pbStack_324; if (0xf < *(uint *)(pbVar18 + 0x14)) { pbVar12 = *(byte **)pbVar18; } do { bVar6 = *pbVar12; bVar19 = bVar6 < *pbVar15; if (bVar6 != *pbVar15) { LAB_0057a290: uVar7 = -(uint)bVar19 | 1; goto LAB_0057a295; } if (bVar6 == 0) break; bVar6 = pbVar12[1]; bVar19 = bVar6 < pbVar15[1]; if (bVar6 != pbVar15[1]) goto LAB_0057a290; pbVar12 = pbVar12 + 2; pbVar15 = pbVar15 + 2; } while (bVar6 != 0); uVar7 = 0; LAB_0057a295: if ((uVar7 != 0) || ((pbVar18[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_0057a2ae; } npc->_state = 0x10; npc->_projectileCooldown = 0; code_r0x0057a2df: local_328 = (int *)0x0; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined1 *)&npc->_i1 = 0; uVar7 = Random(); npc->_projectileCooldown = uVar7 % 0x1e + 0x1e; pcVar23 = (char *)((int)&npc->_i1 + 1); *pcVar23 = *pcVar23 + '\x01'; *(undefined1 *)((int)&npc->_i1 + 3) = 0; npc->_state = 3; } else { npc->_pendingDamage = 0.0; damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { fVar20 = *damageEvent; *damageEvent = fVar20 * 0.1; npc->_pendingDamage = fVar20 * 0.1 + npc->_pendingDamage; } } } iVar10 = npc->_state; if ((((iVar10 == 8) || (iVar10 == 9)) || (iVar10 == 10)) && (animState = &(npc->_sprite)._animState, (npc->_sprite)._animState._animData != (void *)0x0)) { bVar6 = AnimationState::IsEventTriggered(animState,s_Open); if (bVar6 == 0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar6 = AnimationState::IsEventTriggered(animState,(byte *)"Close"), bVar6 != 0)) { *(undefined1 *)&npc->_i1 = 0; } } else { Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); *(undefined1 *)&npc->_i1 = 1; } } if (npc->_state != 6) { (npc->_velocity).y = (*(float *)((int)g_game->_room + 0x18) + 8.0) - (npc->_pos).y; fVar20 = (npc->_velocity).x; if (fVar20 <= 1.0) { if (-1.0 <= fVar20) { pcVar23 = "WalkIdle"; } else { pcVar23 = "WalkLeft"; } } else { pcVar23 = "WalkRight"; } ANM2::PlayOverlay(&npc->_sprite,(byte *)pcVar23,0); } if (npc->_state != 7) { pEVar8 = Entity_NPC::GetPlayerTarget(npc); pRVar4 = room; cStack_31d = *(char *)((int)&npc->_i1 + 1); if (cStack_31d == '\x01') { fVar20 = (room->_topLeftPos).x + 80.0; VStack_31c.x = ((((room->_bottomRightPos).x - 80.0) - fVar20) * ((npc->_v1).x + 1.0) * 0.5 + fVar20) - (npc->_pos).x; } else { VStack_31c.x = (pEVar8->_pos).x - (npc->_pos).x; if ((npc->_state == 8) || (npc->_state == 10)) { if (VStack_31c.x < 0.0) { VStack_31c.x = VStack_31c.x - 20.0; } else if (0.0 < VStack_31c.x) { VStack_31c.x = VStack_31c.x + 20.0; } } else { VStack_31c.x = VStack_31c.x + (npc->_v1).x * 120.0; } } npc->_projectileDelay = npc->_projectileDelay + -1; if (npc->_projectileDelay < 1) { uVar7 = Random(); fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; (npc->_v1).x = (fVar20 + fVar20) - 1.0; uVar7 = Random(); npc->_projectileDelay = uVar7 % 0x1e + 10; } if (VStack_31c.x <= 40.0) { if (VStack_31c.x < -40.0) { cVar5 = -1; goto LAB_0057bcb6; } LAB_0057bcd9: npc->_stateFrame = npc->_stateFrame + -1; if (npc->_stateFrame < 1) { *(undefined1 *)((int)&npc->_i1 + 2) = 0; } } else { cVar5 = '\x01'; LAB_0057bcb6: currentStrafeDir = *(char *)((int)&npc->_i1 + 2); if ((currentStrafeDir != cVar5) && (currentStrafeDir != '\0')) goto LAB_0057bcd9; *(char *)((int)&npc->_i1 + 2) = cVar5; npc->_stateFrame = 6; } if (0.0 < (float)local_328) { if ((cStack_31d != '\x01') && (pEVar8 = Entity_NPC::GetPlayerTarget(npc), ABS((pEVar8->_pos).y - (npc->_pos).y) < 32.0)) { local_328 = (int *)0x3f800000; } cVar5 = *(char *)((int)&npc->_i1 + 2); if (cVar5 < '\x01') { if ((cVar5 < '\0') && ((pRVar4->_topLeftPos).x + 80.0 < (npc->_pos).x)) { (npc->_velocity).x = (npc->_velocity).x - (float)local_328 * 5.0 * npc->_speedMultiplier; } } else { fVar20 = (pRVar4->_bottomRightPos).x - 80.0; if ((npc->_pos).x <= fVar20 && fVar20 != (npc->_pos).x) { (npc->_velocity).x = (float)local_328 * 5.0 * npc->_speedMultiplier + (npc->_velocity).x; } } } } frictionScale = frictionScale * npc->_friction; LAB_0057bdca: npc->_friction = frictionScale; return; } //@@ 0057be30 FUN_0057be30 void FUN_0057be30(uint param_1) { uint uVar1; int in_ECX; if (0x7fffffff < param_1) { param_1 = 0xffffffff; } uVar1 = 7; if ((int)param_1 < 7) { uVar1 = param_1; } *(uint *)(in_ECX + 0x1831c) = uVar1; return; } //@@ 0057be60 FUN_0057be60 void FUN_0057be60(undefined4 param_1,undefined4 param_2) { int in_ECX; *(undefined4 *)(in_ECX + 0x18320) = param_1; *(undefined4 *)(in_ECX + 0x18324) = param_2; return; } //@@ 0057be90 FUN_0057be90 void FUN_0057be90(int param_1) { int iVar1; int in_ECX; if (param_1 < -0x13) { param_1 = -0x14; } iVar1 = 0xa8; if (param_1 < 0xa8) { iVar1 = param_1; } *(int *)(in_ECX + 0x18328) = iVar1; return; } //@@ 0057bec0 NpcAI::ENTITY_ROTGUT_face /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Rotgut face phase; was REPENTOGON Backdrop::pre_render_walls; strs Munch/FallIn/Attack1Begin */ void __fastcall NpcAI::ENTITY_ROTGUT_face(Entity_NPC *npc) { code *pcVar1; float *pfVar2; byte bVar3; char cVar4; EntityRef *entityRefPtr; Entity *spawned; byte *animName; Vector *randomPos; undefined *debrisColor; int attackPattern; uint uVar6; int iVar7; char *expectedAnimName; WeightedOutcomePicker WVar8; AnimationState *animState; uint uVar9; bool isNameLess; float fVar10; float fVar11; float fVar12; float fVar13; EntityRef entityRef; uint debrisSeed; undefined8 uStack_4b8; undefined4 uStack_4b0; uint attackSeed; undefined1 auStack_4a8 [8]; undefined4 uStack_4a0; Vector local_49c; Vector local_494; Vector local_48c; Vector local_484; Vector local_47c; Vector velocity; Vector local_46c; Vector local_464; Vector scratchVec; Vector local_454; float local_44c; float local_448; float local_444; float local_440; WeightedOutcomePicker picker; WeightedOutcomePicker pickerEnd; WeightedOutcomePicker pickerCapacity; float local_430; float local_42c; Room *local_428; float local_424; int elapsedFrames; byte isRotgutCleared; ProjectileParams munchParams; ProjectileParams crossParams; ProjectileParams reverseSpiralParams; ProjectileParams spiralParams; ProjectileParams debrisParams; ProjectileParams waveParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; WeightedOutcomePicker local_14; int attackPattern; RNG attackRng; RNG debrisRng; undefined4 flagsHigh; Game *game; int *outcomeWeight; Entity_Player *pulledEntity; float speedMultiplier; ColorMod *spriteColor; puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); local_14 = (WeightedOutcomePicker)0xffffffff; puStack_18 = &LAB_00af527b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&waveParams)[1].Spread; ExceptionList = &local_1c; local_428 = g_game->_room; isRotgutCleared = *(byte *)((int)local_428->_descriptor + 0x46) & 1; npc->_friction = 0.6; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; switch(npc->_state) { case 0: puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); Level::init_rotgut_dungeon_room(local_24); npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); if (isRotgutCleared != 0) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; entityRefPtr = EntityRef::EntityRef(&entityRef); (**(code **)(*(int *)npc + 0x24))(entityRefPtr); ExceptionList = local_1c; return; } break; default: puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); break; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,s_Idle,0); } attackPattern = npc->_stateFrame + 1; npc->_stateFrame = attackPattern; if (0x2d < attackPattern) { uVar6 = Random(); WVar8 = (WeightedOutcomePicker)(uVar6 % 0x14); if (WVar8 == (WeightedOutcomePicker)0x0) { npc->_stateFrame = 0; npc->_projectileDelay = -1; local_46c.y = 1.4013e-45; local_46c.x = (float)WVar8; picker = WVar8; pickerEnd = WVar8; pickerCapacity = WVar8; local_14 = WVar8; std::vector<8byte>::_Emplace_reallocate(0,&local_46c); if (npc->_projectileCooldown < 1) { uVar6 = 0; uVar9 = (int)pickerEnd - (int)picker >> 3; if (uVar9 != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 1) { outcomeWeight = (undefined4 *)((int)picker + 4) + uVar6 * 2; *outcomeWeight = *outcomeWeight + 1; if (*outcomeWeight < 0) { ((undefined4 *)((int)picker + 4))[uVar6 * 2] = 0; } goto LAB_0057c104; } uVar6 = uVar6 + 1; } while (uVar6 < uVar9); } local_46c.x = 1.4013e-45; local_46c.y = 1.4013e-45; if (pickerEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,&local_46c); } else { *(undefined4 *)pickerEnd = 1; *(undefined4 *)((int)pickerEnd + 4) = 1; pickerEnd = (WeightedOutcomePicker)((int)pickerEnd + 8); } } LAB_0057c104: uVar6 = 0; uVar9 = (int)pickerEnd - (int)picker >> 3; if (uVar9 != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 2) { outcomeWeight = (undefined4 *)((int)picker + 4) + uVar6 * 2; *outcomeWeight = *outcomeWeight + 1; if (*outcomeWeight < 0) { ((undefined4 *)((int)picker + 4))[uVar6 * 2] = 0; } goto LAB_0057c174; } uVar6 = uVar6 + 1; } while (uVar6 < uVar9); } local_46c.x = 2.8026e-45; local_46c.y = 1.4013e-45; if (pickerEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,&local_46c); } else { *(undefined4 *)pickerEnd = 2; *(undefined4 *)((int)pickerEnd + 4) = 1; pickerEnd = (WeightedOutcomePicker)((int)pickerEnd + 8); } LAB_0057c174: attackSeed = Random(); attackSeed = attackSeed | 1; auStack_4a8 = (undefined1 [8])0x900000005; uStack_4a0 = 7; attackRng._shift1 = 5; attackRng._seed = attackSeed; attackRng._shift2 = 9; attackRng._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&picker,attackRng); if (uVar6 == 0) { ANM2::Play(&npc->_sprite,(byte *)"Attack1Begin",0); npc->_state = 8; uVar6 = Random(); npc->_i1 = uVar6 % 3; } else if (uVar6 == 1) { ANM2::Play(&npc->_sprite,(byte *)"Attack2Begin",0); npc->_state = 9; npc->_i1 = 0; } else if (uVar6 == 2) { ANM2::Play(&npc->_sprite,(byte *)"Munch",0); npc->_state = 10; uVar6 = Random(); npc->_i1 = uVar6 & 1; } local_14 = (WeightedOutcomePicker)0xffffffff; if (picker != (WeightedOutcomePicker)0x0) { uVar6 = (int)pickerCapacity - (int)picker & 0xfffffff8; WVar8 = picker; if (0xfff < uVar6) { WVar8 = *(WeightedOutcomePicker *)((int)picker + -4); uVar6 = uVar6 + 0x23; if (0x1f < ((int)picker - (int)WVar8) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)WVar8,uVar6); } } } break; case 8: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)"Attack1Loop",0); if ((npc->_sprite)._animState._animData != (void *)0x0) goto LAB_0057c42e; } else { LAB_0057c42e: bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound1"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { npc->_projectileDelay = 0; Entity_NPC::PlaySound(npc,0x74,1.0,2,0,1.0); } attackPattern = npc->_projectileDelay; if (-1 < attackPattern) { local_42c = 0.0; local_454.x = (npc->_pos).x + 0.0; local_454.y = (npc->_pos).y + 10.0; if (0 < elapsedFrames) { local_448 = 4.2039e-45; local_430 = 1.96182e-44; local_424 = 3.92364e-44; iVar7 = elapsedFrames; LAB_0057c520: if (npc->_state == 8) { attackPattern = npc->_i1; if (attackPattern == 0) { if (attackPattern % (int)local_430 == 0) { iVar7 = 8; if (attackPattern % (int)local_424 == 0) { local_428 = (Room *)(float)attackPattern; do { local_428 = (Room *)((float)local_428 + 45.0); ProjectileParams::ProjectileParams(&spiralParams); spiralParams.FallingAccelModifier = spiralParams.FallingAccelModifier - 0.12; spiralParams.Color._offset[2] = DAT_00c34f00; spiralParams.BulletFlags._0_4_ = 0x40080; spiralParams.BulletFlags._4_4_ = 0; spiralParams.CurvingStrength = 0.006; spiralParams.Color._tint[0] = _DAT_00c34ed8; spiralParams.Color._tint[1] = fRam00c34edc; spiralParams.Color._tint[2] = fRam00c34ee0; spiralParams.Color._tint[3] = fRam00c34ee4; spiralParams.Color._colorize[0] = _DAT_00c34ee8; spiralParams.Color._colorize[1] = fRam00c34eec; spiralParams.Color._colorize[2] = fRam00c34ef0; spiralParams.Color._colorize[3] = fRam00c34ef4; spiralParams.Color._offset[0] = (float)DAT_00c34ef8; spiralParams.Color._offset[1] = DAT_00c34ef8._4_4_; local_44c = (float)local_428 * 0.017453292; local_48c.x = cos(local_44c); local_48c.x = local_48c.x * 6.0; local_48c.y = sin(local_44c); local_48c.y = local_48c.y * 6.0; Entity_NPC::FireProjectiles(npc,&local_454,&local_48c,0,&spiralParams); iVar7 = iVar7 + -1; } while (iVar7 != 0); } else { local_428 = (Room *)(float)-attackPattern; do { local_428 = (Room *)((float)local_428 - 45.0); ProjectileParams::ProjectileParams(&reverseSpiralParams); reverseSpiralParams.FallingAccelModifier = reverseSpiralParams.FallingAccelModifier - 0.12; reverseSpiralParams.Color._offset[2] = DAT_00c34d48; reverseSpiralParams.BulletFlags._0_4_ = 0x80080; reverseSpiralParams.BulletFlags._4_4_ = 0; reverseSpiralParams.CurvingStrength = 0.006; reverseSpiralParams.Color._tint[0] = _DAT_00c34d20; reverseSpiralParams.Color._tint[1] = fRam00c34d24; reverseSpiralParams.Color._tint[2] = fRam00c34d28; reverseSpiralParams.Color._tint[3] = fRam00c34d2c; reverseSpiralParams.Color._colorize[0] = _DAT_00c34d30; reverseSpiralParams.Color._colorize[1] = fRam00c34d34; reverseSpiralParams.Color._colorize[2] = fRam00c34d38; reverseSpiralParams.Color._colorize[3] = fRam00c34d3c; reverseSpiralParams.Color._offset[0] = (float)DAT_00c34d40; reverseSpiralParams.Color._offset[1] = DAT_00c34d40._4_4_; local_44c = (float)local_428 * 0.017453292; local_494.x = cos(local_44c); local_494.x = local_494.x * 6.0; local_494.y = sin(local_44c); local_494.y = local_494.y * 6.0; Entity_NPC::FireProjectiles(npc,&local_454,&local_494,0,&reverseSpiralParams); iVar7 = iVar7 + -1; } while (iVar7 != 0); } } if (npc->_projectileDelay < 0xb4) goto LAB_0057cc83; animName = (npc->_sprite)._animState._animData; if (animName == (byte *)0x0) goto LAB_0057cc58; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnimName = "Attack1End"; do { bVar3 = *animName; isNameLess = bVar3 < (byte)*expectedAnimName; if (bVar3 != *expectedAnimName) goto LAB_0057cc40; if (bVar3 == 0) break; bVar3 = animName[1]; isNameLess = bVar3 < (byte)expectedAnimName[1]; if (bVar3 != expectedAnimName[1]) goto LAB_0057cc40; animName = animName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar3 != 0); LAB_0057cc3c: uVar6 = 0; goto LAB_0057cc45; } if (attackPattern == 1) { if (attackPattern % (int)local_448 == 0) { fVar10 = sin((float)attackPattern * 6.0); local_428 = (Room *)(fVar10 * 45.0); attackPattern = 4; do { local_428 = (Room *)((float)local_428 + 90.0); ProjectileParams::ProjectileParams(&crossParams); crossParams.FallingAccelModifier = crossParams.FallingAccelModifier - 0.12; crossParams.BulletFlags._0_4_ = 0x200080; crossParams.BulletFlags._4_4_ = 0; crossParams.Color._offset[2] = DAT_00c34f00; crossParams.Color._tint[0] = _DAT_00c34ed8; crossParams.Color._tint[1] = fRam00c34edc; crossParams.Color._tint[2] = fRam00c34ee0; crossParams.Color._tint[3] = fRam00c34ee4; crossParams.Color._colorize[0] = _DAT_00c34ee8; crossParams.Color._colorize[1] = fRam00c34eec; crossParams.Color._colorize[2] = fRam00c34ef0; crossParams.Color._colorize[3] = fRam00c34ef4; crossParams.Color._offset[0] = (float)DAT_00c34ef8; crossParams.Color._offset[1] = DAT_00c34ef8._4_4_; local_44c = (float)local_428 * 0.017453292; local_484.x = cos(local_44c); local_484.x = local_484.x * 6.0; local_484.y = sin(local_44c); local_484.y = local_484.y * 6.0; Entity_NPC::FireProjectiles(npc,&local_454,&local_484,0,&crossParams); attackPattern = attackPattern + -1; } while (attackPattern != 0); attackPattern = npc->_projectileDelay; } if (attackPattern < 0xb4) goto LAB_0057cc83; animName = (npc->_sprite)._animState._animData; if (animName != (byte *)0x0) { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnimName = "Attack1End"; do { bVar3 = *animName; isNameLess = bVar3 < (byte)*expectedAnimName; if (bVar3 != *expectedAnimName) goto LAB_0057cc40; if (bVar3 == 0) goto LAB_0057cc3c; bVar3 = animName[1]; isNameLess = bVar3 < (byte)expectedAnimName[1]; if (bVar3 != expectedAnimName[1]) goto LAB_0057cc40; animName = animName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar3 != 0); uVar6 = 0; goto LAB_0057cc45; } goto LAB_0057cc58; } if (attackPattern == 2) { if (attackPattern % (int)local_448 == 0) { local_440 = (float)attackPattern * 8.0; local_444 = 180.0 - local_440; ProjectileParams::ProjectileParams(&waveParams); waveParams.FallingAccelModifier = waveParams.FallingAccelModifier - 0.12; waveParams.BulletFlags._0_4_ = 0x80; waveParams.BulletFlags._4_4_ = 0; waveParams.Color._offset[2] = DAT_00c34f00; waveParams.TargetPosition.x = local_454.x; waveParams.TargetPosition.y = local_454.y; waveParams.Color._tint[0] = _DAT_00c34ed8; waveParams.Color._tint[1] = fRam00c34edc; waveParams.Color._tint[2] = fRam00c34ee0; waveParams.Color._tint[3] = fRam00c34ee4; waveParams.Color._colorize[0] = _DAT_00c34ee8; waveParams.Color._colorize[1] = fRam00c34eec; waveParams.Color._colorize[2] = fRam00c34ef0; waveParams.Color._colorize[3] = fRam00c34ef4; waveParams.Color._offset[0] = (float)DAT_00c34ef8; waveParams.Color._offset[1] = DAT_00c34ef8._4_4_; local_440 = local_440 * 0.017453292; fVar10 = cos(local_440); local_46c.x = fVar10 * 6.0; local_46c.y = sin(local_440); local_46c.y = local_46c.y * 6.0; Entity_NPC::FireProjectiles(npc,&local_454,&local_46c,0,&waveParams); local_444 = local_444 * 0.017453292; local_464.x = cos(local_444); local_464.x = local_464.x * 6.0; local_464.y = sin(local_444); local_464.y = local_464.y * 6.0; Entity_NPC::FireProjectiles(npc,&local_454,&local_464,0,&waveParams); waveParams.Scale = 1.5; waveParams.Color._tint[0] = _DAT_00c34d20; waveParams.Color._tint[1] = fRam00c34d24; waveParams.Color._tint[2] = fRam00c34d28; waveParams.Color._tint[3] = fRam00c34d2c; waveParams.Color._offset[2] = DAT_00c34d48; waveParams.Color._colorize[0] = _DAT_00c34d30; waveParams.Color._colorize[1] = fRam00c34d34; waveParams.Color._colorize[2] = fRam00c34d38; waveParams.Color._colorize[3] = fRam00c34d3c; waveParams.Color._offset[0] = (float)DAT_00c34d40; waveParams.Color._offset[1] = DAT_00c34d40._4_4_; velocity.x = cos(local_440); velocity.x = velocity.x * 8.0; velocity.y = sin(local_440); velocity.y = velocity.y * 8.0; Entity_NPC::FireProjectiles(npc,&local_454,&velocity,0,&waveParams); local_47c.x = cos(local_444); local_47c.x = local_47c.x * 8.0; local_47c.y = sin(local_444); local_47c.y = local_47c.y * 8.0; Entity_NPC::FireProjectiles(npc,&local_454,&local_47c,0,&waveParams); attackPattern = npc->_projectileDelay; } if (0xb3 < attackPattern) { animName = (npc->_sprite)._animState._animData; if (animName != (byte *)0x0) { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedAnimName = "Attack1End"; do { bVar3 = *animName; isNameLess = bVar3 < (byte)*expectedAnimName; if (bVar3 != *expectedAnimName) goto LAB_0057cc40; if (bVar3 == 0) goto LAB_0057cc3c; bVar3 = animName[1]; isNameLess = bVar3 < (byte)expectedAnimName[1]; if (bVar3 != expectedAnimName[1]) goto LAB_0057cc40; animName = animName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar3 != 0); uVar6 = 0; goto LAB_0057cc45; } goto LAB_0057cc58; } goto LAB_0057cc83; } goto LAB_0057cc89; } break; } } break; case 9: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2), (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); ANM2::Play(&npc->_sprite,(byte *)"Attack2Loop",0); if ((npc->_sprite)._animState._animData != (void *)0x0) goto LAB_0057cce0; } else { LAB_0057cce0: bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x137,1.0,10,0,0.9); npc->_projectileDelay = 0; } } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Sound1"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0xa7,1.0,10,0,0.6); } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Sound2"), bVar3 != 0)) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } } uVar6 = npc->_projectileDelay; if (-1 < (int)uVar6) { local_440 = 0.0; attackPattern = elapsedFrames; if (0 < elapsedFrames) { do { if ((uVar6 & 1) != 0) goto LAB_0057d676; local_424 = (npc->_pos).x + 0.0; local_430 = (npc->_pos).y - 4.0; randomPos = Room::GetRandomPosition(local_428,(Vector *)(auStack_4a8 + 4),10.0); picker = (WeightedOutcomePicker)0x0; pickerEnd = (WeightedOutcomePicker)0x0; pickerCapacity = (WeightedOutcomePicker)0x0; local_464.x = (randomPos->x - local_424) * 0.024; local_464.y = (randomPos->y - local_430) * 0.024; local_14 = (WeightedOutcomePicker)0x1; local_494.x = 0.0; local_494.y = 9.10844e-44; std::vector<8byte>::_Emplace_reallocate(0,&local_494); uVar6 = 0; uVar9 = (int)pickerEnd - (int)picker >> 3; if (uVar9 != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 1) { outcomeWeight = (undefined4 *)((int)picker + 4) + uVar6 * 2; *outcomeWeight = *outcomeWeight + 0x14; if (*outcomeWeight < 0) { ((undefined4 *)((int)picker + 4))[uVar6 * 2] = 0; } goto LAB_0057cf30; } uVar6 = uVar6 + 1; } while (uVar6 < uVar9); } local_48c.x = 1.4013e-45; local_48c.y = 2.8026e-44; if (pickerEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,&local_48c); } else { *(undefined4 *)pickerEnd = 1; *(undefined4 *)((int)pickerEnd + 4) = 0x14; pickerEnd = (WeightedOutcomePicker)((int)pickerEnd + 8); } LAB_0057cf30: uVar6 = 0; uVar9 = (int)pickerEnd - (int)picker >> 3; if (uVar9 != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 2) { outcomeWeight = (undefined4 *)((int)picker + 4) + uVar6 * 2; *outcomeWeight = *outcomeWeight + 10; if (*outcomeWeight < 0) { ((undefined4 *)((int)picker + 4))[uVar6 * 2] = 0; } goto LAB_0057cfaf; } uVar6 = uVar6 + 1; } while (uVar6 < uVar9); } local_484.x = 2.8026e-45; local_484.y = 1.4013e-44; if (pickerEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,&local_484); } else { *(undefined4 *)pickerEnd = 2; *(undefined4 *)((int)pickerEnd + 4) = 10; pickerEnd = (WeightedOutcomePicker)((int)pickerEnd + 8); } LAB_0057cfaf: uVar6 = 0; uVar9 = (int)pickerEnd - (int)picker >> 3; if (uVar9 != 0) { do { if (*(int *)((int)picker + uVar6 * 8) == 3) { outcomeWeight = (undefined4 *)((int)picker + 4) + uVar6 * 2; *outcomeWeight = *outcomeWeight + 5; if (*outcomeWeight < 0) { ((undefined4 *)((int)picker + 4))[uVar6 * 2] = 0; } goto LAB_0057d023; } uVar6 = uVar6 + 1; } while (uVar6 < uVar9); } local_47c.x = 4.2039e-45; local_47c.y = 7.00649e-45; if (pickerEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,&local_47c); } else { *(undefined4 *)pickerEnd = 3; *(undefined4 *)((int)pickerEnd + 4) = 5; pickerEnd = (WeightedOutcomePicker)((int)pickerEnd + 8); } LAB_0057d023: ProjectileParams::ProjectileParams(&debrisParams); uVar6 = Random(); debrisParams.FallingSpeedModifier = -60.0; debrisParams.FallingAccelModifier = 2.0; debrisParams.HeightModifier = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * -8.0; debrisSeed = Random(); debrisSeed = debrisSeed | 1; uStack_4b8 = 0x900000005; uStack_4b0 = 7; debrisRng._shift1 = 5; debrisRng._seed = debrisSeed; debrisRng._shift2 = 9; debrisRng._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&picker,debrisRng); switch(uVar6) { case 0: debrisParams.Scale = 2.0; debrisParams.Variant = 3; break; case 1: debrisParams.Variant = 1; break; case 2: spawn_small_maggot(&npc->_pos,-60.0,&local_464,-20.0); goto switchD_0057d0bf_default; case 3: debrisParams.Variant = 0xb; break; default: goto switchD_0057d0bf_default; } Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_464,0,&debrisParams); switchD_0057d0bf_default: uVar6 = Random(); local_424 = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 * 0.017453292; local_430 = cos(local_424); fVar10 = sin(local_424); local_424 = local_430 * 0.0 - fVar10 * -1.0; local_430 = fVar10 * 0.0 - local_430 * 1.0; uVar6 = Random(); velocity.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 8.0; velocity.x = local_424 * velocity.y; velocity.y = local_430 * velocity.y; local_44c = ((float)npc->_projectileDelay - 0.0) / 90.0; if (local_44c <= 0.0) { local_44c = 0.0; } if (1.0 <= local_44c) { local_44c = 1.0; } uVar6 = Random(); local_42c = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; uVar6 = Random(); local_424 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_424 = local_424 + local_424; local_430 = sin(local_424); fVar10 = cos(local_424); local_424 = fVar10 * 4.0 + 0.0; local_430 = ((-14.0 - local_44c * 26.0) - local_42c * 16.0) + local_430 * 4.0; uVar6 = Random(); spawned = Game::Spawn(g_game,1000,2,&npc->_pos,&velocity,(Entity *)0x0,4,uVar6); (**(code **)(*(int *)spawned + 0x3c))(&DAT_00c34c9c,0xffffffff,0xff,0,1); (spawned->_sprite)._offset.x = local_424; (spawned->_sprite)._offset.y = local_430; spawned->_renderDepthOffset = 10.0; spawned->_renderZOffset = 500; uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar10 = fVar13 * g_vectorOne.x; (spawned->_sprite)._scale.y = fVar13 * g_vectorOne.y; (spawned->_sprite)._scale.x = fVar10; uVar6 = Random(); if ((uVar6 & 7) == 0) { uVar6 = Random(); local_424 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_424 = local_424 + local_424; local_444 = sin(local_424); local_448 = cos(local_424); uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_46c.y = fVar10 * local_444 * 12.0 + (npc->_pos).y; local_46c.x = fVar10 * local_448 * 12.0 + (npc->_pos).x; uVar6 = Random(); if (uVar6 % 5 == 0) { uVar6 = Random(); uVar9 = Random(); local_49c.x = local_448 * 5.0; local_49c.y = local_444 * 5.0; spawned = Game::Spawn(g_game,1000,5,&local_46c,&local_49c,(Entity *)0x0, (uVar9 & 1) + 1,uVar6); } else { uVar6 = Random(); scratchVec.x = local_448 * 5.0; scratchVec.y = local_444 * 5.0; spawned = Game::Spawn(g_game,1000,5,&local_46c,&scratchVec,(Entity *)0x0,0,uVar6); fVar11 = fRam00c34ca8; fVar13 = fRam00c34ca4; fVar10 = fRam00c34ca0; spriteColor = &(spawned->_sprite)._color; if (spriteColor != (ColorMod *)&DAT_00c34c9c) { spriteColor->_tint[0] = _DAT_00c34c9c; (spawned->_sprite)._color._tint[1] = fVar10; (spawned->_sprite)._color._tint[2] = fVar13; (spawned->_sprite)._color._tint[3] = fVar11; fVar11 = fRam00c34cb8; fVar13 = fRam00c34cb4; fVar10 = fRam00c34cb0; (spawned->_sprite)._color._colorize[0] = _DAT_00c34cac; (spawned->_sprite)._color._colorize[1] = fVar10; (spawned->_sprite)._color._colorize[2] = fVar13; (spawned->_sprite)._color._colorize[3] = fVar11; fVar10 = DAT_00c34cbc._4_4_; (spawned->_sprite)._color._offset[0] = (float)DAT_00c34cbc; (spawned->_sprite)._color._offset[1] = fVar10; (spawned->_sprite)._color._offset[2] = DAT_00c34cc4; } } attackPattern = *(int *)spawned; (spawned->_posOffset).x = 0.0; (spawned->_posOffset).y = -60.0; (**(code **)(attackPattern + 0xc))(); } Game::ShakeScreen(g_game,4); local_14 = (WeightedOutcomePicker)0xffffffff; if (picker != (WeightedOutcomePicker)0x0) { deallocate((void *)picker,(int)pickerCapacity - (int)picker >> 3); picker = (WeightedOutcomePicker)0x0; pickerEnd = (WeightedOutcomePicker)0x0; pickerCapacity = (WeightedOutcomePicker)0x0; } attackPattern = elapsedFrames; LAB_0057d676: if (0x59 < npc->_projectileDelay) { npc->_projectileCooldown = 0xf0; ANM2::Play(&npc->_sprite,(byte *)"Attack2End",0); npc->_state = 3; break; } local_440 = (float)((int)local_440 + 1); uVar6 = npc->_projectileDelay + 1; npc->_projectileDelay = uVar6; } while ((int)local_440 < attackPattern); } } break; case 10: puStack_20 = (undefined1 *)((&waveParams)[1].Color._tint + 2); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Game::ShakeScreen(g_game,8); local_464.x = (npc->_pos).x + 0.0; local_464.y = (npc->_pos).y + 10.0; Entity_NPC::PlaySound(npc,0x8e,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); npc->_projectileDelay = 0; ProjectileParams::ProjectileParams(&munchParams); munchParams.FallingAccelModifier = -0.12; if (npc->_i1 == 0) { attackPattern = npc->_stateFrame; if (attackPattern == 0) { Color::operator_assign((Color *)&munchParams.Color,(ColorMod *)&DAT_00c34ed8); munchParams.Scale = 1.5; scratchVec.x = 5.0; scratchVec.y = 18.0; } else { if (attackPattern != 1) { if (attackPattern == 2) { local_42c = 3.08286e-44; do { uVar6 = Random(); local_424 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_424 = local_424 + local_424; local_430 = cos(local_424); local_424 = sin(local_424); uVar6 = Random(); local_49c.x = local_430 * 5.0 + (npc->_pos).x; scratchVec.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 ; scratchVec.x = local_430 * 15.0 * scratchVec.y; local_49c.y = local_424 * 5.0 + (npc->_pos).y; scratchVec.y = local_424 * 15.0 * scratchVec.y; uVar6 = Random(); spawned = Game::Spawn(g_game,9,0,&local_49c,&scratchVec,(Entity *)npc,0,uVar6); uVar6 = Random(); spawned[1]._damageEvents._begin = (void *)0x0; *(float *)&spawned[1].field_0x4 = -22.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 8.0; uVar6 = Random(); spawned[1]._damageEvents._end = (void *)(-0.06 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.030000005); uVar6 = Random(); attackPattern = *(int *)spawned; debrisColor = &DAT_00c34d20; fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 1.1999999 + 0.6; spawned[1]._variant = 0; spawned[1]._subtype = 0x20; spawned[1]._index = 0x3f666666; spawned[1]._pendingDamage = fVar10; if (fVar10 <= 1.2) { debrisColor = &DAT_00c34ed8; } (**(code **)(attackPattern + 0x3c))(debrisColor,0xffffffff,0xff,0,1); if ((npc->_flags & 0x80) != 0) { spawned[1]._variant = spawned[1]._variant | 0x1000000; spawned[1]._subtype = spawned[1]._subtype; } local_42c = (float)((int)local_42c + -1); } while (local_42c != 0.0); local_42c = 0.0; } goto LAB_0057dd48; } scratchVec.x = 10.0; scratchVec.y = 9.0; } Entity_NPC::FireProjectiles(npc,&local_464,&scratchVec,9,&munchParams); } else { ProjectileParams::ProjectileParams(&debrisParams); debrisParams.FallingAccelModifier = 0.2; attackPattern = 0x14; do { uVar6 = Random(); local_42c = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0) * 0.017453292; uVar6 = Random(); local_428 = (Room *)((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 ); fVar10 = cos(local_42c); local_454.x = fVar10 * (float)local_428 * 20.0; fVar10 = sin(local_42c); local_454.y = fVar10 * (float)local_428 * 20.0; uVar6 = Random(); debrisParams.FallingSpeedModifier = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * -2.3283064e-10 * 4.0; uVar6 = Random(); debrisParams.Scale = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.7 + 0.8; Entity_NPC::FireProjectiles(npc,&local_464,&local_454,0,&debrisParams); uVar6 = Random(); local_42c = (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 30.0 + 180.0) - 15.0) * 0.017453292; uVar6 = Random(); local_428 = (Room *)((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 ); fVar10 = cos(local_42c); local_424 = fVar10 * (float)local_428 * 20.0; fVar10 = sin(local_42c); local_454.x = local_424; local_454.y = fVar10 * (float)local_428 * 20.0; uVar6 = Random(); debrisParams.FallingSpeedModifier = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * -2.3283064e-10 * 4.0; uVar6 = Random(); debrisParams.Scale = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.7 + 0.8; Entity_NPC::FireProjectiles(npc,&local_464,&local_454,0,&debrisParams); attackPattern = attackPattern + -1; } while (attackPattern != 0); } LAB_0057dd48: scratchVec.x = 0.0; uVar6 = Random(); scratchVec.y = -54.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 16.0; spawned = spawn_blood_explosion(4,&npc->_pos,&scratchVec,&g_colorGreenSplat,&g_vectorZero); spawned->_renderZOffset = 500; } attackPattern = ANM2::GetFrame(&npc->_sprite); if (((attackPattern == 0xf) && (npc->_i1 == 0)) && (npc->_stateFrame < 2)) { npc->_stateFrame = npc->_stateFrame + 1; Sprite::SetFrame_1((Sprite *)&npc->_sprite,4); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0xf; } break; case 0x10: if (((npc->_sprite)._animState._animData == (void *)0x0) || (pfVar2 = (&waveParams)[1].Color._tint + 2, (npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"TransitionLoop",0); pfVar2 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar2; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x133,1.0,2,0,1.0); npc->_projectileDelay = 0; } if (-1 < npc->_stateFrame) { attackPattern = npc->_stateFrame + elapsedFrames; npc->_stateFrame = attackPattern; game = g_game; if (0x13 < attackPattern) { g_game->_enterDoor = -1; fVar10 = (npc->_pos).y; (game->_dungeonReturnPosition).x = (npc->_pos).x; (game->_dungeonReturnPosition).y = fVar10; FUN_0057be90(game->_currentRoomIdx); Game::StartRoomTransition(game,-0xe,-1,2,(Entity_Player *)0x0,-1); } } attackPattern = npc->_projectileDelay; if (-1 < attackPattern) { if (0 < elapsedFrames) { local_448 = 4.2039e-45; local_424 = 8.40779e-45; iVar7 = elapsedFrames; do { if (attackPattern % (int)local_424 == 0) { uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6); (**(code **)(*(int *)spawned + 0xc))(); attackPattern = npc->_projectileDelay; } if (attackPattern % (int)local_448 == 0) { uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)0x0,1,uVar6); (**(code **)(*(int *)spawned + 0xc))(); attackPattern = npc->_projectileDelay; } attackPattern = attackPattern + 1; npc->_projectileDelay = attackPattern; iVar7 = iVar7 + -1; } while (iVar7 != 0); } local_440 = 1.0; if ((0x5a < attackPattern) && (local_440 = (float)(attackPattern + -0x5a) / 30.0 + 1.0, 8.0 <= local_440)) { local_440 = 8.0; } local_44c = 0.0; if ((local_428->_entityList)._updateEL._size != 0) { do { pulledEntity = *(Entity_Player **) ((int)(local_428->_entityList)._updateEL._data + (int)local_44c * 4); local_454.y = (float)pulledEntity; if ((pulledEntity != (Entity_Player *)npc) && ((((bVar3 = Entity::IsActiveEnemy((Entity *)pulledEntity,0), bVar3 != 0 || (attackPattern = pulledEntity->_type, attackPattern == 1)) || (attackPattern == 2)) || (attackPattern == 9)))) { if ((pulledEntity->_type == 1) && (pulledEntity->_pitfallState != 0)) { fVar10 = (npc->_pos).y; fVar13 = (pulledEntity->_pos).y; (pulledEntity->_velocity).x = ((npc->_pos).x - (pulledEntity->_pos).x) * 0.5; (pulledEntity->_velocity).y = (fVar10 - fVar13) * 0.5; } else { local_430 = (pulledEntity->_pos).x; local_464.y = (pulledEntity->_pos).y; local_42c = (npc->_pos).x - local_430; local_424 = (npc->_pos).y; local_444 = local_424 - local_464.y; fVar10 = local_444 * local_444 + local_42c * local_42c; local_448 = 2.0 / (fVar10 * 0.0001 + 1.0); fVar11 = sqrtf(fVar10); fVar10 = local_42c; fVar13 = local_444; if (0.0 < fVar11) { fVar13 = local_444 * (1.0 / fVar11); fVar10 = local_42c * (1.0 / fVar11); } if (pulledEntity->_type == 1) { fVar11 = 0.8; if (local_448 * 1.4 <= 0.8) { fVar11 = local_448 * 1.4; } fVar12 = pulledEntity->_mass; if (1.0 <= fVar12) { fVar12 = 1.0; } fVar11 = fVar11 / fVar12; } else { fVar11 = local_448; if (pulledEntity->_type == 2) { fVar11 = local_448 * 0.7; } } fVar12 = pulledEntity->_friction; if (fVar12 == 0.0) { fVar13 = local_430; fVar11 = local_464.y; fVar10 = local_424; } else { speedMultiplier = pulledEntity->_speedMultiplier; (pulledEntity->_velocity).y = (speedMultiplier * fVar11 * local_440 * fVar13) / fVar12 + (pulledEntity->_velocity).y; (pulledEntity->_velocity).x = (speedMultiplier * fVar11 * local_440 * fVar10) / fVar12 + (pulledEntity->_velocity).x; fVar13 = (pulledEntity->_pos).x; fVar11 = (pulledEntity->_pos).y; fVar10 = (npc->_pos).y; } fVar13 = (npc->_pos).x - fVar13; if ((fVar10 - fVar11) * (fVar10 - fVar11) + fVar13 * fVar13 < 400.0) { if ((((*(int *)&g_game->_deathmatchManager < 2) || (pulledEntity->_type != 1)) && (0x3dd < pulledEntity->_type - 10U)) || (cVar4 = (**(code **)(*(int *)pulledEntity + 0x4c))(), cVar4 != '\0')) { attackPattern = pulledEntity->_type; if ((attackPattern == 2) || (attackPattern == 9)) { (**(code **)(*(int *)pulledEntity + 0x28))(); } else if ((((attackPattern == 1) && (pulledEntity->_variant == 0)) && (pulledEntity->_dead == 0)) && (pulledEntity->_pitfallState == 0)) { Entity_Player::PlayExtraAnimation(pulledEntity,(byte *)"FallIn"); pulledEntity->_isControlsEnabled = 0; pulledEntity->_entityCollisionClass = 0; pulledEntity->_pitfallState = 4; pulledEntity->_pitfallTimer = 0; if (npc->_stateFrame < 0) { npc->_stateFrame = 0; } } } else { pcVar1 = *(code **)(*(int *)pulledEntity + 0x24); EntityRef::constructor(&entityRef,(Entity *)npc); (*pcVar1)(&entityRef); } } } } local_44c = (float)((int)local_44c + 1); } while ((uint)local_44c < (uint)(local_428->_entityList)._updateEL._size); } } } LAB_0057c295: fVar10 = (npc->_targetPosition).y; fVar13 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar10 - fVar13; if (0 < npc->_projectileCooldown) { iVar7 = npc->_projectileCooldown - elapsedFrames; attackPattern = 0; if (0 < iVar7) { attackPattern = iVar7; } npc->_projectileCooldown = attackPattern; } if ((isRotgutCleared == 0) && ((npc->_dead != 0 || (npc->_health <= 0.0)))) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; npc->_state = 0x10; npc->_dead = 0; npc->_health = 0.001; npc->_entityCollisionClass = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_isInvicible = 1; npc->_projectileDelay = -1; npc->_stateFrame = -1; npc->_renderZOffset = -500; Entity_NPC::PlaySound(npc,0x70,1.0,2,0,1.0); ANM2::Play(&npc->_sprite,(byte *)"Transition",0); Entity_NPC::PlaySound(npc,0x1c,1.0,2,0,1.0); scratchVec.x = 0.0; scratchVec.y = -4.0; spawned = spawn_blood_explosion(4,&npc->_pos,&scratchVec,&g_colorGreenSplat,&g_vectorZero); spawned->_renderZOffset = 500; Entity::BloodExplode((Entity *)npc); } ExceptionList = local_1c; return; LAB_0057cc40: uVar6 = -(uint)isNameLess | 1; LAB_0057cc45: if ((uVar6 != 0) || ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) != '\0' && ((npc->_sprite)._animState._isPlaying == 0)))) { LAB_0057cc58: bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Attack1End",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } npc->_state = 3; LAB_0057cc83: iVar7 = elapsedFrames; LAB_0057cc89: npc->_projectileDelay = npc->_projectileDelay + 1; local_42c = (float)((int)local_42c + 1); attackPattern = npc->_projectileDelay; if (iVar7 <= (int)local_42c) goto LAB_0057c295; goto LAB_0057c520; } //@@ 0057e3b0 FUN_0057e3b0 void FUN_0057e3b0(float *param_1) { Vector *pVVar1; Entity *in_ECX; Vector local_20; float local_18; float local_14; float local_10; float local_c; local_c = (in_ECX->_pos).x; local_10 = (in_ECX->_posOffset).x; local_18 = (in_ECX->_pos).y; local_14 = (in_ECX->_posOffset).y; pVVar1 = Entity::GetNullOffset(in_ECX,&local_20,(byte *)"ShootPos"); *param_1 = local_c + local_10 + pVVar1->x; param_1[1] = local_14 + local_18 + pVVar1->y; return; } //@@ 0057e430 NpcHelper::rotgut_fire_projectile /* DB: thiscall Entity_NPC: Entity_NPC::FireBossProjectiles(1, zero, 0, params) then overrides _fallingSpeed/_fallingAccel/_scale from params (+8/+0xc/+0x14) and sets position/velocity from param_1/param_2; only callers NpcAI::ENTITY_ROTGUT and ENTITY_ROTGUT_maggot */ Entity_Projectile * NpcHelper::rotgut_fire_projectile(float *param_1,float *param_2,void *param_3) { Entity_Projectile *pEVar1; Entity_NPC *in_ECX; pEVar1 = Entity_NPC::FireBossProjectiles(in_ECX,1,&g_vectorZero,0.0,param_3); pEVar1->_fallingSpeed = *(float *)((int)param_3 + 8); pEVar1->_fallingAccel = *(float *)((int)param_3 + 0xc); pEVar1->_scale = *(float *)((int)param_3 + 0x14); (pEVar1->_pos).x = *param_1; (pEVar1->_pos).y = param_1[1]; (pEVar1->_velocity).x = *param_2; (pEVar1->_velocity).y = param_2[1]; return pEVar1; } //@@ 0057e4a0 NpcAI::ENTITY_ROTGUT_maggot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: 911.1 (dispatcher case 0xdf variant 1); strs ButtAttack1-3/HeadAttack1-3/Shoot, spawn_small_maggot, 1000.006_rotgut detail.anm2 */ void __fastcall NpcAI::ENTITY_ROTGUT_maggot(Entity_NPC *npc) { ANM2 *pAVar1; byte bVar2; Entity *tmpEntity; EntityPtr detailEffect; uint uVar3; Vector *vecResult; Entity_Projectile *projectile; Vector *nullOffsetResult; float *pfVar4; ColorMod *color; char *ptr; uint rngResult; int iVar5; bool isEveryFourth; float fVar6; float fVar7; Vector nullOffset2; Vector nullOffset; Vector shootPos; Vector local_2e8; Room *room; Vector effectVelocity; int elapsedFrames; Vector scratchVec; Vector local_2c8; Vector local_2c0; float local_2b8; char isTargetAbove; float local_2b0; float *local_2ac; EntityPtr *local_2a8; Color bloodColor; ProjectileParams projParams3; ProjectileParams projParams; ProjectileParams projParams2; float local_7c; float fStack_78; float fStack_74; float fStack_70; float local_6c; float fStack_68; float fStack_64; float fStack_60; float local_5c [2]; float local_54; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; AnimationState *animState; undefined4 flagsHigh; Entity_NPC *roomEntity; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af52bd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; npc->_friction = 0.6; iVar5 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; room = g_game->_room; elapsedFrames = iVar5; tmpEntity = Entity_NPC::GetPlayerTarget(npc); if (tmpEntity->_entityGridCollisionClass == 5) { LAB_0057e54b: isTargetAbove = '\0'; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar6 = (npc->_pos).y - 80.0; isTargetAbove = '\x01'; pfVar4 = &(tmpEntity->_pos).y; if (fVar6 < *pfVar4 || fVar6 == *pfVar4) goto LAB_0057e54b; } switch(npc->_state) { case 0: Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); npc->_state = 3; ANM2::Play(&npc->_sprite,s_Idle,0); (npc->_posOffset).y = 36.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_stateFrame = 0; uVar3 = Random(); scratchVec.x = (npc->_pos).x + 0.0; scratchVec.y = (npc->_pos).y + 36.0; detailEffect = (EntityPtr) Game::Spawn(g_game,1000,6,&scratchVec,&g_vectorZero,(Entity *)0x0,0,uVar3); local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = 0.0; local_50._20_4_ = std::_Allocate(0x20); local_2c = 4.34403e-44; local_28 = 4.34403e-44; builtin_strncpy((char *)local_50._20_4_,"gfx/1000.006_rotgut detail.anm2",0x20); local_14 = 0; ANM2::Load((ANM2 *)((int)detailEffect + 0x48),(std_string *)(local_50 + 0x14),1); local_14 = 0xffffffff; if (0xf < (uint)local_28) { uVar3 = (int)local_28 + 1; ptr = (char *)local_50._20_4_; if (0xfff < uVar3) { ptr = *(char **)(local_50._20_4_ + -4); uVar3 = (int)local_28 + 0x24; if ((char *)0x1f < (char *)(local_50._20_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } ANM2::Play((ANM2 *)((int)detailEffect + 0x48),(byte *)"Detail",0); *(uint *)((int)detailEffect + 0x168) = *(uint *)((int)detailEffect + 0x168) | 0x200000; *(undefined4 *)((int)detailEffect + 0x16c) = *(undefined4 *)((int)detailEffect + 0x16c); *(float *)((int)detailEffect + 0x358) = 100.0; if (npc->_child != (EntityPtr)0x0) { local_2a8 = &npc->_child; std::multiset::erase(); } npc->_child = detailEffect; std::multiset::insert(); (**(code **)(*(int *)detailEffect + 0xc))(); default: goto switchD_0057e561_caseD_1; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,s_Idle,0); } npc->_stateFrame = npc->_stateFrame + 1; if ((0xf < npc->_stateFrame) && (uVar3 = Random(), uVar3 % 0x1e == 0)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_2a8 = (EntityPtr *)(tmpEntity->_pos).y; pfVar4 = &(npc->_pos).y; if (((*pfVar4 <= (float)local_2a8 && (float)local_2a8 != *pfVar4) && (uVar3 = Random(), uVar3 % 3 != 0)) || ((((npc->_pos).y <= (float)local_2a8 || (uVar3 = Random(), uVar3 % 3 == 0)) && (uVar3 = Random(), (uVar3 & 1) == 0)))) { uVar3 = Random(); uVar3 = uVar3 % 3 + 3; } else { uVar3 = Random(); uVar3 = uVar3 % 3; } npc->_projectileCooldown = -1; npc->_stateFrame = 0; switch(uVar3) { case 0: npc->_state = 8; ANM2::Play(&npc->_sprite,(byte *)"ButtAttack1",0); break; case 1: npc->_state = 9; ANM2::Play(&npc->_sprite,(byte *)"ButtAttack2",0); break; case 2: npc->_state = 10; ANM2::Play(&npc->_sprite,(byte *)"ButtAttack3",0); break; case 3: npc->_state = 0xb; ANM2::Play(&npc->_sprite,(byte *)"HeadAttack1",0); break; case 4: npc->_state = 0xc; ANM2::Play(&npc->_sprite,(byte *)"HeadAttack2",0); break; case 5: npc->_state = 7; ANM2::Play(&npc->_sprite,(byte *)"HeadAttack3",0); Entity_NPC::PlaySound(npc,0x138,1.0,0x14,0,0.75); } } goto switchD_0057e561_caseD_1; case 7: animState = &(npc->_sprite)._animState; local_2ac = (float *)0x0; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"); if (bVar2 != 0) { npc->_projectileCooldown = 0; Entity_NPC::PlaySound(npc,0xb,1.0,2,0,1.0); Game::ShakeScreen(g_game,0x14); local_2ac = (float *)0xc0000000; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Sound"), bVar2 != 0)) { Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); } } if (npc->_projectileCooldown < 0) { Game::ShakeScreen(g_game,4); local_2ac = (float *)0x3f000000; LAB_0057f9f9: local_2a8 = (EntityPtr *)0x0; if ((room->_entityList)._updateEL._size != 0) { do { roomEntity = *(Entity_NPC **) ((int)(room->_entityList)._updateEL._data + (int)local_2a8 * 4); if (roomEntity != npc) { if ((*(int *)&g_game->_deathmatchManager < 2) || (roomEntity->_type != 1)) { local_2c8.y = (float)roomEntity->_type; if (((0x3dd < (int)local_2c8.y - 10U) || (local_2c8.y == 4.62428e-44)) && (((local_2c8.y != 1.4013e-45 && (local_2c8.y != 2.8026e-45)) && (local_2c8.y != 1.26117e-44)))) goto LAB_0057fbdc; } else { local_2c8.y = 1.4013e-45; } local_2c0.y = (npc->_pos).y - (roomEntity->_pos).y; local_2b0 = (npc->_pos).x - (roomEntity->_pos).x; fVar6 = local_2c0.y * local_2c0.y + local_2b0 * local_2b0; local_2b8 = 2.0 / (fVar6 * 1e-05 + 1.0); fVar6 = sqrtf(fVar6); if (0.0 < fVar6) { local_2c0.y = local_2c0.y * (1.0 / fVar6); local_2b0 = local_2b0 * (1.0 / fVar6); } if (local_2c8.y == 1.4013e-45) { fVar6 = 0.8; if (local_2b8 * 1.4 <= 0.8) { fVar6 = local_2b8 * 1.4; } local_2b8 = roomEntity->_mass; if (1.0 <= local_2b8) { local_2b8 = 1.0; } local_2b8 = fVar6 / local_2b8; } else if (local_2c8.y == 2.8026e-45) { local_2b8 = local_2b8 * 0.7; } else if (local_2c8.y == 1.26117e-44) { local_2b8 = local_2b8 * 0.4; } fVar6 = roomEntity->_friction; if (fVar6 != 0.0) { fVar7 = roomEntity->_speedMultiplier; (roomEntity->_velocity).x = (local_2b8 * (float)local_2ac * local_2b0 * fVar7) / fVar6 + (roomEntity->_velocity).x; (roomEntity->_velocity).y = (local_2b8 * (float)local_2ac * local_2c0.y * fVar7) / fVar6 + (roomEntity->_velocity).y; } } LAB_0057fbdc: local_2a8 = (EntityPtr *)((int)local_2a8 + 1); } while (local_2a8 < (uint)(room->_entityList)._updateEL._size); } } else if ((float)local_2ac != 0.0) goto LAB_0057f9f9; local_2a8 = (EntityPtr *)0x0; if (0 < elapsedFrames) { uVar3 = npc->_projectileCooldown; iVar5 = elapsedFrames; do { if (0x1d < uVar3) break; if ((uVar3 & 1) == 0) { local_2b8 = (npc->_posOffset).x; local_2ac = (float *)(npc->_pos).x; local_2b0 = (npc->_posOffset).y; local_2c0.y = (npc->_pos).y; vecResult = Entity::GetNullOffset((Entity *)npc,&nullOffset,(byte *)"ShootPos"); iVar5 = 3; shootPos.y = local_2b0 + local_2c0.y + vecResult->y; shootPos.x = (float)local_2ac + local_2b8 + vecResult->x; do { ProjectileParams::ProjectileParams(&projParams); projParams.FallingAccelModifier = 0.72; uVar3 = Random(); rngResult = uVar3 % 3 + 5; uVar3 = 0xd; if (rngResult < 0xd) { uVar3 = rngResult; } projParams.Scale = ((float)uVar3 - 3.0) / 3.0; uVar3 = Random(); local_2ac = (float *)(-10.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 11.0); uVar3 = Random(); local_2b0 = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 15.0 + 10.0) * 0.017453292; local_2c0.y = cos(local_2b0); fVar6 = sin(local_2b0); local_2b0 = local_2c0.y * (float)local_2ac - fVar6 * 0.0; local_2c0.y = fVar6 * (float)local_2ac + local_2c0.y * 0.0; projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&projParams); projectile->_fallingSpeed = projParams.FallingSpeedModifier; projectile->_fallingAccel = projParams.FallingAccelModifier; projectile->_scale = projParams.Scale; (projectile->_pos).x = shootPos.x; (projectile->_pos).y = shootPos.y; (projectile->_velocity).x = local_2b0; (projectile->_velocity).y = local_2c0.y; iVar5 = iVar5 + -1; } while (iVar5 != 0); uVar3 = Random(); if (uVar3 % 6 == 0) { uVar3 = Random(); local_2b0 = -4.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 4.0; uVar3 = Random(); local_2e8.y = 0.0; local_2e8.x = -6.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 4.0; spawn_small_maggot(&shootPos,0.0,&local_2e8,local_2b0); } else { uVar3 = Random(); if (uVar3 % 6 == 0) { uVar3 = Random(); rngResult = Random(); local_2ac = (float *)(-10.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 10.0); rngResult = Random(); local_2b0 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 30.0 * 0.017453292; local_2c0.y = cos(local_2b0); fVar6 = sin(local_2b0); scratchVec.x = local_2c0.y * (float)local_2ac - fVar6 * 0.0; scratchVec.y = fVar6 * (float)local_2ac + local_2c0.y * 0.0; tmpEntity = Game::Spawn(g_game,0x12,0,&shootPos,&scratchVec,(Entity *)0x0,0,uVar3); flagsHigh = *(undefined4 *)((int)&tmpEntity->_flags + 4); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&tmpEntity->_flags + 4) = flagsHigh; } } uVar3 = Random(); local_2b0 = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 - 5.0) * 0.017453292; local_2c0.y = cos(local_2b0); local_2b0 = sin(local_2b0); uVar3 = Random(); effectVelocity.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; effectVelocity.y = (local_2c0.y * 0.0 - local_2b0 * 6.0) * effectVelocity.x; effectVelocity.x = (local_2c0.y * -6.0 - local_2b0 * 0.0) * effectVelocity.x; Color::Color(&bloodColor); tmpEntity = spawn_blood_explosion(3,&shootPos,&g_vectorZero,color,&effectVelocity); uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.32000002; fVar7 = fVar6 * g_vectorOne.y; fVar6 = fVar6 * g_vectorOne.x; tmpEntity->_renderZOffset = 2000; (tmpEntity->_sprite)._scale.y = fVar7; (tmpEntity->_sprite)._scale.x = fVar6; uVar3 = npc->_projectileCooldown; iVar5 = elapsedFrames; } local_2a8 = (EntityPtr *)((int)local_2a8 + 1); uVar3 = uVar3 + 1; npc->_projectileCooldown = uVar3; } while ((int)local_2a8 < iVar5); } break; case 8: if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x25,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xd5,0.8,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; projParams.BulletFlags._0_4_ = 2; projParams.BulletFlags._4_4_ = 0x20000; projParams.Scale = 2.0; projParams.FallingSpeedModifier = 0.0; projParams.FallingAccelModifier = 0.72; local_50._16_4_ = 0.4; local_50._20_4_ = 2.0; fStack_38 = 0.5; fStack_34 = 1.0; local_30 = 0.0; local_2c = 0.0; local_28 = 0.0; Color::operator_assign((Color *)&projParams.Color,(ColorMod *)local_50); uVar3 = Random(); local_2a8 = (EntityPtr *) ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10); FUN_0057e3b0(); local_2b0 = -10.0 - (float)local_2a8 * 6.0; local_2a8 = (EntityPtr *)cos(0.5235988); fVar6 = sin(0.5235988); effectVelocity.x = (float)local_2a8 * local_2b0 - fVar6 * 0.0; effectVelocity.y = fVar6 * local_2b0 + (float)local_2a8 * 0.0; local_2a8 = (EntityPtr *)effectVelocity.x; NpcHelper::rotgut_fire_projectile(); scratchVec.x = (float)local_2a8 * 0.2; scratchVec.y = effectVelocity.y * 0.2; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_50._16_4_ = 0.2; local_50._20_4_ = 1.2; fStack_38 = 0.0; fStack_34 = 1.0; local_30 = 0.0; local_2c = 0.0; local_28 = 0.0; tmpEntity = spawn_blood_explosion (2,&local_2c0,&g_vectorZero,(ColorMod *)local_50,&scratchVec); uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar7 = fVar6 * g_vectorOne.y; fVar6 = fVar6 * g_vectorOne.x; tmpEntity->_renderZOffset = 2000; (tmpEntity->_sprite)._scale.y = fVar7; (tmpEntity->_sprite)._scale.x = fVar6; } break; } goto LAB_00580219; case 9: case 0xc: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { Entity_NPC::PlaySound(npc,0x13d,1.0,2,0,1.0); npc->_projectileCooldown = 0; } local_2b8 = 0.0; if (0 < iVar5) { uVar3 = npc->_projectileCooldown; iVar5 = elapsedFrames; do { if ((int)uVar3 < 0) break; if ((int)uVar3 < 0x15) { uVar3 = uVar3 & 0x80000003; isEveryFourth = uVar3 == 0; if ((int)uVar3 < 0) { isEveryFourth = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if (isEveryFourth) { ProjectileParams::ProjectileParams(&projParams2); projParams2.BulletFlags._0_4_ = 0x2000; projParams2.BulletFlags._4_4_ = 0x40000; projParams2.TargetPosition.x = -8.0; projParams2.TargetPosition.y = 0.0; if (npc->_state == 9) { projParams2.Color._offset[2] = DAT_00c34d48; projParams2.Color._tint[0] = _DAT_00c34d20; projParams2.Color._tint[1] = fRam00c34d24; projParams2.Color._tint[2] = fRam00c34d28; projParams2.Color._tint[3] = fRam00c34d2c; projParams2.Color._colorize[0] = _DAT_00c34d30; projParams2.Color._colorize[1] = fRam00c34d34; projParams2.Color._colorize[2] = fRam00c34d38; projParams2.Color._colorize[3] = fRam00c34d3c; projParams2.Color._offset[0] = (float)DAT_00c34d40; projParams2.Color._offset[1] = DAT_00c34d40._4_4_; } projParams2.FallingAccelModifier = -0.1; uVar3 = Random(); rngResult = uVar3 % 3 + 5; uVar3 = 0xd; if (rngResult < 0xd) { uVar3 = rngResult; } projParams2.Scale = ((float)uVar3 - 3.0) / 3.0; local_2b0 = (npc->_posOffset).x; local_2a8 = (EntityPtr *)(npc->_pos).x; local_2c0.y = (npc->_pos).y; local_2ac = (float *)(npc->_posOffset).y; vecResult = Entity::GetNullOffset((Entity *)npc,&local_2e8,(byte *)"ShootPos"); local_2c8.x = (float)local_2a8 + local_2b0 + vecResult->x + 0.0; local_2c8.y = local_2c0.y + (float)local_2ac + vecResult->y + 8.0; fVar6 = ((float)npc->_projectileCooldown - 0.0) * 0.0625; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } fVar6 = 1.5 - fVar6 * 1.3; local_2ac = (float *)(fVar6 * 0.0); local_2a8 = (EntityPtr *)(fVar6 * -2.0); if ((npc->_state == 9) && (isTargetAbove != '\0')) { uVar3 = Random(); local_2ac = (float *)((float)local_2ac - (-6.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 9.0)); } projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&projParams2); projectile->_fallingSpeed = projParams2.FallingSpeedModifier; projectile->_fallingAccel = projParams2.FallingAccelModifier; projectile->_scale = projParams2.Scale; (projectile->_pos).x = local_2c8.x; (projectile->_pos).y = local_2c8.y; (projectile->_velocity).x = (float)local_2a8; scratchVec.x = (float)local_2a8 * 0.2; (projectile->_velocity).y = (float)local_2ac; scratchVec.y = (float)local_2ac * 0.2; if (npc->_state == 9) { local_54 = g_colorGreenSplat._offset[2]; local_2ac = &local_7c; local_7c = g_colorGreenSplat._tint[0]; fStack_78 = g_colorGreenSplat._tint[1]; fStack_74 = g_colorGreenSplat._tint[2]; fStack_70 = g_colorGreenSplat._tint[3]; local_6c = g_colorGreenSplat._colorize[0]; fStack_68 = g_colorGreenSplat._colorize[1]; fStack_64 = g_colorGreenSplat._colorize[2]; fStack_60 = g_colorGreenSplat._colorize[3]; local_5c[0] = g_colorGreenSplat._offset[0]; local_5c[1] = g_colorGreenSplat._offset[1]; } else { local_2ac = (float *)local_50; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_30 = 0.0; local_2c = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_28 = 0.0; } uVar3 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&local_2c8,&scratchVec,(Entity *)0x0,2,uVar3); (**(code **)(*(int *)tmpEntity + 0x3c))(local_2ac); (tmpEntity->_sprite)._offset.x = g_vectorZero.x; (tmpEntity->_sprite)._offset.y = g_vectorZero.y; tmpEntity->_renderDepthOffset = 10.0; uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar7 = fVar6 * g_vectorOne.y; fVar6 = fVar6 * g_vectorOne.x; tmpEntity->_renderZOffset = 2000; (tmpEntity->_sprite)._scale.y = fVar7; (tmpEntity->_sprite)._scale.x = fVar6; iVar5 = elapsedFrames; } } npc->_projectileCooldown = npc->_projectileCooldown + 1; local_2b8 = (float)((int)local_2b8 + 1); uVar3 = npc->_projectileCooldown; } while ((int)local_2b8 < iVar5); } break; case 10: if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { Entity_NPC::PlaySound(npc,0x25,1.0,2,0,1.0); Game::ShakeScreen(g_game,10); npc->_projectileCooldown = 0; } local_2b0 = 0.0; if (0 < iVar5) { uVar3 = npc->_projectileCooldown; do { if (5 < uVar3) break; local_2b8 = (npc->_posOffset).x; vecResult = &npc->_pos; local_2ac = (float *)vecResult->x; local_2c0.y = (npc->_pos).y; local_2a8 = (EntityPtr *)(npc->_posOffset).y; nullOffsetResult = Entity::GetNullOffset((Entity *)npc,&nullOffset2,(byte *)"ShootPos"); scratchVec.y = (float)local_2a8 + local_2c0.y + nullOffsetResult->y; scratchVec.x = (float)local_2ac + local_2b8 + nullOffsetResult->x; if (npc->_projectileCooldown == 0) { local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_28 = 0.0; Game::Fart(g_game,vecResult,0.0,(Entity *)npc,1.0,0,(ColorMod *)local_50); iVar5 = 0x57f1b9; Game::ButterBeanFart(g_game,vecResult,100.0,(Entity *)npc,0,0); Game::DamageRadius(vecResult,(Entity *)npc,0,0,iVar5,50.0,g_tearFlagPoison,15.0,80.0); } iVar5 = 4; do { ProjectileParams::ProjectileParams(&projParams3); projParams3.Color._offset[2] = DAT_00c34f00; projParams3.Color._tint[0] = _DAT_00c34ed8; projParams3.Color._tint[1] = fRam00c34edc; projParams3.Color._tint[2] = fRam00c34ee0; projParams3.Color._tint[3] = fRam00c34ee4; projParams3.FallingAccelModifier = 0.72; projParams3.Color._colorize[0] = _DAT_00c34ee8; projParams3.Color._colorize[1] = fRam00c34eec; projParams3.Color._colorize[2] = fRam00c34ef0; projParams3.Color._colorize[3] = fRam00c34ef4; projParams3.Color._offset[0] = (float)DAT_00c34ef8; projParams3.Color._offset[1] = DAT_00c34ef8._4_4_; uVar3 = Random(); rngResult = uVar3 % 3 + 5; uVar3 = 0xd; if (rngResult < 0xd) { uVar3 = rngResult; } projParams3.Scale = ((float)uVar3 - 3.0) / 3.0; uVar3 = Random(); local_2c8.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; local_2ac = (float *)(npc->_posOffset).x; local_2a8 = (EntityPtr *)(npc->_pos).x; local_2c0.y = (npc->_posOffset).y; local_2b8 = (npc->_pos).y; vecResult = Entity::GetNullOffset((Entity *)npc,&nullOffset,(byte *)"ShootPos"); local_2ac = (float *)((float)local_2ac + (float)local_2a8 + vecResult->x); local_2b8 = local_2b8 + local_2c0.y + vecResult->y; if (isTargetAbove == '\0') { local_2c8.y = -10.0 - local_2c8.y * 6.0; uVar3 = Random(); local_2a8 = (EntityPtr *) (((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * 15.0 + 25.0) * 0.017453292); local_2c0.y = cos((float)local_2a8); fVar6 = sin((float)local_2a8); } else { local_2c8.y = -16.0 - local_2c8.y * 6.0; uVar3 = Random(); local_2a8 = (EntityPtr *) (((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * 25.0 + 30.0) * 0.017453292); local_2c0.y = cos((float)local_2a8); fVar6 = sin((float)local_2a8); } fVar7 = local_2c8.y * local_2c0.y; local_2c8.y = local_2c8.y * fVar6 + local_2c0.y * 0.0; local_2c0.y = fVar7 - fVar6 * 0.0; projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&projParams3); projectile->_fallingSpeed = projParams3.FallingSpeedModifier; projectile->_fallingAccel = projParams3.FallingAccelModifier; projectile->_scale = projParams3.Scale; (projectile->_pos).x = (float)local_2ac; (projectile->_pos).y = local_2b8; (projectile->_velocity).x = local_2c0.y; (projectile->_velocity).y = local_2c8.y; iVar5 = iVar5 + -1; } while (iVar5 != 0); local_2c0.y = 0.0; do { local_2b8 = -10.0 - (((float)(int)local_2c0.y * 0.25 + (float)npc->_projectileCooldown) / 6.0) * 90.0; uVar3 = Random(); local_2a8 = (EntityPtr *) (((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 6.0 - 3.0) * 0.017453292); local_2ac = (float *)cos((float)local_2a8); fVar6 = sin((float)local_2a8); effectVelocity.x = (float)local_2ac * local_2b8 - fVar6 * 0.0; effectVelocity.y = fVar6 * local_2b8 + (float)local_2ac * 0.0; local_2c8.y = effectVelocity.y; local_2ac = (float *)effectVelocity.x; if (isTargetAbove != '\0') { uVar3 = Random(); local_2a8 = (EntityPtr *) (((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)] ) * 2.3283064e-10 * 25.0 + 5.0) * 0.017453292); local_2b8 = cos((float)local_2a8); fVar6 = sin((float)local_2a8); effectVelocity.x = (float)local_2ac * local_2b8 - local_2c8.y * fVar6; effectVelocity.y = local_2c8.y * local_2b8 + (float)local_2ac * fVar6; } uVar3 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8d,&scratchVec,&effectVelocity,(Entity *)npc,0,uVar3 ); uVar3 = Random(); iVar5 = *(int *)tmpEntity; fVar6 = 1.0 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.25; fVar7 = fVar6 * g_vectorOne.y; fVar6 = fVar6 * g_vectorOne.x; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[8] = -0x6a; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (tmpEntity->_sprite)._scale.y = fVar7; pAVar1 = &tmpEntity[1]._sprite; (pAVar1->_filename)._buf[0xc] = -0x6a; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (tmpEntity->_sprite)._scale.x = fVar6; (**(code **)(iVar5 + 0xc))(); local_2c0.y = (float)((int)local_2c0.y + 1); } while ((int)local_2c0.y < 2); local_2e8.x = -2.0; local_2e8.y = 0.0; uVar3 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&scratchVec,&local_2e8,(Entity *)0x0,3,uVar3); (**(code **)(*(int *)tmpEntity + 0x3c))(&g_colorGreenSplat); (tmpEntity->_sprite)._offset.x = g_vectorZero.x; (tmpEntity->_sprite)._offset.y = g_vectorZero.y; tmpEntity->_renderDepthOffset = 10.0; uVar3 = Random(); local_2b0 = (float)((int)local_2b0 + 1); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.32000002; fVar7 = fVar6 * g_vectorOne.y; fVar6 = fVar6 * g_vectorOne.x; tmpEntity->_renderZOffset = 2000; (tmpEntity->_sprite)._scale.y = fVar7; (tmpEntity->_sprite)._scale.x = fVar6; npc->_projectileCooldown = npc->_projectileCooldown + 1; uVar3 = npc->_projectileCooldown; } while ((int)local_2b0 < elapsedFrames); } break; case 0xb: if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_00580219; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { local_2e8.x = 0.0; local_2e8.y = -12.0; pfVar4 = (float *)FUN_0057e3b0(); scratchVec.y = pfVar4[1] + 12.0; scratchVec.x = *pfVar4 + 0.0; Entity_Laser::ShootAngle(1,&scratchVec,180.0,0x1e,&local_2e8,(Entity *)npc,0); } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_00580219: npc->_state = 3; } switchD_0057e561_caseD_1: bVar2 = npc->_dead; fVar6 = (npc->_targetPosition).y; fVar7 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar6 - fVar7; if ((bVar2 != 0) && (local_2a8 = (EntityPtr *)0x0, (room->_entityList)._updateEL._size != 0)) { do { iVar5 = *(int *)((int)(room->_entityList)._updateEL._data + (int)local_2a8 * 4); if (((iVar5 != 0) && ((*(int *)(iVar5 + 0x28) == 9 && (*(Entity_NPC **)(iVar5 + 0x3bc) == npc)))) && ((*(uint *)(iVar5 + 0x43c) & 0x40000) != 0)) { *(undefined4 *)(iVar5 + 0x438) = *(undefined4 *)(iVar5 + 0x438); *(uint *)(iVar5 + 0x43c) = *(uint *)(iVar5 + 0x43c) & 0xfffbffff; *(undefined1 *)(iVar5 + 0x173) = 1; } local_2a8 = (EntityPtr *)((int)local_2a8 + 1); } while (local_2a8 < (uint)(room->_entityList)._updateEL._size); } ExceptionList = local_1c; return; } //@@ 00581200 rotgut_death_spawn_effects /* DB: ? from Entity_NPC::trigger_kill_item_effects when type 0x38f (ENTITY_ROTGUT 911) variant 1 dies: SpawnEx two effects 1000.0x77 with callback LAB_00580360 at +0x420 and params 1/6, positioned on fixed grid indices of the room (needs width >= 15) */ void rotgut_death_spawn_effects(void) { int iVar1; Game *pGVar2; uint uVar3; Entity *pEVar4; int iVar5; int in_ECX; uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,uVar3,0); pGVar2 = g_game; pEVar4[1]._pendingDamage = (float)&LAB_00580360; *(undefined4 *)&pEVar4[1]._pendingDamageFlags = 1; *(undefined4 *)((int)&pEVar4[1]._pendingDamageFlags + 4) = 0; iVar1 = *(int *)((int)pGVar2->_room + 0xc); if ((iVar1 < 0xf) || (*(int *)((int)pGVar2->_room + 0x10) < 8)) { iVar5 = -1; } else { iVar5 = (iVar1 + 2) * 7; } (pEVar4->_pos).x = (float)(iVar5 % iVar1) * 40.0 + 40.0; (pEVar4->_pos).y = (float)(iVar5 / iVar1) * 40.0 + 120.0; uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,uVar3,0); pGVar2 = g_game; pEVar4[1]._pendingDamage = (float)&LAB_00580360; *(undefined4 *)&pEVar4[1]._pendingDamageFlags = 6; *(undefined4 *)((int)&pEVar4[1]._pendingDamageFlags + 4) = 0; iVar1 = *(int *)((int)pGVar2->_room + 0xc); if ((iVar1 < 0xf) || (*(int *)((int)pGVar2->_room + 0x10) < 7)) { iVar5 = -1; } else { iVar5 = iVar1 * 6 + 0xe; } (pEVar4->_pos).x = (float)(iVar5 % iVar1) * 40.0 + 40.0; (pEVar4->_pos).y = (float)(iVar5 / iVar1) * 40.0 + 120.0; uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,uVar3,0); pGVar2 = g_game; pEVar4[1]._pendingDamage = (float)&LAB_00580360; *(undefined4 *)&pEVar4[1]._pendingDamageFlags = 0xb; *(undefined4 *)((int)&pEVar4[1]._pendingDamageFlags + 4) = 0; iVar1 = *(int *)((int)pGVar2->_room + 0xc); if ((iVar1 < 0xf) || (*(int *)((int)pGVar2->_room + 0x10) < 6)) { iVar5 = -1; } else { iVar5 = iVar1 * 5 + 0xe; } (pEVar4->_pos).x = (float)(iVar5 % iVar1) * 40.0 + 40.0; (pEVar4->_pos).y = (float)(iVar5 / iVar1) * 40.0 + 120.0; if (*(int **)(in_ECX + 0x3c0) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + 0x3c0) + 0x28))(); } return; } //@@ 00581430 NpcAI::rotgut_fire_projectiles /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ENTITY_ROTGUT calls on Shoot event; ProjectileParams + Entity_NPC::FireBossProjectiles toward GetPlayerTarget */ void __fastcall NpcAI::rotgut_fire_projectiles(Entity_NPC *npc) { float *pfVar1; Entity *pEVar2; uint uVar3; Entity_Projectile *pEVar4; int iVar5; bool bVar6; float x; float local_d8; float local_d4; float local_d0; undefined4 local_cc; float local_c8; float local_c4; ProjectileParams local_c0; float local_14; local_14 = (float)(__security_cookie ^ (uint)&(&local_c0)[1].CircleAngle); bVar6 = npc->_state != 4; if (bVar6) { local_d8 = 20.0; } else { local_cc = 0; local_c8 = -20.0; } pfVar1 = &local_d8; if (!bVar6) { pfVar1 = &local_c8; } local_d0 = (npc->_pos).x + 0.0; local_d4 = *pfVar1 + (npc->_pos).y; pEVar2 = Entity_NPC::GetPlayerTarget(npc); local_c4 = atan2f((pEVar2->_pos).y - local_d4,(pEVar2->_pos).x - local_d0); local_c4 = local_c4 * 57.295776; uVar3 = Random(); local_c4 = local_c4 + ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0); ProjectileParams::ProjectileParams(&local_c0); iVar5 = 0; local_c0.Color._tint[0] = _DAT_00c34ed8; local_c0.Color._tint[1] = fRam00c34edc; local_c0.Color._tint[2] = fRam00c34ee0; local_c0.Color._tint[3] = fRam00c34ee4; local_c0.Color._offset[2] = DAT_00c34f00; local_c0.FallingAccelModifier = -0.1; local_c0.Color._colorize[0] = _DAT_00c34ee8; local_c0.Color._colorize[1] = fRam00c34eec; local_c0.Color._colorize[2] = fRam00c34ef0; local_c0.Color._colorize[3] = fRam00c34ef4; local_c0.Color._offset[0] = (float)DAT_00c34ef8; local_c0.Color._offset[1] = DAT_00c34ef8._4_4_; do { x = ((float)iVar5 / 12.0) * 360.0 + local_c4; if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } if ((-20.0 <= x) && (x <= 200.0)) { local_c8 = x * 0.017453292; local_d8 = cos(local_c8); local_d8 = local_d8 * 7.0; local_c8 = sin(local_c8); local_c8 = local_c8 * 7.0; pEVar4 = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&local_c0); pEVar4->_fallingSpeed = local_c0.FallingSpeedModifier; pEVar4->_fallingAccel = local_c0.FallingAccelModifier; pEVar4->_scale = local_c0.Scale; (pEVar4->_pos).x = local_d0; (pEVar4->_pos).y = local_d4; (pEVar4->_velocity).x = local_d8; (pEVar4->_velocity).y = local_c8; } iVar5 = iVar5 + 1; } while (iVar5 < 0xc); return; } //@@ 00581730 NpcAI::ENTITY_ROTGUT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* NPC AI for entity type 911 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ROTGUT(Entity_NPC *npc) { RNG rng; float *pfVar1; byte bVar2; Entity_Projectile *projectile; ColorMod *color; WeightedOutcomePicker *pWVar3; Entity *tmpEntity; WeightedOutcomePicker WVar4; byte *pbVar5; int stateFrame; byte *pbVar6; char *expectedName; uint uVar7; int iVar8; uint outcomeCount; bool bVar9; undefined1 *puVar10; float dirX; float fVar11; float fVar12; undefined1 auStack_1ec [8]; float fStack_1e4; int elapsedFrames; undefined4 local_1dc; WeightedOutcomePicker local_1d8; float local_1d4; void *room; Vector local_1cc; WeightedOutcomePicker outcomePicker; Vector local_1c0; byte isBelowHalfHealth; float local_1b4; WeightedOutcomePicker local_1b0; WeightedOutcomePicker local_1ac; WeightedOutcomePicker local_1a8; float local_1a4; ProjectileParams spitParams; ProjectileParams rainParams; Color tmpColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; WeightedOutcomePicker local_14; AnimationState *animState; Game *game; Manager *manager; int *outcomeWeight; void *roomRef; WeightedOutcomePicker spawnedSprite; game = g_game; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; local_14 = (WeightedOutcomePicker)0xffffffff; puStack_18 = &LAB_00af5350; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&tmpColor)[1]._colorize + 1); ExceptionList = &local_1c; npc->_friction = 0.6; room = game->_room; isBelowHalfHealth = npc->_health / npc->_maxHitPoints < 0.5; iVar8 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; elapsedFrames = iVar8; pfVar1 = (&tmpColor)[1]._offset; switch(npc->_state) { case 0: puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); npc->_state = 3; ANM2::Play(&npc->_sprite,(byte *)"Heartbeat",0); (npc->_posOffset).y = 10.0; (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; pfVar1 = (float *)puStack_20; break; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&tmpColor)[1]._offset, (npc->_sprite)._animState._isPlaying == 0 )) { local_1cc.y = 1.6715462e-38; pbVar5 = (byte *)"HeartbeatFast"; if (!(bool)isBelowHalfHealth) { pbVar5 = (byte *)"Heartbeat"; } puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; ANM2::Play(&npc->_sprite,pbVar5,0); if ((npc->_sprite)._animState._animData != (void *)0x0) goto LAB_00581873; } else { LAB_00581873: bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { Game::ShakeScreen(g_game,6); Entity_NPC::PlaySound(npc,isBelowHalfHealth + 0x141,1.0,2,0,1.0); if (npc->_projectileDelay < 1) { rotgut_fire_projectiles(npc); } else { npc->_projectileDelay = npc->_projectileDelay + -1; roomRef = g_game->_room; local_1d4 = *(float *)((int)roomRef + 0x14) + 20.0; local_1d8 = *(WeightedOutcomePicker *)((int)roomRef + 0x18); local_1a4 = *(float *)((int)roomRef + 0x1c) - 20.0; ProjectileParams::ProjectileParams(&rainParams); rainParams.Color._offset[2] = DAT_00c34cf0; rainParams.Color._tint[0] = _DAT_00c34cc8; rainParams.Color._tint[1] = fRam00c34ccc; rainParams.Color._tint[2] = fRam00c34cd0; rainParams.Color._tint[3] = fRam00c34cd4; rainParams.FallingAccelModifier = 0.48; rainParams.BulletFlags._0_4_ = 0x12000; rainParams.BulletFlags._4_4_ = 1; rainParams.Color._colorize[0] = _DAT_00c34cd8; rainParams.Color._colorize[1] = fRam00c34cdc; rainParams.Color._colorize[2] = fRam00c34ce0; rainParams.Color._colorize[3] = fRam00c34ce4; rainParams.ChangeFlags._0_4_ = 0x10000; rainParams.Color._offset[0] = (float)DAT_00c34ce8; rainParams.Color._offset[1] = DAT_00c34ce8._4_4_; local_1a4 = local_1a4 - local_1d4; rainParams.ChangeFlags._4_4_ = 0; rainParams.ChangeTimeout = 0x1e; local_1b0 = (WeightedOutcomePicker)0x3; do { uVar7 = Random(); rainParams.Scale = 1.6; local_1cc.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)] ) * 2.3283064e-10 * local_1a4 + local_1d4; uVar7 = Random(); local_1a8 = (WeightedOutcomePicker) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 4.0); projectile = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&rainParams); projectile->_fallingSpeed = rainParams.FallingSpeedModifier; projectile->_fallingAccel = rainParams.FallingAccelModifier; projectile->_scale = rainParams.Scale; (projectile->_pos).x = local_1cc.y; (projectile->_pos).y = (float)local_1d8; (projectile->_velocity).x = 0.0; (projectile->_velocity).y = (float)local_1a8; tmpColor._tint[0] = (projectile->_color)._tint[0]; tmpColor._tint[1] = (projectile->_color)._tint[1]; tmpColor._tint[2] = (projectile->_color)._tint[2]; tmpColor._colorize[0] = (projectile->_color)._colorize[0]; tmpColor._colorize[1] = (projectile->_color)._colorize[1]; tmpColor._colorize[2] = (projectile->_color)._colorize[2]; tmpColor._colorize[3] = (projectile->_color)._colorize[3]; tmpColor._offset._0_8_ = *(undefined8 *)(projectile->_color)._offset; tmpColor._offset[2] = (projectile->_color)._offset[2]; tmpColor._tint[3] = 0.0; (**(code **)(*(int *)projectile + 0x3c))(&tmpColor,0xf,1,1,1); local_1b0 = (WeightedOutcomePicker)((int)local_1b0 + -1); projectile->_renderZOffset = 2000; } while (local_1b0 != (WeightedOutcomePicker)0x0); local_1b0 = (WeightedOutcomePicker)0x0; iVar8 = elapsedFrames; } } } stateFrame = npc->_stateFrame + iVar8; npc->_stateFrame = stateFrame; if (npc->_i1 < 0) { npc->_i1 = npc->_i1 + iVar8; } pfVar1 = (float *)puStack_20; if (0x1d < stateFrame) { uVar7 = Random(); WVar4 = (WeightedOutcomePicker)(uVar7 % 0x3c); pfVar1 = (float *)puStack_20; if (WVar4 == (WeightedOutcomePicker)0x0) { npc->_stateFrame = 0; npc->_projectileCooldown = -1; local_1a8 = (WeightedOutcomePicker)0xa; outcomePicker = WVar4; local_1c0.x = (float)WVar4; local_1c0.y = (float)WVar4; local_1ac = WVar4; local_14 = WVar4; std::vector<8byte>::_Emplace_reallocate(0,&local_1ac); if (npc->_projectileDelay < 1) { uVar7 = 0; outcomeCount = (int)local_1c0.x - (int)outcomePicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)outcomePicker + uVar7 * 8) == 1) { outcomeWeight = (undefined4 *)((int)outcomePicker + 4) + uVar7 * 2; *outcomeWeight = *outcomeWeight + 5; if (*outcomeWeight < 0) { ((undefined4 *)((int)outcomePicker + 4))[uVar7 * 2] = 0; } goto LAB_00581c3f; } uVar7 = uVar7 + 1; } while (uVar7 < outcomeCount); } local_1ac = (WeightedOutcomePicker)0x1; local_1a8 = (WeightedOutcomePicker)&DAT_00000005; if (local_1c0.x == local_1c0.y) { std::vector<8byte>::_Emplace_reallocate(local_1c0.x,&local_1ac); } else { *(undefined4 *)local_1c0.x = 1; *(undefined4 *)((int)local_1c0.x + 4) = 5; local_1c0.x = (float)((int)local_1c0.x + 8); } LAB_00581c3f: if (-1 < npc->_i1) { uVar7 = 0; outcomeCount = (int)local_1c0.x - (int)outcomePicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)outcomePicker + uVar7 * 8) == 2) { outcomeWeight = (undefined4 *)((int)outcomePicker + 4) + uVar7 * 2; *outcomeWeight = *outcomeWeight + 5; if (*outcomeWeight < 0) { ((undefined4 *)((int)outcomePicker + 4))[uVar7 * 2] = 0; } goto LAB_00581cb8; } uVar7 = uVar7 + 1; } while (uVar7 < outcomeCount); } local_1ac = (WeightedOutcomePicker)0x2; local_1a8 = (WeightedOutcomePicker)&DAT_00000005; if (local_1c0.x == local_1c0.y) { std::vector<8byte>::_Emplace_reallocate(local_1c0.x,&local_1ac); } else { *(undefined4 *)local_1c0.x = 2; *(undefined4 *)((int)local_1c0.x + 4) = 5; local_1c0.x = (float)((int)local_1c0.x + 8); } } } LAB_00581cb8: uVar7 = Random(); auStack_1ec = (undefined1 [8])0x900000005; fStack_1e4 = 9.80909e-45; rng._shift1 = 5; rng._seed = uVar7 | 1; rng._shift2 = 9; rng._shift3 = 7; uVar7 = WeightedOutcomePicker::PickOutcome(&outcomePicker,rng); if (uVar7 == 0) { ANM2::Play(&npc->_sprite,(byte *)"SpitDown",0); npc->_state = 8; } else if (uVar7 == 1) { ANM2::Play(&npc->_sprite,(byte *)"Summon",0); npc->_state = 0xd; Entity_NPC::PlaySound(npc,0xa7,1.0,10,0,0.6); npc->_projectileDelay = 10; } else if (uVar7 == 2) { ANM2::Play(&npc->_sprite,(byte *)"Retract",0); npc->_state = 4; uVar7 = Random(); npc->_i1 = uVar7 & 1; } local_14 = (WeightedOutcomePicker)0xffffffff; pfVar1 = (float *)puStack_20; if (outcomePicker != (WeightedOutcomePicker)0x0) { uVar7 = (int)local_1c0.y - (int)outcomePicker & 0xfffffff8; WVar4 = outcomePicker; if (0xfff < uVar7) { WVar4 = *(WeightedOutcomePicker *)((int)outcomePicker + -4); uVar7 = uVar7 + 0x23; if (0x1f < ((int)outcomePicker - (int)WVar4) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)WVar4,uVar7); pfVar1 = (float *)puStack_20; } } } break; case 4: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&tmpColor)[1]._offset, (npc->_sprite)._animState._isPlaying == 0 )) { puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"HeartbeatRetracted",0); if (npc->_projectileCooldown < 0) { npc->_projectileCooldown = 0; } } animState = &(npc->_sprite)._animState; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Sound"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0xd4,1.0,2,0,1.0); npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Shoot"), bVar2 != 0)) { Game::ShakeScreen(g_game,6); Entity_NPC::PlaySound(npc,0x141,1.0,2,0,1.0); rotgut_fire_projectiles(npc); } } local_1cc.y = 0.0; pfVar1 = (float *)puStack_20; if (0 < elapsedFrames) { do { roomRef = room; iVar8 = npc->_projectileCooldown; pfVar1 = (float *)puStack_20; if (iVar8 < 0) break; local_1a8 = (WeightedOutcomePicker)(iVar8 + 1); npc->_projectileCooldown = (int)local_1a8; uVar7 = iVar8 - 0x1d; if ((uVar7 < 0x3d) && (uVar7 == ((int)uVar7 / 0xf) * 0xf)) { if (npc->_i1 == 0) { local_1b0 = (WeightedOutcomePicker)(*(float *)((int)room + 0x14) - 80.0); } else { local_1b0 = (WeightedOutcomePicker)(*(float *)((int)room + 0x1c) + 80.0); } uVar7 = Random(); if ((uVar7 & 1) == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1d4 = (tmpEntity->_pos).y; } else { uVar7 = Random(); local_1d4 = *(float *)((int)roomRef + 0x18) + 40.0; local_1d4 = ((*(float *)((int)roomRef + 0x20) - 40.0) - local_1d4) * (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 + local_1d4; } uVar7 = Random(); auStack_1ec._4_4_ = local_1b0; fStack_1e4 = local_1d4; WVar4 = (WeightedOutcomePicker) Game::Spawn(g_game,0x37,0,(Vector *)(auStack_1ec + 4),&g_vectorZero,(Entity *)npc, 0,uVar7); *(uint *)((int)WVar4 + 0x168) = *(uint *)((int)WVar4 + 0x168) & 0xfffffffb; *(undefined4 *)((int)WVar4 + 0x16c) = *(undefined4 *)((int)WVar4 + 0x16c); local_1d8 = WVar4; (**(code **)(*(int *)WVar4 + 0xc))(); (((Entity *)((int)WVar4 + 0x818))->_posOffset).x = 7.00649e-45; *(int *)((int)WVar4 + 0x184) = 0; if (npc->_i1 == 0) { puVar10 = (undefined1 *)0x3f800000; } else { puVar10 = &DAT_bf800000; } local_1a8 = (WeightedOutcomePicker)((int)WVar4 + 0x48); *(float *)((int)WVar4 + 0x338) = 0.0; ((Vector *)((int)WVar4 + 0x334))->x = (float)puVar10 * 1.55; pbVar5 = *(void **)((int)WVar4 + 0x7c); if (pbVar5 == (byte *)0x0) { LAB_00582346: bVar2 = ANM2::SetAnimation((ANM2 *)((int)WVar4 + 0x48),&DAT_00b60d94,1); spawnedSprite = local_1a8; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)local_1a8 + 0x30)); *(byte *)((int)spawnedSprite + 0x44) = 1; WVar4 = local_1d8; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar6 = &DAT_00b60d94; do { bVar2 = *pbVar5; bVar9 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_00582326: uVar7 = -(uint)bVar9 | 1; goto LAB_0058232b; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_00582326; pbVar5 = pbVar5 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_0058232b: if ((uVar7 != 0) || ((*(char *)((int)*(void **)((int)WVar4 + 0x7c) + 0x34) != '\0' && (*(byte *)((int)WVar4 + 0x8c) == 0)))) goto LAB_00582346; } *(bool *)((int)WVar4 + 0x148) = npc->_i1 != 0; uVar7 = Random(); local_1a4 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.95; if (npc->_championColorIdx == 0x12) { local_1a4 = local_1a4 + 0.5; local_1b0 = (WeightedOutcomePicker)0xdd; } else { if (npc->_championColorIdx == 0x13) { local_1a4 = local_1a4 * 0.5; } local_1b0 = (WeightedOutcomePicker)0xdd; } LAB_00582629: manager = g_manager; seed_fart_sound_override((int *)&local_1b0); SoundEffects::Play(&manager->_sfxManager,(int)local_1b0,1.0,2,0,local_1a4,0.0); } else if ((local_1a8 == (WeightedOutcomePicker)0x78) && (uVar7 = Random(), uVar7 % 3 == 0)) { if (npc->_i1 == 0) { local_1b0 = (WeightedOutcomePicker)(*(float *)((int)room + 0x14) - 120.0); } else { local_1b0 = (WeightedOutcomePicker)(*(float *)((int)room + 0x1c) + 120.0); } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1a8 = (WeightedOutcomePicker)(tmpEntity->_pos).y; uVar7 = Random(); local_1c0.x = (float)local_1b0; local_1c0.y = (float)local_1a8; WVar4 = (WeightedOutcomePicker) Game::Spawn(g_game,0x356,0,&local_1c0,&g_vectorZero,(Entity *)npc,0,uVar7); *(uint *)((int)WVar4 + 0x168) = *(uint *)((int)WVar4 + 0x168) & 0xfffffffb; *(undefined4 *)((int)WVar4 + 0x16c) = *(undefined4 *)((int)WVar4 + 0x16c); local_1d8 = WVar4; (**(code **)(*(int *)WVar4 + 0xc))(); (((Entity *)((int)WVar4 + 0x818))->_posOffset).x = 7.00649e-45; *(int *)((int)WVar4 + 0x184) = 0; if (npc->_i1 == 0) { dirX = 1.0; } else { dirX = (float)&DAT_bf800000; } local_1a8 = (WeightedOutcomePicker)((int)WVar4 + 0x48); ((Vector *)((int)WVar4 + 0x334))->x = dirX; *(float *)((int)WVar4 + 0x338) = 0.0; pbVar5 = *(void **)((int)WVar4 + 0x7c); if (pbVar5 == (byte *)0x0) { LAB_00582580: bVar2 = ANM2::SetAnimation((ANM2 *)((int)WVar4 + 0x48),(byte *)"MoveHori",1); spawnedSprite = local_1a8; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)local_1a8 + 0x30)); *(byte *)((int)spawnedSprite + 0x44) = 1; WVar4 = local_1d8; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } expectedName = "MoveHori"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_00582560: uVar7 = -(uint)bVar9 | 1; goto LAB_00582565; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_00582560; pbVar5 = pbVar5 + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar7 = 0; LAB_00582565: if ((uVar7 != 0) || ((*(char *)((int)*(void **)((int)WVar4 + 0x7c) + 0x34) != '\0' && (*(byte *)((int)WVar4 + 0x8c) == 0)))) goto LAB_00582580; } *(bool *)((int)WVar4 + 0x148) = npc->_i1 != 0; uVar7 = Random(); local_1a4 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.95; if (npc->_championColorIdx == 0x12) { local_1a4 = local_1a4 + 0.5; } else if (npc->_championColorIdx == 0x13) { local_1a4 = local_1a4 * 0.5; } local_1b0 = (WeightedOutcomePicker)0x1fe; goto LAB_00582629; } if (0x96 < npc->_projectileCooldown) { npc->_entityCollisionClass = 4; pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_005826de: bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"ComeDown",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar6 = *(byte **)pbVar5; } expectedName = "ComeDown"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_005826c0: uVar7 = -(uint)bVar9 | 1; goto LAB_005826c5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_005826c0; pbVar6 = pbVar6 + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar7 = 0; LAB_005826c5: if ((uVar7 != 0) || ((pbVar5[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0))) ) goto LAB_005826de; } local_1a4 = 1.0; npc->_state = 3; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_1a4 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_1a4 = 0.5; } local_1b0 = (WeightedOutcomePicker)0xd5; seed_fart_sound_override((int *)&local_1b0); SoundEffects::Play(&manager->_sfxManager,(int)local_1b0,1.0,2,0,local_1a4,0.0); npc->_i1 = -0x5a; } local_1cc.y = (float)((int)local_1cc.y + 1); pfVar1 = (float *)puStack_20; } while ((int)local_1cc.y < elapsedFrames); } break; case 8: puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; if ((npc->_sprite)._animState._animData != (void *)0x0) { puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar2 != 0) { Game::ShakeScreen(g_game,10); Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&spitParams); bVar9 = npc->_state != 4; spitParams.FallingAccelModifier = 0.75; spitParams.BulletFlags._0_4_ = 0; spitParams.BulletFlags._4_4_ = 0x20000; spitParams.Scale = 2.2; local_1cc.x = 0.0; local_1cc.y = 5.0; if (bVar9) { local_1ac = (WeightedOutcomePicker)0x0; local_1a8 = (WeightedOutcomePicker)0x41a00000; } else { local_1dc = 0; local_1d8 = (WeightedOutcomePicker)0xc1a00000; } pWVar3 = &local_1a8; if (!bVar9) { pWVar3 = &local_1d8; } local_1b4 = (npc->_pos).x + 0.0; local_1b0 = (WeightedOutcomePicker)((float)*pWVar3 + (npc->_pos).y); NpcHelper::rotgut_fire_projectile(&local_1b4,&local_1cc,&spitParams); Color::Color(&tmpColor); bVar9 = npc->_state != 4; if (bVar9) { local_1ac = (WeightedOutcomePicker)0x0; local_1a8 = (WeightedOutcomePicker)0x41a00000; } else { local_1dc = 0; local_1d8 = (WeightedOutcomePicker)0xc1a00000; } pWVar3 = &local_1a8; if (!bVar9) { pWVar3 = &local_1d8; } local_1cc.x = (npc->_pos).x + 0.0; local_1cc.y = (float)*pWVar3 + (npc->_pos).y; tmpEntity = spawn_blood_explosion(4,&local_1cc,&g_vectorZero,color,&g_vectorZero); uVar7 = Random(); (tmpEntity->_sprite)._rotation = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar7 = Random(); fVar11 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 1.2; fVar12 = fVar11 * g_vectorOne.y; fVar11 = fVar11 * g_vectorOne.x; tmpEntity->_renderZOffset = 2000; (tmpEntity->_sprite)._scale.y = fVar12; (tmpEntity->_sprite)._scale.x = fVar11; } goto LAB_0058202d; } goto LAB_00582040; case 0xd: uVar7 = ANM2::GetFrame(&npc->_sprite); if ((uVar7 & 1) == 0) { Game::ShakeScreen(g_game,4); } LAB_0058202d: if ((npc->_sprite)._animState._animData != (void *)0x0) { pfVar1 = (float *)puStack_20; if ((npc->_sprite)._animState._isPlaying != 0) break; } LAB_00582040: npc->_state = 3; pfVar1 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar1; bVar2 = npc->_dead; fVar11 = (npc->_targetPosition).y; fVar12 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar11 - fVar12; if (bVar2 != 0) { uVar7 = 0; if (*(int *)((int)room + 0x1264) != 0) { do { iVar8 = *(int *)(*(int *)((int)room + 0x125c) + uVar7 * 4); if (((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 9)) && (*(Entity_NPC **)(iVar8 + 0x3bc) == npc)) { *(uint *)(iVar8 + 0x438) = *(uint *)(iVar8 + 0x438) & 0xfffeffff; *(uint *)(iVar8 + 0x43c) = *(uint *)(iVar8 + 0x43c) & 0xfffdffff; *(undefined1 *)(iVar8 + 0x173) = 1; } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)((int)room + 0x1264)); } Game::ShakeScreen(g_game,0x32); Entity_Effect::CreateTimer(FUN_005828b0,0xf,10,0); } ExceptionList = local_1c; return; } //@@ 005828b0 FUN_005828b0 void FUN_005828b0(void) { Manager *pMVar1; uint uVar2; Entity *pEVar3; float fVar4; float fVar5; int ID; int aiStack_18 [2]; Vector local_10; Room::GetRandomPosition(g_game->_room,&local_10,0.0); uVar2 = Random(); pEVar3 = Game::Spawn(g_game,1000,2,&local_10,&g_vectorZero,(Entity *)0x0,4,uVar2); (**(code **)(*(int *)pEVar3 + 0x3c))(&g_colorGreenSplat,0xffffffff); (pEVar3->_sprite)._offset.x = g_vectorZero.x; (pEVar3->_sprite)._offset.y = g_vectorZero.y; pEVar3->_renderDepthOffset = 10.0; uVar2 = Random(); (pEVar3->_sprite)._rotation = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar2 = Random(); fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 1.2; fVar5 = fVar4 * g_vectorOne.y; fVar4 = fVar4 * g_vectorOne.x; pEVar3->_renderZOffset = 5000; (pEVar3->_sprite)._scale.y = fVar5; (pEVar3->_sprite)._scale.x = fVar4; uVar2 = Random(); pMVar1 = g_manager; ID = 0x8d; fVar4 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; seed_fart_sound_override(aiStack_18 + -5); SoundEffects::Play(&pMVar1->_sfxManager,ID,1.0,2,0,fVar4,0.0); return; } //@@ 00582a60 FUN_00582a60 int FUN_00582a60(void) { int iVar1; int in_ECX; while (((iVar1 = *(int *)(in_ECX + 0x3bc), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { in_ECX = iVar1; } return in_ECX; } //@@ 00582a80 FUN_00582a80 int FUN_00582a80(void) { int iVar1; int in_ECX; while (((iVar1 = *(int *)(in_ECX + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { in_ECX = iVar1; } return in_ECX; } //@@ 00582aa0 FUN_00582aa0 void FUN_00582aa0(void) { int in_ECX; do { in_ECX = *(int *)(in_ECX + 0x3c0); if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 0x38d)) break; } while (*(int *)(in_ECX + 0x2c) == 10); return; } //@@ 00582ad0 FUN_00582ad0 undefined4 FUN_00582ad0(void) { int iVar1; int in_ECX; while (((iVar1 = *(int *)(in_ECX + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { in_ECX = iVar1; } return CONCAT31((int3)((uint)iVar1 >> 8),*(int *)(in_ECX + 0xb64) == 6); } //@@ 00582b00 FUN_00582b00 void FUN_00582b00(undefined4 *param_1) { int iVar1; undefined4 uVar2; int in_ECX; while (((iVar1 = *(int *)(in_ECX + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { in_ECX = iVar1; } uVar2 = *(undefined4 *)(in_ECX + 0x340); *param_1 = *(undefined4 *)(in_ECX + 0x33c); param_1[1] = uVar2; return; } //@@ 00582b40 FUN_00582b40 int FUN_00582b40(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x3c0); if (((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 0x38d)) || (*(int *)(iVar1 + 0x2c) != 10)) { iVar1 = 0; } return iVar1; } //@@ 00582b60 NpcHelper::scourge_spawn_chain /* DB: (kind 0/1/2, npc, pos) spawns ENTITY_SCOURGE (0x38d) variant 10 (chain) and sets its anim; called 5x from the Scourge body AI 0x587aa0 (misnamed Entity_Familiar::HandleCollision, dispatcher case for type 909 variant!=10) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl NpcHelper::scourge_spawn_chain (Vector *position,Vector *velocity,byte kind,Entity *parent,Vector *targetV1) { byte bVar1; uint seed; EntityPtr link; byte *curAnimName; uint uVar2; byte *anim; byte *cmpName; EntityPtr *pEVar3; Vector *parentSlot; EntityPtr *linkIt; bool isLess; float fVar4; float fVar5; EntityPtr *chainBegin; EntityPtr *chainEnd; EntityPtr *local_4c; Vector linkPos; Vector *local_40; uint chainKind; EntityPtr pushedLink; EntityPtr *eraseSlot; float local_30; float local_2c; EntityPtr *local_28; EntityPtr local_24; float chainDeltaY; float chainDeltaX; EntityPtr prevLink; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; int firstLink; puStack_c = &LAB_00af538d; local_10 = ExceptionList; ExceptionList = &local_10; pEVar3 = (EntityPtr *)0x0; chainBegin = (EntityPtr *)0x0; local_28 = (EntityPtr *)0x0; chainEnd = (EntityPtr *)0x0; local_4c = (EntityPtr *)0x0; local_8 = 0; local_2c = position->x; chainDeltaX = velocity->x; chainDeltaY = velocity->y; local_30 = position->y; local_40 = velocity; fVar4 = sqrtf(chainDeltaX * chainDeltaX + chainDeltaY * chainDeltaY); if (0.0 < fVar4) { chainDeltaX = chainDeltaX * (1.0 / fVar4); chainDeltaY = chainDeltaY * (1.0 / fVar4); } prevLink = (EntityPtr)0x0; local_24 = (EntityPtr)0x13; chainKind = (uint)(char)kind; chainDeltaX = (chainDeltaX * 10.0 + position->x) - local_2c; chainDeltaY = (chainDeltaY * 10.0 + position->y) - local_30; do { uVar2 = chainKind; linkPos.x = chainDeltaX * ((float)(int)local_24 / 19.0) + local_2c; linkPos.y = chainDeltaY * ((float)(int)local_24 / 19.0) + local_30; seed = Random(); link = (EntityPtr)Game::Spawn(g_game,0x38d,10,&linkPos,&g_vectorZero,(Entity *)0x0,uVar2,seed); ((Vector *)((int)link + 0xba4))->x = (float)local_24; *(float *)((int)link + 0xba0) = 2.8026e-44; *(uint *)((int)link + 0x168) = *(uint *)((int)link + 0x168) & 0xfffffffb; *(undefined4 *)((int)link + 0x16c) = *(undefined4 *)((int)link + 0x16c); pushedLink = link; if (prevLink != (EntityPtr)0x0) { pEVar3 = (EntityPtr *)((int)link + 0x3c0); if (*(EntityPtr *)((int)link + 0x3c0) != (EntityPtr)0x0) { eraseSlot = pEVar3; std::multiset::erase(&eraseSlot); } *pEVar3 = prevLink; std::multiset::insert(pEVar3); pEVar3 = (EntityPtr *)((int)prevLink + 0x3bc); if (*pEVar3 != (EntityPtr)0x0) { eraseSlot = pEVar3; std::multiset::erase(&eraseSlot); } *pEVar3 = link; std::multiset::insert(pEVar3); pEVar3 = local_28; } *(undefined4 *)((int)link + 0x350) = 0xc1a00000; prevLink = link; if (chainEnd == pEVar3) { std::vector<4byte>::_Emplace_reallocate(chainEnd,&pushedLink); local_28 = (EntityPtr *)0x0; pEVar3 = local_4c; } else { *chainEnd = link; chainEnd = chainEnd + 1; } firstLink = iRam00000000; local_24 = (EntityPtr)((int)local_24 + -1); } while (-1 < (int)local_24); local_24 = chainEnd[-1]; *(float *)(iRam00000000 + 0x360) = local_40->x; *(float *)(firstLink + 0x364) = local_40->y; local_30 = local_40->x; local_2c = local_40->y; fVar4 = sqrtf(local_30 * local_30 + local_2c * local_2c); if (fVar4 <= 0.0) { fVar5 = local_30; fVar4 = local_2c; } else { fVar5 = local_30 * (1.0 / fVar4); fVar4 = local_2c * (1.0 / fVar4); } *(float *)(firstLink + 0x334) = fVar5; *(float *)(firstLink + 0x338) = fVar4; *(undefined4 *)(firstLink + 0xc34) = 0x41700000; *(undefined4 *)(firstLink + 0xbc0) = 0x3cf5c28f; parentSlot = (Vector *)((int)local_24 + 0x3bc); if (parentSlot->x != 0.0) { local_40 = parentSlot; std::multiset::erase(&local_40); } parentSlot->x = (float)parent; if (parent != (Entity *)0x0) { std::multiset::insert(parentSlot); } link = local_24; *(float *)((int)local_24 + 0xbb0) = targetV1->x; anim = &DAT_00b62058; *(float *)((int)local_24 + 0xbb4) = targetV1->y; if (kind == 0) { anim = &DAT_00b6208c; } animData = *(byte **)((int)local_24 + 0x7c); if (animData != (byte *)0x0) { curAnimName = animData; cmpName = anim; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } do { bVar1 = *curAnimName; isLess = bVar1 < *cmpName; if (bVar1 != *cmpName) { LAB_00582ec0: uVar2 = -(uint)isLess | 1; goto LAB_00582ec5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < cmpName[1]; if (bVar1 != cmpName[1]) goto LAB_00582ec0; curAnimName = curAnimName + 2; cmpName = cmpName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00582ec5: if ((uVar2 == 0) && ((animData[0x34] == 0 || (*(char *)((int)local_24 + 0x8c) != '\0')))) goto LAB_00582ef3; } bVar1 = ANM2::SetAnimation((ANM2 *)((int)local_24 + 0x48),anim,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)link + 0x78)); *(undefined1 *)((int)link + 0x8c) = 1; } LAB_00582ef3: linkIt = chainBegin; if (chainEnd != (EntityPtr *)0x0) { do { (**(code **)(*(int *)*linkIt + 0xc))(); linkIt = linkIt + 1; } while (linkIt != chainEnd); } uVar2 = (uint)pEVar3 & 0xfffffffc; if ((0xfff < uVar2) && (uVar2 = uVar2 + 0x23, chainBegin = pERamfffffffc, 0x1f < 0xfffffffcU - (int)pERamfffffffc)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } operator_delete(chainBegin,uVar2); ExceptionList = local_10; return (Entity *)local_24; } //@@ 00582f60 NpcHelper::scourge_whip /* DB: ? walks the Scourge (909) variant 10 chain to its tail via child (+0x3c0) -> state 7, target zero; walks to the head via +0x3bc and plays "Whip1" (subtype 0) or "Whip2", SoundEffects::Play 0x48; only caller NpcAI::ENTITY_SCOURGE */ void NpcHelper::scourge_whip(void) { int iVar1; byte *pbVar2; Manager *pMVar3; byte bVar4; byte *pbVar5; uint uVar6; int in_ECX; int iVar7; byte *pbVar8; byte *anim; bool bVar9; int local_c; float local_8; iVar7 = in_ECX; while (((iVar1 = *(int *)(iVar7 + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { iVar7 = iVar1; } *(undefined4 *)(iVar7 + 0xb64) = 7; *(float *)(iVar7 + 0x334) = g_vectorZero.x; *(float *)(iVar7 + 0x338) = g_vectorZero.y; iVar7 = in_ECX; while (((iVar1 = *(int *)(iVar7 + 0x3bc), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { iVar7 = iVar1; } pbVar2 = *(byte **)(iVar7 + 0x7c); anim = &DAT_00b62058; if (*(int *)(in_ECX + 0x30) == 0) { anim = &DAT_00b6208c; } local_c = in_ECX; if (pbVar2 != (byte *)0x0) { pbVar5 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar5 = *(byte **)pbVar2; } pbVar8 = anim; do { bVar4 = *pbVar5; bVar9 = bVar4 < *pbVar8; if (bVar4 != *pbVar8) { LAB_00583024: uVar6 = -(uint)bVar9 | 1; goto LAB_00583029; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar9 = bVar4 < pbVar8[1]; if (bVar4 != pbVar8[1]) goto LAB_00583024; pbVar5 = pbVar5 + 2; pbVar8 = pbVar8 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00583029: if ((uVar6 == 0) && ((pbVar2[0x34] == 0 || (*(char *)(iVar7 + 0x8c) != '\0')))) goto LAB_00583051; } bVar4 = ANM2::SetAnimation((ANM2 *)(iVar7 + 0x48),anim,1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(iVar7 + 0x78)); *(undefined1 *)(iVar7 + 0x8c) = 1; } LAB_00583051: pMVar3 = g_manager; local_8 = 1.0; if (*(int *)(local_c + 0xc64) == 0x12) { local_8 = 1.5; } else if (*(int *)(local_c + 0xc64) == 0x13) { local_8 = 0.5; } local_c = 0x48; seed_fart_sound_override(&local_c); SoundEffects::Play(&pMVar3->_sfxManager,local_c,1.0,2,0,local_8,0.0); return; } //@@ 005830e0 FUN_005830e0 void FUN_005830e0(void) { int iVar1; int in_ECX; while (((iVar1 = *(int *)(in_ECX + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { in_ECX = iVar1; } *(undefined4 *)(in_ECX + 0xbc4) = 0; return; } //@@ 00583110 FUN_00583110 void FUN_00583110(char param_1) { int iVar1; int in_ECX; int iVar2; iVar2 = in_ECX; while (((iVar1 = *(int *)(iVar2 + 0x3bc), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { iVar2 = iVar1; } while (((iVar1 = *(int *)(in_ECX + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x38d)) && (*(int *)(iVar1 + 0x2c) == 10))) { in_ECX = iVar1; } *(bool *)(iVar2 + 0x148) = param_1 != '\0'; *(bool *)(in_ECX + 0x148) = param_1 != '\0'; return; } //@@ 00583170 FUN_00583170 void FUN_00583170(void) { int *piVar1; int *piVar2; int iVar3; int *in_ECX; int *piVar4; int *piVar5; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; float local_1c; float local_18; float local_14; float local_10; undefined4 local_c; undefined4 local_8; piVar4 = in_ECX; while (((piVar1 = (int *)piVar4[0xef], piVar1 != (int *)0x0 && (piVar1[10] == 0x38d)) && (piVar1[0xb] == 10))) { piVar4 = piVar1; } piVar5 = in_ECX; while (((piVar2 = (int *)piVar5[0xf0], piVar2 != (int *)0x0 && (piVar2[10] == 0x38d)) && (piVar2[0xb] == 10))) { piVar5 = piVar2; } if (((piVar4[0x2e9] != 0) || (piVar5[0x2e9] != in_ECX[0x2e8] + -1)) || ((piVar1 == (int *)0x0 || (*(char *)((int)piVar1 + 0x173) != '\0')))) { while (((piVar4 = (int *)in_ECX[0xef], piVar4 != (int *)0x0 && (piVar4[10] == 0x38d)) && (piVar4[0xb] == 10))) { in_ECX = piVar4; } while( true ) { iVar3 = in_ECX[0xf0]; if (((iVar3 == 0) || (*(int *)(iVar3 + 0x28) != 0x38d)) || (*(int *)(iVar3 + 0x2c) != 10)) { iVar3 = 0; } if (iVar3 == 0) break; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = 0; local_1c = g_vectorZero.x; local_18 = g_vectorZero.y; local_14 = g_vectorZero.x; local_10 = g_vectorZero.y; local_c = 0; local_8 = 0; (**(code **)(*in_ECX + 0x24))(&local_2c); in_ECX = (int *)in_ECX[0xf0]; if (((in_ECX == (int *)0x0) || (in_ECX[10] != 0x38d)) || (in_ECX[0xb] != 10)) { in_ECX = (int *)0x0; } } } return; } //@@ 005832c0 Entity_Pickup::GetLootList /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall LootList Entity_Pickup::GetLootList(bool ShouldAdvance, Entity_Player* player); prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Pickup::GetLootList(Entity_Pickup *this,Vector *renderOffset) { void *pvVar1; char cVar2; EntityPtr segment; uint uVar3; int iVar4; LayerState *layer; undefined *shader; int *piVar5; void *pvVar6; byte lowerChar; float *pfVar7; uint uVar8; ANM2 *sprite; float *pfVar9; char *shaderNameCursor; bool bVar10; float fVar11; double dVar12; undefined1 auStackY_220 [128]; Vector *image; int *imageRefCount; float quad; float local_184; float local_180; float local_17c; float local_178; float local_174; float local_170; float local_16c; Vector cornerC; Vector cornerB; Vector cornerA; float local_f0; KColor local_dc; void *uvQuads; float *uvQuadsEnd; float *uvQuadsCap; void *posQuads; void *posQuadsEnd; void *posQuadsCap; float local_b0; float *local_ac; void *local_a8; Vector *local_a4; float halfWidth; float local_9c; void *points; float *pointsEnd; float *pointsCap; float local_8c; Entity_Pickup *pickup; float *layerFrame; float local_80; Vector *texture; int *local_78; float local_74; float *pointsCapCache; void *local_6c; float local_68; void *local_64; float pixelScale; EntityPtr local_5c; void *local_58; float local_54; ColorMod spriteColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; byte shaderNameChar; puStack_20 = (undefined1 *)(&spriteColor)[1]._offset; puStack_18 = &LAB_00af53de; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&spriteColor)[1]._colorize + 1); ExceptionList = &local_1c; pfVar7 = (float *)0x0; local_a4 = renderOffset; local_64 = (void *)0x0; points = (void *)0x0; pointsEnd = (float *)0x0; pointsCapCache = (float *)0x0; pointsCap = (float *)0x0; uvQuads = (void *)0x0; uvQuadsEnd = (float *)0x0; local_ac = (float *)0x0; uvQuadsCap = (float *)0x0; posQuads = (void *)0x0; posQuadsEnd = (void *)0x0; local_a8 = (void *)0x0; posQuadsCap = (void *)0x0; local_14 = 2.8026e-45; spriteColor._tint[0] = (this->_sprite)._color._tint[0]; spriteColor._tint[1] = (this->_sprite)._color._tint[1]; spriteColor._tint[2] = (this->_sprite)._color._tint[2]; spriteColor._tint[3] = (this->_sprite)._color._tint[3]; spriteColor._offset[2] = (this->_sprite)._color._offset[2]; spriteColor._colorize[0] = (this->_sprite)._color._colorize[0]; spriteColor._colorize[1] = (this->_sprite)._color._colorize[1]; spriteColor._colorize[2] = (this->_sprite)._color._colorize[2]; spriteColor._colorize[3] = (this->_sprite)._color._colorize[3]; spriteColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; local_5c = (EntityPtr)this; while (((segment = *(EntityPtr *)((int)local_5c + 0x3c0), segment != (EntityPtr)0x0 && (*(int *)((int)segment + 0x28) == 0x38d)) && (*(int *)((int)segment + 0x2c) == 10))) { local_5c = segment; } local_68 = 0.0; segment = (EntityPtr)this; while (((segment = *(EntityPtr *)((int)segment + 0x3c0), segment != (EntityPtr)0x0 && (*(int *)((int)segment + 0x28) == 0x38d)) && (*(int *)((int)segment + 0x2c) == 10))) { local_68 = (float)((int)local_68 + 1); } pickup = this; pfVar9 = (&spriteColor)[1]._offset; if ((this->_sprite)._animState._animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); pfVar9 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar9; if (*(int *)((int)(pickup->_sprite)._animState._animation + 0x80) < 1) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } pvVar6 = (pickup->_sprite)._animState._animData; if ((pvVar6 != (void *)0x0) && (-1 < *(int *)((int)(pickup->_sprite)._animState._animation + 0x80))) { iVar4 = *(int *)((int)pvVar6 + 0x38); if (iVar4 < 0) { ExceptionList = local_1c; return; } if (*(int *)((int)pvVar6 + 0x1c) <= iVar4) { ExceptionList = local_1c; return; } local_58 = (void *)(iVar4 * 0x10 + *(int *)((int)(pickup->_sprite)._animState._animData + 0x18)) ; iVar4 = *(int *)((int)(pickup->_sprite)._animState._layerFrames + iVar4 * 4); if (iVar4 < 0) { ExceptionList = local_1c; return; } if (*(int *)((int)local_58 + 8) <= iVar4) { ExceptionList = local_1c; return; } layerFrame = (float *)(iVar4 * 0x6c + *(int *)((int)local_58 + 4)); if (layerFrame == (float *)0x0) { ExceptionList = local_1c; return; } halfWidth = layerFrame[2] * 0.5 * (pickup->_sprite)._scale.x; if ((pickup->_subtype == 0) && (*(int *)((int)local_5c + 0xb64) == 6)) { fVar11 = (layerFrame[3] - 16.0) * (pickup->_sprite)._scale.y; } else { fVar11 = (pickup->_sprite)._scale.y * layerFrame[3]; } segment = pickup->_child; local_8c = (pickup->_posOffset).x + (pickup->_pos).x; local_5c = (EntityPtr)((pickup->_posOffset).y + (pickup->_pos).y); local_6c = (void *)(fVar11 / (float)(int)local_68); if (((segment != (EntityPtr)0x0) && (*(int *)((int)segment + 0x28) == 0x38d)) && (*(int *)((int)segment + 0x2c) == 10)) { do { local_9c = *(float *)((int)segment + 0x34c) + *(float *)((int)segment + 0x33c); local_58 = (void *)(*(float *)((int)segment + 0x350) + *(float *)((int)segment + 0x340)); local_64 = (void *)(local_9c - local_8c); local_68 = (float)local_58 - (float)local_5c; fVar11 = sqrtf((float)local_64 * (float)local_64 + local_68 * local_68); if (0.0 < fVar11) { local_64 = (void *)((float)local_64 * (1.0 / fVar11)); local_68 = local_68 * (1.0 / fVar11); } local_8c = (local_8c - 60.0) * 0.65; local_5c = (EntityPtr)(((float)local_5c - 140.0) * 0.65); local_54 = (g_screenHeight - 182.0) * 0.5 + (float)local_5c; pixelScale = g_displayPixelRatio * g_screenPointScale; local_74 = ((g_screenWidth - 338.0) * 0.5 + local_8c) * pixelScale + 0.5; dVar12 = floor((double)local_74); local_74 = (float)dVar12 / pixelScale; local_54 = local_54 * pixelScale + 0.5; dVar12 = floor((double)local_54); local_54 = (float)dVar12; local_b0 = -local_68; fVar11 = layerFrame[6]; if (pfVar7 == pointsCapCache) { std::vector::_Emplace_reallocate(); pointsCapCache = pointsCap; } else { *pfVar7 = local_74 + halfWidth * fVar11 * local_b0; pfVar7[1] = local_54 / pixelScale + (float)local_64 * halfWidth * fVar11; pointsEnd = pfVar7 + 2; } pfVar7 = pointsEnd; local_74 = (g_screenHeight - 182.0) * 0.5 + (float)local_5c; pixelScale = g_displayPixelRatio * g_screenPointScale; local_54 = ((g_screenWidth - 338.0) * 0.5 + local_8c) * pixelScale + 0.5; dVar12 = floor((double)local_54); local_5c = (EntityPtr)((float)dVar12 / pixelScale); local_54 = local_74 * pixelScale + 0.5; dVar12 = floor((double)local_54); local_54 = (float)dVar12; local_80 = -(float)local_64; fVar11 = layerFrame[6]; if (pfVar7 == pointsCapCache) { std::vector::_Emplace_reallocate(); pointsCapCache = pointsCap; } else { *pfVar7 = (float)local_5c + local_68 * halfWidth * fVar11; pfVar7[1] = local_54 / pixelScale + local_80 * halfWidth * fVar11; pointsEnd = pfVar7 + 2; } pfVar7 = pointsEnd; local_8c = (local_9c - 60.0) * 0.65; local_78 = (int *)(((float)local_58 - 140.0) * 0.65); local_74 = (g_screenHeight - 182.0) * 0.5 + (float)local_78; pixelScale = g_displayPixelRatio * g_screenPointScale; local_54 = ((g_screenWidth - 338.0) * 0.5 + local_8c) * pixelScale + 0.5; dVar12 = floor((double)local_54); local_5c = (EntityPtr)((float)dVar12 / pixelScale); local_54 = local_74 * pixelScale + 0.5; dVar12 = floor((double)local_54); local_54 = (float)dVar12; cornerC.y = local_54 / pixelScale + (float)local_64 * halfWidth * layerFrame[6]; cornerC.x = halfWidth * layerFrame[6] * local_b0 + (float)local_5c; if (pfVar7 == pointsCapCache) { std::vector::_Emplace_reallocate(); pointsCapCache = pointsCap; } else { *pfVar7 = cornerC.x; pfVar7[1] = cornerC.y; pointsEnd = pfVar7 + 2; } pfVar7 = pointsEnd; local_b0 = (g_screenHeight - 182.0) * 0.5 + (float)local_78; pixelScale = g_displayPixelRatio * g_screenPointScale; local_78 = (int *)(((g_screenWidth - 338.0) * 0.5 + local_8c) * pixelScale + 0.5); dVar12 = floor((double)(float)local_78); local_54 = (float)dVar12 / pixelScale; local_78 = (int *)(local_b0 * pixelScale + 0.5); dVar12 = floor((double)(float)local_78); local_78 = (int *)(float)dVar12; local_f0 = (float)local_78 / pixelScale + local_80 * halfWidth * layerFrame[6]; if (pfVar7 == pointsCapCache) { std::vector::_Emplace_reallocate(); pointsCapCache = pointsCap; } else { *pfVar7 = local_68 * halfWidth * layerFrame[6] + local_54; pfVar7[1] = local_f0; pointsEnd = pfVar7 + 2; } segment = *(EntityPtr *)((int)segment + 0x3c0); local_8c = local_9c; local_5c = (EntityPtr)local_58; pfVar7 = pointsEnd; } while (((segment != (EntityPtr)0x0) && (*(int *)((int)segment + 0x28) == 0x38d)) && (*(int *)((int)segment + 0x2c) == 10)); local_64 = points; } pfVar9 = (float *)0x0; uVar8 = (int)pfVar7 - (int)local_64 >> 3; if (0 < (int)uVar8) { uVar3 = uVar8 & 0x80000003; bVar10 = uVar3 == 0; if ((int)uVar3 < 0) { bVar10 = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar10) { local_80 = layerFrame[1]; pfVar7 = (float *)((int)local_64 + 0x1c); local_58 = (void *)((uVar8 - 1 >> 2) + 1); do { local_dc._unk = CONCAT31(local_dc._unk._1_3_,1); if ((pickup->_sprite)._flipX == 0) { local_dc._red = *layerFrame; local_dc._blue = local_dc._red + layerFrame[2]; } else { local_dc._blue = *layerFrame; local_dc._red = local_dc._blue + layerFrame[2]; } local_dc._green = local_80 + (float)local_6c; if (pfVar9 == local_ac) { local_dc._alpha = local_dc._green; local_80 = local_dc._green; std::vector::_Emplace_reallocate(); local_ac = uvQuadsCap; } else { pfVar9[1] = 0.0; *pfVar9 = 0.0; pfVar9[3] = 0.0; pfVar9[2] = 0.0; pfVar9[5] = 0.0; pfVar9[4] = 0.0; pfVar9[7] = 0.0; pfVar9[6] = 0.0; *pfVar9 = local_dc._red; pfVar9[1] = local_80; pfVar9[2] = local_dc._blue; pfVar9[3] = local_80; pfVar9[4] = local_dc._red; pfVar9[5] = local_dc._green; pfVar9[6] = local_dc._blue; pfVar9[7] = local_dc._green; pfVar9[8] = (float)local_dc._unk; uvQuadsEnd = pfVar9 + 9; local_80 = local_dc._green; } pfVar9 = uvQuadsEnd; local_dc._unk = 0; local_dc._red = 1.0; local_dc._green = 1.0; local_dc._blue = 1.0; local_dc._alpha = 1.0; ColorQuad::ColorQuad(&quad,&local_dc); local_170 = local_a4->x; local_16c = local_a4->y; quad = local_170 + pfVar7[-7]; local_184 = local_16c + pfVar7[-6]; local_180 = local_170 + pfVar7[-5]; local_17c = local_16c + pfVar7[-4]; local_178 = local_170 + pfVar7[-3]; local_170 = local_170 + pfVar7[-1]; local_174 = local_16c + pfVar7[-2]; local_16c = local_16c + *pfVar7; if (posQuadsEnd == local_a8) { std::vector::_Emplace_reallocate(); local_a8 = posQuadsCap; } else { render_quad_copy(posQuadsEnd,&quad); posQuadsEnd = (void *)((int)posQuadsEnd + 0x70); } local_dc._blue = (float)g_graphicsManager_blendMode[2]; local_dc._red = (float)g_graphicsManager_blendMode[0]; pfVar7 = pfVar7 + 8; local_58 = (void *)((int)local_58 + -1); } while (local_58 != (void *)0x0); local_80 = (float)g_graphicsManager_blendMode[4]; iVar4 = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { iVar4 = 6; } g_graphicsManager_blendMode[0] = 0; sprite = &pickup->_sprite; g_graphicsManager_blendMode[2] = 7; local_dc._green = (float)g_graphicsManager_blendMode[1]; local_dc._alpha = (float)g_graphicsManager_blendMode[3]; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; g_graphicsManager_blendMode[1] = iVar4; layer = ANM2::GetLayer(sprite,(byte *)0x0); layer->_wrapSMode = 0; layer = ANM2::GetLayer(sprite,(byte *)0x0); layer->_wrapTMode = 0; layer = ANM2::GetLayer(sprite,(byte *)0x0); LayerState::GetTexture(layer,&texture); local_14 = (float)CONCAT31(local_14._1_3_,3); if (texture != (Vector *)0x0) { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_f0 = 0.0; local_9c = (float)(((int)pfVar9 - (int)uvQuads) / 0x24); g_currentShader = shader; if (local_9c != 0.0) { local_58 = uvQuads; local_6c = posQuads; do { piVar5 = local_78; image = (Vector *)0x0; imageRefCount = (int *)0x0; local_a4 = texture; if (local_78 != (int *)0x0) { cVar2 = (**(code **)(*local_78 + 4))(); if (cVar2 != '\0') { if (((imageRefCount != (int *)0x0) && (cVar2 = (**(code **)(*imageRefCount + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStackY_220 + 0x84); } image = local_a4; imageRefCount = piVar5; } } apply_sprite_shader_params(&spriteColor,1,image,imageRefCount); pvVar1 = local_58; pvVar6 = local_6c; (**(code **)((int)texture->x + 0x14))(local_58); local_6c = (void *)((int)pvVar6 + 0x70); local_58 = (void *)((int)pvVar1 + 0x24); local_9c = (float)((int)local_9c + -1); } while (local_9c != 0.0); } } fVar11 = 7.54039e-42; g_graphicsManager_blendMode[0] = (int)local_dc._red; shaderNameCursor = "KAGE_ColorTextureShader"; g_graphicsManager_blendMode[1] = (int)local_dc._green; g_graphicsManager_blendMode[2] = (int)local_dc._blue; g_graphicsManager_blendMode[3] = (int)local_dc._alpha; g_graphicsManager_blendMode[4] = (int)local_80; shaderNameChar = 0x4b; do { shaderNameCursor = shaderNameCursor + 1; lowerChar = shaderNameChar + 0x20; if (0x19 < (byte)(shaderNameChar + 0xbf)) { lowerChar = shaderNameChar; } uVar8 = (uint)lowerChar; if (lowerChar == 0x5c) { uVar8 = 0x2f; } fVar11 = (float)((int)fVar11 * 0x21 + uVar8); shaderNameChar = *shaderNameCursor; } while (shaderNameChar != 0); local_6c = (void *)fVar11; _Find_lower_bound<>(); if (((*(char *)((int)local_f0 + 0xd) == '\0') && ((uint)*(float *)((int)local_f0 + 0x10) <= (uint)fVar11)) && (local_f0 != DAT_00c379bc)) { piVar5 = (int *)std::map::operator_index(); pvVar6 = (void *)*piVar5; if ((pvVar6 != (void *)0x0) && ((*(byte *)((int)pvVar6 + 4) & 1) != 0)) { g_currentShader = pvVar6; } } local_14 = (float)CONCAT31(local_14._1_3_,4); if (((local_78 != (int *)0x0) && (cVar2 = (**(code **)(*local_78 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } if (posQuads != (void *)0x0) { uVar8 = (((int)local_a8 - (int)posQuads) / 0x70) * 0x70; pvVar6 = posQuads; if (0xfff < uVar8) { pvVar6 = *(void **)((int)posQuads + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)posQuads + (-4 - (int)pvVar6))) goto LAB_00584103; } operator_delete(pvVar6,uVar8); } if (uvQuads != (void *)0x0) { uVar8 = (((int)local_ac - (int)uvQuads) / 0x24) * 0x24; pvVar6 = uvQuads; if (0xfff < uVar8) { pvVar6 = *(void **)((int)uvQuads + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)uvQuads + (-4 - (int)pvVar6))) goto LAB_00584103; } operator_delete(pvVar6,uVar8); } } } if (local_64 != (void *)0x0) { uVar8 = (int)pointsCapCache - (int)local_64 & 0xfffffff8; pvVar6 = local_64; if (0xfff < uVar8) { pvVar6 = *(void **)((int)local_64 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)local_64 + (-4 - (int)pvVar6))) { LAB_00584103: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar8); } } ExceptionList = local_1c; return; } //@@ 00584140 NpcAI::ENTITY_SCOURGE_chain /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* WARNING: Exceeded maximum restarts with more pending */ /* DB: 909.10 chain segment; NpcTable named it ENTITY_SCOURGE */ void __fastcall NpcAI::ENTITY_SCOURGE_chain(Entity_NPC *npc) { code *pcVar1; longlong lVar2; longlong lVar3; longlong lVar4; Vector pos; byte bVar5; undefined1 uVar6; char cVar7; byte *animNameChar; uint uVar8; EntityPtr EVar9; Entity_NPC *pEVar10; int iVar11; EntityRef *sourceRef; float *pfVar12; Entity *pEVar13; Vector *pVVar14; int *piVar15; Entity_Effect *splat; ColorMod *color; EntityPtr EVar16; uint uVar17; char *animName; float *pfVar18; int unusedArg; void *pvVar19; float *extraout_ECX; uint uVar20; Game *pGVar21; PlayerManager *playerManager; void **ppvVar22; bool bVar23; bool bVar24; float fVar25; double dVar26; float fVar27; float fVar28; EntityPtr maxDamage; ulonglong timeNs; byte addEnemyKillScore; undefined1 auStack_374 [4]; int *local_370; void **local_36c; EntityPtr local_368; uint spawnVariant; Room *local_360; float local_35c; uint spawnSubType; EntityPtr *local_354; Game *game; EntityPtr local_34c; uint spawnType; EntityPtr local_344; Entity_NPC *local_340; uint uStack_338; Vector creepPos; float local_324; Vector creepTargetPos; Vector dirToFirstSegment; uint spawnTypeIn; void *pvStack_30c; EntityPtr *bossSlot; Vector gibPos; EntityPtr *parentSlot; EntityPtr *childSlot; float nextSpeedFast; float nextSpeed; uint collectibleKey; EntityRef charmSource; Vector bloodVel; Vector wallDir; Vector gibVel; Vector toFirstSegment; int spawnedTypeKey; int spawnedVariantKey; int aiStack_298 [2]; Vector projectileTarget; Vector impactBloodVel; Vector impactGibVel; Vector impactGibPos; Vector tipOffset; Vector VStack_268; undefined8 uStack_25c; undefined4 uStack_254; EntityRef brimstoneMarkSource; EntityRef shrinkSource; EntityRef damageSource; EntityRef bossDamageSource; undefined1 auStack_170 [4]; undefined1 auStack_16c [8]; int iStack_164; Vector tipDir; Vector clampedGibPos; EntityRef local_150; EntityRef EStack_128; RNG cardRng; ProjectileParams projectileParams; Color bloodColor; float wallRotations [4]; uint local_c; byte *animData; undefined4 flagsHigh; ProceduralItemManager *proceduralItemManager; Room *room; EntityPtr *spawnerSlot; local_c = __security_cookie ^ (uint)auStack_374; local_360 = g_game->_room; wallRotations[0] = 90.0; wallRotations[1] = 180.0; wallRotations[2] = -90.0; wallRotations[3] = 0.0; local_34c = (EntityPtr)npc; if (npc->_aiCallPhase == 1) { if (npc->_dead == 0) { return; } EVar9 = (EntityPtr)npc; do { EVar9 = *(EntityPtr *)((int)EVar9 + 0x3bc); if ((EVar9 == (EntityPtr)0x0) || (*(int *)((int)EVar9 + 0x28) != 0x38d)) break; } while (*(int *)((int)EVar9 + 0x2c) == 10); EVar9 = (EntityPtr)npc; do { EVar9 = *(EntityPtr *)((int)EVar9 + 0x3c0); if ((EVar9 == (EntityPtr)0x0) || (*(int *)((int)EVar9 + 0x28) != 0x38d)) break; } while (*(int *)((int)EVar9 + 0x2c) == 10); if (npc->_parent != (EntityPtr)0x0) { parentSlot = &npc->_parent; std::multiset::erase(&parentSlot); } npc->_parent = (EntityPtr)0x0; if (npc->_child != (EntityPtr)0x0) { childSlot = &npc->_child; std::multiset::erase(&childSlot); } npc->_child = (EntityPtr)0x0; FUN_00583170(); FUN_00583170(); animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } animName = "WallImpact"; do { bVar5 = *animNameChar; bVar23 = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_00584290: uVar8 = -(uint)bVar23 | 1; goto LAB_00584295; } if (bVar5 == 0) break; bVar5 = animNameChar[1]; bVar23 = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_00584290; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar5 != 0); uVar8 = 0; LAB_00584295: if (uVar8 == 0) { if (animData[0x34] == 0) { return; } if ((npc->_sprite)._animState._isPlaying != 0) { return; } } } bVar5 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WallImpact",1); if (bVar5 == 0) { return; } AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; return; } if (npc->_state == 0) { *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 3; npc->_aiCallFlags = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_stateFrame = -1; npc->_isBoss = 0; fVar28 = g_colorGreenSplat._tint[3]; fVar27 = g_colorGreenSplat._tint[2]; fVar25 = g_colorGreenSplat._tint[1]; if (&npc->_splatColor != &g_colorGreenSplat) { (npc->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar25; (npc->_splatColor)._tint[2] = fVar27; (npc->_splatColor)._tint[3] = fVar28; fVar28 = g_colorGreenSplat._colorize[3]; fVar27 = g_colorGreenSplat._colorize[2]; fVar25 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar25; (npc->_splatColor)._colorize[2] = fVar27; (npc->_splatColor)._colorize[3] = fVar28; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } } if (npc->_dead != 0) { return; } EVar9 = (EntityPtr)FUN_00582a60(); local_344 = EVar9; pEVar10 = (Entity_NPC *)FUN_00582a80(); bossSlot = (EntityPtr *)((int)EVar9 + 0x3bc); local_340 = pEVar10; if ((*bossSlot == (EntityPtr)0x0) || (fVar25 = *(float *)((int)EVar9 + 0x340) - (npc->_pos).y, fVar27 = ((Vector *)((int)EVar9 + 0x33c))->x - (npc->_pos).x, fVar25 = sqrtf(fVar25 * fVar25 + fVar27 * fVar27), *(float *)((int)npc->_config + 0x38) + *(float *)((int)*bossSlot + 0x370) + 10.0 < fVar25)) { iVar11 = 4; } else { iVar11 = 0; } npc->_entityCollisionClass = iVar11; if (npc->_state != 0) { FUN_00583170(); } if ((EntityPtr)npc == EVar9) { if (0.0 <= (pEVar10->_pos).y - (npc->_pos).y) { fVar25 = 100.0; } else { fVar25 = -100.0; } npc->_renderDepthOffset = fVar25; if (npc->_subtype == 0) { fVar25 = (pEVar10->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar25 && fVar25 != (npc->_pos).x; } EVar16 = npc->_parent; if (EVar16 == (EntityPtr)0x0) { sourceRef = EntityRef::EntityRef(&local_150); (**(code **)(*(int *)npc + 0x24))(sourceRef); goto LAB_0058617f; } fVar28 = (*(float *)((int)EVar16 + 0x340) + (npc->_v1).y) - (npc->_pos).y; (npc->_velocity).x = (*(float *)((int)EVar16 + 0x33c) + (npc->_v1).x) - (npc->_pos).x; } else { if (npc == pEVar10) { if (npc->_state != 6) { if (npc->_state == 7) { fVar25 = *(float *)((int)EVar9 + 0x340); fVar27 = (npc->_pos).y; (npc->_velocity).x = (*(float *)((int)EVar9 + 0x33c) - (npc->_pos).x) * 0.5; (npc->_velocity).y = (fVar25 - fVar27) * 0.5; fVar25 = npc->_speedMultiplier; npc->_friction = 1.0; fVar27 = 0.8; if (fVar25 != 1.0) { fVar27 = 0.8 / ((fVar25 + 0.8) - fVar25 * 0.8); } local_36c = (void **)(fVar27 * *(float *)((int)EVar9 + 0xe4)); *(void ***)((int)EVar9 + 0xe4) = local_36c; *(float *)((int)EVar9 + 0xe8) = *(float *)((int)EVar9 + 0xe8) * fVar27; fVar25 = *(float *)((int)EVar9 + 0x340) - (npc->_pos).y; fVar27 = *(float *)((int)EVar9 + 0x33c) - (npc->_pos).x; fVar25 = sqrtf(fVar25 * fVar25 + fVar27 * fVar27); if ((fVar25 < 10.0) || ((float)local_36c < 0.1)) { while( true ) { (**(code **)(*(int *)EVar9 + 0x28))(); EVar9 = *(EntityPtr *)((int)EVar9 + 0x3c0); if (EVar9 == (EntityPtr)0x0) { return; } if (*(int *)((int)EVar9 + 0x28) != 0x38d) break; if (*(int *)((int)EVar9 + 0x2c) != 10) { return; } } return; } } else { npc->_mass = 1000.0; bVar5 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero); if (bVar5 == 0) { local_354 = (EntityPtr *) (extraout_ECX[1] * 10.0 * npc->_speedMultiplier + (npc->_velocity).y); local_36c = (void **)(*extraout_ECX * 10.0 * npc->_speedMultiplier + (npc->_velocity).x) ; (npc->_velocity).y = (float)local_354; (npc->_velocity).x = (float)local_36c; fVar25 = sqrtf((float)local_354 * (float)local_354 + (float)local_36c * (float)local_36c ); room = local_360; if ((80.0 < fVar25) && (0.0 < fVar25)) { (npc->_velocity).y = (80.0 / fVar25) * (float)local_354; (npc->_velocity).x = (80.0 / fVar25) * (float)local_36c; } fVar25 = (npc->_pos).x; fVar27 = (local_360->_topLeftPos).x - 34.0; if (fVar27 <= fVar25) { if (fVar25 <= (local_360->_bottomRightPos).x + 34.0) { fVar28 = (npc->_pos).y; if (((local_360->_topLeftPos).y - 34.0) + 20.0 <= fVar28) { if (fVar28 <= (local_360->_bottomRightPos).y + 34.0 + 20.0) goto LAB_0058617f; local_360 = (Room *)0x3; } else { local_360 = (Room *)0x1; } } else { local_360 = (Room *)0x2; } } else { local_360 = (Room *)0x0; } if (fVar27 <= fVar25) { fVar27 = (room->_bottomRightPos).x + 34.0; if (fVar27 < fVar25) { (npc->_pos).x = fVar27; } } else { (npc->_pos).x = fVar27; } fVar25 = (npc->_pos).y; fVar27 = ((room->_topLeftPos).y - 34.0) + 20.0; if ((fVar25 < fVar27) || (fVar27 = (room->_bottomRightPos).y + 34.0 + 20.0, fVar27 < fVar25)) { (npc->_pos).y = fVar27; } Entity_NPC::PlaySound(npc,0x4d,1.0,2,0,1.0); Game::ShakeScreen(g_game,8); Color::Color(&bloodColor); impactBloodVel.x = 0.0; uVar8 = Random(); pVVar14 = &npc->_pos; impactBloodVel.y = -10.0 - (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 20.0; pEVar13 = spawn_blood_explosion(4,pVVar14,&impactBloodVel,color,&g_vectorZero); (**(code **)(*(int *)pEVar13 + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); iVar11 = 6; do { uVar8 = Random(); local_36c = (void **)(((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 45.0 * 0.017453292); local_354 = (EntityPtr *)cos((float)local_36c); fVar28 = sin((float)local_36c); fVar25 = (npc->_targetPosition).x; fVar27 = (npc->_targetPosition).y; local_368 = (EntityPtr)((float)local_354 * fVar25 - fVar28 * fVar27); local_34c = (EntityPtr)(fVar28 * fVar25 + (float)local_354 * fVar27); uVar8 = Random(); fVar25 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; impactGibPos.x = (float)local_368 * fVar25 * 12.0 + pVVar14->x; impactGibPos.y = (float)local_34c * fVar25 * 12.0 + (npc->_pos).y; uVar8 = Random(); impactGibVel.x = (float)local_368 * 5.0; impactGibVel.y = (float)local_34c * 5.0; pEVar13 = Game::SpawnEx(g_game,1000,4,&impactGibPos,&impactGibVel,(Entity *)0x0,0, uVar8,0); (**(code **)(*(int *)pEVar13 + 0xc))(); EVar9 = local_344; iVar11 = iVar11 + -1; } while (iVar11 != 0); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; (npc->_targetPosition).x = pVVar14->x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 6; fVar25 = *(float *)((int)local_344 + 0x340) - (npc->_pos).y; fVar27 = *(float *)((int)local_344 + 0x33c) - pVVar14->x; fVar25 = sqrtf(fVar25 * fVar25 + fVar27 * fVar27); (npc->_v2).x = fVar25; npc->_i1 = 0x3d75c28f; animName = "Whip2_Latched"; if (npc->_subtype == 0) { animName = "Whip1_Latched"; } npc->_aiFloat = 22.0; ANM2::Play((ANM2 *)((int)EVar9 + 0x48),(byte *)animName,0); ANM2::Play(&npc->_sprite,(byte *)"WallImpact",0); iVar11 = npc->_subtype; (npc->_sprite)._rotation = wallRotations[(int)local_360]; if (iVar11 != 0) { npc->_i2 = (int)&DAT_bf800000; npc->_stateFrame = (int)local_360->_gridEntities + (uint)((npc->_sprite)._flipX != 0) * 2 + -0x23 & 3; } } } goto LAB_0058617f; } uVar8 = npc->_stateFrame; if ((-1 < (int)uVar8) && (fVar25 = (float)npc->_i2, 0.0 <= fVar25)) { if (npc->_subtype == 2) { nextSpeedFast = fVar25 + 1.1; pfVar12 = (float *)&DAT_00b1f128; pfVar18 = &nextSpeedFast; bVar23 = nextSpeedFast == 24.0; bVar24 = nextSpeedFast < 24.0; } else { nextSpeed = fVar25 + 1.0; pfVar12 = (float *)&DAT_00b1f124; pfVar18 = &nextSpeed; bVar23 = nextSpeed == 13.0; bVar24 = nextSpeed < 13.0; } if (bVar24 || bVar23) { pfVar12 = pfVar18; } npc->_i2 = (int)*pfVar12; if (uVar8 < 4) { pfVar12 = DAT_00c80020; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < (int)DAT_00c80020) && (pfVar12 = (float *)_Init_thread_header(&DAT_00c80020), DAT_00c80020 == (float *)0xffffffff)) { _DAT_00c80024 = &DAT_bf800000; _DAT_00c80028 = 0; uRam00c8002c = 0; puRam00c80030 = &DAT_bf800000; _DAT_00c80034 = 0x3f800000; uRam00c80038 = 0; uRam00c8003c = 0; uRam00c80040 = 0x3f800000; pfVar12 = (float *)_Init_thread_footer(&DAT_00c80020); } fVar27 = *(float *)(&DAT_00c80028 + uVar8 * 8); fVar25 = *(float *)(&DAT_00c80024 + uVar8 * 8); } else { fVar27 = g_vectorZero.y; fVar25 = g_vectorZero.x; } local_370 = (int *)((uint)pfVar12 & 0xffffff00); fVar28 = (float)npc->_i2 * fVar25 + (npc->_targetPosition).x; (npc->_targetPosition).y = (float)npc->_i2 * fVar27 + (npc->_targetPosition).y; (npc->_targetPosition).x = fVar28; fVar25 = (local_360->_topLeftPos).x - 34.0; if (fVar25 <= fVar28) { fVar25 = (local_360->_bottomRightPos).x + 34.0; if (fVar25 < fVar28) { local_370 = (int *)0x0; if (npc->_stateFrame == 2) { local_370 = (int *)0x1; } goto LAB_0058461d; } } else { local_370 = (int *)CONCAT31((int3)((uint)pfVar12 >> 8),npc->_stateFrame == 0); LAB_0058461d: (npc->_targetPosition).x = fVar25; } fVar25 = (npc->_targetPosition).y; fVar27 = ((local_360->_topLeftPos).y - 34.0) + 20.0; if (fVar27 <= fVar25) { fVar27 = (local_360->_bottomRightPos).y + 34.0 + 20.0; if (fVar27 < fVar25) { uVar6 = SUB41(local_370,0); if (npc->_stateFrame == 3) { uVar6 = 1; } (npc->_targetPosition).y = fVar27; local_370 = (int *)CONCAT31(local_370._1_3_,uVar6); } } else { (npc->_targetPosition).y = fVar27; if (npc->_stateFrame == 1) { local_370 = (int *)CONCAT31(local_370._1_3_,1); } } uVar8 = Random(); fVar25 = (float)npc->_i2; if (uVar8 % 0x1e == 0) { fVar25 = fVar25 * 0.3; npc->_i2 = (int)fVar25; } bVar5 = (npc->_sprite)._flipX; if ((char)local_370 == '\0') { uVar8 = npc->_stateFrame; } else { fVar25 = fVar25 * 0.3; npc->_i2 = (int)fVar25; uVar8 = (uint)(bVar5 != 0) * 2 + 1 + npc->_stateFrame & 0x80000003; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffc) + 1; } npc->_stateFrame = uVar8; } uVar8 = (uint)(bVar5 == 0) * 2 + 1 + uVar8 & 0x80000003; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffc) + 1; } (npc->_sprite)._rotation = wallRotations[uVar8]; fVar27 = (npc->_v2).y; if (bVar5 == 0) { fVar27 = fVar27 + 2.0; fVar28 = 40.0; if (fVar27 <= 40.0) { fVar28 = fVar27; } } else { fVar27 = fVar27 - 2.0; fVar28 = -40.0; if (-40.0 <= fVar27) { fVar28 = fVar27; } } (npc->_v2).y = fVar28; if (2.0 < fVar25) { iVar11 = 6; if (npc->_subtype == 2) { iVar11 = 3; } iVar11 = Isaac::Random(iVar11); if (iVar11 == 0) { uVar8 = (uint)((npc->_sprite)._flipX != 0) * 2 + 1 + npc->_stateFrame & 0x80000003; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffc) + 1; } Isaac::GetAxisAlignedUnitVectorFromDir(&wallDir,uVar8); bloodVel.x = 0.0; uVar8 = Random(); bloodVel.y = -10.0 - (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 20.0; spawn_blood_explosion(4,&npc->_pos,&bloodVel,&g_colorGreenSplat,&g_vectorZero); uVar8 = Random(); if ((uVar8 % 3 == 0) || (npc->_subtype == 2)) { uVar8 = Random(); local_368 = (EntityPtr) (((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 45.0 * 0.017453292); local_324 = cos((float)local_368); fVar25 = sin((float)local_368); local_35c = local_324 * wallDir.x - fVar25 * wallDir.y; local_370 = (int *)(fVar25 * wallDir.x + local_324 * wallDir.y); uVar8 = Random(); fVar25 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; gibPos.y = fVar25 * (float)local_370 * 12.0 + (npc->_pos).y; gibPos.x = fVar25 * local_35c * 12.0 + (npc->_pos).x; uVar8 = Random(); gibVel.x = local_35c * 5.0; gibVel.y = (float)local_370 * 5.0; pEVar13 = Game::SpawnEx(g_game,1000,5,&gibPos,&gibVel,(Entity *)0x0,0,uVar8,0); Sprite::SetColor((Sprite *)&pEVar13->_sprite,&g_colorGreenSplat); (**(code **)(*(int *)pEVar13 + 0xc))(); Game::ShakeScreen(g_game,4); room = local_360; if (npc->_subtype == 2) { Room::GetClampedPositionImpl(local_360,&creepPos,&gibPos,4.0,4.0,4.0,4.0); toFirstSegment.x = *(float *)((int)EVar9 + 0x33c) - creepPos.x; toFirstSegment.y = *(float *)((int)EVar9 + 0x340) - creepPos.y; Vector::Normalized(&toFirstSegment,&dirToFirstSegment); uVar8 = Random(); fVar25 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 60.0 + 20.0; creepTargetPos.y = fVar25 * dirToFirstSegment.y + creepPos.y; creepTargetPos.x = fVar25 * dirToFirstSegment.x + creepPos.x; pos.y = creepTargetPos.y; pos.x = creepTargetPos.x; iVar11 = Room::GetGridCollisionAtPos(room,pos); if (iVar11 != 0) { pVVar14 = Room::FindFreePickupSpawnPosition (room,&VStack_268,&creepTargetPos,0.0,0,0,0); uVar8 = Random(); local_368 = (EntityPtr) ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0); uVar8 = Random(); creepTargetPos.y = (float)local_368 + pVVar14->y; creepTargetPos.x = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0) + pVVar14->x; } local_324 = (float)Random(); pGVar21 = g_game; game = g_game; spawnSubType = 100; spawnVariant = 0x17; spawnTypeIn = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnTypeIn,(int *)&spawnVariant,&creepPos,&g_vectorZero, (Entity *)npc,(int *)&spawnSubType,(uint *)&local_324); spawnType = spawnTypeIn; if (1 < *(int *)&g_game->_deathmatchManager) { local_370 = (g_game->_deathmatchManager)._type; fVar25 = (float)Random(); piVar15 = local_370; uStack_25c = 0x900000005; uStack_338 = 7; uStack_254 = 7; local_35c = fVar25; if (spawnType == 5) { if (spawnVariant < 0x12d) { if (spawnVariant == 300) { do { if (spawnSubType != 0) { cVar7 = (**(code **)(*local_370 + 0x24))(spawnSubType); if (cVar7 == '\0') goto LAB_00584cb6; } if (fVar25 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)fVar25 >> ((byte)uStack_25c & 0x1f) ^ (uint)fVar25; uVar8 = uVar8 << ((byte)((ulonglong)uStack_25c >> 0x20) & 0x1f) ^ uVar8; fVar25 = (float)(uVar8 >> ((byte)uStack_338 & 0x1f) ^ uVar8); iVar11 = ItemPool::GetCardEx((int)fVar25,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)fVar25; spawnSubType = lua_callback_run_get_card(&cardRng,iVar11,1,1,0); } while( true ); } if (spawnVariant == 0x46) { local_340 = (Entity_NPC *)(spawnSubType >> 0xb); do { if (spawnSubType != 0) { pcVar1 = *(code **)(*local_370 + 0x28); iVar11 = ItemPool::GetPillEffect (&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0 ); cVar7 = (*pcVar1)(iVar11); if (cVar7 == '\0') goto LAB_00584cb6; fVar25 = local_35c; } local_368 = (EntityPtr)&g_game->_itemPool; if (fVar25 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)fVar25 >> ((byte)uStack_25c & 0x1f) ^ (uint)fVar25; uVar8 = uVar8 << ((byte)((ulonglong)uStack_25c >> 0x20) & 0x1f) ^ uVar8; fVar25 = (float)(uVar8 >> ((byte)uStack_338 & 0x1f) ^ uVar8); local_35c = fVar25; spawnSubType = ItemPool::GetPill((uint)fVar25); spawnSubType = spawnSubType | ((uint)local_340 & 1) << 0xb; } while( true ); } if (spawnVariant != 100) goto LAB_00584cbe; if (spawnSubType == 0x19) { LAB_00584c9c: bVar23 = false; } else { collectibleKey = spawnSubType; std::set::find_node(auStack_16c,&collectibleKey); if (((*(char *)(iStack_164 + 0xd) == '\0') && (*(int *)(iStack_164 + 0x10) <= (int)spawnSubType)) && (iStack_164 != piVar15[8])) goto LAB_00584c9c; bVar23 = true; } if ((spawnSubType == 0) || (bVar23)) { spawnSubType = (**(code **)(*piVar15 + 0x84))(0); } } else { if (spawnVariant != 0x15e) goto LAB_00584cbe; while ((spawnSubType == 0 || (cVar7 = (**(code **)(*piVar15 + 0x2c))(spawnSubType), cVar7 != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } EVar9 = local_344; } LAB_00584cb6: } LAB_00584cbe: pGVar21 = game; } if (((npc->_flags & 0x20000000) != 0) && (spawnType == 1000)) { switch(spawnVariant) { case 0x584eb6: /* WARNING: This code block may not be properly labeled as switch case */ spawnVariant = 0x35; } } local_368 = (EntityPtr)EntityFactory::Create(pGVar21->_entityFactory,spawnType,0); if (local_368 != (EntityPtr)0x0) { timeNs = GetTimeNs(); EVar16 = local_34c; EVar9 = local_368; uVar17 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; uStack_338 = (uint)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar17 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar20 = (uint)((ulonglong)lVar3 >> 0x20); uVar8 = uStack_338 + CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (ulonglong)uVar17 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar20,uVar8),uVar20 + uVar8); uVar8 = (uint)((ulonglong)lVar2 >> 0x20); spawnerSlot = (EntityPtr *)((int)local_368 + 0x3c8); local_35c = (float)((uint)lVar2 >> 0x12 | uVar8 * 0x4000); *(int *)((int)local_368 + 0x34) = *(int *)((int)local_34c + 0x28); local_340 = (Entity_NPC *)(uVar8 >> 0x12); *(int *)((int)local_368 + 0x38) = *(int *)((int)local_34c + 0x2c); if (*spawnerSlot != (EntityPtr)0x0) { local_354 = spawnerSlot; std::multiset::erase(&local_354); } *spawnerSlot = EVar16; std::multiset::insert(spawnerSlot); uVar8 = spawnType; iVar11 = *(int *)EVar9; ((Vector *)((int)EVar9 + 0x33c))->x = creepPos.x; ((Vector *)((int)EVar9 + 0x33c))->y = creepPos.y; ((Vector *)((int)EVar9 + 0x360))->x = g_vectorZero.x; ((Vector *)((int)EVar9 + 0x360))->y = g_vectorZero.y; (**(code **)(iVar11 + 4))(spawnType,spawnVariant,spawnSubType,local_324); pvVar19 = game->_room; iVar11 = *(int *)((int)pvVar19 + 0x1214); *(int *)((int)pvVar19 + 0x1214) = iVar11 + 1; *(int *)((int)EVar9 + 0x20) = iVar11; EntityList::AddEntity((EntityList *)((int)pvVar19 + 0x1218),(Entity *)EVar9); bVar5 = Entity::IsActiveEnemy((Entity *)EVar16,1); if (bVar5 != 0) { if ((*(uint *)((int)EVar16 + 0x16c) & 0x10000000) == 0) { bVar5 = Entity::HasEntityFlags((Entity *)EVar16,0x20000000); if (bVar5 != 0) { addEnemyKillScore = 0; bVar5 = 0; iVar11 = -1; sourceRef = EntityRef::EntityRef(&EStack_128); Entity::AddCharmed((Entity *)EVar9,sourceRef,iVar11,bVar5,addEnemyKillScore) ; } } else { uVar17 = *(uint *)((int)((int)EVar9 + 0x168) + 4); flagsHigh = (undefined4)*(qword *)((int)EVar9 + 0x168); *(undefined4 *)((int)EVar9 + 0x168) = flagsHigh; *(uint *)((int)((int)EVar9 + 0x168) + 4) = uVar17 | 0x10000000; if ((uVar8 != 9) && (uVar8 != 7)) { *(undefined4 *)((int)EVar9 + 0x168) = flagsHigh; *(uint *)((int)((int)EVar9 + 0x168) + 4) = uVar17 | 0x10000020; } charmSource._entity = *(void **)((int)EVar16 + 0x264); if (charmSource._entity == (void *)0x0) { charmSource._type = 0; charmSource._variant = 0; charmSource._spawnerType = 0; charmSource._spawnerVariant = 0; charmSource._position.x = g_vectorZero.x; charmSource._position.y = g_vectorZero.y; charmSource._velocity.x = g_vectorZero.x; charmSource._velocity.y = g_vectorZero.y; LAB_005851ae: local_370 = (int *)0x0; if (charmSource._entity != (void *)0x0) goto LAB_005851ba; local_370 = (int *)0x0; LAB_005851dc: uStack_338 = 0; if (charmSource._entity != (void *)0x0) goto LAB_005851e8; LAB_00585201: uVar17 = 0; } else { charmSource._type = *(int *)((int)charmSource._entity + 0x28); charmSource._position.x = *(float *)((int)charmSource._entity + 0x33c); charmSource._position.y = *(float *)((int)charmSource._entity + 0x340); charmSource._variant = *(int *)((int)charmSource._entity + 0x2c); charmSource._spawnerType = *(int *)((int)charmSource._entity + 0x34); charmSource._spawnerVariant = *(int *)((int)charmSource._entity + 0x38); charmSource._velocity.x = *(float *)((int)charmSource._entity + 0x360); charmSource._velocity.y = *(float *)((int)charmSource._entity + 0x364); if ((*(uint *)((int)charmSource._entity + 0x168) & 0x100) == 0) goto LAB_005851ae; local_370 = (int *)0x1; LAB_005851ba: if ((*(uint *)((int)charmSource._entity + 0x168) & 0x20000000) == 0) goto LAB_005851dc; uStack_338 = 2; LAB_005851e8: if ((*(uint *)((int)charmSource._entity + 0x16c) & 0x400000) == 0) goto LAB_00585201; uVar17 = 4; } charmSource._flags = uVar17 | uStack_338 | (uint)local_370; Entity::AddCharmed((Entity *)EVar9,&charmSource,-1,0,0); if (uVar8 - 10 < 0x3de) { ANM2::LoadDeliriumForm((ANM2 *)((int)EVar9 + 0x48),uVar8,spawnVariant,1); } } uStack_338 = __RTDynamicCast(EVar16,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC:: RTTI_Type_Descriptor,0); pEVar13 = (Entity *) __RTDynamicCast(EVar9,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor ,0); if ((uStack_338 != 0) && (pEVar13 != (Entity *)0x0)) { bVar5 = Entity::HasEntityFlags(pEVar13,1); if (bVar5 == 0) { bVar5 = Entity::HasEntityFlags((Entity *)EVar16,0x100000000000000); if (bVar5 != 0) { brimstoneMarkSource._type = 0; brimstoneMarkSource._variant = 0; brimstoneMarkSource._spawnerType = 0; brimstoneMarkSource._spawnerVariant = 0; brimstoneMarkSource._position.x = g_vectorZero.x; brimstoneMarkSource._position.y = g_vectorZero.y; brimstoneMarkSource._velocity.x = g_vectorZero.x; brimstoneMarkSource._velocity.y = g_vectorZero.y; brimstoneMarkSource._flags = 0; brimstoneMarkSource._entity = (void *)0x0; Entity::AddBrimstoneMark(pEVar13,&brimstoneMarkSource,0x5a); } bVar5 = Entity::HasEntityFlags((Entity *)EVar16,0x1000000); if (bVar5 != 0) { shrinkSource._type = 0; shrinkSource._variant = 0; shrinkSource._spawnerType = 0; shrinkSource._spawnerVariant = 0; shrinkSource._position.x = g_vectorZero.x; shrinkSource._position.y = g_vectorZero.y; shrinkSource._velocity.x = g_vectorZero.x; shrinkSource._velocity.y = g_vectorZero.y; shrinkSource._flags = 0; shrinkSource._entity = (void *)0x0; Entity::AddShrink(pEVar13,&shrinkSource,0x5a,0,0); if (0 < pEVar13->_shrinkCountdown) { flagsHigh = *(undefined4 *)((int)&pEVar13->_flags + 4); *(uint *)&pEVar13->_flags = (uint)pEVar13->_flags | 0x1000000; *(undefined4 *)((int)&pEVar13->_flags + 4) = flagsHigh; pEVar13->_shrinkStatus1 = pEVar13->_shrinkStatus2; } } } uVar8 = uStack_338; fVar27 = pEVar13[3]._pendingDamage * *(float *)(uStack_338 + 0xf48); pcVar1 = *(code **)(*(int *)pEVar13 + 0x4c); pEVar13[3]._pendingDamage = fVar27; fVar27 = fVar27 * pEVar13->_shrinkStatus1; fVar25 = fVar27 * g_vectorOne.x; (pEVar13->_sprite)._scale.y = fVar27 * g_vectorOne.y; (pEVar13->_sprite)._scale.x = fVar25; pEVar13[3]._burnTickDamage = pEVar13[3]._burnTickDamage * *(float *)(uStack_338 + 0xf48); pEVar13[3]._poisonTickDamage = *(float *)(uStack_338 + 0xf44) * pEVar13[3]._poisonTickDamage; pEVar13->_maxHitPoints = pEVar13->_maxHitPoints * *(float *)(uStack_338 + 0xf44); pEVar13->_health = pEVar13->_health * *(float *)(uStack_338 + 0xf44); cVar7 = (*pcVar1)(); if (cVar7 != '\0') { pvVar19 = *(void **)(uVar8 + 0xf54); ppvVar22 = &pEVar13[3]._config; if (*ppvVar22 != pvVar19) { if (*ppvVar22 != (void *)0x0) { local_36c = ppvVar22; std::multiset::erase(&local_36c); } *ppvVar22 = pvVar19; if (pvVar19 != (void *)0x0) { std::multiset::insert(ppvVar22); } } } } } bVar5 = Game::ShouldEraseEnemy((Entity *)EVar9); if (bVar5 != 0) { Entity::RemoveWithPoof((Entity *)EVar9,unusedArg); } if ((*(byte *)((int)EVar9 + 0x172) != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { spawnedVariantKey = *(int *)((int)EVar9 + 0x2c); proceduralItemManager = &game->_proceduralItemManager; spawnedTypeKey = *(int *)((int)EVar9 + 0x28); std::map::find(&pvStack_30c,&spawnedTypeKey); pvVar19 = (proceduralItemManager->_spawnTriggerTargets)._head; if (pvStack_30c == pvVar19) { aiStack_298[0] = *(int *)((int)EVar9 + 0x28); aiStack_298[1] = 0xffffffff; piVar15 = (int *)std::map::find(auStack_170,aiStack_298); pvStack_30c = (void *)*piVar15; if (pvStack_30c == pvVar19) goto LAB_00585691; } uVar8 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar19 = (playerManager->_playerList)._end; if ((int)pvVar19 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar19 = (playerManager->_playerList)._end; } piVar15 = (playerManager->_playerList)._begin; if (uVar8 < (uint)((int)pvVar19 - (int)piVar15 >> 2)) { piVar15 = piVar15 + uVar8; } trigger_set_dispatch ((void *)(*piVar15 + 0x1fc8),6,(Entity *)EVar9,&creepPos, &g_vectorZero); uVar8 = uVar8 + 1; playerManager = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00585691: timeNs = GetTimeNs(); uVar8 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_354 = (EntityPtr *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0x431bde82; local_36c = (void **)lVar3; lVar4 = (ulonglong)uVar8 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); VStack_268.x = (float)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (uint)(&local_354->field_0x0 + CARRY4((uint)lVar2,(uint)lVar4))), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar17 = (uint)((ulonglong)lVar3 >> 0x20); fVar25 = (float)((uint)lVar3 >> 0x12 | uVar17 * 0x4000); uVar8 = (int)fVar25 - (int)local_35c; bVar23 = CARRY4((uint)g_entitySpawnTimeMs,uVar8); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar8; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar17 >> 0x12) - (int)local_340) - (uint)((uint)fVar25 < (uint)local_35c) ) + (uint)bVar23; npc = (Entity_NPC *)local_34c; EVar9 = local_344; } fVar25 = g_vectorOne.x * 1.5; (((ANM2 *)((int)local_368 + 0x48))->_scale).y = g_vectorOne.y * 1.5; (((ANM2 *)((int)local_368 + 0x48))->_scale).x = fVar25; uVar8 = Random(); splat = Entity_NPC::MakeSplat (npc,((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5) * 1.5); (**(code **)(*(int *)splat + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (**(code **)(*(int *)splat + 0xc))(); uVar8 = Random(); if (uVar8 % 3 == 0) { pVVar14 = Room::GetClampedPositionImpl (local_360,&clampedGibPos,&gibPos,16.0,16.0,16.0,16.0); spawn_small_maggot_jump(&gibPos,-4.0,pVVar14); } ProjectileParams::ProjectileParams(&projectileParams); Color::operator_assign((Color *)&projectileParams.Color,(ColorMod *)&DAT_00c34ed8); projectileTarget.x = dirToFirstSegment.x * 140.0 + creepPos.x; projectileParams.BulletFlags._0_4_ = 0x2000; projectileParams.BulletFlags._4_4_ = 0; projectileTarget.y = dirToFirstSegment.y * 140.0 + creepPos.y; Entity_NPC::FireBossProjectiles(npc,1,&projectileTarget,0.0,&projectileParams); } } } } } fVar25 = ((Vector *)((int)npc + 0x334))->x; fVar27 = ((Vector *)((int)npc + 0x33c))->x; *(float *)((int)npc + 0x364) = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); ((Vector *)((int)npc + 0x360))->x = fVar25 - fVar27; *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; *(float *)((int)npc + 0xc34) = *(float *)((int)npc + 0xc34) * 0.8; *(float *)((int)npc + 0xbc0) = *(float *)((int)npc + 0xbc0) * 0.8; goto LAB_0058617f; } fVar25 = *(float *)((int)EVar9 + 0x340) - (pEVar10->_pos).y; fVar27 = ((Vector *)((int)EVar9 + 0x33c))->x - (pEVar10->_pos).x; local_36c = (void **)sqrtf(fVar25 * fVar25 + fVar27 * fVar27); local_344 = (EntityPtr)((pEVar10->_pos).x - ((Vector *)((int)EVar9 + 0x33c))->x); local_360 = (Room *)((pEVar10->_pos).y - *(float *)((int)EVar9 + 0x340)); tipOffset.x = (float)local_344; tipOffset.y = (float)local_360; pVVar14 = Vector::Normalized(&tipOffset,&tipDir); local_35c = cos(1.5707964); fVar25 = sin(1.5707964); pEVar10 = local_340; fVar27 = (float)npc->_projectileDelay / (float)(npc->_projectileCooldown + -1); local_354 = (EntityPtr *)(local_35c * pVVar14->x - fVar25 * pVVar14->y); local_344 = (EntityPtr)((float)local_344 * fVar27 + ((Vector *)((int)EVar9 + 0x33c))->x); local_360 = (Room *)((float)local_360 * fVar27 + *(float *)((int)EVar9 + 0x340)); local_34c = (EntityPtr)(fVar27 + fVar27); if (0.5 <= fVar27) { local_368 = (EntityPtr)((1.0 - fVar27) + (1.0 - fVar27)); } else { local_368 = local_34c; } piVar15 = &local_340->_i1; local_35c = local_35c * pVVar14->y + fVar25 * pVVar14->x; local_340 = (Entity_NPC *) (((local_340->_posOffset).y - *(float *)((int)EVar9 + 0x350)) * fVar27 + *(float *)((int)EVar9 + 0x350)); fVar25 = sin(fVar27 * (float)local_36c * (float)*piVar15); local_36c = (void **)(fVar25 * (float)pEVar10->_i2 * (float)local_368); dVar26 = (double)((float)local_34c - 1.0); libm_sse2_pow_precise(); fVar27 = (float)local_36c + (1.0 - (float)dVar26) * (pEVar10->_v2).y; fVar25 = (npc->_pos).x; fVar28 = (local_35c * fVar27 + (float)local_360) - (npc->_pos).y; (npc->_posOffset).y = (float)local_340; (npc->_velocity).x = ((float)local_354 * fVar27 + (float)local_344) - fVar25; } (npc->_velocity).y = fVar28; LAB_0058617f: pEVar10 = (Entity_NPC *)0x501502f9; maxDamage = (EntityPtr)0x0; local_368 = (EntityPtr)0x0; EVar16 = EVar9; do { fVar25 = *(float *)((int)EVar16 + 0x380) - *(float *)((int)EVar16 + 0x14); EVar16 = *(EntityPtr *)((int)EVar16 + 0x3c0); if ((float)pEVar10 <= fVar25) { fVar25 = (float)pEVar10; } pEVar10 = (Entity_NPC *)fVar25; } while (((EVar16 != (EntityPtr)0x0) && (*(int *)((int)EVar16 + 0x28) == 0x38d)) && (*(int *)((int)EVar16 + 0x2c) == 10)); local_340 = pEVar10; do { fVar25 = *(float *)((int)EVar9 + 0x380) - *(float *)((int)EVar9 + 0x14); if ((float)pEVar10 < fVar25) { local_354 = (EntityPtr *)(fVar25 - (float)pEVar10); damageSource._position.x = ((Vector *)((int)npc + 0x33c))->x; damageSource._position.y = *(float *)((int)npc + 0x340); local_36c = *(void ***)(*(int *)EVar9 + 0x20); damageSource._type = *(int *)((int)npc + 0x28); damageSource._variant = *(int *)((int)npc + 0x2c); damageSource._spawnerType = *(int *)((int)npc + 0x34); damageSource._spawnerVariant = *(int *)((int)npc + 0x38); damageSource._velocity.x = ((Vector *)((int)npc + 0x360))->x; damageSource._velocity.y = *(float *)((int)npc + 0x364); if ((*(uint *)((int)npc + 0x168) & 0x20000000) == 0) { uVar8 = 0; } else { uVar8 = 2; } if ((*(uint *)((int)npc + 0x16c) & 0x400000) == 0) { uVar17 = 0; } else { uVar17 = 4; } damageSource._flags = uVar17 | uVar8 | (uint)((*(uint *)((int)npc + 0x168) & 0x100) != 0); damageSource._entity = npc; (*(code *)local_36c)(local_354,0,0,&damageSource,0x1e); maxDamage = (EntityPtr)local_354; if ((float)local_354 <= (float)local_368) { maxDamage = local_368; } pEVar10 = local_340; local_368 = maxDamage; } EVar9 = *(EntityPtr *)((int)EVar9 + 0x3c0); } while (((EVar9 != (EntityPtr)0x0) && (*(int *)((int)EVar9 + 0x28) == 0x38d)) && (*(int *)((int)EVar9 + 0x2c) == 10)); if ((*bossSlot != (EntityPtr)0x0) && (0.0 < (float)maxDamage)) { bossDamageSource._position.x = ((Vector *)((int)npc + 0x33c))->x; bossDamageSource._position.y = *(float *)((int)npc + 0x340); local_36c = *(void ***)(*(int *)*bossSlot + 0x20); bossDamageSource._type = *(int *)((int)npc + 0x28); bossDamageSource._variant = *(int *)((int)npc + 0x2c); bossDamageSource._spawnerType = *(int *)((int)npc + 0x34); bossDamageSource._spawnerVariant = *(int *)((int)npc + 0x38); bossDamageSource._velocity.x = ((Vector *)((int)npc + 0x360))->x; bossDamageSource._velocity.y = *(float *)((int)npc + 0x364); if ((*(uint *)((int)npc + 0x168) & 0x20000000) == 0) { uVar8 = 0; } else { uVar8 = 2; } if ((*(uint *)((int)npc + 0x16c) & 0x400000) == 0) { uVar17 = 0; } else { uVar17 = 4; } bossDamageSource._flags = uVar17 | uVar8 | (uint)((*(uint *)((int)npc + 0x168) & 0x100) != 0); bossDamageSource._entity = npc; (*(code *)local_36c)((float)maxDamage * 0.1,0,0,&bossDamageSource,0x1e); } *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.9; return; } //@@ 005864b0 NpcAI::ENTITY_SCOURGE_main /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs BroccoliAttack/Slice*/TrapDown */ void __fastcall NpcAI::ENTITY_SCOURGE_main(Entity_NPC *npc) { float *pfVar1; RNG rng; Entity *playerTarget; char *pcVar2; uint uVar3; uint uVar4; WeightedOutcomePicker outcomesBegin; undefined4 *outcomeCursor; float fVar5; float fVar6; float hoverSign; float fVar7; float fVar8; undefined8 uStack_74; float fStack_6c; float local_68; Entity_NPC *scourge; WeightedOutcomePicker picker; undefined4 *outcomesEnd; undefined4 *outcomesCapacity; int attackTable [13]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; Entity_NPC *scourgeNpc; int *weight; puStack_20 = (undefined1 *)(attackTable + 0x14); puStack_18 = &LAB_00af541d; local_1c = ExceptionList; attackTable[0xc] = __security_cookie ^ (uint)(attackTable + 0x11); ExceptionList = &local_1c; outcomesBegin = (WeightedOutcomePicker)0x0; attackTable[6] = 3; attackTable[7] = 8; attackTable[8] = 10; attackTable[9] = 10; outcomeCursor = (undefined4 *)0x0; attackTable[10] = 0xb; attackTable[0xb] = 6; attackTable[0] = 0; attackTable[1] = 0x5a; attackTable[2] = 0x5a; attackTable[3] = 0x36; attackTable[4] = 0xf; attackTable[5] = 0x5a; picker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacity = (undefined4 *)0x0; local_14 = 0; scourge = npc; playerTarget = Entity_NPC::GetPlayerTarget(npc); fVar8 = (playerTarget->_pos).x; fStack_6c = (playerTarget->_pos).y; playerTarget = Entity_NPC::GetPlayerTarget(scourge); local_68 = (playerTarget->_velocity).x; fVar6 = (playerTarget->_velocity).y; fVar5 = (scourge->_pos).y - fStack_6c; fVar7 = (scourge->_pos).x - fVar8; fVar5 = sqrtf(fVar5 * fVar5 + fVar7 * fVar7); local_68 = local_68 * fVar5 * 0.1 + fVar8; fVar8 = fVar6 * fVar5 * 0.1 + fStack_6c; if (*(char *)((int)&(scourge->_v2).x + 1) == '\0') { fStack_6c = fVar8 - (scourge->_pos).y; fVar6 = local_68 - (scourge->_pos).x; fVar6 = sqrtf(fVar6 * fVar6 + fStack_6c * fStack_6c); if (fVar6 <= 0.0) { fVar6 = fStack_6c; } else { fVar6 = fStack_6c * (1.0 / fVar6); } if (0.95 < fVar6) { uStack_74 = CONCAT44(1,(undefined4)uStack_74); fStack_6c = 1.4013e-43; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_74 + 4); outcomesBegin = picker; outcomeCursor = outcomesEnd; } } if (*(char *)((int)&(scourge->_v2).x + 2) == '\0') { pfVar1 = &(scourge->_pos).y; if (*pfVar1 <= fVar8 && fVar8 != *pfVar1) { uVar3 = 0; uVar4 = (int)outcomeCursor - (int)outcomesBegin >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomesBegin + uVar3 * 8) == 2) { weight = (int *)((int)outcomesBegin + 4 + uVar3 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)outcomesBegin + 4 + uVar3 * 8) = 0; } goto LAB_005866ea; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } uStack_74 = CONCAT44(2,(undefined4)uStack_74); fStack_6c = 1.4013e-44; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,(int)&uStack_74 + 4); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *outcomeCursor = 2; outcomeCursor[1] = 10; outcomesEnd = outcomeCursor + 2; outcomeCursor = outcomesEnd; } } } LAB_005866ea: if (*(char *)((int)&(scourge->_v2).x + 3) == '\0') { pfVar1 = &(scourge->_pos).y; if (*pfVar1 <= fVar8 && fVar8 != *pfVar1) { uVar3 = 0; uVar4 = (int)outcomeCursor - (int)outcomesBegin >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomesBegin + uVar3 * 8) == 3) { weight = (int *)((int)outcomesBegin + 4 + uVar3 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)outcomesBegin + 4 + uVar3 * 8) = 0; } goto LAB_0058676a; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } uStack_74 = CONCAT44(3,(undefined4)uStack_74); fStack_6c = 1.4013e-44; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,(int)&uStack_74 + 4); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *outcomeCursor = 3; outcomeCursor[1] = 10; outcomesEnd = outcomeCursor + 2; outcomeCursor = outcomesEnd; } } } LAB_0058676a: if (*(char *)&(scourge->_v2).y == '\0') { uVar3 = 0; uVar4 = (int)outcomeCursor - (int)outcomesBegin >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomesBegin + uVar3 * 8) == 4) { weight = (int *)((int)outcomesBegin + 4 + uVar3 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)outcomesBegin + 4 + uVar3 * 8) = 0; } goto LAB_005867e2; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } uStack_74 = CONCAT44(4,(undefined4)uStack_74); fStack_6c = 1.4013e-44; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,(int)&uStack_74 + 4); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *outcomeCursor = 4; outcomeCursor[1] = 10; outcomeCursor = outcomeCursor + 2; outcomesEnd = outcomeCursor; } } LAB_005867e2: if (*(char *)((int)&(scourge->_v2).y + 1) == '\0') { uVar3 = 0; uVar4 = (int)outcomeCursor - (int)outcomesBegin >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomesBegin + uVar3 * 8) == 5) { weight = (int *)((int)outcomesBegin + 4 + uVar3 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)outcomesBegin + 4 + uVar3 * 8) = 0; } goto LAB_0058684e; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } uStack_74 = CONCAT44(5,(undefined4)uStack_74); fStack_6c = 1.4013e-44; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,(int)&uStack_74 + 4); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *outcomeCursor = 5; outcomeCursor[1] = 10; outcomesEnd = outcomeCursor + 2; outcomeCursor = outcomesEnd; } } LAB_0058684e: uVar3 = 0; uVar4 = (int)outcomeCursor - (int)outcomesBegin >> 3; if (uVar4 != 0) { do { if (*(int *)((int)outcomesBegin + uVar3 * 8) == 0) { weight = (int *)((int)outcomesBegin + 4 + uVar3 * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)outcomesBegin + 4 + uVar3 * 8) = 0; } goto LAB_005868ab; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } fStack_6c = 1.4013e-45; uStack_74 = uStack_74 & 0xffffffff; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,(int)&uStack_74 + 4); } else { *outcomeCursor = 0; outcomeCursor[1] = 1; outcomesEnd = outcomeCursor + 2; } LAB_005868ab: uVar3 = Random(); uStack_74 = 0x900000005; fStack_6c = 9.80909e-45; rng._shift1 = 5; rng._seed = uVar3 | 1; rng._shift2 = 9; rng._shift3 = 7; uVar3 = WeightedOutcomePicker::PickOutcome(&picker,rng); scourgeNpc = scourge; if (uVar3 != 0) { scourge->_state = attackTable[uVar3 + 6]; *(char *)((int)(scourge->_floorColor)._tint + (uVar3 - 200)) = (char)attackTable[uVar3]; *(undefined2 *)&scourge->_projectileDelay = 0xffff; *(undefined2 *)&scourge->_projectileCooldown = 0xffff; *(undefined2 *)((int)&scourge->_projectileDelay + 2) = 0; switch(uVar3) { case 1: ANM2::Play(&scourge->_sprite,(byte *)"TrapDown",0); break; case 2: ANM2::Play(&scourge->_sprite,(byte *)"SliceBoth",0); break; case 3: fVar8 = (scourge->_pos).x; fVar6 = (scourge->_pos).x; *(undefined2 *)((int)&scourge->_projectileDelay + 2) = 1; pcVar2 = "SliceLeft"; if (fVar6 <= local_68 && local_68 != fVar8) { pcVar2 = "SliceRight"; } ANM2::Play(&scourge->_sprite,(byte *)pcVar2,0); break; case 4: ANM2::Play(&scourge->_sprite,(byte *)"BroccoliAttack",0); if (0.5 <= scourgeNpc->_health / scourgeNpc->_maxHitPoints) { scourgeNpc->_i1 = 1; } else { scourgeNpc->_i1 = 3; pcVar2 = (char *)((int)(scourgeNpc->_floorColor)._tint + (uVar3 - 200)); *pcVar2 = *pcVar2 + -0x6a; } break; case 5: ANM2::Play(&scourge->_sprite,(byte *)"HoverStart",0); *(undefined2 *)&scourgeNpc->_projectileCooldown = 0; uVar4 = Random(); uVar3 = (scourgeNpc->_vectorDeque1)._offset; *(float *)(*(int *)((int)(scourgeNpc->_vectorDeque1)._map + (uVar3 >> 1 & (scourgeNpc->_vectorDeque1)._mapSize - 1) * 4) + (uVar3 & 1) * 8) = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar3 = Random(); if ((uVar3 & 1) == 0) { hoverSign = (float)&DAT_bf800000; } else { hoverSign = 1.0; } uVar3 = (scourgeNpc->_vectorDeque1)._offset + 1; *(float *)(*(int *)((int)(scourgeNpc->_vectorDeque1)._map + ((scourgeNpc->_vectorDeque1)._mapSize - 1 & uVar3 >> 1) * 4) + (uVar3 & 1) * 8) = hoverSign * 12.0; uVar3 = (scourgeNpc->_vectorDeque1)._offset; local_68 = (float)(uVar3 & 1); *(undefined4 *) (*(int *)((int)(scourge->_vectorDeque1)._map + (uVar3 >> 1 & (scourge->_vectorDeque1)._mapSize - 1) * 4) + 4 + (int)local_68 * 8) = *(undefined4 *) (*(int *)((int)(scourgeNpc->_vectorDeque1)._map + ((scourgeNpc->_vectorDeque1)._mapSize - 1 & uVar3 + 1 >> 1) * 4) + (uVar3 + 1 & 1) * 8); } } if (picker != (WeightedOutcomePicker)0x0) { uVar3 = (int)outcomesCapacity - (int)picker & 0xfffffff8; outcomesBegin = picker; if (0xfff < uVar3) { outcomesBegin = *(WeightedOutcomePicker *)((int)picker + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)picker - (int)outcomesBegin) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)outcomesBegin,uVar3); } ExceptionList = local_1c; return; } //@@ 00586b50 FUN_00586b50 void FUN_00586b50(float *param_1,float param_2) { int in_ECX; float fVar1; float fVar2; float in_XMM2_Da; float fVar3; float in_XMM3_Da; fVar2 = *(float *)(in_ECX + 0x340) - param_1[1]; fVar3 = *(float *)(in_ECX + 0x33c) - *param_1; fVar1 = sqrtf(fVar2 * fVar2 + fVar3 * fVar3); if (0.0 < fVar1) { fVar3 = fVar3 * (1.0 / fVar1); fVar2 = fVar2 * (1.0 / fVar1); } *(float *)(in_ECX + 0x360) = *(float *)(in_ECX + 0x360) - ((fVar1 - in_XMM2_Da) * fVar3 * in_XMM3_Da + *(float *)(in_ECX + 0x360) * param_2) * *(float *)(in_ECX + 0x39c); *(float *)(in_ECX + 0x364) = *(float *)(in_ECX + 0x364) - ((fVar1 - in_XMM2_Da) * fVar2 * in_XMM3_Da + *(float *)(in_ECX + 0x364) * param_2) * *(float *)(in_ECX + 0x39c); return; } //@@ 00586c40 NpcAI::ENTITY_SCOURGE_projectile_attack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? called every 30 frames from the Scourge 909.0 body (00587aa0, misnamed Entity_Familiar::HandleCollision) when target +0x3c0 set; ProjectileParams + Entity_NPC::FireProjectiles toward Entity_NPC::GetPlayerTarget, Game::Spawn */ void __fastcall NpcAI::ENTITY_SCOURGE_projectile_attack(Entity_NPC *npc) { Vector *position; int shotCount; uint randomValue; uint uVar1; Entity *pEVar2; EntityPtr segment; int shotCount; float fVar4; float arcSpan; float arcStart; Vector local_190; float soundPitch; Entity_NPC *local_184; float local_180; float childDirX; float local_178; float local_174; float local_170; float local_16c; ProjectileParams aimedParams; ProjectileParams spreadParams; undefined1 local_28; undefined1 *local_24; undefined4 local_20; undefined1 local_1c; float local_14; Manager *manager; EntityPtr nextSegment; Entity_NPC *scourge; local_14 = (float)(__security_cookie ^ (uint)&(&spreadParams)[1].CircleAngle); segment = npc->_child; while (((nextSegment = *(EntityPtr *)((int)segment + 0x3c0), nextSegment != (EntityPtr)0x0 && (*(int *)((int)nextSegment + 0x28) == 0x38d)) && (*(int *)((int)nextSegment + 0x2c) == 10) )) { segment = nextSegment; } local_174 = (npc->_pos).x; local_178 = (npc->_pos).y; childDirX = *(float *)((int)segment + 0x33c) - local_174; local_16c = *(float *)((int)segment + 0x340) - local_178; segment = npc->_entityRef; while (((nextSegment = *(EntityPtr *)((int)segment + 0x3c0), nextSegment != (EntityPtr)0x0 && (*(int *)((int)nextSegment + 0x28) == 0x38d)) && (*(int *)((int)nextSegment + 0x2c) == 10) )) { segment = nextSegment; } local_174 = *(float *)((int)segment + 0x33c) - local_174; local_178 = *(float *)((int)segment + 0x340) - local_178; local_184 = npc; fVar4 = sqrtf(childDirX * childDirX + local_16c * local_16c); soundPitch = 1.0; if (0.0 < fVar4) { childDirX = childDirX * (1.0 / fVar4); local_16c = local_16c * (1.0 / fVar4); } fVar4 = sqrtf(local_178 * local_178 + local_174 * local_174); if (0.0 < fVar4) { local_174 = local_174 * (1.0 / fVar4); local_178 = local_178 * (1.0 / fVar4); } local_170 = atan2f(local_16c,childDirX); local_170 = local_170 * 57.295776; fVar4 = atan2f(local_178,local_174); fVar4 = local_170 - fVar4 * 57.295776; if (360.0 < ABS(fVar4)) { fVar4 = fmodf(fVar4,360.0); } if (fVar4 <= 180.0) { if (fVar4 < -180.0) { fVar4 = fVar4 + 360.0; } } else { fVar4 = fVar4 - 360.0; } local_178 = local_178 - local_16c; local_170 = ABS(fVar4 * 0.5) - 20.0; if (local_170 <= 10.0) { local_170 = 10.0; } local_174 = local_174 - childDirX; fVar4 = sqrtf(local_178 * local_178 + local_174 * local_174); shotCount = (int)(fVar4 * 0.707 * 12.0); shotCount = 1; if (1 < shotCount) { shotCount = shotCount; } shotCount = shotCount + 1; if (shotCount != 0) { Random(); } local_190.y = (float)(npc->_vectorDeque1)._offset; uVar1 = (int)local_190.y + 1; shotCount = *(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar1 >> 1) * 4); randomValue = Random(); scourge = local_184; arcStart = -local_170; fVar4 = ((float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 - 0.5) * 20.0 + *(float *)(shotCount + 4 + (uVar1 & 1) * 8); shotCount = 1; if (fVar4 <= arcStart) { fVar4 = arcStart; } if (local_170 <= fVar4) { fVar4 = local_170; } local_180 = fVar4; if (1 < shotCount) { arcSpan = local_170 - arcStart; local_170 = arcSpan; do { local_184 = (Entity_NPC *)((float)shotCount / (float)shotCount); if (5.0 < ABS((arcSpan * (float)local_184 + arcStart) - fVar4)) { spreadParams.GridCollision = 1; spreadParams.HeightModifier = 0.0; spreadParams.FallingSpeedModifier = 0.0; spreadParams.FallingAccelModifier = 0.0; spreadParams.VelocityMulti = 1.0; spreadParams.Scale = 1.0; uVar1 = Random(); spreadParams.PositionOffset.x = g_vectorZero.x; spreadParams.TargetPosition.x = g_vectorZero.x; spreadParams.FireDirectionLimit.x = g_vectorZero.x; spreadParams.DotProductLimit = -1000.0; spreadParams.WiggleFrameOffset = 0; spreadParams.ChangeVelocity = 0.0; spreadParams.ChangeTimeout = 0x1e; spreadParams.PositionOffset.y = g_vectorZero.y; spreadParams.TargetPosition.y = g_vectorZero.y; spreadParams.FireDirectionLimit.y = g_vectorZero.y; spreadParams.DepthOffset = 0.0; spreadParams.Variant = 0; local_28 = 0; local_24 = &DAT_bf800000; local_20 = 0; local_1c = 0; spreadParams.Color._offset[2] = DAT_00c34cf0; spreadParams.CircleAngle = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.1415927; spreadParams.HomingStrength = 1.0; spreadParams.CurvingStrength = 0.005; spreadParams.Acceleration = 1.01; spreadParams.Spread = 1.0; spreadParams.BulletFlags = 0; spreadParams.ChangeFlags = 0; spreadParams.HeightModifier = spreadParams.HeightModifier + 10.0; spreadParams.Color._tint[0] = _DAT_00c34cc8; spreadParams.Color._tint[1] = fRam00c34ccc; spreadParams.Color._tint[2] = fRam00c34cd0; spreadParams.Color._tint[3] = fRam00c34cd4; spreadParams.Color._colorize[0] = _DAT_00c34cd8; spreadParams.Color._colorize[1] = fRam00c34cdc; spreadParams.Color._colorize[2] = fRam00c34ce0; spreadParams.Color._colorize[3] = fRam00c34ce4; spreadParams.Color._offset[0] = (float)DAT_00c34ce8; spreadParams.Color._offset[1] = DAT_00c34ce8._4_4_; spreadParams.FallingAccelModifier = spreadParams.FallingAccelModifier - 0.14; uVar1 = Random(); local_190.y = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 + 4.0; local_190.x = (local_174 * (float)local_184 + childDirX) * local_190.y; local_190.y = (local_178 * (float)local_184 + local_16c) * local_190.y; Entity_NPC::FireProjectiles(scourge,&scourge->_pos,&local_190,0,&spreadParams); arcSpan = local_170; fVar4 = local_180; } shotCount = shotCount + 1; } while (shotCount < shotCount); } pEVar2 = Entity_NPC::GetPlayerTarget(scourge); position = &scourge->_pos; local_16c = (pEVar2->_pos).y - (scourge->_pos).y; local_170 = (pEVar2->_pos).x - position->x; fVar4 = sqrtf(local_16c * local_16c + local_170 * local_170); if (0.0 < fVar4) { local_170 = local_170 * (1.0 / fVar4); local_16c = local_16c * (1.0 / fVar4); } ProjectileParams::ProjectileParams(&aimedParams); aimedParams.HeightModifier = aimedParams.HeightModifier + 10.0; aimedParams.Color._offset[2] = DAT_00c34cf0; aimedParams.Color._tint[0] = _DAT_00c34cc8; aimedParams.Color._tint[1] = fRam00c34ccc; aimedParams.Color._tint[2] = fRam00c34cd0; aimedParams.Color._tint[3] = fRam00c34cd4; aimedParams.Color._colorize[0] = _DAT_00c34cd8; aimedParams.Color._colorize[1] = fRam00c34cdc; aimedParams.Color._colorize[2] = fRam00c34ce0; aimedParams.Color._colorize[3] = fRam00c34ce4; aimedParams.Color._offset[0] = (float)DAT_00c34ce8; aimedParams.Color._offset[1] = DAT_00c34ce8._4_4_; aimedParams.FallingAccelModifier = aimedParams.FallingAccelModifier - 0.14; uVar1 = Random(); fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10; local_190.x = fVar4 + fVar4 + 8.0; local_190.y = local_190.x * local_16c; local_190.x = local_190.x * local_170; Entity_NPC::FireProjectiles(scourge,position,&local_190,0,&aimedParams); uVar1 = (scourge->_vectorDeque1)._offset + 1; *(float *)(*(int *)((int)(scourge->_vectorDeque1)._map + ((scourge->_vectorDeque1)._mapSize - 1 & uVar1 >> 1) * 4) + 4 + (uVar1 & 1) * 8 ) = local_180; uVar1 = Random(); pEVar2 = Game::Spawn(g_game,1000,2,position,&g_vectorZero,(Entity *)0x0,2,uVar1); (**(code **)(*(int *)pEVar2 + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (pEVar2->_sprite)._offset.x = 0.0; (pEVar2->_sprite)._offset.y = -20.0; pEVar2->_renderDepthOffset = 10.0; manager = g_manager; if (scourge->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (scourge->_championColorIdx == 0x13) { soundPitch = 0.5; } local_180 = 2.49431e-43; seed_fart_sound_override((int *)&local_180); SoundEffects::Play(&manager->_sfxManager,(int)local_180,1.0,2,0,soundPitch,0.0); return; } //@@ 00587480 NpcHelper::scourge_chain_shoot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: called from Scourge main AI 00587aa0; walks parent chain of 909.10 (Scourge chain segments) to the end, direction from last segment, Entity_NPC::GetPlayerTarget, FireProjectiles + SoundEffects::Play */ void NpcHelper::scourge_chain_shoot(void) { Entity *pEVar1; uint rngResult; Entity_NPC *in_ECX; EntityPtr chainEnd; float fVar2; float fVar3; float fVar4; float fVar5; Vector effectPos; Vector projVelocity; float local_ec; float local_e8; Vector shootPos; float local_dc; float soundPitch; float childChainOffsetY; float childChainOffsetX; float local_cc; float local_c8; float local_c4; ProjectileParams projParams; undefined1 local_28; undefined1 *local_24; undefined4 local_20; undefined1 local_1c; float local_14; Manager *manager; EntityPtr nextSegment; local_14 = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); chainEnd = in_ECX->_child; while (((nextSegment = *(EntityPtr *)((int)chainEnd + 0x3c0), nextSegment != (EntityPtr)0x0 && (*(int *)((int)nextSegment + 0x28) == 0x38d)) && (*(int *)((int)nextSegment + 0x2c) == 10) )) { chainEnd = nextSegment; } local_e8 = (in_ECX->_pos).x; local_ec = (in_ECX->_pos).y; childChainOffsetX = *(float *)((int)chainEnd + 0x33c) - local_e8; childChainOffsetY = *(float *)((int)chainEnd + 0x340) - local_ec; chainEnd = in_ECX->_entityRef; while (((nextSegment = *(EntityPtr *)((int)chainEnd + 0x3c0), nextSegment != (EntityPtr)0x0 && (*(int *)((int)nextSegment + 0x28) == 0x38d)) && (*(int *)((int)nextSegment + 0x2c) == 10) )) { chainEnd = nextSegment; } local_e8 = *(float *)((int)chainEnd + 0x33c) - local_e8; local_ec = *(float *)((int)chainEnd + 0x340) - local_ec; pEVar1 = Entity_NPC::GetPlayerTarget(in_ECX); local_c8 = local_e8 - childChainOffsetX; local_cc = (pEVar1->_pos).y - (in_ECX->_pos).y; local_dc = (pEVar1->_pos).x - (in_ECX->_pos).x; local_c4 = local_ec - childChainOffsetY; fVar2 = sqrtf(local_c4 * local_c4 + local_c8 * local_c8); soundPitch = 1.0; fVar3 = local_c8; fVar4 = local_c4; if (0.0 < fVar2) { fVar3 = local_c8 * (1.0 / fVar2); fVar4 = local_c4 * (1.0 / fVar2); } fVar2 = -childChainOffsetY * fVar4 - childChainOffsetX * fVar3; fVar4 = fVar2 * fVar4 + childChainOffsetY; fVar3 = fVar2 * fVar3 + childChainOffsetX; fVar2 = fVar4 * local_cc; local_cc = 0.0; local_dc = (fVar2 + fVar3 * local_dc) / (fVar4 * fVar4 + fVar3 * fVar3); do { fVar3 = local_cc; rngResult = Random(); if (rngResult % 5 == 0) { fVar4 = local_dc; } else { rngResult = Random(); fVar4 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; } shootPos.x = (in_ECX->_pos).x; shootPos.y = (in_ECX->_pos).y; fVar2 = childChainOffsetX * fVar4 + shootPos.x; fVar5 = childChainOffsetY * fVar4 + shootPos.y; shootPos.x = local_e8 * fVar4 + shootPos.x; shootPos.y = local_ec * fVar4 + shootPos.y; if (fVar3 == 0.0) { local_c4 = fVar2 - shootPos.x; local_c8 = fVar5 - shootPos.y; } else { local_c4 = shootPos.x - fVar2; local_c8 = shootPos.y - fVar5; shootPos.x = fVar2; shootPos.y = fVar5; } fVar3 = sqrtf(local_c4 * local_c4 + local_c8 * local_c8); if (0.0 < fVar3) { local_c4 = (1.0 / fVar3) * local_c4; local_c8 = local_c8 * (1.0 / fVar3); } projParams.GridCollision = 1; projParams.HeightModifier = 0.0; projParams.FallingSpeedModifier = 0.0; projParams.FallingAccelModifier = 0.0; projParams.VelocityMulti = 1.0; projParams.Scale = 1.0; rngResult = Random(); projParams.PositionOffset.x = g_vectorZero.x; projParams.TargetPosition.x = g_vectorZero.x; projParams.FireDirectionLimit.x = g_vectorZero.x; projParams.DotProductLimit = -1000.0; projParams.WiggleFrameOffset = 0; projParams.ChangeVelocity = 0.0; projParams.ChangeTimeout = 0x1e; projParams.PositionOffset.y = g_vectorZero.y; projParams.TargetPosition.y = g_vectorZero.y; projParams.FireDirectionLimit.y = g_vectorZero.y; projParams.DepthOffset = 0.0; projParams.Variant = 0; local_28 = 0; local_24 = &DAT_bf800000; local_20 = 0; local_1c = 0; projParams.Color._offset[2] = DAT_00c34cf0; projParams.BulletFlags._0_4_ = 0x2000; projParams.CircleAngle = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.1415927; projParams.BulletFlags._4_4_ = 0; projParams.HomingStrength = 1.0; projParams.CurvingStrength = 0.005; projParams.Acceleration = 1.01; projParams.Spread = 1.0; projParams.ChangeFlags = 0; projParams.HeightModifier = projParams.HeightModifier + 10.0; projParams.FallingAccelModifier = projParams.FallingAccelModifier - 0.14; projParams.Color._tint[0] = _DAT_00c34cc8; projParams.Color._tint[1] = fRam00c34ccc; projParams.Color._tint[2] = fRam00c34cd0; projParams.Color._tint[3] = fRam00c34cd4; projParams.Color._colorize[0] = _DAT_00c34cd8; projParams.Color._colorize[1] = fRam00c34cdc; projParams.Color._colorize[2] = fRam00c34ce0; projParams.Color._colorize[3] = fRam00c34ce4; projParams.Color._offset[0] = (float)DAT_00c34ce8; projParams.Color._offset[1] = DAT_00c34ce8._4_4_; rngResult = Random(); projVelocity.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 + 5.0; projVelocity.y = projVelocity.x * local_c8; projVelocity.x = projVelocity.x * local_c4; Entity_NPC::FireProjectiles(in_ECX,&shootPos,&projVelocity,0,&projParams); effectPos.x = local_c4 * 4.0 + shootPos.x; effectPos.y = local_c8 * 4.0 + shootPos.y; rngResult = Random(); pEVar1 = Game::Spawn(g_game,1000,2,&effectPos,&g_vectorZero,(Entity *)0x0,1,rngResult); (**(code **)(*(int *)pEVar1 + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (pEVar1->_sprite)._offset.x = 0.0; (pEVar1->_sprite)._offset.y = -20.0; pEVar1->_renderDepthOffset = 10.0; manager = g_manager; local_cc = (float)((int)local_cc + 1); } while ((int)local_cc < 2); if (in_ECX->_championColorIdx == 0x12) { soundPitch = 1.5; } else if (in_ECX->_championColorIdx == 0x13) { soundPitch = 0.5; } local_cc = 2.49431e-43; seed_fart_sound_override((int *)&local_cc); SoundEffects::Play(&manager->_sfxManager,(int)local_cc,1.0,2,0,soundPitch,0.0); return; } //@@ 00587aa0 NpcAI::ENTITY_SCOURGE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: 909.0 (variant != 10); Idle/HoverLoop/Death/Shoot; ZHL exact sig called it Entity_Familiar::HandleCollision (real one 006261f0) */ void __fastcall NpcAI::ENTITY_SCOURGE(Entity_NPC *npc) { code *pcVar1; byte bVar2; char cVar3; ushort uVar4; short sVar5; short sVar6; uint uVar7; byte *pbVar8; Entity *tmpEntity; Vector *clampedTarget; EntityPtr *pEVar9; EntityPtr EVar10; float *pfVar11; undefined4 uVar12; Entity_Projectile *bossShot; char *pcVar13; byte *pbVar14; EntityPtr extraout_EDX; EntityPtr extraout_EDX_00; EntityPtr extraout_EDX_01; EntityPtr extraout_EDX_02; uint uVar15; int iVar16; EntityPtr EVar17; bool bVar18; float fVar19; float fVar20; float fVar21; undefined1 auVar22 [12]; float fVar23; undefined1 *puVar24; float fVar25; float fVar26; int iVar27; undefined4 uVar28; Vector ringShotPos; Vector scratchVec; void *room; undefined1 local_214 [12]; uint local_208; float roomCenter; EntityPtr local_200; EntityPtr npcSaved; Vector local_1f8; float local_1f0; int elapsedTicks; Vector local_1e8; EntityPtr local_1e0; float local_1dc; EntityPtr local_1d8; EntityPtr local_1d4; ProjectileParams bossShotParams; ProjectileParams burstParams; ColorMod tmpColor; Color effectColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; short *idleTimer; Manager *manager; puStack_20 = (undefined1 *)(&effectColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af5450; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)((&effectColor)[1]._colorize + 1); room = g_game->_room; local_200 = (EntityPtr)((*(float *)((int)room + 0x20) + *(float *)((int)room + 0x18)) * 0.5); iVar16 = (int)npc->_updateTime - (int)npc->_prevUpdateTime; roomCenter = (*(float *)((int)room + 0x1c) + *(float *)((int)room + 0x14)) * 0.5; npcSaved = (EntityPtr)npc; local_1f0 = roomCenter; elapsedTicks = iVar16; local_1d8 = local_200; local_24 = uVar7; if (npc->_aiCallPhase == 1) { if (npc->_state != 0x12) { return; } if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } if ((npc->_sprite)._animState._isPlaying == 0) { return; } pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { pbVar8 = &s_empty; } else if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar13 = "Death"; do { bVar2 = *pbVar8; bVar18 = bVar2 < (byte)*pcVar13; if (bVar2 != *pcVar13) { LAB_00587bc2: uVar7 = -(uint)bVar18 | 1; goto LAB_00587bc7; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar18 = bVar2 < (byte)pcVar13[1]; if (bVar2 != pcVar13[1]) goto LAB_00587bc2; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_00587bc7: if (uVar7 != 0) { return; } ExceptionList = &local_1c; puStack_20 = (undefined1 *)(&effectColor)[1]._offset; bVar2 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); manager = g_manager; if (bVar2 == 0) { ExceptionList = local_1c; return; } local_1f0 = 1.0; if (npc->_championColorIdx == 0x12) { local_1d8 = (EntityPtr)0x3fc00000; } else { local_1d8 = (EntityPtr)local_1f0; if (npc->_championColorIdx == 0x13) { local_1d8 = (EntityPtr)0x3f000000; } } local_1dc = 4.40008e-43; seed_fart_sound_override((int *)&local_1dc); SoundEffects::Play(&manager->_sfxManager,(int)local_1dc,1.0,2,0,(float)local_1d8,0.0); manager = g_manager; if (npc->_championColorIdx == 0x12) { local_1f0 = 1.5; } else if (npc->_championColorIdx == 0x13) { local_1f0 = 0.5; } local_1dc = 4.2039e-44; seed_fart_sound_override((int *)&local_1dc); SoundEffects::Play(&manager->_sfxManager,(int)local_1dc,1.0,2,0,local_1f0,0.0); uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,3,uVar7); (**(code **)(*(int *)tmpEntity + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = -60.0; tmpEntity->_renderDepthOffset = 10.0; ExceptionList = local_1c; return; } ExceptionList = &local_1c; pfVar11 = (&effectColor)[1]._offset; if ((npc->_vectorDeque1)._size < 2) { std::deque::resize(2); pfVar11 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar11; switch(npc->_state) { case 0: npc->_state = 3; (npc->_v1).x = 0.0; (npc->_v1).y = -120.0; Color::operator_assign((Color *)&npc->_splatColor,&g_colorGreenSplat); npc->_aiCallFlags = 1; (npc->_v2).x = 0.0; *(undefined2 *)&(npc->_v2).y = 0; npc->_projectileCooldown = 0; *(undefined2 *)&npc->_projectileDelay = 0; uVar7 = (npc->_vectorDeque1)._offset; *(undefined4 *) (*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar7 >> 1) * 4 ) + (uVar7 & 1) * 8) = 0; uVar7 = (npc->_vectorDeque1)._offset; *(undefined4 *) (*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar7 >> 1) * 4 ) + 4 + (uVar7 & 1) * 8) = 0; uVar7 = (npc->_vectorDeque1)._offset + 1; *(undefined4 *) (*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & uVar7 >> 1) * 4 ) + (uVar7 & 1) * 8) = 0; local_208 = (npc->_vectorDeque1)._offset; *(undefined4 *) (*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & local_208 + 1 >> 1) * 4) + 4 + (local_208 + 1 & 1) * 8) = 0; break; case 3: npc->_friction = npc->_friction * 0.8; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1e8.x = (tmpEntity->_pos).x + (npc->_v1).x; local_1e8.y = (tmpEntity->_pos).y + (npc->_v1).y; clampedTarget = Room::GetClampedPositionImpl (g_game->_room,(Vector *)(local_214 + 8),&local_1e8,4.0,4.0,4.0,4.0); local_1d8 = (EntityPtr)((clampedTarget->x - (npc->_pos).x) * 0.1); local_1f0 = (clampedTarget->y - (npc->_pos).y) * 0.1; fVar21 = sqrtf((float)local_1d8 * (float)local_1d8 + local_1f0 * local_1f0); EVar17 = local_1d8; fVar23 = local_1f0; if ((1.0 < fVar21) && (0.0 < fVar21)) { fVar23 = local_1f0 * (1.0 / fVar21); EVar17 = (EntityPtr)((float)local_1d8 * (1.0 / fVar21)); } fVar21 = npc->_speedMultiplier; (npc->_velocity).x = (float)EVar17 * 1.2 * fVar21 + (npc->_velocity).x; (npc->_velocity).y = fVar23 * 1.2 * fVar21 + (npc->_velocity).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1d4 = (EntityPtr)((tmpEntity->_pos).x - (npc->_pos).x); local_1e0 = (EntityPtr)((tmpEntity->_pos).y - (npc->_pos).y); pcVar13 = (npc->_sprite)._animState._animData; if ((pcVar13 == (char *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_0058804d: pbVar8 = (npc->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar14 = s_Idle; do { bVar2 = *pbVar8; bVar18 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_00588083: uVar7 = -(uint)bVar18 | 1; goto LAB_00588088; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar18 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_00588083; pbVar8 = pbVar8 + 2; pbVar14 = pbVar14 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_00588088: if ((uVar7 == 0) && ((*(char *)((int)(npc->_sprite)._animState._animData + 0x34) == '\0' || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_005880c8; } bVar2 = ANM2::SetAnimation(&npc->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; iVar16 = elapsedTicks; } } else { if (0xf < *(uint *)(pcVar13 + 0x14)) { pcVar13 = *(char **)pcVar13; } iVar27 = strncmp(pcVar13,(char *)s_Idle,4); if (iVar27 != 0) goto LAB_0058804d; } LAB_005880c8: if ((ABS((float)local_1d4) <= ABS((float)local_1e0)) || ((float)local_1e0 <= 0.0)) { pbVar8 = s_Idle; } else { pbVar8 = (byte *)"IdleLeft"; if (0.0 <= (float)local_1d4) { pbVar8 = (byte *)"IdleRight"; } } ANM2::SetAnimation(&npc->_sprite,pbVar8,0); uVar7 = Random(); if (uVar7 % 0x14 == 0) { uVar7 = Random(); local_1dc = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 200.0; uVar7 = Random(); local_1d4 = (EntityPtr) (((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 90.0 - 45.0) * 0.017453292); local_1e0 = (EntityPtr)cos((float)local_1d4); fVar23 = sin((float)local_1d4); (npc->_v1).x = (float)local_1e0 * 0.0 - local_1dc * fVar23; (npc->_v1).y = local_1dc * (float)local_1e0 + fVar23 * 0.0; } idleTimer = (short *)((int)&npc->_projectileCooldown + 2); *idleTimer = *idleTimer + (short)iVar16; if ((0x1e < *(short *)((int)&npc->_projectileCooldown + 2)) && (uVar7 = Random(), uVar7 % 10 == 0)) { ENTITY_SCOURGE_main(npc); } break; case 6: local_1e8.y = (float)&npc->_pos; npc->_friction = npc->_friction * 0.6; local_1f8.y = ((float)local_1d8 - (npc->_pos).y) * 0.1; local_1f8.x = (local_1f0 - ((Vector *)local_1e8.y)->x) * 0.1; local_1e0 = (EntityPtr)local_1f8.y; local_1d4 = (EntityPtr)local_1f8.x; fVar23 = sqrtf(local_1f8.y * local_1f8.y + local_1f8.x * local_1f8.x); if (fVar23 <= 2.0) { EVar10 = local_1e0; EVar17 = local_1d4; } else { Vector::Normalize(&local_1f8); EVar10 = (EntityPtr)(local_1f8.y * 2.0); EVar17 = (EntityPtr)(local_1f8.x * 2.0); } fVar23 = npc->_speedMultiplier; (npc->_velocity).x = (float)EVar17 * fVar23 + (npc->_velocity).x; (npc->_velocity).y = (float)EVar10 * fVar23 + (npc->_velocity).y; if (-1 < (short)npc->_projectileCooldown) { if (0 < iVar16) { do { if (((*(ushort *)((int)npc + 0xba0) & 1) == 0) && ((short)*(ushort *)((int)npc + 0xba0) < 0xf1)) { local_1dc = *(float *)(*(int *)(*(int *)((int)npc + 0xc08) + (*(int *)((int)npc + 0xc0c) - 1U & *(uint *)((int)npc + 0xc10) >> 1) * 4) + (*(uint *)((int)npc + 0xc10) & 1) * 8); fVar23 = (float)local_1d8 - *(float *)((int)room + 0x18); fVar21 = local_1f0 - *(float *)((int)room + 0x14); local_1d4 = (EntityPtr)sqrtf(fVar23 * fVar23 + fVar21 * fVar21); uVar7 = Random(); EVar17 = (EntityPtr)0x0; local_1e0 = (EntityPtr)0x0; tmpColor._offset[2] = g_colorGreenSplat._offset[2]; local_1d4 = (EntityPtr) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 20.0 + (float)local_1d4 + 60.0); tmpColor._tint[0] = g_colorGreenSplat._tint[0]; tmpColor._tint[1] = g_colorGreenSplat._tint[1]; tmpColor._tint[2] = g_colorGreenSplat._tint[2]; tmpColor._tint[3] = 0.0; tmpColor._colorize[0] = g_colorGreenSplat._colorize[0]; tmpColor._colorize[1] = g_colorGreenSplat._colorize[1]; tmpColor._colorize[2] = g_colorGreenSplat._colorize[2]; tmpColor._colorize[3] = g_colorGreenSplat._colorize[3]; tmpColor._offset[0] = g_colorGreenSplat._offset[0]; tmpColor._offset[1] = g_colorGreenSplat._offset[1]; local_1dc = local_1dc * 0.017453292; local_200 = (EntityPtr)sin(local_1dc); local_1dc = cos(local_1dc); local_1dc = local_1dc * (float)local_1d4; local_1f8.y = (float)local_1d4 * (float)local_200; do { if (EVar17 == (EntityPtr)0x0) { puVar24 = &DAT_bf800000; } else { puVar24 = (undefined1 *)0x3f800000; } ringShotPos.x = local_1dc * (float)puVar24 + local_1f0; ringShotPos.y = local_1f8.y * (float)puVar24 + (float)local_1d8; uVar7 = Random(); tmpEntity = Game::SpawnEx(g_game,9,0,&ringShotPos,&g_vectorZero,(Entity *)npc,0,uVar7, 0); (**(code **)(*(int *)tmpEntity + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0x3c))(&tmpColor,0x1e,0xff,1,1); if (tmpEntity->_parent != (EntityPtr)0x0) { local_200 = (EntityPtr)&tmpEntity->_parent; std::multiset::erase(&local_200); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); (tmpEntity->_targetPosition).x = local_1f0; (tmpEntity->_targetPosition).y = (float)local_1d8; tmpEntity[1]._variant = 0x2080; tmpEntity[1]._subtype = 0x100000; tmpEntity[1]._damageEvents._end = (void *)0xbd4ccccd; uVar7 = Random(); *(undefined4 *)&tmpEntity[1]._pendingDamageFlags = 0x3dcccccd; tmpEntity->_friction = 0.8; uVar15 = uVar7 % 3 + 5; uVar7 = 0xd; if (uVar15 < 0xd) { uVar7 = uVar15; } tmpEntity[1]._pendingDamage = ((float)uVar7 - 3.0) / 3.0; EVar17 = (EntityPtr)((int)local_1e0 + 1); local_1e0 = EVar17; } while ((int)EVar17 < 2); if ((int)*(short *)((int)npc + 0xba0) % 0xc == 0) { uVar7 = Random(); local_1f8.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; local_200 = (EntityPtr)sin(local_1f8.y); fVar23 = cos(local_1f8.y); scratchVec.x = fVar23 * (float)local_1d4 + local_1f0; scratchVec.y = (float)local_1d4 * (float)local_200 + (float)local_1d8; uVar7 = Random(); tmpEntity = Game::SpawnEx(g_game,9,0,&scratchVec,&g_vectorZero,(Entity *)npc,0,uVar7,0 ); effectColor._tint[0] = 1.0; effectColor._tint[1] = 1.0; effectColor._tint[2] = 1.0; effectColor._tint[3] = 1.0; effectColor._colorize[0] = 2.0; effectColor._colorize[1] = 3.0; effectColor._colorize[2] = 1.0; effectColor._colorize[3] = 1.0; effectColor._offset[0] = 0.0; effectColor._offset[1] = 0.0; effectColor._offset[2] = 0.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&effectColor,0xffffffff,0xff,0,1); effectColor._tint[0] = 1.0; effectColor._tint[1] = 1.0; effectColor._tint[2] = 1.0; effectColor._tint[3] = 0.0; effectColor._colorize[0] = 2.0; effectColor._colorize[1] = 3.0; effectColor._colorize[2] = 1.0; effectColor._colorize[3] = 1.0; effectColor._offset[0] = 0.0; effectColor._offset[1] = 0.0; effectColor._offset[2] = 0.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&effectColor,0x1e,0xff,1,1); if (tmpEntity->_parent != (EntityPtr)0x0) { local_1f8.y = (float)&tmpEntity->_parent; std::multiset::erase(&local_1f8.y); } tmpEntity->_parent = (EntityPtr)npc; std::multiset::insert(&tmpEntity->_parent); (tmpEntity->_targetPosition).x = local_1f0; (tmpEntity->_targetPosition).y = (float)local_1d8; tmpEntity[1]._variant = 0x2080; tmpEntity[1]._subtype = 0x100000; tmpEntity[1]._damageEvents._end = (void *)0xbd4ccccd; tmpEntity[1]._pendingDamage = 1.3333334; *(undefined4 *)&tmpEntity[1]._pendingDamageFlags = 0x3dcccccd; tmpEntity->_friction = 0.99; } local_1d4 = *(EntityPtr *)((int)npc + 0xc10); local_1f8.y = *(float *)((int)npcSaved + 0xc08); fVar23 = *(float *)(*(int *)((int)local_1f8.y + (*(int *)((int)npc + 0xc0c) - 1U & (uint)local_1d4 >> 1) * 4 ) + 4 + ((uint)local_1d4 & 1) * 8) + *(float *)(*(int *)((int)local_1f8.y + (*(int *)((int)npcSaved + 0xc0c) - 1U & (uint)local_1d4 >> 1 ) * 4) + ((uint)local_1d4 & 1) * 8); if (360.0 < ABS(fVar23)) { fVar23 = fmodf(fVar23,360.0); } if (fVar23 <= 180.0) { if (fVar23 < -180.0) { fVar23 = fVar23 + 360.0; } } else { fVar23 = fVar23 - 360.0; } *(float *)(*(int *)(*(int *)((int)npcSaved + 0xc08) + (*(int *)((int)npcSaved + 0xc0c) - 1U & (uint)local_1d4 >> 1) * 4) + ((uint)local_1d4 & 1) * 8) = fVar23; local_208 = *(uint *)((int)npcSaved + 0xc10); fVar23 = approach_angle(*(float *)(*(int *)(*(int *)((int)npcSaved + 0xc08) + (*(int *)((int)npcSaved + 0xc0c) - 1U & local_208 >> 1) * 4) + 4 + (local_208 & 1) * 8), *(float *)(*(int *)(*(int *)((int)npcSaved + 0xc08) + (*(int *)((int)npcSaved + 0xc0c) - 1U & local_208 + 1 >> 1) * 4) + (local_208 + 1 & 1) * 8), *(float *)((int)npcSaved + 0x39c) + *(float *)((int)npcSaved + 0x39c)); npc = (Entity_NPC *)npcSaved; *(float *)(*(int *)(*(int *)((int)npcSaved + 0xc08) + (*(int *)((int)npcSaved + 0xc0c) - 1U & local_208 >> 1) * 4) + 4 + (local_208 & 1) * 8) = fVar23; uVar7 = Random(); if (uVar7 % 0x32 == 0) { local_1f8.y = *(float *)((int)npc + 0xc10); uVar7 = (int)local_1f8.y + 1U >> 1; uVar15 = (uint)((int)local_1f8.y + 1U) & 1; *(uint *)(*(int *)(*(int *)((int)npcSaved + 0xc08) + (*(int *)((int)npcSaved + 0xc0c) - 1U & uVar7) * 4) + uVar15 * 8) = *(uint *)(*(int *)(*(int *)((int)npcSaved + 0xc08) + (*(int *)((int)npcSaved + 0xc0c) - 1U & uVar7) * 4) + uVar15 * 8) ^ 0x80000000; npc = (Entity_NPC *)npcSaved; } iVar16 = elapsedTicks; } *(short *)((int)npc + 0xba0) = *(short *)((int)npc + 0xba0) + 1; sVar6 = *(short *)((int)npc + 0xba0); if (299 < sVar6) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"HoverEnd",0); sVar6 = *(short *)((int)npc + 0xba0); *(undefined4 *)((int)npc + 0xb64) = 7; } if (sVar6 < 300) { if ((int)sVar6 % 6 == 0) { uVar7 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x97,(Vector *)((int)npc + 0x33c),&g_vectorZero, (Entity *)0x0,0,uVar7,0); iVar16 = *(int *)tmpEntity; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -24.0; pcVar1 = *(code **)(iVar16 + 0x3c); Color::Reset(&effectColor); effectColor._tint[0] = 0.5; effectColor._tint[1] = 0.6; effectColor._tint[2] = 0.3; effectColor._tint[3] = 1.0; (*pcVar1)(&effectColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); sVar6 = *(short *)((int)npcSaved + 0xba0); } if ((int)sVar6 % 3 == 0) { uVar7 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x97,(Vector *)local_1e8.y,&g_vectorZero, (Entity *)0x0,1,uVar7,0); iVar16 = *(int *)tmpEntity; (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -24.0; pcVar1 = *(code **)(iVar16 + 0x3c); Color::Reset(&effectColor); effectColor._tint[0] = 0.5; effectColor._tint[1] = 0.6; effectColor._tint[2] = 0.3; effectColor._tint[3] = 1.0; (*pcVar1)(&effectColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); } iVar16 = elapsedTicks; } iVar16 = iVar16 + -1; npc = (Entity_NPC *)npcSaved; elapsedTicks = iVar16; } while (iVar16 != 0); } } if ((*(int *)((int)npc + 0x7c) == 0) || (*(char *)((int)npc + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"HoverLoop",0); } break; case 7: case 9: npc->_friction = npc->_friction * 0.6; LAB_00589c3a: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; goto LAB_00589c49; case 8: npc->_friction = npc->_friction * 0.6; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) { uVar4 = (ushort)npc->_projectileDelay; if (0 < (short)uVar4) goto LAB_005883f3; } else { Entity_NPC::PlaySound(npc,0x1ee,1.0,2,0,1.0); local_1e8.x = -4.0; local_1e8.y = 0.0; local_1f8.x = -20.0; local_1f8.y = 20.0; local_1e0 = (EntityPtr) NpcHelper::scourge_spawn_chain(&npc->_pos,&local_1f8,0,(Entity *)npc,&local_1e8); if (npc->_child != (EntityPtr)0x0) { local_1d4 = (EntityPtr)&npc->_child; std::multiset::erase(&local_1d4); } npc->_child = local_1e0; if (local_1e0 != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } local_1e8.x = 4.0; local_1e8.y = 0.0; local_1f8.x = 20.0; local_1f8.y = 20.0; local_1e0 = (EntityPtr) NpcHelper::scourge_spawn_chain(&npc->_pos,&local_1f8,0,(Entity *)npc,&local_1e8); if (npc->_entityRef != (EntityPtr)0x0) { local_1d4 = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_1d4); } npc->_entityRef = local_1e0; if (local_1e0 != (EntityPtr)0x0) { std::multiset::insert(&npc->_entityRef); } uVar4 = 0xe; LAB_005883f3: uVar7 = (uint)uVar4; local_1d4 = (EntityPtr)0x40800000; uVar4 = 0; if (0 < (int)(uVar7 - iVar16)) { uVar4 = (ushort)(uVar7 - iVar16); } *(ushort *)&npc->_projectileDelay = uVar4; local_1e0 = (EntityPtr)(float)(int)(short)uVar4; pEVar9 = &local_1d4; if ((float)(int)(short)uVar4 <= 4.0) { pEVar9 = &local_1e0; } (npc->_velocity).y = (npc->_velocity).y - (float)*pEVar9; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"TrapLoopDown",0); uVar4 = (ushort)npc->_projectileDelay; } if (-1 < (short)uVar4) { EVar17 = npc->_child; if (((EVar17 == (EntityPtr)0x0) || (local_1d8 = npc->_entityRef, local_1d8 == (EntityPtr)0x0)) || (uVar4 = (ushort)npc->_projectileCooldown, EVar10._2_2_ = 0, EVar10._0_2_ = uVar4, 300 < (short)uVar4)) { LAB_005885c8: npc->_state = 9; *(undefined2 *)&npc->_projectileCooldown = 0xffff; if (EVar17 != (EntityPtr)0x0) { NpcHelper::scourge_whip(); } if (npc->_entityRef != (EntityPtr)0x0) { NpcHelper::scourge_whip(); } ANM2::Play(&npc->_sprite,(byte *)"TrapEndDown",0); } else { local_1d4 = EVar10; iVar16 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (iVar16 == 0) { sVar6 = local_1d4._0_2_; } else { tmpEntity = Entity_NPC::GetPlayerTarget(npc); EVar17 = npc->_child; fVar23 = (tmpEntity->_pos).x; fVar21 = (tmpEntity->_pos).y; if ((EVar17 == (EntityPtr)0x0) || (local_1d8 = npc->_entityRef, local_1d8 == (EntityPtr)0x0)) goto LAB_005885c8; cVar3 = FUN_00582ad0(); EVar10 = extraout_EDX; if (cVar3 == '\0') { LAB_0058869e: local_1d8 = EVar10; } else { cVar3 = FUN_00582ad0(); EVar10 = extraout_EDX_00; if (cVar3 == '\0') goto LAB_0058869e; pfVar11 = (float *)FUN_00582b00(local_214 + 8); fVar20 = (npc->_pos).x; fVar19 = (npc->_pos).y; fVar26 = *pfVar11 - fVar20; fVar25 = pfVar11[1] - fVar19; pfVar11 = (float *)FUN_00582b00(&scratchVec); if (((fVar23 - fVar20) * fVar25 - (fVar21 - fVar19) * fVar26 < 0.0) || (0.0 < (fVar23 - fVar20) * (pfVar11[1] - fVar19) - (fVar21 - fVar19) * (*pfVar11 - fVar20))) { bVar18 = false; } else { bVar18 = true; } if (!bVar18) goto LAB_005885c8; } sVar6 = (short)npc->_projectileCooldown; } if (((sVar6 < 0) && (cVar3 = FUN_00582ad0(), cVar3 != '\0')) && (cVar3 = FUN_00582ad0(), cVar3 != '\0')) { *(undefined2 *)&npc->_projectileCooldown = 0; local_208 = (npc->_vectorDeque1)._offset; *(undefined4 *) (*(int *)((int)(npc->_vectorDeque1)._map + ((npc->_vectorDeque1)._mapSize - 1 & local_208 + 1 >> 1) * 4) + 4 + (local_208 + 1 & 1) * 8) = 0; uVar7 = Random(); *(ushort *)((int)&npc->_projectileDelay + 2) = (ushort)uVar7 & 1; iVar16 = elapsedTicks; if (20.0 < ABS(*(float *)((int)npc->_child + 0x340) - *(float *)((int)npc->_entityRef + 0x340))) { *(undefined2 *)((int)&npc->_projectileDelay + 2) = 0; } goto LAB_0058860b; } } iVar16 = elapsedTicks; } LAB_0058860b: sVar6 = (short)npc->_projectileCooldown; if (-1 < sVar6) { sVar6 = sVar6 + (short)iVar16; iVar27 = (int)sVar6; *(short *)&npc->_projectileCooldown = sVar6; local_1dc = (float)(iVar27 - iVar16); if (*(short *)((int)&npc->_projectileDelay + 2) == 0) { if ((((int)local_1dc / 0x1e < iVar27 / 0x1e) && (npc->_child != (EntityPtr)0x0)) && (npc->_entityRef != (EntityPtr)0x0)) { ENTITY_SCOURGE_projectile_attack(npc); } } else if ((((int)local_1dc / 0xf < iVar27 / 0xf) && (npc->_child != (EntityPtr)0x0)) && (npc->_entityRef != (EntityPtr)0x0)) { NpcHelper::scourge_chain_shoot(); } } if ((npc->_child != (EntityPtr)0x0) && (cVar3 = FUN_00582ad0(), cVar3 != '\0')) { FUN_00582aa0(); uVar28 = 0x3dcccccd; uVar12 = FUN_00582b00(local_214 + 8); FUN_00586b50(uVar12,uVar28); } if ((npc->_entityRef != (EntityPtr)0x0) && (cVar3 = FUN_00582ad0(), cVar3 != '\0')) { FUN_00582aa0(); uVar28 = 0x3dcccccd; uVar12 = FUN_00582b00(local_214 + 8); FUN_00586b50(uVar12,uVar28); } break; case 10: npc->_friction = npc->_friction * 0.6; if ((short)npc->_projectileCooldown < 0) { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x13a,1.0,2,0,1.0); tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar23 = (tmpEntity->_pos).y; (npc->_targetPosition).x = (tmpEntity->_pos).x; (npc->_targetPosition).y = fVar23; } bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 == 0) { if ((short)npc->_projectileDelay < 0) goto LAB_00588e89; } else { local_1e8.x = (npc->_targetPosition).x - (npc->_pos).x; local_1e8.y = (npc->_targetPosition).y - (npc->_pos).y; Vector::Normalize(&local_1e8); uVar7 = Random(); local_1d8 = (EntityPtr)(uVar7 & 1); local_1dc = (float)CONCAT31(local_1dc._1_3_,local_1d8._0_1_); Entity_NPC::PlaySound(npc,0x1ee,1.0,2,0,1.0); if (*(short *)((int)&npc->_projectileDelay + 2) == 0) { local_1f8.x = local_1e8.x * 26.0; local_1f8.y = local_1e8.y * 26.0; local_1e0 = (EntityPtr) NpcHelper::scourge_spawn_chain (&npc->_pos,&local_1f8,1,(Entity *)npc,&g_vectorZero); if (npc->_child != (EntityPtr)0x0) { local_1d4 = (EntityPtr)&npc->_child; std::multiset::erase(&local_1d4); } npc->_child = local_1e0; if (local_1e0 != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } FUN_00582b40(); FUN_00583110(local_1dc); local_1e8.x = -local_1e8.x * 26.0; local_1e8.y = -local_1e8.y * 26.0; local_1e0 = (EntityPtr) NpcHelper::scourge_spawn_chain (&npc->_pos,&local_1e8,1,(Entity *)npc,&g_vectorZero); if (npc->_entityRef != (EntityPtr)0x0) { local_1d4 = (EntityPtr)&npc->_entityRef; std::multiset::erase(&local_1d4); } npc->_entityRef = local_1e0; if (local_1e0 != (EntityPtr)0x0) { std::multiset::insert(&npc->_entityRef); } } else { local_1e8.x = local_1e8.x * 26.0; local_1e8.y = local_1e8.y * 26.0; local_1e0 = (EntityPtr) NpcHelper::scourge_spawn_chain (&npc->_pos,&local_1e8,2,(Entity *)npc,&g_vectorZero); if (npc->_child != (EntityPtr)0x0) { local_1d4 = (EntityPtr)&npc->_child; std::multiset::erase(&local_1d4); } npc->_child = local_1e0; if (local_1e0 != (EntityPtr)0x0) { std::multiset::insert(&npc->_child); } FUN_00582b40(); } FUN_00583110(local_1d8); *(undefined2 *)&npc->_projectileDelay = 0; } if (npc->_child == (EntityPtr)0x0) { bVar18 = npc->_entityRef == (EntityPtr)0x0; EVar17 = (EntityPtr)0x0; } else { cVar3 = FUN_00582ad0(); bVar18 = cVar3 == '\0'; EVar17 = extraout_EDX_01; } if (!bVar18) { EVar10 = (EntityPtr)0x0; if (npc->_entityRef != (EntityPtr)0x0) { cVar3 = FUN_00582ad0(); if (cVar3 == '\0') goto LAB_00588e89; EVar10 = npc->_entityRef; EVar17 = extraout_EDX_02; } *(undefined2 *)&npc->_projectileCooldown = 0; if (EVar17 == (EntityPtr)0x0) { EVar17 = EVar10; if (EVar10 == (EntityPtr)0x0) goto LAB_00588e89; } pcVar13 = "SlicePullLeft"; if (*(char *)((int)EVar17 + 0x148) == '\0') { pcVar13 = "SlicePullRight"; } ANM2::Play(&npc->_sprite,(byte *)pcVar13,0); if ((*(short *)((int)&npc->_projectileDelay + 2) != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,15.0); } } } else { bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { if (npc->_child != (EntityPtr)0x0) { FUN_005830e0(uVar7); } if (npc->_entityRef != (EntityPtr)0x0) { FUN_005830e0(uVar7); } } if ((((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) && ((EVar17 = npc->_child, EVar17 != (EntityPtr)0x0 || (EVar17 = npc->_entityRef, EVar17 != (EntityPtr)0x0)))) { pcVar13 = "SlicePullLoopLeft"; if (*(char *)((int)EVar17 + 0x148) == '\0') { pcVar13 = "SlicePullLoopRight"; } ANM2::Play(&npc->_sprite,(byte *)pcVar13,0); } if (0 < iVar16) { do { sVar5 = (short)npc->_projectileCooldown + 1; sVar6 = *(short *)((int)&npc->_projectileDelay + 2); *(short *)&npc->_projectileCooldown = sVar5; if (((sVar6 == 0) && (0x1d < sVar5)) && ((int)sVar5 % 0x1e == 0)) { ProjectileParams::ProjectileParams(&burstParams); burstParams.Color._offset[2] = DAT_00c34cf0; burstParams.Color._tint[0] = _DAT_00c34cc8; burstParams.Color._tint[1] = fRam00c34ccc; burstParams.Color._tint[2] = fRam00c34cd0; burstParams.Color._tint[3] = fRam00c34cd4; burstParams.FallingAccelModifier = -0.12; local_1e8.x = 6.0; burstParams.Color._colorize[0] = _DAT_00c34cd8; burstParams.Color._colorize[1] = fRam00c34cdc; burstParams.Color._colorize[2] = fRam00c34ce0; burstParams.Color._colorize[3] = fRam00c34ce4; burstParams.Color._offset[0] = (float)DAT_00c34ce8; burstParams.Color._offset[1] = DAT_00c34ce8._4_4_; local_1e8.y = 12.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_1e8,9,&burstParams); uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&npc->_pos,&g_vectorZero,(Entity *)0x0,2,uVar7); (**(code **)(*(int *)tmpEntity + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1); local_1d8 = (EntityPtr)0x3f800000; (tmpEntity->_sprite)._offset.x = 0.0; (tmpEntity->_sprite)._offset.y = -20.0; tmpEntity->_renderDepthOffset = 10.0; manager = g_manager; if (npc->_championColorIdx == 0x12) { local_1d8 = (EntityPtr)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_1d8 = (EntityPtr)0x3f000000; } local_1dc = 2.49431e-43; seed_fart_sound_override((int *)&local_1dc); SoundEffects::Play(&manager->_sfxManager,(int)local_1dc,1.0,2,0,(float)local_1d8,0.0); iVar16 = elapsedTicks; } iVar16 = iVar16 + -1; elapsedTicks = iVar16; } while (iVar16 != 0); } } LAB_00588e89: if (-1 < (short)npc->_projectileDelay) { FUN_00586b50(&roomCenter,0x3d4ccccd); sVar6 = 0xf0; if (*(short *)((int)&npc->_projectileDelay + 2) != 0) { sVar6 = 0x3c; } if ((sVar6 < (short)npc->_projectileCooldown) || ((npc->_child == (EntityPtr)0x0 && (npc->_entityRef == (EntityPtr)0x0)))) { npc->_state = 9; *(undefined2 *)&npc->_projectileCooldown = 0xffff; if (npc->_child != (EntityPtr)0x0) { NpcHelper::scourge_whip(); } if (npc->_entityRef != (EntityPtr)0x0) { NpcHelper::scourge_whip(); } ANM2::Play(&npc->_sprite,(byte *)"TrapEndDown",0); } } break; case 0xb: npc->_friction = npc->_friction * 0.6; bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar2 != 0) { sVar6 = (short)npc->_projectileCooldown + 1; *(short *)&npc->_projectileCooldown = sVar6; if (sVar6 == 0) { LAB_00588f9f: iVar27 = 0x48; } else { if (sVar6 != 1) { if (sVar6 != 2) goto LAB_00588fbc; goto LAB_00588f9f; } iVar27 = 0xa6; } Entity_NPC::PlaySound(npc,iVar27,1.0,2,0,1.0); } LAB_00588fbc: bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0xe2,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); Game::ShakeScreen(g_game,7); *(undefined2 *)&npc->_projectileDelay = 10; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_1e8.x = (tmpEntity->_pos).x - (npc->_pos).x; local_1e8.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalize(&local_1e8); (npc->_targetPosition).x = local_1e8.x * -10.0; (npc->_targetPosition).y = local_1e8.y * -10.0; ProjectileParams::ProjectileParams(&bossShotParams); Color::operator_assign((Color *)&bossShotParams.Color,&g_colorGreenSplat); bossShotParams.BulletFlags._0_4_ = 0; bossShotParams.BulletFlags._4_4_ = 0x200000; bossShot = Entity_NPC::FireBossProjectiles(npc,1,&g_vectorZero,0.0,&bossShotParams); bossShot->_height = -23.0; (bossShot->_velocity).x = local_1e8.x * 14.0; bossShot->_fallingAccel = -0.08; (bossShot->_velocity).y = local_1e8.y * 14.0; bossShot->_fallingSpeed = 0.0; bossShot->_homingStrength = 0.5; fVar23 = npc->_health / npc->_maxHitPoints; if (0.5 <= fVar23) { fVar21 = 1.0; } else { fVar21 = 0.6; } iVar27 = 5; if (0.5 <= fVar23) { iVar27 = 0xe; } bossShot->_subtype = iVar27; bossShot->_scale = fVar21; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._colorize[0] = 2.0; tmpColor._colorize[1] = 4.0; tmpColor._colorize[2] = 1.0; tmpColor._colorize[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; local_1e8.x = 0.0; local_1e8.y = -20.0; spawn_blood_explosion(4,&npc->_pos,&local_1e8,&tmpColor,&g_vectorZero); npc->_i1 = npc->_i1 + -1; } sVar6 = (short)npc->_projectileDelay; if (0 < sVar6) { *(short *)&npc->_projectileDelay = sVar6 - (short)iVar16; fVar23 = npc->_speedMultiplier; fVar21 = (npc->_targetPosition).x; (npc->_velocity).y = fVar23 * (npc->_targetPosition).y + (npc->_velocity).y; auVar22 = ZEXT812(0x3f4ccccd); (npc->_velocity).x = fVar23 * fVar21 + (npc->_velocity).x; fVar23 = npc->_speedMultiplier; if (fVar23 != 1.0) { fVar21 = auVar22._0_4_; auVar22._4_8_ = auVar22._4_8_; auVar22._0_4_ = fVar21 / ((fVar23 + fVar21) - fVar23 * fVar21); } (npc->_targetPosition).y = auVar22._0_4_ * (npc->_targetPosition).y; (npc->_targetPosition).x = auVar22._0_4_ * (npc->_targetPosition).x; } if (((npc->_sprite)._animState._animFrame <= 56.0) || (npc->_i1 < 1)) goto LAB_00589c3a; if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,30.0); goto LAB_00589c3a; } LAB_00589c49: npc->_state = 3; *(undefined2 *)&npc->_projectileCooldown = 0xffff; *(undefined2 *)&npc->_projectileDelay = 0xffff; *(undefined2 *)((int)&npc->_projectileCooldown + 2) = 0; } iVar16 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (iVar16 != 0) { if (*(char *)((int)npc + 3000) != '\0') { *(char *)((int)npc + 3000) = *(char *)((int)npc + 3000) + -1; } if (*(char *)((int)npc + 0xbb9) != '\0') { *(char *)((int)npc + 0xbb9) = *(char *)((int)npc + 0xbb9) + -1; } if (*(char *)((int)npc + 0xbba) != '\0') { *(char *)((int)npc + 0xbba) = *(char *)((int)npc + 0xbba) + -1; } if (*(char *)((int)npc + 0xbbb) != '\0') { *(char *)((int)npc + 0xbbb) = *(char *)((int)npc + 0xbbb) + -1; } if (*(char *)((int)npc + 0xbbc) != '\0') { *(char *)((int)npc + 0xbbc) = *(char *)((int)npc + 0xbbc) + -1; } if (*(char *)((int)npc + 0xbbd) != '\0') { *(char *)((int)npc + 0xbbd) = *(char *)((int)npc + 0xbbd) + -1; } } if (*(char *)((int)npc + 0x173) != '\0') { EntityList::QuerySublist ((EntityList *)((int)room + 0x1218),(EntityList_EL *)local_214,9,0,-1,0,0); uVar7 = 0; if (local_208 != 0) { do { iVar16 = *(int *)(local_214._4_4_ + uVar7 * 4); if ((iVar16 == 0) || (*(int *)(iVar16 + 0x28) != 9)) { iVar16 = 0; } if (*(EntityPtr *)(iVar16 + 0x3bc) == (EntityPtr)npc) { *(undefined1 *)(iVar16 + 0x173) = 1; } uVar7 = uVar7 + 1; } while (uVar7 < local_208); } if (local_214[0] == '\0') { local_14 = 0.0; tracked_alloc(1,(void *)local_214._4_4_,0); } } if (*(int *)((int)npc + 0x2f8) < 3) { ExceptionList = local_1c; return; } *(undefined4 *)((int)npc + 0x2f8) = 2; ExceptionList = local_1c; return; } //@@ 00589de0 FUN_00589de0 void FUN_00589de0(Vector *param_1) { byte bVar1; EntityPtr EVar2; Entity_Pickup *in_ECX; EVar2 = in_ECX->_parent; if (((EVar2 == (EntityPtr)0x0) || (*(int *)((int)EVar2 + 0x28) != 0x38d)) || (*(int *)((int)EVar2 + 0x2c) != 10)) { Entity_Pickup::GetLootList(in_ECX,param_1); } else if (*(int *)&in_ECX[1]._priceANM2._overlayRenderFirst == 6) { bVar1 = (in_ECX->_sprite)._flipX; (in_ECX->_sprite)._flipX = 0; Entity::Render((Entity *)in_ECX,param_1); (in_ECX->_sprite)._flipX = bVar1; return; } return; } //@@ 00589e40 std::vector::_Emplace_reallocate /* DB: ECX vector of 0x70-byte elements (max 0x2492492): allocate 1.5x, render_quad_copy the new element and both halves, adopt (FUN_0041fe10), returns pointer to the inserted element; callers Entity_Pickup::GetLootList and render_quad_draw push ColorQuads */ void * std::vector::_Emplace_reallocate(void *param_1,void *param_2) { uint uVar1; int iVar2; int iVar3; uint uVar4; void *pvVar5; void *this; int *in_ECX; void *pvVar6; void *src; void *pvVar7; uint local_c; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x70; if (iVar3 == 0x2492492) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar4 = iVar3 + 1; uVar1 = (in_ECX[2] - *in_ECX) / 0x70; if (0x2492492 - (uVar1 >> 1) < uVar1) { local_c = 0x2492492; } else { uVar1 = (uVar1 >> 1) + uVar1; local_c = uVar4; if (uVar4 <= uVar1) { local_c = uVar1; } if (0x2492492 < local_c) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(local_c * 0x70); this = (void *)((int)pvVar5 + (((int)param_1 - iVar2) / 0x70) * 0x70); render_quad_copy(this,param_2); pvVar7 = (void *)in_ECX[1]; src = (void *)*in_ECX; pvVar6 = pvVar5; if (param_1 == pvVar7) { for (; src != pvVar7; src = (void *)((int)src + 0x70)) { render_quad_copy(pvVar6,src); pvVar6 = (void *)((int)pvVar6 + 0x70); } } else { if (src != param_1) { do { render_quad_copy(pvVar6,src); src = (void *)((int)src + 0x70); pvVar6 = (void *)((int)pvVar6 + 0x70); } while (src != param_1); pvVar7 = (void *)in_ECX[1]; } if (param_1 != pvVar7) { iVar2 = 0x70 - (int)param_1; do { render_quad_copy((void *)((int)this + iVar2 + (int)param_1),param_1); param_1 = (void *)((int)param_1 + 0x70); } while (param_1 != pvVar7); } } vector::_Change_array(pvVar5,uVar4,local_c); return this; } //@@ 00589f90 Room::CanSpawnObstacleAtPos /* DB: converts pos to grid xy (40px, top 120) and calls Room::CanSpawnObstacleAtPosition; Singe, Wormwood */ void Room::CanSpawnObstacleAtPos(float *param_1,byte param_2) { Room *in_ECX; int iVar1; int iVar2; iVar2 = (int)((*param_1 - 40.0) / 40.0 + 0.5); if ((((iVar2 < 0) || (in_ECX->_gridWidth <= iVar2)) || (iVar1 = (int)((param_1[1] - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (in_ECX->_gridHeight <= iVar1)) { CanSpawnObstacleAtPosition(in_ECX,-1,param_2); return; } CanSpawnObstacleAtPosition(in_ECX,in_ECX->_gridWidth * iVar1 + iVar2,param_2); return; } //@@ 0058a010 Entity_NPC::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix33/34] __thiscall void Entity_NPC::Render(Vector *offset); */ void __cdecl Entity_NPC::Render(Entity_NPC *room) { code *pcVar1; ulonglong uVar2; longlong lVar3; longlong lVar4; longlong lVar5; Entity *entity; byte bVar6; char cVar7; uint uVar8; uint uVar9; GridEntity *pit; uint rerollSeed; int gridWidth; int unusedArg; void *pvVar10; int *piVar11; int iVar12; uint uVar13; PlayerManager *playerManager; Room *room; bool bVar14; float fVar15; ulonglong timeNs; int in_stack_00000004; undefined1 local_11c [8]; void *local_114; undefined1 local_110 [8]; void *local_108; undefined1 local_104 [8]; int local_fc; GridEntity *allocatedPit; undefined4 local_f4; undefined4 local_f0; undefined4 local_ec; undefined4 local_e8; float local_e4; float local_e0; float local_dc; float local_d8; undefined4 local_d4; undefined4 local_d0; undefined8 local_c8; undefined4 local_c0; Vector particlePos; Vector particleVelocity; uint local_ac [3]; int local_a0; int centerRow; uint local_98; int centerCell; EntityPtr *oldSpawnerRef; int timer; int ringSide; int stepX; int cellRow; int cellCol; int sideStep; undefined4 local_74; float local_70; Vector pitPos; int stepY; float outDirY; float outDirX; uint spawnVariant; undefined4 local_54; float local_50; Game *spawnGame; uint spawnType; undefined4 local_44; float local_40; int local_3c; Room *savedRoom; int *local_34; Entity *local_30; uint finalSubtype; uint spawnSubtype; RNG cardRng; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; EntityPtr *spawnerRef; local_8 = 0xffffffff; puStack_c = &LAB_00af549a; local_10 = ExceptionList; uVar8 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; timer = in_stack_00000004; room = g_game->_room; centerCell = (int)((*(float *)(in_stack_00000004 + 0x33c) - 40.0) / 40.0 + 0.5); iVar12 = (int)((*(float *)(in_stack_00000004 + 0x340) - 120.0) / 40.0 + 0.5); if ((((centerCell < 0) || (gridWidth = room->_gridWidth, gridWidth <= centerCell)) || (iVar12 < 0) ) || (room->_gridHeight <= iVar12)) { gridWidth = room->_gridWidth; centerCell = -1; } else { centerCell = gridWidth * iVar12 + centerCell; } centerRow = centerCell / gridWidth; centerCell = centerCell % gridWidth; *(int *)(in_stack_00000004 + 0x450) = *(int *)(in_stack_00000004 + 0x450) + 1; local_3c = *(int *)(in_stack_00000004 + 0x450); stepX = -1; stepY = 0; ringSide = 0; savedRoom = room; local_14 = uVar8; do { sideStep = 0; cellCol = stepX * local_3c + centerCell; cellRow = stepY * local_3c + centerRow; iVar12 = stepX; if (0 < local_3c) { do { if (((cellCol < 0) || (room->_gridWidth <= cellCol)) || ((cellRow < 0 || (room->_gridHeight <= cellRow)))) { uVar13 = 0xffffffff; } else { uVar13 = room->_gridWidth * cellRow + cellCol; } bVar6 = Room::CanSpawnObstacleAtPosition(room,uVar13,0); if (bVar6 != 0) { if (((uVar13 < 0x1c0) && (piVar11 = room->_gridEntities[uVar13], piVar11 != (int *)0x0)) && (piVar11[0xf] != 0)) { local_f4 = 0; local_f0 = 0; local_ec = 0; local_e8 = 0; local_e4 = g_vectorZero.x; local_e0 = g_vectorZero.y; local_dc = g_vectorZero.x; local_d8 = g_vectorZero.y; local_d4 = 0; local_d0 = 0; (**(code **)(*piVar11 + 0x14))(1,&local_f4,uVar8); } uVar9 = Random(); if (((-1 < (int)uVar13) && ((int)uVar13 < 0x1c0)) || ((KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"), -1 < (int)uVar13 && ((int)uVar13 < 0x1c0)))) { if (room->_gridPaths[uVar13] < 0x385) { pit = operator_new(0x158); local_8 = 6; allocatedPit = pit; if (pit == (GridEntity *)0x0) { pit = (GridEntity *)0x0; } else { GridEntity::GridEntity(pit); *(undefined ***)pit = IsaacRepentancePlus::GridEntity_Pit::vftable; } local_8 = 0xffffffff; if (pit != (GridEntity *)0x0) { (pit->_desc)._type = 7; pit->_gridIndex = uVar13; if (savedRoom->_gridEntities[uVar13] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)savedRoom->_gridEntities[uVar13])(1); } savedRoom->_gridEntities[uVar13] = pit; iVar12 = *(int *)pit; (pit->_desc)._variant = 0; (pit->_desc)._varData = 0; pit->_collisionClass = 0; (pit->_desc)._spawnSeed = uVar9; (**(code **)(iVar12 + 0x20))(); game = g_game; piVar11 = &(pit->_desc)._spawnCount; *piVar11 = *piVar11 + 1; (pit->_desc)._initialized = 1; pit->_spawnFrame = game->_frameCount; } room = savedRoom; } piVar11 = room->_gridEntities[uVar13]; if ((piVar11 != (int *)0x0) && (piVar11[1] == 7)) { (**(code **)(*piVar11 + 4))(); } } pitPos.x = (float)((int)uVar13 % room->_gridWidth) * 40.0 + 40.0; pitPos.y = (float)((int)uVar13 / room->_gridWidth) * 40.0 + 120.0; outDirX = pitPos.x - *(float *)(timer + 0x33c); outDirY = pitPos.y - *(float *)(timer + 0x340); fVar15 = sqrtf(outDirX * outDirX + outDirY * outDirY); if (0.0 < fVar15) { outDirX = outDirX * (1.0 / fVar15); outDirY = outDirY * (1.0 / fVar15); } local_70 = (float)Random(); spawnGame = g_game; spawnSubtype = 0; spawnVariant = 0xf; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&pitPos,&g_vectorZero,(Entity *)0x0, (int *)&spawnSubtype,(uint *)&local_70); uVar13 = spawnVariant; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0058a5f2: finalSubtype = spawnSubtype; } else { piVar11 = (g_game->_deathmatchManager)._type; local_34 = piVar11; rerollSeed = Random(); uVar9 = spawnSubtype; local_c8 = 0x900000005; local_40 = 9.80909e-45; local_c0 = 7; if (spawnType != 5) goto LAB_0058a5f2; if (uVar13 < 0x12d) { if (uVar13 == 300) { while ((finalSubtype = spawnSubtype, spawnSubtype == 0 || (cVar7 = (**(code **)(*piVar11 + 0x24))(spawnSubtype), cVar7 != '\0'))) { if (rerollSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } rerollSeed = rerollSeed >> ((byte)local_c8 & 0x1f) ^ rerollSeed; rerollSeed = rerollSeed << ((byte)((ulonglong)local_c8 >> 0x20) & 0x1f) ^ rerollSeed; rerollSeed = rerollSeed >> (SUB41(local_40,0) & 0x1f) ^ rerollSeed; iVar12 = ItemPool::GetCardEx(rerollSeed,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = rerollSeed; spawnSubtype = lua_callback_run_get_card(&cardRng,iVar12,1,1,0); } } else { if (uVar13 == 0x46) { local_50 = (float)(spawnSubtype >> 0xb); do { finalSubtype = spawnSubtype; if (spawnSubtype != 0) { pcVar1 = *(code **)(*piVar11 + 0x28); iVar12 = ItemPool::GetPillEffect (&g_game->_itemPool,spawnSubtype,(Entity_Player *)0x0); cVar7 = (*pcVar1)(iVar12); if (cVar7 == '\0') goto LAB_0058a5f8; piVar11 = local_34; } if (rerollSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } rerollSeed = rerollSeed >> ((byte)local_c8 & 0x1f) ^ rerollSeed; rerollSeed = rerollSeed << ((byte)((ulonglong)local_c8 >> 0x20) & 0x1f) ^ rerollSeed; rerollSeed = rerollSeed >> (SUB41(local_40,0) & 0x1f) ^ rerollSeed; spawnSubtype = ItemPool::GetPill(rerollSeed); spawnSubtype = spawnSubtype | ((uint)local_50 & 1) << 0xb; } while( true ); } if (uVar13 != 100) goto LAB_0058a5f2; finalSubtype = spawnSubtype; if (spawnSubtype == 0x19) { LAB_0058a467: bVar14 = false; } else { local_98 = spawnSubtype; std::set::find_node(local_104,&local_98); if (((*(char *)(local_fc + 0xd) == '\0') && (*(int *)(local_fc + 0x10) <= (int)uVar9)) && (local_fc != piVar11[8])) goto LAB_0058a467; bVar14 = true; } if ((uVar9 == 0) || (bVar14)) { finalSubtype = (**(code **)(*piVar11 + 0x84))(0); spawnSubtype = finalSubtype; } } } else { if (uVar13 != 0x15e) goto LAB_0058a5f2; while ((finalSubtype = spawnSubtype, spawnSubtype == 0 || (cVar7 = (**(code **)(*piVar11 + 0x2c))(spawnSubtype), cVar7 != '\0'))) { spawnSubtype = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0058a5f8: local_30 = EntityFactory::Create(spawnGame->_entityFactory,spawnType,0); if (local_30 != (Entity *)0x0) { timeNs = GetTimeNs(); entity = local_30; local_50 = (float)(timeNs >> 0x20); uVar2 = (timeNs & 0xffffffff) * 0xd7b634db; local_44 = (undefined4)uVar2; lVar3 = (timeNs & 0xffffffff) * 0x431bde82; lVar4 = (ulonglong)(uint)local_50 * 0xd7b634db + (uVar2 >> 0x20); local_54 = (undefined4)(lVar4 + lVar3); lVar3 = (ulonglong)(uint)local_50 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)((ulonglong)lVar3 >> 0x20) + (uint)CARRY4((uint)lVar3,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar3) >> 0x20)); uVar13 = (uint)((ulonglong)lVar3 >> 0x20); spawnerRef = &local_30->_spawnerEntity; local_34 = (int *)((uint)lVar3 >> 0x12 | uVar13 * 0x4000); local_40 = (float)(uVar13 >> 0x12); local_30->_spawnerType = 0; local_30->_spawnerVariant = 0; if (*spawnerRef != (EntityPtr)0x0) { oldSpawnerRef = spawnerRef; std::multiset::erase(&oldSpawnerRef); } iVar12 = *(int *)entity; *spawnerRef = (EntityPtr)0x0; (entity->_pos).x = pitPos.x; (entity->_pos).y = pitPos.y; (entity->_velocity).x = g_vectorZero.x; (entity->_velocity).y = g_vectorZero.y; (**(code **)(iVar12 + 4))(spawnType,spawnVariant,finalSubtype,local_70); game = spawnGame; pvVar10 = spawnGame->_room; iVar12 = *(int *)((int)pvVar10 + 0x1214); *(int *)((int)pvVar10 + 0x1214) = iVar12 + 1; entity->_index = iVar12; EntityList::AddEntity((EntityList *)((int)pvVar10 + 0x1218),entity); bVar6 = Game::ShouldEraseEnemy(entity); if (bVar6 != 0) { Entity::RemoveWithPoof(entity,unusedArg); } if ((entity->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { local_a0 = entity->_variant; uVar13 = entity->_type; local_ac[2] = uVar13; FUN_009e2760(local_110,local_ac + 2); if (((*(char *)((int)local_108 + 0xd) == '\0') && (*(uint *)((int)local_108 + 0x10) <= uVar13)) && ((*(uint *)((int)local_108 + 0x10) < uVar13 || (*(uint *)((int)local_108 + 0x14) <= (uint)entity->_variant)))) { pvVar10 = (spawnGame->_proceduralItemManager)._spawnTriggerTargets._head; if (local_108 == pvVar10) goto LAB_0058a7bc; } else { pvVar10 = (game->_proceduralItemManager)._spawnTriggerTargets._head; LAB_0058a7bc: local_ac[1] = 0xffffffff; local_ac[0] = uVar13; FUN_009e2760(local_11c,local_ac); if (((*(char *)((int)local_114 + 0xd) != '\0') || (uVar13 < *(uint *)((int)local_114 + 0x10))) || (local_114 == pvVar10)) goto LAB_0058a878; } uVar13 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (uVar13 < (uint)((int)pvVar10 - (int)piVar11 >> 2)) { piVar11 = piVar11 + uVar13; } trigger_set_dispatch((void *)(*piVar11 + 0x1fc8),6,entity,&pitPos,&g_vectorZero); uVar13 = uVar13 + 1; playerManager = &g_game->_playerManager; } while (uVar13 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0058a878: timeNs = GetTimeNs(); uVar13 = (uint)(timeNs >> 0x20); uVar2 = (timeNs & 0xffffffff) * 0xd7b634db; local_54 = (undefined4)uVar2; lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_50 = (float)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar13 * 0x431bde82; local_30 = (Entity *)lVar4; lVar5 = (ulonglong)uVar13 * 0xd7b634db + (uVar2 >> 0x20); local_74 = (undefined4)(lVar5 + lVar3); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), (int)local_50 + (uint)CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar9 = (uint)((ulonglong)lVar4 >> 0x20); piVar11 = (int *)((uint)lVar4 >> 0x12 | uVar9 * 0x4000); uVar13 = (int)piVar11 - (int)local_34; bVar14 = CARRY4((uint)g_entitySpawnTimeMs,uVar13); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar13; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar9 >> 0x12) - (int)local_40) - (uint)(piVar11 < local_34)) + (uint)bVar14; } iVar12 = 5; do { uVar13 = Random(); uVar9 = Random(); local_30 = (Entity *) (((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292); local_50 = cos((float)local_30); local_30 = (Entity *)sin((float)local_30); uVar9 = Random(); particleVelocity.y = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 6.0; particleVelocity.x = (local_50 * outDirX - (float)local_30 * outDirY) * particleVelocity.y; particleVelocity.y = ((float)local_30 * outDirX + local_50 * outDirY) * particleVelocity.y; uVar9 = Random(); local_70 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_70 = local_70 + local_70; uVar9 = Random(); local_40 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 20.0; fVar15 = cos(local_70); particlePos.x = fVar15 * local_40 + pitPos.x; fVar15 = sin(local_70); particlePos.y = fVar15 * local_40 + pitPos.y; Game::SpawnEx(g_game,1000,4,&particlePos,&particleVelocity,(Entity *)0x0,0x20000,uVar13, 0); iVar12 = iVar12 + -1; } while (iVar12 != 0); iVar12 = stepX; room = savedRoom; } sideStep = sideStep + 1; cellCol = cellCol - (stepY + iVar12); cellRow = cellRow + (iVar12 - stepY); } while (sideStep < local_3c); } manager = g_manager; stepX = -stepY; ringSide = ringSide + 1; stepY = iVar12; if (3 < ringSide) { local_3c = 0x89; seed_fart_sound_override(&local_3c); SoundEffects::Play(&manager->_sfxManager,local_3c,1.0,2,0,1.0,0.0); ExceptionList = local_10; return; } } while( true ); } //@@ 0058ab60 FUN_0058ab60 uint FUN_0058ab60(void) { Room *this; byte bVar1; Game *pGVar2; undefined3 extraout_var; undefined3 extraout_var_00; float *in_ECX; int iVar3; GridEntity *this_00; this = g_game->_room; iVar3 = (int)((*in_ECX - 40.0) / 40.0 + 0.5); pGVar2 = g_game; if ((((-1 < iVar3) && (iVar3 < this->_gridWidth)) && (pGVar2 = (Game *)(int)((in_ECX[1] - 120.0) / 40.0 + 0.5), -1 < (int)pGVar2)) && (((int)pGVar2 < this->_gridHeight && (iVar3 = this->_gridWidth * (int)pGVar2 + iVar3, -1 < iVar3)))) { if ((iVar3 < 0x1c0) && (this->_gridEntities[iVar3] != (GridEntity *)0x0)) { bVar1 = GridEntity::IsEasyCrushableOrWalkable(this->_gridEntities[iVar3]); if (bVar1 == 0) { bVar1 = GridEntity::IsDangerousCrushableOrWalkable(this_00); pGVar2 = (Game *)CONCAT31(extraout_var,bVar1); if (bVar1 == 0) goto LAB_0058abfc; } } bVar1 = Room::CanSpawnObstacleAtPosition(this,iVar3,1); pGVar2 = (Game *)CONCAT31(extraout_var_00,bVar1); if (bVar1 != 0) { return CONCAT31(extraout_var_00,1); } } LAB_0058abfc: return (uint)pGVar2 & 0xffffff00; } //@@ 0058ac10 NpcHelper::singe_explode_at /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: NpcAI::ENTITY_SINGE_body passes target pos: QueryRadius/QuerySublist, Game::BombExplosionEffects, ShakeScreen, ButterBeanFart */ void NpcHelper::singe_explode_at(Vector *param_1) { int iVar1; qword qVar2; uint uVar3; uint angleRoll; Entity *minion; Entity *in_ECX; qword *heapCounter; float fVar4; EntityList_EL minions; EntityList_EL nearby; Vector spawnPos; float angle; float angleSin; ColorMod explosionColor; uint local_18; void *local_10; undefined1 *puStack_c; float local_8; undefined4 flagsHigh; Game *game; local_8 = -NAN; puStack_c = &LAB_00af54e5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)((&explosionColor)[1]._colorize + 1); ExceptionList = &local_10; explosionColor._offset[0] = 0.0; explosionColor._offset[1] = 0.0; explosionColor._tint[0] = 1.0; explosionColor._tint[1] = 1.0; explosionColor._tint[2] = 1.0; explosionColor._tint[3] = 1.0; explosionColor._offset[2] = 0.0; explosionColor._colorize[0] = 0.0; explosionColor._colorize[1] = 0.0; explosionColor._colorize[2] = 0.0; explosionColor._colorize[3] = 0.0; Game::BombExplosionEffects (g_game,param_1,60.0,(BitSet128)ZEXT816(0),&explosionColor,in_ECX,1.15,1,4,0); Game::ButterBeanFart(g_game,param_1,120.0,in_ECX,0,0); Game::ShakeScreen(g_game,10); game = g_game; in_ECX[2]._collisionDamage = (float)((int)in_ECX[2]._collisionDamage + 1); EntityList::QueryRadius((EntityList *)((int)game->_room + 0x1218),&nearby,param_1,100.0,8); local_8 = 0.0; uVar3 = 0; if (nearby._size != 0) { do { iVar1 = *(int *)((int)nearby._data + uVar3 * 4); if ((*(int *)(iVar1 + 0x28) == 0x393) && (*(int *)(iVar1 + 0x2c) == 1)) { in_ECX[2]._collisionDamage = 0.0; break; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)nearby._size); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&minions,0x393,1,-1,0,0); local_8 = (float)CONCAT31(local_8._1_3_,1); if ((uint)minions._size < *(int *)&in_ECX[2].field_0x3a8 + 4U) { uVar3 = Random(); angleRoll = Random(); angle = (float)((double)(int)angleRoll + __uint_to_double_fixup[-((int)angleRoll >> 0x1f)]) * 2.3283064e-10 * 3.14; angle = angle + angle; angleSin = sin(angle); fVar4 = cos(angle); spawnPos.x = fVar4 * 20.0 + (in_ECX->_pos).x; spawnPos.y = angleSin * 20.0 + (in_ECX->_pos).y; minion = Game::Spawn(g_game,0x393,1,&spawnPos,&g_vectorZero,in_ECX,0,uVar3); flagsHigh = *(undefined4 *)((int)&minion->_flags + 4); iVar1 = *(int *)minion; *(uint *)&minion->_flags = (uint)minion->_flags & 0xfffffffb; *(undefined4 *)((int)&minion->_flags + 4) = flagsHigh; (**(code **)(iVar1 + 0xc))(); iVar1 = *(int *)minion; minion[2]._updateTime = -500.0; minion[2]._speedMultiplier = 10.0; (**(code **)(iVar1 + 0xc))(); } if (minions._0_1_ == '\0') { heapCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } if (minions._data != (void *)0x0) { uVar3 = *(uint *)((int)minions._data + -4); qVar2 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar3; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar2 < uVar3); free((void *)((int)minions._data + -4)); } } if (nearby._0_1_ == '\0') { heapCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } if (nearby._data != (void *)0x0) { uVar3 = *(uint *)((int)nearby._data + -4); qVar2 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar3; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar2 < uVar3); free((void *)((int)nearby._data + -4)); } } ExceptionList = local_10; return; } //@@ 0058aed0 NpcAI::ENTITY_SINGE_body /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Singe main AI; strs Blast/SuperFart/JumpBlast */ void __fastcall NpcAI::ENTITY_SINGE_body(Entity_NPC *npc) { int *piVar1; ANM2 *pAVar2; char cVar3; byte bVar4; uint uVar5; int iVar6; ColorMod *color; float *pfVar7; ColorMod *Color; Entity_Effect *renderTimer; Vector *pVVar8; uint randomValue; Entity *pEVar9; int iVar10; bool bVar11; bool bVar12; float fVar13; undefined1 *puVar14; undefined1 auVar15 [12]; undefined1 auVar16 [16]; float fVar17; float fVar18; float fVar19; float fVar20; float fVar21; char *anim; EntityList_EL queryList; float kickDirY; float kickDirX; Vector standPos; float standY; float standX; Entity_NPC *local_154; EntityPtr bestBall; EntityPtr ball; Entity *playerTarget; float bestScore; float local_140; byte isPlayerLeft; float local_138; float *local_134; Entity *local_130; float standCost; Room *local_128; float *local_124; Vector scratchPos; Vector local_118; Vector local_110; EntityPtr *local_108; undefined1 *local_104; EntityPtr *local_100; Color explosionColor; ProjectileParams fartParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; EntityPtr chosenBall; undefined4 flagsHigh; Entity_NPC *pushedEntity; Room *room; EntityPtr *targetRefSlot; puStack_20 = (undefined1 *)((&fartParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00af552b; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)&(&fartParams)[1].Spread; ExceptionList = &local_1c; room = g_game->_room; local_154 = npc; local_128 = room; local_24 = uVar5; pfVar7 = (&fartParams)[1].Color._tint + 2; if (((npc->_i1 < 2) && (fVar13 = ((float)(2 - npc->_i1) * npc->_maxHitPoints) / 3.0, pfVar7 = (&fartParams)[1].Color._tint + 2, npc->_health <= fVar13 && fVar13 != npc->_health)) && ((npc->_state == 3 || (pfVar7 = (&fartParams)[1].Color._tint + 2, npc->_state == 4)))) { if (npc->_i2 < 1) { npc->_i2 = 0x59; LAB_0058af9d: cVar3 = FUN_0058ab60(uVar5); pfVar7 = (float *)puStack_20; if (cVar3 != '\0') { scratchPos.x = (npc->_pos).x + 40.0; scratchPos.y = (npc->_pos).y + 0.0; cVar3 = FUN_0058ab60(uVar5); pfVar7 = (float *)puStack_20; if (cVar3 != '\0') { scratchPos.x = (npc->_pos).x - 40.0; scratchPos.y = (npc->_pos).y + 0.0; cVar3 = FUN_0058ab60(uVar5); pfVar7 = (float *)puStack_20; if (cVar3 != '\0') { scratchPos.x = (npc->_pos).x + 0.0; scratchPos.y = (npc->_pos).y + 40.0; cVar3 = FUN_0058ab60(uVar5); pfVar7 = (float *)puStack_20; if (cVar3 != '\0') { scratchPos.x = (npc->_pos).x + 0.0; scratchPos.y = (npc->_pos).y - 40.0; cVar3 = FUN_0058ab60(uVar5); pfVar7 = (float *)puStack_20; if (cVar3 != '\0') goto LAB_0058b0b4; } } } } } else { iVar6 = npc->_i2 + -1; npc->_i2 = iVar6; pfVar7 = (&fartParams)[1].Color._tint + 2; if (iVar6 != 0) goto LAB_0058af9d; LAB_0058b0b4: puStack_20 = (undefined1 *)pfVar7; npc->_i1 = npc->_i1 + 1; ANM2::Play(&npc->_sprite,(byte *)"SuperBlast",0); npc->_state = 0xc; npc->_stateFrame = 0; pfVar7 = (float *)puStack_20; } } puStack_20 = (undefined1 *)pfVar7; switch(npc->_state) { case 0: npc->_state = 3; uVar5 = Random(); npc->_stateFrame = -0xf - uVar5 % 0xf; uVar5 = Random(); npc->_i1 = 0; npc->_projectileCooldown = 0; (npc->_v1).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0; default: goto switchD_0058b0ec_caseD_1; case 3: fVar13 = (npc->_velocity).x; if (-1.0 <= fVar13) { if (1.0 < fVar13) { (npc->_sprite)._flipX = 0; } } else { (npc->_sprite)._flipX = 1; } if (npc->_stateFrame < 0) { ANM2::Play(&npc->_sprite,s_Idle,0); piVar1 = &npc->_stateFrame; *piVar1 = *piVar1 + 1; if (*piVar1 == 0) { uVar5 = Random(); npc->_stateFrame = uVar5 % 0x3c + 0x1e; } } else if (0 < npc->_stateFrame) { ANM2::Play(&npc->_sprite,s_Walk,0); bVar4 = 1; iVar6 = 900; fVar13 = 0.8; pVVar8 = Entity_NPC::CalcTargetPosition(npc,&local_110,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar8,fVar13,iVar6,bVar4); piVar1 = &npc->_stateFrame; *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { uVar5 = Random(); npc->_stateFrame = -0xf - uVar5 % 0xf; } } fVar13 = (npc->_v1).x; if (0.0 < fVar13) { fVar13 = fVar13 - 0.0333; (npc->_v1).x = fVar13; } if (fVar13 <= 0.0) { Entity_NPC::QueryNPCsType(&queryList,1000,0x8d); local_14 = 0.0; local_130 = Entity_NPC::GetPlayerTarget(npc); if (queryList._size < 5) { iVar6 = 0x14; if (npc->_i1 == 2) { iVar6 = 4; } iVar6 = Isaac::Random(iVar6); if (iVar6 == 0) goto LAB_0058b2c6; LAB_0058b32c: if ((queryList._size < 8) && (uVar5 = Random(), uVar5 % 3 == 0)) { fVar13 = (npc->_pos).x; pVVar8 = &local_130->_pos; bVar12 = fVar13 != pVVar8->x; bVar11 = pVVar8->x <= fVar13; isPlayerLeft = bVar11 && bVar12; if ((NAN(fVar13) || NAN(pVVar8->x)) || (!bVar11 || !bVar12)) { fVar19 = 120.0; } else { fVar19 = -120.0; } fVar17 = 0.0; if ((float)queryList._size != 0.0) { do { iVar6 = *(int *)((int)queryList._data + (int)fVar17 * 4); fVar20 = ((npc->_pos).y + 0.0) - *(float *)(iVar6 + 0x340); fVar18 = (fVar13 + fVar19) - *(float *)(iVar6 + 0x33c); if (fVar20 * fVar20 + fVar18 * fVar18 < 100.0) goto LAB_0058b3fb; fVar17 = (float)((int)fVar17 + 1); } while ((uint)fVar17 < (uint)queryList._size); } npc->_state = 10; ANM2::Play(&npc->_sprite,&DAT_00b1deb4,0); (npc->_sprite)._flipX = isPlayerLeft; } } else { LAB_0058b2c6: if (ABS((local_130->_pos).x - (npc->_pos).x) <= 160.0) goto LAB_0058b32c; npc->_state = 0xb; ANM2::Play(&npc->_sprite,(byte *)"SuperFart",0); fVar13 = (npc->_pos).x; (npc->_sprite)._flipX = (local_130->_pos).x <= fVar13 && fVar13 != (local_130->_pos).x; npc->_stateFrame = 0; } LAB_0058b3fb: if (npc->_state == 3) { npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)"RunStart",0); targetRefSlot = &npc->_entityRef; npc->_stateFrame = 0x5a; if (*targetRefSlot != (EntityPtr)0x0) { local_108 = targetRefSlot; std::multiset::erase(&local_108); } *targetRefSlot = (EntityPtr)0x0; } EntityList_Query::~EntityList_Query(&queryList); } fVar13 = npc->_friction * 0.8; goto LAB_0058d7a9; case 4: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,&DAT_00b62168,0); Entity_NPC::PlaySound(npc,0x39,1.0,2,0,1.0); } scratchPos.y = 0.0; local_130 = (Entity *)0x0; local_154 = (Entity_NPC *)0x0; bestScore = 9999.0; scratchPos.x = 0.0; playerTarget = Entity_NPC::GetPlayerTarget(npc); bestBall = (EntityPtr)0x0; Entity_NPC::QueryNPCsType(&queryList,0x393,1); local_14 = 1.4013e-45; local_108 = (EntityPtr *)0x40800000; local_124 = (float *)0x0; if ((float)queryList._size != 0.0) { do { ball = *(EntityPtr *)((int)queryList._data + (int)local_124 * 4); local_110.x = *(float *)((int)ball + 0x33c); local_110.y = *(float *)((int)ball + 0x340); bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&local_110,0); if (bVar4 != 0) { local_140 = *(float *)((int)ball + 0x33c); local_138 = *(float *)((int)ball + 0x340); fVar13 = local_138 - (playerTarget->_pos).y; fVar19 = local_140 - (playerTarget->_pos).x; fVar17 = sqrtf(fVar13 * fVar13 + fVar19 * fVar19); fVar13 = (npc->_pos).x; fVar19 = (npc->_pos).y; fVar20 = fVar17 * 0.4 * (playerTarget->_velocity).x + (playerTarget->_pos).x; fVar17 = fVar17 * 0.4 * (playerTarget->_velocity).y + (playerTarget->_pos).y; if (0.0 <= (fVar17 - fVar19) * (local_138 - fVar19) + (local_140 - fVar13) * (fVar20 - fVar13)) { kickDirY = fVar17 - local_138; kickDirX = fVar20 - local_140; fVar13 = sqrtf(kickDirY * kickDirY + kickDirX * kickDirX); if (0.0 < fVar13) { kickDirX = kickDirX * (1.0 / fVar13); kickDirY = kickDirY * (1.0 / fVar13); } local_100 = (EntityPtr *)(kickDirY * 50.0); local_118.y = kickDirX * 50.0; standPos.x = local_140 - local_118.y; standPos.y = local_138 - (float)local_100; standCost = 9999.0; iVar10 = (int)((standPos.x - 40.0) / 40.0 + 0.5); iVar6 = (int)((standPos.y - 120.0) / 40.0 + 0.5); if ((((iVar10 < 0) || (room->_gridWidth <= iVar10)) || (iVar6 < 0)) || (room->_gridHeight <= iVar6)) { iVar10 = -1; } else { iVar10 = iVar6 * room->_gridWidth + iVar10; } standY = standPos.y; standX = standPos.x; local_140 = standPos.x; local_138 = standPos.y; uVar5 = Room::GetGridCollision(room,iVar10); if ((uVar5 == 0) && (bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&standPos,0), bVar4 != 0)) { local_104 = (undefined1 *)((npc->_pos).y - local_138); local_134 = (float *)((npc->_pos).x - local_140); local_128 = (Room *)((float)local_104 * (float)local_104 + (float)local_134 * (float)local_134); standCost = sqrtf((float)local_128); fVar13 = sqrtf((float)local_128); if (0.0 < fVar13) { local_134 = (float *)((float)local_134 * (1.0 / fVar13)); local_104 = (undefined1 *)((float)local_104 * (1.0 / fVar13)); } local_128 = (Room *)cos(1.5707964); fVar13 = sin(1.5707964); fVar19 = (float)local_134 * (float)local_128 - (float)local_104 * fVar13; fVar13 = (float)local_104 * (float)local_128 + (float)local_134 * fVar13; if (0.0 < kickDirX * (float)local_134 + kickDirY * (float)local_104) { fVar17 = 50.0; auVar16 = ZEXT416((uint)(fVar13 * kickDirY)); FUN_0058e210(); if (auVar16._0_8_ != 0.0) { standCost = standCost + 100.0; local_128 = (Room *)(fVar19 * fVar17); standPos.x = *(float *)((int)ball + 0x33c) - (float)local_128; local_104 = (undefined1 *)(fVar13 * fVar17); standPos.y = *(float *)((int)ball + 0x340) - (float)local_104; iVar10 = (int)((standPos.x - 40.0) / 40.0 + 0.5); iVar6 = (int)((standPos.y - 120.0) / 40.0 + 0.5); if (((iVar10 < 0) || (room->_gridWidth <= iVar10)) || ((iVar6 < 0 || (room->_gridHeight <= iVar6)))) { iVar10 = -1; } else { iVar10 = iVar6 * room->_gridWidth + iVar10; } standY = standPos.y; standX = standPos.x; uVar5 = Room::GetGridCollision(room,iVar10); if ((uVar5 != 0) || (bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&standPos,0), bVar4 == 0)) { standPos.x = *(float *)((int)ball + 0x33c) + (float)local_128; standPos.y = *(float *)((int)ball + 0x340) + (float)local_104; standY = standPos.y; standX = standPos.x; } iVar10 = (int)((standX - 40.0) / 40.0 + 0.5); iVar6 = (int)((standY - 120.0) / 40.0 + 0.5); if ((((iVar10 < 0) || (room->_gridWidth <= iVar10)) || (iVar6 < 0)) || (room->_gridHeight <= iVar6)) { iVar10 = -1; } else { iVar10 = iVar6 * room->_gridWidth + iVar10; } uVar5 = Room::GetGridCollision(room,iVar10); if ((uVar5 != 0) || (bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&standPos,0), bVar4 == 0)) { standCost = 9999.0; goto LAB_0058bb2c; } } } if (standCost == 9999.0) goto LAB_0058bb2c; } else { LAB_0058bb2c: standPos.x = *(float *)((int)ball + 0x33c) + local_118.y; standPos.y = *(float *)((int)ball + 0x340) + (float)local_100; iVar10 = (int)((standPos.x - 40.0) / 40.0 + 0.5); iVar6 = (int)((standPos.y - 120.0) / 40.0 + 0.5); if (((iVar10 < 0) || (room->_gridWidth <= iVar10)) || ((iVar6 < 0 || (room->_gridHeight <= iVar6)))) { iVar10 = -1; } else { iVar10 = iVar6 * room->_gridWidth + iVar10; } standY = standPos.y; standX = standPos.x; local_140 = standPos.x; local_138 = standPos.y; uVar5 = Room::GetGridCollision(room,iVar10); if ((uVar5 == 0) && (bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&standPos,0), bVar4 != 0) ) { fVar13 = (npc->_pos).y - local_138; fVar19 = (npc->_pos).x - local_140; standCost = sqrtf(fVar13 * fVar13 + fVar19 * fVar19); standCost = standCost + 500.0; } } if (standCost < 9999.0) { fVar19 = sqrtf(*(float *)((int)ball + 0x360) * *(float *)((int)ball + 0x360) + *(float *)((int)ball + 0x364) * *(float *)((int)ball + 0x364)); fVar13 = standCost; if (4.0 < fVar19) { fVar13 = standCost + 500.0; } if (ball == npc->_entityRef) { fVar13 = fVar13 * 0.5; } if (fVar13 < bestScore) { bestBall = ball; local_154 = (Entity_NPC *)local_140; local_130 = (Entity *)local_138; scratchPos.x = standX; scratchPos.y = standY; bestScore = fVar13; } } } } local_124 = (float *)((int)local_124 + 1); } while (local_124 < (uint)queryList._size); if ((bestScore < 9999.0) && (npc->_projectileCooldown < 2)) { fVar13 = ((float)npc->_stateFrame - 40.0) / 50.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } bestScore = bestScore * (fVar13 * 49.0 + 1.0); } } fVar13 = (playerTarget->_pos).y - (npc->_pos).y; fVar19 = (playerTarget->_pos).x - (npc->_pos).x; local_104 = (undefined1 *)sqrtf(fVar13 * fVar13 + fVar19 * fVar19); local_110.x = (playerTarget->_pos).x; local_110.y = (playerTarget->_pos).y; bVar4 = NPCAI_Pathfinder::HasPathToPos(&npc->_pathfinder,&local_110,0); if ((bVar4 == 0) || (1 < npc->_projectileCooldown)) { local_104 = (undefined1 *)0x461c3c00; } if ((float)local_104 + (float)local_104 < bestScore) { fVar13 = (playerTarget->_pos).y; fVar19 = (playerTarget->_pos).x; fVar18 = (npc->_pos).y - fVar13; local_118.x = (playerTarget->_pos).x; fVar20 = (npc->_pos).x - fVar19; local_118.y = (playerTarget->_pos).y; local_124 = (float *)(fVar18 * -0.70710677); local_100 = (EntityPtr *)(fVar20 * -0.70710677); fVar21 = (float)local_100 + (float)local_124; fVar17 = 0.0; if (0.0 < fVar21) { local_118.y = fVar21 * 0.75 * -0.70710677; local_118.x = fVar19 + local_118.y; local_118.y = fVar13 + local_118.y; fVar17 = fVar21; } fVar18 = fVar18 * 0.70710677; fVar21 = fVar18 + (float)local_100; if (fVar17 < fVar21) { local_118.x = fVar19 + fVar21 * 0.75 * -0.70710677; local_118.y = fVar13 + fVar21 * 0.75 * 0.70710677; fVar17 = fVar21; } fVar20 = fVar20 * 0.70710677; fVar18 = fVar20 + fVar18; if (fVar17 < fVar18) { local_118.y = fVar18 * 0.75 * 0.70710677; local_118.x = fVar19 + local_118.y; local_118.y = fVar13 + local_118.y; fVar17 = fVar18; } fVar20 = fVar20 + (float)local_124; if (fVar17 < fVar20) { fVar20 = fVar20 * 0.75; local_118.y = fVar13 + fVar20 * -0.70710677; local_118.x = fVar19 + fVar20 * 0.70710677; } local_110.x = (playerTarget->_pos).x; local_110.y = (playerTarget->_pos).y; Room::CheckLine(room,&local_110,&local_118,1,0,0,0,&local_118); local_154 = (Entity_NPC *)(playerTarget->_pos).x; local_130 = (Entity *)(playerTarget->_pos).y; scratchPos.x = local_118.x; scratchPos.y = local_118.y; bestBall = (EntityPtr)0x0; } targetRefSlot = &npc->_entityRef; if (bestBall == npc->_entityRef) { if (bestBall == (EntityPtr)0x0) goto LAB_0058c191; LAB_0058c0e6: fVar13 = 2.1; } else { if (npc->_entityRef == (EntityPtr)0x0) { if (npc->_stateFrame < 0x28) { npc->_stateFrame = 0x28; } } else { local_100 = targetRefSlot; std::multiset::erase(&local_100); } *targetRefSlot = bestBall; if (bestBall != (EntityPtr)0x0) { std::multiset::insert(targetRefSlot); goto LAB_0058c0e6; } LAB_0058c191: if (100.0 < (float)local_104) goto LAB_0058c0e6; fVar13 = ((float)local_104 - 40.0) / 60.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } fVar13 = fVar13 * 0.6999999 + 1.4; } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&scratchPos,fVar13,900,1); chosenBall = bestBall; iVar6 = npc->_stateFrame + -1; npc->_stateFrame = iVar6; if (iVar6 < 1) { LAB_0058c1e1: pEVar9 = playerTarget; if (chosenBall == (EntityPtr)0x0) { local_104 = (undefined1 *)(playerTarget->_pos).x; local_134 = (float *)(playerTarget->_pos).y; fVar19 = (npc->_pos).x - (float)local_104; fVar13 = (npc->_pos).y - (float)local_134; fVar13 = sqrtf(fVar13 * fVar13 + fVar19 * fVar19); local_104 = (undefined1 *) ((((float)local_104 + fVar13 * 0.1 * (pEVar9->_velocity).x) - (npc->_pos).x) * 0.1); local_134 = (float *)((((float)local_134 + fVar13 * 0.1 * (pEVar9->_velocity).y) - (npc->_pos).y) * 0.1); (npc->_targetPosition).x = (float)local_104; (npc->_targetPosition).y = (float)local_134; fVar13 = (float)local_134 * (float)local_134 + (float)local_104 * (float)local_104; if ((100.0 < fVar13) && (fVar13 = sqrtf(fVar13), 0.0 < fVar13)) { (npc->_targetPosition).x = (float)local_104 * (10.0 / fVar13); (npc->_targetPosition).y = (float)local_134 * (10.0 / fVar13); } npc->_state = 9; anim = "JumpBlast"; } else { (npc->_targetPosition).x = (float)local_154; (npc->_targetPosition).y = (float)local_130; npc->_state = 8; anim = "Blast"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); } else if (iVar6 < 0x3c) { if (bestBall == (EntityPtr)0x0) { local_108 = (EntityPtr *)0x42480000; } fVar13 = (npc->_pos).y - (float)local_130; fVar19 = (npc->_pos).x - (float)local_154; fVar13 = sqrtf(fVar13 * fVar13 + fVar19 * fVar19); if (fVar13 < (float)local_108) goto LAB_0058c1e1; } if (queryList._0_1_ == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,queryList._data,0); } fVar13 = (npc->_velocity).x; npc->_friction = npc->_friction * 0.8; if (-1.0 <= fVar13) { if (1.0 < fVar13) { (npc->_sprite)._flipX = 0; } } else { (npc->_sprite)._flipX = 1; } goto switchD_0058b0ec_caseD_1; case 8: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { fVar13 = (npc->_pos).x; pVVar8 = &npc->_targetPosition; fVar17 = pVVar8->x - fVar13; fVar19 = (npc->_targetPosition).y - (npc->_pos).y; if (5.0 < fVar19 * fVar19 + fVar17 * fVar17) { pVVar8->x = fVar13; (npc->_targetPosition).y = (npc->_pos).y; } NpcHelper::singe_explode_at(pVVar8); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x45,1.0,2,0,1.0); } LAB_0058c456: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_0058c469; break; case 9: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar4 != 0) { (npc->_velocity).x = (npc->_targetPosition).x; (npc->_velocity).y = (npc->_targetPosition).y; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } bVar4 = ANM2::WasEventTriggered(&npc->_sprite,s_Jump); if ((bVar4 == 0) || (bVar4 = ANM2::WasEventTriggered(&npc->_sprite,s_Land), bVar4 != 0)) { npc->_friction = npc->_friction * 0.6; } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Jump); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x26,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x45,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { NpcHelper::singe_explode_at(&npc->_pos); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; uVar5 = Random(); npc->_stateFrame = -0xf - uVar5 % 0xf; uVar5 = Random(); (npc->_v1).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0; } goto switchD_0058b0ec_caseD_1; case 10: bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); local_124 = (float *)&DAT_bf800000; if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x25,1.0,2,0,1.0); if ((npc->_sprite)._flipX == 0) { local_104 = (undefined1 *)0x3f800000; } else { local_104 = &DAT_bf800000; } iVar6 = 2; local_108 = (EntityPtr *)((float)local_104 * 10.0); do { uVar5 = Random(); local_100 = (EntityPtr *) (((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292); local_118.y = cos((float)local_100); fVar13 = sin((float)local_100); local_100 = (EntityPtr *)((float)local_104 * local_118.y - fVar13 * 0.0); local_118.y = (float)local_104 * fVar13 + local_118.y * 0.0; uVar5 = Random(); local_110.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 10.0; local_110.y = local_118.y * local_110.x; local_110.x = local_110.x * (float)local_100; uVar5 = Random(); scratchPos.x = (float)local_108 + (npc->_pos).x; scratchPos.y = (npc->_pos).y + 0.0; pEVar9 = Game::Spawn(g_game,1000,0x8d,&scratchPos,&local_110,(Entity *)npc,1,uVar5); iVar10 = *(int *)pEVar9; pAVar2 = &pEVar9[1]._sprite; (pAVar2->_filename)._buf[8] = -1; (pAVar2->_filename)._buf[9] = -1; (pAVar2->_filename)._buf[10] = -1; (pAVar2->_filename)._buf[0xb] = -1; pAVar2 = &pEVar9[1]._sprite; (pAVar2->_filename)._buf[0xc] = -1; (pAVar2->_filename)._buf[0xd] = -1; (pAVar2->_filename)._buf[0xe] = -1; (pAVar2->_filename)._buf[0xf] = -1; (**(code **)(iVar10 + 0xc))(); iVar6 = iVar6 + -1; } while (iVar6 != 0); local_110.y = (npc->_pos).y + 0.0; local_110.x = (float)local_104 * 40.0 + (npc->_pos).x; EntityList::QueryRadius(&local_128->_entityList,&queryList,&local_110,60.0,0xffffffff); fVar13 = 0.0; if ((float)queryList._size != 0.0) { do { pushedEntity = *(Entity_NPC **)((int)queryList._data + (int)fVar13 * 4); if (pushedEntity != npc) { (pushedEntity->_velocity).x = (pushedEntity->_velocity).x + (float)local_108; (pushedEntity->_velocity).y = (pushedEntity->_velocity).y + 0.0; } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)queryList._size); } if (queryList._0_1_ == '\0') { local_14 = 4.2039e-45; tracked_alloc(1,queryList._data,0); local_14 = -NAN; } } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if ((bVar4 != 0) && (((npc->_sprite)._animState._animData == (void *)0x0 || (bVar4 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,s_Land), bVar4 == 0) ))) { if ((npc->_sprite)._flipX == 0) { local_124 = (float *)0x3f800000; } uVar5 = Random(); randomValue = Random(); local_100 = (EntityPtr *) (((float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292); local_118.y = cos((float)local_100); local_100 = (EntityPtr *)sin((float)local_100); randomValue = Random(); local_110.y = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 20.0 + 6.0; scratchPos.x = (float)local_124 * 4.0 + (npc->_pos).x; local_110.x = ((float)local_124 * local_118.y - (float)local_100 * 0.0) * local_110.y; local_110.y = ((float)local_124 * (float)local_100 + local_118.y * 0.0) * local_110.y; scratchPos.y = (npc->_pos).y + 0.0; pEVar9 = Game::Spawn(g_game,1000,99,&scratchPos,&local_110,(Entity *)0x0,1,uVar5); uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 1.0; fVar13 = (pEVar9->_sprite)._scale.x; (pEVar9->_sprite)._scale.y = fVar19 * (pEVar9->_sprite)._scale.y; (pEVar9->_sprite)._scale.x = fVar19 * fVar13; color = (ColorMod *)::Color::Color(0x3f800000); Sprite::SetColor((Sprite *)&pEVar9->_sprite,color); (**(code **)(*(int *)pEVar9 + 0xc))(); } goto LAB_0058c456; } LAB_0058c469: npc->_state = 3; uVar5 = Random(); npc->_stateFrame = -0xf - uVar5 % 0xf; uVar5 = Random(); (npc->_v1).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0; break; case 0xb: pAVar2 = &npc->_sprite; if (npc->_stateFrame == 0) { bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar2,"Sound"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x1ea,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x1e9,1.0,0x96,0,1.0); SoundEffects::PlayWithFartOverride(0x1e3,1.0,2,0,1.0); bVar4 = (npc->_sprite)._flipX; npc->_stateFrame = 0x78; if (bVar4 == 0) { (npc->_v1).y = 0.0; } else { (npc->_v1).y = 180.0; } } } else if (npc->_stateFrame < 1) { bVar4 = ANM2::IsFinishedImpl(pAVar2,&s_empty); if (bVar4 != 0) goto LAB_0058c469; } else { bVar4 = ANM2::IsFinishedImpl(pAVar2,&s_empty); if (bVar4 != 0) { ANM2::Play(&npc->_sprite,(byte *)"SuperFartLoop",0); } pEVar9 = Entity_NPC::GetPlayerTarget(npc); fVar13 = atan2f((pEVar9->_pos).y - (npc->_pos).y,(pEVar9->_pos).x - (npc->_pos).x); fVar13 = approach_angle((npc->_v1).y,fVar13 * 57.295776,2.5); bVar4 = (npc->_sprite)._flipX; (npc->_v1).y = fVar13; if (bVar4 == 0) { local_100 = (EntityPtr *)0xc2820000; auVar15 = ZEXT812(0x42820000); pfVar7 = (float *)&local_100; if (-65.0 <= fVar13) { pfVar7 = &(npc->_v1).y; } fVar13 = *pfVar7; LAB_0058cd01: bVar12 = fVar13 == auVar15._0_4_; bVar11 = fVar13 < auVar15._0_4_; } else { if (fVar13 <= 0.0) { auVar15 = ZEXT812(0xc2e60000); goto LAB_0058cd01; } auVar15 = ZEXT812(0x42e60000); bVar12 = auVar15._0_4_ == fVar13; bVar11 = auVar15._0_4_ < fVar13; } if (bVar11 || bVar12) { auVar15._4_8_ = auVar15._4_8_; auVar15._0_4_ = fVar13; } (npc->_v1).y = auVar15._0_4_; local_100 = (EntityPtr *)(auVar15._0_4_ * 0.017453292); local_108 = (EntityPtr *)cos((float)local_100); local_124 = (float *)sin((float)local_100); bVar4 = Entity::IsFrame((Entity *)npc,2,0); if ((bVar4 != 0) && (uVar5 = Random(), uVar5 % 3 != 0)) { ProjectileParams::ProjectileParams(&fartParams); fartParams.Variant = 2; fartParams.BulletFlags._0_4_ = 0x80; fartParams.BulletFlags._4_4_ = 0; uVar5 = Random(); fartParams.FallingAccelModifier = -0.05; fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fartParams.FallingSpeedModifier = ((fVar13 + fVar13) - 1.0) + fartParams.FallingSpeedModifier; local_100 = (EntityPtr *)sin((float)(0x5a - npc->_stateFrame) * 0.1); uVar5 = Random(); local_100 = (EntityPtr *) (((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 16.0 + ((float)local_100 * 10.0 - 8.0)) * 0.017453292); local_118.y = cos((float)local_100); local_100 = (EntityPtr *)sin((float)local_100); uVar5 = Random(); fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_110.y = fVar13 + fVar13 + 8.0; scratchPos.x = (float)local_108 * 4.0 + (npc->_pos).x; local_110.x = (local_118.y * (float)local_108 - (float)local_100 * (float)local_124) * local_110.y; local_110.y = (local_118.y * (float)local_124 + (float)local_100 * (float)local_108) * local_110.y; scratchPos.y = (float)local_124 * 4.0 + (npc->_pos).y; Entity_NPC::FireProjectiles(npc,&scratchPos,&local_110,0,&fartParams); SoundEffects::PlayWithFartOverride(0x1d7,1.0,2,0,1.0); Game::ShakeScreen(g_game,2); } fVar13 = npc->_speedMultiplier; (npc->_velocity).x = (-(float)local_108 + -(float)local_108) * fVar13 + (npc->_velocity).x; (npc->_velocity).y = (-(float)local_124 + -(float)local_124) * fVar13 + (npc->_velocity).y; piVar1 = &npc->_stateFrame; *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { ANM2::Play(&npc->_sprite,(byte *)"SuperFartEnd",0); npc->_stateFrame = -1; } } break; case 0xc: if (npc->_stateFrame < 0) { bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,s_Land); if (bVar4 != 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 5; SoundEffects::PlayWithFartOverride(0x45,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0x45,1.0,2,0,1.0); } bVar4 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar4 != 0) { npc->_state = 3; uVar5 = Random(); npc->_stateFrame = -0xf - uVar5 % 0xf; uVar5 = Random(); (npc->_v1).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0; } } else { bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 == 0) { if (0 < npc->_stateFrame) { iVar6 = npc->_stateFrame + -1; npc->_stateFrame = iVar6; if (iVar6 == 0xf) { local_108 = (EntityPtr *)0x0; do { iVar6 = Room::GetGridCollisionAtPos(room,npc->_pos); if (iVar6 == 0) break; pEVar9 = Entity_NPC::GetPlayerTarget(npc); local_100 = (EntityPtr *)(pEVar9->_pos).x; local_128 = (Room *)(pEVar9->_pos).y; uVar5 = Random(); local_118.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_118.y = local_118.y + local_118.y; fVar13 = cos(local_118.y); local_110.x = fVar13 * 90.0 + (float)local_100; fVar13 = sin(local_118.y); local_110.y = fVar13 * 90.0 + (float)local_128; pVVar8 = Room::FindFreePickupSpawnPosition(room,&scratchPos,&local_110,0.0,0,0,0); (npc->_pos).x = pVVar8->x; (npc->_pos).y = pVVar8->y; local_108 = (EntityPtr *)&local_108->field_0x1; } while ((int)local_108 < 10); uVar5 = Random(); pVVar8 = MusicManager::RandomVector(&scratchPos); local_110.x = pVVar8->x * 15.0 + (npc->_pos).x; local_110.y = pVVar8->y * 15.0 + (npc->_pos).y; pEVar9 = Game::Spawn(g_game,0x393,1,&local_110,&g_vectorZero,(Entity *)npc,0,uVar5); flagsHigh = *(undefined4 *)((int)&pEVar9->_flags + 4); iVar6 = *(int *)pEVar9; *(uint *)&pEVar9->_flags = (uint)pEVar9->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar9->_flags + 4) = flagsHigh; (**(code **)(iVar6 + 0xc))(); iVar6 = *(int *)pEVar9; pEVar9[2]._updateTime = -500.0; pEVar9[2]._speedMultiplier = 10.0; (**(code **)(iVar6 + 0xc))(); iVar6 = npc->_stateFrame; } if (iVar6 == 0) { npc->_stateFrame = -1; ANM2::Play(&npc->_sprite,(byte *)"SuperBlastLand",0); } } } else { ::Color::Color(&explosionColor); Game::BombExplosionEffects (g_game,&npc->_pos,100.0,(BitSet128)ZEXT816(0),Color,(Entity *)npc,1.25,1,4,0); Game::ButterBeanFart(g_game,&npc->_pos,120.0,(Entity *)npc,0,0); Game::ShakeScreen(g_game,0x10); cVar3 = Room::CanSpawnObstacleAtPos(&npc->_pos,0); if (cVar3 != '\0') { local_108 = (EntityPtr *)Room::GetGridIndex(room,&npc->_pos); iVar6 = 0; uVar5 = Random(); Room::SpawnGridEntity(room,(int)local_108,7,0,uVar5,iVar6); if (((local_108 < (EntityPtr *)0x1c0) && (piVar1 = room->_gridEntities[(int)local_108], piVar1 != (int *)0x0)) && (piVar1[1] == 7)) { (**(code **)(*piVar1 + 4))(); } } renderTimer = Entity_Effect::CreateTimer(Entity_NPC::Render,2,1,0); (renderTimer->_pos).x = (npc->_pos).x; (renderTimer->_pos).y = (npc->_pos).y; Entity::SetParent((Entity *)renderTimer,(Entity *)npc); npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_stateFrame = 0x3b; } } local_134 = ANM2::GetLayerFrame(&npc->_sprite,3); if ((local_134 != (float *)0x0) && (*(char *)(local_134 + 3) != '\0')) { local_118.y = ((npc->_sprite)._offset.x + *local_134) * (npc->_sprite)._scale.x; local_128 = (Room *)(((npc->_sprite)._offset.y + local_134[1]) * (npc->_sprite)._scale.y); local_100 = (EntityPtr *)((npc->_sprite)._rotation * 0.017453292); local_124 = local_134; local_104 = (undefined1 *)cos((float)local_100); fVar13 = sin((float)local_100); fVar19 = (float)local_104 * (float)local_128 + fVar13 * local_118.y; local_118.y = (float)local_104 * local_118.y - fVar13 * (float)local_128; if ((npc->_sprite)._flipX != 0) { local_118.y = local_118.y * -1.0; } if ((npc->_sprite)._flipY != 0) { fVar19 = fVar19 * -1.0; } local_118.y = local_118.y / 0.65; local_104 = (undefined1 *)(fVar19 / 0.65); local_108 = (EntityPtr *)(1 - (int)((local_134[5] * local_134[4]) / -100.0)); if (0 < (int)local_108) { local_128 = (Room *)&npc->_pos; local_110.x = 0.0; bVar12 = local_118.y < 0.0; local_134 = local_134 + 6; local_100 = (EntityPtr *)(uint)bVar12; do { uVar5 = Random(); fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_100 = (EntityPtr *)(fVar13 + fVar13); fVar13 = cos((float)local_100); pfVar7 = local_124; local_130 = (Entity *)(fVar13 * local_124[4] * 3.0 + local_118.y); fVar13 = sin((float)local_100); local_100 = (EntityPtr *)(fVar13 * pfVar7[5] * 3.0 + (float)local_104); uVar5 = Random(); randomValue = Random(); local_110.y = -3.0 - (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 5.0; pEVar9 = Game::Spawn(g_game,1000,0x3b,(Vector *)local_128,&local_110,(Entity *)0x0,0,uVar5 ); uVar5 = Random(); if (((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)(int)(uint)bVar12 == 0.0) { puVar14 = (undefined1 *)0x3f800000; } else { puVar14 = &DAT_bf800000; } *(undefined1 **)(pEVar9[1]._sprite._animDefaultName._buf + 8) = puVar14; uVar5 = Random(); iVar6 = *(int *)pEVar9; iVar10 = uVar5 % 10 + 0x1e; *(int *)(pEVar9[1]._sprite._filename._buf + 8) = iVar10; *(int *)(pEVar9[1]._sprite._filename._buf + 0xc) = iVar10; (**(code **)(iVar6 + 0x3c))(local_134,0xffffffff,0xff,0,1); iVar6 = *(int *)pEVar9; (pEVar9->_posOffset).x = (float)local_130; (pEVar9->_posOffset).y = (float)local_100; pEVar9->_renderDepthOffset = 50.0; (**(code **)(iVar6 + 0xc))(); local_108 = (EntityPtr *)&local_108[-1].field_0x3; } while (local_108 != (EntityPtr *)0x0); npc = local_154; } } } fVar13 = npc->_friction * 0.6; LAB_0058d7a9: npc->_friction = fVar13; switchD_0058b0ec_caseD_1: fVar13 = 0.0; if (0.0 < npc->_pendingDamage) { npc->_pendingDamage = 0.0; pfVar7 = (npc->_damageEvents)._begin; if (pfVar7 != (npc->_damageEvents)._end) { do { if ((((((uint)pfVar7[2] & 4) != 0) && (((uint)pfVar7[0xc] >> 1 & 1) == 0)) && (pfVar7[4] != 1.4013e-45)) && (((pfVar7[6] != 1.4013e-45 && (pfVar7[6] != 4.2039e-45)) && (((uint)pfVar7[2] & 0x1000) == 0)))) { *pfVar7 = 0.0; } fVar13 = npc->_pendingDamage + *pfVar7; pfVar7 = pfVar7 + 0xe; npc->_pendingDamage = fVar13; } while (pfVar7 != (npc->_damageEvents)._end); } (npc->_v1).x = (npc->_v1).x - fVar13 * 0.5; } ExceptionList = local_1c; return; } //@@ 0058d8b0 NpcAI::ENTITY_SINGE_ball /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: npc_ai.tsv names trinketOwner ENTITY_SINGE but it is the ball (singe_ball.png, RollHori) */ void __fastcall NpcAI::ENTITY_SINGE_ball(Entity_NPC *npc) { float *pfVar1; undefined4 uVar2; code *pcVar3; byte bVar4; uint uVar5; Entity_Player *trinketOwner; int iVar6; byte extraout_CL; byte extraout_CL_00; byte *strCursor; int gridY; char *pcVar7; undefined1 *puVar8; void *pvVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; double dVar15; Room *local_50; undefined1 local_4c [28]; ulonglong local_30; undefined1 *sheetPathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *damageEventsEnd; Game *game; Manager *manager; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af556d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; local_50 = g_game->_room; game = g_game; puVar8 = local_4c + 0x48; if (npc->_state == 0) { uVar2 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x50011; uVar5 = npc->_initSeed; *(undefined4 *)((int)&npc->_flags + 4) = uVar2; npc->_isInvicible = 1; local_30 = 0x500000002; if (uVar5 == 0) { puStack_20 = local_4c + 0x48; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar5 = uVar5 >> 2 ^ uVar5; (npc->_v1).y = 0.0; uVar5 = uVar5 << 5 ^ uVar5; (npc->_v2).y = 0.0; uVar5 = uVar5 >> 0xf ^ uVar5; npc->_i1 = 0; npc->_i2 = 0; (npc->_v1).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10; bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)"RollVert",1); if (((bVar4 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } pvVar9 = (npc->_sprite)._animState._animData; if (pvVar9 != (void *)0x0) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)((float)*(int *)((int)pvVar9 + 0x30) * (npc->_v1).x)); } game = g_game; npc->_state = 3; puVar8 = puStack_20; } puStack_20 = puVar8; trinketOwner = PlayerManager::FirstTrinketOwner(&game->_playerManager,0x97); if ((trinketOwner != (Entity_Player *)0x0) && (iVar6 = Entity_Player::GetTrinketMultiplier(trinketOwner,0x97), 1 < iVar6 != (npc->_i2 != 0))) { iVar6 = Entity_Player::GetTrinketMultiplier(trinketOwner,0x97); local_30 = local_30 & 0xffffffff; pcVar7 = "gfx/Bosses/repentance/singe_ball_retracted.png"; sheetPathCapacity = &DAT_0000000f; local_4c._16_4_ = (void *)0x0; npc->_i2 = (uint)(1 < iVar6); if (iVar6 < 2) { pcVar7 = "gfx/Bosses/repentance/singe_ball.png"; } strCursor = (byte *)pcVar7; do { bVar4 = *strCursor; strCursor = strCursor + 1; } while (bVar4 != 0); std::string::assign(local_4c + 0x10,(byte *)pcVar7,(int)strCursor - (int)(pcVar7 + 1)); local_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)&npc->_sprite,0,(std_string *)(local_4c + 0x10)); local_14 = 0xffffffff; bVar4 = extraout_CL; if (&DAT_0000000f < sheetPathCapacity) { puVar8 = sheetPathCapacity + 1; pvVar9 = (void *)local_4c._16_4_; if ((undefined1 *)0xfff < puVar8) { pvVar9 = *(void **)(local_4c._16_4_ + -4); puVar8 = sheetPathCapacity + 0x24; if (0x1f < (uint)(local_4c._16_4_ + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,(uint)puVar8); bVar4 = extraout_CL_00; } ANM2::LoadGraphics(&npc->_sprite,bVar4); if (npc->_i2 == 0) { fVar10 = 1.0; } else { fVar10 = 0.0; } npc->_collisionDamage = fVar10; } if ((((npc->_subtype == 0) && (iVar6 = Entity_NPC::GetAliveEnemyCount(npc), iVar6 < 1)) && ((*(char *)((int)g_game->_room + 0x7229) == '\0' || (*(int *)((int)g_game->_room + 0x11ec) < 9)))) && (npc->_dead == 0)) { EntityRef::EntityRef((EntityRef *)local_4c); (**(code **)(*(int *)npc + 0x24))(); } if (npc->_entityGridCollisionClass == 7) { npc->_entityCollisionClass = 0; } else { fVar10 = (npc->_v2).y; iVar6 = 0; if (-50.0 < fVar10) { iVar6 = 4; } npc->_entityCollisionClass = iVar6; if ((fVar10 <= -1.0) || (iVar6 = 5, (npc->_v1).y < 0.0)) { iVar6 = 6; } npc->_entityGridCollisionClass = iVar6; } if ((npc->_pendingDamageFlags & 4) != 0) { damageEventsEnd = (npc->_damageEvents)._end; for (pvVar9 = (npc->_damageEvents)._begin; pvVar9 != damageEventsEnd; pvVar9 = (void *)((int)pvVar9 + 0x38)) { if (((*(uint *)((int)pvVar9 + 8) & 4) != 0) && ((*(float *)((int)pvVar9 + 0x20) != g_vectorZero.x || (*(float *)((int)pvVar9 + 0x24) != g_vectorZero.y)))) { fVar11 = (npc->_pos).x - *(float *)((int)pvVar9 + 0x20); fVar13 = (npc->_pos).y - *(float *)((int)pvVar9 + 0x24); fVar10 = sqrtf(fVar11 * fVar11 + fVar13 * fVar13); if (0.0 < fVar10) { fVar13 = fVar13 * (1.0 / fVar10); fVar11 = fVar11 * (1.0 / fVar10); } fVar10 = (npc->_velocity).x; fVar12 = ((fVar13 * (npc->_velocity).y + fVar10 * fVar11) - -20.0) / 40.0; if (fVar12 <= 0.0) { fVar12 = 0.0; } if (1.0 <= fVar12) { fVar12 = 1.0; } fVar14 = 2.0 - (fVar12 + fVar12); fVar12 = npc->_speedMultiplier; (npc->_velocity).y = fVar14 * fVar13 * 20.0 * fVar12 + (npc->_velocity).y; (npc->_velocity).x = fVar14 * fVar11 * 20.0 * fVar12 + fVar10; if ((0.0 <= (npc->_v2).y) && (0.0 <= (npc->_v1).y)) { (npc->_v1).y = -6.0; } } } } fVar10 = (npc->_v2).y; if (((fVar10 < 0.0) || (pfVar1 = &(npc->_v1).y, *pfVar1 <= 0.0 && *pfVar1 != 0.0)) || (npc->_entityGridCollisionClass == 7)) { iVar6 = npc->_entityGridCollisionClass; fVar11 = (npc->_v1).y; fVar13 = npc->_speedMultiplier * 0.8 + fVar11; fVar10 = fVar10 + npc->_speedMultiplier * fVar11; (npc->_v1).y = fVar13; (npc->_v2).y = fVar10; if (iVar6 == 7) { if (10.0 < fVar10) { uVar5 = Random(); Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)npc + 0x28))(); ExceptionList = local_1c; return; } } else if (0.0 < fVar10) { iVar6 = (int)((((npc->_velocity).x + (npc->_pos).x) - 40.0) / 40.0 + 0.5); gridY = (int)((((npc->_pos).y + (npc->_velocity).y) - 120.0) / 40.0 + 0.5); if (((iVar6 < 0) || (local_50->_gridWidth <= iVar6)) || ((gridY < 0 || (local_50->_gridHeight <= gridY)))) { iVar6 = -1; } else { iVar6 = local_50->_gridWidth * gridY + iVar6; } uVar5 = Room::GetGridCollision(local_50,iVar6); if (uVar5 == 1) { npc->_entityGridCollisionClass = 7; } else { (npc->_v2).y = 0.0; fVar10 = 0.0; if (0.0 < fVar13) { if (fVar13 <= 4.0) { (npc->_v1).y = 0.0; } else { uVar5 = Random(); manager = g_manager; local_50 = (Room *)0x1e7; dVar15 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; fVar10 = (npc->_v1).y; seed_fart_sound_override((int *)&local_50); fVar10 = fVar10 * 0.1 + 0.2; if (1.2 <= fVar10) { fVar10 = 1.2; } SoundEffects::Play(&manager->_sfxManager,(int)local_50,fVar10,2,0, (float)((double)(int)uVar5 + dVar15) * 2.3283064e-10 * 0.2 + 0.9,0.0) ; fVar10 = (npc->_v2).y; (npc->_v1).y = (npc->_v1).y * -0.35; } } } } } fVar11 = (npc->_velocity).x; (npc->_posOffset).y = fVar10; fVar10 = (npc->_velocity).y; local_50 = (Room *)(fVar11 * fVar11 + fVar10 * fVar10); if ((4.0 < (float)local_50) && (uVar5 = (uint)(ABS(fVar10) < ABS(fVar11)), uVar5 != npc->_i1)) { npc->_i1 = uVar5; pcVar7 = "RollHori"; if (uVar5 != 1) { pcVar7 = "RollVert"; } bVar4 = ANM2::SetAnimation(&npc->_sprite,(byte *)pcVar7,1); if (((bVar4 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } pvVar9 = (npc->_sprite)._animState._animData; if (pvVar9 != (void *)0x0) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState, (float)(int)((float)*(int *)((int)pvVar9 + 0x30) * (npc->_v1).x)); } } fVar10 = (npc->_v1).y; fVar11 = sqrtf(fVar10 * fVar10 + (float)local_50); fVar10 = fVar11 * 0.02; if (npc->_i1 == 1) { fVar13 = (npc->_velocity).x; } else { fVar13 = (npc->_velocity).y; } if (fVar13 < 0.0) { fVar10 = -fVar10; } fVar10 = fVar10 + (npc->_v1).x; fVar11 = (fVar11 - 0.5) / 3.5; if (fVar11 <= 0.0) { fVar11 = 0.0; } (npc->_v1).x = fVar10; if (1.0 <= fVar11) { fVar11 = 1.0; } npc->_friction = (fVar11 * 0.29000002 + 0.7) * npc->_friction; while (fVar10 < 0.0) { fVar10 = (npc->_v1).x + 1.0; (npc->_v1).x = fVar10; } while (1.0 <= fVar10) { fVar10 = (npc->_v1).x - 1.0; (npc->_v1).x = fVar10; } pvVar9 = (npc->_sprite)._animState._animData; if (pvVar9 == (void *)0x0) { iVar6 = -1; fVar10 = fVar10 * 0.0; } else { dVar15 = floor((double)(npc->_sprite)._animState._animFrame); local_50 = (Room *)(float)dVar15; fVar10 = (float)*(int *)((int)pvVar9 + 0x30) * fVar10; iVar6 = (int)dVar15; } if (((int)fVar10 != iVar6) && (pvVar9 != (void *)0x0)) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)fVar10); } ExceptionList = local_1c; return; } //@@ 0058e210 FUN_0058e210 undefined1 FUN_0058e210(void) { undefined1 in_CL; return in_CL; } //@@ 0058e230 Entity_Player::StopExtraAnimation /* ZHL [lua] Lua binding EntityPlayer:StopExtraAnimation */ void __thiscall Entity_Player::StopExtraAnimation(Entity_Player *this) { this->_isPlayingExtraAnimation = 0; this->_isPlayingItemAnimation = 0; return; } //@@ 0058e240 FUN_0058e240 void FUN_0058e240(uint param_1) { Vector *in_ECX; Vector *in_EDX; Isaac::GetRandomPickupVelocity(in_ECX,in_EDX,param_1,(RNG *)0x0); return; } //@@ 0058e260 NpcHelper::siren_charm_familiar /* DB: ? ECX=npc (Siren), param_1=familiar: unless the familiar is flagged 0x100, spawns effect 1000.0xa5 at it (timeouts +0x45c/+0x460 = 75) linked to the siren (spawner) and the familiar (+0x3c4 target), reads siren +0xf40; from NpcAI::ENTITY_SIREN_main */ void NpcHelper::siren_charm_familiar(EntityPtr param_1) { EntityPtr EVar1; EntityPtr EVar2; ANM2 *pAVar3; uint uVar4; Entity *pEVar5; EntityPtr in_ECX; EntityPtr *pEVar6; Vector local_1c; Vector local_14; EntityPtr *local_c [2]; EVar2 = param_1; if ((*(uint *)((int)param_1 + 0x168) & 0x100) == 0) { uVar4 = Random(); local_14.x = *(float *)((int)EVar2 + 0x360); local_14.y = *(float *)((int)EVar2 + 0x364); local_1c.x = *(float *)((int)EVar2 + 0x33c); local_1c.y = *(float *)((int)EVar2 + 0x340); param_1 = (EntityPtr)Game::Spawn(g_game,1000,0xa5,&local_1c,&local_14,(Entity *)in_ECX,0,uVar4); EVar1 = ((Entity *)param_1)->_parent; pAVar3 = &((Entity *)((int)param_1 + 0x40c))->_sprite; (pAVar3->_filename)._buf[8] = 'K'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pEVar6 = &((Entity *)param_1)->_parent; pAVar3 = &((Entity *)((int)param_1 + 0x40c))->_sprite; (pAVar3->_filename)._buf[0xc] = 'K'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; if (EVar1 != (EntityPtr)0x0) { local_c[0] = pEVar6; std::multiset::erase(local_c); } *pEVar6 = in_ECX; if (in_ECX != (EntityPtr)0x0) { std::multiset::insert(pEVar6); } pEVar6 = &((Entity *)param_1)->_target; if (*pEVar6 != (EntityPtr)0x0) { local_c[0] = pEVar6; std::multiset::erase(local_c); } *pEVar6 = EVar2; std::multiset::insert(pEVar6); local_14.y = *(float *)((int)in_ECX + 0xf40); pEVar6 = &((Entity *)param_1)->_child; if (*pEVar6 != (EntityPtr)0x0) { local_c[0] = pEVar6; std::multiset::erase(local_c); } *pEVar6 = (EntityPtr)local_14.y; if ((EntityPtr)local_14.y != (EntityPtr)0x0) { std::multiset::insert(pEVar6); } (**(code **)(*(int *)param_1 + 0xc))(); uVar4 = Random(); local_1c.x = *(float *)((int)EVar2 + 0x360); local_1c.y = *(float *)((int)EVar2 + 0x364); local_14.x = *(float *)((int)EVar2 + 0x33c); local_14.y = *(float *)((int)EVar2 + 0x340); pEVar5 = Game::Spawn(g_game,1000,0xa5,&local_14,&local_1c,(Entity *)in_ECX,1,uVar4); EVar1 = pEVar5->_parent; pAVar3 = &pEVar5[1]._sprite; (pAVar3->_filename)._buf[8] = 'K'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &pEVar5[1]._sprite; (pAVar3->_filename)._buf[0xc] = 'K'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; if (EVar1 != (EntityPtr)0x0) { param_1 = (EntityPtr)&pEVar5->_parent; std::multiset::erase(¶m_1); } pEVar5->_parent = in_ECX; std::multiset::insert(&pEVar5->_parent); if (pEVar5->_target != (EntityPtr)0x0) { param_1 = (EntityPtr)&pEVar5->_target; std::multiset::erase(¶m_1); } pEVar5->_target = EVar2; std::multiset::insert(&pEVar5->_target); EVar2 = *(EntityPtr *)((int)in_ECX + 0xf40); pEVar6 = &pEVar5->_child; if (*pEVar6 != (EntityPtr)0x0) { param_1 = (EntityPtr)pEVar6; std::multiset::erase(¶m_1); } *pEVar6 = EVar2; if (EVar2 != (EntityPtr)0x0) { std::multiset::insert(pEVar6); } (**(code **)(*(int *)pEVar5 + 0xc))(); } return; } //@@ 0058e490 NpcHelper::siren_familiar_counts /* DB: counts Isaac's charmable familiars: free, charmed (flag 0x100), total (boss_approx_2) */ void NpcHelper::siren_familiar_counts(int *param_1,int *param_2,int *param_3) { int iVar1; qword qVar2; Game *pGVar3; char cVar4; uint uVar5; void *pvVar6; int extraout_ECX; uint uVar7; uint extraout_EDX; qword *pqVar8; EntityList_EL local_24; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; pGVar3 = g_game; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1690; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *param_1 = 0; *param_2 = 0; *param_3 = 0; EntityList::QuerySublist((EntityList *)((int)pGVar3->_room + 0x1218),&local_24,3,-1,-1,0,0); uVar7 = 0; if (local_24._size != 0) { pvVar6 = local_24._data; do { iVar1 = *(int *)((int)pvVar6 + uVar7 * 4); if ((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 3)) { cVar4 = FUN_0060dae0(uVar5); if (cVar4 != '\0') { if ((*(uint *)(extraout_ECX + 0x168) & 0x100) == 0) { *param_1 = *param_1 + 1; } else { *param_2 = *param_2 + 1; } *param_3 = *param_3 + 1; } pvVar6 = local_24._data; uVar7 = extraout_EDX; } uVar7 = uVar7 + 1; } while (uVar7 < (uint)local_24._size); } if (local_24._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } if (local_24._data != (void *)0x0) { uVar7 = *(uint *)((int)local_24._data + -4); qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar7; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar2 < uVar7); free((uint *)((int)local_24._data + -4)); } } ExceptionList = local_10; return; } //@@ 0058e590 NpcHelper::siren_charmed_count /* DB: charmed familiars following this Siren (boss_approx_2) */ int NpcHelper::siren_charmed_count(void) { Entity_Familiar *this; qword qVar1; byte bVar2; qword *pqVar3; int extraout_ECX; uint uVar4; uint extraout_EDX; int iVar5; EntityList_EL local_24; int local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af38e0; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = 0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_24,3,-1,-1,0,0); uVar4 = 0; if (local_24._size != 0) { do { this = *(Entity_Familiar **)((int)local_24._data + uVar4 * 4); if ((((this != (Entity_Familiar *)0x0) && (this->_type == 3)) && ((this->_flags & 0x100) != 0) ) && ((bVar2 = Entity_Familiar::is_detached_from_follow(this), uVar4 = extraout_EDX, bVar2 != 0 && (*(int *)(extraout_ECX + 0x410) == *(int *)(local_14 + 0xf40))))) { iVar5 = iVar5 + 1; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_24._size); } if (local_24._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } if (local_24._data != (void *)0x0) { uVar4 = *(uint *)((int)local_24._data + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar4; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar4); free((void *)((int)local_24._data + -4)); } } ExceptionList = local_10; return iVar5; } //@@ 0058e680 NpcHelper::siren_pick /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Siren helper (salvage siren_pick.c); verify prototype: db/protos.zhl */ void __fastcall NpcHelper::siren_pick(Entity_NPC *npc) { RNG rng; qword qVar1; uint uVar2; int charmedCount; int familiar; float fVar3; uint outcomeCount; float fVar4; qword *heapCounter; WeightedOutcomePicker outcomesBegin; WeightedOutcomePicker controlledCount; WeightedOutcomePicker outcomeCursor; float roomCenterY; float rightEdgeStart; float leftEdgeStart; WeightedOutcomePicker controlledTotal; EntityList_EL local_64; Entity_NPC *local_54; WeightedOutcomePicker picker; WeightedOutcomePicker outcomesEnd; WeightedOutcomePicker outcomesCapacity; float local_44; float local_40; int local_3c [7]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint local_14; void *room; int *weight; puStack_20 = (undefined1 *)(local_3c + 0xe); puStack_18 = &LAB_00af55ad; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; controlledCount = (WeightedOutcomePicker)0x0; local_3c[4] = 0xc; local_3c[0] = 3; local_3c[1] = 8; local_3c[2] = 9; local_3c[3] = 10; local_3c[5] = 6; picker = (WeightedOutcomePicker)0x0; outcomesEnd = (WeightedOutcomePicker)0x0; outcomesCapacity = (WeightedOutcomePicker)0x0; local_14 = 0; local_54 = npc; local_3c[6] = uVar2; siren_familiar_counts(&local_40,&local_44,&local_64._size); charmedCount = siren_charmed_count(uVar2); controlledTotal = (WeightedOutcomePicker)0x0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_64,3,-1,-1,0,0); fVar4 = 0.0; outcomesBegin = controlledCount; outcomeCursor = (WeightedOutcomePicker)0x0; if ((float)local_64._size != 0.0) { do { familiar = *(int *)((int)local_64._data + (int)fVar4 * 4); if ((familiar == 0) || (*(int *)(familiar + 0x28) != 3)) { familiar = 0; } if (((*(uint *)(familiar + 0x168) & 0x100) != 0) && (*(void **)(familiar + 0x410) == local_54->_sirenPlayerEntity)) { controlledCount = (WeightedOutcomePicker)((int)controlledCount + 1); } fVar4 = (float)((int)fVar4 + 1); } while ((uint)fVar4 < (uint)local_64._size); outcomesBegin = picker; outcomeCursor = outcomesEnd; controlledTotal = controlledCount; } if (local_64._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_64._data != (void *)0x0) { uVar2 = *(uint *)((int)local_64._data + -4); qVar1 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar2; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar1 < uVar2); free((uint *)((int)local_64._data + -4)); } local_14 = local_14 & 0xffffff00; } if ((*(char *)((int)&(local_54->_v2).x + 1) == '\0') && ((int)controlledTotal < 2)) { fVar3 = (float)((int)controlledTotal * -0x21 + 100); fVar4 = 0.0; if (0 < (int)fVar3) { fVar4 = fVar3; } if (0 < (int)fVar4) { local_64._capacity = 1; local_64._size = (int)fVar4; std::vector<8byte>::_Emplace_reallocate(0,&local_64._capacity); outcomesBegin = picker; outcomeCursor = outcomesEnd; } } if (((*(char *)((int)&(local_54->_v2).x + 3) == '\0') && ((int)local_44 < 6)) && (0 < (int)local_40)) { fVar3 = (float)((int)local_40 * 0x21 + (int)local_44 * -0xf); fVar4 = 1.4013e-45; if (1 < (int)fVar3) { fVar4 = fVar3; } local_40 = 2.10195e-43; if ((int)fVar4 < 0x96) { local_40 = fVar4; } uVar2 = 0; outcomeCount = (int)outcomeCursor - (int)outcomesBegin >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)outcomesBegin + uVar2 * 8) == 3) { weight = (undefined4 *)((int)outcomesBegin + 4) + uVar2 * 2; *weight = *weight + (int)local_40; if (*weight < 0) { ((undefined4 *)((int)outcomesBegin + 4))[uVar2 * 2] = 0; } goto LAB_0058e8af; } uVar2 = uVar2 + 1; } while (uVar2 < outcomeCount); } if (0 < (int)local_40) { local_64._capacity = 3; local_64._size = (int)local_40; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,&local_64._capacity); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *(undefined4 *)outcomeCursor = 3; *(float *)((int)outcomeCursor + 4) = local_40; outcomesEnd = (WeightedOutcomePicker)((int)outcomeCursor + 8); outcomeCursor = outcomesEnd; } } } LAB_0058e8af: if (*(char *)&(local_54->_v2).y == '\0') { fVar4 = 4.62428e-44; if (0x21 < charmedCount * 0x21) { fVar4 = (float)(charmedCount * 0x21); } local_40 = 1.4013e-43; if ((int)fVar4 < 100) { local_40 = fVar4; } outcomeCount = (int)outcomeCursor - (int)outcomesBegin >> 3; uVar2 = 0; if (outcomeCount != 0) { do { if (*(int *)((int)outcomesBegin + uVar2 * 8) == 4) { weight = (undefined4 *)((int)outcomesBegin + 4) + uVar2 * 2; *weight = *weight + (int)local_40; if (*weight < 0) { ((undefined4 *)((int)outcomesBegin + 4))[uVar2 * 2] = 0; } goto LAB_0058e94b; } uVar2 = uVar2 + 1; } while (uVar2 < outcomeCount); } if (0 < (int)local_40) { local_64._capacity = 4; local_64._size = (int)local_40; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,&local_64._capacity); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *(undefined4 *)outcomeCursor = 4; *(float *)((int)outcomeCursor + 4) = local_40; outcomesEnd = (WeightedOutcomePicker)((int)outcomeCursor + 8); outcomeCursor = outcomesEnd; } } } LAB_0058e94b: if ((*(char *)((int)&(local_54->_v2).y + 1) == '\0') && (local_44 == 0.0)) { local_64._size = (int)(local_54->_pos).y; room = g_game->_room; fVar4 = *(float *)((int)room + 0x1c); fVar3 = *(float *)((int)room + 0x20); rightEdgeStart = fVar4 - 80.0; local_40 = *(float *)((int)room + 0x14); leftEdgeStart = local_40 + 80.0; roomCenterY = (fVar3 - *(float *)((int)room + 0x18)) * 0.5 + *(float *)((int)room + 0x18); local_44 = (local_54->_pos).x; if (rightEdgeStart == fVar4) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar4 = (local_44 - rightEdgeStart) / (fVar4 - rightEdgeStart); if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } if (leftEdgeStart == local_40) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } local_44 = (local_44 - leftEdgeStart) / (local_40 - leftEdgeStart); if (local_44 <= 0.0) { local_44 = 0.0; } if (1.0 <= local_44) { local_44 = 1.0; } if (roomCenterY == fVar3) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } outcomeCount = (int)outcomeCursor - (int)outcomesBegin >> 3; uVar2 = 0; fVar3 = ((float)local_64._size - roomCenterY) / (fVar3 - roomCenterY); if (fVar3 <= 0.0) { fVar3 = 0.0; } if (1.0 <= fVar3) { fVar3 = 1.0; } fVar4 = (float)(int)((fVar3 + 0.0 + local_44 + 0.0 + fVar4 + 0.0) * 100.0); if (outcomeCount != 0) { do { if (*(int *)((int)outcomesBegin + uVar2 * 8) == 5) { weight = (undefined4 *)((int)outcomesBegin + 4) + uVar2 * 2; *weight = *weight + (int)fVar4; if (*weight < 0) { ((undefined4 *)((int)outcomesBegin + 4))[uVar2 * 2] = 0; } goto LAB_0058eb5f; } uVar2 = uVar2 + 1; } while (uVar2 < outcomeCount); } if (0 < (int)fVar4) { local_64._capacity = 5; local_64._size = (int)fVar4; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,&local_64._capacity); outcomesBegin = picker; outcomeCursor = outcomesEnd; } else { *(undefined4 *)outcomeCursor = 5; *(float *)((int)outcomeCursor + 4) = fVar4; outcomesEnd = (WeightedOutcomePicker)((int)outcomeCursor + 8); outcomeCursor = outcomesEnd; } } LAB_0058eb5f: if (outcomesBegin != outcomeCursor) goto LAB_0058ebbb; } else if ((int)local_44 < 1) goto LAB_0058eb5f; uVar2 = 0; outcomeCount = (int)outcomeCursor - (int)outcomesBegin >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)outcomesBegin + uVar2 * 8) == 0) { weight = (undefined4 *)((int)outcomesBegin + 4) + uVar2 * 2; *weight = *weight + 100; if (*weight < 0) { ((undefined4 *)((int)outcomesBegin + 4))[uVar2 * 2] = 0; } goto LAB_0058ebbb; } uVar2 = uVar2 + 1; } while (uVar2 < outcomeCount); } local_64._size = 100; local_64._capacity = 0; if (outcomeCursor == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomeCursor,&local_64._capacity); } else { *(undefined4 *)outcomeCursor = 0; *(undefined4 *)((int)outcomeCursor + 4) = 100; outcomesEnd = (WeightedOutcomePicker)((int)outcomeCursor + 8); } LAB_0058ebbb: local_64._0_4_ = Random(); local_64._0_4_ = local_64._0_4_ | 1; local_64._data = (void *)0x5; local_64._capacity = 9; local_64._size = 7; rng._shift1 = 5; rng._seed = local_64._0_4_; rng._shift2 = 9; rng._shift3 = 7; uVar2 = WeightedOutcomePicker::PickOutcome(&picker,rng); if (uVar2 == 0) { *(undefined2 *)((int)&local_54->_projectileCooldown + 2) = 0; } else { charmedCount = local_3c[uVar2]; *(undefined2 *)&local_54->_projectileCooldown = 0xffff; local_54->_state = charmedCount; } if (picker != (WeightedOutcomePicker)0x0) { uVar2 = (int)outcomesCapacity - (int)picker & 0xfffffff8; outcomesBegin = picker; if (0xfff < uVar2) { outcomesBegin = *(WeightedOutcomePicker *)((int)picker + -4); uVar2 = uVar2 + 0x23; if (0x1f < ((int)picker - (int)outcomesBegin) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)outcomesBegin,uVar2); } ExceptionList = local_1c; return; } //@@ 0058ec70 NpcAI::ENTITY_SIREN_main /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs Attack1*/Attack2B*/Recall/Revive */ void __fastcall NpcAI::ENTITY_SIREN_main(Entity_NPC *npc) { float *pfVar1; undefined4 uVar2; char cVar3; byte bVar4; ushort attackTimer; short sVar5; int *extraout_EAX; undefined4 extraout_EAX_00; undefined4 extraout_EAX_01; ColorMod *other; undefined4 extraout_EAX_02; undefined4 extraout_EAX_03; undefined4 extraout_EAX_04; undefined4 extraout_EAX_05; undefined4 extraout_EAX_06; undefined4 extraout_EAX_07; Entity_Player *pEVar6; Entity_Familiar *familiar; Vector *vecResult; char *slashAnim; int iVar7; Entity *tmpEntity; int extraout_ECX; code *extraout_EDX; code *extraout_EDX_00; code *extraout_EDX_01; code *extraout_EDX_02; code *extraout_EDX_03; code *extraout_EDX_04; void *pvVar8; int swapIndex; code *extraout_EDX_05; code *extraout_EDX_06; EntityPtr EVar9; ANM2 *pAVar10; int tick; uint uVar11; int *piVar12; bool isEvery32Frames; float fVar13; undefined1 auVar14 [12]; float fVar15; undefined1 auVar16 [12]; double dVar17; undefined8 uVar18; EntityList_EL familiars; Vector local_138; void *local_130; Vector local_12c; char teleportCooldown; char recallCooldown; char attack2BCooldown; char attack2Cooldown; char attack1Cooldown; char slashCooldown; void *local_11c; int *local_118; int frameDelta; Vector local_110; Vector local_108; Vector local_100; ProjectileParams projectileParams; ColorMod color; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; EntityPtr *parentSlot; Room *room; puStack_20 = (undefined1 *)(&color)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af561b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&color)[1]._colorize + 1); ExceptionList = &local_1c; frameDelta = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_110.y = (float)npc; if (npc->_aiCallPhase == 1) { pvVar8 = npc->_sirenPlayerEntity; if (pvVar8 != (void *)0x0) { *(float *)((int)pvVar8 + 0x33c) = (npc->_pos).x; *(float *)((int)pvVar8 + 0x340) = (npc->_pos).y; pvVar8 = npc->_sirenPlayerEntity; *(float *)((int)pvVar8 + 0x360) = (npc->_velocity).x; *(float *)((int)pvVar8 + 0x364) = (npc->_velocity).y; } if (npc->_state == 0x12) { puStack_20 = (undefined1 *)(&color)[1]._offset; siren_release_stolen_items(npc); } } else { npc->_friction = npc->_friction * 0.8; sVar5 = (short)frameDelta; pfVar1 = (&color)[1]._offset; switch(npc->_state) { case 0: puStack_20 = (undefined1 *)(&color)[1]._offset; if (npc->_sirenPlayerEntity != (void *)0x0) { puStack_20 = (undefined1 *)(&color)[1]._offset; (**(code **)(*(int *)npc + 0x44))(local_24); } local_100.y = (float)operator_new(0x2f00); local_14 = 0.0; if ((Entity_Player *)local_100.y == (Entity_Player *)0x0) { piVar12 = (int *)0x0; } else { Entity_Player::constructor((Entity_Player *)local_100.y); piVar12 = extraout_EAX; } local_14 = -NAN; npc->_sirenPlayerEntity = piVar12; (**(code **)(*piVar12 + 4))(1,0,0); *(int *)((int)npc->_sirenPlayerEntity + 0x34) = npc->_type; *(int *)((int)npc->_sirenPlayerEntity + 0x38) = npc->_variant; EVar9 = (EntityPtr)((int)npc->_sirenPlayerEntity + 0x3c8); if (*(int *)EVar9 != 0) { local_108.y = (float)EVar9; std::multiset::erase(); } *(Entity_NPC **)EVar9 = npc; std::multiset::insert(); pvVar8 = npc->_sirenPlayerEntity; *(float *)((int)pvVar8 + 0x33c) = (npc->_pos).x; *(float *)((int)pvVar8 + 0x340) = (npc->_pos).y; pvVar8 = npc->_sirenPlayerEntity; *(float *)((int)pvVar8 + 0x360) = (npc->_velocity).x; *(float *)((int)pvVar8 + 0x364) = (npc->_velocity).y; TemporaryEffects::AddNullEffect ((TemporaryEffects *)((int)npc->_sirenPlayerEntity + 0x1508),0x37,1,1); npc->_entityGridCollisionClass = 3; npc->_state = 3; npc->_projectileCooldown = 0; color._tint[0] = 0.0; color._tint[1] = 0.0; color._tint[2] = 0.0; color._tint[3] = 1.0; npc->_aiCallFlags = 1; color._offset[0] = 0.1; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; color._offset[1] = 0.1; color._offset[2] = 0.1; Color::operator_assign((Color *)&npc->_splatColor,&color); familiars._size = 0; familiars._0_4_ = 0; familiars._data = (void *)0x0; familiars._capacity = 0; local_110.y = (float)Entity::AddFear((Entity *)&npc->_pos,0,0,npc); if (npc->_entityRef != (EntityPtr)0x0) { local_108.y = (float)&npc->_entityRef; std::multiset::erase(); } npc->_entityRef = (EntityPtr)local_110.y; if ((EntityPtr)local_110.y != (EntityPtr)0x0) { std::multiset::insert(); } (npc->_v2).x = 0.0; *(undefined2 *)&(npc->_v2).y = 0; *(undefined2 *)&npc->_projectileDelay = 0; pfVar1 = (float *)puStack_20; break; case 3: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&color)[1]._offset, (npc->_sprite)._animState._isPlaying == 0) ) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,s_Idle,0); } if (npc->_subtype == 999) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0) ; uVar11 = 0; local_14 = 1.4013e-45; if (familiars._size != 0) { pvVar8 = familiars._data; do { familiar = *(Entity_Familiar **)((int)pvVar8 + uVar11 * 4); if ((familiar != (Entity_Familiar *)0x0) && (familiar->_type == 3)) { if ((familiar->_flags & 0x100) == 0) { Entity_Familiar::siren_charm(familiar,npc,npc->_sirenPlayerEntity); } pvVar8 = familiars._data; } uVar11 = uVar11 + 1; } while (uVar11 < (uint)familiars._size); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&familiars); pfVar1 = (float *)puStack_20; } else { bVar4 = ANM2::IsPlaying(&npc->_sprite,s_Idle); if (bVar4 != 0) { PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); uVar11 = Random(); if (((uVar11 % 0x14 == 0) && (fVar13 = (npc->_pos).y + 100.0, pfVar1 = (float *)((int)g_game->_room + 0x20), *pfVar1 <= fVar13 && fVar13 != *pfVar1)) && (fVar13 = (npc->_pathfinder)._moveDirection.y, 0.0 < fVar13)) { (npc->_pathfinder)._moveDirection.y = fVar13 * -1.0; } } sVar5 = *(short *)((int)&npc->_projectileCooldown + 2) + sVar5; *(short *)((int)&npc->_projectileCooldown + 2) = sVar5; if (sVar5 < 0x1f) { if ((((sVar5 - frameDelta) / 10 < (int)sVar5 / 10) && (iVar7 = Isaac::Random(*(byte *)&(npc->_v2).x + 5), iVar7 == 0)) || (pfVar1 = (float *)puStack_20, 0 < (short)npc->_projectileDelay)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_138.y = (tmpEntity->_pos).y - (npc->_pos).y; local_138.x = (tmpEntity->_pos).x - (npc->_pos).x; fVar13 = sqrtf(local_138.y * local_138.y + local_138.x * local_138.x); pfVar1 = (float *)puStack_20; if (fVar13 < 180.0) { vecResult = Vector::Normalized(&local_138,&local_12c); pfVar1 = (float *)puStack_20; if (0.1 < vecResult->y) { NpcHelper::siren_familiar_counts(&local_110.y,&local_108.y,&local_100.y); pfVar1 = (float *)puStack_20; if ((EntityPtr)local_108.y == (EntityPtr)0x0) { *(undefined2 *)&npc->_projectileCooldown = 0; *(undefined2 *)&npc->_projectileDelay = 0; npc->_state = 0xb; vecResult = Vector::Normalized(&local_138,&local_12c); fVar13 = vecResult->x; (npc->_targetPosition).x = fVar13; fVar15 = vecResult->y; *(char *)&(npc->_v2).x = *(char *)&(npc->_v2).x + '\a'; (npc->_targetPosition).y = fVar15; slashAnim = "SlashLeft"; if (0.0 < fVar13) { slashAnim = "SlashRight"; } ANM2::Play(&npc->_sprite,(byte *)slashAnim,0); pfVar1 = (float *)puStack_20; } } } } } else { NpcHelper::siren_pick(npc); pfVar1 = (float *)puStack_20; } } break; case 4: puStack_20 = (undefined1 *)(&color)[1]._offset; Entity_NPC::CalcTargetPosition(npc,&local_100,0.0); local_12c.x = local_100.x + 0.0; local_12c.y = local_100.y - 10.0; vecResult = Room::GetClampedPositionImpl(g_game->_room,&local_108,&local_12c,5.0,5.0,5.0,5.0); local_100.x = vecResult->x; local_100.y = vecResult->y; PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&local_100,2.5,0,1); sVar5 = (short)npc->_projectileCooldown + sVar5; *(short *)&npc->_projectileCooldown = sVar5; if (((0x1e < sVar5) && (fVar13 = local_100.y - (npc->_pos).y, fVar15 = local_100.x - (npc->_pos).x, fVar13 = sqrtf(fVar13 * fVar13 + fVar15 * fVar15), fVar13 < 20.0)) || (0x5a < sVar5)) { npc->_state = 7; } uVar11 = Random(); pfVar1 = (float *)puStack_20; if ((uVar11 & 1) == 0) { uVar11 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar11); fVar13 = g_vectorOne.y; iVar7 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.x = g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar13; pAVar10 = &tmpEntity[1]._sprite; (pAVar10->_filename)._buf[8] = ','; (pAVar10->_filename)._buf[9] = '\x01'; (pAVar10->_filename)._buf[10] = '\0'; (pAVar10->_filename)._buf[0xb] = '\0'; pAVar10 = &tmpEntity[1]._sprite; (pAVar10->_filename)._buf[0xc] = ','; (pAVar10->_filename)._buf[0xd] = '\x01'; (pAVar10->_filename)._buf[0xe] = '\0'; (pAVar10->_filename)._buf[0xf] = '\0'; (**(code **)(iVar7 + 0xc))(); pfVar1 = (float *)puStack_20; } break; case 5: pAVar10 = &npc->_sprite; puStack_20 = (undefined1 *)(&color)[1]._offset; bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar10,"Sound"); if (bVar4 != 0) { play_sound_with_fart_seed(0x32a,1.0,2,0,1.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar10,"Shoot"); if (bVar4 != 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar13 = (npc->_pos).y - (tmpEntity->_pos).y; fVar15 = (npc->_pos).x - (tmpEntity->_pos).x; fVar13 = sqrtf(fVar13 * fVar13 + fVar15 * fVar15); local_12c.y = (fVar13 * 0.1 * (tmpEntity->_velocity).y + (tmpEntity->_pos).y) - (npc->_pos).y; local_12c.x = (fVar13 * 0.1 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x) - (npc->_pos).x; Vector::Normalized(&local_12c,&local_100); fVar13 = local_110.y; ((Vector *)((int)local_110.y + 0x334))->x = local_100.x; *(float *)((int)local_110.y + 0x338) = local_100.y; *(undefined2 *)((int)local_110.y + 0xba0) = 0; uVar11 = Random(); local_12c.x = local_100.x * 10.0; local_12c.y = local_100.y * 10.0; tmpEntity = Game::Spawn(g_game,0x388,10,&npc->_pos,&local_12c,(Entity *)fVar13,0,uVar11); npc = (Entity_NPC *)local_110.y; tmpEntity->_visible = 0; tmpEntity->_entityCollisionClass = 0; tmpEntity->_entityGridCollisionClass = 3; Entity::SetParent(tmpEntity,(Entity *)local_110.y); (**(code **)(*(int *)tmpEntity + 0xc))(); Entity::SetChild((Entity *)npc,tmpEntity); pAVar10 = (ANM2 *)((int)npc + 0x48); } bVar4 = ANM2::WasEventTriggered(pAVar10,(byte *)"Shoot"); sVar5 = *(short *)((int)npc + 0xba0); if ((bVar4 == 0) || (3 < sVar5)) { fVar13 = 1.1 - (float)(sVar5 + -4) * 0.01; if (fVar13 <= 1.0) { fVar13 = 1.0; } *(float *)((int)npc + 0x36c) = fVar13 * *(float *)((int)npc + 0x36c); } else { fVar13 = *(float *)((int)npc + 0x338); fVar15 = *(float *)((int)npc + 0x364); ((Vector *)((int)npc + 0x360))->x = ((Vector *)((int)npc + 0x334))->x * 6.0 + ((Vector *)((int)npc + 0x360))->x; *(float *)((int)npc + 0x364) = fVar13 * 6.0 + fVar15; sVar5 = *(short *)((int)npc + 0xba0); } *(short *)((int)npc + 0xba0) = sVar5 + (short)frameDelta; if ((*(void **)((int)npc + 0x7c) == (void *)0x0) || (*(byte *)((int)npc + 0x8c) == 0)) { *(int *)((int)npc + 0xb64) = 3; *(undefined2 *)((int)npc + 0xba2) = 0; *(undefined1 *)((int)npc + 0xbbc) = 0xf; } pvVar8 = *(void **)((int)npc + 0xf40); auVar16 = ZEXT812(0x40a00000); fVar13 = *(float *)((int)npc + 0x39c) * 0.3 + *(float *)((int)pvVar8 + 0x338); *(undefined4 *)((int)pvVar8 + 0x334) = *(undefined4 *)((int)pvVar8 + 0x334); if (fVar13 <= auVar16._0_4_) { auVar16._4_8_ = auVar16._4_8_; auVar16._0_4_ = fVar13; } *(int *)((int)pvVar8 + 0x338) = auVar16._0_4_; pfVar1 = (float *)puStack_20; break; case 6: puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Teleport",0); Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 5; npc->_shadowSize = 0.0; } bVar4 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar4 != 0) && (uVar11 = Random(), uVar11 % 3 == 0)) { uVar11 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x1a,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar11); fVar13 = g_vectorOne.y; iVar7 = *(int *)tmpEntity; (tmpEntity->_sprite)._scale.x = g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar13; (**(code **)(iVar7 + 0xc))(); } pfVar1 = (float *)puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { *(undefined2 *)&npc->_projectileCooldown = 0; npc->_state = 4; } break; case 7: puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"TeleportEnd",0); Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { npc->_entityCollisionClass = 4; npc->_entityGridCollisionClass = 3; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); } pfVar1 = (float *)puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(undefined4 *)((int)&npc->_projectileCooldown + 2) = 0x1e0000; *(undefined1 *)((int)&(npc->_v2).y + 1) = 9; } break; case 8: attackTimer = (ushort)npc->_projectileCooldown; if ((short)attackTimer < 0) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Attack1Start",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); manager = g_manager; pfVar1 = (float *)puStack_20; if (bVar4 != 0) { local_110.y = 1.01874e-42; *(undefined2 *)&npc->_projectileCooldown = 0; seed_fart_sound_override((int *)&local_110.y); SoundEffects::Play(&manager->_sfxManager,(int)local_110.y,1.0,2,0,1.0,0.0); manager = g_manager; local_110.y = 1.13785e-42; seed_fart_sound_override((int *)&local_110.y); SoundEffects::Play(&manager->_sfxManager,(int)local_110.y,1.0,2,0,1.0,0.0); pfVar1 = (float *)puStack_20; } } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&color)[1]._offset, (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Attack1Loop",0); attackTimer = (ushort)npc->_projectileCooldown; } local_108.y = (float)(uint)attackTimer; iVar7 = (int)(short)attackTimer; if ((int)(iVar7 + (iVar7 >> 0x1f & 7U)) >> 3 < (int)((frameDelta + iVar7 >> 0x1f & 7U) + frameDelta + iVar7) >> 3) { uVar11 = Random(); local_110.y = (float)Game::Spawn(g_game,1000,0xa4,&npc->_pos,&g_vectorZero,(Entity *)0x0,0 ,uVar11); parentSlot = (EntityPtr *)((int)local_110.y + 0x3bc); if (*(EntityPtr *)((int)local_110.y + 0x3bc) != (EntityPtr)0x0) { local_108.y = (float)parentSlot; std::multiset::erase(); } *parentSlot = (EntityPtr)npc; std::multiset::insert(); ((Vector *)((int)local_110.y + 0x34c))->x = 0.0; *(float *)((int)local_110.y + 0x350) = -45.0; attackTimer = (ushort)npc->_projectileCooldown; } iVar7 = (int)(short)attackTimer; local_108.y._2_2_ = 0; local_108.y._0_2_ = attackTimer; if ((int)(iVar7 + (iVar7 >> 0x1f & 0xfU)) >> 4 < (int)((frameDelta + iVar7 >> 0x1f & 0xfU) + frameDelta + iVar7) >> 4) { room = g_game->_room; tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_100.x = (tmpEntity->_pos).x; local_100.y = (tmpEntity->_pos).y; Room::GetClampedPositionImpl(room,&local_108,&local_100,60.0,60.0,60.0,60.0); fVar13 = atan2f(local_108.y - (npc->_pos).y,local_108.x - (npc->_pos).x); local_108.y = fVar13 * 57.295776; local_110.y = local_108.y + 180.0; uVar11 = Random(); local_118 = (int *)(((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 + local_108.y); uVar11 = Random(); local_108.y = ((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 30.0 + local_110.y; if (0 < (short)npc->_projectileCooldown) { local_118 = (int *)approach_angle((npc->_v1).x,(float)local_118,20.0); } (npc->_v1).x = (float)local_118; ProjectileParams::ProjectileParams(&projectileParams); projectileParams.FallingSpeedModifier = projectileParams.FallingSpeedModifier - 0.1; projectileParams.FallingAccelModifier = -0.14; projectileParams.BulletFlags._0_4_ = 0x200000; projectileParams.BulletFlags._4_4_ = 0; local_110.y = 0.0; uVar11 = (int)(short)npc->_projectileCooldown & 0x8000001f; isEvery32Frames = uVar11 == 0; if ((int)uVar11 < 0) { isEvery32Frames = (uVar11 - 1 | 0xffffffe0) == 0xffffffff; } if (isEvery32Frames) { local_110.y = 7.5; } local_11c = (void *)0x0; do { fVar13 = (float)local_118 - (float)local_11c; if (360.0 < ABS(fVar13)) { fVar13 = fmodf(fVar13,360.0); } if (fVar13 <= 180.0) { if (fVar13 < -180.0) { fVar13 = fVar13 + 360.0; } } else { fVar13 = fVar13 - 360.0; } if (7.5 <= ABS(fVar13)) { fVar13 = local_108.y - (float)local_11c; if (360.0 < ABS(fVar13)) { fVar13 = fmodf(fVar13,360.0); } if (fVar13 <= 180.0) { if (fVar13 < -180.0) { fVar13 = fVar13 + 360.0; } } else { fVar13 = fVar13 - 360.0; } if (7.5 <= ABS(fVar13)) { local_138.y = ((float)local_11c + local_110.y) * 0.017453292; fVar13 = cos(local_138.y); local_12c.x = fVar13 * 5.0; fVar13 = sin(local_138.y); local_12c.y = fVar13 * 5.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_12c,0,&projectileParams); } } local_11c = (void *)((float)local_11c + 15.0); } while ((float)local_11c < 360.0); attackTimer = (ushort)npc->_projectileCooldown; } if ((int)(short)attackTimer / 0x18 < ((short)attackTimer + frameDelta) / 0x18) { local_100.x = (npc->_pos).x + 0.0; local_100.y = (npc->_pos).y - 45.0; Game::MakeShockwave(g_game,&local_100,0.015,0.015,0x14); } local_118 = (int *)0x0; local_100.y = (float)g_game->_room; if (((Entity_Player *)local_100.y)->_playerCostumeMap[3]._priority != 0) { do { local_108.y = *(float *)(((PlayerCostumeMap *)((int)local_100.y + 0x122c))[3]._index + (int)local_118 * 4); if ((Entity_NPC *)local_108.y != npc) { if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)local_108.y + 0x28) != 1)) { iVar7 = *(int *)((int)local_108.y + 0x28); if (((0x3dd < iVar7 - 10U) || (iVar7 == 0x21)) && ((((iVar7 != 1 && (iVar7 != 2)) && (iVar7 != 4)) && (iVar7 != 5)))) goto LAB_0058f9a7; } else { iVar7 = 1; } local_138.y = *(float *)((int)local_108.y + 0x340) - (npc->_pos).y; local_110.y = ((Vector *)((int)local_108.y + 0x33c))->x - (npc->_pos).x; fVar13 = local_138.y * local_138.y + local_110.y * local_110.y; local_11c = (void *)(2.0 / (fVar13 * 0.0001 + 1.0)); fVar13 = sqrtf(fVar13); if (fVar13 <= 0.0) { EVar9 = (EntityPtr)local_110.y; piVar12 = (int *)local_138.y; } else { EVar9 = (EntityPtr)(local_110.y * (1.0 / fVar13)); piVar12 = (int *)(local_138.y * (1.0 / fVar13)); } if (iVar7 == 1) { pvVar8 = (void *)((float)local_11c * 0.7); } else { pvVar8 = local_11c; if (iVar7 == 2) { pvVar8 = (void *)((float)local_11c * 0.4); } } fVar13 = *(float *)((int)local_108.y + 0x36c); if (fVar13 != 0.0) { fVar15 = ((Vector *)((int)local_108.y + 0x360))->x; *(float *)((int)local_108.y + 0x364) = (*(float *)((int)local_108.y + 0x39c) * (float)pvVar8 * (float)piVar12) / fVar13 + *(float *)((int)local_108.y + 0x364); ((Vector *)((int)local_108.y + 0x360))->x = (*(float *)((int)local_108.y + 0x39c) * (float)pvVar8 * (float)EVar9) / fVar13 + fVar15; } } LAB_0058f9a7: local_118 = (int *)((int)local_118 + 1); } while (local_118 < (int *)((PlayerCostumeMap *)((int)local_100.y + 0x122c))[3]._priority ); } sVar5 = (short)npc->_projectileCooldown + (short)frameDelta; *(short *)&npc->_projectileCooldown = sVar5; pfVar1 = (float *)puStack_20; if (0x96 < sVar5) { ANM2::Play(&npc->_sprite,(byte *)"Attack1End",0); npc->_state = 3; *(undefined2 *)((int)&npc->_projectileCooldown + 2) = 0; *(undefined1 *)((int)&(npc->_v2).x + 1) = 0x1e; pfVar1 = (float *)puStack_20; } } break; case 9: attackTimer = (ushort)npc->_projectileCooldown; if ((short)attackTimer < 0) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Attack2Start",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); pfVar1 = (float *)puStack_20; if ((bVar4 != 0) && (*(undefined2 *)&npc->_projectileCooldown = 0, npc->_entityRef != (EntityPtr)0x0)) { Color::Color((Color *)&color); (*extraout_EDX)(extraout_EAX_00,0xffffffff,0xff,0,1); Color::Color((Color *)&color); (*extraout_EDX_00)(extraout_EAX_01,0xf,0xff,1,1); pfVar1 = (float *)puStack_20; } } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&color)[1]._offset, (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Attack2Loop",0); attackTimer = (ushort)npc->_projectileCooldown; } local_100.y = (float)(uint)attackTimer; iVar7 = (int)(short)attackTimer; if ((int)(iVar7 + (iVar7 >> 0x1f & 7U)) >> 3 < (int)((frameDelta + iVar7 >> 0x1f & 7U) + frameDelta + iVar7) >> 3) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.FallingSpeedModifier = projectileParams.FallingSpeedModifier - 0.1; projectileParams.FallingAccelModifier = -0.099; Color::Color((Color *)&color); Color::operator_assign((Color *)&projectileParams.Color,other); projectileParams.BulletFlags._0_4_ = 0x20; projectileParams.BulletFlags._4_4_ = 0; uVar11 = Random(); local_110.y = 0.0; local_108.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)] ) * 2.3283064e-10 * 60.0; do { local_100.y = (local_110.y + local_108.y) * 0.017453292; fVar13 = cos(local_100.y); local_12c.x = fVar13 * 10.0; fVar13 = sin(local_100.y); local_12c.y = fVar13 * 10.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_12c,0,&projectileParams); local_110.y = local_110.y + 60.0; } while (local_110.y < 360.0); attackTimer = (ushort)npc->_projectileCooldown; } sVar5 = attackTimer + (short)frameDelta; *(short *)&npc->_projectileCooldown = sVar5; pfVar1 = (float *)puStack_20; if (0x5a < sVar5) { ANM2::Play(&npc->_sprite,(byte *)"Attack2End",0); npc->_state = 3; *(undefined2 *)((int)&npc->_projectileCooldown + 2) = 0; if (npc->_entityRef != (EntityPtr)0x0) { Color::Color((Color *)&color); (*extraout_EDX_01)(extraout_EAX_02,0xffffffff,0xff,0,1); Color::Color((Color *)&color); (*extraout_EDX_02)(extraout_EAX_03,0xf,0xff,1,1); } *(undefined1 *)((int)&(npc->_v2).x + 2) = 0x1e; pfVar1 = (float *)puStack_20; } } break; case 10: sVar5 = (short)npc->_projectileCooldown; pAVar10 = &npc->_sprite; if (sVar5 < 0) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(pAVar10,(byte *)"Attack2BStart",0); bVar4 = Sprite::IsEventTriggered((Sprite *)pAVar10,"Shoot"); manager = g_manager; pfVar1 = (float *)puStack_20; if (bVar4 != 0) { local_110.y = 1.02015e-42; seed_fart_sound_override((int *)&local_110.y); SoundEffects::Play(&manager->_sfxManager,(int)local_110.y,1.0,2,0,1.0,0.0); *(undefined2 *)&npc->_projectileCooldown = 0; Color::Color((Color *)&color); (*extraout_EDX_03)(extraout_EAX_04,0xffffffff,0xff,0,1); Color::Color((Color *)&color); (*extraout_EDX_04)(extraout_EAX_05,0xf,0xff,1,1); pfVar1 = (float *)puStack_20; } } else { if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&color)[1]._offset, (npc->_sprite)._animState._isPlaying == 0)) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(pAVar10,(byte *)"Attack2BLoop",0); sVar5 = (short)npc->_projectileCooldown; } manager = g_manager; if ((sVar5 < 3) && (2 < sVar5 + frameDelta)) { local_11c = (void *)0x0; local_130 = (void *)0x0; local_118 = (int *)0x0; local_12c.x = 0.0; local_138.y = 0.0; local_12c.y = 0.0; local_14 = 2.8026e-45; local_108.y = 1.13926e-42; seed_fart_sound_override((int *)&local_108.y); SoundEffects::Play(&manager->_sfxManager,(int)local_108.y,1.0,2,0,1.0,0.0); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0); uVar11 = 0; local_14 = (float)CONCAT31(local_14._1_3_,3); if (familiars._size == 0) { pvVar8 = (void *)0x0; } else { piVar12 = (int *)0x0; pvVar8 = familiars._data; do { pEVar6 = *(Entity_Player **)((int)pvVar8 + uVar11 * 4); if ((pEVar6 != (Entity_Player *)0x0) && (pEVar6->_type == 3)) { local_100.y = (float)pEVar6; cVar3 = FUN_0060dae0(); if ((cVar3 != '\0') && ((*(uint *)(extraout_ECX + 0x168) & 0x100) == 0)) { if (piVar12 == (int *)local_138.y) { std::vector<4byte>::_Emplace_reallocate(piVar12,&local_100.y); local_138.y = local_12c.y; piVar12 = (int *)local_12c.x; } else { *piVar12 = extraout_ECX; local_12c.x = (float)(piVar12 + 1); piVar12 = (int *)local_12c.x; } } pvVar8 = familiars._data; } uVar11 = uVar11 + 1; } while (uVar11 < (uint)familiars._size); local_11c = local_130; pvVar8 = local_130; npc = (Entity_NPC *)local_110.y; local_118 = piVar12; } local_110.y = 0.0; piVar12 = (int *)((int)local_118 - (int)pvVar8 >> 2); EVar9 = (EntityPtr)((int)piVar12 + -1); if (-1 < (int)EVar9) { local_118 = piVar12; do { if (2 < (uint)local_110.y) break; swapIndex = 0; if (local_118 != (int *)0x0) { uVar11 = Random(); swapIndex = uVar11 % (uint)local_118; pvVar8 = local_11c; } if (EVar9 != (EntityPtr)swapIndex) { uVar2 = *(undefined4 *)((int)pvVar8 + (int)EVar9 * 4); *(undefined4 *)((int)pvVar8 + (int)EVar9 * 4) = *(undefined4 *)((int)pvVar8 + swapIndex * 4); *(undefined4 *)((int)pvVar8 + swapIndex * 4) = uVar2; } local_108.y = (float)swapIndex; NpcHelper::siren_charm_familiar(); local_118 = (int *)((int)local_118 + -1); local_110.y = (float)((int)local_110.y + 1); EVar9 = (EntityPtr) ((int)&((Entity_NPC *)((int)EVar9 + -0xf54))->_pickupGhostsEntity + 3); pvVar8 = local_11c; } while (-1 < (int)EVar9); } if (familiars._0_1_ == '\0') { local_14 = (float)CONCAT31(local_14._1_3_,4); tracked_alloc(1,familiars._data,0); } local_14 = -NAN; if (local_11c != (void *)0x0) { uVar11 = (int)local_138.y - (int)local_11c & 0xfffffffc; pvVar8 = local_11c; if (0xfff < uVar11) { pvVar8 = *(void **)((int)local_11c + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)local_11c + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar11); } pAVar10 = (ANM2 *)((int)npc + 0x48); } sVar5 = *(short *)((int)npc + 0xba0) + (short)frameDelta; *(short *)((int)npc + 0xba0) = sVar5; pfVar1 = (float *)puStack_20; if (0x5a < sVar5) { ANM2::Play(pAVar10,(byte *)"Attack2BEnd",0); ((Vector *)((int)npc + 0xb64))->x = 4.2039e-45; *(undefined2 *)((int)npc + 0xba2) = 0; if (*(EntityPtr *)((int)npc + 0xbec) != (EntityPtr)0x0) { Color::Color((Color *)&color); (*extraout_EDX_05)(extraout_EAX_06,0xffffffff,0xff,0,1); Color::Color((Color *)&color); (*extraout_EDX_06)(extraout_EAX_07,0xf,0xff,1,1); } *(undefined1 *)((int)npc + 0xbbb) = 0x1e; pfVar1 = (float *)puStack_20; } } break; case 0xb: puStack_20 = (undefined1 *)(&color)[1]._offset; bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); manager = g_manager; if (bVar4 != 0) { local_108.y = 1.13505e-42; seed_fart_sound_override((int *)&local_108.y); SoundEffects::Play(&manager->_sfxManager,(int)local_108.y,1.0,2,0,1.0,0.0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar4 != 0) { *(undefined2 *)&npc->_projectileCooldown = 0; ProjectileParams::ProjectileParams(&projectileParams); fVar13 = (npc->_targetPosition).x; fVar15 = (npc->_targetPosition).y; local_12c.x = fVar13 * 15.0; local_100.x = fVar13 * 10.0 + (npc->_pos).x; local_12c.y = fVar15 * 15.0; local_100.y = fVar15 * 10.0 + (npc->_pos).y; projectileParams.Spread = 0.7; Entity_NPC::FireProjectiles(npc,&local_100,&local_12c,5,&projectileParams); } bVar4 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); sVar5 = (short)npc->_projectileCooldown; if (bVar4 == 0) { if ((sVar5 < 5) && (4 < sVar5 + frameDelta)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_100.x = (tmpEntity->_pos).x - (npc->_pos).x; local_100.y = (tmpEntity->_pos).y - (npc->_pos).y; if ((0.0 <= local_100.x) || ((npc->_targetPosition).x <= 0.0)) { if ((0.0 < local_100.x) && ((npc->_targetPosition).x <= 0.0 && (npc->_targetPosition).x != 0.0)) { local_100.x = -0.01; } } else { local_100.x = 0.01; } Vector::Normalize(&local_100); if (local_100.y < 0.1) { local_100.y = 0.1; Vector::Normalize(&local_100); } (npc->_targetPosition).x = local_100.x; (npc->_targetPosition).y = local_100.y; } } else if (sVar5 < 4) { fVar13 = (npc->_targetPosition).y; fVar15 = npc->_speedMultiplier; (npc->_velocity).x = (npc->_targetPosition).x * 6.0 * fVar15 + (npc->_velocity).x; (npc->_velocity).y = fVar13 * 6.0 * fVar15 + (npc->_velocity).y; } else { fVar13 = 1.1 - (float)(sVar5 + -4) * 0.01; if (fVar13 <= 1.0) { fVar13 = 1.0; } npc->_friction = fVar13 * npc->_friction; } *(short *)&npc->_projectileCooldown = (short)npc->_projectileCooldown + (short)frameDelta; pfVar1 = (float *)puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(undefined2 *)((int)&npc->_projectileCooldown + 2) = 0; } break; case 0xc: puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"Recall",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); manager = g_manager; if (bVar4 != 0) { local_108.y = 1.13645e-42; seed_fart_sound_override((int *)&local_108.y); SoundEffects::Play(&manager->_sfxManager,(int)local_108.y,1.0,2,0,1.0,0.0); pEVar6 = Game::GetPlayer(g_game,0); local_100.y = (float)pEVar6; iVar7 = NpcHelper::siren_charmed_count(); local_108.y = (float)(3 - iVar7); if (0 < (int)local_108.y) { do { local_12c.x = (npc->_pos).x; local_12c.y = (npc->_pos).y; uVar11 = Random(); familiar = (Entity_Familiar *) Game::Spawn(g_game,3,0xdc,&local_12c,&g_vectorZero,(Entity *)pEVar6,0,uVar11) ; uVar2 = *(undefined4 *)((int)&familiar->_flags + 4); iVar7 = *(int *)familiar; *(uint *)&familiar->_flags = (uint)familiar->_flags & 0xfffffffb; *(undefined4 *)((int)&familiar->_flags + 4) = uVar2; (**(code **)(iVar7 + 0xc))(); Entity_Familiar::siren_charm(familiar,npc,npc->_sirenPlayerEntity); uVar11 = Random(); local_110.x = (familiar->_pos).x; local_110.y = (familiar->_pos).y; tmpEntity = Game::Spawn(g_game,1000,0xf,&local_110,&g_vectorZero,(Entity *)0x0,0,uVar11) ; color._offset[0] = 0.0; color._tint[0] = 0.2; color._tint[1] = 0.2; color._tint[2] = 0.2; color._tint[3] = 1.0; color._colorize[0] = 1.0; color._colorize[1] = 1.0; color._colorize[2] = 1.0; color._colorize[3] = 1.0; color._offset[1] = 0.0; color._offset[2] = 0.0; (**(code **)(*(int *)tmpEntity + 0x3c))(&color,0xffffffff,0xff,0); (**(code **)(*(int *)tmpEntity + 0xc))(); local_108.y = (float)((int)&((Entity_NPC *)((int)local_108.y + -0xf54))-> _pickupGhostsEntity + 3); pEVar6 = (Entity_Player *)local_100.y; } while ((EntityPtr)local_108.y != (EntityPtr)0x0); } pvVar8 = npc->_sirenPlayerEntity; *(uint *)((int)pvVar8 + 0x168) = *(uint *)((int)pvVar8 + 0x168) | 0x400000; *(undefined4 *)((int)pvVar8 + 0x16c) = *(undefined4 *)((int)pvVar8 + 0x16c); pvVar8 = npc->_sirenPlayerEntity; *(undefined4 *)((int)pvVar8 + 0x334) = 0; *(undefined4 *)((int)pvVar8 + 0x338) = 0x40a00000; } if (((npc->_sprite)._animState._animData == (void *)0x0) || (pfVar1 = (float *)puStack_20, (npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"HoverStart",0); npc->_state = 0xd; pfVar1 = (float *)puStack_20; } break; case 0xd: if (((npc->_sprite)._animState._animData == (void *)0x0) || (puStack_20 = (undefined1 *)(&color)[1]._offset, (npc->_sprite)._animState._isPlaying == 0) ) { puStack_20 = (undefined1 *)(&color)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)"HoverLoop",0); } uVar18 = 0x100000000; fVar13 = 0.3; vecResult = Entity_NPC::CalcTargetPosition(npc,&local_12c,0.0); PathFinder::FindGridPath ((PathFinder *)&npc->_pathfinder,vecResult,fVar13,(int)uVar18, (byte)((ulonglong)uVar18 >> 0x20)); iVar7 = (int)(short)npc->_projectileCooldown; if ((iVar7 / 0x1e < (frameDelta + iVar7) / 0x1e) && (iVar7 = NpcHelper::siren_charmed_count(), iVar7 == 0)) { ANM2::Play(&npc->_sprite,(byte *)"HoverEnd",0); npc->_state = 3; *(undefined2 *)((int)&npc->_projectileCooldown + 2) = 0; *(undefined1 *)&(npc->_v2).y = 0xf; pfVar1 = (float *)puStack_20; } else { sVar5 = (short)npc->_projectileCooldown + (short)frameDelta; *(short *)&npc->_projectileCooldown = sVar5; local_100.y = npc->_pendingDamage; if (0.0 < local_100.y) { dVar17 = ceil((double)local_100.y); local_100.y = (float)dVar17; sVar5 = (short)(int)dVar17 + sVar5; *(short *)&npc->_projectileCooldown = sVar5; } pfVar1 = (float *)puStack_20; if (300 < sVar5) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); slashAnim = "SlashRight"; if ((tmpEntity->_pos).x - (npc->_pos).x <= 0.0) { slashAnim = "SlashLeft"; } ANM2::Play(&npc->_sprite,(byte *)slashAnim,0); npc->_state = 5; pfVar1 = (float *)puStack_20; } } break; case 0x10: ANM2::Play(&npc->_sprite,(byte *)"Revive",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Sound"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0x80,1.0,0x14,0,1.0); sVar5 = *(short *)((int)&npc->_projectileDelay + 2); fVar13 = npc->_maxHitPoints; npc->_shadowSize = *(float *)((int)npc->_config + 0x24); if (sVar5 == 0x51) { fVar13 = fVar13 * 0.2; } npc->_health = fVar13; npc->_entityCollisionClass = 4; } pfVar1 = (float *)puStack_20; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; *(undefined2 *)((int)&npc->_projectileCooldown + 2) = 0; npc->_isInvicible = 0; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); pvVar8 = npc->_sirenPlayerEntity; *(undefined1 *)((int)pvVar8 + 0x1398) = 0; *(undefined1 *)((int)pvVar8 + 0x139a) = 0; } } puStack_20 = (undefined1 *)pfVar1; tick = 0; iVar7 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); if (0 < iVar7) { slashCooldown = *(char *)((int)npc + 3000); attack1Cooldown = *(char *)((int)npc + 0xbb9); attack2Cooldown = *(char *)((int)npc + 0xbba); attack2BCooldown = *(char *)((int)npc + 0xbbb); recallCooldown = *(char *)((int)npc + 0xbbc); teleportCooldown = *(char *)((int)npc + 0xbbd); do { if (slashCooldown != '\0') { slashCooldown = slashCooldown + -1; *(char *)((int)npc + 3000) = slashCooldown; } if (attack1Cooldown != '\0') { attack1Cooldown = attack1Cooldown + -1; *(char *)((int)npc + 0xbb9) = attack1Cooldown; } if (attack2Cooldown != '\0') { attack2Cooldown = attack2Cooldown + -1; *(char *)((int)npc + 0xbba) = attack2Cooldown; } if (attack2BCooldown != '\0') { attack2BCooldown = attack2BCooldown + -1; *(char *)((int)npc + 0xbbb) = attack2BCooldown; } if (recallCooldown != '\0') { recallCooldown = recallCooldown + -1; *(char *)((int)npc + 0xbbc) = recallCooldown; } if (teleportCooldown != '\0') { teleportCooldown = teleportCooldown + -1; *(char *)((int)npc + 0xbbd) = teleportCooldown; } tick = tick + 1; iVar7 = Entity::GetIntervalTicks((Entity *)npc,10.0,0.0); } while (tick < iVar7); } if (0 < *(short *)((int)npc + 0xba4)) { *(short *)((int)npc + 0xba4) = *(short *)((int)npc + 0xba4) - (short)frameDelta; } iVar7 = *(int *)((int)npc + 0xf40); fVar13 = *(float *)(iVar7 + 0x338); fVar15 = *(float *)((int)npc + 0x39c); *(float *)(iVar7 + 0x338) = fVar13; *(float *)(iVar7 + 0x334) = fVar13 * fVar15 + *(float *)(iVar7 + 0x334); if (*(int *)((int)npc + 0x3c0) == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_110.y = (tmpEntity->_pos).y - *(float *)((int)npc + 0x340); local_110.x = (tmpEntity->_pos).x - *(float *)((int)npc + 0x33c); local_108.y = local_110.y; local_100.y = local_110.x; fVar13 = sqrtf(local_110.y * local_110.y + local_110.x * local_110.x); if (0.0 < fVar13) { local_110.y = (1.0 / fVar13) * local_108.y; local_110.x = (1.0 / fVar13) * local_100.y; } FUN_00770640(); iVar7 = *(int *)((int)npc + 0xf40); fVar13 = *(float *)(iVar7 + 0x338) - *(float *)((int)npc + 0x39c) * 0.08; *(undefined4 *)(iVar7 + 0x334) = *(undefined4 *)(iVar7 + 0x334); auVar14 = ZEXT812(0x3f800000); if (auVar14._0_4_ <= fVar13) { auVar14._4_8_ = auVar14._4_8_; auVar14._0_4_ = fVar13; } *(int *)(iVar7 + 0x338) = auVar14._0_4_; } else { FUN_00770640(); } if (*(char *)((int)npc + 0x173) != '\0') { uVar11 = 0; local_100.y = (float)g_game->_room; if (((Entity_Player *)local_100.y)->_playerCostumeMap[3]._priority != 0) { do { iVar7 = *(int *)(((PlayerCostumeMap *)((int)local_100.y + 0x122c))[3]._index + uVar11 * 4) ; if (((*(int *)(iVar7 + 0x28) == 3) && (*(int *)(iVar7 + 0x410) == *(int *)((int)npc + 0xf40))) && ((*(int *)(iVar7 + 0x2c) != 0x29 && (*(int *)(iVar7 + 0x2c) != 0x28)))) { Entity_Familiar::RemoveFromPlayer(); } uVar11 = uVar11 + 1; } while (uVar11 < (uint)((PlayerCostumeMap *)((int)local_100.y + 0x122c))[3]._priority); } iVar7 = *(int *)((int)npc + 0xf40); *(uint *)(iVar7 + 0x168) = *(uint *)(iVar7 + 0x168) & 0xffbfffff; *(undefined4 *)(iVar7 + 0x16c) = *(undefined4 *)(iVar7 + 0x16c); } (**(code **)(**(int **)((int)npc + 0xf40) + 0xc))(); } ExceptionList = local_1c; return; } //@@ 005911b0 NpcAI::siren_release_stolen_items /* DB: ENTITY_SIREN_main state 0x12: 'Death', AnimateCollectible 'Pickup'/'PlayerPickupSparkle' on owner +0xf40, RemoveCollectible 0x51/0xb, Spawn 0x388 */ void __fastcall NpcAI::siren_release_stolen_items(Entity_NPC *npc) { float fVar1; byte bVar2; byte *pbVar3; uint flagsHigh; Entity *sirenSpawn; Vector *freePos; char *pcVar5; int gridRow; int iVar6; int *entitySlot; Entity_Player *player; bool bVar7; Vector local_20; Entity_NPC *local_18; Vector *local_14; uint familiarVariant; undefined4 flagsHigh; Room *room; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Death"; do { bVar2 = *pbVar3; bVar7 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_00591217: flagsHigh = -(uint)bVar7 | 1; goto LAB_0059121c; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_00591217; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); flagsHigh = 0; LAB_0059121c: if (flagsHigh == 0) { flagsHigh = 0; local_14 = g_game->_room; local_18 = npc; if (*(int *)((int)local_14 + 0x1264) != 0) { entitySlot = *(int **)((int)local_14 + 0x125c); do { iVar6 = *entitySlot; if ((*(int *)(iVar6 + 0x28) == 3) && (*(void **)(iVar6 + 0x410) == npc->_sirenPlayerEntity)) { familiarVariant = *(uint *)(iVar6 + 0x2c); local_20.y = (float)(familiarVariant & 0xffff); if ((familiarVariant == 0x29) || (familiarVariant == 0x28)) { *(short *)((int)&npc->_projectileDelay + 2) = (short)familiarVariant; *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_dead = 0; npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; player = *(Entity_Player **)(iVar6 + 0x414); if (player == (Entity_Player *)0x0) { player = *(Entity_Player **)(iVar6 + 0x410); } if ((short)familiarVariant == 0x51) { iVar6 = Entity_Player::GetCollectibleNum(player,0x51,1); if (0 < iVar6) { Entity_Player::RemoveCollectible(player,0x51,0,0,1); } iVar6 = 0x51; } else { iVar6 = Entity_Player::GetCollectibleNum(player,0xb,1); if (0 < iVar6) { Entity_Player::RemoveCollectible(player,0xb,0,0,1); } iVar6 = 0xb; } Entity_Player::AnimateCollectible (npc->_sirenPlayerEntity,iVar6,(byte *)"Pickup", (byte *)"PlayerPickupSparkle"); break; } } flagsHigh = flagsHigh + 1; entitySlot = entitySlot + 1; } while (flagsHigh < *(uint *)((int)local_14 + 0x1264)); } if (npc->_dead != 0) { local_14 = &npc->_pos; sirenSpawn = Game::Spawn(g_game,0x388,1,local_14,&g_vectorZero,(Entity *)0x0,0, npc->_initSeed); local_20.y = local_14->x; local_18 = (Entity_NPC *)local_14->y; room = g_game->_room; iVar6 = (int)((local_20.y - 40.0) / 40.0 + 0.5); gridRow = (int)(((float)local_18 - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (gridRow < 0)) || (room->_gridHeight <= gridRow)) { iVar6 = -1; } else { iVar6 = room->_gridWidth * gridRow + iVar6; } flagsHigh = Room::GetGridCollision(room,iVar6); if (flagsHigh == 0) { (sirenSpawn->_targetPosition).x = local_20.y; (sirenSpawn->_targetPosition).y = (float)local_18; return; } freePos = Room::FindFreePickupSpawnPosition(room,&local_20,local_14,60.0,0,0,0); fVar1 = freePos->y; (sirenSpawn->_targetPosition).x = freePos->x; (sirenSpawn->_targetPosition).y = fVar1; } } } return; } //@@ 00591460 NpcAI::ENTITY_SIREN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 904 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SIREN(Entity_NPC *npc) { Vector *position; uint *puVar1; code *pcVar2; uint3 flagsHigh; byte bVar4; uint uVar5; Entity *particle; EntityPtr siren; int extraout_ECX; void *helperData; int extraout_EDX; int *piVar6; int iVar7; int *familiarIt; float fVar8; int *local_12c; int *local_128; Vector local_120; char helperQuery [4]; undefined8 local_114; uint helperCount; Vector local_108; Vector local_100; Room *local_f8; float local_f4; int *local_f0; ProjectileParams projParams; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Familiar *charmedFamiliar; qword flags; undefined4 flagsHigh; Game *game; float posY; local_8 = 0xffffffff; puStack_c = &LAB_00af566b; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; iVar7 = npc->_variant; local_120.y = (float)npc; if (iVar7 == 0) { ExceptionList = &local_10; ENTITY_SIREN_main(npc); ExceptionList = local_10; return; } if (iVar7 == 1) { if (npc->_state == 0) { ExceptionList = &local_10; npc->_entityCollisionClass = 0; ANM2::Play(&npc->_sprite,(byte *)"Appear",0); flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_state = 3; *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb | 0x11; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } else { ExceptionList = &local_10; if (npc->_state == 3) { if (((npc->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"), bVar4 != 0)) { Entity_NPC::PlaySound(npc,499,1.0,2,0,1.0); npc->_entityCollisionClass = 4; } fVar8 = (npc->_targetPosition).y; posY = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x; (npc->_velocity).y = fVar8 - posY; } } if (npc->_dead == 0) { if (npc->_pendingDamage <= 0.0) { ExceptionList = local_10; return; } if ((npc->_pendingDamageFlags & 0x1000004) != 0) { npc->_dead = 1; } (npc->_damageEvents)._end = (npc->_damageEvents)._begin; bVar4 = npc->_dead; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; if (bVar4 == 0) { ExceptionList = local_10; return; } } position = &npc->_pos; iVar7 = 7; do { uVar5 = Random(); local_f8 = (Room *)((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 360.0 * 0.017453292); local_f4 = cos((float)local_f8); local_f0 = (int *)sin((float)local_f8); uVar5 = Random(); fVar8 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_108.y = fVar8 * (float)local_f0 * 12.0 + (npc->_pos).y; local_108.x = fVar8 * local_f4 * 12.0 + position->x; uVar5 = Random(); local_100.x = local_f4 * 5.0; local_100.y = (float)local_f0 * 5.0; particle = Game::Spawn(g_game,1000,4,&local_108,&local_100,(Entity *)0x0,0x10007,uVar5); (**(code **)(*(int *)particle + 0xc))(); iVar7 = iVar7 + -1; } while (iVar7 != 0); bVar4 = PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x198); uVar5 = npc->_initSeed; if (bVar4 != 0) { Isaac::GetRandomPickupVelocity(&local_108,position,0,(RNG *)0x0); Game::Spawn(g_game,5,0x15e,position,&local_108,(Entity *)0x0,0x8d,uVar5); ExceptionList = local_10; return; } local_114 = 0x1500000002; local_f8 = (Room *)0x9; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> 2 ^ uVar5; uVar5 = uVar5 << 0x15 ^ uVar5; GridEntity_Rock::SpawnDrops(0,uVar5 >> 9 ^ uVar5,1,7,npc); ExceptionList = local_10; return; } if (iVar7 != 10) { return; } if (npc->_state == 0) { flags = npc->_flags; npc->_state = 3; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x2008; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x44000011; return; } local_100.y = *(float *)&npc->_parent; if ((((EntityPtr)local_100.y == (EntityPtr)0x0) || (*(int *)((int)local_100.y + 0x28) != 0x388)) || (*(int *)((int)local_100.y + 0x2c) != 0)) { ExceptionList = &local_10; (**(code **)(*(int *)npc + 0x28))(local_14); ExceptionList = local_10; return; } local_f4 = 0.0; local_f8 = g_game->_room; local_f0 = (int *)0x0; local_12c = (int *)0x0; local_8 = 0; piVar6 = (int *)0x0; local_128 = (int *)0x0; ExceptionList = &local_10; Entity_NPC::QueryNPCsType(helperQuery,0x3c6,-1); local_8._0_1_ = 1; if (helperCount != 0) { uVar5 = 0; siren = (EntityPtr)local_100.y; helperData = (void *)local_114; do { local_f4 = *(float *)((int)helperData + uVar5 * 4); if (*(EntityPtr *)((int)local_f4 + 0x3bc) == siren) { charmedFamiliar = *(Entity_Familiar **)((int)local_f4 + 0x3c4); if (charmedFamiliar != (Entity_Familiar *)0x0) { if (((charmedFamiliar->_flags & 0x100) == 0) || (bVar4 = Entity_Familiar::is_detached_from_follow(charmedFamiliar), bVar4 == 0)) { LAB_0059192a: siren = (EntityPtr)local_100.y; } else { if (*(int *)(extraout_ECX + 0x410) == *(int *)((int)local_100.y + 0xf40)) { if (piVar6 == (int *)0x0) { std::vector::_Emplace_reallocate(0,&local_f4); piVar6 = local_128; goto LAB_0059192a; } *piVar6 = extraout_EDX; piVar6 = piVar6 + 1; local_128 = piVar6; } siren = (EntityPtr)local_100.y; } } helperData = (void *)local_114; } npc = (Entity_NPC *)local_120.y; local_f4 = 0.0; uVar5 = uVar5 + 1; } while (uVar5 < helperCount); local_f0 = (int *)0x0; if (piVar6 != (int *)0x0) { iVar7 = Entity::GetIntervalTicks((Entity *)local_120.y,6.0,0.0); if (iVar7 != 0) { do { local_40 = 0x3f19999a; uStack_3c = 0x3f19999a; uStack_38 = 0x3f19999a; uStack_34 = 0x3f800000; local_20 = 0.7; local_1c = 0; local_30 = 0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; local_18 = 0; (**(code **)(**(int **)(*local_12c + 0x3c4) + 0x3c))(&local_40,6,0,1,1); local_12c = local_12c + 1; } while (local_12c != piVar6); local_12c = local_f0; } if (15.0 < *(float *)((int)npc + 0x3a4)) { do { local_108.x = *(float *)(*(int *)(*local_12c + 0x3c4) + 0x33c); local_108.y = *(float *)(*(int *)(*local_12c + 0x3c4) + 0x340); bVar4 = Room::IsPositionInRoom(local_f8,&local_108,2.0); if (bVar4 == 0) { *(byte *)((int)npc + 0x173) = 1; break; } local_12c = local_12c + 1; } while (local_12c != piVar6); } flagsHigh = local_8._1_3_; if (*(byte *)((int)npc + 400) == 0) { if (*(byte *)((int)npc + 0x173) == 0) { local_8 = (uint)local_8._1_3_ << 8; if (helperQuery[0] == '\0') { local_8 = CONCAT31(flagsHigh,3); tracked_alloc(1,(void *)local_114,0); } if (local_f0 == (int *)0x0) { ExceptionList = local_10; return; } uVar5 = (int)local_f4 - (int)local_f0 & 0xfffffffc; piVar6 = local_f0; if (0xfff < uVar5) { piVar6 = (int *)local_f0[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_f0 + (-4 - (int)piVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto LAB_00591c8f; } } else { *(byte *)((int)npc + 0x173) = 1; } ProjectileParams::ProjectileParams(&projParams); Room::GetClampedPositionImpl(local_f8,&local_120,(Vector *)((int)npc + 0x33c),8.0,8.0,8.0,8.0) ; local_108.x = 8.0; fVar8 = (float)((double)((int)piVar6 - (int)local_f0 >> 2) + __uint_to_double_fixup[-((int)piVar6 - (int)local_f0 >> 0x1f)]) * 6.0; if (fVar8 <= 6.0) { fVar8 = 6.0; } if (18.0 <= fVar8) { fVar8 = 18.0; } local_108.y = (float)(int)fVar8; Entity_NPC::FireProjectiles(npc,&local_120,&local_108,9,&projParams); game = g_game; ((Vector *)((int)npc + 0x33c))->x = local_120.x; ((Vector *)((int)npc + 0x33c))->y = local_120.y; Game::ShakeScreen(game,5); familiarIt = local_f0; do { uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_30 = 0; fStack_2c = g_vectorZero.x; fStack_28 = g_vectorZero.y; fStack_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = 0; local_18 = 0; (**(code **)(*(int *)*familiarIt + 0x20))(0x447a0000,0,0,&uStack_3c,0x1e); familiarIt = familiarIt + 1; } while (familiarIt != piVar6); iVar7 = *(int *)((int)local_100.y + 0xf40); *(uint *)(iVar7 + 0x168) = *(uint *)(iVar7 + 0x168) & 0xffbfffff; *(undefined4 *)(iVar7 + 0x16c) = *(undefined4 *)(iVar7 + 0x16c); } } (**(code **)(*(int *)npc + 0x28))(); flagsHigh = local_8._1_3_; local_8 = (uint)local_8._1_3_ << 8; if (helperQuery[0] == '\0') { local_8 = CONCAT31(flagsHigh,2); tracked_alloc(1,(void *)local_114,0); } if (local_f0 == (int *)0x0) { ExceptionList = local_10; return; } uVar5 = (int)local_f4 - (int)local_f0 & 0xfffffffc; piVar6 = local_f0; if (0xfff < uVar5) { uVar5 = uVar5 + 0x23; piVar6 = (int *)local_f0[-1]; if (0x1f < (uint)((int)local_f0 + (-4 - local_f0[-1]))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_00591c8f: operator_delete(piVar6,uVar5); ExceptionList = local_10; return; } //@@ 00591cc0 NpcAI::ENTITY_SIREN_HELPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 966 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SIREN_HELPER(Entity_NPC *npc) { float fVar1; byte isAnimSet; int *colorEffect; LayerState *layer; EntityPtr targetFamiliar; int *local_44; undefined4 tintColor; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; int familiarConfig; undefined4 flagsHigh; bool isEffectFound; EntityPtr target; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; target = npc->_target; if ((target == (EntityPtr)0x0) || (*(int *)((int)target + 0x28) != 3)) { targetFamiliar = (EntityPtr)0x0; } else { targetFamiliar = target; } if (npc->_aiCallPhase != 1) { if (npc->_state != 0) { return; } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_aiCallFlags = npc->_aiCallFlags | 1; *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_state = 3; npc->_collisionDamage = 1.0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; isAnimSet = ANM2::SetAnimation(&npc->_sprite,s_Fly,1); if (((isAnimSet != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); layer->_visible = 0; if (targetFamiliar == (EntityPtr)0x0) { return; } if (*(Entity_NPC **)((int)targetFamiliar + 0xeec) != npc) { if (*(Entity_NPC **)((int)targetFamiliar + 0xeec) != (Entity_NPC *)0x0) { local_44 = (int *)((int)targetFamiliar + 0xeec); std::multiset::erase(&local_44); } *(int *)((int)targetFamiliar + 0xeec) = (int)npc; std::multiset::insert((int *)((int)targetFamiliar + 0xeec)); } familiarConfig = *(int *)((int)targetFamiliar + 0x330); local_44 = *(int **)(familiarConfig + 0x40); Entity::SetSize((Entity *)npc,*(float *)((int)targetFamiliar + 0x370), *(Vector *)(familiarConfig + 0x3c),*(int *)(familiarConfig + 0x48)); return; } if (((npc->_parent == (EntityPtr)0x0) || (targetFamiliar == (EntityPtr)0x0)) || ((npc->_flags & 0x100) != 0)) { (**(code **)(*(int *)npc + 0x28))(); return; } fVar1 = *(float *)((int)target + 0x340); (npc->_pos).x = *(float *)((int)target + 0x33c); (npc->_pos).y = fVar1; fVar1 = *(float *)((int)target + 0x364); (npc->_velocity).x = *(float *)((int)target + 0x360); (npc->_velocity).y = fVar1; npc->_friction = *(float *)((int)target + 0x36c); npc->_entityCollisionClass = -(uint)(*(int *)((int)target + 0x188) != 0) & 2; npc->_entityGridCollisionClass = *(int *)((int)target + 0x184); if (*(int *)((int)targetFamiliar + 0x224) < 2) { *(uint *)((int)targetFamiliar + 0x168) = *(uint *)((int)targetFamiliar + 0x168) | 0x100; *(int *)((int)targetFamiliar + 0x224) = 2; *(int *)((int)targetFamiliar + 0x16c) = *(int *)((int)targetFamiliar + 0x16c); if (*(int *)((int)targetFamiliar + 0x2c) != 0xdc) { isEffectFound = false; colorEffect = *(int **)((int)targetFamiliar + 0x1ac); tintColor = 0x3f800000; uStack_3c = 0x3ecccccd; uStack_38 = 0x3ecccccd; uStack_34 = 0x3f800000; local_20 = 0.18; local_1c = 0x3d23d70a; local_30 = 0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; local_18 = 0x3d23d70a; if (colorEffect != *(int **)((int)targetFamiliar + 0x1b0)) { do { if (*colorEffect == 0x105) { colorEffect[0xd] = *(int *)((int)targetFamiliar + 0x224); colorEffect[0xc] = *(int *)((int)targetFamiliar + 0x224); isEffectFound = true; } colorEffect = colorEffect + 0xf; } while (colorEffect != *(int **)((int)targetFamiliar + 0x1b0)); if (isEffectFound) goto LAB_00591e56; } (**(code **)(*(int *)targetFamiliar + 0x3c)) (&tintColor,*(int *)((int)targetFamiliar + 0x224),0x105,0,1); } } LAB_00591e56: if (0.0 < npc->_pendingDamage) { tintColor = 0x3f000000; uStack_3c = 0x3f000000; uStack_38 = 0x3f000000; uStack_34 = 0x3f800000; local_20 = 0.784; local_1c = 0; local_18 = 0; local_30 = 0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; (**(code **)(*(int *)targetFamiliar + 0x3c))(&tintColor,1,0,0,1); } if ((npc->_dead == 0) || (*(int *)((int)targetFamiliar + 0x2c) != 0xce)) { return; } uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_30 = 0; fStack_2c = g_vectorZero.x; fStack_28 = g_vectorZero.y; fStack_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = 0; local_18 = 0; (**(code **)(*(int *)targetFamiliar + 0x24))(&uStack_3c); return; } //@@ 00592050 NpcHelper::siren_familiar_orbit /* DB: ? ECX = Siren (type 904, spawner of the familiar's player, flag 0x400000), param = charmed familiar: counts detached familiars in the follow chain, sets the familiar's velocity toward a slot on a 90-unit circle around the Siren (angle by index plus +0x334 * 3.5); only caller Entity_Familiar::FollowParent */ void NpcHelper::siren_familiar_orbit(int param_1) { int iVar1; Entity_Familiar *pEVar2; int iVar3; byte bVar4; int in_ECX; int extraout_ECX; int extraout_ECX_00; int iVar5; int extraout_EDX; int extraout_EDX_00; int iVar6; int iVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; iVar1 = *(int *)(in_ECX + 0xf40); if (iVar1 != 0) { iVar6 = iVar1; if (*(int *)(in_ECX + 0x3c0) != 0) { iVar6 = *(int *)(in_ECX + 0x3c0); } iVar5 = 0; iVar7 = 0; pEVar2 = *(Entity_Familiar **)(param_1 + 0x3bc); if (pEVar2 != (Entity_Familiar *)0x0) { iVar3 = pEVar2->_type; while (iVar3 == 3) { bVar4 = Entity_Familiar::is_detached_from_follow(pEVar2); if (bVar4 != 0) { iVar7 = iVar7 + 1; } pEVar2 = *(Entity_Familiar **)(extraout_ECX + 0x3bc); iVar5 = extraout_EDX; if (pEVar2 == (Entity_Familiar *)0x0) break; iVar3 = pEVar2->_type; } } pEVar2 = *(Entity_Familiar **)(param_1 + 0x3c0); if (pEVar2 != (Entity_Familiar *)0x0) { iVar3 = pEVar2->_type; while (iVar3 == 3) { bVar4 = Entity_Familiar::is_detached_from_follow(pEVar2); iVar5 = extraout_EDX_00; if (bVar4 != 0) { iVar5 = extraout_EDX_00 + 1; } pEVar2 = *(Entity_Familiar **)(extraout_ECX_00 + 0x3c0); if (pEVar2 == (Entity_Familiar *)0x0) break; iVar3 = pEVar2->_type; } } fVar11 = (((float)iVar5 * 360.0) / (float)(iVar5 + 1 + iVar7) + *(float *)(iVar1 + 0x334) * 3.5) * 0.017453292; fVar8 = cos(fVar11); fVar9 = (fVar8 * 90.0 + *(float *)(iVar6 + 0x33c)) - *(float *)(param_1 + 0x33c); fVar8 = sin(fVar11); fVar12 = (fVar8 * 90.0 + *(float *)(iVar6 + 0x340)) - *(float *)(param_1 + 0x340); fVar10 = sqrtf(fVar12 * fVar12 + fVar9 * fVar9); fVar8 = g_vectorZero.y; fVar11 = g_vectorZero.x; if (20.0 < fVar10) { fVar10 = ((fVar10 - 20.0) * 0.1) / fVar10; fVar11 = g_vectorZero.x + fVar9 * fVar10; fVar8 = g_vectorZero.y + fVar12 * fVar10; } fVar9 = *(float *)(iVar6 + 0x360); *(float *)(param_1 + 0x364) = fVar8 + *(float *)(iVar6 + 0x364); *(float *)(param_1 + 0x360) = fVar9 + fVar11; } return; } //@@ 00592200 BitSet128::__bnot /* ZHL [lua] Lua binding BitSet128:__bnot prototype: db/protos.zhl, confirmed by RET 4 */ BitSet128 * __thiscall BitSet128::__bnot(BitSet128 *this,BitSet128 *out) { uint uVar1; qword qVar2; qword qVar3; qVar2 = this->_l; *(uint *)((int)&out->_l + 4) = ~*(uint *)((int)&this->_l + 4); qVar3 = this->_h; uVar1 = *(uint *)((int)&this->_h + 4); *(uint *)&out->_l = ~(uint)qVar2; *(uint *)&out->_h = ~(uint)qVar3; *(uint *)((int)&out->_h + 4) = ~uVar1; return out; } //@@ 00592230 BitSet128::IsZero /* DB: true if all four dwords zero prototype: db/protos.zhl */ byte __thiscall BitSet128::IsZero(BitSet128 *this) { if (((int)this->_l == 0 && *(int *)((int)&this->_l + 4) == 0) && ((int)this->_h == 0 && *(int *)((int)&this->_h + 4) == 0)) { return 1; } return 0; } //@@ 00592250 Entity::SortingLayer /* ZHL [lua] Lua binding Entity:SortingLayer */ int __thiscall Entity::SortingLayer(Entity *this) { return this->_sortingLayer; } //@@ 00592260 BeastArena::get_scroll_speed /* DB: movss xmm0,[ecx+0x120] (Room+0x788c) (beast.md) */ void BeastArena::get_scroll_speed(void) { return; } //@@ 00592270 Room::get_beast_arena /* DB: lea eax,[ecx+0x776c]; callers in Entity_Effect::Update (beast.md) */ int Room::get_beast_arena(void) { int in_ECX; return in_ECX + 0x776c; } //@@ 00592280 NpcAI::ENTITY_BEAST_spawn_background /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: only caller ENTITY_BEAST state 0 in room variant 666; spawns 951.100 at (room centre x, bottom-58) and 951.101-104 at fixed offsets into the deque at npc+0xbf4 (beast.md) */ void __fastcall NpcAI::ENTITY_BEAST_spawn_background(Entity_NPC *npc) { undefined4 *puVar1; void *pvVar2; int iVar3; uint uVar4; Entity *pEVar5; uint uVar6; uint uVar7; Vector local_48; Vector local_40; Entity_NPC *local_38; undefined4 *local_30; Entity *local_2c; float local_28 [8]; float local_8; local_8 = (float)(__security_cookie ^ (uint)(local_28 + 9)); pvVar2 = g_game->_room; local_2c = *(Entity **)((int)pvVar2 + 0x14); local_48.y = *(float *)((int)pvVar2 + 0x1c); local_30 = *(undefined4 **)((int)pvVar2 + 0x20); local_38 = npc; Entity_NPC::ClearDequeRefs(npc); local_40.y = 0.0; std::deque::resize(5,&local_40.y); uVar4 = Random(); local_40.x = (local_48.y + (float)local_2c) * 0.5; local_40.y = (float)local_30 - 58.0; pEVar5 = Game::Spawn(g_game,0x3b7,100,&local_40,&g_vectorZero,(Entity *)npc,0,uVar4); local_2c = pEVar5; (**(code **)(*(int *)pEVar5 + 0xc))(); uVar4 = (npc->_entityDeque)._offset; uVar6 = uVar4 & 3; iVar3 = *(int *)((int)(npc->_entityDeque)._map + ((npc->_entityDeque)._mapSize - 1 & uVar4 >> 2) * 4); puVar1 = (undefined4 *)(iVar3 + uVar6 * 4); if (*(int *)(iVar3 + uVar6 * 4) != 0) { local_30 = puVar1; std::multiset::erase(&local_30); } *puVar1 = pEVar5; std::multiset::insert(puVar1); uVar4 = 0; local_28[0] = -150.0; local_28[1] = -140.0; local_28[2] = -50.0; local_28[3] = -200.0; local_28[4] = 50.0; local_28[5] = -200.0; local_28[6] = 150.0; local_28[7] = -140.0; do { uVar6 = Random(); local_48.x = (pEVar5->_pos).x + local_28[uVar4 * 2]; local_48.y = (pEVar5->_pos).y + local_28[uVar4 * 2 + 1]; pEVar5 = Game::Spawn(g_game,0x3b7,uVar4 + 0x65,&local_48,&g_vectorZero,(Entity *)local_38,0, uVar6); (**(code **)(*(int *)pEVar5 + 0xc))(); local_30 = (undefined4 *)(local_38->_entityDeque)._offset; uVar6 = (int)local_30 + uVar4 + 1; uVar7 = uVar6 & 3; iVar3 = *(int *)((int)(npc->_entityDeque)._map + (uVar6 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); puVar1 = (undefined4 *)(iVar3 + uVar7 * 4); if (*(int *)(iVar3 + uVar7 * 4) != 0) { local_30 = puVar1; std::multiset::erase(&local_30); } *puVar1 = pEVar5; std::multiset::insert(puVar1); uVar4 = uVar4 + 1; pEVar5 = local_2c; } while (uVar4 < 4); return; } //@@ 00592460 NpcAI::ENTITY_BEAST /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: 951.0 (dispatcher default case); BGIdle/BlastLoop/Blink/DeathRay */ void __fastcall NpcAI::ENTITY_BEAST(Entity_NPC *npc) { byte bVar1; ColorMod *color; ColorMod *color_00; LayerState *layer; int iVar2; Vector *pVVar3; int iVar4; int *piVar5; undefined4 *puVar6; void *pvVar7; BitSet128 *maskedFlags; float *pfVar8; int extraout_EAX; EntityRef *pEVar9; uint uVar10; uint uVar11; Entity *spawned; Entity *pEVar12; Game *game; float fVar13; float extraout_ECX; float extraout_ECX_00; float extraout_ECX_01; MusicManager *musicManager; Sprite *extraout_EDX; Sprite *sprite; int extraout_EDX_00; int extraout_EDX_01; Entity_NPC *pEVar14; Room *curRoom; ANM2 *targetSprite; bool bVar15; float fVar16; float fVar17; float fVar18; float fVar19; double dVar20; Vector *spriteOffset; uint subType; ColorMod *color_01; EntityRef damageSource; EntityRef local_308; EntityRef local_2e0; EntityRef local_2b8; EntityRef local_290; BitSet128 local_268; BitSet128 local_258; BitSet128 local_248; BitSet128 local_238; int local_228; Vector local_220; int *local_218; float spawnY; EntityList_EL beastPartList; Vector local_200; undefined1 local_1f8 [8]; Vector VStack_1f0; float local_1e8; float roomLeft; Vector local_1e0; int *local_1d8; Entity_NPC *local_1d4; float local_1d0; float local_1cc; float local_1c8; float local_1c4; float local_1c0; float local_1bc; float elapsedFrames; Vector local_1b4; int *local_1ac; Room *room; int *local_1a4; ProjectileParams bigShotParams; undefined1 local_108; ProjectileParams shotParams; undefined1 local_60; Color tmpColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; char *animName; undefined4 flagsHigh; Manager *manager; qword oldFlags; code *vfn; game = g_game; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af56c6; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&tmpColor)[1]._colorize + 1); iVar2 = npc->_aiCallPhase; local_1d4 = npc; if (iVar2 == 3) { pvVar7 = npc->_collisionEntity; if (*(int *)((int)pvVar7 + 0x28) != 0x3b7) { return; } if (*(int *)((int)pvVar7 + 0x2c) != 1) { return; } if (*(int *)((int)pvVar7 + 0x30) != 3) { ExceptionList = &local_1c; *(undefined4 *)((int)pvVar7 + 0xb64) = 5; *(uint *)((int)pvVar7 + 3000) = *(uint *)((int)game->_room + 0x788c) ^ 0x80000000; *(undefined4 *)((int)pvVar7 + 0xbbc) = 0xc1000000; npc->_collisionResult = 0; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; Game::ShakeScreen(game,10); *(float *)((int)g_game->_room + 0x788c) = *(float *)((int)g_game->_room + 0x788c) * 0.9; } npc->_collisionResult = 0; ExceptionList = local_1c; return; } if (iVar2 == 1) { if (npc->_state != 0x12) { return; } iVar2 = *(int *)((int)g_game->_room + 0x11f8); ExceptionList = &local_1c; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; if (*(char *)(iVar2 + 0x8c) == '\0') { puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; ring_buffer_push((void *)(iVar2 + 0x50),&npc->_pos); game = g_game; *(undefined1 *)(iVar2 + 0x8c) = 1; } local_1d4 = (Entity_NPC *)&(npc->_sprite)._animState; *(float *)((int)game->_room + 0x788c) = *(float *)((int)game->_room + 0x788c) * 0.95; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered((AnimationState *)local_1d4,(byte *)"Sound1"); manager = g_manager; if (bVar1 != 0) { local_1ac = (int *)0x2b9; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.0,0.0); local_1d4 = (Entity_NPC *)&(npc->_sprite)._animState; } if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound2"); manager = g_manager; if (bVar1 != 0) { local_1ac = (int *)0x2db; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.0,0.0); } pEVar14 = local_1d4; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered((AnimationState *)local_1d4,(byte *)"Sound3"); manager = g_manager; if (bVar1 == 0) goto LAB_00592705; local_1ac = (int *)0x2dc; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.0,0.0); } } } pEVar14 = local_1d4; LAB_00592705: if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar1 = AnimationState::WasEventTriggered((AnimationState *)pEVar14,(byte *)"Sound3"); if (bVar1 != 0) { Game::ShakeScreen(g_game,10); } if ((npc->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } bVar1 = AnimationState::IsEventTriggered((AnimationState *)pEVar14,(byte *)"Shoot"); if (bVar1 == 0) { ExceptionList = local_1c; return; } BossOverlay::play(4); ExceptionList = local_1c; return; } if ((iVar2 == 4) || (iVar2 == 2)) { fVar13 = (npc->_targetPosition).x; if ((fVar13 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { return; } local_1b4.y = (npc->_pos).x; local_1ac = (int *)0x41000000; local_1cc = (fVar13 - local_1b4.y) * 0.06; local_1bc = ((npc->_targetPosition).y - (npc->_pos).y) * 0.06; if (0 < npc->_i2) { local_1ac = (int *)0x41400000; local_1cc = local_1cc + local_1cc; local_1bc = local_1bc + local_1bc; } if (npc->_state == 0xb) { local_1ac = (int *)0x41700000; } ExceptionList = &local_1c; fVar13 = sqrtf(local_1cc * local_1cc + local_1bc * local_1bc); if (((float)local_1ac < fVar13) && (0.0 < fVar13)) { local_1cc = local_1cc * ((float)local_1ac / fVar13); local_1bc = local_1bc * ((float)local_1ac / fVar13); } if (iVar2 == 2) { local_1cc = local_1cc * 0.5; local_1bc = local_1bc * 0.5; } (npc->_pos).y = local_1bc + (npc->_pos).y; (npc->_pos).x = local_1b4.y + local_1cc; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; ExceptionList = local_1c; return; } room = g_game->_room; roomLeft = (room->_topLeftPos).x; local_1bc = (room->_topLeftPos).y; local_1a4 = (int *)npc->_health; local_1c0 = (room->_bottomRightPos).x; local_1cc = (room->_bottomRightPos).y; local_1e8 = npc->_maxHitPoints; fVar13 = (float)((int)npc->_updateTime - (int)npc->_prevUpdateTime); ExceptionList = &local_1c; elapsedFrames = fVar13; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; if (local_1e8 == 0.0) { puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar13 = extraout_ECX; } fVar17 = ((float)local_1a4 - 0.0) / (local_1e8 - 0.0); if (fVar17 <= 0.0) { fVar17 = 0.0; } if (1.0 <= fVar17) { fVar17 = 1.0; } local_1c4 = (float)(int)(2.999 - fVar17 * 2.999); if (local_1c4 == 2.8026e-45) { local_1e8 = npc->_maxHitPoints * 0.3333; local_1a4 = (int *)npc->_health; if (local_1e8 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar13 = extraout_ECX_00; } fVar17 = ((float)local_1a4 - 0.0) / (local_1e8 - 0.0); if (fVar17 <= 0.0) { fVar17 = 0.0; } if (1.0 <= fVar17) { fVar17 = 1.0; } local_1c4 = (float)(int)(5.999 - fVar17 * 3.999); } manager = g_manager; if (npc->_projectileDelay < (int)local_1c4) { if (1 < (int)local_1c4) { if (npc->_projectileDelay < 2) { local_1ac = (int *)0x8d; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.0,0.0); manager = g_manager; local_1ac = (int *)0x32f; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.0,0.0); Color::Color(&tmpColor); local_1b4.x = (npc->_pos).x + 0.0; local_1b4.y = (npc->_pos).y - 120.0; local_1a4 = (int *)0x2001; spawn_gibs(&local_1b4,10,40.0,(uint *)&local_1a4,(Entity *)npc,color,&g_vectorZero,1.0); ANM2::Play(&npc->_sprite,(byte *)"TransitionDive",0); game = g_game; npc->_state = 5; local_1d0 = 0.0; local_1a4 = game->_room; fVar13 = local_1d0; if (local_1a4[0x499] != 0) { do { local_1ac = *(int **)(local_1a4[0x497] + (int)local_1d0 * 4); iVar2 = local_1ac[10]; if ((iVar2 == 0x3b7) && (local_1ac[0xb] == 1)) { bVar15 = true; } else { bVar15 = false; } if (bVar15) { vfn = *(code **)(*local_1ac + 0x24); EntityRef::constructor(&local_290,(Entity *)npc); (*vfn)(&local_290); } else { if ((iVar2 == 0x3b7) && (local_1ac[0xb] == 3)) { bVar15 = true; } else { bVar15 = false; } if (bVar15) { vfn = *(code **)(*local_1ac + 0x24); EntityRef::constructor(&local_2b8,(Entity *)npc); (*vfn)(&local_2b8); } else if (((iVar2 == 9) || (iVar2 == 7)) && (local_1ac[0xd] == 0x3b7)) { *(undefined1 *)((int)local_1ac + 0x173) = 1; } } fVar13 = (float)((int)local_1d0 + 1); local_1d0 = fVar13; } while ((uint)fVar13 < (uint)local_1a4[0x499]); } } } if (2 < (int)local_1c4) { if (local_1c4 == 4.2039e-45) { animName = "Damage1"; LAB_00592b43: ANM2::Play(&npc->_sprite,(byte *)animName,0); } else { if (local_1c4 == 5.60519e-45) { animName = "Damage2"; goto LAB_00592b43; } if (local_1c4 == 7.00649e-45) { animName = "Damage3"; goto LAB_00592b43; } } manager = g_manager; local_1ac = (int *)0x8d; seed_fart_sound_override((int *)&local_1ac); SoundEffects::Play(&manager->_sfxManager,(int)local_1ac,1.0,2,0,1.0,0.0); Color::Color(&tmpColor); local_1b4.x = (npc->_pos).x + 0.0; local_1b4.y = (npc->_pos).y - 120.0; local_1a4 = (int *)0x2001; spawn_gibs(&local_1b4,10,40.0,(uint *)&local_1a4,(Entity *)npc,color_00,&g_vectorZero,1.0); Game::ShakeScreen(g_game,0xf); *(float *)((int)g_game->_room + 0x788c) = *(float *)((int)g_game->_room + 0x788c) * 0.8; fVar13 = extraout_ECX_01; } npc->_projectileDelay = (int)local_1c4; } if (npc->_dead != 0) { BlendMode::SetMode(&local_238,2,(int)fVar13); layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000009); layer->_blendMode[0] = (int)local_238._l; layer->_blendMode[1] = local_238._l._4_4_; layer->_blendMode[2] = (int)local_238._h; layer->_blendMode[3] = local_238._h._4_4_; layer->_blendMode[4] = local_228; layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000009); layer->_wrapSMode = 1; layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000009); layer->_wrapTMode = 1; ANM2::PlayOverlay(&npc->_sprite,(byte *)"DeathRay",0); local_1d0 = 0.0; local_1a4 = g_game->_room; if (local_1a4[0x499] != 0) { do { local_1ac = *(int **)(local_1a4[0x497] + (int)local_1d0 * 4); iVar2 = local_1ac[10]; if ((iVar2 == 0x3b7) && (local_1ac[0xb] == 1)) { bVar15 = true; } else { bVar15 = false; } if (bVar15) { vfn = *(code **)(*local_1ac + 0x24); EntityRef::constructor(&local_2e0,(Entity *)npc); (*vfn)(&local_2e0); } else { if ((iVar2 == 0x3b7) && (local_1ac[0xb] == 3)) { bVar15 = true; } else { bVar15 = false; } if (bVar15) { vfn = *(code **)(*local_1ac + 0x24); EntityRef::constructor(&local_308,(Entity *)npc); (*vfn)(&local_308); } else if (((iVar2 == 9) || (iVar2 == 7)) && (local_1ac[0xd] == 0x3b7)) { *(undefined1 *)((int)local_1ac + 0x173) = 1; } } local_1d0 = (float)((int)local_1d0 + 1); } while ((uint)local_1d0 < (uint)local_1a4[0x499]); } } fVar13 = local_1c4; manager = g_manager; switch(npc->_state) { case 0: (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_aiCallFlags = 0xf; uVar10 = Random(); npc->_i2 = 0; npc->_projectileDelay = 0; oldFlags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); game = g_game; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x44000000; npc->_projectileCooldown = uVar10 % 0x3c + 0x1e; if (*(int *)(*(int *)(*(int *)((int)game->_room + 4) + 0x10) + 0xc) == 0x29a) { ANM2::Play(&npc->_sprite,(byte *)"BGIdle",1); flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x80000000; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_entityCollisionClass = 0; npc->_visible = 0; npc->_isInvicible = 1; npc->_state = 0x10; npc->_stateFrame = 0x1e; ENTITY_BEAST_spawn_background(npc); } else { ANM2::Play(&npc->_sprite,s_Idle,1); musicManager = &g_manager->_musicManager; npc->_state = 3; musicManager->_channels[musicManager->_currentChannel]._enabledLayers = 0; MusicManager::EnableLayer(musicManager,3,0); } layer = ANM2::GetLayer(&npc->_sprite,&DAT_00000009); layer->_bitflags = layer->_bitflags | 1; break; case 3: iVar2 = npc->_projectileCooldown; if (0 < iVar2) { iVar4 = iVar2 - (int)elapsedFrames; iVar2 = 0; if (0 < iVar4) { iVar2 = iVar4; } npc->_projectileCooldown = iVar2; } if (npc->_stateFrame < 0x3d) { npc->_stateFrame = npc->_stateFrame + (int)elapsedFrames; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (iVar2 < 1) { ANM2::Play(&npc->_sprite,(byte *)"Blink",1); uVar10 = Random(); npc->_projectileCooldown = uVar10 % 0x3c + 0x1e; } else { ANM2::Play(&npc->_sprite,s_Idle,1); } } break; } iVar2 = npc->_i1; if (iVar2 == 0) { ANM2::Play(&npc->_sprite,(byte *)"MoveStart",0); npc->_state = 4; npc->_stateFrame = 0; uVar10 = Random(); npc->_i1 = npc->_i1 + 1; npc->_i2 = (int)fVar13; npc->_projectileCooldown = uVar10 % 0x14 + 0x1e; Entity_NPC::QueryNPCsType(&beastPartList,0x3b7,1); piVar5 = (int *)0x0; local_14 = 0.0; if ((int *)beastPartList._size != (int *)0x0) { do { (**(code **)(**(int **)((int)beastPartList._data + (int)piVar5 * 4) + 0x28))(); piVar5 = (int *)((int)piVar5 + 1); } while (piVar5 < (uint)beastPartList._size); npc = local_1d4; } (npc->_v1).x = 0.0; local_14 = -NAN; EntityList_Query::~EntityList_Query(&beastPartList); break; } if (iVar2 == 1) { uVar10 = Random(); uVar10 = uVar10 % 3; if (uVar10 == 0) { ANM2::Play(&npc->_sprite,(byte *)"SuckStart",0); npc->_i1 = npc->_i1 + 1; npc->_state = 8; } else if (uVar10 == 1) { ANM2::Play(&npc->_sprite,(byte *)"DoubleShot",0); npc->_i1 = npc->_i1 + 1; npc->_state = 10; } else { if (uVar10 != 2) break; ANM2::Play(&npc->_sprite,(byte *)"SoulCall",0); npc->_i1 = npc->_i1 + 1; npc->_state = 0xd; } } else { if (iVar2 != 2) break; if (npc->_i2 == 0) { ANM2::Play(&npc->_sprite,(byte *)"MoveStart",0); play_sound_with_fart_seed(0x2c9,1.0,2,0,1.0); npc->_state = 0xb; npc->_i1 = 0; } else { ANM2::Play(&npc->_sprite,&DAT_00b1d33c,0); npc->_state = 6; npc->_i1 = 0; } } LAB_00595ea4: npc->_stateFrame = 0; break; case 4: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { if (local_1c4 == 4.2039e-45) { animName = "MoveLoopDamage1"; } else if (local_1c4 == 5.60519e-45) { animName = "MoveLoopDamage2"; } else if (local_1c4 == 7.00649e-45) { animName = "MoveLoopDamage3"; } else { animName = "MoveLoop"; } ANM2::Play(&npc->_sprite,(byte *)animName,0); } sprite = (Sprite *)&npc->_sprite; iVar2 = npc->_projectileCooldown; if (0 < iVar2) { bVar1 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState); sprite = extraout_EDX; if (bVar1 != 0) { iVar2 = iVar2 - (int)elapsedFrames; iVar4 = 0; if (0 < iVar2) { iVar4 = iVar2; } npc->_projectileCooldown = iVar4; } } bVar1 = Sprite::IsEventTriggered(sprite,"Shoot"); if (bVar1 != 0) { npc->_entityCollisionClass = 4; } bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar1 != 0) || (bVar1 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), bVar1 != 0)) { fVar13 = 7.0; if (npc->_i2 == 2) { fVar13 = 7.5; } if ((npc->_sprite)._flipX == 0) { fVar17 = room->_beastBlastForce + 0.2; if (fVar13 <= fVar17) { fVar17 = fVar13; } } else { fVar17 = room->_beastBlastForce - 0.2; if (fVar17 <= -fVar13) { fVar17 = -fVar13; } } room->_beastBlastForce = fVar17; fVar13 = (npc->_v1).x - ABS(fVar17); (npc->_v1).x = fVar13; if (fVar13 <= 0.0) { if ((npc->_sprite)._flipX == 0) { local_1c0 = (roomLeft - 100.0) - fVar13; } else { local_1c0 = local_1c0 + 100.0 + fVar13; } uVar10 = Random(); if ((uVar10 % 3 == 0) && (npc->_i2 != 2)) { uVar10 = Random(); local_1ac = (int *)((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0); uVar10 = Random(); local_1b4.x = local_1c0; local_1b4.y = (local_1bc - 55.0) + (float)local_1ac; spawned = Game::Spawn(g_game,0x3b7,1,&local_1b4,&g_vectorZero,(Entity *)npc,0,uVar10); (**(code **)(*(int *)spawned + 0xc))(); uVar10 = Random(); local_1b4.x = local_1c0; local_1b4.y = local_1cc + 55.0 + (float)local_1ac; spawned = Game::Spawn(g_game,0x3b7,1,&local_1b4,&g_vectorZero,(Entity *)npc,1,uVar10); (**(code **)(*(int *)spawned + 0xc))(); } else { uVar10 = Random(); if ((uVar10 & 1) == 0) { uVar10 = Random(); uVar11 = Random(); local_1b4.x = local_1c0; subType = 1; local_1b4.y = (local_1cc + 20.0) - (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 60.0; } else if ((npc->_i2 == 1) && (uVar10 = Random(), (uVar10 & 1) == 0)) { uVar10 = Random(); uVar11 = Random(); local_1b4.x = local_1c0; subType = 2; local_1b4.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 60.0 + (local_1bc - 20.0); } else { uVar10 = Random(); uVar11 = Random(); local_1b4.x = local_1c0; subType = 0; local_1b4.y = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 60.0 + (local_1bc - 20.0); } local_1c0 = local_1b4.x; spawned = Game::Spawn(g_game,0x3b7,1,&local_1b4,&g_vectorZero,(Entity *)npc,subType,uVar10 ); (**(code **)(*(int *)spawned + 0xc))(); } if ((npc->_i2 == 2) || (npc->_i2 == 1)) { uVar10 = Random(); fVar13 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 60.0 + 150.0; } else { uVar10 = Random(); fVar13 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 60.0 + 200.0; } (npc->_v1).x = fVar13 + (npc->_v1).x; } } if (npc->_stateFrame % 0x3c == 0) { play_sound_with_fart_seed(0x330,1.0,2,0,1.0); } if ((npc->_i2 != 2) && (0xef < npc->_stateFrame)) { npc->_state = 3; ANM2::Play(&npc->_sprite,(byte *)"MoveEnd",0); goto LAB_00595ea4; } npc->_stateFrame = npc->_stateFrame + (int)elapsedFrames; break; case 5: case 6: bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { npc->_entityCollisionClass = 0; } bVar1 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar1 != 0) { iVar2 = npc->_state; (npc->_v1).x = 60.0; (npc->_v1).y = 0.0; if (iVar2 != 5) { npc->_state = 7; uVar10 = Random(); local_1b4.y = roomLeft + 20.0; uVar11 = Random(); local_1e0.x = ((local_1c0 - 20.0) - local_1b4.y) * (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 + local_1b4.y; local_1e0.y = local_1cc; spawned = Game::Spawn(g_game,1000,0xb5,&local_1e0,&g_vectorZero,(Entity *)npc,2,uVar10); iVar2 = *(int *)spawned; targetSprite = &spawned[1]._sprite; (targetSprite->_filename)._buf[8] = '<'; (targetSprite->_filename)._buf[9] = '\0'; (targetSprite->_filename)._buf[10] = '\0'; (targetSprite->_filename)._buf[0xb] = '\0'; targetSprite = &spawned[1]._sprite; (targetSprite->_filename)._buf[0xc] = '<'; (targetSprite->_filename)._buf[0xd] = '\0'; (targetSprite->_filename)._buf[0xe] = '\0'; (targetSprite->_filename)._buf[0xf] = '\0'; (**(code **)(iVar2 + 0xc))(); curRoom = room; local_1e0.x = (spawned->_pos).x; local_1e0.y = (spawned->_pos).y; Room::RaiseGridPathAtPos(room,&local_1e0,900); bVar1 = (npc->_sprite)._flipX; if (bVar1 == 0) { fVar13 = roomLeft + 120.0; } else { fVar13 = local_1c0 - 120.0; } (npc->_targetPosition).x = fVar13; (npc->_sprite)._flipX = bVar1 == 0; goto LAB_00595eb4; } ANM2::Play(&npc->_sprite,(byte *)"TransitionSurface",0); bVar1 = (npc->_sprite)._flipX; (npc->_v1).y = (float)&DAT_bf800000; npc->_stateFrame = 0; if (bVar1 == 0) { fVar13 = roomLeft + 120.0; } else { fVar13 = local_1c0 - 120.0; } (npc->_targetPosition).x = fVar13; (npc->_pos).x = fVar13; npc->_state = 4; (npc->_sprite)._flipX = bVar1 == 0; npc->_i1 = 0; npc->_i2 = 2; (npc->_v1).x = 120.0; } break; case 7: case 0xc: fVar13 = (npc->_v1).y; if (fVar13 < 0.0) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { if ((npc->_v1).y == -2.0) { play_sound_with_fart_seed(0x2c8,1.0,2,0,1.0); } else { play_sound_with_fart_seed(0x2c2,1.0,2,0,1.0); npc->_entityCollisionClass = 4; ProjectileParams::ProjectileParams(&shotParams); shotParams.Variant = 0xe; iVar2 = 0; local_60 = 1; do { uVar10 = Random(); local_1b4.y = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 50.0 - 100.0) * 0.017453292; local_1c8 = cos(local_1b4.y); fVar13 = sin(local_1b4.y); VStack_1f0.y = (local_1c8 * 0.0 + fVar13) * ((float)iVar2 + 10.0); VStack_1f0.x = (local_1c8 - fVar13 * 0.0) * ((float)iVar2 + 10.0); if ((npc->_sprite)._flipX == 0) { VStack_1f0.x = -VStack_1f0.x; } local_1b4.y = (npc->_pos).x; local_1c8 = (room->_bottomRightPos).y; uVar10 = Random(); shotParams.Scale = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8; local_1e0.x = VStack_1f0.x * 3.0 + local_1b4.y; local_1e0.y = VStack_1f0.y * 3.0 + (local_1c8 - 30.0); Entity_NPC::FireProjectiles(npc,&local_1e0,&VStack_1f0,0,&shotParams); iVar2 = iVar2 + 1; *(undefined4 *)(extraout_EAX + 0x30) = 1; } while (iVar2 < 8); } Game::ShakeScreen(g_game,0xe); } bVar1 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&npc->_sprite,s_Idle,1); } iVar2 = npc->_stateFrame + (int)elapsedFrames; npc->_stateFrame = iVar2; curRoom = room; if (0x5a < iVar2) { iVar2 = 0; if ((npc->_v1).y == -2.0) { iVar2 = 0x2d; } npc->_stateFrame = iVar2; npc->_state = 3; } goto LAB_00595eb4; } if (fVar13 == 0.0) { Game::ShakeScreen(g_game,(int)((60.0 - (npc->_v1).x) * 0.125)); } local_1d0 = 0.0; fVar13 = elapsedFrames; if (0 < (int)elapsedFrames) { do { fVar17 = (npc->_v1).x - 1.0; (npc->_v1).x = fVar17; if (0.0 < fVar17) { LAB_00595371: curRoom = room; } else { fVar18 = (npc->_v1).y + 1.0; (npc->_v1).y = fVar18; fVar17 = 30.0 - (fVar18 + fVar18); if (fVar17 <= 12.0) { fVar17 = 12.0; } (npc->_v1).x = fVar17; if (fVar18 == 30.0) { (npc->_v1).x = 60.0; goto LAB_00595371; } if (fVar18 == 31.0) { ANM2::Play(&npc->_sprite,(byte *)"Surface",0); (npc->_v1).y = (float)&DAT_bf800000; goto LAB_00595ea4; } local_1a4 = (int *)(roomLeft + 20.0); uVar10 = Random(); curRoom = room; local_1b4.y = (local_1c0 - 20.0) - (float)local_1a4; VStack_1f0.x = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * local_1b4.y + (float)local_1a4; VStack_1f0.y = local_1cc - 20.0; local_1ac = (int *)VStack_1f0.y; local_1e8 = (float)Room::GetGridPathFromPos(room,&VStack_1f0); iVar2 = 0; do { if (local_1e8 == 0.0) break; uVar10 = Random(); local_1e0.x = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * local_1b4.y + (float)local_1a4; local_1e0.y = (float)local_1ac; local_1c8 = local_1e0.x; fVar13 = (float)Room::GetGridPathFromPos(curRoom,&local_1e0); if ((int)fVar13 < (int)local_1e8) { VStack_1f0.x = local_1c8; VStack_1f0.y = (float)local_1ac; local_1e8 = fVar13; } iVar2 = iVar2 + 1; } while (iVar2 < 0x14); uVar10 = Random(); npc = local_1d4; spawned = Game::Spawn(g_game,1000,0xb5,&VStack_1f0,&g_vectorZero,(Entity *)local_1d4,2, uVar10); iVar2 = *(int *)spawned; targetSprite = &spawned[1]._sprite; (targetSprite->_filename)._buf[8] = '\x1e'; (targetSprite->_filename)._buf[9] = '\0'; (targetSprite->_filename)._buf[10] = '\0'; (targetSprite->_filename)._buf[0xb] = '\0'; targetSprite = &spawned[1]._sprite; (targetSprite->_filename)._buf[0xc] = '\x1e'; (targetSprite->_filename)._buf[0xd] = '\0'; (targetSprite->_filename)._buf[0xe] = '\0'; (targetSprite->_filename)._buf[0xf] = '\0'; (**(code **)(iVar2 + 0xc))(); curRoom = room; local_200.y = (spawned->_pos).y; local_200.x = (spawned->_pos).x; Room::RaiseGridPathAtPos(room,&local_200,900); fVar13 = elapsedFrames; } local_1d0 = (float)((int)local_1d0 + 1); } while ((int)local_1d0 < (int)fVar13); goto LAB_00595eb4; } break; case 8: local_1a4 = (int *)SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x2c1); if (((float)local_1a4 < 1.0) && (0.0 < (float)local_1a4)) { SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x2c1,(float)local_1a4 + 0.05,1.0); } bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"SuckStart"); if ((bVar1 != 0) && (bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"), bVar1 != 0)) { play_sound_with_fart_seed(0x2c6,1.0,2,0,1.0); SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x2c1,0.05,1.0); } bVar1 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&npc->_sprite,(byte *)"SuckLoop",0); } local_1cc = 0.0; if (0 < (int)elapsedFrames) { local_218 = (int *)0x3; fVar13 = elapsedFrames; do { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if ((bVar1 != 0) || ((pvVar7 = (npc->_sprite)._animState._animData, pvVar7 != (void *)0x0 && (*(char *)((int)pvVar7 + 0x34) != '\0')))) { Game::ShakeScreen(g_game,4); if ((npc->_sprite)._flipX == 0) { local_1e8 = -60.0; } else { local_1e8 = 60.0; } fVar13 = (float)npc->_stateFrame; local_1e8 = local_1e8 + (npc->_pos).x; spawnY = (npc->_pos).y + 0.0; if ((int)fVar13 % (int)local_218 == 0) { uVar10 = Random(); if ((npc->_sprite)._flipX == 0) { local_220.x = 800.0; } else { local_220.x = -800.0; } local_220.x = (npc->_pos).x - local_220.x; local_220.y = (npc->_pos).y - 0.0; spawned = Game::Spawn(g_game,1000,0x97,&local_220,&g_vectorZero,(Entity *)0x0,0,uVar10 ); (spawned->_posOffset).x = 0.0; (spawned->_posOffset).y = -24.0; if ((npc->_sprite)._flipX == 0) { fVar13 = 60.0; } else { fVar13 = -60.0; } iVar2 = *(int *)spawned; fVar17 = (npc->_pos).y; (spawned->_targetPosition).x = (npc->_pos).x - fVar13; (spawned->_targetPosition).y = fVar17 - 0.0; (**(code **)(iVar2 + 0xc))(); fVar13 = (float)npc->_stateFrame; } if ((int)fVar13 % 6 == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&beastPartList,0x3b7,1,-1,0,0); local_14 = 1.4013e-45; local_1ac = (int *)0x0; if ((int *)beastPartList._size != (int *)0x0) { pvVar7 = beastPartList._data; do { local_1d8 = *(int **)((int)pvVar7 + (int)local_1ac * 4); if (*(char *)((int)local_1d8 + 0x173) == '\0') { local_1a4 = (int *)local_1d8[0xcf]; if ((npc->_sprite)._flipX == 0) { fVar13 = roomLeft - 100.0; bVar15 = (float)local_1a4 < fVar13; } else { fVar13 = local_1c0 + 100.0; bVar15 = fVar13 < (float)local_1a4; } if (!bVar15 && fVar13 != (float)local_1a4) { vfn = *(code **)(*local_1d8 + 0x20); pEVar9 = EntityRef::EntityRef(&damageSource); local_1d0 = *(float *)(extraout_EDX_00 + 0x340); uVar10 = Random(); fVar17 = (local_1d4->_pos).x - (float)local_1a4; local_1bc = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; fVar13 = (local_1d4->_pos).y - local_1d0; fVar13 = sqrtf(fVar13 * fVar13 + fVar17 * fVar17); fVar13 = (fVar13 - 500.0) / 1500.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } (*vfn)((1.0 - fVar13 * 0.8) * (local_1bc * 14.0 + 14.0),0,0,pEVar9,0x1e); npc = local_1d4; } pvVar7 = beastPartList._data; } local_1ac = (int *)((int)local_1ac + 1); } while (local_1ac < (uint)beastPartList._size); } local_14 = -NAN; if (beastPartList._0_1_ == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,beastPartList._data,0); local_14 = -NAN; } } fVar13 = (float)npc->_stateFrame; if ((0x14 < (int)fVar13) && ((int)fVar13 % 0x1e == 0)) { uVar10 = Random(); iVar4 = -0x5a; iVar2 = (uVar10 % 0x14) * 2; local_1ac = (int *)(iVar2 + -0x14); local_1d8 = (int *)(-0x5a - (int)local_1ac); local_1c4 = (float)(iVar2 + 0x3c); do { local_1a4 = (int *)((float)iVar4 * 0.017453292); local_1bc = cos((float)local_1a4); local_1bc = local_1bc * 580.0; fVar13 = sin((float)local_1a4); if (9 < (int)(((uint)local_1d8 ^ (int)local_1d8 >> 0x1f) - ((int)local_1d8 >> 0x1f)) ) { if ((npc->_sprite)._flipX == 0) { local_1bc = -local_1bc; } local_200.x = local_1e8 + local_1bc; local_200.y = spawnY + fVar13 * 580.0; uVar10 = Random(); spawned = Game::Spawn(g_game,9,2,&local_200,&g_vectorZero,(Entity *)npc,0,uVar10); spawned[1]._damageEvents._begin = (void *)0x0; spawned[1]._damageEvents._end = (void *)0xbdcccccd; spawned[1]._index = 0x3f733333; if ((int)local_1ac < iVar4) { fVar13 = (float)((int)local_1d8 + -10); } else { fVar13 = local_1c4; } uVar10 = (int)fVar13 / 2 & 0x80000003; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xfffffffc) + 1; } if ((uVar10 == 1) || (uVar10 == 3)) { spawned[1]._variant = 0x8000000; targetSprite = &spawned[1]._sprite; (targetSprite->_filename)._buf[8] = '\x1e'; (targetSprite->_filename)._buf[9] = '\0'; (targetSprite->_filename)._buf[10] = '\0'; (targetSprite->_filename)._buf[0xb] = '\0'; LAB_00594017: pEVar12 = spawned + 1; (pEVar12->_sprite)._filename._buf[0] = '\0'; (pEVar12->_sprite)._filename._buf[1] = '\0'; (pEVar12->_sprite)._filename._buf[2] = '\0'; (pEVar12->_sprite)._filename._buf[3] = '\x02'; *(undefined4 *)&spawned[1].field_0x44 = 0x8000000; spawned[1]._subtype = 1; } else { spawned[1]._variant = 0x8000000; if (uVar10 == 2) { targetSprite = &spawned[1]._sprite; (targetSprite->_filename)._buf[8] = '<'; (targetSprite->_filename)._buf[9] = '\0'; (targetSprite->_filename)._buf[10] = '\0'; (targetSprite->_filename)._buf[0xb] = '\0'; goto LAB_00594017; } spawned[1]._subtype = 0; } (**(code **)(*(int *)spawned + 0xc))(); } local_1d8 = (int *)((int)local_1d8 + 2); iVar4 = iVar4 + 2; local_1c4 = (float)((int)local_1c4 + -2); } while (iVar4 < 0x3c); fVar13 = (float)npc->_stateFrame; } if (((uint)fVar13 & 1) == 0) { uVar10 = Random(); if ((npc->_sprite)._flipX == 0) { local_1e0.x = 60.0; } else { local_1e0.x = -60.0; } local_1e0.x = (npc->_pos).x - local_1e0.x; local_1e0.y = (npc->_pos).y - 0.0; spawned = Game::Spawn(g_game,1000,0x97,&local_1e0,&g_vectorZero,(Entity *)0x0,1,uVar10 ); iVar2 = *(int *)spawned; (spawned->_posOffset).x = 0.0; (spawned->_posOffset).y = -24.0; (**(code **)(iVar2 + 0xc))(); } local_1d8 = (int *)0x0; local_1b4.y = (float)g_game->_room; if (*(int *)((int)local_1b4.y + 0x1264) != 0) { fVar13 = 0.0; do { pEVar14 = *(Entity_NPC **)(*(int *)((int)local_1b4.y + 0x125c) + (int)local_1d8 * 4) ; local_1a4 = (int *)pEVar14->_type; if ((((local_1a4 == (int *)&DAT_00000009) || (local_1a4 == (int *)0x2)) || (local_1a4 == (int *)&DAT_00000004)) || (local_1a4 == (int *)0x1)) { LAB_005941aa: if (pEVar14 != npc) { fVar17 = (pEVar14->_pos).x; fVar18 = (pEVar14->_pos).y; if (((fVar17 != local_1e8) || (fVar18 != spawnY)) && (pEVar14->_friction != fVar13)) { local_1d0 = local_1e8 - fVar17; local_1ac = (int *)(spawnY - fVar18); local_1bc = (float)local_1ac * (float)local_1ac + local_1d0 * local_1d0; if (local_1bc < 1.96e+06) { local_1c4 = sqrtf(local_1bc); fVar13 = sqrtf(local_1bc); fVar18 = 1.0; fVar17 = 0.0; if (0.0 < fVar13) { local_1d0 = (1.0 / fVar13) * local_1d0; local_1ac = (int *)((float)local_1ac * (1.0 / fVar13)); } fVar13 = 160.0; if ((*(int *)&g_game->_deathmatchManager < 2) || (local_1a4 != (int *)0x1)) { if ((int)local_1a4 - 10U < 0x3de) { fVar13 = 400.0; } else if ((local_1a4 == (int *)0x2) || (local_1a4 == (int *)&DAT_00000009)) { LAB_005942f8: fVar13 = 300.0; } else if (local_1a4 == (int *)0x3b7) { if (pEVar14->_variant == 2) goto LAB_005942f8; } else if (local_1a4 == (int *)&DAT_00000004) { fVar13 = 400.0; } } else { fVar13 = 400.0; } if (8.0 <= local_1c4) { local_1c4 = 1.0 / local_1c4; } else { local_1c4 = local_1c4 * 0.015625; } if ((local_1a4 == (int *)&DAT_00000009) || (local_1a4 == (int *)0x2)) { fVar16 = pEVar14->_updateTime / 30.0; if (1.0 <= fVar16) { fVar16 = 1.0; } local_1c4 = local_1c4 * fVar16; } local_1c8 = (fVar13 * local_1c4) / pEVar14->_friction; if (local_1a4 == (int *)0x2) { VStack_1f0.y = 0.4; local_1a4 = (int *)(1.0 - local_1c4 * 20.0); pfVar8 = (float *)&local_1a4; if ((float)local_1a4 <= 0.4) { pfVar8 = &VStack_1f0.y; } fVar19 = *pfVar8 * (pEVar14->_velocity).y; fVar16 = *pfVar8 * (pEVar14->_velocity).x; (pEVar14->_velocity).y = fVar19; (pEVar14->_velocity).x = fVar16; local_1f8._0_4_ = SUB84(((BitSet128 *)&(pEVar14->_pathfinder)._direction)->_l,0); local_1f8._4_4_ = *(undefined4 *)&(pEVar14->_pathfinder).field_0x18; VStack_1f0.x = *(float *)&(pEVar14->_pathfinder).field_0x1c; VStack_1f0.y = (float)(pEVar14->_pathfinder)._gridIndex; fVar13 = local_1c4; maskedFlags = BitSet128::operator_and (&local_248,(BitSet128 *)local_1f8, (BitSet128 *)&DAT_00c34b60); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0 )) && (fVar16 * fVar16 + fVar19 * fVar19 < fVar18)) { maskedFlags = BitSet128::__bnot((BitSet128 *)&DAT_00c34b60,&local_258); local_1f8._0_4_ = SUB84(((BitSet128 *)&(pEVar14->_pathfinder)._direction)->_l,0); local_1f8._4_4_ = *(undefined4 *)&(pEVar14->_pathfinder).field_0x18; VStack_1f0.x = *(float *)&(pEVar14->_pathfinder).field_0x1c; VStack_1f0.y = (float)(pEVar14->_pathfinder)._gridIndex; maskedFlags = BitSet128::operator_and (&local_268,(BitSet128 *)local_1f8,maskedFlags); Entity_Tear::SetTearFlags((Entity_Tear *)pEVar14,*maskedFlags); fVar17 = 0.0; fVar13 = local_1c4; } fVar13 = fVar13 * -16.0; fVar18 = pEVar14->_speedMultiplier; if (fVar13 <= -16.0) { fVar13 = -16.0; } (pEVar14->_velocity).x = fVar18 * fVar17 + (pEVar14->_velocity).x; (pEVar14->_velocity).y = fVar13 * fVar18 + (pEVar14->_velocity).y; if (((pEVar14->_dead == 0) && (local_1bc < npc->_size * npc->_size * 0.6 * 0.6)) && (15.0 < pEVar14->_updateTime)) { local_1f8._0_4_ = SUB84(((BitSet128 *)&(pEVar14->_pathfinder)._direction)->_l,0); local_1f8._4_4_ = *(undefined4 *)&(pEVar14->_pathfinder).field_0x18; VStack_1f0.x = *(float *)&(pEVar14->_pathfinder).field_0x1c; VStack_1f0.y = (float)(pEVar14->_pathfinder)._gridIndex; maskedFlags = BitSet128::operator_and (&local_238,(BitSet128 *)local_1f8, &g_tearFlagLudovico); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { (**(code **)(*(int *)pEVar14 + 0x28))(); } } } else if (local_1a4 == (int *)&DAT_00000009) { LAB_00594578: local_1a4 = (int *)0x3ecccccd; VStack_1f0.y = 1.0 - local_1c4 * 20.0; pfVar8 = &VStack_1f0.y; if (VStack_1f0.y <= 0.4) { pfVar8 = (float *)&local_1a4; } fVar13 = *pfVar8; (pEVar14->_velocity).y = fVar13 * (pEVar14->_velocity).y; (pEVar14->_velocity).x = fVar13 * (pEVar14->_velocity).x; if (((pEVar14->_dead == 0) && (local_1bc < npc->_size * npc->_size * 0.6 * 0.6)) && (15.0 < pEVar14->_updateTime)) { (**(code **)(*(int *)pEVar14 + 0x28))(); } if (pEVar14->_type != 9) { fVar17 = local_1c4 * -60.0; fVar13 = pEVar14->_speedMultiplier; if (fVar17 <= -36.0) { fVar17 = -36.0; } (pEVar14->_velocity).x = fVar13 * 0.0 + (pEVar14->_velocity).x; (pEVar14->_velocity).y = fVar17 * fVar13 + (pEVar14->_velocity).y; } } else if (local_1a4 == (int *)0x3b7) { if (pEVar14->_variant == 2) goto LAB_00594578; } else if (local_1a4 == (int *)0x3e8) { local_1a4 = (int *)0x3ecccccd; VStack_1f0.y = 1.0 - local_1c4 * 20.0; pfVar8 = &VStack_1f0.y; if (VStack_1f0.y <= 0.4) { pfVar8 = (float *)&local_1a4; } fVar13 = *pfVar8; (pEVar14->_velocity).y = fVar13 * (pEVar14->_velocity).y; (pEVar14->_velocity).x = fVar13 * (pEVar14->_velocity).x; if (local_1bc < npc->_size * npc->_size * 0.4 * 0.4) { (**(code **)(*(int *)pEVar14 + 0x28))(); } } fVar13 = 0.0; fVar17 = pEVar14->_speedMultiplier; (pEVar14->_velocity).x = local_1d0 * local_1c8 * fVar17 + (pEVar14->_velocity).x; (pEVar14->_velocity).y = (float)local_1ac * local_1c8 * fVar17 + (pEVar14->_velocity).y; } } } } else { if (local_1a4 == (int *)0x3e8) { if ((pEVar14->_variant != 0x42) || (pEVar14->_sortingLayer != 2)) goto LAB_005946cc; goto LAB_005941aa; } if (local_1a4 == (int *)0x3b7) { if (pEVar14->_variant == 2) goto LAB_005941aa; } else if (((local_1a4 == (int *)&DAT_00000005) && (*(int *)&(pEVar14->_pathfinder).field_0x120 == 0)) && ((bVar1 = Entity_Pickup::IsChest(pEVar14->_variant), bVar1 == 0 || (pEVar14->_subtype != 0)))) goto LAB_005941aa; } LAB_005946cc: local_1d8 = (int *)((int)local_1d8 + 1); } while (local_1d8 < *(int **)((int)local_1b4.y + 0x1264)); } } fVar13 = elapsedFrames; } if (0x168 < npc->_stateFrame) { npc->_stateFrame = 0; ANM2::Play(&npc->_sprite,(byte *)"SuckEnd",0); manager = g_manager; npc->_state = 9; local_1a4 = (int *)0x2c5; seed_fart_sound_override((int *)&local_1a4); SoundEffects::Play(&manager->_sfxManager,(int)local_1a4,1.0,2,0,1.0,0.0); manager = g_manager; fVar13 = SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x2c1); local_1b4.y = fVar13 - 0.05; SFXManager::SetAmbientSound(&manager->_sfxManager,0x2c1,local_1b4.y,1.0); break; } local_1cc = (float)((int)local_1cc + 1); npc->_stateFrame = npc->_stateFrame + 1; } while ((int)local_1cc < (int)fVar13); } break; case 9: fVar13 = SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x2c1); local_1b4.y = fVar13 - 0.05; SFXManager::SetAmbientSound(&manager->_sfxManager,0x2c1,local_1b4.y,1.0); bVar1 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&npc->_sprite,(byte *)"BlastLoop",0); play_sound_with_fart_seed(0x2ba,1.0,2,0,1.0); local_1e0.x = 0.0; local_1e0.y = -20.0; if ((npc->_sprite)._flipX == 0) { fVar13 = 180.0; } else { fVar13 = 0.0; } local_200.x = (npc->_pos).x + 0.0; local_200.y = (npc->_pos).y + 20.0; Entity_Laser::ShootAngle(0xd,&local_200,fVar13,0x46,&local_1e0,(Entity *)npc,0); uVar10 = 0; pvVar7 = g_game->_room; if (*(int *)((int)pvVar7 + 0x1264) != 0) { do { iVar2 = *(int *)(*(int *)((int)pvVar7 + 0x125c) + uVar10 * 4); if (*(int *)(iVar2 + 0x28) == 9) { *(undefined1 *)(iVar2 + 0x173) = 1; } uVar10 = uVar10 + 1; } while (uVar10 < *(uint *)((int)pvVar7 + 0x1264)); } } bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if ((bVar1 != 0) || (bVar1 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), bVar1 != 0)) { Game::ShakeScreen(g_game,8); } iVar2 = npc->_stateFrame + (int)elapsedFrames; npc->_stateFrame = iVar2; if (90.0 < (float)iVar2) { npc->_stateFrame = 0; npc->_state = 3; ANM2::Play(&npc->_sprite,(byte *)"BlastEnd",0); } break; case 10: bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { play_sound_with_fart_seed(0x2c7,1.0,2,0,1.0); } bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar1 != 0) { if ((npc->_sprite)._flipX == 0) { VStack_1f0.x = -60.0; } else { VStack_1f0.x = 60.0; } VStack_1f0.x = VStack_1f0.x + (npc->_pos).x; VStack_1f0.y = (npc->_pos).y + 0.0; if (0 < (int)elapsedFrames) { do { if ((npc->_sprite)._animState._animData == (void *)0x0) { uVar10 = npc->_stateFrame; LAB_00594ae1: if (((int)uVar10 % 0x16 == 0) && ((int)uVar10 < 0x46)) { ProjectileParams::ProjectileParams(&shotParams); local_1a4 = (int *)&DAT_bf800000; shotParams.Variant = 2; shotParams.FallingAccelModifier = -0.1; shotParams.BulletFlags._0_4_ = 0x80; shotParams.BulletFlags._4_4_ = 0x21; shotParams.ChangeFlags._0_4_ = 0x80; shotParams.ChangeFlags._4_4_ = 0; shotParams.ChangeTimeout = 0xc; shotParams.Acceleration = 0.7; local_60 = 1; if ((npc->_sprite)._flipX != 0) { local_1a4 = (int *)0x3f800000; } iVar2 = -4; do { local_1b4.y = (float)iVar2 * 18.0 * 0.017453292; local_1c8 = cos(local_1b4.y); fVar13 = sin(local_1b4.y); local_220.x = (local_1c8 * (float)local_1a4 - fVar13 * 0.0) * 20.0; local_220.y = (fVar13 * (float)local_1a4 + local_1c8 * 0.0) * 20.0; Entity_NPC::FireProjectiles(npc,&VStack_1f0,&local_220,0,&shotParams); iVar2 = iVar2 + 1; } while (iVar2 < 5); } } else { bVar1 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Sound"); uVar10 = npc->_stateFrame; if (bVar1 == 0) goto LAB_00594ae1; uVar11 = uVar10 & 0x80000003; bVar15 = uVar11 == 0; if ((int)uVar11 < 0) { bVar15 = (uVar11 - 1 | 0xfffffffc) == 0xffffffff; } if (((bVar15) && (999 < (int)uVar10)) && ((int)uVar10 < 0x400)) { ProjectileParams::ProjectileParams(&bigShotParams); bigShotParams.FallingAccelModifier = -0.1; bigShotParams.Color._tint[0] = _DAT_00c33d54; bigShotParams.Color._tint[1] = fRam00c33d58; bigShotParams.Color._tint[2] = fRam00c33d5c; bigShotParams.Color._tint[3] = fRam00c33d60; bigShotParams.Color._offset[2] = DAT_00c33d7c; bigShotParams.BulletFlags._0_4_ = 0x80; bigShotParams.BulletFlags._4_4_ = 0; bigShotParams.Color._colorize[0] = _DAT_00c33d64; bigShotParams.Color._colorize[1] = fRam00c33d68; bigShotParams.Color._colorize[2] = fRam00c33d6c; bigShotParams.Color._colorize[3] = fRam00c33d70; bigShotParams.Scale = 2.5; bigShotParams.Color._offset[0] = (float)DAT_00c33d74; bigShotParams.Color._offset[1] = DAT_00c33d74._4_4_; local_1a4 = (int *)&DAT_bf800000; local_108 = 1; if ((npc->_sprite)._flipX != 0) { local_1a4 = (int *)0x3f800000; } iVar2 = -9; do { local_1b4.y = (float)iVar2 * 9.0 * 0.017453292; local_1c8 = cos(local_1b4.y); fVar13 = sin(local_1b4.y); local_1b4.y = local_1c8 * (float)local_1a4 - fVar13 * 0.0; local_1e0.x = local_1b4.y * 15.0; local_1c8 = (float)local_1a4 * fVar13 + local_1c8 * 0.0; local_1e0.y = local_1c8 * 15.0; Entity_NPC::FireProjectiles(npc,&VStack_1f0,&local_1e0,0,&bigShotParams); uVar10 = Random(); if ((uVar10 & 1) == 0) { uVar10 = Random(); pVVar3 = &local_200; color_01 = (ColorMod *)&DAT_00c33d54; spriteOffset = &g_vectorZero; local_200.y = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 8.0; local_200.x = local_1b4.y * local_200.y; local_200.y = local_1c8 * local_200.y; uVar10 = Random(); spawn_blood_explosion((~uVar10 & 1) + 3,&VStack_1f0,spriteOffset,color_01,pVVar3); } iVar2 = iVar2 + 2; } while (iVar2 < 10); } } npc->_stateFrame = npc->_stateFrame + 1; elapsedFrames = (float)((int)elapsedFrames - 1); } while (elapsedFrames != 0.0); elapsedFrames = 0.0; } } targetSprite = &npc->_sprite; Sprite::IsEventTriggered((Sprite *)targetSprite,"Shoot"); bVar1 = Sprite::IsEventTriggered((Sprite *)targetSprite,"Sound"); if (bVar1 != 0) { npc->_stateFrame = 1000; } bVar1 = ANM2::IsFinishedImpl(targetSprite,&s_empty); curRoom = room; if (bVar1 != 0) { npc->_stateFrame = 0; npc->_state = 3; } goto LAB_00595eb4; case 0xb: if (npc->_stateFrame == 0) { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { if ((npc->_sprite)._flipX == 0) { fVar13 = roomLeft - 100.0; } else { fVar13 = local_1c0 + 100.0; } (npc->_targetPosition).x = fVar13; (npc->_sizeMulti).y = (npc->_sizeMulti).y * 0.8; } bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (((bVar1 != 0) || (bVar1 = AnimationState::IsLoopingAnimation(&(npc->_sprite)._animState), bVar1 != 0)) && (ABS((npc->_targetPosition).x - (npc->_pos).x) < 80.0)) { npc->_stateFrame = 1; ANM2::Play(&npc->_sprite,(byte *)"MoveEndTurn",0); } bVar1 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&npc->_sprite,(byte *)"MoveLoopFast",0); } } else { bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { pvVar7 = npc->_config; (npc->_sizeMulti).x = *(float *)((int)pvVar7 + 0x3c); (npc->_sizeMulti).y = *(float *)((int)pvVar7 + 0x40); if ((npc->_sprite)._flipX == 0) { fVar13 = roomLeft + 120.0; } else { fVar13 = local_1c0 - 120.0; } (npc->_targetPosition).x = fVar13; } bVar1 = ANM2::IsFinishedImpl(&npc->_sprite,&s_empty); if (bVar1 != 0) { (npc->_sprite)._flipX = (npc->_sprite)._flipX == 0; ANM2::Play(&npc->_sprite,s_Idle,0); goto LAB_00595e9a; } } break; case 0xd: targetSprite = &npc->_sprite; bVar1 = Sprite::IsEventTriggered((Sprite *)targetSprite,&DAT_00b62378); if (bVar1 != 0) { play_sound_with_fart_seed(0x2c3,1.0,2,0,1.0); } bVar1 = Sprite::IsEventTriggered((Sprite *)targetSprite,"Shoot"); if (bVar1 != 0) { play_sound_with_fart_seed(0x2be,1.0,2,0,1.0); } bVar1 = ANM2::WasEventTriggered(targetSprite,(byte *)"Shoot"); if (((bVar1 != 0) && (bVar1 = ANM2::WasEventTriggered(targetSprite,(byte *)"Sound"), bVar1 == 0) ) && (Game::ShakeScreen(g_game,4), 0 < (int)elapsedFrames)) { fVar13 = (float)npc->_stateFrame; do { if (((uint)fVar13 & 1) == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&beastPartList,0x3b7,1,-1,0,0); local_14 = 4.2039e-45; local_1a4 = (int *)0x0; if ((int *)beastPartList._size != (int *)0x0) { pvVar7 = beastPartList._data; do { local_218 = *(int **)((int)pvVar7 + (int)local_1a4 * 4); if (*(char *)((int)local_218 + 0x173) == '\0') { local_1b4.y = (float)local_218[0xcf]; if ((npc->_sprite)._flipX == 0) { fVar13 = roomLeft - 100.0; bVar15 = local_1b4.y < fVar13; } else { fVar13 = local_1c0 + 100.0; bVar15 = fVar13 < local_1b4.y; } if (!bVar15 && fVar13 != local_1b4.y) { vfn = *(code **)(*local_218 + 0x20); pEVar9 = EntityRef::EntityRef(&damageSource); local_1c8 = *(float *)(extraout_EDX_01 + 0x340); uVar10 = Random(); fVar17 = (local_1d4->_pos).x - local_1b4.y; VStack_1f0.y = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; fVar13 = (local_1d4->_pos).y - local_1c8; fVar13 = sqrtf(fVar13 * fVar13 + fVar17 * fVar17); fVar13 = (fVar13 - 500.0) / 1500.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } (*vfn)((1.0 - fVar13 * 0.8) * (VStack_1f0.y * 14.0 + 14.0),0,0,pEVar9,0x1e); npc = local_1d4; } pvVar7 = beastPartList._data; } local_1a4 = (int *)((int)local_1a4 + 1); } while (local_1a4 < (uint)beastPartList._size); } local_14 = -NAN; if (beastPartList._0_1_ == '\0') { local_14 = 5.60519e-45; tracked_alloc(1,beastPartList._data,0); local_14 = -NAN; } } fVar13 = (float)npc->_stateFrame; uVar10 = (uint)fVar13 & 0x80000007; bVar15 = uVar10 == 0; if ((int)uVar10 < 0) { bVar15 = (uVar10 - 1 | 0xfffffff8) == 0xffffffff; } if (bVar15) { uVar10 = Random(); local_1b4.y = roomLeft + 50.0; uVar11 = Random(); local_1e0.x = ((local_1c0 - 50.0) - local_1b4.y) * (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)] ) * 2.3283064e-10 + local_1b4.y; local_1e0.y = local_1cc - 20.0; spawned = Game::Spawn(g_game,0x3b7,3,&local_1e0,&g_vectorZero,(Entity *)npc,0,uVar10); (**(code **)(*(int *)spawned + 0xc))(); fVar13 = (float)npc->_stateFrame; } if (((uint)fVar13 & 1) == 0) { dVar20 = ceil(17.77777862548828); local_1b4.y = (float)dVar20; local_1a4 = (int *)local_1b4.y; uVar10 = Random(); pEVar12 = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)npc,10,uVar10); (pEVar12->_posOffset).x = 0.0; (pEVar12->_posOffset).y = -14.0; Color::Reset(&tmpColor); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 0.2; tmpColor._tint[2] = 0.2; tmpColor._tint[3] = 1.0; (**(code **)(*(int *)pEVar12 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); spawned = pEVar12 + 1; (spawned->_sprite)._filename._buf[0] = '\0'; (spawned->_sprite)._filename._buf[1] = '\0'; (spawned->_sprite)._filename._buf[2] = ' '; (spawned->_sprite)._filename._buf[3] = 'A'; targetSprite = &pEVar12[1]._sprite; (targetSprite->_filename)._buf[4] = '\0'; (targetSprite->_filename)._buf[5] = '\0'; (targetSprite->_filename)._buf[6] = '\x16'; (targetSprite->_filename)._buf[7] = 'C'; *(int *)(pEVar12[1]._sprite._filename._buf + 8) = (int)(float)local_1a4 * 2; *(int *)(pEVar12[1]._sprite._filename._buf + 0xc) = (int)(float)local_1a4 * 2; (**(code **)(*(int *)pEVar12 + 0xc))(); uVar10 = Random(); local_1ac = (int *)0x0; local_1b4.y = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)] ) * 2.3283064e-10 * 360.0; do { uVar10 = Random(); pEVar12 = Game::Spawn(g_game,1000,0x97,&npc->_pos,&g_vectorZero,(Entity *)npc,0xb,uVar10 ); uVar10 = Random(); (pEVar12->_posOffset).x = 0.0; (pEVar12->_posOffset).y = -14.0; (pEVar12->_sprite)._rotation = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) + (float)(int)local_1ac * 120.0 + local_1b4.y; Color::Reset(&tmpColor); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 0.2; tmpColor._tint[2] = 0.2; tmpColor._tint[3] = 1.0; (**(code **)(*(int *)pEVar12 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); *(int *)(pEVar12[1]._sprite._filename._buf + 8) = (int)(float)local_1a4; *(int *)(pEVar12[1]._sprite._filename._buf + 0xc) = (int)(float)local_1a4; uVar10 = Random(); spawned = pEVar12 + 1; (spawned->_sprite)._filename._buf[0] = '\0'; (spawned->_sprite)._filename._buf[1] = '\0'; (spawned->_sprite)._filename._buf[2] = ' '; (spawned->_sprite)._filename._buf[3] = 'A'; *(float *)(pEVar12[1]._sprite._filename._buf + 4) = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.15 + 0.15) * 500.0; uVar10 = Random(); local_1c8 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)] ) * 2.3283064e-10 * 0.4 + 0.6; layer = ANM2::GetLayer(&pEVar12->_sprite,(byte *)0x0); (layer->_size).y = local_1c8; (**(code **)(*(int *)pEVar12 + 0xc))(); local_1ac = (int *)((int)local_1ac + 1); } while ((int)local_1ac < 3); fVar13 = (float)npc->_stateFrame; } fVar13 = (float)((int)fVar13 + 1); elapsedFrames = (float)((int)elapsedFrames - 1); npc->_stateFrame = (int)fVar13; } while (elapsedFrames != 0.0); targetSprite = &npc->_sprite; elapsedFrames = 0.0; } bVar1 = ANM2::IsFinishedImpl(targetSprite,&s_empty); if (bVar1 != 0) { LAB_00595e9a: npc->_state = 3; goto LAB_00595ea4; } break; case 0x10: iVar2 = npc->_stateFrame; if (iVar2 != 1000) { if (iVar2 < 1) { iVar2 = npc->_i1; if (0 < iVar2) { PlayerManager::trigger_room_clear(&g_game->_playerManager); PlayerManager::trigger_room_clear(&g_game->_playerManager); iVar2 = npc->_i1; } if (iVar2 < 4) { local_1a4 = (int *)(iVar2 + 1); piVar5 = (int *)FUN_0044bc90(local_1a4); if (*piVar5 != 0) { puVar6 = (undefined4 *)FUN_0044bc90(local_1a4); Entity::SetChild((Entity *)npc,(Entity *)*puVar6); piVar5 = (int *)FUN_0044bc90(npc->_i1 + 1); if (*piVar5 != 0) { local_1a4 = piVar5; std::multiset::erase(&local_1a4); } animName = "LeaveStart"; goto LAB_0059325e; } } else { piVar5 = (int *)FUN_0044bc90(0); if (*piVar5 != 0) { puVar6 = (undefined4 *)FUN_0044bc90(0); Entity::SetChild((Entity *)npc,(Entity *)*puVar6); piVar5 = (int *)FUN_0044bc90(0); if (*piVar5 != 0) { local_1a4 = piVar5; std::multiset::erase(&local_1a4); } animName = "Leave"; LAB_0059325e: *piVar5 = 0; *(undefined4 *)((int)npc->_child + 0xb64) = 4; ANM2::Play((ANM2 *)((int)npc->_child + 0x48),(byte *)animName,0); } } npc->_stateFrame = 1000; } else if ((npc->_child == (EntityPtr)0x0) && (iVar4 = Room::GetAliveEnemiesCount(room), iVar4 == 1)) { npc->_stateFrame = iVar2 - (int)elapsedFrames; } break; } if (npc->_child != (EntityPtr)0x0) break; curRoom = g_game->_room; if ((curRoom->_gridWidth < 0xc) || (curRoom->_gridHeight < 5)) { iVar2 = -1; } else { iVar2 = curRoom->_gridWidth * 4 + 0xb; } pVVar3 = Room::GetGridPosition(curRoom,&local_1e0,iVar2); local_1b4.y = pVVar3->y + 0.0; local_1b4.x = pVVar3->x + 400.0; *(undefined4 *)&curRoom->field_0x12d0 = 0; switch(npc->_i1) { case 0: uVar10 = Random(); uVar11 = 10; break; case 1: uVar10 = Random(); uVar11 = 0x14; break; case 2: uVar10 = Random(); uVar11 = 0x1e; break; case 3: uVar10 = Random(); uVar11 = 0x28; break; default: goto switchD_00592f92_default; } spawned = Game::Spawn(g_game,0x3b7,uVar11,&local_1b4,&g_vectorZero,(Entity *)0x0,0,uVar10); if (spawned == (Entity *)0x0) { switchD_00592f92_default: flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); musicManager = &g_manager->_musicManager; *(uint *)&npc->_flags = (uint)npc->_flags & 0x7fffffff; npc->_visible = 1; npc->_entityCollisionClass = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_isInvicible = 0; npc->_i1 = 0; musicManager->_channels[musicManager->_currentChannel]._enabledLayers = 0; MusicManager::EnableLayer(musicManager,3,0); (npc->_pos).x = local_1b4.x - 400.0; (npc->_pos).y = local_1b4.y - 0.0; npc->_state = 7; ANM2::Play(&npc->_sprite,(byte *)"Surface",0); play_sound_with_fart_seed(0x2c0,1.0,2,0,1.0); (npc->_v1).y = -2.0; goto LAB_00595ea4; } flagsHigh = *(undefined4 *)((int)&spawned->_flags + 4); *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; *(undefined4 *)((int)&spawned->_flags + 4) = flagsHigh; (**(code **)(*(int *)spawned + 0xc))(); spawned[2]._posOffset.x = 1.38729e-43; Entity::SetChild((Entity *)npc,spawned); npc->_i1 = npc->_i1 + 1; npc->_stateFrame = 0x1e; } curRoom = room; LAB_00595eb4: if ((npc->_dead != 0) || ((iVar2 = npc->_state, iVar2 != 8 && (iVar2 != 9)))) { SFXManager::Stop(&g_manager->_sfxManager,0x2c1); iVar2 = npc->_state; } if ((iVar2 != 4) && (iVar2 != 0x10)) { fVar13 = curRoom->_beastBlastForce - 0.05; if (fVar13 <= 0.0) { fVar13 = 0.0; } curRoom->_beastBlastForce = fVar13; } ExceptionList = local_1c; return; } //@@ 00596120 NpcAI::ENTITY_BEAST_stalactite /* DB: 951.1; TopCrackedBase/TopCrackedTip; NpcTable named it ENTITY_BEAST (first case) */ void __fastcall NpcAI::ENTITY_BEAST_stalactite(Entity_NPC *npc) { uint *puVar1; void *pvVar2; Vector sizeMulti; Vector sizeMulti_00; Vector sizeMulti_01; Vector sizeMulti_02; qword qVar3; int iVar4; uint uVar5; Entity *tmpEntity; EntityRef *selfRef; byte *nullLayerName; uint uVar6; int iVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; double dVar16; uint uStack_70; Vector local_50; code *local_48; float local_44; Vector rockVelocity; Vector emberVelocity; EntityRef local_30; Vector *npcPos; if (npc->_aiCallPhase == 1) { if (*(float *)((int)g_game->_room + 0x20) - 30.0 < (npc->_pos).y + 60.0) { npc->_friction = npc->_friction * 0.5; } if (npc->_subtype == 4) { return; } fVar8 = (npc->_targetPosition).x; if ((fVar8 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { return; } fVar15 = (npc->_targetPosition).y; fVar9 = (npc->_pos).y; (npc->_velocity).x = fVar8 - (npc->_pos).x; (npc->_velocity).y = fVar15 - fVar9; return; } iVar4 = npc->_state; if (iVar4 == 0) { npc->_state = 3; uVar6 = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar5 = 4; if (uVar6 < 4) { uVar5 = uVar6; } ANM2::Play(&npc->_sprite,(&PTR_DAT_00b62284)[uVar5],0); qVar3 = npc->_flags; puVar1 = (uint *)((int)&npc->_flags + 4); *puVar1 = *puVar1 | 0x2408; npc->_aiCallFlags = 1; *(uint *)&npc->_flags = (uint)qVar3 & 0xfffffffb | 0x44050011; uVar6 = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar5 = 4; if (uVar6 < 4) { uVar5 = uVar6; } (npc->_posOffset).y = *(float *)(&DAT_00b62298 + uVar5 * 4); (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; goto LAB_005966b8; } if ((iVar4 != 3) && (iVar4 != 5)) goto LAB_005966b8; fVar8 = (npc->_posOffset).x; if ((fVar8 != 0.0) && (fVar8 = fVar8 * -0.8, (npc->_posOffset).x = fVar8, ABS(fVar8) < 0.3)) { (npc->_posOffset).x = 0.0; } iVar4 = npc->_subtype; if (iVar4 == 2) { npcPos = &npc->_pos; pvVar2 = g_game->_room; if (((0.0 < *(float *)((int)pvVar2 + 0x788c)) && (*(float *)((int)pvVar2 + 0x14) + 200.0 < npcPos->x)) || ((iVar4 = 2, *(float *)((int)pvVar2 + 0x788c) < 0.0 && (fVar8 = *(float *)((int)pvVar2 + 0x1c) - 200.0, npcPos->x <= fVar8 && fVar8 != npcPos->x))) ) { Entity_NPC::PlaySound(npc,0x89,1.0,2,0,1.0); npc->_subtype = 3; ANM2::Play(&npc->_sprite,(byte *)"TopCrackedBase",0); pvVar2 = npc->_config; local_44 = *(float *)((int)pvVar2 + 0x40) * 0.25; local_48 = *(code **)((int)pvVar2 + 0x3c); sizeMulti.y = local_44; sizeMulti.x = (float)local_48; Entity::SetSize((Entity *)npc,*(float *)((int)pvVar2 + 0x38),sizeMulti,-1); uVar5 = Random(); local_50.x = npcPos->x + 0.0; local_50.y = (npc->_pos).y + 100.0; tmpEntity = Game::SpawnEx(g_game,0x3b7,1,&local_50,&g_vectorZero,(Entity *)0x0,4,uVar5,0); pvVar2 = npc->_config; local_44 = *(float *)((int)pvVar2 + 0x40) * 0.5; local_48 = *(code **)((int)pvVar2 + 0x3c); sizeMulti_00.y = local_44; sizeMulti_00.x = (float)local_48; Entity::SetSize(tmpEntity,*(float *)((int)pvVar2 + 0x38),sizeMulti_00,-1); (tmpEntity->_sprite)._flipX = (npc->_sprite)._flipX; (**(code **)(*(int *)tmpEntity + 0xc))(); iVar4 = npc->_subtype; goto LAB_005963c4; } } else { LAB_005963c4: if (iVar4 == 4) { (npc->_velocity).y = npc->_speedMultiplier * 1.5 + (npc->_velocity).y; } } if (npc->_state == 5) { npc->_state = 3; if ((iVar4 == 0) || (iVar4 == 2)) { Entity_NPC::PlaySound(npc,0x89,1.0,2,0,1.0); npc->_subtype = 3; ANM2::Play(&npc->_sprite,(byte *)"TopCrackedBase",0); pvVar2 = npc->_config; local_44 = *(float *)((int)pvVar2 + 0x40) * 0.25; local_48 = *(code **)((int)pvVar2 + 0x3c); sizeMulti_01.y = local_44; sizeMulti_01.x = (float)local_48; Entity::SetSize((Entity *)npc,*(float *)((int)pvVar2 + 0x38),sizeMulti_01,-1); uVar5 = Random(); local_50.x = (npc->_pos).x + 0.0; local_50.y = (npc->_pos).y + 100.0; tmpEntity = Game::SpawnEx(g_game,0x3b7,1,&local_50,&g_vectorZero,(Entity *)0x0,4,uVar5,0); pvVar2 = npc->_config; local_44 = *(float *)((int)pvVar2 + 0x40) * 0.5; local_48 = *(code **)((int)pvVar2 + 0x3c); sizeMulti_02.y = local_44; sizeMulti_02.x = (float)local_48; Entity::SetSize(tmpEntity,*(float *)((int)pvVar2 + 0x38),sizeMulti_02,-1); (tmpEntity->_sprite)._flipX = (npc->_sprite)._flipX; tmpEntity->_visible = 0; tmpEntity[2]._prevUpdateTime = (npc->_v2).x; tmpEntity[2]._updateTime = (npc->_v2).y; local_30._position.x = (npc->_pos).x; local_30._position.y = (npc->_pos).y; local_48 = *(code **)(*(int *)tmpEntity + 0x24); local_30._type = npc->_type; local_30._variant = npc->_variant; local_30._spawnerType = npc->_spawnerType; local_30._spawnerVariant = npc->_spawnerVariant; local_30._velocity.x = (npc->_velocity).x; local_30._velocity.y = (npc->_velocity).y; uStack_70 = (uint)((npc->_flags & 0x100) != 0); if ((npc->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } local_30._flags = uVar6 | uVar5 | uStack_70; local_30._entity = npc; (*local_48)(&local_30); (**(code **)(*(int *)tmpEntity + 0xc))(); } else { selfRef = EntityRef::EntityRef(&local_30); (**(code **)(*(int *)npc + 0x24))(selfRef); } } LAB_005966b8: if (0.0 < npc->_pendingDamage) { if (0.0 < (npc->_posOffset).x || (npc->_posOffset).x == 0.0) { fVar8 = -3.0; } else { fVar8 = 3.0; } (npc->_posOffset).x = fVar8; } pvVar2 = g_game->_room; if (((*(float *)((int)pvVar2 + 0x788c) <= 0.0) || ((npc->_pos).x <= *(float *)((int)pvVar2 + 0x1c) + 200.0)) && ((0.0 <= *(float *)((int)pvVar2 + 0x788c) || (fVar8 = *(float *)((int)pvVar2 + 0x14) - 200.0, fVar8 < (npc->_pos).x || fVar8 == (npc->_pos).x)))) { if (npc->_dead != 0) { Entity_NPC::PlaySound(npc,0x89,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x1e7,1.0,2,0,1.0); Game::ShakeScreen(g_game,4); local_48 = (code *)0x0; if ((npc->_sprite)._numNullLayers != 0) { uStack_70 = 0; do { if (((int)local_48 < 0) || ((npc->_sprite)._numNullLayers <= (int)local_48)) { KAGE_LogMessage(0x10,(byte *)"%s: No null with Id %d\n"); } nullLayerName = (byte *)((int)(npc->_sprite)._nullLayerNames + uStack_70); if (0xf < *(uint *)(nullLayerName + 0x14)) { nullLayerName = *(byte **)nullLayerName; } Entity::GetNullCapsule((Entity *)npc,(Capsule *)&local_30,nullLayerName); if (0.0 < (float)local_30._flags) { local_50.x = (((float)local_30._entity + (float)local_30._flags) * (float)local_30._flags * 4.0) / 3800.0; dVar16 = ceil((double)local_50.x); local_50.x = (float)(int)dVar16; if (0 < (int)local_50.x) { do { Random(); Random(); Random(); uVar5 = Random(); uVar6 = Random(); fVar9 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar9 = fVar9 + fVar9; uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; uVar6 = Random(); fVar8 = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; fVar11 = cos(fVar8); fVar12 = sin(fVar8); fVar8 = (npc->_v2).x; fVar15 = (npc->_v2).y; uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.7; fVar14 = cos(fVar9); rockVelocity.x = fVar14 * fVar10 * 5.0 + (fVar11 * fVar8 - fVar12 * fVar15) * fVar13 ; fVar9 = sin(fVar9); rockVelocity.y = fVar9 * fVar10 * 5.0 + (fVar11 * fVar15 + fVar12 * fVar8) * fVar13; tmpEntity = Game::SpawnEx(g_game,0x3b7,2,(Vector *)&local_30,&rockVelocity, (Entity *)npc,0,uVar5,0); uVar5 = Random(); fVar15 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 + 0.8; tmpEntity[3]._pendingDamage = fVar15; fVar15 = fVar15 * tmpEntity->_shrinkStatus1; fVar8 = fVar15 * g_vectorOne.x; (tmpEntity->_sprite)._scale.y = fVar15 * g_vectorOne.y; (tmpEntity->_sprite)._scale.x = fVar8; iVar4 = *(int *)tmpEntity; (tmpEntity->_targetPosition).x = 0.25; (tmpEntity->_targetPosition).y = 0.0; (**(code **)(iVar4 + 0xc))(); uVar5 = Random(); uVar6 = Random(); fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar8 = fVar8 + fVar8; uVar6 = Random(); fVar15 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar9 = cos(fVar8); emberVelocity.x = fVar9 * fVar15 * 5.0; fVar8 = sin(fVar8); emberVelocity.y = fVar8 * fVar15 * 5.0; tmpEntity = Game::SpawnEx(g_game,1000,0x3b,(Vector *)&local_30,&emberVelocity, (Entity *)npc,0,uVar5,0); (tmpEntity->_posOffset).x = (npc->_posOffset).x; (tmpEntity->_posOffset).y = (npc->_posOffset).y; (tmpEntity->_sprite)._scale.x = g_vectorOne.x; (tmpEntity->_sprite)._scale.y = g_vectorOne.y; uVar5 = Random(); *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar5 = Random(); iVar4 = *(int *)tmpEntity; iVar7 = uVar5 % 0xf + 0xf; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar7; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar7; (**(code **)(iVar4 + 0xc))(); local_50.x = (float)((int)local_50.x + -1); } while (local_50.x != 0.0); local_50.x = 0.0; } } local_48 = (code *)((int)local_48 + 1); uStack_70 = uStack_70 + 0x18; } while (local_48 < (uint)(npc->_sprite)._numNullLayers); } } return; } (**(code **)(*(int *)npc + 0x28))(); return; } //@@ 00596c60 NpcAI::ENTITY_BEAST_rock_projectile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dispatcher case for The Beast (951) variant 2 (ROCK_PROJECTILE); "Rotate%d" anims; sibling naming NpcAI::ENTITY_BEAST */ void __fastcall NpcAI::ENTITY_BEAST_rock_projectile(Entity_NPC *npc) { int iVar1; byte isInRoom; Vector *clampedPos; uint rngResult; Entity *spawnedEffect; Color *this; Game *game; float fVar2; float fVar3; undefined1 auStack_5c [4]; float fStack_58; float fStack_54; int gibCount; float gibSpeed; Vector scratchPos; Vector gibVelocity; Color local_38; uint local_c; uint *flagsHigh; Manager *manager; Vector *npcPos; qword oldFlags; int *roomData; game = g_game; local_c = __security_cookie ^ (uint)auStack_5c; if (npc->_aiCallPhase == 3) { iVar1 = *(int *)((int)npc->_collisionEntity + 0x28); if ((iVar1 == 1) || (iVar1 == 3)) { npc->_dead = 1; return; } } else if (npc->_state == 0) { npc->_state = 3; sprintf_s((byte *)&local_38,0x20,(byte *)"Rotate%d"); ANM2::Play(&npc->_sprite,(byte *)&local_38,0); oldFlags = npc->_flags; npc->_scale = 1.0; (npc->_sprite)._scale.x = g_vectorOne.x; fVar2 = g_vectorOne.y; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2408; (npc->_sprite)._scale.y = fVar2; npc->_entityCollisionClass = 0; npc->_aiCallFlags = 4; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x44010011; } else { fVar2 = npc->_speedMultiplier; npcPos = &npc->_pos; fVar3 = (npc->_targetPosition).x; (npc->_posOffset).y = -22.0; (npc->_velocity).y = fVar2 * fVar3 + (npc->_velocity).y; clampedPos = Room::GetClampedPositionImpl (game->_room,&scratchPos,npcPos,-600.0,-200.0,-200.0,-200.0); if ((npcPos->x != clampedPos->x) || ((npc->_pos).y != clampedPos->y)) { (**(code **)(*(int *)npc + 0x28))(); game = g_game; } roomData = *(int **)(*(int *)((int)game->_room + 4) + 0x10); if (((((roomData != (int *)0x0) && (roomData[2] == 0x10)) && (*roomData == 0x23)) && ((2 < game->_frameCount - npc->_spawnFrame && (0.0 < (npc->_velocity).y)))) && (*(float *)((int)game->_room + 0x20) - 30.0 < (npc->_pos).y)) { (**(code **)(*(int *)npc + 0x28))(); rngResult = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x10,npcPos,&g_vectorZero,(Entity *)0x0,0x42,rngResult,0); (**(code **)(*(int *)spawnedEffect + 0xc))(); return; } if (npc->_dead != 0) { Color::Color(&local_38); local_38._tint[0] = 0.54901963; local_38._tint[1] = 0.48235297; local_38._tint[2] = 0.48235297; local_38._tint[3] = 1.0; Color::__mul(this,&(npc->_sprite)._color); rngResult = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x91,npcPos,&g_vectorZero,(Entity *)npc,0,rngResult,0); iVar1 = *(int *)spawnedEffect; (spawnedEffect->_posOffset).x = (npc->_posOffset).x; (spawnedEffect->_posOffset).y = (npc->_posOffset).y; (**(code **)(iVar1 + 0x3c))(&npc->_color,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawnedEffect + 0xc))(); game = g_game; fVar3 = npc->_scale * g_vectorOne.y; fVar2 = npc->_scale * g_vectorOne.x; (spawnedEffect->_sprite)._rotation = 0.0; (spawnedEffect->_sprite)._scale.y = fVar3; (spawnedEffect->_sprite)._scale.x = fVar2; isInRoom = Room::IsPositionInRoom(game->_room,npcPos,-20.0); manager = g_manager; if (isInRoom != 0) { fStack_58 = 1.91978e-43; seed_fart_sound_override((int *)&fStack_58); SoundEffects::Play(&manager->_sfxManager,(int)fStack_58,1.0,2,0,1.0,0.0); rngResult = Random(); gibCount = (int)(((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.0) * npc->_scale * 4.0); if (gibCount < 1) { gibCount = 1; } if (0x10 < gibCount) { gibCount = 0x10; } if (0 < gibCount) { do { rngResult = Random(); fStack_54 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; fStack_58 = cos(fStack_54); fStack_54 = sin(fStack_54); rngResult = Random(); fVar2 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; gibSpeed = fVar2 + fVar2 + 1.0; rngResult = Random(); fVar2 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; scratchPos.y = fVar2 * fStack_54 * npc->_size + (npc->_pos).y; scratchPos.x = fVar2 * fStack_58 * npc->_size + npcPos->x; rngResult = Random(); gibVelocity.x = fStack_58 * gibSpeed; gibVelocity.y = fStack_54 * gibSpeed; spawnedEffect = Game::SpawnEx(g_game,1000,0x23,&scratchPos,&gibVelocity,(Entity *)0x0,1,rngResult,0 ); iVar1 = *(int *)spawnedEffect; (spawnedEffect->_posOffset).x = (npc->_posOffset).x; (spawnedEffect->_posOffset).y = (npc->_posOffset).y; (**(code **)(iVar1 + 0x3c))(&local_38,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawnedEffect + 0xc))(); gibCount = gibCount + -1; } while (gibCount != 0); return; } } } } return; } //@@ 005971e0 NpcAI::ENTITY_BEAST_soul /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? dispatch type 951 (Beast) variant 3; sinusoidal wandering projectile-like body with Game::DamageRadius, random launch angle at state 0 */ void __fastcall NpcAI::ENTITY_BEAST_soul(Entity_NPC *npc) { int iVar1; qword qVar2; EntityPtr EVar3; Vector *pVVar4; Vector *steer; Entity *effect; undefined1 *extraout_ECX; undefined1 *puVar5; int iVar6; uint uVar7; uint uVar8; std_deque *trailDeque; uint uVar9; float fVar10; float fVar11; float fVar12; EntityPtr *pEVar13; int iVar14; Vector local_40; Vector local_38; EntityPtr local_2c; EntityPtr *local_28; undefined1 local_24 [12]; float local_18; undefined4 local_14; uint *flagsHigh; Manager *manager; local_14 = __security_cookie ^ (uint)(local_24 + 0x14); local_18 = (float)npc->_aiCallPhase; local_2c = (EntityPtr)npc; if (local_18 == 5.60519e-45) { fVar12 = 1.0; } else { if (local_18 != 2.8026e-45) { switch(npc->_state) { case 0: (npc->_posOffset).y = -15.0; uVar8 = Random(); local_28 = (EntityPtr *) (((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292); local_2c = (EntityPtr)cos((float)local_28); fVar12 = sin((float)local_28); local_24._0_4_ = npc->_initSeed; local_18 = 3.78351e-44; fVar11 = (float)local_2c * 0.0 - fVar12 * -1.0; fVar12 = fVar12 * 0.0 - (float)local_2c * 1.0; local_24._4_4_ = 1; local_24._8_4_ = 0x1b; (npc->_v2).x = fVar11; (npc->_v2).y = fVar12; (npc->_velocity).x = fVar11 * 10.0; (npc->_velocity).y = fVar12 * 10.0; uVar8 = RNG::RandomInt((RNG *)local_24,4); ANM2::SetFrame(&npc->_sprite,(std_string *)s_Idle,uVar8); qVar2 = npc->_flags; npc->_isInvicible = 1; (npc->_v1).x = 1.0; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 0x2008; *(uint *)&npc->_flags = (uint)qVar2 & 0xfffffffb | 0x40011; npc->_state = 3; npc->_aiCallFlags = 10; return; default: return; case 3: fVar12 = (npc->_v1).x - npc->_speedMultiplier * 0.002; (npc->_v1).x = fVar12; pVVar4 = Vector::Resized(&npc->_velocity,&local_38,fVar12 * fVar12); uVar8 = Random(); fVar12 = sin(((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.4) * npc->_updateTime); local_28 = (EntityPtr *)(fVar12 * 90.0 * 0.017453292); local_2c = (EntityPtr)cos((float)local_28); fVar10 = sin((float)local_28); fVar12 = (npc->_velocity).x; fVar11 = (npc->_velocity).y; local_18 = (float)local_2c * pVVar4->y + fVar10 * pVVar4->x + fVar11; local_24._8_4_ = ((float)local_2c * pVVar4->x - fVar10 * pVVar4->y) + fVar12; fVar12 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); pVVar4 = Vector::Resized((Vector *)(local_24 + 8),&local_40,fVar12); fVar12 = (npc->_v1).x; fVar11 = npc->_speedMultiplier; if (fVar12 <= 0.95) { fVar12 = 0.95; } if (fVar11 != 1.0) { fVar12 = fVar12 / ((fVar11 + fVar12) - fVar11 * fVar12); } fVar11 = fVar12 * pVVar4->y; fVar12 = fVar12 * pVVar4->x; (npc->_velocity).y = fVar11; (npc->_velocity).x = fVar12; if (1.0 < fVar12 * fVar12 + fVar11 * fVar11) { pVVar4 = Vector::Normalized(&npc->_velocity,(Vector *)(local_24 + 8)); (npc->_v2).x = pVVar4->x; (npc->_v2).y = pVVar4->y; } manager = g_manager; if (!(0.9 < (npc->_v1).x || (npc->_v1).x == 0.9)) { npc->_state = 8; local_28 = (EntityPtr *)0x2bd; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); local_2c = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); pEVar13 = &npc->_target; if (npc->_target != (EntityPtr)0x0) { local_28 = pEVar13; std::multiset::erase(&local_28); } *pEVar13 = local_2c; if (local_2c != (EntityPtr)0x0) { std::multiset::insert(pEVar13); } npc->_stateFrame = 0; return; } return; case 5: uVar8 = Random(); iVar14 = 1000; effect = Game::Spawn(g_game,1000,0x90,&npc->_pos,&g_vectorZero,(Entity *)local_2c,2,uVar8); uVar8 = Random(); (effect->_sprite)._rotation = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 360.0; iVar6 = *(int *)effect; (effect->_sprite)._scale.x = g_vectorOne.x; (effect->_sprite)._scale.y = g_vectorOne.y; (**(code **)(iVar6 + 0x40))(0x41a00000); (**(code **)(*(int *)effect + 0xc))(); EVar3 = local_2c; Game::DamageRadius(&npc->_pos,(Entity *)local_2c,0,0,iVar14,50.0,g_tearFlagsNone,1.0,60.0); uVar8 = Random(); SoundEffects::PlayWithFartOverride (0x1dd,0.8,2,0, (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.2); (**(code **)(*(int *)EVar3 + 0x28))(); return; case 8: goto switchD_00597234_caseD_8; } } fVar12 = 0.5; } local_28 = (EntityPtr *)(fVar12 * npc->_speedMultiplier); uVar8 = (npc->_vectorDeque1)._size; pEVar13 = local_28; if ((npc->_vectorDeque2)._size < uVar8) { std::deque::resize(uVar8); uVar8 = (npc->_vectorDeque1)._size; pEVar13 = local_28; } local_28 = (EntityPtr *)0x0; if (uVar8 != 0) { fVar12 = Math::timescale_factor(0.98,(float)pEVar13); puVar5 = extraout_ECX; do { uVar8 = (npc->_vectorDeque1)._offset; uVar9 = (uint)(puVar5 + uVar8) & 1; iVar6 = *(int *)((int)((std_deque *)((int)local_2c + 0xc04))->_map + (((std_deque *)((int)local_2c + 0xc04))->_mapSize - 1 & (uint)(puVar5 + uVar8) >> 1) * 4); uVar7 = (uint)(&local_28->field_0x1 + uVar8) & 1; iVar14 = *(int *)((int)((std_deque *)((int)local_2c + 0xc04))->_map + (((std_deque *)((int)local_2c + 0xc04))->_mapSize - 1 & (uint)(&local_28->field_0x1 + uVar8) >> 1) * 4); fVar11 = *(float *)(iVar14 + 4 + uVar7 * 8); fVar10 = *(float *)(iVar6 + 4 + uVar9 * 8); uVar8 = (uint)(&local_28->field_0x0 + ((std_deque *)((int)local_2c + 0xc18))->_offset) & 1; iVar1 = *(int *)((int)((std_deque *)((int)local_2c + 0xc18))->_map + (((std_deque *)((int)local_2c + 0xc18))->_mapSize - 1 & (uint)(&local_28->field_0x0 + ((std_deque *)((int)local_2c + 0xc18))->_offset) >> 1) * 4); *(float *)(iVar1 + uVar8 * 8) = (float)pEVar13 * *(float *)(iVar14 + uVar7 * 8) + *(float *)(iVar6 + uVar9 * 8); *(float *)(iVar1 + 4 + uVar8 * 8) = (float)pEVar13 * fVar11 + fVar10; uVar8 = (uint)(&local_28->field_0x1 + ((std_deque *)((int)local_2c + 0xc04))->_offset) & 1; iVar6 = *(int *)((int)((std_deque *)((int)local_2c + 0xc04))->_map + (((std_deque *)((int)local_2c + 0xc04))->_mapSize - 1 & (uint)(&local_28->field_0x1 + ((std_deque *)((int)local_2c + 0xc04))->_offset) >> 1) * 4); fVar11 = *(float *)(iVar6 + 4 + uVar8 * 8); uVar7 = (uint)(&local_28->field_0x1 + ((std_deque *)((int)local_2c + 0xc18))->_offset) & 1; iVar14 = *(int *)((int)((std_deque *)((int)local_2c + 0xc18))->_map + ((uint)(&local_28->field_0x1 + ((std_deque *)((int)local_2c + 0xc18))->_offset) >> 1 & ((std_deque *)((int)local_2c + 0xc18))->_mapSize - 1) * 4); *(float *)(iVar14 + uVar7 * 8) = fVar12 * *(float *)(iVar6 + uVar8 * 8); *(float *)(iVar14 + 4 + uVar7 * 8) = fVar12 * fVar11; fVar11 = *(float *)(*(int *)((int)((std_deque *)((int)local_2c + 0xc04))->_map + ((uint)(&local_28->field_0x2 + ((std_deque *)((int)local_2c + 0xc04))->_offset) >> 1 & ((std_deque *)((int)local_2c + 0xc04))->_mapSize - 1) * 4) + ((uint)(&local_28->field_0x2 + ((std_deque *)((int)local_2c + 0xc04))->_offset) & 1) * 8) - 0.1; if (fVar11 <= 0.0) { fVar11 = 0.0; } puVar5 = &local_28->field_0x3; *(float *)(*(int *)((int)((std_deque *)((int)local_2c + 0xc18))->_map + ((uint)(&local_28->field_0x2 + ((std_deque *)((int)local_2c + 0xc18))->_offset) >> 1 & ((std_deque *)((int)local_2c + 0xc18))->_mapSize - 1) * 4) + ((uint)(&local_28->field_0x2 + ((std_deque *)((int)local_2c + 0xc18))->_offset) & 1) * 8) = fVar11; npc = (Entity_NPC *)local_2c; local_28 = (EntityPtr *)puVar5; } while (puVar5 < (undefined1 *)((std_deque *)((int)local_2c + 0xc04))->_size); } trailDeque = &npc->_vectorDeque2; local_38.x = 1.4; local_38.y = 0.0; std::deque::push_back(trailDeque,&local_38); fVar12 = (npc->_velocity).x; fVar11 = (npc->_velocity).y; fVar12 = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); if (fVar12 <= 0.0) { local_28 = (EntityPtr *)(npc->_velocity).x; local_2c = (EntityPtr)(npc->_velocity).y; } else { local_28 = (EntityPtr *)((npc->_velocity).x * (8.0 / fVar12)); local_2c = (EntityPtr)((npc->_velocity).y * (8.0 / fVar12)); } fVar12 = sin(npc->_updateTime * 0.4); local_40.y = fVar12 * 30.0 * 0.017453292; local_38.y = cos(local_40.y); fVar12 = sin(local_40.y); local_38.x = -(local_38.y * (float)local_28 - fVar12 * (float)local_2c); local_38.y = -(fVar12 * (float)local_28 + local_38.y * (float)local_2c); std::deque::push_back(trailDeque,&local_38); local_38.x = (npc->_posOffset).x + (npc->_pos).x; local_38.y = (npc->_posOffset).y + (npc->_pos).y; std::deque::push_back(trailDeque,&local_38); if ((npc->_vectorDeque2)._size != 0) { do { uVar7 = (npc->_vectorDeque2)._size; uVar8 = ((npc->_vectorDeque2)._offset + uVar7) - 1; if (0.0 < *(float *)(*(int *)((int)(npc->_vectorDeque2)._map + ((npc->_vectorDeque2)._mapSize - 1 & uVar8 >> 1) * 4) + (uVar8 & 1) * 8)) break; if (uVar7 == 1) { (npc->_vectorDeque2)._offset = 0; LAB_00597c51: (npc->_vectorDeque2)._size = uVar7 - 3; if (uVar7 - 3 == 0) { (npc->_vectorDeque2)._offset = 0; break; } } else { if (uVar7 != 2) goto LAB_00597c51; (npc->_vectorDeque2)._offset = 0; (npc->_vectorDeque2)._size = 0xffffffff; } } while (uVar7 != 3); } fVar12 = atan2f((npc->_velocity).y,(npc->_velocity).x); (npc->_sprite)._rotation = fVar12 * 57.295776 + 90.0; if (local_18 != 2.8026e-45) { std::deque::assign(&npc->_vectorDeque2); } return; switchD_00597234_caseD_8: if (npc->_target != (EntityPtr)0x0) { fVar12 = (npc->_v2).x; pVVar4 = &npc->_v2; fVar11 = (npc->_v2).y; local_28 = (EntityPtr *)((fVar12 + fVar12) * npc->_speedMultiplier + (npc->_velocity).x); local_2c = (EntityPtr)((fVar11 + fVar11) * npc->_speedMultiplier + (npc->_velocity).y); (npc->_velocity).x = (float)local_28; (npc->_velocity).y = (float)local_2c; fVar12 = sqrtf((float)local_28 * (float)local_28 + (float)local_2c * (float)local_2c); if ((20.0 < fVar12) && (0.0 < fVar12)) { (npc->_velocity).x = (20.0 / fVar12) * (float)local_28; (npc->_velocity).y = (float)local_2c * (20.0 / fVar12); } iVar6 = npc->_stateFrame; if (iVar6 < 0x28) { local_18 = *(float *)((int)npc->_target + 0x340) - (npc->_pos).y; local_24._8_4_ = *(float *)((int)npc->_target + 0x33c) - (npc->_pos).x; fVar12 = (float)iVar6 * 0.25; if (20.0 <= fVar12) { fVar12 = 20.0; } steer = Vector::Resized((Vector *)(local_24 + 8),&local_38,fVar12); fVar12 = npc->_speedMultiplier; fVar11 = steer->y; pVVar4->x = fVar12 * steer->x + pVVar4->x; (npc->_v2).y = fVar12 * fVar11 + (npc->_v2).y; Vector::Normalize(pVVar4); iVar6 = npc->_stateFrame; } iVar6 = ((int)npc->_updateTime - (int)npc->_prevUpdateTime) + iVar6; npc->_stateFrame = iVar6; if (iVar6 < 0x3d) { return; } } npc->_state = 5; return; } //@@ 00597d00 NpcHelper::beast_soul_render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_NPC::Render case 0x3b7 (ENTITY_BEAST) -> FUN_00598260 calls it when variant == 3 (else Entity::Render); projects the npc trail deque +0xc1c through the background parallax (338x182, x0.65) into static vector g_beastTrailPoints and draws it with BeamRenderer::Add/End (variant 3 = the Beast's soul per wiki, unverified) */ void NpcHelper::beast_soul_render(float *param_1) { Vector *point; int iVar1; int in_ECX; uint dequeIndex; uint uVar2; float fVar3; float fVar4; double dVar5; float smoothedPointX; float fStack_5c; undefined4 uStack_58; float fStack_54; float firstPointX; float fStack_4c; float fStack_48; float fStack_44; float local_40; float local_3c; ColorMod pointColor; uint local_c; undefined1 auStack_8 [4]; float *screenPointsEnd; void *trailPointsEnd; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (8 < *(uint *)(in_ECX + 0xc28)) { iVar1 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar1 + 0xc) < DAT_00c7f838) && (_Init_thread_header(), DAT_00c7f838 == -1)) { _atexit((_func_4879 *)&LAB_00b15560); _Init_thread_footer(); } if ((*(int *)(iVar1 + 0xc) < DAT_00c7f848) && (_Init_thread_header(), DAT_00c7f848 == -1)) { _atexit((_func_4879 *)&LAB_00b15500); _Init_thread_footer(); } uVar2 = 0; DAT_00c7f840 = DAT_00c7f83c; g_beastTrailPointsEnd = g_beastTrailPoints; if (*(int *)(in_ECX + 0xc28) != 0) { do { screenPointsEnd = DAT_00c7f840; fStack_54 = *(float *)(in_ECX + 0xc24); local_40 = g_displayPixelRatio * g_screenPointScale; dequeIndex = (int)fStack_54 + uVar2 & 1; iVar1 = *(int *)(*(int *)(in_ECX + 0xc1c) + (*(int *)(in_ECX + 0xc20) - 1U & (int)fStack_54 + uVar2 >> 1) * 4); fStack_48 = *(float *)(iVar1 + dequeIndex * 8); fStack_44 = *(float *)(iVar1 + 4 + dequeIndex * 8); local_3c = ((g_screenWidth - 338.0) * 0.5 + (fStack_48 - 60.0) * 0.65) * local_40 + 0.5; dVar5 = floor((double)local_3c); fStack_54 = (float)dVar5 / local_40; local_3c = ((g_screenHeight - 182.0) * 0.5 + (fStack_44 - 140.0) * 0.65) * local_40 + 0.5; dVar5 = floor((double)local_3c); local_3c = (float)dVar5; fStack_48 = fStack_54 + *param_1; fStack_44 = local_3c / local_40 + param_1[1]; if (screenPointsEnd == DAT_00c7f844) { std::vector::_Emplace_reallocate(screenPointsEnd,&fStack_48); } else { *screenPointsEnd = fStack_48; DAT_00c7f840[1] = fStack_44; DAT_00c7f840 = DAT_00c7f840 + 2; } uVar2 = uVar2 + 3; } while (uVar2 < *(uint *)(in_ECX + 0xc28)); } trailPointsEnd = g_beastTrailPointsEnd; firstPointX = *DAT_00c7f83c; fStack_4c = DAT_00c7f83c[1]; uVar2 = *(int *)(in_ECX + 0xc24) + 2; local_40 = 0.0; fStack_44 = 0.0; fStack_48 = *(float *)(*(int *)(*(int *)(in_ECX + 0xc1c) + (uVar2 >> 1 & *(int *)(in_ECX + 0xc20) - 1U) * 4) + (uVar2 & 1) * 8); if (g_beastTrailPointsEnd == DAT_00c7f854) { FUN_00598290(g_beastTrailPointsEnd,&firstPointX); } else { *(float *)g_beastTrailPointsEnd = firstPointX; *(float *)((int)trailPointsEnd + 4) = fStack_4c; *(float *)((int)trailPointsEnd + 8) = fStack_48; *(undefined4 *)((int)trailPointsEnd + 0xc) = 0; g_beastTrailPointsEnd = (void *)((int)g_beastTrailPointsEnd + 0x10); } fVar3 = 0.0; uVar2 = 1; if (1 < ((int)DAT_00c7f840 - (int)DAT_00c7f83c >> 3) - 1U) { local_3c = 4.2039e-45; do { trailPointsEnd = g_beastTrailPointsEnd; dequeIndex = (int)local_3c + *(int *)(in_ECX + 0xc24) + 2; fStack_54 = 0.0; smoothedPointX = DAT_00c7f83c[uVar2 * 2 + -2] * 0.3 + DAT_00c7f83c[uVar2 * 2] * 0.4 + DAT_00c7f83c[uVar2 * 2 + 2] * 0.3; fStack_5c = DAT_00c7f83c[uVar2 * 2 + -1] * 0.3 + DAT_00c7f83c[uVar2 * 2 + 1] * 0.4 + DAT_00c7f83c[uVar2 * 2 + 3] * 0.3; uStack_58 = *(undefined4 *) (*(int *)(*(int *)(in_ECX + 0xc1c) + (*(int *)(in_ECX + 0xc20) - 1U & dequeIndex >> 1) * 4) + (dequeIndex & 1) * 8); if (g_beastTrailPointsEnd == DAT_00c7f854) { FUN_00598290(g_beastTrailPointsEnd,&smoothedPointX); } else { *(float *)g_beastTrailPointsEnd = smoothedPointX; *(float *)((int)trailPointsEnd + 4) = fStack_5c; *(undefined4 *)((int)trailPointsEnd + 8) = uStack_58; *(undefined4 *)((int)trailPointsEnd + 0xc) = 0; g_beastTrailPointsEnd = (void *)((int)g_beastTrailPointsEnd + 0x10); } trailPointsEnd = g_beastTrailPointsEnd; iVar1 = (int)g_beastTrailPointsEnd - (int)g_beastTrailPoints >> 4; fVar3 = *(float *)((int)g_beastTrailPoints + (iVar1 + -2) * 0x10 + 4) - *(float *)((int)g_beastTrailPoints + iVar1 * 0x10 + -0xc); fVar4 = *(float *)((int)g_beastTrailPoints + (iVar1 + -2) * 0x10) - *(float *)((int)g_beastTrailPoints + iVar1 * 0x10 + -0x10); fVar3 = sqrtf(fVar3 * fVar3 + fVar4 * fVar4); fVar3 = fVar3 + local_40; uVar2 = uVar2 + 1; local_3c = (float)((int)local_3c + 3); *(float *)((int)trailPointsEnd + -4) = fVar3; local_40 = fVar3; } while (uVar2 < ((int)DAT_00c7f840 - (int)DAT_00c7f83c >> 3) - 1U); } local_3c = 1.0; if ((128.0 < fVar3) && (local_3c = 128.0 / fVar3, local_3c <= 0.5)) { local_3c = 0.5; } DAT_00c78ef0 = in_ECX + 0x48; uVar2 = 0; DAT_00c78ef4 = 0; DAT_00c78ef8._0_2_ = 0; g_beamRendererPointsEnd = g_beamRendererPoints; if ((int)g_beastTrailPointsEnd - (int)g_beastTrailPoints >> 4 != 0) { iVar1 = 0; do { point = (Vector *)(iVar1 + (int)g_beastTrailPoints); pointColor._offset[0] = 0.0; pointColor._offset[1] = 0.0; pointColor._offset[2] = 0.0; pointColor._colorize[0] = 0.0; pointColor._colorize[1] = 0.0; pointColor._colorize[2] = 0.0; pointColor._colorize[3] = 0.0; pointColor._tint[3] = point[1].x; pointColor._tint[0] = 1.0; pointColor._tint[1] = 1.0; pointColor._tint[2] = 1.0; BeamRenderer::Add(point,&pointColor,local_3c,local_3c * point[1].y); iVar1 = iVar1 + 0x10; uVar2 = uVar2 + 1; } while (uVar2 < (uint)((int)g_beastTrailPointsEnd - (int)g_beastTrailPoints >> 4)); } BeamRenderer::End(); } return; } //@@ 00598260 FUN_00598260 void FUN_00598260(Vector *param_1) { Entity *in_ECX; if (in_ECX->_variant == 3) { NpcHelper::beast_soul_render(param_1); return; } Entity::Render(in_ECX,param_1); return; } //@@ 00598290 FUN_00598290 undefined4 * FUN_00598290(undefined4 *param_1,undefined4 *param_2) { uint uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; int iVar9; undefined4 *puVar10; void *pvVar11; uint uVar12; uint uVar13; uint uVar14; undefined4 *puVar15; iVar9 = (int)g_beastTrailPointsEnd - (int)g_beastTrailPoints >> 4; uVar14 = (int)param_1 - (int)g_beastTrailPoints; if (iVar9 == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar9 + 1; uVar12 = (int)DAT_00c7f854 - (int)g_beastTrailPoints >> 4; if (0xfffffff - (uVar12 >> 1) < uVar12) { uVar13 = 0xfffffff; } else { uVar12 = (uVar12 >> 1) + uVar12; uVar13 = uVar1; if (uVar1 <= uVar12) { uVar13 = uVar12; } if (0xfffffff < uVar13) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar10 = std::_Allocate(uVar13 * 0x10); puVar15 = (undefined4 *)((uVar14 & 0xfffffff0) + (int)puVar10); uVar2 = param_2[1]; uVar3 = param_2[2]; uVar4 = param_2[3]; *puVar15 = *param_2; puVar15[1] = uVar2; puVar15[2] = uVar3; puVar15[3] = uVar4; pvVar11 = g_beastTrailPointsEnd; puVar5 = puVar10; puVar6 = g_beastTrailPoints; puVar7 = g_beastTrailPointsEnd; if (param_1 == g_beastTrailPointsEnd) { for (; puVar6 != pvVar11; puVar6 = puVar6 + 4) { uVar2 = puVar6[1]; uVar3 = puVar6[2]; uVar4 = puVar6[3]; *puVar5 = *puVar6; puVar5[1] = uVar2; puVar5[2] = uVar3; puVar5[3] = uVar4; puVar5 = puVar5 + 4; } } else { for (; puVar8 = puVar15, g_beastTrailPointsEnd = puVar7, puVar6 != param_1; puVar6 = puVar6 + 4) { uVar2 = puVar6[1]; uVar3 = puVar6[2]; uVar4 = puVar6[3]; *puVar5 = *puVar6; puVar5[1] = uVar2; puVar5[2] = uVar3; puVar5[3] = uVar4; puVar5 = puVar5 + 4; puVar7 = g_beastTrailPointsEnd; } for (; param_1 != puVar7; param_1 = param_1 + 4) { uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; puVar8[4] = *param_1; puVar8[5] = uVar2; puVar8[6] = uVar3; puVar8[7] = uVar4; puVar8 = puVar8 + 4; } } if (g_beastTrailPoints != (void *)0x0) { uVar14 = (int)DAT_00c7f854 - (int)g_beastTrailPoints & 0xfffffff0; pvVar11 = g_beastTrailPoints; if (0xfff < uVar14) { pvVar11 = *(void **)((int)g_beastTrailPoints + -4); uVar14 = uVar14 + 0x23; if (0x1f < (uint)((int)g_beastTrailPoints + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar14); } g_beastTrailPoints = puVar10; g_beastTrailPointsEnd = puVar10 + uVar1 * 4; DAT_00c7f854 = puVar10 + uVar13 * 4; return puVar15; } //@@ 005983f0 NpcAI::ENTITY_POLYCEPHALUS_the_pile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from NpcAI::ENTITY_POLYCEPHALUS when npc->_variant==1 (The Pile); strs GoUnder/ComeUp/DirtShrink/Summon */ void __fastcall NpcAI::ENTITY_POLYCEPHALUS_the_pile(Entity_NPC *npc) { RNG rng; Vector pos; Vector pos_00; float *pfVar1; byte bVar2; Entity **ppEVar3; Entity *maxWallDist; ColorMod *color; undefined1 *puVar4; uint flagsHigh; Vector *tmpVec; int iVar6; uint seed; Entity *pEVar7; Entity **ppEVar8; WeightedOutcomePicker ptr; int iVar9; float npcDistSq; Entity_NPC *maxWallDist; float fVar11; undefined1 durationScale [12]; float fVar12; undefined1 auStack_140 [8]; float fStack_138; Vector scratchVec; float local_12c; Entity_NPC *local_128; Vector local_124; Vector local_11c; Entity *local_114; WeightedOutcomePicker picker; Vector local_10c; Entity *local_104; Room *local_100; Entity *local_fc; ProjectileParams projParams; Color tmpColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; undefined4 flagsHigh; Manager *manager; EntityPtr *parentPtr; void *playerY; Room *room; ColorMod *spawnedColor; ANM2 *sprite; int *weight; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af5700; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&tmpColor)[1]._colorize + 1); ExceptionList = &local_1c; room = g_game->_room; pEVar7 = (Entity *)((int)npc->_updateTime - (int)npc->_prevUpdateTime); npc->_friction = npc->_friction * 0.8; local_128 = npc; local_100 = room; local_fc = pEVar7; switch(npc->_state) { case 0: npc->_state = 3; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; flagsHigh = Random(); npc->_stateFrame = flagsHigh % 0x1e + 0x1e; *(undefined1 *)&npc->_i1 = 1; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; break; case 3: puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; Entity_NPC::UpdateDirtColor(npc,0); ANM2::Play(&npc->_sprite,s_Idle,0); PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,0.3,0); if (npc->_stateFrame < 1) { picker = (WeightedOutcomePicker)0x0; local_10c.x = 0.0; local_10c.y = 0.0; local_14 = 0.0; if ((char)npc->_i1 == '\0') { auStack_140 = (undefined1 [8])((ulonglong)auStack_140 & 0xffffffff); fStack_138 = 1.4013e-45; std::vector<8byte>::_Emplace_reallocate(0,auStack_140 + 4); flagsHigh = 0; local_fc = (Entity *)((int)local_10c.x - (int)picker >> 3); if (local_fc != (Entity *)0x0) { do { if (*(int *)((int)picker + flagsHigh * 8) == 1) { weight = (int *)((int)picker + 4 + flagsHigh * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)picker + 4 + flagsHigh * 8) = 0; } goto LAB_005985ff; } flagsHigh = flagsHigh + 1; } while (flagsHigh < local_fc); } auStack_140._4_4_ = 1; fStack_138 = 1.4013e-45; if (local_10c.x == local_10c.y) { std::vector<8byte>::_Emplace_reallocate(local_10c.x,auStack_140 + 4); } else { *(undefined4 *)local_10c.x = 1; *(undefined4 *)((int)local_10c.x + 4) = 1; local_10c.x = (float)((int)local_10c.x + 8); } } LAB_005985ff: iVar9 = *(int *)&room->field_0x12c4 + room->_aliveEnemyCount; iVar6 = 0; if (0 < iVar9) { iVar6 = iVar9; } if (iVar6 < 3) { flagsHigh = 0; local_fc = (Entity *)((int)local_10c.x - (int)picker >> 3); if (local_fc != (Entity *)0x0) { do { if (*(int *)((int)picker + flagsHigh * 8) == 2) { weight = (int *)((int)picker + 4 + flagsHigh * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)picker + 4 + flagsHigh * 8) = 0; } goto LAB_005986b3; } flagsHigh = flagsHigh + 1; } while (flagsHigh < local_fc); } auStack_140._4_4_ = 2; fStack_138 = 1.4013e-45; if (local_10c.x == local_10c.y) { std::vector<8byte>::_Emplace_reallocate(local_10c.x,auStack_140 + 4); } else { *(undefined4 *)local_10c.x = 2; *(undefined4 *)((int)local_10c.x + 4) = 1; local_10c.x = (float)((int)local_10c.x + 8); } } LAB_005986b3: flagsHigh = 0; local_fc = (Entity *)((int)local_10c.x - (int)picker >> 3); if (local_fc != (Entity *)0x0) { do { if (*(int *)((int)picker + flagsHigh * 8) == 3) { weight = (int *)((int)picker + 4 + flagsHigh * 8); *weight = *weight + 1; if (*weight < 0) { *(undefined4 *)((int)picker + 4 + flagsHigh * 8) = 0; } goto LAB_00598737; } flagsHigh = flagsHigh + 1; } while (flagsHigh < local_fc); } auStack_140._4_4_ = 3; fStack_138 = 1.4013e-45; if (local_10c.x == local_10c.y) { std::vector<8byte>::_Emplace_reallocate(local_10c.x,auStack_140 + 4); } else { *(undefined4 *)local_10c.x = 3; *(undefined4 *)((int)local_10c.x + 4) = 1; local_10c.x = (float)((int)local_10c.x + 8); } LAB_00598737: flagsHigh = Random(); auStack_140 = (undefined1 [8])0x900000005; fStack_138 = 9.80909e-45; rng._shift1 = 5; rng._seed = flagsHigh | 1; rng._shift2 = 9; rng._shift3 = 7; flagsHigh = WeightedOutcomePicker::PickOutcome(&picker,rng); maxWallDist = local_128; manager = g_manager; if (flagsHigh == 0) { npc->_state = 9; npc->_projectileCooldown = 0; } else if (flagsHigh == 1) { npc->_state = 0xe; local_fc = (Entity *)(int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); local_114 = (Entity *)((room->_gridWidth - (int)local_fc) + -1); local_104 = (Entity *)(int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); pEVar7 = (Entity *)((local_100->_gridHeight - (int)local_104) + -1); ppEVar8 = &local_104; if ((int)local_104 <= (int)local_fc) { ppEVar8 = &local_fc; } ppEVar3 = &local_114; if ((int)local_114 <= (int)*ppEVar8) { ppEVar3 = ppEVar8; } maxWallDist = *ppEVar3; if ((int)*ppEVar3 < (int)pEVar7) { maxWallDist = pEVar7; } local_128->_projectileDelay = (int)maxWallDist * 2; local_128->_projectileCooldown = 6; Entity_NPC::PlaySound(local_128,0x133,1.0,2,0,1.0); npc = maxWallDist; } else if (flagsHigh == 2) { npc->_state = 0xd; } else { npc->_state = 6; npc->_projectileDelay = 3; *(undefined1 *)((int)&npc->_i1 + 1) = 0; local_100 = (Room *)0x42; seed_fart_sound_override((int *)&local_100); SoundEffects::Play(&manager->_sfxManager,(int)local_100,1.0,10,0,1.0,0.0); } *(undefined1 *)&npc->_i1 = 0; if (picker != (WeightedOutcomePicker)0x0) { flagsHigh = (int)local_10c.y - (int)picker & 0xfffffff8; ptr = picker; if (0xfff < flagsHigh) { ptr = *(WeightedOutcomePicker *)((int)picker + -4); flagsHigh = flagsHigh + 0x23; if (0x1f < ((int)picker - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,flagsHigh); } } else { npc->_stateFrame = npc->_stateFrame - (int)local_fc; } break; case 6: puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; Entity_NPC::UpdateDirtColor(npc,0); sprite = &npc->_sprite; if (*(char *)((int)&npc->_i1 + 1) == '\0') { ANM2::Play(sprite,(byte *)"GoUnder",0); bVar2 = ANM2::IsFinishedImpl(&npc->_sprite,(byte *)"GoUnder"); if (bVar2 != 0) { (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; (npc->_v1).x = (npc->_pos).x; (npc->_v1).y = (npc->_pos).y; *(undefined1 *)((int)&npc->_i1 + 1) = 1; npc->_projectileCooldown = 10; } } else if (npc->_projectileCooldown < 1) { if (npc->_projectileCooldown == 0) { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; ANM2::Play(sprite,(byte *)"ComeUp",0); npc->_projectileCooldown = -1; Entity_NPC::UpdateDirtColor(npc,1); } else { iVar6 = ANM2::GetFrame(sprite); if (iVar6 == 1) { npc->_entityCollisionClass = 4; } bVar2 = ANM2::IsFinishedImpl(&npc->_sprite,(byte *)"ComeUp"); if (bVar2 != 0) { pEVar7 = Entity_NPC::GetPlayerTarget(npc); fVar11 = (pEVar7->_pos).y; (npc->_targetPosition).x = (pEVar7->_pos).x; (npc->_targetPosition).y = fVar11; npc->_state = 8; } } } else { ANM2::Play(sprite,(byte *)"DirtShrink",0); npc->_entityCollisionClass = 0; bVar2 = Vector::operator_eq(&npc->_targetPosition,&g_vectorZero); if (bVar2 == 0) { iVar9 = npc->_projectileCooldown + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); iVar6 = 0; if (0 < iVar9) { iVar6 = iVar9; } npc->_projectileCooldown = iVar6; if ((iVar6 == 0) || ((0 < (int)local_fc && (iVar6 % 3 == 0)))) { local_100 = (Room *)Game::GetNearestTargetPlayer (&npc->_targetPosition,(Entity *)npc,0,0,(void *)0x0,5000.0) ; local_11c.y = (npc->_targetPosition).x; fVar11 = (float)local_100->_gridEntities[0xc6] - local_11c.y; local_124.y = (npc->_targetPosition).y; fVar12 = (float)local_100->_gridEntities[199] - local_124.y; if (fVar12 * fVar12 + fVar11 * fVar11 <= 6400.0) { local_128 = (Entity_NPC *)0x461c4000; local_12c = 1.4013e-44; do { local_fc = local_100->_gridEntities[0xc6]; playerY = local_100->_gridEntities[199]; flagsHigh = Random(); fVar11 = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 3.14; local_104 = (Entity *)(fVar11 + fVar11); flagsHigh = Random(); local_114 = (Entity *) (((float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8) * 120.0); fVar11 = cos((float)local_104); local_10c.x = fVar11 * (float)local_114 + (float)local_fc; fVar11 = sin((float)local_104); local_10c.y = fVar11 * (float)local_114 + (float)playerY; Room::FindFreePickupSpawnPosition(room,&scratchVec,&local_10c,40.0,1,0,0); bVar2 = Room::IsPositionInRoom(room,&scratchVec,0.0); if (bVar2 != 0) { pos.y = scratchVec.y; pos.x = scratchVec.x; iVar6 = Room::GetGridCollisionAtPos(room,pos); if ((iVar6 == 0) && (fVar11 = (float)local_100->_gridEntities[0xc6] - scratchVec.x, fVar12 = (float)local_100->_gridEntities[199] - scratchVec.y, 6400.0 < fVar12 * fVar12 + fVar11 * fVar11)) { maxWallDist = (Entity_NPC *) ((local_124.y - scratchVec.y) * (local_124.y - scratchVec.y) + (local_11c.y - scratchVec.x) * (local_11c.y - scratchVec.x)); if ((float)maxWallDist < (float)local_128) { (npc->_targetPosition).x = scratchVec.x; (npc->_targetPosition).y = scratchVec.y; local_128 = maxWallDist; } } } local_12c = (float)((int)local_12c + -1); } while (local_12c != 0.0); iVar6 = npc->_projectileCooldown; if (iVar6 < 1) { iVar6 = 1; } npc->_projectileCooldown = iVar6; local_12c = 0.0; } } PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,&npc->_targetPosition,2.0,0,1); } else { local_fc = (Entity *)0x0; Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0); local_104 = (Entity *)0xa; local_100 = (Room *)0x0; local_114 = (Entity *)0x0; do { flagsHigh = Random(); local_12c = (float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c = local_12c + local_12c; flagsHigh = Random(); local_128 = (Entity_NPC *) (((float)((double)(int)flagsHigh + __uint_to_double_fixup[-((int)flagsHigh >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8) * 120.0); fVar11 = cos(local_12c); local_11c.x = fVar11 * (float)local_128 + scratchVec.x; fVar11 = sin(local_12c); local_11c.y = fVar11 * (float)local_128 + scratchVec.y; Room::FindFreePickupSpawnPosition(room,&local_124,&local_11c,0.0,1,0,0); bVar2 = Room::IsPositionInRoom(room,&local_124,0.0); if (bVar2 != 0) { iVar9 = (int)((local_124.x - 40.0) / 40.0 + 0.5); iVar6 = (int)((local_124.y - 120.0) / 40.0 + 0.5); if ((((iVar9 < 0) || (room->_gridWidth <= iVar9)) || (iVar6 < 0)) || (room->_gridHeight <= iVar6)) { iVar9 = -1; } else { iVar9 = iVar6 * room->_gridWidth + iVar9; } flagsHigh = Room::GetGridCollision(room,iVar9); if (((flagsHigh == 0) && (pEVar7 = Game::GetNearestTargetPlayer (&local_124,(Entity *)npc,0,0,(void *)0x0,5000.0), pEVar7 != (Entity *)0x0)) && (fVar11 = (pEVar7->_pos).x - local_124.x, fVar12 = (pEVar7->_pos).y - local_124.y, fVar11 = fVar12 * fVar12 + fVar11 * fVar11, 6400.0 < fVar11)) { npcDistSq = (npc->_pos).x - local_124.x; fVar12 = (npc->_pos).y - local_124.y; npcDistSq = fVar12 * fVar12 + npcDistSq * npcDistSq; fVar12 = 22500.0; if (npcDistSq <= 22500.0) { fVar12 = npcDistSq; } pEVar7 = (Entity *)(fVar12 + fVar11 + fVar11); if ((float)local_114 < (float)pEVar7) { local_100 = (Room *)local_124.x; local_fc = (Entity *)local_124.y; local_114 = pEVar7; } } } local_104 = (Entity *)((int)&local_104[-1]._luaBridgeRef + 3); } while (local_104 != (Entity *)0x0); (npc->_targetPosition).x = (float)local_100; (npc->_targetPosition).y = (float)local_fc; fVar12 = (npc->_pos).x - (float)local_100; fVar11 = (npc->_pos).y - (float)local_fc; fVar11 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); durationScale = ZEXT812(0x3f800000); if (durationScale._0_4_ <= fVar11 / 100.0) { durationScale._4_8_ = durationScale._4_8_; durationScale._0_4_ = fVar11 / 100.0; } npc->_projectileCooldown = (int)(durationScale._0_4_ * 6.0); } } break; case 8: local_124.y = (float)s_Attack1; if (npc->_projectileDelay < 2) { local_124.y = (float)&DAT_00b1d2e4; } puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; ANM2::Play(&npc->_sprite,(byte *)local_124.y,0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { Entity_NPC::PlaySound(npc,0x132,1.0,2,0,1.0); local_11c.x = (npc->_targetPosition).x - (npc->_pos).x; local_11c.y = (npc->_targetPosition).y - (npc->_pos).y; Vector::Normalize(&local_11c); local_11c.x = local_11c.x * 10.0; local_11c.y = local_11c.y * 10.0; ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_11c,5,&projParams); } bVar2 = ANM2::IsFinishedImpl(&npc->_sprite,(byte *)local_124.y); if (bVar2 != 0) { npc->_projectileDelay = npc->_projectileDelay + -1; if (npc->_projectileDelay < 1) { flagsHigh = Random(); npc->_stateFrame = flagsHigh % 0x1e + 0x1e; npc->_state = 3; *(undefined1 *)((int)&npc->_i1 + 1) = 0; } else { npc->_state = 6; SoundEffects::PlayWithFartOverride(0x42,1.0,10,0,1.0); *(undefined1 *)((int)&npc->_i1 + 1) = 0; } } break; case 9: puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; Entity_NPC::UpdateDirtColor(npc,0); if (npc->_projectileCooldown == 0) { ANM2::Play(&npc->_sprite,(byte *)"ChargeBegin",0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"StartCharge"); if (bVar2 == 0) { ExceptionList = local_1c; return; } pEVar7 = Entity_NPC::GetPlayerTarget(npc); local_10c.x = (pEVar7->_pos).x - (npc->_pos).x; local_10c.y = (pEVar7->_pos).y - (npc->_pos).y; tmpVec = Vector::Normalized(&local_10c,&scratchVec); fVar11 = tmpVec->y; (npc->_v1).x = tmpVec->x * 4.0; (npc->_v1).y = fVar11 * 4.0; Entity_NPC::PlaySound(npc,0x73,1.0,0x14,0,1.0); SoundEffects::PlayWithFartOverride(0x40,1.0,0x14,0,1.0); npc->_projectileCooldown = 1; ExceptionList = local_1c; return; } if (npc->_projectileCooldown == 1) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"ChargeLoop",0); } if (0 < (int)local_fc) { flagsHigh = Random(); Game::Spawn(g_game,1000,0x92,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,flagsHigh); Color::Color(&tmpColor); fVar11 = (npc->_velocity).x; fVar12 = (npc->_velocity).y; local_10c.x = fVar11 + fVar11 + (npc->_pos).x; local_10c.y = fVar12 + fVar12 + (npc->_pos).y; Game::SpawnParticles(g_game,&local_10c,4,2,6.0,color,100000.0,0x20000); } Entity::AddVelocity_divided((Entity *)npc,&npc->_v1,0); if (npc->_collidesWithGrid == 0) { ExceptionList = local_1c; return; } SoundEffects::PlayWithFartOverride(0x34,2.0,2,0,1.0); Game::ShakeScreen(g_game,0xf); npc->_projectileDelay = 0x14; local_104 = (Entity *)0x0; do { flagsHigh = Random(); local_11c.y = (float)Game::Spawn(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,2, flagsHigh); parentPtr = &((Entity *)local_11c.y)->_parent; if (((Entity *)local_11c.y)->_parent != (EntityPtr)0x0) { local_124.y = (float)parentPtr; std::multiset::erase(&local_124.y); } *parentPtr = (EntityPtr)npc; std::multiset::insert(parentPtr); puVar4 = &local_104->field_0x1; *(float *)((((Entity *)((int)local_11c.y + 0x40c))->_sprite)._animDefaultName._buf + 8) = (float)(int)local_104 * 90.0 + 45.0; local_104 = (Entity *)puVar4; } while ((int)puVar4 < 4); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; ANM2::Play(&npc->_sprite,(byte *)"ChargeEnd",0); npc->_projectileCooldown = 2; ExceptionList = local_1c; return; } iVar6 = npc->_projectileDelay; local_100 = (Room *)0x0; if (iVar6 != 0) { pEVar7 = local_fc; do { if ((int)pEVar7 <= (int)local_100) break; npc->_projectileDelay = iVar6 - 1U; if ((iVar6 - 1U & 1) == 0) { local_124.y = (float)Entity_NPC::GetPlayerTarget(npc); ProjectileParams::ProjectileParams(&projParams); projParams.Variant = 1; flagsHigh = Random(); pEVar7 = local_fc; for (iVar6 = (flagsHigh & 1) + 1; local_fc = pEVar7, iVar6 != 0; iVar6 = iVar6 + -1) { local_10c.x = (((Entity *)local_124.y)->_pos).x; local_10c.y = (((Entity *)local_124.y)->_pos).y; Entity_NPC::FireBossProjectiles(npc,1,&local_10c,1.0,&projParams); pEVar7 = local_fc; } } iVar6 = npc->_projectileDelay; local_100 = (Room *)&local_100->field_0x1; } while (iVar6 != 0); } goto LAB_005995d4; case 0xd: ANM2::Play(&npc->_sprite,&DAT_00b1d2e4,0); bVar2 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x109,1.0,2,0,1.0); flagsHigh = Random(); tmpVec = MusicManager::RandomVector(&scratchVec); local_10c.x = tmpVec->x * 60.0 + (npc->_pos).x; local_10c.y = tmpVec->y * 60.0 + (npc->_pos).y; pEVar7 = Game::Spawn(g_game,0xe3,0,&local_10c,&g_vectorZero,(Entity *)npc,0,flagsHigh); (**(code **)(*(int *)pEVar7 + 0xc))(); } LAB_005995d4: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_005995e3: flagsHigh = Random(); npc->_stateFrame = flagsHigh % 0x1e + 0x1e; npc->_state = 3; } break; case 0xe: if (npc->_projectileCooldown == 0) { flagsHigh = npc->_projectileDelay; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; if (0 < (int)flagsHigh) { local_114 = (Entity *)0x0; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; pfVar1 = (&tmpColor)[1]._offset; if (0 < (int)pEVar7) { do { puStack_20 = (undefined1 *)pfVar1; if ((int)flagsHigh < 1) break; if ((flagsHigh & 1) == 0) { iVar6 = Room::GetGridIndex(local_100,&npc->_pos); local_124.y = (float)(iVar6 % local_100->_gridWidth) * 40.0 + 40.0; local_104 = (Entity *)0x0; local_11c.y = (float)(iVar6 / local_100->_gridWidth) * 40.0 + 120.0; do { Isaac::GetAxisAlignedUnitVectorFromDir(&local_10c,(int)local_104); fVar11 = (float)(((int)flagsHigh / 2) * 0x28); auStack_140._4_4_ = local_10c.x * fVar11 + local_124.y; fStack_138 = fVar11 * local_10c.y + local_11c.y; bVar2 = Room::IsPositionInRoom(local_100,(Vector *)(auStack_140 + 4),0.0); if (bVar2 != 0) { pos_00.y = fStack_138; pos_00.x = (float)auStack_140._4_4_; iVar6 = Room::GetGridCollisionAtPos(local_100,pos_00); if (iVar6 == 0) { seed = Random(); pEVar7 = Game::Spawn(g_game,1000,0x37,(Vector *)(auStack_140 + 4),&g_vectorZero, (Entity *)npc,0,seed); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; spawnedColor = &(pEVar7->_sprite)._color; tmpColor._offset[2] = 0.0; if (spawnedColor != (ColorMod *)&tmpColor) { spawnedColor->_tint[0] = 1.0; (pEVar7->_sprite)._color._tint[1] = 1.0; (pEVar7->_sprite)._color._tint[2] = 1.0; (pEVar7->_sprite)._color._tint[3] = 1.0; (pEVar7->_sprite)._color._offset[0] = 0.0; (pEVar7->_sprite)._color._offset[1] = 0.0; (pEVar7->_sprite)._color._colorize[0] = 1.0; (pEVar7->_sprite)._color._colorize[1] = 1.0; (pEVar7->_sprite)._color._colorize[2] = 1.0; (pEVar7->_sprite)._color._colorize[3] = 1.0; (pEVar7->_sprite)._color._offset[2] = 0.0; } (**(code **)(*(int *)pEVar7 + 0xc))(); } } local_104 = (Entity *)&local_104->field_0x1; } while ((int)local_104 < 4); flagsHigh = npc->_projectileDelay; pEVar7 = local_fc; } local_114 = (Entity *)&local_114->field_0x1; flagsHigh = flagsHigh - 1; npc->_projectileDelay = flagsHigh; pfVar1 = (float *)puStack_20; } while ((int)local_114 < (int)pEVar7); } } } else { iVar9 = npc->_projectileCooldown - (int)pEVar7; iVar6 = 0; if (0 < iVar9) { iVar6 = iVar9; } npc->_projectileCooldown = iVar6; puStack_20 = (undefined1 *)(&tmpColor)[1]._offset; } ANM2::Play(&npc->_sprite,(byte *)"Summon",0); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_1c; return; } if (npc->_projectileDelay != 0) { ANM2::Play(&npc->_sprite,s_Idle,0); ExceptionList = local_1c; return; } goto LAB_005995e3; } ExceptionList = local_1c; return; } //@@ 00599950 NpcHelper::tuff_twins_spawn_count /* DB: NpcAI::ENTITY_TUFF_TWINS: variant 2 counts live type 13 + 61 (flies, suckers), variant 3 type 819 (Fly Bombs); the spit/butt attacks need < 4 (pass6_h2.md) */ int NpcHelper::tuff_twins_spawn_count(void) { int iVar1; int *piVar2; int in_ECX; int iVar3; int iVar4; iVar3 = 0; iVar4 = *(int *)((int)g_game->_room + 0x1264); if (iVar4 != 0) { piVar2 = *(int **)((int)g_game->_room + 0x125c); do { if (*(int *)(in_ECX + 0x2c) == 2) { iVar1 = *(int *)(*piVar2 + 0x28); if ((iVar1 == 0xd) || (iVar1 == 0x3d)) { LAB_00599996: iVar3 = iVar3 + 1; } } else if ((*(int *)(in_ECX + 0x2c) == 3) && (*(int *)(*piVar2 + 0x28) == 0x333)) goto LAB_00599996; piVar2 = piVar2 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); } return iVar3; } //@@ 005999b0 NpcHelper::tuff_twins_play_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX = Tuff Twins npc: copies the anim name arg1 into a std::string, appends "B" when +0xbc4 is set (the alternate body), and ANM2::Play's it on the sprite (+0x48); callers are NpcAI::ENTITY_TUFF_TWINS, NpcHelper::tuff_twins_body_attack_anim and sibling state helpers prototype: db/protos.zhl, confirmed by RET 8 */ void NpcHelper::tuff_twins_play_anim(Entity_NPC *npc,byte *animName,int unused) { byte bVar1; uint oldCapacity; byte ****ppppbVar3; uint grownCapacity; byte ****newBuffer; byte *pbVar4; byte ****ptr; byte ****fullAnim [4]; uint fullAnimSize; uint fullAnimCapacity; uint local_14; void *local_10; undefined1 *puStack_c; byte ***local_8; uint oldCapacity; uint oldSize; local_8 = (byte ***)0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; oldCapacity = __security_cookie ^ (uint)(fullAnim + 10); ExceptionList = &local_10; fullAnimSize = 0; fullAnimCapacity = 0xf; fullAnim[0] = (byte ****)0x0; pbVar4 = animName; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); local_14 = oldCapacity; std::string::assign((char *)fullAnim,animName,(int)pbVar4 - (int)(animName + 1)); oldCapacity = fullAnimCapacity; oldSize = fullAnimSize; local_8 = (byte ***)0x0; if (npc->_i2 != 0) { if (fullAnimSize < fullAnimCapacity) { ppppbVar3 = (byte ****)fullAnim; if (0xf < fullAnimCapacity) { ppppbVar3 = fullAnim[0]; } pbVar4 = (byte *)((int)ppppbVar3 + fullAnimSize); fullAnimSize = fullAnimSize + 1; pbVar4[0] = 0x42; pbVar4[1] = 0; } else { if (fullAnimSize == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(oldCapacity); } oldCapacity = fullAnimSize + 1 | 0xf; if (oldCapacity < 0x80000000) { if (0x7fffffff - (fullAnimCapacity >> 1) < fullAnimCapacity) { oldCapacity = 0x7fffffff; } else { grownCapacity = (fullAnimCapacity >> 1) + fullAnimCapacity; if (oldCapacity < grownCapacity) { oldCapacity = grownCapacity; } } } else { oldCapacity = 0x7fffffff; } newBuffer = std::_Allocate(oldCapacity + 1); ppppbVar3 = fullAnim[0]; fullAnimSize = oldSize + 1; pbVar4 = (byte *)((int)newBuffer + oldSize + 1); fullAnimCapacity = oldCapacity; if (oldCapacity < 0x10) { memcpy(newBuffer,fullAnim,oldSize); *(byte *)((int)newBuffer + oldSize) = 0x42; *pbVar4 = 0; } else { memcpy(newBuffer,fullAnim[0],oldSize); oldCapacity = oldCapacity + 1; *(byte *)((int)newBuffer + oldSize) = 0x42; *pbVar4 = 0; ptr = ppppbVar3; if (0xfff < oldCapacity) { ptr = (byte ****)ppppbVar3[-1]; oldCapacity = oldCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbVar3 + (-4 - (int)ptr))) goto LAB_00599b4a; } operator_delete(ptr,oldCapacity); } fullAnim[0] = newBuffer; } } ppppbVar3 = (byte ****)fullAnim; if (0xf < fullAnimCapacity) { ppppbVar3 = fullAnim[0]; } ANM2::Play(&npc->_sprite,(byte *)ppppbVar3,0); if (0xf < fullAnimCapacity) { oldCapacity = fullAnimCapacity + 1; ppppbVar3 = fullAnim[0]; if (0xfff < oldCapacity) { ppppbVar3 = (byte ****)fullAnim[0][-1]; oldCapacity = fullAnimCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)fullAnim[0] + (-4 - (int)ppppbVar3))) { LAB_00599b4a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,oldCapacity); } ExceptionList = local_10; return; } //@@ 00599b80 NpcAI::ENTITY_TUFF_TWINS_head_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=npc (Tuff Twins): variant 3 plays "HeadRotate" at angle +0xbb4 (Bounce null), else WalkHeadDown/Up/Hori and WalkHeadOverlay by velocity; twice from NpcAI::ENTITY_TUFF_TWINS (sibling of the body anim 00599d70) */ void __fastcall NpcAI::ENTITY_TUFF_TWINS_head_anim(Entity_NPC *npc) { byte *pbVar1; byte bVar2; void *pvVar3; byte *pbVar4; char *pcVar5; uint uVar6; int iVar7; bool bVar8; float x; char *local_24 [4]; char *local_14; local_14 = (char *)(__security_cookie ^ (uint)(local_24 + 5)); if (npc->_variant == 3) { x = (npc->_v1).y; if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } uVar6 = (int)((x + 360.0) / 45.0 + 0.5) & 0x80000007; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffff8) + 1; } iVar7 = uVar6 * 2; if ((((npc->_sprite)._overlayAnimState._animData != (void *)0x0) && (pvVar3 = AnimationState::GetNullFrame(&(npc->_sprite)._overlayAnimState,(byte *)"Bounce"), pvVar3 != (void *)0x0)) && (0.0 < *(float *)((int)pvVar3 + 0x18))) { iVar7 = iVar7 + 1; } bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"HeadRotate",1); if (((bVar2 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)iVar7), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } pbVar1 = (npc->_sprite)._overlayAnimState._animData; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pcVar5 = "WalkHeadOverlay"; do { bVar2 = *pbVar4; bVar8 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_00599cd0: uVar6 = -(uint)bVar8 | 1; goto LAB_00599cd5; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar8 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_00599cd0; pbVar4 = pbVar4 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar6 = 0; LAB_00599cd5: if (uVar6 == 0) { if (pbVar1[0x34] == 0) { return; } if ((npc->_sprite)._overlayAnimState._isPlaying != 0) { return; } } } bVar2 = ANM2::SetOverlayAnimation(&npc->_sprite,(byte *)"WalkHeadOverlay",1); if (bVar2 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; return; } } else { local_24[0] = "WalkHeadHori"; local_24[1] = "WalkHeadUp"; local_24[2] = "WalkHeadHori"; local_24[3] = "WalkHeadDown"; NpcHelper::tuff_twins_play_anim(npc,(byte *)local_24[npc->_i1],(int)npc); (npc->_sprite)._flipX = npc->_i1 == 0; } return; } //@@ 00599d70 NpcAI::ENTITY_TUFF_TWINS_body_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=npc (Tuff Twins, variant != 3): picks Body1/2/3 Hori/Vert by direction to the parent (+0x3bc) and segment index (+0x3ec % 3), calls NpcHelper::tuff_twins_play_anim and sets the flipX byte +0x148; ButtIdle/GutsIdle/WalkBodyOverlay/BodyRotate for variant 3; from NpcAI::ENTITY_TUFF_TWINS */ void __fastcall NpcAI::ENTITY_TUFF_TWINS_body_anim(Entity_NPC *npc) { float fVar1; float fVar2; byte bVar3; char *anim; uint uVar4; int unused; float fVar5; float fVar6; char *local_2c [4]; char *local_1c; char *local_18; char *local_14; local_14 = (char *)(__security_cookie ^ (uint)(local_2c + 7)); if (npc->_variant != 3) { unused = 3; local_2c[0] = "Body1Hori"; local_2c[1] = "Body1Vert"; local_2c[2] = "Body2Hori"; local_2c[3] = "Body2Vert"; fVar6 = *(float *)((int)npc->_parent + 0x33c) - (npc->_pos).x; fVar5 = *(float *)((int)npc->_parent + 0x340) - (npc->_pos).y; local_1c = "Body3Hori"; local_18 = "Body3Vert"; if (ABS(fVar6) <= ABS(fVar5)) { uVar4 = (uint)(0.0 <= fVar5) * 2 + 1; } else { unused = 0; uVar4 = 2; if (fVar6 < 0.0) { uVar4 = 0; } } NpcHelper::tuff_twins_play_anim (npc,(byte *)local_2c[(uVar4 & 1) + ((uint)npc->_initSeed % 3) * 2],unused); (npc->_sprite)._flipX = uVar4 == 0; return; } if (npc->_i2 != 0) { anim = "ButtIdle"; if (npc->_child != (EntityPtr)0x0) { anim = "GutsIdle"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); AnimationState::SetAnimationData(&(npc->_sprite)._overlayAnimState,(void *)0x0); return; } fVar5 = *(float *)((int)npc->_parent + 0x33c); fVar6 = *(float *)((int)npc->_parent + 0x340); fVar1 = (npc->_pos).x; fVar2 = (npc->_pos).y; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"BodyRotate",1); if ((bVar3 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) { fVar5 = atan2f(fVar6 - fVar2,fVar5 - fVar1); uVar4 = (int)((fVar5 * 57.295776 + 360.0) / 45.0 + 0.5) & 0x80000007; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffff8) + 1; } AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)uVar4); if ((npc->_sprite)._animState._animData != (void *)0x0) { (npc->_sprite)._animState._isPlaying = 0; } } ANM2::PlayOverlay(&npc->_sprite,(byte *)"WalkBodyOverlay",0); return; } //@@ 00599f80 NpcHelper::tuff_twins_body_attack_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: NpcAI::ENTITY_TUFF_TWINS helper: picks Body1-3Attack{Hori,Vert} by (npc+0x3ec % 3) and the parent (0x3bc) direction, SetFrameFloat by angle, flip flag +0x148 */ void NpcHelper::tuff_twins_body_attack_anim(void) { byte bVar1; byte *****pppppbVar2; int prefixCmp; Entity_NPC *in_ECX; uint uVar3; byte *****pppppbVar4; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int unused; char *pcVar5; byte ****attackAnimEnd; float dy; float dx; double dVar6; int savedFrame; byte *****local_2c; char *local_28; char *local_24; char *local_20; char *local_1c; char *local_18; undefined4 local_14; void *animData; byte ****attackAnim; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; local_2c = (byte *****)0xb624dc; local_28 = "Body1AttackVert"; local_24 = "Body2AttackHori"; local_20 = "Body2AttackVert"; local_1c = "Body3AttackHori"; local_18 = "Body3AttackVert"; dx = *(float *)((int)in_ECX->_parent + 0x33c) - (in_ECX->_pos).x; dy = *(float *)((int)in_ECX->_parent + 0x340) - (in_ECX->_pos).y; if (ABS(dx) <= ABS(dy)) { uVar3 = (uint)(0.0 <= dy) * 2 + 1; } else { uVar3 = 2; if (dx < 0.0) { uVar3 = 0; } } attackAnim = (byte ****)(&local_2c)[(uVar3 & 1) + ((uint)in_ECX->_initSeed % 3) * 2]; (in_ECX->_sprite)._flipX = uVar3 == 0; animData = (in_ECX->_sprite)._animState._animData; if (animData == (void *)0x0) { local_18 = (char *)0xf; local_2c = (byte *****)0x0; local_1c = (char *)0x0; } else { std::string::string((char *)&local_2c,animData); } pppppbVar2 = local_2c; attackAnimEnd = attackAnim; do { bVar1 = *(byte *)attackAnimEnd; attackAnimEnd = (byte ****)((int)attackAnimEnd + 1); } while (bVar1 != 0); pppppbVar4 = (byte *****)&local_2c; if ((char *)0xf < local_18) { pppppbVar4 = local_2c; } bVar1 = str_eq((byte *)pppppbVar4,(uint)local_1c,(byte *)attackAnim, (int)attackAnimEnd - (int)((int)attackAnim + 1)); if ((char *)0xf < local_18) { pcVar5 = local_18 + 1; pppppbVar4 = pppppbVar2; if ((char *)0xfff < pcVar5) { pppppbVar4 = (byte *****)pppppbVar2[-1]; pcVar5 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar2 + (-4 - (int)pppppbVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,(uint)pcVar5); } if (bVar1 == 0) { animData = (in_ECX->_sprite)._animState._animData; if (animData == (void *)0x0) { local_2c = (byte *****)0x0; local_18 = (char *)0xf; local_1c = (char *)0x0; } else { std::string::string((char *)&local_2c,animData); } pppppbVar2 = (byte *****)&local_2c; if ((char *)0xf < local_18) { pppppbVar2 = local_2c; } prefixCmp = strncmp((char *)pppppbVar2,(char *)attackAnim,0xb); unused = extraout_ECX; if ((char *)0xf < local_18) { pcVar5 = local_18 + 1; pppppbVar2 = local_2c; if ((char *)0xfff < pcVar5) { pppppbVar2 = (byte *****)local_2c[-1]; pcVar5 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)pppppbVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar2,(uint)pcVar5); unused = extraout_ECX_00; } if (prefixCmp == 0) { if ((in_ECX->_sprite)._animState._animData == (void *)0x0) { savedFrame = -1; } else { dVar6 = floor((double)(in_ECX->_sprite)._animState._animFrame); savedFrame = (int)dVar6; unused = extraout_ECX_01; } tuff_twins_play_anim(in_ECX,(byte *)attackAnim,unused); if ((in_ECX->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(in_ECX->_sprite)._animState,(float)savedFrame); return; } } else { tuff_twins_play_anim(in_ECX,(byte *)attackAnim,unused); } } return; } //@@ 0059a200 FUN_0059a200 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0059a200(void) { int iVar1; Entity_NPC *in_ECX; Entity_NPC *unused; float fVar2; float fVar3; char *local_24 [4]; char *local_14; local_14 = (char *)(__security_cookie ^ (uint)(local_24 + 5)); local_24[0] = "ButtHori"; local_24[1] = "ButtUp"; local_24[2] = "ButtHori"; local_24[3] = "ButtDown"; fVar3 = *(float *)((int)in_ECX->_parent + 0x33c) - (in_ECX->_pos).x; fVar2 = *(float *)((int)in_ECX->_parent + 0x340) - (in_ECX->_pos).y; if (ABS(fVar3) <= ABS(fVar2)) { iVar1 = (uint)(0.0 <= fVar2) * 2 + 1; unused = in_ECX; } else { unused = (Entity_NPC *)0x0; iVar1 = 2; if (fVar3 < 0.0) { iVar1 = 0; } } NpcHelper::tuff_twins_play_anim(in_ECX,(byte *)local_24[iVar1],(int)unused); (in_ECX->_sprite)._flipX = iVar1 == 0; return; } //@@ 0059a2d0 NpcAI::ENTITY_TUFF_TWINS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs ButtAttack/GutsAttack/AttackHead* */ void __fastcall NpcAI::ENTITY_TUFF_TWINS(Entity_NPC *npc) { undefined4 uVar1; code *pcVar2; qword qVar3; byte bVar4; uint uVar5; undefined4 *puVar6; ColorMod *color; float *pfVar7; uint uVar8; ColorMod *color_00; int iVar9; int iVar10; EntityPtr segment; Entity *pEVar11; Vector *pVVar12; ProjectileParams *params; char *anim; LayerState *layer; EntityPtr segment; void *siblingsData; qword *allocatedBytes; byte *pbVar14; float fVar15; float fVar16; float fVar17; float fVar18; EntityPtr EVar19; EntityPtr *pEVar20; double dVar21; Vector randomDir; Vector awayDir; Vector pathTarget; undefined8 local_288; undefined1 local_27c [4]; EntityRef killSource; Vector headShotVel; Vector shootDir; Vector childVel; Vector awayFromParent; Vector shotVel; EntityList_EL siblings; Vector local_218; float *local_210; float childHealth; Vector targetPos; Vector local_1f4; int variant; EntityPtr *local_1e8; EntityPtr *local_1e4; ProjectileParams projectileParams; ProjectileParams shotParams; Color childParticleColor; Color particleColor; char *headAttackAnims [4]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; Manager *manager; float speedMultiplier; local_14 = (char *)0xffffffff; puStack_18 = &LAB_00af5740; local_1c = ExceptionList; puStack_20 = (undefined1 *)(headAttackAnims + 0xc); uVar5 = __security_cookie ^ (uint)(headAttackAnims + 9); local_24 = uVar5; ExceptionList = &local_1c; variant = npc->_variant; if (npc->_aiCallPhase == 1) { local_1f4.y = 1.0; if (((variant == 3) && (npc->_parent == (EntityPtr)0x0)) && (npc->_i2 == 0)) { (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; } else { pfVar7 = (npc->_damageEvents)._begin; if (pfVar7 != (npc->_damageEvents)._end) { do { npc->_pendingDamage = npc->_pendingDamage - *pfVar7; if ((npc->_i2 == 0) && (((uint)pfVar7[2] & 0x1000004) == 0)) { puVar6 = (undefined4 *)std::vector::erase(local_27c,pfVar7); pfVar7 = (float *)*puVar6; } else { local_218.y = pfVar7[3]; if ((((uint)pfVar7[2] & 0x1000000) == 0) || (npc->_i2 != 0)) { if (((uint)pfVar7[2] & 4) != 0) { if ((pfVar7[8] == g_vectorZero.x) && (pfVar7[9] == g_vectorZero.y)) { fVar18 = *pfVar7; } else { fVar18 = pfVar7[9] - (npc->_pos).y; fVar17 = pfVar7[8] - (npc->_pos).x; fVar18 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); fVar18 = (fVar18 - 0.0) * 0.0078125; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } fVar18 = (1.0 - fVar18 * 0.75) * *pfVar7; *pfVar7 = fVar18; } if (npc->_i2 == 0) { fVar18 = fVar18 * 0.4; } else { fVar18 = fVar18 * 0.3; } *pfVar7 = fVar18; } } else { *pfVar7 = *pfVar7 * 0.6; } fVar18 = *pfVar7; pfVar7 = pfVar7 + 0xe; npc->_pendingDamage = fVar18 + npc->_pendingDamage; } } while (pfVar7 != (npc->_damageEvents)._end); } } if (npc->_i2 != 0) { ExceptionList = local_1c; return; } fVar18 = npc->_maxHitPoints - 15.0; if (npc->_health - npc->_pendingDamage <= fVar18) { (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; npc->_health = fVar18; npc->_i2 = 1; if (variant == 3) { uVar5 = Random(); npc->_projectileCooldown = uVar5 % 0x1e + 0x1e; } manager = g_manager; if (npc->_championColorIdx == 0x12) { local_1f4.y = 1.5; } else if (npc->_championColorIdx == 0x13) { local_1f4.y = 0.5; } local_1e4 = (EntityPtr *)0x89; seed_fart_sound_override((int *)&local_1e4); SoundEffects::Play(&manager->_sfxManager,(int)local_1e4,1.0,2,0,local_1f4.y,0.0); Color::Color(&particleColor); uVar5 = Random(); Game::SpawnParticles(g_game,&npc->_pos,4,uVar5 % 3 + 6,5.0,color,100000.0,0x10001); uVar1 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffe; *(undefined4 *)((int)&npc->_flags + 4) = uVar1; npc->_state = 4; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } npc->_friction = npc->_friction * 0.8; if (npc->_dead != 0) { if (((npc->_parent == (EntityPtr)0x0) && (EVar19 = npc->_child, EVar19 != (EntityPtr)0x0)) && (0.0 < *(float *)((int)EVar19 + 0x380))) { childHealth = *(float *)((int)EVar19 + 0x380) + 25.0; pfVar7 = &childHealth; if (*(float *)((int)EVar19 + 900) <= childHealth) { pfVar7 = (float *)((int)EVar19 + 900); } *(float *)((int)EVar19 + 0x380) = *pfVar7; if (npc->_dead == 0) goto LAB_0059a7bb; } if (((variant == 3) && (EVar19 = npc->_child, EVar19 != (EntityPtr)0x0)) && ((*(int *)((int)EVar19 + 0xbc4) == 0 && (*(int *)((int)EVar19 + 0x3c0) == 0)))) { *(undefined4 *)((int)EVar19 + 0xbc4) = 1; *(float *)((int)npc->_child + 0x380) = *(float *)((int)npc->_child + 900) - 15.0; uVar8 = Random(); *(uint *)((int)npc->_child + 0xba0) = uVar8 % 0x1e + 0x1e; Entity_NPC::PlaySound(npc,0x89,1.0,2,0,1.0); Color::Color(&childParticleColor); uVar8 = Random(); Game::SpawnParticles (g_game,(Vector *)((int)npc->_child + 0x33c),4,uVar8 % 3 + 6,5.0,color_00,100000.0, 0x10001); EVar19 = npc->_child; *(uint *)((int)EVar19 + 0x168) = *(uint *)((int)EVar19 + 0x168) & 0xfffffffe; *(undefined4 *)((int)EVar19 + 0x16c) = *(undefined4 *)((int)EVar19 + 0x16c); *(undefined4 *)((int)npc->_child + 0xb64) = 4; } } LAB_0059a7bb: if (npc->_state != 0) { if (variant == 3) { EVar19 = npc->_parent; if (((EVar19 == (EntityPtr)0x0) && (npc->_i2 != 0)) && (iVar9 = Entity::GetLastChild((Entity *)npc,uVar5), *(int *)(iVar9 + 0xbc4) == 0)) { local_1f4.y = (float)npc; do { EVar19 = *(EntityPtr *)((int)local_1f4.y + 0x3c0); pfVar7 = (float *)((int)local_1f4.y + 0x3c0); local_1e4 = (EntityPtr *)((int)local_1f4.y + 0x3bc); local_1e8 = *(EntityPtr **)((int)local_1f4.y + 0x3bc); if (EVar19 != (EntityPtr)0x0) { local_210 = pfVar7; std::multiset::erase(); } *pfVar7 = (float)local_1e8; if (local_1e8 != (EntityPtr *)0x0) { std::multiset::insert(); } if (*local_1e4 != (EntityPtr)0x0) { std::multiset::erase(); } *local_1e4 = EVar19; if (EVar19 == (EntityPtr)0x0) { segment = *(EntityPtr *)((int)local_1f4.y + 0x3c0); if (segment != (EntityPtr)0x0) { fVar18 = atan2f(*(float *)((int)local_1f4.y + 0x340) - *(float *)((int)segment + 0x340) ,((Vector *)((int)local_1f4.y + 0x33c))->x - *(float *)((int)segment + 0x33c)); *(float *)((int)local_1f4.y + 0xbb4) = fVar18 * 57.295776; break; } } else { std::multiset::insert(); } local_1f4.y = (float)EVar19; } while (EVar19 != (EntityPtr)0x0); EVar19 = npc->_parent; } if ((EVar19 != (EntityPtr)0x0) && (segment = npc->_child, segment != (EntityPtr)0x0)) { fVar18 = atan2f((npc->_pos).y - *(float *)((int)segment + 0x340), (npc->_pos).x - *(float *)((int)segment + 0x33c)); (npc->_v1).y = fVar18 * 57.295776; } iVar9 = npc->_i2; if ((iVar9 != 0) && (npc->_entityGridCollisionClass == 3)) { targetPos.x = (npc->_pos).x; targetPos.y = (npc->_pos).y; iVar10 = Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); iVar9 = npc->_i2; if (iVar10 == 0) { npc->_entityGridCollisionClass = 5; } } (npc->_v1).x = 2.5; segment = npc->_child; if (segment != (EntityPtr)0x0) { segment = segment; do { if (*(int *)((int)segment + 0xbc4) != 0) { (npc->_v1).x = 1.9; break; } segment = *(EntityPtr *)((int)segment + 0x3c0); } while (segment != (EntityPtr)0x0); } if ((iVar9 == 0) && ((EVar19 == (EntityPtr)0x0 || (*(int *)((int)EVar19 + 0xbc4) == 0)))) { npc->_friction = npc->_friction * 0.85; if (EVar19 == (EntityPtr)0x0) { if (npc->_collidesWithGrid != 0) { fVar18 = atan2f((npc->_velocity).y,(npc->_velocity).x); (npc->_v1).y = fVar18 * 57.295776; local_1e8 = (EntityPtr *)((fVar18 * 57.295776) / 90.0); dVar21 = floor((double)(float)local_1e8); local_1e8 = (EntityPtr *)(float)dVar21; EVar19 = (EntityPtr)((float)local_1e8 * 90.0 + 45.0); if (360.0 < ABS((float)EVar19)) { EVar19 = (EntityPtr)fmodf((float)EVar19,360.0); } if ((float)EVar19 <= 180.0) { if ((float)EVar19 < -180.0) { EVar19 = (EntityPtr)((float)EVar19 + 360.0); } } else { EVar19 = (EntityPtr)((float)EVar19 - 360.0); } local_1f4.y = (float)EVar19; uVar5 = Random(); fVar18 = approach_angle((npc->_v1).y,local_1f4.y, (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 10.0); (npc->_v1).y = fVar18; } segment = npc->_child; EVar19 = (EntityPtr)npc; while (segment = segment, segment != (EntityPtr)0x0) { if (*(int *)((int)segment + 0xbc4) != 0) { local_1e4 = (EntityPtr *) (*(float *)((int)segment + 0x340) - *(float *)((int)EVar19 + 0x340)); local_1f4.y = *(float *)((int)segment + 0x33c) - *(float *)((int)EVar19 + 0x33c); fVar18 = sqrtf((float)local_1e4 * (float)local_1e4 + local_1f4.y * local_1f4.y); if (160.0 < fVar18) { local_1e8 = (EntityPtr *)((npc->_v1).y * 0.017453292); fVar18 = sin((float)local_1e8); local_1f4.y = local_1f4.y * 0.001; local_1e4 = (EntityPtr *)((float)local_1e4 * 0.001); fVar17 = cos((float)local_1e8); fVar18 = atan2f((float)local_1e4 + fVar18,fVar17 + local_1f4.y); fVar18 = approach_angle((npc->_v1).y,fVar18 * 57.295776,5.0); (npc->_v1).y = fVar18; break; } } EVar19 = segment; segment = *(EntityPtr *)((int)segment + 0x3c0); } Entity_NPC::CalcTargetPosition(npc,&local_1f4,0.0); local_1e8 = (EntityPtr *)(npc->_pos).x; fVar18 = (npc->_pos).y; fVar17 = fVar18 - local_1f4.y; fVar17 = sqrtf(fVar17 * fVar17 + ((float)local_1e8 - local_1f4.x) * ((float)local_1e8 - local_1f4.x)); if (fVar17 < 130.0) { fVar17 = (fVar17 - 70.0) / 60.0; if (fVar17 <= 0.0) { fVar17 = 0.0; } if (1.0 <= fVar17) { fVar17 = 1.0; } local_1e4 = (EntityPtr *)(1.0 - fVar17); fVar18 = atan2f(local_1f4.y - fVar18,local_1f4.x - (float)local_1e8); local_1e8 = (EntityPtr *)(fVar18 * 57.295776); uVar5 = Random(); fVar18 = approach_angle((npc->_v1).y,(float)local_1e8, ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 2.0) * (float)local_1e4 * npc->_speedMultiplier); (npc->_v1).y = fVar18; } local_1e8 = (EntityPtr *)((npc->_v1).y * 0.017453292); fVar15 = sin((float)local_1e8); fVar16 = cos((float)local_1e8); fVar18 = npc->_friction; fVar17 = (npc->_v1).x; if (fVar18 != 0.0) { speedMultiplier = npc->_speedMultiplier; (npc->_velocity).x = (fVar16 * fVar17 * speedMultiplier) / fVar18 + (npc->_velocity).x; (npc->_velocity).y = (fVar15 * fVar17 * speedMultiplier) / fVar18 + (npc->_velocity).y; } } local_1e4 = (EntityPtr *)CONCAT31(local_1e4._1_3_,1); } else { npc->_friction = npc->_friction * 0.85; if (EVar19 == (EntityPtr)0x0) { if (segment != (EntityPtr)0x0) { uVar5 = Random(); local_1e8 = (EntityPtr *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.8 + 0.2); pVVar12 = Entity_NPC::CalcTargetPosition(npc,&pathTarget,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,pVVar12,(float)local_1e8,900,1) ; } } else { local_1e4 = (EntityPtr *)((npc->_pos).y - *(float *)((int)EVar19 + 0x340)); local_1f4.y = (npc->_pos).x - *(float *)((int)EVar19 + 0x33c); fVar18 = sqrtf((float)local_1e4 * (float)local_1e4 + local_1f4.y * local_1f4.y); pEVar20 = local_1e4; EVar19 = (EntityPtr)local_1f4.y; if (0.0 < fVar18) { pEVar20 = (EntityPtr *)((float)local_1e4 * (1.0 / fVar18)); EVar19 = (EntityPtr)(local_1f4.y * (1.0 / fVar18)); } if (10.0 < fVar18) { fVar17 = npc->_speedMultiplier; (npc->_velocity).x = -(float)EVar19 * (fVar18 - 10.0) * 0.05 * fVar17 + (npc->_velocity).x; (npc->_velocity).y = -(float)pEVar20 * (fVar18 - 10.0) * 0.05 * fVar17 + (npc->_velocity).y; } } local_1e4 = (EntityPtr *)((uint)local_1e4 & 0xffffff00); } Entity_NPC::FollowParentSegment(npc,(byte)local_1e4,24.0,(npc->_v1).x * 5.0); } else { fVar18 = 0.0; EVar19 = (EntityPtr)npc; do { if (*(int *)((int)EVar19 + 0xbc4) == 0) { fVar17 = 3.5; } else { fVar17 = 1.0; } EVar19 = *(EntityPtr *)((int)EVar19 + 0x3c0); fVar18 = fVar18 + fVar17; } while (EVar19 != (EntityPtr)0x0); fVar18 = (fVar18 - 2.0) / 18.0; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } fVar18 = 1.8 - fVar18 * 0.79999995; (npc->_v1).x = fVar18; PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,fVar18,0); Entity_NPC::FollowParentSegment(npc,1,24.0,(npc->_v1).x * 5.0); fVar18 = (npc->_velocity).x; fVar17 = (npc->_velocity).y; if (ABS(fVar18) <= ABS(fVar17)) { iVar9 = (uint)(0.0 <= fVar17) * 2 + 1; } else { iVar9 = 2; if (fVar18 < 0.0) { iVar9 = 0; } } npc->_i1 = iVar9; } } iVar10 = variant; iVar9 = npc->_state; if (iVar9 == 0) { npc->_i2 = 0; npc->_aiCallFlags = npc->_aiCallFlags | 1; npc->_entityGridCollisionClass = (uint)(variant != 3) * 2 + 3; if (variant == 3) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); layer->_visible = 0; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&siblings,npc->_type,npc->_variant,-1,0,0 ); local_14 = (char *)0x0; local_1e4 = (EntityPtr *)(siblings._size + -1); if (-1 < (int)local_1e4) { siblingsData = siblings._data; do { EVar19 = *(EntityPtr *)((int)siblingsData + (int)local_1e4 * 4); if (((EVar19 != (EntityPtr)npc) && (*(EntityPtr *)((int)EVar19 + 0x3bc) != (EntityPtr)npc)) && (*(EntityPtr *)((int)EVar19 + 0x3c0) == (EntityPtr)0x0)) { fVar18 = (npc->_pos).y - *(float *)((int)EVar19 + 0x340); fVar17 = (npc->_pos).x - ((Vector *)((int)EVar19 + 0x33c))->x; fVar18 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); if (fVar18 < 42.0) { segment = EVar19; do { if (segment == (EntityPtr)npc) goto LAB_0059bb72; segment = *(EntityPtr *)((int)segment + 0x3bc); } while ((segment != (EntityPtr)0x0) && (segment != EVar19)); if (npc->_parent != (EntityPtr)0x0) { local_1e8 = &npc->_parent; std::multiset::erase(); } npc->_parent = EVar19; std::multiset::insert(); } LAB_0059bb72: siblingsData = siblings._data; } local_1e4 = (EntityPtr *)&local_1e4[-1].field_0x3; } while (-1 < (int)local_1e4); } EVar19 = npc->_parent; if (EVar19 != (EntityPtr)0x0) { if (*(int *)((int)EVar19 + 0x3c0) != 0) { std::multiset::erase(); } *(Entity_NPC **)((int)EVar19 + 0x3c0) = npc; std::multiset::insert(); } local_14 = (char *)0xffffffff; if (siblings._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (siblings._data != (void *)0x0) { uVar5 = *(uint *)((int)siblings._data + -4); qVar3 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar3 < uVar5); free((uint *)((int)siblings._data + -4)); } } local_14 = (char *)0xffffffff; qVar3 = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)qVar3 | 0x11; if (npc->_parent == (EntityPtr)0x0) { EVar19 = npc->_child; if (EVar19 == (EntityPtr)0x0) { uVar8 = npc->_initSeed; uVar5 = uVar8 & 3; } else { fVar17 = (npc->_pos).x - *(float *)((int)EVar19 + 0x33c); fVar18 = (npc->_pos).y - *(float *)((int)EVar19 + 0x340); if (ABS(fVar17) <= ABS(fVar18)) { uVar8 = npc->_initSeed; uVar5 = (uint)(0.0 <= fVar18) * 2 + 1; } else { uVar8 = npc->_initSeed; uVar5 = 2; if (fVar17 < 0.0) { uVar5 = 0; } } } npc->_i1 = uVar5; local_288 = 0x900000002; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> 2 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; uVar8 = uVar8 >> 0xf ^ uVar8; (npc->_v1).y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10 * 360.0; ENTITY_TUFF_TWINS_head_anim(npc); if (npc->_parent != (EntityPtr)0x0) { std::deque::push_back((void *)((int)npc->_parent + 0xc04),&npc->_pos); } iVar9 = npc->_index; EVar19 = (EntityPtr)npc; do { Entity_NPC::FollowParentSegment(npc,1,24.0,0.0); iVar10 = variant; *(int *)((int)EVar19 + 0xc7c) = iVar9; EVar19 = *(EntityPtr *)((int)EVar19 + 0x3c0); } while (EVar19 != (EntityPtr)0x0); if (variant != 3) { segment = npc->_child; EVar19 = (EntityPtr)npc; while (segment = segment, segment != (EntityPtr)0x0) { EVar19 = segment; segment = *(EntityPtr *)((int)segment + 0x3c0); } if (*(EntityPtr *)((int)EVar19 + 0x3bc) == (EntityPtr)0x0) goto LAB_0059bc47; FUN_0059a200(); npc->_state = 4; goto LAB_0059b88e; } } else { ENTITY_TUFF_TWINS_body_anim(npc); } LAB_0059bc47: npc->_state = 4; iVar10 = variant; LAB_0059b88e: if (npc->_parent == (EntityPtr)0x0) goto LAB_0059b89b; LAB_0059b934: if (npc->_i2 != 0) goto LAB_0059b93d; } else { if (iVar9 != 4) { if (iVar9 == 8) { if (variant == 3) { if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { if (npc->_child == (EntityPtr)0x0) { Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); EVar19 = npc->_parent; if (EVar19 == (EntityPtr)0x0) { pVVar12 = MusicManager::RandomVector(&randomDir); } else { awayFromParent.x = (npc->_pos).x - *(float *)((int)EVar19 + 0x33c); awayFromParent.y = (npc->_pos).y - *(float *)((int)EVar19 + 0x340); pVVar12 = Vector::Normalized(&awayFromParent,&awayDir); } fVar18 = pVVar12->x; local_1e8 = (EntityPtr *)pVVar12->y; uVar5 = Random(); childVel.x = fVar18 * 3.0; childVel.y = (float)local_1e8 * 3.0; pEVar11 = Game::Spawn(g_game,0x333,0,&npc->_pos,&childVel,(Entity *)npc,0,uVar5); uVar1 = *(undefined4 *)((int)&pEVar11->_flags + 4); iVar9 = *(int *)pEVar11; *(uint *)&pEVar11->_flags = (uint)pEVar11->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar11->_flags + 4) = uVar1; (**(code **)(iVar9 + 0xc))(); } else { pEVar11 = Entity_NPC::GetPlayerTarget(npc); local_1f4.y = (pEVar11->_pos).y - (npc->_pos).y; local_1e4 = (EntityPtr *)((pEVar11->_pos).x - (npc->_pos).x); fVar18 = sqrtf(local_1f4.y * local_1f4.y + (float)local_1e4 * (float)local_1e4); if (0.0 < fVar18) { local_1e4 = (EntityPtr *)((float)local_1e4 * (1.0 / fVar18)); local_1f4.y = local_1f4.y * (1.0 / fVar18); } Entity_NPC::PlaySound(npc,0x13e,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&shotParams); shotVel.x = (float)local_1e4 * 8.0; shotParams.FallingAccelModifier = -0.075; shotVel.y = local_1f4.y * 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&shotVel,3,&shotParams); } } goto LAB_0059b65f; } } else if (npc->_parent == (EntityPtr)0x0) { headAttackAnims[0] = "AttackHeadHori"; headAttackAnims[1] = "AttackHeadUp"; headAttackAnims[2] = "AttackHeadHori"; headAttackAnims[3] = "AttackHeadDown"; pbVar14 = (byte *)headAttackAnims[npc->_i1]; npc->_friction = npc->_friction * 0.8; NpcHelper::tuff_twins_play_anim(npc,pbVar14,variant); npc->_renderZOffset = 200; (npc->_sprite)._flipX = npc->_i1 == 0; if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { Isaac::GetAxisAlignedUnitVectorFromDir(&shootDir,npc->_i1); Entity_NPC::PlaySound(npc,0x9e,1.0,2,0,1.0); uVar5 = Random(); uVar8 = Random(); fVar18 = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292; local_1e8 = (EntityPtr *)cos(fVar18); fVar18 = sin(fVar18); uVar8 = 3; if (npc->_i2 != 0) { uVar8 = 0; } local_218.x = shootDir.x * 2.0 + (npc->_pos).x; headShotVel.x = ((float)local_1e8 * shootDir.x - shootDir.y * fVar18) * 30.0; local_218.y = shootDir.y * 2.0 + (npc->_pos).y; headShotVel.y = (fVar18 * shootDir.x + (float)local_1e8 * shootDir.y) * 30.0; Game::Spawn(g_game,0x3d,uVar8,&local_218,&headShotVel,(Entity *)npc,0,uVar5); } goto LAB_0059b65f; } } else { NpcHelper::tuff_twins_body_attack_anim(); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (bVar4 != 0) { Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); pEVar11 = Entity_NPC::GetPlayerTarget(npc); targetPos.x = (pEVar11->_pos).x; targetPos.y = (pEVar11->_pos).y; fVar17 = (npc->_pos).x - targetPos.x; fVar18 = (npc->_pos).y - targetPos.y; fVar18 = sqrtf(fVar18 * fVar18 + fVar17 * fVar17); if (160.0 < fVar18) { targetPos.x = g_vectorZero.x; targetPos.y = g_vectorZero.y; } params = ProjectileParams::ProjectileParams(&projectileParams); uVar5 = Random(); Entity_NPC::FireBossProjectiles(npc,uVar5 % 3 + 2,&targetPos,10.0,params); uVar5 = Random(); pEVar11 = Game::Spawn(g_game,1000,0xb,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); (pEVar11->_sprite)._offset.x = 0.0; (pEVar11->_sprite)._offset.y = -12.0; } LAB_0059b65f: if ((npc->_sprite)._animState._animData != (void *)0x0) { iVar10 = variant; if ((npc->_sprite)._animState._isPlaying == 0) { npc->_state = 4; } goto LAB_0059b88e; } } } goto LAB_0059bc47; } LAB_0059b888: iVar10 = variant; goto LAB_0059b88e; } *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffef; EVar19 = npc->_parent; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); if ((EVar19 == (EntityPtr)0x0) && ((variant != 3 || (npc->_i2 == 0)))) { ENTITY_TUFF_TWINS_head_anim(npc); npc->_renderZOffset = 200; LAB_0059b7a6: if (iVar10 == 3) { iVar9 = npc->_projectileCooldown; if (0 < iVar9) { iVar9 = iVar9 + ((int)npc->_prevUpdateTime - (int)npc->_updateTime); npc->_projectileCooldown = iVar9; } if ((npc->_i2 == 0) || (0 < iVar9)) goto LAB_0059b88e; EVar19 = npc->_child; if ((EVar19 != (EntityPtr)0x0) || (iVar9 = NpcHelper::tuff_twins_spawn_count(), iVar9 < 4)) { npc->_state = 8; anim = "GutsAttack"; if (EVar19 == (EntityPtr)0x0) { anim = "ButtAttack"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); if (npc->_child == (EntityPtr)0x0) { uVar5 = Random(); iVar9 = uVar5 % 0x3c + 0x5a; } else if (npc->_parent == (EntityPtr)0x0) { iVar9 = 0x14; } else { uVar5 = Random(); iVar9 = uVar5 % 0x1e + 0x3c; } npc->_projectileCooldown = iVar9; pEVar11 = Entity_NPC::GetPlayerTarget(npc); fVar18 = (pEVar11->_pos).x; (npc->_sprite)._flipX = (npc->_pos).x <= fVar18 && fVar18 != (npc->_pos).x; } goto LAB_0059b888; } } else { npc->_renderZOffset = 0; if ((npc->_child != (EntityPtr)0x0) || (variant == 3)) { ENTITY_TUFF_TWINS_body_anim(npc); goto LAB_0059b7a6; } FUN_0059a200(); } if (npc->_parent != (EntityPtr)0x0) { LAB_0059b749: if (((npc->_child != (EntityPtr)0x0) && (npc->_i2 != 0)) && ((bVar4 = Entity::IsFrame((Entity *)npc,5,npc->_initSeed), bVar4 != 0 && (uVar5 = Random(), uVar5 % 0x18 == 0)))) { npc->_state = 8; } goto LAB_0059b88e; } bVar4 = Entity::IsFrame((Entity *)npc,10,npc->_initSeed); if (((bVar4 != 0) && (uVar5 = Random(), uVar5 % 0x18 == 0)) && (iVar9 = NpcHelper::tuff_twins_spawn_count(), iVar9 < 4)) { npc->_state = 8; } if (npc->_parent != (EntityPtr)0x0) goto LAB_0059b749; LAB_0059b89b: if (npc->_child != (EntityPtr)0x0) goto LAB_0059b934; if ((iVar10 != 3) || (npc->_i2 == 0)) { killSource._type = 0; killSource._variant = 0; killSource._spawnerType = 0; killSource._spawnerVariant = 0; killSource._position.x = g_vectorZero.x; killSource._position.y = g_vectorZero.y; killSource._velocity.x = g_vectorZero.x; killSource._velocity.y = g_vectorZero.y; killSource._flags = 0; killSource._entity = (void *)0x0; (**(code **)(*(int *)npc + 0x24))(); goto LAB_0059b934; } LAB_0059b93d: uVar5 = Random(); if ((uVar5 & 7) == 0) { uVar5 = Random(); Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } } if (iVar10 == 3) { if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { iVar9 = (npc->_sprite)._layerCount; } else { local_1e4 = AnimationState::GetNullFrame(&(npc->_sprite)._overlayAnimState,(byte *)"Bounce"); iVar9 = (npc->_sprite)._layerCount; if (local_1e4 != (EntityPtr *)0x0) { pbVar14 = (byte *)0x0; if (iVar9 != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar14); (layer->_pos).x = (float)*local_1e4; (layer->_pos).y = (float)local_1e4[1]; layer = ANM2::GetLayer(&npc->_sprite,pbVar14); (layer->_size).x = (float)local_1e4[4]; (layer->_size).y = (float)local_1e4[5]; EVar19 = local_1e4[0x11]; layer = ANM2::GetLayer(&npc->_sprite,pbVar14); pbVar14 = pbVar14 + 1; layer->_rotation = (float)EVar19; } while (pbVar14 < (byte *)(npc->_sprite)._layerCount); } goto LAB_0059be72; } } pbVar14 = (byte *)0x0; if (iVar9 != 0) { do { layer = ANM2::GetLayer(&npc->_sprite,pbVar14); (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; layer = ANM2::GetLayer(&npc->_sprite,pbVar14); (layer->_size).x = g_vectorOne.x; (layer->_size).y = g_vectorOne.y; layer = ANM2::GetLayer(&npc->_sprite,pbVar14); pbVar14 = pbVar14 + 1; layer->_rotation = 0.0; } while (pbVar14 < (byte *)(npc->_sprite)._layerCount); } } LAB_0059be72: if ((npc->_dead != 0) && (npc->_child != (EntityPtr)0x0)) { PathFinder::Reset((PathFinder *)((int)npc->_child + 0x414)); EVar19 = npc->_child; uVar1 = *(undefined4 *)((int)EVar19 + 0x20); for (; EVar19 != (EntityPtr)0x0; EVar19 = *(EntityPtr *)((int)EVar19 + 0x3c0)) { *(undefined4 *)((int)EVar19 + 0xc7c) = uVar1; } } ExceptionList = local_1c; return; } //@@ 0059bed0 Entity_NPC::RenderSegmentLink /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? NPC Render/RenderShadowLayer, parent 0x3c0 I2 checks */ void __thiscall Entity_NPC::RenderSegmentLink(Entity_NPC *this,float *param_2,char param_3) { Color *extraout_EAX; Color *baseColor; float fVar1; float stretch; double dVar2; undefined1 auStack_f4 [40]; float local_cc; float local_c8; float local_c4; float local_c0; float local_bc; Vector beamPoint; float local_b0; float local_ac; float local_a8; float local_a4; float beamLength; ColorMod linkColor; Color tmpColor; uint local_44; EntityPtr child; int childI2; local_44 = __security_cookie ^ (uint)auStack_f4; child = this->_child; if ((child != (EntityPtr)0x0) && (((childI2 = *(int *)((int)child + 0xbc4), childI2 != 0 || (this->_i2 != 0)) && (1 < (uint)(this->_sprite)._layerCount)))) { if (param_3 == '\0') { Color::Color(&tmpColor); baseColor = extraout_EAX; } else { tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; baseColor = &tmpColor; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; } linkColor._tint[0] = baseColor->_tint[0]; linkColor._tint[1] = baseColor->_tint[1]; linkColor._tint[2] = baseColor->_tint[2]; linkColor._tint[3] = baseColor->_tint[3]; linkColor._colorize[0] = baseColor->_colorize[0]; linkColor._colorize[1] = baseColor->_colorize[1]; linkColor._colorize[2] = baseColor->_colorize[2]; linkColor._colorize[3] = baseColor->_colorize[3]; linkColor._offset._0_8_ = *(undefined8 *)baseColor->_offset; local_c0 = g_displayPixelRatio * g_screenPointScale; linkColor._offset[2] = baseColor->_offset[2]; local_c8 = (g_screenWidth - 338.0) * 0.5; local_b0 = (g_screenHeight - 182.0) * 0.5; local_cc = (((this->_pos).x - 60.0) * 0.65 + local_c8) * local_c0 + 0.5; dVar2 = floor((double)local_cc); local_c4 = (float)dVar2 / local_c0; local_cc = (((this->_pos).y - 140.0) * 0.65 + local_b0) * local_c0 + 0.5; dVar2 = floor((double)local_cc); local_a8 = (float)dVar2 / local_c0; local_bc = *param_2; local_cc = local_bc + local_c4; local_c4 = param_2[1]; local_c8 = ((*(float *)((int)child + 0x33c) - 60.0) * 0.65 + local_c8) * local_c0 + 0.5; dVar2 = floor((double)local_c8); local_ac = (float)dVar2 / local_c0; local_c8 = ((*(float *)((int)child + 0x340) - 140.0) * 0.65 + local_b0) * local_c0 + 0.5; dVar2 = floor((double)local_c8); local_c8 = (float)dVar2; fVar1 = local_c8 / local_c0; local_c0 = (local_c4 + local_a8) - 6.0; local_c4 = (local_c4 + fVar1) - 6.0; if (this->_i2 == 0) { local_c0 = local_c0 - 18.0; } if (childI2 == 0) { local_c4 = local_c4 - 18.0; } local_bc = (local_bc + local_ac) - local_cc; local_c4 = local_c4 - local_c0; fVar1 = sqrtf(local_bc * local_bc + local_c4 * local_c4); if (0.0 < fVar1) { local_c4 = local_c4 * (1.0 / fVar1); local_bc = local_bc * (1.0 / fVar1); } beamLength = fVar1 - 6.0; if (6.0 <= beamLength) { DAT_00c78ef0 = &this->_sprite; g_beamRendererPointsEnd = g_beamRendererPoints; stretch = (fVar1 - 20.0) / 70.0; DAT_00c78ef4 = 1; DAT_00c78ef8._0_2_ = 0x100; fVar1 = (beamLength - 6.0) * 0.15; local_ac = (beamLength - 6.0) * 0.5 + 6.0; local_a4 = 30.0; if (fVar1 <= 30.0) { local_a4 = fVar1; } if (stretch <= 0.0) { stretch = 0.0; } local_a8 = local_a4 + 6.0; if (1.0 <= stretch) { stretch = 1.0; } local_a4 = beamLength - local_a4; local_c8 = 1.0 - stretch * 0.6; local_b0 = 1.0 - (1.0 - local_c8) * (1.0 - local_c8); beamPoint.x = local_bc * 6.0 + local_cc; beamPoint.y = local_c4 * 6.0 + local_c0; BeamRenderer::Add(&beamPoint,&linkColor,1.0,0.0); beamPoint.x = local_bc * local_a8 + local_cc; beamPoint.y = local_c4 * local_a8 + local_c0; BeamRenderer::Add(&beamPoint,&linkColor,local_b0,0.33); beamPoint.x = local_bc * local_ac + local_cc; beamPoint.y = local_c4 * local_ac + local_c0; BeamRenderer::Add(&beamPoint,&linkColor,local_c8,0.5); beamPoint.x = local_bc * local_a4 + local_cc; beamPoint.y = local_c4 * local_a4 + local_c0; BeamRenderer::Add(&beamPoint,&linkColor,local_b0,0.66); beamPoint.x = local_bc * beamLength + local_cc; beamPoint.y = local_c4 * beamLength + local_c0; BeamRenderer::Add(&beamPoint,&linkColor,1.0,1.0); BeamRenderer::End(); } } return; } //@@ 0059c4c0 std::string::push_back /* DB: appends one char: in-place when size < capacity (+0x10/+0x14, SSO when cap <= 0xf) with NUL, else grows (x1.5, |0xf, _Xlen at 0x7fffffff) and memcpy; online_chat_text_input, rich_text_layout prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall std::string::push_back(char *this,byte c) { byte *pbVar1; uint uVar2; void *_Src; uint uVar3; void *_Dst; uint uVar4; uint uVar5; void *ptr; uVar2 = *(uint *)(this + 0x14); uVar4 = *(uint *)(this + 0x10); if (uVar4 < uVar2) { *(uint *)(this + 0x10) = uVar4 + 1; if (0xf < uVar2) { this = *(char **)this; } this[uVar4] = c; this[uVar4 + 1] = '\0'; return; } if (uVar4 == 0x7fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = uVar4 + 1 | 0xf; if (uVar5 < 0x80000000) { if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar5 = 0x7fffffff; } else { uVar3 = (uVar2 >> 1) + uVar2; if (uVar5 < uVar3) { uVar5 = uVar3; } } } else { uVar5 = 0x7fffffff; } _Dst = _Allocate(uVar5 + 1); *(uint *)(this + 0x14) = uVar5; pbVar1 = (byte *)((int)_Dst + uVar4); *(uint *)(this + 0x10) = uVar4 + 1; if (uVar2 < 0x10) { memcpy(_Dst,this,uVar4); *pbVar1 = c; pbVar1[1] = 0; *(void **)this = _Dst; return; } _Src = *(void **)this; memcpy(_Dst,_Src,uVar4); *pbVar1 = c; pbVar1[1] = 0; uVar4 = uVar2 + 1; ptr = _Src; if (0xfff < uVar4) { ptr = *(void **)((int)_Src + -4); uVar4 = uVar2 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); *(void **)this = _Dst; return; } //@@ 0059c5d0 NpcAI::ENTITY_TURDLET_segments /* DB: ? called from NpcAI::ENTITY_TURDLET, npc only; BodySegments/Bounce/HeadRotate null frames and layer frames by segment count (+0xc8) */ void __fastcall NpcAI::ENTITY_TURDLET_segments(Entity_NPC *npc) { float fVar1; byte bVar2; float *pfVar3; int iVar4; LayerState *pLVar5; EntityPtr EVar6; ANM2 *this; byte *layerName; float fVar7; byte *local_14; if ((npc->_sprite)._overlayAnimState._animData == (void *)0x0) { return; } pfVar3 = AnimationState::GetNullFrame(&(npc->_sprite)._overlayAnimState,(byte *)"Bounce"); if (pfVar3 == (float *)0x0) { layerName = (byte *)0x0; if ((npc->_sprite)._layerCount == 0) { return; } do { pLVar5 = ANM2::GetLayer(&npc->_sprite,layerName); (pLVar5->_pos).x = g_vectorZero.x; (pLVar5->_pos).y = g_vectorZero.y; pLVar5 = ANM2::GetLayer(&npc->_sprite,layerName); (pLVar5->_size).x = g_vectorOne.x; (pLVar5->_size).y = g_vectorOne.y; pLVar5 = ANM2::GetLayer(&npc->_sprite,layerName); layerName = layerName + 1; pLVar5->_rotation = 0.0; } while (layerName < (byte *)(npc->_sprite)._layerCount); return; } EVar6 = npc->_parent; if (EVar6 == (EntityPtr)0x0) { fVar7 = (npc->_v1).x; if (360.0 < ABS(fVar7)) { fVar7 = fmodf(fVar7,360.0); } if (fVar7 <= 180.0) { if (fVar7 < -180.0) { fVar7 = fVar7 + 360.0; } } else { fVar7 = fVar7 - 360.0; } fVar1 = pfVar3[6]; bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"HeadRotate",1); if ((bVar2 == 0) || ((npc->_sprite)._animState._animData == (void *)0x0)) goto LAB_0059c739; iVar4 = ((int)((fVar7 + 360.0) / 30.0 + 0.5) % 0xc) * 3 - (int)(fVar1 * -255.0); } else { iVar4 = -1; do { EVar6 = *(EntityPtr *)((int)EVar6 + 0x3bc); iVar4 = iVar4 + 1; } while (EVar6 != (EntityPtr)0x0); bVar2 = ANM2::SetAnimation(&npc->_sprite,(byte *)"BodySegments",1); if ((bVar2 == 0) || ((npc->_sprite)._animState._animData == (void *)0x0)) goto LAB_0059c739; } AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)iVar4); if ((npc->_sprite)._animState._animData != (void *)0x0) { (npc->_sprite)._animState._isPlaying = 0; } LAB_0059c739: this = &npc->_sprite; local_14 = (byte *)0x0; if ((npc->_sprite)._layerCount == 0) { return; } do { pLVar5 = ANM2::GetLayer(this,local_14); (pLVar5->_pos).x = *pfVar3; (pLVar5->_pos).y = pfVar3[1]; pLVar5 = ANM2::GetLayer(this,local_14); (pLVar5->_size).x = pfVar3[4]; (pLVar5->_size).y = pfVar3[5]; fVar7 = pfVar3[0x11]; pLVar5 = ANM2::GetLayer(this,local_14); pLVar5->_rotation = fVar7; local_14 = local_14 + 1; } while (local_14 < (byte *)(npc->_sprite)._layerCount); return; } //@@ 0059c830 NpcAI::ENTITY_TURDLET /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 918 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_TURDLET(Entity_NPC *npc) { double dVar1; float *pfVar2; undefined4 segmentPosY; undefined1 *puVar4; byte bVar5; uint uVar6; uint uVar7; EntityRef *sourceRef; float *pfVar8; Vector *followOffset; byte *pbVar9; byte *pbVar10; void *pvVar11; Entity_Effect *splat; Entity *trailEffect; ColorMod *splatColor; EntityPtr EVar12; uint uVar13; int iVar14; int iVar15; qword *allocCounter; EntityPtr *pEVar16; int segmentCount; bool isLess; float fVar17; float fVar18; EntityPtr EVar19; float fVar20; float fVar21; uint damageFlags; float avgSpin; float local_6c; Vector local_64; Vector local_5c; EntityPtr local_54; undefined1 local_50 [8]; int local_48; int local_44; int local_40; float local_3c; float local_38; float local_34; void *local_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; qword allocatedBytes; EntityPtr ancestor; char *animName; undefined4 segmentPosY; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af577d; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_24 = uVar6; if (npc->_aiCallPhase == 1) { EVar19 = (EntityPtr)(npc->_health - npc->_pendingDamage); EVar12 = (EntityPtr)npc; do { fVar17 = *(float *)((int)EVar12 + 0x380) - *(float *)((int)EVar12 + 0x14); EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); if ((float)EVar19 <= fVar17) { fVar17 = (float)EVar19; } EVar19 = (EntityPtr)fVar17; } while (EVar12 != (EntityPtr)0x0); EVar12 = (EntityPtr)npc; local_54 = EVar19; puStack_20 = local_50 + 0x4c; do { fVar17 = *(float *)((int)EVar12 + 0x380) - *(float *)((int)EVar12 + 0x14); if ((float)EVar19 < fVar17) { local_3c = (npc->_pos).x; local_38 = (npc->_pos).y; local_64.y = *(float *)(*(int *)EVar12 + 0x20); local_50._4_4_ = npc->_type; local_48 = npc->_variant; local_44 = npc->_spawnerType; local_40 = npc->_spawnerVariant; local_34 = (npc->_velocity).x; local_30 = (void *)(npc->_velocity).y; damageFlags = (uint)((npc->_flags & 0x100) != 0); if ((npc->_flags & 0x20000000) == 0) { uVar13 = 0; } else { uVar13 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar7 = 0; } else { uVar7 = 4; } local_2c.x = (float)(uVar7 | uVar13 | damageFlags); local_2c.y = (float)npc; (*(code *)local_64.y)(fVar17 - (float)EVar19,0x2000,0,local_50 + 4,0x1e,uVar6); EVar19 = local_54; } EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); } while (EVar12 != (EntityPtr)0x0); ExceptionList = local_1c; return; } if (npc->_state == 0) { switchD_0059ca05_caseD_0: puStack_20 = local_50 + 0x4c; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&local_34,npc->_type, npc->_variant,-1,0,0); local_14 = 0; local_64.y = (float)((int)local_2c.y + -1); if (-1 < (int)local_64.y) { pvVar11 = local_30; do { EVar12 = *(EntityPtr *)((int)pvVar11 + (int)local_64.y * 4); if (((EVar12 != (EntityPtr)npc) && (*(EntityPtr *)((int)EVar12 + 0x3bc) != (EntityPtr)npc)) && (*(EntityPtr *)((int)EVar12 + 0x3c0) == (EntityPtr)0x0)) { fVar17 = (npc->_pos).y - *(float *)((int)EVar12 + 0x340); fVar18 = (npc->_pos).x - ((Vector *)((int)EVar12 + 0x33c))->x; fVar17 = sqrtf(fVar17 * fVar17 + fVar18 * fVar18); if (fVar17 < 42.0) { EVar19 = EVar12; do { if (EVar19 == (EntityPtr)npc) goto LAB_0059e078; EVar19 = *(EntityPtr *)((int)EVar19 + 0x3bc); } while ((EVar19 != (EntityPtr)0x0) && (EVar19 != EVar12)); if (npc->_parent != (EntityPtr)0x0) { local_5c.y = (float)&npc->_parent; std::multiset::erase(&local_5c.y); } npc->_parent = EVar12; std::multiset::insert(&npc->_parent); } LAB_0059e078: pvVar11 = local_30; } local_64.y = (float)((int)local_64.y + -1); } while (-1 < (int)local_64.y); } EVar12 = npc->_parent; if (EVar12 != (EntityPtr)0x0) { pEVar16 = (EntityPtr *)((int)EVar12 + 0x3c0); if (*(int *)((int)EVar12 + 0x3c0) != 0) { local_5c.y = (float)pEVar16; std::multiset::erase(&local_5c.y); } *pEVar16 = (EntityPtr)npc; std::multiset::insert(pEVar16); } local_14 = 0xffffffff; if (local_34._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_30 != (void *)0x0) { uVar6 = *(uint *)((int)local_30 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar6; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar6); free((uint *)((int)local_30 + -4)); } } local_14 = 0xffffffff; uVar6 = Random(); (npc->_v1).x = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadWalkOverlay",0); npc->_state = 4; splatColor = ColorParams::set_from_bytes((ColorParams *)local_50,0,0,0,0xff,0x41,0x29,0x23); Color::operator_assign((Color *)&npc->_splatColor,splatColor); EVar12 = npc->_parent; npc->_aiCallFlags = 1; (npc->_v2).y = npc->_maxHitPoints * 0.9; if ((EVar12 == (EntityPtr)0x0) || (std::deque::push_back((void *)((int)EVar12 + 0xc04),&npc->_pos), npc->_parent == (EntityPtr)0x0)) { iVar15 = npc->_index; EVar12 = (EntityPtr)npc; do { *(int *)((int)EVar12 + 0xc7c) = iVar15; EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); } while (EVar12 != (EntityPtr)0x0); } for (EVar12 = (EntityPtr)Entity::GetLastParent((Entity *)npc); EVar12 != (EntityPtr)0x0; EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0)) { ENTITY_TURDLET_segments((Entity_NPC *)EVar12); } ExceptionList = local_1c; return; } if ((npc->_parent == (EntityPtr)0x0) && (npc->_child == (EntityPtr)0x0)) { puStack_20 = local_50 + 0x4c; sourceRef = EntityRef::EntityRef((EntityRef *)(local_50 + 4)); (**(code **)(*(int *)npc + 0x24))(sourceRef); ExceptionList = local_1c; return; } puVar4 = local_50 + 0x4c; switch(npc->_state) { case 0: goto switchD_0059ca05_caseD_0; case 4: if (npc->_parent == (EntityPtr)0x0) { puStack_20 = local_50 + 0x4c; if (npc->_collidesWithGrid != 0) { puStack_20 = local_50 + 0x4c; fVar17 = atan2f((npc->_velocity).y,(npc->_velocity).x); (npc->_v1).x = fVar17 * 57.295776; } Entity_NPC::CalcTargetPosition(npc,&local_5c,0.0); fVar17 = (npc->_v2).x; if (120.0 <= fVar17) { fVar18 = (npc->_targetPosition).x; fVar20 = (npc->_targetPosition).y; fVar17 = (fVar17 - 120.0) / 80.0; if (fVar17 <= 0.0) { fVar17 = 0.0; } if (1.0 <= fVar17) { fVar17 = 1.0; } (npc->_targetPosition).x = (local_5c.x - fVar18) * (1.0 - fVar17) + fVar18; pEVar16 = (EntityPtr *)((local_5c.y - fVar20) * (1.0 - fVar17) + fVar20); } else { (npc->_targetPosition).x = local_5c.x; pEVar16 = (EntityPtr *)local_5c.y; } (npc->_targetPosition).y = (float)pEVar16; fVar17 = (npc->_v2).x; fVar18 = (fVar17 - 120.0) / 150.0; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } local_64.y = fVar18 * 40.0 + 120.0; fVar20 = atan2f((npc->_pos).y - (npc->_targetPosition).y, (npc->_pos).x - (npc->_targetPosition).x); local_54 = (EntityPtr)(fVar20 * 57.295776 - local_64.y); local_2c.y = fVar20 * 57.295776 + local_64.y; fVar20 = angle_difference(local_2c.y,(npc->_v1).x); local_64.y = ABS(fVar20); fVar20 = angle_difference((float)local_54,(npc->_v1).x); if (ABS(fVar20) <= local_64.y) { EVar12 = local_54; } else { EVar12 = (EntityPtr)local_2c.y; } fVar20 = npc->_speedMultiplier; fVar18 = approach_angle((npc->_v1).x,(float)EVar12,fVar20 * (fVar18 * 20.0 + 5.0)); (npc->_v1).y = 1.2; local_54 = (EntityPtr)(npc->_friction * 0.85); (npc->_v1).x = fVar18; local_64.y = fVar18 * 0.017453292; npc->_friction = (float)local_54; fVar18 = cos(local_64.y); local_2c.y = fVar18 * 1.2; fVar18 = sin(local_64.y); if ((float)local_54 != 0.0) { (npc->_velocity).x = (local_2c.y * fVar20) / (float)local_54 + (npc->_velocity).x; (npc->_velocity).y = (fVar18 * 1.2 * fVar20) / (float)local_54 + (npc->_velocity).y; fVar17 = (npc->_v2).x; } fVar18 = (npc->_targetPosition).x - (npc->_pos).x; fVar20 = (npc->_targetPosition).y - (npc->_pos).y; if (((fVar20 * fVar20 + fVar18 * fVar18 < 900.0) && (270.0 < fVar17)) && (uVar6 = Random(), uVar6 % 5 == 0)) { npc->_state = 8; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadChargeOverlay",0); *(undefined4 *)((int)npc->_child + 0xbc0) = 2; } uVar6 = Random(); (npc->_v2).x = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 1.0) * npc->_speedMultiplier + (npc->_v2).x; } else { fVar17 = npc->_friction; iVar15 = npc->_i1; (npc->_v1).y = 1.0; npc->_friction = fVar17 * 0.85; puStack_20 = local_50 + 0x4c; if (0 < iVar15) { iVar15 = ((int)npc->_prevUpdateTime - (int)npc->_updateTime) + iVar15; npc->_i1 = iVar15; puStack_20 = local_50 + 0x4c; if (iVar15 < 0) { puStack_20 = local_50 + 0x4c; ANM2::PlayOverlay(&npc->_sprite,(byte *)"HeadChargeOverlay",0); if (npc->_child != (EntityPtr)0x0) { *(undefined4 *)((int)npc->_child + 0xbc0) = 2; } } } } goto LAB_0059cf9b; case 6: bVar5 = npc->_collidesWithGrid; npc->_friction = npc->_friction * 0.98; (npc->_v2).x = npc->_speedMultiplier + (npc->_v2).x; puStack_20 = local_50 + 0x4c; if (bVar5 != 0) { local_64.y = (npc->_velocity).x - (npc->_gridCollisionVelocity).x; local_54 = (EntityPtr)((npc->_velocity).y - (npc->_gridCollisionVelocity).y); puStack_20 = local_50 + 0x4c; for (EVar12 = (EntityPtr)Entity::GetLastParent((Entity *)npc); EVar12 != (EntityPtr)0x0; EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0)) { if (*(byte *)((int)EVar12 + 400) == 0) { *(byte *)((int)EVar12 + 400) = npc->_collidesWithGrid; ((Vector *)((int)EVar12 + 0x194))->x = (npc->_gridCollisionVelocity).x; *(float *)((int)EVar12 + 0x198) = (npc->_gridCollisionVelocity).y; ((Vector *)((int)EVar12 + 0x19c))->x = (npc->_gridCollisionNormal).x; *(float *)((int)EVar12 + 0x1a0) = (npc->_gridCollisionNormal).y; fVar17 = ((Vector *)((int)EVar12 + 0x360))->x; *(float *)((int)EVar12 + 0x364) = *(float *)((int)EVar12 + 0x39c) * (float)local_54 + *(float *)((int)EVar12 + 0x364); ((Vector *)((int)EVar12 + 0x360))->x = *(float *)((int)EVar12 + 0x39c) * local_64.y + fVar17; } } } EVar12 = npc->_parent; EVar19 = npc->_child; if (EVar12 == (EntityPtr)0x0) { if (EVar19 != (EntityPtr)0x0) { fVar17 = atan2f((npc->_pos).y - *(float *)((int)EVar19 + 0x340), (npc->_pos).x - *(float *)((int)EVar19 + 0x33c)); (npc->_v1).x = fVar17 * 57.295776; local_64.y = *(float *)((int)EVar19 + 0x38c) + *(float *)((int)EVar19 + 0x394); local_54 = (EntityPtr)(*(float *)((int)EVar19 + 0x390) + *(float *)((int)EVar19 + 0x398)); goto LAB_0059d1f5; } } else { if (EVar19 == (EntityPtr)0x0) { local_64.y = *(float *)((int)EVar12 + 0x38c) + *(float *)((int)EVar12 + 0x394); local_54 = (EntityPtr)(*(float *)((int)EVar12 + 0x390) + *(float *)((int)EVar12 + 0x398)); LAB_0059d1f5: local_5c.x = ((npc->_prevPosition).x + (npc->_prevVelocity).x) - local_64.y; local_5c.y = ((npc->_prevPosition).y + (npc->_prevVelocity).y) - (float)local_54; followOffset = Vector::Resized(&local_5c,&local_2c,24.0); fVar18 = (npc->_velocity).x; fVar17 = (npc->_velocity).y; fVar18 = (((local_64.y + followOffset->x) - (npc->_pos).x) - fVar18) * 0.5 + fVar18; (npc->_velocity).y = ((((float)local_54 + followOffset->y) - (npc->_pos).y) - fVar17) * 0.5 + fVar17; } else { fVar17 = (npc->_velocity).y; fVar18 = (npc->_velocity).x; fVar18 = (((*(float *)((int)EVar12 + 0x38c) + *(float *)((int)EVar12 + 0x394) + *(float *)((int)EVar19 + 0x38c) + *(float *)((int)EVar19 + 0x394)) * 0.5 - (npc->_pos).x) - fVar18) * 0.5 + fVar18; (npc->_velocity).y = (((*(float *)((int)EVar12 + 0x390) + *(float *)((int)EVar12 + 0x398) + *(float *)((int)EVar19 + 0x390) + *(float *)((int)EVar19 + 0x398)) * 0.5 - (npc->_pos).y) - fVar17) * 0.5 + fVar17; } (npc->_velocity).x = fVar18; } fVar18 = 0.0; local_6c = 0.0; local_64.y = 0.0; EVar12 = (EntityPtr)Entity::GetLastParent((Entity *)npc); fVar17 = local_6c; if (EVar12 != (EntityPtr)0x0) { do { fVar17 = fVar17 + ((Vector *)((int)EVar12 + 0x38c))->x; local_6c = local_6c + *(float *)((int)EVar12 + 0x390); EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); fVar18 = (float)((int)fVar18 + 1); } while (EVar12 != (EntityPtr)0x0); local_64.y = fVar18; } fVar21 = 0.0; fVar20 = 0.0; fVar17 = fVar17 / (float)(int)fVar18; local_6c = local_6c / (float)(int)fVar18; avgSpin = 0.0; EVar19 = npc->_parent; EVar12 = (EntityPtr)npc; while (ancestor = EVar19, ancestor != (EntityPtr)0x0) { EVar12 = ancestor; EVar19 = *(EntityPtr *)((int)ancestor + 0x3bc); } do { fVar20 = fVar20 + ((Vector *)((int)EVar12 + 0x394))->x; fVar21 = fVar21 + *(float *)((int)EVar12 + 0x398); local_2c.y = ((Vector *)((int)EVar12 + 0x38c))->x - fVar17; local_54 = (EntityPtr)(*(float *)((int)EVar12 + 0x390) - local_6c); local_5c.y = local_2c.y * local_2c.y + (float)local_54 * (float)local_54; fVar18 = sqrtf(local_5c.y); if (1.0 <= fVar18) { fVar18 = sqrtf(local_5c.y); if (0.0 < fVar18) { local_2c.y = (1.0 / fVar18) * local_2c.y; local_54 = (EntityPtr)((float)local_54 * (1.0 / fVar18)); } local_5c.y = cos(1.5707964); fVar18 = sin(1.5707964); avgSpin = ((float)local_54 * local_5c.y + fVar18 * local_2c.y) * *(float *)((int)EVar12 + 0x398) + (local_5c.y * local_2c.y - fVar18 * (float)local_54) * ((Vector *)((int)EVar12 + 0x394))->x + avgSpin; } EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); } while (EVar12 != (EntityPtr)0x0); fVar18 = (float)(int)local_64.y; avgSpin = avgSpin / fVar18; fVar20 = fVar20 / fVar18; fVar21 = fVar21 / fVar18; fVar18 = ((npc->_v2).x - 60.0) / 90.0; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } local_2c.y = 1.0 - fVar18; local_54 = (EntityPtr)(local_2c.y * 10.0); if ((int)local_64.y < 4) { local_54 = (EntityPtr)((float)local_54 * 1.35); } local_5c.y = fVar21 * fVar21 + fVar20 * fVar20; local_64.y = sqrtf(local_5c.y); if ((0.5 < (float)local_54) && (local_64.y < (float)local_54)) { fVar18 = sqrtf(local_5c.y); if (0.0 < fVar18) { fVar18 = (((float)local_54 - local_64.y) * 0.2) / fVar18; fVar20 = fVar20 * fVar18; fVar21 = fVar18 * fVar21; } fVar18 = npc->_speedMultiplier; (npc->_velocity).x = fVar18 * fVar20 + (npc->_velocity).x; (npc->_velocity).y = fVar18 * fVar21 + (npc->_velocity).y; } fVar18 = local_2c.y * local_2c.y * 6.0; if ((0.5 < fVar18) && (ABS(avgSpin) < fVar18)) { local_5c.y = (npc->_prevPosition).x - fVar17; local_6c = (npc->_prevPosition).y - local_6c; if (avgSpin <= 0.0) { fVar18 = -fVar18; } local_2c.y = fVar18 - avgSpin; if (local_2c.y <= -0.5) { local_2c.y = -0.5; } if (0.5 <= local_2c.y) { local_2c.y = 0.5; } local_54 = (EntityPtr)cos(1.5707964); fVar18 = sin(1.5707964); fVar17 = npc->_speedMultiplier; (npc->_velocity).y = (local_5c.y * fVar18 + local_6c * (float)local_54) * local_2c.y * 0.05 * fVar17 + (npc->_velocity).y; (npc->_velocity).x = (local_5c.y * (float)local_54 - local_6c * fVar18) * local_2c.y * 0.05 * fVar17 + (npc->_velocity).x; } if (npc->_parent != (EntityPtr)0x0) goto LAB_0059de35; puVar4 = puStack_20; if ((150.0 < (npc->_v2).x) && (local_64.y < 3.0)) { local_64.y = (float)npc; do { fVar17 = local_64.y; local_54 = (EntityPtr)((int)local_64.y + 0x48); pbVar10 = *(byte **)((int)local_64.y + 0x9c); if (pbVar10 == (byte *)0x0) { LAB_0059d74b: bVar5 = ANM2::SetOverlayAnimation((ANM2 *)local_54,(byte *)"HeadChargeEndOverlay",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)((int)fVar17 + 0x98)); *(undefined1 *)((int)fVar17 + 0xac) = 1; } } else { pbVar9 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar9 = *(byte **)pbVar10; } animName = "HeadChargeEndOverlay"; do { bVar5 = *pbVar9; isLess = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_0059d730: uVar6 = -(uint)isLess | 1; goto LAB_0059d735; } if (bVar5 == 0) break; bVar5 = pbVar9[1]; isLess = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_0059d730; pbVar9 = pbVar9 + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_0059d735: if ((uVar6 != 0) || ((pbVar10[0x34] != 0 && (*(char *)((int)local_64.y + 0xac) == '\0')))) goto LAB_0059d74b; } local_64.y = *(float *)((int)local_64.y + 0x3c0); } while ((EntityPtr)local_64.y != (EntityPtr)0x0); if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { local_64.y = 0.0; puVar4 = puStack_20; if ((npc->_sprite)._overlayAnimState._isPlaying != 0) break; } local_64.y = (float)npc; do { EVar12 = (EntityPtr)local_64.y; local_5c.y = (float)((int)local_64.y + 0x48); pbVar10 = *(byte **)((int)local_64.y + 0x9c); if (pbVar10 == (byte *)0x0) { LAB_0059d7f2: bVar5 = ANM2::SetOverlayAnimation ((ANM2 *)((int)local_64.y + 0x48),(byte *)"HeadWalkOverlay",1); fVar17 = local_5c.y; if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)((int)local_5c.y + 0x50)); *(undefined1 *)&((Vector *)((int)fVar17 + 100))->x = 1; EVar12 = (EntityPtr)local_64.y; } } else { if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } animName = "HeadWalkOverlay"; do { bVar5 = *pbVar10; isLess = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_0059d7d2: uVar6 = -(uint)isLess | 1; goto LAB_0059d7d7; } if (bVar5 == 0) break; bVar5 = pbVar10[1]; isLess = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_0059d7d2; pbVar10 = pbVar10 + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_0059d7d7: if ((uVar6 != 0) || ((*(char *)(*(int *)((int)local_64.y + 0x9c) + 0x34) != '\0' && (*(char *)((int)local_64.y + 0xac) == '\0')))) goto LAB_0059d7f2; } *(int *)((int)EVar12 + 0xb64) = 4; ((Vector *)((int)EVar12 + 3000))->x = 0.0; std::deque::_Tidy(); local_64.y = *(float *)((int)EVar12 + 0x3c0); } while ((EntityPtr)local_64.y != (EntityPtr)0x0); local_2c.y = *(float *)&npc->_child; local_64.y = 0.0; puVar4 = puStack_20; if ((EntityPtr)local_2c.y != (EntityPtr)0x0) { local_64.y = 0.0; do { iVar15 = *(int *)((int)local_2c.y + 0x3bc); segmentPosY = *(undefined4 *)((int)local_2c.y + 0x33c); segmentPosY = *(undefined4 *)((int)local_2c.y + 0x340); local_54 = *(EntityPtr *)(iVar15 + 0xc10); if ((((uint)local_54 & 1) == 0) && (*(uint *)(iVar15 + 0xc0c) <= *(int *)(iVar15 + 0xc14) + 2U >> 1)) { std::deque::_Growmap(local_2c.y); local_54 = *(EntityPtr *)(iVar15 + 0xc10); } uVar6 = *(int *)(iVar15 + 0xc0c) * 2; uVar13 = uVar6 - 1 & (uint)local_54; *(uint *)(iVar15 + 0xc10) = uVar13; if (uVar13 == 0) { uVar13 = uVar6; } local_5c.y = (float)(uVar13 - 1); local_64.y = (float)(*(int *)(iVar15 + 0xc0c) - 1U & (uint)local_5c.y >> 1); if (*(int *)(*(int *)(iVar15 + 0xc08) + (int)local_64.y * 4) == 0) { pvVar11 = operator_new(0x10); *(void **)(*(int *)(iVar15 + 0xc08) + (int)local_64.y * 4) = pvVar11; } iVar14 = *(int *)(*(int *)(iVar15 + 0xc08) + (int)local_64.y * 4); *(undefined4 *)(iVar14 + ((uint)local_5c.y & 1) * 8) = segmentPosY; *(undefined4 *)(iVar14 + 4 + ((uint)local_5c.y & 1) * 8) = segmentPosY; *(int *)(iVar15 + 0xc14) = *(int *)(iVar15 + 0xc14) + 1; *(float *)(iVar15 + 0xc10) = local_5c.y; local_2c.y = *(float *)((int)local_2c.y + 0x3c0); } while ((EntityPtr)local_2c.y != (EntityPtr)0x0); local_2c.y = 0.0; puVar4 = puStack_20; } } break; case 8: npc->_friction = npc->_friction * 0.85; puStack_20 = local_50 + 0x4c; if ((npc->_parent == (EntityPtr)0x0) && (((npc->_sprite)._overlayAnimState._animData == (void *)0x0 || (puStack_20 = local_50 + 0x4c, (npc->_sprite)._overlayAnimState._isPlaying == 0)))) { puStack_20 = local_50 + 0x4c; Entity_NPC::PlaySound(npc,0x39,1.0,2,0,1.0); local_64.y = 0.0; local_54 = (EntityPtr)0x0; iVar15 = 0; EVar12 = (EntityPtr)npc; do { local_64.y = local_64.y + ((Vector *)((int)EVar12 + 0x33c))->x; local_54 = (EntityPtr)((float)local_54 + *(float *)((int)EVar12 + 0x340)); EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); iVar15 = iVar15 + 1; } while (EVar12 != (EntityPtr)0x0); Entity_NPC::CalcTargetPosition(npc,&local_5c,0.0); local_64.x = local_5c.x - local_64.y / (float)iVar15; local_64.y = local_5c.y - (float)local_54 / (float)iVar15; Vector::Resized(&local_64,&local_5c,12.0); pEVar16 = (EntityPtr *)local_5c.y; fVar17 = local_5c.x; local_54 = (EntityPtr)npc; do { EVar12 = local_54; pfVar2 = (float *)((Vector *)((int)local_54 + 0x9c))->x; if (pfVar2 == (float *)0x0) { LAB_0059cf3b: bVar5 = ANM2::SetOverlayAnimation ((ANM2 *)((int)local_54 + 0x48),(byte *)"HeadChargeLoopOverlay",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)((int)EVar12 + 0x98)); *(undefined1 *)((int)EVar12 + 0xac) = 1; } pEVar16 = (EntityPtr *)local_5c.y; fVar17 = local_5c.x; } else { pfVar8 = pfVar2; if (0xf < (uint)pfVar2[5]) { pfVar8 = (float *)*pfVar2; } animName = "HeadChargeLoopOverlay"; do { bVar5 = *(byte *)pfVar8; isLess = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_0059cf20: uVar6 = -(uint)isLess | 1; goto LAB_0059cf25; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)pfVar8 + 1); isLess = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_0059cf20; pfVar8 = (float *)((int)pfVar8 + 2); animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_0059cf25: if (uVar6 != 0) goto LAB_0059cf3b; if (*(char *)(pfVar2 + 0xd) != '\0') { if (*(char *)((int)local_54 + 0xac) == '\0') goto LAB_0059cf3b; } } ((Vector *)((int)local_54 + 0xb64))->x = 8.40779e-45; ((Vector *)((int)local_54 + 0x360))->x = fVar17; *(EntityPtr **)((int)local_54 + 0x364) = pEVar16; ((Vector *)((int)local_54 + 3000))->x = 0.0; local_54 = *(EntityPtr *)((int)local_54 + 0x3c0); } while (local_54 != (EntityPtr)0x0); } LAB_0059cf9b: Entity_NPC::FollowParentSegment(npc,1,24.0,20.0); puVar4 = puStack_20; break; case 0x10: npc->_friction = npc->_friction * 0.85; Entity_NPC::FollowParentSegment(npc,1,24.0,20.0); if (((npc->_sprite)._animState._animData == (void *)0x0) || (puVar4 = puStack_20, (npc->_sprite)._animState._isPlaying == 0)) { if (npc->_parent != (EntityPtr)0x0) goto LAB_0059de35; fVar17 = npc->_maxHitPoints; local_54 = (EntityPtr)(fVar17 * 0.1 + npc->_health); if (fVar17 <= (float)local_54) { local_54 = (EntityPtr)fVar17; } segmentCount = 0; local_64.y = (float)npc; do { EVar12 = (EntityPtr)local_64.y; local_5c.y = (float)((int)local_64.y + 0x48); *(EntityPtr *)((int)local_64.y + 0x380) = local_54; segmentCount = segmentCount + 1; pbVar10 = *(byte **)((int)local_64.y + 0x9c); if (pbVar10 == (byte *)0x0) { LAB_0059da15: bVar5 = ANM2::SetOverlayAnimation ((ANM2 *)((int)local_64.y + 0x48),(byte *)"HeadWalkOverlay",1); fVar17 = local_5c.y; if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)((int)local_5c.y + 0x50)); *(undefined1 *)((int)fVar17 + 100) = 1; EVar12 = (EntityPtr)local_64.y; } } else { if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } animName = "HeadWalkOverlay"; do { bVar5 = *pbVar10; isLess = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_0059d9f5: uVar6 = -(uint)isLess | 1; goto LAB_0059d9fa; } if (bVar5 == 0) break; bVar5 = pbVar10[1]; isLess = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_0059d9f5; pbVar10 = pbVar10 + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_0059d9fa: if ((uVar6 != 0) || ((*(char *)(*(int *)((int)local_64.y + 0x9c) + 0x34) != '\0' && (*(char *)((int)local_64.y + 0xac) == '\0')))) goto LAB_0059da15; } *(int *)((int)EVar12 + 0xb64) = 4; uVar6 = Random(); *(uint *)((int)EVar12 + 0x168) = *(uint *)((int)EVar12 + 0x168) & 0xfffffffe; *(int *)((int)EVar12 + 0x188) = 4; *(byte *)((int)EVar12 + 0x3b0) = 0; dVar1 = __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]; *(undefined4 *)((int)EVar12 + 0x16c) = *(undefined4 *)((int)EVar12 + 0x16c); ((Vector *)((int)EVar12 + 3000))->x = (float)((double)(int)uVar6 + dVar1) * -2.3283064e-10 * 120.0; local_64.y = *(float *)((int)EVar12 + 0x3c0); } while ((EntityPtr)local_64.y != (EntityPtr)0x0); iVar14 = 0; iVar15 = segmentCount / 2; EVar12 = (EntityPtr)npc; EVar19 = (EntityPtr)npc; if (0 < iVar15) { do { EVar19 = (EntityPtr)0x0; if (EVar12 == (EntityPtr)0x0) break; EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); iVar14 = iVar14 + 1; EVar19 = EVar12; } while (iVar14 < iVar15); } local_64.y = *(float *)((int)EVar19 + 0x33c); local_54 = *(EntityPtr *)((int)EVar19 + 0x340); iVar14 = *(int *)((int)EVar19 + 0x3bc); if (iVar15 * 2 < segmentCount) { local_2c.y = (float)(iVar14 + 0x3c0); local_5c.y = (float)segmentCount; if (*(int *)(iVar14 + 0x3c0) != 0) { local_5c.y = local_2c.y; std::multiset::erase(&local_5c.y); } *(int *)local_2c.y = 0; local_2c.y = (float)(*(int *)((int)EVar19 + 0x3c0) + 0x3bc); if (*(int *)local_2c.y != 0) { local_5c.y = local_2c.y; std::multiset::erase(&local_5c.y); } *(int *)local_2c.y = 0; (**(code **)(*(int *)EVar19 + 0x28))(); } else { local_5c.y = (float)(iVar14 + 0x3c0); local_64.y = (local_64.y + *(float *)(iVar14 + 0x33c)) * 0.5; local_54 = (EntityPtr)(((float)local_54 + *(float *)(iVar14 + 0x340)) * 0.5); local_2c.y = local_5c.y; if (*(int *)(iVar14 + 0x3c0) != 0) { std::multiset::erase(&local_5c.y); } local_5c.y = (float)((int)EVar19 + 0x3bc); *(undefined4 *)local_2c.y = 0; if (*(int *)local_5c.y != 0) { std::multiset::erase(&local_5c.y); } *(int *)((int)EVar19 + 0x3bc) = 0; } local_5c.y = (npc->_pos).x; local_2c.y = (npc->_pos).y; *(float *)((int)EVar19 + 0x33c) = local_64.y; *(EntityPtr *)((int)EVar19 + 0x340) = local_54; Entity::BloodExplode((Entity *)npc); *(float *)((int)EVar19 + 0x33c) = local_5c.y; *(float *)((int)EVar19 + 0x340) = local_2c.y; puVar4 = puStack_20; } } puStack_20 = puVar4; if (npc->_parent == (EntityPtr)0x0) { iVar15 = 0; EVar12 = (EntityPtr)npc; do { EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); iVar15 = iVar15 + 1; } while (EVar12 != (EntityPtr)0x0); if ((3 < iVar15) && ((npc->_dead != 0 || (fVar17 = (float)(iVar15 / 2) * 0.1 * npc->_maxHitPoints, npc->_health <= fVar17 && fVar17 != npc->_health)))) { segmentPosY = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_state = 0x10; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = segmentPosY; EVar12 = (EntityPtr)npc; do { *(byte *)((int)EVar12 + 0x173) = 0; *(int *)((int)EVar12 + 0x188) = 0; *(int *)((int)EVar12 + 0xb64) = 0x10; AnimationState::SetAnimationData((AnimationState *)((int)EVar12 + 0x98),(void *)0x0); if (*(EntityPtr *)((int)EVar12 + 0x3bc) == (EntityPtr)0x0) { animName = "DeathHead"; } else { sprintf((byte *)&local_44,(byte *)"DeathBody%02d"); animName = (char *)&local_44; } ANM2::Play((ANM2 *)((int)EVar12 + 0x48),(byte *)animName,0); ((Vector *)((int)EVar12 + 3000))->x = 0.0; *(float *)((int)EVar12 + 0xbbc) = 0.0; std::deque::_Tidy(); EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c0); } while (EVar12 != (EntityPtr)0x0); local_64.y = *(float *)&npc->_child; if ((EntityPtr)local_64.y != (EntityPtr)0x0) { do { iVar15 = *(int *)((int)local_64.y + 0x3bc); local_2c.y = *(float *)((int)local_64.y + 0x33c); segmentPosY = *(undefined4 *)((int)local_64.y + 0x340); local_54 = *(EntityPtr *)(iVar15 + 0xc10); if ((((uint)local_54 & 1) == 0) && (*(uint *)(iVar15 + 0xc0c) <= *(int *)(iVar15 + 0xc14) + 2U >> 1)) { std::deque::_Growmap(local_64.y); local_54 = *(EntityPtr *)(iVar15 + 0xc10); } uVar6 = *(int *)(iVar15 + 0xc0c) * 2; uVar13 = uVar6 - 1 & (uint)local_54; *(uint *)(iVar15 + 0xc10) = uVar13; if (uVar13 == 0) { uVar13 = uVar6; } local_5c.y = (float)(uVar13 - 1); uVar6 = (uint)local_5c.y >> 1 & *(int *)(iVar15 + 0xc0c) - 1U; if (*(int *)(*(int *)(iVar15 + 0xc08) + uVar6 * 4) == 0) { pvVar11 = operator_new(0x10); *(void **)(*(int *)(iVar15 + 0xc08) + uVar6 * 4) = pvVar11; } iVar14 = *(int *)(*(int *)(iVar15 + 0xc08) + uVar6 * 4); *(float *)(iVar14 + ((uint)local_5c.y & 1) * 8) = local_2c.y; *(undefined4 *)(iVar14 + 4 + ((uint)local_5c.y & 1) * 8) = segmentPosY; *(int *)(iVar15 + 0xc14) = *(int *)(iVar15 + 0xc14) + 1; *(float *)(iVar15 + 0xc10) = local_5c.y; local_64.y = *(float *)((int)local_64.y + 0x3c0); } while ((EntityPtr)local_64.y != (EntityPtr)0x0); local_64.y = 0.0; } } } LAB_0059de35: uVar6 = Random(); if ((uVar6 & 7) == 0) { uVar6 = Random(); splat = Entity_NPC::MakeSplat (npc,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&npc->_splatColor,0xffffffff,0xff,0,1); } if ((((npc->_flags & 0x4000) == 0) && (bVar5 = Game::IsPaused(g_game), bVar5 == 0)) && ((int)((npc->_prevUpdateTime + 0.0) * -0.125) != (int)((npc->_updateTime + 0.0) * -0.125))) { uVar6 = Random(); trailEffect = Game::SpawnEx(g_game,1000,0x5e,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6,0); uVar6 = Random(); iVar15 = *(int *)trailEffect; fVar18 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.25 + 0.75; fVar17 = fVar18 * g_vectorOne.x; (trailEffect->_sprite)._scale.y = fVar18 * g_vectorOne.y; (trailEffect->_sprite)._scale.x = fVar17; (**(code **)(iVar15 + 0xc))(); } ENTITY_TURDLET_segments(npc); ExceptionList = local_1c; return; } //@@ 0059e250 Room::IsDoorSlotAllowed /* ZHL [lua] Lua binding Room:IsDoorSlotAllowed */ uint Room::IsDoorSlotAllowed(uint param_1) { uint uVar1; uint in_ECX; if (param_1 < 8) { uVar1 = 1 << ((byte)param_1 & 0x1f); return CONCAT31((int3)(uVar1 >> 8), (*(uint *)(*(int *)(*(int *)(in_ECX + 4) + 0x10) + 0x38 + (param_1 >> 5) * 4) & uVar1) != 0); } return in_ECX & 0xffffff00; } //@@ 0059e290 Game::Difficulty /* ZHL [lua] Lua binding Game:Difficulty */ int __thiscall Game::Difficulty(Game *this) { return this->_difficulty; } //@@ 0059e2a0 NpcHelper::UltraGreed_Heal /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: hp += mhp*.00125*n, i2+=n */ void NpcHelper::UltraGreed_Heal(int param_1) { int iVar1; int *in_ECX; float fVar2; float fVar3; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; float local_14; float local_10; float local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; in_ECX[0x2f1] = in_ECX[0x2f1] + param_1; iVar1 = in_ECX[0x2f1]; if (0x19 < iVar1) { iVar1 = 0x19; } in_ECX[0x2f1] = iVar1; fVar3 = (float)in_ECX[0xe1]; fVar2 = fVar3 * 0.00125 * (float)param_1 + (float)in_ECX[0xe0]; in_ECX[0xe0] = (int)fVar2; if (fVar3 < fVar2) { in_ECX[0xe0] = (int)fVar3; } fVar3 = (float)param_1 / 3.0; param_1 = param_1 * 4; if (0xf < param_1) { param_1 = 0xf; } local_14 = 1.0; if (fVar3 <= 1.0) { local_14 = fVar3; } local_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; local_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; local_10 = local_14 * 0.84; local_c = local_14 * 0.0; (**(code **)(*in_ECX + 0x3c))(&local_34,param_1,0xff,1,1); return; } //@@ 0059e390 Entity_NPC::CreateBling /* ZHL [exact] __thiscall void Entity_NPC::CreateBling(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_NPC::CreateBling(Entity_NPC *this) { uint uVar1; Entity *pEVar2; int iVar3; undefined4 uVar4; TypeDescriptor *pTVar5; TypeDescriptor *pTVar6; undefined4 uVar7; undefined1 local_24 [12]; float local_18; float local_10; float local_c; float local_8; uVar1 = Random(); local_8 = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 1.0) * 187.5; uVar1 = Random(); local_10 = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 125.0; local_c = local_8; Sprite::GetTexel(local_24,local_10,local_8,g_vectorZero.x,g_vectorZero.y,0x3f666666,0xffffffff); if (1.0 <= local_18) { uVar1 = Random(); uVar7 = 0; pTVar6 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar5 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar4 = 0; pEVar2 = Game::Spawn(g_game,1000,0x67,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar1); iVar3 = __RTDynamicCast(pEVar2,uVar4,pTVar5,pTVar6,uVar7); *(float *)(iVar3 + 0xdc) = local_10; *(undefined4 *)(iVar3 + 0x354) = 1000; *(float *)(iVar3 + 0xe0) = local_8; } return; } //@@ 0059e4c0 Entity_NPC::CreateGoldParticles /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_NPC::CreateGoldParticles(unsigned int count); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_NPC::CreateGoldParticles(Entity_NPC *this,uint count) { uint uVar1; undefined1 local_64 [12]; float local_58; Vector local_50; float local_48; float local_44; float local_40; float local_3c; ColorMod local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); for (; count != 0; count = count - 1) { uVar1 = Random(); local_3c = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 1.0) * 187.5; uVar1 = Random(); local_48 = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 125.0; local_44 = local_3c; local_40 = local_48; Sprite::GetTexel(local_64,local_48,local_3c,g_vectorZero.x,g_vectorZero.y,0x3f666666,0xffffffff) ; if (1.0 <= local_58) { local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; local_50.x = local_40 + (this->_pos).x; local_38._offset[2] = 0.0; local_50.y = (this->_pos).y; Game::SpawnParticles(g_game,&local_50,0x5f,7,12.0,&local_38,local_3c,0); } } return; } //@@ 0059e630 NpcHelper::UltraDoor_Opposite /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: door slot -> opposite door entity */ int NpcHelper::UltraDoor_Opposite (int param_1,char param_2,int param_3,undefined4 param_4,uint param_5) { qword qVar1; uint uVar2; int iVar3; qword *pqVar4; int iVar5; uint uVar6; int local_34 [9]; void *local_10; undefined1 *puStack_c; int local_8; puStack_c = &LAB_00af57bd; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_34 + 0xc); ExceptionList = &local_10; local_8 = 0; local_34[8] = uVar2; if (param_1 != 0) { iVar5 = -1; local_34[0] = 2; local_34[1] = 3; local_34[2] = 0; local_34[3] = 1; local_34[4] = 6; local_34[5] = 7; local_34[6] = 4; local_34[7] = 5; if (*(uint *)(param_1 + 0xbc0) < 8) { iVar5 = local_34[*(uint *)(param_1 + 0xbc0)]; } uVar6 = 0; if (param_5 != 0) { do { iVar3 = __RTDynamicCast(*(undefined4 *)(param_3 + uVar6 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar2); if ((iVar3 != 0) && (*(int *)(iVar3 + 0xbc0) == iVar5)) goto LAB_0059e6d2; uVar6 = uVar6 + 1; } while (uVar6 < param_5); } } iVar3 = 0; LAB_0059e6d2: if (param_2 == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (param_3 != 0) { uVar2 = *(uint *)(param_3 + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar2); free((void *)(param_3 + -4)); } } ExceptionList = local_10; return iVar3; } //@@ 0059e730 NpcHelper::UltraGreed_Smash /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: shockwave+blast+door lasers (ultra greed port) prototype: db/protos.zhl, confirmed by RET 8 */ void NpcHelper::UltraGreed_Smash(Entity_NPC *npc,Vector position) { RNG rng; qword qVar1; Entity_NPC *pEVar2; uint uVar3; int iVar4; int oppositeDoor; float randomDoor; uint outcomeCount; WeightedOutcomePicker ptr; Game *game; qword *allocCounter; EntityList_EL ultraDoors; WeightedOutcomePicker picker; undefined4 *pickerEnd; undefined4 *pickerCapacity; Entity_NPC *boss; uint pickSeed; undefined8 uStack_8c; float fStack_84; float local_80; ColorMod particleColor; ColorMod explosionColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; int *outcomeWeight; void *room; puStack_20 = (undefined1 *)(&explosionColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af580b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&explosionColor)[1]._colorize + 1); ExceptionList = &local_1c; boss = npc; Entity_NPC::CreateGoldParticles(npc,0x1e); manager = g_manager; local_80 = 1.93379e-43; seed_fart_sound_override((int *)&local_80); SoundEffects::Play(&manager->_sfxManager,(int)local_80,1.0,2,0,1.0,0.0); uVar3 = Random(); manager = g_manager; local_80 = 6.72623e-44; fStack_84 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; seed_fart_sound_override((int *)&local_80); SoundEffects::Play(&manager->_sfxManager,(int)local_80,1.0,2,0,fStack_84,0.0); game = g_game; fStack_84 = position.x; room = g_game->_room; local_80 = position.y; *(int *)((int)room + 0x70fc) = *(int *)((int)room + 0x70fc) + 1; uVar3 = *(uint *)((int)room + 0x70fc) & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } if (1 < uVar3) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); game = g_game; } pEVar2 = boss; iVar4 = uVar3 + 0x407; *(float *)((int)room + iVar4 * 0x1c) = fStack_84; *(float *)((int)room + iVar4 * 0x1c + 4) = local_80; *(undefined4 *)((int)room + iVar4 * 0x1c + 8) = 0; *(undefined4 *)((int)room + iVar4 * 0x1c + 0xc) = 0x3ccccccd; *(undefined4 *)((int)room + iVar4 * 0x1c + 0x10) = 0x3ccccccd; *(undefined4 *)((int)room + iVar4 * 0x1c + 0x14) = 0; *(undefined4 *)((int)room + iVar4 * 0x1c + 0x18) = 0x19; explosionColor._offset[0] = 0.5; explosionColor._offset[1] = 0.25; explosionColor._colorize[0] = 0.0; explosionColor._colorize[1] = 0.0; explosionColor._colorize[2] = 0.0; explosionColor._colorize[3] = 0.0; explosionColor._offset[2] = 0.0; explosionColor._tint[0] = 1.0; explosionColor._tint[1] = 1.0; explosionColor._tint[2] = 1.0; explosionColor._tint[3] = 1.0; Game::BombExplosionEffects (game,&position,60.0,(BitSet128)ZEXT816(0),&explosionColor,(Entity *)boss,1.8,1,4,0); particleColor._tint[0] = 1.0; particleColor._tint[1] = 1.0; particleColor._tint[2] = 1.0; particleColor._tint[3] = 1.0; particleColor._offset[0] = 0.0; particleColor._colorize[0] = 0.0; particleColor._colorize[1] = 0.0; particleColor._colorize[2] = 0.0; particleColor._colorize[3] = 0.0; particleColor._offset[1] = 0.0; particleColor._offset[2] = 0.0; Game::SpawnParticles(g_game,&position,0x5f,0xf,5.0,&particleColor,100000.0,0); EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&ultraDoors,0x126,-1,-1,1,0); local_14 = 0.0; if ((pEVar2->_state == 700) || (pEVar2->_state == 0x10)) { picker = (WeightedOutcomePicker)0x0; pickerEnd = (undefined4 *)0x0; pickerCapacity = (undefined4 *)0x0; local_14 = 1.4013e-45; uStack_8c = uStack_8c & 0xffffffff; fStack_84 = 1.4013e-43; std::vector<8byte>::_Emplace_reallocate(0,(int)&uStack_8c + 4); uVar3 = 0; outcomeCount = (int)pickerEnd - (int)picker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)picker + uVar3 * 8) == 1) { outcomeWeight = (int *)((int)picker + 4 + uVar3 * 8); *outcomeWeight = *outcomeWeight + 0x46; if (*outcomeWeight < 0) { *(undefined4 *)((int)picker + 4 + uVar3 * 8) = 0; } goto LAB_0059eaaa; } uVar3 = uVar3 + 1; } while (uVar3 < outcomeCount); } uStack_8c = CONCAT44(1,(undefined4)uStack_8c); fStack_84 = 9.80909e-44; if (pickerEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,(int)&uStack_8c + 4); } else { *pickerEnd = 1; pickerEnd[1] = 0x46; pickerEnd = pickerEnd + 2; } LAB_0059eaaa: pickSeed = Random(); pickSeed = pickSeed | 1; uStack_8c = 0x900000005; fStack_84 = 9.80909e-45; rng._shift1 = 5; rng._seed = pickSeed; rng._shift2 = 9; rng._shift3 = 7; uVar3 = WeightedOutcomePicker::PickOutcome(&picker,rng); if ((uVar3 == 0) || (boss->_state == 0x10)) { Game::ShakeScreen(g_game,0xd); if ((float)ultraDoors._size != 0.0) { uVar3 = Random(); local_80 = (float)(uVar3 % (uint)ultraDoors._size + 1); if (0 < (int)local_80) { do { uVar3 = Random(); iVar4 = __RTDynamicCast(*(undefined4 *) ((int)ultraDoors._data + (uVar3 % (uint)ultraDoors._size) * 4), 0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); oppositeDoor = UltraDoor_Opposite(iVar4,1,ultraDoors._data,ultraDoors._capacity, ultraDoors._size); if ((iVar4 != 0) && (*(int *)(iVar4 + 0xb64) == 3)) { *(undefined4 *)(iVar4 + 0xb64) = 8; } if ((oppositeDoor != 0) && (*(int *)(oppositeDoor + 0xb64) == 3)) { *(undefined4 *)(oppositeDoor + 0xb64) = 9; } local_80 = (float)((int)local_80 + -1); } while (local_80 != 0.0); } } } else if ((uVar3 == 1) && (Game::ShakeScreen(g_game,0x12), (float)ultraDoors._size != 0.0)) { local_80 = (float)ultraDoors._size; do { if ((float)ultraDoors._size == 0.0) { uVar3 = 0; } else { uVar3 = Random(); uVar3 = uVar3 % (uint)ultraDoors._size; } iVar4 = __RTDynamicCast(*(undefined4 *)((int)ultraDoors._data + uVar3 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); oppositeDoor = UltraDoor_Opposite(iVar4,1,ultraDoors._data,ultraDoors._capacity, ultraDoors._size); if ((iVar4 != 0) && (*(int *)(iVar4 + 0xb64) == 3)) { *(undefined4 *)(iVar4 + 0xb64) = 8; } if ((oppositeDoor != 0) && (*(int *)(oppositeDoor + 0xb64) == 3)) { *(undefined4 *)(oppositeDoor + 0xb64) = 9; } local_80 = (float)((int)local_80 - 1); } while (local_80 != 0.0); local_80 = 0.0; } local_14 = (float)((uint)local_14 & 0xffffff00); if (picker != (WeightedOutcomePicker)0x0) { uVar3 = ((int)pickerCapacity - (int)picker >> 3) * 8; ptr = picker; if (0xfff < uVar3) { ptr = *(WeightedOutcomePicker *)((int)picker + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)picker - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar3); } } if ((boss->_state == 0x2c6) && (Game::ShakeScreen(g_game,10), (float)ultraDoors._size != 0.0)) { uVar3 = Random(); randomDoor = (float)__RTDynamicCast(*(undefined4 *) ((int)ultraDoors._data + (uVar3 % (uint)ultraDoors._size) * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); fStack_84 = randomDoor; iVar4 = UltraDoor_Opposite(randomDoor,1,ultraDoors._data,ultraDoors._capacity,ultraDoors._size); if (randomDoor != 0.0) { *(undefined4 *)((int)randomDoor + 0xb64) = 8; *(undefined4 *)((int)randomDoor + 0x410) = 0; } if (iVar4 != 0) { *(undefined4 *)(iVar4 + 0xb64) = 9; *(undefined4 *)(iVar4 + 0x410) = 0; } } if (ultraDoors._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (ultraDoors._data != (void *)0x0) { uVar3 = *(uint *)((int)ultraDoors._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)ultraDoors._data + -4)); } } ExceptionList = local_1c; return; } //@@ 0059edb0 NpcAI::ENTITY_ULTRA_GREED /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* NPC AI for entity type 406 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ULTRA_GREED(Entity_NPC *npc) { byte bVar1; code *pcVar2; RNG rng; RNG rng_00; Vector position; Vector position_00; byte bVar3; char cVar4; uint uVar5; uint uVar6; Entity *tmpEntity; int *piVar7; byte *pbVar8; int iVar9; byte *pbVar10; Vector *vecResult; ColorMod *color; ColorMod *color_00; EntityPtr EVar11; EntityConfig_Entity *configEntity; EntityPtr EVar12; char *pcVar13; Game *extraout_ECX; Game *extraout_ECX_00; Game *extraout_ECX_01; Game *extraout_ECX_02; Game *extraout_ECX_03; undefined4 extraout_ECX_04; Game *pGVar14; Game *extraout_ECX_05; int unused; int unused_00; int unused_01; int extraout_ECX_06; int extraout_ECX_07; int unused_02; int unused_03; int unused_04; Game *animState; Entity *this_00; Game *this_01; ANM2 *extraout_ECX_08; ANM2 *extraout_ECX_09; ANM2 *extraout_ECX_10; ANM2 *extraout_ECX_11; ANM2 *extraout_ECX_12; ANM2 *extraout_ECX_13; ANM2 *extraout_ECX_14; ANM2 *extraout_ECX_15; void *pvVar15; GridEntity *pit; undefined4 extraout_EDX; uint3 uVar18; uint3 extraout_var; undefined4 extraout_EDX_00; int iVar16; int iVar17; float fVar19; WeightedOutcomePicker WVar20; float fVar21; bool bVar22; undefined1 *puVar23; float fVar24; undefined8 uVar25; double dVar26; undefined4 uVar27; TypeDescriptor *pTVar28; TypeDescriptor *pTVar29; undefined4 uVar30; EntityRef npcRef; EntityList_EL greedGapers; EntityList_EL ultraCoins; EntityList_EL keepers; EntityList_EL ultraDoors; EntityList_EL coinPickups; undefined1 local_1e4 [28]; undefined8 uStack_1c8; undefined1 *puStack_1c0; Vector scratchVec; Vector local_1b4; Vector local_1ac; Vector local_1a4; Vector local_19c; void *local_194; uint isStomp2; Vector local_18c; Vector local_184; Vector local_17c; float local_174; Vector local_170; float local_168; undefined1 *local_164; WeightedOutcomePicker outcomePicker; Vector local_15c; Vector local_154; float local_14c; float local_148; byte isStomp1; byte local_141; EntityPtr local_140; EntityPtr local_13c; Vector local_138; EntityPtr local_130; EntityPtr local_12c; ProjectileParams projectileParams; Color tmpColor; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; float fStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; AnimationState *animState; Manager *manager; Room *room; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af589d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_130 = (EntityPtr)npc; puVar23 = (undefined1 *)((int)register0x00000010 + -4); if ((npc->_variant == 1) && (puVar23 = (undefined1 *)((int)register0x00000010 + -4), 0.0 < npc->_pendingDamage)) { FUN_005a6fb0(local_24); uVar5 = __ftoui3(); Entity_NPC::CreateGoldParticles(npc,uVar5); puVar23 = puStack_20; } puStack_20 = puVar23; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&coinPickups,5,0x14,-1,1,0); local_14 = 0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&ultraCoins,0x125,-1,-1,1,0); local_14._0_1_ = 1; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&greedGapers,299,-1,-1,1,0); local_14._0_1_ = 2; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&keepers,0x56,-1,-1,1,0); local_14._0_1_ = 3; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&ultraDoors,0x126,-1,-1,1,0); local_14 = CONCAT31(local_14._1_3_,4); fVar19 = 0.0; local_148 = 0.0; uVar27 = extraout_EDX; if ((float)coinPickups._size != 0.0) { fVar21 = 0.0; do { uVar25 = __RTDynamicCast(*(undefined4 *)((int)coinPickups._data + (int)fVar19 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); uVar27 = (undefined4)((ulonglong)uVar25 >> 0x20); iVar9 = (int)uVar25; if (iVar9 != 0) { if ((*(int *)(iVar9 + 0x2c) == 0x14) && (*(int *)(iVar9 + 0x30) - 1U < 7)) { iVar9 = *(int *)(&DAT_00b67e34 + *(int *)(iVar9 + 0x30) * 4); } else { iVar9 = 0; } fVar21 = (float)((int)fVar21 + iVar9); } fVar19 = (float)((int)fVar19 + 1); } while ((uint)fVar19 < (uint)coinPickups._size); npc = (Entity_NPC *)local_130; local_148 = fVar21; } local_17c.y = 65.0; local_14c = (float)(((uint)ultraCoins._size >> 1) + greedGapers._size + keepers._size); bVar3 = (g_manager->_persistentGameData)._achievements[0xf6]; uVar18 = (uint3)((uint)uVar27 >> 8); fVar19 = 45.0; local_194 = (void *)0x42340000; if ((bVar3 != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_17c.y = 85.0; fVar19 = 60.0; local_194 = (void *)0x42700000; } if (*(int *)((int)npc + 0x2c) == 1) { local_17c.y = fVar19; } iVar9 = *(int *)((int)npc + 0xb64); if (iVar9 == 0) { if ((bVar3 != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { *(float *)((int)npc + 900) = *(float *)((int)npc + 900) * 1.15; *(float *)((int)npc + 0x380) = *(float *)((int)npc + 0x380) * 1.15; } local_138.y = 1.0; local_138.x = 2.0; Entity::SetSize((Entity *)npc,*(float *)((int)npc + 0x370),(Vector)0x3f80000040000000, *(int *)((int)*(void **)((int)npc + 0x330) + 0x48)); *(byte *)((int)npc + 0xb4c) = 1; uVar5 = *(uint *)((int)npc + 0x168); uVar27 = *(undefined4 *)((int)npc + 0x16c); if (((uVar5 & 0x20000000) == 0) && ((float)ultraDoors._size == 0.0)) { uVar5 = 0; local_13c = (EntityPtr)0x1; local_130 = (EntityPtr)0x744; do { local_194 = g_game->_room; if ((uVar5 < 8) && ((*(uint *)(*(int *)(*(int *)((int)local_194 + 4) + 0x10) + 0x38 + (uVar5 >> 5) * 4) & (uint)local_13c) != 0)) { local_138.x = (float)(*(int *)((int)local_194 + (int)local_130) % *(int *)((int)local_194 + 0xc)) * 40.0 + 40.0; local_138.y = (float)(*(int *)((int)local_194 + (int)local_130) / *(int *)((int)local_194 + 0xc)) * 40.0 + 120.0; uVar6 = Random(); uVar30 = 0; pTVar29 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; tmpEntity = Game::Spawn(g_game,0x126,0,&local_138,&g_vectorZero,(Entity *)npc,0,uVar6); piVar7 = (int *)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); if (piVar7 != (int *)0x0) { piVar7[0x2f0] = uVar5; (**(code **)(*piVar7 + 0xc))(); } } uVar5 = uVar5 + 1; local_130 = (EntityPtr)((int)local_130 + 4); local_13c = (EntityPtr)((int)local_13c << 1 | (uint)((int)local_13c < 0)); } while ((int)local_130 < 0x764); uVar5 = *(uint *)((int)npc + 0x168); uVar27 = *(undefined4 *)((int)npc + 0x16c); } *(float *)((int)npc + 0xc40) = local_17c.y; *(int *)((int)npc + 0xc44) = 0x78; *(float *)((int)npc + 0xbb4) = 0.0; *(int *)((int)npc + 0xb64) = 2; *(uint *)((int)npc + 0x168) = uVar5 & 0xfffffffb; *(undefined4 *)((int)npc + 0x16c) = uVar27; pbVar10 = *(void **)((int)npc + 0x7c); if (pbVar10 != (byte *)0x0) { pbVar8 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar8 = *(byte **)pbVar10; } pcVar13 = "Hanging"; do { bVar3 = *pbVar8; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_0059f295: uVar5 = -(uint)bVar22 | 1; goto LAB_0059f29a; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_0059f295; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0059f29a: if ((uVar5 == 0) && ((pbVar10[0x34] == 0 || (*(byte *)((int)npc + 0x8c) != 0)))) goto LAB_005a472a; } bVar3 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"Hanging",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(byte *)((int)npc + 0x8c) = 1; } goto LAB_005a472a; } pGVar14 = g_game; if (((*(byte *)((int)npc + 0x173) != 0) && (iVar9 != 9000)) && (iVar9 != 0x2329)) { if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { get_mt_state_checksum(); KAGE_LogMessage(1,(byte *) "[Frame %d] Greed State Set: = STATE_TURN_GOLD ( Global Seed = %08x )\n"); } pGVar14 = g_game; *(int *)((int)npc + 0xb64) = 9000; ((Vector *)((int)npc + 0x334))->x = ((Vector *)((int)npc + 0x33c))->x; *(float *)((int)npc + 0x338) = *(float *)((int)npc + 0x340); *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) | 0x80000000; *(int *)((int)npc + 0x410) = 0; *(byte *)((int)npc + 0x173) = 0; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); local_140 = (EntityPtr)pGVar14->_room; local_13c = (EntityPtr)0x0; if (*(EntityPtr *)((int)local_140 + 0x1264) != (EntityPtr)0x0) { do { EVar12 = *(EntityPtr *)((int)((Vector *)((int)local_140 + 0x125c))->x + (int)local_13c * 4); local_12c = EVar12; if (*(int *)((int)EVar12 + 0x28) != 0x196) { if (*(int *)((int)EVar12 + 0x28) == 9) { *(byte *)((int)EVar12 + 0x173) = 1; } else { bVar3 = Entity::is_valid_boss_enemy((Entity *)EVar12,(int)pGVar14); if (bVar3 == 0) { pGVar14 = extraout_ECX; if (*(int *)((int)EVar12 + 0x28) == 0x126) { iVar9 = __RTDynamicCast(EVar12,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); pGVar14 = extraout_ECX_01; if (iVar9 != 0) { *(undefined4 *)(iVar9 + 0xb64) = 3; } } } else { pcVar2 = *(code **)(*(int *)EVar12 + 0x24); EntityRef::constructor((EntityRef *)local_1e4,(Entity *)npc); (*pcVar2)(local_1e4); pGVar14 = extraout_ECX_00; } } } local_13c = (EntityPtr)((int)local_13c + 1); } while ((uint)local_13c < (uint)*(EntityPtr *)((int)local_140 + 0x1264)); } PersistentGameData::AddBestiaryKill (&g_manager->_persistentGameData,*(int *)((int)npc + 0x28),*(int *)((int)npc + 0x2c)); pGVar14 = extraout_ECX_02; uVar18 = extraout_var; } animState = (AnimationState *)((int)npc + 0x78); if (*(void **)((int)npc + 0x7c) == (void *)0x0) { isStomp2 = (uint)uVar18 << 8; isStomp1 = 0; } else { isStomp1 = AnimationState::IsEventTriggered(animState,(byte *)"Stomp"); isStomp2 = CONCAT31((int3)((uint)extraout_EDX_00 >> 8),isStomp1); local_141 = isStomp1; if (*(void **)((int)npc + 0x7c) == (void *)0x0) { pGVar14 = extraout_ECX_03; } else { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Stomp1"); pGVar14 = (Game *)CONCAT31((int3)((uint)extraout_ECX_04 >> 8),local_141); isStomp1 = local_141; isStomp2 = CONCAT31(isStomp2._1_3_,local_141); if (bVar3 != 0) { isStomp1 = 1; isStomp2 = CONCAT31(isStomp2._1_3_,local_141); } } } if (*(void **)((int)npc + 0x7c) != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Stomp2"); isStomp2 = isStomp2 & 0xff; if (bVar3 != 0) { isStomp2 = 1; } pGVar14 = extraout_ECX_05; } local_164 = *(undefined1 **)((int)npc + 0xf1c); local_13c = (EntityPtr)0x0; local_138.y = 0.0; local_184.y = 0.0; local_138.x = 0.0; if (local_164 != (undefined1 *)0xffffffff) { fVar19 = InputManager::GetActionValue(0,(int)local_164,(Entity *)npc,(int)pGVar14); local_184.y = 0.0 - fVar19; if (*(int *)((int)npc + 0xf1c) == -1) { local_138.x = local_184.y + 0.0; iVar9 = unused; LAB_0059f5e9: local_13c = (EntityPtr)0x0; local_184.y = local_138.x; local_154.y = local_138.x; LAB_0059f5f6: fVar19 = 0.0; iVar16 = -1; } else { fVar19 = InputManager::GetActionValue(1,*(int *)((int)npc + 0xf1c),(Entity *)npc,unused); local_184.y = fVar19 + local_184.y; iVar9 = unused_00; local_138.x = local_184.y; if (*(int *)((int)npc + 0xf1c) == -1) goto LAB_0059f5e9; local_154.y = local_184.y; fVar19 = InputManager::GetActionValue(2,*(int *)((int)npc + 0xf1c),(Entity *)npc,unused_00); local_13c = (EntityPtr)(0.0 - fVar19); if (*(int *)((int)npc + 0xf1c) == -1) { iVar9 = unused_01; goto LAB_0059f5f6; } fVar19 = InputManager::GetActionValue(3,*(int *)((int)npc + 0xf1c),(Entity *)npc,unused_01); iVar16 = *(int *)((int)npc + 0xf1c); iVar9 = extraout_ECX_06; } local_13c = (EntityPtr)(fVar19 + (float)local_13c); fVar19 = (float)local_13c * (float)local_13c + local_154.y * local_154.y; local_138.y = (float)local_13c; if (1.0 < fVar19) { fVar19 = sqrtf(fVar19); iVar9 = extraout_ECX_07; if (0.0 < fVar19) { local_184.y = local_154.y * (1.0 / fVar19); local_13c = (EntityPtr)((float)local_13c * (1.0 / fVar19)); local_138.x = local_184.y; local_138.y = (float)local_13c; } } if (iVar16 != -1) { InputManager::GetActionValue(4,iVar16,(Entity *)npc,iVar9); if (*(int *)((int)npc + 0xf1c) != -1) { InputManager::GetActionValue(5,*(int *)((int)npc + 0xf1c),(Entity *)npc,unused_02); if (*(int *)((int)npc + 0xf1c) != -1) { InputManager::GetActionValue(6,*(int *)((int)npc + 0xf1c),(Entity *)npc,unused_03); if (*(int *)((int)npc + 0xf1c) != -1) { InputManager::GetActionValue(7,*(int *)((int)npc + 0xf1c),(Entity *)npc,unused_04); } } } } } iVar9 = *(int *)((int)npc + 0xb64); if (((iVar9 == 400) || (iVar9 == 100)) || (iVar9 == 0x1fe)) { *(float *)((int)npc + 0xc40) = local_17c.y + local_17c.y; } else { if (*(int *)((int)npc + 0x2c) != 1) { *(float *)((int)npc + 0xc40) = local_17c.y; } iVar9 = *(int *)((int)npc + 0xbc4); if ((0 < iVar9) && (bVar3 = Entity::IsFrame((Entity *)npc,0x1e,*(int *)((int)npc + 0x20)), bVar3 != 0)) { *(int *)((int)npc + 0xbc4) = iVar9 + -1; } } local_140 = *(EntityPtr *)((int)npc + 900); local_12c = *(EntityPtr *)((int)npc + 0x380); if ((float)local_140 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar19 = ((float)local_12c - 0.0) / ((float)local_140 - 0.0); if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } local_18c.y = (((float)*(int *)((int)npc + 0xbc4) + (15.0 - fVar19 * 15.0)) - 0.0) / 25.0; if (local_18c.y <= 0.0) { local_18c.y = 0.0; } if (1.0 <= local_18c.y) { local_18c.y = 1.0; } local_18c.y = local_18c.y + 0.0; if (*(int *)((int)npc + 0xb64) == 9000) { if (*(void **)((int)npc + 0x7c) == (void *)0x0) { iVar9 = -1; } else { local_12c = *(EntityPtr *)((int)npc + 0x88); dVar26 = floor((double)(float)local_12c); local_12c = (EntityPtr)(float)dVar26; iVar9 = (int)dVar26; } fVar19 = ((float)iVar9 - 0.0) / 10.0; if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } local_18c.y = local_18c.y + (0.0 - local_18c.y) * fVar19; } else if (*(int *)((int)npc + 0xb64) == 0x2329) { local_18c.y = 0.0; } local_30 = 0; uStack_2c = 0; local_28 = 0; local_40 = 0x3f800000; uStack_3c = 0x3e4ccccd; uStack_38 = 0x3e4ccccd; local_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f800000; if ((ColorMod *)((int)npc + 0x1b8) != (ColorMod *)&local_50) { ((ColorMod *)((int)npc + 0x1b8))->_tint[0] = 1.0; *(float *)((int)npc + 0x1bc) = 1.0; *(float *)((int)npc + 0x1c0) = 1.0; *(float *)((int)npc + 0x1c4) = 1.0; *(float *)((int)npc + 0x1c8) = 1.0; *(float *)((int)npc + 0x1cc) = 0.2; *(float *)((int)npc + 0x1d0) = 0.2; *(float *)((int)npc + 0x1d4) = local_18c.y; *(float *)((int)npc + 0x1d8) = 0.0; *(float *)((int)npc + 0x1dc) = 0.0; *(float *)((int)npc + 0x1e0) = 0.0; } fStack_34 = local_18c.y; (**(code **)(*(int *)npc + 0x3c))(&local_50,1,0,0,1); local_17c.y = *(float *)((int)npc + 0xb64); if (local_17c.y == 2.8026e-45) { local_12c = (EntityPtr)(((Vector *)((int)npc + 0x33c))->x + 0.0); local_140 = (EntityPtr)(*(float *)((int)npc + 0x340) - 100.0); iVar9 = *(int *)((int)g_game->_room + 0x11f8); if (*(char *)(iVar9 + 0x8c) == '\0') { local_130 = *(EntityPtr *)(iVar9 + 0x54); EVar12 = *(EntityPtr *)(iVar9 + 0x58); if (EVar12 == local_130) { if ((int)EVar12 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_130 = *(EntityPtr *)(iVar9 + 0x54); EVar12 = *(EntityPtr *)(iVar9 + 0x58); } iVar16 = (*(int *)(iVar9 + 0x5c) + 1) % (int)local_130; EVar12 = (EntityPtr)((int)&((Entity_NPC *)((int)EVar12 + -0xf54))->_pickupGhostsEntity + 3); *(int *)(iVar9 + 0x5c) = iVar16; *(EntityPtr *)(iVar9 + 0x58) = EVar12; } else { iVar16 = *(int *)(iVar9 + 0x5c); } iVar17 = ((int)EVar12 + iVar16) % (int)local_130; iVar16 = *(int *)(iVar9 + 0x50); *(EntityPtr *)(iVar16 + iVar17 * 8) = local_12c; *(EntityPtr *)(iVar16 + 4 + iVar17 * 8) = local_140; *(int *)(iVar9 + 0x58) = *(int *)(iVar9 + 0x58) + 1; *(undefined1 *)(iVar9 + 0x8c) = 1; } *(float *)((int)npc + 0x36c) = 0.01; *(int *)((int)npc + 0x188) = 0; if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered((AnimationState *)((int)npc + 0x78),&DAT_00b62624), bVar3 != 0)) { Game::ShakeScreen(g_game,0xf); manager = g_manager; local_130 = (EntityPtr)0x3f800000; if (*(int *)((int)npc + 0xc64) == 0x12) { local_130 = (EntityPtr)0x3fc00000; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_130 = (EntityPtr)0x3f000000; } local_148 = 6.05361e-43; seed_fart_sound_override((int *)&local_148); SoundEffects::Play(&manager->_sfxManager,(int)local_148,1.0,2,0,(float)local_130,0.0); } if ((isStomp1 != 0) || ((byte)isStomp2 != '\0')) { Game::ShakeScreen(g_game,0xf); uVar5 = Random(); manager = g_manager; local_130 = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); if (*(int *)((int)npc + 0xc64) == 0x12) { local_130 = (EntityPtr)((float)local_130 + 0.5); } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_130 = (EntityPtr)((float)local_130 * 0.5); } local_148 = 6.72623e-44; seed_fart_sound_override((int *)&local_148); SoundEffects::Play(&manager->_sfxManager,(int)local_148,1.0,2,0,(float)local_130,0.0); } if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (*(byte *)((int)npc + 0x8c) != 0)) { pbVar10 = *(void **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar13 = "Hanging"; do { bVar3 = *pbVar10; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_0059fbc1: uVar5 = -(uint)bVar22 | 1; goto LAB_0059fbc6; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_0059fbc1; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0059fbc6: if ((uVar5 == 0) && (0x3c < *(int *)((int)npc + 0x410))) { pbVar10 = *(void **)((int)npc + 0x7c); if (pbVar10 != (byte *)0x0) { pbVar8 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar8 = *(byte **)pbVar10; } pcVar13 = "Appearing"; do { bVar3 = *pbVar8; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_0059fc10: uVar5 = -(uint)bVar22 | 1; goto LAB_0059fc15; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_0059fc10; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0059fc15: if ((uVar5 == 0) && ((pbVar10[0x34] == 0 || (*(byte *)((int)npc + 0x8c) != 0)))) goto LAB_0059fc4c; } bVar3 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),(byte *)"Appearing",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(byte *)((int)npc + 0x8c) = 1; } } } LAB_0059fc4c: *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (*(byte *)((int)npc + 0x8c) == 0)) { pbVar10 = *(void **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar13 = "Appearing"; do { bVar3 = *pbVar10; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_0059fca0: uVar5 = -(uint)bVar22 | 1; goto LAB_0059fca5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_0059fca0; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0059fca5: if (uVar5 == 0) { *(int *)((int)npc + 0x188) = 4; *(int *)((int)npc + 0xb64) = 4; *(int *)((int)npc + 0x410) = 0; } } goto LAB_005a3586; } if (((local_17c.y != 5.60519e-45) && (local_17c.y != 4.2039e-45)) && (local_17c.y != 4.34403e-43)) { if (local_17c.y == 4.2039e-43) { SoundEffects::PlayWithFartOverride(0x1b0,1.0,0x1e,0,1.0); ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Tantrum",0); iVar9 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar9 == 0xc) { *(int *)((int)npc + 0xb64) = 0x136; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xba4) = 0; *(int *)((int)npc + 0xbc0) = 0; } LAB_005a09ef: *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.4; } else { if ((local_17c.y == 9.80909e-43) || (local_17c.y == 9.94922e-43)) { if (*(int *)((int)npc + 0xbc0) == 0) { SoundEffects::PlayWithFartOverride(0x1b1,1.0,0x2d,0,1.0); } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Smash",0); bVar3 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),"Smash"); if (bVar3 != 0) { local_138.y = *(float *)((int)npc + 0x340) + 60.0; local_138.x = ((Vector *)((int)npc + 0x33c))->x + 0.0; position.y = local_138.y; position.x = local_138.x; NpcHelper::UltraGreed_Smash(npc,position); } if ((*(void **)((int)npc + 0x7c) == (void *)0x0) || (*(byte *)((int)npc + 0x8c) == 0)) { if (*(int *)((int)npc + 0xb64) == 700) { LAB_005a1af9: *(int *)((int)npc + 0xb64) = 3; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; } else if (*(int *)((int)npc + 0xb64) == 0x2c6) { if (1 < *(int *)((int)npc + 0xbc0)) goto LAB_005a1af9; ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Smash",1); *(bool *)((int)npc + 0x148) = *(byte *)((int)npc + 0x148) == 0; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = *(int *)((int)npc + 0xbc0) + 1; } } goto LAB_005a09ef; } if (local_17c.y == 5.60519e-43) { iVar9 = *(int *)((int)npc + 0xbc0); if (iVar9 == 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"GuardStart",0); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xbc0) = 1; } } else if (iVar9 == 1) { *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) | 0x2000000; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)"GuardFlashSlow"); if ((bVar3 != 0) || (bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)"GuardStart"), bVar3 != 0)) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Guarding",0); } if (0.0 < *(float *)((int)npc + 0x14)) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"GuardFlashSlow",1); } if (local_164 == (undefined1 *)0xffffffff) { if ((int)local_14c < 5) goto LAB_0059fe46; } else { bVar3 = Entity_NPC::IsControllerActionPressed(npc,0xb); if (bVar3 == 0) { LAB_0059fe46: *(int *)((int)npc + 0xbc0) = 2; *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) & 0xfdffffff; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); } } } else if (iVar9 == 2) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"GuardEnd",0); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xb64) = 4; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; } } *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.4; goto LAB_005a3586; } if ((local_17c.y == 7.00649e-43) || (local_17c.y == 7.14662e-43)) { local_130 = (EntityPtr)((uint)local_130 & 0xffffff00); *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; if (local_17c.y == 7.14662e-43) { iVar9 = *(int *)((int)npc + 0xbc0); if (iVar9 == 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SpinStart",0); SoundEffects::PlayWithFartOverride(0x1b1,1.0,0x1e,0,1.0); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xbc0) = 1; } } else if (iVar9 == 1) { if ((*(int *)((int)npc + 0x410) == 0) || (bVar3 = Entity::IsFrame((Entity *)npc,0x1e,*(int *)((int)npc + 0x20)), bVar3 != 0)) { vecResult = Room::GetRandomPosition(g_game->_room,&scratchVec,0.0); ((Vector *)((int)npc + 0x334))->x = vecResult->x; *(float *)((int)npc + 0x338) = vecResult->y; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SpinConstant",0); local_130._0_1_ = 1; fVar19 = (float)*(int *)((int)npc + 0x410) / 240.0; if ((*(byte *)((int)npc + 0x20) & 1) == 0) { fVar19 = fVar19 * -1.0; } local_12c = (EntityPtr)(fVar19 * 6.2831855); fVar19 = cos((float)local_12c); local_140 = (EntityPtr)(fVar19 * 0.7); fVar19 = sin((float)local_12c); local_138.y = fVar19 * 0.7; local_138.x = (float)local_140; Entity::AddVelocity_divided((Entity *)npc,&local_138,0); local_138.x = ((Vector *)((int)npc + 0x334))->x - ((Vector *)((int)npc + 0x33c))->x; local_138.y = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); Vector::Resize(&local_138,1.0); if (local_164 != (undefined1 *)0xffffffff) { local_138.x = local_184.y; local_138.y = (float)local_13c; } Entity::AddVelocity_divided((Entity *)npc,&local_138,0); if (*(byte *)((int)npc + 400) != 0) { local_12c = (EntityPtr)(-((Vector *)((int)npc + 0x19c))->x * 20.0); local_140 = (EntityPtr)(-*(float *)((int)npc + 0x1a0) * 20.0); uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_138.x = (float)local_12c * fVar19; local_138.y = (float)local_140 * fVar19; Entity::AddVelocity_divided((Entity *)npc,&local_138,0); } uVar5 = *(int *)((int)npc + 0x410); uVar6 = uVar5 & 0x80000007; bVar22 = uVar6 == 0; if ((int)uVar6 < 0) { bVar22 = (uVar6 - 1 | 0xfffffff8) == 0xffffffff; } if (bVar22) { ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Variant = 7; projectileParams.HeightModifier = -80.0; projectileParams.Scale = 1.6; projectileParams.FallingAccelModifier = 0.06; projectileParams.FallingSpeedModifier = 10.0; local_12c = (EntityPtr) ((float)*(int *)((int)npc + 0x410) * 12.0 * 0.707 * 0.017453292); local_140 = (EntityPtr)sin((float)local_12c); fVar19 = cos((float)local_12c); local_1b4.x = fVar19 * 10.0 + ((Vector *)((int)npc + 0x360))->x; local_1b4.y = (float)local_140 * 10.0 + *(float *)((int)npc + 0x364); Entity_NPC::FireProjectiles (npc,(Vector *)((int)npc + 0x33c),&local_1b4,0,&projectileParams); uVar5 = *(int *)((int)npc + 0x410); } if (local_164 == (undefined1 *)0xffffffff) { if ((int)(120.0 - local_18c.y * 60.0) < (int)uVar5) goto LAB_005a15ba; } else { bVar3 = Entity_NPC::IsControllerActionPressed(npc,4); if (bVar3 != 0) { *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; goto LAB_005a1634; } LAB_005a15ba: *(int *)((int)npc + 0xbc0) = 2; uVar5 = 0; } *(uint *)((int)npc + 0x410) = uVar5 + 1; } else if (iVar9 == 2) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SpinEnd",0); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xb64) = 4; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; ((Vector *)((int)npc + 0x334))->x = g_vectorZero.x; *(float *)((int)npc + 0x338) = g_vectorZero.y; } } } LAB_005a1634: if (*(int *)((int)npc + 0xb64) == 500) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SpinOnce",0); SoundEffects::PlayWithFartOverride(0x1b1,1.0,0x1e,0,1.0); iVar9 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); local_130 = (EntityPtr)((uint)local_130 & 0xff); if (3 < iVar9) { local_130 = (EntityPtr)0x1; } bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xb64) = 4; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; } } if (local_130._0_1_ != '\0') { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_1e4 + 0x18) ,(Vector *)((int)npc + 0x33c), *(float *)((int)npc + 0x370) * ((Vector *)((int)npc + 0x374))->x * 3.0, 0xffffffff); local_14._0_1_ = 6; local_164 = (undefined1 *)0x0; if (puStack_1c0 != (undefined1 *)0x0) { do { piVar7 = *(int **)((int)(float)uStack_1c8 + (int)local_164 * 4); if (((piVar7 != (int *)0x0) && (piVar7[0x62] != 0)) && ((((iVar9 = piVar7[10], iVar9 == 1 || (iVar9 == 3)) && ((*(uint *)((int)npc + 0x168) & 0x20000000) == 0)) || ((((1 < *(int *)&g_game->_deathmatchManager && (iVar9 == 1)) || (iVar9 - 10U < 0x3de)) && ((*(uint *)((int)npc + 0x168) & 0x100) != 0)))))) { local_13c = *(EntityPtr *)(piVar7 + 0xcf); local_14c = (float)piVar7[0xd0]; fVar21 = ((Vector *)((int)npc + 0x33c))->x - (float)local_13c; fVar19 = *(float *)((int)npc + 0x340) - local_14c; fVar19 = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); if (fVar19 < *(float *)((int)npc + 0x370) * ((Vector *)((int)npc + 0x374))->x * 2.4) { local_13c = (EntityPtr)((float)local_13c - ((Vector *)((int)npc + 0x33c))->x); local_14c = local_14c - *(float *)((int)npc + 0x340); fVar19 = -70.0; if (*(byte *)((int)npc + 0x148) != 0) { fVar19 = 70.0; } local_12c = (EntityPtr)(fVar19 * 0.017453292); local_130 = (EntityPtr)cos((float)local_12c); fVar19 = sin((float)local_12c); local_148 = (float)local_130 * (float)local_13c - fVar19 * local_14c; local_130 = (EntityPtr)((float)local_130 * local_14c + fVar19 * (float)local_13c); fVar21 = sqrtf(local_148 * local_148 + (float)local_130 * (float)local_130); EVar12 = local_130; fVar19 = local_148; if (0.0 < fVar21) { fVar19 = local_148 * (5.0 / fVar21); EVar12 = (EntityPtr)((float)local_130 * (5.0 / fVar21)); } fVar21 = (float)piVar7[0xdb]; if (fVar21 != 0.0) { piVar7[0xd9] = (int)(((float)piVar7[0xe7] * (float)EVar12) / fVar21 + (float)piVar7[0xd9]); piVar7[0xd8] = (int)(((float)piVar7[0xe7] * fVar19) / fVar21 + (float)piVar7[0xd8]); } local_12c = *(EntityPtr *)(*piVar7 + 0x20); EntityRef::constructor(&npcRef,(Entity *)npc); if (((*(int *)&g_game->_deathmatchManager < 2) || (piVar7[10] != 1)) && (0x3dd < piVar7[10] - 10U)) { uVar27 = 0x40000000; } else { uVar27 = 0x41f00000; } (*(code *)local_12c)(uVar27,0x40,0,&npcRef,0x1e); } } local_164 = local_164 + 1; } while (local_164 < puStack_1c0); } SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x1b8,1.0,1.0); local_14 = CONCAT31(local_14._1_3_,4); EntityList_Query::~EntityList_Query(local_1e4 + 0x18); } goto LAB_005a3586; } if (local_17c.y != 8.40779e-43) { if (local_17c.y != 1.4013e-43) { if (local_17c.y == 2.8026e-43) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Tantrum",0); iVar9 = *(int *)((int)npc + 0x410); if (iVar9 == 0) { SoundEffects::PlayWithFartOverride(0x1b0,1.0,2,0,1.0); iVar9 = *(int *)((int)npc + 0x410); } local_18c.y = local_18c.y + 1.0; *(int *)((int)npc + 0x410) = iVar9 + 1; *(float *)((int)npc + 0x14c) = local_18c.y; if ((isStomp1 != 0) || ((byte)isStomp2 != '\0')) { Game::ShakeScreen(g_game,10); uVar5 = Random(); Entity_NPC::PlaySound (npc,0x30,1.0,2,0, (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); if (*(int *)((int)npc + 0x2c) == 0) { if ((uint)keepers._size < 4) { local_138.x = ((Vector *)((int)npc + 0x33c))->x + 0.0; local_138.y = *(float *)((int)npc + 0x370) * 1.3 + *(float *)((int)npc + 0x340); uVar5 = Random(); Game::Spawn(g_game,0x56,0,&local_138,&g_vectorZero,(Entity *)npc,0,uVar5); } } else if (*(int *)((int)npc + 0x2c) == 1) { local_148 = 2.8026e-45; do { room = g_game->_room; vecResult = Room::GetRandomPosition(room,&local_1ac,0.0); Room::FindFreePickupSpawnPosition(room,&scratchVec,vecResult,0.0,0,0,0); uVar5 = Random(); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c = (EntityPtr)(fVar19 + fVar19); local_140 = (EntityPtr)sin((float)local_12c); local_138.x = cos((float)local_12c); uVar30 = 0; pTVar29 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; local_138.y = (float)local_140; tmpEntity = Game::Spawn(g_game,0x125,2,&scratchVec,&local_138,(Entity *)npc,0, uVar5); piVar7 = (int *)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); piVar7[0xc] = 1; (**(code **)(*piVar7 + 0xc))(); local_148 = (float)((int)local_148 - 1); } while (local_148 != 0.0); } ShockwaveParams::ShockwaveParams(local_1e4 + 0xc); local_1e4._12_4_ = ((Vector *)((int)npc + 0x33c))->x; local_1e4._16_4_ = *(float *)((int)npc + 0x340); puStack_1c0 = (undefined1 *)0x19; uStack_1c8._0_4_ = 0.025; local_1e4._24_4_ = 0.025; iVar9 = FUN_0081e220(); Game::SetShockwaveParams(animState,iVar9,local_1e4 + 0xc); } if (local_164 == (undefined1 *)0xffffffff) { if ((int)(75.0 / local_18c.y) < *(int *)((int)npc + 0x410)) { if (*(void **)((int)npc + 0x7c) == (void *)0x0) { puVar23 = &DAT_bf800000; } else { puVar23 = *(undefined1 **)((int)npc + 0x88); } if ((float)puVar23 < local_18c.y) goto LAB_005a09d1; } } else { bVar3 = Entity_NPC::IsControllerActionPressed(npc,10); if (bVar3 == 0) { LAB_005a09d1: *(int *)((int)npc + 0xb64) = 4; *(int *)((int)npc + 0x410) = 0; *(float *)((int)npc + 0x14c) = 1.0; } } goto LAB_005a09ef; } if (local_17c.y == 8.40779e-45) { iVar9 = *(int *)((int)npc + 0xbc0); if (iVar9 == 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),&DAT_00b1e0e4,0); if (*(int *)((int)npc + 0x410) == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar19 = (tmpEntity->_pos).y; ((Vector *)((int)npc + 0x334))->x = (tmpEntity->_pos).x; *(float *)((int)npc + 0x338) = fVar19; } bVar3 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),s_Jump); if (bVar3 != 0) { *(int *)((int)npc + 0x188) = 0; *(int *)((int)npc + 0x184) = 0; SoundEffects::PlayWithFartOverride(0xe,1.0,2,0,1.0); Entity_NPC::CreateGoldParticles(npc,0xf); Game::ShakeScreen(g_game,8); } bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&DAT_00b1e0e4); if (bVar3 == 0) { iVar9 = *(int *)((int)npc + 0xbc0); } else { *(int *)((int)npc + 0xbc0) = 1; iVar9 = 1; } *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; } if (iVar9 == 1) { local_138.x = ((Vector *)((int)npc + 0x334))->x - ((Vector *)((int)npc + 0x33c))->x; local_138.y = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); Vector::Normalize(&local_138); local_138.x = local_138.x * 2.0; local_138.y = local_138.y * 2.0; Entity::AddVelocity((Entity *)npc,&local_138,0); bVar3 = Entity::IsFrame(this_00,5,0); if (bVar3 != 0) { fVar19 = ((float)*(int *)((int)npc + 0x410) - 0.0) / 60.0; if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } local_12c = (EntityPtr)(fVar19 + fVar19 + 3.0); ProjectileParams::ProjectileParams(&projectileParams); projectileParams.HeightModifier = -800.0; uVar5 = Random(); projectileParams.FallingAccelModifier = 2.0; projectileParams.Scale = 1.6; projectileParams.Variant = 7; projectileParams.BulletFlags._0_4_ = 2; projectileParams.BulletFlags._4_4_ = 0; projectileParams.FallingSpeedModifier = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 30.0; vecResult = MusicManager::RandomVector(&scratchVec); uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_138.y = (float)local_12c * fVar19 * vecResult->y; local_138.x = (float)local_12c * fVar19 * vecResult->x; Entity_NPC::FireProjectiles (npc,(Vector *)((int)npc + 0x33c),&local_138,0,&projectileParams); } bVar3 = Entity::IsFrame((Entity *)npc,1,0); if (bVar3 != 0) { Color::Color(&tmpColor); Game::SpawnParticles(g_game,(Vector *)((int)npc + 0x33c),0x5f,2,3.0,color,-800.0,0); } fVar19 = *(float *)((int)npc + 0x340) - *(float *)((int)npc + 0x338); fVar21 = ((Vector *)((int)npc + 0x33c))->x - ((Vector *)((int)npc + 0x334))->x; fVar19 = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); if (*(float *)((int)npc + 0x370) <= fVar19) { iVar9 = *(int *)((int)npc + 0xbc0); } else { *(int *)((int)npc + 0xbc0) = 2; iVar9 = 2; } *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; } if (iVar9 == 2) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"JumpDown",0); bVar3 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),"Stomp"); if (bVar3 != 0) { *(int *)((int)npc + 0x188) = 4; *(int *)((int)npc + 0x184) = 5; Entity_NPC::CreateGoldParticles(npc,0x1e); SoundEffects::PlayWithFartOverride(0x8a,1.0,2,0,1.0); uVar5 = Random(); SoundEffects::PlayWithFartOverride (0x30,1.0,2,0, (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); ShockwaveParams::ShockwaveParams(local_1e4 + 0xc); local_1e4._12_4_ = ((Vector *)((int)npc + 0x33c))->x; local_1e4._16_4_ = *(float *)((int)npc + 0x340); puStack_1c0 = (undefined1 *)0x19; uStack_1c8._0_4_ = 0.025; local_1e4._24_4_ = 0.025; iVar9 = FUN_0081e220(); Game::SetShockwaveParams(this_01,iVar9,local_1e4 + 0xc); Game::ShakeScreen(g_game,0x12); local_148 = 0.0; do { uVar5 = Random(); uVar30 = 0; pTVar29 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; tmpEntity = Game::Spawn(g_game,1000,0x48,(Vector *)((int)npc + 0x33c), &g_vectorZero,(Entity *)npc,0,uVar5); local_140 = (EntityPtr)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); EVar12 = (EntityPtr)((int)local_140 + 0x3bc); if (*(EntityPtr *)((int)local_140 + 0x3bc) != (EntityPtr)0x0) { local_12c = EVar12; std::multiset::erase(&local_12c); } *(Entity_NPC **)EVar12 = npc; std::multiset::insert(EVar12); fVar19 = (float)((int)local_148 + 1); *(float *)((int)local_140 + 0x474) = ((float)(int)local_148 * 360.0) / 5.0; local_148 = fVar19; } while ((int)fVar19 < 5); } *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),(byte *)"JumpDown"); if (bVar3 != 0) { *(int *)((int)npc + 0xbc0) = 0; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xb64) = 3; } } *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.8; } else if (local_17c.y == 1.26117e-41) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Death",0); *(float *)((int)npc + 0x14c) = 1.0; Entity_NPC::CreateBling(npc); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xb64) = 0x2329; } bVar3 = Sprite::IsEventTriggered((Sprite *)((int)npc + 0x48),"Disappear"); if (bVar3 != 0) { SoundEffects::PlayWithFartOverride(0x1af,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x1ab,1.0,2,0,1.0); *(int *)((int)npc + 0x188) = 0; *(float *)((int)npc + 0x15c) = 0.0; local_130 = (EntityPtr)0x0; do { Color::Color(&tmpColor); uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c = (EntityPtr)(fVar19 + fVar19); local_1b4.y = sin((float)local_12c); uVar5 = Random(); local_140 = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10); fVar19 = cos((float)local_12c); fVar19 = *(float *)((int)npc + 0x370) * fVar19 * (float)local_140; fVar21 = *(float *)((int)npc + 0x370) * (float)local_140 * local_1b4.y; local_138.x = fVar19 + fVar19 + ((Vector *)((int)npc + 0x33c))->x; local_138.y = fVar21 + fVar21 + *(float *)((int)npc + 0x340); Game::SpawnParticles (g_game,&local_138,0x5f,4,10.0,color_00,(float)(int)local_130 * -2.0,0); local_130 = (EntityPtr)((int)local_130 + 1); } while ((int)local_130 < 100); uVar5 = Random(); local_138.x = 0.0; local_138.y = -3.0; Game::Spawn(g_game,5,0x14,(Vector *)((int)npc + 0x33c),&local_138,(Entity *)npc,1, uVar5); Room::TurnGold(); } } else if (local_17c.y == 1.26131e-41) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Final",0); *(byte *)((int)npc + 0xc3c) = 0; Entity_NPC::CreateBling(npc); } goto LAB_005a3586; } iVar9 = *(int *)((int)npc + 0xbc0); iVar16 = 100; if (iVar9 == 0) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SlotStart",0); SoundEffects::PlayWithFartOverride(0x1b3,1.0,0x3c,0,1.0); bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xbc0) = 1; *(int *)((int)npc + 0x410) = 0; } } else if (iVar9 == 1) { ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"SlotSpinningFast",0); SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x1b4,1.0,1.0); *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; if ((int)(51.0 - local_18c.y * 21.0) < *(int *)((int)npc + 0x410)) { SFXManager::Stop(&g_manager->_sfxManager,0x1b4); SoundEffects::PlayWithFartOverride(0x1b5,1.0,0x5a,0,1.0); *(int *)((int)npc + 0xbc0) = 2; uVar5 = Random(); ANM2::SetFrame((ANM2 *)((int)npc + 0x48),(std_string *)"SlotSpinningOutcomes",uVar5 & 3) ; *(int *)((int)npc + 0x410) = 0; } } else if (iVar9 == 2) { EVar12 = (EntityPtr)0x1; local_130 = (EntityPtr)0x1; iVar9 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar9 == 0) { fVar19 = *(float *)((int)npc + 900) * 0.2; local_14c = (float)ultraDoors._size; local_184.y = 1.4013e-45; local_17c.y = 1.12104e-44; if (*(float *)((int)npc + 0x380) <= fVar19 && fVar19 != *(float *)((int)npc + 0x380)) { EVar12 = (EntityPtr)0x2; } local_130 = EVar12; LAB_005a0396: local_13c = (EntityPtr)(int)(60.0 - local_18c.y * 40.0); if (0x3b < *(int *)((int)npc + 0x410)) goto LAB_005a044d; SFXManager::SetAmbientSound(&g_manager->_sfxManager,0x1b7,1.0,1.0); } else { iVar9 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar9 == 1) { local_184.y = 2.8026e-45; local_14c = 1.68156e-44; local_17c.y = 2.8026e-45; goto LAB_005a0396; } iVar9 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar9 == 2) { local_184.y = 4.2039e-45; local_14c = 9.80909e-45; local_17c.y = 9.80909e-45; goto LAB_005a0396; } iVar9 = ANM2::GetFrame((ANM2 *)((int)npc + 0x48)); if (iVar9 == 3) { local_184.y = 0.0; local_14c = 9.80909e-45; local_17c.y = 9.80909e-45; } else { local_17c.y = 4.2039e-44; local_14c = 1.4013e-45; local_184.y = -NAN; } local_13c = (EntityPtr)0x0; local_130 = (EntityPtr)0x1; LAB_005a044d: SFXManager::Stop(&g_manager->_sfxManager,0x1b7); SoundEffects::PlayWithFartOverride(0x1b6,1.0,0x5a,0,1.0); } iVar9 = *(int *)((int)npc + 0x410); if (iVar9 == 0) { SoundEffects::PlayWithFartOverride(0x1ac,1.0,0x5a,0,1.0); iVar9 = *(int *)((int)npc + 0x410); } EVar12 = (EntityPtr)(iVar9 + 1); *(EntityPtr *)((int)npc + 0x410) = EVar12; if ((((EntityPtr)local_184.y != (EntityPtr)0xffffffff) && (local_12c = EVar12, (int)EVar12 % (int)local_17c.y == 0)) && ((int)EVar12 <= (int)local_14c * (int)local_17c.y)) { do { room = g_game->_room; vecResult = Room::GetRandomPosition(room,&local_1ac,0.0); Room::FindFreePickupSpawnPosition(room,&scratchVec,vecResult,0.0,0,0,0); uVar5 = Random(); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c = (EntityPtr)(fVar19 + fVar19); local_140 = (EntityPtr)sin((float)local_12c); local_138.x = cos((float)local_12c); uVar30 = 0; pTVar29 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; local_138.y = (float)local_140; tmpEntity = Game::Spawn(g_game,0x125,(uint)local_184.y,&scratchVec,&local_138, (Entity *)npc,0,uVar5); piVar7 = (int *)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); if (piVar7 != (int *)0x0) { if ((((EntityPtr)local_184.y == (EntityPtr)0x1) && (iVar9 = *(int *)((int)npc + 0x410) / (int)local_17c.y + -1, iVar9 < ultraDoors._size)) && (iVar9 = __RTDynamicCast(*(undefined4 *)((int)ultraDoors._data + iVar9 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0 ), iVar9 != 0)) { piVar7[0x2f0] = *(int *)(iVar9 + 0xbc0); } (**(code **)(*piVar7 + 0xc))(); } local_130 = (EntityPtr) ((int)&((Entity_NPC *)((int)local_130 + -0xf54))->_pickupGhostsEntity + 3) ; } while (local_130 != (EntityPtr)0x0); EVar12 = *(EntityPtr *)((int)npc + 0x410); local_130 = (EntityPtr)0x0; } iVar16 = 100; if (((int)local_14c * (int)local_17c.y < (int)EVar12) && ((int)local_13c < (int)EVar12)) { iVar16 = 4; } } if (iVar16 != *(int *)((int)npc + 0xb64)) { *(int *)((int)npc + 0xb64) = iVar16; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; } goto LAB_005a09ef; } local_138.y = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); local_138.x = ((Vector *)((int)npc + 0x334))->x - ((Vector *)((int)npc + 0x33c))->x; iVar9 = vector_to_direction(&local_138); switch(iVar9) { case 0: pcVar13 = "ShootLeft"; break; case 1: pcVar13 = "ShootUp"; break; case 2: pcVar13 = "ShootRight"; break; case 3: pcVar13 = "ShootDown"; break; default: goto switchD_0059ff31_default; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)pcVar13,0); switchD_0059ff31_default: uVar5 = *(int *)((int)npc + 0xbc0); if (uVar5 == 0) { uVar5 = Random(); uVar5 = uVar5 | 1; *(uint *)((int)npc + 0xbc0) = uVar5; } RNG::game_constructor((RNG *)(local_1e4 + 0x18),uVar5,0x23); outcomePicker = (WeightedOutcomePicker)0x0; local_15c.x = 0.0; local_15c.y = 0.0; local_14 = CONCAT31(local_14._1_3_,7); WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,3,100,0); WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,4,100,0); WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,5,100,0); WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,0x32,100,0); rng._shift1 = (int)(float)uStack_1c8; rng._seed = local_1e4._24_4_; rng._shift2 = uStack_1c8._4_4_; rng._shift3 = (int)puStack_1c0; local_148 = (float)WeightedOutcomePicker::PickOutcome(&outcomePicker,rng); bVar3 = ANM2::WasEventTriggered((ANM2 *)((int)npc + 0x48),(byte *)"Shoot"); if (bVar3 != 0) { if (*(int *)((int)npc + 0x410) == 0) { SoundEffects::PlayWithFartOverride(0x1b2,1.0,2,0,1.0); } ProjectileParams::ProjectileParams(&projectileParams); projectileParams.Variant = 7; projectileParams.HeightModifier = -80.0; projectileParams.Scale = 1.6; if (*(int *)((int)npc + 0x2c) == 1) { projectileParams.Spread = projectileParams.Spread * 1.6; projectileParams.BulletFlags._0_4_ = (uint)projectileParams.BulletFlags | 2; } if (*(int *)((int)npc + 0x410) == 0) { if (local_148 == 7.00649e-44) { Entity_NPC::FireBossProjectiles (npc,6,(Vector *)((int)npc + 0x334),0.0,&projectileParams); } else { projectileParams.FallingAccelModifier = 0.06; projectileParams.FallingSpeedModifier = 10.0; Vector::Resized(&local_138,&local_1ac,11.0); Entity_NPC::FireProjectiles (npc,(Vector *)((int)npc + 0x33c),&local_1ac,(uint)local_148,&projectileParams ); } } *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; } bVar3 = ANM2::IsFinishedImpl((ANM2 *)((int)npc + 0x48),&s_empty); if (bVar3 != 0) { *(int *)((int)npc + 0xb64) = 3; *(int *)((int)npc + 0xbc0) = 0; *(int *)((int)npc + 0x410) = 0; } local_14 = CONCAT31(local_14._1_3_,4); *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.4; if (outcomePicker != (WeightedOutcomePicker)0x0) { deallocate((void *)outcomePicker,(int)local_15c.y - (int)outcomePicker >> 3); } } goto LAB_005a3586; } if ((isStomp1 != 0) || ((byte)isStomp2 != '\0')) { Game::ShakeScreen(g_game,5); uVar5 = Random(); manager = g_manager; local_154.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; if (*(int *)((int)npc + 0xc64) == 0x12) { local_154.y = local_154.y + 0.5; } else if (*(int *)((int)npc + 0xc64) == 0x13) { local_154.y = local_154.y * 0.5; } local_170.y = 6.72623e-44; seed_fart_sound_override((int *)&local_170.y); SoundEffects::Play(&manager->_sfxManager,(int)local_170.y,1.0,2,0,local_154.y,0.0); } local_154.y = (float)((uint)local_154.y & 0xffffff00); if (*(void **)((int)npc + 0x7c) != (void *)0x0) { local_12c = *(EntityPtr *)((int)npc + 0x88); dVar26 = floor((double)(float)local_12c); local_12c = (EntityPtr)(float)dVar26; iVar9 = (int)dVar26; if ((iVar9 < 0) || (4 < iVar9)) { local_154.y = 0.0; if (0xd < iVar9) { local_154.y = (float)(uint)(iVar9 < 0x13); } } else { local_154.y = 1.4013e-45; } if (0x1b < iVar9) { local_154.y = 1.4013e-45; } } local_1a4.y = sqrtf((float)local_13c * (float)local_13c + local_184.y * local_184.y); fVar19 = local_1a4.y * 10.0; if (local_164 == (undefined1 *)0xffffffff) { fVar19 = 10.0; } iVar9 = *(int *)((int)npc + 0xb64); if (iVar9 == 0x136) { fVar19 = 10.0; } local_12c = (EntityPtr)0x3f800000; if (*(int *)((int)npc + 0x2c) == 1) { local_12c = (EntityPtr)0x3f19999a; } local_140 = (EntityPtr)((float)local_12c * 4.0); if (local_154.y._0_1_ == '\0') { local_140 = (EntityPtr)((float)local_140 * 0.7); fVar19 = fVar19 * 0.6; fVar21 = *(float *)((int)npc + 0x36c) * 0.6; } else { fVar21 = *(float *)((int)npc + 0x36c) * 0.8; } *(float *)((int)npc + 0x36c) = fVar21; local_168 = local_18c.y * 0.70000005 + 1.0; local_174 = local_168; if (iVar9 == 0x136) { local_174 = 3.0; } local_174 = local_174 * fVar19; local_19c.y = (float)((int)npc + 0x33c); local_1b4.y = 1e+08; local_141 = 0; local_1ac.x = ((Vector *)local_19c.y)->x; local_1ac.y = *(float *)((int)npc + 0x340); if (iVar9 == 4) { local_154.y = 0.0; do { pvVar15 = coinPickups._data; if ((uint)coinPickups._size <= (uint)local_154.y) break; iVar9 = *(int *)((int)coinPickups._data + (int)local_154.y * 4); fVar21 = *(float *)((int)npc + 0x340) - *(float *)(iVar9 + 0x340); fVar19 = ((Vector *)((int)npc + 0x33c))->x - *(float *)(iVar9 + 0x33c); local_170.y = fVar21 * fVar21 + fVar19 * fVar19; iVar9 = __RTDynamicCast(iVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); if (iVar9 == 0) { fVar19 = local_170.y; } else { if ((*(int *)(iVar9 + 0x2c) == 0x14) && (*(int *)(iVar9 + 0x30) - 1U < 7)) { iVar16 = *(int *)(&DAT_00b67e34 + *(int *)(iVar9 + 0x30) * 4); } else { iVar16 = 0; } fVar19 = local_170.y / (float)iVar16; } if (((fVar19 < local_1b4.y) && (*(int *)(iVar9 + 0x188) != 0)) && (*(char *)(iVar9 + 0x173) == '\0')) { local_141 = 1; iVar9 = *(int *)((int)pvVar15 + (int)local_154.y * 4); local_1ac.x = *(float *)(iVar9 + 0x33c); local_1ac.y = *(float *)(iVar9 + 0x340); ((Vector *)((int)npc + 0x334))->x = g_vectorZero.x; *(float *)((int)npc + 0x338) = g_vectorZero.y; local_1b4.y = fVar19; } iVar9 = *(int *)((int)npc + 0xb64); local_154.y = (float)((int)local_154.y + 1); } while (iVar9 == 4); if (local_141 == 0) { if ((((Vector *)((int)npc + 0x334))->x == g_vectorZero.x) && (*(float *)((int)npc + 0x338) == g_vectorZero.y)) { vecResult = Room::GetRandomPosition (g_game->_room,&scratchVec, *(float *)((int)npc + 0x370) * ((Vector *)((int)npc + 0x374))->x); iVar9 = 0; ((Vector *)((int)npc + 0x334))->x = vecResult->x; *(float *)((int)npc + 0x338) = vecResult->y; do { Room::GetRandomPosition (g_game->_room,&local_154, *(float *)((int)npc + 0x370) * ((Vector *)((int)npc + 0x374))->x); fVar19 = local_154.y - *(float *)((int)npc + 0x340); fVar21 = local_154.x - ((Vector *)((int)npc + 0x33c))->x; local_1b4.y = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); fVar21 = ((Vector *)((int)npc + 0x334))->x - ((Vector *)((int)npc + 0x33c))->x; fVar19 = *(float *)((int)npc + 0x338) - *(float *)((int)npc + 0x340); fVar19 = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); if (fVar19 < local_1b4.y) { ((Vector *)((int)npc + 0x334))->x = local_154.x; *(float *)((int)npc + 0x338) = local_154.y; if (180.0 < local_1b4.y) break; } iVar9 = iVar9 + 1; } while (iVar9 < 0x14); } local_1ac.x = ((Vector *)((int)npc + 0x334))->x; iVar9 = *(int *)((int)npc + 0xb64); local_1ac.y = *(float *)((int)npc + 0x338); } } local_154.y = 0.0; local_170.y = 0.0; if (local_164 == (undefined1 *)0xffffffff) { fVar21 = (local_1ac.x - ((Vector *)((int)npc + 0x33c))->x) / ((Vector *)((int)npc + 0x374))->x; fVar19 = (local_1ac.y - *(float *)((int)npc + 0x340)) / *(float *)((int)npc + 0x378); fVar19 = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); if (fVar19 < *(float *)((int)npc + 0x370) || fVar19 == *(float *)((int)npc + 0x370)) { if ((local_141 == 0) && (iVar9 == 4)) { ((Vector *)((int)npc + 0x334))->x = g_vectorZero.x; local_17c.y = 4.2039e-45; *(float *)((int)npc + 0x338) = g_vectorZero.y; } } else { local_1b4.y = ((Vector *)((int)npc + 0x360))->x; local_13c = *(EntityPtr *)((int)npc + 0x364); local_184.y = *(float *)((int)npc + 0x36c); PathFinder::FindGridPath((PathFinder *)((int)npc + 0x414),&local_1ac,1.0,900,1); local_154.y = *(float *)((int)npc + 0x364) - (float)local_13c; local_170.y = ((Vector *)((int)npc + 0x360))->x - local_1b4.y; ((Vector *)((int)npc + 0x360))->x = local_1b4.y; *(EntityPtr *)((int)npc + 0x364) = local_13c; *(float *)((int)npc + 0x36c) = local_184.y; fVar19 = sqrtf(local_154.y * local_154.y + local_170.y * local_170.y); if (0.0 < fVar19) { iVar9 = *(int *)((int)npc + 0xb64); local_170.y = local_170.y * (1.0 / fVar19); local_154.y = local_154.y * (1.0 / fVar19); goto LAB_005a2262; } } iVar9 = *(int *)((int)npc + 0xb64); } else { local_170.y = local_184.y; local_154.y = (float)local_13c; } LAB_005a2262: if (iVar9 == 0x136) { local_170.y = ((Vector *)((int)npc + 0x334))->x; local_154.y = *(float *)((int)npc + 0x338); fVar19 = sqrtf(local_170.y * local_170.y + local_154.y * local_154.y); if (0.0 < fVar19) { local_170.y = local_170.y * (1.0 / fVar19); local_154.y = local_154.y * (1.0 / fVar19); } } fVar19 = *(float *)((int)npc + 0x36c); if (fVar19 != 0.0) { fVar21 = ((Vector *)((int)npc + 0x360))->x; *(float *)((int)npc + 0x364) = (*(float *)((int)npc + 0x39c) * (float)local_140 * local_154.y) / fVar19 + *(float *)((int)npc + 0x364); ((Vector *)((int)npc + 0x360))->x = (*(float *)((int)npc + 0x39c) * (float)local_140 * local_170.y) / fVar19 + fVar21; } fVar19 = ((Vector *)((int)npc + 0x360))->x; local_140 = *(EntityPtr *)((int)npc + 0x364); fVar19 = sqrtf(fVar19 * fVar19 + (float)local_140 * (float)local_140); if ((local_174 < fVar19) && (0.0 < fVar19)) { ((Vector *)((int)npc + 0x360))->x = (local_174 / fVar19) * ((Vector *)((int)npc + 0x360))->x; *(float *)((int)npc + 0x364) = (float)local_140 * (local_174 / fVar19); } local_13c = (EntityPtr)0x0; if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (*(byte *)((int)npc + 0x8c) != 0)) { pbVar10 = *(void **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar13 = "Walking"; do { bVar3 = *pbVar10; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_005a2402: uVar5 = -(uint)bVar22 | 1; goto LAB_005a2407; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_005a2402; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_005a2407: if (uVar5 != 0) { pbVar10 = *(void **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar13 = "WalkingUp"; do { bVar3 = *pbVar10; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_005a2440: uVar5 = -(uint)bVar22 | 1; goto LAB_005a2445; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_005a2440; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_005a2445: if (uVar5 != 0) { pbVar10 = *(void **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar13 = "WalkingDown"; do { bVar3 = *pbVar10; bVar22 = bVar3 < (byte)*pcVar13; if (bVar3 != *pcVar13) { LAB_005a2480: uVar5 = -(uint)bVar22 | 1; goto LAB_005a2485; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar22 = bVar3 < (byte)pcVar13[1]; if (bVar3 != pcVar13[1]) goto LAB_005a2480; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_005a2485: if (uVar5 != 0) goto LAB_005a2499; } } local_13c = *(EntityPtr *)((int)npc + 0x88); } LAB_005a2499: if (ABS(local_170.y) <= ABS(local_154.y)) { local_184.y = (float)((uint)(0.0 <= local_154.y) * 2 + 1); } else { local_184.y = 2.8026e-45; if (local_170.y < 0.0) { local_184.y = 0.0; } } EVar12 = (EntityPtr)local_184.y; local_174 = sqrtf(local_170.y * local_170.y + local_154.y * local_154.y); if (local_174 == 0.0) { EVar12 = (EntityPtr)0xffffffff; local_184.y = -NAN; } if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (*(byte *)((int)npc + 0x8c) != 0)) { pbVar10 = *(void **)((int)npc + 0x7c); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar13 = "DashStop"; do { bVar3 = *pbVar10; bVar1 = (((ANM2 *)pcVar13)->_filename)._buf[0]; bVar22 = bVar3 < bVar1; if (bVar3 != bVar1) { LAB_005a2560: uVar5 = -(uint)bVar22 | 1; goto LAB_005a2565; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar1 = (((ANM2 *)pcVar13)->_filename)._buf[1]; bVar22 = bVar3 < bVar1; if (bVar3 != bVar1) goto LAB_005a2560; pbVar10 = pbVar10 + 2; pcVar13 = (((ANM2 *)pcVar13)->_filename)._buf + 2; } while (bVar3 != 0); uVar5 = 0; LAB_005a2565: if (uVar5 != 0) goto LAB_005a257b; *(float *)((int)npc + 0x14c) = 1.0; goto LAB_005a26c2; } LAB_005a257b: switch(EVar12) { case (EntityPtr)0x0: case (EntityPtr)0x2: ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"Walking",0); pcVar13 = (char *)extraout_ECX_08; if (*(void **)((int)npc + 0x7c) != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)((int)npc + 0x78),(float)local_13c); pcVar13 = (char *)extraout_ECX_09; } break; case (EntityPtr)0x1: pcVar13 = "WalkingUp"; goto LAB_005a25bc; case (EntityPtr)0x3: pcVar13 = "WalkingDown"; LAB_005a25bc: ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)pcVar13,0); pcVar13 = (char *)extraout_ECX_10; if (*(void **)((int)npc + 0x7c) != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)((int)npc + 0x78),(float)local_13c); pcVar13 = (char *)extraout_ECX_11; } goto LAB_005a2696; default: *(float *)((int)npc + 0x14c) = 1.0; pbVar10 = *(void **)((int)npc + 0x7c); if (pbVar10 != (byte *)0x0) { if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pbVar8 = s_Idle; do { bVar3 = *pbVar10; bVar22 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_005a2630: uVar5 = -(uint)bVar22 | 1; goto LAB_005a2635; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar22 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_005a2630; pbVar10 = pbVar10 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_005a2635: pcVar13 = (char *)((int)npc + 0x48); if ((uVar5 == 0) && ((*(char *)((int)*(void **)((int)npc + 0x7c) + 0x34) == '\0' || (*(byte *)((int)npc + 0x8c) != 0)))) break; } bVar3 = ANM2::SetAnimation((ANM2 *)((int)npc + 0x48),s_Idle,1); pcVar13 = (char *)extraout_ECX_12; if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)npc + 0x78)); *(byte *)((int)npc + 0x8c) = 1; pcVar13 = (char *)extraout_ECX_13; EVar12 = (EntityPtr)local_184.y; } } if ((EVar12 == (EntityPtr)0x0) || (EVar12 == (EntityPtr)0x2)) { *(bool *)((int)npc + 0x148) = local_170.y < 0.0; } if (EVar12 != (EntityPtr)0xffffffff) { LAB_005a2696: *(float *)((int)npc + 0x14c) = local_174 * local_168 * 0.8 * (float)local_12c; } LAB_005a26c2: iVar9 = *(int *)((int)npc + 0xb64); local_154.y = 0.0; local_170.y = 0.0; if (local_164 == (undefined1 *)0xffffffff) { if ((iVar9 != 4) && (iVar9 != 3)) goto LAB_005a3277; bVar3 = Entity::IsFrame((Entity *)npc,0xf,0); if (bVar3 != 0) { outcomePicker = (WeightedOutcomePicker)0x0; local_15c.x = 0.0; local_15c.y = 0.0; local_14 = CONCAT31(local_14._1_3_,5); WVar20 = (WeightedOutcomePicker)0x0; if (*(int *)((int)npc + 0x2c) == 0) { local_12c = (EntityPtr)(local_18c.y * 20.0); local_13c = (EntityPtr)(int)((float)local_12c + 30.0); EVar11 = (EntityPtr)(-(uint)((uint)ultraCoins._size < 3) & (uint)local_13c); EVar12 = (EntityPtr)((int)EVar11 + 0x1e); if (1 < (int)local_14c) { EVar12 = EVar11; } if (0 < (int)EVar12) { local_138.x = 1.4013e-43; local_138.y = (float)EVar12; std::vector<8byte>::_Emplace_reallocate(0,&local_138); } room = g_game->_room; vecResult = Entity_NPC::CalcTargetPosition((Entity_NPC *)local_130,&scratchVec,0.0); tmpEntity = Entity_NPC::GetPlayerTarget((Entity_NPC *)local_130); local_168 = (tmpEntity->_velocity).x; local_174 = (tmpEntity->_velocity).y; uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_138.y = fVar19 * local_174 * 16.0 + vecResult->y; local_138.x = fVar19 * local_168 * 16.0 + vecResult->x; Room::GetClampedPositionImpl(room,&local_1a4,&local_138,20.0,20.0,20.0,20.0); npc = (Entity_NPC *)local_130; local_138.x = local_1a4.x - *(float *)local_19c.y; local_138.y = local_1a4.y - *(float *)((int)local_19c.y + 4); if ((ABS(local_138.x) < *(float *)((int)local_130 + 0x370) * ((Vector *)((int)local_130 + 0x374))->x) || (ABS(local_138.y) < *(float *)((int)local_130 + 0x370) * *(float *)((int)local_130 + 0x378))) { vecResult = Vector::ToCardinal(&scratchVec,&local_138); local_170.y = vecResult->x; local_154.y = vecResult->y; } else { local_13c = (EntityPtr)0x0; } uVar5 = 0; uVar6 = (int)local_15c.x - (int)outcomePicker >> 3; if (uVar6 != 0) { do { if (*(int *)((int)outcomePicker + uVar5 * 8) == 300) { piVar7 = (int *)((int)outcomePicker + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_13c; if (*piVar7 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar5 * 8) = 0; } goto LAB_005a29aa; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_13c) { local_138.x = 4.2039e-43; local_138.y = (float)local_13c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); } else { *(EntityPtr *)local_15c.x = (EntityPtr)0x12c; *(EntityPtr *)((int)local_15c.x + 4) = local_13c; local_15c.x = (float)((int)local_15c.x + 8); } } LAB_005a29aa: WVar20 = outcomePicker; local_13c = (EntityPtr)0x0; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar19 = ((Vector *)((int)npc + 0x374))->x; fVar21 = ((Vector *)((int)npc + 0x33c))->x / fVar19 - (tmpEntity->_pos).x / fVar19; fVar19 = *(float *)((int)npc + 0x340) / *(float *)((int)npc + 0x378) - (tmpEntity->_pos).y / *(float *)((int)npc + 0x378); fVar19 = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); if (fVar19 < *(float *)((int)npc + 0x370) * 3.0) { local_13c = (EntityPtr)(int)(local_18c.y * 130.0 + 70.0); } uVar5 = 0; uVar6 = (int)local_15c.x - (int)WVar20 >> 3; if (uVar6 != 0) { do { if (*(int *)((int)WVar20 + uVar5 * 8) == 500) { piVar7 = (int *)((int)WVar20 + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_13c; if (*piVar7 < 0) { *(undefined4 *)((int)WVar20 + 4 + uVar5 * 8) = 0; } goto LAB_005a2ada; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_13c) { local_138.x = 7.00649e-43; local_138.y = (float)local_13c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); WVar20 = outcomePicker; } else { *(EntityPtr *)local_15c.x = (EntityPtr)0x1f4; *(EntityPtr *)((int)local_15c.x + 4) = local_13c; local_15c.x = (float)((int)local_15c.x + 8); } } LAB_005a2ada: uVar5 = 0; uVar6 = (int)local_15c.x - (int)WVar20 >> 3; if (uVar6 != 0) { do { if (*(int *)((int)WVar20 + uVar5 * 8) == 0x1fe) { piVar7 = (int *)((int)WVar20 + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)((float)local_12c + 15.0); if (*piVar7 < 0) { *(undefined4 *)((int)WVar20 + 4 + uVar5 * 8) = 0; } goto LAB_005a2b66; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } EVar12 = (EntityPtr)(int)((float)local_12c + 15.0); if (0 < (int)EVar12) { local_138.x = 7.14662e-43; local_138.y = (float)EVar12; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); WVar20 = outcomePicker; } else { *(EntityPtr *)local_15c.x = (EntityPtr)0x1fe; *(EntityPtr *)((int)local_15c.x + 4) = EVar12; local_15c.x = (float)((int)local_15c.x + 8); } } } LAB_005a2b66: tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_13c = (EntityPtr)0x0; fVar19 = (tmpEntity->_pos).x - ((Vector *)((int)npc + 0x33c))->x; fVar21 = (tmpEntity->_pos).y - *(float *)((int)npc + 0x340); local_164 = (undefined1 *)sqrtf(fVar19 * fVar19 + fVar21 * fVar21); if ((200.0 < (float)local_164) && ((float)local_164 < 320.0)) { if (*(int *)((int)npc + 0x2c) == 0) { fVar19 = local_18c.y * 30.0 + 50.0; } else { if (*(int *)((int)npc + 0x2c) != 1) goto LAB_005a2c0e; fVar19 = local_18c.y * 40.0 + 80.0; } local_13c = (EntityPtr)(int)fVar19; } LAB_005a2c0e: uVar5 = 0; uVar6 = (int)local_15c.x - (int)WVar20 >> 3; if (uVar6 != 0) { do { if (*(int *)((int)WVar20 + uVar5 * 8) == 600) { piVar7 = (int *)((int)WVar20 + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_13c; if (*piVar7 < 0) { *(undefined4 *)((int)WVar20 + 4 + uVar5 * 8) = 0; } goto LAB_005a2c9a; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_13c) { local_138.x = 8.40779e-43; local_138.y = (float)local_13c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); WVar20 = outcomePicker; } else { *(EntityPtr *)local_15c.x = (EntityPtr)0x258; *(EntityPtr *)((int)local_15c.x + 4) = local_13c; local_15c.x = (float)((int)local_15c.x + 8); } } LAB_005a2c9a: if (*(int *)((int)npc + 0x2c) == 0) { EVar12 = (EntityPtr)(int)(local_18c.y * 20.0 + 20.0); local_12c = (EntityPtr)((int)EVar12 + 0x1e); if (1 < (int)local_14c) { local_12c = EVar12; } uVar5 = 0; uVar6 = (int)local_15c.x - (int)WVar20 >> 3; if (uVar6 != 0) { do { if (*(int *)((int)WVar20 + uVar5 * 8) == 200) { piVar7 = (int *)((int)WVar20 + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_12c; if (*piVar7 < 0) { *(undefined4 *)((int)WVar20 + 4 + uVar5 * 8) = 0; } goto LAB_005a2d64; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_12c) { local_138.x = 2.8026e-43; local_138.y = (float)local_12c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); WVar20 = outcomePicker; } else { *(EntityPtr *)local_15c.x = (EntityPtr)0xc8; *(EntityPtr *)((int)local_15c.x + 4) = local_12c; local_15c.x = (float)((int)local_15c.x + 8); } } LAB_005a2d64: EVar11 = (EntityPtr)(int)(100.0 - local_18c.y * 40.0); EVar12 = (EntityPtr)((int)EVar11 + -0x3c); if (1 < (int)local_14c) { EVar12 = EVar11; } local_12c = (EntityPtr)((int)EVar12 + 500); if ((int)local_148 < 6) { local_12c = EVar12; } local_140 = *(EntityPtr *)((int)npc + 0xb64); uVar5 = 0; uVar6 = (int)local_15c.x - (int)WVar20 >> 3; if (uVar6 != 0) { do { npc = (Entity_NPC *)local_130; if (*(EntityPtr *)((int)WVar20 + uVar5 * 8) == local_140) { piVar7 = (int *)((int)WVar20 + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_12c; if (*piVar7 < 0) { *(undefined4 *)((int)WVar20 + 4 + uVar5 * 8) = 0; } goto LAB_005a2e3b; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_12c) { local_138.x = (float)local_140; local_138.y = (float)local_12c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); } else { *(EntityPtr *)local_15c.x = local_140; *(EntityPtr *)((int)local_15c.x + 4) = local_12c; local_15c.x = (float)((int)local_15c.x + 8); } } } LAB_005a2e3b: if (*(float *)((int)npc + 0x2c) == 1.4013e-45) { EVar12 = (EntityPtr)(int)(local_18c.y * 5.0 + 10.0); local_12c = (EntityPtr)((int)EVar12 + 0x1e); if (1 < (int)local_14c) { local_12c = EVar12; } uVar5 = 0; uVar6 = (int)local_15c.x - (int)outcomePicker >> 3; if (uVar6 != 0) { do { if (*(int *)((int)outcomePicker + uVar5 * 8) == 200) { piVar7 = (int *)((int)outcomePicker + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_12c; if (*piVar7 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar5 * 8) = 0; } goto LAB_005a2f11; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_12c) { local_138.x = 2.8026e-43; local_138.y = (float)local_12c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); } else { *(EntityPtr *)local_15c.x = (EntityPtr)0xc8; *(EntityPtr *)((int)local_15c.x + 4) = local_12c; local_15c.x = (float)((int)local_15c.x + 8); } } LAB_005a2f11: EVar12 = (EntityPtr)(int)(100.0 - local_18c.y * 70.0); local_12c = (EntityPtr)((int)EVar12 + 500); if ((int)local_148 < 6) { local_12c = EVar12; } local_140 = (EntityPtr)((Vector *)((int)npc + 0xb64))->x; uVar6 = (int)local_15c.x - (int)outcomePicker >> 3; uVar5 = 0; if (uVar6 != 0) { do { npc = (Entity_NPC *)local_130; if (*(EntityPtr *)((int)outcomePicker + uVar5 * 8) == local_140) { piVar7 = (int *)((int)outcomePicker + 4 + uVar5 * 8); *piVar7 = *piVar7 + (int)local_12c; if (*piVar7 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar5 * 8) = 0; } goto LAB_005a2fd3; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } if (0 < (int)local_12c) { local_138.x = (float)local_140; local_138.y = (float)local_12c; if (local_15c.x == local_15c.y) { std::vector<8byte>::_Emplace_reallocate(local_15c.x,&local_138); } else { *(EntityPtr *)local_15c.x = local_140; *(EntityPtr *)((int)local_15c.x + 4) = local_12c; local_15c.x = (float)((int)local_15c.x + 8); } } LAB_005a2fd3: fVar19 = *(float *)((int)npc + 0x370); fVar21 = ((Vector *)((int)npc + 0x374))->x; local_19c.y = fVar19 * fVar21; local_168 = local_19c.y + 100.0; if (local_19c.y == local_168) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar21 = ((Vector *)((int)npc + 0x374))->x; fVar19 = *(float *)((int)npc + 0x370); } local_168 = local_168 - local_19c.y; fVar24 = (float)local_164 - local_19c.y; local_19c.y = fVar21 * fVar19; fVar24 = fVar24 / local_168; if (fVar24 <= 0.0) { fVar24 = 0.0; } if (1.0 <= fVar24) { fVar24 = 1.0; } local_168 = local_19c.y + 100.0; local_174 = (float)(int)(20.0 - fVar24 * 10.0); if (local_19c.y == local_168) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar19 = ((float)local_164 - local_19c.y) / (local_168 - local_19c.y); if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } iVar9 = (int)(20.0 - fVar19 * 10.0); if (0 < (int)local_14c) { iVar9 = iVar9 * 3; } WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,700,(int)local_174,0); WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,0x2c6,iVar9,0); local_168 = *(float *)((int)npc + 0x370) * ((Vector *)((int)npc + 0x374))->x; local_19c.y = local_168 + 400.0; if (local_168 == local_19c.y) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar19 = ((float)local_164 - local_168) / (local_19c.y - local_168); if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,6,(int)(fVar19 * 40.0 + 10.0),0); } uVar5 = Random(); local_1e4._24_4_ = uVar5 | 1; uStack_1c8._0_4_ = 7.00649e-45; uStack_1c8._4_4_ = 9; puStack_1c0 = &DAT_00000007; rng_00._shift1 = 5; rng_00._seed = local_1e4._24_4_; rng_00._shift2 = 9; rng_00._shift3 = 7; local_17c.y = (float)WeightedOutcomePicker::PickOutcome(&outcomePicker,rng_00); local_14 = CONCAT31(local_14._1_3_,4); if (outcomePicker != (WeightedOutcomePicker)0x0) { deallocate((void *)outcomePicker,(int)local_15c.y - (int)outcomePicker >> 3); } } if ((int)local_14c < 6) goto LAB_005a3532; fVar19 = 5.60519e-43; } else if ((iVar9 == 4) || (iVar9 == 3)) { if (*(int *)((int)npc + 0xf1c) == -1) { LAB_005a3c6b: fVar19 = local_17c.y; } else { bVar3 = input_is_action_pressed(5,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13); pcVar13 = (char *)extraout_ECX_14; if ((bVar3 == 0) || (local_1a4.y <= 0.5)) goto LAB_005a3c6b; vecResult = Vector::ToCardinal(&local_15c,&local_138); local_170.y = vecResult->x; local_154.y = vecResult->y; pcVar13 = (char *)extraout_ECX_15; fVar19 = 4.2039e-43; } if (*(int *)((int)npc + 0xf1c) != -1) { bVar3 = input_is_action_pressed(7,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13); pcVar13 = (char *)0x1f4; if (bVar3 != 0) { fVar19 = 7.00649e-43; } } if (*(int *)((int)npc + 0xf1c) != -1) { bVar3 = input_is_action_pressed(4,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13); pcVar13 = (char *)0x1fe; if (bVar3 != 0) { fVar19 = 7.14662e-43; } } if (*(int *)((int)npc + 0xf1c) != -1) { bVar3 = input_is_action_pressed(6,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13); pcVar13 = (char *)0x258; if (bVar3 != 0) { fVar19 = 8.40779e-43; } } if (*(int *)((int)npc + 0xf1c) != -1) { bVar3 = input_is_action_pressed(8,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13); pcVar13 = (char *)0x64; if (bVar3 != 0) { fVar19 = 1.4013e-43; } } if (*(int *)((int)npc + 0xf1c) != -1) { bVar3 = input_is_action_pressed(10,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13); pcVar13 = (char *)0xc8; if (bVar3 != 0) { fVar19 = 2.8026e-43; } } if ((*(int *)((int)npc + 0xf1c) != -1) && (bVar3 = input_is_action_pressed(0xb,*(int *)((int)npc + 0xf1c),(Entity *)npc,(int)pcVar13), bVar3 != 0)) { fVar19 = 5.60519e-43; } } else { LAB_005a3277: if (iVar9 == 0x136) { iVar9 = 3; do { local_12c = (EntityPtr)Random(); local_130 = (EntityPtr)((Vector *)((int)npc + 0x360))->x; local_13c = *(EntityPtr *)((int)npc + 0x364); fVar19 = sqrtf((float)local_130 * (float)local_130 + (float)local_13c * (float)local_13c); if (0.0 < fVar19) { local_13c = (EntityPtr)((1.0 / fVar19) * (float)local_13c); local_130 = (EntityPtr)((1.0 / fVar19) * (float)local_130); } local_130 = (EntityPtr)((float)local_130 * -3.5); local_13c = (EntityPtr)((float)local_13c * -3.5); uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_19c.y = fVar19 + fVar19; local_174 = sin(local_19c.y); uVar5 = Random(); local_168 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar19 = cos(local_19c.y); uVar30 = 0; local_138.x = fVar19 * local_168 + (float)local_130; pTVar29 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_138.y = local_174 * local_168 + (float)local_13c; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; tmpEntity = Game::Spawn(g_game,1000,0x58,(Vector *)((int)npc + 0x33c),&local_138, (Entity *)0x0,0,(uint)local_12c); local_12c = (EntityPtr)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); (**(code **)((int)*(float *)local_12c + 0xc))(); fVar19 = g_vectorOne.y * 2.0; ((Vector *)((int)local_12c + 0xe4))->x = g_vectorOne.x * 2.0; *(float *)((int)local_12c + 0xe8) = fVar19; uVar5 = Random(); dVar26 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; ((Vector *)((int)local_12c + 0xdc))->x = 0.0; *(float *)((int)local_12c + 0xe0) = -20.0 - (float)((double)(int)uVar5 + dVar26) * 2.3283064e-10 * 40.0; if (*(float *)((int)npc + 0x338) <= 0.0 && *(float *)((int)npc + 0x338) != 0.0) { *(float *)((int)local_12c + 0x354) = 2.8026e-42; } iVar9 = iVar9 + -1; } while (iVar9 != 0); iVar9 = *(int *)((int)npc + 0xba4) + ((int)*(float *)((int)npc + 0x3a4) - (int)*(float *)((int)npc + 0x3a0)); *(int *)((int)npc + 0xba4) = iVar9; if (0x5a < iVar9) { *(int *)((int)npc + 0x410) = 100; } if ((*(byte *)((int)npc + 400) != 0) || (99 < *(int *)((int)npc + 0x410))) { iVar9 = *(int *)((int)npc + 0x410) + 1; *(int *)((int)npc + 0x410) = iVar9; if (iVar9 < 6) { fVar19 = local_17c.y; } else { ((Vector *)((int)npc + 0x334))->x = g_vectorZero.x; fVar19 = 4.2039e-45; *(float *)((int)npc + 0x338) = g_vectorZero.y; ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)"DashStop",0); } goto LAB_005a3538; } *(int *)((int)npc + 0x410) = 0; } LAB_005a3532: fVar19 = local_17c.y; } LAB_005a3538: if ((*(float *)((int)npc + 0xb64) == 4.2039e-45) && (iVar9 = *(int *)((int)npc + 0x410) + 1, *(int *)((int)npc + 0x410) = iVar9, 0x1e < iVar9)) { fVar19 = 5.60519e-45; LAB_005a3562: *(float *)((int)npc + 0xb64) = fVar19; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; *(float *)((int)npc + 0x14c) = 1.0; } else if (fVar19 != *(float *)((int)npc + 0xb64)) { if (fVar19 == 4.2039e-43) { ((Vector *)((int)npc + 0x334))->x = local_170.y; *(float *)((int)npc + 0x338) = local_154.y; } else if (fVar19 == 8.40779e-43) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar21 = (tmpEntity->_pos).y; ((Vector *)((int)npc + 0x334))->x = (tmpEntity->_pos).x; *(float *)((int)npc + 0x338) = fVar21; } else if ((((((fVar19 == 5.60519e-43) || (fVar19 == 4.2039e-45)) || (fVar19 == 5.60519e-45)) || ((fVar19 == 7.00649e-43 || (fVar19 == 7.14662e-43)))) || (fVar19 == 9.80909e-43)) || (fVar19 == 9.94922e-43)) goto LAB_005a3562; *(float *)((int)npc + 0xb64) = fVar19; *(int *)((int)npc + 0x410) = 0; *(int *)((int)npc + 0xbc0) = 0; *(float *)((int)npc + 0x14c) = 1.0; *(byte *)((int)npc + 0x148) = 0; } LAB_005a3586: if (*(int *)((int)npc + 0x2c) == 1) { Entity_NPC::CreateBling(npc); if (*(void **)((int)npc + 0x7c) != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"StartGibs"); if (bVar3 != 0) { Entity_NPC::CreateGoldParticles(npc,7); manager = g_manager; local_12c = (EntityPtr)0x8a; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,0.5,0.0); manager = g_manager; local_12c = (EntityPtr)0x1ae; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,1.0,0.0); } if ((*(void **)((int)npc + 0x7c) != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered ((AnimationState *)((int)npc + 0x78),(byte *)"BreakGibs"), bVar3 != 0)) { Entity_NPC::CreateGoldParticles(npc,0x3c); manager = g_manager; local_12c = (EntityPtr)0x1ab; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,1.0,0.0); manager = g_manager; local_12c = (EntityPtr)0x1b0; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,0.5,0.0); local_138.y = *(float *)((int)npc + 0x340) + 60.0; local_138.x = ((Vector *)((int)npc + 0x33c))->x + 0.0; position_00.y = local_138.y; position_00.x = local_138.x; NpcHelper::UltraGreed_Smash(npc,position_00); } } if ((*(int *)((int)npc + 0x2c) == 1) && (*(int *)((int)npc + 0xb64) == 0x10)) { *(int *)((int)npc + 0x188) = 4; *(byte *)((int)npc + 0x173) = 0; Entity::RemoveStatusEffects((Entity *)npc); *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) | 0xc4000001; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); *(float *)((int)npc + 0x380) = *(float *)((int)npc + 900); *(byte *)((int)npc + 0x3b0) = 1; *(float *)((int)npc + 0x388) = 0.0; local_138.y = 1.0; local_138.x = 2.0; Entity::SetSize((Entity *)npc,*(float *)((int)npc + 0x370),(Vector)0x3f80000040000000, *(int *)((int)*(void **)((int)npc + 0x330) + 0x48)); ((Vector *)((int)npc + 0x360))->x = g_vectorZero.x; *(float *)((int)npc + 0x364) = g_vectorZero.y; ((Vector *)((int)npc + 0x33c))->x = ((Vector *)((int)npc + 0x334))->x; *(float *)((int)npc + 0x340) = *(float *)((int)npc + 0x338); *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; *(float *)((int)npc + 0x36c) = *(float *)((int)npc + 0x36c) * 0.01; manager = g_manager; if ((*(void **)((int)npc + 0x7c) == (void *)0x0) || (*(byte *)((int)npc + 0x8c) == 0)) { *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) & 0x39fffffe; *(uint *)((int)npc + 0x16c) = *(uint *)((int)npc + 0x16c) & 0xfffffff7; *(float *)((int)npc + 0x380) = *(float *)((int)npc + 900); *(byte *)((int)npc + 0x3b0) = 0; *(int *)((int)npc + 0xb64) = 3; *(int *)((int)npc + 0x410) = 0; configEntity = EntityConfig::GetEntity (&manager->_entityConfig,*(int *)((int)npc + 0x28), *(int *)((int)npc + 0x2c),0); *(float *)((int)npc + 0x388) = configEntity->collisionDamage; } } } manager = g_manager; if ((*(int *)((int)npc + 0xb64) == 9000) || (*(int *)((int)npc + 0xb64) == 0x2329)) { if (*(int *)((int)npc + 0x410) == 0) { local_12c = (EntityPtr)0x1ad; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,1.0,0.0); manager = g_manager; local_12c = (EntityPtr)0x1ae; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,1.0,0.0); manager = g_manager; local_12c = (EntityPtr)0x1af; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,1.0,0.0); manager = g_manager; local_12c = (EntityPtr)0x1b0; seed_fart_sound_override((int *)&local_12c); SoundEffects::Play(&manager->_sfxManager,(int)local_12c,1.0,2,0,0.6,0.0); } if (*(int *)((int)npc + 0x2c) == 0) { *(int *)((int)npc + 0x188) = 4; } *(byte *)((int)npc + 0x173) = 0; Entity::RemoveStatusEffects((Entity *)npc); *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) | 0xc4000001; *(uint *)((int)npc + 0x16c) = *(uint *)((int)npc + 0x16c) | 8; *(float *)((int)npc + 0x380) = *(float *)((int)npc + 900); *(byte *)((int)npc + 0x3b0) = 1; *(float *)((int)npc + 0x388) = 0.0; local_138.y = 1.0; local_138.x = 2.0; Entity::SetSize((Entity *)npc,*(float *)((int)npc + 0x370),(Vector)0x3f80000040000000, *(int *)((int)*(void **)((int)npc + 0x330) + 0x48)); ((Vector *)((int)npc + 0x360))->x = g_vectorZero.x; *(float *)((int)npc + 0x364) = g_vectorZero.y; fVar19 = *(float *)((int)npc + 0x36c); ((Vector *)((int)npc + 0x33c))->x = ((Vector *)((int)npc + 0x334))->x; *(float *)((int)npc + 0x340) = *(float *)((int)npc + 0x338); *(int *)((int)npc + 0x410) = *(int *)((int)npc + 0x410) + 1; *(float *)((int)npc + 0x36c) = fVar19 * 0.01; if (((*(int *)((int)npc + 0x2c) == 0) && ((*(void **)((int)npc + 0x7c) == (void *)0x0 || (*(byte *)((int)npc + 0x8c) == 0)))) && ((g_game->_difficulty == 3 || (g_game->_difficulty == 1)))) { iVar9 = PersistentGameData::GetBestiaryEncounterCount(&g_manager->_persistentGameData,0x196,1) ; ((Vector *)((int)npc + 0x360))->x = g_vectorZero.x; *(float *)((int)npc + 0x364) = g_vectorZero.y; Entity_NPC::Morph(npc,0x196,1,0,-1); *(void **)((int)npc + 0xc40) = local_194; *(int *)((int)npc + 0xc44) = 0x78; *(int *)((int)npc + 0xb64) = 0x10; *(int *)((int)npc + 0x410) = 0; if (iVar9 == 0) { KAGE_LogMessage(1,(byte *)"First UG+ encounter"); pcVar13 = "BreakFreeLong"; } else { pcVar13 = "BreakFreeShort"; } ANM2::Play((ANM2 *)((int)npc + 0x48),(byte *)pcVar13,0); } } pvVar15 = ((std_vector *)((int)npc + 0x178))->_begin; local_148 = 0.0; if ((int)*(void **)((int)npc + 0x17c) - (int)pvVar15 >> 3 != 0) { fVar19 = 40.0; do { room = g_game->_room; iVar16 = (int)(((*(float *)((int)pvVar15 + (int)local_148 * 8) * 1.1 + ((Vector *)((int)npc + 0x33c))->x) - fVar19) / fVar19 + 0.5); iVar9 = (int)(((*(float *)((int)pvVar15 + (int)local_148 * 8 + 4) * 1.1 + *(float *)((int)npc + 0x340)) - 120.0) / fVar19 + 0.5); if ((((-1 < iVar16) && (iVar16 < room->_gridWidth)) && (-1 < iVar9)) && ((iVar9 < room->_gridHeight && (iVar16 = iVar9 * room->_gridWidth + iVar16, -1 < iVar16)))) { if (iVar16 < 0x1c0) { EVar12 = *(EntityPtr *)(room->_gridEntities + iVar16); } else { EVar12 = (EntityPtr)0x0; } local_130 = EVar12; uVar5 = Room::GetGridCollision(room,iVar16); if (((uVar5 == 3) || (uVar5 == 2)) && ((EVar12 != (EntityPtr)0x0 && (*(float *)((int)EVar12 + 0x3c) == 4.2039e-45)))) { pcVar2 = *(code **)((int)*(float *)EVar12 + 0x14); EntityRef::constructor(&npcRef,(Entity *)npc); cVar4 = (*pcVar2)(0,&npcRef); fVar19 = 40.0; if (cVar4 != '\0') { local_1a4.y = (float)g_game->_room; iVar9 = ((Room *)local_1a4.y)->_gridWidth; fVar24 = (float)((int)*(float *)((int)local_130 + 0x24) % iVar9) * 40.0 + 40.0; fVar21 = (float)((int)*(float *)((int)local_130 + 0x24) / iVar9) * 40.0 + 120.0; local_138.x = fVar24 - ((Vector *)((int)npc + 0x33c))->x; local_138.y = fVar21 - *(float *)((int)npc + 0x340); Vector::ToCardinal(&local_19c,&local_138); iVar17 = (int)(((fVar24 + local_19c.x * fVar19) - fVar19) / fVar19 + 0.5); iVar16 = (int)(((local_19c.y * fVar19 + fVar21) - 120.0) / fVar19 + 0.5); if ((((iVar17 < 0) || (iVar9 <= iVar17)) || (iVar16 < 0)) || ((*(int *)((int)local_1a4.y + 0x10) <= iVar16 || (iVar17 = iVar9 * iVar16 + iVar17, iVar17 < 0)))) goto LAB_005a4087; if (iVar17 < 0x1c0) { pit = ((void **)((int)local_1a4.y + 0x24))[iVar17]; } else { pit = (GridEntity *)0x0; } Room::TryMakeBridge((Room *)local_1a4.y,pit,(GridEntity *)local_130); } } fVar19 = 40.0; } LAB_005a4087: pvVar15 = ((std_vector *)((int)npc + 0x178))->_begin; local_148 = (float)((int)local_148 + 1); } while ((uint)local_148 < (uint)((int)*(void **)((int)npc + 0x17c) - (int)pvVar15 >> 3)); } if ((isStomp1 != 0) || ((byte)isStomp2 != '\0')) { if (*(void **)((int)npc + 0x7c) == (void *)0x0) { local_140 = (EntityPtr)0x0; local_130 = (EntityPtr)0x0; } else { EVar12 = (EntityPtr) AnimationState::GetNullFrame((AnimationState *)((int)npc + 0x78),(byte *)"Foot1"); local_130 = EVar12; if (*(void **)((int)npc + 0x7c) == (void *)0x0) { local_140 = (EntityPtr)0x0; } else { local_140 = (EntityPtr) AnimationState::GetNullFrame ((AnimationState *)((int)npc + 0x78),(byte *)"Foot2"); local_130 = EVar12; } } local_164 = (undefined1 *)0x0; EVar12 = local_130; do { EVar11 = EVar12; bVar3 = isStomp1; if (local_164 == (undefined1 *)0x0) { joined_r0x005a412e: if ((bVar3 != 0) && (EVar11 != (EntityPtr)0x0)) { local_13c = *(EntityPtr *)((int)EVar11 + 4); if (*(byte *)((int)npc + 0x148) == 0) { puVar23 = (undefined1 *)0x3f800000; } else { puVar23 = &DAT_bf800000; } local_194 = (void *)((float)puVar23 * *(float *)EVar11); local_168 = (float)local_194 / 0.65; local_174 = (float)local_13c / 0.65; uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1a4.y = fVar19 + fVar19; local_19c.y = sin(local_1a4.y); uVar5 = Random(); local_14c = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar19 = cos(local_1a4.y); local_12c = (EntityPtr)(fVar19 * local_14c * 15.0 + local_168); local_14c = local_14c * local_19c.y * 15.0 + local_174; uVar5 = Random(); local_138.x = (float)local_194 + ((Vector *)((int)npc + 0x33c))->x; local_138.y = (float)local_13c + *(float *)((int)npc + 0x340); Game::Spawn(g_game,1000,0x59,&local_138,&g_vectorZero,(Entity *)0x0,0,uVar5); if (*(int *)((int)npc + 0x2c) == 1) { Color::Reset(&tmpColor); local_184.x = (float)local_194 + ((Vector *)((int)npc + 0x33c))->x; local_184.y = (float)local_13c + *(float *)((int)npc + 0x340); Game::SpawnParticles(g_game,&local_184,0x5f,10,8.0,(ColorMod *)&tmpColor,0.0,0); } local_194 = (void *)0x10; do { uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1a4.y = fVar19 + fVar19; local_19c.y = sin(local_1a4.y); uVar5 = Random(); local_148 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar19 = cos(local_1a4.y); local_1a4.y = fVar19 * local_148 * 3.0; local_148 = ABS(local_148 * local_19c.y * 3.0); uVar5 = Random(); local_17c.x = local_1a4.y + ((Vector *)((int)npc + 0x360))->x * 0.5; uVar30 = 0; pTVar29 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; local_17c.y = local_148 + *(float *)((int)npc + 0x364) * 0.5; local_154.y = local_148 + *(float *)((int)npc + 0x340) + 0.0; local_154.x = (float)local_12c + local_1a4.y + ((Vector *)((int)npc + 0x33c))->x; tmpEntity = Game::Spawn(g_game,1000,0x58,&local_154,&local_17c,(Entity *)0x0,0,uVar5); piVar7 = (int *)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); (**(code **)(*piVar7 + 0xc))(); piVar7[0xd5] = 1000; piVar7[0x37] = 0; *(EntityPtr *)(piVar7 + 0x38) = local_13c; Color::Reset(&tmpColor); tmpColor._offset[0] = 0.11764707; tmpColor._offset[1] = 0.058823533; tmpColor._offset[2] = 0.019607844; (**(code **)(*piVar7 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); local_194 = (void *)((int)local_194 + -1); } while (local_194 != (void *)0x0); uVar5 = Random(); if ((uVar5 & 1) == 0) { uVar5 = Random(); local_19c.y = ((Vector *)((int)npc + 0x360))->x + 0.0; local_174 = *(float *)((int)npc + 0x364) + 2.0; uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1a4.y = fVar19 + fVar19; local_168 = sin(local_1a4.y); local_170.x = cos(local_1a4.y); local_170.x = local_170.x + local_19c.y; local_170.y = local_168 + local_174; uVar30 = 0; pTVar29 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar28 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar27 = 0; local_18c.y = local_14c + *(float *)((int)npc + 0x340); local_18c.x = (float)local_12c + ((Vector *)((int)npc + 0x33c))->x; tmpEntity = Game::Spawn(g_game,1000,4,&local_18c,&local_170,(Entity *)0x0,0,uVar5); piVar7 = (int *)__RTDynamicCast(tmpEntity,uVar27,pTVar28,pTVar29,uVar30); (**(code **)(*piVar7 + 0xc))(); } EVar12 = local_130; } } else if (local_164 == (undefined1 *)0x1) { EVar11 = local_140; bVar3 = (byte)isStomp2; goto joined_r0x005a412e; } local_164 = local_164 + 1; } while ((int)local_164 < 2); } bVar3 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x1b8); manager = g_manager; if (((bVar3 != 0) && (*(int *)((int)npc + 0xb64) != 500)) && (*(int *)((int)npc + 0xb64) != 0x1fe) ) { fVar19 = SFXManager::GetAmbientSoundVolume(&g_manager->_sfxManager,0x1b8); local_1a4.y = fVar19 - 0.15; SFXManager::SetAmbientSound(&manager->_sfxManager,0x1b8,local_1a4.y,1.0); } if (*(int *)((int)npc + 0xb64) != 100) { SFXManager::Stop(&g_manager->_sfxManager,0x1b4); SFXManager::Stop(&g_manager->_sfxManager,0x1b7); } LAB_005a472a: if (ultraDoors._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,8); tracked_alloc(1,ultraDoors._data,0); } if (keepers._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,9); tracked_alloc(1,keepers._data,0); } if (greedGapers._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,10); tracked_alloc(1,greedGapers._data,0); } if (ultraCoins._0_1_ == '\0') { local_14 = CONCAT31(local_14._1_3_,0xb); tracked_alloc(1,ultraCoins._data,0); } if (coinPickups._0_1_ == '\0') { local_14 = 0xc; tracked_alloc(1,coinPickups._data,0); } ExceptionList = local_1c; return; } //@@ 005a4820 NpcAI::ENTITY_ULTRA_COIN /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 293 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ULTRA_COIN(Entity_NPC *npc) { byte bVar1; uint uVar2; Vector *randomDir; byte *curAnim; uint uVar3; ColorMod *color; undefined4 uVar4; int iVar5; int ultraDoor; byte *nameCursor; char *animName; qword *allocCounter; bool isLess; undefined1 *puVar6; float fVar7; float fVar8; undefined4 uVar9; TypeDescriptor *pTVar10; TypeDescriptor *pTVar11; undefined4 uVar12; undefined4 local_110 [11]; EntityList_EL ultraGreedList; EntityList_EL queryList; float local_c4; Entity_NPC *local_c0; Vector local_bc; char isExploded; Entity *local_b0; float local_ac; Color particleColor; ColorMod deathParticleColor; ColorMod explosionColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Manager *manager; qword oldAllocated; float speedMult; puStack_20 = (undefined1 *)(&explosionColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af58f6; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&explosionColor)[1]._colorize + 1); if (npc->_state == 0) { uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; npc->_state = 2; if (&npc->_splatColor != (ColorMod *)local_110) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } manager = g_manager; npc->_entityCollisionClass = 0; (npc->_sprite)._offset.x = 5.0; (npc->_sprite)._offset.y = -3.0; if ((manager->_persistentGameData)._achievements[0xf6] == 0) { if (manager->_state != 2) { return; } if (g_game == (Game *)0x0) { return; } if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) { return; } } npc->_maxHitPoints = npc->_maxHitPoints * 1.15; npc->_health = npc->_health * 1.15; return; } ExceptionList = &local_1c; local_c0 = npc; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&ultraGreedList,0x196,-1,-1,0,0); local_14._0_1_ = 0; local_14._1_3_ = 0; uVar2 = 0; fVar8 = 0.0; fVar7 = 0.0; local_b0 = (Entity *)0x3f800000; if (ultraGreedList._size != 0) { do { iVar5 = *(int *)((int)ultraGreedList._data + uVar2 * 4); if ((0.0 < *(float *)(iVar5 + 900)) && (*(char *)(iVar5 + 0x173) == '\0')) { fVar7 = fVar7 + *(float *)(iVar5 + 0x380); fVar8 = fVar8 + *(float *)(iVar5 + 900); } uVar2 = uVar2 + 1; } while (uVar2 < (uint)ultraGreedList._size); local_bc.y = fVar7; local_ac = fVar8; if (0.0 < fVar8) { if (fVar8 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar7 = (local_bc.y - 0.0) / (local_ac - 0.0); if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } local_b0 = (Entity *)(fVar7 * 0.5 + 0.5); if (((g_manager->_persistentGameData)._achievements[0xf6] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_b0 = (Entity *)((float)local_b0 * 0.9); } } } iVar5 = npc->_state; fVar7 = 0.1; if (iVar5 == 2) { switch(npc->_variant) { case 0: animName = "AppearNeutral"; break; case 1: animName = "AppearKey"; break; case 2: animName = "AppearBomb"; break; case 3: animName = "AppearHeart"; break; default: goto switchD_005a4ae5_default; } ANM2::Play(&npc->_sprite,(byte *)animName,0); switchD_005a4ae5_default: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 3; npc->_stateFrame = 0; npc->_entityCollisionClass = 4; switch(npc->_variant) { case 0: animName = "SpinningNeutral"; break; case 1: animName = "SpinningKey"; break; case 2: animName = "SpinningBomb"; break; case 3: animName = "SpinningHeart"; break; default: goto switchD_005a4b56_default; } LAB_005a58d2: ANM2::Play(&npc->_sprite,(byte *)animName,0); } goto switchD_005a4b56_default; } if (iVar5 != 3) { if (iVar5 != 4) goto switchD_005a4b56_default; if (npc->_variant != 1) { if (npc->_variant == 3) { npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"HeartChange"); if (((bVar1 == 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && ((npc->_sprite)._animState._isPlaying != 0)) { bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"HeartMove"); if (bVar1 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&queryList,0x196,-1,-1,0,0); uVar12 = 0; pTVar11 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar10 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar9 = 0; local_14._0_1_ = 2; uVar4 = NpcHelper::query_nearest_other(0,(npc->_pos).x,(npc->_pos).y); iVar5 = __RTDynamicCast(uVar4,uVar9,pTVar10,pTVar11,uVar12); if (iVar5 != 0) { local_b0 = (Entity *)(*(float *)(iVar5 + 0x33c) - (npc->_pos).x); local_bc.y = *(float *)(iVar5 + 0x340) - (npc->_pos).y; fVar7 = sqrtf((float)local_b0 * (float)local_b0 + local_bc.y * local_bc.y); if (0.0 < fVar7) { local_b0 = (Entity *)((2.0 / fVar7) * (float)local_b0); local_bc.y = local_bc.y * (2.0 / fVar7); } fVar8 = (float)local_b0 * npc->_speedMultiplier + (npc->_velocity).x; fVar7 = local_bc.y * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = fVar8; local_c0 = (Entity_NPC *)sqrtf(fVar7 * fVar7 + fVar8 * fVar8); fVar7 = sqrtf((float)local_b0 * (float)local_b0 + local_bc.y * local_bc.y); if (0.0 < fVar7) { local_bc.y = ((float)local_c0 / fVar7) * local_bc.y; local_b0 = (Entity *)(((float)local_c0 / fVar7) * (float)local_b0); } (npc->_velocity).y = local_bc.y; (npc->_velocity).x = (float)local_b0; fVar7 = (npc->_pos).y - *(float *)(iVar5 + 0x340); fVar8 = (npc->_pos).x - *(float *)(iVar5 + 0x33c); local_c0 = (Entity_NPC *)sqrtf(fVar7 * fVar7 + fVar8 * fVar8); fVar7 = sqrtf(local_bc.y * local_bc.y + (float)local_b0 * (float)local_b0); if (fVar7 <= (float)local_c0) { local_14._0_1_ = 0; EntityList_Query::~EntityList_Query(&queryList); goto switchD_005a4b56_default; } NpcHelper::UltraGreed_Heal(3); manager = g_manager; local_ac = 3.27904e-43; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac,1.0,2,0,0.9,0.0); } (**(code **)(*(int *)npc + 0x28))(); EntityList_Query::~EntityList_Query(&queryList); goto LAB_005a5acd; } } else { npc->_friction = npc->_friction * fVar7; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { animName = "HeartMove"; goto LAB_005a58af; } } } goto switchD_005a4b56_default; } npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"KeyChange"); if (((bVar1 == 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && ((npc->_sprite)._animState._isPlaying != 0)) { bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"KeyMove"); if (bVar1 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&queryList,0x126,-1,-1,0,0); local_14._0_1_ = 1; iVar5 = 0; local_ac = 0.0; if ((float)queryList._size != 0.0) { do { ultraDoor = __RTDynamicCast(*(undefined4 *)((int)queryList._data + (int)local_ac * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if ((ultraDoor != 0) && (*(int *)(ultraDoor + 0xbc0) == npc->_i1)) { iVar5 = ultraDoor; } local_ac = (float)((int)local_ac + 1); } while ((uint)local_ac < (uint)queryList._size); if (iVar5 != 0) { local_b0 = (Entity *)(*(float *)(iVar5 + 0x340) - (npc->_pos).y); local_bc.y = *(float *)(iVar5 + 0x33c) - (npc->_pos).x; fVar7 = sqrtf((float)local_b0 * (float)local_b0 + local_bc.y * local_bc.y); if (0.0 < fVar7) { local_bc.y = local_bc.y * (2.0 / fVar7); local_b0 = (Entity *)((float)local_b0 * (2.0 / fVar7)); } local_b0 = (Entity *)((float)local_b0 * npc->_speedMultiplier + (npc->_velocity).y); local_bc.y = local_bc.y * npc->_speedMultiplier + (npc->_velocity).x; (npc->_velocity).y = (float)local_b0; (npc->_velocity).x = local_bc.y; fVar7 = (npc->_pos).y - *(float *)(iVar5 + 0x340); fVar8 = (npc->_pos).x - *(float *)(iVar5 + 0x33c); local_c0 = (Entity_NPC *)sqrtf(fVar7 * fVar7 + fVar8 * fVar8); fVar7 = sqrtf((float)local_b0 * (float)local_b0 + local_bc.y * local_bc.y); if (fVar7 <= (float)local_c0) { local_14._0_1_ = 0; EntityList_Query::~EntityList_Query(&queryList); goto switchD_005a4b56_default; } *(undefined4 *)(iVar5 + 0xb64) = 0xd; manager = g_manager; local_ac = 2.18603e-43; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac,1.0,2,0,1.0,0.0); } } (**(code **)(*(int *)npc + 0x28))(); EntityList_Query::~EntityList_Query(&queryList); goto LAB_005a5acd; } goto switchD_005a4b56_default; } npc->_friction = npc->_friction * fVar7; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) goto switchD_005a4b56_default; animName = "KeyMove"; LAB_005a58af: (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; goto LAB_005a58d2; } uVar2 = 0; isExploded = '\0'; switch(npc->_variant) { case 0: local_ac = npc->_friction * 0.9; npc->_friction = local_ac; local_bc.y = npc->_maxHitPoints; local_b0 = (Entity *)(npc->_health - (local_bc.y * npc->_speedMultiplier) / 330.0); npc->_health = (float)local_b0; if ((float)local_b0 < 0.0) { npc->_dead = 1; } if (local_bc.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); local_ac = npc->_friction; } fVar7 = ((float)local_b0 - 0.0) / (local_bc.y - 0.0); if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } local_b0 = (Entity *)(fVar7 + fVar7 + 2.0); (npc->_sprite)._playbackSpeed = (float)local_b0; npc->_stateFrame = npc->_stateFrame + (int)(float)local_b0; iVar5 = npc->_index * 0x231d + npc->_stateFrame; local_bc.y = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) / 240.0; if ((npc->_index & 1U) == 0) { local_bc.y = local_bc.y * -1.0; } local_bc.y = local_bc.y * 6.2831855; local_c4 = cos(local_bc.y); local_c4 = local_c4 * 0.12; fVar7 = sin(local_bc.y); if (local_ac != 0.0) { fVar8 = npc->_speedMultiplier; (npc->_velocity).y = (fVar8 * fVar7 * 0.12 * (float)local_b0) / local_ac + (npc->_velocity).y; (npc->_velocity).x = (fVar8 * local_c4 * (float)local_b0) / local_ac + (npc->_velocity).x; } bVar1 = Entity::IsFrame((Entity *)npc,0x78,npc->_index); if (bVar1 != 0) { randomDir = MusicManager::RandomVector(&local_bc); (npc->_v1).x = randomDir->x; (npc->_v1).y = randomDir->y; } fVar7 = npc->_friction; fVar8 = (npc->_v1).x; if (fVar7 != 0.0) { speedMult = npc->_speedMultiplier; (npc->_velocity).y = (speedMult * (npc->_v1).y * 0.1 * (float)local_b0) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (speedMult * fVar8 * 0.1 * (float)local_b0) / fVar7 + (npc->_velocity).x; } if (npc->_collidesWithGrid != 0) { local_c4 = -(npc->_gridCollisionNormal).x * 9.0; local_ac = -(npc->_gridCollisionNormal).y * 9.0; uVar2 = Random(); fVar7 = npc->_friction; fVar8 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; if (fVar7 != 0.0) { speedMult = npc->_speedMultiplier; (npc->_velocity).y = (speedMult * local_ac * fVar8) / fVar7 + (npc->_velocity).y; (npc->_velocity).x = (speedMult * local_c4 * fVar8) / fVar7 + (npc->_velocity).x; } } break; case 1: if ((float)local_b0 * 225.0 < npc->_updateTime) { animName = "KeyChange"; LAB_005a4f23: npc->_state = 4; ANM2::Play(&npc->_sprite,(byte *)animName,0); manager = g_manager; local_ac = 3.75548e-43; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac,0.7,2,0,1.0,0.0); } goto LAB_005a4f7f; case 2: if ((float)local_b0 * 60.0 < npc->_updateTime) { if ((npc->_sprite)._animState._animData == (void *)0x0) { puVar6 = &DAT_bf800000; LAB_005a4fdc: if ((npc->_speedMultiplier * (npc->_sprite)._playbackSpeed + (float)puVar6 < 7.0) || (bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"SpinningBomb"), bVar1 == 0)) goto LAB_005a5008; } else { puVar6 = (undefined1 *)(npc->_sprite)._animState._animFrame; if ((float)puVar6 < 7.0) goto LAB_005a4fdc; LAB_005a5008: bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"IdleBomb"); if (bVar1 == 0) goto LAB_005a5045; } ANM2::Play(&npc->_sprite,(byte *)"PulseBomb",0); (npc->_sprite)._playbackSpeed = 1.0 / (float)local_b0; } LAB_005a5045: if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { curAnim = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } animName = "PulseBomb"; do { bVar1 = *curAnim; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_005a5090: uVar3 = -(uint)isLess | 1; goto LAB_005a5095; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_005a5090; curAnim = curAnim + 2; animName = animName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_005a5095: if (uVar3 == 0) { explosionColor._offset[2] = 0.0; uVar2 = 0; explosionColor._offset[0] = 0.5; explosionColor._offset[1] = 0.25; explosionColor._colorize[0] = 0.0; explosionColor._colorize[1] = 0.0; explosionColor._colorize[2] = 0.0; explosionColor._colorize[3] = 0.0; explosionColor._tint[0] = 1.0; explosionColor._tint[1] = 1.0; explosionColor._tint[2] = 1.0; explosionColor._tint[3] = 1.0; Game::BombExplosionEffects (g_game,&npc->_pos,40.0,(BitSet128)ZEXT816(0),&explosionColor,(Entity *)npc,1.8,1, 4,0); if (npc->_subtype == 1) { uVar2 = Random(); uVar2 = uVar2 & 1; } Color::Color(&particleColor); Game::SpawnParticles(g_game,&npc->_pos,0x5f,6,10.0,color,100000.0,0); isExploded = '\x01'; } } npc->_friction = npc->_friction * 0.8; if (uVar2 != 0) { do { uVar3 = Random(); local_b0 = Game::Spawn(g_game,5,0x14,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar3); if (local_b0 != (Entity *)0x0) { uVar3 = Random(); local_c4 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c4 = local_c4 + local_c4; local_ac = sin(local_c4); fVar7 = cos(local_c4); (local_b0->_velocity).x = fVar7 + fVar7; (local_b0->_velocity).y = local_ac + local_ac; } uVar2 = uVar2 - 1; } while (uVar2 != 0); npc = local_c0; } if (isExploded == '\0') break; goto LAB_005a5ac6; case 3: if ((float)local_b0 * 150.0 < npc->_updateTime) { if ((npc->_sprite)._animState._animData == (void *)0x0) { puVar6 = &DAT_bf800000; } else { puVar6 = (undefined1 *)(npc->_sprite)._animState._animFrame; if (7.0 <= (float)puVar6) goto LAB_005a4f7f; } if ((7.0 <= npc->_speedMultiplier * (npc->_sprite)._playbackSpeed + (float)puVar6) && (bVar1 = ANM2::IsPlaying(&npc->_sprite,(byte *)"SpinningHeart"), bVar1 != 0)) { animName = "HeartChange"; goto LAB_005a4f23; } } LAB_005a4f7f: npc->_friction = npc->_friction * 0.8; } switchD_005a4b56_default: if (npc->_dead == 0) { if (npc->_state != 0x10) goto LAB_005a5acd; } else { uVar2 = Random(); manager = g_manager; local_ac = 5.98354e-43; local_c0 = (Entity_NPC *) ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 1.2); seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac,1.0,0x1e,0,(float)local_c0,0.0); npc->_dead = 0; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; Entity::RemoveStatusEffects((Entity *)npc); uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; deathParticleColor._tint[0] = 1.0; deathParticleColor._tint[1] = 1.0; deathParticleColor._tint[2] = 1.0; deathParticleColor._tint[3] = 1.0; deathParticleColor._offset[0] = 0.0; deathParticleColor._colorize[0] = 0.0; deathParticleColor._colorize[1] = 0.0; deathParticleColor._colorize[2] = 0.0; deathParticleColor._colorize[3] = 0.0; deathParticleColor._offset[1] = 0.0; deathParticleColor._offset[2] = 0.0; Game::SpawnParticles(g_game,&npc->_pos,0x5f,6,5.0,&deathParticleColor,100000.0,0); curAnim = (npc->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_005a5a4e: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Crumble",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } animName = "Crumble"; do { bVar1 = *nameCursor; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_005a5a30: uVar2 = -(uint)isLess | 1; goto LAB_005a5a35; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_005a5a30; nameCursor = nameCursor + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_005a5a35: if ((uVar2 != 0) || ((curAnim[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_005a5a4e; } (npc->_sprite)._playbackSpeed = 1.0; npc->_state = 0x10; npc->_sortingLayer = 0; npc->_shadowSize = 0.0; } npc->_friction = npc->_friction * 0.1; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_005a5ac6: (**(code **)(*(int *)npc + 0x28))(); } LAB_005a5acd: if (ultraGreedList._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (ultraGreedList._data != (void *)0x0) { uVar2 = *(uint *)((int)ultraGreedList._data + -4); oldAllocated = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)oldAllocated < uVar2); free((uint *)((int)ultraGreedList._data + -4)); } } ExceptionList = local_1c; return; } //@@ 005a5b60 NpcAI::ENTITY_ULTRA_DOOR /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 294 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_ULTRA_DOOR(Entity_NPC *npc) { byte bVar1; qword qVar2; byte *pbVar3; Vector *pos; Entity *spawned; int *spawnedNpc; Entity_Laser *laser; float fVar4; char *pcVar5; byte *pbVar6; byte *pbVar7; EntityPtr EVar8; qword *heapCounter; uint uVar9; float fVar10; int iVar11; ANM2 *sprite; EntityPtr EVar12; bool bVar13; float chosenX; float fVar14; undefined4 uVar15; TypeDescriptor *pTVar16; TypeDescriptor *pTVar17; undefined4 uVar18; undefined4 local_d4 [8]; undefined4 local_b4; undefined4 uStack_b0; undefined4 local_ac; EntityList_EL ultraGreedList; EntityList_EL ultraDoorList; Vector local_88; Vector local_80; Vector local_78; float bestY; float bestX; float bestSlot; Entity *local_64; Vector local_60; ANM2 *local_58; EntityPtr local_54; ColorMod laserColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; Manager *manager; Room *room; puStack_20 = (undefined1 *)(&laserColor)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00af593b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&laserColor)[1]._colorize + 1); ExceptionList = &local_1c; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&ultraGreedList,0x196,-1,-1,0,0); local_14 = 0.0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&ultraDoorList,0x126,-1,-1,1,0); local_14 = (float)CONCAT31(local_14._1_3_,1); iVar11 = npc->_state; if (iVar11 == 0) { npc->_state = 2; if (&npc->_splatColor != (ColorMod *)local_d4) { (npc->_splatColor)._offset[0] = 0.0; (npc->_splatColor)._offset[1] = 0.0; (npc->_splatColor)._tint[0] = 0.0; (npc->_splatColor)._tint[1] = 0.0; (npc->_splatColor)._tint[2] = 0.0; (npc->_splatColor)._tint[3] = 0.0; (npc->_splatColor)._offset[2] = 0.0; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } qVar2 = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); game = g_game; *(uint *)&npc->_flags = (uint)qVar2 & 0xfffffffb | 0x11; fVar4 = -NAN; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; npc->_isInvicible = 1; npc->_sortingLayer = 1; local_54 = (EntityPtr)game->_room; bestSlot = -NAN; bestX = g_vectorZero.x; bestY = g_vectorZero.y; local_80.y = 0.0; local_64 = (Entity *)0x1; local_58 = (ANM2 *)0x744; local_b4 = 0; uStack_b0 = 0; local_ac = 0; fVar14 = g_vectorZero.y; chosenX = g_vectorZero.x; do { fVar10 = local_80.y; if ((uint)local_80.y < 8) { if ((*(uint *)(*(int *)(*(int *)((int)local_54 + 4) + 0x10) + 0x38 + ((uint)local_80.y >> 5) * 4) & (uint)local_64) == 0) { LAB_005a5e5c: fVar4 = bestSlot; } else { iVar11 = *(int *)((local_58->_filename)._buf + (int)local_54); local_88.y = (float)(iVar11 % *(int *)((int)local_54 + 0xc)) * 40.0 + 40.0; local_78.y = (float)(iVar11 / *(int *)((int)local_54 + 0xc)) * 40.0 + 120.0; if (bestSlot != -NAN) { fVar14 = (npc->_pos).x - local_88.y; fVar4 = (npc->_pos).y - local_78.y; local_60.y = sqrtf(fVar4 * fVar4 + fVar14 * fVar14); fVar14 = (npc->_pos).x - bestX; fVar4 = (npc->_pos).y - bestY; fVar4 = sqrtf(fVar4 * fVar4 + fVar14 * fVar14); if (fVar4 <= local_60.y) { LAB_005a5e44: local_80.y = fVar10; fVar14 = bestY; chosenX = bestX; goto LAB_005a5e5c; } } uVar9 = 0; if (ultraDoorList._size != 0) { do { iVar11 = *(int *)((int)ultraDoorList._data + uVar9 * 4); fVar14 = *(float *)(iVar11 + 0x33c) - local_88.y; fVar4 = *(float *)(iVar11 + 0x340) - local_78.y; fVar4 = sqrtf(fVar4 * fVar4 + fVar14 * fVar14); if (fVar4 < 80.0) { fVar10 = local_80.y; goto LAB_005a5e44; } uVar9 = uVar9 + 1; } while (uVar9 < (uint)ultraDoorList._size); } bestSlot = local_80.y; bestX = local_88.y; bestY = local_78.y; fVar4 = local_80.y; fVar14 = local_78.y; chosenX = local_88.y; } } local_58 = (ANM2 *)((local_58->_filename)._buf + 4); local_64 = (Entity *)((int)local_64 << 1 | (uint)((int)local_64 < 0)); local_80.y = (float)((int)local_80.y + 1); } while ((int)local_58 < 0x764); if (fVar4 != -NAN) { npc->_i1 = (int)fVar4; (npc->_pos).x = chosenX; (npc->_pos).y = fVar14; } fVar4 = (float)npc->_i1 * 90.0; local_60.y = fVar4 * 0.017453292; (npc->_sprite)._rotation = fVar4 - 90.0; local_54 = (EntityPtr)sin(local_60.y); fVar4 = cos(local_60.y); fVar4 = fVar4 * 23.076923 + (npc->_pos).x; fVar14 = (float)local_54 * 23.076923 + (npc->_pos).y; (npc->_pos).x = fVar4; (npc->_targetPosition).x = fVar4; (npc->_pos).y = fVar14; (npc->_targetPosition).y = fVar14; goto LAB_005a6ae5; } local_58 = &npc->_sprite; if (iVar11 == 2) { ANM2::Play(local_58,(byte *)"Closed",0); npc->_state = 3; iVar11 = 3; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying == 0)) { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Close"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a5f94: uVar9 = -(uint)bVar13 | 1; goto LAB_005a5f99; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a5f94; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a5f99: if (uVar9 == 0) { ANM2::Play(local_58,(byte *)"Closed",0); iVar11 = npc->_state; } } if (iVar11 == 3) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_005a6049: ANM2::Play(local_58,(byte *)"Close",0); manager = g_manager; local_54 = (EntityPtr)0x23; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,0.5,0x14,0,1.0,0.0); } else { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Close"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a6001: uVar9 = -(uint)bVar13 | 1; goto LAB_005a6006; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a6001; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a6006: if (uVar9 != 0) { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Closed"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a6040: uVar9 = -(uint)bVar13 | 1; goto LAB_005a6045; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a6040; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a6045: if (uVar9 != 0) goto LAB_005a6049; } } sprite = local_58; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying != 0)) goto LAB_005a60f3; pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Close"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a60d8: uVar9 = -(uint)bVar13 | 1; goto LAB_005a60dd; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a60d8; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a60dd: if (uVar9 == 0) { ANM2::Play(local_58,(byte *)"Closed",0); } } else { LAB_005a60f3: sprite = local_58; } if (npc->_state == 0xd) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_005a6199: ANM2::Play(sprite,s_Open,0); manager = g_manager; npc->_stateFrame = 0; local_54 = (EntityPtr)0x24; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,0.5,0x14,0,1.0,0.0); } else { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar6 = s_Open; do { bVar1 = *pbVar3; bVar13 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_005a6150: uVar9 = -(uint)bVar13 | 1; goto LAB_005a6155; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_005a6150; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a6155: if (uVar9 != 0) { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Opened"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a6190: uVar9 = -(uint)bVar13 | 1; goto LAB_005a6195; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a6190; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a6195: if (uVar9 != 0) goto LAB_005a6199; } } pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 != (byte *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar7 = s_Open; do { bVar1 = *pbVar6; bVar13 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_005a6235: uVar9 = -(uint)bVar13 | 1; goto LAB_005a623a; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar13 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_005a6235; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a623a: if (uVar9 == 0) { ANM2::Play(local_58,(byte *)"Opened",0); pbVar3 = (npc->_sprite)._animState._animData; } } if ((pbVar3 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { pbVar3 = &s_empty; } else if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Opened"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a62a0: uVar9 = -(uint)bVar13 | 1; goto LAB_005a62a5; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a62a0; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a62a5: if (uVar9 == 0) { iVar11 = npc->_stateFrame + 1; npc->_stateFrame = iVar11; if (iVar11 % 10 == 0) { room = g_game->_room; pos = Room::GetRandomPosition(room,&local_60,0.0); Room::FindFreePickupSpawnPosition(room,&local_88,pos,0.0,0,0,0); uVar9 = Random(); uVar18 = 0; pTVar17 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar16 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar15 = 0; spawned = Game::Spawn(g_game,299,0,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar9); spawnedNpc = (int *)__RTDynamicCast(spawned,uVar15,pTVar16,pTVar17,uVar18); if (spawnedNpc != (int *)0x0) { (**(code **)(*spawnedNpc + 0xc))(); } } if (0x50 < npc->_stateFrame) { npc->_state = 3; } } } } } if ((npc->_state == 8) || (npc->_state == 9)) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_005a63fc: ANM2::Play(local_58,s_Open,0); manager = g_manager; npc->_stateFrame = 0; local_54 = (EntityPtr)0x24; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,0.5,0x14,0,1.0,0.0); } else { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar6 = s_Open; do { bVar1 = *pbVar3; bVar13 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_005a63b6: uVar9 = -(uint)bVar13 | 1; goto LAB_005a63bb; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_005a63b6; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a63bb: if (uVar9 != 0) { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Opened"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a63f3: uVar9 = -(uint)bVar13 | 1; goto LAB_005a63f8; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a63f3; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a63f8: if (uVar9 != 0) goto LAB_005a63fc; } } pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 != (byte *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar7 = s_Open; do { bVar1 = *pbVar6; bVar13 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_005a64a0: uVar9 = -(uint)bVar13 | 1; goto LAB_005a64a5; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar13 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_005a64a0; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a64a5: if (uVar9 == 0) { ANM2::Play(local_58,(byte *)"Opened",0); pbVar3 = (npc->_sprite)._animState._animData; } } if ((pbVar3 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { pbVar3 = &s_empty; } else if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Opened"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a6510: uVar9 = -(uint)bVar13 | 1; goto LAB_005a6515; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a6510; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a6515: if (uVar9 == 0) { iVar11 = npc->_stateFrame + 1; npc->_stateFrame = iVar11; if ((npc->_state == 8) && (iVar11 == 0xf)) { Room::GetClampedPositionImpl(g_game->_room,&local_80,&npc->_pos,-10.0,-10.0,-10.0,-10.0) ; local_54 = (EntityPtr)npc; if (ultraGreedList._size != 0) { local_54 = *(EntityPtr *)ultraGreedList._data; } local_60.x = 0.0; local_60.y = -5.0; laser = Entity_Laser::ShootAngle (3,&local_80,(float)npc->_i1 * 90.0,0xf,&local_60,(Entity *)npc,0); if (laser != (Entity_Laser *)0x0) { laserColor._offset[0] = 0.6; laserColor._colorize[0] = 0.0; laserColor._colorize[1] = 0.0; laserColor._colorize[2] = 0.0; laserColor._colorize[3] = 0.0; laserColor._offset[1] = 0.3; laserColor._tint[0] = 0.8; laserColor._tint[1] = 0.5; laserColor._tint[2] = 0.15; laserColor._tint[3] = 1.0; laserColor._offset[2] = 0.1; Sprite::SetColor((Sprite *)&laser->_sprite,&laserColor); if (laser->_spawnerEntity != (EntityPtr)0x0) { local_60.y = (float)&laser->_spawnerEntity; std::multiset::erase(&local_60.y); } laser->_spawnerEntity = local_54; if (local_54 != (EntityPtr)0x0) { std::multiset::insert(&laser->_spawnerEntity); } (**(code **)(*(int *)laser + 0xc))(); } } if (0x24 < npc->_stateFrame) { npc->_state = 3; } } } } } if (npc->_state == 10) { if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { LAB_005a66f9: ANM2::Play(local_58,s_Open,0); manager = g_manager; npc->_stateFrame = -1; local_54 = (EntityPtr)0x24; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,0.5,0x14,0,1.0,0.0); } else { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar6 = s_Open; do { bVar1 = *pbVar3; bVar13 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_005a66b0: uVar9 = -(uint)bVar13 | 1; goto LAB_005a66b5; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_005a66b0; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a66b5: if (uVar9 != 0) { pbVar3 = (npc->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Opened"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a66f0: uVar9 = -(uint)bVar13 | 1; goto LAB_005a66f5; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a66f0; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a66f5: if (uVar9 != 0) goto LAB_005a66f9; } } pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 != (byte *)0x0) { if ((npc->_sprite)._animState._isPlaying == 0) { pbVar6 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar6 = *(byte **)pbVar3; } pbVar7 = s_Open; do { bVar1 = *pbVar6; bVar13 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_005a6796: uVar9 = -(uint)bVar13 | 1; goto LAB_005a679b; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar13 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_005a6796; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a679b: if (uVar9 == 0) { ANM2::Play(local_58,(byte *)"Opened",0); pbVar3 = (npc->_sprite)._animState._animData; } } if ((pbVar3 != (byte *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) { pbVar3 = (npc->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { pbVar3 = &s_empty; } else if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pcVar5 = "Opened"; do { bVar1 = *pbVar3; bVar13 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_005a6800: uVar9 = -(uint)bVar13 | 1; goto LAB_005a6805; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar13 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_005a6800; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_005a6805: if (uVar9 == 0) { local_64 = Entity_NPC::GetPlayerTarget(npc); local_54 = (EntityPtr) NpcHelper::UltraDoor_Opposite (npc,1,ultraDoorList._data,ultraDoorList._capacity, ultraDoorList._size); if ((local_54 == (EntityPtr)0x0) || (local_64 == (Entity *)0x0)) { LAB_005a68e6: iVar11 = npc->_i1; EVar8 = local_54; EVar12 = (EntityPtr)npc; if (local_64 != (Entity *)0x0) goto LAB_005a68fe; } else { fVar4 = (local_64->_pos).y - *(float *)((int)local_54 + 0x340); fVar14 = (local_64->_pos).x - *(float *)((int)local_54 + 0x33c); local_60.y = sqrtf(fVar4 * fVar4 + fVar14 * fVar14); fVar4 = (local_64->_pos).y - (npc->_pos).y; fVar14 = (local_64->_pos).x - (npc->_pos).x; fVar4 = sqrtf(fVar4 * fVar4 + fVar14 * fVar14); if (local_60.y <= fVar4) goto LAB_005a68e6; iVar11 = npc->_i1; EVar8 = (EntityPtr)npc; EVar12 = local_54; LAB_005a68fe: if (iVar11 % 0xb4 == 0) { fVar4 = (local_64->_pos).y - (npc->_pos).y; } else { fVar4 = (local_64->_pos).x - (npc->_pos).x; } if (ABS(fVar4) < 30.0) { if (EVar12 != (EntityPtr)0x0) { *(undefined4 *)((int)EVar12 + 0x410) = 0; *(undefined4 *)((int)EVar12 + 0xbc4) = 0; } if (EVar8 != (EntityPtr)0x0) { *(undefined4 *)((int)EVar8 + 0x410) = 0; *(undefined4 *)((int)EVar12 + 0xbc4) = 1; } } } local_60.y = 2.52234e-43; iVar11 = npc->_stateFrame; if (-1 < iVar11) { iVar11 = iVar11 + 1; npc->_stateFrame = iVar11; } if (iVar11 == 5) { Room::GetClampedPositionImpl(g_game->_room,&local_78,&npc->_pos,-10.0,-10.0,-10.0,-10.0) ; local_54 = (EntityPtr)npc; if (ultraGreedList._size != 0) { local_54 = *(EntityPtr *)ultraGreedList._data; } if (npc->_i2 == 0) { local_60.x = 0.0; local_60.y = -5.0; laser = Entity_Laser::ShootAngle (3,&local_78,(float)npc->_i1 * 90.0,0xf,&local_60,(Entity *)npc,0); if (laser != (Entity_Laser *)0x0) { laserColor._offset[0] = 0.6; laserColor._colorize[0] = 0.0; laserColor._colorize[1] = 0.0; laserColor._colorize[2] = 0.0; laserColor._colorize[3] = 0.0; laserColor._offset[1] = 0.3; laserColor._tint[0] = 0.8; laserColor._tint[1] = 0.5; laserColor._tint[2] = 0.15; laserColor._tint[3] = 1.0; laserColor._offset[2] = 0.1; Sprite::SetColor((Sprite *)&laser->_sprite,&laserColor); if (laser->_spawnerEntity != (EntityPtr)0x0) { local_60.y = (float)&laser->_spawnerEntity; std::multiset::erase(&local_60.y); } laser->_spawnerEntity = local_54; if (local_54 != (EntityPtr)0x0) { std::multiset::insert(&laser->_spawnerEntity); } (**(code **)(*(int *)laser + 0xc))(); } } } if (0x1a < npc->_stateFrame) { npc->_state = 3; } } } } } (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; LAB_005a6ae5: if (ultraDoorList._0_1_ == '\0') { heapCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } if (ultraDoorList._data != (void *)0x0) { uVar9 = *(uint *)((int)ultraDoorList._data + -4); qVar2 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar9; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar2 < uVar9); free((void *)((int)ultraDoorList._data + -4)); } } if (ultraGreedList._0_1_ == '\0') { heapCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } if (ultraGreedList._data != (EntityPtr *)0x0) { EVar12 = *(EntityPtr *)((int)ultraGreedList._data + -4); EVar8 = *(EntityPtr *)heapCounter; *(int *)heapCounter = (int)*(EntityPtr *)heapCounter - (int)EVar12; *(EntityPtr *)((int)heapCounter + 4) = (EntityPtr) ((int)*(EntityPtr *)((int)heapCounter + 4) - (uint)((uint)EVar8 < (uint)EVar12)); free((EntityPtr *)((int)ultraGreedList._data + -4)); } } ExceptionList = local_1c; return; } //@@ 005a6b80 NpcAI::ENTITY_GREED_GAPER /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 299 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_GREED_GAPER(Entity_NPC *npc) { byte bVar1; undefined4 *damageEvent; byte *overlayNameCursor; Entity *target; Vector *targetPos; byte *headNameCursor; void *pvVar2; uint uVar3; bool bVar4; Vector local_50; byte *local_48; void *walkVertAnim; char local_40 [12]; uint local_34; uint local_30; void *walkHoriAnim; char local_28 [12]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 flagsHigh; Manager *manager; byte *overlayAnim; pvVar2 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00af3555; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; if ((0.0 < npc->_pendingDamage) && (damageEvent = (npc->_damageEvents)._begin, damageEvent != (npc->_damageEvents)._end)) { do { if (damageEvent[6] == npc->_type) { *damageEvent = 0; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } if (npc->_state == 0) { uVar3 = npc->_index & 3; if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount != *(int *)((int)g_game->_room + 0x11f0))) { local_48 = (&PTR_s_Head1_00b62838)[uVar3]; overlayAnim = (npc->_sprite)._overlayAnimState._animData; if (overlayAnim == (byte *)0x0) { LAB_005a6d29: bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,local_48,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { overlayNameCursor = overlayAnim; headNameCursor = local_48; if (0xf < *(uint *)(overlayAnim + 0x14)) { overlayNameCursor = *(byte **)overlayAnim; } do { bVar1 = *overlayNameCursor; bVar4 = bVar1 < *headNameCursor; if (bVar1 != *headNameCursor) { LAB_005a6d10: uVar3 = -(uint)bVar4 | 1; goto LAB_005a6d15; } if (bVar1 == 0) break; bVar1 = overlayNameCursor[1]; bVar4 = bVar1 < headNameCursor[1]; if (bVar1 != headNameCursor[1]) goto LAB_005a6d10; overlayNameCursor = overlayNameCursor + 2; headNameCursor = headNameCursor + 2; } while (bVar1 != 0); uVar3 = 0; LAB_005a6d15: if ((uVar3 != 0) || ((overlayAnim[0x34] != 0 && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_005a6d29; } flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; npc->_entityCollisionClass = 4; npc->_state = 4; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } else { bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"WalkVert",1); if (((bVar1 != 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(npc->_sprite)._animState,0.0), (npc->_sprite)._animState._animData != (void *)0x0)) { (npc->_sprite)._animState._isPlaying = 0; } overlayAnim = (npc->_sprite)._overlayAnimState._animData; local_48 = (&PTR_s_Head1_00b62838)[uVar3]; if (overlayAnim == (byte *)0x0) { LAB_005a6c9c: bVar1 = ANM2::SetOverlayAnimation(&npc->_sprite,local_48,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._overlayAnimState); (npc->_sprite)._overlayAnimState._isPlaying = 1; } } else { overlayNameCursor = overlayAnim; headNameCursor = local_48; if (0xf < *(uint *)(overlayAnim + 0x14)) { overlayNameCursor = *(byte **)overlayAnim; } do { bVar1 = *overlayNameCursor; bVar4 = bVar1 < *headNameCursor; if (bVar1 != *headNameCursor) { LAB_005a6c83: uVar3 = -(uint)bVar4 | 1; goto LAB_005a6c88; } if (bVar1 == 0) break; bVar1 = overlayNameCursor[1]; bVar4 = bVar1 < headNameCursor[1]; if (bVar1 != headNameCursor[1]) goto LAB_005a6c83; overlayNameCursor = overlayNameCursor + 2; headNameCursor = headNameCursor + 2; } while (bVar1 != 0); uVar3 = 0; LAB_005a6c88: if ((uVar3 != 0) || ((overlayAnim[0x34] != 0 && ((npc->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_005a6c9c; } npc->_state = 4; } } else if (npc->_state != 4) { ExceptionList = pvVar2; return; } local_30 = 0xf; local_34 = 8; walkVertAnim = (void *)0x6b6c6157; builtin_strncpy(local_40,"Vert",5); local_18 = 0xf; local_1c = 8; walkHoriAnim = (void *)0x6b6c6157; builtin_strncpy(local_28,"Hori",5); local_8 = 1; Entity_NPC::AnimWalkFrame(npc,(std_string *)&walkHoriAnim,(std_string *)&walkVertAnim,0.1); local_8 = local_8 & 0xffffff00; if (0xf < local_18) { uVar3 = local_18 + 1; pvVar2 = walkHoriAnim; if (0xfff < uVar3) { pvVar2 = *(void **)((int)walkHoriAnim + -4); uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)walkHoriAnim + (-4 - (int)pvVar2))) goto LAB_005a6e57; } operator_delete(pvVar2,uVar3); } local_8 = 0xffffffff; local_1c = 0; local_18 = 0xf; walkHoriAnim = (void *)((uint)walkHoriAnim & 0xffffff00); if (0xf < local_30) { uVar3 = local_30 + 1; pvVar2 = walkVertAnim; if (0xfff < uVar3) { pvVar2 = *(void **)((int)walkVertAnim + -4); uVar3 = local_30 + 0x24; if (0x1f < (uint)((int)walkVertAnim + (-4 - (int)pvVar2))) { LAB_005a6e57: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } npc->_aiFloat = 0.6; if ((npc->_flags & 0x1000800) == 0) { targetPos = Entity_NPC::CalcTargetPosition(npc,&local_50,0.0); PathFinder::FindGridPath((PathFinder *)&npc->_pathfinder,targetPos,0.6,900,1); } else { target = Entity_NPC::GetPlayerTarget(npc); local_50.x = (target->_pos).x; local_50.y = (target->_pos).y; PathFinder::EvadeTarget((PathFinder *)&npc->_pathfinder,&local_50,0); npc->_friction = npc->_friction * 0.8; } if ((npc->_pathfinder)._hasDirectPath == 0) { ExceptionList = local_10; return; } uVar3 = Random(); manager = g_manager; if (uVar3 % 0x1e != 0) { ExceptionList = local_10; return; } local_48 = (byte *)0x3f800000; if (npc->_championColorIdx == 0x12) { local_48 = (byte *)0x3fc00000; } else if (npc->_championColorIdx == 0x13) { local_48 = (byte *)0x3f000000; } local_50.y = 2.31214e-43; seed_fart_sound_override((int *)&local_50.y); SoundEffects::Play(&manager->_sfxManager,(int)local_50.y,1.0,0x78,0,(float)local_48,0.0); ExceptionList = local_10; return; } //@@ 005a6fb0 FUN_005a6fb0 void FUN_005a6fb0(void) { float in_XMM0_Da; ceil((double)in_XMM0_Da); return; } //@@ 005a6ff0 Entity::MultiplyFriction /* ZHL [lua] Lua binding Entity:MultiplyFriction */ void __thiscall Entity::MultiplyFriction(Entity *this,float param_2) { this->_friction = param_2 * this->_friction; return; } //@@ 005a7010 NpcHelper::visage_spawn_particles /* DB: only called from NpcAI::ENTITY_VISAGE (x2) and NpcAI::ENTITY_VISAGE_mask (x2); spawns 5..8 effect 1000.59 particles around ECX position along the EDX direction with random velocity, sets +0x474 spin sign and 30..39 timeout */ void NpcHelper::visage_spawn_particles(void) { float fVar1; float fVar2; float fVar3; float fVar4; int iVar5; uint uVar6; uint uVar7; Entity *pEVar8; float *in_ECX; float *in_EDX; int iVar9; int iVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; undefined1 *puVar16; float fVar17; Vector local_18; Vector local_10; uVar6 = Random(); fVar11 = cos(1.5707964); fVar12 = sin(1.5707964); fVar1 = *in_EDX; fVar2 = in_EDX[1]; for (iVar10 = (uVar6 & 3) + 5; iVar10 != 0; iVar10 = iVar10 + -1) { uVar6 = Random(); uVar7 = Random(); fVar13 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar14 = *in_EDX; fVar15 = in_EDX[1]; uVar7 = Random(); fVar17 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar17 = (fVar17 + fVar17) - 1.0; local_18.y = fVar13 * fVar15 * 5.0 + fVar17 * (fVar2 * fVar11 + fVar1 * fVar12); local_18.x = fVar13 * fVar14 * 5.0 + fVar17 * (fVar1 * fVar11 - fVar2 * fVar12); uVar7 = Random(); fVar14 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar14 = fVar14 + fVar14; uVar7 = Random(); fVar15 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar13 = cos(fVar14); local_10.x = fVar13 * fVar15 * 20.0 + *in_ECX; fVar14 = sin(fVar14); local_10.y = fVar14 * fVar15 * 20.0 + in_ECX[1]; pEVar8 = Game::SpawnEx(g_game,1000,0x3b,&local_10,&local_18,(Entity *)0x0,0,uVar6,0); fVar14 = (pEVar8->_pos).x; fVar15 = (pEVar8->_pos).y; fVar13 = *in_ECX; fVar17 = in_ECX[1]; fVar3 = *in_EDX; fVar4 = in_EDX[1]; uVar6 = Random(); if (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)((fVar14 - fVar13) * fVar3 + (fVar15 - fVar17) * fVar4 < 0.0) == 0.0 ) { puVar16 = (undefined1 *)0x3f800000; } else { puVar16 = &DAT_bf800000; } *(undefined1 **)(pEVar8[1]._sprite._animDefaultName._buf + 8) = puVar16; uVar6 = Random(); (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -16.0; iVar5 = *(int *)pEVar8; iVar9 = uVar6 % 10 + 0x1e; *(int *)(pEVar8[1]._sprite._filename._buf + 8) = iVar9; *(int *)(pEVar8[1]._sprite._filename._buf + 0xc) = iVar9; (**(code **)(iVar5 + 0xc))(); } return; } //@@ 005a7310 NpcHelper::visage_spawn_chain /* WARNING: Removing unreachable block (ram,0x005a74c2) */ /* WARNING: Removing unreachable block (ram,0x005a74d4) */ /* WARNING: Removing unreachable block (ram,0x005a74e4) */ /* WARNING: Removing unreachable block (ram,0x005a74ea) */ /* DB: ECX = Visage npc; callers NpcAI::ENTITY_VISAGE (5a7ce7, 5a81c6): Game::Spawn(903 ENTITY_VISAGE, variant 10, at +0x33c) 40 (0x28) times with subtype = index, each link's +0x3bc parent = previous link (multiset EntityPtr refs), +0x3c0 child set when the previous is a variant-10 link; stores the last link at npc+0xbec and closes the chain with the first link */ void NpcHelper::visage_spawn_chain(void) { uint subType; uint seed; EntityPtr EVar1; EntityPtr in_ECX; EntityPtr EVar2; EntityPtr *local_34; EntityPtr *local_30; EntityPtr local_28; EntityPtr local_24; Vector *local_20; uint local_1c; EntityPtr *local_18; EntityPtr local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af597d; local_10 = ExceptionList; ExceptionList = &local_10; local_34 = (EntityPtr *)0x0; local_18 = (EntityPtr *)0x0; local_30 = (EntityPtr *)0x0; local_8 = 0; local_20 = (Vector *)((int)in_ECX + 0x33c); local_1c = 0; local_14 = in_ECX; do { subType = local_1c; seed = Random(); EVar1 = (EntityPtr) Game::Spawn(g_game,0x387,10,local_20,&g_vectorZero,(Entity *)local_14,subType,seed); *(uint *)((int)EVar1 + 0x168) = *(uint *)((int)EVar1 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar1 + 0x16c) = *(undefined4 *)((int)EVar1 + 0x16c); local_28 = EVar1; if (*(EntityPtr *)((int)EVar1 + 0x3bc) != (EntityPtr)0x0) { local_24 = (EntityPtr)((int)EVar1 + 0x3bc); std::multiset::erase(&local_24); } *(EntityPtr *)((int)EVar1 + 0x3bc) = in_ECX; if (in_ECX != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar1 + 0x3bc)); } if (*(int *)((int)in_ECX + 0x2c) == 10) { EVar2 = (EntityPtr)((int)in_ECX + 0x3c0); if (*(int *)((int)in_ECX + 0x3c0) != 0) { local_24 = EVar2; std::multiset::erase(&local_24); } *(EntityPtr *)EVar2 = EVar1; std::multiset::insert(EVar2); } if (local_30 == local_18) { std::vector<4byte>::_Emplace_reallocate(local_30,&local_28); local_18 = (EntityPtr *)0x0; } else { *local_30 = EVar1; local_30 = local_30 + 1; } local_1c = local_1c + 1; in_ECX = EVar1; } while ((int)local_1c < 0x28); local_24 = local_30[-1]; EVar2 = (EntityPtr)((int)local_14 + 0xbec); if (*(EntityPtr *)EVar2 != (EntityPtr)0x0) { local_28 = EVar2; std::multiset::erase(&local_28); } *(EntityPtr *)EVar2 = local_24; if (local_24 != (EntityPtr)0x0) { std::multiset::insert(EVar2); } EVar1 = (EntityPtr)((int)EVar1 + 0x3c0); EVar2 = *(EntityPtr *)((int)local_14 + 0x3c0); if (*(EntityPtr *)EVar1 != (EntityPtr)0x0) { local_28 = EVar1; std::multiset::erase(&local_28); } *(EntityPtr *)EVar1 = EVar2; if (EVar2 != (EntityPtr)0x0) { std::multiset::insert(EVar1); } if (local_30 != (EntityPtr *)0x0) { do { (**(code **)(*(int *)*local_34 + 0xc))(); local_34 = local_34 + 1; } while (local_34 != local_30); } ExceptionList = local_10; return; } //@@ 005a7510 NpcHelper::visage_plasma_cap /* DB: compared with the live 903.20 count in NpcAI::ENTITY_VISAGE state 0x72 to choose Attack (spawn a plasma) over Attack3 */ undefined4 NpcHelper::visage_plasma_cap(void) { int iVar1; iVar1 = *(int *)((int)g_game->_room + 4); if ((iVar1 != 0) && (iVar1 = *(int *)(iVar1 + 0x10), iVar1 != 0)) { switch(*(undefined4 *)(iVar1 + 0x48)) { case 4: case 6: return 6; case 8: case 9: case 10: case 0xb: case 0xc: return 8; } } return 4; } //@@ 005a7570 FUN_005a7570 undefined1 FUN_005a7570(void) { int in_ECX; if (*(uint *)(in_ECX + 0xb64) < 0x71) { return 0x67 < *(uint *)(in_ECX + 0xb64); } return 2; } //@@ 005a7590 NpcHelper::visage_score_position /* DB: ? (float* pos) ECX = Visage npc: GetPlayerTarget, distance of pos to the target/_child (+0x3c0) and to the mask, branch on _state < 0x71; called twice from FUN_005a7920 (Visage new _targetPosition +0x334 picker over 20 random room positions, called 3x from NpcAI::ENTITY_VISAGE) to score candidates */ void NpcHelper::visage_score_position(float *param_1) { EntityPtr EVar1; Entity *pEVar2; Entity_NPC *in_ECX; float fVar3; float fVar4; float x; pEVar2 = Entity_NPC::GetPlayerTarget(in_ECX); EVar1 = in_ECX->_child; if (EVar1 == (EntityPtr)0x0) { fVar3 = (pEVar2->_pos).y - param_1[1]; fVar4 = (pEVar2->_pos).x - *param_1; sqrtf(fVar3 * fVar3 + fVar4 * fVar4); return; } if ((uint)in_ECX->_state < 0x71) { fVar3 = *(float *)((int)EVar1 + 0x340) - param_1[1]; fVar4 = *(float *)((int)EVar1 + 0x33c) - *param_1; fVar3 = fVar3 * fVar3 + fVar4 * fVar4; sqrtf(fVar3); sqrtf(fVar3); fVar3 = (pEVar2->_pos).y - param_1[1]; fVar4 = (pEVar2->_pos).x - *param_1; x = fVar3 * fVar3 + fVar4 * fVar4; sqrtf(x); fVar3 = (in_ECX->_pos).x - *param_1; fVar4 = (in_ECX->_pos).y - param_1[1]; sqrtf(x); sqrtf(fVar4 * fVar4 + fVar3 * fVar3); return; } fVar3 = *(float *)((int)EVar1 + 0x340) - param_1[1]; fVar4 = *(float *)((int)EVar1 + 0x33c) - *param_1; fVar3 = fVar3 * fVar3 + fVar4 * fVar4; sqrtf(fVar3); sqrtf(fVar3); fVar4 = (pEVar2->_pos).x - *param_1; fVar3 = (pEVar2->_pos).y - param_1[1]; fVar3 = fVar3 * fVar3 + fVar4 * fVar4; sqrtf(fVar3); sqrtf(fVar3); return; } //@@ 005a7920 NpcHelper::visage_pick_target_position /* DB: ? round 7 agent */ void NpcHelper::visage_pick_target_position(void) { Room *this; uint uVar1; int in_ECX; int iVar2; float in_XMM0_Da; float fVar3; float fVar4; float fVar5; float local_1c; Vector local_18; Vector local_10; *(undefined4 *)(in_ECX + 0x334) = *(undefined4 *)(in_ECX + 0x33c); *(undefined4 *)(in_ECX + 0x338) = *(undefined4 *)(in_ECX + 0x340); visage_score_position((float *)(in_ECX + 0x33c)); iVar2 = 0x14; local_1c = in_XMM0_Da; do { uVar1 = Random(); fVar3 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar3 = fVar3 + fVar3; uVar1 = Random(); fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 100.0; fVar5 = cos(fVar3); fVar5 = fVar5 * fVar4 + *(float *)(in_ECX + 0x33c); local_18.x = fVar5; fVar3 = sin(fVar3); this = g_game->_room; fVar3 = fVar3 * fVar4 + *(float *)(in_ECX + 0x340); local_18.y = fVar3; if (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48) - 9U < 4) { Room::GetClampedPositionImpl(this,&local_10,&local_18,10.0,10.0,10.0,10.0); if ((local_10.x == fVar5) && (fVar4 = local_10.y, local_10.y == fVar3)) { LAB_005a7ace: visage_score_position(&local_18); if (local_1c < fVar4) { *(float *)(in_ECX + 0x334) = fVar5; *(float *)(in_ECX + 0x338) = fVar3; local_1c = fVar4; } } } else if (((((this->_topLeftPos).x + 10.0 <= fVar5) && (fVar5 <= (this->_bottomRightPos).x - 10.0)) && ((this->_topLeftPos).y + 10.0 <= fVar3)) && (fVar4 = (this->_bottomRightPos).y - 10.0, fVar3 <= fVar4)) goto LAB_005a7ace; iVar2 = iVar2 + -1; if (iVar2 == 0) { return; } } while( true ); } //@@ 005a7b20 NpcAI::ENTITY_VISAGE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 903 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_VISAGE(Entity_NPC *npc) { float fVar1; Entity_NPC *pEVar2; byte bVar3; LayerState *layer; Vector *pVVar4; EntityPtr *refSlot; int *piVar5; ColorMod *particleColor; Vector *dirVec; void *pvVar6; int iVar7; Entity *pEVar8; Entity_Laser *laser; int iVar9; float *damageEvent; uint uVar10; Game *game; EntityPtr EVar11; uint uVar12; bool bVar13; bool bVar14; bool bVar15; Entity_NPC *laser; float fVar17; float fVar18; float fVar19; Vector scratchVec; Vector local_350; Vector VStack_348; Vector local_340; char isRewindActive; Vector VStack_334; Vector VStack_32c; Vector local_324; Vector local_31c; Vector VStack_314; Vector VStack_30c; Vector VStack_304; Vector aVStack_2fc [2]; Vector VStack_2ec; Vector VStack_2e4; EntityRef damageSource; ProjectileParams wallSlamParams; ProjectileParams chainBounceParams; ProjectileParams landingParams; ProjectileParams chainShotParams; uint stackCookie; float *damageEventsEnd; undefined4 flagsHigh; code *takeDamageFn; uVar12 = g_graphicsManager_flags; stackCookie = __security_cookie ^ (uint)&scratchVec; EVar11 = (EntityPtr)((int)npc->_updateTime - (int)npc->_prevUpdateTime); local_350.x = (float)npc; local_340.x = (float)EVar11; switch(npc->_state) { case 0: layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); iVar9 = 1; if ((uVar12 & 4) == 0) { iVar9 = 6; } layer->_blendMode[1] = iVar9; layer->_blendMode[0] = 0; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; npc->_state = 100; npc->_isInvicible = 1; Color::operator_assign((Color *)&npc->_splatColor,(ColorMod *)&DAT_00c34c70); flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; (npc->_v1).x = 0.0; Entity_NPC::ClearDequeRefs(npc); local_350.x = 0.0; std::deque::push_front(&local_350); (npc->_v1).y = 150.0; uVar12 = Random(); scratchVec.x = (npc->_pos).x + 0.0; scratchVec.y = (npc->_pos).y + 26.0; local_340.x = (float)Game::SpawnEx(g_game,0x387,1,&scratchVec,&g_vectorZero,(Entity *)0x0,0, uVar12,0); laser = (Entity_NPC *)((int)local_340.x + 0x3bc); if (*(EntityPtr *)((int)local_340.x + 0x3bc) != (EntityPtr)0x0) { local_350.x = (float)laser; std::multiset::erase(&local_350); } *(Entity_NPC **)laser = npc; std::multiset::insert(laser); refSlot = &npc->_child; if (npc->_child != (EntityPtr)0x0) { local_350.x = (float)refSlot; std::multiset::erase(&local_350); } *refSlot = (EntityPtr)local_340.x; std::multiset::insert(refSlot); NpcHelper::visage_spawn_chain(); break; case 100: ANM2::Play(&npc->_sprite,&DAT_00b601c4,0); PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); game = g_game; npc->_friction = npc->_friction * 0.8; pvVar6 = game->_room; iVar9 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); iVar7 = (int)(((npc->_pos).y - 120.0) / 40.0 + 0.5); if (((-1 < iVar9) && (iVar9 < *(int *)((int)pvVar6 + 0xc))) && ((-1 < iVar7 && ((((iVar7 < *(int *)((int)pvVar6 + 0x10) && (iVar9 = *(int *)((int)pvVar6 + 0xc) * iVar7 + iVar9, -1 < iVar9)) && (iVar9 < 0x1c0)) && (*(int *)((int)pvVar6 + iVar9 * 4 + 0x76c) < 0x3b7)))))) { *(undefined4 *)((int)pvVar6 + iVar9 * 4 + 0x76c) = 900; } if (((uint)npc->_state < 0x69) && (EVar11 = npc->_child, EVar11 != (EntityPtr)0x0)) { local_340.x = *(float *)((int)EVar11 + 0x340) - (npc->_pos).y; local_350.x = *(float *)((int)EVar11 + 0x33c) - (npc->_pos).x; local_324.x = local_340.x * local_340.x + local_350.x * local_350.x; fVar18 = sqrtf(local_324.x); laser = (Entity_NPC *)(fVar18 - (npc->_v1).y); VStack_314.x = (float)(Entity_NPC *)0x41700000; if ((float)laser <= 15.0) { VStack_314.x = (float)laser; } if (0.0 < VStack_314.x) { fVar18 = sqrtf(local_324.x); laser = (Entity_NPC *)local_350.x; EVar11 = (EntityPtr)local_340.x; if (0.0 < fVar18) { laser = (Entity_NPC *)(local_350.x * (1.0 / fVar18)); EVar11 = (EntityPtr)(local_340.x * (1.0 / fVar18)); } fVar18 = npc->_friction; if (fVar18 != 0.0) { fVar19 = npc->_speedMultiplier; (npc->_velocity).x = ((float)laser * VStack_314.x * 0.2 * fVar19) / fVar18 + (npc->_velocity).x; (npc->_velocity).y = ((float)EVar11 * VStack_314.x * 0.2 * fVar19) / fVar18 + (npc->_velocity).y; } } } break; case 0x65: ANM2::Play(&npc->_sprite,(byte *)"Unwind",0); bVar3 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b62850); if (bVar3 != 0) { EVar11 = npc->_child; (npc->_v1).y = (npc->_v1).y + 20.0; if (EVar11 != (EntityPtr)0x0) { fVar18 = *(float *)((int)EVar11 + 0x338); (npc->_velocity).x = (npc->_velocity).x - *(float *)((int)EVar11 + 0x334) * 0.8; (npc->_velocity).y = (npc->_velocity).y - fVar18 * 0.8; } } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 100; } break; case 0x66: ANM2::Play(&npc->_sprite,(byte *)"Rewind",0); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b62850); if (bVar3 != 0) { SoundEffects::Play(&g_manager->_sfxManager,0x1f7,0.8,2,1,1.0,0.0); } bVar3 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b62850); if (((bVar3 == 0) && ((npc->_sprite)._animState._animData != (void *)0x0)) && ((npc->_sprite)._animState._isPlaying != 0)) { fVar18 = (npc->_v1).y; } else { fVar18 = (npc->_v1).y - 30.0; if (fVar18 <= 35.0) { fVar18 = 35.0; } (npc->_v1).y = fVar18; } if (fVar18 < 40.0) { SFXManager::Stop(&g_manager->_sfxManager,0x1f7); EVar11 = npc->_child; (npc->_v1).y = 150.0; if (EVar11 != (EntityPtr)0x0) { *(undefined4 *)((int)EVar11 + 0xb64) = 100; } npc->_state = 100; } break; case 0x67: case 0x68: npc->_friction = npc->_friction * 0.1; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Break"); if (bVar3 != 0) { particleColor = (ColorMod *)Color::Color(0x3f800000); uVar12 = Random(); local_350.x = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10; uVar12 = Random(); Game::SpawnParticles (g_game,&npc->_pos,0x23,(uVar12 & 3) + 3,local_350.x + local_350.x + 3.0, particleColor,100000.0,0); Entity_NPC::PlaySound(npc,0x89,1.0,2,0,1.0); flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; npc->_state = 0x68; npc->_isInvicible = 0; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } npc->_state = 0x69; if (npc->_entityRef == (EntityPtr)0x0) { NpcHelper::visage_spawn_chain(); } break; case 0x69: ANM2::Play(&npc->_sprite,s_Idle2,0); if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown - (int)EVar11; } if ((npc->_child == (EntityPtr)0x0) || (*(int *)((int)npc->_child + 0xb64) == 0x6d)) { npc->_friction = npc->_friction * 0.8; PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); if ((npc->_projectileCooldown < 1) && (uVar12 = Random(), uVar12 % 0x28 == 0)) goto LAB_005a83be; } else { npc->_friction = npc->_friction * 0.8; Entity_NPC::GetPlayerTarget(npc); uVar12 = Random(); if ((uVar12 % 0x14 == 0) || ((0.0 < npc->_pendingDamage && (uVar12 = Random(), (uVar12 & 3) == 0)))) { NpcHelper::visage_pick_target_position(); } scratchVec.x = (npc->_targetPosition).x - (npc->_pos).x; scratchVec.y = (npc->_targetPosition).y - (npc->_pos).y; local_350.x = scratchVec.y; local_324.x = scratchVec.x; dirVec = Vector::Normalized(&scratchVec,&VStack_348); VStack_314.x = 2.0; fVar19 = sqrtf(local_350.x * local_350.x + local_324.x * local_324.x); fVar18 = dirVec->y; local_350.x = fVar19 * 0.1; pVVar4 = &VStack_314; if ((float)(fVar19 * 0.1) <= 2.0) { pVVar4 = &local_350; } fVar19 = pVVar4->x; (npc->_velocity).x = pVVar4->x * dirVec->x + (npc->_velocity).x; (npc->_velocity).y = fVar18 * fVar19 + (npc->_velocity).y; if (((npc->_projectileCooldown < 1) && (uVar12 = Random(), uVar12 % 0x14 == 0)) && (fVar18 = (npc->_pos).y - *(float *)((int)npc->_child + 0x340), fVar19 = (npc->_pos).x - *(float *)((int)npc->_child + 0x33c), fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19), 256.0 < fVar18)) { LAB_005a83be: if (npc->_entityRef != (EntityPtr)0x0) { npc->_state = 0x6a; } } } bVar3 = Vector::operator_eq(&npc->_v2,&g_vectorZero); if ((bVar3 != 0) || (fVar18 = (npc->_v2).y - (npc->_pos).y, fVar19 = (npc->_v2).x - (npc->_pos).x, fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19), 80.0 < fVar18)) { (npc->_v2).x = (npc->_pos).x; (npc->_v2).y = (npc->_pos).y; npc->_projectileDelay = 0; } else { npc->_projectileDelay = npc->_projectileDelay + (int)local_340.x; } break; case 0x6a: fVar18 = npc->_friction; (npc->_v1).x = 0.0; npc->_friction = fVar18 * 0.5; ANM2::Play(&npc->_sprite,(byte *)"Unwind2",0); if (npc->_entityRef == (EntityPtr)0x0) { npc->_i1 = -1; } else { bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,&DAT_00b62850); if (bVar3 != 0) { if ((npc->_child == (EntityPtr)0x0) || ((*(int *)((int)npc->_child + 0xb64) == 0x6d && (uVar12 = Random(), (uVar12 & 1) != 0)))) { EVar11 = (EntityPtr)Entity_NPC::GetPlayerTarget(npc); VStack_32c.x = *(float *)((int)EVar11 + 0x364); VStack_334.x = ((Vector *)((int)EVar11 + 0x360))->x; fVar18 = (npc->_pos).y - *(float *)((int)EVar11 + 0x340); fVar19 = (npc->_pos).x - ((Vector *)((int)EVar11 + 0x33c))->x; fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); fVar19 = VStack_334.x * fVar18 * 0.06; fVar18 = VStack_32c.x * fVar18 * 0.06; } else { EVar11 = npc->_child; VStack_32c.x = *(float *)((int)EVar11 + 0x364); VStack_334.x = ((Vector *)((int)EVar11 + 0x360))->x; fVar18 = (npc->_pos).y - *(float *)((int)EVar11 + 0x340); fVar19 = (npc->_pos).x - ((Vector *)((int)EVar11 + 0x33c))->x; fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); fVar19 = VStack_334.x * fVar18 * 0.01; fVar18 = VStack_32c.x * fVar18 * 0.01; } fVar17 = *(float *)((int)EVar11 + 0x340); fVar1 = ((Vector *)((int)EVar11 + 0x33c))->x; EVar11 = npc->_entityRef; iVar9 = *(int *)((int)EVar11 + 0x3c0); if ((((iVar9 == 0) || (*(int *)(iVar9 + 0x28) != 0x387)) || (*(int *)(iVar9 + 0x2c) != 10)) && (*(int *)((int)EVar11 + 0xb64) == 4)) { *(undefined4 *)((int)EVar11 + 0xb64) = 5; VStack_334.x = (fVar19 + fVar1) - *(float *)((int)EVar11 + 0x33c); VStack_32c.x = (fVar18 + fVar17) - *(float *)((int)EVar11 + 0x340); fVar18 = sqrtf(VStack_334.x * VStack_334.x + VStack_32c.x * VStack_32c.x); if (fVar18 <= 0.0) { fVar19 = VStack_334.x; fVar18 = VStack_32c.x; } else { fVar19 = VStack_334.x * (1.0 / fVar18); fVar18 = VStack_32c.x * (1.0 / fVar18); } *(float *)((int)EVar11 + 0x334) = fVar19; *(float *)((int)EVar11 + 0x338) = fVar18; SoundEffects::Play(&g_manager->_sfxManager,0x1f7,0.8,2,1,1.0,0.0); } npc->_stateFrame = 0; } EVar11 = npc->_entityRef; iVar9 = *(int *)((int)EVar11 + 0xb64); if ((iVar9 != 6) && (iVar9 != 7)) { if ((iVar9 == 5) && (EVar11 = npc->_child, EVar11 != (EntityPtr)0x0)) { *(float *)((int)EVar11 + 0x36c) = *(float *)((int)EVar11 + 0x36c) * 0.6; } break; } fVar18 = (npc->_pos).y - *(float *)((int)EVar11 + 0x340); fVar19 = (npc->_pos).x - *(float *)((int)EVar11 + 0x33c); fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); (npc->_v1).y = fVar18; laser = *(Entity_NPC **)((int)EVar11 + 0x3c4); local_350.x = (float)laser; if (((laser != (Entity_NPC *)0x0) && (laser->_type == 0x387)) && (laser->_variant == 1)) { local_324.x = (float)Entity_NPC::GetPlayerTarget(npc); fVar18 = (npc->_pos).x; VStack_348.y = (npc->_pos).y; scratchVec.x = (((Entity *)local_324.x)->_pos).x - fVar18; scratchVec.y = (((Entity *)local_324.x)->_pos).y - VStack_348.y; VStack_348.x = (laser->_pos).x - fVar18; VStack_348.y = (laser->_pos).y - VStack_348.y; pVVar4 = Vector::Normalized(&scratchVec,&local_31c); dirVec = Vector::Normalized(&VStack_348,&VStack_314); local_340.x = pVVar4->y * dirVec->y + dirVec->x * pVVar4->x; if ((npc->_projectileDelay < 0x5b) && (uVar12 = Random(), fVar18 = local_350.x, uVar12 % 7 != 0)) { if ((*(int *)((int)local_350.x + 0xb64) == 0x6d) || ((local_340.x <= 0.9 && ((local_340.x <= 0.4 || (uVar12 = Random(), (uVar12 & 3) != 0)))))) { scratchVec.x = ((Vector *)((int)fVar18 + 0x33c))->x - (npc->_pos).x; scratchVec.y = ((Vector *)((int)fVar18 + 0x33c))->y - (npc->_pos).y; pVVar4 = Vector::Normalized(&scratchVec,&VStack_348); local_340.x = cos(1.5707964); fVar18 = sin(1.5707964); if ((local_340.x * pVVar4->x - fVar18 * pVVar4->y) * (((Vector *)((int)local_324.x + 0x33c))->x - ((Vector *)((int)local_350.x + 0x33c))->x) + (local_340.x * pVVar4->y + fVar18 * pVVar4->x) * (((Vector *)((int)local_324.x + 0x33c))->y - ((Vector *)((int)local_350.x + 0x33c))->y) <= 0.0) { fVar18 = -9.0; } else { fVar18 = 9.0; } (npc->_v1).x = fVar18; npc->_i1 = 0; npc->_state = 0x6b; } else { npc->_i1 = 1; npc->_state = 0x6b; } } else { npc->_i1 = 2; npc->_state = 0x6b; } break; } } npc->_state = 0x6b; break; case 0x6b: ANM2::Play(&npc->_sprite,(byte *)"Rewind2",0); bVar3 = ANM2::WasEventTriggered(&npc->_sprite,&DAT_00b62850); if (((bVar3 != 0) || ((npc->_sprite)._animState._animData == (void *)0x0)) || (isRewindActive = '\0', (npc->_sprite)._animState._isPlaying == 0)) { isRewindActive = '\x01'; npc->_stateFrame = npc->_stateFrame + (int)EVar11; } EVar11 = npc->_entityRef; if (EVar11 != (EntityPtr)0x0) { if (*(int *)((int)EVar11 + 0xb64) == 6) { scratchVec.x = *(float *)((int)EVar11 + 0x33c) - (npc->_pos).x; scratchVec.y = *(float *)((int)EVar11 + 0x340) - (npc->_pos).y; if (npc->_collidesWithGrid != 0) { Entity_NPC::PlaySound(npc,0x34,1.0,10,0,1.0); Game::ShakeScreen(g_game,0xf); scratchVec.x = (npc->_gridCollisionNormal).x * -1.0; scratchVec.y = (npc->_gridCollisionNormal).y * -1.0; NpcHelper::visage_spawn_particles(); ProjectileParams::ProjectileParams(&wallSlamParams); wallSlamParams.HeightModifier = wallSlamParams.HeightModifier - 10.0; wallSlamParams.Variant = 9; uVar12 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar12 & 1) + 5,&g_vectorZero,0.0,&wallSlamParams); uVar12 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar12 & 1) + 5,&g_vectorZero,0.0,&wallSlamParams); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; FUN_005ad1c0(); NpcHelper::visage_pick_target_position(); break; } if (isRewindActive != '\0') { pVVar4 = Vector::Normalized(&scratchVec,&local_350); fVar18 = npc->_speedMultiplier; fVar19 = pVVar4->y; (npc->_velocity).x = pVVar4->x * 8.0 * fVar18 + (npc->_velocity).x; (npc->_velocity).y = fVar19 * 8.0 * fVar18 + (npc->_velocity).y; } iVar9 = npc->_stateFrame; bVar15 = SBORROW4(iVar9,0x5a); bVar14 = iVar9 + -0x5a < 0; bVar13 = iVar9 == 0x5a; goto LAB_005a8ba1; } if (*(int *)((int)EVar11 + 0xb64) != 7) goto LAB_005a98f3; npc->_friction = npc->_friction * 0.5; laser = *(Entity_NPC **)((int)EVar11 + 0x3c4); VStack_314.x = (float)laser; if ((laser == (Entity_NPC *)0x0) || (laser->_dead != 0)) { LAB_005a9793: Game::ShakeScreen(g_game,8); if ((laser != (Entity_NPC *)0x0) && (laser->_dead == 0)) { iVar9 = laser->_type; if (iVar9 == 1) { takeDamageFn = *(code **)(*(int *)laser + 0x20); EntityRef::constructor(&damageSource,(Entity *)npc); (*takeDamageFn)(0x40000000,0,0,&damageSource,0x1e); laser = (Entity_NPC *)VStack_314.x; } else if (iVar9 == 4) { laser->_stateFrame = 1; (laser->_pathfinder)._entity = (void *)0x1; } else if ((iVar9 == 0x387) && (laser->_variant == 1)) { if ((npc->_i1 == 1) && (laser->_state != 0x6d)) { laser->_state = 0x6c; refSlot = (EntityPtr *)FUN_0044bc90(0); EntityPtr::SetReference(refSlot,(Entity *)laser); npc->_state = 0x6d; } else if (npc->_i1 == 2) { if (laser->_state == 0x6b) { laser->_state = 0x6a; } pEVar8 = Entity_NPC::GetPlayerTarget(npc); fVar18 = (pEVar8->_pos).y; (npc->_targetPosition).x = (pEVar8->_pos).x; (npc->_targetPosition).y = fVar18; npc->_state = 0x6e; } else if (laser->_state == 0x6b) { laser->_state = 0x6a; } } (laser->_velocity).x = g_vectorZero.x; (laser->_velocity).y = g_vectorZero.y; FUN_005ad1c0(); break; } } else { VStack_334.x = (npc->_pos).x; VStack_32c.x = (npc->_pos).y; fVar19 = (laser->_pos).x - VStack_334.x; fVar18 = (laser->_pos).y - VStack_32c.x; fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); if (fVar18 <= 40.0) goto LAB_005a9793; scratchVec.x = VStack_334.x - (laser->_pos).x; scratchVec.y = VStack_32c.x - (laser->_pos).y; VStack_334.x = scratchVec.x; VStack_32c.x = scratchVec.y; if (isRewindActive == '\0') { fVar18 = Math::timescale_factor(0.5,npc->_speedMultiplier); local_350.x = fVar18 * (laser->_velocity).x; (laser->_velocity).x = local_350.x; (laser->_velocity).y = fVar18 * (laser->_velocity).y; dirVec = Vector::Normalized(&scratchVec,aVStack_2fc); fVar18 = sqrtf(VStack_32c.x * VStack_32c.x + VStack_334.x * VStack_334.x); VStack_348.x = fVar18 - (npc->_v1).y; fVar18 = dirVec->y; local_31c.x = 0.0; pVVar4 = &VStack_348; if (VStack_348.x <= 0.0) { pVVar4 = &local_31c; } fVar19 = pVVar4->x; fVar17 = *(float *)((int)VStack_314.x + 0x39c); ((Vector *)((int)VStack_314.x + 0x360))->x = fVar19 * dirVec->x * fVar17 + local_350.x; ((Vector *)((int)VStack_314.x + 0x360))->y = fVar19 * fVar18 * fVar17 + ((Vector *)((int)VStack_314.x + 0x360))->y; break; } if (laser->_type == 1) { uVar12 = Random(); Entity_NPC::MakeSplat (laser,(float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); fVar18 = npc->_speedMultiplier; if (fVar18 == 1.0) { local_350.x = 0.5; } else { local_350.x = 0.5 / ((fVar18 + 0.5) - fVar18 * 0.5); } pVVar4 = Vector::Normalized(&scratchVec,&local_340); fVar18 = npc->_speedMultiplier; fVar19 = pVVar4->y; (laser->_velocity).x = pVVar4->x * 22.0 * fVar18 + (laser->_velocity).x * local_350.x; (laser->_velocity).y = fVar19 * 22.0 * fVar18 + (laser->_velocity).y * local_350.x; LAB_005a8d84: iVar9 = npc->_stateFrame; bVar15 = SBORROW4(iVar9,0x3c); bVar14 = iVar9 + -0x3c < 0; bVar13 = iVar9 == 0x3c; } else if ((laser->_type == 0x387) && (laser->_variant == 1)) { fVar18 = npc->_speedMultiplier; fVar19 = 0.9; if ((npc->_v1).x != 0.0) { fVar17 = (laser->_velocity).x; fVar1 = (laser->_velocity).y; if (npc->_stateFrame < 0x3d) { if (fVar18 != 1.0) { fVar19 = 0.9 / ((fVar18 + 0.9) - fVar18 * 0.9); } local_350.x = fVar17 * fVar19; (laser->_velocity).x = local_350.x; (laser->_velocity).y = fVar1 * fVar19; pVVar4 = Vector::Normalized(&scratchVec,&VStack_30c); VStack_348.x = pVVar4->x; local_31c.x = pVVar4->y; local_340.x = -VStack_334.x; local_340.y = -VStack_32c.x; VStack_334.x = local_340.x; VStack_32c.x = local_340.y; pVVar4 = Vector::Normalized(&local_340,&VStack_304); local_324.x = cos(1.5707964); local_340.x = sin(1.5707964); laser = (Entity_NPC *)VStack_314.x; fVar18 = pVVar4->y; fVar19 = pVVar4->x; fVar17 = (npc->_v1).x; fVar1 = *(float *)((int)VStack_314.x + 0x39c); ((Vector *)((int)VStack_314.x + 0x360))->x = ((local_324.x * fVar19 - local_340.x * fVar18) * fVar17 + VStack_348.x * 9.0) * fVar1 + local_350.x; ((Vector *)((int)VStack_314.x + 0x360))->y = ((local_324.x * fVar18 + local_340.x * fVar19) * fVar17 + local_31c.x * 9.0) * fVar1 + ((Vector *)((int)VStack_314.x + 0x360))->y; iVar9 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0); if ((iVar9 != 0) && (*(int *)((int)laser + 0xb64) != 0x6d)) { ProjectileParams::ProjectileParams(&chainShotParams); chainShotParams.HeightModifier = chainShotParams.HeightModifier - 10.0; pVVar4 = Vector::Normalized(&scratchVec,&VStack_30c); VStack_348.y = pVVar4->y * -10.0; VStack_348.x = pVVar4->x * -10.0; Entity_NPC::FireProjectiles (laser,(Vector *)((int)laser + 0x33c),&VStack_348,0,&chainShotParams); Entity_NPC::PlaySound(npc,0xb2,1.0,2,0,1.0); } if (0x1e < npc->_stateFrame) { pVVar4 = Vector::Normalized(&scratchVec,&VStack_30c); VStack_348.x = pVVar4->x; local_31c.x = pVVar4->y; scratchVec.x = VStack_334.x; scratchVec.y = VStack_32c.x; pVVar4 = Vector::Normalized(&scratchVec,&VStack_304); fVar18 = (npc->_v1).x; scratchVec.y = (pVVar4->y * local_324.x + pVVar4->x * local_340.x) * 3.0 * fVar18 - local_31c.x * 9.0; scratchVec.x = (pVVar4->x * local_324.x - pVVar4->y * local_340.x) * 3.0 * fVar18 - VStack_348.x * 9.0; Vector::Normalized(&scratchVec,&VStack_348); pEVar8 = Entity_NPC::GetPlayerTarget(npc); scratchVec.x = (pEVar8->_pos).x - (npc->_pos).x; scratchVec.y = (pEVar8->_pos).y - (npc->_pos).y; pVVar4 = Vector::Normalized(&scratchVec,&VStack_2ec); if (0.85 < VStack_348.y * pVVar4->y + VStack_348.x * pVVar4->x) { npc->_stateFrame = 0x3c; } } } else { if (fVar18 != 1.0) { fVar19 = 0.9 / ((fVar18 + 0.9) - fVar18 * 0.9); } local_350.x = fVar17 * fVar19; (laser->_velocity).x = local_350.x; (laser->_velocity).y = fVar1 * fVar19; pVVar4 = Vector::Normalized(&scratchVec,&VStack_304); local_31c.x = pVVar4->x; VStack_348.x = pVVar4->y; scratchVec.x = -VStack_334.x; scratchVec.y = -VStack_32c.x; VStack_334.x = scratchVec.x; VStack_32c.x = scratchVec.y; pVVar4 = Vector::Normalized(&scratchVec,&VStack_30c); local_324.x = cos(1.5707964); local_340.x = sin(1.5707964); fVar18 = pVVar4->x; fVar19 = pVVar4->y; fVar17 = (npc->_v1).x; fVar1 = *(float *)((int)VStack_314.x + 0x39c); ((Vector *)((int)VStack_314.x + 0x360))->x = ((local_324.x * fVar18 - local_340.x * fVar19) * fVar17 - local_31c.x * 9.0) * fVar1 + local_350.x; ((Vector *)((int)VStack_314.x + 0x360))->y = ((local_324.x * fVar19 + local_340.x * fVar18) * fVar17 - VStack_348.x * 9.0) * fVar1 + ((Vector *)((int)VStack_314.x + 0x360))->y; laser = (Entity_NPC *)VStack_314.x; } if (laser->_collidesWithGrid == 0) break; scratchVec.x = VStack_334.x; scratchVec.y = VStack_32c.x; pVVar4 = Vector::Normalized(&scratchVec,&VStack_348); fVar17 = -(npc->_v1).x; fVar18 = pVVar4->x; fVar19 = pVVar4->y; (laser->_velocity).x = (fVar18 * local_324.x - fVar19 * local_340.x) * fVar17; (laser->_velocity).y = (fVar19 * local_324.x + fVar18 * local_340.x) * fVar17; Entity_NPC::PlaySound(npc,0x34,1.0,10,0,1.0); Game::ShakeScreen(g_game,0xf); ProjectileParams::ProjectileParams(&chainBounceParams); chainBounceParams.HeightModifier = chainBounceParams.HeightModifier - 10.0; chainBounceParams.Variant = 9; if (laser->_state == 0x6d) { uVar12 = Random(); iVar9 = (uVar12 & 1) + 6; } else { uVar12 = Random(); iVar9 = (uVar12 & 3) + 10; } Entity_NPC::FireBossProjectiles(laser,iVar9,&g_vectorZero,0.0,&chainBounceParams); fVar18 = (npc->_pos).y - *(float *)((int)npc->_entityRef + 0x340); fVar19 = (npc->_pos).x - *(float *)((int)npc->_entityRef + 0x33c); fVar18 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); (npc->_v1).y = fVar18; bVar3 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Rewind2",1); if (bVar3 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; laser = (Entity_NPC *)VStack_314.x; } if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,4.0); } scratchVec.x = (laser->_gridCollisionNormal).x * -1.0; scratchVec.y = (laser->_gridCollisionNormal).y * -1.0; NpcHelper::visage_spawn_particles(); (npc->_v1).x = 0.0; goto LAB_005a94a3; } if (fVar18 != 1.0) { fVar19 = 0.9 / ((fVar18 + 0.9) - fVar18 * 0.9); } VStack_348.x = fVar19 * (laser->_velocity).x; (laser->_velocity).x = VStack_348.x; (laser->_velocity).y = fVar19 * (laser->_velocity).y; pVVar4 = Vector::Normalized(&scratchVec,&local_324); fVar18 = laser->_speedMultiplier; fVar19 = pVVar4->y; (laser->_velocity).x = pVVar4->x * 15.0 * fVar18 + VStack_348.x; (laser->_velocity).y = fVar19 * 15.0 * fVar18 + (laser->_velocity).y; if (npc->_i1 != 1) goto LAB_005a8d84; pVVar4 = Vector::Normalized(&scratchVec,&VStack_334); fVar18 = pVVar4->y; (npc->_velocity).x = (npc->_velocity).x - pVVar4->x * 15.0; (npc->_velocity).y = (npc->_velocity).y - fVar18 * 15.0; iVar9 = npc->_stateFrame; bVar15 = SBORROW4(iVar9,0x3c); bVar14 = iVar9 + -0x3c < 0; bVar13 = iVar9 == 0x3c; } else { fVar18 = Math::timescale_factor(0.9,npc->_speedMultiplier); VStack_348.x = fVar18 * (laser->_velocity).x; (laser->_velocity).x = VStack_348.x; (laser->_velocity).y = fVar18 * (laser->_velocity).y; pVVar4 = Vector::Normalized(&scratchVec,&VStack_32c); fVar18 = laser->_speedMultiplier; fVar19 = pVVar4->y; (laser->_velocity).x = pVVar4->x * 15.0 * fVar18 + VStack_348.x; (laser->_velocity).y = fVar19 * 15.0 * fVar18 + (laser->_velocity).y; iVar9 = npc->_stateFrame; bVar15 = SBORROW4(iVar9,0x3c); bVar14 = iVar9 + -0x3c < 0; bVar13 = iVar9 == 0x3c; } LAB_005a8ba1: if (bVar13 || bVar15 != bVar14) break; } FUN_005ad1c0(); break; } LAB_005a98f3: EVar11 = npc->_child; if ((EVar11 != (EntityPtr)0x0) && (*(int *)((int)EVar11 + 0xb64) == 0x6b)) { *(undefined4 *)((int)EVar11 + 0xb64) = 0x6a; } goto LAB_005a9910; case 0x6d: ANM2::Play(&npc->_sprite,s_Idle2,0); piVar5 = (int *)FUN_0044bc90(0); iVar9 = *piVar5; if ((iVar9 != 0) && (*(int *)(iVar9 + 0xb64) == 0x6c)) { Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,*(int *)(iVar9 + 0xbc0)); VStack_348.x = (float)Entity_NPC::GetPlayerTarget(npc); local_350.x = cos(1.5707964); fVar18 = sin(1.5707964); local_31c.x = local_350.x * scratchVec.x - fVar18 * scratchVec.y; local_350.x = local_350.x * scratchVec.y + fVar18 * scratchVec.x; bVar3 = ANM2::WasEventTriggered((ANM2 *)(iVar9 + 0x48),(byte *)"Break"); fVar18 = (((Vector *)((int)VStack_348.x + 0x33c))->y - (npc->_pos).y) * local_350.x + (((Vector *)((int)VStack_348.x + 0x33c))->x - (npc->_pos).x) * local_31c.x; if (fVar18 <= 10.0) { if (fVar18 < -10.0) { if (bVar3 == 0) { fVar18 = 0.7; } else { fVar18 = 0.015; } fVar18 = -fVar18; goto LAB_005a9a6a; } } else { if (bVar3 == 0) { fVar18 = 0.7; } else { fVar18 = 0.015; } LAB_005a9a6a: fVar19 = npc->_speedMultiplier; (npc->_velocity).y = fVar18 * local_350.x * fVar19 + (npc->_velocity).y; (npc->_velocity).x = fVar18 * local_31c.x * fVar19 + (npc->_velocity).x; } if (bVar3 == 0) { if (0.0 < (((Vector *)((int)VStack_348.x + 0x33c))->y - (npc->_pos).y) * scratchVec.y + (((Vector *)((int)VStack_348.x + 0x33c))->x - (npc->_pos).x) * scratchVec.x) { fVar18 = npc->_speedMultiplier; npc->_friction = npc->_friction * 0.8; (npc->_velocity).x = scratchVec.x * 0.5 * fVar18 + (npc->_velocity).x; fVar18 = scratchVec.y * 0.5 * fVar18 + (npc->_velocity).y; goto LAB_005a9ba6; } } else { fVar18 = npc->_speedMultiplier; npc->_friction = npc->_friction * 0.95; (npc->_velocity).x = (npc->_velocity).x - scratchVec.x * 0.5 * fVar18; fVar18 = (npc->_velocity).y - scratchVec.y * 0.5 * fVar18; LAB_005a9ba6: (npc->_velocity).y = fVar18; } fVar18 = (npc->_pos).y; *(float *)(iVar9 + 0x33c) = scratchVec.x * 40.0 + (npc->_pos).x + 0.0; *(float *)(iVar9 + 0x340) = scratchVec.y * 40.0 + fVar18 + 1.0; *(float *)(iVar9 + 0x360) = (npc->_velocity).x; *(float *)(iVar9 + 0x364) = (npc->_velocity).y; break; } goto LAB_005a9910; case 0x6e: ANM2::Play(&npc->_sprite,&DAT_00b1e0e4,0); npc->_friction = npc->_friction * 0.6; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { npc->_entityCollisionClass = 0; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; npc->_state = 0x6f; } break; case 0x6f: ANM2::Play(&npc->_sprite,(byte *)"JumpDown",0); npc->_friction = npc->_friction * 0.6; bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { npc->_entityCollisionClass = 4; Entity_NPC::PlaySound(npc,0x34,2.0,2,0,1.0); Game::ShakeScreen(g_game,0xf); ProjectileParams::ProjectileParams(&landingParams); landingParams.HeightModifier = landingParams.HeightModifier - 10.0; landingParams.Variant = 9; uVar12 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar12 & 3) + 10,&g_vectorZero,0.0,&landingParams); local_350.x = 0.0; do { uVar12 = Random(); local_31c.x = (float)Game::SpawnEx(g_game,1000,0x48,&npc->_pos,&g_vectorZero,(Entity *)npc,1 ,uVar12,0); refSlot = &((Entity *)local_31c.x)->_parent; if (((Entity *)local_31c.x)->_parent != (EntityPtr)0x0) { VStack_348.x = (float)refSlot; std::multiset::erase(&VStack_348); } *refSlot = (EntityPtr)npc; std::multiset::insert(refSlot); iVar9 = (int)local_350.x + 1; *(float *)((((Entity *)((int)local_31c.x + 0x40c))->_sprite)._animDefaultName._buf + 8) = (float)(int)local_350.x * 90.0 + 45.0; local_350.x = (float)iVar9; } while (iVar9 < 4); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; LAB_005a9910: npc->_state = 0x69; uVar12 = Random(); npc->_projectileCooldown = uVar12 % 0x1e + 0xf; break; case 0x70: case 0x71: npc->_friction = npc->_friction * 0.1; ANM2::Play(&npc->_sprite,(byte *)"Transition2",0); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Break"); if (bVar3 != 0) { particleColor = (ColorMod *)Color::Color(0x3f800000); uVar12 = Random(); VStack_348.x = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 4.0; uVar12 = Random(); pVVar4 = (Vector *)((int)local_350.x + 0x33c); Game::SpawnParticles (g_game,pVVar4,0x23,(uVar12 & 7) + 8,VStack_348.x,particleColor,100000.0,0); uVar12 = Random(); Game::SpawnEx(g_game,1000,0xf,pVVar4,&g_vectorZero,(Entity *)0x0,0,uVar12,0); npc = (Entity_NPC *)local_350.x; Entity_NPC::PlaySound((Entity_NPC *)local_350.x,0x89,1.0,2,0,1.0); flagsHigh = *(undefined4 *)((int)((int)npc + 0x168) + 4); *(uint *)((int)npc + 0x168) = (uint)*(qword *)((int)npc + 0x168) & 0xffffffee; *(int *)((int)npc + 0xb64) = 0x71; *(byte *)((int)npc + 0x3b0) = 0; *(undefined4 *)((int)((int)npc + 0x168) + 4) = flagsHigh; } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 0x72; } break; case 0x72: ANM2::Play(&npc->_sprite,&DAT_00b1d43c,0); if ((npc->_child == (EntityPtr)0x0) || (*(int *)((int)npc->_child + 0xb64) == 0x6d)) { npc->_friction = npc->_friction * 0.75; PathFinder::MoveRandomlyBoss((PathFinder *)&npc->_pathfinder,0); } else { npc->_friction = npc->_friction * 0.75; Entity_NPC::GetPlayerTarget(npc); uVar12 = Random(); if ((uVar12 % 0x14 == 0) || ((0.0 < npc->_pendingDamage && (uVar12 = Random(), (uVar12 & 3) == 0)))) { NpcHelper::visage_pick_target_position(); } scratchVec.x = (npc->_targetPosition).x - (npc->_pos).x; scratchVec.y = (npc->_targetPosition).y - (npc->_pos).y; VStack_348.x = scratchVec.y; local_31c.x = scratchVec.x; dirVec = Vector::Normalized(&scratchVec,&VStack_2e4); local_350.x = 3.0; fVar17 = sqrtf(VStack_348.x * VStack_348.x + local_31c.x * local_31c.x); fVar18 = dirVec->y; fVar19 = npc->_speedMultiplier; VStack_348.x = fVar17 * 0.1; pVVar4 = &local_350; if ((float)(fVar17 * 0.1) <= 3.0) { pVVar4 = &VStack_348; } fVar17 = pVVar4->x; (npc->_velocity).x = pVVar4->x * dirVec->x * fVar19 + (npc->_velocity).x; (npc->_velocity).y = fVar18 * fVar17 * fVar19 + (npc->_velocity).y; } iVar9 = npc->_projectileCooldown; if (0 < iVar9) { iVar9 = iVar9 + -1; npc->_projectileCooldown = iVar9; } if ((iVar9 != 0) || (uVar12 = Random(), uVar12 % 0xf != 0)) break; pvVar6 = Entity_NPC::QueryNPCsType(aVStack_2fc,0x387,0x14); iVar9 = *(int *)((int)pvVar6 + 0xc); EntityList_Query::~EntityList_Query(aVStack_2fc); if (iVar9 < 3) { if (0 < iVar9) goto LAB_005aa16b; } else { uVar12 = Random(); if ((uVar12 & 1) == 0) { npc->_state = 0x76; ANM2::Play(&npc->_sprite,(byte *)"Attack4",0); npc->_projectileCooldown = 0; LAB_005a94a3: npc->_stateFrame = 0; break; } LAB_005aa16b: uVar12 = Random(); if ((uVar12 % 3 == 0) || (iVar7 = NpcHelper::visage_plasma_cap(), iVar7 <= iVar9)) { npc->_state = 0x74; ANM2::Play(&npc->_sprite,&DAT_00b1d2e4,0); npc->_projectileCooldown = 0; break; } } iVar7 = NpcHelper::visage_plasma_cap(); if (iVar9 < iVar7) { npc->_state = 0x73; npc->_i1 = 0; if (((npc->_child != (EntityPtr)0x0) && (*(int *)((int)npc->_child + 0xb64) == 0x6d)) && ((iVar9 == 0 || (uVar12 = Random(), (uVar12 & 1) == 0)))) { npc->_i1 = 1; } } break; case 0x73: ANM2::Play(&npc->_sprite,(byte *)"Attack",0); bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { uVar12 = Random(); local_350.x = (((float)(uVar12 & 3) + 0.0) * 90.0 + 45.0) * 0.017453292; uVar12 = Random(); fVar18 = cos(local_350.x); scratchVec.x = fVar18 * 10.0; fVar18 = sin(local_350.x); scratchVec.y = fVar18 * 10.0; pEVar8 = Game::Spawn(g_game,0x387,0x14,&npc->_pos,&scratchVec,(Entity *)npc,0,uVar12); flagsHigh = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = flagsHigh; Entity::SetParent(pEVar8,(Entity *)npc); if ((npc->_i1 != 0) && (npc->_child != (EntityPtr)0x0)) { Entity::SetTarget(pEVar8,(Entity *)npc->_child); } Entity_NPC::PlaySound(npc,0x1d7,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0xd5,1.0,2,0,1.0); } goto LAB_005aa33f; case 0x74: npc->_friction = npc->_friction * 0.7; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&npc->_sprite,(byte *)"Attack3Loop",0); } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x10b,0.5,2,0,1.0); Entity_NPC::PlaySound(npc,0x48,1.0,2,0,1.0); local_350.x = 0.0; do { VStack_348.x = (float)(int)local_350.x * 22.5 * 0.017453292; fVar18 = cos(VStack_348.x); scratchVec.x = fVar18 * 10.0; fVar18 = sin(VStack_348.x); scratchVec.y = fVar18 * 10.0; uVar12 = Random(); pEVar8 = Game::SpawnEx(g_game,9,0,&npc->_pos,&scratchVec,(Entity *)npc,1,uVar12,0); EVar11 = pEVar8->_parent; *(undefined4 *)&pEVar8[1].field_0x4 = 0xc1a00000; pEVar8[1]._damageEvents._begin = (void *)0x0; pEVar8[1]._pendingDamage = 1.0; pEVar8[1]._variant = 0x2000; pEVar8[1]._subtype = 0; if (EVar11 != (EntityPtr)0x0) { VStack_348.x = (float)&pEVar8->_parent; std::multiset::erase(&VStack_348); } pEVar8->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar8->_parent); fVar18 = (npc->_pos).y; iVar9 = *(int *)pEVar8; (pEVar8->_targetPosition).x = (npc->_pos).x; (pEVar8->_targetPosition).y = fVar18; (**(code **)(iVar9 + 0xc))(); local_350.x = (float)((int)local_350.x + 1); } while ((int)local_350.x < 0x10); } npc->_projectileCooldown = npc->_projectileCooldown + 1; game = g_game; if (0x3c < npc->_projectileCooldown) { uVar12 = 0; npc->_state = 0x75; pvVar6 = game->_room; if (*(int *)((int)pvVar6 + 0x1264) != 0) { do { iVar9 = *(int *)(*(int *)((int)pvVar6 + 0x125c) + uVar12 * 4); if (((*(int *)(iVar9 + 0x28) == 9) && (*(Entity_NPC **)(iVar9 + 0x3bc) == npc)) && (*(int *)(iVar9 + 0x30) == 1)) { *(undefined4 *)(iVar9 + 0x30) = 2; } uVar12 = uVar12 + 1; } while (uVar12 < *(uint *)((int)pvVar6 + 0x1264)); } } break; case 0x75: npc->_friction = npc->_friction * 0.7; ANM2::Play(&npc->_sprite,(byte *)"Attack3End",0); LAB_005aa33f: if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 0x72; uVar12 = Random(); npc->_projectileCooldown = uVar12 % 0x1e + 0x1e; } break; case 0x76: npc->_friction = npc->_friction * 0.7; if ((3 < npc->_projectileCooldown) && (bVar3 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Break"), bVar3 == 0)) { if ((npc->_projectileCooldown == 4) && ((npc->_child != (EntityPtr)0x0 && (*(int *)((int)npc->_child + 0xb64) != 0x6d)))) { FUN_005ab3e0(); uVar12 = Random(); pEVar8 = Game::SpawnEx(g_game,0x387,0x14,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar12,0); flagsHigh = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = flagsHigh; Entity::SetParent(pEVar8,(Entity *)npc); Entity_NPC::PlaySound(npc,0x1d7,1.0,2,0,1.0); } VStack_334.x = 0.0; VStack_348.x = (float)g_game->_room; game = g_game; if (((Entity *)((int)VStack_348.x + 0x1030))->_burnCountdown != 0) { do { laser = *(Entity_NPC **) (((Entity *)((int)VStack_348.x + 0x1030))->_midasFreezeCountdown + (int)VStack_334.x * 4); if (laser != npc) { if ((*(int *)&game->_deathmatchManager < 2) || (laser->_type != 1)) { local_350.x = (float)laser->_type; if ((((undefined1 *)0x3dd < (undefined1 *) ((int)&((Entity_NPC *)((int)local_350.x + -0xf54))->_scaleMulti + 2U)) || ((Entity_NPC *)local_350.x == (Entity_NPC *)0x21)) && (((((Entity_NPC *)local_350.x != (Entity_NPC *)0x1 && ((Entity_NPC *)local_350.x != (Entity_NPC *)0x2)) && ((Entity_NPC *)local_350.x != (Entity_NPC *)&DAT_00000009)) && ((Entity_NPC *)local_350.x != (Entity_NPC *)&DAT_00000005)))) { game = g_game; goto LAB_005aa83d; } } else { local_350.x = 1.4013e-45; } VStack_314.x = (npc->_pos).y - (laser->_pos).y; local_324.x = (npc->_pos).x - (laser->_pos).x; fVar19 = sqrtf(VStack_314.x * VStack_314.x + local_324.x * local_324.x); fVar18 = ((600.0 - fVar19) * 0.9) / 600.0; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (0.9 <= fVar18) { fVar18 = 0.9; } if (fVar19 <= 0.0) { pEVar8 = (Entity *)local_324.x; pEVar2 = (Entity_NPC *)VStack_314.x; } else { pEVar8 = (Entity *)(local_324.x * (1.0 / fVar19)); pEVar2 = (Entity_NPC *)((1.0 / fVar19) * VStack_314.x); } if ((Entity_NPC *)local_350.x == (Entity_NPC *)0x1) { fVar18 = fVar18 * 0.6; } else if ((((Entity_NPC *)local_350.x == (Entity_NPC *)0x387) && (laser->_variant == 0x14)) && (laser->_parent == (EntityPtr)npc)) { fVar18 = fVar18 * 1.6; laser->_state = 4; } game = g_game; fVar19 = laser->_friction; if (fVar19 != 0.0) { fVar17 = laser->_speedMultiplier; (laser->_velocity).x = ((float)pEVar8 * fVar18 * fVar17) / fVar19 + (laser->_velocity).x; (laser->_velocity).y = ((float)pEVar2 * fVar18 * fVar17) / fVar19 + (laser->_velocity).y; } } LAB_005aa83d: VStack_334.x = (float)((int)VStack_334.x + 1); } while ((uint)VStack_334.x < (uint)((Entity *)((int)VStack_348.x + 0x1030))->_burnCountdown ); } } bVar3 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar3 != 0) { Entity_NPC::PlaySound(npc,0x130,1.0,2,0,1.0); scratchVec.y = -20.0; local_350.x = 0.0; scratchVec.x = 0.0; do { VStack_348.x = (float)(int)local_350.x * 90.0 + 45.0; laser = Entity_Laser::ShootAngle(1,&npc->_pos,VStack_348.x,0x14,&scratchVec,(Entity *)npc,0) ; fVar18 = sin(VStack_348.x * 0.017453292); fVar19 = 0.0; if (0.0 <= fVar18) { fVar19 = 1000.0; } laser->_renderDepthOffset = fVar19; laser->_maxDistance = 100.0; (**(code **)(*(int *)laser + 0xc))(); local_350.x = (float)((int)local_350.x + 1); } while ((int)local_350.x < 4); } if ((npc->_sprite)._animState._animData == (void *)0x0) { LAB_005aaa9f: npc->_state = 0x72; uVar12 = Random(); game = g_game; uVar10 = 0; npc->_projectileCooldown = uVar12 % 0x1e + 0x1e; pvVar6 = game->_room; if (*(int *)((int)pvVar6 + 0x1264) != 0) { do { iVar9 = *(int *)(*(int *)((int)pvVar6 + 0x125c) + uVar10 * 4); if (((*(int *)(iVar9 + 0x28) == 0x387) && (*(int *)(iVar9 + 0x2c) == 0x14)) && (*(Entity_NPC **)(iVar9 + 0x3bc) == npc)) { *(undefined4 *)(iVar9 + 0xb64) = 3; } uVar10 = uVar10 + 1; } while (uVar10 < *(uint *)((int)pvVar6 + 0x1264)); } } else { bVar3 = AnimationState::WasEventTriggered(&(npc->_sprite)._animState,(byte *)"Shoot"); if (((bVar3 != 0) && (iVar9 = Entity::GetIntervalTicks((Entity *)npc,2.0,0.0), iVar9 != 0)) && (0 < npc->_stateFrame)) { npc->_stateFrame = npc->_stateFrame + -1; local_350.x = 0.0; do { VStack_348.x = ((float)(int)local_350.x * 15.0 + (float)npc->_stateFrame * 7.5) * 0.017453292; fVar18 = cos(VStack_348.x); scratchVec.x = fVar18 * 14.0; fVar18 = sin(VStack_348.x); scratchVec.y = fVar18 * 14.0; uVar12 = Random(); pEVar8 = Game::SpawnEx(g_game,9,2,&npc->_pos,&scratchVec,(Entity *)npc,0,uVar12,0); (**(code **)(*(int *)pEVar8 + 0x3c))(&DAT_00c34d78,0xffffffff,0xff,0,1); EVar11 = pEVar8->_parent; pEVar8[1]._variant = 0x2080; pEVar8[1]._subtype = 0; if (EVar11 != (EntityPtr)0x0) { std::multiset::erase(aVStack_2fc + -0xc); } pEVar8->_parent = (EntityPtr)npc; std::multiset::insert(&pEVar8->_parent); (**(code **)(*(int *)pEVar8 + 0xc))(); local_350.x = (float)((int)local_350.x + 1); } while ((int)local_350.x < 0x18); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) goto LAB_005aaa9f; } npc->_projectileCooldown = npc->_projectileCooldown + (int)local_340.x; } uVar12 = npc->_state; if (uVar12 < 0x71) { if (uVar12 < 0x68) { if ((npc->_entityRef == (EntityPtr)0x0) && (uVar12 != 0x67)) { SFXManager::Stop(&g_manager->_sfxManager,0x1f7); if (npc->_child != (EntityPtr)0x0) { *(undefined4 *)((int)npc->_child + 0xb64) = 0x68; } npc->_state = 0x67; } } else { fVar18 = npc->_pendingDamage; fVar19 = npc->_maxHitPoints * 0.5; if (npc->_health - fVar18 <= fVar19) { if (uVar12 == 0x69) { npc->_state = 0x70; } else if (0.0 < fVar18) { fVar19 = npc->_health - fVar19; fVar17 = fVar18; if (fVar19 <= fVar18) { fVar17 = fVar19; } npc->_pendingDamage = 0.0; damageEventsEnd = (npc->_damageEvents)._end; for (damageEvent = (npc->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { fVar19 = (fVar17 / fVar18) * *damageEvent; *damageEvent = fVar19; npc->_pendingDamage = fVar19 + npc->_pendingDamage; } } } } } if (npc->_dead != 0) { uVar12 = 0; local_324.x = (float)g_game->_room; if (*(int *)((int)local_324.x + 0x1264) != 0) { do { piVar5 = *(int **)(*(int *)((int)local_324.x + 0x125c) + uVar12 * 4); if (piVar5[10] == 9) { if ((Entity_NPC *)piVar5[0xef] != npc) { LAB_005aac26: bVar13 = false; goto LAB_005aac28; } *(undefined1 *)((int)piVar5 + 0x173) = 1; } else { if ((piVar5[10] != 0x387) || (piVar5[0xb] != 0x14)) goto LAB_005aac26; bVar13 = true; LAB_005aac28: if (bVar13) { damageSource._position.x = (npc->_pos).x; damageSource._position.y = (npc->_pos).y; local_31c.x = *(float *)(*piVar5 + 0x24); damageSource._type = npc->_type; damageSource._variant = npc->_variant; damageSource._spawnerType = npc->_spawnerType; damageSource._spawnerVariant = npc->_spawnerVariant; damageSource._velocity.x = (npc->_velocity).x; damageSource._velocity.y = (npc->_velocity).y; local_340.x = (float)(uint)((npc->_flags & 0x100) != 0); local_350.x = 2.8026e-45; if ((npc->_flags & 0x20000000) == 0) { local_350.x = 0.0; } if ((npc->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } damageSource._flags = uVar10 | (uint)local_350.x | (uint)local_340.x; damageSource._entity = npc; (*(code *)local_31c.x)(&damageSource); } } uVar12 = uVar12 + 1; } while (uVar12 < *(uint *)((int)local_324.x + 0x1264)); } } return; } //@@ 005aae10 FUN_005aae10 void FUN_005aae10(void) { int iVar1; int in_ECX; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float x; fVar2 = *(float *)(in_ECX + 0x36c) * 0.8; iVar1 = *(int *)(in_ECX + 0x3bc); *(float *)(in_ECX + 0x36c) = fVar2; if ((iVar1 != 0) && (*(uint *)(iVar1 + 0xb64) < 0x69)) { fVar3 = *(float *)(iVar1 + 0x340) - *(float *)(in_ECX + 0x340); fVar5 = *(float *)(iVar1 + 0x33c) - *(float *)(in_ECX + 0x33c); x = fVar3 * fVar3 + fVar5 * fVar5; fVar4 = sqrtf(x); fVar4 = fVar4 - *(float *)(iVar1 + 0xbb4); fVar6 = 15.0; if (fVar4 <= 15.0) { fVar6 = fVar4; } if (0.0 < fVar6) { fVar4 = sqrtf(x); if (0.0 < fVar4) { fVar5 = fVar5 * (1.0 / fVar4); fVar3 = fVar3 * (1.0 / fVar4); } if (fVar2 != 0.0) { *(float *)(in_ECX + 0x360) = (fVar6 * fVar5 * *(float *)(in_ECX + 0x39c)) / fVar2 + *(float *)(in_ECX + 0x360); *(float *)(in_ECX + 0x364) = (fVar6 * fVar3 * *(float *)(in_ECX + 0x39c)) / fVar2 + *(float *)(in_ECX + 0x364); } } } return; } //@@ 005aaf60 FUN_005aaf60 undefined1 * FUN_005aaf60(byte *param_1) { sprintf(&DAT_00c7f858,param_1); return &DAT_00c7f858; } //@@ 005aafd0 FUN_005aafd0 void FUN_005aafd0(float *param_1) { int iVar1; int in_ECX; float fVar2; if ((*param_1 == g_vectorZero.x) && (param_1[1] == g_vectorZero.y)) { param_1 = (float *)(in_ECX + 0x360); } fVar2 = sqrtf(*param_1 * *param_1 + param_1[1] * param_1[1]); if (0.1 < fVar2) { if (ABS(*param_1) <= ABS(param_1[1])) { iVar1 = (uint)(0.0 <= param_1[1]) * 2 + 1; } else { iVar1 = 2; if (*param_1 < 0.0) { iVar1 = 0; } } *(int *)(in_ECX + 0xbc0) = iVar1; *(undefined4 *)(in_ECX + 0xf30) = *(undefined4 *)(in_ECX + 0x334); *(undefined4 *)(in_ECX + 0xf34) = *(undefined4 *)(in_ECX + 0x338); } return; } //@@ 005ab0b0 FUN_005ab0b0 void FUN_005ab0b0(int param_1) { int in_ECX; float fVar1; float in_XMM2_Da; fVar1 = sqrtf(*(float *)(in_ECX + 0x360) * *(float *)(in_ECX + 0x360) + *(float *)(in_ECX + 0x364) * *(float *)(in_ECX + 0x364)); if (in_XMM2_Da < fVar1) { switch(*(undefined4 *)(in_ECX + 0xb64)) { case 0x6a: case 0x6b: ANM2::Play((ANM2 *)(in_ECX + 0x48),(&PTR_s_MoveAngryLeft_00b6295c)[param_1],0); return; case 0x6c: ANM2::Play((ANM2 *)(in_ECX + 0x48),(&PTR_s_AttackLeft_00b60af0)[param_1],0); return; case 0x6d: ANM2::Play((ANM2 *)(in_ECX + 0x48),(&PTR_s_StunLeft_00b6296c)[param_1],0); return; default: ANM2::Play((ANM2 *)(in_ECX + 0x48),(&PTR_s_MoveLeft_00b6294c)[param_1],0); } } return; } //@@ 005ab180 NpcHelper::visage_start_charge /* DB: ? ECX=npc: from NpcHelper::visage_handle_collision after the bounce damage call; plays a sfx, picks axis-aligned dir (Isaac::GetAxisAlignedUnitVectorFromDir) into +0x334/+0x338 and plays "Charge2Loop%s" with Down/Up/Left/Right */ void NpcHelper::visage_start_charge(void) { undefined4 uVar1; byte *pbVar2; Manager *pMVar3; byte bVar4; Vector *pVVar5; byte *pbVar6; uint uVar7; Entity_Laser *pEVar8; Entity *in_ECX; byte *pbVar9; bool bVar10; float fVar11; int iVar12; Entity *source; Vector local_18; Vector VStack_10; if (in_ECX[2]._posOffset.x == 1.52742e-43) { uVar1 = *(undefined4 *)((int)&in_ECX->_flags + 4); *(uint *)&in_ECX->_flags = (uint)in_ECX->_flags & 0xffffffee; iVar12 = *(int *)in_ECX; *(undefined4 *)((int)&in_ECX->_flags + 4) = uVar1; in_ECX->_health = in_ECX->_maxHitPoints; in_ECX->_isInvicible = 0; (**(code **)(iVar12 + 0x40))(*(undefined4 *)((int)in_ECX->_config + 0x28)); } pMVar3 = g_manager; local_18.x = 1.0; if (*(int *)&in_ECX[3].field_0x40 == 0x12) { local_18.x = 1.5; } else if (*(int *)&in_ECX[3].field_0x40 == 0x13) { local_18.x = 0.5; } VStack_10.x = 1.61149e-43; seed_fart_sound_override((int *)&VStack_10); SoundEffects::Play(&pMVar3->_sfxManager,(int)VStack_10.x,1.0,2,0,local_18.x,0.0); pVVar5 = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_10,*(int *)&in_ECX[2].field_0x3a8); (in_ECX->_targetPosition).x = pVVar5->x; (in_ECX->_targetPosition).y = pVVar5->y; sprintf(&DAT_00c7f858,(byte *)"Charge2Loop%s"); pbVar2 = (in_ECX->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { pbVar6 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar6 = *(byte **)pbVar2; } pbVar9 = &DAT_00c7f858; do { bVar4 = *pbVar6; bVar10 = bVar4 < *pbVar9; if (bVar4 != *pbVar9) { LAB_005ab300: uVar7 = -(uint)bVar10 | 1; goto LAB_005ab305; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; bVar10 = bVar4 < pbVar9[1]; if (bVar4 != pbVar9[1]) goto LAB_005ab300; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_005ab305: if ((uVar7 == 0) && ((pbVar2[0x34] == 0 || ((in_ECX->_sprite)._animState._isPlaying != 0)))) goto LAB_005ab33c; } bVar4 = ANM2::SetAnimation(&in_ECX->_sprite,&DAT_00c7f858,1); if (bVar4 != 0) { AnimationState::Rewind(&(in_ECX->_sprite)._animState); (in_ECX->_sprite)._animState._isPlaying = 1; } LAB_005ab33c: in_ECX[2]._posOffset.x = 1.54143e-43; pVVar5 = &local_18; VStack_10.x = (in_ECX->_targetPosition).y * -1.0; bVar4 = 0; iVar12 = 0x14; local_18.x = 0.0; local_18.y = -40.0; source = in_ECX; fVar11 = atan2f(VStack_10.x,(in_ECX->_targetPosition).x * -1.0); pEVar8 = Entity_Laser::ShootAngle(1,&in_ECX->_pos,fVar11 * 57.295776,iVar12,pVVar5,source,bVar4); fVar11 = 0.0; if (0.0 <= VStack_10.x) { fVar11 = 1000.0; } pEVar8->_renderDepthOffset = fVar11; (**(code **)(*(int *)pEVar8 + 0xc))(); return; } //@@ 005ab3e0 FUN_005ab3e0 void FUN_005ab3e0(void) { Manager *pMVar1; int *in_ECX; int local_c; float local_8; if (in_ECX[0x2d9] == 0x6d) { return; } in_ECX[0xe0] = in_ECX[0xe1]; in_ECX[0x2d9] = 0x6d; pMVar1 = g_manager; local_8 = 1.0; if (in_ECX[0x319] == 0x12) { local_8 = 1.5; } else if (in_ECX[0x319] == 0x13) { local_8 = 0.5; } local_c = 0x105; seed_fart_sound_override(&local_c); SoundEffects::Play(&pMVar1->_sfxManager,local_c,1.0,2,0,local_8,0.0); in_ECX[0x5a] = in_ECX[0x5a] | 0x11; in_ECX[0x5b] = in_ECX[0x5b]; *(undefined1 *)(in_ECX + 0xec) = 1; (**(code **)(*in_ECX + 0x40))(0); FUN_005ab0b0(in_ECX[0x2f0]); return; } //@@ 005ab4d0 NpcAI::ENTITY_VISAGE_mask /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs ChargeBegin%s/LeftEye/RightEye/Break */ void __fastcall NpcAI::ENTITY_VISAGE_mask(Entity_NPC *npc) { byte bVar1; LayerState *blendLayer; uint uVar2; int iVar3; Entity *tmpEntity; Vector *toTargetDir; EntityPtr EVar4; Vector *pVVar5; byte *animName; ColorMod *other; int elapsedFrames; uint uVar6; undefined4 uVar7; float fVar8; undefined1 auVar9 [12]; float fVar10; float fVar11; float fVar12; float fVar13; Entity_Effect *local_120; Vector VStack_11c; Vector VStack_114; Vector local_10c; EntityPtr *pEStack_104; Vector VStack_100; Vector local_f8; Vector laserOrigin; Color tmpColor; ProjectileParams projParams; uint local_c; void *damageEventsBegin; local_c = __security_cookie ^ (uint)&local_120; local_120 = (Entity_Effect *)0x3f800000; uVar6 = npc->_state; if (0x68 < uVar6) { local_120 = (Entity_Effect *)0x3fc00000; } EVar4 = npc->_parent; elapsedFrames = (int)npc->_updateTime - (int)npc->_prevUpdateTime; local_10c.x = (float)elapsedFrames; if ((EVar4 == (EntityPtr)0x0) && (uVar6 != 0x6d)) { FUN_005ab3e0(); uVar6 = npc->_state; EVar4 = npc->_parent; } switch(uVar6) { case 0: Entity_NPC::ClearDequeRefs(npc); local_120 = (Entity_Effect *)0x2; do { uVar6 = Random(); EVar4 = (EntityPtr) Game::SpawnEx(g_game,1000,0xa6,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar6,0); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; if ((Color *)((int)EVar4 + 0xf0) != &tmpColor) { *(undefined4 *)((int)EVar4 + 0x100) = 0; *(undefined4 *)((int)EVar4 + 0x104) = 0; *(undefined4 *)((int)EVar4 + 0x108) = 0; *(undefined4 *)((int)EVar4 + 0x10c) = 0; *(undefined8 *)((int)EVar4 + 0x110) = 0; ((Color *)((int)EVar4 + 0xf0))->_tint[0] = 1.0; *(undefined4 *)((int)EVar4 + 0xf4) = 0x3e4ccccd; *(undefined4 *)((int)EVar4 + 0xf8) = 0; *(undefined4 *)((int)EVar4 + 0xfc) = 0x3f4ccccd; *(undefined4 *)((int)EVar4 + 0x118) = 0; } fVar8 = g_vectorOne.y; fVar10 = g_vectorOne.x * 0.5; *(undefined4 *)((int)EVar4 + 0x454) = 0x3df5c28f; *(undefined4 *)((int)EVar4 + 0x458) = 0x3df5c28f; *(float *)((int)EVar4 + 0xe4) = fVar10; *(float *)((int)EVar4 + 0xe8) = fVar8 * 0.5; if (*(EntityPtr *)((int)EVar4 + 0x3bc) != (EntityPtr)0x0) { local_10c.x = (float)((int)EVar4 + 0x3bc); std::multiset::erase(&local_10c); } *(undefined4 *)((int)EVar4 + 0x3bc) = npc; std::multiset::insert((undefined4 *)((int)EVar4 + 0x3bc)); local_10c.x = 0.0; std::deque::push_front(&local_10c); local_f8.y = (float)((npc->_entityDeque)._size + (npc->_entityDeque)._offset); uVar6 = (int)local_f8.y - 1U & 3; iVar3 = *(int *)((int)(npc->_entityDeque)._map + ((int)local_f8.y - 1U >> 2 & (npc->_entityDeque)._mapSize - 1) * 4); VStack_11c.x = (float)(iVar3 + uVar6 * 4); if (*(int *)(iVar3 + uVar6 * 4) != 0) { local_10c.x = VStack_11c.x; std::multiset::erase(&local_10c); } *(EntityPtr *)VStack_11c.x = EVar4; std::multiset::insert(VStack_11c.x); uVar6 = g_graphicsManager_flags; local_120 = (Entity_Effect *)((int)&local_120[-1]._hitList._capacity + 3); } while (local_120 != (Entity_Effect *)0x0); blendLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); VStack_114.x = 0.0; VStack_114.y = 1.0; iVar3 = 1; blendLayer->_blendMode[0] = 0; if ((uVar6 & 4) == 0) { iVar3 = 6; } blendLayer->_blendMode[1] = iVar3; blendLayer->_blendMode[2] = 1; blendLayer->_blendMode[3] = 1; blendLayer->_blendMode[4] = 1; uVar7 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x11; *(undefined4 *)((int)&npc->_flags + 4) = uVar7; npc->_state = 100; npc->_stateFrame = 0x3c; npc->_isInvicible = 1; FUN_005aafd0(&VStack_114); break; case 100: tmpEntity = Entity_NPC::GetPlayerTarget(npc); VStack_114.x = (tmpEntity->_pos).x - (npc->_pos).x; VStack_114.y = (tmpEntity->_pos).y - (npc->_pos).y; Vector::Normalized(&VStack_114,&VStack_11c); if (npc->_projectileCooldown < -0x59) { uVar6 = Random(); if (uVar6 % 0x28 == 0) { uVar6 = Random(); npc->_projectileCooldown = uVar6 % 0x3c + 0x1e; (npc->_targetPosition).x = VStack_11c.x; (npc->_targetPosition).y = VStack_11c.y; } } else { npc->_projectileCooldown = npc->_projectileCooldown + -1; } if (npc->_projectileCooldown < 1) { fVar8 = npc->_speedMultiplier; (npc->_velocity).x = VStack_11c.x * 1.5 * fVar8 + (npc->_velocity).x; (npc->_velocity).y = VStack_11c.y * 1.5 * fVar8 + (npc->_velocity).y; } else { pVVar5 = &npc->_targetPosition; uVar6 = Random(); fVar8 = (npc->_targetPosition).y; fVar10 = npc->_speedMultiplier; fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 2.5 + 1.5; fVar13 = pVVar5->x; (npc->_velocity).x = fVar12 * pVVar5->x * fVar10 + (npc->_velocity).x; (npc->_velocity).y = fVar8 * fVar12 * fVar10 + (npc->_velocity).y; pVVar5->x = VStack_11c.x * 0.05 + fVar13; (npc->_targetPosition).y = VStack_11c.y * 0.05 + (npc->_targetPosition).y; Vector::Normalize(pVVar5); elapsedFrames = (int)local_10c.x; } FUN_005aafd0(&VStack_11c); FUN_005ab0b0(npc->_i1); if (0 < npc->_stateFrame) { npc->_stateFrame = npc->_stateFrame - elapsedFrames; } pVVar5 = Vector::ToCardinal(&local_f8,&VStack_11c); if ((((0.9 < VStack_11c.y * pVVar5->y + VStack_11c.x * pVVar5->x) && (uVar6 = Random(), uVar6 % 0x28 == 0)) && (npc->_stateFrame < 1)) && (npc->_projectileCooldown < 1)) { Entity_Laser::CalculateEndPoint (&VStack_114,&npc->_pos,&VStack_11c,&g_vectorZero,(Entity *)0x0,20.0); fVar8 = (npc->_pos).y - VStack_114.y; fVar10 = (npc->_pos).x - VStack_114.x; fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); if (200.0 < fVar8) { (npc->_targetPosition).x = VStack_11c.x; (npc->_targetPosition).y = VStack_11c.y; bVar1 = 0; npc->_state = 0x65; *(undefined4 *)((int)npc->_parent + 0xb64) = 0x65; animName = (byte *)FUN_005aaf60("ChargeBegin%s",&npc->_targetPosition); ANM2::Play(&npc->_sprite,animName,bVar1); } } FUN_005aae10(); break; case 0x65: FUN_005aae10(); iVar3 = ANM2::GetFrame(&npc->_sprite); if ((6 < iVar3) && (npc->_stateFrame < 1)) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar8 = (npc->_pos).y - (tmpEntity->_pos).y; fVar10 = (npc->_pos).x - (tmpEntity->_pos).x; fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); VStack_114.y = (fVar8 * 0.18 * (tmpEntity->_velocity).y + (tmpEntity->_pos).y) - (npc->_pos).y ; VStack_114.x = (fVar8 * 0.18 * (tmpEntity->_velocity).x + (tmpEntity->_pos).x) - (npc->_pos).x ; Vector::Normalized(&VStack_114,&local_10c); (npc->_targetPosition).x = local_10c.x; (npc->_targetPosition).y = local_10c.y; npc->_stateFrame = 1; } bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Charge"); if (bVar1 != 0) { if ((npc->_sprite)._animState._animData == (void *)0x0) { local_120 = (Entity_Effect *)&DAT_bf800000; } else { local_120 = (Entity_Effect *)(npc->_sprite)._animState._animFrame; } bVar1 = 0; animName = (byte *)FUN_005aaf60("ChargeBegin%s",&npc->_targetPosition); ANM2::Play(&npc->_sprite,animName,bVar1); if ((npc->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)local_120); } Entity_NPC::PlaySound(npc,0x73,1.0,10,0,1.0); SoundEffects::Play(&g_manager->_sfxManager,0x1f7,0.8,2,1,1.0,0.0); npc->_state = 0x66; } break; case 0x66: FUN_005aae10(); if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { bVar1 = 0; animName = (byte *)FUN_005aaf60("ChargeLoop%s",&npc->_targetPosition); ANM2::Play(&npc->_sprite,animName,bVar1); } fVar8 = (npc->_targetPosition).y; (npc->_velocity).x = (npc->_targetPosition).x * 7.0 + (npc->_velocity).x; (npc->_velocity).y = fVar8 * 7.0 + (npc->_velocity).y; if (npc->_collidesWithGrid == 0) break; pVVar5 = Vector::Normalized(&npc->_gridCollisionVelocity,&local_f8); fVar8 = (npc->_gridCollisionNormal).y; fVar10 = (npc->_gridCollisionNormal).x; if (0.5 <= ABS(fVar8 * pVVar5->y + fVar10 * pVVar5->x)) { bVar1 = 0; animName = (byte *)FUN_005aaf60("ChargeHit%s",&npc->_targetPosition); ANM2::Play(&npc->_sprite,animName,bVar1); Entity_NPC::PlaySound(npc,0x34,1.0,10,0,1.0); SFXManager::Stop(&g_manager->_sfxManager,0x1f7); Game::ShakeScreen(g_game,0xf); npc->_state = 0x67; VStack_114.x = (npc->_gridCollisionNormal).x * -1.0; VStack_114.y = (npc->_gridCollisionNormal).y * -1.0; NpcHelper::visage_spawn_particles(); ProjectileParams::ProjectileParams(&projParams); projParams.HeightModifier = projParams.HeightModifier - 10.0; projParams.Variant = 9; uVar6 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar6 & 3) + 10,&g_vectorZero,0.0,&projParams); break; } fVar13 = (npc->_gridCollisionVelocity).y; fVar12 = (npc->_gridCollisionVelocity).x; fVar11 = fVar12 * fVar10 + fVar13 * fVar8; fVar11 = fVar11 + fVar11; fVar12 = fVar12 - fVar10 * fVar11; fVar13 = fVar13 - fVar8 * fVar11; goto LAB_005abd18; case 0x67: FUN_005aae10(); if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; FUN_005aafd0(&npc->_targetPosition); FUN_005ab0b0(npc->_i1); *(undefined4 *)((int)npc->_parent + 0xb64) = 0x66; goto LAB_005ac89d; case 0x68: case 0x69: npc->_friction = npc->_friction * 0.1; ANM2::Play(&npc->_sprite,(byte *)"Transition",0); if ((npc->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,(byte *)"Break"); if (bVar1 != 0) { local_120 = (Entity_Effect *)npc->_size; uVar6 = Random(); local_120 = (Entity_Effect *)((float)local_120 * 0.5); local_10c.x = (float)((uVar6 & 3) + 10); do { uVar6 = Random(); uVar2 = Random(); fVar8 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; pEStack_104 = (EntityPtr *)(fVar8 + fVar8); uVar2 = Random(); VStack_11c.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 2.0; VStack_114.x = cos((float)pEStack_104); VStack_114.x = VStack_114.x * VStack_11c.x; VStack_114.y = sin((float)pEStack_104); VStack_114.y = VStack_114.y * VStack_11c.x; uVar2 = Random(); fVar8 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; VStack_11c.x = fVar8 + fVar8; fVar8 = cos(VStack_11c.x); VStack_100.x = fVar8 * (float)local_120 + (npc->_pos).x; fVar8 = sin(VStack_11c.x); VStack_100.y = fVar8 * (float)local_120 + (npc->_pos).y; tmpEntity = Game::SpawnEx(g_game,1000,0xa3,&VStack_100,&VStack_114,(Entity *)0x0,0,uVar6,0 ); (**(code **)(*(int *)tmpEntity + 0xc))(); local_10c.x = (float)((int)local_10c.x + -1); } while ((EntityPtr)local_10c.x != (EntityPtr)0x0); Entity_NPC::PlaySound(npc,0x1f8,1.0,2,0,1.0); Entity_NPC::PlaySound(npc,0x131,1.0,2,0,1.0); npc->_state = 0x69; } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; } *(uint *)&npc->_flags = (uint)npc->_flags & 0xffffffee; uVar7 = *(undefined4 *)((int)&npc->_flags + 4); npc->_isInvicible = 0; *(undefined4 *)((int)&npc->_flags + 4) = uVar7; npc->_state = 0x6a; npc->_i2 = 0; (npc->_targetPosition).x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; break; case 0x6a: pVVar5 = &npc->_targetPosition; bVar1 = Vector::operator_eq(pVVar5,&g_vectorZero); if (bVar1 == 0) { if ((float)local_120 <= (npc->_targetPosition).y * (npc->_velocity).y + pVVar5->x * (npc->_velocity).x) { npc->_i2 = 0; } else { iVar3 = npc->_i2 + (int)local_10c.x; npc->_i2 = iVar3; if (4 < iVar3) { pVVar5->x = g_vectorZero.x; (npc->_targetPosition).y = g_vectorZero.y; } } fVar8 = (npc->_targetPosition).y; (npc->_velocity).x = pVVar5->x * 1.5 * (float)local_120 + (npc->_velocity).x; (npc->_velocity).y = fVar8 * 1.5 * (float)local_120 + (npc->_velocity).y; } else { PathFinder::MoveRandomlyAxisAligned((PathFinder *)&npc->_pathfinder,(float)local_120 * 0.8,0); } FUN_005aae10(); FUN_005aafd0(&g_vectorZero); FUN_005ab0b0(npc->_i1); uVar6 = Random(); if (uVar6 % 10 == 0) { tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar8 = (tmpEntity->_pos).x - (npc->_pos).x; fVar10 = (tmpEntity->_pos).y - (npc->_pos).y; VStack_100.x = fVar8; VStack_100.y = fVar10; Vector::ToCardinal(&VStack_114,&VStack_100); VStack_100.x = fVar8; VStack_100.y = fVar10; toTargetDir = Vector::Normalized(&VStack_100,&local_f8); if (0.9 < VStack_114.y * toTargetDir->y + VStack_114.x * toTargetDir->x) { pVVar5->x = VStack_114.x; (npc->_targetPosition).y = VStack_114.y; } } break; case 0x6b: LAB_005ac292: FUN_005aae10(); VStack_100.x = (npc->_pos).x - *(float *)((int)npc->_parent + 0x33c); VStack_100.y = (npc->_pos).y - *(float *)((int)npc->_parent + 0x340); FUN_005aafd0(&VStack_100); goto LAB_005ac2d7; case 0x6c: FUN_005ab0b0(npc->_i1); bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Break"); if (bVar1 != 0) { Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_114,npc->_i1); local_10c.x = cos(1.5707964); fVar8 = sin(1.5707964); fVar10 = 15.0; if (VStack_114.y == 0.0) { fVar10 = 10.0; } VStack_100.x = 0.0; VStack_11c.x = fVar10 * (local_10c.x * VStack_114.x - fVar8 * VStack_114.y); VStack_100.y = -58.0; pEStack_104 = (EntityPtr *)(fVar10 * (fVar8 * VStack_114.x + local_10c.x * VStack_114.y)); laserOrigin.x = VStack_11c.x + (npc->_pos).x; laserOrigin.y = (float)pEStack_104 + (npc->_pos).y; fVar8 = atan2f(VStack_114.y,VStack_114.x); local_120 = (Entity_Effect *)(fVar8 * 57.295776); local_10c.x = (float)Entity_Laser::ShootAngle (1,&laserOrigin,(float)local_120,0x14,&VStack_100,(Entity *)npc ,0); fVar8 = 0.0; if (0.0 <= VStack_114.y) { fVar8 = 1000.0; } *(float *)((int)local_10c.x + 0x358) = fVar8; *(byte *)((int)local_10c.x + 0x4c0) = 1; *(int *)((int)local_10c.x + 0x4c4) = 0; *(float *)((int)local_10c.x + 0x4c8) = 10.0; *(float *)((int)local_10c.x + 0x4cc) = 2.0; (**(code **)(*(int *)local_10c.x + 0xc))(); local_f8.x = (npc->_pos).x - VStack_11c.x; local_f8.y = (npc->_pos).y - (float)pEStack_104; VStack_100.x = 0.0; VStack_100.y = -58.0; EVar4 = (EntityPtr) Entity_Laser::ShootAngle (1,&local_f8,(float)local_120,0x14,&VStack_100,(Entity *)npc,0); uVar7 = 0; if (0.0 <= VStack_114.y) { uVar7 = 0x447a0000; } *(undefined4 *)((int)EVar4 + 0x358) = uVar7; *(undefined1 *)((int)EVar4 + 0x4c0) = 1; *(undefined4 *)((int)EVar4 + 0x4c4) = 0; *(undefined4 *)((int)EVar4 + 0x4c8) = 0xc1200000; *(undefined4 *)((int)EVar4 + 0x4cc) = 0xc0000000; (**(code **)(*(int *)EVar4 + 0xc))(); local_120 = Entity_Effect::CreateTimer(FUN_005acb70,5,0,0); pEStack_104 = &local_120->_child; if (local_120->_child != (EntityPtr)0x0) { VStack_11c.x = (float)pEStack_104; std::multiset::erase(&VStack_11c); } *pEStack_104 = (EntityPtr)local_10c.x; std::multiset::insert(pEStack_104); pEStack_104 = &local_120->_target; if (*pEStack_104 != (EntityPtr)0x0) { VStack_11c.x = (float)pEStack_104; std::multiset::erase(&VStack_11c); } *pEStack_104 = EVar4; std::multiset::insert(pEStack_104); local_120 = Entity_Effect::CreateTimer(FUN_005acbf0,0xf,0,0); pEStack_104 = &local_120->_child; if (local_120->_child != (EntityPtr)0x0) { VStack_11c.x = (float)pEStack_104; std::multiset::erase(&VStack_11c); } *pEStack_104 = (EntityPtr)local_10c.x; std::multiset::insert(pEStack_104); VStack_11c.x = (float)&local_120->_target; if (*(EntityPtr *)VStack_11c.x != (EntityPtr)0x0) { local_10c.x = VStack_11c.x; std::multiset::erase(&local_10c); } *(EntityPtr *)VStack_11c.x = EVar4; std::multiset::insert(VStack_11c.x); } if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { npc->_state = 0x6a; } break; case 0x6d: if (((EVar4 != (EntityPtr)0x0) && (*(int *)((int)EVar4 + 0xbec) != 0)) && (*(Entity_NPC **)(*(int *)((int)EVar4 + 0xbec) + 0x3c4) == npc)) goto LAB_005ac292; npc->_friction = npc->_friction * 0.5; LAB_005ac2d7: FUN_005ab0b0(npc->_i1); break; case 0x6e: bVar1 = npc->_collidesWithGrid; fVar8 = (npc->_targetPosition).y; (npc->_velocity).x = (npc->_targetPosition).x * 5.0 + (npc->_velocity).x; (npc->_velocity).y = fVar8 * 5.0 + (npc->_velocity).y; if (bVar1 == 0) break; pVVar5 = Vector::Normalized(&npc->_gridCollisionVelocity,&local_f8); fVar8 = (npc->_gridCollisionNormal).y; fVar10 = (npc->_gridCollisionNormal).x; if (0.5 <= ABS(fVar8 * pVVar5->y + fVar10 * pVVar5->x)) { bVar1 = 0; animName = (byte *)FUN_005aaf60("Charge2Hit%s",&npc->_targetPosition); ANM2::Play(&npc->_sprite,animName,bVar1); Entity_NPC::PlaySound(npc,0x34,1.0,10,0,1.0); Game::ShakeScreen(g_game,0xf); npc->_state = 0x6f; local_f8.x = (npc->_gridCollisionNormal).x * -1.0; local_f8.y = (npc->_gridCollisionNormal).y * -1.0; NpcHelper::visage_spawn_particles(); ProjectileParams::ProjectileParams(&projParams); local_f8.x = 10.0; local_f8.y = 8.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_f8,9,&projParams); projParams.Variant = 9; Color::Color(&tmpColor); Color::operator_assign((Color *)&projParams.Color,other); projParams.HeightModifier = projParams.HeightModifier - 10.0; uVar6 = Random(); Entity_NPC::FireBossProjectiles(npc,(uVar6 & 3) + 10,&g_vectorZero,0.0,&projParams); break; } fVar13 = (npc->_gridCollisionVelocity).y; fVar12 = (npc->_gridCollisionVelocity).x; fVar11 = fVar12 * fVar10 + fVar13 * fVar8; fVar11 = fVar11 + fVar11; fVar13 = fVar13 - fVar11 * fVar8; fVar12 = fVar12 - fVar11 * fVar10; LAB_005abd18: (npc->_velocity).x = fVar12; (npc->_velocity).y = fVar13; break; case 0x6f: npc->_friction = npc->_friction * 0.6; if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; npc->_state = 0x6a; FUN_005aafd0(&npc->_targetPosition); FUN_005ab0b0(npc->_i1); LAB_005ac89d: uVar6 = Random(); npc->_stateFrame = uVar6 % 0x3c + 0x1e; } if ((npc->_isInvicible == 0) && (fVar8 = npc->_health, fVar8 - npc->_pendingDamage <= 0.0)) { iVar3 = npc->_state; damageEventsBegin = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; (npc->_damageEvents)._end = damageEventsBegin; if (iVar3 == 0x6a) { FUN_005ab3e0(); } else { auVar9 = ZEXT812(0x3dcccccd); if (fVar8 < auVar9._0_4_) { auVar9._4_8_ = auVar9._4_8_; auVar9._0_4_ = fVar8; } npc->_health = auVar9._0_4_; } } if ((npc->_parent != (EntityPtr)0x0) && (*(char *)((int)npc->_parent + 0x173) != '\0')) { FUN_005ab3e0(); } fVar8 = (npc->_velocity).y; fVar10 = (npc->_velocity).x; fVar8 = sqrtf(fVar10 * fVar10 + fVar8 * fVar8); local_10c.x = fVar8 * npc->_friction; uVar6 = 0; do { uVar2 = uVar6 + (npc->_entityDeque)._offset; if (*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar2 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar2 & 3) * 4) != 0) { Entity::GetNullOffset((Entity *)npc,&local_f8,(&PTR_s_LeftEye_00b62944)[uVar6]); if ((local_f8.x == g_vectorZero.x) && (local_f8.y == g_vectorZero.y)) { uVar2 = uVar6 + (npc->_entityDeque)._offset; *(undefined4 *) (*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar2 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar2 & 3) * 4) + 0xfc) = 0; } else { fVar8 = (local_10c.x - 10.0) / 15.0; uVar2 = uVar6 + (npc->_entityDeque)._offset; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } *(float *)(*(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar2 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar2 & 3) * 4) + 0xfc) = fVar8; } fVar8 = (npc->_pos).y; uVar2 = uVar6 + (npc->_entityDeque)._offset; iVar3 = *(int *)(*(int *)((int)(npc->_entityDeque)._map + (uVar2 >> 2 & (npc->_entityDeque)._mapSize - 1) * 4) + (uVar2 & 3) * 4); *(float *)(iVar3 + 0x33c) = local_f8.x + (npc->_pos).x; *(float *)(iVar3 + 0x340) = local_f8.y + fVar8; } uVar6 = uVar6 + 1; } while (uVar6 < 2); return; } //@@ 005acb70 FUN_005acb70 void FUN_005acb70(int param_1) { int iVar1; int iVar2; iVar2 = *(int *)(param_1 + 0x3c0); if ((iVar2 == 0) || (*(int *)(iVar2 + 0x28) != 7)) { iVar2 = 0; } iVar1 = *(int *)(param_1 + 0x3c4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 7)) { iVar1 = 0; } if (iVar2 != 0) { *(undefined1 *)(iVar2 + 0x4c0) = 1; *(undefined4 *)(iVar2 + 0x4c4) = 0; *(undefined4 *)(iVar2 + 0x4c8) = 0xc1a00000; *(undefined4 *)(iVar2 + 0x4cc) = 0xc0000000; } if (iVar1 != 0) { *(undefined1 *)(iVar1 + 0x4c0) = 1; *(undefined4 *)(iVar1 + 0x4c4) = 0; *(undefined4 *)(iVar1 + 0x4c8) = 0x41a00000; *(undefined4 *)(iVar1 + 0x4cc) = 0x40000000; } return; } //@@ 005acbf0 FUN_005acbf0 void FUN_005acbf0(int param_1) { int iVar1; int iVar2; iVar2 = *(int *)(param_1 + 0x3c0); if ((iVar2 == 0) || (*(int *)(iVar2 + 0x28) != 7)) { iVar2 = 0; } iVar1 = *(int *)(param_1 + 0x3c4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 7)) { iVar1 = 0; } if (iVar2 != 0) { *(undefined1 *)(iVar2 + 0x4c0) = 1; *(undefined4 *)(iVar2 + 0x4c4) = 0; *(undefined4 *)(iVar2 + 0x4c8) = 0x41a00000; *(undefined4 *)(iVar2 + 0x4cc) = 0x40000000; } if (iVar1 != 0) { *(undefined1 *)(iVar1 + 0x4c0) = 1; *(undefined4 *)(iVar1 + 0x4c4) = 0; *(undefined4 *)(iVar1 + 0x4c8) = 0xc1a00000; *(undefined4 *)(iVar1 + 0x4cc) = 0xc0000000; } return; } //@@ 005acc70 FUN_005acc70 int FUN_005acc70(void) { int iVar1; int iVar2; int in_ECX; iVar2 = *(int *)(in_ECX + 0x3c0); while (iVar1 = iVar2, iVar1 != 0) { in_ECX = iVar1; iVar2 = *(int *)(iVar1 + 0x3c0); } if ((*(int *)(in_ECX + 0x28) == 0x387) && (*(int *)(in_ECX + 0x2c) == 1)) { return in_ECX; } return 0; } //@@ 005accb0 FUN_005accb0 int FUN_005accb0(void) { int iVar1; int iVar2; int in_ECX; iVar2 = *(int *)(in_ECX + 0x3bc); while (iVar1 = iVar2, iVar1 != 0) { in_ECX = iVar1; iVar2 = *(int *)(iVar1 + 0x3bc); } if ((*(int *)(in_ECX + 0x28) == 0x387) && (*(int *)(in_ECX + 0x2c) == 0)) { return in_ECX; } return 0; } //@@ 005accf0 FUN_005accf0 int FUN_005accf0(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x3bc); uVar2 = (uint3)((uint)iVar1 >> 8); if (((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 0x387)) || (*(int *)(iVar1 + 0x2c) != 10)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 005acd10 FUN_005acd10 int FUN_005acd10(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x3c0); uVar2 = (uint3)((uint)iVar1 >> 8); if (((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 0x387)) || (*(int *)(iVar1 + 0x2c) != 10)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 005acd30 NpcHelper::visage_chain_solve /* DB: ? ECX=npc (Visage chain 903.10), char arg: walks the parent (+0x3bc) / child (+0x3c0) chain to the 903.0 head and constrains link spacing via Normalized/atan2; called from NpcAI::ENTITY_VISAGE_chain in _aiCallPhase 2 */ void NpcHelper::visage_chain_solve(char param_1) { int iVar1; int iVar2; undefined1 isFlipX; Vector *normalized; float *pfVar3; int in_ECX; int iVar4; int iVar5; float fVar6; float angleDeg; Vector local_2c; float headY; float headX; Vector normDir; float dirX; float anchorY; float anchorX; float *headPos; int *parentSlot; int *state; iVar1 = *(int *)(in_ECX + 0x3c0); if (((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 0x387)) || (*(int *)(iVar1 + 0x2c) != 10)) { parentSlot = (int *)(in_ECX + 0x3bc); iVar5 = *(int *)(in_ECX + 0x3bc); iVar4 = in_ECX; while (iVar2 = iVar5, iVar2 != 0) { iVar4 = iVar2; iVar5 = *(int *)(iVar2 + 0x3bc); } iVar5 = in_ECX; if ((*(int *)(iVar4 + 0x28) != 0x387) || (*(int *)(iVar4 + 0x2c) != 0)) { iVar4 = 0; } while (iVar2 = iVar1, iVar2 != 0) { iVar5 = iVar2; iVar1 = *(int *)(iVar2 + 0x3c0); } if (((iVar5 == 0) || (*(int *)(iVar5 + 0x28) != 0x387)) || (*(int *)(iVar5 + 0x2c) != 1)) { iVar5 = 0; } if (iVar4 != 0) { headPos = (float *)(iVar4 + 0x33c); headX = *headPos; state = (int *)(in_ECX + 0xb64); headY = *(float *)(iVar4 + 0x340); if (*(int *)(in_ECX + 0xb64) == 3) { if (iVar5 == 0) { return; } pfVar3 = (float *)(iVar5 + 0x33c); anchorX = *pfVar3; anchorY = *(float *)(iVar5 + 0x340); if (param_1 != '\0') { iVar1 = (uint)(*(char *)(iVar4 + 0x175) != '\0') * 8; headX = *(float *)(iVar4 + 0x360) * 0.5 + *(float *)(iVar1 + 0x33c + iVar4); headY = *(float *)(iVar4 + 0x364) * 0.5 + *(float *)(iVar1 + 0x340 + iVar4); if (*(char *)(iVar5 + 0x175) != '\0') { anchorX = *(float *)(iVar5 + 0x344); pfVar3 = (float *)(iVar5 + 0x344); } anchorX = *(float *)(iVar5 + 0x360) * 0.5 + anchorX; anchorY = *(float *)(iVar5 + 0x364) * 0.5 + pfVar3[1]; } local_2c.x = headX - anchorX; local_2c.y = headY - anchorY; normalized = Vector::Normalized(&local_2c,&normDir); dirX = normalized->x; normDir.y = normalized->y; } else { anchorX = *(float *)(in_ECX + 0x33c); anchorY = *(float *)(in_ECX + 0x340); if (param_1 != '\0') { if (*(char *)(iVar4 + 0x175) == '\0') { pfVar3 = headPos; } else { headX = *(float *)(iVar4 + 0x344); pfVar3 = (float *)(iVar4 + 0x344); } headX = *(float *)(iVar4 + 0x360) * 0.5 + headX; headY = *(float *)(iVar4 + 0x364) * 0.5 + pfVar3[1]; } dirX = headX - anchorX; normDir.y = headY - anchorY; fVar6 = sqrtf(dirX * dirX + normDir.y * normDir.y); if (0.0 < fVar6) { normDir.y = normDir.y * (1.0 / fVar6); dirX = dirX * (1.0 / fVar6); } anchorX = anchorX - dirX * 8.0; anchorY = anchorY - normDir.y * 8.0; } iVar1 = *parentSlot; while (iVar1 != 0) { fVar6 = sqrtf((headY - anchorY) * (headY - anchorY) + (headX - anchorX) * (headX - anchorX)) ; if (8.0 < fVar6) { if (16.0 <= fVar6) { local_2c.y = dirX * 16.0 + anchorX; fVar6 = normDir.y * 16.0 + anchorY; } else { local_2c.y = *headPos; fVar6 = *(float *)(iVar4 + 0x340); } if (param_1 == '\0') { *(undefined1 *)(in_ECX + 0x171) = 1; *(undefined4 *)(in_ECX + 0x188) = 4; } if ((*state == 3) || (((iVar1 = *(int *)(in_ECX + 0x3c0), iVar1 != 0 && (*(int *)(iVar1 + 0x28) == 0x387)) && (*(int *)(iVar1 + 0x2c) == 10)))) { *(float *)(in_ECX + 0x33c) = (anchorX + local_2c.y) * 0.5; *(float *)(in_ECX + 0x340) = (anchorY + fVar6) * 0.5; *(float *)(in_ECX + 0x360) = g_vectorZero.x; *(float *)(in_ECX + 0x364) = g_vectorZero.y; } *(undefined4 *)(in_ECX + 0x350) = 0xc20c0000; angleDeg = atan2f(normDir.y,dirX); angleDeg = angleDeg * 57.295776; if ((90.0 < angleDeg) || (angleDeg < -90.0)) { isFlipX = 1; angleDeg = 180.0 - angleDeg; } else { isFlipX = 0; } *(undefined1 *)(in_ECX + 0x148) = isFlipX; *(float *)(in_ECX + 0xec) = angleDeg; anchorX = local_2c.y; anchorY = fVar6; } else if (param_1 == '\0') { *(float *)(in_ECX + 0x33c) = *headPos; *(undefined4 *)(in_ECX + 0x340) = *(undefined4 *)(iVar4 + 0x340); *(undefined1 *)(in_ECX + 0x171) = 0; *(undefined4 *)(in_ECX + 0x188) = 0; } in_ECX = *parentSlot; parentSlot = (int *)(in_ECX + 0x3bc); iVar1 = *(int *)(in_ECX + 0x3bc); } } } return; } //@@ 005ad1c0 FUN_005ad1c0 void FUN_005ad1c0(void) { int *piVar1; int iVar2; Manager *pMVar3; int in_ECX; int *local_8; iVar2 = *(int *)(in_ECX + 0x3c0); if (((iVar2 == 0) || (*(int *)(iVar2 + 0x28) != 0x387)) || (*(int *)(iVar2 + 0x2c) != 10)) { piVar1 = (int *)(in_ECX + 0x3c4); *(float *)(in_ECX + 0x334) = g_vectorZero.x; *(float *)(in_ECX + 0x338) = g_vectorZero.y; if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); } pMVar3 = g_manager; *piVar1 = 0; *(undefined4 *)(in_ECX + 0xb64) = 4; SFXManager::Stop(&pMVar3->_sfxManager,0x1f7); } return; } //@@ 005ad250 NpcAI::ENTITY_VISAGE_chain /* DB: dispatch type 903 (Visage) variant 10 (chain); siblings ENTITY_VISAGE (0), ENTITY_VISAGE_mask (1), FUN_005ad8a0 (0x14 plasma) */ void __fastcall NpcAI::ENTITY_VISAGE_chain(Entity_NPC *npc) { char cVar1; byte isInRoom; int visage; EntityPtr EVar2; EntityRef *sourceRef; byte *anim; int iVar3; uint uVar4; EntityPtr EVar5; uint uVar6; EntityPtr EVar7; float fVar8; float fVar9; ColorMod local_34; void *animData; undefined4 flagsHigh; if (npc->_aiCallPhase == 2) { NpcHelper::visage_chain_solve(1); return; } if (npc->_i1 != 0) { return; } visage = FUN_005accb0(); EVar2 = (EntityPtr)FUN_005acc70(); if ((npc->_dead == 0) && (((visage == 0 || (*(char *)(visage + 0x173) != '\0')) || ((cVar1 = FUN_005accf0(), cVar1 != '\0' && ((EVar2 == (EntityPtr)0x0 && (*(uint *)(visage + 0xb64) < 0x69)))))))) { if (npc->_entityCollisionClass == 0) { (**(code **)(*(int *)npc + 0x28))(); } else { sourceRef = EntityRef::EntityRef((EntityRef *)&local_34); (**(code **)(*(int *)npc + 0x24))(sourceRef); } } switch(npc->_state) { case 0: local_34._tint[0] = 1.0; local_34._tint[1] = 1.0; local_34._tint[2] = 1.0; local_34._tint[3] = 1.0; npc->_state = 3; local_34._colorize[0] = 1.0; local_34._colorize[1] = 1.0; local_34._colorize[2] = 1.0; local_34._colorize[3] = 1.0; local_34._offset[0] = 0.0; local_34._offset[1] = 0.0; local_34._offset[2] = 0.0; Color::operator_assign((Color *)&npc->_splatColor,&local_34); anim = s_Idle2; if ((npc->_subtype & 1) == 0) { anim = &DAT_00b601c4; } ANM2::SetFrame(&npc->_sprite,(std_string *)anim,0); if ((visage != 0) && (iVar3 = FUN_005a7570(), 0 < iVar3)) { flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10; npc->_state = 4; npc->_isInvicible = 1; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; cVar1 = FUN_005acd10(); if (cVar1 != '\0') { ANM2::SetFrame(&npc->_sprite,(std_string *)&DAT_00b1d43c,0); (npc->_pos).x = *(float *)(visage + 0x33c); (npc->_pos).y = *(float *)(visage + 0x340); } } *(uint *)&npc->_flags = (uint)npc->_flags | 0x10001; flagsHigh = *(undefined4 *)((int)&npc->_flags + 4); npc->_aiCallFlags = npc->_aiCallFlags | 2; *(undefined4 *)((int)&npc->_flags + 4) = flagsHigh; npc->_entityCollisionClass = 0; npc->_i1 = 0; goto LAB_005ad5c4; case 3: goto LAB_005ad441; case 4: cVar1 = FUN_005acd10(); if ((cVar1 != '\0') && (visage != 0)) { (npc->_pos).x = *(float *)(visage + 0x33c); (npc->_pos).y = *(float *)(visage + 0x340); (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } goto LAB_005ad441; case 5: npc->_friction = npc->_friction * 0.85; fVar9 = (npc->_targetPosition).y; (npc->_velocity).x = (npc->_targetPosition).x * 7.0 + (npc->_velocity).x; (npc->_velocity).y = fVar9 * 7.0 + (npc->_velocity).y; NpcHelper::visage_chain_solve(0); if ((npc->_collidesWithGrid != 0) || (isInRoom = Room::IsPositionInRoom(g_game->_room,&npc->_pos,0.0), isInRoom == 0)) { Entity_NPC::PlaySound(npc,0x8a,1.0,2,0,1.0); npc->_state = 6; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; } break; case 6: (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; NpcHelper::visage_chain_solve(0); LAB_005ad5c4: npc->_visible = 0; break; case 7: NpcHelper::visage_chain_solve(0); EVar7 = npc->_target; if (EVar7 == (EntityPtr)0x0) { FUN_005ad1c0(); } else { fVar9 = *(float *)((int)EVar7 + 0x340); (npc->_pos).x = *(float *)((int)EVar7 + 0x33c); (npc->_pos).y = fVar9; fVar9 = *(float *)((int)npc->_target + 0x364); (npc->_velocity).x = *(float *)((int)npc->_target + 0x360); (npc->_velocity).y = fVar9; } if (npc->_target == EVar2) goto LAB_005ad5c4; } LAB_005ad5cb: if (npc->_state != 3) goto LAB_005ad790; EVar2 = npc->_parent; if (((EVar2 == (EntityPtr)0x0) || (*(int *)((int)EVar2 + 0x28) != 0x387)) || (*(int *)((int)EVar2 + 0x2c) != 10)) { EVar2 = (EntityPtr)npc; fVar9 = 1e+10; do { fVar8 = fVar9; if (*(int *)((int)EVar2 + 0x2c) != 10) break; fVar8 = *(float *)((int)EVar2 + 0x380) - *(float *)((int)EVar2 + 0x14); EVar2 = *(EntityPtr *)((int)EVar2 + 0x3c0); if (fVar9 <= fVar8) { fVar8 = fVar9; } fVar9 = fVar8; } while (EVar2 != (EntityPtr)0x0); EVar2 = (EntityPtr)npc; do { if (*(int *)((int)EVar2 + 0x2c) != 10) break; fVar9 = *(float *)((int)EVar2 + 0x380) - *(float *)((int)EVar2 + 0x14); if (fVar8 < fVar9) { local_34._colorize[0] = (npc->_pos).x; local_34._colorize[1] = (npc->_pos).y; local_34._tint[0] = (float)npc->_type; local_34._tint[1] = (float)npc->_variant; local_34._tint[2] = (float)npc->_spawnerType; local_34._tint[3] = (float)npc->_spawnerVariant; local_34._colorize[2] = (npc->_velocity).x; local_34._colorize[3] = (npc->_velocity).y; if ((npc->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } local_34._offset[0] = (float)(uVar4 | uVar6 | (uint)((npc->_flags & 0x100) != 0)); local_34._offset[1] = (float)npc; (**(code **)(*(int *)EVar2 + 0x20))(fVar9 - fVar8,0,0,&local_34,0x1e); } EVar2 = *(EntityPtr *)((int)EVar2 + 0x3c0); } while (EVar2 != (EntityPtr)0x0); } fVar9 = npc->_maxHitPoints * 0.25; if ((npc->_health < fVar9) || (fVar9 <= npc->_health - npc->_pendingDamage)) goto LAB_005ad790; animData = (npc->_sprite)._animState._animData; if (animData == (void *)0x0) { uVar6 = 0xffffffff; LAB_005ad76f: uVar4 = Random(); uVar4 = uVar4 % uVar6; if ((npc->_sprite)._animState._animData == (void *)0x0) goto LAB_005ad790; } else { uVar6 = *(int *)((int)animData + 0x30) - 1; if (uVar6 != 0) goto LAB_005ad76f; uVar4 = 0; } AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)(int)(uVar4 + 1)); LAB_005ad790: if (npc->_dead != 0) { EVar2 = npc->_parent; EVar7 = (EntityPtr)npc; if (npc->_parent != (EntityPtr)0x0) { do { EVar5 = EVar2; if (*(int *)((int)EVar5 + 0x2c) != 10) break; EVar2 = *(EntityPtr *)((int)EVar5 + 0x3bc); EVar7 = EVar5; } while (*(EntityPtr *)((int)EVar5 + 0x3bc) != (EntityPtr)0x0); if ((EVar7 != (EntityPtr)npc) && (*(byte *)((int)EVar7 + 0x173) != 0)) { return; } } for (EVar2 = *(EntityPtr *)((int)EVar7 + 0x3c0); (EVar2 != (EntityPtr)0x0 && (*(int *)((int)EVar2 + 0x2c) == 10)); EVar2 = *(EntityPtr *)((int)EVar2 + 0x3c0)) { *(int *)((int)EVar2 + 0xbc0) = 1; if (*(int *)((int)EVar2 + 0x188) == 0) { (**(code **)(*(int *)EVar2 + 0x28))(); } else { local_34._tint[0] = 0.0; local_34._tint[1] = 0.0; local_34._tint[2] = 0.0; local_34._tint[3] = 0.0; local_34._colorize[0] = g_vectorZero.x; local_34._colorize[1] = g_vectorZero.y; local_34._colorize[2] = g_vectorZero.x; local_34._colorize[3] = g_vectorZero.y; local_34._offset[0] = 0.0; local_34._offset[1] = 0.0; (**(code **)(*(int *)EVar2 + 0x24))(&local_34); } } } return; LAB_005ad441: NpcHelper::visage_chain_solve(0); goto LAB_005ad5cb; } //@@ 005ad8a0 NpcAI::ENTITY_VISAGE_plasma /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: dispatcher case 0xd7 (Visage 903) variant 0x14 (VISAGE_PLASMA), beside NpcAI::ENTITY_VISAGE (variant 0) and ENTITY_VISAGE_mask (variant 1) */ void __fastcall NpcAI::ENTITY_VISAGE_plasma(Entity_NPC *npc) { float *pfVar1; float fVar2; float roomMaxX; undefined4 uVar4; LayerState *layer; int iVar5; float fVar6; float clampedY; float signY; float signX; float fVar7; EntityPtr *local_18; float local_14; float velocityDirX; float steerY; float steerX; Game *game; uint graphicsFlags; void *room; float roomMaxX; EntityPtr target; graphicsFlags = g_graphicsManager_flags; iVar5 = npc->_state; if (iVar5 == 0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); iVar5 = 1; if ((graphicsFlags & 4) == 0) { iVar5 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar5; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; npc->_state = 3; fVar2 = fRam00c34c7c; fVar7 = fRam00c34c78; fVar6 = fRam00c34c74; if (&npc->_splatColor != (ColorMod *)&DAT_00c34c70) { (npc->_splatColor)._tint[0] = _DAT_00c34c70; (npc->_splatColor)._tint[1] = fVar6; (npc->_splatColor)._tint[2] = fVar7; (npc->_splatColor)._tint[3] = fVar2; fVar2 = fRam00c34c8c; fVar7 = fRam00c34c88; fVar6 = fRam00c34c84; (npc->_splatColor)._colorize[0] = _DAT_00c34c80; (npc->_splatColor)._colorize[1] = fVar6; (npc->_splatColor)._colorize[2] = fVar7; (npc->_splatColor)._colorize[3] = fVar2; *(undefined8 *)(npc->_splatColor)._offset = DAT_00c34c90; (npc->_splatColor)._offset[2] = DAT_00c34c98; } uVar4 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 1; *(undefined4 *)((int)&npc->_flags + 4) = uVar4; ANM2::Play(&npc->_sprite,s_Idle,0); (npc->_v1).x = 0.6; } else if (iVar5 == 3) { target = npc->_target; if (target != (EntityPtr)0x0) { if (((*(int *)((int)target + 0x28) == 0x387) && (*(int *)((int)target + 0x2c) == 1)) && (*(int *)((int)target + 0xb64) == 0x6d)) { local_18 = (EntityPtr *)(npc->_velocity).x; local_14 = (npc->_velocity).y; velocityDirX = (float)local_18; fVar6 = sqrtf((float)local_18 * (float)local_18 + local_14 * local_14); if (0.0 < fVar6) { velocityDirX = (1.0 / fVar6) * velocityDirX; local_14 = (npc->_velocity).y * (1.0 / fVar6); } steerX = *(float *)((int)target + 0x33c) - (npc->_pos).x; steerY = *(float *)((int)target + 0x340) - (npc->_pos).y; fVar6 = sqrtf(steerX * steerX + steerY * steerY); if (0.0 < fVar6) { steerX = steerX * (1.0 / fVar6); steerY = steerY * (1.0 / fVar6); } steerX = steerX * 0.2 + velocityDirX; steerY = steerY * 0.2 + local_14; fVar6 = sqrtf(steerX * steerX + steerY * steerY); if (0.0 < fVar6) { steerX = steerX * (1.0 / fVar6); steerY = steerY * (1.0 / fVar6); } local_14 = npc->_friction * 0.8; (npc->_v1).x = 1.0; npc->_friction = local_14; fVar6 = (npc->_velocity).y; fVar6 = sqrtf((float)local_18 * (float)local_18 + fVar6 * fVar6); fVar6 = fVar6 + 1.0 / local_14; (npc->_velocity).x = steerX * fVar6; (npc->_velocity).y = steerY * fVar6; return; } local_18 = &npc->_target; std::multiset::erase(&local_18); npc->_target = (EntityPtr)0x0; } game = g_game; fVar6 = (npc->_pos).x; signX = (float)&DAT_bf800000; (npc->_v1).x = 0.5; room = game->_room; fVar7 = *(float *)((int)room + 0x14); fVar2 = *(float *)((int)room + 0x18); roomMaxX = *(float *)((int)room + 0x1c); roomMaxX = *(float *)((int)room + 0x20); if ((fVar7 <= fVar6) || (0.0 < (npc->_velocity).x || (npc->_velocity).x == 0.0)) { if ((roomMaxX < fVar6) && (0.0 < (npc->_velocity).x)) { (npc->_velocity).x = (float)&DAT_bf800000; } } else { (npc->_velocity).x = 1.0; } clampedY = (npc->_pos).y; if ((fVar2 <= clampedY) || (pfVar1 = &(npc->_velocity).y, 0.0 < *pfVar1 || *pfVar1 == 0.0)) { if ((roomMaxX < clampedY) && (0.0 < (npc->_velocity).y)) { (npc->_velocity).y = (float)&DAT_bf800000; } } else { (npc->_velocity).y = 1.0; } if (fVar6 <= fVar7) { fVar6 = fVar7; } if (clampedY <= fVar2) { clampedY = fVar2; } pfVar1 = &(npc->_velocity).y; fVar2 = *pfVar1; fVar7 = *pfVar1; if (roomMaxX <= fVar6) { fVar6 = roomMaxX; } if (roomMaxX <= clampedY) { clampedY = roomMaxX; } (npc->_pos).x = fVar6; (npc->_pos).y = clampedY; if (0.1 < fVar7 || fVar2 == 0.1) { signY = 1.0; } else { signY = (float)&DAT_bf800000; } fVar6 = (npc->_velocity).x; if (0.0 <= fVar6) { signX = 1.0; } fVar7 = npc->_friction * 0.8; npc->_friction = fVar7; if (fVar7 != 0.0) { fVar2 = npc->_speedMultiplier; (npc->_velocity).x = (signX * 0.5 * fVar2) / fVar7 + fVar6; (npc->_velocity).y = (signY * 0.5 * fVar2) / fVar7 + (npc->_velocity).y; return; } } else if (iVar5 == 4) { npc->_friction = npc->_friction * 0.9; return; } return; } //@@ 005add40 NpcHelper::visage_handle_collision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? per-type collision hook reached from Entity_NPC::HandleCollision: Visage body (variant 0) in state 0x76 touching ENTITY_VISAGE (0x387) variant 0x14 plays sound 0xb9 with rising pitch, removes it via its vtable and heals; other variants check type 9 variant 2 projectiles */ undefined4 NpcHelper::visage_handle_collision(EntityPtr param_1) { EntityPtr EVar1; Entity_NPC *in_ECX; float newHealth; float healCap; int iVar2; float local_3c; EntityPtr *local_38; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; EntityPtr *targetRef; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar2 = in_ECX->_variant; if (iVar2 == 0) { if (((in_ECX->_state != 0x76) || (*(int *)((int)param_1 + 0x28) != 0x387)) || (*(int *)((int)param_1 + 0x2c) != 0x14)) { return 0xff; } Entity_NPC::PlaySound(in_ECX,0xb9,1.0,2,0,(float)in_ECX->_stateFrame * 0.15 + 1.0); in_ECX->_stateFrame = in_ECX->_stateFrame + 1; (**(code **)(*(int *)param_1 + 0x28))(); local_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; local_14 = 0x3f800000; local_10 = 0x3dcccccd; local_c = 0; local_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; (**(code **)(*(int *)in_ECX + 0x3c))(&local_34,10,0xff,1,1); healCap = in_ECX->_maxHitPoints * 0.4; newHealth = in_ECX->_maxHitPoints * 0.025 + in_ECX->_health; if (healCap <= newHealth) { newHealth = healCap; } in_ECX->_health = newHealth; return 0xff; } if (iVar2 == 1) { if ((*(int *)((int)param_1 + 0x28) == 9) && (*(int *)((int)param_1 + 0x2c) == 2)) { *(undefined1 *)((int)param_1 + 0x173) = 1; return 0; } if ((param_1 == in_ECX->_parent) && (in_ECX->_state == 0x6c)) { return 1; } if (*(int *)((int)param_1 + 0x28) != 0x387) { return 0xff; } if (*(int *)((int)param_1 + 0x2c) != 0x14) { return 0xff; } if (*(int *)((int)param_1 + 0xb64) == 4) { return 0xff; } if ((in_ECX->_state == 0x6a) || (in_ECX->_state == 0x6d)) { (**(code **)(*(int *)param_1 + 0x28))(); local_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; local_14 = 0x3f800000; local_10 = 0x3e19999a; local_c = 0; local_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; (**(code **)(*(int *)in_ECX + 0x3c))(&local_34,10,0xff,1,1); visage_start_charge(); return 0xff; } return 0xff; } if (iVar2 != 10) { if (iVar2 == 0x14) { return 0xff; } return 0; } targetRef = &in_ECX->_target; if (param_1 == in_ECX->_target) { return 1; } if (in_ECX->_state != 5) { return 0xff; } iVar2 = *(int *)((int)param_1 + 0x28); if (iVar2 == 1) { iVar2 = 0x4d; } else { if (iVar2 == 4) { iVar2 = *(int *)((int)param_1 + 0x410) + 1; *(int *)((int)param_1 + 0x410) = iVar2; *(int *)((int)param_1 + 0x414) = iVar2; goto LAB_005adfbb; } if (iVar2 != 0x387) { return 0xff; } if (*(int *)((int)param_1 + 0x2c) != 1) { return 0xff; } iVar2 = 0x8a; } Entity_NPC::PlaySound(in_ECX,iVar2,1.0,2,0,1.0); LAB_005adfbb: EVar1 = (EntityPtr)FUN_005acc70(); if ((param_1 == EVar1) && (*(int *)((int)param_1 + 0xb64) == 0x6a)) { local_3c = *(float *)((int)param_1 + 0x33c) - *(float *)(*(int *)((int)param_1 + 0x3bc) + 0x33c) ; local_38 = (EntityPtr *) (*(float *)((int)param_1 + 0x340) - *(float *)(*(int *)((int)param_1 + 0x3bc) + 0x340)); FUN_005aafd0(&local_3c); *(int *)((int)param_1 + 0xb64) = 0x6b; } if (*targetRef != (EntityPtr)0x0) { local_38 = targetRef; std::multiset::erase(&local_38); } *targetRef = param_1; std::multiset::insert(targetRef); in_ECX->_state = 7; (in_ECX->_velocity).x = g_vectorZero.x; (in_ECX->_velocity).y = g_vectorZero.y; return 1; } //@@ 005ae0b0 position_is_over_pit /* DB: ? ECX = Vector* position: converts to grid cell ((x-40)/40, (y-120)/40 rounded), returns true when it is in the room and the cell's GridEntity type is 7 (PIT); only callers NpcAI::ENTITY_WORMWOOD_main / segment_follow */ uint position_is_over_pit(void) { void *pvVar1; Game *pGVar2; float *in_ECX; int iVar3; int iVar4; pvVar1 = g_game->_room; iVar4 = (int)((*in_ECX - 40.0) / 40.0 + 0.5); pGVar2 = g_game; if (((((iVar4 < 0) || (pGVar2 = *(Game **)((int)pvVar1 + 0xc), (int)pGVar2 <= iVar4)) || (iVar3 = (int)((in_ECX[1] - 120.0) / 40.0 + 0.5), iVar3 < 0)) || ((*(int *)((int)pvVar1 + 0x10) <= iVar3 || (pGVar2 = (Game *)((int)pGVar2 * iVar3 + iVar4), (int)pGVar2 < 0)))) || ((0x1bf < (int)pGVar2 || ((pGVar2 = *(Game **)((int)pvVar1 + (int)pGVar2 * 4 + 0x24), pGVar2 == (Game *)0x0 || (pGVar2->_stageType != 7)))))) { return (uint)pGVar2 & 0xffffff00; } return CONCAT31((int3)((uint)pGVar2 >> 8),1); } //@@ 005ae140 NpcHelper::wormwood_spawn_splash /* DB: ECX = Wormwood npc: spawns effect 1000.132 at its position and plays sound 474; returns the effect; called from NpcAI::ENTITY_WORMWOOD_main when it dives/emerges and ENTITY_WORMWOOD_segment_follow when a segment crosses the water line */ Entity * NpcHelper::wormwood_spawn_splash(void) { Manager *pMVar1; uint seed; Entity *pEVar2; int in_ECX; int local_8; seed = Random(); pEVar2 = Game::Spawn(g_game,1000,0x84,(Vector *)(in_ECX + 0x33c),&g_vectorZero,(Entity *)0x0,0, seed); (**(code **)(*(int *)pEVar2 + 0xc))(); pMVar1 = g_manager; local_8 = 0x1da; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.0,10,0,1.0,0.0); return pEVar2; } //@@ 005ae1d0 FUN_005ae1d0 bool FUN_005ae1d0(void) { Game *pGVar1; uint uVar2; pGVar1 = g_game; if (g_game->_challenge == 0x2c) { uVar2 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); uVar2 = RoomConfig::GetStageID(pGVar1->_stage,uVar2,-1); return uVar2 == 0x21; } if (g_game->_currentDimensionIdx == 2) { return false; } uVar2 = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); return uVar2 == 0x21; } //@@ 005ae230 NpcAI::ENTITY_WORMWOOD_pick_pit /* DB: ? ECX=npc (Wormwood): scans room grid for pits (grid type 7), scores 500-distance+random*40 (+100 when pits adjoin), stores the best grid index at npc+0xba4; from ENTITY_WORMWOOD_main */ void __fastcall NpcAI::ENTITY_WORMWOOD_pick_pit(Entity_NPC *npc) { int *piVar1; int *piVar2; int iVar3; uint uVar4; int iVar5; int iVar6; void *pvVar7; int iVar8; int iVar9; float fVar10; float fVar11; int local_10; float local_c; int local_8; pvVar7 = g_game->_room; iVar8 = 0; iVar9 = -1; local_c = 0.0; local_10 = -1; piVar1 = (int *)((int)pvVar7 + 0x10); piVar2 = (int *)((int)pvVar7 + 0xc); iVar6 = *piVar2; if (0 < *piVar1 * iVar6) { local_8 = 0x24; do { if ((((-1 < iVar8) && (iVar8 < 0x1c0)) && (*(int *)(local_8 + (int)pvVar7) != 0)) && (*(int *)(*(int *)(local_8 + (int)pvVar7) + 4) == 7)) { iVar9 = iVar8 / iVar6; iVar6 = iVar8 % iVar6; fVar11 = (npc->_pos).x - ((float)iVar6 * 40.0 + 40.0); fVar10 = (npc->_pos).y - ((float)iVar9 * 40.0 + 120.0); fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); uVar4 = Random(); pvVar7 = g_game->_room; fVar10 = (500.0 - fVar10) + (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if ((((((-1 < iVar6 + -1) && (iVar3 = *(int *)((int)pvVar7 + 0xc), iVar6 + -1 < iVar3)) && ((-1 < iVar9 && ((iVar9 < *(int *)((int)pvVar7 + 0x10) && (iVar5 = iVar3 * iVar9 + iVar6 + -1, -1 < iVar5)))))) && ((iVar5 < 0x1c0 && (((iVar5 = *(int *)((int)pvVar7 + iVar5 * 4 + 0x24), iVar5 != 0 && (*(int *)(iVar5 + 4) == 7)) && (iVar6 + 1 < iVar3)))))) && (((iVar5 = iVar3 * iVar9 + iVar6 + 1, -1 < iVar5 && (iVar5 < 0x1c0)) && ((((iVar5 = *(int *)((int)pvVar7 + iVar5 * 4 + 0x24), iVar5 != 0 && ((*(int *)(iVar5 + 4) == 7 && (iVar5 = iVar9 + -1, iVar6 < iVar3)))) && (-1 < iVar5) ) && ((((iVar5 < *(int *)((int)pvVar7 + 0x10) && (iVar5 = iVar5 * iVar3 + iVar6, -1 < iVar5)) && (iVar5 < 0x1c0)) && (((iVar5 = *(int *)((int)pvVar7 + iVar5 * 4 + 0x24), iVar5 != 0 && (*(int *)(iVar5 + 4) == 7)) && ((iVar9 + 1 < *(int *)((int)pvVar7 + 0x10) && ((iVar6 = iVar3 * (iVar9 + 1) + iVar6, -1 < iVar6 && (iVar6 < 0x1c0)))))))))) )))) && ((iVar6 = *(int *)((int)pvVar7 + iVar6 * 4 + 0x24), iVar6 != 0 && (*(int *)(iVar6 + 4) == 7)))) { fVar10 = fVar10 + 100.0; } if (fVar10 <= local_c) { iVar9 = local_10; } else { iVar9 = iVar8; local_10 = iVar8; local_c = fVar10; } } iVar8 = iVar8 + 1; local_8 = local_8 + 4; iVar6 = *piVar2; } while (iVar8 < *piVar1 * iVar6); if (-1 < iVar9) { npc->_projectileDelay = iVar9; } } return; } //@@ 005ae490 Entity_Familiar::ai_buddy_inbox /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix21/22] __thiscall void Entity_Familiar::ai_buddy_inbox(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Familiar::ai_buddy_inbox(Entity_Familiar *this) { byte bVar1; char cVar2; int backAnimOffset; uint uVar3; byte *pbVar4; byte unused; byte *pbVar5; byte *pbVar6; char *pcVar7; bool isLess; float angle; undefined8 uVar8; Vector VStack_c0; float savedFrame; ProjectileParams projParams; float securityCookie; int headState; EntityPtr parent; securityCookie = (float)(__security_cookie ^ (uint)&(&projParams)[1].CircleAngle); switch(this->_subtype) { case 0: backAnimOffset = 0; headState = *(int *)&(this->_pathfinder).field_0x5c4; if ((this->_velocity).y < 0.0) { backAnimOffset = 4; } if (headState != 1) { if (headState == 2) { ANM2::Play(&this->_sprite, *(byte **)((int)&PTR_s_HeadFrontWiggleOpen_00b62994 + backAnimOffset),0); return; } ANM2::Play(&this->_sprite, *(byte **)((int)&PTR_s_HeadFrontWiggleClosed_00b6299c + backAnimOffset),0); return; } VStack_c0.y = *(float *)((int)&PTR_s_HeadFrontWiggleTransition_00b6298c + backAnimOffset); uVar8 = _string_holder_c_str(); pbVar5 = (byte *)uVar8; do { pbVar6 = (byte *)((ulonglong)uVar8 >> 0x20); pbVar4 = (byte *)uVar8; bVar1 = *pbVar4; isLess = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_005ae518: uVar3 = -(uint)isLess | 1; goto LAB_005ae51d; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_005ae518; uVar8 = CONCAT44(pbVar6 + 2,pbVar4 + 2); } while (bVar1 != 0); uVar3 = 0; LAB_005ae51d: if (uVar3 == 0) { LAB_005ae551: pcVar7 = "HeadBackWiggleTransition"; do { bVar1 = *pbVar5; isLess = bVar1 < (byte)*pcVar7; if (bVar1 != *pcVar7) { LAB_005ae576: uVar3 = -(uint)isLess | 1; goto LAB_005ae57b; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; isLess = bVar1 < (byte)pcVar7[1]; if (bVar1 != pcVar7[1]) goto LAB_005ae576; pbVar5 = pbVar5 + 2; pcVar7 = pcVar7 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_005ae57b: if (uVar3 == 0) goto LAB_005ae57f; ANM2::Play(&this->_sprite,(byte *)VStack_c0.y,0); } else { pcVar7 = "HeadFrontWiggleTransition"; pbVar4 = pbVar5; do { bVar1 = *pbVar4; isLess = bVar1 < (byte)*pcVar7; if (bVar1 != *pcVar7) { LAB_005ae548: uVar3 = -(uint)isLess | 1; goto LAB_005ae54d; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < (byte)pcVar7[1]; if (bVar1 != pcVar7[1]) goto LAB_005ae548; pbVar4 = pbVar4 + 2; pcVar7 = pcVar7 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_005ae54d: if (uVar3 != 0) goto LAB_005ae551; LAB_005ae57f: if ((this->_sprite)._animState._animData == (void *)0x0) { savedFrame = (float)&DAT_bf800000; } else { savedFrame = (this->_sprite)._animState._animFrame; } ANM2::Play(&this->_sprite,(byte *)VStack_c0.y,0); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,savedFrame); } } bVar1 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if (bVar1 != 0) { Entity_NPC::PlaySound((Entity_NPC *)this,0xe2,1.0,2,0,1.0); ProjectileParams::ProjectileParams(&projParams); cVar2 = FUN_005ae1d0(); if (cVar2 == '\0') { uVar3 = Game::GetStageID(g_game,unused); projParams.Variant = (uVar3 != 0x1c) + 3; } VStack_c0.x = 10.0; VStack_c0.y = 0.0; Entity_NPC::FireProjectiles((Entity_NPC *)this,&this->_pos,&VStack_c0,6,&projParams); } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { *(undefined4 *)&(this->_pathfinder).field_0x5c4 = 2; return; } break; case 1: ANM2::Play(&this->_sprite,(byte *)"Body1Wiggle",0); return; case 2: ANM2::Play(&this->_sprite,(byte *)"Body2Wiggle",0); return; case 3: ANM2::Play(&this->_sprite,(byte *)"Body3Wiggle",0); return; case 4: ANM2::Play(&this->_sprite,(byte *)"Body4Wiggle",0); return; case 5: ANM2::Play(&this->_sprite,(byte *)"Body5Wiggle",0); return; case 6: ANM2::Play(&this->_sprite,(byte *)"Body6Wiggle",0); parent = this->_parent; angle = atan2f(((*(float *)((int)parent + 0x340) + *(float *)((int)parent + 0x350)) - (this->_pos).y) - (this->_posOffset).y, ((*(float *)((int)parent + 0x33c) + *(float *)((int)parent + 0x34c)) - (this->_pos).x) - (this->_posOffset).x); angle = normalize_angle_degrees(angle * 57.295776 - (this->_sprite)._rotation); angle = normalize_angle_degrees(angle * 0.3 + (this->_sprite)._rotation); (this->_sprite)._rotation = angle; } return; } //@@ 005ae840 NpcAI::ENTITY_WORMWOOD_segment_follow /* DB: ? called once from ENTITY_WORMWOOD_main: segment follows the parent (npc+0x3bc) recorded path deque (+0xc04..+0xc24) using +0xbb0/+0xbb4 (V1) progress, sets velocity +0x360/+0x364 */ void __fastcall NpcAI::ENTITY_WORMWOOD_segment_follow(Entity_NPC *npc) { char isOverPit; int iVar1; LayerState *layer; int entityCollisionClass; uint uVar2; uint uVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; Vector scratchVec; float pitCheckX; float local_54; float segmentDx; float local_4c; float local_48; uint pathBlockIndex; float prevHeight; uint pathOffset; uint heightBlockIndex; int *parentHeightProxy; float pathDistance; uint heightIndex; float pointY; float pointX; EntityPtr local_20; int *parentPathProxy; uint pathIndex; float pointHeight; uint *heightDequeSize; fVar6 = (npc->_v1).y; local_20 = npc->_parent; prevHeight = fVar6; if (local_20 != (EntityPtr)0x0) { parentPathProxy = *(int **)((int)local_20 + 0xc04); uVar2 = *(uint *)((int)local_20 + 0xc10); pointX = *(float *)((int)local_20 + 0x33c); pointY = *(float *)((int)local_20 + 0x340); pointHeight = *(float *)((int)local_20 + 0xbb4); heightIndex = *(uint *)((int)local_20 + 0xc24); parentHeightProxy = *(int **)((int)local_20 + 0xc18); pathDistance = 0.0; pathOffset = uVar2; pathIndex = uVar2; LAB_005ae8d9: do { local_4c = (float)(*(int *)((int)local_20 + 0xc14) + uVar2); if ((float)pathIndex == local_4c) { fVar4 = (npc->_v1).x; fVar6 = (npc->_v1).y; LAB_005aeb67: fVar6 = fVar4 * npc->_speedMultiplier + fVar6; (npc->_v1).y = fVar6; break; } if (parentPathProxy == (int *)0x0) { iVar1 = 0; } else { iVar1 = *parentPathProxy; } uVar3 = pathIndex & 1; pathBlockIndex = pathIndex >> 1; iVar1 = *(int *)(*(int *)(iVar1 + 4) + (*(int *)(iVar1 + 8) - 1U & pathBlockIndex) * 4); segmentDx = *(float *)(iVar1 + uVar3 * 8) - pointX; local_54 = *(float *)(iVar1 + 4 + uVar3 * 8) - pointY; if (parentHeightProxy == (int *)0x0) { iVar1 = 0; } else { iVar1 = *parentHeightProxy; } heightBlockIndex = heightIndex >> 1; local_48 = (float)((heightIndex & 1) * 8); scratchVec.y = *(float *)(*(int *)(*(int *)(iVar1 + 4) + (*(int *)(iVar1 + 8) - 1U & heightBlockIndex) * 4) + 4 + (int)local_48) - pointHeight; fVar4 = sqrtf(local_54 * local_54 + segmentDx * segmentDx + scratchVec.y * scratchVec.y); uVar2 = pathOffset; fVar6 = fVar4 + pathDistance; if (20.0 < fVar6) { fVar6 = npc->_friction; fVar4 = (20.0 - pathDistance) / fVar4; fVar5 = (npc->_pos).x; (npc->_velocity).y = ((fVar4 * local_54 + pointY) - (npc->_pos).y) / fVar6; (npc->_velocity).x = ((fVar4 * segmentDx + pointX) - fVar5) / fVar6; fVar6 = (npc->_v1).y; fVar4 = (fVar4 * scratchVec.y + pointHeight) - fVar6; (npc->_v1).x = fVar4; goto LAB_005aeb67; } if (parentPathProxy == (int *)0x0) { iVar1 = 0; } else { iVar1 = *parentPathProxy; } iVar1 = *(int *)(*(int *)(iVar1 + 4) + (*(int *)(iVar1 + 8) - 1U & pathBlockIndex) * 4); pointX = *(float *)(iVar1 + uVar3 * 8); pointY = *(float *)(iVar1 + 4 + uVar3 * 8); if (parentHeightProxy == (int *)0x0) { iVar1 = 0; } else { iVar1 = *parentHeightProxy; } heightIndex = heightIndex + 1; pointHeight = *(float *)(*(int *)(*(int *)(iVar1 + 4) + (*(int *)(iVar1 + 8) - 1U & heightBlockIndex) * 4) + 4 + (int)local_48); pathIndex = pathIndex + 1; pathDistance = fVar6; if ((float)pathIndex != local_4c) goto LAB_005ae8d9; local_4c = pointX - (npc->_pos).x; local_48 = pointY - (npc->_pos).y; fVar6 = pointHeight - (npc->_v1).y; fVar6 = sqrtf(local_48 * local_48 + local_4c * local_4c + fVar6 * fVar6); if (fVar6 <= 20.0) goto LAB_005ae8d9; fVar6 = npc->_friction; (npc->_velocity).x = local_4c / fVar6; (npc->_velocity).y = local_48 / fVar6; (npc->_v1).x = pointHeight - (npc->_v1).y; uVar2 = *(uint *)((int)local_20 + 0xc10); pathOffset = uVar2; } while( true ); } fVar4 = 0.0; if (npc->_subtype != 0) goto LAB_005aed71; fVar5 = npc->_speedMultiplier * 0.2; fVar7 = fVar5 + (npc->_v1).x; if ((fVar7 < 0.0) || (fVar6 < 14.0)) { fVar5 = fVar7 + fVar5; fVar6 = fVar7 * npc->_speedMultiplier + fVar6; (npc->_v1).x = fVar5; (npc->_v1).y = fVar6; if ((prevHeight <= -8.0) && ((-8.0 < fVar6 && (0.0 < fVar5)))) { fVar7 = (npc->_pos).x; fVar8 = (npc->_pos).y; pitCheckX = fVar7 - 10.0; scratchVec.y = fVar8 + 0.0; local_54 = scratchVec.y; isOverPit = position_is_over_pit(); if (isOverPit != '\0') { pitCheckX = fVar7 + 10.0; local_54 = scratchVec.y; isOverPit = position_is_over_pit(); if (isOverPit != '\0') { fVar7 = fVar7 + fVar4; scratchVec.y = fVar8 - 10.0; scratchVec.x = fVar7; isOverPit = position_is_over_pit(); if (isOverPit != '\0') { scratchVec.y = fVar8 + 10.0; scratchVec.x = fVar7; isOverPit = position_is_over_pit(); if ((isOverPit != '\0') && ((npc->_state != 4 || (-1 < npc->_projectileDelay)))) goto LAB_005aed0b; } } } (npc->_v1).y = -8.0; fVar6 = -8.0; (npc->_v1).x = -fVar5 * 0.4; } } else { (npc->_v1).y = 14.0; fVar6 = 14.0; (npc->_v1).x = 0.0; } LAB_005aed0b: if (((prevHeight <= fVar4) || (fVar6 = (npc->_v1).y, fVar4 <= fVar6)) || (-2.0 <= fVar6 - prevHeight)) { if (((prevHeight < fVar4) && (fVar4 < fVar6)) && (-2.0 < fVar6 - prevHeight)) { NpcHelper::wormwood_spawn_splash(); npc->_friction = npc->_friction * 0.5; } } else { NpcHelper::wormwood_spawn_splash(); } LAB_005aed71: fVar6 = (npc->_v1).y; if (fVar6 <= 0.0) { layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = 1.0; fVar6 = *(float *)((int)npc->_config + 0x24); } else { scratchVec.y = (fVar6 - 0.0) / 14.0; if (scratchVec.y <= 0.0) { scratchVec.y = 0.0; } if (1.0 <= scratchVec.y) { scratchVec.y = 1.0; } scratchVec.y = 1.0 - scratchVec.y; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); fVar6 = 0.0; (layer->_color)._tint[3] = scratchVec.y; } npc->_shadowSize = fVar6; fVar6 = (npc->_v1).y; if ((0.0 < fVar6) || (fVar6 < -35.0)) { iVar1 = 3; entityCollisionClass = 0; } else { iVar1 = 6; entityCollisionClass = 4; } npc->_entityCollisionClass = entityCollisionClass; npc->_entityGridCollisionClass = iVar1; if (((npc->_vectorDeque1)._size == 0) || (uVar2 = (npc->_vectorDeque1)._offset, uVar3 = uVar2 & 1, iVar1 = *(int *)((int)(npc->_vectorDeque1)._map + (uVar2 >> 1 & (npc->_vectorDeque1)._mapSize - 1) * 4), uVar2 = (npc->_vectorDeque2)._offset, fVar4 = *(float *)(iVar1 + 4 + uVar3 * 8) - (npc->_pos).y , fVar5 = *(float *)(iVar1 + uVar3 * 8) - (npc->_pos).x, fVar6 = *(float *)(*(int *)((int)(npc->_vectorDeque2)._map + (uVar2 >> 1 & (npc->_vectorDeque2)._mapSize - 1) * 4) + 4 + (uVar2 & 1) * 8) - fVar6, fVar6 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5 + fVar6 * fVar6), 3.0 < fVar6)) { std::deque::push_back(&npc->_vectorDeque1,&npc->_pos); scratchVec.y = (npc->_v1).y; scratchVec.x = 0.0; std::deque::push_back(&npc->_vectorDeque2,&scratchVec); uVar2 = (npc->_vectorDeque1)._size; while (0x3c < uVar2) { uVar2 = uVar2 - 1; (npc->_vectorDeque1)._size = uVar2; if (uVar2 == 0) { (npc->_vectorDeque1)._offset = 0; } heightDequeSize = &(npc->_vectorDeque2)._size; *heightDequeSize = *heightDequeSize - 1; if (*heightDequeSize == 0) { (npc->_vectorDeque2)._offset = 0; } } } return; } //@@ 005aef20 NpcAI::wormwood_pick_emerge_position /* DB: ? ENTITY_WORMWOOD_main calls it in state 3 and when _v1 is invalid; GetPlayerTarget/CalcTargetPosition + Room::GetGridIndex, writes +0x334/+0x338 and velocity, _state 3 -> 8, 0xba4 = -1 */ void __fastcall NpcAI::wormwood_pick_emerge_position(Entity_NPC *npc) { Vector *pos; uint rngResult; Vector *pVVar1; Entity *target; int iVar2; float fVar3; float fVar4; float fVar5; Vector local_28; Vector local_20; float local_18; float local_14; float local_10; float local_c; float local_8; Room *room; room = g_game->_room; if (npc->_subtype == 0) { iVar2 = npc->_projectileDelay; if (-1 < iVar2) { if (((iVar2 < 0x1c0) && (room->_gridEntities[iVar2] != (void *)0x0)) && (*(int *)((int)room->_gridEntities[iVar2] + 4) == 7)) { fVar3 = (npc->_velocity).y; fVar5 = (npc->_velocity).x; local_20.y = sqrtf(fVar5 * fVar5 + fVar3 * fVar3); local_20.y = local_20.y + 0.22000001; local_10 = (float)(iVar2 % room->_gridWidth) * 40.0 + 40.0; local_c = (float)(iVar2 / room->_gridWidth) * 40.0 + 120.0; local_8 = local_10 - (npc->_pos).x; local_14 = local_c - (npc->_pos).y; if ((npc->_state == 3) && (fVar3 = sqrtf(local_14 * local_14 + local_8 * local_8), fVar3 < 20.0)) { if ((0.0 < (npc->_v2).x) && (rngResult = Random(), (rngResult & 1) == 0)) { (npc->_targetPosition).x = local_10; (npc->_targetPosition).y = local_c; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; (npc->_pos).x = local_10; (npc->_pos).y = local_c; npc->_projectileDelay = -1; if (npc->_state != 8) { npc->_state = 8; } (npc->_v2).x = 0.0; return; } pVVar1 = Entity_NPC::CalcTargetPosition(npc,&local_20,0.0); local_28.x = pVVar1->x - (npc->_pos).x; local_28.y = pVVar1->y - (npc->_pos).y; pVVar1 = Vector::Normalized(&local_28,&local_20); fVar3 = pVVar1->x; fVar5 = pVVar1->y; (npc->_v1).x = -8.0; (npc->_velocity).x = fVar3 * 8.0; (npc->_velocity).y = fVar5 * 8.0; npc->_stateFrame = 0; npc->_projectileDelay = -1; if (npc->_state != 6) { npc->_state = 6; } (npc->_v2).x = (npc->_v2).x + 1.0; return; } rngResult = Random(); local_10 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_10 = local_10 + local_10; fVar3 = cos(local_10); local_8 = fVar3 + local_8; local_10 = sin(local_10); local_10 = local_10 + local_14; fVar4 = sqrtf(local_8 * local_8 + local_10 * local_10); fVar5 = local_10; fVar3 = local_8; if (0.0 < fVar4) { fVar5 = local_10 * (1.0 / fVar4); fVar3 = local_8 * (1.0 / fVar4); } local_14 = fVar3 * 1.6 * 1.2 * npc->_speedMultiplier + (npc->_velocity).x; local_c = fVar5 * 1.6 * 1.2 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = local_14; (npc->_velocity).y = local_c; if (0.0 < (npc->_v1).y) { local_8 = fVar3 * 5.0 * npc->_speedMultiplier + local_14; local_10 = fVar5 * 5.0 * npc->_speedMultiplier + local_c; local_18 = sqrtf(local_10 * local_10 + local_8 * local_8); if (local_18 <= 0.0) { local_c = local_10; fVar3 = local_8; } else { fVar3 = sqrtf(local_14 * local_14 + local_c * local_c); local_c = (fVar3 / local_18) * local_10; fVar3 = (fVar3 / local_18) * local_8; } (npc->_velocity).x = fVar3; (npc->_velocity).y = local_c; if (0.0 < (npc->_v1).y) goto LAB_005af3fc; } fVar3 = sin((float)(g_game->_frameCount - npc->_spawnFrame) * 0.4); local_18 = ((fVar3 * 0.5 + 0.5) * 16.0 - 8.0) * 0.017453292; local_14 = cos(local_18); fVar5 = sin(local_18); fVar3 = (npc->_velocity).x; fVar4 = fVar5 * local_c; local_c = local_14 * local_c + fVar5 * fVar3; (npc->_velocity).x = local_14 * fVar3 - fVar4; (npc->_velocity).y = local_c; LAB_005af3fc: local_10 = (npc->_velocity).x; fVar3 = sqrtf(local_c * local_c + local_10 * local_10); if (0.0 < fVar3) { (npc->_velocity).y = (1.0 / fVar3) * local_c; local_10 = local_10 * (1.0 / fVar3); } (npc->_velocity).x = local_10 * local_20.y; (npc->_velocity).y = local_20.y * (npc->_velocity).y; return; } npc->_projectileDelay = -1; npc->_stateFrame = 0x1e; } iVar2 = npc->_i2; if (iVar2 == 1) { local_10 = 3.0; } else { local_10 = 1.0; } fVar3 = (npc->_velocity).y; fVar5 = (npc->_velocity).x; local_14 = sqrtf(fVar5 * fVar5 + fVar3 * fVar3); local_14 = local_14 + local_10 * 0.4; if (iVar2 == 1) { target = Entity_NPC::GetPlayerTarget(npc); pVVar1 = &target->_pos; } else { pVVar1 = Entity_NPC::CalcTargetPosition(npc,&local_28,0.0); } local_8 = pVVar1->y; pos = &npc->_pos; local_28.y = pVVar1->x; local_c = local_8 - (npc->_pos).y; local_10 = local_28.y - pos->x; fVar3 = sqrtf(local_10 * local_10 + local_c * local_c); if (0.0 < fVar3) { local_c = (1.0 / fVar3) * local_c; local_10 = local_10 * (1.0 / fVar3); } if (npc->_i2 == 1) { fVar3 = 6.0; } else { fVar3 = 1.0; } local_10 = local_10 * 1.6 * fVar3 * npc->_speedMultiplier + (npc->_velocity).x; fVar5 = (npc->_v1).y; local_c = local_c * 1.6 * fVar3 * npc->_speedMultiplier + (npc->_velocity).y; (npc->_velocity).x = local_10; (npc->_velocity).y = local_c; if (fVar5 <= 0.0) { fVar3 = sin((float)(g_game->_frameCount - npc->_spawnFrame) * 0.4); local_20.y = ((fVar3 * 0.5 + 0.5) * 16.0 - 8.0) * 0.017453292; local_18 = cos(local_20.y); fVar3 = sin(local_20.y); fVar5 = fVar3 * local_c; local_c = fVar3 * local_10 + local_18 * local_c; (npc->_velocity).y = local_c; (npc->_velocity).x = local_18 * local_10 - fVar5; } local_10 = (npc->_velocity).x; fVar3 = sqrtf(local_c * local_c + local_10 * local_10); if (fVar3 <= 0.0) { fVar3 = local_10; } else { (npc->_velocity).y = (1.0 / fVar3) * local_c; fVar3 = local_10 * (1.0 / fVar3); } (npc->_velocity).x = fVar3 * local_14; (npc->_velocity).y = local_14 * (npc->_velocity).y; if ((0 < npc->_projectileCooldown) && (fVar3 = local_8 - (npc->_pos).y, fVar5 = local_28.y - pos->x, fVar3 = sqrtf(fVar3 * fVar3 + fVar5 * fVar5), fVar3 < 30.0)) { iVar2 = Room::GetGridIndex(room,pos); fVar5 = (float)(iVar2 % room->_gridWidth) * 40.0 + 40.0; fVar3 = (float)(iVar2 / room->_gridWidth) * 40.0 + 120.0; (npc->_targetPosition).x = fVar5; (npc->_targetPosition).y = fVar3; (npc->_velocity).x = g_vectorZero.x; (npc->_velocity).y = g_vectorZero.y; pos->x = fVar5; (npc->_pos).y = fVar3; if (npc->_state != 9) { npc->_state = 9; } npc->_projectileCooldown = npc->_projectileCooldown + -1; } } return; } //@@ 005af800 NpcAI::ENTITY_WORMWOOD_main /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs HeadBackStunned/HeadFrontStunned */ void __fastcall NpcAI::ENTITY_WORMWOOD_main(Entity_NPC *npc) { byte bVar1; char cVar2; int *piVar3; ColorMod *color; Vector *vecResult; Entity *tmpEntity; uint rngValue; undefined1 *puVar4; LayerState *layer; ColorMod *color_00; uint uVar5; float *damageEntry; byte unused; EntityPtr EVar6; int iVar7; int iVar8; EntityPtr EVar9; float fVar10; float fVar11; float fVar12; EntityPtr EVar13; double dVar14; undefined4 uVar15; TypeDescriptor *pTVar16; char *anim; undefined8 uVar17; Vector scratchVec; byte isFlipped; Vector scratchVec2; undefined1 *local_fc; Room *local_f8; EntityPtr local_f4; EntityPtr local_f0; EntityPtr local_ec; ProjectileParams projParams; undefined1 local_40 [8]; float local_38; float local_34; float local_30; float local_2c; float local_28; float local_24; float local_20; float local_1c; float local_18; undefined4 stackCookie; float *damageEnd; Manager *manager; Room *room; ANM2 *sprite; code *vfn; stackCookie = __security_cookie ^ (uint)(local_40 + 0x30); local_f8 = g_game->_room; local_f0 = (EntityPtr)((int)npc->_updateTime - (int)npc->_prevUpdateTime); if (npc->_subtype != 0) { if (npc->_parent == (EntityPtr)0x0) { local_40._4_4_ = 0.0; local_38 = 0.0; local_34 = 0.0; local_30 = 0.0; local_2c = g_vectorZero.x; local_28 = g_vectorZero.y; local_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = 0.0; local_18 = 0.0; (**(code **)(*(int *)npc + 0x24))(); return; } if (npc->_state != 0) { Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); ENTITY_WORMWOOD_segment_follow(npc); (npc->_posOffset).y = (npc->_v1).y; return; } } switch(npc->_state) { case 0: iVar8 = 0; if (npc->_subtype == 0) { puVar4 = (undefined1 *)0x0; local_f0 = (EntityPtr)npc; do { uVar5 = Random(); local_fc = puVar4 + 1; EVar6 = (EntityPtr) Game::Spawn(g_game,npc->_type,npc->_variant,&npc->_pos,&g_vectorZero,(Entity *)npc, (uint)local_fc,uVar5); if (*(EntityPtr *)((int)EVar6 + 0x3bc) != (EntityPtr)0x0) { local_ec = (EntityPtr)((int)EVar6 + 0x3bc); std::multiset::erase(); } *(EntityPtr *)((int)EVar6 + 0x3bc) = local_f0; if (local_f0 != (EntityPtr)0x0) { std::multiset::insert(); } local_f4 = (EntityPtr)((int)local_f0 + 0x3c0); if (*(int *)((int)local_f0 + 0x3c0) != 0) { local_ec = local_f4; std::multiset::erase(); } *(EntityPtr *)local_f4 = EVar6; std::multiset::insert(); local_f0 = EVar6; (**(code **)(*(int *)EVar6 + 0xc))(); puVar4 = local_fc; } while ((int)local_fc < 6); iVar8 = npc->_state; npc->_stateFrame = 0x1e; } *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); (npc->_v1).x = 0.0; (npc->_v1).y = 14.0; if (iVar8 != 3) { npc->_state = 3; if (npc->_i2 == 1) { npc->_stateFrame = 0x3c; Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); ENTITY_WORMWOOD_segment_follow(npc); return; } uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0x1e; } Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); ENTITY_WORMWOOD_segment_follow(npc); return; case 3: npc->_friction = npc->_friction * 0.96; Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); wormwood_pick_emerge_position(npc); ENTITY_WORMWOOD_segment_follow(npc); npc->_i1 = 0; if ((0 < npc->_stateFrame) && (npc->_projectileCooldown == 0)) { iVar8 = npc->_stateFrame - (int)local_f0; npc->_stateFrame = iVar8; manager = g_manager; if (iVar8 < 1) { if (npc->_i2 == 1) { npc->_state = 0x10; local_f0 = (EntityPtr)0x34; seed_fart_sound_override((int *)&local_f0); SoundEffects::Play(&manager->_sfxManager,(int)local_f0,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xf); room = local_f8; npc->_stateFrame = 0x1e; vecResult = Room::GetCenterPos(&scratchVec2); local_fc = (undefined1 *)vecResult->x; tmpEntity = Entity_NPC::GetPlayerTarget(npc); if ((tmpEntity->_pos).x <= (float)local_fc) { local_f8 = (Room *)0x0; } else { local_f8 = (Room *)(room->_gridWidth + -1); } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_ec = (EntityPtr)(((tmpEntity->_pos).y - 120.0) / 40.0 + 0.5); dVar14 = floor((double)(float)local_ec); EVar6 = (EntityPtr)(int)dVar14; if ((int)EVar6 < 1) { EVar6 = (EntityPtr)0x1; } local_ec = (EntityPtr)(room->_gridHeight + -2); local_f0 = local_ec; if ((int)EVar6 <= (int)local_ec) { local_f0 = EVar6; } iVar8 = FUN_00813420(local_f8,local_f0); EVar6 = local_f0; if ((iVar8 != 0) && (*(int *)(iVar8 + 4) == 0x10)) { if (((int)local_f0 < 2) || ((local_f0 != local_ec && (uVar5 = Random(), (uVar5 & 1) != 0)))) { EVar6 = (EntityPtr)((int)local_f0 + 1); } else { EVar6 = (EntityPtr)((int)local_f0 + -1); } } iVar7 = Room::GetGridIndexByTile(room,(int)local_f8,(int)EVar6); iVar8 = room->_gridWidth; fVar12 = (float)(iVar7 % iVar8) * 40.0 + 40.0; (npc->_targetPosition).x = fVar12; (npc->_targetPosition).y = (float)(iVar7 / iVar8) * 40.0 + 120.0; if (fVar12 <= (float)local_fc) { local_f0 = (EntityPtr)0x3f800000; } else { local_f0 = (EntityPtr)&DAT_bf800000; } uVar5 = Random(); local_ec = (EntityPtr)((uVar5 & 3) + 3); if (local_ec != (EntityPtr)0x0) { local_f4 = (EntityPtr)((uint)local_f0 ^ 0x80000000); do { uVar5 = Random(); rngValue = Random(); local_fc = (undefined1 *) ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 5.0); rngValue = Random(); fVar12 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 5.0 - 2.5; scratchVec.x = (float)local_f0 * (float)local_fc + fVar12 * 0.0; scratchVec.y = (float)local_f4 * fVar12 + (float)local_fc * 0.0; rngValue = Random(); fVar12 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc = (undefined1 *)(fVar12 + fVar12); rngValue = Random(); local_f8 = (Room *)((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar12 = cos((float)local_fc); scratchVec2.x = fVar12 * (float)local_f8 + (npc->_targetPosition).x; fVar12 = sin((float)local_fc); uVar17 = 0xc5d5ac; scratchVec2.y = fVar12 * (float)local_f8 + (npc->_targetPosition).y; pTVar16 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar15 = 0; tmpEntity = Game::Spawn(g_game,1000,0x3b,&scratchVec2,&scratchVec,(Entity *)0x0,0, uVar5); piVar3 = (int *)__RTDynamicCast(tmpEntity,uVar15,pTVar16,uVar17); local_fc = (undefined1 *)0x3f800000; if (((float)piVar3[0xd0] - (npc->_pos).y) * (float)local_f4 + ((float)piVar3[0xcf] - (npc->_pos).x) * 0.0 < 0.0) { local_fc = &DAT_bf800000; } uVar5 = Random(); piVar3[0x11d] = (int)(((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_fc); uVar5 = Random(); iVar8 = uVar5 % 0xf + 0xf; piVar3[0x117] = iVar8; piVar3[0x118] = iVar8; (**(code **)(*piVar3 + 0xc))(); local_ec = (EntityPtr)((int)&((Entity *)((int)local_ec + -0x40c))->_luaBridgeRef + 3); } while (local_ec != (EntityPtr)0x0); } Color::Color((Color *)local_40); uVar5 = Random(); Game::SpawnParticles(g_game,&npc->_targetPosition,4,uVar5 % 5 + 6,8.0,color,100000.0,0); } else { ENTITY_WORMWOOD_pick_pit(npc); } } } break; case 4: npc->_friction = npc->_friction * 0.95; Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); ENTITY_WORMWOOD_segment_follow(npc); if ((0 < npc->_stateFrame) && ((iVar8 = npc->_stateFrame - (int)local_f0, npc->_stateFrame = iVar8, iVar8 < 1 || (npc->_i2 == 1)))) { ENTITY_WORMWOOD_pick_pit(npc); } if (((npc->_v1).y <= 0.0) || ((npc->_v1).x < 0.0)) { wormwood_pick_emerge_position(npc); break; } npc->_projectileDelay = -1; goto LAB_005b0665; case 5: npc->_friction = npc->_friction * 0.85; if (npc->_i1 != 3) { npc->_i1 = 3; Entity_NPC::PlaySound(npc,0x8e,1.0,2,0,1.0); if ((npc->_velocity).y < 0.0) { anim = "HeadBackStunned"; } else { anim = "HeadFrontStunned"; } ANM2::Play(&npc->_sprite,(byte *)anim,0); } ENTITY_WORMWOOD_segment_follow(npc); EVar6 = npc->_entityRef; if (EVar6 != (EntityPtr)0x0) { *(float *)((int)EVar6 + 0x360) = g_vectorZero.x; *(float *)((int)EVar6 + 0x364) = g_vectorZero.y; EVar6 = npc->_entityRef; *(float *)((int)EVar6 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar6 + 0x340) = (npc->_pos).y; EVar6 = npc->_entityRef; if (EVar6 != (EntityPtr)0x0) { if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; if (*(int *)((int)EVar6 + 0x28) == 4) { *(undefined4 *)((int)EVar6 + 0x410) = 0; *(undefined4 *)((int)EVar6 + 0x414) = 0; (**(code **)(*(int *)npc->_entityRef + 0xc))(); } } } EVar6 = npc->_child; npc->_i1 = 2; npc->_state = 4; if (EVar6 != (EntityPtr)0x0) { scratchVec2.x = *(float *)((int)EVar6 + 0x33c) - (npc->_pos).x; scratchVec2.y = *(float *)((int)EVar6 + 0x340) - (npc->_pos).y; vecResult = Vector::Normalized(&scratchVec2,&scratchVec); uVar5 = Random(); if ((uVar5 & 1) == 0) { fVar12 = -15.0; } else { fVar12 = 15.0; } local_ec = (EntityPtr)(fVar12 * 0.017453292); local_f4 = (EntityPtr)cos((float)local_ec); fVar11 = sin((float)local_ec); fVar12 = vecResult->x; fVar10 = vecResult->y; (npc->_velocity).x = (fVar12 * (float)local_f4 - fVar10 * fVar11) * 10.0; (npc->_velocity).y = (fVar10 * (float)local_f4 + fVar12 * fVar11) * 10.0; } npc->_stateFrame = 1; break; case 6: Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); ENTITY_WORMWOOD_segment_follow(npc); fVar12 = (npc->_v1).y; if ((fVar12 <= 0.0) || ((npc->_v1).x <= 0.0)) { if ((0xf < npc->_stateFrame) && (npc->_i1 == 0)) { npc->_i1 = 1; } puVar4 = (undefined1 *)(npc->_stateFrame + (int)local_f0); npc->_stateFrame = (int)puVar4; if ((((0x2d < (int)puVar4) && (fVar12 <= 0.0)) && (fVar12 == -8.0)) && (npc->_stateFrame = 0x96, npc->_state != 4)) { npc->_state = 4; } break; } LAB_005b0665: if (npc->_state != 3) { npc->_state = 3; if (npc->_i2 == 1) { npc->_stateFrame = 0x3c; } else { uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0x1e; } } break; case 8: sprite = &npc->_sprite; (npc->_v1).y = (float)&DAT_bf800000; (npc->_v1).x = 0.0; npc->_entityCollisionClass = 4; ANM2::Play(sprite,s_Attack1,0); layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_color)._tint[3] = 1.0; fVar11 = npc->_friction * 0.4; npc->_friction = fVar11; fVar12 = (npc->_targetPosition).y; fVar10 = (npc->_pos).y; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) / fVar11; (npc->_velocity).y = (fVar12 - fVar10) / fVar11; iVar8 = ANM2::GetFrame(sprite); if (iVar8 == 2) { NpcHelper::wormwood_spawn_splash(); } bVar1 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"); manager = g_manager; if (bVar1 != 0) { local_ec = (EntityPtr)0xd; seed_fart_sound_override((int *)&local_ec); SoundEffects::Play(&manager->_sfxManager,(int)local_ec,1.0,2,0,1.0,0.0); ProjectileParams::ProjectileParams(&projParams); cVar2 = FUN_005ae1d0(); if (cVar2 == '\0') { uVar5 = Game::GetStageID(g_game,unused); projParams.Variant = (uVar5 != 0x1c) + 3; } tmpEntity = Entity_NPC::GetPlayerTarget(npc); local_ec = (EntityPtr)(tmpEntity->_pos).x; local_f4 = (EntityPtr)(tmpEntity->_pos).y; tmpEntity = Entity_NPC::GetPlayerTarget(npc); fVar12 = (float)local_f4 - (npc->_pos).y; fVar10 = (float)local_ec - (npc->_pos).x; fVar12 = sqrtf(fVar12 * fVar12 + fVar10 * fVar10); scratchVec2.x = (tmpEntity->_velocity).x * fVar12 * 0.02 + (float)local_ec; scratchVec2.y = (tmpEntity->_velocity).y * fVar12 * 0.02 + (float)local_f4; Entity_NPC::FireBossProjectiles(npc,0xd,&scratchVec2,0.0,&projParams); } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; NpcHelper::wormwood_spawn_splash(); if (npc->_state != 3) { npc->_state = 3; if (npc->_i2 == 1) { npc->_stateFrame = 0x3c; } else { uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0x1e; } } (npc->_v1).y = 14.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = 0.0; npc->_stateFrame = 0xf; goto LAB_005b11c4; case 9: (npc->_v1).y = (float)&DAT_bf800000; (npc->_v1).x = 0.0; bVar1 = ANM2::WasEventTriggered(&npc->_sprite,(byte *)"Shoot"); if (bVar1 == 0) { npc->_entityCollisionClass = 0; } ANM2::Play(&npc->_sprite,s_Attack2,0); layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = 1.0; fVar11 = npc->_friction * 0.4; npc->_friction = fVar11; fVar12 = (npc->_targetPosition).y; fVar10 = (npc->_pos).y; (npc->_velocity).x = ((npc->_targetPosition).x - (npc->_pos).x) / fVar11; (npc->_velocity).y = (fVar12 - fVar10) / fVar11; bVar1 = Sprite::IsEventTriggered((Sprite *)&npc->_sprite,"Shoot"); if (bVar1 != 0) { npc->_entityCollisionClass = 4; NpcHelper::wormwood_spawn_splash(); local_fc = (undefined1 *)0x0; if ((local_f8->_entityList)._updateEL._size != 0) { do { EVar6 = *(EntityPtr *)((int)(local_f8->_entityList)._updateEL._data + (int)local_fc * 4); local_ec = EVar6; bVar1 = Entity::IsVulnerableEnemy((Entity *)EVar6,(Entity *)0x0); if ((bVar1 == 0) || (((*(int *)((int)EVar6 + 0x28) == 0x3e && (*(int *)((int)EVar6 + 0x2c) == 3)) || (fVar12 = (npc->_pos).y - *(float *)((int)EVar6 + 0x340), fVar10 = (npc->_pos).x - ((Vector *)((int)EVar6 + 0x33c))->x, fVar12 = sqrtf(fVar12 * fVar12 + fVar10 * fVar10), 40.0 <= fVar12)))) { if ((*(int *)((int)EVar6 + 0x28) == 1) && (fVar12 = (npc->_pos).y - *(float *)((int)EVar6 + 0x340), fVar10 = (npc->_pos).x - ((Vector *)((int)EVar6 + 0x33c))->x, fVar12 = sqrtf(fVar12 * fVar12 + fVar10 * fVar10), fVar12 < 40.0)) { vfn = *(code **)(*(int *)EVar6 + 0x20); EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*vfn)(0x3f800000,0,0,local_40 + 4); EVar6 = local_ec; goto LAB_005b0e62; } } else { local_40._4_4_ = 0.0; local_38 = 0.0; local_34 = 0.0; local_30 = 0.0; local_2c = g_vectorZero.x; local_28 = g_vectorZero.y; local_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = 0.0; local_18 = 0.0; (**(code **)(*(int *)EVar6 + 0x20))(0x41c80000,0,0,local_40 + 4); LAB_005b0e62: local_ec = (EntityPtr)(((Vector *)((int)EVar6 + 0x33c))->x - (npc->_pos).x); local_f4 = (EntityPtr)(*(float *)((int)EVar6 + 0x340) - (npc->_pos).y); fVar12 = sqrtf((float)local_ec * (float)local_ec + (float)local_f4 * (float)local_f4); if (fVar12 <= 0.0) { EVar13 = local_ec; EVar9 = local_f4; } else { EVar13 = (EntityPtr)((float)local_ec * (1.0 / fVar12)); EVar9 = (EntityPtr)((float)local_f4 * (1.0 / fVar12)); } fVar12 = *(float *)((int)EVar6 + 0x36c); if (fVar12 != 0.0) { fVar10 = ((Vector *)((int)EVar6 + 0x360))->x; *(float *)((int)EVar6 + 0x364) = (*(float *)((int)EVar6 + 0x39c) * (float)EVar9 * 15.0) / fVar12 + *(float *)((int)EVar6 + 0x364); ((Vector *)((int)EVar6 + 0x360))->x = (*(float *)((int)EVar6 + 0x39c) * (float)EVar13 * 15.0) / fVar12 + fVar10; } } local_fc = local_fc + 1; } while (local_fc < (undefined1 *)(local_f8->_entityList)._updateEL._size); } cVar2 = position_is_over_pit(); if (cVar2 == '\0') { local_f4 = (EntityPtr)Room::GetGridEntityFromPos(local_f8,&npc->_pos); manager = g_manager; local_ec = (EntityPtr)0x89; seed_fart_sound_override((int *)&local_ec); SoundEffects::Play(&manager->_sfxManager,(int)local_ec,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,8); if (local_f4 != (EntityPtr)0x0) { vfn = *(code **)(*(int *)local_f4 + 0x14); EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*vfn)(1); } } vecResult = &npc->_pos; cVar2 = Room::CanSpawnObstacleAtPos(vecResult); if (cVar2 != '\0') { local_f0 = (EntityPtr)Room::GetGridIndex(local_f8,vecResult); local_fc = (undefined1 *)Random(); if (((-1 < (int)local_f0) && ((int)local_f0 < 0x1c0)) || ((KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"), -1 < (int)local_f0 && ((int)local_f0 < 0x1c0)))) { if ((local_f8->_gridPaths[(int)local_f0] < 0x385) && (local_ec = (EntityPtr)Isaac::CreateGridEntity(7,(uint)local_f0), local_ec != (EntityPtr)0x0)) { local_f4 = *(EntityPtr *)(local_f8->_gridEntities + (int)local_f0); if (local_f4 != (EntityPtr)0x0) { (*(code *)**(undefined4 **)local_f4)(); } *(EntityPtr *)(local_f8->_gridEntities + (int)local_f0) = local_ec; ((std_vector *)((int)local_ec + 8))->_begin = (void *)0x0; *(undefined4 *)((int)local_ec + 0x18) = 0; GridEntity::Init((GridEntity *)local_ec,(uint)local_fc); } piVar3 = local_f8->_gridEntities[(int)local_f0]; if ((piVar3 != (int *)0x0) && (piVar3[1] == 7)) { (**(code **)(*piVar3 + 4))(); } } Color::Color((Color *)local_40); Game::SpawnParticles(g_game,vecResult,4,4,6.0,color_00,100000.0,0); } } if (((npc->_sprite)._animState._animData != (void *)0x0) && ((npc->_sprite)._animState._isPlaying != 0)) break; NpcHelper::wormwood_spawn_splash(); if (npc->_state != 3) { npc->_state = 3; if (npc->_i2 == 1) { npc->_stateFrame = 0x3c; } else { uVar5 = Random(); npc->_stateFrame = uVar5 % 0x1e + 0x1e; } } (npc->_v1).y = 14.0; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_color)._tint[3] = 0.0; npc->_stateFrame = 0x1e; LAB_005b11c4: npc->_entityCollisionClass = 0; break; case 0x10: Entity_Familiar::ai_buddy_inbox((Entity_Familiar *)npc); ENTITY_WORMWOOD_segment_follow(npc); iVar8 = npc->_stateFrame - (int)local_f0; npc->_i1 = 0; npc->_stateFrame = iVar8; if (iVar8 < 1) { (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; (npc->_v1).y = -14.0; (npc->_v1).x = -4.0; std::deque::_Tidy(); std::deque::_Tidy(); vecResult = Room::GetCenterPos(&scratchVec2); local_ec = (EntityPtr)(npc->_targetPosition).x; local_f4 = (EntityPtr)vecResult->x; vecResult = Room::GetCenterPos(&scratchVec2); if (vecResult->x <= (float)local_ec) { fVar12 = -20.0; } else { fVar12 = 20.0; } (npc->_velocity).x = fVar12; (npc->_velocity).y = 0.0; for (EVar6 = npc->_child; EVar6 != (EntityPtr)0x0; EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0)) { *(float *)((int)EVar6 + 0x33c) = (npc->_pos).x; *(float *)((int)EVar6 + 0x340) = (npc->_pos).y; *(float *)((int)EVar6 + 0xbb4) = (npc->_v1).y; *(float *)((int)EVar6 + 0xbb0) = (npc->_v1).x; std::deque::_Tidy(); std::deque::_Tidy(); } uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x89,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); isFlipped = (float)local_f4 <= (float)local_ec; (tmpEntity->_sprite)._flipX = isFlipped; (**(code **)(*(int *)tmpEntity + 0xc))(); uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x89,&npc->_pos,&g_vectorZero,(Entity *)0x0,1,uVar5); (tmpEntity->_sprite)._flipX = isFlipped; (**(code **)(*(int *)tmpEntity + 0xc))(); uVar5 = Random(); local_f0 = (EntityPtr)0x0; local_fc = (undefined1 *)(uVar5 % 3 + 3); if (local_fc != (undefined1 *)0x0) { do { uVar5 = Random(); local_ec = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 - 2.5); uVar5 = Random(); scratchVec.y = (float)local_ec; scratchVec.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0; if (local_f0 != (EntityPtr)0x0) { scratchVec.x = scratchVec.x * -1.0; } uVar5 = Random(); rngValue = Random(); fVar12 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_ec = (EntityPtr)(fVar12 + fVar12); rngValue = Random(); local_f4 = (EntityPtr) ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10); fVar12 = cos((float)local_ec); scratchVec2.x = fVar12 * 20.0 * (float)local_f4 + (npc->_pos).x; fVar12 = sin((float)local_ec); scratchVec2.y = fVar12 * 20.0 * (float)local_f4 + (npc->_pos).y; tmpEntity = Game::Spawn(g_game,1000,0x3b,&scratchVec2,&scratchVec,(Entity *)0x0,0,uVar5); uVar5 = Random(); fVar12 = (tmpEntity->_pos).x; fVar10 = (tmpEntity->_pos).y; fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = fVar11; if (local_f0 == (EntityPtr)0x0) { puVar4 = (undefined1 *)0x3f800000; } else { puVar4 = &DAT_bf800000; } if ((float)puVar4 * (fVar12 - (npc->_pos).x) + (fVar10 - (npc->_pos).y) * 0.0 < 0.0) { *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = -fVar11; } uVar5 = Random(); iVar8 = *(int *)tmpEntity; iVar7 = uVar5 % 0xf + 0xf; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar7; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar7; (**(code **)(iVar8 + 0xc))(); local_f0 = (EntityPtr)((int)local_f0 + 1); } while ((int)local_f0 < (int)local_fc); } local_ec = (EntityPtr)0x3; do { vecResult = Room::FindFreePickupSpawnPosition (local_f8,&scratchVec,&npc->_pos,80.0,1, 0.0 < *(float *)((int)g_game->_room + 0x7240),0); uVar5 = Random(); fVar12 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_f4 = (EntityPtr)(fVar12 + fVar12); fVar12 = cos((float)local_f4); scratchVec2.x = fVar12 * 10.0 + vecResult->x; fVar12 = sin((float)local_f4); scratchVec2.y = fVar12 * 10.0 + vecResult->y; Entity_NPC::ThrowLeech(&npc->_pos,(Entity *)npc,-8.0,&scratchVec2,0); manager = g_manager; local_ec = (EntityPtr)((int)local_ec + -1); } while (local_ec != (EntityPtr)0x0); local_ec = (EntityPtr)0x34; seed_fart_sound_override((int *)&local_ec); SoundEffects::Play(&manager->_sfxManager,(int)local_ec,1.0,2,0,1.0,0.0); manager = g_manager; local_ec = (EntityPtr)0x1db; seed_fart_sound_override((int *)&local_ec); SoundEffects::Play(&manager->_sfxManager,(int)local_ec,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xf); npc->_i1 = 2; if (npc->_state != 6) { npc->_state = 6; } npc->_stateFrame = 0; npc->_i2 = 2; ENTITY_WORMWOOD_segment_follow(npc); } } iVar8 = npc->_i2; (npc->_posOffset).y = (npc->_v1).y; if (((iVar8 == 0) && (npc->_health / npc->_maxHitPoints < 0.33)) && (cVar2 = FUN_005ae1d0(), cVar2 == '\0')) { npc->_i2 = 1; if (npc->_state == 4) { npc->_stateFrame = 1; } uVar5 = Random(); npc->_projectileCooldown = (uVar5 & 3) + 3; } if (npc->_i2 == 1) { EVar6 = (EntityPtr)npc; do { *(float *)((int)EVar6 + 0x14) = 0.0; damageEnd = *(void **)((int)EVar6 + 0xc); for (damageEntry = ((std_vector *)((int)EVar6 + 8))->_begin; damageEntry != damageEnd; damageEntry = damageEntry + 0xe) { fVar12 = *damageEntry; *damageEntry = fVar12 * 0.2; *(float *)((int)EVar6 + 0x14) = fVar12 * 0.2 + *(float *)((int)EVar6 + 0x14); } EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0); } while (EVar6 != (EntityPtr)0x0); } EVar13 = (EntityPtr)0x501502f9; EVar6 = (EntityPtr)npc; do { EVar9 = (EntityPtr)(*(float *)((int)EVar6 + 0x380) - *(float *)((int)EVar6 + 0x14)); EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0); if ((float)EVar13 <= (float)EVar9) { EVar9 = EVar13; } EVar13 = EVar9; } while (EVar6 != (EntityPtr)0x0); EVar6 = (EntityPtr)npc; local_ec = EVar13; do { fVar12 = *(float *)((int)EVar6 + 0x380) - *(float *)((int)EVar6 + 0x14); if ((float)EVar13 < fVar12) { local_40._4_4_ = 0.0; local_38 = 0.0; local_34 = 0.0; local_30 = 0.0; local_2c = g_vectorZero.x; local_28 = g_vectorZero.y; local_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = 0.0; local_18 = 0.0; (**(code **)(*(int *)EVar6 + 0x20))(fVar12 - (float)EVar13,0x2000,0,local_40 + 4,0x1e); EVar13 = local_ec; } EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0); } while (EVar6 != (EntityPtr)0x0); if (npc->_dead != 0) { for (EVar6 = npc->_child; EVar6 != (EntityPtr)0x0; EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0)) { local_40._4_4_ = 0.0; local_38 = 0.0; local_34 = 0.0; local_30 = 0.0; local_1c = 0.0; local_18 = 0.0; local_2c = g_vectorZero.x; local_28 = g_vectorZero.y; local_24 = g_vectorZero.x; local_20 = g_vectorZero.y; (**(code **)(*(int *)EVar6 + 0x24))(); } } if (((npc->_state == 4) && (iVar8 = npc->_stateFrame, 0 < iVar8)) && (fVar12 = npc->_pendingDamage, 0.0 < fVar12)) { local_ec = (EntityPtr)(fVar12 + fVar12); dVar14 = ceil((double)(float)local_ec); iVar8 = iVar8 - (int)dVar14; iVar7 = 1; if (1 < iVar8) { iVar7 = iVar8; } npc->_stateFrame = iVar7; } return; } //@@ 005b1490 FUN_005b1490 void FUN_005b1490(undefined4 param_1,undefined4 param_2) { undefined4 *in_ECX; *in_ECX = param_1; in_ECX[1] = param_2; return; } //@@ 005b14b0 ItemPool::AddRoomBlacklist /* ZHL [lua] Lua binding ItemPool:AddRoomBlacklist prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ItemPool::AddRoomBlacklist(ItemPool *this,int item) { uint *puVar1; puVar1 = (uint *)((int)(this->_roomBlacklistedCollectibles)._begin + ((uint)item >> 5) * 4); *puVar1 = *puVar1 | 1 << (item & 0x1fU); return; } //@@ 005b14e0 Item::IsCollectible /* ZHL [lua] Lua binding Item:IsCollectible */ int Item::IsCollectible(void) { int iVar1; uint3 uVar2; int *in_ECX; iVar1 = *in_ECX; uVar2 = (uint3)((uint)iVar1 >> 8); if (((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 005b1500 Item::HasTags /* ZHL [lua] Lua binding Item:HasTags prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Item::HasTags(void *this,ulonglong tags) { if (((uint)tags & *(uint *)((int)this + 0xb8)) == 0 && (*(uint *)((int)this + 0xbc) & tags._4_4_) == 0) { return 0; } return 1; } //@@ 005b1530 Card::IsCard /* ZHL [lua] Lua binding Card:IsCard */ int Card::IsCard(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x58); uVar2 = (uint3)((uint)iVar1 >> 8); if ((((iVar1 == 0) || (iVar1 == 1)) || (iVar1 == 3)) || (iVar1 == 5)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 005b1550 Card::IsRune /* ZHL [lua] Lua binding Card:IsRune */ bool Card::IsRune(void) { int in_ECX; return *(int *)(in_ECX + 0x58) == 2; } //@@ 005b1560 FUN_005b1560 void FUN_005b1560(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0xffffffff; return; } //@@ 005b1570 Entity::CollisionDamage /* ZHL [lua] Lua binding Entity:CollisionDamage */ float10 __thiscall Entity::CollisionDamage(Entity *this) { return (float10)this->_collisionDamage; } //@@ 005b1580 Entity::IsInvincible /* ZHL [lua] Lua binding Entity:IsInvincible */ byte __thiscall Entity::IsInvincible(Entity *this) { return this->_isInvicible; } //@@ 005b1590 Entity::DropSeed /* ZHL [lua] Lua binding Entity:DropSeed */ int __thiscall Entity::DropSeed(Entity *this) { return (this->_dropRNG)._seed; } //@@ 005b15a0 FUN_005b15a0 void FUN_005b15a0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x3dc) = param_1; *(undefined8 *)(in_ECX + 0x3e0) = 0x300000004; *(undefined4 *)(in_ECX + 1000) = 0x11; return; } //@@ 005b15d0 FUN_005b15d0 void FUN_005b15d0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x438) = param_1; return; } //@@ 005b15f0 FUN_005b15f0 void FUN_005b15f0(float *param_1) { float *in_ECX; float in_XMM2_Da; *in_ECX = (*param_1 - *in_ECX) * in_XMM2_Da + *in_ECX; in_ECX[1] = (param_1[1] - in_ECX[1]) * in_XMM2_Da + in_ECX[1]; in_ECX[2] = (param_1[2] - in_ECX[2]) * in_XMM2_Da + in_ECX[2]; in_ECX[3] = (param_1[3] - in_ECX[3]) * in_XMM2_Da + in_ECX[3]; in_ECX[4] = (param_1[4] - in_ECX[4]) * in_XMM2_Da + in_ECX[4]; in_ECX[5] = (param_1[5] - in_ECX[5]) * in_XMM2_Da + in_ECX[5]; return; } //@@ 005b1690 FUN_005b1690 void FUN_005b1690(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 0x80; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xffffff7f; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 005b16c0 Room::InvalidatePickupVision /* ZHL [lua] Lua binding Room:InvalidatePickupVision */ void __thiscall Room::InvalidatePickupVision(Room *this) { this->_isPickupVisionInvalid = 1; return; } //@@ 005b16d0 Level::GetPreviousRoomIndex /* ZHL [lua] Lua binding Level:GetPreviousRoomIndex */ int __thiscall Level::GetPreviousRoomIndex(Level *this) { return this->_previousRoomIndex; } //@@ 005b16e0 Level::SetCanSeeEverything /* ZHL [lua] Lua binding Level:SetCanSeeEverything */ void __thiscall Level::SetCanSeeEverything(Level *this,byte param_2) { this->_isCanSeeEverything = param_2; return; } //@@ 005b16f0 FUN_005b16f0 void FUN_005b16f0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0xc) = param_1; return; } //@@ 005b1700 Entity_Player::GetBoneHearts /* ZHL [lua] Lua binding EntityPlayer:GetBoneHearts */ int __thiscall Entity_Player::GetBoneHearts(Entity_Player *this) { return this->_boneHearts; } //@@ 005b1710 Entity_Player::GetRottenHearts /* ZHL [lua] Lua binding EntityPlayer:GetRottenHearts */ int __thiscall Entity_Player::GetRottenHearts(Entity_Player *this) { return this->_rottenHearts; } //@@ 005b1720 FUN_005b1720 undefined4 FUN_005b1720(int param_1) { int in_ECX; return *(undefined4 *)(param_1 * 0x20 + 0x159c + in_ECX); } //@@ 005b1740 Entity_Player::GetSoulHearts /* ZHL [lua] Lua binding EntityPlayer:GetSoulHearts */ int __thiscall Entity_Player::GetSoulHearts(Entity_Player *this) { return this->_soulHearts; } //@@ 005b1750 Entity_Player::GetBlackHearts /* ZHL [lua] Lua binding EntityPlayer:GetBlackHearts */ int __thiscall Entity_Player::GetBlackHearts(Entity_Player *this) { return this->_blackHearts; } //@@ 005b1760 Entity_Player::GetNumKeys /* ZHL [lua] Lua binding EntityPlayer:GetNumKeys */ int __thiscall Entity_Player::GetNumKeys(Entity_Player *this) { return this->_numKeys; } //@@ 005b1770 Entity_Player::GetGoldenHearts /* ZHL [lua] Lua binding EntityPlayer:GetGoldenHearts */ int __thiscall Entity_Player::GetGoldenHearts(Entity_Player *this) { return this->_goldenHearts; } //@@ 005b1780 Entity_Player::HasWeaponType /* ZHL [lua] Lua binding EntityPlayer:HasWeaponType prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Player::HasWeaponType(Entity_Player *this,int weaponType) { if ((uint)weaponType < 0x11) { return *(byte *)((int)this->_weapons + weaponType + 0x14); } return 0; } //@@ 005b17a0 FUN_005b17a0 void FUN_005b17a0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x410) = param_1; return; } //@@ 005b17b0 FUN_005b17b0 void FUN_005b17b0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x414) = param_1; return; } //@@ 005b17c0 Entity_Player::GetCollectibleRNG /* ZHL [exact] __thiscall RNG* Entity_Player::GetCollectibleRNG(int id); prototype: REPENTOGON, confirmed by RET 4 */ RNG * __thiscall Entity_Player::GetCollectibleRNG(Entity_Player *this,int id) { void *pvVar1; void *pvVar2; uint uVar3; if (id < 0) { return (this->_collectibleRNGs)._begin; } pvVar2 = (this->_collectibleRNGs)._end; if ((int)pvVar2 - (int)(this->_collectibleRNGs)._begin >> 4 <= id) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); pvVar2 = (this->_collectibleRNGs)._end; } pvVar1 = (this->_collectibleRNGs)._begin; uVar3 = ((int)pvVar2 - (int)pvVar1 >> 4) - 1; if (uVar3 < (uint)id) { id = uVar3; } return (RNG *)((int)pvVar1 + id * 0x10); } //@@ 005b1820 FUN_005b1820 int FUN_005b1820(void) { int in_ECX; return in_ECX + 0x11a4; } //@@ 005b1830 FUN_005b1830 void FUN_005b1830(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xf1c) = param_1; return; } //@@ 005b1840 FUN_005b1840 bool FUN_005b1840(void) { int *in_ECX; return *in_ECX != 0; } //@@ 005b1850 Game::GetDevilRoomDeals /* ZHL [lua] Lua binding Game:GetDevilRoomDeals */ int __thiscall Game::GetDevilRoomDeals(Game *this) { return this->_devilRoomDeals; } //@@ 005b1860 Game::GetAmbush /* ZHL [lua] Lua binding Game:GetAmbush */ Ambush * __thiscall Game::GetAmbush(Game *this) { return &this->_ambush; } //@@ 005b1870 Game::ShowFortune /* ZHL [lua] Lua binding Game:ShowFortune */ void __thiscall Game::ShowFortune(Game *this) { ShowFortuneText(&this->_fortuneRNG,(byte *)"Fortune_General"); return; } //@@ 005b1890 Game::room_restart_flag_set /* DB: sets game+0x67744 = 1 after D7's Room::RespawnEnemies */ void Game::room_restart_flag_set(void) { g_game->_isRoomRespawned = 1; return; } //@@ 005b18a0 FUN_005b18a0 int FUN_005b18a0(void) { return g_game->_magicSkinUses; } //@@ 005b18b0 FUN_005b18b0 void FUN_005b18b0(int param_1) { g_game->_magicSkinUses = g_game->_magicSkinUses + param_1; return; } //@@ 005b18d0 FUN_005b18d0 void FUN_005b18d0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd84) = param_1; return; } //@@ 005b18e0 FUN_005b18e0 undefined1 FUN_005b18e0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0xdc8); } //@@ 005b18f0 FUN_005b18f0 void FUN_005b18f0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0xd76) = param_1; return; } //@@ 005b1900 FUN_005b1900 void FUN_005b1900(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0xf34) = in_XMM1_Da; return; } //@@ 005b1910 FUN_005b1910 void FUN_005b1910(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xee8) = param_1; return; } //@@ 005b1920 FUN_005b1920 void FUN_005b1920(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x524) = param_1; return; } //@@ 005b1930 Entity_Pickup::IsShopItem /* ZHL [lua] Lua binding EntityPickup:IsShopItem */ bool __thiscall Entity_Pickup::IsShopItem(Entity_Pickup *this) { return this->_price != 0; } //@@ 005b1940 Entity_Pickup::Timeout /* ZHL [lua] Lua binding EntityPickup:Timeout */ int __thiscall Entity_Pickup::Timeout(Entity_Pickup *this) { return this->_timeout; } //@@ 005b1950 FUN_005b1950 void FUN_005b1950(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x52c) = param_1; return; } //@@ 005b1960 FUN_005b1960 undefined4 FUN_005b1960(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x588); } //@@ 005b1970 FUN_005b1970 void FUN_005b1970(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x528) = param_1; return; } //@@ 005b1980 Entity_Pickup::OptionsPickupIndex /* ZHL [lua] Lua binding EntityPickup:OptionsPickupIndex */ int __thiscall Entity_Pickup::OptionsPickupIndex(Entity_Pickup *this) { return this->_optionsPickupIndex; } //@@ 005b1990 FUN_005b1990 void FUN_005b1990(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x530) = param_1; return; } //@@ 005b19a0 FUN_005b19a0 undefined4 FUN_005b19a0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x530); } //@@ 005b19b0 Entity_Pickup::GetRandomPickupVelocity /* ZHL [exact] static cleanup Vector * Entity_Pickup::GetRandomPickupVelocity(const Vector& buffer, Vector * position, RNG * rng, unsigned int ePickupVelType); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ Vector * __cdecl Entity_Pickup::GetRandomPickupVelocity(Vector *buffer,Vector *position,RNG *rng,uint ePickupVelType) { Isaac::GetRandomPickupVelocity(buffer,position,ePickupVelType,rng); return buffer; } //@@ 005b19d0 FUN_005b19d0 void FUN_005b19d0(void) { char in_CL; if (in_CL == '\0') { g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1; return; } g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; return; } //@@ 005b19f0 FUN_005b19f0 void FUN_005b19f0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x554) = param_1; return; } //@@ 005b1a00 FUN_005b1a00 undefined1 FUN_005b1a00(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x52e); } //@@ 005b1a10 FUN_005b1a10 bool FUN_005b1a10(void) { int in_ECX; return *(int *)(in_ECX + 0xc) == 0; } //@@ 005b1a20 Entity_Player::moms_bracelet_grab /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this Entity_Player: when +0x1600 != 0x25c (Mom's Bracelet) picks the facing grid entity (CanPickupGridEntity/PickupGridEntity) or an enemy in radius -> TryHoldEntity; Rock1/redhost/mobile host gfx; no resolved callers (UseActiveItem jump table) */ void __thiscall Entity_Player::moms_bracelet_grab(Entity_Player *this) { ushort uVar1; ANM2 other; qword qVar2; byte bVar3; Vector *pVVar4; int iVar5; EntityList_EL *queryResult; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; int gridIndex; char *pcVar6; int GridIndex; uint uVar7; undefined1 *entityCount; ANM2 *room; qword *allocCounter; Entity_Effect *entity; bool isRockShot; float fVar8; EntityPtr *pEVar9; ANM2 aAStackY_8d98 [128]; undefined1 in_stack_fffffd7c [244]; float fVar10; float fVar11; Vector *pVVar12; undefined4 uVar13; ANM2 spriteCopy; EntityList_EL nearbyEntities; Vector local_40; Vector local_38; Entity_Effect *local_30; undefined1 local_2c [16]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Effect *heldEffect; int *rockShot; Room *room; local_8 = 0xffffffff; puStack_c = &LAB_00af59cd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; room = g_game->_room; if (this->_itemState != 0x25c) { fVar8 = 0.0; local_38.x = 0.0; if (this->_moveDirection != -1) { pVVar4 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_40,this->_moveDirection); local_38.x = pVVar4->x; fVar8 = pVVar4->y; } local_38.x = local_38.x * 22.0; pEVar9 = (EntityPtr *)(fVar8 * 22.0); gridIndex = (int)(((local_38.x + (this->_pos).x) - 40.0) / 40.0 + 0.5); iVar5 = (int)((((float)pEVar9 + (this->_pos).y) - 120.0) / 40.0 + 0.5); if ((((-1 < gridIndex) && (gridIndex < room->_gridWidth)) && (-1 < iVar5)) && (((iVar5 < room->_gridHeight && (gridIndex = room->_gridWidth * iVar5 + gridIndex, -1 < gridIndex)) && (local_40.y = local_38.x, local_38.y = (float)pEVar9, bVar3 = Room::CanPickupGridEntity(room,gridIndex), bVar3 != 0)))) { local_30 = Room::PickupGridEntity(room,GridIndex); if (local_30 != (Entity_Effect *)0x0) { pEVar9 = &local_30->_parent; if (local_30->_parent != (EntityPtr)0x0) { local_38.y = (float)pEVar9; std::multiset::erase(); } *pEVar9 = (EntityPtr)this; std::multiset::insert(); TryHoldEntity(this,(Entity *)local_30); ExceptionList = local_10; return; } local_30 = (Entity_Effect *)0x0; pEVar9 = (EntityPtr *)local_38.y; local_38.x = local_40.y; } local_38.x = local_38.x + (this->_pos).x; local_38.y = (float)pEVar9 + (this->_pos).y; local_40.y = (float)&room->_entityList; EntityList::QueryRadius((EntityList *)local_40.y,&nearbyEntities,&local_38,22.0,0xffffffff); local_8 = 0; local_30 = (Entity_Effect *)0x0; entityCount = (undefined1 *)nearbyEntities._size; if ((undefined1 *)nearbyEntities._size != (undefined1 *)0x0) { do { entity = *(Entity_Effect **)((nearbyEntities._data)->_buf + (int)local_30 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (((Entity *)entity)->_type != 1)) { iVar5 = ((Entity *)entity)->_type; if (iVar5 - 10U < 0x3de) goto LAB_005b1bf2; LAB_005b1f4c: bVar3 = TryHoldEntity(this,(Entity *)entity); if (bVar3 != 0) goto LAB_005b2306; entityCount = (undefined1 *)nearbyEntities._size; } else { iVar5 = 1; LAB_005b1bf2: if (((Entity *)entity)->_entityCollisionClass == 0) goto LAB_005b1f4c; if (iVar5 == 0x1b) { if ((((Entity *)entity)->_variant == 0) && (((Entity *)entity)->_subtype == 0)) { ((Entity *)entity)->_subtype = 99; local_2c._0_4_ = std::_Allocate(0x30); local_1c = 0x2c; local_18 = 0x2f; builtin_strncpy((char *)local_2c._0_4_,"gfx/monsters/classic/monster_127_redhost.png", 0x2d); local_8._0_1_ = 1; Sprite::ReplaceSpritesheet ((Sprite *)&((Entity *)entity)->_sprite,0,(std_string *)local_2c); local_8 = (uint)local_8._1_3_ << 8; bVar3 = extraout_CL; if (0xf < local_18) { uVar7 = local_18 + 1; pcVar6 = (char *)local_2c._0_4_; if (0xfff < uVar7) { pcVar6 = *(char **)(local_2c._0_4_ + -4); uVar7 = local_18 + 0x24; if ((char *)0x1f < (char *)(local_2c._0_4_ + (-4 - (int)pcVar6))) { LAB_005b1e76: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar7); bVar3 = extraout_CL_00; } ANM2::LoadGraphics(&((Entity *)entity)->_sprite,bVar3); *(undefined4 *)&((Entity *)((int)entity + 0x40c))->field_0x4 = 0xf; ANM2::SetFrame(&((Entity *)entity)->_sprite,(std_string *)"Bombed",0); uVar7 = Random(); local_30 = (Entity_Effect *) Game::Spawn(g_game,1000,0x88,&this->_pos,&g_vectorZero,(Entity *)0x0,0, uVar7); local_38.y = (float)&((Entity *)local_30)->_sprite; local_1c = 0; local_18 = 0xf; local_2c[0] = '\0'; local_2c[1] = '\0'; local_2c[2] = '\0'; local_2c[3] = '\0'; local_2c._0_4_ = std::_Allocate(0x20); local_1c = 0x1c; local_18 = 0x1f; builtin_strncpy((char *)local_2c._0_4_,"gfx/002.040_thrown tear.anm2",0x1d); local_8._0_1_ = 2; ANM2::Load((ANM2 *)local_38.y,(std_string *)local_2c,1); local_8 = (uint)local_8._1_3_ << 8; if (0xf < local_18) { uVar7 = local_18 + 1; pcVar6 = (char *)local_2c._0_4_; if (0xfff < uVar7) { pcVar6 = *(char **)(local_2c._0_4_ + -4); uVar7 = local_18 + 0x24; if ((char *)0x1f < (char *)(local_2c._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar7); } LAB_005b2124: ANM2::Play((ANM2 *)local_38.y,(byte *)"Rock1",0); heldEffect = local_30; ((Entity *)((int)local_30 + 0x40c))->_pendingDamage = 2.8026e-45; *(undefined4 *)&((Entity *)((int)local_30 + 0x40c))->_pendingDamageFlags = 9000; ((Entity *)((int)local_30 + 0x40c))->_collisionIndex = ((Entity *)entity)->_initSeed; if (local_30->_parent != (EntityPtr)0x0) { local_40.y = (float)&local_30->_parent; std::multiset::erase(); } heldEffect->_parent = (EntityPtr)this; std::multiset::insert(); entity = heldEffect; LAB_005b2184: TryHoldEntity(this,(Entity *)entity); goto LAB_005b2306; } } else if (iVar5 == 0xcc) { if ((((Entity *)entity)->_variant == 0) && (((Entity *)entity)->_subtype == 0)) { ((Entity *)entity)->_subtype = 99; local_2c._0_4_ = std::_Allocate(0x40); local_1c = 0x36; local_18 = 0x3f; builtin_strncpy((char *)local_2c._0_4_, "gfx/monsters/rebirth/monster_247_flesh mobile host.png",0x37); local_8._0_1_ = 3; Sprite::ReplaceSpritesheet ((Sprite *)&((Entity *)entity)->_sprite,1,(std_string *)local_2c); local_8 = (uint)local_8._1_3_ << 8; bVar3 = extraout_CL_01; if (0xf < local_18) { uVar7 = local_18 + 1; pcVar6 = (char *)local_2c._0_4_; if (0xfff < uVar7) { pcVar6 = *(char **)(local_2c._0_4_ + -4); uVar7 = local_18 + 0x24; if ((char *)0x1f < (char *)(local_2c._0_4_ + (-4 - (int)pcVar6))) goto LAB_005b1e76; } operator_delete(pcVar6,uVar7); bVar3 = extraout_CL_02; } ANM2::LoadGraphics(&((Entity *)entity)->_sprite,bVar3); *(undefined4 *)&((Entity *)((int)entity + 0x40c))->field_0x4 = 0xf; ANM2::SetFrame(&((Entity *)entity)->_sprite,(std_string *)"Bombed",0); uVar13 = *(undefined4 *)((int)&((Entity *)entity)->_flags + 4); *(uint *)&((Entity *)entity)->_flags = (uint)((Entity *)entity)->_flags & 0xffffffef; *(undefined4 *)((int)&((Entity *)entity)->_flags + 4) = uVar13; uVar7 = Random(); local_30 = (Entity_Effect *) Game::Spawn(g_game,1000,0x88,&this->_pos,&g_vectorZero,(Entity *)0x0,0, uVar7); local_38.y = (float)&((Entity *)local_30)->_sprite; local_1c = 0; local_18 = 0xf; local_2c[0] = '\0'; local_2c[1] = '\0'; local_2c[2] = '\0'; local_2c[3] = '\0'; local_2c._0_4_ = std::_Allocate(0x20); local_1c = 0x1c; local_18 = 0x1f; builtin_strncpy((char *)local_2c._0_4_,"gfx/002.040_thrown tear.anm2",0x1d); local_8._0_1_ = 4; ANM2::Load((ANM2 *)local_38.y,(std_string *)local_2c,1); local_8 = (uint)local_8._1_3_ << 8; if (0xf < local_18) { uVar7 = local_18 + 1; pcVar6 = (char *)local_2c._0_4_; if (0xfff < uVar7) { pcVar6 = *(char **)(local_2c._0_4_ + -4); uVar7 = local_18 + 0x24; if ((char *)0x1f < (char *)(local_2c._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar7); } goto LAB_005b2124; } } else { if (iVar5 == 0xf5) goto LAB_005b2184; if (iVar5 == 0x124) { (**(code **)(*(int *)entity + 0x28))(); uVar7 = Random(); iVar5 = 0; uVar13._0_1_ = 0; uVar13._1_1_ = 0; uVar13._2_2_ = 0; pVVar12 = &g_vectorZero; pVVar4 = &this->_pos; fVar11 = 1.90577e-43; fVar10 = 1.4013e-42; fVar8 = 8.36807e-39; local_30 = (Entity_Effect *) Game::Spawn(g_game,1000,0x88,pVVar4,&g_vectorZero,(Entity *)0x0,0,uVar7); ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x284),&((Entity *)entity)->_sprite); other._championColor._offset[0] = fVar8; other._filename._buf[0] = in_stack_fffffd7c[0]; other._filename._buf[1] = in_stack_fffffd7c[1]; other._filename._buf[2] = in_stack_fffffd7c[2]; other._filename._buf[3] = in_stack_fffffd7c[3]; other._filename._buf[4] = in_stack_fffffd7c[4]; other._filename._buf[5] = in_stack_fffffd7c[5]; other._filename._buf[6] = in_stack_fffffd7c[6]; other._filename._buf[7] = in_stack_fffffd7c[7]; other._filename._buf[8] = in_stack_fffffd7c[8]; other._filename._buf[9] = in_stack_fffffd7c[9]; other._filename._buf[10] = in_stack_fffffd7c[10]; other._filename._buf[0xb] = in_stack_fffffd7c[0xb]; other._filename._buf[0xc] = in_stack_fffffd7c[0xc]; other._filename._buf[0xd] = in_stack_fffffd7c[0xd]; other._filename._buf[0xe] = in_stack_fffffd7c[0xe]; other._filename._buf[0xf] = in_stack_fffffd7c[0xf]; other._filename._size = in_stack_fffffd7c._16_4_; other._filename._capacity = in_stack_fffffd7c._20_4_; other._animDefaultName._buf[0] = in_stack_fffffd7c[0x18]; other._animDefaultName._buf[1] = in_stack_fffffd7c[0x19]; other._animDefaultName._buf[2] = in_stack_fffffd7c[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffd7c[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffd7c[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffd7c[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffd7c[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffd7c[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffd7c[0x20]; other._animDefaultName._buf[9] = in_stack_fffffd7c[0x21]; other._animDefaultName._buf[10] = in_stack_fffffd7c[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffd7c[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffd7c[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffd7c[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffd7c[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffd7c[0x27]; other._animDefaultName._size = in_stack_fffffd7c._40_4_; other._animDefaultName._capacity = in_stack_fffffd7c._44_4_; other._animState._animation = (void *)in_stack_fffffd7c._48_4_; other._animState._animData = (void *)in_stack_fffffd7c._52_4_; other._animState._layerFrames = (void *)in_stack_fffffd7c._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffd7c._60_4_; other._animState._animFrame = (float)in_stack_fffffd7c._64_4_; other._animState._isPlaying = in_stack_fffffd7c[0x44]; other._animState._21_3_ = in_stack_fffffd7c._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffd7c._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffd7c._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffd7c._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffd7c._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffd7c._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffd7c._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffd7c._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffd7c[100]; other._overlayAnimState._21_3_ = in_stack_fffffd7c._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffd7c._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffd7c._108_4_; other._overlayRenderFirst = in_stack_fffffd7c[0x70]; other._113_3_ = in_stack_fffffd7c._113_3_; other._animData = (void *)in_stack_fffffd7c._116_4_; other._animCount = in_stack_fffffd7c._120_4_; other._layerState = (void *)in_stack_fffffd7c._124_4_; other._layerCount = in_stack_fffffd7c._128_4_; other._nullLayerNames = (void *)in_stack_fffffd7c._132_4_; other._numNullLayers = in_stack_fffffd7c._136_4_; other._eventNames = (void *)in_stack_fffffd7c._140_4_; other._numEvents = in_stack_fffffd7c._144_4_; other._offset.x = (float)in_stack_fffffd7c._148_4_; other._offset.y = (float)in_stack_fffffd7c._152_4_; other._scale.x = (float)in_stack_fffffd7c._156_4_; other._scale.y = (float)in_stack_fffffd7c._160_4_; other._rotation = (float)in_stack_fffffd7c._164_4_; other._color._tint[0] = (float)in_stack_fffffd7c._168_4_; other._color._tint[1] = (float)in_stack_fffffd7c._172_4_; other._color._tint[2] = (float)in_stack_fffffd7c._176_4_; other._color._tint[3] = (float)in_stack_fffffd7c._180_4_; other._color._colorize[0] = (float)in_stack_fffffd7c._184_4_; other._color._colorize[1] = (float)in_stack_fffffd7c._188_4_; other._color._colorize[2] = (float)in_stack_fffffd7c._192_4_; other._color._colorize[3] = (float)in_stack_fffffd7c._196_4_; other._color._offset[0] = (float)in_stack_fffffd7c._200_4_; other._color._offset[1] = (float)in_stack_fffffd7c._204_4_; other._color._offset[2] = (float)in_stack_fffffd7c._208_4_; other._championColor._tint[0] = (float)in_stack_fffffd7c._212_4_; other._championColor._tint[1] = (float)in_stack_fffffd7c._216_4_; other._championColor._tint[2] = (float)in_stack_fffffd7c._220_4_; other._championColor._tint[3] = (float)in_stack_fffffd7c._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffd7c._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffd7c._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffd7c._236_4_; other._championColor._colorize[3] = (float)in_stack_fffffd7c._240_4_; other._championColor._offset[1] = fVar10; other._championColor._offset[2] = fVar11; other._256_4_ = pVVar4; other._playbackSpeed = (float)pVVar12; other._264_1_ = (char)uVar13; other._loaded = SUB41(uVar13,1); other._266_2_ = SUB42(uVar13,2); other._shadowLayerIndex = iVar5; other._bitflags = uVar7; ANM2::operator_assign(&local_30->_sprite,other); ((Entity *)((int)local_30 + 0x40c))->_pendingDamage = 1.68156e-44; *(undefined4 *)&((Entity *)((int)local_30 + 0x40c))->_pendingDamageFlags = 0; *(undefined4 *)((int)&((Entity *)((int)local_30 + 0x40c))->_pendingDamageFlags + 4) = 0; pEVar9 = &local_30->_parent; ((Entity *)((int)local_30 + 0x40c))->_collisionIndex = ((Entity *)entity)->_initSeed; if (*pEVar9 != (EntityPtr)0x0) { local_40.y = (float)pEVar9; std::multiset::erase(); } *pEVar9 = (EntityPtr)this; std::multiset::insert(); TryHoldEntity(this,(Entity *)local_30); goto LAB_005b2306; } } } local_30 = (Entity_Effect *)&local_30->field_0x1; } while (local_30 < entityCount); } queryResult = EntityList::QueryRadius ((EntityList *)local_40.y,(EntityList_EL *)(local_2c + 8),&this->_pos, 44.0,6); nearbyEntities._0_1_ = '\x01'; nearbyEntities._data = queryResult->_data; nearbyEntities._capacity = queryResult->_capacity; nearbyEntities._size = queryResult->_size; local_38.y = (float)nearbyEntities._data; if (local_2c[8] == '\0') { local_8._0_1_ = 5; tracked_alloc(1,(void *)local_2c._12_4_,0); local_8 = (uint)local_8._1_3_ << 8; local_38.y = (float)nearbyEntities._data; } uVar7 = 0; nearbyEntities._data = (void *)local_38.y; if ((undefined1 *)nearbyEntities._size != (undefined1 *)0x0) { do { rockShot = *(int **)(((std_string *)local_38.y)->_buf + uVar7 * 4); if (rockShot[10] == 2) { isRockShot = rockShot[0xb] == 0x28; LAB_005b219a: if ((((isRockShot) && ((Entity_Player *)rockShot[0xef] != this)) && (*(char *)((int)rockShot + 0x173) == '\0')) && (-75.0 < (float)rockShot[0xd4])) { (**(code **)(*rockShot + 0x28))(); uVar7 = Random(); local_30 = (Entity_Effect *) Game::Spawn(g_game,1000,0x88,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7) ; ANM2::ANM2(&spriteCopy,(ANM2 *)(rockShot + 0x12)); Isaac::SwapANM2(&local_30->_sprite,&spriteCopy); local_8._0_1_ = 6; ANM2::Reset(room); AnimationState::~AnimationState(&spriteCopy._overlayAnimState); AnimationState::~AnimationState(&spriteCopy._animState); std::string::_Tidy_deallocate(spriteCopy._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&spriteCopy); local_8 = (uint)local_8._1_3_ << 8; uVar1 = *(ushort *)((int)rockShot + 0x32); ((Entity *)((int)local_30 + 0x40c))->_pendingDamage = (float)(uint)uVar1; *(uint *)&((Entity *)((int)local_30 + 0x40c))->_pendingDamageFlags = (uint)*(ushort *)(rockShot + 0xc); ((Entity *)((int)local_30 + 0x40c))->_collisionIndex = rockShot[0xfb]; *(undefined4 *)((int)&((Entity *)((int)local_30 + 0x40c))->_pendingDamageFlags + 4) = 0; if ((float)(uint)uVar1 == 1.96182e-44) { *(int *)((int)&((Entity *)((int)local_30 + 0x40c))->_pendingDamageFlags + 4) = (int)(float)rockShot[0xe0]; } pEVar9 = &local_30->_parent; if (local_30->_parent != (EntityPtr)0x0) { local_40.y = (float)pEVar9; std::multiset::erase(); } *pEVar9 = (EntityPtr)this; std::multiset::insert(); TryHoldEntity(this,(Entity *)local_30); goto LAB_005b2306; } } else if (rockShot[10] == 9) { isRockShot = rockShot[0xb] == 8; goto LAB_005b219a; } uVar7 = uVar7 + 1; } while (uVar7 < (uint)nearbyEntities._size); } PlayExtraAnimation(this,(byte *)"LiftItem"); ANM2::Reset(&this->_heldSprite); FlushQueueItem(this); this->_itemState = 0x25c; this->_itemStateCooldown = 0; LAB_005b2306: if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (ANM2 *)0x0) { uVar7 = ((ANM2 *)((int)nearbyEntities._data + -0x114))->_bitflags; qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar7; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar7); free(&((ANM2 *)((int)nearbyEntities._data + -0x114))->_bitflags); } } } ExceptionList = local_10; return; } //@@ 005b2360 Entity_Player::UseRedKey /* ZHL [exact] __thiscall void Entity_Player::UseRedKey(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::UseRedKey(Entity_Player *this) { int iVar1; int *piVar2; uint doorSlot; float fVar3; float fVar4; doorSlot = 0; piVar2 = (int *)((int)g_game->_room + 0x7744); while ((iVar1 = *piVar2, iVar1 == 0 || (fVar3 = (this->_pos).y - *(float *)(iVar1 + 0x340), fVar4 = (this->_pos).x - *(float *)(iVar1 + 0x33c), 14400.0 <= fVar3 * fVar3 + fVar4 * fVar4))) { doorSlot = doorSlot + 1; piVar2 = piVar2 + 1; if (7 < doorSlot) { return; } } if (doorSlot != 0xffffffff) { Level::MakeRedRoomDoor((Level *)g_game,g_game->_currentRoomIdx,doorSlot); } return; } //@@ 005b23f0 Entity_Player::use_card_hagalaz /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: UseCard case 0x20 (CARD_RUNE_HAGALAZ; case 0x1f is Joker, 0x21 Jera); walks room grid calling Destroy on every non-door grid entity, morphs rock NPCs (type 0x13 variants 2/3 etc.) via Entity_NPC::Morph, ItemOverlay::Show(0x14) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::use_card_hagalaz(Entity_Player *npc,RNG *rng) { uint uVar1; Entity_NPC *npc; Entity *spawned; int *piVar2; uint uVar3; void *pvVar4; undefined1 *particlesLeft; code *pcVar5; void *gridX; int iVar6; float fVar7; TypeDescriptor *pTVar8; undefined4 uVar9; TypeDescriptor *pTVar10; undefined4 uVar11; EntityRef destroySource2; EntityRef destroySource; EntityRef damageGridSource; undefined4 rockDamageSource; undefined4 local_214; undefined4 local_210; undefined4 local_20c; float local_208; float local_204; float local_200; float local_1fc; undefined4 local_1f8; undefined4 local_1f4; undefined8 local_1ec; Vector particlePos; float npcPosY; float npcPosX; Vector particleVelocity; uint entityIndex; undefined4 local_1c4; uint rngSeed; Entity_Player *player; void *local_1b8; undefined1 *local_1b4; int *local_1b0; undefined4 local_1ac; undefined4 local_1a8; undefined4 local_1a4; float local_1a0; undefined4 local_19c; float fStack_198; float fStack_194; float fStack_190; float local_18c; undefined4 local_188; undefined4 local_184; int rockEnemyTable [95]; Manager *manager; EntityRef *sourceRef; rockEnemyTable[0x5e] = __security_cookie ^ (uint)(rockEnemyTable + 0x5f); if (rng == (RNG *)0x0) { uVar1 = 0; } else { uVar1 = rng->_seed; } pvVar4 = g_game->_room; local_1ec = 0x1b00000005; local_1c4 = 0x19; local_1b8 = (void *)0x1; rngSeed = uVar1; player = npc; if (1 < *(int *)((int)pvVar4 + 0xc) + -1) { do { local_1b0 = (int *)0x1; gridX = local_1b8; if (1 < *(int *)((int)pvVar4 + 0x10) + -1) { do { if (-1 < (int)gridX) { if ((((int)gridX < *(int *)((int)pvVar4 + 0xc)) && (-1 < (int)local_1b0)) && ((int)local_1b0 < *(int *)((int)pvVar4 + 0x10))) { iVar6 = *(int *)((int)pvVar4 + 0xc) * (int)local_1b0 + (int)gridX; if (-1 < iVar6) { piVar2 = *(int **)((int)pvVar4 + iVar6 * 4 + 0x24); if ((piVar2 != (int *)0x0) && (piVar2[1] != 0x10)) { if (rng == (RNG *)0x0) { LAB_005b2520: pcVar5 = *(code **)(*piVar2 + 0x14); EntityRef::constructor(&destroySource,(Entity *)player); (*pcVar5)(0,&destroySource); if (piVar2[1] == 0x16) { pcVar5 = *(code **)(*piVar2 + 0x14); EntityRef::constructor(&destroySource2,(Entity *)player); sourceRef = &destroySource2; uVar9 = 0; goto LAB_005b2568; } } else { if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar1 = uVar1 >> ((byte)local_1ec & 0x1f) ^ uVar1; uVar1 = uVar1 << ((byte)((ulonglong)local_1ec >> 0x20) & 0x1f) ^ uVar1; uVar1 = uVar1 >> ((byte)local_1c4 & 0x1f) ^ uVar1; if ((uVar1 & 3) == 0) goto LAB_005b2520; pcVar5 = *(code **)(*piVar2 + 0x10); EntityRef::constructor(&damageGridSource,(Entity *)player); sourceRef = &damageGridSource; uVar9 = 1; LAB_005b2568: (*pcVar5)(uVar9,sourceRef); } gridX = local_1b8; } } } } local_1b0 = (int *)((int)local_1b0 + 1); pvVar4 = g_game->_room; } while ((int)local_1b0 < *(int *)((int)pvVar4 + 0x10) + -1); rngSeed = uVar1; } local_1b8 = (void *)((int)gridX + 1); pvVar4 = g_game->_room; } while ((int)local_1b8 < *(int *)((int)pvVar4 + 0xc) + -1); } rockEnemyTable[0] = 0x335; rockEnemyTable[1] = 0; rockEnemyTable[2] = 0x17; rockEnemyTable[3] = 3; rockEnemyTable[4] = 0x35b; rockEnemyTable[5] = 0; rockEnemyTable[6] = 0x29; rockEnemyTable[7] = 3; rockEnemyTable[8] = 0x332; rockEnemyTable[9] = 0; rockEnemyTable[10] = 0x332; rockEnemyTable[0xb] = 1; rockEnemyTable[0xc] = 0x332; rockEnemyTable[0xd] = 2; rockEnemyTable[0xe] = 0x12e; rockEnemyTable[0xf] = 0; rockEnemyTable[0x10] = 0x12e; rockEnemyTable[0x11] = 10; rockEnemyTable[0x12] = 0x33a; rockEnemyTable[0x13] = 0; rockEnemyTable[0x14] = 0x2a; rockEnemyTable[0x15] = 0; rockEnemyTable[0x16] = 0x2a; rockEnemyTable[0x17] = 1; rockEnemyTable[0x18] = 0x2a; rockEnemyTable[0x19] = 2; rockEnemyTable[0x1a] = 0xc9; rockEnemyTable[0x1b] = 0; rockEnemyTable[0x1c] = 0xca; rockEnemyTable[0x1d] = 0; rockEnemyTable[0x1e] = 0xca; rockEnemyTable[0x1f] = 10; rockEnemyTable[0x20] = 0xcb; rockEnemyTable[0x21] = 0; rockEnemyTable[0x22] = 0xeb; rockEnemyTable[0x23] = 0; rockEnemyTable[0x24] = 0xec; rockEnemyTable[0x25] = 0; rockEnemyTable[0x26] = 0x324; rockEnemyTable[0x27] = 0; rockEnemyTable[0x28] = 0x329; rockEnemyTable[0x29] = 0; rockEnemyTable[0x2a] = 0x2c; rockEnemyTable[0x2b] = 0; rockEnemyTable[0x2c] = 0x2c; rockEnemyTable[0x2d] = 1; rockEnemyTable[0x2e] = 0x36d; rockEnemyTable[0x2f] = 0; rockEnemyTable[0x30] = 0x37d; rockEnemyTable[0x31] = 0; rockEnemyTable[0x32] = 0x354; rockEnemyTable[0x33] = 0; rockEnemyTable[0x34] = 0x393; rockEnemyTable[0x35] = 1; rockEnemyTable[0x36] = 0x1b; rockEnemyTable[0x37] = 0; rockEnemyTable[0x38] = 0x1b; rockEnemyTable[0x39] = 1; rockEnemyTable[0x3a] = 0x1b; rockEnemyTable[0x3b] = 3; rockEnemyTable[0x3c] = 0x1b; rockEnemyTable[0x3d] = 1; rockEnemyTable[0x3e] = 0xcc; rockEnemyTable[0x3f] = 0; rockEnemyTable[0x40] = 0xf7; rockEnemyTable[0x41] = 0; rockEnemyTable[0x42] = 0x29; rockEnemyTable[0x43] = 0; rockEnemyTable[0x44] = 0x20; rockEnemyTable[0x45] = 0; rockEnemyTable[0x46] = 0x29; rockEnemyTable[0x47] = 2; rockEnemyTable[0x48] = 0x348; rockEnemyTable[0x49] = 0; rockEnemyTable[0x4a] = 0x29; rockEnemyTable[0x4b] = 4; rockEnemyTable[0x4c] = 0x348; rockEnemyTable[0x4d] = 0; rockEnemyTable[0x4e] = 0xfe; rockEnemyTable[0x4f] = 0; rockEnemyTable[0x50] = 0x20; rockEnemyTable[0x51] = 0; rockEnemyTable[0x52] = 0x11b; rockEnemyTable[0x53] = 0; local_1b8 = g_game->_room; rockEnemyTable[0x54] = 0x20; rockEnemyTable[0x55] = 0; rockEnemyTable[0x56] = 0xd4; rockEnemyTable[0x57] = 0; rockEnemyTable[0x58] = 0x11e; rockEnemyTable[0x59] = 0; rockEnemyTable[0x5a] = 0xd4; rockEnemyTable[0x5b] = 3; rockEnemyTable[0x5c] = 0x11e; rockEnemyTable[0x5d] = 0; entityIndex = 0; if (*(int *)((int)local_1b8 + 0x1264) != 0) { do { if (*(int *)(*(int *)(entityIndex * 4 + *(int *)((int)local_1b8 + 0x125c)) + 0x28) - 10U < 0x3de) { if (rng == (RNG *)0x0) { LAB_005b29ae: npc = (Entity_NPC *) __RTDynamicCast(*(undefined4 *)(*(int *)((int)local_1b8 + 0x125c) + entityIndex * 4) ,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); uVar3 = 0; do { if ((npc->_type == rockEnemyTable[uVar3 * 2]) && (npc->_variant == rockEnemyTable[uVar3 * 2 + 1])) { local_1a8 = 0; local_1a4 = 0; local_1a0 = 0.0; local_19c = 0; fStack_198 = g_vectorZero.x; fStack_194 = g_vectorZero.y; fStack_190 = g_vectorZero.x; local_18c = g_vectorZero.y; local_188 = 0; local_184 = 0; (**(code **)(*(int *)npc + 0x24))(&local_1a8); manager = g_manager; local_1b0 = (int *)0x89; seed_fart_sound_override((int *)&local_1b0); SoundEffects::Play(&manager->_sfxManager,(int)local_1b0,1.0,2,0,1.0,0.0); break; } uVar3 = uVar3 + 1; } while (uVar3 < 0x1b); piVar2 = rockEnemyTable + 0x37; uVar3 = 0; LAB_005b2ad0: if ((npc->_type != piVar2[-1]) || (npc->_variant != *piVar2)) goto LAB_005b2adc; if (npc->_type == 0xd4) { npc->_isInvicible = 0; } Entity_NPC::Morph(npc,rockEnemyTable[uVar3 * 4 + 0x38],rockEnemyTable[uVar3 * 4 + 0x39],0, -1); manager = g_manager; if (*(int *)((int)player->_config + 0x5c) < 1) { local_1b0 = (int *)0x3f4ccccd; } else { local_1b0 = (int *)0x3f800000; } local_1b4 = (undefined1 *)0x1e; seed_fart_sound_override((int *)&local_1b4); SoundEffects::Play(&manager->_sfxManager,(int)local_1b4,(float)local_1b0,2,0,1.0,0.0); uVar3 = Random(); particlesLeft = (undefined1 *)(uVar3 % 6 + 6); if (particlesLeft != (undefined1 *)0x0) { local_1b4 = particlesLeft; do { uVar1 = Random(); fVar7 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1b4 = (undefined1 *)(fVar7 + fVar7); uVar1 = Random(); local_1b0 = (int *)((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 5.0); particleVelocity.x = cos((float)local_1b4); particleVelocity.x = particleVelocity.x * (float)local_1b0; particleVelocity.y = sin((float)local_1b4); particleVelocity.y = particleVelocity.y * (float)local_1b0; uVar1 = Random(); npcPosX = (npc->_pos).x; npcPosY = (npc->_pos).y; uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1b4 = (undefined1 *)(fVar7 + fVar7); uVar3 = Random(); local_1b0 = (int *)((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar7 = cos((float)local_1b4); particlePos.x = fVar7 * (float)local_1b0 + npcPosX; fVar7 = sin((float)local_1b4); uVar11 = 0; pTVar10 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; particlePos.y = fVar7 * (float)local_1b0 + npcPosY; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar9 = 0; spawned = Game::Spawn(g_game,1000,0x3b,&particlePos,&particleVelocity,(Entity *)0x0,0, uVar1); piVar2 = (int *)__RTDynamicCast(spawned,uVar9,pTVar8,pTVar10,uVar11); local_1b4 = (undefined1 *)0x3f800000; if (((float)piVar2[0xcf] - (npc->_pos).x) * particleVelocity.y - ((float)piVar2[0xd0] - (npc->_pos).y) * particleVelocity.x < 0.0) { local_1b4 = &DAT_bf800000; } local_1b0 = piVar2; uVar1 = Random(); piVar2[0x11d] = (int)(((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)] ) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_1b4); uVar1 = Random(); iVar6 = uVar1 % 0xf + 0xf; piVar2[0x117] = iVar6; piVar2[0x118] = iVar6; fVar7 = g_vectorOne.y; piVar2[0x39] = (int)g_vectorOne.x; piVar2[0x3a] = (int)fVar7; pcVar5 = *(code **)(*piVar2 + 0x3c); uVar1 = Random(); local_1ac = 0x3f800000; local_1a8 = 0x3f800000; local_1a4 = 0x3f800000; local_18c = 0.0; local_188 = 0; local_184 = 0; local_19c = 0; fStack_198 = 0.0; fStack_194 = 0.0; fStack_190 = 0.0; local_1a0 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)] ) * 2.3283064e-10 * 0.5 + 0.2; (*pcVar5)(&local_1ac,0xffffffff,0xff,0,1); (**(code **)(*local_1b0 + 0xc))(); particlesLeft = particlesLeft + -1; } while (particlesLeft != (undefined1 *)0x0); uVar1 = rngSeed; } manager = g_manager; local_1b4 = (undefined1 *)0x89; seed_fart_sound_override((int *)&local_1b4); SoundEffects::Play(&manager->_sfxManager,(int)local_1b4,1.0,2,0,1.0,0.0); LAB_005b2f5e: manager = g_manager; if ((npc->_type == 0x13) && (((npc->_variant == 2 || (npc->_variant == 3)) && (npc->_i2 == 0)))) { local_1b4 = (undefined1 *)0x89; seed_fart_sound_override((int *)&local_1b4); SoundEffects::Play(&manager->_sfxManager,(int)local_1b4,1.0,2,0,1.0,0.0); rockDamageSource = 0; local_214 = 0; local_210 = 0; local_20c = 0; local_208 = g_vectorZero.x; local_204 = g_vectorZero.y; local_200 = g_vectorZero.x; local_1fc = g_vectorZero.y; local_1f8 = 0; local_1f4 = 0; (**(code **)(*(int *)npc + 0x20))(0x42200000,4,0,&rockDamageSource,0x1e); } goto LAB_005b3058; } if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar1 = uVar1 >> ((byte)local_1ec & 0x1f) ^ uVar1; uVar1 = uVar1 << ((byte)((ulonglong)local_1ec >> 0x20) & 0x1f) ^ uVar1; uVar1 = uVar1 >> ((byte)local_1c4 & 0x1f) ^ uVar1; rngSeed = uVar1; if ((uVar1 & 3) == 0) goto LAB_005b29ae; } LAB_005b3058: entityIndex = entityIndex + 1; } while (entityIndex < *(uint *)((int)local_1b8 + 0x1264)); } if (rng == (RNG *)0x0) { ItemOverlay::Show(&g_game->_itemOverlay,0x14,4,(Entity_Player *)0x0); } return; LAB_005b2adc: uVar3 = uVar3 + 1; piVar2 = piVar2 + 4; if (9 < uVar3) goto LAB_005b2f5e; goto LAB_005b2ad0; } //@@ 005b30b0 alabaster_box_timer_callback /* DB: callback passed to Entity_Effect::CreateTimer (mov ecx,0x5b30b0 at 0x5c3383) in Entity_Player::UseActiveItem case COLLECTIBLE_ALABASTER_BOX; uses collectible RNG 0x249 (585), spawns soul/black hearts 5.10 + item from pool 3/4 per devil deals, Book of Virtues (584) adds wisp 585, 'Happy' */ void alabaster_box_timer_callback(int param_1) { Entity_Player *this; void *pvVar1; bool bVar2; code *pcVar3; Game *pGVar4; Manager *pMVar5; byte bVar6; uint uVar7; uint uVar8; Vector *pVVar9; void *pvVar10; ItemPool *pIVar11; uint *puVar12; int FrameDelay; int local_38; ItemPool *local_34; Vector local_30; Vector local_28; Vector local_20; Vector local_18; Vector local_10; this = *(Entity_Player **)(param_1 + 0x3bc); if ((this != (Entity_Player *)0x0) && (this->_type == 1)) { pvVar10 = (this->_collectibleRNGs)._end; if ((int)((int)pvVar10 - (int)(this->_collectibleRNGs)._begin & 0xfffffff0U) < 0x2491) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); pvVar10 = (this->_collectibleRNGs)._end; } pvVar1 = (this->_collectibleRNGs)._begin; uVar7 = ((int)pvVar10 - (int)pvVar1 >> 4) - 1; uVar8 = 0x249; if (uVar7 < 0x249) { uVar8 = uVar7; } local_30.x = (this->_pos).x; puVar12 = (uint *)(uVar8 * 0x10 + (int)pvVar1); local_30.y = (this->_pos).y; Room::FindFreePickupSpawnPosition(g_game->_room,&local_18,&local_30,40.0,0,0,0); uVar7 = *puVar12; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar12; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)puVar12[1] & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)puVar12[2] & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)puVar12[3] & 0x1f) ^ uVar7; *puVar12 = uVar7; uVar8 = 3; if (*(int *)(param_1 + 0x30) == 1) { uVar8 = 6; } Game::SpawnEx(g_game,5,10,&local_18,&g_vectorZero,(Entity *)0x0,uVar8,uVar7,0); if (*(int *)(param_1 + 0x30) == 1) { bVar2 = 0 < g_game->_devilRoomDeals; } else { bVar2 = g_game->_devilRoomDeals < 1; } local_38 = bVar2 + 1; do { local_28.y = (this->_pos).y; local_28.x = (this->_pos).x; Room::FindFreePickupSpawnPosition(g_game->_room,&local_30,&local_28,40.0,0,0,0); uVar7 = *puVar12; local_34 = &g_game->_itemPool; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar12; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)puVar12[1] & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)puVar12[2] & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)puVar12[3] & 0x1f) ^ uVar7; *puVar12 = uVar7; uVar8 = ItemPool::GetCollectible(local_34,(*(int *)(param_1 + 0x30) != 1) + 3,uVar7,0,0,0); uVar7 = *puVar12; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar12; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } pGVar4 = g_game; uVar7 = uVar7 >> ((byte)puVar12[1] & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)puVar12[2] & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)puVar12[3] & 0x1f) ^ uVar7; *puVar12 = uVar7; Game::SpawnEx(pGVar4,5,100,&local_30,&g_vectorZero,(Entity *)0x0,uVar8,uVar7,0); uVar7 = Random(); Game::SpawnEx(g_game,1000,0xf,&local_30,&g_vectorZero,(Entity *)0x0,0,uVar7,0); local_20.y = (this->_pos).y; local_20.x = (this->_pos).x; pVVar9 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,&local_20,40.0,0,0,0); uVar7 = *puVar12; local_30.x = pVVar9->x; local_30.y = pVVar9->y; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar12; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)puVar12[1] & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)puVar12[2] & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)puVar12[3] & 0x1f) ^ uVar7; *puVar12 = uVar7; if (*(int *)(param_1 + 0x30) == 1) { uVar8 = 6; } else { uVar8 = uVar7; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *puVar12; } if (uVar8 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar8 = uVar8 >> ((byte)puVar12[1] & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)puVar12[2] & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)puVar12[3] & 0x1f) ^ uVar8; *puVar12 = uVar8; uVar8 = 4 - (uVar8 % 10 != 0); } Game::SpawnEx(g_game,5,10,&local_30,&g_vectorZero,(Entity *)0x0,uVar8,uVar7,0); local_38 = local_38 + -1; } while (local_38 != 0); bVar6 = Entity_Player::HasCollectible(this,0x248,0); if (bVar6 != 0) { pIVar11 = (ItemPool *)((uint)(g_game->_devilRoomDeals < 1) * 4 + 4); local_34 = pIVar11; do { local_20.x = (this->_pos).x; local_20.y = (this->_pos).y; Entity_Player::AddWisp(this,0x249,&local_20,0,0); pIVar11 = (ItemPool *)((int)&pIVar11[-1]._numAvailableTrinkets + 3); } while (pIVar11 != (ItemPool *)0x0); } pMVar5 = g_manager; pGVar4 = g_game; if (*(int *)(param_1 + 0x30) == 1) { local_38 = 0xf1; g_game->_darknessStrength = 1.0; pGVar4->_darknessTimeout = 0x4b; seed_fart_sound_override(&local_38); FrameDelay = 2; } else { local_38 = 0x10a; seed_fart_sound_override(&local_38); FrameDelay = 0x14; } SoundEffects::Play(&pMVar5->_sfxManager,local_38,1.0,FrameDelay,0,1.0,0.0); pMVar5 = g_manager; local_38 = 0x10c; seed_fart_sound_override(&local_38); SoundEffects::Play(&pMVar5->_sfxManager,local_38,1.0,2,0,1.0,0.0); this->_isPlayingItemAnimation = 0; ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); bVar6 = ANM2::SetAnimation(&this->_sprite,(byte *)"Happy",1); if (bVar6 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 1; this->_isPlayingItemAnimation = 0; } return; } //@@ 005b35c0 Isaac::SpawnLocust /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static cleanup void Isaac::SpawnLocust(Entity_Player* player, int collectibleType, Vector* pos); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ void __cdecl Isaac::SpawnLocust(Entity_Player *player,int collectibleType,Vector *pos) { ItemConfig_Item *collectibleConfig; uint rngResult; Entity_Familiar *locust; void *pvVar1; Entity *poof; int iVar2; int iVar3; void *ptr; int *piVar4; uint uVar5; bool isGameNull; int *local_6c; Vector scratchVec; Vector *spawnPos; int *local_58; void *local_54; ItemConfig *local_50; float local_4c; uint local_48; int *local_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af5a0d; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar4 = (int *)0x0; spawnPos = pos; local_54 = (void *)0x0; local_6c = (int *)0x0; local_58 = (int *)0x0; local_8 = 0; local_50 = &g_manager->_itemConfig; local_4c = (float)collectibleType; collectibleConfig = ItemConfig::GetCollectible(local_50,collectibleType); if ((collectibleConfig == (ItemConfig_Item *)0x0) || (iVar2 = *(int *)collectibleConfig[1].name._buf - collectibleConfig[1].id, iVar3 = iVar2 >> 0x1f, iVar2 / 0xb8 + iVar3 == iVar3)) { pvVar1 = (local_50->_collectibles)._begin; if ((int)((int)(local_50->_collectibles)._end - (int)pvVar1 & 0xfffffffcU) < 0x65) { collectibleConfig = (ItemConfig_Item *)0x0; } else { collectibleConfig = *(ItemConfig_Item **)((int)pvVar1 + 100); } } local_44 = (int *)0x0; iVar2 = *(int *)collectibleConfig[1].name._buf - collectibleConfig[1].id; iVar3 = iVar2 >> 0x1f; if (iVar2 / 0xb8 + iVar3 != iVar3) { iVar3 = collectibleConfig[1].id; local_48 = 0; do { local_54 = (void *)(local_48 + iVar3); if (local_6c == local_58) { std::vector<4byte>::_Emplace_reallocate(local_6c,&local_54); local_58 = (int *)0x0; } else { *local_6c = (int)local_54; local_6c = local_6c + 1; } iVar3 = collectibleConfig[1].id; local_48 = local_48 + 0xb8; local_44 = (int *)((int)local_44 + 1); } while (local_44 < (int *)((*(int *)collectibleConfig[1].name._buf - iVar3) / 0xb8)); local_54 = (void *)0x0; collectibleType = (int)local_4c; piVar4 = local_6c; } pvVar1 = (void *)0x0; uVar5 = (int)piVar4 >> 2; local_48 = 0; if (uVar5 != 0) { local_44 = (int *)0x0; do { iVar3 = 0; if (0 < *(int *)(*local_44 + 0x80)) { do { rngResult = ::Random(); local_4c = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_4c = local_4c + local_4c; rngResult = ::Random(); local_50 = (ItemConfig *) ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 4.0 + 6.0); scratchVec.x = cos(local_4c); scratchVec.x = scratchVec.x * (float)local_50; scratchVec.y = sin(local_4c); scratchVec.y = scratchVec.y * (float)local_50; rngResult = ::Random(); locust = (Entity_Familiar *) Game::Spawn(g_game,3,0xe7,spawnPos,&scratchVec,(Entity *)player,collectibleType, rngResult); rngResult = ::Random(); isGameNull = g_game == (Game *)0x0; locust->_state = (rngResult & 1) + 4; if (isGameNull) { if (-1 < collectibleType) goto LAB_005b3839; LAB_005b3853: pvVar1 = (void *)0x0; } else if (collectibleType < 0) { pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin; if ((int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2 <= ~collectibleType) goto LAB_005b3853; pvVar1 = (void *)**(undefined4 **)((int)pvVar1 + ~collectibleType * 4); } else { LAB_005b3839: pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 >> 2 <= collectibleType) goto LAB_005b3853; pvVar1 = *(void **)((int)pvVar1 + collectibleType * 4); } locust->_item = pvVar1; Entity_Familiar::set_locust_config_index(locust,local_48); (**(code **)(*(int *)locust + 0xc))(); iVar3 = iVar3 + 1; } while (iVar3 < *(int *)(*local_44 + 0x80)); } pvVar1 = local_54; local_48 = local_48 + 1; local_44 = local_44 + 1; } while (local_48 < uVar5); if (uVar5 != 0) { uVar5 = ::Random(); scratchVec.x = spawnPos->x + 0.0; scratchVec.y = spawnPos->y + 10.0; poof = Game::Spawn(g_game,1000,0xf,&scratchVec,&g_vectorZero,(Entity *)0x0,0,uVar5); local_20 = 0; local_1c = 0; local_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; local_18 = 0; local_40 = 0x3dcccccd; uStack_3c = 0x3dcccccd; uStack_38 = 0x3dcccccd; uStack_34 = 0x3f800000; (**(code **)(*(int *)poof + 0x3c))(&local_40,0xffffffff,0xff,0,1); (**(code **)(*(int *)poof + 0xc))(); } } if (pvVar1 != (void *)0x0) { uVar5 = (int)local_58 - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < uVar5) { ptr = *(void **)((int)pvVar1 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } ExceptionList = local_10; return; } //@@ 005b3990 FUN_005b3990 undefined4 FUN_005b3990(uint *param_1) { uint uVar1; uVar1 = *param_1; if ((((uVar1 == 1) || (uVar1 == 3)) || (uVar1 == 4)) && (uVar1 = param_1[0x2e] & 0x1000000, uVar1 == 0)) { return 0; } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 005b39d0 Entity_Player::UseActiveItem /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:UseActiveItem prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall Entity_Player::UseActiveItem (Entity_Player *this,short *resultFlags,int collectible,uint useFlags,int activeSlot, int varData) { ushort uVar1; ushort uVar2; code *pcVar3; ANM2 other; ColorMod color; ColorMod color_00; Vector VVar4; RNG rng; RNG rng_00; RNG rng_01; RNG rng_02; RNG rng_03; RNG rng_04; RNG rng_05; Vector pos; byte bVar5; undefined1 uVar6; char cVar7; Entity_Player *pEVar8; int iVar9; Entity_Player *pEVar10; uint uVar11; ItemConfig *itemConfigDb; MusicManager *musicManager; PlayerManager *playerManager; BitSet128 *tearFlags; PersistentGameData *persistentData; ColorMod *poofColor; Sprite *sprite; Color *spriteColor; Vector *tmpVec2; int iVar12; HUD *hud; SoundEffects *sfxManager; Entity_Laser *tammyLaser; Entity_Bomb *tammyBomb; Entity_Knife *tammyKnife; ColorMod *Color; Entity_Player *curPlayer; RNG *rngPtr; ItemConfig_Item *itemConfig; undefined1 *puVar13; EntityList *roomEntities; std_string *localizedName; ColorMod *poofColor; RNG *spriteColor; Entity *tmpEntity; GridEntity_Door *door; TemporaryEffects *tempEffects; Entity_Effect *effect; Entity_Tear *tear; int *piVar14; ItemConfig_Card *cardConfig; Vector *tmpVec; Room *room; undefined4 *puVar15; RoomDescriptor *roomDesc; Entity_Pickup *pEVar16; RNG *sfxManager; GridEntity *gridEntity; EntityList_EL *queryList; Entity_NPC *minecart; ColorMod *color_02; undefined4 uVar17; short *psVar18; RNG *tammyBomb; GridEntity_Spikes *tammyKnife; int goldenHearts; int soulHearts; int maxHearts; ColorMod *color_03; uint *puVar19; float *pfVar20; EntityConfig_Entity *entityConfigEntry; Game *pGVar21; ColorMod *color_04; EntityRef *charmSourceRef; ColorMod *color_05; Camera *camera; RNG *curPlayer; Ambush *ambush; GlowingHourglassState *hourglassState; ItemPool *itemPool; ColorModState *roomColorMod; Level *pLVar22; Entity_Familiar *familiar; ANM2 *pAVar23; LayerState *layerState; int layerCount; ItemOverlay *itemOverlay; void *pvVar24; int iVar25; Level *level; uint uVar26; int layerIndex; undefined1 *puVar27; Vector *playerPos; WeightedOutcomePicker *d12Picker; bool bVar28; bool bVar29; float10 fVar30; ANM2 aAStackY_a604 [128]; undefined1 in_stack_ffffe510 [184]; float in_stack_ffffe5c8; float in_stack_ffffe5cc; float in_stack_ffffe5d0; float in_stack_ffffe5d4; float in_stack_ffffe5d8; float in_stack_ffffe5dc; float in_stack_ffffe5e0; float in_stack_ffffe5e4; float in_stack_ffffe5e8; float in_stack_ffffe5ec; float in_stack_ffffe5f0; float in_stack_ffffe5f4; float in_stack_ffffe5f8; float in_stack_ffffe5fc; float in_stack_ffffe600; float in_stack_ffffe604; float fVar31; float fVar32; undefined4 uVar33; Entity_Player *pEVar34; float fVar35; byte bVar36; Entity_Player *pEVar37; char *pcVar38; float fVar39; BitSet128 *pBVar40; byte bVar41; BitSet128 *pBVar42; EntityRef EStack_19d0; EntityRef EStack_19a8; EntityRef EStack_1980; EntityRef EStack_1958; EntityRef EStack_1930; EntityRef EStack_1908; EntityRef EStack_18e0; EntityRef EStack_18b8; EntityRef EStack_1890; EntityRef EStack_1868; EntityRef EStack_1840; EntitySaveState aEStack_1818 [30]; float afStack_17a0 [12]; EntityRef EStack_1770; EntityRef EStack_1748; EntityRef EStack_1720; EntityRef EStack_16f8; EntityRef EStack_16d0; EntityRef EStack_16a8; EntityRef EStack_1680; EntityRef EStack_1658; EntityRef EStack_1630; EntityRef EStack_1608; EntityRef EStack_15e0; EntityRef EStack_15b8; EntityRef EStack_1590; EntityRef EStack_1568; EntityRef EStack_1540; EntityRef EStack_1518; EntityRef EStack_14f0; EntityRef EStack_14c8; EntityRef EStack_14a0; BitSet128 BStack_1478; BitSet128 BStack_1468; BitSet128 BStack_1458; BitSet128 BStack_1448; BitSet128 BStack_1438; undefined1 auStack_1428 [16]; BitSet128 BStack_1418; undefined1 local_1408 [16]; BitSet128 BStack_13f8; BitSet128 BStack_13e8; BitSet128 BStack_13d8; undefined1 auStack_13c8 [16]; BitSet128 BStack_13b8; BitSet128 BStack_13a8; BitSet128 BStack_1398; undefined1 auStack_1384 [28]; Vector VStack_1368; Vector VStack_1360; Vector VStack_1358; Vector VStack_1350; Vector VStack_1348; Vector VStack_1340; Vector VStack_1338; Vector VStack_1330; Vector VStack_1328; Vector VStack_1320; Vector VStack_1318; Vector VStack_1310; Vector VStack_1308; Vector VStack_1300; Vector VStack_12f8; Vector VStack_12f0; Vector VStack_12e8; Vector VStack_12e0; Vector VStack_12d8; Vector VStack_12d0; Vector VStack_12c8; Vector VStack_12c0; Vector VStack_12b8; ColorModState savedColorMod; Vector VStack_1298; Vector VStack_1290; Vector VStack_1288; Vector VStack_1280; Vector VStack_1278; Vector VStack_1270; Vector VStack_1268; Vector VStack_1260; Vector VStack_1258; Vector VStack_1250; Vector VStack_1248; Vector VStack_1240; Vector VStack_1238; Vector VStack_1230; Vector VStack_1228; Vector VStack_1220; Vector VStack_1218; Vector aVStack_1210 [2]; Vector VStack_1200; Vector VStack_11f8; Vector VStack_11f0; Vector VStack_11e8; Vector VStack_11e0; Vector VStack_11d8; Vector VStack_11d0; Vector VStack_11c8; Vector VStack_11c0; Vector VStack_11b8; Vector aVStack_11b0 [2]; Vector local_11a0; Vector local_1198; Vector local_1190; Vector local_1188; Vector local_1180; Vector VStack_1178; Vector VStack_1170; Vector VStack_1168; Vector VStack_1160; Vector VStack_1158; Vector VStack_1150; Vector aVStack_1148 [2]; Vector VStack_1138; Vector VStack_1130; Vector VStack_1128; Vector VStack_1120; Vector VStack_1118; Vector VStack_1110; Vector VStack_1108; Vector VStack_1100; Vector VStack_10f8; Vector VStack_10f0; Vector VStack_10e8; Vector VStack_10e0; Vector VStack_10d8; Vector VStack_10d0; Vector VStack_10c8; Vector VStack_10c0; Vector VStack_10b8; Vector VStack_10b0; Vector VStack_10a8; Vector VStack_10a0; Vector VStack_1098; Vector VStack_1090; Vector VStack_1088; Vector VStack_1080; Vector VStack_1078; Vector VStack_1070; Vector VStack_1068; Vector VStack_1060; Vector VStack_1058; Vector VStack_1050; Vector VStack_1048; Vector VStack_1040; Vector VStack_1038; Vector VStack_1030; Vector aVStack_1028 [3]; Vector VStack_1010; Vector VStack_1008; Vector VStack_1000; Vector VStack_ff8; Vector VStack_ff0; Vector VStack_fe8; Vector VStack_fe0; Vector VStack_fd8; Vector VStack_fd0; Vector aVStack_fc8 [2]; Vector aVStack_fb8 [3]; Vector VStack_fa0; Vector VStack_f98; Vector VStack_f90; Vector VStack_f88; Vector VStack_f80; Vector VStack_f78; Vector VStack_f70; Vector VStack_f68; Vector VStack_f60; Vector VStack_f58; Vector VStack_f50; Vector VStack_f48; Vector VStack_f40; Vector VStack_f38; Vector VStack_f30; Vector VStack_f28; Vector VStack_f20; Vector VStack_f18; Vector VStack_f10; Vector VStack_f08; Vector VStack_f00; Vector VStack_ef8; Vector VStack_ef0; Vector VStack_ee8; Vector VStack_ee0; Vector VStack_ed8; Vector VStack_ed0; Vector VStack_ec8; Vector VStack_ec0; Vector VStack_eb8; Vector VStack_eb0; Vector VStack_ea8; Vector VStack_ea0; Vector VStack_e98; Vector VStack_e90; Vector VStack_e88; Vector VStack_e80; Vector VStack_e78; Vector aVStack_e70 [3]; Vector VStack_e58; Vector VStack_e50; Vector VStack_e48; Vector VStack_e40; Vector VStack_e38; Vector VStack_e30; Vector VStack_e28; Vector VStack_e20; Vector VStack_e18; Vector aVStack_e10 [2]; Vector VStack_e00; Vector VStack_df8; Vector aVStack_df0 [3]; Vector VStack_dd8; Vector VStack_dd0; Vector VStack_dc8; Vector VStack_dc0; Vector aVStack_db8 [2]; Vector VStack_da8; Vector aVStack_da0 [2]; Vector VStack_d90; Vector VStack_d88; Vector VStack_d80; Vector VStack_d78; Vector VStack_d70; Vector VStack_d68; Vector VStack_d60; Vector VStack_d58; Vector VStack_d50; Vector VStack_d48; Vector VStack_d40; Vector VStack_d38; Vector VStack_d30; Vector VStack_d28; Vector VStack_d20; Vector VStack_d18; Vector VStack_d10; Vector VStack_d08; Vector aVStack_d00 [3]; Vector VStack_ce8; Vector VStack_ce0; Entity_Player *queuedItemConfig; int iStack_cd4; undefined4 uStack_cd0; undefined4 uStack_ccc; Entity_Player *pEStack_cc8; undefined1 larynxEffect [8]; std_vector *psStack_cbc; undefined1 secretsEffect [8]; undefined4 uStack_cac; Vector aVStack_ca4 [2]; undefined1 auStack_c90 [4]; undefined1 auStack_c8c [4]; undefined1 auStack_c88 [4]; undefined1 auStack_c84 [4]; Vector chainPos2; Vector VStack_c78; Vector VStack_c70; Vector VStack_c68; Vector VStack_c60; Vector VStack_c58; Vector VStack_c50; Vector VStack_c48; Vector VStack_c40; Vector VStack_c38; Vector VStack_c30; Vector VStack_c28; undefined1 auStack_c20 [4]; Vector VStack_c1c; Vector VStack_c14; Vector VStack_c0c; Vector VStack_c04; undefined1 auStack_bfc [8]; undefined1 auStack_bf4 [4]; undefined1 auStack_bf0 [8]; undefined1 auStack_be8 [4]; undefined1 megaMushEffect [8]; undefined4 uStack_bdc; undefined1 peelerEffect [8]; undefined4 uStack_bc8; undefined1 auStack_bc0 [4]; undefined1 auStack_bbc [12]; undefined1 auStack_bb0 [4]; EntityList_EL spindownCollectibles; EntityList_EL eternalWisps; EntityList_EL spindownWisps; EntityList_EL flipCollectibles; EntityList_EL eternalCollectibles; EntityList_EL planCWisps; EntityList_EL boneOrbitals; EntityList_EL friendsWisps; EntityList_EL placeboFamiliars; EntityList_EL diplopiaPickups; EntityList_EL diplopiaWisps; EntityList_EL flushEntities; EntityList_EL d4Wisps; EntityList_EL d100Wisps; EntityList_EL shovelEffects; EntityList_EL cleaverWisps; EntityList_EL nearbyEntities; EntityList_EL d1Pickups; EntityList_EL d8Wisps; EntityList_EL razorEffects; Vector VStack_a6c; undefined4 uStack_a64; undefined4 uStack_a60; Vector VStack_a5c; Vector VStack_a54; Vector VStack_a4c; Vector VStack_a44; Vector VStack_a3c; Vector chainPos; Vector chainMidpoint; Vector chainDir; Vector VStack_a1c; Vector VStack_a14; Vector VStack_a0c; Vector skinSpawnPos; Vector VStack_9fc; Vector VStack_9f4; Vector VStack_9ec; Vector voidSpawnPos; EntityList_EL isaacsTearsWisps; undefined1 auStack_9cc [12]; EntityList_EL d20Pickups; float fStack_9b0; undefined4 uStack_9ac; int iStack_9a8; undefined4 uStack_9a4; undefined4 uStack_9a0; int iStack_99c; Entity_Player *pEStack_998; float fStack_994; float fStack_990; undefined4 uStack_98c; int iStack_988; undefined4 uStack_984; float fStack_97c; float fStack_978; float fStack_974; undefined4 uStack_970; float fStack_96c; float fStack_968; float fStack_964; float fStack_960; float fStack_95c; undefined4 uStack_958; undefined4 uStack_954; float jumpStepLength; float jumpLookahead; undefined4 uStack_948; int iStack_944; float fStack_940; float fStack_93c; Entity_Player *pEStack_938; int iStack_934; uint uStack_930; undefined4 uStack_92c; uint uStack_928; undefined4 uStack_924; float fStack_920; float fStack_91c; EntityList_EL detonatorTears; undefined4 shearsEffect; undefined4 uStack_904; undefined4 uStack_900; undefined4 uStack_8fc; float fStack_8f8; float fStack_8f4; undefined1 auStack_8f0 [12]; undefined1 auStack_8e4 [12]; undefined1 auStack_8d8 [12]; undefined1 auStack_8cc [12]; undefined1 auStack_8c0 [12]; short sStack_8b4; short sStack_8b2; short sStack_8b0; short sStack_8ae; short sStack_8ac; short sStack_8aa; short sStack_8a8; short sStack_8a6; short sStack_8a4; short sStack_8a2; short sStack_8a0; short sStack_89e; short sStack_89c; short sStack_89a; Vector VStack_898; Vector VStack_890; Vector razorSpawnPos; Vector d12GridPos; short sStack_878; short sStack_876; short sStack_874; short sStack_872; short sStack_870; undefined1 local_86e [2]; WeightedOutcomePicker batterySubtypePicker [3]; uint isAddCostume; int isEffectCostume; float fStack_858; float fStack_854; float afStack_850 [3]; float fStack_844; float fStack_840; int iStack_83c; undefined4 uStack_838; undefined4 uStack_834; int iStack_830; undefined4 uStack_82c; undefined4 uStack_828; char acStack_820 [4]; float fStack_81c; float fStack_818; Entity_Player *pEStack_814; uint uStack_810; char acStack_80c [4]; undefined1 *puStack_808; float fStack_804; float fStack_800; float fStack_7fc; float fStack_7f8; float fStack_7f4; float afStack_7f0 [2]; undefined4 uStack_7e8; int iStack_7e4; Entity_Familiar *pEStack_7e0; Entity_Familiar *pEStack_7dc; undefined4 uStack_7d8; int iStack_7d4; undefined4 uStack_7d0; Entity_Pickup *pEStack_7cc; Entity_Pickup *couponPickup; undefined4 uStack_7c4; int iStack_7c0; float fStack_7bc; float fStack_7b8; float fStack_7b4; float fStack_7b0; undefined1 auStack_7ac [20]; EntityList_EL dataminerCollectibles; EntityList_EL pennyPickups; WeightedOutcomePicker secretsPicker [3]; undefined1 auStack_76c [12]; undefined1 auStack_760 [12]; undefined1 auStack_754 [24]; undefined1 auStack_73c [8]; undefined1 auStack_734 [16]; undefined1 auStack_724 [8]; undefined1 auStack_71c [8]; Entity_Projectile *chainedProjectile; ushort *resultOut; undefined1 auStack_708 [12]; undefined1 auStack_6fc [12]; Entity_Player *pEStack_6f0; Vector boneSpawnPos; void *apvStack_6e0 [8]; Entity_Pickup *d1Pickup; int d12GridVariant; undefined1 auStack_6b4 [12]; WeightedOutcomePicker heartSubtypePicker [3]; Entity *boneOrbital2; Vector giftSpawnPos; WeightedOutcomePicker keepersBoxPicker [3]; Vector jumpStep; Vector sinSpawnPos; Entity *boneOrbital; void *pvStack_670; Entity *devolveTarget; Entity_Pickup *voidPickup; Vector digPos; Vector jumpTarget; Entity *chainTargetPartner; int d12GridType; undefined1 auStack_648 [4]; undefined1 auStack_644 [8]; WeightedOutcomePicker lemegetonPicker [3]; undefined1 auStack_630 [4]; Entity_Player *local_62c; void *pvStack_628; Entity_Pickup *boxPickup; Entity *chainTarget; int slot; uint flags; Entity_Pickup *pEStack_614; void *local_610; char isAddTempEffect; byte local_609; Vector VStack_608; Entity_Player *local_600; undefined2 useResult; Entity_Player *local_5f8; int itemId; Entity_Player *local_5f0; Entity_Player *local_5ec; void *isShowAnim; Entity_Player *local_5e4; Entity_Player *local_5e0; byte local_5d9; Color aCStack_5d8 [4]; Color aCStack_528 [3]; Color CStack_4a4; Color CStack_478; Color aCStack_44c [2]; Color aCStack_3f4 [6]; BitSet128 aBStack_2e0 [3]; char acStack_2ac [24]; std_string sStack_294; std_string sStack_27c; RNG RStack_264; RNG RStack_254; RNG aRStack_244 [3]; RNG manualRng; RNG virtuesWispRng; RNG metronomeRng; RNG rerollRng; RNG shovelRng; RNG voidRng; RNG deadRng2; RNG d12Rng; RNG deadRng; void *friendTypes; uint friendVariants; void *pvStack_170; void *pvStack_16c; void *pvStack_168; void *pvStack_164; void *pvStack_160; void *pvStack_15c; void *pvStack_158; void *pvStack_154; undefined1 *puStack_150; void *pvStack_14c; undefined1 *puStack_148; void *pvStack_144; undefined1 *puStack_140; void *pvStack_13c; undefined1 *puStack_138; void *pvStack_134; void *pvStack_130; void *pvStack_12c; void *pvStack_128; void *pvStack_124; void *pvStack_120; void *pvStack_11c; void *pvStack_118; void *pvStack_114; void *pvStack_110; void *pvStack_10c; void *pvStack_108; void *pvStack_104; void *pvStack_100; void *pvStack_fc; void *pvStack_f8; void *pvStack_f4; undefined1 *puStack_f0; void *pvStack_ec; undefined1 *puStack_e8; void *pvStack_e4; undefined1 *puStack_e0; void *pvStack_dc; void *pvStack_d8; void *pvStack_d4; void *blueBoxPools [5]; undefined1 *puStack_bc; undefined1 *puStack_b8; void *pvStack_b4; void *pvStack_b0; undefined1 *puStack_ac; Vector aVStack_8c [4]; int *piStack_6c; int *piStack_68; int *piStack_64; int *piStack_60; int *piStack_5c; int *piStack_58; int *piStack_54; int *piStack_50; int *piStack_4c; int *piStack_48; int *piStack_44; int *piStack_40; int *piStack_3c; int *piStack_38; int *piStack_34; int *piStack_30; int *piStack_2c; int *piStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float fStack_14; puStack_20 = (undefined1 *)(aVStack_8c + 0x11); fStack_14 = -NAN; puStack_18 = &LAB_00af5d53; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&aVStack_8c[0xf].y; ExceptionList = &local_1c; flags = useFlags; local_5ec = (void *)0x0; local_62c = (Entity_Player *)collectible; resultOut = (ushort *)resultFlags; slot = activeSlot; local_5f0 = (Entity_Player *)0x0; useResult = 1; if ((collectible == 0) || (3 < activeSlot)) { LAB_005c72f6: *resultFlags = useResult; ExceptionList = local_1c; return; } local_5e0 = this; pEVar8 = (Entity_Player *)GetCollectibleRNG(this,collectible); pEVar10 = local_5e0; fVar31 = 8.378051e-39; fVar32 = (float)collectible; pEVar34 = local_5e0; pEVar37 = (Entity_Player *)flags; bVar5 = LuaEngine::PreUseItem(g_luaEngine,collectible,(RNG *)pEVar8,local_5e0,flags,slot,varData); if (bVar5 != 0) { resultFlags = (short *)resultOut; goto LAB_005c72f6; } local_609 = ~(byte)flags & 1; local_5e4 = (Entity_Player *)(flags >> 3 & 0xffffff01); isAddCostume = CONCAT31((uint3)(flags >> 9),~(byte)(flags >> 1)) & 0xffffff01; isEffectCostume = CONCAT31(isEffectCostume._1_3_,(char)isAddCostume); local_5f8 = (Entity_Player *)(flags & 0x44); if ((pEVar10->_variant == 0) && (pEVar10->field_0x1826 == '\0')) { uVar26 = 0; iVar9 = Game::GetNumPlayers(g_game); if (iVar9 != 0) { do { pEVar10 = Game::GetPlayer(g_game,uVar26); iVar9 = Entity::Variant((Entity *)pEVar10); if (iVar9 == 1) { pEVar37 = (Entity_Player *)0x0; pEVar8 = (Entity_Player *)local_86e; fVar32 = 8.37829e-39; pEVar34 = local_62c; UseActiveItem(pEVar10,(short *)pEVar8,(int)local_62c,0,-1,0); } uVar26 = uVar26 + 1; uVar11 = Game::GetNumPlayers(g_game); } while (uVar26 < uVar11); collectible = (int)local_62c; } } pEVar10 = (Entity_Player *)0x22; if ((Entity_Player *)collectible != (Entity_Player *)&DAT_0000003b) { pEVar10 = (Entity_Player *)collectible; } itemId = (int)pEVar10; itemConfigDb = Isaac::GetItemConfig(); local_62c = (Entity_Player *)ItemConfig::GetCollectible(itemConfigDb,(int)pEVar10); iVar9 = itemId; isAddTempEffect = '\x01'; isShowAnim = (void *)0x0; if (local_5e0->_variant == 0) { isShowAnim = (void *)(uint)local_609; } if (((char)isShowAnim == '\0') && ((flags & 0x200) == 0)) { uVar6 = 0; } else { uVar6 = 1; } local_610 = (void *)CONCAT31(local_610._1_3_,uVar6); if (itemId < 0) { if ((char)isShowAnim != '\0') { AnimateCollectible(local_5e0,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } FUN_004074a0(); playerPos = &local_5e0->_pos; pEVar34 = (Entity_Player *)0x0; fVar31 = 8.378593e-39; fVar32 = (float)iVar9; pEVar8 = local_5e0; pEVar37 = local_5e0; local_5ec = (Entity_Player *)playerPos; glitched_item_effects_run(); } else { playerPos = &local_5e0->_pos; local_5ec = (Entity_Player *)playerPos; } local_600 = (Entity_Player *)0x3f800000; if ((char)isShowAnim != '\0') { pEVar37 = (Entity_Player *)0x2; pEVar34 = (Entity_Player *)0x3f9; pEVar8 = (Entity_Player *)0x5b3c69; SoundEffects::PlayWithFartOverride(0x3f9,1.0,2,0,1.0); } curPlayer = local_5e0; pvVar24 = ThreadLocalStoragePointer; pGVar21 = g_game; pEVar10 = (Entity_Player *)0x3f800000; bVar5 = (byte)isShowAnim; if (iVar9 < 0x11b) { if (iVar9 == 0x11a) { if (local_5e0->_variant == 0) { jumpLookahead = 60.0; local_600 = (Entity_Player *)&local_5e0->_velocity; tmpVec = Vector::__mul((Vector *)local_600,&local_1180,&jumpLookahead); Vector::__add(playerPos,&jumpTarget,tmpVec); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::GetClampedPosition(room,&local_1188,&jumpTarget,20.0); Vector::operator_assign(&jumpTarget,tmpVec); Vector::__sub(playerPos,&jumpStep,&jumpTarget); local_5f0 = (Entity_Player *)Vector::LengthSquared(&jumpStep); local_5d9 = '\0'; Vector::Normalize(&jumpStep); jumpStepLength = 10.0; Vector::operator_mul_assign(&jumpStep,&jumpStepLength); Level::GetCurrentRoom((Level *)g_game); local_5e4 = (Entity_Player *)Room::GetEntities(); if (0.0 < (float)local_5f0) { do { if (local_5d9 != '\0') break; pEVar8 = local_5f0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); pos.y = jumpTarget.y; pos.x = jumpTarget.x; iVar9 = Room::GetGridCollisionAtPos(room,pos); if (iVar9 == 0) { local_5d9 = '\x01'; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); local_5e4 = (Entity_Player *)*puVar15; bVar5 = Entity::IsEnemy((Entity *)local_5e4); if (bVar5 != 0) { FUN_00417340(); local_5f8 = (Entity_Player *)((float)pEVar8 + local_5e0->_size + 5.0); tmpVec = Entity::Position((Entity *)local_5e4,&local_1190); tmpVec = Vector::__sub(tmpVec,&local_1198,&jumpTarget); local_5e4 = (Entity_Player *)Vector::LengthSquared(tmpVec); pEVar8 = (Entity_Player *)((float)local_5f8 * (float)local_5f8); if ((float)local_5e4 < (float)pEVar8) { Vector::operator_add_assign(&jumpTarget,&jumpStep); fVar32 = Vector::LengthSquared(&jumpStep); local_5f0 = (Entity_Player *)((float)local_5f0 - fVar32); local_5d9 = '\0'; } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::GetClampedPosition(room,&local_11a0,&jumpTarget,20.0); Vector::operator_assign(&local_5e0->_targetPosition,tmpVec); Vector::operator_assign((Vector *)local_600,&g_vectorZero); local_5e0->_entityCollisionClass = 0; local_5e0->_entityGridCollisionClass = 0; } else { Vector::operator_add_assign(&jumpTarget,&jumpStep); fVar32 = Vector::LengthSquared(&jumpStep); local_5f0 = (Entity_Player *)((float)local_5f0 - fVar32); } } while (0.0 < (float)local_5f0); playerPos = (Vector *)local_5ec; } if ((float)local_5f0 <= 0.0) { Vector::operator_assign(&local_5e0->_targetPosition,playerPos); } SoundEffects::PlayWithFartOverride(0x41f,1.0,2,0,1.0); if (local_5e0->_canFly == 0) { PlayExtraAnimation(local_5e0,s_Jump); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } } goto LAB_005b3e24; } switch(iVar9) { case 0x21: SoundEffects::PlayWithFartOverride(8,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x40e,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); local_5e4 = (Entity_Player *)Room::GetEntities(); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar15; iVar9 = Entity::Type(tmpEntity); if ((iVar9 == 0x2d) || (iVar9 = Entity::Type(tmpEntity), iVar9 == 0x4e)) { pcVar3 = *(code **)(*(int *)tmpEntity + 0x24); EntityRef::constructor(&EStack_1630,(Entity *)local_5e0); (*pcVar3)(); persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentData,0x1b); break; } iVar9 = Entity::Type(tmpEntity); if (iVar9 == 0x54) { EntityRef::constructor(&EStack_1770,tmpEntity); EntityRef::operator_(&local_5e0->_lastDamageSource,&EStack_1770); pcVar3 = *(code **)(*(int *)local_5e0 + 0x24); EntityRef::constructor(&EStack_1608,(Entity *)local_5e0); (*pcVar3)(); break; } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } goto LAB_005b40d0; case 0x22: SoundEffects::PlayWithFartOverride(0x22,1.0,2,0,1.0); bVar5 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e2a; case 0x23: if ((local_5e0->_variant == 0) || ((char)local_5e4 != '\0')) { local_5ec = (Entity_Player *)0x42200000; local_5e4 = local_5ec; Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { local_5ec = (Entity_Player *)0x41a00000; local_5e4 = (Entity_Player *)0x41200000; } iVar9 = GetCollectibleNum(local_5e0,0x106,0); iVar25 = GetTrinketMultiplier(local_5e0,0x30); local_600 = (Entity_Player *)((float)(iVar9 + iVar25) * (float)local_5e4 + (float)local_5ec) ; SoundEffects::PlayWithFartOverride(0x21,1.0,2,0,1.0); Game::ShakeScreen(g_game,0xf); poofColor = (ColorMod *)::Color::Color(); Entity::MakeGroundPoofAtSelf((Entity *)local_5e0,poofColor,1.0); Level::GetCurrentRoom((Level *)g_game); local_5f8 = (Entity_Player *)Room::GetEntities(); local_5f0 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5ec = pEVar8; bVar5 = Entity::IsEnemy((Entity *)pEVar8); if ((((bVar5 != 0) && (pEVar8 != local_5e0)) && (bVar5 = Entity::HasEntityFlags((Entity *)pEVar8,0x10), bVar5 == 0)) && ((cVar7 = Entity::IsInvincible((Entity *)pEVar8), cVar7 == '\0' && (bVar5 = Entity::HasEntityFlags((Entity *)pEVar8,0x20000000), bVar5 == 0)))) { pcVar3 = *(code **)(*(int *)pEVar8 + 0x20); EntityRef::constructor(&EStack_1658,(Entity *)local_5e0); (*pcVar3)(); bVar5 = HasCollectible(local_5e0,0x1b2,0); if (bVar5 != 0) { Entity::AddEntityFlags((Entity *)pEVar8,0x10000000); } fVar32 = 0.2; ::Color::Color(); uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar8,&VStack_1080); tmpEntity = Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar8,&VStack_1088); tmpEntity = Game::Spawn(g_game,1000,2,tmpVec,&g_vectorZero,(Entity *)0x0,3,uVar26); (**(code **)(*(int *)tmpEntity + 0x3c))(); sprite = (Sprite *)Entity::GetSprite(tmpEntity); spriteColor = (Color *)Sprite::Color(sprite); ::Color::SetTint(spriteColor,0.2,0.2,0.2,1.0); uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar8,&VStack_1090); tmpEntity = Game::Spawn(g_game,1000,7,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); iVar9 = Isaac::Random(5); local_5e4 = (Entity_Player *)(iVar9 + 3); if (0 < (int)local_5e4) { do { tmpVec = Entity::Position((Entity *)pEVar8,&VStack_1098); tmpVec2 = MusicManager::RandomVector(&VStack_10a0); fStack_8f4 = 0.5; tmpVec2 = Vector::operator_mul(&VStack_10a8,&fStack_8f4,tmpVec2); FUN_00417340(); fStack_8f8 = fVar32; tmpVec2 = Vector::__mul(tmpVec2,&VStack_10b0,&fStack_8f8); Vector::__add(tmpVec,&VStack_c0c,tmpVec2); tmpVec = MusicManager::RandomVector(&VStack_10b8); fVar32 = random_float(); fVar32 = fVar32 * 4.0 + 2.0; fStack_91c = fVar32; Vector::operator_mul(&VStack_c04,&fStack_91c,tmpVec); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,5,&VStack_c0c,&VStack_c04,(Entity *)0x0,0, uVar26); (**(code **)(*(int *)tmpEntity + 0x3c))(); ::Color::assign(); (**(code **)(*(int *)tmpEntity + 0xc))(); local_5e4 = (Entity_Player *)((int)&local_5e4[-1]._replacedPlayer + 3); pEVar8 = local_5ec; } while (local_5e4 != (Entity_Player *)0x0); } } puVar27 = &local_5f0->field_0x1; local_5f0 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } bVar5 = HasPlayerForm(local_5e0,0xf); iVar9 = slot; curPlayer = local_5e0; if ((bVar5 != 0) && (local_5e0->_activeDesc[slot]._varData == 1)) { useResult = useResult & 0xff00; AddActiveCharge(local_5e0,-1,slot,0,0,0); iVar12 = GetActiveItem(local_5e0,iVar9); pGVar21 = g_game; iVar25 = iVar9; if (iVar12 < 1) { local_5e0->_activeDesc[iVar9]._varData = 0; hud = (HUD *)Game::GetHUD(pGVar21); HUD::InvalidateActiveItem(hud); iVar25 = slot; } active_used_post(local_5e0,iVar25,0,local_5e0->_activeDesc[iVar9]._charge + 1); goto LAB_005b46cc; } goto switchD_005b5899_default; } break; case 0x24: room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar8 = (Entity_Player *)Room::GetGridIndex(room,playerPos); local_5f8 = pEVar8; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_5e4 = (Entity_Player *)Room::GetGridEntity(room,(uint)pEVar8); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); if (bVar5 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar26 = Room::GetGridCollision(room,(int)pEVar8); if (uVar26 == 0) { if (local_5e4 != (Entity_Player *)0x0) { GridEntity::GetType(); cVar7 = is_grid_type_floor_special(); if (cVar7 != '\0') goto LAB_005b4907; } local_5f0 = (Entity_Player *)GetCollectibleRNG(local_5e0,0x24); pEVar8 = (Entity_Player *)0x0; local_5ec = (Entity_Player *)0x0; bVar5 = HasCollectible(local_5e0,0x21f,0); if (bVar5 == 0) { tempEffects = (TemporaryEffects *)GetEffects(local_5e0); bVar5 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x21f); if (bVar5 != 0) goto LAB_005b47e2; } else { LAB_005b47e2: pEVar8 = (Entity_Player *)&DAT_00000006; local_5ec = (Entity_Player *)&DAT_00000006; } bVar5 = HasTrinket(local_5e0,0x5b,0); if (bVar5 != 0) { local_5e4 = (Entity_Player *)0x21; iVar9 = GetTrinketMultiplier(local_5e0,0x5b); if (iVar9 == 2) { local_5e4 = (Entity_Player *)0x42; } else if (iVar9 == 3) { local_5e4 = (Entity_Player *)0x64; } rngPtr = (RNG *)FUN_005cbd00(); pEVar10 = (Entity_Player *)RNG::RandomInt(rngPtr,100); if (pEVar10 < local_5e4) { pEVar8 = (Entity_Player *)&DAT_00000005; } local_5ec = pEVar8; } bVar5 = HasCollectible(local_5e0,0xca,0); if (bVar5 != 0) { uVar26 = RNG::RandomInt((RNG *)local_5f0,100); if ((int)(uVar26 - (int)(local_5e0->_luck * 10.0)) < 0x22) { pEVar8 = (Entity_Player *)0x3; } local_5ec = pEVar8; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar26 = RNG::Next((RNG *)local_5f0); Room::SpawnGridEntity(room,(int)local_5f8,0xe,(uint)local_5ec,uVar26,0); Game::ButterBeanFart(g_game,playerPos,120.0,(Entity *)local_5e0,0,0); } } LAB_005b4907: SoundEffects::PlayWithFartOverride(0x25,1.0,2,0,1.0); ShootCandle(local_5e0,&g_vectorZero); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; case 0x25: uVar26 = Random(); Game::Spawn(g_game,4,1,playerPos,&g_vectorZero,(Entity *)local_5e0,0,uVar26); tear = (Entity_Tear *)__RTDynamicCast(); if (tear != (Entity_Tear *)0x0) { GetBombFlags(local_5e0,&BStack_13e8,0); FUN_006a6910(); FUN_006a6930(); fVar30 = (float10)Entity_Tear::FallingAcceleration(tear); Entity_Projectile::set_falling_accel ((Entity_Projectile *)tear,(float)(fVar30 + (float10)85.0)); } sfxManager = MusicManager::SFXManager(); SoundEffects::Play(sfxManager,0x28,1.0,4,0,1.0,0.0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; case 0x26: local_5f0 = (Entity_Player *)random_float(); if (varData != 0) { local_600 = (Entity_Player *)((float)varData / 100.0); } if (local_5e0->_megaBlastLaser == (void *)0x0) { bVar5 = HasWeaponType(local_5e0,5); if (bVar5 == 0) { bVar5 = HasWeaponType(local_5e0,2); if (bVar5 == 0) { local_600 = (Entity_Player *)((float)local_600 * 25.0); local_5ec = local_600; bVar5 = HasWeaponType(local_5e0,3); if (bVar5 == 0) { local_5ec = local_600; bVar5 = HasWeaponType(local_5e0,4); if (bVar5 == 0) { local_600 = (Entity_Player *)&local_5e0->_pos; local_5e4 = (void *)0x0; do { pEVar8 = local_600; tmpVec = Vector::FromAngle(&VStack_10f8, ((float)(int)local_5e4 / 10.0 + (float)local_5f0) * 360.0); tmpVec = Vector::Resized(tmpVec,&VStack_1100,10.0); tear = FireTear(local_5e0,(Vector *)pEVar8,*tmpVec,6,(Entity *)0x0,1.0); fVar30 = (float10)Entity_Tear::Scale(tear); Entity_Tear::SetScale(tear,(float)(fVar30 * (float10)1.355)); pcVar3 = *(code **)(*(int *)tear + 0x40); fVar30 = (float10)Entity::CollisionDamage((Entity *)tear); local_5f8 = (Entity_Player *)(float)(fVar30 + (float10)(float)local_5ec); (*pcVar3)(); local_5e4 = (Entity_Player *)((int)local_5e4 + 1); } while ((int)local_5e4 < 10); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; } else { local_5f0 = (Entity_Player *)((float)local_5f0 * 360.0); local_5e4 = (void *)0x0; do { pEVar8 = local_5e4; tammyKnife = FireKnife(local_5e0,(Entity *)local_5e0,0,0.0,0,1); normalize_angle_degrees((float)(int)pEVar8 * 36.0 + (float)local_5f0); FUN_005b15d0(); pcVar3 = *(code **)(*(int *)tammyKnife + 0x40); fVar30 = (float10)Entity::CollisionDamage((Entity *)tammyKnife); local_5f8 = (Entity_Player *)(float)(fVar30 + (float10)(float)local_5ec); (*pcVar3)(); fVar30 = (float10)Entity_Knife::Rotation(tammyKnife); tmpVec = Vector::FromAngle(&VStack_10f0,(float)fVar30); Entity_Knife::InitHomingPath(tammyKnife,*tmpVec,(Entity *)local_5e0,0.0); (**(code **)(*(int *)tammyKnife + 0xc))(); local_5e4 = (Entity_Player *)((int)local_5e4 + 1); } while ((int)local_5e4 < 10); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; } } else { local_600 = (Entity_Player *)&local_5e0->_pos; local_5e4 = (void *)0x0; do { pEVar8 = local_600; fVar32 = 1.0; tmpEntity = (Entity *)0x0; bVar36 = 1; bVar5 = 1; tmpVec = Vector::FromAngle(&VStack_10e0, ((float)(int)local_5e4 / 10.0 + (float)local_5f0) * 360.0 ); tammyLaser = FireTechLaser(local_5e0,(Vector *)pEVar8,0,tmpVec,bVar5,bVar36, tmpEntity,fVar32); pcVar3 = *(code **)(*(int *)tammyLaser + 0x40); fVar30 = (float10)Entity::CollisionDamage((Entity *)tammyLaser); local_5f8 = (Entity_Player *)(float)(fVar30 + (float10)(float)local_5ec); (*pcVar3)(); iVar9 = Entity::PositionOffset((Entity *)tammyLaser); tmpVec = Vector::Vector(&VStack_10e8,0.0,*(float *)(iVar9 + 4)); Entity::SetPositionOffset((Entity *)tammyLaser,tmpVec); (**(code **)(*(int *)tammyLaser + 0xc))(); local_5e4 = (Entity_Player *)((int)local_5e4 + 1); } while ((int)local_5e4 < 10); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; } } else { local_5ec = (Entity_Player *)((float)local_600 * 3.5); local_5e4 = (void *)0x0; do { Vector::FromAngle(&VStack_10d8, ((float)(int)local_5e4 / 10.0 + (float)local_5f0) * 360.0); tmpEntity = (Entity *)FireBrimstone(local_5e0); pcVar3 = *(code **)(*(int *)tmpEntity + 0x40); fVar30 = (float10)Entity::CollisionDamage(tmpEntity); local_5f8 = (Entity_Player *)(float)(fVar30 + (float10)(float)local_5ec); (*pcVar3)(); (**(code **)(*(int *)tmpEntity + 0xc))(); local_5e4 = (Entity_Player *)((int)local_5e4 + 1); } while ((int)local_5e4 < 10); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; } } else { iVar9 = 0; local_5e4 = (Entity_Player *)((float)local_600 * 35.0); local_5ec = (Entity_Player *)&local_5e0->_pos; do { pEVar8 = local_5ec; tmpVec = Vector::FromAngle(&VStack_10c8,((float)iVar9 / 10.0 + (float)local_5f0) * 360.0 ); tmpEntity = (Entity *)0x0; tmpVec = Vector::Resized(tmpVec,&VStack_10d0,10.0); tammyBomb = FireBomb(local_5e0,(Vector *)pEVar8,tmpVec,tmpEntity); fVar30 = (float10)Entity_Tear::FallingAcceleration((Entity_Tear *)tammyBomb); Entity_Projectile::set_falling_accel ((Entity_Projectile *)tammyBomb,(float)(fVar30 + (float10)(float)local_5e4)); (**(code **)(*(int *)tammyBomb + 0xc))(); iVar9 = iVar9 + 1; } while (iVar9 < 10); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; } } else { pEVar8 = (Entity_Player *)&DAT_00000006; bVar5 = HasCollectible(local_5e0,0x44,0); local_600 = (Entity_Player *)((float)local_600 * 3.5); if (bVar5 != 0) { pEVar8 = (Entity_Player *)&DAT_0000000f; } iVar9 = 0; local_5e4 = (Entity_Player *)&local_5e0->_pos; local_5ec = (Entity_Player *)&local_5e0->_laserColor; local_5f8 = pEVar8; do { pEVar8 = local_5f8; bVar5 = 0; pEVar10 = local_5e0; tmpVec = Vector::Vector(&VStack_10c0,0.0,-30.0); tammyLaser = Entity_Laser::ShootAngle ((int)pEVar8,(Vector *)local_5e4, ((float)iVar9 / 10.0 + (float)local_5f0) * 360.0,0x1e,tmpVec, (Entity *)pEVar10,bVar5); Isaac::Random(2); GetTearHitParams(); (**(code **)(*(int *)tammyLaser + 0x40))(); Entity_Laser::set_disable_init_sound(tammyLaser); tearFlags = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,&BStack_13d8); BitSet128::operator_and(&BStack_13b8,aBStack_2e0,tearFlags); FUN_00456830(); (**(code **)(*(int *)tammyLaser + 0x3c))(); (**(code **)(*(int *)tammyLaser + 0xc))(); iVar9 = iVar9 + 1; } while (iVar9 < 10); Game::ShakeScreen(g_game,0xf); local_5d9 = 0; curPlayer = local_5e0; } goto LAB_005b54d1; case 0x27: SoundEffects::PlayWithFartOverride(0x40b,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); local_5ec = (Entity_Player *)Room::GetEntities(); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5e4 = pEVar8; bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0); if ((bVar5 != 0) && (pEVar8 != local_5e0)) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x27); iVar9 = itemConfig->maxCooldown; EntityRef::constructor(&EStack_16a8,(Entity *)local_5e0); Entity::AddFreeze((Entity *)local_5e4,&EStack_16a8,iVar9,0); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } goto LAB_005b40d0; case 0x28: if (local_5e0->_variant == 0) { ::Color::Color(&CStack_4a4); tearFlags = GetBombFlags(local_5e0,&BStack_1418,0); Game::BombExplosionEffects (g_game,playerPos,185.0,*tearFlags,Color,(Entity *)local_5e0,1.0,0,0x50000004,1); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e24; case 0x29: SoundEffects::PlayWithFartOverride(0x40b,1.0,2,0,1.0); curPlayer = local_5e0; if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); local_5e4 = (Entity_Player *)Room::GetEntities(); pEVar8 = (Entity_Player *)0x0; local_5f0 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); local_5e4 = (Entity_Player *)*puVar15; bVar5 = Entity::IsVulnerableEnemy((Entity *)local_5e4,(Entity *)0x0); if ((bVar5 != 0) && (local_5e4 != local_5e0)) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x27); iVar9 = itemConfig->maxCooldown; EntityRef::constructor(&EStack_1680,(Entity *)local_5e0); Entity::AddFear((Entity *)local_5e4,&EStack_1680,iVar9,0); pEVar8 = local_5f0; } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5f0 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); playerPos = (Vector *)local_5ec; } AddBlueFlies(local_5e0,1,playerPos,(Entity *)0x0); goto LAB_005b46cc; } break; case 0x2a: goto LAB_005b5445; default: goto LAB_005c71f1; case 0x2c: if (local_5e0->_variant == 0) { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); curPlayer = local_5e0; Game::MoveToRandomRoom(g_game,0,uVar26,local_5e0); local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e24; case 0x2d: if (local_5e0->_variant == 0) { iVar9 = 0x9d; if (local_5e0->_playerType == 0x16) { iVar9 = 0x266; } play_sound_with_fart_seed(iVar9,1.0,2,0,1.0); uVar26 = 0; iVar9 = Game::GetNumPlayers(g_game); if (iVar9 != 0) { do { pEVar8 = Game::GetPlayer(g_game,uVar26); AddHearts(pEVar8,(pEVar8 == curPlayer) + 1,0,0); uVar26 = uVar26 + 1; uVar11 = Game::GetNumPlayers(g_game); } while (uVar26 < uVar11); } goto switchD_005b5899_default; } break; case 0x2f: LAB_005b5445: SetItemState(local_5e0); pcVar38 = "LiftItem"; goto LAB_005b3eb3; case 0x31: SetItemState(local_5e0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; case 0x38: SoundEffects::PlayWithFartOverride(0x33,1.0,2,0,1.0); uVar26 = Random(); Game::Spawn(g_game,1000,0x20,&local_5e0->_pos,&g_vectorZero,(Entity *)local_5e0,0,uVar26); piVar14 = (int *)__RTDynamicCast(); (**(code **)(*piVar14 + 0xc))(); goto LAB_005b3e9f; case 0x3a: fVar32 = 1.43773e-42; goto LAB_005b3e91; case 0x41: fVar32 = 1.12104e-44; LAB_005b3e91: SoundEffects::PlayWithFartOverride((int)fVar32,1.0,2,0,1.0); goto LAB_005b3e9f; case 0x42: uVar33._0_1_ = 0xc5; uVar33._1_1_ = 0x3c; uVar33._2_2_ = 0x5b; SoundEffects::PlayWithFartOverride(0x40f,1.0,2,0,1.0); if ((char)isShowAnim != '\0') { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); fVar35 = 8.378916e-39; TemporaryEffects::AddCollectibleEffect(tempEffects,iVar9,1,1); musicManager = (MusicManager *)MusicManager::MusicManager(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::time_scale_update(room); MusicManager::PitchSlide(musicManager); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,itemId); uVar26 = 0; local_5e4 = (Entity_Player *)itemConfig->maxCooldown; pvVar24 = (void *)Game::GetPlayerManager(g_game); iVar25 = std::vector::size(pvVar24); if (iVar25 != 0) { do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); pEVar8 = PlayerManager::GetPlayer(playerManager,uVar26); if ((pEVar8 != local_5e0) && (pEVar10 = (Entity_Player *)GetOtherTwin(local_5e0), pEVar8 != pEVar10)) { fVar39 = 8.379182e-39; EntityRef::constructor(&EStack_1748,(Entity *)local_5e0); bVar5 = 0; ::Color::Color(); color._tint[1] = in_stack_ffffe5f8; color._tint[0] = in_stack_ffffe5f4; color._tint[2] = in_stack_ffffe5fc; color._tint[3] = in_stack_ffffe600; color._colorize[0] = in_stack_ffffe604; color._colorize[1] = fVar31; color._colorize[2] = fVar32; color._colorize[3] = (float)uVar33; color._offset[0] = fVar35; color._offset[1] = (float)iVar9; color._offset[2] = fVar39; Entity::AddSlowing((Entity *)pEVar8,&EStack_1748,(int)local_5e4,0.9,color,bVar5); } uVar26 = uVar26 + 1; pvVar24 = (void *)Game::GetPlayerManager(g_game); uVar11 = std::vector::size(pvVar24); } while (uVar26 < uVar11); } } goto LAB_005b3e24; case 0x4e: if (local_5e0->_variant == 0) { AddSoulHearts(local_5e0,2,0); Config::GetCollectibles(); rngPtr = (RNG *)FUN_005cbd00(); RNG::Next(rngPtr); Level::ForceHorsemanBoss(); Game::SetStateFlag(); goto LAB_005b46cc; } break; case 0x53: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x77,1.0,2,0,1.0); AddBlackHearts(local_5e0,1); LAB_005b5414: curPlayer = local_5e0; } break; case 0x54: goto LAB_005b83e0; case 0x55: if (local_5e0->_variant != 0) goto LAB_005b3e24; bVar5 = HasCollectible(local_5e0,0xfc,0); curPlayer = local_5e0; if ((bVar5 == 0) || (bVar5 = HasCollectible(local_5e0,0xfb,0), bVar5 != 0)) { Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); RNG::Next(rngPtr); iVar9 = ItemPool::GetCard(); AddCard(); bVar5 = 0; if ((char)isShowAnim != '\0') { AnimateCard(curPlayer,iVar9,(byte *)"UseItem"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } } else { Game::GetItemPool(g_game); LAB_005b67ef: rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); iVar9 = ItemPool::GetPill(uVar26); AddPill(); bVar5 = 0; if ((char)isShowAnim != '\0') { AnimatePill(curPlayer,iVar9,(byte *)"UseItem"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } } goto LAB_005b3e2a; case 0x56: if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); local_5ec = (Entity_Player *)Room::GetEntities(); iVar9 = EntityList::Size(); curPlayer = local_5e0; if (iVar9 != 0) { local_5f8 = local_5e0; local_5e4 = (Entity_Player *)((uint)local_5e4 & 0xffffff00); local_5f0 = (Entity_Player *)0x1; uVar26 = EntityList::Size(); if (1 < uVar26) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; puVar15 = (undefined4 *)std::vector::operator_index(); if ((((Entity_Player *)*puVar15 != curPlayer) && (((bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0), bVar5 != 0 || (((bVar5 = Entity::IsEnemy((Entity *)pEVar8), bVar5 != 0 && (iVar9 = Entity::Type((Entity *)pEVar8), iVar9 != 0x21)) && ((char)local_5e4 == '\0')))) && (cVar7 = Entity::IsDead((Entity *)pEVar8), cVar7 == '\0')))) || (iVar9 = Entity::Type((Entity *)pEVar8), iVar9 == 1)) { fVar30 = (float10)Entity::HitPoints((Entity *)pEVar8); local_600 = (Entity_Player *)(float)fVar30; if (0.0 < (float)local_600) { local_5f8 = pEVar8; bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0); local_5e4 = (Entity_Player *)((uint)local_5e4 & 0xff); if (bVar5 != 0) { local_5e4 = (Entity_Player *)0x1; } } } puVar27 = &local_5f0->field_0x1; local_5f0 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } uVar26 = Random(); tmpVec = Entity::Position((Entity *)local_5f8,&VStack_1128); Game::Spawn(g_game,1000,0x1c,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); tmpEntity = (Entity *)__RTDynamicCast(); Entity::SetTarget(tmpEntity,(Entity *)local_5f8); (**(code **)(*(int *)tmpEntity + 0xc))(); goto LAB_005b8b6f; } } goto LAB_005b3e24; case 0x5d: goto LAB_005b83cf; case 0x61: if (local_5e0->_variant != 0) break; SoundEffects::PlayWithFartOverride(0x412,1.0,2,0,1.0); curPlayer = local_5e0; pEVar8 = (Entity_Player *)FUN_005cbd00(); local_5ec = pEVar8; local_5e4 = (Entity_Player *)RNG::RandomInt((RNG *)pEVar8,7); local_5f0 = (Entity_Player *)RNG::Next((RNG *)pEVar8); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&sinSpawnPos,&curPlayer->_pos,40.0,0,0,0); uVar26 = RNG::RandomInt((RNG *)pEVar8,6); local_5f8 = (Entity_Player *)(uVar26 + 1); bVar5 = HasTrinket(curPlayer,0x16,0); if (bVar5 == 0) { pEVar10 = local_5e4; } else { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,5); pEVar10 = local_5e4; if (uVar26 != 0) { pEVar10 = local_5f8; } } switch(pEVar10) { case (Entity_Player *)0x0: FUN_00424510(); fStack_14 = 2.8026e-45; persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,1,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,3,10,0); WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,6,10,0); WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,4,2,0); bVar36 = 1; iVar25 = 2; bVar5 = PersistentGameData::Unlocked(persistentData,0xe0); iVar9 = 1; if (bVar5 != 0) { iVar9 = 7; } WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,iVar9,iVar25,bVar36); bVar36 = 1; iVar25 = 2; bVar5 = PersistentGameData::Unlocked(persistentData,0x187); iVar9 = 1; if (bVar5 != 0) { iVar9 = 0xb; } WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,iVar9,iVar25,bVar36); bVar36 = 1; iVar25 = 4; bVar5 = PersistentGameData::Unlocked(persistentData,0x19b); iVar9 = 1; if (bVar5 != 0) { iVar9 = 0xc; } fVar32 = 8.389142e-39; WeightedOutcomePicker::AddOutcomeWeight(heartSubtypePicker,iVar9,iVar25,bVar36); iVar12 = 0x5b598f; uVar26 = RNG::Next((RNG *)local_5ec); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),(uint)local_5f0,0x23); rng._shift1 = iVar9; rng._seed = (int)fVar32; rng._shift2 = iVar25; rng._shift3 = iVar12; uVar11 = WeightedOutcomePicker::PickOutcome(heartSubtypePicker,rng); Game::Spawn(g_game,5,10,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,uVar11,uVar26); fStack_14 = -NAN; std::vector::_Tidy(); goto LAB_005b46cc; case (Entity_Player *)0x1: uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,0x28,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,1,uVar26); default: break; case (Entity_Player *)0x2: uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,0x1e,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,1,uVar26); break; case (Entity_Player *)0x3: uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,0x46,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,0,uVar26); break; case (Entity_Player *)0x4: uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,300,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,0,uVar26); break; case (Entity_Player *)0x5: uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,0x14,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,0,uVar26); break; case (Entity_Player *)0x6: FUN_00424510(); fStack_14 = 4.2039e-45; persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); WeightedOutcomePicker::AddOutcomeWeight(batterySubtypePicker,1,0x32,0); WeightedOutcomePicker::AddOutcomeWeight(batterySubtypePicker,3,1,0); bVar36 = 1; iVar25 = 1; bVar5 = PersistentGameData::Unlocked(persistentData,0x267); iVar9 = 1; if (bVar5 != 0) { iVar9 = 4; } fVar32 = 8.389746e-39; WeightedOutcomePicker::AddOutcomeWeight(batterySubtypePicker,iVar9,iVar25,bVar36); iVar12 = 0x5b5b3e; uVar26 = RNG::Next((RNG *)local_5ec); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),(uint)local_5f0,0x23); rng_00._shift1 = iVar9; rng_00._seed = (int)fVar32; rng_00._shift2 = iVar25; rng_00._shift3 = iVar12; uVar11 = WeightedOutcomePicker::PickOutcome(batterySubtypePicker,rng_00); Game::Spawn(g_game,5,0x5a,&sinSpawnPos,&g_vectorZero,(Entity *)curPlayer,uVar11,uVar26); fStack_14 = -NAN; std::vector::_Tidy(); LAB_005b46cc: curPlayer = local_5e0; } switchD_005b5899_default: iVar9 = itemId; break; case 0x66: if (local_5e0->_variant != 0) goto LAB_005b3e24; SoundEffects::PlayWithFartOverride(0x366,1.0,2,0,1.0); curPlayer = local_5e0; bVar5 = HasCollectible(local_5e0,0xfb,0); if ((bVar5 == 0) || (bVar5 = HasCollectible(curPlayer,0xfc,0), bVar5 != 0)) { Game::GetItemPool(g_game); goto LAB_005b67ef; } Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); RNG::Next(rngPtr); iVar9 = ItemPool::GetCard(); AddCard(); bVar5 = 0; if ((char)isShowAnim != '\0') { AnimateCard(curPlayer,iVar9,(byte *)"UseItem"); local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e2a; case 0x69: goto LAB_005b7f80; case 0x6b: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0xaf,3.0,2,0,1.0); tmpVec = (Vector *)FUN_0058e240(); fStack_93c = 2.0; Vector::__mul(tmpVec,&VStack_a3c,&fStack_93c); uVar26 = Random(); Game::Spawn(g_game,1000,2,playerPos,&VStack_a3c,(Entity *)0x0,3,uVar26); iVar9 = Isaac::Random(3); local_5ec = (Entity_Player *)(iVar9 + 2); iVar25 = Isaac::Random(6); local_5e4 = (Entity_Player *)0x0; local_5f0 = (Entity_Player *) ((((Entity_Player *)(iVar9 + 2))->_sprite)._filename._buf + iVar25 + -0x42); if (0 < (int)local_5f0) { do { fVar32 = random_float(); tmpVec = Vector::Rotated(&VStack_a3c,aVStack_1148,fVar32 * 20.0 - 10.0); fStack_940 = random_float(); Vector::__mul(tmpVec,&VStack_a44,&fStack_940); Vector::__add(playerPos,&VStack_c14,&VStack_a44); uVar26 = Random(); pEVar8 = local_5e4; uVar11 = 99; if ((int)local_5e4 < (int)local_5ec) { uVar11 = 0; } tmpEntity = Game::Spawn(g_game,1000,5,&VStack_c14,&VStack_a44,(Entity *)0x0,uVar11, uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); local_5e4 = (Entity_Player *)&pEVar8->field_0x1; } while ((int)local_5e4 < (int)local_5f0); } curPlayer = local_5e0; local_5e0->_cacheFlags = local_5e0->_cacheFlags | *(int *)((int)local_62c + 0x54); TemporaryEffect::TemporaryEffect(&shearsEffect,(ItemConfig_Item *)local_62c); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { uStack_900 = 0x1c2; } TemporaryEffects::AddEffect(&curPlayer->_temporaryeffects,&shearsEffect,1,1); EvaluateItems(); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x14); puVar15 = TemporaryEffect::TemporaryEffect(auStack_1428,itemConfig); shearsEffect = *puVar15; uStack_904 = puVar15[1]; uStack_900 = puVar15[2]; uStack_8fc = puVar15[3]; Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { uStack_900 = 0x1c2; } TemporaryEffects::AddEffect(&curPlayer->_temporaryeffects,&shearsEffect,1,1); isAddTempEffect = '\0'; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e24; case 0x6f: ::Color::Color(&CStack_478); curPlayer = local_5e0; Game::Fart(g_game,playerPos,85.0,(Entity *)local_5e0,1.0,0,poofColor); Game::ButterBeanFart(g_game,playerPos,120.0,(Entity *)curPlayer,0,0); goto switchD_005bfbd8_caseD_11d; case 0x7b: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0xf1,0.7,2,0,1.0); pEVar8 = local_5e0; local_5ec = (Entity_Player *)&DAT_00000008; local_5e4 = (Entity_Player *)&DAT_bf800000; rngPtr = (RNG *)FUN_005cbd00(); uVar11 = 7; uVar26 = RNG::Next(rngPtr); RNG::game_constructor(&manualRng,uVar26,uVar11); fStack_14 = 1.96182e-44; pEVar10 = (Entity_Player *)0x0; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); iVar9 = std::vector::size(pvVar24); if (iVar9 != 0) { do { cVar7 = FUN_0072fe80(); if (cVar7 != '\0') { local_5f0 = (Entity_Player *)RNG::RandomFloat(&manualRng); if ((float)local_5e4 < (float)local_5f0) { local_5ec = pEVar10; local_5e4 = local_5f0; } } pEVar10 = (Entity_Player *)&pEVar10->field_0x1; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); puVar13 = (undefined1 *)std::vector::size(pvVar24); } while (pEVar10 < puVar13); } uVar26 = std::vector::size(&pEVar8->_levelEffectItems); pEVar10 = local_5ec; if (uVar26 < 0x40) { TemporaryEffects::AddCollectibleEffect(&pEVar8->_temporaryeffects,(int)local_5ec,1,1); pEStack_938 = pEVar10; std::vector::push_back(); } fStack_14 = -NAN; guard_check_icall(); goto LAB_005b46cc; } break; case 0x7c: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x40a,1.0,2,0,1.0); curPlayer = local_5e0; if (local_5e0->_itemState == 0) { iVar9 = 0; local_5e4 = (Entity_Player *)0x26; local_5ec = (Entity_Player *)&local_5e0->_collectibleRNGs; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,0x20); pEVar8 = *(Entity_Player **)(&DAT_00b62f50 + uVar26 * 4); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 == '\0') { LAB_005b6056: local_5d9 = 0; } else { Game::GetField26614(g_game); piVar14 = (int *)EntityList::Size(); cVar7 = (**(code **)(*piVar14 + 0x30))(); local_5d9 = 1; if (cVar7 == '\0') goto LAB_005b6056; } iVar25 = Game::Challenge(g_game); if (((iVar25 != 0x2b) || (cVar7 = FUN_0072fe80(), cVar7 == '\0')) && (local_5d9 == 0)) { local_5e4 = pEVar8; break; } iVar9 = iVar9 + 1; } while (iVar9 < 10); Game::GetHUD(g_game); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,(int)local_5e4); localizedName = ItemConfig_Item::GetLocalizedName(itemConfig,&sStack_294,0x14); fStack_14 = 1.4013e-44; std::string::c_str(localizedName->_buf); curPlayer = local_5e0; PlayerHUD::show_pill_name(); fStack_14 = -NAN; std::string::_Tidy_deallocate(sStack_294._buf); UseActiveItem(curPlayer,&sStack_870,(int)local_5e4,1,-1,0); TriggerBookOfVirtues(); iVar9 = itemId; } } if ((char)isShowAnim == '\0') goto LAB_005b3e24; if ((curPlayer->_itemState == 0) || (curPlayer->_itemState == 0x31)) goto LAB_005b46e5; pcVar38 = "LiftItem"; goto LAB_005b46ef; case 0x7e: if (local_5e0->_variant == 0) { local_5e0->_damageCooldown = 0; local_5e4 = (Entity_Player *)0x3f800000; Game::GetField26614(pGVar21); cVar7 = FUN_00429550(); curPlayer = local_5e0; if (cVar7 != '\0') { local_5e4 = (Entity_Player *)0x41200000; } pcVar3 = *(code **)(*(int *)local_5e0 + 0x20); local_5ec = (Entity_Player *)EntityRef::EntityRef(&EStack_19d0); TemporaryEffects::GetCollectibleEffectNum(&curPlayer->_temporaryeffects,0x7e); (*pcVar3)(); SoundEffects::PlayWithFartOverride(0x422,1.0,2,0,1.0); goto switchD_005b5899_default; } break; case 0x7f: if (local_5e0->_variant == 0) { if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } Game::GetField26614(g_game); cVar7 = FUN_00429560(); if (cVar7 == '\0') { effect = Entity_Effect::CreateTimer(FUN_005c7ad0,1,0,0); Entity::SetParent((Entity *)effect,(Entity *)local_5e0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } fVar32 = 2.62043e-43; goto LAB_005b743f; } goto LAB_005b3e24; case 0x82: case 0xb5: if (local_5e0->_variant != 0) { local_5d9 = bVar5; goto LAB_005b54d1; } tmpVec = &local_5e0->_velocity; local_5e4 = (Entity_Player *)Vector::LengthSquared(tmpVec); if (1.0 < (float)local_5e4) { tmpVec = Vector::Normalized(tmpVec,&VStack_1108); fStack_920 = 10.0; tmpVec = Vector::__mul(tmpVec,&VStack_1110,&fStack_920); Entity::SetVelocity((Entity *)local_5e0,tmpVec); local_5e0->_ponyCharge = 0x3c; std::vector::clear(&local_5e0->_contactHitList,0); fVar32 = 1.66755e-43; goto LAB_005b562c; } goto LAB_005b3e24; case 0x85: if ((local_5e0->_variant == 0) && (1 < local_5e0->_maxHearts)) { play_sound_with_fart_seed(0x9d,1.0,2,0,1.0); local_5e0->_maxHearts = local_5e0->_maxHearts + -2; iStack_934 = GetEffectiveMaxHearts(local_5e0); pEVar8 = local_5e0; piVar14 = (int *)std::min(); pEVar8->_redHearts = *piVar14; AddSoulHearts(pEVar8,6,0); UpdateHeartDependentEffects(pEVar8); if ((char)isShowAnim != '\0') { AnimateCollectible(pEVar8,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } if (slot == 0) { bVar5 = HasCollectible(pEVar8,0x3b,0); if (bVar5 != 0) { TemporaryEffects::AddNullEffect(&pEVar8->_temporaryeffects,0x82,1,1); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } } } goto LAB_005b3e24; case 0x87: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x420,1.0,2,0,1.0); pEVar8 = local_5e0; pGVar21 = g_game; local_5e4 = (Entity_Player *)0x42020; local_5e0->_damageCooldown = 0; iVar9 = Game::Challenge(pGVar21); if (iVar9 == 0x1e) { local_5e4 = (Entity_Player *)0x42820; } pcVar3 = *(code **)(*(int *)pEVar8 + 0x20); EntityRef::EntityRef(&EStack_19a8); (*pcVar3)(); iVar9 = 0; if ((local_5e0->_playerType == 0xe) || (local_5e0->_playerType == 0x21)) { bVar5 = HasCollectible(local_5e0,0x4b,0); if ((bVar5 != 0) && (iVar25 = Isaac::Random(2), iVar25 == 0)) { iVar9 = 1; } bVar5 = HasCollectible(local_5e0,0xe3,0); if (bVar5 != 0) { local_600 = (Entity_Player *)0x40000000; } fVar32 = random_float(); if (iVar9 == 0) { fVar31 = 0.5; } else { fVar31 = 0.25; } iVar9 = iVar9 + (uint)(fVar32 * (float)local_600 <= fVar31); } else { rngPtr = &local_5e0->_dropRNG; bVar5 = Game::IsHardMode(); if (bVar5 == 0) { uStack_930 = RNG::RandomInt(rngPtr,3); uStack_92c = 1; } else { uStack_928 = RNG::RandomInt(rngPtr,2); uStack_924 = 1; } piVar14 = (int *)FUN_0040cdc0(); iVar9 = *piVar14; bVar5 = HasCollectible(local_5e0,0x4b,0); if (bVar5 != 0) { iVar9 = iVar9 + 1; } } curPlayer = local_5e0; if (0 < iVar9) { local_5e4 = (Entity_Player *)&local_5e0->_pos; do { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition (room,&VStack_1120,(Vector *)local_5e4,40.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)local_5e0,0,uVar26); iVar9 = iVar9 + -1; } while (iVar9 != 0); goto LAB_005b46cc; } goto switchD_005b5899_default; } break; case 0x88: if (local_5e0->_variant == 0) { uVar26 = Random(); curPlayer = local_5e0; Game::Spawn(g_game,4,2,playerPos,&g_vectorZero,(Entity *)local_5e0,0,uVar26); tear = (Entity_Tear *)__RTDynamicCast(); EntityPtr::SetReference((EntityPtr *)&curPlayer->field_0x1450,(Entity *)tear); if (tear != (Entity_Tear *)0x0) { SoundEffects::PlayWithFartOverride(0x401,1.0,2,0,1.0); Entity_Bomb::SetExplosionCountdown(); GetBombFlags(curPlayer,&BStack_1438,0); FUN_006a6910(); FUN_006a6930(); fVar30 = (float10)Entity_Tear::FallingAcceleration(tear); Entity_Projectile::set_falling_accel ((Entity_Projectile *)tear,(float)(fVar30 + (float10)85.0)); local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } } goto LAB_005b3e24; case 0x91: if (local_5e0->_variant == 0) { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,3); curPlayer = local_5e0; local_5e4 = (Entity_Player *)(uVar26 + 2); bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 == 0) || ((char)local_610 == '\0')) { AddBlueFlies(curPlayer,(int)local_5e4,playerPos,(Entity *)0x0); } else { curPlayer = local_5e0; if (0 < (int)local_5e4) { tmpVec = &local_5e0->_pos; pEVar8 = local_5e4; do { AddWisp(local_5e0,0x91,tmpVec,0,0); pEVar8 = (Entity_Player *)((int)&pEVar8[-1]._replacedPlayer + 3); curPlayer = local_5e0; } while (pEVar8 != (Entity_Player *)0x0); } } goto switchD_005b5899_default; } break; case 0x92: if (local_5e0->_variant == 0) { AddEternalHearts(local_5e0,1); curPlayer = local_5e0; } break; case 0x93: bVar5 = TemporaryEffects::HasCollectibleEffect(&local_5e0->_temporaryeffects,0x93); if (bVar5 == 0) { TemporaryEffects::AddCollectibleEffect(&curPlayer->_temporaryeffects,0x93,0,1); SoundEffects::PlayWithFartOverride(0x421,1.0,2,0,1.0); } useResult = useResult & 0xff00; goto LAB_005b54bc; case 0x9e: if (local_5e0->_variant == 0) { rngPtr = (RNG *)FUN_005cbd00(); level = (Level *)Config::GetCollectibles(); Level::ShowMap(level); uVar26 = RNG::RandomInt(rngPtr,2); pEVar8 = local_5e0; if (uVar26 == 0) { LAB_005b6a39: uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1138,&pEVar8->_pos,40.0,0,0,0); uVar11 = 0; fVar32 = 4.2039e-43; } else { bVar5 = HasTrinket(local_5e0,0x16,0); if (bVar5 != 0) { spriteColor = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(spriteColor,5); if (uVar26 != 0) goto LAB_005b6a39; } uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1130,&pEVar8->_pos,40.0,0,0,0); uVar11 = 3; fVar32 = 1.4013e-44; } Game::Spawn(g_game,5,(uint)fVar32,tmpVec,&g_vectorZero,(Entity *)pEVar8,uVar11,uVar26); SoundEffects::PlayWithFartOverride(0x41d,1.0,2,0,1.0); goto LAB_005b46cc; } break; case 0xa0: goto LAB_005b78cc; case 0xa4: goto LAB_005b7eff; case 0xa6: if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); iVar25 = GridEntity::GetVariant(); if (iVar25 == 2) { Level::GetCurrentRoom((Level *)g_game); Room::ShopReshuffle(); } Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&d20Pickups,5,-1,-1,0,0); fStack_14 = 9.80909e-45; pEVar8 = (Entity_Player *)0x0; local_5ec = (Entity_Player *)0x0; iVar25 = EntityList::Size(); if (iVar25 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); cVar7 = Entity::IsDead((Entity *)*puVar15); if (cVar7 == '\0') { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Variant((Entity *)*puVar15); if (iVar9 != 100) { std::vector::operator_index(); pEVar37 = (Entity_Player *)__RTDynamicCast(); local_5e4 = pEVar37; bVar5 = Entity_Pickup::CanReroll((Entity_Pickup *)pEVar37); pEVar34 = local_5e0; if (bVar5 != 0) { bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 == 0) || ((char)local_610 == '\0')) { cVar7 = Entity_Pickup::IsShopItem((Entity_Pickup *)pEVar37); if (cVar7 == '\0') { uVar11 = 0x3d; uVar26 = Entity::InitSeed((Entity *)pEVar37); RNG::game_constructor(&rerollRng,uVar26,uVar11); fStack_14 = (float)CONCAT31(fStack_14._1_3_,9); cVar7 = FUN_006ee330(); if (((cVar7 == '\0') || (uVar26 = RNG::RandomInt(&rerollRng,5), uVar26 == 0)) && (uVar26 = RNG::RandomInt(&rerollRng,10), uVar26 != 0)) { bVar41 = 0; bVar36 = 0; bVar5 = 1; fVar32 = 1.4013e-45; iVar25 = 0; iVar9 = Entity::Type((Entity *)pEVar37); } else { uVar26 = RNG::RandomInt(&rerollRng,4); iVar25 = (-(uint)(uVar26 != 0) & 0xfffffff6) + 0x3c; iVar9 = Entity::Type((Entity *)local_5e4); bVar41 = 0; bVar36 = 0; bVar5 = 1; fVar32 = 0.0; pEVar37 = local_5e4; } Entity_Pickup::Morph ((Entity_Pickup *)pEVar37,iVar9,iVar25,(int)fVar32,bVar5,bVar36, bVar41); goto LAB_005b5f61; } bVar41 = 0; bVar36 = 0; bVar5 = 1; fVar32 = 0.0; iVar25 = 0x96; iVar9 = Entity::Type(); Entity_Pickup::Morph ((Entity_Pickup *)pEVar37,iVar9,iVar25,(int)fVar32,bVar5,bVar36,bVar41 ); } else { uVar11 = 0x23; uVar26 = Entity::InitSeed((Entity *)pEVar37); RNG::game_constructor(&virtuesWispRng,uVar26,uVar11); fStack_14 = (float)CONCAT31(fStack_14._1_3_,8); uVar26 = RNG::RandomInt(&virtuesWispRng,5); if (uVar26 == 0) { tmpVec = Entity::Position((Entity *)pEVar37,&VStack_1118); iVar9 = Entity_Familiar::GetRandomWisp(&virtuesWispRng); AddWisp(pEVar34,iVar9,tmpVec,0,0); pEVar37 = local_5e4; } (**(code **)(*(int *)pEVar37 + 0x28))(); LAB_005b5f61: fStack_14 = (float)CONCAT31(fStack_14._1_3_,7); guard_check_icall(); } pEVar8 = local_5ec; } } } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5ec = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); iVar9 = itemId; } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&d20Pickups); } goto LAB_005b8358; case 0xab: if (local_5e0->_variant == 0) { fVar35 = 4.62428e-44; uVar17._0_1_ = 0xbe; uVar17._1_1_ = 0x5b; uVar17._2_2_ = 0x5b; SoundEffects::PlayWithFartOverride(0x21,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); local_5f0 = (Entity_Player *)Room::GetEntities(); local_5ec = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5e4 = pEVar8; bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0); if ((bVar5 != 0) && (pEVar8 != local_5e0)) { iVar9 = 0x5b5c2b; bVar5 = Entity::HasEntityFlags((Entity *)pEVar8,0x20000000); if (bVar5 == 0) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0xab); pEVar10 = local_5e0; iVar25 = itemConfig->maxCooldown; fVar39 = 8.390167e-39; EntityRef::constructor(&EStack_16d0,(Entity *)local_5e0); bVar5 = 0; ::Color::Color(); pEVar8 = local_5e4; color_00._tint[1] = in_stack_ffffe5f8; color_00._tint[0] = in_stack_ffffe5f4; color_00._tint[2] = in_stack_ffffe5fc; color_00._tint[3] = in_stack_ffffe600; color_00._colorize[0] = in_stack_ffffe604; color_00._colorize[1] = fVar31; color_00._colorize[2] = fVar32; color_00._colorize[3] = (float)uVar17; color_00._offset[0] = fVar35; color_00._offset[1] = (float)iVar9; color_00._offset[2] = fVar39; Entity::AddSlowing((Entity *)local_5e4,&EStack_16d0,iVar25,0.9,color_00,bVar5); Entity::AddEntityFlags((Entity *)pEVar8,0x400000); pcVar3 = *(code **)(*(int *)pEVar8 + 0x20); EntityRef::constructor(&EStack_15e0,(Entity *)pEVar10); fVar35 = 2.0; uVar17._0_1_ = 0; uVar17._1_1_ = 0; uVar17._2_2_ = 0x4120; fVar32 = 8.390359e-39; (*pcVar3)(); } } puVar27 = &local_5ec->field_0x1; local_5ec = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } goto LAB_005b46cc; } break; case 0xaf: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0xcc,1.0,2,0,1.0); iVar9 = 0; do { room = (Room *)Level::GetCurrentRoom((Level *)g_game); door = Room::GetDoor(room,iVar9); if (((door != (GridEntity_Door *)0x0) && (cVar7 = FUN_00710370(), cVar7 != '\0')) && (bVar5 = GridEntity_Door::TryUnlock(door,local_5e0,1), bVar5 == 0)) { GridEntity_Door::Open(door); GridEntity_Door::TryBlowOpen(door,0,(Entity *)0x0); } iVar9 = iVar9 + 1; } while (iVar9 < 8); Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(tempEffects,0xaf,1,1); goto LAB_005b46cc; } break; case 0xb1: if (local_5e0->_variant == 0) { local_5d9 = bVar5; if (local_5e0->_numCoins < 1) goto LAB_005b54d1; AnimateCollectible(local_5e0,0xb1,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); pEVar8 = local_5e0; AddCoins(local_5e0,-1); IsLocalPlayer(pEVar8); SoundEffects::PlayWithFartOverride(0x382,(float)pEVar10,2,0,1.0); bVar5 = HasCollectible(pEVar8,0x2e,0); iVar9 = 0xf; if (bVar5 == 0) { iVar9 = 0x15; } iVar9 = Isaac::Random(iVar9); uVar26 = iVar9 + 4; if (iVar9 + 3U < 9) { uVar26 = iVar9 + 3U; } if (uVar26 == 7) { iVar9 = Isaac::Random(3); if (iVar9 != 0) goto LAB_005b73ac; switchD_005b73b8_caseD_a: SoundEffects::PlayWithFartOverride(899,1.0,2,0,1.0); iStack_944 = Isaac::Random(3); uStack_948 = 1; piVar14 = (int *)FUN_0040cdc0(); iVar9 = *piVar14; if (iVar9 != 0) { local_5e4 = (Entity_Player *)&local_5e0->_pos; do { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition (room,&VStack_1168,(Vector *)local_5e4,40.0,0,0,0); pEVar8 = local_5e0; Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)local_5e0,0,uVar26); bVar5 = HasCollectible(pEVar8,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0xb1,&pEVar8->_pos,0,0); } iVar9 = iVar9 + -1; } while (iVar9 != 0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } } else { if (((uVar26 == 6) || (uVar26 == 5)) && (bVar5 = HasTrinket(pEVar8,0x16,0), bVar5 != 0)) { rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::RandomInt(rngPtr,5); if (uVar11 != 0) goto switchD_005b73b8_caseD_a; } LAB_005b73ac: switch(uVar26) { case 3: iVar9 = Isaac::Random(3); if (iVar9 != 0) { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1150,&pEVar8->_pos,40.0,0,0,0) ; Game::Spawn(g_game,0xd,0,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); AnimateSad(pEVar8); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; goto LAB_005b54d1; } AddPrettyFly(pEVar8); bVar5 = HasCollectible(pEVar8,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { tmpVec = &pEVar8->_pos; AddWisp(pEVar8,0x91,tmpVec,0,0); AddWisp(pEVar8,0x91,tmpVec,0,0); AddWisp(pEVar8,0x91,tmpVec,0,0); } fVar32 = 1.25977e-42; goto LAB_005b743f; case 4: SoundEffects::PlayWithFartOverride(899,1.0,2,0,1.0); uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1158,&pEVar8->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x28,tmpVec,&g_vectorZero,(Entity *)pEVar8,0,uVar26); bVar5 = HasCollectible(pEVar8,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0x25,&pEVar8->_pos,0,0); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; goto LAB_005b54d1; } break; case 5: case 6: SoundEffects::PlayWithFartOverride(899,1.0,2,0,1.0); uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1160,&pEVar8->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)pEVar8,0,uVar26); bVar5 = HasCollectible(pEVar8,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0x2d,&pEVar8->_pos,0,0); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; goto LAB_005b54d1; } break; case 7: SoundEffects::PlayWithFartOverride(899,1.0,2,0,1.0); uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1170,&pEVar8->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x1e,tmpVec,&g_vectorZero,(Entity *)pEVar8,0,uVar26); bVar5 = HasCollectible(pEVar8,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0xaf,&pEVar8->_pos,0,0); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; goto LAB_005b54d1; } break; case 8: SoundEffects::PlayWithFartOverride(899,1.0,2,0,1.0); uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1178,&pEVar8->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x46,tmpVec,&g_vectorZero,(Entity *)pEVar8,0,uVar26); bVar5 = HasCollectible(pEVar8,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0x66,&pEVar8->_pos,0,0); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; goto LAB_005b54d1; } break; default: PlayExtraAnimation(pEVar8,&DAT_00b1cdf8); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; case 10: case 0xb: case 0xc: goto switchD_005b73b8_caseD_a; } } } goto LAB_005b3e24; case 0xba: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x21,1.0,2,0,1.0); local_5e0->_damageCooldown = 0; iVar9 = TemporaryEffects::GetCollectibleEffectNum(&local_5e0->_temporaryeffects,0xba); if (iVar9 < 1) { local_600 = (Entity_Player *)0x40000000; } Game::GetField26614(g_game); cVar7 = FUN_00429550(); curPlayer = local_5e0; if (cVar7 != '\0') { local_600 = (Entity_Player *)0x41700000; } pcVar3 = *(code **)(*(int *)local_5e0 + 0x20); EntityRef::EntityRef(&EStack_1930); (*pcVar3)(); UseActiveItem(curPlayer,&sStack_872,0x23,1,-1,0); Game::ShakeScreen(g_game,8); Level::GetCurrentRoom((Level *)g_game); Room::EmitBloodFromWalls(); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if ((cVar7 != '\0') && (iVar9 = TemporaryEffects::GetCollectibleEffectNum(&curPlayer->_temporaryeffects,0xba), 1 < iVar9)) { RemoveCollectible(curPlayer,0xba,1,slot,1); } AddCacheFlags(curPlayer,2); EvaluateItems(); goto switchD_005b5899_default; } break; case 0xc0: SoundEffects::PlayWithFartOverride(0x423,1.0,2,0,1.0); tearFlags = BitSet128::operator_and(&BStack_1458,&local_5e0->_tearFlags,&g_tearFlagHoming); bVar5 = BitSet128::IsNonZero(tearFlags); if (bVar5 != 0) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentData,0x185); } LAB_005b3e9f: bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; LAB_005b3ea9: pcVar38 = "UseItem"; LAB_005b3eb3: goto LAB_005b3eb4; case 0x107: if (local_5e0->_variant == 0) { iVar9 = GetCard(local_5e0); itemConfigDb = Isaac::GetItemConfig(); cardConfig = ItemConfig::GetCard(itemConfigDb,iVar9); if (((iVar9 == 0) || (cardConfig == (ItemConfig_Card *)0x0)) || (cVar7 = Card::IsRune(), cVar7 == '\0')) goto LAB_005b46cc; if ((((flags & 4) != 0) && (-1 < slot)) && (local_5e0->_activeDesc[slot]._item == 0x107)) { local_5e0->_activeDesc[slot]._varData = cardConfig->mimicCharge; } UseCard(local_5e0,iVar9,0x180); local_5e0->_wildCardItemType = 1; local_5e0->_wildCardItem = iVar9; local_5e0->_wildCardVarData = 0; curPlayer = local_5e0; goto switchD_005b5899_default; } } LAB_005b46d8: if ((char)isShowAnim != '\0') { LAB_005b46e5: pcVar38 = "UseItem"; LAB_005b46ef: LAB_005b46f0: AnimateCollectible(curPlayer,iVar9,(byte *)pcVar38,(byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e24; } if (0x1be < iVar9 - 0x11bU) { LAB_005c71f1: local_5d9 = bVar5; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); iVar25 = std::vector::size(pvVar24); if (iVar25 <= iVar9) { KAGE_LogMessage(1,(byte *)"Undefined collectible used %d\n"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; goto LAB_005b54d1; } goto LAB_005b3e30; } /* WARNING (jumptable): Sanity check requires truncation of jumptable */ /* WARNING: Could not find normalized switch variable to match jumptable */ switch((&DAT_005c7645)[iVar9]) { case 0: pEVar8 = local_5e0; if (local_5e0->_variant == 0) { UseActiveItem(local_5e0,&sStack_874,0x69,1,-1,0); pEVar8 = local_5e0; UseActiveItem(local_5e0,&sStack_876,0xa6,1,-1,0); UseActiveItem(pEVar8,&sStack_878,0x11d,1,-1,0); UseActiveItem(pEVar8,&sStack_89a,0x182,1,-1,0); UseActiveItem(pEVar8,&sStack_89c,0x1b5,1,-1,0); UseActiveItem(pEVar8,&sStack_89e,0x196,1,-1,0); UseActiveItem(pEVar8,&sStack_8a0,0x1dc,1,-1,0); UseActiveItem(pEVar8,&sStack_8a2,0x11c,1,-1,0); } bVar5 = HasCollectible(pEVar8,0x248,0); curPlayer = local_5e0; if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(local_5e0,0x248,playerPos,0,0); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&d100Wisps,3,0xce,-1,0,0); fStack_14 = 2.10195e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { std::vector::operator_index(); local_5e4 = (Entity_Player *)FUN_00435de0(); if ((local_5e4 != (Entity_Player *)0x0) && (pEVar8 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)local_5e4), pEVar8 == curPlayer)) { FUN_005cbd00(); FUN_0043e990(); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } queryList = &d100Wisps; LAB_005b8efd: fStack_14 = -NAN; EntityList_Query::~EntityList_Query(queryList); } goto LAB_005b8f09; case 1: bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&d4Wisps,3,0xce,-1,0,0); fStack_14 = 2.24208e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); (**(code **)(*(int *)*puVar15 + 0x28))(); uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } iVar25 = 0; local_5e4 = (Entity_Player *)Config::GetCollectibles(); local_5ec = (Entity_Player *)0x0; iVar9 = FUN_0042c7f0(); if (iVar9 != 0) { do { if (((uint)local_5ec & 1) == 0) { bVar36 = 0; bVar5 = 0; tmpVec = &local_5e0->_pos; rngPtr = (RNG *)FUN_005cbd00(); iVar9 = Entity_Familiar::GetRandomWisp(rngPtr); curPlayer = local_5e0; AddWisp(local_5e0,iVar9,tmpVec,bVar5,bVar36); iVar25 = iVar25 + 1; if (iVar25 == 0xc) break; } local_5ec = (Entity_Player *)&local_5ec->field_0x1; pEVar8 = (Entity_Player *)FUN_0042c7f0(); } while (local_5ec < pEVar8); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&d4Wisps); } bVar5 = (byte)(flags >> 4) & 1; rngPtr = (RNG *)FUN_005cbd00(); reroll_collectibles_on_damage(curPlayer,rngPtr,bVar5); goto LAB_005b8f09; case 2: if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); Room::GetEntities(); FUN_00424510(); fStack_14 = 2.66247e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); devolveTarget = (Entity *)*puVar15; cVar7 = Entity::HasMortalDamage(); if (((cVar7 == '\0') && (cVar7 = Entity::IsDead(devolveTarget), cVar7 == '\0')) && (bVar5 = Entity::CanDevolve(devolveTarget), bVar5 != 0)) { std::vector::push_back(); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } std::iterator_copy(auStack_8c0,auStack_648); FUN_00456190(); cVar7 = FUN_0042c710(); while (cVar7 != '\0') { puVar15 = (undefined4 *)EntityPtr::Ref(); Game::DevolveEnemy((Entity *)*puVar15,(Entity **)0x0); FUN_005cbb80(); FUN_00456190(); cVar7 = FUN_0042c710(); } fStack_14 = -NAN; FID_conflict__Tidy(auStack_8c0); iVar9 = itemId; } goto LAB_005b8358; case 3: local_5d9 = bVar5; if (local_5e0->_variant == 0) { iVar25 = GetCard(local_5e0); local_5d9 = (byte)isShowAnim; if ((iVar25 != 0) && ((iVar25 != 0x30 || (local_5e0->_activeDesc[0]._item != 0x1dd)))) { itemConfigDb = Isaac::GetItemConfig(); local_5e4 = (Entity_Player *)ItemConfig::GetCard(itemConfigDb,iVar25); local_5d9 = (byte)isShowAnim; if (local_5e4 != (Entity_Player *)0x0) { cVar7 = Card::IsCard(); pEVar8 = local_5e0; if (cVar7 != '\0') { if ((((flags & 4) != 0) && (-1 < slot)) && (local_5e0->_activeDesc[slot]._item == 0x11e) ) { local_5e0->_activeDesc[slot]._varData = *(int *)((local_5e4->_sprite)._animDefaultName._buf + 4); } UseCard(local_5e0,iVar25,0x180); if (iVar25 == 0x30) { iVar9 = pEVar8->_pocketSlots[3]; pEVar8->_pocketSlots[0] = pEVar8->_pocketSlots[2]; local_5d9 = 0; local_5e0->_pocketSlots[1] = iVar9; local_5e0->_pocketSlots[2] = local_5e0->_pocketSlots[4]; local_5e0->_pocketSlots[3] = local_5e0->_pocketSlots[5]; local_5e0->_pocketSlots[4] = local_5e0->_pocketSlots[6]; local_5e0->_pocketSlots[5] = local_5e0->_pocketSlots[7]; local_5e0->_pocketSlots[6] = 0; curPlayer = local_5e0; break; } if (iVar25 != 0x50) { local_5e0->_wildCardItemType = 1; local_5e0->_wildCardItem = iVar25; local_5e0->_wildCardVarData = 0; } local_5d9 = (byte)isShowAnim; if (iVar25 == 0x14) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentData,0x102); local_5d9 = (byte)isShowAnim; } iVar9 = itemId; } } } } if (local_5d9 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; break; } goto LAB_005b3e30; case 4: if (local_5e0->_variant == 0) { FUN_00424510(); fStack_14 = 2.8026e-44; level = (Level *)Config::GetCollectibles(); cVar7 = Level::GetStateFlag(level); if (cVar7 == '\0') { pEVar37 = (Entity_Player *)0x0; pEVar34 = (Entity_Player *)&LAB_005ba6f2; WeightedOutcomePicker::AddOutcomeWeight(secretsPicker,0,1,0); } level = (Level *)Config::GetCollectibles(); cVar7 = Level::GetStateFlag(level); if (cVar7 == '\0') { pEVar37 = (Entity_Player *)0x1; pEVar34 = (Entity_Player *)&LAB_005ba71b; WeightedOutcomePicker::AddOutcomeWeight(secretsPicker,1,1,0); } level = (Level *)Config::GetCollectibles(); iVar25 = 0x5ba72f; cVar7 = Level::GetStateFlag(level); if (cVar7 == '\0') { iVar25 = 1; pEVar37 = (Entity_Player *)0x2; pEVar34 = (Entity_Player *)&LAB_005ba744; WeightedOutcomePicker::AddOutcomeWeight(secretsPicker,2,1,0); } iVar12 = 0x5ba74f; cVar7 = FUN_004178f0(); if (cVar7 == '\0') { level = (Level *)Config::GetCollectibles(); Level::SetCanSeeEverything(level); pGVar21 = (Game *)Config::GetCollectibles(); Game::UpdateVisibility(pGVar21); } else { uVar11 = 0x23; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),uVar26,uVar11); rng_01._shift1 = (int)pEVar37; rng_01._seed = (int)pEVar34; rng_01._shift2 = iVar25; rng_01._shift3 = iVar12; uVar26 = WeightedOutcomePicker::PickOutcome(secretsPicker,rng_01); if (uVar26 == 0) { level = (Level *)Config::GetCollectibles(); Level::ApplyBlueMapEffect(level); } else if (uVar26 == 1) { level = (Level *)Config::GetCollectibles(); Level::ApplyCompassEffect(level,1); } else if (uVar26 == 2) { level = (Level *)Config::GetCollectibles(); Level::ApplyMapEffect(level); } iVar9 = itemId; } itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x11f); TemporaryEffect::TemporaryEffect(secretsEffect,itemConfig); uStack_cac = 0x2d; Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddEffect(tempEffects,secretsEffect,1,1); fStack_14 = -NAN; std::vector::_Tidy(); curPlayer = local_5e0; } goto LAB_005b46d8; case 5: if (local_5e0->_variant == 0) { iVar25 = Isaac::Random(5); curPlayer = local_5e0; local_5e4 = (Entity_Player *)(iVar25 + 4); if (local_5e4 == (Entity_Player *)0x0) goto LAB_005b5414; local_5ec = (Entity_Player *)playerPos; do { bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 == 0) || ((char)local_610 == '\0')) { ThrowBlueSpider(curPlayer,(Vector *)local_5ec,&g_vectorZero); SoundEffects::PlayWithFartOverride(0x405,1.0,2,0,1.0); } else { AddWisp(curPlayer,0x120,playerPos,0,0); local_5ec = (Entity_Player *)playerPos; } local_5e4 = (Entity_Player *)((int)&local_5e4[-1]._replacedPlayer + 3); } while (local_5e4 != (Entity_Player *)0x0); local_5e4 = (Entity_Player *)0x0; goto switchD_005b5899_default; } goto LAB_005b46d8; case 6: LAB_005b7eff: SetItemState(local_5e0); AnimateCollectible(local_5e0,itemId,(byte *)"LiftItem",(byte *)"PlayerPickupSparkle"); fVar32 = 1.45175e-42; goto LAB_005b743f; case 7: if (local_5e0->_variant == 0) { piVar14 = &local_5e0->_jarHearts; local_5ec = (Entity_Player *)piVar14; if (0 < local_5e0->_jarHearts) { FUN_005b19d0(); pEVar8 = local_5e0; local_5f8 = (Entity_Player *)*piVar14; local_5d9 = '\x01'; if (slot == 0) { bVar5 = HasCollectible(local_5e0,0x3b,0); if (bVar5 != 0) { uStack_970 = 2; puVar15 = (undefined4 *)std::min(); local_5f8 = (Entity_Player *)*puVar15; trigger_book_of_belial_passive(pEVar8,0x122,(int)local_5f8); apvStack_6e0[0] = (void *)((float)(int)local_5f8 * 0.25 + 0.5); uVar26 = Random(); local_5e4 = (Entity_Player *)&pEVar8->_pos; effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x2e,(Vector *)local_5e4,&g_vectorZero,(Entity *)pEVar8 ,0,uVar26); fStack_974 = (float)apvStack_6e0[0] * 3.0; tmpVec = Vector::operator_mul(&VStack_1248,&fStack_974,&g_vectorOne); Entity::SetSpriteScale((Entity *)effect,tmpVec); Entity_Effect::SetTimeout(effect,0x1c2); (**(code **)(*(int *)effect + 0xc))(); uVar26 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,2,(Vector *)local_5e4,&g_vectorZero,(Entity *)0x0, (0.75 < (float)(int)local_5f8) + 3,uVar26); fVar32 = random_float(); Entity_Effect::set_rotation(effect,fVar32 * 360.0); tmpVec = Vector::operator_mul(&VStack_1250,(float *)apvStack_6e0,&g_vectorOne); Entity::SetSpriteScale((Entity *)effect,tmpVec); (**(code **)(*(int *)effect + 0xc))(); local_5d9 = '\0'; pEVar8 = local_5e0; } bVar5 = HasCollectible(pEVar8,0x248,0); pEVar8 = local_5e0; if ((bVar5 == 0) || ((char)local_610 == '\0')) { if (local_5d9 != '\0') goto LAB_005b9b2b; } else { iVar9 = (int)local_5f8 / 2; if (0 < iVar9) { do { AddWisp(pEVar8,0x122,&pEVar8->_pos,0,0); iVar9 = iVar9 + -1; } while (iVar9 != 0); } if ((((uint)local_5f8 & 1) != 0) && (familiar = AddWisp(pEVar8,0x122,&pEVar8->_pos,0,0), familiar != (Entity_Familiar *)0x0)) { Entity::MaxHitPoints(); FUN_00435d40(); } } } else { LAB_005b9b2b: pEVar8 = local_5e0; local_5e4 = (Entity_Player *)((int)local_5f8 / 2); if (0 < (int)local_5e4) { do { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&VStack_c38,playerPos,40.0,0,0,0); uVar26 = Random(); Game::Spawn(g_game,5,10,&VStack_c38,&g_vectorZero,(Entity *)pEVar8,1,uVar26); FUN_005b1950(); local_5e4 = (Entity_Player *)((int)&local_5e4[-1]._replacedPlayer + 3); } while (local_5e4 != (Entity_Player *)0x0); } if (((uint)local_5f8 & 1) != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&VStack_c40,playerPos,40.0,0,0,0); uVar26 = Random(); Game::Spawn(g_game,5,10,&VStack_c40,&g_vectorZero,(Entity *)pEVar8,2,uVar26); FUN_005b1950(); } } *(int *)local_5ec = *(int *)local_5ec - (int)local_5f8; if ((char)isShowAnim != '\0') { AnimateCollectible(local_5e0,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } FUN_005b19d0(); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; break; } } goto LAB_005b3e24; case 8: if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(tempEffects,0x123,1,1); SoundEffects::PlayWithFartOverride(0x18c,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); queryList = (EntityList_EL *)Room::GetEntities(); EntityList_EL::constructor(&flushEntities,queryList); fStack_14 = 2.38221e-44; local_5f8 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; pEVar10 = (Entity_Player *)__RTDynamicCast(); local_5f0 = pEVar10; if ((pEVar10 == (Entity_Player *)0x0) || (bVar5 = Entity::HasEntityFlags((Entity *)pEVar10,0x20000000), bVar5 == 0)) { bVar5 = Entity::is_player((Entity *)pEVar8); if ((bVar5 != 0) && (pEVar8 != local_5e0)) { Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { pcVar3 = *(code **)(*(int *)pEVar8 + 0x20); EntityRef::EntityRef(&EStack_18e0); (*pcVar3)(); goto LAB_005b986f; } } if ((pEVar10 == (Entity_Player *)0x0) || (((((((iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0xd9 && (iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0xdc)) && (iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0xdf)) && ((iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0x105 && (iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0x192)))) && ((iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0x366 && ((iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0x367 && (iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0x392)))))) && (iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0x368)) && ((iVar9 = Entity::Type((Entity *)pEVar10), iVar9 != 0xed || (iVar9 = Entity::Variant((Entity *)pEVar10), iVar9 != 2)))))) { iVar9 = Entity::Type((Entity *)pEVar8); if (((iVar9 != 0xf5) && (((iVar9 = Entity::Type((Entity *)pEVar8), iVar9 != 0x1c && (bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0), bVar5 != 0)) && (iVar9 = Entity::Type((Entity *)pEVar8), iVar9 != 0xd5)))) && ((pEVar10 != (Entity_Player *)0x0 && (cVar7 = Entity_NPC::CanReroll((Entity_NPC *)pEVar10), cVar7 != '\0')))) { (**(code **)(*(int *)pEVar8 + 0x28))(); uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar8,&VStack_1240); local_5e4 = (Entity_Player *) Game::Spawn(g_game,0xf5,0,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); ::Color::Color(); ::Color::assign(); pEVar8 = local_5e0; bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0x123,&pEVar8->_pos,0,0); } cVar7 = FUN_004e47b0(); if (cVar7 != '\0') { minecart = (Entity_NPC *)FUN_004b7090(); Entity_NPC::MinecartUpdateChild(minecart,(Entity *)local_5e4); } } } else { Entity_NPC::KillUnique((Entity_NPC *)pEVar10); cVar7 = (**(code **)(*(int *)pEVar10 + 0x4c))(); if (cVar7 != '\0') { fVar30 = (float10)Entity::MaxHitPoints(); local_5e4 = (Entity_Player *)(float)fVar30; fVar30 = (float10)Entity::HitPoints((Entity *)pEVar10); local_5ec = (Entity_Player *)(float)fVar30; fVar32 = assert_lerp_range((float)local_5ec,0.0,(float)local_5e4,0.0,6.0,1); local_5e4 = (Entity_Player *)0x0; local_5ec = (Entity_Player *)(int)fVar32; iVar9 = Entity::Type((Entity *)pEVar10); if (((iVar9 == 0x105) && (iVar9 = Entity::Variant((Entity *)pEVar10), iVar9 == 1)) || (iVar9 = Entity::Type((Entity *)pEVar10), iVar9 == 0x192)) { local_5e4 = (Entity_Player *)0x2; } if (0 < (int)fVar32) { do { local_600 = (Entity_Player *)Random(); tmpVec = Entity::Position((Entity *)pEVar10,&VStack_1218); tmpVec2 = MusicManager::RandomVector(&VStack_1220); fVar32 = random_float(); fStack_968 = fVar32; tmpVec2 = Vector::__mul(tmpVec2,&VStack_1228,&fStack_968); FUN_00417340(); fStack_96c = fVar32; tmpVec2 = Vector::__mul(tmpVec2,&VStack_1230,&fStack_96c); tmpVec = Vector::__add(tmpVec,&VStack_1238,tmpVec2); Game::Spawn(g_game,0xd9,(uint)local_5e4,tmpVec,&g_vectorZero,(Entity *)local_5e0 ,0,(uint)local_600); local_5ec = (Entity_Player *)((int)&local_5ec[-1]._replacedPlayer + 3); pEVar10 = local_5f0; } while (local_5ec != (Entity_Player *)0x0); local_5ec = (Entity_Player *)0x0; } } } } LAB_005b986f: puVar27 = &local_5f8->field_0x1; local_5f8 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&flushEntities); goto LAB_005b46cc; } goto LAB_005b46d8; case 9: if (local_5e0->_variant == 0) { AddBlackHearts(local_5e0,2); } SoundEffects::PlayWithFartOverride(0x40d,1.0,2,0,1.0); if ((char)isShowAnim != '\0') { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } level = (Level *)Config::GetCollectibles(); Level::SetStateFlag(level); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; break; case 10: Vector::Vector(aVStack_8c,1.0,0.0); Vector::Vector(aVStack_8c + 1,0.0,1.0); Vector::Vector(aVStack_8c + 2,-1.0,0.0); Vector::Vector(aVStack_8c + 3,0.0,-1.0); curPlayer = local_5e0; local_5ec = (void *)0x0; do { Vector::Vector(&VStack_a5c,0.0,-20.0); fStack_978 = 10.0; tmpVec = Vector::__mul(aVStack_8c + (int)local_5ec,&VStack_1258,&fStack_978); Vector::operator_add_assign(&VStack_a5c,tmpVec); Vector::__add(playerPos,&VStack_c48,&VStack_a5c); bVar5 = 0; pEVar8 = curPlayer; tmpVec = Vector::Vector(&VStack_1260,0.0,-20.0); local_5e4 = (Entity_Player *) Entity_Laser::ShootAngle (1,&VStack_c48,(float)(int)local_5ec * 90.0,0x1f,tmpVec,(Entity *)pEVar8 ,bVar5); if (0.0 < aVStack_8c[(int)local_5ec].y || aVStack_8c[(int)local_5ec].y == 0.0) { fVar32 = 3000.0; } else { fVar32 = -10.0; } set_field_358(local_5e4,fVar32); local_5f0 = *(Entity_Player **)(*(int *)local_5e4 + 0x40); Game::GetField26614(g_game); FUN_00429550(); (*(code *)local_5f0)(); (**(code **)(*(int *)local_5e4 + 0xc))(); local_5ec = (Entity_Player *)((int)local_5ec + 1); } while ((int)local_5ec < 4); local_5d9 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); goto switchD_005bfbd8_caseD_11d; } goto LAB_005b54cf; case 0xb: Game::ButterBeanFart(g_game,playerPos,120.0,(Entity *)local_5e0,1,1); local_5d9 = (byte)isShowAnim; curPlayer = local_5e0; break; case 0xc: if ((local_5e0->_variant == 0) && (0 < local_5e0->_numCoins)) { SoundEffects::PlayWithFartOverride(0x89,1.0,2,0,1.0); curPlayer = local_5e0; AddCoins(local_5e0,-1); Game::ShakeScreen(g_game,0xf); Level::GetCurrentRoom((Level *)g_game); local_5f0 = (Entity_Player *)Room::GetEntities(); local_5ec = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5f8 = pEVar8; bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0); if (bVar5 != 0) { if (pEVar8 == local_5e0) { curPlayer = local_5e0; } else { Game::GetField26614(g_game); cVar7 = FUN_00429550(); curPlayer = local_5e0; if (cVar7 == '\0') { local_5e4 = (Entity_Player *)0x41200000; } else { local_5e4 = (Entity_Player *)0x0; } pcVar3 = *(code **)(*(int *)pEVar8 + 0x20); EntityRef::constructor(&EStack_1720,(Entity *)local_5e0); (*pcVar3)(); } } puVar27 = &local_5ec->field_0x1; local_5ec = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(curPlayer,0x127,&curPlayer->_pos,0,0); } goto LAB_005b8b6f; } goto LAB_005b3e24; case 0xd: if (local_5e0->_variant == 0) { iVar9 = local_5e0->_soulHearts; if (iVar9 < 2) { useResult = (ushort)useResult._1_1_ << 8; local_5d9 = bVar5; break; } iVar25 = iVar9; if (iVar9 + -2 < iVar9) { do { cVar7 = IsBlackHeart(curPlayer); if (cVar7 != '\0') { RemoveBlackHeart(); UseActiveItem(curPlayer,&sStack_8a4,0x23,1,-1,0); } iVar9 = curPlayer->_soulHearts; iVar25 = iVar25 + -1; } while (iVar9 + -2 < iVar25); } curPlayer->_soulHearts = iVar9 + -2; if ((local_5e0->_playerType == 0x11) && ((Entity_Player *)local_5e0->_subPlayer != (Entity_Player *)0x0)) { AddBoneHearts((Entity_Player *)local_5e0->_subPlayer,1); if (local_5e0->_soulHearts < 1) { SwapForgottenForm(local_5e0,0,0); } } else { AddMaxHearts(local_5e0,2,0); } AddHearts(local_5e0,2,0,0); pEVar8 = local_5e0; bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(pEVar8,0x128,&pEVar8->_pos,0,0); } if ((char)isShowAnim != '\0') { AnimateCollectible(pEVar8,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } fVar32 = 1.1883e-42; goto LAB_005b743f; } goto LAB_005b3e24; case 0xe: if (local_5e0->_variant != 0) goto LAB_005bbae2; IsLocalPlayer(local_5e0); SoundEffects::PlayWithFartOverride(0x37e,(float)pEVar10,2,0,1.0); uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); Config::GetCollectibles(); pEVar8 = (Entity_Player *)EntityPtr::Ref(); local_600 = pEVar8; bVar5 = HasTrinket(curPlayer,0xaf,0); if (bVar5 != 0) { local_5f0 = (Entity_Player *)&DAT_00000006; iVar9 = GetTrinketMultiplier(curPlayer,0xaf); if (iVar9 == 2) { local_5f0 = (Entity_Player *)&DAT_00000008; } else if (iVar9 == 3) { local_5f0 = (Entity_Player *)0xa; } TryRemoveTrinket(curPlayer,0xaf); bVar5 = Game::IsGreedMode(g_game); pvStack_b0 = (void *)0x1a; if (bVar5 == 0) { local_5ec = (Entity_Player *)0xa; blueBoxPools[0] = (void *)0x0; blueBoxPools[1] = (undefined1 *)0x2; blueBoxPools[2] = (void *)0x1; blueBoxPools[3] = (undefined1 *)0x3; puStack_ac = &DAT_00000005; blueBoxPools[4] = &DAT_00000004; pvStack_b4 = (void *)0xc; } else { local_5ec = (Entity_Player *)&DAT_00000009; blueBoxPools[0] = (void *)0x10; blueBoxPools[1] = &DAT_00000011; blueBoxPools[2] = (void *)0x12; blueBoxPools[3] = &DAT_00000013; blueBoxPools[4] = &DAT_00000014; pvStack_b4 = (void *)0x15; } VStack_608.y = (float)((int)local_5ec + -1); pvVar24 = (void *)0x0; local_5e4 = (Entity_Player *)&curPlayer->_collectibleRNGs; puStack_bc = &DAT_00000006; puStack_b8 = &DAT_00000008; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,(int)local_5ec - (int)pvVar24); if (uVar26 != 0) { FUN_005cbf90(); } pvVar24 = (void *)((int)pvVar24 + 1); } while (pvVar24 < (uint)VStack_608.y); local_5ec = (void *)0x0; VStack_608.y = (float)&local_5e0->_pos; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,(int)blueBoxPools[(int)local_5ec],uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition (room,&VStack_1280,(Vector *)VStack_608.y,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); local_5ec = (Entity_Player *)((int)local_5ec + 1); } while ((int)local_5ec < (int)local_5f0); goto switchD_005bb135_caseD_b; } Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { Game::GetField26614(g_game); EntityList::Size(); FUN_0042b550(); FUN_005cbbd0(); fStack_14 = 2.94273e-44; playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); iVar9 = PlayerManager::count_main_players(playerManager); if (iVar9 != 0) { uVar26 = 0; do { GridEntity::GetType(); iVar9 = FUN_0067f030(); FUN_0042c770(); for (; iVar9 != 0; iVar9 = iVar9 + -1) { FUN_0042c6e0(); } puVar15 = (undefined4 *)FUN_0042c700(); uStack_a64 = *puVar15; uStack_a60 = puVar15[1]; FUN_0042c730(); Game::GetField26614(g_game); piVar14 = (int *)EntityList::Size(); (**(code **)(*piVar14 + 0x38))(); uVar26 = uVar26 + 1; playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); uVar11 = PlayerManager::count_main_players(playerManager); } while (uVar26 < uVar11); curPlayer = local_5e0; } fStack_14 = -NAN; FUN_0042c780(); goto switchD_005bb135_caseD_b; } puVar13 = (undefined1 *)((int)&pEVar8[-1]._replacedPlayer + 3); bVar5 = Game::IsGreedMode(g_game); pEVar8 = local_600; if (bVar5 != 0) { switch(puVar13) { case (undefined1 *)0x0: local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1288,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x1e,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1290,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x28,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x1: VStack_608.y = (float)&curPlayer->_collectibleRNGs; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,2,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1298,&local_5e0->_pos,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_12b8,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)curPlayer,3,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x2: local_5e4 = (Entity_Player *)&DAT_00000014; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_12c0,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (Entity_Player *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x3: local_5e4 = (void *)0x2; pEStack_614 = (Entity_Pickup *)&curPlayer->_pos; VStack_608.y = (float)&curPlayer->_collectibleRNGs; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,2,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition (room,&VStack_12c8,(Vector *)pEStack_614,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x4: rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,3,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_12d0,&local_5e0->_pos,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = &VStack_12d8; LAB_005bb0b6: tmpVec = Room::FindFreePickupSpawnPosition(room,tmpVec,&curPlayer->_pos,40.0,0,0,0); uVar26 = 6; fVar32 = 1.4013e-44; goto LAB_005bb9aa; case (undefined1 *)0x5: case (undefined1 *)0x6: rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = &VStack_12e0; LAB_005bb8ef: tmpVec = Room::FindFreePickupSpawnPosition(room,tmpVec,&curPlayer->_pos,40.0,0,0,0); uVar26 = 1; fVar32 = 2.8026e-44; goto LAB_005bb9aa; default: goto switchD_005bac48_default; } goto switchD_005bb135_caseD_b; } switch(puVar13) { case (undefined1 *)0x0: local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_12e8,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)curPlayer,3,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x1: local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_12f0,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x1e,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_12f8,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x28,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x2: rngPtr = (RNG *)FUN_005cbd00(); VStack_608.y = (float)RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); uVar26 = ItemPool::GetCollectible(itemPool,2,uVar26,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); curPlayer = local_5e0; tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1300,&local_5e0->_pos,40.0,0,0,0); pvVar24 = (void *)VStack_608.y; goto LAB_005bb9a1; case (undefined1 *)0x3: VStack_608.y = (float)&curPlayer->_collectibleRNGs; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,2,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1308,&local_5e0->_pos,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); local_5e4 = (void *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1310,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)curPlayer,3,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x4: local_5e4 = (Entity_Player *)&DAT_00000004; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1318,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)curPlayer,3,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (Entity_Player *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x5: local_5e4 = (Entity_Player *)&DAT_00000014; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1320,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (Entity_Player *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x6: local_5e4 = (void *)0x2; pEStack_614 = (Entity_Pickup *)&curPlayer->_pos; VStack_608.y = (float)&curPlayer->_collectibleRNGs; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,2,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition (room,&VStack_1328,(Vector *)pEStack_614,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; break; case (undefined1 *)0x7: rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1330,&curPlayer->_pos,40.0,0,0,0); uVar26 = 0x21; goto LAB_005bb9a1; default: switchD_005bac48_default: KAGE_LogMessage(1,(byte *) "[warn] Blue Box, can\'t generate a specific collectible for the current stage %d\n" ); goto LAB_005bb9bd; case (undefined1 *)0x9: local_5e4 = (Entity_Player *)&curPlayer->_collectibleRNGs; Config::GetCollectibles(); cVar7 = Level::IsAltStage(); if (cVar7 == '\0') { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,3,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1348,&local_5e0->_pos,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = &VStack_1350; goto LAB_005bb0b6; } rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar11 = ItemPool::GetCollectible(itemPool,4,uVar11,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1338,&local_5e0->_pos,40.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5e0,uVar11,uVar26); rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1340,&curPlayer->_pos,40.0,0,0,0); uVar26 = 4; fVar32 = 1.4013e-44; goto LAB_005bb9aa; case (undefined1 *)0xa: Config::GetCollectibles(); cVar7 = Level::IsAltStage(); if (cVar7 != '\0') { rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = &VStack_1358; goto LAB_005bb8ef; } persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentData,0x16e); break; case (undefined1 *)0xb: break; case (undefined1 *)0xc: persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar5 = PersistentGameData::Unlocked(persistentData,0x19f); if (bVar5 == 0) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentData,0x19f); } rngPtr = (RNG *)FUN_005cbd00(); pvVar24 = (void *)RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1360,&curPlayer->_pos,40.0,0,0,0); uVar26 = 0x244; LAB_005bb9a1: fVar32 = 1.4013e-43; LAB_005bb9aa: Game::Spawn(g_game,5,(uint)fVar32,tmpVec,&g_vectorZero,(Entity *)curPlayer,uVar26, (uint)pvVar24); } switchD_005bb135_caseD_b: pEVar8 = local_600; LAB_005bb9bd: bVar5 = HasCollectible(curPlayer,0x248,0); if (((bVar5 != 0) && ((char)local_610 != '\0')) && (puVar13 = (undefined1 *)((int)&pEVar8[-1]._replacedPlayer + 3), 0 < (int)puVar13)) { do { AddWisp(curPlayer,0x129,&curPlayer->_pos,0,0); puVar13 = puVar13 + -1; } while (puVar13 != (undefined1 *)0x0); } bVar5 = HasCollectible(curPlayer,0x3b,0); if (bVar5 != 0) { itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); fVar32 = (float)ItemPool::GetCollectibleFromList (itemPool,(int *)&DAT_00b62f30,8,uVar26,0x71,1,0); VStack_608.y = fVar32; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); curPlayer = local_5e0; tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_1368,&local_5e0->_pos,40.0,0,0,0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,(uint)VStack_608.y,uVar26); piVar14 = (int *)__RTDynamicCast(); (**(code **)(*piVar14 + 0xc))(); } LAB_005bbadc: iVar9 = itemId; goto LAB_005bbae2; case 0xf: local_5d9 = HasCollectible(local_5e0,0x3b,0); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 == 0) || ((char)local_610 == '\0')) { LAB_005ba336: local_5ec = (Entity_Player *)0x40a00000; iVar9 = 8; local_5f8 = (Entity_Player *)&DAT_00000008; if (local_5d9 != 0) { iVar9 = 10; local_5ec = (Entity_Player *)0x41200000; local_5f8 = (Entity_Player *)0xa; } local_5f0 = (void *)0x0; VStack_608.y = (float)&local_5e0->_pos; pEStack_614 = (Entity_Pickup *)((float)iVar9 + 0.0); tmpVec = &local_5e0->_pos; do { if (local_5d9 == 0) { local_5e4 = (void *)0x3f800000; } else { local_5e4 = (void *)0x3fb33333; } fVar32 = ((float)((double)(int)local_5f0 + __uint_to_double_fixup[-((int)local_5f0 >> 0x1f)] ) / (float)pEStack_614) * 3.1415927; local_600 = (Entity_Player *)(fVar32 + fVar32); local_610 = (void *)sinf_wrapper((float)local_600); pEVar8 = local_600; FUN_00417150(); tmpVec2 = Vector::Vector(&VStack_1268,(float)pEVar8,(float)local_610); fStack_97c = 10.0; tmpVec2 = Vector::__mul(tmpVec2,&VStack_1278,&fStack_97c); tear = FireTear(local_5e0,tmpVec,*tmpVec2,6,(Entity *)0x0,(float)local_5e4); if (local_5d9 != 0) { Entity::Variant((Entity *)tear); iVar9 = FUN_0067d9b0(); iVar25 = Entity::Variant((Entity *)tear); if (iVar9 != iVar25) { Entity_Tear::ChangeVariant(tear,iVar9); } pBVar42 = &g_tearFlagSpectral; pBVar40 = (BitSet128 *)&DAT_00c34b50; tearFlags = Entity_Tear::TearFlags(tear,&BStack_1448); tearFlags = BitSet128::operator_or(&BStack_13f8,tearFlags,pBVar40); tearFlags = BitSet128::operator_or(&BStack_1468,tearFlags,pBVar42); Entity_Tear::SetTearFlags(tear,*tearFlags); fVar30 = (float10)Entity_Tear::Scale(tear); Entity_Tear::SetScale(tear,(float)(fVar30 + (float10)0.5)); } pcVar3 = *(code **)(*(int *)tear + 0x40); fVar30 = (float10)Entity::CollisionDamage((Entity *)tear); local_5e4 = (Entity_Player *)(float)(fVar30 + (float10)(float)local_5ec); (*pcVar3)(); local_5f0 = (Entity_Player *)((int)local_5f0 + 1); tmpVec = (Vector *)VStack_608.y; } while (local_5f0 < local_5f8); curPlayer = local_5e0; } else { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&isaacsTearsWisps,3,0xce,-1,0,0); fStack_14 = 2.52234e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)*puVar15); if (pEVar8 == curPlayer) { puVar15 = (undefined4 *)std::vector::operator_index(); (**(code **)(*(int *)*puVar15 + 0x28))(); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&isaacsTearsWisps); if (local_5d9 != 0) goto LAB_005ba336; } bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; pcVar38 = "HideItem"; goto LAB_005b8f47; case 0x10: if (local_5e0->_variant == 0) { pEVar8 = (Entity_Player *)FUN_005cbd00(); local_5ec = pEVar8; FUN_005cbe20(); fStack_14 = 0.0; FUN_00424510(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,1); local_5e4 = (Entity_Player *)0x0; level = (Level *)Config::GetCollectibles(); iVar9 = Level::GetRoomCount(level); if (0 < iVar9) { iVar9 = 0; do { room = (Room *)Config::GetCollectibles(); iVar25 = Room::GetTopLeftPos(room); puVar15 = (undefined4 *)(iVar9 + iVar25); if (*(int *)(iVar9 + 0x10 + iVar25) != 0) { Config::GetCollectibles(); iVar25 = FUN_004f8930(); if ((puVar15[3] == iVar25) && (((iVar25 = *(int *)(puVar15[4] + 8), iVar25 == 4 || (iVar25 == 7)) || (iVar25 == 8)) )) { pvStack_670 = (void *)*puVar15; std::set::find(); std::iterator_copy(auStack_724,auStack_bb0); cVar7 = FUN_00557bb0(); if (cVar7 != '\0') { std::set::insert(); std::vector::push_back(); } } } iVar9 = iVar9 + 0xb8; puVar13 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar13; level = (Level *)Config::GetCollectibles(); iVar25 = Level::GetRoomCount(level); } while ((int)puVar13 < iVar25); pEVar8 = local_5ec; } level = (Level *)Config::GetCollectibles(); bVar5 = Level::IsNextStageAvailable(level); if (bVar5 != 0) { level = (Level *)Config::GetCollectibles(); roomDesc = Level::GetRoomByIdx(level,-2,-1); if (roomDesc->Data != (void *)0x0) { uStack_954 = 0xfffffffe; std::vector::push_back(); } uVar26 = RNG::RandomInt((RNG *)pEVar8,100); if (uVar26 == 0) { level = (Level *)Config::GetCollectibles(); roomDesc = Level::GetRoomByIdx(level,-6,-1); if (roomDesc->Data != (void *)0x0) { uStack_958 = 0xfffffffa; std::vector::push_back(); } } } iVar9 = std::vector::size(auStack_708); if (iVar9 != 0) { uVar26 = std::vector::size(auStack_708); RNG::RandomInt((RNG *)pEVar8,uVar26); Config::GetCollectibles(); FUN_00428ae0(); piVar14 = (int *)FUN_0042c810(); iVar9 = *piVar14; piVar14 = (int *)FUN_0042c810(); Game::StartRoomTransition(g_game,*piVar14,-1,3,local_5e0,(iVar9 >> 0x1f & 1U) - 1); SoundEffects::PlayWithFartOverride(0x390,1.0,2,0,1.0); } FID_conflict__Tidy(auStack_708); fStack_14 = -NAN; FUN_00424420(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x11: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0xaf,3.0,2,0,1.0); tmpVec = (Vector *)FUN_0058e240(); fStack_960 = 2.0; Vector::__mul(tmpVec,&VStack_a4c,&fStack_960); uVar26 = Random(); Game::Spawn(g_game,1000,2,playerPos,&VStack_a4c,(Entity *)0x0,3,uVar26); iVar9 = Isaac::Random(3); local_5ec = (Entity_Player *)(iVar9 + 2); iVar25 = Isaac::Random(6); local_5e4 = (Entity_Player *)0x0; local_5f0 = (Entity_Player *) ((((Entity_Player *)(iVar9 + 2))->_sprite)._filename._buf + iVar25 + -0x42); if (0 < (int)local_5f0) { do { fVar32 = random_float(); tmpVec = Vector::Rotated(&VStack_a4c,aVStack_1210,fVar32 * 20.0 - 10.0); fStack_964 = random_float(); Vector::__mul(tmpVec,&VStack_a54,&fStack_964); Vector::__add(playerPos,&VStack_c30,&VStack_a54); uVar26 = Random(); pEVar8 = local_5e4; uVar11 = 99; if ((int)local_5e4 < (int)local_5ec) { uVar11 = 0; } tmpEntity = Game::Spawn(g_game,1000,5,&VStack_c30,&VStack_a54,(Entity *)0x0,uVar11,uVar26) ; (**(code **)(*(int *)tmpEntity + 0xc))(); local_5e4 = (Entity_Player *)&pEVar8->field_0x1; } while ((int)local_5e4 < (int)local_5f0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } } goto LAB_005b3e24; case 0x12: isAddTempEffect = '\0'; local_5d9 = bVar5; break; case 0x13: SetItemState(local_5e0); itemConfigDb = Isaac::GetItemConfig(); bVar5 = 0; itemConfig = Config::GetNullItem(itemConfigDb,0x1e); AddCostume(local_5e0,itemConfig,bVar5); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x14: if (local_5e0->_variant == 0) { if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } FUN_005cba40(); fStack_14 = 3.08286e-44; Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&diplopiaPickups,5,-1,-1,0,0); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x17); local_5ec = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5e4 = pEVar8; iVar9 = Entity::Variant((Entity *)pEVar8); if (iVar9 == 100) { iVar9 = Entity::SubType(); if ((iVar9 != 0x15b) && (iVar9 = Entity::SubType((Entity *)pEVar8), iVar9 != 0)) goto LAB_005bbc3f; } else { bVar5 = Entity_Pickup::CanJeraDuplicate((Entity_Pickup *)pEVar8); if (bVar5 != 0) { LAB_005bbc3f: fVar32 = (float)Entity::SubType((Entity *)pEVar8); iVar9 = Entity::Variant((Entity *)pEVar8); if (iVar9 == 0x15e) { fVar32 = 0.0; } VStack_608.y = fVar32; uVar26 = Entity::InitSeed((Entity *)pEVar8); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_ce0); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_ce8,tmpVec,40.0,0,0,0); uVar11 = Entity::Variant((Entity *)local_5e4); pEVar16 = (Entity_Pickup *) Game::Spawn(g_game,5,uVar11,tmpVec,&g_vectorZero,(Entity *)local_5e0, (uint)VStack_608.y,uVar26); pEVar8 = local_5e4; bVar5 = FUN_005b1a00(); Entity_Pickup::SetForceBlind(pEVar16,bVar5); iVar9 = Entity_Pickup::GetAlternatePedestal((Entity_Pickup *)pEVar8); Entity_Pickup::SetAlternatePedestal(pEVar16,iVar9); FUN_005b19a0(); FUN_005b1990(); SoundEffects::PlayWithFartOverride(0x425,1.0,2,0,1.0); iVar9 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); if (0 < iVar9) { uStack_984 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); std::set::find(); std::iterator_copy(auStack_734,auStack_c90); cVar7 = FUN_00557bb0(); if (cVar7 == '\0') { FUN_005cba30(); FUN_005b1970(); } else { iStack_988 = Entity_Pickup::AssignOptionsIndex(pEVar16); uStack_98c = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); FUN_005cbfa0(); FUN_005cbfc0(); } } } } puVar27 = &local_5ec->field_0x1; local_5ec = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); curPlayer = local_5e0; } if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&diplopiaWisps,3,0xce,-1,0,0); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x18); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); bVar36 = 0; bVar5 = 0; tmpVec = &curPlayer->_pos; iVar9 = Entity::SubType((Entity *)*puVar15); AddWisp(curPlayer,iVar9,tmpVec,bVar5,bVar36); uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } EntityList_Query::~EntityList_Query(&diplopiaWisps); } EntityList_Query::~EntityList_Query(&diplopiaPickups); fStack_14 = -NAN; FUN_00436fb0(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x15: if (local_5e0->_variant == 0) { pEStack_614 = (Entity_Pickup *)GetPill(local_5e0); if (pEStack_614 != (Entity_Pickup *)0x0) { SoundEffects::PlayWithFartOverride(0x366,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&placeboFamiliars,3,-1,-1,1,0); fStack_14 = 3.50325e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); VStack_608.y = (float)*puVar15; pEVar8 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)*puVar15); if (pEVar8 == curPlayer) { Entity_Familiar::farting_baby_fart((Entity_Familiar *)VStack_608.y); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } itemPool = (ItemPool *)Game::GetItemPool(g_game); pEVar16 = pEStack_614; local_5e4 = (Entity_Player *)ItemPool::GetPillEffect(itemPool,(uint)pEStack_614,curPlayer); Isaac::GetItemConfig(); iVar9 = Config::GetPillEffect(); if (((((flags & 4) != 0) && (-1 < slot)) && (curPlayer->_activeDesc[slot]._item == 0x15c)) && (iVar9 != 0)) { curPlayer->_activeDesc[slot]._varData = *(int *)(iVar9 + 0x48); } UsePill(); queryList = &placeboFamiliars; curPlayer->_wildCardItemType = 0; curPlayer->_wildCardItem = (int)local_5e4; curPlayer->_wildCardVarData = (int)pEVar16; LAB_005bc1ec: fStack_14 = -NAN; EntityList_Query::~EntityList_Query(queryList); } goto LAB_005bc1f8; } goto LAB_005b3e24; case 0x16: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x429,1.0,2,0,1.0); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,100); if ((int)uVar26 < 0x34) { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,aVStack_d00,&curPlayer->_pos,40.0,0,0,0); uVar11 = 1; } else if ((int)uVar26 < 0x3a) { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_d08,&curPlayer->_pos,40.0,0,0,0); uVar11 = 2; } else { if (0x3b < (int)uVar26) goto LAB_005bc04b; uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_d10,&curPlayer->_pos,40.0,0,0,0); uVar11 = 3; } Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)curPlayer,uVar11,uVar26); SoundEffects::PlayWithFartOverride(0x42a,1.0,2,0,1.0); LAB_005bc045: iVar9 = itemId; goto LAB_005bc04b; } goto LAB_005bc067; case 0x17: ::Color::Color(aCStack_44c); curPlayer = local_5e0; tmpVec = &local_5e0->_pos; Game::Fart(g_game,tmpVec,160.0,(Entity *)local_5e0,2.0,0,color_02); Game::ButterBeanFart(g_game,tmpVec,200.0,(Entity *)curPlayer,0,0); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xca,&curPlayer->_pos,&g_vectorZero,(Entity *)curPlayer,0, uVar26); Entity::SetTargetPosition(tmpEntity,curPlayer->_pos); (**(code **)(*(int *)tmpEntity + 0xc))(); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { FUN_005ca880(); } local_5d9 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); local_5d9 = (byte)isShowAnim; break; } goto LAB_005bc073; case 0x18: goto LAB_005b7f60; case 0x19: if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); FUN_00428a60(); local_5e4 = (Entity_Player *)FUN_0041b690(); iVar25 = 1; local_5d9 = 0; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); iVar9 = std::vector::size(pvVar24); if (iVar9 < 2) { LAB_005bc473: if (local_5e4 < (Entity_Player *)&DAT_0000003c) { TemporaryEffects::AddCollectibleEffect(&curPlayer->_temporaryeffects,0x71,1,1); } } else { do { Isaac::GetItemConfig(); Config::GetCollectibles(); puVar15 = (undefined4 *)FUN_0042c810(); if (((((void *)*puVar15 != (void *)0x0) && (bVar5 = Item::HasTags((void *)*puVar15,0x8000000), bVar5 == 0)) && (iVar9 = GetCollectibleNum(curPlayer,iVar25,0), 0 < iVar9)) && (bVar5 = ItemConfig::IsValidCollectible(iVar25), bVar5 != 0)) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,iVar25); if ((itemConfig != (ItemConfig_Item *)0x0) && (itemConfig->type == 4)) { local_5e4 = (Entity_Player *)&local_5e4->field_0x1; if (&DAT_0000003c < local_5e4) break; TemporaryEffects::AddCollectibleEffect(&curPlayer->_temporaryeffects,iVar25,1,1); local_5d9 = 1; } } iVar25 = iVar25 + 1; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); iVar9 = std::vector::size(pvVar24); } while (iVar25 < iVar9); if (local_5d9 == 0) goto LAB_005bc473; } if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&friendsWisps,3,0xce,-1,0,0); fStack_14 = 3.64338e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); bVar36 = 0; bVar5 = 0; tmpVec = &curPlayer->_pos; iVar9 = Entity::SubType((Entity *)*puVar15); familiar = AddWisp(curPlayer,iVar9,tmpVec,bVar5,bVar36); if (familiar != (Entity_Familiar *)0x0) { FUN_005b18f0(); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } familiar = AddWisp(curPlayer,0x165,&curPlayer->_pos,0,0); if (familiar != (Entity_Familiar *)0x0) { FUN_005b18f0(); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&friendsWisps); } fVar32 = 1.17709e-42; goto LAB_005b743f; } goto LAB_005b3e24; case 0x1a: SetItemState(local_5e0); AnimateCollectible(local_5e0,itemId,(byte *)"LiftItem",(byte *)"PlayerPickupSparkle"); fVar32 = 1.43213e-42; goto LAB_005b743f; case 0x1b: local_5d9 = HasCollectible(local_5e0,0x3b,0); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&detonatorTears,2,-1,-1,0,0); fStack_14 = 3.78351e-44; pEVar8 = (Entity_Player *)0x0; local_5ec = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); cVar7 = Entity::IsDead((Entity *)*puVar15); if (cVar7 == '\0') { SoundEffects::PlayWithFartOverride(0x427,1.0,2,0,1.0); puVar15 = (undefined4 *)std::vector::operator_index(); (**(code **)(*(int *)*puVar15 + 0x28))(); fVar32 = random_float(); local_5f0 = (Entity_Player *)0x0; pEStack_614 = (Entity_Pickup *)(fVar32 * 360.0 - 180.0); do { tmpVec = Vector::FromAngle(&VStack_d18,(float)local_5f0 + (float)pEStack_614); fStack_990 = curPlayer->_shotspeed * 10.0; Vector::__mul(tmpVec,&VStack_9ec,&fStack_990); fVar31 = VStack_9ec.y; fVar32 = VStack_9ec.x; if (local_5d9 == 0) { local_5e4 = (Entity_Player *)0x3f800000; } else { local_5e4 = (Entity_Player *)0x3fb33333; } puVar15 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar15,&VStack_d20); curPlayer = local_5e0; VVar4.y = fVar31; VVar4.x = fVar32; tear = FireTear(local_5e0,tmpVec,VVar4,6,(Entity *)0x0,(float)local_5e4); puVar15 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar15,&VStack_d28); Entity::SetTargetPosition((Entity *)tear,*tmpVec); if (local_5d9 != 0) { Entity::Variant((Entity *)tear); iVar9 = FUN_0067d9b0(); iVar25 = Entity::Variant((Entity *)tear); if (iVar9 != iVar25) { Entity_Tear::ChangeVariant(tear,iVar9); } pBVar42 = &g_tearFlagSpectral; pBVar40 = (BitSet128 *)&DAT_00c34b50; tearFlags = Entity_Tear::TearFlags(tear,&BStack_1478); tearFlags = BitSet128::operator_or(&BStack_13a8,tearFlags,pBVar40); tearFlags = BitSet128::operator_or(&BStack_1398,tearFlags,pBVar42); Entity_Tear::SetTearFlags(tear,*tearFlags); pcVar3 = *(code **)(*(int *)tear + 0x40); fVar30 = (float10)Entity::CollisionDamage((Entity *)tear); VStack_608.y = (float)(fVar30 + (float10)5.0); (*pcVar3)(); fVar30 = (float10)Entity_Tear::Scale(tear); Entity_Tear::SetScale(tear,(float)(fVar30 + (float10)0.5)); curPlayer = local_5e0; } local_5f0 = (Entity_Player *)((float)local_5f0 + 60.0); } while ((float)local_5f0 < 360.0); pEVar8 = local_5ec; } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5ec = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); } if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&detonatorTears); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x1c: if (local_5e0->_variant == 0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7f958) && (_Init_thread_header(), DAT_00c7f958 == -1)) { FUN_00424510(); _atexit(FUN_00b15580); _Init_thread_footer(); } if ((*(int *)(*(int *)pvVar24 + 0xc) < DAT_00c7f968) && (_Init_thread_header(), DAT_00c7f968 == -1)) { FUN_00424510(); _atexit(FUN_00b15570); _Init_thread_footer(); } memset(&DAT_00c7f980,0xff,0x1c0); cVar7 = FUN_004178f0(); if (cVar7 == '\0') { uVar26 = 0; piVar14 = &DAT_00b62d6c; do { if ((char)piVar14[-1] == '\0') { WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&DAT_00c7f95c,uVar26,*piVar14,0); } WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&DAT_00c7f96c,uVar26,*piVar14,0); uVar26 = uVar26 + 1; piVar14 = piVar14 + 4; } while (uVar26 < 0x1d); } Level::GetCurrentRoom((Level *)g_game); iVar9 = EntityList::Size(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_5f0 = (Entity_Player *)Room::GetGridHeight(room); uVar11 = 0x11; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); RNG::game_constructor(&d12Rng,uVar26,uVar11); fStack_14 = 3.92364e-44; local_5f0 = (Entity_Player *)((int)local_5f0 * iVar9); local_5e4 = (Entity_Player *)0x0; if (0 < (int)local_5f0) { do { pEVar8 = local_5e4; room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(room,(uint)pEVar8); if (gridEntity == (GridEntity *)0x0) goto switchD_005bca27_caseD_5; uVar17 = GridEntity::GetType(); switch(uVar17) { case 2: case 3: case 4: case 6: case 0xb: case 0x16: case 0x18: case 0x19: case 0x1b: iVar9 = FUN_00499db0(); if (iVar9 != 0) goto switchD_005bca27_caseD_8; break; case 8: switchD_005bca27_caseD_8: bVar29 = true; goto LAB_005bca51; case 9: case 10: switchD_005bca27_caseD_9: bVar29 = false; LAB_005bca51: room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar25 = 1; iVar9 = 0; fVar32 = 8.42964e-39; Room::RemoveGridEntityImmediate(room,(int)pEVar8,0,1); d12Picker = (WeightedOutcomePicker *)&DAT_00c7f95c; if (bVar29) { d12Picker = (WeightedOutcomePicker *)&DAT_00c7f96c; } uVar11 = 0x23; uVar26 = RNG::Next(&d12Rng); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),uVar26,uVar11); rng_02._shift1 = (int)pEVar8; rng_02._seed = (int)fVar32; rng_02._shift2 = iVar9; rng_02._shift3 = iVar25; uVar26 = WeightedOutcomePicker::PickOutcome(d12Picker,rng_02); *(char *)&local_5e4[0x527]._firedTearCount = (char)uVar26; pEVar8 = local_5e4; break; case 0xc: case 0xe: iVar9 = FUN_00499db0(); if (iVar9 != 0) goto switchD_005bca27_caseD_9; } switchD_005bca27_caseD_5: local_5e4 = (Entity_Player *)&pEVar8->field_0x1; } while ((int)local_5e4 < (int)local_5f0); } Level::GetCurrentRoom((Level *)g_game); local_5ec = (Entity_Player *)Room::GetEntities(); pEVar8 = (Entity_Player *)0x0; local_5f8 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { tmpEntity = (Entity *)FUN_00417610(); bVar5 = Entity::IsType(tmpEntity,0x60,-1,-1); if (bVar5 == 0) { tmpEntity = (Entity *)FUN_00417610(); fVar32 = 4.62428e-44; puVar13 = (undefined1 *)0x5bcb40; bVar5 = Entity::IsType(tmpEntity,0x21,-1,-1); if (bVar5 == 0) { LAB_005bcb82: tmpEntity = (Entity *)FUN_00417610(); fVar32 = 4.09179e-43; puVar13 = (undefined1 *)0x5bcb9a; bVar5 = Entity::IsType(tmpEntity,0x124,-1,-1); if (bVar5 != 0) { tmpEntity = (Entity *)FUN_00417610(); iVar9 = Entity::EntityCollisionClass(tmpEntity); if (iVar9 != 0) goto switchD_005bcb6f_caseD_0; } } else { tmpEntity = (Entity *)FUN_00417610(); iVar9 = Entity::EntityCollisionClass(tmpEntity); if (iVar9 == 0) goto LAB_005bcb82; tmpEntity = (Entity *)FUN_00417610(); uVar17 = Entity::Variant(tmpEntity); switch(uVar17) { case 0: case 1: switchD_005bcb6f_caseD_0: local_5e4 = (Entity_Player *)0x0; break; case 2: case 3: local_5e4 = (Entity_Player *)0x1; break; default: goto switchD_005bcb6f_default; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpEntity = (Entity *)FUN_00417610(); tmpVec = Entity::Position(tmpEntity,&VStack_d30); fVar31 = (float)Room::GetGridIndex(room,tmpVec); VStack_608.y = fVar31; if ((-1 < (int)fVar31) && ((&DAT_00c7f980)[(int)fVar31] == -1)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(room,(uint)fVar31); if (gridEntity != (GridEntity *)0x0) { GridEntity::GetType(); cVar7 = is_grid_type_floor_special(); if (cVar7 != '\0') goto switchD_005bcb6f_default; room = (Room *)Level::GetCurrentRoom((Level *)g_game); puVar13 = &LAB_005bcc53; Room::RemoveGridEntityImmediate(room,(int)fVar31,0,0); fVar32 = fVar31; } iVar9 = 0x5bcc5f; piVar14 = (int *)FUN_00417610(); iVar25 = 0x5bcc68; (**(code **)(*piVar14 + 0x28))(); d12Picker = (WeightedOutcomePicker *)&DAT_00c7f95c; if (local_5e4 != (Entity_Player *)0x0) { d12Picker = (WeightedOutcomePicker *)&DAT_00c7f96c; } uVar11 = 0x23; uVar26 = RNG::Next(&d12Rng); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),uVar26,uVar11); rng_03._shift1 = (int)fVar32; rng_03._seed = (int)puVar13; rng_03._shift2 = iVar9; rng_03._shift3 = iVar25; uVar26 = WeightedOutcomePicker::PickOutcome(d12Picker,rng_03); *(char *)((int)VStack_608.y + 0xc7f980) = (char)uVar26; pEVar8 = local_5f8; } } } else { tmpEntity = (Entity *)FUN_00417610(); iVar9 = Entity::Parent(tmpEntity); if (iVar9 == 0) { piVar14 = (int *)FUN_00417610(); (**(code **)(*piVar14 + 0x28))(); } } switchD_005bcb6f_default: pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5f8 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); } iVar9 = 0; pEVar8 = local_5f0; if (0 < (int)local_5f0) { do { if ((&DAT_00c7f980)[iVar9] != -1) { FUN_005c7bf0(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetGridPosition(room,&d12GridPos,iVar9); if (d12GridType < 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar26 = RNG::Next(&d12Rng); Room::SpawnGridEntity(room,iVar9,1,1000,uVar26,0); uVar26 = RNG::Next(&d12Rng); Game::Spawn(g_game,-d12GridType,d12GridVariant,&d12GridPos,&g_vectorZero,(Entity *)0x0 ,0,uVar26); LAB_005bcdcc: uVar26 = Random(); Game::Spawn(g_game,1000,0xf,&d12GridPos,&g_vectorZero,(Entity *)0x0,0,uVar26); } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar26 = RNG::Next(&d12Rng); Room::SpawnGridEntity(room,iVar9,d12GridType,d12GridVariant,uVar26,0); if (d12GridType != 0xe) goto LAB_005bcdcc; } pEVar8 = local_5f0; } pEVar34 = local_5f0; iVar9 = iVar9 + 1; } while (iVar9 < (int)pEVar8); uVar26 = 0; do { if ((&DAT_00c7f980)[uVar26] != -1) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(room,uVar26); if (gridEntity != (GridEntity *)0x0) { (**(code **)(*(int *)gridEntity + 4))(); } } uVar26 = uVar26 + 1; } while ((int)uVar26 < (int)pEVar34); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::InvalidatePickupVision(room); if ((char)isShowAnim != '\0') { IsLocalPlayer(local_5e0); SoundEffects::PlayWithFartOverride(0x38e,(float)pEVar10,2,0,1.0); AnimateCollectible(local_5e0,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } fStack_14 = -NAN; guard_check_icall(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x1d: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x428,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist (roomEntities,&razorEffects,1000,0x52,*(int *)&curPlayer->field_0x1ae0,0,0); fStack_14 = 4.06377e-44; iVar9 = EntityList::Size(); if (iVar9 != 0) { iVar9 = EntityList::Size(); if (iVar9 != 0) { uVar26 = 0; do { puVar15 = (undefined4 *)std::vector::operator_index(); Entity::Die((Entity *)*puVar15); uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); playerPos = &curPlayer->_pos; } } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&razorSpawnPos,playerPos,0.0,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetGridIndex(room,&razorSpawnPos); VStack_608.y = (float)Config::GetCollectibles(); HasCollectible(curPlayer,0x248,0); FUN_0074a280(); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x52,&razorSpawnPos,&g_vectorZero,(Entity *)curPlayer, *(uint *)&curPlayer->field_0x1ae0,uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&razorSpawnPos,&g_vectorZero,(Entity *)0x0,3,uVar26); FUN_00435cd0(); local_5e4 = *(Entity_Player **)(*(int *)tmpEntity + 0x3c); ::Color::Color(); (*(code *)local_5e4)(); Isaac::Random(4); FUN_0043eea0(); (**(code **)(*(int *)tmpEntity + 0xc))(); SoundEffects::PlayWithFartOverride(0x48,1.0,2,0,1.0); uVar26 = *(int *)&curPlayer->field_0x1ae0 + 1U & 0x80000001; if ((int)uVar26 < 0) { uVar26 = (uVar26 - 1 | 0xfffffffe) + 1; } *(uint *)&curPlayer->field_0x1ae0 = uVar26; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&razorEffects); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x1e: rngPtr = (RNG *)FUN_005cbd00(); fVar32 = RNG::RandomFloat(rngPtr); curPlayer->_d8DamageModifier = fVar32; rngPtr = (RNG *)FUN_005cbd00(); fVar32 = RNG::RandomFloat(rngPtr); curPlayer->_d8SpeedModifier = fVar32; rngPtr = (RNG *)FUN_005cbd00(); fVar32 = RNG::RandomFloat(rngPtr); curPlayer->_d8RangeModifier = fVar32; rngPtr = (RNG *)FUN_005cbd00(); fVar32 = RNG::RandomFloat(rngPtr); curPlayer->_d8FireDelayModifier = fVar32; iVar9 = 5; do { local_5e4 = (Entity_Player *) ((2.0 - (curPlayer->_d8DamageModifier + curPlayer->_d8SpeedModifier + curPlayer->_d8RangeModifier + curPlayer->_d8FireDelayModifier)) * 0.25); fVar32 = Math::clamp(0.0,1.0,curPlayer->_d8DamageModifier + (float)local_5e4); curPlayer->_d8DamageModifier = fVar32; fVar32 = Math::clamp(0.0,1.0,(float)local_5e4 + curPlayer->_d8SpeedModifier); curPlayer->_d8SpeedModifier = fVar32; fVar32 = Math::clamp(0.0,1.0,(float)local_5e4 + curPlayer->_d8RangeModifier); curPlayer->_d8RangeModifier = fVar32; fVar32 = Math::clamp(0.0,1.0,(float)local_5e4 + curPlayer->_d8FireDelayModifier); curPlayer->_d8FireDelayModifier = fVar32; iVar9 = iVar9 + -1; } while (iVar9 != 0); fVar31 = curPlayer->_d8DamageModifier; fVar39 = 0.5; fVar35 = fVar39; if (0.5 <= fVar31) { fVar35 = fVar31; fVar32 = fVar31; } curPlayer->_d8DamageModifier = fVar31 + fVar35; fVar31 = curPlayer->_d8SpeedModifier; fVar35 = fVar39; if (0.5 <= fVar31) { fVar35 = fVar31; fVar32 = fVar31; } curPlayer->_d8SpeedModifier = fVar31 + fVar35; fVar31 = curPlayer->_d8RangeModifier; fVar35 = fVar39; if (0.5 <= fVar31) { fVar35 = fVar31; fVar32 = fVar31; } curPlayer->_d8RangeModifier = fVar31 + fVar35; fVar31 = curPlayer->_d8FireDelayModifier; if (0.5 <= fVar31) { fVar39 = fVar31; fVar32 = fVar31; } curPlayer->_d8FireDelayModifier = fVar31 + fVar39; curPlayer->_cacheFlags = curPlayer->_cacheFlags | 0x1b; EvaluateItems(); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&d8Wisps,3,0xce,0x196,0,0); fStack_14 = 4.2039e-44; iVar9 = EntityList::Size(); if (iVar9 != 0) { uVar26 = 0; do { std::vector::operator_index(); puVar15 = (undefined4 *)std::vector::operator_index(); rngPtr = (RNG *)Entity::GetDropRNG((Entity *)*puVar15); RNG::Next(rngPtr); FUN_005b15a0(); uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&d8Wisps); } bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; IsLocalPlayer(curPlayer); SoundEffects::PlayWithFartOverride(0x38e,fVar32,2,0,1.0); goto LAB_005b8b7d; case 0x1f: if (local_5e0->_variant == 0) { Config::GetCollectibles(); FUN_00428ae0(); Config::GetCollectibles(); iVar9 = Level::GetNonCompleteRoomIndex(); if (iVar9 == -1) { level = (Level *)Config::GetCollectibles(); Level::InitializeDevilAngelRoom(level,0,0); } Game::StartRoomTransition(g_game,iVar9,-1,3,curPlayer,-1); } goto switchD_005bfbd8_caseD_11d; case 0x20: Game::CharmFart(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x21: if (local_5e0->_variant == 0) { if ((flags & 0x400) == 0) { if ((((flags & 4) != 0) && (-1 < slot)) && (local_5e0->_activeDesc[slot]._item == 0x1a6)) { iVar25 = local_5e0->_activeDesc[slot]._varData; goto LAB_005bd679; } LAB_005bd6f6: Config::GetCollectibles(); level = (Level *)Config::GetCollectibles(); Level::EnterDoor(level); FUN_00428ae0(); level = (Level *)Config::GetCollectibles(); iVar9 = Level::GetPreviousRoomIndex(level); Game::StartRoomTransition(g_game,iVar9,-1,0xc,curPlayer,-1); fVar32 = 1.20652e-42; } else { iVar25 = varData; LAB_005bd679: if (iVar25 < 3) goto LAB_005bd6f6; if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(tempEffects,0x42,1,1); musicManager = (MusicManager *)MusicManager::MusicManager(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::time_scale_update(room); MusicManager::PitchSlide(musicManager); fVar32 = 1.20792e-42; } SoundEffects::PlayWithFartOverride((int)fVar32,1.0,2,0,1.0); local_5d9 = (byte)isShowAnim; break; } goto LAB_005bc067; case 0x22: SoundEffects::PlayWithFartOverride(0x426,1.0,2,0,1.0); uVar26 = Random(); tmpVec = MusicManager::RandomVector(&VStack_d38); fStack_994 = 0.5; tmpVec = Vector::__mul(tmpVec,&VStack_d40,&fStack_994); pEVar8 = local_5e0; tmpVec = Vector::__add(&local_5e0->_pos,&VStack_d48,tmpVec); tmpEntity = Game::Spawn(g_game,0x124,1,tmpVec,&g_vectorZero,(Entity *)pEVar8,1,uVar26); uVar26 = Random(); tmpVec = Entity::Position(tmpEntity,&VStack_d50); tmpVec2 = Vector::Vector(&VStack_d58,0.0,5.0); tmpVec = Vector::__add(tmpVec,&VStack_d60,tmpVec2); tmpEntity = Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); goto LAB_005b40d0; case 0x23: if ((local_5e0->_variant != 0) || (local_5e0->_jarFlies < 1)) goto LAB_005b3e24; SoundEffects::PlayWithFartOverride(0x424,1.0,2,0,1.0); pEVar8 = local_5e0; bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 == 0) || ((char)local_610 == '\0')) { AddBlueFlies(pEVar8,pEVar8->_jarFlies,playerPos,(Entity *)0x0); } else { iVar9 = pEVar8->_jarFlies; iVar25 = iVar9 / 5; tmpVec = &local_5e0->_pos; if (0 < iVar25) { do { AddWisp(local_5e0,0x10009,tmpVec,0,0); iVar25 = iVar25 + -1; } while (iVar25 != 0); iVar9 = local_5e0->_jarFlies; } if (iVar9 % 5 != 0) { AddWisp(local_5e0,iVar9 % 5 + 0x10004,tmpVec,0,0); } } local_5e0->_jarFlies = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e24; pcVar38 = "UseItem"; curPlayer = local_5e0; iVar9 = itemId; goto LAB_005b46f0; case 0x24: if (local_5e0->_variant == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); if ((char)isShowAnim != '\0') { IsLocalPlayer(curPlayer); SoundEffects::PlayWithFartOverride(0x38e,(float)pEVar10,2,0,1.0); AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } iVar9 = GridEntity::GetVariant(); if (((iVar9 != 5) && (bVar5 = Room::IsBeastDungeon(room), bVar5 == 0)) && (((iVar9 = GridEntity::GetVariant(), iVar9 != 0x10 || (iVar9 = GridEntity::GetType(), *(int *)(iVar9 + 0x10) == 0)) || ((iVar9 = GridEntity::GetType(), *(int *)(*(int *)(iVar9 + 0x10) + 0x10) != 2 && (iVar9 = GridEntity::GetType(), *(int *)(*(int *)(iVar9 + 0x10) + 0x10) != 3)))))) { Config::GetCollectibles(); iVar9 = EntityPtr::Ref(); if (iVar9 != 0xd) { Level::GetCurrentRoom((Level *)g_game); Room::RespawnEnemies(); Game::room_restart_flag_set(); } } } goto switchD_005bfbd8_caseD_11d; case 0x25: if (local_5e0->_variant != 0) goto LAB_005bc067; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_d68,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x15e,tmpVec,&g_vectorZero,(Entity *)curPlayer,0,uVar26); local_5d9 = 0; if ((char)isShowAnim != '\0') { SoundEffects::PlayWithFartOverride(0x37a,1.0,2,0,1.0); AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); local_5d9 = (byte)isShowAnim; break; } goto LAB_005bc073; case 0x26: Game::GetField26614(g_game); cVar7 = FUN_00429550(); curPlayer = local_5e0; iVar9 = 0x1c2; if (cVar7 != '\0') { iVar9 = 0x96; } local_5e0->_megaBlastDuration = iVar9; bVar5 = HasCollectible(local_5e0,0x164,0); if (bVar5 != 0) { curPlayer->_megaBlastDuration = (int)((double)curPlayer->_megaBlastDuration * 1.5); } itemConfigDb = Isaac::GetItemConfig(); bVar5 = 0; itemConfig = Config::GetNullItem(itemConfigDb,0x1f); AddCostume(curPlayer,itemConfig,bVar5); goto switchD_005bfbd8_caseD_11d; case 0x27: if (local_5e0->_variant == 0) { if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar9 = Room::GetBossID(room); if (iVar9 == 0x46) { curPlayer->_planCKillCountdown = 300; } else { iVar25 = 0x159; if (iVar9 != 0x58) { iVar25 = 0x5a; } curPlayer->_planCKillCountdown = iVar25; } SoundEffects::PlayWithFartOverride(0x381,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); local_5ec = (Entity_Player *)Room::GetEntities(); pEVar8 = (Entity_Player *)0x0; local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::IsActiveEnemy((Entity *)*puVar15,0); if (bVar5 != 0) { puVar15 = (undefined4 *)std::vector::operator_index(); if ((Entity_Player *)*puVar15 != curPlayer) { puVar15 = (undefined4 *)std::vector::operator_index(); pcVar3 = *(code **)(*(int *)*puVar15 + 0x20); EntityRef::constructor(&EStack_14a0,(Entity *)local_5e0); (*pcVar3)(); curPlayer = local_5e0; pEVar8 = local_5e4; } } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5e4 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); } Level::GetCurrentRoom((Level *)g_game); Room::EmitBloodFromWalls(); Game::ShakeScreen(g_game,0x1e); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&planCWisps,3,0xce,-1,0,0); fStack_14 = 4.62428e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { std::vector::operator_index(); local_5e4 = (Entity_Player *)FUN_00435de0(); pEVar8 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)local_5e4); if (pEVar8 == curPlayer) { pcVar3 = *(code **)(*(int *)local_5e4 + 0x24); EntityRef::EntityRef(&EStack_18b8); (*pcVar3)(); curPlayer = local_5e0; } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } iVar9 = 0x20; do { bVar36 = 0; bVar5 = 0; tmpVec = Entity::Position((Entity *)curPlayer,&VStack_d90); familiar = AddWisp(curPlayer,0x1db,tmpVec,bVar5,bVar36); if (familiar == (Entity_Familiar *)0x0) break; iVar9 = iVar9 + -1; } while (-1 < iVar9); queryList = &planCWisps; goto LAB_005bc1ec; } } goto LAB_005bc1f8; case 0x28: if (local_5e0->_variant == 0) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&d1Pickups,5,-1,-1,0,0); fStack_14 = 4.34403e-44; FUN_00424510(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x20); EntityList::Size(); FUN_0042c820(); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); d1Pickup = (Entity_Pickup *)*puVar15; bVar5 = Entity_Pickup::CanReroll(d1Pickup); if ((bVar5 != 0) && (iVar9 = Entity::Variant((Entity *)d1Pickup), iVar9 != 100)) { std::vector::push_back(); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } iVar9 = std::vector::size(auStack_76c); if (iVar9 == 0) { bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(curPlayer,0x1dc,&curPlayer->_pos,0,0); } FID_conflict__Tidy(auStack_76c); queryList = &d1Pickups; goto LAB_005b8efd; } VStack_608.y = (float)&curPlayer->_collectibleRNGs; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = std::vector::size(auStack_76c); RNG::RandomInt(rngPtr,uVar26); puVar15 = (undefined4 *)FUN_0042c810(); pEVar16 = (Entity_Pickup *)*puVar15; pEStack_614 = pEVar16; local_5f0 = (Entity_Player *)Entity::Type((Entity *)pEVar16); pEVar8 = (Entity_Player *)Entity::Variant((Entity *)pEVar16); local_5e4 = pEVar8; local_5ec = (Entity_Player *)Entity::SubType((Entity *)pEVar16); if (local_5f0 == (Entity_Player *)&DAT_00000005) { cVar7 = FUN_006ee330(); if (cVar7 != '\0') { rngPtr = (RNG *)Entity::GetDropRNG((Entity *)pEVar16); uVar26 = RNG::RandomInt(rngPtr,2); pEVar8 = (Entity_Player *)((-(uint)(uVar26 != 0) & 0xfffffff6) + 0x3c); local_5e4 = pEVar8; } pEVar34 = local_5ec; if (pEVar8 == (Entity_Player *)0x12c) { if (local_5ec != (Entity_Player *)0x0) { itemConfigDb = Isaac::GetItemConfig(); cardConfig = ItemConfig::GetCard(itemConfigDb,(int)pEVar34); if (cardConfig != (ItemConfig_Card *)0x0) { if (cardConfig->cardType == 2) { Game::GetItemPool(g_game); rngPtr = (RNG *)Entity::GetDropRNG((Entity *)pEVar16); RNG::Next(rngPtr); } else { if (cardConfig->cardType == 4) goto LAB_005bdbdf; Game::GetItemPool(g_game); rngPtr = (RNG *)Entity::GetDropRNG((Entity *)pEVar16); RNG::Next(rngPtr); } local_5ec = (Entity_Player *)ItemPool::GetCard(); } } } else { local_5ec = (Entity_Player *)0x0; } LAB_005bdbdf: Entity_Pickup::UpdateLootPreview(pEVar16); } rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)pEStack_614,&VStack_d70); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_d78,tmpVec,0.0,0,0,0); curPlayer = local_5e0; Game::Spawn(g_game,(uint)local_5f0,(uint)local_5e4,tmpVec,&g_vectorZero,(Entity *)local_5e0, (uint)local_5ec,uVar26); FID_conflict__Tidy(auStack_76c); queryList = &d1Pickups; goto LAB_005b8efd; } LAB_005b8f09: bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; IsLocalPlayer(curPlayer); SoundEffects::PlayWithFartOverride(0x38e,(float)pEVar10,2,0,1.0); goto LAB_005b8f3d; case 0x29: if (local_5e0->_variant != 0) goto LAB_005bbae2; local_5d9 = 0; FUN_00424510(); fStack_14 = 5.1848e-44; Level::GetCurrentRoom((Level *)g_game); VStack_608.y = (float)Room::GetEntities(); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Type((Entity *)*puVar15); if (iVar9 == 5) { puVar15 = (undefined4 *)std::vector::operator_index(); cVar7 = Entity::IsDead((Entity *)*puVar15); if (cVar7 == '\0') { puVar15 = (undefined4 *)std::vector::operator_index(); voidPickup = (Entity_Pickup *)*puVar15; bVar5 = Entity_Pickup::CanReroll(voidPickup); if (((bVar5 != 0) && (iVar9 = Entity::Variant((Entity *)voidPickup), iVar9 == 100)) && (cVar7 = Entity_Pickup::IsShopItem(voidPickup), cVar7 == '\0')) { std::vector::push_back(); } } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } local_5ec = (Entity_Player *)0x0; if ((((curPlayer->_queuedItem)._item == (void *)0x0) || (cVar7 = Item::IsCollectible(), cVar7 == '\0')) || (bVar5 = Item::HasTags((curPlayer->_queuedItem)._item,0x8000), bVar5 != 0)) { local_5f8 = pEStack_cc8; } else { queuedItemConfig = (curPlayer->_queuedItem)._item; iStack_cd4 = (curPlayer->_queuedItem)._charge; uStack_cd0 = *(undefined4 *)&(curPlayer->_queuedItem)._flags; uStack_ccc = *(undefined4 *)&curPlayer->field_0x17d0; local_5f8 = *(Entity_Player **)&curPlayer->field_0x17d4; ClearQueueItem(curPlayer); local_5ec = queuedItemConfig; } local_5f0 = (Entity_Player *)&curPlayer->_voidedCollectibles; local_5e4 = (void *)0x0; iVar9 = std::vector::size(local_5f0); if (iVar9 != 0) { do { pfVar20 = (float *)FUN_0042c810(); fVar32 = *pfVar20; VStack_608.y = fVar32; if (fVar32 == 4.56823e-43) { if (curPlayer->_damageCooldown < 8) { pcVar3 = *(code **)(*(int *)curPlayer + 0x3c); ::Color::Color(); (*pcVar3)(); curPlayer->_damageCooldown = 8; *(int *)&curPlayer->_flags = (int)curPlayer->_flags; puVar19 = (uint *)((int)&curPlayer->_flags + 4); *puVar19 = *puVar19 | 0x10; } } else if (fVar32 != 6.68419e-43) { UseActiveItem(curPlayer,&sStack_8a8,(int)fVar32,0x43,-1,0); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,(int)VStack_608.y); AddCostume(curPlayer,itemConfig,1); } local_5e4 = (Entity_Player *)((int)local_5e4 + 1); pvVar24 = (void *)std::vector::size(&curPlayer->_voidedCollectibles); } while (local_5e4 < pvVar24); } if (curPlayer->_itemState != 0) { DischargeActiveItem(curPlayer,0,0); } if ((curPlayer->_playerType == 0xf) && (bVar5 = HasCollectible(curPlayer,0x26b,0), bVar5 != 0)) { uVar11 = 0x2f; FUN_005cbd00(); uVar26 = EntityPtr::Ref(); RNG::game_constructor(&voidRng,uVar26,uVar11); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x26); uVar26 = RNG::RandomInt(&voidRng,10); if ((uVar26 == 0) && (cVar7 = FUN_004bc660(), cVar7 == '\0')) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&voidSpawnPos,&curPlayer->_pos,40.0,0,0,0); uVar26 = FUN_0042f160(); RNG::RandomInt(&voidRng,uVar26); puVar19 = (uint *)std::vector::operator__(); uVar26 = *puVar19; uVar11 = RNG::Next(&voidRng); Game::Spawn(g_game,5,100,&voidSpawnPos,&g_vectorZero,(Entity *)local_5e0,uVar26,uVar11); FUN_005b1990(); curPlayer = local_5e0; play_sound_with_fart_seed(0xa2,1.0,2,0,1.0); uVar26 = Random(); Game::Spawn(g_game,1000,0xf,&voidSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar26); } fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x25); guard_check_icall(); } rngPtr = (RNG *)FUN_005cbd00(); RNG::Next(rngPtr); if (((local_5ec != (Entity_Player *)0x0) && (cVar7 = Item::IsCollectible(), cVar7 != '\0')) && (bVar5 = Item::HasTags(local_5ec,0x8000), bVar5 == 0)) { if ((*(int *)local_5ec == 3) && (*(int *)&local_5ec->field_0x4 != 0x20b)) { iStack_99c = *(int *)&local_5ec->field_0x4; std::vector::push_back(); } else { piStack_54 = &curPlayer->_speedModifier; piStack_50 = &curPlayer->_fireDelayModifier; piStack_4c = &curPlayer->_damageModifier; piStack_48 = &curPlayer->_tearRangeModifier; piStack_44 = &curPlayer->_shotSpeedModifier; piStack_40 = &curPlayer->_luckModifier; FUN_005cbd00(); FUN_005cbfe0(); *piStack_54 = *piStack_54 + 1; *piStack_50 = *piStack_50 + 1; if (*(int *)local_5ec != 3) { FUN_005b1490(); FUN_005cbdd0(); } } uVar26 = Random(); curPlayer = local_5e0; tmpVec = Vector::Vector(aVStack_da0,0.0,10.0); tmpVec = Vector::__add(&curPlayer->_pos,&VStack_da8,tmpVec); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); } local_5e4 = (Entity_Player *)0x0; iVar9 = std::vector::size(auStack_8cc); if (iVar9 == 0) { LAB_005bef93: pEVar8 = local_5f0; iVar9 = std::vector::size(local_5f0); if (iVar9 == 0) { fVar32 = 1.50219e-42; } else { fVar32 = 1.50079e-42; } SoundEffects::PlayWithFartOverride((int)fVar32,1.0,2,0,1.0); } else { do { puVar15 = (undefined4 *)FUN_0042c810(); pEVar8 = (Entity_Player *)*puVar15; local_5ec = pEVar8; cVar7 = Entity::Exists((Entity *)pEVar8); if (((cVar7 != '\0') && (cVar7 = Entity::IsDead((Entity *)pEVar8), cVar7 == '\0')) && ((cVar7 = Entity_Pickup::IsShopItem((Entity_Pickup *)pEVar8), cVar7 == '\0' && (((iVar9 = Entity::Variant((Entity *)pEVar8), iVar9 == 100 && (iVar9 = Entity::SubType((Entity *)pEVar8), iVar9 != 0)) && (iVar9 = Entity_Pickup::Timeout((Entity_Pickup *)pEVar8), iVar9 < 1)))))) { itemConfigDb = Isaac::GetItemConfig(); iVar9 = Entity::SubType((Entity *)local_5ec); itemConfig = ItemConfig::GetCollectible(itemConfigDb,iVar9); if ((itemConfig->type == 3) && (itemConfig->id != 0x20b)) { uStack_9a0 = Entity::SubType((Entity *)local_5ec); std::vector::push_back(); } else { piStack_6c = &curPlayer->_speedModifier; piStack_68 = &curPlayer->_fireDelayModifier; piStack_64 = &curPlayer->_damageModifier; piStack_60 = &curPlayer->_tearRangeModifier; piStack_5c = &curPlayer->_shotSpeedModifier; piStack_58 = &curPlayer->_luckModifier; FUN_005cbd00(); FUN_005cbfe0(); *piStack_6c = *piStack_6c + 1; *piStack_68 = *piStack_68 + 1; if (itemConfig->type != 3) { FUN_005b19a0(); Entity::SubType((Entity *)local_5ec); FUN_005b1490(); FUN_005cbdd0(); } } uVar26 = Random(); tmpVec = Entity::Position((Entity *)local_5ec,aVStack_db8); tmpVec2 = Vector::Vector(&VStack_dc0,0.0,10.0); tmpVec = Vector::__add(tmpVec,&VStack_dc8,tmpVec2); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); pEVar8 = local_5ec; (**(code **)(*(int *)local_5ec + 0x28))(); Entity_Pickup::RemoveOtherOptions(); fVar32 = (float)FUN_005b1960(); VStack_608.y = fVar32; if (fVar32 != -NAN) { Game::GetPlayerManager(g_game); uVar26 = PlayerManager::GetNumAlivePlayers(); if ((int)fVar32 + 1U < uVar26) { Entity::Position((Entity *)pEVar8,&VStack_c50); (**(code **)(*(int *)pEVar8 + 0x28))(); itemPool = (ItemPool *)Game::GetItemPool(g_game); pEVar8 = local_5e0; uVar26 = RNG::Next(&local_5e0->_dropRNG); uVar26 = ItemPool::GetCollectible(itemPool,2,uVar26,0,0,0); uVar11 = RNG::Next(&pEVar8->_dropRNG); tmpEntity = Game::Spawn(g_game,5,100,&VStack_c50,&g_vectorZero,(Entity *)0x0,uVar26, uVar11); FUN_006e2ff0(); (**(code **)(*(int *)tmpEntity + 0xc))(); } } local_5d9 = 1; } puVar27 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)std::vector::size(auStack_8cc); curPlayer = local_5e0; } while (puVar27 < puVar13); if (local_5d9 == 0) goto LAB_005bef93; SoundEffects::PlayWithFartOverride(0x391,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x42f,1.0,2,0,1.0); pEVar8 = local_5f0; } curPlayer = local_5e0; bVar5 = HasCollectible(local_5e0,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { local_5e4 = (Entity_Player *)0x0; iVar9 = std::vector::size(pEVar8); if (iVar9 != 0) { do { piVar14 = (int *)FUN_0042c810(); AddWisp(curPlayer,*piVar14,&curPlayer->_pos,0,0); local_5e4 = (Entity_Player *)&local_5e4->field_0x1; pEVar10 = (Entity_Player *)std::vector::size(pEVar8); } while (local_5e4 < pEVar10); } } curPlayer->_cacheFlags = curPlayer->_cacheFlags | 0x41f; EvaluateItems(); if (local_5d9 != 0) { Level::GetCurrentRoom((Level *)g_game); iVar9 = GridEntity::GetVariant(); if (iVar9 != 0xb) { Level::GetCurrentRoom((Level *)g_game); iVar9 = GridEntity::GetVariant(); if (iVar9 != 0x11) goto LAB_005bf09d; } ambush = (Ambush *)Game::GetAmbush(g_game); Ambush::StartChallenge(ambush); } LAB_005bf09d: fStack_14 = -NAN; FID_conflict__Tidy(auStack_8cc); goto LAB_005bbadc; case 0x2a: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x37f,1.0,2,0,1.0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::SetPauseTimer(room,900); Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(tempEffects,0x1de,1,1); *(undefined2 *)((int)curPlayer[1]._chargeBarSprites[0]._color._tint + 6) = 0xf0; } goto LAB_005bdf0b; case 0x2b: if (local_5e0->_variant == 0) { FlushQueueItem(local_5e0); local_5ec = (Entity_Player *)curPlayer->_trinketsID; local_5f0 = (Entity_Player *)0x2; do { uVar26 = *(uint *)local_5ec; if (uVar26 != 0) { pEStack_614 = (Entity_Pickup *)(uVar26 >> 0xf & 0xffffff01); local_5e4 = (Entity_Player *)(uVar26 & 0x7fff); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetTrinket(itemConfigDb,uVar26 & 0x7fff); std::string::c_str((curPlayer->_name)._buf); VStack_608.y = (float)local_5e0->_playerIndex; localizedName = ItemConfig_Item::GetLocalizedName(itemConfig,&sStack_27c,0x14); fStack_14 = 4.76441e-44; std::string::c_str(localizedName->_buf); KAGE_LogMessage(1,(byte *)"Adding smelted trinket %d (%s) to player %d (%s)\n"); fStack_14 = -NAN; std::string::_Tidy_deallocate(sStack_27c._buf); curPlayer = local_5e0; FUN_00721e60(); fStack_14 = 4.90454e-44; History::AddHistoryItem(&curPlayer->_history,auStack_1384); fStack_14 = -NAN; guard_check_icall(); psVar18 = (short *)FUN_0042c810(); if ((char)pEStack_614 == '\0') { *psVar18 = *psVar18 + 1; *(uint *)local_5ec = 0; } else { psVar18[1] = psVar18[1] + 1; *(uint *)local_5ec = 0; } } local_5ec = (Entity_Player *)((int)local_5ec + 4); local_5f0 = (Entity_Player *)((int)&local_5f0[-1]._replacedPlayer + 3); } while (local_5f0 != (Entity_Player *)0x0); InvalidateCoPlayerItems(curPlayer); hud = (HUD *)Game::GetHUD(g_game); HUD::mark_all_slots_dirty(hud,0,0); iVar9 = itemId; } bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; IsLocalPlayer(curPlayer); SoundEffects::PlayWithFartOverride(0x38c,(float)pEVar10,2,0,1.0); pcVar38 = "UseItem"; goto LAB_005b8b8d; case 0x2c: if (local_5e0->_variant == 0) { fVar32 = (float)local_5e0->_numBlueSpiders; iVar9 = local_5e0->_numBlueFlies; VStack_608.y = fVar32; if ((int)fVar32 + iVar9 == 0) { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,2); if (uVar26 == 0) { AddBlueSpider(); } else { AddBlueFlies(curPlayer,1,playerPos,(Entity *)0x0); } } else { if (0 < iVar9) { AddBlueFlies(local_5e0,iVar9,playerPos,(Entity *)0x0); fVar32 = (float)curPlayer->_numBlueSpiders; } if (0 < (int)fVar32) { do { AddBlueSpider(curPlayer); fVar32 = (float)((int)fVar32 + -1); } while (fVar32 != 0.0); } } Level::GetCurrentRoom((Level *)g_game); local_5f0 = (Entity_Player *)Room::GetEntities(); pEVar8 = (Entity_Player *)0x0; local_5e4 = (Entity_Player *)0x0; local_5ec = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Type((Entity *)*puVar15); if (iVar9 == 5) { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Variant((Entity *)*puVar15); if (iVar9 != 100) { std::vector::operator_index(); pEVar16 = (Entity_Pickup *)__RTDynamicCast(); cVar7 = Entity_Pickup::IsShopItem(pEVar16); if ((cVar7 == '\0') && (bVar5 = Entity_Pickup::CanReroll(pEVar16), bVar5 != 0)) { (**(code **)(*(int *)pEVar16 + 0x28))(); local_5e4 = (Entity_Player *)&local_5e4->field_0x1; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,2); if (uVar26 == 0) { Entity::Position((Entity *)pEVar16,&VStack_d80); AddBlueSpider(curPlayer); } else { tmpEntity = (Entity *)0x0; tmpVec = Entity::Position((Entity *)pEVar16,&VStack_d88); AddBlueFlies(curPlayer,1,tmpVec,tmpEntity); } } pEVar8 = local_5ec; } } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5ec = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); } bVar5 = HasCollectible(curPlayer,0x248,0); pEVar8 = local_5e4; if ((((bVar5 != 0) && ((char)local_610 != '\0')) && (0 < (int)local_5e4)) && (local_5e4 = (Entity_Player *)AddWisp(curPlayer,0x1e0,&curPlayer->_pos,0,0), local_5e4 != (Entity_Player *)0x0)) { (**(code **)(*(int *)local_5e4 + 0xc))(); FUN_00435d40(); Entity::SetField380((Entity *)local_5e4,(float)(int)pEVar8); } } goto LAB_005bdf0b; case 0x2d: if (local_5e0->_variant == 0) { piStack_3c = &local_5e0->_speedModifier; piStack_38 = &local_5e0->_fireDelayModifier; piStack_34 = &local_5e0->_damageModifier; piStack_30 = &local_5e0->_tearRangeModifier; piStack_2c = &local_5e0->_shotSpeedModifier; piStack_28 = &local_5e0->_luckModifier; VStack_608.y = (float)&local_5e0->_collectibleRNGs; FUN_005cbd00(); FUN_005cbfe0(); *piStack_3c = *piStack_3c + 1; *piStack_38 = *piStack_38 + -1; curPlayer->_cacheFlags = curPlayer->_cacheFlags | 0x41f; EvaluateItems(); TemporaryEffects::AddCollectibleEffect(&curPlayer->_temporaryeffects,0x1e1,1,1); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&dataminerCollectibles,5,100,-1,0,0); pEVar8 = (Entity_Player *)0x0; fStack_14 = 6.16571e-44; local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::SubType((Entity *)*puVar15); if (iVar9 != 0) { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Variant((Entity *)*puVar15); if (iVar9 == 100) { puVar15 = (undefined4 *)std::vector::operator_index(); Entity::SubType((Entity *)*puVar15); cVar7 = FUN_0072fe80(); if (cVar7 != '\0') goto code_r0x005c0308; } std::vector::operator_index(); FUN_004074a0(); rngPtr = (RNG *)FUN_005cbd00(); RNG::Next(rngPtr); ItemPool::CreateGlitchedCollectible(); FUN_00435cd0(); pEVar8 = local_5e4; puVar15 = (undefined4 *)std::vector::operator_index(); local_5e4 = (Entity_Player *)*puVar15; Entity_Pickup::UpdateSprite((Entity_Pickup *)local_5e4,0); FUN_004074a0(); Entity::SubType((Entity *)local_5e4); iVar9 = FUN_009e0150(); if (iVar9 != 0) { FUN_005b1920(); } } code_r0x005c0308: pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5e4 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); curPlayer = local_5e0; } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&dataminerCollectibles); } TemporaryEffects::AddCollectibleEffect(&curPlayer->_temporaryeffects,0x1a2,0,1); Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(tempEffects,0x1e1,1,1); SoundEffects::PlayWithFartOverride(0x356,1.0,2,0,1.0); local_5d9 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); local_5d9 = (byte)isShowAnim; } isAddTempEffect = '\0'; curPlayer = local_5e0; break; case 0x2e: if (local_5e0->_variant == 0) { local_5e4 = (Entity_Player *)local_5e0->_playerType; if (local_5e0->_dead != 0) goto LAB_005bc067; iVar25 = GetOtherTwin(local_5e0); if (iVar25 != 0) { tmpEntity = (Entity *)GetOtherTwin(curPlayer); cVar7 = Entity::IsDead(tmpEntity); if (cVar7 != '\0') goto LAB_005bc067; } pEVar8 = GetMainTwin(curPlayer); if (pEVar8 != curPlayer) { pEVar8 = GetMainTwin(curPlayer); UseActiveItem(pEVar8,&sStack_8a6,iVar9,flags,-1,0); local_5d9 = (byte)isShowAnim; break; } uVar26 = curPlayer->_playerType - 0x15; if (local_5e4 == (Entity_Player *)&DAT_00000011) { local_5e4 = (Entity_Player *)0x10; } FUN_00424510(); fStack_14 = 5.04467e-44; FUN_005cbb60(); pEVar8 = (Entity_Player *)((-(uint)(0x13 < uVar26) & 0xffffffeb) + 0x15); VStack_608.y = (float)pEVar8; pEVar10 = (Entity_Player *)((-(uint)(0x13 < uVar26) & 0xffffffec) + 0x28); if (pEVar8 < pEVar10) { do { FUN_00417910(); fVar32 = (float)FUN_0069bd10(); VStack_608.y = fVar32; if ((fVar32 != 0.0) && (*(int *)((int)fVar32 + 0xe8) != -2)) { if (-1 < *(int *)((int)fVar32 + 0xe8)) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar5 = PersistentGameData::Unlocked (persistentData,*(int *)((int)VStack_608.y + 0xe8)); if (bVar5 == 0) goto LAB_005be4fe; } if (pEVar8 != local_5e4) { pEStack_998 = pEVar8; std::vector::push_back(); } } LAB_005be4fe: pEVar8 = (Entity_Player *)&pEVar8->field_0x1; } while ((int)pEVar8 < (int)pEVar10); curPlayer = local_5e0; } local_609 = HasCollectible(curPlayer,0x3b,0); cVar7 = FUN_004bc660(); if (cVar7 == '\0') { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = std::vector::size(auStack_760); RNG::RandomInt(rngPtr,uVar26); pfVar20 = (float *)FUN_0042c810(); VStack_608.y = *pfVar20; Config::GetCollectibles(); iVar9 = FUN_0042c7f0(); if (0 < iVar9) { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,2); if (uVar26 == 0) { for (local_5e4 = (Entity_Player *)(iVar9 + -1); -1 < (int)local_5e4; local_5e4 = (Entity_Player *)((int)&local_5e4[-1]._replacedPlayer + 3)) { Config::GetCollectibles(); iVar9 = FUN_005cbe00(); if (*(char *)(iVar9 + 4) != '\0') { TryRemoveSmeltedTrinket(curPlayer,*(uint *)(iVar9 + 8)); break; } Config::GetCollectibles(); iVar9 = FUN_005cbe00(); iVar9 = *(int *)(iVar9 + 8); if ((((iVar9 != 0x1e2) && (iVar9 != curPlayer->_activeDesc[0]._item)) && (bVar5 = CanRerollCollectible(curPlayer,iVar9,1), bVar5 != 0)) && (piVar14 = (int *)FUN_0042c810(), 0 < *piVar14)) { RemoveCollectibleByHistoryIndex(curPlayer,(int)local_5e4,1); break; } } } } ChangePlayerType(curPlayer,(int)VStack_608.y,0); if (local_609 != 0) { AddCollectible(curPlayer,0x33,0,1,0,0,0); } } if (((char)isShowAnim == '\0') || (iVar9 = GetOtherTwin(curPlayer), iVar9 == 0)) { iVar9 = itemId; } else { pEVar8 = (Entity_Player *)GetOtherTwin(curPlayer); iVar9 = itemId; AnimateCollectible(pEVar8,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { bVar36 = 0; bVar5 = 0; tmpVec = &curPlayer->_pos; rngPtr = (RNG *)FUN_005cbd00(); iVar25 = Entity_Familiar::GetRandomWisp(rngPtr); AddWisp(curPlayer,iVar25,tmpVec,bVar5,bVar36); } itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x27,0,(Entity_Player *)0x0); fStack_14 = -NAN; FID_conflict__Tidy(auStack_760); } goto LAB_005bbae2; case 0x2f: if (local_5e0->_variant == 0) { if (local_5e0->_hasGoldenBomb == 0) { if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } } else { RemoveGoldenBomb(); useResult = useResult & 0xff; } level = (Level *)Config::GetCollectibles(); Game::GetField26614(g_game); cVar7 = FUN_00429550(); pEVar8 = (Entity_Player *)0x0; if (cVar7 != '\0') { pEVar8 = curPlayer; } Level::StartMamaMega(level,&curPlayer->_pos,pEVar8); goto LAB_005bc045; } goto LAB_005bc04b; case 0x30: tmpVec = &local_5e0->_pos; Game::ButterBeanFart(g_game,tmpVec,120.0,(Entity *)local_5e0,1,0); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(roomEntities,&nearbyEntities,tmpVec,80.0,8); fStack_14 = 5.46506e-44; local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { pEVar8 = (Entity_Player *)0x0; do { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::IsDescendantOf((Entity *)*puVar15,(Entity *)curPlayer); if (bVar5 == 0) { puVar15 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar15; EntityRef::constructor(&EStack_14c8,(Entity *)curPlayer); Entity::AddPoison(tmpEntity,&EStack_14c8,0x3c,0.0,0); pEVar8 = local_5e4; } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5e4 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&nearbyEntities); } uVar26 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x3d,&curPlayer->_pos,&g_vectorZero,(Entity *)curPlayer,0, uVar26); Entity::SetParent((Entity *)effect,(Entity *)curPlayer); Entity_Effect::SetRadii(effect,curPlayer->_size,90.0); Entity_Effect::SetTimeout(effect,10); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x31: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x353,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&pennyPickups,5,-1,-1,0,0); fStack_14 = 5.60519e-44; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); Level::GetCurrentRoom((Level *)g_game); uVar11 = Room::GetDecorationSeed(); uVar26 = uVar26 ^ uVar11; if (uVar26 == 0) { uVar26 = 1; } RNG::game_constructor(&RStack_254,uVar26,4); fStack_14._0_1_ = 0x29; pEVar8 = (Entity_Player *)RNG::RandomInt(tammyBomb,2); fStack_14._0_1_ = 0x28; guard_check_icall(); if (pEVar8 == (Entity_Player *)0x0) { FUN_005cba40(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x2a); local_5f0 = pEVar8; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5e4 = pEVar8; bVar5 = Entity_Pickup::CanReroll((Entity_Pickup *)pEVar8); if (((bVar5 != 0) && ((cVar7 = FUN_006ee330(), cVar7 == '\0' || (iVar9 = Entity::SubType((Entity *)pEVar8), iVar9 != 0)))) && ((iVar9 = Entity::Variant((Entity *)pEVar8), iVar9 != 100 || (iVar9 = Entity::SubType((Entity *)pEVar8), iVar9 != 0)))) { fVar32 = (float)Entity::InitSeed((Entity *)pEVar8); VStack_608.y = fVar32; uVar26 = Entity::SubType((Entity *)pEVar8); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_dd0); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_dd8,tmpVec,40.0,0,0,0); uVar11 = Entity::Variant((Entity *)local_5e4); curPlayer = local_5e0; local_5ec = (Entity_Player *) Game::Spawn(g_game,5,uVar11,tmpVec,&g_vectorZero,(Entity *)local_5e0, uVar26,(uint)VStack_608.y); pEVar8 = local_5e4; bVar5 = FUN_005b1a00(); Entity_Pickup::SetForceBlind((Entity_Pickup *)local_5ec,bVar5); iVar9 = Entity_Pickup::GetAlternatePedestal((Entity_Pickup *)pEVar8); Entity_Pickup::SetAlternatePedestal((Entity_Pickup *)local_5ec,iVar9); iVar9 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); if (0 < iVar9) { uStack_9a4 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); std::set::find(); std::iterator_copy(auStack_71c,auStack_bf4); cVar7 = FUN_00557bb0(); if (cVar7 == '\0') { FUN_005cba30(); FUN_005b1970(); } else { iStack_9a8 = Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)local_5ec); uStack_9ac = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); FUN_005cbfa0(); FUN_005cbfc0(); } } } puVar27 = &local_5f0->field_0x1; local_5f0 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } FUN_00436fb0(); fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&pennyPickups); } else { pEVar8 = (Entity_Player *)0x0; local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar16 = (Entity_Pickup *)*puVar15; VStack_608.y = (float)pEVar16; bVar5 = Entity_Pickup::CanReroll(pEVar16); if ((bVar5 != 0) && ((cVar7 = FUN_006ee330(), cVar7 == '\0' || (iVar9 = Entity::SubType((Entity *)pEVar16), iVar9 != 0)))) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)VStack_608.y,aVStack_df0); Level::GetCurrentRoom((Level *)g_game); fVar32 = (float)EntityList::Size(); VStack_608.y = fVar32; iVar9 = Room::GetGridIndex(room,tmpVec); uVar26 = (int)VStack_608.y + iVar9; room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetGridEntity(room,uVar26); tammyKnife = (GridEntity_Spikes *)__RTDynamicCast(); if ((tammyKnife != (GridEntity_Spikes *)0x0) && ((iVar9 = GridEntity::GetType(), iVar9 == 0x1c && (cVar7 = FUN_005b1a10(), cVar7 != '\0')))) { GridEntity_Spikes::unsummon(tammyKnife,0); } pEVar8 = local_5e4; puVar15 = (undefined4 *)std::vector::operator_index(); (**(code **)(*(int *)*puVar15 + 0x28))(); } pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5e4 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); curPlayer = local_5e0; } rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_df8,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)curPlayer,1,uVar26); fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&pennyPickups); } goto LAB_005bbadc; } goto LAB_005bbae2; case 0x32: pcVar3 = *(code **)(*(int *)local_5e0 + 0x20); EntityRef::constructor(&EStack_1518,(Entity *)local_5e0); (*pcVar3)(); SoundEffects::PlayWithFartOverride(0x414,1.0,2,0,1.0); goto LAB_005bfa98; case 0x33: if ((local_5e0->_variant == 0) && (0 < local_5e0->_maxHearts)) { AddMaxHearts(local_5e0,-2,0); bVar5 = HasCollectible(curPlayer,0x49,0); if ((bVar5 == 0) && (bVar5 = HasCollectible(curPlayer,0xcf,0), bVar5 != 0)) { bVar5 = HasCollectible(curPlayer,0xcf,0); if (bVar5 != 0) { curPlayer->_potatoPeelerBandageCounter = curPlayer->_potatoPeelerBandageCounter + 1; } } else { curPlayer->_potatoPeelerCounter = curPlayer->_potatoPeelerCounter + 1; } curPlayer->_cacheFlags = curPlayer->_cacheFlags | 0x201; EvaluateItems(); pcVar3 = *(code **)(*(int *)curPlayer + 0x20); EntityRef::constructor(&EStack_14f0,(Entity *)curPlayer); (*pcVar3)(); tmpVec = (Vector *)FUN_0058e240(); fStack_9b0 = 2.0; Vector::__mul(tmpVec,&VStack_9f4,&fStack_9b0); SoundEffects::PlayWithFartOverride(0x4d,1.0,2,0,1.0); uVar26 = Random(); Game::Spawn(g_game,1000,2,&curPlayer->_pos,&VStack_9f4,(Entity *)0x0,3,uVar26); iVar9 = Isaac::Random(3); VStack_608.y = (float)(iVar9 + 2); iVar25 = Isaac::Random(6); pEVar8 = local_5ec; local_5e4 = (Entity_Player *)0x0; pEStack_614 = (Entity_Pickup *)(iVar25 + 6 + iVar9 + 2); if (0 < (int)pEStack_614) { do { fVar32 = random_float(); tmpVec = Vector::Rotated(&VStack_9f4,aVStack_e10,fVar32 * 20.0 - 10.0); fStack_7b0 = random_float(); Vector::__mul(tmpVec,&VStack_a6c,&fStack_7b0); Vector::__add((Vector *)pEVar8,&VStack_c58,&VStack_a6c); uVar26 = Random(); pEVar10 = local_5e4; uVar11 = 99; if ((int)local_5e4 < (int)VStack_608.y) { uVar11 = 0; } tmpEntity = Game::Spawn(g_game,1000,5,&VStack_c58,&VStack_a6c,(Entity *)0x0,uVar11,uVar26) ; (**(code **)(*(int *)tmpEntity + 0xc))(); local_5e4 = (Entity_Player *)&pEVar10->field_0x1; } while ((int)local_5e4 < (int)pEStack_614); curPlayer = local_5e0; } try_trigger_astral_projection(curPlayer); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0xd6); TemporaryEffect::TemporaryEffect(peelerEffect,itemConfig); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { uStack_bc8 = 300; } TemporaryEffects::AddEffect(&curPlayer->_temporaryeffects,peelerEffect,1,1); bVar5 = HasCollectible(curPlayer,0x3b,0); if (bVar5 != 0) { TemporaryEffects::AddNullEffect(&curPlayer->_temporaryeffects,0x82,1,1); } goto LAB_005b8b6f; } goto LAB_005b3e24; case 0x34: if (local_5e0->_variant == 0) { if (local_5e0->_metronomeCollectibleID != 0) { TemporaryEffects::RemoveCollectibleEffect(&local_5e0->_temporaryeffects,0x1e8,1); TemporaryEffects::RemoveCollectibleEffect (&curPlayer->_temporaryeffects,curPlayer->_metronomeCollectibleID,1); if ((curPlayer->_metronomeCollectibleID == 0x6b) && (bVar5 = HasCollectible(curPlayer,0x14,0), bVar5 == 0)) { TemporaryEffects::RemoveCollectibleEffect(&curPlayer->_temporaryeffects,0x14,1); } itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,curPlayer->_metronomeCollectibleID); if (itemConfig->type == 3) { ResetItemState(curPlayer); } iVar9 = curPlayer->_metronomeCollectibleID; curPlayer->_metronomeCollectibleID = 0; bVar5 = HasCollectible(curPlayer,iVar9,0); if (bVar5 == 0) { RemoveCostume(curPlayer,itemConfig); } } if (DAT_00c7166c == 0) { uVar11 = 0xf; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); RNG::game_constructor(&metronomeRng,uVar26,uVar11); fStack_14 = 6.02558e-44; pEStack_614 = (Entity_Pickup *)&DAT_0000000f; do { pEStack_614 = (Entity_Pickup *)((int)&pEStack_614[-1]._altPedestalANM2._bitflags + 3); rngPtr = (RNG *)FUN_005cbd00(); Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); iVar9 = std::vector::size(pvVar24); uVar26 = RNG::RandomInt(rngPtr,iVar9 - 1); iVar9 = uVar26 + 1; if ((((((iVar9 != 0x1e8) && (iVar9 != 0x1db)) && (iVar9 != 0x1a6)) && ((iVar9 != 0x146 && (iVar9 != 0x1e2)))) && (iVar9 != 0x27c)) && (iVar9 != 0x280)) { iVar25 = Game::Challenge(g_game); if (iVar25 == 0x2b) { Isaac::GetItemConfig(); cVar7 = FUN_0072fe80(); if (cVar7 != '\0') goto LAB_005bfef6; } if (iVar9 == 0x274) { fVar32 = RNG::RandomFloat(&metronomeRng); VStack_608.y = fVar32; bVar29 = fVar32 == 0.15; bVar28 = 0.15 < fVar32; LAB_005bfe68: if (bVar28 || bVar29) goto LAB_005bfef6; } else if (iVar9 == 0x26e) { fVar32 = RNG::RandomFloat(&metronomeRng); VStack_608.y = fVar32; bVar29 = fVar32 == 0.25; bVar28 = 0.25 < fVar32; goto LAB_005bfe68; } FUN_00421780(); cVar7 = FUN_005b1840(); if ((cVar7 == '\0') || (iVar9 != 0x7f)) { Isaac::GetItemConfig(); bVar5 = ItemConfig::IsValidCollectible(iVar9); if (bVar5 != 0) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,iVar9); if (itemConfig != (ItemConfig_Item *)0x0) { Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { Game::GetField26614(g_game); piVar14 = (int *)EntityList::Size(); cVar7 = (**(code **)(*piVar14 + 0x30))(); if (cVar7 != '\0') goto LAB_005bfef6; } curPlayer->_metronomeCollectibleID = iVar9; break; } } } } LAB_005bfef6: } while (0 < (int)pEStack_614); fStack_14 = -NAN; guard_check_icall(); } else { curPlayer->_metronomeCollectibleID = DAT_00c7166c; } if (curPlayer->_metronomeCollectibleID != 0) { KAGE_LogMessage(1,(byte *)"Metronome Collectible %d\n"); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,curPlayer->_metronomeCollectibleID); if (itemConfig->type == 3) { UseActiveItem(curPlayer,&sStack_8ac,curPlayer->_metronomeCollectibleID,0,-1,0); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { fVar32 = (float)curPlayer->_metronomeCollectibleID; goto LAB_005c0043; } } else { AddCostume(curPlayer,itemConfig,0); AddBombs(curPlayer,itemConfig->addBombs); AddKeys(curPlayer,itemConfig->addKeys); AddCoins(curPlayer,itemConfig->addCoins); AddMaxHearts(curPlayer,itemConfig->addMaxhearts,0); AddHearts(curPlayer,itemConfig->addHearts,0,0); AddSoulHearts(curPlayer,itemConfig->addSoulHearts,0); AddBlackHearts(curPlayer,itemConfig->addBlackHearts); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { rngPtr = (RNG *)FUN_005cbd00(); fVar32 = (float)Entity_Familiar::GetRandomWisp(rngPtr); LAB_005c0043: AddWisp(curPlayer,(int)fVar32,&curPlayer->_pos,0,0); } } bVar5 = (byte)isShowAnim; if ((bVar5 != 0) && (curPlayer->_metronomeCollectibleID != 0)) { AnimateCollectible(curPlayer,curPlayer->_metronomeCollectibleID,(byte *)"UseItem", (byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e2a; } KAGE_LogMessage(1,(byte *)"[warn] No Collectible found for Metronome!\n"); goto LAB_005b8b6f; } goto LAB_005b3e24; case 0x35: if (local_5e0->_variant == 0) { if ((flags & 0x400) == 0) { VStack_608 = (Vector)(CONCAT44(flags,VStack_608.x) & 0x4ffffffff); if ((((flags & 4) == 0) || (slot < 0)) || (local_5e0->_activeDesc[slot]._item != 0x1e9)) { FUN_005cbd00(); uVar26 = EntityPtr::Ref(); uVar26 = uVar26 % 10; pvVar24 = (void *)VStack_608.y; goto LAB_005bfb5e; } iVar9 = *(int *)(&DAT_00b1f450 + *(short *)((int)&local_5e0->_activeDesc[slot]._varData + 2) * 4); LAB_005bfb73: if (curPlayer->_activeDesc[slot]._item == 0x1e9) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,iVar9); *(short *)&curPlayer->_activeDesc[slot]._varData = (short)itemConfig->maxCharges; } } else { uVar26 = varData >> 0x10; pvVar24 = (void *)(flags & 4); LAB_005bfb5e: iVar9 = *(int *)(&DAT_00b1f450 + uVar26 * 4); if ((pvVar24 != (void *)0x0) && (-1 < slot)) goto LAB_005bfb73; } UseActiveItem(curPlayer,&sStack_8aa,iVar9,0,-1,0); switch(iVar9) { case 0x11b: itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x1c,0,(Entity_Player *)0x0); break; case 0x11c: itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x11,0,(Entity_Player *)0x0); break; case 0x182: itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x25,0,(Entity_Player *)0x0); break; case 0x196: itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x24,0,(Entity_Player *)0x0); } } goto switchD_005bfbd8_caseD_11d; case 0x36: if (local_5e0->_variant == 0) { local_5e4 = (void *)0x2; if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_e00,&curPlayer->_pos,40.0,0,0,0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)curPlayer,0,uVar26); local_5e4 = (Entity_Player *)((int)local_5e4 + -1); } while (local_5e4 != (void *)0x0); local_5e4 = (Entity_Player *)0x0; goto LAB_005bc045; } LAB_005bc04b: local_5d9 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); goto LAB_005bc067; } goto LAB_005bc073; case 0x37: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); SoundEffects::PlayWithFartOverride(0x349,1.0,2,0,1.0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } case 0x60: LAB_005b83cf: curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x38: Level::GetCurrentRoom((Level *)g_game); local_5f0 = (Entity_Player *)Room::GetEntities(); pEVar8 = (Entity_Player *)0x0; local_5d9 = 0; local_5f8 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::IsVulnerableEnemy((Entity *)*puVar15,(Entity *)0x0); if (bVar5 == 0) { pEVar10 = local_5e0; } else { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar10 = local_5e0; if ((Entity_Player *)*puVar15 != local_5e0) { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::HasEntityFlags((Entity *)*puVar15,0x20000000); if (bVar5 == 0) { std::vector::operator_index(); fVar30 = (float10)Entity::MaxHitPoints(); VStack_608.y = (float)(fVar30 * (float10)0.1); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 == '\0') { LAB_005c0516: local_5e4 = (Entity_Player *)VStack_608.y; } else { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::is_player((Entity *)*puVar15); if (bVar5 == 0) goto LAB_005c0516; puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; iVar9 = GetBlackHearts(pEVar8); iVar25 = GetBoneHearts(pEVar8); iVar12 = GetRottenHearts(pEVar8); goldenHearts = GetGoldenHearts(pEVar8); soulHearts = GetSoulHearts(pEVar8); maxHearts = GetMaxHearts(pEVar8); local_5e4 = (Entity_Player *) ((float)(maxHearts + iVar9 + iVar25 + iVar12 + goldenHearts + soulHearts ) * 0.1); } puVar15 = (undefined4 *)std::vector::operator_index(); pcVar3 = *(code **)(*(int *)*puVar15 + 0x20); EntityRef::constructor(&EStack_1540,(Entity *)local_5e0); cVar7 = (*pcVar3)(); if (cVar7 == '\0') { pEVar10 = local_5e0; } else { puVar15 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar15,&VStack_e18); pEVar10 = local_5e0; tmpVec = Vector::__sub(&local_5e0->_pos,&VStack_e20,tmpVec); fStack_7b4 = 0.1; Vector::__mul(tmpVec,&VStack_890,&fStack_7b4); fVar32 = Vector::Length(&VStack_890); VStack_608.y = fVar32; if (30.0 < fVar32) { Vector::Resize(&VStack_890,30.0); } uVar26 = Random(); puVar15 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar15,&VStack_e28); Game::Spawn(g_game,1000,2,tmpVec,&g_vectorZero,(Entity *)0x0,3,uVar26); iVar9 = Isaac::Random(2); pEStack_614 = (Entity_Pickup *)(iVar9 + 2); iVar25 = Isaac::Random(10); VStack_608.y = 0.0; VVar4 = VStack_608; local_5e4 = (Entity_Player *) ((((Entity_Pickup *)(iVar9 + 2))->_sprite)._filename._buf + iVar25 + -0x42); if (0 < (int)local_5e4) { VStack_608.y = 0.0; pvVar24 = (void *)VStack_608.y; VStack_608 = VVar4; do { fVar32 = random_float(); tmpVec = Vector::Rotated(&VStack_890,&VStack_e30,fVar32 * 10.0 - 5.0); fStack_7b8 = random_float(); Vector::__mul(tmpVec,&VStack_898,&fStack_7b8); puVar15 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar15,&VStack_e38); Vector::__add(tmpVec,&VStack_9fc,&VStack_898); uVar26 = Random(); if ((int)pvVar24 < (int)pEStack_614) { fStack_7bc = 0.2; tmpVec = Vector::__mul(&VStack_898,&VStack_e40,&fStack_7bc); tmpEntity = Game::Spawn(g_game,1000,5,&VStack_9fc,tmpVec,(Entity *)0x0,0, uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); } else { tmpEntity = Game::Spawn(g_game,1000,5,&VStack_9fc,&VStack_898,(Entity *)0x0,99 ,uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); FUN_00444c70(); } pvVar24 = (void *)((int)pvVar24 + 1); } while ((int)pvVar24 < (int)local_5e4); pEVar10 = local_5e0; } bVar5 = HasCollectible(pEVar10,0x248,0); if (bVar5 != 0) { if ((char)local_610 != '\0') { iVar9 = Isaac::Random(3); pEVar8 = local_5f8; if (iVar9 == 0) { puVar15 = (undefined4 *)std::vector::operator_index(); bVar36 = 0; bVar5 = 0; tmpVec = Entity::Position((Entity *)*puVar15,&VStack_e48); AddWisp(pEVar10,0x1fb,tmpVec,bVar5,bVar36); local_5d9 = 1; goto LAB_005c0845; } } } } local_5d9 = 1; pEVar8 = local_5f8; } } } LAB_005c0845: pEVar8 = (Entity_Player *)&pEVar8->field_0x1; local_5f8 = pEVar8; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar8 < puVar13); if (local_5d9 != 0) { Game::ShakeScreen(g_game,6); SoundEffects::PlayWithFartOverride(0x48,1.0,2,0,1.0); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,100); if (uVar26 < 0xf) { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_e50,&pEVar10->_pos,40.0,0,0,0); tmpEntity = Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)pEVar10,2,uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); } } } LAB_005b40d0: bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; pcVar38 = "UseItem"; iVar9 = itemId; goto LAB_005b3eb4; case 0x39: if (local_5e0->_variant == 0) { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,0x3b); console_spawn(curPlayer,&DAT_00c33d80 + uVar26 * 4,(byte)local_610); } goto LAB_005bdf0b; case 0x3a: SoundEffects::PlayWithFartOverride(0x42b,1.0,2,0,1.0); goto LAB_005b7f60; case 0x3b: if (local_5e0->_variant == 0) { local_5ec = (Entity_Player *)FUN_005cbd00(); uStack_7c4 = 2; iStack_7c0 = (int)curPlayer->_luck + 0xc; puVar19 = (uint *)std::max(); VStack_608.y = (float)RNG::RandomInt((RNG *)local_5ec,*puVar19); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&giftSpawnPos,playerPos,40.0,0,0,0); if ((void *)VStack_608.y == (void *)0x0) { uVar26 = RNG::Next((RNG *)local_5ec); tmpEntity = Game::Spawn(g_game,5,100,&giftSpawnPos,&g_vectorZero,(Entity *)curPlayer,0x24, uVar26); ::Color::Color(aCStack_528); Game::Fart(g_game,&giftSpawnPos,85.0,(Entity *)curPlayer,1.0,0,color_03); Game::ButterBeanFart(g_game,&giftSpawnPos,120.0,(Entity *)curPlayer,0,0); } else if ((void *)VStack_608.y == (void *)0x1) { uVar26 = RNG::Next((RNG *)local_5ec); tmpEntity = Game::Spawn(g_game,5,100,&giftSpawnPos,&g_vectorZero,(Entity *)curPlayer,0x84, uVar26); VStack_608.y = (float)tmpEntity; SoundEffects::PlayWithFartOverride(0x10b,1.0,2,0,1.0); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&giftSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar26); pcVar3 = *(code **)(*(int *)tmpEntity + 0x3c); ::Color::Color(); (*pcVar3)(); curPlayer = local_5e0; tmpEntity = (Entity *)VStack_608.y; } else { uVar26 = RNG::Next((RNG *)local_5ec); tmpEntity = Game::Spawn(g_game,5,100,&giftSpawnPos,&g_vectorZero,(Entity *)curPlayer,0, uVar26); SoundEffects::PlayWithFartOverride(0x10c,1.0,2,0,1.0); uVar26 = Random(); Game::Spawn(g_game,1000,0xf,&giftSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar26); } Entity::ClearEntityFlags(tmpEntity,4); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); } goto LAB_005bc1f8; case 0x3c: if (local_5e0->_variant == 0) { FUN_00424510(); fStack_14 = 6.30584e-44; FUN_005cbb40(); Level::GetCurrentRoom((Level *)g_game); VStack_608.y = (float)Room::GetEntities(); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Type((Entity *)*puVar15); if (iVar9 == 5) { std::vector::operator_index(); couponPickup = (Entity_Pickup *)__RTDynamicCast(); if ((couponPickup != (Entity_Pickup *)0x0) && (cVar7 = Entity_Pickup::IsShopItem(couponPickup), cVar7 != '\0')) { std::vector::push_back(); } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } iVar9 = std::vector::size(auStack_754); if (iVar9 != 0) { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = std::vector::size(auStack_754); RNG::RandomInt(rngPtr,uVar26); puVar15 = (undefined4 *)FUN_0042c810(); Entity_Pickup::update_price_sprite((Entity_Pickup *)*puVar15,0); curPlayer = local_5e0; } fStack_14 = -NAN; FID_conflict__Tidy(auStack_754); } goto LAB_005bc1f8; case 0x3d: if (bVar5 != 0) { IsLocalPlayer(local_5e0); SoundEffects::PlayWithFartOverride(0x38d,(float)pEVar10,2,0,1.0); iVar9 = itemId; LAB_005b83be: AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } goto LAB_005b83cf; case 0x3e: if (local_5e0->_variant == 0) { local_5f0 = (Entity_Player *)&local_5e0->_movingBoxContents; cVar7 = FUN_004bc660(); if (cVar7 == '\0') { SoundEffects::PlayWithFartOverride(0x37d,1.0,2,0,1.0); FUN_005b19d0(); FUN_005cba40(); fStack_14 = 6.72623e-44; FUN_00424510(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x31); local_5e4 = (void *)0x0; iVar9 = FUN_005cbe80(); if (iVar9 != 0) { do { puVar19 = (uint *)FUN_005cbe60(); tmpEntity = Game::Spawn(g_game,*puVar19,puVar19[1],(Vector *)(puVar19 + 10), &g_vectorZero,(Entity *)curPlayer,puVar19[2],puVar19[0xd]); VStack_608.y = (float)tmpEntity; room = (Room *)Level::GetCurrentRoom((Level *)g_game); fVar32 = VStack_608.y; Entity_Pickup::RestoreState(room,(Entity_Pickup *)VStack_608.y,puVar19); pEStack_7cc = (Entity_Pickup *)fVar32; std::vector::push_back(); iVar9 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)fVar32); if (0 < iVar9) { uStack_7d0 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)fVar32); std::set::find(); std::iterator_copy(auStack_73c,auStack_c20); cVar7 = FUN_00557bb0(); if (cVar7 == '\0') { FUN_005cba30(); FUN_005b1970(); } else { iStack_7d4 = Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)fVar32); uStack_7d8 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)fVar32); FUN_005cbfa0(); FUN_005cbfc0(); } } local_5e4 = (Entity_Player *)((int)local_5e4 + 1); pvVar24 = (void *)FUN_005cbe80(); } while (local_5e4 < pvVar24); } FUN_005b19d0(); local_5e4 = (Entity_Player *)0x0; iVar9 = std::vector::size(auStack_8e4); pEVar8 = local_5ec; if (iVar9 != 0) { do { puVar15 = (undefined4 *)FUN_0042c810(); tmpEntity = (Entity *)*puVar15; room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,aVStack_e70,(Vector *)pEVar8,40.0,0,0,0) ; Entity::SetPosition(tmpEntity,tmpVec); puVar27 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)std::vector::size(auStack_8e4); } while (puVar27 < puVar13); curPlayer = local_5e0; } FUN_00571170(); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(curPlayer,0x20b,&curPlayer->_pos,0,0); } FID_conflict__Tidy(auStack_8e4); fStack_14 = -NAN; FUN_00436fb0(); goto LAB_005bbadc; } local_5d9 = 0; SoundEffects::PlayWithFartOverride(0x37c,1.0,2,0,1.0); Level::GetCurrentRoom((Level *)g_game); local_5e4 = (Entity_Player *)Room::GetEntities(); FUN_00424510(); fStack_14 = 6.44597e-44; iVar9 = EntityList::Size(); if (iVar9 != 0) { uVar26 = 0; do { std::vector::operator_index(); boxPickup = (Entity_Pickup *)FUN_00435e30(); if ((boxPickup != (Entity_Pickup *)0x0) && (cVar7 = Entity::IsDead((Entity *)boxPickup), cVar7 == '\0')) { local_609 = FUN_006ee330(); bVar5 = Entity_Pickup::CanReroll(boxPickup); if (((((bVar5 != 0) && (cVar7 = Entity_Pickup::IsShopItem(boxPickup), cVar7 == '\0')) && ((iVar9 = Entity::Variant((Entity *)boxPickup), iVar9 != 100 || (iVar9 = Entity::SubType((Entity *)boxPickup), iVar9 != 0)))) && ((local_609 == 0 || (iVar9 = Entity::SubType((Entity *)boxPickup), iVar9 != 0)))) && ((iVar9 = Entity_Pickup::Timeout(boxPickup), iVar9 < 0 && (cVar7 = Entity::IsDead((Entity *)boxPickup), cVar7 == '\0')))) { std::vector::push_back(); } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } iVar9 = std::vector::size(auStack_8d8); if (iVar9 != 0) { uVar26 = 0; do { uVar11 = FUN_005cbe80(); if (9 < uVar11) break; puVar15 = (undefined4 *)FUN_0042c810(); pEVar8 = (Entity_Player *)*puVar15; local_5e4 = pEVar8; cVar7 = FUN_006ee330(); if ((cVar7 != '\0') || (iVar9 = Entity::Variant((Entity *)pEVar8), iVar9 == 100)) { local_5d9 = 1; } EntitySaveState::constructor(aEStack_1818); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x2f); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Entity_Pickup::CanFlip(room,(Entity_Pickup *)pEVar8,aEStack_1818,0); if (bVar5 != 0) { FUN_004d7100(); iVar9 = Entity_Pickup::Timeout((Entity_Pickup *)pEVar8); if (iVar9 < 0) { uVar11 = Random(); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_e58); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar11); pEVar8 = local_5e4; } Entity_Pickup::RemoveOtherOptions(); (**(code **)(*(int *)pEVar8 + 0x28))(); } fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x2e); invoke_pending_callbacks(aEStack_1818); uVar26 = uVar26 + 1; uVar11 = std::vector::size(auStack_8d8); } while (uVar26 < uVar11); curPlayer = local_5e0; if (local_5d9 != 0) { Level::GetCurrentRoom((Level *)g_game); iVar9 = GridEntity::GetVariant(); if (iVar9 != 0xb) { Level::GetCurrentRoom((Level *)g_game); iVar9 = GridEntity::GetVariant(); if (iVar9 != 0x11) goto LAB_005c1127; } ambush = (Ambush *)Game::GetAmbush(g_game); Ambush::StartChallenge(ambush); } } LAB_005c1127: fStack_14 = -NAN; FID_conflict__Tidy(auStack_8d8); goto LAB_005bbadc; } goto LAB_005bbae2; case 0x3f: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x42d,1.0,2,0,1.0); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); tmpEntity = Game::Spawn(g_game,1000,0x6c,&curPlayer->_pos,&g_vectorZero,(Entity *)curPlayer,0, uVar26); VStack_608.y = (float)tmpEntity; Entity::SetParent(tmpEntity,(Entity *)local_5e0); uVar26 = Random(); Game::Spawn(g_game,1000,0x1e,&curPlayer->_pos,&g_vectorZero,tmpEntity,0,uVar26); effect = (Entity_Effect *)__RTDynamicCast(); Entity_Effect::SetTimeout(effect,0x4b); pcVar3 = *(code **)(*(int *)effect + 0x3c); ::Color::Color(); (*pcVar3)(); fVar32 = VStack_608.y; Entity::SetTarget((Entity *)VStack_608.y,(Entity *)effect); (**(code **)(*(int *)fVar32 + 0xc))(); iVar9 = itemId; } bVar5 = 0; if ((char)isShowAnim != '\0') { pcVar38 = "LiftItem"; curPlayer = local_5e0; goto LAB_005b8b8d; } goto LAB_005b3e2a; case 0x40: if (local_5e0->_variant == 0) { local_5d9 = 0; local_609 = 0; FUN_00424510(); fStack_14 = 7.00649e-44; FUN_0042c820(); Level::GetCurrentRoom((Level *)g_game); local_5ec = (Entity_Player *)Room::GetEntities(); local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { std::vector::operator_index(); familiar = (Entity_Familiar *)FUN_00435de0(); if (familiar != (Entity_Familiar *)0x0) { pEVar8 = (Entity_Player *)Entity_Familiar::Player(familiar); if (pEVar8 == curPlayer) { if (curPlayer->_playerType == 0xd) { iVar9 = Entity::Variant((Entity *)familiar); if (iVar9 == 0x50) goto LAB_005c1788; } iVar9 = Game::Challenge(g_game); if (iVar9 == 0x1e) { iVar9 = Entity::Variant((Entity *)familiar); if (iVar9 == 0x43) goto LAB_005c1788; } iVar9 = Entity::Variant((Entity *)familiar); if (((((iVar9 == 0x2b) || (iVar9 = Entity::Variant((Entity *)familiar), iVar9 == 0x49) ) || ((iVar9 = Entity::Variant((Entity *)familiar), iVar9 == 0x73 || ((iVar9 = Entity::Variant((Entity *)familiar), iVar9 == 0xe4 || (iVar9 = Entity::Variant((Entity *)familiar), iVar9 == 0xc9)))))) || (iVar9 = Entity::Variant((Entity *)familiar), iVar9 == 0xe5)) || (iVar9 = Entity::Variant((Entity *)familiar), iVar9 == 0xee)) { uVar26 = Entity::DropSeed((Entity *)familiar); tmpVec = Entity::Position((Entity *)familiar,&VStack_e88); Game::Spawn(g_game,5,0x14,tmpVec,&g_vectorZero,(Entity *)familiar,1,uVar26); Entity::Die((Entity *)familiar); } else { iVar9 = Entity::Variant((Entity *)familiar); if (iVar9 == 0xce) { uVar26 = Entity::DropSeed(); tmpVec = Entity::Position((Entity *)familiar,&VStack_e78); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)familiar,2,uVar26); pcVar3 = *(code **)(*(int *)familiar + 0x24); EntityRef::EntityRef(&EStack_1908); (*pcVar3)(); } else { iVar9 = Entity::Variant((Entity *)familiar); if (iVar9 != 0xed) { cVar7 = FUN_005b18e0(); if (cVar7 == '\0') { iVar9 = FUN_00417490(); if ((*(uint *)(iVar9 + 0xd8) & 0x20) != 0) { pEStack_7e0 = familiar; std::vector::push_back(); } } else { pEStack_7dc = familiar; std::vector::push_back(); } goto LAB_005c1788; } uVar26 = Entity::DropSeed((Entity *)familiar); tmpVec = Entity::Position((Entity *)familiar,&VStack_e80); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)familiar,8,uVar26); pcVar3 = *(code **)(*(int *)familiar + 0x24); EntityRef::EntityRef(&EStack_1840); (*pcVar3)(); } } local_5d9 = 1; curPlayer = local_5e0; } } LAB_005c1788: puVar27 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } local_5f0 = (Entity_Player *)&curPlayer->_collectibleRNGs; rngPtr = (RNG *)FUN_005cbd00(); puVar15 = (undefined4 *)FUN_00456190(); piVar14 = (int *)*puVar15; puVar15 = std::iterator_copy(auStack_6fc,auStack_bbc); RNG::Shuffle(rngPtr,(int *)*puVar15,piVar14); iStack_7e4 = std::vector::size(auStack_6fc); uStack_7e8 = 2; puVar15 = (undefined4 *)std_min_ptr(); pEStack_614 = (Entity_Pickup *)*puVar15; local_600 = (Entity_Player *)0x0; if (pEStack_614 == (Entity_Pickup *)0x0) { curPlayer = local_5e0; if (local_5d9 != 0) goto LAB_005c1a82; } else { local_609 = 1; do { puVar15 = (undefined4 *)FUN_0042c810(); pEVar8 = (Entity_Player *)*puVar15; local_5ec = pEVar8; uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar8,&VStack_e90); tmpEntity = Game::Spawn(g_game,1000,2,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); Entity_Familiar::RemoveFromPlayer((Entity_Familiar *)pEVar8,1); iVar9 = Entity::Variant((Entity *)pEVar8); if (((iVar9 == 0x20) || (iVar9 = Entity::Variant((Entity *)pEVar8), iVar9 == 0x53)) || (iVar9 = Entity::Variant((Entity *)pEVar8), iVar9 == 0x5c)) { local_5e4 = (Entity_Player *)0x2; do { rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)local_5ec,&VStack_e98); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_ea0,tmpVec,1.0,0,0,0); Game::Spawn(g_game,5,10,tmpVec,&g_vectorZero,(Entity *)local_5ec,6,uVar26); local_5e4 = (Entity_Player *)((int)&local_5e4[-1]._replacedPlayer + 3); } while (local_5e4 != (Entity_Player *)0x0); } itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); fVar32 = (float)ItemPool::GetCollectibleFromList (itemPool,(int *)&DAT_00b62cc0,0x28,uVar26,0x33,1,0); VStack_608.y = fVar32; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)local_5ec,&VStack_ea8); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_eb0,tmpVec,1.0,0,0,0); fVar32 = VStack_608.y; Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)local_5ec,(uint)VStack_608.y, uVar26); __RTDynamicCast(); FUN_005b1990(); itemPool = (ItemPool *)Game::GetItemPool(g_game); ItemPool::AddRoomBlacklist(itemPool,(int)fVar32); curPlayer = local_5e0; bVar5 = HasCollectible(local_5e0,0x3b,0); if (bVar5 != 0) { curPlayer->_redStewBonusDuration = curPlayer->_redStewBonusDuration + 0xa8c; } local_600 = (Entity_Player *)&local_600->field_0x1; } while (local_600 < pEStack_614); LAB_005c1a82: uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); Game::Darken(g_game); SoundEffects::PlayWithFartOverride(0xf1,1.0,2,0,1.0); AddNullCostume(curPlayer,0x2b); if (local_609 != 0) { bVar5 = HasCollectible(curPlayer,0x248,0); if (bVar5 != 0) { if ((char)local_610 != '\0') { AddWisp(curPlayer,0x218,&curPlayer->_pos,0,0); } } } } fStack_14 = -NAN; FID_conflict__Tidy(auStack_6fc); } LAB_005bc1f8: bVar5 = 0; if ((char)isShowAnim != '\0') { LAB_005b8f3d: pcVar38 = "UseItem"; LAB_005b8f47: AnimateCollectible(curPlayer,itemId,(byte *)pcVar38,(byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e2a; case 0x41: local_5d9 = '\0'; local_5ec = (Entity_Player *)FUN_005cbd00(); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&boneOrbitals,3,0x80,-1,0,0); fStack_14 = 7.14662e-44; FUN_005cbb00(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x34); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); afStack_7f0[1] = (float)*puVar15; pEVar8 = (Entity_Player *)Entity_Familiar::Player(); if (pEVar8 == curPlayer) { std::deque::push_front(); } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } Level::GetCurrentRoom((Level *)g_game); local_600 = (Entity_Player *)FUN_004e4840(); cVar7 = FUN_004073a0(); if (cVar7 == '\0') { pEVar8 = (Entity_Player *)0x0; local_5e4 = (Entity_Player *)0x0; FUN_0042c770(); do { std::iterator_copy(local_600,auStack_bc0); cVar7 = FUN_0042c710(); pEVar10 = local_5ec; if (cVar7 == '\0') break; if (((int)pEVar8 < 1) || (uVar26 = RNG::RandomInt((RNG *)local_5ec,3), uVar26 != 0)) { pfVar20 = (float *)FUN_0042c700(); boneSpawnPos.x = *pfVar20; boneSpawnPos.y = pfVar20[1]; uVar26 = RNG::RandomInt((RNG *)pEVar10,5); if (uVar26 == 0) { uVar11 = 4; uVar26 = RNG::Next((RNG *)pEVar10); RNG::game_constructor(&deadRng,uVar26,uVar11); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x35); pEVar8 = (Entity_Player *)0xe3; local_5f8 = (Entity_Player *)0x0; uVar26 = RNG::RandomInt(&deadRng,4); if (uVar26 == 0) { pEVar8 = (Entity_Player *)0x115; } local_5f0 = pEVar8; fVar32 = (float)FUN_00417910(); VStack_608.y = fVar32; iVar9 = FUN_0042c700(); uVar1 = *(ushort *)(iVar9 + 0xe); iVar9 = FUN_0042c700(); uVar2 = *(ushort *)(iVar9 + 0xc); iVar9 = FUN_0042c700(); entityConfigEntry = EntityConfig::GetEntity ((EntityConfig *)VStack_608.y,*(int *)(iVar9 + 8),(uint)uVar2,(uint)uVar1 ); uVar26 = RNG::RandomInt(&deadRng,4); if ((uVar26 == 0) && ((cVar7 = str_ne(), cVar7 != '\0' || (entityConfigEntry->gridCollisionPoints == 0)))) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); iVar9 = PersistentGameData::GetBestiaryKillCount(persistentData,0x19,4); if (iVar9 == 0) { FUN_00421780(); cVar7 = FUN_005b1840(); if (cVar7 == '\0') goto LAB_005c1db9; } local_5f0 = (Entity_Player *)0x19; local_5f8 = (Entity_Player *)&DAT_00000004; } LAB_005c1db9: uVar26 = RNG::RandomInt(&deadRng,4); if (uVar26 == 0) { Config::GetCollectibles(); VStack_608.y = (float)entityConfigEntry->stageHP; pEVar16 = (Entity_Pickup *)entityConfigEntry->baseHP; pEStack_614 = pEVar16; Config::GetCollectibles(); FUN_0074b9a0(); VStack_608.y = (float)pEVar16; FUN_0074b9a0(); if (VStack_608.y < (float)pEVar16) goto LAB_005c1e91; persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); iVar9 = PersistentGameData::GetBestiaryKillCount(persistentData,0x33e,0); if (iVar9 == 0) { FUN_00421780(); cVar7 = FUN_005b1840(); if (cVar7 == '\0') goto LAB_005c1e91; } local_5f8 = (Entity_Player *)0x0; pEVar8 = (Entity_Player *)0x33e; } else { LAB_005c1e91: pEVar8 = local_5f0; } pGVar21 = (Game *)Config::GetCollectibles(); uVar26 = Game::GetStageID(pGVar21,0); uVar11 = RNG::RandomInt(&deadRng,100); if ((uVar11 == 0) || ((uVar11 = RNG::RandomInt(&deadRng,0xc), uVar11 != 0 && ((((uVar26 == 0xe || (uVar26 == 0x10)) || (uVar26 == 0x1f)) || (uVar26 == 0x20)))))) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); iVar9 = PersistentGameData::GetBestiaryKillCount(persistentData,0x349,0); if (iVar9 == 0) { FUN_00421780(); cVar7 = FUN_005b1840(); if (cVar7 == '\0') goto LAB_005c1f2d; } pEVar8 = (Entity_Player *)0x349; local_5f8 = (Entity_Player *)0x0; } LAB_005c1f2d: uVar26 = RNG::Next((RNG *)local_5ec); tmpEntity = Game::Spawn(g_game,(uint)pEVar8,(uint)local_5f8,&boneSpawnPos,&g_vectorZero, (Entity *)local_5e0,0,uVar26); tmpEntity = (Entity *)Entity::to_npc_or_coop_player(tmpEntity); bVar36 = 0; bVar5 = 0; iVar9 = -1; charmSourceRef = EntityRef::EntityRef(&EStack_1868); Entity::AddCharmed(tmpEntity,charmSourceRef,iVar9,bVar5,bVar36); (**(code **)(*(int *)tmpEntity + 0xc))(); Entity::SetVisibleFlag(tmpEntity,0); Entity::MaxHitPoints(); FUN_00435d40(); fVar30 = (float10)Entity::MaxHitPoints(); Entity::SetField380(tmpEntity,(float)fVar30); SoundEffects::PlayWithFartOverride(0x73,1.0,2,0,1.0); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x34); guard_check_icall(); } else { uVar26 = Room::GetGridHeight((Room *)auStack_7ac); if (0xb < uVar26) { puVar15 = (undefined4 *)FUN_005cbae0(); (**(code **)(*(int *)*puVar15 + 0x28))(); FUN_00499560(); } boneOrbital = AddBoneOrbital(curPlayer,&boneSpawnPos); tmpVec = MusicManager::RandomVector(&VStack_eb8); afStack_7f0[0] = 8.0; tmpVec = Vector::__mul(tmpVec,&VStack_ec0,afStack_7f0); fStack_7f4 = random_float(); tmpVec = Vector::__mul(tmpVec,&VStack_ec8,&fStack_7f4); Entity::SetVelocity(boneOrbital,tmpVec); Entity::ClearEntityFlags(boneOrbital,4); std::deque::push_front(); } ::Color::Color(aCStack_5d8); fVar32 = random_float(); Game::SpawnParticles(g_game,&boneSpawnPos,0x23,4,fVar32 * 3.0 + 2.0,color_04,100000.0,0); fVar32 = random_float(); fStack_7f8 = fVar32 * 3.0 + 2.0; iVar9 = Isaac::Random(2); local_5f0 = (Entity_Player *)(iVar9 + 2); if (0 < (int)local_5f0) { do { uVar26 = Random(); tmpVec = MusicManager::RandomVector(&VStack_ed0); tmpVec2 = Vector::Vector(&VStack_ed8,1.0,0.5); tmpVec = Vector::Mul(tmpVec,&VStack_ee0,tmpVec2); tmpVec = Vector::__mul(tmpVec,&VStack_ee8,&fStack_7f8); tmpEntity = Game::Spawn(g_game,1000,5,&boneSpawnPos,tmpVec,(Entity *)0x0,1,uVar26); Entity::AddEntityFlags(tmpEntity,0x10000); (**(code **)(*(int *)tmpEntity + 0xc))(); local_5f0 = (Entity_Player *)((int)&local_5f0[-1]._replacedPlayer + 3); } while (local_5f0 != (Entity_Player *)0x0); } pEVar8 = (Entity_Player *)&local_5e4->field_0x1; local_5e4 = pEVar8; puVar15 = (undefined4 *)FUN_004f8460(); local_5d9 = '\x01'; pvStack_628 = (void *)*puVar15; curPlayer = local_5e0; } else { FUN_004f8390(); pEVar8 = local_5e4; } } while ((int)pEVar8 < 8); } Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { FUN_00424510(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x36); uVar26 = 0; pvVar24 = (void *)Game::GetPlayerManager(g_game); iVar9 = std::vector::size(pvVar24); if (iVar9 != 0) { do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); pEVar8 = PlayerManager::GetPlayer(playerManager,uVar26); cVar7 = IsCoopGhost(pEVar8); if (cVar7 != '\0') { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); pEVar8 = PlayerManager::GetPlayer(playerManager,uVar26); Entity::Position((Entity *)pEVar8,&VStack_ef0); FUN_0042f170(); } uVar26 = uVar26 + 1; pvVar24 = (void *)Game::GetPlayerManager(g_game); uVar11 = std::vector::size(pvVar24); } while (uVar26 < uVar11); } local_5f0 = (Entity_Player *)0x0; iVar9 = FUN_0042f160(); if (iVar9 != 0) { local_5d9 = '\x01'; do { uVar26 = RNG::RandomInt((RNG *)local_5ec,5); if (uVar26 == 0) { uVar11 = 4; uVar26 = RNG::Next((RNG *)local_5ec); RNG::game_constructor(&deadRng2,uVar26,uVar11); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x37); pEVar8 = (Entity_Player *)0xe3; uVar26 = RNG::RandomInt(&deadRng2,4); if (uVar26 == 0) { pEVar8 = (Entity_Player *)0x115; } uVar26 = RNG::RandomInt(&deadRng2,4); if (uVar26 == 0) { pEVar8 = (Entity_Player *)0x33e; } local_5e4 = pEVar8; uVar26 = RNG::RandomInt(&deadRng2,100); if (uVar26 == 0) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); iVar9 = PersistentGameData::GetBestiaryDeathCount(persistentData,0x349,0); if (iVar9 != 0) { pEVar8 = (Entity_Player *)0x349; } local_5e4 = pEVar8; } uVar26 = RNG::Next((RNG *)local_5ec); tmpVec = (Vector *)std::vector::operator__(); tmpEntity = Game::Spawn(g_game,(uint)local_5e4,0,tmpVec,&g_vectorZero, (Entity *)curPlayer,0,uVar26); tmpEntity = (Entity *)Entity::to_npc_or_coop_player(tmpEntity); bVar36 = 0; bVar5 = 0; iVar9 = -1; charmSourceRef = EntityRef::EntityRef(&EStack_1890); Entity::AddCharmed(tmpEntity,charmSourceRef,iVar9,bVar5,bVar36); (**(code **)(*(int *)tmpEntity + 0xc))(); Entity::SetVisibleFlag(tmpEntity,0); Entity::MaxHitPoints(); FUN_00435d40(); fVar30 = (float10)Entity::MaxHitPoints(); Entity::SetField380(tmpEntity,(float)fVar30); SoundEffects::PlayWithFartOverride(0x73,1.0,2,0,1.0); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x36); guard_check_icall(); } else { uVar26 = Room::GetGridHeight((Room *)auStack_7ac); if (0xb < uVar26) { puVar15 = (undefined4 *)FUN_005cbae0(); (**(code **)(*(int *)*puVar15 + 0x28))(); FUN_00499560(); } tmpVec = (Vector *)std::vector::operator__(); boneOrbital2 = AddBoneOrbital(curPlayer,tmpVec); tmpVec = MusicManager::RandomVector(&VStack_ef8); fStack_7fc = 8.0; tmpVec = Vector::__mul(tmpVec,&VStack_f00,&fStack_7fc); fStack_800 = random_float(); tmpVec = Vector::__mul(tmpVec,&VStack_f08,&fStack_800); Entity::SetVelocity(boneOrbital2,tmpVec); Entity::ClearEntityFlags(boneOrbital2,4); std::deque::push_front(); } ::Color::Color(aCStack_3f4); fVar32 = random_float(); VStack_608.y = fVar32 * 3.0 + 2.0; tmpVec = (Vector *)std::vector::operator__(); Game::SpawnParticles(g_game,tmpVec,0x23,4,VStack_608.y,color_05,100000.0,0); fVar32 = random_float(); fStack_804 = fVar32 * 3.0 + 2.0; iVar9 = Isaac::Random(2); local_5e4 = (Entity_Player *)(iVar9 + 2); if (0 < (int)local_5e4) { do { uVar26 = Random(); tmpVec = MusicManager::RandomVector(&VStack_f10); tmpVec2 = Vector::Vector(&VStack_f18,1.0,0.5); tmpVec = Vector::Mul(tmpVec,&VStack_f20,tmpVec2); tmpVec = Vector::__mul(tmpVec,&VStack_f28,&fStack_804); tmpVec2 = (Vector *)std::vector::operator__(); tmpEntity = Game::Spawn(g_game,1000,5,tmpVec2,tmpVec,(Entity *)0x0,1,uVar26); Entity::AddEntityFlags(tmpEntity,0x10000); (**(code **)(*(int *)tmpEntity + 0xc))(); local_5e4 = (Entity_Player *)((int)&local_5e4[-1]._replacedPlayer + 3); } while (local_5e4 != (Entity_Player *)0x0); local_5e4 = (Entity_Player *)0x0; curPlayer = local_5e0; } puVar27 = &local_5f0->field_0x1; local_5f0 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)FUN_0042f160(); } while (puVar27 < puVar13); } fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x34); std::vector::_Tidy(); } if (local_5d9 != '\0') { SoundEffects::PlayWithFartOverride(0x13c,1.0,0x14,0,1.0); } if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } std::deque<4byte>::~deque(); fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&boneOrbitals); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x42: if (bVar5 != 0) { SoundEffects::PlayWithFartOverride(0x413,1.0,2,0,1.0); LAB_005b83b3: goto LAB_005b83be; } goto LAB_005b83cf; case 0x43: LAB_005b83e0: local_5d9 = 1; if (local_5e0->_variant == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar8 = local_5e0; tmpVec = Entity::Position((Entity *)local_5e0,&VStack_11c8); local_5f0 = (Entity_Player *)Room::GetGridIndex(room,tmpVec); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&shovelEffects,1000,0x74,-1,0,0); fStack_14 = 1.54143e-44; pEVar10 = (Entity_Player *)0x0; local_5ec = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); local_5e4 = (Entity_Player *)*puVar15; iVar9 = Entity_Tear::TearIndex((Entity_Tear *)local_5e4); if (iVar9 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_11d0); pEVar10 = (Entity_Player *)Room::GetGridIndex(room,tmpVec); if (pEVar10 == local_5f0) { if (itemId == 0x228) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar5 = PersistentGameData::Unlocked(persistentData,0x186); if (bVar5 == 0) { Entity_Effect::set_state((Entity_Effect *)local_5e4,2); local_5d9 = 0; goto LAB_005b862a; } } pEVar8 = local_5e4; Entity_Effect::set_state((Entity_Effect *)local_5e4,1); uVar11 = 5; uVar26 = Entity::InitSeed((Entity *)pEVar8); RNG::game_constructor(&shovelRng,uVar26,uVar11); uVar26 = 0; rngPtr = &shovelRng; fStack_14._0_1_ = 0xc; tmpVec = Entity::Position((Entity *)pEVar8,&VStack_11d8); Entity_Pickup::GetRandomPickupVelocity(&VStack_c1c,tmpVec,rngPtr,uVar26); uVar26 = RNG::Next(&shovelRng); fStack_95c = 4.0; tmpVec = Vector::__mul(&VStack_c1c,&VStack_11e0,&fStack_95c); uVar11 = RNG::RandomInt(&shovelRng,3); pEVar8 = local_5e0; Game::Spawn(g_game,5,*(uint *)(&DAT_00b62fd0 + uVar11 * 4),&local_5e0->_pos,tmpVec, (Entity *)0x0,0,uVar26); SoundEffects::PlayWithFartOverride(0x394,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x395,1.0,2,0,1.0); local_5d9 = 0; fStack_14 = (float)CONCAT31(fStack_14._1_3_,0xb); guard_check_icall(); } LAB_005b862a: pEVar10 = local_5ec; } pEVar10 = (Entity_Player *)&pEVar10->field_0x1; local_5ec = pEVar10; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar10 < puVar13); } if ((itemId == 0x228) && (bVar5 = HasCollectible(pEVar8,0x248,0), bVar5 != 0)) { AddWisp(pEVar8,0x226,&pEVar8->_pos,0,0); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&shovelEffects); if ((local_5e0->_variant == 0) && (local_5d9 != 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); curPlayer = local_5e0; if (bVar5 == 0) { digPos.y = (local_5e0->_pos).y; digPos.x = (local_5e0->_pos).x; Level::GetCurrentRoom((Level *)g_game); pEVar8 = (Entity_Player *)FUN_00436040(); iVar9 = 0; local_5e4 = pEVar8; do { gridEntity = *(GridEntity **)((int)(&(pEVar8->_sprite)._filename + -3) + iVar9 * 4); if (gridEntity != (GridEntity *)0x0) { tmpVec = GridEntity::Position(gridEntity,&VStack_11e8); tmpVec = Vector::__sub(tmpVec,&VStack_11f0,&digPos); local_5ec = (Entity_Player *)Vector::LengthSquared(tmpVec); if ((float)local_5ec < 4900.0) { if (-1 < iVar9) { tmpVec = GridEntity::Position (*(GridEntity **) ((int)(&(local_5e4->_sprite)._filename + -3) + iVar9 * 4), &VStack_c70); tmpVec = Vector::__sub(tmpVec,&VStack_c28,&digPos); local_5ec = (Entity_Player *)Vector::LengthSquared(tmpVec); if ((float)local_5ec < 4900.0) { iVar25 = 0x14; goto LAB_005b87b2; } } break; } pEVar8 = local_5e4; } iVar9 = iVar9 + 1; } while (iVar9 < 8); goto LAB_005b8849; } goto LAB_005b8b6f; } } curPlayer = local_5e0; goto LAB_005b8b6f; case 0x44: if (local_5e0->_variant == 0) { AddCoins(local_5e0,-5); SoundEffects::PlayWithFartOverride(0x112,1.0,2,0,1.0); curPlayer = local_5e0; } goto LAB_005b46d8; case 0x45: if (local_5e0->_variant == 0) { SoundEffects::PlayWithFartOverride(0x77,1.0,2,0,1.0); } TemporaryEffects::AddCollectibleEffect(&curPlayer->_temporaryeffects,0x76,0,1); itemConfigDb = Isaac::GetItemConfig(); bVar5 = 0; itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x76); AddCostume(curPlayer,itemConfig,bVar5); goto LAB_005bdf0b; case 0x46: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } rngPtr = (RNG *)FUN_005cbd00(); SoundEffects::PlayWithFartOverride(0x1eb,1.0,2,0,1.0); local_5ec = (Entity_Player *)0x0; fVar32 = RNG::RandomFloat(rngPtr); VStack_608 = (Vector)(double)fVar32; if (0.03 <= (double)VStack_608) { if (0.167 <= (double)VStack_608) { if (0.333 <= (double)VStack_608) { Game::ShowFortune(g_game); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } local_5e4 = (Entity_Player *)0xa; local_5ec = (Entity_Player *)0x3; } else { local_5e4 = (Entity_Player *)0x12c; } } else { local_5e4 = (Entity_Player *)0x15e; } uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_f30,playerPos,40.0,0,0,0); Game::Spawn(g_game,5,(uint)local_5e4,tmpVec,&g_vectorZero,(Entity *)0x0,(uint)local_5ec,uVar26); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x47: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); AddCollectible(local_5e0,0x290,0,1,0,0,0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x48: SoundEffects::PlayWithFartOverride(0x33,1.0,2,0,1.0); uVar26 = Random(); curPlayer = local_5e0; effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x4e,&local_5e0->_pos,&g_vectorZero,(Entity *)local_5e0,0, uVar26); Entity_Effect::SetTimeout(effect,600); (**(code **)(*(int *)effect + 0xc))(); goto LAB_005bfa98; case 0x49: UseRedKey(local_5e0); if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } if ((-1 < slot) && (iVar9 = Game::Challenge(g_game), iVar9 == 0x2c)) { TemporaryEffects::AddNullEffect(&curPlayer->_temporaryeffects,0x6d,1,1); } goto switchD_005bfbd8_caseD_11d; case 0x4a: play_sound_with_fart_seed(0x9d,1.0,2,0,1.0); goto LAB_005bdf0b; case 0x4b: LAB_005b78cc: if (bVar5 != 0) goto LAB_005b83b3; goto LAB_005b83cf; case 0x4c: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); effect = Entity_Effect::CreateTimer(alabaster_box_timer_callback,0x1e,0,1); Entity::SetParent((Entity *)effect,(Entity *)curPlayer); bVar5 = HasCollectible(curPlayer,0x3b,0); if (bVar5 != 0) { FUN_00435cd0(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x4d: moms_bracelet_grab(local_5e0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x4e: play_sound_with_fart_seed(0xed,1.0,2,0,1.0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x4f: LAB_005b7f80: if (local_5e0->_variant == 0) { Game::GetItemPool(g_game); ItemPool::ResetRoomBlacklist(); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&eternalCollectibles,5,100,-1,0,0); fStack_14 = 5.60519e-45; local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar15; cVar7 = Entity::IsDead(tmpEntity); if ((cVar7 == '\0') && (iVar9 = Entity::SubType(tmpEntity), iVar9 != 0)) { pEVar16 = (Entity_Pickup *)__RTDynamicCast(); bVar5 = Entity_Pickup::CanReroll(pEVar16); if ((bVar5 != 0) && ((iVar9 = Entity_Pickup::OptionsPickupIndex(pEVar16), iVar9 == 0 || (iVar9 = Entity_Pickup::Timeout(pEVar16), iVar9 < 0)))) { if (itemId == 0x261) { uVar11 = 0x2c; uVar26 = Entity::DropSeed((Entity *)pEVar16); RNG::game_constructor(&RStack_264,uVar26,uVar11); fStack_14 = (float)CONCAT31(fStack_14._1_3_,5); local_5f0 = (Entity_Player *)((uint)local_5f0 | 1); local_5ec = local_5f0; local_5ec = (Entity_Player *)RNG::RandomFloat(sfxManager); pEVar10 = (Entity_Player *)0x3e800000; local_5d9 = 1; if (0.25 < (float)local_5ec) goto LAB_005b80bd; } else { LAB_005b80bd: local_5d9 = 0; } fStack_14 = 5.60519e-45; if (((uint)local_5f0 & 1) != 0) { local_5f0 = (Entity_Player *)((uint)local_5f0 & 0xfffffffe); guard_check_icall(); } if (local_5d9 == 0) { iVar9 = Entity::Variant((Entity *)pEVar16); iVar25 = Entity::Type((Entity *)pEVar16); Entity_Pickup::Morph(pEVar16,iVar25,iVar9,0,1,0,0); FUN_005b1950(); pEVar8 = local_5e0; bVar5 = HasCollectible(local_5e0,0x248,0); if (((bVar5 != 0) && ((char)local_610 != '\0')) && (itemId == 0x69)) { bVar36 = 0; bVar5 = 0; tmpVec = Entity::Position((Entity *)pEVar16,&VStack_11b8); AddWisp(pEVar8,0x69,tmpVec,bVar5,bVar36); } } else { Entity_Pickup::empty_pedestal(); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar16,aVStack_11b0); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); play_sound_with_fart_seed(0x109,0.7,2,0,1.0); pcVar3 = *(code **)(*(int *)pEVar16 + 0x24); EntityRef::EntityRef(&EStack_1980); (*pcVar3)(); } } uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar16,&VStack_11c0); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); } } puVar27 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } pEVar8 = local_5e0; bVar5 = HasCollectible(local_5e0,0x248,0); if (((bVar5 != 0) && ((char)local_610 != '\0')) && (itemId == 0x261)) { iVar9 = Isaac::Random(2); if (iVar9 == 0) { AddWisp(pEVar8,0x261,&pEVar8->_pos,0,0); } else { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&eternalWisps,3,0xce,0x261,0,0); fStack_14 = (float)CONCAT31(fStack_14._1_3_,6); local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pcVar3 = *(code **)(*(int *)*puVar15 + 0x24); EntityRef::EntityRef(&EStack_1958); (*pcVar3)(); puVar27 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); } EntityList_Query::~EntityList_Query(&eternalWisps); } } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&eternalCollectibles); iVar9 = itemId; } LAB_005b8358: if ((char)isShowAnim == '\0') goto LAB_005b3e24; IsLocalPlayer(local_5e0); SoundEffects::PlayWithFartOverride(0x38e,(float)pEVar10,2,0,1.0); goto LAB_005b3ea9; case 0x50: local_5f0 = (Entity_Player *)0x1; if ((flags & 0x400) == 0) { if ((((flags & 4) != 0) && (-1 < slot)) && (local_5e0->_activeDesc[slot]._item == 0x263)) { uStack_82c = 0xc; iStack_830 = GetTotalActiveCharge(local_5e0,slot); puVar15 = (undefined4 *)std::min(); local_5f0 = (Entity_Player *)*puVar15; if ((curPlayer->_wildCardItemType == 2) && (curPlayer->_wildCardItem == 0x263)) { curPlayer->_wildCardVarData = (int)local_5f0; } goto LAB_005c5161; } LAB_005c51ae: fVar32 = 1.0; fVar31 = 8.05747e-43; LAB_005c51c9: pEVar8 = local_5f0; play_sound_with_fart_seed((int)fVar31,fVar32,2,0,1.0); if (5 < (int)pEVar8) goto LAB_005c51d7; } else { uStack_828._0_2_ = 1; uStack_828._2_1_ = '\0'; uStack_828._3_1_ = '\0'; puVar15 = (undefined4 *)std::max(); local_5f0 = (Entity_Player *)*puVar15; curPlayer = local_5e0; LAB_005c5161: pEVar8 = local_5f0; if ((int)local_5f0 < 5) goto LAB_005c51ae; if ((int)local_5f0 < 9) { fVar32 = 1.1; fVar31 = 8.07148e-43; goto LAB_005c51c9; } play_sound_with_fart_seed(0x241,(float)(int)&local_5f0[-1].field_0x26c4 * 0.2 + 1.1,2,0,1.0); LAB_005c51d7: room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::get_color_modifier(room,&savedColorMod._red); VStack_608.y = (float)(int)&pEVar8[-1].field_0x26c7 / 9.0; FUN_004aadf0(); FUN_005b15f0(); Game::SetColorModifier(g_game,&savedColorMod,0,0.015); room = (Room *)Level::GetCurrentRoom((Level *)g_game); roomColorMod = (ColorModState *)Room::get_color_modifier(room,afStack_17a0); Game::SetColorModifier(g_game,roomColorMod,1,0.02); } iVar9 = (int)pEVar8 * (int)local_5f0; Game::ShakeScreen(g_game,(int)local_5f0 * 3 + 2 + iVar9 / 0xc); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x7f,&curPlayer->_pos,&g_vectorZero,(Entity *)curPlayer,1, uVar26); VStack_608.y = (float)tmpEntity; Entity::SetTargetPosition(tmpEntity,curPlayer->_pos); fVar32 = VStack_608.y; Entity_Effect::SetRadii ((Entity_Effect *)VStack_608.y,10.0, (float)(int)local_5f0 * 50.0 + 30.0 + (float)iVar9 * 0.8); Game::GetField26614(g_game); FUN_00429550(); (**(code **)(*(int *)fVar32 + 0x40))(); (**(code **)(*(int *)fVar32 + 0xc))(); TemporaryEffects::RemoveCollectibleEffect(&curPlayer->_temporaryeffects,0x263,-1); TemporaryEffect::TemporaryEffect(larynxEffect,(ItemConfig_Item *)local_62c); psStack_cbc = &local_5f0->_damageEvents; TemporaryEffects::AddEffect(&curPlayer->_temporaryeffects,larynxEffect,1,1); isAddTempEffect = '\0'; bVar5 = HasCollectible(curPlayer,0x248,0); if (bVar5 != 0) { if ((char)local_610 != '\0') { familiar = AddWisp(curPlayer,0x263,&curPlayer->_pos,0,0); if (familiar != (Entity_Familiar *)0x0) { fVar30 = (float10)Entity::MaxHitPoints(); pEVar8 = local_5f0; VStack_608.y = (float)(float)fVar30; FUN_00435d40(); fVar30 = (float10)Entity::HitPoints((Entity *)familiar); VStack_608.y = (float)fVar30; Entity::SetField380((Entity *)familiar,(float)fVar30 * (float)(int)pEVar8 * 0.5); FUN_005b18d0(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } } } goto LAB_005b3e24; case 0x51: if (local_5e0->_variant == 0) { if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } Config::GetCollectibles(); FUN_0074bce0(); Config::GetCollectibles(); FUN_00428ae0(); pEVar8 = GetMainTwin(curPlayer); Game::StartRoomTransition(g_game,-0xc,-1,3,pEVar8,0); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { effect = Entity_Effect::CreateTimer(FUN_005c7e30,1,1,1); pEVar8 = GetMainTwin(curPlayer); Entity::SetParent((Entity *)effect,(Entity *)pEVar8); local_5d9 = (byte)isShowAnim; break; } } goto LAB_005bc067; case 0x52: if (0 < local_5e0->_numKeys) { SetItemState(local_5e0); AnimateCollectible(curPlayer,itemId,(byte *)"LiftItem",(byte *)"PlayerPickupSparkle"); } goto switchD_005bfbd8_caseD_11d; case 0x53: itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x271); TemporaryEffect::TemporaryEffect(megaMushEffect,itemConfig); Game::GetField26614(g_game); cVar7 = FUN_00429550(); pEVar10 = local_5e0; puVar13 = megaMushEffect; if (cVar7 != '\0') { uStack_bdc = 300; } fVar35 = 8.489231e-39; TemporaryEffects::AddEffect(&local_5e0->_temporaryeffects,puVar13,1,1); local_5d9 = (byte)isShowAnim; if ((local_5d9 != 0) && (iVar9 = pEVar10->_playerCostumeMap[4]._index, -1 < iVar9)) { iVar25 = 0x5c70ae; pAVar23 = (ANM2 *)FUN_005cbd10(); piVar14 = *(int **)pAVar23[1]._filename._buf; if ((piVar14 != (int *)0x0) && ((*piVar14 == 3 && (piVar14[1] == 0x271)))) { VStack_608.y = (float)((int)register0x00000010 + -0x1af0); ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x1af0),pAVar23); fStack_14 = 9.52883e-44; Game::GetItemOverlay(g_game); pAVar23 = (ANM2 *)FUN_005b1820(); fStack_14 = -NAN; other._color._colorize[0] = in_stack_ffffe5c8; other._filename._buf[0] = in_stack_ffffe510[0]; other._filename._buf[1] = in_stack_ffffe510[1]; other._filename._buf[2] = in_stack_ffffe510[2]; other._filename._buf[3] = in_stack_ffffe510[3]; other._filename._buf[4] = in_stack_ffffe510[4]; other._filename._buf[5] = in_stack_ffffe510[5]; other._filename._buf[6] = in_stack_ffffe510[6]; other._filename._buf[7] = in_stack_ffffe510[7]; other._filename._buf[8] = in_stack_ffffe510[8]; other._filename._buf[9] = in_stack_ffffe510[9]; other._filename._buf[10] = in_stack_ffffe510[10]; other._filename._buf[0xb] = in_stack_ffffe510[0xb]; other._filename._buf[0xc] = in_stack_ffffe510[0xc]; other._filename._buf[0xd] = in_stack_ffffe510[0xd]; other._filename._buf[0xe] = in_stack_ffffe510[0xe]; other._filename._buf[0xf] = in_stack_ffffe510[0xf]; other._filename._size = in_stack_ffffe510._16_4_; other._filename._capacity = in_stack_ffffe510._20_4_; other._animDefaultName._buf[0] = in_stack_ffffe510[0x18]; other._animDefaultName._buf[1] = in_stack_ffffe510[0x19]; other._animDefaultName._buf[2] = in_stack_ffffe510[0x1a]; other._animDefaultName._buf[3] = in_stack_ffffe510[0x1b]; other._animDefaultName._buf[4] = in_stack_ffffe510[0x1c]; other._animDefaultName._buf[5] = in_stack_ffffe510[0x1d]; other._animDefaultName._buf[6] = in_stack_ffffe510[0x1e]; other._animDefaultName._buf[7] = in_stack_ffffe510[0x1f]; other._animDefaultName._buf[8] = in_stack_ffffe510[0x20]; other._animDefaultName._buf[9] = in_stack_ffffe510[0x21]; other._animDefaultName._buf[10] = in_stack_ffffe510[0x22]; other._animDefaultName._buf[0xb] = in_stack_ffffe510[0x23]; other._animDefaultName._buf[0xc] = in_stack_ffffe510[0x24]; other._animDefaultName._buf[0xd] = in_stack_ffffe510[0x25]; other._animDefaultName._buf[0xe] = in_stack_ffffe510[0x26]; other._animDefaultName._buf[0xf] = in_stack_ffffe510[0x27]; other._animDefaultName._size = in_stack_ffffe510._40_4_; other._animDefaultName._capacity = in_stack_ffffe510._44_4_; other._animState._animation = (void *)in_stack_ffffe510._48_4_; other._animState._animData = (void *)in_stack_ffffe510._52_4_; other._animState._layerFrames = (void *)in_stack_ffffe510._56_4_; other._animState._nullLayerFrames = (void *)in_stack_ffffe510._60_4_; other._animState._animFrame = (float)in_stack_ffffe510._64_4_; other._animState._isPlaying = in_stack_ffffe510[0x44]; other._animState._21_3_ = in_stack_ffffe510._69_3_; other._animState._currentlyTriggeredEvents = in_stack_ffffe510._72_4_; other._animState._previouslyTriggeredEvents = in_stack_ffffe510._76_4_; other._overlayAnimState._animation = (void *)in_stack_ffffe510._80_4_; other._overlayAnimState._animData = (void *)in_stack_ffffe510._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_ffffe510._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_ffffe510._92_4_; other._overlayAnimState._animFrame = (float)in_stack_ffffe510._96_4_; other._overlayAnimState._isPlaying = in_stack_ffffe510[100]; other._overlayAnimState._21_3_ = in_stack_ffffe510._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_ffffe510._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_ffffe510._108_4_; other._overlayRenderFirst = in_stack_ffffe510[0x70]; other._113_3_ = in_stack_ffffe510._113_3_; other._animData = (void *)in_stack_ffffe510._116_4_; other._animCount = in_stack_ffffe510._120_4_; other._layerState = (void *)in_stack_ffffe510._124_4_; other._layerCount = in_stack_ffffe510._128_4_; other._nullLayerNames = (void *)in_stack_ffffe510._132_4_; other._numNullLayers = in_stack_ffffe510._136_4_; other._eventNames = (void *)in_stack_ffffe510._140_4_; other._numEvents = in_stack_ffffe510._144_4_; other._offset.x = (float)in_stack_ffffe510._148_4_; other._offset.y = (float)in_stack_ffffe510._152_4_; other._scale.x = (float)in_stack_ffffe510._156_4_; other._scale.y = (float)in_stack_ffffe510._160_4_; other._rotation = (float)in_stack_ffffe510._164_4_; other._color._tint[0] = (float)in_stack_ffffe510._168_4_; other._color._tint[1] = (float)in_stack_ffffe510._172_4_; other._color._tint[2] = (float)in_stack_ffffe510._176_4_; other._color._tint[3] = (float)in_stack_ffffe510._180_4_; other._color._colorize[1] = in_stack_ffffe5cc; other._color._colorize[2] = in_stack_ffffe5d0; other._color._colorize[3] = in_stack_ffffe5d4; other._color._offset[0] = in_stack_ffffe5d8; other._color._offset[1] = in_stack_ffffe5dc; other._color._offset[2] = in_stack_ffffe5e0; other._championColor._tint[0] = in_stack_ffffe5e4; other._championColor._tint[1] = in_stack_ffffe5e8; other._championColor._tint[2] = in_stack_ffffe5ec; other._championColor._tint[3] = in_stack_ffffe5f0; other._championColor._colorize[0] = in_stack_ffffe5f4; other._championColor._colorize[1] = in_stack_ffffe5f8; other._championColor._colorize[2] = in_stack_ffffe5fc; other._championColor._colorize[3] = in_stack_ffffe600; other._championColor._offset[0] = in_stack_ffffe604; other._championColor._offset[1] = fVar31; other._championColor._offset[2] = fVar32; other._256_4_ = pEVar8; other._playbackSpeed = fVar35; other._264_4_ = puVar13; other._shadowLayerIndex = iVar25; other._bitflags = iVar9; ANM2::operator_assign(pAVar23,other); Game::GetItemOverlay(g_game); sprite = (Sprite *)FUN_005b1820(); tmpVec = (Vector *)Sprite::Scale((Sprite *)&pEVar10->_sprite); Sprite::SetScale(sprite,tmpVec); Game::GetItemOverlay(g_game); pAVar23 = (ANM2 *)FUN_005b1820(); ANM2::Play(pAVar23,(byte *)"Transform",1); layerIndex = 0; Game::GetItemOverlay(g_game); sprite = (Sprite *)FUN_005b1820(); iVar9 = Sprite::GetLayerCount(sprite); if (iVar9 != 0) { do { Game::GetItemOverlay(g_game); sprite = (Sprite *)FUN_005b1820(); tmpVec = &g_vectorZero; layerState = Sprite::GetLayer(sprite,(byte *)layerIndex); Vector::operator_assign(&layerState->_pos,tmpVec); layerIndex = layerIndex + 1; Game::GetItemOverlay(g_game); sprite = (Sprite *)FUN_005b1820(); layerCount = Sprite::GetLayerCount(sprite); } while ((uint)layerIndex < (uint)layerCount); } itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x2d,0,pEVar10); pEVar10->_visible = 0; } local_5d9 = (byte)isShowAnim; } isAddTempEffect = '\0'; curPlayer = local_5e0; break; case 0x54: SoundEffects::PlayWithFartOverride(0x41e,1.0,2,0,1.0); Config::GetCollectibles(); FUN_007515c0(); uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x55: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } Level::GetCurrentRoom((Level *)g_game); VStack_608.y = (float)Room::GetEntities(); iVar9 = EntityList::Size(); if (iVar9 != 0) { uVar26 = 0; do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)Entity::to_npc_or_coop_player((Entity *)*puVar15); local_5e4 = pEVar8; if (pEVar8 != (Entity_Player *)0x0) { local_609 = 0; bVar5 = Entity::is_same_segmented_body((Entity *)pEVar8,(Entity *)0x0); if ((bVar5 == 0) || (pEVar10 = (Entity_Player *)Entity::GetStatusEffectTarget((Entity *)pEVar8), pEVar10 != pEVar8)) { bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0); if ((bVar5 != 0) && (bVar5 = Entity::is_same_segmented_body((Entity *)pEVar8,(Entity *)0x0), bVar5 == 0)) { cVar7 = (**(code **)(*(int *)pEVar8 + 0x48))(); if ((cVar7 == '\0') && (bVar5 = Entity::IsType((Entity *)pEVar8,0x322,-1,-1), bVar5 == 0)) { bVar5 = Entity::IsType((Entity *)pEVar8,0x32f,-1,-1); goto LAB_005c3a69; } goto LAB_005c3a6f; } } else { FUN_00424510(); fStack_14 = 8.12753e-44; do { bVar5 = Entity::IsVulnerableEnemy((Entity *)pEVar8,(Entity *)0x0); if (bVar5 != 0) { pEStack_814 = pEVar8; std::vector::push_back(); } pEVar8 = (Entity_Player *)Entity::Child((Entity *)pEVar8); } while (pEVar8 != (Entity_Player *)0x0); cVar7 = FUN_004bc660(); if (cVar7 == '\0') { std::vector::size(auStack_8f0); puVar15 = (undefined4 *)FUN_0042c810(); local_609 = 1; local_5e4 = (Entity_Player *)*puVar15; } fStack_14 = -NAN; FID_conflict__Tidy(auStack_8f0); bVar5 = local_609; LAB_005c3a69: if (bVar5 != 0) { LAB_005c3a6f: uVar11 = Random(); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_f50); tmpEntity = Game::Spawn(g_game,1000,0xb0,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar11); Entity::SetTarget(tmpEntity,(Entity *)local_5e4); (**(code **)(*(int *)tmpEntity + 0xc))(); SoundEffects::PlayWithFartOverride(0xfc,1.0,2,0,0.9); } } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } bVar5 = HasCollectible(curPlayer,0x248,0); if (bVar5 != 0) { if ((char)local_610 != '\0') { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&cleaverWisps,3,0xce,-1,0,0); fStack_14 = 8.26766e-44; iVar9 = EntityList::Size(); if (iVar9 != 0) { uVar26 = 0; do { uVar11 = Random(); puVar15 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar15,&VStack_f58); tmpEntity = Game::Spawn(g_game,1000,0xb0,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar11); puVar15 = (undefined4 *)std::vector::operator_index(); Entity::SetTarget(tmpEntity,(Entity *)*puVar15); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } bVar36 = 0; bVar5 = 1; tmpVec = Entity::Position((Entity *)curPlayer,&VStack_f60); AddWisp(curPlayer,0x277,tmpVec,bVar5,bVar36); fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&cleaverWisps); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } } goto LAB_005b3e24; case 0x56: local_5e4 = (Entity_Player *)FUN_005c92f0(); if (local_5e4 != (Entity_Player *)0x0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_f48); VStack_608 = *tmpVec; iVar9 = Room::GetGridCollisionAtPos(room,VStack_608); if (curPlayer->_canFly == 0) { if ((iVar9 == 0) || (iVar9 == 5)) goto LAB_005c320a; } else if (iVar9 != 4) { LAB_005c320a: bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(curPlayer,0x27b,&curPlayer->_pos,0,0); } pEVar8 = local_5e4; FUN_00436200(); (**(code **)(*(int *)pEVar8 + 0xc))(); local_5d9 = (byte)isShowAnim; break; } } goto LAB_005bc067; case 0x57: if (local_5f8 != (Entity_Player *)0x0) { useResult._1_1_ = 1; } effect = Entity_Effect::CreateTimer(&LAB_005c7ee0,1,0,0); curPlayer = local_5e0; Entity::SetParent((Entity *)effect,(Entity *)local_5e0); SoundEffects::PlayWithFartOverride(0x388,1.0,2,0,1.0); local_5d9 = 0; if ((char)isShowAnim != '\0') { effect = Entity_Effect::CreateTimer(FUN_005c7ef0,3,0,0); Entity::SetParent((Entity *)effect,(Entity *)curPlayer); Entity::AddEntityFlags((Entity *)effect,0x2000000000); local_5d9 = (byte)isShowAnim; break; } goto LAB_005bc073; case 0x58: goto LAB_005b7f60; case 0x59: if (local_5e0->_variant == 0) { iVar9 = 0x9d; if (local_5e0->_playerType == 0x16) { iVar9 = 0x266; } play_sound_with_fart_seed(iVar9,1.0,2,0,1.0); AddRottenHearts(curPlayer,2,0); } LAB_005bdf0b: local_5d9 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); goto switchD_005bfbd8_caseD_11d; } goto LAB_005b54cf; case 0x5a: bVar5 = TemporaryEffects::HasCollectibleEffect(&local_5e0->_temporaryeffects,0x280); if (bVar5 == 0) { SoundEffects::PlayWithFartOverride(0x23c,1.0,2,0,1.0); } else { TemporaryEffects::RemoveCollectibleEffect(&curPlayer->_temporaryeffects,0x280,-1); if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,0x280,(byte *)"HideItem",(byte *)"PlayerPickupSparkle"); } SoundEffects::PlayWithFartOverride(0x23d,1.0,2,0,1.0); LAB_005b54bc: isAddTempEffect = '\0'; } goto switchD_005bfbd8_caseD_11d; case 0x5b: if (local_5e0->_variant == 0) { if (bVar5 != 0) { AnimateCollectible(local_5e0,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } FUN_005b18b0(); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar26 = Room::GetSeededCollectible(room,uVar26,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&skinSpawnPos,(Vector *)local_5ec,40.0,0,0,0); uVar11 = RNG::Next(rngPtr); tmpEntity = Game::Spawn(g_game,5,100,&skinSpawnPos,&g_vectorZero,(Entity *)0x0,uVar26,uVar11); Entity::ClearEntityFlags(tmpEntity,4); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&skinSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar26); pcVar3 = *(code **)(*(int *)tmpEntity + 0x3c); ::Color::Color(); (*pcVar3)(); SoundEffects::PlayWithFartOverride(0x411,1.0,2,0,1.0); pEVar8 = local_5e0; if (local_5e0->_maxHearts < 1) { if (local_5e0->_boneHearts < 1) { AddSoulHearts(local_5e0,-4,0); } else { AddBoneHearts(local_5e0,-1); } } else { AddMaxHearts(local_5e0,-2,0); } iVar9 = pEVar8->_playerType; if (iVar9 == 10) { LAB_005c3074: if (iVar9 != 10) goto LAB_005c3079; LAB_005c308b: uVar6 = useResult._1_1_; if (local_5f8 != (Entity_Player *)0x0) { uVar6 = 1; } useResult = CONCAT11(uVar6,(char)useResult); FUN_005b18a0(); FUN_005b18b0(); } else { if (iVar9 != 0x1f) { AddBrokenHearts(pEVar8,1); iVar9 = pEVar8->_playerType; goto LAB_005c3074; } LAB_005c3079: if ((iVar9 == 0x1f) || (iVar9 = GetHeartLimit(pEVar8,0), iVar9 < 1)) goto LAB_005c308b; } *(undefined4 *)&pEVar8->_lastDamageFlags = 0x400; *(undefined4 *)((int)&pEVar8->_lastDamageFlags + 4) = 0; curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x5c: if (bVar5 != 0) { AnimateCollectible(local_5e0,0x28a,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } SoundEffects::PlayWithFartOverride(0x1df,1.0,2,0,1.0); effect = Entity_Effect::CreateTimer(FUN_005c7d30,0xf,1,0); Entity::SetPosition((Entity *)effect,playerPos); Entity::SetParent((Entity *)effect,(Entity *)local_5e0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x5d: local_5f8 = (Entity_Player *)0x0; Level::GetCurrentRoom((Level *)g_game); local_5f0 = (Entity_Player *)Room::GetEntities(); local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity_Player *)*puVar15; local_5ec = pEVar8; Level::GetCurrentRoom((Level *)g_game); camera = (Camera *)FUN_00428a70(); tmpVec = Entity::Position((Entity *)pEVar8,&VStack_f38); bVar5 = Camera::IsPosVisible(camera,tmpVec); if (bVar5 != 0) { bVar5 = Entity::IsEnemy((Entity *)pEVar8); if ((bVar5 == 0) || (cVar7 = Entity::IsDead((Entity *)pEVar8), cVar7 != '\0')) { bVar5 = Entity::IsType((Entity *)pEVar8,1000,0x90,0); if ((bVar5 != 0) && (iVar9 = Entity::FrameCount((Entity *)pEVar8), 1 < iVar9)) { cVar7 = Entity::Exists((Entity *)pEVar8); pEVar10 = local_5e0; if (cVar7 != '\0') { bVar5 = HasCollectible(local_5e0,0x3b,0); if (bVar5 == 0) { Entity_Effect::set_state((Entity_Effect *)pEVar8,1); (**(code **)(*(int *)pEVar8 + 0xc))(); local_5f8 = (Entity_Player *)&local_5f8->field_0x1; } else { uVar11 = 0xd; uVar26 = Entity::InitSeed(); RNG::game_constructor(aRStack_244,uVar26,uVar11); fStack_14 = 7.84727e-44; uVar26 = RNG::Next(curPlayer); tmpVec = Entity::Position((Entity *)local_5ec,&VStack_f40); tmpEntity = Game::Spawn(g_game,1000,0xbd,tmpVec,&g_vectorZero,(Entity *)pEVar10,1, uVar26); fStack_14 = -NAN; guard_check_icall(); sprite = (Sprite *)Entity::GetSprite(tmpEntity); Sprite::SetLastFrame(sprite); pcVar3 = *(code **)(*(int *)tmpEntity + 0x3c); ::Color::Color(); (*pcVar3)(); pEVar8 = local_5ec; tmpVec = (Vector *)Entity::SpriteScale((Entity *)local_5ec); Entity::SetSpriteScale(tmpEntity,tmpVec); (**(code **)(*(int *)tmpEntity + 0xc))(); (**(code **)(*(int *)pEVar8 + 0x28))(); } } } } else { bVar5 = Entity::IsType((Entity *)pEVar8,0x34a,-1,-1); pEVar10 = local_5e0; if (bVar5 != 0) { pcVar3 = *(code **)(*(int *)pEVar8 + 0x24); EntityRef::constructor(&EStack_1568,(Entity *)local_5e0); (*pcVar3)(); pEVar8 = local_5ec; } fVar30 = (float10)Entity::HitPoints((Entity *)pEVar8); pEStack_614 = (Entity_Pickup *)(float)fVar30; fVar30 = (float10)Entity::MaxHitPoints(); VStack_608.y = (float)(fVar30 * (float10)0.5); if (((float)pEStack_614 < (float)(fVar30 * (float10)0.5)) && (iVar9 = FUN_00417490(), (*(uint *)(iVar9 + 0xd8) & 8) != 0)) { pcVar3 = *(code **)(*(int *)pEVar8 + 0x24); EntityRef::constructor(&EStack_1590,(Entity *)pEVar10); (*pcVar3)(); } } } pEVar8 = local_5f8; puVar27 = &local_5e4->field_0x1; local_5e4 = (Entity_Player *)puVar27; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar27 < puVar13); if (0 < (int)pEVar8) { iVar9 = (int)((float)(int)pEVar8 + 8.0); if (0x14 < iVar9) { iVar9 = 0x14; } fVar32 = random_float(); SoundEffects::PlayWithFartOverride(0x1dd,1.0,2,0,fVar32 * 0.2 + 0.9); Game::ShakeScreen(g_game,iVar9); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } } goto LAB_005b3e24; case 0x5e: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } iVar9 = slot; local_5f0 = (Entity_Player *)0x1; if ((flags & 0x400) == 0) { if ((((flags & 4) != 0) && (-1 < slot)) && (curPlayer->_activeDesc[slot]._item == 0x2ad)) { local_5f0 = (Entity_Player *)curPlayer->_activeDesc[slot]._varData; puStack_808 = &local_5f0->field_0x1; acStack_80c[0] = '\f'; acStack_80c[1] = '\0'; acStack_80c[2] = '\0'; acStack_80c[3] = '\0'; piVar14 = (int *)std::min(); curPlayer->_activeDesc[iVar9]._varData = *piVar14; } } else { local_5f0 = (Entity_Player *)varData; } FUN_00424510(); fStack_14 = 7.9874e-44; uVar26 = 0; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); iVar9 = std::vector::size(pvVar24); if (iVar9 != 0) { do { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,uVar26); if (((itemConfig != (ItemConfig_Item *)0x0) && (itemConfig->type == 3)) && ((itemConfig[1].type != 0 && (0 < *(short *)(itemConfig[1].type + 400))))) { uStack_810 = uVar26; std::vector::push_back(); } uVar26 = uVar26 + 1; Isaac::GetItemConfig(); pvVar24 = (void *)Config::GetCollectibles(); uVar11 = std::vector::size(pvVar24); } while (uVar26 < uVar11); } if ((int)local_5f0 < 1) { pEVar8 = local_5ec; } else { do { rngPtr = (RNG *)FUN_005cbd00(); fVar32 = RNG::RandomFloat(rngPtr); VStack_608.y = fVar32; if (0.67 <= fVar32) { LAB_005c3686: itemConfigDb = Isaac::GetItemConfig(); pEVar8 = (Entity_Player *)ItemConfig::GetCollectible(itemConfigDb,0x248); local_5ec = pEVar8; } else { rngPtr = (RNG *)FUN_005cbd00(); iVar9 = std::vector::size(auStack_9cc); RNG::RandomInt(rngPtr,iVar9 - 1); piVar14 = (int *)FUN_0042c810(); iVar9 = *piVar14; itemConfigDb = Isaac::GetItemConfig(); pEVar8 = (Entity_Player *)ItemConfig::GetCollectible(itemConfigDb,iVar9); local_5ec = pEVar8; if (((pEVar8 == (Entity_Player *)0x0) || (bVar5 = ItemConfig::IsValidCollectible(*(int *)&pEVar8->field_0x4), bVar5 == 0)) || (*(int *)pEVar8 != 3)) goto LAB_005c3686; } pvVar24 = (pEVar8->_sprite)._nullLayerNames; if ((pvVar24 == (void *)0x0) || (*(short *)((int)pvVar24 + 400) < 1)) { itemConfigDb = Isaac::GetItemConfig(); pEVar8 = (Entity_Player *)ItemConfig::GetCollectible(itemConfigDb,0x248); local_5ec = pEVar8; } if ((*(int *)&pEVar8->field_0x4 == 0x248) && (bVar5 = HasCollectible(curPlayer,0x3b,0), bVar5 != 0)) { itemConfigDb = Isaac::GetItemConfig(); local_5ec = (Entity_Player *)ItemConfig::GetCollectible(itemConfigDb,0x124); } pEVar8 = (Entity_Player *)&curPlayer->_pos; AddWisp(curPlayer,*(int *)&local_5ec->field_0x4,(Vector *)pEVar8,1,0); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { AddWisp(curPlayer,*(int *)&local_5ec->field_0x4,(Vector *)pEVar8,1,0); AddWisp(curPlayer,*(int *)&local_5ec->field_0x4,(Vector *)pEVar8,1,0); } local_5f0 = (Entity_Player *)((int)&local_5f0[-1]._replacedPlayer + 3); } while (local_5f0 != (Entity_Player *)0x0); local_5f0 = (Entity_Player *)0x0; } SoundEffects::PlayWithFartOverride2(0x1d7,(int)pEVar8,2,0,1.0,1.0); fStack_14 = -NAN; FID_conflict__Tidy(auStack_9cc); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x5f: friendTypes = (void *)0xe3; friendVariants = 0; pvStack_170 = (void *)0x115; pvStack_16c = (void *)0x0; pvStack_168 = (void *)0xe3; pvStack_164 = (void *)0x1; pvStack_160 = (void *)0x35; pvStack_15c = (void *)0x0; pvStack_d8 = (void *)0x57; pvStack_158 = (void *)0x35; pvStack_154 = (void *)0x1; puStack_150 = &DAT_0000000f; pvStack_14c = (void *)0x0; pvStack_d4 = (void *)0x0; puStack_148 = &DAT_0000000f; pvStack_144 = (void *)0x1; puStack_140 = &DAT_0000000f; pvStack_13c = (void *)0x2; puStack_138 = &DAT_0000000f; pvStack_134 = (void *)0x3; pvStack_130 = (void *)0x335; pvStack_12c = (void *)0x0; pvStack_128 = (void *)0x334; pvStack_124 = (void *)0x0; pvStack_120 = (void *)0x334; pvStack_11c = (void *)0x1; pvStack_118 = (void *)0x16; pvStack_114 = (void *)0x0; pvStack_110 = (void *)0x16; pvStack_10c = (void *)0x1; pvStack_108 = (void *)0x16; pvStack_104 = (void *)0x2; pvStack_100 = (void *)0xcd; pvStack_fc = (void *)0x0; pvStack_f8 = (void *)0x1a; pvStack_f4 = (void *)0x0; puStack_f0 = &DAT_00000027; pvStack_ec = (void *)0x0; puStack_e8 = &DAT_00000027; pvStack_e4 = (void *)0x1; puStack_e0 = &DAT_00000027; pvStack_dc = (void *)0x2; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,0x15); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); tmpVec = MusicManager::RandomVector(&VStack_f78); fStack_818 = 10.0; VStack_608.y = (float)&local_5e0->_pos; tmpVec = Vector::__mul(tmpVec,&VStack_f80,&fStack_818); tmpVec = Vector::__add((Vector *)VStack_608.y,&VStack_f88,tmpVec); tmpEntity = Game::Spawn(g_game,(uint)(&friendTypes)[uVar26 * 2],(&friendVariants)[uVar26 * 2], tmpVec,&g_vectorZero,(Entity *)local_5e0,0,uVar11); curPlayer = local_5e0; EntityRef::constructor(&EStack_15b8,(Entity *)local_5e0); Entity::AddCharmed(tmpEntity,&EStack_15b8,-1,0,0); FUN_005b1830(); (**(code **)(*(int *)tmpEntity + 0xc))(); bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { bVar36 = 0; bVar5 = 0; tmpVec = &curPlayer->_pos; rngPtr = (RNG *)FUN_005cbd00(); iVar9 = Entity_Familiar::GetRandomWisp(rngPtr); AddWisp(curPlayer,iVar9,tmpVec,bVar5,bVar36); } LAB_005bfa98: local_5d9 = 0; if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); local_5d9 = (byte)isShowAnim; break; } goto LAB_005bc073; case 0x61: play_sound_with_fart_seed(0x250,1.0,2,0,1.0); fVar32 = 9.10844e-43; LAB_005b562c: play_sound_with_fart_seed((int)fVar32,1.0,2,0,1.0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x62: uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&local_5e0->_pos,&g_vectorZero,(Entity *)0x0,0,uVar26); pcVar3 = *(code **)(*(int *)tmpEntity + 0x3c); ::Color::Color(); (*pcVar3)(); SoundEffects::PlayWithFartOverride(0x415,1.0,2,0,1.0); curPlayer = local_5e0; if (local_5e0->_markedTarget != (int *)0x0) { (**(code **)(*(int *)local_5e0->_markedTarget + 0x28))(); EntityPtr::SetReference((EntityPtr *)&curPlayer->_markedTarget,(Entity *)0x0); } if (curPlayer->_darkArtsLastSnare == (void *)0x0) { uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xc2,&curPlayer->_pos,&g_vectorZero,(Entity *)curPlayer,0, uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); EntityPtr::SetReference((EntityPtr *)&curPlayer->_darkArtsLastSnare,tmpEntity); std::vector::clear(&curPlayer->_darkArtsHitList,0); curPlayer->_darkArtsDamage = 0.0; local_5d9 = (byte)isShowAnim; break; } LAB_005bc067: local_5d9 = (byte)isShowAnim; LAB_005bc073: break; case 99: if (local_5e0->_variant == 0) { local_5d9 = 0; if ((((local_5e0->_queuedItem)._item != (void *)0x0) && (cVar7 = Item::IsCollectible(), cVar7 != '\0')) && (bVar5 = Item::HasTags((curPlayer->_queuedItem)._item,0x8000), bVar5 == 0)) { Isaac::SpawnLocust(curPlayer,*(int *)((int)(curPlayer->_queuedItem)._item + 4), &curPlayer->_pos); ClearQueueItem(curPlayer); local_5d9 = 1; } Level::GetCurrentRoom((Level *)g_game); local_5ec = (Entity_Player *)Room::GetEntities(); local_5f8 = (Entity_Player *)0xffffffff; EntityPtr::clear((EntityPtr *)&VStack_a0c); local_5e4 = (Entity_Player *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Type((Entity *)*puVar15); if (iVar9 == 5) { puVar15 = (undefined4 *)std::vector::operator_index(); cVar7 = Entity::IsDead((Entity *)*puVar15); if (cVar7 == '\0') { std::vector::operator_index(); pEVar8 = (Entity_Player *)FUN_00435e30(); local_5f0 = pEVar8; bVar5 = Entity_Pickup::CanReroll((Entity_Pickup *)pEVar8); if ((((bVar5 != 0) && (cVar7 = Entity_Pickup::IsShopItem((Entity_Pickup *)pEVar8), cVar7 == '\0')) && ((pEVar8 != (Entity_Player *)0x0 && ((iVar9 = Entity::Variant((Entity *)pEVar8), iVar9 == 100 && (iVar9 = Entity::SubType((Entity *)pEVar8), iVar9 != 0)))))) && (iVar9 = Entity_Pickup::Timeout((Entity_Pickup *)pEVar8), iVar9 < 1)) { tmpVec = Entity::Position((Entity *)pEVar8,&VStack_f68); iVar9 = Entity::SubType((Entity *)local_5f0); Isaac::SpawnLocust(curPlayer,iVar9,tmpVec); (**(code **)(*(int *)local_5f0 + 0x28))(); Entity_Pickup::RemoveOtherOptions(); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar5 = PlayerManager::IsCoopPlay(playerManager); if ((bVar5 != 0) && (iVar9 = FUN_005b1960(), iVar9 != -1)) { Game::GetPlayerManager(g_game); uVar26 = PlayerManager::GetNumAlivePlayers(); iVar9 = FUN_005b1960(); if (iVar9 + 1U < uVar26) { local_5f8 = (Entity_Player *)FUN_005b1960(); tmpVec = Entity::Position((Entity *)local_5f0,&VStack_f70); Vector::operator_assign(&VStack_a0c,tmpVec); } } local_5d9 = 1; } } } local_5e4 = (Entity_Player *)&local_5e4->field_0x1; pEVar8 = (Entity_Player *)EntityList::Size(); } while (local_5e4 < pEVar8); } if (local_5d9 == 0) { SoundEffects::PlayWithFartOverride(0x430,1.0,2,0,1.0); } else { SoundEffects::PlayWithFartOverride(0x342,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x431,1.0,2,0,1.0); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar5 = PlayerManager::IsCoopPlay(playerManager); if ((bVar5 != 0) && (local_5f8 != (Entity_Player *)0xffffffff)) { itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar26 = RNG::Next(&curPlayer->_dropRNG); uVar26 = ItemPool::GetCollectible(itemPool,2,uVar26,0,0,0); uVar11 = RNG::Next(&curPlayer->_dropRNG); tmpEntity = Game::Spawn(g_game,5,100,&VStack_a0c,&g_vectorZero,(Entity *)0x0,uVar26,uVar11 ); FUN_006e2ff0(); (**(code **)(*(int *)tmpEntity + 0xc))(); } Level::GetCurrentRoom((Level *)g_game); iVar9 = GridEntity::GetVariant(); if (iVar9 != 0xb) { Level::GetCurrentRoom((Level *)g_game); iVar9 = GridEntity::GetVariant(); if (iVar9 != 0x11) goto LAB_005bbadc; } ambush = (Ambush *)Game::GetAmbush(g_game); Ambush::StartChallenge(ambush); } goto LAB_005bbadc; } LAB_005bbae2: bVar5 = 0; if ((char)isShowAnim != '\0') { pcVar38 = "UseItem"; LAB_005b8b8d: AnimateCollectible(curPlayer,iVar9,(byte *)pcVar38,(byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e2a; case 100: if (local_5e0->_suplexState == 0) { fVar32 = Vector::LengthSquared(&local_5e0->_velocity); VStack_608.y = fVar32; if ((1.0 < fVar32) && (bVar5 = TemporaryEffects::HasCollectibleEffect(&curPlayer->_temporaryeffects,0x271), bVar5 == 0)) { SoundEffects::PlayWithFartOverride(0x406,1.0,2,0,1.0); tmpVec = Vector::Normalized(&curPlayer->_velocity,&VStack_f90); fStack_81c = 10.0; tmpVec = Vector::__mul(tmpVec,&VStack_f98,&fStack_81c); Entity::SetVelocity((Entity *)curPlayer,tmpVec); curPlayer->_suplexState = 1; curPlayer->_suplexAimCountdown = 0x10; std::vector::clear(&curPlayer->_contactHitList,0); fVar32 = random_float(); play_sound_with_fart_seed(0xfc,1.0,2,0,fVar32 * 0.2 + 0.9); goto LAB_005b54bc; } } goto switchD_005bfbd8_caseD_11d; case 0x65: local_5d9 = bVar5; if (local_5e0->_variant != 0) goto LAB_005bc073; SoundEffects::PlayWithFartOverride(0x432,1.0,2,0,1.0); iVar25 = Game::Challenge(g_game); if (iVar25 != 0x2b) { if (((slot == 0) || (slot == 1)) && (curPlayer->_bagOfCraftingOutput != 0)) { itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,curPlayer->_bagOfCraftingOutput); if (itemConfig != (ItemConfig_Item *)0x0) { FUN_005b19d0(); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); uVar26 = curPlayer->_bagOfCraftingOutput; room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,aVStack_fb8,&local_5e0->_pos,40.0,1,0,0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,uVar26,uVar11); FUN_005b19d0(); curPlayer = local_5e0; FUN_005b1990(); bVar5 = HasCollectible(curPlayer,0x248,0); if (bVar5 != 0) { bVar36 = 0; bVar5 = 0; tmpVec = &curPlayer->_pos; rngPtr = (RNG *)FUN_005cbd00(); iVar9 = Entity_Familiar::GetRandomWisp(rngPtr); AddWisp(curPlayer,iVar9,tmpVec,bVar5,bVar36); } iVar9 = itemId; } curPlayer->_bagOfCraftingHoldFrames = 0; puVar15 = (undefined4 *)FUN_005b1560(); uVar17 = puVar15[1]; curPlayer->_bagOfCraftingOutput = *puVar15; pGVar21 = g_game; *(undefined4 *)&curPlayer->field_0x1f50 = uVar17; curPlayer->_bagOfCraftingContent[0] = 0; curPlayer->_bagOfCraftingContent[1] = 0; curPlayer->_bagOfCraftingContent[2] = 0; curPlayer->_bagOfCraftingContent[3] = 0; curPlayer->_bagOfCraftingContent[4] = 0; curPlayer->_bagOfCraftingContent[5] = 0; curPlayer->_bagOfCraftingContent[6] = 0; curPlayer->_bagOfCraftingContent[7] = 0; hud = (HUD *)Game::GetHUD(pGVar21); HUD::InvalidateCraftingItem(hud,curPlayer); play_sound_with_fart_seed(0x10c,1.0,2,0,1.0); pcVar38 = "UseItem"; } else { SetItemState(curPlayer); pcVar38 = "LiftItem"; } goto LAB_005b8b8d; } iVar9 = std::vector::size(&curPlayer->_itemCards); if (iVar9 != 0) { piVar14 = (int *)EntityPtr::Ref(); AnimateCollectible(curPlayer,*piVar14,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); EntityPtr::Ref(); std::set::find(); std::iterator_copy(&curPlayer->_roomTemporaryCollectibles,auStack_be8); cVar7 = FUN_00557bb0(); if (cVar7 == '\0') { iVar9 = FUN_005cba30(); *(int *)(iVar9 + 4) = *(int *)(iVar9 + 4) + 1; } else { acStack_820[0] = '\x01'; acStack_820[1] = '\0'; acStack_820[2] = '\0'; acStack_820[3] = '\0'; EntityPtr::Ref(); FUN_005cbfa0(); FUN_005cc100(); } itemConfigDb = Isaac::GetItemConfig(); piVar14 = (int *)EntityPtr::Ref(); pEVar8 = (Entity_Player *)ItemConfig::GetCollectible(itemConfigDb,*piVar14); local_5e4 = pEVar8; if (pEVar8 != (Entity_Player *)0x0) { if (*(int *)&pEVar8->field_0x4 == 0x1a6) { hourglassState = Game::GetGlowingHourglassState(g_game); if ((hourglassState != (GlowingHourglassState *)0x0) && (-1 < curPlayer->_glowingHourglassIndex)) { hourglassState = Game::GetGlowingHourglassState(g_game); if (hourglassState != (GlowingHourglassState *)0x0) { iVar9 = curPlayer->_glowingHourglassIndex; std::iterator_copy((vector_> *) (hourglassState->_eventCounters + iVar9 * 0x177 + -0x16ed), auStack_630); FUN_00456190(); cVar7 = FUN_0042c710(); while (cVar7 != '\0') { piVar14 = (int *)EntityPtr::Ref(); if (*piVar14 == 0x1a6) { std::vector_>::erase ((vector_> *) (hourglassState->_eventCounters + iVar9 * 0x177 + -0x16ed)); break; } FUN_005cbad0(); FUN_00456190(); cVar7 = FUN_0042c710(); } pEVar8 = local_5e4; } } } if (*(int *)pEVar8 == 3) { UseActiveItem(curPlayer,&sStack_8ae,*(int *)&pEVar8->field_0x4,4,-1,0); } else { AddCollectible(curPlayer,*(int *)&pEVar8->field_0x4,0,1,0,0,0); } hud = (HUD *)Game::GetHUD(g_game); HUD::ShowItemText(hud,curPlayer,(ItemConfig_Item *)pEVar8); } SoundEffects::PlayWithFartOverride(0x80,1.0,2,0,1.0); std::iterator_copy(&curPlayer->_itemCards,auStack_bf0); std::vector_>::erase ((vector_> *)&curPlayer->_itemCards); hud = (HUD *)Game::GetHUD(g_game); HUD::mark_all_slots_dirty(hud,0,0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x66: local_5d9 = bVar5; cVar7 = FUN_00417390(); if (cVar7 == '\0') { LAB_005c4634: bVar5 = (byte)flags; } else { local_5d9 = (byte)isShowAnim; cVar7 = IsCoopGhost(curPlayer); if (cVar7 != '\0') goto LAB_005c4634; local_5d9 = (byte)isShowAnim; if ((curPlayer->_playerType != 0x1d) && (curPlayer->_playerType != 0x26)) goto LAB_005c4634; bVar5 = (byte)flags; if ((flags & 0x20) == 0) { iVar9 = EntityPtr::Ref(); if (iVar9 == 0) { pEVar8 = curPlayer->_backupPlayer; } else { pEVar8 = (Entity_Player *)EntityPtr::Ref(); } iVar9 = EntityPtr::Ref(); local_609 = iVar9 != 0; local_5d9 = (byte)isShowAnim; if (pEVar8 != (Entity_Player *)0x0) { iVar9 = GetPlayerType(pEVar8); if (iVar9 == 0x26) { fVar32 = 8.15556e-43; } else { fVar32 = 8.16957e-43; } play_sound_with_fart_seed((int)fVar32,1.0,2,0,1.0); FUN_005b17a0(); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); PlayerManager::replace_player(playerManager,curPlayer,pEVar8); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&curPlayer->_pos,&g_vectorZero,(Entity *)0x0,0, uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); SyncConsumables(curPlayer,pEVar8,0xffffffff); PlayExtraAnimation(pEVar8,&DAT_00b1cdf8); FUN_005b17a0(); FUN_005b17b0(); pEVar8->_entityCollisionClass = 4; local_5d9 = (byte)isShowAnim; if (local_609 != 0) { PlayExtraAnimation(curPlayer,&DAT_00b1cdf8); FUN_005b17b0(); uVar26 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&pEVar8->_pos,&g_vectorZero,(Entity *)0x0,0, uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); curPlayer->_entityCollisionClass = 0; local_5d9 = 0; } } goto LAB_005c4634; } } if ((bVar5 & 0x24) == 4) { if ((curPlayer->_playerType == 0x1d) || (curPlayer->_playerType == 0x26)) { level = (Level *)Config::GetCollectibles(); iVar9 = Level::GetCurrentRoomIndex(level); if (iVar9 == -0xc) { useResult = useResult & 0xff00; goto LAB_005b54cf; } } Game::GetItemPool(g_game); ItemPool::ResetRoomBlacklist(); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&flipCollectibles,5,100,-1,0,0); fStack_14 = 8.40779e-44; uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { puVar15 = (undefined4 *)std::vector::operator_index(); VStack_608.y = (float)*puVar15; cVar7 = Entity::IsDead((Entity *)*puVar15); if (cVar7 == '\0') { local_5e4 = (Entity_Player *)__RTDynamicCast(); rngPtr = (RNG *)FUN_005cbd00(); uVar11 = RNG::Next(rngPtr); bVar5 = Entity_Pickup::TryFlip((Entity_Pickup *)local_5e4,curPlayer,uVar11); if (bVar5 != 0) { uVar11 = Random(); tmpVec = Entity::Position((Entity *)local_5e4,&VStack_fa0); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar11); SoundEffects::PlayWithFartOverride(0x358,1.0,2,0,1.0); curPlayer = local_5e0; } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); } if (local_5d9 != 0) { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&flipCollectibles); curPlayer = local_5e0; break; } goto LAB_005b54cf; case 0x67: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } Isaac::GetItemConfig(); FUN_00730de0(); VStack_608.y = (float)&curPlayer->_collectibleRNGs; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(rngPtr,4); if (uVar26 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); iVar9 = Room::GetSeededCollectible(room,uVar26,1); Game::GetField26614(g_game); cVar7 = FUN_00429550(); while (cVar7 != '\0') { Game::GetField26614(g_game); piVar14 = (int *)EntityList::Size(); cVar7 = (**(code **)(*piVar14 + 0x30))(); if (cVar7 == '\0') break; room = (Room *)Level::GetCurrentRoom((Level *)g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); iVar9 = Room::GetSeededCollectible(room,uVar26,1); Game::GetField26614(g_game); cVar7 = FUN_00429550(); } } else { FUN_00424510(); fStack_14 = 8.54792e-44; bVar5 = Game::IsGreedMode(g_game); if (bVar5 == 0) { WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0,100,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,1,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,2,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,3,4,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,4,4,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,5,2,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0x1a,2,0); iVar9 = 0xc; } else { WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0x10,100,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0x12,0x32,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0x11,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0x13,4,0); WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,0x14,4,0); iVar9 = 0x1a; } iVar12 = 0; iVar25 = 2; fVar32 = 8.477023e-39; WeightedOutcomePicker::AddOutcomeWeight(lemegetonPicker,iVar9,2,0); uVar11 = 0x23; rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),uVar26,uVar11); rng_04._shift1 = iVar9; rng_04._seed = (int)fVar32; rng_04._shift2 = iVar25; rng_04._shift3 = iVar12; local_5e4 = (Entity_Player *)WeightedOutcomePicker::PickOutcome(lemegetonPicker,rng_04); itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); iVar9 = ItemPool::GetCollectible(itemPool,(int)local_5e4,uVar26,0,8,0); Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { do { Game::GetField26614(g_game); piVar14 = (int *)EntityList::Size(); cVar7 = (**(code **)(*piVar14 + 0x30))(); if (cVar7 == '\0') break; itemPool = (ItemPool *)Game::GetItemPool(g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); iVar9 = ItemPool::GetCollectible(itemPool,(int)local_5e4,uVar26,0,8,0); Game::GetField26614(g_game); cVar7 = FUN_00429550(); } while (cVar7 != '\0'); curPlayer = local_5e0; } fStack_14 = -NAN; std::vector::_Tidy(); } Isaac::GetItemConfig(); FUN_00730e20(); AddItemWisp(); itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,iVar9); if (itemConfig != (ItemConfig_Item *)0x0) { hud = (HUD *)Game::GetHUD(g_game); HUD::ShowItemText(hud,curPlayer,itemConfig); } fVar32 = 4.4281e-43; LAB_005b743f: SoundEffects::PlayWithFartOverride((int)fVar32,1.0,2,0,1.0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x68: if (local_5e0->_variant == 0) { if (local_5e0->_playerType != 0x1a) { if (bVar5 != 0) { AnimateCollectible(local_5e0,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } SpawnClot(curPlayer,playerPos,1); goto LAB_005b54bc; } if (bVar5 != 0) { AnimateCollectible(local_5e0,itemId,(byte *)"HideItem",(byte *)"PlayerPickupSparkle"); } TemporaryEffects::RemoveCollectibleEffect(&curPlayer->_temporaryeffects,0x2c9,-1); } goto switchD_005bfbd8_caseD_11d; case 0x69: bVar5 = TemporaryEffects::HasCollectibleEffect(&local_5e0->_temporaryeffects,0x2ca); if (bVar5 != 0) goto LAB_005b54bc; play_sound_with_fart_seed(0x23e,1.0,2,0,1.0); switchD_005bfbd8_caseD_11d: local_5d9 = (byte)isShowAnim; LAB_005b54cf: break; case 0x6a: if ((flags & 0x400) == 0) { if (((flags & 4) != 0) && (-1 < slot)) { iVar9 = FUN_005b1720(); if (0 < iVar9) { if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } FUN_005b1720(); UsePoopSpell(curPlayer); SetActiveVarData(curPlayer,0,slot); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } if ((curPlayer->_playerType == 0x19) && (0 < curPlayer->_poopMana)) { AddPoopMana(curPlayer,-1); if ((char)isShowAnim != '\0') { AnimateCollectible(curPlayer,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } SetActiveVarData(curPlayer,(uint)curPlayer->_poopSpellQueue[0],slot); curPlayer->_poopSpellQueue[0] = curPlayer->_poopSpellQueue[1]; curPlayer->_poopSpellQueue[1] = curPlayer->_poopSpellQueue[2]; curPlayer->_poopSpellQueue[2] = curPlayer->_poopSpellQueue[3]; curPlayer->_poopSpellQueue[3] = curPlayer->_poopSpellQueue[4]; curPlayer->_poopSpellQueue[4] = curPlayer->_poopSpellQueue[5]; curPlayer->_poopSpellQueue[5] = 0; poop_spell_roll(curPlayer); fVar32 = 8.49187e-43; goto LAB_005b562c; } } } else if (0 < varData) { if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } UsePoopSpell(local_5e0); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } goto LAB_005b3e24; case 0x6b: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } FUN_00424510(); fStack_14 = 8.68805e-44; WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,0,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,1,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,2,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,3,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,4,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,5,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,6,1,0); WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,7,1,0); iVar9 = 8; fVar32 = 8.479575e-39; WeightedOutcomePicker::AddOutcomeWeight(keepersBoxPicker,8,1,0); iVar12 = 0x2cf; iVar25 = 0x5c55ab; local_5ec = (Entity_Player *)FUN_005cbd00(); uVar11 = 0x23; uVar26 = RNG::Next((RNG *)local_5ec); RNG::game_constructor((RNG *)((int)register0x00000010 + -0x19ec),uVar26,uVar11); rng_05._shift1 = iVar9; rng_05._seed = (int)fVar32; rng_05._shift2 = iVar25; rng_05._shift3 = iVar12; uVar26 = WeightedOutcomePicker::PickOutcome(keepersBoxPicker,rng_05); switch(uVar26) { case 0: pEVar8 = (Entity_Player *)0xa; local_5f8 = (Entity_Player *)0x1; break; case 1: pEVar8 = (Entity_Player *)0x28; local_5f8 = (Entity_Player *)0x1; break; case 2: local_600 = (Entity_Player *)0x46; Game::GetItemPool(g_game); uVar26 = RNG::Next((RNG *)local_5ec); local_5f8 = (Entity_Player *)ItemPool::GetPill(uVar26); pEVar8 = (Entity_Player *)0x46; goto LAB_005c574d; case 3: pEVar8 = (Entity_Player *)0x1e; local_5f8 = (Entity_Player *)0x1; break; case 4: pEVar8 = (Entity_Player *)0xa; local_5f8 = (Entity_Player *)0x3; break; case 5: pEVar8 = (Entity_Player *)0x5a; local_5f8 = (Entity_Player *)0x1; break; case 6: local_600 = (Entity_Player *)0x12c; Game::GetItemPool(g_game); RNG::Next((RNG *)local_5ec); local_5f8 = (Entity_Player *)ItemPool::GetCard(); pEVar8 = (Entity_Player *)0x12c; goto LAB_005c574d; case 7: pEVar8 = (Entity_Player *)0x45; local_5f8 = (Entity_Player *)0x0; break; case 8: local_600 = (Entity_Player *)0x64; itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar26 = RNG::Next((RNG *)local_5ec); bVar5 = Game::IsGreedMode(g_game); iVar9 = 1; if (bVar5 != 0) { iVar9 = 0x12; } local_5f8 = (Entity_Player *)ItemPool::GetCollectible(itemPool,iVar9,uVar26,0,0,0); pEVar8 = (Entity_Player *)0x64; curPlayer = local_5e0; goto LAB_005c574d; default: local_5f8 = pEStack_6f0; pEVar8 = pEStack_6f0; } local_600 = pEVar8; LAB_005c574d: local_5e4 = (Entity_Player *)0x0; iVar9 = Game::GetNumPlayers(g_game); if (iVar9 != 0) { pEVar10 = (Entity_Player *)0x0; do { local_5f0 = Game::GetPlayer(g_game,(uint)pEVar10); iVar9 = Entity::Variant((Entity *)local_5f0); if (((iVar9 == 0) && (iVar9 = GetPlayerType(local_5f0), iVar9 != 0xe)) && (iVar9 = GetPlayerType(local_5f0), iVar9 != 0x21)) goto LAB_005c57f3; local_5e4 = (Entity_Player *)&local_5e4->field_0x1; pEVar34 = (Entity_Player *)Game::GetNumPlayers(g_game); pEVar10 = local_5e4; } while (local_5e4 < pEVar34); } if (pEVar8 == (Entity_Player *)0xa) { uVar26 = RNG::RandomInt((RNG *)local_5ec,2); local_5f8 = (Entity_Player *)0x1; local_600 = (Entity_Player *)((-(uint)(uVar26 != 0) & 10) + 0x1e); } LAB_005c57f3: rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,aVStack_fc8,&curPlayer->_pos,40.0,1,0,0); pEVar16 = (Entity_Pickup *) Game::Spawn(g_game,5,(uint)local_600,tmpVec,&g_vectorZero,(Entity *)0x0, (uint)local_5f8,uVar26); Entity_Pickup::MakeShopItem(pEVar16,-1); (**(code **)(*(int *)pEVar16 + 0xc))(); uVar26 = Random(); tmpVec = Entity::Position((Entity *)pEVar16,&VStack_fd0); tmpEntity = Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)tmpEntity + 0xc))(); fStack_14 = -NAN; std::vector::_Tidy(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x6c: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } local_5e4 = (Entity_Player *)0x1; if ((flags & 0x400) == 0) { if ((((flags & 4) != 0) && (-1 < slot)) && (curPlayer->_activeDesc[slot]._item == 0x2d0)) { uStack_838 = 0xc; iStack_83c = GetTotalActiveCharge(curPlayer,slot); puVar15 = (undefined4 *)std::min(); local_5e4 = (Entity_Player *)*puVar15; if ((curPlayer->_wildCardItemType == 2) && (curPlayer->_wildCardItem == 0x2d0)) { curPlayer->_wildCardVarData = (int)local_5e4; } goto LAB_005c59e4; } } else { uStack_834 = 1; puVar15 = (undefined4 *)std::max(); local_5e4 = (Entity_Player *)*puVar15; LAB_005c59e4: if ((int)local_5e4 < 1) goto LAB_005b3e24; } pEVar8 = (Entity_Player *)FUN_005cbd00(); local_5f0 = pEVar8; switch(local_5e4) { case (Entity_Player *)0x1: UseActiveItem(curPlayer,&sStack_8b0,0x24,3,-1,0); goto switchD_005c5a14_default; case (Entity_Player *)0x2: local_600 = (Entity_Player *)&DAT_00000014; local_5f8 = (Entity_Player *)0x1; break; case (Entity_Player *)0x3: local_5f8 = (Entity_Player *)0x1; goto LAB_005c5b0b; case (Entity_Player *)0x4: local_600 = (Entity_Player *)0x1e; local_5f8 = (Entity_Player *)0x1; break; case (Entity_Player *)0x5: local_600 = (Entity_Player *)0xa; local_5f8 = (Entity_Player *)0x1; break; case (Entity_Player *)0x6: local_600 = (Entity_Player *)0x46; local_5f8 = (Entity_Player *)0x0; break; case (Entity_Player *)0x7: local_600 = (Entity_Player *)0x12c; local_5f8 = (Entity_Player *)0x0; break; case (Entity_Player *)0x8: local_600 = (Entity_Player *)0xa; local_5f8 = (Entity_Player *)0x3; break; case (Entity_Player *)0x9: local_600 = (Entity_Player *)0xa; local_5f8 = (Entity_Player *)&DAT_00000007; break; case (Entity_Player *)0xa: local_600 = (Entity_Player *)0x1e; local_5f8 = (Entity_Player *)0x2; break; case (Entity_Player *)0xb: local_5f8 = (Entity_Player *)&DAT_00000004; LAB_005c5b0b: local_600 = (Entity_Player *)0x28; break; case (Entity_Player *)0xc: uVar26 = RNG::RandomInt((RNG *)pEVar8,0xc); switch(uVar26) { case 0: UseActiveItem(curPlayer,&sStack_8b2,0x1e1,3,-1,0); break; case 1: uVar26 = RNG::RandomInt((RNG *)pEVar8,10); effect = Entity_Effect::CreateTimer(FUN_005c7f20,2,uVar26 + 5,0); rngPtr = (RNG *)Entity::GetDropRNG((Entity *)effect); uVar26 = RNG::Next((RNG *)local_5f0); RNG::SetSeed(rngPtr,uVar26,0x23); curPlayer = local_5e0; Entity::SetPosition((Entity *)effect,&local_5e0->_pos); Entity::SetParent((Entity *)effect,(Entity *)curPlayer); (**(code **)(*(int *)effect + 0xc))(); pEVar8 = local_5f0; break; case 2: room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&VStack_c68,&curPlayer->_pos,40.0,0,0,0); uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,0xd,0,&VStack_c68,&g_vectorZero,(Entity *)curPlayer,0,uVar26); break; case 4: uVar26 = RNG::RandomInt((RNG *)pEVar8,10); effect = Entity_Effect::CreateTimer(everything_jar_crack_the_sky_timer,5,uVar26 + 0x12,0); rngPtr = (RNG *)Entity::GetDropRNG((Entity *)effect); uVar26 = RNG::Next((RNG *)local_5f0); RNG::SetSeed(rngPtr,uVar26,0x23); Entity::SetParent((Entity *)effect,(Entity *)local_5e0); (**(code **)(*(int *)effect + 0xc))(); pEVar8 = local_5f0; curPlayer = local_5e0; break; case 5: room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,aVStack_ca4,&curPlayer->_pos,40.0,0,0,0); FUN_005b19d0(); uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,100,aVStack_ca4,&g_vectorZero,(Entity *)curPlayer,0,uVar26); FUN_006e1910(); FUN_005b19d0(); break; case 6: itemConfigDb = Isaac::GetItemConfig(); iVar9 = 1; bVar5 = 1; itemConfig = ItemConfig::GetCollectible(itemConfigDb,0x41); pvVar24 = TemporaryEffect::TemporaryEffect(auStack_13c8,itemConfig); TemporaryEffects::AddEffect(&curPlayer->_temporaryeffects,pvVar24,bVar5,iVar9); break; case 7: UseCard(curPlayer,0x2d,0x183); break; case 8: uVar26 = RNG::RandomInt((RNG *)pEVar8,0xc); effect = Entity_Effect::CreateTimer(everything_jar_shopkeeper_rain_timer,2,uVar26 + 6,0); rngPtr = (RNG *)Entity::GetDropRNG((Entity *)effect); uVar26 = RNG::Next((RNG *)local_5f0); RNG::SetSeed(rngPtr,uVar26,0x23); Entity::SetPosition((Entity *)effect,&local_5e0->_pos); (**(code **)(*(int *)effect + 0xc))(); pEVar8 = local_5f0; curPlayer = local_5e0; break; case 9: room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&VStack_a14,&curPlayer->_pos,40.0,0,0,0); uVar26 = RNG::RandomInt((RNG *)pEVar8,4); if (uVar26 == 0) { uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,4,0x11,&VStack_a14,&g_vectorZero,(Entity *)curPlayer,0,uVar26); } else { uVar26 = RNG::Next((RNG *)pEVar8); Game::Spawn(g_game,5,0x28,&VStack_a14,&g_vectorZero,(Entity *)curPlayer,7,uVar26); } break; case 10: room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_600 = (Entity_Player *)Room::GetAliveEnemiesCount(room); FUN_00424510(); fStack_14 = 8.82818e-44; Level::GetCurrentRoom((Level *)g_game); iVar9 = FUN_00436040(); local_5ec = (Entity_Player *)0x0; do { gridEntity = *(GridEntity **)(iVar9 + (int)local_5ec * 4); if (gridEntity != (GridEntity *)0x0) { GridEntity::Position(gridEntity,&VStack_a1c); pEVar10 = Game::GetNearestPlayer(g_game,&VStack_a1c); tmpVec = Entity::Position((Entity *)pEVar10,&VStack_fd8); pEVar10 = (Entity_Player *)Vector::DistanceSquared(tmpVec,&VStack_a1c); VStack_608.y = (float)pEVar10; if (6400.0 < (float)pEVar10) { GridEntity::Position(*(GridEntity **)(iVar9 + (int)local_5ec * 4),&VStack_fe0); FUN_0042f170(); } } local_5ec = (Entity_Player *)((int)local_5ec + 1); } while (local_5ec < &DAT_00000008); cVar7 = FUN_004bc660(); curPlayer = local_5e0; if (cVar7 != '\0') { Level::GetCurrentRoom((Level *)g_game); Room::GetCenterPos(&VStack_fe8); FUN_0042f170(); } local_5ec = (Entity_Player *)RNG::RandomInt((RNG *)pEVar8,4); Config::GetCollectibles(); FUN_0074b9a0(); pEStack_614 = (Entity_Pickup *)&local_5ec->field_0x4; local_5f8 = pEVar10; if ((int)local_5ec < (int)pEStack_614) { do { fVar32 = (float)RNG::Next((RNG *)pEVar8); VStack_608.y = fVar32; room = (Room *)Level::GetCurrentRoom((Level *)g_game); FUN_0042f160(); tmpVec = (Vector *)std::vector::operator__(); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_ff0,tmpVec,0.0,0,0,0); tmpVec2 = MusicManager::RandomVector(&VStack_ff8); fStack_840 = random_float(); tmpVec2 = Vector::__mul(tmpVec2,&VStack_1000,&fStack_840); fStack_844 = 20.0; tmpVec2 = Vector::__mul(tmpVec2,&VStack_1008,&fStack_844); tmpVec = Vector::__add(tmpVec,&VStack_1010,tmpVec2); uVar26 = RNG::RandomInt((RNG *)local_5f0,2); tmpEntity = Game::Spawn(g_game,(-(uint)(uVar26 != 0) & 8) + 10,0,tmpVec,&g_vectorZero, (Entity *)0x0,0,(uint)VStack_608.y); Entity::SetField380(tmpEntity,(float)local_5f8); FUN_00435d40(); local_5ec = (Entity_Player *)&local_5ec->field_0x1; pEVar8 = local_5f0; } while ((int)local_5ec < (int)pEStack_614); curPlayer = local_5e0; } UseActiveItem(curPlayer,&sStack_8b4,0x11d,3,-1,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar9 = Room::GetAliveEnemiesCount(room); if ((int)local_600 < iVar9) { iVar9 = 0; do { room = (Room *)Level::GetCurrentRoom((Level *)g_game); door = Room::GetDoor(room,iVar9); if (door != (GridEntity_Door *)0x0) { GridEntity_Door::Close(door); } iVar9 = iVar9 + 1; } while (iVar9 < 8); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::IsClear(room); if (bVar5 != 0) { level = (Level *)Config::GetCollectibles(); pLVar22 = (Level *)Config::GetCollectibles(); iVar9 = Level::GetCurrentRoomIndex(pLVar22); Level::GetRoomByIdx(level,iVar9,-1); FUN_005b1690(); } Level::GetCurrentRoom((Level *)g_game); Room::SetClear(); } fStack_14 = -NAN; std::vector::_Tidy(); pEVar8 = local_5f0; break; case 0xb: uVar26 = RNG::RandomInt((RNG *)pEVar8,0xc); local_5f0 = (Entity_Player *)0x0; VStack_608.y = (float)(uVar26 + 6); if (0 < (int)(uVar26 + 6)) { do { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&VStack_c78,&curPlayer->_pos,40.0,0,0,0); uVar26 = RNG::Next((RNG *)pEVar8); local_5ec = (Entity_Player *) Game::Spawn(g_game,5,0,&VStack_c78,&g_vectorZero,(Entity *)curPlayer,1, uVar26); RNG::RandomInt((RNG *)pEVar8,5); FUN_005b19f0(); cVar7 = FUN_006ee330(); if ((cVar7 == '\0') && (uVar26 = RNG::RandomInt((RNG *)pEVar8,3), uVar26 == 0)) { Entity::AddEntityFlags((Entity *)local_5ec,0x10000000000); } local_5f0 = (Entity_Player *)&local_5f0->field_0x1; } while ((int)local_5f0 < (int)VStack_608.y); } } default: goto switchD_005c5a14_default; } rngPtr = (RNG *)FUN_005cbd00(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&VStack_c60,&curPlayer->_pos,40.0,0,0,0); uVar26 = RNG::Next(rngPtr); Game::Spawn(g_game,5,(uint)local_600,&VStack_c60,&g_vectorZero,(Entity *)curPlayer, (uint)local_5f8,uVar26); pEVar8 = local_5f0; switchD_005c5a14_default: bVar5 = HasCollectible(curPlayer,0x248,0); if (bVar5 != 0) { if ((char)local_610 != '\0') { bVar36 = 0; tmpVec = &curPlayer->_pos; bVar5 = 0; iVar9 = Entity_Familiar::GetRandomWisp((RNG *)pEVar8); familiar = AddWisp(curPlayer,iVar9,tmpVec,bVar5,bVar36); pEVar8 = local_5e4; if (familiar != (Entity_Familiar *)0x0) { Entity::MaxHitPoints(); VStack_608.y = (float)(int)pEVar8 * 0.5; FUN_00435d40(); fVar30 = (float10)Entity::MaxHitPoints(); Entity::SetField380((Entity *)familiar,(float)fVar30); FUN_005b1900(); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; } } } LAB_005b3e24: bVar5 = (byte)isShowAnim; LAB_005b3e2a: local_5d9 = bVar5; LAB_005b3e30: curPlayer = local_5e0; break; case 0x6d: if (bVar5 != 0) { AnimateCollectible(local_5e0,iVar9,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } Level::GetCurrentRoom((Level *)g_game); local_5f8 = (Entity_Player *)Room::GetEntities(); local_5f0 = (Entity_Player *)0x4e6e6b28; chainTarget = (Entity *)0x0; FUN_00424510(); fStack_14 = 8.96831e-44; FUN_005cba40(); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x41); pEVar8 = (void *)0x0; local_5e4 = (void *)0x0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { piVar14 = (int *)std::vector::operator_index(); if ((Entity_Player *)*piVar14 != curPlayer) { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::IsActiveEnemy((Entity *)*puVar15,0); if (bVar5 != 0) { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::EntityCollisionClass((Entity *)*puVar15); if (iVar9 != 0) { puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::HasEntityFlags((Entity *)*puVar15,0x20000000); if (bVar5 == 0) { std::vector::operator_index(); std::vector::push_back(); goto LAB_005c65e4; } } } puVar15 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::IsType((Entity *)*puVar15,1000,0xc1,-1); if (bVar5 != 0) { puVar15 = (undefined4 *)std::vector::operator_index(); iVar9 = Entity::Target((Entity *)*puVar15); if (iVar9 != 0) { puVar15 = (undefined4 *)std::vector::operator_index(); chainedProjectile = (Entity_Projectile *)*puVar15; afStack_850[2] = (float)Entity::Target(); FUN_005cba80(); std::iterator_copy(auStack_644,auStack_bfc); cVar7 = FUN_00557bb0(); if (cVar7 == '\0') { iVar9 = FUN_005cba30(); iVar9 = Entity_Projectile::ChangeTimeout(*(Entity_Projectile **)(iVar9 + 4)); iVar25 = Entity_Projectile::ChangeTimeout(chainedProjectile); pEVar8 = local_5e4; if (iVar25 <= iVar9) goto LAB_005c65e4; } puVar15 = (undefined4 *)std::vector::operator_index(); afStack_850[1] = (float)Entity::Target((Entity *)*puVar15); FUN_005cbfa0(); FUN_005cc120(); } } } LAB_005c65e4: pEVar8 = (Entity_Player *)((int)pEVar8 + 1); local_5e4 = pEVar8; pvVar24 = (void *)EntityList::Size(); } while (pEVar8 < pvVar24); } local_5e4 = (Entity_Player *)0x0; iVar9 = std::vector::size(auStack_6b4); if (iVar9 != 0) { do { puVar15 = (undefined4 *)FUN_0042c810(); tmpVec = Entity::Position((Entity *)*puVar15,aVStack_1028); fVar32 = Vector::DistanceSquared(tmpVec,&curPlayer->_pos); VStack_608.y = fVar32; puVar15 = (undefined4 *)FUN_0042c810(); bVar5 = Entity::IsType((Entity *)*puVar15,0x362,-1,-1); if (bVar5 == 0) { LAB_005c668f: local_5ec = (Entity_Player *)VStack_608.y; } else { puVar15 = (undefined4 *)FUN_0042c810(); pEVar8 = (Entity_Player *)Entity::SpawnerEntity((Entity *)*puVar15); if (pEVar8 != curPlayer) goto LAB_005c668f; local_5ec = (Entity_Player *)&DAT_bf800000; } FUN_0042c810(); FUN_005cba80(); std::iterator_copy(auStack_644,auStack_c84); cVar7 = FUN_0042c710(); pEVar8 = local_5e4; if (cVar7 != '\0') { local_5ec = (Entity_Player *)((float)local_5ec + 1e+06); } if ((float)local_5ec < (float)local_5f0) { local_5f0 = local_5ec; piVar14 = (int *)FUN_0042c810(); chainTarget = (Entity *)*piVar14; if ((float)local_5ec < 0.0) break; } local_5e4 = (Entity_Player *)&pEVar8->field_0x1; puVar13 = (undefined1 *)std::vector::size(auStack_6b4); } while (&pEVar8->field_0x1 < puVar13); } if (chainTarget == (Entity *)0x0) { if ((flags & 0x20) == 0) { pvVar24 = TemporaryEffects::GetNullEffect(&curPlayer->_temporaryeffects,0x6d); if (pvVar24 != (void *)0x0) { *(undefined4 *)((int)pvVar24 + 8) = 10; } useResult = useResult & 0xff00; } } else { pvVar24 = (void *)0x96; local_5e4 = (void *)0x96; if ((curPlayer->_playerType == 0x25) || (curPlayer->_playerType == 0x27)) { bVar5 = HasCollectible(curPlayer,0x26b,0); if (bVar5 != 0) { pvVar24 = (void *)0xc8; } local_5e4 = pvVar24; } pEVar8 = local_5e4; Game::GetField26614(g_game); cVar7 = FUN_00429550(); if (cVar7 != '\0') { pEVar8 = (Entity_Player *)((uint)pEVar8 >> 1); local_5e4 = pEVar8; } Entity::Position(chainTarget,&chainPos); bVar5 = Entity::IsType(chainTarget,0x362,-1,-1); if (bVar5 != 0) { iVar9 = Entity::Parent(chainTarget); if (iVar9 == 0) { LAB_005c6810: tmpEntity = (Entity *)Entity::Child(chainTarget); } else { tmpEntity = (Entity *)Entity::Parent(chainTarget); bVar5 = Entity::IsEnemy(tmpEntity); if (bVar5 == 0) goto LAB_005c6810; tmpEntity = (Entity *)Entity::Parent(chainTarget); } chainTargetPartner = (Entity *)Entity::to_npc_or_coop_player(tmpEntity); if (chainTargetPartner != (Entity *)0x0) { tmpVec = Entity::Position(chainTarget,&VStack_1030); tmpVec2 = Entity::Position(chainTargetPartner,&VStack_1038); tmpVec = Vector::__add(tmpVec,&VStack_1040,tmpVec2); afStack_850[0] = 0.5; Vector::operator_mul(&chainMidpoint,afStack_850,tmpVec); tmpVec = Entity::Position(chainTarget,&VStack_1048); tmpVec2 = Entity::Position(chainTargetPartner,&VStack_1050); tmpVec = Vector::__sub(tmpVec,&VStack_1058,tmpVec2); Vector::Normalized(tmpVec,&chainDir); fStack_854 = 10.0; tmpVec = Vector::operator_mul(&VStack_1060,&fStack_854,&chainDir); tmpVec = Vector::__add(&chainMidpoint,&VStack_1068,tmpVec); Vector::operator_assign(&chainPos,tmpVec); fStack_858 = 10.0; tmpVec = Vector::operator_mul(&VStack_1070,&fStack_858,&chainDir); Vector::__sub(&chainMidpoint,&chainPos2,tmpVec); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); local_5ec = (Entity_Player *) Game::Spawn(g_game,1000,0xc1,&chainPos2,&g_vectorZero,(Entity *)curPlayer,0, uVar26); Entity::SetTarget((Entity *)local_5ec,chainTargetPartner); pEVar8 = local_5e4; Entity_Effect::SetTimeout((Entity_Effect *)local_5ec,(int)local_5e4); FUN_005cba80(); std::iterator_copy(auStack_644,auStack_c88); cVar7 = FUN_0042c710(); if (cVar7 != '\0') { iVar9 = FUN_005cba30(); iVar9 = Entity_Projectile::ChangeTimeout(*(Entity_Projectile **)(iVar9 + 4)); Entity_Effect::SetTimeout((Entity_Effect *)local_5ec,iVar9 + (int)pEVar8); } (**(code **)(*(int *)local_5ec + 0xc))(); } } rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); local_5e4 = (Entity_Player *) Game::Spawn(g_game,1000,0xc1,&chainPos,&g_vectorZero,(Entity *)curPlayer,0,uVar26) ; Entity::SetTarget((Entity *)local_5e4,chainTarget); Entity_Effect::SetTimeout((Entity_Effect *)local_5e4,(int)pEVar8); FUN_005cba80(); std::iterator_copy(auStack_644,auStack_c8c); cVar7 = FUN_0042c710(); if (cVar7 != '\0') { iVar9 = FUN_005cba30(); iVar9 = Entity_Projectile::ChangeTimeout(*(Entity_Projectile **)(iVar9 + 4)); Entity_Effect::SetTimeout((Entity_Effect *)local_5e4,iVar9 + (int)pEVar8); } (**(code **)(*(int *)local_5e4 + 0xc))(); bVar5 = HasCollectible(curPlayer,0x248,0); if (((bVar5 != 0) && ((char)local_610 != '\0')) && (familiar = AddWisp(curPlayer,0x2d2,&curPlayer->_pos,0,1), familiar != (Entity_Familiar *)0x0)) { Entity::SetParent((Entity *)familiar,chainTarget); (**(code **)(*(int *)familiar + 0xc))(); } } FUN_00436fb0(); fStack_14 = -NAN; FID_conflict__Tidy(auStack_6b4); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x6e: if (local_5e0->_variant == 0) { Game::GetItemPool(g_game); ItemPool::ResetRoomBlacklist(); Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&spindownCollectibles,5,100,-1,0,0); fStack_14 = 9.24857e-44; iVar9 = EntityList::Size(); if (iVar9 != 0) { uVar26 = 0; do { puVar15 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar15; cVar7 = Entity::IsDead(tmpEntity); if ((cVar7 == '\0') && (iVar9 = Entity::SubType(tmpEntity), iVar9 != 0)) { pEVar8 = (Entity_Player *)__RTDynamicCast(); local_5ec = pEVar8; iVar9 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pEVar8); if (((iVar9 == 0) || (iVar9 = Entity_Pickup::Timeout((Entity_Pickup *)pEVar8), iVar9 < 0)) && (bVar5 = Entity_Pickup::CanReroll((Entity_Pickup *)pEVar8), bVar5 != 0)) { fVar32 = (float)Entity::SubType((Entity *)pEVar8); do { fVar32 = (float)((int)fVar32 + -1); VStack_608.y = fVar32; if ((int)fVar32 < 1) { Entity_Pickup::empty_pedestal((Entity_Pickup *)local_5ec); goto LAB_005c6cee; } itemConfigDb = Isaac::GetItemConfig(); itemConfig = ItemConfig::GetCollectible(itemConfigDb,(int)fVar32); } while ((itemConfig == (ItemConfig_Item *)0x0) || (bVar5 = Item::IsAvailable(itemConfig,3), bVar5 == 0)); iVar9 = Entity::Variant((Entity *)local_5ec); iVar25 = Entity::Type((Entity *)local_5ec); Entity_Pickup::Morph((Entity_Pickup *)local_5ec,iVar25,iVar9,(int)VStack_608.y,1,0,0); FUN_005b1950(); LAB_005c6cee: uVar11 = Random(); tmpVec = Entity::Position((Entity *)local_5ec,&VStack_1078); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar11); } } uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } bVar5 = HasCollectible(curPlayer,0x248,0); if ((bVar5 != 0) && ((char)local_610 != '\0')) { Level::GetCurrentRoom((Level *)g_game); roomEntities = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(roomEntities,&spindownWisps,3,0xce,-1,0,0); fStack_14 = (float)CONCAT31(fStack_14._1_3_,0x43); rngPtr = (RNG *)FUN_005cbd00(); local_5e4 = (Entity_Player *)Entity_Familiar::GetRandomWisp(rngPtr); uVar26 = 0; iVar9 = EntityList::Size(); if (iVar9 != 0) { do { std::vector::operator_index(); FUN_00435de0(); FUN_0043d7f0(); uVar26 = uVar26 + 1; uVar11 = EntityList::Size(); } while (uVar26 < uVar11); curPlayer = local_5e0; } bVar36 = 0; bVar5 = 0; tmpVec = Entity::Position((Entity *)curPlayer,&VStack_1270); AddWisp(curPlayer,(int)local_5e4,tmpVec,bVar5,bVar36); EntityList_Query::~EntityList_Query(&spindownWisps); } fStack_14 = -NAN; EntityList_Query::~EntityList_Query(&spindownCollectibles); iVar9 = itemId; } bVar5 = 0; if ((char)isShowAnim != '\0') { IsLocalPlayer(curPlayer); SoundEffects::PlayWithFartOverride(0x38e,(float)pEVar10,2,0,1.0); pcVar38 = "UseItem"; goto LAB_005b8b8d; } goto LAB_005b3e2a; case 0x6f: SoundEffects::PlayWithFartOverride(0x41a,1.0,2,0,1.0); LAB_005b7f60: SetItemState(local_5e0); pcVar38 = "LiftItem"; iVar9 = itemId; LAB_005b3eb4: AnimateCollectible(local_5e0,iVar9,(byte *)pcVar38,(byte *)"PlayerPickupSparkle"); curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x70: SoundEffects::PlayWithFartOverride(0x416,1.0,2,0,1.0); SetItemState(local_5e0); AnimateCollectible(local_5e0,itemId,(byte *)"LiftItem",(byte *)"PlayerPickupSparkle"); isAddTempEffect = '\0'; curPlayer = local_5e0; local_5d9 = (byte)isShowAnim; break; case 0x71: goto LAB_005c71f1; } LAB_005b54d1: rngPtr = GetCollectibleRNG(curPlayer,itemId); pEVar8 = local_5e0; bVar5 = LuaEngine::UseItem(g_luaEngine,itemId,rngPtr,local_5e0,flags,slot,varData,&useResult); if ((bVar5 != 0) && (local_5d9 != 0)) { AnimateCollectible(pEVar8,itemId,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } if ((useResult._1_1_ != '\0') && ((flags & 0x40) != 0)) { RemoveCollectible(pEVar8,itemId,0,0xffffffff,1); useResult = useResult & 0xff; } pEVar10 = local_62c; if (((char)useResult == '\0') || ((pEVar8->_itemState != 0 && (pEVar8->_itemState != 0x2f)))) { useResult = (ushort)useResult._1_1_ << 8; } else { useResult = CONCAT11(useResult._1_1_,1); } pEVar8->_cacheFlags = pEVar8->_cacheFlags | *(int *)((int)local_62c + 0x54); iVar9 = pEVar8->_cacheFlags; if (isAddTempEffect != '\0') { iVar25 = 1; iVar9 = isEffectCostume; pvVar24 = TemporaryEffect::TemporaryEffect(local_1408,(ItemConfig_Item *)local_62c); TemporaryEffects::AddEffect(&pEVar8->_temporaryeffects,pvVar24,(byte)iVar9,iVar25); iVar9 = pEVar8->_cacheFlags; } if (iVar9 != 0) { EvaluateItems(); } if ((char)isAddCostume != '\0') { AddCostume(pEVar8,(ItemConfig_Item *)pEVar10,0); } if (itemId == 0x246) { update_mini_mush_costume(pEVar8); } else if (itemId == 0x2c0) { level = (Level *)Level::GetCurrentRoom((Level *)g_game); Level::UpdateBackwardsPathStages(level); } pEVar8->field_0x1826 = 1; *resultOut = useResult; ExceptionList = local_1c; return; while( true ) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::FindFreePickupSpawnPosition(room,&VStack_11f8,&digPos,20.0,0,0,0); Vector::operator_assign(&digPos,tmpVec); tmpVec = GridEntity::Position (*(GridEntity **)((int)(&(local_5e4->_sprite)._filename + -3) + iVar9 * 4), &VStack_c70); tmpVec = Vector::__sub(tmpVec,&VStack_c28,&digPos); local_5ec = (Entity_Player *)Vector::LengthSquared(tmpVec); iVar25 = iVar25 + -1; if (4900.0 <= (float)local_5ec) break; LAB_005b87b2: if (iVar25 < 1) break; } curPlayer = local_5e0; LAB_005b8849: room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar8 = (Entity_Player *)Room::GetGridIndex(room,&digPos); local_5ec = pEVar8; room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(room,(uint)pEVar8); if (gridEntity != (GridEntity *)0x0) { iVar9 = GridEntity::GetType(); if (iVar9 != 0x11) { iVar9 = GridEntity::GetType(); if (iVar9 != 0x12) goto LAB_005b88a3; } goto LAB_005b8b6f; } LAB_005b88a3: room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); if ((((bVar5 == 0) && (gridEntity != (GridEntity *)0x0)) && (iVar9 = GridEntity::GetType(), iVar9 == 1)) && (uVar26 = GridEntity::GetVariant(), uVar26 < 0x1f)) { level = (Level *)Config::GetCollectibles(); cVar7 = Level::GetStateFlag(level); local_5d9 = 1; if (cVar7 != '\0') goto LAB_005b88f4; } else { LAB_005b88f4: local_5d9 = 0; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); EntityRef::constructor(&EStack_16f8,(Entity *)curPlayer); Room::DestroyGridWithSource(room); if (local_5d9 == 0) { level = (Level *)Config::GetCollectibles(); bVar5 = Level::CanSpawnTrapDoor(level); if (bVar5 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); Room::SpawnGridEntity(room,(int)local_5ec,0x11,0,uVar26,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar8 = (Entity_Player *)Room::GetGridEntity(room,(uint)local_5ec); local_5e4 = pEVar8; if (pEVar8 != (Entity_Player *)0x0) { iVar9 = GridEntity::GetType(); if (iVar9 == 0x11) { GridEntity::GetSprite((GridEntity *)pEVar8); pcVar38 = (char *)Sprite::GetFilename(); fStack_14 = 1.82169e-44; std::string::c_str(pcVar38); iVar9 = FUN_00680060(); fStack_14 = -NAN; std::string::_Tidy_deallocate(acStack_2ac); if (iVar9 == 0) { uVar26 = Random(); tmpVec = GridEntity::Position((GridEntity *)local_5e4,&VStack_1200); tmpEntity = Game::Spawn(g_game,1000,2,tmpVec,&g_vectorZero,(Entity *)0x0,3,uVar26); FUN_00435cd0(); Isaac::Random(4); FUN_0043eea0(); level = (Level *)Config::GetCollectibles(); bVar5 = Level::IsMausoleumHeartStage(level); if (bVar5 == 0) { Config::GetCollectibles(); iVar9 = EntityPtr::Ref(); if (iVar9 == 7) { level = (Level *)Config::GetCollectibles(); bVar5 = Level::IsAltPath(level); if (bVar5 != 0) goto LAB_005b8b11; } } else { LAB_005b8b11: (**(code **)(*(int *)tmpEntity + 0x3c))(); } (**(code **)(*(int *)tmpEntity + 0xc))(); fVar32 = 1.00893e-43; } else { fVar32 = 1.28359e-42; } SoundEffects::PlayWithFartOverride((int)fVar32,1.0,2,0,1.0); } } } } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); rngPtr = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(rngPtr); Room::SpawnGridEntity(room,(int)local_5ec,0x12,0,uVar26,0); level = (Level *)Config::GetCollectibles(); Level::SetStateFlag(level); } LAB_005b8b6f: bVar5 = 0; if ((char)isShowAnim == '\0') goto LAB_005b3e2a; LAB_005b8b7d: pcVar38 = "UseItem"; iVar9 = itemId; goto LAB_005b8b8d; } //@@ 005c7ad0 FUN_005c7ad0 void FUN_005c7ad0(int param_1) { Entity_Player *this; code *pcVar1; Game *pGVar2; Manager *pMVar3; uint uVar4; uint uVar5; int local_20; int *local_1c; undefined8 local_14; pMVar3 = g_manager; this = *(Entity_Player **)(param_1 + 0x3bc); if ((this != (Entity_Player *)0x0) && (this->_type == 1)) { local_20 = 0x41e; seed_fart_sound_override(&local_20); SoundEffects::Play(&pMVar3->_sfxManager,local_20,1.0,2,0,1.0,0.0); Entity_Player::PlayExtraAnimation(this,(byte *)"Appear"); pGVar2 = g_game; if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { uVar5 = g_game->_stage + 1; } else { uVar5 = g_game->_stage; } local_14 = 0xf00000005; uVar5 = -(uint)(uVar5 != 0) & uVar5; uVar4 = 0xd; if (uVar5 < 0xd) { uVar4 = uVar5; } uVar5 = (g_game->_seedEffects)._stageSeeds[uVar4]; local_1c = (g_game->_seedEffects)._stageSeeds + uVar4; local_20 = 0x11; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 0xf ^ uVar5; *local_1c = uVar5 >> 0x11 ^ uVar5; Game::StartStageTransition(pGVar2,1,1,this); } return; } //@@ 005c7bf0 FUN_005c7bf0 void FUN_005c7bf0(int *param_1,int *param_2) { byte bVar1; int iVar2; int *in_ECX; iVar2 = *in_ECX; if (iVar2 == 0xe) { if (in_ECX[1] == 6) { bVar1 = (g_manager->_persistentGameData)._achievements[0x18e]; } else { if (in_ECX[1] != 0xb) goto LAB_005c7d15; bVar1 = (g_manager->_persistentGameData)._achievements[0x25d]; } if ((bVar1 == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { *param_1 = 0xe; *param_2 = 0; return; } } else if (iVar2 == 0x1b) { if (((g_manager->_persistentGameData)._achievements[0x264] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { LAB_005c7ca2: *param_1 = 2; *param_2 = 0; return; } } else if (iVar2 == 0x16) { if (((g_manager->_persistentGameData)._achievements[0x143] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { *param_1 = 4; *param_2 = 0; return; } } else if ((iVar2 == 0x11) && ((g_game->_dailyChallenge)._id != 0)) goto LAB_005c7ca2; LAB_005c7d15: *param_1 = iVar2; *param_2 = in_ECX[1]; return; } //@@ 005c7d30 FUN_005c7d30 void FUN_005c7d30(int param_1) { float fVar1; undefined4 uVar2; int iVar3; uint uVar4; Vector *position; Entity *pEVar5; float fVar6; uint uVar7; Vector local_18; Vector local_10; pEVar5 = *(Entity **)(param_1 + 0x3bc); if ((pEVar5 != (Entity *)0x0) && (pEVar5->_type == 1)) { fVar6 = pEVar5[5]._targetPosition.y; if ((int)((int)fVar6 - (int)pEVar5[5]._targetPosition.x & 0xfffffff0U) < 0x28a1) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); fVar6 = pEVar5[5]._targetPosition.y; } fVar1 = pEVar5[5]._targetPosition.x; uVar4 = ((int)fVar6 - (int)fVar1 >> 4) - 1; uVar7 = 0x28a; if (uVar4 < 0x28a) { uVar7 = uVar4; } uVar4 = RNG::Next((RNG *)(uVar7 * 0x10 + (int)fVar1)); local_18.x = *(float *)(param_1 + 0x33c); local_18.y = *(float *)(param_1 + 0x340); position = Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,&local_18,40.0,1,0,0); pEVar5 = Game::SpawnEx(g_game,3,0xe0,position,&g_vectorZero,pEVar5,0,uVar4,0); uVar2 = *(undefined4 *)((int)&pEVar5->_flags + 4); iVar3 = *(int *)pEVar5; *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar5->_flags + 4) = uVar2; (**(code **)(iVar3 + 0xc))(); } return; } //@@ 005c7e30 FUN_005c7e30 void FUN_005c7e30(int param_1) { Entity_Player *this; Vector local_10; this = *(Entity_Player **)(param_1 + 0x3bc); if ((this != (Entity_Player *)0x0) && (this->_type == 1)) { local_10.x = (this->_pos).x; local_10.y = (this->_pos).y; Entity_Player::AddWisp(this,0x26e,&local_10,0,0); local_10.x = (this->_pos).x; local_10.y = (this->_pos).y; Entity_Player::AddWisp(this,0x26e,&local_10,0,0); local_10.x = (this->_pos).x; local_10.y = (this->_pos).y; Entity_Player::AddWisp(this,0x26e,&local_10,0,0); } return; } //@@ 005c7ef0 FUN_005c7ef0 void FUN_005c7ef0(int param_1) { Entity_Player *this; this = *(Entity_Player **)(param_1 + 0x3bc); if ((this != (Entity_Player *)0x0) && (this->_type == 1)) { Entity_Player::AnimateCollectible(this,0x27c,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } return; } //@@ 005c7f20 FUN_005c7f20 void FUN_005c7f20(int param_1) { Entity_Player *this; code *pcVar1; uint uVar2; Vector local_10; this = *(Entity_Player **)(param_1 + 0x3bc); if ((this != (Entity_Player *)0x0) && (this->_type == 1)) { uVar2 = *(uint *)(param_1 + 0x3dc); if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = *(uint *)(param_1 + 0x3dc); if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)*(undefined4 *)(param_1 + 0x3e0) & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)*(undefined4 *)(param_1 + 0x3e4) & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)*(undefined4 *)(param_1 + 1000) & 0x1f) ^ uVar2; *(uint *)(param_1 + 0x3dc) = uVar2; uVar2 = uVar2 % 3; local_10.x = (this->_pos).x; if (uVar2 == 0) { local_10.y = (this->_pos).y; Entity_Player::AddBlueFlies(this,1,&local_10,(Entity *)0x0); return; } local_10.y = (this->_pos).y; if (uVar2 == 1) { this->_numBlueSpiders = this->_numBlueSpiders + 1; spawn_blue_spider(&local_10,(Entity *)this,&g_vectorZero); return; } spawn_dip_at(0,&local_10,(Entity *)this,&g_vectorZero); } return; } //@@ 005c8020 everything_jar_crack_the_sky_timer /* DB: ? Entity_Effect::CreateTimer callback (mov ecx,0x5c8020 at 005c5ca5, RandomInt(10)+18 repeats every 5 frames) in UseActiveItem's Everything Jar (0x2d0) 12-charge random pick: at Room::GetRandomPosition spawns 1000.19 (Crack the Sky beam, as in 160's case) parented to the timer's player parent, damage (player +0x157c *3 +4) * rand(0.7..2.1), random hsv_to_rgb color */ void everything_jar_crack_the_sky_timer(int param_1) { float fVar1; float fVar2; EntityPtr spawner; code *pcVar3; uint uVar4; Entity *pEVar5; KColor *pKVar6; LayerState *pLVar7; int iVar8; float fVar9; Entity *pEStack_40; EntityPtr *local_38; EntityPtr *pEStack_34; float fStack_30; undefined1 local_24 [32]; Room::GetRandomPosition(g_game->_room,(Vector *)local_24,20.0); spawner = *(EntityPtr *)(param_1 + 0x3bc); if ((spawner != (EntityPtr)0x0) && (*(int *)((int)spawner + 0x28) == 1)) { uVar4 = *(uint *)(param_1 + 0x3dc); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *(uint *)(param_1 + 0x3dc); if (uVar4 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)(param_1 + 0x3e0) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)(param_1 + 0x3e4) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)(param_1 + 1000) & 0x1f) ^ uVar4; *(uint *)(param_1 + 0x3dc) = uVar4; local_38 = (EntityPtr *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 1.4 + 0.7); uVar4 = Random(); pEVar5 = Game::SpawnEx(g_game,1000,0x13,(Vector *)local_24,&g_vectorZero,(Entity *)spawner,2, uVar4,0); (**(code **)(*(int *)pEVar5 + 0x40)) ((*(float *)((int)spawner + 0x157c) * 3.0 + 4.0) * (float)local_38); fStack_30 = -g_vectorOne.y; pEStack_34 = (EntityPtr *)-g_vectorOne.x; Entity::SetSize(pEStack_40,(float)pEVar5 * 20.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); pEStack_34 = &pEStack_40->_parent; if (*pEStack_34 != (EntityPtr)0x0) { local_38 = pEStack_34; std::multiset::erase(&local_38); } *pEStack_34 = spawner; std::multiset::insert(pEStack_34); uVar4 = *(uint *)(param_1 + 0x3dc); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *(uint *)(param_1 + 0x3dc); if (uVar4 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)(param_1 + 0x3e0) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)(param_1 + 0x3e4) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)(param_1 + 1000) & 0x1f) ^ uVar4; *(uint *)(param_1 + 0x3dc) = uVar4; pEStack_34 = (EntityPtr *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 0.2 + 0.6); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *(uint *)(param_1 + 0x3dc); if (uVar4 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)(param_1 + 0x3e0) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)(param_1 + 0x3e4) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)(param_1 + 1000) & 0x1f) ^ uVar4; *(uint *)(param_1 + 0x3dc) = uVar4; pKVar6 = hsv_to_rgb((KColor *)(local_24 + 4), (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 360.0,1.0,(float)pEStack_34,1.0); fVar9 = pKVar6->_green; fVar1 = pKVar6->_blue; fVar2 = pKVar6->_alpha; (pEStack_40->_sprite)._color._tint[0] = pKVar6->_red; (pEStack_40->_sprite)._color._tint[1] = fVar9; (pEStack_40->_sprite)._color._tint[2] = fVar1; (pEStack_40->_sprite)._color._tint[3] = fVar2; uVar4 = g_graphicsManager_flags; pLVar7 = ANM2::GetLayer(&pEStack_40->_sprite,(byte *)0x0); iVar8 = 1; if ((uVar4 & 4) == 0) { iVar8 = 6; } pLVar7->_blendMode[0] = 0; pLVar7->_blendMode[1] = iVar8; pLVar7->_blendMode[2] = 1; pLVar7->_blendMode[3] = 1; pLVar7->_blendMode[4] = 1; uVar4 = g_graphicsManager_flags; pLVar7 = ANM2::GetLayer(&pEStack_40->_sprite,(byte *)0x1); iVar8 = 1; if ((uVar4 & 4) == 0) { iVar8 = 6; } pLVar7->_blendMode[1] = iVar8; pLVar7->_blendMode[0] = 0; pLVar7->_blendMode[2] = 1; pLVar7->_blendMode[3] = 1; pLVar7->_blendMode[4] = 1; iVar8 = *(int *)pEStack_40; fVar9 = (float)pEVar5 * g_vectorOne.x; (pEStack_40->_sprite)._scale.y = (float)pEVar5 * g_vectorOne.y; (pEStack_40->_sprite)._scale.x = fVar9; (**(code **)(iVar8 + 0xc))(); } return; } //@@ 005c83f0 everything_jar_shopkeeper_rain_timer /* DB: ? Entity_Effect::CreateTimer callback (mov ecx,0x5c83f0 at 005c5dc5, RandomInt(12)+6 repeats every 2 frames) in Entity_Player::UseActiveItem's Everything Jar (0x2d0) 12-charge random pick, case 8: FindFreePickupSpawnPosition near a random point, clears the grid path cost to 900, WeightedOutcomePicker over variants 0..4 (weights 3,3,1,1,1), Game::Spawn(17 shopkeeper, variant) */ void everything_jar_shopkeeper_rain_timer(int param_1) { int *piVar1; Room *this; void *pvVar2; code *pcVar3; RNG rng; bool bVar4; Vector *pos; uint uVar5; int iVar6; Game *pGVar7; int iVar8; Manager *pMVar9; WeightedOutcomePicker ptr; uint uVar10; float fVar11; WeightedOutcomePicker local_30; float *local_2c; float *local_28; Vector local_24; Vector local_1c; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5d8d; local_10 = ExceptionList; ExceptionList = &local_10; this = g_game->_room; pos = Room::GetRandomPosition(this,&local_1c,20.0); Room::FindFreePickupSpawnPosition(this,&local_24,pos,40.0,0,0,0); uVar5 = Random(); local_1c.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1c.y = local_1c.y + local_1c.y; local_14 = sin(local_1c.y); local_1c.y = cos(local_1c.y); local_1c.y = local_1c.y * 20.0; local_14 = local_14 * 20.0; uVar5 = Random(); fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_24.y = local_24.y + fVar11 * local_14; local_24.x = local_24.x + fVar11 * local_1c.y; pvVar2 = g_game->_room; iVar6 = (int)((local_24.y - 120.0) / 40.0 + 0.5); iVar8 = (int)((local_24.x - 40.0) / 40.0 + 0.5); if ((((-1 < iVar8) && (iVar8 < *(int *)((int)pvVar2 + 0xc))) && (-1 < iVar6)) && ((iVar6 < *(int *)((int)pvVar2 + 0x10) && (uVar5 = *(int *)((int)pvVar2 + 0xc) * iVar6 + iVar8, uVar5 < 0x1c0)))) { iVar6 = *(int *)((int)pvVar2 + uVar5 * 4 + 0x76c); iVar8 = iVar6 % 1000; if (iVar8 < 900) { *(int *)((int)pvVar2 + uVar5 * 4 + 0x76c) = (iVar6 - iVar8) + 900; } } local_30 = (WeightedOutcomePicker)0x0; local_2c = (float *)0x0; local_28 = (float *)0x0; local_8 = 0; local_1c.x = 0.0; local_1c.y = 4.2039e-45; std::vector<8byte>::_Emplace_reallocate(0,&local_1c); uVar5 = 0; uVar10 = (int)local_2c - (int)local_30 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)local_30 + uVar5 * 8) == 1) { piVar1 = (int *)((int)local_30 + 4 + uVar5 * 8); *piVar1 = *piVar1 + 3; if (*piVar1 < 0) { *(undefined4 *)((int)local_30 + 4 + uVar5 * 8) = 0; } goto LAB_005c8637; } uVar5 = uVar5 + 1; } while (uVar5 < uVar10); } local_1c.x = 1.4013e-45; local_1c.y = 4.2039e-45; if (local_2c == local_28) { std::vector<8byte>::_Emplace_reallocate(local_2c,&local_1c); } else { *local_2c = 1.4013e-45; local_2c[1] = 4.2039e-45; local_2c = local_2c + 2; } LAB_005c8637: uVar5 = 0; uVar10 = (int)local_2c - (int)local_30 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)local_30 + uVar5 * 8) == 2) { piVar1 = (int *)((int)local_30 + 4 + uVar5 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)((int)local_30 + 4 + uVar5 * 8) = 0; } goto LAB_005c8698; } uVar5 = uVar5 + 1; } while (uVar5 < uVar10); } local_1c.x = 2.8026e-45; local_1c.y = 1.4013e-45; if (local_2c == local_28) { std::vector<8byte>::_Emplace_reallocate(local_2c,&local_1c); } else { *local_2c = 2.8026e-45; local_2c[1] = 1.4013e-45; local_2c = local_2c + 2; } LAB_005c8698: pMVar9 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0xf7] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { bVar4 = false; } else { bVar4 = true; } local_1c.x = 0.0; local_1c.y = 1.4013e-45; if (bVar4) { local_1c.x = 4.2039e-45; } if (local_2c == local_28) { std::vector<8byte>::_Emplace_reallocate(local_2c,&local_1c); pGVar7 = g_game; pMVar9 = g_manager; } else { *local_2c = local_1c.x; local_2c[1] = 1.4013e-45; local_2c = local_2c + 2; } if (((pMVar9->_persistentGameData)._achievements[0xf3] == 0) && (((pMVar9->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { local_1c.x = 0.0; } else { local_1c.x = 5.60519e-45; } local_1c.y = 1.4013e-45; if (local_2c == local_28) { std::vector<8byte>::_Emplace_reallocate(local_2c,&local_1c); } else { *local_2c = local_1c.x; local_2c[1] = 1.4013e-45; local_2c = local_2c + 2; } uVar5 = *(uint *)(param_1 + 0x3dc); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = *(uint *)(param_1 + 0x3dc); if (uVar5 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar5 = uVar5 >> ((byte)*(undefined4 *)(param_1 + 0x3e0) & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)*(undefined4 *)(param_1 + 0x3e4) & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)*(undefined4 *)(param_1 + 1000) & 0x1f) ^ uVar5; *(uint *)(param_1 + 0x3dc) = uVar5; uVar10 = uVar5; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = *(uint *)(param_1 + 0x3dc); } if (uVar10 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(param_1 + 0x3e0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(param_1 + 0x3e4) & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)*(undefined4 *)(param_1 + 1000) & 0x1f) ^ uVar10; *(uint *)(param_1 + 0x3dc) = uVar10; rng._shift1 = 5; rng._seed = uVar10; rng._shift2 = 9; rng._shift3 = 7; uVar10 = WeightedOutcomePicker::PickOutcome(&local_30,rng); Game::Spawn(g_game,0x11,uVar10,&local_24,&g_vectorZero,(Entity *)0x0,0,uVar5); if (local_30 != (WeightedOutcomePicker)0x0) { uVar5 = (int)local_28 - (int)local_30 & 0xfffffff8; ptr = local_30; if (0xfff < uVar5) { ptr = *(WeightedOutcomePicker *)((int)local_30 + -4); uVar5 = uVar5 + 0x23; if (0x1f < ((int)local_30 - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar5); } ExceptionList = local_10; return; } //@@ 005c88a0 Entity_Player::reroll_collectibles_on_damage /* WARNING: Removing unreachable block (ram,0x005c929d) */ /* WARNING: Removing unreachable block (ram,0x005c926d) */ /* WARNING: Removing unreachable block (ram,0x005c8dcf) */ /* WARNING: Removing unreachable block (ram,0x005c8dd5) */ /* WARNING: Removing unreachable block (ram,0x005c8dd7) */ /* WARNING: Removing unreachable block (ram,0x005c919d) */ /* WARNING: Removing unreachable block (ram,0x005c91a3) */ /* WARNING: Removing unreachable block (ram,0x005c91b7) */ /* WARNING: Removing unreachable block (ram,0x005c927f) */ /* WARNING: Removing unreachable block (ram,0x005c928f) */ /* WARNING: Removing unreachable block (ram,0x005c92af) */ /* WARNING: Removing unreachable block (ram,0x005c92c5) */ /* DB: only caller take_damage_impl; playerType 0x1e (Tainted Eden) check, CanRerollCollectible, ItemPool::GetCollectible/ResetCollectible, AddCollectible, ClearCostumes, zeroes stat modifiers prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Entity_Player::reroll_collectibles_on_damage(Entity_Player *itemPool,RNG *rng,byte isIncludeActives) { code *pcVar1; byte bVar2; char cVar3; void *pvVar4; ActiveItemDesc *activeDesc; ItemConfig_Item *formCostume; int iVar5; ItemPool *itemPool; int *piVar6; int iVar7; Entity_Player *this_00; Entity_Player *heartPlayer; uint *d4Seed; uint activeSlot; void *formsEnd; int *historyEntry; int heartsTaken; uint uVar8; void *pvVar9; int *activeEntry; double dVar10; int *removedItemsEnd; void *formCounts; void *formCountsEnd; int rerolledCount; int *removedItemsIt; float activeChargeRatio; int *activeHistoryEntry; ItemConfig_Item *local_1c; int maxHeartsDelta; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; puStack_c = &LAB_00af5dcd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; pvVar4 = TemporaryEffects::GetCollectibleEffect(&itemPool->_temporaryeffects,0x139); if (pvVar4 != (void *)0x0) { std::vector::_Emplace_reallocate(0,pvVar4); } TemporaryEffects::ClearEffects(&itemPool->_temporaryeffects,0); ClearCostumes(itemPool); update_player_skin(itemPool); itemPool->_damageModifier = 0; itemPool->_fireDelayModifier = 0; itemPool->_speedModifier = 0; itemPool->_tearRangeModifier = 0; itemPool->_shotSpeedModifier = 0; itemPool->_luckModifier = 0; ResetItemState(itemPool); pvVar4 = (itemPool->_collectibleRNGs)._begin; maxHeartsDelta = 0; d4Seed = (uint *)((int)pvVar4 + 0x11c0); rerolledCount = 0; removedItemsEnd = (int *)0x0; local_8 = CONCAT31(local_8._1_3_,1); activeHistoryEntry = (itemPool->_history)._historyItems._end; historyEntry = (itemPool->_history)._historyItems._begin; activeChargeRatio = 0.0; if (historyEntry != activeHistoryEntry) { do { if ((char)historyEntry[1] == '\0') { uVar8 = historyEntry[2]; if (0 < *(int *)((int)(itemPool->_collectibleCounts)._begin + uVar8 * 4)) { if (g_game == (Game *)0x0) { if (-1 < (int)uVar8) goto LAB_005c8a2a; LAB_005c8a44: local_1c = (ItemConfig_Item *)0x0; } else if ((int)uVar8 < 0) { if (((int)uVar8 < 0) && (pvVar9 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar8 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar9 >> 2)) { local_1c = (ItemConfig_Item *)**(undefined4 **)((int)pvVar9 + ~uVar8 * 4); } else { local_1c = (ItemConfig_Item *)0x0; } } else { LAB_005c8a2a: pvVar9 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar9 >> 2 <= (int)uVar8) goto LAB_005c8a44; local_1c = *(ItemConfig_Item **)((int)pvVar9 + uVar8 * 4); } activeSlot = 0xffffffff; if (local_1c->type == 3) { activeSlot = 0; activeDesc = itemPool->_activeDesc; do { if (activeDesc->_item == local_1c->id) { if (((int)activeSlot < 0) || ((isIncludeActives != 0 && ((int)activeSlot < 2)))) goto LAB_005c8a89; goto LAB_005c8c08; } activeSlot = activeSlot + 1; activeDesc = activeDesc + 1; } while (activeSlot < 4); activeSlot = 0xffffffff; } LAB_005c8a89: bVar2 = CanRerollCollectible(itemPool,uVar8,0); if ((((bVar2 == 0) || (*historyEntry < 0)) || ((uVar8 == 0x248 && (isIncludeActives == 0)))) || ((itemPool->_playerType == 0x1e && (*historyEntry <= *(int *)&itemPool->field_0x1f14)))) { LAB_005c8c08: if (local_1c->addCostumeOnPickup != 0) { AddCostume(itemPool,local_1c,0); } } else { if (-1 < (int)activeSlot) { if (local_1c->maxCharges < 1) { activeChargeRatio = 1.0; } else { if ((int)activeSlot < 4) { iVar5 = itemPool->_activeDesc[activeSlot]._charge; } else { iVar5 = 0; } activeChargeRatio = (float)iVar5 / (float)local_1c->maxCharges; } itemPool->_activeDesc[activeSlot]._item = 0; uVar8 = historyEntry[2]; } piVar6 = (int *)((int)(itemPool->_collectibleCounts)._begin + uVar8 * 4); *piVar6 = *piVar6 + -1; maxHeartsDelta = maxHeartsDelta - local_1c->addMaxhearts; TriggerCollectibleRemoved(itemPool,historyEntry[2]); pvVar9 = (itemPool->_collectibleCounts)._begin; if (*(int *)((int)pvVar9 + historyEntry[2] * 4) < 1) { uVar8 = 0; *(undefined4 *)((int)pvVar9 + historyEntry[2] * 4) = 0; do { if ((((-1 < (int)uVar8) && (pvVar9 = (g_manager->_itemConfig)._playerForms._begin, (int)uVar8 < (int)(g_manager->_itemConfig)._playerForms._end - (int)pvVar9 >> 2 )) && (iVar5 = *(int *)((int)pvVar9 + uVar8 * 4), iVar5 != 0)) && ((*(int *)(iVar5 + 8) != 0 || *(int *)(iVar5 + 0xc) != 0 && (cVar3 = FUN_0072fe80(*(int *)(iVar5 + 8)), cVar3 != '\0')))) { IncrementPlayerFormCounter(itemPool,uVar8,-1); } uVar8 = uVar8 + 1; } while (uVar8 < 0x10); if (removedItemsEnd == (int *)0x0) { std::vector::_Emplace_reallocate(0,historyEntry + 2); } else { *removedItemsEnd = historyEntry[2]; removedItemsEnd = removedItemsEnd + 1; } } rerolledCount = rerolledCount + 1; historyEntry[2] = 0; if (local_1c->type == 3) { activeHistoryEntry = historyEntry; } } } } historyEntry = historyEntry + 7; } while (historyEntry != (itemPool->_history)._historyItems._end); } removedItemsIt = (int *)0x0; bVar2 = HasCollectible(itemPool,0x102,0); if (bVar2 != 0) { uVar8 = Random(); itemPool->_speedModifier = itemPool->_speedModifier + (uVar8 % 3 - 1); uVar8 = Random(); itemPool->_fireDelayModifier = itemPool->_fireDelayModifier + (uVar8 % 3 - 1); uVar8 = Random(); itemPool->_damageModifier = itemPool->_damageModifier + (uVar8 % 3 - 1); uVar8 = Random(); itemPool->_tearRangeModifier = itemPool->_tearRangeModifier + (uVar8 % 3 - 1); uVar8 = Random(); itemPool->_shotSpeedModifier = itemPool->_shotSpeedModifier + (uVar8 % 3 - 1); uVar8 = Random(); itemPool->_luckModifier = itemPool->_luckModifier + (uVar8 % 3 - 1); } uVar8 = 0; do { if (((itemPool->_hasCurseMistEffect == 0) && (itemPool->_isCoopGhost == 0)) && ((2 < itemPool->_playerForms[uVar8] && (((pvVar9 = (g_manager->_itemConfig)._playerForms._begin, (int)uVar8 < (int)(g_manager->_itemConfig)._playerForms._end - (int)pvVar9 >> 2 && (iVar5 = *(int *)((int)pvVar9 + uVar8 * 4), iVar5 != 0)) && (iVar5 = *(int *)(iVar5 + 0x28), iVar5 != -1)))))) { if ((iVar5 < 0) || (pvVar9 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar9 >> 2 <= iVar5)) { formCostume = (ItemConfig_Item *)0x0; } else { formCostume = *(ItemConfig_Item **)((int)pvVar9 + iVar5 * 4); } AddCostume(itemPool,formCostume,0); } game = g_game; uVar8 = uVar8 + 1; } while (uVar8 < 0x10); if (removedItemsEnd != (int *)0x0) { do { ItemPool::ResetCollectible(&game->_itemPool,*removedItemsIt); removedItemsIt = removedItemsIt + 1; } while (removedItemsIt != removedItemsEnd); } uVar8 = (int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2; formCounts = (void *)0x0; formCountsEnd = (void *)0x0; if (uVar8 != 0) { if (0x3fffffff < uVar8) { /* WARNING: Subroutine does not return */ std::_Xlen(); } formCounts = std::_Allocate(uVar8 * 4); formCountsEnd = (void *)((int)formCounts + uVar8 * 4); memset(formCounts,0,uVar8 * 4); } local_8 = CONCAT31(local_8._1_3_,2); (itemPool->_history)._isLocked = 1; historyEntry = (itemPool->_history)._historyItems._begin; piVar6 = (itemPool->_history)._historyItems._end; if (historyEntry != piVar6) { activeEntry = activeHistoryEntry; do { if (((char)historyEntry[1] == '\0') && (historyEntry[2] == 0)) { _isIncludeActives = (int *)0x0; do { game = g_game; local_1c = (ItemConfig_Item *)historyEntry[2]; if (local_1c != (ItemConfig_Item *)0x0) goto LAB_005c8f47; uVar8 = *d4Seed; if (activeEntry == historyEntry) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *d4Seed; if (uVar8 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar4 + 0x11c4) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)((int)pvVar4 + 0x11c8) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar4 + 0x11cc) & 0x1f) ^ uVar8; *d4Seed = uVar8; iVar5 = ItemPool::GetCollectible(&game->_itemPool,historyEntry[6],uVar8,0xc,0,0); historyEntry[2] = iVar5; activeEntry = (itemPool->_history)._historyItems._end; activeHistoryEntry = activeEntry; } else { itemPool = &g_game->_itemPool; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *d4Seed; if (uVar8 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar4 + 0x11c4) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)((int)pvVar4 + 0x11c8) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar4 + 0x11cc) & 0x1f) ^ uVar8; *d4Seed = uVar8; iVar5 = ItemPool::GetCollectible(itemPool,historyEntry[6],uVar8,6,0,0); historyEntry[2] = iVar5; } if ((itemPool->_playerType == 0x1e) && (historyEntry[2] == 0x26b)) { historyEntry[2] = 0; } _isIncludeActives = (int *)((int)_isIncludeActives + 1); } while ((int)_isIncludeActives < 10); local_1c = (ItemConfig_Item *)historyEntry[2]; if (local_1c == (ItemConfig_Item *)0x0) { historyEntry[2] = 0x19; local_1c = (ItemConfig_Item *)0x19; } LAB_005c8f47: if (g_game == (Game *)0x0) { if (-1 < (int)local_1c) goto LAB_005c8f8c; LAB_005c8fa6: _isIncludeActives = (int *)0x0; } else if ((int)local_1c < 0) { if (((int)local_1c < 0) && (pvVar9 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)local_1c < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar9 >> 2)) { _isIncludeActives = (int *)**(undefined4 **)((int)pvVar9 + ~(uint)local_1c * 4); } else { _isIncludeActives = (int *)0x0; } } else { LAB_005c8f8c: pvVar9 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar9 >> 2 <= (int)local_1c) goto LAB_005c8fa6; _isIncludeActives = *(int **)((int)pvVar9 + (int)local_1c * 4); } if (*_isIncludeActives == 3) { dVar10 = ceil((double)((float)_isIncludeActives[0x1d] * activeChargeRatio)); iVar5 = (int)dVar10; } else { iVar5 = 0; } AddCollectible(itemPool,(int)local_1c,iVar5,0,0,0,0); local_1c = (ItemConfig_Item *)0x0; formsEnd = (g_manager->_itemConfig)._playerForms._end; pvVar9 = (g_manager->_itemConfig)._playerForms._begin; if ((int)formsEnd - (int)pvVar9 >> 2 != 0) { do { if ((((-1 < (int)local_1c) && ((int)local_1c < (int)formsEnd - (int)pvVar9 >> 2)) && (iVar5 = *(int *)((int)pvVar9 + (int)local_1c * 4), iVar5 != 0)) && (*(int *)(iVar5 + 8) != 0 || *(int *)(iVar5 + 0xc) != 0)) { cVar3 = FUN_0072fe80(*(undefined4 *)(iVar5 + 8)); manager = g_manager; if (cVar3 != '\0') { piVar6 = (int *)((int)formCounts + (int)local_1c * 4); *piVar6 = *piVar6 + 1; formsEnd = (manager->_itemConfig)._playerForms._end; } } local_1c = (ItemConfig_Item *)((int)local_1c + 1); pvVar9 = (g_manager->_itemConfig)._playerForms._begin; } while (local_1c < (uint)((int)formsEnd - (int)pvVar9 >> 2)); activeEntry = activeHistoryEntry; } maxHeartsDelta = maxHeartsDelta + _isIncludeActives[0x16]; piVar6 = (itemPool->_history)._historyItems._end; } historyEntry = historyEntry + 7; } while (historyEntry != piVar6); } (itemPool->_history)._isLocked = 0; if (maxHeartsDelta < 0) { heartPlayer = itemPool; do { iVar5 = maxHeartsDelta; if (-1 < maxHeartsDelta) break; iVar5 = *(int *)&heartPlayer->field_0x1950; if (0 < iVar5) { iVar7 = -maxHeartsDelta; if (iVar5 < -maxHeartsDelta) { iVar7 = iVar5; } maxHeartsDelta = maxHeartsDelta + iVar7; *(int *)&heartPlayer->field_0x1950 = iVar5 - iVar7; } heartPlayer = (Entity_Player *)heartPlayer->_subPlayer; iVar5 = maxHeartsDelta; } while (heartPlayer != (Entity_Player *)0x0); heartPlayer = itemPool; maxHeartsDelta = iVar5; do { if (-1 < iVar5) break; iVar7 = heartPlayer->_maxHearts; if (0 < iVar7) { heartsTaken = -iVar5; if (iVar7 < -iVar5) { heartsTaken = iVar7; } AddMaxHearts(heartPlayer,-heartsTaken,0); iVar5 = maxHeartsDelta + heartsTaken; if (heartPlayer->_redHearts < 1) { iVar7 = GetHealthType(heartPlayer); if ((iVar7 == 3) || (heartPlayer->_playerType == 0x12)) { AddMaxHearts(heartPlayer,2,0); AddHearts(heartPlayer,2,1,0); } else if (heartPlayer->_soulHearts < 1) { AddSoulHearts(this_00,2,0); } } maxHeartsDelta = iVar5; } heartPlayer = (Entity_Player *)heartPlayer->_subPlayer; } while (heartPlayer != (Entity_Player *)0x0); } else if (0 < maxHeartsDelta) { AddMaxHearts(itemPool,maxHeartsDelta,0); } uVar8 = 0; if ((int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2 != 0) { do { iVar5 = *(int *)((int)formCounts + uVar8 * 4); if (0 < iVar5) { IncrementPlayerFormCounter(itemPool,uVar8,iVar5); } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2)); } itemPool->_cacheFlags = itemPool->_cacheFlags | 0xffff; EvaluateItems(); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); if (formCounts != (void *)0x0) { uVar8 = (int)formCountsEnd - (int)formCounts & 0xfffffffc; pvVar4 = formCounts; if (0xfff < uVar8) { pvVar4 = *(void **)((int)formCounts + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)formCounts + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar8); } ExceptionList = local_10; return rerolledCount; } //@@ 005c92f0 FUN_005c92f0 int FUN_005c92f0(void) { qword qVar1; uint uVar2; qword *pqVar3; int in_ECX; int iVar4; EntityList_EL local_20; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_20,3,0xde,-1,0,0); uVar2 = 0; if (local_20._size != 0) { do { iVar4 = *(int *)((int)local_20._data + uVar2 * 4); if (*(int *)(iVar4 + 0x410) == in_ECX) goto LAB_005c9362; uVar2 = uVar2 + 1; } while (uVar2 < (uint)local_20._size); } iVar4 = 0; LAB_005c9362: if (local_20._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } if (local_20._data != (void *)0x0) { uVar2 = *(uint *)((int)local_20._data + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar2; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar2); free((void *)((int)local_20._data + -4)); } } ExceptionList = local_10; return iVar4; } //@@ 005c93b0 Entity_Player::AddWisp /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [lua] Lua binding EntityPlayer:AddWisp prototype: db/protos.zhl, confirmed by RET 16 */ Entity_Familiar * __thiscall Entity_Player::AddWisp (Entity_Player *this,int collectibleId,Vector *position,byte isAdjustOrbitLayer, byte isDontUpdate) { float ******ppppppfVar2; float ******ppppppfVar1; code *pcVar3; uint uVar4; void *pvVar5; float *******wispConfigCopy; Entity_Familiar *newWisp; int wispItemId; uint wispLayer; qword *heapCounter; char isSpawning; uint i; uint *rngSeed; uint orbitLayer; float *******pppppppfVar7; EntityList_EL wispList; Entity_Familiar *weakestSameWisp; float weakestHp; float *******local_48; Entity_Player *player; uint itemId; char isSpawnAllowed; int layerStats [10]; void *local_10; undefined1 *puStack_c; int local_8; Entity_Familiar *wisp; qword allocatedBytes; Game *game; float *******wispConfigCopy; local_8 = 0xffffffff; puStack_c = &LAB_00af5e1d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(layerStats + 0xd); ExceptionList = &local_10; itemId = collectibleId; player = this; layerStats[9] = uVar4; local_48 = ItemConfig::get_wisp_config(collectibleId); isSpawnAllowed = '\x01'; orbitLayer = (uint)*(short *)(local_48 + 99); if (*(short *)(local_48 + 99) < 0) goto LAB_005c9642; layerStats[6] = 0; layerStats[7] = 0; layerStats[8] = 0; layerStats[0] = 0; layerStats[1] = 0; layerStats[2] = 0; layerStats[3] = 9999; layerStats[4] = 9999; layerStats[5] = 9999; weakestSameWisp = (Entity_Familiar *)0x0; weakestHp = 9999.0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&wispList,3,0xce,-1,0,0); i = 0; local_8 = 0; if (wispList._size != 0) { pvVar5 = wispList._data; do { wisp = *(Entity_Familiar **)((int)pvVar5 + i * 4); if ((((wisp != (Entity_Familiar *)0x0) && (wisp->_type == 3)) && (wisp->_exists != 0)) && (wisp->_player == player)) { if ((itemId == 0x246) && (wisp->_subtype == 0x246)) { if (wispList._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,pvVar5,0); } ExceptionList = local_10; return (Entity_Familiar *)0x0; } if (wisp->_variant == 0xed) { wispItemId = wisp->_wispCollectibleType; } else if (wisp->_variant == 0xce) { wispItemId = wisp->_subtype; } else { wispItemId = 0x248; } pvVar5 = ItemConfig::get_wisp_config(wispItemId); wispLayer = wisp->_orbitLayer - 7; if (2 < wispLayer) { wispLayer = 0xffffffff; } if ((wisp->_subtype == itemId) && (wisp->_health < weakestHp)) { weakestSameWisp = wisp; weakestHp = wisp->_health; } if (-1 < (int)wispLayer) { if ((int)*(short *)((int)pvVar5 + 0x18e) < layerStats[wispLayer + 3]) { layerStats[wispLayer + 3] = (int)*(short *)((int)pvVar5 + 0x18e); layerStats[wispLayer] = (int)wisp; } layerStats[wispLayer + 6] = layerStats[wispLayer + 6] + 1; } pvVar5 = wispList._data; } i = i + 1; } while (i < (uint)wispList._size); } wispConfigCopy = local_48; if (isAdjustOrbitLayer != 0) { i = 0; do { if (layerStats[orbitLayer + 6] < *(int *)(&DAT_00b62c90 + orbitLayer * 4)) break; orbitLayer = (orbitLayer + 1) % 3; i = i + 1; } while (i < 3); } if (layerStats[orbitLayer + 6] < *(int *)(&DAT_00b62c90 + orbitLayer * 4)) { LAB_005c95f0: isSpawning = isSpawnAllowed; } else { if (weakestSameWisp == (Entity_Familiar *)0x0) { if ((int *)layerStats[orbitLayer] != (int *)0x0) { (**(code **)(*(int *)layerStats[orbitLayer] + 0x28))(uVar4); } goto LAB_005c95f0; } pppppppfVar7 = (float *******)((float)*local_48 + weakestSameWisp->_health); ppppppfVar1 = *local_48; ppppppfVar2 = *local_48; local_48 = pppppppfVar7; wispConfigCopy = (float *******)&local_48; if ((float)ppppppfVar2 <= (float)pppppppfVar7 && (float)pppppppfVar7 != (float)ppppppfVar1) { wispConfigCopy = wispConfigCopy; } weakestSameWisp->_health = (float)*wispConfigCopy; isSpawning = '\0'; } local_8 = 0xffffffff; if (wispList._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if (wispList._data != (void *)0x0) { uVar4 = *(uint *)((int)wispList._data + -4); allocatedBytes = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar4; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)allocatedBytes < uVar4); free((uint *)((int)wispList._data + -4)); } } local_8 = 0xffffffff; if (isSpawning == '\0') { ExceptionList = local_10; return (Entity_Familiar *)0x0; } collectibleId = itemId; LAB_005c9642: pvVar5 = (player->_collectibleRNGs)._begin; rngSeed = (uint *)((int)pvVar5 + 0x2480); uVar4 = *rngSeed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *rngSeed; if (uVar4 == 0) { pcVar3 = (code *)swi(3); newWisp = (Entity_Familiar *)(*pcVar3)(); return newWisp; } } game = g_game; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x2484) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar5 + 0x2488) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x248c) & 0x1f) ^ uVar4; *rngSeed = uVar4; newWisp = (Entity_Familiar *) Game::Spawn(game,3,0xce,position,&g_vectorZero,(Entity *)player,collectibleId,uVar4); if ((isAdjustOrbitLayer != 0) && (-1 < (int)orbitLayer)) { Entity_Familiar::AddToOrbit(newWisp,orbitLayer + 7); } if (isDontUpdate == 0) { (**(code **)(*(int *)newWisp + 0xc))(); } ExceptionList = local_10; return newWisp; } //@@ 005c96f0 Entity_Player::AddItemWisp /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:AddItemWisp */ Entity_Familiar * Entity_Player::AddItemWisp(uint param_1,Vector *param_2,char param_3) { code *pcVar1; Game *this; byte bVar2; void *pvVar3; void *pvVar4; Entity_Familiar *pEVar5; Entity_Player *in_ECX; int iVar6; uint uVar7; uint uVar8; int iVar9; uint *puVar10; uint uVar11; int local_2c [10]; local_2c[9] = __security_cookie ^ (uint)(local_2c + 10); iVar9 = 0x2c8; bVar2 = HasCollectible(in_ECX,0x248,0); if (bVar2 != 0) { iVar9 = 0x10012; } pvVar3 = ItemConfig::get_wisp_config(iVar9); uVar11 = (uint)*(short *)((int)pvVar3 + 0x18c); if (-1 < *(short *)((int)pvVar3 + 0x18c)) { uVar8 = 0; local_2c[6] = 0; local_2c[7] = 0; local_2c[8] = 0; pvVar3 = g_game->_room; local_2c[0] = 0; local_2c[1] = 0; local_2c[2] = 0; local_2c[3] = 9999; local_2c[4] = 9999; local_2c[5] = 9999; if (*(int *)((int)pvVar3 + 0x1264) != 0) { do { iVar9 = *(int *)(*(int *)((int)pvVar3 + 0x125c) + uVar8 * 4); if ((((iVar9 != 0) && (*(int *)(iVar9 + 0x28) == 3)) && ((iVar6 = *(int *)(iVar9 + 0x2c), iVar6 == 0xce || (iVar6 == 0xed)))) && (*(Entity_Player **)(iVar9 + 0x410) == in_ECX)) { if (iVar6 == 0xed) { iVar6 = *(int *)(iVar9 + 0xf20); } else if (iVar6 == 0xce) { iVar6 = *(int *)(iVar9 + 0x30); } else { iVar6 = 0x248; } pvVar4 = ItemConfig::get_wisp_config(iVar6); iVar6 = *(int *)(iVar9 + 0xd70); uVar7 = iVar6 - 7; if ((uVar7 < 3) && (-1 < (int)uVar7)) { if ((*(int *)(iVar9 + 0x2c) == 0xce) || ((int)*(short *)((int)pvVar4 + 0x18e) < local_2c[iVar6 + -4])) { local_2c[iVar6 + -4] = (int)*(short *)((int)pvVar4 + 0x18e); local_2c[uVar7] = iVar9; } local_2c[iVar6 + -1] = local_2c[iVar6 + -1] + 1; } } uVar8 = uVar8 + 1; } while (uVar8 < *(uint *)((int)pvVar3 + 0x1264)); } if (param_3 != '\0') { uVar8 = 0; do { if (local_2c[uVar11 + 6] < *(int *)(&DAT_00b62c90 + uVar11 * 4)) break; uVar11 = (uVar11 + 1) % 3; uVar8 = uVar8 + 1; } while (uVar8 < 3); } if ((*(int *)(&DAT_00b62c90 + uVar11 * 4) <= local_2c[uVar11 + 6]) && ((int *)local_2c[uVar11] != (int *)0x0)) { (**(code **)(*(int *)local_2c[uVar11] + 0x28))(); } } pvVar3 = (in_ECX->_collectibleRNGs)._begin; puVar10 = (uint *)((int)pvVar3 + 0x2c80); uVar8 = *puVar10; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *puVar10; if (uVar8 == 0) { pcVar1 = (code *)swi(3); pEVar5 = (Entity_Familiar *)(*pcVar1)(); return pEVar5; } } this = g_game; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar3 + 0x2c84) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)((int)pvVar3 + 0x2c88) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar3 + 0x2c8c) & 0x1f) ^ uVar8; *puVar10 = uVar8; pEVar5 = (Entity_Familiar *) Game::Spawn(this,3,0xed,param_2,&g_vectorZero,(Entity *)in_ECX,param_1,uVar8); if ((param_3 != '\0') && (-1 < (int)uVar11)) { Entity_Familiar::AddToOrbit(pEVar5,uVar11 + 7); } (**(code **)(*(int *)pEVar5 + 0xc))(); return pEVar5; } //@@ 005c9930 Entity_Player::trigger_book_of_belial_passive /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: requires HasCollectible(0x3b BOOK_OF_BELIAL_PASSIVE, Judas birthright); switch on used active id adds bonus effects (Necronomicon via UseActiveItem(0x23), AddNullEffect, AddMidasFreeze); called from active_used_post right after TriggerBookOfVirtues prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::trigger_book_of_belial_passive(Entity_Player *effectSprite,int activeId,int charges) { void *pvVar1; byte bVar2; uint uVar3; Entity *tmpEntity; uint uVar4; LayerState *sparkLayer; int iVar5; Game *game; float fVar6; float sparkScaleX; float sparkScaleY; float fVar7; int nullEffect [3]; undefined4 local_7c; Vector sparkPos; Vector sparkVelocity; Entity_Player *player; Entity *local_64; code *local_60; ItemConfig_Item *local_5c; undefined4 local_58; uint local_54; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float fStack_2c; Entity_Player *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; ANM2 *effectSprite; Manager *manager; puStack_20 = local_50 + 0x4c; uStack_14 = 0xffffffff; puStack_18 = &LAB_00af5e50; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; player = effectSprite; bVar2 = HasCollectible(effectSprite,0x3b,0); if (bVar2 == 0) { ExceptionList = local_1c; return; } local_58 = g_manager; local_5c = ItemConfig::GetCollectible(&g_manager->_itemConfig,activeId); if (activeId < 0xbb) { if (activeId == 0xba) { LAB_005ca3b6: iVar5 = 0x7e; LAB_005ca3bc: TemporaryEffects::AddCollectibleEffect(&effectSprite->_temporaryeffects,iVar5,1,1); ExceptionList = local_1c; return; } switch(activeId) { case 0x22: case 0x3b: case 0x85: ExceptionList = local_1c; return; case 0x28: case 0x7e: local_54 = 0x21; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&local_58->_sfxManager,local_54,1.0,2,0,1.0,0.0); UseActiveItem(effectSprite,(short *)((int)&local_58 + 2),0x23,1,-1,0); Game::ShakeScreen(g_game,8); pvVar1 = g_game->_room; *(undefined4 *)((int)pvVar1 + 0x7214) = 10; *(undefined4 *)((int)pvVar1 + 0x7218) = 5; ExceptionList = local_1c; return; case 0x7f: TemporaryEffects::AddNullEffect(&effectSprite->_temporaryeffects,0x81,1,2); ExceptionList = local_1c; return; case 0x87: TemporaryEffects::AddNullEffect(&effectSprite->_temporaryeffects,0x7b,1,1); ExceptionList = local_1c; return; } switchD_005c99c5_caseD_23: if (local_5c == (ItemConfig_Item *)0x0) { ExceptionList = local_1c; return; } if (local_5c->maxCharges < 1) { ExceptionList = local_1c; return; } if (local_5c->chargeType != 0) { ExceptionList = local_1c; return; } } else if (activeId < 0x22c) { if (activeId == 0x22b) { local_54 = 0x89; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&local_58->_sfxManager,local_54,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xf); local_58 = (Manager *)0x0; local_5c = g_game->_room; game = g_game; if (*(int *)((int)local_5c + 0x1264) == 0) { ExceptionList = local_1c; return; } do { tmpEntity = *(Entity **)(*(int *)((int)local_5c + 0x125c) + (int)local_58 * 4); if ((*(int *)&game->_deathmatchManager < 2) || (tmpEntity->_type != 1)) { local_54 = tmpEntity->_type; if (local_54 - 10 < 0x3de) goto LAB_005c9c18; } else { local_54 = 1; LAB_005c9c18: if ((((tmpEntity->_entityCollisionClass != 1) && (tmpEntity->_entityCollisionClass != 0)) && (tmpEntity->_isInvicible == 0)) && (tmpEntity->_dead == 0)) { bVar2 = Entity::HasEntityFlags(tmpEntity,0x10); if (((bVar2 == 0) || (local_54 == 0x322)) || (local_54 == 0x362)) { uVar3 = Random(); if (uVar3 % 3 == 0) { if (effectSprite == (Entity_Player *)0x0) { local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.0; local_40 = 0.0; fStack_3c = g_vectorZero.x; fStack_38 = g_vectorZero.y; fStack_34 = g_vectorZero.x; local_30 = g_vectorZero.y; LAB_005c9d27: uVar3 = 0; if (effectSprite != (Entity_Player *)0x0) goto LAB_005c9d2d; uVar3 = 0; LAB_005c9d48: local_54 = 0; if (effectSprite != (Entity_Player *)0x0) goto LAB_005c9d53; LAB_005c9d6c: uVar4 = 0; } else { local_50._4_4_ = effectSprite->_type; fStack_3c = (effectSprite->_pos).x; fStack_38 = (effectSprite->_pos).y; fStack_48 = (float)effectSprite->_variant; fStack_44 = (float)effectSprite->_spawnerType; local_40 = (float)effectSprite->_spawnerVariant; fStack_34 = (effectSprite->_velocity).x; local_30 = (effectSprite->_velocity).y; if ((effectSprite->_flags & 0x100) == 0) goto LAB_005c9d27; uVar3 = 1; LAB_005c9d2d: if ((effectSprite->_flags & 0x20000000) == 0) goto LAB_005c9d48; local_54 = 2; LAB_005c9d53: if ((effectSprite->_flags & 0x40000000000000) == 0) goto LAB_005c9d6c; uVar4 = 4; } fStack_2c = (float)(uVar3 | local_54 | uVar4); local_28 = effectSprite; Entity::AddMidasFreeze(tmpEntity,(EntityRef *)(local_50 + 4),3,0); } local_60 = *(code **)(*(int *)tmpEntity + 0x20); if (effectSprite == (Entity_Player *)0x0) { local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.0; local_40 = 0.0; fStack_3c = g_vectorZero.x; fStack_38 = g_vectorZero.y; fStack_34 = g_vectorZero.x; local_30 = g_vectorZero.y; LAB_005c9e39: local_54 = 0; if (effectSprite != (Entity_Player *)0x0) goto LAB_005c9e44; local_54 = 0; LAB_005c9e62: uVar3 = 0; if (effectSprite != (Entity_Player *)0x0) goto LAB_005c9e68; LAB_005c9e81: uVar4 = 0; } else { local_50._4_4_ = effectSprite->_type; fStack_3c = (effectSprite->_pos).x; fStack_38 = (effectSprite->_pos).y; fStack_48 = (float)effectSprite->_variant; fStack_44 = (float)effectSprite->_spawnerType; local_40 = (float)effectSprite->_spawnerVariant; fStack_34 = (effectSprite->_velocity).x; local_30 = (effectSprite->_velocity).y; if ((effectSprite->_flags & 0x100) == 0) goto LAB_005c9e39; local_54 = 1; LAB_005c9e44: if ((effectSprite->_flags & 0x20000000) == 0) goto LAB_005c9e62; uVar3 = 2; LAB_005c9e68: if ((effectSprite->_flags & 0x40000000000000) == 0) goto LAB_005c9e81; uVar4 = 4; } fStack_2c = (float)(uVar3 | uVar4 | local_54); local_28 = effectSprite; (*local_60)(effectSprite->_meleeDamage + effectSprite->_meleeDamage + 15.0,0,0,local_50 + 4,0x1e); } game = g_game; } } local_58 = (Manager *)((int)local_58 + 1); if (*(uint *)((int)local_5c + 0x1264) <= local_58) { ExceptionList = local_1c; return; } } while( true ); } if (activeId == 0x11a) { local_54 = 0x1d7; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&local_58->_sfxManager,local_54,1.0,2,0,1.0,0.0); ExceptionList = local_1c; return; } if (activeId != 0x122) { if (activeId == 0x127) { uVar3 = RNG::RandomInt((RNG *)((int)(effectSprite->_collectibleRNGs)._begin + 0x3b0),4); manager = g_manager; if (uVar3 != 0) { ExceptionList = local_1c; return; } local_54 = 0x112; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,local_54,1.0,2,0,1.0,0.0); iVar5 = 0x22b; goto LAB_005ca3bc; } goto switchD_005c99c5_caseD_23; } if (charges < 1) { ExceptionList = local_1c; return; } } else { if (activeId == 0x26f) goto LAB_005ca3b6; if (activeId != 0x282) goto switchD_005c99c5_caseD_23; TemporaryEffects::AddNullEffect(&effectSprite->_temporaryeffects,0x82,1,1); local_58 = g_manager; } if (charges == 0) { charges = 1; if (1 < local_5c->_initCharge) { charges = local_5c->_initCharge; } } bVar2 = TemporaryEffects::HasCollectibleEffect(&effectSprite->_temporaryeffects,0x22); if (bVar2 == 0) { bVar2 = TemporaryEffects::HasNullEffect(&effectSprite->_temporaryeffects,0x7b); local_54 = 0x22; if (bVar2 == 0) goto LAB_005c9f70; } local_54 = 0x1d7; LAB_005c9f70: seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&local_58->_sfxManager,local_54,1.0,2,0,1.0,0.0); pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((0x1ec < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU)) && (iVar5 = *(int *)((int)pvVar1 + 0x1ec), iVar5 != 0)) { nullEffect[2] = *(undefined4 *)(iVar5 + 0x78); nullEffect[1] = 0; local_7c = 0; nullEffect[0] = iVar5; TemporaryEffects::AddEffect(&effectSprite->_temporaryeffects,nullEffect,1,charges); } if (charges < 4) { uVar3 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&effectSprite->_pos,&g_vectorZero,(Entity *)0x0,0,uVar3); local_30 = 0.0; local_50._0_4_ = 0.2; local_50._4_4_ = 0.2; fStack_48 = 0.2; fStack_44 = 0.6; local_40 = 1.0; fStack_3c = 1.0; fStack_38 = 1.0; fStack_34 = 1.0; fStack_2c = 0.0; local_28 = (Entity_Player *)0x0; (**(code **)(*(int *)tmpEntity + 0x3c))(local_50,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); } else { local_50._0_4_ = 0.2; local_50._4_4_ = 0.2; fStack_48 = 0.2; fStack_44 = 0.6; local_30 = 0.0; local_40 = 1.0; fStack_3c = 1.0; fStack_38 = 1.0; fStack_34 = 1.0; fStack_2c = 0.0; local_28 = (Entity_Player *)0x0; Entity::MakeGroundPoof((Entity *)effectSprite,&effectSprite->_pos,(ColorMod *)local_50,1.0); } local_54 = 0; do { uVar3 = local_54; local_5c = (ItemConfig_Item *)((float)(int)local_54 * 0.7 * 0.25 + 0.3); local_58 = (Manager *)((float)local_5c * 0.0); uVar4 = Random(); local_64 = (Entity *) ((-10.0 - (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 6.0) * (float)local_5c); uVar4 = Random(); local_5c = (ItemConfig_Item *) (((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 - 5.0) * 0.017453292); local_60 = (code *)cos((float)local_5c); fVar6 = sin((float)local_5c); fVar7 = ((float)(int)uVar3 - 0.0) / 12.0; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } sparkVelocity.y = fVar7 * 1.4 + 0.6; sparkVelocity.x = ((float)local_60 * (float)local_58 - fVar6 * (float)local_64) * sparkVelocity.y; sparkVelocity.y = ((float)local_60 * (float)local_64 + fVar6 * (float)local_58) * sparkVelocity.y; sparkPos.x = sparkVelocity.x + sparkVelocity.x + (effectSprite->_pos).x; sparkPos.y = sparkVelocity.y + sparkVelocity.y + (effectSprite->_pos).y; uVar3 = Random(); local_64 = Game::Spawn(g_game,1000,0x3b,&sparkPos,&sparkVelocity,(Entity *)effectSprite,0,uVar3); uVar3 = g_graphicsManager_flags; effectSprite = &local_64->_sprite; sparkLayer = ANM2::GetLayer(effectSprite,(byte *)0x0); local_30 = 0.0; fStack_2c = 0.0; iVar5 = 1; local_28 = (Entity_Player *)0x0; if ((uVar3 & 4) == 0) { iVar5 = 6; } sparkLayer->_blendMode[0] = 0; sparkLayer->_blendMode[1] = iVar5; sparkLayer->_blendMode[2] = 1; sparkLayer->_blendMode[3] = 1; sparkLayer->_blendMode[4] = 1; sparkLayer = ANM2::GetLayer(effectSprite,(byte *)0x0); if (&sparkLayer->_color != (ColorMod *)local_50) { (sparkLayer->_color)._tint[0] = 5.0; (sparkLayer->_color)._tint[1] = 0.5; (sparkLayer->_color)._tint[2] = 0.2; (sparkLayer->_color)._tint[3] = 1.0; (sparkLayer->_color)._colorize[0] = 0.0; (sparkLayer->_color)._colorize[1] = 0.0; (sparkLayer->_color)._colorize[2] = 0.0; (sparkLayer->_color)._colorize[3] = 0.0; *(ulonglong *)(sparkLayer->_color)._offset = CONCAT44(fStack_2c,local_30); (sparkLayer->_color)._offset[2] = (float)local_28; } uVar3 = Random(); tmpEntity = local_64; *(float *)(local_64[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar3 = Random(); iVar5 = uVar3 % 10 + 10; *(int *)(tmpEntity[1]._sprite._filename._buf + 8) = iVar5; *(int *)(tmpEntity[1]._sprite._filename._buf + 0xc) = iVar5; uVar3 = Random(); sparkScaleX = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.2; sparkScaleY = sparkScaleX * g_vectorOne.y; sparkScaleX = sparkScaleX * g_vectorOne.x; fVar7 = (player->_playerSpriteScale).y; fVar6 = (player->_playerSpriteScale).x; tmpEntity->_renderZOffset = -600; (tmpEntity->_sprite)._scale.y = sparkScaleY * fVar7; (tmpEntity->_sprite)._scale.x = sparkScaleX * fVar6; local_54 = local_54 + 1; effectSprite = player; } while ((int)local_54 < 5); ExceptionList = local_1c; return; } //@@ 005ca470 Entity_Player::TriggerBookOfVirtues /* ZHL [lua] Lua binding EntityPlayer:TriggerBookOfVirtues */ void Entity_Player::TriggerBookOfVirtues(int param_1) { code *pcVar1; Manager *pMVar2; byte bVar3; uint uVar4; void *pvVar5; Entity_Player *in_ECX; ushort uVar6; uint *puVar7; int local_c [2]; bVar3 = HasCollectible(in_ECX,0x248,0); if (bVar3 == 0) { return; } if (param_1 == 0x61) { pvVar5 = (in_ECX->_collectibleRNGs)._begin; puVar7 = (uint *)((int)pvVar5 + 0x2480); uVar4 = *puVar7; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *puVar7; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x2484) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar5 + 0x2488) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x248c) & 0x1f) ^ uVar4; *puVar7 = uVar4; param_1 = *(int *)(&DAT_00b62c9c + (uVar4 % 7) * 4); if (param_1 == 0xb1) { uVar6 = 3; ItemConfig::get_wisp_config(0xb1); goto LAB_005ca50f; } } pvVar5 = ItemConfig::get_wisp_config(param_1); uVar6 = *(ushort *)((int)pvVar5 + 400); LAB_005ca50f: bVar3 = HasCollectible(in_ECX,0x164,0); if (bVar3 != 0) { uVar6 = uVar6 * 2; } if (0 < (short)uVar6) { uVar4 = (uint)uVar6; do { AddWisp(in_ECX,param_1,&in_ECX->_pos,0,0); pMVar2 = g_manager; uVar4 = uVar4 - 1; } while (uVar4 != 0); local_c[0] = 0x1d7; seed_fart_sound_override(local_c); SoundEffects::Play(&pMVar2->_sfxManager,local_c[0],1.0,2,0,1.0,0.0); } return; } //@@ 005ca566 FUN_005ca566 void FUN_005ca566(undefined4 param_1,undefined4 param_2,int param_3) { int unaff_ESI; SoundEffects::Play((SoundEffects *)(unaff_ESI + 0x2a324),param_3,1.0,2,0,1.0,0.0); return; } //@@ 005ca5a0 KAGE_Filesys_FileManager::OpenRead /* ZHL [exact] __thiscall KAGE_Filesys_IFile* KAGE_Filesys_FileManager::OpenRead(const char* filePath); */ bool __thiscall KAGE_Filesys_FileManager::OpenRead(KAGE_Filesys_FileManager *this,int param_2,int param_3) { byte bVar1; int iVar2; int iVar3; if (-1 < param_3) { iVar2 = Entity_Player::GetActiveMaxCharge((Entity_Player *)this,param_3); iVar3 = Entity_Player::GetTotalActiveCharge((Entity_Player *)this,param_3); if (iVar3 < iVar2) { return false; } } if (0x244 < param_2) { switch(param_2) { case 0x248: if ((this[0x5f1] != (KAGE_Filesys_FileManager)0x0) && (*(int *)this[0x5f1] == 3)) { return false; } default: return true; case 0x26f: return 0 < (int)this[0x4d7]; case 0x27b: iVar2 = FUN_005c92f0(); if (iVar2 != 0) { iVar2 = Room::GetGridCollisionAtPos(g_game->_room,*(Vector *)(iVar2 + 0x33c)); if (*(char *)(this + 0x55c) != '\0') { return iVar2 != 4; } if (iVar2 == 0) { return true; } if (iVar2 == 5) { return true; } } break; case 0x282: iVar2 = Entity_Player::GetEffectiveMaxHearts((Entity_Player *)this); return 0 < iVar2 + (int)this[0x4d3]; case 0x2c5: if ((this[0x7cb] == (KAGE_Filesys_FileManager)0x0) && (1.0 < (float)this[0xd8] * (float)this[0xd8] + (float)this[0xd9] * (float)this[0xd9])) { return true; } break; case 0x2ca: bVar1 = Entity::HasEntityFlags((Entity *)this,0x600000000000000); if ((bVar1 == 0) && ((float)this[0xd4] == 0.0)) { return true; } } return false; } if (param_2 == 0x244) { iVar2 = FUN_00827180(this + 0xcf); return iVar2 != -1; } if (0x127 < param_2) { if (param_2 != 0x1e7) { if (param_2 == 0x22b) { return 4 < (int)this[0x4da]; } return true; } LAB_005ca662: return 1 < (int)this[0x4d0]; } if (param_2 == 0x127) { return 0 < (int)this[0x4da]; } if (param_2 != 0x82) { if (param_2 == 0x85) goto LAB_005ca662; if (param_2 != 0xb5) { return true; } } return 1.0 < (float)this[0xd8] * (float)this[0xd8] + (float)this[0xd9] * (float)this[0xd9]; } //@@ 005ca880 FUN_005ca880 void FUN_005ca880(void) { int iVar1; qword qVar2; uint uVar3; uint uVar4; Entity *pEVar5; void *pvVar6; qword *pqVar7; uint uVar8; float x; undefined4 uVar9; TypeDescriptor *pTVar10; TypeDescriptor *pTVar11; undefined4 uVar12; EntityList_EL local_2c; int local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5e8d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_2c,3,0xce,-1,0,0); uVar8 = 0; local_8 = 0; if (local_2c._size != 0) { pvVar6 = local_2c._data; do { iVar1 = *(int *)((int)pvVar6 + uVar8 * 4); if (((*(char *)(iVar1 + 0x173) == '\0') && (*(int *)(iVar1 + 0x2c) == 0xce)) && (*(int *)(iVar1 + 0x30) == 0x15f)) { uVar4 = Random(); uVar12 = 0; pTVar11 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar10 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar9 = 0; pEVar5 = Game::Spawn(g_game,1000,0x48,(Vector *)(iVar1 + 0x33c),&g_vectorZero, *(Entity **)(iVar1 + 0x410),0,uVar4); local_1c = __RTDynamicCast(pEVar5,uVar9,pTVar10,pTVar11,uVar12,uVar3); local_18 = (int *)(local_1c + 0x3bc); if (*(int *)(local_1c + 0x3bc) != 0) { local_14 = local_18; std::multiset::erase(&local_14); } *local_18 = iVar1; std::multiset::insert(local_18); uVar4 = Random(); x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0; if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } *(float *)(local_1c + 0x474) = x; pvVar6 = local_2c._data; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)local_2c._size); } if (local_2c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } if (local_2c._data != (void *)0x0) { uVar3 = *(uint *)((int)local_2c._data + -4); qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar3; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar2 < uVar3); free((uint *)((int)local_2c._data + -4)); } } ExceptionList = local_10; return; } //@@ 005caa70 Entity_Player::console_spawn /* DB: ? ECX=player (pos +0x33c, +0x1770), param_1 = parsed spawn vector (type,variant,subtype,count), from Isaac::ExecuteCommand handler 0068cdc0; AddCharmed/LoadDeliriumForm/AddWisp/ShowHallucination/AddPersistentEntity options prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::console_spawn(Entity_Player *this,int *spawnSpec,byte isAddWisp) { int iVar1; code *pcVar2; Entity_Player *this_00; byte isBookOfVirtues; uint uVar3; Vector *position; EntityPtr tmpEntity; EntityPtr chainEntity; EntityPtr nextChainNpc; void *spawnedBuffer; float *ptr; uint i; EntityPtr *pEVar4; Vector *pos; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; float local_9c; float local_98; float local_94; float local_90; undefined4 local_8c; undefined4 local_88; void *spawnedBegin; EntityPtr *local_80; EntityPtr *local_7c; float local_78; float fStack_74; Vector VStack_70; EntityRef local_68; EntityPtr spawned; uint *rng; EntityPtr *local_38; EntityPtr *local_34; Entity_Player *local_30; void *local_2c; Vector *playerPos; float *entriesBegin; float *entriesEnd; float *entriesCapacityEnd; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; float playerPosY; uint *rngState; local_8 = 0xffffffff; puStack_c = &LAB_00af5ec5; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; i = 0; local_34 = g_game->_room; local_30 = this; if (*(int *)((int)local_34 + 0x1264) != 0) { do { iVar1 = *(int *)(*(int *)((int)local_34 + 0x125c) + i * 4); if (((*(uint *)(iVar1 + 0x16c) & 0x10000000) != 0) && (*(Entity_Player **)(iVar1 + 0x264) == local_30)) { *(undefined4 *)(iVar1 + 0x168) = *(undefined4 *)(iVar1 + 0x168); *(uint *)(iVar1 + 0x16c) = *(uint *)(iVar1 + 0x16c) | 0x20000000; local_ac = 0; local_a8 = 0; local_a4 = 0; local_98 = g_vectorZero.y; local_90 = g_vectorZero.y; local_a0 = 0; local_9c = g_vectorZero.x; local_94 = g_vectorZero.x; local_8c = 0; local_88 = 0; (**(code **)(**(int **)(*(int *)((int)local_34 + 0x125c) + i * 4) + 0x24))(&local_ac,uVar3); } i = i + 1; } while (i < *(uint *)((int)local_34 + 0x1264)); } if (*spawnSpec == 0) { ExceptionList = local_10; return; } pEVar4 = (EntityPtr *)0x0; rng = (uint *)((int)(local_30->_collectibleRNGs)._begin + 0x1fe0); local_38 = (EntityPtr *)0x0; local_2c = (void *)0x0; spawnedBegin = (void *)0x0; local_80 = (EntityPtr *)0x0; local_34 = (EntityPtr *)0x0; local_7c = (EntityPtr *)0x0; entriesBegin = (float *)0x0; entriesEnd = (float *)0x0; entriesCapacityEnd = (float *)0x0; local_8 = 1; playerPos = &local_30->_pos; local_68._position.x = playerPos->x; local_68._position.y = (local_30->_pos).y; local_68._velocity.x = (float)*spawnSpec; local_68._velocity.y = (float)spawnSpec[1]; local_68._flags = spawnSpec[2]; local_68._entity = (void *)spawnSpec[3]; std::vector<24byte>::_Emplace_reallocate(0,&local_68._position); switch(*spawnSpec) { case 0x13: local_78 = (float)*spawnSpec; fStack_74 = (float)spawnSpec[1]; VStack_70.x = (float)spawnSpec[2]; VStack_70.y = (float)spawnSpec[3]; uVar3 = Random(); local_14 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_14 = local_14 + local_14; local_18 = cos(local_14); local_18 = local_18 * 40.0; local_14 = sin(local_14); local_14 = local_14 * 40.0; local_68._position.x = local_18 + playerPos->x; local_68._position.y = local_14 + playerPos->y; local_68._velocity.x = local_78; local_68._velocity.y = fStack_74; local_68._flags = (int)VStack_70.x; local_68._entity = (void *)VStack_70.y; if (entriesEnd == entriesCapacityEnd) { std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position); } else { *entriesEnd = local_68._position.x; entriesEnd[1] = local_68._position.y; entriesEnd[2] = local_78; entriesEnd[3] = fStack_74; *(ulonglong *)(entriesEnd + 4) = CONCAT44(VStack_70.y,VStack_70.x); entriesEnd = entriesEnd + 6; } playerPosY = playerPos->y; *entriesBegin = playerPos->x - local_18; entriesBegin[1] = playerPosY - local_14; break; default: switchD_005cac1b_caseD_14: break; case 0x45: if (spawnSpec[1] != 1) goto switchD_005cac1b_caseD_14; local_78 = (float)*spawnSpec; fStack_74 = (float)spawnSpec[1]; VStack_70.x = (float)spawnSpec[2]; VStack_70.y = (float)spawnSpec[3]; uVar3 = Random(); local_14 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_14 = local_14 + local_14; local_18 = cos(local_14); local_18 = local_18 * 40.0; local_14 = sin(local_14); local_14 = local_14 * 40.0; local_68._position.x = local_18 + playerPos->x; local_68._position.y = local_14 + playerPos->y; local_68._velocity.x = local_78; local_68._velocity.y = fStack_74; local_68._flags = (int)VStack_70.x; local_68._entity = (void *)VStack_70.y; if (entriesEnd == entriesCapacityEnd) { std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position); } else { *entriesEnd = local_68._position.x; entriesEnd[1] = local_68._position.y; entriesEnd[2] = local_78; entriesEnd[3] = fStack_74; *(ulonglong *)(entriesEnd + 4) = CONCAT44(VStack_70.y,VStack_70.x); entriesEnd = entriesEnd + 6; } playerPosY = playerPos->y; *entriesBegin = playerPos->x - local_18; entriesBegin[1] = playerPosY - local_14; break; case 0x52: local_78 = (float)*spawnSpec; fStack_74 = (float)spawnSpec[1]; VStack_70.x = (float)spawnSpec[2]; VStack_70.y = (float)spawnSpec[3]; uVar3 = Random(); local_14 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_14 = local_14 + local_14; local_18 = cos(local_14); local_18 = local_18 * 40.0; local_14 = sin(local_14); local_14 = local_14 * 40.0; local_68._position.x = local_18 + playerPos->x; local_78 = 1.16308e-43; VStack_70.x = 50.0; local_68._position.y = local_14 + playerPos->y; local_68._velocity.x = 1.16308e-43; local_68._velocity.y = fStack_74; local_68._flags = 0x42480000; local_68._entity = (void *)VStack_70.y; if (entriesEnd == entriesCapacityEnd) { std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position); } else { *entriesEnd = local_68._position.x; entriesEnd[1] = local_68._position.y; entriesEnd[2] = 1.16308e-43; entriesEnd[3] = fStack_74; *(ulonglong *)(entriesEnd + 4) = CONCAT44(VStack_70.y,0x42480000); entriesEnd = entriesEnd + 6; } playerPosY = playerPos->y; *entriesBegin = playerPos->x - local_18; entriesBegin[1] = playerPosY - local_14; break; case 0xed: local_78 = (float)*spawnSpec; fStack_74 = (float)spawnSpec[1]; VStack_70.x = (float)spawnSpec[2]; VStack_70.y = (float)spawnSpec[3]; uVar3 = Random(); local_14 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_14 = local_14 + local_14; local_18 = cos(local_14); local_18 = local_18 * 40.0; local_14 = sin(local_14); local_14 = local_14 * 40.0; local_68._position.x = local_18 + playerPos->x; local_68._position.y = local_14 + playerPos->y; local_68._velocity.x = local_78; local_68._velocity.y = fStack_74; local_68._flags = (int)VStack_70.x; local_68._entity = (void *)VStack_70.y; if (entriesEnd == entriesCapacityEnd) { std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position); } else { *entriesEnd = local_68._position.x; entriesEnd[1] = local_68._position.y; entriesEnd[2] = local_78; entriesEnd[3] = fStack_74; *(ulonglong *)(entriesEnd + 4) = CONCAT44(VStack_70.y,VStack_70.x); entriesEnd = entriesEnd + 6; } playerPosY = playerPos->y; *entriesBegin = playerPos->x - local_18; entriesBegin[1] = playerPosY - local_14; } local_18 = 0.0; iVar1 = (int)entriesEnd - (int)entriesBegin >> 0x1f; if (((int)entriesEnd - (int)entriesBegin) / 0x18 + iVar1 == iVar1) { spawnedBuffer = (void *)0x0; } else { local_2c = (void *)0x0; do { local_14 = 0.0; if (0 < spawnSpec[3]) { do { rngState = rng; DAT_00c71670 = 1; uVar3 = *rng; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *rngState; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar3 = uVar3 >> ((byte)rngState[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)rngState[2] & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)rngState[3] & 0x1f) ^ uVar3; *rngState = uVar3; pos = (Vector *)((int)local_2c + (int)entriesBegin); position = Room::FindFreePickupSpawnPosition(game->_room,&VStack_70,pos,40.0,0,0,0); tmpEntity = (EntityPtr) Game::Spawn(g_game,(uint)pos[1].x,(uint)pos[1].y,position,&g_vectorZero, (Entity *)local_30,0,uVar3); *(uint *)((int)tmpEntity + 0x16c) = *(uint *)((int)tmpEntity + 0x16c) | 0x10000020; *(undefined4 *)((int)tmpEntity + 0x168) = *(undefined4 *)((int)tmpEntity + 0x168); spawned = tmpEntity; EntityRef::constructor(&local_68,(Entity *)local_30); Entity::AddCharmed((Entity *)tmpEntity,&local_68,-1,0,0); Entity::SetVisibleFlag((Entity *)tmpEntity,0); *(float *)((int)tmpEntity + 0x380) = pos[2].x; *(float *)((int)tmpEntity + 900) = pos[2].x; ANM2::LoadDeliriumForm ((ANM2 *)((int)tmpEntity + 0x48),*(int *)((int)tmpEntity + 0x28), *(int *)((int)tmpEntity + 0x2c),1); if (local_38 == local_34) { std::vector::_Emplace_reallocate(local_38,&spawned); local_34 = local_7c; } else { *local_38 = tmpEntity; local_80 = local_38 + 1; } local_14 = (float)((int)local_14 + 1); local_38 = local_80; } while ((int)local_14 < spawnSpec[3]); pEVar4 = local_80; } local_2c = (void *)((int)local_2c + 0x18); local_18 = (float)((int)local_18 + 1); } while ((uint)local_18 < (uint)(((int)entriesEnd - (int)entriesBegin) / 0x18)); local_2c = spawnedBegin; spawnedBuffer = spawnedBegin; } pEVar4 = (EntityPtr *)((int)pEVar4 - (int)spawnedBuffer >> 2); local_14 = 0.0; local_38 = pEVar4; if (pEVar4 != (EntityPtr *)0x0) { do { tmpEntity = *(EntityPtr *)((int)spawnedBuffer + (int)local_14 * 4); spawned = tmpEntity; (**(code **)(*(int *)tmpEntity + 0xc))(); *(uint *)((int)tmpEntity + 0x168) = *(uint *)((int)tmpEntity + 0x168) | 0x80000000; *(undefined4 *)((int)tmpEntity + 0x16c) = *(undefined4 *)((int)tmpEntity + 0x16c); EntityList::AddPersistentEntity ((EntityList *)((int)g_game->_room + 0x1218),(Entity *)tmpEntity); for (chainEntity = *(EntityPtr *)((int)tmpEntity + 0x3bc); chainEntity != (EntityPtr)0x0; chainEntity = *(EntityPtr *)((int)chainEntity + 0x3bc)) { tmpEntity = chainEntity; } chainEntity = (EntityPtr) __RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); tmpEntity = spawned; spawnSpec = (int *)0x0; if (chainEntity != (EntityPtr)0x0) { do { if (chainEntity == tmpEntity) { nextChainNpc = (EntityPtr) __RTDynamicCast(*(undefined4 *)((int)chainEntity + 0x3c0),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0) ; if (nextChainNpc == (EntityPtr)spawnSpec) break; } else { ANM2::LoadDeliriumForm ((ANM2 *)((int)chainEntity + 0x48),*(int *)((int)chainEntity + 0x28), *(int *)((int)chainEntity + 0x2c),1); nextChainNpc = (EntityPtr) __RTDynamicCast(*(undefined4 *)((int)chainEntity + 0x3c0),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0) ; spawnSpec = (int *)chainEntity; } chainEntity = nextChainNpc; } while (nextChainNpc != (EntityPtr)0x0); pEVar4 = local_38; } local_14 = (float)((int)local_14 + 1); spawnedBuffer = local_2c; } while ((uint)local_14 < pEVar4); } if (g_game->_hallucinationTimer < 1) { Game::ShowHallucination(g_game,0x19,0x3f); } this_00 = local_30; isBookOfVirtues = HasCollectible(local_30,0x248,0); rngState = rng; if ((isBookOfVirtues != 0) && (isAddWisp != 0)) { uVar3 = *rng; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *rngState; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar3 = uVar3 >> ((byte)rngState[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)rngState[2] & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)rngState[3] & 0x1f) ^ uVar3; *rngState = uVar3; AddWisp(this_00,*(int *)(&DAT_00b62c80 + (uVar3 & 3) * 4),playerPos,0,0); } if (entriesBegin != (float *)0x0) { uVar3 = (((int)entriesCapacityEnd - (int)entriesBegin) / 0x18) * 0x18; ptr = entriesBegin; if (0xfff < uVar3) { ptr = (float *)entriesBegin[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)entriesBegin + (-4 - (int)ptr))) goto LAB_005cb36d; } operator_delete(ptr,uVar3); } if (local_2c != (void *)0x0) { uVar3 = (int)local_34 - (int)local_2c & 0xfffffffc; spawnedBuffer = local_2c; if (0xfff < uVar3) { spawnedBuffer = *(void **)((int)local_2c + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_2c + (-4 - (int)spawnedBuffer))) { LAB_005cb36d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(spawnedBuffer,uVar3); } ExceptionList = local_10; return; } //@@ 005cb480 Entity_Player::update_mini_mush_costume /* DB: counts TemporaryEffects of 0x47 (Mini Mush) + 0x246 (Wavy Cap), removes item-anim entries for ItemConfig list (+0x18, g_Manager+0x2a41c) entries 71/72/73 and adds the one for count 1-3/4-6/7+, then syncs other players; UseActiveItem, trigger_collectible_effect_removed prototype: db/protos.zhl */ void __thiscall Entity_Player::update_mini_mush_costume(Entity_Player *this) { bool bVar1; char cVar2; uint uVar3; void *costumesEnd; int *piVar4; int otherStackCount; NetplayManager peer; int *effect; qword *allocCounter; uint uVar5; uint peerCount; int iVar6; void *pvVar7; PlayerManager *playerManager; int costumeLevel3; int costumeLevel2; int costumeLevel1; int stackCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword allocatedBytes; void **costumesEndSlot; int *effectsEnd; Game *game; bool isCostumeRemoved; local_8 = 0xffffffff; puStack_c = &LAB_00af5ef0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((this->_temporaryeffects)._disabled == 0) { for (piVar4 = (this->_temporaryeffects)._effects._begin; piVar4 != (this->_temporaryeffects)._effects._end; piVar4 = piVar4 + 4) { if ((*(int *)*piVar4 == 0) && (((int *)*piVar4)[1] == 0x47)) { iVar6 = piVar4[1]; goto LAB_005cb4e6; } } iVar6 = 0; LAB_005cb4e6: pvVar7 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x246); if (pvVar7 == (void *)0x0) { stackCount = 0; } else { stackCount = *(int *)((int)pvVar7 + 4); } } else { stackCount = 0; iVar6 = 0; } stackCount = stackCount + iVar6; pvVar7 = (g_manager->_itemConfig)._nullItems._begin; iVar6 = (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 >> 2; if (iVar6 < 0x48) { costumeLevel1 = 0; costumeLevel2 = 0; costumeLevel3 = 0; } else { costumeLevel1 = *(int *)((int)pvVar7 + 0x11c); if (iVar6 < 0x49) { costumeLevel2 = 0; costumeLevel3 = 0; } else { costumeLevel2 = *(int *)((int)pvVar7 + 0x120); if (iVar6 < 0x4a) { costumeLevel3 = 0; } else { costumeLevel3 = *(int *)((int)pvVar7 + 0x124); } } } pvVar7 = (this->_costumeSpriteDescs)._begin; isCostumeRemoved = false; costumesEnd = (this->_costumeSpriteDescs)._end; bVar1 = false; if (pvVar7 != costumesEnd) { do { isCostumeRemoved = bVar1; iVar6 = *(int *)((int)pvVar7 + 0x114); if (((iVar6 == costumeLevel1) || (iVar6 == costumeLevel2)) || (iVar6 == costumeLevel3)) { std::_Move_unchecked(pvVar7,uVar3); costumesEnd = (this->_costumeSpriteDescs)._end; local_8 = 0; ANM2::Reset((ANM2 *)((int)costumesEnd + -0x130)); iVar6 = *(int *)((int)costumesEnd + -0xd8); if (iVar6 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar6 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar5; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar5); free((void *)(iVar6 + -4)); *(undefined4 *)((int)costumesEnd + -0xd8) = 0; } iVar6 = *(int *)((int)costumesEnd + -0xd4); if (iVar6 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar6 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar5; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar5); free((void *)(iVar6 + -4)); *(undefined4 *)((int)costumesEnd + -0xd4) = 0; } iVar6 = *(int *)((int)costumesEnd + -0xf8); if (iVar6 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar6 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar5; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar5); free((void *)(iVar6 + -4)); *(undefined4 *)((int)costumesEnd + -0xf8) = 0; } iVar6 = *(int *)((int)costumesEnd + -0xf4); if (iVar6 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar6 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar5; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar5); free((void *)(iVar6 + -4)); *(undefined4 *)((int)costumesEnd + -0xf4) = 0; } std::string::_Tidy_deallocate((char *)((int)costumesEnd + -0x118)); std::string::_Tidy_deallocate((char *)((int)costumesEnd + -0x130)); isCostumeRemoved = true; local_8 = 0xffffffff; costumesEndSlot = &(this->_costumeSpriteDescs)._end; *costumesEndSlot = (void *)((int)*costumesEndSlot + -0x130); costumesEnd = (this->_costumeSpriteDescs)._end; } else { pvVar7 = (void *)((int)pvVar7 + 0x130); } bVar1 = isCostumeRemoved; } while (pvVar7 != costumesEnd); } if (stackCount < 7) { if (stackCount < 4) { if (stackCount < 1) { if (isCostumeRemoved) { UpdateCostumes(this); } } else { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 & 0xfffffffcU) < 0x11d ) { AddCostume(this,(ItemConfig_Item *)0x0,0); } else { AddCostume(this,*(ItemConfig_Item **)((int)pvVar7 + 0x11c),0); } } } else { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 & 0xfffffffcU) < 0x121) { AddCostume(this,(ItemConfig_Item *)0x0,0); } else { AddCostume(this,*(ItemConfig_Item **)((int)pvVar7 + 0x120),0); } } } else { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 & 0xfffffffcU) < 0x125) { AddCostume(this,(ItemConfig_Item *)0x0,0); } else { AddCostume(this,*(ItemConfig_Item **)((int)pvVar7 + 0x124),0); } } peer = g_manager->_netplayManager; if (peer != *(NetplayManager *)(g_manager + 1)) { uVar5 = (int)*(NetplayManager *)(g_manager + 1) - (int)peer >> 2; uVar3 = 0; if (uVar5 != 0) { do { if (*(int *)(*(int *)peer + 0xc) == this->_controllerIndex) { cVar2 = (**(code **)(*(int *)(*(int *)peer + 0x370) + 0x14))(); if (cVar2 == '\0') { ExceptionList = local_10; return; } break; } uVar3 = uVar3 + 1; peer = (NetplayManager)((int)peer + 4); } while (uVar3 < uVar5); } } uVar3 = 1; playerManager = &g_game->_playerManager; if (1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)) { do { pvVar7 = (playerManager->_playerList)._end; piVar4 = (playerManager->_playerList)._begin; if ((int)pvVar7 - (int)piVar4 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (playerManager->_playerList)._end; piVar4 = (playerManager->_playerList)._begin; } if (uVar3 < (uint)((int)pvVar7 - (int)piVar4 >> 2)) { piVar4 = piVar4 + uVar3; } peer = g_manager->_netplayManager; if (peer != *(NetplayManager *)(g_manager + 1)) { peerCount = (int)*(NetplayManager *)(g_manager + 1) - (int)peer >> 2; uVar5 = 0; if (peerCount != 0) { do { if (*(int *)(*(int *)peer + 0xc) == *(int *)(*piVar4 + 0x1618)) { cVar2 = (**(code **)(*(int *)(*(int *)peer + 0x370) + 0x14))(); if (cVar2 == '\0') goto LAB_005cb950; break; } uVar5 = uVar5 + 1; peer = (NetplayManager)((int)peer + 4); } while (uVar5 < peerCount); } } if ((this->_temporaryeffects)._disabled == 0) { piVar4 = (this->_temporaryeffects)._effects._begin; effectsEnd = (this->_temporaryeffects)._effects._end; effect = piVar4; if (piVar4 == effectsEnd) goto LAB_005cb939; do { iVar6 = *(int *)*effect; if ((((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) && (((int *)*effect)[1] == 0x246)) { iVar6 = effect[1]; goto LAB_005cb910; } effect = effect + 4; } while (effect != effectsEnd); iVar6 = 0; LAB_005cb910: do { if ((*(int *)*piVar4 == 0) && (((int *)*piVar4)[1] == 0x47)) { otherStackCount = piVar4[1] + iVar6; if (piVar4[1] + iVar6 < stackCount) { otherStackCount = stackCount; } stackCount = otherStackCount; goto LAB_005cb950; } piVar4 = piVar4 + 4; } while (piVar4 != effectsEnd); } else { LAB_005cb939: iVar6 = 0; } if (iVar6 < stackCount) { iVar6 = stackCount; } stackCount = iVar6; LAB_005cb950: uVar3 = uVar3 + 1; playerManager = &g_game->_playerManager; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } game = g_game; g_game->_dizzyTargetIntensity = (float)stackCount / 10.0; game->_dizzyIntensityChangeSpeed = 0.001; ExceptionList = local_10; return; } //@@ 005cb9b0 FID_conflict:_Tidy /* Library Function - Multiple Matches With Different Base Names public: __thiscall std::vector >::~vector >(void) private: void __thiscall std::vector >::_Tidy(void) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Tidy(void *this) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x18) * 0x18; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } return; } //@@ 005cba20 FUN_005cba20 void FUN_005cba20(void) { int *in_ECX; *in_ECX = *in_ECX + 0x1c; return; } //@@ 005cba30 FUN_005cba30 int FUN_005cba30(void) { int *in_ECX; return *in_ECX + 0x10; } //@@ 005cba40 FUN_005cba40 void FUN_005cba40(void) { void *pvVar1; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *in_ECX = pvVar1; return; } //@@ 005cba80 FUN_005cba80 void FUN_005cba80(int *param_1,uint *param_2) { int *in_ECX; undefined1 local_10 [8]; int local_8; _Find_lower_bound<>(local_10,param_2); if ((*(char *)(local_8 + 0xd) == '\0') && (*(uint *)(local_8 + 0x10) <= *param_2)) { *param_1 = local_8; return; } *param_1 = *in_ECX; return; } //@@ 005cbad0 FUN_005cbad0 void FUN_005cbad0(void) { int *in_ECX; *in_ECX = *in_ECX + 4; return; } //@@ 005cbae0 FUN_005cbae0 int FUN_005cbae0(void) { int in_ECX; return *(int *)(*(int *)(in_ECX + 4) + (*(uint *)(in_ECX + 0xc) >> 2 & *(int *)(in_ECX + 8) - 1U) * 4) + (*(uint *)(in_ECX + 0xc) & 3) * 4; } //@@ 005cbb00 FUN_005cbb00 void FUN_005cbb00(void) { undefined4 *puVar1; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; puVar1 = operator_new(8); puVar1[1] = 0; *in_ECX = puVar1; *puVar1 = in_ECX; return; } //@@ 005cbb40 FUN_005cbb40 void FUN_005cbb40(void) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; if ((uint)(in_ECX[2] - *in_ECX >> 2) < 10) { iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(0x28); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,10); return; } return; } //@@ 005cbb60 FUN_005cbb60 void FUN_005cbb60(void) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; if ((uint)(in_ECX[2] - *in_ECX >> 2) < 0x29) { iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(0xa4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,0x29); return; } return; } //@@ 005cbb80 FUN_005cbb80 void FUN_005cbb80(int *param_1) { int iVar1; int *in_ECX; iVar1 = *in_ECX; *param_1 = iVar1; *in_ECX = iVar1 + 4; return; } //@@ 005cbba0 emplace_back<> /* Library Function - Multiple Matches With Same Base Name public: struct CHN * & __thiscall std::vector >::emplace_back(struct CHN * &) public: unsigned int & __thiscall std::vector >::emplace_back(unsigned int const &) public: unsigned int & __thiscall std::vector >::emplace_back(unsigned int const &) Library: Visual Studio 2019 Release */ void emplace_back<>(undefined4 *param_1) { undefined4 *puVar1; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector::_Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 4; return; } //@@ 005cbbd0 FUN_005cbbd0 undefined4 * FUN_005cbbd0(int *param_1) { int *piVar1; undefined4 uVar2; int iVar3; undefined4 *puVar4; undefined4 *in_ECX; int iVar5; undefined4 *local_28; void *local_24; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af5f2d; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = 0; *in_ECX = 0; in_ECX[1] = 0; param_1 = (int *)*param_1; piVar1 = (int *)*param_1; local_8 = 0; if (piVar1 == param_1) { local_14 = local_24; } else { local_8 = 1; local_14 = operator_new(0x10); uVar2 = piVar1[3]; iVar5 = 1; *(int *)((int)local_14 + 8) = piVar1[2]; *(undefined4 *)((int)local_14 + 0xc) = uVar2; local_28 = local_14; for (piVar1 = (int *)*piVar1; piVar1 != param_1; piVar1 = (int *)*piVar1) { puVar4 = operator_new(0x10); iVar5 = iVar5 + 1; iVar3 = piVar1[3]; puVar4[2] = piVar1[2]; puVar4[3] = iVar3; *local_28 = puVar4; puVar4[1] = local_28; local_28 = puVar4; } } local_8 = CONCAT31(local_8._1_3_,2); puVar4 = operator_new(0x10); if (iVar5 == 0) { *puVar4 = puVar4; puVar4[1] = puVar4; } else { *puVar4 = local_14; puVar4[1] = local_28; *(undefined4 **)((int)local_14 + 4) = puVar4; *local_28 = puVar4; } *in_ECX = puVar4; in_ECX[1] = iVar5; ExceptionList = local_10; return in_ECX; } //@@ 005cbd00 FUN_005cbd00 int FUN_005cbd00(int param_1) { int *in_ECX; return param_1 * 0x10 + *in_ECX; } //@@ 005cbd10 FUN_005cbd10 int FUN_005cbd10(int param_1) { int *in_ECX; return param_1 * 0x130 + *in_ECX; } //@@ 005cbd20 std::vector::erase /* DB: 0x130-byte ANM2 elements, costume add/remove */ void std::vector::erase(undefined4 *param_1,undefined4 param_2) { int iVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; _Move_unchecked(param_2,__security_cookie ^ (int)register0x00000010 - 4U); iVar1 = *(int *)(in_ECX + 4); local_8 = 0; ANM2::Reset((ANM2 *)(iVar1 + -0x130)); AnimationState::~AnimationState((AnimationState *)(iVar1 + -0xe0)); AnimationState::~AnimationState((AnimationState *)(iVar1 + -0x100)); string::_Tidy_deallocate((char *)(iVar1 + -0x118)); string::_Tidy_deallocate((char *)(iVar1 + -0x130)); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -0x130; *param_1 = param_2; ExceptionList = local_10; return; } //@@ 005cbdd0 FUN_005cbdd0 void FUN_005cbdd0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<8byte>::_Emplace_reallocate(puVar1,param_1); return; } uVar2 = param_1[1]; *puVar1 = *param_1; puVar1[1] = uVar2; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 8; return; } //@@ 005cbe00 FUN_005cbe00 int FUN_005cbe00(int param_1) { int *in_ECX; return *in_ECX + param_1 * 0x1c; } //@@ 005cbe20 FUN_005cbe20 void FUN_005cbe20(void) { void *pvVar1; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *in_ECX = pvVar1; return; } //@@ 005cbe60 FUN_005cbe60 int FUN_005cbe60(int param_1) { int *in_ECX; return *in_ECX + param_1 * 0x78; } //@@ 005cbe80 FUN_005cbe80 int FUN_005cbe80(void) { int *in_ECX; return (in_ECX[1] - *in_ECX) / 0x78; } //@@ 005cbea0 std::vector_>::erase /* Library Function - Single Match public: class std::_Vector_iterator > > __thiscall std::vector >::erase(class std::_Vector_const_iterator > >) Library: Visual Studio 2019 Release */ void __thiscall std::vector_>::erase (vector_> *this,undefined4 *param_2,void *param_3) { memmove(param_3,(void *)((int)param_3 + 4),*(int *)(this + 4) - ((int)param_3 + 4)); *(int *)(this + 4) = *(int *)(this + 4) + -4; *param_2 = param_3; return; } //@@ 005cbed0 FUN_005cbed0 void FUN_005cbed0(void) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(0x28); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,10); return; } //@@ 005cbf10 FUN_005cbf10 void FUN_005cbf10(void) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(0xa4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,0x29); return; } //@@ 005cbf50 FUN_005cbf50 void FUN_005cbf50(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x10; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 005cbf90 FUN_005cbf90 void FUN_005cbf90(void) { undefined4 uVar1; undefined4 *in_ECX; undefined4 *in_EDX; uVar1 = *in_ECX; *in_ECX = *in_EDX; *in_EDX = uVar1; return; } //@@ 005cbfa0 FUN_005cbfa0 void FUN_005cbfa0(undefined4 *param_1) { undefined4 *in_ECX; undefined4 *in_EDX; *in_ECX = *in_EDX; in_ECX[1] = *param_1; return; } //@@ 005cbfc0 FUN_005cbfc0 void * FUN_005cbfc0(void *param_1,int *param_2) { void *in_ECX; std_map_int_insert(in_ECX,param_1,param_2); return param_1; } //@@ 005cbfe0 FUN_005cbfe0 void FUN_005cbfe0(uint *param_1) { undefined4 uVar1; code *pcVar2; int in_ECX; int in_EDX; uint uVar3; uint uVar4; int iVar5; uVar4 = in_EDX - in_ECX >> 2; iVar5 = uVar4 - 1; if (0 < iVar5) { do { uVar3 = *param_1; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *param_1; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar3 = uVar3 >> ((byte)param_1[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)param_1[2] & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)param_1[3] & 0x1f) ^ uVar3; *param_1 = uVar3; if (uVar4 == 0) { uVar3 = 0; } else { uVar3 = uVar3 % uVar4; } uVar4 = uVar4 - 1; uVar1 = *(undefined4 *)(in_ECX + iVar5 * 4); *(undefined4 *)(in_ECX + iVar5 * 4) = *(undefined4 *)(in_ECX + uVar3 * 4); iVar5 = iVar5 + -1; *(undefined4 *)(in_ECX + uVar3 * 4) = uVar1; } while (0 < iVar5); } return; } //@@ 005cc070 RNG::Shuffle /* DB: Fisher-Yates over int range with xorshift RNG in ECX prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl RNG::Shuffle(RNG *rng,int *begin,int *end) { int iVar1; code *pcVar2; uint uVar3; int iVar4; uint local_8; local_8 = (int)end - (int)begin >> 2; iVar4 = local_8 - 1; if (0 < iVar4) { do { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar3 = uVar3 >> ((byte)rng->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)rng->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)rng->_shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; if (local_8 == 0) { uVar3 = 0; } else { uVar3 = uVar3 % local_8; } iVar1 = begin[iVar4]; local_8 = local_8 - 1; begin[iVar4] = begin[uVar3]; iVar4 = iVar4 + -1; begin[uVar3] = iVar1; } while (0 < iVar4); } return; } //@@ 005cc100 FUN_005cc100 undefined4 FUN_005cc100(undefined4 param_1,undefined4 param_2) { FUN_005cc7e0(param_1,param_2); return param_1; } //@@ 005cc120 FUN_005cc120 undefined4 FUN_005cc120(undefined4 param_1,undefined4 param_2) { FUN_005cc810(param_1,param_2); return param_1; } //@@ 005cc140 std::vector<24byte>::_Emplace_reallocate /* DB: growth/max 0xaaaaaaa by /0x18, 24-byte POD element; caller Entity_Player::console_spawn */ undefined4 * std::vector<24byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; void *pvVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 *puVar9; undefined4 *puVar10; undefined4 *puVar11; int *in_ECX; uint uVar12; uint uVar13; void *ptr; iVar2 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0x18; if (iVar5 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar13 = (in_ECX[2] - *in_ECX) / 0x18; if (0xaaaaaaa - (uVar13 >> 1) < uVar13) { uVar12 = 0xaaaaaaa; } else { uVar13 = (uVar13 >> 1) + uVar13; uVar12 = iVar5 + 1U; if (iVar5 + 1U <= uVar13) { uVar12 = uVar13; } if (0xaaaaaaa < uVar12) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar10 = _Allocate(uVar12 * 0x18); puVar1 = puVar10 + (((int)param_1 - iVar2) / 0x18) * 6; uVar6 = param_2[1]; uVar7 = param_2[2]; uVar8 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar6; puVar1[2] = uVar7; puVar1[3] = uVar8; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_2 + 4); puVar3 = (undefined4 *)in_ECX[1]; puVar11 = (undefined4 *)*in_ECX; puVar9 = puVar10; if (param_1 == puVar3) { for (; puVar11 != puVar3; puVar11 = puVar11 + 6) { uVar6 = puVar11[1]; uVar7 = puVar11[2]; uVar8 = puVar11[3]; *puVar9 = *puVar11; puVar9[1] = uVar6; puVar9[2] = uVar7; puVar9[3] = uVar8; *(undefined8 *)(puVar9 + 4) = *(undefined8 *)(puVar11 + 4); puVar9 = puVar9 + 6; } } else { FUN_005cc6e0(puVar11,param_1,puVar10); FUN_005cc6e0(param_1,in_ECX[1],puVar1 + 6); } pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { uVar13 = ((in_ECX[2] - (int)pvVar4) / 0x18) * 0x18; ptr = pvVar4; if (0xfff < uVar13) { ptr = *(void **)((int)pvVar4 + -4); uVar13 = uVar13 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar13); } *in_ECX = (int)puVar10; in_ECX[1] = (int)(puVar10 + (iVar5 * 3 + 3) * 2); in_ECX[2] = (int)(puVar10 + uVar12 * 6); return puVar1; } //@@ 005cc2d0 std::_Move_unchecked /* DB: ECX..EDX range of 0x118-byte CostumeSprite moved down to param via ANM2 copy + Isaac::SwapANM2 + Reset; std::vector::erase, Entity_Player::update_mini_mush_costume */ ANM2 * std::_Move_unchecked(ANM2 *param_1) { undefined4 *puVar1; uint uVar2; qword qVar3; undefined4 *in_ECX; undefined4 *in_EDX; ANM2 *this; qword *pqVar4; undefined4 *puVar5; ANM2 local_12c; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af5f50; local_10 = ExceptionList; if (in_ECX == in_EDX) { return param_1; } puVar5 = in_ECX + 0x46; ExceptionList = &local_10; local_14 = in_EDX; do { local_8 = 0xffffffff; ANM2::ANM2(&local_12c,(ANM2 *)(puVar5 + -0x46)); Isaac::SwapANM2(param_1,&local_12c); local_8 = 0; ANM2::Reset(this); if (local_12c._overlayAnimState._layerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)local_12c._overlayAnimState._layerFrames + -4); qVar3 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)((int)local_12c._overlayAnimState._layerFrames + -4)); local_12c._overlayAnimState._layerFrames = (void *)0x0; } if (local_12c._overlayAnimState._nullLayerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)local_12c._overlayAnimState._nullLayerFrames + -4); qVar3 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)((int)local_12c._overlayAnimState._nullLayerFrames + -4)); local_12c._overlayAnimState._nullLayerFrames = (void *)0x0; } if (local_12c._animState._layerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)local_12c._animState._layerFrames + -4); qVar3 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)((int)local_12c._animState._layerFrames + -4)); local_12c._animState._layerFrames = (void *)0x0; } if (local_12c._animState._nullLayerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)local_12c._animState._nullLayerFrames + -4); qVar3 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)((int)local_12c._animState._nullLayerFrames + -4)); local_12c._animState._nullLayerFrames = (void *)0x0; } string::_Tidy_deallocate(local_12c._animDefaultName._buf); string::_Tidy_deallocate((char *)&local_12c); *(undefined4 *)param_1[1]._filename._buf = puVar5[-1]; *(undefined4 *)(param_1[1]._filename._buf + 4) = *puVar5; param_1[1]._filename._buf[8] = *(char *)(puVar5 + 1); param_1[1]._filename._buf[9] = *(char *)((int)puVar5 + 5); param_1[1]._filename._buf[10] = *(char *)((int)puVar5 + 6); param_1[1]._filename._buf[0xb] = *(char *)((int)puVar5 + 7); *(undefined4 *)(param_1[1]._filename._buf + 0xc) = puVar5[2]; param_1[1]._filename._size = puVar5[3]; *(undefined1 *)¶m_1[1]._filename._capacity = *(undefined1 *)(puVar5 + 4); *(undefined1 *)((int)¶m_1[1]._filename._capacity + 1) = *(undefined1 *)((int)puVar5 + 0x11); *(undefined4 *)param_1[1]._animDefaultName._buf = puVar5[5]; param_1 = (ANM2 *)(param_1[1]._animDefaultName._buf + 4); puVar1 = puVar5 + 6; puVar5 = puVar5 + 0x4c; } while (puVar1 != local_14); ExceptionList = local_10; return param_1; } //@@ 005cc510 std::vector<8byte>::_Emplace_reallocate /* DB: ECX vector, args (where, const T*) for 8-byte elements: 1.5x growth (max 0x1fffffff), insert, move halves, _Change_array; used by Level::place_special_rooms, Entity_Player::RestoreGameState and the push_back wrapper FUN_005cbdd0 */ uint * std::vector<8byte>::_Emplace_reallocate(uint *param_1,uint *param_2) { uint *puVar1; int iVar2; uint uVar3; uint *puVar4; int iVar5; uint uVar6; uint *puVar7; int *in_ECX; uint uVar8; uint *puVar9; uint *puVar10; uint *puVar11; uint local_c; iVar2 = *in_ECX; iVar5 = in_ECX[1] - iVar2 >> 3; if (iVar5 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar6 = iVar5 + 1; uVar8 = in_ECX[2] - iVar2 >> 3; if (0x1fffffff - (uVar8 >> 1) < uVar8) { local_c = 0x1fffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; local_c = uVar6; if (uVar6 <= uVar8) { local_c = uVar8; } if (0x1fffffff < local_c) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = _Allocate(local_c << 3); puVar1 = puVar7 + ((int)param_1 - iVar2 >> 3) * 2; uVar8 = *param_2; puVar1[1] = param_2[1]; *puVar1 = uVar8; puVar10 = (uint *)in_ECX[1]; puVar9 = (uint *)*in_ECX; puVar4 = puVar7; if (param_1 == puVar10) { for (; puVar9 != puVar10; puVar9 = puVar9 + 2) { uVar8 = puVar9[1]; *puVar4 = *puVar9; puVar4[1] = uVar8; puVar4 = puVar4 + 2; } } else { puVar11 = puVar7; puVar4 = param_1; if (puVar9 != param_1) { do { uVar8 = *puVar9; uVar3 = puVar9[1]; puVar9 = puVar9 + 2; *puVar11 = uVar8; puVar11[1] = uVar3; puVar11 = puVar11 + 2; } while (puVar9 != param_1); puVar10 = (uint *)in_ECX[1]; } for (; puVar4 != puVar10; puVar4 = puVar4 + 2) { uVar8 = puVar4[1]; *(uint *)((int)puVar1 + (8 - (int)param_1) + (int)puVar4) = *puVar4; *(uint *)((int)puVar1 + (0xc - (int)param_1) + (int)puVar4) = uVar8; } } FID_conflict__Change_array(in_ECX,puVar7,uVar6,local_c); return puVar1; } //@@ 005cc630 FUN_005cc630 void FUN_005cc630(void) { ANM2 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset(in_ECX); AnimationState::~AnimationState(&in_ECX->_overlayAnimState); AnimationState::~AnimationState(&in_ECX->_animState); std::string::_Tidy_deallocate((in_ECX->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)in_ECX); ExceptionList = local_10; return; } //@@ 005cc6a0 FUN_005cc6a0 void FUN_005cc6a0(void) { undefined4 *puVar1; undefined4 *ptr; int in_ECX; if (*(int *)(in_ECX + 4) != 0) { *(undefined4 *)(*(int *)(in_ECX + 0xc) + 4) = 0; **(undefined4 **)(in_ECX + 8) = 0; ptr = *(undefined4 **)(in_ECX + 0xc); while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; operator_delete(ptr,0x10); ptr = puVar1; } } return; } //@@ 005cc6e0 FUN_005cc6e0 void FUN_005cc6e0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; for (; param_1 != param_2; param_1 = param_1 + 6) { uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *param_3 = *param_1; param_3[1] = uVar1; param_3[2] = uVar2; param_3[3] = uVar3; *(undefined8 *)(param_3 + 4) = *(undefined8 *)(param_1 + 4); param_3 = param_3 + 6; } return; } //@@ 005cc710 std_map_int_insert /* DB: std::map::insert(pair): find_node on the key, if absent allocates a 0x18-byte node with key/value and links it (FUN_00415bd0); returns (iterator, inserted) in param_1; Room::Update, GameStatePlayer::read_part3 prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall std_map_int_insert(void *this,void *outResult,int *keyValue) { undefined8 uVar1; undefined4 uVar2; uint uVar3; undefined8 *puVar4; undefined4 *newNode; void *pvVar5; undefined1 uVar6; void *local_28; int iStack_24; undefined1 local_1c [4]; void *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5f7d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined8 *)std::set::find_node(local_1c,keyValue); pvVar5 = *(void **)(puVar4 + 1); uVar1 = *puVar4; if ((*(char *)((int)pvVar5 + 0xd) == '\0') && (*(int *)((int)pvVar5 + 0x10) <= *keyValue)) { uVar6 = 0; } else { if (*(int *)((int)this + 4) == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } uVar2 = *(undefined4 *)this; local_8 = 0; local_14 = 0; local_18 = this; newNode = operator_new(0x18); newNode[4] = *keyValue; newNode[5] = keyValue[1]; iStack_24 = (int)((ulonglong)uVar1 >> 0x20); *newNode = uVar2; local_28 = (void *)uVar1; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; pvVar5 = std::_Tree::_Insert_node(this,local_28,iStack_24,newNode); uVar6 = 1; } *(void **)outResult = pvVar5; *(undefined1 *)((int)outResult + 4) = uVar6; ExceptionList = local_10; return outResult; } //@@ 005cc7e0 FUN_005cc7e0 void FUN_005cc7e0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_005cc840(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 005cc810 FUN_005cc810 void FUN_005cc810(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::map::insert(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 005cc840 FUN_005cc840 void FUN_005cc840(int *param_1,int *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5fad; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)std::set::find_node(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(int *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x18); piVar8[4] = *param_2; piVar8[5] = param_2[1]; local_28 = (int *)uVar1; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_005cc98c: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_005cc98c; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 005cca10 std::map::insert /* DB: _Find_lower_bound on the uint key, returns {existing node,false} or a new 0x18-byte node with key+value (8 bytes from param_2) and {node,true}; callers RoomSet::GetVariantSet and 2 others */ void std::map::insert(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5fad; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)_Find_lower_bound<>(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(uint *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x18); piVar8[4] = *param_2; piVar8[5] = param_2[1]; local_28 = (int *)uVar1; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_005ccb5c: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_005ccb5c; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 005ccbe0 Entity::SetCollisionDamage /* ZHL [vtable slot 16] */ void __thiscall Entity::SetCollisionDamage(Entity *this,float param_2) { this->_collisionDamage = param_2; return; } //@@ 005ccc00 Entity::CanShutDoors /* ZHL [vtable slot 18] */ undefined1 __thiscall Entity::CanShutDoors(void) { return 0; } //@@ 005ccc10 Entity::TryThrow /* ZHL [exact] bool TryThrow(const EntityRef& Source, Vector* dir, float force); */ undefined1 Entity::TryThrow(void) { return 0; } //@@ 005ccc20 Entity_Effect::HandleCollision /* ZHL [vtable slot 23] */ undefined1 __thiscall Entity_Effect::HandleCollision(void) { return 1; } //@@ 005ccc30 FUN_005ccc30 void FUN_005ccc30(void) { Entity *in_ECX; Entity::constructor(in_ECX); *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Text::vftable; KColor::SetFromARGB((KColor *)(in_ECX[1]._sprite._color._colorize + 3),0xffffffff); return; } //@@ 005ccc60 Entity_Text::Free /* DB: vtable slot 0 of Entity_Text; slot name from Entity */ void Entity_Text::Free(byte param_1) { Entity *in_ECX; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Text::vftable; Entity::destructor(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x530); } return; } //@@ 005ccca0 Entity_Text::Init /* DB: vtable slot 1 of Entity_Text; slot name from Entity */ void Entity_Text::Init(int param_1,int param_2,int param_3,uint param_4) { int iVar1; Entity *in_ECX; KColor local_18; Entity::Init(in_ECX,param_1,param_2,param_3,param_4); *(undefined4 *)&in_ECX[1].field_0x4 = 0; in_ECX->_renderZOffset = 1000000; KColor::SetFromARGB(&local_18,0xffffffff); in_ECX->_entityGridCollisionClass = 0; in_ECX[1]._sprite._color._colorize[3] = local_18._red; in_ECX[1]._sprite._color._offset[0] = local_18._green; in_ECX[1]._sprite._color._offset[1] = local_18._blue; in_ECX[1]._sprite._color._offset[2] = local_18._alpha; in_ECX[1]._sprite._championColor._tint[0] = (float)local_18._unk; iVar1 = in_ECX->_variant; in_ECX->_entityCollisionClass = 0; in_ECX->_shadowSize = 0.0; if (iVar1 == 0) { in_ECX[1]._damageEvents._begin = (void *)0x5a; return; } if (iVar1 == 1) { in_ECX[1]._sprite._color._colorize[3] = 1.0; in_ECX[1]._sprite._color._offset[0] = 0.39215687; in_ECX[1]._sprite._color._offset[1] = 0.39215687; in_ECX[1]._sprite._color._offset[2] = 1.0; in_ECX[1]._damageEvents._begin = (void *)0x19; in_ECX[1]._sprite._championColor._tint[0] = 0.0; return; } if (iVar1 == 2) { in_ECX[1]._damageEvents._begin = (void *)0x23; return; } in_ECX[1]._damageEvents._begin = (void *)0x3e8; return; } //@@ 005ccd80 Entity_Text::Update /* DB: vtable slot 3 of Entity_Text; slot name from Entity */ void Entity_Text::Update(void) { Game *pGVar1; int iVar2; int *in_ECX; uint uVar3; float fVar4; float fVar5; iVar2 = in_ECX[0xb]; if (iVar2 == 0) { fVar4 = 1.0 - (float)in_ECX[0x104] / (float)in_ECX[0x105]; fVar4 = fVar4 * fVar4; in_ECX[0x149] = (int)fVar4; in_ECX[0xd3] = 0; in_ECX[0xd4] = (int)((1.0 - fVar4) * -50.0); } else if (iVar2 == 1) { iVar2 = in_ECX[0x104]; if (iVar2 == 0) { sprintf_s((byte *)(in_ECX + 0x106),0x100,&DAT_00b62fe0); iVar2 = in_ECX[0x104]; } pGVar1 = g_game; iVar2 = in_ECX[0x105] - iVar2; if (10 < iVar2) { iVar2 = 10; } in_ECX[0x149] = (int)((float)iVar2 / 10.0); fVar4 = sin((float)(pGVar1->_frameCount - in_ECX[0xca]) * 0.2); if ((*(byte *)(in_ECX + 8) & 1) == 0) { fVar4 = fVar4 * 15.0; } else { fVar4 = fVar4 * -15.0; } in_ECX[0xd3] = (int)fVar4; in_ECX[0xd4] = 0; } else if (iVar2 == 2) { uVar3 = in_ECX[0x104]; if (uVar3 == 0) { sprintf_s((byte *)(in_ECX + 0x106),0x100,s__d); uVar3 = in_ECX[0x104]; } iVar2 = 0x3f800000; if ((in_ECX[0x105] + -0xf <= (int)uVar3) && ((uVar3 & 1) != 0)) { iVar2 = 0; } in_ECX[0x146] = 0x3f800000; in_ECX[0x147] = 0x3f800000; in_ECX[0x148] = 0x3f800000; in_ECX[0x149] = iVar2; in_ECX[0x14a] = 0; } fVar4 = (float)in_ECX[0xdb] * (float)in_ECX[0xd8]; in_ECX[0x104] = in_ECX[0x104] + 1; fVar5 = (float)in_ECX[0xdb] * (float)in_ECX[0xd9]; in_ECX[0xdb] = in_ECX[0xda]; in_ECX[0xd8] = (int)fVar4; in_ECX[0xd9] = (int)fVar5; in_ECX[0xcf] = (int)(fVar4 + (float)in_ECX[0xcf]); in_ECX[0xd0] = (int)(fVar5 + (float)in_ECX[0xd0]); if (in_ECX[0x105] < in_ECX[0x104]) { (**(code **)(*in_ECX + 0x28))(); } return; } //@@ 005ccfc0 Entity_Text::Render /* DB: vtable slot 5 of Entity_Text; slot name from Entity */ void Entity_Text::Render(float *param_1) { byte *str; Vector pos; Vector scale; byte bVar1; int in_ECX; uint uVar2; Font *this; float fVar3; double dVar4; FontSettings local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; float local_24; float local_20; int local_1c; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5fe5; local_10 = ExceptionList; ExceptionList = &local_10; if (*(char *)(in_ECX + 0x172) != '\0') { str = (byte *)(in_ECX + 0x418); this = &g_manager->_font6_PFTempestaSevenCondensed; local_1c = Font::get_string_width_n(this,str,-1); local_20 = *(float *)(in_ECX + 0x340) + *(float *)(in_ECX + 0x350); local_24 = (g_screenHeight - 182.0) * 0.5; local_18 = g_displayPixelRatio * g_screenPointScale; local_14 = (((*(float *)(in_ECX + 0x34c) + *(float *)(in_ECX + 0x33c)) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_18 + 0.5; dVar4 = floor((double)local_14); local_14 = (float)dVar4 / local_18; local_24 = ((local_20 - 140.0) * 0.65 + local_24) * local_18 + 0.5; dVar4 = floor((double)local_24); local_24 = (float)dVar4; local_14 = local_14 + *param_1; fVar3 = param_1[1]; *(float *)(in_ECX + 0x1a4) = local_14; *(float *)(in_ECX + 0x1a8) = local_24 / local_18 + fVar3; if (*(int *)(in_ECX + 0x2c) == 2) { bVar1 = Game::IsPaused(g_game); if (bVar1 == 0) { uVar2 = g_manager->_framecount + 1U & 0x80000001; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffe) + 1; } } else { uVar2 = 0; } local_40 = (FontSettings)0x0; local_3c = 0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; fVar3 = ((float)(int)(uVar2 + *(int *)(in_ECX + 0x410) * 2) * 0.5 - 0.0) * 0.25; if (fVar3 <= 0.0) { fVar3 = 0.0; } if (1.0 <= fVar3) { fVar3 = 1.0; } fVar3 = 4.0 - fVar3 * 2.5; local_8 = 0; pos.y = *(float *)(in_ECX + 0x1a8) - fVar3 * 4.0; pos.x = local_14 - (float)local_1c * 0.5 * fVar3; scale.y = fVar3; scale.x = fVar3; Font::DrawString(this,str,pos,scale,(KColor *)(in_ECX + 0x518),&local_40); ExceptionList = local_10; return; } local_40 = (FontSettings)0x0; local_3c = 0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_8 = 1; Font::DrawString(str,in_ECX + 0x518,&local_40); } ExceptionList = local_10; return; } //@@ 005cd2e0 Entity_Text::Interpolate /* DB: vtable slot 4 of Entity_Text; slot name from Entity */ void Entity_Text::Interpolate(void) { int iVar1; Entity *in_ECX; float fVar2; if (in_ECX->_variant == 1) { fVar2 = sin(((float)(g_game->_frameCount - in_ECX->_spawnFrame) + 0.5) * 0.2); iVar1 = in_ECX->_index; (in_ECX->_posOffset).y = 0.0; if ((iVar1 & 1) == 0) { (in_ECX->_posOffset).x = fVar2 * 15.0; Entity::Interpolate(in_ECX); return; } (in_ECX->_posOffset).x = fVar2 * -15.0; } Entity::Interpolate(in_ECX); return; } //@@ 005cd370 FUN_005cd370 void FUN_005cd370(undefined4 param_1) { undefined4 *in_ECX; *in_ECX = param_1; return; } //@@ 005cd380 FUN_005cd380 void FUN_005cd380(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 4) = param_1; return; } //@@ 005cd3a0 FUN_005cd3a0 void FUN_005cd3a0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 8) = param_1; return; } //@@ 005cd3c0 FUN_005cd3c0 void FUN_005cd3c0(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x14) = in_XMM1_Da; return; } //@@ 005cd3d0 FUN_005cd3d0 void FUN_005cd3d0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x20) = param_1; return; } //@@ 005cd3f0 FUN_005cd3f0 void FUN_005cd3f0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x24) = param_1; return; } //@@ 005cd410 FUN_005cd410 void FUN_005cd410(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x28) = param_1; return; } //@@ 005cd430 FUN_005cd430 void FUN_005cd430(uint *param_1) { uint *in_ECX; *in_ECX = *in_ECX & *param_1; in_ECX[1] = in_ECX[1] & param_1[1]; in_ECX[2] = in_ECX[2] & param_1[2]; in_ECX[3] = in_ECX[3] & param_1[3]; return; } //@@ 005cd460 Entity::AddFlagsLow /* DB: ? this+0x110 |= flags, ICF-foldable */ void __thiscall Entity::AddFlagsLow(Entity *this,uint param_2) { float *pfVar1; pfVar1 = (this->_sprite)._color._offset; *pfVar1 = (float)((uint)*pfVar1 | param_2); return; } //@@ 005cd470 FUN_005cd470 int FUN_005cd470(void) { int in_ECX; return *(int *)(in_ECX + 0x150) * 0x13c + 0x154 + in_ECX; } //@@ 005cd490 FUN_005cd490 int FUN_005cd490(int param_1) { int in_ECX; return param_1 * 0x13c + 0x154 + in_ECX; } //@@ 005cd4b0 FUN_005cd4b0 void FUN_005cd4b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { undefined4 *in_ECX; *in_ECX = param_1; in_ECX[1] = param_2; in_ECX[3] = param_4; in_ECX[2] = param_3; in_ECX[4] = param_5; return; } //@@ 005cd4e0 FUN_005cd4e0 int FUN_005cd4e0(void) { int in_ECX; return in_ECX + 0x38; } //@@ 005cd4f0 FUN_005cd4f0 void FUN_005cd4f0(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0xffffffff; in_ECX[4] = 0; in_ECX[5] = 0; *(undefined1 *)(in_ECX + 6) = 0; return; } //@@ 005cd520 FUN_005cd520 void FUN_005cd520(void) { undefined4 *in_ECX; *in_ECX = IsaacRepentancePlus::Entity_Effect::ExtraData::vftable; return; } //@@ 005cd530 std::_Facet_base::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::_Facet_base::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::_Facet_base::_scalar_deleting_destructor_(_Facet_base *this,uint param_1) { *(undefined ***)this = IsaacRepentancePlus::Entity_Effect::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(this,4); } return this; } //@@ 005cd560 Entity_Bomb::Flags /* ZHL [lua] Lua binding EntityBomb:Flags */ void __thiscall Entity_Bomb::Flags(Entity_Bomb *this,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; qword qVar3; uVar1 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); qVar3 = (this->_tearFlags)._h; uVar2 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); *param_2 = (int)(this->_tearFlags)._l; param_2[1] = uVar1; param_2[2] = (int)qVar3; param_2[3] = uVar2; return; } //@@ 005cd580 Entity_Laser::SetOneHit /* ZHL [lua] Lua binding EntityLaser:SetOneHit */ void __thiscall Entity_Laser::SetOneHit(Entity_Laser *this,byte param_2) { this->_oneHit = param_2; return; } //@@ 005cd590 Entity_Laser::SetMultidimensionalTouched /* ZHL [lua] Lua binding EntityLaser:SetMultidimensionalTouched */ void __thiscall Entity_Laser::SetMultidimensionalTouched(Entity_Laser *this,byte param_2) { this->_multidimensionalTouched = param_2; return; } //@@ 005cd5a0 FUN_005cd5a0 void FUN_005cd5a0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x514) = param_1; return; } //@@ 005cd5b0 FUN_005cd5b0 void FUN_005cd5b0(uint param_1) { int in_ECX; sorted_vector_insert_unique((void *)(in_ECX + 0x520),param_1); return; } //@@ 005cd5c0 FUN_005cd5c0 void FUN_005cd5c0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int in_ECX; *(undefined4 *)(in_ECX + 0x410) = param_1; *(undefined4 *)(in_ECX + 0x414) = param_2; *(undefined4 *)(in_ECX + 0x418) = param_3; *(undefined4 *)(in_ECX + 0x41c) = param_4; return; } //@@ 005cd5e0 GridEntity_Door::Direction /* ZHL [lua] Lua binding GridEntityDoor:Direction */ int __thiscall GridEntity_Door::Direction(GridEntity_Door *this) { return this->_direction; } //@@ 005cd5f0 GridEntity_Door::IsRoomType /* ZHL [lua] Lua binding GridEntityDoor:IsRoomType prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall GridEntity_Door::IsRoomType(GridEntity_Door *this,int roomType) { if ((this->_currentRoomType == roomType) || (this->_targetRoomType == roomType)) { return 1; } return 0; } //@@ 005cd620 FUN_005cd620 int FUN_005cd620(void) { int in_ECX; return in_ECX + 0x4f8; } //@@ 005cd630 FUN_005cd630 undefined1 FUN_005cd630(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x20); } //@@ 005cd640 RoomDescriptor::SacrificeDone /* ZHL [lua] Lua binding RoomDescriptor:SacrificeDone */ uint __thiscall RoomDescriptor::SacrificeDone(RoomDescriptor *this) { return CONCAT31((uint3)((uint)this->Flags >> 10),(char)((uint)this->Flags >> 2)) & 0xffffff01; } //@@ 005cd650 Room::IsSacrificeDone /* ZHL [lua] Lua binding Room:IsSacrificeDone */ uint Room::IsSacrificeDone(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); return CONCAT31((uint3)(uVar1 >> 10),(char)(uVar1 >> 2)) & 0xffffff01; } //@@ 005cd660 FUN_005cd660 undefined1 FUN_005cd660(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x1bbc); } //@@ 005cd670 FUN_005cd670 undefined1 FUN_005cd670(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x7768); } //@@ 005cd680 Level::DungeonReturnRoomIndex /* ZHL [lua] Lua binding Level:DungeonReturnRoomIndex */ int __thiscall Level::DungeonReturnRoomIndex(Level *this) { return this->_dungeonReturnRoomIndex; } //@@ 005cd690 TearParams::constructor /* ZHL [exact] __thiscall void TearParams::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall TearParams::constructor(TearParams *this) { this->_tearVariant = 0; this->_bombVariant = 0; (this->_tearColor)._tint[0] = 1.0; (this->_tearColor)._tint[1] = 1.0; (this->_tearColor)._tint[2] = 1.0; (this->_tearColor)._tint[3] = 1.0; (this->_tearColor)._colorize[0] = 0.0; (this->_tearColor)._colorize[1] = 0.0; (this->_tearColor)._colorize[2] = 0.0; (this->_tearColor)._colorize[3] = 0.0; (this->_tearColor)._offset[0] = 0.0; (this->_tearColor)._offset[1] = 0.0; (this->_tearColor)._offset[2] = 0.0; *(undefined4 *)&(this->_flags)._l = 0; *(undefined4 *)((int)&(this->_flags)._l + 4) = 0; *(undefined4 *)&(this->_flags)._h = 0; *(undefined4 *)((int)&(this->_flags)._h + 4) = 0; this->_tearDamage = 3.5; this->_tearScale = 1.0; this->_tearHeight = -23.75; this[1]._tearVariant = 0x3f800000; this[1]._bombVariant = 0x3fd9999a; this[1]._tearColor._tint[0] = 1.0; this[1]._tearColor._tint[1] = 0.0; return; } //@@ 005cd740 Entity_Player::GetLastDirection /* ZHL [lua] Lua binding EntityPlayer:GetLastDirection */ Vector * __thiscall Entity_Player::GetLastDirection(Entity_Player *this) { return &this->_lastDirection; } //@@ 005cd750 FUN_005cd750 void FUN_005cd750(void) { return; } //@@ 005cd760 FUN_005cd760 void FUN_005cd760(void) { return; } //@@ 005cd770 FUN_005cd770 void FUN_005cd770(void) { return; } //@@ 005cd780 FUN_005cd780 void FUN_005cd780(undefined4 *param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x1b1c) = *param_1; *(undefined4 *)(in_ECX + 0x1b20) = param_1[1]; return; } //@@ 005cd7a0 FUN_005cd7a0 void FUN_005cd7a0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *(undefined4 *)(in_ECX + 0x1910) = *param_1; *(undefined4 *)(in_ECX + 0x1914) = uVar1; *(undefined4 *)(in_ECX + 0x1918) = uVar2; *(undefined4 *)(in_ECX + 0x191c) = uVar3; *(undefined8 *)(in_ECX + 0x1920) = *(undefined8 *)(param_1 + 4); *(undefined4 *)(in_ECX + 0x1928) = param_1[6]; return; } //@@ 005cd7d0 Entity_Player::FriendBallEnemy /* ZHL [lua] Lua binding EntityPlayer:FriendBallEnemy */ EntityDesc * __thiscall Entity_Player::FriendBallEnemy(Entity_Player *this) { return &this->_friendBallEnemy; } //@@ 005cd7e0 FUN_005cd7e0 Vector * FUN_005cd7e0(Vector *param_1) { Entity_Player *in_ECX; Entity_Player::GetShootingJoystick(in_ECX,param_1); return param_1; } //@@ 005cd800 FUN_005cd800 void FUN_005cd800(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x839c) = 0; return; } //@@ 005cd810 FUN_005cd810 AchievementOverlay * FUN_005cd810(void) { return &g_manager->_achievementOverlay; } //@@ 005cd820 GridEntity_Rock::GetRubbleAnim /* ZHL [lua] Lua binding GridEntityRock:GetRubbleAnim */ std_string * __thiscall GridEntity_Rock::GetRubbleAnim(GridEntity_Rock *this) { std_string *psVar1; psVar1 = &this->_rubbleAnim; if (0xf < (this->_rubbleAnim)._capacity) { psVar1 = *(std_string **)psVar1->_buf; } return psVar1; } //@@ 005cd840 FUN_005cd840 void FUN_005cd840(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x54c) = param_1; return; } //@@ 005cd850 FUN_005cd850 void FUN_005cd850(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6028; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; *in_ECX = IsaacRepentancePlus::MrMeData::vftable; ANM2::constructor((ANM2 *)(in_ECX + 2)); local_8 = CONCAT31(local_8._1_3_,1); *(undefined1 *)(in_ECX + 0x4a) = 0; ANM2::Reset((ANM2 *)(in_ECX + 2)); ExceptionList = local_10; return; } //@@ 005cd8c0 FUN_005cd8c0 void FUN_005cd8c0(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 2)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x16)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0xe)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); std::string::_Tidy_deallocate((char *)(in_ECX + 2)); *in_ECX = IsaacRepentancePlus::Entity_Effect::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,300); } ExceptionList = local_10; return; } //@@ 005cd950 FUN_005cd950 bool FUN_005cd950(int param_1,int param_2) { return param_1 != param_2; } //@@ 005cd960 Entity_Effect::constructor /* ZHL [exact] __thiscall void Entity_Effect::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Effect::constructor(Entity_Effect *this) { Entity::constructor((Entity *)this); *(undefined ***)this = IsaacRepentancePlus::Entity_Effect::vftable; (this->_parentOffset).y = 0.0; (this->_parentOffset).x = 0.0; (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; *(undefined4 *)&this->field_0x488 = 0; *(undefined4 *)&this->field_0x484 = 0; *(undefined4 *)&this->field_0x490 = 0; *(undefined4 *)&this->field_0x48c = 0; *(undefined4 *)(this + 1) = 0; *(undefined4 *)&this[1].field_0x4 = 0; return; } //@@ 005cd9f0 Entity_Effect::Free /* ZHL [vtable slot 0] */ Entity_Effect * __thiscall Entity_Effect::Free(Entity_Effect *this,byte param_2) { char cVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::Entity_Effect::vftable; local_8 = 0; if (*(int **)&this[1].field_0x4 != (int *)0x0) { cVar1 = (**(code **)(**(int **)&this[1].field_0x4 + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7e854 != (code *)0x0)) { (*DAT_00c7e854)(this + 1); } } FID_conflict__Tidy(&this->_hitList); Entity::destructor((Entity *)this); if ((param_2 & 1) != 0) { operator_delete(this,0x4c0); } ExceptionList = local_10; return this; } //@@ 005cda90 FUN_005cda90 void FUN_005cda90(void) { int *piVar1; char cVar2; uint uVar3; Entity *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Effect::vftable; local_8 = 0; piVar1 = *(int **)&in_ECX[1]._sprite._overlayAnimState._isPlaying; if (piVar1 != (int *)0x0) { cVar2 = (**(code **)(*piVar1 + 0xc))(uVar3); if ((cVar2 != '\0') && (DAT_00c7e854 != (code *)0x0)) { (*DAT_00c7e854)(&in_ECX[1]._sprite._overlayAnimState._animFrame); } } FID_conflict__Tidy(&in_ECX[1]._sprite._overlayAnimState._animData); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 005cdb20 Entity_Effect::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] */ void __thiscall Entity_Effect::Init(Entity_Effect *this,int param_2,int param_3,int param_4,uint param_5) { code *pcVar1; Level *this_00; byte bVar2; char cVar3; byte *pbVar4; LayerState *pLVar5; Entity *tmpEntity; int iVar6; uint uVar7; int iVar8; Entity_Player *player; char *pcVar9; std_string *psVar10; ColorMod *extraout_EAX; Vector *vecResult; void *extraout_EAX_00; Room *pRVar11; AnimationState *animState; Game *game; RoomDescriptor *currentRoomDesc; RoomDescriptor *linkedRoomDesc; Entity_Familiar *pEVar12; ColorMod *tmpColor; Sprite *wispSprite; Font *spriteColor; undefined4 extraout_EAX_01; void *extraout_EAX_02; void *extraout_EAX_03; void *extraout_EAX_04; void *pvVar13; void *extraout_EAX_05; void *extraout_EAX_06; void *extraout_EAX_07; void *extraout_EAX_08; Entity_Effect *pEVar14; void *extraout_EAX_09; uint uVar15; Color *colorTarget; ColorMod *color; Vector *playerPos; EntityList *this_01; undefined4 *listEntry; undefined1 *puVar16; RNG *this_02; void *extraout_EAX_10; ColorMod *color_00; undefined4 uVar17; int *piVar18; RNG *rng; ANM2 *sprite; float10 alpha; float fVar19; float scale; undefined4 uVar20; undefined4 uVar21; undefined1 local_36c [40]; undefined1 local_344 [20]; undefined1 local_330 [20]; undefined1 local_31c [20]; undefined1 local_308 [20]; undefined1 local_2f4 [4]; undefined1 auStack_2f0 [12]; Level *local_2e4; Vector scratchVec; KColor local_2d8; char isReplaced; Vector local_2c0; LayerState *local_2b8; Entity_Familiar *local_2b4; Entity_Effect *effect; Color scratchColor; std_string minesLavaSheet; std_string blueWombSheet; std_string wombSheet; std_string depthsSheet; std_string cavesSheet; std_string corpse2Sheet; std_string corpseSheet; std_string mausoleumSheet; std_string minesLava2Sheet; std_string minesSheet; Color fadedColor; Color faintColor; Color orangeOffsetColor; Color splatTint; Color defaultColor; std_string local_b4; std_string sheetPath3; std_string sheetPath2; undefined1 local_6c [36]; float local_48; float local_44; std_string sheetPath; undefined1 local_28 [8]; undefined8 local_20; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; KColor *blendMode; bool isOpened; Manager *manager; EntityPtr spawner; local_8 = 0xffffffff; puStack_c = &LAB_00af61a2; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; effect = this; FUN_0060c800(0); Entity::Init((Entity *)this,param_2,param_3,param_4,param_5); std::vector::clear(&this->_hitList,1); this->_maxHitPoints = 0.0; if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),0); pbVar4 = std::string::c_str((this->_sprite)._animDefaultName._buf); ANM2::Play(&this->_sprite,pbVar4,0); } this->_state = 0; this->_timeout = -1; this->_lifespan = 1; (this->_parentOffset).x = g_vectorZero.x; (this->_parentOffset).y = g_vectorZero.y; this->_rotation = 0.0; this->_isFollowing = 0; this->_scale = 1.0; this->_minRadius = 0.0; this->_maxRadius = 0.0; this->_damageSource = 0; *(undefined4 *)&(this->_varData)._l = 0; *(undefined4 *)((int)&(this->_varData)._l + 4) = 0; *(undefined4 *)&(this->_varData)._h = 0; *(undefined4 *)((int)&(this->_varData)._h + 4) = 0; if (*(int *)((int)g_game->_room + 8) == 0x10) { switch(this->_variant) { case 7: case 0x12: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x20: case 0x25: case 0x2c: case 0x2d: case 0x2e: case 0x35: case 0x36: case 0x38: case 0x4d: case 0x4e: case 0x59: case 0x5a: case 0x5c: case 0x5d: case 0x5e: case 100: case 0xa9: case 0xc3: case 0xcc: this->_visible = 0; goto LAB_005cdc8a; } } iVar6 = this->_variant; if ((((((((iVar6 == 0x16) || (iVar6 == 0x17)) || (iVar6 == 0x18)) || ((iVar6 == 0x19 || (iVar6 == 0x1a)))) || (iVar6 == 0x20)) || (((iVar6 == 0x4e || (iVar6 == 0x25)) || ((iVar6 == 0x2c || (((iVar6 == 0x2d || (iVar6 == 0x2e)) || (iVar6 == 0x36)))))))) || ((iVar6 == 0x35 || (iVar6 == 0xcc)))) || ((iVar6 == 0x38 || (((iVar6 == 0x5a || (iVar6 == 0x5c)) || ((iVar6 == 0x5d || (((iVar6 == 0x5e || (iVar6 == 0xc3)) || (iVar6 == 0xa9)))))))))) { this->_sortingLayer = 0; this->_renderZOffset = 2000; if ((((iVar6 == 0x20) || (iVar6 == 0x25)) || (iVar6 == 0x4e)) || (iVar6 == 0x5a)) { this->_lifespan = 0x122; iVar6 = 0x122; } else { iVar6 = 0x7d; } this->_timeout = iVar6; game = g_game; iVar6 = this->_variant; this->_isInitFlag176 = 1; if ((iVar6 == 0x16) && (*(int *)((int)game->_room + 0x1d18) == 10)) { Color::Reset(&scratchColor); Color::SetTint(&scratchColor,0.5,0.5,0.5,1.0); Color::operator_assign((Color *)&(this->_sprite)._color,(ColorMod *)&scratchColor); iVar6 = this->_variant; } if (iVar6 == 0xa9) { piVar18 = &(this->_sprite)._bitflags; *piVar18 = *piVar18 | 0x20; } if (iVar6 == 0xc3) { Color::Reset(&orangeOffsetColor); Color::SetTint(&orangeOffsetColor,0.0,0.0,0.0,1.0); orangeOffsetColor._offset[0] = 0.6; orangeOffsetColor._offset[1] = 0.4; orangeOffsetColor._offset[2] = 0.0; Color::operator_assign((Color *)&(this->_sprite)._color,(ColorMod *)&orangeOffsetColor); iVar6 = this->_variant; } } else { if ((iVar6 != 7) && (iVar6 != 0x12)) { if (iVar6 == 0x59) { pvVar13 = (this->_sprite)._animState._animData; if ((pvVar13 == (void *)0x0) || (uVar7 = *(uint *)((int)pvVar13 + 0x30), uVar7 == 0)) { uVar15 = 0; } else { uVar15 = Random(); uVar15 = uVar15 % uVar7; pvVar13 = (this->_sprite)._animState._animData; } if (pvVar13 != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)uVar15); } Color::Reset(&faintColor); Color::SetTint(&faintColor,1.0,1.0,1.0,0.3); faintColor._offset[0] = 0.0; tmpColor = (ColorMod *)&faintColor; faintColor._offset[1] = 0.0; faintColor._offset[2] = 0.0; } else { if (iVar6 != 100) goto LAB_005ce02f; ANM2::Play(&this->_sprite,(byte *)"Final",0); pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar5->_blendMode[0] = 0; pLVar5->_blendMode[1] = 4; pLVar5->_blendMode[2] = 7; pLVar5->_blendMode[3] = 4; pLVar5->_blendMode[4] = 7; Color::Reset(&fadedColor); Color::SetTint(&fadedColor,1.0,1.0,1.0,0.66); fadedColor._offset[0] = 0.0; tmpColor = (ColorMod *)&fadedColor; fadedColor._offset[1] = 0.0; fadedColor._offset[2] = 0.0; } Color::operator_assign((Color *)&(this->_sprite)._color,tmpColor); } iVar6 = this->_variant; if ((iVar6 != 7) && (iVar6 != 0x12)) { uVar17 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 8; *(undefined4 *)((int)&this->_flags + 4) = uVar17; } this->_sortingLayer = 0; } LAB_005ce02f: if (((iVar6 == 1) || (iVar6 == 0x12)) && ((spawner = this->_spawnerEntity, spawner == (EntityPtr)0x0 || ((*(int *)((int)spawner + 0x28) != 1 && (tmpEntity = Entity::GetPlayerAncestor((Entity *)spawner), tmpEntity == (Entity *)0x0)))))) { iVar6 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3f); if (iVar6 == 2) { scale = (this->_sprite)._scale.x * 0.75; fVar19 = (this->_sprite)._scale.y * 0.75; } else { if (iVar6 < 3) goto LAB_005ce0c2; scale = (this->_sprite)._scale.x * 0.5; fVar19 = (this->_sprite)._scale.y * 0.5; } (this->_sprite)._scale.y = fVar19; (this->_sprite)._scale.x = scale; } LAB_005ce0c2: iVar6 = this->_variant; if (iVar6 == 0xe) { this->_sortingLayer = 0; uVar7 = Random(); (this->_sprite)._flipX = (byte)uVar7 & 1; iVar6 = this->_variant; } iVar8 = 3; if (iVar6 != 5) { iVar8 = 0; } this->_entityGridCollisionClass = iVar8; this->_entityCollisionClass = 0; game = g_game; if ((((iVar6 == 0xc) || (iVar6 == 0xd)) || (iVar6 == 0x4f)) || (iVar6 == 0x50)) { uVar7 = Random(); this->_rotation = ((float)(uVar7 & 3) + 0.0) * 90.0; goto LAB_005d03c8; } if (iVar6 == 0x61) { uVar7 = Random(); this->_isInitFlag176 = 1; this->_rotation = ((float)(uVar7 & 3) + 0.0) * 90.0; uVar7 = Random(); (this->_sprite)._flipX = ((byte)uVar7 ^ 0xff) & 1; goto LAB_005d03cf; } if (iVar6 == 1) { uVar7 = Random(); (this->_sprite)._flipX = ((byte)uVar7 ^ 0xff) & 1; goto LAB_005d03cf; } if ((((iVar6 == 4) || (iVar6 == 0x1b)) || ((iVar6 == 0x23 || ((iVar6 == 0x55 || (iVar6 == 0x56)))))) || ((iVar6 == 0x5f || ((iVar6 == 0x62 || (iVar6 == 0xa3)))))) { this->_fallingAcceleration = 1.3; uVar7 = Random(); this->_height = -23.0; (this->_posOffset).y = -23.0; iVar6 = this->_variant; this->_fallingSpeed = -5.0 - (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0; if ((iVar6 == 0x1b) || (iVar6 == 0xa3)) { uVar7 = Random(); ANM2::SetFrame(&this->_sprite,(std_string *)(&PTR_DAT_00b63bc8)[uVar7 & 3],0); } else if ((((iVar6 == 0x23) || (iVar6 == 0x55)) || (iVar6 == 0x56)) || ((iVar6 == 0x5f || (iVar6 == 0x62)))) { uVar7 = Random(); uVar15 = Random(); if ((uVar15 % 3 == 0) && (this->_variant != 0x55)) { ANM2::SetFrame(&this->_sprite,(std_string *)(&PTR_s_Gib01_00b63ba8)[uVar7 & 3],0); } else { ANM2::Play(&this->_sprite,(byte *)(&PTR_s_Gib01_00b63ba8)[uVar7 & 3],0); } } goto LAB_005d03cf; } if (iVar6 == 0x3a) { this->_fallingAcceleration = 1.3; this->_height = -23.0; uVar7 = Random(); local_2b8 = (LayerState *) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0); pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar5->_rotation = (float)local_2b8; uVar7 = Random(); ANM2::Play(&this->_sprite,(&PTR_s_Gib01_00b63b94)[uVar7 % 5],0); uVar7 = Random(); this->_fallingSpeed = 5.0 - (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 30.0; goto LAB_005d03cf; } if (iVar6 == 0x22) { if (this->_subtype == 1) { std::string::string_from_cstr(local_b4._buf,(byte *)"gfx/Effects/Effect_Fart_Red.png"); local_8 = 0; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&local_b4); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_b4._buf); ANM2::LoadGraphics(&this->_sprite,0); } uVar7 = Random(); (this->_sprite)._flipX = ((byte)uVar7 ^ 0xff) & 1; manager = g_manager; if (((uint)this->_subtype < 10) && ((this->_spawnerEntity == (EntityPtr)0x0 || (*(int *)((int)this->_spawnerEntity + 0x28) != 0x108)))) { local_2b4 = (Entity_Familiar *)0x25; seed_fart_sound_override((int *)&local_2b4); SoundEffects::Play(&manager->_sfxManager,(int)local_2b4,1.0,0x14,0,1.0,0.0); } this->_renderZOffset = 1000; goto LAB_005d03cf; } if (iVar6 == 8) { this->_renderDepthOffset = -40.0; goto LAB_005d03cf; } if (((iVar6 == 10) || (iVar6 == 0x34)) || (iVar6 == 0x33)) { spawner = this->_spawnerEntity; this->_entityGridCollisionClass = 6; if (((spawner != (EntityPtr)0x0) && ((*(int *)((int)spawner + 0x28) == 2 || (*(int *)((int)spawner + 0x28) == 4)))) && (*(Entity **)((int)spawner + 0x3c8) != (Entity *)0x0)) { Entity::SetSpawnerEntity((Entity *)this,*(Entity **)((int)spawner + 0x3c8)); } if (this->_variant != 10) { this->_scale = 1.0; this->_timeout = 300; this->_lifespan = 300; } goto LAB_005d03dd; } if (iVar6 == 0x1f) { ANM2::SetFrame(&this->_sprite,(std_string *)"Falling",0); goto LAB_005d03cf; } if (iVar6 == 0x37) { this->_state = 1; this->_collisionDamage = 1.0; player = PlayerManager::FirstTrinketOwner(&game->_playerManager,0x97); if (player == (Entity_Player *)0x0) { LAB_005ce40c: pcVar9 = "SummonWomb"; } else { iVar6 = Entity_Player::GetTrinketMultiplier(player,0x97); pcVar9 = "SummonWombDisabled"; if (iVar6 < 2) goto LAB_005ce40c; } ANM2::Play(&this->_sprite,(byte *)pcVar9,0); goto LAB_005d03cf; } if (param_3 == 0x15) { this->_sortingLayer = 1; LAB_005d0198: if (this->_variant == 0x44) { this->_sortingLayer = 0; this->_renderZOffset = 5000; uVar7 = Random(); local_2c0.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10000.0; uVar7 = Random(); (this->_targetPosition).x = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 40.0; (this->_targetPosition).y = local_2c0.y; } this->_mass = 1.0; this->_entityCollisionClass = 4; LAB_005d03c8: this->_isInitFlag176 = 1; goto LAB_005d03cf; } if (param_3 == 0x21) { uVar7 = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); if (uVar7 == 0xf) { ANM2::Play(&this->_sprite,(byte *)"White",0); } goto LAB_005d0198; } if (param_3 == 0x44) goto LAB_005d0198; if (param_3 == 2) { if (this->_subtype - 1U < 5) { ANM2::Play(&this->_sprite,(&PTR_s_Poof_Large_00b63b48)[this->_subtype],0); } goto LAB_005d03c8; } if (param_3 == 0xf) { if (this->_subtype - 1U < 3) { ANM2::Play(&this->_sprite,(&PTR_s_Poof2_00b63b3c)[this->_subtype],0); } this->_renderZOffset = 8000; goto LAB_005d03cf; } if (param_3 == 0x10) { iVar6 = this->_subtype; if ((iVar6 == 1) || (iVar6 == 3)) { if (*(int *)((int)g_game->_room + 8) != 0x10) { this->_sortingLayer = 0; } ANM2::Play(&this->_sprite,&DAT_00b1d534,0); } else if (((iVar6 == 2) || (iVar6 == 4)) || (iVar6 == 5)) { this->_renderZOffset = 8000; ANM2::Play(&this->_sprite,&DAT_00b1d534,0); } else { if (iVar6 == 0x42) { local_28._4_4_ = this->_initSeed; local_20._0_4_ = 1.4013e-45; local_20._4_4_ = 1.54143e-44; local_18 = 6; local_8 = 1; RNG::Next((RNG *)(local_28 + 4)); ANM2::Play(&this->_sprite,(&PTR_s_Poof0_00b63b34)[(uint)local_28._4_4_ % 3],0); local_8 = 0xffffffff; } else { if (iVar6 != 0x43) goto LAB_005d03cf; ANM2::Play(&this->_sprite,(byte *)"PoofLarge",0); } (this->_sprite)._flipX = ~(byte)this->_initSeed & 1; } goto LAB_005d03cf; } if (param_3 == 0x39) { pcVar9 = "Effect"; if (this->_subtype != 0) { pcVar9 = "Effect2"; } ANM2::Play(&this->_sprite,(byte *)pcVar9,0); if (*(int *)((int)g_game->_room + 8) != 0x10) { this->_sortingLayer = 0; } goto LAB_005d03dd; } if (param_3 == 0x3b) { pcVar9 = ANM2::GetAnimationData(&this->_sprite,(byte *)"Clouds"); if (pcVar9 != (char *)0x0) { local_2b8 = *(LayerState **)(pcVar9 + 0x30); if (local_2b8 == (LayerState *)0x0) { local_2b4 = (Entity_Familiar *)0x0; } else { uVar7 = Random(); local_2b4 = (Entity_Familiar *)(uVar7 % (uint)local_2b8); } psVar10 = (std_string *)std::string::c_str(pcVar9); ANM2::SetFrame(&this->_sprite,psVar10,(int)local_2b4); uVar7 = Random(); (this->_sprite)._flipX = ((byte)uVar7 ^ 0xff) & 1; uVar7 = Random(); (this->_sprite)._rotation = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0 - 180.0; (this->_sprite)._scale.x = 0.5; (this->_sprite)._scale.y = 0.5; this->_renderZOffset = 8000; if (this->_subtype == 1) { Color::Reset((Color *)local_6c); Color::SetTint((Color *)local_6c,1.0,1.0,1.0,1.0); local_6c._32_4_ = -0.5; local_48 = -0.5; local_44 = -0.5; Color::operator_assign((Color *)&(this->_sprite)._color,(ColorMod *)local_6c); } } goto LAB_005d03cf; } if (iVar6 == 0x3c) { this->_entityGridCollisionClass = 3; ANM2::Play(&this->_sprite,(byte *)"Rotate",0); (this->_posOffset).x = 0.0; manager = g_manager; (this->_posOffset).y = -20.0; local_2b8 = (LayerState *)0x345; seed_fart_sound_override((int *)&local_2b8); SoundEffects::Play(&manager->_sfxManager,(int)local_2b8,1.0,2,1,1.0,0.0); goto LAB_005d03cf; } if (iVar6 == 0x3d) { this->_visible = 0; this->_timeout = 0x14; this->_minRadius = 20.0; this->_maxRadius = 95.0; goto LAB_005d03cf; } if (iVar6 == 0x43) { this->_visible = 0; this->_timeout = 0x32; this->_minRadius = 45.0; this->_maxRadius = 320.0; goto LAB_005d03cf; } if (iVar6 != 0x3e) { if (iVar6 == 0x29) { iVar6 = g_game->_stage; if (iVar6 < 7) { if (((iVar6 == 5) || (iVar6 == 6)) && (g_game->_stageType == 2)) { std::string::string_from_cstr (sheetPath3._buf,(byte *)"gfx/Effects/Effect_DankDroplets.png"); local_8 = 0xe; goto LAB_005ceb44; } } else { std::string::string_from_cstr (sheetPath3._buf,(byte *)"gfx/Effects/Effect_BloodDroplets.png"); local_8 = 0xd; LAB_005ceb44: Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath3); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath3._buf); } uVar7 = Random(); this->_state = uVar7 % 3; if (uVar7 % 3 == 0) { ANM2::Play(&this->_sprite,(byte *)"LargeDrop",0); uVar7 = Random(); scale = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; fVar19 = scale * g_vectorOne.x; (this->_sprite)._scale.y = scale * g_vectorOne.y; (this->_sprite)._scale.x = fVar19; } else { ANM2::Play(&this->_sprite,(byte *)"SmallDrop",0); } this->_height = -10.0; uVar7 = Random(); (this->_sprite)._flipX = ((byte)uVar7 ^ 0xff) & 1; goto LAB_005d03cf; } if (iVar6 != 0x41) { if (iVar6 == 0x3f) { pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::is_type_16(pRVar11); if (bVar2 != 0) { LAB_005cdc8a: (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_10; return; } iVar6 = this->_subtype; if (iVar6 == 0) { pcVar9 = "WormHori"; LAB_005ceeab: ANM2::Play(&this->_sprite,(byte *)pcVar9,0); } else { if (iVar6 == 1) { pcVar9 = "MaggotHori"; goto LAB_005ceeab; } if (iVar6 == 2) { pcVar9 = "LeechHori"; goto LAB_005ceeab; } } fVar19 = random_float(); fVar19 = normalize_angle_degrees(fVar19 * 360.0); this->_rotation = fVar19; Sprite::SetRotation((Sprite *)&this->_sprite,fVar19); this->_sortingLayer = 1; this->_fallingAcceleration = 1.3; fVar19 = random_float(); this->_fallingSpeed = 5.0 - fVar19 * 30.0; goto LAB_005d03cf; } if (iVar6 == 0x40) { ANM2::Play(&this->_sprite,(byte *)"WalkHori",0); fVar19 = random_float(); local_2b8 = (LayerState *)normalize_angle_degrees(fVar19 * 360.0); this->_rotation = (float)local_2b8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); pLVar5->_rotation = (float)local_2b8; this->_height = 0.0; } else { if (iVar6 != 0x45) { if (iVar6 == 0x46) { iVar6 = Isaac::Random(3); ANM2::SetFrame(&this->_sprite,(std_string *)"Droplets",iVar6); this->_fallingAcceleration = 1.3; fVar19 = random_float(); this->_shadowSize = 0.04; this->_fallingSpeed = 1.0 - fVar19 * 15.0; goto LAB_005d03dd; } if ((iVar6 == 0x47) || (iVar6 == 0x6e)) { pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); pLVar5->_minFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); pLVar5->_magFilterMode = 1; if (this->_variant == 0x6e) { ANM2::Play(&this->_sprite,(byte *)"IdleQuick",0); } } else if (iVar6 == 0x7e) { iVar6 = Isaac::Random(4); Sprite::SetRotation((Sprite *)&this->_sprite, (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]) * 90.0); iVar6 = Isaac::Random(2); Sprite::set_flip_x((Sprite *)&this->_sprite,iVar6 == 0); pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); pLVar5->_visible = 0; if (this->_subtype == 1) { SetTimeout(this,0x3c); fVar19 = random_float(); SoundEffects::PlayWithFartOverride2(0x22d,(int)&this->_pos,2,0,fVar19 * 0.2 + 0.9,1.0) ; } else { SetTimeout(this,0x5a); fVar19 = random_float(); SoundEffects::PlayWithFartOverride2(0x110,(int)&this->_pos,2,0,fVar19 * 0.3 + 2.7,0.6) ; } } else if ((iVar6 == 0x7f) || (iVar6 == 0xca)) { this->_visible = 0; Entity::AddEntityFlags((Entity *)this,0x200000); if (this->_variant == 0xca) { iVar6 = 0x365; LAB_005cf680: SoundEffects::PlayWithFartOverride(iVar6,1.0,2,0,1.0); } } else if (iVar6 == 0x48) { this->_visible = 0; this->_timeout = 0xf0; Vector::operator_assign(&this->_targetPosition,&g_vectorZero); } else if (iVar6 == 0x49) { this->_visible = 0; this->_timeout = 8; } else if (iVar6 == 0x4a) { this->_sortingLayer = 0; this->_entityGridCollisionClass = 3; this->_entityCollisionClass = 1; Level::GetCurrentRoom((Level *)game); iVar6 = GridEntity::GetVariant(); if (iVar6 == 0x13) { std::string::string_from_cstr (sheetPath2._buf,(byte *)"gfx/Effects/IsaacCarpet_Barren.png"); local_8 = 0xf; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath2); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath2._buf); } } else if (iVar6 == 0x4b) { this->_timeout = 0x32; this->_fallingAcceleration = 1.3; this->_fallingSpeed = 0.5; ANM2::Play(&this->_sprite,&DAT_00b634bc,0); } else if (iVar6 == 0x4c) { local_2e4 = (Level *)&DAT_00000005; piVar18 = (int *)std_min_ptr(); ANM2::Play(&this->_sprite,(&PTR_DAT_00b63b70)[*piVar18],0); LAB_005cf2a4: this->_sortingLayer = 0; } else if (iVar6 == 0x24) { pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetBackdropType(pRVar11); Level::GetCurrentRoom((Level *)g_game); FUN_004aae70(); iVar6 = FUN_005cd470(); Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,(std_string *)(iVar6 + 0x108)); this->_sortingLayer = 1; } else if (iVar6 == 0x1d) { Vector::operator_assign(&this->_targetPosition,&g_vectorZero); this->_collisionDamage = 300.0; } else if (iVar6 == 0x13) { this->_collisionDamage = 20.0; } else if (iVar6 == 0x51) { this->_fallingSpeed = 0.0; this->_height = -60.0; (this->_posOffset).y = -60.0; this->_entityGridCollisionClass = 6; } else if (iVar6 == 0x52) { sprite = &this->_sprite; local_2b4 = (Entity_Familiar *)sprite; if (this->_subtype == 1) { std::string::string_from_cstr (sheetPath2._buf,(byte *)"gfx/Effects/wombhole_orange.png"); local_8 = 0x10; Sprite::ReplaceSpritesheet((Sprite *)sprite,0,&sheetPath2); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath2._buf); } this->_sortingLayer = 0; this->_state = 0; ANM2::Play(sprite,(byte *)"Closed",0); Config::GetCollectibles(); pLVar5 = (LayerState *)FUN_00436120(this->_subtype - 1U & 1); local_2b8 = pLVar5; local_2e4 = (Level *)Config::GetCollectibles(); pvVar13 = pLVar5->_layerData; game = (Game *)Config::GetCollectibles(); currentRoomDesc = Game::GetCurrentRoomDesc(game); linkedRoomDesc = Level::GetRoomByIdx(local_2e4,(int)pvVar13,-1); if ((-1 < (int)local_2b8->_layerData) || (isOpened = false, linkedRoomDesc == currentRoomDesc)) { isOpened = true; } pcVar9 = "Opened"; if (!isOpened) { pcVar9 = "Closed"; } ANM2::Play((ANM2 *)local_2b4,(byte *)pcVar9,0); Config::GetCollectibles(); this = effect; iVar6 = FUN_00436120(effect->_subtype); if (*(char *)(iVar6 + 8) != '\0') { player = Game::GetPlayer(g_game,0); pEVar12 = Entity_Player::AddWisp(player,0x18c,&this->_pos,0,1); local_2b4 = pEVar12; if (pEVar12 != (Entity_Familiar *)0x0) { Entity::SetParent((Entity *)pEVar12,(Entity *)this); if (this->_subtype != 0) { tmpColor = ColorParams::set_from_bytes ((ColorParams *)local_6c,400,0xfa,0x3c,0xff,0,0,0); wispSprite = (Sprite *)Entity::GetSprite((Entity *)local_2b4); pLVar5 = Sprite::GetLayer(wispSprite,(byte *)0x0); Color::operator_assign((Color *)&pLVar5->_color,tmpColor); tmpColor = ColorParams::set_from_bytes ((ColorParams *)local_6c,300,200,10,0xff,0,0,0); wispSprite = (Sprite *)Entity::GetSprite((Entity *)local_2b4); pLVar5 = Sprite::GetLayer(wispSprite,(byte *)0x1); Color::operator_assign((Color *)&pLVar5->_color,tmpColor); pEVar12 = local_2b4; } FUN_0063c060(9); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar6 = Room::GetFrameCount(pRVar11); if (iVar6 < 2) { Entity::ClearEntityFlags((Entity *)pEVar12,4); } (**(code **)(*(int *)pEVar12 + 0xc))(); } } } else if (iVar6 == 0x57) { BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,blendMode); fVar19 = RNG::RandomFloat(&this->_dropRNG); local_2c0.y = fVar19 * 0.5 + 0.5; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); } else if (iVar6 == 0x58) { if (this->_subtype == 1) { std::string::string_from_cstr (sheetPath2._buf,(byte *)"gfx/Effects/Effect_088_PurpleBall.png"); local_8 = 0x11; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath2); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath2._buf); } uVar7 = Random(); Sprite::PlayRandom(uVar7); iVar6 = Isaac::Random(2); Sprite::set_flip_x((Sprite *)&this->_sprite,iVar6 == 0); this->_renderZOffset = -1000; } else { if (iVar6 == 0x5b) { ANM2::Play(&this->_sprite,(byte *)"JumpDown",0); iVar6 = 2; goto LAB_005cf680; } if (iVar6 == 99) { if (this->_subtype == 0) { Level::GetCurrentRoom((Level *)g_game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)(iVar6 + 0x74)); spriteColor = (Font *)Sprite::Color((Sprite *)&this->_sprite); fVar19 = random_float(); Font::SetLineHeightModifier(spriteColor,fVar19 * 0.15 + 0.05); iVar6 = Isaac::Random(2); Sprite::set_flip_x((Sprite *)&this->_sprite,iVar6 == 0); fVar19 = random_float(); local_2c0.y = fVar19 * 0.2 + 0.5; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); fVar19 = random_float(); local_2c0.y = fVar19 * 2.0 + 1.0; fVar19 = random_float(); SoundEffects::PlayWithFartOverride(0x18e,fVar19 * 0.5 + 0.5,2,0,local_2c0.y); } else { this->_fallingAcceleration = 0.5; fVar19 = random_float(); this->_height = -10.0; this->_fallingSpeed = -1.0 - fVar19 * 2.0; fVar19 = random_float(); local_2c0.y = fVar19 * 0.5 + 0.5; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); Level::GetCurrentRoom((Level *)g_game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)(iVar6 + 0x74)); spriteColor = (Font *)Sprite::Color((Sprite *)&this->_sprite); fVar19 = random_float(); Font::SetLineHeightModifier(spriteColor,fVar19 * 0.3 + 0.1); } } else if (iVar6 == 0x53) { iVar6 = Game::Challenge(g_game); if (iVar6 == 0x1e) { std::string::string_from_cstr (sheetPath._buf,(byte *)"gfx/Effects/Effect_101_FireSword.png"); local_8 = 0x12; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath._buf); } } else if (iVar6 == 0x35) { this->_timeout = 0x19; } else if (iVar6 == 0x68) { uVar7 = this->_subtype; if (uVar7 == 0) { this->_visible = 0; } else if (uVar7 == 1) { ANM2::Play(&this->_sprite,(byte *)"Projectile",0); fVar19 = random_float(); this->_height = -(fVar19 * 4.0 + 12.0); local_2e4 = (Level *)random_float(); local_2c0.y = random_float(); random_float(); pcVar1 = *(code **)(*(int *)this + 0x3c); Color::Color((Color *)local_6c); (*pcVar1)(extraout_EAX_01,0xffffffff,0xff,0,1); } else { if (uVar7 == 2) { bVar2 = 0; pcVar9 = "Explode"; } else { if (uVar7 < 3) goto LAB_005cf9dd; bVar2 = 0; iVar6 = Isaac::Random(4); pcVar9 = (&PTR_s_Particle1_00b63b60)[iVar6]; } ANM2::Play(&this->_sprite,(byte *)pcVar9,bVar2); } LAB_005cf9dd: if (this->_subtype != 1) { fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 360.0 - 180.0); } BlendMode::SetMode(local_308,2,0); pvVar13 = extraout_EAX_02; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,pvVar13); } else if (iVar6 == 0x69) { ANM2::Play(&this->_sprite,(byte *)"PoofStart",0); this->_renderZOffset = 1000; } else if (iVar6 == 0x6a) { ANM2::Play(&this->_sprite,(byte *)"Appear",0); this->_renderZOffset = 1000; (this->_posOffset).y = -20.0; } else if (iVar6 == 0x27) { Entity::AddEntityFlags((Entity *)this,0x200000); if (this->_subtype == 1) { if (this->_spawnerType != 0) goto LAB_005cf2a4; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); pLVar5->_minFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); pLVar5->_magFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x2); pLVar5->_minFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x2); pLVar5->_magFilterMode = 1; BlendMode::SetMode(local_308,2,0); pvVar13 = extraout_EAX_03; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,pvVar13); BlendMode::SetMode(local_308,2,0); pvVar13 = extraout_EAX_04; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x2); copy_20_bytes(pLVar5->_blendMode,pvVar13); pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x2); game = g_game; pLVar5->_visible = 0; tmpEntity = Game::Spawn(game,this->_type,this->_variant,&this->_pos,&g_vectorZero, (Entity *)this,this->_subtype,this->_initSeed); Entity::SetChild((Entity *)this,tmpEntity); Entity::SetParent(tmpEntity,(Entity *)this); this->_renderDepthOffset = 10.0; } } else if (iVar6 == 0x7b) { iVar6 = this->_subtype; if (iVar6 == 3) { pvVar13 = (void *)FUN_00a11590(0,2,0); pbVar4 = (byte *)0x0; LAB_005cfc0c: pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,pbVar4); copy_20_bytes(pLVar5->_blendMode,pvVar13); } else { if (iVar6 == 4) { Entity::AddFlagsLow((Entity *)&this->_sprite,0x20); BlendMode::SetMode(local_344,2,0); pbVar4 = (byte *)0x0; pvVar13 = extraout_EAX_05; goto LAB_005cfc0c; } if (iVar6 == 7) { Entity::AddFlagsLow((Entity *)&this->_sprite,0x100); BlendMode::SetMode(local_330,2,0); pbVar4 = (byte *)0x0; pvVar13 = extraout_EAX_06; goto LAB_005cfc0c; } if (iVar6 == 9) { BlendMode::SetMode(local_b4._buf + 4,2,0); pbVar4 = (byte *)0x1; pvVar13 = extraout_EAX_07; goto LAB_005cfc0c; } } this->_renderZOffset = -1000; } else if (iVar6 == 0x6b) { if (this->_subtype == 0) { (this->_posOffset).y = -32.0; ANM2::Play(&this->_sprite,(byte *)"Throw",0); } else { ANM2::Play(&this->_sprite,s_Idle,0); } } else { if (iVar6 == 0x6c) { local_2c0.y = (float)operator_new(300); local_8 = 0x13; if ((Room *)local_2c0.y == (Room *)0x0) { uVar17 = 0; } else { uVar17 = FUN_005cd850(); } local_8 = 0xffffffff; ExtraDataRef::Set(uVar17); this->_state = 0; goto LAB_005d03dd; } if (iVar6 == 0x6d) { LAB_005d00d8: ANM2::Play(&this->_sprite,(byte *)"Appear",0); } else if (iVar6 == 0x6f) { ANM2::Play(&this->_sprite,&DAT_00b1d534,0); } else if (iVar6 == 0x70) { BlendMode::SetMode(local_b4._buf + 4,2,0); pvVar13 = extraout_EAX_08; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,pvVar13); ANM2::Play(&this->_sprite,(byte *)"Appear",0); this->_state = -1; } else { if (iVar6 == 0x71) goto LAB_005d00d8; if (iVar6 == 0x73) { ANM2::Play(&this->_sprite,s_Idle,0); this->_renderZOffset = 10000; this->_state = 0; Entity::AddEntityFlags((Entity *)this,0x200000); } else if (iVar6 == 0x74) { ANM2::Play(&this->_sprite,s_Idle,0); this->_sortingLayer = 0; this->_state = 0; this->_damageSource = 0; Entity::AddEntityFlags((Entity *)this,0x200000); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar6 = Room::GetBackdropType(pRVar11); if (iVar6 == 0x10) { std::string::string_from_cstr (sheetPath._buf,(byte *)"gfx/Effects/dirtpatch_darkroom.png"); local_8 = 0x14; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath._buf); Sprite::LoadGraphics(); } } else if (iVar6 == 0x75) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7fb40) && (_Init_thread_header(&DAT_00c7fb40), DAT_00c7fb40 == -1)) { local_8 = 0x15; Color::Color(0x3f800000,0x3d4ccccd,0x3df5c28f,0x3e4ccccd); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c7fb40); } Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&DAT_00c7fb44); ANM2::Play(&this->_sprite,(byte *)"LostDeath",0); this->_state = 0; } else if (iVar6 == 0x77) { this->_visible = 0; *(undefined4 *)&(this->_varData)._l = 0; *(undefined4 *)((int)&(this->_varData)._l + 4) = 1; *(undefined4 *)&(this->_varData)._h = 1; Entity::AddEntityFlags((Entity *)this,0x200000); } else if (iVar6 == 0x78) { this->_visible = 0; *(undefined4 *)&(this->_varData)._l = 0; *(undefined4 *)((int)&(this->_varData)._l + 4) = 0; this->_state = -1; Entity::AddEntityFlags((Entity *)this,0x200000); } else if (iVar6 == 0x31) { if ((uint)this->_subtype < 6) { ANM2::Play(&this->_sprite,(&PTR_s_Heart_00b63af4)[this->_subtype],0); } } else if (iVar6 == 0x79) { Entity::AddEntityFlags((Entity *)this,0x200000); this->_scale = 0.0; ANM2::SetFrame(&this->_sprite,(std_string *)"Default",0); } else if (iVar6 == 0x7c) { bVar2 = 0; iVar6 = Isaac::Random(3); ANM2::Play(&this->_sprite,(&PTR_s_Bubble1_00b63ae4)[iVar6],bVar2); iVar6 = Isaac::Random(2); Sprite::set_flip_x((Sprite *)&this->_sprite,iVar6 == 0); } else if (iVar6 == 0x7d) { ANM2::Play(&this->_sprite,(byte *)"SmallHoleOpen",0); this->_state = 0; this->_renderDepthOffset = -5.0; local_2b8 = ANM2::GetLayer(&this->_sprite,&DAT_00b1d57c); if (local_2b8 != (LayerState *)0x0) { uVar7 = Random(); vecResult = &this->_pos; pEVar14 = (Entity_Effect *) Game::Spawn(g_game,1000,0x7a,vecResult,&g_vectorZero,(Entity *)effect, 0,uVar7); Entity::SetParent((Entity *)pEVar14,(Entity *)effect); iVar6 = _ptr_deref_or_minus1(); set_state(pEVar14,iVar6); Entity::SetChild((Entity *)effect,(Entity *)pEVar14); pLVar5 = local_2b8; game = g_game; local_2b8->_visible = 0; pRVar11 = (Room *)Level::GetCurrentRoom((Level *)game); this = effect; Room::GetFloorColorAt(pRVar11,&local_2d8,vecResult,effect->_size); tmpColor = (ColorMod *)Color::Color(0x3f800000); Color::operator_assign((Color *)&pLVar5->_color,tmpColor); } } else if (iVar6 == 0x67) { BlendMode::SetMode(local_b4._buf + 4,2,0); pvVar13 = extraout_EAX_09; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,pvVar13); bVar2 = 0; iVar6 = Isaac::Random(5); ANM2::Play(&this->_sprite,(&PTR_s_Bling1_00b63ad0)[iVar6],bVar2); } else if (iVar6 == 0xcb) { ANM2::Play(&this->_sprite,(byte *)"Summon",0); Level::GetCurrentRoom((Level *)g_game); Room::SetClear(0); } } } } goto LAB_005d03cf; } ANM2::Play(&this->_sprite,s_Idle,0); animState = (AnimationState *)Config::GetPillEffects(); iVar6 = AnimationState::GetAnimationLength(animState); iVar6 = Isaac::Random(iVar6); Sprite::SetFrame_1((Sprite *)&this->_sprite,iVar6); fVar19 = random_float(); fVar19 = normalize_angle_degrees(fVar19 * 360.0); this->_rotation = fVar19; Sprite::SetRotation((Sprite *)&this->_sprite,fVar19); fVar19 = random_float(); fVar19 = fVar19 * -30.0 - 5.0; (this->_posOffset).y = fVar19; this->_height = fVar19; Vector::operator_assign(&this->_targetPosition,&g_vectorZero); } goto LAB_005d03c8; } uVar7 = Game::GetStageID(g_game,0); switch(uVar7) { case 10: case 0xb: case 0xc: case 0x1c: case 0x1e: case 0x21: case 0x22: ANM2::Play(&this->_sprite,(byte *)"White",0); Color::Reset((Color *)local_6c); Color::SetTint((Color *)local_6c,1.0,0.8,0.0,1.0); Color::operator_assign((Color *)&(this->_sprite)._color,(ColorMod *)local_6c); Color::Reset((Color *)local_6c); Color::SetTint((Color *)local_6c,1.0,1.0,0.5,1.0); tmpColor = (ColorMod *)local_6c; goto code_r0x005ceddb; default: ANM2::Play(&this->_sprite,&DAT_00b634c0,0); break; case 0x10: case 0x1f: ANM2::Play(&this->_sprite,&DAT_00b633c4,0); Color::Reset(&splatTint); Color::SetTint(&splatTint,1.0,0.5,0.5,1.0); if (&this->_splatColor != (ColorMod *)&splatTint) { (this->_splatColor)._tint[0] = splatTint._tint[0]; (this->_splatColor)._tint[1] = splatTint._tint[1]; (this->_splatColor)._tint[2] = splatTint._tint[2]; (this->_splatColor)._tint[3] = splatTint._tint[3]; (this->_splatColor)._colorize[0] = splatTint._colorize[0]; (this->_splatColor)._colorize[1] = splatTint._colorize[1]; (this->_splatColor)._colorize[2] = splatTint._colorize[2]; (this->_splatColor)._colorize[3] = splatTint._colorize[3]; *(undefined8 *)(this->_splatColor)._offset = splatTint._offset._0_8_; (this->_splatColor)._offset[2] = splatTint._offset[2]; } goto code_r0x005cede7; case 0x20: ANM2::Play(&this->_sprite,(byte *)"White",0); tmpColor = (ColorMod *)Color::Color(0x3f800000); Sprite::SetColor((Sprite *)&this->_sprite,tmpColor); } Color::Color((Color *)local_6c); tmpColor = extraout_EAX; code_r0x005ceddb: Color::operator_assign((Color *)&this->_splatColor,tmpColor); code_r0x005cede7: fVar19 = random_float(); (this->_posOffset).y = fVar19 * -50.0; fVar19 = random_float(); local_2b8 = (LayerState *)(fVar19 * 0.5 + 0.5); vecResult = Vector::__mul(&g_vectorOne,&local_2c0,(float *)&local_2b8); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); BlendMode::SetMode(local_36c,2,0); pvVar13 = extraout_EAX_00; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,pvVar13); goto LAB_005d03cf; } uVar7 = Random(); (this->_sprite)._flipX = ~(byte)uVar7 & 1; switch(*(undefined4 *)((int)g_game->_room + 0x1d18)) { case 4: case 5: std::string::string_from_cstr (cavesSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakCaves.png"); local_8 = 2; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&cavesSheet); local_8 = 0xffffffff; std::string::_Tidy_deallocate(cavesSheet._buf); break; case 7: case 8: case 9: std::string::string_from_cstr (depthsSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakDepths.png"); local_8 = 3; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&depthsSheet); local_8 = 0xffffffff; std::string::_Tidy_deallocate(depthsSheet._buf); break; case 10: case 0xb: case 0xc: std::string::string_from_cstr (wombSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakWomb.png"); local_8 = 4; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&wombSheet); psVar10 = &wombSheet; goto LAB_005ceaae; case 0xd: std::string::string_from_cstr (blueWombSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakBlueWomb.png"); local_8 = 5; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&blueWombSheet); psVar10 = &blueWombSheet; goto LAB_005ceaae; case 0x20: if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 5 & 1) == 0) { std::string::string_from_cstr (minesSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakMines.png"); local_8 = 7; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&minesSheet); local_8 = 0xffffffff; std::string::_Tidy_deallocate(minesSheet._buf); } else { std::string::string_from_cstr (minesLavaSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakMinesLava.png"); local_8 = 6; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&minesLavaSheet); local_8 = 0xffffffff; std::string::_Tidy_deallocate(minesLavaSheet._buf); } break; case 0x21: case 0x28: case 0x29: case 0x2a: std::string::string_from_cstr (mausoleumSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakMausoleum.png"); local_8 = 9; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&mausoleumSheet); local_8 = 0xffffffff; std::string::_Tidy_deallocate(mausoleumSheet._buf); break; case 0x22: std::string::string_from_cstr (corpseSheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakCorpse.png"); local_8 = 10; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&corpseSheet); psVar10 = &corpseSheet; goto LAB_005ceaae; case 0x2b: std::string::string_from_cstr (corpse2Sheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakCorpse2.png"); local_8 = 0xb; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&corpse2Sheet); psVar10 = &corpse2Sheet; goto LAB_005ceaae; case 0x2c: std::string::string_from_cstr (sheetPath3._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakWomb.png"); local_8 = 0xc; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath3); psVar10 = &sheetPath3; LAB_005ceaae: local_8 = 0xffffffff; std::string::_Tidy_deallocate(psVar10->_buf); RNG::Next(&this->_dropRNG); ANM2::Play(&this->_sprite,(&PTR_s_WombBreak1_00b63b88)[(uint)(this->_dropRNG)._seed % 3],0); break; case 0x2e: std::string::string_from_cstr (minesLava2Sheet._buf,(byte *)"gfx/Effects/Effect_062_GroundBreakMinesLava.png"); local_8 = 8; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&minesLava2Sheet); local_8 = 0xffffffff; std::string::_Tidy_deallocate(minesLava2Sheet._buf); } LAB_005d03cf: LAB_005d03dd: game = g_game; switch(this->_variant) { case 0x15: case 0x21: case 0x40: case 0x44: pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar6 = Room::GetBackdropType(pRVar11); if (iVar6 == 0x2d) { Color::Color(&defaultColor); Sprite::SetColor((Sprite *)&this->_sprite,color); } break; case 0x20: if (this->_spawnerEntity != (EntityPtr)0x0) { bVar2 = Entity::is_player((Entity *)this->_spawnerEntity); pEVar14 = effect; if (bVar2 != 0) { this->_scale = 1.3; } goto LAB_005d1317; } break; case 0x80: Entity::AddEntityFlags((Entity *)this,0x200000); ANM2::Play(&this->_sprite,s_Idle,0); break; case 0x82: game = (Game *)Config::GetCollectibles(); uVar7 = Game::GetStageID(game,0); if (uVar7 == 0x1c) { std::string::string_from_cstr (sheetPath._buf,(byte *)"gfx/monsters/repentance/810.000_small_leech_dross.png"); local_8 = 0x16; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath._buf); Sprite::LoadGraphics(); } break; case 0x84: if ((this->_subtype == 1) || (this->_subtype == 2)) goto LAB_005d049c; case 0x86: Level::GetCurrentRoom((Level *)g_game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)(iVar6 + 0x74)); break; case 0x85: this->_renderZOffset = -100; sprite = &this->_sprite; Level::GetCurrentRoom((Level *)game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)sprite,(ColorMod *)(iVar6 + 0x74)); spriteColor = (Font *)Sprite::Color((Sprite *)sprite); Sprite::Color((Sprite *)sprite); alpha = (float10)Color::A(); pRVar11 = (Room *)(float)(alpha * (float10)0.8); local_2c0.y = (float)pRVar11; LAB_005d130c: Font::SetLineHeightModifier(spriteColor,(float)pRVar11); break; case 0x87: bVar2 = 0; sprite = &this->_sprite; iVar6 = Isaac::Random(4); ANM2::Play(sprite,(&PTR_s_Drop01_00b63b24)[iVar6],bVar2); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar6 = Room::GetFrameCount(pRVar11); if (iVar6 == 0) { animState = (AnimationState *)Config::GetPillEffects(); iVar6 = AnimationState::GetAnimationLength(animState); iVar6 = Isaac::Random(iVar6); Sprite::SetFrame_1((Sprite *)sprite,iVar6); } Level::GetCurrentRoom((Level *)g_game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)sprite,(ColorMod *)(iVar6 + 0x74)); break; case 0x88: case 0x96: case 0xb1: case 0xb7: case 0xbb: case 0xc0: goto LAB_005d11c7; case 0x89: local_2b4 = (Entity_Familiar *)&this->_sprite; ANM2::Play((ANM2 *)local_2b4,s_Open,0); if (this->_subtype == 0) { this->_sortingLayer = 1; LAB_005d05aa: pEVar12 = local_2b4; } else { if (this->_subtype != 1) goto LAB_005d05aa; Level::GetCurrentRoom((Level *)g_game); FUN_00440ec0(); iVar6 = FUN_005cd620(); pEVar12 = local_2b4; Sprite::SetColor((Sprite *)local_2b4,(ColorMod *)(iVar6 + 0x74)); } game = (Game *)Config::GetCollectibles(); uVar7 = Game::GetStageID(game,0); if (uVar7 == 0x1c) { uVar7 = 0; iVar6 = Sprite::GetLayerCount((Sprite *)pEVar12); if (iVar6 != 0) { do { std::string::string_from_cstr (sheetPath._buf,(byte *)"gfx/bosses/repentance/wormwood_wallbreak_dross.png"); local_8 = 0x17; Sprite::ReplaceSpritesheet((Sprite *)pEVar12,uVar7,&sheetPath); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath._buf); uVar7 = uVar7 + 1; uVar15 = Sprite::GetLayerCount((Sprite *)pEVar12); } while (uVar7 < uVar15); } Sprite::LoadGraphics(); } break; case 0x8a: this->_renderZOffset = -0x80000000; goto LAB_005d0669; case 0x8c: case 0x9a: case 0x9c: goto LAB_005d0f6b; case 0x8d: sprite = &this->_sprite; local_2e4 = (Level *)sprite; if (this->_subtype == 1) { tmpColor = (ColorMod *)Color::Color(0x3f800000,0,0,0,0,0x3e4ccccd,0x3e4ccccd,0); Sprite::SetColor((Sprite *)sprite,tmpColor); } else { tmpColor = (ColorMod *)Color::Color(0x3f800000,0,0,0,0,0,0x3e4ccccd,0); Sprite::SetColor((Sprite *)sprite,tmpColor); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::IsBeastDungeon(pRVar11); if (bVar2 != 0) { tmpColor = (ColorMod *)Color::Color(0x3f800000,0,0,0,0,0,0x3e99999a,0); Sprite::SetColor((Sprite *)sprite,tmpColor); pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); Font::SetLineHeightModifier((Font *)&pLVar5->_color,0.5); } } spriteColor = (Font *)Sprite::Color((Sprite *)sprite); Font::SetLineHeightModifier(spriteColor,0.0); rng = &this->_dropRNG; fVar19 = RNG::RandomFloat(rng); local_2c0.y = fVar19 * 0.4 + 1.0; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); this_00 = local_2e4; Sprite::SetScale((Sprite *)local_2e4,vecResult); vecResult = Vector::Vector((Vector *)(auStack_2f0 + 8),0.0,-20.0); Sprite::set_offset((Sprite *)this_00,vecResult); uVar7 = RNG::RandomInt(rng,2); Sprite::set_flip_x((Sprite *)this_00,uVar7 != 0); ANM2::Play((ANM2 *)this_00,s_Idle,0); animState = (AnimationState *)Config::GetPillEffects(); uVar7 = AnimationState::GetAnimationLength(animState); uVar7 = RNG::RandomInt(rng,uVar7); Sprite::SetFrame_1((Sprite *)this_00,uVar7); break; case 0x8e: if (this->_subtype == 1) { this->_sortingLayer = 0; RNG::RandomInt(&this->_dropRNG,4); sprintf_s(local_28 + 4,0x10,(byte *)"Idle%d"); ANM2::Play(&this->_sprite,local_28 + 4,0); Level::GetCurrentRoom((Level *)g_game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)(iVar6 + 0x74)); colorTarget = (Color *)Sprite::Color((Sprite *)&this->_sprite); Color::SetOffset(colorTarget,0.3,0.3,0.3); } else { this->_renderDepthOffset = -14.0; Level::GetCurrentRoom((Level *)game); FUN_00440ec0(); iVar6 = FUN_005cd620(); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)(iVar6 + 0x74)); } break; case 0x8f: case 0x94: this->_visible = 0; this->_timeout = 0x78; Vector::operator_assign(&this->_targetPosition,&g_vectorZero); break; case 0x90: sprite = &this->_sprite; bVar2 = 0; if (this->_subtype == 0) { uVar7 = RNG::RandomInt(&this->_dropRNG,4); ANM2::Play(sprite,(&PTR_DAT_00b63b14)[uVar7],bVar2); game = g_game; this->_entityGridCollisionClass = 3; vecResult = &this->_pos; player = Game::GetNearestPlayer(game,vecResult); if (player != (Entity_Player *)0x0) { playerPos = Entity::Position((Entity *)player,&scratchVec); Sprite::set_flip_x((Sprite *)sprite, vecResult->x <= playerPos->x && playerPos->x != vecResult->x); } } else { ANM2::Play(sprite,(byte *)"Explosion",0); this->_renderDepthOffset = 100.0; if (this->_subtype == 2) { tmpColor = (ColorMod *) Color::Color(0x3f800000,0x3f800000,0x3f800000,0x3f800000,0x3f800000,0,0,0); Sprite::SetColor((Sprite *)sprite,tmpColor); } else if (this->_subtype == 3) { tmpColor = (ColorMod *) Color::Color(0x3f800000,0x3f400000,0x3f19999a,0x3f800000,0x3f800000,0,0,0); Sprite::SetColor((Sprite *)sprite,tmpColor); } } break; case 0x91: this->_isInitFlag176 = 1; uVar7 = RNG::RandomInt(&this->_dropRNG,2); Sprite::set_flip_x((Sprite *)&this->_sprite,uVar7 != 0); break; case 0x92: this->_isInitFlag176 = 1; uVar7 = RNG::RandomInt(&this->_dropRNG,2); Sprite::set_flip_x((Sprite *)&this->_sprite,uVar7 != 0); this->_lifespan = 0x1e; this->_timeout = 0x1e; ANM2::Play(&this->_sprite,(byte *)"Appear",0); if (this->_subtype == 0) { pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetFloorColorAt(pRVar11,&local_2d8,&this->_pos,this->_size); tmpColor = (ColorMod *)Color::Color(0x3f800000); Sprite::SetColor((Sprite *)&this->_sprite,tmpColor); } break; case 0x97: fVar19 = random_float(); iVar6 = this->_subtype; this->_rotation = fVar19 * 30.0 + 5.0; if (iVar6 == 0xb) { fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 360.0); this->_maxRadius = 100.0; this->_scale = 1.0; } else if (iVar6 == 10) { this->_maxRadius = 100.0; std::string::string_from_cstr(sheetPath._buf,(byte *)"gfx/effects/shockwave.png"); local_8 = 0x18; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath._buf); this->_scale = 1.0; } else { if (iVar6 == 0) { fVar19 = random_float(); this->_maxRadius = fVar19 * 0.4 + 1.2; } else { fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 360.0); this->_maxRadius = 20.0; if (this->_spawnerType == 0x3b7) { fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 80.0 + 140.0); this->_scale = 1.0; break; } } this->_scale = 1.0; } break; case 0x98: this->_visible = 0; goto LAB_005d0f6b; case 0x9b: this->_sortingLayer = 0; this->_renderZOffset = 2000; this->_isInitFlag176 = 1; this->_scale = 0.033; break; case 0x9d: goto LAB_005d11e7; case 0x9e: ANM2::Play(&this->_sprite,s_Idle,0); fVar19 = random_float(); fVar19 = normalize_angle_degrees(fVar19 * 360.0); this->_rotation = fVar19; local_2c0.y = fVar19 + 180.0; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); pLVar5->_rotation = local_2c0.y; this->_height = 0.0; this->_isInitFlag176 = 1; break; case 0x9f: Vector::operator_assign(&this->_targetPosition,&this->_pos); fVar19 = random_float(); fVar19 = normalize_angle_degrees(fVar19 * 360.0); this->_rotation = fVar19; ANM2::Play(&this->_sprite,s_Idle,0); fVar19 = RNG::RandomFloat(&this->_dropRNG); local_2c0.y = fVar19 * 0.2 + 1.0; vecResult = Vector::operator_mul(&scratchVec,&local_2c0.y,&g_vectorOne); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); uVar7 = RNG::RandomInt(&this->_dropRNG,2); Sprite::set_flip_x((Sprite *)&this->_sprite,uVar7 != 0); local_2c0.y = RNG::RandomFloat(&this->_dropRNG); set_PlaybackSpeed(&this->_sprite,local_2c0.y * 0.3 + 1.0); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar17 = Room::GetBackdropType(pRVar11); switch(uVar17) { case 0x21: case 0x26: case 0x28: case 0x29: case 0x2a: tmpColor = (ColorMod *)Color::Color(0x3f800000); Sprite::SetColor((Sprite *)&this->_sprite,tmpColor); } spriteColor = (Font *)Sprite::Color((Sprite *)&this->_sprite); fVar19 = RNG::RandomFloat(&this->_dropRNG); local_2c0.y = fVar19 * 0.3 + 0.3; Font::SetLineHeightModifier(spriteColor,local_2c0.y); this->_isInitFlag176 = 1; break; case 0xa1: iVar6 = this->_subtype; if (iVar6 == 0) { uVar21 = 0x3f000000; uVar20 = 0x3fe66666; uVar17 = 0x40133333; LAB_005d10c7: tmpColor = (ColorMod *)Color::Color(0x3f800000,uVar17,uVar20,uVar21,0x3f800000,0,0,0); Sprite::SetColor((Sprite *)&this->_sprite,tmpColor); } else { if (iVar6 == 1) { uVar21 = 0x3ecccccd; uVar20 = 0x3ecccccd; uVar17 = 0x40000000; goto LAB_005d10c7; } if (iVar6 == 2) { uVar21 = 0x40000000; uVar20 = 0x3f99999a; uVar17 = 0x3f800000; goto LAB_005d10c7; } if (iVar6 == 3) { uVar21 = 0; uVar20 = 0x3fe66666; uVar17 = 0; goto LAB_005d10c7; } } this->_sortingLayer = 0; this->_state = 0; ANM2::Play(&this->_sprite,(byte *)"Opened",0); animState = (AnimationState *)Config::GetPillEffects(); uVar7 = AnimationState::GetAnimationLength(animState); uVar7 = RNG::RandomInt(&this->_dropRNG,uVar7); Sprite::SetFrame_1((Sprite *)&this->_sprite,uVar7); break; case 0xa2: goto LAB_005d1bff; case 0xa4: this->_renderDepthOffset = 80.0; spriteColor = (Font *)Sprite::Color((Sprite *)&this->_sprite); Font::SetLineHeightModifier(spriteColor,0.6); goto LAB_005d0669; case 0xa5: BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,blendMode); pEVar14 = effect; if (this->_subtype == 1) { this->_sortingLayer = 0; } else { this->_renderDepthOffset = 4.0; } goto LAB_005d1317; case 0xa6: this->_renderZOffset = -0x80000000; local_2c0.y = (float)operator_new(0x18); local_8 = 0x19; if ((Room *)local_2c0.y == (Room *)0x0) { uVar17 = 0; } else { uVar17 = FUN_005d2270(); } local_8 = 0xffffffff; ExtraDataRef::Set(uVar17); this->_minRadius = 0.1; goto LAB_005d0669; case 0xa7: SetTimeout(this,1); this->_maxRadius = 130.0; this->_minRadius = 130.0; *(undefined4 *)&this->field_0x430 = 0x40600000; *(undefined4 *)&this->field_0x434 = 0x3f800000; FUN_00435bc0(0,0); *(undefined4 *)&(this->_varData)._l = local_28._4_4_; *(float *)((int)&(this->_varData)._l + 4) = (float)local_20; *(float *)&(this->_varData)._h = local_20._4_4_; *(int *)((int)&(this->_varData)._h + 4) = local_18; goto LAB_005d11c7; case 0xa8: this->_sortingLayer = 0; this->_renderZOffset = 2000; goto LAB_005d11e7; case 0xaa: this->_sortingLayer = 0; sprite = &this->_sprite; ANM2::PlayOverlay(sprite,(byte *)"Float",0); rng = &effect->_dropRNG; animState = (AnimationState *)FUN_0041e470(); uVar7 = AnimationState::GetAnimationLength(animState); uVar7 = RNG::RandomInt(rng,uVar7); ANM2::SetOverlayFrame(sprite,uVar7); ANM2::SetFrame(sprite,(std_string *)s_Idle,0); animState = (AnimationState *)Config::GetPillEffects(); uVar7 = AnimationState::GetAnimationLength(animState); uVar7 = RNG::RandomInt(rng,uVar7); Sprite::SetFrame_1((Sprite *)sprite,uVar7); uVar7 = RNG::RandomInt(rng,2); Sprite::set_flip_x((Sprite *)sprite,uVar7 != 0); Entity::AddEntityFlags((Entity *)effect,0x200000); break; case 0xab: if (this->_subtype == 2) { ANM2::Play(&this->_sprite,(byte *)"Swirl",0); local_2c0.y = 3.0; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 360.0); spriteColor = (Font *)Sprite::Color((Sprite *)&this->_sprite); pRVar11 = (Room *)0x0; LAB_005d130a: goto LAB_005d130c; } if (this->_subtype == 1) { ANM2::Play(&this->_sprite,(byte *)"Trail",0); fVar19 = random_float(); local_2c0.y = fVar19 * 0.5 + 0.5; fVar19 = random_float(); vecResult = Vector::Vector(&scratchVec,fVar19 + 1.0,local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 360.0); } else { Entity::AddEntityFlags((Entity *)this,0x200000); Entity::AddFlagsLow((Entity *)&this->_sprite,0x20); ANM2::Play(&this->_sprite,(byte *)"IdleClosed",0); this->_timeout = 0x2d; } break; case 0xac: if (this->_subtype == 2) { ANM2::Play(&this->_sprite,(byte *)"Swirl",0); local_2c0.y = 0.7; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); fVar19 = random_float(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar19 * 360.0); spriteColor = (Font *)Sprite::Color((Sprite *)&this->_sprite); pRVar11 = (Room *)0x3f800000; goto LAB_005d130a; } if (this->_subtype != 1) { Entity::AddEntityFlags((Entity *)this,0x200000); Entity::AddFlagsLow((Entity *)&this->_sprite,0x20); BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x2); copy_20_bytes(pLVar5->_blendMode,blendMode); ANM2::Play(&this->_sprite,s_Open,0); this->_minRadius = 0.0; break; } ANM2::SetFrame(&this->_sprite,(std_string *)&DAT_00b635b8,0); pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); pLVar5->_visible = 0; BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,blendMode); BlendMode::SetMode(local_28,2,0); blendMode = (KColor *)local_28; pbVar4 = (byte *)0x1; goto LAB_005d0681; case 0xad: case 0xc9: this->_renderDepthOffset = 10.0; break; case 0xae: Entity::AddEntityFlags((Entity *)this,0x200000); ANM2::Play(&this->_sprite,s_Idle,0); game = g_game; this->_renderDepthOffset = -100.0; pRVar11 = (Room *)Level::GetCurrentRoom((Level *)game); iVar6 = Room::GetFrameCount(pRVar11); if (1 < iVar6) { isReplaced = '\0'; Level::GetCurrentRoom((Level *)g_game); this_01 = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(this_01,(EntityList_EL *)auStack_2f0,1000,0xae,-1,0,0); local_8 = 0x1a; pEVar12 = (Entity_Familiar *)0x0; local_2b4 = (Entity_Familiar *)0x0; iVar6 = EntityList::Size(); if (iVar6 == 0) { LAB_005d1763: RNG::game_constructor((RNG *)(local_28 + 4),this->_initSeed,0x12); local_8 = CONCAT31(local_8._1_3_,0x1b); uVar7 = RNG::Next(this_02); tmpEntity = Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); guard_check_icall(); } else { do { piVar18 = (int *)std::vector::operator_index(pEVar12); if (*(int *)(*piVar18 + 0x450) != 0) { local_2c0.y = (float)Level::GetCurrentRoom((Level *)g_game); listEntry = (undefined4 *)std::vector::operator_index(pEVar12); vecResult = Entity::Position((Entity *)*listEntry,&scratchVec); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar6 = Room::GetGridIndex(pRVar11,&effect->_pos); iVar8 = Room::GetGridIndex((Room *)local_2c0.y,vecResult); pEVar12 = local_2b4; if (iVar8 == iVar6) { listEntry = (undefined4 *)std::vector::operator_index(local_2b4); (**(code **)(*(int *)*listEntry + 0x28))(); isReplaced = '\x01'; } } pEVar12 = (Entity_Familiar *)&pEVar12->field_0x1; local_2b4 = pEVar12; puVar16 = (undefined1 *)EntityList::Size(); } while (pEVar12 < puVar16); if (isReplaced == '\0') { this = effect; goto LAB_005d1763; } } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(auStack_2f0); } break; case 0xb2: this->_timeout = -1; this->_scale = 0.0; Entity::AddEntityFlags((Entity *)this,0x2000200000); break; case 0xb3: BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,blendMode); pEVar14 = effect; fVar19 = RNG::RandomFloat(&effect->_dropRNG); local_2c0.y = fVar19 * 0.3 + 0.9; vecResult = Vector::__mul(&g_vectorOne,&scratchVec,&local_2c0.y); Sprite::SetScale((Sprite *)&this->_sprite,vecResult); fVar19 = RNG::RandomFloat(&pEVar14->_dropRNG); pEVar14->_scale = fVar19 * 0.08 + 0.06; goto LAB_005d1317; case 0xb4: this->_renderDepthOffset = -100.0; break; case 0xb5: this->_renderZOffset = 1000; LAB_005d0669: BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pbVar4 = (byte *)0x0; LAB_005d0681: pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,pbVar4); copy_20_bytes(pLVar5->_blendMode,blendMode); break; case 0xb9: BlendMode::SetMode(local_b4._buf + 4,2,0); pvVar13 = extraout_EAX_10; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); copy_20_bytes(pLVar5->_blendMode,pvVar13); this->_renderDepthOffset = -10.0; ANM2::Play(&this->_sprite,s_Idle,0); break; case 0xba: if (this->_subtype == 1) { std::string::string_from_cstr(sheetPath._buf,(byte *)"gfx/Effects/spookier_ghost_white.png"); local_8 = 0x1c; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&sheetPath); local_8 = 0xffffffff; std::string::_Tidy_deallocate(sheetPath._buf); } ANM2::Play(&this->_sprite,(byte *)"Appear",0); break; case 0xbc: this->_visible = 0; this->_state = 0; break; case 0xbd: if (this->_subtype != 0) goto LAB_005d11e7; RNG::game_constructor((RNG *)(local_28 + 4),this->_initSeed,8); local_8 = 0x1d; uVar7 = RNG::RandomInt((RNG *)(local_28 + 4),4); uVar15 = RNG::RandomInt((RNG *)(local_28 + 4),2); Sprite::set_flip_x((Sprite *)&this->_sprite,uVar15 != 0); sprite = &this->_sprite; local_2b8 = (LayerState *)((float)(int)uVar7 * 64.0); pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); (pLVar5->_cropOffset).y = (float)local_2b8; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); (pLVar5->_cropOffset).y = (float)local_2b8; pvVar13 = (void *)FUN_00a11590(0,2,0); pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); copy_20_bytes(pLVar5->_blendMode,pvVar13); ANM2::Play(sprite,(byte *)"Appear",0); local_8 = 0xffffffff; effect->_sortingLayer = 0; guard_check_icall(); break; case 0xbe: case 0xc6: BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,blendMode); BlendMode::SetMode(local_28,2,0); puVar16 = local_28; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); copy_20_bytes(pLVar5->_blendMode,puVar16); pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); pLVar5->_visible = 0; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); pLVar5->_visible = 0; vecResult = Vector::Vector(&scratchVec,0.0,-20.0); Vector::operator_assign(&this->_posOffset,vecResult); break; case 0xbf: local_2c0.y = (float)operator_new(0x458); local_8 = 0x1e; if ((Room *)local_2c0.y == (Room *)0x0) { uVar17 = 0; } else { uVar17 = FUN_005d2300(); } local_8 = 0xffffffff; ExtraDataRef::Set(uVar17); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::is_type_16(pRVar11); pEVar14 = effect; if (bVar2 == 0) { this->_renderDepthOffset = 10.0; } else { this->_renderZOffset = 10000; } goto LAB_005d1317; case 0xc1: this->_state = 0; ANM2::Play(&this->_sprite,s_Idle,0); if (this->_subtype == 0) { this->_visible = 0; pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x1); pLVar5->_visible = 0; } else { pLVar5 = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); pLVar5->_visible = 0; } break; case 0xc2: this->_state = 0; ANM2::Play(&this->_sprite,(byte *)"Shadow",0); goto LAB_005d1bff; case 0xc5: ANM2::Play(&this->_sprite,(byte *)"Flying",0); break; case 199: ANM2::Play(&this->_sprite,&DAT_00b602e8,0); break; case 200: LAB_005d049c: Entity::AddFlagsLow((Entity *)&this->_sprite,0x20); } LAB_005d1311: pEVar14 = effect; LAB_005d1317: sprite = &pEVar14->_sprite; Sprite::LoadGraphics(); iVar6 = effect->_variant; if ((iVar6 == 0xbe) || (iVar6 == 0xc6)) { pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_minFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_magFilterMode = 1; iVar6 = effect->_variant; } if (iVar6 == 0x3b) { pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_minFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_magFilterMode = 1; iVar6 = effect->_variant; } if ((iVar6 == 0x1e) || (iVar6 == 0x99)) { *(undefined4 *)((int)&(effect->_varData)._l + 4) = 0; *(undefined4 *)&(effect->_varData)._h = 0; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_wrapSMode = 0; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_wrapTMode = 1; if (effect->_variant == 0x99) { colorTarget = &defaultColor; } else { colorTarget = &scratchColor; } Color::Color(colorTarget); Sprite::SetColor((Sprite *)sprite,color_00); iVar6 = effect->_variant; } if (iVar6 == 0xa0) { pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_wrapSMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_wrapTMode = 0; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_visible = 0; effect->_renderDepthOffset = 4.0; pEVar14 = effect; } else if (iVar6 == 0xaf) { Entity::AddEntityFlags((Entity *)effect,0x200000); ANM2::Play(sprite,s_Idle,0); BlendMode::SetMode(&local_2d8,2,0); blendMode = &local_2d8; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,blendMode); pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_visible = 0; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_wrapSMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_wrapTMode = 0; BlendMode::SetMode(local_28,2,0); puVar16 = local_28; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); copy_20_bytes(pLVar5->_blendMode,puVar16); pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_visible = 0; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_wrapSMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_wrapTMode = 0; BlendMode::SetMode(local_2f4,2,0); puVar16 = local_2f4; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x2); copy_20_bytes(pLVar5->_blendMode,puVar16); pEVar14 = effect; pcVar1 = *(code **)(*(int *)effect + 0x3c); uVar17 = Color::Color(0x3f800000); (*pcVar1)(uVar17,0xffffffff,0xff,0,1); } else { if (iVar6 == 0xc1) { pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_wrapSMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x1); pLVar5->_wrapTMode = 0; } else if (iVar6 == 0xc4) { effect->_sortingLayer = 0; BlendMode::SetMode(local_31c,2,0); puVar16 = local_31c; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); copy_20_bytes(pLVar5->_blendMode,puVar16); pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_minFilterMode = 1; pLVar5 = Sprite::GetLayer((Sprite *)sprite,(byte *)0x0); pLVar5->_magFilterMode = 1; } pEVar14 = effect; } Game::GetField26614(g_game); cVar3 = FUN_00429550(); if (cVar3 != '\0') { Game::GetField26614(g_game); piVar18 = (int *)EntityList::Size(); (**(code **)(*piVar18 + 0x44))(pEVar14); } FUN_00861330(pEVar14); ExceptionList = local_10; return; LAB_005d1bff: this->_sortingLayer = 0; goto LAB_005d1311; LAB_005d11e7: ANM2::Play(&this->_sprite,(byte *)"Appear",0); goto LAB_005d1311; LAB_005d0f6b: Entity::AddEntityFlags((Entity *)this,0x200000); goto LAB_005d1311; LAB_005d11c7: this->_visible = 0; goto LAB_005d1311; } //@@ 005d2270 FUN_005d2270 void FUN_005d2270(void) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af61dd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; puVar1 = in_ECX + 1; *in_ECX = IsaacRepentancePlus::SpriteTrailData::vftable; *puVar1 = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; puVar2 = operator_new(8); puVar2[1] = 0; *puVar1 = puVar2; *puVar2 = puVar1; ExceptionList = local_10; return; } //@@ 005d2300 FUN_005d2300 void FUN_005d2300(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af620d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; *in_ECX = IsaacRepentancePlus::PickupGhostData::vftable; _eh_vector_constructor_iterator_(in_ECX + 1,0x114,4,ANM2::constructor,ANM2::~ANM2); ExceptionList = local_10; return; } //@@ 005d2370 FUN_005d2370 void FUN_005d2370(byte param_1) { undefined4 *in_ECX; FUN_0060c580(); *in_ECX = IsaacRepentancePlus::Entity_Effect::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } return; } //@@ 005d23a0 FUN_005d23a0 void FUN_005d23a0(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; _eh_vector_destructor_iterator_(in_ECX + 1,0x114,4,ANM2::~ANM2); *in_ECX = IsaacRepentancePlus::Entity_Effect::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x458); } ExceptionList = local_10; return; } //@@ 005d2420 Entity_Effect::Remove /* ZHL [vtable slot 10] */ void __thiscall Entity_Effect::Remove(Entity_Effect *this) { uint uVar1; Entity_Effect *pEVar2; undefined4 *ptr; bool bVar3; bool bVar4; uint uVar5; bVar3 = false; bVar4 = false; uVar5 = 0; uVar1 = *(uint *)((int)g_game->_room + 0x1264); if (uVar1 != 0) { bVar4 = false; do { pEVar2 = *(Entity_Effect **)(*(int *)((int)g_game->_room + 0x125c) + uVar5 * 4); if ((pEVar2->_type == 1000) && (pEVar2 != this)) { if (pEVar2->_variant == 0x3c) { bVar3 = true; } else if (pEVar2->_variant == 0xa1) { bVar4 = true; } } uVar5 = uVar5 + 1; } while (uVar5 < uVar1); if (bVar3) goto LAB_005d24ab; } SFXManager::Stop(&g_manager->_sfxManager,0x345); LAB_005d24ab: if (!bVar4) { SFXManager::Stop(&g_manager->_sfxManager,0x34e); } this->_exists = 0; if (this->_dead == 0) { this->_dead = 1; } Entity::ReleaseLuaRef(this); ptr = this->_luaBridgeRef; if (ptr != (undefined4 *)0x0) { luaL_unref(*ptr,0xfff0b9d8,ptr[1]); operator_delete(ptr,8); this->_luaBridgeRef = (void *)0x0; } return; } //@@ 005d2520 Entity_Effect::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_Effect::Interpolate(Entity_Effect *this) { byte isEnemy; LayerState *layer; float fVar1; float fVar2; Vector scratchVec; EntityPtr linkedEntity; if (this->_pauseTimer == 0) { Entity::Interpolate((Entity *)this); if ((this->_isFollowing != 0) && (linkedEntity = this->_parent, linkedEntity != (EntityPtr)0x0)) { fVar1 = *(float *)((int)linkedEntity + 0x340); fVar2 = (this->_parentOffset).y; (this->_pos).x = *(float *)((int)linkedEntity + 0x33c) + (this->_parentOffset).x; (this->_pos).y = fVar1 + fVar2; (this->_posOffset).x = *(float *)((int)linkedEntity + 0x34c); (this->_posOffset).y = *(float *)((int)linkedEntity + 0x350); } switch(this->_variant) { case 4: case 5: case 0x1b: case 0x23: case 0x3a: case 0x55: case 0x56: case 0x5f: case 0x62: case 0xa3: if (*(int *)((int)g_game->_room + 8) != 0x10) { LAB_005d2702: (this->_posOffset).y = this->_fallingSpeed * this->_speedMultiplier * 0.5 + (this->_posOffset).y; return; } break; case 0x1e: case 0x99: if (this->_subtype == 0) { Room::GetClampedPositionImpl(g_game->_room,&scratchVec,&this->_pos,0.0,0.0,0.0,0.0); (this->_pos).x = scratchVec.x; (this->_pos).y = scratchVec.y; } linkedEntity = this->_spawnerEntity; if ((linkedEntity != (EntityPtr)0x0) && (((*(int *)((int)linkedEntity + 0x28) == 1 || (isEnemy = Entity::IsEnemy((Entity *)linkedEntity), isEnemy != 0)) && (this->_lifespan == 0)))) { scratchVec.x = ((Vector *)((int)linkedEntity + 0x33c))->x - (this->_pos).x; fVar1 = *(float *)((int)linkedEntity + 0x340) - (this->_pos).y; fVar2 = atan2f(fVar1,scratchVec.x); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_rotation = fVar2 * 57.295776; fVar1 = sqrtf(fVar1 * fVar1 + scratchVec.x * scratchVec.x); this->_scale = fVar1; return; } break; case 0x1f: (this->_posOffset).y = (float)-this->_timeout * 100.0 - 50.0; return; case 0x51: (this->_posOffset).y = this->_fallingSpeed * 0.5 * this->_speedMultiplier + this->_height; return; case 0x76: if (0 < this->_state) goto LAB_005d2702; break; case 0x7b: linkedEntity = this->_parent; if ((linkedEntity != (EntityPtr)0x0) && ((this->_subtype == 4 || (this->_subtype == 7)))) { fVar1 = *(float *)((int)linkedEntity + 0x340); (this->_pos).x = *(float *)((int)linkedEntity + 0x33c); (this->_pos).y = fVar1; fVar1 = *(float *)((int)linkedEntity + 0x364); (this->_velocity).x = *(float *)((int)linkedEntity + 0x360); (this->_velocity).y = fVar1; (this->_posOffset).x = *(float *)((int)linkedEntity + 0x34c); (this->_posOffset).y = *(float *)((int)linkedEntity + 0x350); return; } break; case 0xaf: linkedEntity = this->_target; if (linkedEntity != (EntityPtr)0x0) { fVar1 = *(float *)((int)linkedEntity + 0x340); (this->_pos).x = *(float *)((int)linkedEntity + 0x33c); (this->_pos).y = fVar1; } (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; return; case 0xb2: update_variant178_shooter(this,1); return; case 0xb9: linkedEntity = this->_parent; if (linkedEntity != (EntityPtr)0x0) { fVar1 = *(float *)((int)linkedEntity + 0x340); (this->_pos).x = *(float *)((int)linkedEntity + 0x33c); (this->_pos).y = fVar1; fVar1 = *(float *)((int)linkedEntity + 0x364); (this->_velocity).x = *(float *)((int)linkedEntity + 0x360); (this->_velocity).y = fVar1; (this->_posOffset).x = *(float *)((int)linkedEntity + 0x34c); (this->_posOffset).y = *(float *)((int)linkedEntity + 0x350); (this->_sprite)._scale.x = *(float *)((int)linkedEntity + 0xe4); (this->_sprite)._scale.y = *(float *)((int)linkedEntity + 0xe8); } } } return; } //@@ 005d29b0 FUN_005d29b0 void FUN_005d29b0(void) { Vector *position; int in_ECX; float fVar1; float fVar2; float fVar3; Vector local_10; position = (Vector *)(in_ECX + 0x33c); fVar2 = *(float *)(in_ECX + 0x410) + 5.0; Room::GetClampedPositionImpl(g_game->_room,&local_10,position,fVar2,fVar2,fVar2,fVar2); fVar1 = local_10.x - position->x; fVar3 = local_10.y - *(float *)(in_ECX + 0x340); fVar2 = fVar3 * fVar3 + fVar1 * fVar1; if (((0.0 < fVar2) && (fVar2 < 100.0)) && (0.0 < *(float *)(in_ECX + 0x414))) { *(float *)(in_ECX + 0x360) = fVar1; *(float *)(in_ECX + 0x364) = fVar3; position->x = local_10.x; *(float *)(in_ECX + 0x340) = local_10.y; } return; } //@@ 005d2a70 Entity_Effect::update_mr_me /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Entity_Effect: __RTDynamicCast(_extraData +0x4b4 -> MrMeData) else return; anims Float/Carry/HideItem/ShopIdle/Broken, follows parent player _markedTarget/_aimDirection, TryOpenChest, GridEntity_Door::TryUnlock/Open, AnimateCollectible, SpawnEx: Mr. ME ghost effect update */ void __thiscall Entity_Effect::update_mr_me(Entity_Effect *this) { Vector *pos; undefined4 savedParentX; undefined4 savedParentY; byte curChar; GridEntity *gridEntity; Game *game; Manager *manager; char cVar7; int mrMeData; Entity_Player *pEVar9; int *targetEffect; GridEntity_Door *door; int iVar12; float *vecResult; int iVar14; byte *animNameCursor; uint uVar16; ItemConfig_Item *itemConfig; undefined4 *gridPos; Entity_Pickup *pickup; ColorMod *explosionColor; void *pvVar20; int extraout_ECX; char *literalCursor; float *extraout_ECX_00; EntityPtr EVar22; bool isLess; float fVar24; float fVar25; float fVar26; float fVar27; float fVar28; undefined1 pickupSpriteCopy [220]; float fStack_cc; float bestDistSq; float local_74; float local_70; float local_60; EntityPtr local_5c; float moveY; float moveX; float local_50; float local_48; float local_44; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af6230; local_10 = ExceptionList; ExceptionList = &local_10; mrMeData = __RTDynamicCast(); if (mrMeData == 0) { ExceptionList = local_10; return; } iVar14 = this->_state; moveX = g_vectorZero.x; moveY = g_vectorZero.y; if (iVar14 == 0) { if (this->_parent == (EntityPtr)0x0) goto LAB_005d3f7c; ANM2::Play(&this->_sprite,(byte *)"Float",0); fVar26 = *(float *)((int)this->_parent + 0x340) - (this->_pos).y; fVar24 = *(float *)((int)this->_parent + 0x33c) - (this->_pos).x; bestDistSq = 0.0; fVar28 = fVar26 * fVar26 + fVar24 * fVar24; if (fVar28 <= 4900.0) { (this->_velocity).x = (this->_velocity).x * 0.9; (this->_velocity).y = (this->_velocity).y * 0.9; } else { sqrtf(); if (fVar28 <= 0.0) { moveY = fVar26; moveX = fVar24; } else { moveY = (6.0 / fVar28) * fVar26; moveX = fVar24 * (6.0 / fVar28); } } if (((this->_target != (EntityPtr)0x0) && (this->_parent != (EntityPtr)0x0)) && (*(int *)((int)this->_parent + 0x28) == 1)) { pEVar9 = (Entity_Player *)__RTDynamicCast(); targetEffect = (int *)__RTDynamicCast(); pvVar20 = pEVar9->_markedTarget; if (pvVar20 == (void *)0x0) { fVar24 = (pEVar9->_aimDirection).y * 20.0; fVar28 = (pEVar9->_aimDirection).x * 20.0; } else { fVar24 = *(float *)((int)pvVar20 + 0x340) - (float)targetEffect[0xd0]; fVar28 = *(float *)((int)pvVar20 + 0x33c) - (float)targetEffect[0xcf]; targetEffect[0xd5] = 100; } targetEffect[0xd8] = (int)fVar28; targetEffect[0xd9] = (int)fVar24; (**(code **)(*targetEffect + 0x3c))(); fVar24 = *(float *)((int)this->_target + 0x340); (this->_targetPosition).x = *(float *)((int)this->_target + 0x33c); (this->_targetPosition).y = fVar24; if ((*(char *)((int)this->_target + 0x172) != '\0') && (*(char *)((int)this->_target + 0x173) == '\0')) { *(int *)(mrMeData + 0x124) = *(int *)(mrMeData + 0x124) + 1; goto LAB_005d3f7c; } Entity_Player::AnimateCollectible(pEVar9); (**(code **)(*(int *)pEVar9 + 0xc))(); game = g_game; local_44 = -NAN; fVar26 = 0.0; local_48 = 0.0; *(undefined4 *)(mrMeData + 4) = 0; *(undefined4 *)(mrMeData + 0x120) = 0xffffffff; fVar28 = g_vectorZero.y; fVar24 = g_vectorZero.x; *(undefined1 *)(mrMeData + 0x128) = 0; pvVar20 = game->_room; local_50 = fVar24; local_74 = fVar28; local_5c = (EntityPtr)0x0; if (0 < *(int *)((int)pvVar20 + 0x10) * *(int *)((int)pvVar20 + 0xc)) { local_70 = 5.04467e-44; do { if ((uint)local_5c < 0x1c0) { iVar14 = *(int *)((int)pvVar20 + (int)local_70); if (iVar14 == 0) goto LAB_005d2e6b; uVar16 = *(uint *)(iVar14 + 0xc); fVar26 = local_48; if (uVar16 == 2) goto LAB_005d2e6b; iVar12 = *(int *)(iVar14 + 4); if (((iVar12 != 4) && (iVar12 != 0x16)) && ((iVar12 != 6 && (iVar12 != 0x1a)))) { if (iVar12 == 0xc) { if (uVar16 < 4) goto LAB_005d314d; } else if (iVar12 == 0x10) { if (*(int *)&g_game->_deathmatchManager < 2) { if (g_game->_currentRoomIdx != -0x14) { door = (GridEntity_Door *)__RTDynamicCast(); fVar24 = local_50; fVar28 = local_74; if ((((door->_doorFlags & 0x50U) == 0) && ((((door->_doorFlags & 0x20U) == 0 || ((door->_desc)._variant != 4)) && (iVar12 = GridEntity_Door::get_secret_exit_kind(door), iVar12 != 4))) ) && ((door->_desc)._state != 2)) { iVar14 = *(int *)(iVar14 + 0x24); local_48 = 2.8026e-45; iVar12 = *(int *)((int)g_game->_room + 0xc); vecResult = (float *)Isaac::GetAxisAlignedUnitVectorFromDir(); local_44 = (float)local_5c; local_50 = ((float)(iVar14 % iVar12) * 40.0 + 40.0) - *vecResult * 20.0; local_74 = ((float)(iVar14 / iVar12) * 40.0 + 120.0) - vecResult[1] * 20.0; fVar24 = local_50; fVar28 = local_74; if (((door->_currentRoomType == 7) || (door->_targetRoomType == 7)) || ((door->_currentRoomType == 8 || (fVar26 = local_48, door->_targetRoomType == 8)))) { local_48 = 1.4013e-45; fVar26 = (float)1; } } } } } else if (iVar12 == 0x14) { if (uVar16 == 0) { local_48 = 5.60519e-45; fVar26 = 5.60519e-45; fVar24 = (float)(*(int *)(iVar14 + 0x24) % *(int *)((int)pvVar20 + 0xc)) * 40.0 + 40.0; fVar28 = (float)(*(int *)(iVar14 + 0x24) / *(int *)((int)pvVar20 + 0xc)) * 40.0 + 120.0; local_74 = fVar28; local_50 = fVar24; local_44 = (float)local_5c; goto LAB_005d2e6e; } } goto LAB_005d2e6b; } LAB_005d314d: fVar26 = 1.4013e-45; local_48 = 1.4013e-45; fVar24 = (float)(*(int *)(iVar14 + 0x24) % *(int *)((int)pvVar20 + 0xc)) * 40.0 + 40.0; fVar28 = (float)(*(int *)(iVar14 + 0x24) / *(int *)((int)pvVar20 + 0xc)) * 40.0 + 120.0; local_74 = fVar28; local_50 = fVar24; local_44 = (float)local_5c; } else { LAB_005d2e6b: } LAB_005d2e6e: EVar22 = this->_target; if ((EVar22 != (EntityPtr)0x0) && ((fVar25 = *(float *)((int)EVar22 + 0x33c) - fVar24, fVar27 = *(float *)((int)EVar22 + 0x340) - fVar28, fVar25 = fVar27 * fVar27 + fVar25 * fVar25, *(int *)(mrMeData + 4) == 0 || (fVar25 < bestDistSq)))) { *(float *)(mrMeData + 4) = fVar26; (this->_targetPosition).x = fVar24; (this->_targetPosition).y = fVar28; *(float *)(mrMeData + 0x120) = local_44; bestDistSq = fVar25; } local_5c = (EntityPtr)((int)local_5c + 1); local_70 = (float)((int)local_70 + 4); pvVar20 = g_game->_room; } while ((int)local_5c < *(int *)((int)pvVar20 + 0x10) * *(int *)((int)pvVar20 + 0xc)); } local_50 = 0.0; pvVar20 = g_game->_room; local_44 = g_vectorZero.x; local_48 = g_vectorZero.y; local_5c = (EntityPtr)0x0; local_60 = 0.0; fVar24 = g_vectorZero.x; fVar28 = g_vectorZero.y; if (*(int *)((int)pvVar20 + 0x1264) != 0) { do { EVar22 = *(EntityPtr *)(*(int *)((int)pvVar20 + 0x125c) + (int)local_60 * 4); iVar14 = *(int *)((int)EVar22 + 0x28); if (iVar14 == 0x21) { if ((*(float *)((int)EVar22 + 0x380) <= 1.0) || (*(uint *)((int)EVar22 + 0x2c) < 2)) goto LAB_005d31b7; LAB_005d2f78: fVar24 = *(float *)((int)EVar22 + 0x33c); fVar28 = *(float *)((int)EVar22 + 0x340); local_50 = 1.4013e-45; local_5c = EVar22; local_48 = fVar28; local_44 = fVar24; } else { if ((iVar14 == 0x11) || ((iVar14 == 0x124 && (1.0 < *(float *)((int)EVar22 + 0x380))))) goto LAB_005d2f78; LAB_005d31b7: if ((*(int *)&g_game->_deathmatchManager < 2) || (iVar14 != 1)) { if (iVar14 - 10U < 0x3de) goto LAB_005d31d8; LAB_005d3260: if (((*(char *)((int)EVar22 + 0x172) == '\0') || (*(int *)((int)EVar22 + 0x28) != 5)) || (*(char *)((int)EVar22 + 0x171) == '\0')) { if (*(int *)((int)EVar22 + 0x28) == 6) { if ((*(int *)((int)EVar22 + 0x7c) != 0) && (*(char *)((int)EVar22 + 0x8c) != '\0') ) { animNameCursor = *(byte **)((int)EVar22 + 0x7c); if (0xf < *(uint *)(animNameCursor + 0x14)) { animNameCursor = *(byte **)animNameCursor; } literalCursor = "Broken"; do { curChar = *animNameCursor; isLess = curChar < (byte)*literalCursor; if (curChar != *literalCursor) { LAB_005d3386: uVar16 = -(uint)isLess | 1; goto LAB_005d338b; } if (curChar == 0) break; curChar = animNameCursor[1]; isLess = curChar < (byte)literalCursor[1]; if (curChar != literalCursor[1]) goto LAB_005d3386; animNameCursor = animNameCursor + 2; literalCursor = literalCursor + 2; } while (curChar != 0); uVar16 = 0; LAB_005d338b: if (uVar16 == 0) goto LAB_005d3396; } goto LAB_005d2f78; } } else { iVar14 = *(int *)((int)EVar22 + 0x2c); if (iVar14 == 100) { if (*(int *)((int)EVar22 + 0x30) == 0) goto LAB_005d32c7; LAB_005d32e3: iVar14 = PlayerManager::FirstCollectibleOwner(); if (iVar14 != 0) { *(undefined1 *)(mrMeData + 0x128) = 1; } } else if (((((iVar14 != 300) && (iVar14 != 0x46)) && (iVar14 != 0x15e)) && ((iVar14 != 0x45 && (iVar14 != 0x14)))) && (((iVar14 != 10 && ((iVar14 != 0x28 && (iVar14 != 0x1e)))) && (iVar14 != 0x5a)))) { LAB_005d32c7: cVar7 = Entity_Pickup::IsChest(); if ((cVar7 == '\0') || (*(int *)((int)EVar22 + 0x30) == 0)) goto LAB_005d3396; if (extraout_ECX == 100) goto LAB_005d32e3; } fVar24 = *(float *)((int)EVar22 + 0x33c); fVar28 = *(float *)((int)EVar22 + 0x340); local_50 = 5.60519e-45; local_5c = EVar22; local_48 = fVar28; local_44 = fVar24; } } else { LAB_005d31d8: if (*(int *)((int)EVar22 + 0x188) == 1) goto LAB_005d3260; if (*(int *)((int)EVar22 + 0x188) == 0) goto LAB_005d3260; if (*(char *)((int)EVar22 + 0x3b0) != '\0') goto LAB_005d3260; if (*(char *)((int)EVar22 + 0x173) != '\0') goto LAB_005d3260; cVar7 = Entity::HasEntityFlags(); if ((((cVar7 != '\0') && (iVar14 != 0x322)) && (iVar14 != 0x362)) || (cVar7 = Entity::IsDescendantOf((Entity *)this), cVar7 != '\0')) { fVar24 = local_44; fVar28 = local_48; goto LAB_005d3260; } fVar24 = *(float *)((int)EVar22 + 0x33c); fVar28 = *(float *)((int)EVar22 + 0x340); local_50 = 4.2039e-45; local_5c = EVar22; local_48 = fVar28; local_44 = fVar24; } } LAB_005d3396: fVar26 = *(float *)((int)this->_target + 0x33c) - fVar24; fVar25 = *(float *)((int)this->_target + 0x340) - fVar28; fVar26 = fVar25 * fVar25 + fVar26 * fVar26; if (*(int *)(mrMeData + 4) == 0) { LAB_005d33d8: *(float *)(mrMeData + 4) = local_50; (this->_targetPosition).x = fVar24; (this->_targetPosition).y = fVar28; if (this->_child != (EntityPtr)0x0) { std::multiset::erase(); } this->_child = local_5c; if (local_5c != (EntityPtr)0x0) { std::multiset::insert(); } *(undefined4 *)(mrMeData + 0x120) = 0xffffffff; fVar24 = local_44; fVar28 = local_48; bestDistSq = fVar26; } else if (fVar26 < bestDistSq) goto LAB_005d33d8; local_60 = (float)((int)local_60 + 1); } while ((uint)local_60 < *(uint *)((int)pvVar20 + 0x1264)); } if (*(int *)(mrMeData + 4) != 0) { this->_state = 1; *(undefined4 *)(mrMeData + 0x124) = 0; *(int *)(mrMeData + 0x124) = *(int *)(mrMeData + 0x124) + 1; goto LAB_005d3f7c; } } this->_state = 3; *(int *)(mrMeData + 0x124) = *(int *)(mrMeData + 0x124) + 1; goto LAB_005d3f7c; } if (iVar14 == 1) { if (*(char *)(mrMeData + 0x128) != '\0') { uVar16 = 0; pvVar20 = g_game->_room; if (*(int *)((int)pvVar20 + 0x1264) != 0) { do { if ((*(int *)(*(int *)(*(int *)((int)pvVar20 + 0x125c) + uVar16 * 4) + 0x28) == 5) && (iVar14 = __RTDynamicCast(), 1 < *(uint *)(iVar14 + 0x5c0))) { this->_child = *(EntityPtr *)(*(int *)((int)pvVar20 + 0x125c) + uVar16 * 4); break; } uVar16 = uVar16 + 1; } while (uVar16 < *(uint *)((int)pvVar20 + 0x1264)); } } EVar22 = this->_child; if (EVar22 == (EntityPtr)0x0) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,*(int *)((int)EVar22 + 0x30)); } iVar14 = *(int *)(mrMeData + 4); if (iVar14 == 4) { uVar16 = *(uint *)(mrMeData + 0x120); if ((uVar16 != 0xffffffff) || ((EVar22 != (EntityPtr)0x0 && ((*(int *)((int)EVar22 + 0x2c) != 100 || (itemConfig != (ItemConfig_Item *)0x0)))))) { local_60 = (this->_targetPosition).x; local_70 = (this->_targetPosition).y; if (EVar22 != (EntityPtr)0x0) { local_60 = *(float *)((int)EVar22 + 0x33c); local_70 = *(float *)((int)EVar22 + 0x340); } vecResult = (float *)Vector::Resized(); moveX = *vecResult; moveY = vecResult[1]; local_60 = (this->_pos).x - local_60; local_70 = (this->_pos).y - local_70; if (256.0 <= local_70 * local_70 + local_60 * local_60) { if ((EVar22 == (EntityPtr)0x0) || (*(char *)((int)EVar22 + 0x171) != '\0')) goto LAB_005d3f7c; } else if ((int)uVar16 < 0) { if (EVar22 != (EntityPtr)0x0) { if (*(int *)((int)EVar22 + 0x28) != 5) goto LAB_005d3f7c; pickup = (Entity_Pickup *)__RTDynamicCast(); if (pickup->_price != 0) { uVar16 = RNG::RandomInt(&this->_dropRNG,3); manager = g_manager; if (uVar16 == 0) { seed_fart_sound_override(); SoundEffects::Play(&manager->_sfxManager,0xbb,1.0,2,0,1.0,0.0); this->_state = 3; } else { Entity_Pickup::update_price_sprite(); } } if (this->_state == 3) goto LAB_005d3f7c; iVar14 = pickup->_variant; if (((iVar14 == 0x3c) || (iVar14 == 0x35)) || (iVar14 == 0x37)) { Entity_Pickup::TryOpenChest(pickup,(Entity_Player *)0x0); } else if (iVar14 == 0x33) { explosionColor = (ColorMod *)Color::Color(); fStack_cc = 8.560782e-39; Game::BombExplosionEffects (g_game,&this->_pos,20.0,(BitSet128)ZEXT816(0),explosionColor, (Entity *)this->_parent,1.0,1,4,0); } else if ((iVar14 != 0x14) || (pickup->_subtype != 6)) { if (*(char *)(mrMeData + 0x128) != '\0') { pickup->_cycleCollectibleCount = 0; } ANM2::ANM2((ANM2 *)pickupSpriteCopy,&pickup->_sprite); ANM2::operator_assign(); if (pickup->_variant == 100) { ANM2::Play((ANM2 *)(mrMeData + 8),(byte *)"ShopIdle",1); AnimationState::SetAnimationData((AnimationState *)(mrMeData + 0x58)); fVar24 = g_vectorOne.y * 0.8; *(float *)(mrMeData + 0xa4) = g_vectorOne.x * 0.8; *(float *)(mrMeData + 0xa8) = fVar24; } pickup->_visible = 0; *(int *)(mrMeData + 0x11c) = pickup->_entityCollisionClass; pickup->_entityCollisionClass = 0; this->_state = 2; goto LAB_005d3f7c; } } } else if (((uVar16 < 0x1c0) && (gridEntity = *(GridEntity **)((int)g_game->_room + uVar16 * 4 + 0x24), gridEntity != (GridEntity *)0x0)) && (((gridEntity->_desc)._type == 0x14 && ((EVar22 = this->_parent, EVar22 != (EntityPtr)0x0 && (*(int *)((int)EVar22 + 0x28) == 1)))))) { iVar14 = *(int *)((int)EVar22 + 0x13bc); savedParentX = *(undefined4 *)((int)EVar22 + 0x33c); savedParentY = *(undefined4 *)((int)EVar22 + 0x340); if (iVar14 < 1) { iVar14 = 1; } *(int *)((int)EVar22 + 0x13bc) = iVar14; gridPos = (undefined4 *)GridEntity::Position(gridEntity); *(undefined4 *)((int)EVar22 + 0x33c) = *gridPos; *(undefined4 *)((int)EVar22 + 0x340) = gridPos[1]; (**(code **)(*(int *)gridEntity + 8))(); *(undefined4 *)((int)EVar22 + 0x33c) = savedParentX; *(undefined4 *)((int)EVar22 + 0x340) = savedParentY; } } } else if (iVar14 == 2) { fVar24 = (this->_targetPosition).x; fVar28 = (this->_targetPosition).y; moveX = fVar24 - (this->_pos).x; moveY = fVar28 - (this->_pos).y; fVar26 = moveY * moveY + moveX * moveX; sqrtf(); if (0.0 < fVar26) { moveX = moveX * (8.0 / fVar26); moveY = moveY * (8.0 / fVar26); } fVar24 = (this->_pos).x - fVar24; fVar28 = (this->_pos).y - fVar28; if (1600.0 <= fVar28 * fVar28 + fVar24 * fVar24) goto LAB_005d3f7c; uVar16 = *(uint *)(mrMeData + 0x120); if (((((((-1 < (int)uVar16) && (uVar16 < 0x1c0)) && (iVar14 = *(int *)((int)g_game->_room + uVar16 * 4 + 0x24), iVar14 != 0)) && ((*(int *)(iVar14 + 4) == 0x10 && (door = (GridEntity_Door *)__RTDynamicCast(), (door->_desc)._state != 2)))) && (this->_parent != (EntityPtr)0x0)) && ((*(int *)((int)this->_parent + 0x28) == 1 && (cVar7 = FUN_00710370(), cVar7 != '\0')))) && (cVar7 = GridEntity_Door::TryUnlock(door), cVar7 == '\0')) { GridEntity_Door::Open(); } } else if (iVar14 == 1) { fVar24 = (this->_targetPosition).x; pos = &this->_pos; fVar28 = (this->_targetPosition).y; moveX = fVar24 - pos->x; moveY = fVar28 - (this->_pos).y; fVar26 = moveY * moveY + moveX * moveX; sqrtf(); if (0.0 < fVar26) { moveX = moveX * (8.0 / fVar26); moveY = moveY * (8.0 / fVar26); } fVar24 = pos->x - fVar24; fVar28 = (this->_pos).y - fVar28; if (400.0 <= fVar28 * fVar28 + fVar24 * fVar24) goto LAB_005d3f7c; explosionColor = (ColorMod *)Color::Color(); fStack_cc = 8.561981e-39; Game::BombExplosionEffects (g_game,pos,20.0,(BitSet128)ZEXT816(0),explosionColor,(Entity *)this->_parent,1.0,1,4,0); } else { if (iVar14 != 3) goto LAB_005d3f7c; if ((EVar22 != (EntityPtr)0x0) && (*(char *)((int)EVar22 + 0x173) == '\0')) { fVar24 = (this->_pos).x; sqrtf(); vecResult = (float *)Vector::Resized(); moveX = *vecResult; moveY = vecResult[1]; if ((1 < *(int *)&g_game->_deathmatchManager) && (600 < *(int *)(mrMeData + 0x124))) { this->_state = 3; } cVar7 = Entity::IsFrame((Entity *)this); if ((cVar7 != '\0') && (fVar28 = (this->_pos).y - *(float *)((int)EVar22 + 0x340), fVar24 = fVar24 - *(float *)((int)EVar22 + 0x33c), fVar28 * fVar28 + fVar24 * fVar24 < this->_size * this->_size)) { (**(code **)(*(int *)EVar22 + 0x20))(); Color::Color(); (**(code **)(*(int *)this + 0x3c))(); } goto LAB_005d3f7c; } } } else { if (iVar14 == 3) { Random(); Game::SpawnEx(g_game); (**(code **)(*(int *)this + 0x28))(); goto LAB_005d3f7c; } if (iVar14 != 2) goto LAB_005d3f7c; ANM2::Play(&this->_sprite,(byte *)"Carry",0); EVar22 = this->_parent; if (((EVar22 != (EntityPtr)0x0) && (this->_child != (EntityPtr)0x0)) && (*(char *)((int)this->_child + 0x172) != '\0')) { fVar24 = *(float *)((int)EVar22 + 0x33c) - (this->_pos).x; fVar26 = *(float *)((int)EVar22 + 0x340) - (this->_pos).y; vecResult = (float *)Vector::Resized(); fVar25 = (this->_pos).y - *(float *)((int)EVar22 + 0x340); moveX = *vecResult; moveY = vecResult[1]; fVar28 = (this->_pos).x - *(float *)((int)EVar22 + 0x33c); if (1024.0 <= fVar25 * fVar25 + fVar28 * fVar28) goto LAB_005d3f7c; Room::FindFreePickupSpawnPosition(); EVar22 = this->_child; *(float *)((int)EVar22 + 0x33c) = fVar24; *(float *)((int)EVar22 + 0x340) = fVar26; EVar22 = this->_child; cVar7 = Vector::operator_ne(); if (cVar7 != '\0') { *extraout_ECX_00 = fVar24; extraout_ECX_00[1] = fVar26; EVar22 = this->_child; } *(undefined1 *)((int)EVar22 + 0x171) = 1; *(undefined4 *)((int)this->_child + 0x188) = *(undefined4 *)(mrMeData + 0x11c); ANM2::Play(&this->_sprite,(byte *)"Float",0); } } this->_state = 3; LAB_005d3f7c: if (*(char *)(mrMeData + 0x111) != '\0') { AnimationState::Update(); AnimationState::Update(); } (this->_velocity).x = (this->_velocity).x * 0.9 + moveX * 0.1; (this->_velocity).y = (this->_velocity).y * 0.9 + moveY * 0.1; ExceptionList = local_10; return; } //@@ 005d4010 Entity_Effect::update_wave_chain /* DB: ? ECX=Entity_Effect: on the frame FrameCount-spawnFrame == +0x438 advances the wave (mode +0x440: 4 grows step +0x430 up to 20 and +0x434 by 0.1, 2 sets 1.75 and 60, 1 rotates direction +0x420 by angle +0x448) and spawns the next effect via FUN_006395e0 (SpawnEx 1000.variant + parent link) at pos + dir*+0x42c; from Entity_Effect::Update */ void Entity_Effect::update_wave_chain(void) { int iVar1; int iVar2; float **ppfVar3; int in_ECX; float fVar4; float fVar5; float *local_14; float *local_10; float local_c; iVar1 = *(int *)(in_ECX + 0x438); if (g_game->_frameCount - *(int *)(in_ECX + 0x328) == iVar1) { iVar2 = *(int *)(in_ECX + 0x440); if (iVar2 == 4) { local_10 = (float *)(*(float *)(in_ECX + 0x430) * 1.5); local_14 = (float *)0x41a00000; ppfVar3 = &local_14; if ((float)local_10 <= 20.0) { ppfVar3 = &local_10; } *(float **)(in_ECX + 0x430) = *ppfVar3; *(float *)(in_ECX + 0x434) = *(float *)(in_ECX + 0x434) + 0.1; } else if ((iVar2 == 2) && (*(int *)(in_ECX + 0x428) == 1)) { *(undefined4 *)(in_ECX + 0x434) = 0x3fe00000; *(undefined4 *)(in_ECX + 0x43c) = 0x3c; } else if (iVar2 == 1) { local_10 = (float *)(*(float *)(in_ECX + 0x448) * 0.017453292); local_14 = (float *)cos((float)local_10); fVar5 = sin((float)local_10); fVar4 = *(float *)(in_ECX + 0x420); *(float *)(in_ECX + 0x420) = fVar4 * (float)local_14 - *(float *)(in_ECX + 0x424) * fVar5; *(float *)(in_ECX + 0x424) = *(float *)(in_ECX + 0x424) * (float)local_14 + fVar4 * fVar5; } local_14 = (float *)(in_ECX + 0x420); fVar4 = sqrtf(*(float *)(in_ECX + 0x420) * *(float *)(in_ECX + 0x420) + *(float *)(in_ECX + 0x424) * *(float *)(in_ECX + 0x424)); local_c = local_14[1]; if (fVar4 <= 0.0) { fVar5 = *local_14; } else { fVar4 = *(float *)(in_ECX + 0x42c) / fVar4; fVar5 = *local_14 * fVar4; local_c = local_c * fVar4; } local_10 = (float *)(fVar5 + *(float *)(in_ECX + 0x33c)); local_c = local_c + *(float *)(in_ECX + 0x340); FUN_006395e0(&local_10,local_14,*(undefined4 *)(in_ECX + 0x428),*(float *)(in_ECX + 0x42c), *(undefined4 *)(in_ECX + 0x430),*(undefined4 *)(in_ECX + 0x434),iVar1, *(undefined4 *)(in_ECX + 0x43c),*(undefined4 *)(in_ECX + 0x444), *(undefined4 *)(in_ECX + 0x448)); } return; } //@@ 005d4210 FUN_005d4210 void FUN_005d4210(void) { uint *puVar1; qword qVar2; EntityConfig_Entity *pEVar3; float *pfVar4; Entity *pEVar5; int *in_ECX; float fVar6; float local_10; float local_c [2]; pEVar3 = EntityConfig::GetEntity (&g_manager->_entityConfig,in_ECX[0x11f],in_ECX[0x120],in_ECX[0x126]); if (pEVar3 != (EntityConfig_Entity *)0x0) { local_10 = pEVar3->collisionRadius * 0.0625; local_c[0] = 0.8; pfVar4 = &local_10; if (local_10 <= 0.8) { pfVar4 = local_c; } fVar6 = *pfVar4; if (2.0 < fVar6) { fVar6 = 2.0; } in_ECX[0x39] = (int)fVar6; in_ECX[0x3a] = (int)fVar6; } if ((in_ECX[0x1f] == 0) || ((char)in_ECX[0x23] == '\0')) { pEVar5 = Game::SpawnEx(g_game,in_ECX[0x11f],in_ECX[0x120],(Vector *)(in_ECX + 0x121), (Vector *)(in_ECX + 0x123),(Entity *)in_ECX[0x125],in_ECX[0x126], in_ECX[0x127],in_ECX[0x128]); pEVar5->_spawnGridIndex = in_ECX[0x129]; if (pEVar5->_type - 10U < 0x3de) { *(undefined1 *)&pEVar5[3]._targetPosition.y = 1; } if ((in_ECX[0x5b] & 0x80U) != 0) { qVar2 = pEVar5->_flags; puVar1 = (uint *)((int)&pEVar5->_flags + 4); *puVar1 = *puVar1 | 0x80; *(int *)&pEVar5->_flags = (int)qVar2; } (**(code **)(*in_ECX + 0x28))(); } puVar1 = (uint *)(*(int *)((int)g_game->_room + 4) + 0x44); *puVar1 = *puVar1 & 0xfffffffe; return; } //@@ 005d4380 Entity_Effect::Update /* decompile failed: Exception while decompiling 005d4380: process: timeout */ //@@ 006073f0 FUN_006073f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_006073f0(int param_1) { Entity_Player *this; void *pvVar1; int iVar2; Manager *pMVar3; undefined1 auStack_50 [4]; int local_4c; int aiStack_48 [3]; undefined4 uStack_3c; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; pMVar3 = g_manager; local_c = __security_cookie ^ (uint)auStack_50; this = *(Entity_Player **)(param_1 + 0x3bc); if (((this != (Entity_Player *)0x0) && (this->_type == 1)) && (this->_dead == 0)) { local_4c = 0x84; seed_fart_sound_override(&local_4c); SoundEffects::Play(&pMVar3->_sfxManager,local_4c,1.0,2,0,1.0,0.0); local_38 = 0x40000000; uStack_34 = 0x40400000; uStack_30 = 0x40800000; uStack_2c = 0x3f800000; local_18 = 0x3e4ccccd; local_14 = 0x3e4ccccd; local_10 = 0x3e4ccccd; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; (**(code **)(*(int *)this + 0x3c))(&local_38,3,0xffffffff,1,1); pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((0x128 < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU)) && (iVar2 = *(int *)((int)pvVar1 + 0x128), iVar2 != 0)) { aiStack_48[2] = *(undefined4 *)(iVar2 + 0x78); aiStack_48[1] = 0; uStack_3c = 0; aiStack_48[0] = iVar2; TemporaryEffects::AddEffect(&this->_temporaryeffects,aiStack_48,1,1); } Entity_Player::AnimateCollectible(this,0x24d,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); Entity_Player::AddSoulHearts(this,1,0); } return; } //@@ 00607540 FUN_00607540 void FUN_00607540(void) { undefined4 *in_ECX; in_ECX[1] = 0; *in_ECX = 0; in_ECX[2] = 0x3f800000; in_ECX[3] = 0x3f800000; in_ECX[4] = 0x3f800000; in_ECX[5] = 0x3f800000; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; return; } //@@ 006075a0 TearParams::operator_ /* DB: struct copy; Brimstone/ApplyTearFlagEffects prototype: db/protos.zhl, confirmed by RET 4 */ TearParams * __thiscall TearParams::operator_(TearParams *this,TearParams *other) { float fVar1; float fVar2; float fVar3; undefined4 uVar4; undefined4 uVar5; qword qVar6; this->_tearVariant = other->_tearVariant; this->_bombVariant = other->_bombVariant; if (&this->_tearColor != &other->_tearColor) { fVar1 = (other->_tearColor)._tint[1]; fVar2 = (other->_tearColor)._tint[2]; fVar3 = (other->_tearColor)._tint[3]; (this->_tearColor)._tint[0] = (other->_tearColor)._tint[0]; (this->_tearColor)._tint[1] = fVar1; (this->_tearColor)._tint[2] = fVar2; (this->_tearColor)._tint[3] = fVar3; fVar1 = (other->_tearColor)._colorize[1]; fVar2 = (other->_tearColor)._colorize[2]; fVar3 = (other->_tearColor)._colorize[3]; (this->_tearColor)._colorize[0] = (other->_tearColor)._colorize[0]; (this->_tearColor)._colorize[1] = fVar1; (this->_tearColor)._colorize[2] = fVar2; (this->_tearColor)._colorize[3] = fVar3; *(undefined8 *)(this->_tearColor)._offset = *(undefined8 *)(other->_tearColor)._offset; (this->_tearColor)._offset[2] = (other->_tearColor)._offset[2]; } uVar4 = *(undefined4 *)((int)&(other->_flags)._l + 4); qVar6 = (other->_flags)._h; uVar5 = *(undefined4 *)((int)&(other->_flags)._h + 4); *(int *)&(this->_flags)._l = (int)(other->_flags)._l; *(undefined4 *)((int)&(this->_flags)._l + 4) = uVar4; *(int *)&(this->_flags)._h = (int)qVar6; *(undefined4 *)((int)&(this->_flags)._h + 4) = uVar5; this->_tearDamage = other->_tearDamage; this->_tearScale = other->_tearScale; this->_tearHeight = other->_tearHeight; this[1]._tearVariant = other[1]._tearVariant; this[1]._bombVariant = other[1]._bombVariant; this[1]._tearColor._tint[0] = other[1]._tearColor._tint[0]; this[1]._tearColor._tint[1] = other[1]._tearColor._tint[1]; return this; } //@@ 00607620 Entity_Effect::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [vtable slot 5] */ void __thiscall Entity_Effect::Render(Entity_Effect *this,float *param_2) { byte bVar1; char isLocalPlayerOwned; LayerState *layer; int trailDeque; int iVar2; ColorMod *to; Vector *renderPos; ColorMod *to_00; ColorMod *to_01; Entity_Player *player; AnimationState *overlayFrame; Vector *pVVar3; uint uVar4; ColorMod *tmpColor; float *pfVar5; float curveY; ANM2 *layerSprite; Color *player; float *extraout_ECX; EntityPtr *extraout_ECX_00; int extraout_EDX; int extraout_EDX_00; void *pvVar6; int *trail; undefined1 auVar7 [12]; undefined1 auVar8 [12]; undefined1 auVar9 [12]; float fVar10; float fVar11; float fVar12; EntityPtr EVar13; double dVar14; undefined1 auStack_1f0 [20]; float fStack_1dc; byte *layerName; Vector local_1bc; Vector local_1b4; int *local_1ac; int *local_1a8; float local_1a4; char isParentFrameVisible; Vector local_19c; float local_194; float local_190; EntityPtr local_18c; float *renderOffset; Vector local_184; EntityPtr local_17c; Vector local_178; float local_170; AnimationLayer local_16c; AnimationState *local_168; Vector local_164; float local_15c; EntityPtr local_158; EntityPtr local_154; AnimationState overlayFrameCopy; undefined1 local_124; Color local_e4; ColorMod local_b8; Color scratchColor; ColorMod beamColor; Color local_34; float local_8; Game *game; EntityPtr *trailPoint; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); renderOffset = param_2; if (this->_variant == 0x79) { return; } local_1bc.y = (float)this; if ((((this->_variant == 0x1e) && (this->_spawnerEntity != (EntityPtr)0x0)) && (bVar1 = Entity::IsEnemy((Entity *)this->_spawnerEntity), bVar1 != 0)) && (isLocalPlayerOwned = is_local_player_owned(), isLocalPlayerOwned == '\0')) { return; } if (this->_visible == 0) { return; } local_17c = (EntityPtr)((this->_posOffset).y + (this->_pos).y); local_1b4.y = (g_screenHeight - 182.0) * 0.5; local_158 = (EntityPtr)(g_displayPixelRatio * g_screenPointScale); local_154 = (EntityPtr) (((((this->_pos).x + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_158 + 0.5); dVar14 = floor((double)(float)local_154); local_1ac = (int *)(float)dVar14; local_154 = (EntityPtr) ((((float)local_17c - 140.0) * 0.65 + local_1b4.y) * (float)local_158 + 0.5); dVar14 = floor((double)(float)local_154); local_154 = (EntityPtr)(float)dVar14; fVar10 = param_2[1]; pVVar3 = &this->_renderPosition; pVVar3->x = (float)local_1ac / (float)local_158 + *param_2; (this->_renderPosition).y = (float)local_154 / (float)local_158 + fVar10; iVar2 = this->_variant; if ((iVar2 == 0x7a) || (iVar2 == 0xb8)) { local_154 = this->_parent; if (local_154 == (EntityPtr)0x0) goto LAB_0060ab8d; layerSprite = (ANM2 *)((int)local_154 + 0x48); layer = ANM2::GetLayer(layerSprite,(byte *)this->_state); fVar10 = g_displayPixelRatio; layer->_visible = 1; local_17c = (EntityPtr)(fVar10 * g_screenPointScale); local_164.y = (((*(float *)((int)local_154 + 0x33c) + *(float *)((int)local_154 + 0x34c)) - 60.0 ) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_17c + 0.5; dVar14 = floor((double)local_164.y); local_178.y = (float)dVar14 / (float)local_17c; local_164.y = (((*(float *)((int)local_154 + 0x340) + *(float *)((int)local_154 + 0x350)) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_17c + 0.5; dVar14 = floor((double)local_164.y); local_164.x = local_178.y + *renderOffset; local_164.y = (float)dVar14 / (float)local_17c + renderOffset[1]; Sprite::RenderLayer((Sprite *)layerSprite,this->_state,&local_164,&g_vectorZero,&g_vectorZero); layerName = (byte *)this->_state; goto LAB_0060ab84; } if (iVar2 == 0xc9) { if ((this->_parent != (EntityPtr)0x0) && (*(int *)((int)this->_parent + 0x28) == 3)) { render_player_target(); } goto LAB_0060ab8d; } if (iVar2 == 0xc4) { if ((this->_parent != (EntityPtr)0x0) && (this->_isFollowing != 0)) { local_15c = g_displayPixelRatio * g_screenPointScale; local_154 = (EntityPtr) (((g_screenWidth - 338.0) * 0.5 + (*(float *)((int)this->_parent + 0x33c) - 60.0) * 0.65) * local_15c + 0.5); dVar14 = floor((double)(float)local_154); local_1b4.y = (float)dVar14 / local_15c; local_154 = (EntityPtr) (((g_screenHeight - 182.0) * 0.5 + (*(float *)((int)this->_parent + 0x340) - 140.0) * 0.65) * local_15c + 0.5); dVar14 = floor((double)(float)local_154); local_154 = (EntityPtr)(float)dVar14; local_164.x = local_1b4.y + *renderOffset; local_164.y = (float)local_154 / local_15c + renderOffset[1]; ANM2::Render(&this->_sprite,&local_164,&g_vectorZero,&g_vectorZero); goto LAB_0060ab8d; } } else if (iVar2 == 0x27) { if ((this->_subtype == 1) && (EVar13 = this->_parent, EVar13 != (EntityPtr)0x0)) { if (*(uint *)((int)EVar13 + 200) < 3) goto LAB_0060ab8d; layer = ANM2::GetLayer((ANM2 *)((int)EVar13 + 0x48),(byte *)0x2); layer->_visible = 1; Sprite::RenderLayer((Sprite *)((int)this->_parent + 0x48),2,pVVar3,&g_vectorZero,&g_vectorZero ); layerSprite = (ANM2 *)((int)this->_parent + 0x48); layerName = (byte *)0x2; LAB_0060ab84: layer = ANM2::GetLayer(layerSprite,layerName); layer->_visible = 0; goto LAB_0060ab8d; } } else { if (iVar2 == 0x8b) { uVar4 = this->_state; if (((((int)uVar4 < 0) || (0x1bf < uVar4)) || (iVar2 = *(int *)((int)g_game->_room + uVar4 * 4 + 0x24), iVar2 == 0)) || ((*(int *)(iVar2 + 4) != 0x11 || (*(uint *)(iVar2 + 0xc0) < 2)))) goto LAB_0060ab8d; layerSprite = (ANM2 *)(iVar2 + 0x40); layer = ANM2::GetLayer(layerSprite,(byte *)0x1); layer->_visible = 1; Sprite::RenderLayer((Sprite *)layerSprite,1,&this->_renderPosition,&g_vectorZero,&g_vectorZero ); layerName = (byte *)0x1; goto LAB_0060ab84; } if (iVar2 == 0xa6) { fStack_1dc = 8.860197e-39; local_190 = (float)__RTDynamicCast(); if ((((this->_sprite)._loaded != 0) && (local_190 != 0.0)) && (1 < *(uint *)((int)local_190 + 0x14))) { DAT_00c78ef0 = &this->_sprite; DAT_00c78ef4 = 0; DAT_00c78ef8._0_2_ = 0; g_beamRendererPointsEnd = g_beamRendererPoints; local_1ac = *(int **)((int)local_190 + 4); local_170 = (float)(*(int *)((int)local_190 + 0x14) + -1 + *(int *)((int)local_190 + 0x10)); local_194 = 0.0; local_158 = (EntityPtr)g_vectorZero.x; local_18c = (EntityPtr)g_vectorZero.y; fVar10 = local_190; trail = local_1ac; LAB_00607b21: do { if ((int)local_170 + 1U == *(int *)((int)fVar10 + 0x10)) goto LAB_00607e4b; if (0 < (int)local_194) { if (trail == (int *)0x0) { iVar2 = 0; } else { iVar2 = *trail; } pfVar5 = *(float **) (*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & (uint)local_170) * 4); fVar11 = *pfVar5 - (float)local_158; fVar12 = pfVar5[1] - (float)local_18c; fVar12 = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); if (trail == (int *)0x0) { iVar2 = 0; } else { iVar2 = *trail; } if (fVar12 < *(float *)(*(int *)(*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & (uint)local_170) * 4) + 0x34 ) * 0.4) { local_170 = (float)((int)local_170 - 1); goto LAB_00607b21; } } if (trail == (int *)0x0) { iVar2 = 0; } else { iVar2 = *trail; } iVar2 = *(int *)(*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & (uint)local_170) * 4); beamColor._tint[0] = *(float *)(iVar2 + 8); beamColor._tint[1] = *(float *)(iVar2 + 0xc); beamColor._tint[2] = *(float *)(iVar2 + 0x10); beamColor._colorize[0] = *(float *)(iVar2 + 0x18); beamColor._colorize[1] = *(float *)(iVar2 + 0x1c); beamColor._colorize[2] = *(float *)(iVar2 + 0x20); beamColor._colorize[3] = *(float *)(iVar2 + 0x24); beamColor._offset._0_8_ = *(undefined8 *)(iVar2 + 0x28); beamColor._offset[2] = *(float *)(iVar2 + 0x30); if (trail == (int *)0x0) { trailDeque = 0; } else { trailDeque = *trail; } beamColor._tint[3] = *(float *)(iVar2 + 0x14) * *(float *)(*(int *)(*(int *)(trailDeque + 4) + (*(int *)(trailDeque + 8) - 1U & (uint)local_170) * 4) + 0x3c); if (trail == (int *)0x0) { iVar2 = 0; } else { iVar2 = *trail; } iVar2 = *(int *)(*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & (uint)local_170) * 4); if (trail == (int *)0x0) { local_158 = *(EntityPtr *)(_DAT_00000004 + (_DAT_00000008 - 1U & (uint)local_170) * 4); trailDeque = 0; } else { local_158 = *(EntityPtr *) (*(int *)(*trail + 4) + (*(int *)(*trail + 8) - 1U & (uint)local_170) * 4); trailDeque = *trail; } local_1b4.y = *(float *)(*(int *)(*(int *)(trailDeque + 4) + (*(int *)(trailDeque + 8) - 1U & (uint)local_170) * 4) + 0x34) * *(float *)((int)local_158 + 0x3c); if (trail == (int *)0x0) { trailDeque = 0; } else { trailDeque = *trail; } local_158 = (EntityPtr)(g_displayPixelRatio * g_screenPointScale); pfVar5 = *(float **) (*(int *)(trailDeque + 4) + (*(int *)(trailDeque + 8) - 1U & (uint)local_170) * 4); local_154 = (EntityPtr) (((g_screenWidth - 338.0) * 0.5 + (*pfVar5 - 60.0) * 0.65) * (float)local_158 + 0.5); dVar14 = floor((double)(float)local_154); local_17c = (EntityPtr)((float)dVar14 / (float)local_158); local_154 = (EntityPtr) (((pfVar5[1] - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_158 + 0.5); dVar14 = floor((double)(float)local_154); local_154 = (EntityPtr)(float)dVar14; local_164.x = (float)local_17c + *renderOffset; local_164.y = (float)local_154 / (float)local_158 + renderOffset[1]; BeamRenderer::Add(&local_164,&beamColor,local_1b4.y,*(float *)(iVar2 + 0x38)); if (local_1ac == (int *)0x0) { iVar2 = 0; } else { iVar2 = *local_1ac; } trailPoint = *(EntityPtr **) (*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & (uint)local_170) * 4); local_194 = (float)((int)local_194 + 1); local_170 = (float)((int)local_170 - 1); local_158 = *trailPoint; local_18c = trailPoint[1]; fVar10 = local_190; trail = local_1ac; } while( true ); } goto LAB_0060ab8d; } if (iVar2 == 0xaf) { EVar13 = this->_target; if (EVar13 == (EntityPtr)0x0) { local_1a8 = (int *)((this->_posOffset).x + (this->_pos).x); local_1a4 = (this->_posOffset).y + (this->_pos).y; } else { local_1a8 = (int *)(((Vector *)((int)EVar13 + 0x33c))->x + ((Vector *)((int)EVar13 + 0x34c))->x); local_1a4 = *(float *)((int)EVar13 + 0x340) + *(float *)((int)EVar13 + 0x350); bVar1 = Entity::IsEnemy((Entity *)EVar13); if (bVar1 != 0) { local_1a4 = local_1a4 - 12.0; } } local_170 = 1.0; if (0 < this->_timeout) { fVar10 = (float)this->_timeout / 10.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = local_170; } local_170 = (2.0 - (fVar10 + fVar10)) * fVar10 + fVar10; } local_15c = g_displayPixelRatio * g_screenPointScale; local_178.y = ((float)local_1a8 - 60.0) * 0.65; local_17c = (EntityPtr)((local_1a4 - 140.0) * 0.65); local_154 = (EntityPtr)(((g_screenWidth - 338.0) * 0.5 + local_178.y) * local_15c + 0.5); dVar14 = floor((double)(float)local_154); local_1b4.y = (float)dVar14 / local_15c; local_154 = (EntityPtr)(((g_screenHeight - 182.0) * 0.5 + (float)local_17c) * local_15c + 0.5) ; dVar14 = floor((double)(float)local_154); local_154 = (EntityPtr)(float)dVar14; fVar10 = *renderOffset; (this->_renderPosition).y = (float)local_154 / local_15c + renderOffset[1]; pVVar3->x = local_1b4.y + fVar10; fVar10 = local_170 * g_vectorOne.y; (this->_sprite)._scale.x = local_170 * g_vectorOne.x; (this->_sprite)._scale.y = fVar10; ANM2::Render(&this->_sprite,pVVar3,&g_vectorZero,&g_vectorZero); if (this->_parent != (EntityPtr)0x0) { Color::operator_assign((Color *)&beamColor,&(this->_sprite)._color); local_18c = (EntityPtr)(this->_updateTime / 15.0); if (1.0 <= (float)local_18c) { local_18c = (EntityPtr)0x3f800000; } local_1bc.y = *(float *)(extraout_EDX + 0x340) - 15.0; local_194 = *(float *)(extraout_EDX + 0x33c) + 0.0; local_1a4 = local_1a4 - local_1bc.y; local_1a8 = (int *)((float)local_1a8 - local_194); local_164.y = sqrtf(local_1a4 * local_1a4 + (float)local_1a8 * (float)local_1a8); if (80.0 <= local_164.y) { fVar10 = 40.0 / local_164.y; local_154 = (EntityPtr)(local_164.y - 40.0); local_158 = (EntityPtr)0x42200000; local_1ac = (int *)((float)local_1a8 * fVar10 + local_194); local_1b4.y = local_1a4 * fVar10; local_1a4 = local_1a4 * (1.0 - fVar10) + local_1bc.y; local_1b4.y = local_1b4.y + local_1bc.y; local_1a8 = (int *)((float)local_1a8 * (1.0 - fVar10) + local_194); } else { local_1ac = (int *)((float)local_1a8 * 0.5 + local_194); local_1b4.y = local_1a4 * 0.5 + local_1bc.y; local_158 = (EntityPtr)(local_164.y * 0.5); local_1a8 = local_1ac; local_1a4 = local_1b4.y; local_154 = local_158; } fVar10 = local_194 - 60.0; local_194 = (g_screenHeight - 182.0) * 0.5; local_190 = (g_screenWidth - 338.0) * 0.5; local_15c = g_displayPixelRatio * g_screenPointScale; local_19c.y = (fVar10 * 0.65 + local_190) * local_15c + 0.5; dVar14 = floor((double)local_19c.y); local_184.y = (float)dVar14 / local_15c; local_19c.y = ((local_1bc.y - 140.0) * 0.65 + local_194) * local_15c + 0.5; dVar14 = floor((double)local_19c.y); local_19c.y = (float)dVar14; local_1bc.y = renderOffset[1] + local_19c.y / local_15c; local_1bc.x = *renderOffset + local_184.y; local_184.y = (((float)local_1ac - 60.0) * 0.65 + local_190) * local_15c + 0.5; dVar14 = floor((double)local_184.y); local_19c.y = (float)dVar14 / local_15c; local_184.y = ((local_1b4.y - 140.0) * 0.65 + local_194) * local_15c + 0.5; dVar14 = floor((double)local_184.y); pfVar5 = renderOffset; local_1b4.y = renderOffset[1] + (float)dVar14 / local_15c; local_1b4.x = *renderOffset + local_19c.y; local_184.y = (((float)local_1a8 - 60.0) * 0.65 + local_190) * local_15c + 0.5; dVar14 = floor((double)local_184.y); local_19c.y = (float)dVar14 / local_15c; local_184.y = ((local_1a4 - 140.0) * 0.65 + local_194) * local_15c + 0.5; dVar14 = floor((double)local_184.y); local_184.y = (float)dVar14; local_19c.x = *pfVar5 + local_19c.y; local_178.y = (local_190 + local_178.y) * local_15c + 0.5; local_19c.y = pfVar5[1] + local_184.y / local_15c; dVar14 = floor((double)local_178.y); local_184.y = (float)dVar14 / local_15c; local_178.y = (local_194 + (float)local_17c) * local_15c + 0.5; dVar14 = floor((double)local_178.y); iVar2 = 0; local_178.x = *pfVar5 + local_184.y; local_178.y = pfVar5[1] + (float)dVar14 / local_15c; local_18c = (EntityPtr)((float)local_18c * 0.7); do { if (iVar2 == 0) { local_190 = 4.0; } else { local_190 = 7.0; } local_190 = local_190 * this->_updateTime; DAT_00c78ef0 = &this->_sprite; g_beamRendererPointsEnd = g_beamRendererPoints; DAT_00c78ef8._0_2_ = 0; beamColor._tint[3] = 0.0; DAT_00c78ef4 = iVar2; BeamRenderer::Add(&local_1bc,&beamColor,local_170,local_190 + 0.0); beamColor._tint[3] = (float)local_18c; BeamRenderer::Add(&local_1b4,&beamColor,local_170,local_190 + (float)local_158); if ((float)local_154 != (float)local_158) { BeamRenderer::Add(&local_19c,&beamColor,local_170,local_190 + (float)local_154); } beamColor._tint[3] = 0.0; BeamRenderer::Add(&local_178,&beamColor,local_170,local_190 + local_164.y); BeamRenderer::End(); iVar2 = iVar2 + 1; } while (iVar2 < 2); } goto LAB_0060ab8d; } if (iVar2 == 0xc1) { if (this->_subtype == 0) { fVar12 = 0.0; fVar10 = ((this->_updateTime + 6.0) - 10.0) / 50.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } Color::Color(&scratchColor); tmpColor = Color::Lerp(&beamColor,(ColorMod *)&DAT_00c5c8f8,to,fVar10 + fVar12); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,tmpColor); EVar13 = this->_target; if (EVar13 == (EntityPtr)0x0) { local_164.x = (this->_pos).x + (this->_posOffset).x; local_164.y = (this->_pos).y + (this->_posOffset).y; } else { local_164.x = *(float *)((int)EVar13 + 0x33c) + (this->_posOffset).x; local_164.y = *(float *)((int)EVar13 + 0x340) + (this->_posOffset).y; } renderPos = Isaac::GetRenderPosition(&local_178,&local_164,1); fVar10 = *renderOffset; fVar12 = renderPos->x; (this->_renderPosition).y = renderPos->y + renderOffset[1]; pVVar3->x = fVar10 + fVar12; ANM2::Render(&this->_sprite,pVVar3,&g_vectorZero,&g_vectorZero); } else { local_164.x = (this->_targetPosition).x; local_17c = (EntityPtr)(this->_targetPosition).y; local_164.y = (float)local_17c; local_154 = (EntityPtr)local_164.x; Color::Color(&local_34); fVar10 = 0.0; if (this->_parent != (EntityPtr)0x0) { Color::operator_assign(player,(ColorMod *)((int)this->_parent + 0xf0)); iVar2 = *(int *)(extraout_EDX_00 + 0x3c4); if (iVar2 == 0) { local_178.x = *(float *)(extraout_EDX_00 + 0x33c); local_178.y = *(float *)(extraout_EDX_00 + 0x340); } else { local_184.x = (float)*(EntityPtr *)(iVar2 + 0x33c); local_184.y = (float)*(EntityPtr *)(iVar2 + 0x340); } pVVar3 = &local_178; if (iVar2 != 0) { pVVar3 = &local_184; } fVar12 = (*(float *)(extraout_EDX_00 + 0x3a4) - fVar10) / 6.0; if (fVar12 <= fVar10) { fVar12 = fVar10; } if (1.0 <= fVar12) { fVar12 = 1.0; } fVar12 = fVar12 + fVar10; local_164.x = (pVVar3->x - (this->_pos).x) * fVar12 + (this->_pos).x; local_17c = (EntityPtr)((pVVar3->y - (this->_pos).y) * fVar12 + (this->_pos).y); (this->_posOffset).y = (*(float *)(extraout_EDX_00 + 0x350) - fVar10) * fVar12 + fVar10; local_164.y = (float)local_17c; local_154 = (EntityPtr)local_164.x; } bVar1 = Vector::operator_ne(&local_164,&this->_pos); if (bVar1 != 0) { pVVar3 = Isaac::GetRenderPosition(&local_164,&this->_pos,1); local_170 = *renderOffset; local_1b4.y = local_170 + pVVar3->x; local_15c = renderOffset[1]; local_1ac = (int *)(local_15c + pVVar3->y); local_164.x = (float)local_154 + (this->_posOffset).x; local_164.y = (float)local_17c + (this->_posOffset).y; pVVar3 = Isaac::GetRenderPosition(&local_178,&local_164,1); local_184.y = local_15c + pVVar3->y; local_184.x = local_170 + pVVar3->x; local_15c = local_184.y - (float)local_1ac; local_170 = local_184.x - local_1b4.y; local_154 = (EntityPtr)sqrtf(local_15c * local_15c + local_170 * local_170); DAT_00c78ef0 = &this->_sprite; local_170 = local_170 / (float)local_154; DAT_00c78ef4 = 1; DAT_00c78ef8._0_2_ = 0; g_beamRendererPointsEnd = g_beamRendererPoints; local_15c = local_15c / (float)local_154; local_158 = (EntityPtr)0x0; if (0.0 < (float)local_154) { do { fVar12 = 0.0; local_164.y = (float)local_154 - (float)local_158; fVar10 = (((this->_updateTime + 6.0) - local_164.y * 0.5) - 10.0) / 50.0; if (fVar10 <= 0.0) { fVar10 = fVar12; } if (1.0 <= fVar10) { fVar10 = 1.0; } Color::Color(&local_e4); tmpColor = Color::Lerp(&local_b8,(ColorMod *)&DAT_00c5c8f8,to_00,fVar10 + fVar12); beamColor._offset[2] = local_34._offset[2]; beamColor._tint[0] = local_34._tint[0]; beamColor._tint[1] = local_34._tint[1]; beamColor._tint[2] = local_34._tint[2]; beamColor._tint[3] = local_34._tint[3]; beamColor._colorize[0] = local_34._colorize[0]; beamColor._colorize[1] = local_34._colorize[1]; beamColor._colorize[2] = local_34._colorize[2]; beamColor._colorize[3] = local_34._colorize[3]; beamColor._offset[0] = local_34._offset[0]; beamColor._offset[1] = local_34._offset[1]; Color::__mul((Color *)&beamColor,tmpColor); scratchColor._offset[2] = beamColor._offset[2]; scratchColor._tint[0] = beamColor._tint[0]; scratchColor._tint[1] = beamColor._tint[1]; scratchColor._tint[2] = beamColor._tint[2]; scratchColor._colorize[0] = beamColor._colorize[0]; scratchColor._colorize[1] = beamColor._colorize[1]; scratchColor._colorize[2] = beamColor._colorize[2]; scratchColor._colorize[3] = beamColor._colorize[3]; scratchColor._offset[0] = beamColor._offset[0]; scratchColor._offset[1] = beamColor._offset[1]; auVar7 = ZEXT812(0x3f800000); if ((float)local_158 / 40.0 <= auVar7._0_4_) { auVar7._4_8_ = auVar7._4_8_; auVar7._0_4_ = (float)local_158 / 40.0; } scratchColor._tint[3] = auVar7._0_4_; local_178.x = local_170 * (float)local_158 + local_1b4.y; local_178.y = local_15c * (float)local_158 + (float)local_1ac; BeamRenderer::Add(&local_178,(ColorMod *)&scratchColor,1.0,local_164.y); local_158 = (EntityPtr)((float)local_158 + 10.0); } while ((float)local_158 < (float)local_154); } fVar12 = 0.0; fVar10 = ((this->_updateTime + 6.0) - 10.0) / 50.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } Color::Color((Color *)&local_b8); Color::Lerp((ColorMod *)&local_e4,(ColorMod *)&DAT_00c5c8f8,to_01,fVar10 + fVar12); Color::operator_assign((Color *)auStack_1f0,(ColorMod *)&local_34); FUN_004072e0(); auVar8 = ZEXT812(0x3f800000); if ((float)local_154 / 40.0 <= auVar8._0_4_) { auVar8._4_8_ = auVar8._4_8_; auVar8._0_4_ = (float)local_154 / 40.0; } scratchColor._tint[3] = auVar8._0_4_; BeamRenderer::Add(&local_184,(ColorMod *)&scratchColor,1.0,0.0); BeamRenderer::End(); } } goto LAB_0060ab8d; } if (iVar2 == 0xbd) { if ((this->_subtype == 1) && (0 < this->_state)) { local_170 = (this->_velocity).x; local_15c = (this->_velocity).y; fVar10 = sqrtf(local_170 * local_170 + local_15c * local_15c); if ((7.0 < fVar10) && (0.0 < fVar10)) { local_170 = (this->_velocity).x * (7.0 / fVar10); local_15c = (this->_velocity).y * (7.0 / fVar10); } iVar2 = 5; if (0.0 <= local_15c) { pfVar5 = beamColor._tint + 1; do { pfVar5[1] = 0.0; *pfVar5 = 0.0; iVar2 = iVar2 + -1; pfVar5 = pfVar5 + 2; } while (iVar2 != 0); pfVar5 = beamColor._tint + 1; local_164.y = this->_updateTime * 0.6; uVar4 = 4; local_170 = -local_170; local_15c = -local_15c; do { local_178.y = sqrtf((float)(int)uVar4); local_178.y = local_178.y * 1.5; fVar12 = sin(local_178.y + local_164.y); fVar10 = local_1bc.y; uVar4 = uVar4 - 1; *pfVar5 = (local_170 * local_178.y + 0.0) * 0.65; pfVar5[1] = (fVar12 + fVar12 + local_15c * local_178.y) * 0.65; pfVar5 = pfVar5 + 2; } while (uVar4 < 0x80000000); local_158 = (EntityPtr)0x0; do { pvVar6 = (void *)0x0; if ((((ANM2 *)((int)fVar10 + 0x48))->_animState)._animData != (void *)0x0) { AnimationState::SetFrameFloat (&((ANM2 *)((int)fVar10 + 0x48))->_animState,(float)(int)local_158); pvVar6 = (((ANM2 *)((int)fVar10 + 0x48))->_animState)._animData; } local_164.x = beamColor._tint[(int)local_158 * 2 + 1] + ((Vector *)((int)fVar10 + 0x1a4))->x; local_164.y = beamColor._tint[(int)local_158 * 2 + 2] + ((Vector *)((int)fVar10 + 0x1a4))->y; if (((pvVar6 != (void *)0x0) && (1 < *(int *)((int)(((ANM2 *)((int)fVar10 + 0x48))->_animState)._animation + 0x80))) && (iVar2 = *(int *)((int)pvVar6 + 0x3c), -1 < iVar2)) { fStack_1dc = 8.868798e-39; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar6 + 0x18)),&local_164, *(int *)((int)(((ANM2 *)((int)fVar10 + 0x48))->_animState)._layerFrames + iVar2 * 4),&g_vectorZero,&g_vectorZero, (((ANM2 *)((int)fVar10 + 0x48))->_animState)._animation); } local_158 = (EntityPtr)((int)local_158 + 1); } while ((int)local_158 < 5); local_158 = (EntityPtr)0x0; do { pvVar6 = (void *)0x0; if ((((ANM2 *)((int)fVar10 + 0x48))->_animState)._animData != (void *)0x0) { AnimationState::SetFrameFloat (&((ANM2 *)((int)fVar10 + 0x48))->_animState,(float)(int)local_158); pvVar6 = (((ANM2 *)((int)fVar10 + 0x48))->_animState)._animData; } local_164.x = beamColor._tint[(int)local_158 * 2 + 1] + ((Vector *)((int)fVar10 + 0x1a4))->x; local_164.y = beamColor._tint[(int)local_158 * 2 + 2] + ((Vector *)((int)fVar10 + 0x1a4))->y; if (((pvVar6 != (void *)0x0) && (0 < *(int *)((int)(((ANM2 *)((int)fVar10 + 0x48))->_animState)._animation + 0x80))) && (iVar2 = *(int *)((int)pvVar6 + 0x38), -1 < iVar2)) { fStack_1dc = 8.869034e-39; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar6 + 0x18)),&local_164, *(int *)((int)(((ANM2 *)((int)fVar10 + 0x48))->_animState)._layerFrames + iVar2 * 4),&g_vectorZero,&g_vectorZero, (((ANM2 *)((int)fVar10 + 0x48))->_animState)._animation); } local_158 = (EntityPtr)((int)local_158 + 1); } while ((int)local_158 < 5); } else { pfVar5 = local_34._tint + 1; do { pfVar5[1] = 0.0; *pfVar5 = 0.0; iVar2 = iVar2 + -1; pfVar5 = pfVar5 + 2; } while (iVar2 != 0); iVar2 = 0; local_164.y = this->_updateTime * 0.6; local_170 = -local_170; local_15c = -local_15c; do { local_178.y = sqrtf((float)iVar2); local_178.y = local_178.y * 1.5; fVar10 = sin(local_178.y + local_164.y); local_34._tint[iVar2 * 2 + 1] = (local_170 * local_178.y + 0.0) * 0.65; local_34._tint[iVar2 * 2 + 2] = (fVar10 + fVar10 + local_15c * local_178.y) * 0.65; iVar2 = iVar2 + 1; } while (iVar2 < 5); local_158 = (EntityPtr)0x0; do { if (local_158 == (EntityPtr)0x0) { iVar2 = 5; } else { iVar2 = 4 - (int)local_158; } pvVar6 = (void *)0x0; if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar2); pvVar6 = (this->_sprite)._animState._animData; } local_164.x = local_34._tint[(int)local_158 * 2 + 1] + (this->_renderPosition).x; local_164.y = local_34._tint[(int)local_158 * 2 + 2] + (this->_renderPosition).y; if (((pvVar6 != (void *)0x0) && (1 < *(int *)((int)(this->_sprite)._animState._animation + 0x80))) && (iVar2 = *(int *)((int)pvVar6 + 0x3c), -1 < iVar2)) { fStack_1dc = 8.867977e-39; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar6 + 0x18)),&local_164, *(int *)((int)(this->_sprite)._animState._layerFrames + iVar2 * 4), &g_vectorZero,&g_vectorZero,(this->_sprite)._animState._animation); } local_158 = (EntityPtr)((int)local_158 + 1); } while ((int)local_158 < 5); local_158 = (EntityPtr)0x0; do { if (local_158 == (EntityPtr)0x0) { iVar2 = 5; } else { iVar2 = 4 - (int)local_158; } pvVar6 = (void *)0x0; if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar2); pvVar6 = (this->_sprite)._animState._animData; } local_164.x = (this->_renderPosition).x + local_34._tint[(int)local_158 * 2 + 1]; local_164.y = local_34._tint[(int)local_158 * 2 + 2] + (this->_renderPosition).y; if (((pvVar6 != (void *)0x0) && (0 < *(int *)((int)(this->_sprite)._animState._animation + 0x80))) && (iVar2 = *(int *)((int)pvVar6 + 0x38), -1 < iVar2)) { fStack_1dc = 8.868238e-39; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar6 + 0x18)),&local_164, *(int *)((int)(this->_sprite)._animState._layerFrames + iVar2 * 4), &g_vectorZero,&g_vectorZero,(this->_sprite)._animState._animation); } local_158 = (EntityPtr)((int)local_158 + 1); } while ((int)local_158 < 5); } goto LAB_0060ab8d; } } else { if (iVar2 == 0xbf) { fStack_1dc = 8.869122e-39; local_190 = (float)__RTDynamicCast(); if ((local_190 == 0.0) || (*(int *)((int)local_190 + 0x454) < 1)) goto LAB_0060ab8d; EVar13 = this->_parent; local_170 = g_vectorOne.x; local_15c = g_vectorOne.y; local_158 = (EntityPtr)g_vectorZero.x; local_18c = (EntityPtr)g_vectorZero.y; if ((EVar13 == (EntityPtr)0x0) || ((*(char *)((int)EVar13 + 0x151) == '\0' || (*(int *)((int)EVar13 + 0x7c) == 0)))) { local_164.x = (this->_pos).x + (this->_posOffset).x; local_164.y = (this->_pos).y + (this->_posOffset).y; renderPos = Isaac::GetRenderPosition(&local_1b4,&local_164,1); fVar10 = renderPos->y; fVar12 = renderOffset[1]; pVVar3->x = renderPos->x + *renderOffset; (this->_renderPosition).y = fVar10 + fVar12; } else { local_154 = (EntityPtr) AnimationState::GetLayerFrame((AnimationState *)((int)EVar13 + 0x78),0); if ((local_154 == (EntityPtr)0x0) || (*(char *)((int)local_154 + 0x2c) == '\0')) { EVar13 = this->_parent; isParentFrameVisible = '\0'; local_170 = *(float *)((int)EVar13 + 0xe4); local_15c = *(float *)((int)EVar13 + 0xe8); if (local_154 != (EntityPtr)0x0) goto LAB_00609482; } else { EVar13 = this->_parent; isParentFrameVisible = '\x01'; local_170 = *(float *)((int)EVar13 + 0xe4); local_15c = *(float *)((int)EVar13 + 0xe8); LAB_00609482: if ((*(int *)((int)EVar13 + 0x28) == 5) && (*(int *)((int)EVar13 + 0x2c) == 0x45)) { layer = ANM2::GetLayer((ANM2 *)((int)EVar13 + 0x48),(byte *)0x0); EVar13 = this->_parent; local_158 = (EntityPtr) ((float)local_158 + (layer->_pos).x + *(float *)((int)local_154 + 0x10)); local_18c = (EntityPtr) ((float)local_18c + (layer->_pos).y + *(float *)((int)local_154 + 0x14)); } layer = ANM2::GetLayer((ANM2 *)((int)EVar13 + 0x48),(byte *)0x0); EVar13 = this->_parent; local_170 = local_170 * (layer->_size).x * *(float *)((int)local_154 + 0x18); local_15c = local_15c * (layer->_size).y * *(float *)((int)local_154 + 0x1c); } local_164.x = *(float *)((int)EVar13 + 0x33c) + *(float *)((int)EVar13 + 0x34c); local_164.y = *(float *)((int)EVar13 + 0x340) + *(float *)((int)EVar13 + 0x350); renderPos = Isaac::GetRenderPosition(&local_19c,&local_164,1); fVar10 = renderPos->y; fVar12 = renderOffset[1]; pVVar3->x = renderPos->x + *renderOffset; (this->_renderPosition).y = fVar10 + fVar12; if (isParentFrameVisible == '\0') goto LAB_0060ab8d; } local_154 = (EntityPtr)0x0; iVar2 = *(int *)((int)local_190 + 0x454); if (0 < iVar2) { local_17c = (EntityPtr)((int)&DAT_00c5c928 + (((iVar2 + -1) * iVar2) / 2) * 8); local_164.y = local_170 * 0.5; local_178.y = local_15c * 0.5; pfVar5 = (float *)((int)local_190 + 0xa4); do { *(EntityPtr *)(pfVar5 + -3) = local_158; *(EntityPtr *)(pfVar5 + -2) = local_18c; *(float *)(pfVar5 + -1) = local_164.y; *pfVar5 = local_178.y; local_184.x = local_170 * *(float *)local_17c * 0.65 + pVVar3->x; local_184.y = local_15c * *(float *)((int)local_17c + 4) * 0.65 + (this->_renderPosition).y; ANM2::Render((ANM2 *)(pfVar5 + -0x28),&local_184,&g_vectorZero,&g_vectorZero); pfVar5 = pfVar5 + 0x45; local_154 = (EntityPtr)((int)local_154 + 1); local_17c = (EntityPtr)((int)local_17c + 8); } while ((int)local_154 < *(int *)((int)local_190 + 0x454)); } goto LAB_0060ab8d; } if (iVar2 == 0x32) { EVar13 = (EntityPtr)0x3f800000; local_154 = (EntityPtr)0x3f800000; if (this->_parent != (EntityPtr)0x0) { Entity::GetLastParent((Entity *)this->_parent); fStack_1dc = 8.870603e-39; player = (Entity_Player *)__RTDynamicCast(); if (player != (Entity_Player *)0x0) { bVar1 = Entity_Player::IsLocalPlayer(player); if (bVar1 == 0) { FUN_00925df0(); local_154 = EVar13; } } } Color::operator_assign(&scratchColor,&(this->_sprite)._color); game = g_game; (this->_sprite)._color._tint[3] = (float)local_154 * (this->_sprite)._color._tint[3]; if (*(int *)((int)game->_room + 0x12bc) == 5) { (this->_sprite)._flipY = (this->_sprite)._flipY == 0; ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); (this->_sprite)._flipY = (this->_sprite)._flipY == 0; Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&scratchColor); } else { ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&scratchColor); } goto LAB_0060ab8d; } } } ANM2::Render(&this->_sprite,pVVar3,&g_vectorZero,&g_vectorZero); iVar2 = this->_variant; if (((iVar2 == 0x1e) || (iVar2 == 0x99)) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { overlayFrame = AnimationState::GetLayerFrame(&(this->_sprite)._overlayAnimState,1); if (overlayFrame != (AnimationState *)0x0) { AnimationState::copy_assign(&overlayFrameCopy,overlayFrame); LayerAnimation::LayerAnimation(); overlayFrameCopy._layerFrames = (void *)(this->_scale * 0.65); local_168 = &overlayFrameCopy; local_164.x = 1.4013e-45; local_16c = (AnimationLayer)0x1; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_124 = 1; fStack_1dc = 8.871164e-39; AnimationLayer::RenderFrame(&local_16c,pVVar3,0,&g_vectorZero,&g_vectorZero,&this->_sprite); } } else if (iVar2 == 0xa0) { if (((this->_target != (EntityPtr)0x0) && (this->_parent != (EntityPtr)0x0)) && (bVar1 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar1 != 0)) { fVar10 = (this->_posOffset).x; fVar12 = (this->_posOffset).y; local_184.y = *(float *)((int)this->_parent + 0x340) + (this->_parentOffset).y; local_184.x = *(float *)((int)this->_parent + 0x33c) + (this->_parentOffset).x; local_164.y = *(float *)((int)this->_target + 0x33c) + fVar10; local_154 = (EntityPtr)(fVar10 + *extraout_ECX); local_178.y = *(float *)((int)this->_target + 0x340) + fVar12; local_17c = (EntityPtr)(fVar12 + extraout_ECX[1]); fVar10 = local_184.x - local_164.y; fVar12 = local_184.y - local_178.y; if (900.0 <= fVar12 * fVar12 + fVar10 * fVar10) { local_19c.x = fVar10; local_19c.y = fVar12; pVVar3 = Vector::Resized(&local_19c,&local_1b4,30.0); local_164.x = local_164.y + pVVar3->x; local_164.y = local_178.y + pVVar3->y; pVVar3 = Isaac::GetRenderPosition(&local_178,&local_164,1); local_170 = *renderOffset; local_15c = renderOffset[1]; local_1bc.y = local_170 + pVVar3->x; local_18c = (EntityPtr)(local_15c + pVVar3->y); local_164.x = local_184.x - (float)local_154; local_164.y = local_184.y - (float)local_17c; pVVar3 = Vector::Resized(&local_164,&local_178,30.0); local_164.x = (float)local_154 + pVVar3->x; local_164.y = (float)local_17c + pVVar3->y; bVar1 = 1; pVVar3 = Isaac::GetRenderPosition(&local_19c,&local_164,1); local_194 = local_170 + pVVar3->x; local_158 = (EntityPtr)(local_15c + pVVar3->y); pVVar3 = Isaac::GetRenderPosition(&local_164,&local_184,1); local_170 = local_170 + pVVar3->x; local_15c = local_15c + pVVar3->y; local_154 = (EntityPtr)0x3f800000; uVar4 = Game::GetStageID(g_game,bVar1); if (uVar4 == 0x1e) { local_154 = (EntityPtr)0x3eb33333; } BeamRenderer::Begin(); local_164.y = 0.0; local_1bc.y = local_1bc.y - local_170; local_190 = 0.0; local_194 = local_194 - local_170; local_164.x = 0.0; local_18c = (EntityPtr)((float)local_18c - local_15c); local_17c = (EntityPtr)0x0; local_158 = (EntityPtr)((float)local_158 - local_15c); do { fVar11 = (float)((double)(int)local_17c + __uint_to_double_fixup[-((int)local_17c >> 0x1f)]) / 10.0; fVar10 = local_194 * fVar11 + local_170; fVar12 = (float)local_158 * fVar11 + local_15c; EVar13 = (EntityPtr)(((local_1bc.y * fVar11 + local_170) - fVar10) * fVar11 + fVar10); curveY = (((float)local_18c * fVar11 + local_15c) - fVar12) * fVar11 + fVar12; if (local_17c != (EntityPtr)0x0) { fVar10 = curveY - local_164.y; fVar12 = (float)EVar13 - local_164.x; local_164.x = (float)EVar13; local_164.y = curveY; fVar10 = sqrtf(fVar10 * fVar10 + fVar12 * fVar12); local_190 = fVar10 + local_190; EVar13 = (EntityPtr)local_164.x; curveY = local_164.y; } local_164.y = curveY; local_164.x = (float)EVar13; Color::Reset(&scratchColor); scratchColor._tint[0] = 1.0; scratchColor._tint[1] = 1.0; scratchColor._tint[2] = 1.0; scratchColor._tint[3] = (float)local_154; BeamRenderer::Add(&local_164,(ColorMod *)&scratchColor,0.9,local_190); local_17c = (EntityPtr)((int)local_17c + 1); } while ((uint)local_17c < 0xb); BeamRenderer::End(); } } } else if (iVar2 == 0x7e) { if ((this->_subtype == 1) && (bVar1 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar1 != 0)) { local_164.y = (float)this->_timeout; if (this->_timeout < 6) { fVar10 = (local_164.y - 0.0) / 5.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } local_158 = (EntityPtr)(2.0 - (fVar10 * 0.8 + 0.2)); } else { local_178.y = (float)this->_lifespan; if (local_178.y == 5.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar10 = (local_164.y - 5.0) / (local_178.y - 5.0); if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } pow(1.0 - fVar10,0.5); local_158 = (EntityPtr)0x3f800000; } BeamRenderer::Begin(); tmpColor = (ColorMod *)Color::Color(); local_164.x = (this->_pos).x + (this->_posOffset).x; local_164.y = (this->_pos).y + (this->_posOffset).y; pVVar3 = Isaac::GetRenderPosition(&local_178,&local_164,1); local_164.x = *renderOffset + pVVar3->x; local_164.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_164,tmpColor,(float)local_158,0.0); tmpColor = (ColorMod *)Color::Color(); local_164.x = (this->_pos).x + (this->_posOffset).x + (this->_targetPosition).x * 700.0; local_164.y = (this->_posOffset).y + (this->_pos).y + (this->_targetPosition).y * 700.0; pVVar3 = Isaac::GetRenderPosition(&local_178,&local_164,1); fVar10 = 0.0; EVar13 = local_158; LAB_0060a8db: local_164.x = pVVar3->x + *renderOffset; LAB_0060a8e9: local_164.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_164,tmpColor,(float)EVar13,fVar10); BeamRenderer::End(); } } else if (iVar2 == 0xac) { if ((this->_subtype == 1) && (bVar1 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar1 != 0)) { local_184.x = *(float *)extraout_ECX_00; local_18c = extraout_ECX_00[1]; local_184.y = (float)local_18c; local_158 = (EntityPtr)local_184.x; if ((g_manager->_framecount & 1) == 0) { local_164.y = this->_rotation * this->_speedMultiplier * 0.5 * 0.017453292; local_178.y = cos(local_164.y); fVar10 = sin(local_164.y); fVar12 = (float)local_158 * fVar10; local_158 = (EntityPtr)((float)local_158 * local_178.y - (float)local_18c * fVar10); local_184.y = (float)local_18c * local_178.y + fVar12; } local_164.y = (float)this->_timeout; local_18c = (EntityPtr)local_184.y; local_184.x = (float)local_158; if (this->_timeout < 6) { fVar10 = (local_164.y - 0.0) / 5.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } fVar10 = fVar10 * 0.8 + 0.2; fVar11 = 2.0 - fVar10; local_154 = (EntityPtr)(fVar10 * fVar10); } else { iVar2 = this->_lifespan; local_178.y = (float)iVar2; if (local_178.y == 5.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); iVar2 = this->_lifespan; } fVar10 = (local_164.y - 5.0) / (local_178.y - 5.0); if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } fVar10 = pow(1.0 - fVar10,0.5); fVar11 = 1.0; fVar12 = (float)(iVar2 - this->_timeout) / 15.0; if (1.0 <= fVar12) { fVar12 = 1.0; } local_154 = (EntityPtr)(fVar12 * fVar10 * fVar10); } local_164.y = (this->_sprite)._scale.x; local_17c = (EntityPtr)(local_164.y * fVar11); BeamRenderer::Begin(); tmpColor = (ColorMod *)Color::Color(); local_178.x = (this->_posOffset).x + (this->_pos).x + (float)local_158; local_178.y = (this->_posOffset).y + (this->_pos).y + (float)local_18c; pVVar3 = Isaac::GetRenderPosition(&local_19c,&local_178,1); local_178.x = *renderOffset + pVVar3->x; local_178.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_178,tmpColor,(float)local_17c,0.0); tmpColor = (ColorMod *)Color::Color(); pVVar3 = Vector::Resized(&local_184,&local_178,((float)local_154 * 250.0 + 40.0) * local_164.y ); local_164.x = (this->_pos).x + (this->_posOffset).x + pVVar3->x; local_164.y = (this->_posOffset).y + (this->_pos).y + pVVar3->y; pVVar3 = Isaac::GetRenderPosition(&local_184,&local_164,1); fVar10 = 0.0; local_164.x = *renderOffset + pVVar3->x; EVar13 = local_17c; goto LAB_0060a8e9; } } else if (iVar2 == 0xc6) { local_178.x = (this->_targetPosition).x; local_178.y = (this->_targetPosition).y; local_158 = (EntityPtr)(this->_sprite)._scale.x; pvVar6 = g_game->_room; if (ABS(local_178.x) <= ABS(local_178.y)) { fVar10 = *(float *)((int)pvVar6 + 0x20) - *(float *)((int)pvVar6 + 0x18); } else { fVar10 = *(float *)((int)pvVar6 + 0x1c) - *(float *)((int)pvVar6 + 0x14); } local_154 = (EntityPtr)(fVar10 * 0.8); ANM2::GetLayer(&this->_sprite,(byte *)0x1); Color::operator_assign((Color *)auStack_1f0,&(this->_sprite)._color); FUN_004072e0(); Color::operator_assign(&scratchColor,&beamColor); scratchColor._tint[3] = 0.0; BeamRenderer::Begin(); local_164.x = (this->_pos).x + (this->_posOffset).x; local_164.y = (this->_posOffset).y + (this->_pos).y; pVVar3 = Isaac::GetRenderPosition(&local_184,&local_164,1); local_164.x = pVVar3->x + *renderOffset; local_164.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_164,(ColorMod *)&scratchColor,(float)local_158,1.0); auVar9 = ZEXT812(0x42700000); if ((float)local_154 * 0.5 <= auVar9._0_4_) { auVar9._4_8_ = auVar9._4_8_; auVar9._0_4_ = (float)local_154 * 0.5; } pVVar3 = Vector::Resized(&local_178,&local_184,auVar9._0_4_); local_164.x = (this->_posOffset).x + (this->_pos).x + pVVar3->x; local_164.y = (this->_posOffset).y + (this->_pos).y + pVVar3->y; pVVar3 = Isaac::GetRenderPosition(&local_19c,&local_164,1); local_164.x = pVVar3->x + *renderOffset; local_164.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_164,&beamColor,(float)local_158,0.0); pVVar3 = Vector::Resized(&local_178,&local_184,(float)local_154); local_164.x = (this->_posOffset).x + (this->_pos).x + pVVar3->x; local_164.y = (this->_posOffset).y + (this->_pos).y + pVVar3->y; pVVar3 = Isaac::GetRenderPosition(&local_178,&local_164,1); local_164.x = pVVar3->x + *renderOffset; local_164.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_164,(ColorMod *)&scratchColor,(float)local_158,1.0); BeamRenderer::End(); } else if ((iVar2 == 0xbe) && (this->_state != 3)) { fVar10 = (this->_targetPosition).x; fVar12 = (this->_targetPosition).y; pvVar6 = g_game->_room; if (ABS(fVar10) <= ABS(fVar12)) { local_154 = (EntityPtr)(*(float *)((int)pvVar6 + 0x20) - *(float *)((int)pvVar6 + 0x18)); } else { local_154 = (EntityPtr)(*(float *)((int)pvVar6 + 0x1c) - *(float *)((int)pvVar6 + 0x14)); } local_178.x = fVar10; local_178.y = fVar12; BeamRenderer::Begin(); tmpColor = (ColorMod *)Color::Color(); local_164.x = (this->_posOffset).x + (this->_pos).x + fVar10; local_164.y = (this->_pos).y + (this->_posOffset).y + fVar12; pVVar3 = Isaac::GetRenderPosition(&local_184,&local_164,1); local_164.x = *renderOffset + pVVar3->x; local_164.y = pVVar3->y + renderOffset[1]; BeamRenderer::Add(&local_164,tmpColor,1.0,0.0); tmpColor = (ColorMod *)Color::Color(); pVVar3 = Vector::Resized(&local_178,&local_184,(float)local_154 * 0.8); local_164.x = (this->_posOffset).x + (this->_pos).x + pVVar3->x; local_164.y = (this->_pos).y + (this->_posOffset).y + pVVar3->y; pVVar3 = Isaac::GetRenderPosition(&local_178,&local_164,1); EVar13 = (EntityPtr)0x3f800000; fVar10 = 1.0; goto LAB_0060a8db; } if ((this->_variant == 0x6c) && (this->_state == 2)) { fStack_1dc = 8.87695e-39; local_164.y = (float)__RTDynamicCast(); if ((this->_child != (EntityPtr)0x0) && ((((EntityPtr)local_164.y != (EntityPtr)0x0 && (*(char *)((int)local_164.y + 0x111) != '\0')) && (pfVar5 = Sprite::GetNullFrame((Sprite *)&this->_sprite,(byte *)"CarryPos"), pfVar5 != (float *)0x0)))) { local_178.x = *pfVar5 + (this->_renderPosition).x; local_178.y = (this->_renderPosition).y + pfVar5[1]; ANM2::Render((ANM2 *)((int)local_164.y + 8),&local_178,&g_vectorZero,&g_vectorZero); } } LAB_0060ab8d: FUN_008614f0(); return; LAB_00607e4b: BeamRenderer::End(); goto LAB_0060ab8d; } //@@ 0060abb0 Entity_Effect::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_Effect::ClearReferences(Entity_Effect *this) { EntityPtr this_00; int iVar1; iVar1 = this->_variant; if (iVar1 == 0xb3) { this_00 = this->_target; if ((this_00 == (EntityPtr)0x0) || (*(int *)((int)this_00 + 0x28) != 1)) goto LAB_0060ac03; Entity_Player::AddUrnSouls((Entity_Player *)this_00,1); iVar1 = this->_variant; } if (((iVar1 == 0xc1) && (this->_subtype == 0)) && (this->_visible == 0)) { SFXManager::Stop(&g_manager->_sfxManager,0x1f7); } LAB_0060ac03: Entity::ClearReferences((Entity *)this); ExtraDataRef::Set(0); return; } //@@ 0060ac20 Entity_Effect::IsPlayerCreep /* ZHL [lua] Lua binding EntityEffect:IsPlayerCreep */ undefined4 Entity_Effect::IsPlayerCreep(int param_1) { if (((((param_1 == 0x36) || (param_1 == 0x2d)) || (param_1 == 0x2e)) || ((((param_1 == 0x2c || (param_1 == 0x25)) || ((param_1 == 0x35 || ((param_1 == 0x20 || (param_1 == 0x4e)))))) || (param_1 == 0xcc)))) || (((param_1 == 0x5c || (param_1 == 0x5a)) || (param_1 == 0x5d)))) { return 1; } return 0; } //@@ 0060ac70 room_perimeter_to_position /* DB: ? (out, {inset, t}): clamps inset to [-10, 40], wraps t with fmodf over the room perimeter (Room +0x18..+0x20 bounds) and interpolates along the walls; two calls in Entity_Effect::Update (005f85ce/005f882a) */ void room_perimeter_to_position(float *param_1,float *param_2) { void *pvVar1; Game *pGVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float local_2c; float local_28; float local_24; pGVar2 = g_game; fVar3 = *param_2; if (fVar3 <= -10.0) { fVar3 = -10.0; } if (40.0 <= fVar3) { fVar3 = 40.0; } *param_2 = fVar3; pvVar1 = pGVar2->_room; fVar7 = *(float *)((int)pvVar1 + 0x20); fVar8 = *(float *)((int)pvVar1 + 0x18); fVar9 = *(float *)((int)pvVar1 + 0x1c); local_24 = *(float *)((int)pvVar1 + 0x14); local_28 = fVar7 - fVar8; fVar6 = fVar9 - local_24; fVar5 = fVar6 + fVar6 + local_28 + local_28; fVar4 = fmodf(param_2[1],fVar5); param_2[1] = fVar4; if (fVar4 < 0.0) { fVar4 = fVar4 + fVar5; param_2[1] = fVar4; } if (local_28 <= fVar4) { fVar5 = fVar9 + 40.0; fVar12 = fVar5; if (fVar6 + local_28 <= fVar4) { fVar10 = local_28 + local_28 + fVar6; local_2c = fVar7 + 40.0; if (fVar4 < fVar10) { fVar4 = fVar4 - (fVar6 + local_28); fVar11 = fVar8 - 40.0; fVar10 = fVar7; local_24 = fVar9; goto LAB_0060ae81; } fVar12 = local_24 - 40.0; fVar8 = fVar9; } else { local_2c = fVar8 - 40.0; fVar7 = fVar8; fVar8 = local_24; fVar5 = local_24 - 40.0; fVar10 = local_28; local_24 = fVar9; } fVar4 = fVar4 - fVar10; fVar10 = fVar7; fVar11 = local_2c; fVar9 = fVar8; fVar8 = fVar7; local_28 = fVar6; } else { local_2c = fVar8 - 40.0; fVar10 = fVar8; fVar11 = fVar7 + 40.0; fVar9 = local_24; fVar8 = fVar7; fVar5 = local_24 - 40.0; fVar12 = local_24 - 40.0; } LAB_0060ae81: fVar3 = fVar3 / 40.0; fVar5 = (fVar9 - fVar5) * fVar3 + fVar5; fVar11 = (fVar8 - fVar11) * fVar3 + fVar11; param_1[1] = (((fVar10 - local_2c) * fVar3 + local_2c) - fVar11) * (fVar4 / local_28) + fVar11; *param_1 = (((local_24 - fVar12) * fVar3 + fVar12) - fVar5) * (fVar4 / local_28) + fVar5; return; } //@@ 0060af00 Entity_Effect::CreateTimer /* ZHL [exact] static cleanup Entity_Effect* Entity_Effect::CreateTimer(void* fn, uint32_t delay, uint32_t times, bool persistent); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity_Effect * __cdecl Entity_Effect::CreateTimer(void *fn,uint delay,uint times,byte isPersistent) { uint *puVar1; qword qVar2; uint seed; Entity_Effect *pEVar3; seed = Random(); pEVar3 = (Entity_Effect *) Game::SpawnEx(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,seed,0); *(void **)&(pEVar3->_varData)._l = fn; *(uint *)((int)&(pEVar3->_varData)._l + 4) = delay; *(uint *)&(pEVar3->_varData)._h = times; if (isPersistent != 0) { qVar2 = pEVar3->_flags; puVar1 = (uint *)((int)&pEVar3->_flags + 4); *puVar1 = *puVar1 | 0x20; *(int *)&pEVar3->_flags = (int)qVar2; } return pEVar3; } //@@ 0060af70 Entity::AddFear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddFear(const EntityRef& ref, int duration, bool ignoreBossStatusCooldown); */ Entity * __thiscall Entity::AddFear(Entity *this,int param_2,int param_3,EntityPtr param_4) { float fVar1; float fVar2; uint seed; Entity *pEVar3; undefined4 *in_EDX; float fVar4; float fVar5; undefined1 local_3c [2]; undefined1 auStack_3a [2]; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; local_c = __security_cookie ^ (uint)local_3c; seed = Random(); pEVar3 = Game::SpawnEx(g_game,1000,0x79,(Vector *)this,&g_vectorZero,(Entity *)0x0,0,seed,0); local_18 = 0; fVar5 = 0.0; local_14 = 0; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; local_38 = *in_EDX; uStack_34 = in_EDX[1]; uStack_30 = in_EDX[2]; uStack_2c = in_EDX[3]; local_10 = 0; (**(code **)(*(int *)pEVar3 + 0x3c))(&local_38,0xffffffff,0xff); fVar4 = fVar5 * g_vectorOne.x; if (param_2 < 1) { param_2 = -1; } fVar5 = fVar5 * g_vectorOne.y; *(int *)(pEVar3[1]._sprite._filename._buf + 8) = param_2; *(int *)(pEVar3[1]._sprite._filename._buf + 0xc) = param_2; (pEVar3->_sprite)._scale.x = fVar4; if (param_3 < 1) { param_3 = 6; } (pEVar3->_sprite)._scale.y = fVar5; *(int *)&pEVar3[1].field_0x44 = param_3; if (param_4 != (EntityPtr)0x0) { if (pEVar3->_parent != (EntityPtr)0x0) { std::multiset::erase(local_3c + -0x14); } pEVar3->_parent = param_4; std::multiset::insert(&pEVar3->_parent); fVar5 = (pEVar3->_pos).x; fVar4 = (pEVar3->_pos).y; fVar1 = *(float *)((int)param_4 + 0x33c); fVar2 = *(float *)((int)param_4 + 0x340); *(undefined1 *)&pEVar3[1]._sprite._filename._size = 1; pEVar3[1]._sprite._filename._capacity = (uint)(fVar5 - fVar1); *(float *)pEVar3[1]._sprite._animDefaultName._buf = fVar4 - fVar2; } return pEVar3; } //@@ 0060b0d0 Entity_Effect::update_variant178_shooter /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Effect variant switch case 0xb2 (178) calls it with 1: effect follows parent (+0x3bc), approach_angle/fmodf toward parent angle (+0x474) into +0xec, anims Up/Down/Left/Right/Idle/Shoot/ShootBegin/ShootLoop/ShootEnd (shared with Mother 2 / Mothers Shadow); Remove when parentless prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Effect::update_variant178_shooter(Entity_Effect *this,byte isPositionOnly) { float fVar1; EntityPtr EVar2; byte bVar3; char *directionName; int iVar4; byte *******pppppppbVar5; byte *pbVar6; void *freeBlock; byte *pbVar7; char *currentAnimName; uint uVar8; byte *pbVar9; byte *******pppppppbVar10; bool bVar11; float fVar12; float fVar13; float fVar14; undefined8 uVar15; float turnLerp; byte *fullAnimName; void *local_84 [4]; undefined4 local_74; uint local_70; void *local_6c; undefined4 local_5c; uint local_58; void *local_54 [4]; undefined4 local_44; uint local_40; byte *******joinedAnimName [5]; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; byte ******local_14; puStack_20 = (undefined1 *)(joinedAnimName + 0xe); local_14 = (byte ******)0xffffffff; puStack_18 = &DAT_00af6605; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(joinedAnimName + 0xb); EVar2 = this->_parent; if (EVar2 == (EntityPtr)0x0) { if (isPositionOnly == 0) { ExceptionList = &local_1c; puStack_20 = (undefined1 *)(joinedAnimName + 0xe); (**(code **)(*(int *)this + 0x28))(local_24); ExceptionList = local_1c; return; } return; } fVar13 = 0.4; turnLerp = 0.4; ExceptionList = &local_1c; pppppppbVar10 = (byte *******)(joinedAnimName + 0xe); if (isPositionOnly == 0) { fVar1 = this->_speedMultiplier; if (fVar1 != 1.0) { fVar13 = 0.4 / ((fVar1 + 0.4) - fVar1 * 0.4); } fVar1 = (this->_sprite)._rotation; fVar12 = this->_rotation; fVar14 = fVar12 - fVar1; pppppppbVar10 = (byte *******)(joinedAnimName + 0xe); if (360.0 < ABS(fVar14)) { fVar14 = fmodf(fVar14,360.0); pppppppbVar10 = (byte *******)puStack_20; } puStack_20 = (undefined1 *)pppppppbVar10; if (fVar14 <= 180.0) { if (fVar14 < -180.0) { fVar14 = fVar14 + 360.0; } } else { fVar14 = fVar14 - 360.0; } fVar13 = approach_angle(fVar1,fVar12,ABS(fVar14 * fVar13)); (this->_sprite)._rotation = fVar13; pppppppbVar10 = (byte *******)puStack_20; } puStack_20 = (undefined1 *)pppppppbVar10; fVar13 = this->_speedMultiplier; if (fVar13 != 1.0) { turnLerp = 0.4 / ((fVar13 + 0.4) - fVar13 * 0.4); } fVar13 = (this->_sprite)._rotation; if (isPositionOnly != 0) { fVar1 = this->_rotation; fVar12 = fVar1 - fVar13; if (360.0 < ABS(fVar12)) { fVar12 = fmodf(fVar12,360.0); } if (fVar12 <= 180.0) { if (fVar12 < -180.0) { fVar12 = fVar12 + 360.0; } } else { fVar12 = fVar12 - 360.0; } fVar13 = approach_angle(fVar13,fVar1,ABS(fVar12 * turnLerp) * 0.5); } fVar14 = sin(fVar13 * 0.017453292); fVar1 = *(float *)((int)EVar2 + 0x33c); fVar12 = *(float *)((int)EVar2 + 0x340); fVar13 = cos(fVar13 * 0.017453292); (this->_pos).x = fVar1 + fVar13 * 18.0; (this->_pos).y = fVar12 + fVar14 * 18.0; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; if (isPositionOnly != 0) { ExceptionList = local_1c; return; } iVar4 = this->_state; if (iVar4 < 0) { this->_state = iVar4 + 1; switchD_0060b3c2_caseD_0: pbVar9 = s_Idle; } else { switch(iVar4) { case 0: goto switchD_0060b3c2_caseD_0; case 1: case 2: pbVar9 = (byte *)"ShootBegin"; break; case 3: pbVar9 = (byte *)"ShootLoop"; break; case 4: pbVar9 = (byte *)"ShootEnd"; break; default: goto switchD_0060b3c2_default; } } fVar13 = (this->_sprite)._rotation; if (360.0 < ABS(fVar13)) { fVar13 = fmodf(fVar13,360.0); } if (fVar13 <= 180.0) { if (fVar13 < -180.0) { fVar13 = fVar13 + 360.0; } } else { fVar13 = fVar13 - 360.0; } if ((fVar13 < 20.0) || (160.0 < fVar13)) { if ((fVar13 < -160.0) || (-20.0 < fVar13)) { if ((160.0 < fVar13) || (directionName = "Right", fVar13 < -160.0)) { directionName = "Left"; } } else { directionName = "Up"; } } else { directionName = "Down"; } currentAnimName = (this->_sprite)._animState._animData; if (currentAnimName != (char *)0x0) { pbVar6 = pbVar9; do { bVar3 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar3 != 0); if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(char **)currentAnimName; } iVar4 = strncmp((char *)pbVar9,currentAnimName,(int)pbVar6 - (int)(pbVar9 + 1)); if (iVar4 == 0) { std::string::string_from_cstr((char *)local_54,pbVar9); local_14 = (byte ******)0x0; FUN_0060c790(directionName); local_14 = (byte ******)CONCAT31(local_14._1_3_,2); if (0xf < local_40) { uVar8 = local_40 + 1; freeBlock = local_54[0]; if (0xfff < uVar8) { freeBlock = *(void **)((int)local_54[0] + -4); uVar8 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar8); } pppppppbVar10 = joinedAnimName[0]; local_44 = 0; local_40 = 0xf; local_54[0] = (void *)((uint)local_54[0] & 0xffffff00); uVar15 = _string_holder_c_str(); do { pbVar6 = (byte *)((ulonglong)uVar15 >> 0x20); pbVar9 = (byte *)uVar15; bVar3 = *pbVar6; bVar11 = bVar3 < *pbVar9; if (bVar3 != *pbVar9) { LAB_0060b567: uVar8 = -(uint)bVar11 | 1; goto LAB_0060b56c; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar11 = bVar3 < pbVar9[1]; if (bVar3 != pbVar9[1]) goto LAB_0060b567; uVar15 = CONCAT44(pbVar6 + 2,pbVar9 + 2); } while (bVar3 != 0); uVar8 = 0; LAB_0060b56c: if (uVar8 != 0) { pppppppbVar5 = (byte *******)joinedAnimName; if (0xf < local_28) { pppppppbVar5 = pppppppbVar10; } ANM2::SetAnimation(&this->_sprite,(byte *)pppppppbVar5,0); pppppppbVar10 = joinedAnimName[0]; } local_14 = (byte ******)0xffffffff; if (0xf < local_28) { uVar8 = local_28 + 1; pppppppbVar5 = pppppppbVar10; if (0xfff < uVar8) { pppppppbVar5 = (byte *******)pppppppbVar10[-1]; uVar8 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbVar10 + (-4 - (int)pppppppbVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar5,uVar8); } goto switchD_0060b3c2_default; } } std::string::string_from_cstr((char *)local_84,pbVar9); local_14 = (byte ******)0x3; fullAnimName = (byte *)FUN_0060c790(directionName); local_14._0_1_ = 4; if (0xf < *(uint *)(fullAnimName + 0x14)) { fullAnimName = *(byte **)fullAnimName; } pbVar9 = (this->_sprite)._animState._animData; if (pbVar9 == (byte *)0x0) { LAB_0060b64b: bVar3 = ANM2::SetAnimation(&this->_sprite,fullAnimName,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar9; pbVar7 = fullAnimName; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar6 = *(byte **)pbVar9; } do { bVar3 = *pbVar6; bVar11 = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_0060b632: uVar8 = -(uint)bVar11 | 1; goto LAB_0060b637; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar11 = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_0060b632; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar8 = 0; LAB_0060b637: if ((uVar8 != 0) || ((pbVar9[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0060b64b; } local_14 = (byte ******)CONCAT31(local_14._1_3_,3); if (0xf < local_58) { uVar8 = local_58 + 1; freeBlock = local_6c; if (0xfff < uVar8) { freeBlock = *(void **)((int)local_6c + -4); uVar8 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c + (-4 - (int)freeBlock))) goto LAB_0060b6dc; } operator_delete(freeBlock,uVar8); } local_14 = (byte ******)0xffffffff; local_5c = 0; local_58 = 0xf; local_6c = (void *)((uint)local_6c & 0xffffff00); if (0xf < local_70) { uVar8 = local_70 + 1; freeBlock = local_84[0]; if (0xfff < uVar8) { freeBlock = *(void **)((int)local_84[0] + -4); uVar8 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)freeBlock))) { LAB_0060b6dc: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar8); } local_74 = 0; local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); switchD_0060b3c2_default: iVar4 = this->_state; if (iVar4 == 1) { if (((this->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Shoot"), bVar3 != 0)) { this->_state = 2; } } else if (iVar4 == 2) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { this->_state = 3; } } else if ((iVar4 == 4) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { this->_state = 0; } ExceptionList = local_1c; return; } //@@ 0060b7a0 Entity_Effect::CreateLootPreview /* ZHL [exact] static cleanup Entity_Effect* Entity_Effect::CreateLootPreview(LootList* lootlist, Vector* pos, Entity* owner, Entity_Effect* effect); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ Entity_Effect * __cdecl Entity_Effect::CreateLootPreview(void *lootlist,Vector *pos,Entity *owner,Entity_Effect *effect) { EntityPtr *pEVar1; float fVar2; float fVar3; float fVar4; float fVar5; uint seed; Entity_Effect *pEVar6; EntityPtr *local_c [2]; local_c[0] = lootlist; if (((effect == (Entity_Effect *)0x0) || (effect->_type != 1000)) || (effect->_variant != 0xbf)) { seed = Random(); effect = (Entity_Effect *) Game::SpawnEx(g_game,1000,0xbf,pos,&g_vectorZero,(Entity *)0x0,0,seed,0); } (effect->_pos).x = pos->x; (effect->_pos).y = pos->y; setup_loot_preview(effect,lootlist); if (owner != (Entity *)0x0) { pEVar1 = &effect->_parent; if (effect->_parent != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)owner; std::multiset::insert(pEVar1); fVar2 = (effect->_pos).x; fVar3 = (effect->_pos).y; fVar4 = (owner->_pos).x; fVar5 = (owner->_pos).y; effect->_isFollowing = 1; (effect->_parentOffset).x = fVar2 - fVar4; (effect->_parentOffset).y = fVar3 - fVar5; } pEVar6 = (Entity_Effect *)0x0; if (effect->_exists != 0) { pEVar6 = effect; } return pEVar6; } //@@ 0060b890 Entity::SpawnFollowingEffect198 /* DB: ? spawns effect 1000.198, FollowParent, SetColor, timeout prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity_Effect * __cdecl Entity::SpawnFollowingEffect198 (Entity *parent,Vector *offset,Vector *targetPosition,int timeout,ColorMod *color, float scale) { float fVar1; int iVar2; uint seed; Entity_Effect *this; float fVar3; Vector local_c; if ((((parent == (Entity *)0x0) || (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) || (iVar2 = *(int *)((int)g_game->_room + 4), iVar2 == 0)) || (((iVar2 = *(int *)(iVar2 + 0x10), iVar2 == 0 || (iVar2 = *(int *)(iVar2 + 0x48), iVar2 == 1)) || ((iVar2 == 2 || (iVar2 == 3)))))) { return (Entity_Effect *)0x0; } seed = Random(); local_c.x = (parent->_pos).x + offset->x; local_c.y = (parent->_pos).y + offset->y; this = (Entity_Effect *)Game::Spawn(g_game,1000,0xc6,&local_c,&g_vectorZero,(Entity *)0x0,0,seed); if (this != (Entity_Effect *)0x0) { Entity_Effect::FollowParent(this,parent); Sprite::SetColor((Sprite *)&this->_sprite,color); fVar3 = scale * g_vectorOne.x; (this->_sprite)._scale.y = scale * g_vectorOne.y; (this->_sprite)._scale.x = fVar3; fVar3 = targetPosition->x; fVar1 = targetPosition->y; this->_timeout = timeout; this->_lifespan = timeout; iVar2 = *(int *)this; (this->_targetPosition).x = fVar3; (this->_targetPosition).y = fVar1; (**(code **)(iVar2 + 0xc))(); } return this; } //@@ 0060b9d0 NpcHelper::spawn_tracer_effect198 /* DB: Game::Spawn(1000, 0xc6 generic tracer) at ECX pos, direction EDX, SetColor(param_2), scale param_3, timeout 0x18; only caller NpcAI::ENTITY_FLY (Soul Sucker death, four cardinal warnings); notes/entities/pass7_i3.md */ Entity * NpcHelper::spawn_tracer_effect198(undefined4 param_1,ColorMod *param_2,float param_3) { int iVar1; ANM2 *pAVar2; uint seed; Entity *pEVar3; Vector *in_ECX; float *in_EDX; float fVar4; if ((((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (iVar1 = *(int *)((int)g_game->_room + 4), iVar1 == 0)) || (iVar1 = *(int *)(iVar1 + 0x10), iVar1 == 0)) || (((iVar1 = *(int *)(iVar1 + 0x48), iVar1 == 1 || (iVar1 == 2)) || (iVar1 == 3)))) { return (Entity *)0x0; } seed = Random(); pEVar3 = Game::Spawn(g_game,1000,0xc6,in_ECX,&g_vectorZero,(Entity *)0x0,0,seed); if (pEVar3 != (Entity *)0x0) { Sprite::SetColor((Sprite *)&pEVar3->_sprite,param_2); fVar4 = param_3 * g_vectorOne.y; (pEVar3->_sprite)._scale.x = param_3 * g_vectorOne.x; (pEVar3->_sprite)._scale.y = fVar4; fVar4 = in_EDX[1]; iVar1 = *(int *)pEVar3; (pEVar3->_targetPosition).x = *in_EDX; (pEVar3->_targetPosition).y = fVar4; pAVar2 = &pEVar3[1]._sprite; (pAVar2->_filename)._buf[8] = '\x18'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar3[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x18'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar1 + 0xc))(); } return pEVar3; } //@@ 0060bae0 Entity_Effect::setup_loot_preview /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: only caller CreateLootPreview, right after spawning 1000.191; questionmark.png, Pickup_PickVariant, ItemConfig::GetCollectible, forced/prevented curses prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Effect::setup_loot_preview(Entity_Effect *this,void *lootQueue) { void *pvVar1; uint uVar2; code *pcVar3; undefined8 uVar4; char isPicked; byte bVar5; EntityConfig_Entity *entityConfig; LayerState *layer; byte *pbVar6; uint uVar7; uint preventedCurses; ItemConfig_Item *item; uint uVar8; std_string *psVar9; byte unk; byte *ptr; int iVar10; undefined4 *puVar11; undefined4 *puVar12; int iVar13; ANM2 *pAVar14; undefined4 local_dc [8]; undefined4 local_bc; undefined4 uStack_b8; undefined4 local_b4; byte *entryType; uint entryVariant; undefined4 *entrySubType; byte *entrySeed; Entity_Effect *effect; undefined1 local_98 [4]; ANM2 *lootIt [2]; uint local_8c; ANM2 *lootType; uint lootVariant; undefined8 uStack_80; undefined4 *local_78; ANM2 *lootMap; undefined4 lootMapSize; int ghostData; byte *local_68; uint local_64; ANM2 *local_60; byte *local_5c; undefined4 *local_58; std_string itemGfxPath; undefined1 local_3c [8]; uint uStack_34; int iStack_30; uint uStack_2c; undefined4 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; ANM2 *sprite; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af6655; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; effect = this; ghostData = __RTDynamicCast(*(undefined4 *)(this + 1),0, &IsaacRepentancePlus::Entity_Effect::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::PickupGhostData::RTTI_Type_Descriptor,0,local_24 ); if (ghostData == 0) { (**(code **)(*(int *)this + 0x28))(); } else { pAVar14 = (ANM2 *)(ghostData + 4); iVar13 = 4; do { if (pAVar14->_loaded != 0) { ANM2::Reset(pAVar14); } iVar10 = ghostData; pAVar14 = pAVar14 + 1; iVar13 = iVar13 + -1; } while (iVar13 != 0); *(undefined4 *)(ghostData + 0x454) = 0; lootMap = (ANM2 *)0x0; lootMapSize = 0; lootMap = operator_new(0x28); *(ANM2 **)(lootMap->_filename)._buf = lootMap; *(ANM2 **)((lootMap->_filename)._buf + 4) = lootMap; *(ANM2 **)((lootMap->_filename)._buf + 8) = lootMap; (lootMap->_filename)._buf[0xc] = '\x01'; (lootMap->_filename)._buf[0xd] = '\x01'; local_14 = 0; local_64 = 0; if (*(int *)((int)lootQueue + 0x10) != 0) { do { local_8c = *(int *)((int)lootQueue + 0xc) + local_64; puVar11 = *(undefined4 **) (*(int *)((int)lootQueue + 4) + (*(int *)((int)lootQueue + 8) - 1U & local_8c) * 4); lootType = (ANM2 *)*puVar11; lootVariant = puVar11[1]; uStack_80 = *(undefined8 *)(puVar11 + 2); local_78 = (undefined4 *)puVar11[4]; iVar13 = puVar11[2]; uVar8 = puVar11[3]; local_60 = lootType; local_58 = local_78; if (lootType == (ANM2 *)&DAT_00000005) { isPicked = Pickup_PickVariant(&uStack_80,0,0); if (isPicked != '\0') { local_58 = local_78; local_60 = lootType; iVar13 = (int)uStack_80; uVar8 = uStack_80._4_4_; goto LAB_0060bc31; } } else { LAB_0060bc31: uVar2 = lootVariant; if (g_game->_challenge == 0x2b) { if (lootVariant != 300) goto LAB_0060bcab; uStack_80 = CONCAT44(uStack_80._4_4_,0x10); uVar4 = uStack_80; uStack_80._0_4_ = 0x10; iVar10 = 0x10; iVar13 = (int)uStack_80; uVar8 = uStack_80._4_4_; uStack_80 = uVar4; } else if (lootVariant == 300) { if ((((int)uStack_80 < 0) || (pvVar1 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar1 >> 2 <= (int)uStack_80)) || (iVar13 = *(int *)((int)pvVar1 + (int)uStack_80 * 4), iVar13 == 0)) { iVar10 = 2; uStack_80 = CONCAT44(uStack_80._4_4_,2); uVar4 = uStack_80; uStack_80._0_4_ = 2; iVar13 = (int)uStack_80; uVar8 = uStack_80._4_4_; uStack_80 = uVar4; } else { iVar10 = *(int *)(iVar13 + 0x54); uStack_80 = CONCAT44(uStack_80._4_4_,iVar10); iVar13 = iVar10; uVar8 = uStack_80._4_4_; } } else { LAB_0060bcab: iVar10 = (int)uStack_80; } pAVar14 = local_60; uVar7 = lootVariant; lootType = local_60; local_78 = local_58; entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,(int)local_60,lootVariant,iVar10); if (entityConfig != (EntityConfig_Entity *)0x0) { if (local_60 == (ANM2 *)&DAT_00000005) { if (uVar2 < 0x29) { if (uVar2 == 0x28) { if (((iVar10 == 4) || (iVar10 == 6)) || (iVar10 == 7)) { LAB_0060bd04: local_3c._0_4_ = (byte *)0x1f4; } else { local_3c._0_4_ = (byte *)0xa; } } else if (uVar2 == 10) { if (((iVar10 == 4) || (iVar10 == 7)) || (iVar10 == 0xb)) goto LAB_0060bd04; if ((((iVar10 == 6) || (iVar10 == 10)) || (iVar10 == 3)) || (iVar10 == 8)) { local_3c._0_4_ = (byte *)0xc8; } else { local_3c._0_4_ = (byte *)0xa; } } else if (uVar2 == 0x14) { if ((iVar10 == 3) || (iVar10 == 5)) goto LAB_0060bd04; local_3c._0_4_ = (byte *)0xa; if (iVar10 == 2) { local_3c._0_4_ = (byte *)0xc8; } } else { if (uVar2 != 0x1e) goto LAB_0060bd7e; if ((iVar10 == 2) || (iVar10 == 4)) goto LAB_0060bd04; local_3c._0_4_ = (byte *)0xa; } } else if (uVar2 == 100) { local_3c._0_4_ = (byte *)0x2710; } else if (uVar2 == 0x15e) { local_3c._0_4_ = (byte *)0x3e8; } else { LAB_0060bd7e: local_3c._0_4_ = (byte *)0x32; } } else { local_3c._0_4_ = (byte *)0x0; } local_28 = local_58; local_3c._4_4_ = pAVar14; uStack_34 = uVar7; iStack_30 = iVar13; uStack_2c = uVar8; std::multimap::emplace(local_98,local_3c); } } local_64 = local_64 + 1; } while (local_64 < *(uint *)((int)lootQueue + 0x10)); iVar10 = ghostData; } pAVar14 = lootMap; lootIt[0] = lootMap; if (lootMap != *(ANM2 **)(lootMap->_filename)._buf) { while (iVar13 = *(int *)(iVar10 + 0x454), iVar13 < 4) { local_60 = lootIt[0]; std::_Tree_iterator::operator_decrement(&local_60); entryType = (byte *)(local_60->_filename)._capacity; entryVariant = *(uint *)(local_60->_animDefaultName)._buf; entrySubType = *(undefined4 **)((local_60->_animDefaultName)._buf + 4); entrySeed = *(byte **)((local_60->_animDefaultName)._buf + 8); local_68 = entryType; local_64 = entryVariant; local_58 = entrySubType; entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,(int)entryType,entryVariant, (int)entrySubType); if (entityConfig != (EntityConfig_Entity *)0x0) { *(int *)(ghostData + 0x454) = *(int *)(ghostData + 0x454) + 1; pAVar14 = (ANM2 *)(ghostData + 4 + iVar13 * 0x114); local_60 = pAVar14; ANM2::Load(pAVar14,&entityConfig->anm2Path,0); layer = ANM2::GetLayer(pAVar14,(byte *)0x0); (layer->_pos).x = 0.0; (layer->_pos).y = -4.0; if (local_68 == &DAT_00000005) { if (local_64 == 0x15e) { pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((int)((uint)local_58 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) { iVar13 = *(int *)((int)pvVar1 + ((uint)local_58 & 0x7fff) * 4); } else { iVar13 = 0; } local_64 = *(uint *)(iVar13 + 0x48); local_58 = (undefined4 *)(iVar13 + 0x38); if (0xf < *(uint *)(iVar13 + 0x4c)) { local_58 = (undefined4 *)*local_58; } if (local_64 < 0x10) { local_5c = (byte *)*local_58; local_3c._4_4_ = local_58[1]; uStack_34 = local_58[2]; iStack_30 = local_58[3]; puVar11 = (undefined4 *)&DAT_0000000f; local_3c._0_4_ = local_5c; } else { puVar11 = (undefined4 *)(local_64 | 0xf); if ((undefined4 *)0x7fffffff < puVar11) { puVar11 = (undefined4 *)0x7fffffff; } local_5c = std::_Allocate((uint)((int)puVar11 + 1)); local_3c._0_4_ = local_5c; memcpy(local_5c,local_58,local_64 + 1); } sprite = local_60; local_14._0_1_ = 1; uStack_2c = local_64; local_28 = puVar11; if (0 < pAVar14->_layerCount) { local_58 = pAVar14->_layerState; local_8c = local_58[6]; local_68 = (byte *)(local_58 + 2); if (0xf < (uint)local_58[7]) { local_68 = *(byte **)local_68; } pbVar6 = local_3c; if (&DAT_0000000f < puVar11) { pbVar6 = local_5c; } bVar5 = str_eq(pbVar6,local_64,local_68,local_8c); pAVar14 = sprite; if (bVar5 == 0) { if (local_58 + 2 == (undefined4 *)local_3c) { puVar12 = local_58; } else { pbVar6 = local_3c; if (&DAT_0000000f < puVar11) { pbVar6 = local_5c; } std::string::assign((char *)(local_58 + 2),pbVar6,local_64); local_5c = (byte *)local_3c._0_4_; puVar12 = sprite->_layerState; puVar11 = local_28; } *(undefined1 *)(puVar12 + 0xc) = 0; } } local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < puVar11) { puVar12 = (undefined4 *)((int)puVar11 + 1); ptr = local_5c; if ((undefined4 *)0xfff < puVar12) { ptr = *(byte **)(local_5c + -4); puVar12 = puVar11 + 9; if ((byte *)0x1f < local_5c + (-4 - (int)ptr)) goto LAB_0060c2e6; } LAB_0060c216: operator_delete(ptr,(uint)puVar12); } } else if (local_64 == 100) { layer = ANM2::GetLayer(pAVar14,(byte *)0x1); (layer->_pos).x = 0.0; (layer->_pos).y = 4.0; if (local_58 != (undefined4 *)0x0) { uVar8 = g_game->_debugCurses; uVar2 = g_game->_curses; uVar7 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (uVar7 | uVar8 | uVar2) & 0x40) == 0) { item = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_58); std::string::string(itemGfxPath._buf,&item->gfxFilename); local_14._0_1_ = 3; if (g_game->_challenge == 0x20) { uStack_80 = 0x150000000b; local_8c = 0xd; local_68 = (byte *)0x0; pbVar6 = entrySeed; while( true ) { manager = g_manager; if (pbVar6 == (byte *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar8 = (uint)pbVar6 >> ((byte)uStack_80 & 0x1f) ^ (uint)pbVar6; uVar8 = uVar8 << ((byte)((ulonglong)uStack_80 >> 0x20) & 0x1f) ^ uVar8; local_5c = (byte *)(uVar8 >> ((byte)local_8c & 0x1f) ^ uVar8); iVar13 = (uint)local_5c % 0x2dc + 1; if ((((iVar13 != 0) && (iVar13 < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2)) && (iVar13 != 0xeb)) && (((iVar13 != 0x2b && (iVar13 != 0x3d)) && (item = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar13), item != (ItemConfig_Item *)0x0)))) break; local_68 = local_68 + 1; if (0xe < (int)local_68) goto LAB_0060c1d7; pbVar6 = local_5c; } item = ItemConfig::GetCollectible(&manager->_itemConfig,iVar13); psVar9 = &item->gfxFilename; if (&itemGfxPath != psVar9) { if (0xf < (item->gfxFilename)._capacity) { psVar9 = *(std_string **)psVar9->_buf; } std::string::assign(itemGfxPath._buf,(byte *)psVar9,(item->gfxFilename)._size) ; } } LAB_0060c1d7: pAVar14 = local_60; Sprite::ReplaceSpritesheet((Sprite *)local_60,1,&itemGfxPath); local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < itemGfxPath._capacity) { pbVar6 = (byte *)itemGfxPath._buf._0_4_; puVar11 = (undefined4 *)itemGfxPath._capacity; goto LAB_0060c1f6; } } else { local_3c._0_4_ = std::_Allocate(0x30); pAVar14 = local_60; uStack_2c = 0x27; local_28 = (undefined4 *)&DAT_0000002f; *(char *)(local_3c._0_4_ + 0) = 'g'; *(char *)(local_3c._0_4_ + 1) = 'f'; *(char *)(local_3c._0_4_ + 2) = 'x'; *(char *)(local_3c._0_4_ + 3) = '/'; *(char *)(local_3c._0_4_ + 4) = 'I'; *(char *)(local_3c._0_4_ + 5) = 't'; *(char *)(local_3c._0_4_ + 6) = 'e'; *(char *)(local_3c._0_4_ + 7) = 'm'; *(char *)(local_3c._0_4_ + 8) = 's'; *(char *)(local_3c._0_4_ + 9) = '/'; *(char *)(local_3c._0_4_ + 10) = 'C'; *(char *)(local_3c._0_4_ + 0xb) = 'o'; *(char *)(local_3c._0_4_ + 0xc) = 'l'; *(char *)(local_3c._0_4_ + 0xd) = 'l'; *(char *)(local_3c._0_4_ + 0xe) = 'e'; *(char *)(local_3c._0_4_ + 0xf) = 'c'; *(char *)(local_3c._0_4_ + 0x10) = 't'; *(char *)(local_3c._0_4_ + 0x11) = 'i'; *(char *)(local_3c._0_4_ + 0x12) = 'b'; *(char *)(local_3c._0_4_ + 0x13) = 'l'; *(char *)(local_3c._0_4_ + 0x14) = 'e'; *(char *)(local_3c._0_4_ + 0x15) = 's'; *(char *)(local_3c._0_4_ + 0x16) = '/'; *(char *)(local_3c._0_4_ + 0x17) = 'q'; *(char *)(local_3c._0_4_ + 0x18) = 'u'; *(char *)(local_3c._0_4_ + 0x19) = 'e'; *(char *)(local_3c._0_4_ + 0x1a) = 's'; *(char *)(local_3c._0_4_ + 0x1b) = 't'; *(char *)(local_3c._0_4_ + 0x1c) = 'i'; *(char *)(local_3c._0_4_ + 0x1d) = 'o'; *(char *)(local_3c._0_4_ + 0x1e) = 'n'; *(char *)(local_3c._0_4_ + 0x1f) = 'm'; *(char *)(local_3c._0_4_ + 0x20) = 'a'; *(char *)(local_3c._0_4_ + 0x21) = 'r'; *(char *)(local_3c._0_4_ + 0x22) = 'k'; *(char *)(local_3c._0_4_ + 0x23) = '.'; *(byte *)(local_3c._0_4_ + 0x24) = 0x70; *(byte *)(local_3c._0_4_ + 0x25) = 0x6e; *(byte *)(local_3c._0_4_ + 0x26) = 0x67; *(byte *)(local_3c._0_4_ + 0x27) = 0; local_14._0_1_ = 2; Sprite::ReplaceSpritesheet((Sprite *)local_60,1,(std_string *)local_3c); local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < local_28) { pbVar6 = (byte *)local_3c._0_4_; puVar11 = local_28; LAB_0060c1f6: puVar12 = (undefined4 *)((int)puVar11 + 1); ptr = pbVar6; if ((undefined4 *)0xfff < puVar12) { ptr = *(byte **)(pbVar6 + -4); puVar12 = puVar11 + 9; if ((byte *)0x1f < pbVar6 + (-4 - (int)ptr)) { LAB_0060c2e6: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto LAB_0060c216; } } } } } layer = ANM2::GetLayer(pAVar14,(byte *)"shadow"); if (layer != (LayerState *)0x0) { layer->_visible = 0; } ANM2::LoadGraphics(pAVar14,unk); psVar9 = &pAVar14->_animDefaultName; if (0xf < (pAVar14->_animDefaultName)._capacity) { psVar9 = *(std_string **)psVar9->_buf; } bVar5 = ANM2::SetAnimation(pAVar14,(byte *)psVar9,1); if (((bVar5 != 0) && ((pAVar14->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&pAVar14->_animState,0.0), (pAVar14->_animState)._animData != (void *)0x0)) { (pAVar14->_animState)._isPlaying = 0; } local_bc = 0; uStack_b8 = 0; local_b4 = 0; if (&pAVar14->_color != (ColorMod *)local_dc) { (pAVar14->_color)._colorize[0] = 0.0; (pAVar14->_color)._colorize[1] = 0.0; (pAVar14->_color)._colorize[2] = 0.0; (pAVar14->_color)._colorize[3] = 0.0; (pAVar14->_color)._offset[0] = 0.0; (pAVar14->_color)._offset[1] = 0.0; (pAVar14->_color)._tint[0] = 1.0; (pAVar14->_color)._tint[1] = 1.0; (pAVar14->_color)._tint[2] = 1.0; (pAVar14->_color)._tint[3] = 0.75; (pAVar14->_color)._offset[2] = 0.0; } pAVar14 = lootMap; } std::_Tree_iterator::operator_decrement(lootIt); if (lootIt[0] == *(ANM2 **)(pAVar14->_filename)._buf) break; iVar10 = ghostData; } } if (*(int *)(ghostData + 0x454) == 0) { (**(code **)(*(int *)effect + 0x28))(); pAVar14 = lootMap; } FID_conflict__Erase_tree_>_> (&lootMap,(fuzzer_allocator_> *)&lootMap, *(_Tree_node **)((pAVar14->_filename)._buf + 4)); operator_delete(lootMap,0x28); } ExceptionList = local_1c; return; } //@@ 0060c350 FUN_0060c350 void FUN_0060c350(void) { int *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x28); return; } //@@ 0060c370 Entity_Effect::TriggerGlowingHourglass /* ZHL [vtable slot 11] */ void __thiscall Entity_Effect::TriggerGlowingHourglass(Entity_Effect *this) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; byte *pbVar5; bool bVar6; if (this->_variant == 0xb9) { this->_state = 0; pbVar1 = (this->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = s_Idle; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_0060c3c0: uVar4 = -(uint)bVar6 | 1; goto LAB_0060c3c5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_0060c3c0; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0060c3c5: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((this->_sprite)._animState._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else if (this->_variant == 0x77) { /* WARNING: Could not recover jumptable at 0x0060c3fb. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x28))(); return; } return; } //@@ 0060c400 Entity_Effect::CanShutDoors /* ZHL [vtable slot 18] */ bool __thiscall Entity_Effect::CanShutDoors(Entity_Effect *this) { return this->_variant == 0xcb; } //@@ 0060c410 FUN_0060c410 void FUN_0060c410(void) { int in_ECX; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + 1; return; } //@@ 0060c420 FUN_0060c420 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_0060c420(void) { int iVar1; int *in_ECX; if ((int *)*in_ECX == (int *)0x0) { return *(undefined4 *)(_DAT_00000004 + (_DAT_00000008 - 1U & in_ECX[2]) * 4); } iVar1 = *(int *)*in_ECX; return *(undefined4 *)(*(int *)(iVar1 + 4) + (*(int *)(iVar1 + 8) - 1U & in_ECX[2]) * 4); } //@@ 0060c450 FUN_0060c450 bool FUN_0060c450(int param_1) { int in_ECX; return *(int *)(in_ECX + 8) != *(int *)(param_1 + 8); } //@@ 0060c470 FUN_0060c470 void FUN_0060c470(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; void *pvVar5; int iVar6; int in_ECX; uint uVar7; iVar6 = *(int *)(in_ECX + 0x10); uVar7 = *(uint *)(in_ECX + 8); if (uVar7 <= iVar6 + 1U) { FUN_0060c8a0(uVar7); uVar7 = *(uint *)(in_ECX + 8); iVar6 = *(int *)(in_ECX + 0x10); } *(uint *)(in_ECX + 0xc) = *(uint *)(in_ECX + 0xc) & uVar7 - 1; uVar7 = *(int *)(in_ECX + 0xc) + iVar6 & uVar7 - 1; iVar6 = *(int *)(in_ECX + 4); if (*(int *)(iVar6 + uVar7 * 4) == 0) { pvVar5 = operator_new(0x40); *(void **)(*(int *)(in_ECX + 4) + uVar7 * 4) = pvVar5; iVar6 = *(int *)(in_ECX + 4); } puVar1 = *(undefined4 **)(iVar6 + uVar7 * 4); uVar2 = param_1[1]; *puVar1 = *param_1; puVar1[1] = uVar2; uVar2 = param_1[3]; uVar3 = param_1[4]; uVar4 = param_1[5]; puVar1[2] = param_1[2]; puVar1[3] = uVar2; puVar1[4] = uVar3; puVar1[5] = uVar4; uVar2 = param_1[7]; uVar3 = param_1[8]; uVar4 = param_1[9]; puVar1[6] = param_1[6]; puVar1[7] = uVar2; puVar1[8] = uVar3; puVar1[9] = uVar4; *(undefined8 *)(puVar1 + 10) = *(undefined8 *)(param_1 + 10); puVar1[0xc] = param_1[0xc]; puVar1[0xd] = param_1[0xd]; puVar1[0xe] = param_1[0xe]; puVar1[0xf] = param_1[0xf]; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; return; } //@@ 0060c510 FUN_0060c510 undefined4 FUN_0060c510(void) { int in_ECX; return *(undefined4 *) (*(int *)(in_ECX + 4) + (*(int *)(in_ECX + 8) - 1U & (*(int *)(in_ECX + 0x10) + *(int *)(in_ECX + 0xc)) - 1U) * 4) ; } //@@ 0060c530 FUN_0060c530 undefined4 FUN_0060c530(int param_1) { int in_ECX; return *(undefined4 *) (*(int *)(in_ECX + 4) + (*(int *)(in_ECX + 8) - 1U & param_1 + *(int *)(in_ECX + 0xc)) * 4 ); } //@@ 0060c560 FUN_0060c560 void FUN_0060c560(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; uVar1 = in_ECX[3]; uVar2 = *in_ECX; param_1[1] = 0; param_1[2] = uVar1; *param_1 = uVar2; return; } //@@ 0060c580 FUN_0060c580 void FUN_0060c580(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; uint size; int iVar2; iVar2 = in_ECX[4]; if (iVar2 != 0) { do { iVar2 = iVar2 + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; } iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x40); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 0060c620 Entity_Effect::ExtraDataRef::Set /* DB: ReferenceCount */ void Entity_Effect::ExtraDataRef::Set(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6694; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7e854 != (code *)0x0)) { (*DAT_00c7e854)(); } } in_ECX[1] = this; *in_ECX = param_1; ExceptionList = local_10; return; } //@@ 0060c6c0 FUN_0060c6c0 int FUN_0060c6c0(int param_1) { int *in_ECX; return *in_ECX + param_1 * 0x14; } //@@ 0060c6e0 FUN_0060c6e0 int FUN_0060c6e0(void) { int *in_ECX; return (in_ECX[1] - *in_ECX) / 0x14; } //@@ 0060c700 std::_Tree_iterator::operator_decrement /* DB: red-black tree predecessor: from head goes to rightmost, else rightmost of left subtree or climbs parents (isnil byte +0xd); Isaac::GetEntityTypeByName/GetEntityVariantByName prototype: db/protos.zhl */ void * __thiscall std::_Tree_iterator::operator_decrement(void *this) { char cVar1; int iVar2; int iVar3; int *piVar4; int *piVar5; int *piVar6; piVar6 = *(int **)this; if (*(char *)((int)piVar6 + 0xd) != '\0') { *(int *)this = piVar6[2]; return this; } iVar2 = *piVar6; if (*(char *)(iVar2 + 0xd) == '\0') { cVar1 = *(char *)(*(int *)(iVar2 + 8) + 0xd); iVar3 = *(int *)(iVar2 + 8); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar3 + 8) + 0xd); iVar2 = iVar3; iVar3 = *(int *)(iVar3 + 8); } *(int *)this = iVar2; } else { piVar5 = (int *)piVar6[1]; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { piVar4 = piVar5; piVar5 = piVar4; if (piVar6 != (int *)*piVar4) break; *(int **)this = piVar4; piVar5 = (int *)piVar4[1]; piVar6 = piVar4; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar6 + 0xd) == '\0') { *(int **)this = piVar5; return this; } } return this; } //@@ 0060c790 FUN_0060c790 void FUN_0060c790(byte *param_1) { byte bVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; byte *pbVar5; undefined4 *puVar6; undefined4 *in_ECX; char *in_EDX; pbVar5 = param_1; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); puVar6 = std::string::append(in_EDX,param_1,(int)pbVar5 - (int)(param_1 + 1)); *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar2 = puVar6[1]; uVar3 = puVar6[2]; uVar4 = puVar6[3]; *in_ECX = *puVar6; in_ECX[1] = uVar2; in_ECX[2] = uVar3; in_ECX[3] = uVar4; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; return; } //@@ 0060c800 FUN_0060c800 void FUN_0060c800(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6694; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7e854 != (code *)0x0)) { (*DAT_00c7e854)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 0060c8a0 FUN_0060c8a0 void FUN_0060c8a0(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0x3ffffff - uVar3 < uVar3) { FUN_0040cad0(); LAB_0060c9d6: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = std::_Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_0060c9d6; } //@@ 0060c9e0 FID_conflict:_Erase_tree_>_> /* Library Function - Multiple Matches With Different Base Names public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree_and_orphan > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Erase_tree_>_> (void *this,fuzzer_allocator_> *param_1, _Tree_node *param_2) { _Tree_node _Var1; _Tree_node *p_Var2; _Var1 = param_2[0xd]; while (_Var1 == (_Tree_node)0x0) { FID_conflict__Erase_tree_>_> (this,param_1,*(_Tree_node **)(param_2 + 8)); p_Var2 = *(_Tree_node **)param_2; operator_delete(param_2,0x28); param_2 = p_Var2; _Var1 = p_Var2[0xd]; } return; } //@@ 0060ca20 std::multimap::emplace /* DB: red-black tree insert of a new 0x28-byte node (key uint at +0x10 compared with <, equal keys to the right, max size 0x6666666) holding a 24-byte value; from Entity_Effect::setup_loot_preview */ void std::multimap::emplace(undefined4 *param_1,uint *param_2) { char cVar1; int iVar2; uint uVar3; int *piVar4; uint uVar5; uint uVar6; uint uVar7; uint uVar8; int *piVar9; int *piVar10; int *in_ECX; int *piVar11; int *piVar12; bool bVar13; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00af66d5; local_1c = ExceptionList; uVar8 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; iVar2 = *in_ECX; local_14 = 0; piVar9 = operator_new(0x28); uVar3 = *param_2; piVar9[4] = uVar3; uVar5 = param_2[2]; uVar6 = param_2[3]; uVar7 = param_2[4]; piVar9[5] = param_2[1]; piVar9[6] = uVar5; piVar9[7] = uVar6; piVar9[8] = uVar7; piVar9[9] = param_2[5]; *piVar9 = iVar2; piVar9[1] = iVar2; piVar9[2] = iVar2; *(undefined2 *)(piVar9 + 3) = 0; local_14 = 1; bVar13 = false; piVar4 = (int *)*in_ECX; piVar12 = (int *)piVar4[1]; if (*(char *)((int)piVar12 + 0xd) == '\0') { piVar10 = piVar12; do { piVar12 = piVar10; bVar13 = uVar3 < (uint)piVar12[4]; if (bVar13) { piVar10 = (int *)*piVar12; } else { piVar10 = (int *)piVar12[2]; } } while (*(char *)((int)piVar10 + 0xd) == '\0'); } if (in_ECX[1] == 0x6666666) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar8); } in_ECX[1] = in_ECX[1] + 1; piVar9[1] = (int)piVar12; if (piVar12 == piVar4) { *piVar4 = (int)piVar9; piVar4[1] = (int)piVar9; piVar4[2] = (int)piVar9; *(undefined1 *)(piVar9 + 3) = 1; } else { if (bVar13) { *piVar12 = (int)piVar9; if (piVar12 == (int *)*piVar4) { *piVar4 = (int)piVar9; } } else { piVar12[2] = (int)piVar9; if (piVar12 == (int *)piVar4[2]) { piVar4[2] = (int)piVar9; } } cVar1 = *(char *)(piVar9[1] + 0xc); piVar12 = piVar9; while (cVar1 == '\0') { piVar10 = (int *)piVar12[1]; piVar11 = *(int **)piVar10[1]; if (piVar10 == piVar11) { piVar11 = (int *)((undefined4 *)piVar10[1])[2]; if ((char)piVar11[3] == '\0') { LAB_0060cb7a: *(undefined1 *)(piVar10 + 3) = 1; *(undefined1 *)(piVar11 + 3) = 1; *(undefined1 *)(*(int *)(piVar12[1] + 4) + 0xc) = 0; piVar12 = *(int **)(piVar12[1] + 4); } else { if (piVar12 == (int *)piVar10[2]) { FUN_00415fe0(piVar10); piVar12 = piVar10; } *(undefined1 *)(piVar12[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar12[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar12[1] + 4)); } } else { if ((char)piVar11[3] == '\0') goto LAB_0060cb7a; if (piVar12 == (int *)*piVar10) { FUN_00415f80(piVar10); piVar12 = piVar10; } *(undefined1 *)(piVar12[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar12[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar12[1] + 4)); } cVar1 = *(char *)(piVar12[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = piVar9; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_1c; return; } //@@ 0060cc00 FUN_0060cc00 void FUN_0060cc00(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x28); } return; } //@@ 0060cc20 FUN_0060cc20 void FUN_0060cc20(void) { FUN_00652a70(); return; } //@@ 0060cc30 FUN_0060cc30 void FUN_0060cc30(uint param_1) { uint uVar1; uint *in_ECX; uint uVar2; if (0x3f < param_1) { param_1 = param_1 - 0x40; uVar1 = 1 << (param_1 & 0x1f); uVar2 = 0; if (0x1f < param_1) { uVar2 = uVar1; } uVar1 = uVar1 ^ uVar2; if (0x3f < param_1) { uVar2 = uVar1; } in_ECX[2] = in_ECX[2] | uVar1; in_ECX[3] = in_ECX[3] | uVar2; return; } uVar1 = 1 << (param_1 & 0x1f); uVar2 = 0; if (0x1f < param_1) { uVar2 = uVar1; } uVar1 = uVar1 ^ uVar2; if (0x3f < param_1) { uVar2 = uVar1; } *in_ECX = *in_ECX | uVar1; in_ECX[1] = in_ECX[1] | uVar2; return; } //@@ 0060cc80 Item::IsTrinket /* ZHL [lua] Lua binding Item:IsTrinket */ bool Item::IsTrinket(void) { int *in_ECX; return *in_ECX == 2; } //@@ 0060cc90 FUN_0060cc90 int FUN_0060cc90(void) { int in_ECX; if ((in_ECX == 0) || (*(int *)(in_ECX + 0x28) != 8)) { return 0; } return in_ECX; } //@@ 0060cca0 FUN_0060cca0 void FUN_0060cca0(void) { return; } //@@ 0060ccb0 Entity_Tear::BaseScale /* ZHL [lua] Lua binding EntityTear:BaseScale */ float10 __thiscall Entity_Tear::BaseScale(Entity_Tear *this) { return (float10)this->_baseScale; } //@@ 0060ccc0 Entity_Tear::Rotation /* ZHL [lua] Lua binding EntityTear:Rotation */ float10 __thiscall Entity_Tear::Rotation(Entity_Tear *this) { return (float10)this->_rotation; } //@@ 0060ccd0 Entity_Tear::SetKnockbackMultiplier /* ZHL [lua] Lua binding EntityTear:SetKnockbackMultiplier */ void __thiscall Entity_Tear::SetKnockbackMultiplier(Entity_Tear *this,float param_2) { this->_knockbackMultiplier = param_2; return; } //@@ 0060ccf0 FUN_0060ccf0 void FUN_0060ccf0(void) { return; } //@@ 0060cd00 Entity_Tear::SetWaitFrames /* ZHL [lua] Lua binding EntityTear:SetWaitFrames */ void __thiscall Entity_Tear::SetWaitFrames(Entity_Tear *this,int param_2) { this->_waitFrames = param_2; return; } //@@ 0060cd10 FUN_0060cd10 undefined4 FUN_0060cd10(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x438); } //@@ 0060cd20 FUN_0060cd20 void FUN_0060cd20(undefined4 *param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x43c) = *param_1; *(undefined4 *)(in_ECX + 0x440) = param_1[1]; return; } //@@ 0060cd40 FUN_0060cd40 int FUN_0060cd40(void) { int in_ECX; return in_ECX + 0x43c; } //@@ 0060cd50 FUN_0060cd50 void FUN_0060cd50(void) { return; } //@@ 0060cd60 FUN_0060cd60 undefined1 FUN_0060cd60(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x468); } //@@ 0060cd70 FUN_0060cd70 void FUN_0060cd70(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x468) = param_1; return; } //@@ 0060cd80 FUN_0060cd80 undefined1 FUN_0060cd80(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x469); } //@@ 0060cd90 FUN_0060cd90 void FUN_0060cd90(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x469) = param_1; return; } //@@ 0060cda0 FUN_0060cda0 void FUN_0060cda0(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x7e8) = 0; return; } //@@ 0060cdb0 FUN_0060cdb0 void FUN_0060cdb0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x448) = param_1; return; } //@@ 0060cdc0 Entity_Bomb::RadiusMultiplier /* ZHL [lua] Lua binding EntityBomb:RadiusMultiplier */ float10 __thiscall Entity_Bomb::RadiusMultiplier(Entity_Bomb *this) { return (float10)this->_radiusMultiplier; } //@@ 0060cdd0 FUN_0060cdd0 undefined1 FUN_0060cdd0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x460); } //@@ 0060cde0 FUN_0060cde0 void FUN_0060cde0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x460) = param_1; return; } //@@ 0060cdf0 FUN_0060cdf0 void FUN_0060cdf0(void) { return; } //@@ 0060ce00 FUN_0060ce00 void FUN_0060ce00(void) { return; } //@@ 0060ce10 FUN_0060ce10 void FUN_0060ce10(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x42c) = in_XMM1_Da; return; } //@@ 0060ce20 Entity_Effect::SetDamageSource /* ZHL [lua] Lua binding EntityEffect:SetDamageSource */ void __thiscall Entity_Effect::SetDamageSource(Entity_Effect *this,int param_2) { this->_damageSource = param_2; return; } //@@ 0060ce30 FUN_0060ce30 undefined1 FUN_0060ce30(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x515); } //@@ 0060ce40 FUN_0060ce40 void FUN_0060ce40(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x45e) = param_1; return; } //@@ 0060ce50 FUN_0060ce50 undefined1 FUN_0060ce50(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x45e); } //@@ 0060ce60 FUN_0060ce60 undefined4 FUN_0060ce60(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x4d4); } //@@ 0060ce70 FUN_0060ce70 void FUN_0060ce70(void) { return; } //@@ 0060ce80 FUN_0060ce80 void FUN_0060ce80(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x4bc) = param_1; return; } //@@ 0060cea0 Entity_Laser::Radius /* ZHL [lua] Lua binding EntityLaser:Radius */ float10 __thiscall Entity_Laser::Radius(Entity_Laser *this) { return (float10)this->_radius; } //@@ 0060ceb0 Entity_Laser::SetBlackHpDropChance /* ZHL [lua] Lua binding EntityLaser:SetBlackHpDropChance */ void __thiscall Entity_Laser::SetBlackHpDropChance(Entity_Laser *this,float param_2) { this->_blackHpDropChance = param_2; return; } //@@ 0060ced0 FUN_0060ced0 void FUN_0060ced0(void) { return; } //@@ 0060cee0 FUN_0060cee0 undefined1 FUN_0060cee0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x500); } //@@ 0060cef0 FUN_0060cef0 undefined1 FUN_0060cef0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x514); } //@@ 0060cf00 FUN_0060cf00 void FUN_0060cf00(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x517) = 1; return; } //@@ 0060cf10 Entity_Knife::IsFlying /* ZHL [lua] Lua binding EntityKnife:IsFlying */ byte __thiscall Entity_Knife::IsFlying(Entity_Knife *this) { return this->_isFlying; } //@@ 0060cf20 FUN_0060cf20 void FUN_0060cf20(float param_1) { int in_ECX; if (360.0 < ABS(param_1)) { param_1 = fmodf(param_1,360.0); } if (180.0 < param_1) { *(float *)(in_ECX + 0x43c) = param_1 - 360.0; return; } if (param_1 < -180.0) { param_1 = param_1 + 360.0; } *(float *)(in_ECX + 0x43c) = param_1; return; } //@@ 0060cfb0 Entity_Knife::SetPathFollowSpeed /* ZHL [lua] Lua binding EntityKnife:SetPathFollowSpeed */ void __thiscall Entity_Knife::SetPathFollowSpeed(Entity_Knife *this,float param_2) { this->_pathFollowSpeed = param_2; return; } //@@ 0060cfd0 FUN_0060cfd0 undefined1 FUN_0060cfd0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x4e5); } //@@ 0060cfe0 GridEntity_Door::TargetRoomIndex /* ZHL [lua] Lua binding GridEntityDoor:TargetRoomIndex */ int __thiscall GridEntity_Door::TargetRoomIndex(GridEntity_Door *this) { return this->_targetRoomIdx; } //@@ 0060cff0 GridEntity_Door::IsKeyFamiliarTarget /* ZHL [lua] Lua binding GridEntityDoor:IsKeyFamiliarTarget */ bool GridEntity_Door::IsKeyFamiliarTarget(void) { int in_ECX; return *(int *)(in_ECX + 8) == 5; } //@@ 0060d000 Level::GetDungeonPlacementSeed /* ZHL [lua] Lua binding Level:GetDungeonPlacementSeed */ int __thiscall Level::GetDungeonPlacementSeed(Level *this) { return this->_dungeonPlacementSeed; } //@@ 0060d010 Game::GetRoomDescriptorsOffsetsArrayForDimension /* ZHL [exact] __thiscall int* Game::GetRoomDescriptorsOffsetsArrayForDimension(int dimension); prototype: REPENTOGON, confirmed by RET 4 */ int * __thiscall Game::GetRoomDescriptorsOffsetsArrayForDimension(Game *this,int dimension) { if (dimension < 0) { return this->_currentRoomMap; } return this->_roomMap + dimension * 0xa9; } //@@ 0060d040 FUN_0060d040 void FUN_0060d040(void) { return; } //@@ 0060d050 Entity_Player::GetNumBlueSpiders /* ZHL [lua] Lua binding EntityPlayer:GetNumBlueSpiders */ int __thiscall Entity_Player::GetNumBlueSpiders(Entity_Player *this) { return this->_numBlueSpiders; } //@@ 0060d060 FUN_0060d060 void FUN_0060d060(void) { return; } //@@ 0060d070 FUN_0060d070 void FUN_0060d070(void) { return; } //@@ 0060d080 Entity_Player::GetDamageCooldown /* ZHL [lua] Lua binding EntityPlayer:GetDamageCooldown */ int __thiscall Entity_Player::GetDamageCooldown(Entity_Player *this) { return this->_damageCooldown; } //@@ 0060d090 Entity_Player::ResetDamageCooldown /* ZHL [lua] Lua binding EntityPlayer:ResetDamageCooldown */ void __thiscall Entity_Player::ResetDamageCooldown(Entity_Player *this) { this->_damageCooldown = 0; return; } //@@ 0060d0a0 Entity_Player::SpriteScale /* ZHL [lua] Lua binding EntityPlayer:SpriteScale */ void __thiscall Entity_Player::SpriteScale(Entity_Player *this,float *param_2) { float fVar1; fVar1 = (this->_playerSpriteScale).y; *param_2 = (this->_playerSpriteScale).x; param_2[1] = fVar1; return; } //@@ 0060d0c0 FUN_0060d0c0 void FUN_0060d0c0(void) { int in_ECX; *(short *)(in_ECX + 0x1d94) = *(short *)(in_ECX + 0x1d94) + 1; return; } //@@ 0060d0d0 FUN_0060d0d0 void FUN_0060d0d0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd7c) = param_1; return; } //@@ 0060d0e0 Entity_Familiar::Hearts /* ZHL [lua] Lua binding EntityFamiliar:Hearts */ int __thiscall Entity_Familiar::Hearts(Entity_Familiar *this) { return this->_hearts; } //@@ 0060d0f0 FUN_0060d0f0 void FUN_0060d0f0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd80) = param_1; return; } //@@ 0060d100 Entity_Familiar::Keys /* ZHL [lua] Lua binding EntityFamiliar:Keys */ int __thiscall Entity_Familiar::Keys(Entity_Familiar *this) { return this->_keys; } //@@ 0060d110 FUN_0060d110 undefined4 FUN_0060d110(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0xd88); } //@@ 0060d120 FUN_0060d120 byte FUN_0060d120(void) { int in_ECX; return (byte)((uint)*(undefined4 *)(in_ECX + 0xd70) >> 0x1f) ^ 1; } //@@ 0060d130 FUN_0060d130 undefined1 FUN_0060d130(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0xd76); } //@@ 0060d140 Entity_NPC::set_entity_ptr_f54 /* DB: ? multiset EntityPtr at +0xf54; cage/tarboy */ void Entity_NPC::set_entity_ptr_f54(int *param_1) { int *piVar1; int *piVar2; int in_ECX; piVar2 = param_1; piVar1 = (int *)(in_ECX + 0xf54); if ((int *)*piVar1 != param_1) { if ((int *)*piVar1 != (int *)0x0) { param_1 = piVar1; std::multiset::erase(¶m_1); } *piVar1 = (int)piVar2; if (piVar2 != (int *)0x0) { std::multiset::insert(piVar1); } } return; } //@@ 0060d180 Entity_Familiar::GetPlayerSlot /* DB: ? matches player +0x1618 controller in 4 slots */ KColor * __thiscall Entity_Familiar::GetPlayerSlot(Entity_Familiar *this,KColor *param_2,int param_3) { int playerColor; std_string *psVar1; playerColor = 0; psVar1 = &(this->_sprite)._animDefaultName; do { if (*(int *)psVar1->_buf == *(int *)(param_3 + 0x1618)) goto LAB_0060d1a3; playerColor = playerColor + 1; psVar1 = (std_string *)(psVar1->_buf + 4); } while (playerColor < 4); playerColor = 5; LAB_0060d1a3: PlayerManager::GetPlayerColorValue(param_2,playerColor); return param_2; } //@@ 0060d1c0 FUN_0060d1c0 bool FUN_0060d1c0(uint param_1) { Entity_Player *pEVar1; PlayerManager *in_ECX; pEVar1 = PlayerManager::FirstPlayerByType(in_ECX,param_1); return pEVar1 != (Entity_Player *)0x0; } //@@ 0060d1e0 FUN_0060d1e0 undefined4 FUN_0060d1e0(void) { return CONCAT31((int3)((uint)g_game >> 8),g_game->_isStartingFromState); } //@@ 0060d1f0 FUN_0060d1f0 void FUN_0060d1f0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x540) = param_1; return; } //@@ 0060d200 Entity_Familiar::Constructor /* ZHL [exact] __thiscall void Entity_Familiar::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Familiar::Constructor(Entity_Familiar *this) { undefined4 *puVar1; void *pvVar2; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6753; local_10 = ExceptionList; ExceptionList = &local_10; Entity::constructor((Entity *)this); local_8 = 0; *(undefined ***)this = IsaacRepentancePlus::Entity_Familiar::vftable; iVar3 = 0x3c; puVar1 = (undefined4 *)&this->field_0x418; do { puVar1[1] = 0; *puVar1 = 0; iVar3 = iVar3 + -1; puVar1 = puVar1 + 2; } while (iVar3 != 0); PathFinder::Init((PathFinder *)&this->_pathfinder,(Entity *)this); (this->_orbitDistance).y = 0.0; (this->_orbitDistance).x = 0.0; this->_isSubtype55555 = 0; this->_isHourglassRewound = 0; (this->_formationOffset).y = 0.0; (this->_formationOffset).x = 0.0; (this->_formationTargetOffset).y = 0.0; (this->_formationTargetOffset).x = 0.0; (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; local_8._0_1_ = 2; ANM2::constructor(&this->_chargeBarSprite); this->_extraData = (void *)0x0; *(undefined4 *)&this->field_0xee4 = 0; this->_sirenHelper = (EntityPtr)0x0; local_8 = CONCAT31(local_8._1_3_,5); this->_sirenCharmFrames = 0; (this->_dirtColor)._tint[0] = 1.0; (this->_dirtColor)._tint[1] = 1.0; (this->_dirtColor)._tint[2] = 1.0; (this->_dirtColor)._tint[3] = 1.0; (this->_dirtColor)._colorize[0] = 0.0; (this->_dirtColor)._colorize[1] = 0.0; (this->_dirtColor)._colorize[2] = 0.0; (this->_dirtColor)._colorize[3] = 0.0; (this->_dirtColor)._offset[0] = 0.0; (this->_dirtColor)._offset[1] = 0.0; (this->_dirtColor)._offset[2] = 0.0; this[1]._pendingDamage = 1.4013e-44; *(undefined4 *)&this[1]._pendingDamageFlags = 0; *(undefined4 *)((int)&this[1]._pendingDamageFlags + 4) = 0; pvVar2 = operator_new(0x18); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *(void **)&this[1]._pendingDamageFlags = pvVar2; ExceptionList = local_10; return; } //@@ 0060d3d0 Entity_Familiar::Free /* ZHL [vtable slot 0] */ Entity_Familiar * __thiscall Entity_Familiar::Free(Entity_Familiar *this,byte param_2) { FUN_0060d400(); if ((param_2 & 1) != 0) { operator_delete(this,0xf48); } return this; } //@@ 0060d400 FUN_0060d400 void FUN_0060d400(void) { float *pfVar1; Vector *pVVar2; int *piVar3; char cVar4; uint uVar5; Entity *in_ECX; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6770; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pfVar1 = &in_ECX[3]._pausePosition.y; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Familiar::vftable; local_14 = in_ECX; FID_conflict__Erase_tree_>_> (pfVar1,(fuzzer_allocator_> *)pfVar1, *(_Tree_node **)((int)*pfVar1 + 4)); operator_delete((void *)*pfVar1,0x18); pVVar2 = &in_ECX[3]._entityRef4._position; if (pVVar2->x != 0.0) { local_14 = (Entity *)pVVar2; std::multiset::erase(&local_14); pVVar2->x = 0.0; } local_8 = 1; piVar3 = (int *)in_ECX[3]._entityRef4._spawnerType; if (piVar3 != (int *)0x0) { cVar4 = (**(code **)(*piVar3 + 0xc))(uVar5); if ((cVar4 != '\0') && (DAT_00c7e818 != (code *)0x0)) { (*DAT_00c7e818)(&in_ECX[3]._entityRef4._variant); } } local_8 = 2; ANM2::Reset((ANM2 *)&in_ECX[3]._renderPosition.y); AnimationState::~AnimationState((AnimationState *)(in_ECX[3]._splatColor._colorize + 1)); AnimationState::~AnimationState((AnimationState *)in_ECX[3]._color._offset); std::string::_Tidy_deallocate((char *)(in_ECX[3]._color._tint + 2)); std::string::_Tidy_deallocate((char *)&in_ECX[3]._renderPosition.y); FID_conflict__Tidy(&in_ECX[3]._entityCollisionClass); pfVar1 = in_ECX[3]._sprite._championColor._tint + 1; FID_conflict__Erase_tree_>_> (pfVar1,(fuzzer_allocator_> *)pfVar1, *(_Tree_node **) ((int)in_ECX[3]._sprite._championColor._tint[1] + 4)); operator_delete((void *)*pfVar1,0x14); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 0060d530 FUN_0060d530 void FUN_0060d530(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; *in_ECX = IsaacRepentancePlus::IsaacsBodyData::vftable; _eh_vector_destructor_iterator_(in_ECX + 0x46,0x114,4,ANM2::~ANM2); local_8 = CONCAT31(local_8._1_3_,1); ANM2::Reset((ANM2 *)(in_ECX + 1)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x15)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0xd)); std::string::_Tidy_deallocate((char *)(in_ECX + 7)); std::string::_Tidy_deallocate((char *)(in_ECX + 1)); *in_ECX = IsaacRepentancePlus::Entity_Familiar::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x578); } ExceptionList = local_10; return; } //@@ 0060d5e0 FUN_0060d5e0 void FUN_0060d5e0(byte param_1) { int *piVar1; uint uVar2; int *in_ECX; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = (int)IsaacRepentancePlus::AbyssLocustData::vftable; piVar1 = in_ECX + 0x13; local_14 = in_ECX; if (*piVar1 != 0) { local_14 = piVar1; std::multiset::erase(&local_14); *piVar1 = 0; } FID_conflict__Tidy(in_ECX + 0x10); FUN_00651910(uVar2); FUN_00651910(); piVar1 = in_ECX + 7; FID_conflict__Erase_tree_>_> (piVar1,(fuzzer_allocator_> *)piVar1, *(_Tree_node **)(in_ECX[7] + 4)); operator_delete((void *)*piVar1,0x18); *in_ECX = (int)IsaacRepentancePlus::Entity_Familiar::ExtraData::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } ExceptionList = local_10; return; } //@@ 0060d6a0 FUN_0060d6a0 int FUN_0060d6a0(void) { int iVar1; byte bVar2; void *pvVar3; Entity *in_ECX; int iVar4; iVar4 = *(int *)((int)in_ECX->_config + 0xd0); if ((-1 < (int)in_ECX[3]._sprite._playbackSpeed) && ((in_ECX->_flags & 0x20000000000) != 0)) { iVar4 = 8; } iVar1 = in_ECX->_variant; if (iVar1 == 0xe7) { pvVar3 = ItemConfig::get_wisp_entry(in_ECX->_subtype,in_ECX[3]._sprite._bitflags); return *(int *)((int)pvVar3 + 0x7c); } if (iVar1 == 0xee) { if ((int)in_ECX[3]._shadowOffset.y < 2) { LAB_0060d748: if (1 < *(int *)&g_game->_deathmatchManager) { if (iVar1 == 0x3f) { iVar4 = iVar4 * 2; } else { if (iVar1 == 0x53) { return iVar4 << 2; } if (iVar1 == 0x83) { return 0x10; } } } return iVar4; } } else if (iVar1 != 0xf0) { if (iVar1 == 0xf3) { if (0 < (int)in_ECX[3]._shadowOffset.y) { return 0; } bVar2 = Entity::HasEntityFlags(in_ECX,0x400000000000000); if (bVar2 != 0) { return 0; } } else if ((iVar1 == 0xce) && (in_ECX->_subtype == 0x2be)) { iVar4 = 2; } goto LAB_0060d748; } return 0; } //@@ 0060d780 FUN_0060d780 undefined4 FUN_0060d780(void) { int in_ECX; switch(*(undefined4 *)(in_ECX + 0x2c)) { case 0x2b: case 0x49: case 0xea: goto switchD_0060d794_caseD_2b; default: if (*(char *)(in_ECX + 0xd76) == '\0') { return 0xffffffff; } switchD_0060d794_caseD_2b: return 100; case 0x73: return 0x32; case 0x79: case 0x80: case 0xe5: return 0x19; case 0xc9: case 0xe4: return 10; case 0xce: return 8; case 0xed: return 6; case 0xee: return 1; } } //@@ 0060d8c0 Entity_Familiar::CanBeDamagedByEnemy /* ZHL [exact] __thiscall bool Entity_Familiar::CanBeDamagedByEnemy(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Familiar::CanBeDamagedByEnemy(Entity_Familiar *this) { int iVar1; iVar1 = this->_variant; if ((((iVar1 == 0x3e) || (iVar1 == 0x43)) || (iVar1 == 0xd3)) || (iVar1 == 100)) { return 1; } return 0; } //@@ 0060d8e0 Entity_Familiar::CanBlockProjectiles /* ZHL [exact] __thiscall bool Entity_Familiar::CanBlockProjectiles(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Familiar::CanBlockProjectiles(Entity_Familiar *this) { byte isHasTag; int iVar1; bool isBlocker; BitSet128 itemTags; iVar1 = this->_variant; if (iVar1 == 0x23) { return 1; } if (iVar1 == 0x2c) { return 1; } if (iVar1 == 0x2d) { return 1; } if (iVar1 == 0x21) { return 1; } if (iVar1 == 0x41) { return 1; } if (iVar1 == 0x20) { return 1; } if (iVar1 == 0x2a) { return 1; } if (iVar1 == 0x11) { return 1; } if (iVar1 == 0x33) { return 1; } if (iVar1 == 0x4b) { return 1; } if (iVar1 == 0x32) { isBlocker = this->_subtype == 0; } else { if (iVar1 == 0x44) { return 1; } if (iVar1 == 0x43) { return 1; } if (iVar1 == 0x53) { return 1; } if (iVar1 == 0x5f) { return 1; } if (iVar1 == 0x45) { return 1; } if (iVar1 == 0x46) { return 1; } if (iVar1 == 0x67) { return 1; } if (iVar1 == 0x68) { LAB_0060d954: if (this->_fireCooldown < 0) { return 1; } return 0; } if (iVar1 == 0x6b) { isBlocker = this->_subtype == 1; } else { if (iVar1 == 0x79) { return 1; } if (iVar1 == 0x80) { return 1; } if (iVar1 == 0x82) { return 1; } if (iVar1 == 900) { return 1; } if (iVar1 == 0x74) { return 1; } if (iVar1 == 0x75) { return 1; } if (iVar1 == 0xcf) { return 1; } if (iVar1 == 0xe2) { return 1; } if (iVar1 == 0xe4) { return 1; } if (iVar1 == 0xee) { return 1; } if (iVar1 == 0xe0) { return 1; } if (iVar1 == 0xc9) { return 1; } if (iVar1 == 0xd8) { return 1; } if (iVar1 == 0xd9) { return 1; } if (iVar1 == 0xce) { if (this->_subtype == 0x2be) { return 0; } return 1; } if (iVar1 == 0xed) { return 1; } if (iVar1 == 0xe5) { return 1; } if (iVar1 == 0xcc) { return 1; } if (iVar1 == 0xd3) { return 1; } if (iVar1 == 0xe7) { iVar1 = get_item_config_entry(); itemTags._l._4_4_ = *(uint *)(iVar1 + 0xc) & DAT_00c34c64; itemTags._l._0_4_ = *(uint *)(iVar1 + 8) & DAT_00c34c60; itemTags._h._0_4_ = *(uint *)(iVar1 + 0x10) & DAT_00c34c68; itemTags._h._4_4_ = *(uint *)(iVar1 + 0x14) & DAT_00c34c6c; isHasTag = BitSet128::IsNonZero(&itemTags); if (isHasTag == 0) { return 0; } return 1; } if (iVar1 == 0xe8) goto LAB_0060d954; if (iVar1 == 0xea) { return 1; } if (iVar1 == 0xef) { return 1; } if (iVar1 == 100) { return 1; } isBlocker = iVar1 == 0xf3; } } if (isBlocker) { return 1; } return 0; } //@@ 0060dab0 Entity_Familiar::CanShutDoors /* ZHL [vtable slot 18] */ undefined1 __thiscall Entity_Familiar::CanShutDoors(Entity_Familiar *this) { if (((this->_variant == 0xf2) && (this->_coins != 0)) && (this->_visible != 0)) { return 1; } return 0; } //@@ 0060dae0 FUN_0060dae0 uint FUN_0060dae0(void) { uint uVar1; uint uVar2; int in_ECX; uVar1 = *(uint *)(in_ECX + 0x2c); uVar2 = uVar1; if (900 < uVar1) goto switchD_0060dafd_caseD_d; if (uVar1 != 900) { uVar2 = 0; switch(uVar1) { case 0xc: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x1a: case 0x1b: case 0x1c: case 0x2b: case 0x39: case 0x3e: case 0x40: case 0x43: case 0x44: case 0x49: case 0x6d: case 0x78: case 0x80: case 0xc9: case 0xca: case 0xcb: case 0xce: case 0xd3: case 0xd5: case 0xd6: case 0xd7: case 0xe4: case 0xec: case 0xed: case 0xee: case 0xf0: case 0xf3: break; default: switchD_0060dafd_caseD_d: return CONCAT31((int3)(uVar2 >> 8),1); case 0x19: case 0x3a: case 0x3b: case 0x6a: return (uint)(*(int *)(in_ECX + 0x30) == 0); case 0x50: uVar2 = *(uint *)(in_ECX + 0x410); if ((uVar2 == 0) || (*(int *)(uVar2 + 0x13c0) != 0xd)) goto switchD_0060dafd_caseD_d; break; case 200: return (uint)(*(int *)(in_ECX + 0xd88) != 0); case 0xd8: return (uint)(*(int *)(in_ECX + 0xd88) < 1); } } return uVar2 & 0xffffff00; } //@@ 0060dc40 Entity_Familiar::apply_tear_modifiers /* DB: ? checks collectibles 247/248 (BFFS/Hive Mind) and trinket 89 when familiar fires tears prototype: db/protos.zhl */ float __thiscall Entity_Familiar::apply_tear_modifiers(Entity_Familiar *this) { uint uVar1; float fVar2; void *pvVar3; void *pvVar4; byte bVar5; int iVar6; int iVar7; Entity_Player *this_00; bool bVar8; bool bVar9; float fVar10; uVar1 = *(uint *)((int)this->_config + 0xd8); iVar7 = this->_variant; bVar5 = Entity_Player::HasCollectible(this->_player,0xf7,0); if ((((bVar5 == 0) || (this->_variant == 0x2b)) || (this->_variant == 0x49)) && (((bVar5 = Entity_Player::HasCollectible(this->_player,0xf8,0), bVar5 == 0 && (bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this->_player + 0x1508),0xf8), bVar5 == 0)) || (((uVar1 & 1) == 0 && (((uVar1 & 2) == 0 && (iVar7 != 0xe7)))))))) { fVar10 = 1.0; } else { fVar10 = 2.0; } this_00 = this->_player; fVar2 = this_00[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar2 == 0.0) || (fVar2 != 1.24716e-43)) { iVar7 = Entity_Player::GetTrinketMultiplier(this_00,0x59); bVar9 = false; bVar8 = iVar7 == 0; LAB_0060dd32: if (bVar8 || bVar9 != iVar7 < 0) goto LAB_0060dd6f; this_00 = this->_player; } else if (*(char *)(this_00[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar6 = Entity_Player::GetTrinketMultiplier(this_00,0x59); bVar9 = SBORROW4(iVar6,1); iVar7 = iVar6 + -1; bVar8 = iVar6 == 1; goto LAB_0060dd32; } iVar7 = Entity_Player::GetTrinketMultiplier(this_00,0x59); fVar10 = (float)iVar7 * 0.25 + fVar10; LAB_0060dd6f: pvVar3 = this->_player; iVar7 = *(int *)((int)pvVar3 + 0x13c0); if (iVar7 == 0x24) { fVar10 = fVar10 * 0.75; } if (((*(char *)((int)pvVar3 + 0x172) != '\0') && ((((iVar7 == 0x1d || (iVar7 == 0x26)) && (pvVar4 = *(void **)((int)pvVar3 + 0x1e68), pvVar4 != (void *)0x0)) && ((*(int *)((int)pvVar4 + 0x161c) != -1 && (*(int *)((int)pvVar4 + 0x161c) < *(int *)((int)pvVar3 + 0x161c))))))) && (pvVar4 != pvVar3) ) { fVar10 = fVar10 * 0.25; } return fVar10; } //@@ 0060ddd0 Entity_Familiar::set_locust_config_index /* DB: own log "Trying to set locust config index on something that isn't a locust" when variant != 231 (abyss locust): writes subtype index to +0xd7c, applies the wisp/locust config gfx overrides to the sprite (+0x48), scales size (+0x370) and sprite scale +0xe4/+0xe8 from the entry; called by Isaac::SpawnLocust and Menu_Stats::Render */ void __thiscall Entity_Familiar::set_locust_config_index(Entity_Familiar *this,int param_2) { float fVar1; void *pvVar2; int iVar3; iVar3 = this->_variant; if (iVar3 != 0xe7) { KAGE_LogMessage(0x10,(byte *) "Trying to set locust config index on something that isn\'t a locust\n"); iVar3 = this->_variant; } this->_coins = param_2; if (iVar3 == 0xe7) { iVar3 = this->_subtype; } else { iVar3 = 0x19; param_2 = 0; } pvVar2 = ItemConfig::get_wisp_entry(iVar3,param_2); anm2_apply_gfx_overrides((int)pvVar2 + 0x84,(int)pvVar2 + 0x9c,&this->_sprite); this->_size = *(float *)((int)this->_config + 0x38) * *(float *)((int)pvVar2 + 0x78); fVar1 = *(float *)((int)pvVar2 + 0x78); (this->_sprite)._scale.x = fVar1; (this->_sprite)._scale.y = fVar1; return; } //@@ 0060de70 Entity_Familiar::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] void Init(unsigned int type, unsigned int variant, unsigned int subtype, unsigned int initSeed); prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Entity_Familiar::Init(Entity_Familiar *this,uint type,uint variant,uint subtype,uint initSeed) { uint *puVar1; float fVar2; undefined4 uVar3; byte bVar4; EntityPtr EVar5; byte *pbVar6; uint uVar7; void *pvVar8; Entity *orbitParent; Entity *otherOrbitParent; int iVar9; byte *animNameCursor; undefined4 *appendedPath; char *extraout_EAX; LayerState *layer; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; char *pcVar10; ANM2 *pAVar11; std_string *psVar12; undefined1 auVar13 [4]; uint subtypeIndex; ANM2 *pAVar14; qword *allocatedBytes; int extraout_EDX; EntityPtr *size; ANM2 *this_00; ANM2 *this_01; EntityPtr EVar15; int iVar16; bool isLess; undefined8 uVar17; float fVar18; ANM2 playerSpriteCopy; ANM2 costumeSpriteCopy; void *local_114; Entity_Familiar *familiar; Vector local_10c; std_string *local_104; EntityPtr local_100; ANM2 *local_fc; uint *local_f8; ANM2 *local_f4; EntityPtr local_f0; char isWideOrbitWisp; std_string sStack_e8; char sheetStem [24]; char sheetExtension [24]; undefined4 tintColor; undefined4 uStack_9c; undefined4 uStack_98; byte abStack_94 [8]; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; std_string layerSheetPath; std_string redirectedPath; undefined1 local_44 [16]; EntityPtr local_34; EntityPtr local_30; undefined1 local_2c [4]; float fStack_28; RNG RStack_24; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *costumeItem; Game *game; Entity_Familiar *listEntity; Manager *manager; qword prevAllocatedBytes; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00af6879; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; familiar = this; set_extra_data(0); this->_isSubtype55555 = subtype == 0xd903; this->_isHourglassRewound = 0; local_f8 = (uint *)0x0; if (subtype != 0xd903) { local_f8 = (uint *)subtype; } Entity::Init((Entity *)this,type,variant,(int)local_f8,initSeed); EVar5 = this->_spawnerEntity; if ((EVar5 == (EntityPtr)0x0) || (*(int *)((int)EVar5 + 0x28) != 1)) { EVar5 = (EntityPtr)Game::GetPlayer(g_game,0); } this->_player = (void *)EVar5; if (this->_config != (void *)0x0) { local_f4 = &this->_sprite; ANM2::Load(local_f4,(std_string *)((int)this->_config + 0x74),1); local_104 = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { local_104 = *(std_string **)local_104->_buf; } pbVar6 = (local_f4->_animState)._animData; if (pbVar6 != (byte *)0x0) { if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } psVar12 = local_104; do { bVar4 = *pbVar6; isLess = bVar4 < (byte)psVar12->_buf[0]; if (bVar4 != psVar12->_buf[0]) { LAB_0060df87: uVar7 = -(uint)isLess | 1; goto LAB_0060df8c; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)psVar12->_buf[1]; if (bVar4 != psVar12->_buf[1]) goto LAB_0060df87; pbVar6 = pbVar6 + 2; psVar12 = (std_string *)(psVar12->_buf + 2); } while (bVar4 != 0); uVar7 = 0; LAB_0060df8c: if ((uVar7 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0060dfcc; } bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)local_104,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_0060dfcc: this->_fireCooldown = 0; this->_headFrameDelay = 0; this->_orbitAngleOffset = 0.0; this->_sirenOriginalPlayer = (void *)0x0; (this->_orbitDistance).x = g_vectorZero.x; (this->_orbitDistance).y = g_vectorZero.y; this->_orbitSpeed = 0.0; this->_orbitLayer = -1; this->_isLilDelirium = 0; this->_isNotCountedAsFollower = 0; if (((((((((variant == 1) || (variant == 2)) || (variant == 4)) || ((variant == 5 || (variant == 6)))) || (variant == 7)) || ((variant == 9 || (variant == 10)))) || ((((variant == 0xb || (((variant == 0x14 || (variant == 0x15)) || (variant == 0x16)))) || (((variant == 0x17 || (variant == 0x28)) || (variant == 0x29)))) || ((variant == 3 || (variant == 0x19)))))) || (((variant == 0xc || (((variant == 0x33 || (variant == 0x34)) || (variant == 0x36)))) || (((variant == 0x3d || (variant == 0x39)) || ((variant == 0x37 || (((((variant == 0x3b || (variant == 0x4a)) || ((variant == 0x1a || ((((variant == 0x1b || (variant == 0x1c)) || (variant == 0x4c)) || ((variant == 0x50 || (variant == 0x51)))))))) || (variant == 0x52)) || ((variant == 0x56 || (variant == 0x5b)))))))))))) || (((((variant == 0x5c || (((variant == 0x59 || (variant == 0x5f)) || (variant == 0x61)))) || (((variant == 100 || (variant == 0x68)) || (variant == 0x67)))) || ((variant == 0x69 || (variant == 0x6c)))) || (((variant == 0x70 || (((variant == 0x72 || (variant == 0x6d)) || (variant == 0x77)))) || (((((variant == 0x7c || (variant == 0x7d)) || (variant == 0x81)) || ((((variant == 0x82 || (variant == 0x5d)) || ((variant == 0xcb || ((((variant == 0xd0 || (variant == 0xd1)) || (variant == 0xdd)) || ((variant == 0xe6 || (variant == 0xdc)))))))) || ((variant == 0xe8 || ((variant == 0xd5 || (variant == 0xd6)))))))) || ((variant == 0xdf || (variant == 0xf2)))))))))) { bVar4 = 1; } else { bVar4 = 0; } this->_isFollower = bVar4; if ((((variant == 0x62) || (variant == 0x65)) || (variant == 0x6a)) || (variant == 99)) { bVar4 = 1; } else { bVar4 = 0; } this->_isDelayed = bVar4; this->_moveDirection = -1; this->_shootDirection = -1; this->_lastDirection = -1; this->_counter = 0; this->_state = 0; this->_appearTimer = 5; if (((variant != 0x11) && (variant != 0x60)) && (variant != 0xcf)) { uVar3 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 4; *(undefined4 *)((int)&this->_flags + 4) = uVar3; } this->_coins = 0; this->_hearts = 0; this->_keys = 0; this->_roomClearCount = 0; this->_linkedEntity = (EntityPtr)0x0; this->_weapon = (void *)0x0; this->_item = (void *)0x0; this->_sirenCharmFrames = 0; this->_moveDelayNum = -1; uVar7 = Random(); *(undefined4 *)(this + 1) = 0; this[1]._damageEvents._begin = (void *)0x3f800000; this[1]._damageEvents._end = (void *)0x3f800000; this[1]._damageEvents._capacity = (void *)0x3f800000; *(uint *)&this[1].field_0x4 = uVar7 % 0x3c + 0x3c; fVar18 = g_vectorZero.x; (this->_formationTargetOffset).x = g_vectorZero.x; fVar2 = g_vectorZero.y; (this->_formationTargetOffset).y = g_vectorZero.y; (this->_formationOffset).x = fVar18; (this->_formationOffset).y = fVar2; this->_formationAngle = 0.0; this->_formationMode = 0xff; UpdateFollowPosition(this,&local_10c); (this->_formationOffset).x = (this->_formationTargetOffset).x; (this->_formationOffset).y = (this->_formationTargetOffset).y; if (*(int *)&(this->_sirenHelper).field_0x0 != 0) { local_f4 = (ANM2 *)&this->_sirenHelper; std::multiset::erase(&local_f4); this->_sirenHelper = (EntityPtr)0x0; } if (this->_isSubtype55555 != 0) { pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 < 0x296) { pvVar8 = (void *)0x0; } else { pvVar8 = *(void **)((int)pvVar8 + 0xa54); } fVar18 = (this->_pos).x; (this->_formationTargetOffset).x = fVar18; fVar2 = (this->_pos).y; (this->_formationTargetOffset).y = fVar2; (this->_formationOffset).y = fVar2; (this->_formationOffset).x = fVar18; this->_item = pvVar8; tintColor = 0x3f800000; uStack_9c = 0x3f800000; uStack_98 = 0x3f800000; abStack_94[0] = 0; abStack_94[1] = 0; abStack_94[2] = 0x80; abStack_94[3] = 0x3f; this->_isNotCountedAsFollower = 1; abStack_94[4] = 0; abStack_94[5] = 0; abStack_94[6] = 0x80; abStack_94[7] = 0x3f; uStack_8c = 0x3f800000; uStack_88 = 0x3f800000; uStack_84 = 0x3f800000; local_80 = 0; local_7c = 0; local_78 = 0; (**(code **)(*(int *)this + 0x3c))(&tintColor,0xffffffff,0xff,0,1); uVar3 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags & 0xfffffffb; *(undefined4 *)((int)&this->_flags + 4) = uVar3; } if ((this->_chargeBarSprite)._loaded == 0) { if (this->_variant == 0xe6) { RStack_24._shift2 = 0; RStack_24._shift3 = 0xf; local_2c[0] = '\0'; local_2c[1] = '\0'; local_2c[2] = '\0'; local_2c[3] = '\0'; local_2c = (undefined1 [4])std::_Allocate(0x20); RStack_24._shift2 = 0x16; RStack_24._shift3 = 0x1f; *(char *)((int)local_2c + 0) = 'g'; *(char *)((int)local_2c + 1) = 'f'; *(char *)((int)local_2c + 2) = 'x'; *(char *)((int)local_2c + 3) = '/'; *(char *)((int)local_2c + 4) = 'c'; *(char *)((int)local_2c + 5) = 'h'; *(char *)((int)local_2c + 6) = 'a'; *(char *)((int)local_2c + 7) = 'r'; *(char *)((int)local_2c + 8) = 'g'; *(char *)((int)local_2c + 9) = 'e'; *(char *)((int)local_2c + 10) = 'b'; *(char *)((int)local_2c + 0xb) = 'a'; *(char *)((int)local_2c + 0xc) = 'r'; *(char *)((int)local_2c + 0xd) = '_'; *(char *)((int)local_2c + 0xe) = 'm'; *(char *)((int)local_2c + 0xf) = 'a'; *(char *)((int)local_2c + 0x10) = 'w'; *(char *)((int)local_2c + 0x11) = '.'; *(char *)((int)local_2c + 0x12) = 'a'; *(char *)((int)local_2c + 0x13) = 'n'; *(byte *)((int)local_2c + 0x14) = 0x6d; *(byte *)((int)local_2c + 0x15) = 0x32; *(byte *)((int)local_2c + 0x16) = 0; local_8 = 0; ANM2::Load(&this->_chargeBarSprite,(std_string *)local_2c,1); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if ((ANM2 *)0xf < (uint)RStack_24._shift3) { pcVar10 = ((std_string *)RStack_24._shift3)->_buf + 1; auVar13 = local_2c; if ((char *)0xfff < pcVar10) { auVar13 = *(undefined1 (*) [4])((int)local_2c + -4); pcVar10 = ((std_string *)(RStack_24._shift3 + 0x18))->_buf + 0xc; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)auVar13))) { code_r0x0060e596: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar13,(uint)pcVar10); } RStack_24._shift2 = 0; RStack_24._shift3 = 0xf; local_2c = (undefined1 [4])((uint)local_2c & 0xffffff00); } else { local_34 = (EntityPtr)0x0; local_30 = (EntityPtr)0xf; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); local_34 = (EntityPtr)0x12; local_30 = (EntityPtr)0x1f; builtin_strncpy((char *)local_44._0_4_,"gfx/chargebar.anm2",0x13); local_8 = 1; ANM2::Load(&this->_chargeBarSprite,(std_string *)local_44,1); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < (uint)local_30) { uVar7 = (int)local_30 + 1; pcVar10 = (char *)local_44._0_4_; if (0xfff < uVar7) { pcVar10 = *(char **)(local_44._0_4_ + -4); uVar7 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)pcVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar10,uVar7); } local_34 = (EntityPtr)0x0; local_30 = (EntityPtr)0xf; local_44._0_4_ = local_44._0_4_ & 0xffffff00; } } if (((variant == 0x2e) || (variant == 0x2f)) || (((variant == 0x47 || (((variant == 0x48 || (variant == 0x30)) || (variant == 0x38)))) || (variant == 0x49)))) { LAB_0060e6d4: this->_entityGridCollisionClass = 5; } else if (variant == 0x4b) { this->_entityGridCollisionClass = 6; } else if (variant == 0x57) { this->_entityGridCollisionClass = 3; } else { if ((this->_variant == 0x5e) || (this->_variant == 0x71)) { this->_entityCollisionClass = 3; goto LAB_0060e6d4; } this->_entityGridCollisionClass = 0; } FUN_008635a0(this); if ((this->_isFollower == 0) && (this->_variant != 0xeb)) { if (this->_isDelayed == 0) { switch(variant) { case 0x1e: case 0x3c: this->_orbitLayer = 3; break; case 0x1f: case 0xda: this->_orbitLayer = 2; break; case 0x20: case 0x21: case 0x23: case 0x2c: case 0x2d: case 0x32: case 0x45: case 0x46: case 0x53: case 0x7e: case 0xe2: this->_orbitLayer = 0; break; case 0x2b: this->_orbitLayer = 1; break; case 0x41: case 0x44: case 0x74: case 0x75: case 0x79: case 0x80: this->_orbitLayer = 5; break; case 0x54: case 0x7b: this->_orbitLayer = 4; break; case 0xcc: case 0xd8: case 0xd9: this->_orbitLayer = 6; break; case 0xce: iVar9 = FUN_00436260(); if (*(short *)(iVar9 + 0x18c) < 0) { this->_orbitLayer = -1; } else { iVar9 = FUN_00436260(); this->_orbitLayer = *(short *)(iVar9 + 0x18c) + 7; } break; case 0xe5: this->_orbitLayer = 10; break; case 0xed: this->_orbitLayer = 8; } if (this->_isSubtype55555 == 0) { EVar5 = (EntityPtr)this->_orbitLayer; local_f0 = EVar5; if ((-1 < (int)EVar5) && (this->_exists != 0)) { if ((this->_type == 3) && (((this->_variant == 0xce && (this->_subtype == 0x4d)) || ((this->_variant == 0xce && (this->_subtype == 0x12a)))))) { isWideOrbitWisp = '\x01'; } else { isWideOrbitWisp = '\0'; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&RStack_24,3,-1,-1 ,0,0); local_8 = 2; buffer_init(local_44 + 8,(uint)(((std_string *)RStack_24._shift3)->_buf + 1)); local_8 = CONCAT31(local_8._1_3_,3); local_fc = (ANM2 *)RStack_24._shift1; local_f4 = (ANM2 *)0x0; local_104 = (std_string *)local_44._12_4_; if ((ANM2 *)RStack_24._shift3 != (ANM2 *)0x0) { pAVar11 = (ANM2 *)RStack_24._shift3; pAVar14 = (ANM2 *)RStack_24._shift1; do { listEntity = *(Entity_Familiar **)((pAVar14->_filename)._buf + (int)local_f4 * 4); if (listEntity->_exists != 0) { if (listEntity != this) { local_100 = (EntityPtr) __RTDynamicCast(listEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar:: RTTI_Type_Descriptor,0); if (*(EntityPtr *)((int)local_100 + 0xd70) == EVar5) { orbitParent = get_orbit_parent(this); otherOrbitParent = get_orbit_parent((Entity_Familiar *)local_100); EVar5 = local_100; if (otherOrbitParent == orbitParent) { if (((*(EntityPtr *)((int)local_100 + 0x28) == (EntityPtr)0x3) && (*(EntityPtr *)((int)local_100 + 0x2c) == (EntityPtr)0xce)) && ((*(EntityPtr *)((int)local_100 + 0x30) == (EntityPtr)0x4d || (*(EntityPtr *)((int)local_100 + 0x30) == (EntityPtr)0x12a)))) { isWideOrbitWisp = '\x01'; } local_100 = (EntityPtr)((int)local_30 + 1); if ((uint)local_34 < (uint)local_100) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } *(EntityPtr *)(local_104->_buf + (int)local_30 * 4) = EVar5; local_30 = local_100; } EVar5 = local_f0; } pAVar11 = (ANM2 *)RStack_24._shift3; pAVar14 = local_fc; } } local_f4 = (ANM2 *)((local_f4->_filename)._buf + 1); } while (local_f4 < pAVar11); } local_100 = (EntityPtr)0x3f800000; if (isWideOrbitWisp != '\0') { local_100 = (EntityPtr)0x40000000; } bVar4 = Entity_Player::HasCollectible(this->_player,0x117,0); EVar5 = local_30; if (bVar4 != 0) { local_100 = (EntityPtr)0x3eaaaaab; } local_10c.y = (float)((int)local_30 + 1); if ((uint)local_34 < (uint)local_10c.y) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } local_30 = (EntityPtr)((int)EVar5 + 1); *(Entity_Familiar **)(local_104->_buf + (int)EVar5 * 4) = this; if ((int)local_f0 < 1) { EVar5 = (EntityPtr)0x0; } else { EVar5 = local_f0; if (9 < (int)local_f0) { EVar5 = (EntityPtr)0xa; } } EVar15 = (EntityPtr)0x0; local_f4 = (ANM2 *)((int)EVar5 * 0x14); if (local_30 != (EntityPtr)0x0) { local_f0 = (EntityPtr) (float)((double)(int)local_30 + __uint_to_double_fixup[-((int)local_30 >> 0x1f)]); do { local_114 = (void *)__RTDynamicCast(*(undefined4 *)(local_104->_buf + (int)EVar15 * 4) ,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar:: RTTI_Type_Descriptor,0); *(float *)((int)local_114 + 0xd60) = ((float)(int)EVar15 * 6.2831855) / (float)local_f0; bVar4 = Entity_Player::HasCollectible(this->_player,0x70,0); if (bVar4 == 0) { fVar18 = *(float *)(local_f4[0xb51b]._animDefaultName._buf + 4); } else { fVar18 = *(float *)(local_f4[0xb51b]._animDefaultName._buf + 8) * *(float *)(local_f4[0xb51b]._animDefaultName._buf + 4); } *(float *)((int)local_114 + 0xd6c) = fVar18 * (float)local_100; if (*(int *)((int)local_114 + 0x2c) == 0x3c) { *(float *)((int)local_114 + 0xd6c) = fVar18 * (float)local_100 * 3.0; } EVar15 = (EntityPtr)((int)EVar15 + 1); } while ((uint)EVar15 < (uint)local_10c.y); } if (local_44[8] == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (local_104 != (std_string *)0x0) { uVar7 = (((ANM2 *)(local_104 + -1))->_filename)._capacity; prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar7); free(&(((ANM2 *)(local_104 + -1))->_filename)._capacity); } } local_8 = 0xffffffff; if ((char)RStack_24._seed == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (local_fc != (ANM2 *)0x0) { uVar7 = local_fc[-1]._bitflags; prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar7); free(&local_fc[-1]._bitflags); } } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; iVar9 = this->_orbitLayer; if (iVar9 < 1) { iVar9 = 0; } iVar16 = 10; if (iVar9 < 10) { iVar16 = iVar9; } fVar18 = (float)(&DAT_00c34134)[iVar16 * 5]; (this->_orbitDistance).x = (float)(&DAT_00c34130)[iVar16 * 5]; (this->_orbitDistance).y = fVar18; } } else { this->_orbitLayer = -1; } } else { AddToDelayed(this); } } else { AddToFollowers(this); } game = g_game; iVar9 = this->_variant; if (iVar9 == 0x2b) { fVar18 = *(float *)((int)this->_player + 0x157c); this->_collisionDamage = fVar18 + fVar18; switch(local_f8) { case (uint *)0x1: pcVar10 = "LocustWrath"; break; case (uint *)0x2: pcVar10 = "LocustPestilence"; break; case (uint *)0x3: pcVar10 = "LocustFamine"; break; case (uint *)0x4: pcVar10 = "LocustDeath"; break; case (uint *)0x5: pcVar10 = "LocustConquest"; break; default: goto LAB_0060ed24; } LAB_0060f2b1: ANM2::Play(&this->_sprite,(byte *)pcVar10,0); } else if (iVar9 == 0x49) { fVar18 = *(float *)((int)this->_player + 0x157c); this->_counter = 0; this->_collisionDamage = fVar18 + fVar18; pbVar6 = (this->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { animNameCursor = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { animNameCursor = *(byte **)pbVar6; } pcVar10 = "Appear"; do { bVar4 = *animNameCursor; isLess = bVar4 < (byte)*pcVar10; if (bVar4 != *pcVar10) { LAB_0060ece1: uVar7 = -(uint)isLess | 1; goto LAB_0060ece6; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; isLess = bVar4 < (byte)pcVar10[1]; if (bVar4 != pcVar10[1]) goto LAB_0060ece1; animNameCursor = animNameCursor + 2; pcVar10 = pcVar10 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_0060ece6: if ((uVar7 == 0) && ((pbVar6[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0060ed24; } bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)"Appear",1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0060ed24: if ((((local_f8 == (uint *)0x0) && (1 < *(int *)&g_game->_deathmatchManager)) && (EVar5 = this->_spawnerEntity, EVar5 != (EntityPtr)0x0)) && (*(int *)((int)EVar5 + 0x28) == 1)) { GetPlayerSlot((Entity_Familiar *)&g_game->_playerManager,&fStack_28,EVar5); uVar17 = Color::Color(fStack_28 * 0.6,(float)RStack_24._seed * 0.6, (float)RStack_24._shift1 * 0.6); (*(code *)((ulonglong)uVar17 >> 0x20))((int)uVar17,0xffffffff,0xff,0,1); } } else if (iVar9 == 0x23) { LAB_0060f221: iVar9 = this->_orbitLayer; if (iVar9 < 1) { iVar9 = 0; } iVar16 = 10; if (iVar9 < 10) { iVar16 = iVar9; } fVar18 = (float)(&DAT_00c34134)[iVar16 * 5]; (this->_orbitDistance).x = (float)(&DAT_00c34130)[iVar16 * 5] * 1.5; (this->_orbitDistance).y = fVar18 * 1.5; } else if (iVar9 == 0x3a) { this->_collisionDamage = 10.0; } else if (iVar9 == 0x43) { iVar9 = *(int *)&g_game->_deathmatchManager; this->_maxHitPoints = 100.0; this->_health = 100.0; this->_isInvicible = iVar9 < 2; } else { if (iVar9 == 0x17) { LAB_0060f2aa: pcVar10 = "Float"; goto LAB_0060f2b1; } if (((iVar9 == 0x3d) || (iVar9 == 0x6c)) || (iVar9 == 0xe6)) { LAB_0060efe1: iVar9 = apply_forgotten_lullaby(this,0x1e); this->_fireCooldown = iVar9; } else if (iVar9 == 0x55) { this->_moveDirection = 3; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; } else if (iVar9 == 0x5a) { uVar7 = RNG::RandomInt(&this->_dropRNG,4); this->_state = uVar7; } else if (iVar9 == 0x58) { local_f8 = (uint *)0x34a; LAB_0060ef49: manager = g_manager; seed_fart_sound_override((int *)&local_f8); SoundEffects::Play(&manager->_sfxManager,(int)local_f8,1.0,2,0,1.0,0.0); } else if (iVar9 == 0x83) { this->_renderDepthOffset = -10.0; this->_orbitSpeed = 0.0; update_idle_anim_by_size(this); } else { if (iVar9 == 0x73) { pcVar10 = "Appear"; goto LAB_0060f2b1; } if (iVar9 == 0x74) { if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } else if (iVar9 == 0x76) { (this->_posOffset).y = -24.0; } else if (iVar9 == 0x77) { if (this->_subtype != 0) { this->_subtype = 0; } } else { if (iVar9 == 0x78) { this->_entityCollisionClass = 0; this->_entityGridCollisionClass = 0; local_f8 = (uint *)0x42e; goto LAB_0060ef49; } if (iVar9 == 0x79) { uVar7 = RNG::RandomInt(&this->_dropRNG,4); this->_subtype = uVar7; pcVar10 = (&PTR_s_Idle_00b64900)[uVar7]; goto LAB_0060f2b1; } if (iVar9 == 0x7a) { uVar7 = RNG::RandomInt(&this->_dropRNG,5); this->_subtype = uVar7; init_lil_harbinger_sprite(this); } else { if (iVar9 == 0x7d) { this->_lastDirection = -1; goto LAB_0060efe1; } if (iVar9 == 0x67) goto LAB_0060f2aa; if (iVar9 == 0x80) { RStack_24._seed = (this->_dropRNG)._seed; iVar9 = this->_subtype; RStack_24._shift1 = 2; RStack_24._shift2 = 7; RStack_24._shift3 = 0x19; uVar7 = RNG::RandomInt(&RStack_24,8); this->_subtype = uVar7 + 1; pcVar10 = "Idle%d"; if (iVar9 == 0) { pcVar10 = "Appear%d"; } sprintf_s(abStack_94,0x20,(byte *)pcVar10); ANM2::Play(&this->_sprite,abStack_94,0); uVar7 = RNG::RandomInt(&RStack_24,2); (this->_sprite)._flipX = uVar7 == 0; fVar18 = RNG::RandomFloat(&RStack_24); local_10c.y = fVar18 * 0.3 + 0.8; (this->_orbitDistance).y = local_10c.y * (this->_orbitDistance).y; (this->_orbitDistance).x = local_10c.y * (this->_orbitDistance).x; this->_collisionDamage = *(float *)((int)this->_player + 0x157c); } else { if (iVar9 != 0xea) { if (iVar9 == 900) { uVar3 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x40200000; *(undefined4 *)((int)&this->_flags + 4) = uVar3; bVar4 = Room::IsBeastDungeon(game->_room); if (bVar4 == 0) { this->_entityGridCollisionClass = 5; if ((**(char **)(extraout_EDX + 0x18300) == '\0') || (pcVar10 = "Appear", *(int *)(extraout_EDX + 0x264f8) - *(int *)(*(char **)(extraout_EDX + 0x18300) + 0x11f0) < 2)) { pcVar10 = (char *)s_Idle; } } else { this->_entityGridCollisionClass = 3; if (**(char **)(extraout_EDX + 0x18300) == '\0') { iVar9 = -1; } else { iVar9 = *(int *)(extraout_EDX + 0x264f8) - *(int *)(*(char **)(extraout_EDX + 0x18300) + 0x11f0); } pcVar10 = "FlyingAppear"; if (iVar9 < 2) { pcVar10 = "FlyingIdle"; } } } else { if (iVar9 == 0x7e) goto LAB_0060f221; if ((((iVar9 != 0x14) && (iVar9 != 0x15)) && (iVar9 != 0x16)) && (((iVar9 != 0x39 && (iVar9 != 0x52)) && ((iVar9 != 0x5b && (iVar9 != 0x72)))))) { if (iVar9 == 100) { this->_maxHitPoints = 9999.0; this->_health = 9999.0; } goto LAB_0060f2b9; } pcVar10 = "FloatDown"; } goto LAB_0060f2b1; } RStack_24._seed = (this->_dropRNG)._seed; RStack_24._shift1 = 2; RStack_24._shift2 = 7; RStack_24._shift3 = 0x19; uVar7 = RNG::RandomInt(&RStack_24,8); this->_subtype = uVar7 + 1; sprintf_s(abStack_94,0x20,(byte *)"Idle%d"); ANM2::Play(&this->_sprite,abStack_94,0); uVar7 = RNG::RandomInt(&RStack_24,2); (this->_sprite)._flipX = uVar7 == 0; this->_collisionDamage = *(float *)((int)this->_player + 0x157c); this->_isNotCountedAsFollower = 1; } } } } } LAB_0060f2b9: iVar9 = FUN_0060d780(); if (iVar9 < 0) { uVar3 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x200000; *(undefined4 *)((int)&this->_flags + 4) = uVar3; } if (1 < *(int *)&g_game->_deathmatchManager) { (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x44))(this); } iVar9 = this->_variant; if (((iVar9 == 0x18) || (iVar9 == 0x40)) || ((iVar9 == 0x5a || (iVar9 == 0x66)))) { pbVar6 = (this->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { animNameCursor = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { animNameCursor = *(byte **)pbVar6; } pcVar10 = "FloatDown"; do { bVar4 = *animNameCursor; isLess = bVar4 < (byte)*pcVar10; if (bVar4 != *pcVar10) { LAB_0060f341: uVar7 = -(uint)isLess | 1; goto LAB_0060f346; } if (bVar4 == 0) break; bVar4 = animNameCursor[1]; isLess = bVar4 < (byte)pcVar10[1]; if (bVar4 != pcVar10[1]) goto LAB_0060f341; animNameCursor = animNameCursor + 2; pcVar10 = pcVar10 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_0060f346: if ((uVar7 == 0) && ((pbVar6[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0060f37d; } bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)"FloatDown",1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_0060f37d: if (this->_variant == 0x3e) { EVar5 = (EntityPtr)((int)this->_player + 0x1448); if (*(EntityPtr *)EVar5 != (EntityPtr)0x0) { local_10c.y = (float)EVar5; std::multiset::erase(&local_10c.y); } *(Entity_Familiar **)EVar5 = this; std::multiset::insert(EVar5); LAB_0060f3c0: this->_entityCollisionClass = 4; } else if (this->_variant == 0x4b) goto LAB_0060f3c0; if (this->_variant == 0xe7) { local_114 = ItemConfig::get_wisp_entry(this->_subtype,this->_coins); local_10c.y = (float)operator_new(0x58); if ((EntityPtr)local_10c.y == (EntityPtr)0x0) { EVar5 = (EntityPtr)0x0; } else { local_8 = 7; puVar1 = (uint *)((int)local_10c.y + 0x1c); *(undefined ***)local_10c.y = IsaacRepentancePlus::AbyssLocustData::vftable; *(int *)((int)local_10c.y + 8) = 0; pAVar11 = (ANM2 *)((int)local_10c.y + 0xc); (pAVar11->_filename)._buf[0] = '\0'; (pAVar11->_filename)._buf[1] = '\0'; (pAVar11->_filename)._buf[2] = '\0'; (pAVar11->_filename)._buf[3] = '\0'; pcVar10 = (char *)((int)local_10c.y + 0x10); pcVar10[0] = '\0'; pcVar10[1] = '\0'; pcVar10[2] = '\0'; pcVar10[3] = '\0'; pcVar10 = (char *)((int)local_10c.y + 0x14); pcVar10[0] = '\0'; pcVar10[1] = '\0'; pcVar10[2] = '\0'; pcVar10[3] = '\0'; pcVar10 = (char *)((int)local_10c.y + 0x18); pcVar10[0] = '\0'; pcVar10[1] = '\0'; pcVar10[2] = '\0'; pcVar10[3] = '\0'; *puVar1 = 0; *(uint *)((int)local_10c.y + 0x20) = 0; local_f8 = puVar1; pvVar8 = operator_new(0x18); *(void **)pvVar8 = pvVar8; *(void **)((int)pvVar8 + 4) = pvVar8; *(void **)((int)pvVar8 + 8) = pvVar8; *(undefined2 *)((int)pvVar8 + 0xc) = 0x101; *puVar1 = (uint)pvVar8; psVar12 = (std_string *)((int)local_10c.y + 0x24); psVar12->_buf[0] = '\0'; psVar12->_buf[1] = '\0'; psVar12->_buf[2] = '\0'; psVar12->_buf[3] = '\0'; pcVar10 = (char *)((int)local_10c.y + 0x28); pcVar10[0] = '\0'; pcVar10[1] = '\0'; pcVar10[2] = '\0'; pcVar10[3] = '\0'; pcVar10 = (char *)((int)local_10c.y + 0x2c); pcVar10[0] = '\0'; pcVar10[1] = '\0'; pcVar10[2] = '\0'; pcVar10[3] = '\0'; pcVar10 = (char *)((int)local_10c.y + 0x30); pcVar10[0] = '\0'; pcVar10[1] = '\0'; pcVar10[2] = '\0'; pcVar10[3] = '\0'; *(uint *)((int)local_10c.y + 0x34) = 0; *(uint *)((int)local_10c.y + 0x38) = 0; ((AnimationState *)((int)local_10c.y + 0x3c))->_animation = (void *)0x0; *(void **)((int)local_10c.y + 0x40) = (void *)0x0; *(void **)((int)local_10c.y + 0x44) = (void *)0x0; *(void **)((int)local_10c.y + 0x48) = (void *)0x0; *(float *)((int)local_10c.y + 0x4c) = 0.0; *(byte *)((int)local_10c.y + 0x50) = 0; EVar5 = (EntityPtr)local_10c.y; } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; set_extra_data(EVar5); load_config_graphics(this); if ((*(uint *)((int)local_114 + 0x18) & 0x40000) != 0) { std::string::string(local_44,&(g_manager->_itemConfig)._wispGfxRoot); local_8 = 8; appendedPath = std::string::append(local_44,(byte *)"hungry_0.png",0xc); local_2c = (undefined1 [4])*appendedPath; fStack_28 = (float)appendedPath[1]; RStack_24._seed = appendedPath[2]; RStack_24._4_8_ = *(undefined8 *)(appendedPath + 3); RStack_24._shift3 = appendedPath[5]; appendedPath[4] = 0; appendedPath[5] = 0xf; *(undefined1 *)appendedPath = 0; local_8._0_1_ = 9; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,(std_string *)local_2c); local_8._0_1_ = 8; bVar4 = extraout_CL; if ((ANM2 *)0xf < (uint)RStack_24._shift3) { pcVar10 = ((std_string *)RStack_24._shift3)->_buf + 1; auVar13 = local_2c; if ((char *)0xfff < pcVar10) { auVar13 = *(undefined1 (*) [4])((int)local_2c + -4); pcVar10 = ((std_string *)(RStack_24._shift3 + 0x18))->_buf + 0xc; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)auVar13))) goto LAB_0060f5ad; } operator_delete((void *)auVar13,(uint)pcVar10); bVar4 = extraout_CL_00; } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < (uint)local_30) { size = (EntityPtr *)((int)local_30 + 1); pvVar8 = (void *)local_44._0_4_; if ((EntityPtr *)0xfff < size) { pvVar8 = *(void **)(local_44._0_4_ + -4); size = (EntityPtr *)((int)local_30 + 0x24); if (0x1f < (uint)(local_44._0_4_ + (-4 - (int)pvVar8))) { LAB_0060f5ad: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,(uint)size); bVar4 = extraout_CL_01; } ANM2::LoadGraphics(&this->_sprite,bVar4); } } if ((this->_variant == 0x30) && (this->_player != (void *)0x0)) { EVar5 = (EntityPtr)operator_new(0x578); local_10c.y = (float)EVar5; if (EVar5 == (EntityPtr)0x0) { EVar5 = (EntityPtr)0x0; local_f0 = (EntityPtr)0x0; } else { local_8 = 0xb; *(undefined ***)EVar5 = IsaacRepentancePlus::IsaacsBodyData::vftable; local_f0 = EVar5; ANM2::constructor((ANM2 *)((int)EVar5 + 4)); local_8 = CONCAT31(local_8._1_3_,0xc); _eh_vector_constructor_iterator_ ((int *)((int)EVar5 + 0x118),0x114,4,ANM2::constructor,ANM2::~ANM2); } local_8 = 0xffffffff; set_extra_data(EVar5); local_f4 = (ANM2 *)((int)EVar5 + 0x568); local_fc = (ANM2 *)((int)EVar5 + 0x118); local_f8 = (uint *)0x0; do { iVar16 = local_f8[0x2c7c50]; pvVar8 = this->_player; iVar9 = *(int *)((int)pvVar8 + iVar16 * 0x10 + 0x122c); if (iVar9 < 0) { ANM2::ANM2(&playerSpriteCopy,(ANM2 *)((int)pvVar8 + 0x48)); Isaac::SwapANM2(local_fc,&playerSpriteCopy); local_8 = 0xe; ANM2::Reset(this_01); AnimationState::~AnimationState(&playerSpriteCopy._overlayAnimState); AnimationState::~AnimationState(&playerSpriteCopy._animState); std::string::_Tidy_deallocate(playerSpriteCopy._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&playerSpriteCopy); local_8 = 0xffffffff; } else if ((*(char *)((int)pvVar8 + 0x1570) == '\0') || (*(char *)(iVar9 * 0x130 + *(int *)((int)pvVar8 + 0x1220) + 0x11d) != '\0')) { pAVar11 = (ANM2 *)(iVar9 * 0x130 + *(int *)((int)pvVar8 + 0x1220)); costumeItem = *(int **)pAVar11[1]._filename._buf; if ((costumeItem == (int *)0x0) || ((*costumeItem != 1 || (costumeItem[1] != 0x14)))) { ANM2::ANM2(&costumeSpriteCopy,pAVar11); Isaac::SwapANM2(local_fc,&costumeSpriteCopy); local_8 = 0xd; ANM2::Reset(this_00); AnimationState::~AnimationState(&costumeSpriteCopy._overlayAnimState); AnimationState::~AnimationState(&costumeSpriteCopy._animState); std::string::_Tidy_deallocate(costumeSpriteCopy._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&costumeSpriteCopy); local_8 = 0xffffffff; } else { pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 < 0xba) { iVar9 = 0; } else { iVar9 = *(int *)((int)pvVar8 + 0x2e4); } ANM2::Load(local_fc,(std_string *)(iVar9 + 0x84),1); } iVar16 = *(int *)((int)this->_player + (iVar16 + 0x123) * 0x10); } else { iVar16 = -1; } EVar5 = local_f0; *(int *)(local_f4->_filename)._buf = iVar16; local_f4 = (ANM2 *)((local_f4->_filename)._buf + 4); local_fc = local_fc + 1; local_f8 = local_f8 + 1; } while (local_f8 < (uint *)0x10); RStack_24._shift2 = 0; RStack_24._shift3 = 0xf; local_2c = (undefined1 [4])0x0; std::string::assign(local_2c,(byte *)"gfx/characters/blood gush.anm2",0x1e); local_8 = 0xf; ANM2::Load((ANM2 *)((int)EVar5 + 4),(std_string *)local_2c,1); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if ((ANM2 *)0xf < (uint)RStack_24._shift3) { pcVar10 = ((std_string *)RStack_24._shift3)->_buf + 1; auVar13 = local_2c; if ((char *)0xfff < pcVar10) { auVar13 = *(undefined1 (*) [4])((int)local_2c + -4); pcVar10 = ((std_string *)(RStack_24._shift3 + 0x18))->_buf + 0xc; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)auVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar13,(uint)pcVar10); } iVar9 = *(int *)((int)this->_player + 0x184); if ((((iVar9 == 0) || (iVar9 == 3)) || (iVar9 == 1)) || (iVar9 == 2)) { this->_entityGridCollisionClass = 3; (this->_posOffset).y = -4.0; } else { this->_entityGridCollisionClass = 5; } } bVar4 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)this->_player + 0x1508),0x32); if (bVar4 != 0) { puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 | 0x200; *(int *)&this->_flags = (int)this->_flags; if (-1 < this->_orbitLayer) { this->_size = *(float *)((int)this->_config + 0x38) + 5.0; } } switch(this->_variant) { case 0xc9: switch(this->_subtype) { case 0: case 2: case 4: (this->_splatColor)._offset[0] = 0.25490198; (this->_splatColor)._offset[1] = 0.16078432; (this->_splatColor)._offset[2] = 0.13725491; break; case 1: (this->_splatColor)._offset[0] = 0.5882353; (this->_splatColor)._offset[1] = 0.10588236; (this->_splatColor)._offset[2] = 0.18823531; break; case 3: (this->_splatColor)._offset[0] = 0.9176471; (this->_splatColor)._offset[1] = 0.61960787; goto LAB_0060ff7b; case 5: (this->_splatColor)._offset[0] = 0.039215688; (this->_splatColor)._offset[1] = 0.039215688; (this->_splatColor)._offset[2] = 0.039215688; break; case 6: (this->_splatColor)._offset[0] = 0.7607844; (this->_splatColor)._offset[1] = 0.94117653; (this->_splatColor)._offset[2] = 0.94117653; break; default: goto switchD_0060fe51_caseD_7; case 0xc: (this->_splatColor)._tint[0] = 0.0; (this->_splatColor)._tint[1] = 0.0; (this->_splatColor)._tint[2] = 0.0; (this->_splatColor)._tint[3] = 0.0; goto switchD_0060fe51_caseD_7; case 0xd: (this->_splatColor)._offset[0] = 0.3137255; (this->_splatColor)._offset[1] = 0.16078432; (this->_splatColor)._offset[2] = 0.13725491; break; case 0xe: (this->_splatColor)._offset[0] = 0.25490198; (this->_splatColor)._offset[1] = 0.50980395; (this->_splatColor)._offset[2] = 0.13725491; break; case 0x14: (this->_splatColor)._offset[0] = 0.6; (this->_splatColor)._offset[1] = 0.4; LAB_0060ff7b: (this->_splatColor)._offset[2] = 0.0; } (this->_splatColor)._tint[3] = 1.0; (this->_splatColor)._tint[2] = 0.0; (this->_splatColor)._tint[1] = 0.0; (this->_splatColor)._tint[0] = 0.0; switchD_0060fe51_caseD_7: if (this->_subtype == 1) { fVar18 = 2.0; } else { fVar18 = 1.0; } this->_collisionDamage = fVar18 * *(float *)((int)this->_player + 0x157c); break; case 0xce: case 0xed: WispInit(this); break; case 0xd0: ANM2::Play(&this->_sprite,(byte *)"FloatDown",0); break; case 0xda: ANM2::Play(&this->_sprite,s_Fly,0); break; case 0xe0: ANM2::Play(&this->_sprite,(byte *)"Descend",0); this->_entityCollisionClass = 0; case 0xf1: this->_state = 0; break; case 0xe4: ANM2::SetFrame(&this->_sprite,(std_string *)"WalkDown",0); ANM2::SetOverlayFrame(&this->_sprite,(byte *)"HeadDown",0); this->_fireCooldown = 0; this->_headFrameDelay = 0; this->_state = 0; this->_entityGridCollisionClass = 5; this->_shootDirection = -1; if (this->_subtype == 0) break; RStack_24._shift2 = 0; RStack_24._shift3 = 0xf; local_2c = (undefined1 [4])0x0; local_8 = 0x10; bVar4 = extraout_CL_02; switch(this->_subtype) { case 1: uVar7 = 6; pcVar10 = "_white"; break; case 2: uVar7 = 6; pcVar10 = "_black"; break; case 3: uVar7 = 5; pcVar10 = "_blue"; break; case 4: uVar7 = 4; pcVar10 = &UNK_00b63dac; break; case 5: uVar7 = 6; pcVar10 = "_green"; break; case 6: uVar7 = 5; pcVar10 = "_grey"; break; case 7: uVar7 = 7; pcVar10 = "_shadow"; break; default: goto DAT_0060fa34; case 99: uVar7 = 10; pcVar10 = "_forgotten"; } std::string::assign(local_2c,(byte *)pcVar10,uVar7); bVar4 = extraout_CL_03; DAT_0060fa34: local_f0 = (EntityPtr)0x0; if ((this->_sprite)._layerCount != 0) { do { ANM2::GetLayer(&this->_sprite,(byte *)local_f0); FUN_004562f0(&layerSheetPath); local_8._0_1_ = 0x11; psVar12 = &layerSheetPath; if (0xf < layerSheetPath._capacity) { psVar12 = (std_string *)layerSheetPath._buf._0_4_; } iVar9 = std::string::find_last_of ((byte *)psVar12,layerSheetPath._size,0xffffffff,&DAT_00b1cebc,1); if (iVar9 != -1) { FUN_00651a90(sheetExtension,iVar9,0xffffffff); local_8._0_1_ = 0x12; FUN_00651a90(&uStack_8c,0,iVar9); local_8._0_1_ = 0x13; pcVar10 = (char *)FUN_00651a90(sheetStem,0,iVar9); local_8._0_1_ = 0x14; auVar13 = (undefined1 [4])local_2c; if ((ANM2 *)0xf < (uint)RStack_24._shift3) { auVar13 = local_2c; } pvVar8 = std::string::append(pcVar10,(byte *)auVar13,RStack_24._shift2); FUN_00417100(pvVar8); local_8._0_1_ = 0x15; FUN_00651d50(sheetExtension); std::string::_Tidy_deallocate(local_44); local_8 = CONCAT31(local_8._1_3_,0x18); std::string::_Tidy_deallocate(sheetStem); ModManager::TryRedirectPath(&g_manager->_modManager,&sStack_e8,&redirectedPath); if (&redirectedPath != (std_string *)extraout_EAX) { std::string::_Tidy_deallocate(redirectedPath._buf); redirectedPath._buf._0_4_ = *(undefined4 *)extraout_EAX; redirectedPath._buf._4_4_ = *(undefined4 *)(extraout_EAX + 4); redirectedPath._buf._8_4_ = *(undefined4 *)(extraout_EAX + 8); redirectedPath._buf._12_4_ = *(undefined4 *)(extraout_EAX + 0xc); redirectedPath._size = *(uint *)(extraout_EAX + 0x10); redirectedPath._capacity = *(uint *)(extraout_EAX + 0x14); extraout_EAX[0x10] = '\0'; extraout_EAX[0x11] = '\0'; extraout_EAX[0x12] = '\0'; extraout_EAX[0x13] = '\0'; extraout_EAX[0x14] = '\x0f'; extraout_EAX[0x15] = '\0'; extraout_EAX[0x16] = '\0'; extraout_EAX[0x17] = '\0'; *extraout_EAX = '\0'; } std::string::_Tidy_deallocate(sStack_e8._buf); pbVar6 = (byte *)&redirectedPath; if (0xf < redirectedPath._capacity) { pbVar6 = (byte *)redirectedPath._buf._0_4_; } bVar4 = file_exists(pbVar6); if (bVar4 != 0) { pbVar6 = (byte *)&redirectedPath; if (0xf < redirectedPath._capacity) { pbVar6 = (byte *)redirectedPath._buf._0_4_; } std::string::assign(layerSheetPath._buf,pbVar6,redirectedPath._size); Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,(int)local_f0,&layerSheetPath); } local_8._0_1_ = 0x13; if (0xf < redirectedPath._capacity) { uVar7 = redirectedPath._capacity + 1; pbVar6 = (byte *)redirectedPath._buf._0_4_; if (0xfff < uVar7) { pbVar6 = *(byte **)(redirectedPath._buf._0_4_ + 0xfffffffc); uVar7 = redirectedPath._capacity + 0x24; if ((byte *)0x1f < (byte *)(redirectedPath._buf._0_4_ + (-4 - (int)pbVar6))) goto code_r0x0060e596; } operator_delete(pbVar6,uVar7); } redirectedPath._size = 0; redirectedPath._capacity = 0xf; redirectedPath._buf._0_4_ = redirectedPath._buf._0_4_ & 0xffffff00; std::string::_Tidy_deallocate((char *)&uStack_8c); std::string::_Tidy_deallocate(sheetExtension); } local_8 = CONCAT31(local_8._1_3_,0x10); std::string::_Tidy_deallocate(layerSheetPath._buf); local_f0 = (EntityPtr)((int)local_f0 + 1); bVar4 = extraout_CL_04; } while ((uint)local_f0 < (uint)(this->_sprite)._layerCount); } ANM2::LoadGraphics(&this->_sprite,bVar4); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if ((ANM2 *)0xf < (uint)RStack_24._shift3) { pcVar10 = ((std_string *)RStack_24._shift3)->_buf + 1; auVar13 = local_2c; if ((char *)0xfff < pcVar10) { auVar13 = *(undefined1 (*) [4])((int)local_2c + -4); pcVar10 = ((std_string *)(RStack_24._shift3 + 0x18))->_buf + 0xc; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)auVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar13,(uint)pcVar10); } break; case 0xe9: this->_visible = 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x2); layer->_visible = 0; ANM2::Play(&this->_sprite,(byte *)"GrabEnd",0); Sprite::SetLastFrame((Sprite *)&this->_sprite); this->_renderZOffset = -100; break; case 0xec: if ((g_game->_currentDimensionIdx != 0) || ((iVar9 = g_game->_currentRoomIdx, iVar9 < 0 && (iVar9 = g_game->_lastRoomIdx, iVar9 < 0)))) { iVar9 = g_game->_startingRoomIdx; } this->_coins = -1; this->_hearts = -0x7fff8000; this->_keys = 0; this->_orbitSpeed = 0.0; this->_orbitAngleOffset = 1.0; (this->_formationTargetOffset).x = (float)(iVar9 % 0xd); (this->_formationOffset).x = (float)(iVar9 % 0xd); (this->_formationTargetOffset).y = (float)(iVar9 / 0xd); (this->_formationOffset).y = (float)(iVar9 / 0xd); break; case 0xee: ANM2::SetFrame(&this->_sprite,(std_string *)"WalkDown",0); ANM2::SetOverlayFrame(&this->_sprite,(byte *)"HeadDown",0); this->_fireCooldown = 0; this->_headFrameDelay = 0; this->_damageCountdown = 0x14; subtypeIndex = -(uint)(this->_subtype != 0) & this->_subtype; this->_state = 0; this->_entityGridCollisionClass = 5; this->_shootDirection = -1; uVar7 = 7; if (subtypeIndex < 7) { uVar7 = subtypeIndex; } layer = ANM2::GetLayer(&familiar->_sprite,(byte *)0x0); (layer->_cropOffset).x = *(float *)(&DAT_00c3423c + uVar7 * 100); (layer->_cropOffset).y = *(float *)(&DAT_00c34240 + uVar7 * 100); subtypeIndex = -(uint)(familiar->_subtype != 0) & familiar->_subtype; uVar7 = 7; if (subtypeIndex < 7) { uVar7 = subtypeIndex; } layer = ANM2::GetLayer(&familiar->_sprite,(byte *)0x1); this = familiar; (layer->_cropOffset).x = *(float *)(&DAT_00c3423c + uVar7 * 100); (layer->_cropOffset).y = *(float *)(&DAT_00c34240 + uVar7 * 100); subtypeIndex = -(uint)(familiar->_subtype != 0) & familiar->_subtype; uVar7 = 7; if (subtypeIndex < 7) { uVar7 = subtypeIndex; } Color::operator_assign ((Color *)&familiar->_splatColor,(ColorMod *)(&DAT_00c34244 + uVar7 * 100)); game = g_game; fVar18 = DAT_00c344f4; iVar9 = this->_subtype; if (iVar9 == 7) { this->_health = DAT_00c344f4; if (1 < *(int *)&game->_deathmatchManager) { this->_health = fVar18 * 10.0; } } else { if (iVar9 == 1) { fVar18 = this->_maxHitPoints * 1.5; } else { if (iVar9 != 6) break; fVar18 = this->_maxHitPoints * 0.5; } this->_maxHitPoints = fVar18; this->_health = fVar18; } break; case 0xef: this->_entityGridCollisionClass = 5; uVar7 = Random(); fVar18 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; this->_orbitAngleOffset = fVar18; ANM2::SetFrame(&this->_sprite,(std_string *)&DAT_00b602e8,(int)(fVar18 * 8.0)); break; case 0xf0: FamiliarHelper::umbilical_baby_load_graphics(this); if (this->_player != (void *)0x0) { uVar7 = Random(); EVar5 = (EntityPtr) Game::Spawn(g_game,1000,0xc9,(Vector *)((int)this->_player + 0x33c),&g_vectorZero, (Entity *)0x0,0,uVar7); Entity::SetParent((Entity *)EVar5,(Entity *)this); *(uint *)((int)EVar5 + 0x16c) = *(uint *)((int)EVar5 + 0x16c) | 0x20; *(undefined4 *)((int)EVar5 + 0x168) = *(undefined4 *)((int)EVar5 + 0x168); (**(code **)(*(int *)EVar5 + 0xc))(); if (this->_linkedEntity != (EntityPtr)0x0) { local_10c.y = (float)&this->_linkedEntity; std::multiset::erase(&local_10c.y); } this->_linkedEntity = EVar5; std::multiset::insert(&this->_linkedEntity); } } if (((this->_variant == 0x59) || (this->_variant == 0x60)) && (1 < (uint)(this->_sprite)._layerCount)) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_bitflags = 1; } ExceptionList = local_10; return; } //@@ 00610470 Entity_Familiar::Remove /* ZHL [vtable slot 10] */ void __thiscall Entity_Familiar::Remove(Entity_Familiar *this) { int *piVar1; int iVar2; void *pvVar3; float fVar4; Entity::Remove((Entity *)this); if (-1 < this->_orbitLayer) { RecalculateOrbitOffset(this,this->_orbitLayer,0); this->_orbitLayer = -1; } RemoveFromFollowers(this); RemoveFromDelayed(this); if (this->_variant == 0x2b) { if (this->_subtype == 0) { piVar1 = (int *)((int)this->_player + 0x136c); *piVar1 = *piVar1 + -1; } } else if (this->_variant == 0x49) { piVar1 = (int *)((int)this->_player + 0x1370); *piVar1 = *piVar1 + -1; } fVar4 = g_vectorZero.y; iVar2 = this->_variant; if (((iVar2 == 0x44) || (iVar2 == 0x4e)) || (iVar2 == 0xf3)) { pvVar3 = this->_player; *(float *)((int)pvVar3 + 0x164c) = g_vectorZero.x; *(float *)((int)pvVar3 + 0x1650) = fVar4; } ResolveOrbitConflict(this); return; } //@@ 00610540 Entity_Familiar::Kill /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 9] prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Familiar::Kill(Entity_Familiar *this,EntityRef *source) { float *pfVar1; code *pcVar2; longlong lVar3; longlong lVar4; longlong lVar5; ANM2 *pAVar6; qword qVar7; char cVar8; byte bVar9; ColorMod *color; uint uVar10; Entity *tmpEntity; Entity *orbitParent; int orbitLayerClamped; ColorMod *color_00; int *piVar11; Vector *pVVar12; uint uVar13; uint uVar14; LayerState *layer; EntityRef *tmpEntity; void *pvVar16; int orbitLayerClamped; int unusedArg; qword *allocatedBytes; Entity_Familiar *pEVar18; PlayerManager *playerManager; EntityPtr *pEVar19; bool bVar20; float fVar21; undefined8 uVar22; ulonglong uVar23; ulonglong uVar24; EntityRef killSource; Vector freePickupPos; undefined1 local_228 [8]; int local_220; undefined1 local_21c [4]; EntityRef nullKillSource; Vector spawnPos; undefined8 rngShifts; undefined4 local_1dc; int triggerKeyType; undefined4 triggerKeyAnyVariant; int triggerKeyTypeVariant; int triggerKeyVariant; EntityPtr *spawnerPtr; uint collectibleKey; Vector pickupVelocity; char wispMates [4]; int wispMatesData; undefined1 *wispMatesCapacity; Entity_Familiar *wispMatesCount; char itemWispMates [4]; int itemWispMatesData; undefined1 *itemWispMatesCapacity; Entity_Familiar *itemWispMatesCount; Vector local_198; Vector local_190; EntityList_EL itemWispQuery; EntityList_EL wispQuery; Vector pickupPos; uint pickupSeed; int soundId; Vector local_158; Vector local_150; void *local_148; uint pickupType; uint local_140; EntityPtr *local_13c; Game *local_138; Entity *local_134; uint pickupSubtype; EntityPtr local_12c; uint local_128; Entity_Familiar *local_124; undefined8 local_120; Entity_Familiar *local_118; char isUnicornWisp; Color particleColor; Color particleColor2; RNG cardRng; ColorMod splatColor; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; Manager *manager; Entity_Familiar *otherFamiliar; Entity_Player *player; manager = g_manager; local_14 = -NAN; puStack_18 = &LAB_00af68e1; local_1c = ExceptionList; ExceptionList = &local_1c; local_12c = (EntityPtr)this; if (this->_dead == 0) { orbitLayerClamped = this->_variant; if (orbitLayerClamped == 0x80) { Color::Color(&particleColor); uVar10 = Random(); Game::SpawnParticles (g_game,&this->_pos,0x23,8, (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0,color,-12.0,0); uVar10 = Random(); manager = g_manager; local_120 = CONCAT44(0xb5,(float)local_120); local_124 = (Entity_Familiar *) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.0); seed_fart_sound_override((int *)((int)&local_120 + 4)); SoundEffects::Play(&manager->_sfxManager,(int)local_120._4_4_,0.5,2,0,(float)local_124,0.0); } else if ((orbitLayerClamped == 0xd8) || (orbitLayerClamped == 0xd9)) { soundId = 0x1e; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); splatColor._tint[0] = 0.2; splatColor._tint[1] = 0.2; splatColor._tint[2] = 0.2; splatColor._tint[3] = 1.0; splatColor._offset[0] = 0.0; splatColor._colorize[0] = 1.0; splatColor._colorize[1] = 1.0; splatColor._colorize[2] = 1.0; splatColor._colorize[3] = 1.0; splatColor._offset[1] = 0.0; splatColor._offset[2] = 0.0; uVar10 = Random(); pVVar12 = &this->_pos; local_198.y = (float)pVVar12; tmpEntity = Game::SpawnEx(g_game,1000,2,pVVar12,&g_vectorZero,(Entity *)0x0,3,uVar10,0); (**(code **)(*(int *)tmpEntity + 0x3c))(&splatColor,0xffffffff,0xff,0,1); uVar10 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,7,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar10,0); (**(code **)(*(int *)tmpEntity + 0x3c))(&splatColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar10 = Random(); piVar11 = (int *)(uVar10 % 5); while (local_124 = (Entity_Familiar *)((int)piVar11 + 3), local_124 != (Entity_Familiar *)0x0) { uVar10 = Random(); fVar21 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_134 = (Entity *)(fVar21 + fVar21); fVar21 = cos((float)local_134); pickupPos.x = fVar21 * 0.5 * *(float *)((int)this + 0x370) + ((Vector *)((int)this + 0x33c))->x; fVar21 = sin((float)local_134); pickupPos.y = fVar21 * 0.5 * *(float *)((int)this + 0x370) + *(float *)((int)this + 0x340); uVar10 = Random(); fVar21 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_120._4_4_ = (Entity_Familiar *)(fVar21 + fVar21); uVar10 = Random(); local_120 = CONCAT44(local_120._4_4_, (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0); pickupVelocity.x = cos((float)local_120._4_4_); pickupVelocity.x = pickupVelocity.x * (float)local_120; local_150.y = pickupVelocity.x; fVar21 = sin((float)local_120._4_4_); pickupVelocity.y = fVar21 * (float)local_120; local_13c = (EntityPtr *)pickupVelocity.y; pickupSeed = Random(); local_138 = g_game; pickupSubtype = 0; local_140 = 5; pickupType = 1000; lua_callback_run_pre_entity_spawn ((int *)&pickupType,(int *)&local_140,&pickupPos,&pickupVelocity,(Entity *)0x0, (int *)&pickupSubtype,&pickupSeed); uVar10 = local_140; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00611aa8: local_128 = pickupSubtype; } else { local_118 = (g_game->_deathmatchManager)._type; uVar14 = Random(); pEVar18 = local_118; uVar13 = pickupSubtype; rngShifts = 0x900000005; local_120 = CONCAT44(uVar14,7); local_1dc = 7; if (pickupType != 5) goto LAB_00611aa8; if (uVar10 < 0x12d) { if (uVar10 == 300) { while ((local_128 = pickupSubtype, pickupSubtype == 0 || (cVar8 = (**(code **)(*(int *)local_118 + 0x24))(pickupSubtype), cVar8 != '\0') )) { if (uVar14 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = uVar14 >> ((byte)rngShifts & 0x1f) ^ uVar14; uVar14 = uVar14 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar14; uVar14 = uVar14 >> ((byte)local_120 & 0x1f) ^ uVar14; orbitLayerClamped = ItemPool::GetCardEx(uVar14,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar14; pickupSubtype = lua_callback_run_get_card(&cardRng,orbitLayerClamped,1,1,0); } } else { if (uVar10 == 0x46) { local_134 = (Entity *)(pickupSubtype >> 0xb); do { local_128 = pickupSubtype; if (pickupSubtype != 0) { pcVar2 = *(code **)(*(int *)local_118 + 0x28); orbitLayerClamped = ItemPool::GetPillEffect (&g_game->_itemPool,pickupSubtype,(Entity_Player *)0x0); cVar8 = (*pcVar2)(orbitLayerClamped); if (cVar8 == '\0') goto LAB_00611ab4; uVar14 = (uint)local_120._4_4_; } if (uVar14 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = uVar14 >> ((byte)rngShifts & 0x1f) ^ uVar14; uVar14 = uVar14 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar14; uVar14 = uVar14 >> ((byte)local_120 & 0x1f) ^ uVar14; local_120 = CONCAT44(uVar14,(float)local_120); pickupSubtype = ItemPool::GetPill(uVar14); pickupSubtype = pickupSubtype | ((uint)local_134 & 1) << 0xb; } while( true ); } if (uVar10 != 100) goto LAB_00611aa8; local_128 = pickupSubtype; if (pickupSubtype == 0x19) { LAB_006118d4: bVar20 = false; } else { collectibleKey = pickupSubtype; std::set::find_node(local_228,&collectibleKey); if (((*(char *)(local_220 + 0xd) == '\0') && (*(int *)(local_220 + 0x10) <= (int)uVar13)) && (local_220 != pEVar18->_index)) goto LAB_006118d4; bVar20 = true; } if ((uVar13 == 0) || (bVar20)) { pickupSubtype = (**(code **)(*(int *)pEVar18 + 0x84))(0); local_128 = pickupSubtype; } } } else { if (uVar10 != 0x15e) goto LAB_00611aa8; while ((local_128 = pickupSubtype, pickupSubtype == 0 || (cVar8 = (**(code **)(*(int *)local_118 + 0x2c))(pickupSubtype), cVar8 != '\0'))) { pickupSubtype = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_00611ab4: local_134 = EntityFactory::Create(local_138->_entityFactory,pickupType,0); lVar3 = CONCAT44(local_138,local_158.y); if (local_134 != (Entity *)0x0) { uVar23 = GetTimeNs(); tmpEntity = local_134; lVar3 = (uVar23 & 0xffffffff) * 0x431bde82; local_158.y = (float)((ulonglong)lVar3 >> 0x20); lVar4 = (uVar23 >> 0x20) * 0xd7b634db; local_118 = (Entity_Familiar *)((ulonglong)lVar4 >> 0x20); uVar24 = lVar4 + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)(uVar24 >> 0x20); lVar3 = lVar3 + (uVar24 & 0xffffffff); local_190.x = (float)lVar3; uVar10 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = (uVar23 >> 0x20) * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar10),uVar13 + uVar10); local_134->_spawnerType = 0; uVar10 = (uint)((ulonglong)lVar3 >> 0x20); local_134->_spawnerVariant = 0; pEVar19 = &local_134->_spawnerEntity; local_120 = CONCAT44(uVar10 >> 0x12,(uint)lVar3 >> 0x12 | uVar10 * 0x4000); if (*pEVar19 != (EntityPtr)0x0) { spawnerPtr = pEVar19; std::multiset::erase(&spawnerPtr); } orbitLayerClamped = *(int *)tmpEntity; *pEVar19 = (EntityPtr)0x0; (tmpEntity->_pos).x = pickupPos.x; (tmpEntity->_pos).y = pickupPos.y; (tmpEntity->_velocity).x = local_150.y; (tmpEntity->_velocity).y = (float)local_13c; (**(code **)(orbitLayerClamped + 4))(pickupType,local_140,local_128,pickupSeed); game = local_138; pvVar16 = local_138->_room; orbitLayerClamped = *(int *)((int)pvVar16 + 0x1214); *(int *)((int)pvVar16 + 0x1214) = orbitLayerClamped + 1; tmpEntity->_index = orbitLayerClamped; EntityList::AddEntity((EntityList *)((int)pvVar16 + 0x1218),tmpEntity); bVar9 = Game::ShouldEraseEnemy(tmpEntity); if (bVar9 != 0) { Entity::RemoveWithPoof(tmpEntity,unusedArg); } if ((tmpEntity->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { triggerKeyTypeVariant = tmpEntity->_type; triggerKeyVariant = tmpEntity->_variant; std::map::find(&local_148,&triggerKeyTypeVariant); if (local_148 == (game->_proceduralItemManager)._spawnTriggerTargets._head) { triggerKeyType = tmpEntity->_type; triggerKeyAnyVariant = 0xffffffff; piVar11 = (int *)std::map::find(local_21c,&triggerKeyType); local_148 = (void *)*piVar11; if (local_148 == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_00611d87; } playerManager = &g_game->_playerManager; local_118 = (Entity_Familiar *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar16 = (playerManager->_playerList)._end; if ((int)pvVar16 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar16 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (local_118 < (Entity_Familiar *)((int)pvVar16 - (int)piVar11 >> 2)) { piVar11 = piVar11 + (int)local_118; } trigger_set_dispatch ((void *)(*piVar11 + 0x1fc8),6,tmpEntity,&pickupPos,&pickupVelocity); playerManager = &g_game->_playerManager; local_118 = (Entity_Familiar *)&local_118->field_0x1; } while (local_118 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00611d87: uVar24 = GetTimeNs(); uVar10 = (uint)(uVar24 >> 0x20); lVar4 = (uVar24 & 0xffffffff) * 0x431bde82; local_150.y = (float)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar10 * 0xd7b634db; local_13c = (EntityPtr *)((ulonglong)lVar5 >> 0x20); lVar3 = (ulonglong)uVar10 * 0x431bde82; uVar24 = lVar5 + ((uVar24 & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)(uVar24 >> 0x20); lVar4 = lVar4 + (uVar24 & 0xffffffff); local_190.x = (float)lVar4; uVar10 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar10),uVar13 + uVar10); uVar14 = (uint)((ulonglong)lVar4 >> 0x20); uVar10 = (uint)lVar4 >> 0x12 | uVar14 * 0x4000; uVar13 = uVar10 - (int)(float)local_120; bVar20 = CARRY4((uint)g_entitySpawnTimeMs,uVar13); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar13; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar14 >> 0x12) - (int)local_120._4_4_) - (uint)(uVar10 < (uint)(float)local_120)) + (uint)bVar20; } tmpEntity = local_134; local_138 = (Game *)((ulonglong)lVar3 >> 0x20); local_158.y = (float)lVar3; (**(code **)(*(int *)local_134 + 0x3c))(&splatColor,0xffffffff,0xff,0,1); if (&tmpEntity->_splatColor != &splatColor) { (tmpEntity->_splatColor)._tint[0] = splatColor._tint[0]; (tmpEntity->_splatColor)._tint[1] = splatColor._tint[1]; (tmpEntity->_splatColor)._tint[2] = splatColor._tint[2]; (tmpEntity->_splatColor)._tint[3] = splatColor._tint[3]; (tmpEntity->_splatColor)._colorize[0] = splatColor._colorize[0]; (tmpEntity->_splatColor)._colorize[1] = splatColor._colorize[1]; (tmpEntity->_splatColor)._colorize[2] = splatColor._colorize[2]; (tmpEntity->_splatColor)._colorize[3] = splatColor._colorize[3]; *(ulonglong *)(tmpEntity->_splatColor)._offset = CONCAT44(splatColor._offset[1],splatColor._offset[0]); (tmpEntity->_splatColor)._offset[2] = splatColor._offset[2]; } (**(code **)(*(int *)tmpEntity + 0xc))(); this = (Entity_Familiar *)local_12c; piVar11 = &local_124[-1]._wispCollectibleType; } if (*(int *)((int)this + 0x2c) == 0xd8) { layer = ANM2::GetLayer((ANM2 *)((int)this + 0x48),(byte *)0x0); (layer->_size).x = g_vectorZero.x; (layer->_size).y = g_vectorZero.y; *(int *)((int)this + 0xd88) = 0x1c2; *(int *)((int)this + 0x188) = 0; *(float *)((int)this + 0x15c) = 0.0; if (-1 < *(int *)((int)this + 0xd70)) { RecalculateOrbitOffset(this,*(int *)((int)this + 0xd70),0); *(int *)((int)this + 0xd70) = -1; } local_150.y = *(float *)((int)this + 0x410); local_124 = (Entity_Familiar *)0x2; do { uVar10 = Random(); uVar13 = Random(); fVar21 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_13c = (EntityPtr *)(fVar21 + fVar21); fVar21 = cos((float)local_13c); spawnPos.x = fVar21 * 10.0 + ((Vector *)((int)this + 0x33c))->x; fVar21 = sin((float)local_13c); spawnPos.y = fVar21 * 10.0 + *(float *)((int)this + 0x340); tmpEntity = Game::SpawnEx(g_game,3,0xd9,&spawnPos,&g_vectorZero,(Entity *)local_150.y,0, uVar10,0); (**(code **)(*(int *)tmpEntity + 0xc))(); pEVar19 = &tmpEntity->_parent; if (tmpEntity->_parent != (EntityPtr)0x0) { local_13c = pEVar19; std::multiset::erase(&local_13c); } *pEVar19 = (EntityPtr)this; std::multiset::insert(pEVar19); local_124 = (Entity_Familiar *)((int)local_124 + -1); } while (local_124 != (Entity_Familiar *)0x0); nullKillSource._type = 0; nullKillSource._variant = 0; nullKillSource._spawnerType = 0; nullKillSource._spawnerVariant = 0; nullKillSource._position.x = g_vectorZero.x; nullKillSource._position.y = g_vectorZero.y; nullKillSource._velocity.x = g_vectorZero.x; nullKillSource._velocity.y = g_vectorZero.y; nullKillSource._flags = 0; nullKillSource._entity = (void *)0x0; Entity::Kill((Entity *)this,&nullKillSource); *(byte *)((int)this + 0x173) = 0; ExceptionList = local_1c; return; } uVar10 = Random(); fVar21 = local_198.y; orbitLayerClamped = (uVar10 & 1) + 2; if ((*(uint *)((int)this + 0x168) & 0x100) == 0) { do { tmpEntity = *(void **)((int)this + 0x410); pfVar1 = &tmpEntity[4]._pos.y; *pfVar1 = (float)((int)*pfVar1 + 1); spawn_blue_spider((Vector *)((int)this + 0x33c),tmpEntity,&g_vectorZero); orbitLayerClamped = orbitLayerClamped + -1; } while (orbitLayerClamped != 0); } else { do { pVVar12 = Room::FindFreePickupSpawnPosition (g_game->_room,&freePickupPos,(Vector *)fVar21,40.0,0,0,0); Entity_NPC::ThrowSpider((Vector *)fVar21,(Entity *)0x0,*pVVar12,0,-30.0); orbitLayerClamped = orbitLayerClamped + -1; } while (orbitLayerClamped != 0); this = (Entity_Familiar *)local_12c; } } else if (orbitLayerClamped == 0xce) { cVar8 = wisp_kill(this,__security_cookie ^ (uint)((&splatColor)[1]._colorize + 1)); if (cVar8 == '\0') { ExceptionList = local_1c; return; } local_140 = this->_orbitLayer; if (-1 < (int)local_140) { if (this->_isSubtype55555 == 0) { if ((this->_type == 3) && (((this->_variant == 0xce && (this->_subtype == 0x4d)) || ((this->_variant == 0xce && (this->_subtype == 0x12a)))))) { isUnicornWisp = '\x01'; } else { isUnicornWisp = '\0'; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&wispQuery,3,-1,-1,0,0); orbitLayerClamped = wispQuery._size; local_14 = 0.0; buffer_init(wispMates,wispQuery._size + 1); local_14 = (float)CONCAT31(local_14._1_3_,1); local_120._0_4_ = 0.0; pEVar18 = wispMatesCount; if (orbitLayerClamped != 0) { local_118 = wispMatesCount; pvVar16 = wispQuery._data; uVar10 = wispQuery._size; do { otherFamiliar = *(Entity_Familiar **)((int)pvVar16 + (int)(float)local_120 * 4); if (otherFamiliar->_exists != 0) { if (otherFamiliar != this) { local_120._4_4_ = (Entity_Familiar *) __RTDynamicCast(otherFamiliar,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0 ); if ((local_120._4_4_)->_orbitLayer == local_140) { tmpEntity = get_orbit_parent(this); orbitParent = get_orbit_parent(local_120._4_4_); pEVar18 = local_120._4_4_; if (orbitParent == tmpEntity) { if ((((local_120._4_4_)->_type == 3) && ((local_120._4_4_)->_variant == 0xce)) && (((local_120._4_4_)->_subtype == 0x4d || ((local_120._4_4_)->_subtype == 0x12a)))) { isUnicornWisp = '\x01'; } local_124 = (Entity_Familiar *)&local_118->field_0x1; if (wispMatesCapacity < local_124) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } *(Entity_Familiar **)(wispMatesData + (int)local_118 * 4) = pEVar18; local_118 = local_124; wispMatesCount = local_124; pEVar18 = local_124; } else { pEVar18 = local_118; } } pvVar16 = wispQuery._data; uVar10 = wispQuery._size; } } local_120._0_4_ = (float)((int)(float)local_120 + 1); } while ((uint)(float)local_120 < uVar10); } local_12c = (EntityPtr)0x3f800000; if (isUnicornWisp != '\0') { local_12c = (EntityPtr)0x40000000; } bVar9 = Entity_Player::HasCollectible(this->_player,0x117,0); if (bVar9 != 0) { local_12c = (EntityPtr)0x3eaaaaab; } uVar10 = local_140; if ((int)local_140 < 1) { uVar10 = 0; } uVar13 = 10; if ((int)uVar10 < 10) { uVar13 = uVar10; } local_118 = (Entity_Familiar *)0x0; local_120 = CONCAT44(local_120._4_4_,uVar13 * 0x14); if (pEVar18 != (Entity_Familiar *)0x0) { local_134 = (Entity *) (float)((double)(int)pEVar18 + __uint_to_double_fixup[-((int)pEVar18 >> 0x1f)]); local_138 = (Game *)0x40400000; local_124 = (Entity_Familiar *)0x40c90fdb; do { local_148 = (void *)__RTDynamicCast(*(undefined4 *) (wispMatesData + (int)local_118 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_Familiar:: RTTI_Type_Descriptor,0); *(float *)((int)local_148 + 0xd60) = ((float)(int)local_118 * (float)local_124) / (float)local_134; bVar9 = Entity_Player::HasCollectible(this->_player,0x70,0); if (bVar9 == 0) { fVar21 = *(float *)(&DAT_00c34138 + (int)(float)local_120); } else { fVar21 = *(float *)(&DAT_00c3413c + (int)(float)local_120) * *(float *)(&DAT_00c34138 + (int)(float)local_120); } *(float *)((int)local_148 + 0xd6c) = fVar21 * (float)local_12c; if (*(int *)((int)local_148 + 0x2c) == 0x3c) { *(float *)((int)local_148 + 0xd6c) = fVar21 * (float)local_12c * (float)local_138; } local_118 = (Entity_Familiar *)&local_118->field_0x1; } while (local_118 < pEVar18); } if (wispMates[0] == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (wispMatesData != 0) { uVar10 = *(uint *)(wispMatesData + -4); qVar7 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar10; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar7 < uVar10); free((uint *)(wispMatesData + -4)); } } local_14 = -NAN; if (wispQuery._0_1_ == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (wispQuery._data != (void *)0x0) { uVar10 = *(uint *)((int)wispQuery._data + -4); qVar7 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar10; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar7 < uVar10); free((uint *)((int)wispQuery._data + -4)); } local_14 = -NAN; } } this->_orbitLayer = -1; } } else { pVVar12 = &this->_pos; if (orbitLayerClamped == 0xed) { uVar10 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0xf,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar10,0); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -6.0; local_12c = (EntityPtr)0x3f800000; uVar22 = Color::Color(0x3f800000); Sprite::SetColor((Sprite *)((ulonglong)uVar22 >> 0x20),(ColorMod *)uVar22); uVar10 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0xc,pVVar12,&g_vectorZero,(Entity *)0x0,1,uVar10,0); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -6.0; uVar22 = Color::Color(0x3f800000); Sprite::SetColor((Sprite *)((ulonglong)uVar22 >> 0x20),(ColorMod *)uVar22); manager = g_manager; local_128 = 0x105; seed_fart_sound_override((int *)&local_128); SoundEffects::Play(&manager->_sfxManager,local_128,1.0,2,0,1.0,0.0); local_120 = CONCAT44(local_120._4_4_,this->_orbitLayer); if (-1 < this->_orbitLayer) { if (this->_isSubtype55555 == 0) { if ((this->_type == 3) && (((this->_variant == 0xce && (this->_subtype == 0x4d)) || ((this->_variant == 0xce && (this->_subtype == 0x12a)))))) { isUnicornWisp = '\x01'; } else { isUnicornWisp = '\0'; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&itemWispQuery,3,-1,-1,0,0); orbitLayerClamped = itemWispQuery._size; local_14 = 5.60519e-45; buffer_init(itemWispMates,itemWispQuery._size + 1); uVar10 = 0; local_14 = (float)CONCAT31(local_14._1_3_,5); local_120 = local_120 & 0xffffffff; pEVar18 = itemWispMatesCount; if (orbitLayerClamped != 0) { local_118 = itemWispMatesCount; pvVar16 = itemWispQuery._data; uVar13 = itemWispQuery._size; do { otherFamiliar = *(Entity_Familiar **)((int)pvVar16 + uVar10 * 4); if (otherFamiliar->_exists != 0) { if (otherFamiliar != this) { local_124 = (Entity_Familiar *) __RTDynamicCast(otherFamiliar,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar:: RTTI_Type_Descriptor,0); if ((float)local_124->_orbitLayer == (float)local_120) { tmpEntity = get_orbit_parent(local_124); orbitParent = get_orbit_parent(this); pEVar18 = local_124; if (tmpEntity == orbitParent) { if (((local_124->_type == 3) && (local_124->_variant == 0xce)) && ((local_124->_subtype == 0x4d || (local_124->_subtype == 0x12a)))) { isUnicornWisp = '\x01'; } local_124 = (Entity_Familiar *)&local_118->field_0x1; if (itemWispMatesCapacity < local_124) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } *(Entity_Familiar **)(itemWispMatesData + (int)local_118 * 4) = pEVar18; local_118 = local_124; itemWispMatesCount = local_124; pEVar18 = local_124; } else { pEVar18 = local_118; } } pvVar16 = itemWispQuery._data; uVar13 = itemWispQuery._size; } } uVar10 = (int)local_120._4_4_ + 1; local_120 = CONCAT44(uVar10,(float)local_120); } while (uVar10 < uVar13); } if (isUnicornWisp != '\0') { local_12c = (EntityPtr)0x40000000; } bVar9 = Entity_Player::HasCollectible(this->_player,0x117,0); if (bVar9 != 0) { local_12c = (EntityPtr)0x3eaaaaab; } orbitLayerClamped = (int)(float)local_120; if ((int)(float)local_120 < 1) { orbitLayerClamped = 0; } orbitLayerClamped = 10; if (orbitLayerClamped < 10) { orbitLayerClamped = orbitLayerClamped; } local_118 = (Entity_Familiar *)0x0; local_120 = CONCAT44(local_120._4_4_,orbitLayerClamped * 0x14); if (pEVar18 != (Entity_Familiar *)0x0) { local_124 = (Entity_Familiar *) (float)((double)(int)pEVar18 + __uint_to_double_fixup[-((int)pEVar18 >> 0x1f)]); do { local_134 = (Entity *) __RTDynamicCast(*(undefined4 *)(itemWispMatesData + (int)local_118 * 4), 0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar:: RTTI_Type_Descriptor,0); local_134[3]._sprite._championColor._offset[0] = ((float)(int)local_118 * 6.2831855) / (float)local_124; bVar9 = Entity_Player::HasCollectible(this->_player,0x70,0); if (bVar9 == 0) { fVar21 = *(float *)(&DAT_00c34138 + (int)(float)local_120); } else { fVar21 = *(float *)(&DAT_00c3413c + (int)(float)local_120) * *(float *)(&DAT_00c34138 + (int)(float)local_120); } *(float *)&local_134[3]._sprite._flipX = fVar21 * (float)local_12c; if (local_134->_variant == 0x3c) { *(float *)&local_134[3]._sprite._flipX = fVar21 * (float)local_12c * 3.0; } local_118 = (Entity_Familiar *)&local_118->field_0x1; } while (local_118 < pEVar18); } if (itemWispMates[0] == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (itemWispMatesData != 0) { uVar10 = *(uint *)(itemWispMatesData + -4); qVar7 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar10; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar7 < uVar10); free((uint *)(itemWispMatesData + -4)); } } local_14 = -NAN; if (itemWispQuery._0_1_ == '\0') { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (itemWispQuery._data != (void *)0x0) { uVar10 = *(uint *)((int)itemWispQuery._data + -4); qVar7 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar10; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar7 < uVar10); free((uint *)((int)itemWispQuery._data + -4)); } local_14 = -NAN; } } this->_orbitLayer = -1; } EntityPtr::Set(&this->_sirenHelper,(Entity *)0x0); } else if (orbitLayerClamped == 0xe5) { Entity_Player::AddBlueFlies(this->_player,1,pVVar12,(Entity *)this->_target); } else if (orbitLayerClamped == 0xea) { Color::Color(&particleColor2); uVar10 = Random(); Game::SpawnParticles (g_game,&this->_pos,0x23,8, (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0,color_00,-12.0,0); uVar10 = Random(); SoundEffects::PlayWithFartOverride (0xb5,0.5,2,0, (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.0); } else if (orbitLayerClamped == 0xc9) { if (this->_subtype != 0xc) { uVar10 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,2,pVVar12,&g_vectorZero,(Entity *)0x0,1,uVar10,0); piVar11 = (int *)__RTDynamicCast(tmpEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor ,0); piVar11[0xd3] = 0; piVar11[0xd4] = -0x3ee00000; (**(code **)(*piVar11 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); (**(code **)(*piVar11 + 0xc))(); } Entity::BloodExplode((Entity *)this); switch(this->_subtype) { case 2: case 0x14: Entity_Player::AddBlueFlies(this->_player,1,&this->_pos,(Entity *)0x0); break; case 3: uVar10 = Random(); local_120 = CONCAT44((uVar10 & 1) + 2,(float)local_120); do { uVar10 = RNG::Next(&this->_dropRNG); uVar13 = Random(); fVar21 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_124 = (Entity_Familiar *)(fVar21 + fVar21); local_198.x = cos((float)local_124); local_198.x = local_198.x * 5.0; fVar21 = sin((float)local_124); local_198.y = fVar21 * 5.0; Game::SpawnEx(g_game,5,0x14,&this->_pos,&local_198,(Entity *)this,0,uVar10,0); orbitLayerClamped = (int)local_120._4_4_ + -1; local_120 = CONCAT44(orbitLayerClamped,(float)local_120); } while (orbitLayerClamped != 0); break; case 4: uVar10 = Random(); orbitLayerClamped = (uVar10 & 3) + 2; local_120 = CONCAT44(orbitLayerClamped,(float)local_120); while (orbitLayerClamped != 0) { uVar10 = RNG::Next(&this->_dropRNG); uVar13 = Random(); fVar21 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_124 = (Entity_Familiar *)(fVar21 + fVar21); local_150.x = cos((float)local_124); local_150.x = local_150.x * 5.0; fVar21 = sin((float)local_124); local_150.y = fVar21 * 5.0; Game::SpawnEx(g_game,5,10,&this->_pos,&local_150,(Entity *)this,2,uVar10,0); orbitLayerClamped = (int)local_120._4_4_ + -1; local_120 = CONCAT44(orbitLayerClamped,(float)local_120); } break; case 0xd: uVar10 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x34,&this->_pos,&g_vectorZero,this->_player,0,uVar10) ; (**(code **)(*(int *)tmpEntity + 0x40))(0x41000000); orbitLayerClamped = *(int *)tmpEntity; pAVar6 = &tmpEntity[1]._sprite; (pAVar6->_filename)._buf[8] = ','; (pAVar6->_filename)._buf[9] = '\x01'; (pAVar6->_filename)._buf[10] = '\0'; (pAVar6->_filename)._buf[0xb] = '\0'; pAVar6 = &tmpEntity[1]._sprite; (pAVar6->_filename)._buf[0xc] = ','; (pAVar6->_filename)._buf[0xd] = '\x01'; (pAVar6->_filename)._buf[0xe] = '\0'; (pAVar6->_filename)._buf[0xf] = '\0'; (**(code **)(orbitLayerClamped + 0xc))(); break; case 0xe: uVar10 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x8d,&this->_pos,&g_vectorZero,this->_player,0,uVar10) ; orbitLayerClamped = *(int *)tmpEntity; pAVar6 = &tmpEntity[1]._sprite; (pAVar6->_filename)._buf[8] = '\x0e'; (pAVar6->_filename)._buf[9] = '\x01'; (pAVar6->_filename)._buf[10] = '\0'; (pAVar6->_filename)._buf[0xb] = '\0'; pAVar6 = &tmpEntity[1]._sprite; (pAVar6->_filename)._buf[0xc] = '\x0e'; (pAVar6->_filename)._buf[0xd] = '\x01'; (pAVar6->_filename)._buf[0xe] = '\0'; (pAVar6->_filename)._buf[0xf] = '\0'; (**(code **)(orbitLayerClamped + 0x40))(*(float *)((int)this->_player + 0x157c) * 0.5); (**(code **)(*(int *)tmpEntity + 0xc))(); } } else { uVar10 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,2,pVVar12,&g_vectorZero,(Entity *)0x0,1,uVar10,0); piVar11 = (int *)__RTDynamicCast(tmpEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0 ); piVar11[0xd3] = 0; piVar11[0xd4] = -0x3ee00000; (**(code **)(*piVar11 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); (**(code **)(*piVar11 + 0xc))(); Entity::BloodExplode((Entity *)this); if ((((this->_variant == 0xee) && (this->_player->_playerType == 0x1a)) && (bVar9 = Entity_Player::HasCollectible(this->_player,0x26b,0), bVar9 != 0)) && (this->_subtype == 0)) { uVar10 = RNG::Next(&this->_dropRNG); pVVar12 = MusicManager::RandomVector(&local_190); uVar13 = Random(); this = (Entity_Familiar *)local_12c; local_158.x = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)] ) * 2.3283064e-10 * 3.0 + 2.0; local_158.y = local_158.x * pVVar12->y; local_158.x = local_158.x * pVVar12->x; tmpEntity = Game::Spawn(g_game,5,10,(Vector *)((int)local_12c + 0x33c),&local_158, (Entity *)local_12c,2,uVar10); orbitLayerClamped = *(int *)tmpEntity; tmpEntity[1]._sprite._championColor._colorize[2] = 8.40779e-44; (**(code **)(orbitLayerClamped + 0xc))(); } } } } tmpEntity = EntityRef::EntityRef(&killSource); Entity::Kill((Entity *)this,tmpEntity); (**(code **)(*(int *)this + 0x28))(); orbitLayerClamped = *(int *)((int)this + 0x2c); if (orbitLayerClamped == 0xed) { if (*(void **)((int)this + 0x410) == (Entity_Player *)0x0) { ExceptionList = local_1c; return; } Entity_Player::RecomputeWispCollectibles(*(void **)((int)this + 0x410),(Entity_Familiar *)0x0); orbitLayerClamped = *(int *)((int)this + 0x2c); } if (((orbitLayerClamped == 0xee) && (player = *(void **)((int)this + 0x410), player != (Entity_Player *)0x0)) && (player->_playerType == 0x1a)) { Entity_Player::UpdateHeartDependentEffects(player); } ExceptionList = local_1c; return; } //@@ 006121d0 Entity_Familiar::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_Familiar::ClearReferences(Entity_Familiar *this) { uint *puVar1; std_vector *psVar2; int iVar3; void *pvVar4; int iVar5; void *pvVar6; uint size; int local_14 [3]; EntityPtr *local_8; iVar5 = this->_variant; if (iVar5 == 900) { iVar3 = (this->_pathfinder)._gridIndex; if (-1 < iVar3) { iVar5 = 900; if ((iVar3 < 0x1c0) && (*(int *)((int)g_game->_room + iVar3 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)g_game->_room + iVar3 * 4 + 0x76c) = 900; iVar5 = this->_variant; goto LAB_0061221c; } } LAB_00612223: if (iVar5 != 0xed) goto LAB_00612253; } else { LAB_0061221c: if (iVar5 != 0xce) goto LAB_00612223; } if (this->_subtype == 0x22d) { puVar1 = (uint *)((int)this->_player + 0x1574); *puVar1 = *puVar1 | 0x400; *(undefined1 *)((int)this->_player + 0x1518) = 1; iVar5 = this->_variant; } LAB_00612253: if ((iVar5 == 0xf0) && (this->_linkedEntity != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_linkedEntity + 0x28))(); } if (this->_linkedEntity != (EntityPtr)0x0) { local_8 = &this->_linkedEntity; std::multiset::erase(&local_8); } this->_linkedEntity = (EntityPtr)0x0; Entity::ClearReferences((Entity *)this); psVar2 = &this->_hitList; if ((std_vector *)local_14 != psVar2) { pvVar4 = psVar2->_begin; pvVar6 = (this->_hitList)._capacity; psVar2->_begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; if (pvVar4 != (void *)0x0) { size = (int)pvVar6 - (int)pvVar4 & 0xfffffffc; pvVar6 = pvVar4; if (0xfff < size) { pvVar6 = *(void **)((int)pvVar4 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,size); } } set_extra_data(0); if (this->_weapon != (int *)0x0) { (**(code **)(*(int *)this->_weapon + 0x14))(); if (this->_weapon != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_weapon)(1); } this->_weapon = (void *)0x0; } return; } //@@ 00612330 Entity_Familiar::get_orbit_parent /* DB: ? Init/Kill/RecalculateOrbitOffset; type 0x2b/0xce special prototype: db/protos.zhl */ Entity * __thiscall Entity_Familiar::get_orbit_parent(Entity_Familiar *this) { Entity *pEVar1; byte bVar2; EntityPtr EVar3; EntityList_EL local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6910; local_10 = ExceptionList; ExceptionList = &local_10; if (((this->_variant != 0x2b) && (this->_variant != 0xce)) || (EVar3 = this->_parent, EVar3 == (EntityPtr)0x0)) { bVar2 = Entity_Player::HasCollectible(this->_player,0x248,0); if (bVar2 != 0) { bVar2 = Entity_Player::HasCollectible(this->_player,0x2d8,0); if (bVar2 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_20,3,0xf0,-1,1,0); if (local_20._size != 0) { pEVar1 = *(Entity **)local_20._data; if (local_20._0_1_ == '\0') { local_8 = 0; tracked_alloc(1,local_20._data,0); } ExceptionList = local_10; return pEVar1; } if (local_20._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,local_20._data,0); } } } EVar3 = (EntityPtr)this->_player; } ExceptionList = local_10; return (Entity *)EVar3; } //@@ 00612440 Entity_Familiar::RecalculateOrbitOffset /* ZHL [lua] Lua binding EntityFamiliar:RecalculateOrbitOffset prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Entity_Familiar::RecalculateOrbitOffset(Entity_Familiar *this,int layer,byte isAdd) { double dVar1; byte isHasCollectible; uint uVar2; Entity_Familiar *familiar; Entity *otherParent; Entity *ownParent; int iVar3; qword *heapBytes; uint prevCount; uint orbiterCount; uint uVar4; float orbitDistance; EntityList_EL familiarQuery; char orbiterBuffer [4]; int local_30; uint orbiterCapacity; uint orbiterSize; uint local_24; void *familiarData; Entity_Familiar *local_1c; int orbiters; char isUnicornWisp; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword prevBytes; local_8 = 0xffffffff; puStack_c = &LAB_00af6945; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(orbiterBuffer + 0x30); if ((this->_isSubtype55555 != 0) || (layer < 0)) { return 0; } if (((this->_type == 3) && (this->_variant == 0xce)) && ((this->_subtype == 0x4d || (this->_subtype == 0x12a)))) { isUnicornWisp = '\x01'; } else { isUnicornWisp = '\0'; } ExceptionList = &local_10; local_1c = this; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiarQuery,3,-1,-1,0,0); iVar3 = familiarQuery._size; local_8 = 0; buffer_init(orbiterBuffer,familiarQuery._size + 1); local_8 = CONCAT31(local_8._1_3_,1); local_24 = 0; familiarData = familiarQuery._data; orbiters = local_30; orbiterCount = orbiterSize; if (iVar3 != 0) { uVar4 = familiarQuery._size; prevCount = orbiterSize; do { familiar = *(Entity_Familiar **)((int)familiarQuery._data + local_24 * 4); orbiterCount = prevCount; if (familiar->_exists != 0) { if (familiar != this) { familiar = (Entity_Familiar *) __RTDynamicCast(familiar,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0, uVar2); if (familiar->_orbitLayer == layer) { otherParent = get_orbit_parent(familiar); ownParent = get_orbit_parent(local_1c); if (otherParent == ownParent) { if (((familiar->_type == 3) && (familiar->_variant == 0xce)) && ((familiar->_subtype == 0x4d || (familiar->_subtype == 0x12a)))) { isUnicornWisp = '\x01'; } orbiterCount = prevCount + 1; if (orbiterCapacity < orbiterCount) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } *(Entity_Familiar **)(orbiters + prevCount * 4) = familiar; orbiterSize = orbiterCount; } } uVar4 = familiarQuery._size; familiarQuery._data = familiarData; this = local_1c; } } local_24 = local_24 + 1; prevCount = orbiterCount; } while (local_24 < uVar4); } local_1c = (Entity_Familiar *)0x3f800000; if (isUnicornWisp != '\0') { local_1c = (Entity_Familiar *)0x40000000; } isHasCollectible = Entity_Player::HasCollectible(this->_player,0x117,0); if (isHasCollectible != 0) { local_1c = (Entity_Familiar *)0x3eaaaaab; } if (isAdd != 0) { uVar2 = orbiterCount + 1; if (orbiterCapacity < uVar2) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } *(Entity_Familiar **)(orbiters + orbiterCount * 4) = this; orbiterCount = uVar2; orbiterSize = uVar2; } if (layer < 1) { layer = 0; } uVar2 = 10; if ((uint)layer < 10) { uVar2 = layer; } uVar4 = 0; iVar3 = uVar2 * 0x14; if (orbiterCount != 0) { dVar1 = __uint_to_double_fixup[-((int)orbiterCount >> 0x1f)]; do { local_24 = __RTDynamicCast(*(undefined4 *)(orbiters + uVar4 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); *(float *)(local_24 + 0xd60) = ((float)(int)uVar4 * 6.2831855) / (float)((double)(int)orbiterCount + dVar1); isHasCollectible = Entity_Player::HasCollectible(this->_player,0x70,0); if (isHasCollectible == 0) { orbitDistance = *(float *)(&DAT_00c34138 + iVar3); } else { orbitDistance = *(float *)(&DAT_00c3413c + iVar3) * *(float *)(&DAT_00c34138 + iVar3); } *(float *)(local_24 + 0xd6c) = orbitDistance * (float)local_1c; if (*(int *)(local_24 + 0x2c) == 0x3c) { *(float *)(local_24 + 0xd6c) = orbitDistance * (float)local_1c * 3.0; } uVar4 = uVar4 + 1; } while (uVar4 < orbiterCount); } if (orbiterBuffer[0] == '\0') { heapBytes = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapBytes = &g_allocatedBytesNoHeap; } if (orbiters != 0) { uVar2 = *(uint *)(orbiters + -4); prevBytes = *heapBytes; *(uint *)heapBytes = (uint)*heapBytes - uVar2; *(uint *)((int)heapBytes + 4) = *(uint *)((int)heapBytes + 4) - (uint)((uint)prevBytes < uVar2); free((void *)(orbiters + -4)); } } if (familiarQuery._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapBytes = &g_allocatedBytesNoHeap; } else { heapBytes = (qword *)((int)g_mainHeap + 0x30); } if (familiarData != (void *)0x0) { uVar2 = *(uint *)((int)familiarData + -4); prevBytes = *heapBytes; *(uint *)heapBytes = (uint)*heapBytes - uVar2; *(uint *)((int)heapBytes + 4) = *(uint *)((int)heapBytes + 4) - (uint)((uint)prevBytes < uVar2); free((void *)((int)familiarData + -4)); } } ExceptionList = local_10; return orbiterCount; } //@@ 006127b0 Entity_Familiar::AddToOrbit /* ZHL [lua] Lua binding EntityFamiliar:AddToOrbit prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Familiar::AddToOrbit(Entity_Familiar *this,int orbitLayer) { float fVar1; int iVar2; int iVar3; if (-1 < this->_orbitLayer) { RecalculateOrbitOffset(this,this->_orbitLayer,0); } this->_orbitLayer = orbitLayer; iVar3 = orbitLayer; if (orbitLayer < 1) { iVar3 = 0; } iVar2 = 10; if (iVar3 < 10) { iVar2 = iVar3; } fVar1 = (float)(&DAT_00c34134)[iVar2 * 5]; (this->_orbitDistance).x = (float)(&DAT_00c34130)[iVar2 * 5]; (this->_orbitDistance).y = fVar1; RecalculateOrbitOffset(this,orbitLayer,1); return; } //@@ 00612820 Entity_Familiar::RemoveFromOrbit /* ZHL [lua] Lua binding EntityFamiliar:RemoveFromOrbit */ void __thiscall Entity_Familiar::RemoveFromOrbit(Entity_Familiar *this) { if (-1 < this->_orbitLayer) { RecalculateOrbitOffset(this,this->_orbitLayer,0); this->_orbitLayer = -1; } return; } //@@ 00612850 Entity_Familiar::GetOrbitDistance /* ZHL [lua] Lua binding EntityFamiliar:GetOrbitDistance */ void Entity_Familiar::GetOrbitDistance(undefined4 *param_1,int param_2) { undefined4 uVar1; int iVar2; if (param_2 < 1) { param_2 = 0; } iVar2 = 10; if (param_2 < 10) { iVar2 = param_2; } uVar1 = (&DAT_00c34134)[iVar2 * 5]; *param_1 = (&DAT_00c34130)[iVar2 * 5]; param_1[1] = uVar1; return; } //@@ 00612890 Entity_Familiar::is_detached_from_follow /* DB: ? per-variant checks (0x3b,0x19,0x68,0x82...) used by FollowParent prototype: db/protos.zhl */ byte __thiscall Entity_Familiar::is_detached_from_follow(Entity_Familiar *this) { int iVar1; bool bVar2; if (this->_isFollower == 0) { return 0; } iVar1 = this->_variant; if (iVar1 == 3) { bVar2 = this->_fireCooldown == 0; } else if (iVar1 == 0x3b) { bVar2 = this->_fireCooldown == 0; } else if (iVar1 == 0x19) { bVar2 = this->_fireCooldown == 0; } else if (iVar1 == 0x5d) { bVar2 = this->_fireCooldown == 0; } else { if (iVar1 == 100) { if ((float)this->_subtype == this[1]._pendingDamage) { return 0; } return 1; } if (iVar1 == 0x68) { bVar2 = this->_fireCooldown == 0; } else { if ((iVar1 == 0x7c) || (iVar1 == 0x81)) { if (this->_visible == 0) { return 0; } return 1; } if (iVar1 == 0x82) { if (this->_fireCooldown < 0) { return 0; } return 1; } if (iVar1 == 0xe8) { bVar2 = this->_fireCooldown == 0; } else if (iVar1 == 0xdf) { bVar2 = this->_fireCooldown == 0; } else { if (iVar1 != 0xf2) { return 1; } if (this->_visible == 0) { return 0; } bVar2 = this->_coins == 0; } } } if (bVar2) { return 1; } return 0; } //@@ 00612970 Entity_Familiar::GetFollowerPriority /* ZHL [exact] __thiscall int Entity_Familiar::GetFollowerPriority(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Familiar::GetFollowerPriority(Entity_Familiar *this) { switch(this->_variant) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 9: case 10: case 0xb: case 0xc: case 0x19: case 0x3b: case 0x4c: case 0x51: case 0x5c: case 0x5d: case 0x61: case 0x68: case 0x77: case 0x7d: case 0xd1: case 0xdc: case 0xdf: return 1; default: return 0; case 0x33: case 0x4a: case 0x59: case 0xe6: return 2; case 0x3d: case 0x6c: return 3; case 0x50: case 0xeb: return 10; case 100: return 9; case 0x6d: return 9999; case 0xe8: return 5; } } //@@ 00612ad0 FUN_00612ad0 undefined4 FUN_00612ad0(void) { int iVar1; Entity_Familiar *in_ECX; int extraout_ECX; iVar1 = Entity_Familiar::GetFollowerPriority(in_ECX); if ((iVar1 < 1) || (*(char *)(extraout_ECX + 0xd76) != '\0')) { return 0; } return 1; } //@@ 00612af0 Entity_Familiar::IsLilithBirthrightIncubus /* DB: ? player Lilith (0x20) + Birthright (0x26b), subtype 0xf prototype: db/protos.zhl */ byte __thiscall Entity_Familiar::IsLilithBirthrightIncubus(Entity_Familiar *this) { Entity_Player *this_00; byte bVar1; void *pvVar2; this_00 = this->_player; pvVar2 = this_00->_weapons[0]; if (pvVar2 == (void *)0x0) { pvVar2 = this_00->_weapons[1]; } if (this_00->_playerType == 0x20) { bVar1 = Entity_Player::HasCollectible(this_00,0x26b,0); if ((((bVar1 != 0) && (pvVar2 != (void *)0x0)) && (*(int *)((int)pvVar2 + 0x30) == 0xf)) && ((this->_isFollower != 0 && (this->_isNotCountedAsFollower == 0)))) { return 1; } } return 0; } //@@ 00612b50 Entity_Familiar::get_incubus_umbilical_whip /* DB: Lilith birthright incubus, dyncast Weapon_UmbilicalWhip, returns entity type 3 prototype: db/protos.zhl */ Entity * __thiscall Entity_Familiar::get_incubus_umbilical_whip(Entity_Familiar *this) { byte bVar1; int iVar2; int *piVar3; Entity *pEVar4; bVar1 = IsLilithBirthrightIncubus(this); if (bVar1 != 0) { iVar2 = *(int *)((int)this->_player + 0x13dc); if (iVar2 == 0) { iVar2 = *(int *)((int)this->_player + 0x13e0); } piVar3 = (int *)__RTDynamicCast(iVar2,0,&IsaacRepentancePlus::Weapon::RTTI_Type_Descriptor, &IsaacRepentancePlus::Weapon_UmbilicalWhip::RTTI_Type_Descriptor ,0); if (((piVar3 != (int *)0x0) && (pEVar4 = (Entity *)(**(code **)(*piVar3 + 0x28))(), pEVar4 != (Entity *)0x0)) && (pEVar4->_type == 3)) { return pEVar4; } } return (Entity *)0x0; } //@@ 00612bb0 Entity_Familiar::FollowParent /* ZHL [lua] Lua binding EntityFamiliar:FollowParent prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity_Familiar::FollowParent(Entity_Familiar *this) { code *pcVar1; byte bVar2; char cVar3; uint uVar4; Entity *umbilicalWhip; Entity_Player *player; int iVar5; Vector *facingDir; Entity_Familiar *parentFamiliar; EntityPtr extraout_ECX; Entity_Familiar *parentFamiliar; Entity_Familiar *extraout_ECX_00; EntityPtr this_01; EntityPtr extraout_ECX_01; Entity_Familiar *this_02; Entity_Familiar *extraout_ECX_02; EntityPtr EVar6; Entity_Familiar *this_03; Entity_Familiar *extraout_ECX_03; Entity_Familiar *this_04; int extraout_ECX_04; char extraout_DL; char extraout_DL_00; int iVar7; int extraout_EDX; float extraout_EDX_00; float extraout_EDX_01; float extraout_EDX_02; float extraout_EDX_03; EntityPtr *childSlot; float fVar8; float fVar9; float fVar10; EntityPtr local_48; undefined1 query [12]; float local_38; EntityPtr local_34; float local_30; float local_2c; float local_28; char isOverrideParent; char isLilithBirthright; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; EntityPtr chainNext; void *playerRaw; puStack_20 = query + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00af697d; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(query + 0x34); if (this->_isSubtype55555 != 0) { (this->_pos).x = (this->_formationOffset).x; (this->_pos).y = (this->_formationOffset).y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; return; } ExceptionList = &local_1c; bVar2 = IsLilithBirthrightIncubus(this); if (bVar2 != 0) { umbilicalWhip = get_incubus_umbilical_whip(this); player = this->_player; local_34 = (EntityPtr)(player->_pos).x; local_38 = (player->_pos).y; if (umbilicalWhip != (Entity *)0x0) { local_30 = (float)this->_initSeed; iVar7 = 0; local_38 = 9.80909e-45; EVar6 = this->_child; if (EVar6 != (EntityPtr)0x0) { do { if (*(int *)((int)EVar6 + 0x28) == 3) { bVar2 = is_detached_from_follow((Entity_Familiar *)EVar6); EVar6 = extraout_ECX; iVar7 = extraout_EDX; if (bVar2 != 0) { iVar7 = extraout_EDX + 1; } } EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0); } while (EVar6 != (EntityPtr)0x0); player = this->_player; } local_2c = (float)iVar7 + 5.0; bVar2 = Entity_Player::HasCollectible(player,0xf7,0); if (bVar2 != 0) { local_2c = local_2c * 1.5; } if (local_30 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = (uint)local_30 >> 5 ^ (uint)local_30; uVar4 = uVar4 << 9 ^ uVar4; local_38 = (float)(uVar4 >> (SUB41(local_38,0) & 0x1f) ^ uVar4); local_34 = (EntityPtr)0xe; if (local_38 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = (uint)local_38 >> 3 ^ (uint)local_38; uVar4 = uVar4 << 1 ^ uVar4; uVar4 = uVar4 >> 0xe ^ uVar4; local_34 = (EntityPtr)(umbilicalWhip->_size * 0.3); local_38 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 3.14; local_30 = (float)local_34 + local_2c; local_38 = local_38 + local_38; local_2c = cos(local_38); local_2c = local_2c * local_30; fVar8 = sin(local_38); local_30 = fVar8 * local_30; iVar7 = this->_variant; if (((iVar7 == 0xd5) || (iVar7 == 0xd6)) || (iVar7 == 0xdf)) { local_2c = (float)local_34; local_30 = 0.0; } local_28 = (umbilicalWhip->_pos).x; local_48 = (EntityPtr)(umbilicalWhip->_pos).y; iVar7 = __RTDynamicCast(umbilicalWhip[3]._entityRef4._variant,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor ,&IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor,0); if (iVar7 == 0) { local_38 = 0.0; } else { local_38 = *(float *)(iVar7 + 0x154); } local_38 = local_38 * 0.017453292; local_34 = (EntityPtr)cos(local_38); fVar8 = sin(local_38); fVar9 = (float)local_34 * local_30; local_34 = (EntityPtr)(((float)local_34 * local_2c - fVar8 * local_30) + local_28); local_38 = fVar8 * local_2c + fVar9 + (float)local_48; if ((umbilicalWhip->_type == 3) && (this->_parent == (EntityPtr)0x0)) { childSlot = &umbilicalWhip->_child; if (umbilicalWhip->_child != (EntityPtr)0x0) { local_48 = (EntityPtr)childSlot; std::multiset::erase(&local_48); } *childSlot = (EntityPtr)this; std::multiset::insert(childSlot); } } fVar8 = (this->_pos).y; (this->_velocity).x = (float)local_34 - (this->_pos).x; (this->_velocity).y = local_38 - fVar8; ExceptionList = local_1c; return; } player = this->_player; if (((player != (Entity_Player *)0x0) && (local_48 = player->_spawnerEntity, local_48 != (EntityPtr)0x0)) && ((*(int *)((int)local_48 + 0x28) == 0x388 && ((*(int *)((int)local_48 + 0x2c) == 0 && (bVar2 = Entity::HasEntityFlags((Entity *)player,0x400000), bVar2 != 0)))))) { NpcHelper::siren_familiar_orbit(this); goto LAB_006138df; } bVar2 = Entity_Player::HasTrinket(player,0xb3,0); if (bVar2 != 0) { predict_player_movement(this); ExceptionList = local_1c; return; } bVar2 = Entity_Player::HasTrinket(this->_player,0x6d,0); if (bVar2 != 0) { move_to_parent_offset(this); ExceptionList = local_1c; return; } if (((this->_formationOffset).x != g_vectorZero.x) || ((this->_formationOffset).y != g_vectorZero.y)) { reset_follow_target(this,uVar4); } EVar6 = this->_parent; isOverrideParent = '\0'; if ((g_game->_challenge == 0x1e) && (this->_variant == 0x3e)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)query,3,0x43,-1,0,0); if (local_38 != 0.0) { isOverrideParent = '\x01'; EVar6 = *(EntityPtr *)query._4_4_; } EntityList_Query::~EntityList_Query(query); } local_48 = EVar6; if ((this->_player->_playerType == 0xd) && (bVar2 = Entity_Player::HasCollectible(this->_player,0x26b,0), bVar2 != 0)) { isLilithBirthright = '\x01'; cVar3 = FUN_00612ad0(); if (cVar3 != '\0') { EVar6 = this->_parent; fVar8 = 0.0; local_34 = (EntityPtr)this->_player; iVar7 = 0; local_30 = 0.0; for (; EVar6 != (EntityPtr)0x0; EVar6 = ((Entity_Familiar *)EVar6)->_parent) { if (*(int *)((int)EVar6 + 0x28) == 3) { if (*(int *)((int)EVar6 + 0x2c) == 0x6d) { local_34 = EVar6; break; } bVar2 = is_detached_from_follow((Entity_Familiar *)EVar6); EVar6 = (EntityPtr)parentFamiliar; fVar8 = extraout_EDX_00; if (bVar2 != 0) { iVar5 = GetFollowerPriority(parentFamiliar); EVar6 = (EntityPtr)extraout_ECX_00; fVar8 = extraout_EDX_01; if ((0 < iVar5) && (extraout_ECX_00->_isNotCountedAsFollower == SUB41(extraout_EDX_01,0))) { iVar7 = iVar7 + 1; } } } } EVar6 = this->_child; if (EVar6 != (EntityPtr)0x0) { do { if (*(int *)((int)EVar6 + 0x28) == 3) { bVar2 = is_detached_from_follow((Entity_Familiar *)EVar6); EVar6 = this_01; fVar8 = extraout_EDX_02; if (bVar2 != 0) { iVar5 = GetFollowerPriority((Entity_Familiar *)this_01); EVar6 = extraout_ECX_01; fVar8 = extraout_EDX_03; if ((0 < iVar5) && (*(char *)((int)extraout_ECX_01 + 0xd76) == '\0')) { fVar8 = (float)((int)extraout_EDX_03 + 1); } } } EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0); } while (EVar6 != (EntityPtr)0x0); local_30 = fVar8; } playerRaw = this->_player; local_48 = (EntityPtr)(iVar7 + (int)fVar8); iVar7 = (int)local_48 + 1; local_28 = *(float *)((int)playerRaw + 0x1630); local_2c = *(float *)((int)playerRaw + 0x1634); if ((local_28 == g_vectorZero.x) && (local_2c == g_vectorZero.y)) { facingDir = Isaac::GetAxisAlignedUnitVectorFromDir ((Vector *)(query + 8),*(int *)((int)playerRaw + 0x1628)); local_28 = facingDir->x; local_2c = facingDir->y; fVar8 = local_30; } if (1 < iVar7) { fVar10 = (float)iVar7 * 5.0 + 15.0; fVar9 = 179.0; if (fVar10 <= 179.0) { fVar9 = fVar10; } if (((uint)local_30 & 1) != 0) { fVar9 = -fVar9; } local_30 = ((fVar9 * (float)(int)((iVar7 - ((int)fVar8 - ((int)fVar8 >> 0x1f) & 0xfffffffeU) ) + -1)) / (float)(int)local_48) * 0.017453292; local_48 = (EntityPtr)cos(local_30); fVar8 = sin(local_30); fVar9 = fVar8 * local_28; local_28 = (float)local_48 * local_28 - fVar8 * local_2c; local_2c = (float)local_48 * local_2c + fVar9; } local_48 = *(EntityPtr *)((int)local_34 + 0x33c); local_38 = *(float *)((int)local_34 + 0x340); fVar8 = sqrtf(local_28 * local_28 + local_2c * local_2c); if (0.0 < fVar8) { fVar8 = (*(float *)((int)this->_player + 0x370) + 20.0) / fVar8; local_2c = fVar8 * local_2c; local_28 = fVar8 * local_28; } fVar8 = (this->_pos).y; (this->_velocity).x = (((float)local_48 + local_28) - (this->_pos).x) * 0.4; (this->_velocity).y = ((local_38 + local_2c) - fVar8) * 0.4; goto LAB_006138df; } } else { isLilithBirthright = '\0'; } bVar2 = Entity_Player::HasTrinket(this->_player,0x94,0); if ((bVar2 != 0) && (this->_variant != 0x6d)) { local_34 = (EntityPtr)this->_player; iVar7 = 0; EVar6 = this->_parent; local_30 = 0.0; for (; EVar6 != (EntityPtr)0x0; EVar6 = ((Entity_Familiar *)EVar6)->_parent) { if (*(int *)((int)EVar6 + 0x28) == 3) { if (*(int *)((int)EVar6 + 0x2c) == 0x6d) { local_34 = EVar6; break; } bVar2 = is_detached_from_follow((Entity_Familiar *)EVar6); EVar6 = (EntityPtr)this_02; if (bVar2 != 0) { if (extraout_DL != '\0') { iVar5 = GetFollowerPriority(this_02); EVar6 = (EntityPtr)extraout_ECX_02; if ((0 < iVar5) && (extraout_ECX_02->_isNotCountedAsFollower == 0)) goto LAB_00613385; } local_30 = (float)((int)local_30 + 1); } } LAB_00613385: } EVar6 = this->_child; do { if (EVar6 == (EntityPtr)0x0) { local_48 = (EntityPtr)((int)local_30 + 1 + iVar7); this->_orbitSpeed = 3.5; iVar5 = Entity_Player::GetTrinketMultiplier(this->_player,0x94); fVar8 = this->_orbitSpeed; if (2 < iVar5) { fVar8 = fVar8 * 1.5; this->_orbitSpeed = fVar8; } iVar5 = g_game->_frameCount; (this->_orbitDistance).x = 65.0; (this->_orbitDistance).y = 60.0; local_30 = (((float)iVar7 * 360.0) / (float)(int)local_48 + (float)iVar5 * fVar8) - this->_orbitAngleOffset; bVar2 = Entity_Player::HasTrinket(this->_player,0x59,0); if (bVar2 != 0) { (this->_orbitDistance).x = (this->_orbitDistance).x * 0.5; (this->_orbitDistance).y = (this->_orbitDistance).y * 0.5; } local_30 = local_30 * 0.017453292; fVar8 = cos(local_30); EVar6 = local_34; local_34 = (EntityPtr) ((fVar8 * (this->_orbitDistance).x + *(float *)((int)local_34 + 0x33c)) - (this->_pos).x); fVar8 = sin(local_30); local_48 = (EntityPtr) ((fVar8 * (this->_orbitDistance).y + *(float *)((int)EVar6 + 0x340)) - (this->_pos).y); fVar8 = sqrtf((float)local_48 * (float)local_48 + (float)local_34 * (float)local_34); if (fVar8 <= 20.0) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; } else { fVar8 = ((fVar8 - 20.0) * 0.1) / fVar8; fVar9 = fVar8 * (float)local_48; fVar8 = fVar8 * (float)local_34; if ((this->_flags & 0x20000000000) != 0) { fVar8 = fVar8 * 5.0; fVar9 = fVar9 * 5.0; } (this->_velocity).x = fVar8; (this->_velocity).y = fVar9; } if (*(int *)((int)EVar6 + 0x28) == 1) { fVar8 = 1.5; } else { fVar8 = 1.0; } fVar9 = *(float *)((int)EVar6 + 0x360); (this->_velocity).y = fVar8 * *(float *)((int)EVar6 + 0x364) + (this->_velocity).y; (this->_velocity).x = fVar8 * fVar9 + (this->_velocity).x; ExceptionList = local_1c; return; } if (*(int *)((int)EVar6 + 0x28) == 3) { bVar2 = is_detached_from_follow((Entity_Familiar *)EVar6); EVar6 = (EntityPtr)this_03; if (bVar2 != 0) { if (extraout_DL_00 != '\0') { iVar5 = GetFollowerPriority(this_03); EVar6 = (EntityPtr)extraout_ECX_03; if ((0 < iVar5) && (extraout_ECX_03->_isNotCountedAsFollower == 0)) goto LAB_006133c6; } iVar7 = iVar7 + 1; } } LAB_006133c6: EVar6 = ((Entity_Familiar *)EVar6)->_child; } while( true ); } (this->_orbitDistance).x = g_vectorZero.x; (this->_orbitDistance).y = g_vectorZero.y; if (isOverrideParent == '\0') { for (; EVar6 != (EntityPtr)0x0; EVar6 = *(EntityPtr *)((int)EVar6 + 0x3bc)) { parentFamiliar = (Entity_Familiar *) __RTDynamicCast(EVar6,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (parentFamiliar == (Entity_Familiar *)0x0) goto LAB_0061378a; bVar2 = is_detached_from_follow(parentFamiliar); if ((bVar2 != 0) || (((isLilithBirthright != '\0' && (iVar7 = GetFollowerPriority(this_04), 0 < iVar7)) && (*(char *)(extraout_ECX_04 + 0xd76) == '\0')))) goto LAB_0061378a; } LAB_00613692: if (this->_variant != 0x6d) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)query,3,0x6d,-1,1,0); local_14 = 0; local_30 = 0.0; if (local_38 != 0.0) { LAB_006136d5: iVar7 = __RTDynamicCast(*(EntityPtr *)(query._4_4_ + local_30 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (((*(char *)(iVar7 + 0x172) == '\0') || (*(void **)(iVar7 + 0x410) != this->_player)) || (*(EntityPtr *)(iVar7 + 0x3bc) != this->_parent)) goto LAB_00613716; EVar6 = *(EntityPtr *)(query._4_4_ + local_30 * 4); for (chainNext = *(EntityPtr *)((int)*(EntityPtr *)(query._4_4_ + local_30 * 4) + 0x3c0); ((chainNext != (EntityPtr)0x0 && (*(int *)((int)chainNext + 0x28) == 3)) && (*(int *)((int)chainNext + 0x2c) == 0x6d)); chainNext = *(EntityPtr *)((int)chainNext + 0x3c0)) { EVar6 = chainNext; } } LAB_0061375a: local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(query); if (EVar6 != (EntityPtr)0x0) goto LAB_0061378a; } local_30 = *(float *)((int)this->_player + 0x33c); local_28 = *(float *)((int)this->_player + 0x340); } else { EVar6 = local_48; if (local_48 == (EntityPtr)0x0) goto LAB_00613692; LAB_0061378a: local_30 = *(float *)((int)EVar6 + 0x33c); local_28 = *(float *)((int)EVar6 + 0x340); } local_2c = 20.0; if (this->_variant == 100) { local_2c = 10.0; } bVar2 = Entity_Player::HasTrinket(this->_player,0x59,0); if (bVar2 != 0) { local_2c = 5.0; } local_38 = (this->_pos).y - local_28; local_34 = (EntityPtr)((this->_pos).x - local_30); fVar8 = sqrtf(local_38 * local_38 + (float)local_34 * (float)local_34); if (fVar8 <= 0.0) { local_48 = local_34; } else { local_38 = (local_2c / fVar8) * local_38; local_48 = (EntityPtr)((local_2c / fVar8) * (float)local_34); } fVar9 = local_30 - (this->_pos).x; local_48 = (EntityPtr)(local_30 + (float)local_48); fVar8 = local_28 - (this->_pos).y; local_38 = local_28 + local_38; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); if (local_2c < fVar8) { fVar9 = (this->_pos).y; fVar8 = ((fVar8 - local_2c) / fVar8) * 0.2; (this->_velocity).x = ((float)local_48 - (this->_pos).x) * fVar8; (this->_velocity).y = (local_38 - fVar9) * fVar8; } LAB_006138df: this->_friction = this->_friction * 0.8; ExceptionList = local_1c; return; LAB_00613716: local_30 = (float)((int)local_30 + 1); if ((uint)local_38 <= (uint)local_30) goto LAB_0061375a; goto LAB_006136d5; } //@@ 00613910 Entity_Familiar::FollowPosition /* ZHL [lua] Lua binding EntityFamiliar:FollowPosition */ void __thiscall Entity_Familiar::FollowPosition(Entity_Familiar *this,float *param_2) { float fVar1; float fVar2; float fVar3; float fVar4; if (this->_isSubtype55555 == 0) { fVar1 = *param_2; fVar2 = param_2[1]; fVar3 = (this->_pos).x; fVar4 = (this->_pos).y; this->_friction = this->_friction * 0.8; (this->_velocity).x = (fVar1 - fVar3) * 0.1; (this->_velocity).y = (fVar2 - fVar4) * 0.1; return; } (this->_pos).x = (this->_formationOffset).x; (this->_pos).y = (this->_formationOffset).y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; return; } //@@ 006139b0 Entity_Familiar::GetOrbitPosition /* ZHL [lua] Lua binding EntityFamiliar:GetOrbitPosition prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Entity_Familiar::GetOrbitPosition(Entity_Familiar *this,Vector *outPosition,Vector *offset) { float fVar1; byte bVar2; Vector *pVVar3; uint uVar4; LayerState *pLVar5; int iVar6; int iVar7; float fVar8; float fVar9; Vector local_10; if (this->_isSubtype55555 != 0) { fVar8 = (this->_formationOffset).y; outPosition->x = (this->_formationOffset).x; outPosition->y = fVar8; return outPosition; } bVar2 = Entity_Player::HasTrinket(this->_player,0x6d,0); if ((bVar2 != 0) && (this->_variant != 0x2b)) { pVVar3 = UpdateFollowPosition(this,&local_10); outPosition->x = pVVar3->x + offset->x; outPosition->y = pVVar3->y + offset->y; return outPosition; } if (((this->_formationOffset).x != g_vectorZero.x) || ((this->_formationOffset).y != g_vectorZero.y)) { reset_follow_target(this); } uVar4 = g_manager->_framecount & 0x80000001; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffe) + 1; } fVar8 = fmodf(this->_orbitAngleOffset - ((float)(int)uVar4 * 0.5 + (float)g_game->_frameCount) * this->_orbitSpeed * 3.1415927 * 0.5,6.2831855); iVar7 = this->_variant; if (iVar7 == 0x23) { bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"Rotation",1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,6.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } local_10.x = (fVar8 * 180.0) / 3.1415927; pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar5->_rotation = local_10.x; iVar7 = this->_variant; } if (iVar7 == 0x7e) { pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar5->_rotation = (fVar8 * 180.0) / 3.1415927; } iVar7 = this->_orbitLayer; if (iVar7 < 0) { fVar8 = offset->y; outPosition->x = offset->x; outPosition->y = fVar8; return outPosition; } if (iVar7 < 1) { iVar7 = 0; } iVar6 = 10; if (iVar7 < 10) { iVar6 = iVar7; } fVar1 = (float)(&DAT_00c34140)[iVar6 * 5]; fVar9 = cos(fVar8 + fVar1); outPosition->x = fVar9 * (this->_orbitDistance).x + offset->x; fVar8 = sin(fVar8 + fVar1); outPosition->y = fVar8 * (this->_orbitDistance).y + offset->y; return outPosition; } //@@ 00613c20 Entity_Familiar::fire_robo_baby_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=familiar: Entity_Laser::ShootAngle(2 = thin tech laser) from familiar position, apply_tear_modifiers; offset differs when variant (ECX+0x2c) == 206 (wisp); callers Entity_Familiar::Shoot for variant 6 (Robo-Baby), FamiliarAI::variant_53 (Robo-Baby 2.0 like) and fire_wisp_projectile */ Entity_Tear * __thiscall Entity_Familiar::fire_robo_baby_laser(Entity_Familiar *this,float *param_2) { byte bVar1; Entity_Tear *tear; float fVar2; float fVar3; int timeout; Vector *posOffset; Entity_Familiar *source; Vector local_40; Color local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (*(char *)((int)this->_player + 0x173) != '\0') { return (Entity_Tear *)0x0; } fVar2 = *param_2; local_40.y = -23.0; local_40.x = (fVar2 + fVar2) - param_2[1] * 9.0; fVar3 = -8.0 - (fVar2 + fVar2); if (this->_variant == 0xce) { local_40.y = -18.0; local_40.x = g_vectorZero.x; fVar3 = g_vectorZero.y; } local_40.y = local_40.y + fVar3; bVar1 = 0; local_40.x = local_40.x + 0.0; posOffset = &local_40; timeout = 3; source = this; fVar2 = atan2f(param_2[1],fVar2); tear = (Entity_Tear *) Entity_Laser::ShootAngle (2,&this->_pos,fVar2 * 57.295776,timeout,posOffset,(Entity *)source,bVar1); *(undefined1 *)((int)&(tear->_tearHaloANM2)._overlayAnimState._currentlyTriggeredEvents + 1) = 1; *(undefined1 *)&(tear->_tearHaloANM2)._animState._layerFrames = 1; fVar2 = apply_tear_modifiers(this); (**(code **)(*(int *)tear + 0x40))(fVar2 * 3.5); if ((param_2[1] <= -0.5 && param_2[1] != -0.5) || (*param_2 <= -0.5 && *param_2 != -0.5)) { fVar2 = -10.0; } else { fVar2 = 3000.0; } tear->_renderDepthOffset = fVar2; Color::Color(&local_38); if (this->_isLilDelirium != 0) { local_38._tint[0] = 0.2; local_38._tint[1] = 1.0; local_38._tint[2] = 0.0; local_38._tint[3] = 1.0; local_38._offset[2] = 0.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; local_38._offset[0] = 1.0; local_38._offset[1] = 1.0; } if (this->_player != (Entity_Player *)0x0) { bVar1 = Entity_Player::IsHologram(this->_player); if (bVar1 != 0) { local_38._tint[3] = 0.25; } } (**(code **)(*(int *)tear + 0x3c))(&local_38,0xffffffff,0xff,0,1); (**(code **)(*(int *)tear + 0xc))(); apply_baby_bender(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); return tear; } //@@ 00613df0 Entity_Familiar::PlayFloatAnim /* ZHL [lua] Lua binding EntityFamiliar:PlayFloatAnim prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Familiar::PlayFloatAnim(Entity_Familiar *this,int direction) { char cVar1; uint uVar2; LayerState *layer; int *texture; byte *anim; char *anim_00; undefined1 textureRef [4]; int *textureImage; void *local_10; undefined1 *puStack_c; undefined4 local_8; int variant; local_8 = 0xffffffff; puStack_c = &LAB_00af69ad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(textureRef + 0x18); variant = this->_variant; if (variant == 0x58) { return; } if (variant == 0xce) { ExceptionList = &local_10; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); texture = LayerState::GetTexture(layer,textureRef); local_8 = 0; anim = s_Idle2; if (*(uint *)(*texture + 0x10) < 0x81) { anim = s_Idle; } ANM2::SetAnimation(&this->_sprite,anim,0); local_8 = 1; if (textureImage == (int *)0x0) { ExceptionList = local_10; return; } cVar1 = (**(code **)(*textureImage + 0xc))(uVar2); if (cVar1 == '\0') { ExceptionList = local_10; return; } if (g_imageReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } (*g_imageReleaseFn)(textureRef); ExceptionList = local_10; return; } if (variant == 0xed) { ExceptionList = &local_10; ANM2::SetAnimation(&this->_sprite,s_Idle,0); ExceptionList = local_10; return; } if (variant == 0xee) { return; } ExceptionList = &local_10; (this->_sprite)._flipX = 0; if (variant == 0x4c) { anim_00 = "Float"; } else if ((variant == 6) || (variant == 0x35)) { switch(direction) { case 0: anim_00 = "FloatSide2"; break; case 1: switchD_00613f56_caseD_1: anim_00 = "FloatUp"; break; case 2: goto switchD_00613f56_caseD_2; case 3: switchD_00613f56_caseD_3: anim_00 = "FloatDown"; break; default: goto switchD_00613f25_default; } } else if ((variant == 0x6d) && (*(int *)((int)this->_player + 0x162c) != -1)) { switch(direction) { case 0: (this->_sprite)._flipX = 1; case 2: anim_00 = "StoppedSide"; break; case 1: anim_00 = "StoppedUp"; break; case 3: anim_00 = "StoppedDown"; break; default: goto switchD_00613f25_default; } } else { switch(direction) { case 0: (this->_sprite)._flipX = 1; break; case 1: goto switchD_00613f56_caseD_1; case 2: break; case 3: goto switchD_00613f56_caseD_3; default: goto switchD_00613f25_default; } switchD_00613f56_caseD_2: anim_00 = "FloatSide"; } ANM2::Play(&this->_sprite,(byte *)anim_00,0); switchD_00613f25_default: ExceptionList = local_10; return; } //@@ 00613fe0 Entity_Familiar::AddToDelayed /* ZHL [lua] Lua binding EntityFamiliar:AddToDelayed prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Familiar::AddToDelayed(Entity_Familiar *this) { EntityPtr EVar1; qword qVar2; Game *pGVar3; uint uVar4; int iVar5; Entity_Familiar *pEVar6; void *pvVar7; qword *pqVar8; uint uVar9; EntityPtr *pEVar10; bool bVar11; EntityList_EL local_24; EntityPtr *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af69dd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; if (this->_isSubtype55555 != 0) { return; } ExceptionList = &local_10; if ((this->_isDelayed != 0) && (EVar1 = this->_parent, EVar1 != (EntityPtr)0x0)) { if (*(int *)((int)EVar1 + 0x28) == 3) { iVar5 = __RTDynamicCast(EVar1,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0,uVar4); if ((iVar5 == 0) || (*(char *)(iVar5 + 0xd75) == '\0')) goto LAB_00614095; bVar11 = this->_player == *(void **)(iVar5 + 0x410); } else { if (*(int *)((int)EVar1 + 0x28) != 1) goto LAB_00614095; bVar11 = EVar1 == (EntityPtr)this->_player; } if (bVar11) { KAGE_LogMessage(1,(byte *)"[warn] Tried to add familiar %d to delayed again!\n"); ExceptionList = local_10; return; } } LAB_00614095: pGVar3 = g_game; this->_isDelayed = 1; EntityList::QuerySublist((EntityList *)((int)pGVar3->_room + 0x1218),&local_24,3,-1,-1,0,0); uVar9 = 0; local_8 = 0; if (local_24._size != 0) { pvVar7 = local_24._data; do { EVar1 = *(EntityPtr *)((int)pvVar7 + uVar9 * 4); if (((*(int *)((int)EVar1 + 0x28) == 3) && (*(char *)((int)EVar1 + 0x172) != '\0')) && (*(int *)((int)EVar1 + 0x3c0) == 0)) { pEVar6 = (Entity_Familiar *) __RTDynamicCast(EVar1,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0,uVar4 ); if (((pEVar6 != (Entity_Familiar *)0x0) && (pEVar6->_isDelayed != 0)) && ((this->_player == pEVar6->_player && (pEVar6 != this)))) { pEVar10 = (EntityPtr *)((int)EVar1 + 0x3c0); if (*(int *)((int)EVar1 + 0x3c0) != 0) { local_14 = pEVar10; std::multiset::erase(&local_14); } *pEVar10 = (EntityPtr)this; std::multiset::insert(pEVar10); pEVar10 = &this->_parent; if (this->_parent != (EntityPtr)0x0) { local_14 = pEVar10; std::multiset::erase(&local_14); } *pEVar10 = EVar1; std::multiset::insert(pEVar10); break; } pvVar7 = local_24._data; } uVar9 = uVar9 + 1; } while (uVar9 < (uint)local_24._size); } if (local_24._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } if (local_24._data != (void *)0x0) { uVar4 = *(uint *)((int)local_24._data + -4); qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar4; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar2 < uVar4); free((uint *)((int)local_24._data + -4)); } } ExceptionList = local_10; return; } //@@ 006141e0 Entity_Familiar::RemoveFromDelayed /* ZHL [lua] Lua binding EntityFamiliar:RemoveFromDelayed */ void __thiscall Entity_Familiar::RemoveFromDelayed(Entity_Familiar *this) { EntityPtr *pEVar1; EntityPtr *pEVar2; EntityPtr EVar3; EntityPtr EVar4; EntityPtr local_10; EntityPtr local_c; EntityPtr local_8; if (this->_isDelayed != 0) { EVar3 = this->_parent; pEVar1 = &this->_parent; if (EVar3 != (EntityPtr)0x0) { EVar4 = (EntityPtr)((int)EVar3 + 0x3c0); local_c = this->_child; if (*(int *)((int)EVar3 + 0x3c0) != 0) { local_8 = EVar4; std::multiset::erase(&local_8); } *(EntityPtr *)EVar4 = local_c; if (local_c != (EntityPtr)0x0) { std::multiset::insert(EVar4); } } EVar3 = this->_child; pEVar2 = &this->_child; if (EVar3 != (EntityPtr)0x0) { local_8 = (EntityPtr)((int)EVar3 + 0x3bc); local_10 = *pEVar1; if (*(int *)((int)EVar3 + 0x3bc) != 0) { local_c = local_8; std::multiset::erase(&local_c); } *(EntityPtr *)local_8 = local_10; if (local_10 != (EntityPtr)0x0) { std::multiset::insert(local_8); } } if (*pEVar1 != (EntityPtr)0x0) { local_10 = (EntityPtr)pEVar1; std::multiset::erase(&local_10); } *pEVar1 = (EntityPtr)0x0; if (*pEVar2 != (EntityPtr)0x0) { local_10 = (EntityPtr)pEVar2; std::multiset::erase(&local_10); } *pEVar2 = (EntityPtr)0x0; } this->_isDelayed = 0; return; } //@@ 006142e0 Entity_Familiar::PlayChargeAnim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityFamiliar:PlayChargeAnim */ int * __thiscall Entity_Familiar::PlayChargeAnim(Entity_Familiar *this,undefined4 param_2) { byte bVar1; int *piVar2; byte *****animNameBuf; uint size; int chargeFrame; float chargeFrameFloat; char *anim; undefined1 auStack_44 [4]; int *fireCooldown; uint chargeNamePos; byte *****local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; uint local_28; uint uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; int frameMod5; int local_10; uint local_c; void *animData; byte *****animNameBuf; Game *game; local_c = __security_cookie ^ (uint)auStack_44; fireCooldown = &this->_fireCooldown; (this->_sprite)._flipX = 0; animData = (this->_sprite)._animState._animData; chargeFrameFloat = 1.0 - (float)*fireCooldown / 30.0; if (animData == (void *)0x0) { chargeFrameFloat = chargeFrameFloat * 0.0; local_38 = (byte *****)0x0; uStack_24 = 0xf; local_28 = 0; } else { chargeFrameFloat = chargeFrameFloat * (float)*(int *)((int)animData + 0x30); std::string::string((char *)&local_38,animData); } animNameBuf = local_38; chargeFrame = (int)chargeFrameFloat; animNameBuf = (byte *****)&local_38; if (0xf < uStack_24) { animNameBuf = local_38; } chargeNamePos = std::string::find((byte *)animNameBuf,local_28,0,(byte *)"Charge",6); if (0xf < uStack_24) { size = uStack_24 + 1; animNameBuf = animNameBuf; if (0xfff < size) { animNameBuf = (byte *****)animNameBuf[-1]; size = uStack_24 + 0x24; if ((byte *)0x1f < (byte *)((int)animNameBuf + (-4 - (int)animNameBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(animNameBuf,size); } local_28 = 0; uStack_24 = 0xf; if (chargeNamePos == 0xffffffff) { chargeFrame = 0; } local_38 = (byte *****)((uint)local_38 & 0xffffff00); switch(param_2) { case 0: (this->_sprite)._flipX = 1; case 2: anim = "FloatChargeSide"; break; case 1: anim = "FloatChargeUp"; break; case 3: anim = "FloatChargeDown"; break; default: goto switchD_006143f4_default; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)chargeFrame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } switchD_006143f4_default: game = g_game; animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { piVar2 = (int *)0x0; } else { piVar2 = *(int **)((int)animData + 0x30); } if ((((int)piVar2 <= chargeFrame) && (piVar2 = fireCooldown, *fireCooldown < 0)) && (piVar2 = (int *)((uint)this->_flags & 0x4000), piVar2 == (int *)0x0)) { bVar1 = Game::IsPaused(g_game); piVar2 = (int *)(uint)bVar1; if (bVar1 == 0) { piVar2 = (int *)(game->_frameCount / 5); frameMod5 = game->_frameCount % 5; if (frameMod5 == 0) { local_18 = 0x3e48c8ca; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; local_38 = (byte *****)0x3f800000; uStack_34 = 0x3f000000; uStack_30 = 0x3f000000; uStack_2c = 0x3f800000; local_10 = frameMod5; piVar2 = (int *)(**(code **)(*(int *)this + 0x3c))(&local_38,2,0,1,1); } } } return piVar2; } //@@ 00614500 Entity_Familiar::PlayShootAnim /* ZHL [lua] Lua binding EntityFamiliar:PlayShootAnim prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Familiar::PlayShootAnim(Entity_Familiar *this,int direction) { char cVar1; byte isAnimSet; uint uVar2; LayerState *layer; int *texture; char *animName; undefined1 textureRef [4]; int *textureImage; void *local_10; undefined1 *puStack_c; undefined4 local_8; int variant; local_8 = 0xffffffff; puStack_c = &LAB_00af69ad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(textureRef + 0x18); variant = this->_variant; if (variant == 0xce) { ExceptionList = &local_10; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); texture = LayerState::GetTexture(layer,textureRef); local_8 = 0; animName = "Shoot2"; if (*(uint *)(*texture + 0x10) < 0x81) { animName = "Shoot"; } ANM2::SetAnimation(&this->_sprite,(byte *)animName,0); local_8 = 1; if (textureImage == (int *)0x0) { ExceptionList = local_10; return; } cVar1 = (**(code **)(*textureImage + 0xc))(uVar2); if (cVar1 == '\0') { ExceptionList = local_10; return; } if (g_imageReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } (*g_imageReleaseFn)(textureRef); ExceptionList = local_10; return; } if (variant == 0xed) { ExceptionList = &local_10; ANM2::SetAnimation(&this->_sprite,(byte *)"Shoot",0); ExceptionList = local_10; return; } if (variant == 0xee) { return; } ExceptionList = &local_10; (this->_sprite)._flipX = 0; if (variant == 0x4c) { animName = "Shoot"; } else if ((variant == 6) || (variant == 0x35)) { switch(direction) { case 0: animName = "FloatShootSide2"; break; case 1: goto switchD_00614663_caseD_1; case 2: goto switchD_00614663_caseD_2; case 3: goto switchD_00614663_caseD_3; default: goto switchD_00614663_default; } } else { if (variant == 0x58) { isAnimSet = ANM2::SetAnimation(&this->_sprite,(byte *)"Level3Shoot",1); if (isAnimSet != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if (direction == 0) { (this->_sprite)._flipX = 1; ExceptionList = local_10; return; } ExceptionList = local_10; return; } switch(direction) { case 0: (this->_sprite)._flipX = 1; case 2: switchD_00614663_caseD_2: animName = "FloatShootSide"; break; case 1: switchD_00614663_caseD_1: animName = "FloatShootUp"; break; case 3: switchD_00614663_caseD_3: animName = "FloatShootDown"; break; default: goto switchD_00614663_default; } } ANM2::Play(&this->_sprite,(byte *)animName,0); switchD_00614663_default: ExceptionList = local_10; return; } //@@ 006146e0 Entity_Familiar::TryAimAtMarkedTarget /* ZHL [exact] __thiscall bool Entity_Familiar::TryAimAtMarkedTarget(Vector *AimDirection, int *eDirection, Vector *TargetPosBuffer); prototype: REPENTOGON, confirmed by RET 12 */ byte __thiscall Entity_Familiar::TryAimAtMarkedTarget (Entity_Familiar *this,Vector *AimDirection,int *eDirection,Vector *TargetPosBuffer) { byte bVar1; int iVar2; EntityPtr tmpEntity; float distance; float fVar3; float distance; Vector targetPos; if (((this->_variant == 0xf0) && (10.0 < this->_updateTime)) && (tmpEntity = this->_target, tmpEntity != (EntityPtr)0x0)) { if ((g_manager->_framecount & 1) == 0) { targetPos.x = *(float *)((int)tmpEntity + 0x38c); targetPos.y = *(float *)((int)tmpEntity + 0x390); } else { targetPos.x = (*(float *)((int)tmpEntity + 0x38c) + *(float *)((int)tmpEntity + 0x33c)) * 0.5; targetPos.y = (*(float *)((int)tmpEntity + 0x390) + *(float *)((int)tmpEntity + 0x340)) * 0.5; } fVar3 = targetPos.x - (this->_pos).x; distance = targetPos.y - (this->_pos).y; distance = sqrtf(fVar3 * fVar3 + distance * distance); if (0.0 < distance) { fVar3 = fVar3 * (1.0 / distance); distance = distance * (1.0 / distance); } AimDirection->x = fVar3; AimDirection->y = distance; iVar2 = vector_to_direction(AimDirection); *eDirection = iVar2; goto LAB_00614abd; } if (this->_isFollower == 0) { LAB_0061484b: bVar1 = Entity_Player::HasCollectible(this->_player,0x18a,0); if (((bVar1 == 0) && (bVar1 = Entity_Player::HasCollectible(this->_player,0x23c,0), bVar1 == 0)) || (iVar2 = *(int *)((int)this->_player + 0x140c), iVar2 == 0)) { if (TargetPosBuffer != (Vector *)0x0) { TargetPosBuffer->x = g_vectorZero.x; TargetPosBuffer->y = g_vectorZero.y; } return 0; } if ((g_manager->_framecount & 1) == 0) { targetPos.x = *(float *)(iVar2 + 0x38c); targetPos.y = *(float *)(iVar2 + 0x390); } else { targetPos.x = (*(float *)(iVar2 + 0x38c) + *(float *)(iVar2 + 0x33c)) * 0.5; targetPos.y = (*(float *)(iVar2 + 0x390) + *(float *)(iVar2 + 0x340)) * 0.5; } distance = targetPos.x - (this->_pos).x; fVar3 = targetPos.y - (this->_pos).y; distance = sqrtf(distance * distance + fVar3 * fVar3); if (0.0 < distance) { fVar3 = fVar3 * (1.0 / distance); distance = distance * (1.0 / distance); } AimDirection->x = distance; AimDirection->y = fVar3; if (ABS(distance) <= ABS(fVar3)) { LAB_00614aa9: iVar2 = (uint)(0.0 <= fVar3) * 2 + 1; } else { iVar2 = 2; if (distance < 0.0) { iVar2 = 0; } } } else { bVar1 = IsLilithBirthrightIncubus(this); if ((bVar1 == 0) || (tmpEntity = (EntityPtr)get_incubus_umbilical_whip(this), tmpEntity == (EntityPtr)0x0)) { tmpEntity = (EntityPtr)this; do { if (*(int *)((int)tmpEntity + 0x28) != 3) break; if (*(int *)((int)tmpEntity + 0x2c) == 0x6d) goto LAB_006148e6; tmpEntity = *(EntityPtr *)((int)tmpEntity + 0x3bc); } while (tmpEntity != (EntityPtr)0x0); goto LAB_0061484b; } LAB_006148e6: tmpEntity = *(EntityPtr *)((int)tmpEntity + 0x3c4); if (tmpEntity == (EntityPtr)0x0) goto LAB_0061484b; if ((g_manager->_framecount & 1) == 0) { targetPos.x = *(float *)((int)tmpEntity + 0x38c); targetPos.y = *(float *)((int)tmpEntity + 0x390); } else { targetPos.x = (*(float *)((int)tmpEntity + 0x38c) + *(float *)((int)tmpEntity + 0x33c)) * 0.5; targetPos.y = (*(float *)((int)tmpEntity + 0x390) + *(float *)((int)tmpEntity + 0x340)) * 0.5; } distance = targetPos.x - (this->_pos).x; fVar3 = targetPos.y - (this->_pos).y; distance = sqrtf(distance * distance + fVar3 * fVar3); if (0.0 < distance) { fVar3 = fVar3 * (1.0 / distance); distance = distance * (1.0 / distance); } AimDirection->x = distance; AimDirection->y = fVar3; if (ABS(distance) <= ABS(fVar3)) goto LAB_00614aa9; iVar2 = 2; if (distance < 0.0) { iVar2 = 0; } } *eDirection = iVar2; LAB_00614abd: if (TargetPosBuffer != (Vector *)0x0) { TargetPosBuffer->x = targetPos.x; TargetPosBuffer->y = targetPos.y; } return 1; } //@@ 00614b10 Entity_Familiar::Shoot /* ZHL [lua] Lua binding EntityFamiliar:Shoot prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Familiar::Shoot(Entity_Familiar *this) { byte bVar1; char isLastRef; uint uVar2; Vector *AimDirection; int iVar3; LayerState *layer; int *texturePtr; EntityPtr EVar4; byte *anim; int iVar5; float sinAngle; Vector local_4c; Vector aimDir; Vector local_3c; undefined1 texture [4]; EntityPtr local_30; float local_2c; int fireDirection; int fireDelay; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *floatAnim; void *player; puStack_20 = texture + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00af6a0d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(texture + 0x24); if (this->_player->_dead != 0) { return; } ExceptionList = &local_1c; if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } bVar1 = Entity_Player::HasTrinket(this->_player,0x8d,0); if ((bVar1 != 0) && (0 < this->_fireCooldown)) { this->_fireCooldown = this->_fireCooldown + -1; } iVar5 = this->_variant; fireDelay = 0x16; if (iVar5 == 0x4a) { fireDelay = 0xb; } if ((iVar5 == 1) || (iVar5 == 8)) { fireDelay = 0x10; } if (iVar5 == 0x51) { fireDelay = 0x2c; } if ((this->_flags & 0x100) != 0) { fireDelay = (int)((float)fireDelay * 1.4); } local_2c = -NAN; if (iVar5 == 0xf4) { fireDelay = 0xb; } else if (iVar5 == 0x4a) { local_2c = (float)this->_subtype; } if ((1 < *(int *)&g_game->_deathmatchManager) && (iVar5 == 0x36)) { fireDelay = 0x21; } iVar3 = fireDelay; player = this->_player; fireDirection = *(int *)((int)player + 0x162c); if (fireDirection == -1) { if (((-1 < this->_headFrameDelay) && (iVar3 = this->_headFrameDelay + -1, this->_headFrameDelay = iVar3, iVar3 < 0)) && (iVar5 != 0x58)) { if (iVar5 == 0xce) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); texturePtr = LayerState::GetTexture(layer,texture); local_14 = 0; anim = s_Idle2; if (*(uint *)(*texturePtr + 0x10) < 0x81) { anim = s_Idle; } ANM2::SetAnimation(&this->_sprite,anim,0); local_14 = 1; if (((local_30 != (EntityPtr)0x0) && (isLastRef = (**(code **)(*(int *)local_30 + 0xc))(uVar2), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(texture); ExceptionList = local_1c; return; } } else { if (iVar5 == 0xed) { ANM2::SetAnimation(&this->_sprite,s_Idle,0); ExceptionList = local_1c; return; } if (iVar5 != 0xee) { (this->_sprite)._flipX = 0; if (iVar5 == 0x4c) { floatAnim = "Float"; } else if (((iVar5 == 6) || (iVar5 == 0x35)) || ((iVar5 != 0x6d || (*(int *)((int)this->_player + 0x162c) == -1)))) { floatAnim = "FloatDown"; } else { floatAnim = "StoppedDown"; } ANM2::Play(&this->_sprite,(byte *)floatAnim,0); } } } ExceptionList = local_1c; return; } local_4c.x = *(float *)((int)player + 0x33c) - (this->_pos).x; local_4c.y = *(float *)((int)player + 0x340) - (this->_pos).y; if ((iVar5 == 8) || (iVar5 == 0xf4)) { if (ABS(local_4c.x) <= ABS(local_4c.y)) { fireDirection = (uint)(0.0 <= local_4c.y) * 2 + 1; } else { fireDirection = 2; if (local_4c.x < 0.0) { fireDirection = 0; } } } Isaac::GetAxisAlignedUnitVectorFromDir(&aimDir,fireDirection); bVar1 = TryAimAtMarkedTarget(this,&aimDir,&fireDirection,(Vector *)0x0); local_30._0_1_ = bVar1; (this->_sprite)._flipX = fireDirection == 0; if (0 < this->_fireCooldown) goto LAB_00614e92; iVar5 = this->_variant; if (iVar5 == 0x61) { iVar5 = 0; do { local_2c = (float)iVar5 * 90.0 * 0.017453292; local_3c.y = cos(local_2c); sinAngle = sin(local_2c); local_4c.x = aimDir.x * local_3c.y - aimDir.y * sinAngle; local_4c.y = aimDir.y * local_3c.y + aimDir.x * sinAngle; FireProjectile(this,&local_4c,local_30._0_1_); iVar5 = iVar5 + 1; } while (iVar5 < 4); iVar3 = fireDelay; LAB_00614e78: this->_fireCooldown = iVar3; this->_headFrameDelay = 0x12; } else { if ((iVar5 == 6) || (local_2c == 5.60519e-45)) { fire_robo_baby_laser(this,&aimDir); goto LAB_00614e78; } if ((iVar5 != 0x36) && (local_2c != 1.26117e-44)) { if ((iVar5 == 8) || (iVar5 == 0xf4)) { EVar4 = local_30; AimDirection = Vector::Normalized(&local_4c,&local_3c); FireProjectile(this,AimDirection,EVar4._0_1_); } else { FireProjectile(this,&aimDir,bVar1); } goto LAB_00614e78; } if (this->_linkedEntity == (EntityPtr)0x0) { PickEnemyTarget(this,200.0,1,0,&g_vectorZero,15.0); local_30 = (EntityPtr) Entity_Player::AddBlueFlies(this->_player,1,&this->_pos,(Entity *)this->_target); if (this->_linkedEntity != (EntityPtr)0x0) { local_3c.y = (float)&this->_linkedEntity; std::multiset::erase(&local_3c.y); } this->_linkedEntity = local_30; EVar4 = (EntityPtr)0x0; if (local_30 != (EntityPtr)0x0) { std::multiset::insert(&this->_linkedEntity); EVar4 = this->_linkedEntity; } Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)EVar4); goto LAB_00614e78; } } mongo_baby_pick_next_mimic(this); LAB_00614e92: if (this->_headFrameDelay < 9) { PlayFloatAnim(this,fireDirection); this->_headFrameDelay = 8; ExceptionList = local_1c; return; } PlayShootAnim(this,fireDirection); this->_headFrameDelay = this->_headFrameDelay + -1; ExceptionList = local_1c; return; } //@@ 00615030 Entity_Familiar::PickEnemyTarget /* ZHL [lua] Lua binding EntityFamiliar:PickEnemyTarget prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Entity_Familiar::PickEnemyTarget (Entity_Familiar *this,float attackRange,int frameInterval,int flags,Vector *coneDir, float coneAngle) { int iVar1; uint3 uVar2; byte bVar3; int *piVar4; EntityPtr candidate; EntityPtr *targetSlot; float fVar5; float fVar6; undefined1 local_68 [8]; int local_60; undefined1 local_5c [4]; undefined1 local_58 [4]; int local_54; undefined1 local_50 [4]; void *room; uint isPreferHighHealth; uint isPreferLowHealth; EntityPtr prevTarget; float coneCos; EntityPtr *targetSlotSaved; float local_34; float local_30; float playerDist; uint isNearPlayerBonus; float dist; float dy; float coneDirY; float coneDirX; byte isRetarget; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uint entityIndex; bool isDeathmatchEnemy; Entity_NPC *ownerEnemy; uStack_8 = 0xffffffff; puStack_c = &LAB_00af6a30; local_10 = ExceptionList; ExceptionList = &local_10; if (*(char *)((int)g_game->_room + 0x72a1) != '\0') { if (this->_target != (EntityPtr)0x0) { flags = (int)&this->_target; std::multiset::erase(&flags); } this->_target = (EntityPtr)0x0; ExceptionList = local_10; return; } bVar3 = (byte)flags; uVar2 = (uint3)((uint)flags >> 8); isRetarget = bVar3 & 1; isNearPlayerBonus = CONCAT31(uVar2 >> 1,~(byte)((uint)flags >> 1)) & 0xffffff01; isPreferHighHealth = (uint)flags >> 2 & 0xffffff01; isPreferLowHealth = (uint)flags >> 3 & 0xffffff01; flags = CONCAT31(uVar2 >> 4,(char)((uint)flags >> 4)) & 0xffffff01; if ((coneDir->x == g_vectorZero.x) && (fVar5 = (float)(uint)(bVar3 & 0xff01), coneDir->y == g_vectorZero.y)) { coneDir = (Vector *)((uint)coneDir & 0xffffff); coneDirY = 0.0; coneDirX = 0.0; } else { coneDirY = coneDir->y; coneDirX = coneDir->x; coneDir = (Vector *)CONCAT13(1,coneDir._0_3_); fVar5 = sqrtf(coneDirX * coneDirX + coneDirY * coneDirY); if (0.0 < fVar5) { coneDirX = (1.0 / fVar5) * coneDirX; coneDirY = coneDirY * (1.0 / fVar5); } coneCos = cos((coneAngle * 3.1415927) / 360.0); fVar5 = (float)(uint)isRetarget; } local_30 = 1.4013e-45; if (*(int *)&g_game->_deathmatchManager < 2) { local_30 = fVar5; } targetSlotSaved = &this->_target; if (this->_target != (EntityPtr)0x0) { fVar5 = *(float *)((int)this->_target + 0x20); coneAngle = fVar5; _Find_lower_bound<>(local_5c,&coneAngle); if (((*(char *)(local_54 + 0xd) == '\0') && ((uint)*(float *)(local_54 + 0x10) <= (uint)fVar5)) && (local_54 != (int)this[1]._pendingDamageFlags)) { local_34 = fVar5; piVar4 = (int *)std::map::try_emplace(local_50,&local_34); if (*(int *)(*piVar4 + 0x14) < 0) { if (this->_target != (EntityPtr)0x0) { coneAngle = (float)&this->_target; std::multiset::erase(&coneAngle); } this->_target = (EntityPtr)0x0; } } } iVar1 = frameInterval; if ((this->_flags & 0x100) != 0) { candidate = this->_target; targetSlot = &this->_target; if (((candidate != (EntityPtr)0x0) && (*(int *)((int)candidate + 0x28) == 1)) && (bVar3 = Entity_Player::HasInvincibility((Entity_Player *)candidate,0,(EntityRef *)0x0), bVar3 != 0)) { if (*targetSlot != (EntityPtr)0x0) { flags = (int)targetSlot; std::multiset::erase(&flags); } *targetSlot = (EntityPtr)0x0; } if ((1 < frameInterval) && (bVar3 = Entity::IsFrame((Entity *)this,frameInterval,this->_index), bVar3 == 0)) { ExceptionList = local_10; return; } if (*targetSlot != (EntityPtr)0x0) { ExceptionList = local_10; return; } if (this->_variant == 200) { flags = 0x43960000; } else { flags = (int)(attackRange + attackRange); } ownerEnemy = *(Entity_NPC **)((int)this->_player + 0x3bc); if (ownerEnemy == (Entity_NPC *)0x0) { ExceptionList = local_10; return; } bVar3 = Entity::IsEnemy((Entity *)ownerEnemy); if (bVar3 == 0) { ExceptionList = local_10; return; } candidate = (EntityPtr)Entity_NPC::GetPlayerTarget(ownerEnemy); fVar5 = (this->_pos).y - *(float *)((int)candidate + 0x340); fVar6 = (this->_pos).x - ((Vector *)((int)candidate + 0x33c))->x; fVar5 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if ((float)flags < fVar5) { ExceptionList = local_10; return; } if (*targetSlot != (EntityPtr)0x0) { flags = (int)targetSlot; std::multiset::erase(&flags); } *targetSlot = candidate; goto LAB_00615845; } prevTarget = this->_target; candidate = (EntityPtr)0x0; if (prevTarget == (EntityPtr)0x0) { LAB_006153f5: if (1 < iVar1) goto LAB_006153fa; } else { bVar3 = Entity::IsVulnerableEnemy((Entity *)prevTarget,(Entity *)0x0); if (bVar3 == 0) { LAB_006153c5: if (this->_target != (EntityPtr)0x0) { frameInterval = (int)&this->_target; std::multiset::erase(&frameInterval); } this->_target = (EntityPtr)0x0; candidate = (EntityPtr)0x0; goto LAB_006153f5; } candidate = this->_target; bVar3 = Entity::HasEntityFlags((Entity *)candidate,0x20000010); if (bVar3 != 0) goto LAB_006153c5; if (local_30._0_1_ == '\0') goto LAB_006153f5; if ((iVar1 < 2) || (bVar3 = Entity::IsFrame((Entity *)this,iVar1,this->_index), bVar3 != 0)) goto LAB_006153c5; LAB_006153fa: bVar3 = Entity::IsFrame((Entity *)this,iVar1,this->_index); if (bVar3 == 0) { ExceptionList = local_10; return; } } if (candidate != (EntityPtr)0x0) { ExceptionList = local_10; return; } candidate = (EntityPtr)0x0; coneAngle = 0.0; local_30 = 0.0; room = g_game->_room; local_34 = 0.0; if (*(int *)((int)room + 0x1264) == 0) { targetSlot = targetSlotSaved; } else { do { candidate = *(EntityPtr *)(*(int *)((int)room + 0x125c) + (int)local_34 * 4); entityIndex = *(int *)((int)candidate + 0x20); frameInterval = entityIndex; _Find_lower_bound<>(local_68,&frameInterval); if (((*(char *)(local_60 + 0xd) == '\0') && (*(uint *)(local_60 + 0x10) <= entityIndex)) && (local_60 != (int)this[1]._pendingDamageFlags)) { frameInterval = entityIndex; piVar4 = (int *)std::map::try_emplace(local_58,&frameInterval); if (-1 < *(int *)(*piVar4 + 0x14)) goto LAB_006154a6; } else { LAB_006154a6: fVar5 = *(float *)((int)candidate + 0x340) - (this->_pos).y; fVar6 = ((Vector *)((int)candidate + 0x33c))->x - (this->_pos).x; dist = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); fVar5 = *(float *)((int)candidate + 0x340) - *(float *)((int)this->_player + 0x340); fVar6 = ((Vector *)((int)candidate + 0x33c))->x - *(float *)((int)this->_player + 0x33c); playerDist = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); piVar4 = (int *)((int)candidate + 0x28); if ((*(int *)&g_game->_deathmatchManager < 2) || (*piVar4 != 1)) { frameInterval = *piVar4; if (frameInterval - 10U < 0x3de) goto LAB_0061554a; LAB_006155dc: frameInterval = frameInterval & 0xffffff; } else { frameInterval = 1; LAB_0061554a: if ((((((*(int *)((int)candidate + 0x188) == 1) || (*(int *)((int)candidate + 0x188) == 0) ) || ((*(byte *)((int)candidate + 0x3b0) != 0 || (*(byte *)((int)candidate + 0x173) != 0)))) || (((((bVar3 = Entity::HasEntityFlags((Entity *)candidate,0x10), bVar3 != 0 && (frameInterval != 0x322)) && (frameInterval != 0x362)) || ((bVar3 = Entity::IsDescendantOf ((Entity *)candidate,(Entity *)this->_spawnerEntity), bVar3 != 0 || ((*(uint *)((int)candidate + 0x168) & 0x20000010) != 0)))) || (*piVar4 == 0x322)))) || (*(byte *)((int)candidate + 0x173) != 0)) || ((attackRange < dist && (((char)isNearPlayerBonus == '\0' || (attackRange <= playerDist)))))) goto LAB_006155dc; frameInterval = CONCAT13(1,(undefined3)frameInterval); } if ((((*(int *)&g_game->_deathmatchManager < 2) || (*piVar4 != 3)) || (*(int *)((int)candidate + 0x2c) != 0x43)) || (bVar3 = Entity::IsDescendantOf((Entity *)candidate,(Entity *)this->_spawnerEntity), bVar3 != 0)) { isDeathmatchEnemy = false; } else { isDeathmatchEnemy = true; } if ((frameInterval._3_1_ != '\0') || (isDeathmatchEnemy)) { if (*piVar4 == 1) { bVar3 = Entity_Player::IsInvisible((Entity_Player *)candidate); if (bVar3 == 0) { bVar3 = Entity_Player::HasCollectible((Entity_Player *)candidate,9,0); if (bVar3 == 0) { if (((*(int *)((int)candidate + 0x2c) != 0) || (*(byte *)((int)candidate + 0x202c) != 0)) || (*(byte *)((int)candidate + 0x20a9) != 0)) goto LAB_006156ba; if (2 < *(int *)((int)candidate + 0x17e0)) goto LAB_00615664; } else { LAB_00615664: iVar1 = this->_variant; if (((iVar1 == 0x2b) || (iVar1 == 0x49)) || (iVar1 == 0xe7)) goto LAB_006157fa; if (((*(int *)((int)candidate + 0x2c) != 0) || (*(byte *)((int)candidate + 0x202c) != 0)) || (*(byte *)((int)candidate + 0x20a9) != 0)) goto LAB_006156ba; } if ((*(int *)((int)candidate + 0x180c) < 3) || ((this->_variant != 0x49 && (this->_variant != 0x71)))) goto LAB_006156ba; } } else { LAB_006156ba: fVar5 = 0.0; if (coneDir._3_1_ != '\0') { frameInterval = (int)(((Vector *)((int)candidate + 0x33c))->x - (this->_pos).x); dy = *(float *)((int)candidate + 0x340) - (this->_pos).y; fVar5 = sqrtf((float)frameInterval * (float)frameInterval + dy * dy); if (fVar5 <= 0.0) { fVar6 = (float)frameInterval; fVar5 = dy; } else { fVar6 = (float)frameInterval * (1.0 / fVar5); fVar5 = dy * (1.0 / fVar5); } fVar5 = coneDirX * fVar6 + coneDirY * fVar5; if (fVar5 < coneCos) goto LAB_006157fa; fVar5 = fVar5 * 2000.0 + 0.0; } if (((char)flags == '\0') && (candidate == prevTarget)) { fVar5 = fVar5 + 400.0; } fVar6 = 800.0 - dist; if (fVar6 <= 0.0) { fVar6 = 0.0; } fVar6 = fVar6 + fVar5; if ((char)isNearPlayerBonus != '\0') { fVar5 = 400.0 - playerDist; if (fVar5 <= 0.0) { fVar5 = 0.0; } fVar6 = fVar6 + fVar5 * 3.0; } if ((char)isPreferLowHealth != '\0') { fVar5 = 400.0 - *(float *)((int)candidate + 0x380); if (fVar5 <= 0.0) { fVar5 = 0.0; } fVar6 = fVar6 + fVar5; } if ((char)isPreferHighHealth != '\0') { fVar5 = *(float *)((int)candidate + 0x380); if (1000.0 <= fVar5) { fVar5 = 1000.0; } fVar6 = fVar6 + fVar5; } if (local_30 < fVar6) { coneAngle = (float)candidate; local_30 = fVar6; } } } } LAB_006157fa: targetSlot = targetSlotSaved; candidate = (EntityPtr)coneAngle; local_34 = (float)((int)local_34 + 1); } while ((uint)local_34 < (uint)*(float *)((int)room + 0x1264)); if (*targetSlotSaved != (EntityPtr)0x0) { flags = (int)targetSlotSaved; std::multiset::erase(&flags); } } *targetSlot = candidate; if (candidate == (EntityPtr)0x0) { ExceptionList = local_10; return; } LAB_00615845: std::multiset::insert(targetSlot); ExceptionList = local_10; return; } //@@ 00615870 Entity_Familiar::target_threatening_projectile /* DB: ECX familiar: scans the room's projectile list (g_game+0x18300 list +0x497/+0x499), predicts each one's position, scores by distance to the owner player (+0x410) and heading (x1200 dot product when arg2 bit1 clear), skips dead/friendly/coop-owned ones, and stores the best into _target +0x3c4; used by Entity_Familiar::ai_bot_fly and FamiliarAI::variant_204 */ void __thiscall Entity_Familiar::target_threatening_projectile (Entity_Familiar *this,undefined4 param_2,uint param_3) { EntityPtr this_00; byte isDescendant; float fVar1; float fVar2; float in_XMM1_Da; float fVar3; float predictedX; float fVar4; float predictedY; EntityPtr bestTarget; float velocityX; float velocityY; float score; float speedSq; float bestScore; EntityPtr projectileIdx; EntityPtr *local_24; uint tearFlags; uint uStack_1c; uint uStack_18; uint uStack_14; Game *game; uint isAlwaysAssign; EntityPtr *targetRef; isAlwaysAssign = param_3 & 1; param_3._0_1_ = ~(byte)(param_3 >> 1) & 1; local_24 = g_game->_room; bestTarget = (EntityPtr)0x0; bestScore = -1e+10; projectileIdx = (EntityPtr)0x0; if (local_24[0x499] != (EntityPtr)0x0) { do { this_00 = *(EntityPtr *)((int)local_24[0x497] + (int)projectileIdx * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (isDescendant = Entity::IsDescendantOf((Entity *)this_00,(Entity *)this->_spawnerEntity), isDescendant == 0)) { game = g_game; velocityX = ((Vector *)((int)this_00 + 0x360))->x; fVar3 = (this->_pos).x - ((Vector *)((int)this_00 + 0x33c))->x; velocityY = *(float *)((int)this_00 + 0x364); fVar1 = (this->_pos).y - *(float *)((int)this_00 + 0x340); fVar3 = sqrtf(fVar1 * fVar1 + fVar3 * fVar3); predictedX = ((Vector *)((int)this_00 + 0x360))->x * fVar3 * 0.05 + ((Vector *)((int)this_00 + 0x33c))->x; fVar1 = *(float *)((int)this->_player + 0x33c); predictedY = *(float *)((int)this_00 + 0x364) * fVar3 * 0.05 + *(float *)((int)this_00 + 0x340); fVar3 = *(float *)((int)this->_player + 0x340); fVar2 = predictedX - fVar1; fVar4 = predictedY - fVar3; fVar4 = fVar4 * fVar4 + fVar2 * fVar2; fVar2 = sqrtf(fVar4); if ((*(byte *)((int)this_00 + 0x173) == 0) && (((*(uint *)((int)this_00 + 0x168) & 0x10) == 0 && (fVar2 <= in_XMM1_Da)))) { if (((this->_flags & 0x100) == 0) && (*(int *)&game->_deathmatchManager < 2)) { if ((((*(int *)((int)this_00 + 0x28) == 9) && (speedSq = velocityX * velocityX + velocityY * velocityY, 1e-05 < speedSq)) && (-50.0 < *(float *)((int)this_00 + 0x410))) && (((*(int *)((int)this_00 + 0x438) & 0x80000000U) == 0 && (*(int *)((int)this_00 + 0x2c) != 0xe)))) { LAB_00615c0f: fVar4 = sqrtf(fVar4); fVar2 = 200.0 - fVar4; if (200.0 - fVar4 <= 0.0) { fVar2 = 0.0; } score = fVar2 * 3.0 + 100.0; if ((byte)param_3 != 0) { fVar2 = sqrtf(speedSq); if (0.0 < fVar2) { velocityY = (1.0 / fVar2) * velocityY; velocityX = (1.0 / fVar2) * velocityX; } fVar1 = fVar1 - predictedX; fVar3 = fVar3 - predictedY; fVar2 = sqrtf(fVar1 * fVar1 + fVar3 * fVar3); if (0.0 < fVar2) { fVar3 = fVar3 * (1.0 / fVar2); fVar1 = fVar1 * (1.0 / fVar2); } fVar1 = (velocityX * fVar1 + velocityY * fVar3) * 1200.0; if (0.5 <= fVar1) { score = fVar1 + score; } else { score = score - 1200.0; } } fVar1 = sqrtf(speedSq); fVar1 = fVar1 * 100.0; if (600.0 <= fVar1) { fVar1 = 600.0; } if (bestScore < fVar1 + score) { bestTarget = this_00; bestScore = fVar1 + score; } } } else if (*(int *)((int)this_00 + 0x28) == 2) { speedSq = velocityX * velocityX + velocityY * velocityY; if ((1e-05 < speedSq) && (-50.0 < *(float *)((int)this_00 + 0x410))) { tearFlags = *(uint *)((int)this_00 + 0x428); uStack_1c = *(int *)((int)this_00 + 0x42c); uStack_18 = *(int *)((int)this_00 + 0x430); uStack_14 = *(int *)((int)this_00 + 0x434); if (((((uint)g_tearFlagExplosive._l | (uint)g_tearFlagLudovico._l) & tearFlags) == 0 && ((g_tearFlagExplosive._l._4_4_ | g_tearFlagLudovico._l._4_4_) & uStack_1c) == 0) && ((((uint)g_tearFlagExplosive._h | (uint)g_tearFlagLudovico._h) & uStack_18) == 0 && ((g_tearFlagExplosive._h._4_4_ | g_tearFlagLudovico._h._4_4_) & uStack_14) == 0)) goto LAB_00615c0f; } } else if ((((*(int *)((int)this_00 + 0x28) == 9) && ((*(int *)((int)this_00 + 0x438) & 0x80000000U) != 0)) && (speedSq = velocityX * velocityX + velocityY * velocityY, 1e-05 < speedSq)) && (-50.0 < *(float *)((int)this_00 + 0x410))) goto LAB_00615c0f; } } projectileIdx = (EntityPtr)((int)projectileIdx + 1); } while ((uint)projectileIdx < (uint)local_24[0x499]); } if ((isAlwaysAssign != 0) || (bestTarget != (EntityPtr)0x0)) { targetRef = &this->_target; if (this->_target != (EntityPtr)0x0) { local_24 = targetRef; std::multiset::erase(&local_24); } *targetRef = bestTarget; if (bestTarget != (EntityPtr)0x0) { std::multiset::insert(targetRef); } } return; } //@@ 00615d80 Entity_Familiar::ai_blue_fly /* DB: Entity_Familiar::Update case variant 43 BLUE_FLY: GetOrbitPosition/RecalculateOrbitOffset/get_orbit_parent orbit then PickEnemyTarget attack */ void __thiscall Entity_Familiar::ai_blue_fly(Entity_Familiar *this) { EntityPtr *pEVar1; EntityPtr EVar2; int iVar3; uint uVar4; Entity *pEVar5; Vector *pVVar6; float fVar7; float fVar8; Vector local_18; Vector local_10; if (0 < this->_state) { iVar3 = this->_state + -1; this->_state = iVar3; this->_entityCollisionClass = 0; this->_friction = this->_friction * 0.96; if (iVar3 == 0) { this->_entityCollisionClass = 4; return; } return; } local_18.x = 200.0; if (this->_subtype == 1) { local_18.x = 400.0; if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 0x3c)) { this->_target = (EntityPtr)0x0; iVar3 = 0; goto LAB_00615e6a; } } uVar4 = Random(); if ((uVar4 % 3 == 0) || (this->_subtype == 1)) { PickEnemyTarget(this,local_18.x,0xd,0,&g_vectorZero,15.0); } iVar3 = 4; LAB_00615e6a: pEVar1 = &this->_parent; this->_entityCollisionClass = iVar3; EVar2 = *pEVar1; if ((EVar2 != (EntityPtr)0x0) && ((*(char *)((int)EVar2 + 0x173) != '\0' || (*(int *)((int)EVar2 + 0x188) == 0)))) { local_18.x = (float)pEVar1; std::multiset::erase(&local_18); *pEVar1 = (EntityPtr)0x0; if (-1 < this->_orbitLayer) { RecalculateOrbitOffset(this,this->_orbitLayer,0); this->_orbitLayer = -1; } } EVar2 = this->_target; if (EVar2 == (EntityPtr)0x0) { if (this->_orbitLayer == -1) { this->_orbitLayer = 1; fVar7 = DAT_00c34148; (this->_orbitDistance).x = DAT_00c34144; (this->_orbitDistance).y = fVar7; RecalculateOrbitOffset(this,1,1); } pEVar5 = get_orbit_parent(this); local_10.x = (pEVar5->_pos).x; local_10.y = (pEVar5->_pos).y; pVVar6 = GetOrbitPosition(this,&local_18,&local_10); fVar7 = pVVar6->x; (this->_targetPosition).x = fVar7; (this->_targetPosition).y = pVVar6->y; } else { fVar7 = *(float *)((int)EVar2 + 0x33c); fVar8 = *(float *)((int)EVar2 + 0x340); (this->_targetPosition).x = fVar7; (this->_targetPosition).y = fVar8; if (-1 < this->_orbitLayer) { RecalculateOrbitOffset(this,this->_orbitLayer,0); this->_orbitLayer = -1; fVar7 = (this->_targetPosition).x; } } local_10.x = (this->_targetPosition).y - (this->_pos).y; local_18.x = fVar7 - (this->_pos).x; fVar7 = sqrtf(local_10.x * local_10.x + local_18.x * local_18.x); if (fVar7 < 0.1) { fVar8 = 0.0; } else { fVar8 = fVar7 * 0.15; if (2.0 <= fVar8) { fVar8 = 2.0; } fVar8 = fVar8 / fVar7; } (this->_velocity).x = local_18.x * fVar8 + (this->_velocity).x; (this->_velocity).y = local_10.x * fVar8 + (this->_velocity).y; this->_friction = this->_friction * 0.8; return; } //@@ 00616050 FamiliarAI::blue_spider /* DB: Entity_Familiar::Update case 0x49 (FamiliarVariant 73 BLUE_SPIDER); Appear/Idle/Walk and Idle_Deathmatch/Walk_Deathmatch anims; HasCollectible(0xf7 BFFS) size check */ EntityPtr __fastcall FamiliarAI::blue_spider(Entity_Familiar *familiar) { byte bVar1; byte *curAnimName; uint uVar2; Entity_Player *nearestPlayer; Vector *pVVar3; EntityPtr EVar4; char *animName; bool isLess; float fVar5; float fVar6; float fVar7; float fVar8; Vector local_20; Vector local_18; Vector local_10; Game *game; float *posOffsetY; int prevCounter; posOffsetY = &(familiar->_posOffset).y; if ((*posOffsetY <= 0.0 && *posOffsetY != 0.0) || (familiar->_orbitSpeed <= 0.0 && familiar->_orbitSpeed != 0.0)) { familiar->_entityGridCollisionClass = 3; familiar->_entityCollisionClass = 0; (familiar->_velocity).x = (familiar->_orbitDistance).x; EVar4 = (EntityPtr)(familiar->_orbitDistance).y; (familiar->_velocity).y = (float)EVar4; fVar5 = familiar->_orbitSpeed + 0.7; familiar->_orbitSpeed = fVar5; fVar7 = fVar5 + (familiar->_posOffset).y; (familiar->_posOffset).y = fVar7; if (fVar7 <= -fVar5) { return EVar4; } (familiar->_posOffset).y = 0.0; familiar->_orbitSpeed = 0.0; (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; goto LAB_0061674f; } if (((familiar->_sprite)._animState._animData != (void *)0x0) && ((familiar->_sprite)._animState._isPlaying != 0)) { curAnimName = (familiar->_sprite)._animState._animData; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } animName = "Appear"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_006160c0: uVar2 = -(uint)isLess | 1; goto LAB_006160c5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_006160c0; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006160c5: if (uVar2 == 0) { return (EntityPtr)0x0; } } uVar2 = Random(); if (uVar2 % 3 == 0) { Entity_Familiar::PickEnemyTarget(familiar,240.0,0xd,0,&g_vectorZero,15.0); } pVVar3 = &familiar->_pos; nearestPlayer = Game::GetNearestPlayer(g_game,pVVar3); EVar4 = familiar->_target; if (EVar4 == (EntityPtr)0x0) { fVar7 = (nearestPlayer->_pos).x; local_20.x = (nearestPlayer->_pos).y; uVar2 = Random(); fVar5 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; uVar2 = Random(); fVar5 = ((fVar5 + fVar5) - 1.0) * 30.0 + local_20.x; fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; fVar7 = ((fVar6 + fVar6) - 1.0) * 30.0 + fVar7; } else { fVar7 = *(float *)((int)EVar4 + 0x33c); fVar5 = *(float *)((int)EVar4 + 0x340); } game = g_game; local_20.x = fVar5 - (familiar->_pos).y; local_18.x = fVar7 - pVVar3->x; local_10.x = fVar7; local_10.y = fVar5; if (((familiar->_targetPosition).x == g_vectorZero.x) && ((familiar->_targetPosition).y == g_vectorZero.y)) { animName = "Idle_Deathmatch"; if (*(int *)&g_game->_deathmatchManager < 2) { animName = (char *)s_Idle; } ANM2::Play(&familiar->_sprite,(byte *)animName,0); prevCounter = familiar->_counter; EVar4 = (EntityPtr)(prevCounter + 1); familiar->_counter = (int)EVar4; if (0xd < prevCounter) { local_18.x = sqrtf(local_20.x * local_20.x + local_18.x * local_18.x); uVar2 = Random(); if (((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 100.0 + 100.0 <= local_18.x) || (bVar1 = Room::CheckLine(g_game->_room,pVVar3,&local_10,1,0,0,0,(Vector *)0x0), bVar1 == 0) ) { pVVar3 = MusicManager::RandomVector(&local_10); uVar2 = Random(); game = g_game; fVar7 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 40.0 + 70.0; local_20.y = fVar7 * pVVar3->y + (familiar->_pos).y; local_20.x = fVar7 * pVVar3->x + (familiar->_pos).x; pVVar3 = Room::GetClampedPositionImpl(g_game->_room,&local_18,&local_20,70.0,40.0,60.0,60.0) ; local_20.x = pVVar3->x; local_20.y = pVVar3->y; local_18.x = (float)game->_room; EVar4 = (EntityPtr)Room::GetGridCollisionAtPos((Room *)local_18.x,*pVVar3); if (EVar4 == (EntityPtr)0x0) { EVar4._0_1_ = Room::CheckLine((Room *)local_18.x,&local_20,&familiar->_pos,0,0,0,0, (Vector *)0x0); EVar4._1_3_ = 0; if (EVar4._0_1_ == 0) { uVar2 = Random(); EVar4 = (EntityPtr)(uVar2 / 0x14); if (uVar2 % 0x14 == 0) { fVar7 = (familiar->_pos).x; fVar5 = (familiar->_pos).y; local_10.x = fVar7 * 0.9 + local_20.x * 0.1; local_10.y = fVar5 * 0.9 + local_20.y * 0.1; local_18.x = fVar7 * 0.1 + local_20.x * 0.9; local_18.y = fVar5 * 0.1 + local_20.y * 0.9; EVar4._0_1_ = Room::CheckLine(g_game->_room,&local_18,&local_10,1,0,0,0,(Vector *)0x0) ; EVar4._1_3_ = 0; if (EVar4._0_1_ != 0) goto LAB_0061653c; } } else { LAB_0061653c: (familiar->_targetPosition).x = local_20.x; (familiar->_targetPosition).y = local_20.y; familiar->_counter = 0xf; } } } else { EVar4 = familiar->_target; if (EVar4 == (EntityPtr)0x0) { EVar4 = (EntityPtr)familiar->_player; if (EVar4 == (EntityPtr)0x0) goto LAB_0061669b; fVar6 = *(float *)((int)EVar4 + 0x360) * 5.0; fVar8 = *(float *)((int)EVar4 + 0x364) * 5.0; fVar6 = fVar6 + fVar6; fVar8 = fVar8 + fVar8; } else { fVar6 = *(float *)((int)EVar4 + 0x360) * 5.0; fVar8 = *(float *)((int)EVar4 + 0x364) * 5.0; } (familiar->_targetPosition).x = fVar6 + fVar7; (familiar->_targetPosition).y = fVar8 + fVar5; } } } else { familiar->_counter = familiar->_counter + -1; animName = "Walk_Deathmatch"; if (*(int *)&game->_deathmatchManager < 2) { animName = (char *)s_Walk; } ANM2::Play(&familiar->_sprite,(byte *)animName,0); local_10.x = (familiar->_targetPosition).x - pVVar3->x; local_10.y = (familiar->_targetPosition).y - (familiar->_pos).y; fVar7 = sqrtf(local_10.y * local_10.y + local_10.x * local_10.x); if ((fVar7 < 14.0) || ((fVar7 = (familiar->_velocity).y, fVar5 = (familiar->_velocity).x, fVar7 = sqrtf(fVar5 * fVar5 + fVar7 * fVar7), fVar7 < 3.0 && (familiar->_counter < 0)))) { (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; familiar->_counter = 0; } pVVar3 = Vector::Normalized(&local_10,&local_18); fVar7 = familiar->_friction; fVar5 = pVVar3->y; fVar6 = (pVVar3->x * 6.0) / fVar7 + (familiar->_velocity).x; (familiar->_velocity).x = fVar6; (familiar->_velocity).y = (fVar5 * 6.0) / fVar7 + (familiar->_velocity).y; EVar4._1_3_ = 0; EVar4._0_1_ = fVar6 < 0.0; (familiar->_sprite)._flipX = fVar6 < 0.0; } LAB_0061669b: familiar->_friction = familiar->_friction * 0.6; LAB_0061674f: familiar->_entityCollisionClass = 3; familiar->_entityGridCollisionClass = 5; return EVar4; } //@@ 00616770 FamiliarAI::bobs_brain /* DB: Entity_Familiar::Update case 0x30 (48 BOBS_BRAIN); WalkDown/WalkHori/WalkVert, PickEnemyTarget, FindGridPath, SpawnEx explosion */ void __fastcall FamiliarAI::bobs_brain(Entity_Familiar *familiar) { byte bVar1; int bodyData; byte *curAnimName; uint uVar2; char *positiveWalkAnim; Entity *spawnedEffect; int *piVar3; byte *expectedAnimName; AnimationState *partAnimState; bool bVar4; bool isLess; float fVar5; float fVar6; float fVar7; float walkAnimSpeed; int *partSlot; int partsLeft; byte *pbStack_20; Vector followPos; byte *animData; ANM2 *sprite; EntityPtr target; followPos.x = *(float *)((int)familiar->_player + 0x33c); followPos.y = *(float *)((int)familiar->_player + 0x340); Entity_Familiar::PickEnemyTarget (familiar,familiar->_collisionDamage * 15.0 + 65.0,0xd,0,&g_vectorZero,15.0); target = familiar->_target; if (target == (EntityPtr)0x0) { fVar7 = 6400.0; } else { followPos.x = *(float *)((int)target + 0x33c); followPos.y = *(float *)((int)target + 0x340); fVar7 = 400.0; } fVar5 = followPos.y - (familiar->_pos).y; fVar6 = followPos.x - (familiar->_pos).x; if (fVar7 < fVar5 * fVar5 + fVar6 * fVar6) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar7 = 2.0; } else { fVar7 = 1.75; } if (target == (EntityPtr)0x0) { fVar7 = 1.5; } PathFinder::FindGridPath ((PathFinder *)&familiar->_pathfinder,&followPos, fVar7 * *(float *)((int)familiar->_player + 0x1568),0,1); } familiar->_friction = familiar->_friction * 0.85; bodyData = __RTDynamicCast(familiar->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::IsaacsBodyData::RTTI_Type_Descriptor,0); if (bodyData == 0) { fVar7 = (familiar->_velocity).x; fVar5 = (familiar->_velocity).y; fVar7 = sqrtf(fVar7 * fVar7 + fVar5 * fVar5); sprite = &familiar->_sprite; if (2.0 <= fVar7) { if (ABS((familiar->_velocity).y) < ABS((familiar->_velocity).x)) { ANM2::Play(sprite,(byte *)"WalkHori",0); (familiar->_sprite)._flipX = (familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0; return; } ANM2::Play(sprite,(byte *)"WalkVert",0); return; } bVar1 = ANM2::SetAnimation(sprite,(byte *)"WalkVert",1); if (bVar1 == 0) { return; } if ((familiar->_sprite)._animState._animData == (void *)0x0) { return; } AnimationState::SetFrameFloat(&(familiar->_sprite)._animState,0.0); if ((familiar->_sprite)._animState._animData == (void *)0x0) { return; } (familiar->_sprite)._animState._isPlaying = 0; return; } animData = *(byte **)(bodyData + 0x38); if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = s_Idle; do { bVar1 = *curAnimName; bVar4 = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00616910: uVar2 = -(uint)bVar4 | 1; goto LAB_00616915; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar4 = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00616910; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00616915: if ((uVar2 == 0) && ((animData[0x34] == 0 || (*(char *)(bodyData + 0x48) != '\0')))) goto LAB_0061694b; } bVar1 = ANM2::SetAnimation((ANM2 *)(bodyData + 4),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(bodyData + 0x34)); *(undefined1 *)(bodyData + 0x48) = 1; } LAB_0061694b: if ((familiar->_sprite)._animState._animData != (void *)0x0) { walkAnimSpeed = 1.0; fVar7 = (familiar->_velocity).x; fVar5 = (familiar->_velocity).y; pbStack_20 = (byte *)0xb1e044; fVar7 = sqrtf(fVar7 * fVar7 + fVar5 * fVar5); bVar4 = false; if (1.0 < fVar7) { fVar5 = (familiar->_velocity).y; fVar6 = (familiar->_velocity).x; if (ABS(fVar5) <= ABS(fVar6)) { pbStack_20 = (byte *)0xb1da88; positiveWalkAnim = "WalkRight"; } else { pbStack_20 = (byte *)&DAT_00b1e020; positiveWalkAnim = "WalkDown"; fVar6 = fVar5; } if (0.0 <= fVar6) { pbStack_20 = (byte *)positiveWalkAnim; } bVar4 = true; } if (2.3 <= fVar7) { if (6.0 < fVar7) { fVar7 = (10.0 - fVar7) / (6.0 - fVar7); walkAnimSpeed = 1.0; if (1.0 <= fVar7) { walkAnimSpeed = fVar7; } if (0.0 <= walkAnimSpeed) { walkAnimSpeed = 0.0; } walkAnimSpeed = walkAnimSpeed + 1.0; } } else { if (fVar7 == 1.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar5 = (2.3 - fVar7) / (1.0 - fVar7); fVar7 = 1.0; if (1.0 <= fVar5) { fVar7 = fVar5; } if (0.0 <= fVar7) { fVar7 = 0.0; } walkAnimSpeed = fVar7 * 0.5 + 0.5; } partsLeft = 4; partSlot = (int *)(bodyData + 0x568); piVar3 = (int *)(bodyData + 0x14c); do { if (-1 < *partSlot) { if ((bVar4) || (familiar->_entityGridCollisionClass == 3)) { animData = (byte *)*piVar3; if (animData == (byte *)0x0) { LAB_00616b7a: bVar1 = ANM2::SetAnimation((ANM2 *)(piVar3 + -0xd),pbStack_20,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(piVar3 + -1)); *(undefined1 *)(piVar3 + 4) = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = pbStack_20; do { bVar1 = *curAnimName; isLess = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00616b67: uVar2 = -(uint)isLess | 1; goto LAB_00616b6c; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00616b67; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00616b6c: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((char)piVar3[4] == '\0')))) goto LAB_00616b7a; } piVar3[0x34] = (int)walkAnimSpeed; } else { bVar1 = ANM2::SetAnimation((ANM2 *)(piVar3 + -0xd),pbStack_20,1); if (((bVar1 != 0) && (*piVar3 != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(piVar3 + -1),0.0), *piVar3 != 0)) { *(undefined1 *)(piVar3 + 4) = 0; } } } partSlot = partSlot + 1; piVar3 = piVar3 + 0x45; partsLeft = partsLeft + -1; } while (partsLeft != 0); } partAnimState = (AnimationState *)(bodyData + 0x148); piVar3 = (int *)(bodyData + 0x568); pbStack_20 = (byte *)0x4; do { if ((-1 < *piVar3) && (*(char *)((int)&partAnimState[6]._currentlyTriggeredEvents + 1) != '\0')) { AnimationState::Update(partAnimState); AnimationState::Update(partAnimState + 1); } piVar3 = piVar3 + 1; partAnimState = (AnimationState *)&partAnimState[8]._isPlaying; pbStack_20 = (byte *)((int)pbStack_20 + -1); } while (pbStack_20 != (byte *)0x0); if (*(char *)(bodyData + 0x10d) != '\0') { AnimationState::Update((AnimationState *)(bodyData + 0x34)); AnimationState::Update((AnimationState *)(bodyData + 0x54)); } uVar2 = Random(); if ((uVar2 & 3) == 0) { uVar2 = Random(); fVar7 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; uVar2 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,7,&familiar->_pos,&g_vectorZero,(Entity *)familiar,0,uVar2,0); piVar3 = (int *)__RTDynamicCast(spawnedEffect,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); piVar3[0x39] = (int)fVar7; piVar3[0x3a] = (int)fVar7; (**(code **)(*piVar3 + 0xc))(); return; } return; } //@@ 00616db0 Entity_Familiar::ai_walker /* DB: Entity_Familiar::Update cases 0x2b-0x2f/0x38/0x46-0x48 (Cube of Meat 3-4, Ball of Bandages 3-4, Leech 0x38 from item 0x10e); anims Attack/Move Down-Hori-Up, WalkHori/WalkVert, PickEnemyTarget + PathFinder::FindGridPath */ void __thiscall Entity_Familiar::ai_walker(Entity_Familiar *this) { int iVar1; byte bVar2; int *piVar3; undefined4 *puVar4; Entity *bloodSplat; byte *animNameChar; byte *pbVar5; byte *animNameChar; char *animName; EntityPtr EVar7; uint uVar8; bool bVar9; float fVar10; float deltaX; float fVar11; undefined4 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; EntityList_EL sameVariantList; Vector targetPos; undefined4 targetIndex; EntityPtr local_1c; EntityPtr local_18; bool isChasingTarget; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6a5d; local_10 = ExceptionList; ExceptionList = &local_10; targetPos.x = *(float *)((int)this->_player + 0x33c); targetPos.y = *(float *)((int)this->_player + 0x340); if (this->_variant == 0x38) { EVar7 = this->_parent; if (EVar7 == (EntityPtr)0x0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&sameVariantList,this->_type,0x38,-1,0, 0); local_8 = 0; uVar8 = 0; if (sameVariantList._size != 0) { do { EVar7 = *(EntityPtr *)((int)sameVariantList._data + uVar8 * 4); if (((*(byte *)((int)EVar7 + 0x172) != 0) && (*(EntityPtr *)((int)EVar7 + 0x3bc) != (EntityPtr)0x0)) && (*(EntityPtr *)((int)EVar7 + 0x3c0) == (EntityPtr)0x0)) { local_1c = EVar7; if (this->_parent != (EntityPtr)0x0) { local_18 = (EntityPtr)&this->_parent; std::multiset::erase(&local_18); } this->_parent = local_1c; if (local_1c != (EntityPtr)0x0) { std::multiset::insert(&this->_parent); } local_18 = (EntityPtr)(*(int *)((int)sameVariantList._data + uVar8 * 4) + 0x3c0); if (*(EntityPtr *)local_18 != (EntityPtr)0x0) { local_1c = local_18; std::multiset::erase(&local_1c); } *(Entity_Familiar **)local_18 = this; std::multiset::insert(local_18); iVar1 = *(int *)((int)sameVariantList._data + uVar8 * 4); targetPos.x = *(float *)(iVar1 + 0x33c); targetPos.y = *(float *)(iVar1 + 0x340); break; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)sameVariantList._size); } if ((this->_parent == (EntityPtr)0x0) && (this->_parent = (EntityPtr)this->_player, (EntityPtr)this->_player != (EntityPtr)0x0)) { std::multiset::insert(&this->_parent); } if (sameVariantList._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,sameVariantList._data,0); } } else { targetPos.x = *(float *)((int)EVar7 + 0x33c); targetPos.y = *(float *)((int)EVar7 + 0x340); } } local_8 = 0xffffffff; if ((1 < *(int *)&g_game->_deathmatchManager) && (this->_target != (EntityPtr)0x0)) { local_1c = *(EntityPtr *)((int)this->_target + 0x20); piVar3 = map_find_value(&this[1]._pendingDamageFlags,(uint)&local_1c); if (0x1c1 < *piVar3) { targetIndex = *(undefined4 *)((int)this->_target + 0x20); puVar4 = map_find_value(&this[1]._pendingDamageFlags,(uint)&targetIndex); *puVar4 = 0xfffffc7c; } } PickEnemyTarget(this,this->_collisionDamage * 15.0 + 65.0,8,0,&g_vectorZero,15.0); EVar7 = this->_target; isChasingTarget = false; if (EVar7 == (EntityPtr)0x0) { fVar11 = 6400.0; } else { targetPos.x = *(float *)((int)EVar7 + 0x33c); fVar11 = 0.0; targetPos.y = *(float *)((int)EVar7 + 0x340); } fVar10 = targetPos.y - (this->_pos).y; deltaX = targetPos.x - (this->_pos).x; if (fVar11 < fVar10 * fVar10 + deltaX * deltaX) { iVar1 = this->_variant; if ((iVar1 == 0x2f) || (iVar1 == 0x38)) { fVar11 = 2.2; } else { fVar11 = 1.8; } if ((1 < *(int *)&g_game->_deathmatchManager) && (iVar1 == 0x2f)) { fVar11 = 2.0; } PathFinder::FindGridPath((PathFinder *)&this->_pathfinder,&targetPos,fVar11 * 0.83,0,1); isChasingTarget = this->_target != (EntityPtr)0x0; } if (((this->_variant == 0x2e) || (this->_variant == 0x2f)) && (uVar8 = Random(), (uVar8 & 3) == 0) ) { uVar8 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; bloodSplat = Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar8); piVar3 = (int *)__RTDynamicCast(bloodSplat,uVar12,pTVar13,pTVar14,uVar15); uVar8 = Random(); fVar11 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.1; piVar3[0x39] = (int)fVar11; piVar3[0x3a] = (int)fVar11; (**(code **)(*piVar3 + 0xc))(); } local_1c = (EntityPtr)this->_variant; this->_friction = this->_friction * 0.85; fVar11 = (this->_velocity).x; fVar10 = (this->_velocity).y; fVar11 = sqrtf(fVar11 * fVar11 + fVar10 * fVar10); if (fVar11 < 2.0) { if (local_1c == (EntityPtr)0x38) { if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_10; return; } AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); ExceptionList = local_10; return; } pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { animNameChar = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { animNameChar = *(byte **)pbVar5; } animNameChar = s_Idle; do { bVar2 = *animNameChar; bVar9 = bVar2 < *animNameChar; if (bVar2 != *animNameChar) { LAB_00617225: uVar8 = -(uint)bVar9 | 1; goto LAB_0061722a; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar9 = bVar2 < animNameChar[1]; if (bVar2 != animNameChar[1]) goto LAB_00617225; animNameChar = animNameChar + 2; animNameChar = animNameChar + 2; } while (bVar2 != 0); uVar8 = 0; LAB_0061722a: if (uVar8 == 0) { if (pbVar5[0x34] == 0) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._isPlaying != 0) { ExceptionList = local_10; return; } } } EVar7 = (EntityPtr)s_Idle; goto LAB_0061748d; } fVar11 = (this->_velocity).y; if (ABS(fVar11) < ABS((this->_velocity).x)) { if (this->_variant == 0x38) { animName = "Attack Hori"; if (isChasingTarget == false) { animName = "Move Hori"; } pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } EVar7 = (EntityPtr)animName; do { bVar2 = *pbVar5; bVar9 = bVar2 < *(byte *)EVar7; if (bVar2 != *(byte *)EVar7) { LAB_006172c4: uVar8 = -(uint)bVar9 | 1; goto LAB_006172c9; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < *(byte *)((int)EVar7 + 1); if (bVar2 != *(byte *)((int)EVar7 + 1)) goto LAB_006172c4; pbVar5 = pbVar5 + 2; EVar7 = (EntityPtr)((int)EVar7 + 2); } while (bVar2 != 0); uVar8 = 0; LAB_006172c9: if ((uVar8 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00617356; } local_18 = (EntityPtr)animName; } else { pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } animName = "WalkHori"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00617320: uVar8 = -(uint)bVar9 | 1; goto LAB_00617325; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00617320; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar8 = 0; LAB_00617325: if ((uVar8 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00617356; } animName = "WalkHori"; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00617356: (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; ExceptionList = local_10; return; } pbVar5 = (this->_sprite)._animState._animData; if (this->_variant != 0x38) { if (pbVar5 != (byte *)0x0) { animNameChar = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { animNameChar = *(byte **)pbVar5; } animName = "WalkVert"; do { bVar2 = *animNameChar; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00617473: uVar8 = -(uint)bVar9 | 1; goto LAB_00617478; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00617473; animNameChar = animNameChar + 2; animName = animName + 2; } while (bVar2 != 0); uVar8 = 0; LAB_00617478: if (uVar8 == 0) { if (pbVar5[0x34] == 0) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._isPlaying != 0) { ExceptionList = local_10; return; } } } EVar7 = (EntityPtr)"WalkVert"; goto LAB_0061748d; } if (isChasingTarget == false) { local_18 = (EntityPtr)0xb605fc; if (fVar11 <= 0.0) { local_18 = (EntityPtr)0xb60608; } if (pbVar5 != (byte *)0x0) { animNameChar = pbVar5; EVar7 = local_18; if (0xf < *(uint *)(pbVar5 + 0x14)) { animNameChar = *(byte **)pbVar5; } do { bVar2 = *animNameChar; bVar9 = bVar2 < *(byte *)EVar7; if (bVar2 != *(byte *)EVar7) goto LAB_006173d2; if (bVar2 == 0) goto LAB_006173ce; bVar2 = animNameChar[1]; bVar9 = bVar2 < *(byte *)((int)EVar7 + 1); if (bVar2 != *(byte *)((int)EVar7 + 1)) goto LAB_006173d2; animNameChar = animNameChar + 2; EVar7 = (EntityPtr)((int)EVar7 + 2); } while (bVar2 != 0); uVar8 = 0; goto LAB_006173d7; } } else { local_18 = (EntityPtr)0xb60574; if (fVar11 <= 0.0) { local_18 = (EntityPtr)0xb605b8; } if (pbVar5 != (byte *)0x0) { animNameChar = pbVar5; EVar7 = local_18; if (0xf < *(uint *)(pbVar5 + 0x14)) { animNameChar = *(byte **)pbVar5; } do { bVar2 = *animNameChar; bVar9 = bVar2 < *(byte *)EVar7; if (bVar2 != *(byte *)EVar7) goto LAB_006173d2; if (bVar2 == 0) break; bVar2 = animNameChar[1]; bVar9 = bVar2 < *(byte *)((int)EVar7 + 1); if (bVar2 != *(byte *)((int)EVar7 + 1)) goto LAB_006173d2; animNameChar = animNameChar + 2; EVar7 = (EntityPtr)((int)EVar7 + 2); } while (bVar2 != 0); LAB_006173ce: uVar8 = 0; LAB_006173d7: if (uVar8 == 0) { if (pbVar5[0x34] == 0) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._isPlaying != 0) { ExceptionList = local_10; return; } } } } EVar7 = local_18; LAB_0061748d: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)EVar7,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } ExceptionList = local_10; return; LAB_006173d2: uVar8 = -(uint)bVar9 | 1; goto LAB_006173d7; } //@@ 006174c0 Entity_Familiar::ai_charger /* DB: Entity_Familiar::Update cases 3/0x19/0x3b/0x68/0x82/0xd5/0xd6/0xdf/0xe8 (Little Chubby, Bobs Brain, Big Chubby, Jaw Bone, Knife Piece 1/2, Knife Full, Lil Portal per CheckFamiliar item ids); anims Float*/Hit*/Throw/Touched/Charge3 */ void __thiscall Entity_Familiar::ai_charger(Entity_Familiar *this) { void *pvVar1; byte bVar2; char isFiring; Entity *umbilicalWhip; Vector *pVVar3; byte *currentAnimName; uint uVar4; undefined4 uVar5; int iVar6; Entity_Player *player; RNG *collectibleRng; EntityPtr *chargeLevelPtr; Vector *pVVar7; float *collisionPoint; EntityPtr *nonNegativeLevelPtr; float *extraout_ECX; int iVar8; bool bVar9; float fVar10; undefined1 in_XMM0 [16]; float fVar11; EntityPtr EVar12; EntityPtr EVar13; float velocityX; EntityRef sourceRef; EntityList_EL entityList; Vector scratchVec; undefined1 local_40 [12]; EntityPtr local_34; EntityPtr local_30; Vector local_2c; EntityPtr local_24; EntityPtr local_20; Vector local_1c; char isNoOtherCharging; byte isLilithIncubus; void *local_10; undefined1 *puStack_c; undefined4 local_8; char *animName; GridEntity_Door *door; Game *game; Manager *manager; int *queriedEntity; Room *room; RoomDescriptor *roomDesc; ANM2 *sprite; local_8 = 0xffffffff; puStack_c = &LAB_00af6aa9; local_10 = ExceptionList; ExceptionList = &local_10; local_20 = (EntityPtr)this; isLilithIncubus = IsLilithBirthrightIncubus(this); if (this->_subtype != 0) { this->_entityCollisionClass = 0; if (((this->_variant == 0x19) && ((this->_sprite)._animState._animData != (void *)0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { this->_friction = this->_friction * 0.3; if (isLilithIncubus == 0) goto LAB_006189fb; } else { this->_visible = 0; } FollowParent(this); LAB_006189fb: uVar4 = this->_subtype; if (3 < uVar4) { this->_subtype = 0; iVar6 = 0x3c; if (this->_variant != 0x3b) { iVar6 = 0; } this->_fireCooldown = iVar6; ANM2::Play(&this->_sprite,(byte *)"Appear",0); ExceptionList = local_10; return; } if (((this->_variant != 0xe8) && (uVar4 != 0)) && (iVar6 = this->_state, this->_state = iVar6 + 1, 300 < iVar6)) { if (uVar4 == 1) { uVar4 = Random(); Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); uVar4 = this->_subtype; } this->_subtype = uVar4 + 1; } ExceptionList = local_10; return; } this->_visible = 1; this->_state = 0; local_24 = *(EntityPtr *)((int)this->_player + 0x162c); Isaac::GetAxisAlignedUnitVectorFromDir(&local_1c,(int)local_24); TryAimAtMarkedTarget(this,&local_1c,(int *)&local_24,(Vector *)0x0); if (this->_fireCooldown < 0) { if (((isLilithIncubus != 0) && (umbilicalWhip = get_incubus_umbilical_whip(this), umbilicalWhip != (Entity *)0x0)) && (fVar10 = umbilicalWhip[3]._sprite._championColor._colorize[2], fVar10 != -NAN)) { pVVar3 = Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,(int)fVar10); (this->_velocity).x = pVVar3->x; (this->_velocity).y = pVVar3->y; } iVar6 = this->_variant; if (iVar6 == 0x82) { animName = "Throw"; } else { if (iVar6 == 0xe8) { local_30 = (EntityPtr)0x0; local_24 = (EntityPtr)0x3; uVar4 = (g_game->_stage + 1) * 100; if (0x4b0 < (int)uVar4) { uVar4 = 0x4b0; } local_2c.y = (float)(this->_coins / (int)(uVar4 >> 2)); nonNegativeLevelPtr = &local_30; if (-1 < (int)local_2c.y) { nonNegativeLevelPtr = (EntityPtr *)&local_2c.y; } chargeLevelPtr = &local_24; if ((int)*nonNegativeLevelPtr < 4) { chargeLevelPtr = nonNegativeLevelPtr; } EVar12 = *chargeLevelPtr; ANM2::Play(&this->_sprite,(&PTR_s_Charge0_00b648f0)[(int)EVar12],0); fVar10 = (float)(int)EVar12; (**(code **)(*(int *)this + 0x40))(fVar10 + fVar10 + 2.0); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&entityList,&this->_pos,this->_size, 0x10); local_8 = 0; local_30 = (EntityPtr)0x0; if ((undefined1 *)entityList._size != (undefined1 *)0x0) { iVar6 = g_forceCollideDepth; do { queriedEntity = *(int **)((int)entityList._data + (int)local_30 * 4); if (((queriedEntity != (int *)0x0) && (queriedEntity[10] == 5)) && ((((iVar8 = queriedEntity[0xb], iVar8 == 10 || (((((iVar8 == 0x14 || (iVar8 == 0x5a)) || (iVar8 == 0x28)) || ((iVar8 == 0x1e || (iVar8 == 0x46)))) || (iVar8 == 300)))) || ((((iVar8 == 0x15e || (iVar8 == 0x45)) || (iVar8 == 0x29)) || (iVar8 == 0x2a)))) && (queriedEntity[0x14d] == 0)))) { g_forceCollideDepth = iVar6 + 1; (**(code **)(*(int *)this + 0x5c))(queriedEntity,1); (**(code **)(*queriedEntity + 0x5c))(this,0); iVar6 = g_forceCollideDepth + -1; g_forceCollideDepth = iVar6; } local_30 = (EntityPtr)((int)local_30 + 1); } while ((uint)local_30 < (uint)entityList._size); } local_8 = 0xffffffff; if (entityList._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,entityList._data,0); local_8 = 0xffffffff; } goto LAB_006177c3; } fVar10 = (this->_velocity).x; fVar11 = (this->_velocity).y; if (ABS(fVar11) < ABS(fVar10)) { if (((iVar6 == 3) || (iVar6 == 0x68)) || ((iVar6 == 0xdf && (this->_fireCooldown == -1)))) { ANM2::Play(&this->_sprite,(byte *)"FloatShootSide",0); fVar10 = (this->_velocity).x; } (this->_sprite)._flipX = fVar10 < 0.0; goto LAB_006177c3; } if (((iVar6 != 3) && (iVar6 != 0x68)) && ((iVar6 != 0xdf || (this->_fireCooldown != -1)))) goto LAB_006177c3; animName = "FloatShootUp"; if (0.0 <= fVar11) { animName = "FloatShootDown"; } } ANM2::Play(&this->_sprite,(byte *)animName,0); LAB_006177c3: if (this->_variant == 0x82) { EVar13 = this->_target; EVar12 = (EntityPtr)&this->_target; pVVar3 = &this->_pos; local_30 = EVar12; if (EVar13 == (EntityPtr)0x0) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_40,pVVar3, this->_size,0x10); EVar13 = local_30; local_8 = 2; local_24 = (EntityPtr)0x0; if (local_34 != (EntityPtr)0x0) { do { EVar12 = *(EntityPtr *)(local_40._4_4_ + (int)local_24 * 4); local_1c.y = (float)EVar12; if ((((EVar12 != (EntityPtr)0x0) && (*(int *)((int)EVar12 + 0x28) == 5)) && (((((iVar6 = *(int *)((int)EVar12 + 0x2c), iVar6 == 10 || (((iVar6 == 0x14 || (iVar6 == 0x5a)) || (iVar6 == 0x28)))) || (((iVar6 == 0x1e || (iVar6 == 0x46)) || (iVar6 == 300)))) || ((iVar6 == 0x15e || (iVar6 == 0x45)))) || ((iVar6 == 0x29 || (iVar6 == 0x2a)))))) && (*(int *)((int)EVar12 + 0x534) == 0)) { if ((iVar6 == 0x14) && (*(int *)((int)EVar12 + 0x30) == 6)) { if ((*(int *)((int)EVar12 + 0x7c) != 0) && (*(char *)((int)EVar12 + 0x8c) != '\0')) { currentAnimName = *(byte **)((int)EVar12 + 0x7c); if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } animName = "Touched"; do { bVar2 = *currentAnimName; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00617920: uVar4 = -(uint)bVar9 | 1; goto LAB_00617925; } if (bVar2 == 0) break; bVar2 = currentAnimName[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00617920; currentAnimName = currentAnimName + 2; animName = animName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00617925: if (uVar4 == 0) goto LAB_006179e0; } local_2c.y = (float)((int)EVar12 + 0x48); currentAnimName = *(byte **)((int)EVar12 + 0x7c); if (currentAnimName == (byte *)0x0) { LAB_00617990: bVar2 = ANM2::SetAnimation((ANM2 *)((int)EVar12 + 0x48),(byte *)"Touched",1); fVar10 = local_2c.y; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)local_2c.y + 0x30)); *(undefined1 *)((int)fVar10 + 0x44) = 1; EVar12 = (EntityPtr)local_1c.y; } } else { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } animName = "Touched"; do { bVar2 = *currentAnimName; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_00617970: uVar4 = -(uint)bVar9 | 1; goto LAB_00617975; } if (bVar2 == 0) break; bVar2 = currentAnimName[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_00617970; currentAnimName = currentAnimName + 2; animName = animName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00617975: if ((uVar4 != 0) || ((*(char *)(*(int *)((int)EVar12 + 0x7c) + 0x34) != '\0' && (*(char *)((int)EVar12 + 0x8c) == '\0')))) goto LAB_00617990; } *(undefined4 *)((int)EVar12 + 0x54c) = 10; } else { if (*(uint *)EVar13 != 0) { local_2c.y = (float)EVar13; std::multiset::erase(&local_2c.y); } *(EntityPtr *)EVar13 = EVar12; std::multiset::insert(EVar13); } } LAB_006179e0: local_24 = (EntityPtr)((int)local_24 + 1); } while ((uint)local_24 < (uint)local_34); EVar12 = local_30; this = (Entity_Familiar *)local_20; } if (local_40[0] == '\0') { local_8 = 3; tracked_alloc(1,(void *)local_40._4_4_,0); } local_8 = 0xffffffff; pVVar3 = (Vector *)((int)this + 0x33c); } else { *(float *)((int)EVar13 + 0x33c) = pVVar3->x; *(float *)((int)EVar13 + 0x340) = (this->_pos).y; EVar13 = *(EntityPtr *)EVar12; *(float *)((int)EVar13 + 0x360) = (this->_velocity).x; *(float *)((int)EVar13 + 0x364) = (this->_velocity).y; *(undefined4 *)((int)*(EntityPtr *)EVar12 + 0x184) = 0; } if (*(int *)((int)this + 0xd4c) == -2) { local_2c.y = *(float *)((int)*(void **)((int)this + 0x410) + 0x340) - pVVar3->y; local_30 = (EntityPtr)(*(float *)((int)*(void **)((int)this + 0x410) + 0x33c) - pVVar3->x); local_24 = (EntityPtr)(local_2c.y * local_2c.y + (float)local_30 * (float)local_30); if ((float)local_24 < 1600.0) { uVar4 = *(uint *)EVar12; *(int *)((int)this + 0xd4c) = 0x1e; if (uVar4 != 0) { uVar5 = 3; if (isLilithIncubus != 0) { uVar5 = 0; } *(undefined4 *)(uVar4 + 0x184) = uVar5; if (*(uint *)EVar12 != 0) { local_20 = EVar12; std::multiset::erase(&local_20); } *(uint *)EVar12 = 0; } iVar6 = Entity::get_velocity_direction((Entity *)this); sprite = (ANM2 *)((int)this + 0x48); if (iVar6 == 3) { ANM2::Play(sprite,(byte *)"FloatDown",0); } else if (iVar6 == 1) { ANM2::Play(sprite,(byte *)"FloatUp",0); } else { ANM2::Play(sprite,(byte *)"FloatSide",0); *(bool *)((int)this + 0x148) = iVar6 == 0; } } fVar10 = sqrtf((float)local_24); EVar12 = local_30; EVar13 = (EntityPtr)local_2c.y; if (0.0 < fVar10) { EVar12 = (EntityPtr)((float)local_30 * (1.0 / fVar10)); EVar13 = (EntityPtr)(local_2c.y * (1.0 / fVar10)); } ((Vector *)((int)this + 0x360))->x = (float)EVar12 * 10.0; *(float *)((int)this + 0x364) = (float)EVar13 * 10.0; *(int *)((int)this + 0x188) = 4; } else { if ((((*(byte *)((int)this + 400) != 0) || (bVar2 = Room::IsPositionInRoom(g_game->_room,pVVar3,-100.0), bVar2 == 0)) || (*(uint *)EVar12 != 0)) && (bVar2 = IsLilithBirthrightIncubus(this), bVar2 == 0)) { *(int *)((int)this + 0x184) = 0; ((Vector *)((int)this + 0x360))->x = ((Vector *)((int)this + 0x360))->x * 0.5; *(float *)((int)this + 0x364) = *(float *)((int)this + 0x364) * 0.5; *(int *)((int)this + 0xd4c) = -2; } *(int *)((int)this + 0x188) = 4; } } else if (this->_variant == 0xdf) { iVar6 = this->_fireCooldown; if (iVar6 == -3) { fVar10 = (this->_sprite)._color._tint[3] - 0.1; if (fVar10 <= 0.0) { fVar10 = 0.0; } (this->_sprite)._color._tint[3] = fVar10; if (fVar10 <= 0.0) { (**(code **)(*(int *)this + 0x28))(); uVar4 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar4); if (player->_variant == 0) { player->_cacheFlags = player->_cacheFlags | 0x200; (player->_temporaryeffects)._shouldEvaluateCache = 1; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } } else if (iVar6 == -2) { fVar10 = (this->_targetPosition).y; fVar11 = (this->_pos).y; (this->_velocity).x = (this->_targetPosition).x - (this->_pos).x; (this->_velocity).y = fVar10 - fVar11; if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { this->_fireCooldown = 0x1e; } } else if (iVar6 == -1) { iVar6 = 0x194; this->_entityCollisionClass = 3; if (isLilithIncubus != 0) { iVar6 = 0x360; } local_40._8_4_ = *(EntityPtr *)((int)(&(this->_sprite)._filename + -3) + iVar6); local_34 = *(EntityPtr *)((this->_sprite)._filename._buf + iVar6 + -0x44); local_30 = local_34; local_24 = (EntityPtr)local_40._8_4_; if ((isLilithIncubus == 0) && ((this->_collidesWithGrid == 0 || (pVVar3 = Vector::Normalized((Vector *)(local_40 + 8),&local_2c), pVVar3->y * (this->_gridCollisionNormal).y + (this->_gridCollisionNormal).x * pVVar3->x <= 0.45)))) { local_30 = (EntityPtr)(this->_velocity).x; local_2c.y = (this->_velocity).y; fVar10 = sqrtf((float)local_30 * (float)local_30 + local_2c.y * local_2c.y); if (17.0 <= fVar10) { ExceptionList = local_10; return; } if (0.0 < fVar10) { (this->_velocity).x = (float)local_30 * (17.0 / fVar10); (this->_velocity).y = local_2c.y * (17.0 / fVar10); ExceptionList = local_10; return; } ExceptionList = local_10; return; } EVar12 = local_20; collisionPoint = (this->_collisionPoints)._begin; local_34 = (EntityPtr)((int)(this->_collisionPoints)._end - (int)collisionPoint >> 3); local_1c.y = 0.0; if (local_34 != (EntityPtr)0x0) { pVVar7 = &this->_pos; pVVar3 = &this->_pos; local_2c.y = (float)g_game->_room; do { iVar8 = (int)((((float)local_24 + pVVar3->x + *collisionPoint) - 40.0) / 40.0 + 0.5); iVar6 = (int)((((float)local_30 + pVVar7->y + collisionPoint[1]) - 120.0) / 40.0 + 0.5); if (-1 < iVar8) { if (((((iVar8 < (int)*(void **)((int)local_2c.y + 0xc)) && (-1 < iVar6)) && (this = (Entity_Familiar *)local_20, iVar6 < (int)*(void **)((int)local_2c.y + 0x10))) && ((uVar4 = (int)*(void **)((int)local_2c.y + 0xc) * iVar6 + iVar8, uVar4 < 0x1c0 && (door = (GridEntity_Door *)((int *)((int)local_2c.y + 0x24))[uVar4], door != (GridEntity_Door *)0x0)))) && ((door->_desc)._type == 0x10)) { this = (Entity_Familiar *)EVar12; if ((((door->_desc)._variant == 3) && (iVar6 = GridEntity_Door::get_secret_exit_kind(door), iVar6 == 4)) && (bVar2 = GridEntity_Door::TryBlowOpen(door,0,(Entity *)EVar12), bVar2 != 0)) { *(int *)((int)EVar12 + 0x184) = 0; *(int *)((int)EVar12 + 0xd4c) = -3; ((Vector *)((int)EVar12 + 0x360))->x = (float)local_24; *(EntityPtr *)((int)EVar12 + 0x364) = local_30; fVar10 = ((Vector *)((int)EVar12 + 0x360))->x; fVar11 = ((Vector *)((int)EVar12 + 0x33c))->x; *(float *)((int)EVar12 + 0x340) = (float)local_30 * *(float *)((int)EVar12 + 0x39c) + *(float *)((int)EVar12 + 0x340); ((Vector *)((int)EVar12 + 0x33c))->x = *(float *)((int)EVar12 + 0x39c) * fVar10 + fVar11; bVar2 = Entity_Player::HasCollectible(*(void **)((int)EVar12 + 0x410),0x272,0); if (bVar2 == 0) { player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x272, (RNG **)&g_game->_playerManager,0); } else { player = *(void **)((int)EVar12 + 0x410); } if (player != (Entity_Player *)0x0) { Entity_Player::RemoveCollectible(player,0x272,0,0,1); } bVar2 = Entity_Player::HasCollectible(*(void **)((int)EVar12 + 0x410),0x273,0); if (bVar2 == 0) { player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x273, (RNG **)&g_game->_playerManager,0); } else { player = *(void **)((int)EVar12 + 0x410); } if (player != (Entity_Player *)0x0) { Entity_Player::RemoveCollectible(player,0x273,0,0,1); } goto LAB_00618228; } break; } } local_1c.y = (float)((int)local_1c.y + 1); collisionPoint = collisionPoint + 2; } while ((uint)local_1c.y < (uint)local_34); } bVar2 = IsLilithBirthrightIncubus(this); if (bVar2 == 0) { *(int *)((int)this + 0x188) = 0; *(int *)((int)this + 0x184) = 0; bVar2 = Vector::operator_eq((Vector *)((int)this + 0x19c),&g_vectorZero); if (bVar2 == 0) { if (ABS((float)local_30) < ABS((float)local_24)) { ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)"HitSide",0); *(bool *)((int)this + 0x148) = (float)local_24 < 0.0; } else { animName = "HitDown"; if ((float)local_30 < 0.0) { animName = "HitUp"; } ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)animName,0); } manager = g_manager; ((Vector *)((int)this + 0x334))->x = ((Vector *)((int)this + 0x33c))->x; *(float *)((int)this + 0x338) = *(float *)((int)this + 0x340); ((Vector *)((int)this + 0x360))->x = g_vectorZero.x; *(float *)((int)this + 0x364) = g_vectorZero.y; local_30 = (EntityPtr)0xcd; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,2,0,1.0,0.0); *(int *)((int)this + 0xd4c) = -2; } else { *(int *)((int)this + 0xd4c) = 0x1e; } } } } else { if (((this->_collidesWithGrid != 0) || (this->_fireCooldown < -1)) || (bVar2 = Room::IsPositionInRoom(g_game->_room,&this->_pos,-100.0), bVar2 == 0)) { bVar2 = IsLilithBirthrightIncubus(this); game = g_game; if (bVar2 == 0) { this->_entityGridCollisionClass = 0; room = game->_room; iVar6 = Room::GetGridIndex(room,(Vector *)((int)local_20 + 0x33c)); EntityRef::constructor(&sourceRef,*(void **)((int)local_20 + 0x410)); Room::DamageGridWithSource(room,iVar6,1,&sourceRef); ((Vector *)((int)local_20 + 0x360))->x = ((Vector *)((int)local_20 + 0x360))->x * 0.5; *(float *)((int)local_20 + 0x364) = *(float *)((int)local_20 + 0x364) * 0.5; *(int *)((int)local_20 + 0xd4c) = *(int *)((int)local_20 + 0xd4c) - 1; this = (Entity_Familiar *)local_20; if (*(int *)((int)local_20 + 0xd4c) < -10) { *(uint *)((int)local_20 + 0xd4c) = 0x1e; } } } *(uint *)((int)this + 0x188) = (*(int *)((int)this + 0x2c) == 0x68) + 3; } LAB_00618228: if (isLilithIncubus == 0) { ExceptionList = local_10; return; } FollowParent(this); umbilicalWhip = get_incubus_umbilical_whip(this); if (umbilicalWhip == (Entity *)0x0) { *(int *)((int)this + 0xd4c) = 0x1e; ExceptionList = local_10; return; } ExceptionList = local_10; return; } FollowParent(this); iVar6 = this->_variant; if (iVar6 == 0x82) { fVar10 = (this->_velocity).y; fVar11 = (this->_velocity).x; if (4.0 < fVar11 * fVar11 + fVar10 * fVar10) { iVar6 = Entity::get_velocity_direction((Entity *)this); sprite = &this->_sprite; if (iVar6 == 3) { ANM2::Play(sprite,(byte *)"FloatDown",0); } else { if (iVar6 != 1) { ANM2::Play(sprite,(byte *)"FloatSide",0); bVar9 = iVar6 == 0; goto LAB_006185e8; } ANM2::Play(sprite,(byte *)"FloatUp",0); } } } else if (iVar6 == 0xe8) { iVar6 = (g_game->_stage + 1) * 100; if (0x4b0 < iVar6) { iVar6 = 0x4b0; } if ((((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0) || (g_game->field_0x188f8 != '\0')) || ((this->_coins < iVar6 || (fVar10 = (this->_velocity).y, fVar11 = (this->_velocity).x, 400.0 <= fVar11 * fVar11 + fVar10 * fVar10)))) { pvVar1 = (this->_sprite)._animState._animData; if (((pvVar1 == (void *)0x0) || (*(char *)((int)pvVar1 + 0x34) != '\0')) || ((this->_sprite)._animState._isPlaying == 0)) { uVar4 = g_game->_stage * 200; local_34 = (EntityPtr)0x0; local_2c.y = 4.2039e-45; if (0x4b0 < (int)uVar4) { uVar4 = 0x4b0; } local_30 = (EntityPtr)(this->_coins / (int)(uVar4 >> 2)); nonNegativeLevelPtr = &local_34; if (-1 < (int)local_30) { nonNegativeLevelPtr = &local_30; } chargeLevelPtr = (EntityPtr *)&local_2c.y; if ((int)*nonNegativeLevelPtr < 4) { chargeLevelPtr = nonNegativeLevelPtr; } ANM2::Play(&this->_sprite,(&PTR_DAT_00b648e0)[(int)*chargeLevelPtr],0); } } else { iVar6 = g_game->_currentRoomIdx; if ((((iVar6 != -0x14) && (iVar6 != -0x12)) && (iVar6 != -0xd)) && (((iVar6 != -4 && (iVar6 != -6)) && (iVar6 != -0x13)))) { ANM2::Play(&this->_sprite,s_Spawn,0); bVar2 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if (bVar2 != 0) { Room::FindFreePickupSpawnPosition(g_game->_room,&local_2c,&this->_pos,0.0,0,0,1); manager = g_manager; this->_coins = 0; local_30 = (EntityPtr)0x10c; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,2,0,1.0,0.0); game = g_game; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1 )) { local_8 = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)game->_currentDimensionIdx < 3) { roomDesc = game->_roomList + 0x20e; } roomDesc->Flags = roomDesc->Flags | 0x20000; collectibleRng = Entity_Player::GetCollectibleRNG(this->_player,0x2a9); uVar4 = RNG::Next(collectibleRng); Game::Spawn(g_game,1000,0xa1,&local_2c,&g_vectorZero,(Entity *)0x0,0x3d4,uVar4); game = g_game; this->_subtype = 1; game->field_0x188f8 = 1; } } } if ((this->_fireCooldown < 1) && (bVar2 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar2 != 0)) { local_1c.x = *extraout_ECX; local_1c.y = *(float *)(extraout_ECX + 1); local_24 = (EntityPtr)0x0; } } else if (((iVar6 == 0xd5) || (iVar6 == 0xd6)) || (iVar6 == 0xdf)) { ANM2::Play(&this->_sprite,s_Idle,0); fVar10 = (this->_velocity).x; FUN_0058e210(); if (in_XMM0._0_8_ != 0.0) { bVar9 = fVar10 < 0.0; LAB_006185e8: (this->_sprite)._flipX = bVar9; } } else { bVar2 = ANM2::IsPlaying(&this->_sprite,(byte *)"Float"); if (bVar2 == 0) { ANM2::Play(&this->_sprite,(byte *)"Float",0); } } if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } if (isLilithIncubus != 0) { this->_fireCooldown = 0; } if (((local_24 != (EntityPtr)0xffffffff) && (iVar6 = this->_variant, iVar6 != 0xd5)) && (iVar6 != 0xd6)) { if (iVar6 != 0x82) { (this->_sprite)._flipX = local_24 == (EntityPtr)0x0; } isNoOtherCharging = '\x01'; if (iVar6 == 0x3b) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,3,0x3b,-1,1,0); uVar4 = 0; local_8 = 5; if ((undefined1 *)entityList._size != (undefined1 *)0x0) { do { iVar6 = __RTDynamicCast(*(undefined4 *)((int)entityList._data + uVar4 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (((*(char *)(iVar6 + 0x172) != '\0') && (*(int *)(iVar6 + 0xd4c) < 0)) && (*(int *)(iVar6 + 0x30) == 0)) { isNoOtherCharging = '\0'; break; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)entityList._size); } if (entityList._0_1_ == '\0') { local_8 = 6; tracked_alloc(1,entityList._data,0); } local_8 = 0xffffffff; } if (this->_variant == 0xe8) { if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) { isFiring = '\0'; } else { if (0 < this->_fireCooldown) goto LAB_00618988; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; isFiring = '\x01'; } } else { isFiring = isNoOtherCharging; } if ((this->_fireCooldown < 1) && (isFiring != '\0')) { iVar6 = this->_variant; local_30 = (EntityPtr)0x41200000; if (iVar6 == 0x68) { local_30 = (EntityPtr)0x40400000; } else if (iVar6 == 0xdf) { local_30 = (EntityPtr)0x41880000; } this->_fireCooldown = -1; if (isLilithIncubus == 0) { if ((iVar6 == 0x82) || (iVar8 = 4, iVar6 == 0xdf)) { iVar8 = 3; } } else { iVar8 = 0; } this->_entityGridCollisionClass = iVar8; pVVar3 = &this->_velocity; pvVar1 = this->_player; velocityX = local_1c.x * (float)local_30; pVVar3->x = velocityX; (this->_velocity).y = local_1c.y * (float)local_30; fVar10 = *(float *)((int)pvVar1 + 0x360); fVar11 = *(float *)((int)pvVar1 + 0x364); if ((local_24 == (EntityPtr)0x0) || (local_24 == (EntityPtr)0x2)) { fVar10 = 0.0; } else { fVar11 = 0.0; } if (this->_variant == 0x68) { fVar11 = fVar11 * 0.2; velocityX = fVar10 * 0.2 + fVar10 * 0.2 + velocityX; pVVar3->x = velocityX; } else { fVar11 = fVar11 * 0.6; velocityX = fVar10 * 0.6 + fVar10 * 0.6 + velocityX; pVVar3->x = velocityX; } fVar10 = fVar11 + fVar11 + local_1c.y * (float)local_30; (this->_velocity).y = fVar10; if (fVar10 * fVar10 + velocityX * velocityX < (float)local_30 * (float)local_30) { pVVar7 = Vector::Normalized(pVVar3,&scratchVec); fVar10 = pVVar7->y; pVVar3->x = (float)local_30 * pVVar7->x; (this->_velocity).y = (float)local_30 * fVar10; } iVar6 = this->_variant; this->_friction = 1.0; if (iVar6 == 0x82) { if (this->_target != (EntityPtr)0x0) { local_34 = (EntityPtr)&this->_target; std::multiset::erase(&local_34); iVar6 = this->_variant; } this->_target = (EntityPtr)0x0; } manager = g_manager; if (iVar6 == 0x68) { local_30 = (EntityPtr)0x343; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,0x1c2,0,1.0,0.0); iVar6 = this->_variant; } manager = g_manager; if (iVar6 == 3) { local_30 = (EntityPtr)0x351; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,0x1c2,0,1.0,0.0); } } } LAB_00618988: iVar6 = 0; if (this->_variant == 0x82) { iVar6 = 4; } this->_entityCollisionClass = iVar6; ExceptionList = local_10; return; } //@@ 00618b00 FamiliarAI::gb_bug /* DB: Entity_Familiar::Update case 0x5d (93 GB_BUG); Collide/Float anims, Entity_Pickup::Morph + IsChest on hit pickups, FollowParent */ void __fastcall FamiliarAI::gb_bug(Entity_Familiar *familiar) { code *pcVar1; byte bVar2; void *pvVar3; byte *curAnimChar; Vector *normalizedVelocity; int iVar4; char *wantAnimChar; int extraout_EDX; uint uVar5; int iVar6; Entity_Pickup *rngSeed; bool isLess; float fVar7; float fVar8; float fVar9; EntityRef playerRef; undefined8 rngShifts; EntityList_EL nearbyEntities; Vector local_20; int local_18; byte isLilithIncubus; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; int *gridEntity; Manager *manager; byte rngShift1; byte rngShift2; byte rngShift3; Vector *velocity; local_8 = 0xffffffff; puStack_c = &LAB_00af6add; local_10 = ExceptionList; ExceptionList = &local_10; isLilithIncubus = Entity_Familiar::IsLilithBirthrightIncubus(familiar); if (familiar->_subtype != 0) { familiar->_entityCollisionClass = 0; familiar->_visible = 0; Entity_Familiar::FollowParent(familiar); if (1 < *(int *)&g_game->_deathmatchManager) { iVar4 = familiar->_fireCooldown; if (0 < iVar4) { iVar4 = iVar4 + -1; familiar->_fireCooldown = iVar4; } if (iVar4 == 0) { familiar->_subtype = 0; } } uVar5 = familiar->_subtype; if (3 < uVar5) { familiar->_subtype = 0; familiar->_fireCooldown = 0; ANM2::Play(&familiar->_sprite,(byte *)"Collide",0); ExceptionList = local_10; return; } if (uVar5 == 0) { ExceptionList = local_10; return; } if (familiar->_state < 1) { ExceptionList = local_10; return; } if (uVar5 == 1) { uVar5 = Random(); Game::Spawn(g_game,1000,0xf,&familiar->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); uVar5 = familiar->_subtype; } familiar->_subtype = uVar5 + 1; ExceptionList = local_10; return; } familiar->_visible = 1; familiar->_state = 0; if (familiar->_fireCooldown < 0) { if (isLilithIncubus != 0) { Entity_Familiar::FollowParent(familiar); familiar->_entityGridCollisionClass = 0; if (familiar->_visible == 0) { familiar->_fireCooldown = 1; ExceptionList = local_10; return; } } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&familiar->_pos, familiar->_size,0x10); uVar5 = 0; local_8 = 0; if (nearbyEntities._size != 0) { pvVar3 = nearbyEntities._data; do { local_20.y = *(float *)((int)pvVar3 + uVar5 * 4); if (((Entity_Pickup *)local_20.y != (Entity_Pickup *)0x0) && (((Entity_Pickup *)local_20.y)->_type == 5)) { iVar4 = ((Entity_Pickup *)local_20.y)->_variant; if (((((iVar4 == 10) || ((iVar4 == 0x14 || (iVar4 == 0x5a)))) || ((iVar4 == 0x28 || (((((iVar4 == 0x1e || (iVar4 == 0x46)) || (iVar4 == 300)) || ((iVar4 == 0x15e || (iVar4 == 0x45)))) || ((iVar4 == 0x29 || (iVar4 == 0x2a))))))) ) && ((((Entity_Pickup *)local_20.y)->_price == 0 && (((Entity_Pickup *)local_20.y)->_dead == 0)))) || ((bVar2 = Entity_Pickup::IsChest(iVar4), bVar2 != 0 && (*(int *)(extraout_EDX + 0x30) != 0)))) { uVar5 = Random(); Game::Spawn(g_game,1000,0xf,&familiar->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); manager = g_manager; familiar->_visible = 0; local_18 = 0x253; seed_fart_sound_override(&local_18); SoundEffects::Play(&manager->_sfxManager,local_18,1.0,2,0,1.0,0.0); fVar7 = local_20.y; game = g_game; familiar->_subtype = 1; if (1 < *(int *)&game->_deathmatchManager) { familiar->_fireCooldown = 300; } rngShifts = 0x500000009; rngSeed = *(Entity_Pickup **)((int)local_20.y + 0x3ec); local_18 = 0x19; bVar2 = Entity_Pickup::IsChest(*(int *)((int)local_20.y + 0x2c)); rngShift3 = (byte)local_18; rngShift1 = (byte)rngShifts; rngShift2 = (byte)((ulonglong)rngShifts >> 0x20); if (bVar2 == 0) { LAB_00618e4e: if (rngSeed == (Entity_Pickup *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = (uint)rngSeed >> (rngShift1 & 0x1f) ^ (uint)rngSeed; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; rngSeed = (Entity_Pickup *)(uVar5 >> (rngShift3 & 0x1f) ^ uVar5); local_20.y = (float)rngSeed; if (rngSeed == (Entity_Pickup *)(((uint)rngSeed / 10) * 10)) goto LAB_00618e97; iVar6 = 1; iVar4 = 0; } else { if (rngSeed == (Entity_Pickup *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = (uint)rngSeed >> (rngShift1 & 0x1f) ^ (uint)rngSeed; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; rngSeed = (Entity_Pickup *)(uVar5 >> (rngShift3 & 0x1f) ^ uVar5); if (rngSeed == (Entity_Pickup *)(((uint)rngSeed / 5) * 5)) goto LAB_00618e4e; LAB_00618e97: if (rngSeed == (Entity_Pickup *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = (uint)rngSeed >> (rngShift1 & 0x1f) ^ (uint)rngSeed; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; iVar4 = 0x32; if (((uVar5 >> (rngShift3 & 0x1f) ^ uVar5) & 3) == 0) { iVar4 = 0x3c; } iVar6 = 0; } Entity_Pickup::Morph ((Entity_Pickup *)fVar7,*(int *)((int)fVar7 + 0x28),iVar4,iVar6,1,0,0); if (nearbyEntities._0_1_ != '\0') { ExceptionList = local_10; return; } local_8 = 1; goto LAB_00618f0d; } pvVar3 = nearbyEntities._data; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)nearbyEntities._size); } game = g_game; if (((familiar->_collidesWithGrid != 0) || (familiar->_fireCooldown < -1)) || (bVar2 = Room::IsPositionInRoom(g_game->_room,&familiar->_pos,-100.0), bVar2 == 0)) { familiar->_entityGridCollisionClass = 0; fVar7 = 0.5; local_20.y = (float)game->_room; iVar4 = (int)(((familiar->_pos).x - 40.0) / 40.0 + 0.5); iVar6 = (int)(((familiar->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar4 < 0) || (pvVar3 = (((Entity_Pickup *)local_20.y)->_damageEvents)._end, (int)pvVar3 <= iVar4)) || ((iVar6 < 0 || ((int)(((Entity_Pickup *)local_20.y)->_damageEvents)._capacity <= iVar6)))) { EntityRef::constructor(&playerRef,familiar->_player); } else { uVar5 = iVar6 * (int)pvVar3 + iVar4; EntityRef::constructor(&playerRef,familiar->_player); if ((uVar5 < 0x1c0) && (gridEntity = *(int **)((((ANM2 *)((int)local_20.y + 0x48))->_filename)._buf + uVar5 * 4 + -0x24), gridEntity != (int *)0x0)) { (**(code **)(*gridEntity + 0x10))(1,&playerRef); fVar7 = 0.5; } } (familiar->_velocity).x = (familiar->_velocity).x * fVar7; (familiar->_velocity).y = (familiar->_velocity).y * fVar7; familiar->_fireCooldown = familiar->_fireCooldown + -1; iVar4 = familiar->_fireCooldown; if (iVar4 < -10) { iVar4 = 0x1e; } familiar->_fireCooldown = iVar4; } familiar->_entityCollisionClass = 4; if (nearbyEntities._0_1_ != '\0') { ExceptionList = local_10; return; } local_8 = 2; LAB_00618f0d: tracked_alloc(1,nearbyEntities._data,0); ExceptionList = local_10; return; } Entity_Familiar::FollowParent(familiar); if (((familiar->_sprite)._animState._animData != (void *)0x0) && ((familiar->_sprite)._animState._isPlaying != 0)) { curAnimChar = (familiar->_sprite)._animState._animData; if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } wantAnimChar = "Float"; do { bVar2 = *curAnimChar; isLess = bVar2 < (byte)*wantAnimChar; if (bVar2 != *wantAnimChar) { LAB_00618ff0: uVar5 = -(uint)isLess | 1; goto LAB_00618ff5; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < (byte)wantAnimChar[1]; if (bVar2 != wantAnimChar[1]) goto LAB_00618ff0; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00618ff5: if (uVar5 == 0) goto LAB_00619008; } ANM2::Play(&familiar->_sprite,(byte *)"Float",0); LAB_00619008: if ((isLilithIncubus != 0) && (1 < familiar->_fireCooldown)) { familiar->_fireCooldown = 1; } iVar4 = familiar->_fireCooldown; if (0 < iVar4) { iVar4 = iVar4 + -1; familiar->_fireCooldown = iVar4; } fVar7 = (familiar->_targetPosition).x; if (((fVar7 != g_vectorZero.x) || ((familiar->_targetPosition).y != g_vectorZero.y)) && (iVar4 < 1)) { fVar7 = fVar7 * 10.0; velocity = &familiar->_velocity; familiar->_fireCooldown = -1; iVar4 = 4; if (isLilithIncubus != 0) { iVar4 = 0; } familiar->_entityGridCollisionClass = iVar4; fVar9 = (familiar->_targetPosition).y; pvVar3 = familiar->_player; velocity->x = fVar7; (familiar->_velocity).y = fVar9 * 10.0; fVar9 = *(float *)((int)pvVar3 + 0x360); fVar8 = *(float *)((int)pvVar3 + 0x364); if (ABS((familiar->_targetPosition).x) <= ABS((familiar->_targetPosition).y)) { fVar8 = 0.0; } else { fVar9 = 0.0; } fVar8 = fVar8 * 0.6 + fVar8 * 0.6 + (familiar->_velocity).y; fVar7 = fVar9 * 0.6 + fVar9 * 0.6 + fVar7; (familiar->_velocity).y = fVar8; velocity->x = fVar7; if (fVar8 * fVar8 + fVar7 * fVar7 < 100.0) { normalizedVelocity = Vector::Normalized(velocity,&local_20); fVar7 = normalizedVelocity->y; velocity->x = normalizedVelocity->x * 10.0; (familiar->_velocity).y = fVar7 * 10.0; } familiar->_friction = 1.0; (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; } familiar->_entityCollisionClass = 0; ExceptionList = local_10; return; } //@@ 00619270 Entity_Familiar::ai_auto_shooter /* DB: ? Entity_Familiar::Update case 2 (Demon Baby) shared by variants 6/0x35/0x4c/0x6d (and wisp 0xce/0xed branch): QueryRadius(8) + Room::CheckLine(...,900) for a target, spawns 2.1 tears with apply_tear_modifiers, cooldown this+0xd50=12, anims Float/FloatDown/StoppedDown */ void __thiscall Entity_Familiar::ai_auto_shooter(Entity_Familiar *this) { Vector *pVVar1; qword qVar2; byte bVar3; char isLastRef; int iVar4; Entity_Tear *tear; LayerState *layer; int *texture; qword *allocCounter; byte *anim; float fVar5; Entity *pEVar6; undefined4 uVar7; TypeDescriptor *pTVar8; TypeDescriptor *pTVar9; char *anim_00; undefined4 uVar10; EntityList_EL enemyList; Vector local_24; Vector local_1c; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; uint blockSize; local_8 = 0xffffffff; puStack_c = &LAB_00af6b15; local_10 = ExceptionList; ExceptionList = &local_10; FollowParent(this); iVar4 = apply_forgotten_lullaby(this,10); bVar3 = Entity::IsFrame((Entity *)this,iVar4,0); if (bVar3 != 0) { local_14 = (Entity *)0x0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&enemyList,&this->_pos,150.0,8); local_8 = 0; local_1c.y = 0.0; if ((float)enemyList._size != 0.0) { do { pEVar6 = *(Entity **)((int)enemyList._data + (int)local_1c.y * 4); bVar3 = Entity::IsVulnerableEnemy(pEVar6,(Entity *)0x0); if ((bVar3 != 0) && (((this->_spawnerEntity == (EntityPtr)0x0 || (bVar3 = Entity::IsDescendantOf((Entity *)this->_spawnerEntity,pEVar6), bVar3 == 0)) && ((pEVar6->_flags & 0x20000010) == 0)))) { local_24.y = (pEVar6->_pos).y; local_24.x = (pEVar6->_pos).x; bVar3 = Room::CheckLine(g_game->_room,&this->_pos,&local_24,3,900,0,0,(Vector *)0x0); if (bVar3 != 0) { local_14 = pEVar6; } } local_1c.y = (float)((int)local_1c.y + 1); } while ((uint)local_1c.y < (uint)enemyList._size); if (local_14 != (Entity *)0x0) { iVar4 = 0; local_1c.y = (local_14->_pos).x - (this->_pos).x; local_14 = (Entity *)((local_14->_pos).y - (this->_pos).y); if (ABS(local_1c.y) <= ABS((float)local_14)) { iVar4 = (uint)(0.0 < (float)local_14) * 2 + 1; } else if (0.0 < local_1c.y) { iVar4 = 2; } this->_headFrameDelay = 0xc; PlayShootAnim(this,iVar4); local_24.y = (float)Random(); fVar5 = sqrtf(local_1c.y * local_1c.y + (float)local_14 * (float)local_14); pEVar6 = local_14; if (0.0 < fVar5) { local_1c.y = local_1c.y * (1.0 / fVar5); pEVar6 = (Entity *)((float)local_14 * (1.0 / fVar5)); } local_1c.x = local_1c.y * 8.0; local_1c.y = (float)pEVar6 * 8.0; uVar10 = 0; pTVar9 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar7 = 0; pEVar6 = Game::Spawn(g_game,2,1,&this->_pos,&local_1c,(Entity *)this,0,(uint)local_24.y); tear = (Entity_Tear *)__RTDynamicCast(pEVar6,uVar7,pTVar8,pTVar9,uVar10); tear->_fallingSpeed = 1.2; local_24.y = apply_tear_modifiers(this); fVar5 = apply_tear_modifiers(this); local_1c.y = fVar5 * 0.35 + 0.55; (**(code **)(*(int *)tear + 0x40))(local_24.y * 3.0); local_24.y = local_1c.y; local_1c.y = 0.01; pVVar1 = &local_24; if (local_24.y <= 0.01) { pVVar1 = &local_1c; } fVar5 = pVVar1->y; tear->_baseScale = fVar5; tear->_fScale = fVar5; Entity_Tear::ResetSpriteScale(tear); TryFireTear(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); } } mongo_baby_pick_next_mimic(this); local_8 = 0xffffffff; if (enemyList._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (enemyList._data != (void *)0x0) { blockSize = *(uint *)((int)enemyList._data + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - blockSize; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < blockSize); free((void *)((int)enemyList._data + -4)); } local_8 = 0xffffffff; } } if (0 < this->_headFrameDelay) { this->_headFrameDelay = this->_headFrameDelay + -1; ExceptionList = local_10; return; } iVar4 = this->_variant; if (iVar4 != 0x58) { if (iVar4 == 0xce) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); texture = LayerState::GetTexture(layer,&local_24); local_8 = 2; anim = s_Idle2; if (*(uint *)(*texture + 0x10) < 0x81) { anim = s_Idle; } ANM2::SetAnimation(&this->_sprite,anim,0); local_8 = 3; if ((((int *)local_24.y != (int *)0x0) && (isLastRef = (**(code **)(*(int *)local_24.y + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_24); ExceptionList = local_10; return; } } else { if (iVar4 == 0xed) { ANM2::SetAnimation(&this->_sprite,s_Idle,0); ExceptionList = local_10; return; } if (iVar4 != 0xee) { (this->_sprite)._flipX = 0; if (iVar4 == 0x4c) { anim_00 = "Float"; } else if (((iVar4 == 6) || (iVar4 == 0x35)) || ((iVar4 != 0x6d || (*(int *)((int)this->_player + 0x162c) == -1)))) { anim_00 = "FloatDown"; } else { anim_00 = "StoppedDown"; } ANM2::Play(&this->_sprite,(byte *)anim_00,0); } } } ExceptionList = local_10; return; } //@@ 006196e0 FamiliarAI::variant_53 /* DB: ? Entity_Familiar::Update case 0x35 (53); moves along Entity_Player::GetShootingJoystick *1.25, Float/FloatSide/StoppedDown anims, PlayShootAnim, Room::CheckLine (Robo-Baby 2.0 like) */ void __fastcall FamiliarAI::variant_53(Entity_Familiar *familiar) { int iVar1; undefined1 *puVar2; byte bVar3; char cVar4; int iVar5; int **ppiVar6; float *pfVar7; Vector *fireDirection; LayerState *layer; byte *idleAnim; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; int *piVar13; Entity *pEVar14; float fVar15; char *anim; Vector local_5c; Vector local_54; undefined1 textureRef [4]; int *local_48; float targetX; float targetSize; float absDeltaX; float absDeltaY; int *local_34; int *local_30; float deltaY; int *local_28; Entity *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Entity_Player *player; puStack_20 = textureRef + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af6b55; local_1c = ExceptionList; ExceptionList = &local_1c; player = familiar->_player; pEVar14 = (Entity *)g_vectorZero.y; local_34 = (int *)g_vectorZero.x; puVar2 = textureRef + 0x48; if ((player->_isControlsEnabled != 0) && (puVar2 = textureRef + 0x48, player->_controlsCooldown < 1)) { Entity_Player::GetShootingJoystick(player,&local_54); local_28 = (int *)local_54.x; local_24 = (Entity *)local_54.y; local_30 = (int *)local_54.y; local_34 = (int *)local_54.x; fVar8 = sqrtf(local_54.y * local_54.y + local_54.x * local_54.x); puVar2 = puStack_20; if ((fVar8 <= 1.0) || (fVar8 <= 0.0)) { pEVar14 = local_24; local_34 = local_28; } else { pEVar14 = (Entity *)((1.0 / fVar8) * (float)local_30); local_34 = (int *)((1.0 / fVar8) * (float)local_34); } } puStack_20 = puVar2; fVar15 = (float)local_34 * 1.25; fVar8 = (float)pEVar14 * 1.25; if ((fVar15 == g_vectorZero.x) && (fVar8 == g_vectorZero.y)) { iVar5 = 3; } else { iVar5 = 0; if (ABS(fVar15) <= ABS(fVar8)) { iVar5 = (uint)(0.0 < fVar8) * 2 + 1; } else if (0.0 < fVar15) { iVar5 = 2; } } familiar->_moveDirection = iVar5; if ((fVar15 != 0.0) || (fVar8 != 0.0)) { fVar11 = (familiar->_velocity).y; fVar9 = (familiar->_velocity).x; fVar10 = fVar15 * fVar9 + fVar8 * fVar11; fVar12 = fVar8 * fVar10; fVar10 = fVar15 * fVar10; (familiar->_velocity).y = (fVar11 - fVar12) * 0.79999995 + fVar12; (familiar->_velocity).x = (fVar9 - fVar10) * 0.79999995 + fVar10; } game = g_game; fVar11 = (familiar->_velocity).x; local_30 = (int *)0x0; local_34 = (int *)((fVar8 * (familiar->_velocity).y + fVar15 * fVar11) * -0.2); ppiVar6 = &local_34; if ((float)local_34 <= 0.0) { ppiVar6 = &local_30; } fVar9 = ((float)*ppiVar6 + 3.0) * 0.425; (familiar->_velocity).y = (fVar8 * fVar9 + (familiar->_velocity).y) * 0.775; (familiar->_velocity).x = (fVar11 + fVar15 * fVar9) * 0.775; Room::GetClampedPositionImpl(game->_room,&local_54,&familiar->_pos,0.0,0.0,0.0,0.0); local_24 = (Entity *)(local_54.x - (familiar->_pos).x); local_28 = (int *)(local_54.y - (familiar->_pos).y); if (((float)local_24 != g_vectorZero.x) || ((float)local_28 != g_vectorZero.y)) { fVar8 = sqrtf((float)local_24 * (float)local_24 + (float)local_28 * (float)local_28); piVar13 = local_28; pEVar14 = local_24; if (0.0 < fVar8) { piVar13 = (int *)((float)local_28 * (1.0 / fVar8)); pEVar14 = (Entity *)((float)local_24 * (1.0 / fVar8)); } fVar8 = (familiar->_velocity).x; fVar15 = familiar->_speedMultiplier; fVar11 = -((float)piVar13 * (familiar->_velocity).y + (float)pEVar14 * fVar8); if (fVar11 <= 1.0) { fVar11 = 1.0; } if (10.0 <= fVar11) { fVar11 = 10.0; } (familiar->_velocity).y = (float)piVar13 * fVar11 * fVar15 + (familiar->_velocity).y; (familiar->_velocity).x = fVar8 + (float)pEVar14 * fVar11 * fVar15; } iVar5 = 0x3c; if (*(int *)&g_game->_deathmatchManager < 2) { iVar5 = 10; } iVar5 = apply_forgotten_lullaby(familiar,iVar5); if ((((familiar->_flags & 0x4000) == 0) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)) && (g_game->_frameCount % iVar5 == 0)) { local_54.y = (float)g_game->_room; local_30 = (int *)0x438c0000; local_34 = (int *)0x0; local_24 = (Entity *)0x0; if (*(int *)((int)local_54.y + 0x1264) != 0) { do { pEVar14 = *(Entity **)(*(int *)((int)local_54.y + 0x125c) + (int)local_34 * 4); if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar5 = 1, pEVar14->_type == 1)) || (iVar5 = pEVar14->_type, iVar5 - 10U < 0x3de)) && (((pEVar14->_entityCollisionClass != 1 && (pEVar14->_entityCollisionClass != 0)) && (((pEVar14->_isInvicible == 0 && (pEVar14->_dead == 0)) && (((((pEVar14->_flags & 0x10) == 0 || (iVar5 == 0x322)) || (iVar5 == 0x362)) && ((bVar3 = Entity::IsDescendantOf(pEVar14,(Entity *)familiar->_spawnerEntity), bVar3 == 0 && ((pEVar14->_flags & 0x20000010) == 0)))))))))) { targetX = (pEVar14->_pos).x; local_48 = (int *)(pEVar14->_pos).y; deltaY = (float)local_48 - (familiar->_pos).y; local_28 = (int *)(targetX - (familiar->_pos).x); absDeltaY = ABS(deltaY); absDeltaX = ABS((float)local_28); targetSize = pEVar14->_size; pfVar7 = &absDeltaY; if (ABS((float)local_28) <= ABS(deltaY)) { pfVar7 = &absDeltaX; } if (!(targetSize + 10.0 < *pfVar7 || targetSize + 10.0 == *pfVar7)) { fVar8 = sqrtf((float)local_28 * (float)local_28 + deltaY * deltaY); if (fVar8 <= 0.0) { piVar13 = local_28; fVar8 = deltaY; } else { piVar13 = (int *)((targetSize / fVar8) * (float)local_28); fVar8 = (targetSize / fVar8) * deltaY; } local_5c.x = targetX - (float)piVar13; local_5c.y = (float)local_48 - fVar8; fVar15 = local_5c.x - (familiar->_pos).x; fVar8 = local_5c.y - (familiar->_pos).y; local_48 = (int *)sqrtf(fVar8 * fVar8 + fVar15 * fVar15); if (((float)local_48 < (float)local_30) && (bVar3 = Room::CheckLine(g_game->_room,&familiar->_pos,&local_5c,3,0x3b6,0,0, (Vector *)0x0), bVar3 != 0)) { local_30 = local_48; local_24 = pEVar14; } } } local_34 = (int *)((int)local_34 + 1); } while (local_34 < *(int **)((int)local_54.y + 0x1264)); if (local_24 != (Entity *)0x0) { fVar15 = (local_24->_pos).x - (familiar->_pos).x; fVar8 = (local_24->_pos).y - (familiar->_pos).y; if (ABS(fVar15) <= ABS(fVar8)) { iVar5 = (uint)(0.0 < fVar8) * 2 + 1; } else { iVar5 = 2; if (fVar15 <= 0.0) { iVar5 = 0; } } familiar->_shootDirection = iVar5; familiar->_headFrameDelay = 0xd; fireDirection = Isaac::GetAxisAlignedUnitVectorFromDir(&local_5c,iVar5); Entity_Familiar::fire_robo_baby_laser(familiar,fireDirection); } } } if (0 < familiar->_headFrameDelay) { iVar5 = familiar->_shootDirection; if (0x14 < familiar->_headFrameDelay) { Entity_Familiar::PlayShootAnim(familiar,iVar5); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; } iVar1 = familiar->_variant; if (iVar1 != 0x58) { if (iVar1 == 0xce) { layer = ANM2::GetLayer(&familiar->_sprite,(byte *)0x0); piVar13 = LayerState::GetTexture(layer,&local_5c); local_14 = 1; idleAnim = s_Idle2; if (*(uint *)(*piVar13 + 0x10) < 0x81) { idleAnim = s_Idle; } ANM2::SetAnimation(&familiar->_sprite,idleAnim,0); local_14 = 2; if ((((int *)local_5c.y != (int *)0x0) && (cVar4 = (**(code **)(*(int *)local_5c.y + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_5c); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; } } else { if (iVar1 == 0xed) { ANM2::SetAnimation(&familiar->_sprite,s_Idle,0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; } if (iVar1 != 0xee) { (familiar->_sprite)._flipX = 0; if (iVar1 == 0x4c) { ANM2::Play(&familiar->_sprite,(byte *)"Float",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; } if ((iVar1 == 6) || (iVar1 == 0x35)) { switch(iVar5) { case 0: ANM2::Play(&familiar->_sprite,(byte *)"FloatSide2",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; case 1: switchD_00619f85_caseD_1: ANM2::Play(&familiar->_sprite,(byte *)"FloatUp",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; case 2: goto switchD_00619f85_caseD_2; case 3: goto switchD_00619f85_caseD_3; default: goto switchD_00619ef3_default; } } if ((iVar1 == 0x6d) && (*(int *)((int)familiar->_player + 0x162c) != -1)) { switch(iVar5) { case 0: (familiar->_sprite)._flipX = 1; case 2: ANM2::Play(&familiar->_sprite,(byte *)"StoppedSide",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; case 1: ANM2::Play(&familiar->_sprite,(byte *)"StoppedUp",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; case 3: ANM2::Play(&familiar->_sprite,(byte *)"StoppedDown",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; } } else { switch(iVar5) { case 0: (familiar->_sprite)._flipX = 1; case 2: switchD_00619f85_caseD_2: ANM2::Play(&familiar->_sprite,(byte *)"FloatSide",0); familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; case 1: goto switchD_00619f85_caseD_1; case 3: switchD_00619f85_caseD_3: ANM2::Play(&familiar->_sprite,(byte *)"FloatDown",0); } } } } } switchD_00619ef3_default: familiar->_headFrameDelay = familiar->_headFrameDelay + -1; ExceptionList = local_1c; return; } iVar5 = familiar->_variant; iVar1 = familiar->_moveDirection; if (iVar5 == 0x58) { ExceptionList = local_1c; return; } if (iVar5 == 0xce) { layer = ANM2::GetLayer(&familiar->_sprite,(byte *)0x0); piVar13 = LayerState::GetTexture(layer,textureRef); local_14 = 3; idleAnim = s_Idle2; if (*(uint *)(*piVar13 + 0x10) < 0x81) { idleAnim = s_Idle; } ANM2::SetAnimation(&familiar->_sprite,idleAnim,0); local_14 = 4; if (local_48 == (int *)0x0) { ExceptionList = local_1c; return; } cVar4 = (**(code **)(*local_48 + 0xc))(); if (cVar4 == '\0') { ExceptionList = local_1c; return; } if (g_imageReleaseFn == (void *)0x0) { ExceptionList = local_1c; return; } (*g_imageReleaseFn)(textureRef); ExceptionList = local_1c; return; } if (iVar5 == 0xed) { ANM2::SetAnimation(&familiar->_sprite,s_Idle,0); ExceptionList = local_1c; return; } if (iVar5 == 0xee) { ExceptionList = local_1c; return; } (familiar->_sprite)._flipX = 0; if (iVar5 == 0x4c) { anim = "Float"; } else if ((iVar5 == 6) || (iVar5 == 0x35)) { switch(iVar1) { case 0: anim = "FloatSide2"; break; case 1: switchD_0061a186_caseD_1: anim = "FloatUp"; break; case 2: goto switchD_0061a186_caseD_2; case 3: switchD_0061a186_caseD_3: anim = "FloatDown"; break; default: goto switchD_0061a158_default; } } else if ((iVar5 == 0x6d) && (*(int *)((int)familiar->_player + 0x162c) != -1)) { switch(iVar1) { case 0: (familiar->_sprite)._flipX = 1; case 2: anim = "StoppedSide"; break; case 1: anim = "StoppedUp"; break; case 3: anim = "StoppedDown"; break; default: goto switchD_0061a158_default; } } else { switch(iVar1) { case 0: (familiar->_sprite)._flipX = 1; break; case 1: goto switchD_0061a186_caseD_1; case 2: break; case 3: goto switchD_0061a186_caseD_3; default: goto switchD_0061a158_default; } switchD_0061a186_caseD_2: anim = "FloatSide"; } ANM2::Play(&familiar->_sprite,(byte *)anim,0); switchD_0061a158_default: ExceptionList = local_1c; return; } //@@ 0061a240 Entity_Familiar::ai_blue_babys_only_friend /* DB: Entity_Familiar::Update case 0x4d (variant 77, CheckFamiliar from COLLECTIBLE_BLUE_BABYS_ONLY_FRIEND 320); steered by Entity_Player::GetShootingJoystick and clamped with Room::GetClampedPositionImpl */ void __thiscall Entity_Familiar::ai_blue_babys_only_friend(Entity_Familiar *this) { float fVar1; Game *pGVar2; Vector *pVVar3; float fVar4; float fVar5; float fVar6; Vector local_18; Vector local_10; Entity_Player::GetShootingJoystick(this->_player,&local_10); fVar4 = local_10.x; if (this->_collidesWithGrid != 0) { (this->_velocity).x = (this->_velocity).x * 0.88; (this->_velocity).y = (this->_velocity).y * 0.88; } fVar6 = 0.0; if (local_10.x == 0.0) { if (local_10.y == 0.0) goto LAB_0061a315; LAB_0061a2e5: if (local_10.x != 0.0) goto LAB_0061a315; fVar6 = (this->_velocity).y; (this->_velocity).x = (this->_velocity).x * 0.5; } else { if (local_10.y != 0.0) goto LAB_0061a2e5; fVar6 = (this->_velocity).x; (this->_velocity).y = (this->_velocity).y * 0.5; } fVar6 = ABS(fVar6); LAB_0061a315: pGVar2 = g_game; fVar5 = (this->_velocity).y; fVar1 = (this->_velocity).x; local_18.x = 0.0; local_10.x = -(fVar5 * local_10.y + fVar1 * local_10.x) * 0.2; pVVar3 = &local_10; if (local_10.x <= 0.0) { pVVar3 = &local_18; } fVar6 = (fVar6 * 0.3 * 0.1 + pVVar3->x + 3.0) * 0.8; (this->_velocity).y = (fVar6 * local_10.y + fVar5) * 0.775; (this->_velocity).x = (fVar6 * fVar4 + fVar1) * 0.775; Room::GetClampedPositionImpl(pGVar2->_room,&local_18,&this->_pos,0.0,0.0,0.0,0.0); local_10.x = local_18.x - (this->_pos).x; local_18.x = local_18.y - (this->_pos).y; if ((local_10.x != g_vectorZero.x) || (local_18.x != g_vectorZero.y)) { fVar4 = sqrtf(local_18.x * local_18.x + local_10.x * local_10.x); if (0.0 < fVar4) { local_10.x = local_10.x * (1.0 / fVar4); local_18.x = local_18.x * (1.0 / fVar4); } fVar4 = (this->_velocity).x; fVar6 = this->_speedMultiplier; fVar5 = -(local_18.x * (this->_velocity).y + fVar4 * local_10.x); if (fVar5 <= 1.0) { fVar5 = 1.0; } if (10.0 <= fVar5) { fVar5 = 10.0; } (this->_velocity).x = local_10.x * fVar5 * fVar6 + fVar4; (this->_velocity).y = local_18.x * fVar5 * fVar6 + (this->_velocity).y; } return; } //@@ 0061a4e0 Entity_Familiar::ai_pickup_sack /* DB: ? Entity_Familiar::Update cases 0x18/0x40/0x5a/0x66 (Bomb Bag-style pickup spawners): PreSpawn/FloatDown anims, FindFreePickupSpawnPosition, ThrowSpider/spawn_blue_spider, BFFS 0xf7 check */ void __thiscall Entity_Familiar::ai_pickup_sack(Entity_Familiar *this) { float *pfVar1; code *pcVar2; Vector targetPos; byte bVar3; Entity *pEVar4; byte *curAnimName; uint uVar5; EntityPtr *pEVar6; Entity *shot; int spawnsLeft; int iVar7; uint variantRoll; byte *curAnimNameChar; char *targetAnimNameChar; byte *spawnAnimNameChar; qword *allocatedBytes; RNG *dropRng; int iVar8; bool bVar9; float fVar10; float fVar11; EntityPtr *dirY; Vector dropPos; Vector heartPos; Vector cardPos; Vector pillPos; Vector pickupPos; EntityList_EL familiars; EntityList_EL nearbyPickups; Vector dropMidpoint; Vector heartMidpoint; Vector cardMidpoint; Vector pillMidpoint; Vector spiderMidpoint; Vector pickupMidpoint; Vector local_30; float local_28 [2]; ItemPool *local_20; float local_1c; EntityPtr *local_18; EntityPtr *local_14; void *local_10; undefined1 *puStack_c; float local_8; Game *game; Manager *manager; Entity_Familiar *otherFamiliar; qword prevAllocatedBytes; EntityPtr target; local_8 = -NAN; puStack_c = &LAB_00af6b95; local_10 = ExceptionList; ExceptionList = &local_10; target = this->_target; pEVar6 = &this->_target; if ((target == (EntityPtr)0x0) || (*(char *)((int)target + 0x173) != '\0')) { local_18 = *(EntityPtr **)((int)this->_player + 0x33c); local_14 = *(EntityPtr **)((int)this->_player + 0x340); local_1c = 80.0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,1,0); local_8 = 0.0; uVar5 = 0; if (familiars._size != 0) { do { otherFamiliar = *(Entity_Familiar **)((int)familiars._data + uVar5 * 4); if (otherFamiliar->_exists != 0) { iVar8 = otherFamiliar->_variant; if ((((iVar8 == 0x18) || (iVar8 == 0x40)) || (iVar8 == 0x5a)) || ((iVar8 == 0x66 || (iVar8 == 0x58)))) { if (otherFamiliar == this) break; local_18 = (EntityPtr *)(otherFamiliar->_pos).x; local_14 = (EntityPtr *)(otherFamiliar->_pos).y; local_1c = 50.0; } else if (otherFamiliar == this) break; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)familiars._size); } local_28[0] = (this->_pos).y; local_14 = (EntityPtr *)((float)local_14 - local_28[0]); local_18 = (EntityPtr *)((float)local_18 - (this->_pos).x); local_28[0] = *(float *)((int)this->_player + 0x340) - local_28[0]; local_30.y = *(float *)((int)this->_player + 0x33c) - (this->_pos).x; local_20 = (ItemPool *) sqrtf((float)local_14 * (float)local_14 + (float)local_18 * (float)local_18); fVar11 = sqrtf(local_28[0] * local_28[0] + local_30.y * local_30.y); if (80.0 <= fVar11) { if (local_1c < (float)local_20) { (this->_velocity).x = ((float)local_18 / (float)local_20) * 0.8 + (this->_velocity).x; (this->_velocity).y = ((float)local_14 / (float)local_20) * 0.8 + (this->_velocity).y; } } else if ((((5 < this->_coins) || (2 < this->_hearts)) || (this->_state < this->_keys)) && (((this->_sprite)._animState._animData != (void *)0x0 && ((this->_sprite)._animState._isPlaying != 0)))) { curAnimName = (this->_sprite)._animState._animData; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } targetAnimNameChar = "FloatDown"; do { bVar3 = *curAnimName; bVar9 = bVar3 < (byte)*targetAnimNameChar; if (bVar3 != *targetAnimNameChar) { LAB_0061a861: uVar5 = -(uint)bVar9 | 1; goto LAB_0061a866; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar9 = bVar3 < (byte)targetAnimNameChar[1]; if (bVar3 != targetAnimNameChar[1]) goto LAB_0061a861; curAnimName = curAnimName + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0061a866: if ((uVar5 == 0) && (bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"PreSpawn",1), bVar3 != 0)) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } local_8 = -NAN; if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar5 = *(uint *)((int)familiars._data + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar5); free((uint *)((int)familiars._data + -4)); } local_8 = -NAN; } LAB_0061a925: this->_friction = this->_friction * 0.8; bVar3 = Entity::IsFrame((Entity *)this,5,0); if (bVar3 != 0) goto LAB_0061a950; } else { local_18 = (EntityPtr *)(*(float *)((int)target + 0x340) - (this->_pos).y); local_14 = (EntityPtr *)(*(float *)((int)target + 0x33c) - (this->_pos).x); fVar11 = (float)local_18 * (float)local_18 + (float)local_14 * (float)local_14; if (100.0 <= fVar11) { fVar11 = sqrtf(fVar11); pEVar6 = local_14; dirY = local_18; if (0.0 < fVar11) { dirY = (EntityPtr *)((float)local_18 * (1.0 / fVar11)); pEVar6 = (EntityPtr *)((float)local_14 * (1.0 / fVar11)); } (this->_velocity).x = (float)pEVar6 * 1.1 + (this->_velocity).x; (this->_velocity).y = (float)dirY * 1.1 + (this->_velocity).y; goto LAB_0061a925; } Entity::collide_with_entity((Entity *)this,__security_cookie ^ (uint)(local_28 + 9)); target = *pEVar6; if (*(byte *)((int)target + 0x173) == 0) { if ((((target != (EntityPtr)0x0) && (*(int *)((int)target + 0x28) == 5)) && (*(int *)((int)target + 0x2c) == 0x14)) && (*(int *)((int)target + 0x30) == 6)) { uVar5 = Entity::GetHitListIndex((Entity *)target); sorted_vector_insert_unique(&this->_hitList,uVar5); if (*pEVar6 != (EntityPtr)0x0) { local_18 = pEVar6; std::multiset::erase(&local_18); } *pEVar6 = (EntityPtr)0x0; } goto LAB_0061a925; } if (target != (EntityPtr)0x0) { local_14 = pEVar6; std::multiset::erase(&local_14); } *pEVar6 = (EntityPtr)0x0; this->_friction = this->_friction * 0.8; LAB_0061a950: if (this->_target == (EntityPtr)0x0) { local_1c = 40000.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyPickups,&this->_pos,200.0,0x10); local_8 = 2.8026e-45; local_14 = (EntityPtr *)0x0; if ((undefined1 *)nearbyPickups._size != (undefined1 *)0x0) { do { iVar8 = *(int *)((int)nearbyPickups._data + (int)local_14 * 4); if (*(int *)(iVar8 + 0x28) == 5) { pEVar4 = (Entity *) __RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); iVar8 = this->_variant; if (((((iVar8 == 0x18) || (iVar8 == 0x66)) && (pEVar4->_variant == 0x14)) || (((((iVar8 == 0x40 || (iVar8 == 0x66)) && (pEVar4->_variant == 10)) && ((((iVar7 = pEVar4->_subtype, iVar7 == 1 || (iVar7 == 2)) || (iVar7 == 5)) || (iVar7 == 9)))) || (((iVar8 == 0x5a || (iVar8 == 0x66)) && ((pEVar4->_variant == 0x1e && (pEVar4->_subtype != 2)))))))) && (((pEVar4->_dead == 0 && (pEVar4[1]._sprite._championColor._tint[3] == 0.0)) && (((bVar3 = EntityList::HitListContains((EntityList *)&this->_hitList,pEVar4), bVar3 == 0 || ((pEVar4->_variant == 0x14 && (pEVar4->_subtype == 2)))) && (fVar11 = (pEVar4->_pos).x - (this->_pos).x, fVar10 = (pEVar4->_pos).y - (this->_pos).y, local_30.y = fVar10 * fVar10 + fVar11 * fVar11, local_30.y < local_1c)))))) { pEVar6 = &this->_target; if (this->_target != (EntityPtr)0x0) { local_20 = (ItemPool *)pEVar6; std::multiset::erase(&local_20); } *(Entity **)&pEVar6->field_0x0 = pEVar4; std::multiset::insert(pEVar6); local_1c = local_30.y; } } local_14 = (EntityPtr *)&local_14->field_0x1; } while (local_14 < (uint)nearbyPickups._size); } local_8 = -NAN; if (nearbyPickups._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (nearbyPickups._data != (void *)0x0) { uVar5 = *(uint *)((int)nearbyPickups._data + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar5); free((void *)((int)nearbyPickups._data + -4)); } local_8 = -NAN; } } } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying != 0)) { LAB_0061b7e0: curAnimName = (this->_sprite)._animState._animData; if ((curAnimName != (byte *)0x0) && ((this->_sprite)._animState._isPlaying == 0)) { curAnimNameChar = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimNameChar = *(byte **)curAnimName; } spawnAnimNameChar = s_Spawn; do { bVar3 = *curAnimNameChar; bVar9 = bVar3 < *spawnAnimNameChar; if (bVar3 != *spawnAnimNameChar) { LAB_0061b827: uVar5 = -(uint)bVar9 | 1; goto LAB_0061b82c; } if (bVar3 == 0) break; bVar3 = curAnimNameChar[1]; bVar9 = bVar3 < spawnAnimNameChar[1]; if (bVar3 != spawnAnimNameChar[1]) goto LAB_0061b827; curAnimNameChar = curAnimNameChar + 2; spawnAnimNameChar = spawnAnimNameChar + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0061b82c: if (uVar5 == 0) { curAnimNameChar = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimNameChar = *(byte **)curAnimName; } targetAnimNameChar = "FloatDown"; do { bVar3 = *curAnimNameChar; bVar9 = bVar3 < (byte)*targetAnimNameChar; if (bVar3 != *targetAnimNameChar) { LAB_0061b860: uVar5 = -(uint)bVar9 | 1; goto LAB_0061b865; } if (bVar3 == 0) break; bVar3 = curAnimNameChar[1]; bVar9 = bVar3 < (byte)targetAnimNameChar[1]; if (bVar3 != targetAnimNameChar[1]) goto LAB_0061b860; curAnimNameChar = curAnimNameChar + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0061b865: if (((uVar5 != 0) || (curAnimName[0x34] != 0)) && (bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"FloatDown",1), bVar3 != 0)) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } ExceptionList = local_10; return; } curAnimName = (this->_sprite)._animState._animData; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } targetAnimNameChar = "PreSpawn"; do { bVar3 = *curAnimName; bVar9 = bVar3 < (byte)*targetAnimNameChar; if (bVar3 != *targetAnimNameChar) { LAB_0061ab77: uVar5 = -(uint)bVar9 | 1; goto LAB_0061ab7c; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar9 = bVar3 < (byte)targetAnimNameChar[1]; if (bVar3 != targetAnimNameChar[1]) goto LAB_0061ab77; curAnimName = curAnimName + 2; targetAnimNameChar = targetAnimNameChar + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0061ab7c: if (uVar5 != 0) goto LAB_0061b7e0; bVar3 = ANM2::SetAnimation(&this->_sprite,s_Spawn,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } local_28[0] = 0.0; iVar8 = this->_variant; if (iVar8 == 0x66) { if (this->_coins < 6) { if (this->_hearts < 3) goto LAB_0061b57f; goto LAB_0061b0d0; } } else if (iVar8 != 0x18) { if (iVar8 != 0x40) { if (iVar8 != 0x5a) { ExceptionList = local_10; return; } LAB_0061b57f: bVar3 = Entity_Player::HasCollectible(this->_player,0xf7,0); uVar5 = (this->_dropRNG)._seed; if (bVar3 == 0) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; iVar7 = this->_keys + -4; iVar8 = 0; if (0 < iVar7) { iVar8 = iVar7; } uVar5 = uVar5 & 3; } else { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; iVar7 = this->_keys + -3; iVar8 = 0; if (0 < iVar7) { iVar8 = iVar7; } uVar5 = uVar5 % 3; } this->_state = uVar5 + 2; this->_keys = iVar8; iVar8 = (this->_variant == 0x66) + 1; while( true ) { dropMidpoint.x = (this->_pos).x * 0.5 + *(float *)((int)this->_player + 0x33c) * 0.5; dropMidpoint.y = *(float *)((int)this->_player + 0x340) * 0.5 + (this->_pos).y * 0.5; Room::FindFreePickupSpawnPosition(g_game->_room,&dropPos,&dropMidpoint,0.0,0,0,0); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; variantRoll = uVar5; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); variantRoll = (this->_dropRNG)._seed; } if (variantRoll == 0) break; variantRoll = variantRoll >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ variantRoll; variantRoll = variantRoll << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ variantRoll; variantRoll = variantRoll >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ variantRoll; (this->_dropRNG)._seed = variantRoll; Game::Spawn(g_game,5,*(uint *)(&DAT_00b62fd0 + (variantRoll % 3) * 4),&dropPos,&g_vectorZero ,(Entity *)0x0,0,uVar5); iVar8 = iVar8 + -1; if (iVar8 == 0) { ExceptionList = local_10; return; } } pcVar2 = (code *)swi(3); (*pcVar2)(); return; } LAB_0061b0d0: this->_hearts = this->_hearts + -3; dropRng = &this->_dropRNG; uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; if ((uVar5 % 10 == 0) && (bVar3 = Entity_Player::HasCollectible(this->_player,0xf7,0), bVar3 == 0)) { this->_hearts = this->_hearts + -1; } manager = g_manager; local_28[0] = 1.19531e-42; seed_fart_sound_override((int *)local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28[0],1.0,2,0,1.0,0.0); uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; local_20 = (ItemPool *)(uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f)); uVar5 = (uint)local_20 ^ uVar5; dropRng->_seed = uVar5; uVar5 = uVar5 % 5; if (uVar5 != 0) { if (uVar5 == 1) { pillMidpoint.x = *(float *)((int)this->_player + 0x33c) * 0.5 + (this->_pos).x * 0.5; pillMidpoint.y = (this->_pos).y * 0.5 + *(float *)((int)this->_player + 0x340) * 0.5; Room::FindFreePickupSpawnPosition(g_game->_room,&pillPos,&pillMidpoint,0.0,0,0,0); uVar5 = RNG::Next(dropRng); Game::Spawn(g_game,5,0x46,&pillPos,&g_vectorZero,(Entity *)this,0,uVar5); ExceptionList = local_10; return; } if (uVar5 == 2) { cardMidpoint.x = (this->_pos).x * 0.5 + *(float *)((int)this->_player + 0x33c) * 0.5; cardMidpoint.y = (this->_pos).y * 0.5 + *(float *)((int)this->_player + 0x340) * 0.5; Room::FindFreePickupSpawnPosition(g_game->_room,&cardPos,&cardMidpoint,0.0,0,0,0); uVar5 = RNG::Next(dropRng); Game::Spawn(g_game,5,300,&cardPos,&g_vectorZero,(Entity *)this,0,uVar5); ExceptionList = local_10; return; } spawnsLeft = (this->_variant == 0x66) + 1; local_20 = (ItemPool *)spawnsLeft; do { heartMidpoint.x = (this->_pos).x * 0.5 + *(float *)((int)this->_player + 0x33c) * 0.5; heartMidpoint.y = *(float *)((int)this->_player + 0x340) * 0.5 + (this->_pos).y * 0.5; Room::FindFreePickupSpawnPosition(g_game->_room,&heartPos,&heartMidpoint,0.0,0,0,0); uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; Game::Spawn(game,5,10,&heartPos,&g_vectorZero,(Entity *)this,6,uVar5); spawnsLeft = spawnsLeft + -1; } while (spawnsLeft != 0); ExceptionList = local_10; return; } spiderMidpoint.x = (this->_pos).x * 0.5 + *(float *)((int)this->_player + 0x33c) * 0.5; spiderMidpoint.y = (this->_pos).y * 0.5 + *(float *)((int)this->_player + 0x340) * 0.5; Room::FindFreePickupSpawnPosition(g_game->_room,&local_30,&spiderMidpoint,0.0,0,0,0); uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; if ((uVar5 & 1) == 0) { pEVar4 = this->_player; pfVar1 = &pEVar4[4]._pos.y; *pfVar1 = (float)((int)*pfVar1 + 1); spawn_blue_spider(&local_30,pEVar4,&g_vectorZero); Entity::convert_shot_for_enemy_owner((Entity *)this,shot); ExceptionList = local_10; return; } targetPos.y = local_30.y; targetPos.x = local_30.x; Entity_NPC::ThrowSpider(&this->_pos,(Entity *)this,targetPos,0,-30.0); ExceptionList = local_10; return; } bVar3 = Entity_Player::HasCollectible(this->_player,0xf7,0); if (bVar3 == 0) { uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; local_18 = (EntityPtr *)((uVar5 & 1) + 3); } else { local_18 = (EntityPtr *)0x3; } if ((this->_coins < 10) || (this->_subtype != 0)) { LAB_0061acb1: uVar5 = (this->_dropRNG)._seed; dropRng = &this->_dropRNG; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; if (uVar5 != (uVar5 / 100) * 100) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; pEVar6 = (EntityPtr *)(uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5); dropRng->_seed = (int)pEVar6; local_14 = pEVar6; if (((uint)pEVar6 & 1) == 0) { if (pEVar6 == (EntityPtr *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pEVar6 = (EntityPtr *)dropRng->_seed; if (pEVar6 == (EntityPtr *)0x0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = (uint)pEVar6 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ (uint)pEVar6; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; local_14 = (EntityPtr *)(uVar5 % 3); pEVar6 = local_14; if (local_14 == (EntityPtr *)0x0) { bVar3 = Entity_Player::HasTrinket(this->_player,0x16,0); if ((bVar3 == 0) || (uVar5 = Random(), uVar5 % 5 == 0)) { pEVar6 = local_14; } else { uVar5 = RNG::RandomInt(dropRng,2); pEVar6 = (EntityPtr *)(uVar5 + 1); } } if (pEVar6 == (EntityPtr *)0x0) { fVar11 = 1.4013e-44; } else if (pEVar6 == (EntityPtr *)0x1) { fVar11 = 4.2039e-44; } else if (pEVar6 == (EntityPtr *)0x2) { fVar11 = 5.60519e-44; } else { fVar11 = 0.0; } } else { if (pEVar6 == (EntityPtr *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_14 = (EntityPtr *)dropRng->_seed; if (local_14 == (EntityPtr *)0x0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = (uint)local_14 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ (uint)local_14; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; if (uVar5 == (uVar5 / 3) * 3) { fVar11 = 4.90454e-43; } else { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; switch(uVar5 & 3) { case 0: fVar11 = 9.80909e-44; break; case 1: fVar11 = 4.2039e-43; break; default: fVar11 = 1.26117e-43; } } } goto LAB_0061af9a; } } else { uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; if (uVar5 != (uVar5 / 3) * 3) goto LAB_0061acb1; } local_20 = &g_game->_itemPool; local_30.y = 1.4013e-43; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; } if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; local_28[0] = (float)ItemPool::GetCollectible(local_20,10,uVar5,0,0,0); manager = g_manager; local_18 = (EntityPtr *)0xa; this->_subtype = 1; local_1c = 3.75548e-43; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&manager->_sfxManager,(int)local_1c,1.0,2,0,1.0,0.0); fVar11 = local_30.y; LAB_0061af9a: dropRng = &this->_dropRNG; iVar7 = this->_coins - (int)local_18; iVar8 = 0; if (0 < iVar7) { iVar8 = iVar7; } this->_coins = iVar8; local_1c = (float)((this->_variant == 0x66) + 1); do { pickupMidpoint.x = (this->_pos).x * 0.5 + *(float *)((int)this->_player + 0x33c) * 0.5; pickupMidpoint.y = *(float *)((int)this->_player + 0x340) * 0.5 + (this->_pos).y * 0.5; Room::FindFreePickupSpawnPosition(g_game->_room,&pickupPos,&pickupMidpoint,0.0,0,0,0); uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; Game::Spawn(game,5,(uint)fVar11,&pickupPos,&g_vectorZero,(Entity *)this,(uint)local_28[0],uVar5) ; local_1c = (float)((int)local_1c + -1); } while (local_1c != 0.0); ExceptionList = local_10; return; } //@@ 0061b8c0 Entity_Familiar::ai_flying_bird /* DB: ? Entity_Familiar::Update cases 0xe/0xf/0x3f and from Bird Cage 006424d0: Flying (0xe,0xd2), FlyingTransparent (0xf), Float/FloatChase (0x3f), Idle; PickEnemyTarget */ void __thiscall Entity_Familiar::ai_flying_bird(Entity_Familiar *this) { byte bVar1; int *mapEntry; byte *curAnimName; uint uVar2; char *animName; byte *idleAnimName; bool isLess; float fVar3; float fVar4; float acceleration; float local_44 [2]; float local_3c; float friction; Color color; byte *animData; Manager *manager; EntityPtr target; int variant; acceleration = 1.0; friction = 0.9; if (this->_variant == 0xd2) { PickEnemyTarget(this,360.0,0xd,4,&g_vectorZero,15.0); acceleration = 0.8; friction = 0.8; LAB_0061b99b: if (((this->_variant == 0x3f) && (1 < *(int *)&g_game->_deathmatchManager)) && (this->_target != (EntityPtr)0x0)) { local_3c = *(float *)((int)this->_target + 0x20); mapEntry = (int *)std::map::try_emplace(local_44,&local_3c); if (599 < *(int *)(*mapEntry + 0x14)) { local_3c = *(float *)((int)this->_target + 0x20); mapEntry = (int *)std::map::try_emplace(local_44,&local_3c); *(undefined4 *)(*mapEntry + 0x14) = 0xfffffc7c; } } } else { target = this->_target; PickEnemyTarget(this,300.0,0xd,0,&g_vectorZero,15.0); manager = g_manager; if ((target != (EntityPtr)0x0) || (this->_target == (EntityPtr)0x0)) goto LAB_0061b99b; if (this->_variant == 0x3f) { local_44[0] = 1.20372e-42; seed_fart_sound_override((int *)local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44[0],1.0,0x1c2,0,1.0,0.0); goto LAB_0061b99b; } } target = this->_target; if (target == (EntityPtr)0x0) { local_44[0] = *(float *)((int)this->_player + 0x340) - (this->_pos).y; local_3c = *(float *)((int)this->_player + 0x33c) - (this->_pos).x; fVar4 = local_44[0] * local_44[0] + local_3c * local_3c; if (6400.0 < fVar4) { fVar4 = sqrtf(fVar4); if (fVar4 <= 0.0) { fVar4 = local_3c; fVar3 = local_44[0]; } else { fVar3 = local_44[0] * (1.0 / fVar4); fVar4 = (1.0 / fVar4) * local_3c; } goto LAB_0061bb14; } } else { local_44[0] = *(float *)((int)target + 0x33c) - (this->_pos).x; local_3c = *(float *)((int)target + 0x340) - (this->_pos).y; fVar3 = sqrtf(local_44[0] * local_44[0] + local_3c * local_3c); if (fVar3 <= 0.0) { fVar4 = local_44[0]; fVar3 = local_3c; } else { fVar4 = local_44[0] * (1.0 / fVar3); fVar3 = local_3c * (1.0 / fVar3); } LAB_0061bb14: (this->_velocity).y = fVar3 * acceleration + (this->_velocity).y; (this->_velocity).x = fVar4 * acceleration + (this->_velocity).x; } variant = this->_variant; if ((variant == 0xe) || (variant == 0xd2)) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } animName = "Flying"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_0061bcd3: uVar2 = -(uint)isLess | 1; goto LAB_0061bcd8; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_0061bcd3; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0061bcd8: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061bd0b; } animName = "Flying"; } else if (variant == 0xf) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } animName = "FlyingTransparent"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_0061bb92: uVar2 = -(uint)isLess | 1; goto LAB_0061bb97; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_0061bb92; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0061bb97: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061bd0b; } animName = "FlyingTransparent"; } else { if (variant != 0x3c) { if (variant == 0x3f) { animName = "FloatChase"; if (this->_target == (EntityPtr)0x0) { animName = "Float"; } ANM2::Play(&this->_sprite,(byte *)animName,0); Color::operator_assign(&color,&(this->_sprite)._color); if (this->_target == (EntityPtr)0x0) { fVar4 = 0.5; } else { fVar4 = 1.0; } color._tint[3] = (fVar4 - color._tint[3]) * 0.15 + color._tint[3]; Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&color); } goto LAB_0061bd0b; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } idleAnimName = s_Idle; do { bVar1 = *curAnimName; isLess = bVar1 < *idleAnimName; if (bVar1 != *idleAnimName) { LAB_0061bbf7: uVar2 = -(uint)isLess | 1; goto LAB_0061bbfc; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < idleAnimName[1]; if (bVar1 != idleAnimName[1]) goto LAB_0061bbf7; curAnimName = curAnimName + 2; idleAnimName = idleAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0061bbfc: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061bd0b; } animName = (char *)s_Idle; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0061bd0b: fVar4 = (this->_velocity).x; fVar3 = (this->_velocity).y; (this->_sprite)._flipX = 0.0 < fVar4; (this->_velocity).x = fVar4 * friction; (this->_velocity).y = friction * fVar3; return; } //@@ 0061bd50 Entity_Familiar::ai_daddy_longlegs /* DB: Entity_Familiar::Update case variant 16: StompArm/StompLeg anims (shared only with NpcAI::ENTITY_DADDYLONGLEGS), PickEnemyTarget, ANM2::GetFrame */ void __thiscall Entity_Familiar::ai_daddy_longlegs(Entity_Familiar *this) { byte bVar1; byte *pbVar2; uint uVar3; uint rngResult; char *anim; int iVar4; byte *pbVar5; byte *idleName; bool bVar6; float fVar7; float fVar8; float toTargetX; float toTargetY; float fVar9; float chaseDirX; double dVar10; EntityPtr target; if (this->_fireCooldown == 0) { PickEnemyTarget(this,365.0,0xd,0,&g_vectorZero,15.0); target = this->_target; if (target != (EntityPtr)0x0) { toTargetX = *(float *)((int)target + 0x33c) - (this->_pos).x; toTargetY = *(float *)((int)target + 0x340) - (this->_pos).y; fVar8 = (this->_velocity).x; chaseDirX = (*(float *)((int)target + 0x360) * 5.0 - fVar8 * 5.0) + toTargetX; fVar9 = (*(float *)((int)target + 0x364) * 5.0 - (this->_velocity).y * 5.0) + toTargetY; fVar7 = sqrtf(chaseDirX * chaseDirX + fVar9 * fVar9); if (0.0 < fVar7) { chaseDirX = chaseDirX * (1.0 / fVar7); fVar9 = fVar9 * (1.0 / fVar7); } (this->_velocity).y = fVar9 + (this->_velocity).y; (this->_velocity).x = fVar8 + chaseDirX; if (((toTargetY * toTargetY + toTargetX * toTargetX < 900.0) && ((this->_sprite)._animState._animData != (void *)0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { pbVar2 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pbVar5 = s_Idle; do { bVar1 = *pbVar2; bVar6 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_0061bee3: uVar3 = -(uint)bVar6 | 1; goto LAB_0061bee8; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar6 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_0061bee3; pbVar2 = pbVar2 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0061bee8: if (uVar3 == 0) { rngResult = Random(); anim = "StompArm"; if ((rngResult & 1) == 0) { anim = "StompLeg"; } ANM2::Play(&this->_sprite,(byte *)anim,(byte)uVar3); uVar3 = Random(); (this->_sprite)._flipX = ~(byte)uVar3 & 1; } } } } if ((this->_target == (EntityPtr)0x0) || (this->_fireCooldown - 1U < 0x62)) { fVar8 = *(float *)((int)this->_player + 0x340) - (this->_pos).y; fVar7 = *(float *)((int)this->_player + 0x33c) - (this->_pos).x; fVar9 = fVar8 * fVar8 + fVar7 * fVar7; if (6400.0 < fVar9) { fVar9 = sqrtf(fVar9); if (0.0 < fVar9) { fVar7 = fVar7 * (1.0 / fVar9); fVar8 = fVar8 * (1.0 / fVar9); } (this->_velocity).x = fVar7 + (this->_velocity).x; (this->_velocity).y = fVar8 + (this->_velocity).y; } } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { pbVar5 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar5 = *(byte **)pbVar2; } idleName = s_Idle; do { bVar1 = *pbVar5; bVar6 = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_0061c020: uVar3 = -(uint)bVar6 | 1; goto LAB_0061c025; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar6 = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_0061c020; pbVar5 = pbVar5 + 2; idleName = idleName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0061c025: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061c058; } bVar1 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_0061c058: if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } if ((this->_sprite)._animState._animData != (void *)0x0) { dVar10 = floor((double)(this->_sprite)._animState._animFrame); if ((9 < (int)dVar10) && ((int)dVar10 < 0x20)) { if ((*(int *)&g_game->_deathmatchManager < 2) || (iVar4 = ANM2::GetFrame(&this->_sprite), iVar4 < 0x11)) { iVar4 = 3; } else { iVar4 = 0; } this->_entityCollisionClass = iVar4; fVar8 = (this->_velocity).x; this->_fireCooldown = 100; (this->_velocity).x = fVar8 * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; return; } } fVar8 = (this->_velocity).x; this->_entityCollisionClass = 0; (this->_velocity).x = fVar8 * 0.9; (this->_velocity).y = (this->_velocity).y * 0.9; return; } //@@ 0061c150 Entity_Familiar::ai_orbital_variant_50 /* DB: ? Entity_Familiar::Update case variant 50: GetOrbitPosition/RecalculateOrbitOffset orbit, PickEnemyTarget, FUN_00652210 (set insert) */ void __thiscall Entity_Familiar::ai_orbital_variant_50(Entity_Familiar *this) { EntityPtr EVar1; int *piVar2; Vector *pVVar3; float fVar4; float fVar5; Vector local_18; Vector local_10; if (this->_subtype == 1) { PickEnemyTarget(this,200.0,0xd,0,&g_vectorZero,15.0); } if ((1 < *(int *)&g_game->_deathmatchManager) && (this->_target != (EntityPtr)0x0)) { local_18.x = *(float *)((int)this->_target + 0x20); piVar2 = (int *)std::map::try_emplace(&local_10,&local_18); if (599 < *(int *)(*piVar2 + 0x14)) { local_18.x = *(float *)((int)this->_target + 0x20); piVar2 = (int *)std::map::try_emplace(&local_10,&local_18); *(undefined4 *)(*piVar2 + 0x14) = 0xfffffb50; } } EVar1 = this->_target; if (EVar1 == (EntityPtr)0x0) { if (this->_orbitLayer == -1) { this->_orbitLayer = 1; fVar4 = DAT_00c34148; (this->_orbitDistance).x = DAT_00c34144; (this->_orbitDistance).y = fVar4; RecalculateOrbitOffset(this,1,1); } local_10.x = *(float *)((int)this->_player + 0x33c); local_10.y = *(float *)((int)this->_player + 0x340); pVVar3 = GetOrbitPosition(this,&local_18,&local_10); local_18.x = pVVar3->x; (this->_targetPosition).x = local_18.x; local_10.x = pVVar3->y; (this->_targetPosition).y = local_10.x; local_10.x = local_10.x - (this->_pos).y; local_18.x = local_18.x - (this->_pos).x; fVar4 = sqrtf(local_10.x * local_10.x + local_18.x * local_18.x); if (fVar4 < 20.0) { (this->_velocity).x = local_18.x * 0.9; (this->_velocity).y = local_10.x * 0.9; } } else { local_10.x = *(float *)((int)EVar1 + 0x33c); fVar4 = *(float *)((int)EVar1 + 0x340); (this->_targetPosition).x = local_10.x; (this->_targetPosition).y = fVar4; if (this->_orbitLayer < 0) goto LAB_0061c32f; RecalculateOrbitOffset(this,this->_orbitLayer,0); this->_orbitLayer = -1; } local_10.x = (this->_targetPosition).x; LAB_0061c32f: local_18.x = (this->_targetPosition).y - (this->_pos).y; local_10.x = local_10.x - (this->_pos).x; fVar4 = sqrtf(local_18.x * local_18.x + local_10.x * local_10.x); if (fVar4 < 0.1) { fVar5 = 0.0; } else { fVar5 = fVar4 * 0.15; if (2.0 <= fVar5) { fVar5 = 2.0; } fVar5 = fVar5 / fVar4; } (this->_velocity).x = local_10.x * fVar5 + (this->_velocity).x; (this->_velocity).y = local_18.x * fVar5 + (this->_velocity).y; this->_friction = this->_friction * 0.8; return; } //@@ 0061c3f0 FamiliarAI::variant_66 /* DB: ? Entity_Familiar::Update case 0x42 (66); 'Walking', PathFinder, shoots (apply_tear_modifiers/convert_shot_for_enemy_owner), SpawnEx(3,0x49) */ void __fastcall FamiliarAI::variant_66(Entity_Familiar *familiar) { float fVar1; double dVar2; byte bVar3; uint uVar4; uint rngX; byte *pbVar5; Entity *pEVar6; byte *pbVar7; char *walkingAnimChar; int doorEnemyCount; byte *wantedAnimChar; int iVar8; bool isLess; float fVar9; int *numBlueSpiders; int *attackCooldown; undefined4 flagsHigh; Game *game; void *room; float roomMaxY; float roomMinY; if (familiar->_subtype == 0) { iVar8 = familiar->_counter; familiar->_counter = iVar8 + -1; if (iVar8 < 1) { familiar->_subtype = 1; uVar4 = Random(); game = g_game; familiar->_counter = uVar4 % 0x1e + 0xf; room = game->_room; fVar9 = *(float *)((int)room + 0x1c); fVar1 = *(float *)((int)room + 0x14); roomMaxY = *(float *)((int)room + 0x20); roomMinY = *(float *)((int)room + 0x18); (familiar->_targetPosition).x = fVar1; (familiar->_targetPosition).y = *(float *)((int)room + 0x18); uVar4 = Random(); dVar2 = __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]; rngX = Random(); (familiar->_targetPosition).x = (float)((double)(int)rngX + __uint_to_double_fixup[-((int)rngX >> 0x1f)]) * 2.3283064e-10 * (fVar9 - fVar1) + (familiar->_targetPosition).x; (familiar->_targetPosition).y = (float)((double)(int)uVar4 + dVar2) * 2.3283064e-10 * (roomMaxY - roomMinY) + (familiar->_targetPosition).y; } } else if (familiar->_subtype == 1) { if (((familiar->_sprite)._animState._animData == (void *)0x0) || ((familiar->_sprite)._animState._isPlaying == 0)) { LAB_0061c581: PathFinder::FindGridPath ((PathFinder *)&familiar->_pathfinder,&familiar->_targetPosition,0.8,0,1); } else { pbVar5 = (familiar->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar7 = s_Spawn; do { bVar3 = *pbVar5; isLess = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_0061c570: uVar4 = -(uint)isLess | 1; goto LAB_0061c575; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; isLess = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_0061c570; pbVar5 = pbVar5 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0061c575: if (uVar4 != 0) goto LAB_0061c581; } iVar8 = familiar->_counter; familiar->_counter = iVar8 + -1; if (iVar8 < 1) { uVar4 = Random(); familiar->_subtype = 0; familiar->_counter = uVar4 % 0x14 + 0xf; PathFinder::Reset((PathFinder *)&familiar->_pathfinder); } } if (((familiar->_sprite)._animState._animData == (void *)0x0) || ((familiar->_sprite)._animState._isPlaying == 0)) { LAB_0061c62d: fVar9 = (familiar->_velocity).y; fVar1 = (familiar->_velocity).x; pbVar5 = (familiar->_sprite)._animState._animData; if (fVar1 * fVar1 + fVar9 * fVar9 <= 1.0) { if (pbVar5 != (byte *)0x0) { pbVar7 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar7 = *(byte **)pbVar5; } wantedAnimChar = s_Idle; do { bVar3 = *pbVar7; isLess = bVar3 < *wantedAnimChar; if (bVar3 != *wantedAnimChar) { LAB_0061c708: uVar4 = -(uint)isLess | 1; goto LAB_0061c70d; } if (bVar3 == 0) break; bVar3 = pbVar7[1]; isLess = bVar3 < wantedAnimChar[1]; if (bVar3 != wantedAnimChar[1]) goto LAB_0061c708; pbVar7 = pbVar7 + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0061c70d: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_0061c740; } bVar3 = ANM2::SetAnimation(&familiar->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } else { if (pbVar5 == (byte *)0x0) { LAB_0061c69e: bVar3 = ANM2::SetAnimation(&familiar->_sprite,(byte *)"Walking",1); if (bVar3 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } else { pbVar7 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar7 = *(byte **)pbVar5; } walkingAnimChar = "Walking"; do { bVar3 = *pbVar7; isLess = bVar3 < (byte)*walkingAnimChar; if (bVar3 != *walkingAnimChar) { LAB_0061c688: uVar4 = -(uint)isLess | 1; goto LAB_0061c68d; } if (bVar3 == 0) break; bVar3 = pbVar7[1]; isLess = bVar3 < (byte)walkingAnimChar[1]; if (bVar3 != walkingAnimChar[1]) goto LAB_0061c688; pbVar7 = pbVar7 + 2; walkingAnimChar = walkingAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0061c68d: if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && ((familiar->_sprite)._animState._isPlaying == 0)))) goto LAB_0061c69e; } (familiar->_sprite)._flipX = (familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0; } } else { pbVar5 = (familiar->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar7 = s_Spawn; do { bVar3 = *pbVar5; isLess = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_0061c620: uVar4 = -(uint)isLess | 1; goto LAB_0061c625; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; isLess = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_0061c620; pbVar5 = pbVar5 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0061c625: if (uVar4 != 0) goto LAB_0061c62d; } LAB_0061c740: game = g_game; familiar->_visible = 1; familiar->_entityGridCollisionClass = 5; familiar->_friction = familiar->_friction * 0.7; familiar->_entityCollisionClass = 3; doorEnemyCount = *(int *)((int)game->_room + 0x12c4) + *(int *)((int)game->_room + 0x12c0); iVar8 = 0; if (0 < doorEnemyCount) { iVar8 = doorEnemyCount; } if (iVar8 == 0) goto LAB_0061c8a0; attackCooldown = &familiar->_state; *attackCooldown = *attackCooldown + -1; if (-1 < *attackCooldown) goto LAB_0061c8a0; fVar9 = Entity_Familiar::apply_tear_modifiers(familiar); if (fVar9 <= 1.0) { uVar4 = Random(); iVar8 = uVar4 % 300 + 0x96; } else { uVar4 = Random(); iVar8 = uVar4 % 0xd2 + 0x78; } familiar->_state = iVar8; uVar4 = familiar->_player->_numBlueSpiders; if ((4 < uVar4) && ((bVar3 = Entity_Player::HasCollectible(familiar->_player,0xd9,0), bVar3 == 0 || (9 < uVar4)))) goto LAB_0061c8a0; pbVar5 = (familiar->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_0061c866: bVar3 = ANM2::SetAnimation(&familiar->_sprite,s_Spawn,1); if (bVar3 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } else { pbVar7 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar7 = *(byte **)pbVar5; } wantedAnimChar = s_Spawn; do { bVar3 = *pbVar7; isLess = bVar3 < *wantedAnimChar; if (bVar3 != *wantedAnimChar) { LAB_0061c850: uVar4 = -(uint)isLess | 1; goto LAB_0061c855; } if (bVar3 == 0) break; bVar3 = pbVar7[1]; isLess = bVar3 < wantedAnimChar[1]; if (bVar3 != wantedAnimChar[1]) goto LAB_0061c850; pbVar7 = pbVar7 + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0061c855: if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && ((familiar->_sprite)._animState._isPlaying == 0)))) goto LAB_0061c866; } familiar->_friction = familiar->_friction * 0.6; LAB_0061c8a0: if (((familiar->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(familiar->_sprite)._animState,s_Spawn), bVar3 != 0) ) { pEVar6 = familiar->_player; numBlueSpiders = (int *)&pEVar6[4]._pos.y; *numBlueSpiders = *numBlueSpiders + 1; uVar4 = Random(); pEVar6 = Game::SpawnEx(g_game,3,0x49,&familiar->_pos,&g_vectorZero,pEVar6,0,uVar4,0); flagsHigh = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = flagsHigh; Entity::convert_shot_for_enemy_owner((Entity *)familiar,pEVar6); } return; } //@@ 0061c910 FamiliarAI::punching_bag /* DB: Entity_Familiar::Update case 0x43 (variant 67); EvaluateItems CheckFamiliar(0x43) from collectible 0x119 COLLECTIBLE_PUNCHING_BAG; PathFinder::EvadeTarget/FindGridPath, QueryRadius */ void __fastcall FamiliarAI::punching_bag(Entity_Familiar *familiar) { float fVar1; byte bVar2; uint uVar3; byte *curAnimChar; byte *cmpAnimChar; int iVar4; qword *allocCounter; PathFinder *pathfinder; int iVar5; bool bVar6; float fVar7; EntityList_EL nearbyEntities; undefined1 local_3c [8]; int *gridSetHead; undefined4 gridSetSize; Vector local_2c; Entity_Familiar *local_24; int *local_20; int local_1c; float sumY; float sumX; void *local_10; undefined1 *puStack_c; uint local_8; byte *animData; Game *game; int *gridSetEnd; int gridWidth; Manager *manager; Entity *nearbyEntity; qword prevAllocated; void *room; local_8 = 0xffffffff; puStack_c = &LAB_00af6bd5; local_10 = ExceptionList; if (familiar->_subtype == 0xdead) { familiar->_visible = 0; familiar->_entityCollisionClass = 0; familiar->_entityGridCollisionClass = 0; (familiar->_velocity).x = g_vectorZero.x; (familiar->_velocity).y = g_vectorZero.y; (familiar->_pos).x = g_vectorZero.x; (familiar->_pos).y = g_vectorZero.y; return; } ExceptionList = &local_10; local_24 = familiar; if ((*(char *)((int)familiar->_player + 0x173) != '\0') && (g_game->_challenge == 0x1e)) { familiar->_subtype = 0xdead; uVar3 = Random(); Game::Spawn(g_game,1000,2,&familiar->_pos,&g_vectorZero,(Entity *)0x0,0,uVar3); manager = g_manager; local_1c = 0x1e; seed_fart_sound_override(&local_1c); SoundEffects::Play(&manager->_sfxManager,local_1c,1.0,2,0,1.0,0.0); } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&familiar->_pos,50.0,8); local_8 = 0; if (nearbyEntities._size == 0) { pathfinder = (PathFinder *)&familiar->_pathfinder; } else { if (familiar->_subtype == 1) { familiar->_subtype = 0; PathFinder::Reset((PathFinder *)&familiar->_pathfinder); } uVar3 = 0; sumX = g_vectorZero.x; sumY = g_vectorZero.y; local_1c = 0; if (nearbyEntities._size != 0) { iVar5 = 0; do { nearbyEntity = *(Entity **)((int)nearbyEntities._data + uVar3 * 4); bVar2 = Entity::IsVulnerableEnemy(nearbyEntity,(Entity *)0x0); if ((((bVar2 != 0) && ((nearbyEntity->_flags & 0x20000010) == 0)) || (nearbyEntity->_type == 0x21)) || (nearbyEntity->_type == 4)) { iVar5 = iVar5 + 1; sumX = sumX + (nearbyEntity->_pos).x; sumY = sumY + (nearbyEntity->_pos).y; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)nearbyEntities._size); familiar = local_24; local_1c = iVar5; } gridSetHead = (int *)0x0; gridSetSize = 0; gridSetHead = operator_new(0x14); *gridSetHead = (int)gridSetHead; gridSetHead[1] = (int)gridSetHead; gridSetHead[2] = (int)gridSetHead; *(undefined2 *)(gridSetHead + 3) = 0x101; local_8 = CONCAT31(local_8._1_3_,1); uVar3 = 0; do { local_20 = (int *)((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 360.0 * 0.125 * 0.017453292); local_2c.y = sin((float)local_20); fVar7 = cos((float)local_20); iVar4 = (int)(((fVar7 * 50.0 + (familiar->_pos).x) - 40.0) / 40.0 + 0.5); iVar5 = (int)(((local_2c.y * 50.0 + (familiar->_pos).y) - 120.0) / 40.0 + 0.5); if (((iVar4 < 0) || (gridWidth = *(int *)((int)g_game->_room + 0xc), gridWidth <= iVar4)) || ((iVar5 < 0 || (*(int *)((int)g_game->_room + 0x10) <= iVar5)))) { local_2c.y = -NAN; } else { local_2c.y = (float)(gridWidth * iVar5 + iVar4); } std::set::insert(local_3c,&local_2c.y); gridSetEnd = gridSetHead; uVar3 = uVar3 + 1; } while (uVar3 < 8); local_20 = (int *)*gridSetHead; if (local_20 != gridSetHead) { fVar7 = 120.0; room = g_game->_room; iVar5 = local_1c; do { if ((((uint)local_20[4] < 0x1c0) && (iVar4 = *(int *)((int)room + local_20[4] * 4 + 0x24), iVar4 != 0)) && ((*(int *)(iVar4 + 4) == 0xe && (*(int *)(iVar4 + 8) == 1)))) { gridWidth = *(int *)((int)room + 0xc); iVar5 = iVar5 + 1; sumX = (float)(*(int *)(iVar4 + 0x24) % gridWidth) * 40.0 + 40.0 + sumX; sumY = sumY + (float)(*(int *)(iVar4 + 0x24) / gridWidth) * 40.0 + fVar7; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_20); } while (local_20 != gridSetEnd); familiar = local_24; local_1c = iVar5; } pathfinder = (PathFinder *)&familiar->_pathfinder; local_2c.x = sumX / (float)local_1c; local_2c.y = sumY / (float)local_1c; PathFinder::EvadeTarget(pathfinder,&local_2c,0); local_8 = local_8 & 0xffffff00; FID_conflict__Erase_tree_>_> (&gridSetHead,(fuzzer_allocator_> *)&gridSetHead, (_Tree_node *)gridSetHead[1]); operator_delete(gridSetHead,0x14); } if (familiar->_subtype == 0) { iVar5 = familiar->_counter; familiar->_counter = iVar5 + -1; if (iVar5 < 1) { familiar->_subtype = 1; uVar3 = Random(); game = g_game; familiar->_counter = uVar3 % 0x1e + 0xf; room = game->_room; local_24 = (Entity_Familiar *)(*(float *)((int)room + 0x1c) - *(float *)((int)room + 0x14)); local_2c.y = *(float *)((int)room + 0x20) - *(float *)((int)room + 0x18); (familiar->_targetPosition).x = *(float *)((int)room + 0x14); (familiar->_targetPosition).y = *(float *)((int)room + 0x18); uVar3 = Random(); local_2c.y = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * local_2c.y; uVar3 = Random(); (familiar->_targetPosition).x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * (float)local_24 + (familiar->_targetPosition).x; (familiar->_targetPosition).y = local_2c.y + (familiar->_targetPosition).y; } } else if (familiar->_subtype == 1) { PathFinder::FindGridPath(pathfinder,&familiar->_targetPosition,0.8,0,1); iVar5 = familiar->_counter; familiar->_counter = iVar5 + -1; if (iVar5 < 1) { uVar3 = Random(); familiar->_subtype = 0; familiar->_counter = uVar3 % 0x14 + 0xf; PathFinder::Reset(pathfinder); } } fVar7 = (familiar->_velocity).y; fVar1 = (familiar->_velocity).x; animData = (familiar->_sprite)._animState._animData; if (fVar1 * fVar1 + fVar7 * fVar7 <= 1.0) { if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = s_Idle; do { bVar2 = *curAnimChar; bVar6 = bVar2 < *cmpAnimChar; if (bVar2 != *cmpAnimChar) { LAB_0061cf70: uVar3 = -(uint)bVar6 | 1; goto LAB_0061cf75; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; bVar6 = bVar2 < cmpAnimChar[1]; if (bVar2 != cmpAnimChar[1]) goto LAB_0061cf70; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0061cf75: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_0061cfa8; } bVar2 = ANM2::SetAnimation(&familiar->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } goto LAB_0061cfa8; } if (animData == (byte *)0x0) { LAB_0061cf06: bVar2 = ANM2::SetAnimation(&familiar->_sprite,s_Walk,1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = s_Walk; do { bVar2 = *curAnimChar; bVar6 = bVar2 < *cmpAnimChar; if (bVar2 != *cmpAnimChar) { LAB_0061cef0: uVar3 = -(uint)bVar6 | 1; goto LAB_0061cef5; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; bVar6 = bVar2 < cmpAnimChar[1]; if (bVar2 != cmpAnimChar[1]) goto LAB_0061cef0; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0061cef5: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((familiar->_sprite)._animState._isPlaying == 0)))) goto LAB_0061cf06; } (familiar->_sprite)._flipX = (familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0; LAB_0061cfa8: familiar->_visible = 1; familiar->_entityGridCollisionClass = 5; familiar->_entityCollisionClass = 4; familiar->_friction = familiar->_friction * 0.8; if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { uVar3 = *(uint *)((int)nearbyEntities._data + -4); prevAllocated = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)prevAllocated < uVar3); free((void *)((int)nearbyEntities._data + -4)); } } ExceptionList = local_10; return; } //@@ 0061d030 FamiliarAI::lil_haunt /* DB: ? Entity_Familiar::Update case 0x4f (FamiliarVariant 79); FloatDown/FloatDownRage/Rage/RageEnd anims (NPC haunt anm2 set), Entity_Familiar::FollowParent then PickEnemyTarget + EntityList::QueryRadius, "Rage" when its counter runs out, HasCollectible(0xf7 BFFS) prototype: db/protos.zhl, confirmed by RET 4 */ void FamiliarAI::lil_haunt(Entity_Familiar *familiar,int unused) { byte isBffs; LayerState *layer; uint uVar1; qword *allocatedBytes; float fVar2; float fVar3; float fVar4; float neighborDistSq; float neighborDx; char *anim; EntityList_EL nearby; float local_4c; float local_48; float local_44; int prevFireCooldown; float local_3c; float local_38; float local_34; float local_30; float leashRadius; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; int neighbor; qword prevAllocatedBytes; EntityPtr target; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00af6c00; local_1c = ExceptionList; ExceptionList = &local_1c; leashRadius = 150.0; local_38 = 180.0; isBffs = Entity_Player::HasCollectible(familiar->_player,0xf7,0); if (isBffs != 0) { leashRadius = 187.5; local_38 = 225.0; } local_3c = (familiar->_pos).x; local_34 = *(float *)((int)familiar->_player + 0x33c); local_30 = *(float *)((int)familiar->_player + 0x340); local_24 = local_34 - local_3c; local_44 = (familiar->_pos).y; local_28 = local_30 - local_44; local_48 = sqrtf(local_28 * local_28 + local_24 * local_24); prevFireCooldown = familiar->_fireCooldown; local_24 = local_24 / local_48; local_28 = local_28 / local_48; (familiar->_pos).x = local_34; (familiar->_pos).y = local_30; Entity_Familiar::PickEnemyTarget(familiar,local_38,1,0,&g_vectorZero,15.0); (familiar->_pos).x = local_3c; (familiar->_pos).y = local_44; target = familiar->_target; if (target == (EntityPtr)0x0) { if (0 < familiar->_fireCooldown) { familiar->_fireCooldown = familiar->_fireCooldown + -1; } Entity_Familiar::FollowParent(familiar); } else { familiar->_fireCooldown = 0xf; if (local_48 <= leashRadius) { local_38 = *(float *)((int)target + 0x340) - (familiar->_pos).y; local_3c = *(float *)((int)target + 0x33c) - local_3c; fVar2 = sqrtf(local_38 * local_38 + local_3c * local_3c); if (fVar2 <= 0.0) { fVar3 = local_38; fVar2 = local_3c; } else { fVar3 = local_38 * (1.0 / fVar2); fVar2 = local_3c * (1.0 / fVar2); } (familiar->_velocity).x = fVar2 + (familiar->_velocity).x; (familiar->_velocity).y = fVar3 + (familiar->_velocity).y; } else { local_30 = *(float *)((int)familiar->_player + 0x340); local_34 = *(float *)((int)familiar->_player + 0x33c); local_4c = sqrtf(local_24 * local_24 + local_28 * local_28); if (local_4c <= 0.0) { fVar2 = local_24; fVar3 = local_28; } else { fVar2 = local_24 * (leashRadius / local_4c); fVar3 = local_28 * (leashRadius / local_4c); } local_44 = -local_24; local_48 = -local_28; local_34 = ((local_34 - fVar2) - local_3c) * 0.9 + (familiar->_velocity).x; local_30 = ((local_30 - fVar3) - (familiar->_pos).y) * 0.9 + (familiar->_velocity).y; (familiar->_velocity).x = local_34; (familiar->_velocity).y = local_30; fVar2 = sqrtf(local_30 * local_30 + local_34 * local_34); fVar2 = (local_30 * local_48 + local_34 * local_44) / fVar2; if (0.0 <= fVar2) { if (local_4c <= 0.0) { fVar3 = local_28; fVar2 = local_24; } else { fVar2 = fVar2 / local_4c; fVar3 = local_28 * fVar2; fVar2 = local_24 * fVar2; } (familiar->_velocity).y = fVar3 + (familiar->_velocity).y; (familiar->_velocity).x = local_34 + fVar2; } fVar2 = *(float *)((int)familiar->_player + 0x340) - *(float *)((int)familiar->_target + 0x340); fVar3 = *(float *)((int)familiar->_player + 0x33c) - *(float *)((int)familiar->_target + 0x33c); fVar2 = sqrtf(fVar2 * fVar2 + fVar3 * fVar3); if (local_38 < fVar2) { familiar->_target = (EntityPtr)0x0; } } (familiar->_velocity).x = (familiar->_velocity).x * 0.9; (familiar->_velocity).y = (familiar->_velocity).y * 0.9; } if (familiar->_fireCooldown < 1) { if (prevFireCooldown < 1) { if (((familiar->_sprite)._animState._animData != (void *)0x0) && ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0061d4bf; anim = "FloatDown"; } else { anim = "RageEnd"; } } else if (prevFireCooldown < 1) { anim = &DAT_00b1e11c; } else { if (((familiar->_sprite)._animState._animData != (void *)0x0) && ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0061d4bf; anim = "FloatDownRage"; } ANM2::Play(&familiar->_sprite,(byte *)anim,0); LAB_0061d4bf: if (familiar->_target != (EntityPtr)0x0) { local_4c = *(float *)((int)familiar->_target + 0x33c) - (familiar->_pos).x; layer = ANM2::GetLayer(&familiar->_sprite,(byte *)0x0); layer->_flipX = local_4c < 0.0; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearby,&familiar->_pos,24.0,1); uVar1 = 0; fVar2 = 0.0; fVar3 = 0.0; local_28 = 0.0; local_24 = 0.0; if (nearby._size != 0) { do { neighbor = *(int *)((int)nearby._data + uVar1 * 4); if ((((neighbor != 0) && (*(int *)(neighbor + 0x28) == 3)) && (*(int *)(neighbor + 0x2c) == familiar->_variant)) && (*(void **)(neighbor + 0x410) == familiar->_player)) { neighborDx = (familiar->_pos).x - *(float *)(neighbor + 0x33c); fVar4 = (familiar->_pos).y - *(float *)(neighbor + 0x340); if ((neighborDx != g_vectorZero.x) || (fVar4 != g_vectorZero.y)) { neighborDistSq = fVar4 * fVar4 + neighborDx * neighborDx; fVar3 = fVar3 + (neighborDx * 10.0) / neighborDistSq; fVar2 = fVar2 + (fVar4 * 10.0) / neighborDistSq; } } uVar1 = uVar1 + 1; } while (uVar1 < (uint)nearby._size); local_28 = fVar2; local_24 = fVar3; } fVar4 = sqrtf(local_28 * local_28 + local_24 * local_24); fVar2 = local_28; fVar3 = local_24; if ((4.0 < fVar4) && (0.0 < fVar4)) { fVar2 = local_28 * (4.0 / fVar4); fVar3 = local_24 * (4.0 / fVar4); } fVar4 = familiar->_speedMultiplier; (familiar->_velocity).y = fVar4 * fVar2 + (familiar->_velocity).y; (familiar->_velocity).x = fVar4 * fVar3 + (familiar->_velocity).x; if (nearby._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (nearby._data != (void *)0x0) { uVar1 = *(uint *)((int)nearby._data + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((uint *)((int)nearby._data + -4)); } } ExceptionList = local_1c; return; } //@@ 0061d6b0 Entity_Familiar::ai_key_full /* DB: Key Full familiar: flies to the door in state 5 (gridpos - (13.85, 7.69)), turns layer to 90 by 2/tick, within 3 px: SOUND_GOLDENKEY, door state 8 + Open, removes Key Piece 1/2 (0xee/0xef) */ void __thiscall Entity_Familiar::ai_key_full(Entity_Familiar *this) { uint *puVar1; GridEntity_Door *this_00; int iVar2; qword qVar3; byte bVar4; uint uVar5; LayerState *pLVar6; byte *pbVar7; byte *pbVar8; Entity_Player *keyPieceOwner; char *floatNameChar; bool isLess; float distY; float local_18; float doorTargetY; Vector followTarget; Game *game; Manager *manager; if ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0) { uVar5 = 0; do { this_00 = *(GridEntity_Door **)((int)g_game->_room + uVar5 * 4 + 0x724); if ((this_00 != (GridEntity_Door *)0x0) && ((this_00->_desc)._variant == 5)) { if (this->_isFollower != 0) { RemoveFromFollowers(this); } pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) goto LAB_0061d7bc; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar7 = s_Idle; goto LAB_0061d784; } uVar5 = uVar5 + 1; } while (uVar5 < 8); } if (this->_isFollower == 0) { AddToFollowers(this); } pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar6->_rotation = 0.0; pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { pbVar7 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar7 = *(byte **)pbVar8; } floatNameChar = "Float"; do { bVar4 = *pbVar7; isLess = bVar4 < (byte)*floatNameChar; if (bVar4 != *floatNameChar) { LAB_0061d9bd: uVar5 = -(uint)isLess | 1; goto LAB_0061d9c2; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; isLess = bVar4 < (byte)floatNameChar[1]; if (bVar4 != floatNameChar[1]) goto LAB_0061d9bd; pbVar7 = pbVar7 + 2; floatNameChar = floatNameChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0061d9c2: if ((uVar5 == 0) && ((pbVar8[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061d9f5; } bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)"Float",1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0061d9f5: FollowParent(this); return; while( true ) { bVar4 = pbVar8[1]; isLess = bVar4 < pbVar7[1]; if (bVar4 != pbVar7[1]) goto LAB_0061d7a4; pbVar8 = pbVar8 + 2; pbVar7 = pbVar7 + 2; if (bVar4 == 0) break; LAB_0061d784: bVar4 = *pbVar8; isLess = bVar4 < *pbVar7; if (bVar4 != *pbVar7) { LAB_0061d7a4: uVar5 = -(uint)isLess | 1; goto LAB_0061d7a9; } if (bVar4 == 0) break; } uVar5 = 0; LAB_0061d7a9: if ((uVar5 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) { LAB_0061d7bc: bVar4 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } iVar2 = *(int *)((int)g_game->_room + 0xc); local_18 = ((float)(this_00->_gridIndex % iVar2) * 40.0 + 40.0) - 13.846154; doorTargetY = ((float)(this_00->_gridIndex / iVar2) * 40.0 + 120.0) - 7.692308; followTarget.x = local_18; followTarget.y = doorTargetY; FollowPosition(this,&followTarget); pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); manager = g_manager; if (pLVar6->_rotation < 90.0) { local_18 = pLVar6->_rotation + 2.0; if (90.0 <= local_18) { local_18 = 90.0; } pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar6->_rotation = local_18; return; } local_18 = (this->_pos).x - local_18; distY = (this->_pos).y - doorTargetY; if (9.0 <= distY * distY + local_18 * local_18) { return; } local_18 = 2.85865e-43; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,(int)local_18,1.0,2,0,1.0,0.0); game = g_game; iVar2 = (this_00->_desc)._variant; if (iVar2 != 4) { if (iVar2 == 5) { qVar3 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x20000; *(int *)&game->_gameStateFlags = (int)qVar3; } (this_00->_desc)._variant = 8; GridEntity_Door::UpdateAnimation(this_00); } GridEntity_Door::Open(this_00); (**(code **)(*(int *)this + 0x28))(); keyPieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xee,(RNG **)&g_game->_playerManager,0); if (keyPieceOwner != (Entity_Player *)0x0) { Entity_Player::RemoveCollectible(keyPieceOwner,0xee,0,0,1); } keyPieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xef,(RNG **)&g_game->_playerManager,0); if (keyPieceOwner == (Entity_Player *)0x0) { return; } Entity_Player::RemoveCollectible(keyPieceOwner,0xef,0,0,1); return; } //@@ 0061da10 Entity_Familiar::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Familiar::Update(Entity_Familiar *this) { qword *this_00; ColorMod color; BitSet128 flags; byte bVar1; char cVar2; int iVar3; int *otherFamiliar; uint uVar4; Entity *tmpEntity; RNG *this_01; ColorMod *color_00; ItemOverlay *itemOverlay; Entity_Effect *effect; KColor *spriteColor; Entity_Laser *techLaser; BitSet128 *pBVar5; uint uVar6; Entity_Projectile *projectile; LayerState *layer; EntityRef *sourceRef; SoundEffects *sfx; Entity_Tear *tear; Entity_Player *listSize; AnimationState *animState; Entity_Familiar *tmpEntity; char *animName; EntityList *entityList; undefined4 *puVar8; undefined1 *puVar9; TemporaryEffects *playerEffects; Vector *pVVar10; Vector *pVVar11; Room *room; GridEntity *gridEntity; float *pfVar12; Game *game; EntityPtr followTarget; int *piVar13; undefined1 *puVar14; code *pcVar15; Entity_Player *pEVar16; bool bVar17; float10 fVar18; Entity_Familiar *in_XMM0_Da; float fVar19; float fVar20; ulonglong projectileFlags; undefined4 in_stack_fffffd0c; undefined4 in_stack_fffffd10; undefined4 in_stack_fffffd14; undefined4 in_stack_fffffd18; undefined4 in_stack_fffffd1c; undefined4 in_stack_fffffd20; EntityList_EL *in_stack_fffffd24; void *in_stack_fffffd28; undefined4 uVar21; undefined4 uVar22; int green; int blue; byte addEnemyKillScore; BitSet128 *pBVar23; float fVar24; BitSet128 local_2b8 [2]; BitSet128 local_298; BitSet128 local_288; BitSet128 local_278; BitSet128 local_268; BitSet128 local_258; BitSet128 local_248; Vector local_238; Vector local_230; Vector local_228; Vector local_220; Vector local_218; Vector local_210; BitSet128 local_208; Vector local_1f0; Vector local_1e8; Vector local_1e0; Vector local_1d8; Vector local_1d0; Vector local_1c8; Vector local_1c0; BitSet128 local_1b8; undefined1 local_1a4 [16]; Vector local_194; Vector local_18c; Vector local_184; Vector local_17c; Vector local_174; Vector local_16c; float local_164; Vector local_160; Vector local_158; Vector local_150; Vector local_148; Vector local_140; undefined4 local_134; Vector local_130; Vector local_128; Entity_Familiar *local_120; Entity_Familiar *local_11c; Entity_Player *local_118; Entity_Familiar *self; undefined1 local_a8 [12]; byte idleAnimName [12]; BitSet128 local_90; undefined1 local_78 [12]; char *pcStack_6c; undefined1 local_68 [12]; char *local_5c; byte animNameBuf [4]; Color local_54; uint local_24; float *pfStack_20; void *local_1c; undefined1 *puStack_18; float local_14; ANM2 *sprite; pfStack_20 = (&local_54)[1]._offset + 1; local_14 = -NAN; puStack_18 = &LAB_00af6c90; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&local_54)[1]._colorize + 2); ExceptionList = &local_1c; self = this; pfVar12 = (&local_54)[1]._offset + 1; if (this->_variant != 900) { fVar20 = 1.0; pfVar12 = (&local_54)[1]._offset + 1; if (this->_variant == 0xe7) { in_stack_fffffd28 = this->_extraData; in_stack_fffffd24 = (EntityList_EL *)0x61da92; __RTDynamicCast(); iVar3 = get_item_config_entry(this); fVar20 = *(float *)(iVar3 + 0x78); pfVar12 = pfStack_20; if ((fVar20 == 1.0) && (piVar13 = this->_item, piVar13 != (int *)0x0)) { if ((*piVar13 == 2) && (piVar13[1] == 0xba)) { bVar1 = 3; } else { bVar1 = (byte)piVar13[0x30]; } if (bVar1 < 5) { fVar20 = *(float *)((int)(&(g_manager->_itemConfig)._wispGfxRoot + 1) + (uint)bVar1 * 4); } else { fVar20 = 1.0; } } } pfStack_20 = pfVar12; in_XMM0_Da = (Entity_Familiar *)(fVar20 * g_vectorOne.x); (this->_sprite)._scale.y = fVar20 * g_vectorOne.y; (this->_sprite)._scale.x = (float)in_XMM0_Da; pfVar12 = pfStack_20; } pfStack_20 = pfVar12; game = g_game; if (g_game->_frameCount - this->_spawnFrame < 2) { iVar3 = this->_variant; if ((((iVar3 == 0x62) || (iVar3 == 99)) || (iVar3 == 0x65)) || ((iVar3 == 0x83 || (iVar3 == 0x6a)))) { in_XMM0_Da = *(Entity_Familiar **)((int)this->_player + 0x33c); fVar20 = *(float *)((int)this->_player + 0x340); (this->_pos).x = (float)in_XMM0_Da; (this->_pos).y = fVar20; } if (this->_orbitLayer == 0) { in_stack_fffffd24 = (EntityList_EL *)local_68; piVar13 = (int *)0x0; local_130.y = 0.0; in_stack_fffffd28 = (void *)0x3; in_stack_fffffd20 = 0x61dbab; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),in_stack_fffffd24,3,-1,-1,1,0); local_14 = 0.0; local_118 = (Entity_Player *)0x0; if (local_5c != (char *)0x0) { do { in_stack_fffffd28 = *(void **)(local_68._4_4_ + (int)local_118 * 4); in_stack_fffffd24 = (EntityList_EL *)0x61dbd9; otherFamiliar = (int *)__RTDynamicCast(); if (((otherFamiliar != (int *)0x0) && ((void *)otherFamiliar[0x104] == this->_player)) && ((*(char *)((int)otherFamiliar + 0x172) != '\0' && (otherFamiliar[0x35c] == 0)))) { local_130.y = (float)((int)local_130.y + 1); if ((piVar13 == (int *)0x0) && (otherFamiliar[0xb] == 0x21)) { piVar13 = otherFamiliar; } } local_118 = (Entity_Player *)&local_118->field_0x1; } while (local_118 < local_5c); if (3 < (int)local_130.y) { if (this->_variant == 0x21) { iVar3 = *(int *)this; } else { if (piVar13 == (int *)0x0) goto LAB_0061dc46; iVar3 = *piVar13; } (**(code **)(iVar3 + 0x28))(); } } LAB_0061dc46: if (this->_exists == 0) { Entity::Update((Entity *)this); if (local_68[0] == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_68._4_4_,0); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (local_68[0] == '\0') { local_14 = 2.8026e-45; tracked_alloc(1,(void *)local_68._4_4_,0); } local_14 = -NAN; game = g_game; } } if ((0 < this->_appearTimer) && ((this->_flags & 4) != 0)) { iVar3 = this->_appearTimer + -1; this->_appearTimer = iVar3; if (iVar3 == 3) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); iVar3 = this->_appearTimer; game = g_game; } this->_visible = iVar3 == 0; if (((this->_variant == 0xce) || (this->_variant == 0xed)) && (game->_frameCount == this->_spawnFrame)) { ai_wisp(this); } Entity::Update((Entity *)this); ExceptionList = local_1c; return; } if (0 < this->_sirenCharmFrames) { this->_sirenCharmFrames = this->_sirenCharmFrames + 1; } if (this->_isLilDelirium != 0) { bVar1 = Entity::IsFrame((Entity *)this,300,this->_index); if (bVar1 != 0) { delirium_morph(this); } game = g_game; } if (this->_state == 0) { in_XMM0_Da = (Entity_Familiar *)this->_updateTime; if ((float)in_XMM0_Da == 0.0) { ResolveOrbitConflict(this); game = g_game; } } uVar4 = this->_variant; if (900 < uVar4) goto switchD_0061ddf2_caseD_12; if (uVar4 == 900) { bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { animName = "FlyingIdle"; if (this->_entityGridCollisionClass != 3) { animName = (char *)s_Idle; } ANM2::Play(&this->_sprite,(byte *)animName,0); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar1 = Room::is_type_16(room); if (bVar1 == 0) { bVar1 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero); if (bVar1 != 0) { PathFinder::UpdateGridIndex((PathFinder *)&this->_pathfinder); Vector::operator_assign(&this->_targetPosition,&this->_pos); } pVVar11 = Vector::__sub(&this->_targetPosition,(Vector *)(local_78 + 8),&this->_pos); Vector::operator_assign(&this->_velocity,pVVar11); room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar3 = PathFinder::GetGridIndex(); Room::SetGridPath(room,iVar3,0x3b6); } else { in_XMM0_Da = (Entity_Familiar *)(this->_friction * 0.95); this->_friction = (float)in_XMM0_Da; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,(EntityList_EL *)local_1a4,&this->_pos,30.0,2); local_14 = 1.82169e-44; pEVar16 = (Entity_Player *)0x0; local_118 = (Entity_Player *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::HasEntityFlags((Entity *)*puVar8,0x20000000); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); Entity::Position((Entity *)*puVar8,(Vector *)(local_78 + 8)); Entity::Position(this->_player,(Vector *)(local_68 + 8)); FUN_00a0ff70(); pEVar16 = local_118; local_148.y = (float)in_XMM0_Da; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Position((Entity *)*puVar8,(Vector *)&local_1b8._h); Vector::__sub(&this->_pos,&local_140,pVVar11); local_150.y = Vector::LengthSquared(&local_140); in_XMM0_Da = (Entity_Familiar *)local_148.y; if (local_150.y < local_148.y) { tmpEntity = (Entity_Familiar *)local_148.y; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,(Vector *)&local_208._h); Vector::Normalized(pVVar11,&local_16c); Vector::Normalized(&local_140,&local_17c); puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,&local_1f0); local_160.y = Vector::Length(pVVar11); Vector::__mul(&local_17c,&local_130,&local_160.y); FUN_00a10160(); FUN_0060cc20(); local_148.y = (float)tmpEntity / 3.1415927; local_150.y = 0.99; puVar8 = (undefined4 *)std::min(); local_11c = (Entity_Familiar *)*puVar8; puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar8; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,(Vector *)&local_258._h); pVVar11 = Vector::__mul(pVVar11,(Vector *)&local_248._h,(float *)&local_11c); in_XMM0_Da = (Entity_Familiar *)(1.0 - (float)local_11c); local_128.y = (float)in_XMM0_Da; pVVar10 = Vector::__mul(&local_130,&local_238,&local_128.y); pVVar11 = Vector::__add(pVVar11,&local_230,pVVar10); Entity::SetVelocity(tmpEntity,pVVar11); pEVar16 = local_118; this = self; } } pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_118 = pEVar16; puVar9 = (undefined1 *)EntityList::Size(); } while (pEVar16 < puVar9); } puVar9 = local_1a4; goto LAB_006241ee; } switch(uVar4) { case 2: switchD_0061ddf2_caseD_2: ai_auto_shooter(this); break; case 3: case 0x19: case 0x3b: case 0x68: case 0x82: case 0xd5: case 0xd6: case 0xdf: case 0xe8: ai_charger(this); break; case 8: case 0xf4: Level::GetCurrentRoom(); FUN_0043eed0(); pVVar11 = Entity::Position(this->_player,&local_150); Vector::__sub(pVVar11,&local_148,&local_140); if (this->_variant == 0xf4) { pVVar11 = RandomVector(&local_150,this->_initSeed); RNG::game_constructor((RNG *)local_78,this->_initSeed,0x13); local_14 = 4.2039e-45; local_11c = (Entity_Familiar *)RNG::RandomFloat(this_01); pVVar11 = Vector::__mul(pVVar11,&local_160,(float *)&local_11c); local_16c.y = 30.0; pVVar11 = Vector::__mul(pVVar11,&local_128,&local_16c.y); Vector::operator_add_assign(&local_140,pVVar11); local_14 = -NAN; guard_check_icall(); } Vector::__sub(&local_140,&local_150,&local_148); FollowPosition(this); Shoot(this); break; case 0xd: MoveDiagonally(this); local_11c = (Entity_Familiar *)0x3f4ccccd; Vector::operator_mul_assign(&this->_velocity,(float *)&local_11c); Shoot(this); break; case 0xe: case 0xf: case 0x3f: ai_flying_bird(this); break; case 0x10: ai_daddy_longlegs(this); break; case 0x11: case 0xcf: MoveDiagonally(this); ANM2::Play(&this->_sprite,(byte *)"Float",0); break; case 0x14: case 0x15: case 0x16: case 0x17: case 0x39: case 0x52: case 0x5b: case 0x72: FollowParent(this); bVar1 = ANM2::IsFinishedImpl(&this->_sprite,s_Spawn); if (bVar1 != 0) { if (this->_variant != 0x17) goto LAB_00623343; ANM2::Play(&this->_sprite,(byte *)"Float",0); } break; case 0x18: case 0x40: case 0x5a: case 0x66: ai_pickup_sack(this); break; case 0x1c: ai_key_full(this); break; case 0x2a: tmpEntity = (Entity_Familiar *)(this->_subtype + 1); local_11c = tmpEntity; local_128.y = Vector::LengthSquared(&this->_velocity); if (1.0 <= local_128.y) { animName = "Idle%u"; } else { animName = "Float%u"; } sprintf_s(animNameBuf,0x32,(byte *)animName); ANM2::Play(&this->_sprite,animNameBuf,0); pVVar11 = Entity::Position(this->_player,&local_158); Vector::__sub(&this->_pos,&local_140,pVVar11); local_128.y = Vector::LengthSquared(&local_140); if (local_128.y <= 900.0) { local_130.y = (float)((double)(int)tmpEntity + __uint_to_double_fixup[-((int)tmpEntity >> 0x1f)]); } else { pVVar11 = Vector::Normalized(&local_140,&local_158); local_130.y = (float)((double)(int)local_11c + __uint_to_double_fixup[-((int)local_11c >> 0x1f)]); local_128.y = local_130.y + local_130.y + 15.0; fVar20 = Vector::Length(&local_140); local_16c.y = local_128.y - fVar20; local_120 = (Entity_Familiar *)0x3fb33333; pfVar12 = (float *)std::min(); pVVar11 = Vector::__mul(pVVar11,&local_174,pfVar12); local_164 = 0.07; pVVar11 = Vector::__mul(pVVar11,&local_184,&local_164); Vector::operator_add_assign(&this->_velocity,pVVar11); } local_128.y = local_130.y * 0.01 + 0.87; Vector::operator_mul_assign(&this->_velocity,&local_128.y); game = g_game; this->_mass = local_130.y * 3.0 + 3.0; this->_collisionDamage = local_130.y + local_130.y + 3.0; Level::GetCurrentRoom((Level *)game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,(EntityList_EL *)local_78,3,this->_variant,-1,0,0); local_14 = 8.40779e-45; uVar4 = 0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); cVar2 = Entity::Exists((Entity *)*puVar8); if ((cVar2 != '\0') && (piVar13 = (int *)std::vector::operator_index(), (Entity_Familiar *)*piVar13 != this )) { puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Position((Entity *)*puVar8,&local_158); Vector::__sub(&this->_pos,&local_17c,pVVar11); local_128.y = 0.0; fVar20 = Vector::Length(&local_17c); local_11c = (Entity_Familiar *)(20.0 - fVar20); pfVar12 = (float *)std::max(); Vector::Resize(&local_17c,*pfVar12 * 0.1); Vector::operator_add_assign(&this->_velocity,&local_17c); } uVar4 = uVar4 + 1; uVar6 = EntityList::Size(); } while (uVar4 < uVar6); } LAB_0061f2a8: puVar9 = local_78; goto LAB_006241ee; case 0x2b: ai_blue_fly(this); break; case 0x2d: case 0x46: pVVar11 = Entity::Position(this->_player,&local_158); pVVar11 = GetOrbitPosition(this,&local_174,pVVar11); pVVar11 = Vector::__sub(pVVar11,&local_184,&this->_pos); Vector::operator_assign(&this->_velocity,pVVar11); Shoot(this); break; case 0x2e: case 0x2f: case 0x38: ai_walker(this); break; case 0x30: FamiliarAI::bobs_brain(this); break; case 0x32: ai_orbital_variant_50(this); break; case 0x33: bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&DAT_00b1d3b0); if (bVar1 != 0) { ANM2::Play(&this->_sprite,s_Idle,0); Entity_Player::UseActiveItem(this->_player,(short *)((int)&local_134 + 2),0x23,1,-1,0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,1,0,(Entity_Player *)0x0); } goto LAB_0061f886; case 0x34: ANM2::Play(&this->_sprite,(byte *)"FloatDown",0); FollowParent(this); bVar1 = Entity::IsFrame((Entity *)this,4,0); if (bVar1 != 0) { uVar4 = Random(); uVar6 = 0x2c; LAB_0061f94f: Game::Spawn(g_game,1000,uVar6,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); fVar20 = random_float(); pfVar12 = &local_128.y; pVVar11 = &local_158; local_128.y = fVar20 * 0.5 + 0.2; LAB_0061dea4: pVVar11 = Vector::__mul(&g_vectorOne,pVVar11,pfVar12); Entity::SetSpriteScale(tmpEntity,pVVar11); (**(code **)(*(int *)tmpEntity + 0xc))(); } break; case 0x35: FamiliarAI::variant_53(this); break; case 0x37: FollowParent(this); bVar1 = Entity::IsFrame((Entity *)this,3,0); if (bVar1 != 0) { fVar20 = random_float(); local_128.y = fVar20 * 0.5 + 0.2; uVar4 = Random(); Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); pVVar11 = Vector::Vector(&local_158,local_128.y,local_128.y); Entity::SetSpriteScale(tmpEntity,pVVar11); (**(code **)(*(int *)tmpEntity + 0xc))(); } bVar1 = Entity::IsFrame((Entity *)this,2,0); if ((bVar1 != 0) && (uVar4 = Isaac::Random(5), 1 < uVar4)) { uVar4 = Random(); uVar6 = 0x2e; goto LAB_0061f94f; } break; case 0x3a: this->_entityGridCollisionClass = 3; if (this->_subtype == 0) { layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); local_130.y = (layer->_size).x; if (1.0 <= local_130.y) { this->_entityCollisionClass = 3; } else { local_130.y = local_130.y + 0.05; if (1.0 <= local_130.y) { local_130.y = 1.0; } pVVar11 = Vector::__mul(&g_vectorOne,&local_158,&local_130.y); layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); Vector::operator_assign(&layer->_size,pVVar11); } this->_visible = 1; MoveDiagonally(this); } else { pVVar11 = &g_vectorZero; this->_entityCollisionClass = 0; this->_visible = 0; layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); Vector::operator_assign(&layer->_size,pVVar11); Vector::operator_assign(&this->_velocity,&g_vectorZero); if ((0 < this->_counter) && (iVar3 = this->_counter + -1, this->_counter = iVar3, iVar3 < 1)) { this->_subtype = 0; if (this->_player != (Entity *)0x0) { pVVar11 = Entity::Position(this->_player,&local_158); Vector::operator_assign(&this->_pos,pVVar11); } } } break; case 0x3d: case 0x6c: case 0xe6: FollowParent(this); ai_incubus_shot(); break; case 0x3e: tmpEntity = this->_player; iVar3 = Game::Challenge(); if (iVar3 == 0x1e) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,(EntityList_EL *)local_78,3,0x43,-1,0,0); local_14 = 1.12104e-44; iVar3 = EntityList::Size(); if (iVar3 != 0) { puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar8; } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_78); } else { iVar3 = Entity_Player::GetPlayerType(this->_player); if ((iVar3 == 0x23) && (iVar3 = Entity_Player::GetOtherTwin(this->_player), iVar3 != 0)) { tmpEntity = (Entity *)Entity_Player::GetOtherTwin(this->_player); } } if (this->_state == 0) { Entity::Position(tmpEntity,&local_148); bVar1 = Entity::is_player(tmpEntity); if (bVar1 != 0) { pVVar11 = (Vector *)Entity_Player::GetAimDirection(this->_player); local_128.y = 60.0; pVVar11 = Vector::__mul(pVVar11,&local_158,&local_128.y); Vector::operator__(&local_148,pVVar11); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_16c.y = (float)&this->_pos; pVVar11 = Vector::__sub((Vector *)local_16c.y,&local_174,&local_148); pVVar11 = Vector::Resized(pVVar11,&local_184,40.0); pVVar11 = Vector::__add(&local_148,&local_18c,pVVar11); Room::GetClampedPosition(room,&local_150,pVVar11,6.0); pVVar11 = &this->_pos; local_128.y = Vector::Distance(pVVar11,&local_148); if (40.0 < local_128.y) { local_128.y = ((local_128.y - 40.0) / local_128.y) * 0.4; pVVar10 = Vector::__sub(&local_150,&local_158,pVVar11); pVVar10 = Vector::__mul(pVVar10,&local_174,&local_128.y); Vector::operator_assign(&this->_velocity,pVVar10); local_11c = (Entity_Familiar *)Vector::Length(&this->_velocity); if (15.0 < (float)local_11c) { Vector::Resize(&this->_velocity,15.0); } } this->_friction = this->_friction * 0.8; if ((this->_fireCooldown < 1) && (bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty), bVar1 != 0)) { ANM2::Play(&this->_sprite,(byte *)"FloatDown",0); } local_130.y = (float)Entity_Player::GetFireDirection(this->_player); EntityPtr::clear((EntityPtr *)&local_160); bVar1 = TryAimAtMarkedTarget(this,&local_160,&this->_lastDirection,(Vector *)0x0); if ((bVar1 != 0) && (0x1d < this->_fireCooldown)) { local_130.y = -NAN; } cVar2 = CanPlayerFire(this); if (cVar2 != '\0') { iVar3 = this->_fireCooldown; if ((Entity_Player *)local_130.y == (Entity_Player *)0xffffffff) { if (0 < iVar3) { if (iVar3 < 0x1e) { ANM2::Play(&this->_sprite,(byte *)"FloatDown",0); } else { ANM2::Play(&this->_sprite,(byte *)"ChargeAttack",1); this->_fireCooldown = 0; bVar1 = Entity_Player::HasCollectible(this->_player,0xf7,0); local_134 = (Entity_Tear *)CONCAT13(bVar1,(undefined3)local_134); if (bVar1 == 0) { local_118 = (Entity_Player *)0x42f00000; } else { local_118 = (Entity_Player *)0x43340000; } Game::ButterBeanFart(g_game,pVVar11,(float)local_118,this->_player,0,0); Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius (entityList,(EntityList_EL *)local_78,pVVar11,(float)local_118,8); local_14 = 1.26117e-44; local_120 = (Entity_Familiar *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity_Familiar *)*puVar8; local_11c = tmpEntity; bVar1 = Entity::IsVulnerableEnemy((Entity *)tmpEntity,(Entity *)0x0); if (bVar1 != 0) { bVar1 = Entity::IsDescendantOf((Entity *)tmpEntity,(Entity *)this->_spawnerEntity); if (bVar1 == 0) { fVar18 = (float10)Entity::Mass((Entity *)tmpEntity); local_128.y = (float)fVar18; if (0.0 < local_128.y) { bVar1 = Entity::HasEntityFlags((Entity *)tmpEntity,0x4000000); if (bVar1 == 0) { bVar1 = Entity::HasEntityFlags((Entity *)tmpEntity,0x20000000); if (bVar1 == 0) { pVVar11 = Entity::Position((Entity *)tmpEntity,&local_158); Vector::__sub(pVVar11,&local_140,&this->_pos); local_118 = (Entity_Player *)Vector::Length(&local_140); Vector::__div_assign(&local_140,(float *)&local_118); fVar18 = (float10)Entity::Mass((Entity *)tmpEntity); pEVar16 = (Entity_Player *)(float)fVar18; if (local_134._3_1_ != '\0') { local_130.y = (float)pEVar16; FUN_00431260(); } local_130.y = (float)pEVar16; FUN_00417340(); local_118 = (Entity_Player *) ((float)local_118 - ((float)pEVar16 + this->_size)); fVar20 = assert_lerp_range(local_130.y + (float)local_118,10.0,120.0, 20.0,1.0,1); FUN_00407140(); local_128.y = 16.0; pVVar11 = Vector::__mul(&local_140,&local_174,&local_128.y); EntityRef::constructor((EntityRef *)(local_a8 + 4),(Entity *)self); Entity::AddKnockback ((Entity *)local_11c,(EntityRef *)(local_a8 + 4),pVVar11, (int)fVar20,1); this = self; } } } } } puVar14 = &local_120->field_0x1; local_120 = (Entity_Familiar *)puVar14; puVar9 = (undefined1 *)EntityList::Size(); } while (puVar14 < puVar9); pVVar11 = &this->_pos; } SoundEffects::PlayWithFartOverride(0x45,2.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0xb2,1.0,2,0,1.0); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,pVVar11,&g_vectorZero,(Entity *)this, (local_134._3_1_ != '\0') + 3,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); if (local_134._3_1_ != '\0') { local_118 = (Entity_Player *)0x3; do { MusicManager::RandomVector(&local_140); uVar4 = Random(); fVar20 = random_float(); local_128.y = fVar20 * 4.0 + 8.0; pVVar11 = Vector::operator_mul(&local_158,&local_128.y,&local_140); local_11c = (Entity_Familiar *)0x41200000; pVVar10 = Vector::operator_mul(&local_174,(float *)&local_11c,&local_140); pVVar10 = Vector::__add((Vector *)local_16c.y,&local_184,pVVar10); this = self; tmpEntity = Game::Spawn(g_game,1000,2,pVVar10,pVVar11,(Entity *)self,3,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); local_118 = (Entity_Player *)((int)&local_118[-1]._replacedPlayer + 3); } while (local_118 != (Entity_Player *)0x0); pVVar11 = &this->_pos; local_118 = (Entity_Player *)0x0; } uVar4 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x2e,pVVar11,&g_vectorZero,(Entity *)this,0,uVar4); if (local_134._3_1_ == '\0') { local_128.y = 1.2; } else { local_128.y = 3.0; } pVVar11 = Vector::operator_mul(&local_158,&local_128.y,&g_vectorOne); Entity::SetSpriteScale((Entity *)effect,pVVar11); Entity_Effect::SetTimeout(effect,0x1c2); (**(code **)(*(int *)effect + 0xc))(); local_118 = (Entity_Player *)0x0; do { Vector::FromAngle(&local_140, (float)((double)(int)local_118 + __uint_to_double_fixup[-((int)local_118 >> 0x1f)]) * 360.0 * 0.125); uVar4 = Random(); local_128.y = 12.0; pVVar11 = Vector::__mul(&local_140,&local_158,&local_128.y); tmpEntity = Game::Spawn(g_game,2,1,&this->_pos,pVVar11,(Entity *)this,0,uVar4); (**(code **)(*(int *)tmpEntity + 0x40))(); (**(code **)(*(int *)tmpEntity + 0xc))(); local_118 = (Entity_Player *)&local_118->field_0x1; } while (local_118 < &DAT_00000008); if (local_134._3_1_ != '\0') { local_118 = (Entity_Player *)0xa; do { MusicManager::RandomVector(&local_140); local_128.y = 10.0; Vector::operator_mul_assign(&local_140,&local_128.y); fVar20 = random_float(); local_11c = (Entity_Familiar *)(fVar20 * 0.2 + 0.7); Vector::operator_mul_assign(&local_140,(float *)&local_11c); uVar4 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,2,1,&this->_pos,&local_140,(Entity *)this,0,uVar4); Entity_Projectile::set_falling_accel((Entity_Projectile *)tear,0.8); random_float(); FUN_00444c70(); iVar3 = Isaac::Random(2); if (iVar3 == 0) { fVar20 = random_float(); Entity_Tear::SetScale(tear,fVar20 * 0.05 + 0.9); } else { fVar20 = random_float(); Entity_Tear::SetScale(tear,fVar20 * 0.05 + 1.3); } (**(code **)(*(int *)tear + 0x40))(); (**(code **)(*(int *)tear + 0xc))(); local_118 = (Entity_Player *)((int)&local_118[-1]._replacedPlayer + 3); } while (local_118 != (Entity_Player *)0x0); } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_78); pVVar11 = &this->_pos; } this->_fireCooldown = 0; } } else { if ((iVar3 < 1) && (bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty), bVar1 == 0)) { animState = (AnimationState *)Config::GetPillEffects(); bVar1 = AnimationState::IsLoopingAnimation(animState); if (bVar1 == 0) goto LAB_00620a2e; } local_11c = (Entity_Familiar *)(this->_fireCooldown + 1); local_128.y = 4.2039e-44; piVar13 = (int *)std::min(); iVar3 = *piVar13; this->_fireCooldown = iVar3; if (0x12 < iVar3) { bVar1 = ANM2::IsPlaying(&this->_sprite,(byte *)"FloatDown"); if (bVar1 != 0) { ANM2::Play(&this->_sprite,(byte *)"ChargeStart",0); goto LAB_00620a2e; } } bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&this->_sprite,(byte *)"ChargeLoop",0); } } } LAB_00620a2e: cVar2 = Entity::IsDead(this->_player); if (cVar2 != '\0') { this->_state = 1; this->_visible = 0; this->_shadowSize = 0.0; this->_entityCollisionClass = 0; uVar4 = Random(); Game::Spawn(g_game,1000,2,pVVar11,&g_vectorZero,(Entity *)0x0,1,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); pVVar11 = Vector::Vector(&local_158,0.0,-10.0); Entity::SetPositionOffset(tmpEntity,pVVar11); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); Entity::BloodExplode((Entity *)this); } } else { cVar2 = Entity::IsDead(this->_player); if (cVar2 == '\0') { pVVar11 = Entity::Position(this->_player,&local_158); pVVar10 = Vector::Vector(&local_174,0.0,10.0); pVVar11 = Vector::__add(pVVar11,&local_184,pVVar10); Vector::operator_assign(&this->_pos,pVVar11); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)self,0,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); self->_state = 0; self->_visible = 1; self->_shadowSize = *(float *)((int)self->_config + 0x24); self->_entityCollisionClass = 4; goto LAB_00624200; } } break; case 0x42: FamiliarAI::variant_66(this); break; case 0x43: FamiliarAI::punching_bag(this); break; case 0x44: pVVar11 = Entity::Position(this->_player,&local_158); GetOrbitPosition(this,&local_148,pVVar11); pVVar11 = Vector::__sub(&local_148,&local_158,&this->_pos); Vector::operator_assign(&this->_velocity,pVVar11); playerEffects = (TemporaryEffects *)Entity_Player::GetEffects(this->_player); bVar1 = TemporaryEffects::HasCollectibleEffect(playerEffects,0x2d9); if (bVar1 == 0) { bVar1 = Entity_Player::IsFullSpriteRendering(this->_player); this->_entityCollisionClass = 4; this->_visible = bVar1 == 0; pVVar10 = Entity::Position(this->_player,&local_158); pVVar11 = &local_148; goto LAB_0061ef12; } this->_visible = 0; this->_entityCollisionClass = 0; break; case 0x47: case 0x48: ai_walker(this); Shoot(this); break; case 0x49: FamiliarAI::blue_spider(this); break; case 0x4a: if ((this->_subtype == 1) || ((bVar1 = Entity_Player::HasCollectible(this->_player,0x71,0), bVar1 != 0 && (iVar3 = Entity_Player::GetFireDirection(this->_player), iVar3 == -1)))) goto switchD_0061ddf2_caseD_2; case 1: case 4: case 5: case 6: case 7: case 9: case 10: case 0xb: case 0xc: case 0x36: case 0x51: case 0x5c: case 0x61: case 0xd1: case 0xdc: FollowParent(this); Shoot(this); break; case 0x4b: ai_samsons_chains(this); break; case 0x4c: case 0x50: FollowParent(this); update_weapon(); break; case 0x4d: ai_blue_babys_only_friend(this); break; case 0x4e: this->_friction = this->_friction * 0.8; Vector::operator_assign(&this->_velocity,&g_vectorZero); if (this->_state == 0) { this->_state = 1; } pVVar10 = Entity::Position(this->_player,&local_158); pVVar11 = &this->_pos; LAB_0061ef12: pVVar11 = Vector::__sub(pVVar11,&local_174,pVVar10); local_140.x = pVVar11->x; local_140.y = pVVar11->y; FUN_007792f0(); break; case 0x4f: FamiliarAI::lil_haunt(this,0); break; case 0x53: uVar4 = 2; Game::GetField26614(game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { uVar4 = 6; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,(EntityList_EL *)local_78,&this->_pos,30.0,uVar4); local_14 = 7.00649e-45; pEVar16 = (Entity_Player *)0x0; local_130.y = 0.0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::HasEntityFlags((Entity *)*puVar8,0x20000000); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsDescendantOf((Entity *)*puVar8,(Entity *)this->_spawnerEntity); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); Entity::Position((Entity *)*puVar8,&local_160); Entity::Position(this->_player,&local_220); FUN_00a0ff70(); pEVar16 = (Entity_Player *)local_130.y; local_11c = in_XMM0_Da; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Position((Entity *)*puVar8,&local_218); Vector::__sub(&this->_pos,&local_17c,pVVar11); local_120 = (Entity_Familiar *)Vector::LengthSquared(&local_17c); in_XMM0_Da = local_11c; if ((float)local_120 < (float)local_11c) { tmpEntity = local_11c; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,&local_210); Vector::Normalized(pVVar11,&local_150); Vector::Normalized(&local_17c,&local_148); local_11c = (Entity_Familiar *)0x41700000; Vector::__mul(&local_148,&local_140,(float *)&local_11c); FUN_00a10160(); FUN_0060cc20(); local_11c = (Entity_Familiar *)((float)tmpEntity / 3.1415927); local_16c.y = 0.99; puVar8 = (undefined4 *)std::min(); local_118 = (Entity_Player *)*puVar8; puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar8; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,&local_228); pVVar11 = Vector::__mul(pVVar11,&local_1e0,(float *)&local_118); local_164 = 1.0 - (float)local_118; pVVar10 = Vector::__mul(&local_140,&local_1e8,&local_164); pVVar11 = Vector::__add(pVVar11,&local_1c0,pVVar10); Entity::SetVelocity(tmpEntity,pVVar11); pEVar16 = (Entity_Player *)local_130.y; if ((float)local_120 < 400.0) { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsProjectile((Entity *)*puVar8); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsTear((Entity *)*puVar8); if (bVar1 == 0) goto LAB_0061ebc3; puVar8 = (undefined4 *)std::vector::operator_index(); projectile = (Entity_Projectile *)*puVar8; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,&local_18c); pVVar11 = Vector::__mul(pVVar11,&local_184,(float *)&local_118); local_128.y = 1.0 - (float)local_118; pVVar10 = Vector::__mul(&local_140,&local_174,&local_128.y); pVVar11 = Vector::__add(pVVar11,&local_158,pVVar10); Entity_Projectile::Deflect(projectile,(Entity *)self,pVVar11); } else { puVar8 = (undefined4 *)std::vector::operator_index(); projectile = (Entity_Projectile *)*puVar8; puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Velocity((Entity *)*puVar8,&local_1c8); pVVar11 = Vector::__mul(pVVar11,&local_1d0,(float *)&local_118); local_134 = (Entity_Tear *)(1.0 - (float)local_118); pVVar10 = Vector::__mul(&local_140,&local_1d8,(float *)&local_134); pVVar11 = Vector::__add(pVVar11,&local_194,pVVar10); Entity_Projectile::Reflect(projectile,(Entity *)self,pVVar11); } pEVar16 = (Entity_Player *)local_130.y; } LAB_0061ebc3: in_XMM0_Da = local_120; if ((float)local_120 < 64.0) { puVar8 = (undefined4 *)std::vector::operator_index(); Entity::Die((Entity *)*puVar8); } this = self; } } } pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_130.y = (float)pEVar16; puVar9 = (undefined1 *)EntityList::Size(); } while (pEVar16 < puVar9); } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_78); case 0x1e: case 0x1f: case 0x20: case 0x21: case 0x23: case 0x2c: case 0x3c: case 0x41: case 0x45: case 0x54: case 0x75: case 0x79: case 0x7e: pVVar11 = Entity::Position(this->_player,&local_158); pVVar10 = GetOrbitPosition(this,&local_174,pVVar11); pVVar11 = &this->_pos; LAB_0061ec34: pVVar11 = Vector::__sub(pVVar10,&local_184,pVVar11); Vector::operator_assign(&this->_velocity,pVVar11); break; case 0x55: FamiliarAI::lost_fly(this); break; case 0x56: room = (Room *)Level::GetCurrentRoom(); bVar1 = Room::IsClear(room); if (bVar1 != 0) { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 == '\0') goto switchD_0061ddf2_caseD_70; } iVar3 = Entity::FrameCount((Entity *)this); if ((0 < iVar3) && (((iVar3 = Entity::FrameCount((Entity *)this), iVar3 % 900 == 0 && (iVar3 = Isaac::Random(2), iVar3 == 0)) || (iVar3 = Entity::FrameCount((Entity *)this), iVar3 % 0x708 == 0)))) { if (this->_coins < 2) { uVar4 = RNG::RandomInt(&this->_dropRNG,3); if (uVar4 == 2) goto LAB_0061e0cf; LAB_0061e0e9: if (uVar4 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,&local_140,&this->_pos,0.0,0,0,0); uVar4 = Random(); Game::Spawn(g_game,5,0x5a,&local_140,&g_vectorZero,(Entity *)this,0,uVar4); ANM2::Play(&this->_sprite,s_Spawn,1); iVar3 = 0x3f3; } else { if (uVar4 != 1) { if (uVar4 == 2) { Level::GetCurrentRoom((Level *)g_game); local_130.y = (float)Room::GetEntities(); tmpEntity = (Entity_Familiar *)0x0; local_120 = (Entity_Familiar *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsVulnerableEnemy((Entity *)*puVar8,(Entity *)0x0); if (bVar1 != 0) { puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar8; EntityRef::constructor((EntityRef *)(local_a8 + 4),(Entity *)this); Entity::AddFreeze(tmpEntity,(EntityRef *)(local_a8 + 4),-0x28,0); tmpEntity = local_120; } tmpEntity = (Entity_Familiar *)&tmpEntity->field_0x1; local_120 = tmpEntity; puVar9 = (undefined1 *)EntityList::Size(); } while (tmpEntity < puVar9); } ANM2::Play(&this->_sprite,&DAT_00b63f60,1); SoundEffects::PlayWithFartOverride(0x3f5,1.0,2,0,1.0); } else if (uVar4 != 2) goto LAB_0061e295; goto switchD_0061ddf2_caseD_70; } Entity_Player::AddActiveCharge(this->_player,1,-1,0,0,0); ANM2::Play(&this->_sprite,&DAT_00b63f60,1); iVar3 = 0x3f4; } SoundEffects::PlayWithFartOverride(iVar3,1.0,2,0,1.0); } else { uVar4 = 2; LAB_0061e0cf: Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 == '\0') goto LAB_0061e0e9; } LAB_0061e295: this->_coins = this->_coins + 1; } case 0x70: switchD_0061ddf2_caseD_70: FollowParent(this); bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&this->_sprite,s_Idle,0); } break; case 0x57: ai_lil_gurdy(this); break; case 0x58: FamiliarAI::bumbo(this); break; case 0x59: uVar4 = 10; Game::GetField26614(game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { uVar4 = 0xe; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); uVar21 = 0x61e536; EntityList::QueryRadius(entityList,(EntityList_EL *)local_78,&this->_pos,150.0,uVar4); local_14 = 5.60519e-45; pEVar16 = (Entity_Player *)0x0; local_118 = (Entity_Player *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); uVar22 = 0x61e56c; bVar1 = Entity::HasEntityFlags((Entity *)*puVar8,0x20000000); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsVulnerableEnemy((Entity *)*puVar8,(Entity *)0x0); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); iVar3 = Entity::Type((Entity *)*puVar8); if (iVar3 == 9) { puVar8 = (undefined4 *)std::vector::operator_index(); uVar21 = 0; in_stack_fffffd28 = (void *)*puVar8; in_stack_fffffd24 = (EntityList_EL *)0x61e61e; local_118 = (Entity_Player *)__RTDynamicCast(); if ((local_118 != (Entity_Player *)0x0) && (projectileFlags = Entity_Projectile::ProjectileFlags((Entity_Projectile *)local_118), (projectileFlags & 0x1000000) == 0)) { pVVar11 = Entity::Velocity((Entity *)local_118,&local_140); local_11c = (Entity_Familiar *)0x3f000000; pVVar11 = Vector::__mul(pVVar11,&local_17c,(float *)&local_11c); Entity::SetVelocity((Entity *)local_118,pVVar11); Entity_Projectile::AddProjectileFlags((Entity_Projectile *)local_118); } } else { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsTear((Entity *)*puVar8); if (bVar1 != 0) { puVar8 = (undefined4 *)std::vector::operator_index(); uVar21 = 0; in_stack_fffffd28 = (void *)*puVar8; in_stack_fffffd24 = (EntityList_EL *)0x61e6cb; local_130.y = (float)__RTDynamicCast(); if ((Entity_Player *)local_130.y != (Entity_Player *)0x0) { pBVar5 = (BitSet128 *)FUN_00435bc0(); pBVar23 = Entity_Tear::TearFlags((Entity_Tear *)local_130.y,&local_1b8); pBVar5 = BitSet128::operator_and(&local_208,pBVar23,pBVar5); bVar1 = BitSet128::IsZero(pBVar5); fVar20 = local_130.y; if ((bVar1 != 0) && (bVar1 = Entity::IsDescendantOf ((Entity *)local_130.y,(Entity *)this->_spawnerEntity), bVar1 == 0)) { pVVar11 = Entity::Velocity((Entity *)fVar20,&local_150); local_16c.y = 0.5; pVVar11 = Vector::__mul(pVVar11,&local_160,&local_16c.y); Entity::SetVelocity((Entity *)fVar20,pVVar11); pBVar5 = (BitSet128 *)FUN_00435bc0(); pBVar23 = Entity_Tear::TearFlags((Entity_Tear *)local_130.y,&local_258); pBVar5 = BitSet128::operator_or(&local_248,pBVar23,pBVar5); uVar21 = (undefined4)pBVar5->_l; in_stack_fffffd28 = (void *)0x61e7b5; Entity_Tear::SetTearFlags((Entity_Tear *)local_130.y,*pBVar5); } goto LAB_0061e7b5; } } } } else { puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar8; fVar20 = 8.990418e-39; EntityRef::constructor((EntityRef *)(local_a8 + 4),(Entity *)this); bVar1 = 0; Color::Color(0x3f800000,0x28,0x28,0x28); color._tint[1] = (float)in_stack_fffffd10; color._tint[0] = (float)in_stack_fffffd0c; color._tint[2] = (float)in_stack_fffffd14; color._tint[3] = (float)in_stack_fffffd18; color._colorize[0] = (float)in_stack_fffffd1c; color._colorize[1] = (float)in_stack_fffffd20; color._colorize[2] = (float)in_stack_fffffd24; color._colorize[3] = (float)in_stack_fffffd28; color._offset[0] = (float)uVar21; color._offset[1] = (float)uVar22; color._offset[2] = fVar20; Entity::AddSlowing(tmpEntity,(EntityRef *)(local_a8 + 4),2,0.9,color,bVar1); LAB_0061e7b5: pEVar16 = local_118; } } pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_118 = pEVar16; puVar9 = (undefined1 *)EntityList::Size(); } while (pEVar16 < puVar9); } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_78); case 0x1a: case 0x1b: case 0x28: case 0x29: case 0x67: FollowParent(this); break; case 0x5d: FamiliarAI::gb_bug(this); break; case 0x5e: case 0x71: FamiliarAI::spider_mod(this); break; case 0x5f: bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&DAT_00b1d3b0); if (bVar1 != 0) { ANM2::Play(&this->_sprite,s_Idle,0); iVar3 = Isaac::Random(3); if (iVar3 == 0) { Color::Color((Color *)local_a8); Game::Fart(g_game,&this->_pos,85.0,(Entity *)this,1.0,0,color_00); Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,0,0); } else if (iVar3 == 1) { Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,1,0); } else if (iVar3 == 2) { Game::CharmFart(); } } LAB_0061f886: FollowParent(this); if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } goto LAB_00624200; case 0x60: bVar1 = Entity::IsFrame((Entity *)this,7,this->_index); if (bVar1 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,(EntityList_EL *)local_78,&this->_pos,150.0,8); local_14 = 9.80909e-45; pEVar16 = (Entity_Player *)0x0; local_118 = (Entity_Player *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsVulnerableEnemy((Entity *)*puVar8,(Entity *)0x0); if (bVar1 != 0) { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsDescendantOf((Entity *)this,(Entity *)*puVar8); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::HasEntityFlags((Entity *)*puVar8,0x20000010); if (bVar1 == 0) { puVar8 = (undefined4 *)std::vector::operator_index(); pcVar15 = *(code **)(*(int *)*puVar8 + 0x20); EntityRef::constructor((EntityRef *)(local_a8 + 4),(Entity *)self); (*pcVar15)(); pEVar16 = local_118; this = self; } } } pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_118 = pEVar16; puVar9 = (undefined1 *)EntityList::Size(); } while (pEVar16 < puVar9); } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_78); } uVar4 = 0; iVar3 = Game::GetNumPlayers(g_game); if (iVar3 != 0) { do { local_130.y = (float)Game::GetPlayer(g_game,uVar4); Game::GetField26614(g_game); cVar2 = FUN_00429550(); if ((cVar2 == '\0') || (bVar1 = Entity::IsDescendantOf((Entity *)this,(Entity *)local_130.y), bVar1 != 0)) { pVVar11 = Entity::Position((Entity *)local_130.y,&local_158); local_128.y = Vector::DistanceSquared(pVVar11,&this->_pos); if (local_128.y < 10000.0) { FUN_0060d0c0(); } } uVar4 = uVar4 + 1; uVar6 = Game::GetNumPlayers(g_game); } while (uVar4 < uVar6); } MoveDiagonally(this); break; case 0x62: goto switchD_0061ddf2_caseD_62; case 99: ai_lil_monstro(this); goto switchD_0061ddf2_caseD_62; case 100: if ((uint)this->_subtype < (uint)this[1]._pendingDamage) { FollowParent(this); } else { bVar1 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,&DAT_00b63f64); if (bVar1 == 0) { tmpEntity = (Entity_Familiar *)&this->_pos; } else { this->_shadowSize = 0.0; SoundEffects::PlayWithFartOverride(0x35,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x33,1.0,2,0,1.0); playerEffects = (TemporaryEffects *)Entity_Player::GetEffects(this->_player); TemporaryEffects::AddCollectibleEffect(playerEffects,0x1b4,1,1); uVar4 = Random(); local_11c = (Entity_Familiar *)&this->_pos; tmpEntity = Game::Spawn(g_game,1000,0xd,(Vector *)local_11c,&g_vectorZero,(Entity *)this,0, uVar4); pcVar15 = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*pcVar15)(); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar4 = Random(); tmpEntity = local_11c; tmpEntity = Game::Spawn(g_game,1000,0x5a,(Vector *)local_11c,&g_vectorZero,(Entity *)0x0,0, uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); this = self; } this->_friction = this->_friction * 0.5; bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&this->_sprite,s_Idle,0); this->_visible = 0; Vector::operator_assign((Vector *)tmpEntity,&g_vectorZero); goto LAB_0061e4de; } } break; case 0x65: MoveDelayed(this); Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,(EntityList_EL *)local_78,&this->_pos,this->_size,4); local_14 = 1.4013e-44; pEVar16 = (Entity_Player *)0x0; local_118 = (Entity_Player *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); cVar2 = Entity::IsDead((Entity *)*puVar8); if (cVar2 == '\0') { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)Entity::SpawnerEntity((Entity *)*puVar8); bVar1 = Entity::IsDescendantOf((Entity *)this,tmpEntity); if (bVar1 == 0) goto LAB_006213fc; } std::vector::operator_index(); cVar2 = FUN_004d7760(); if (cVar2 == '\0') { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsTear((Entity *)*puVar8); if (bVar1 != 0) { puVar8 = (undefined4 *)std::vector::operator_index(); tear = (Entity_Tear *)Entity::ToTear((Entity *)*puVar8); local_16c.y = (float)tear; iVar3 = Entity::Variant((Entity *)tear); if (iVar3 != 9) { iVar3 = Entity::Variant((Entity *)tear); if (iVar3 != 0x2d) { iVar3 = Entity::Variant((Entity *)tear); if (iVar3 != 0x28) { pBVar23 = &g_tearFlagLudovico; pBVar5 = Entity_Tear::TearFlags(tear,(BitSet128 *)local_68); pBVar5 = BitSet128::operator_and(&local_1b8,pBVar5,pBVar23); bVar1 = BitSet128::IsNonZero(pBVar5); if (bVar1 != 0) { FUN_005cd750(); iVar3 = Entity::GetIntervalTicks((Entity *)tear,(float)in_XMM0_Da,0.0); if (iVar3 == 0) goto LAB_006213f6; } cVar2 = FUN_0060cd60(); if (cVar2 == '\0') { FUN_0060cd70(); iVar3 = FUN_0060cd10(); local_134 = (Entity_Tear *)CONCAT13(0 < iVar3,(undefined3)local_134); if (iVar3 < 1) { pVVar11 = Entity::Velocity((Entity *)tear,&local_158); } else { pfVar12 = (float *)FUN_0060cd40(); local_140.y = pfVar12[1]; pVVar11 = &local_140; local_140.x = *pfVar12; } local_17c.x = pVVar11->x; local_17c.y = pVVar11->y; local_128.y = 1.333; if (local_134._3_1_ == '\0') { pVVar11 = Vector::__mul(&local_17c,&local_184,&local_128.y); Entity::SetVelocity((Entity *)tear,pVVar11); } else { Vector::__mul(&local_17c,&local_174,&local_128.y); FUN_0060cd20(); } fVar18 = (float10)Entity_Tear::Height(tear); Entity_Projectile::SetHeight ((Entity_Projectile *)tear,(float)(fVar18 * (float10)1.5)); pVVar11 = Vector::Rotated(&local_17c,&local_18c,90.0); pVVar11 = Vector::Normalized(pVVar11,&local_194); Vector::operator_assign(&local_17c,pVVar11); pVVar11 = Entity::Position((Entity *)tear,&local_1d8); local_11c = (Entity_Familiar *)0x40a00000; pVVar10 = Vector::__mul(&local_17c,&local_1d0,(float *)&local_11c); pVVar11 = Vector::__sub(pVVar11,&local_1c8,pVVar10); fVar20 = local_16c.y; Entity::SetPosition((Entity *)local_16c.y,pVVar11); iVar3 = Entity::Variant((Entity *)fVar20); if (((iVar3 != 0x23) && (iVar3 = Entity::Variant((Entity *)fVar20), iVar3 != 0x25)) && (iVar3 = Entity::Variant((Entity *)fVar20), iVar3 != 0x26)) { Entity_Tear::ChangeVariant((Entity_Tear *)fVar20,0x15); } tmpEntity = (Entity *)Entity::SpawnerEntity((Entity *)fVar20); tear = Entity_Tear::MakeMultidimensionalCopy((Entity_Tear *)fVar20,tmpEntity); tmpEntity = (Entity *)Entity::Parent((Entity *)fVar20); Entity::SetParent((Entity *)tear,tmpEntity); pVVar11 = Entity::Position((Entity *)fVar20,&local_1c0); local_130.y = 10.0; pVVar10 = Vector::__mul(&local_17c,&local_1e8,&local_130.y); pVVar11 = Vector::__add(pVVar11,&local_1e0,pVVar10); Entity::SetPosition((Entity *)tear,pVVar11); (**(code **)(*(int *)tear + 0xc))(); this = self; } } } } LAB_006213f6: pEVar16 = local_118; } } else { std::vector::operator_index(); local_128.y = (float)FUN_0060cc90(); cVar2 = Entity_Knife::IsFlying((Entity_Knife *)local_128.y); if (cVar2 != '\0') { multidimensional_baby_copy_knife(); } } } LAB_006213fc: pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_118 = pEVar16; puVar9 = (undefined1 *)EntityList::Size(); } while (pEVar16 < puVar9); } PlayFloatAnim(this,3); puVar9 = local_78; LAB_006241ee: local_14 = -NAN; EntityList_Query::~EntityList_Query(puVar9); break; case 0x69: FollowParent(this); bVar1 = Entity::IsFrame((Entity *)this,3,0); if ((bVar1 != 0) && (iVar3 = Isaac::Random(5), iVar3 != 0)) { uVar4 = Random(); Game::Spawn(g_game,1000,0x36,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); fVar20 = random_float(); pfVar12 = (float *)&local_11c; pVVar11 = &local_140; local_11c = (Entity_Familiar *)(fVar20 * 0.5 + 0.2); goto LAB_0061dea4; } break; case 0x6a: if (this->_subtype != 0) { if (this->_visible == 0) { LAB_00620f26: Vector::operator_assign(&this->_velocity,&g_vectorZero); followTarget = (EntityPtr)this->_player; if (this->_parent != (EntityPtr)0x0) { followTarget = this->_parent; } pVVar11 = Entity::Position((Entity *)followTarget,&local_158); Vector::operator_assign(&this->_pos,pVVar11); } else { this->_visible = 0; iVar3 = Isaac::Random(2); local_118 = (Entity_Player *)(iVar3 + 3); if (0 < (int)local_118) { do { uVar4 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar11 = Room::FindFreePickupSpawnPosition(room,&local_158,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,0x17,0,pVVar11,&g_vectorZero,(Entity *)this,1,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); addEnemyKillScore = 0; bVar1 = 0; iVar3 = -1; sourceRef = EntityRef::EntityRef((EntityRef *)(local_a8 + 4)); Entity::AddCharmed(tmpEntity,sourceRef,iVar3,bVar1,addEnemyKillScore); Entity::SetVisibleFlag(tmpEntity,0); (**(code **)(*(int *)tmpEntity + 0xc))(); local_118 = (Entity_Player *)((int)&local_118[-1]._replacedPlayer + 3); } while (local_118 != (Entity_Player *)0x0); } if (this->_visible == 0) goto LAB_00620f26; } this->_friction = this->_friction * 0.7; break; } local_68._4_4_ = "WalkDown"; local_68._8_4_ = &DAT_00b1e020; local_5c = "WalkHori"; local_78._4_4_ = "FlyDown"; local_78._8_4_ = &DAT_00b1ddc0; pcStack_6c = "FlyHori"; bVar1 = Entity::IsFlying(this->_player); puVar9 = local_78; if (bVar1 == 0) { puVar9 = local_68; } local_130.y = (float)(puVar9 + 4); MoveDelayed(this); local_120 = (Entity_Familiar *)Entity::get_velocity_direction((Entity *)this); local_128.y = Vector::LengthSquared(&this->_velocity); if (1.0 <= local_128.y) { sprite = &this->_sprite; if (local_120 == (Entity_Familiar *)0x3) { ANM2::Play(sprite,*(byte **)local_130.y,0); } else if (local_120 == (Entity_Familiar *)0x1) { ANM2::Play(sprite,*(byte **)((int)local_130.y + 4),0); } else { ANM2::Play(sprite,((std_vector *)((int)local_130.y + 8))->_begin,0); Sprite::set_flip_x((Sprite *)&this->_sprite,local_120 == (Entity_Familiar *)0x0); } } else { local_130.y = *(float *)local_130.y; bVar1 = Entity::IsFlying(this->_player); if (bVar1 == 0) { ANM2::SetFrame(&this->_sprite,(std_string *)local_130.y,0); } else { ANM2::Play(&this->_sprite,(byte *)local_130.y,0); } } bVar1 = ANM2::IsPlaying(&this->_sprite,&s_empty); if (bVar1 != 0) { fVar20 = Vector::Length(&this->_velocity); local_118 = (Entity_Player *)(fVar20 * 0.5); fVar20 = 1.0; if ((float)local_118 < 2.3) { fVar20 = assert_lerp_range((float)local_118,1.0,2.3,0.5,1.0,1); } if (6.0 < (float)local_118) { fVar20 = assert_lerp_range((float)local_118,6.0,10.0,1.0,2.0,1); } set_PlaybackSpeed(&this->_sprite,fVar20); } if (this->_variant == 0x6a) { iVar3 = Entity_Player::GetPlayerType(this->_player); if (iVar3 == 0xc) { spriteColor = (KColor *)Sprite::Color((Sprite *)&this->_sprite); blue = 0x24; green = 0x1c; iVar3 = 0xee; } else { spriteColor = (KColor *)Sprite::Color((Sprite *)&this->_sprite); blue = 0xff; green = 0xff; iVar3 = 0xff; } KColor::FromRGBA255(spriteColor,iVar3,green,blue,0xff); } Game::GetField26614(g_game); cVar2 = FUN_00429550(); iVar3 = 0x29a; if (cVar2 != '\0') { iVar3 = 100; } if (iVar3 < this->_state) { this->_subtype = 1; } goto LAB_00624200; case 0x6b: if (this->_subtype == 0) { bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&this->_sprite,(byte *)"Phase2",0); } MoveDiagonally(this); iVar3 = Entity_Player::GetFireDirection(this->_player); if (iVar3 != -1) { this->_subtype = 1; ANM2::Play(&this->_sprite,(byte *)"RevertToPhase1",0); this->_fireCooldown = 0x1e; } } else if (this->_subtype == 1) { sprite = &this->_sprite; local_128.y = (float)sprite; bVar1 = ANM2::IsFinishedImpl(sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(sprite,s_Idle,0); } iVar3 = Entity_Player::GetFireDirection(this->_player); if (iVar3 == -1) { this->_subtype = 0; ANM2::Play(sprite,(byte *)"Phase2Start",0); } game = g_game; this->_friction = this->_friction * 0.85; room = (Room *)Level::GetCurrentRoom((Level *)game); pVVar11 = Room::GetClampedPosition(room,&local_158,&this->_pos,this->_size); Vector::operator_assign(&this->_pos,pVVar11); iVar3 = this->_fireCooldown; this->_fireCooldown = iVar3 + -1; if (iVar3 < 1) { this->_fireCooldown = 0x1e; iVar3 = 0; do { pVVar11 = Vector::Vector(&local_158,0.0,1.0); bVar1 = 0; pVVar11 = Vector::Rotated(pVVar11,&local_174,(float)iVar3 * 45.0); FireProjectile(this,pVVar11,bVar1); iVar3 = iVar3 + 1; } while (iVar3 < 8); ANM2::Play((ANM2 *)local_128.y,(byte *)"RevertToPhase1",0); } } break; case 0x6d: iVar3 = Entity_Player::GetFireDirection(this->_player); if (iVar3 == -1) { FollowParent(this); Entity::SetTarget((Entity *)this,(Entity *)0x0); } else { bVar1 = IsLilithBirthrightIncubus(this); game = g_game; if (bVar1 == 0) { this->_friction = this->_friction * 0.7; room = (Room *)Level::GetCurrentRoom((Level *)game); pVVar11 = Room::GetClampedPosition(room,&local_158,&this->_pos,0.0); Vector::operator_assign(&this->_pos,pVVar11); } else { FollowParent(this); } PickEnemyTarget(this,800.0,8,0x13,&g_vectorZero,15.0); } iVar3 = Entity::get_velocity_direction((Entity *)this); local_128.y = Vector::LengthSquared(&this->_velocity); if (local_128.y < 1.0) { iVar3 = 3; } PlayFloatAnim(this,iVar3); break; case 0x6e: pfVar12 = (float *)Entity_Player::GetAimDirection(this->_player); local_150.x = *pfVar12; local_150.y = pfVar12[1]; bVar1 = Vector::operator_eq(&local_150,&g_vectorZero); if (bVar1 != 0) { iVar3 = Entity_Player::GetHeadDirection(this->_player); pVVar11 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_158,iVar3); Vector::operator_assign(&local_150,pVVar11); bVar1 = Vector::operator_eq(&local_150,&g_vectorZero); if (bVar1 != 0) { pVVar11 = Vector::Vector(&local_158,0.0,1.0); Vector::operator_assign(&local_150,pVVar11); } } local_128.y = Vector::GetAngleDegrees(&local_150); fVar20 = LerpAngleDeg(this->_orbitAngleOffset,local_128.y,0.3); this->_orbitAngleOffset = fVar20; pVVar11 = Entity::Position(this->_player,&local_158); pVVar10 = Vector::FromAngle(&local_174,this->_orbitAngleOffset); local_128.y = 50.0; pVVar10 = Vector::__mul(pVVar10,&local_184,&local_128.y); Vector::__add(pVVar11,&local_160,pVVar10); pVVar11 = Vector::__sub(&local_160,&local_18c,&this->_pos); local_128.y = 0.3; pVVar11 = Vector::__mul(pVVar11,&local_158,&local_128.y); Vector::operator_add_assign(&this->_velocity,pVVar11); this->_friction = this->_friction * 0.7; pVVar11 = Entity::Position(this->_player,&local_194); Vector::__sub(&this->_pos,&local_140,pVVar11); fVar20 = Vector::GetAngleDegrees(&local_140); local_128.y = fVar20 - 90.0; fVar20 = normalize_angle_degrees(local_128.y); Sprite::SetRotation((Sprite *)&this->_sprite,fVar20); fVar18 = (float10)Sprite::Rotation((Sprite *)&this->_sprite); local_128.y = (float)fVar18; local_134 = (Entity_Tear *)CONCAT13(1.0 < local_128.y,(undefined3)local_134); layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); layer->_flipX = local_134._3_1_; Game::GetField26614(g_game); cVar2 = FUN_00429550(); iVar3 = 3; if (cVar2 != '\0') { iVar3 = 0x3c; } bVar1 = Entity::IsFrame((Entity *)this,iVar3,0); if (bVar1 != 0) { pEVar16 = this->_player; pVVar11 = Vector::Normalized(&local_140,&local_158); techLaser = Entity_Player::FireTechLaser(pEVar16,&this->_pos,2,pVVar11,0,1,(Entity *)this,1.0) ; pVVar11 = Vector::Vector(&local_174,0.0,-10.0); Entity::SetPositionOffset((Entity *)techLaser,pVVar11); FUN_0044bf90(); pcVar15 = *(code **)(*(int *)techLaser + 0x40); iVar3 = Entity_Player::GetTearHitParams(); local_128.y = *(float *)(iVar3 + 0x48) * 0.1; apply_tear_modifiers(self); (*pcVar15)(); FUN_0044bfa0(); FUN_00435bc0(); FUN_00456830(); FUN_0060cf00(); set_field_0x37c(); (**(code **)(*(int *)techLaser + 0xc))(); } break; case 0x6f: ai_variant_111(this); break; case 0x73: bVar1 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero); if (bVar1 != 0) { Vector::operator_assign(&this->_targetPosition,&this->_pos); } bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { ANM2::Play(&this->_sprite,s_Fly,0); } bVar1 = Entity::IsFrame((Entity *)this,0x1e,this->_index); if (bVar1 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,(EntityList_EL *)local_78,&this->_pos,150.0,8); local_14 = 1.54143e-44; pEVar16 = (Entity_Player *)0x0; local_130.y = 0.0; local_120 = (Entity_Familiar *)0x471c4000; local_118 = (Entity_Player *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsVulnerableEnemy((Entity *)*puVar8,(Entity *)this); if (bVar1 != 0) { piVar13 = (int *)std::vector::operator_index(); iVar3 = Entity::SpawnerEntity((Entity *)this); pEVar16 = local_118; if (*piVar13 != iVar3) { puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Position((Entity *)*puVar8,&local_158); local_128.y = Vector::DistanceSquared(pVVar11,&this->_pos); if (local_128.y < (float)local_120) { local_120 = (Entity_Familiar *)local_128.y; pfVar12 = (float *)std::vector::operator_index(); local_130.y = *pfVar12; } } } pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_118 = pEVar16; puVar9 = (undefined1 *)EntityList::Size(); fVar20 = local_130.y; } while (pEVar16 < puVar9); if ((Entity_Player *)local_130.y != (Entity_Player *)0x0) { ANM2::Play(&this->_sprite,(byte *)"Attack",1); pVVar11 = Entity::Position((Entity *)fVar20,&local_158); fVar24 = (this->_pos).x; Sprite::set_flip_x((Sprite *)&this->_sprite,pVVar11->x <= fVar24 && fVar24 != pVVar11->x); uVar4 = Random(); pVVar11 = Entity::Position((Entity *)fVar20,&local_158); pVVar10 = Entity::Velocity((Entity *)local_130.y,&local_174); pVVar11 = Vector::__add(pVVar11,&local_184,pVVar10); pVVar10 = &self->_pos; pVVar11 = Vector::__sub(pVVar11,&local_18c,pVVar10); pVVar11 = Vector::Resized(pVVar11,&local_194,10.0); this = self; Game::Spawn(g_game,2,1,pVVar10,pVVar11,(Entity *)self,0,uVar4); tear = (Entity_Tear *)__RTDynamicCast(); local_128.y = apply_tear_modifiers(this); fVar20 = apply_tear_modifiers(this); local_11c = (Entity_Familiar *)(fVar20 * 0.2 + 0.6); (**(code **)(*(int *)tear + 0x40))(); Entity_Tear::SetScale(tear,(float)local_11c); FUN_00444c70(); TryFireTear(this,tear); (**(code **)(*(int *)tear + 0xc))(); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); } } local_14 = -NAN; EntityList_Query::~EntityList_Query(local_78); } Game::GetField26614(g_game); cVar2 = FUN_00429550(); if ((cVar2 != '\0') && (this->_counter = this->_counter + 1, 0x2ed < this->_counter)) { iVar3 = Player(this); if (iVar3 != 0) { pEVar16 = (Entity_Player *)Player(this); playerEffects = (TemporaryEffects *)Entity_Player::GetEffects(pEVar16); TemporaryEffects::RemoveCollectibleEffect(playerEffects,0x1f8,1); } pcVar15 = *(code **)(*(int *)this + 0x24); EntityRef::EntityRef((EntityRef *)(local_a8 + 4)); (*pcVar15)(); } pVVar11 = Vector::__sub(&this->_targetPosition,&local_158,&this->_pos); Vector::operator_assign(&this->_velocity,pVVar11); this->_friction = this->_friction * 0.8; break; case 0x74: pVVar11 = &this->_pos; local_120 = (Entity_Familiar *)pVVar11; pVVar10 = Entity::Position(this->_player,&local_158); Vector::__sub(pVVar11,&local_140,pVVar10); fVar20 = Vector::GetAngleDegrees(&local_140); local_128.y = fVar20 + 45.0; fVar20 = normalize_angle_degrees(local_128.y); local_134 = (Entity_Tear *)(int)((1.0 - (fVar20 + 180.0) / 360.0) * 8.0); if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } local_164 = (float)apply_forgotten_lullaby(this,0xc); if (this->_fireCooldown < 1) { local_130.y = 0.0; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,(EntityList_EL *)local_78,pVVar11,200.0,8); local_14 = 1.68156e-44; iVar3 = EntityList::Size(); if (iVar3 == 0) { LAB_00621e31: fVar20 = 5.60519e-45; } else { uVar4 = 0; do { puVar8 = (undefined4 *)std::vector::operator_index(); pEVar16 = (Entity_Player *)*puVar8; local_118 = pEVar16; bVar1 = Entity::IsVulnerableEnemy((Entity *)pEVar16,(Entity *)0x0); if ((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags((Entity *)pEVar16,0x20000010), bVar1 == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar11 = Entity::Position((Entity *)local_118,&local_158); bVar1 = Room::CheckLine(room,(Vector *)local_120,pVVar11,3,900,0,0,(Vector *)0x0); if (bVar1 != 0) { pVVar11 = Entity::Position((Entity *)local_118,&local_174); pVVar11 = Vector::__sub(pVVar11,&local_184,(Vector *)local_120); pVVar11 = Vector::Normalized(pVVar11,&local_18c); fVar20 = Vector::GetAngleDegrees(&local_140); pVVar10 = Vector::FromAngle(&local_194,fVar20 - 45.0); local_128.y = Vector::Dot(pVVar11,pVVar10); if (0.9 < local_128.y) { local_130.y = (float)local_118; } } } fVar20 = local_130.y; uVar4 = uVar4 + 1; uVar6 = EntityList::Size(); this = self; } while (uVar4 < uVar6); if ((Entity_Player *)fVar20 == (Entity_Player *)0x0) goto LAB_00621e31; pVVar11 = Entity::Position((Entity *)fVar20,&local_158); pVVar11 = Vector::__sub(pVVar11,&local_174,&this->_pos); Vector::operator_assign(&local_140,pVVar11); uVar4 = Random(); pVVar11 = Vector::Normalized(&local_140,&local_158); local_128.y = 10.0; pVVar11 = Vector::__mul(pVVar11,&local_174,&local_128.y); Game::Spawn(g_game,2,1,&this->_pos,pVVar11,(Entity *)this,0,uVar4); tear = (Entity_Tear *)__RTDynamicCast(); FUN_00444c70(); local_11c = (Entity_Familiar *)apply_tear_modifiers(this); fVar20 = apply_tear_modifiers(this); local_16c.y = fVar20 * 0.35 + 0.7; (**(code **)(*(int *)tear + 0x40))(); Entity_Tear::SetScale(tear,local_16c.y); TryFireTear(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); fVar20 = local_164; } local_14 = -NAN; this->_fireCooldown = (int)fVar20; EntityList_Query::~EntityList_Query(local_78); pVVar11 = &this->_pos; } Sprite::SetFrame_1((Sprite *)&this->_sprite,(int)local_134); pVVar10 = Entity::Position(this->_player,&local_158); pVVar10 = GetOrbitPosition(this,&local_174,pVVar10); goto LAB_0061ec34; case 0x76: update_angry_fly(this); break; case 0x77: ai_lil_spewer(this); break; case 0x78: FamiliarAI::sprinkler(); break; case 0x7a: ai_lil_harbingers(this); break; case 0x7b: if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7fc58) && (_Init_thread_header(), DAT_00c7fc58 == -1)) { Color::Color(); Color::Color(); Color::Color(); Color::Color(); _Init_thread_footer(); } pVVar11 = Entity::Position(this->_player,&local_158); pVVar11 = GetOrbitPosition(this,&local_174,pVVar11); local_128.y = (float)&this->_pos; pVVar11 = Vector::__sub(pVVar11,&local_184,(Vector *)local_128.y); Vector::operator_assign(&this->_velocity,pVVar11); Level::GetCurrentRoom((Level *)g_game); local_164 = (float)Room::GetEntities(); pEVar16 = (Entity_Player *)0x0; local_130.y = 0.0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); cVar2 = Entity::IsDead((Entity *)*puVar8); if (cVar2 != '\0') goto LAB_006223ba; puVar8 = (undefined4 *)std::vector::operator_index(); iVar3 = Entity::Type((Entity *)*puVar8); if (iVar3 == 2) { puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Position((Entity *)*puVar8,&local_158); local_11c = (Entity_Familiar *)Vector::DistanceSquared(pVVar11,(Vector *)local_128.y); fVar20 = 625.0; if (625.0 <= (float)local_11c) goto LAB_006223d9; std::vector::operator_index(); local_120 = (Entity_Familiar *)__RTDynamicCast(); cVar2 = FUN_0060cd80(); if (cVar2 == '\0') { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { bVar1 = Entity::IsDescendantOf((Entity *)local_120,(Entity *)this->_spawnerEntity); if (bVar1 == 0) goto LAB_006223ba; } pBVar23 = &g_tearFlagLudovico; pBVar5 = Entity_Tear::TearFlags((Entity_Tear *)local_120,&local_268); pBVar5 = BitSet128::operator_and(&local_278,pBVar5,pBVar23); bVar1 = BitSet128::IsNonZero(pBVar5); tmpEntity = local_120; local_134 = (Entity_Tear *)CONCAT13(bVar1,(undefined3)local_134); if (bVar1 == 0) { (**(code **)(*(int *)local_120 + 0x28))(); } else { FUN_005cd750(); iVar3 = Entity::GetIntervalTicks((Entity *)local_120,fVar20,0.0); if (iVar3 == 0) goto LAB_006223ba; tmpEntity = local_120; } local_118 = (Entity_Player *)0x0; local_11c = (Entity_Familiar *)&DAT_00c7fc60; do { local_16c.y = (float)Entity::InitSeed((Entity *)tmpEntity); local_160.y = (float)Entity::SubType((Entity *)tmpEntity); local_150.y = (float)Entity::SpawnerEntity((Entity *)tmpEntity); pVVar11 = Entity::Velocity((Entity *)tmpEntity,&local_174); pVVar10 = Entity::Position((Entity *)tmpEntity,&local_184); uVar4 = Entity::Variant((Entity *)local_120); Game::Spawn(g_game,2,uVar4,pVVar10,pVVar11,(Entity *)local_150.y,(uint)local_160.y, (uint)local_16c.y); tear = (Entity_Tear *)__RTDynamicCast(); tmpEntity = local_120; fVar18 = (float10)Entity_Tear::Height((Entity_Tear *)local_120); Entity_Projectile::SetHeight((Entity_Projectile *)tear,(float)fVar18); Entity_Tear::FallingSpeed((Entity_Tear *)tmpEntity); FUN_00444c70(); fVar18 = (float10)Entity_Tear::FallingAcceleration((Entity_Tear *)tmpEntity); Entity_Projectile::set_falling_accel((Entity_Projectile *)tear,(float)fVar18); FUN_0060cca0(); FUN_00676bd0(); fVar18 = (float10)Entity_Tear::BaseScale((Entity_Tear *)tmpEntity); Entity_Tear::SetScale(tear,(float)fVar18); pBVar5 = BitSet128::__bnot(&g_tearFlagLudovico,local_2b8); pBVar23 = Entity_Tear::TearFlags((Entity_Tear *)local_120,&local_288); pBVar5 = BitSet128::operator_and(&local_298,pBVar23,pBVar5); Entity_Tear::SetTearFlags(tear,*pBVar5); FUN_0060cd10(); Entity_Tear::SetWaitFrames(tear); iVar3 = Entity_Tear::TearIndex((Entity_Tear *)local_120); Entity_Effect::set_state((Entity_Effect *)tear,iVar3); pcVar15 = *(code **)(*(int *)tear + 0x40); fVar18 = (float10)Entity::CollisionDamage((Entity *)local_120); fVar20 = (float)fVar18; local_150.y = fVar20; (*pcVar15)(); tmpEntity = local_120; Entity_Tear::Rotation((Entity_Tear *)local_120); FUN_004aadb0(); FUN_0060ccf0(); Entity_Tear::SetKnockbackMultiplier(tear); FUN_0060cd50(); Entity_Tear::SetDeadEyeIntensity(tear,fVar20); FUN_0060cd60(); FUN_0060cd70(); FUN_0060cda0(); FUN_0060cd90(); tmpEntity = (Entity *)Entity::Parent((Entity *)tmpEntity); Entity::SetParent((Entity *)tear,tmpEntity); tmpEntity = (Entity *)Entity::SpawnerEntity((Entity *)tmpEntity); Entity::SetSpawnerEntity((Entity *)tear,tmpEntity); local_16c.y = (float)(int)local_118; if (local_134._3_1_ == '\0') { pVVar11 = Entity::Velocity((Entity *)tear,&local_1c8); pVVar11 = Vector::Rotated(pVVar11,&local_1c0,30.0 - local_16c.y * 20.0); } else { pVVar11 = Entity::Velocity((Entity *)tear,&local_18c); pVVar10 = Vector::FromAngle(&local_194,local_16c.y * 90.0); local_148.y = 10.0; pVVar10 = Vector::__mul(pVVar10,&local_1d8,&local_148.y); pVVar11 = Vector::__add(pVVar11,&local_1d0,pVVar10); } Entity::SetVelocity((Entity *)tear,pVVar11); tmpEntity = local_11c; (**(code **)(*(int *)tear + 0x3c))(); (**(code **)(*(int *)tear + 0xc))(); local_118 = (Entity_Player *)&local_118->field_0x1; local_11c = (Entity_Familiar *)&tmpEntity->_variant; tmpEntity = local_120; } while ((int)local_11c < 0xc7fd10); LAB_006223ae: this = self; goto LAB_006223b4; } } else { LAB_006223d9: puVar8 = (undefined4 *)std::vector::operator_index(); iVar3 = Entity::Type((Entity *)*puVar8); if (iVar3 == 4) { puVar8 = (undefined4 *)std::vector::operator_index(); pVVar11 = Entity::Position((Entity *)*puVar8,&local_1e8); local_150.y = Vector::DistanceSquared(pVVar11,&this->_pos); if (625.0 <= local_150.y) goto LAB_00622693; std::vector::operator_index(); tmpEntity = (Entity_Familiar *)__RTDynamicCast(); local_120 = tmpEntity; cVar2 = FUN_0060cdd0(); if ((cVar2 == '\0') && (cVar2 = Entity_Bomb::IsFetus((Entity_Bomb *)tmpEntity), cVar2 != '\0')) { (**(code **)(*(int *)tmpEntity + 0x28))(); local_118 = (Entity_Player *)0x0; local_134 = (Entity_Tear *)&DAT_00c7fc60; do { local_150.y = (float)Entity::InitSeed((Entity *)tmpEntity); local_160.y = (float)Entity::SubType((Entity *)tmpEntity); local_11c = (Entity_Familiar *)Entity::SpawnerEntity((Entity *)tmpEntity); local_16c.y = (float)Entity::Velocity((Entity *)tmpEntity,&local_1e0); pVVar11 = Entity::Position((Entity *)tmpEntity,&local_228); uVar4 = Entity::Variant((Entity *)local_120); uVar6 = Entity::Type((Entity *)local_120); Game::Spawn(g_game,uVar6,uVar4,pVVar11,(Vector *)local_16c.y,(Entity *)local_11c, (uint)local_160.y,(uint)local_150.y); projectile = (Entity_Projectile *)__RTDynamicCast(); tmpEntity = local_120; Entity_Bomb::IsFetus((Entity_Bomb *)local_120); FUN_0060cdb0(); Entity::AddEntityFlags((Entity *)projectile,0x4000000); Entity::GridCollisionClass((Entity *)tmpEntity); FUN_0044bfa0(); FUN_0060cde0(); Entity_Bomb::Flags((Entity_Bomb *)tmpEntity); FUN_006a6910(); fVar18 = (float10)Entity_Tear::FallingAcceleration((Entity_Tear *)tmpEntity); Entity_Projectile::set_falling_accel(projectile,(float)fVar18); Player(tmpEntity); Entity_Bomb::SetExplosionCountdown(); Entity_Bomb::RadiusMultiplier((Entity_Bomb *)tmpEntity); FUN_00435e70(); local_11c = (Entity_Familiar *)(30.0 - (float)(int)local_118 * 20.0); pVVar11 = Entity::Velocity((Entity *)projectile,&local_210); pVVar11 = Vector::Rotated(pVVar11,&local_218,(float)local_11c); Entity::SetVelocity((Entity *)projectile,pVVar11); FUN_0060cdf0(); FUN_00456820(); FUN_0060ce00(); FUN_0060ce10(); (**(code **)(*(int *)projectile + 0x3c))(); local_118 = (Entity_Player *)&local_118->field_0x1; local_134 = (Entity_Tear *)((int)local_134 + 0x2c); } while ((int)local_134 < 0xc7fd10); goto LAB_006223ae; } LAB_006223b4: pEVar16 = (Entity_Player *)local_130.y; } else { LAB_00622693: puVar8 = (undefined4 *)std::vector::operator_index(); iVar3 = Entity::Type((Entity *)*puVar8); if (iVar3 == 7) { puVar8 = (undefined4 *)std::vector::operator_index(); iVar3 = Entity::SubType((Entity *)*puVar8); if (iVar3 == 2) { std::vector::operator_index(); tear = (Entity_Tear *)__RTDynamicCast(); local_134 = tear; cVar2 = FUN_0060cef0(); if (cVar2 == '\0') { fVar18 = (float10)Entity_Laser::Radius((Entity_Laser *)tear); local_160.y = (float)(fVar18 * (float10)0.5); pVVar11 = Entity::Position((Entity *)tear,&local_220); local_150.y = Vector::DistanceSquared(pVVar11,&this->_pos); if (local_150.y <= local_160.y * local_160.y) { local_118 = (Entity_Player *)0x0; LAB_00622760: local_150.y = (float)Random(); local_160.y = (float)Entity::SubType((Entity *)tear); local_11c = this->_player; pVVar11 = Entity::Velocity((Entity *)tear,&local_140); pVVar10 = Entity::Position((Entity *)tear,(Vector *)(local_1a4 + 8)); uVar4 = Entity::Variant((Entity *)local_134); Game::Spawn(g_game,7,uVar4,pVVar10,pVVar11,(Entity *)local_11c,(uint)local_160.y ,(uint)local_150.y); tmpEntity = (Entity_Familiar *)__RTDynamicCast(); local_120 = tmpEntity; pVVar11 = (Vector *)Entity::PositionOffset((Entity *)local_134); Entity::SetPositionOffset((Entity *)tmpEntity,pVVar11); Entity_Laser::Radius((Entity_Laser *)local_134); FUN_0060ce80(); this = self; Entity::SetSpawnerEntity((Entity *)tmpEntity,self->_player); FUN_00435f70(); pBVar5 = Entity_Tear::TearFlags(local_134,&local_90); fVar20 = *(float *)&pBVar5->_l; FUN_00456830(); FUN_0060ce70(); Entity_Laser::SetMaxDistance((Entity_Laser *)tmpEntity,fVar20); FUN_0060ced0(); Entity_Laser::SetBlackHpDropChance((Entity_Laser *)tmpEntity); pcVar15 = *(code **)(*(int *)tmpEntity + 0x40); fVar18 = (float10)Entity::CollisionDamage((Entity *)local_134); local_150.y = (float)fVar18; (*pcVar15)(); fVar18 = (float10)Entity::DepthOffset((Entity *)local_134); tmpEntity = local_120; set_field_358(local_120,(float)fVar18); Entity::InitSeed((Entity *)local_134); FUN_005b15a0(); Entity::GridCollisionClass((Entity *)local_134); FUN_0044bfa0(); FUN_0060ce60(); Entity_Laser::SetHomingType((Entity_Laser *)tmpEntity); Entity::SpawnerType((Entity *)local_134); FUN_004316b0(); pVVar11 = (Vector *)Entity::TargetPosition((Entity *)local_134); Entity::SetTargetPosition((Entity *)tmpEntity,*pVVar11); FUN_0060cee0(); Entity_Laser::SetMultidimensionalTouched((Entity_Laser *)tmpEntity); Entity::SetParent((Entity *)tmpEntity,this->_player); FUN_00579760(); Entity_Laser::SetTimeout((Entity_Laser *)tmpEntity); FUN_0060ce30(); Entity_Laser::SetOneHit((Entity_Laser *)tmpEntity); FUN_0060ce50(); FUN_0060ce40(); Entity::Visible((Entity *)local_134); FUN_0044bf90(); if (local_118 == (Entity_Player *)0x0) { pVVar11 = Entity::Velocity((Entity *)tmpEntity,&local_230); pVVar11 = Vector::Rotated(pVVar11,&local_238,-30.0); Entity::SetVelocity((Entity *)tmpEntity,pVVar11); pcVar15 = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(&local_54); LAB_00622a96: (*pcVar15)(); tmpEntity = local_120; LAB_00622ab7: FUN_005cd5a0(); (**(code **)(*(int *)tmpEntity + 0xc))(); local_118 = (Entity_Player *)&local_118->field_0x1; if (3 < (int)local_118) goto LAB_00622b6f; tear = local_134; goto LAB_00622760; } if (local_118 == (Entity_Player *)0x1) { pVVar11 = Entity::Velocity((Entity *)tmpEntity,(Vector *)&local_248._h); pVVar11 = Vector::Rotated(pVVar11,(Vector *)&local_258._h,-10.0); Entity::SetVelocity((Entity *)tmpEntity,pVVar11); LAB_00622a6e: pcVar15 = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); goto LAB_00622a96; } if (local_118 == (Entity_Player *)0x2) { pVVar11 = Entity::Velocity((Entity *)tmpEntity,&local_1f0); pVVar11 = Vector::Rotated(pVVar11,(Vector *)&local_208._h,10.0); Entity::SetVelocity((Entity *)tmpEntity,pVVar11); goto LAB_00622a6e; } if (local_118 != (Entity_Player *)0x3) goto LAB_00622ab7; pVVar11 = Entity::Velocity((Entity *)tmpEntity,(Vector *)&local_1b8._h); pVVar11 = Vector::Rotated(pVVar11,(Vector *)(local_68 + 8),30.0); Entity::SetVelocity((Entity *)tmpEntity,pVVar11); pcVar15 = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*pcVar15)(); tmpEntity = local_120; FUN_005cd5a0(); (**(code **)(*(int *)tmpEntity + 0xc))(); LAB_00622b6f: (**(code **)(*(int *)local_134 + 0x28))(); } } goto LAB_006223b4; } } puVar8 = (undefined4 *)std::vector::operator_index(); iVar3 = Entity::Type((Entity *)*puVar8); if (iVar3 == 8) { std::vector::operator_index(); local_130.y = (float)FUN_0060cc90(); cVar2 = FUN_0060cfd0(); if ((cVar2 == '\0') && (cVar2 = Entity_Knife::IsFlying((Entity_Knife *)local_130.y), cVar2 != '\0')) { pVVar11 = Entity::Position((Entity *)local_130.y,(Vector *)(local_78 + 8)); local_150.y = Vector::DistanceSquared(pVVar11,&this->_pos); if (local_150.y <= 625.0) { Entity_Knife::spawn_child_knife((Entity_Knife *)local_130.y); } } } } } LAB_006223ba: pEVar16 = (Entity_Player *)&pEVar16->field_0x1; local_130.y = (float)pEVar16; puVar9 = (undefined1 *)EntityList::Size(); } while (pEVar16 < puVar9); } break; case 0x7c: FamiliarAI::mystery_egg(this); break; case 0x7d: FamiliarAI::lil_spewer(this); break; case 0x7f: pfVar12 = (float *)Entity_Player::GetAimDirection(this->_player); local_160.x = *pfVar12; local_160.y = pfVar12[1]; bVar1 = Vector::operator_eq(&local_160,&g_vectorZero); if (bVar1 != 0) { iVar3 = Entity_Player::GetHeadDirection(this->_player); pVVar11 = Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)(local_78 + 8),iVar3); Vector::operator_assign(&local_160,pVVar11); bVar1 = Vector::operator_eq(&local_160,&g_vectorZero); if (bVar1 != 0) { pVVar11 = Vector::Vector((Vector *)(local_78 + 8),0.0,1.0); Vector::operator_assign(&local_160,pVVar11); } } fVar24 = 120.0; iVar3 = Game::GetFrameCount(g_game); fVar20 = sinf_wrapper(((float)iVar3 / 30.0) * 3.1415927); local_150.y = assert_lerp_range(fVar20,-1.0,1.0,20.0,fVar24,1); local_148.y = Vector::GetAngleDegrees(&local_160); fVar20 = LerpAngleDeg(this->_orbitAngleOffset,local_148.y,0.4); this->_orbitAngleOffset = fVar20; pVVar11 = Entity::Position(this->_player,(Vector *)(local_68 + 8)); pVVar10 = Vector::FromAngle((Vector *)(local_78 + 8),this->_orbitAngleOffset); pVVar10 = Vector::__mul(pVVar10,(Vector *)&local_1b8._h,&local_150.y); Vector::__add(pVVar11,&local_140,pVVar10); pVVar11 = Vector::__sub(&local_140,(Vector *)&local_208._h,&this->_pos); local_148.y = 0.8; pVVar11 = Vector::__mul(pVVar11,(Vector *)(local_78 + 8),&local_148.y); Vector::operator_assign(&this->_velocity,pVVar11); this->_friction = this->_friction * 0.7; pVVar11 = Entity::Position(this->_player,&local_1f0); Vector::__sub(&this->_pos,&local_128,pVVar11); fVar20 = Vector::GetAngleDegrees(&local_128); local_148.y = fVar20 - 90.0; local_148.y = normalize_angle_degrees(local_148.y); layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); layer->_rotation = local_148.y; fVar18 = (float10)Sprite::Rotation((Sprite *)&this->_sprite); local_148.y = (float)fVar18; local_134 = (Entity_Tear *)CONCAT13(1.0 < local_148.y,(undefined3)local_134); layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); layer->_flipX = local_134._3_1_; bVar1 = Entity::IsFrame((Entity *)this,7,0); if (bVar1 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar3 = Room::GetGridIndex(room,&this->_pos); if (-1 < iVar3) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); sourceRef = EntityRef::EntityRef((EntityRef *)(local_a8 + 4)); Room::DamageGridWithSource(room,iVar3,1,sourceRef); } } break; case 0x80: animState = (AnimationState *)Config::GetPillEffects(); bVar1 = AnimationState::IsLoopingAnimation(animState); if (bVar1 == 0) { Entity::MultiplyFriction((Entity *)this); bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { sprintf_s(idleAnimName,0x20,(byte *)"Idle%d"); ANM2::Play(&this->_sprite,idleAnimName,0); animState = (AnimationState *)Config::GetPillEffects(); iVar3 = AnimationState::GetAnimationLength(animState); iVar3 = Isaac::Random(iVar3); Sprite::SetFrame_1((Sprite *)&this->_sprite,iVar3); } } else { pVVar11 = Entity::Position(this->_player,&local_158); GetOrbitPosition(this,&local_150,pVVar11); pVVar11 = Entity::Velocity(this->_player,&local_158); local_128.y = 2.0; Vector::__mul(pVVar11,&local_148,&local_128.y); pVVar11 = Vector::__add(&this->_pos,&local_158,&local_148); pVVar11 = Vector::__sub(&local_150,&local_174,pVVar11); local_128.y = 0.5; Vector::__mul(pVVar11,&local_140,&local_128.y); iVar3 = Entity::FrameCount((Entity *)this); if (iVar3 < 0x28) { iVar3 = Entity::FrameCount((Entity *)this); fVar20 = Math::clamp((float)(iVar3 + -10) / 30.0,0.06,1.0); local_118 = (Entity_Player *)(1.0 / fVar20 + 4.0); } else { local_118 = (Entity_Player *)0x40a00000; } local_128.y = Vector::Length(&local_140); if ((float)local_118 < local_128.y) { Vector::Resize(&local_140,(float)local_118 - 1.0); } pVVar11 = Vector::__add(&local_148,&local_158,&local_140); pVVar11 = Vector::__div(pVVar11,&local_174,&this->_friction); Vector::operator_assign(&this->_velocity,pVVar11); } break; case 0x81: cVar2 = Entity::Visible((Entity *)this); if (cVar2 == '\0') { LAB_0061e4de: Vector::operator_assign(&this->_velocity,&g_vectorZero); } else { bVar1 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero); if (bVar1 == 0) { pVVar11 = Vector::__sub(&this->_targetPosition,(Vector *)(local_78 + 8),&this->_pos); local_148.y = 0.5; pVVar11 = Vector::__mul(pVVar11,(Vector *)(local_68 + 8),&local_148.y); Vector::operator_assign(&this->_velocity,pVVar11); bVar1 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,s_Spawn); if (bVar1 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpEntity = (Entity_Familiar *)Room::GetGridIndex(room,&this->_pos); local_148.y = (float)tmpEntity; room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(room,(uint)tmpEntity); if (((gridEntity == (GridEntity *)0x0) || (iVar3 = GridEntity::GetType(), iVar3 == 1)) || (iVar3 = GridEntity::GetType(), iVar3 == 10)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar1 = Room::is_type_16(room); if (bVar1 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar4 = RNG::Next(&this->_dropRNG); Room::SpawnGridEntity(room,(int)local_148.y,0xe,6,uVar4,0); Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,0,0); } } SoundEffects::PlayWithFartOverride(0x25,1.0,2,0,1.0); } bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { FUN_0044bf90(); } } else { FollowParent(this); } } break; case 0x83: update_idle_anim_by_size(this); MoveDelayed(this); break; case 200: ai_boiled_baby(this); break; case 0xc9: zhl_misfit_006414c0(this); break; case 0xca: ai_shadow_intruder_damocles(this); break; case 0xcb: FUN_0063f9f0(); break; case 0xcc: FamiliarAI::variant_204(this); break; case 0xce: case 0xed: ai_wisp(this); break; case 0xd0: FollowParent(this); sprite = &this->_sprite; local_148.y = (float)sprite; iVar3 = Entity::FrameCount((Entity *)this); if (iVar3 == 0) { LAB_00623343: ANM2::Play(&this->_sprite,(byte *)"FloatDown",0); } else { bVar1 = ANM2::IsPlaying(sprite,(byte *)"FloatDown"); if ((bVar1 == 0) && (bVar1 = ANM2::IsFinishedImpl(sprite,&s_empty), bVar1 == 0)) { bVar1 = ANM2::IsPlaying(sprite,s_Spawn); if ((bVar1 != 0) && (bVar1 = Sprite::IsEventTriggered((Sprite *)sprite,"Shoot"), bVar1 != 0) ) { SoundEffects::PlayWithFartOverride(0xb2,1.0,2,0,1.0); iVar3 = Isaac::Random(3); local_16c.y = (float)(iVar3 + 4); fVar20 = apply_tear_modifiers(this); local_11c = (Entity_Familiar *)(fVar20 * 3.5); if (0 < (int)(iVar3 + 4)) { do { MusicManager::RandomVector(&local_140); local_148.y = 10.0; Vector::operator_mul_assign(&local_140,&local_148.y); fVar20 = random_float(); local_150.y = fVar20 * 0.2 + 0.7; Vector::operator_mul_assign(&local_140,&local_150.y); bVar1 = Entity::HasEntityFlags((Entity *)this,0x100); if (bVar1 == 0) { FUN_00431270(); Color::Color((Color *)local_a8); if (this->_isLilDelirium != 0) { Color::SetColorize((Color *)local_a8,2.4,2.4,2.4,1.0); } uVar4 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,2,1,&this->_pos,&local_140,(Entity *)this,0,uVar4); Entity_Projectile::set_falling_accel((Entity_Projectile *)tear,0.8); random_float(); FUN_00444c70(); flags._l._4_4_ = local_78._4_4_; flags._l._0_4_ = local_78._0_4_; flags._h._0_4_ = local_78._8_4_; flags._h._4_4_ = pcStack_6c; Entity_Tear::SetTearFlags(tear,flags); (**(code **)(*(int *)tear + 0x3c))(); iVar3 = Isaac::Random(2); if (iVar3 == 0) { fVar20 = random_float(); Entity_Tear::SetScale(tear,(fVar20 * 0.05 + 0.9) * 0.8); } else { fVar20 = random_float(); Entity_Tear::SetScale(tear,(fVar20 * 0.05 + 1.3) * 0.8); } (**(code **)(*(int *)tear + 0x40))(); TryFireTear(this,tear); } else { uVar4 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,9,0,&this->_pos,&local_140,(Entity *)this,0,uVar4); Entity_Projectile::set_falling_accel((Entity_Projectile *)tear,0.8); random_float(); FUN_00444c70(); iVar3 = Isaac::Random(2); if (iVar3 == 0) { random_float(); } else { random_float(); } FUN_004508a0(); } (**(code **)(*(int *)tear + 0xc))(); local_16c.y = (float)((int)&((Entity_Tear *)((int)local_16c.y + -0x824))->_tearRange + 3); } while ((Entity_Tear *)local_16c.y != (Entity_Tear *)0x0); local_16c.y = 0.0; } } } else { ANM2::Play(sprite,(byte *)"FloatDown",0); iVar3 = apply_forgotten_lullaby(this,4); bVar1 = Entity::IsFrame((Entity *)this,iVar3,0); if (bVar1 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar3 = Room::GetAliveEnemiesCount(room); if (0 < iVar3) { local_11c = (Entity_Familiar *)0x42a00000; bVar1 = Entity::HasEntityFlags((Entity *)this,0x100); if (bVar1 != 0) { local_11c = (Entity_Familiar *)0x43340000; } pEVar16 = (Entity_Player *)0x0; local_130.y = 0.0; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius (entityList,(EntityList_EL *)local_78,&this->_pos,(float)local_11c,8); local_14 = 1.96182e-44; local_118 = (Entity_Player *)0x0; iVar3 = EntityList::Size(); if (iVar3 != 0) { do { puVar8 = (undefined4 *)std::vector::operator_index(); tmpEntity = (Entity *)*puVar8; if (tmpEntity != (Entity *)0x0) { bVar1 = Entity::HasEntityFlags((Entity *)this,0x100); if ((bVar1 == 0) || ((bVar1 = Entity::is_player(tmpEntity), bVar1 == 0 && ((bVar1 = Entity::IsFamiliar(tmpEntity), bVar1 == 0 || (bVar1 = Entity::HasEntityFlags(tmpEntity,0x100), bVar1 != 0)))))) { bVar1 = Entity::HasEntityFlags((Entity *)this,0x100); if ((bVar1 == 0) && (bVar1 = Entity::IsVulnerableEnemy(tmpEntity,(Entity *)0x0), bVar1 != 0)) { local_130.y = (float)((int)local_130.y + 1); } } else { local_130.y = (float)((int)local_130.y + 1); } } pEVar16 = (Entity_Player *)local_130.y; local_118 = (Entity_Player *)&local_118->field_0x1; listSize = (Entity_Player *)EntityList::Size(); } while (local_118 < listSize); } iVar3 = 5; if ((int)pEVar16 < 1) { iVar3 = 0x14; } iVar3 = Isaac::Random(iVar3); if (iVar3 != 0) goto LAB_0061f2a8; ANM2::Play((ANM2 *)local_148.y,s_Spawn,1); puVar9 = local_78; goto LAB_006241ee; } } } } break; case 0xd2: ai_bird_cage(this); break; case 0xd3: FUN_00645bc0(); break; case 0xd4: FamiliarAI::lil_dumpy(this); break; case 0xd8: case 0xd9: FamiliarAI::tinytoma(this); break; case 0xda: pVVar11 = Entity::Position(this->_player,(Vector *)(local_78 + 8)); pVVar11 = GetOrbitPosition(this,(Vector *)(local_68 + 8),pVVar11); pVVar11 = Vector::__sub(pVVar11,(Vector *)&local_1b8._h,&this->_pos); Vector::operator_assign(&this->_velocity,pVVar11); ai_bot_fly(this); break; case 0xdd: FUN_006401d0(); break; case 0xde: ai_stitches(this); break; case 0xe0: FUN_0063e180(); break; case 0xe1: FUN_006403f0(); break; case 0xe2: pVVar11 = Entity::Position(this->_player,(Vector *)(local_78 + 8)); pVVar11 = GetOrbitPosition(this,(Vector *)(local_68 + 8),pVVar11); pVVar11 = Vector::__sub(pVVar11,(Vector *)&local_1b8._h,&this->_pos); Vector::operator_assign(&this->_velocity,pVVar11); bVar1 = Entity::HasEntityFlags((Entity *)this,0x20000000000); if (bVar1 == 0) { ANM2::Play(&this->_sprite,s_Idle,0); local_160.y = (float)(this->_chargeLevel + -1); local_128.y = 0.0; piVar13 = (int *)std::max(); } else { ANM2::Play(&this->_sprite,&DAT_00b602e8,0); local_148.y = (float)(this->_chargeLevel + 1); local_150.y = 7.00649e-45; piVar13 = (int *)std::min(); } this->_chargeLevel = *piVar13; local_148.y = 1.0; local_150.y = (float)this->_chargeLevel * 0.2; puVar8 = (undefined4 *)std::min(); local_11c = (Entity_Familiar *)*puVar8; local_150.y = 0.3; local_148.y = (float)this->_chargeLevel * 0.06; pfVar12 = (float *)std::min(); local_16c.y = *pfVar12 + 0.7; sfx = MusicManager::SFXManager(); bVar1 = SFXManager::IsPlaying(sfx,0x393); if (bVar1 == 0) { if (0 < this->_chargeLevel) { SoundEffects::PlayWithFartOverride(0x393,(float)local_11c,0,1,local_16c.y); } } else if (this->_chargeLevel < 1) { sfx = MusicManager::SFXManager(); SFXManager::Stop(sfx,0x393); } else { sfx = MusicManager::SFXManager(); SFXManager::AdjustVolume(sfx,0x393,(float)local_11c); sfx = MusicManager::SFXManager(); SFXManager::AdjustPitch(sfx,0x393,local_16c.y); } break; case 0xe4: ai_minisaac(this); break; case 0xe5: pVVar11 = Entity::Position(this->_player,(Vector *)(local_78 + 8)); GetOrbitPosition(this,&local_160,pVVar11); pVVar11 = Entity::Velocity(this->_player,(Vector *)(local_68 + 8)); local_148.y = 2.0; Vector::__mul(pVVar11,&local_150,&local_148.y); pVVar11 = Vector::__add(&this->_pos,(Vector *)&local_1b8._h,&local_150); pVVar11 = Vector::__sub(&local_160,(Vector *)(local_78 + 8),pVVar11); local_148.y = 0.5; Vector::__mul(pVVar11,&local_140,&local_148.y); iVar3 = Entity::FrameCount((Entity *)this); if (iVar3 < 0x28) { iVar3 = Entity::FrameCount((Entity *)this); fVar20 = Math::clamp((float)(iVar3 + -10) / 30.0,0.06,1.0); local_11c = (Entity_Familiar *)(1.0 / fVar20 + 4.0); } else { local_11c = (Entity_Familiar *)0x40a00000; } local_148.y = Vector::Length(&local_140); if ((float)local_11c < local_148.y) { Vector::Resize(&local_140,(float)local_11c - 1.0); } pVVar11 = Vector::__add(&local_150,(Vector *)(local_78 + 8),&local_140); pVVar11 = Vector::__div(pVVar11,(Vector *)(local_68 + 8),&this->_friction); Vector::operator_assign(&this->_velocity,pVVar11); break; case 0xe7: FamiliarAI::apollyons_best_friend(this); break; case 0xe9: FamiliarAI::worm_friend(this); break; case 0xea: animState = (AnimationState *)Config::GetPillEffects(); bVar1 = AnimationState::IsLoopingAnimation(animState); if (bVar1 != 0) { fVar20 = assert_lerp_range(this->_updateTime,0.0,15.0,1.0,0.8,1); this->_friction = fVar20 * this->_friction; } break; case 0xeb: tmpEntity = this->_player; local_120 = tmpEntity; update_weapon(); pfVar12 = (float *)Entity_Player::GetAimDirection(this->_player); local_160.x = *pfVar12; local_160.y = pfVar12[1]; if ((((0 < this->_headFrameDelay) || (0 < this->_counter)) && (bVar1 = Vector::operator_eq(&local_160,&g_vectorZero), bVar1 != 0)) && (bVar1 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar1 != 0)) { Vector::operator_assign(&local_160,&this->_targetPosition); } bVar1 = Vector::operator_eq(&local_160,&g_vectorZero); if (bVar1 != 0) { pVVar11 = Vector::Vector((Vector *)(local_78 + 8),0.0,1.0); Vector::operator_assign(&local_160,pVVar11); } Vector::operator_assign(&this->_targetPosition,&local_160); local_130.y = 0.4; bVar1 = Entity_Player::HasTrinket(this->_player,0x94,0); local_134 = (Entity_Tear *)CONCAT13(bVar1,(undefined3)local_134); if (bVar1 != 0) { pVVar11 = Vector::Vector((Vector *)(local_78 + 8),26.0,26.0); Vector::operator_assign(&this->_orbitDistance,pVVar11); game = g_game; this->_orbitSpeed = 3.5; iVar3 = Game::GetFrameCount(game); pVVar11 = Vector::FromAngle((Vector *)(local_68 + 8), (float)iVar3 * this->_orbitSpeed - this->_orbitAngleOffset); Vector::operator_assign(&local_160,pVVar11); local_130.y = 0.8; } pVVar11 = Vector::Rotated(&local_160,(Vector *)(local_78 + 8),-90.0); local_148.y = 26.0; pVVar11 = Vector::operator_mul((Vector *)(local_68 + 8),&local_148.y,pVVar11); Vector::operator_assign(&local_160,pVVar11); if (local_134._3_1_ == '\0') { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar3 = Room::GetFrameCount(room); if (0x1e < iVar3) { local_11c = this; iVar3 = Entity::Parent((Entity *)this); if (iVar3 != 0) { do { tmpEntity = (Entity *)Entity::Parent((Entity *)this); bVar1 = Entity::IsFamiliar(tmpEntity); if (bVar1 == 0) break; this = (Entity_Familiar *)Entity::Parent((Entity *)this); iVar3 = Entity::Parent((Entity *)this); } while (iVar3 != 0); local_11c = this; } pVVar11 = (Vector *)FUN_004172b0(); pVVar10 = Entity::Velocity((Entity *)local_11c,(Vector *)(local_68 + 8)); local_148.y = 1.0 - local_130.y; pVVar10 = Vector::__mul(pVVar10,(Vector *)&local_1b8._h,&local_148.y); pVVar10 = Vector::__div(pVVar10,(Vector *)&local_208._h,&local_130.y); Vector::__add(pVVar11,&local_140,pVVar10); pVVar11 = Entity::Position((Entity *)local_120,&local_1f0); pVVar10 = Entity::Position((Entity *)local_120,(Vector *)(local_78 + 8)); pVVar11 = Vector::__add(pVVar11,(Vector *)(local_68 + 8),&local_160); local_148.y = Vector::DistanceSquared(&local_140,pVVar11); pVVar11 = Vector::__sub(pVVar10,(Vector *)&local_1b8._h,&local_160); local_150.y = Vector::DistanceSquared(&local_140,pVVar11); if (local_150.y < local_148.y) { pVVar11 = Vector::__unm(&local_160,(Vector *)(local_78 + 8)); Vector::operator_assign(&local_160,pVVar11); } tmpEntity = local_120; this = self; } } if (((this->_parent != (EntityPtr)0x0) && (bVar1 = Entity::IsFamiliar((Entity *)this->_parent), bVar1 != 0)) && (iVar3 = Entity::Parent((Entity *)this->_parent), iVar3 != 0)) { tmpEntity = (Entity_Familiar *)Entity::Parent((Entity *)this->_parent); } if (this->_subtype == 1) { pVVar11 = Vector::__unm(&local_160,(Vector *)(local_78 + 8)); Vector::operator_assign(&local_160,pVVar11); } pVVar11 = Entity::Position((Entity *)tmpEntity,(Vector *)(local_78 + 8)); Vector::__add(pVVar11,&local_128,&local_160); pVVar11 = Vector::__sub(&local_128,(Vector *)(local_68 + 8),&this->_pos); pVVar11 = Vector::__mul(pVVar11,(Vector *)(local_78 + 8),&local_130.y); Vector::operator_assign(&this->_velocity,pVVar11); this->_friction = this->_friction * 0.8; break; case 0xec: FamiliarAI::star_of_bethlehem(this); break; case 0xee: ai_blood_clot(this); break; case 0xef: FamiliarAI::thrown_familiar_239(this); break; case 0xf0: ai_umbilical_baby(); break; case 0xf1: FamiliarAI::variant_241(this); break; case 0xf2: ai_variant_242(this); break; case 0xf3: if (this->_state < 1) { fVar20 = (this->_targetPosition).x; if ((0.0 <= fVar20) && (pfVar12 = &(this->_targetPosition).y, 0.0 < *pfVar12 || *pfVar12 == 0.0)) goto LAB_0061fc21; fVar24 = (this->_targetPosition).y; fVar19 = this->_speedMultiplier * 1.2 + fVar24; fVar20 = this->_speedMultiplier * fVar24 + fVar20; (this->_targetPosition).x = fVar20; (this->_targetPosition).y = fVar19; if ((fVar19 < 0.0) || (iVar3 = 5, fVar19 < -26.0)) { iVar3 = 3; } this->_entityGridCollisionClass = iVar3; if (0.0 < fVar20) { (this->_targetPosition).x = 0.0; (this->_targetPosition).y = 0.0; Entity::ClearEntityFlags((Entity *)this,0x400000000000000); iVar3 = Entity_Player::GetPlayerType(this->_player); if ((iVar3 == 0x10) || (iVar3 = Entity_Player::GetPlayerType(this->_player), iVar3 == 0x23)) { play_sound_with_fart_seed(499,1.0,2,0,1.0); play_sound_with_fart_seed(0x1d3,1.0,2,0,1.0); } else { play_sound_with_fart_seed(0x48,1.0,2,0,1.0); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,&this->_pos,&g_vectorZero,(Entity *)0x0,2,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); } } } else { if (this->_state == 1) { std::vector::clear(&this->_hitList,0); } Entity::ClearEntityFlags((Entity *)this,0x400000000000000); uVar4 = this->_state & 0x80000003; bVar17 = uVar4 == 0; if ((int)uVar4 < 0) { bVar17 = (uVar4 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar17) { pcVar15 = *(code **)(*(int *)this + 0x3c); Color::Color(); (*pcVar15)(); } this->_entityGridCollisionClass = 0; Entity::Position(this->_player,&local_140); local_128.y = assert_lerp_range((float)this->_state,0.0,15.0,1.0,16.0,1); this->_state = this->_state + 1; pVVar11 = Vector::__sub(&local_140,&local_158,&this->_pos); bVar1 = 0; pVVar11 = Vector::Resized(pVVar11,&local_174,local_128.y); Entity::AddVelocity((Entity *)this,pVVar11,bVar1); iVar3 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0); if (iVar3 != 0) { uVar4 = Random(); local_128.y = 0.5; pVVar11 = Vector::__mul(&this->_velocity,&local_158,&local_128.y); tmpEntity = Game::Spawn(g_game,1000,0x6f,&this->_pos,pVVar11,(Entity *)this,0,uVar4); pVVar11 = Vector::Vector(&local_174,0.0,-8.0); pVVar11 = Vector::__add(&this->_posOffset,&local_184,pVVar11); Entity::SetPositionOffset(tmpEntity,pVVar11); set_field_358(tmpEntity,-5.0); (**(code **)(*(int *)tmpEntity + 0xc))(); } LAB_0061fc21: this->_friction = this->_friction * 0.85; } local_128.y = Vector::LengthSquared(&this->_velocity); if ((3.0 < local_128.y) && (bVar1 = Entity::IsFrame((Entity *)this,3,0), bVar1 != 0)) { Entity_NPC::MakeSplat((Entity_NPC *)this,0.5); } tmpEntity = this->_player; (this->_posOffset).y = (this->_targetPosition).x; pVVar11 = Entity::Position(tmpEntity,&local_158); pVVar11 = Vector::__sub(&this->_pos,&local_174,pVVar11); local_140.x = pVVar11->x; local_140.y = pVVar11->y; FUN_007792f0(); bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); if (bVar1 == 0) { if (this->_state < 1) { local_118 = (Entity_Player *)0x43c80000; } else { local_118 = (Entity_Player *)0x44c80000; } pVVar11 = Entity::Position(this->_player,&local_158); local_128.y = Vector::DistanceSquared(pVVar11,&this->_pos); if (local_128.y <= (float)local_118) { Entity_Player::AnimateCollectible (this->_player,0x2d9,(byte *)"HideItem",(byte *)"PlayerPickupSparkle"); play_sound_with_fart_seed(0xf9,1.0,2,0,1.0); playerEffects = (TemporaryEffects *)Entity_Player::GetEffects(this->_player); TemporaryEffects::RemoveCollectibleEffect(playerEffects,0x2d9,-1); (**(code **)(*(int *)this + 0x28))(); } } } switchD_0061ddf2_caseD_12: LAB_00624200: bVar1 = Vector::operator_ne(&self->_orbitDistance,&g_vectorZero); if (bVar1 != 0) { bVar1 = Entity::HasEntityFlags((Entity *)self,0x20000000000); if (bVar1 != 0) { fVar20 = normalize_angle_degrees(self->_orbitAngleOffset - self->_orbitSpeed * 10.0); self->_orbitAngleOffset = fVar20; cVar2 = FUN_0060d120(); if ((cVar2 != '\0') && (bVar1 = Entity::IsFrame((Entity *)self,4,0), bVar1 != 0)) { pcVar15 = *(code **)(*(int *)self + 0x3c); Color::Color(); (*pcVar15)(); } } tmpEntity = self; if (self->_orbitLayer == 8) { playerEffects = (TemporaryEffects *)Entity_Player::GetEffects(self->_player); bVar1 = TemporaryEffects::HasCollectibleEffect(playerEffects,0x4d); if (bVar1 == 0) { playerEffects = (TemporaryEffects *)Entity_Player::GetEffects(tmpEntity->_player); bVar1 = TemporaryEffects::HasCollectibleEffect(playerEffects,0x12a); if (bVar1 == 0) goto LAB_0062434e; } fVar20 = normalize_angle_degrees(tmpEntity->_orbitAngleOffset - tmpEntity->_orbitSpeed * 0.5); tmpEntity->_orbitAngleOffset = fVar20; } } LAB_0062434e: FUN_00860f00(); iVar3 = FUN_0060d6a0(); if (iVar3 < 1) { tmpEntity = self; } else { bVar1 = Entity::IsFrame((Entity *)self,iVar3,self->_index); tmpEntity = self; if (bVar1 != 0) { if ((self->_variant != 0x18) && (self->_variant != 0x66)) { std::vector::clear(&self->_hitList,0); } } } fVar20 = apply_tear_modifiers(tmpEntity); if (1.0 < fVar20) { iVar3 = self->_variant; if (iVar3 == 0xe7) { pVVar10 = (Vector *)Entity::SpriteScale((Entity *)self); pVVar11 = &local_148; local_148.y = 1.1; puVar9 = local_78; } else { if (((iVar3 == 900) || (iVar3 == 0x3e)) || (iVar3 == 0xd3)) goto LAB_0062442e; pVVar10 = (Vector *)Entity::SpriteScale((Entity *)self); pVVar11 = &local_150; local_150.y = 1.25; puVar9 = local_68; } pVVar11 = Vector::__mul(pVVar10,(Vector *)(puVar9 + 8),&pVVar11->y); Entity::SetSpriteScale((Entity *)self,pVVar11); } LAB_0062442e: room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar1 = Room::is_type_16(room); if ((bVar1 != 0) && (bVar1 = Entity::IsFlying((Entity *)self), bVar1 == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar11 = &self->_pos; gridEntity = Room::GetGridEntityFromPos(room,pVVar11); if (((gridEntity != (GridEntity *)0x0) && (iVar3 = GridEntity::GetType(), iVar3 == 0x13)) || ((self->_variant == 0x4b || (self->_variant == 900)))) { fVar20 = (self->_velocity).y; if (self->_variant == 900) { (self->_velocity).y = fVar20 + 0.8; } else { pVVar10 = &self->_velocity; (self->_velocity).y = fVar20 * 0.5; if (pVVar10->x <= 0.0) { if (pVVar10->x < 0.0) { local_148.y = Vector::Length(pVVar10); pVVar10->x = -local_148.y; } } else { fVar20 = Vector::Length(pVVar10); pVVar10->x = fVar20; } game = g_game; (self->_velocity).y = 0.0; room = (Room *)Level::GetCurrentRoom((Level *)game); pVVar10 = Vector::Vector((Vector *)(local_78 + 8),0.0, (self->_sizeMulti).y * self->_size + 0.5); pVVar11 = Vector::__add(pVVar11,(Vector *)(local_68 + 8),pVVar10); local_140.x = pVVar11->x; local_140.y = pVVar11->y; iVar3 = Room::GetGridCollisionAtPos(room,*pVVar11); if (iVar3 != 4) { bVar1 = 0; pVVar11 = Vector::Vector((Vector *)(local_78 + 8),0.0,3.5); Entity::AddVelocity_divided((Entity *)self,pVVar11,bVar1); } } } } Entity::Update((Entity *)self); ANM2::Update(&self->_chargeBarSprite); if (self->_dead != 0) { (**(code **)(*(int *)self + 0x28))(); } this_00 = &self[1]._pendingDamageFlags; if (self->_target != (EntityPtr)0x0) { local_148.y = (float)PathFinder::GetGridIndex(); piVar13 = map_find_value(this_00,(uint)&local_148.y); *piVar13 = *piVar13 + 1; } FUN_0042c770(); std::iterator_copy(this_00,&local_148.y); cVar2 = FUN_0042c710(); while (cVar2 != '\0') { iVar3 = FUN_005cba30(); if (*(int *)(iVar3 + 4) < 0) { iVar3 = FUN_005cba30(); *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1; } iVar3 = FUN_005cba30(); if (*(int *)(iVar3 + 4) == 0) { pfVar12 = (float *)FUN_00651db0(); local_118 = (Entity_Player *)*pfVar12; } else { set_iterator_post_increment(); } std::iterator_copy(this_00,&local_148.y); cVar2 = FUN_0042c710(); } ExceptionList = local_1c; return; switchD_0061ddf2_caseD_62: MoveDelayed(this); goto switchD_0061ddf2_caseD_12; } //@@ 00624a80 Entity_Familiar::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_Familiar::Interpolate(Entity_Familiar *this) { float fVar1; float fVar2; int iVar3; void *pvVar4; byte bVar5; float fVar6; float fVar7; switch(this->_variant) { case 0x3d: ai_incubus_shot(); break; case 0x50: update_weapon(1); break; case 0xca: ai_shadow_intruder_damocles(this,1); break; case 0xee: fVar1 = this->_speedMultiplier; fVar7 = this->_friction; if (fVar1 != 1.0) { fVar7 = fVar7 / ((fVar7 + fVar1) - fVar7 * fVar1); } fVar2 = this->_baseFriction; fVar6 = fVar7 * (this->_velocity).x; fVar7 = fVar7 * (this->_velocity).y; (this->_velocity).x = fVar6; (this->_velocity).y = fVar7; fVar1 = this->_speedMultiplier; this->_friction = fVar2; (this->_pos).x = fVar1 * fVar6 + (this->_pos).x; (this->_pos).y = fVar1 * fVar7 + (this->_pos).y; ai_blood_clot(this,1); Entity::CollideWithGrid((Entity *)this,1); return; case 0xf0: ai_umbilical_baby(1); } fVar1 = this->_orbitAngleOffset; iVar3 = this->_orbitLayer; if (-1 < iVar3) { fVar7 = fVar1; if ((this->_flags & 0x20000000000) != 0) { fVar7 = fVar1 - this->_orbitSpeed * 5.0; if (360.0 < ABS(fVar7)) { fVar7 = fmodf(fVar7,360.0); } if (fVar7 <= 180.0) { if (fVar7 < -180.0) { fVar7 = fVar7 + 360.0; } } else { fVar7 = fVar7 - 360.0; } this->_orbitAngleOffset = fVar7; } if (iVar3 == 8) { pvVar4 = this->_player; bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)pvVar4 + 0x1508),0x4d); if ((bVar5 != 0) || (bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)pvVar4 + 0x1508),0x12a), bVar5 != 0)) { fVar7 = fVar7 - this->_orbitSpeed * 0.25; if (360.0 < ABS(fVar7)) { fVar7 = fmodf(fVar7,360.0); } if (fVar7 <= 180.0) { if (fVar7 < -180.0) { fVar7 = fVar7 + 360.0; } } else { fVar7 = fVar7 - 360.0; } this->_orbitAngleOffset = fVar7; } } } Entity::Interpolate((Entity *)this); if (this->_variant == 0xf3) { (this->_posOffset).y = (this->_targetPosition).y * 0.5 * this->_speedMultiplier + (this->_posOffset).y; } this->_orbitAngleOffset = fVar1; return; } //@@ 00624dd0 Entity_Familiar::RenderShadowLayer /* ZHL [vtable slot 6] */ byte __thiscall Entity_Familiar::RenderShadowLayer(Entity_Familiar *this,Vector *param_2) { byte bVar1; Entity *pEVar2; bVar1 = IsLilithBirthrightIncubus(this); if (bVar1 != 0) { pEVar2 = get_incubus_umbilical_whip(this); if ((pEVar2 == (Entity *)0x0) || (pEVar2->_visible == 0)) { return 0; } } bVar1 = Entity::RenderShadowLayer((Entity *)this,param_2); return bVar1; } //@@ 00624e10 Entity_Familiar::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [vtable slot 5] prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Familiar::Render(Entity_Familiar *this,Vector *offset) { code *pcVar1; float fVar2; byte bVar3; Entity *umbilicalWhip; uint seed; LayerState *layer; void *pvVar4; Game *game; byte *layerId; float *layerColor; int iVar5; float fVar6; float fVar7; double dVar8; undefined1 local_194 [44]; float local_168; float fStack_164; float fStack_160; float fStack_15c; float local_158; float fStack_154; float fStack_150; float fStack_14c; undefined8 local_148; int iStack_13c; undefined4 uStack_138; undefined4 uStack_134; undefined4 uStack_130; undefined4 uStack_12c; float local_128; float fStack_124; float fStack_120; float fStack_11c; float local_118; float fStack_114; float fStack_110; float fStack_10c; undefined8 local_108; float local_100; float opacity; Vector *renderOffset; undefined1 uStack_f1; float local_f0; float local_ec; Vector iconPosX; float local_e0; char isHologram; int *local_d8; float local_d4; float local_d0; Vector iconScaleX; int savedPlayerColor2; int iStack_c0; int iStack_bc; int iStack_b8; int iStack_b4; int iStack_b0; int iStack_ac; int iStack_a8; undefined8 uStack_a4; int iStack_9c; float savedPlayerColor; float fStack_94; float fStack_90; int iStack_8c; float fStack_88; float fStack_84; float fStack_80; float fStack_7c; float afStack_78 [2]; float fStack_70; int fadedPlayerColor; int iStack_68; int iStack_64; float fStack_60; int iStack_5c; int iStack_58; int iStack_54; int iStack_50; undefined8 uStack_4c; int iStack_44; ColorMod tmpColor; uint stackCookie; void *local_10; undefined1 *puStack_c; float local_8; int *player; Vector *renderPos; ColorMod *spriteColor; local_8 = -NAN; puStack_c = &LAB_00af6cd1; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(&tmpColor)[1]._colorize; ExceptionList = &local_10; renderOffset = offset; bVar3 = IsLilithBirthrightIncubus(this); if (bVar3 != 0) { umbilicalWhip = get_incubus_umbilical_whip(this); if (umbilicalWhip == (Entity *)0x0) { ExceptionList = local_10; return; } if (umbilicalWhip->_visible == 0) { ExceptionList = local_10; return; } } local_118 = (this->_sprite)._color._tint[0]; fStack_114 = (this->_sprite)._color._tint[1]; fStack_110 = (this->_sprite)._color._tint[2]; fStack_10c = (this->_sprite)._color._tint[3]; local_108 = *(undefined8 *)(this->_sprite)._color._offset; local_100 = (this->_sprite)._color._offset[2]; opacity = 1.0; local_128 = (this->_sprite)._color._colorize[0]; fStack_124 = (this->_sprite)._color._colorize[1]; fStack_120 = (this->_sprite)._color._colorize[2]; fStack_11c = (this->_sprite)._color._colorize[3]; if (this->_player == (void *)0x0) { game = g_game; } else { if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar3 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)((int)this->_player + 0x1618)), bVar3 == 0)) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { opacity = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } else { opacity = 1.0; } } game = g_game; spriteColor = &(this->_sprite)._color; fStack_15c = fStack_10c * opacity; offset = renderOffset; local_168 = local_118; fStack_164 = fStack_114; fStack_160 = fStack_110; local_158 = local_128; fStack_154 = fStack_124; fStack_150 = fStack_120; fStack_14c = fStack_11c; local_148 = local_108; if (spriteColor != (ColorMod *)&local_168) { *(undefined8 *)(this->_sprite)._color._offset = local_108; spriteColor->_tint[0] = local_118; (this->_sprite)._color._tint[1] = fStack_114; (this->_sprite)._color._tint[2] = fStack_110; (this->_sprite)._color._tint[3] = fStack_15c; (this->_sprite)._color._offset[2] = local_100; (this->_sprite)._color._colorize[0] = local_128; (this->_sprite)._color._colorize[1] = fStack_124; (this->_sprite)._color._colorize[2] = fStack_120; (this->_sprite)._color._colorize[3] = fStack_11c; } } local_d8 = *(int **)((int)game->_room + 0x12bc); if (this->_player == (Entity_Player *)0x0) { LAB_00624ff9: isHologram = '\0'; } else { bVar3 = Entity_Player::IsHologram(this->_player); isHologram = '\x01'; if (bVar3 == 0) goto LAB_00624ff9; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7fd10) && (_Init_thread_header(), DAT_00c7fd10 == -1)) { _DAT_00c5c97c = 0x300000004; DAT_00c5c984 = 0x1b; _atexit((_func_4879 *)&DAT_00b15590); local_8 = -NAN; _Init_thread_footer(&DAT_00c7fd10); } if (isHologram != '\0') { if ((DAT_00c5c978 == 0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), DAT_00c5c978 == 0)) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } seed = DAT_00c5c978 >> ((byte)_DAT_00c5c97c & 0x1f) ^ DAT_00c5c978; seed = seed << ((byte)((ulonglong)_DAT_00c5c97c >> 0x20) & 0x1f) ^ seed; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; DAT_00c5c978 = seed >> ((byte)DAT_00c5c984 & 0x1f) ^ seed; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[3] = (float)((double)(int)DAT_00c5c978 + __uint_to_double_fixup[-((int)DAT_00c5c978 >> 0x1f)]) * 2.3283062e-10 * 0.15 + 0.05; render_color_stack_push(); } if (this->_variant == 0x4b) { pvVar4 = this->_player; local_f0 = (g_screenHeight - 182.0) * 0.5; local_d4 = (g_screenWidth - 338.0) * 0.5; local_ec = g_displayPixelRatio * g_screenPointScale; local_d0 = ((*(float *)((int)pvVar4 + 0x33c) - 60.0) * 0.65 + local_d4) * local_ec + 0.5; dVar8 = floor((double)local_d0); local_d0 = (float)dVar8 / local_ec; local_e0 = ((*(float *)((int)pvVar4 + 0x340) - 140.0) * 0.65 + local_f0) * local_ec + 0.5; dVar8 = floor((double)local_e0); local_e0 = (float)dVar8 / local_ec; local_d4 = (((this->_pos).x - 60.0) * 0.65 + local_d4) * local_ec + 0.5; dVar8 = floor((double)local_d4); iconPosX.y = (float)dVar8 / local_ec; local_d4 = (((this->_pos).y - 140.0) * 0.65 + local_f0) * local_ec + 0.5; dVar8 = floor((double)local_d4); local_d0 = local_d0 - iconPosX.y; local_e0 = local_e0 - (float)dVar8 / local_ec; if (local_d8 == (int *)&DAT_00000005) { local_e0 = local_e0 * -1.0; } layerId = (byte *)0x1; do { fVar7 = (float)((double)(int)layerId + __uint_to_double_fixup[-((int)layerId >> 0x1f)]); fVar6 = 1.0 - fVar7 * 0.125; local_d4 = (this->_sprite)._scale.x; iconPosX.y = (fVar7 * local_d0 * 0.125 + 0.0) / local_d4; local_d4 = ((-5.0 - fVar6 * fVar6 * 7.0) + fVar7 * local_e0 * 0.125) / local_d4; layer = ANM2::GetLayer(&this->_sprite,layerId); layerId = layerId + 1; (layer->_pos).x = iconPosX.y; (layer->_pos).y = local_d4; } while (layerId < &DAT_00000009); LAB_0062578c: offset = renderOffset; } else if (this->_variant == 0x4f) { local_f0 = (g_screenHeight - 182.0) * 0.5; iconScaleX.y = (g_screenWidth - 338.0) * 0.5; local_e0 = g_displayPixelRatio * g_screenPointScale; iconPosX.y = ((*(float *)((int)this->_player + 0x33c) - 60.0) * 0.65 + iconScaleX.y) * local_e0 + 0.5; dVar8 = floor((double)iconPosX.y); local_d0 = (float)dVar8 / local_e0; iconPosX.y = ((*(float *)((int)this->_player + 0x340) - 140.0) * 0.65 + local_f0) * local_e0 + 0.5; dVar8 = floor((double)iconPosX.y); iconPosX.y = (float)dVar8; local_ec = iconPosX.y / local_e0; iconScaleX.y = (((this->_pos).x - 60.0) * 0.65 + iconScaleX.y) * local_e0 + 0.5; dVar8 = floor((double)iconScaleX.y); iconPosX.y = (float)dVar8 / local_e0; iconScaleX.y = (((this->_pos).y - 140.0) * 0.65 + local_f0) * local_e0 + 0.5; dVar8 = floor((double)iconScaleX.y); local_d0 = local_d0 - iconPosX.y; local_ec = local_ec - (float)dVar8 / local_e0; if (local_d8 == (int *)&DAT_00000005) { local_ec = local_ec * -1.0; } layerId = (byte *)0x1; local_d8 = (int *)(*(float *)((int)this->_player + 0x14f4) * -1.0); iconScaleX.y = -16.0 - (float)local_d8; do { fVar7 = (float)((double)(int)layerId + __uint_to_double_fixup[-((int)layerId >> 0x1f)]); fVar6 = 1.0 - fVar7 / 9.0; local_d4 = (this->_sprite)._scale.x; iconPosX.y = ((fVar7 * local_d0) / 9.0 + 0.0) / local_d4; local_d4 = (iconScaleX.y * fVar6 * fVar6 + (float)local_d8 + (fVar7 * local_ec) / 9.0) / local_d4; layer = ANM2::GetLayer(&this->_sprite,layerId); layerId = layerId + 1; (layer->_pos).x = iconPosX.y; (layer->_pos).y = local_d4; } while (layerId < (byte *)0xa); goto LAB_0062578c; } switch(this->_variant) { case 0x30: local_d0 = (float)__RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData:: RTTI_Type_Descriptor, &IsaacRepentancePlus::IsaacsBodyData::RTTI_Type_Descriptor); if (local_d0 != 0.0) { local_d8 = (int *)(g_displayPixelRatio * g_screenPointScale); iconScaleX.y = ((((this->_pos).x + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_d8 + 0.5; dVar8 = floor((double)iconScaleX.y); iconPosX.y = (float)dVar8 / (float)local_d8; iconScaleX.y = ((((this->_posOffset).y + (this->_pos).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_d8 + 0.5; dVar8 = floor((double)iconScaleX.y); iconScaleX.y = (float)dVar8; fVar7 = iconScaleX.y / (float)local_d8; local_f0 = 5.60519e-45; local_d8 = (int *)((int)local_d0 + 0x568); fVar6 = offset->y; layerColor = (float *)((int)local_d0 + 0x1c0); (this->_renderPosition).x = iconPosX.y + offset->x; (this->_renderPosition).y = fVar7 + fVar6; do { iVar5 = *local_d8; if (-1 < iVar5) { spriteColor = &(this->_sprite)._color; if ((ColorMod *)layerColor != spriteColor) { fVar6 = (this->_sprite)._color._tint[1]; fVar7 = (this->_sprite)._color._tint[2]; fVar2 = (this->_sprite)._color._tint[3]; *layerColor = spriteColor->_tint[0]; layerColor[1] = fVar6; layerColor[2] = fVar7; layerColor[3] = fVar2; fVar6 = (this->_sprite)._color._colorize[1]; fVar7 = (this->_sprite)._color._colorize[2]; fVar2 = (this->_sprite)._color._colorize[3]; layerColor[4] = (this->_sprite)._color._colorize[0]; layerColor[5] = fVar6; layerColor[6] = fVar7; layerColor[7] = fVar2; fVar6 = (this->_sprite)._color._offset[1]; layerColor[8] = (this->_sprite)._color._offset[0]; layerColor[9] = fVar6; layerColor[10] = (this->_sprite)._color._offset[2]; iVar5 = *local_d8; } Sprite::RenderLayer((Sprite *)(layerColor + -0x2a),iVar5,&this->_renderPosition, &g_vectorZero,&g_vectorZero); } local_d8 = local_d8 + 1; layerColor = layerColor + 0x45; local_f0 = (float)((int)local_f0 + -1); } while (local_f0 != 0.0); Sprite::RenderLayer((Sprite *)((int)local_d0 + 4),0,&this->_renderPosition,&g_vectorZero, &g_vectorZero); break; } default: Entity::Render((Entity *)this,offset); break; case 0x44: if (this->_visible != 0) { local_d8 = (int *)(g_displayPixelRatio * g_screenPointScale); iconScaleX.y = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_d8 + 0.5; dVar8 = floor((double)iconScaleX.y); iconPosX.y = (float)dVar8 / (float)local_d8; iconScaleX.y = ((((this->_posOffset).y + (this->_pos).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_d8 + 0.5; dVar8 = floor((double)iconScaleX.y); iconScaleX.y = (float)dVar8; fVar6 = offset->x; renderPos = &this->_renderPosition; (this->_renderPosition).y = iconScaleX.y / (float)local_d8 + offset->y; renderPos->x = iconPosX.y + fVar6; player = this->_player; savedPlayerColor = (float)player[0x3c]; fStack_94 = (float)player[0x3d]; fStack_90 = (float)player[0x3e]; iStack_8c = player[0x3f]; fStack_88 = (float)player[0x40]; fStack_84 = (float)player[0x41]; fStack_80 = (float)player[0x42]; fStack_7c = (float)player[0x43]; afStack_78 = *(float (*) [2])(player + 0x44); fStack_70 = (float)player[0x46]; tmpColor._tint[3] = opacity; tmpColor._tint[0] = savedPlayerColor; tmpColor._tint[1] = fStack_94; tmpColor._tint[2] = fStack_90; tmpColor._colorize[0] = fStack_88; tmpColor._colorize[1] = fStack_84; tmpColor._colorize[2] = fStack_80; tmpColor._colorize[3] = fStack_7c; tmpColor._offset._0_8_ = afStack_78; tmpColor._offset[2] = fStack_70; (**(code **)(*player + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); Entity_Player::RenderGlow(this->_player,renderPos); FUN_0078e130(renderPos); Entity_Player::RenderHead(this->_player,renderPos); (**(code **)(*(int *)this->_player + 0x3c))(&savedPlayerColor,0xffffffff,0xff,0,1); } break; case 0x4e: case 0xf3: local_d8 = (int *)(g_displayPixelRatio * g_screenPointScale); iconScaleX.y = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_d8 + 0.5; dVar8 = floor((double)iconScaleX.y); iconPosX.y = (float)dVar8 / (float)local_d8; iconScaleX.y = ((((this->_posOffset).y + (this->_pos).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_d8 + 0.5; dVar8 = floor((double)iconScaleX.y); iconScaleX.y = (float)dVar8; fVar7 = iconPosX.y + offset->x; fVar6 = offset->y; renderPos = &this->_renderPosition; renderPos->x = fVar7; (this->_renderPosition).y = iconScaleX.y / (float)local_d8 + fVar6; if (this->_variant == 0xf3) { renderPos->x = fVar7 + 0.0; (this->_renderPosition).y = (this->_renderPosition).y + 8.45; } player = this->_player; savedPlayerColor2 = player[0x3c]; iStack_c0 = player[0x3d]; iStack_bc = player[0x3e]; iStack_b8 = player[0x3f]; uStack_f1 = *(undefined1 *)((int)player + 0x171); iStack_b4 = player[0x40]; iStack_b0 = player[0x41]; iStack_ac = player[0x42]; iStack_a8 = player[0x43]; uStack_a4 = *(undefined8 *)(player + 0x44); iStack_9c = player[0x46]; fStack_60 = opacity; fadedPlayerColor = savedPlayerColor2; iStack_68 = iStack_c0; iStack_64 = iStack_bc; iStack_5c = iStack_b4; iStack_58 = iStack_b0; iStack_54 = iStack_ac; iStack_50 = iStack_a8; uStack_4c = uStack_a4; iStack_44 = iStack_9c; (**(code **)(*player + 0x3c))(&fadedPlayerColor,0xffffffff,0xff,0,1); *(undefined1 *)((int)this->_player + 0x171) = 1; Entity_Player::RenderGlow(this->_player,renderPos); FUN_0078e130(renderPos); Entity_Player::RenderHead(this->_player,renderPos); *(undefined1 *)((int)this->_player + 0x171) = uStack_f1; (**(code **)(*(int *)this->_player + 0x3c))(&savedPlayerColor2,0xffffffff,0xff,0,1); break; case 0xe7: local_d0 = (float)__RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData:: RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor); iVar5 = *(int *)((int)local_d0 + 0x24); if (iVar5 != *(int *)((int)local_d0 + 0x28)) { do { render_abyss_locust_sprite(this,iVar5,renderOffset); iVar5 = iVar5 + 0x114; } while (iVar5 != *(int *)((int)local_d0 + 0x28)); } Entity::Render((Entity *)this,renderOffset); iVar5 = *(int *)((int)local_d0 + 0x30); if (iVar5 != *(int *)((int)local_d0 + 0x34)) { do { render_abyss_locust_sprite(this,iVar5,renderOffset); iVar5 = iVar5 + 0x114; } while (iVar5 != *(int *)((int)local_d0 + 0x34)); } break; case 0xed: Entity::Render((Entity *)this,offset); if (((this->_visible != 0) && (pvVar4 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0), pvVar4 != (void *)0x0)) && (*(char *)((int)pvVar4 + 0x2c) != '\0')) { uStack_12c = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { uStack_138 = 6; } else { uStack_138 = 1; } iStack_13c = 0; uStack_134 = 1; uStack_130 = 1; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; iconScaleX.x = (layer->_size).x * *(float *)((int)pvVar4 + 0x18); tmpColor._tint[2] = 1.0; tmpColor._offset[0] = 0.6; tmpColor._offset[1] = 0.4; iconScaleX.y = *(float *)((int)pvVar4 + 0x1c) * (layer->_size).y; tmpColor._offset[2] = 0.8; tmpColor._tint[3] = opacity; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; iconPosX.x = (this->_renderPosition).x + *(float *)((int)pvVar4 + 0x10); iconPosX.y = *(float *)((int)pvVar4 + 0x14) + (this->_renderPosition).y; GameOver::render_collectible_icon (&g_game->_gameOver,this->_subtype,&iconPosX,&tmpColor,&iconScaleX,&iStack_13c); } break; case 0xf0: FUN_00435130(); } FUN_00860fe0(this,renderOffset); render_charge_indicator(this); if ((isHologram != '\0') && (g_colorStackSize = g_colorStackSize - 1, g_colorStackSize == 0)) { DAT_00c78dbc = 0; } spriteColor = &(this->_sprite)._color; if (spriteColor != (ColorMod *)local_194) { spriteColor->_tint[0] = local_118; (this->_sprite)._color._tint[1] = fStack_114; (this->_sprite)._color._tint[2] = fStack_110; (this->_sprite)._color._tint[3] = fStack_10c; (this->_sprite)._color._colorize[0] = local_128; (this->_sprite)._color._colorize[1] = fStack_124; (this->_sprite)._color._colorize[2] = fStack_120; (this->_sprite)._color._colorize[3] = fStack_11c; *(undefined8 *)(this->_sprite)._color._offset = local_108; (this->_sprite)._color._offset[2] = local_100; } ExceptionList = local_10; return; } //@@ 006261f0 Entity_Familiar::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [vtable slot 23] */ undefined1 __thiscall Entity_Familiar::HandleCollision(Entity_Familiar *this,EntityPtr param_2,char param_3) { ColorMod color; undefined1 auVar1 [32]; ColorMod color_00; ColorMod color_01; ColorMod color_02; BitSet128 tearFlags; BitSet128 tearFlags_00; BitSet128 flags; Vector pos; Vector pos_00; ANM2 *pAVar2; qword *pqVar3; undefined1 *puVar4; byte bVar5; char cVar6; int iVar7; Entity_Player **ppEVar8; uint uVar9; uint uVar10; int *piVar11; Entity_Player *extraout_EAX; LayerState *layer; EntityList_EL *queryResult; Vector *pVVar12; RNG *collectibleRng; Entity_NPC *npc; Entity *spawned; BitSet128 *flagsResult; Entity_Tear *tear; float fVar13; undefined4 uVar14; Vector *pVVar15; ChallengeParam *challengeParams; undefined4 *puVar16; int clampedOrbitLayer; Entity_Projectile *projectile; byte unused; EntityPtr EVar17; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int extraout_ECX_05; int extraout_ECX_06; int extraout_ECX_07; int extraout_ECX_08; int extraout_ECX_09; int extraout_ECX_10; int extraout_ECX_11; int extraout_ECX_12; int extraout_ECX_13; int extraout_ECX_14; int extraout_ECX_15; int extraout_ECX_16; int extraout_ECX_17; undefined1 uVar18; uint3 uVar19; code *extraout_EDX; Vector *collectibleRng; code *extraout_EDX_00; undefined4 extraout_EDX_01; code *extraout_EDX_02; code *extraout_EDX_03; EntityPtr EVar20; code *pcVar21; float *locustEffect; float fVar22; void *pvVar23; float fVar24; float fVar25; Entity_Player *pEVar26; Entity_Player *pEVar27; undefined4 in_stack_fffffd94; undefined4 in_stack_fffffd98; float in_stack_fffffd9c; undefined *in_stack_fffffda0; undefined4 in_stack_fffffda4; EntityRef *in_stack_fffffda8; Entity_Player *in_stack_fffffdac; undefined *in_stack_fffffdb0; EntityRef *pEVar28; undefined4 uVar29; undefined4 uVar30; undefined4 uVar31; TypeDescriptor *unused2; EntityRef EStack_230; EntityRef EStack_208; EntityRef EStack_1e0; EntityRef statusRef; undefined1 auStack_190 [8]; Vector effectPos; EntityRef tmpRef; undefined1 auStack_158 [8]; Vector VStack_150; float fStack_144; Vector VStack_140; char isLocustEffectTriggered; Vector VStack_134; EntityRef sourceRef; float fStack_104; int isIgnoreCollision; float damageMultiplier; undefined1 auStack_f8 [12]; float fStack_ec; undefined1 auStack_e8 [8]; Vector VStack_e0; Vector VStack_d8; float fStack_d0; int *colliderType; Entity_Player *pEStack_c8; EntityPtr collider; float damage; Entity_Player *pEStack_bc; undefined auStack_b8 [72]; float fStack_70; undefined1 auStack_50 [44]; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; Game *game; bool isVelocityDamageable; short *leprosyCount; Manager *manager; puStack_20 = auStack_50 + 0x4c; uStack_14 = 0xffffffff; puStack_18 = &UNK_00af6d10; pvStack_1c = ExceptionList; uStack_24 = __security_cookie ^ (uint)(auStack_50 + 0x40); ExceptionList = &pvStack_1c; collider = param_2; puVar4 = auStack_50 + 0x4c; if (1 < *(int *)&g_game->_deathmatchManager) { if (*(int *)((int)param_2 + 0x28) == 1) { puStack_20 = auStack_50 + 0x4c; puVar4 = auStack_50 + 0x4c; if (param_2 != this->_spawnerEntity) goto LAB_00626276; } else { puVar4 = auStack_50 + 0x4c; if (*(int *)((int)param_2 + 0x28) == 2) { bVar5 = Entity::IsDescendantOf((Entity *)param_2,(Entity *)this->_spawnerEntity); if (bVar5 != 0) { ExceptionList = pvStack_1c; return 1; } LAB_00626276: param_3 = '\x01'; puVar4 = puStack_20; } } } puStack_20 = puVar4; pEVar28 = (EntityRef *)0x626284; iVar7 = LuaEngine::PreFamiliarCollision(); if (iVar7 == 1) { ExceptionList = pvStack_1c; return 1; } if (iVar7 == -1) { ExceptionList = pvStack_1c; return 0; } colliderType = (int *)((int)param_2 + 0x28); pEStack_c8 = *(Entity_Player **)&g_game->_deathmatchManager; if (((int)pEStack_c8 < 2) || (*colliderType != 1)) { VStack_134.y = (float)*colliderType; if ((int)VStack_134.y - 10U < 0x3de) goto LAB_006262e3; } else { VStack_134.y = 1.4013e-45; LAB_006262e3: if ((*(uint *)((int)param_2 + 0x168) & 0x20000000) != 0) { ExceptionList = pvStack_1c; return 1; } } if ((((1 < (int)pEStack_c8) && (VStack_134.y == 1.4013e-45)) || ((int)VStack_134.y - 10U < 0x3de)) && (((*(uint *)((int)param_2 + 0x168) & 0x20000000) == 0 && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x100), bVar5 != 0)))) { ExceptionList = pvStack_1c; return 1; } if ((((1 < (int)pEStack_c8) && (VStack_134.y == 1.4013e-45)) || ((int)VStack_134.y - 10U < 0x3de)) && (*(char *)((int)g_game->_room + 0x72a1) != '\0')) { ExceptionList = pvStack_1c; return 1; } uVar19 = (uint3)((uint)pEStack_c8 >> 8); isIgnoreCollision = CONCAT31(uVar19,1); if (this->_variant == 0xef) { if (VStack_134.y == 1.4013e-45) { if (this->_orbitSpeed <= 0.0 && this->_orbitSpeed != 0.0) { ExceptionList = pvStack_1c; return 1; } } else if (VStack_134.y == 4.2039e-45) goto LAB_006263bd; isIgnoreCollision = (uint)uVar19 << 8; } else if (this->_variant == 0xf0) { ExceptionList = pvStack_1c; return 1; } LAB_006263bd: damageMultiplier = apply_tear_modifiers(this); iVar7 = this->_variant; if (iVar7 == 0x57) { if (this->_state == 1) { if (*(int *)&g_game->_deathmatchManager < 2) { pEStack_bc = (Entity_Player *)0x41200000; } else { pEStack_bc = (Entity_Player *)0x41600000; } fVar22 = (this->_velocity).y; fVar13 = (this->_velocity).x; fVar22 = sqrtf(fVar13 * fVar13 + fVar22 * fVar22); fVar22 = fVar22 / (float)pEStack_bc; if (fVar22 <= 0.0) { fVar22 = 0.0; } if (4.0 <= fVar22) { fVar22 = 4.0; } damageMultiplier = fVar22 * damageMultiplier; LAB_006266d0: iVar7 = this->_variant; } else { damageMultiplier = 0.0; } LAB_006266d3: if (((iVar7 == 0x5e) || (iVar7 == 0x71)) && ((this->_fireCooldown < 1 && ((bVar5 = Entity::IsVulnerableEnemy((Entity *)param_2,(Entity *)0x0), bVar5 != 0 && (bVar5 = Entity::IsDescendantOf((Entity *)this,(Entity *)param_2), bVar5 == 0)))))) { uVar9 = Random(); sourceRef._entity = this; switch(uVar9 & 7) { case 0: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; in_stack_fffffda4 = 0; in_stack_fffffda8 = (EntityRef *)0x0; in_stack_fffffdac = (Entity_Player *)0x0; in_stack_fffffdb0 = (undefined *)0x0; in_stack_fffffd94 = 0x3f800000; in_stack_fffffd98 = 0x3f800000; in_stack_fffffd9c = 1.3; in_stack_fffffda0 = (undefined *)0x3f800000; pEVar28 = (EntityRef *)0x3e20a0a1; auVar1 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3fa66666,0x3f8000003f800000))); color._offset[0] = 0.15686275; color._tint[0] = (float)auVar1._0_4_; color._tint[1] = (float)auVar1._4_4_; color._tint[2] = (float)auVar1._8_4_; color._tint[3] = (float)auVar1._12_4_; color._colorize[0] = (float)auVar1._16_4_; color._colorize[1] = (float)auVar1._20_4_; color._colorize[2] = (float)auVar1._24_4_; color._colorize[3] = (float)auVar1._28_4_; color._offset[1] = 0.15686275; color._offset[2] = 0.15686275; Entity::AddSlowing((Entity *)param_2,&sourceRef,0x3c,0.9,color,0); break; case 1: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = &sourceRef; in_stack_fffffdb0 = &UNK_00626954; Entity::AddPoison((Entity *)param_2,pEVar28,0x28,0.0,0); break; case 2: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = (EntityRef *)&UNK_00626a38; Entity::AddFreeze((Entity *)param_2,&sourceRef,0x32,0); break; case 3: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = &sourceRef; in_stack_fffffdb0 = &UNK_00626b21; Entity::AddCharmed((Entity *)param_2,pEVar28,0x96,0,0); break; case 4: uVar9 = Random(); sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_c8 = (Entity_Player *)(uVar9 % 0x1e + 0x96); sourceRef._type = this->_type; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = (EntityRef *)&UNK_00626c23; Entity::AddConfusion((Entity *)param_2,&sourceRef,(int)pEStack_c8,0); break; case 5: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = (EntityRef *)&UNK_00626d0a; Entity::AddFear((Entity *)param_2,&sourceRef,-0x96,0); break; case 6: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = &sourceRef; in_stack_fffffdb0 = &UNK_00626df6; Entity::AddBurn((Entity *)param_2,pEVar28,0x28,0.0,0); break; case 7: sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; pEStack_bc = (Entity_Player *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar9 = 0; } else { uVar9 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar10 = 0; } else { uVar10 = 4; } sourceRef._flags = uVar10 | uVar9 | (uint)pEStack_bc; pEVar28 = &sourceRef; in_stack_fffffdb0 = &UNK_00626edf; Entity::AddShrink((Entity *)param_2,pEVar28,-0x96,0,0); } uVar9 = Random(); this->_fireCooldown = (uVar9 % 3 + 3) * 0x1e; } } else { if (iVar7 == 0xf3) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); if ((bVar5 != 0) || (0 < this->_state)) { damageMultiplier = 6.0; goto LAB_006266d0; } iVar7 = this->_variant; } if (iVar7 == 200) { if (this->_state < 1) { iVar7 = 200; damageMultiplier = 0.0; goto LAB_006266d3; } fVar22 = (this->_velocity).y; fVar13 = (this->_velocity).x; pEStack_c8 = (Entity_Player *)sqrtf(fVar13 * fVar13 + fVar22 * fVar22); cVar6 = (**(code **)(*(int *)param_2 + 0x4c))(); fVar22 = 0.1; if (cVar6 == '\0') { fVar22 = 0.25; } iVar7 = this->_variant; damageMultiplier = fVar22 * (float)pEStack_c8 + 0.1; } if (iVar7 != 0xef) goto LAB_006266d3; fVar22 = (this->_velocity).x; fVar13 = (this->_velocity).y; fVar22 = sqrtf(fVar22 * fVar22 + fVar13 * fVar13); fVar22 = fVar22 / 3.0; if (fVar22 <= 0.0) { fVar22 = 0.0; } if (5.0 <= fVar22) { fVar22 = 5.0; } damageMultiplier = fVar22 * damageMultiplier; if ((((*colliderType == 1) && (this->_fireCooldown < 1)) && (0.0 <= this->_orbitSpeed)) && (fVar22 = ((Vector *)((int)param_2 + 0x360))->x, fVar22 = sqrtf(fVar22 * fVar22 + *(float *)((int)param_2 + 0x364) * *(float *)((int)param_2 + 0x364)), 2.0 < fVar22)) { pEStack_bc = (Entity_Player *)0x41600000; pEStack_c8 = (Entity_Player *)(fVar22 * 3.0); VStack_e0.y = (this->_pos).y - *(float *)((int)param_2 + 0x340); VStack_e0.x = (this->_pos).x - ((Vector *)((int)param_2 + 0x33c))->x; ppEVar8 = &pEStack_c8; if (14.0 <= fVar22 * 3.0) { ppEVar8 = &pEStack_bc; } pVVar12 = Vector::Resized(&VStack_e0,(Vector *)(auStack_f8 + 8),(float)*ppEVar8); manager = g_manager; pEStack_bc = (Entity_Player *)0x354; fVar22 = pVVar12->y; (this->_velocity).x = pVVar12->x + (this->_velocity).x; (this->_velocity).y = fVar22 + (this->_velocity).y; seed_fart_sound_override((int *)&pEStack_bc); pEVar28 = (EntityRef *)0x2; in_stack_fffffdb0 = (undefined *)0x3f800000; in_stack_fffffda8 = (EntityRef *)0x6266ca; in_stack_fffffdac = pEStack_bc; SoundEffects::Play(&manager->_sfxManager,(int)pEStack_bc,1.0,2,0,1.0,0.0); param_2 = collider; goto LAB_006266d0; } } if ((((this->_variant == 0x69) && (uVar9 = Random(), uVar9 % 100 == 0)) && (bVar5 = Entity::IsVulnerableEnemy((Entity *)param_2,(Entity *)0x0), bVar5 != 0)) && (bVar5 = Entity::IsDescendantOf((Entity *)this,(Entity *)param_2), bVar5 == 0)) { uVar9 = Random(); VStack_e0 = *(Vector *)((int)param_2 + 0x33c); in_stack_fffffda4 = 1000; in_stack_fffffda0 = &UNK_00626f7f; Game::SpawnEx(g_game,1000,0x13,&VStack_e0,&g_vectorZero,(Entity *)this,0,uVar9,0); piVar11 = (int *)__RTDynamicCast(); (**(code **)(*piVar11 + 0x40))(); pEStack_bc = this->_player; if (piVar11[0xef] != 0) { pEStack_c8 = (Entity_Player *)(piVar11 + 0xef); std::multiset::erase(); } *(Entity_Player **)(piVar11 + 0xef) = pEStack_bc; if (pEStack_bc != (Entity_Player *)0x0) { std::multiset::insert(); } Color::Color((Color *)auStack_50); pEVar28 = (EntityRef *)0x1; in_stack_fffffdb0 = (undefined *)0x1e; in_stack_fffffda8 = (EntityRef *)0x627031; in_stack_fffffdac = extraout_EAX; (*extraout_EDX)(); } EVar17 = collider; if (this->_variant == 0x7f) { bVar5 = Entity::IsEnemy((Entity *)collider); if (bVar5 != 0) { bVar5 = Entity::IsDescendantOf((Entity *)EVar17,(Entity *)this->_spawnerEntity); if ((bVar5 == 0) && (((bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,(Entity *)0x0), bVar5 != 0 || (iVar7 = *colliderType, iVar7 == 0x21)) || ((iVar7 == 0x124 || (iVar7 == 0xf5)))))) { bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)EVar17); if (bVar5 == 0) { uVar9 = Entity::GetHitListIndex((Entity *)EVar17); sorted_vector_insert_unique(&this->_hitList,uVar9); pEStack_bc = *(Entity_Player **)((int)this->_player + 0x360); fStack_104 = *(float *)((int)this->_player + 0x364); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pEStack_c8 = (Entity_Player *)((layer->_rotation + 90.0) * 0.017453292); VStack_134.y = sin((float)pEStack_c8); fVar22 = cos((float)pEStack_c8); pEStack_c8 = (Entity_Player *) ((fVar22 * (float)pEStack_bc + VStack_134.y * fStack_104) * 0.1); if ((float)pEStack_c8 <= 0.0) { pEStack_c8 = (Entity_Player *)0x0; } if (1.0 <= (float)pEStack_c8) { pEStack_c8 = (Entity_Player *)0x3f800000; } Random(); in_stack_fffffdb0 = auStack_b8; pEVar28 = (EntityRef *)&DAT_00000004; Entity_Player::GetTearHitParams(); pcVar21 = *(code **)(*(int *)collider + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); in_stack_fffffda8 = &sourceRef; in_stack_fffffdac = (Entity_Player *)0x1e; in_stack_fffffda4 = 0; in_stack_fffffda0 = (undefined *)0x0; in_stack_fffffd9c = ((float)pEStack_c8 + damageMultiplier) * fStack_70; in_stack_fffffd98 = 0x6271d5; (*pcVar21)(); EVar17 = collider; } } } } iVar7 = this->_variant; if ((((iVar7 == 3) || (iVar7 == 0x3b)) || ((iVar7 == 0x68 || (iVar7 == 0x19)))) && (((this->_subtype == 0 && (this->_fireCooldown < 0)) && ((iVar7 = *colliderType, iVar7 == 0x21 || ((iVar7 == 0x124 || (iVar7 == 0xf5)))))))) { pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); pEVar28 = (EntityRef *)0x0; in_stack_fffffdb0 = (undefined *)0x40600000; in_stack_fffffdac = (Entity_Player *)0x627256; (*pcVar21)(); (this->_velocity).x = (this->_velocity).x * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; iVar7 = this->_fireCooldown + -1; this->_fireCooldown = iVar7; if (iVar7 < -10) { this->_fireCooldown = 0x1e; } } if ((((this->_variant == 0xce) && (this->_subtype == 0x82)) && (this->_fireCooldown < 0)) && (((iVar7 = *colliderType, iVar7 == 0x21 || (iVar7 == 0x124)) || (iVar7 == 0xf5)))) { pcVar21 = *(code **)(*(int *)collider + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); pEVar28 = (EntityRef *)0x0; in_stack_fffffdb0 = (undefined *)0x40600000; in_stack_fffffdac = (Entity_Player *)0x62731c; (*pcVar21)(); (this->_velocity).x = (this->_velocity).x * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; iVar7 = this->_fireCooldown + -1; this->_fireCooldown = iVar7; if (iVar7 < -10) { this->_fireCooldown = 0x3c; this->_state = 0; } } EVar17 = collider; if (this->_variant == 0x42) { bVar5 = Entity::IsFrame((Entity *)this,7,this->_index); if (bVar5 != 0) { std::vector::clear(&this->_hitList,0); } EVar17 = collider; bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)collider); if (bVar5 != 0) { ExceptionList = pvStack_1c; return 1; } uVar9 = Entity::GetHitListIndex((Entity *)EVar17); sorted_vector_insert_unique(&this->_hitList,uVar9); bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,(Entity *)0x0); if (bVar5 == 0) { ExceptionList = pvStack_1c; return 1; } bVar5 = Entity::IsDescendantOf((Entity *)EVar17,(Entity *)this->_spawnerEntity); if (bVar5 == 0) { EntityRef::constructor(&sourceRef,(Entity *)this); Entity::AddCharmed((Entity *)EVar17,&sourceRef,0x96,0,0); SoundEffects::PlayWithFartOverride(0x3f8,1.0,0x96,0,1.0); ExceptionList = pvStack_1c; return 1; } ExceptionList = pvStack_1c; return 1; } if (this->_variant == 0x83) { bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)collider); if (bVar5 != 0) { ExceptionList = pvStack_1c; return 1; } uVar9 = Entity::GetHitListIndex((Entity *)EVar17); sorted_vector_insert_unique(&this->_hitList,uVar9); bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,this->_player); if (bVar5 == 0) { ExceptionList = pvStack_1c; return 1; } queryResult = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_f8 ,0x17,0,1,0,0); uVar9 = queryResult->_size; EntityList_Query::~EntityList_Query(auStack_f8); if (0xf < uVar9) { ExceptionList = pvStack_1c; return 1; } pVVar12 = MusicManager::RandomVector((Vector *)(auStack_f8 + 8)); pEStack_c8 = (Entity_Player *)pVVar12->x; pEStack_bc = (Entity_Player *)pVVar12->y; uVar9 = Random(); fStack_104 = 0.0; fVar22 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; VStack_e0.x = (float)pEStack_c8 * 40.0 * fVar22 + (this->_pos).x; VStack_e0.y = (float)pEStack_bc * 40.0 * fVar22 + (this->_pos).y; do { fVar22 = VStack_e0.y; pos.y = VStack_e0.y; pos.x = VStack_e0.x; iVar7 = Room::GetGridCollisionAtPos(g_game->_room,pos); if (iVar7 == 0) break; uVar9 = Random(); fVar22 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; pEStack_bc = (Entity_Player *)(fVar22 + fVar22); uVar9 = Random(); VStack_134.y = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; fVar22 = cos((float)pEStack_bc); pEStack_c8 = (Entity_Player *)(fVar22 * 40.0 * VStack_134.y + (this->_pos).x); fVar22 = sin((float)pEStack_bc); fStack_104 = (float)((int)fStack_104 + 1); fVar22 = fVar22 * 40.0 * VStack_134.y + (this->_pos).y; VStack_e0.x = (float)pEStack_c8; VStack_e0.y = fVar22; } while ((uint)fStack_104 < 4); pos_00.y = fVar22; pos_00.x = VStack_e0.x; iVar7 = Room::GetGridCollisionAtPos(g_game->_room,pos_00); if (iVar7 == 0) { collectibleRng = Entity_Player::GetCollectibleRNG(this->_player,0x1b1); uVar9 = RNG::Next(collectibleRng); npc = (Entity_NPC *) Game::SpawnEx(g_game,0x17,0,&VStack_e0,&g_vectorZero,this->_player,1,uVar9,0); uVar14 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffffffb; *(undefined4 *)((int)&npc->_flags + 4) = uVar14; EntityRef::constructor(&sourceRef,(Entity *)this); Entity::AddCharmed((Entity *)npc,&sourceRef,-1,0,0); Entity_NPC::TryForceTarget(npc,(Entity *)collider,0x5a); npc->_canShutDoors = 0; Color::Color(); (**(code **)(*(int *)npc + 0x3c))(); (**(code **)(*(int *)npc + 0xc))(); uVar9 = Random(); VStack_d8 = npc->_pos; spawned = Game::SpawnEx(g_game,1000,0x93,&VStack_d8,&g_vectorZero,(Entity *)0x0,1,uVar9,0); Color::Color(); (**(code **)(*(int *)spawned + 0x3c))(); (**(code **)(*(int *)spawned + 0x40))(); (**(code **)(*(int *)spawned + 0xc))(); ExceptionList = pvStack_1c; return 1; } ExceptionList = pvStack_1c; return 1; } if (param_3 == '\0') { } else { bVar5 = Entity::HasEntityFlags((Entity *)this,0x20000000000); EVar17 = collider; if (bVar5 != 0) { bVar5 = Entity::IsVulnerableEnemy((Entity *)collider,(Entity *)0x0); if (bVar5 != 0) { bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)EVar17); if (bVar5 == 0) { if (this->_orbitLayer == 0) { VStack_e0.y = *(float *)((int)EVar17 + 0x340) - *(float *)((int)this->_player + 0x340); VStack_e0.x = ((Vector *)((int)EVar17 + 0x33c))->x - *(float *)((int)this->_player + 0x33c); Vector::Normalized(&VStack_e0,&VStack_d8); fVar22 = *(float *)((int)EVar17 + 0x364); ((Vector *)((int)EVar17 + 0x360))->x = ((Vector *)((int)EVar17 + 0x360))->x + VStack_d8.x * 5.0; *(float *)((int)EVar17 + 0x364) = fVar22 + VStack_d8.y * 5.0; pvVar23 = this->_player; *(float *)((int)pvVar23 + 0x360) = *(float *)((int)pvVar23 + 0x360) - VStack_d8.x * 5.0; *(float *)((int)pvVar23 + 0x364) = *(float *)((int)pvVar23 + 0x364) - VStack_d8.y * 5.0; } pcVar21 = *(code **)(*(int *)EVar17 + 0x20); in_stack_fffffdb0 = (undefined *)(this->_collisionDamage * 1.5 + 6.0); EntityRef::constructor(&sourceRef,(Entity *)this); pEVar28 = (EntityRef *)0x0; in_stack_fffffdac = (Entity_Player *)0x627933; (*pcVar21)(); EVar17 = collider; FUN_00431620(); } } } } if (((this->_spawnerEntity == (EntityPtr)0x0) || (bVar5 = Entity::IsDescendantOf((Entity *)this->_spawnerEntity,(Entity *)EVar17), bVar5 == 0)) && ((bVar5 = Entity::IsActiveEnemy((Entity *)EVar17,0), bVar5 != 0 && ((bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,(Entity *)0x0), bVar5 != 0 || (cVar6 = (**(code **)(*(int *)EVar17 + 0x48))(), cVar6 != '\0')))))) { iVar7 = this->_variant; if ((iVar7 != 0xe4) && (iVar7 != 0xee)) { if (iVar7 == 0xc9) { VStack_d8.x = 0.0; VStack_d8.y = 0.0; switch(this->_subtype) { case 1: SoundEffects::PlayWithFartOverride(0x2b,1.0,0x14,0,1.0); break; case 3: bVar5 = Entity::HasEntityFlags((Entity *)EVar17,0x400); if ((bVar5 == 0) && (uVar9 = Random(), uVar9 % 3 == 0)) { *(int *)((int)EVar17 + 0x238) = 0; Entity::CopyStatusEffects((Entity *)EVar17); EntityRef::constructor(&sourceRef,(Entity *)this); Entity::AddMidasFreeze((Entity *)EVar17,&sourceRef,0x78,0); } break; case 4: bVar5 = Entity::HasEntityFlags((Entity *)EVar17,0x100); if ((bVar5 == 0) && (uVar9 = Random(), uVar9 % 3 == 0)) { *(int *)((int)EVar17 + 0x238) = 0; Entity::CopyStatusEffects((Entity *)EVar17); EntityRef::constructor(&sourceRef,(Entity *)this); Entity::AddCharmed((Entity *)EVar17,&sourceRef,0x78,0,0); } break; case 5: uVar14 = 0x627ac6; bVar5 = Entity::HasEntityFlags((Entity *)EVar17,0x80); if (bVar5 == 0) { *(int *)((int)EVar17 + 0x238) = 0; Entity::CopyStatusEffects((Entity *)EVar17); fVar22 = 9.043973e-39; EntityRef::constructor(&sourceRef,(Entity *)this); bVar5 = 0; Color::Color(0x3f800000); color_00._tint[1] = (float)in_stack_fffffd98; color_00._tint[0] = (float)in_stack_fffffd94; color_00._tint[2] = in_stack_fffffd9c; color_00._tint[3] = (float)in_stack_fffffda0; color_00._colorize[0] = (float)in_stack_fffffda4; color_00._colorize[1] = (float)in_stack_fffffda8; color_00._colorize[2] = (float)in_stack_fffffdac; color_00._colorize[3] = (float)in_stack_fffffdb0; color_00._offset[0] = (float)pEVar28; color_00._offset[1] = (float)uVar14; color_00._offset[2] = fVar22; Entity::AddSlowing((Entity *)EVar17,&sourceRef,0x78,0.9,color_00,bVar5); } break; case 0xd: VStack_d8.x = 2.8026e-45; VStack_d8.y = 0.0; bVar5 = Entity::HasEntityFlags((Entity *)EVar17,0x1000); if (bVar5 == 0) { *(int *)((int)EVar17 + 0x238) = 0; Entity::CopyStatusEffects((Entity *)EVar17); EntityRef::constructor(&sourceRef,(Entity *)this); Entity::AddBurn((Entity *)EVar17,&sourceRef,0x78,3.5,0); } } fVar22 = this->_collisionDamage; if (((this->_state == 2) && (bVar5 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero), bVar5 != 0)) && (pEStack_c8 = (Entity_Player *)(fVar22 + fVar22 + 7.0), this->_headFrameDelay == 0)) { Entity::SetTarget((Entity *)this,(Entity *)EVar17); this->_headFrameDelay = 1; } EVar20 = EVar17; if (this->_damageCountdown < 1) { pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); (*pcVar21)(); EVar20 = collider; } VStack_d8.y = *(float *)((int)EVar20 + 0x340) - (this->_pos).y; VStack_d8.x = ((Vector *)((int)EVar20 + 0x33c))->x - (this->_pos).x; Vector::Normalized(&VStack_d8,&VStack_e0); VStack_d8.y = VStack_e0.y * 10.0; VStack_d8.x = VStack_e0.x * 10.0; Entity::AddVelocity_divided((Entity *)EVar20,&VStack_d8,1); pVVar12 = &VStack_d8; VStack_d8.y = -VStack_e0.y * 3.0; VStack_d8.x = -VStack_e0.x * 3.0; EVar17 = (EntityPtr)this; LAB_00627cf6: Entity::AddVelocity_divided((Entity *)EVar17,pVVar12,1); if (*(float *)((int)EVar20 + 0x388) <= 0.0) { ExceptionList = pvStack_1c; return 1; } if (this->_damageCountdown < 1) { pcVar21 = *(code **)(*(int *)this + 0x20); EntityRef::constructor(&sourceRef,(Entity *)collider); (*pcVar21)(); ExceptionList = pvStack_1c; return 1; } ExceptionList = pvStack_1c; return 1; } if ((iVar7 == 0xd8) || (iVar7 == 0xd9)) { if (this->_damageCountdown < 1) { pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); (*pcVar21)(); EVar17 = collider; } VStack_e0.y = *(float *)((int)EVar17 + 0x340) - (this->_pos).y; VStack_e0.x = ((Vector *)((int)EVar17 + 0x33c))->x - (this->_pos).x; Vector::Normalized(&VStack_e0,&VStack_d8); pVVar12 = &VStack_e0; VStack_e0.y = VStack_d8.y * 2.0; VStack_e0.x = VStack_d8.x * 2.0; EVar20 = EVar17; goto LAB_00627cf6; } if (((iVar7 != 0xce) && (iVar7 != 0xed)) || (iVar7 = Room::GetFrameCount(g_game->_room), iVar7 < 0xf)) goto LAB_00628173; if (this->_collisionDamage <= 0.0) { ExceptionList = pvStack_1c; return 1; } if (((this->_damageCountdown < 1) && (bVar5 = Entity_Player::HasInvincibility(this->_player,0,(EntityRef *)0x0), bVar5 == 0)) && (this->_isInvicible == 0)) { pEStack_c8 = *(Entity_Player **)(*(int *)this + 0x20); EntityRef::constructor(&sourceRef,(Entity *)EVar17); (*(code *)pEStack_c8)(); } pEStack_c8 = (Entity_Player *)&this->_hitList; bVar5 = EntityList::HitListContains((EntityList *)pEStack_c8,(Entity *)EVar17); if (bVar5 != 0) { ExceptionList = pvStack_1c; return 1; } if (this->_variant == 0xce) { iVar7 = this->_subtype; if (iVar7 == 0x2be) goto LAB_00627ec1; if ((iVar7 != 0x82) || (this->_state != 1)) goto LAB_00627ea3; LAB_00627ec8: if (this->_state != 0) goto LAB_00627f86; } else { LAB_00627ea3: SoundEffects::PlayWithFartOverride(0x2b,0.7,0x14,0,1.0); iVar7 = this->_subtype; LAB_00627ec1: if (iVar7 == 0x82) goto LAB_00627ec8; } if ((0.0 < *(float *)((int)EVar17 + 0x36c)) && (0.0 < *(float *)((int)EVar17 + 0x37c))) { VStack_e0.y = *(float *)((int)EVar17 + 0x340) - *(float *)((int)this->_player + 0x340); VStack_e0.x = ((Vector *)((int)EVar17 + 0x33c))->x - *(float *)((int)this->_player + 0x33c); pVVar12 = Vector::Normalized(&VStack_e0,(Vector *)(auStack_f8 + 8)); VStack_e0.y = (this->_mass * pVVar12->y) / *(float *)((int)EVar17 + 0x37c); VStack_e0.x = (this->_mass * pVVar12->x) / *(float *)((int)EVar17 + 0x37c); Entity::AddVelocity_divided((Entity *)EVar17,&VStack_e0,1); } LAB_00627f86: pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); (*pcVar21)(); FUN_00431620(); ExceptionList = pvStack_1c; return 1; } if ((0.0 < *(float *)((int)EVar17 + 0x388)) && (this->_damageCountdown < 1)) { pcVar21 = *(code **)(*(int *)this + 0x20); EntityRef::constructor(&sourceRef,(Entity *)collider); (*pcVar21)(); EVar17 = collider; VStack_e0.y = (this->_pos).y - *(float *)((int)collider + 0x340); VStack_e0.x = (this->_pos).x - ((Vector *)((int)collider + 0x33c))->x; Vector::Normalized(&VStack_e0,&VStack_d8); VStack_e0.y = VStack_d8.y * 3.0; VStack_e0.x = VStack_d8.x * 3.0; Entity::AddVelocity_divided((Entity *)this,&VStack_e0,1); } } LAB_00628173: if ((this->_variant == 0xcc) && (0xc < this->_fireCooldown)) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x100); if (bVar5 == 0) { iVar7 = *colliderType; if (iVar7 == 9) { if ((*(uint *)((int)EVar17 + 0x438) & 2) == 0) { *(undefined1 *)((int)EVar17 + 0x173) = 1; VStack_e0.y = g_vectorZero.y; VStack_e0.x = g_vectorZero.x; VStack_134.y = (float)aim_reflected_projectile(this); if ((Entity *)VStack_134.y == (Entity *)0x0) { fVar22 = (this->_velocity).x; fVar13 = (this->_velocity).y; if (fVar22 * fVar22 + fVar13 * fVar13 <= 1e-05) { pVVar12 = MusicManager::RandomVector((Vector *)(auStack_f8 + 8)); } else { VStack_d8 = this->_velocity; pVVar12 = Vector::Normalized(&VStack_d8,(Vector *)(auStack_f8 + 8)); } } else { VStack_d8.y = (((Entity *)VStack_134.y)->_pos).y - (this->_pos).y; VStack_d8.x = (((Entity *)VStack_134.y)->_pos).x - (this->_pos).x; pVVar12 = Vector::Normalized(&VStack_d8,(Vector *)(auStack_f8 + 8)); } VStack_e0.y = pVVar12->y * 10.0; VStack_e0.x = pVVar12->x * 10.0; fVar22 = apply_tear_modifiers(this); pEStack_c8 = (Entity_Player *)(fVar22 * 2.0); fVar22 = apply_tear_modifiers(this); pEStack_bc = (Entity_Player *)(fVar22 * 0.2 + 0.8); uVar9 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,2,0,&this->_pos,&VStack_e0,(Entity *)this,0,uVar9); (**(code **)(*(int *)tear + 0x40))(); Entity_Tear::SetTearFlags(tear,g_tearFlagHoming); (**(code **)(*(int *)tear + 0x3c))(); Entity_Tear::SetScale(tear,(float)pEStack_bc); Entity::SetTarget((Entity *)tear,(Entity *)VStack_134.y); (**(code **)(*(int *)tear + 0xc))(); ExceptionList = pvStack_1c; return 1; } } else if ((((((iVar7 == 0xd) || (iVar7 == 0x12)) || (iVar7 == 0xde)) || ((iVar7 == 0x119 || (iVar7 == 0x364)))) || (iVar7 == 0x328)) && ((*(char *)((int)EVar17 + 0x173) == '\0' && (bVar5 = Entity::HasEntityFlags((Entity *)EVar17,0x20000000), bVar5 == 0)))) { (**(code **)(*(int *)EVar17 + 0x28))(); VStack_e0 = *(Vector *)((int)EVar17 + 0x33c); spawned = Entity_Player::AddBlueFlies(this->_player,1,&VStack_e0,(Entity *)0x0); fVar22 = *(float *)((int)EVar17 + 0x364); (spawned->_velocity).x = *(float *)((int)EVar17 + 0x360); (spawned->_velocity).y = fVar22; ExceptionList = pvStack_1c; return 1; } } else if ((this->_sirenHelper != (EntityPtr)0x0) && (0x1d < g_game->_frameCount - *(int *)((int)this->_sirenHelper + 0x328))) { if (*colliderType == 2) { flagsResult = BitSet128::operator_or ((BitSet128 *)auStack_158,&g_tearFlagExplosive,&g_tearFlagLudovico); auStack_f8._0_4_ = *(uint *)((int)EVar17 + 0x428); auStack_f8._4_4_ = *(uint *)((int)EVar17 + 0x42c); auStack_f8._8_4_ = *(float *)((int)EVar17 + 0x430); fStack_ec = *(float *)((int)EVar17 + 0x434); flagsResult = BitSet128::operator_and ((BitSet128 *)auStack_190,(BitSet128 *)auStack_f8,flagsResult); bVar5 = BitSet128::IsZero(flagsResult); if (bVar5 != 0) { *(undefined1 *)((int)EVar17 + 0x173) = 1; VStack_e0.y = g_vectorZero.y; VStack_e0.x = g_vectorZero.x; iVar7 = aim_reflected_projectile(this); if (iVar7 == 0) { fVar22 = (this->_velocity).y; pVVar12 = &this->_velocity; if (pVVar12->x * pVVar12->x + fVar22 * fVar22 <= 1e-05) { pVVar12 = MusicManager::RandomVector((Vector *)(auStack_f8 + 8)); goto LAB_006282d2; } } else { pVVar12 = &VStack_d8; VStack_d8.y = *(float *)(iVar7 + 0x340) - (this->_pos).y; VStack_d8.x = *(float *)(iVar7 + 0x33c) - (this->_pos).x; } pVVar12 = Vector::Normalized(pVVar12,(Vector *)(auStack_f8 + 8)); LAB_006282d2: VStack_e0.y = pVVar12->y * 10.0; VStack_e0.x = pVVar12->x * 10.0; uVar9 = Random(); spawned = Game::Spawn(g_game,9,4,&this->_pos,&VStack_e0,(Entity *)this,0,uVar9); iVar7 = *(int *)spawned; spawned[1]._variant = 1; spawned[1]._subtype = 0; (**(code **)(iVar7 + 0x3c))(); (**(code **)(*(int *)spawned + 0xc))(); ExceptionList = pvStack_1c; return 1; } } else if ((*colliderType == 3) && (*(int *)((int)EVar17 + 0x2c) == 0x2b)) { (**(code **)(*(int *)EVar17 + 0x28))(); uVar9 = Random(); VStack_e0 = *(Vector *)((int)EVar17 + 0x360); VStack_d8 = *(Vector *)((int)EVar17 + 0x33c); spawned = Game::Spawn(g_game,0x12,0,&VStack_d8,&VStack_e0,(Entity *)0x0,0,uVar9); uVar14 = *(undefined4 *)((int)&spawned->_flags + 4); iVar7 = *(int *)spawned; *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; *(undefined4 *)((int)&spawned->_flags + 4) = uVar14; (**(code **)(iVar7 + 0xc))(); ExceptionList = pvStack_1c; return 1; } } } if ((*colliderType == 1) && ((((bVar5 = Entity_Player::HasCollectible((Entity_Player *)EVar17,9,0), bVar5 != 0 || ((*(int *)((int)EVar17 + 0x2c) == 0 && (bVar5 = Entity_Player::HasPlayerForm((Entity_Player *)EVar17,1), bVar5 != 0)))) && ((iVar7 = this->_variant, iVar7 == 0x2b || ((iVar7 == 0x49 || (iVar7 == 0xe7)))))) || (((*colliderType == 1 && ((*(int *)((int)EVar17 + 0x2c) == 0 && (bVar5 = Entity_Player::HasPlayerForm((Entity_Player *)EVar17,0xc), bVar5 != 0)))) && ((this->_variant == 0x49 || (this->_variant == 0x71)))))))) { ExceptionList = pvStack_1c; return 1; } if (((((this->_variant == 0xe7) && (this->_state == -1)) && (bVar5 = Entity::IsEnemy((Entity *)EVar17), bVar5 != 0)) && (bVar5 = Entity::IsDescendantOf((Entity *)this,(Entity *)EVar17), bVar5 == 0)) && ((((bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,(Entity *)0x0), bVar5 != 0 || (iVar7 = *colliderType, iVar7 == 0x21)) || ((iVar7 == 0x124 || (iVar7 == 0xf5)))) && (bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)EVar17), bVar5 == 0)))) { FUN_00431620(); fVar13 = (float)get_item_config_entry(this); unused2 = &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor; fStack_104 = fVar13; pEStack_c8 = (Entity_Player *)__RTDynamicCast(); auStack_f8._0_4_ = *(uint *)((int)fVar13 + 8); auStack_f8._4_4_ = *(uint *)((int)fVar13 + 0xc); auStack_f8._8_4_ = *(float *)((int)fVar13 + 0x10); fStack_ec = *(float *)((int)fVar13 + 0x14); fStack_d0 = *(float *)((int)fVar13 + 0x18); fVar22 = 1.0; damage = 1.0; if (this->_item != (void *)0x0) { uVar14 = func_0x0064b8f0(); switch(uVar14) { case 0: fVar22 = 0.5; break; case 1: fVar22 = 0.75; break; case 2: break; case 3: fVar22 = 1.5; break; case 4: fVar22 = 2.0; break; default: goto LAB_00628822; } damage = fVar22; } LAB_00628822: locustEffect = *(float **)((int)fVar13 + 0x68); isLocustEffectTriggered = '\0'; fVar13 = 0.0; VStack_134.y = 0.0; if (locustEffect == *(float **)((int)fStack_104 + 0x6c)) { LAB_0062892d: damage = fVar22 * *(float *)((int)fStack_104 + 4); } else { pEStack_bc = (Entity_Player *)0x1; fVar24 = fStack_104; do { if (((uint)fVar13 & (uint)pEStack_bc) == 0) { if (*locustEffect <= 0.0) { fVar22 = damage; } else { uVar9 = Random(); if ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 < *locustEffect) { auStack_f8._0_4_ = auStack_f8._0_4_ | (uint)locustEffect[2]; auStack_f8._4_4_ = auStack_f8._4_4_ | (uint)locustEffect[3]; auStack_f8._8_4_ = auStack_f8._8_4_ | (uint)locustEffect[4]; fStack_ec = (float)((uint)fStack_ec | (uint)locustEffect[5]); fStack_d0 = (float)((uint)fStack_d0 | (uint)locustEffect[6]); damage = damage * locustEffect[1]; VStack_134.y = (float)((uint)VStack_134.y | (uint)locustEffect[7]); isLocustEffectTriggered = '\x01'; } fVar13 = VStack_134.y; fVar24 = fStack_104; fVar22 = damage; } } locustEffect = locustEffect + 0x1a; pEStack_bc = (Entity_Player *)((int)pEStack_bc << 1 | (uint)((int)pEStack_bc < 0)); } while (locustEffect != *(float **)((int)fVar24 + 0x6c)); if (isLocustEffectTriggered == '\0') goto LAB_0062892d; } fVar22 = apply_tear_modifiers(this); damage = (fVar22 * 0.25 + 0.75) * damage; iVar7 = extraout_ECX; if (((uint)fStack_d0 & 2) != 0) { uVar9 = Random(); iVar7 = 0x16; switch(uVar9 % 0x16) { case 0: unused2 = (TypeDescriptor *)0x62899c; FUN_0060cc30(); iVar7 = extraout_ECX_00; break; case 1: unused2 = (TypeDescriptor *)0x6289ae; FUN_0060cc30(); iVar7 = extraout_ECX_01; break; case 2: unused2 = (TypeDescriptor *)0x6289c0; FUN_0060cc30(); iVar7 = extraout_ECX_02; break; case 3: unused2 = (TypeDescriptor *)0x6289d2; FUN_0060cc30(); iVar7 = extraout_ECX_03; break; case 4: unused2 = (TypeDescriptor *)0x6289e4; FUN_0060cc30(); iVar7 = extraout_ECX_04; break; case 5: unused2 = (TypeDescriptor *)0x6289f6; FUN_0060cc30(); iVar7 = extraout_ECX_05; break; case 6: unused2 = (TypeDescriptor *)0x628a08; FUN_0060cc30(); iVar7 = extraout_ECX_06; break; case 7: unused2 = (TypeDescriptor *)0x628a1a; FUN_0060cc30(); iVar7 = extraout_ECX_07; break; case 8: unused2 = (TypeDescriptor *)0x628a2c; FUN_0060cc30(); iVar7 = extraout_ECX_08; break; case 9: unused2 = (TypeDescriptor *)0x628a3e; FUN_0060cc30(); iVar7 = extraout_ECX_09; break; case 10: unused2 = (TypeDescriptor *)0x628a50; FUN_0060cc30(); iVar7 = extraout_ECX_10; break; case 0xb: unused2 = (TypeDescriptor *)0x628a62; FUN_0060cc30(); iVar7 = extraout_ECX_11; break; case 0xc: unused2 = (TypeDescriptor *)0x628a74; FUN_0060cc30(); iVar7 = extraout_ECX_12; break; case 0xd: unused2 = (TypeDescriptor *)0x628a86; FUN_0060cc30(); iVar7 = extraout_ECX_13; break; case 0xe: unused2 = (TypeDescriptor *)0x628a98; FUN_0060cc30(); iVar7 = extraout_ECX_14; break; case 0xf: unused2 = (TypeDescriptor *)0x628aaa; FUN_0060cc30(); iVar7 = extraout_ECX_15; break; case 0x10: unused2 = (TypeDescriptor *)0x628abc; FUN_0060cc30(); iVar7 = extraout_ECX_16; break; case 0x11: fStack_d0 = (float)((uint)fStack_d0 | 1); break; case 0x12: fStack_d0 = (float)((uint)fStack_d0 | 0x400); break; case 0x13: fStack_d0 = (float)((uint)fStack_d0 | 0x800); break; case 0x14: uVar9 = Random(); iVar7 = extraout_ECX_17; switch(uVar9 & 3) { case 0: fStack_d0 = (float)((uint)fStack_d0 | 0x2000); break; case 1: fStack_d0 = (float)((uint)fStack_d0 | 0x4000); break; case 2: fStack_d0 = (float)((uint)fStack_d0 | 0x8000); break; case 3: fStack_d0 = (float)((uint)fStack_d0 | 0x10000); } break; case 0x15: fStack_d0 = (float)((uint)fStack_d0 | 0x20000); } } damage = damage * *(float *)((int)this->_player + 0x157c) + (float)(byte)(pEStack_c8->_sprite)._filename._buf[8] * 0.25; VStack_e0.x = 0.0; VStack_e0.y = 0.0; in_stack_fffffda4 = 0x628b8a; tearFlags_00._l._4_4_ = auStack_f8._4_4_; tearFlags_00._l._0_4_ = auStack_f8._0_4_; tearFlags_00._h._0_4_ = auStack_f8._8_4_; tearFlags_00._h._4_4_ = fStack_ec; get_tear_flags_from_player ((ulonglong *)&VStack_e0,iVar7,tearFlags_00,(int)unused2,(Entity *)this); pcVar21 = *(code **)(*(int *)collider + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); (*pcVar21)(); EVar17 = collider; in_stack_fffffda8 = (EntityRef *)0x628c02; flags._l._4_4_ = auStack_f8._4_4_; flags._l._0_4_ = auStack_f8._0_4_; flags._h._0_4_ = auStack_f8._8_4_; flags._h._4_4_ = fStack_ec; Entity_Tear::ApplyTearFlagEffects((Entity *)collider,&this->_pos,flags,(Entity *)this,damage); apply_tear_flag_effects(this,(BitSet128 *)auStack_f8,(uint *)&fStack_d0,(Entity *)EVar17); if (this->_fireCooldown == -1) { flagsResult = BitSet128::operator_and ((BitSet128 *)auStack_158,(BitSet128 *)auStack_f8, (BitSet128 *)&DAT_00c34b50); bVar5 = BitSet128::IsZero(flagsResult); if (bVar5 != 0) { this->_fireCooldown = -2; } } if (((this->_player->_playerType == 0x22) && (bVar5 = Entity_Player::HasCollectible(this->_player,0x26b,0), bVar5 != 0)) && ((bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,(Entity *)0x0), bVar5 != 0 && ((bVar5 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero), bVar5 != 0 || (this->_target == (EntityPtr)0x0)))))) { Entity::SetTarget((Entity *)this,(Entity *)EVar17); (this->_targetPosition).x = (this->_pos).x; (this->_targetPosition).y = (this->_pos).y; } bVar5 = Entity::HasEntityFlags((Entity *)EVar17,0x4000000); if (bVar5 == 0) { Vector::Normalized(&this->_velocity,&VStack_e0); fVar22 = Entity::IsCollisionIgnored((Entity *)EVar17,(Entity *)this); if (0.0 < fVar22) { VStack_e0.x = VStack_e0.x / fVar22; VStack_e0.y = VStack_e0.y / fVar22; } fVar22 = this->_mass * 1.8000001; VStack_e0.y = VStack_e0.y * fVar22; VStack_e0.x = VStack_e0.x * fVar22; Entity::AddVelocity_divided((Entity *)EVar17,&VStack_e0,0); } } damage = this->_collisionDamage; if (damage == 0.0) { iVar7 = Entity_Player::GetTrinketMultiplier(this->_player,0xb3); if (iVar7 == 2) { damage = 2.0; } else if (2 < iVar7) { damage = 5.0; } iVar7 = Entity_Player::GetTrinketMultiplier(this->_player,0x94); if (1 < iVar7) { damage = 4.0; } } if (param_3 == '\0') goto LAB_0062a55e; bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar17,(Entity *)0x0); if ((((bVar5 != 0) && (((0.0 < damage || (this->_variant == 0x21)) || (this->_variant == 0x7e)))) && (bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)EVar17), bVar5 == 0)) && (((this->_variant != 0x10 || (this->_entityCollisionClass == 3)) || (this->_entityCollisionClass == 4)))) { FUN_00431620(); uVar9 = this->_variant; if (((uVar9 == 0x21) || (uVar9 == 0x3c)) || ((((uVar9 == 0xf || ((((uVar9 == 0xe || (uVar9 == 0x4f)) || (uVar9 == 0x4d)) || ((uVar9 == 3 || (uVar9 == 0x68)))))) || ((0x2b < uVar9 && (uVar9 < 0x30)))) || (((uVar9 == 0x20 || (uVar9 == 0x53)) || ((uVar9 == 0x79 || (uVar9 == 0x7e)))))))) { LAB_00628f34: iVar7 = *colliderType; if (iVar7 != 0xd) { if (iVar7 == 0xe) { if (*(int *)((int)EVar17 + 0x2c) == 2) goto LAB_0062908f; } else if (((((iVar7 != 0x12) && (iVar7 != 0x50)) && (iVar7 != 0xde)) && ((iVar7 != 0x100 && (iVar7 != 0x128)))) && ((iVar7 != 0x119 && (iVar7 != 0x364)))) { LAB_0062908f: if (uVar9 != 0x82) goto LAB_006290a8; goto LAB_00629096; } } pcVar21 = *(code **)(*(int *)EVar17 + 0x24); EntityRef::constructor(&EStack_1e0,(Entity *)this); (*pcVar21)(); iVar7 = this->_variant; LAB_00628f77: EVar17 = collider; LAB_00628f7d: if (iVar7 == 0x2b) { uVar9 = Random(); uVar30 = 0; pVVar15 = &g_vectorZero; pVVar12 = &this->_pos; uVar31 = 3; uVar29 = 1000; uVar14 = 0x628fae; Game::Spawn(g_game,1000,3,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar9); (**(code **)(*(int *)this + 0x28))(); iVar7 = this->_subtype; isIgnoreCollision = 1; if (iVar7 == 1) { flagsResult = Entity_Player::GetBombFlags(this->_player,(BitSet128 *)auStack_e8,0); Game::BombExplosionEffects (g_game,&this->_pos,(damageMultiplier - 1.0) * 25.0 + 60.0,*flagsResult, &(this->_sprite)._color,(Entity *)this,0.6,1,4,0); } else if (iVar7 == 2) { EntityRef::constructor(&tmpRef,(Entity *)this); Entity::AddPoison((Entity *)EVar17,&tmpRef,0x28,0.0,0); } else if (iVar7 == 3) { fVar22 = 9.05608e-39; EntityRef::constructor(&tmpRef,(Entity *)this); bVar5 = 0; Color::Color(0x3f800000,0x28,0x28,0x28); color_02._tint[1] = (float)in_stack_fffffd98; color_02._tint[0] = (float)in_stack_fffffd94; color_02._tint[2] = in_stack_fffffd9c; color_02._tint[3] = (float)in_stack_fffffda0; color_02._colorize[0] = (float)uVar14; color_02._colorize[1] = (float)uVar29; color_02._colorize[2] = (float)uVar31; color_02._colorize[3] = (float)pVVar12; color_02._offset[0] = (float)pVVar15; color_02._offset[1] = (float)uVar30; color_02._offset[2] = fVar22; Entity::AddSlowing((Entity *)EVar17,&tmpRef,300,0.9,color_02,bVar5); } else if (iVar7 == 4) { pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&tmpRef,(Entity *)this); (*pcVar21)(); } SoundEffects::PlayWithFartOverride(0x3f7,1.0,0xf,0,1.0); iVar7 = this->_variant; } } else { if (uVar9 == 0x82) { if (this->_fireCooldown == -1) goto LAB_00628f34; LAB_00629096: iVar7 = 0x82; if (this->_fireCooldown == -1) { LAB_006290a8: if ((uVar9 != 0x21) && (uVar9 != 0x75)) goto LAB_006290bc; goto LAB_00629a76; } goto LAB_00628f7d; } if (uVar9 != 0x57) { if ((((uVar9 == 0xe2) || (uVar9 == 0xe0)) || (uVar9 == 0xd2)) || (((uVar9 == 0xda || (uVar9 == 0xce)) || ((uVar9 == 0xed || ((uVar9 == 0xe5 || (uVar9 == 0xcc)))))))) goto LAB_00628f34; if (uVar9 == 0xe8) { iVar7 = this->_fireCooldown; joined_r0x00628f2e: if (iVar7 == -1) goto LAB_00628f34; goto LAB_006290bc; } if (uVar9 == 0xdf) { iVar7 = this->_fireCooldown; goto joined_r0x00628f2e; } goto LAB_006290a8; } if (0 < this->_fireCooldown) goto LAB_00628f34; LAB_006290bc: npc = (Entity_NPC *)__RTDynamicCast(); if ((npc == (Entity_NPC *)0x0) || (bVar5 = Entity_NPC::CanBeDamagedFromVelocity(npc,this->_velocity), bVar5 != 0)) { isVelocityDamageable = true; } else { isVelocityDamageable = false; } if (((this->_variant != 0x2b) && (this->_variant != 0x49)) || (isVelocityDamageable)) { pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); fVar22 = damage * damageMultiplier; uVar31 = 0; uVar29 = 0; uVar14 = 0x62914d; fStack_d0 = fVar22; (*pcVar21)(); iVar7 = this->_variant; if ((iVar7 != 0xef) || (damageMultiplier <= 0.0)) { EVar17 = collider; } else { std::vector::clear(&this->_hitList,0); FUN_00431620(); iVar7 = 0xf; if (1 < *(int *)&g_game->_deathmatchManager) { iVar7 = 0x78; } fVar13 = 9.052146e-39; EntityRef::constructor(&statusRef,(Entity *)this); bVar5 = 0; Color::Color(0x3f800000,0x28,0x28,0x28); EVar17 = collider; color_01._tint[1] = (float)in_stack_fffffd98; color_01._tint[0] = (float)in_stack_fffffd94; color_01._tint[2] = in_stack_fffffd9c; color_01._tint[3] = (float)in_stack_fffffda0; color_01._colorize[0] = (float)in_stack_fffffda4; color_01._colorize[1] = (float)in_stack_fffffda8; color_01._colorize[2] = (float)uVar14; color_01._colorize[3] = fVar22; color_01._offset[0] = (float)uVar29; color_01._offset[1] = (float)uVar31; color_01._offset[2] = fVar13; Entity::AddSlowing((Entity *)collider,&statusRef,iVar7,0.9,color_01,bVar5); EntityRef::constructor(&statusRef,(Entity *)this); Entity::AddIce((Entity *)EVar17,&statusRef,8); iVar7 = this->_variant; } if (iVar7 == 0x38) { if ((1 < *(int *)&g_game->_deathmatchManager) && (this->_roomClearCount = this->_roomClearCount + (int)(fStack_d0 + 0.5), 0x32 < this->_roomClearCount)) { do { pEStack_c8 = this->_player; if ((pEStack_c8 != (Entity_Player *)0x0) && (pEStack_c8->_dead == 0)) { Entity_Player::AddHearts(pEStack_c8,1,0,0); uVar9 = Random(); effectPos.x = (pEStack_c8->_pos).x; effectPos.y = (pEStack_c8->_pos).y; in_stack_fffffda0 = (undefined *)0x6292e6; Game::SpawnEx(g_game,1000,0x31,&effectPos,&g_vectorZero,(Entity *)0x0,0,uVar9,0); iVar7 = __RTDynamicCast(); *(undefined4 *)(iVar7 + 0xdc) = 0; *(undefined4 *)(iVar7 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar7 + 0x358) = 0x3f800000; } this->_roomClearCount = this->_roomClearCount + -0x32; } while (0x32 < this->_roomClearCount); iVar7 = this->_variant; goto LAB_00629332; } } else { LAB_00629332: if ((iVar7 == 0x57) && (0.0 < damageMultiplier)) { std::vector::clear(&this->_hitList,0); FUN_00431620(); VStack_134.y = *(float *)((int)EVar17 + 0x340) - (this->_pos).y; fStack_144 = this->_size + *(float *)((int)EVar17 + 0x370); fStack_104 = ((Vector *)((int)EVar17 + 0x33c))->x - (this->_pos).x; auStack_f8._8_4_ = fStack_104; fStack_ec = VStack_134.y; pEStack_c8 = (Entity_Player *) sqrtf(VStack_134.y * VStack_134.y + fStack_104 * fStack_104); if (0.0001 < (float)pEStack_c8) { VStack_150.y = (this->_velocity).y - *(float *)((int)EVar17 + 0x364); VStack_150.x = (this->_velocity).x - ((Vector *)((int)EVar17 + 0x360))->x; VStack_e0.y = (float)&this->_velocity; VStack_140.y = VStack_150.y; VStack_d8.y = VStack_150.x; pEStack_bc = (Entity_Player *) sqrtf(VStack_150.y * VStack_150.y + VStack_150.x * VStack_150.x); if ((fStack_144 * 0.5 < (float)pEStack_bc) && (VStack_134.y * VStack_140.y + VStack_d8.y * fStack_104 < 0.0)) { pVVar12 = Vector::Normalized(&VStack_150,&VStack_d8); pVVar15 = Vector::Normalized((Vector *)(auStack_f8 + 8),&VStack_150); fVar22 = pVVar12->y * pVVar15->y + pVVar12->x * pVVar15->x; fVar13 = fVar22 * VStack_134.y; fVar22 = fVar22 * fStack_104; VStack_134.y = VStack_134.y + fVar13 + fVar13; fStack_104 = fStack_104 + fVar22 + fVar22; pEStack_c8 = (Entity_Player *) sqrtf(VStack_134.y * VStack_134.y + fStack_104 * fStack_104); EVar17 = collider; } fVar13 = (float)pEStack_bc * (fStack_104 / (float)pEStack_c8); pEVar27 = (Entity_Player *) (this->_mass / (*(float *)((int)EVar17 + 0x37c) + this->_mass)); pEVar26 = (Entity_Player *)((float)pEStack_bc * (VStack_134.y / (float)pEStack_c8)); fVar25 = (this->_velocity).x - fVar13 * (1.0 - (float)pEVar27); fVar22 = (this->_velocity).y; fVar24 = fVar22 - (float)pEVar26 * (1.0 - (float)pEVar27); VStack_d8.y = fVar25; fStack_144 = fVar13; VStack_140.y = fVar24; VStack_134.x = fVar25; VStack_134.y = fVar24; pEStack_c8 = pEVar27; pEStack_bc = pEVar26; if (0 < this->_fireCooldown) { bVar5 = Vector::operator_ne(&VStack_134,&g_vectorZero); if (bVar5 != 0) { fVar22 = sqrtf(*(float *)VStack_e0.y * *(float *)VStack_e0.y + fVar22 * fVar22); Vector::Resized(&VStack_134,(Vector *)(auStack_f8 + 8),fVar22 * 0.95); fVar22 = (float)this->_fireCooldown / 100.0; if (fVar22 <= 0.2) { fVar22 = 0.2; } if (1.0 <= fVar22) { fVar22 = 1.0; } fVar24 = VStack_140.y + (fStack_ec - VStack_140.y) * fVar22; fVar25 = VStack_d8.y + fVar22 * ((float)auStack_f8._8_4_ - VStack_d8.y); pEVar26 = pEStack_bc; pEVar27 = pEStack_c8; fVar13 = fStack_144; } } auStack_f8._8_4_ = fVar13 * (float)pEVar27; (this->_velocity).x = fVar25; fStack_ec = (float)pEVar26 * (float)pEVar27; (this->_velocity).y = fVar24; Entity::AddVelocity((Entity *)EVar17,(Vector *)(auStack_f8 + 8),1); bVar5 = Vector::operator_ne(collectibleRng,&g_vectorZero); if ((bVar5 != 0) && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x100), bVar5 == 0) ) { fVar22 = (this->_velocity).x; fVar13 = (this->_velocity).y; VStack_e0.y = fVar22; fVar22 = sqrtf(fVar22 * fVar22 + fVar13 * fVar13); VStack_d8.y = fVar22; (this->_velocity).x = VStack_e0.y / fVar22; (this->_velocity).y = (this->_velocity).y / fVar22; PickEnemyTarget(this,800.0,0,0xb,&this->_velocity,15.0); EVar20 = this->_target; if (EVar20 != (EntityPtr)0x0) { auStack_f8._8_4_ = *(float *)((int)EVar20 + 0x33c) - (this->_pos).x; fStack_ec = *(float *)((int)EVar20 + 0x340) - (this->_pos).y; pVVar12 = Vector::Normalized((Vector *)(auStack_f8 + 8),&VStack_150); (this->_velocity).x = pVVar12->x; (this->_velocity).y = pVVar12->y; } (this->_velocity).y = VStack_d8.y * (this->_velocity).y; (this->_velocity).x = VStack_d8.y * (this->_velocity).x; } } } } iVar7 = this->_variant; if (iVar7 == 0x6a) { this->_state = this->_state + (int)fStack_d0; } else if (iVar7 == 0x79) { iVar7 = this->_state + 1; this->_state = iVar7; if (0x1d < iVar7) { pEVar28 = &EStack_208; leprosyCount = (short *)((int)this->_player + 0x1384); *leprosyCount = *leprosyCount + -1; LAB_00629a06: EntityRef::EntityRef(pEVar28); (*extraout_EDX_00)(); } } else if (iVar7 == 0x80) { auStack_f8._8_4_ = ((Vector *)((int)EVar17 + 0x33c))->x - *(float *)((int)this->_player + 0x33c); fStack_ec = *(float *)((int)EVar17 + 0x340) - *(float *)((int)this->_player + 0x340); pVVar12 = Vector::Normalized((Vector *)(auStack_f8 + 8),&VStack_d8); auStack_f8._8_4_ = pVVar12->x * 10.0; fStack_ec = pVVar12->y * 10.0; Entity::AddVelocity_divided((Entity *)EVar17,(Vector *)(auStack_f8 + 8),0); iVar7 = this->_state + 3; this->_state = iVar7; if (5 < iVar7) { pEVar28 = &EStack_230; goto LAB_00629a06; } } else if (iVar7 == 0xea) { auStack_f8._8_4_ = ((Vector *)((int)EVar17 + 0x33c))->x - *(float *)((int)this->_player + 0x33c); fStack_ec = *(float *)((int)EVar17 + 0x340) - *(float *)((int)this->_player + 0x340); pVVar12 = Vector::Normalized((Vector *)(auStack_f8 + 8),&VStack_e0); VStack_e0.y = pVVar12->y * 10.0; VStack_e0.x = pVVar12->x * 10.0; Entity::AddVelocity_divided((Entity *)EVar17,&VStack_e0,0); auStack_f8._8_4_ = -VStack_e0.x; fStack_ec = -VStack_e0.y; Entity::AddVelocity_divided((Entity *)this,(Vector *)(auStack_f8 + 8),0); iVar7 = this->_state + 3; this->_state = iVar7; if (5 < iVar7) { pEVar28 = (EntityRef *)(auStack_50 + 4); goto LAB_00629a06; } } } uVar9 = this->_variant; if (uVar9 == 0x2a) { if ((((g_game->_challenge != 0) && (challengeParams = Manager::GetChallengeParams((Manager *)&DAT_0000002a,g_game->_challenge), challengeParams->_canShoot == 0)) && (pEVar26 = this->_player, pEVar26 != (Entity_Player *)0x0)) && (pEVar26->_variant == 0)) { auStack_f8._8_4_ = (pEVar26->_pos).x; fStack_ec = (pEVar26->_pos).y; Entity_Player::AddBlueFlies(pEVar26,1,(Vector *)(auStack_f8 + 8),(Entity *)EVar17); uVar9 = this->_variant; goto LAB_00629a76; } } else { LAB_00629a76: if ((uVar9 == 0x3f) && (uVar9 = Random(), uVar9 % 10 == 0)) { EntityRef::constructor(&statusRef,(Entity *)this); Entity::AddFear((Entity *)EVar17,&statusRef,-0x96,0); } } iVar7 = this->_variant; if (iVar7 == 0x75) { EntityRef::constructor(&statusRef,(Entity *)this); Entity::AddBleeding((Entity *)EVar17,&statusRef,0x96,unused); pcVar21 = *(code **)(*(int *)EVar17 + 0x20); EntityRef::constructor(&statusRef,(Entity *)this); iVar7 = Entity_Player::GetTearHitParams(); in_stack_fffffda0 = (undefined *)0x0; in_stack_fffffd9c = damageMultiplier * *(float *)(iVar7 + 0x48) * 0.2; in_stack_fffffd98 = 0x629b3b; (*pcVar21)(); iVar7 = this->_variant; } if (iVar7 != 0x82) goto LAB_00628f77; this->_fireCooldown = -2; } if (iVar7 == 0x49) { uVar9 = Random(); Game::Spawn(g_game,1000,0x26,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar9); (**(code **)(*(int *)this + 0x28))(); isIgnoreCollision = 1; SoundEffects::PlayWithFartOverride(0x3f7,1.0,0xf,0,1.0); iVar7 = this->_variant; } EVar17 = collider; if (iVar7 == 0x5d) { if (((this->_subtype != 0) || (bVar5 = Entity::IsActiveEnemy((Entity *)collider,0), bVar5 == 0)) || (*colliderType == 1) ) goto LAB_0062a0cb; uVar9 = Random(); Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar9); this->_visible = 0; play_sound_with_fart_seed(0x253,1.0,2,0,1.0); game = g_game; this->_subtype = 1; Game::RerollEnemy(game,(Entity_NPC *)EVar17,0); iVar7 = this->_variant; } if (iVar7 == 0x3a) { iVar7 = this->_subtype; joined_r0x00629d6f: if ((iVar7 == 0) && (iVar7 = Room::GetFrameCount(g_game->_room), 0x14 < iVar7)) { pEStack_c8 = (Entity_Player *)((damageMultiplier - 1.0) * 25.0 + 100.0); uVar9 = (uint)g_tearFlagsNone._l; pvVar23 = g_tearFlagsNone._l._4_4_; fVar22 = (float)g_tearFlagsNone._h; fVar13 = g_tearFlagsNone._h._4_4_; pEVar26 = pEStack_c8; if (this->_player != (Entity_Player *)0x0) { flagsResult = Entity_Player::GetBombFlags(this->_player,(BitSet128 *)auStack_f8,0); auStack_f8._0_4_ = SUB84(flagsResult->_l,0); auStack_f8._4_4_ = *(uint *)((int)&flagsResult->_l + 4); auStack_f8._8_4_ = *(undefined4 *)&flagsResult->_h; fStack_ec = *(float *)((int)&flagsResult->_h + 4); fVar24 = Entity_Player::check_bomb_tearflags(this->_player,(BitSet128)ZEXT816(0)); uVar9 = auStack_f8._0_4_; pvVar23 = (void *)auStack_f8._4_4_; fVar22 = (float)auStack_f8._8_4_; fVar13 = fStack_ec; pEVar26 = pEStack_c8; if (1.5 <= fVar24) { pEVar26 = (Entity_Player *)((float)pEStack_c8 + 50.0); } } tearFlags._l._4_4_ = pvVar23; tearFlags._l._0_4_ = uVar9; tearFlags._h._0_4_ = fVar22; tearFlags._h._4_4_ = fVar13; Game::BombExplosionEffects (g_game,&this->_pos,(float)pEVar26,tearFlags,&(this->_sprite)._color, (Entity *)this,1.0,1,0x40000004,0); this->_subtype = 1; if (this->_variant == 0x3a) { this->_counter = 300; goto LAB_0062a0ba; } isIgnoreCollision = CONCAT31((int3)((uint)extraout_EDX_01 >> 8),1); if (this->_variant == 0x3b) { EntityRef::constructor(&tmpRef,(Entity *)this); Entity::AddPoison((Entity *)EVar17,&tmpRef,(int)(damageMultiplier * 80.0),0.0,0); this->_state = 0; } } } else { if (iVar7 == 0x3b) { iVar7 = this->_subtype; goto joined_r0x00629d6f; } if ((iVar7 != 0x19) || (this->_subtype != 0)) goto LAB_0062a0cb; this->_shadowSize = 0.0; SoundEffects::PlayWithFartOverride(0x35,1.0,2,0,1.0); SoundEffects::PlayWithFartOverride(0x33,1.0,2,0,1.0); uVar9 = Random(); pVVar12 = &this->_pos; spawned = Game::Spawn(g_game,1000,0xd,pVVar12,&g_vectorZero,(Entity *)this,0,uVar9); (**(code **)(*(int *)spawned + 0xc))(); uVar9 = Random(); spawned = Game::Spawn(g_game,1000,0x25,pVVar12,&g_vectorZero,(Entity *)this,0,uVar9); (**(code **)(*(int *)spawned + 0xc))(); uVar9 = Random(); auStack_f8._8_4_ = (this->_velocity).x * 0.2; fStack_ec = (this->_velocity).y * 0.2; spawned = Game::Spawn(g_game,1000,0xc,pVVar12,(Vector *)(auStack_f8 + 8),(Entity *)this,0, uVar9); (**(code **)(*(int *)spawned + 0xc))(); bVar5 = Entity_Player::HasCollectible(this->_player,0xf7,0); if (bVar5 != 0) { uVar9 = Random(); spawned = Game::Spawn(g_game,1000,10,pVVar12,&g_vectorZero,this->_player,0,uVar9); Color::Color(); (*extraout_EDX_02)(); (**(code **)(*(int *)spawned + 0x40))(); iVar7 = *(int *)spawned; pAVar2 = &spawned[1]._sprite; (pAVar2->_filename)._buf[8] = '\"'; (pAVar2->_filename)._buf[9] = '\x01'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &spawned[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\"'; (pAVar2->_filename)._buf[0xd] = '\x01'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (**(code **)(iVar7 + 0xc))(); } this->_subtype = 1; this->_state = 0; ANM2::Play(&this->_sprite,(byte *)"Break",0); EVar17 = collider; LAB_0062a0ba: isIgnoreCollision = 1; } } LAB_0062a0cb: if (*colliderType == 9) { if ((*(uint *)((int)EVar17 + 0x438) & 0x80000000) == 0) goto LAB_0062a0db; LAB_0062a14f: uVar18 = 1; goto LAB_0062a564; } if (*colliderType == 2) { LAB_0062a0db: bVar5 = CanBlockProjectiles(this); if (bVar5 == 0) { if (this->_variant != 0x7e) goto LAB_0062a14f; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); iVar7 = this->_orbitLayer; if (iVar7 < 1) { iVar7 = 0; } clampedOrbitLayer = 10; if (iVar7 < 10) { clampedOrbitLayer = iVar7; } fVar22 = (((float)(&DAT_00c34140)[clampedOrbitLayer * 5] * 180.0) / 3.1415927 + layer->_rotation) * 0.017453292; VStack_e0.y = fVar22; fVar22 = cos(fVar22); VStack_d8.y = fVar22; fVar22 = sin(VStack_e0.y); VStack_140.x = ((Vector *)((int)EVar17 + 0x360))->x; fVar13 = VStack_d8.y * VStack_140.x + fVar22 * *(float *)((int)EVar17 + 0x364); if (fVar13 < 0.0) { fVar24 = *(float *)((int)this->_player + 0x360); VStack_140.x = VStack_140.x - (VStack_d8.y + VStack_d8.y) * fVar13; fVar13 = (fVar22 + fVar22) * fVar13; fVar25 = *(float *)((int)this->_player + 0x364); VStack_140.y = *(float *)((int)EVar17 + 0x364) - fVar13; fVar22 = fVar22 * fVar25 + VStack_d8.y * fVar24; if (0.0 < fVar22) { VStack_140.x = fVar24 * fVar22 + VStack_140.x; VStack_140.y = fVar25 * fVar22 + VStack_140.y; VStack_e0.y = VStack_140.y; VStack_d8.y = VStack_140.x; pEStack_bc = (Entity_Player *)sqrtf(fVar24 * fVar24 + fVar25 * fVar25); fVar22 = ((Vector *)((int)EVar17 + 0x360))->x; pEVar26 = (Entity_Player *) sqrtf(fVar22 * fVar22 + *(float *)((int)EVar17 + 0x364) * *(float *)((int)EVar17 + 0x364)); if ((float)pEStack_bc <= (float)pEVar26) { pEStack_bc = pEVar26; } fVar13 = sqrtf(VStack_e0.y * VStack_e0.y + VStack_d8.y * VStack_d8.y); if ((float)pEStack_bc < fVar13) { Vector::Resize(&VStack_140,(float)pEStack_bc); } } VStack_e0.y = (float)__RTDynamicCast(); projectile = (Entity_Projectile *)__RTDynamicCast(); if ((Entity_Projectile *)VStack_e0.y == (Entity_Projectile *)0x0) { if (projectile == (Entity_Projectile *)0x0) goto LAB_0062a55e; Entity_Projectile::Deflect(projectile,(Entity *)this,&VStack_140); } else { Entity_Projectile::Reflect ((Entity_Projectile *)VStack_e0.y,(Entity *)VStack_e0.y,&VStack_140); } Entity_Player::IsLocalPlayer(this->_player); SoundEffects::PlayWithFartOverride(0x38b,fVar13,2,0,1.0); } } else { if (this->_variant == 0x33) { if (this->_fireCooldown < 1) { iVar7 = 0x19; if (*(int *)&g_game->_deathmatchManager < 2) { iVar7 = 4; } iVar7 = Isaac::Random(iVar7); if (iVar7 == 0) { ANM2::Play(&this->_sprite,&DAT_00b1d3b0,0); this->_fireCooldown = 0x96; } } } else if (((this->_variant == 0x5f) && (uVar9 = Random(), uVar9 % 5 == 0)) && (this->_fireCooldown < 1)) { ANM2::Play(&this->_sprite,&DAT_00b1d3b0,0); this->_fireCooldown = 0xd2; SoundEffects::PlayWithFartOverride(0x25,1.0,2,0,1.0); } game = g_game; if (this->_variant == 0x53) { iVar7 = this->_coins + 1; this->_coins = iVar7; if ((*(int *)&game->_deathmatchManager < 2) && (iVar7 == 10)) { pvVar23 = this->_player; VStack_e0 = this->_pos; if (pvVar23 != (void *)0x0) { auStack_f8._8_4_ = *(float *)((int)pvVar23 + 0x33c); fStack_ec = *(float *)((int)pvVar23 + 0x340); pVVar12 = Room::FindFreePickupSpawnPosition (game->_room,&VStack_150,(Vector *)(auStack_f8 + 8),40.0,0,0,0); VStack_e0 = *pVVar12; } uVar9 = Random(); Game::Spawn(g_game,5,10,&VStack_e0,&g_vectorZero,(Entity *)this,4,uVar9); } } iVar7 = this->_variant; if (iVar7 == 0x79) { iVar7 = this->_state + 10; this->_state = iVar7; if (0x1d < iVar7) { leprosyCount = (short *)((int)this->_player + 0x1384); *leprosyCount = *leprosyCount + -1; goto LAB_0062a2d5; } } else if (((iVar7 == 0x80) || (iVar7 == 0xe5)) || ((iVar7 == 0xea && (iVar7 = this->_state + 3, this->_state = iVar7, 5 < iVar7)))) { LAB_0062a2d5: EntityRef::EntityRef((EntityRef *)(auStack_50 + 4)); (*extraout_EDX_03)(); } iVar7 = this->_variant; if ((iVar7 == 0xe4) || (iVar7 == 0xee)) { pcVar21 = *(code **)(*(int *)this + 0x20); EntityRef::constructor(&tmpRef,(Entity *)collider); LAB_0062a365: (*pcVar21)(); } else if (((iVar7 == 0xc9) || (iVar7 == 0xd8)) || (iVar7 == 0xd9)) { pcVar21 = *(code **)(*(int *)this + 0x20); EntityRef::constructor(&tmpRef,(Entity *)collider); goto LAB_0062a365; } if (this->_variant == 0xe7) { flagsResult = (BitSet128 *)&DAT_00c34c60; iVar7 = get_item_config_entry(this); flagsResult = BitSet128::operator_and ((BitSet128 *)auStack_f8,(BitSet128 *)(iVar7 + 8),flagsResult); bVar5 = BitSet128::IsZero(flagsResult); if (bVar5 != 0) { pEStack_bc = (Entity_Player *)__RTDynamicCast(); if (pEStack_bc != (Entity_Player *)0x0) { pqVar3 = &pEStack_bc->_pendingDamageFlags; pEStack_c8 = *(Entity_Player **)((int)collider + 0x20); piVar11 = (int *)FUN_005cba80(); if (*piVar11 == *(int *)((int)pqVar3 + 4)) { fVar22 = (float)get_item_config_entry(this); VStack_d8.y = fVar22; locustEffect = *(float **)((int)fVar22 + 0x68); if (locustEffect == *(float **)((int)fVar22 + 0x6c)) { pEVar26 = pEStack_c8; } else { do { VStack_e0.y = (float)((uint)locustEffect[5] & DAT_00c34c6c); if (((((uint)locustEffect[2] & DAT_00c34c60) != 0 || ((uint)locustEffect[3] & DAT_00c34c64) != 0) || (((uint)locustEffect[4] & DAT_00c34c68) != 0 || (float)((uint)locustEffect[5] & DAT_00c34c6c) != 0.0)) && ((0.0 < *locustEffect && (uVar9 = Random(), (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 < *locustEffect)))) goto LAB_0062a5ae; locustEffect = locustEffect + 0x1a; } while (locustEffect != *(float **)((int)VStack_d8.y + 0x6c)); pEVar26 = *(Entity_Player **)((int)collider + 0x20); } pEStack_c8 = pEVar26; _Find_lower_bound<>(); if ((*(char *)((int)VStack_150.y + 0xd) != '\0') || (pEVar26 < *(Entity_Player **)((int)VStack_150.y + 0x10))) { puVar16 = (undefined4 *)((int)&pEStack_bc->_pendingDamageFlags + 4); if (pEStack_bc->_index == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } uVar14 = *puVar16; uStack_14 = 0; fStack_ec = 0.0; auStack_f8._8_4_ = puVar16; puVar16 = operator_new(0x18); puVar16[4] = pEStack_c8; *(undefined1 *)(puVar16 + 5) = 0; *puVar16 = uVar14; puVar16[1] = uVar14; puVar16[2] = uVar14; *(undefined2 *)(puVar16 + 3) = 0; VStack_150.y = (float)std::_Tree::_Insert_node ((void *)((int)&pEStack_bc->_pendingDamageFlags + 4) ,(void *)auStack_158._4_4_,(int)VStack_150.x, puVar16); } *(undefined1 *)((int)VStack_150.y + 0x14) = 1; } } goto LAB_0062a55e; } } LAB_0062a5ae: *(byte *)((int)collider + 0x173) = 1; } } LAB_0062a55e: uVar18 = (undefined1)isIgnoreCollision; LAB_0062a564: iVar7 = this->_variant; if ((((((iVar7 == 0x3e) || (iVar7 == 0x43)) || (iVar7 == 0xe4)) || (iVar7 == 0xee)) || ((iVar7 == 0xd4 && (this->_state == 1)))) && ((*colliderType != 1 && (*colliderType != 4)))) { uVar18 = 0; } ExceptionList = pvStack_1c; return uVar18; } //@@ 0062a8f0 Entity_Familiar::CanPlayerFire /* DB: ? player not dead/frozen and room flag clear; Blood Clot, Familiar::Update */ uint __thiscall Entity_Familiar::CanPlayerFire(Entity_Familiar *this) { void *pvVar1; Game *in_EAX; pvVar1 = this->_player; if ((((*(char *)((int)pvVar1 + 0x1398) == '\0') && (*(char *)((int)pvVar1 + 0x139a) == '\0')) && (in_EAX = g_game, *(int *)&g_game->_stageTransition == 0)) && ((*(char *)((int)pvVar1 + 0x410) != '\0' && (*(int *)((int)pvVar1 + 0x414) < 1)))) { return CONCAT31((int3)((uint)g_game >> 8),1); } return (uint)in_EAX & 0xffffff00; } //@@ 0062a930 Entity_Familiar::AddCoins /* ZHL [lua] Lua binding EntityFamiliar:AddCoins */ Entity * __thiscall Entity_Familiar::AddCoins(Entity_Familiar *this,int param_2) { code *pcVar1; byte bVar2; Entity *pEVar3; int iVar4; uint uVar5; uint uVar6; pEVar3 = (Entity *)this->_variant; iVar4 = this->_coins + param_2; this->_coins = iVar4; if (pEVar3 == (Entity *)0xe8) { if (0 < iVar4 % 100) { do { iVar4 = iVar4 + 99; } while (0 < iVar4 % 100); this->_coins = iVar4; } pEVar3 = Entity_Player::AddBlueFlies(this->_player,1,&this->_pos,(Entity *)0x0); return pEVar3; } if ((((pEVar3 != (Entity *)0xf1) && (pEVar3 == (Entity *)0x58)) && (this->_state == 3)) && (0 < param_2)) { do { bVar2 = Entity_Player::HasCollectible(this->_player,0xf7,0); uVar5 = (this->_dropRNG)._seed; if (bVar2 == 0) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); pEVar3 = (Entity *)(*pcVar1)(); return pEVar3; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; pEVar3 = (Entity *)(uVar5 / 5); uVar6 = uVar5 % 5; } else { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); pEVar3 = (Entity *)(*pcVar1)(); return pEVar3; } } pEVar3 = (Entity *)(uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5); uVar5 = (int)pEVar3 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ (uint)pEVar3; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; uVar6 = uVar5 & 3; } (this->_dropRNG)._seed = uVar5; if (uVar6 == 0) { this->_counter = this->_counter + 1; } param_2 = param_2 + -1; } while (param_2 != 0); } return pEVar3; } //@@ 0062aaa0 Entity_Familiar::AddHearts /* ZHL [lua] Lua binding EntityFamiliar:AddHearts */ void __thiscall Entity_Familiar::AddHearts(Entity_Familiar *this,int param_2) { this->_hearts = this->_hearts + param_2; return; } //@@ 0062aab0 Entity_Familiar::TriggerRoomClear /* DB: REPENTOGON Entity_Familiar::TriggerRoomClear: called per familiar from Entity_Player::TriggerRoomClear (familiar+0x410 player == this); spawns blue spiders, cards via ItemPool::GetCardEx, wisps via GetRandomWisp+0043d7f0, FindFreePickupSpawnPosition prototype: REPENTOGON */ void __thiscall Entity_Familiar::TriggerRoomClear(Entity_Familiar *this) { byte bVar1; Entity *shot; Entity_Player *playerEntity; Entity *shot_00; int iVar3; uint uVar4; uint pickupSubType; uint pickupVariant; float dropChance; RNG spawnRng; Vector spiderPos; float local_10; Vector local_c; Manager *manager; Entity *playerEntity; float *spiderCounter; if (this->_exists == 0) { return; } playerEntity = this->_player; if (playerEntity == (Entity_Player *)0x0) { return; } if (playerEntity->_exists == 0) { return; } this->_roomClearCount = this->_roomClearCount + 1; pickupSubType = 0; pickupVariant = 0; local_c.y = 0.0; bVar1 = Entity_Player::HasCollectible(playerEntity,0xf7,0); switch(this->_variant) { case 0x14: if (bVar1 == 0) { local_c.y = 0.35; pickupVariant = 0x28; } else { local_c.y = 0.42; pickupVariant = 0x28; } break; case 0x15: if (bVar1 == 0) { local_c.y = 0.5; pickupVariant = 0x14; } else { local_c.y = 0.57; pickupVariant = 0x14; } break; case 0x16: if (bVar1 == 0) { local_c.y = 0.35; pickupVariant = 10; pickupSubType = 2; } else { local_c.y = 0.42; pickupVariant = 10; pickupSubType = 2; } break; case 0x17: if (bVar1 == 0) { local_c.y = 0.125; pickupVariant = 10; pickupSubType = 3; } else { local_c.y = 0.166; pickupVariant = 10; pickupSubType = 3; } break; case 0x34: iVar3 = 2; bVar1 = Entity_Player::HasCollectible(this->_player,0xf7,0); if (bVar1 != 0) { iVar3 = 3; } do { Room::FindFreePickupSpawnPosition(g_game->_room,&spiderPos,&this->_pos,0.0,0,0,0); playerEntity = this->_player; spiderCounter = &playerEntity[4]._pos.y; *spiderCounter = (float)((int)*spiderCounter + 1); spawn_blue_spider(&spiderPos,playerEntity,&g_vectorZero); Entity::convert_shot_for_enemy_owner((Entity *)this,shot); iVar3 = iVar3 + -1; } while (iVar3 != 0); pickupVariant = 0; pickupSubType = 0; break; case 0x39: if (bVar1 == 0) { local_c.y = 0.18; } else { local_c.y = 0.22; } uVar4 = RNG::RandomInt(&this->_dropRNG,4); switch(uVar4) { case 0: pickupVariant = 10; pickupSubType = RNG::RandomInt(&this->_dropRNG,6); pickupSubType = pickupSubType + 1; break; case 1: pickupVariant = 0x14; pickupSubType = RNG::RandomInt(&this->_dropRNG,4); pickupSubType = pickupSubType + 1; break; case 2: pickupVariant = 0x1e; pickupSubType = RNG::RandomInt(&this->_dropRNG,3); pickupSubType = pickupSubType + 1; break; case 3: pickupVariant = 0x28; pickupSubType = RNG::RandomInt(&this->_dropRNG,2); pickupSubType = pickupSubType + 1; } break; case 0x52: local_10 = 0.8; local_c.y = 0.0; if (bVar1 == 0) { local_10 = 1.0; } dropChance = RNG::RandomFloat(&this->_dropRNG); local_10 = dropChance * local_10; dropChance = local_10; if (*(int *)((int)this->_player + 0x13c0) == 0x24) { dropChance = local_10 * 0.75; } if (0.1 <= dropChance) { if (0.35 <= dropChance) break; uVar4 = RNG::RandomInt(&this->_dropRNG,7); switch(uVar4) { case 0: pickupVariant = 10; dropChance = 1.0; break; case 1: pickupVariant = 0x14; dropChance = 1.0; break; case 2: pickupVariant = 0x1e; dropChance = 1.0; break; case 3: pickupVariant = 0x28; dropChance = 1.0; break; case 4: pickupVariant = 0x5a; dropChance = 1.0; break; case 5: pickupVariant = 300; dropChance = 1.0; break; case 6: pickupVariant = 0x46; default: dropChance = 1.0; } } else { pickupVariant = 0x15e; dropChance = 1.0; } goto LAB_0062acdf; case 0x58: if (this->_state != 1) break; local_10 = 1.12104e-43; uVar4 = 100; if (bVar1 != 0) { uVar4 = 0x50; } uVar4 = RNG::RandomInt(&this->_dropRNG,uVar4); if (*(int *)((int)this->_player + 0x13c0) == 0x24) { uVar4 = (int)(uVar4 << 2) / 3; } dropChance = local_c.y; if ((int)uVar4 < 0x21) { this->_counter = this->_counter + 1; } goto LAB_0062acdf; case 0x5b: if (bVar1 == 0) { local_c.y = 0.125; pickupVariant = 300; } else { local_c.y = 0.166; pickupVariant = 300; } break; case 0x5e: local_10 = 1.12104e-43; uVar4 = 100; if (bVar1 != 0) { uVar4 = 0x50; } local_c.y = 0.0; uVar4 = RNG::RandomInt(&this->_dropRNG,uVar4); if (*(int *)((int)this->_player + 0x13c0) == 0x24) { uVar4 = (int)(uVar4 << 2) / 3; } if ((int)uVar4 < 10) { uVar4 = RNG::RandomInt(&this->_dropRNG,3); if (uVar4 == 0) { uVar4 = Random(); Game::Spawn(g_game,5,0x5a,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); } else { playerEntity = this->_player; spiderCounter = &playerEntity[4]._pos.y; *spiderCounter = (float)((int)*spiderCounter + 1); spawn_blue_spider(&this->_pos,playerEntity,&g_vectorZero); Entity::convert_shot_for_enemy_owner((Entity *)this,shot_00); } } break; case 0x70: if (bVar1 == 0) { pickupVariant = 0x46; dropChance = 0.125; } else { pickupVariant = 0x46; dropChance = 0.166; } goto LAB_0062acdf; case 0x72: if (bVar1 == 0) { local_c.y = 0.125; pickupVariant = 0x45; } else { local_c.y = 0.166; pickupVariant = 0x45; } } dropChance = local_c.y; LAB_0062acdf: playerEntity = this->_player; if (playerEntity->_playerType == 0x24) { dropChance = dropChance * 0.75; } uVar4 = this->_roomClearCount & 0x800003ff; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffc00) + 1; } if ((pickupVariant != 0) && (0.0 < dropChance)) { if (dropChance < 1.0) { if ((int)((float)(int)(uVar4 + 1) * dropChance) <= (int)((float)(int)uVar4 * dropChance)) goto LAB_0062ae77; playerEntity = this->_player; } if (((pickupVariant != 10) || (bVar1 = Entity_Player::HasTrinket(playerEntity,0x16,0), bVar1 == 0)) || (uVar4 = Random(), uVar4 % 5 == 0)) { if (this->_variant == 0x5b) { pickupSubType = RNG::Next(&this->_dropRNG); pickupSubType = ItemPool::GetCardEx(pickupSubType,0,-1,0,1); } Room::FindFreePickupSpawnPosition(g_game->_room,&local_c,&this->_pos,0.0,0,0,0); spawnRng._seed = RNG::Next(&this->_dropRNG); spawnRng._shift1 = 5; spawnRng._shift2 = 0x11; spawnRng._shift3 = 0xd; uVar4 = RNG::Next(&spawnRng); Game::Spawn(g_game,5,pickupVariant,&local_c,&g_vectorZero,(Entity *)this,pickupSubType,uVar4); bVar1 = ANM2::SetAnimation(&this->_sprite,s_Spawn,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } manager = g_manager; if (this->_variant == 0x16) { local_10 = 3.06884e-43; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,(int)local_10,1.0,2,0,1.0,0.0); } } } LAB_0062ae77: manager = g_manager; iVar3 = this->_variant; if (iVar3 == 0x5d) { if (this->_subtype != 0) { this->_state = 1; return; } } else if (iVar3 == 0xdd) { if (this->_hearts < 6) { local_10 = 6.60012e-43; this->_hearts = this->_hearts + 1; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,(int)local_10,1.0,2,0,1.0,0.0); paschal_candle_sync_effects(this); return; } } else if (((iVar3 != 0xee) && (iVar3 == 0xce)) && ((this->_dead == 0 && (1 < g_game->_frameCount - this->_spawnFrame)))) { if (this->_wispCollectibleType == 0x1ea) { iVar3 = GetRandomWisp(&this->_dropRNG); FUN_0043d7f0(iVar3); this->_health = this->_maxHitPoints; } else if (this->_wispCollectibleType == 0x203) { this->_health = this->_maxHitPoints; return; } } return; } //@@ 0062b360 Entity_Familiar::level_start /* DB: ? ECX familiar (Entity_Player::level_start calls it for every type-3 entity whose +0x410 player == this, also PlayerManager::trigger_level_start): variant 100 resets to Idle and TemporaryEffects::RemoveEffect of collectible 0x1b4 item, variant 0x2a halves +0x30, 0x77/0x18 cases */ void __thiscall Entity_Familiar::level_start(Entity_Familiar *this) { void *pvVar1; float fVar2; byte bVar3; byte *pbVar4; uint uVar5; int iVar6; Vector *followPos; byte *pbVar7; int extraout_ECX; bool bVar8; Vector local_18; undefined4 local_10; undefined4 local_c; byte *animData; EntityPtr roomEntity; if (this->_variant != 100) goto LAB_0062b462; this->_subtype = 0; this->_visible = 1; this->_shadowSize = *(float *)((int)this->_config + 0x24); animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0062b3e6: bVar3 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { pbVar4 = animData; if (0xf < *(uint *)(animData + 0x14)) { pbVar4 = *(byte **)animData; } pbVar7 = s_Idle; do { bVar3 = *pbVar4; bVar8 = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_0062b3d0: uVar5 = -(uint)bVar8 | 1; goto LAB_0062b3d5; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar8 = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_0062b3d0; pbVar4 = pbVar4 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0062b3d5: if ((uVar5 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0062b3e6; } pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0x6d0 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU)) && (fVar2 = *(float *)((int)pvVar1 + 0x6d0), fVar2 != 0.0)) { local_10 = *(undefined4 *)((int)fVar2 + 0x78); local_18.y = 0.0; local_c = 0; local_18.x = fVar2; TemporaryEffects::RemoveEffect((TemporaryEffects *)((int)this->_player + 0x1508),&local_18,1); } LAB_0062b462: iVar6 = this->_variant; if (iVar6 == 0x2a) { this->_subtype = (uint)this->_subtype >> 1; } else if ((iVar6 == 0x77) || (iVar6 == 0x18)) { this->_subtype = 0; } else if (iVar6 == 0xcb) { if (g_game->_isStartingFromState == 0) { this->_hearts = 0; iVar6 = Entity_Player::GetHealthType(this->_player); if ((int)(2 - (uint)(iVar6 != 3)) < *(int *)(extraout_ECX + 0x1344)) { this->_state = 4; fVar2 = *(float *)(extraout_ECX + 0x340); (this->_pos).x = *(float *)(extraout_ECX + 0x33c); (this->_pos).y = fVar2; } } FUN_00640050(); } else if (iVar6 == 0xdd) { paschal_candle_sync_effects(this); } else if (iVar6 == 0xd3) { if (g_game->_isStartingFromState == 0) { if (this->_state == 4) { this->_visible = 1; iVar6 = 1; } else { iVar6 = 2; } this->_state = iVar6; fVar2 = *(float *)((int)this->_player + 0x340); (this->_pos).x = *(float *)((int)this->_player + 0x33c) + 0.0; (this->_pos).y = fVar2 + 48.0; return; } } else if (iVar6 == 0xce) { if (this->_subtype == 0x2be) { (**(code **)(*(int *)this + 0x28))(); } else if ((this->_subtype == 0x7f) && (5 < g_game->_frameCount - this->_spawnFrame)) { (**(code **)(*(int *)this + 0x28))(); } } else if (iVar6 == 0xec) { iVar6 = g_game->_currentRoomIdx; if (iVar6 < 0) { iVar6 = g_game->_startingRoomIdx; } this->_coins = -1; (this->_formationTargetOffset).x = (float)(iVar6 % 0xd); (this->_formationOffset).x = (float)(iVar6 % 0xd); (this->_formationTargetOffset).y = (float)(iVar6 / 0xd); (this->_formationOffset).y = (float)(iVar6 / 0xd); } else if (iVar6 == 0xf0) { (**(code **)(*(int *)this + 0x28))(); } followPos = GetFollowTargetPosition(this,&local_18,0); (this->_pos).x = followPos->x; (this->_pos).y = followPos->y; iVar6 = this->_variant; if (iVar6 == 0xf1) { uVar5 = 0; pvVar1 = g_game->_room; if (*(int *)((int)pvVar1 + 0x1254) == 0) { return; } do { iVar6 = *(int *)(*(int *)((int)pvVar1 + 0x124c) + uVar5 * 4); if ((*(int *)(iVar6 + 0x28) == 0x322) && (*(Entity_Familiar **)(iVar6 + 0x3bc) == this)) { *(float *)(iVar6 + 0x33c) = *(float *)(iVar6 + 0x33c) + 0.0; *(float *)(iVar6 + 0x340) = *(float *)(iVar6 + 0x340) + 80.0; roomEntity = *(EntityPtr *)(*(int *)((int)pvVar1 + 0x124c) + uVar5 * 4); if (roomEntity == this->_linkedEntity) { fVar2 = *(float *)((int)roomEntity + 0x340); (this->_pos).x = *(float *)((int)roomEntity + 0x33c); (this->_pos).y = fVar2; } } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar1 + 0x1254)); iVar6 = this->_variant; } if (iVar6 == 0xf2) { this->_state = 0; } return; } //@@ 0062b750 Entity_Familiar::trigger_player_damage /* DB: ? (damageFlags, amount, source) per owned familiar from Entity_Player::take_damage_impl: variant checks, "Crack" anim + Game::SpawnEx (Mystery Egg style), sound, FindFreePickupSpawnPosition, +0xd80/+0xd88 counters, flags & 0x10200020 excluded */ void __thiscall Entity_Familiar::trigger_player_damage (Entity_Familiar *this,uint param_2,undefined4 param_3,EntityPtr *param_4) { byte bVar1; Vector *freePos; Entity *poofEffect; uint uVar2; int iVar3; int gridX; EntityPtr damageSource; EntityPtr *targetRef; float fVar4; float in_XMM1_Da; float effectScaleX; Vector freePosBuf; float damageAmount; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; Manager *manager; EntityPtr parentEntity; Room *room; uStack_8 = 0xffffffff; puStack_c = &LAB_00af6d40; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = this->_variant; damageAmount = in_XMM1_Da; if (iVar3 == 0x32) { this->_subtype = 1; goto LAB_0062b8cc; } if ((iVar3 == 0x7c) && (this->_state == 0)) { ANM2::Play(&this->_sprite,(byte *)"Crack",0); iVar3 = this->_variant; this->_state = 1; } if (iVar3 != 0x81) goto LAB_0062b8cc; if (this->_state != 0) { ExceptionList = local_10; return; } ANM2::Play(&this->_sprite,s_Spawn,0); room = g_game->_room; gridX = (int)(((this->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((this->_pos).y - 120.0) / 40.0 + 0.5); if ((((gridX < 0) || (room->_gridWidth <= gridX)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) { uVar2 = 0xffffffff; LAB_0062b93f: if (room->_roomType == 0x10) goto LAB_0062b892; iVar3 = room->_gridWidth; (this->_targetPosition).x = (float)((int)uVar2 % iVar3) * 40.0 + 40.0; fVar4 = (float)((int)uVar2 / iVar3) * 40.0 + 120.0; } else { uVar2 = room->_gridWidth * iVar3 + gridX; if (((0x1bf < uVar2) || (room->_gridEntities[uVar2] == (void *)0x0)) || ((iVar3 = *(int *)((int)room->_gridEntities[uVar2] + 4), iVar3 == 1 || (iVar3 == 10)))) goto LAB_0062b93f; LAB_0062b892: freePos = Room::FindFreePickupSpawnPosition(room,&freePosBuf,&this->_pos,0.0,1,0,0); (this->_targetPosition).x = freePos->x; fVar4 = freePos->y; } (this->_targetPosition).y = fVar4; iVar3 = this->_variant; this->_state = 1; LAB_0062b8cc: manager = g_manager; if (iVar3 == 200) { if ((this->_state == 0) && (param_4[9] != (EntityPtr)0x0)) { uVar2 = 0; damageSource = param_4[9]; do { if ((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)damageSource + 0x28) == 1)) goto LAB_0062b935; } while ((0x3dd < *(int *)((int)damageSource + 0x28) - 10U) && ((parentEntity = *(EntityPtr *)((int)damageSource + 0x3c8), parentEntity != (EntityPtr)0x0 && (uVar2 = uVar2 + 1, damageSource = parentEntity, uVar2 < 10)))); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)damageSource + 0x28) != 1)) { iVar3 = *(int *)((int)damageSource + 0x28); if (0x3dd < iVar3 - 10U) { ExceptionList = local_10; return; } } else { LAB_0062b935: iVar3 = 1; } if (((((*(int *)((int)damageSource + 0x188) != 1) && (*(int *)((int)damageSource + 0x188) != 0)) && (*(char *)((int)damageSource + 0x3b0) == '\0')) && (*(char *)((int)damageSource + 0x173) == '\0')) && (((bVar1 = Entity::HasEntityFlags((Entity *)damageSource,0x10), bVar1 == 0 || (iVar3 == 0x322)) || (iVar3 == 0x362)))) { targetRef = &this->_target; if (this->_target != (EntityPtr)0x0) { param_4 = targetRef; std::multiset::erase(¶m_4); } *targetRef = damageSource; std::multiset::insert(targetRef); ExceptionList = local_10; return; } } } else if (iVar3 == 0xdd) { if ((1 < this->_hearts) && ((param_2 & 0x10200020) == 0)) { this->_hearts = 1; param_4 = (EntityPtr *)0x105; seed_fart_sound_override((int *)¶m_4); SoundEffects::Play(&manager->_sfxManager,(int)param_4,1.0,2,0,1.0,0.0); uVar2 = Random(); poofEffect = Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2,0); fVar4 = g_vectorOne.y; effectScaleX = g_vectorOne.x * 0.65; (poofEffect->_posOffset).x = 0.0; (poofEffect->_posOffset).y = -10.0; (poofEffect->_sprite)._scale.x = effectScaleX; (poofEffect->_sprite)._scale.y = fVar4 * 0.65; paschal_candle_sync_effects(this); ExceptionList = local_10; return; } } else if (((iVar3 == 0xca) && (0.0 < damageAmount)) && ((param_2 & 0x10200020) == 0)) { this->_subtype = 1; } ExceptionList = local_10; return; } //@@ 0062bb70 Entity_Familiar::room_enter /* DB: ? this=Entity_Familiar: switch on _variant sets +0xd4c cooldown/state, FloatDown anim, Mantle overlay, wisp config, AddToOrbit/GetOrbitPosition, Red Key wisp MakeRedRoomDoor; called from room-enter entity loop 009bba30 PlayerManager::enter_level type 3, NPCs go to 006d6d80 Entity_NPC::room_enter void __thiscall Entity_Familiar::room_enter(Entity_Familiar *this) { code *pcVar1; byte bVar2; char isTargetable; void *pvVar3; Vector *outPosition; Vector *tmpVec; uint uVar4; int iVar5; uint uVar6; bool bVar7; float fVar8; Vector local_60; Vector local_58; Vector local_50; Vector wispOrbitPos; Vector itemWispOrbitPos; Vector enterDirection; Vector randomDirection [3]; undefined8 local_14; EntityPtr child; Game *game; undefined4 playerPosY; int segment; undefined4 *segmentPos; game = g_game; uVar6 = this->_variant; if (900 < uVar6) goto switchD_0062bba7_caseD_4; if (uVar6 == 900) { switchD_0062bba7_caseD_49: (this->_targetPosition).x = g_vectorZero.x; fVar8 = g_vectorZero.y; LAB_0062c604: (this->_targetPosition).y = fVar8; goto switchD_0062bba7_caseD_4; } switch(uVar6) { case 3: case 0x19: case 0x5d: case 0x68: case 0x82: case 0xdf: case 0xe8: this->_fireCooldown = 0xf; break; case 0x11: case 0x2e: case 0x2f: case 0x47: case 0x48: case 0x60: case 0xcf: goto switchD_0062bba7_caseD_11; case 0x32: case 0x3a: this->_subtype = 0; this->_fireCooldown = 0; goto switchD_0062bba7_caseD_11; case 0x33: case 0x5f: case 0xe7: this->_fireCooldown = 0; break; case 0x3b: this->_fireCooldown = 0x3c; break; case 0x42: case 0x43: this->_subtype = 1; (this->_pathfinder)._movementTarget.x = g_vectorZero.x; (this->_pathfinder)._movementTarget.y = g_vectorZero.y; (this->_pathfinder)._moveDirection.x = g_vectorZero.x; (this->_pathfinder)._moveDirection.y = g_vectorZero.y; pvVar3 = game->_room; local_58.x = *(float *)((int)pvVar3 + 0x1c); local_50.x = *(float *)((int)pvVar3 + 0x14); fVar8 = *(float *)((int)pvVar3 + 0x20); local_60.x = *(float *)((int)pvVar3 + 0x18); (this->_targetPosition).x = local_50.x; (this->_targetPosition).y = *(float *)((int)pvVar3 + 0x18); uVar6 = Random(); local_60.x = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * (fVar8 - local_60.x); uVar6 = Random(); (this->_targetPosition).x = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * (local_58.x - local_50.x) + (this->_targetPosition).x; (this->_targetPosition).y = local_60.x + (this->_targetPosition).y; uVar6 = Random(); this->_health = this->_maxHitPoints; this->_counter = uVar6 % 0x3c + 0x46; break; case 0x49: case 0x7a: goto switchD_0062bba7_caseD_49; case 0x53: goto switchD_0062bba7_caseD_53; case 0x55: (this->_targetPosition).x = g_vectorZero.x; fVar8 = g_vectorZero.y; this->_moveDirection = 3; goto LAB_0062c604; case 0x56: if (g_game->_isStartingFromState != 0) break; switchD_0062bba7_caseD_53: this->_coins = 0; break; case 0x5e: case 0x71: this->_subtype = 1; (this->_pathfinder)._movementTarget.x = g_vectorZero.x; (this->_pathfinder)._movementTarget.y = g_vectorZero.y; (this->_pathfinder)._moveDirection.x = g_vectorZero.x; (this->_pathfinder)._moveDirection.y = g_vectorZero.y; tmpVec = Room::GetRandomPosition(game->_room,&local_60,0.0); (this->_targetPosition).x = tmpVec->x; (this->_targetPosition).y = tmpVec->y; uVar6 = Random(); this->_counter = uVar6 % 0x3c + 0x46; break; case 0x62: case 99: case 0x65: case 0x6a: case 0x83: this->_moveDelayNum = -1; goto switchD_0062bba7_caseD_11; case 0x6f: (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; case 0xd4: this->_state = 0; break; case 0x7c: this->_state = 0; if (this->_visible == 0) { this->_roomClearCount = 0; } this->_visible = 1; ANM2::Play(&this->_sprite,s_Idle,0); break; case 0x81: this->_state = 0; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; this->_visible = 1; ANM2::Play(&this->_sprite,(byte *)"FloatDown",0); break; case 0xce: if (this->_subtype == 0x20f) { this->_keys = 0; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; if (this->_variant == 0xed) { iVar5 = this->_wispCollectibleType; } else if (this->_variant == 0xce) { iVar5 = this->_subtype; } else { iVar5 = 0x248; } pvVar3 = ItemConfig::get_wisp_config(iVar5); if (this->_orbitLayer < 0) { AddToOrbit(this,*(short *)((int)pvVar3 + 0x18c) + 7); } } else if (this->_subtype == 0x244) { local_14 = 0x1500000001; iVar5 = *(int *)((int)g_game->_room + 4); if ((iVar5 == 0) || (uVar6 = *(uint *)(iVar5 + 0x5c), uVar6 == 0)) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = uVar6 >> 1 ^ uVar6; uVar6 = uVar6 << 0x15 ^ uVar6; uVar6 = (uVar6 >> 0x14 ^ uVar6) & 7; if ((*(int *)((int)g_game->_room + uVar6 * 4 + 0x724) == 0) && (bVar2 = Level::CanSpawnDoorOutline((Level *)g_game,g_game->_currentRoomIdx,uVar6), bVar2 != 0)) { Level::MakeRedRoomDoor((Level *)g_game,g_game->_currentRoomIdx,uVar6); } } local_50.x = *(float *)((int)this->_player + 0x33c); local_50.y = *(float *)((int)this->_player + 0x340); tmpVec = &local_50; outPosition = &wispOrbitPos; goto LAB_0062c09b; case 0xd3: fVar8 = *(float *)((int)this->_player + 0x340); (this->_pos).x = *(float *)((int)this->_player + 0x33c); (this->_pos).y = fVar8; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; bVar2 = Entity_Player::HasCollectible(this->_player,0xf7,0); if (bVar2 != 0) { this->_coins = 1; ANM2::PlayOverlay(&this->_sprite,(byte *)"Mantle",0); } break; case 0xe0: (**(code **)(*(int *)this + 0x28))(); break; case 0xe1: fVar8 = *(float *)((int)this->_player + 0x340); (this->_pos).x = *(float *)((int)this->_player + 0x33c); (this->_pos).y = fVar8; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; ANM2::Play(&this->_sprite,s_Fly,0); this->_state = 3; break; case 0xec: if (this->_visible == 0) { update_star_of_bethlehem_speed(this,0); } break; case 0xed: local_58.x = *(float *)((int)this->_player + 0x33c); local_58.y = *(float *)((int)this->_player + 0x340); tmpVec = &local_58; outPosition = &itemWispOrbitPos; LAB_0062c09b: tmpVec = GetOrbitPosition(this,outPosition,tmpVec); (this->_pos).x = tmpVec->x; (this->_pos).y = tmpVec->y; break; case 0xee: this->_damageCountdown = 0x14; break; case 0xef: fVar8 = *(float *)((int)this->_player + 0x340); (this->_pos).x = *(float *)((int)this->_player + 0x33c); (this->_pos).y = fVar8; if (game->_enterDoor < 0) { tmpVec = MusicManager::RandomVector(randomDirection); } else { uVar6 = game->_enterDoor + 2U & 0x80000003; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffc) + 1; } tmpVec = Isaac::GetAxisAlignedUnitVectorFromDir(&enterDirection,uVar6); } fVar8 = tmpVec->x; (this->_pos).y = tmpVec->y * 15.0 + (this->_pos).y; (this->_pos).x = fVar8 * 15.0 + (this->_pos).x; switchD_0062bba7_caseD_11: (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; break; case 0xf0: iVar5 = __RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor,0); if (iVar5 != 0) { uVar6 = *(uint *)(iVar5 + 0x14); uVar4 = 0; if (uVar6 != 0) { do { local_50.x = (float)((double)(int)(uVar6 - 1) + __uint_to_double_fixup[-((int)(uVar6 - 1) >> 0x1f)]); if (local_50.x == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } playerPosY = *(undefined4 *)((int)this->_player + 0x340); fVar8 = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) - 0.0 ) / (local_50.x - 0.0); if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } segmentPos = *(undefined4 **) (*(int *)(iVar5 + 8) + (*(int *)(iVar5 + 0x10) + uVar4 & *(int *)(iVar5 + 0xc) - 1U) * 4); *segmentPos = *(undefined4 *)((int)this->_player + 0x33c); segmentPos[1] = playerPosY; segmentPos[2] = -15.0 - fVar8 * 5.0; uVar6 = *(int *)(iVar5 + 0x10) + uVar4; uVar4 = uVar4 + 1; segment = *(int *)(*(int *)(iVar5 + 8) + (uVar6 & *(int *)(iVar5 + 0xc) - 1U) * 4); *(undefined4 *)(segment + 0xc) = (undefined4)DAT_00c79c58; *(undefined4 *)(segment + 0x10) = DAT_00c79c58._4_4_; *(undefined4 *)(segment + 0x14) = DAT_00c79c60; uVar6 = *(uint *)(iVar5 + 0x14); } while (uVar4 < uVar6); } } break; case 0xf1: uVar6 = 0; pvVar3 = g_game->_room; if (*(int *)((int)pvVar3 + 0x1254) != 0) { do { child = *(EntityPtr *)(*(int *)((int)pvVar3 + 0x124c) + uVar6 * 4); if ((*(int *)((int)child + 0x28) == 0x322) && (*(Entity_Familiar **)((int)child + 0x3bc) == this)) { if (child == this->_linkedEntity) { *(float *)((int)child + 0x33c) = (this->_pos).x; fVar8 = (this->_pos).y; } else { uVar4 = Random(); local_50.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_50.x = local_50.x + local_50.x; fVar8 = cos(local_50.x); local_58.x = (this->_pos).y; *(float *)((int)child + 0x33c) = fVar8 + (this->_pos).x; fVar8 = sin(local_50.x); fVar8 = fVar8 + local_58.x; } *(float *)((int)child + 0x340) = fVar8; iVar5 = *(int *)(*(int *)((int)pvVar3 + 0x124c) + uVar6 * 4); *(float *)(iVar5 + 0x360) = g_vectorZero.x; *(float *)(iVar5 + 0x364) = g_vectorZero.y; iVar5 = *(int *)(*(int *)((int)pvVar3 + 0x124c) + uVar6 * 4); if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar5 + 0x28) == 1)) || (*(int *)(iVar5 + 0x28) - 10U < 0x3de)) { *(undefined4 *)(iVar5 + 0xb64) = 0x10; (**(code **)(**(int **)(*(int *)((int)pvVar3 + 0x124c) + uVar6 * 4) + 0xc))(); } } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar3 + 0x1254)); } break; case 0xf2: (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; this->_coins = 0; this->_keys = 0; pvVar3 = game->_room; if (((*(int *)((int)pvVar3 + 8) == 5) && ((*(byte *)(*(int *)((int)pvVar3 + 4) + 0x44) & 1) == 0)) && (uVar6 = 0, *(int *)((int)pvVar3 + 0x1264) != 0)) { do { isTargetable = (**(code **)(**(int **)(*(int *)((int)pvVar3 + 0x125c) + uVar6 * 4) + 0x4c)) (); if (((isTargetable != '\0') && (iVar5 = *(int *)(*(int *)((int)pvVar3 + 0x125c) + uVar6 * 4), (*(uint *)(iVar5 + 0x168) & 0x20000000) == 0 && (*(uint *)(iVar5 + 0x16c) & 0x20) == 0)) && (*(int *)(iVar5 + 0x3bc) == 0)) { iVar5 = *(int *)(iVar5 + 0x28); if (iVar5 < 0x197) { if (iVar5 != 0x196) { switch(iVar5) { case 0x2d: case 0x4e: case 0x54: case 0x66: case 0x111: case 0x112: case 0x113: break; default: switchD_0062c43c_caseD_2e: this->_coins = iVar5; this->_keys = *(int *)(*(int *)(*(int *)((int)pvVar3 + 0x125c) + uVar6 * 4) + 0x2c); goto switchD_0062bba7_caseD_4; } } } else if (iVar5 < 0x391) { if (((iVar5 != 0x390) && (iVar5 != 0x197)) && (iVar5 != 0x19c)) { bVar7 = iVar5 == 0x362; LAB_0062c46e: if (!bVar7) goto switchD_0062c43c_caseD_2e; } } else if (iVar5 != 0x3b6) { bVar7 = iVar5 == 0x3b7; goto LAB_0062c46e; } } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar3 + 0x1264)); } } switchD_0062bba7_caseD_4: if (((this->_isNotCountedAsFollower != 0) && (g_game->_isStartingFromState == 0)) && (this->_isHourglassRewound == 0)) { (**(code **)(*(int *)this + 0x28))(); } this->_isHourglassRewound = 0; return; } //@@ 0062c8a0 FUN_0062c8a0 void FUN_0062c8a0(void) { Entity_Familiar *in_ECX; if (in_ECX->_variant == 0xcb) { FUN_00640050(); } else if (in_ECX->_variant == 0xdd) { Entity_Familiar::paschal_candle_sync_effects(in_ECX); return; } return; } //@@ 0062c8d0 Entity_Familiar::farting_baby_fart /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=familiar, variant 0x70/0x7d branches; variant 0x7d rerolls rng%5 different from last (+0xd88) = random fart type; Spawn anim, effect 1000.15, Entity::AddPoison, Game::start_poop_cloud_screen_effect; from Entity_Player::update_effects loop over the player's familiars */ void __thiscall Entity_Familiar::farting_baby_fart(Entity_Familiar *this) { code *pcVar1; byte bVar2; uint uVar3; byte *curAnimChar; Entity *pEVar4; uint uVar5; byte *cmpAnimChar; void *room; uint uVar6; bool bVar7; uint local_4c; Entity *local_48; Vector local_44; int *enemy; ColorMod local_38; uint local_c; byte *animData; int entityType; Manager *manager; local_c = __security_cookie ^ (uint)&local_4c; if (this->_variant != 0x70) { if (this->_variant == 0x7d) { uVar6 = this->_state; uVar5 = (this->_dropRNG)._seed; do { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; this->_state = uVar5 % 5; } while (uVar5 % 5 == uVar6); FUN_0063b240(); uVar6 = Random(); local_44.x = (this->_velocity).x + (this->_pos).x; local_44.y = (this->_pos).y + (this->_velocity).y; pEVar4 = Game::SpawnEx(g_game,1000,0xf,&local_44,&g_vectorZero,(Entity *)0x0,0,uVar6,0); (**(code **)(*(int *)pEVar4 + 0xc))(); manager = g_manager; local_4c = 0x84; seed_fart_sound_override((int *)&local_4c); SoundEffects::Play(&manager->_sfxManager,local_4c,1.0,2,0,1.0,0.0); } return; } uVar6 = 0; room = g_game->_room; local_44.x = (float)room; if (*(int *)((int)room + 0x1264) != 0) { do { pEVar4 = *(Entity **)(*(int *)((int)room + 0x125c) + uVar6 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (pEVar4->_type != 1)) { entityType = pEVar4->_type; if ((entityType - 10U < 0x3de) && (((entityType != 0x21 && (entityType != 0x11)) && (entityType != 0x124)))) { if (entityType == 0x375) { bVar7 = pEVar4->_variant == 10; } else { if ((entityType == 0x3c0) || (entityType == 0x3c5)) goto LAB_0062cb69; bVar7 = entityType == 0xf5; } if (!bVar7) goto LAB_0062c990; } } else { LAB_0062c990: if ((pEVar4->_dead == 0) && (bVar2 = Entity::IsDescendantOf((Entity *)this,pEVar4), bVar2 == 0)) { local_38._colorize[0] = (this->_pos).x; local_38._colorize[1] = (this->_pos).y; enemy = *(int **)(*(int *)((int)room + 0x125c) + uVar6 * 4); local_38._colorize[2] = (this->_velocity).x; local_48 = *(Entity **)(*enemy + 0x20); local_38._colorize[3] = (this->_velocity).y; local_38._tint[0] = (float)this->_type; local_38._tint[1] = (float)this->_variant; local_38._tint[2] = (float)this->_spawnerType; local_38._tint[3] = (float)this->_spawnerVariant; local_4c = (uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar3 = 0; } else { uVar3 = 4; } local_38._offset[0] = (float)(uVar3 | uVar5 | local_4c); local_38._offset[1] = (float)this; (*(code *)local_48)(0x41200000,0,0,&local_38,0x1e); local_38._colorize[0] = (this->_pos).x; local_38._colorize[1] = (this->_pos).y; local_48 = *(Entity **)(*(int *)((int)room + 0x125c) + uVar6 * 4); local_38._tint[0] = (float)this->_type; local_38._tint[1] = (float)this->_variant; local_38._tint[2] = (float)this->_spawnerType; local_38._tint[3] = (float)this->_spawnerVariant; local_38._colorize[2] = (this->_velocity).x; local_38._colorize[3] = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar3 = 0; } else { uVar3 = 4; } local_38._offset[0] = (float)(uVar3 | uVar5 | (uint)((this->_flags & 0x100) != 0)); local_38._offset[1] = (float)this; Entity::AddPoison(local_48,(EntityRef *)&local_38,0x96,0.0,0); room = (void *)local_44.x; } } LAB_0062cb69: uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)room + 0x1264)); } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cmpAnimChar = s_Spawn; do { bVar2 = *curAnimChar; bVar7 = bVar2 < *cmpAnimChar; if (bVar2 != *cmpAnimChar) { LAB_0062cbb0: uVar6 = -(uint)bVar7 | 1; goto LAB_0062cbb5; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; bVar7 = bVar2 < cmpAnimChar[1]; if (bVar2 != cmpAnimChar[1]) goto LAB_0062cbb0; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar2 != 0); uVar6 = 0; LAB_0062cbb5: if ((uVar6 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0062cbe8; } bVar2 = ANM2::SetAnimation(&this->_sprite,s_Spawn,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0062cbe8: local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 1.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 1.0; Game::start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),&local_38); local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 0.5; local_38._offset[0] = 0.0; local_38._colorize[0] = 0.6; local_38._colorize[1] = 1.0; local_38._colorize[2] = 0.3; local_38._colorize[3] = 1.0; local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; Entity::MakeGroundPoof((Entity *)this,&this->_pos,&local_38,1.0); return; } //@@ 0062cdc0 Entity_Familiar::TakeDamage /* ZHL [vtable slot 8] */ byte __thiscall Entity_Familiar::TakeDamage (Entity_Familiar *this,float param_2,uint param_3,undefined4 param_4,EntityRef *param_5, int param_6) { float fVar1; float fVar2; void *pvVar3; Manager *pMVar4; byte bVar5; char cVar6; Vector *pVVar7; int iVar8; Entity_Effect *this_00; float fVar9; uint uVar10; int iVar11; byte local_19; Vector local_18; Vector local_10; bVar5 = Entity::IsDamageSourceFriendly((Entity *)this,param_5); uVar10 = param_3; if ((bVar5 != 0) || ((param_5->_flags & 2) != 0)) { return 0; } if (((param_3 & 0x280) != 0) && (this->_variant != 0x3e)) { return 0; } iVar8 = this->_variant; if ((iVar8 == 0xce) || (iVar8 == 0xed)) { cVar6 = wisp_take_damage(this,¶m_2,¶m_3,param_5); if (cVar6 == '\0') { return 0; } iVar11 = param_6 / 3; if (10 < iVar11) { iVar11 = 10; } iVar8 = this->_variant; } else { iVar11 = param_6; } if ((*(int *)&g_game->_deathmatchManager < 2) || (iVar8 != 0x43)) { if (iVar8 == 0xee) { if (0 < this->_counter) { return 0; } goto LAB_0062ce83; } if (iVar8 != 0x3e) goto LAB_0062ce83; LAB_0062cec0: local_19 = (**(code **)(*(int *)this->_player + 0x20)) (param_2,uVar10 | 0x800,param_4,param_5,iVar11); } else { iVar11 = 4; LAB_0062ce83: if ((g_game->_challenge == 0x1e) && (iVar8 == 0x43)) goto LAB_0062cec0; if (iVar8 == 0xd3) { uVar10 = uVar10 | 0x41; } else { uVar10 = uVar10 | 0x40; } local_19 = Entity::TakeDamage((Entity *)this,param_2,CONCAT44(param_4,uVar10),param_5,iVar11); } if (local_19 == 0) { return 0; } if (param_2 <= 0.0) { return local_19; } iVar8 = this->_variant; if (iVar8 == 0x43) { local_18.x = (this->_pos).x - (param_5->_position).x; local_18.y = (this->_pos).y - (param_5->_position).y; pVVar7 = Vector::Normalized(&local_18,&local_10); fVar1 = this->_friction; fVar9 = pVVar7->y; if (fVar1 == 0.0) goto LAB_0062d006; fVar2 = this->_speedMultiplier; (this->_velocity).x = (pVVar7->x * 5.0 * fVar2) / fVar1 + (this->_velocity).x; (this->_velocity).y = (fVar9 * 5.0 * fVar2) / fVar1 + (this->_velocity).y; iVar8 = this->_variant; } if (iVar8 == 0xc9) { uVar10 = Random(); pMVar4 = g_manager; if ((uVar10 & 1) == 0) { local_18.x = 8.40779e-44; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_18.x,0.8,0xf,0,1.0,0.0); } } LAB_0062d006: iVar8 = this->_variant; if (((iVar8 == 0xce) || (iVar8 == 0xed)) && (0 < this->_damageCountdown)) { uVar10 = 0; pvVar3 = g_game->_room; if (*(int *)((int)pvVar3 + 0x1254) != 0) { do { iVar8 = *(int *)(*(int *)((int)pvVar3 + 0x124c) + uVar10 * 4); if (((((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 3)) && ((*(int *)(iVar8 + 0x2c) == 0xce || (*(int *)(iVar8 + 0x2c) == 0xed)))) && ((*(char *)(iVar8 + 0x172) != '\0' && (*(char *)(iVar8 + 0x173) == '\0')))) && (*(void **)(iVar8 + 0x410) == this->_player)) { iVar11 = *(int *)(iVar8 + 0x214); if (*(int *)(iVar8 + 0x214) < this->_damageCountdown) { iVar11 = this->_damageCountdown; } *(int *)(iVar8 + 0x214) = iVar11; } uVar10 = uVar10 + 1; } while (uVar10 < *(uint *)((int)pvVar3 + 0x1254)); iVar8 = this->_variant; } } pMVar4 = g_manager; if ((iVar8 == 0xd3) && (this->_state == 1)) { if (this->_coins < 1) { if (this->_coins == 0) { local_18.x = 4.2039e-44; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_18.x,1.0,2,0,1.0,0.0); pMVar4 = g_manager; local_18.x = 7.70714e-44; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_18.x,1.0,2,0,1.5,0.0); this->_state = 4; } } else { local_18.x = 3.8816e-43; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_18.x,1.0,2,0,1.0,0.0); uVar10 = Random(); this_00 = (Entity_Effect *) Game::SpawnEx(g_game,1000,0x10,&this->_pos,&g_vectorZero,(Entity *)this,0xb,uVar10,0 ); Entity_Effect::FollowParent(this_00,(Entity *)this); (this_00->_posOffset).x = (this->_posOffset).x; (this_00->_posOffset).y = (this->_posOffset).y; this_00->_renderDepthOffset = 16.0; (**(code **)(*(int *)this_00 + 0xc))(); this->_coins = 0; this->_damageCountdown = 0x1e; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); } } if (this->_variant == 100) { fVar1 = this[1]._pendingDamage; if (((uint)this->_subtype < (uint)fVar1) && (fVar9 = (float)(this->_subtype + 1), this->_subtype = (int)fVar9, fVar9 == fVar1)) { ANM2::Play(&this->_sprite,&DAT_00b63f64,0); } this->_damageCountdown = 0x1e; this->_health = param_2 + this->_health; } return local_19; } //@@ 0062d290 Entity_Familiar::mongo_baby_pick_next_mimic /* DB: thiscall Entity_Familiar: only variant 74 (Mongo Baby) - advances its subtype (+0x30) through the 12-entry table DAT_00b648b0 {8,113,99,100,95,67,163,167,174,268,435,608} (baby familiar collectibles) until one the player (+0x410) HasCollectible; Entity_Familiar::Shoot, ai_auto_shooter */ void __thiscall Entity_Familiar::mongo_baby_pick_next_mimic(Entity_Familiar *this) { byte bVar1; int iVar2; int iVar3; int iVar4; if (this->_variant == 0x4a) { iVar4 = this->_subtype; iVar3 = 0; this->_subtype = 0; while( true ) { iVar2 = (int)((ulonglong)((longlong)(iVar4 + 1) * -0x2aaaaaab) >> 0x20); iVar4 = iVar4 + 1 + ((iVar2 >> 1) - (iVar2 >> 0x1f)) * 0xc; bVar1 = Entity_Player::HasCollectible(this->_player,*(int *)(&DAT_00b648b0 + iVar4 * 4),0); if (bVar1 != 0) break; iVar3 = iVar3 + 1; if (0xb < iVar3) { return; } } this->_subtype = iVar4; } return; } //@@ 0062d300 Entity_Familiar::ai_incubus_shot /* decompile failed: Low-level Error: Trying to construct memory range beyond end of address space: ram */ //@@ 0062d7e0 Entity_Familiar::RemoveFromFollowers /* ZHL [lua] Lua binding EntityFamiliar:RemoveFromFollowers prototype: db/protos.zhl */ void __thiscall Entity_Familiar::RemoveFromFollowers(Entity_Familiar *this) { EntityPtr EVar1; EntityPtr EVar2; EntityPtr EVar3; EntityPtr local_14; EntityPtr local_10; EntityPtr local_c; EntityPtr leadBaby; EntityPtr *childRef; EntityPtr *parentRef; if (this->_variant == 0xeb) { EVar2 = this->_parent; parentRef = &this->_parent; if (EVar2 != (EntityPtr)0x0) { if (this->_subtype == 0) { EVar2 = this->_child; leadBaby = (EntityPtr)this; if ((EVar2 == (EntityPtr)0x0) || (*(int *)((int)EVar2 + 0x28) != 3)) { EVar2 = (EntityPtr)0x0; } } else { leadBaby = (EntityPtr)0x0; if (*(int *)((int)EVar2 + 0x28) == 3) { leadBaby = EVar2; } EVar2 = (EntityPtr)this; } if ((leadBaby == (EntityPtr)0x0) || (EVar2 == (EntityPtr)0x0)) { KAGE_LogMessage(4,(byte *)"Attempting to remove unpaired twisted baby!\n"); EVar2 = *parentRef; if ((EVar2 != (EntityPtr)0x0) && (*(int *)((int)EVar2 + 0x28) == 3)) { local_10 = this->_child; EVar2 = (EntityPtr)((int)EVar2 + 0x3c0); if (*(int *)EVar2 != 0) { local_14 = EVar2; std::multiset::erase(&local_14); } *(EntityPtr *)EVar2 = local_10; if (local_10 != (EntityPtr)0x0) { std::multiset::insert(EVar2); } } EVar2 = this->_child; if (EVar2 != (EntityPtr)0x0) { EVar1 = (EntityPtr)((int)EVar2 + 0x3bc); local_10 = *parentRef; if (*(int *)((int)EVar2 + 0x3bc) != 0) { local_14 = EVar1; std::multiset::erase(&local_14); } *(EntityPtr *)EVar1 = local_10; if (local_10 != (EntityPtr)0x0) { std::multiset::insert(EVar1); } } if (*parentRef != (EntityPtr)0x0) { local_14 = (EntityPtr)parentRef; std::multiset::erase(&local_14); } *parentRef = (EntityPtr)0x0; } else { EVar1 = (EntityPtr)((int)leadBaby + 0x3bc); EVar3 = *(EntityPtr *)EVar1; if ((EVar3 != (EntityPtr)0x0) && (*(int *)((int)EVar3 + 0x28) == 3)) { local_10 = *(EntityPtr *)((int)EVar2 + 0x3c0); EVar3 = (EntityPtr)((int)EVar3 + 0x3c0); if (*(int *)EVar3 != 0) { local_c = EVar3; std::multiset::erase(&local_c); } *(EntityPtr *)EVar3 = local_10; if (local_10 != (EntityPtr)0x0) { std::multiset::insert(EVar3); } } EVar3 = *(EntityPtr *)((int)EVar2 + 0x3c0); if (EVar3 != (EntityPtr)0x0) { local_c = (EntityPtr)((int)EVar3 + 0x3bc); local_14 = *(EntityPtr *)EVar1; if (*(int *)((int)EVar3 + 0x3bc) != 0) { local_10 = local_c; std::multiset::erase(&local_10); } *(EntityPtr *)local_c = local_14; if (local_14 != (EntityPtr)0x0) { std::multiset::insert(local_c); } } if (*(EntityPtr *)EVar1 != (EntityPtr)0x0) { local_14 = EVar1; std::multiset::erase(&local_14); } *(EntityPtr *)EVar1 = (EntityPtr)0x0; EVar1 = (EntityPtr)((int)leadBaby + 0x3c0); if (*(EntityPtr *)EVar1 != (EntityPtr)0x0) { local_14 = EVar1; std::multiset::erase(&local_14); } EVar3 = (EntityPtr)((int)EVar2 + 0x3bc); *(EntityPtr *)EVar1 = (EntityPtr)0x0; if (*(EntityPtr *)EVar3 != (EntityPtr)0x0) { local_14 = EVar3; std::multiset::erase(&local_14); } *(EntityPtr *)EVar3 = (EntityPtr)0x0; this = (Entity_Familiar *)EVar2; } EVar2 = (EntityPtr)((int)this + 0x3c0); if (*(EntityPtr *)EVar2 != (EntityPtr)0x0) { local_14 = EVar2; std::multiset::erase(&local_14); } *(EntityPtr *)EVar2 = (EntityPtr)0x0; return; } } if (this->_isFollower != 0) { EVar2 = this->_parent; parentRef = &this->_parent; if (EVar2 != (EntityPtr)0x0) { EVar1 = (EntityPtr)((int)EVar2 + 0x3c0); local_10 = this->_child; if (*(int *)((int)EVar2 + 0x3c0) != 0) { local_14 = EVar1; std::multiset::erase(&local_14); } *(EntityPtr *)EVar1 = local_10; if (local_10 != (EntityPtr)0x0) { std::multiset::insert(EVar1); } } EVar2 = this->_child; childRef = &this->_child; if (EVar2 != (EntityPtr)0x0) { local_10 = (EntityPtr)((int)EVar2 + 0x3bc); local_c = *parentRef; if (*(int *)((int)EVar2 + 0x3bc) != 0) { local_14 = local_10; std::multiset::erase(&local_14); } *(EntityPtr *)local_10 = local_c; if (local_c != (EntityPtr)0x0) { std::multiset::insert(local_10); } } if (*parentRef != (EntityPtr)0x0) { local_14 = (EntityPtr)parentRef; std::multiset::erase(&local_14); } *parentRef = (EntityPtr)0x0; if (*childRef != (EntityPtr)0x0) { local_14 = (EntityPtr)childRef; std::multiset::erase(&local_14); } *childRef = (EntityPtr)0x0; } this->_isFollower = 0; return; } //@@ 0062db20 Entity_Familiar::AddToFollowers /* ZHL [lua] Lua binding EntityFamiliar:AddToFollowers prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Familiar::AddToFollowers(Entity_Familiar *this) { EntityPtr *pEVar1; byte bVar2; EntityConfig_Entity *entityConfig; byte *curAnimChar; int otherPriority; uint uVar3; std_string *expectedName; int iVar4; EntityPtr childField; EntityPtr EVar5; std_string *anim; bool isLess; EntityList_EL familiars; EntityPtr local_18; EntityPtr local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; EntityPtr chainEntity; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00af6d75; local_10 = ExceptionList; if (this->_isSubtype55555 != 0) { return; } if (this->_variant != 0xeb) { ExceptionList = &local_10; if ((this->_isFollower != 0) && (chainEntity = this->_parent, chainEntity != (EntityPtr)0x0)) { if (*(int *)((int)chainEntity + 0x28) == 3) { iVar4 = __RTDynamicCast(chainEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0, __security_cookie ^ (int)register0x00000010 - 4U); if (((iVar4 != 0) && (*(char *)(iVar4 + 0xd74) != '\0')) && (this->_player == *(void **)(iVar4 + 0x410))) { KAGE_LogMessage(1,(byte *)"[warn] Tried to add familiar %d to followers again!\n"); ExceptionList = local_10; return; } } else if ((*(int *)((int)chainEntity + 0x28) == 1) && (chainEntity == (EntityPtr)this->_player) ) { KAGE_LogMessage(1,(byte *)"[warn] Tried to add familiar %d to followers again!\n"); ExceptionList = local_10; return; } } this->_isFollower = 1; iVar4 = GetFollowerPriority(this); EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0); local_8 = 2; uVar3 = 0; if (familiars._size != 0) { LAB_0062de40: chainEntity = *(EntityPtr *)((int)familiars._data + uVar3 * 4); if (((chainEntity == (EntityPtr)0x0) || (((Entity_Familiar *)chainEntity)->_type != 3)) || ((chainEntity == (EntityPtr)this || ((((Entity_Familiar *)chainEntity)->_isFollower == 0 || (((Entity_Familiar *)chainEntity)->_player != this->_player)))))) goto LAB_0062de6b; for (EVar5 = ((Entity_Familiar *)chainEntity)->_parent; (EVar5 != (EntityPtr)0x0 && (*(int *)((int)EVar5 + 0x28) == 3)); EVar5 = *(EntityPtr *)((int)EVar5 + 0x3bc)) { chainEntity = EVar5; } otherPriority = GetFollowerPriority((Entity_Familiar *)chainEntity); do { if (otherPriority < iVar4) { pEVar1 = &this->_child; if (this->_child != (EntityPtr)0x0) { local_14 = (EntityPtr)pEVar1; std::multiset::erase(&local_14); } *pEVar1 = chainEntity; if (chainEntity != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } pEVar1 = &this->_parent; local_18 = *(EntityPtr *)((int)chainEntity + 0x3bc); EVar5 = (EntityPtr)((int)chainEntity + 0x3bc); if (this->_parent != (EntityPtr)0x0) { local_14 = (EntityPtr)pEVar1; std::multiset::erase(&local_14); } *pEVar1 = local_18; if (local_18 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); chainEntity = *pEVar1; if ((chainEntity != (EntityPtr)0x0) && (*(int *)((int)chainEntity + 0x28) == 3)) { childField = (EntityPtr)((int)chainEntity + 0x3c0); if (*(int *)((int)chainEntity + 0x3c0) != 0) { local_18 = childField; std::multiset::erase(&local_18); } *(Entity_Familiar **)childField = this; std::multiset::insert(childField); } } if (*(int *)EVar5 != 0) { local_18 = EVar5; std::multiset::erase(&local_18); } *(Entity_Familiar **)EVar5 = this; LAB_0062df8a: std::multiset::insert(EVar5); break; } EVar5 = *(EntityPtr *)((int)chainEntity + 0x3c0); if (EVar5 == (EntityPtr)0x0) { LAB_0062dfde: *(EntityPtr *)((int)chainEntity + 0x3c0) = (EntityPtr)this; std::multiset::insert((EntityPtr *)((int)chainEntity + 0x3c0)); EVar5 = (EntityPtr)&this->_parent; if (this->_parent != (EntityPtr)0x0) { local_14 = EVar5; std::multiset::erase(&local_14); } *(EntityPtr *)EVar5 = chainEntity; goto LAB_0062df8a; } if (*(int *)((int)EVar5 + 0x28) != 3) { local_14 = (EntityPtr)((int)chainEntity + 0x3c0); std::multiset::erase(&local_14); goto LAB_0062dfde; } otherPriority = GetFollowerPriority((Entity_Familiar *)EVar5); chainEntity = EVar5; } while( true ); } LAB_0062df8f: if (familiars._0_1_ != '\0') { ExceptionList = local_10; return; } local_8 = 3; goto LAB_0062dfa3; } pEVar1 = &this->_parent; if (this->_parent != (EntityPtr)0x0) { return; } ExceptionList = &local_10; *pEVar1 = (EntityPtr)this->_player; if ((EntityPtr)this->_player != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,0xeb,-1,0,0); local_8 = 0; uVar3 = 0; if (familiars._size != 0) { LAB_0062dbc5: chainEntity = *(EntityPtr *)((int)familiars._data + uVar3 * 4); if ((((chainEntity == (EntityPtr)0x0) || (*(int *)((int)chainEntity + 0x28) != 3)) || (chainEntity == (EntityPtr)this)) || ((*(byte *)((int)chainEntity + 0x172) == 0 || (*(void **)((int)chainEntity + 0x410) != this->_player)))) goto LAB_0062dbf4; for (EVar5 = *(EntityPtr *)((int)chainEntity + 0x3c0); EVar5 != (EntityPtr)0x0; EVar5 = *(EntityPtr *)((int)EVar5 + 0x3c0)) { chainEntity = EVar5; } if (*(int *)((int)chainEntity + 0x3c0) != 0) { local_14 = (EntityPtr)((int)chainEntity + 0x3c0); std::multiset::erase(&local_14); } *(undefined4 *)((int)chainEntity + 0x3c0) = this; std::multiset::insert((undefined4 *)((int)chainEntity + 0x3c0)); if (*pEVar1 != (EntityPtr)0x0) { local_14 = (EntityPtr)pEVar1; std::multiset::erase(&local_14); } *pEVar1 = chainEntity; std::multiset::insert(pEVar1); iVar4 = 1 - *(int *)((int)chainEntity + 0x30); goto LAB_0062dbfb; } LAB_0062dbf9: iVar4 = 0; LAB_0062dbfb: manager = g_manager; if (iVar4 != this->_subtype) { this->_subtype = iVar4; entityConfig = EntityConfig::GetEntity(&manager->_entityConfig,this->_type,this->_variant,iVar4) ; this->_config = entityConfig; ANM2::Load(&this->_sprite,&entityConfig->anm2Path,1); anim = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { anim = *(std_string **)anim->_buf; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedName = anim; do { bVar2 = *curAnimChar; isLess = bVar2 < (byte)expectedName->_buf[0]; if (bVar2 != expectedName->_buf[0]) { LAB_0062dd02: uVar3 = -(uint)isLess | 1; goto LAB_0062dd07; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < (byte)expectedName->_buf[1]; if (bVar2 != expectedName->_buf[1]) goto LAB_0062dd02; curAnimChar = curAnimChar + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_0062dd07: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0062dd2f; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_0062dd2f: if (familiars._0_1_ != '\0') { ExceptionList = local_10; return; } local_8 = 1; LAB_0062dfa3: tracked_alloc(1,familiars._data,0); ExceptionList = local_10; return; LAB_0062de6b: uVar3 = uVar3 + 1; if ((uint)familiars._size <= uVar3) goto LAB_0062df8f; goto LAB_0062de40; LAB_0062dbf4: uVar3 = uVar3 + 1; if ((uint)familiars._size <= uVar3) goto LAB_0062dbf9; goto LAB_0062dbc5; } //@@ 0062e020 Entity_Familiar::set_player /* DB: thiscall Entity_Familiar: detaches from orbit/follower/delayed lists (RecalculateOrbitOffset, RemoveFromFollowers, RemoveFromDelayed), sets _player = param, re-adds (AddToFollowers/AddToDelayed, variant 235 always follows); PlayerManager::replace_player, Entity_Familiar::RemoveFromPlayer prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Familiar::set_player(Entity_Familiar *this,Entity_Player *player) { byte bVar1; bool bVar2; short sVar3; char cVar4; bVar1 = this->_isFollower; if (((bVar1 == 0) && (-1 < this->_orbitLayer)) && (this->_exists != 0)) { sVar3 = (ushort)this->_isDelayed << 8; bVar2 = true; RecalculateOrbitOffset(this,this->_orbitLayer,0); LAB_0062e072: if (this->_variant != 0xeb) goto LAB_0062e088; } else { sVar3 = CONCAT11(this->_isDelayed,bVar1); bVar2 = false; if (bVar1 == 0) goto LAB_0062e072; bVar2 = false; } RemoveFromFollowers(this); LAB_0062e088: cVar4 = (char)((ushort)sVar3 >> 8); if (cVar4 != '\0') { RemoveFromDelayed(this); } this->_player = player; if (bVar2) { RecalculateOrbitOffset(this,this->_orbitLayer,1); } if (((char)sVar3 != '\0') || (this->_variant == 0xeb)) { AddToFollowers(this); } if (cVar4 != '\0') { AddToDelayed(this); } return; } //@@ 0062e0e0 FUN_0062e0e0 void FUN_0062e0e0(int param_1) { int *piVar1; int *in_ECX; int *local_8; piVar1 = in_ECX + 0x370; local_8 = in_ECX; if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); } *piVar1 = param_1; if (param_1 != 0) { std::multiset::insert(piVar1); } return; } //@@ 0062e120 Entity_Familiar::ai_samsons_chains /* DB: Entity_Familiar::Update case 0x4b (variant 75, CheckFamiliar from COLLECTIBLE_SAMSONS_CHAINS 321); EntityList::QuerySublist + Room::GetGridCollision + distance checks for the dragged ball */ void __thiscall Entity_Familiar::ai_samsons_chains(Entity_Familiar *this) { float fVar1; float fVar2; qword qVar3; float *pfVar4; int iVar5; float *pfVar6; int iVar7; qword *allocCounter; uint uVar8; float fVar9; float fVar10; EntityList_EL chainList; float local_40; float local_3c; float local_38; float local_34; float local_30; float local_2c; float toPlayerY; float toPlayerX; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; Game *game; Entity_Familiar *otherChain; Room *room; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00af3a60; local_1c = ExceptionList; ExceptionList = &local_1c; toPlayerX = *(float *)((int)this->_player + 0x33c) - (this->_pos).x; toPlayerY = *(float *)((int)this->_player + 0x340) - (this->_pos).y; local_3c = toPlayerX * toPlayerX + toPlayerY * toPlayerY; local_40 = sqrtf(local_3c); game = g_game; if (0.01 < local_40) { if (*(int *)((int)g_game->_room + 8) == 0x10) { fVar9 = toPlayerX; if (0.0 < local_40) { fVar9 = (1.0 / local_40) * toPlayerX; } local_30 = (local_40 - 70.0) * 0.1; local_2c = 0.0; local_34 = (local_40 - 100.0) * 1.6; local_38 = 0.0; pfVar6 = &local_30; if (local_30 <= 0.0) { pfVar6 = &local_2c; } pfVar4 = &local_34; if (local_34 <= 0.0) { pfVar4 = &local_38; } (this->_velocity).x = fVar9 * (*pfVar6 + *pfVar4) + (this->_velocity).x; } else { fVar9 = toPlayerY; fVar10 = toPlayerX; if (0.0 < local_40) { fVar9 = (1.0 / local_40) * toPlayerY; fVar10 = (1.0 / local_40) * toPlayerX; } local_38 = (local_40 - 70.0) * 0.1; local_34 = 0.0; local_30 = (local_40 - 100.0) * 1.6; local_2c = 0.0; pfVar6 = &local_38; if (local_38 <= 0.0) { pfVar6 = &local_34; } fVar1 = *pfVar6; pfVar6 = &local_30; if (local_30 <= 0.0) { pfVar6 = &local_2c; } fVar2 = *pfVar6; (this->_velocity).x = fVar10 * (fVar1 + fVar2) + (this->_velocity).x; (this->_velocity).y = fVar9 * (fVar1 + fVar2) + (this->_velocity).y; } } iVar5 = this->_variant; (this->_velocity).x = (this->_velocity).x * 0.8836; (this->_velocity).y = (this->_velocity).y * 0.8836; EntityList::QuerySublist((EntityList *)((int)game->_room + 0x1218),&chainList,3,iVar5,-1,0,0); uVar8 = 0; if (chainList._size != 0) { do { otherChain = *(Entity_Familiar **)((int)chainList._data + uVar8 * 4); if (otherChain != this) { local_2c = (this->_pos).x - (otherChain->_pos).x; local_30 = (this->_pos).y - (otherChain->_pos).y; local_38 = 0.0; fVar9 = sqrtf(local_2c * local_2c + local_30 * local_30); local_34 = 20.0 - fVar9; pfVar6 = &local_38; if (0.0 <= 20.0 - fVar9) { pfVar6 = &local_34; } if (fVar9 <= 0.0) { fVar10 = local_30; fVar9 = local_2c; } else { fVar9 = (*pfVar6 * 0.1) / fVar9; fVar10 = local_30 * fVar9; fVar9 = local_2c * fVar9; } (this->_velocity).x = fVar9 + (this->_velocity).x; (this->_velocity).y = fVar10 + (this->_velocity).y; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)chainList._size); } if (14400.0 < local_3c) { if (local_40 <= 0.0) { fVar9 = toPlayerX; local_3c = toPlayerY; } else { fVar9 = toPlayerX * (120.0 / local_40); local_3c = toPlayerY * (120.0 / local_40); } local_40 = *(float *)((int)this->_player + 0x33c) - fVar9; local_3c = *(float *)((int)this->_player + 0x340) - local_3c; room = g_game->_room; iVar7 = (int)((local_40 - 40.0) / 40.0 + 0.5); iVar5 = (int)((local_3c - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar5 < 0)) || (room->_gridHeight <= iVar5)) { iVar7 = -1; } else { iVar7 = iVar5 * room->_gridWidth + iVar7; } uVar8 = Room::GetGridCollision(room,iVar7); if (uVar8 == 0) { (this->_pos).x = local_40; (this->_pos).y = local_3c; (this->_velocity).x = g_vectorZero.x; fVar9 = g_vectorZero.y; } else { fVar9 = (this->_velocity).x; local_38 = (this->_velocity).y; local_40 = 5.0; local_3c = sqrtf(fVar9 * fVar9 + local_38 * local_38); pfVar6 = &local_40; if (local_3c <= 5.0) { pfVar6 = &local_3c; } fVar9 = *pfVar6; if (local_3c <= 0.0) goto LAB_0062e5c3; (this->_velocity).x = (fVar9 / local_3c) * (this->_velocity).x; fVar9 = local_38 * (fVar9 / local_3c); } (this->_velocity).y = fVar9; } LAB_0062e5c3: if (chainList._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (chainList._data != (void *)0x0) { uVar8 = *(uint *)((int)chainList._data + -4); qVar3 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar8; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar3 < uVar8); free((uint *)((int)chainList._data + -4)); } } ExceptionList = local_1c; return; } //@@ 0062e620 Entity_Familiar::update_weapon /* DB: Create/DestroyWeapon matching player weapon 0xdc4 */ void Entity_Familiar::update_weapon(undefined4 param_1) { void *pvVar1; byte isLullaby; Weapon *newWeapon; uint rngResult; int weaponTarget; Entity_Familiar *in_ECX; float shootDirection; float local_28; Vector local_24; undefined1 isShooting [4]; Vector aimDirection; Vector markedAim; int *oldWeapon; int playerWeapon; if (*(char *)((int)in_ECX->_player + 0x173) != '\0') { return; } playerWeapon = *(int *)((int)in_ECX->_player + 0x13e0); if ((char)param_1 == '\0') { oldWeapon = in_ECX->_weapon; if (playerWeapon == 0) { if (oldWeapon != (int *)0x0) { Isaac::DestoryWeapon(&in_ECX->_weapon); } } else { if (oldWeapon != (int *)0x0) { if (oldWeapon[0xc] == *(int *)(playerWeapon + 0x30)) goto LAB_0062e6b0; (**(code **)(*oldWeapon + 0x14))(); if (in_ECX->_weapon != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_weapon)(1); } in_ECX->_weapon = (void *)0x0; } newWeapon = Isaac::CreateWeapon(*(int *)(playerWeapon + 0x30),(Entity *)in_ECX); in_ECX->_weapon = newWeapon; } } LAB_0062e6b0: pvVar1 = in_ECX->_player; if ((((*(char *)((int)pvVar1 + 0x1398) == '\0') && (*(char *)((int)pvVar1 + 0x139a) == '\0')) && (*(int *)&g_game->_stageTransition == 0)) && ((*(char *)((int)pvVar1 + 0x410) != '\0' && (*(int *)((int)pvVar1 + 0x414) < 1)))) { aimDirection.x = *(float *)((int)pvVar1 + 0x1630); local_28 = *(float *)((int)pvVar1 + 0x162c); aimDirection.y = *(float *)((int)pvVar1 + 0x1634); isShooting[0] = *(int *)((int)pvVar1 + 0x162c) != -1; markedAim.y = 0.0; markedAim.x = 0.0; if ((playerWeapon != 0) && (in_ECX->_weapon != (void *)0x0)) { TryAimAtMarkedTarget(in_ECX,&aimDirection,(int *)&local_28,&markedAim); } shootDirection = local_28; if (in_ECX->_variant == 0x4c) { rngResult = Random(); local_28 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_28 = local_28 + local_28; local_24.x = cos(local_28); aimDirection.y = sin(local_28); aimDirection.x = local_24.x; if (ABS(local_24.x) <= ABS(aimDirection.y)) { shootDirection = (float)((uint)(0.0 <= aimDirection.y) * 2 + 1); local_24.x = shootDirection; } else { shootDirection = 2.8026e-45; if (local_24.x < 0.0) { shootDirection = 0.0; } } } if (in_ECX->_counter < 1) { if ((shootDirection == -NAN) && ((in_ECX->_headFrameDelay < 1 || (shootDirection = (float)in_ECX->_shootDirection, shootDirection == -NAN)))) { shootDirection = 4.2039e-45; } if ((in_ECX->_weapon != (int *)0x0) && (weaponTarget = (**(code **)(*(int *)in_ECX->_weapon + 0x24))(), weaponTarget != 0)) { local_24.x = *(float *)(weaponTarget + 0x33c) - (in_ECX->_pos).x; local_24.y = *(float *)(weaponTarget + 0x340) - (in_ECX->_pos).y; shootDirection = (float)vector_to_direction(&local_24); } in_ECX->_shootDirection = (int)shootDirection; } if ((playerWeapon != 0) && (pvVar1 = in_ECX->_weapon, pvVar1 != (void *)0x0)) { *(float *)((int)pvVar1 + 0x28) = markedAim.x; *(float *)((int)pvVar1 + 0x2c) = markedAim.y; isLullaby = Entity_Player::HasTrinket(in_ECX->_player,0x8d,0); if (isLullaby == 0) { *(undefined4 *)((int)in_ECX->_weapon + 0x10) = *(undefined4 *)(playerWeapon + 0x10); } else { *(float *)((int)in_ECX->_weapon + 0x10) = *(float *)(playerWeapon + 0x10) * 0.5; } *(uint *)((int)in_ECX->_weapon + 0x34) = *(uint *)(playerWeapon + 0x34) | 0x40000000; (**(code **)(*(int *)in_ECX->_weapon + 8))(param_1); (**(code **)(*(int *)in_ECX->_weapon + 0xc))(isShooting,local_24.y,param_1); } if ((char)param_1 == '\0') { if (in_ECX->_fireCooldown == 0) { if (in_ECX->_headFrameDelay < 9) { PlayFloatAnim(in_ECX,in_ECX->_shootDirection); } else { PlayShootAnim(in_ECX,in_ECX->_shootDirection); } } if (0 < in_ECX->_counter) { in_ECX->_counter = in_ECX->_counter + -1; } if (0 < in_ECX->_headFrameDelay) { in_ECX->_headFrameDelay = in_ECX->_headFrameDelay + -1; } if (0 < in_ECX->_fireCooldown) { in_ECX->_fireCooldown = in_ECX->_fireCooldown + -1; } isLullaby = Entity_Player::HasTrinket(in_ECX->_player,0x8d,0); if ((isLullaby != 0) && (0 < in_ECX->_fireCooldown)) { in_ECX->_fireCooldown = in_ECX->_fireCooldown + -1; } } } return; } //@@ 0062e9c0 FamiliarAI::lost_fly /* DB: Entity_Familiar::Update case 0x55 (85 LOST_FLY); QueryRadius + IsVulnerableEnemy + Entity_NPC::TryForceTarget (distracts enemies), CheckLine */ void __fastcall FamiliarAI::lost_fly(Entity_Familiar *familiar) { Vector *position; Vector pos; byte bVar1; int iVar2; Vector *dirUnit; uint uVar3; int startGridIndex; float fVar4; undefined1 nearbyEntities [12]; uint nearbyCount; Vector local_30; float local_28; float local_24; int probeColumn; float local_1c; float stepX; void **roomRef; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_NPC *enemy; int gridWidth; Room *room; local_8 = 0xffffffff; puStack_c = &LAB_00af6dad; local_10 = ExceptionList; ExceptionList = &local_10; if (((familiar->_targetPosition).x == g_vectorZero.x) && ((familiar->_targetPosition).y == g_vectorZero.y)) { (familiar->_targetPosition).x = (familiar->_pos).x; (familiar->_targetPosition).y = (familiar->_pos).y; startGridIndex = (int)(((familiar->_pos).x - 40.0) / 40.0 + 0.5); iVar2 = (int)(((familiar->_pos).y - 120.0) / 40.0 + 0.5); if ((startGridIndex < 0) || (((gridWidth = *(int *)((int)g_game->_room + 0xc), gridWidth <= startGridIndex || (iVar2 < 0) ) || (*(int *)((int)g_game->_room + 0x10) <= iVar2)))) { startGridIndex = -1; } else { startGridIndex = iVar2 * gridWidth + startGridIndex; } familiar->_state = startGridIndex; } position = &familiar->_pos; familiar->_friction = familiar->_friction * 0.6; position->x = (familiar->_targetPosition).x; (familiar->_pos).y = (familiar->_targetPosition).y; dirUnit = Isaac::GetAxisAlignedUnitVectorFromDir(&local_30,familiar->_moveDirection); stepX = dirUnit->x * 3.0; local_1c = dirUnit->y * 3.0; roomRef = &g_game->_room; room = *roomRef; fVar4 = ((stepX + position->x) - 40.0) / 40.0 + 0.5; probeColumn = (int)fVar4; iVar2 = (int)(((local_1c + (familiar->_pos).y) - 120.0) / 40.0 + 0.5); if (((probeColumn < 0) || (room->_gridWidth <= probeColumn)) || ((iVar2 < 0 || (room->_gridHeight <= iVar2)))) { iVar2 = -1; } else { iVar2 = iVar2 * room->_gridWidth + (int)fVar4; } if (iVar2 != familiar->_state) { uVar3 = Room::GetGridCollision(room,iVar2); if ((uVar3 != 0) && (uVar3 != 1)) { uVar3 = familiar->_moveDirection + 3U & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } familiar->_moveDirection = uVar3; ExceptionList = local_10; return; } uVar3 = familiar->_moveDirection + 1U & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } dirUnit = Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)(nearbyEntities + 8),uVar3); roomRef = &g_game->_room; room = *roomRef; local_24 = dirUnit->x * 3.0 + position->x; local_30.y = dirUnit->y * 3.0 + (familiar->_pos).y; fVar4 = ((local_24 + stepX) - 40.0) / 40.0 + 0.5; probeColumn = (int)fVar4; iVar2 = (int)(((local_30.y + local_1c) - 120.0) / 40.0 + 0.5); if ((((probeColumn < 0) || (room->_gridWidth <= probeColumn)) || (iVar2 < 0)) || (room->_gridHeight <= iVar2)) { iVar2 = -1; } else { iVar2 = iVar2 * room->_gridWidth + (int)fVar4; } uVar3 = Room::GetGridCollision(room,iVar2); fVar4 = local_24; if ((uVar3 == 0) || (uVar3 == 1)) { local_28 = local_24; local_24 = local_30.y; pos.y = local_30.y; pos.x = fVar4; iVar2 = Room::GetGridCollisionAtPos(*roomRef,pos); if ((iVar2 != 0) && (iVar2 != 1)) { uVar3 = familiar->_moveDirection + 1U & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } familiar->_moveDirection = uVar3; } } } fVar4 = (familiar->_targetPosition).x; (familiar->_velocity).x = stepX; (familiar->_velocity).y = local_1c; (familiar->_targetPosition).x = stepX + fVar4; (familiar->_targetPosition).y = local_1c + (familiar->_targetPosition).y; iVar2 = Entity::GetIntervalTicks((Entity *)familiar,2.0,0.0); if (iVar2 != 0) { EntityList::QueryRadius ((EntityList *)((int)*roomRef + 0x1218),(EntityList_EL *)nearbyEntities,position,160.0 ,8); local_8 = 0; local_1c = 0.0; if (nearbyCount != 0) { do { enemy = *(Entity_NPC **)(nearbyEntities._4_4_ + (int)local_1c * 4); bVar1 = Entity::IsVulnerableEnemy((Entity *)enemy,(Entity *)0x0); if (((bVar1 != 0) && (iVar2 = __RTDynamicCast(enemy,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar2 != 0)) && ((enemy->_flags & 0x20000010) == 0)) { local_30.y = (enemy->_pos).y; local_30.x = (enemy->_pos).x; bVar1 = Room::CheckLine(g_game->_room,&familiar->_pos,&local_30,3,0,0,0,(Vector *)0x0); if (bVar1 != 0) { Entity_NPC::TryForceTarget(enemy,(Entity *)familiar,0x5a); } } local_1c = (float)((int)local_1c + 1); } while ((uint)local_1c < nearbyCount); } if (nearbyEntities[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)nearbyEntities._4_4_,0); } } ExceptionList = local_10; return; } //@@ 0062ee30 Entity_Familiar::ai_lil_gurdy /* WARNING: Type propagation algorithm not settling */ /* DB: Entity_Familiar::Update case 0x57 (FamiliarVariant.LIL_GURDY 87): charges while fire is held (ChargeStart/Charging, up to 90 frames), dashes in the aim direction (Dashing/DashStop), DamageGridWithSource breaks rocks, MakeSplat prototype: db/protos.zhl */ void __thiscall Entity_Familiar::ai_lil_gurdy(Entity_Familiar *this) { Vector *coneDir; void *pvVar1; byte bVar2; uint uVar3; Vector *targetDir; undefined1 *puVar4; int chargeFrames; int iVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; char *anim; EntityRef *source; float local_44; Vector local_40; Vector local_38; EntityRef damageSource; Manager *manager; EntityPtr target; if (this->_state == 0) { pvVar1 = this->_player; this->_entityGridCollisionClass = 3; iVar5 = *(int *)((int)pvVar1 + 0x162c); fVar6 = sqrtf(*(float *)((int)pvVar1 + 0x1630) * *(float *)((int)pvVar1 + 0x1630) + *(float *)((int)pvVar1 + 0x1634) * *(float *)((int)pvVar1 + 0x1634)); if ((fVar6 < 0.5) && (*(char *)((int)this->_player + 0x1638) == '\0')) { iVar5 = -1; } Isaac::GetAxisAlignedUnitVectorFromDir(&local_38,this->_lastDirection); bVar2 = TryAimAtMarkedTarget(this,&local_38,&this->_lastDirection,(Vector *)0x0); if ((bVar2 != 0) && (0x59 < this->_fireCooldown)) { iVar5 = -1; } pvVar1 = this->_player; if ((((*(char *)((int)pvVar1 + 0x1398) == '\0') && (*(char *)((int)pvVar1 + 0x139a) == '\0')) && (*(int *)&g_game->_stageTransition == 0)) && ((*(char *)((int)pvVar1 + 0x410) != '\0' && (*(int *)((int)pvVar1 + 0x414) < 1)))) { chargeFrames = this->_fireCooldown; if (iVar5 == -1) { if (chargeFrames < 1) { if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) goto LAB_0062f0b9; anim = (char *)s_Idle; } else { this->_state = 1; iVar5 = 0x5a; if (chargeFrames < 0x5a) { iVar5 = chargeFrames; } this->_entityGridCollisionClass = 6; this->_fireCooldown = iVar5; fVar6 = ((float)iVar5 / 90.0) * 20.0 + 5.0; fVar7 = local_38.x * fVar6 + (this->_velocity).x; (this->_velocity).y = local_38.y * fVar6 + (this->_velocity).y; (this->_velocity).x = fVar7; fVar11 = *(float *)((int)this->_player + 0x360) * 0.6; fVar8 = *(float *)((int)this->_player + 0x364) * 0.6; fVar11 = fVar11 + fVar11; fVar8 = fVar8 + fVar8; fVar10 = local_38.y * fVar8 + local_38.x * fVar11; fVar6 = local_38.y * fVar10; fVar10 = local_38.x * fVar10; if (local_38.y * fVar6 + local_38.x * fVar10 < 0.0) { fVar8 = fVar8 - fVar6; fVar11 = fVar11 - fVar10; } anim = "Dashing"; (this->_velocity).y = fVar8 + (this->_velocity).y; (this->_velocity).x = fVar7 + fVar11; local_38.x = fVar6; } } else { if (chargeFrames == 0) { ANM2::Play(&this->_sprite,(byte *)"ChargeStart",0); chargeFrames = this->_fireCooldown; } this->_lastDirection = iVar5; this->_fireCooldown = chargeFrames + 1; if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) goto LAB_0062f0b9; anim = "Charging"; } ANM2::Play(&this->_sprite,(byte *)anim,0); } LAB_0062f0b9: if (this->_state == 0) { local_44 = this->_friction * 0.8; this->_friction = local_44; fVar6 = (this->_pos).x; fVar10 = (this->_pos).y; fVar8 = *(float *)((int)this->_player + 0x33c); fVar11 = *(float *)((int)this->_player + 0x340); fVar9 = fVar6 - fVar8; fVar7 = fVar10 - fVar11; if (2500.0 < fVar7 * fVar7 + fVar9 * fVar9) { local_38.x = (fVar8 - fVar6) * 0.05; local_40.x = (fVar11 - fVar10) * 0.05; fVar8 = sqrtf(local_40.x * local_40.x + local_38.x * local_38.x); fVar6 = local_40.x; fVar10 = local_38.x; if ((1.0 < fVar8) && (0.0 < fVar8)) { fVar6 = (1.0 / fVar8) * local_40.x; fVar10 = (1.0 / fVar8) * local_38.x; } if (local_44 != 0.0) { fVar8 = this->_speedMultiplier; (this->_velocity).y = (fVar8 * fVar6) / local_44 + (this->_velocity).y; (this->_velocity).x = (fVar8 * fVar10) / local_44 + (this->_velocity).x; } } } uVar3 = Random(); if (uVar3 % 3 != 0) goto LAB_0062f7c8; fVar6 = 10.0; } else { if (this->_state != 1) goto LAB_0062f7c8; if (this->_collidesWithGrid != 0) { local_38.x = (this->_gridCollisionVelocity).x + (this->_pos).x; local_40.x = (float)g_game->_room; local_44 = (this->_gridCollisionVelocity).y; local_38.y = local_44 + (this->_pos).y; local_38.x = (float)Room::GetGridIndex((Room *)local_40.x,&local_38); if ((int)local_38.x < 0) { fVar6 = local_44; } else { damageSource._entity = this->_player; if (damageSource._entity == (void *)0x0) { damageSource._type = 0; damageSource._variant = 0; damageSource._spawnerType = 0; damageSource._spawnerVariant = 0; damageSource._position.x = g_vectorZero.x; damageSource._position.y = g_vectorZero.y; damageSource._velocity.x = g_vectorZero.x; damageSource._velocity.y = g_vectorZero.y; LAB_0062f341: damageSource._flags = 0; if (damageSource._entity != (void *)0x0) goto LAB_0062f347; damageSource._flags = 0; LAB_0062f363: local_44 = 0.0; if (damageSource._entity != (void *)0x0) goto LAB_0062f36f; LAB_0062f388: uVar3 = 0; } else { damageSource._type = *(int *)((int)damageSource._entity + 0x28); damageSource._variant = *(int *)((int)damageSource._entity + 0x2c); damageSource._spawnerType = *(int *)((int)damageSource._entity + 0x34); damageSource._spawnerVariant = *(int *)((int)damageSource._entity + 0x38); damageSource._position.x = *(float *)((int)damageSource._entity + 0x33c); damageSource._position.y = *(float *)((int)damageSource._entity + 0x340); damageSource._velocity.x = *(float *)((int)damageSource._entity + 0x360); damageSource._velocity.y = *(float *)((int)damageSource._entity + 0x364); if ((*(uint *)((int)damageSource._entity + 0x168) & 0x100) == 0) goto LAB_0062f341; damageSource._flags = 1; LAB_0062f347: if ((*(uint *)((int)damageSource._entity + 0x168) & 0x20000000) == 0) goto LAB_0062f363; local_44 = 2.8026e-45; LAB_0062f36f: if ((*(uint *)((int)damageSource._entity + 0x16c) & 0x400000) == 0) goto LAB_0062f388; uVar3 = 4; } fVar6 = (this->_gridCollisionVelocity).y; fVar10 = (this->_gridCollisionVelocity).x; damageSource._flags = uVar3 | (uint)local_44 | damageSource._flags; source = &damageSource; fVar6 = sqrtf(fVar10 * fVar10 + fVar6 * fVar6); fVar6 = fVar6 / 10.0; if (fVar6 <= 1.0) { fVar6 = 1.0; } if (4.0 <= fVar6) { fVar6 = 4.0; } Room::DamageGridWithSource((Room *)local_40.x,(int)local_38.x,(int)fVar6,source); fVar6 = (this->_gridCollisionVelocity).y; } fVar10 = (this->_gridCollisionVelocity).x; if (64.0 < fVar6 * fVar6 + fVar10 * fVar10) { (this->_hitList)._end = (this->_hitList)._begin; fVar6 = (this->_gridCollisionVelocity).y; } fVar10 = (this->_gridCollisionVelocity).x; local_44 = sqrtf(fVar10 * fVar10 + fVar6 * fVar6); local_40.x = (this->_velocity).x; coneDir = &this->_velocity; local_38.x = (this->_velocity).y; fVar6 = sqrtf(local_40.x * local_40.x + local_38.x * local_38.x); if (fVar6 <= 0.0) { fVar10 = local_40.x; fVar6 = local_38.x; } else { fVar10 = local_40.x * (1.0 / fVar6); fVar6 = local_38.x * (1.0 / fVar6); } coneDir->x = fVar10; (this->_velocity).y = fVar6; if ((0.0 < local_44) && (bVar2 = Entity::HasEntityFlags((Entity *)this,0x100), bVar2 == 0)) { PickEnemyTarget(this,800.0,0,0xb,coneDir,15.0); target = this->_target; if (target != (EntityPtr)0x0) { local_38.x = *(float *)((int)target + 0x33c) - (this->_pos).x; local_38.y = *(float *)((int)target + 0x340) - (this->_pos).y; targetDir = Vector::Normalized(&local_38,&local_40); coneDir->x = targetDir->x; (this->_velocity).y = targetDir->y; } } fVar10 = local_44 * (this->_velocity).y; fVar6 = local_44 * coneDir->x; (this->_velocity).y = fVar10; coneDir->x = fVar6; manager = g_manager; fVar6 = -(fVar10 * (this->_gridCollisionNormal).y + fVar6 * (this->_gridCollisionNormal).x); if (fVar6 <= 20.0) { if (4.0 < fVar6) { fVar6 = (fVar6 - 4.0) * 0.125; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } SoundEffects::PlayWithFartOverride(0x48,fVar6 * 0.5 + 0.5,2,0,1.0); } } else { local_38.x = 3.92364e-44; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38.x,0.8,2,0,1.0,0.0); } } local_40.x = (this->_velocity).x; fVar6 = (this->_velocity).y; local_38.x = sqrtf(local_40.x * local_40.x + fVar6 * fVar6); if (this->_fireCooldown < 1) { local_44 = 0.98; local_40.x = local_38.x * 0.02 + 0.8; puVar4 = (undefined1 *)&local_40; if (0.98 <= local_40.x) { puVar4 = (undefined1 *)&local_44; } this->_friction = *(float *)puVar4 * this->_friction; } else { iVar5 = this->_fireCooldown + -3; this->_fireCooldown = iVar5; if (0.0 < local_38.x) { fVar6 = (float)iVar5 / 60.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } fVar6 = fVar6 * (3.0 / local_38.x) + local_38.x; if (40.0 <= fVar6) { fVar6 = 40.0; } (this->_velocity).x = (fVar6 / local_38.x) * local_40.x; (this->_velocity).y = (fVar6 / local_38.x) * (this->_velocity).y; local_38.x = fVar6; } } if (local_38.x < 1.0) { this->_state = 0; this->_fireCooldown = 0; ANM2::Play(&this->_sprite,(byte *)"DashStop",0); } fVar6 = 10.0 / local_38.x; if (fVar6 <= 2.0) { fVar6 = 2.0; } if (10.0 <= fVar6) { fVar6 = 10.0; } } iVar5 = Entity::GetIntervalTicks((Entity *)this,fVar6,0.0); if (iVar5 != 0) { uVar3 = Random(); Entity_NPC::MakeSplat ((Entity_NPC *)this, (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); } LAB_0062f7c8: (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; return; } //@@ 0062f7f0 FamiliarAI::bumbo /* DB: Entity_Familiar::Update case 0x58 (88 BUMBO); Level1Float/Level2Idle..Level4Walking anims, PickEnemyTarget, FindFreePickupSpawnPosition */ void __fastcall FamiliarAI::bumbo(Entity_Familiar *familiar) { void *pvVar1; int iVar2; code *pcVar3; qword qVar4; byte bVar5; uint uVar6; uint rngResult; Vector *pVVar7; byte *curAnimName; EntityPtr EVar8; qword *allocCounter; bool bVar9; float fVar10; float fVar11; EntityPtr *pEVar12; EntityList_EL familiarList; EntityList_EL nearbyEntities; Vector tearVelocity; Vector goalPos; Vector local_28; Vector local_20; float local_18; char isCoinCollected; char isDroppingPickup; void *local_10; undefined1 *puStack_c; undefined4 local_8; char *animName; byte *curAnimData; Game *game; Manager *manager; Entity_Familiar *otherFamiliar; EntityPtr *targetRef; local_8 = 0xffffffff; puStack_c = &LAB_00af6de5; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar1 = familiar->_player; bVar9 = false; isDroppingPickup = '\0'; fVar10 = *(float *)((int)pvVar1 + 0x33c) - (familiar->_pos).x; fVar11 = *(float *)((int)pvVar1 + 0x340) - (familiar->_pos).y; if (((fVar11 * fVar11 + fVar10 * fVar10 < 6400.0) && (0 < familiar->_counter)) && ((familiar->_state == 1 || (familiar->_state == 3)))) { bVar9 = true; isDroppingPickup = '\x01'; } if (familiar->_state == 3) { goalPos.x = *(float *)((int)pvVar1 + 0x33c); EVar8 = familiar->_target; goalPos.y = *(float *)((int)pvVar1 + 0x340); if (EVar8 == (EntityPtr)0x0) { Entity_Familiar::PickEnemyTarget(familiar,300.0,0xd,0,&g_vectorZero,15.0); EVar8 = familiar->_target; if (EVar8 != (EntityPtr)0x0) goto LAB_0062f8e5; fVar10 = 6400.0; } else { LAB_0062f8e5: goalPos.x = *(float *)((int)EVar8 + 0x33c); goalPos.y = *(float *)((int)EVar8 + 0x340); fVar10 = 400.0; if (*(int *)((int)EVar8 + 0x28) == 5) { fVar10 = 16.0; } } local_20.x = goalPos.x - (familiar->_pos).x; local_20.y = goalPos.y - (familiar->_pos).y; local_28.y = local_20.x * local_20.x + local_20.y * local_20.y; if (fVar10 < local_28.y) { PathFinder::FindGridPath((PathFinder *)&familiar->_pathfinder,&goalPos,0.75,0,1); EVar8 = familiar->_target; } if ((((EVar8 != (EntityPtr)0x0) && (bVar5 = Entity::IsFrame((Entity *)familiar,0x3c,familiar->_index), bVar5 != 0)) && (rngResult = Random(), (rngResult & 3) == 0)) && (local_28.y < 2500.0)) { rngResult = Random(); pVVar7 = Vector::Resized(&local_20,&tearVelocity,5.0); Game::Spawn(g_game,4,0,&familiar->_pos,pVVar7,(Entity *)familiar,0,rngResult); } familiar->_friction = familiar->_friction * 0.85; if (!bVar9) { fVar10 = (familiar->_velocity).y; fVar11 = (familiar->_velocity).x; fVar10 = sqrtf(fVar11 * fVar11 + fVar10 * fVar10); if (2.0 <= fVar10) { ANM2::Play(&familiar->_sprite,(byte *)"Level4Walking",0); (familiar->_sprite)._flipX = (familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0; } else { ANM2::Play(&familiar->_sprite,(byte *)"Level4Idle",0); } } } manager = g_manager; iVar2 = familiar->_coins; if (iVar2 < 0x18) { if (iVar2 < 0xc) { if (5 < iVar2) { if (familiar->_state == 0) { local_20.y = 1.18129e-42; seed_fart_sound_override((int *)&local_20.y); SoundEffects::Play(&manager->_sfxManager,(int)local_20.y,1.0,2,0,1.0,0.0); } familiar->_state = 1; } } else { if (familiar->_state == 1) { local_20.y = 1.1827e-42; seed_fart_sound_override((int *)&local_20.y); SoundEffects::Play(&manager->_sfxManager,(int)local_20.y,1.0,2,0,1.0,0.0); } familiar->_state = 2; } } else { if (familiar->_state == 2) { pVVar7 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_28,&familiar->_pos,0.0,0,0,0); manager = g_manager; local_20.y = 1.1841e-42; (familiar->_pos).x = pVVar7->x; (familiar->_pos).y = pVVar7->y; familiar->_entityGridCollisionClass = 5; familiar->_entityCollisionClass = 4; seed_fart_sound_override((int *)&local_20.y); SoundEffects::Play(&manager->_sfxManager,(int)local_20.y,1.0,2,0,1.0,0.0); } familiar->_collisionDamage = 2.5; familiar->_state = 3; } EVar8 = familiar->_target; targetRef = &familiar->_target; isCoinCollected = '\0'; if (((EVar8 == (EntityPtr)0x0) || (*(char *)((int)EVar8 + 0x173) != '\0')) || (*(int *)((int)EVar8 + 0x28) != 5)) { if (familiar->_state != 3) { local_18 = *(float *)((int)familiar->_player + 0x33c); local_20.y = *(float *)((int)familiar->_player + 0x340); local_28.y = 80.0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiarList,3,-1,-1,1,0); local_8 = 0; uVar6 = 0; if (familiarList._size != 0) { do { otherFamiliar = *(Entity_Familiar **)((int)familiarList._data + uVar6 * 4); iVar2 = otherFamiliar->_variant; if (((iVar2 == 0x18) || (iVar2 == 0x40)) || ((iVar2 == 0x5a || ((iVar2 == 0x58 || (iVar2 == 0x66)))))) { if (otherFamiliar == familiar) break; local_18 = (otherFamiliar->_pos).x; local_20.y = (otherFamiliar->_pos).y; local_28.y = 50.0; } else if (otherFamiliar == familiar) break; uVar6 = uVar6 + 1; } while (uVar6 < (uint)familiarList._size); } local_20.y = local_20.y - (familiar->_pos).y; local_18 = local_18 - (familiar->_pos).x; fVar10 = sqrtf(local_20.y * local_20.y + local_18 * local_18); if (local_28.y < fVar10) { (familiar->_velocity).x = (local_18 / fVar10) * 0.8 + (familiar->_velocity).x; (familiar->_velocity).y = (local_20.y / fVar10) * 0.8 + (familiar->_velocity).y; } if ((familiar->_state == 2) && (Entity_Familiar::Shoot(familiar), 0 < familiar->_headFrameDelay)) { familiar->_friction = familiar->_friction * 0.2; } local_8 = 0xffffffff; if (familiarList._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (familiarList._data != (void *)0x0) { uVar6 = *(uint *)((int)familiarList._data + -4); qVar4 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar6; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar4 < uVar6); free((void *)((int)familiarList._data + -4)); } local_8 = 0xffffffff; } } } else { fVar10 = *(float *)((int)EVar8 + 0x33c) - (familiar->_pos).x; pEVar12 = (EntityPtr *)(*(float *)((int)EVar8 + 0x340) - (familiar->_pos).y); if (100.0 <= (float)pEVar12 * (float)pEVar12 + fVar10 * fVar10) { if (familiar->_state != 3) { local_28.x = fVar10; local_28.y = (float)pEVar12; pVVar7 = Vector::Normalized(&local_28,&local_20); fVar10 = pVVar7->y; (familiar->_velocity).x = pVVar7->x * 1.1 + (familiar->_velocity).x; (familiar->_velocity).y = fVar10 * 1.1 + (familiar->_velocity).y; } } else { Entity::collide_with_entity((Entity *)familiar,uVar6); if (*(char *)((int)*targetRef + 0x173) != '\0') { isCoinCollected = '\x01'; if (*targetRef != (EntityPtr)0x0) { local_28.y = (float)targetRef; std::multiset::erase(&local_28.y); } *targetRef = (EntityPtr)0x0; } } } if ((isDroppingPickup != '\0') && (((pvVar1 = (familiar->_sprite)._animState._animData, pvVar1 == (void *)0x0 || ((familiar->_sprite)._animState._isPlaying == 0)) || (*(char *)((int)pvVar1 + 0x34) != '\0')) )) { if (familiar->_state == 1) { animName = "Level2Spawn"; } else { if (familiar->_state != 3) goto LAB_0062fedd; animName = "Level4Spawn"; } bVar5 = ANM2::SetAnimation(&familiar->_sprite,(byte *)animName,1); if (bVar5 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } LAB_0062fedd: if (((familiar->_sprite)._animState._animData != (void *)0x0) && (bVar5 = AnimationState::IsEventTriggered(&(familiar->_sprite)._animState,s_Spawn), bVar5 != 0) ) { uVar6 = (familiar->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (familiar->_dropRNG)._seed; if (uVar6 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } game = g_game; uVar6 = uVar6 >> ((byte)(familiar->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(familiar->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(familiar->_dropRNG)._shift3 & 0x1f) ^ uVar6; (familiar->_dropRNG)._seed = uVar6; Game::Spawn(game,5,0,&familiar->_pos,&g_vectorZero,(Entity *)familiar,0,uVar6); familiar->_counter = familiar->_counter + -1; } if (isDroppingPickup != '\0') goto LAB_0063023d; iVar2 = familiar->_state; if (iVar2 == 0) { if (((familiar->_sprite)._animState._animData != (void *)0x0) && ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0063023d; curAnimData = (familiar->_sprite)._animState._animData; if (curAnimData != (byte *)0x0) { curAnimName = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } animName = "Level1Float"; do { bVar5 = *curAnimName; bVar9 = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_00630201: uVar6 = -(uint)bVar9 | 1; goto LAB_00630206; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar9 = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_00630201; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00630206: if ((uVar6 == 0) && ((curAnimData[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_0063023d; } animName = "Level1Float"; } else if (iVar2 == 1) { fVar10 = (familiar->_velocity).y; fVar11 = (familiar->_velocity).x; curAnimData = (familiar->_sprite)._animState._animData; if (fVar11 * fVar11 + fVar10 * fVar10 <= 1.0) { if (curAnimData != (byte *)0x0) { curAnimName = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } animName = "Level2Idle"; do { bVar5 = *curAnimName; bVar9 = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_00630186: uVar6 = -(uint)bVar9 | 1; goto LAB_0063018b; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar9 = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_00630186; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_0063018b: if (uVar6 == 0) { if ((curAnimData[0x34] == 0) || ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0063023d; animName = "Level2Idle"; goto LAB_00630226; } } animName = "Level2Idle"; } else { if (curAnimData != (byte *)0x0) { curAnimName = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } animName = "Level2Walking"; do { bVar5 = *curAnimName; bVar9 = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_00630117: uVar6 = -(uint)bVar9 | 1; goto LAB_0063011c; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar9 = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_00630117; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_0063011c: if (uVar6 == 0) { if ((curAnimData[0x34] == 0) || ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0063023d; animName = "Level2Walking"; goto LAB_00630226; } } animName = "Level2Walking"; } } else { if ((iVar2 != 2) || (((pvVar1 = (familiar->_sprite)._animState._animData, pvVar1 != (void *)0x0 && ((familiar->_sprite)._animState._isPlaying != 0)) && (*(char *)((int)pvVar1 + 0x34) == '\0')))) goto LAB_0063023d; fVar10 = (familiar->_velocity).y; fVar11 = (familiar->_velocity).x; curAnimData = (familiar->_sprite)._animState._animData; if (fVar11 * fVar11 + fVar10 * fVar10 <= 1.0) { if (curAnimData != (byte *)0x0) { curAnimName = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } animName = "Level3Idle"; do { bVar5 = *curAnimName; bVar9 = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_00630080: uVar6 = -(uint)bVar9 | 1; goto LAB_00630085; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar9 = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_00630080; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00630085: if (uVar6 == 0) { if ((curAnimData[0x34] == 0) || ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0063023d; animName = "Level3Idle"; goto LAB_00630226; } } animName = "Level3Idle"; } else { if (curAnimData != (byte *)0x0) { curAnimName = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } animName = "Level3Walking"; do { bVar5 = *curAnimName; bVar9 = bVar5 < (byte)*animName; if (bVar5 != *animName) { LAB_00630010: uVar6 = -(uint)bVar9 | 1; goto LAB_00630015; } if (bVar5 == 0) break; bVar5 = curAnimName[1]; bVar9 = bVar5 < (byte)animName[1]; if (bVar5 != animName[1]) goto LAB_00630010; curAnimName = curAnimName + 2; animName = animName + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00630015: if (uVar6 == 0) { if ((curAnimData[0x34] == 0) || ((familiar->_sprite)._animState._isPlaying != 0)) goto LAB_0063023d; animName = "Level3Walking"; goto LAB_00630226; } } animName = "Level3Walking"; } } LAB_00630226: bVar5 = ANM2::SetAnimation(&familiar->_sprite,(byte *)animName,1); if (bVar5 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } LAB_0063023d: if (familiar->_state != 3) { if ((familiar->_state != 2) || (familiar->_headFrameDelay < 1)) { (familiar->_sprite)._flipX = (familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0; } familiar->_friction = familiar->_friction * 0.8; } if (((isCoinCollected != '\0') || (bVar5 = Entity::IsFrame((Entity *)familiar,5,0), bVar5 != 0)) && (*targetRef == (EntityPtr)0x0)) { local_28.y = 40000.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&familiar->_pos,200.0, 0x10); uVar6 = 0; local_8 = 2; if (nearbyEntities._size != 0) { do { iVar2 = *(int *)((int)nearbyEntities._data + uVar6 * 4); if (((*(int *)(iVar2 + 0x28) == 5) && (EVar8 = (EntityPtr) __RTDynamicCast(iVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0), *(int *)((int)EVar8 + 0x2c) == 0x14)) && ((*(char *)((int)EVar8 + 0x173) == '\0' && ((*(int *)((int)EVar8 + 0x534) == 0 && (fVar10 = *(float *)((int)EVar8 + 0x33c) - (familiar->_pos).x, fVar11 = *(float *)((int)EVar8 + 0x340) - (familiar->_pos).y, local_20.y = fVar11 * fVar11 + fVar10 * fVar10, local_20.y < local_28.y)))))) { if (familiar->_entityGridCollisionClass == 5) { goalPos.x = *(float *)((int)EVar8 + 0x33c); goalPos.y = *(float *)((int)EVar8 + 0x340); bVar5 = NPCAI_Pathfinder::HasPathToPos(&familiar->_pathfinder,&goalPos,0); if (bVar5 == 0) goto LAB_006303e4; } if (familiar->_target != (EntityPtr)0x0) { local_28.y = (float)&familiar->_target; std::multiset::erase(&local_28.y); } familiar->_target = EVar8; std::multiset::insert(&familiar->_target); local_28.y = local_20.y; } LAB_006303e4: uVar6 = uVar6 + 1; } while (uVar6 < (uint)nearbyEntities._size); } if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { uVar6 = *(uint *)((int)nearbyEntities._data + -4); qVar4 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar6; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar4 < uVar6); free((void *)((int)nearbyEntities._data + -4)); } } } ExceptionList = local_10; return; } //@@ 00630440 Entity_Familiar::AddKeys /* ZHL [lua] Lua binding EntityFamiliar:AddKeys */ void __thiscall Entity_Familiar::AddKeys(Entity_Familiar *this,int param_2) { this->_keys = this->_keys + param_2; return; } //@@ 00630450 Entity_Familiar::store_backup /* DB: ECX familiar, arg 0x34-byte record: copies init seed +0x3ec, drop RNG +0x3dc, variant/subtype, +0xd7c..+0xd9c state (hearts, keys...), +0x380, two bytes, with per-variant overrides (206/237 +0xd70, 241 child's +0x380, 236 +0xd6c, 231 abyss locust ExtraData byte); Entity_Player::StoreGameState pushes it with vector_PlayerItemBackup_emplace_reallocate and AddCurseMistEffect stores the familiars the same way */ void __thiscall Entity_Familiar::store_backup(Entity_Familiar *this,int *param_2) { int iVar1; *param_2 = this->_initSeed; param_2[0xb] = (this->_dropRNG)._seed; param_2[1] = this->_variant; param_2[2] = this->_subtype; param_2[3] = this->_coins; param_2[4] = this->_hearts; param_2[5] = this->_keys; param_2[6] = this->_state; param_2[7] = this->_roomClearCount; param_2[8] = (int)(this->_formationTargetOffset).x; param_2[9] = (int)(this->_formationTargetOffset).y; param_2[10] = (int)this->_health; *(byte *)(param_2 + 0xc) = this->_isNotCountedAsFollower; *(byte *)((int)param_2 + 0x31) = this->_isSubtype55555; iVar1 = this->_variant; if ((iVar1 == 0xce) || (iVar1 == 0xed)) { param_2[7] = this->_orbitLayer; iVar1 = this->_variant; } if (iVar1 == 0xf1) { if (this->_linkedEntity == (EntityPtr)0x0) { iVar1 = 0; } else { iVar1 = *(int *)((int)this->_linkedEntity + 0x380); } param_2[10] = iVar1; iVar1 = this->_variant; } if (iVar1 == 0xec) { param_2[10] = (int)this->_orbitSpeed; iVar1 = this->_variant; } if (iVar1 == 0xe7) { iVar1 = __RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0); param_2[7] = (uint)*(byte *)(iVar1 + 0x50); } return; } //@@ 00630560 Menu_Stats::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix45/46] __thiscall void Menu_Stats::Render(); */ void __thiscall Menu_Stats::Render(Menu_Stats *this,int param_2) { char cVar1; byte isHasCollectible; LayerState *pLVar2; Entity_Familiar *otherFamiliar; Entity *ownOrbitParent; float orbitDistanceIndex; uint uVar3; Entity *pEVar4; int iVar5; ItemConfig_Item *itemConfig; qword *allocCounter; float orbitCount; float fVar6; uint uVar7; char orbitList [4]; uint orbitListData; uint orbitListCapacity; uint orbitListSize; EntityList_EL familiars; float local_5c; void *familiarsData; uint local_54; EntityPtr *local_50; uint local_4c; float local_48; char isFastOrbit; undefined4 color; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword allocatedBytes; AnimationState *childSlot; uint *flagsHigh; Menu_Stats *listEntity; int *oldChild; local_8 = 0xffffffff; puStack_c = &LAB_00af6e25; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(orbitList + 0x78); ExceptionList = &local_10; this->_IconIDtoUseForAchievementID[0xa7] = *(int *)(param_2 + 0x2c); this->_IconIDtoUseForAchievementID[0xa8] = 4; this->_IconIDtoUseForAchievementID[0xa9] = 3; this->_IconIDtoUseForAchievementID[0xaa] = 0x11; this->_IconIDtoUseForAchievementID[10] = this->_IconIDtoUseForAchievementID[10] & 0xfffffffb; this->_IconIDtoUseForAchievementID[0xb] = this->_IconIDtoUseForAchievementID[0xb]; *(undefined4 *)((this->_achievementMiniSprite2)._filename._buf + 0xc) = *(undefined4 *)(param_2 + 0xc); (this->_achievementMiniSprite2)._filename._size = *(uint *)(param_2 + 0x10); (this->_achievementMiniSprite2)._filename._capacity = *(uint *)(param_2 + 0x14); *(undefined4 *)(this->_achievementMiniSprite2)._animDefaultName._buf = *(undefined4 *)(param_2 + 0x18); *(undefined4 *)((this->_achievementMiniSprite2)._animDefaultName._buf + 4) = *(undefined4 *)(param_2 + 0x1c); uVar7 = *(uint *)(param_2 + 0x20); (this->_achievementMiniSprite2)._animDefaultName._size = uVar7; uVar3 = *(uint *)(param_2 + 0x24); (this->_achievementMiniSprite2)._animDefaultName._capacity = uVar3; *(uint *)((this->_achievementMiniSprite2)._animDefaultName._buf + 8) = uVar7; *(uint *)((this->_achievementMiniSprite2)._animDefaultName._buf + 0xc) = uVar3; this->_IconIDtoUseForAchievementID[0x90] = *(int *)(param_2 + 0x28); (this->_achievementMiniSprite2)._filename._buf[6] = *(char *)(param_2 + 0x30); cVar1 = *(char *)(param_2 + 0x31); (this->_achievementMiniSprite2)._filename._buf[7] = cVar1; if (cVar1 != '\0') { color = 0x3f800000; uStack_3c = 0x3f800000; uStack_38 = 0x3f800000; uStack_34 = 0x3f800000; local_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; uStack_24 = 0x3f800000; local_20 = 0; local_1c = 0; local_18 = 0; (**(code **)(this->_countTotalAchievements + 0x3c))(&color,0xffffffff,0xff,0,1,local_14); } if (((this->_StatsMenuSprite)._filename._size == 0xd8) && (0 < *(int *)(this->_achievementMiniSprite2)._animDefaultName._buf)) { pLVar2 = ANM2::GetLayer((ANM2 *)&(this->_StatsMenuSprite)._animDefaultName._capacity,(byte *)0x0 ); (pLVar2->_size).x = g_vectorZero.x; (pLVar2->_size).y = g_vectorZero.y; iVar5 = *(int *)(this->_achievementMiniSprite2)._filename._buf; this->_IconIDtoUseForAchievementID[0x12] = 0; this->_IconIDtoUseForAchievementID[7] = 0; if (-1 < iVar5) { Entity_Familiar::RecalculateOrbitOffset((Entity_Familiar *)this,iVar5,0); (this->_achievementMiniSprite2)._filename._buf[0] = -1; (this->_achievementMiniSprite2)._filename._buf[1] = -1; (this->_achievementMiniSprite2)._filename._buf[2] = -1; (this->_achievementMiniSprite2)._filename._buf[3] = -1; } } if ((this->_StatsMenuSprite)._filename._size == 0xd3) { if (*(int *)(this->_achievementMiniSprite2)._animDefaultName._buf == 4) { *(undefined1 *)((int)this->_IconIDtoUseForAchievementID + 0x31) = 0; ANM2::Play((ANM2 *)&(this->_StatsMenuSprite)._animDefaultName._capacity,(byte *)"Death",0); if ((this->_StatsMenuSprite)._overlayAnimState._animFrame != 0.0) { AnimationState::AdvancePosition ((AnimationState *)&(this->_StatsMenuSprite)._overlayAnimState._nullLayerFrames, *(int *)((int)(this->_StatsMenuSprite)._overlayAnimState._animFrame + 0x30) + -1) ; } } else if (0 < *(int *)((this->_achievementMiniSprite2)._filename._buf + 0xc)) { ANM2::PlayOverlay((ANM2 *)&(this->_StatsMenuSprite)._animDefaultName._capacity, (byte *)"Mantle",0); } } uVar7 = (this->_StatsMenuSprite)._filename._size; if ((uVar7 == 0xce) || (uVar7 == 0xed)) { if (*(int *)(param_2 + 0x1c) < 0) { fVar6 = *(float *)(this->_achievementMiniSprite2)._filename._buf; local_5c = fVar6; if (-1 < (int)fVar6) { if ((this->_achievementMiniSprite2)._filename._buf[7] == '\0') { if (((*(int *)((this->_StatsMenuSprite)._filename._buf + 0xc) == 3) && (uVar7 == 0xce)) && (((this->_StatsMenuSprite)._filename._capacity == 0x4d || ((this->_StatsMenuSprite)._filename._capacity == 0x12a)))) { isFastOrbit = '\x01'; } else { isFastOrbit = '\0'; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0); iVar5 = familiars._size; local_8 = 0; buffer_init(orbitList,familiars._size + 1); local_8 = CONCAT31(local_8._1_3_,1); local_54 = 0; familiarsData = familiars._data; local_4c = orbitListData; orbitCount = (float)orbitListSize; if (iVar5 != 0) { local_48 = (float)orbitListSize; uVar7 = familiars._size; do { listEntity = *(Menu_Stats **)((int)familiars._data + local_54 * 4); if (*(char *)((int)listEntity->_IconIDtoUseForAchievementID + 0x32) != '\0') { if (listEntity != this) { otherFamiliar = (Entity_Familiar *) __RTDynamicCast(listEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0 ); if ((float)otherFamiliar->_orbitLayer == fVar6) { pEVar4 = Entity_Familiar::get_orbit_parent(otherFamiliar); ownOrbitParent = Entity_Familiar::get_orbit_parent((Entity_Familiar *)this); fVar6 = local_48; if (pEVar4 == ownOrbitParent) { if (((otherFamiliar->_type == 3) && (otherFamiliar->_variant == 0xce)) && ((otherFamiliar->_subtype == 0x4d || (otherFamiliar->_subtype == 0x12a)))) { isFastOrbit = '\x01'; } local_48 = (float)((int)local_48 + 1); if (orbitListCapacity < (uint)local_48) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); } *(Entity_Familiar **)(local_4c + (int)fVar6 * 4) = otherFamiliar; fVar6 = local_5c; orbitListSize = (uint)local_48; } else { fVar6 = local_5c; } } uVar7 = familiars._size; familiars._data = familiarsData; orbitCount = local_48; } } local_54 = local_54 + 1; } while (local_54 < uVar7); } local_48 = 1.0; if (isFastOrbit != '\0') { local_48 = 2.0; } isHasCollectible = Entity_Player::HasCollectible ((Entity_Player *)this->_IconIDtoUseForAchievementID[0xb4],0x117,0); if (isHasCollectible != 0) { local_48 = 0.33333334; } if ((int)fVar6 < 1) { fVar6 = 0.0; } orbitDistanceIndex = 1.4013e-44; if ((int)fVar6 < 10) { orbitDistanceIndex = fVar6; } uVar7 = 0; local_54 = (int)orbitDistanceIndex * 0x14; if (orbitCount != 0.0) { local_5c = (float)((double)(int)orbitCount + __uint_to_double_fixup[-((int)orbitCount >> 0x1f)]); do { local_50 = (EntityPtr *) __RTDynamicCast(*(undefined4 *)(local_4c + uVar7 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor ,0); local_50[0x358] = (EntityPtr)(((float)(int)uVar7 * 6.2831855) / local_5c); isHasCollectible = Entity_Player::HasCollectible ((Entity_Player *)this->_IconIDtoUseForAchievementID[0xb4],0x70,0); if (isHasCollectible == 0) { fVar6 = *(float *)(&DAT_00c34138 + local_54); } else { fVar6 = *(float *)(&DAT_00c3413c + local_54) * *(float *)(&DAT_00c34138 + local_54); } local_50[0x35b] = (EntityPtr)(fVar6 * local_48); if (local_50[0xb] == (EntityPtr)0x3c) { local_50[0x35b] = (EntityPtr)(fVar6 * local_48 * 3.0); } uVar7 = uVar7 + 1; } while (uVar7 < (uint)orbitCount); } if (orbitList[0] == '\0') { allocCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (local_4c != 0) { uVar7 = *(uint *)(local_4c - 4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar7; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar7); free((void *)(local_4c - 4)); } } local_8 = 0xffffffff; if (familiars._0_1_ == '\0') { allocCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (familiarsData != (void *)0x0) { uVar7 = *(uint *)((int)familiarsData + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar7; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar7); free((void *)((int)familiarsData + -4)); } } local_8 = 0xffffffff; } (this->_achievementMiniSprite2)._filename._buf[0] = -1; (this->_achievementMiniSprite2)._filename._buf[1] = -1; (this->_achievementMiniSprite2)._filename._buf[2] = -1; (this->_achievementMiniSprite2)._filename._buf[3] = -1; } } else { Entity_Familiar::AddToOrbit((Entity_Familiar *)this,*(int *)(param_2 + 0x1c)); } } if ((((this->_StatsMenuSprite)._filename._size != 0xf1) || (this->_IconIDtoUseForAchievementID[0x90] = 0, *(float *)(param_2 + 0x28) <= 0.0)) || (iVar5 = *(int *)(this->_achievementMiniSprite2)._animDefaultName._buf, iVar5 < 1)) goto LAB_00630bda; uVar7 = 0; local_4c = 0; if (iVar5 == 1) { local_4c = 0; LAB_00630acd: uVar7 = 0x322; } else if (iVar5 == 2) { local_4c = 1; goto LAB_00630acd; } oldChild = (this->_achievementMiniSprite2)._overlayAnimState._animation; childSlot = &(this->_achievementMiniSprite2)._overlayAnimState; if (oldChild != (int *)0x0) { (**(code **)(*oldChild + 0x28))(); if (childSlot->_animation != (void *)0x0) { local_50 = (EntityPtr *)childSlot; std::multiset::erase(&local_50); } childSlot->_animation = (void *)0x0; } if (uVar7 != 0) { uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,uVar7,local_4c, (Vector *)(this->_IconIDtoUseForAchievementID + 0x7f),&g_vectorZero, (Entity *)this->_IconIDtoUseForAchievementID[0xb4],0,uVar3,0); if (pEVar4->_parent != (EntityPtr)0x0) { local_50 = &pEVar4->_parent; std::multiset::erase(&local_50); } pEVar4->_parent = (EntityPtr)this; std::multiset::insert(&pEVar4->_parent); (**(code **)(*(int *)pEVar4 + 0xc))(); (pEVar4->_sprite)._flipX = (byte)this->_IconIDtoUseForAchievementID[2]; fVar6 = *(float *)(param_2 + 0x28); flagsHigh = (uint *)((int)&pEVar4->_flags + 4); *flagsHigh = *flagsHigh | 0x80; pEVar4->_health = fVar6; *(int *)&pEVar4->_flags = (int)pEVar4->_flags; EntityList::AddPersistentEntity((EntityList *)((int)g_game->_room + 0x1218),pEVar4); if (childSlot->_animation != (void *)0x0) { local_50 = (EntityPtr *)childSlot; std::multiset::erase(&local_50); } childSlot->_animation = pEVar4; std::multiset::insert(childSlot); } LAB_00630bda: uVar7 = (this->_StatsMenuSprite)._filename._size; if (uVar7 == 0xec) { this->_IconIDtoUseForAchievementID[0x90] = *(int *)(this->_IconIDtoUseForAchievementID[0x7c] + 0x50); (this->_achievementMiniSprite1)._bitflags = *(int *)(param_2 + 0x28); } else if (uVar7 == 0xe7) { iVar5 = __RTDynamicCast((this->_achievementMiniSprite3)._overlayAnimState._nullLayerFrames,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0); Entity_Familiar::set_locust_config_index ((Entity_Familiar *)this, *(undefined4 *)((this->_achievementMiniSprite2)._filename._buf + 0xc)); itemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig,(this->_StatsMenuSprite)._filename._capacity); *(ItemConfig_Item **)&(this->_achievementMiniSprite3)._overlayAnimState._isPlaying = itemConfig; *(undefined1 *)(iVar5 + 0x50) = *(undefined1 *)(param_2 + 0x1c); Entity_Familiar::load_config_graphics((Entity_Familiar *)this); } (**(code **)(this->_countTotalAchievements + 0xc))(); ExceptionList = local_10; return; } //@@ 00630c90 FamiliarAI::spider_mod /* DB: Entity_Familiar::Update case 0x5e/0x71 (variants 94 and 113); EvaluateItems CheckFamiliar(0x5e)/CheckFamiliar(0x71) from collectible 0x193 COLLECTIBLE_SPIDER_MOD; random walk via PathFinder, Room::GetRandomPosition */ void __fastcall FamiliarAI::spider_mod(Entity_Familiar *familiar) { float fVar1; byte bVar2; uint uVar3; Vector *randomPos; byte *animNameCursor; Entity *candidate; byte *wantedNameCursor; int iVar4; bool bVar5; byte *pbVar6; Vector local_2c; Vector local_24; uint entityIndex; Entity *target; Room *room; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; Game *game; float velocityX; uStack_8 = 0xffffffff; puStack_c = &LAB_00af6e50; local_10 = ExceptionList; ExceptionList = &local_10; if (familiar->_subtype == 0) { iVar4 = familiar->_counter; familiar->_counter = iVar4 + -1; if (iVar4 < 1) { familiar->_subtype = 1; uVar3 = Random(); game = g_game; familiar->_counter = uVar3 % 0x3c + 0xf; if (familiar->_variant == 0x71) { room = game->_room; candidate = (Entity *)0x0; target = (Entity *)0x0; entityIndex = 0; if ((room->_entityList)._updateEL._size != 0) { local_2c.y = *(float *)&game->_deathmatchManager; local_24.y = (float)(room->_entityList)._updateEL._data; do { candidate = *(Entity **)local_24.y; if (((int)local_2c.y < 2) || (candidate->_type != 1)) { iVar4 = candidate->_type; if (iVar4 - 10U < 0x3de) goto LAB_00630d59; } else { iVar4 = 1; LAB_00630d59: if (((((candidate->_entityCollisionClass != 1) && (candidate->_entityCollisionClass != 0)) && (candidate->_isInvicible == 0)) && (candidate->_dead == 0)) && (((bVar2 = Entity::HasEntityFlags(candidate,0x10), bVar2 == 0 || (iVar4 == 0x322)) || (iVar4 == 0x362)))) break; } if (((int)local_2c.y < 2) || (iVar4 != 1)) { if ((iVar4 - 10U < 0x3de) && (((iVar4 != 0x21 && (iVar4 != 0x11)) && (iVar4 != 0x124)))) { if (iVar4 == 0x375) { bVar5 = candidate->_variant == 10; } else { if ((iVar4 == 0x3c0) || (iVar4 == 0x3c5)) goto LAB_00630e05; bVar5 = iVar4 == 0xf5; } if (!bVar5) goto LAB_00630df8; } LAB_00630e05: bVar5 = false; } else { LAB_00630df8: if (candidate->_dead != 0) goto LAB_00630e05; bVar5 = true; } if (!bVar5) { candidate = target; } entityIndex = entityIndex + 1; local_24.y = (float)((int)local_24.y + 4); target = candidate; } while (entityIndex < (uint)(room->_entityList)._updateEL._size); } if (candidate == (Entity *)0x0) { randomPos = Room::GetRandomPosition(room,&local_2c,0.0); (familiar->_targetPosition).x = randomPos->x; (familiar->_targetPosition).y = randomPos->y; } else { fVar1 = (candidate->_pos).y; (familiar->_targetPosition).x = (candidate->_pos).x; (familiar->_targetPosition).y = fVar1; } } else { randomPos = Room::GetRandomPosition(game->_room,&local_24,0.0); (familiar->_targetPosition).x = randomPos->x; (familiar->_targetPosition).y = randomPos->y; } } } else if (familiar->_subtype == 1) { PathFinder::FindGridPath ((PathFinder *)&familiar->_pathfinder,&familiar->_targetPosition,1.0,0,1); iVar4 = familiar->_counter; familiar->_counter = iVar4 + -1; if (iVar4 < 1) { uVar3 = Random(); familiar->_subtype = 0; familiar->_counter = uVar3 % 0x14 + 0xf; PathFinder::Reset((PathFinder *)&familiar->_pathfinder); } } fVar1 = (familiar->_velocity).y; velocityX = (familiar->_velocity).x; pbVar6 = (familiar->_sprite)._animState._animData; if (velocityX * velocityX + fVar1 * fVar1 <= 1.0) { if (pbVar6 != (byte *)0x0) { animNameCursor = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { animNameCursor = *(byte **)pbVar6; } wantedNameCursor = s_Idle; do { bVar2 = *animNameCursor; bVar5 = bVar2 < *wantedNameCursor; if (bVar2 != *wantedNameCursor) { LAB_00630fc5: uVar3 = -(uint)bVar5 | 1; goto LAB_00630fca; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar5 = bVar2 < wantedNameCursor[1]; if (bVar2 != wantedNameCursor[1]) goto LAB_00630fc5; animNameCursor = animNameCursor + 2; wantedNameCursor = wantedNameCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00630fca: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_00630ffd; } pbVar6 = s_Idle; } else { if (pbVar6 != (byte *)0x0) { animNameCursor = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { animNameCursor = *(byte **)pbVar6; } wantedNameCursor = s_Walk; do { bVar2 = *animNameCursor; bVar5 = bVar2 < *wantedNameCursor; if (bVar2 != *wantedNameCursor) { LAB_00630f73: uVar3 = -(uint)bVar5 | 1; goto LAB_00630f78; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar5 = bVar2 < wantedNameCursor[1]; if (bVar2 != wantedNameCursor[1]) goto LAB_00630f73; animNameCursor = animNameCursor + 2; wantedNameCursor = wantedNameCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00630f78: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_00630ffd; } pbVar6 = s_Walk; } bVar2 = ANM2::SetAnimation(&familiar->_sprite,pbVar6,1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } LAB_00630ffd: fVar1 = familiar->_friction; (familiar->_sprite)._flipX = (familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0; familiar->_friction = fVar1 * 0.7; if (0 < familiar->_fireCooldown) { familiar->_fireCooldown = familiar->_fireCooldown + -1; } ExceptionList = local_10; return; } //@@ 00631050 Entity_Familiar::MoveDelayed /* ZHL [lua] Lua binding EntityFamiliar:MoveDelayed */ void __thiscall Entity_Familiar::MoveDelayed(Entity_Familiar *this,int param_2) { undefined4 uVar1; float fVar2; float fVar3; byte bVar4; undefined4 *puVar5; float *pfVar6; EntityPtr EVar7; int iVar8; int iVar9; if (this->_isSubtype55555 != 0) { (this->_pos).x = (this->_formationOffset).x; (this->_pos).y = (this->_formationOffset).y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; return; } bVar4 = Entity_Player::HasTrinket(this->_player,0x6d,0); if (bVar4 != 0) { move_to_parent_offset(this); return; } if (((this->_formationOffset).x == g_vectorZero.x) && ((this->_formationOffset).y == g_vectorZero.y)) { iVar9 = this->_moveDelayNum; } else { reset_follow_target(this); iVar9 = -1; } EVar7 = (EntityPtr)this->_player; if (this->_parent != (EntityPtr)0x0) { EVar7 = this->_parent; } if (iVar9 == -1) { iVar9 = 0; this->_moveDelayNum = 0; if (3 < param_2) { iVar8 = (param_2 - 4U >> 2) + 1; iVar9 = iVar8 * 4; puVar5 = (undefined4 *)&this->field_0x424; do { uVar1 = *(undefined4 *)((int)EVar7 + 0x340); puVar5[-3] = *(undefined4 *)((int)EVar7 + 0x33c); puVar5[-2] = uVar1; uVar1 = *(undefined4 *)((int)EVar7 + 0x340); puVar5[-1] = *(undefined4 *)((int)EVar7 + 0x33c); *puVar5 = uVar1; uVar1 = *(undefined4 *)((int)EVar7 + 0x340); puVar5[1] = *(undefined4 *)((int)EVar7 + 0x33c); puVar5[2] = uVar1; uVar1 = *(undefined4 *)((int)EVar7 + 0x340); puVar5[3] = *(undefined4 *)((int)EVar7 + 0x33c); puVar5[4] = uVar1; iVar8 = iVar8 + -1; puVar5 = puVar5 + 8; } while (iVar8 != 0); } if (iVar9 < param_2) { iVar8 = param_2 - iVar9; pfVar6 = &((Vector *)(&this->_splatColor + 0xc))[iVar9 + 4].y; do { uVar1 = *(undefined4 *)((int)EVar7 + 0x340); *pfVar6 = *(float *)((int)EVar7 + 0x33c); pfVar6[1] = (float)uVar1; iVar8 = iVar8 + -1; pfVar6 = pfVar6 + 2; } while (iVar8 != 0); } } else { iVar9 = (iVar9 + 1) % param_2; this->_moveDelayNum = iVar9; fVar2 = *(float *)((int)EVar7 + 0x340); ((Vector *)(&this->_splatColor + 0xc))[iVar9 + 4].y = *(float *)((int)EVar7 + 0x33c); ((Vector *)(&this->_splatColor + 0xc))[iVar9 + 5].x = fVar2; } param_2 = (this->_moveDelayNum + 1) % param_2; if (this->_variant == 0x83) { fVar2 = ((Vector *)(&this->_splatColor + 0xc))[param_2 + 5].x; fVar3 = (this->_pos).y; (this->_velocity).x = (((Vector *)(&this->_splatColor + 0xc))[param_2 + 4].y - (this->_pos).x) * 0.5; (this->_velocity).y = (fVar2 - fVar3) * 0.5; } else { fVar2 = ((Vector *)(&this->_splatColor + 0xc))[param_2 + 5].x; (this->_velocity).x = (((Vector *)(&this->_splatColor + 0xc))[param_2 + 4].y - (this->_pos).x) * 0.1 + (this->_velocity).x; (this->_velocity).y = (fVar2 - (this->_pos).y) * 0.1 + (this->_velocity).y; } this->_friction = this->_friction * 0.7; return; } //@@ 006312f0 Entity_Familiar::MoveDiagonally /* ZHL [lua] Lua binding EntityFamiliar:MoveDiagonally */ float __thiscall Entity_Familiar::MoveDiagonally(Entity_Familiar *this,float param_2) { Vector *position; byte bVar1; uint rngResult; float extraout_EAX; Entity *spawned; int *effect; float fVar2; float fVar3; float fVar4; Vector local_10; Game *game; bool isFixedAngle; int tls; if ((this->_variant == 0x4c) || (this->_variant == 0x3a)) { isFixedAngle = true; } else { isFixedAngle = false; } if (this->_isSubtype55555 != 0) { (this->_pos).x = (this->_formationOffset).x; fVar2 = (this->_formationOffset).y; (this->_pos).y = fVar2; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; return fVar2; } fVar2 = (this->_velocity).x; if ((fVar2 == g_vectorZero.x) && ((this->_velocity).y == g_vectorZero.y)) { rngResult = Random(); local_10.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_10.x = local_10.x + local_10.x; fVar2 = cos(local_10.x); fVar3 = sin(local_10.x); (this->_velocity).x = fVar2 * 10.0; (this->_velocity).y = fVar3 * 10.0; return extraout_EAX; } tls = *(int *)ThreadLocalStoragePointer; (this->_velocity).x = fVar2 * 0.7; (this->_velocity).y = (this->_velocity).y * 0.7; if ((*(int *)(tls + 0xc) < DAT_00c7fd14) && (_Init_thread_header(&DAT_00c7fd14), DAT_00c7fd14 == -1)) { DAT_00c7fd18 = sqrtf(2.0); _Init_thread_footer(&DAT_00c7fd14); } local_10.x = 0.7853982; if (!isFixedAngle) { local_10.x = ((float)this->_fireCooldown * 3.1415927) / 180.0 + 0.7853982; } fVar4 = cos(local_10.x); fVar3 = DAT_00c7fd18; fVar2 = (this->_velocity).x; if (fVar2 <= 0.0) { fVar2 = fVar2 - DAT_00c7fd18 * fVar4 * param_2; } else { fVar2 = DAT_00c7fd18 * fVar4 * param_2 + fVar2; } (this->_velocity).x = fVar2; fVar4 = sin(local_10.x); game = g_game; fVar2 = (this->_velocity).y; if (fVar2 <= 0.0) { fVar2 = fVar2 - fVar4 * fVar3 * param_2; } else { fVar2 = fVar4 * fVar3 * param_2 + fVar2; } position = &this->_pos; (this->_velocity).y = fVar2; Room::GetClampedPositionImpl(game->_room,&local_10,position,0.0,0.0,0.0,0.0); if (position->x <= local_10.x) { if (position->x < local_10.x) { (this->_velocity).x = param_2 * 3.0 + (this->_velocity).x; } } else { (this->_velocity).x = (this->_velocity).x - param_2 * 3.0; } fVar2 = (this->_pos).y; if (fVar2 <= local_10.y) { if (fVar2 < local_10.y) { (this->_velocity).y = param_2 * 3.0 + (this->_velocity).y; } } else { (this->_velocity).y = (this->_velocity).y - param_2 * 3.0; } fVar2 = (float)Random(); if ((((uint)fVar2 & 3) == 0) && ((fVar2 = (float)this->_variant, fVar2 == 2.38221e-44 || (fVar2 == 2.90069e-43)))) { rngResult = Random(); spawned = Game::SpawnEx(g_game,1000,7,position,&g_vectorZero,(Entity *)0x0,0,rngResult,0); effect = (int *)__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); rngResult = Random(); fVar2 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.1; effect[0x39] = (int)fVar2; effect[0x3a] = (int)fVar2; fVar2 = (float)(**(code **)(*effect + 0xc))(); } game = g_game; if ((this->_variant == 0xcf) && (fVar2 = (float)((uint)this->_flags & 0x4000), fVar2 == 0.0)) { bVar1 = Game::IsPaused(g_game); fVar2 = (float)(uint)bVar1; if ((bVar1 == 0) && (bVar1 = ~(byte)game->_frameCount, fVar2 = (float)(bVar1 & 0xffffff01), (bVar1 & 1) != 0)) { rngResult = Random(); fVar2 = (float)(rngResult / 5); if (1 < rngResult % 5) { rngResult = Random(); spawned = Game::SpawnEx(g_game,1000,0x2e,&this->_pos,&g_vectorZero,(Entity *)this,0, rngResult,0); effect = (int *)__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0 ); rngResult = Random(); fVar3 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; fVar2 = fVar3 * g_vectorOne.x; effect[0x3a] = (int)(fVar3 * g_vectorOne.y); effect[0x39] = (int)fVar2; fVar2 = (float)(**(code **)(*effect + 0xc))(); } } } if (!isFixedAngle) { if (((0.0 < (this->_velocity).x) && ((this->_targetPosition).x <= 0.0)) || ((0.0 < (this->_velocity).y && ((this->_targetPosition).y <= 0.0)))) { rngResult = Random(); this->_fireCooldown = rngResult % 0x1f - 0xf; } (this->_targetPosition).x = (this->_velocity).x; fVar2 = (this->_velocity).y; (this->_targetPosition).y = fVar2; } return fVar2; } //@@ 00631850 Entity_Familiar::move_to_parent_offset /* DB: pos = parent pos + offset, velocity capped 100 */ void __thiscall Entity_Familiar::move_to_parent_offset(Entity_Familiar *this) { void *pvVar1; Vector *pVVar2; float fVar3; float fVar4; float fVar5; Vector local_10; if ((*(char *)g_game->_room != '\0') && (g_game->_frameCount == *(int *)((int)g_game->_room + 0x11f0))) { pvVar1 = this->_player; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; fVar3 = *(float *)((int)pvVar1 + 0x33c); fVar4 = *(float *)((int)pvVar1 + 0x340); pVVar2 = UpdateFollowPosition(this,&local_10); fVar5 = pVVar2->y; (this->_pos).x = fVar3 + pVVar2->x; (this->_pos).y = fVar4 + fVar5; return; } fVar3 = *(float *)((int)this->_player + 0x33c); fVar4 = *(float *)((int)this->_player + 0x340); pVVar2 = UpdateFollowPosition(this,&local_10); fVar3 = (fVar3 + pVVar2->x) - (this->_pos).x; fVar4 = (fVar4 + pVVar2->y) - (this->_pos).y; (this->_velocity).x = fVar3; fVar5 = fVar3 * fVar3 + fVar4 * fVar4; (this->_velocity).y = fVar4; if (10000.0 < fVar5) { fVar5 = sqrtf(fVar5); if (0.0 < fVar5) { (this->_velocity).y = (100.0 / fVar5) * fVar4; (this->_velocity).x = (100.0 / fVar5) * fVar3; } } (this->_velocity).x = (this->_velocity).x * 0.8; (this->_velocity).y = (this->_velocity).y * 0.8; return; } //@@ 00631a00 FUN_00631a00 void FUN_00631a00(float *param_1,undefined4 param_2,float *param_3) { float fVar1; float fVar2; float fVar3; fVar1 = g_vectorZero.y; fVar3 = 0.0; fVar2 = 0.0; switch(param_2) { case 0: fVar3 = *param_3 + *param_3; fVar2 = param_3[1] * 7.0 + fVar3; fVar3 = fVar3 - 8.0; break; case 1: fVar2 = *param_3 + *param_3; fVar3 = -8.0 - fVar2; fVar2 = fVar2 - param_3[1] * 7.0; break; case 2: case 5: fVar3 = g_vectorZero.y; fVar2 = g_vectorZero.x; break; case 3: case 4: case 6: fVar3 = 4.0 - ABS(*param_3) * 4.0; fVar2 = *param_3 * 10.0; break; case 0xffffffff: *param_1 = g_vectorZero.x; param_1[1] = fVar1; return; } param_1[1] = fVar3 - 23.0; *param_1 = fVar2 + 0.0; return; } //@@ 00631b20 Entity_Familiar::delirium_morph /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_Familiar::delirium_morph(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Familiar::delirium_morph(Entity_Familiar *this) { size_t _Size; EntityPtr *pEVar1; EntityPtr EVar2; int iVar3; code *pcVar4; size_t *psVar5; qword qVar6; uint uVar7; LayerState *layer; size_t *extraout_EAX; undefined1 auVar8 [4]; byte *resolvedPath; Entity *poofEffect; byte extraout_CL; byte extraout_CL_00; byte unk; void *ptr; qword *heapCounter; EntityPtr EVar9; size_t *_Size_00; undefined1 ptr_00 [4]; float fVar10; EntityPtr *local_70; EntityPtr oldSirenHelper; EntityPtr local_68; Entity_Familiar *local_64; size_t *local_60; EntityPtr local_5c; size_t *local_58; ANM2 *local_54; EntityPtr local_50; EntityPtr local_4c; byte local_46; byte local_45; void *redirectedPath [3]; undefined8 local_38; uint local_30; undefined1 local_2c [4]; std_string *psStack_28; size_t sStack_24; size_t sStack_20; uint local_1c; EntityPtr EStack_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; float oldPosY; float oldVelocityX; float oldVelocityY; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af6e7d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(redirectedPath + 0x10); ExceptionList = &local_10; local_58 = (size_t *)this->_variant; uVar7 = this->_initSeed; local_38._0_1_ = '\x05'; local_38._1_1_ = '\0'; local_38._2_1_ = '\0'; local_38._3_1_ = '\0'; local_38._4_4_ = 3; local_54 = (ANM2 *)0x15; local_50 = (EntityPtr)0x0; do { local_64 = this; if (local_58 != (size_t *)this->_variant) break; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar7 = uVar7 >> 5 ^ uVar7; uVar7 = uVar7 << 3 ^ uVar7; uVar7 = uVar7 >> 0x15 ^ uVar7; local_50 = (EntityPtr)((int)local_50 + 1); local_58 = *(size_t **)(&DAT_00b64820 + (uVar7 % 0x16) * 4); } while ((uint)local_50 < 10); local_4c = (EntityPtr)this->_player; fVar10 = (this->_pos).x; local_5c = this->_child; local_50 = this->_parent; iVar3 = this->_spawnerType; oldPosY = (this->_pos).y; local_60 = (size_t *)this->_spawnerVariant; oldVelocityX = (this->_velocity).x; local_68 = (EntityPtr)this->_sirenOriginalPlayer; oldVelocityY = (this->_velocity).y; oldSirenHelper = this->_sirenHelper; if (this->_weapon != (int *)0x0) { (**(code **)(*(int *)this->_weapon + 0x14))(local_14); if (this->_weapon != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_weapon)(1); } this->_weapon = (void *)0x0; } if (this->_linkedEntity != (EntityPtr)0x0) { (**(code **)(*(int *)this->_linkedEntity + 0x28))(); } local_46 = this->_isFollower; local_45 = this->_isDelayed; RecalculateOrbitOffset(this,this->_orbitLayer,0); RemoveFromFollowers(this); RemoveFromDelayed(this); (**(code **)(*(int *)this + 0x44))(); if (this->_spawnerEntity != (EntityPtr)0x0) { local_70 = &this->_spawnerEntity; std::multiset::erase(&local_70); } this->_spawnerEntity = local_4c; if (local_4c != (EntityPtr)0x0) { std::multiset::insert(&this->_spawnerEntity); } local_4c = *(EntityPtr *)(*(int *)this + 4); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar7 = uVar7 >> ((byte)local_38 & 0x1f) ^ uVar7; uVar7 = uVar7 << (SUB81(local_38,4) & 0x1f) ^ uVar7; (*(code *)local_4c)(this->_type,local_58,0,uVar7 >> ((byte)local_54 & 0x1f) ^ uVar7); if (((this->_isFollower != 0) && (local_46 != 0)) || ((this->_isDelayed != 0 && (local_45 != 0)))) { RemoveFromFollowers(this); RemoveFromDelayed(this); pEVar1 = &this->_parent; this->_isFollower = local_46; this->_isDelayed = local_45; if (*pEVar1 != (EntityPtr)0x0) { local_4c = (EntityPtr)pEVar1; std::multiset::erase(&local_4c); } *pEVar1 = local_50; if (local_50 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); EVar9 = (EntityPtr)((int)local_50 + 0x3c0); if (*(EntityPtr *)EVar9 != (EntityPtr)0x0) { local_4c = EVar9; std::multiset::erase(&local_4c); } *(Entity_Familiar **)EVar9 = this; std::multiset::insert(EVar9); } pEVar1 = &this->_child; if (this->_child != (EntityPtr)0x0) { local_4c = (EntityPtr)pEVar1; std::multiset::erase(&local_4c); } *pEVar1 = local_5c; if (local_5c != (EntityPtr)0x0) { std::multiset::insert(pEVar1); EVar9 = (EntityPtr)((int)local_5c + 0x3bc); if (*(EntityPtr *)EVar9 != (EntityPtr)0x0) { local_4c = EVar9; std::multiset::erase(&local_4c); } *(Entity_Familiar **)EVar9 = this; std::multiset::insert(EVar9); } } (this->_pos).x = fVar10; (this->_pos).y = oldPosY; (this->_velocity).x = oldVelocityX; this->_spawnerType = iVar3; this->_spawnerVariant = (int)local_60; (this->_velocity).y = oldVelocityY; this->_appearTimer = 0; local_45 = '\0'; local_50 = (EntityPtr)0x0; if ((this->_sprite)._layerCount != 0) { local_54 = &this->_sprite; do { layer = ANM2::GetLayer(local_54,(byte *)local_50); if (layer->_layerData == (void *)0x0) { EStack_18 = (EntityPtr)0xf; local_1c = 0; local_2c = (undefined1 [4])0x0; } else { std::string::string(local_2c,(void *)((int)layer->_layerData + 0x20)); } uVar7 = local_1c; local_8 = (void *)0x0; local_5c = EStack_18; if (local_1c < 4) { /* WARNING: Subroutine does not return */ FUN_00499950(); } if ((int)EStack_18 - local_1c < 0x12) { if (0x7fffffff - local_1c < 0x12) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } EVar9 = (EntityPtr)(local_1c + 0x12 | 0xf); if ((uint)EVar9 < 0x80000000) { if (0x7fffffff - ((uint)EStack_18 >> 1) < (uint)EStack_18) { EVar9 = (EntityPtr)0x7fffffff; } else { EVar2 = (EntityPtr)((int)EStack_18 + ((uint)EStack_18 >> 1)); if ((uint)EVar9 < (uint)EVar2) { EVar9 = EVar2; } } } else { EVar9 = (EntityPtr)0x7fffffff; } local_58 = std::_Allocate((int)EVar9 + 1); auVar8 = local_2c; EVar2 = local_5c; local_1c = uVar7 + 0x12; local_60 = (size_t *)(uVar7 - 3); EStack_18 = EVar9; if ((uint)local_5c < 0x10) { *local_58 = (size_t)local_2c; local_58[1] = 0x696d6166; local_58[2] = 0x7261696c; local_58[3] = 0x6c65642f; local_58[4] = 0x75697269; *(undefined2 *)(local_58 + 5) = 0x2f6d; memcpy((void *)((int)local_58 + 0x16),&psStack_28,(size_t)local_60); } else { *local_58 = *(size_t *)local_2c; local_58[1] = 0x696d6166; local_58[2] = 0x7261696c; local_58[3] = 0x6c65642f; local_58[4] = 0x75697269; *(undefined2 *)(local_58 + 5) = 0x2f6d; memcpy((void *)((int)local_58 + 0x16),(size_t *)((int)local_2c + 4),(size_t)local_60); uVar7 = (int)EVar2 + 1; ptr_00 = auVar8; if (0xfff < uVar7) { ptr_00 = *(undefined1 (*) [4])((int)auVar8 + -4); uVar7 = (int)EVar2 + 0x24; if (0x1f < (uint)((int)auVar8 + (-4 - (int)ptr_00))) goto LAB_006321d1; } operator_delete((void *)ptr_00,uVar7); } local_2c = (undefined1 [4])local_58; } else { local_60 = (size_t *)local_2c; if (0xf < (uint)EStack_18) { local_60 = (size_t *)local_2c; } psVar5 = local_60 + 1; if (((size_t *)0xb6403d < psVar5) || ((char *)((int)local_60 + local_1c) < "familiar/delirium/")) { _Size_00 = (size_t *)0x12; } else if ("familiar/delirium/" < psVar5) { _Size_00 = local_60 + -0x2d900a; } else { _Size_00 = (size_t *)0x0; } _Size = local_1c - 3; local_1c = local_1c + 0x12; memmove((void *)((int)local_60 + 0x16),psVar5,_Size); psVar5 = local_60 + 1; memcpy(psVar5,"familiar/delirium/",(size_t)_Size_00); memcpy((void *)((int)_Size_00 + (int)psVar5),(void *)((int)_Size_00 + 0xb6403e), 0x12 - (int)_Size_00); } ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)redirectedPath,(std_string *)local_2c); if ((size_t *)local_2c != extraout_EAX) { if (0xf < (uint)EStack_18) { uVar7 = (int)EStack_18 + 1; auVar8 = local_2c; if (0xfff < uVar7) { auVar8 = *(undefined1 (*) [4])((int)local_2c + -4); uVar7 = (int)EStack_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)auVar8))) goto LAB_006321d1; } operator_delete((void *)auVar8,uVar7); } local_2c = (undefined1 [4])*extraout_EAX; psStack_28 = (std_string *)extraout_EAX[1]; sStack_24 = extraout_EAX[2]; sStack_20 = extraout_EAX[3]; local_1c = extraout_EAX[4]; EStack_18 = (EntityPtr)extraout_EAX[5]; extraout_EAX[4] = 0; extraout_EAX[5] = 0xf; *(undefined1 *)extraout_EAX = 0; } if (0xf < local_30) { uVar7 = local_30 + 1; ptr = redirectedPath[0]; if (0xfff < uVar7) { ptr = *(void **)((int)redirectedPath[0] + -4); uVar7 = local_30 + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)ptr))) goto LAB_006321d1; } operator_delete(ptr,uVar7); } auVar8 = (undefined1 [4])local_2c; if (0xf < (uint)EStack_18) { auVar8 = local_2c; } resolvedPath = FileSystem::ResolvePath((byte *)auVar8); local_46 = resolvedPath != (byte *)0x0; if (resolvedPath != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } uVar7 = *(uint *)(resolvedPath + -4); qVar6 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar7; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar6 < uVar7); free(resolvedPath + -4); local_8 = (void *)((uint)local_8 & 0xffffff00); } EVar9 = local_50; unk = 0; if (local_46 != 0) { Sprite::ReplaceSpritesheet((Sprite *)local_54,(int)local_50,(std_string *)local_2c); local_45 = '\x01'; unk = extraout_CL; } local_8 = (void *)0xffffffff; if (0xf < (uint)EStack_18) { uVar7 = (int)EStack_18 + 1; auVar8 = local_2c; if (0xfff < uVar7) { auVar8 = *(undefined1 (*) [4])((int)local_2c + -4); uVar7 = (int)EStack_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)auVar8))) { LAB_006321d1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar8,uVar7); unk = extraout_CL_00; } this = local_64; local_50 = (EntityPtr)((int)EVar9 + 1); } while ((uint)local_50 < (byte *)(local_64->_sprite)._layerCount); if (local_45 != '\0') { ANM2::LoadGraphics(&local_64->_sprite,unk); } } uVar7 = Random(); poofEffect = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); fVar10 = g_vectorOne.y * 0.5; iVar3 = *(int *)poofEffect; (poofEffect->_sprite)._scale.x = g_vectorOne.x * 0.5; (poofEffect->_sprite)._scale.y = fVar10; (**(code **)(iVar3 + 0xc))(); EVar9 = this->_sirenHelper; pEVar1 = &this->_sirenHelper; if (EVar9 != oldSirenHelper) { if (EVar9 != (EntityPtr)0x0) { local_64 = (Entity_Familiar *)pEVar1; std::multiset::erase(&local_64); } *pEVar1 = oldSirenHelper; EVar9 = (EntityPtr)0x0; if (oldSirenHelper != (EntityPtr)0x0) { std::multiset::insert(pEVar1); EVar9 = *pEVar1; } } this->_sirenOriginalPlayer = (void *)local_68; if (EVar9 != (EntityPtr)0x0) { EVar2 = (EntityPtr)((int)EVar9 + 0x3c4); if (*(int *)((int)EVar9 + 0x3c4) != 0) { local_68 = EVar2; std::multiset::erase(&local_68); } *(Entity_Familiar **)EVar2 = this; std::multiset::insert(EVar2); } this->_isLilDelirium = 1; ExceptionList = local_10; return; } //@@ 006322f0 Entity_Familiar::init_lil_harbinger_sprite /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ECX familiar: clamps subtype (+0x30) to 0..4 ("[err] Wrong Harbinger subtype %u!"), replaces each spritesheet layer with the per-subtype gfx/familiar/familiar_122_mini*.png, LoadGraphics and plays "FloatDown"; called from Entity_Familiar::Init and ai_lil_harbingers */ void __thiscall Entity_Familiar::init_lil_harbinger_sprite(Entity_Familiar *this) { byte *pbVar1; byte bVar2; uint uVar3; uint uVar4; byte *pbVar5; uint extraout_ECX; void *ptr; uint extraout_ECX_00; char *wantedAnimName; uint layerId; bool isLess; std_string sheetPath; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6ebd; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&sheetPath + 0x28U; ExceptionList = &local_10; uVar3 = this->_subtype; if (4 < uVar3) { KAGE_LogMessage(0x10,(byte *)"[err] Wrong Harbinger subtype %u!\n"); uVar3 = this->_subtype; } uVar3 = -(uint)(uVar3 != 0) & uVar3; uVar4 = 4; if (uVar3 < 4) { uVar4 = uVar3; } layerId = 0; this->_subtype = uVar4; if ((this->_sprite)._layerCount != 0) { do { sheetPath._size = 0; sheetPath._capacity = 0xf; uVar4 = -(uint)(this->_subtype != 0) & this->_subtype; sheetPath._buf._0_4_ = (void *)0x0; uVar3 = 4; if (uVar4 < 4) { uVar3 = uVar4; } pbVar1 = (&PTR_s_gfx_familiar_familiar_122_miniwa_00b64890)[uVar3]; pbVar5 = pbVar1; do { bVar2 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar2 != 0); std::string::assign(sheetPath._buf,pbVar1,(int)pbVar5 - (int)(pbVar1 + 1)); local_8 = 0; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,layerId,&sheetPath); local_8 = 0xffffffff; uVar3 = extraout_ECX; if (0xf < sheetPath._capacity) { uVar3 = sheetPath._capacity + 1; ptr = (void *)sheetPath._buf._0_4_; if (0xfff < uVar3) { ptr = *(void **)(sheetPath._buf._0_4_ + -4); uVar3 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); uVar3 = extraout_ECX_00; } layerId = layerId + 1; } while (layerId < (uint)(this->_sprite)._layerCount); } ANM2::LoadGraphics(&this->_sprite,(byte)uVar3); pbVar1 = (this->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar5 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar5 = *(byte **)pbVar1; } wantedAnimName = "FloatDown"; do { bVar2 = *pbVar5; isLess = bVar2 < (byte)*wantedAnimName; if (bVar2 != *wantedAnimName) { LAB_00632450: uVar3 = -(uint)isLess | 1; goto LAB_00632455; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; isLess = bVar2 < (byte)wantedAnimName[1]; if (bVar2 != wantedAnimName[1]) goto LAB_00632450; pbVar5 = pbVar5 + 2; wantedAnimName = wantedAnimName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00632455: if ((uVar3 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00632488; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"FloatDown",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00632488: uVar4 = -(uint)(this->_subtype != 0) & this->_subtype; uVar3 = 4; if (uVar4 < 4) { uVar3 = uVar4; } this->_collisionDamage = *(float *)(&DAT_00b64878 + uVar3 * 4); ExceptionList = local_10; return; } //@@ 006324d0 Entity_Familiar::render_charge_indicator /* DB: ? called from Entity_Familiar::Render; plays Charging/Charged/StartCharged/Disappear on ANM2 at +0xdcc from charge timer +0xd4c, apply_forgotten_lullaby, NetplayManager::IsIdxLocalPlayer */ void __thiscall Entity_Familiar::render_charge_indicator(Entity_Familiar *this,float *param_2) { byte bVar1; int iVar2; EntityPtr rootSpawner; int iVar3; float10 weaponCharge; float chargePercent; char *anim; Vector local_10; void *chargeAnimData; if ((g_manager->_optionsConfig)._enableChargeBars == 0) { return; } iVar2 = this->_variant; iVar3 = 0; if (iVar2 == 0x50) { if (this->_weapon != (int *)0x0) { weaponCharge = (float10)(**(code **)(*(int *)this->_weapon + 0x1c))(); local_10.x = (float)weaponCharge; if (0.0 < local_10.x) { chargePercent = local_10.x * 100.0; goto LAB_006326d0; } } LAB_0063263a: if ((this->_chargeBarSprite)._animState._animData != (void *)0x0) { anim = "Disappear"; LAB_00632650: ANM2::Play(&this->_chargeBarSprite,(byte *)anim,0); goto LAB_00632655; } } else { if (((iVar2 != 0x3d) && (iVar2 != 0x6c)) && (iVar2 != 0xe6)) { if (iVar2 == 0x57) { if (this->_state == 0) { chargePercent = (float)this->_fireCooldown / 90.0; goto LAB_006326b8; } } else { if (iVar2 == 0x7d) { iVar2 = this->_fireCooldown; if (iVar2 < 0) { chargePercent = 0.0; } else { iVar3 = apply_forgotten_lullaby(this,0x1e); chargePercent = (1.0 - (float)iVar2 / (float)iVar3) * 100.0; if (chargePercent <= 0.0) { chargePercent = 0.0; } } goto LAB_006326c8; } if (iVar2 == 0x3e) { chargePercent = (float)this->_fireCooldown / 30.0; goto LAB_006326b8; } } goto LAB_0063263a; } iVar2 = this->_fireCooldown; iVar3 = apply_forgotten_lullaby(this,0x1e); local_10.x = 1.0 - (float)(iVar2 + 1) / (float)iVar3; iVar2 = apply_forgotten_lullaby(this,0x1e); if (this->_fireCooldown == iVar2) { iVar3 = 0; goto LAB_0063263a; } chargePercent = local_10.x; LAB_006326b8: chargePercent = chargePercent * 100.0; if (chargePercent <= 0.0) { chargePercent = 0.0; } LAB_006326c8: if (100.0 <= chargePercent) { chargePercent = 100.0; } LAB_006326d0: iVar3 = (int)chargePercent; if (iVar3 == 0) goto LAB_0063263a; if (iVar3 == 100) { chargeAnimData = (this->_chargeBarSprite)._animState._animData; if (chargeAnimData != (void *)0x0) { if (*(char *)((int)chargeAnimData + 0x34) == '\0') { if ((this->_chargeBarSprite)._animState._isPlaying == 0) goto LAB_0063270c; goto LAB_00632723; } goto LAB_00632655; } LAB_0063270c: ANM2::Play(&this->_chargeBarSprite,(byte *)"StartCharged",0); if ((this->_chargeBarSprite)._animState._animData != (void *)0x0) { LAB_00632723: if ((this->_chargeBarSprite)._animState._isPlaying != 0) goto LAB_00632655; } anim = "Charged"; goto LAB_00632650; } bVar1 = ANM2::SetAnimation(&this->_chargeBarSprite,(byte *)"Charging",1); if (((bVar1 != 0) && ((this->_chargeBarSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_chargeBarSprite)._animState,(float)iVar3), (this->_chargeBarSprite)._animState._animData != (void *)0x0)) { (this->_chargeBarSprite)._animState._isPlaying = 0; } LAB_00632655: if (((this->_chargeBarSprite)._animState._animData != (void *)0x0) && ((this->_chargeBarSprite)._animState._isPlaying != 0)) goto LAB_00632689; } if (iVar3 < 1) { return; } if (g_game->_frameCount - this->_spawnFrame < 7) { return; } LAB_00632689: rootSpawner = this->_spawnerEntity; if (rootSpawner != (EntityPtr)0x0) { for (; *(EntityPtr *)((int)rootSpawner + 0x3c8) != (EntityPtr)0x0; rootSpawner = *(EntityPtr *)((int)rootSpawner + 0x3c8)) { } } iVar2 = __RTDynamicCast(rootSpawner,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); if (((iVar2 == 0) || (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) || (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar2 + 0x1618)), bVar1 != 0)) { local_10.x = *param_2 + 12.0; local_10.y = param_2[1] - 35.0; ANM2::Render(&this->_chargeBarSprite,&local_10,&g_vectorZero,&g_vectorZero); } return; } //@@ 00632820 Entity_Familiar::ai_lil_monstro /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Familiar::Update case 99: QueryRadius(8) for enemy, Room::CheckLine, "Attack" anim then TryFireTear burst on "Shoot" event */ void __thiscall Entity_Familiar::ai_lil_monstro(Entity_Familiar *this) { EntityPtr EVar1; code *pcVar2; qword qVar3; byte bVar4; int iVar5; byte *curAnimName; Entity *spawned; Entity_Tear *tear; char *attackAnimName; byte *flyAnimName; qword *allocCounter; uint uVar6; bool isLess; float dirLength; float fVar7; float dirX; undefined4 uVar8; TypeDescriptor *pTVar9; TypeDescriptor *pTVar10; undefined4 uVar11; EntityList_EL nearbyEnemies; Entity_Familiar *self; Vector local_90; Vector local_88; float local_80; undefined1 tearHitParams [104]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; void *curAnimData; EntityPtr *targetRef; local_8 = 0xffffffff; puStack_c = &LAB_00af6f00; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(tearHitParams + 0x78); ExceptionList = &local_10; self = this; iVar5 = apply_forgotten_lullaby(this,0x1e); bVar4 = Entity::IsFrame((Entity *)this,iVar5,0); if (bVar4 != 0) { local_90.y = 0.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEnemies,&this->_pos,150.0,8); uVar6 = 0; local_8 = 0; if (nearbyEnemies._size != 0) { do { EVar1 = *(EntityPtr *)((int)nearbyEnemies._data + uVar6 * 4); bVar4 = Entity::IsVulnerableEnemy((Entity *)EVar1,(Entity *)0x0); if (((bVar4 != 0) && (bVar4 = Entity::IsDescendantOf((Entity *)this,(Entity *)EVar1), bVar4 == 0)) && ((*(uint *)((int)EVar1 + 0x168) & 0x20000010) == 0)) { local_88.y = *(float *)((int)EVar1 + 0x340); local_88.x = ((Vector *)((int)EVar1 + 0x33c))->x; bVar4 = Room::CheckLine(g_game->_room,&this->_pos,&local_88,3,0,0,0,(Vector *)0x0); if (bVar4 != 0) { local_90.y = (float)EVar1; } } uVar6 = uVar6 + 1; } while (uVar6 < (uint)nearbyEnemies._size); if ((EntityPtr)local_90.y != (EntityPtr)0x0) { local_88.y = ((Vector *)((int)local_90.y + 0x33c))->x - (this->_pos).x; local_80 = *(float *)((int)local_90.y + 0x340) - (this->_pos).y; this->_headFrameDelay = 0xc; animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_006329dd: bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)"Attack",1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } attackAnimName = "Attack"; do { bVar4 = *curAnimName; isLess = bVar4 < (byte)*attackAnimName; if (bVar4 != *attackAnimName) { LAB_006329c7: uVar6 = -(uint)isLess | 1; goto LAB_006329cc; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < (byte)attackAnimName[1]; if (bVar4 != attackAnimName[1]) goto LAB_006329c7; curAnimName = curAnimName + 2; attackAnimName = attackAnimName + 2; } while (bVar4 != 0); uVar6 = 0; LAB_006329cc: if ((uVar6 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_006329dd; } (this->_sprite)._flipX = local_88.y < 0.0; dirLength = sqrtf(local_80 * local_80 + local_88.y * local_88.y); fVar7 = local_80; dirX = local_88.y; if (0.0 < dirLength) { fVar7 = local_80 * (1.0 / dirLength); dirX = local_88.y * (1.0 / dirLength); } targetRef = &this->_target; (this->_targetPosition).x = dirX * 8.0; (this->_targetPosition).y = fVar7 * 8.0; if (*targetRef != (EntityPtr)0x0) { local_88.y = (float)targetRef; std::multiset::erase(&local_88.y); } *targetRef = (EntityPtr)local_90.y; std::multiset::insert(targetRef); } } local_8 = 0xffffffff; if (nearbyEnemies._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEnemies._data != (void *)0x0) { uVar6 = *(uint *)((int)nearbyEnemies._data + -4); qVar3 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar6; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar3 < uVar6); free((void *)((int)nearbyEnemies._data + -4)); } local_8 = 0xffffffff; } } if (this->_headFrameDelay < 1) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } flyAnimName = s_Fly; do { bVar4 = *curAnimName; isLess = bVar4 < *flyAnimName; if (bVar4 != *flyAnimName) { LAB_00632b48: uVar6 = -(uint)isLess | 1; goto LAB_00632b4d; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < flyAnimName[1]; if (bVar4 != flyAnimName[1]) goto LAB_00632b48; curAnimName = curAnimName + 2; flyAnimName = flyAnimName + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00632b4d: if ((uVar6 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00632b80; } bVar4 = ANM2::SetAnimation(&this->_sprite,s_Fly,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } else { this->_headFrameDelay = this->_headFrameDelay + -1; } LAB_00632b80: if (((this->_sprite)._animState._animData != (void *)0x0) && (bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Shoot"), bVar4 != 0)) { local_90.x = (this->_targetPosition).x; EVar1 = this->_target; local_90.y = (this->_targetPosition).y; if (EVar1 != (EntityPtr)0x0) { local_88.y = *(float *)((int)EVar1 + 0x33c) - (this->_pos).x; local_80 = *(float *)((int)EVar1 + 0x340) - (this->_pos).y; dirLength = sqrtf(local_88.y * local_88.y + local_80 * local_80); targetRef = (EntityPtr *)local_88.y; fVar7 = local_80; if (0.0 < dirLength) { targetRef = (EntityPtr *)(local_88.y * (1.0 / dirLength)); fVar7 = local_80 * (1.0 / dirLength); } local_90.x = (float)targetRef * 10.0; local_90.y = fVar7 * 10.0; } uVar6 = Random(); uVar11 = 0; pTVar10 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar9 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar8 = 0; spawned = Game::Spawn(g_game,2,0,&this->_pos,&local_90,(Entity *)this,0,uVar6); tear = (Entity_Tear *)__RTDynamicCast(spawned,uVar8,pTVar9,pTVar10,uVar11); tear->_fallingSpeed = 1.2; local_88.y = apply_tear_modifiers(this); fVar7 = apply_tear_modifiers(this); local_80 = fVar7 * 0.2 + 0.7; pcVar2 = *(code **)(*(int *)tear + 0x40); uVar6 = Random(); iVar5 = Entity_Player::GetTearHitParams(tearHitParams,1,0x3f800000,(uVar6 & 1) * 2 + -1,0); (*pcVar2)(local_88.y * *(float *)(iVar5 + 0x48)); fVar7 = local_80; if (local_80 <= 0.01) { fVar7 = 0.01; } tear->_baseScale = fVar7; tear->_fScale = fVar7; Entity_Tear::ResetSpriteScale(tear); this = self; TryFireTear(self,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); } curAnimData = (this->_sprite)._animState._animData; if ((curAnimData != (void *)0x0) && (*(char *)((int)curAnimData + 0x34) != '\0')) { (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; } ExceptionList = local_10; return; } //@@ 00632d90 Entity_Familiar::ai_variant_111 /* DB: ? Entity_Familiar::Update case variant 111: wanders to Room::GetRandomPosition, vector path, GridEntity::IsBreakableRock, LerpAngleDeg, Level::GetRoomByIdx on grid +0x394, sounds */ void __thiscall Entity_Familiar::ai_variant_111(Entity_Familiar *this) { int iVar1; Entity_Familiar *pEVar2; byte isBreakableRock; RoomDescriptor *doorTargetRoom; uint rngResult; int iVar3; Vector *randomPos; float *pfVar4; int extraout_ECX; int extraout_EDX; void *freePtr; float *pfVar5; Game *game; float *candidatesEnd; uint rngResult; float fVar7; float fVar8; float *local_2c; Vector scratchVec; Entity_Familiar *local_1c; void *local_18; float *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; GridEntity *rockGrid; local_8 = 0xffffffff; puStack_c = &LAB_00af5d8d; local_10 = ExceptionList; ExceptionList = &local_10; if ((((this->_targetPosition).x != g_vectorZero.x) || ((this->_targetPosition).y != g_vectorZero.y)) || (1 < this->_state)) goto LAB_00633192; candidatesEnd = (float *)0x0; local_2c = (float *)0x0; local_8 = 0; local_18 = (void *)0x0; pfVar4 = (float *)((int)g_game->_room + 0x724); game = g_game; local_1c = this; local_14 = pfVar4; do { iVar3 = *(int *)((int)pfVar4 + (int)local_18 * 4); if (iVar3 != 0) { if (*(int *)(iVar3 + 0xc) != 2) { if (*(int *)(iVar3 + 0x160) == 7) { LAB_00632e6b: doorTargetRoom = Level::GetRoomByIdx((Level *)game,*(int *)(iVar3 + 0x394),-1); game = g_game; pfVar4 = local_14; if (doorTargetRoom->VisitedCount != 0) goto LAB_00632f15; iVar3 = *(int *)(*(int *)((int)local_14 + (int)local_18 * 4) + 0x24); iVar1 = *(int *)((int)g_game->_room + 0xc); scratchVec.x = (float)(iVar3 % iVar1) * 40.0 + 40.0; scratchVec.y = (float)(iVar3 / iVar1) * 40.0 + 120.0; if (candidatesEnd == (float *)0x0) { std::vector::_Emplace_reallocate(0,&scratchVec); game = g_game; candidatesEnd = local_2c; } else { *candidatesEnd = scratchVec.x; candidatesEnd[1] = scratchVec.y; local_2c = candidatesEnd + 2; candidatesEnd = local_2c; } } else if (*(int *)(iVar3 + 0x160) == 8) goto LAB_00632e6b; pfVar4 = local_14; } } LAB_00632f15: this = local_1c; pfVar5 = (float *)0x0; fVar7 = 40.0; fVar8 = 120.0; local_18 = (void *)((int)local_18 + 1); } while (local_18 < 8); local_14 = pfVar5; if (((((game->_levelStateFlags & 0x2000U) == 0) && (iVar3 = *(int *)((int)game->_room + 0x768), -1 < iVar3)) && ((iVar3 < 0x1c0 && ((rockGrid = *(GridEntity **)((int)game->_room + iVar3 * 4 + 0x24), rockGrid != (GridEntity *)0x0 && (isBreakableRock = GridEntity::IsBreakableRock(rockGrid), isBreakableRock != 0)))))) && (*(int *)(extraout_ECX + 0xc) != 2)) { iVar3 = *(int *)((int)game->_room + 0xc); scratchVec.x = (float)(extraout_EDX % iVar3) * fVar7 + fVar7; scratchVec.y = (float)(extraout_EDX / iVar3) * fVar7 + fVar8; if (candidatesEnd == local_14) { std::vector::_Emplace_reallocate(candidatesEnd,&scratchVec); local_14 = (float *)0x0; game = g_game; candidatesEnd = local_2c; } else { *candidatesEnd = scratchVec.x; candidatesEnd[1] = scratchVec.y; local_2c = candidatesEnd + 2; candidatesEnd = local_2c; } } iVar3 = *(int *)((int)game->_room + 0x764); if (-1 < iVar3) { if (iVar3 < 0x1c0) { iVar1 = *(int *)((int)game->_room + iVar3 * 4 + 0x24); if (iVar1 != 0) { if (*(int *)(iVar1 + 4) != 4) { if (*(int *)(iVar1 + 4) != 0x16) goto LAB_0063308e; } if (*(int *)(iVar1 + 0xc) != 2) { iVar1 = *(int *)((int)game->_room + 0xc); scratchVec.x = (float)(iVar3 % iVar1) * 40.0 + 40.0; scratchVec.y = (float)(iVar3 / iVar1) * 40.0 + 120.0; this = local_1c; if (candidatesEnd == local_14) { std::vector::_Emplace_reallocate(candidatesEnd,&scratchVec); local_14 = (float *)0x0; game = g_game; candidatesEnd = local_2c; } else { *candidatesEnd = scratchVec.x; candidatesEnd[1] = scratchVec.y; candidatesEnd = candidatesEnd + 2; } } } } } LAB_0063308e: manager = g_manager; rngResult = (int)candidatesEnd >> 3; local_18 = (void *)0x0; if (rngResult == 0) { this->_state = 2; randomPos = Room::GetRandomPosition(game->_room,&scratchVec,0.0); (this->_targetPosition).x = randomPos->x; (this->_targetPosition).y = randomPos->y; } else { local_1c = (Entity_Familiar *)0x392; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&manager->_sfxManager,(int)local_1c,1.0,2,0,1.0,0.0); rngResult = Random(); pfVar4 = (float *)((int)local_18 + (rngResult % rngResult) * 8); (this->_targetPosition).x = *pfVar4; (this->_targetPosition).y = pfVar4[1]; this->_state = (uint)(rngResult == 1); } this->_fireCooldown = 0x96; local_8 = 0xffffffff; if (local_18 != (void *)0x0) { rngResult = (int)local_14 - (int)local_18 & 0xfffffff8; freePtr = local_18; if (0xfff < rngResult) { freePtr = *(void **)((int)local_18 + -4); rngResult = rngResult + 0x23; if (0x1f < (uint)((int)local_18 + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,rngResult); } LAB_00633192: if (this->_state == 2) { local_18 = (void *)(this->_velocity).x; fVar7 = (this->_velocity).y; local_14 = (float *)((this->_targetPosition).x - (this->_pos).x); if (1.0 <= (float)local_18 * (float)local_18 + fVar7 * fVar7) { local_1c = (Entity_Familiar *)((this->_targetPosition).y - (this->_pos).y); rngResult = Random(); local_18 = (void *)((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 0.2 + 0.1); scratchVec.y = atan2f((float)local_1c,(float)local_14); scratchVec.y = scratchVec.y * 57.295776; fVar7 = atan2f((this->_velocity).y,(this->_velocity).x); fVar7 = LerpAngleDeg(fVar7 * 57.295776,scratchVec.y,(float)local_18); local_18 = (void *)(fVar7 * 0.017453292); scratchVec.y = 0.5; local_1c = (Entity_Familiar *) sqrtf((float)local_1c * (float)local_1c + (float)local_14 * (float)local_14); pfVar4 = &scratchVec.y; if ((float)local_1c <= 0.5) { pfVar4 = (float *)&local_1c; } fVar7 = cos((float)local_18); (this->_velocity).x = fVar7 * (float)*pfVar4 + (this->_velocity).x; fVar7 = sin((float)local_18); (this->_velocity).y = fVar7 * (float)*pfVar4 + (this->_velocity).y; } else { local_1c = (Entity_Familiar *)((this->_targetPosition).y - (this->_pos).y); fVar7 = sqrtf((float)local_14 * (float)local_14 + (float)local_1c * (float)local_1c); if (fVar7 <= 0.0) { pEVar2 = local_1c; pfVar4 = local_14; } else { pEVar2 = (Entity_Familiar *)((0.5 / fVar7) * (float)local_1c); pfVar4 = (float *)((float)local_14 * (0.5 / fVar7)); } (this->_velocity).y = (float)pEVar2 + (this->_velocity).y; (this->_velocity).x = (float)local_18 + (float)pfVar4; } this->_friction = this->_friction * 0.8; if ((0 < this->_fireCooldown) && (iVar3 = this->_fireCooldown + -1, this->_fireCooldown = iVar3, iVar3 == 0)) { randomPos = Room::GetRandomPosition(g_game->_room,&scratchVec,0.0); (this->_targetPosition).x = randomPos->x; (this->_targetPosition).y = randomPos->y; rngResult = Random(); this->_fireCooldown = (rngResult % 3 + 1) * 0x1e; ExceptionList = local_10; return; } } else { local_1c = (Entity_Familiar *)((this->_targetPosition).x - (this->_pos).x); local_18 = (void *)((this->_targetPosition).y - (this->_pos).y); fVar7 = (float)local_18 * (float)local_18 + (float)local_1c * (float)local_1c; if ((1.0 < fVar7) && (fVar7 = sqrtf(fVar7), 0.0 < fVar7)) { local_18 = (void *)((float)local_18 * (1.0 / fVar7)); local_1c = (Entity_Familiar *)((1.0 / fVar7) * (float)local_1c); } (this->_velocity).x = (float)local_1c + (this->_velocity).x; fVar7 = this->_friction; (this->_velocity).y = (float)local_18 + (this->_velocity).y; this->_friction = fVar7 * 0.8; if ((0 < this->_fireCooldown) && (iVar3 = this->_fireCooldown + -1, this->_fireCooldown = iVar3, iVar3 == 0)) { (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; } } ExceptionList = local_10; return; } //@@ 00633500 Entity_Familiar::update_angry_fly /* DB: own log "[err] Angry Fly - Got a null target!"; called from Entity_Familiar::Update; QuerySublist for IsVulnerableEnemy target, orbit math (sin/cos/fmodf) */ void __thiscall Entity_Familiar::update_angry_fly(Entity_Familiar *this) { qword qVar1; byte bVar2; char cVar3; EntityPtr EVar4; uint rngResult; undefined4 *puVar5; int iVar6; qword *allocCounter; EntityPtr *targetSlot; uint uVar7; void *ptr; bool isExcluded; float fVar8; EntityList_EL entityList; EntityPtr *local_24; Entity_Familiar *local_20; EntityPtr newTarget; void *room; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *candidatesData; int entityType; Entity_Familiar *otherFly; local_8 = 0xffffffff; puStack_c = &LAB_00af6f45; local_10 = ExceptionList; ExceptionList = &local_10; EVar4 = this->_target; targetSlot = &this->_target; local_24 = targetSlot; local_20 = this; if (EVar4 != (EntityPtr)0x0) { if (EVar4 == (EntityPtr)this->_player) { bVar2 = Entity::IsFrame((Entity *)this,0x1e,this->_index); if (bVar2 != 0) goto LAB_0063357f; EVar4 = *targetSlot; } bVar2 = Entity::IsVulnerableEnemy((Entity *)EVar4,(Entity *)0x0); if ((bVar2 != 0) || (bVar2 = Entity::IsFrame((Entity *)this,0x96,this->_index), bVar2 == 0)) goto LAB_00633702; } LAB_0063357f: newTarget = (EntityPtr)this->_player; entityList._data = (void *)0x0; entityList._capacity = 0; entityList._size = 0; room = g_game->_room; local_8 = 0; std::vector::_Reallocate(0x20); uVar7 = 0; puVar5 = (undefined4 *)entityList._capacity; if (*(int *)((int)room + 0x1264) != 0) { do { iVar6 = *(int *)(*(int *)((int)room + 0x125c) + uVar7 * 4); local_14 = (undefined4 *)(*(int *)((int)room + 0x125c) + uVar7 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)(iVar6 + 0x28) != 1)) { entityType = *(int *)(iVar6 + 0x28); if ((entityType - 10U < 0x3de) && (((entityType != 0x21 && (entityType != 0x11)) && (entityType != 0x124)))) { if (entityType == 0x375) { isExcluded = *(int *)(iVar6 + 0x2c) == 10; } else { if ((entityType == 0x3c0) || (entityType == 0x3c5)) goto LAB_00633662; isExcluded = entityType == 0xf5; } if (!isExcluded) goto LAB_0063363b; } } else { LAB_0063363b: if (*(char *)(iVar6 + 0x173) == '\0') { if (puVar5 == (undefined4 *)entityList._size) { std::vector::_Emplace_reallocate(puVar5,local_14); puVar5 = (undefined4 *)entityList._capacity; } else { *puVar5 = *local_14; entityList._capacity = (int)(puVar5 + 1); puVar5 = (undefined4 *)entityList._capacity; } } } LAB_00633662: uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)((int)room + 0x1264)); } candidatesData = entityList._data; uVar7 = (int)puVar5 - (int)entityList._data >> 2; if (uVar7 != 0) { rngResult = Random(); newTarget = *(EntityPtr *)((int)candidatesData + (rngResult % uVar7) * 4); } targetSlot = local_24; if (*local_24 != (EntityPtr)0x0) { std::multiset::erase(&local_24); } *targetSlot = newTarget; if (newTarget != (EntityPtr)0x0) { std::multiset::insert(targetSlot); } local_8 = 0xffffffff; if (candidatesData != (void *)0x0) { uVar7 = (entityList._size - (int)candidatesData >> 2) * 4; ptr = candidatesData; if (0xfff < uVar7) { ptr = *(void **)((int)candidatesData + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)candidatesData + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } this = local_20; LAB_00633702: if (*targetSlot == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"[err] Angry Fly - Got a null target!\n"); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&entityList,this->_type,this->_variant,-1,1 ,0); local_8 = 1; puVar5 = (undefined4 *)0x0; local_14 = (undefined4 *)0x0; iVar6 = 1; if ((undefined4 *)entityList._size != (undefined4 *)0x0) { do { otherFly = *(Entity_Familiar **)((int)entityList._data + (int)puVar5 * 4); if (otherFly == this) { local_14 = puVar5; } else if (otherFly->_target == *targetSlot) { iVar6 = iVar6 + 1; } puVar5 = (undefined4 *)((int)puVar5 + 1); } while (puVar5 < (uint)entityList._size); } fVar8 = ((float)(int)local_14 * 360.0) / (float)iVar6; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_20 = (Entity_Familiar *)0x42820000; local_14 = (undefined4 *)fVar8; cVar3 = (**(code **)(*(int *)*targetSlot + 0x4c))(); if ((cVar3 != '\0') && (iVar6 = g_game->_frameCount % 0x96, iVar6 < 0x1e)) { fVar8 = ABS((float)iVar6 / 30.0 - 0.5); local_20 = (Entity_Familiar *)((fVar8 + fVar8) * 65.0); } EVar4 = *targetSlot; local_24 = (EntityPtr *)(((float)g_game->_frameCount * 3.6 + (float)local_14) * 0.017453292); local_14 = (undefined4 *)sin((float)local_24); fVar8 = cos((float)local_24); local_14 = (undefined4 *) ((((float)local_14 * (float)local_20 + *(float *)((int)EVar4 + 0x340)) - (this->_pos).y ) * 0.22); local_24 = (EntityPtr *) (((fVar8 * (float)local_20 + *(float *)((int)EVar4 + 0x33c)) - (this->_pos).x) * 0.22); (this->_velocity).y = (float)local_14; (this->_velocity).x = (float)local_24; fVar8 = (float)local_14 * (float)local_14 + (float)local_24 * (float)local_24; if ((100.0 < fVar8) && (fVar8 = sqrtf(fVar8), 0.0 < fVar8)) { (this->_velocity).x = (float)local_24 * (10.0 / fVar8); (this->_velocity).y = (float)local_14 * (10.0 / fVar8); } if (entityList._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (entityList._data != (void *)0x0) { uVar7 = *(uint *)((int)entityList._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar7; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar7); free((uint *)((int)entityList._data + -4)); } } ExceptionList = local_10; return; } //@@ 00633990 familiar_wisp_pick_tear_color /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? thread-safe static init copies a table of KColors (g_tearFlagSpectral.. etc) then picks one with the RNG param ("RNG Seed is zero!") into the out color; callers Entity_Familiar::fire_wisp_projectile, Entity_Familiar::ai_lil_spewer */ void familiar_wisp_pick_tear_color(uint *param_1,undefined4 *param_2,uint *param_3) { double dVar1; code *pcVar2; int iVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; double dVar8; iVar3 = *(int *)ThreadLocalStoragePointer; if (*(int *)(iVar3 + 0xc) < DAT_00c7fd1c) { _Init_thread_header(&DAT_00c7fd1c); if (DAT_00c7fd1c == -1) { _DAT_00c7fd20 = g_tearFlagsNone; _DAT_00c7fd30 = g_tearFlagSpectral; _DAT_00c7fd40 = DAT_00c34b50; uRam00c7fd44 = DAT_00c34b54; uRam00c7fd48 = DAT_00c34b58; uRam00c7fd4c = DAT_00c34b5c; _DAT_00c7fd50 = g_tearFlagHoming; _DAT_00c7fd60 = DAT_00c34b30; uRam00c7fd64 = DAT_00c34b34; uRam00c7fd68 = DAT_00c34b38; uRam00c7fd6c = DAT_00c34b3c; _DAT_00c7fd70 = DAT_00c34850; uRam00c7fd74 = DAT_00c34854; uRam00c7fd78 = DAT_00c34858; uRam00c7fd7c = DAT_00c3485c; _DAT_00c7fd80 = DAT_00c34860; uRam00c7fd84 = DAT_00c34864; uRam00c7fd88 = DAT_00c34868; uRam00c7fd8c = DAT_00c3486c; _DAT_00c7fd90 = DAT_00c34870; uRam00c7fd94 = DAT_00c34874; uRam00c7fd98 = DAT_00c34878; uRam00c7fd9c = DAT_00c3487c; _DAT_00c7fda0 = DAT_00c34b60; uRam00c7fda4 = DAT_00c34b64; uRam00c7fda8 = DAT_00c34b68; uRam00c7fdac = DAT_00c34b6c; _DAT_00c7fdb0 = DAT_00c34b40; uRam00c7fdb4 = DAT_00c34b44; uRam00c7fdb8 = DAT_00c34b48; uRam00c7fdbc = DAT_00c34b4c; _DAT_00c7fdc0 = DAT_00c34880; uRam00c7fdc4 = DAT_00c34884; uRam00c7fdc8 = DAT_00c34888; uRam00c7fdcc = DAT_00c3488c; _DAT_00c7fdd0 = DAT_00c34b80; uRam00c7fdd4 = DAT_00c34b84; uRam00c7fdd8 = DAT_00c34b88; uRam00c7fddc = DAT_00c34b8c; _DAT_00c7fde0 = DAT_00c34c40; uRam00c7fde4 = DAT_00c34c44; uRam00c7fde8 = DAT_00c34c48; uRam00c7fdec = DAT_00c34c4c; _DAT_00c7fdf0 = DAT_00c34b20; uRam00c7fdf4 = DAT_00c34b24; uRam00c7fdf8 = DAT_00c34b28; uRam00c7fdfc = DAT_00c34b2c; _DAT_00c7fe00 = DAT_00c34890; uRam00c7fe04 = DAT_00c34894; uRam00c7fe08 = DAT_00c34898; uRam00c7fe0c = DAT_00c3489c; _DAT_00c7fe10 = DAT_00c348a0; uRam00c7fe14 = DAT_00c348a4; uRam00c7fe18 = DAT_00c348a8; uRam00c7fe1c = DAT_00c348ac; _DAT_00c7fe20 = DAT_00c348b0; uRam00c7fe24 = DAT_00c348b4; uRam00c7fe28 = DAT_00c348b8; uRam00c7fe2c = DAT_00c348bc; _DAT_00c7fe30 = DAT_00c348c0; uRam00c7fe34 = DAT_00c348c4; uRam00c7fe38 = DAT_00c348c8; uRam00c7fe3c = DAT_00c348cc; _DAT_00c7fe40 = _DAT_00c348d0; uRam00c7fe44 = _DAT_00c348d4; uRam00c7fe48 = _DAT_00c348d8; uRam00c7fe4c = _DAT_00c348dc; _DAT_00c7fe50 = _DAT_00c34ac0; uRam00c7fe54 = _DAT_00c34ac4; uRam00c7fe58 = _DAT_00c34ac8; uRam00c7fe5c = _DAT_00c34acc; _DAT_00c7fe60 = DAT_00c348e0; uRam00c7fe64 = DAT_00c348e4; uRam00c7fe68 = DAT_00c348e8; uRam00c7fe6c = DAT_00c348ec; _DAT_00c7fe70 = DAT_00c348f0; uRam00c7fe74 = DAT_00c348f4; uRam00c7fe78 = DAT_00c348f8; uRam00c7fe7c = DAT_00c348fc; _DAT_00c7fe80 = _DAT_00c34900; uRam00c7fe84 = _DAT_00c34904; uRam00c7fe88 = _DAT_00c34908; uRam00c7fe8c = DAT_00c3490c; _Init_thread_footer(&DAT_00c7fd1c); } } if (*(int *)(iVar3 + 0xc) < DAT_00c7fe90) { _Init_thread_header(&DAT_00c7fe90); if (DAT_00c7fe90 == -1) { _DAT_00c7fe98 = g_tearFlagsNone; _DAT_00c7fea8 = DAT_00c34c30; uRam00c7feac = DAT_00c34c34; uRam00c7feb0 = DAT_00c34c38; uRam00c7feb4 = DAT_00c34c3c; _DAT_00c7feb8 = g_tearFlagPoison; _DAT_00c7fec8 = DAT_00c34be0; uRam00c7fecc = DAT_00c34be4; uRam00c7fed0 = DAT_00c34be8; uRam00c7fed4 = DAT_00c34bec; _DAT_00c7fed8 = _DAT_00c34910; uRam00c7fedc = DAT_00c34914; uRam00c7fee0 = _DAT_00c34918; uRam00c7fee4 = DAT_00c3491c; _DAT_00c7fee8 = DAT_00c34c10; uRam00c7feec = DAT_00c34c14; uRam00c7fef0 = DAT_00c34c18; uRam00c7fef4 = DAT_00c34c1c; _DAT_00c7fef8 = DAT_00c34bf0; uRam00c7fefc = DAT_00c34bf4; uRam00c7ff00 = DAT_00c34bf8; uRam00c7ff04 = DAT_00c34bfc; _DAT_00c7ff08 = DAT_00c34af0; uRam00c7ff0c = DAT_00c34af4; uRam00c7ff10 = DAT_00c34af8; uRam00c7ff14 = DAT_00c34afc; _DAT_00c7ff18 = DAT_00c34c20; uRam00c7ff1c = DAT_00c34c24; uRam00c7ff20 = DAT_00c34c28; uRam00c7ff24 = DAT_00c34c2c; _DAT_00c7ff28 = DAT_00c34c00; uRam00c7ff2c = DAT_00c34c04; uRam00c7ff30 = DAT_00c34c08; uRam00c7ff34 = DAT_00c34c0c; _DAT_00c7ff38 = _DAT_00c34920; uRam00c7ff3c = DAT_00c34924; uRam00c7ff40 = _DAT_00c34928; uRam00c7ff44 = DAT_00c3492c; _DAT_00c7ff48 = DAT_00c34930; uRam00c7ff4c = DAT_00c34934; uRam00c7ff50 = DAT_00c34938; uRam00c7ff54 = DAT_00c3493c; _DAT_00c7ff58 = DAT_00c34ab0; uRam00c7ff5c = DAT_00c34ab4; uRam00c7ff60 = DAT_00c34ab8; uRam00c7ff64 = DAT_00c34abc; _DAT_00c7ff68 = DAT_00c34aa0; uRam00c7ff6c = DAT_00c34aa4; uRam00c7ff70 = DAT_00c34aa8; uRam00c7ff74 = DAT_00c34aac; _DAT_00c7ff78 = DAT_00c34a80; uRam00c7ff7c = DAT_00c34a84; uRam00c7ff80 = DAT_00c34a88; uRam00c7ff84 = DAT_00c34a8c; _DAT_00c7ff88 = DAT_00c34a60; uRam00c7ff8c = DAT_00c34a64; uRam00c7ff90 = DAT_00c34a68; uRam00c7ff94 = DAT_00c34a6c; _DAT_00c7ff98 = DAT_00c34a50; uRam00c7ff9c = DAT_00c34a54; uRam00c7ffa0 = DAT_00c34a58; uRam00c7ffa4 = DAT_00c34a5c; _DAT_00c7ffa8 = DAT_00c34a40; uRam00c7ffac = DAT_00c34a44; uRam00c7ffb0 = DAT_00c34a48; uRam00c7ffb4 = DAT_00c34a4c; _DAT_00c7ffb8 = _DAT_00c34940; uRam00c7ffbc = _DAT_00c34944; uRam00c7ffc0 = _DAT_00c34948; uRam00c7ffc4 = _DAT_00c3494c; _DAT_00c7ffc8 = DAT_00c34a20; uRam00c7ffcc = DAT_00c34a24; uRam00c7ffd0 = DAT_00c34a28; uRam00c7ffd4 = DAT_00c34a2c; _DAT_00c7ffd8 = DAT_00c34a10; uRam00c7ffdc = DAT_00c34a14; uRam00c7ffe0 = DAT_00c34a18; uRam00c7ffe4 = DAT_00c34a1c; _DAT_00c7ffe8 = DAT_00c34a00; uRam00c7ffec = DAT_00c34a04; uRam00c7fff0 = DAT_00c34a08; uRam00c7fff4 = DAT_00c34a0c; _Init_thread_footer(&DAT_00c7fe90); } } uVar6 = *param_1; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *param_1; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)param_1[1] & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)param_1[2] & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)param_1[3] & 0x1f); *param_1 = uVar6; dVar8 = (double)(int)uVar6; dVar1 = __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *param_1; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)param_1[1] & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)param_1[2] & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)param_1[3] & 0x1f); *param_1 = uVar6; uVar4 = uVar6 % 0x1a; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *param_1; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)param_1[1] & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)param_1[2] & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)param_1[3] & 0x1f); *param_1 = uVar6; uVar5 = uVar6 % 0x17; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *param_1; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)param_1[1] & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)param_1[2] & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)param_1[3] & 0x1f); *param_1 = uVar6; uVar7 = uVar6 % 0x16; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *param_1; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)param_1[1] & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)param_1[2] & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)param_1[3] & 0x1f); *param_1 = uVar6; if ((uVar6 & 1) == 0) { *param_2 = *(undefined4 *)(&DAT_00b647b0 + uVar4 * 4); iVar3 = uVar5 * 0x10; uVar6 = *(uint *)(iVar3 + 0xc7fd24); uVar4 = *(uint *)(iVar3 + 0xc7fd28); uVar5 = *(uint *)(iVar3 + 0xc7fd2c); *param_3 = *(uint *)(&DAT_00c7fd20 + iVar3); param_3[1] = uVar6; param_3[2] = uVar4; param_3[3] = uVar5; uVar6 = Random(); if ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 < ((float)(dVar8 + dVar1) * 2.3283062e-10 + 0.3) * 0.37) { iVar3 = uVar7 * 0x10; *param_3 = *param_3 | *(uint *)(&DAT_00c7fe98 + iVar3); param_3[1] = param_3[1] | *(uint *)(&DAT_00c7fe9c + iVar3); param_3[2] = param_3[2] | *(uint *)(&DAT_00c7fea0 + iVar3); param_3[3] = param_3[3] | *(uint *)(&DAT_00c7fea4 + iVar3); } } return; } //@@ 00633ea0 Entity_Familiar::apply_baby_bender_tear_params /* DB: ECX familiar (owner player at +0x410): if the player has TRINKET_BABY_BENDER 127 and the tear has no homing flag yet, ORs in homing (g_tearFlagHoming), sets purple tear color; multiplier >= 2 adds more flags, >= 3 doubles height/halves fall speed/+120 range; returns true; used by TryFireTear, Entity_Familiar::apply_baby_bender and Entity_Player::GetTearHitParams */ undefined4 __thiscall Entity_Familiar::apply_baby_bender_tear_params (Entity_Familiar *this,BitSet128 *param_2,undefined4 *param_3,float *param_4, float *param_5,float *param_6,char param_7) { uint *puVar1; undefined8 uVar2; byte bVar3; BitSet128 *pBVar4; undefined4 uVar5; int iVar6; undefined4 local_6c [8]; undefined4 local_4c; undefined4 uStack_48; undefined4 local_44; undefined4 local_40 [8]; undefined4 local_20; undefined4 uStack_1c; undefined4 local_18; BitSet128 local_14; bVar3 = Entity_Player::HasTrinket(this->_player,0x7f,0); if (bVar3 == 0) { return 0; } pBVar4 = BitSet128::operator_and(&local_14,param_2,&g_tearFlagHoming); if (((int)pBVar4->_l == 0 && *(int *)((int)&pBVar4->_l + 4) == 0) && ((int)pBVar4->_h == 0 && *(int *)((int)&pBVar4->_h + 4) == 0)) { *(uint *)¶m_2->_l = (uint)param_2->_l | (uint)g_tearFlagHoming._l; puVar1 = (uint *)((int)¶m_2->_l + 4); *puVar1 = *puVar1 | g_tearFlagHoming._l._4_4_; *(uint *)¶m_2->_h = (uint)param_2->_h | (uint)g_tearFlagHoming._h; puVar1 = (uint *)((int)¶m_2->_h + 4); *puVar1 = *puVar1 | g_tearFlagHoming._h._4_4_; if (param_7 == '\0') { local_4c = 0x3e5cdcde; uStack_48 = 0x3ca0a0a1; local_44 = 0x3ebebebf; if (param_3 == local_6c) goto LAB_00633f7c; uVar5 = 0x3ebebebf; param_3[4] = 0; param_3[5] = 0; param_3[6] = 0; param_3[7] = 0; uVar2 = 0x3ca0a0a13e5cdcde; } else { local_20 = 0x3eb4b4b5; uStack_1c = 0; local_18 = 0x3f34b4b5; if (param_3 == local_40) goto LAB_00633f7c; uVar5 = 0x3f34b4b5; param_3[4] = 0; param_3[5] = 0; param_3[6] = 0; param_3[7] = 0; uVar2 = 0x3eb4b4b5; } *(undefined8 *)(param_3 + 8) = uVar2; param_3[10] = uVar5; *param_3 = 0x3ecccccd; param_3[1] = 0x3e19999a; param_3[2] = 0x3ec28f5c; param_3[3] = 0x3f800000; } LAB_00633f7c: iVar6 = Entity_Player::GetTrinketMultiplier(this->_player,0x7f); if (1 < iVar6) { *(uint *)¶m_2->_l = (uint)param_2->_l | DAT_00c34950; puVar1 = (uint *)((int)¶m_2->_l + 4); *puVar1 = *puVar1 | DAT_00c34954; *(uint *)¶m_2->_h = (uint)param_2->_h | DAT_00c34958; puVar1 = (uint *)((int)¶m_2->_h + 4); *puVar1 = *puVar1 | DAT_00c3495c; } if (2 < iVar6) { *param_4 = *param_4 + *param_4; *param_5 = *param_5 * 0.5; *param_6 = *param_6 + 120.0; } return 1; } //@@ 00634000 Entity_Familiar::TryFireTear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Forgotten Lullaby 127 multiplier prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Familiar::TryFireTear(Entity_Familiar *this,Entity_Tear *tear) { Entity_Player *this_00; BitSet128 flags; Game *pGVar1; int iVar2; int iVar3; bool bVar4; bool bVar5; float fVar6; undefined1 auStack_68 [11]; bool local_5d; float local_5c; float local_58; float local_54; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; undefined8 local_20; float local_18; uint local_14; local_14 = __security_cookie ^ (uint)auStack_68; this_00 = this->_player; fVar6 = this_00[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar6 == 0.0) || (fVar6 != 1.77965e-43)) { iVar3 = Entity_Player::GetTrinketMultiplier(this_00,0x7f); bVar5 = false; bVar4 = iVar3 == 0; } else { if (*(char *)(this_00[1]._chargeBarSprites[0]._color._offset + 1) != '\0') { local_5d = true; goto LAB_00634064; } iVar2 = Entity_Player::GetTrinketMultiplier(this_00,0x7f); bVar5 = SBORROW4(iVar2,1); iVar3 = iVar2 + -1; bVar4 = iVar2 == 1; } bVar5 = bVar5 == iVar3 < 0; local_5d = !bVar4 && bVar5; if (bVar4 || !bVar5) { return local_5d; } LAB_00634064: local_50 = (undefined4)(tear->_tearFlags)._l; uStack_4c = *(undefined4 *)((int)&(tear->_tearFlags)._l + 4); uStack_48 = (undefined4)(tear->_tearFlags)._h; uStack_44 = *(undefined4 *)((int)&(tear->_tearFlags)._h + 4); local_18 = (tear->_sprite)._color._offset[2]; local_40 = (tear->_sprite)._color._tint[0]; fStack_3c = (tear->_sprite)._color._tint[1]; fStack_38 = (tear->_sprite)._color._tint[2]; fStack_34 = (tear->_sprite)._color._tint[3]; local_30 = (tear->_sprite)._color._colorize[0]; fStack_2c = (tear->_sprite)._color._colorize[1]; fStack_28 = (tear->_sprite)._color._colorize[2]; fStack_24 = (tear->_sprite)._color._colorize[3]; local_20 = *(undefined8 *)(tear->_sprite)._color._offset; local_5c = tear->_height; local_58 = tear->_fallingSpeed; local_54 = tear->_tearRange; apply_baby_bender_tear_params(this,&local_50,&local_40,&local_5c,&local_58,&local_54,0); flags._l._4_4_ = uStack_4c; flags._l._0_4_ = local_50; flags._h._0_4_ = uStack_48; flags._h._4_4_ = uStack_44; Entity_Tear::SetTearFlags(tear,flags); (**(code **)(*(int *)tear + 0x3c))(&local_40,0xffffffff,0xff,0,1); tear->_height = local_5c; fVar6 = Entity_Tear::get_height_offset_y(tear,local_5c); pGVar1 = g_game; (tear->_posOffset).y = fVar6; if ((*(int *)((int)pGVar1->_room + 8) == 0x10) && ((tear->_posOffset).y = -18.0, -5.1 < local_5c)) { tear->_height = -5.1; } tear->_fallingSpeed = local_58; tear->_tearRange = local_54; return local_5d; } //@@ 006341a0 Entity_Familiar::apply_baby_bender /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: if the familiar's player (+0x410) has TRINKET_BABY_BENDER (0x7f) adds homing to the tear's TearFlags (+0x428..0x434 via FUN_00633ea0) and sets its colour (vtable +0x3c), returns whether it applied; Entity_Familiar::ai_incubus_shot, FireBrimstone, fire_wisp_projectile prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Familiar::apply_baby_bender(Entity_Familiar *this,Entity_Tear *tear) { int iVar1; byte bVar2; undefined4 local_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined1 local_44 [4]; undefined1 local_40 [4]; undefined1 local_3c [4]; float local_38; float fStack_34; float fStack_30; float fStack_2c; float local_28; float fStack_24; float fStack_20; float fStack_1c; undefined8 local_18; float local_10; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); bVar2 = Entity_Player::HasTrinket(this->_player,0x7f,0); if (bVar2 != 0) { local_58 = (undefined4)(tear->_tearFlags)._l; uStack_54 = *(undefined4 *)((int)&(tear->_tearFlags)._l + 4); uStack_50 = (undefined4)(tear->_tearFlags)._h; uStack_4c = *(undefined4 *)((int)&(tear->_tearFlags)._h + 4); local_10 = (tear->_sprite)._color._offset[2]; local_38 = (tear->_sprite)._color._tint[0]; fStack_34 = (tear->_sprite)._color._tint[1]; fStack_30 = (tear->_sprite)._color._tint[2]; fStack_2c = (tear->_sprite)._color._tint[3]; local_28 = (tear->_sprite)._color._colorize[0]; fStack_24 = (tear->_sprite)._color._colorize[1]; fStack_20 = (tear->_sprite)._color._colorize[2]; fStack_1c = (tear->_sprite)._color._colorize[3]; local_18 = *(undefined8 *)(tear->_sprite)._color._offset; apply_baby_bender_tear_params(this,&local_58,&local_38,local_44,local_40,local_3c,1); iVar1 = *(int *)tear; *(undefined4 *)&(tear->_tearFlags)._l = local_58; *(undefined4 *)((int)&(tear->_tearFlags)._l + 4) = uStack_54; *(undefined4 *)&(tear->_tearFlags)._h = uStack_50; *(undefined4 *)((int)&(tear->_tearFlags)._h + 4) = uStack_4c; (**(code **)(iVar1 + 0x3c))(&local_38,0xffffffff,0xff,0,1); } return bVar2; } //@@ 00634260 Entity_Familiar::UpdateFollowPosition /* WARNING: Variable defined which should be unmapped: outOffset */ /* DB: ? follower +0xd90..0xda4, GetFollowerPriority prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity_Familiar::UpdateFollowPosition(Entity_Familiar *this,Vector *outOffset) { float fVar1; qword qVar2; char cVar3; uint uVar4; undefined4 *puVar5; void *pvVar6; Entity_Familiar *otherFamiliar; qword *allocCounter; uint listIndex; float fVar7; undefined1 *sideSign; float fVar8; undefined4 *puVar9; float fVar10; EntityList_EL familiars; int priority [2]; undefined4 *prioritySetHead; int prioritySetSize; undefined4 *local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; byte formationMode; int listEntity; puStack_20 = (undefined1 *)(priority + 0xd); local_14 = 0xffffffff; puStack_18 = &LAB_00af6f85; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(priority + 10); ExceptionList = &local_1c; cVar3 = FUN_00634920(uVar4); if (cVar3 == '\0') { pvVar6 = this->_player; if (*(uint *)((int)pvVar6 + 0x1ef0) != (uint)this->_formationMode) { (this->_formationTargetOffset).x = g_vectorZero.x; (this->_formationTargetOffset).y = g_vectorZero.y; } if (((this->_formationTargetOffset).x == g_vectorZero.x) && ((this->_formationTargetOffset).y == g_vectorZero.y)) { this->_formationMode = *(byte *)((int)pvVar6 + 0x1ef0); prioritySetHead = (undefined4 *)0x0; prioritySetSize = 0; puVar5 = operator_new(0x18); *puVar5 = puVar5; puVar5[1] = puVar5; puVar5[2] = puVar5; *(undefined2 *)(puVar5 + 3) = 0x101; local_14 = 0; local_24 = 0.0; prioritySetHead = puVar5; if (this->_formationMode != 0) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0) ; listIndex = 0; local_14 = CONCAT31(local_14._1_3_,1); if (familiars._size != 0) { pvVar6 = familiars._data; do { listEntity = *(int *)((int)pvVar6 + listIndex * 4); if ((*(char *)(listEntity + 0x173) == '\0') && (*(char *)(listEntity + 0x172) != '\0')) { cVar3 = FUN_00634920(uVar4); if ((cVar3 == '\0') && (otherFamiliar->_player == this->_player)) { priority[0] = GetFollowerPriority(otherFamiliar); FUN_00652690(&local_28,priority); } pvVar6 = familiars._data; } listIndex = listIndex + 1; } while (listIndex < (uint)familiars._size); } puVar5 = prioritySetHead; local_28 = (undefined4 *)*prioritySetHead; while ((local_28 != puVar5 && ((Entity_Familiar *)local_28[5] != this))) { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); local_24 = (float)((int)local_24 + 1); } if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar4 = *(uint *)((int)familiars._data + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar4); free((uint *)((int)familiars._data + -4)); puVar5 = prioritySetHead; } } } formationMode = this->_formationMode; if (formationMode == 1) { if (((uint)local_24 & 1) == 0) { sideSign = (undefined1 *)0x3f800000; } else { sideSign = &DAT_bf800000; } (this->_formationTargetOffset).y = 0.0; (this->_formationTargetOffset).x = (float)((int)local_24 / 2 + 1) * 32.0 * (float)sideSign; } else if (formationMode == 2) { (this->_formationTargetOffset).x = 0.0; (this->_formationTargetOffset).y = (float)&DAT_42000000; fVar7 = local_24; if (prioritySetSize != 2) { fVar7 = (float)((int)local_24 - 1); } if (-1 < (int)fVar7) { if (((uint)fVar7 & 1) == 0) { sideSign = &DAT_bf800000; } else { sideSign = (undefined1 *)0x3f800000; } fVar7 = (float)((int)fVar7 / 2 + 1) * 24.0 * (float)sideSign + 0.0; (this->_formationTargetOffset).x = fVar7; (this->_formationTargetOffset).y = (this->_formationTargetOffset).y - ABS(fVar7); } } else if (formationMode == 3) { local_28 = (undefined4 *) ((360.0 / (float)((double)prioritySetSize + __uint_to_double_fixup[-(prioritySetSize >> 0x1f)])) * (float)(int)local_24 * 0.017453292); local_24 = cos((float)local_28); fVar7 = sin((float)local_28); (this->_formationTargetOffset).x = local_24 * 0.0 - fVar7 * 54.0; (this->_formationTargetOffset).y = fVar7 * 0.0 + local_24 * 54.0; } else { fVar10 = (this->_pos).x - *(float *)((int)this->_player + 0x33c); fVar7 = (this->_pos).y - *(float *)((int)this->_player + 0x340); (this->_formationTargetOffset).x = fVar10; (this->_formationTargetOffset).y = fVar7; (this->_formationOffset).x = fVar10; (this->_formationOffset).y = fVar7; } FID_conflict__Erase_tree_>_> (&prioritySetHead, (fuzzer_allocator_> *)&prioritySetHead, (_Tree_node *)puVar5[1]); operator_delete(prioritySetHead,0x18); } fVar7 = (this->_formationOffset).x; fVar10 = (this->_formationTargetOffset).x; if ((fVar7 != fVar10) || ((this->_formationOffset).y != (this->_formationTargetOffset).y)) { fVar8 = (this->_formationOffset).y; fVar1 = (this->_formationTargetOffset).y; (this->_formationOffset).x = (fVar10 - fVar7) * 0.1 + fVar7; (this->_formationOffset).y = (fVar1 - fVar8) * 0.1 + fVar8; } fVar8 = 0.0; local_24 = 0.0; fVar7 = *(float *)((int)this->_player + 0x1630); fVar10 = *(float *)((int)this->_player + 0x1634); if (this->_formationMode != 0) { if (0.1 < fVar7 * fVar7 + fVar10 * fVar10) { fVar7 = atan2f(fVar10,fVar7); fVar8 = fVar7 * 57.295776 - 90.0; } local_24 = fVar8; } puVar5 = (undefined4 *)this->_formationAngle; puVar9 = puVar5; if ((float)puVar5 < 0.0) { puVar9 = (undefined4 *)((uint)puVar5 ^ 0x80000000); } if (360.0 < (float)puVar9) { puVar5 = (undefined4 *)fmodf((float)puVar5,360.0); } if ((float)puVar5 <= 180.0) { if ((float)puVar5 < -180.0) { puVar5 = (undefined4 *)((float)puVar5 + 360.0); } } else { puVar5 = (undefined4 *)((float)puVar5 - 360.0); } fVar7 = local_24; if (local_24 < 0.0) { fVar7 = -local_24; } fVar10 = local_24; local_28 = puVar5; if (360.0 < fVar7) { fVar10 = fmodf(local_24,360.0); } if (fVar10 <= 180.0) { if (fVar10 < -180.0) { fVar10 = fVar10 + 360.0; } } else { fVar10 = fVar10 - 360.0; } fVar7 = fVar10 - (float)local_28; if (fVar7 < 0.0) { fVar7 = -fVar7; } puVar5 = local_28; if (180.0 < fVar7) { if (fVar10 <= (float)local_28) { fVar10 = fVar10 + 360.0; } else { puVar5 = (undefined4 *)((float)local_28 + 360.0); } } fVar10 = (fVar10 - (float)puVar5) * 0.1 + (float)puVar5; fVar7 = fVar10; if (fVar10 < 0.0) { fVar7 = -fVar10; } if (360.0 < fVar7) { fVar10 = fmodf(fVar10,360.0); } if (fVar10 <= 180.0) { if (fVar10 < -180.0) { fVar10 = fVar10 + 360.0; } } else { fVar10 = fVar10 - 360.0; } this->_formationAngle = fVar10; local_24 = fVar10 * 0.017453292; local_28 = (undefined4 *)cos(local_24); fVar8 = sin(local_24); fVar7 = (this->_formationOffset).x; fVar10 = (this->_formationOffset).y; outOffset->x = (float)local_28 * fVar7 - fVar8 * fVar10; outOffset->y = (float)local_28 * fVar10 + fVar8 * fVar7; } else { outOffset->x = g_vectorZero.x; outOffset->y = g_vectorZero.y; } ExceptionList = local_1c; return outOffset; } //@@ 006348d0 Entity_Familiar::reset_follow_target /* DB: ? resets 0xd90..0xda4 to zero vector, 0xda4=0xff */ void __thiscall Entity_Familiar::reset_follow_target(Entity_Familiar *this) { (this->_formationTargetOffset).x = g_vectorZero.x; (this->_formationTargetOffset).y = g_vectorZero.y; (this->_formationOffset).x = (this->_formationTargetOffset).x; (this->_formationOffset).y = (this->_formationTargetOffset).y; this->_formationAngle = 0.0; this->_formationMode = 0xff; return; } //@@ 00634920 FUN_00634920 undefined4 FUN_00634920(void) { int in_ECX; switch(*(undefined4 *)(in_ECX + 0x2c)) { case 8: case 0xd: case 0xe: case 0x10: case 0x11: case 0x18: case 0x2a: case 0x2b: case 0x35: case 0x38: case 0x3a: case 0x3e: case 0x3f: case 0x40: case 0x42: case 0x43: case 0x49: case 0x4b: case 0x55: case 0x57: case 0x58: case 0x5a: case 0x5e: case 0x60: case 0x6a: case 0x6e: case 0x6f: case 0x76: case 0x7a: case 0x7f: case 200: case 0xd2: case 0xd3: case 0xd4: case 0xe1: case 0xe9: case 0xeb: case 0xec: case 0xef: case 0xf1: break; default: if (*(char *)(in_ECX + 0xd77) == '\0') { return 0; } } return 1; } //@@ 00634a40 Entity_Familiar::ResolveOrbitConflict /* DB: ? +0xda4 orbit, compares +0x410 */ void __thiscall Entity_Familiar::ResolveOrbitConflict(Entity_Familiar *this) { char cVar1; uint uVar2; int extraout_ECX; uint uVar3; uint extraout_EDX; EntityList_EL local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (this->_formationMode != 0) { cVar1 = FUN_00634920(uVar2); if (cVar1 == '\0') { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_20,3,-1,-1,0,0); uVar3 = 0; if (local_20._size != 0) { do { if (*(Entity_Familiar **)((int)local_20._data + uVar3 * 4) != this) { cVar1 = FUN_00634920(uVar2); uVar3 = extraout_EDX; if ((cVar1 == '\0') && (*(void **)(extraout_ECX + 0x410) == this->_player)) { *(undefined1 *)(extraout_ECX + 0xda4) = 0xff; } } uVar3 = uVar3 + 1; } while (uVar3 < (uint)local_20._size); } if (local_20._0_1_ == '\0') { local_8 = 0; tracked_alloc(1,local_20._data,0); } } } ExceptionList = local_10; return; } //@@ 00634b10 Entity_Familiar::ai_lil_spewer /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Familiar::Update case 0x77: FollowParent, TryFireTear, Sprite::ReplaceSpritesheet + LoadGraphics picked by RNG (pill-colour style), convert_shot_for_enemy_owner, forgotten lullaby */ void __thiscall Entity_Familiar::ai_lil_spewer(Entity_Familiar *this) { code *pcVar1; BitSet128 flags; byte bVar2; int iVar3; Entity *spawned; Entity_Tear *tear; byte rngShift2; byte rngShift3; void *pvVar4; void *extraout_ECX; uint babyIdx; uint uVar5; uint uVar6; float fVar7; EntityPtr *pEVar8; float fVar9; undefined4 uVar10; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; undefined8 tearFlagsLo; undefined8 tearFlagsHi; float tearModifier; float baseDamage; float baseFallingSpeed; Vector fireDir; Vector local_68; EntityPtr *local_60; Vector local_5c; uint rng [4]; std_string *local_44; uint local_40; std_vector *local_3c; byte isAimingAtMarked; float tearColor; float local_30; float local_2c; undefined4 local_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; uint local_8; void *babiesBegin; local_8 = __security_cookie ^ (uint)(rng + 0x14); if (this->_subtype == 0) { uVar6 = this->_initSeed ^ g_game->_dungeonPlacementSeed; local_3c = &(g_manager->_entityConfig)._babies; rng[1] = 1; rng[2] = 0x15; local_44 = (std_string *)&DAT_00000014; local_40 = 0; do { uVar5 = ((int)(g_manager->_entityConfig)._babies._end - (int)local_3c->_begin) / 0x38; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = uVar6 >> 1 ^ uVar6; uVar6 = uVar6 << 0x15 ^ uVar6; uVar6 = uVar6 >> 0x14 ^ uVar6; babyIdx = 0; if (uVar5 != 0) { babyIdx = uVar6 % uVar5; } babiesBegin = local_3c->_begin; local_5c.y = (float)((int)babiesBegin + babyIdx * 0x38); uVar5 = *(uint *)((int)local_5c.y + 0x34); pvVar4 = (void *)local_5c.y; if (((int)uVar5 < 0) || ((uVar5 < 0x282 && (((uVar5 == 0 || ((g_manager->_persistentGameData)._achievements[uVar5] != 0)) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))) goto LAB_00634ca6; local_40 = local_40 + 1; } while (local_40 < 10); local_40 = ((int)(g_manager->_entityConfig)._babies._end - (int)babiesBegin) / 0x38 - 0x47; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = uVar6 >> 1 ^ uVar6; uVar6 = uVar6 << 0x15 ^ uVar6; uVar5 = 0; if (local_40 != 0) { uVar5 = (uVar6 >> 0x14 ^ uVar6) % local_40; } pvVar4 = (void *)((int)babiesBegin + (uVar5 + 0x47) * 0x38); LAB_00634ca6: uVar6 = 0; if ((this->_sprite)._layerCount != 0) { local_44 = (std_string *)((int)pvVar4 + 0x1c); do { Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar6,local_44); uVar6 = uVar6 + 1; pvVar4 = extraout_ECX; } while (uVar6 < (uint)(this->_sprite)._layerCount); } ANM2::LoadGraphics(&this->_sprite,(byte)pvVar4); this->_subtype = 1; } rng[0] = this->_initSeed ^ g_game->_dungeonPlacementSeed; rng[1] = 1; rng[2] = 0x1b; rng[3] = 0x1b; if (*(char *)((int)this->_player + 0x173) != '\0') { return; } iVar3 = this->_fireCooldown; if (0 < iVar3) { iVar3 = iVar3 + -1; this->_fireCooldown = iVar3; } uVar6 = *(uint *)((int)this->_player + 0x162c); local_40 = uVar6; if (uVar6 == 0xffffffff) { if ((((-1 < this->_headFrameDelay) && (iVar3 = this->_headFrameDelay + -1, this->_headFrameDelay = iVar3, iVar3 < 0)) && (bVar2 = ANM2::SetAnimation(&this->_sprite,&DAT_00b1cddc,1), bVar2 != 0)) && (((this->_sprite)._animState._animData != (void *)0x0 && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)))) { (this->_sprite)._animState._isPlaying = 0; } } else { if (iVar3 < 1) { fVar7 = apply_tear_modifiers(this); local_44 = (std_string *)0x0; local_60 = (EntityPtr *)((fVar7 * 0.25 + 0.75) * 0.8); tearFlagsLo = 0; tearFlagsHi = 0; familiar_wisp_pick_tear_color(rng,&local_44,&tearFlagsLo); tearModifier = apply_tear_modifiers(this); if (rng[0] == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } bVar2 = (byte)rng[1]; uVar5 = rng[0] >> (bVar2 & 0x1f) ^ rng[0]; rngShift2 = (byte)rng[2]; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; rngShift3 = (byte)rng[3]; uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5; baseDamage = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10 * 4.0 + 2.0; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5; baseFallingSpeed = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10 * 0.4 - 0.2; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5; local_3c = (std_vector *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5; local_5c.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5; local_14 = 0; local_10 = 0; uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5; local_c = 0; local_68.y = (float)(uVar5 >> (rngShift3 & 0x1f) ^ uVar5); local_28 = 0x3f800000; local_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; tearColor = (float)((double)(int)local_68.y + __uint_to_double_fixup[-((int)local_68.y >> 0x1f)]) * 2.3283062e-10; local_30 = local_5c.y; local_2c = (float)local_3c; Isaac::GetAxisAlignedUnitVectorFromDir(&fireDir,uVar6); isAimingAtMarked = TryAimAtMarkedTarget(this,&fireDir,(int *)&local_40,(Vector *)0x0); local_5c.y = fireDir.x * 10.0; local_3c = (std_vector *)(fireDir.y * 10.0); if (local_68.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = (uint)local_68.y >> ((byte)rng[1] & 0x1f) ^ (uint)local_68.y; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)rng[3] & 0x1f) ^ uVar6; local_68.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 * 0.6 + 0.7; local_68.x = local_5c.y * local_68.y; local_68.y = (float)local_3c * local_68.y; if (isAimingAtMarked == 0) { fVar7 = *(float *)((int)this->_player + 0x360) * 0.6; fVar9 = *(float *)((int)this->_player + 0x364) * 0.6; local_68.x = fVar7 + fVar7 + local_68.x; local_68.y = fVar9 + fVar9 + local_68.y; } uVar5 = Random(); uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; local_5c.x = fireDir.x * 10.0 + (this->_pos).x; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; local_5c.y = fireDir.y * 10.0 + (this->_pos).y; spawned = Game::Spawn(g_game,2,(uint)local_44,&local_5c,&local_68,(Entity *)this,0,uVar5); tear = (Entity_Tear *)__RTDynamicCast(spawned,uVar10,pTVar11,pTVar12,uVar13); uVar5 = Random(); tear->_fallingAccel = 0.0; tear->_fallingSpeed = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + baseFallingSpeed; (**(code **)(*(int *)tear + 0x40))(baseDamage * tearModifier); flags._h._0_4_ = (undefined4)tearFlagsHi; flags._l = tearFlagsLo; flags._h._4_4_ = tearFlagsHi._4_4_; Entity_Tear::SetTearFlags(tear,flags); pEVar8 = local_60; if ((float)local_60 <= 0.01) { pEVar8 = (EntityPtr *)0x3c23d70a; } tear->_baseScale = (float)pEVar8; tear->_fScale = (float)pEVar8; Entity_Tear::ResetSpriteScale(tear); if (tear->_parent != (EntityPtr)0x0) { local_60 = &tear->_parent; std::multiset::erase(&local_60); } tear->_parent = (EntityPtr)this; std::multiset::insert(&tear->_parent); (**(code **)(*(int *)tear + 0x3c))(&tearColor,0xffffffff,0xff,0,1); uVar5 = Random(); tear->_tearIdx = uVar5 & 1; TryFireTear(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = uVar6 >> ((byte)rng[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)rng[2] & 0x1f) ^ uVar6; iVar3 = apply_forgotten_lullaby(this,(uVar6 >> ((byte)rng[3] & 0x1f) ^ uVar6) % 0xc + 10); this->_fireCooldown = iVar3; this->_headFrameDelay = 0x12; } else if (this->_headFrameDelay < 9) { bVar2 = ANM2::SetAnimation(&this->_sprite,(&PTR_DAT_00b6297c)[uVar6],1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } this->_headFrameDelay = 8; goto LAB_0063535f; } bVar2 = ANM2::SetAnimation(&this->_sprite,(&PTR_DAT_00b6297c)[local_40],1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,2.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } this->_headFrameDelay = this->_headFrameDelay + -1; } LAB_0063535f: FollowParent(this); return; } //@@ 00635390 FamiliarAI::sprinkler /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update case 0x78 (120 SPRINKLER); 'Loki Appear' with 0x57, 'MomsEye Appear' with 0x37; FireTear/FireBomb/FireTechXLaser spin */ void FamiliarAI::sprinkler(void) { Vector shotDirection; Vector shotDirection_00; Vector shotDirection_01; Vector shotDirection_02; Vector shotDirection_03; Vector shotDirection_04; Vector velocity; Vector velocity_00; Vector velocity_01; Vector velocity_02; byte bVar1; int iVar2; uint uVar3; uint rngValue; Entity *spawnedEffect; int *spawnedShot; Entity_Bomb *firedBomb; Entity_Laser *firedLaser; Entity_Tear *firedTear; byte *currentAnimName; Entity_Familiar *in_ECX; char *animName; byte *wantedAnimName; void *pvVar4; float *pfVar5; int gridX; Vector *pos; bool isLess; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; double dVar11; undefined4 uVar12; TypeDescriptor *pTVar13; undefined8 uVar14; float shotOffsetX; float shotOffsetY; Vector local_b0; Weapon_MultiShotParams multiShotParams; int local_84; float techXShotOffsetX; float techXShotOffsetY; Vector local_74; float *local_6c; undefined1 multiShotPosVel [8]; Vector local_60; byte *local_58; float *local_54; float local_50; float *local_4c; float *local_48; void *momsEyeAnimName; undefined4 momsEyeAnimNameSize; uint momsEyeAnimNameCapacity; void *momsEyeAnimPrefix; undefined4 local_28; undefined1 local_24; undefined4 momsEyeAnimPrefixSize; uint momsEyeAnimPrefixCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Entity_Player *player; local_8 = 0xffffffff; puStack_c = &LAB_00af6fc5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(multiShotPosVel + 100); ExceptionList = &local_10; if (((in_ECX->_targetPosition).x == g_vectorZero.x) && ((in_ECX->_targetPosition).y == g_vectorZero.y)) { (in_ECX->_targetPosition).x = (in_ECX->_pos).x; (in_ECX->_targetPosition).y = (in_ECX->_pos).y; } fVar8 = in_ECX->_friction; fVar6 = (in_ECX->_targetPosition).x; (in_ECX->_pos).x = fVar6; game = g_game; fVar9 = (in_ECX->_targetPosition).y; (in_ECX->_pos).y = fVar9; in_ECX->_friction = fVar8 * 0.5; pvVar4 = game->_room; iVar2 = (int)((fVar9 - 120.0) / 40.0 + 0.5); gridX = (int)((fVar6 - 40.0) / 40.0 + 0.5); if (((((-1 < gridX) && (gridX < *(int *)((int)pvVar4 + 0xc))) && (-1 < iVar2)) && ((iVar2 < *(int *)((int)pvVar4 + 0x10) && (uVar3 = iVar2 * *(int *)((int)pvVar4 + 0xc) + gridX, uVar3 < 0x1c0)))) && (*(int *)((int)pvVar4 + uVar3 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)pvVar4 + uVar3 * 4 + 0x76c) = 700; } player = in_ECX->_player; if (in_ECX->_subtype == 0) { bVar1 = Entity_Player::HasCollectible(player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); animName = "MomsEye Appear"; if (bVar1 == 0) { animName = "Appear"; } } else { animName = "Loki Appear"; } ANM2::Play(&in_ECX->_sprite,(byte *)animName,0); if (((in_ECX->_sprite)._animState._animData == (void *)0x0) || ((in_ECX->_sprite)._animState._isPlaying == 0)) { in_ECX->_subtype = 1; ExceptionList = local_10; return; } ExceptionList = local_10; return; } fVar8 = player->_maxfiredelay; if ((player->field_0x13f6 != '\0') || (player->field_0x13fe != '\0')) { fVar8 = fVar8 * 3.0; } iVar2 = Entity::GetIntervalTicks((Entity *)in_ECX,fVar8,0.0); if (iVar2 == 0) { ExceptionList = local_10; return; } Entity_Player::GetMultiShotParams(in_ECX->_player,&multiShotParams,1); pvVar4 = *(void **)((int)in_ECX->_player + 0x13e0); if (*(char *)((int)in_ECX->_player + 0x13f6) != '\0') { fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_48 = (float *)(fVar8 * 0.017453292); local_6c = (float *)sin((float)local_48); fVar8 = (float)((multiShotParams.numTears * 5 + 0x14) * 2); uVar3 = Random(); rngValue = Random(); local_58 = (byte *)((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 10.0 + 5.0); local_60.x = cos((float)local_48); uVar14 = 0xc5d5ac; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; local_60.x = local_60.x * (float)local_58; local_60.y = (float)local_58 * (float)local_6c; spawnedEffect = Game::Spawn(g_game,1000,0x1e,&in_ECX->_pos,&local_60,(Entity *)in_ECX,0,uVar3); local_58 = (byte *)__RTDynamicCast(spawnedEffect,uVar12,pTVar13,uVar14); *(int *)((int)local_58 + 0x450) = (int)multiShotParams.numTears; *(float *)((int)local_58 + 0x45c) = fVar8; *(float *)((int)local_58 + 0x460) = fVar8; local_48 = (float *)((int)local_58 + 0x3bc); if (*local_48 != 0.0) { local_6c = local_48; std::multiset::erase(); } *local_48 = (float)in_ECX; std::multiset::insert(); bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if ((bVar1 != 0) || (bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0), bVar1 != 0)) { uVar3 = Random(); uVar14 = 0xc5d5ac; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; spawnedEffect = Game::Spawn(g_game,1000,0x1e,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,0,uVar3); local_54 = (float *)__RTDynamicCast(spawnedEffect,uVar12,pTVar13,uVar14); local_48 = local_54 + 0xef; if (local_54[0xef] != 0.0) { local_6c = local_48; std::multiset::erase(); } *local_48 = (float)local_58; std::multiset::insert(); local_54[0x114] = (float)(int)multiShotParams.numTears; local_54[0x117] = fVar8; local_54[0x118] = fVar8; local_54[0xc] = 1.4013e-45; bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 != 0) { local_48 = (float *)0x2; do { uVar3 = Random(); uVar14 = 0xc5d5ac; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; spawnedEffect = Game::Spawn(g_game,1000,0x1e,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,0,uVar3); iVar2 = __RTDynamicCast(spawnedEffect,uVar12,pTVar13,uVar14); if (*(int *)(iVar2 + 0x3bc) != 0) { local_54 = (float *)(iVar2 + 0x3bc); std::multiset::erase(); } *(byte **)(iVar2 + 0x3bc) = local_58; std::multiset::insert(); *(int *)(iVar2 + 0x450) = (int)multiShotParams.numTears; *(float *)(iVar2 + 0x45c) = fVar8; *(float *)(iVar2 + 0x460) = fVar8; *(float **)(iVar2 + 0x30) = local_48; local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < 4); } } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0xe5,0); if (bVar1 != 0) { uVar3 = Random(); local_48 = (float *)(uVar3 % 3 + 2); if (local_48 != (float *)0x0) { do { uVar3 = Random(); uVar14 = 0xc5d5ac; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; spawnedEffect = Game::Spawn(g_game,1000,0x1e,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,0,uVar3); iVar2 = __RTDynamicCast(spawnedEffect,uVar12,pTVar13,uVar14); if (*(int *)(iVar2 + 0x3bc) != 0) { local_54 = (float *)(iVar2 + 0x3bc); std::multiset::erase(); } *(byte **)(iVar2 + 0x3bc) = local_58; std::multiset::insert(); *(float *)(iVar2 + 0x45c) = fVar8; *(float *)(iVar2 + 0x460) = fVar8; *(int *)(iVar2 + 0x450) = (int)multiShotParams.numTears; *(undefined4 *)(iVar2 + 0x30) = 4; uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_54 = (float *)(fVar6 + fVar6); local_4c = (float *)sin((float)local_54); uVar3 = Random(); local_6c = (float *)((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 10.0); fVar6 = cos((float)local_54); local_48 = (float *)((int)local_48 + -1); *(float *)(iVar2 + 0x34c) = fVar6 * (float)local_6c; *(float *)(iVar2 + 0x350) = (float)local_6c * (float)local_4c; } while (local_48 != (float *)0x0); local_48 = (float *)0x0; } } } pos = &in_ECX->_pos; if (in_ECX->_player->field_0x13f4 != '\0') { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fmodf(fVar8,360.0); } spawnedShot = (int *)sprinkler_spawn_knife(in_ECX); (**(code **)(*spawnedShot + 0xc))(); } } else { local_48 = (float *)0x1; do { fVar8 = (float)in_ECX->_state * 45.0 + (float)(int)local_48 * 90.0; if (360.0 < ABS(fVar8)) { fmodf(fVar8,360.0); } spawnedShot = (int *)sprinkler_spawn_knife(in_ECX); (**(code **)(*spawnedShot + 0xc))(); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_54 = (float *)sin((float)local_4c); local_74.x = cos((float)local_4c); local_74.y = (float)local_54; local_48 = (float *)0x0; if (0 < multiShotParams.numTears) { do { shotDirection.y = local_74.y; shotDirection.x = local_74.x; Entity_Player::GetMultiShotPositionVelocity (multiShotPosVel,(int)local_48,4,shotDirection,10.0,multiShotParams.numTears, multiShotParams.spreadAngleTears,multiShotParams.spreadAngleLaser, multiShotParams.speadAngleTechX,multiShotParams.spreadAngleKnife, multiShotParams.numEyesActive,multiShotParams.multiEyeAngle, multiShotParams.isCrossEyed,(short)stack0xffffff78); atan2f(local_60.y,local_60.x); spawnedShot = (int *)sprinkler_spawn_knife(in_ECX); (**(code **)(*spawnedShot + 0xc))(); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < (int)multiShotParams.numTears); } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0xe5,0); if (bVar1 != 0) { uVar3 = Random(); for (local_48 = (float *)(uVar3 % 3 + 1); local_48 != (float *)0x0; local_48 = (float *)((int)local_48 + -1)) { Random(); spawnedShot = (int *)sprinkler_spawn_knife(in_ECX); (**(code **)(*spawnedShot + 0xc))(); } } } if (in_ECX->_player->field_0x13f5 != '\0') { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_54 = (float *)sin((float)local_4c); local_60.x = cos((float)local_4c); local_60.x = local_60.x * 10.0; local_60.y = (float)local_54 * 10.0; firedBomb = Entity_Player::FireBomb(in_ECX->_player,pos,&local_60,(Entity *)0x0); (**(code **)(*(int *)firedBomb + 0xc))(); } } else { local_48 = (float *)0x1; do { fVar8 = (float)(int)local_48 * 90.0 + (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_54 = (float *)sin((float)local_4c); local_60.x = cos((float)local_4c); local_60.x = local_60.x * 10.0; local_60.y = (float)local_54 * 10.0; firedBomb = Entity_Player::FireBomb(in_ECX->_player,pos,&local_60,(Entity *)0x0); (**(code **)(*(int *)firedBomb + 0xc))(); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_54 = (float *)sin((float)local_4c); local_74.x = cos((float)local_4c); local_74.y = (float)local_54; local_48 = (float *)0x0; if (0 < multiShotParams.numTears) { do { shotDirection_00.y = local_74.y; shotDirection_00.x = local_74.x; Entity_Player::GetMultiShotPositionVelocity (&shotOffsetX,(int)local_48,5,shotDirection_00,10.0,multiShotParams.numTears, multiShotParams.spreadAngleTears,multiShotParams.spreadAngleLaser, multiShotParams.speadAngleTechX,multiShotParams.spreadAngleKnife, multiShotParams.numEyesActive,multiShotParams.multiEyeAngle, multiShotParams.isCrossEyed,(short)stack0xffffff78); local_60.x = shotOffsetX + pos->x; local_60.y = shotOffsetY + (in_ECX->_pos).y; firedBomb = Entity_Player::FireBomb(in_ECX->_player,&local_60,&local_b0,(Entity *)0x0); (**(code **)(*(int *)firedBomb + 0xc))(); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < (int)multiShotParams.numTears); } } if (in_ECX->_player->field_0x13f9 != '\0') { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_54 = (float *)sin((float)local_4c); local_60.x = cos((float)local_4c); local_60.x = local_60.x * 10.0; local_60.y = (float)local_54 * 10.0; firedLaser = Entity_Player::FireTechXLaser (in_ECX->_player,pos,&local_60,5.0,(Entity *)0x0,1.0); (**(code **)(*(int *)firedLaser + 0xc))(); } } else { local_48 = (float *)0x1; do { fVar8 = (float)(int)local_48 * 90.0 + (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_54 = (float *)sin((float)local_4c); local_60.x = cos((float)local_4c); local_60.x = local_60.x * 10.0; local_60.y = (float)local_54 * 10.0; firedLaser = Entity_Player::FireTechXLaser (in_ECX->_player,pos,&local_60,5.0,(Entity *)0x0,1.0); (**(code **)(*(int *)firedLaser + 0xc))(); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_4c = (float *)(fVar8 * 0.017453292); local_58 = (byte *)sin((float)local_4c); local_b0.x = cos((float)local_4c); local_b0.y = (float)local_58; local_48 = (float *)0x0; if (0 < multiShotParams.numTears) { do { shotDirection_01.y = local_b0.y; shotDirection_01.x = local_b0.x; Entity_Player::GetMultiShotPositionVelocity (&techXShotOffsetX,(int)local_48,9,shotDirection_01,10.0,multiShotParams.numTears, multiShotParams.spreadAngleTears,multiShotParams.spreadAngleLaser, multiShotParams.speadAngleTechX,multiShotParams.spreadAngleKnife, multiShotParams.numEyesActive,multiShotParams.multiEyeAngle, multiShotParams.isCrossEyed,(short)stack0xffffff78); local_60.x = techXShotOffsetX + pos->x; local_60.y = techXShotOffsetY + (in_ECX->_pos).y; firedLaser = Entity_Player::FireTechXLaser (in_ECX->_player,&local_60,&local_74,5.0,(Entity *)0x0,1.0); (**(code **)(*(int *)firedLaser + 0xc))(); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < (int)multiShotParams.numTears); } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0xe5,0); if (bVar1 != 0) { uVar3 = Random(); local_48 = (float *)(uVar3 % 3 + 3); if (local_48 != (float *)0x0) { local_6c = (float *)(local_b0.x * 20.0); fVar8 = (float)local_58 * 20.0; do { player = in_ECX->_player; uVar3 = Random(); local_50 = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5) * 10.0; uVar3 = Random(); local_4c = (float *)(((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 50.0 - 25.0) * 0.017453292); local_54 = (float *)cos((float)local_4c); fVar6 = sin((float)local_4c); local_60.x = local_b0.x * (float)local_54 - (float)local_58 * fVar6; local_60.y = (float)local_58 * (float)local_54 + local_b0.x * fVar6; local_74.y = fVar8 + (in_ECX->_pos).y; local_74.x = (float)local_6c + (in_ECX->_pos).x; firedLaser = Entity_Player::FireTechXLaser (player,&local_74,&local_60,local_50,(Entity *)0x0,1.0); (**(code **)(*(int *)firedLaser + 0xc))(); local_48 = (float *)((int)local_48 + -1); } while (local_48 != (float *)0x0); } } } if (in_ECX->_player->field_0x13f3 != '\0') { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fmodf(fVar8,360.0); } spawnedShot = (int *)Entity_Familiar::sprinkler_shoot_laser(); (**(code **)(*spawnedShot + 0xc))(); } } else { iVar2 = 1; do { fVar8 = (float)iVar2 * 90.0 + (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fmodf(fVar8,360.0); } spawnedShot = (int *)Entity_Familiar::sprinkler_shoot_laser(); (**(code **)(*spawnedShot + 0xc))(); iVar2 = iVar2 + 1; } while (iVar2 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); local_74.x = cos(local_50); iVar2 = 0; local_74.y = (float)local_4c; if (0 < multiShotParams.numTears) { do { shotDirection_02.y = local_74.y; shotDirection_02.x = local_74.x; Entity_Player::GetMultiShotPositionVelocity (multiShotPosVel,iVar2,3,shotDirection_02,10.0,multiShotParams.numTears, multiShotParams.spreadAngleTears,multiShotParams.spreadAngleLaser, multiShotParams.speadAngleTechX,multiShotParams.spreadAngleKnife, multiShotParams.numEyesActive,multiShotParams.multiEyeAngle, multiShotParams.isCrossEyed,(short)stack0xffffff78); atan2f(local_60.y,local_60.x); spawnedShot = (int *)Entity_Familiar::sprinkler_shoot_laser(); (**(code **)(*spawnedShot + 0xc))(); iVar2 = iVar2 + 1; } while (iVar2 < multiShotParams.numTears); } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0xe5,0); if (bVar1 != 0) { uVar3 = Random(); for (iVar2 = uVar3 % 3 + 3; iVar2 != 0; iVar2 = iVar2 + -1) { Random(); spawnedShot = (int *)Entity_Familiar::sprinkler_shoot_laser(); (**(code **)(*spawnedShot + 0xc))(); } } } if (in_ECX->_player->field_0x13f2 != '\0') { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fmodf(fVar8,360.0); } spawnedShot = (int *)FamiliarHelper::sprinkler_fire_laser(); (**(code **)(*spawnedShot + 0xc))(); } } else { iVar2 = 1; do { fVar8 = (float)iVar2 * 90.0 + (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fmodf(fVar8,360.0); } spawnedShot = (int *)FamiliarHelper::sprinkler_fire_laser(); (**(code **)(*spawnedShot + 0xc))(); iVar2 = iVar2 + 1; } while (iVar2 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); local_74.x = cos(local_50); iVar2 = 0; local_74.y = (float)local_4c; if (0 < multiShotParams.numTears) { do { shotDirection_03.y = local_74.y; shotDirection_03.x = local_74.x; Entity_Player::GetMultiShotPositionVelocity (multiShotPosVel,iVar2,2,shotDirection_03,10.0,multiShotParams.numTears, multiShotParams.spreadAngleTears,multiShotParams.spreadAngleLaser, multiShotParams.speadAngleTechX,multiShotParams.spreadAngleKnife, multiShotParams.numEyesActive,multiShotParams.multiEyeAngle, multiShotParams.isCrossEyed,(short)stack0xffffff78); atan2f(local_60.y,local_60.x); spawnedShot = (int *)FamiliarHelper::sprinkler_fire_laser(); (**(code **)(*spawnedShot + 0xc))(); iVar2 = iVar2 + 1; } while (iVar2 < multiShotParams.numTears); } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0xe5,0); if (bVar1 != 0) { uVar3 = Random(); for (iVar2 = uVar3 % 3 + 3; iVar2 != 0; iVar2 = iVar2 + -1) { Random(); spawnedShot = (int *)FamiliarHelper::sprinkler_fire_laser(); (**(code **)(*spawnedShot + 0xc))(); } } } if ((pvVar4 != (void *)0x0) && (*(int *)((int)pvVar4 + 0x30) == 0xe)) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); iVar2 = 0x636cfa; local_60.x = cos(local_50); local_60.x = local_60.x * 10.0; local_60.y = (float)local_4c * 10.0; firedTear = fire_fetus_tear(pvVar4,&in_ECX->_pos,&local_60,7,(Entity *)in_ECX,1.0,iVar2); Entity_Familiar::TryFireTear(in_ECX,firedTear); } } else { local_48 = (float *)0x1; do { fVar8 = (float)(int)local_48 * 90.0 + (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); iVar2 = 0x636c04; local_60.x = cos(local_50); local_60.x = local_60.x * 10.0; local_60.y = (float)local_4c * 10.0; firedTear = fire_fetus_tear(pvVar4,&in_ECX->_pos,&local_60,7,(Entity *)in_ECX,1.0,iVar2); Entity_Familiar::TryFireTear(in_ECX,firedTear); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); local_74.x = cos(local_50); local_74.y = (float)local_4c; local_48 = (float *)0x0; if (0 < multiShotParams.numTears) { do { iVar2 = stack0xffffff78; FUN_009f4230(&shotOffsetX,local_48,0xe,local_74.x,local_74.y,0x41200000, multiShotParams._0_4_,multiShotParams.spreadAngleTears, multiShotParams.spreadAngleLaser,multiShotParams.speadAngleTechX, multiShotParams.spreadAngleKnife,multiShotParams.numEyesActive, multiShotParams.multiEyeAngle,multiShotParams._28_4_,stack0xffffff78); local_60.x = shotOffsetX + (in_ECX->_pos).x; local_60.y = shotOffsetY + (in_ECX->_pos).y; firedTear = fire_fetus_tear(pvVar4,&local_60,&local_b0,7,(Entity *)in_ECX,1.0,iVar2); Entity_Familiar::TryFireTear(in_ECX,firedTear); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < (int)multiShotParams.numTears); } } player = in_ECX->_player; if (((player->field_0x13f1 != '\0') || (player->field_0x13f7 != '\0')) || (player->field_0x13fa != '\0')) { bVar1 = Entity_Player::HasCollectible(player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); if (bVar1 != 0) { fVar8 = (float)in_ECX->_state * 45.0 + 180.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); local_74.x = cos(local_50); local_74.y = (float)local_4c * 10.0; local_74.x = local_74.x * 10.0; velocity_00.y = local_74.y; velocity_00.x = local_74.x; firedTear = Entity_Player::FireTear (in_ECX->_player,&in_ECX->_pos,velocity_00,7,(Entity *)0x0,1.0); Entity_Familiar::TryFireTear(in_ECX,firedTear); } } else { local_48 = (float *)0x1; do { fVar8 = (float)(int)local_48 * 90.0 + (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_4c = (float *)sin(local_50); local_74.x = cos(local_50); local_74.y = (float)local_4c * 10.0; local_74.x = local_74.x * 10.0; velocity.y = local_74.y; velocity.x = local_74.x; firedTear = Entity_Player::FireTear (in_ECX->_player,&in_ECX->_pos,velocity,7,(Entity *)0x0,1.0); Entity_Familiar::TryFireTear(in_ECX,firedTear); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < 4); } fVar8 = (float)in_ECX->_state * 45.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } local_50 = fVar8 * 0.017453292; local_48 = (float *)sin(local_50); local_74.x = cos(local_50); local_74.y = (float)local_48; if (*(char *)((int)in_ECX->_player + 0x13f7) == '\0') { local_48 = (float *)0x0; if (0 < multiShotParams.numTears) { do { shotDirection_04.y = local_74.y; shotDirection_04.x = local_74.x; Entity_Player::GetMultiShotPositionVelocity (&shotOffsetX,(int)local_48,1,shotDirection_04,10.0,multiShotParams.numTears, multiShotParams.spreadAngleTears,multiShotParams.spreadAngleLaser, multiShotParams.speadAngleTechX,multiShotParams.spreadAngleKnife, multiShotParams.numEyesActive,multiShotParams.multiEyeAngle, multiShotParams.isCrossEyed,(short)stack0xffffff78); local_60.x = shotOffsetX + (in_ECX->_pos).x; local_60.y = shotOffsetY + (in_ECX->_pos).y; velocity_02.y = local_b0.y; velocity_02.x = local_b0.x; firedTear = Entity_Player::FireTear (in_ECX->_player,&local_60,velocity_02,7,(Entity *)0x0,1.0); Entity_Familiar::TryFireTear(in_ECX,firedTear); local_48 = (float *)((int)local_48 + 1); } while ((int)local_48 < (int)multiShotParams.numTears); } } else { local_50 = (float)(0xc - (int)((float)(int)multiShotParams.numTears * -2.4)) / (float)multiShotParams.numEyesActive; dVar11 = ceil((double)local_50); local_54 = (float *)(float)dVar11; local_58 = (byte *)0x0; if (0 < multiShotParams.numEyesActive) { do { local_50 = 0.0; if (1 < multiShotParams.numEyesActive) { local_4c = (float *)((uint)multiShotParams.multiEyeAngle ^ 0x80000000); local_50 = (float)multiShotParams.numEyesActive - 1.0; if (local_50 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar8 = ((float)(int)local_58 - 0.0) / (local_50 - 0.0); if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } local_50 = (multiShotParams.multiEyeAngle - (float)local_4c) * fVar8 + (float)local_4c; } local_50 = local_50 * 0.017453292; local_4c = (float *)cos(local_50); fVar8 = sin(local_50); fVar10 = local_74.x * (float)local_4c; local_84 = (int)(float)local_54; fVar9 = (float)local_48 * fVar8; fVar8 = local_74.x * fVar8; fVar6 = (float)local_48 * (float)local_4c; if (0 < local_84) { local_b0.y = 0.01; do { uVar3 = Random(); local_50 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_50 = local_50 + local_50; local_6c = (float *)sin(local_50); uVar3 = Random(); local_4c = (float *)((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10); fVar7 = cos(local_50); local_60.x = fVar7 * (float)local_4c * 3.5 + (fVar10 - fVar9) * 10.0; local_60.y = (float)local_4c * (float)local_6c * 3.5 + (fVar8 + fVar6) * 10.0; velocity_01.y = local_60.y; velocity_01.x = local_60.x; firedTear = Entity_Player::FireTear (in_ECX->_player,&in_ECX->_pos,velocity_01,7,(Entity *)0x0,1.0); firedTear->_fallingAccel = firedTear->_fallingAccel + 0.5; uVar3 = Random(); firedTear->_fallingSpeed = (firedTear->_fallingSpeed - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 15.0) + 5.0; uVar3 = Random(); rngValue = Random(); local_50 = (((float)(uVar3 & 1) + 0.0) * 0.4 + 0.9 + (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.05) * firedTear->_fScale; pfVar5 = &local_50; if (local_50 <= 0.01) { pfVar5 = &local_b0.y; } fVar7 = *pfVar5; firedTear->_baseScale = fVar7; firedTear->_fScale = fVar7; Entity_Tear::ResetSpriteScale(firedTear); Entity_Familiar::TryFireTear(in_ECX,firedTear); local_84 = local_84 + -1; } while (local_84 != 0); } local_58 = (byte *)((int)local_58 + 1); } while ((int)local_58 < multiShotParams.numEyesActive); } } } bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x57,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(in_ECX->_player,0x37,0); uVar3 = in_ECX->_state + 2U & 0x80000007; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff8) + 1; } local_48 = (float *)(&PTR_DAT_00b64790)[uVar3]; if (bVar1 != 0) { momsEyeAnimPrefixCapacity = 0xf; momsEyeAnimPrefixSize = 8; momsEyeAnimPrefix = (void *)0x736d6f4d; local_28 = 0x20657945; local_24 = 0; local_8 = 0; local_58 = (byte *)FUN_0060c790(); local_8 = CONCAT31(local_8._1_3_,1); if (0xf < *(uint *)(local_58 + 0x14)) { local_58 = *(byte **)local_58; } currentAnimName = (in_ECX->_sprite)._animState._animData; if (currentAnimName == (byte *)0x0) { LAB_0063777b: bVar1 = ANM2::SetAnimation(&in_ECX->_sprite,local_58,1); if (bVar1 != 0) { AnimationState::Rewind(&(in_ECX->_sprite)._animState); (in_ECX->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } wantedAnimName = local_58; do { bVar1 = *currentAnimName; isLess = bVar1 < *wantedAnimName; if (bVar1 != *wantedAnimName) { LAB_00637760: uVar3 = -(uint)isLess | 1; goto LAB_00637765; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < wantedAnimName[1]; if (bVar1 != wantedAnimName[1]) goto LAB_00637760; currentAnimName = currentAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00637765: if ((uVar3 != 0) || ((*(char *)((int)(in_ECX->_sprite)._animState._animData + 0x34) != '\0' && ((in_ECX->_sprite)._animState._isPlaying == 0)))) goto LAB_0063777b; } if (0xf < momsEyeAnimNameCapacity) { uVar3 = momsEyeAnimNameCapacity + 1; pvVar4 = momsEyeAnimName; if (0xfff < uVar3) { pvVar4 = *(void **)((int)momsEyeAnimName + -4); uVar3 = momsEyeAnimNameCapacity + 0x24; if (0x1f < (uint)((int)momsEyeAnimName + (-4 - (int)pvVar4))) goto LAB_00637807; } operator_delete(pvVar4,uVar3); } momsEyeAnimNameSize = 0; momsEyeAnimNameCapacity = 0xf; momsEyeAnimName = (void *)((uint)momsEyeAnimName & 0xffffff00); if (0xf < momsEyeAnimPrefixCapacity) { uVar3 = momsEyeAnimPrefixCapacity + 1; pvVar4 = momsEyeAnimPrefix; if (0xfff < uVar3) { pvVar4 = *(void **)((int)momsEyeAnimPrefix + -4); uVar3 = momsEyeAnimPrefixCapacity + 0x24; if (0x1f < (uint)((int)momsEyeAnimPrefix + (-4 - (int)pvVar4))) { LAB_00637807: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar3); } goto LAB_0063788c; } currentAnimName = (in_ECX->_sprite)._animState._animData; if (currentAnimName != (byte *)0x0) { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } pfVar5 = local_48; do { bVar1 = *currentAnimName; isLess = bVar1 < *(byte *)pfVar5; if (bVar1 != *(byte *)pfVar5) { LAB_00637850: uVar3 = -(uint)isLess | 1; goto LAB_00637855; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < *(byte *)((int)pfVar5 + 1); if (bVar1 != *(byte *)((int)pfVar5 + 1)) goto LAB_00637850; currentAnimName = currentAnimName + 2; pfVar5 = (float *)((int)pfVar5 + 2); } while (bVar1 != 0); uVar3 = 0; LAB_00637855: if ((uVar3 == 0) && ((*(char *)((int)(in_ECX->_sprite)._animState._animData + 0x34) == '\0' || ((in_ECX->_sprite)._animState._isPlaying != 0)))) goto LAB_0063788c; } uVar14 = CONCAT44(1,local_48); } else { currentAnimName = (in_ECX->_sprite)._animState._animData; if ((in_ECX->_state & 1) == 0) { if (currentAnimName != (byte *)0x0) { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } animName = "Loki Down"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_00637613: uVar3 = -(uint)isLess | 1; goto LAB_00637618; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_00637613; currentAnimName = currentAnimName + 2; animName = animName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00637618: if ((uVar3 == 0) && ((*(char *)((int)(in_ECX->_sprite)._animState._animData + 0x34) == '\0' || ((in_ECX->_sprite)._animState._isPlaying != 0)))) goto LAB_0063788c; } uVar14 = 0x100b641d0; } else { if (currentAnimName != (byte *)0x0) { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } animName = "Loki Bottom Right"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_00637675: uVar3 = -(uint)isLess | 1; goto LAB_0063767a; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_00637675; currentAnimName = currentAnimName + 2; animName = animName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0063767a: if ((uVar3 == 0) && ((*(char *)((int)(in_ECX->_sprite)._animState._animData + 0x34) == '\0' || ((in_ECX->_sprite)._animState._isPlaying != 0)))) goto LAB_0063788c; } uVar14 = 0x100b641dc; } } bVar1 = ANM2::SetAnimation(&in_ECX->_sprite,(byte *)uVar14,(byte)((ulonglong)uVar14 >> 0x20)); if (bVar1 != 0) { AnimationState::Rewind(&(in_ECX->_sprite)._animState); (in_ECX->_sprite)._animState._isPlaying = 1; } LAB_0063788c: uVar3 = in_ECX->_state + 1U & 0x80000007; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff8) + 1; } in_ECX->_state = uVar3; ExceptionList = local_10; return; } //@@ 006378c0 Entity_Familiar::ai_lil_harbingers /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update case; "[err] Wrong Harbinger subtype %u!", FloatDown/PreSpawn, convert_shot_for_enemy_owner */ void __thiscall Entity_Familiar::ai_lil_harbingers(Entity_Familiar *this) { code *pcVar1; float *pfVar2; byte bVar3; uint uVar4; uint uVar5; Entity *pEVar6; Vector *pVVar7; Vector *randomPos; EntityPtr shot; byte *pbVar8; byte *pbVar9; int iVar10; uint subtypeIndex; char *expectedName; EntityPtr *linkedEntitySlot; bool bVar11; float fVar12; float fVar13; uint entityIndex; int entityType; Vector local_64; EntityPtr local_5c; float local_58; uint entityCount; Entity *local_50; int fireDelayBySubtype [5]; float maxSpeedBySubtype [5]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float fStack_14; Game *game; puStack_20 = (undefined1 *)(maxSpeedBySubtype + 0xd); fStack_14 = -NAN; puStack_18 = &LAB_00af6ff0; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(maxSpeedBySubtype + 10); ExceptionList = &local_1c; iVar10 = this->_state; local_24 = uVar4; pfVar2 = maxSpeedBySubtype + 0xd; if (300 < iVar10) { uVar5 = (this->_dropRNG)._seed; pfVar2 = maxSpeedBySubtype + 0xd; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_dropRNG)._seed; pfVar2 = (float *)puStack_20; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } puStack_20 = (undefined1 *)pfVar2; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5; (this->_dropRNG)._seed = uVar5; this->_subtype = uVar5 % 5; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; init_lil_harbinger_sprite(this,uVar4); uVar4 = Random(); pEVar6 = Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4,0); (**(code **)(*(int *)pEVar6 + 0xc))(); this->_state = 0; iVar10 = 0; pfVar2 = (float *)puStack_20; } puStack_20 = (undefined1 *)pfVar2; local_58 = (this->_targetPosition).x; if ((local_58 == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) { pVVar7 = Room::GetRandomPosition(g_game->_room,&local_64,this->_size); (this->_targetPosition).x = pVVar7->x; (this->_targetPosition).y = pVVar7->y; iVar10 = this->_state; local_58 = (this->_targetPosition).x; } this->_state = iVar10 + 1; pVVar7 = &this->_pos; local_50 = (Entity *)((this->_targetPosition).y - (this->_pos).y); local_58 = local_58 - pVVar7->x; fVar12 = sqrtf((float)local_50 * (float)local_50 + local_58 * local_58); if (fVar12 <= 0.0) { fVar13 = local_58; pEVar6 = local_50; } else { fVar13 = (2.0 / fVar12) * local_58; pEVar6 = (Entity *)((2.0 / fVar12) * (float)local_50); } (this->_velocity).x = fVar13 + (this->_velocity).x; (this->_velocity).y = (float)pEVar6 + (this->_velocity).y; iVar10 = this->_subtype; if ((iVar10 == 0) || (iVar10 == 3)) { fVar13 = pVVar7->x - (this->_targetPosition).x; fVar12 = (this->_pos).y - (this->_targetPosition).y; if (fVar12 * fVar12 + fVar13 * fVar13 < 25.0) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; } game = g_game; if ((((this->_flags & 0x4000) == 0) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)) && ((game->_frameCount + this->_index) % 3 == 0)) { local_5c = (EntityPtr)game->_room; local_58 = 0.0; uVar4 = *(uint *)((int)local_5c + 0x1264); entityIndex = 0; local_50 = (Entity *)0x0; entityCount = uVar4; if (uVar4 != 0) { local_64.y = *(float *)&game->_deathmatchManager; do { pEVar6 = *(Entity **)(*(int *)((int)local_5c + 0x125c) + entityIndex * 4); if (((int)local_64.y < 2) || (pEVar6->_type != 1)) { entityType = pEVar6->_type; uVar4 = entityCount; if (entityType - 10U < 0x3de) goto LAB_00637d3b; } else { entityType = 1; LAB_00637d3b: if (((pEVar6->_entityCollisionClass != 1) && (pEVar6->_entityCollisionClass != 0)) && ((pEVar6->_isInvicible == 0 && (pEVar6->_dead == 0)))) { bVar3 = Entity::HasEntityFlags(pEVar6,0x10); if (((bVar3 == 0) || (entityType == 0x322)) || (entityType == 0x362)) { fVar12 = (pEVar6->_pos).x - (this->_pos).x; fVar13 = (pEVar6->_pos).y - (this->_pos).y; fVar12 = fVar13 * fVar13 + fVar12 * fVar12; if (local_50 == (Entity *)0x0) { local_58 = fVar12; local_50 = pEVar6; } else if (fVar12 < local_58) { local_58 = fVar12; local_50 = pEVar6; } } uVar4 = entityCount; } } entityIndex = entityIndex + 1; } while (entityIndex < uVar4); } if (local_50 == (Entity *)0x0) { fVar13 = (this->_pos).x - (this->_targetPosition).x; fVar12 = (this->_pos).y - (this->_targetPosition).y; if (fVar12 * fVar12 + fVar13 * fVar13 < 25.0) { pVVar7 = Room::GetRandomPosition((Room *)local_5c,&local_64,this->_size); (this->_targetPosition).x = pVVar7->x; (this->_targetPosition).y = pVVar7->y; } } else { fVar12 = (local_50->_pos).y; (this->_targetPosition).x = (local_50->_pos).x; (this->_targetPosition).y = fVar12; } } } else { fVar12 = pVVar7->x - (this->_targetPosition).x; fVar13 = (this->_pos).y - (this->_targetPosition).y; if (fVar13 * fVar13 + fVar12 * fVar12 < 25.0) { randomPos = Room::GetRandomPosition(g_game->_room,&local_64,this->_size); (this->_targetPosition).x = randomPos->x; (this->_targetPosition).y = randomPos->y; iVar10 = this->_subtype; } if (iVar10 == 1) { bVar3 = Entity::IsFrame((Entity *)this,0xc,this->_index); if ((bVar3 != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { uVar4 = Random(); pEVar6 = this->_player; uVar5 = 0x35; goto LAB_00637be3; } } else if (((iVar10 == 2) && (bVar3 = Entity::IsFrame((Entity *)this,0xc,this->_index), bVar3 != 0)) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { uVar4 = Random(); pEVar6 = this->_player; uVar5 = 0x2d; LAB_00637be3: pEVar6 = Game::SpawnEx(g_game,1000,uVar5,pVVar7,&g_vectorZero,pEVar6,0,uVar4,0); iVar10 = __RTDynamicCast(pEVar6,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar10 + 0x45c) = 0x78; *(undefined4 *)(iVar10 + 0x460) = 0x78; *(undefined4 *)(iVar10 + 0x470) = 1; } } uVar4 = this->_subtype; maxSpeedBySubtype[4] = 2.0; fireDelayBySubtype[4] = 0x3c; maxSpeedBySubtype[0] = 2.5; maxSpeedBySubtype[1] = 2.0; maxSpeedBySubtype[2] = 2.0; maxSpeedBySubtype[3] = 1.5; fireDelayBySubtype[0] = 0x96; fireDelayBySubtype[1] = 0x5a; fireDelayBySubtype[2] = 0x5a; fireDelayBySubtype[3] = 0x5a; if (4 < uVar4) { KAGE_LogMessage(0x10,(byte *)"[err] Wrong Harbinger subtype %u!\n"); uVar4 = this->_subtype; } fVar12 = (this->_velocity).x; local_64.y = (this->_velocity).y; fVar12 = sqrtf(fVar12 * fVar12 + local_64.y * local_64.y); subtypeIndex = -(uint)(uVar4 != 0) & uVar4; uVar5 = 4; if (subtypeIndex < 4) { uVar5 = subtypeIndex; } if (maxSpeedBySubtype[uVar5] <= fVar12 && fVar12 != maxSpeedBySubtype[uVar5]) { uVar5 = 4; if (subtypeIndex < 4) { uVar5 = subtypeIndex; } if (0.0 < fVar12) { fVar13 = maxSpeedBySubtype[uVar5]; (this->_velocity).y = (fVar13 / fVar12) * local_64.y; (this->_velocity).x = (fVar13 / fVar12) * (this->_velocity).x; uVar4 = this->_subtype; } } iVar10 = this->_fireCooldown + 1; this->_fireCooldown = iVar10; uVar4 = -(uint)(uVar4 != 0) & uVar4; uVar5 = 4; if (uVar4 < 4) { uVar5 = uVar4; } if ((fireDelayBySubtype[uVar5] <= iVar10) && (this->_linkedEntity == (EntityPtr)0x0)) { this->_fireCooldown = 0; uVar4 = Random(); local_5c = (EntityPtr) Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,this->_player, this->_subtype + 1,uVar4,0); if (this->_subtype == 4) { uVar4 = Random(); local_5c = (EntityPtr) Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,this->_player, this->_subtype + 1,uVar4,0); } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"PreSpawn",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } linkedEntitySlot = &this->_linkedEntity; if (*linkedEntitySlot != (EntityPtr)0x0) { local_64.y = (float)linkedEntitySlot; std::multiset::erase(&local_64.y); } *linkedEntitySlot = local_5c; shot = (EntityPtr)0x0; if (local_5c != (EntityPtr)0x0) { std::multiset::insert(linkedEntitySlot); shot = this->_linkedEntity; } Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)shot); } if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying == 0)) { pbVar8 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } expectedName = "PreSpawn"; do { bVar3 = *pbVar8; bVar11 = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_006380a0: uVar4 = -(uint)bVar11 | 1; goto LAB_006380a5; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar11 = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_006380a0; pbVar8 = pbVar8 + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_006380a5: if (uVar4 == 0) { pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { pbVar9 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar9 = *(byte **)pbVar8; } expectedName = "FloatDown"; do { bVar3 = *pbVar9; bVar11 = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_006380e0: uVar4 = -(uint)bVar11 | 1; goto LAB_006380e5; } if (bVar3 == 0) break; bVar3 = pbVar9[1]; bVar11 = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_006380e0; pbVar9 = pbVar9 + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_006380e5: if ((uVar4 == 0) && ((pbVar8[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0063811c; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"FloatDown",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } LAB_0063811c: fVar12 = (this->_velocity).x; if (0.0 < ABS(fVar12)) { (this->_sprite)._flipX = fVar12 < 0.0; } ExceptionList = local_1c; return; } //@@ 00638170 FamiliarAI::mystery_egg /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Familiar::Update case 0x7c (124); 'Crack' event -> SpawnEx enemy, MakeChampion, AddCharmed, BloodExplode; FollowParent */ void __fastcall FamiliarAI::mystery_egg(Entity_Familiar *familiar) { byte bVar1; uint uVar2; Entity *spawned; Entity_NPC *this; int *bloodEffect; byte *currentAnimName; char *crackName; undefined *enemyTable; bool isLess; int soundId; EntityRef EStack_38; undefined4 uStack_10; uint local_c; Manager *manager; int roomsCleared; local_c = __security_cookie ^ (uint)&soundId; if ((familiar->_sprite)._animState._animData != (void *)0x0) { bVar1 = AnimationState::IsEventTriggered(&(familiar->_sprite)._animState,s_Spawn); if (bVar1 != 0) { roomsCleared = familiar->_roomClearCount; enemyTable = &DAT_00b64778; uVar2 = 6; if (roomsCleared < 1) { enemyTable = &DAT_00b6475c; uVar2 = 7; } else if (roomsCleared < 4) { enemyTable = &DAT_00b64724; uVar2 = 0xe; } else if (roomsCleared < 7) { enemyTable = &DAT_00b64698; uVar2 = 0x23; } else if (roomsCleared < 10) { enemyTable = &DAT_00b645e0; uVar2 = 0x20; } else if (roomsCleared < 0xd) { enemyTable = &DAT_00b645b0; uVar2 = 0xc; } uVar2 = RNG::RandomInt(&familiar->_dropRNG,uVar2); spawned = Game::SpawnEx(g_game,*(uint *)(enemyTable + uVar2 * 4),0,&familiar->_pos, &g_vectorZero,(Entity *)familiar,0,(familiar->_dropRNG)._seed,0); this = (Entity_NPC *) __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); EStack_38._position.y = g_vectorZero.y; EStack_38._velocity.y = g_vectorZero.y; EStack_38._type = 0; EStack_38._variant = 0; EStack_38._spawnerType = 0; EStack_38._spawnerVariant = 0; EStack_38._position.x = g_vectorZero.x; EStack_38._velocity.x = g_vectorZero.x; EStack_38._flags = 0; EStack_38._entity = (void *)0x0; Entity::AddCharmed((Entity *)this,&EStack_38,-1,0,0); bVar1 = Entity_Player::HasCollectible(familiar->_player,0xf7,0); if (bVar1 != 0) { Entity_NPC::MakeChampion(this,(familiar->_dropRNG)._seed,-1,0); } manager = g_manager; soundId = 0xed; this->_maxHitPoints = this->_maxHitPoints * 1.5; this->_health = this->_health * 1.5; uVar2 = familiar->_index; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,uVar2 % 0xb,0,1.0,0.0); Entity::BloodExplode((Entity *)familiar); uVar2 = Random(); spawned = Game::SpawnEx(g_game,1000,2,&familiar->_pos,&g_vectorZero,(Entity *)0x0,3,uVar2,0); bloodEffect = (int *)__RTDynamicCast(spawned,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor ,0); EStack_38._flags = 0x3f4ccccd; EStack_38._entity = (void *)0x3f4ccccd; uStack_10 = 0x3f4ccccd; EStack_38._position.x = 0.0; EStack_38._position.y = 0.0; EStack_38._velocity.x = 0.0; EStack_38._velocity.y = 0.0; EStack_38._type = 0x3f800000; EStack_38._variant = 0x3f800000; EStack_38._spawnerType = 0x3f800000; EStack_38._spawnerVariant = 0x3f800000; (**(code **)(*bloodEffect + 0x3c))(&EStack_38,0xffffffff,0xff,0,1); bloodEffect[0xd3] = 0; bloodEffect[0xd4] = -0x3ea00000; (**(code **)(*bloodEffect + 0xc))(); familiar->_roomClearCount = 0; } if (((familiar->_sprite)._animState._animData != (void *)0x0) && ((familiar->_sprite)._animState._isPlaying == 0)) { currentAnimName = (familiar->_sprite)._animState._animData; if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } crackName = "Crack"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*crackName; if (bVar1 != *crackName) { LAB_00638450: uVar2 = -(uint)isLess | 1; goto LAB_00638455; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)crackName[1]; if (bVar1 != crackName[1]) goto LAB_00638450; currentAnimName = currentAnimName + 2; crackName = crackName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00638455: if (uVar2 == 0) { familiar->_visible = 0; return; } } } if (familiar->_visible != 0) { Entity_Familiar::FollowParent(familiar); } return; } //@@ 006384a0 FamiliarAI::lil_spewer /* DB: Entity_Familiar::Update case 0x7d (variant 125); EvaluateItems CheckFamiliar(0x7d) from collectible 0x219 COLLECTIBLE_LIL_SPEWER; ChargeDown/ChargeSide/FloatShootDown, apply_forgotten_lullaby */ void __fastcall FamiliarAI::lil_spewer(Entity_Familiar *familiar) { byte bVar1; int iVar2; int maxCooldown; uint clampedDirection; int iVar3; void *pvVar4; float fVar5; float driftX; float driftY; float projX; float local_48; float shotDirX; float shotDirY; int local_3c; float local_38; int local_34; uint local_30; float spreadAngle; int local_28; float angleRad; Vector local_20; Vector spawnPos; Vector fireDir; byte *animName; Manager *manager; Entity_Familiar::FollowParent(familiar); if ((g_game->_frameCount - familiar->_spawnFrame == 4) && (familiar->_state != 0)) { FUN_0063b240(); } if ((familiar->_fireCooldown < 0) && (iVar2 = familiar->_fireCooldown + 1, familiar->_fireCooldown = iVar2, iVar2 == 0)) { iVar2 = apply_forgotten_lullaby(familiar,0x1e); familiar->_fireCooldown = iVar2; } pvVar4 = familiar->_player; iVar2 = *(int *)((int)pvVar4 + 0x1624); local_30 = *(int *)((int)pvVar4 + 0x162c); if (iVar2 == -1) { iVar2 = 3; } iVar3 = familiar->_lastDirection; if (iVar3 == -1) { local_34 = 3; } else { local_28 = 0; if (iVar3 < 1) { iVar3 = 0; } local_34 = 3; if (iVar3 < 3) { local_34 = iVar3; } } fVar5 = sqrtf(*(float *)((int)pvVar4 + 0x1630) * *(float *)((int)pvVar4 + 0x1630) + *(float *)((int)pvVar4 + 0x1634) * *(float *)((int)pvVar4 + 0x1634)); if ((fVar5 < 0.5) && (*(char *)((int)familiar->_player + 0x1638) == '\0')) { local_30 = -1; } Isaac::GetAxisAlignedUnitVectorFromDir(&local_20,familiar->_lastDirection); bVar1 = Entity_Familiar::TryAimAtMarkedTarget (familiar,&local_20,&familiar->_lastDirection,(Vector *)0x0); if ((bVar1 != 0) && (familiar->_fireCooldown == 0)) { local_30 = -1; } pvVar4 = familiar->_player; if ((((*(char *)((int)pvVar4 + 0x1398) != '\0') || (*(char *)((int)pvVar4 + 0x139a) != '\0')) || (*(int *)&g_game->_stageTransition != 0)) || ((*(char *)((int)pvVar4 + 0x410) == '\0' || (0 < *(int *)((int)pvVar4 + 0x414))))) { return; } if (local_30 != -1) { local_28 = familiar->_fireCooldown; if (local_28 < 0) { return; } if (0 < local_28) { local_28 = local_28 + -1; familiar->_fireCooldown = local_28; } (familiar->_sprite)._flipX = local_30 == 0; clampedDirection = local_30; if ((int)local_30 < 1) { clampedDirection = 0; } iVar2 = 3; if ((int)clampedDirection < 3) { iVar2 = clampedDirection; } iVar3 = apply_forgotten_lullaby(familiar,0x1e); animName = (&PTR_s_ChargeSide_00b644b4)[iVar2]; fVar5 = 1.0 - (float)local_28 / (float)iVar3; pvVar4 = ANM2::GetAnimationData(&familiar->_sprite,animName); local_20.x = (float)(int)((float)*(int *)((int)pvVar4 + 0x30) * fVar5); bVar1 = ANM2::SetAnimation(&familiar->_sprite,animName,1); if (((bVar1 != 0) && ((familiar->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(familiar->_sprite)._animState,(float)(int)local_20.x), (familiar->_sprite)._animState._animData != (void *)0x0)) { (familiar->_sprite)._animState._isPlaying = 0; } if ((familiar->_fireCooldown == 0) && (bVar1 = Entity::IsFrame((Entity *)familiar,5,0), bVar1 != 0)) { iVar2 = familiar->_state; if (iVar2 < 1) { iVar2 = 0; } iVar3 = 4; if (iVar2 < 4) { iVar3 = iVar2; } (**(code **)(*(int *)familiar + 0x3c))(&DAT_00c5c9b8 + iVar3 * 0x2c,5,0,1,0); } familiar->_lastDirection = local_30; return; } maxCooldown = apply_forgotten_lullaby(familiar,0x1e); iVar3 = familiar->_fireCooldown; if (iVar3 == maxCooldown) { (familiar->_sprite)._flipX = iVar2 == 0; ANM2::Play(&familiar->_sprite,(&PTR_s_FloatSide_00b64684)[iVar2],0); iVar3 = familiar->_fireCooldown; } if (iVar3 != 0) { if (iVar3 < 1) { return; } iVar2 = apply_forgotten_lullaby(familiar,0x1e); familiar->_fireCooldown = iVar2; return; } iVar2 = apply_forgotten_lullaby(familiar,-0xf); familiar->_fireCooldown = iVar2; animName = *(byte **)(&UNK_00b64674 + local_34 * 4); (familiar->_sprite)._flipX = local_34 == 0; ANM2::Play(&familiar->_sprite,animName,0); iVar2 = familiar->_state; if (iVar2 < 1) { iVar2 = 0; } spawnPos.x = (familiar->_velocity).x + (familiar->_pos).x + local_20.x * 20.0; iVar3 = 4; if (iVar2 < 4) { iVar3 = iVar2; } local_34 = (&DAT_00b64660)[iVar3]; local_3c = (&DAT_00b64540)[iVar3]; spawnPos.y = (familiar->_pos).y + (familiar->_velocity).y + local_20.y * 20.0; local_48 = (float)(&DAT_00b6452c)[iVar3]; local_38 = (float)(&DAT_00b64518)[iVar3]; bVar1 = Entity_Player::HasCollectible(familiar->_player,0xf7,0); if (bVar1 != 0) { local_34 = local_34 + (&DAT_00b64504)[iVar3]; local_3c = local_3c + (&DAT_00b6459c)[iVar3]; } bVar1 = Entity_Player::HasTrinket(familiar->_player,0x6a,0); if (bVar1 == 0) goto LAB_00638804; iVar2 = Entity_Player::GetTrinketMultiplier(familiar->_player,0x6a); if (iVar2 == 1) { fVar5 = (float)(&DAT_00b64588)[iVar3]; LAB_006387e6: local_48 = local_48 + fVar5; } else if (iVar2 == 2) { local_48 = (float)(&DAT_00b64588)[iVar3] * 1.25 + local_48; } else if (iVar2 == 3) { fVar5 = (float)(&DAT_00b64588)[iVar3] * 1.5; goto LAB_006387e6; } local_38 = (float)(int)(&DAT_00b64574)[iVar3] + local_38; LAB_00638804: driftX = (familiar->_velocity).x * 0.6; driftY = (familiar->_velocity).y * 0.6; fVar5 = local_20.y * driftY + local_20.x * driftX; projX = local_20.x * fVar5; fVar5 = local_20.y * fVar5; if (local_20.y * fVar5 + local_20.x * projX < 0.0) { driftX = driftX - projX; driftY = driftY - fVar5; } shotDirX = driftX * 0.1 + local_20.x; shotDirY = driftY * 0.1 + local_20.y; fVar5 = sqrtf(shotDirY * shotDirY + shotDirX * shotDirX); if (0.0 < fVar5) { shotDirX = shotDirX * (1.0 / fVar5); shotDirY = shotDirY * (1.0 / fVar5); } fireDir.x = shotDirX; fireDir.y = shotDirY; if (familiar->_state == 1) { local_30 = 0x41200000; spreadAngle = -90.0; local_28 = 2; do { angleRad = spreadAngle * 0.017453292; local_20.x = cos(angleRad); fVar5 = sin(angleRad); fireDir.x = shotDirX * local_20.x - shotDirY * fVar5; fireDir.y = shotDirX * fVar5 + shotDirY * local_20.x; FUN_006395e0(&spawnPos,&fireDir,local_34,local_38,(&DAT_00b644f0)[iVar3],local_48, (&DAT_00b64560)[iVar3],local_3c,familiar,local_30); local_28 = local_28 + -1; local_30 = local_30 ^ 0x80000000; spreadAngle = -spreadAngle; } while (local_28 != 0); } else { FUN_006395e0(&spawnPos,&fireDir,local_34,local_38,(&DAT_00b644f0)[iVar3],local_48, (&DAT_00b64560)[iVar3],local_3c,familiar,0); } manager = g_manager; local_28 = 0x1cb; seed_fart_sound_override(&local_28); SoundEffects::Play(&manager->_sfxManager,local_28,1.0,0,0,1.2,0.0); return; } //@@ 00638c10 Entity_Familiar::FireBrimstone /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity_Laser* Entity_Familiar::FireBrimstone(const Vector& AimDirection, bool Unk); prototype: REPENTOGON, confirmed by RET 8 */ Entity_Laser * __thiscall Entity_Familiar::FireBrimstone(Entity_Familiar *this,Vector *AimDirection,byte Unk) { EntityPtr tear; int direction; float fVar1; Vector local_4c; Vector *local_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; local_44 = AimDirection; if (*(char *)((int)this->_player + 0x173) == '\0') { fVar1 = AimDirection->x; local_4c.x = fVar1 * 10.0; local_4c.y = -19.0 - ABS(fVar1) * 4.0; fVar1 = atan2f(AimDirection->y,fVar1); tear = (EntityPtr) Entity_Laser::ShootAngle(1,&this->_pos,fVar1 * 57.295776,8,&local_4c,(Entity *)this,0); fVar1 = apply_tear_modifiers(this); (**(code **)(*(int *)tear + 0x40))(fVar1 * 3.0); *(void **)((int)tear + 0x4e0) = (void *)0x3f000000; Entity_Laser::ResetSpriteScale((Entity_Laser *)tear); if (-0.5 < local_44->y || local_44->y == -0.5) { fVar1 = 3000.0; } else { fVar1 = -10.0; } *(float *)((int)tear + 0x358) = fVar1; if (Unk == 0) { if (this->_isLilDelirium != 0) { local_20 = 0x3f800000; local_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; local_40 = 0x3e4ccccd; uStack_3c = 0x3f800000; uStack_38 = 0; uStack_34 = 0x3f800000; local_1c = 0x3f800000; local_18 = 0; (**(code **)(*(int *)tear + 0x3c))(&local_40,0xffffffff,0xff,0,1); } apply_baby_bender(this,(Entity_Tear *)tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); (**(code **)(*(int *)tear + 0xc))(); if (this->_linkedEntity != (EntityPtr)0x0) { local_4c.y = (float)&this->_linkedEntity; std::multiset::erase(&local_4c.y); } this->_linkedEntity = tear; std::multiset::insert(&this->_linkedEntity); this->_headFrameDelay = 0x1e; if (ABS(local_44->x) <= ABS(local_44->y)) { direction = (uint)(0.0 <= local_44->y) * 2 + 1; } else { direction = 2; if (local_44->x < 0.0) { direction = 0; } } PlayShootAnim(this,direction); } } else { tear = (EntityPtr)0x0; } return (Entity_Laser *)tear; } //@@ 00638e20 FUN_00638e20 void FUN_00638e20(void) { Entity_Familiar *in_ECX; in_ECX->_isLilDelirium = 1; Entity_Familiar::delirium_morph(in_ECX); return; } //@@ 00638e30 spawn_blue_spider /* DB: ? spawns familiar 3.73 (blue spider) toward pos, random near free spot if zero prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl spawn_blue_spider(Vector *position,Entity *spawner,Vector *target) { undefined4 uVar1; Vector *pVVar2; uint uVar3; Entity *pEVar4; float fVar5; float fVar6; float fVar7; float local_24; float local_1c; Vector local_18; Vector local_10; local_24 = target->x; local_1c = target->y; if ((local_24 == g_vectorZero.x) && (local_1c == g_vectorZero.y)) { pVVar2 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,position,80.0,1,0,0); uVar3 = Random(); fVar5 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar5 = fVar5 + fVar5; uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; fVar7 = cos(fVar5); local_24 = fVar7 * fVar6 * 20.0 + pVVar2->x; fVar5 = sin(fVar5); local_1c = fVar5 * fVar6 * 20.0 + pVVar2->y; } local_18.x = (local_24 - position->x) * 0.04; local_18.y = (local_1c - position->y) * 0.04; uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,3,0x49,position,&local_18,spawner,0,uVar3,0); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; uVar1 = *(undefined4 *)((int)&pEVar4->_flags + 4); (pEVar4->_targetPosition).x = local_24; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar1; pEVar4[3]._sprite._flipX = 0; pEVar4[3]._sprite._flipY = 0; *(undefined2 *)&pEVar4[3]._sprite.field_0x102 = 0xc100; (pEVar4->_targetPosition).y = local_1c; pEVar4[3]._sprite._championColor._offset[1] = local_18.x; pEVar4[3]._sprite._championColor._offset[2] = local_18.y; pEVar4->_entityCollisionClass = 0; return; } //@@ 00639000 Entity_Familiar::ThrowDip /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: own assert string; spawns 3.201 dip prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl Entity_Familiar::ThrowDip(int subType,Vector *position,Entity *spawner) { int *piVar1; uint uVar2; Entity *pEVar3; int playerColor; float *colorSlot; uint uVar4; qword *heapBytes; int *oldestDip; float score; float bestScore; undefined1 local_7c [8]; float local_74; uint dipCount; Entity *savedSpawner; int *local_64; float local_60 [15]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; ColorMod *dipColor; float dipListData; undefined4 flagsHigh; bool isUnderCap; Entity *owner; qword prevBytes; puStack_20 = (undefined1 *)(local_60 + 0x17); puStack_18 = &LAB_00af702d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_60 + 0x14); ExceptionList = &local_1c; savedSpawner = spawner; local_24 = uVar2; while( true ) { local_14 = -NAN; oldestDip = (int *)0x0; bestScore = 1e+10; local_64 = (int *)0x0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)(local_7c + 4),3,0xc9,-1 ,0,0); dipListData = local_74; local_14 = 0.0; uVar4 = 0; if (dipCount == 0) break; do { piVar1 = *(int **)((int)local_74 + uVar4 * 4); if ((((piVar1 != (int *)0x0) && (piVar1[10] == 3)) && (*(char *)((int)piVar1 + 0x173) == '\0') ) && ((Entity *)piVar1[0x104] == savedSpawner)) { local_60[0xc] = 10000.0; local_60[0xd] = 10000.0; local_60[0xe] = 10000.0; local_60[0] = 0.0; local_60[1] = 10000.0; local_60[2] = -200.0; local_60[3] = 20000.0; local_60[4] = 20000.0; local_60[5] = 10000.0; local_60[6] = 20000.0; local_60[7] = 0.0; local_60[8] = 0.0; local_60[9] = 0.0; local_60[10] = 0.0; local_60[0xb] = 0.0; if ((uint)piVar1[0xc] < 0xf) { score = local_60[piVar1[0xc]]; } else { score = 0.0; } score = score - (float)(g_game->_frameCount - piVar1[0xca]); if (score < bestScore) { oldestDip = piVar1; bestScore = score; } local_64 = (int *)((int)local_64 + 1); } uVar4 = uVar4 + 1; } while (uVar4 < dipCount); isUnderCap = local_64 < (int *)0x21; local_64 = oldestDip; if (isUnderCap) break; if (oldestDip == (int *)0x0) { KAGE_LogMessage(4,(byte *) "Entity_Familiar::ThrowDip: couldn\'t find a candidate for removal, remaining: %d\n" ); goto joined_r0x0063923f; } local_60[5] = 0.0; local_60[10] = g_vectorZero.y; local_60[0xc] = g_vectorZero.y; local_60[6] = 0.0; local_60[7] = 0.0; local_60[8] = 0.0; local_60[9] = g_vectorZero.x; local_60[0xb] = g_vectorZero.x; local_60[0xd] = 0.0; local_60[0xe] = 0.0; (**(code **)(*oldestDip + 0x24))(local_60 + 5,uVar2); local_14 = -NAN; if (local_7c[4] == '\0') { if (g_mainHeap == (void *)0x0) { heapBytes = &g_allocatedBytesNoHeap; } else { heapBytes = (qword *)((int)g_mainHeap + 0x30); } if (dipListData != 0.0) { uVar4 = *(uint *)((int)dipListData + -4); prevBytes = *heapBytes; *(uint *)heapBytes = (uint)*heapBytes - uVar4; *(uint *)((int)heapBytes + 4) = *(uint *)((int)heapBytes + 4) - (uint)((uint)prevBytes < uVar4); free((void *)((int)dipListData + -4)); } } } joined_r0x0063923f: if (local_7c[4] == '\0') { local_14 = -NAN; if (g_mainHeap == (void *)0x0) { heapBytes = &g_allocatedBytesNoHeap; } else { heapBytes = (qword *)((int)g_mainHeap + 0x30); } if (dipListData != 0.0) { uVar2 = *(uint *)((int)dipListData + -4); prevBytes = *heapBytes; *(uint *)heapBytes = (uint)*heapBytes - uVar2; *(uint *)((int)heapBytes + 4) = *(uint *)((int)heapBytes + 4) - (uint)((uint)prevBytes < uVar2); free((void *)((int)dipListData + -4)); } } local_14 = -NAN; uVar2 = Random(); owner = savedSpawner; pEVar3 = Game::Spawn(g_game,3,0xc9,position,&g_vectorZero,savedSpawner, -(uint)(4 < subType - 7U) & subType,uVar2); flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; if (((1 < *(int *)&g_game->_deathmatchManager) && (owner != (Entity *)0x0)) && (owner->_type == 1) ) { playerColor = 0; colorSlot = (float *)&(g_game->_playerManager).field_0x60; do { if (*colorSlot == owner[5]._color._offset[1]) goto LAB_006392f7; playerColor = playerColor + 1; colorSlot = colorSlot + 1; } while (playerColor < 4); playerColor = 5; LAB_006392f7: PlayerManager::GetPlayerColorValue((KColor *)local_7c,playerColor); dipColor = &(pEVar3->_sprite)._color; if (dipColor != (ColorMod *)(local_60 + 4)) { (pEVar3->_sprite)._color._colorize[0] = 0.0; (pEVar3->_sprite)._color._colorize[1] = 0.0; (pEVar3->_sprite)._color._colorize[2] = 0.0; (pEVar3->_sprite)._color._colorize[3] = 0.0; dipColor->_tint[0] = (float)local_7c._0_4_; (pEVar3->_sprite)._color._tint[1] = (float)local_7c._4_4_; (pEVar3->_sprite)._color._tint[2] = local_74; (pEVar3->_sprite)._color._tint[3] = 1.0; *(ulonglong *)(pEVar3->_sprite)._color._offset = CONCAT44((float)local_7c._4_4_ * 0.25,(float)local_7c._0_4_ * 0.25); (pEVar3->_sprite)._color._offset[2] = local_74 * 0.25; } } ExceptionList = local_1c; return pEVar3; } //@@ 006393a0 spawn_dip_at /* DB: ? spawns friendly dip (via FUN_00639000) with jump velocity toward pos, random pos if null; Poop, ThrowFriendlyDip prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl spawn_dip_at(int subType,Vector *position,Entity *spawner,Vector *targetPosition) { Room *this; uint uVar1; Vector *pVVar2; Entity *pEVar3; float fVar4; float fVar5; float fVar6; float local_24; float local_1c; Vector local_18; Vector local_10; local_24 = targetPosition->x; local_1c = targetPosition->y; if ((local_24 == g_vectorZero.x) && (local_1c == g_vectorZero.y)) { this = g_game->_room; uVar1 = Random(); fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; fVar5 = cos(fVar4); local_18.x = fVar5 * 80.0 + position->x; fVar4 = sin(fVar4); local_18.y = fVar4 * 80.0 + position->y; pVVar2 = Room::FindFreePickupSpawnPosition(this,&local_10,&local_18,80.0,1,0,0); uVar1 = Random(); fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; uVar1 = Random(); fVar5 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10; fVar6 = cos(fVar4); local_24 = fVar6 * fVar5 * 20.0 + pVVar2->x; fVar4 = sin(fVar4); local_1c = fVar4 * fVar5 * 20.0 + pVVar2->y; } fVar4 = (local_24 - position->x) * 0.04; local_18.x = (local_1c - position->y) * 0.04; pEVar3 = Entity_Familiar::ThrowDip(subType,position,spawner); (pEVar3->_targetPosition).x = local_24; (pEVar3->_velocity).x = fVar4; (pEVar3->_velocity).y = local_18.x; pEVar3[3]._sprite._flipX = 0; pEVar3[3]._sprite._flipY = 0; *(undefined2 *)&pEVar3[3]._sprite.field_0x102 = 0xc100; (pEVar3->_targetPosition).y = local_1c; pEVar3[3]._sprite._championColor._offset[1] = fVar4; pEVar3[3]._sprite._championColor._offset[2] = local_18.x; pEVar3[3]._shadowOffset.y = 2.8026e-45; return pEVar3; } //@@ 006395e0 FUN_006395e0 void FUN_006395e0(Vector *param_1,int *param_2,int param_3,int param_4,int param_5,float param_6, int param_7,int param_8,Entity *param_9,int param_10) { byte bVar1; uint seed; Entity *pEVar2; int *piVar3; int iVar4; uint in_ECX; int unaff_EBX; float fVar5; if (0 < param_3) { bVar1 = Room::IsPositionInRoom(g_game->_room,param_1,0.0); if (bVar1 != 0) { seed = Random(); pEVar2 = Game::SpawnEx(g_game,1000,in_ECX,param_1,&g_vectorZero,param_9,0,seed,0); piVar3 = (int *)__RTDynamicCast(pEVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); if (in_ECX == 0x20) { piVar3[0x11e] = (int)param_6; } else { fVar5 = param_6 * g_vectorOne.x; piVar3[0x3a] = (int)(param_6 * g_vectorOne.y); piVar3[0x39] = (int)fVar5; } (**(code **)(*piVar3 + 0x40))(param_5); piVar3[0x10e] = param_7; piVar3[0x10c] = param_5; piVar3[0x117] = param_8; piVar3[0x118] = param_8; piVar3[0x108] = *param_2; piVar3[0x109] = param_2[1]; piVar3[0x112] = param_10; piVar3[0x10d] = (int)param_6; iVar4 = 0; if (0 < param_3 + -1) { iVar4 = param_3 + -1; } piVar3[0x10a] = iVar4; piVar3[0x111] = (int)param_9; if (param_9 != (Entity *)0x0) { std::multiset::insert(piVar3 + 0x111); } piVar3[0x110] = unaff_EBX; piVar3[0x10b] = param_4; piVar3[0x10f] = param_8; (**(code **)(*piVar3 + 0xc))(); } } return; } //@@ 00639750 Entity_Familiar::FireProjectile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding EntityFamiliar:FireProjectile prototype: REPENTOGON, confirmed by RET 8 */ Entity_Tear * __thiscall Entity_Familiar::FireProjectile(Entity_Familiar *this,Vector *AimDirection,byte Unk) { BitSet128 flags; BitSet128 flags_00; BitSet128 flags_01; Vector velocity_00; byte bVar1; uint rngResult; int iVar2; ColorMod *other; Vector *pVVar3; uint uVar4; Entity_Tear *tear; float fVar5; int extraout_ECX; float fVar6; uint uVar7; float fVar8; undefined1 extraout_var [12]; float afVar9 [4]; float afVar10 [4]; EntityPtr *pEVar11; float fVar12; float tearDamage; float tearScale; float local_140; float fStack_13c; float local_138; float fStack_134; float local_12c; float local_128; Vector *local_124; float velocityY; float velocityX; float fallingSpeed; Vector velocity; EntityPtr *local_10c; Vector local_108; float local_100; float local_fc; Vector local_f8; Vector local_f0; float local_e8; float local_e4; float local_dc; ColorMod tmpColor; Color tearColor; uint hitParams [2]; ColorMod CStack_78; uint uStack_48; uint uStack_44; uint uStack_40; uint uStack_3c; float fStack_38; float fStack_34; uint local_14; local_14 = __security_cookie ^ (uint)&tearDamage; fallingSpeed = 0.0; velocityX = AimDirection->x * 10.0; velocityY = AimDirection->y * 10.0; velocity.x = velocityX; velocity.y = velocityY; if (Unk == 0) { iVar2 = this->_variant; if (iVar2 == 200) { tearScale = *(float *)((int)this->_player + 0x360) * 0.6; local_12c = *(float *)((int)this->_player + 0x364) * 0.6; tearScale = tearScale + tearScale; local_12c = local_12c + local_12c; local_124 = (Vector *)AimDirection->x; local_128 = AimDirection->y; fVar8 = sqrtf((float)local_124 * (float)local_124 + local_128 * local_128); if (0.0 < fVar8) { local_124 = (Vector *)(AimDirection->x * (1.0 / fVar8)); local_128 = AimDirection->y * (1.0 / fVar8); } local_10c = (EntityPtr *)AimDirection->x; local_100 = AimDirection->y; fVar8 = sqrtf((float)local_10c * (float)local_10c + local_100 * local_100); if (fVar8 <= 0.0) { pEVar11 = local_10c; fVar8 = local_100; } else { pEVar11 = (EntityPtr *)(AimDirection->x * (1.0 / fVar8)); fVar8 = AimDirection->y * (1.0 / fVar8); } fVar8 = fVar8 * local_12c + (float)pEVar11 * tearScale; fVar12 = local_128 * fVar8; fVar8 = (float)local_124 * fVar8; velocity.x = tearScale; velocity.y = local_12c; if (fVar12 * AimDirection->y + fVar8 * AimDirection->x < 0.0) { velocity.x = tearScale - fVar8; velocity.y = local_12c - fVar12; } velocity.x = velocityX + velocity.x; velocity.y = velocityY + velocity.y; } else { if ((iVar2 == 8) || (iVar2 == 0xf4)) { fVar8 = *(float *)((int)this->_player + 0x360) * 0.6; fVar12 = *(float *)((int)this->_player + 0x364) * 0.6; velocityX = velocityX - (fVar8 + fVar8); velocityY = velocityY - (fVar12 + fVar12); } else { fVar8 = *(float *)((int)this->_player + 0x360) * 0.6; fVar12 = *(float *)((int)this->_player + 0x364) * 0.6; velocityX = velocityX + fVar8 + fVar8; velocityY = velocityY + fVar12 + fVar12; } velocity.x = velocityX; velocity.y = velocityY; if ((velocityY * velocityY + velocityX * velocityX < 100.0) && (iVar2 != 0x6c)) { pVVar3 = Vector::Normalized(&velocity,&local_108); velocity.x = pVVar3->x * 10.0; velocity.y = pVVar3->y * 10.0; } } } velocityY = velocity.y; velocityX = velocity.x; if ((this->_variant == 0xce) || (this->_variant == 0xed)) { velocity_00.y = velocity.y; velocity_00.x = velocity.x; tear = fire_wisp_projectile(this,velocity_00); return tear; } uVar7 = 0; local_12c = 0.0; local_140 = 0.0; fStack_13c = 0.0; local_138 = 0.0; fStack_134 = 0.0; local_124 = (Vector *)apply_tear_modifiers(this); fVar8 = apply_tear_modifiers(this); fVar12 = 0.8; tearDamage = 3.5; local_10c = (EntityPtr *)0x0; afVar9[0] = (fVar8 * 0.25 + 0.75) * 0.8; afVar9[1] = (float)extraout_var._0_4_; afVar9[2] = (float)extraout_var._4_4_; afVar9[3] = (float)extraout_var._8_4_; tearScale = afVar9[0]; Color::Color(&tearColor); uVar4 = this->_variant; if (uVar4 == 0x4a) { local_100 = (float)this->_subtype; LAB_00639ad8: local_128 = 0.0; if (local_100 == 1.12104e-44) goto LAB_00639ae3; } else { local_100 = -NAN; if (uVar4 != 0xb) goto LAB_00639ad8; LAB_00639ae3: rngResult = Random(); afVar9 = (float [4])ZEXT416((uint)tearScale); fVar12 = 0.8; uVar4 = this->_variant; local_128 = (float)(rngResult % 10 + 1); } afVar10 = afVar9; if (uVar4 == 0xc) { local_140 = DAT_00c34b50; fStack_13c = DAT_00c34b54; local_138 = DAT_00c34b58; fStack_134 = DAT_00c34b5c; if (this->_player != (Entity_Player *)0x0) { iVar2 = Entity_Player::GetTrinketMultiplier(this->_player,0x36); afVar10 = afVar9; if (1 < iVar2) { tearDamage = *(float *)((int)this->_player + 0x1470); if (2 < iVar2) { afVar10._0_8_ = (double)tearDamage * 1.5; afVar10[2] = 0.0; afVar10[3] = 0.0; tearDamage = (float)afVar10._0_8_; } } } goto LAB_0063a552; } afVar10._4_12_ = afVar9._4_12_; if (((uVar4 == 9) || (local_128 == 1.4013e-45)) || (local_100 == 8.40779e-45)) { local_140 = (float)g_tearFlagSpectral._l; fStack_13c = g_tearFlagSpectral._l._4_4_; tearColor._tint[0] = _DAT_00babc50; tearColor._tint[1] = _UNK_00babc54; tearColor._tint[2] = _UNK_00babc58; tearColor._tint[3] = _UNK_00babc5c; local_138 = (float)g_tearFlagSpectral._h; fStack_134 = g_tearFlagSpectral._h._4_4_; afVar10 = _DAT_00babc50; } else { fVar8 = afVar9[0]; if (((uVar4 == 10) || (local_128 == 2.8026e-45)) || (local_100 == 9.80909e-45)) { tearScale = fVar8 * 0.9; uVar7 = 1; local_12c = 1.4013e-45; afVar10._0_12_ = ZEXT812(0x40800000); afVar10[3] = 0.0; tearDamage = afVar10[0]; goto LAB_0063a552; } if ((local_128 == 4.2039e-45) || (local_100 == 1.12104e-44)) { uVar7 = 1; afVar10[0] = fVar8 * fVar12; afVar10[1] = (float)afVar9[1]; afVar10[2] = (float)afVar9[2]; afVar10[3] = (float)afVar9[3]; local_12c = 1.4013e-45; fallingSpeed = 1.2; tearDamage = 3.0; tearScale = afVar10[0]; goto LAB_0063a552; } if (((uVar4 == 6) || (local_128 == 5.60519e-45)) || (local_100 == 5.60519e-45)) { afVar10[0] = fVar8 * 1.06; uVar7 = 1; local_12c = 1.4013e-45; tearDamage = 5.0; tearScale = afVar10[0]; goto LAB_0063a552; } if (((uVar4 == 4) || (local_128 == 7.00649e-45)) || (local_100 == 2.8026e-45)) { local_140 = (float)(DAT_00c34c30 | DAT_00c34ad0); fStack_13c = (float)(DAT_00c34c34 | DAT_00c34ad4); local_138 = (float)(DAT_00c34c38 | DAT_00c34ad8); fStack_134 = (float)(DAT_00c34c3c | DAT_00c34adc); tearColor._tint[0] = _DAT_00bac560; tearColor._tint[1] = _UNK_00bac564; tearColor._tint[2] = _UNK_00bac568; tearColor._tint[3] = _UNK_00bac56c; tearColor._offset[0] = -0.5882353; tearColor._offset[1] = -0.5882353; tearColor._offset[2] = -0.5882353; afVar10 = _DAT_00bac560; goto LAB_0063a552; } if (((uVar4 == 5) || (local_128 == 8.40779e-45)) || (local_100 == 4.2039e-45)) { uVar7 = 0x15; local_140 = (float)g_tearFlagHoming._l; fStack_13c = g_tearFlagHoming._l._4_4_; fallingSpeed = -3.0; local_12c = 2.94273e-44; local_138 = (float)g_tearFlagHoming._h; fStack_134 = g_tearFlagHoming._h._4_4_; goto LAB_0063a54a; } if ((uVar4 == 0xd) || (local_128 == 9.80909e-45)) { local_140 = (float)((uint)(float)g_tearFlagSpectral._l | (uint)(float)g_tearFlagHoming._l); fStack_13c = (float)((uint)g_tearFlagSpectral._l._4_4_ | (uint)g_tearFlagHoming._l._4_4_); local_138 = (float)((uint)(float)g_tearFlagSpectral._h | (uint)(float)g_tearFlagHoming._h); fStack_134 = (float)((uint)g_tearFlagSpectral._h._4_4_ | (uint)g_tearFlagHoming._h._4_4_); fallingSpeed = -3.0; tearColor._tint[0] = _DAT_00babc50; tearColor._tint[1] = _UNK_00babc54; tearColor._tint[2] = _UNK_00babc58; tearColor._tint[3] = _UNK_00babc5c; afVar10 = _DAT_00babc50; goto LAB_0063a552; } if (uVar4 == 0x2d) { local_12c = 1.4013e-45; uVar7 = 1; goto LAB_0063a552; } if (((0x45 < uVar4) && (uVar4 < 0x49)) || (local_128 == 1.12104e-44)) { uVar4 = Random(); if ((uVar4 % 10 == 0) || (local_128 == 1.12104e-44)) { local_140 = DAT_00c34c10; fStack_13c = DAT_00c34c14; local_138 = DAT_00c34c18; fStack_134 = DAT_00c34c1c; } tearColor._tint[0] = _DAT_00bac6e0; tearColor._tint[1] = _UNK_00bac6e4; tearColor._tint[2] = _UNK_00bac6e8; tearColor._tint[3] = _UNK_00bac6ec; tearColor._offset[0] = 0.19607845; tearColor._offset[1] = 0.0; tearColor._offset[2] = 0.0; afVar10 = _DAT_00bac6e0; if (this->_variant == 0x48) { local_140 = (float)((uint)local_140 | DAT_00c34af0); fStack_13c = (float)((uint)fStack_13c | DAT_00c34af4); local_138 = (float)((uint)local_138 | DAT_00c34af8); fStack_134 = (float)((uint)fStack_134 | DAT_00c34afc); } goto LAB_0063a552; } if (((uVar4 == 7) || (local_100 == 7.00649e-45)) || (local_128 == 1.4013e-44)) { tearColor._tint[0] = _DAT_00babfa0; tearColor._tint[1] = _UNK_00babfa4; tearColor._tint[2] = _UNK_00babfa8; tearColor._tint[3] = _UNK_00babfac; tearDamage = 6.0; afVar10 = _DAT_00babfa0; goto LAB_0063a552; } if (uVar4 == 0x6b) { tearDamage = 6.0; tmpColor._colorize = (float [4])ZEXT816(0); local_12c = 8.40779e-45; tmpColor._tint[0] = _DAT_00bac7b0; tmpColor._tint[1] = _UNK_00bac7b4; tmpColor._tint[2] = _UNK_00bac7b8; tmpColor._tint[3] = _UNK_00bac7bc; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.2; tmpColor._offset[2] = 0.4; afVar10 = _DAT_00bac7b0; Color::operator_assign(&tearColor,&tmpColor); uVar7 = 6; goto LAB_0063a552; } if ((uVar4 == 0x61) || (local_100 == 1.4013e-44)) { tearColor._tint[0] = _DAT_00babfa0; tearColor._tint[1] = _UNK_00babfa4; tearColor._tint[2] = _UNK_00babfa8; tearColor._tint[3] = _UNK_00babfac; afVar10 = _DAT_00babfa0; goto LAB_0063a552; } if (((uVar4 == 0x50) || (uVar4 == 0x51)) || (uVar4 == 0x4c)) { uVar4 = Random(); Entity_Player::GetTearHitParams(hitParams,1,local_124,(uVar4 & 1) * 2 + -1,0); Color::operator_assign(&tearColor,&CStack_78); local_fc = (float)(~(DAT_00c34b08 | (uint)g_tearFlagLudovico._h | DAT_00c34af8) & uStack_40); local_108.x = (float)(~(DAT_00c34b04 | g_tearFlagLudovico._l._4_4_ | DAT_00c34af4) & uStack_44 ); local_f8.x = (float)(~(DAT_00c34b0c | g_tearFlagLudovico._h._4_4_ | DAT_00c34afc) & uStack_3c) ; fVar8 = (float)(~(DAT_00c34b00 | (uint)g_tearFlagLudovico._l | DAT_00c34af0) & uStack_48); tearDamage = fStack_38; local_140 = fVar8; fStack_13c = local_108.x; local_138 = local_fc; fStack_134 = local_f8.x; bVar1 = Entity_Player::HasCollectible(this->_player,0x95,0); if (bVar1 != 0) { fStack_13c = (float)((uint)local_108.x | g_tearFlagExplosive._l._4_4_); local_140 = (float)((uint)fVar8 | (uint)g_tearFlagExplosive._l); local_138 = (float)((uint)local_fc | (uint)g_tearFlagExplosive._h); fStack_134 = (float)((uint)local_f8.x | g_tearFlagExplosive._h._4_4_); } tearScale = fStack_34; fallingSpeed = -*(float *)((int)this->_player + 0x1478); local_10c = *(EntityPtr **)((int)this->_player + 0x147c); afVar10 = (float [4])ZEXT416(local_10c); local_12c = (float)hitParams[0]; uVar7 = hitParams[0]; goto LAB_0063a552; } if ((uVar4 == 0x58) && (this->_state == 2)) { uVar4 = Random(); afVar10 = afVar9; if (uVar4 % 10 == 0) { local_140 = DAT_00c34aa0; fStack_13c = DAT_00c34aa4; local_138 = DAT_00c34aa8; fStack_134 = DAT_00c34aac; goto LAB_0063a54a; } } iVar2 = this->_variant; if (iVar2 == 0x5c) { fStack_13c = g_tearFlagHoming._l._4_4_; local_140 = (float)g_tearFlagHoming._l; fStack_134 = g_tearFlagHoming._h._4_4_; local_138 = (float)g_tearFlagHoming._h; Color::Color((Color *)&tmpColor); Color::operator_assign(&tearColor,other); if (*(int *)&g_game->_deathmatchManager < 2) { tearDamage = 10.0; } else { tearDamage = 6.0; } tearScale = 1.1; velocityX = velocityX * 0.75; fallingSpeed = -0.75; velocityY = velocityY * 0.75; afVar10 = (float [4])ZEXT416((uint)velocityY); velocity.x = velocityX; velocity.y = velocityY; goto LAB_0063a552; } if (iVar2 == 0x4c) { tearDamage = *(float *)((int)this->_player + 0x157c); goto LAB_0063a552; } if (iVar2 == 0x6c) { local_12c = 1.4013e-45; pVVar3 = MusicManager::RandomVector(&local_108); uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar12 = fVar8 * pVVar3->y; fVar8 = fVar8 * pVVar3->x; velocityX = fVar8 + fVar8 + velocityX; velocityY = velocityY + fVar12 + fVar12; velocity.x = velocityX; velocity.y = velocityY; uVar4 = Random(); uVar7 = Random(); local_10c = (EntityPtr *)0x3f000000; tearScale = tearScale * ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.05 + ((float)(uVar4 & 1) + 0.0) * 0.4 + 0.9); uVar4 = Random(); fallingSpeed = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 15.0 + 5.0; afVar10 = (float [4])ZEXT416((uint)fallingSpeed); fallingSpeed = 0.0 - fallingSpeed; uVar7 = 1; goto LAB_0063a552; } if (iVar2 == 8) { iVar2 = *(int *)((int)this->_player + 0x13c0); if ((iVar2 == 2) || (iVar2 == 0x17)) goto LAB_0063a061; LAB_0063a140: if (local_100 != 1.54143e-44) goto LAB_0063a552; } else { if (iVar2 == 0xf4) { LAB_0063a061: local_12c = 1.4013e-45; tearDamage = 7.5; uVar7 = 1; goto LAB_0063a552; } if (iVar2 == 200) { tmpColor._tint[2] = 1.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[3] = 1.0; tearDamage = 1.5; tmpColor._colorize[0] = _DAT_00bac850; tmpColor._colorize[1] = _UNK_00bac854; tmpColor._colorize[2] = _UNK_00bac858; tmpColor._colorize[3] = _UNK_00bac85c; tmpColor._offset[0] = 0.4; tmpColor._offset[1] = 0.4; tmpColor._offset[2] = 0.38; afVar10 = _DAT_00bac850; Color::operator_assign(&tearColor,&tmpColor); goto LAB_0063a552; } if (iVar2 == 0xe1) { fVar8 = 3.0; tearDamage = 3.0; Random(); FUN_0067af30(); fallingSpeed = 0.0; tearScale = fVar8 * 1.25 * tearScale; afVar10._0_12_ = ZEXT812(0xbccccccd); afVar10[3] = 0.0; local_10c = afVar10[0]; goto LAB_0063a552; } if (iVar2 != 0xd1) goto LAB_0063a140; } uVar7 = 0x29; tearScale = tearScale * 1.1; afVar10 = (float [4])ZEXT416((uint)tearScale); local_dc = DAT_00c349e0; local_f8.x = DAT_00c349e4; local_140 = DAT_00c349e0; fStack_13c = DAT_00c349e4; local_12c = 5.74532e-44; local_fc = DAT_00c349e8; local_108.x = DAT_00c349ec; local_138 = DAT_00c349e8; fStack_134 = DAT_00c349ec; uVar4 = Random(); if (uVar4 % 10 != 0) goto LAB_0063a552; local_140 = (float)((uint)local_dc | DAT_00c34be0); fStack_13c = (float)((uint)local_f8.x | DAT_00c34be4); local_138 = (float)((uint)local_fc | DAT_00c34be8); fStack_134 = (float)((uint)local_108.x | DAT_00c34bec); } LAB_0063a54a: LAB_0063a552: if (this->_isLilDelirium != 0) { if (uVar7 == 0) { uVar7 = 1; } tearColor._colorize[0] = _DAT_00bac940; tearColor._colorize[1] = _UNK_00bac944; tearColor._colorize[2] = _UNK_00bac948; tearColor._colorize[3] = _UNK_00bac94c; afVar10 = _DAT_00bac940; local_12c = (float)uVar7; } local_108.x = (float)((uint)fStack_134 & DAT_00c3496c); if (((((uint)local_140 & DAT_00c34960) != 0 || ((uint)fStack_13c & DAT_00c34964) != 0) || (((uint)local_138 & DAT_00c34968) != 0 || (EntityPtr *)local_108.x != (EntityPtr *)0x0)) && (bVar1 = Entity_Player::HasCollectible(this->_player,0xe9,0), bVar1 == 0)) { fVar8 = *(float *)((int)this->_player + 0x1474); fallingSpeed = ((fVar8 * 0.75) / *(float *)((int)this->_player + 0x1464)) * (23.75 / -fVar8); afVar10._0_12_ = ZEXT812(0x3fa66666); afVar10[3] = 0.0; local_10c = afVar10[0]; } if (this->_player != (Entity_Player *)0x0) { bVar1 = Entity_Player::IsHologram(this->_player); if (bVar1 != 0) { afVar10 = (float [4])ZEXT416((uint)(tearColor._tint[3] * 0.25)); tearColor._tint[3] = tearColor._tint[3] * 0.25; } if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(extraout_ECX + 0x1618)), bVar1 == 0 )) { FUN_00925df0(); tearColor._tint[3] = afVar10[0] * tearColor._tint[3]; } } if (((this->_variant == 10) || (local_128 == 1.26117e-44)) || (local_100 == 9.80909e-45)) { local_128 = 2.8026e-45; local_f0.x = velocityX - velocityY * 0.2; local_f0.y = velocityX * 0.2 + velocityY; local_e8 = velocityY * 0.2 + velocityX; local_e4 = velocityY - velocityX * 0.2; tearDamage = tearDamage * (float)local_124; if (tearScale <= 0.01) { tearScale = 0.01; } local_124 = &local_f0; do { pVVar3 = local_124; uVar4 = Random(); tear = (Entity_Tear *) Game::SpawnEx(g_game,2,(uint)local_12c,&this->_pos,pVVar3,(Entity *)this,0,uVar4,0); uVar4 = Random(); tear->_fallingSpeed = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + fallingSpeed; tear->_fallingAccel = (float)local_10c; (**(code **)(*(int *)tear + 0x40))(tearDamage); flags_01._l._4_4_ = local_140; flags_01._l._0_4_ = tearScale; flags_01._h._0_4_ = fStack_13c; flags_01._h._4_4_ = local_138; Entity_Tear::SetTearFlags(tear,flags_01); tear->_baseScale = tearDamage; tear->_fScale = tearDamage; Entity_Tear::ResetSpriteScale(tear); (**(code **)(*(int *)tear + 0x3c))(tmpColor._offset + 2,0xffffffff,0xff,0,1); if (tear->_parent != (EntityPtr)0x0) { local_108.x = (float)&tear->_parent; std::multiset::erase(&local_108); } tear->_parent = (EntityPtr)this; std::multiset::insert(&tear->_parent); uVar4 = Random(); tear->_tearIdx = uVar4 & 1; TryFireTear(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); local_124 = local_124 + 1; local_128 = (float)((int)local_128 + -1); } while (local_128 != 0.0); return tear; } tearDamage = tearDamage * (float)local_124; if (tearScale <= 0.01) { tearScale = 0.01; } if (this->_variant != 200) { uVar4 = Random(); tear = (Entity_Tear *) Game::SpawnEx(g_game,2,uVar7,&this->_pos,&velocity,(Entity *)this,0,uVar4,0); uVar4 = Random(); tear->_fallingSpeed = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + fallingSpeed; tear->_fallingAccel = (float)local_10c; (**(code **)(*(int *)tear + 0x40))(tearDamage); flags_00._l._4_4_ = local_140; flags_00._l._0_4_ = tearScale; flags_00._h._0_4_ = fStack_13c; flags_00._h._4_4_ = local_138; Entity_Tear::SetTearFlags(tear,flags_00); tear->_baseScale = tearDamage; tear->_fScale = tearDamage; Entity_Tear::ResetSpriteScale(tear); if (tear->_parent != (EntityPtr)0x0) { local_10c = &tear->_parent; std::multiset::erase(&local_10c); } tear->_parent = (EntityPtr)this; std::multiset::insert(&tear->_parent); (**(code **)(*(int *)tear + 0x3c))(tmpColor._offset + 2,0xffffffff,0xff,0,1); uVar4 = Random(); tear->_tearIdx = uVar4 & 1; TryFireTear(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); return tear; } local_124 = (Vector *)0x0; do { local_128 = ((float)(int)local_124 / 3.0) * 10.0 - 5.0; local_108.x = (((float)(int)local_124 / 3.0) * 180.0 - 90.0) * 0.017453292; local_fc = cos(local_108.x); fVar8 = sin(local_108.x); local_128 = local_128 * 0.017453292; local_f8.x = (AimDirection->x * local_fc - AimDirection->y * fVar8) * 10.0 + (this->_pos).x; local_f8.y = (AimDirection->y * local_fc + AimDirection->x * fVar8) * 10.0 + (this->_pos).y; local_108.x = cos(local_128); fVar8 = sin(local_128); velocity.x = velocityX * local_108.x - velocityY * fVar8; velocity.y = velocityY * local_108.x + velocityX * fVar8; uVar4 = Random(); tear = (Entity_Tear *) Game::SpawnEx(g_game,2,(uint)local_12c,&local_f8,&velocity,(Entity *)this,0,uVar4,0); uVar4 = Random(); tear->_fallingSpeed = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + fallingSpeed; tear->_fallingAccel = (float)local_10c; (**(code **)(*(int *)tear + 0x40))(tearDamage); uVar4 = Random(); if (uVar4 % 10 == 0) { fVar8 = tearScale; fVar12 = local_140; fVar6 = fStack_13c; fVar5 = local_138; } else { fVar8 = (float)((uint)tearScale | DAT_00c34c30); fVar12 = (float)((uint)local_140 | DAT_00c34c34); fVar6 = (float)((uint)fStack_13c | DAT_00c34c38); fVar5 = (float)((uint)local_138 | DAT_00c34c3c); local_f8.y = fVar8; local_f0.x = fVar12; local_f0.y = fVar6; local_e8 = fVar5; } flags._l._4_4_ = fVar12; flags._l._0_4_ = fVar8; flags._h._0_4_ = fVar6; flags._h._4_4_ = fVar5; Entity_Tear::SetTearFlags(tear,flags); tear->_baseScale = tearDamage; tear->_fScale = tearDamage; Entity_Tear::ResetSpriteScale(tear); (**(code **)(*(int *)tear + 0x3c))(tmpColor._offset + 2,0xffffffff,0xff,0,1); if (tear->_parent != (EntityPtr)0x0) { local_108.x = (float)&tear->_parent; std::multiset::erase(&local_108); } tear->_parent = (EntityPtr)this; std::multiset::insert(&tear->_parent); uVar4 = Random(); tear->_tearIdx = uVar4 & 1; TryFireTear(this,tear); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); local_124 = (Vector *)((int)local_124 + 1); } while ((int)local_124 < 4); return tear; } //@@ 0063acf0 FamiliarHelper::sprinkler_fire_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=familiar (Sprinkler), XMM1=angle, XMM2=distance: Entity_Laser::ShootAngle from the familiar position (offset -32 up) with laser variant 1, or 9 when the owner (+0x410) has Technology (68), returns the laser; three times from FamiliarAI::sprinkler (single, 4-way, multishot) */ Entity_Laser * FamiliarHelper::sprinkler_fire_laser(void) { byte bVar1; Entity_Laser *pEVar2; Entity_Player *this; float *pfVar3; Entity *in_ECX; int iVar4; float fVar5; float in_XMM1_Da; float in_XMM2_Da; float fStack_bc; float fStack_b8; undefined1 local_90 [4]; float local_8c; float local_88; float local_84; Vector local_80 [5]; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_c; local_c = __security_cookie ^ (uint)local_90; iVar4 = 1; local_88 = in_XMM2_Da; local_84 = in_XMM1_Da; bVar1 = Entity_Player::HasCollectible(*(Entity_Player **)&in_ECX[1].field_0x4,0x44,0); local_8c = local_84 * 0.017453292; if (bVar1 != 0) { iVar4 = 9; } fVar5 = cos(local_8c); local_80[0].x = fVar5 * local_88 + 0.0; fVar5 = sin(local_8c); local_80[0].y = fVar5 * local_88 - 32.0; fStack_b8 = 9.154014e-39; pEVar2 = Entity_Laser::ShootAngle(iVar4,&in_ECX->_pos,local_84,5,local_80,in_ECX,0); Random(); Entity_Player::GetTearHitParams(); iVar4 = *(int *)pEVar2; fStack_b8 = 3.57331e-43; fStack_bc = -NAN; *(undefined4 *)&(pEVar2->_tearFlags)._l = uStack_54; *(undefined4 *)((int)&(pEVar2->_tearFlags)._l + 4) = uStack_50; *(undefined4 *)&(pEVar2->_tearFlags)._h = uStack_4c; *(undefined4 *)((int)&(pEVar2->_tearFlags)._h + 4) = uStack_48; (**(code **)(iVar4 + 0x3c))(&local_84); (**(code **)(*(int *)pEVar2 + 0x40))(uStack_58); fVar5 = fStack_bc; pEVar2->_renderDepthOffset = 3000.0; this = *(Entity_Player **)((int)fStack_bc + 0x410); if (this->_playerType == 7) { LAB_0063ae4f: bVar1 = Entity_Player::HasCollectible(this,0x76,0); if (bVar1 == 0) { fStack_bc = 60.0; fStack_b8 = 32.0 - *(float *)(*(int *)((int)fVar5 + 0x410) + 0x1474) * 2.5; pfVar3 = &fStack_b8; if (fStack_b8 <= 60.0) { pfVar3 = &fStack_bc; } fVar5 = *pfVar3; goto LAB_0063aec8; } } else { bVar1 = TemporaryEffects::HasTrinketEffect(&this->_temporaryeffects,0xa2); if (bVar1 != 0) { this = *(Entity_Player **)((int)fVar5 + 0x410); goto LAB_0063ae4f; } } fVar5 = 115.0 - *(float *)(*(int *)((int)fVar5 + 0x410) + 0x1474) * 2.5; LAB_0063aec8: pEVar2->_maxDistance = fVar5; return pEVar2; } //@@ 0063aef0 Entity_Familiar::sprinkler_shoot_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=the familiar (MOV ECX,EDI in FamiliarAI::sprinkler); Entity_Laser::ShootAngle(variant 2, this+0x33c pos, angle XMM1, timeout 3, offset (cos,sin)*dist-32), laser+0x515=1, Entity_Player::GetTearHitParams(weapon 3) copied into laser tear flags/color, spectral -> grid collision 6 else 3; sprinkler calls it for its Technology shots (extra for Mom's Eye 0x37, Monstro's Lung 0xe5, multishot) */ Entity_Laser * __thiscall Entity_Familiar::sprinkler_shoot_laser(Entity_Familiar *this) { bool bVar1; Entity_Laser *pEVar2; uint uVar3; int iVar4; float fVar5; float in_XMM1_Da; float in_XMM2_Da; undefined1 auStack_90 [4]; float local_8c; float local_88; float local_84; Vector local_80; undefined1 local_78 [12]; uint uStack_6c; uint uStack_68; uint uStack_64; uint uStack_60; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_c; local_c = __security_cookie ^ (uint)auStack_90; local_88 = in_XMM1_Da * 0.017453292; local_8c = in_XMM2_Da; local_84 = in_XMM1_Da; fVar5 = cos(local_88); local_80.x = fVar5 * local_8c + 0.0; fVar5 = sin(local_88); local_80.y = fVar5 * local_8c - 32.0; pEVar2 = Entity_Laser::ShootAngle(2,&this->_pos,local_84,3,&local_80,(Entity *)this,0); pEVar2->_oneHit = 1; uVar3 = Random(); Entity_Player::GetTearHitParams(local_78,3,0x3f800000,(uVar3 & 1) * 2 + -1,0); iVar4 = *(int *)pEVar2; *(undefined4 *)&(pEVar2->_tearFlags)._l = uStack_54; *(undefined4 *)((int)&(pEVar2->_tearFlags)._l + 4) = uStack_50; *(undefined4 *)&(pEVar2->_tearFlags)._h = uStack_4c; *(undefined4 *)((int)&(pEVar2->_tearFlags)._h + 4) = uStack_48; (**(code **)(iVar4 + 0x3c))(&local_84,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar2 + 0x40))(uStack_58); if (((uStack_6c & (uint)g_tearFlagSpectral._l) == 0 && (uStack_68 & g_tearFlagSpectral._l._4_4_) == 0) && ((uStack_64 & (uint)g_tearFlagSpectral._h) == 0 && (uStack_60 & g_tearFlagSpectral._h._4_4_) == 0)) { bVar1 = false; } else { bVar1 = true; } pEVar2->_renderDepthOffset = 3000.0; iVar4 = 3; if (bVar1) { iVar4 = 6; } pEVar2->_entityGridCollisionClass = iVar4; return pEVar2; } //@@ 0063b070 FamiliarAI::sprinkler_spawn_knife /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX = familiar: Entity_Player::GetTearHitParams, random angle, Game::SpawnEx type 8 (Entity_Knife, dynamic_cast) at the familiar position; only caller FamiliarAI::sprinkler (Sprinkler + Mom's Knife) */ Entity_Knife * __fastcall FamiliarAI::sprinkler_spawn_knife(Entity_Familiar *familiar) { int iVar1; Vector direction; uint uVar2; uint seed; Entity *pEVar3; Entity_Knife *this; float fVar4; float fVar5; EntityPtr source; undefined1 auStack_aa [18]; float local_90; Vector local_8c; Entity_Familiar *local_84; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; EntityPtr EStack_44; uint local_c; local_c = __security_cookie ^ (uint)&local_90; local_84 = familiar; uVar2 = Random(); Entity_Player::GetTearHitParams(); seed = Random(); cos(0.017453292); fVar4 = sin(0.017453292); local_90 = fVar4 * (float)((uVar2 & 1) * 2 + -1) + (familiar->_pos).y; pEVar3 = Game::SpawnEx(g_game,8,0,(Vector *)(auStack_aa + 0x16),&g_vectorZero,(Entity *)familiar,1 ,seed,0); this = (Entity_Knife *)__RTDynamicCast(pEVar3,0); iVar1 = *(int *)this; (this->_posOffset).x = 0.0; (this->_posOffset).y = -32.0; (**(code **)(iVar1 + 0x40))(); fVar4 = 3.57331e-43; (**(code **)(*(int *)this + 0x3c))(&local_8c.y,0xffffffff); source = EStack_44; if (this->_parent != (EntityPtr)0x0) { std::multiset::erase(auStack_aa + -0xe); source = EStack_44; } this->_parent = source; std::multiset::insert(&this->_parent); *(undefined4 *)&(this->_tearFlags)._l = uStack_6c; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = uStack_68; *(undefined4 *)&(this->_tearFlags)._h = uStack_64; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = uStack_60; fVar5 = cos(fVar4); fVar4 = sin(fVar4); direction.y = fVar4; direction.x = fVar5; Entity_Knife::InitHomingPath(this,direction,(Entity *)source,0.0); this->_pathFollowSpeed = 0.05; (**(code **)(*(int *)this + 0xc))(); return this; } //@@ 0063b240 FUN_0063b240 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ void FUN_0063b240(void) { byte *text; int iVar1; byte extraout_CL; byte extraout_CL_00; byte bVar2; int in_ECX; int iVar3; byte *pbVar4; void *ptr; uint size; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6ebd; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&local_2c + 0x28U; ExceptionList = &local_10; local_2c._size = 0; iVar3 = *(int *)(in_ECX + 0xd88); local_2c._capacity = 0xf; if (iVar3 < 1) { iVar3 = 0; } local_2c._buf._0_4_ = (void *)0x0; iVar1 = 4; if (iVar3 < 4) { iVar1 = iVar3; } text = (&PTR_s_gfx_familiar_familiar_125_lilspe_00b64488)[iVar1]; pbVar4 = text; do { bVar2 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar2 != 0); std::string::assign(local_2c._buf,text,(int)pbVar4 - (int)(text + 1)); local_8 = 0; Sprite::ReplaceSpritesheet((Sprite *)(in_ECX + 0x48),0,&local_2c); local_8 = 0xffffffff; bVar2 = extraout_CL; if (0xf < local_2c._capacity) { size = local_2c._capacity + 1; ptr = (void *)local_2c._buf._0_4_; if (0xfff < size) { ptr = *(void **)(local_2c._buf._0_4_ + -4); size = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); bVar2 = extraout_CL_00; } ANM2::LoadGraphics((ANM2 *)(in_ECX + 0x48),bVar2); ExceptionList = local_10; return; } //@@ 0063b340 Entity_Familiar::update_idle_anim_by_size /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "Idle%d" from player scale thresholds */ void __thiscall Entity_Familiar::update_idle_anim_by_size(Entity_Familiar *this) { float fVar1; byte *pbVar2; byte bVar3; byte *pbVar4; uint uVar5; byte *pbVar6; uint uVar7; bool bVar8; float fVar9; float local_34 [2]; byte local_2c [32]; uint local_c; local_c = __security_cookie ^ (uint)local_34; local_34[0] = *(float *)((int)this->_player + 0x15c) * *(float *)((int)this->_player + 0xe4) * 100.0; if (this->_orbitSpeed == local_34[0]) { return; } uVar7 = 0; do { if (local_34[0] < (float)(&DAT_00b644a0)[uVar7] * 1.5) break; uVar7 = uVar7 + 1; } while (uVar7 < 4); FUN_00652a30(local_2c,0x20,"Idle%d",uVar7); pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { pbVar4 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar4 = *(byte **)pbVar2; } pbVar6 = local_2c; do { bVar3 = *pbVar4; bVar8 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_0063b402: uVar5 = -(uint)bVar8 | 1; goto LAB_0063b407; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar8 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_0063b402; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0063b407: if ((uVar5 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0063b43a; } bVar3 = ANM2::SetAnimation(&this->_sprite,local_2c,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0063b43a: fVar1 = (float)(&DAT_00b644a0)[uVar7]; fVar9 = local_34[0] * g_vectorOne.y; (this->_sprite)._scale.x = (local_34[0] * g_vectorOne.x) / fVar1; (this->_sprite)._scale.y = fVar9 / fVar1; this->_orbitSpeed = local_34[0]; this->_size = local_34[0]; return; } //@@ 0063b4a0 Entity_Familiar::GetFollowTargetPosition /* DB: ? out vec; orbit pos if 0xd70>=0, variant 120 free pickup spawn pos prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Entity_Familiar::GetFollowTargetPosition (Entity_Familiar *this,Vector *outPosition,byte isRandomOffset) { Room *pRVar1; byte bVar2; Vector *pVVar3; Entity_Player *pEVar4; uint uVar5; int iVar6; float fVar7; float fVar8; float local_50; float local_4c; Vector local_48; Vector local_40; Vector local_38; Vector local_30; Vector local_28; Vector local_20; Vector local_18; Vector local_10; if (g_game->_nbRooms != 0) { if (-1 < this->_orbitLayer) { local_48.x = *(float *)((int)this->_player + 0x33c); local_48.y = *(float *)((int)this->_player + 0x340); GetOrbitPosition(this,outPosition,&local_48); return outPosition; } iVar6 = this->_variant; if (iVar6 == 0x78) { local_48.x = *(float *)((int)this->_player + 0x33c); local_48.y = *(float *)((int)this->_player + 0x340); Room::FindFreePickupSpawnPosition(g_game->_room,outPosition,&local_48,0.0,0,0,0); return outPosition; } if (iVar6 == 900) { fVar7 = (this->_pos).y; outPosition->x = (this->_pos).x; outPosition->y = fVar7; return outPosition; } if (((iVar6 != 0x30) && (iVar6 != 0x4e)) && (iVar6 != 0xf3)) { local_48.x = *(float *)((int)this->_player + 0x33c); local_48.y = *(float *)((int)this->_player + 0x340); if (isRandomOffset != 0) { pVVar3 = MusicManager::RandomVector(&local_40); local_48.x = pVVar3->x * 20.0 + local_48.x; local_48.y = pVVar3->y * 20.0 + local_48.y; } local_4c = local_48.y; local_50 = local_48.x; bVar2 = is_detached_from_follow(this); if ((bVar2 != 0) && (bVar2 = Entity_Player::HasTrinket(this->_player,0xb3,0), bVar2 != 0)) { pVVar3 = MusicManager::RandomVector(&local_38); local_50 = local_50 + pVVar3->x; local_4c = local_4c + pVVar3->y; local_48.x = local_50; local_48.y = local_4c; } if (isRandomOffset == 0) { iVar6 = this->_variant; if (iVar6 == 0xee) { pVVar3 = MusicManager::RandomVector(&local_30); local_48.x = local_50 + pVVar3->x; local_48.y = local_4c + pVVar3->y; iVar6 = this->_variant; } if ((iVar6 == 0xf1) && (this->_linkedEntity != (EntityPtr)0x0)) { pRVar1 = g_game->_room; pVVar3 = Room::GetCenterPos(&local_28); pVVar3 = Room::FindFreePickupSpawnPosition(pRVar1,&local_20,pVVar3,0.0,0,0,0); iVar6 = 0; local_48.x = pVVar3->x; local_48.y = pVVar3->y; do { fVar8 = local_48.y; fVar7 = local_48.x; pEVar4 = Game::GetNearestPlayer(g_game,&local_48); fVar7 = (pEVar4->_pos).x - fVar7; fVar8 = (pEVar4->_pos).y - fVar8; if (25600.0 <= fVar8 * fVar8 + fVar7 * fVar7) break; pRVar1 = g_game->_room; pVVar3 = Room::GetCenterPos(&local_18); uVar5 = Random(); fVar7 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar7 = fVar7 + fVar7; fVar8 = cos(fVar7); local_40.x = fVar8 * 100.0 + pVVar3->x; fVar7 = sin(fVar7); local_40.y = fVar7 * 100.0 + pVVar3->y; pVVar3 = Room::FindFreePickupSpawnPosition(pRVar1,&local_10,&local_40,60.0,1,0,0); iVar6 = iVar6 + 1; local_48.x = pVVar3->x; local_48.y = pVVar3->y; } while (iVar6 < 0x14); } } Room::GetClampedPositionImpl(g_game->_room,outPosition,&local_48,20.0,20.0,20.0,20.0); return outPosition; } } fVar7 = *(float *)((int)this->_player + 0x340); outPosition->x = *(float *)((int)this->_player + 0x33c); outPosition->y = fVar7; return outPosition; } //@@ 0063b8b0 Entity_Familiar::RemoveFromPlayer /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: thiscall on familiar: calls own vtable slot 10 (+0x28, Entity_Familiar::Remove), switch on variant (+0x2c) removing the granting collectible/trinket/null effect from player (+0x410), EvaluateItems; called in Entity_Player::UseActiveItem COLLECTIBLE_SACRIFICIAL_ALTAR loop; REPENTOGON EntityFamiliar::RemoveFromPlayer prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Familiar::RemoveFromPlayer(Entity_Familiar *this,byte UnusedRemoveFamiliar) { uint *_Src; short *psVar1; void **ppvVar2; void *pvVar3; Entity_Player *this_00; byte bVar4; ItemConfig_Item *item; uint uVar5; uint familiarFlagBit; int *piVar6; uint *puVar7; undefined2 newCount; int removedCount; int iVar8; RNG local_38; uint collectibleId; int removeIndex; int removeCount; char isEvaluateNeeded; int local_18 [5]; int currentCount; uint *levelItemsEnd; Manager *manager; local_18[4] = __security_cookie ^ (uint)(local_18 + 5); (**(code **)(*(int *)this + 0x28))(); manager = g_manager; item = this->_item; isEvaluateNeeded = '\0'; switch(this->_variant) { case 0x1c: bVar4 = Entity_Player::HasCollectible(this->_player,0xef,0); iVar8 = (bVar4 != 0) + 0xee; goto LAB_0063b918; case 0x41: pvVar3 = this->_player; bVar4 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)pvVar3 + 0x1508),0x6b); if (bVar4 != 0) { TemporaryEffects::RemoveNullEffect((TemporaryEffects *)((int)pvVar3 + 0x1508),0x6b,1); goto LAB_0063bcad; } break; case 0x66: local_38._seed = this->_initSeed; local_38._shift1 = 2; local_38._shift2 = 0x15; local_38._shift3 = 9; local_18[1] = 0x90; local_18[2] = 0x116; local_18[3] = 0x184; uVar5 = RNG::RandomInt(&local_38,3); iVar8 = local_18[uVar5 + 1]; LAB_0063b918: item = ItemConfig::GetCollectible(&manager->_itemConfig,iVar8); isEvaluateNeeded = '\x01'; break; case 0x67: iVar8 = *(short *)((int)this->_player + 0x1382) + -1; newCount = 0; if (0 < iVar8) { newCount = (short)iVar8; } *(undefined2 *)((int)this->_player + 0x1382) = newCount; goto LAB_0063bcad; case 0x71: iVar8 = this->_player->_playerForms[0xc]; if (iVar8 < 1) { return; } Entity_Player::IncrementPlayerFormCounter(this->_player,0xc,-iVar8); return; case 0xf4: TemporaryEffects::RemoveNullEffect((TemporaryEffects *)((int)this->_player + 0x1508),0x6b,1); goto LAB_0063bcad; } if (item != (ItemConfig_Item *)0x0) { iVar8 = item->type; if (((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) { uVar5 = item->id; removeCount = 0; collectibleId = uVar5; bVar4 = Entity_Player::HasCollectible(this->_player,0x19d,0); if ((bVar4 == 0) && (bVar4 = Entity_Player::HasCollectible(this->_player,0x19c,0), bVar4 == 0) ) { LAB_0063bb29: if (uVar5 == 10) { pvVar3 = (this->_player->_pillEffectUses)._begin; iVar8 = *(int *)((int)pvVar3 + 0x28); if (iVar8 < 1) { bVar4 = Entity_Player::HasCollectible(this->_player,10,0); if (bVar4 == 0) { iVar8 = 0; } else { iVar8 = 1; removeCount = 1; piVar6 = (int *)(*(int *)((int)this->_player + 0x16d4) + 0x28); *piVar6 = *piVar6 + 1; } goto LAB_0063bc53; } *(int *)((int)pvVar3 + 0x28) = iVar8 + -1; } else { LAB_0063bbd4: if (uVar5 != 0x20d) { if (uVar5 == 0x49) { iVar8 = this->_variant + -0x2b; currentCount = *(int *)((int)this->_player + 0x153c); removedCount = currentCount; if (iVar8 < currentCount) { removedCount = iVar8; } iVar8 = iVar8 - removedCount; *(int *)((int)this->_player + 0x153c) = currentCount - removedCount; removeCount = iVar8; } else { familiarFlagBit = 0; if (uVar5 != 0xcf) goto LAB_0063bad8; iVar8 = this->_variant + -0x44; currentCount = *(int *)((int)this->_player + 0x1540); removedCount = currentCount; if (iVar8 < currentCount) { removedCount = iVar8; } iVar8 = iVar8 - removedCount; *(int *)((int)this->_player + 0x1540) = currentCount - removedCount; removeCount = iVar8; } goto LAB_0063bc53; } psVar1 = (short *)((int)this->_player + 0x1384); *psVar1 = *psVar1 + -1; } } else { if ((int)uVar5 < 0x114) { if (uVar5 == 0x113) { familiarFlagBit = 0x10; } else { switch(uVar5) { case 0x62: familiarFlagBit = 0x100; break; default: goto LAB_0063bb29; case 0x70: familiarFlagBit = 0x40; break; case 0x71: familiarFlagBit = 4; break; case 0xb2: familiarFlagBit = 0x80; break; case 0x10e: familiarFlagBit = 1; } } } else { switch(uVar5) { case 0x116: familiarFlagBit = 2; break; default: goto LAB_0063bbd4; case 0x168: familiarFlagBit = 8; break; case 0x16b: familiarFlagBit = 0x200; break; case 0x186: familiarFlagBit = 0x400; break; case 0x1a1: familiarFlagBit = 0x20; } } LAB_0063bad8: iVar8 = 1; removeCount = 1; if (familiarFlagBit != 0) { uVar5 = *(uint *)((int)this->_player + 0x1938); if ((familiarFlagBit & uVar5) != 0) { iVar8 = 0; *(uint *)((int)this->_player + 0x1938) = uVar5 | familiarFlagBit; removeCount = 0; } } LAB_0063bc53: removeIndex = 0; if (0 < iVar8) { LAB_0063bc60: this_00 = this->_player; if ((this_00->_temporaryeffects)._disabled == 0) { for (piVar6 = (this_00->_temporaryeffects)._effects._begin; piVar6 != (this_00->_temporaryeffects)._effects._end; piVar6 = piVar6 + 4) { if ((ItemConfig_Item *)*piVar6 == item) { if ((item->type == 3) && (item->passiveCache == 0)) goto LAB_0063bdc5; puVar7 = (this_00->_levelEffectItems)._begin; levelItemsEnd = (this_00->_levelEffectItems)._end; if (puVar7 != levelItemsEnd) goto LAB_0063bd00; break; } } } LAB_0063bc8b: Entity_Player::RemoveCollectible(this_00,collectibleId,0,0,1); goto LAB_0063bc9b; } } } else if (iVar8 == 2) { uVar5 = item->id; bVar4 = Entity_Player::HasTrinket(this->_player,uVar5,0); if (bVar4 != 0) { Entity_Player::TryRemoveTrinket(this->_player,uVar5); } } } LAB_0063bca7: if (isEvaluateNeeded == '\0') { return; } LAB_0063bcad: puVar7 = (uint *)((int)this->_player + 0x1574); *puVar7 = *puVar7 | 0x200; Entity_Player::EvaluateItems(); return; LAB_0063bd00: _Src = puVar7 + 1; if (*puVar7 != collectibleId) { puVar7 = _Src; if (_Src == levelItemsEnd) goto LAB_0063bc8b; goto LAB_0063bd00; } memmove(puVar7,_Src,(int)levelItemsEnd - (int)_Src); ppvVar2 = &(this_00->_levelEffectItems)._end; *ppvVar2 = (void *)((int)*ppvVar2 + -4); uVar5 = *(uint *)(*(int *)((int)this->_player + 0x173c) + removeIndex * 4); if (g_game == (Game *)0x0) { if ((int)uVar5 < 0) goto LAB_0063bdc5; LAB_0063bd84: pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 >> 2 <= (int)uVar5) goto LAB_0063bdc5; iVar8 = *(int *)((int)pvVar3 + uVar5 * 4); } else { if (-1 < (int)uVar5) goto LAB_0063bd84; if (((int)uVar5 < 0) && (pvVar3 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar5 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar3 >> 2) ) { iVar8 = **(int **)((int)pvVar3 + ~uVar5 * 4); } else { iVar8 = 0; } } if (iVar8 != 0) { local_18[2] = *(undefined4 *)(iVar8 + 0x78); local_18[1] = 0; local_18[3] = 0; local_18[0] = iVar8; TemporaryEffects::RemoveEffect((TemporaryEffects *)((int)this->_player + 0x1508),local_18,1); } LAB_0063bdc5: local_38._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; local_38._shift3 = 0; local_38._seed = (int)item; TemporaryEffects::RemoveEffect((TemporaryEffects *)((int)this->_player + 0x1508),&local_38,1); LAB_0063bc9b: removeIndex = removeIndex + 1; if (removeCount <= removeIndex) goto LAB_0063bca7; goto LAB_0063bc60; } //@@ 0063c060 FUN_0063c060 void FUN_0063c060(int param_1) { Entity_Familiar *in_ECX; if (-1 < param_1) { Entity_Familiar::AddToOrbit(in_ECX,param_1); return; } if (-1 < in_ECX->_orbitLayer) { Entity_Familiar::RecalculateOrbitOffset(in_ECX,in_ECX->_orbitLayer,0); in_ECX->_orbitLayer = -1; } return; } //@@ 0063c0a0 Entity_Familiar::TryThrow /* ZHL [vtable slot 21] */ undefined4 __thiscall Entity_Familiar::TryThrow(Entity_Familiar *this,undefined4 param_2,float *param_3,float param_4) { float fVar1; float fVar2; if (this->_variant == 0xc9) { if (this->_state != 2) { (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; (this->_posOffset).y = -15.0; this->_orbitSpeed = -param_4 * 0.7; fVar1 = param_3[1]; (this->_orbitDistance).x = *param_3 * 0.8; (this->_orbitDistance).y = fVar1 * 0.8; fVar1 = *param_3; fVar2 = param_3[1]; this->_state = 2; (this->_velocity).x = fVar1 * 0.8; (this->_velocity).y = fVar2 * 0.8; return 1; } } else if (this->_variant == 0xef) { this->_orbitSpeed = -param_4 * 0.7; fVar1 = param_3[1]; (this->_velocity).x = *param_3; (this->_velocity).y = fVar1; (this->_posOffset).y = -15.0; this->_fireCooldown = 0x1e; return 1; } return 0; } //@@ 0063c1c0 Entity_Familiar::ai_minisaac /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update case 0xe4 (FamiliarVariant.MINISAAC 228); Head*/Walk*/Fly* dir anims, Transform/TransformFlying, Poof_Small */ void __thiscall Entity_Familiar::ai_minisaac(Entity_Familiar *this) { float fVar1; code *pcVar2; longlong lVar3; longlong lVar4; Vector *position; byte bVar5; char cVar6; int iVar7; char *anim; uint uVar8; Entity *pEVar9; int *piVar10; int unusedArg; void *pvVar11; uint uVar12; uint uVar13; PlayerManager *playerManager; bool bVar14; float fVar15; ulonglong timeNs; ulonglong uVar16; undefined1 auStack_f0 [3]; char isFlying; undefined8 local_ec; Entity *local_e4; uint spawnSubType; uint finalSubType; float local_d8; uint spawnType; uint local_d0; uint spawnVariant; Game *spawnGame; float local_c4; uint local_c0; int landSound; int landSound2; int deathSound; void *pvStack_ac; float local_a8; Vector particlePos; undefined4 local_98; EntityPtr *local_90; uint local_8c; Entity_Familiar *savedFamiliar; Vector particleVelocity; int iStack_7c; int iStack_78; int iStack_74; undefined4 uStack_70; undefined8 rngShifts; undefined4 local_60; undefined1 auStack_5c [4]; undefined1 local_58 [8]; int local_50; RNG cardRng; char *dirAnims [4]; char *walkAnims [4]; char *headAnims; char *local_18; char *local_14; char *local_10; uint local_c; Game *game; Manager *manager; std_set *spawnTriggerTargets; EntityPtr *spawnerSlot; ANM2 *sprite; local_c = __security_cookie ^ (uint)auStack_f0; walkAnims[0] = "WalkLeft"; walkAnims[1] = "WalkUp"; walkAnims[2] = "WalkRight"; walkAnims[3] = "WalkDown"; dirAnims[0] = "FlyLeft"; dirAnims[1] = "FlyUp"; dirAnims[2] = "FlyRight"; dirAnims[3] = "FlyDown"; headAnims = "HeadLeft"; local_18 = "HeadUp"; local_14 = "HeadRight"; local_10 = "HeadDown"; if (this->_player != (void *)0x0) { iVar7 = this->_entityGridCollisionClass; if ((((iVar7 == 0) || (iVar7 == 3)) || (iVar7 == 1)) || (isFlying = '\0', iVar7 == 2)) { isFlying = '\x01'; } iVar7 = this->_state; savedFamiliar = this; if (iVar7 == 0) { fVar15 = (this->_targetPosition).x; fVar1 = (this->_targetPosition).y; local_e4 = (Entity *)sqrtf(fVar15 * fVar15 + fVar1 * fVar1); if ((float)local_e4 <= 0.01) { iVar7 = 3; } else { fVar15 = (this->_targetPosition).x; fVar1 = (this->_targetPosition).y; if (ABS(fVar15) <= ABS(fVar1)) { iVar7 = (uint)(0.0 <= fVar1) * 2 + 1; } else { iVar7 = 2; if (fVar15 < 0.0) { iVar7 = 0; } } } sprite = &this->_sprite; local_ec = CONCAT44(local_ec._4_4_,iVar7); if (isFlying == '\0') { if ((float)local_e4 <= 0.01) { ANM2::SetFrame(sprite,(std_string *)"WalkDown",0); } else { ANM2::Play(sprite,(byte *)dirAnims[iVar7 + 4],0); pEVar9 = local_e4; if ((float)local_e4 <= 0.5) { pEVar9 = (Entity *)0x3f000000; } if (1.0 <= (float)pEVar9) { pEVar9 = (Entity *)0x3f800000; } (this->_sprite)._playbackSpeed = (float)pEVar9; } fVar15 = 0.0; } else { ANM2::Play(sprite,(byte *)dirAnims[iVar7],0); pEVar9 = local_e4; if ((float)local_e4 <= 0.5) { pEVar9 = (Entity *)0x3f000000; } if (1.0 <= (float)pEVar9) { pEVar9 = (Entity *)0x3f800000; } (this->_sprite)._playbackSpeed = (float)pEVar9; fVar15 = -4.0; } (this->_posOffset).y = fVar15; local_d0 = (uint)(6 < this->_fireCooldown); iVar7 = (int)(int *)local_ec; if (this->_shootDirection != -1) { iVar7 = this->_shootDirection; } bVar5 = ANM2::SetOverlayAnimation(&this->_sprite,(byte *)dirAnims[iVar7 + 8],1); if ((bVar5 != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)(int)local_d0); } FamiliarHelper::fly_head_pathfind_move(this); minisaac_find_target(); minisaac_fire(this); game = g_game; if ((((this->_flags & 0x4000) == 0) && (bVar5 = Game::IsPaused(g_game), bVar5 == 0)) && ((game->_frameCount % 0xf == 0 && (1.0 < this->_health)))) { this->_health = this->_health - 0.2; } } else if (iVar7 == 1) { if ((this->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,s_Land); manager = g_manager; if (bVar5 != 0) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; landSound = 0x45; seed_fart_sound_override(&landSound); SoundEffects::Play(&manager->_sfxManager,landSound,0.8,2,0,1.0,0.0); } if (((this->_sprite)._animState._animData != (void *)0x0) && (bVar5 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,s_Land), bVar5 != 0)) { this->_friction = this->_friction * 0.5; } } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { anim = "TransformFlying"; if (isFlying == '\0') { anim = "Transform"; } ANM2::Play(&this->_sprite,(byte *)anim,0); this->_state = 2; } } else if (iVar7 == 2) { if ((this->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,s_Land); manager = g_manager; if (bVar5 != 0) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; landSound2 = 0x45; seed_fart_sound_override(&landSound2); SoundEffects::Play(&manager->_sfxManager,landSound2,0.8,2,0,1.0,0.0); } } this->_friction = this->_friction * 0.5; if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { this->_state = 0; this->_entityCollisionClass = 4; } } manager = g_manager; if (this->_dead != 0) { deathSound = 0x37; seed_fart_sound_override(&deathSound); SoundEffects::Play(&manager->_sfxManager,deathSound,0.8,2,0,1.8,0.0); uVar8 = Random(); position = &this->_pos; pEVar9 = Game::SpawnEx(g_game,1000,2,position,&g_vectorZero,(Entity *)0x0,1,uVar8,0); ANM2::Play(&pEVar9->_sprite,(byte *)"Poof_Small",0); uVar8 = Random(); for (local_d0 = (uVar8 & 1) + 1; local_d0 != 0; local_d0 = local_d0 + -1) { uVar8 = Random(); local_d8 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d8 = local_d8 + local_d8; fVar15 = cos(local_d8); particlePos.x = fVar15 * this->_size * 0.5 + position->x; fVar15 = sin(local_d8); particlePos.y = fVar15 * this->_size * 0.5 + (this->_pos).y; uVar8 = Random(); fVar15 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_e4 = (Entity *)(fVar15 + fVar15); uVar8 = Random(); local_ec = CONCAT44((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 1.0,(int *)local_ec); local_c4 = cos((float)local_e4); local_c4 = local_c4 * local_ec._4_4_; particleVelocity.x = local_c4; local_a8 = sin((float)local_e4); local_a8 = local_a8 * local_ec._4_4_; particleVelocity.y = local_a8; local_d8 = (float)Random(); spawnGame = g_game; spawnSubType = 0; spawnVariant = 5; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&particlePos,&particleVelocity, (Entity *)0x0,(int *)&spawnSubType,(uint *)&local_d8); uVar8 = spawnVariant; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0063cadf: finalSubType = spawnSubType; } else { local_ec = CONCAT44(local_ec._4_4_,(g_game->_deathmatchManager)._type); pEVar9 = (Entity *)Random(); uVar12 = spawnSubType; rngShifts = 0x900000005; piVar10 = (int *)local_ec; local_ec = CONCAT44(7,(int *)local_ec); local_60 = 7; local_e4 = pEVar9; if (spawnType != 5) goto LAB_0063cadf; if (300 < uVar8) { if (uVar8 == 0x15e) { do { finalSubType = spawnSubType; if (spawnSubType != 0) { cVar6 = (**(code **)(*(int *)local_ec + 0x2c))(spawnSubType); if (cVar6 == '\0') goto LAB_0063cae7; } spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } while( true ); } goto LAB_0063cadf; } if (uVar8 == 300) { do { finalSubType = spawnSubType; if (spawnSubType != 0) { cVar6 = (**(code **)(*(int *)local_ec + 0x24))(spawnSubType); if (cVar6 == '\0') goto LAB_0063cae7; } if (pEVar9 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = (uint)pEVar9 >> ((byte)rngShifts & 0x1f) ^ (uint)pEVar9; uVar8 = uVar8 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar8; pEVar9 = (Entity *)(uVar8 >> ((byte)((ulonglong)local_ec >> 0x20) & 0x1f) ^ uVar8); iVar7 = ItemPool::GetCardEx((int)pEVar9,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = (int)pEVar9; spawnSubType = lua_callback_run_get_card(&cardRng,iVar7,1,1,0); } while( true ); } if (uVar8 == 0x46) { local_c0 = spawnSubType >> 0xb; do { finalSubType = spawnSubType; if (spawnSubType != 0) { pcVar2 = *(code **)(*(int *)local_ec + 0x28); iVar7 = ItemPool::GetPillEffect (&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0); cVar6 = (*pcVar2)(iVar7); if (cVar6 == '\0') goto LAB_0063cae7; pEVar9 = local_e4; } if (pEVar9 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = (uint)pEVar9 >> ((byte)rngShifts & 0x1f) ^ (uint)pEVar9; uVar8 = uVar8 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar8; pEVar9 = (Entity *)(uVar8 >> ((byte)((ulonglong)local_ec >> 0x20) & 0x1f) ^ uVar8); local_e4 = pEVar9; spawnSubType = ItemPool::GetPill((uint)pEVar9); spawnSubType = spawnSubType | (local_c0 & 1) << 0xb; } while( true ); } if (uVar8 != 100) goto LAB_0063cadf; finalSubType = spawnSubType; if (spawnSubType == 0x19) { LAB_0063c921: bVar14 = false; } else { local_8c = spawnSubType; std::set::find_node(local_58,&local_8c); if (((*(char *)(local_50 + 0xd) == '\0') && (*(int *)(local_50 + 0x10) <= (int)uVar12)) && (local_50 != piVar10[8])) goto LAB_0063c921; bVar14 = true; } if ((uVar12 == 0) || (bVar14)) { spawnSubType = (**(code **)(*piVar10 + 0x84))(0); finalSubType = spawnSubType; } } LAB_0063cae7: local_e4 = EntityFactory::Create(spawnGame->_entityFactory,spawnType,0); lVar3 = CONCAT44(local_c0,local_98); if (local_e4 == (Entity *)0x0) { pEVar9 = (Entity *)0x0; } else { timeNs = GetTimeNs(); pEVar9 = local_e4; lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_98 = (undefined4)((ulonglong)lVar3 >> 0x20); uVar16 = (timeNs >> 0x20) * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)(uVar16 >> 0x20); lVar3 = lVar3 + (uVar16 & 0xffffffff); local_c0 = (uint)lVar3; uVar8 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = (timeNs >> 0x20) * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar12,uVar8),uVar12 + uVar8); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); spawnerSlot = &local_e4->_spawnerEntity; local_ec = CONCAT44(uVar8 >> 0x12,(uint)lVar3 >> 0x12 | uVar8 * 0x4000); local_e4->_spawnerType = 0; local_e4->_spawnerVariant = 0; if (*spawnerSlot != (EntityPtr)0x0) { local_90 = spawnerSlot; std::multiset::erase(&local_90); } iVar7 = *(int *)pEVar9; *spawnerSlot = (EntityPtr)0x0; (pEVar9->_pos).x = particlePos.x; (pEVar9->_pos).y = particlePos.y; (pEVar9->_velocity).x = local_c4; (pEVar9->_velocity).y = local_a8; (**(code **)(iVar7 + 4))(spawnType,spawnVariant,finalSubType,local_d8); pvVar11 = spawnGame->_room; iVar7 = *(int *)((int)pvVar11 + 0x1214); *(int *)((int)pvVar11 + 0x1214) = iVar7 + 1; pEVar9->_index = iVar7; EntityList::AddEntity((EntityList *)((int)pvVar11 + 0x1218),pEVar9); bVar5 = Game::ShouldEraseEnemy(pEVar9); if (bVar5 != 0) { Entity::RemoveWithPoof(pEVar9,unusedArg); } if ((pEVar9->_exists != 0) && ((spawnGame->_proceduralItemManager)._proceduralItems._begin != (spawnGame->_proceduralItemManager)._proceduralItems._end)) { iStack_78 = pEVar9->_variant; iVar7 = pEVar9->_type; spawnTriggerTargets = &(spawnGame->_proceduralItemManager)._spawnTriggerTargets; iStack_7c = iVar7; std::map::find(&pvStack_ac,&iStack_7c); if (pvStack_ac == spawnTriggerTargets->_head) { uStack_70 = 0xffffffff; iStack_74 = iVar7; piVar10 = (int *)std::map::find(auStack_5c,&iStack_74); pvStack_ac = (void *)*piVar10; if (pvStack_ac == spawnTriggerTargets->_head) goto LAB_0063cd56; } uVar8 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar11 = (playerManager->_playerList)._end; if ((int)pvVar11 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar11 = (playerManager->_playerList)._end; } piVar10 = (playerManager->_playerList)._begin; if (uVar8 < (uint)((int)pvVar11 - (int)piVar10 >> 2)) { piVar10 = piVar10 + uVar8; } trigger_set_dispatch ((void *)(*piVar10 + 0x1fc8),6,local_e4,&particlePos,&particleVelocity); uVar8 = uVar8 + 1; playerManager = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0063cd56: uVar16 = GetTimeNs(); local_d8 = (float)(uVar16 >> 0x20); lVar4 = (uVar16 & 0xffffffff) * 0x431bde82; local_c4 = (float)((ulonglong)lVar4 >> 0x20); lVar3 = (ulonglong)(uint)local_d8 * 0x431bde82; uVar16 = (ulonglong)(uint)local_d8 * 0xd7b634db + ((uVar16 & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)(uVar16 >> 0x20); lVar4 = lVar4 + (uVar16 & 0xffffffff); local_a8 = (float)lVar4; uVar8 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar12,uVar8),uVar12 + uVar8); uVar13 = (uint)((ulonglong)lVar4 >> 0x20); uVar8 = (uint)lVar4 >> 0x12 | uVar13 * 0x4000; uVar12 = uVar8 - (int)(int *)local_ec; bVar14 = CARRY4((uint)g_entitySpawnTimeMs,uVar12); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar12; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar13 >> 0x12) - (int)local_ec._4_4_) - (uint)(uVar8 < (int *)local_ec)) + (uint)bVar14; pEVar9 = local_e4; } local_c0 = (uint)((ulonglong)lVar3 >> 0x20); local_98 = (undefined4)lVar3; (**(code **)(*(int *)pEVar9 + 0xc))(); position = &savedFamiliar->_pos; this = savedFamiliar; } } } return; } //@@ 0063ce20 Entity_Familiar::minisaac_fire /* DB: ? ECX=familiar, from Entity_Familiar::ai_minisaac: fire cooldown/direction checks, subtype 99 branch, apply_tear_modifiers, spawns knife (8.1) or TryFireTear depending on the player's weapon */ void __thiscall Entity_Familiar::minisaac_fire(Entity_Familiar *this) { int iVar1; uint spawnSeed; Entity *knifeEntity; Entity_Knife *this_00; Vector *pVVar2; Entity_Tear *tear; Manager *manager; float fVar3; float Volume; float Pitch; Vector local_34; Vector local_2c; float local_24; Vector local_20; Vector shootDir; Vector normalizedDir; EntityPtr *parentRef; if ((-1 < this->_shootDirection) && (this->_fireCooldown < 1)) { Isaac::GetAxisAlignedUnitVectorFromDir(&shootDir,this->_shootDirection); if (this->_subtype == 99) { iVar1 = _get_index_plus_one_if_kind_4_5(); local_20.x = (float)iVar1 * 0.15 + 1.2; fVar3 = apply_tear_modifiers(this); local_24 = (fVar3 * 0.4 + 0.6) * local_20.x; fVar3 = apply_tear_modifiers(this); local_2c.x = (fVar3 * 0.25 + 0.75) * 0.7; spawnSeed = Random(); local_34.x = (this->_pos).x; local_34.y = (this->_pos).y; knifeEntity = Game::SpawnEx(g_game,8,1,&local_34,&g_vectorZero,(Entity *)this,4,spawnSeed,0); this_00 = (Entity_Knife *) __RTDynamicCast(knifeEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0); parentRef = &this_00->_parent; if (this_00->_parent != (EntityPtr)0x0) { local_20.x = (float)parentRef; std::multiset::erase(&local_20); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); (this_00->_targetPosition).x = 8.0; (this_00->_targetPosition).y = 0.0; pVVar2 = Vector::ToCardinal(&local_20,&shootDir); fVar3 = atan2f(pVVar2->y,pVVar2->x); (this_00->_posOffset).x = 0.0; (this_00->_posOffset).y = -8.0; this_00->_rotation = fVar3 * 57.295776; (**(code **)(*(int *)this_00 + 0x40))(local_24 + local_24); fVar3 = local_34.y * g_vectorOne.x; (this_00->_sprite)._scale.y = local_34.y * g_vectorOne.y; (this_00->_sprite)._scale.x = fVar3; Entity_Knife::SetAttackAnimation(this_00); (**(code **)(*(int *)this_00 + 0xc))(); manager = g_manager; this->_fireCooldown = 0x14; seed_fart_sound_override((int *)((int)register0x00000010 + -0x38)); Pitch = 1.5; Volume = 0.6; fVar3 = 3.53127e-43; } else { local_20.x = (this->_velocity).x * 0.5; local_34.x = (this->_velocity).y * 0.5; local_2c.x = shootDir.y; local_24 = shootDir.x; fVar3 = sqrtf(shootDir.y * shootDir.y + shootDir.x * shootDir.x); if (fVar3 <= 0.0) { fVar3 = local_2c.x; } else { local_24 = shootDir.x * (1.0 / fVar3); fVar3 = local_2c.x * (1.0 / fVar3); } local_24 = local_34.x * fVar3 + local_20.x * local_24; fVar3 = local_20.x; if (local_24 < 0.0) { pVVar2 = Vector::Normalized(&shootDir,&normalizedDir); fVar3 = local_20.x - local_24 * pVVar2->x; local_34.x = local_34.x - local_24 * pVVar2->y; } local_2c.x = shootDir.x * 9.0 + fVar3; local_2c.y = shootDir.y * 9.0 + local_34.x; iVar1 = _get_index_plus_one_if_kind_4_5(); local_20.x = (float)iVar1 * 0.15 + 1.2; fVar3 = apply_tear_modifiers(this); local_20.x = (fVar3 * 0.4 + 0.6) * local_20.x; fVar3 = apply_tear_modifiers(this); local_24 = (fVar3 * 0.25 + 0.75) * 0.5; spawnSeed = Random(); tear = (Entity_Tear *) Game::SpawnEx(g_game,2,0,&this->_pos,&local_2c,(Entity *)this,0,spawnSeed,0); (**(code **)(*(int *)tear + 0x40))(local_20.x); if (this->_entityGridCollisionClass == 5) { fVar3 = -14.0; } else { fVar3 = -18.0; } Entity_Projectile::SetHeight((Entity_Projectile *)tear,fVar3); fVar3 = local_2c.y * tear->_baseScale; if (fVar3 <= 0.01) { fVar3 = 0.01; } tear->_baseScale = fVar3; tear->_fScale = fVar3; Entity_Tear::ResetSpriteScale(tear); TryFireTear(this,tear); (**(code **)(*(int *)tear + 0xc))(); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); manager = g_manager; this->_fireCooldown = 10; local_24 = 2.14399e-43; seed_fart_sound_override((int *)&local_24); Pitch = 1.0; Volume = 1.0; fVar3 = local_24; } SoundEffects::Play(&manager->_sfxManager,(int)fVar3,Volume,2,0,Pitch,0.0); } if (0 < this->_fireCooldown) { this->_fireCooldown = this->_fireCooldown + -1; } return; } //@@ 0063d2e0 FamiliarHelper::fly_head_pick_side_offset /* DB: ? ECX=familiar, param_2=target entity: for the 4 axis directions (table DAT_00c5ca94) raycasts with Room::GetLaserTarget from the target and picks the reachable offset (distance target size+10/+40 swayed by sin(frame*pi/15), closer for subtype/variant 99), returns the Vector in param_1; callers FamiliarHelper::fly_head_pathfind_move and 0063dd60 Entity_Familiar::minisaac_find_target float * FamiliarHelper::fly_head_pick_side_offset(float *param_1,float param_2) { Game *pGVar1; int iVar2; int iVar3; Vector *pVVar4; int in_ECX; Vector *direction; float fVar5; float fVar6; float fVar7; Vector local_38; Vector local_30; Room *local_28; int local_24; float local_20; float local_1c; float local_18; int local_14; float local_10; float local_c; float local_8; iVar2 = (int)param_2; pGVar1 = g_game; local_1c = *(float *)(in_ECX + 0x33c) - *(float *)((int)param_2 + 0x33c); iVar3 = g_game->_frameCount - *(int *)(in_ECX + 0x328); local_18 = *(float *)(in_ECX + 0x340) - *(float *)((int)param_2 + 0x340); local_24 = in_ECX; if (*(int *)(in_ECX + 0x30) == 99) { param_2 = *(float *)((int)param_2 + 0x370) + 10.0; fVar5 = sin(((float)iVar3 * 3.1415927) / 15.0); fVar5 = fVar5 * 10.0; local_c = param_2 + 20.0; } else { param_2 = *(float *)((int)param_2 + 0x370) + 40.0; fVar5 = sin(((float)iVar3 * 3.1415927) / 15.0); fVar5 = fVar5 * 40.0; local_c = param_2 + 100.0; } local_c = local_c + fVar5; local_10 = 10000.0; local_28 = pGVar1->_room; direction = (Vector *)&DAT_00c5ca94; local_30.x = *(float *)(iVar2 + 0x33c); local_30.y = *(float *)(iVar2 + 0x340); param_1[1] = 0.0; *param_1 = 0.0; local_14 = 4; do { fVar5 = local_18 * direction->y + local_1c * direction->x; local_20 = param_2; if (param_2 <= fVar5) { local_20 = fVar5; } pVVar4 = Room::GetLaserTarget(local_28,&local_38,&local_30,direction); local_8 = pVVar4->y - *(float *)(iVar2 + 0x340); fVar7 = pVVar4->x - *(float *)(iVar2 + 0x33c); fVar5 = sqrtf(local_8 * local_8 + fVar7 * fVar7); if (param_2 <= fVar5) { local_20 = (local_c - local_20) * 0.2 + local_20; if ((fVar5 <= local_20) || (fVar5 <= 0.0)) { local_20 = local_8; } else { local_20 = local_20 / fVar5; fVar7 = fVar7 * local_20; local_20 = local_8 * local_20; } fVar7 = *(float *)(iVar2 + 0x33c) + fVar7; local_20 = *(float *)(iVar2 + 0x340) + local_20; fVar6 = *(float *)(local_24 + 0x33c) - fVar7; fVar5 = *(float *)(local_24 + 0x340) - local_20; fVar5 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if (fVar5 < local_10) { *param_1 = fVar7; param_1[1] = local_20; local_10 = fVar5; } } direction = direction + 1; local_14 = local_14 + -1; } while (local_14 != 0); return param_1; } //@@ 0063d570 FamiliarHelper::fly_head_pathfind_move /* DB: ? called from the Entity_Familiar::Update case 0xe4 (variant 228) routine 0063c1c0 (FlyUp/FlyDown/HeadUp/HeadDown, Transform/TransformFlying anims); PathFinder::FindGridPath, Room::CheckLine, EntityList::QuerySublist, GetAxisAlignedUnitVectorFromDir; Ghidra cannot decompile it prototype: db/protos.zhl */ void __fastcall FamiliarHelper::fly_head_pathfind_move(Entity_Familiar *familiar) { Entity_Familiar *pEVar1; code *pcVar2; byte isLineClear; float *stepLen; int iVar3; void *listData; uint uVar4; qword *allocCounter; float fVar5; float fVar6; float stepVelY; EntityList_EL siblings; Vector targetPos; Vector local_48; float local_40; float local_3c; float local_38; float local_34; Room *local_30; float local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; qword prevAllocated; EntityPtr *targetRef; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00af6c00; local_1c = ExceptionList; ExceptionList = &local_1c; targetRef = &familiar->_target; local_30 = g_game->_room; listData = familiar->_player; local_34 = *(float *)((int)listData + 0x1568) * 1.15; familiar->_shootDirection = -1; if (*targetRef == (EntityPtr)0x0) { targetPos.x = *(float *)((int)listData + 0x33c); targetPos.y = *(float *)((int)listData + 0x340); puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } else { fly_head_pick_side_offset(&local_48,*targetRef); if ((local_48.x == g_vectorZero.x) && (local_48.y == g_vectorZero.y)) { familiar->_friction = familiar->_friction * 0.7; (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; familiar->_headFrameDelay = familiar->_headFrameDelay + 1; if (familiar->_headFrameDelay < 0xb) { ExceptionList = local_1c; return; } if (*targetRef != (EntityPtr)0x0) { local_30 = (Room *)targetRef; std::multiset::erase(&local_30); } *targetRef = (EntityPtr)0x0; ExceptionList = local_1c; return; } targetPos.x = local_48.x; targetPos.y = local_48.y; local_24 = *(float *)((int)*targetRef + 0x33c) - (familiar->_pos).x; local_28 = *(float *)((int)*targetRef + 0x340) - (familiar->_pos).y; if (ABS(local_24) <= ABS(local_28)) { local_2c = (float)((uint)(0.0 <= local_28) * 2 + 1); } else { local_2c = 2.8026e-45; if (local_24 < 0.0) { local_2c = 0.0; } } Isaac::GetAxisAlignedUnitVectorFromDir(&local_48,(int)local_2c); fVar5 = sqrtf(local_28 * local_28 + local_24 * local_24); if (0.0 < fVar5) { local_24 = local_24 * (1.0 / fVar5); local_28 = local_28 * (1.0 / fVar5); } if (0.86 < local_48.x * local_24 + local_48.y * local_28) { familiar->_shootDirection = (int)local_2c; } } local_2c = (float)familiar->_initSeed; familiar->_headFrameDelay = 0; siblings._data = (void *)0x2; siblings._capacity = 7; local_24 = 3.50325e-44; if (local_2c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = (uint)local_2c >> 2 ^ (uint)local_2c; uVar4 = uVar4 << 7 ^ uVar4; local_2c = (float)(uVar4 >> 0x19 ^ uVar4); local_28 = (float)((double)(int)local_2c + __uint_to_double_fixup[-((int)local_2c >> 0x1f)]) * 2.3283062e-10 * 0.20000005 + 0.9; if (local_2c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = (uint)local_2c >> 2 ^ (uint)local_2c; uVar4 = uVar4 << 7 ^ uVar4; local_28 = local_28 * local_34; uVar4 = uVar4 >> 0x19 ^ uVar4; local_48.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 15.0 + 15.0; local_40 = local_48.y * 1.5; local_3c = local_40 + 4.0; local_38 = local_40 + local_40; isLineClear = Room::CheckLine(local_30,&familiar->_pos,&targetPos,0,0,0,0,(Vector *)0x0); if (isLineClear == 0) { PathFinder::FindGridPath((PathFinder *)&familiar->_pathfinder,&targetPos,local_28,0,1); (familiar->_targetPosition).x = (familiar->_velocity).x; (familiar->_targetPosition).y = (familiar->_velocity).y; } else { familiar->_friction = familiar->_friction * 0.7; local_2c = targetPos.x - (familiar->_pos).x; local_24 = targetPos.y - (familiar->_pos).y; local_34 = sqrtf(local_2c * local_2c + local_24 * local_24); if (((*targetRef != (EntityPtr)0x0) || (local_38 < local_34)) || ((local_3c < local_34 && (fVar5 = (familiar->_velocity).y, fVar6 = (familiar->_velocity).x, fVar5 = sqrtf(fVar6 * fVar6 + fVar5 * fVar5), 1.0 < fVar5)))) { fVar5 = local_2c; if (0.0 < local_34) { fVar5 = local_2c * (1.0 / local_34); local_24 = local_24 * (1.0 / local_34); } local_3c = 2.0; local_38 = local_34 * 0.1; stepLen = &local_3c; if (local_34 * 0.1 <= 2.0) { stepLen = &local_38; } stepVelY = *stepLen * local_24 * local_28; fVar6 = *stepLen * fVar5 * local_28; (familiar->_targetPosition).y = stepVelY; (familiar->_targetPosition).x = fVar6; fVar5 = familiar->_friction; (familiar->_velocity).x = fVar6 / fVar5 + (familiar->_velocity).x; (familiar->_velocity).y = stepVelY / fVar5 + (familiar->_velocity).y; } else { (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; } } local_24 = 0.0; local_38 = (familiar->_pos).y - *(float *)((int)familiar->_player + 0x340); local_3c = (familiar->_pos).x - *(float *)((int)familiar->_player + 0x33c); local_28 = 0.0; fVar5 = sqrtf(local_38 * local_38 + local_3c * local_3c); if ((0.0 < fVar5) && (fVar5 < local_40)) { fVar5 = (1.0 - fVar5 / local_40) / fVar5; local_24 = fVar5 * local_38 * 0.2 + 0.0; local_28 = fVar5 * local_3c * 0.2 + 0.0; } fVar5 = (familiar->_velocity).y; fVar6 = (familiar->_velocity).x; fVar5 = sqrtf(fVar6 * fVar6 + fVar5 * fVar5); fVar5 = fVar5 + 0.4; if (fVar5 <= 0.8) { fVar5 = 0.8; } if (2.0 <= fVar5) { fVar5 = 2.0; } if (*(char *)local_30 == '\0') { iVar3 = -1; } else { iVar3 = g_game->_frameCount - local_30->_enterFrame; } local_40 = (float)iVar3 / 30.0; if (local_40 <= 0.0) { local_40 = 0.0; } if (1.0 <= local_40) { local_40 = 1.0; } local_40 = local_40 * fVar5; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&siblings,familiar->_type, familiar->_variant,-1,0,0); uVar4 = 0; if (siblings._size != 0) { listData = siblings._data; do { pEVar1 = *(Entity_Familiar **)((int)listData + uVar4 * 4); if (pEVar1 != familiar) { if (pEVar1->_player == familiar->_player) { local_3c = (familiar->_pos).x - (pEVar1->_pos).x; local_38 = (familiar->_pos).y - (pEVar1->_pos).y; fVar5 = sqrtf(local_3c * local_3c + local_38 * local_38); if ((0.0 < fVar5) && (fVar5 < local_48.y)) { listData = siblings._data; if (0.1 < local_40) { local_28 = (local_3c / fVar5) * local_40 + local_28; local_24 = (local_38 / fVar5) * local_40 + local_24; } goto LAB_0063dccd; } } listData = siblings._data; } LAB_0063dccd: uVar4 = uVar4 + 1; } while (uVar4 < (uint)siblings._size); } (familiar->_velocity).x = local_28 + (familiar->_velocity).x; (familiar->_velocity).y = local_24 + (familiar->_velocity).y; if (siblings._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (siblings._data != (void *)0x0) { uVar4 = *(uint *)((int)siblings._data + -4); prevAllocated = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)prevAllocated < uVar4); free((uint *)((int)siblings._data + -4)); } } ExceptionList = local_1c; return; } //@@ 0063dd60 Entity_Familiar::minisaac_find_target /* DB: ? ECX=familiar from ai_minisaac (every 4 frames, not paused): IsVulnerableEnemy/IsEnemy/HasEntityFlags filters, Room::CheckLine line-of-sight, sqrtf distance */ void Entity_Familiar::minisaac_find_target(void) { Entity *targetSlot; byte bVar2; uint frameMod; EntityPtr target; float *sideOffset; Entity *in_ECX; int candidateType; bool isUpdateFrame; float fVar3; float dx; undefined1 sideOffsetBuf [8]; Vector candidatePos; EntityPtr *local_28; Entity *local_24; EntityPtr local_20; float bestScore; float score; EntityPtr bestTarget; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; Game *game; Entity_NPC *ownerParent; EntityPtr *targetSlot; game = g_game; uStack_8 = 0xffffffff; puStack_c = &LAB_00af7060; local_10 = ExceptionList; ExceptionList = &local_10; if ((in_ECX->_flags & 0x4000) == 0) { local_24 = in_ECX; bVar2 = Game::IsPaused(g_game); if (bVar2 == 0) { frameMod = game->_frameCount + in_ECX->_index & 0x80000003; isUpdateFrame = frameMod == 0; if ((int)frameMod < 0) { isUpdateFrame = (frameMod - 1 | 0xfffffffc) == 0xffffffff; } if (isUpdateFrame) { targetSlot = &in_ECX->_target; target = *targetSlot; fVar3 = *(float *)(*(int *)&in_ECX[1].field_0x4 + 0x340) - (in_ECX->_pos).y; dx = *(float *)(*(int *)&in_ECX[1].field_0x4 + 0x33c) - (in_ECX->_pos).x; fVar3 = sqrtf(fVar3 * fVar3 + dx * dx); if (800.0 < fVar3) { if (target != (EntityPtr)0x0) { local_20 = (EntityPtr)targetSlot; std::multiset::erase(&local_20); } *targetSlot = (EntityPtr)0x0; ExceptionList = local_10; return; } if ((target != (EntityPtr)0x0) && (bVar2 = Entity::IsVulnerableEnemy((Entity *)target,(Entity *)0x0), bVar2 != 0)) { ExceptionList = local_10; return; } if ((in_ECX->_flags & 0x100) == 0) { local_20 = (EntityPtr)0x0; bestTarget = (EntityPtr)0x0; bestScore = 0.0; local_28 = g_game->_room; if (local_28[0x499] != (EntityPtr)0x0) { do { target = *(EntityPtr *)((int)local_28[0x497] + (int)local_20 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)target + 0x28) != 1)) { candidateType = *(int *)((int)target + 0x28); if (candidateType - 10U < 0x3de) goto LAB_0063dfb5; } else { candidateType = 1; LAB_0063dfb5: if ((((*(int *)((int)target + 0x188) != 1) && (*(int *)((int)target + 0x188) != 0)) && (*(byte *)((int)target + 0x3b0) == 0)) && (*(byte *)((int)target + 0x173) == 0)) { bVar2 = Entity::HasEntityFlags((Entity *)target,0x10); targetSlot = local_24; if ((((bVar2 == 0) || (candidateType == 0x322)) || (candidateType == 0x362)) && ((bVar2 = Entity::IsDescendantOf(local_24,(Entity *)target), bVar2 == 0 && ((*(uint *)((int)target + 0x168) & 0x20000010) == 0)))) { candidatePos.y = *(float *)((int)target + 0x340); candidatePos.x = ((Vector *)((int)target + 0x33c))->x; bVar2 = Room::CheckLine(g_game->_room,&targetSlot->_pos,&candidatePos,3,0,0,0, (Vector *)0x0); if (bVar2 != 0) { score = 0.0; if (target == *targetSlot) { score = 100.0; } fVar3 = *(float *)((int)target + 0x340) - (targetSlot->_pos).y; dx = ((Vector *)((int)target + 0x33c))->x - (targetSlot->_pos).x; fVar3 = sqrtf(fVar3 * fVar3 + dx * dx); fVar3 = 100.0 - fVar3; if (fVar3 <= 0.0) { fVar3 = 0.0; } score = fVar3 + score; if ((bestScore < score) && ((sideOffset = (float *)FamiliarHelper::fly_head_pick_side_offset (sideOffsetBuf,target), *sideOffset != g_vectorZero.x || (sideOffset[1] != g_vectorZero.y)))) { bestScore = score; bestTarget = target; } } } } } local_20 = (EntityPtr)((int)local_20 + 1); } while ((uint)local_20 < (uint)local_28[0x499]); } target = bestTarget; if (*targetSlot != (EntityPtr)0x0) { local_28 = targetSlot; std::multiset::erase(&local_28); } *targetSlot = target; if (target == (EntityPtr)0x0) { ExceptionList = local_10; return; } } else { target = *targetSlot; if (((target != (EntityPtr)0x0) && (*(int *)((int)target + 0x28) == 1)) && (bVar2 = Entity_Player::HasInvincibility((Entity_Player *)target,0,(EntityRef *)0x0), bVar2 != 0)) { if (*targetSlot != (EntityPtr)0x0) { local_20 = (EntityPtr)targetSlot; std::multiset::erase(&local_20); } *targetSlot = (EntityPtr)0x0; } if ((in_ECX->_flags & 0x4000) != 0) { ExceptionList = local_10; return; } if (*targetSlot != (EntityPtr)0x0) { ExceptionList = local_10; return; } ownerParent = *(Entity_NPC **)(*(int *)&in_ECX[1].field_0x4 + 0x3bc); if (ownerParent == (Entity_NPC *)0x0) { ExceptionList = local_10; return; } bVar2 = Entity::IsEnemy((Entity *)ownerParent); if (bVar2 == 0) { ExceptionList = local_10; return; } target = (EntityPtr)Entity_NPC::GetPlayerTarget(ownerParent); fVar3 = (in_ECX->_pos).y - *(float *)((int)target + 0x340); dx = (in_ECX->_pos).x - ((Vector *)((int)target + 0x33c))->x; fVar3 = sqrtf(fVar3 * fVar3 + dx * dx); if (300.0 < fVar3) { ExceptionList = local_10; return; } if (*targetSlot != (EntityPtr)0x0) { local_20 = (EntityPtr)targetSlot; std::multiset::erase(&local_20); } *targetSlot = target; } std::multiset::insert(targetSlot); } } } ExceptionList = local_10; return; } //@@ 0063e180 FUN_0063e180 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0063e180(void) { EntityPtr EVar1; code *pcVar2; longlong lVar3; longlong lVar4; longlong lVar5; ItemPool *pIVar6; ANM2 *pAVar7; Manager *pMVar8; Game *pGVar9; char cVar10; byte bVar11; Entity *pEVar12; Entity_Tear *this; int iVar13; int *piVar14; char *anim; Vector *pVVar15; EntityPtr in_ECX; EntityPtr *pEVar16; int unusedArg; void *pvVar17; uint uVar18; uint uVar19; PlayerManager *pPVar20; bool bVar21; float fVar22; undefined1 *puVar23; float fVar24; float fVar25; ulonglong uVar26; undefined1 auStack_c0 [4]; ItemPool *pIStack_bc; float fStack_b8; float fStack_b4; int *piStack_b0; Game *pGStack_ac; Entity *local_a8; ItemPool *pIStack_a4; float fStack_a0; EntityPtr *pEStack_9c; Vector VStack_98; float fStack_90; ItemPool *pIStack_8c; Vector VStack_88; uint uStack_80; int iStack_7c; EntityPtr local_78; int iStack_74; uint uStack_70; Vector VStack_6c; undefined8 uStack_60; undefined4 uStack_58; undefined1 auStack_54 [8]; int iStack_4c; RNG RStack_48; ColorMod CStack_38; uint local_c; local_c = __security_cookie ^ (uint)auStack_c0; local_78 = in_ECX; if (g_game->_frameCount - *(int *)((int)in_ECX + 0x328) == 1) { local_a8 = g_game->_room; uVar19 = 0; if (local_a8[4]._burnCountdown != 0) { do { iVar13 = *(int *)(local_a8[4]._midasFreezeCountdown + uVar19 * 4); if (((((iVar13 != 0) && (*(int *)(iVar13 + 0x28) == 3)) && (*(void **)(iVar13 + 0x410) == *(void **)((int)in_ECX + 0x410))) && ((*(int *)((int)in_ECX + 0x28) == 3 && (*(int *)(iVar13 + 0x2c) == 0xce)))) && ((*(int *)(iVar13 + 0x30) == 0x28a && (pEVar16 = (EntityPtr *)(iVar13 + 0x3c4), *pEVar16 == (EntityPtr)0x0)))) { *pEVar16 = in_ECX; std::multiset::insert(pEVar16); } uVar19 = uVar19 + 1; } while (uVar19 < (uint)local_a8[4]._burnCountdown); } } switch(*(int *)((int)in_ECX + 0xd88)) { case 0: *(int *)((int)in_ECX + 0xd88) = 3; return; case 3: *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.8; if ((*(void **)((int)in_ECX + 0x7c) == (void *)0x0) || (*(byte *)((int)in_ECX + 0x8c) == 0)) { *(int *)((int)in_ECX + 0x188) = 4; *(int *)((int)in_ECX + 0x184) = 3; *(int *)((int)in_ECX + 0xd88) = 4; *(int *)((int)in_ECX + 0xd4c) = -1; (**(code **)(*(int *)in_ECX + 0x40))(0x41400000); return; } break; case 4: *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.8; ANM2::Play((ANM2 *)((int)in_ECX + 0x48),s_Attack1,0); if (*(void **)((int)in_ECX + 0x7c) != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered ((AnimationState *)((int)in_ECX + 0x78),(byte *)"Shoot"); if (bVar11 != 0) { Entity_Familiar::PickEnemyTarget((Entity_Familiar *)in_ECX,1000.0,1,5,&g_vectorZero,15.0); EVar1 = *(EntityPtr *)((int)in_ECX + 0x3c4); if (EVar1 == (EntityPtr)0x0) { fStack_a0 = *(float *)((int)*(void **)((int)in_ECX + 0x410) + 0x33c); fStack_b4 = *(float *)((int)*(void **)((int)in_ECX + 0x410) + 0x340); } else { fVar24 = *(float *)((int)in_ECX + 0x340) - *(float *)((int)EVar1 + 0x340); fVar25 = ((Vector *)((int)in_ECX + 0x33c))->x - *(float *)((int)EVar1 + 0x33c); fVar24 = sqrtf(fVar24 * fVar24 + fVar25 * fVar25); fStack_b4 = fVar24 * 0.1 * *(float *)((int)EVar1 + 0x364) + *(float *)((int)EVar1 + 0x340) ; fStack_a0 = fVar24 * 0.1 * *(float *)((int)EVar1 + 0x360) + *(float *)((int)EVar1 + 0x33c) ; } fStack_a0 = fStack_a0 - ((Vector *)((int)in_ECX + 0x33c))->x; fStack_b4 = fStack_b4 - *(float *)((int)in_ECX + 0x340); fVar22 = sqrtf(fStack_a0 * fStack_a0 + fStack_b4 * fStack_b4); fVar24 = fStack_b4; fVar25 = fStack_a0; if (0.0 < fVar22) { fVar24 = fStack_b4 * (1.0 / fVar22); fVar25 = fStack_a0 * (1.0 / fVar22); } ((Vector *)((int)in_ECX + 0x334))->x = fVar25 * 4.0; *(float *)((int)in_ECX + 0x338) = fVar24 * 4.0; *(int *)((int)in_ECX + 0xd4c) = 0; *(bool *)((int)in_ECX + 0x148) = fVar25 * 4.0 < 0.0; } if (*(void **)((int)in_ECX + 0x7c) != (void *)0x0) { bVar11 = AnimationState::IsEventTriggered ((AnimationState *)((int)in_ECX + 0x78),(byte *)"Sound"); if (bVar11 != 0) { *(byte *)((int)in_ECX + 0x148) = 0; } if ((*(void **)((int)in_ECX + 0x7c) != (void *)0x0) && (*(byte *)((int)in_ECX + 0x8c) != 0)) { iVar13 = *(int *)((int)in_ECX + 0xd4c); if (iVar13 < 0) { return; } if (iVar13 < 0x169) { if (*(byte *)((int)in_ECX + 0x148) == 0) { pIStack_bc = (ItemPool *)(90.0 - (float)iVar13); } else { pIStack_bc = (ItemPool *)((float)iVar13 + 90.0); } uVar19 = Random(); pIStack_bc = (ItemPool *)((float)pIStack_bc * 0.017453292); VStack_98.x = cos((float)pIStack_bc); VStack_98.x = VStack_98.x * 7.0; VStack_98.y = sin((float)pIStack_bc); VStack_98.y = VStack_98.y * 7.0; pEVar12 = Game::SpawnEx(g_game,2,1,(Vector *)((int)in_ECX + 0x33c),&VStack_98, (Entity *)in_ECX,0,uVar19,0); iVar13 = *(int *)pEVar12; pEVar12[1]._damageEvents._end = (void *)((float)pEVar12[1]._damageEvents._end - 0.099); (**(code **)(iVar13 + 0x40))(0x40600000); Entity::convert_shot_for_enemy_owner((Entity *)in_ECX,pEVar12); } ((Vector *)((int)in_ECX + 0x360))->x = ((Vector *)((int)in_ECX + 0x360))->x + ((Vector *)((int)in_ECX + 0x334))->x; *(float *)((int)in_ECX + 0x364) = *(float *)((int)in_ECX + 0x338) + *(float *)((int)in_ECX + 0x364); ((Vector *)((int)in_ECX + 0x334))->x = ((Vector *)((int)in_ECX + 0x334))->x * 0.93; *(float *)((int)in_ECX + 0x338) = *(float *)((int)in_ECX + 0x338) * 0.93; *(int *)((int)in_ECX + 0xd4c) = *(int *)((int)in_ECX + 0xd4c) + 0x1e; return; } } } *(int *)((int)in_ECX + 0xd88) = 5; *(int *)((int)in_ECX + 0xd4c) = -1; ((Vector *)((int)in_ECX + 0x334))->x = g_vectorZero.x; *(float *)((int)in_ECX + 0x338) = g_vectorZero.y; return; case 5: *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.9; ANM2::Play((ANM2 *)((int)in_ECX + 0x48),s_Attack2,0); *(int *)((int)in_ECX + 0x184) = 3; if ((*(void **)((int)in_ECX + 0x7c) != (void *)0x0) && (bVar11 = AnimationState::IsEventTriggered((AnimationState *)((int)in_ECX + 0x78),s_Jump), bVar11 != 0)) { Entity_Familiar::PickEnemyTarget((Entity_Familiar *)in_ECX,1000.0,1,5,&g_vectorZero,15.0); EVar1 = *(EntityPtr *)((int)in_ECX + 0x3c4); if (EVar1 != (EntityPtr)0x0) { fStack_b4 = ((Vector *)((int)in_ECX + 0x33c))->x; fStack_a0 = *(float *)((int)in_ECX + 0x340); fVar25 = fStack_b4 - *(float *)((int)EVar1 + 0x33c); fVar24 = fStack_a0 - *(float *)((int)EVar1 + 0x340); fVar24 = sqrtf(fVar24 * fVar24 + fVar25 * fVar25); fStack_b8 = (fVar24 * 0.1 * *(float *)((int)EVar1 + 0x364) + *(float *)((int)EVar1 + 0x340)) - fStack_a0; pIStack_bc = (ItemPool *) ((fVar24 * 0.1 * *(float *)((int)EVar1 + 0x360) + *(float *)((int)EVar1 + 0x33c)) - fStack_b4); fVar24 = sqrtf(fStack_b8 * fStack_b8 + (float)pIStack_bc * (float)pIStack_bc); if ((fVar24 <= 120.0) || (fVar24 <= 0.0)) { fVar25 = fStack_b8; pIVar6 = pIStack_bc; } else { fVar25 = fStack_b8 * (120.0 / fVar24); pIVar6 = (ItemPool *)((float)pIStack_bc * (120.0 / fVar24)); } ((Vector *)((int)in_ECX + 0x334))->x = fStack_b4 + (float)pIVar6; *(float *)((int)in_ECX + 0x338) = fStack_a0 + fVar25; } } fVar24 = ((Vector *)((int)in_ECX + 0x334))->x; if ((fVar24 != g_vectorZero.x) || (*(float *)((int)in_ECX + 0x338) != g_vectorZero.y)) { fVar25 = *(float *)((int)in_ECX + 0x338); fVar22 = *(float *)((int)in_ECX + 0x340); ((Vector *)((int)in_ECX + 0x360))->x = (fVar24 - ((Vector *)((int)in_ECX + 0x33c))->x) * 0.2; *(float *)((int)in_ECX + 0x364) = (fVar25 - fVar22) * 0.2; } if (*(void **)((int)in_ECX + 0x7c) == (void *)0x0) { LAB_0063ead6: if (-1 < *(int *)((int)in_ECX + 0xd4c)) { *(int *)((int)in_ECX + 0x184) = 5; *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.5; } } else { bVar11 = AnimationState::IsEventTriggered ((AnimationState *)((int)in_ECX + 0x78),(byte *)"Shoot"); if (bVar11 != 0) { Game::ShakeScreen(g_game,5); pMVar8 = g_manager; fStack_b4 = 1.00893e-43; seed_fart_sound_override((int *)&fStack_b4); SoundEffects::Play(&pMVar8->_sfxManager,(int)fStack_b4,1.0,2,0,1.0,0.0); *(int *)((int)in_ECX + 0xd4c) = 0; ((Vector *)((int)in_ECX + 0x334))->x = g_vectorZero.x; *(float *)((int)in_ECX + 0x338) = g_vectorZero.y; uVar19 = Random(); pEVar12 = Game::SpawnEx(g_game,1000,0x2e,(Vector *)((int)in_ECX + 0x33c),&g_vectorZero, (Entity *)in_ECX,0,uVar19,0); fStack_b8 = 0.0; (pEVar12->_sprite)._scale.x = 1.5; (pEVar12->_sprite)._scale.y = 1.5; pAVar7 = &pEVar12[1]._sprite; (pAVar7->_filename)._buf[8] = -0x6a; (pAVar7->_filename)._buf[9] = '\0'; (pAVar7->_filename)._buf[10] = '\0'; (pAVar7->_filename)._buf[0xb] = '\0'; pAVar7 = &pEVar12[1]._sprite; (pAVar7->_filename)._buf[0xc] = -0x6a; (pAVar7->_filename)._buf[0xd] = '\0'; (pAVar7->_filename)._buf[0xe] = '\0'; (pAVar7->_filename)._buf[0xf] = '\0'; do { uVar19 = Random(); local_a8 = (Entity *) ((float)((double)(int)fStack_b8 + __uint_to_double_fixup[-((int)fStack_b8 >> 0x1f)]) * 360.0 * 0.125 * 0.017453292); VStack_98.x = cos((float)local_a8); VStack_98.x = VStack_98.x * 10.0; VStack_98.y = sin((float)local_a8); VStack_98.y = VStack_98.y * 10.0; pEVar12 = Game::SpawnEx(g_game,2,1,(Vector *)((int)in_ECX + 0x33c),&VStack_98, (Entity *)in_ECX,0,uVar19,0); iVar13 = *(int *)pEVar12; pEVar12[1]._damageEvents._end = (void *)((float)pEVar12[1]._damageEvents._end - 0.099); (**(code **)(iVar13 + 0x40))(0x40a00000); Entity::convert_shot_for_enemy_owner((Entity *)in_ECX,pEVar12); fStack_b8 = (float)((int)fStack_b8 + 1); } while ((uint)fStack_b8 < 8); fStack_b8 = 0.0; do { uVar19 = Random(); local_a8 = (Entity *) ((((float)((double)(int)fStack_b8 + __uint_to_double_fixup[-((int)fStack_b8 >> 0x1f)]) * 360.0) / 14.0) * 0.017453292); VStack_98.x = cos((float)local_a8); VStack_98.x = VStack_98.x * 5.0; VStack_98.y = sin((float)local_a8); VStack_98.y = VStack_98.y * 5.0; pEVar12 = Game::SpawnEx(g_game,2,1,(Vector *)((int)in_ECX + 0x33c),&VStack_98, (Entity *)in_ECX,0,uVar19,0); iVar13 = *(int *)pEVar12; pEVar12[1]._damageEvents._end = (void *)((float)pEVar12[1]._damageEvents._end - 0.099); (**(code **)(iVar13 + 0x40))(0x40a00000); Entity::convert_shot_for_enemy_owner((Entity *)in_ECX,pEVar12); fStack_b8 = (float)((int)fStack_b8 + 1); } while ((uint)fStack_b8 < 0xe); } if ((*(void **)((int)in_ECX + 0x7c) == (void *)0x0) || (bVar11 = AnimationState::IsEventTriggered ((AnimationState *)((int)in_ECX + 0x78),(byte *)"Sound"), bVar11 == 0)) goto LAB_0063ead6; *(int *)((int)in_ECX + 0xd4c) = -1; } if ((*(void **)((int)in_ECX + 0x7c) == (void *)0x0) || (*(byte *)((int)in_ECX + 0x8c) == 0)) { *(int *)((int)in_ECX + 0xd88) = 6; *(int *)((int)in_ECX + 0xd4c) = -1; return; } break; case 6: if (*(int *)((int)in_ECX + 0xd4c) == -1) { *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.8; ANM2::Play((ANM2 *)((int)in_ECX + 0x48),&DAT_00b1d2e4,0); if ((*(void **)((int)in_ECX + 0x7c) != (void *)0x0) && (bVar11 = AnimationState::IsEventTriggered ((AnimationState *)((int)in_ECX + 0x78),(byte *)"Shoot"), bVar11 != 0)) { uVar19 = Random(); puVar23 = &DAT_bf800000; if ((uVar19 & 1) == 0) { puVar23 = (undefined1 *)0x3f800000; } ((Vector *)((int)in_ECX + 0x334))->x = (float)puVar23; *(undefined1 **)((int)in_ECX + 0x338) = &DAT_bf800000; *(bool *)((int)in_ECX + 0x148) = (float)puVar23 < 0.0; Vector::Normalize((Vector *)((int)in_ECX + 0x334)); *(int *)((int)in_ECX + 0xd4c) = 0; } } else if (*(int *)((int)in_ECX + 0xd4c) == -2) { *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.9; ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"Attack3End",0); if ((*(void **)((int)in_ECX + 0x7c) == (void *)0x0) || (*(byte *)((int)in_ECX + 0x8c) == 0)) { *(int *)((int)in_ECX + 0xd88) = 7; ((Vector *)((int)in_ECX + 0x334))->x = g_vectorZero.x; *(float *)((int)in_ECX + 0x338) = g_vectorZero.y; *(int *)((int)in_ECX + 0xd4c) = -1; *(int *)((int)in_ECX + 0xd50) = 0; } } iVar13 = *(int *)((int)in_ECX + 0xd4c); if (iVar13 < 0) { return; } if ((*(void **)((int)in_ECX + 0x7c) == (void *)0x0) || (*(byte *)((int)in_ECX + 0x8c) == 0)) { ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"Attack3Loop",0); iVar13 = *(int *)((int)in_ECX + 0xd4c); } *(float *)((int)in_ECX + 0x36c) = 0.98; *(uint *)((int)in_ECX + 0xd4c) = iVar13 + 1U; pMVar8 = g_manager; if ((iVar13 + 1U & 1) == 0) { iStack_74 = 0xb9; seed_fart_sound_override(&iStack_74); SoundEffects::Play(&pMVar8->_sfxManager,iStack_74,1.0,2,0,1.0,0.0); fStack_b8 = ((Vector *)((int)in_ECX + 0x334))->x; pIStack_bc = *(ItemPool **)((int)in_ECX + 0x338); uVar19 = Random(); fVar24 = (float)((double)(int)uVar19 + __uint_to_double_fixup[-((int)uVar19 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; fStack_b8 = -fStack_b8 * 5.0 * fVar24; pIStack_bc = (ItemPool *)(-(float)pIStack_bc * 5.0 * fVar24); uVar19 = Random(); local_a8 = (Entity *) (((float)((double)(int)uVar19 + __uint_to_double_fixup[-((int)uVar19 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292); pGStack_ac = (Game *)cos((float)local_a8); fVar24 = sin((float)local_a8); VStack_6c.x = (float)pGStack_ac * fStack_b8 - fVar24 * (float)pIStack_bc; VStack_6c.y = (float)pGStack_ac * (float)pIStack_bc + fVar24 * fStack_b8; VStack_98.x = ((Vector *)((int)in_ECX + 0x33c))->x - ((Vector *)((int)in_ECX + 0x334))->x * 12.0; VStack_98.y = *(float *)((int)in_ECX + 0x340) - 4.0; uVar19 = Random(); fStack_b4 = (float)((double)(int)uVar19 + __uint_to_double_fixup[-((int)uVar19 >> 0x1f)]) * 2.3283064e-10; uVar19 = Random(); this = (Entity_Tear *) Game::SpawnEx(g_game,2,1,&VStack_98,&VStack_6c,(Entity *)in_ECX,0,uVar19,0); this->_fallingAccel = this->_fallingAccel - 0.099; fVar24 = fStack_b4 * -4.0; FUN_0067af30(); if (fVar24 <= 0.01) { fVar24 = 0.01; } this->_baseScale = fVar24; this->_fScale = fVar24; Entity_Tear::ResetSpriteScale(this); Entity_Projectile::SetHeight((Entity_Projectile *)this,this->_height - 10.0); (**(code **)(*(int *)this + 0x40))(fStack_b4 + 3.0); Entity::convert_shot_for_enemy_owner((Entity *)in_ECX,(Entity *)this); uStack_70 = Random(); pGStack_ac = g_game; pIStack_a4 = (ItemPool *)0x0; fStack_a0 = 1.10703e-43; fStack_b8 = 1.4013e-42; lua_callback_run_pre_entity_spawn ((int *)&fStack_b8,(int *)&fStack_a0,&VStack_98,&g_vectorZero,(Entity *)0x0, (int *)&pIStack_a4,&uStack_70); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0063f1f1: pIStack_bc = pIStack_a4; } else { piStack_b0 = (g_game->_deathmatchManager)._type; fVar24 = (float)Random(); pIVar6 = pIStack_a4; uStack_60 = 0x900000005; uStack_80 = 7; uStack_58 = 7; fStack_b4 = fVar24; if (fStack_b8 != 7.00649e-45) goto LAB_0063f1f1; if ((uint)fStack_a0 < 0x12d) { if (fStack_a0 == 4.2039e-43) { while ((pIStack_bc = pIStack_a4, pIStack_a4 == (ItemPool *)0x0 || (cVar10 = (**(code **)(*piStack_b0 + 0x24))(pIStack_a4), cVar10 != '\0'))) { if (fVar24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar19 = (uint)fVar24 >> ((byte)uStack_60 & 0x1f) ^ (uint)fVar24; uVar19 = uVar19 << ((byte)((ulonglong)uStack_60 >> 0x20) & 0x1f) ^ uVar19; fVar24 = (float)(uVar19 >> ((byte)uStack_80 & 0x1f) ^ uVar19); iVar13 = ItemPool::GetCardEx((int)fVar24,0x19,10,10,1); RStack_48._shift1 = 5; RStack_48._shift2 = 9; RStack_48._shift3 = 7; RStack_48._seed = (int)fVar24; pIStack_a4 = (ItemPool *)lua_callback_run_get_card(&RStack_48,iVar13,1,1,0); } } else { if (fStack_a0 == 9.80909e-44) { local_a8 = (Entity *)((uint)pIStack_a4 >> 0xb); do { pIStack_bc = pIStack_a4; if (pIStack_a4 != (ItemPool *)0x0) { pcVar2 = *(code **)(*piStack_b0 + 0x28); iVar13 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)pIStack_a4,(Entity_Player *)0x0); cVar10 = (*pcVar2)(iVar13); if (cVar10 == '\0') goto LAB_0063f1f9; fVar24 = fStack_b4; } pIStack_8c = &g_game->_itemPool; if (fVar24 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar19 = (uint)fVar24 >> ((byte)uStack_60 & 0x1f) ^ (uint)fVar24; uVar19 = uVar19 << ((byte)((ulonglong)uStack_60 >> 0x20) & 0x1f) ^ uVar19; fVar24 = (float)(uVar19 >> ((byte)uStack_80 & 0x1f) ^ uVar19); fStack_b4 = fVar24; uVar19 = ItemPool::GetPill((uint)fVar24); pIStack_a4 = (ItemPool *)(uVar19 | ((uint)local_a8 & 1) << 0xb); } while( true ); } if (fStack_a0 != 1.4013e-43) goto LAB_0063f1f1; pIStack_bc = pIStack_a4; if (pIStack_a4 == (ItemPool *)0x19) { LAB_0063f039: bVar21 = false; } else { pIStack_8c = pIStack_a4; std::set::find_node(auStack_54,&pIStack_8c); if (((*(char *)(iStack_4c + 0xd) == '\0') && (*(int *)(iStack_4c + 0x10) <= (int)pIVar6)) && (iStack_4c != piStack_b0[8])) goto LAB_0063f039; bVar21 = true; } if ((pIVar6 == (ItemPool *)0x0) || (bVar21)) { pIStack_bc = (ItemPool *)(**(code **)(*piStack_b0 + 0x84))(0); pIStack_a4 = pIStack_bc; } } } else { if (fStack_a0 != 4.90454e-43) goto LAB_0063f1f1; while ((pIStack_bc = pIStack_a4, pIStack_a4 == (ItemPool *)0x0 || (cVar10 = (**(code **)(*piStack_b0 + 0x2c))(pIStack_a4), cVar10 != '\0'))) { pIStack_a4 = (ItemPool *)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0063f1f9: local_a8 = EntityFactory::Create(pGStack_ac->_entityFactory,(uint)fStack_b8,0); lVar3 = CONCAT44(pGStack_ac,pIStack_8c); if (local_a8 != (Entity *)0x0) { uVar26 = GetTimeNs(); pEVar12 = local_a8; uStack_80 = (uint)(uVar26 >> 0x20); lVar3 = (uVar26 & 0xffffffff) * 0x431bde82; pEStack_9c = (EntityPtr *)((ulonglong)lVar3 >> 0x20); fStack_90 = (float)((ulonglong)uStack_80 * 0xd7b634db >> 0x20); uVar26 = (ulonglong)uStack_80 * 0xd7b634db + ((uVar26 & 0xffffffff) * 0xd7b634db >> 0x20); uVar18 = (uint)(uVar26 >> 0x20); lVar3 = lVar3 + (uVar26 & 0xffffffff); VStack_88.x = (float)lVar3; uVar19 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = (ulonglong)uStack_80 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar18,uVar19),uVar18 + uVar19); local_a8->_spawnerType = 0; uVar19 = (uint)((ulonglong)lVar3 >> 0x20); local_a8->_spawnerVariant = 0; piStack_b0 = (int *)((uint)lVar3 >> 0x12 | uVar19 * 0x4000); fStack_b4 = (float)(uVar19 >> 0x12); pEVar16 = &local_a8->_spawnerEntity; if (*pEVar16 != (EntityPtr)0x0) { pEStack_9c = pEVar16; std::multiset::erase(&pEStack_9c); } iVar13 = *(int *)pEVar12; *pEVar16 = (EntityPtr)0x0; (pEVar12->_pos).x = VStack_98.x; (pEVar12->_pos).y = VStack_98.y; (pEVar12->_velocity).x = g_vectorZero.x; (pEVar12->_velocity).y = g_vectorZero.y; (**(code **)(iVar13 + 4))(fStack_b8,fStack_a0,pIStack_bc,uStack_70); pGVar9 = pGStack_ac; pvVar17 = pGStack_ac->_room; iVar13 = *(int *)((int)pvVar17 + 0x1214); *(int *)((int)pvVar17 + 0x1214) = iVar13 + 1; pEVar12->_index = iVar13; EntityList::AddEntity((EntityList *)((int)pvVar17 + 0x1218),pEVar12); bVar11 = Game::ShouldEraseEnemy(pEVar12); if (bVar11 != 0) { Entity::RemoveWithPoof(pEVar12,unusedArg); } if ((pEVar12->_exists != 0) && ((pGVar9->_proceduralItemManager)._proceduralItems._begin != (pGVar9->_proceduralItemManager)._proceduralItems._end)) { iStack_7c = pEVar12->_variant; uStack_80 = pEVar12->_type; std::map::find(&pGStack_ac,&uStack_80); if (pGStack_ac == (pGVar9->_proceduralItemManager)._spawnTriggerTargets._head) { VStack_88.x = (float)pEVar12->_type; VStack_88.y = -NAN; piVar14 = (int *)std::map::find(&fStack_90,&VStack_88); pGStack_ac = (Game *)*piVar14; if (pGStack_ac == (pGVar9->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_0063f472; } pPVar20 = &g_game->_playerManager; pIStack_bc = (ItemPool *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar20->_playerList)._begin >> 2 != 0) { do { pvVar17 = (pPVar20->_playerList)._end; if ((int)pvVar17 - (int)(pPVar20->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar17 = (pPVar20->_playerList)._end; } piVar14 = (pPVar20->_playerList)._begin; if (pIStack_bc < (ItemPool *)((int)pvVar17 - (int)piVar14 >> 2)) { piVar14 = piVar14 + (int)pIStack_bc; } trigger_set_dispatch((void *)(*piVar14 + 0x1fc8),6,pEVar12,&VStack_98,&g_vectorZero); pPVar20 = &g_game->_playerManager; pIStack_bc = (ItemPool *)((int)&pIStack_bc->_seed + 1); } while (pIStack_bc < (ItemPool *) ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar20->_playerList)._begin >> 2)); } } LAB_0063f472: uVar26 = GetTimeNs(); uVar19 = (uint)(uVar26 >> 0x20); lVar4 = (uVar26 & 0xffffffff) * 0x431bde82; fStack_90 = (float)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar19 * 0xd7b634db; pEStack_9c = (EntityPtr *)((ulonglong)lVar5 >> 0x20); lVar3 = (ulonglong)uVar19 * 0x431bde82; uVar26 = lVar5 + ((uVar26 & 0xffffffff) * 0xd7b634db >> 0x20); uVar18 = (uint)(uVar26 >> 0x20); lVar4 = lVar4 + (uVar26 & 0xffffffff); VStack_88.x = (float)lVar4; uVar19 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar18,uVar19),uVar18 + uVar19); uVar18 = (uint)((ulonglong)lVar4 >> 0x20); piVar14 = (int *)((uint)lVar4 >> 0x12 | uVar18 * 0x4000); uVar19 = (int)piVar14 - (int)piStack_b0; bVar21 = CARRY4((uint)g_entitySpawnTimeMs,uVar19); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar19; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar18 >> 0x12) - (int)fStack_b4) - (uint)(piVar14 < piStack_b0)) + (uint)bVar21; in_ECX = local_78; } pEVar12 = local_a8; pGStack_ac = (Game *)((ulonglong)lVar3 >> 0x20); pIStack_8c = (ItemPool *)lVar3; uVar19 = Random(); (pEVar12->_sprite)._rotation = (float)((double)(int)uVar19 + __uint_to_double_fixup[-((int)uVar19 >> 0x1f)]) * 2.3283064e-10 * 360.0; uVar19 = Random(); CStack_38._offset[0] = 0.54901963; CStack_38._offset[1] = 0.043137256; CStack_38._offset[2] = 0.058823533; fVar25 = (float)((double)(int)uVar19 + __uint_to_double_fixup[-((int)uVar19 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.8; fVar24 = fVar25 * g_vectorOne.x; (pEVar12->_sprite)._scale.y = fVar25 * g_vectorOne.y; (pEVar12->_sprite)._scale.x = fVar24; CStack_38._colorize[0] = 0.0; CStack_38._colorize[1] = 0.0; CStack_38._colorize[2] = 0.0; CStack_38._colorize[3] = 0.0; CStack_38._tint[0] = 0.0; CStack_38._tint[1] = 0.0; CStack_38._tint[2] = 0.0; CStack_38._tint[3] = 1.0; Sprite::SetColor((Sprite *)&pEVar12->_sprite,&CStack_38); (pEVar12->_posOffset).x = 0.0; (pEVar12->_posOffset).y = -33.0; if (*(float *)((int)in_ECX + 0x338) <= 0.0 && *(float *)((int)in_ECX + 0x338) != 0.0) { pEVar12->_renderDepthOffset = 10.0; } } if (*(byte *)((int)in_ECX + 400) != 0) { fVar24 = ((Vector *)((int)in_ECX + 0x334))->x; if (((0.0 < fVar24) && (0.2 < ((Vector *)((int)in_ECX + 0x19c))->x)) || ((fVar24 < 0.0 && (((Vector *)((int)in_ECX + 0x19c))->x <= -0.2 && ((Vector *)((int)in_ECX + 0x19c))->x != -0.2)))) { ((Vector *)((int)in_ECX + 0x334))->x = -fVar24; } fVar24 = *(float *)((int)in_ECX + 0x338); if (((0.0 < fVar24) && (0.2 < *(float *)((int)in_ECX + 0x1a0))) || ((fVar24 < 0.0 && (*(float *)((int)in_ECX + 0x1a0) <= -0.2 && *(float *)((int)in_ECX + 0x1a0) != -0.2)))) { *(float *)((int)in_ECX + 0x338) = -fVar24; } pVVar15 = (Vector *)((int)in_ECX + 0x360); Vector::Normalize(pVVar15); Entity_Familiar::PickEnemyTarget((Entity_Familiar *)in_ECX,1000.0,1,5,&g_vectorZero,15.0); local_78 = *(EntityPtr *)((int)in_ECX + 0x3c4); if (local_78 != (EntityPtr)0x0) { pEStack_9c = (EntityPtr *)((Vector *)((int)local_78 + 0x33c))->x; fStack_90 = *(float *)((int)local_78 + 0x340); fVar25 = *(float *)((int)in_ECX + 0x33c) - (float)pEStack_9c; fVar24 = *(float *)((int)in_ECX + 0x340) - fStack_90; fVar24 = sqrtf(fVar24 * fVar24 + fVar25 * fVar25); VStack_88.x = (((Vector *)((int)local_78 + 0x360))->x * fVar24 * 0.1 + (float)pEStack_9c) - *(float *)((int)in_ECX + 0x33c); VStack_88.y = (*(float *)((int)local_78 + 0x364) * fVar24 * 0.1 + fStack_90) - *(float *)((int)in_ECX + 0x340); Vector::Normalized(&VStack_88,&VStack_6c); if (0.9 < VStack_6c.y * *(float *)((int)in_ECX + 0x364) + VStack_6c.x * pVVar15->x) { pVVar15->x = VStack_6c.x; *(float *)((int)in_ECX + 0x364) = VStack_6c.y; } } fVar25 = sqrtf(*(float *)((int)in_ECX + 0x194) * *(float *)((int)in_ECX + 0x194) + *(float *)((int)in_ECX + 0x198) * *(float *)((int)in_ECX + 0x198)); fVar24 = pVVar15->x; *(float *)((int)in_ECX + 0x364) = fVar25 * *(float *)((int)in_ECX + 0x364); pVVar15->x = fVar25 * fVar24; } anim = "Attack3Loop"; if (0.0 < *(float *)((int)in_ECX + 0x338)) { anim = "Attack3BackLoop"; } ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)anim,0); *(bool *)((int)in_ECX + 0x148) = *(float *)((int)in_ECX + 0x334) < 0.0; *(float *)((int)in_ECX + 0x360) = *(float *)((int)in_ECX + 0x334) * 0.4 + *(float *)((int)in_ECX + 0x360); *(float *)((int)in_ECX + 0x364) = *(float *)((int)in_ECX + 0x338) * 0.4 + *(float *)((int)in_ECX + 0x364); if ((0x78 < *(int *)((int)in_ECX + 0xd4c)) && (*(float *)((int)in_ECX + 0x338) <= 0.0 && *(float *)((int)in_ECX + 0x338) != 0.0)) { *(undefined1 *)((int)in_ECX + 0x148) = 0; *(undefined4 *)((int)in_ECX + 0xd4c) = 0xfffffffe; return; } break; case 7: ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"Leave",0); *(int *)((int)in_ECX + 0x188) = 0; *(int *)((int)in_ECX + 0x184) = 0; if (*(int *)((int)in_ECX + 0xd4c) == -2) { fVar24 = *(float *)((int)in_ECX + 0x338); fVar25 = *(float *)((int)in_ECX + 0x364); ((Vector *)((int)in_ECX + 0x360))->x = ((Vector *)((int)in_ECX + 0x334))->x * 0.75 + ((Vector *)((int)in_ECX + 0x360))->x; *(float *)((int)in_ECX + 0x364) = fVar24 * 0.75 + fVar25; fVar24 = *(float *)((int)in_ECX + 0x36c) * 0.98; } else { if ((*(void **)((int)in_ECX + 0x7c) != (void *)0x0) && (bVar11 = AnimationState::IsEventTriggered ((AnimationState *)((int)in_ECX + 0x78),(byte *)"Shoot"), bVar11 != 0)) { *(int *)((int)in_ECX + 0xd4c) = -2; pVVar15 = Room::GetCenterPos(&VStack_88); fVar24 = pVVar15->x; fVar25 = ((Vector *)((int)in_ECX + 0x33c))->x; fVar22 = ((Vector *)((int)in_ECX + 0x33c))->x; *(float *)((int)in_ECX + 0x338) = 0.0; if (fVar24 < fVar22 || fVar24 == fVar25) { ((Vector *)((int)in_ECX + 0x334))->x = 1.0; *(byte *)((int)in_ECX + 0x148) = 0; } else { ((Vector *)((int)in_ECX + 0x334))->x = (float)&DAT_bf800000; *(byte *)((int)in_ECX + 0x148) = 1; } } fVar24 = *(float *)((int)in_ECX + 0x36c) * 0.8; } *(float *)((int)in_ECX + 0x36c) = fVar24; if ((*(void **)((int)in_ECX + 0x7c) == (void *)0x0) || (*(byte *)((int)in_ECX + 0x8c) == 0)) { (**(code **)(*(int *)in_ECX + 0x28))(); } } return; } //@@ 0063f9f0 FUN_0063f9f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0063f9f0(void) { AnimationState *this; ColorMod *pCVar1; float fVar2; float fVar3; Manager *pMVar4; byte bVar5; char cVar6; uint uVar7; uint subType; Entity *pEVar8; byte *pbVar9; uint uVar10; Entity_NPC *in_ECX; int extraout_ECX; byte *pbVar11; int extraout_EDX; int iVar12; bool bVar13; float fVar14; code *pcStack_74; Vector VStack_70; float fStack_68; Vector VStack_64; Vector VStack_5c; int iStack_54; int iStack_50; int iStack_4c; int iStack_48; float fStack_44; float fStack_40; float fStack_3c; float fStack_38; uint uStack_34; Vector local_2c; undefined1 *local_24; char *local_20; Vector local_1c; undefined4 uStack_14; undefined4 uStack_10; uint local_c; local_c = __security_cookie ^ (uint)&pcStack_74; local_2c.x = (float)s_Idle; local_1c.x = 0.0; local_1c.y = 0.0; uStack_14 = 10; uStack_10 = 4; iVar12 = 0; local_2c.y = (float)s_Idle2; local_24 = &DAT_00b1d43c; local_20 = "Idle4"; fVar14 = (float)(int)(in_ECX->_statusEffectSprite)._color._tint[0] / 23.0; if (fVar14 <= 0.5) { if (fVar14 <= 0.25) { if (0.0 < fVar14) { iVar12 = 1; } } else { iVar12 = 2; } } else { iVar12 = 3; } switch((in_ECX->_statusEffectSprite)._color._tint[2]) { case 0.0: (in_ECX->_statusEffectSprite)._color._tint[2] = 4.2039e-45; case 4.2039e-45: ANM2::Play(&in_ECX->_sprite,(byte *)(&local_2c.x)[iVar12],0); fVar14 = (&local_1c.x)[iVar12]; if ((fVar14 != 0.0) && (uVar10 = Random(), uVar10 % (uint)fVar14 == 0)) { uVar10 = Random(); Entity_NPC::MakeSplat (in_ECX,(float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)] ) * 2.3283064e-10 * 0.5 + 0.2); } break; default: goto LAB_0064001c; case 5.60519e-45: ANM2::Play(&in_ECX->_sprite,&DAT_00b643e8,0); this = &(in_ECX->_sprite)._animState; fVar14 = in_ECX->_friction; fVar2 = *(float *)(in_ECX->_stateFrame + 0x340); fVar3 = (in_ECX->_pos).y; (in_ECX->_velocity).x = (*(float *)(in_ECX->_stateFrame + 0x33c) - (in_ECX->_pos).x) / fVar14; (in_ECX->_velocity).y = (fVar2 - fVar3) / fVar14; if ((in_ECX->_sprite)._animState._animData == (void *)0x0) { return; } bVar5 = AnimationState::IsEventTriggered(this,&DAT_00b1d3b0); pMVar4 = g_manager; if (bVar5 == 0) { if ((in_ECX->_sprite)._animState._animData == (void *)0x0) { return; } bVar5 = AnimationState::IsEventTriggered(this,&DAT_00b602f0); if (bVar5 == 0) { return; } (in_ECX->_statusEffectSprite)._color._tint[2] = 7.00649e-45; return; } pcStack_74 = (code *)0x4d; seed_fart_sound_override((int *)&pcStack_74); SoundEffects::Play(&pMVar4->_sfxManager,(int)pcStack_74,1.0,2,0,1.0,0.0); bVar5 = Entity_Player::HasInvincibility((Entity_Player *)in_ECX->_stateFrame,0,(EntityRef *)0x0) ; if (bVar5 != 0) { return; } iVar12 = Entity_Player::GetHealthType((Entity_Player *)in_ECX->_stateFrame); VStack_70.x = 0.0; if (extraout_EDX < 1) { VStack_70.x = (float)(2 - (uint)(iVar12 != 3)); } fStack_68 = (float)(*(int *)(extraout_ECX + 0x1344) - (int)VStack_70.x); iVar12 = 0; (in_ECX->_statusEffectSprite)._color._tint[0] = 0.0; if (0 < (int)fStack_68) { do { if (*(int *)(in_ECX->_stateFrame + 0x1344) <= (int)VStack_70.x) break; *(undefined4 *)(in_ECX->_stateFrame + 0x13bc) = 0; fStack_44 = (in_ECX->_pos).x; fStack_40 = (in_ECX->_pos).y; fStack_3c = (in_ECX->_velocity).x; pcStack_74 = *(code **)(*(int *)in_ECX->_stateFrame + 0x20); iStack_54 = in_ECX->_type; iStack_50 = in_ECX->_variant; iStack_4c = in_ECX->_spawnerType; iStack_48 = in_ECX->_spawnerVariant; fStack_38 = (in_ECX->_velocity).y; if ((in_ECX->_flags & 0x20000000) == 0) { uVar10 = 0; } else { uVar10 = 2; } if ((in_ECX->_flags & 0x40000000000000) == 0) { uVar7 = 0; } else { uVar7 = 4; } uStack_34 = uVar7 | uVar10 | (uint)((in_ECX->_flags & 0x100) != 0); cVar6 = (*pcStack_74)(0x3f800000,0x2042821,0,&iStack_54,0x1e); if (cVar6 == '\0') break; pCVar1 = &(in_ECX->_statusEffectSprite)._color; pCVar1->_tint[0] = (float)((int)pCVar1->_tint[0] + 1); iVar12 = iVar12 + 1; } while (iVar12 < (int)fStack_68); } if (0 < (int)(in_ECX->_statusEffectSprite)._color._tint[0]) { VStack_64.x = *(float *)(in_ECX->_stateFrame + 0x33c); VStack_64.y = *(float *)(in_ECX->_stateFrame + 0x340); Isaac::GetRandomPickupVelocity(&VStack_5c,&VStack_64,0,(RNG *)0x0); fStack_68 = VStack_5c.x + VStack_5c.x; VStack_64.y = VStack_5c.y + VStack_5c.y; VStack_64.x = fStack_68; VStack_5c.x = VStack_64.y; uVar10 = Random(); VStack_70.x = *(float *)(in_ECX->_stateFrame + 0x33c); VStack_70.y = *(float *)(in_ECX->_stateFrame + 0x340); Game::SpawnEx(g_game,1000,2,&VStack_70,&VStack_64,(Entity *)0x0,3,uVar10,0); uVar10 = Random(); uVar7 = Random(); iVar12 = 0; VStack_64.x = (float)(uVar10 % 3 + 8 + uVar7 % 6); if (VStack_64.x != 0.0) { do { uVar7 = Random(); VStack_70.x = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292; pcStack_74 = (code *)cos(VStack_70.x); VStack_70.x = sin(VStack_70.x); uVar7 = Random(); local_1c.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; local_1c.x = (fStack_68 * (float)pcStack_74 - VStack_5c.x * VStack_70.x) * local_1c.y; local_1c.y = (fStack_68 * VStack_70.x + VStack_5c.x * (float)pcStack_74) * local_1c.y; local_2c.x = local_1c.x + *(float *)(in_ECX->_stateFrame + 0x33c); local_2c.y = local_1c.y + *(float *)(in_ECX->_stateFrame + 0x340); uVar7 = Random(); subType = 99; if (iVar12 < (int)(uVar10 % 3 + 2)) { subType = 0; } pEVar8 = Game::SpawnEx(g_game,1000,5,&local_2c,&local_1c,(Entity *)0x0,subType,uVar7,0); (**(code **)(*(int *)pEVar8 + 0xc))(); iVar12 = iVar12 + 1; } while (iVar12 < (int)VStack_64.x); } bVar5 = Entity_Player::HasCollectible((Entity_Player *)in_ECX->_stateFrame,0xf7,0); if (bVar5 != 0) { pCVar1 = &(in_ECX->_statusEffectSprite)._color; pCVar1->_tint[0] = (float)((int)pCVar1->_tint[0] + 4); } } FUN_00640050(); return; case 7.00649e-45: if (((in_ECX->_sprite)._animState._animData != (void *)0x0) && ((in_ECX->_sprite)._animState._isPlaying == 0)) { pbVar9 = (in_ECX->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pbVar11 = &DAT_00b643e8; do { bVar5 = *pbVar9; bVar13 = bVar5 < *pbVar11; if (bVar5 != *pbVar11) { LAB_00640002: uVar10 = -(uint)bVar13 | 1; goto LAB_00640007; } if (bVar5 == 0) break; bVar5 = pbVar9[1]; bVar13 = bVar5 < pbVar11[1]; if (bVar5 != pbVar11[1]) goto LAB_00640002; pbVar9 = pbVar9 + 2; pbVar11 = pbVar11 + 2; } while (bVar5 != 0); uVar10 = 0; LAB_00640007: if (uVar10 == 0) { (in_ECX->_statusEffectSprite)._color._tint[2] = 4.2039e-45; } } } Entity_Familiar::FollowParent((Entity_Familiar *)in_ECX); LAB_0064001c: return; } //@@ 00640050 FUN_00640050 void FUN_00640050(void) { void *pvVar1; int iVar2; int *piVar3; int *piVar4; int in_ECX; int iVar5; ItemConfig_Item *collectibleID; ItemConfig_Item *local_1c; int iStack_18; int iStack_14; int iStack_10; int local_c; int local_8; iVar5 = *(int *)(in_ECX + 0x410); local_c = in_ECX; if (*(char *)(iVar5 + 0x1519) == '\0') { for (piVar3 = *(int **)(iVar5 + 0x150c); piVar3 != *(int **)(iVar5 + 0x1510); piVar3 = piVar3 + 4) { if ((*(int *)*piVar3 == 0) && (((int *)*piVar3)[1] == 0x36)) { iVar5 = piVar3[1]; if (0 < iVar5) { do { TemporaryEffects::RemoveNullEffect ((TemporaryEffects *)(*(int *)(in_ECX + 0x410) + 0x1508),0x36,1); iVar5 = iVar5 + -1; } while (iVar5 != 0); } break; } } } pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU) < 0xd9) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar1 + 0xd8); } iVar5 = 0; iStack_10 = 0; iStack_18 = 1; iStack_14 = 0; local_8 = 0; local_1c = collectibleID; if (0 < *(int *)(in_ECX + 0xd80)) { do { iVar2 = *(int *)(in_ECX + 0x410); if (*(char *)(iVar2 + 0x1519) == '\0') { piVar3 = *(int **)(iVar2 + 0x1510); for (piVar4 = *(int **)(iVar2 + 0x150c); piVar4 != piVar3; piVar4 = piVar4 + 4) { if ((ItemConfig_Item *)*piVar4 == collectibleID) { if (piVar4 != piVar3) { piVar4[1] = piVar4[1] + 1; piVar4[2] = piVar4[2] + iVar5; goto LAB_0064018d; } break; } } if (piVar3 == *(int **)(iVar2 + 0x1514)) { std::vector::_Emplace_reallocate(piVar3,&local_1c); collectibleID = local_1c; } else { *piVar3 = (int)local_1c; piVar3[1] = iStack_18; piVar3[2] = iStack_14; piVar3[3] = iStack_10; *(int *)(iVar2 + 0x1510) = *(int *)(iVar2 + 0x1510) + 0x10; } *(undefined4 *) (((*(int *)(iVar2 + 0x1510) - *(int *)(iVar2 + 0x150c) & 0xfffffff0U) - 0xc) + *(int *)(iVar2 + 0x150c)) = 1; if (*(Entity_Player **)(iVar2 + 0x151c) != (Entity_Player *)0x0) { Entity_Player::AddCostume(*(Entity_Player **)(iVar2 + 0x151c),collectibleID,0); } LAB_0064018d: *(uint *)(iVar2 + 0x1508) = *(uint *)(iVar2 + 0x1508) | collectibleID->cacheFlags; *(undefined1 *)(iVar2 + 0x1518) = 1; iVar5 = iStack_14; in_ECX = local_c; } local_8 = local_8 + 1; } while (local_8 < *(int *)(in_ECX + 0xd80)); } Entity_Player::EvaluateItems(); return; } //@@ 006401d0 FUN_006401d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_006401d0(void) { byte *pbVar1; byte bVar2; int iVar3; byte *pbVar4; uint uVar5; Entity_Familiar *in_ECX; byte *pbVar6; bool bVar7; byte *local_2c; byte *local_28 [7]; uint local_c; local_c = __security_cookie ^ (uint)&local_2c; local_28[0] = (byte *)&DAT_00b604e8; local_28[1] = &DAT_00b601c4; local_28[2] = s_Idle2; local_28[3] = &DAT_00b1d43c; iVar3 = in_ECX->_hearts; local_28[4] = (byte *)0xb604cc; local_28[5] = (byte *)0xb604d4; local_28[6] = (byte *)0xb612e0; if (iVar3 == 0) { in_ECX->_hearts = 2; Entity_Familiar::paschal_candle_sync_effects(in_ECX); iVar3 = in_ECX->_hearts; } pbVar1 = (in_ECX->_sprite)._animState._animData; iVar3 = iVar3 + -1; if (6 < iVar3) { iVar3 = 6; } if (iVar3 < 0) { iVar3 = 0; } local_2c = local_28[iVar3]; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; pbVar6 = local_2c; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } do { bVar2 = *pbVar4; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_00640290: uVar5 = -(uint)bVar7 | 1; goto LAB_00640295; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_00640290; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00640295: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((in_ECX->_sprite)._animState._isPlaying != 0)))) goto LAB_006402c8; } bVar2 = ANM2::SetAnimation(&in_ECX->_sprite,local_2c,1); if (bVar2 != 0) { AnimationState::Rewind(&(in_ECX->_sprite)._animState); (in_ECX->_sprite)._animState._isPlaying = 1; } LAB_006402c8: Entity_Familiar::FollowParent(in_ECX); return; } //@@ 006402f0 Entity_Familiar::paschal_candle_sync_effects /* DB: ECX familiar (variant 221 case in TriggerRoomClear after _hearts +0xd80 is raised to max 6): removes every COLLECTIBLE_PASCHAL_CANDLE 567 temporary effect from the owner player (+0x410 -> TemporaryEffects +0x1508) then re-adds (_hearts-1) of them and EvaluateItems; also called from trigger_player_damage and other variant 221 paths prototype: db/protos.zhl */ void __thiscall Entity_Familiar::paschal_candle_sync_effects(Entity_Familiar *this) { void *pvVar1; int iVar2; int local_18 [5]; pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0x8dc < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU)) && (local_18[0] = *(int *)((int)pvVar1 + 0x8dc), local_18[0] != 0)) { local_18[2] = *(undefined4 *)(local_18[0] + 0x78); local_18[1] = 0; local_18[3] = 0; TemporaryEffects::RemoveEffect((TemporaryEffects *)((int)this->_player + 0x1508),local_18,-1); } pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) < 0x8dd) { local_18[0] = 0; } else { local_18[0] = *(int *)((int)pvVar1 + 0x8dc); } iVar2 = 1; local_18[3] = 0; local_18[1] = 1; local_18[2] = 0; if (1 < this->_hearts) { do { TemporaryEffects::AddEffect((TemporaryEffects *)((int)this->_player + 0x1508),local_18,1,1); iVar2 = iVar2 + 1; } while (iVar2 < this->_hearts); } Entity_Player::EvaluateItems(); return; } //@@ 006403f0 FUN_006403f0 void FUN_006403f0(void) { float *pfVar1; void *pvVar2; int iVar3; EntityPtr EVar4; bool bVar5; byte bVar6; char *anim; uint uVar7; Entity_Tear *shot; char *pcVar8; Entity_Familiar *in_ECX; uint uVar9; char cVar10; float fVar11; float fVar12; float fVar13; RNG RStack_38; Vector VStack_28; float fStack_20; float fStack_1c; float fStack_18; float local_14; float local_10; float local_c; char local_6; char local_5; local_5 = '\0'; VStack_28.y = (float)in_ECX; if (in_ECX->_collidesWithGrid != 0) { fVar11 = (in_ECX->_targetPosition).x; if (((0.0 < fVar11) && (0.2 < (in_ECX->_gridCollisionNormal).x)) || ((fVar11 < 0.0 && ((in_ECX->_gridCollisionNormal).x <= -0.2 && (in_ECX->_gridCollisionNormal).x != -0.2)))) { (in_ECX->_targetPosition).x = -fVar11; } fVar11 = (in_ECX->_targetPosition).y; if (((0.0 < fVar11) && (0.2 < (in_ECX->_gridCollisionNormal).y)) || ((fVar11 < 0.0 && (pfVar1 = &(in_ECX->_gridCollisionNormal).y, *pfVar1 <= -0.2 && *pfVar1 != -0.2)))) { (in_ECX->_targetPosition).y = -fVar11; } local_c = (in_ECX->_velocity).x; local_14 = (in_ECX->_velocity).y; local_10 = sqrtf(local_c * local_c + local_14 * local_14); if (0.0 < local_10) { fVar11 = (in_ECX->_gridCollisionVelocity).x; fVar13 = (in_ECX->_gridCollisionVelocity).y; fVar11 = sqrtf(fVar13 * fVar13 + fVar11 * fVar11); (in_ECX->_velocity).x = local_c * (fVar11 / local_10); (in_ECX->_velocity).y = local_14 * (fVar11 / local_10); } local_5 = '\x01'; } local_6 = '\0'; in_ECX->_entityGridCollisionClass = 3; switch(in_ECX->_state) { case 0: ANM2::Play(&in_ECX->_sprite,s_Fly,0); in_ECX->_state = 3; in_ECX->_shootDirection = -1; return; case 1: case 2: break; case 3: ANM2::Play(&in_ECX->_sprite,s_Fly,0); RStack_38._seed = in_ECX->_initSeed; RStack_38._shift1 = 5; RStack_38._shift2 = 9; RStack_38._shift3 = 7; fVar13 = RNG::RandomFloat(&RStack_38); pvVar2 = in_ECX->_player; fVar11 = (float)(g_game->_frameCount - in_ECX->_spawnFrame); local_14 = (fVar11 + fVar11 + fVar13 * 360.0) * 0.017453292; fVar11 = cos(local_14); local_c = (fVar11 * 40.0 + *(float *)((int)pvVar2 + 0x33c)) - (in_ECX->_pos).x; fVar11 = sin(local_14); local_10 = (fVar11 * 40.0 + *(float *)((int)pvVar2 + 0x340)) - (in_ECX->_pos).y; fVar12 = sqrtf(local_c * local_c + local_10 * local_10); fVar11 = local_c; fVar13 = local_10; if (0.0 < fVar12) { fVar11 = local_c * (1.0 / fVar12); fVar13 = local_10 * (1.0 / fVar12); } (in_ECX->_velocity).x = fVar11 * 0.6 + (in_ECX->_velocity).x; (in_ECX->_velocity).y = fVar13 * 0.6 + (in_ECX->_velocity).y; in_ECX->_friction = in_ECX->_friction * 0.8; Entity_Familiar::PickEnemyTarget(in_ECX,480.0,8,5,&g_vectorZero,15.0); cVar10 = in_ECX->_target != (EntityPtr)0x0; goto LAB_00640ad8; case 4: pfVar1 = &(in_ECX->_targetPosition).y; pcVar8 = "AttackStart"; if (0.0 < *pfVar1 || *pfVar1 == 0.0) { pcVar8 = "AttackBackStart"; } ANM2::Play(&in_ECX->_sprite,(byte *)pcVar8,0); if (((in_ECX->_sprite)._animState._animData != (void *)0x0) && (bVar6 = AnimationState::IsEventTriggered(&(in_ECX->_sprite)._animState,(byte *)"Shoot"), bVar6 != 0)) { in_ECX->_state = 5; in_ECX->_fireCooldown = 0; } in_ECX->_friction = in_ECX->_friction * 0.9; return; case 5: pcVar8 = "AttackLoop"; if (((in_ECX->_sprite)._animState._animData == (void *)0x0) || ((in_ECX->_sprite)._animState._isPlaying == 0)) { (in_ECX->_sprite)._flipX = (in_ECX->_targetPosition).x <= 0.0 && (in_ECX->_targetPosition).x != 0.0; anim = "AttackLoop"; pfVar1 = &(in_ECX->_targetPosition).y; if (0.0 < *pfVar1 || *pfVar1 == 0.0) { anim = "AttackBackLoop"; } ANM2::Play(&in_ECX->_sprite,(byte *)anim,0); } bVar6 = Entity_Player::HasTrinket(in_ECX->_player,0x8d,0); if (bVar6 == 0) { fVar11 = 0.3; } else { fVar11 = 0.6; } fVar13 = (in_ECX->_targetPosition).y; (in_ECX->_velocity).x = fVar11 * (in_ECX->_targetPosition).x + (in_ECX->_velocity).x; (in_ECX->_velocity).y = fVar13 * fVar11 + (in_ECX->_velocity).y; in_ECX->_friction = in_ECX->_friction * 0.98; if (local_5 != '\0') { (in_ECX->_sprite)._flipX = (in_ECX->_targetPosition).x <= 0.0 && (in_ECX->_targetPosition).x != 0.0; pfVar1 = &(in_ECX->_targetPosition).y; if (0.0 < *pfVar1 || *pfVar1 == 0.0) { pcVar8 = "AttackBackLoop"; } ANM2::Play(&in_ECX->_sprite,(byte *)pcVar8,0); } uVar7 = in_ECX->_fireCooldown + 1; in_ECX->_fireCooldown = uVar7; if ((uVar7 & 1) == 0) { VStack_28.x = (in_ECX->_targetPosition).x * -5.0; VStack_28.y = (in_ECX->_targetPosition).y * -5.0; uVar7 = Random(); fVar11 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; VStack_28.x = VStack_28.x * fVar11; VStack_28.y = VStack_28.y * fVar11; uVar7 = Random(); local_14 = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292; local_10 = cos(local_14); fVar11 = sin(local_14); fVar13 = VStack_28.x * fVar11; VStack_28.x = VStack_28.x * local_10 - VStack_28.y * fVar11; VStack_28.y = fVar13 + VStack_28.y * local_10; shot = Entity_Familiar::FireProjectile(in_ECX,&VStack_28,1); iVar3 = *(int *)shot; (shot->_velocity).x = VStack_28.x; (shot->_velocity).y = VStack_28.y; fVar11 = (in_ECX->_targetPosition).y; fVar13 = (in_ECX->_pos).y; (shot->_pos).x = (in_ECX->_pos).x - (in_ECX->_targetPosition).x * 8.0; (shot->_pos).y = fVar13 - (fVar11 + fVar11); (**(code **)(iVar3 + 0xc))(); Entity::convert_shot_for_enemy_owner((Entity *)in_ECX,(Entity *)shot); uVar7 = in_ECX->_fireCooldown; } if ((0x3c < (int)uVar7) || ((0x14 < (int)uVar7 && ((in_ECX->_target == (EntityPtr)0x0 || ((uVar7 = Random(), (uVar7 & 3) == 0 && (-10.0 < ((in_ECX->_pos).y - *(float *)((int)in_ECX->_target + 0x340)) * (in_ECX->_targetPosition).y + ((in_ECX->_pos).x - *(float *)((int)in_ECX->_target + 0x33c)) * (in_ECX->_targetPosition).x)))))))) { in_ECX->_state = 6; return; } break; case 6: pfVar1 = &(in_ECX->_targetPosition).y; pcVar8 = "AttackEnd"; if (0.0 < *pfVar1 || *pfVar1 == 0.0) { pcVar8 = "AttackBackEnd"; } ANM2::Play(&in_ECX->_sprite,(byte *)pcVar8,0); if (((in_ECX->_sprite)._animState._animData == (void *)0x0) || ((in_ECX->_sprite)._animState._isPlaying == 0)) { Entity_Familiar::PickEnemyTarget(in_ECX,480.0,1,5,&g_vectorZero,15.0); if (in_ECX->_target == (EntityPtr)0x0) { in_ECX->_state = 3; in_ECX->_fireCooldown = 0; goto LAB_00640abd; } cVar10 = '\x01'; } else { LAB_00640abd: cVar10 = local_6; } in_ECX->_friction = in_ECX->_friction * 0.9; LAB_00640ad8: if ((cVar10 != '\0') && (EVar4 = in_ECX->_target, EVar4 != (EntityPtr)0x0)) { fVar11 = (in_ECX->_pos).y - *(float *)((int)EVar4 + 0x340); fVar13 = (in_ECX->_pos).x - *(float *)((int)EVar4 + 0x33c); fVar11 = sqrtf(fVar11 * fVar11 + fVar13 * fVar13); local_10 = -1e+06; fStack_18 = (*(float *)((int)EVar4 + 0x360) * fVar11 * 0.1 + *(float *)((int)EVar4 + 0x33c)) - (in_ECX->_pos).x; uVar9 = 0; local_14 = (*(float *)((int)EVar4 + 0x364) * fVar11 * 0.1 + *(float *)((int)EVar4 + 0x340)) - (in_ECX->_pos).y; uVar7 = 0; do { local_c = ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 90.0 + 45.0) * 0.017453292; fStack_20 = local_10; fStack_1c = sin(local_c); fStack_1c = fStack_1c * local_14; fVar13 = cos(local_c); fVar11 = VStack_28.y; fVar13 = fStack_1c + fVar13 * fStack_18; if (local_10 < fVar13) { local_10 = fVar13; } bVar5 = fVar13 <= fStack_20; fStack_20 = (float)uVar9; if (bVar5) { fStack_20 = (float)uVar7; } uVar9 = uVar9 + 1; uVar7 = (uint)fStack_20; } while (uVar9 < 4); *(float *)((int)VStack_28.y + 0xd58) = fStack_20; VStack_28.y = ((float)(int)fStack_20 * 90.0 + 45.0) * 0.017453292; fStack_20 = cos(VStack_28.y); fVar13 = sin(VStack_28.y); ((Vector *)((int)fVar11 + 0x334))->y = fVar13; *(int *)((int)fVar11 + 0xd88) = 4; ((Vector *)((int)fVar11 + 0x334))->x = fStack_20; ((ANM2 *)((int)fVar11 + 0x48))->_flipX = fStack_20 < 0.0; } break; default: goto LAB_00640c7c; } LAB_00640c7c: return; } //@@ 00640ca0 Entity_Familiar::ai_boiled_baby /* DB: ? Entity_Familiar::Update case variant 200: "Shoot" event, PickEnemyTarget, Entity_Familiar::FireProjectile toward target, Room::CheckLine, FindFreePickupSpawnPosition; reads owner +0x150c/+0x1510 list prototype: db/protos.zhl */ void __thiscall Entity_Familiar::ai_boiled_baby(Entity_Familiar *this) { int direction; EntityPtr EVar1; byte bVar2; int *piVar3; int iVar4; Vector *pVVar5; uint uVar6; byte *animNameChar; byte *wantedAnimChar; char *shootAnimChar; bool bVar7; float fVar8; float fVar9; float fVar10; float jumpProgress; float *frictionPtr; Vector local_2c; Vector local_24; Vector local_1c; Room *room; Vector local_10; float friction; void *player; room = g_game->_room; player = this->_player; if (*(char *)((int)player + 0x1519) == '\0') { for (piVar3 = *(int **)((int)player + 0x150c); piVar3 != *(int **)((int)player + 0x1510); piVar3 = piVar3 + 4) { if ((*(int *)*piVar3 == 0) && (((int *)*piVar3)[1] == 0x37)) { iVar4 = this->_state; piVar3 = &this->_state; if (iVar4 == 0) { this->_visible = 1; *piVar3 = 1; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; this->_coins = 0; this->_keys = 1; uVar6 = Random(); this->_hearts = (uVar6 & 3) + 2; iVar4 = *piVar3; } frictionPtr = &this->_friction; *frictionPtr = this->_friction * 0.7; local_24.x = (float)frictionPtr; if (iVar4 == 0) goto LAB_00640d22; if (iVar4 == 1) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) goto LAB_00641131; animNameChar = (this->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } shootAnimChar = "Shoot"; goto LAB_00641000; } if (((iVar4 != 2) || (ANM2::Play(&this->_sprite,&DAT_00b1de1c,0), (this->_sprite)._animState._animData == (void *)0x0)) || ((this->_sprite)._animState._isPlaying != 0)) goto LAB_00640d9b; animNameChar = (this->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } wantedAnimChar = &DAT_00b1de1c; goto LAB_00640f80; } } } this->_state = 0; this->_friction = this->_friction * 0.7; LAB_00640d22: frictionPtr = &this->_friction; this->_visible = 0; fVar9 = *(float *)((int)this->_player + 0x340); (this->_pos).x = *(float *)((int)this->_player + 0x33c); (this->_pos).y = fVar9; if (*(char *)((int)this->_player + 0x173) == '\0') { iVar4 = this->_fireCooldown; if (0 < iVar4) { iVar4 = iVar4 + -1; this->_fireCooldown = iVar4; } direction = *(int *)((int)this->_player + 0x162c); if ((direction != -1) && (iVar4 < 1)) { bVar2 = 0; pVVar5 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,direction); FireProjectile(this,pVVar5,bVar2); this->_fireCooldown = 0x2d; } } goto LAB_00640d9b; while( true ) { bVar2 = animNameChar[1]; bVar7 = bVar2 < (byte)shootAnimChar[1]; if (bVar2 != shootAnimChar[1]) goto LAB_00641020; animNameChar = animNameChar + 2; shootAnimChar = shootAnimChar + 2; if (bVar2 == 0) break; LAB_00641000: bVar2 = *animNameChar; bVar7 = bVar2 < (byte)*shootAnimChar; if (bVar2 != *shootAnimChar) { LAB_00641020: uVar6 = -(uint)bVar7 | 1; goto LAB_00641025; } if (bVar2 == 0) break; } uVar6 = 0; LAB_00641025: if (((uVar6 == 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { bVar2 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Shoot"); frictionPtr = (float *)local_24.x; if (bVar2 != 0) { EVar1 = this->_target; if (EVar1 != (EntityPtr)0x0) { fVar9 = *(float *)((int)EVar1 + 0x33c); local_10.x = *(float *)((int)EVar1 + 0x340); fVar10 = (this->_pos).x - fVar9; fVar8 = (this->_pos).y - local_10.x; fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); local_1c.x = (*(float *)((int)this->_target + 0x360) * fVar8 * 0.075 + fVar9) - (this->_pos).x; local_1c.y = (*(float *)((int)this->_target + 0x364) * fVar8 * 0.075 + local_10.x) - (this->_pos).y; Vector::Normalized(&local_1c,&local_10); FireProjectile(this,&local_10,1); frictionPtr = (float *)local_24.x; } } } else { LAB_00641131: ANM2::Play(&this->_sprite,s_Idle,0); } if ((this->_keys < 1) && (this->_target == (EntityPtr)0x0)) { PickEnemyTarget(this,1000.0,1,9,&g_vectorZero,15.0); } if ((((this->_target == (EntityPtr)0x0) || ((bVar2 = Entity::IsVulnerableEnemy((Entity *)this->_target,(Entity *)0x0), bVar2 == 0 && (*(int *)((int)this->_target + 0x28) != 1)))) || (this->_hearts < 1)) || (fVar9 = (this->_pos).y - *(float *)((int)this->_target + 0x340), fVar8 = (this->_pos).x - *(float *)((int)this->_target + 0x33c), fVar9 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8), 180.0 <= fVar9)) { LAB_0064122e: bVar7 = false; } else { local_10.x = *(float *)((int)this->_target + 0x33c); local_10.y = *(float *)((int)this->_target + 0x340); bVar2 = Room::CheckLine(room,&this->_pos,&local_10,3,999,0,0,(Vector *)0x0); if (bVar2 == 0) goto LAB_0064122e; bVar7 = true; } iVar4 = this->_keys; if ((iVar4 < 1) && (bVar7)) { ANM2::Play(&this->_sprite,(byte *)"Shoot",0); this->_hearts = this->_hearts + -1; this->_keys = 0xf; this->_coins = 0x14; } else if (this->_coins < 1) { PickEnemyTarget(this,1000.0,1,9,&g_vectorZero,15.0); EVar1 = this->_target; if (EVar1 == (EntityPtr)0x0) { fVar9 = 80.0; local_24.x = *(float *)((int)this->_player + 0x33c); local_2c.x = *(float *)((int)this->_player + 0x340); } else { fVar9 = (this->_pos).y - *(float *)((int)EVar1 + 0x340); fVar8 = (this->_pos).x - *(float *)((int)EVar1 + 0x33c); fVar9 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8); local_10.x = *(float *)((int)EVar1 + 0x360) * fVar9 * 0.08 + *(float *)((int)EVar1 + 0x33c); local_1c.x = *(float *)((int)EVar1 + 0x364) * fVar9 * 0.08 + *(float *)((int)EVar1 + 0x340); local_24.x = local_10.x - (this->_pos).x; local_24.y = local_1c.x - (this->_pos).y; pVVar5 = Vector::Normalized(&local_24,&local_2c); fVar9 = 10.0; local_24.x = pVVar5->x * 60.0 + local_10.x; local_2c.x = pVVar5->y * 60.0 + local_1c.x; } fVar10 = (this->_pos).x - local_24.x; fVar8 = (this->_pos).y - local_2c.x; local_1c.x = fVar9; local_10.x = local_24.x; local_10.y = local_2c.x; fVar9 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); if (180.0 < fVar9) { local_24.x = local_24.x - (this->_pos).x; local_24.y = local_2c.x - (this->_pos).y; pVVar5 = Vector::Normalized(&local_24,&local_2c); local_10.x = pVVar5->x * 180.0 + (this->_pos).x; local_10.y = pVVar5->y * 180.0 + (this->_pos).y; } pVVar5 = Room::FindFreePickupSpawnPosition(room,&local_1c,&local_10,local_1c.x,1,0,0); (this->_targetPosition).x = pVVar5->x; (this->_targetPosition).y = pVVar5->y; this->_orbitSpeed = 0.0; *piVar3 = 2; } else { if (0 < iVar4) { this->_keys = iVar4 + -1; } this->_coins = this->_coins + -1; } goto LAB_00640d9b; while( true ) { bVar2 = animNameChar[1]; bVar7 = bVar2 < wantedAnimChar[1]; if (bVar2 != wantedAnimChar[1]) goto LAB_00640fa0; animNameChar = animNameChar + 2; wantedAnimChar = wantedAnimChar + 2; if (bVar2 == 0) break; LAB_00640f80: bVar2 = *animNameChar; bVar7 = bVar2 < *wantedAnimChar; if (bVar2 != *wantedAnimChar) { LAB_00640fa0: uVar6 = -(uint)bVar7 | 1; goto LAB_00640fa5; } if (bVar2 == 0) break; } uVar6 = 0; LAB_00640fa5: if (uVar6 == 0) { *piVar3 = 1; this->_coins = 5; uVar6 = Random(); this->_hearts = (uVar6 & 3) + 2; } LAB_00640d9b: iVar4 = this->_state; if (((iVar4 != 0) && (((this->_targetPosition).x != g_vectorZero.x || ((this->_targetPosition).y != g_vectorZero.y) ))) && ((iVar4 == 1 || (((iVar4 == 2 && ((this->_sprite)._animState._animData != (void *)0x0)) && (bVar2 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,s_Jump), bVar2 != 0)))))) { jumpProgress = this->_orbitSpeed + 0.02; this->_orbitSpeed = jumpProgress; fVar9 = (this->_pos).x; fVar8 = (this->_pos).y; fVar10 = (this->_targetPosition).y; friction = *frictionPtr; (this->_velocity).x = ((((this->_targetPosition).x - fVar9) * jumpProgress + fVar9) - fVar9) / *frictionPtr; (this->_velocity).y = (((fVar10 - fVar8) * jumpProgress + fVar8) - fVar8) / friction; if (1.0 <= this->_orbitSpeed) { (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; } } return; } //@@ 006414c0 Entity_Familiar::zhl_misfit_006414c0 /* DB: ? only caller Entity_Familiar::Update; +0x184=5, Random()%3; ZHL called it RoomTransition::ChangeRoom */ void __thiscall Entity_Familiar::zhl_misfit_006414c0(Entity_Familiar *this) { ANM2 *pAVar1; byte bVar2; float *damageEvent; Entity_Player *player; uint uVar3; byte *pbVar4; int oldHallowedCountdown; uint moveRoll; Vector *randomDir; Entity_Effect *splat; Entity *spawnedEffect; byte *pbVar6; byte *expectedNameCh; bool bVar7; float fVar8; float fVar9; EntityPtr *pEVar10; EntityPtr *local_4c; Vector local_48; float local_40; EntityPtr *local_3c; Vector local_38; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; float fStack_20; float fStack_1c; float fStack_18; float fStack_14; undefined4 uStack_10; undefined4 uStack_c; float *damageEventsEnd; float dipX; float dipY; Game *game; Manager *manager; int oldHallowedCountdown; EntityPtr playerIdx; byte rainbowBlue; local_40 = 1.0; this->_entityGridCollisionClass = 5; this->_entityCollisionClass = 4; if (0.0 < this->_pendingDamage) { this->_pendingDamage = 0.0; damageEventsEnd = (this->_damageEvents)._end; for (damageEvent = (this->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { fVar8 = *damageEvent; if (((uint)damageEvent[2] & 4) != 0) { if (3.5 < fVar8) { fVar8 = 3.5; } *damageEvent = fVar8; } this->_pendingDamage = fVar8 + this->_pendingDamage; } } game = g_game; switch(this->_subtype) { case 1: uVar3 = Random(); if (uVar3 % 3 == 0) { PickEnemyTarget(this,240.0,4,0,&g_vectorZero,15.0); } break; case 3: local_40 = 0.8; break; case 4: if ((((this->_flags & 0x4000) == 0) && (bVar2 = Game::IsPaused(g_game), bVar2 == 0)) && ((~(byte)game->_frameCount & 1) != 0)) { uVar3 = Random(); uVar3 = uVar3 % 6; bVar2 = (&DAT_00b64475)[uVar3 * 3]; rainbowBlue = (&DAT_00b64476)[uVar3 * 3]; (this->_splatColor)._offset[0] = (float)(byte)(&DAT_00b64474)[uVar3 * 3] * 0.003921569; (this->_splatColor)._offset[1] = (float)bVar2 * 0.003921569; (this->_splatColor)._offset[2] = (float)rainbowBlue * 0.003921569; } break; case 6: if ((((this->_flags & 0x4000) == 0) && (bVar2 = Game::IsPaused(g_game), bVar2 == 0)) && (game->_frameCount % 3 == 0)) { local_48.x = 0.0; playerIdx = (EntityPtr)0x0; if ((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2 != 0) { do { local_48.x = (float)playerIdx; player = Game::GetPlayer(g_game,(uint)local_48.x); if (((*(int *)&g_game->_deathmatchManager < 2) || (bVar2 = Entity::IsDescendantOf((Entity *)this,(Entity *)player), bVar2 != 0)) && (fVar8 = (this->_pos).y - (player->_pos).y, fVar9 = (this->_pos).x - (player->_pos).x, fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9), fVar8 < player->_size + 23.33)) { oldHallowedCountdown = player->_hallowedGroundCountdown; oldHallowedCountdown = oldHallowedCountdown + 4; if (4 < oldHallowedCountdown) { oldHallowedCountdown = 4; } player->_hallowedGroundCountdown = oldHallowedCountdown; if (0 < oldHallowedCountdown != 0 < oldHallowedCountdown) { player->_cacheFlags = player->_cacheFlags | 99; Entity_Player::EvaluateItems(); } } local_48.x = (float)((int)local_48.x + 1); playerIdx = (EntityPtr)local_48.x; } while ((uint)local_48.x < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } pEVar10 = &this->_child; if (this->_child == (EntityPtr)0x0) { uVar3 = Random(); local_48.x = (float)Game::SpawnEx(g_game,1000,0x70,&this->_pos,&g_vectorZero,(Entity *)0x0,0, uVar3,0); local_3c = (EntityPtr *)((int)local_48.x + 0x3bc); if (*(EntityPtr *)((int)local_48.x + 0x3bc) != (EntityPtr)0x0) { local_4c = local_3c; std::multiset::erase(&local_4c); } *local_3c = (EntityPtr)this; std::multiset::insert(local_3c); fVar8 = ((Vector *)((int)local_48.x + 0x33c))->x; fVar9 = *(float *)((int)local_48.x + 0x340); dipX = (this->_pos).x; dipY = (this->_pos).y; oldHallowedCountdown = *(int *)local_48.x; *(undefined1 *)((int)local_48.x + 0x464) = 1; ((Vector *)((int)local_48.x + 0xdc))->x = 0.0; *(float *)((int)local_48.x + 0x468) = fVar8 - dipX; *(float *)((std_string *)((int)local_48.x + 0x46c))->_buf = fVar9 - dipY; *(float *)((int)local_48.x + 0xe0) = -8.0; fVar8 = g_vectorOne.y; fVar9 = g_vectorOne.x * 0.33; *(int *)((int)local_48.x + 0x354) = 10000; ((Vector *)((int)local_48.x + 0xe4))->x = fVar9; *(float *)((int)local_48.x + 0xe8) = fVar8 * 0.33; (**(code **)(oldHallowedCountdown + 0xc))(); if (*pEVar10 != (EntityPtr)0x0) { local_3c = pEVar10; std::multiset::erase(&local_3c); } *pEVar10 = (EntityPtr)local_48.x; std::multiset::insert(pEVar10); } } if ((this->_subtype != 1) && (uVar3 = Random(), uVar3 % 10 == 0)) { PickEnemyTarget(this,40.0,4,0,&g_vectorZero,15.0); } if (this->_target == (EntityPtr)0x0) { this->_headFrameDelay = 0; } oldHallowedCountdown = this->_state; if (oldHallowedCountdown == 0) { pbVar4 = (this->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_00641d0e: bVar2 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar6 = *(byte **)pbVar4; } expectedNameCh = s_Idle; do { bVar2 = *pbVar6; bVar7 = bVar2 < *expectedNameCh; if (bVar2 != *expectedNameCh) { LAB_00641cf0: uVar3 = -(uint)bVar7 | 1; goto LAB_00641cf5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar7 = bVar2 < expectedNameCh[1]; if (bVar2 != expectedNameCh[1]) goto LAB_00641cf0; pbVar6 = pbVar6 + 2; expectedNameCh = expectedNameCh + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00641cf5: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00641d0e; } uVar3 = 10; if (this->_subtype == 0xc) { uVar3 = 0x14; } else if (this->_subtype == 0xd) { uVar3 = 3; } moveRoll = Random(); if ((moveRoll % uVar3 == 0) && (this->_visible != 0)) { pEVar10 = &this->_target; if ((this->_subtype != 1) && (((*pEVar10 != (EntityPtr)0x0 && (this->_headFrameDelay == 0)) && (uVar3 = Random(), (uVar3 & 3) == 0)))) { if (*pEVar10 != (EntityPtr)0x0) { local_3c = pEVar10; std::multiset::erase(&local_3c); } *pEVar10 = (EntityPtr)0x0; } local_48.x = *(float *)pEVar10; if ((EntityPtr)local_48.x == (EntityPtr)0x0) { local_48.x = (float)this->_player; } fVar8 = local_48.x; local_38.y = *(float *)((int)local_48.x + 0x340); local_38.x = *(float *)((int)local_48.x + 0x33c); bVar2 = Room::CheckLine(g_game->_room,&this->_pos,&local_38,1,999,0,0,(Vector *)0x0); if (bVar2 == 0) { local_38.x = this->_friction; local_3c = (EntityPtr *)(this->_velocity).x; local_4c = (EntityPtr *)(this->_velocity).y; PathFinder::Reset((PathFinder *)&this->_pathfinder); local_48.y = *(float *)((int)local_48.x + 0x340); local_48.x = *(float *)((int)local_48.x + 0x33c); PathFinder::FindGridPath((PathFinder *)&this->_pathfinder,&local_48,1.0,0,1); fVar8 = (this->_velocity).x; fVar9 = (this->_pos).y + (this->_velocity).y; (this->_velocity).x = (float)local_3c; (this->_velocity).y = (float)local_4c; this->_friction = local_38.x; pEVar10 = (EntityPtr *)(fVar8 + (this->_pos).x); } else { pEVar10 = *(EntityPtr **)((int)fVar8 + 0x33c); fVar9 = *(float *)((int)fVar8 + 0x340); local_4c = pEVar10; local_48.x = fVar9; if ((void *)fVar8 == this->_player) { randomDir = MusicManager::RandomVector(&local_38); uVar3 = Random(); fVar8 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 80.0; fVar9 = local_48.x + fVar8 * randomDir->y; pEVar10 = (EntityPtr *)((float)local_4c + fVar8 * randomDir->x); } else if (this->_subtype == 1) { local_40 = 2.0; } } fVar8 = (this->_pos).x; if ((fVar8 == (float)pEVar10) && ((this->_pos).y == fVar9)) { uVar3 = Random(); local_38.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38.x = local_38.x + local_38.x; local_48.x = sin(local_38.x); local_4c = (EntityPtr *)cos(local_38.x); } else { local_48.x = fVar9 - (this->_pos).y; local_4c = (EntityPtr *)((float)pEVar10 - fVar8); fVar8 = sqrtf((float)local_4c * (float)local_4c + local_48.x * local_48.x); if (0.0 < fVar8) { local_4c = (EntityPtr *)((float)local_4c * (1.0 / fVar8)); local_48.x = local_48.x * (1.0 / fVar8); } } uVar3 = Random(); fVar8 = this->_friction; fVar9 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 5.0; (this->_velocity).y = (fVar9 * local_48.x * local_40) / fVar8 + (this->_velocity).y; (this->_velocity).x = (fVar9 * (float)local_4c * local_40) / fVar8 + (this->_velocity).x; this->_state = 1; } fVar8 = this->_friction * 0.8; LAB_006420cf: this->_friction = fVar8; } else { if (oldHallowedCountdown == 1) { pbVar4 = (this->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_00641c4e: bVar2 = ANM2::SetAnimation(&this->_sprite,&DAT_00b1d6fc,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { pbVar6 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar6 = *(byte **)pbVar4; } expectedNameCh = &DAT_00b1d6fc; do { bVar2 = *pbVar6; bVar7 = bVar2 < *expectedNameCh; if (bVar2 != *expectedNameCh) { LAB_00641c30: uVar3 = -(uint)bVar7 | 1; goto LAB_00641c35; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar7 = bVar2 < expectedNameCh[1]; if (bVar2 != expectedNameCh[1]) goto LAB_00641c30; pbVar6 = pbVar6 + 2; expectedNameCh = expectedNameCh + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00641c35: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00641c4e; } fVar8 = (this->_velocity).y; fVar9 = (this->_velocity).x; if (fVar9 * fVar9 + fVar8 * fVar8 < 1.0) { this->_state = 0; } fVar8 = this->_friction * 0.95; goto LAB_006420cf; } if (oldHallowedCountdown == 2) { pbVar4 = (this->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_00641976: bVar2 = ANM2::SetAnimation(&this->_sprite,&DAT_00b1d6fc,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pbVar6 = &DAT_00b1d6fc; do { bVar2 = *pbVar4; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_00641956: uVar3 = -(uint)bVar7 | 1; goto LAB_0064195b; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_00641956; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0064195b: if ((uVar3 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00641976; } if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) { fVar8 = this->_orbitSpeed + 0.7; this->_orbitSpeed = fVar8; fVar9 = fVar8 + (this->_posOffset).y; (this->_posOffset).y = fVar9; if (-26.0 <= fVar9) { this->_entityGridCollisionClass = (fVar9 < -3.0) + 5; } else { this->_entityGridCollisionClass = 3; } } else { this->_entityGridCollisionClass = 3; this->_entityCollisionClass = 0; (this->_velocity).x = (this->_orbitDistance).x; (this->_velocity).y = (this->_orbitDistance).y; fVar8 = this->_orbitSpeed + 0.7; this->_orbitSpeed = fVar8; fVar9 = fVar8 + (this->_posOffset).y; (this->_posOffset).y = fVar9; } if (-fVar8 < fVar9) { if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) { local_38.x = (this->_pos).x; local_38.y = (this->_pos).y; oldHallowedCountdown = Room::GetGridCollisionAtPos(g_game->_room,this->_pos); if (oldHallowedCountdown == 1) { uVar3 = Random(); Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar3,0); (**(code **)(*(int *)this + 0x28))(); return; } if ((this->_target != (EntityPtr)0x0) || (PickEnemyTarget(this,80.0,1,0,&g_vectorZero,15.0), this->_target != (EntityPtr)0x0)) { this->_headFrameDelay = 1; } } manager = g_manager; (this->_posOffset).y = 0.0; this->_orbitSpeed = 0.0; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; this->_state = 0; if (this->_subtype == 0xc) { local_40 = 6.82432e-43; } else { local_40 = 3.61535e-43; } seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,2,0,1.0,0.0); } } } uVar3 = Random(); if ((uVar3 % 0x14 == 0) && (this->_subtype != 0xc)) { uVar3 = Random(); splat = Entity_NPC::MakeSplat ((Entity_NPC *)this, (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2); (**(code **)(*(int *)splat + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); } game = g_game; if (this->_dead == 0) { oldHallowedCountdown = this->_subtype; if (oldHallowedCountdown == 1) { if (g_game->_frameCount - this->_spawnFrame < 0x1c2) { fVar9 = this->_health + 0.03; fVar8 = this->_maxHitPoints; if (fVar9 <= fVar8) { fVar8 = fVar9; } this->_health = fVar8; } else { uStack_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; fStack_20 = g_vectorZero.x; fStack_1c = g_vectorZero.y; fStack_18 = g_vectorZero.x; fStack_14 = g_vectorZero.y; uStack_10 = 0; uStack_c = 0; (**(code **)(*(int *)this + 0x24))(&uStack_30); } } else { if (oldHallowedCountdown == 5) { if (((this->_flags & 0x4000) != 0) || (bVar2 = Game::IsPaused(g_game), bVar2 != 0)) goto LAB_0064243e; uVar3 = game->_frameCount + this->_index & 0x80000003; bVar7 = uVar3 == 0; if ((int)uVar3 < 0) { bVar7 = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if ((!bVar7) || (uVar3 = Random(), (uVar3 & 1) != 0)) goto LAB_0064243e; uVar3 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x2d,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar3,0); uVar3 = Random(); fVar8 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.4; fVar9 = fVar8 * g_vectorOne.y; fVar8 = fVar8 * g_vectorOne.x; pAVar1 = &spawnedEffect[1]._sprite; (pAVar1->_filename)._buf[8] = 'Z'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (spawnedEffect->_sprite)._scale.y = fVar9; pAVar1 = &spawnedEffect[1]._sprite; (pAVar1->_filename)._buf[0xc] = 'Z'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (spawnedEffect->_sprite)._scale.x = fVar8; } else { if (((oldHallowedCountdown != 0xe) || ((this->_flags & 0x4000) != 0)) || (bVar2 = Game::IsPaused(g_game), bVar2 != 0)) goto LAB_0064243e; uVar3 = game->_frameCount + this->_index & 0x80000007; bVar7 = uVar3 == 0; if ((int)uVar3 < 0) { bVar7 = (uVar3 - 1 | 0xfffffff8) == 0xffffffff; } if ((!bVar7) || (uVar3 = Random(), uVar3 % 3 != 0)) goto LAB_0064243e; uVar3 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x8d,&this->_pos,&g_vectorZero,this->_player,0,uVar3,0); uVar3 = Random(); fVar8 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.5; fVar9 = fVar8 * g_vectorOne.y; fVar8 = fVar8 * g_vectorOne.x; pAVar1 = &spawnedEffect[1]._sprite; (pAVar1->_filename)._buf[8] = '<'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; (spawnedEffect->_sprite)._scale.y = fVar9; pAVar1 = &spawnedEffect[1]._sprite; (pAVar1->_filename)._buf[0xc] = '<'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; (spawnedEffect->_sprite)._scale.x = fVar8; (**(code **)(*(int *)spawnedEffect + 0x40))(*(float *)((int)this->_player + 0x157c) * 0.5); } (**(code **)(*(int *)spawnedEffect + 0xc))(); } } LAB_0064243e: if ((0.0 < this->_pendingDamage) && (bVar2 = Entity_Player::HasCollectible(this->_player,0xf7,0), bVar2 != 0)) { this->_pendingDamage = 0.0; damageEventsEnd = (this->_damageEvents)._end; for (damageEvent = (this->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { fVar8 = *damageEvent; *damageEvent = fVar8 * 0.5; this->_pendingDamage = fVar8 * 0.5 + this->_pendingDamage; } } (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; return; } //@@ 006424d0 Entity_Familiar::ai_bird_cage /* DB: Entity_Familiar::Update case 0xd2 (210 Bird Cage): Flying/JumpDown anims, Game::BombDamage + ShakeScreen on landing, PickEnemyTarget, flies via 0061b8c0 Entity_Familiar::ai_flying_bird void __thiscall Entity_Familiar::ai_bird_cage(Entity_Familiar *this) { byte bVar1; byte *curAnimName; uint uVar2; Vector *pVVar3; Entity *tmpEntity; char *expectedAnimName; Entity **targetRef; int iVar4; bool isLess; float fVar5; float fVar6; float targetDy; Entity *local_3c; Vector local_38; Vector local_30; float enemyDistance; int deathmatchMode; Entity *local_20; undefined4 *local_1c; float local_18; float awayDirY; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; byte *animData; Manager *manager; EntityPtr *parentRef; EntityPtr target; uStack_8 = 0xffffffff; puStack_c = &LAB_00af7060; local_10 = ExceptionList; ExceptionList = &local_10; switch(this->_state) { case 0: PickEnemyTarget(this,10000.0,0,5,&g_vectorZero,15.0); target = this->_target; if (target != (EntityPtr)0x0) { fVar6 = *(float *)((int)target + 0x340); (this->_targetPosition).x = *(float *)((int)target + 0x33c); (this->_targetPosition).y = fVar6; bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b1e0e4,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_state = 1; ExceptionList = local_10; return; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "Flying"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_006425d0: uVar2 = -(uint)isLess | 1; goto LAB_006425d5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_006425d0; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006425d5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00642608; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Flying",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00642608: this->_state = 3; ExceptionList = local_10; return; case 1: if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00642686: bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"JumpDown",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = "JumpDown"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00642670: uVar2 = -(uint)isLess | 1; goto LAB_00642675; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00642670; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00642675: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00642686; } this->_state = 2; } target = this->_target; local_20 = (Entity *)&this->_target; if (target == (EntityPtr)0x0) goto LAB_00642705; if (*(char *)((int)target + 0x173) == '\0') { fVar6 = *(float *)((int)target + 0x340); (this->_targetPosition).x = *(float *)((int)target + 0x33c); (this->_targetPosition).y = fVar6; goto LAB_00642705; } targetRef = &local_20; break; case 2: pVVar3 = &this->_pos; pVVar3->x = (this->_targetPosition).x; (this->_pos).y = (this->_targetPosition).y; if ((this->_sprite)._animState._animData == (void *)0x0) { LAB_00642bca: if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&this->_sprite,(byte *)"Flying",0); this->_state = 3; } } else { bVar1 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b1d3b0); manager = g_manager; if (bVar1 == 0) goto LAB_00642bca; local_18 = 7.28675e-44; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,(int)local_18,1.0,2,0,1.0,0.0); Game::BombDamage(g_game,pVVar3,45.0,24.0,1,this->_player,(BitSet128)ZEXT816(0),4,0); uVar2 = Random(); local_3c = Game::SpawnEx(g_game,1000,0x48,pVVar3,&g_vectorZero,this->_player,0,uVar2,0); parentRef = &local_3c->_parent; if (local_3c->_parent != (EntityPtr)0x0) { local_20 = (Entity *)parentRef; std::multiset::erase(&local_20); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); awayDirY = 0.0; local_18 = 0.0; local_20 = *(Entity **)((int)g_game->_room + 0x1264); if (local_20 != (Entity *)0x0) { deathmatchMode = *(int *)&g_game->_deathmatchManager; local_1c = *(undefined4 **)((int)g_game->_room + 0x125c); do { tmpEntity = (Entity *)*local_1c; local_38.y = (tmpEntity->_pos).y - (this->_pos).y; local_30.y = (tmpEntity->_pos).x - (this->_pos).x; enemyDistance = sqrtf(local_30.y * local_30.y + local_38.y * local_38.y); if ((deathmatchMode < 2) || (tmpEntity->_type != 1)) { iVar4 = tmpEntity->_type; if (iVar4 - 10U < 0x3de) goto LAB_006428f9; } else { iVar4 = 1; LAB_006428f9: if ((((((tmpEntity->_entityCollisionClass != 1) && (tmpEntity->_entityCollisionClass != 0)) && (tmpEntity->_isInvicible == 0)) && (tmpEntity->_dead == 0)) && (((bVar1 = Entity::HasEntityFlags(tmpEntity,0x10), bVar1 == 0 || (iVar4 == 0x322)) || (iVar4 == 0x362)))) && ((enemyDistance <= 256.0 && (0.0 < enemyDistance)))) { local_18 = local_30.y / enemyDistance + local_18; awayDirY = local_38.y / enemyDistance + awayDirY; } } local_1c = local_1c + 1; local_20 = (Entity *)((int)&local_20[-1]._luaBridgeRef + 3); } while (local_20 != (Entity *)0x0); local_20 = (Entity *)0x0; } fVar5 = awayDirY; fVar6 = local_18; if (awayDirY * awayDirY + local_18 * local_18 < 0.001) { pVVar3 = MusicManager::RandomVector(&local_38); fVar6 = pVVar3->x; fVar5 = pVVar3->y; } local_18 = atan2f(fVar5,fVar6); local_18 = local_18 * 57.295776; iVar4 = *(int *)local_3c; *(float *)(local_3c[1]._sprite._animDefaultName._buf + 8) = local_18; (**(code **)(iVar4 + 0xc))(); bVar1 = Entity_Player::HasCollectible(this->_player,0xf7,0); if (bVar1 != 0) { local_20 = (Entity *)0x3; do { local_18 = local_18 + 90.0; uVar2 = Random(); tmpEntity = Game::SpawnEx(g_game,1000,0x48,&this->_pos,&g_vectorZero,this->_player,0,uVar2 ,0); parentRef = &tmpEntity->_parent; if (tmpEntity->_parent != (EntityPtr)0x0) { local_3c = (Entity *)parentRef; std::multiset::erase(&local_3c); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); iVar4 = *(int *)tmpEntity; *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = local_18; (**(code **)(iVar4 + 0xc))(); local_20 = (Entity *)((int)&local_20[-1]._luaBridgeRef + 3); } while (local_20 != (Entity *)0x0); } iVar4 = 4; do { uVar2 = Random(); local_3c = (Entity *) ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292); local_20 = (Entity *)cos((float)local_3c); local_1c = (undefined4 *)sin((float)local_3c); uVar2 = Random(); fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10; local_30.y = fVar6 * (float)local_1c * 12.0 + (this->_pos).y; local_30.x = fVar6 * (float)local_20 * 12.0 + (this->_pos).x; uVar2 = Random(); local_38.x = (float)local_20 * 5.0; local_38.y = (float)local_1c * 5.0; tmpEntity = Game::SpawnEx(g_game,1000,4,&local_30,&local_38,(Entity *)0x0,0,uVar2,0); (**(code **)(*(int *)tmpEntity + 0xc))(); iVar4 = iVar4 + -1; } while (iVar4 != 0); Game::ShakeScreen(g_game,0xc); } target = this->_target; local_3c = (Entity *)&this->_target; if (target == (EntityPtr)0x0) goto LAB_00642705; if (*(char *)((int)target + 0x173) == '\0') { fVar6 = *(float *)((int)target + 0x340); fVar5 = *(float *)((int)target + 0x33c) - (this->_targetPosition).x; targetDy = fVar6 - (this->_targetPosition).y; if (targetDy * targetDy + fVar5 * fVar5 < 10000.0) { (this->_targetPosition).x = *(float *)((int)target + 0x33c); (this->_targetPosition).y = fVar6; } goto LAB_00642705; } targetRef = &local_3c; break; case 3: ai_flying_bird(this,__security_cookie ^ (int)register0x00000010 - 4U); default: ExceptionList = local_10; return; } std::multiset::erase(targetRef); this->_target = (EntityPtr)0x0; LAB_00642705: (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; ExceptionList = local_10; return; } //@@ 00642cb0 FamiliarAI::tinytoma /* DB: Entity_Familiar::Update case 0xd8/0xd9 (Tinytoma, items sweep 12) */ void __fastcall FamiliarAI::tinytoma(Entity_Familiar *familiar) { int iVar1; int *mapHead; LayerState *layer; float *damageEvent; float fVar2; void *pvVar3; undefined1 lowerBoundResult [8]; int *foundNode; undefined4 smallKey; int smallParent; undefined4 local_4c; uint bigKey; int bigTinytoma; undefined4 local_40; undefined1 insertResult [8]; int insertResult2 [2]; Vector local_2c; int *childCountMap; float local_20; Vector local_1c; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; float *damageEventsEnd; float friction; char isNil; int *mapNode; int *nextNode; EntityPtr parentEntity; int *parentNode; local_8 = 0xffffffff; puStack_c = &LAB_00af708d; local_10 = ExceptionList; ExceptionList = &local_10; local_2c.x = *(float *)((int)familiar->_player + 0x33c); local_2c.y = *(float *)((int)familiar->_player + 0x340); Entity_Familiar::GetOrbitPosition(familiar,&local_1c,&local_2c); pvVar3 = familiar->_player; local_20 = (*(float *)((int)pvVar3 + 0x360) + *(float *)((int)pvVar3 + 0x360)) / *(float *)((int)pvVar3 + 0x36c); local_2c.y = (*(float *)((int)pvVar3 + 0x364) + *(float *)((int)pvVar3 + 0x364)) / *(float *)((int)pvVar3 + 0x36c); local_14 = (void *)((local_1c.x - (local_20 + (familiar->_pos).x)) * 0.5); local_1c.y = (local_1c.y - (local_2c.y + (familiar->_pos).y)) * 0.5; fVar2 = sqrtf((float)local_14 * (float)local_14 + local_1c.y * local_1c.y); if ((fVar2 <= 5.0) || ((familiar->_flags & 0x20000000000) != 0)) { pvVar3 = local_14; fVar2 = local_1c.y; } else { if (fVar2 <= 0.0) { pvVar3 = local_14; fVar2 = local_1c.y; } else { pvVar3 = (void *)((float)local_14 * (1.0 / fVar2)); fVar2 = local_1c.y * (1.0 / fVar2); } pvVar3 = (void *)((float)pvVar3 * 4.0); fVar2 = fVar2 * 4.0; } iVar1 = familiar->_variant; friction = familiar->_friction; (familiar->_velocity).x = ((float)pvVar3 + local_20) / friction; (familiar->_velocity).y = (fVar2 + local_2c.y) / friction; if (((iVar1 == 0xd9) && (familiar->_parent == (EntityPtr)0x0)) && (g_game->_frameCount - familiar->_spawnFrame < 2)) { local_14 = g_game->_room; childCountMap = (int *)0x0; local_20 = 0.0; mapHead = operator_new(0x1c); *mapHead = (int)mapHead; mapHead[1] = (int)mapHead; mapHead[2] = (int)mapHead; *(undefined2 *)(mapHead + 3) = 0x101; local_8 = 0; local_1c.y = 0.0; childCountMap = mapHead; if (*(int *)((int)local_14 + 0x1254) != 0) { do { iVar1 = *(int *)(*(int *)((int)local_14 + 0x124c) + (int)local_1c.y * 4); if (((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 3)) && (*(void **)(iVar1 + 0x410) == familiar->_player)) { if (*(int *)(iVar1 + 0x2c) == 0xd8) { if (0 < *(int *)(iVar1 + 0xd88)) { local_2c.y = *(float *)(iVar1 + 0x20); _Find_lower_bound<>(lowerBoundResult,&local_2c.y); if (((*(char *)((int)foundNode + 0xd) != '\0') || (*(uint *)(iVar1 + 0x20) < (uint)foundNode[4])) || (foundNode == mapHead)) { local_40 = 0; bigKey = *(uint *)(iVar1 + 0x20); bigTinytoma = iVar1; FUN_00652750(insertResult,&bigKey); goto LAB_00642f82; } } } else if ((((*(int *)(iVar1 + 0x2c) == 0xd9) && (iVar1 = *(int *)(iVar1 + 0x3bc), iVar1 != 0)) && (*(int *)(iVar1 + 0x28) == 3)) && ((*(int *)(iVar1 + 0x2c) == 0xd8 && (0 < *(int *)(iVar1 + 0xd88))))) { smallKey = *(undefined4 *)(iVar1 + 0x20); local_4c = 0; smallParent = iVar1; FUN_00652750(insertResult2,&smallKey); *(int *)(insertResult2[0] + 0x18) = *(int *)(insertResult2[0] + 0x18) + 1; LAB_00642f82: mapHead = childCountMap; } } local_1c.y = (float)((int)local_1c.y + 1); } while ((uint)local_1c.y < (uint)*(float *)((int)local_14 + 0x1254)); } mapNode = (int *)*mapHead; while (mapNode != mapHead) { if ((uint)mapNode[6] < 2) { parentEntity = *(EntityPtr *)(mapNode + 5); if (familiar->_parent != (EntityPtr)0x0) { local_2c.y = (float)&familiar->_parent; std::multiset::erase(&local_2c.y); mapHead = childCountMap; } familiar->_parent = parentEntity; if (parentEntity != (EntityPtr)0x0) { std::multiset::insert(&familiar->_parent); mapHead = childCountMap; } break; } nextNode = (int *)mapNode[2]; if (*(char *)((int)nextNode + 0xd) == '\0') { isNil = *(char *)(*nextNode + 0xd); mapNode = nextNode; nextNode = (int *)*nextNode; while (isNil == '\0') { isNil = *(char *)(*nextNode + 0xd); mapNode = nextNode; nextNode = (int *)*nextNode; } } else { isNil = *(char *)(mapNode[1] + 0xd); parentNode = (int *)mapNode[1]; nextNode = mapNode; while ((mapNode = parentNode, isNil == '\0' && (nextNode == (int *)mapNode[2]))) { isNil = *(char *)(mapNode[1] + 0xd); parentNode = (int *)mapNode[1]; nextNode = mapNode; } } } local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&childCountMap, (fuzzer_allocator_> *)&childCountMap, (_Tree_node *)mapHead[1]); operator_delete(childCountMap,0x1c); } parentEntity = familiar->_parent; if ((parentEntity != (EntityPtr)0x0) && (*(int *)((int)parentEntity + 0x28) == 3)) { *(undefined4 *)((int)parentEntity + 0xd4c) = 0; } if (familiar->_fireCooldown < 0x1e) { familiar->_fireCooldown = familiar->_fireCooldown + 1; } layer = ANM2::GetLayer(&familiar->_sprite,(byte *)0x0); iVar1 = familiar->_state; if ((0 < iVar1) && (((0x96 < iVar1 || (0x1d < familiar->_fireCooldown)) && (familiar->_state = iVar1 + -1, iVar1 + -1 < 1)))) { familiar->_health = familiar->_maxHitPoints; fVar2 = g_vectorOne.y * 0.01; (layer->_size).x = g_vectorOne.x * 0.01; (layer->_size).y = fVar2; Entity_Familiar::AddToOrbit(familiar,6); } fVar2 = (layer->_size).x; if ((0.0 < fVar2) && (fVar2 < 1.0)) { fVar2 = fVar2 + 0.03; if (1.0 <= fVar2) { fVar2 = 1.0; } (layer->_size).y = fVar2; (layer->_size).x = fVar2; if (0.8 < fVar2) { familiar->_entityCollisionClass = 4; familiar->_shadowSize = *(float *)((int)familiar->_config + 0x24); } } if (0.0 < familiar->_pendingDamage) { familiar->_pendingDamage = 0.0; damageEventsEnd = (familiar->_damageEvents)._end; for (damageEvent = (familiar->_damageEvents)._begin; damageEvent != damageEventsEnd; damageEvent = damageEvent + 0xe) { fVar2 = *damageEvent; if (((uint)damageEvent[2] & 4) != 0) { if (3.5 < fVar2) { fVar2 = 3.5; } *damageEvent = fVar2; } familiar->_pendingDamage = fVar2 + familiar->_pendingDamage; } } ExceptionList = local_10; return; } //@@ 006431b0 FUN_006431b0 void FUN_006431b0(void) { int *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x1c); return; } //@@ 006431d0 Entity_Familiar::ai_bot_fly /* DB: Entity_Familiar::Update case 0xda (variant 218, CheckFamiliar from COLLECTIBLE_BOT_FLY 629) after GetOrbitPosition; anims Attack/Shoot, fires tears via SpawnEx + SetTearFlags + convert_shot_for_enemy_owner */ void __thiscall Entity_Familiar::ai_bot_fly(Entity_Familiar *this) { BitSet128 flags; byte bVar1; byte *pbVar2; uint uVar3; Entity *projectile; Entity_Tear *tear; char *pcVar4; byte *pbVar5; EntityPtr *targetRef; bool isLess; float fVar6; float fVar7; float fVar8; float fVar9; EntityPtr *targetRef; float fVar11; float local_3c; EntityPtr *local_34; Vector local_30; uint uStack_28; EntityPtr *local_14 [4]; EntityPtr target; float *targetPosX; int vtable; pcVar4 = (char *)this; if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 == (byte *)0x0) { pbVar2 = &s_empty; } else if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pcVar4 = "Attack"; do { bVar1 = *pbVar2; isLess = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_00643230: uVar3 = -(uint)isLess | 1; goto LAB_00643235; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; isLess = bVar1 < (byte)((Entity_Familiar *)pcVar4)->field_0x1; if (bVar1 != ((Entity_Familiar *)pcVar4)->field_0x1) goto LAB_00643230; pbVar2 = pbVar2 + 2; pcVar4 = &((Entity_Familiar *)pcVar4)->field_0x2; } while (bVar1 != 0); uVar3 = 0; LAB_00643235: if (uVar3 == 0) { target_threatening_projectile(this,pcVar4,1); targetRef = &this->_target; if (this->_target != (EntityPtr)0x0) { fVar6 = (this->_pos).x; targetPosX = (float *)((int)this->_target + 0x33c); (this->_sprite)._flipX = *targetPosX <= fVar6 && fVar6 != *targetPosX; } if ((this->_sprite)._animState._animData == (void *)0x0) { return; } local_14[0] = targetRef; bVar1 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Shoot"); if (bVar1 == 0) { return; } if ((1 < *(int *)&g_game->_deathmatchManager) && (uVar3 = Random(), uVar3 % 3 != 0)) { return; } target = *targetRef; if (target == (EntityPtr)0x0) { if ((this->_sprite)._flipX == 0) { fVar6 = 15.0; } else { fVar6 = -15.0; } local_30.x = *(float *)((int)this->_player + 0x360) * 0.6; fVar8 = *(float *)((int)this->_player + 0x364) * 0.6; local_30.x = local_30.x + local_30.x; local_34 = (EntityPtr *)(fVar8 + fVar8); local_3c = 0.0; fVar8 = sqrtf(fVar6 * fVar6 + 0.0); if (fVar8 <= 0.0) { fVar9 = local_3c; fVar11 = fVar6; } else { fVar9 = (1.0 / fVar8) * 0.0; fVar11 = (1.0 / fVar8) * fVar6; } fVar7 = 0.0; local_3c = fVar6; if (0.0 < fVar8) { fVar7 = (1.0 / fVar8) * 0.0; local_3c = (1.0 / fVar8) * fVar6; } fVar8 = (float)local_34 * fVar7 + local_30.x * local_3c; fVar9 = fVar9 * fVar8; fVar11 = fVar11 * fVar8; targetRef = local_34; if (fVar11 * fVar6 + fVar9 * 0.0 < 0.0) { local_30.x = local_30.x - fVar11; targetRef = (EntityPtr *)((float)local_34 - fVar9); } local_30.y = (float)targetRef + 0.0; fVar6 = local_30.x + fVar6; } else { fVar6 = (this->_pos).y - *(float *)((int)target + 0x340); fVar8 = (this->_pos).x - *(float *)((int)target + 0x33c); fVar6 = sqrtf(fVar6 * fVar6 + fVar8 * fVar8); target = *targetRef; fVar9 = (fVar6 * 0.05 * *(float *)((int)target + 0x364) + *(float *)((int)target + 0x340)) - (this->_pos).y; fVar6 = (fVar6 * 0.05 * *(float *)((int)target + 0x360) + *(float *)((int)target + 0x33c)) - (this->_pos).x; fVar8 = sqrtf(fVar9 * fVar9 + fVar6 * fVar6); if (fVar8 <= 0.0) { local_30.y = fVar9; } else { fVar6 = fVar6 * (15.0 / fVar8); local_30.y = fVar9 * (15.0 / fVar8); } } local_30.x = fVar6; if ((this->_flags & 0x100) == 0) { uVar3 = Random(); tear = (Entity_Tear *) Game::SpawnEx(g_game,2,10,&this->_pos,&local_30,(Entity *)this,0,uVar3,0); (**(code **)(*(int *)tear + 0x40))(0x40400000); local_30.x = (float)(DAT_00c34c64 | g_tearFlagSpectral._l._4_4_ | g_tearFlagHoming._l._4_4_) ; uStack_28 = DAT_00c34c6c | g_tearFlagSpectral._h._4_4_ | g_tearFlagHoming._h._4_4_; local_34 = (EntityPtr *) (DAT_00c34c60 | (uint)g_tearFlagSpectral._l | (uint)g_tearFlagHoming._l); local_30.y = (float)(DAT_00c34c68 | (uint)g_tearFlagSpectral._h | (uint)g_tearFlagHoming._h) ; flags._l._4_4_ = local_30.x; flags._l._0_4_ = local_34; flags._h._0_4_ = local_30.y; flags._h._4_4_ = uStack_28; Entity_Tear::SetTearFlags(tear,flags); tear->_baseScale = 0.8; tear->_fScale = 0.8; Entity_Tear::ResetSpriteScale(tear); tear->_fallingAccel = 0.2; target = this->_target; if (target != (EntityPtr)0x0) { if (tear->_target != (EntityPtr)0x0) { local_34 = &tear->_target; std::multiset::erase(&local_34); } tear->_target = target; std::multiset::insert(&tear->_target); } (**(code **)(*(int *)tear + 0xc))(); Entity::convert_shot_for_enemy_owner((Entity *)this,(Entity *)tear); targetRef = local_14[0]; } else { uVar3 = Random(); projectile = Game::SpawnEx(g_game,9,0,&this->_pos,&local_30,(Entity *)this,0,uVar3,0); vtable = *(int *)projectile; projectile[1]._variant = 0x2000; projectile[1]._subtype = 0x1000; projectile[1]._damageEvents._end = (void *)0x3f4ccccd; (**(code **)(vtable + 0xc))(); } target = *targetRef; if (target == (EntityPtr)0x0) { return; } *(uint *)((int)target + 0x168) = *(uint *)((int)target + 0x168) | 0x10; *(undefined4 *)((int)target + 0x16c) = *(undefined4 *)((int)target + 0x16c); if (*targetRef != (EntityPtr)0x0) { local_14[0] = targetRef; std::multiset::erase(local_14); } *targetRef = (EntityPtr)0x0; return; } } target_threatening_projectile(this,pcVar4,0); pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pbVar5 = s_Fly; do { bVar1 = *pbVar2; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_006436f0: uVar3 = -(uint)isLess | 1; goto LAB_006436f5; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_006436f0; pbVar2 = pbVar2 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_006436f5: if ((uVar3 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00643729; } bVar1 = ANM2::SetAnimation(&this->_sprite,s_Fly,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00643729: if (this->_target != (EntityPtr)0x0) { pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { pbVar5 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar5 = *(byte **)pbVar2; } pcVar4 = "Attack"; do { bVar1 = *pbVar5; isLess = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_00643768: uVar3 = -(uint)isLess | 1; goto LAB_0064376d; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; isLess = bVar1 < (byte)pcVar4[1]; if (bVar1 != pcVar4[1]) goto LAB_00643768; pbVar5 = pbVar5 + 2; pcVar4 = pcVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0064376d: if (uVar3 == 0) { if (pbVar2[0x34] == 0) { return; } if ((this->_sprite)._animState._isPlaying != 0) { return; } } } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Attack",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } return; } //@@ 006437a0 Entity_Familiar::ai_stitches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update cases 0xdd/0xde (variants 221 Paschal Candle 567, 222 Stitches 635); anims TeleportDown/TeleportUp, aims with GetShootingJoystick + Room::GetClampedPositionImpl */ void __thiscall Entity_Familiar::ai_stitches(Entity_Familiar *this) { void *pvVar1; ANM2 other; Vector velocity; Entity *player; ANM2 *pAVar3; byte bVar4; Entity *effect; LayerState *layer; byte *curAnimChar; uint uVar5; Game *game; char *wantedAnimChar; bool bVar6; float fVar7; float fVar8; float fVar9; float fVar10; Entity_Familiar *effect; ANM2 aAStackY_8ca0 [128]; undefined1 in_stack_fffffe74 [228]; float in_stack_ffffff58; float in_stack_ffffff5c; float in_stack_ffffff60; Vector *pVVar12; undefined4 uVar13; int iVar14; EntityPtr *local_70; byte isBffs; float fStack_68; Entity *pEStack_64; float local_60; Entity_Familiar *local_5c; Vector local_58; undefined4 uStack_50; undefined4 uStack_4c; code *pcStack_48; float deltaX; float distanceToPlayer; float fStack_3c; ColorMod CStack_38; uint local_c; byte *animData; EntityPtr beamParent; EntityPtr *beamParentSlot; int *entity; Manager *manager; Entity_Player *player; Vector *pos; local_c = __security_cookie ^ (uint)&local_70; this->_entityGridCollisionClass = 3; local_5c = this; switch(this->_state) { case 0: this->_spawnerType = 1; LAB_0064423d: this->_state = 3; break; case 1: uVar5 = Random(); iVar14 = 0; uVar13._0_1_ = 0; uVar13._1_1_ = 0; uVar13._2_2_ = 0; fVar10 = 0.0; pVVar12 = &g_vectorZero; pos = &this->_pos; fVar9 = 2.10195e-44; fVar7 = 1.4013e-42; fVar8 = 9.203692e-39; effect = Game::SpawnEx(g_game,1000,0xf,pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x18c),&local_5c->_sprite); other._championColor._colorize[0] = in_stack_ffffff58; other._filename._buf[0] = in_stack_fffffe74[0]; other._filename._buf[1] = in_stack_fffffe74[1]; other._filename._buf[2] = in_stack_fffffe74[2]; other._filename._buf[3] = in_stack_fffffe74[3]; other._filename._buf[4] = in_stack_fffffe74[4]; other._filename._buf[5] = in_stack_fffffe74[5]; other._filename._buf[6] = in_stack_fffffe74[6]; other._filename._buf[7] = in_stack_fffffe74[7]; other._filename._buf[8] = in_stack_fffffe74[8]; other._filename._buf[9] = in_stack_fffffe74[9]; other._filename._buf[10] = in_stack_fffffe74[10]; other._filename._buf[0xb] = in_stack_fffffe74[0xb]; other._filename._buf[0xc] = in_stack_fffffe74[0xc]; other._filename._buf[0xd] = in_stack_fffffe74[0xd]; other._filename._buf[0xe] = in_stack_fffffe74[0xe]; other._filename._buf[0xf] = in_stack_fffffe74[0xf]; other._filename._size = in_stack_fffffe74._16_4_; other._filename._capacity = in_stack_fffffe74._20_4_; other._animDefaultName._buf[0] = in_stack_fffffe74[0x18]; other._animDefaultName._buf[1] = in_stack_fffffe74[0x19]; other._animDefaultName._buf[2] = in_stack_fffffe74[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffe74[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffe74[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffe74[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffe74[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffe74[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffe74[0x20]; other._animDefaultName._buf[9] = in_stack_fffffe74[0x21]; other._animDefaultName._buf[10] = in_stack_fffffe74[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffe74[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffe74[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffe74[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffe74[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffe74[0x27]; other._animDefaultName._size = in_stack_fffffe74._40_4_; other._animDefaultName._capacity = in_stack_fffffe74._44_4_; other._animState._animation = (void *)in_stack_fffffe74._48_4_; other._animState._animData = (void *)in_stack_fffffe74._52_4_; other._animState._layerFrames = (void *)in_stack_fffffe74._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffe74._60_4_; other._animState._animFrame = (float)in_stack_fffffe74._64_4_; other._animState._isPlaying = in_stack_fffffe74[0x44]; other._animState._21_3_ = in_stack_fffffe74._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffe74._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffe74._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffe74._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffe74._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffe74._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffe74._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffe74._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffe74[100]; other._overlayAnimState._21_3_ = in_stack_fffffe74._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffe74._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffe74._108_4_; other._overlayRenderFirst = in_stack_fffffe74[0x70]; other._113_3_ = in_stack_fffffe74._113_3_; other._animData = (void *)in_stack_fffffe74._116_4_; other._animCount = in_stack_fffffe74._120_4_; other._layerState = (void *)in_stack_fffffe74._124_4_; other._layerCount = in_stack_fffffe74._128_4_; other._nullLayerNames = (void *)in_stack_fffffe74._132_4_; other._numNullLayers = in_stack_fffffe74._136_4_; other._eventNames = (void *)in_stack_fffffe74._140_4_; other._numEvents = in_stack_fffffe74._144_4_; other._offset.x = (float)in_stack_fffffe74._148_4_; other._offset.y = (float)in_stack_fffffe74._152_4_; other._scale.x = (float)in_stack_fffffe74._156_4_; other._scale.y = (float)in_stack_fffffe74._160_4_; other._rotation = (float)in_stack_fffffe74._164_4_; other._color._tint[0] = (float)in_stack_fffffe74._168_4_; other._color._tint[1] = (float)in_stack_fffffe74._172_4_; other._color._tint[2] = (float)in_stack_fffffe74._176_4_; other._color._tint[3] = (float)in_stack_fffffe74._180_4_; other._color._colorize[0] = (float)in_stack_fffffe74._184_4_; other._color._colorize[1] = (float)in_stack_fffffe74._188_4_; other._color._colorize[2] = (float)in_stack_fffffe74._192_4_; other._color._colorize[3] = (float)in_stack_fffffe74._196_4_; other._color._offset[0] = (float)in_stack_fffffe74._200_4_; other._color._offset[1] = (float)in_stack_fffffe74._204_4_; other._color._offset[2] = (float)in_stack_fffffe74._208_4_; other._championColor._tint[0] = (float)in_stack_fffffe74._212_4_; other._championColor._tint[1] = (float)in_stack_fffffe74._216_4_; other._championColor._tint[2] = (float)in_stack_fffffe74._220_4_; other._championColor._tint[3] = (float)in_stack_fffffe74._224_4_; other._championColor._colorize[1] = in_stack_ffffff5c; other._championColor._colorize[2] = in_stack_ffffff60; other._championColor._colorize[3] = fVar8; other._championColor._offset[0] = fVar7; other._championColor._offset[1] = fVar9; other._championColor._offset[2] = (float)pos; other._256_4_ = pVVar12; other._playbackSpeed = fVar10; other._264_1_ = (char)uVar13; other._loaded = SUB41(uVar13,1); other._266_2_ = SUB42(uVar13,2); other._shadowLayerIndex = uVar5; other._bitflags = iVar14; ANM2::operator_assign(&effect->_sprite,other); ANM2::Play(&effect->_sprite,(byte *)"TeleportUp",0); (**(code **)(*(int *)effect + 0xc))(); this = local_5c; player = local_5c->_player; pos = &local_5c->_pos; local_70 = (EntityPtr *)(player->_pos).x; local_60 = (player->_pos).y; Entity_Player::Teleport(player,pos,1,0); manager = g_manager; pos->x = (float)local_70; (this->_pos).y = local_60; pvVar1 = (manager->_itemConfig)._collectibles._begin; if ((int)((int)(manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) < 0x9ed) { local_58.x = 0.0; } else { local_58.x = *(float *)((int)pvVar1 + 0x9ec); } uStack_4c = 0; uStack_50 = 0xc; local_58.y = 1.4013e-45; TemporaryEffects::AddEffect((TemporaryEffects *)((int)this->_player + 0x1508),&local_58,0,1); fStack_68 = 30.0; local_70 = (EntityPtr *)(this->_player->_meleeDamage * 3.0 + 40.0); isBffs = Entity_Player::HasCollectible(this->_player,0xf7,0); if (isBffs != 0) { fStack_68 = 45.0; } uVar5 = Random(); local_58.x = *(float *)((int)this->_player + 0x33c); local_58.y = *(float *)((int)this->_player + 0x340); effect = Game::SpawnEx(g_game,1000,0xf,&local_58,&g_vectorZero,(Entity *)0x0,0,uVar5,0); (**(code **)(*(int *)effect + 0xc))(); uVar5 = Random(); pVVar12 = pos; effect = Game::SpawnEx(g_game,1000,0xf,pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); (**(code **)(*(int *)effect + 0xc))(); local_58.x = *(float *)((int)this->_player + 0x33c); local_58.y = *(float *)((int)this->_player + 0x340); Game::DamageRadius(&local_58,(Entity *)this,4,0,(int)pVVar12,50.0,g_tearFlagsNone, (float)local_70,fStack_68); fVar8 = *(float *)((int)this->_player + 0x157c); if (isBffs != 0) { fVar8 = fVar8 + fVar8 + 3.0; } Game::DamageRadius(pos,(Entity *)this,4,0,(int)pVVar12,50.0,g_tearFlagsNone,fVar8,fStack_68); if (isBffs != 0) { fStack_68 = 0.0; do { player = this->_player; pEStack_64 = (Entity *)(player->_shotspeed * 10.0); local_70 = (EntityPtr *) ((float)((double)(int)fStack_68 + __uint_to_double_fixup[-((int)fStack_68 >> 0x1f)]) * 360.0 * 0.125 * 0.017453292); fVar8 = cos((float)local_70); local_58.x = fVar8 * (float)pEStack_64; local_58.y = sin((float)local_70); local_58.y = local_58.y * (float)pEStack_64; velocity.y = local_58.y; velocity.x = local_58.x; Entity_Player::FireTear(player,&this->_pos,velocity,0,(Entity *)0x0,1.0); fStack_68 = (float)((int)fStack_68 + 1); } while ((uint)fStack_68 < 8); } bVar4 = Entity_Player::HasCollectible(this->_player,0x3b,0); if (bVar4 != 0) { fVar8 = *(float *)((int)this->_player + 0x157c); fStack_3c = fVar8 + fVar8 + 3.0; uVar5 = Random(); pEStack_64 = Game::SpawnEx(g_game,1000,0xa6,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar5,0 ); beamParent = (EntityPtr)this->_player; beamParentSlot = &pEStack_64->_parent; if (pEStack_64->_parent != (EntityPtr)0x0) { local_70 = beamParentSlot; std::multiset::erase(); } *beamParentSlot = beamParent; if (beamParent != (EntityPtr)0x0) { std::multiset::insert(); } effect = pEStack_64; CStack_38._offset[0] = 0.0; CStack_38._colorize[0] = 0.0; CStack_38._colorize[1] = 0.0; CStack_38._colorize[2] = 0.0; CStack_38._colorize[3] = 0.0; CStack_38._offset[1] = 0.0; CStack_38._offset[2] = 0.0; CStack_38._tint[0] = 0.0; CStack_38._tint[1] = 0.0; CStack_38._tint[2] = 0.0; CStack_38._tint[3] = 1.0; Sprite::SetColor((Sprite *)&pEStack_64->_sprite,&CStack_38); uVar5 = g_graphicsManager_flags; layer = ANM2::GetLayer(&effect->_sprite,(byte *)0x0); iVar14 = 1; if ((uVar5 & 4) == 0) { iVar14 = 6; } layer->_blendMode[1] = iVar14; layer->_blendMode[0] = 0; layer->_blendMode[2] = 7; layer->_blendMode[3] = 1; layer->_blendMode[4] = 7; fVar8 = g_vectorOne.y; (effect->_sprite)._scale.x = g_vectorOne.x; (effect->_sprite)._scale.y = fVar8; builtin_strncpy(effect[1]._sprite._filename._buf,"\n×£=\n×£=",8); (**(code **)(*(int *)effect + 0xc))(); this = local_5c; fVar8 = *(float *)((int)local_5c->_player + 0x340); iVar14 = *(int *)effect; (effect->_pos).x = *(float *)((int)local_5c->_player + 0x33c); (effect->_pos).y = fVar8; fVar8 = g_vectorOne.x; fVar7 = g_vectorOne.y * 2.0; player = effect + 1; (player->_sprite)._filename._buf[0] = '\n'; (player->_sprite)._filename._buf[1] = -0x29; (player->_sprite)._filename._buf[2] = '#'; (player->_sprite)._filename._buf[3] = '='; pAVar3 = &effect[1]._sprite; (pAVar3->_filename)._buf[4] = '\n'; (pAVar3->_filename)._buf[5] = -0x29; (pAVar3->_filename)._buf[6] = '#'; (pAVar3->_filename)._buf[7] = '='; (effect->_sprite)._scale.y = fVar7; (effect->_sprite)._scale.x = fVar8 * 2.0; (**(code **)(iVar14 + 0xc))(); fStack_68 = *(float *)((int)this->_player + 0x340) - (this->_pos).y; local_5c = (Entity_Familiar *)(*(float *)((int)this->_player + 0x33c) - (this->_pos).x); distanceToPlayer = sqrtf(fStack_68 * fStack_68 + (float)local_5c * (float)local_5c); if (0.0 < distanceToPlayer) { effect = (Entity_Familiar *)((float)local_5c / distanceToPlayer); local_70 = (EntityPtr *)0x0; local_58.x = (float)g_game->_room; fVar8 = fStack_68 / distanceToPlayer; game = g_game; fStack_68 = fVar8; local_5c = effect; if (*(int *)((int)local_58.x + 0x1264) != 0) { do { entity = *(int **)(*(int *)((int)local_58.x + 0x125c) + (int)local_70 * 4); if ((entity[0x62] != 0) && ((((1 < *(int *)&game->_deathmatchManager && (entity[10] == 1)) || (entity[10] - 10U < 0x3de)) && ((entity[0x5a] & 0x20000000U) == 0)))) { pEStack_64 = (Entity *)((float)entity[0xd0] - (this->_pos).y); deltaX = (float)entity[0xcf] - (this->_pos).x; pcStack_48 = (code *)(fVar8 * (float)pEStack_64 + (float)effect * deltaX); local_60 = cos(1.5707964); fVar8 = sin(1.5707964); if ((((fVar8 * (float)local_5c + local_60 * fStack_68) * (float)pEStack_64 + (local_60 * (float)local_5c - fVar8 * fStack_68) * deltaX < (float)entity[0xdc] + 25.0) && (0.0 <= (float)pcStack_48)) && ((float)pcStack_48 <= distanceToPlayer)) { CStack_38._offset[1] = (float)this->_player; pcStack_48 = *(code **)(*entity + 0x20); if ((void *)CStack_38._offset[1] == (void *)0x0) { CStack_38._tint[0] = 0.0; CStack_38._tint[1] = 0.0; CStack_38._tint[2] = 0.0; CStack_38._tint[3] = 0.0; CStack_38._colorize[0] = g_vectorZero.x; CStack_38._colorize[1] = g_vectorZero.y; CStack_38._colorize[2] = g_vectorZero.x; CStack_38._colorize[3] = g_vectorZero.y; LAB_00643fa1: pEStack_64 = (Entity *)0x0; if ((void *)CStack_38._offset[1] != (void *)0x0) goto LAB_00643fad; pEStack_64 = (Entity *)0x0; LAB_00643fcf: local_60 = 0.0; if ((void *)CStack_38._offset[1] != (void *)0x0) goto LAB_00643fdb; LAB_00643ff4: uVar5 = 0; } else { CStack_38._tint[0] = *(float *)((int)CStack_38._offset[1] + 0x28); CStack_38._tint[1] = *(float *)((int)CStack_38._offset[1] + 0x2c); CStack_38._tint[2] = *(float *)((int)CStack_38._offset[1] + 0x34); CStack_38._tint[3] = *(float *)((int)CStack_38._offset[1] + 0x38); CStack_38._colorize[0] = *(float *)((int)CStack_38._offset[1] + 0x33c); CStack_38._colorize[1] = *(float *)((int)CStack_38._offset[1] + 0x340); CStack_38._colorize[2] = *(float *)((int)CStack_38._offset[1] + 0x360); CStack_38._colorize[3] = *(float *)((int)CStack_38._offset[1] + 0x364); if ((*(uint *)((int)CStack_38._offset[1] + 0x168) & 0x100) == 0) goto LAB_00643fa1; pEStack_64 = (Entity *)0x1; LAB_00643fad: if ((*(uint *)((int)CStack_38._offset[1] + 0x168) & 0x20000000) == 0) goto LAB_00643fcf; local_60 = 2.8026e-45; LAB_00643fdb: if ((*(uint *)((int)CStack_38._offset[1] + 0x16c) & 0x400000) == 0) goto LAB_00643ff4; uVar5 = 4; } CStack_38._offset[0] = (float)(uVar5 | (uint)local_60 | (uint)pEStack_64); (*pcStack_48)(); } game = g_game; effect = local_5c; fVar8 = fStack_68; } local_70 = (EntityPtr *)&local_70->field_0x1; } while (local_70 < *(undefined1 **)((int)local_58.x + 0x1264)); } } uVar5 = Random(); manager = g_manager; local_70 = (EntityPtr *)0x1fa; local_58.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.5; seed_fart_sound_override((int *)&local_70); SoundEffects::Play(&manager->_sfxManager,(int)local_70,1.0,1,0,local_58.x,0.0); Game::ShakeScreen(g_game,6); } iVar14 = *(int *)((int)this->_player + 0x13bc); if (iVar14 < 0x1e) { iVar14 = 0x1e; } *(int *)((int)this->_player + 0x13bc) = iVar14; pvVar1 = this->_player; *(uint *)((int)pvVar1 + 0x16c) = *(uint *)((int)pvVar1 + 0x16c) | 0x10; *(undefined4 *)((int)pvVar1 + 0x168) = *(undefined4 *)((int)pvVar1 + 0x168); (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0064418e: bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)"TeleportDown",1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } wantedAnimChar = "TeleportDown"; do { bVar4 = *curAnimChar; bVar6 = bVar4 < (byte)*wantedAnimChar; if (bVar4 != *wantedAnimChar) { LAB_00644170: uVar5 = -(uint)bVar6 | 1; goto LAB_00644175; } if (bVar4 == 0) break; bVar4 = curAnimChar[1]; bVar6 = bVar4 < (byte)wantedAnimChar[1]; if (bVar4 != wantedAnimChar[1]) goto LAB_00644170; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00644175: if ((uVar5 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0064418e; } this->_state = 2; break; case 2: animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00644210: bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)"TeleportDown",1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } wantedAnimChar = "TeleportDown"; do { bVar4 = *curAnimChar; bVar6 = bVar4 < (byte)*wantedAnimChar; if (bVar4 != *wantedAnimChar) { LAB_006441f2: uVar5 = -(uint)bVar6 | 1; goto LAB_006441f7; } if (bVar4 == 0) break; bVar4 = curAnimChar[1]; bVar6 = bVar4 < (byte)wantedAnimChar[1]; if (bVar4 != wantedAnimChar[1]) goto LAB_006441f2; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar4 != 0); uVar5 = 0; LAB_006441f7: if ((uVar5 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00644210; } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) goto LAB_0064423d; break; case 3: ANM2::Play(&this->_sprite,s_Idle,0); } Entity_Player::GetShootingJoystick(this->_player,&local_58); fVar8 = (this->_velocity).x; if (this->_collidesWithGrid != 0) { fVar8 = fVar8 * 0.88; (this->_velocity).x = fVar8; (this->_velocity).y = (this->_velocity).y * 0.88; } fVar7 = 0.0; if ((local_58.x == 0.0) || (local_58.y != 0.0)) { if ((local_58.y == 0.0) || (local_58.x != 0.0)) goto LAB_00644300; fVar7 = (this->_velocity).y; fVar8 = fVar8 * 0.5; } else { (this->_velocity).y = (this->_velocity).y * 0.5; fVar7 = fVar8; } fVar7 = ABS(fVar7); LAB_00644300: game = g_game; fVar9 = (this->_velocity).y; fVar10 = -(fVar9 * local_58.y + fVar8 * local_58.x) * 0.2; if (fVar10 <= 0.0) { fVar10 = 0.0; } fVar7 = (fVar10 + fVar7 * 0.3 * 0.1 + 3.0) * 0.8; (this->_velocity).y = (fVar7 * local_58.y + fVar9) * 0.775; (this->_velocity).x = (fVar7 * local_58.x + fVar8) * 0.775; Room::GetClampedPositionImpl(game->_room,&local_58,&this->_pos,0.0,0.0,0.0,0.0); local_60 = local_58.x - (this->_pos).x; local_70 = (EntityPtr *)(local_58.y - (this->_pos).y); if ((local_60 != g_vectorZero.x) || ((float)local_70 != g_vectorZero.y)) { fVar8 = sqrtf((float)local_70 * (float)local_70 + local_60 * local_60); if (0.0 < fVar8) { local_70 = (EntityPtr *)((float)local_70 * (1.0 / fVar8)); local_60 = local_60 * (1.0 / fVar8); } fVar8 = (this->_velocity).x; fVar7 = this->_speedMultiplier; fVar9 = -((float)local_70 * (this->_velocity).y + fVar8 * local_60); if (fVar9 <= 1.0) { fVar9 = 1.0; } if (10.0 <= fVar9) { fVar9 = 10.0; } (this->_velocity).x = local_60 * fVar9 * fVar7 + fVar8; (this->_velocity).y = (float)local_70 * fVar9 * fVar7 + (this->_velocity).y; } return; } //@@ 006444d0 Entity_Familiar::aim_reflected_projectile /* DB: ? Entity_Familiar::HandleCollision with projectile (type 9): if flag 0x100 and owner target -> GetPlayerTarget, else picks nearest valid enemy (skips 802/866 friendlies) and returns direction/speed for the knocked-back shot */ Entity * __thiscall Entity_Familiar::aim_reflected_projectile(Entity_Familiar *this) { Entity_NPC *this_00; void *pvVar1; Entity *pEVar2; uint uVar3; int iVar4; Game *pGVar5; uint uVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float local_30; float local_20; float local_1c; Entity *local_18; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; pGVar5 = g_game; uStack_8 = 0xffffffff; puStack_c = &LAB_00af70b0; local_10 = ExceptionList; ExceptionList = &local_10; if ((((this->_flags & 0x100) != 0) && (this_00 = *(Entity_NPC **)((int)this->_player + 0x3bc), this_00 != (Entity_NPC *)0x0)) && (((1 < *(int *)&g_game->_deathmatchManager && (this_00->_type == 1)) || (this_00->_type - 10U < 0x3de)))) { pEVar2 = Entity_NPC::GetPlayerTarget(this_00); ExceptionList = local_10; return pEVar2; } local_20 = (this->_velocity).y; local_1c = (this->_velocity).x; local_30 = 0.0; fVar9 = local_20 * local_20; local_18 = (Entity *)0x0; fVar7 = sqrtf(local_1c * local_1c + fVar9); if (0.0 < fVar7) { local_1c = local_1c * (1.0 / fVar7); local_20 = local_20 * (1.0 / fVar7); } pvVar1 = pGVar5->_room; fVar7 = (this->_velocity).x; uVar6 = 0; pEVar2 = (Entity *)0x0; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { pEVar2 = *(Entity **)(*(int *)((int)pvVar1 + 0x125c) + uVar6 * 4); if (((((1 < *(int *)&pGVar5->_deathmatchManager) && (iVar4 = 1, pEVar2->_type == 1)) || (iVar4 = pEVar2->_type, iVar4 - 10U < 0x3de)) && ((pEVar2->_entityCollisionClass != 1 && (pEVar2->_entityCollisionClass != 0)))) && (((pEVar2->_isInvicible == 0 && (pEVar2->_dead == 0)) && ((((pEVar2->_flags & 0x10) == 0 || (iVar4 == 0x322)) || (iVar4 == 0x362)))))) { if (fVar7 * fVar7 + fVar9 <= 1e-05) { uVar3 = Random(); fVar10 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; pGVar5 = g_game; } else { fVar10 = (pEVar2->_pos).x - (this->_pos).x; fVar11 = (pEVar2->_pos).y - (this->_pos).y; fVar8 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (0.0 < fVar8) { fVar10 = fVar10 * (1.0 / fVar8); fVar11 = fVar11 * (1.0 / fVar8); } fVar10 = local_1c * fVar10 + local_20 * fVar11; } if (local_30 < fVar10) { local_30 = fVar10; local_18 = pEVar2; } } uVar6 = uVar6 + 1; pEVar2 = local_18; } while (uVar6 < *(uint *)((int)pvVar1 + 0x1264)); } ExceptionList = local_10; return pEVar2; } //@@ 00644780 FamiliarAI::variant_204 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Familiar::Update case 0xcc (204); spawns child effect 1000.166 at +0x3c0 (scale .6, tinted), GetOrbitPosition, HasEntityFlags */ void __fastcall FamiliarAI::variant_204(Entity_Familiar *familiar) { ANM2 *pAVar1; char *pcVar2; byte bVar3; uint rngResult; EntityPtr tmpEntity; int iVar4; int decayedDelay; int iVar5; float fVar6; float fVar7; float fVar8; EntityPtr *local_54; float fStack_50; Vector VStack_4c; Vector VStack_44; float playerLeadX; undefined4 local_38 [8]; undefined4 local_18; undefined4 uStack_14; undefined4 local_10; uint local_c; EntityPtr *childSlot; void *player; local_c = __security_cookie ^ (uint)&local_54; childSlot = &familiar->_child; if (familiar->_child == (EntityPtr)0x0) { rngResult = Random(); tmpEntity = (EntityPtr) Game::SpawnEx(g_game,1000,0xa6,&familiar->_pos,&g_vectorZero,(Entity *)familiar,0, rngResult,0); local_18 = 0; uStack_14 = 0; local_10 = 0; if ((ColorMod *)((int)tmpEntity + 0xf0) != (ColorMod *)local_38) { *(float *)((int)tmpEntity + 0x100) = 0.0; *(float *)((int)tmpEntity + 0x104) = 0.0; *(float *)((int)tmpEntity + 0x108) = 0.0; *(float *)((int)tmpEntity + 0x10c) = 0.0; ((float *)((int)tmpEntity + 0x110))[0] = 0.0; ((float *)((int)tmpEntity + 0x110))[1] = 0.0; ((ColorMod *)((int)tmpEntity + 0xf0))->_tint[0] = 0.7; *(float *)((int)tmpEntity + 0xf4) = 0.0; *(float *)((int)tmpEntity + 0xf8) = 0.85; *(float *)((int)tmpEntity + 0xfc) = 0.0; *(float *)((int)tmpEntity + 0x118) = 0.0; } fVar6 = g_vectorOne.x; fVar8 = g_vectorOne.y * 0.6; pAVar1 = (ANM2 *)((int)tmpEntity + 0x454); (pAVar1->_filename)._buf[0] = -0x71; (pAVar1->_filename)._buf[1] = -0x3e; (pAVar1->_filename)._buf[2] = -0xb; (pAVar1->_filename)._buf[3] = '='; pcVar2 = (char *)((int)tmpEntity + 0x458); pcVar2[0] = -0x71; pcVar2[1] = -0x3e; pcVar2[2] = -0xb; pcVar2[3] = '='; *(float *)((int)tmpEntity + 0xe8) = fVar8; ((Vector *)((int)tmpEntity + 0xe4))->x = fVar6 * 0.6; if (*(EntityPtr *)((int)tmpEntity + 0x3bc) != (EntityPtr)0x0) { local_54 = (EntityPtr *)((int)tmpEntity + 0x3bc); std::multiset::erase(&local_54); } *(EntityPtr *)((int)tmpEntity + 0x3bc) = (EntityPtr)familiar; std::multiset::insert((EntityPtr *)((int)tmpEntity + 0x3bc)); (**(code **)(*(int *)tmpEntity + 0xc))(); if (*childSlot != (EntityPtr)0x0) { local_54 = childSlot; std::multiset::erase(&local_54); } *childSlot = tmpEntity; std::multiset::insert(childSlot); } iVar5 = (int)familiar->_updateTime - (int)familiar->_prevUpdateTime; if (familiar->_state == 0) { familiar->_fireCooldown = 0; familiar->_headFrameDelay = 0; familiar->_state = 1; LAB_0064490b: iVar4 = 0; if (1 < *(int *)&g_game->_deathmatchManager) { iVar4 = -0x3c; } if (familiar->_fireCooldown <= iVar4) { Entity_Familiar::target_threatening_projectile(familiar,iVar4,0); } } else if (-1 < familiar->_headFrameDelay) goto LAB_0064490b; tmpEntity = familiar->_target; if (tmpEntity == (EntityPtr)0x0) { if (familiar->_fireCooldown < 1) { VStack_4c.x = *(float *)((int)familiar->_player + 0x33c); VStack_4c.y = *(float *)((int)familiar->_player + 0x340); Entity_Familiar::GetOrbitPosition(familiar,&VStack_44,&VStack_4c); fStack_50 = VStack_44.y - (familiar->_pos).y; local_54 = (EntityPtr *)(VStack_44.x - (familiar->_pos).x); VStack_4c.x = fStack_50 * fStack_50 + (float)local_54 * (float)local_54; fVar6 = sqrtf(VStack_4c.x); if (24.0 <= fVar6) { fVar6 = sqrtf(VStack_4c.x); if (0.0 < fVar6) { fStack_50 = fStack_50 * (1.0 / fVar6); local_54 = (EntityPtr *)((float)local_54 * (1.0 / fVar6)); } fVar6 = familiar->_speedMultiplier; fVar8 = (familiar->_velocity).x; familiar->_friction = familiar->_friction * 0.8; (familiar->_velocity).x = (float)local_54 * 4.0 * fVar6 + fVar8; (familiar->_velocity).y = fStack_50 * 4.0 * fVar6 + (familiar->_velocity).y; } else { player = familiar->_player; playerLeadX = (*(float *)((int)player + 0x360) + *(float *)((int)player + 0x360)) / *(float *)((int)player + 0x36c); VStack_4c.x = (*(float *)((int)player + 0x364) + *(float *)((int)player + 0x364)) / *(float *)((int)player + 0x36c); fStack_50 = (VStack_44.x - (playerLeadX + (familiar->_pos).x)) * 0.5; local_54 = (EntityPtr *)((VStack_44.y - (VStack_4c.x + (familiar->_pos).y)) * 0.5); VStack_44.x = sqrtf((float)local_54 * (float)local_54 + fStack_50 * fStack_50); if (((5.0 < VStack_44.x) && (bVar3 = Entity::HasEntityFlags((Entity *)familiar,0x20000000000), bVar3 == 0)) && (0.0 < VStack_44.x)) { fStack_50 = fStack_50 * (5.0 / VStack_44.x); local_54 = (EntityPtr *)((float)local_54 * (5.0 / VStack_44.x)); } fVar6 = familiar->_friction * 0.8; familiar->_friction = fVar6; (familiar->_velocity).x = (playerLeadX + fStack_50) / fVar6; (familiar->_velocity).y = (VStack_4c.x + (float)local_54) / fVar6; } if (familiar->_headFrameDelay < 0) { iVar5 = familiar->_headFrameDelay + iVar5; iVar4 = 0; if (iVar5 < 0) { iVar4 = iVar5; } familiar->_headFrameDelay = iVar4; } *(undefined4 *)((int)*childSlot + 0xfc) = 0; familiar->_fireCooldown = familiar->_fireCooldown + -1; goto LAB_00644d80; } if (0 < familiar->_headFrameDelay) { decayedDelay = familiar->_headFrameDelay - iVar5; iVar4 = 0; if (0 < decayedDelay) { iVar4 = decayedDelay; } familiar->_headFrameDelay = iVar4; } if (0 < iVar5) { do { iVar4 = familiar->_fireCooldown; if (iVar4 == 0xe) { (familiar->_velocity).x = (familiar->_velocity).x * -2.0; (familiar->_velocity).y = (familiar->_velocity).y * -2.0; familiar->_fireCooldown = 0xd; LAB_00644c4c: rngResult = Random(); if ((rngResult & 1) == 0) { familiar->_fireCooldown = familiar->_fireCooldown + -1; } } else { familiar->_fireCooldown = iVar4 + -1; if (iVar4 - 2U < 0xe) goto LAB_00644c4c; } iVar5 = iVar5 + -1; } while (iVar5 != 0); } fVar6 = familiar->_friction * 0.5; } else { familiar->_fireCooldown = 4; VStack_4c.x = (familiar->_pos).y; fVar8 = *(float *)((int)tmpEntity + 0x33c) - (familiar->_pos).x; fVar6 = *(float *)((int)tmpEntity + 0x340) - (familiar->_pos).y; fVar8 = sqrtf(fVar6 * fVar6 + fVar8 * fVar8); tmpEntity = familiar->_target; fStack_50 = *(float *)((int)tmpEntity + 0x360) * *(float *)((int)tmpEntity + 0x36c) * fVar8 * 0.04 + *(float *)((int)tmpEntity + 0x33c); fVar6 = (familiar->_pos).x; fVar8 = *(float *)((int)tmpEntity + 0x364) * *(float *)((int)tmpEntity + 0x36c) * fVar8 * 0.04 + *(float *)((int)tmpEntity + 0x340); if (fStack_50 == fVar6) { fVar7 = (familiar->_pos).y; if (fVar8 != fVar7) goto LAB_00644dda; } else { fVar7 = VStack_4c.x; LAB_00644dda: local_54 = (EntityPtr *)(fVar8 - fVar7); fStack_50 = fStack_50 - fVar6; fVar6 = sqrtf((float)local_54 * (float)local_54 + fStack_50 * fStack_50); if (0.0 < fVar6) { fStack_50 = fStack_50 * (1.0 / fVar6); local_54 = (EntityPtr *)((float)local_54 * (1.0 / fVar6)); } fVar6 = familiar->_speedMultiplier; (familiar->_velocity).x = fStack_50 * 15.0 * fVar6 + (familiar->_velocity).x; (familiar->_velocity).y = (float)local_54 * 15.0 * fVar6 + (familiar->_velocity).y; } familiar->_headFrameDelay = familiar->_headFrameDelay + iVar5; iVar5 = familiar->_headFrameDelay; fVar6 = familiar->_friction * 0.7; if (0x3c < iVar5) { iVar5 = -0x3c; } familiar->_headFrameDelay = iVar5; } familiar->_friction = fVar6; *(undefined4 *)((int)*childSlot + 0xfc) = 0x3f4ccccd; LAB_00644d80: fVar6 = (familiar->_posOffset).x; fVar8 = (familiar->_pos).x; tmpEntity = *childSlot; *(float *)((int)tmpEntity + 0x340) = ((familiar->_pos).y + (familiar->_posOffset).y) - 16.0; *(float *)((int)tmpEntity + 0x33c) = fVar6 + fVar8 + 0.0; return; } //@@ 00644e80 Entity_Familiar::ai_shadow_intruder_damocles /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update cases 0x83/200/0xc9/0xca (My Shadow 433, Intruder 575, Damocles 656 per CheckFamiliar); RemoveCollectible(0x290 DAMOCLES_PASSIVE), SwapANM2, inlined Game::Spawn */ void __thiscall Entity_Familiar::ai_shadow_intruder_damocles(Entity_Familiar *this,char param_2) { code *pcVar1; longlong lVar2; longlong lVar3; longlong lVar4; byte bVar5; char cVar6; byte *curAnimChar; uint uVar7; uint uVar8; EntityRef *sourceRef; uint rngResult; Entity *spawned; int iVar9; int *piVar10; byte *wantedAnimChar; int unusedArg; void *pvVar11; code *extraout_EDX; uint particleIndex; ANM2 *sprite; PlayerManager *playerManager; bool bVar12; float fVar13; ulonglong timeNs; byte *pbVar14; undefined1 auStack_12c [4]; uint spawnSubType; uint finalSubType; int *piStack_120; Entity_Familiar *pEStack_11c; Entity *pEStack_118; int local_114; int iStack_110; uint spawnType; Entity_Familiar *savedFamiliar; float fStack_104; Game *pGStack_100; Vector particlePos; uint uStack_f0; int local_e8; float particleVelX; float fStack_e0; void *pvStack_dc; uint uStack_d8; float burstX; float burstY; EntityPtr *pEStack_cc; uint uStack_c8; uint directSpawnCount; int particleCount; uint uStack_b8; Vector particleVelocity; Vector playerPos; Vector slowVelocity; int iStack_9c; int iStack_98; int aiStack_94 [3]; undefined8 rngShifts; undefined4 uStack_80; int local_7c; int local_78; int local_74; int local_70; float local_6c; float local_68; float local_64; float local_60; uint local_5c; EntityRef local_58; RNG cardRng; uint local_c; Game *game; Manager *manager; Entity_Familiar *spawnVariant; EntityPtr *spawnerSlot; local_c = __security_cookie ^ (uint)auStack_12c; fVar13 = *(float *)((int)this->_player + 0x340); (this->_pos).x = *(float *)((int)this->_player + 0x33c); (this->_pos).y = fVar13; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; if (param_2 != '\0') { return; } iVar9 = this->_state; savedFamiliar = this; if (iVar9 == 0) { this->_state = 1; this->_fireCooldown = 0; ANM2::Play(&this->_sprite,s_Idle,0); return; } if (iVar9 == 1) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { uVar7 = Random(); fVar13 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; if (0.1 <= fVar13) { if (0.5 <= fVar13) { pbVar14 = s_Idle; } else { pbVar14 = s_Idle2; } } else { pbVar14 = &DAT_00b1d43c; } bVar5 = ANM2::SetAnimation(&this->_sprite,pbVar14,1); if (bVar5 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } game = g_game; if ((this->_flags & 0x4000) != 0) { return; } bVar5 = Game::IsPaused(g_game); if (bVar5 != 0) { return; } uVar7 = game->_frameCount & 0x80000003; bVar12 = uVar7 == 0; if ((int)uVar7 < 0) { bVar12 = (uVar7 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar12) { iVar9 = this->_subtype; if (iVar9 < 1) { return; } uVar7 = Random(); manager = g_manager; if ((int)(uVar7 % 10000) < iVar9) { local_114 = 0x1fd; seed_fart_sound_override(&local_114); SoundEffects::Play(&manager->_sfxManager,local_114,1.0,0,0,1.0,0.0); this->_state = 2; return; } return; } return; } if (iVar9 != 2) { return; } pbVar14 = (this->_sprite)._animState._animData; sprite = &this->_sprite; if (pbVar14 != (byte *)0x0) { curAnimChar = pbVar14; if (0xf < *(uint *)(pbVar14 + 0x14)) { curAnimChar = *(byte **)pbVar14; } wantedAnimChar = &DAT_00b1e7b0; do { bVar5 = *curAnimChar; bVar12 = bVar5 < *wantedAnimChar; if (bVar5 != *wantedAnimChar) { LAB_00644f50: uVar7 = -(uint)bVar12 | 1; goto LAB_00644f55; } if (bVar5 == 0) break; bVar5 = curAnimChar[1]; bVar12 = bVar5 < wantedAnimChar[1]; if (bVar5 != wantedAnimChar[1]) goto LAB_00644f50; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar5 != 0); uVar7 = 0; LAB_00644f55: if ((uVar7 == 0) && ((pbVar14[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00644f81; } bVar5 = ANM2::SetAnimation(sprite,&DAT_00b1e7b0,1); if (bVar5 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00644f81: if ((this->_sprite)._animState._animData != (void *)0x0) { bVar5 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b1d3b0); manager = g_manager; if (bVar5 != 0) { local_e8 = 0x4d; seed_fart_sound_override(&local_e8); SoundEffects::Play(&manager->_sfxManager,local_e8,1.0,2,0,1.0,0.0); *(undefined4 *)((int)this->_player + 0x13bc) = 0; bVar5 = Entity_Player::HasInvincibility(this->_player,0,(EntityRef *)0x0); if (bVar5 == 0) { local_6c = (savedFamiliar->_pos).x; local_68 = (savedFamiliar->_pos).y; local_7c = savedFamiliar->_type; local_64 = (savedFamiliar->_velocity).x; local_78 = savedFamiliar->_variant; local_74 = savedFamiliar->_spawnerType; local_70 = savedFamiliar->_spawnerVariant; local_60 = (savedFamiliar->_velocity).y; if ((savedFamiliar->_flags & 0x20000000) == 0) { uVar7 = 0; } else { uVar7 = 2; } if ((savedFamiliar->_flags & 0x40000000000000) == 0) { uVar8 = 0; } else { uVar8 = 4; } local_5c = uVar8 | uVar7 | (uint)((savedFamiliar->_flags & 0x100) != 0); local_58._type = (int)savedFamiliar; (**(code **)(*(int *)this->_player + 0x20))(0x3f800000,0x2002800,0,&local_7c,0x1e); this = pEStack_11c; sourceRef = EntityRef::EntityRef(&local_58); (*extraout_EDX)(sourceRef); uVar7 = Random(); playerPos.x = *(float *)((int)this->_player + 0x33c); playerPos.y = *(float *)((int)this->_player + 0x340); Game::SpawnEx(g_game,1000,2,&playerPos,&g_vectorZero,(Entity *)0x0,3,uVar7,0); local_114 = 3; do { uVar7 = Random(); fVar13 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; piStack_120 = (int *)(fVar13 + fVar13); uVar7 = Random(); pEStack_11c = (Entity_Familiar *) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 15.0 + 6.0); burstX = cos((float)piStack_120); burstX = burstX * (float)pEStack_11c; burstY = sin((float)piStack_120); burstY = burstY * (float)pEStack_11c; uVar8 = Random(); particleIndex = 0; uStack_d8 = 0; uVar7 = (uVar8 & 1) + 1; directSpawnCount = uVar7; rngResult = Random(); particleCount = (uVar8 & 1) + 5 + rngResult % 6; if (particleCount != 0) { do { uVar8 = Random(); pGStack_100 = (Game *)(((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 10.0 - 5.0) * 0.017453292); fStack_104 = cos((float)pGStack_100); pGStack_100 = (Game *)sin((float)pGStack_100); uVar8 = Random(); fStack_e0 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10; particleVelX = (burstX * fStack_104 - burstY * (float)pGStack_100) * fStack_e0; fStack_e0 = (burstX * (float)pGStack_100 + burstY * fStack_104) * fStack_e0; particlePos.x = *(float *)((int)this->_player + 0x33c) + particleVelX; particlePos.y = *(float *)((int)this->_player + 0x340) + fStack_e0; particleVelocity.x = particleVelX; particleVelocity.y = fStack_e0; fVar13 = (float)Random(); if (particleIndex < uVar7) { slowVelocity.x = particleVelX * 0.2; slowVelocity.y = fStack_e0 * 0.2; spawned = Game::SpawnEx(g_game,1000,5,&particlePos,&slowVelocity,(Entity *)0x0,0, (uint)fVar13,0); (**(code **)(*(int *)spawned + 0xc))(); uStack_d8 = particleIndex; } else { pGStack_100 = g_game; spawnSubType = 99; pEStack_11c = (Entity_Familiar *)&DAT_00000005; spawnType = 1000; fStack_104 = fVar13; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&pEStack_11c,&particlePos,&particleVelocity, (Entity *)0x0,(int *)&spawnSubType,(uint *)&fStack_104); spawnVariant = pEStack_11c; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00645675: finalSubType = spawnSubType; } else { piVar10 = (g_game->_deathmatchManager)._type; piStack_120 = piVar10; uVar8 = Random(); uVar7 = spawnSubType; rngShifts = 0x900000005; pEStack_118 = (Entity *)&DAT_00000007; uStack_80 = 7; if (spawnType != 5) goto LAB_00645675; if (spawnVariant < (Entity_Familiar *)0x12d) { if (spawnVariant == (Entity_Familiar *)0x12c) { while ((finalSubType = spawnSubType, spawnSubType == 0 || (cVar6 = (**(code **)(*piVar10 + 0x24))(spawnSubType), cVar6 != '\0'))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)rngShifts & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)pEStack_118 & 0x1f) ^ uVar8; iVar9 = ItemPool::GetCardEx(uVar8,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar8; spawnSubType = lua_callback_run_get_card(&cardRng,iVar9,1,1,0); } } else { if (spawnVariant == (Entity_Familiar *)0x46) { uStack_f0 = spawnSubType >> 0xb; do { finalSubType = spawnSubType; if (spawnSubType != 0) { pcVar1 = *(code **)(*piVar10 + 0x28); iVar9 = ItemPool::GetPillEffect (&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0) ; cVar6 = (*pcVar1)(iVar9); if (cVar6 == '\0') goto LAB_0064567d; piVar10 = piStack_120; } if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)rngShifts & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)pEStack_118 & 0x1f) ^ uVar8; spawnSubType = ItemPool::GetPill(uVar8); spawnSubType = spawnSubType | (uStack_f0 & 1) << 0xb; } while( true ); } if (spawnVariant != (Entity_Familiar *)0x64) goto LAB_00645675; finalSubType = spawnSubType; if (spawnSubType == 0x19) { LAB_006454c5: bVar12 = false; } else { uStack_b8 = spawnSubType; std::set::find_node(&local_58._spawnerType,&uStack_b8); if (((*(char *)((int)local_58._position.x + 0xd) == '\0') && (*(int *)((int)local_58._position.x + 0x10) <= (int)uVar7)) && (local_58._position.x != (float)piVar10[8])) goto LAB_006454c5; bVar12 = true; } if ((uVar7 == 0) || (bVar12)) { spawnSubType = (**(code **)(*piVar10 + 0x84))(0); finalSubType = spawnSubType; } } } else { if (spawnVariant != (Entity_Familiar *)0x15e) goto LAB_00645675; while ((finalSubType = spawnSubType, spawnSubType == 0 || (cVar6 = (**(code **)(*piVar10 + 0x2c))(spawnSubType), cVar6 != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0064567d: pEStack_118 = EntityFactory::Create(pGStack_100->_entityFactory,spawnType,0); if (pEStack_118 != (Entity *)0x0) { timeNs = GetTimeNs(); spawned = pEStack_118; uStack_f0 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; iStack_110 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uStack_f0 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); uVar7 = iStack_110 + (uint)CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (ulonglong)uStack_f0 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar8,uVar7),uVar8 + uVar7); uStack_c8 = (uint)((ulonglong)lVar2 >> 0x20); spawnerSlot = &pEStack_118->_spawnerEntity; piStack_120 = (int *)((uint)lVar2 >> 0x12 | uStack_c8 * 0x4000); uStack_c8 = uStack_c8 >> 0x12; pEStack_118->_spawnerType = 0; pEStack_118->_spawnerVariant = 0; if (*spawnerSlot != (EntityPtr)0x0) { pEStack_cc = spawnerSlot; std::multiset::erase(&pEStack_cc); } iVar9 = *(int *)spawned; *spawnerSlot = (EntityPtr)0x0; (spawned->_pos).x = particlePos.x; (spawned->_pos).y = particlePos.y; (spawned->_velocity).x = particleVelX; (spawned->_velocity).y = fStack_e0; (**(code **)(iVar9 + 4))(spawnType,pEStack_11c,finalSubType,fStack_104); game = pGStack_100; pvVar11 = pGStack_100->_room; iVar9 = *(int *)((int)pvVar11 + 0x1214); *(int *)((int)pvVar11 + 0x1214) = iVar9 + 1; spawned->_index = iVar9; EntityList::AddEntity((EntityList *)((int)pvVar11 + 0x1218),spawned); bVar5 = Game::ShouldEraseEnemy(spawned); if (bVar5 != 0) { Entity::RemoveWithPoof(spawned,unusedArg); } if ((spawned->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { iStack_98 = spawned->_variant; iVar9 = spawned->_type; iStack_9c = iVar9; std::map::find(&pvStack_dc,&iStack_9c); if (pvStack_dc == (game->_proceduralItemManager)._spawnTriggerTargets._head) { aiStack_94[1] = 0xffffffff; aiStack_94[0] = iVar9; piVar10 = (int *)std::map::find (&local_58._variant,aiStack_94); pvStack_dc = (void *)*piVar10; if (pvStack_dc == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_006458e9; } uVar7 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar11 = (playerManager->_playerList)._end; if ((int)pvVar11 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar11 = (playerManager->_playerList)._end; } piVar10 = (playerManager->_playerList)._begin; if (uVar7 < (uint)((int)pvVar11 - (int)piVar10 >> 2)) { piVar10 = piVar10 + uVar7; } trigger_set_dispatch ((void *)(*piVar10 + 0x1fc8),6,spawned,&particlePos, &particleVelocity); uVar7 = uVar7 + 1; playerManager = &g_game->_playerManager; } while (uVar7 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_006458e9: timeNs = GetTimeNs(); uVar7 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; uStack_f0 = (uint)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar7 * 0x431bde82; iStack_110 = (int)lVar3; lVar4 = (ulonglong)uVar7 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); pGStack_100 = (Game *)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), uStack_f0 + CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); piVar10 = (int *)((uint)lVar3 >> 0x12 | uVar8 * 0x4000); uVar7 = (int)piVar10 - (int)piStack_120; bVar12 = CARRY4((uint)g_entitySpawnTimeMs,uVar7); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar7; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar8 >> 0x12) - uStack_c8) - (uint)(piVar10 < piStack_120)) + (uint)bVar12; } spawned = pEStack_118; (**(code **)(*(int *)pEStack_118 + 0xc))(); spawned[1]._damageEvents._begin = (void *)0xc1000000; uVar7 = directSpawnCount; this = savedFamiliar; } particleIndex = uStack_d8 + 1; uStack_d8 = particleIndex; } while ((int)particleIndex < particleCount); } local_114 = local_114 + -1; } while (local_114 != 0); sprite = &this->_sprite; local_114 = 0; } uVar7 = Random(); spawned = Game::SpawnEx(g_game,1000,6,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7,0); Isaac::SwapANM2(&spawned->_sprite,sprite); iVar9 = *(int *)spawned; *(undefined4 *)&spawned[1].field_0x44 = 1; (**(code **)(iVar9 + 0xc))(); Entity_Player::RemoveCollectible(this->_player,0x290,0,0,1); (**(code **)(*(int *)this + 0x28))(); return; } } return; } //@@ 00645bc0 FUN_00645bc0 void FUN_00645bc0(void) { EntityPtr *pEVar1; int iVar2; code *pcVar3; longlong lVar4; longlong lVar5; longlong lVar6; Game *pGVar7; Manager *pMVar8; Game *type; Entity *pEVar9; byte bVar10; RNG *this; uint uVar11; uint uVar12; int *piVar13; undefined4 uVar14; float in_ECX; int unusedArg; void *pvVar15; int unusedArg_00; uint uVar16; PlayerManager *pPVar17; bool bVar18; float fVar19; float fVar20; float fVar21; float fVar22; ulonglong uVar23; uint uStack_80; uint uStack_7c; Game *pGStack_78; uint uStack_74; int iStack_70; uint uStack_6c; Entity *pEStack_68; Entity *pEStack_64; float fStack_60; RNG *pRStack_5c; Vector *pVStack_58; float local_54; Game *apGStack_50 [2]; EntityPtr *apEStack_48 [2]; EntityPtr *apEStack_40 [2]; Game *pGStack_38; uint auStack_30 [3]; undefined1 auStack_24 [4]; Vector VStack_20; float fStack_18; int iStack_14; Vector VStack_10; if (*(char *)((int)in_ECX + 0x173) != '\0') { return; } switch(*(undefined4 *)((int)in_ECX + 0xd88)) { case 0: ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"FloatDown",0); *(undefined4 *)((int)in_ECX + 0xd88) = 1; break; case 1: ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"FloatDown",0); iVar2 = *(int *)((int)in_ECX + 0x410); fVar21 = *(float *)(iVar2 + 0x33c) - *(float *)(iVar2 + 0x1630) * 48.0; fVar22 = *(float *)(iVar2 + 0x340) - *(float *)(iVar2 + 0x1634) * 48.0; fVar20 = *(float *)((int)in_ECX + 0x33c) - fVar21; fVar19 = *(float *)((int)in_ECX + 0x340) - fVar22; if (fVar19 * fVar19 + fVar20 * fVar20 <= 2304.0) { fVar19 = *(float *)(iVar2 + 0x364); *(float *)((int)in_ECX + 0x360) = *(float *)(iVar2 + 0x360) * 0.4 * *(float *)((int)in_ECX + 0x39c) + *(float *)((int)in_ECX + 0x360); *(float *)((int)in_ECX + 0x364) = fVar19 * 0.4 * *(float *)((int)in_ECX + 0x39c) + *(float *)((int)in_ECX + 0x364); } else { local_54 = (fVar21 - *(float *)((int)in_ECX + 0x33c)) * 0.04; pVStack_58 = (Vector *)((fVar22 - *(float *)((int)in_ECX + 0x340)) * 0.04); fVar19 = sqrtf((float)pVStack_58 * (float)pVStack_58 + local_54 * local_54); if ((5.0 < fVar19) && (0.0 < fVar19)) { pVStack_58 = (Vector *)((5.0 / fVar19) * (float)pVStack_58); local_54 = (5.0 / fVar19) * local_54; } *(float *)((int)in_ECX + 0x360) = local_54 * *(float *)((int)in_ECX + 0x39c) + *(float *)((int)in_ECX + 0x360); *(float *)((int)in_ECX + 0x364) = (float)pVStack_58 * *(float *)((int)in_ECX + 0x39c) + *(float *)((int)in_ECX + 0x364); } *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.8; break; case 2: local_54 = in_ECX; ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"PreSpawn",0); if ((*(int *)((int)in_ECX + 0x7c) == 0) || (*(char *)((int)in_ECX + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)in_ECX + 0x48),s_Spawn,0); pMVar8 = g_manager; *(undefined4 *)((int)in_ECX + 0xd88) = 3; iStack_70 = 0x10c; seed_fart_sound_override(&iStack_70); SoundEffects::Play(&pMVar8->_sfxManager,iStack_70,1.0,2,0,1.0,0.0); this = Entity_Player::GetCollectibleRNG(*(Entity_Player **)((int)in_ECX + 0x410),0x264); pRStack_5c = this; fStack_60 = RNG::RandomFloat(this); pVStack_58 = (Vector *)((int)in_ECX + 0x33c); if (0.25 <= fStack_60) { if (0.5 <= fStack_60) { if (0.75 <= fStack_60) { uStack_6c = 0; do { Room::FindFreePickupSpawnPosition(g_game->_room,&VStack_20,pVStack_58,40.0,0,0,0); uVar11 = this->_seed; if (uVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar11 = this->_seed; if (uVar11 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } pGVar7 = g_game; uVar11 = uVar11 >> ((byte)this->_shift1 & 0x1f) ^ uVar11; uVar11 = uVar11 << ((byte)this->_shift2 & 0x1f) ^ uVar11; apGStack_50[0] = g_game; fStack_60 = (float)(uVar11 >> ((byte)this->_shift3 & 0x1f) ^ uVar11); uStack_74 = 4; this->_seed = (int)fStack_60; pGStack_78 = (Game *)0xa; uStack_7c = 5; lua_callback_run_pre_entity_spawn ((int *)&uStack_7c,(int *)&pGStack_78,&VStack_20,&g_vectorZero,(Entity *)0x0 ,(int *)&uStack_74,(uint *)&fStack_60); uVar11 = uStack_7c; auStack_30[0] = uStack_7c; if (1 < *(int *)&g_game->_deathmatchManager) { ItemPool::ReplaceBlacklistedPickup ((g_game->_deathmatchManager)._type,auStack_30,&pGStack_78,&uStack_74); } pEStack_68 = EntityFactory::Create(pGVar7->_entityFactory,uVar11,0); if (pEStack_68 != (Entity *)0x0) { uVar23 = GetTimeNs(); pEVar9 = pEStack_68; uVar11 = (uint)(uVar23 >> 0x20); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82; lVar5 = (ulonglong)uVar11 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); pGStack_38 = (Game *)(lVar5 + lVar4); lVar4 = (ulonglong)uVar11 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), (int)((ulonglong)lVar4 >> 0x20) + (uint)CARRY4((uint)lVar4,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar4) >> 0x20)); uVar11 = (uint)((ulonglong)lVar4 >> 0x20); pEVar1 = &pEStack_68->_spawnerEntity; uStack_80 = (uint)lVar4 >> 0x12 | uVar11 * 0x4000; apEStack_40[0] = (EntityPtr *)(uVar11 >> 0x12); pEStack_68->_spawnerType = 0; pEStack_68->_spawnerVariant = 0; if (*pEVar1 != (EntityPtr)0x0) { apEStack_48[0] = pEVar1; std::multiset::erase(apEStack_48); } iVar2 = *(int *)pEVar9; *pEVar1 = (EntityPtr)0x0; (pEVar9->_pos).x = VStack_20.x; (pEVar9->_pos).y = VStack_20.y; (pEVar9->_velocity).x = g_vectorZero.x; (pEVar9->_velocity).y = g_vectorZero.y; (**(code **)(iVar2 + 4))(uStack_7c,pGStack_78,uStack_74,fStack_60); pGVar7 = apGStack_50[0]; pvVar15 = apGStack_50[0]->_room; iVar2 = *(int *)((int)pvVar15 + 0x1214); *(int *)((int)pvVar15 + 0x1214) = iVar2 + 1; pEVar9->_index = iVar2; EntityList::AddEntity((EntityList *)((int)pvVar15 + 0x1218),pEVar9); bVar10 = Game::ShouldEraseEnemy(pEVar9); if (bVar10 != 0) { Entity::RemoveWithPoof(pEVar9,unusedArg_00); } if ((pEVar9->_exists != 0) && ((pGVar7->_proceduralItemManager)._proceduralItems._begin != (pGVar7->_proceduralItemManager)._proceduralItems._end)) { VStack_10.y = (float)pEVar9->_variant; fVar19 = (float)pEVar9->_type; VStack_10.x = fVar19; std::map::find(&pEStack_64,&VStack_10); if (pEStack_64 == (pGVar7->_proceduralItemManager)._spawnTriggerTargets._head) { iStack_14 = -1; fStack_18 = fVar19; piVar13 = (int *)std::map::find(auStack_24,&fStack_18); pEStack_64 = (Entity *)*piVar13; if (pEStack_64 == (pGVar7->_proceduralItemManager)._spawnTriggerTargets._head) goto code_r0x006466b1; } uVar11 = 0; pPVar17 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar17->_playerList)._begin >> 2 != 0) { do { pvVar15 = (pPVar17->_playerList)._end; if ((int)pvVar15 - (int)(pPVar17->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar15 = (pPVar17->_playerList)._end; } piVar13 = (pPVar17->_playerList)._begin; if (uVar11 < (uint)((int)pvVar15 - (int)piVar13 >> 2)) { piVar13 = piVar13 + uVar11; } trigger_set_dispatch ((void *)(*piVar13 + 0x1fc8),6,pEVar9,&VStack_20,&g_vectorZero); uVar11 = uVar11 + 1; pPVar17 = &g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar17->_playerList)._begin >> 2)); } } code_r0x006466b1: uVar23 = GetTimeNs(); uVar11 = (uint)(uVar23 >> 0x20); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82; pGStack_38 = (Game *)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar11 * 0x431bde82; auStack_30[0] = (uint)lVar5; lVar6 = (ulonglong)uVar11 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); apGStack_50[0] = (Game *)(lVar6 + lVar4); lVar5 = lVar5 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar6 >> 0x20), (int)pGStack_38->_roomList[0]._doors + (CARRY4((uint)lVar4,(uint)lVar6) - 0x30)), (int)((ulonglong)(lVar6 + lVar4) >> 0x20)); uVar16 = (uint)((ulonglong)lVar5 >> 0x20); uVar11 = (uint)lVar5 >> 0x12 | uVar16 * 0x4000; uVar12 = uVar11 - uStack_80; bVar18 = CARRY4((uint)g_entitySpawnTimeMs,uVar12); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar12; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar16 >> 0x12) - (int)apEStack_40[0]) - (uint)(uVar11 < uStack_80)) + (uint)bVar18; this = pRStack_5c; } pEStack_68[1]._sprite._flipX = (undefined1)uStack_6c; pEStack_68[1]._sprite._flipY = uStack_6c._1_1_; *(undefined2 *)&pEStack_68[1]._sprite.field_0x102 = uStack_6c._2_2_; uStack_6c = uStack_6c + 1; } while ((int)uStack_6c < 2); } else { fStack_60 = 0.0; do { Room::FindFreePickupSpawnPosition(g_game->_room,&VStack_20,pVStack_58,40.0,0,0,0); uVar11 = this->_seed; if (uVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar11 = this->_seed; if (uVar11 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } pGVar7 = g_game; uVar11 = uVar11 >> ((byte)this->_shift1 & 0x1f) ^ uVar11; uVar11 = uVar11 << ((byte)this->_shift2 & 0x1f) ^ uVar11; pGStack_38 = g_game; uStack_6c = uVar11 >> ((byte)this->_shift3 & 0x1f) ^ uVar11; uStack_80 = 3; this->_seed = uStack_6c; uStack_7c = 10; pGStack_78 = (Game *)&DAT_00000005; lua_callback_run_pre_entity_spawn ((int *)&pGStack_78,(int *)&uStack_7c,&VStack_20,&g_vectorZero,(Entity *)0x0 ,(int *)&uStack_80,&uStack_6c); type = pGStack_78; apGStack_50[0] = pGStack_78; if (1 < *(int *)&g_game->_deathmatchManager) { ItemPool::ReplaceBlacklistedPickup ((g_game->_deathmatchManager)._type,apGStack_50,&uStack_7c,&uStack_80); } pEStack_64 = EntityFactory::Create(pGVar7->_entityFactory,(uint)type,0); if (pEStack_64 != (Entity *)0x0) { uVar23 = GetTimeNs(); pEVar9 = pEStack_64; uVar11 = (uint)(uVar23 >> 0x20); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82; apEStack_48[0] = (EntityPtr *)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar11 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)((ulonglong)lVar5 >> 0x20); lVar4 = (ulonglong)uVar11 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4(uVar12,(uint)(&apEStack_48[0]->field_0x0 + CARRY4((uint)lVar4,(uint)lVar5))), &apEStack_48[0]->field_0x0 + CARRY4((uint)lVar4,(uint)lVar5) + uVar12); auStack_30[0] = (uint)((ulonglong)lVar4 >> 0x20); pEVar1 = &pEStack_64->_spawnerEntity; uStack_74 = (uint)lVar4 >> 0x12 | auStack_30[0] * 0x4000; auStack_30[0] = auStack_30[0] >> 0x12; pEStack_64->_spawnerType = 0; pEStack_64->_spawnerVariant = 0; if (*pEVar1 != (EntityPtr)0x0) { apEStack_40[0] = pEVar1; std::multiset::erase(apEStack_40); } iVar2 = *(int *)pEVar9; *pEVar1 = (EntityPtr)0x0; (pEVar9->_pos).x = VStack_20.x; (pEVar9->_pos).y = VStack_20.y; (pEVar9->_velocity).x = g_vectorZero.x; (pEVar9->_velocity).y = g_vectorZero.y; (**(code **)(iVar2 + 4))(pGStack_78,uStack_7c,uStack_80,uStack_6c); pGVar7 = pGStack_38; pvVar15 = pGStack_38->_room; iVar2 = *(int *)((int)pvVar15 + 0x1214); *(int *)((int)pvVar15 + 0x1214) = iVar2 + 1; pEVar9->_index = iVar2; EntityList::AddEntity((EntityList *)((int)pvVar15 + 0x1218),pEVar9); bVar10 = Game::ShouldEraseEnemy(pEVar9); if (bVar10 != 0) { Entity::RemoveWithPoof(pEVar9,unusedArg); } if ((pEVar9->_exists != 0) && ((pGVar7->_proceduralItemManager)._proceduralItems._begin != (pGVar7->_proceduralItemManager)._proceduralItems._end)) { iStack_14 = pEVar9->_variant; fVar19 = (float)pEVar9->_type; fStack_18 = fVar19; std::map::find(&pEStack_68,&fStack_18); if (pEStack_68 == (pGVar7->_proceduralItemManager)._spawnTriggerTargets._head) { VStack_10.y = -NAN; VStack_10.x = fVar19; piVar13 = (int *)std::map::find(auStack_24,&VStack_10); pEStack_68 = (Entity *)*piVar13; if (pEStack_68 == (pGVar7->_proceduralItemManager)._spawnTriggerTargets._head) goto code_r0x006462c1; } uVar11 = 0; pPVar17 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar17->_playerList)._begin >> 2 != 0) { do { pvVar15 = (pPVar17->_playerList)._end; if ((int)pvVar15 - (int)(pPVar17->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar15 = (pPVar17->_playerList)._end; } piVar13 = (pPVar17->_playerList)._begin; if (uVar11 < (uint)((int)pvVar15 - (int)piVar13 >> 2)) { piVar13 = piVar13 + uVar11; } trigger_set_dispatch ((void *)(*piVar13 + 0x1fc8),6,pEVar9,&VStack_20,&g_vectorZero); uVar11 = uVar11 + 1; pPVar17 = &g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar17->_playerList)._begin >> 2)); } } code_r0x006462c1: uVar23 = GetTimeNs(); uVar11 = (uint)(uVar23 >> 0x20); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82; apEStack_48[0] = (EntityPtr *)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar11 * 0x431bde82; pGStack_38 = (Game *)lVar5; lVar6 = (ulonglong)uVar11 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); apGStack_50[0] = (Game *)(lVar6 + lVar4); lVar5 = lVar5 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar6 >> 0x20), (uint)(&apEStack_48[0]->field_0x0 + CARRY4((uint)lVar4,(uint)lVar6))), (int)((ulonglong)(lVar6 + lVar4) >> 0x20)); uVar16 = (uint)((ulonglong)lVar5 >> 0x20); uVar11 = (uint)lVar5 >> 0x12 | uVar16 * 0x4000; uVar12 = uVar11 - uStack_74; bVar18 = CARRY4((uint)g_entitySpawnTimeMs,uVar12); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar12; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar16 >> 0x12) - auStack_30[0]) - (uint)(uVar11 < uStack_74)) + (uint)bVar18; this = pRStack_5c; } *(float *)&pEStack_64[1]._sprite._flipX = fStack_60; fStack_60 = (float)((int)fStack_60 + 1); } while ((int)fStack_60 < 3); } in_ECX = local_54; } else { Room::FindFreePickupSpawnPosition(g_game->_room,&VStack_10,pVStack_58,40.0,0,0,0); pGVar7 = g_game; uVar11 = RNG::Next(this); uVar11 = ItemPool::GetCollectible(&pGVar7->_itemPool,0,uVar11,0,0,0); uVar12 = RNG::Next(this); Game::SpawnEx(g_game,5,100,&VStack_10,&g_vectorZero,(Entity *)0x0,uVar11,uVar12,0); } } else { Room::FindFreePickupSpawnPosition(g_game->_room,&VStack_10,pVStack_58,40.0,0,0,0); pGVar7 = g_game; uVar11 = RNG::Next(this); uVar11 = ItemPool::GetCollectible(&pGVar7->_itemPool,4,uVar11,0,0,0); uVar12 = RNG::Next(this); Game::SpawnEx(g_game,5,100,&VStack_10,&g_vectorZero,(Entity *)0x0,uVar11,uVar12,0); } } goto LAB_00646759; case 3: if ((*(int *)((int)in_ECX + 0x7c) == 0) || (*(char *)((int)in_ECX + 0x8c) == '\0')) { ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"FloatDown",0); *(undefined4 *)((int)in_ECX + 0xd88) = 1; } LAB_00646759: *(float *)((int)in_ECX + 0x36c) = *(float *)((int)in_ECX + 0x36c) * 0.8; break; case 4: ANM2::Play((ANM2 *)((int)in_ECX + 0x48),(byte *)"Death",0); bVar10 = Sprite::IsEventTriggered((Sprite *)((int)in_ECX + 0x48),"Sound"); pMVar8 = g_manager; if ((bVar10 != 0) && (*(char *)((int)in_ECX + 0x171) != '\0')) { local_54 = 3.04082e-43; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&pMVar8->_sfxManager,(int)local_54,1.0,2,0,1.5,0.0); } if ((*(int *)((int)in_ECX + 0x7c) == 0) || (*(char *)((int)in_ECX + 0x8c) == '\0')) { *(undefined1 *)((int)in_ECX + 0x171) = 0; } *(float *)((int)in_ECX + 0x360) = g_vectorZero.x; *(float *)((int)in_ECX + 0x364) = g_vectorZero.y; } uVar14 = 0; *(undefined4 *)((int)in_ECX + 0x184) = 3; if (*(int *)((int)in_ECX + 0xd88) == 1) { uVar14 = 4; } *(undefined4 *)((int)in_ECX + 0x188) = uVar14; *(bool *)((int)in_ECX + 0x148) = 0.0 < *(float *)((int)in_ECX + 0x360); return; } //@@ 006468a0 FamiliarAI::lil_dumpy /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Familiar::Update case 0xd4 (variant 212); EvaluateItems CheckFamiliar(0xd4) from collectible 0x267 COLLECTIBLE_LIL_DUMPY; Game::ButterBeanFart on contact, Idle/IdleFast/IdleFaster */ void __fastcall FamiliarAI::lil_dumpy(Entity_Familiar *familiar) { float fVar1; float fVar2; Entity *pEVar3; byte bVar4; uint rngResult; Entity *pEVar5; undefined4 extraout_EAX; Vector *bounceVelocity; void *pvVar6; int iVar7; code *extraout_EDX; uint entityIdx; float fVar8; float fVar9; float fVar10; char *anim; Capsule playerCapsule [8]; float local_74; EntityList_EL nearbyEntities; float familiarX; Vector local_58; float local_50; float local_4c; Vector local_48; Color local_40; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Entity_Player *player; local_8 = -NAN; puStack_c = &LAB_00af70dd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&local_40)[1]._colorize; ExceptionList = &local_10; familiar->_entityGridCollisionClass = 3; Entity_Player::HasCollectible(familiar->_player,0xf7,0); if (familiar->_state == 0) { pvVar6 = familiar->_player; familiarX = (familiar->_pos).x; local_58.y = (familiar->_pos).y; local_4c = familiarX - *(float *)((int)pvVar6 + 0x33c); local_50 = local_58.y - *(float *)((int)pvVar6 + 0x340); fVar8 = sqrtf(local_50 * local_50 + local_4c * local_4c); fVar9 = local_4c; if (0.0 < fVar8) { fVar9 = local_4c * (10.0 / fVar8); local_50 = local_50 * (10.0 / fVar8); } fVar10 = *(float *)((int)pvVar6 + 0x33c) - familiarX; fVar8 = *(float *)((int)pvVar6 + 0x340) - local_58.y; local_48.y = *(float *)((int)pvVar6 + 0x340) + local_50; local_50 = *(float *)((int)pvVar6 + 0x33c) + fVar9; local_4c = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); pvVar6 = (familiar->_sprite)._animState._animData; if (((pvVar6 == (void *)0x0) || (*(char *)((int)pvVar6 + 0x34) != '\0')) || ((familiar->_sprite)._animState._isPlaying == 0)) { if (local_4c <= 80.0) { if (local_4c <= 40.0) { anim = (char *)s_Idle; } else { anim = "IdleFast"; } } else { anim = "IdleFaster"; } ANM2::Play(&familiar->_sprite,(byte *)anim,0); } if (10.0 < local_4c) { fVar9 = familiar->_speedMultiplier; fVar8 = ((local_4c - 10.0) / local_4c) * 0.2; if (fVar9 == 1.0) { fVar9 = 0.8; } else { fVar9 = 0.8 / ((fVar9 + 0.8) - fVar9 * 0.8); } fVar10 = (familiar->_pos).y; fVar1 = (familiar->_velocity).x; fVar2 = (familiar->_velocity).y; (familiar->_velocity).x = ((local_50 - (familiar->_pos).x) * fVar8 - fVar1) * (1.0 - fVar9) + fVar1; (familiar->_velocity).y = ((local_48.y - fVar10) * fVar8 - fVar2) * (1.0 - fVar9) + fVar2; } player = familiar->_player; if (((player->_entityCollisionClass != 0) && (player->_damageCooldown < 2)) && ((bVar4 = Entity_Player::HasInvincibility(player,0,(EntityRef *)0x0), bVar4 == 0 && (local_4c <= 100.0)))) { pvVar6 = familiar->_player; local_48.x = *(float *)((int)pvVar6 + 0x360) * *(float *)((int)pvVar6 + 0x36c) * *(float *)((int)pvVar6 + 0x39c) + *(float *)((int)pvVar6 + 0x33c); local_48.y = *(float *)((int)pvVar6 + 0x364) * *(float *)((int)pvVar6 + 0x36c) * *(float *)((int)pvVar6 + 0x39c) + *(float *)((int)pvVar6 + 0x340); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&local_48, *(float *)((int)pvVar6 + 0x370) + 150.0, (uint)(1 < *(int *)&g_game->_deathmatchManager) * 4 + 10); local_8 = 0.0; pEVar3 = familiar->_player; local_48.x = (pEVar3->_velocity).x * pEVar3->_friction * pEVar3->_speedMultiplier; local_48.y = (pEVar3->_velocity).y * pEVar3->_friction * pEVar3->_speedMultiplier; Entity::GetCollisionCapsule(pEVar3,playerCapsule,&local_48); rngResult = Random(); entityIdx = 0; local_74 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 10.0 + 10.0 + local_74; if (nearbyEntities._size != 0) { do { pEVar3 = *(Entity **)((int)nearbyEntities._data + entityIdx * 4); pEVar5 = Entity::GetPlayerAncestor((Entity *)familiar); bVar4 = Entity::IsDescendantOf(pEVar3,pEVar5); if (((bVar4 == 0) && (pEVar3->_dead == 0)) && (pEVar3->_entityCollisionClass != 0)) { if ((*(int *)&g_game->_deathmatchManager < 2) || (pEVar3->_type != 1)) { iVar7 = pEVar3->_type; if ((((0x3dd < iVar7 - 10U) && (iVar7 != 9)) && ((*(int *)&g_game->_deathmatchManager < 2 || (iVar7 != 2)))) || ((iVar7 == 0x21 && (pEVar3->_variant == 4)))) goto LAB_00646d6f; } else { iVar7 = 1; } if ((pEVar3->_flags & 0x20000000) == 0) { if (iVar7 == 9) { if ((pEVar3[1]._variant & 0x80000000U) == 0) goto LAB_00646d01; } else if (0.0 < pEVar3->_collisionDamage) { LAB_00646d01: local_48.x = pEVar3->_speedMultiplier * pEVar3->_friction * (pEVar3->_velocity).x; local_48.y = pEVar3->_speedMultiplier * pEVar3->_friction * (pEVar3->_velocity).y; Entity::GetCollisionCapsule(pEVar3,local_40._tint + 1,&local_48); local_58.y = 0.0; local_58.x = 0.0; bVar4 = Capsule::Collide(playerCapsule,(Capsule *)(local_40._tint + 1),&local_58); if (bVar4 != 0) { ANM2::Play(&familiar->_sprite,&DAT_00b1deb4,0); pEVar5 = familiar->_player; local_48.y = (pEVar5->_pos).y; local_48.x = (pEVar5->_pos).x; Game::ButterBeanFart(g_game,&local_48,120.0,pEVar5,0,1); local_50 = 1.0; bVar4 = Entity_Player::HasTrinket(familiar->_player,0x86,0); if (bVar4 != 0) { local_50 = 2.0; } rngResult = Random(); pEVar5 = Game::Spawn(g_game,1000,0x22,&familiar->_pos,&g_vectorZero,(Entity *)0x0, 0,rngResult); Color::Color(&local_40); (*extraout_EDX)(extraout_EAX,0xffffffff,0xff,0,1); fVar9 = local_50 * g_vectorOne.x; (pEVar5->_sprite)._scale.y = local_50 * g_vectorOne.y; (pEVar5->_sprite)._scale.x = fVar9; local_48.x = (familiar->_pos).x - (pEVar3->_pos).x; local_48.y = (familiar->_pos).y - (pEVar3->_pos).y; bounceVelocity = Vector::Resized(&local_48,&local_58,20.0); (familiar->_velocity).x = bounceVelocity->x; (familiar->_velocity).y = bounceVelocity->y; familiar->_state = 1; familiar->_fireCooldown = 0x2d; break; } } } } LAB_00646d6f: entityIdx = entityIdx + 1; } while (entityIdx < (uint)nearbyEntities._size); } local_8 = -NAN; if (nearbyEntities._0_1_ == '\0') { local_8 = 1.4013e-45; tracked_alloc(1,nearbyEntities._data,0); local_8 = -NAN; } } if (familiar->_state != 0) goto LAB_00646f6c; fVar9 = familiar->_friction * 0.8; } else { pvVar6 = (familiar->_sprite)._animState._animData; if ((pvVar6 == (void *)0x0) || ((familiar->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&familiar->_sprite,&DAT_00b607b4,0); pvVar6 = (familiar->_sprite)._animState._animData; if (pvVar6 != (void *)0x0) goto LAB_00647005; fVar9 = familiar->_friction; } else { LAB_00647005: fVar9 = familiar->_friction; if (*(char *)((int)pvVar6 + 0x34) != '\0') { familiar->_friction = fVar9 * 0.8; if (((familiar->_fireCooldown < 1) || (iVar7 = familiar->_fireCooldown + ((int)familiar->_prevUpdateTime - (int)familiar->_updateTime), familiar->_fireCooldown = iVar7, iVar7 < 1)) && (fVar9 = (familiar->_pos).x - *(float *)((int)familiar->_player + 0x33c), fVar8 = (familiar->_pos).y - *(float *)((int)familiar->_player + 0x340), fVar8 * fVar8 + fVar9 * fVar9 <= 2500.0)) { ANM2::Play(&familiar->_sprite,&DAT_00b607ac,0); familiar->_state = 0; } goto LAB_00646f6c; } } fVar9 = fVar9 * 0.95; } familiar->_friction = fVar9; LAB_00646f6c: fVar9 = (familiar->_velocity).x; (familiar->_sprite)._flipX = fVar9 < 0.0; fVar8 = (familiar->_velocity).y; fVar9 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); local_48.y = (fVar9 - 10.0) / 30.0; if (local_48.y <= 0.0) { local_48.y = 0.0; } if (1.0 <= local_48.y) { local_48.y = 1.0; } fVar9 = Entity_Familiar::apply_tear_modifiers(familiar); familiar->_collisionDamage = fVar9 * (local_48.y * 25.0 + 0.0); ExceptionList = local_10; return; } //@@ 006470c0 Entity_Familiar::get_item_config_entry /* DB: ? calls ItemConfig collectible 0xd0 vector lookup */ void __thiscall Entity_Familiar::get_item_config_entry(Entity_Familiar *this) { if (this->_variant == 0xe7) { ItemConfig::get_wisp_entry(this->_subtype,this->_coins); return; } ItemConfig::get_wisp_entry(0x19,0); return; } //@@ 006470f0 ItemConfig::get_wisp_entry /* DB: ? collectible+0xd0 vector of 0xb8 entries indexed by EDX, default item fallback prototype: db/protos.zhl */ void * __fastcall ItemConfig::get_wisp_entry(int collectibleId,int index) { void *pvVar1; int iVar2; Manager *pMVar3; ItemConfig_Item *pIVar4; int iVar5; pMVar3 = g_manager; pIVar4 = GetCollectible(&g_manager->_itemConfig,collectibleId); if (pIVar4 != (ItemConfig_Item *)0x0) { iVar5 = *(int *)pIVar4[1].name._buf - pIVar4[1].id; iVar2 = iVar5 >> 0x1f; if (iVar5 / 0xb8 + iVar2 != iVar2) { return (void *)(index * 0xb8 + pIVar4[1].id); } } pvVar1 = (pMVar3->_itemConfig)._collectibles._begin; if ((int)((int)(pMVar3->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) < 0x65) { return pvRam000000d0; } return *(void **)(*(int *)((int)pvVar1 + 100) + 0xd0); } //@@ 00647170 Entity_Familiar::abyss_locust_eat /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? KAGE_LogMessage "This should only be called on a locust" unless variant 0xe7 (231 Abyss Locust); dynamic_cast ExtraData -> AbyssLocustData, increments hunger byte +0x50 up to 25 and every 5 swaps the spritesheet "hungry_%d.png"; Entity_Pickup::HandleCollision */ undefined4 __thiscall Entity_Familiar::abyss_locust_eat(Entity_Familiar *this) { uint uVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; byte bVar5; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte *pbVar6; void *pvVar7; void *local_64; char acStack_60 [4]; char acStack_5c [4]; char acStack_58 [8]; uint uStack_50; void *local_4c [4]; undefined4 local_3c; uint local_38; byte local_34 [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af7125; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_14 = uVar1; if (this->_variant != 0xe7) { KAGE_LogMessage(0x10,(byte *)"This should only be called on a locust\n"); } iVar2 = __RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0,uVar1); if (*(byte *)(iVar2 + 0x50) < 0x19) { bVar5 = *(byte *)(iVar2 + 0x50) + 1; *(byte *)(iVar2 + 0x50) = bVar5; if ((uint)bVar5 % 5 == 1) { sprintf(local_34,(byte *)"hungry_%d.png"); std::string::string((char *)local_4c,&(g_manager->_itemConfig)._wispGfxRoot); pbVar6 = local_34; local_8 = 0; do { bVar5 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar5 != 0); puVar3 = std::string::append((char *)local_4c,local_34,(int)pbVar6 - (int)(local_34 + 1)); local_64 = (void *)*puVar3; acStack_60 = (char [4])puVar3[1]; acStack_5c = (char [4])puVar3[2]; acStack_58._0_4_ = puVar3[3]; unique0x0000a400 = *(undefined8 *)(puVar3 + 4); puVar3[4] = 0; puVar3[5] = 0xf; *(undefined1 *)puVar3 = 0; local_8._0_1_ = 1; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,(std_string *)&local_64); local_8 = (uint)local_8._1_3_ << 8; bVar5 = extraout_CL; if (0xf < uStack_50) { uVar1 = uStack_50 + 1; pvVar7 = local_64; if (0xfff < uVar1) { pvVar7 = *(void **)((int)local_64 + -4); uVar1 = uStack_50 + 0x24; if (0x1f < (uint)((int)local_64 + (-4 - (int)pvVar7))) goto LAB_006472d2; } operator_delete(pvVar7,uVar1); bVar5 = extraout_CL_00; } local_8 = -1; if (0xf < local_38) { uVar1 = local_38 + 1; pvVar7 = local_4c[0]; if (0xfff < uVar1) { pvVar7 = *(void **)((int)local_4c[0] + -4); uVar1 = local_38 + 0x24; if (0x1f < (uint)((int)local_4c[0] + (-4 - (int)pvVar7))) { LAB_006472d2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar1); bVar5 = extraout_CL_01; } local_3c = 0; local_38 = 0xf; local_4c[0] = (void *)((uint)local_4c[0] & 0xffffff00); ANM2::LoadGraphics(&this->_sprite,bVar5); } uVar4 = 1; } else { uVar4 = 0; } ExceptionList = local_10; return uVar4; } //@@ 00647320 FamiliarAI::apollyons_best_friend /* DB: Entity_Familiar::Update case 0xe7 (variant 231); EvaluateItems: CheckFamiliar(0xe7, GetTrinketMultiplier(0xba)) with trinket 186 TRINKET_APOLLYONS_BEST_FRIEND; CanBlockProjectiles, TryAimAtMarkedTarget, HitListContains */ void __fastcall FamiliarAI::apollyons_best_friend(Entity_Familiar *familiar) { byte bVar1; void *pvVar2; float *pfVar3; int iVar4; Vector *pVVar5; Vector *normalizedDir; void *pvVar6; BitSet128 *maskedFlags; EntityRef *pEVar7; uint uVar8; int collectibleId; int iVar9; int *familiarList; code *extraout_EDX; int *piVar10; Entity *nearbyEntity; float fVar11; float fVar12; float dy; float fVar13; BitSet128 flagsResult; EntityRef sourceRef; EntityList_EL nearbyList; Vector local_58; undefined1 local_50 [8]; Vector local_48; undefined1 local_40 [12]; float local_34; int locustData; void *local_2c; Vector local_28; void *local_20; Vector local_1c; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Familiar *otherFamiliar; code *takeDamageFn; EntityPtr target; EntityPtr *targetSlot; local_8 = 0xffffffff; puStack_c = &LAB_00af717d; local_10 = ExceptionList; ExceptionList = &local_10; local_58.y = (float)familiar; locustData = __RTDynamicCast(familiar->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData:: RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0, __security_cookie ^ (uint)(local_40 + 0x3c)); *(uint *)&familiar->_flags = (uint)familiar->_flags | 0x44000000; iVar4 = familiar->_state; *(undefined4 *)((int)&familiar->_flags + 4) = *(undefined4 *)((int)&familiar->_flags + 4); if (iVar4 < 1) { if (familiar->_variant == 0xe7) { iVar9 = familiar->_coins; collectibleId = familiar->_subtype; } else { collectibleId = 0x19; iVar9 = 0; } pvVar2 = ItemConfig::get_wisp_entry(collectibleId,iVar9); local_20 = pvVar2; if (familiar->_fireCooldown < 0) { familiar->_state = -1; Entity_Familiar::break_grid_ahead(familiar); fVar12 = 0.8; local_2c = (void *)0x4e6e6b28; if (familiar->_fireCooldown == -1) { maskedFlags = BitSet128::operator_and (&flagsResult,(BitSet128 *)((int)pvVar2 + 8),&g_tearFlagHoming); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { if (familiar->_target == (EntityPtr)0x0) { bVar1 = Entity::IsFrame((Entity *)familiar,4,familiar->_index); if (bVar1 != 0) { local_14 = 1e+09; local_48.x = (familiar->_velocity).x * 5.0 + (familiar->_pos).x; local_28.y = 0.0; local_48.y = (familiar->_velocity).y * 5.0 + (familiar->_pos).y; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyList,&local_48,128.0,8); pvVar2 = (void *)0x0; local_8 = 0; nearbyEntity = (Entity *)0x0; if ((void *)nearbyList._size != (void *)0x0) { do { nearbyEntity = *(Entity **)((int)nearbyList._data + (int)pvVar2 * 4); bVar1 = Entity::IsVulnerableEnemy(nearbyEntity,(Entity *)0x0); if ((((bVar1 != 0) && ((nearbyEntity->_flags & 0x20000010) == 0)) && (bVar1 = EntityList::HitListContains ((EntityList *)&familiar->_hitList,nearbyEntity), bVar1 == 0)) && (uVar8 = Random(), (uVar8 & 1) != 0)) { if (familiar->_entityGridCollisionClass == 4) { local_34 = (nearbyEntity->_pos).y; local_40._8_4_ = (nearbyEntity->_pos).x; bVar1 = Room::CheckLine(g_game->_room,&familiar->_pos,(Vector *)(local_40 + 8) ,3,0,0,0,(Vector *)0x0); if (bVar1 == 0) goto LAB_00647c73; } fVar11 = (nearbyEntity->_pos).x - ((familiar->_velocity).x * 5.0 + (familiar->_pos).x); fVar12 = (nearbyEntity->_pos).y - ((familiar->_velocity).y * 5.0 + (familiar->_pos).y); local_1c.y = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); uVar8 = Random(); fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 128.0 + local_1c.y; bVar1 = EntityList::HitListContains ((EntityList *)&familiar->_hitList,nearbyEntity); if (bVar1 != 0) { fVar12 = fVar12 + 1000.0; } if (fVar12 < local_14) { local_28.y = (float)nearbyEntity; local_14 = fVar12; } } LAB_00647c73: pvVar2 = (void *)((int)pvVar2 + 1); nearbyEntity = (Entity *)local_28.y; } while (pvVar2 < (uint)nearbyList._size); } targetSlot = &familiar->_target; if (familiar->_target != (EntityPtr)0x0) { local_1c.y = (float)targetSlot; std::multiset::erase(&local_1c.y); } *(Entity **)&targetSlot->field_0x0 = nearbyEntity; if (nearbyEntity != (Entity *)0x0) { std::multiset::insert(targetSlot); } local_8 = 0xffffffff; if (nearbyList._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,nearbyList._data,0); local_8 = 0xffffffff; } } fVar12 = 0.8; } target = familiar->_target; if (target != (EntityPtr)0x0) { local_34 = (familiar->_pos).y - *(float *)((int)target + 0x340); local_40._8_4_ = (familiar->_pos).x - *(float *)((int)target + 0x33c); local_1c.y = (familiar->_velocity).x * fVar12; local_14 = (familiar->_velocity).y * fVar12; pVVar5 = Vector::Normalized((Vector *)(local_40 + 8),&local_48); fVar12 = familiar->_speedMultiplier * pVVar5->x; fVar11 = familiar->_speedMultiplier * pVVar5->y; local_40._8_4_ = local_1c.y - (fVar12 + fVar12); fVar12 = (familiar->_velocity).y; local_34 = local_14 - (fVar11 + fVar11); fVar11 = (familiar->_velocity).x; fVar12 = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); pVVar5 = Vector::Resized((Vector *)(local_40 + 8),&local_28,fVar12); (familiar->_velocity).x = pVVar5->x; (familiar->_velocity).y = pVVar5->y; } } if ((*(uint *)(locustData + 0x18) & 0x40000) != 0) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_40, &familiar->_pos,familiar->_size,0x10); local_8 = 2; fVar12 = 0.0; if (local_34 != 0.0) { iVar4 = g_forceCollideDepth; fVar11 = local_34; do { piVar10 = *(int **)(local_40._4_4_ + (int)fVar12 * 4); if (piVar10 != (int *)0x0) { if (piVar10[10] == 5) { iVar9 = piVar10[0xb]; if (((((iVar9 != 10) && (iVar9 != 0x14)) && ((iVar9 != 0x5a && ((iVar9 != 0x28 && (iVar9 != 0x1e)))))) && (iVar9 != 0x46) ) && ((((iVar9 != 300 && (iVar9 != 0x15e)) && (iVar9 != 0x45)) && (iVar9 != 0x29)))) { if (iVar9 != 0x2a) goto LAB_00647e96; } if (piVar10[0x14d] == 0) { g_forceCollideDepth = iVar4 + 1; (**(code **)(*(int *)familiar + 0x5c))(piVar10,1); (**(code **)(*piVar10 + 0x5c))(familiar,0); iVar4 = g_forceCollideDepth + -1; fVar11 = local_34; g_forceCollideDepth = iVar4; } } } LAB_00647e96: fVar12 = (float)((int)fVar12 + 1); } while ((uint)fVar12 < (uint)fVar11); } local_8 = 0xffffffff; if (local_40[0] == '\0') { local_8 = 3; tracked_alloc(1,(void *)local_40._4_4_,0); local_8 = 0xffffffff; } } } if (familiar->_collidesWithGrid == 0) { LAB_00647f5f: if (((familiar->_subtype == 6) && (fVar12 = *(float *)((int)familiar->_player + 0x340) - (familiar->_pos).y, fVar11 = *(float *)((int)familiar->_player + 0x33c) - (familiar->_pos).x, fVar12 = sqrtf(fVar12 * fVar12 + fVar11 * fVar11), 100.0 < fVar12)) || (familiar->_fireCooldown < -1)) goto LAB_00647fb2; } else { local_14 = (familiar->_gridCollisionVelocity).x; local_1c.y = (familiar->_gridCollisionVelocity).y; fVar12 = sqrtf(local_14 * local_14 + local_1c.y * local_1c.y); if (fVar12 <= 0.0) { fVar11 = local_14; pVVar5 = (Vector *)local_1c.y; } else { fVar11 = (familiar->_gridCollisionVelocity).x * (1.0 / fVar12); pVVar5 = (Vector *)((familiar->_gridCollisionVelocity).y * (1.0 / fVar12)); } if ((float)pVVar5 * (familiar->_gridCollisionNormal).y + fVar11 * (familiar->_gridCollisionNormal).x <= 0.3) goto LAB_00647f5f; LAB_00647fb2: familiar->_entityGridCollisionClass = 0; local_1c.y = (float)g_game->_room; iVar9 = (int)(((familiar->_pos).x - 40.0) / 40.0 + 0.5); iVar4 = (int)(((familiar->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar9 < 0) || ((int)((std_multiset *)((int)local_1c.y + 8))->_size <= iVar9)) || ((iVar4 < 0 || ((int)((Vector *)((int)local_1c.y + 0x10))->x <= iVar4)))) { EntityRef::constructor(&sourceRef,familiar->_player); } else { uVar8 = ((std_multiset *)((int)local_1c.y + 8))->_size * iVar4 + iVar9; EntityRef::constructor(&sourceRef,familiar->_player); if ((uVar8 < 0x1c0) && ((int *)((int *)((int)local_1c.y + 0x20))[uVar8 + 1] != (int *)0x0) ) { (**(code **)(*(int *)((int *)((int)local_1c.y + 0x20))[uVar8 + 1] + 0x10))(1,&sourceRef) ; } } if (((familiar->_targetPosition).x == g_vectorZero.x) && ((familiar->_targetPosition).y == g_vectorZero.y)) { pVVar5 = (Vector *)(locustData + 0x4c); if (pVVar5->x != 0.0) { pEVar7 = EntityRef::EntityRef(&sourceRef); (*extraout_EDX)(pEVar7); if (pVVar5->x != 0.0) { local_1c.y = (float)pVVar5; std::multiset::erase(&local_1c.y); pVVar5->x = 0.0; } } (familiar->_velocity).x = (familiar->_velocity).x * 0.8; (familiar->_velocity).y = (familiar->_velocity).y * 0.8; familiar->_fireCooldown = familiar->_fireCooldown + -1; if (familiar->_fireCooldown < -10) { familiar->_fireCooldown = 0x1e; (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; Entity_Familiar::load_config_graphics(familiar); } } else { target = familiar->_target; targetSlot = &familiar->_target; if (target != (EntityPtr)0x0) { fVar12 = *(float *)((int)target + 0x340); (familiar->_targetPosition).x = *(float *)((int)target + 0x33c); (familiar->_targetPosition).y = fVar12; } if ((*(int *)((int)familiar->_player + 0x162c) == -1) || (familiar->_fireCooldown < -0xf)) { (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; } else { (familiar->_velocity).x = (familiar->_velocity).x * 0.86; (familiar->_velocity).y = (familiar->_velocity).y * 0.86; if (-0x10 < familiar->_fireCooldown) { familiar->_fireCooldown = familiar->_fireCooldown + -1; } if (*(int *)&targetSlot->field_0x0 == 0) { LAB_0064821e: uVar8 = Random(); if ((Entity *)(uVar8 & 1) == (Entity *)0x0) { local_28.y = (float)(uVar8 & 1); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyList,&familiar->_pos, 50.0,8); pvVar2 = (void *)0x0; local_8 = 4; if ((void *)nearbyList._size != (void *)0x0) { do { nearbyEntity = *(Entity **)((int)nearbyList._data + (int)pvVar2 * 4); bVar1 = Entity::IsVulnerableEnemy(nearbyEntity,(Entity *)0x0); if ((bVar1 != 0) && ((nearbyEntity->_flags & 0x20000010) == 0)) { fVar12 = (nearbyEntity->_pos).y - (familiar->_pos).y; fVar11 = (nearbyEntity->_pos).x - (familiar->_pos).x; local_1c.y = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); uVar8 = Random(); pvVar6 = (void *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 128.0 + local_1c.y); if ((float)pvVar6 < (float)local_2c) { local_2c = pvVar6; local_28.y = (float)nearbyEntity; } } pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < (uint)nearbyList._size); targetSlot = &familiar->_target; if ((Entity *)local_28.y != (Entity *)0x0) { if (*(int *)&targetSlot->field_0x0 != 0) { local_1c.y = (float)targetSlot; std::multiset::erase(&local_1c.y); } *(float *)&targetSlot->field_0x0 = local_28.y; std::multiset::insert(targetSlot); } } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&nearbyList); } } else if (*(char *)(*(int *)&targetSlot->field_0x0 + 0x173) != '\0') { local_1c.y = (float)targetSlot; std::multiset::erase(&local_1c.y); *(undefined4 *)&targetSlot->field_0x0 = 0; goto LAB_0064821e; } if (familiar->_target != (EntityPtr)0x0) { familiar->_fireCooldown = -2; } pVVar5 = MusicManager::RandomVector(&local_48); local_40._8_4_ = ((familiar->_targetPosition).x - (familiar->_pos).x) * 0.02 + pVVar5->x ; local_34 = ((familiar->_targetPosition).y - (familiar->_pos).y) * 0.02 + pVVar5->y; pVVar5 = Vector::Normalized((Vector *)(local_40 + 8),&local_1c); uVar8 = Random(); fVar12 = familiar->_speedMultiplier; fVar13 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 0.5; fVar11 = pVVar5->x; (familiar->_velocity).y = fVar13 * pVVar5->y * fVar12 + (familiar->_velocity).y; (familiar->_velocity).x = fVar13 * fVar11 * fVar12 + (familiar->_velocity).x; } } } maskedFlags = BitSet128::operator_and (&flagsResult,(BitSet128 *)(locustData + 8),(BitSet128 *)&DAT_00c34920 ); pvVar2 = local_20; if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { maskedFlags = BitSet128::operator_and ((BitSet128 *)local_40,(BitSet128 *)((int)local_20 + 8), (BitSet128 *)&DAT_00c34920); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { pfVar3 = *(float **)((int)pvVar2 + 0x68); if (pfVar3 != *(float **)((int)pvVar2 + 0x6c)) { do { maskedFlags = BitSet128::operator_and ((BitSet128 *)local_50,(BitSet128 *)(pfVar3 + 2), (BitSet128 *)&DAT_00c34920); if (((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (*pfVar3 != 0.0)) && (uVar8 = Random(), (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 < *pfVar3)) goto LAB_0064851e; pfVar3 = pfVar3 + 0x1a; } while (pfVar3 != *(float **)((int)pvVar2 + 0x6c)); } } else { LAB_0064851e: EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyList,&familiar->_pos, familiar->_size * 3.0 + 100.0,0xffffffff); local_8 = 5; local_20 = (void *)0x0; if ((void *)nearbyList._size != (void *)0x0) { do { nearbyEntity = *(Entity **)((int)nearbyList._data + (int)local_20 * 4); bVar1 = Entity::IsVulnerableEnemy(nearbyEntity,(Entity *)0x0); if ((bVar1 != 0) && ((familiar->_spawnerEntity == (EntityPtr)0x0 || (bVar1 = Entity::IsDescendantOf((Entity *)familiar->_spawnerEntity,nearbyEntity), bVar1 == 0)))) { fVar11 = nearbyEntity->_size + familiar->_size; dy = (familiar->_pos).y - (nearbyEntity->_pos).y; fVar13 = familiar->_size * 4.0 + nearbyEntity->_size; fVar12 = (familiar->_pos).x - (nearbyEntity->_pos).x; fVar12 = dy * dy + fVar12 * fVar12; if ((fVar11 * fVar11 < fVar12) && (fVar12 < fVar13 * fVar13)) { takeDamageFn = *(code **)(*(int *)nearbyEntity + 0x20); EntityRef::constructor(&sourceRef,(Entity *)familiar); (*takeDamageFn)(0x40000000,0,0,&sourceRef,0x1e); } } local_20 = (void *)((int)local_20 + 1); } while (local_20 < (uint)nearbyList._size); } local_8 = 0xffffffff; if (nearbyList._0_1_ == '\0') { local_8 = 6; tracked_alloc(1,nearbyList._data,0); local_8 = 0xffffffff; } } } if ((*(uint *)(locustData + 0x18) & 0x200) != 0) { local_1c.y = (float)&familiar->_pos; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_40, (Vector *)local_1c.y,40.0,2); fVar12 = local_1c.y; iVar4 = 0; local_8 = 7; if (0 < (int)local_34) { do { iVar9 = *(int *)(local_40._4_4_ + iVar4 * 4); local_2c = (void *)(*(float *)(iVar9 + 0x340) - (float)*(EntityPtr *)((int)fVar12 + 4)); local_20 = (void *)(*(float *)(iVar9 + 0x33c) - *(float *)fVar12); local_14 = (float)local_2c * (float)local_2c + (float)local_20 * (float)local_20; local_1c.y = sqrtf(local_14); local_28.y = *(float *)(iVar9 + 0x360); local_48.y = *(float *)(iVar9 + 0x364); uVar8 = Random(); local_1c.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * (80.0 - local_1c.y) * 0.1 + 0.05; fVar11 = sqrtf(local_14); if (fVar11 <= 0.0) { pvVar2 = local_20; pvVar6 = local_2c; } else { pvVar2 = (void *)((local_1c.y / fVar11) * (float)local_20); pvVar6 = (void *)((local_1c.y / fVar11) * (float)local_2c); } iVar9 = *(int *)(local_40._4_4_ + iVar4 * 4); iVar4 = iVar4 + 1; *(float *)(iVar9 + 0x360) = local_28.y + (float)pvVar2; *(float *)(iVar9 + 0x364) = local_48.y + (float)pvVar6; } while (iVar4 < (int)local_34); familiar = (Entity_Familiar *)local_58.y; } local_8 = 0xffffffff; if (local_40[0] == '\0') { local_8 = 8; tracked_alloc(1,(void *)local_40._4_4_,0); local_8 = 0xffffffff; } } familiar->_entityGridCollisionClass = 3; familiar->_entityCollisionClass = 4; goto LAB_0064881f; } if (iVar4 == -1) { fVar12 = (familiar->_pos).y - *(float *)((int)familiar->_player + 0x340); fVar11 = (familiar->_pos).x - *(float *)((int)familiar->_player + 0x33c); fVar12 = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); if (fVar12 < 100.0) { familiar->_state = 0; goto LAB_0064745f; } LAB_006475f0: local_28.y = *(float *)((int)familiar->_player + 0x340) - (familiar->_pos).y; local_14 = *(float *)((int)familiar->_player + 0x33c) - (familiar->_pos).x; fVar12 = sqrtf(local_28.y * local_28.y + local_14 * local_14); if (fVar12 < 0.1) { fVar12 = 0.0; } else { local_2c = (void *)0x40c00000; local_1c.y = fVar12 * 0.15; pfVar3 = &local_1c.y; if (6.0 <= (float)(fVar12 * 0.15)) { pfVar3 = (float *)&local_2c; } fVar12 = *pfVar3 / fVar12; } (familiar->_velocity).x = local_14 * fVar12 + (familiar->_velocity).x; (familiar->_velocity).y = local_28.y * fVar12 + (familiar->_velocity).y; familiar->_friction = familiar->_friction * 0.8; } else { if (iVar4 != 0) goto LAB_006475f0; LAB_0064745f: (familiar->_velocity).x = (familiar->_velocity).x * 0.86; (familiar->_velocity).y = (familiar->_velocity).y * 0.86; uVar8 = Random(); fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2c = (void *)(fVar12 + fVar12); local_28.y = sin((float)local_2c); local_14 = (*(float *)((int)familiar->_player + 0x33c) - (familiar->_pos).x) * 0.02; local_1c.y = (*(float *)((int)familiar->_player + 0x340) - (familiar->_pos).y) * 0.02; fVar12 = cos((float)local_2c); local_14 = fVar12 + local_14; local_28.y = local_28.y + local_1c.y; fVar12 = sqrtf(local_14 * local_14 + local_28.y * local_28.y); if (0.0 < fVar12) { local_14 = (1.0 / fVar12) * local_14; local_28.y = local_28.y * (1.0 / fVar12); } uVar8 = Random(); fVar12 = familiar->_speedMultiplier; fVar11 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 0.5; (familiar->_velocity).x = local_14 * fVar11 * fVar12 + (familiar->_velocity).x; (familiar->_velocity).y = local_28.y * fVar11 * fVar12 + (familiar->_velocity).y; } iVar4 = familiar->_fireCooldown; if (iVar4 < 1) { LAB_006476de: if ((iVar4 == 0) && (iVar4 = *(int *)((int)familiar->_player + 0x162c), iVar4 != -1)) { Isaac::GetAxisAlignedUnitVectorFromDir(&local_48,iVar4); bVar1 = Entity_Familiar::TryAimAtMarkedTarget (familiar,&local_48,(int *)&local_58.y,(Vector *)0x0); local_1c.y = *(float *)((int)local_20 + 0x74) * 10.0; Room::GetClampedPositionImpl(g_game->_room,&local_58,&familiar->_pos,5.0,5.0,5.0,5.0); (familiar->_pos).x = local_58.x; (familiar->_pos).y = local_58.y; familiar->_friction = 1.0; (familiar->_velocity).x = local_48.x * local_1c.y; (familiar->_velocity).y = local_48.y * local_1c.y; *(undefined4 *)(locustData + 0x3c) = 0xffffffff; if (bVar1 == 0) { fVar12 = *(float *)((int)familiar->_player + 0x360) * 0.6; fVar11 = *(float *)((int)familiar->_player + 0x364) * 0.6; local_20 = (void *)(fVar12 + fVar12); local_1c.y = fVar11 + fVar11; pVVar5 = Vector::Normalized(&local_48,(Vector *)(local_40 + 8)); normalizedDir = Vector::Normalized(&local_48,&local_58); fVar11 = local_1c.y * normalizedDir->y + (float)local_20 * normalizedDir->x; fVar13 = fVar11 * pVVar5->y; fVar11 = fVar11 * pVVar5->x; pvVar2 = local_20; fVar12 = local_1c.y; if (fVar11 * local_48.x + fVar13 * local_48.y < 0.0) { pvVar2 = (void *)((float)local_20 - fVar11); fVar12 = local_1c.y - fVar13; } (familiar->_velocity).x = (float)pvVar2 + (familiar->_velocity).x; (familiar->_velocity).y = fVar12 + (familiar->_velocity).y; } pvVar2 = ThreadLocalStoragePointer; familiar->_state = -1; familiar->_fireCooldown = -1; if ((*(int *)(*(int *)pvVar2 + 0xc) < DAT_00c7fff8) && (_Init_thread_header(&DAT_00c7fff8), DAT_00c7fff8 == -1)) { _atexit((_func_4879 *)&LAB_00b155a0); _Init_thread_footer(&DAT_00c7fff8); } piVar10 = DAT_00c7fffc; DAT_00c80000 = DAT_00c7fffc; local_1c.y = (float)Entity_Familiar::get_item_config_entry(familiar); local_14 = 0.0; local_2c = g_game->_room; if (*(int *)((int)local_2c + 0x1264) != 0) { do { pvVar2 = *(void **)(*(int *)((int)local_2c + 0x125c) + (int)local_14 * 4); if (pvVar2 != (void *)0x0) { if (*(int *)((int)pvVar2 + 0x28) == 3) { local_20 = pvVar2; if (*(void **)((int)pvVar2 + 0x410) == familiar->_player) { if (*(int *)((int)pvVar2 + 0x2c) == familiar->_variant) { if (*(int *)((int)pvVar2 + 0x2c) == 0xe7) { iVar4 = *(int *)((int)pvVar2 + 0x30); iVar9 = *(int *)((int)pvVar2 + 0xd7c); } else { iVar4 = 0x19; iVar9 = 0; } pvVar6 = ItemConfig::get_wisp_entry(iVar4,iVar9); if (((((RNG *)((int)local_1c.y + 0x18))->_seed & 4) == 0) || ((*(byte *)((int)pvVar6 + 0x18) & 4) == 0)) { if (piVar10 == DAT_00c80004) { std::vector<4byte>::_Emplace_reallocate(piVar10,&local_20); piVar10 = DAT_00c80000; } else { *piVar10 = (int)pvVar2; DAT_00c80000 = DAT_00c80000 + 1; piVar10 = DAT_00c80000; } } } } } } local_14 = (float)((int)local_14 + 1); } while ((uint)local_14 < (uint)*(float *)((int)local_2c + 0x1264)); if (DAT_00c7fffc != piVar10) { iVar4 = (int)piVar10 - (int)DAT_00c7fffc >> 2; fVar12 = (float)(10 - (iVar4 - ((int)piVar10 - (int)DAT_00c7fffc >> 0x1f) >> 1)); local_14 = 4.2039e-45; if (3 < (int)fVar12) { local_14 = fVar12; } uVar8 = 0; if (iVar4 != 0) { familiarList = DAT_00c7fffc; do { otherFamiliar = (Entity_Familiar *)familiarList[uVar8]; if (otherFamiliar != familiar) { if (-1 < otherFamiliar->_fireCooldown) { if (otherFamiliar->_fireCooldown < (int)local_14) { otherFamiliar->_fireCooldown = (int)local_14; familiarList = DAT_00c7fffc; piVar10 = DAT_00c80000; } } } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)piVar10 - (int)familiarList >> 2)); } } } Entity_NPC::HandleCollision((Entity_NPC *)familiar); } } else if (familiar->_state == 0) { iVar4 = iVar4 + -1; familiar->_fireCooldown = iVar4; goto LAB_006476de; } familiar->_entityGridCollisionClass = 0; } else { familiar->_state = iVar4 + -1; familiar->_entityCollisionClass = 0; familiar->_friction = familiar->_friction * 0.96; if (iVar4 + -1 != 0) goto LAB_0064881f; } bVar1 = Entity_Familiar::CanBlockProjectiles(familiar); familiar->_entityCollisionClass = (uint)bVar1 << 2; LAB_0064881f: iVar4 = locustData; if (*(int **)(locustData + 0x4c) != (int *)0x0) { local_58.y = *(float *)((int)familiar->_player + 0x340) - (familiar->_pos).y; local_48.y = *(float *)((int)familiar->_player + 0x33c) - (familiar->_pos).x; (**(code **)(**(int **)(locustData + 0x4c) + 0x40))(familiar->_collisionDamage * 0.5); iVar9 = *(int *)(iVar4 + 0x4c); fVar12 = (familiar->_sprite)._scale.y * 0.5 * g_vectorOne.y; *(float *)(iVar9 + 0xe4) = (familiar->_sprite)._scale.x * 0.5 * g_vectorOne.x; *(float *)(iVar9 + 0xe8) = fVar12; fVar12 = (familiar->_sprite)._scale.y; iVar9 = *(int *)(iVar4 + 0x4c); fVar11 = (familiar->_posOffset).y; *(float *)(iVar9 + 0x34c) = (familiar->_sprite)._scale.x * 0.0 + (familiar->_posOffset).x; *(float *)(iVar9 + 0x350) = fVar11 - fVar12 * 24.0; sqrtf(local_58.y * local_58.y + local_48.y * local_48.y); uVar8 = __ftoui3(); *(float *)(*(int *)(iVar4 + 0x4c) + 0x438) = (float)(uVar8 % 0x168) + 0.0; } ExceptionList = local_10; return; } //@@ 006489a0 Entity_NPC::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0064914b) */ /* WARNING: Removing unreachable block (ram,0x00649169) */ /* WARNING: Removing unreachable block (ram,0x00649176) */ /* WARNING: Removing unreachable block (ram,0x0064915f) */ /* ZHL [prefix46/55] __thiscall bool Entity_NPC::HandleCollision(Entity* collider, bool low); */ void __thiscall Entity_NPC::HandleCollision(Entity_NPC *this) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; qword qVar4; int iVar5; uint uVar6; void *pvVar7; int iVar8; ANM2 *other; ANM2 *other_00; ANM2 *other_01; ANM2 *other_02; EntityPtr knife; BitSet128 *knifeFlags; float *effectEntry; EntityPtr *knifeSlot; float fVar9; BitSet128 local_178; BitSet128 local_168; int entryIndex; uint appliedMask; EntityPtr *local_150; void *wispEntry; int locustData; Entity_NPC *familiar; ANM2 tmpSprite; void *tmpString [2]; BitSet128 local_24; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; int *spriteVectorBegin; ANM2 *spriteVectorEnd; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af7201; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(tmpString + 10); ExceptionList = &local_10; if (this->_variant == 0xe7) { fVar9 = (this->_statusEffectSprite)._rotation; iVar8 = this->_subtype; } else { iVar8 = 0x19; fVar9 = 0.0; } familiar = this; local_14 = uVar6; pvVar7 = ItemConfig::get_wisp_entry(iVar8,(int)fVar9); wispEntry = pvVar7; iVar8 = __RTDynamicCast((this->_chargeBarSprite)._championColor._offset[0],0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0,uVar6); uVar1 = *(undefined4 *)((int)pvVar7 + 0xc); uVar2 = *(undefined4 *)((int)pvVar7 + 0x10); uVar3 = *(undefined4 *)((int)pvVar7 + 0x14); local_150 = (EntityPtr *)(iVar8 + 8); *local_150 = *(EntityPtr *)((int)pvVar7 + 8); *(undefined4 *)(iVar8 + 0xc) = uVar1; *(undefined4 *)(iVar8 + 0x10) = uVar2; *(undefined4 *)(iVar8 + 0x14) = uVar3; *(undefined4 *)(iVar8 + 0x18) = *(undefined4 *)((int)pvVar7 + 0x18); spriteVectorBegin = (int *)(iVar8 + 0x24); locustData = iVar8; ANM2::constructor(&tmpSprite); local_8 = (void *)0x0; spriteVectorEnd = *(ANM2 **)(iVar8 + 0x28); if (spriteVectorEnd == *(ANM2 **)(iVar8 + 0x2c)) { std::vector::_Emplace_reallocate(spriteVectorEnd,other); } else { ANM2::ANM2(spriteVectorEnd,other); *(int *)(iVar8 + 0x28) = *(int *)(iVar8 + 0x28) + 0x114; } local_8 = (void *)0x1; ANM2::Reset(&tmpSprite); AnimationState::~AnimationState(&tmpSprite._overlayAnimState); AnimationState::~AnimationState(&tmpSprite._animState); std::string::_Tidy_deallocate(tmpSprite._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&tmpSprite); local_24._h._4_4_ = 0xf; local_24._h._0_4_ = 0; tmpString[0] = (void *)0x0; local_8 = (void *)0x2; anm2_apply_gfx_overrides ((int)wispEntry + 0x38,tmpString, ((*(int *)(iVar8 + 0x28) - *spriteVectorBegin) / 0x114) * 0x114 + -0x114 + *spriteVectorBegin); local_8 = (void *)0xffffffff; if (0xf < local_24._h._4_4_) { uVar6 = local_24._h._4_4_ + 1; pvVar7 = tmpString[0]; if (0xfff < uVar6) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar6 = local_24._h._4_4_ + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) goto LAB_00649265; } operator_delete(pvVar7,uVar6); } iVar5 = locustData; *(undefined4 *) (((*(int *)(iVar8 + 0x28) - *spriteVectorBegin) / 0x114) * 0x114 + -0x60 + *spriteVectorBegin) = 0; spriteVectorBegin = (int *)(locustData + 0x30); ANM2::constructor(&tmpSprite); local_8 = (void *)0x3; spriteVectorEnd = *(ANM2 **)(iVar5 + 0x34); if (spriteVectorEnd == *(ANM2 **)(iVar5 + 0x38)) { std::vector::_Emplace_reallocate(spriteVectorEnd,other_00); } else { ANM2::ANM2(spriteVectorEnd,other_00); *(int *)(iVar5 + 0x34) = *(int *)(iVar5 + 0x34) + 0x114; } local_8 = (void *)0x4; ANM2::Reset(&tmpSprite); AnimationState::~AnimationState(&tmpSprite._overlayAnimState); AnimationState::~AnimationState(&tmpSprite._animState); std::string::_Tidy_deallocate(tmpSprite._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&tmpSprite); local_24._h._4_4_ = 0xf; local_24._h._0_4_ = 0; tmpString[0] = (void *)0x0; local_8 = (void *)0x5; anm2_apply_gfx_overrides ((int)wispEntry + 0x50,tmpString, ((*(int *)(iVar5 + 0x34) - *spriteVectorBegin) / 0x114) * 0x114 + -0x114 + *spriteVectorBegin); local_8 = (void *)0xffffffff; if (0xf < local_24._h._4_4_) { uVar6 = local_24._h._4_4_ + 1; pvVar7 = tmpString[0]; if (0xfff < uVar6) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar6 = local_24._h._4_4_ + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) goto LAB_00649265; } operator_delete(pvVar7,uVar6); } entryIndex = 0; uVar6 = 0; appliedMask = 0; *(undefined4 *) (((*(int *)(iVar5 + 0x34) - *spriteVectorBegin) / 0x114) * 0x114 + -0x60 + *spriteVectorBegin) = 0; effectEntry = *(float **)((int)wispEntry + 0x68); if (effectEntry != *(float **)((int)wispEntry + 0x6c)) { do { iVar8 = entryIndex; if (((uVar6 & 1 << ((byte)entryIndex & 0x1f)) == 0) && (0.0 < *effectEntry)) { uVar6 = Random(); iVar5 = locustData; if (*effectEntry <= (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10) { uVar6 = appliedMask; } else { *local_150 = (EntityPtr)((uint)*local_150 | (uint)effectEntry[2]); local_150[1] = (EntityPtr)((uint)local_150[1] | (uint)effectEntry[3]); local_150[2] = (EntityPtr)((uint)local_150[2] | (uint)effectEntry[4]); local_150[3] = (EntityPtr)((uint)local_150[3] | (uint)effectEntry[5]); *(uint *)(locustData + 0x18) = *(uint *)(locustData + 0x18) | (uint)effectEntry[6]; local_24._h._4_4_ = 0xf; local_24._h._0_4_ = 0; tmpString[0] = (void *)0x0; local_8 = (void *)0x6; anm2_apply_gfx_overrides(effectEntry + 8,tmpString,&familiar->_sprite); local_8 = (void *)0xffffffff; if (0xf < local_24._h._4_4_) { uVar6 = local_24._h._4_4_ + 1; pvVar7 = tmpString[0]; if (0xfff < uVar6) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar6 = local_24._h._4_4_ + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) goto LAB_00649265; } operator_delete(pvVar7,uVar6); } ANM2::constructor(&tmpSprite); local_8 = (void *)0x7; spriteVectorEnd = *(ANM2 **)(iVar5 + 0x28); if (spriteVectorEnd == *(ANM2 **)(iVar5 + 0x2c)) { std::vector::_Emplace_reallocate(spriteVectorEnd,other_01); } else { ANM2::ANM2(spriteVectorEnd,other_01); *(int *)(iVar5 + 0x28) = *(int *)(iVar5 + 0x28) + 0x114; } local_8 = (void *)0x8; ANM2::Reset(&tmpSprite); AnimationState::~AnimationState(&tmpSprite._overlayAnimState); AnimationState::~AnimationState(&tmpSprite._animState); std::string::_Tidy_deallocate(tmpSprite._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&tmpSprite); local_24._h._4_4_ = 0xf; local_24._h._0_4_ = 0; tmpString[0] = (void *)0x0; local_8 = (void *)0x9; anm2_apply_gfx_overrides (effectEntry + 0xe,tmpString, *(int *)(iVar5 + 0x24) + -0x114 + ((*(int *)(iVar5 + 0x28) - *(int *)(iVar5 + 0x24)) / 0x114) * 0x114); local_8 = (void *)0xffffffff; if (0xf < local_24._h._4_4_) { uVar6 = local_24._h._4_4_ + 1; pvVar7 = tmpString[0]; if (0xfff < uVar6) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar6 = local_24._h._4_4_ + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) goto LAB_00649265; } operator_delete(pvVar7,uVar6); } *(undefined4 *) (((*(int *)(locustData + 0x28) - *(int *)(locustData + 0x24)) / 0x114) * 0x114 + -0x60 + *(int *)(locustData + 0x24)) = 0; ANM2::constructor(&tmpSprite); iVar8 = locustData; local_8 = (void *)0xa; spriteVectorEnd = *(ANM2 **)(locustData + 0x34); if (spriteVectorEnd == *(ANM2 **)(locustData + 0x38)) { std::vector::_Emplace_reallocate(spriteVectorEnd,other_02); } else { ANM2::ANM2(spriteVectorEnd,other_02); *(int *)(iVar8 + 0x34) = *(int *)(iVar8 + 0x34) + 0x114; } local_8 = (void *)0xb; ANM2::Reset(&tmpSprite); AnimationState::~AnimationState(&tmpSprite._overlayAnimState); AnimationState::~AnimationState(&tmpSprite._animState); std::string::_Tidy_deallocate(tmpSprite._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&tmpSprite); local_24._h._4_4_ = 0xf; local_24._h._0_4_ = 0; tmpString[0] = (void *)0x0; local_8 = (void *)0xc; anm2_apply_gfx_overrides (effectEntry + 0x14,tmpString, *(int *)(iVar8 + 0x30) + -0x114 + ((*(int *)(iVar8 + 0x34) - *(int *)(iVar8 + 0x30)) / 0x114) * 0x114); local_8 = (void *)0xffffffff; if (0xf < local_24._h._4_4_) { uVar6 = local_24._h._4_4_ + 1; pvVar7 = tmpString[0]; if (0xfff < uVar6) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar6 = local_24._h._4_4_ + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) goto LAB_00649265; } operator_delete(pvVar7,uVar6); } *(undefined4 *) (((*(int *)(locustData + 0x34) - *(int *)(locustData + 0x30)) / 0x114) * 0x114 + -0x60 + *(int *)(locustData + 0x30)) = 0; appliedMask = appliedMask | (uint)effectEntry[7]; uVar6 = appliedMask; iVar8 = entryIndex; } } effectEntry = effectEntry + 0x1a; entryIndex = iVar8 + 1; } while (effectEntry != *(float **)((int)wispEntry + 0x6c)); } iVar8 = locustData; if ((*(byte *)(locustData + 0x18) & 0x40) != 0) { uVar6 = Random(); knife = (EntityPtr) Game::Spawn(g_game,8,0,&familiar->_pos,&g_vectorZero,(Entity *)familiar,0,uVar6); if (*(EntityPtr *)((int)knife + 0x3bc) != (EntityPtr)0x0) { local_150 = (EntityPtr *)((int)knife + 0x3bc); std::multiset::erase(&local_150); } *(undefined4 *)((int)knife + 0x3bc) = familiar; std::multiset::insert((undefined4 *)((int)knife + 0x3bc)); (**(code **)(*(int *)knife + 0x3c))(&(familiar->_sprite)._color,0xffffffff,0xff,0,1); knifeFlags = BitSet128::operator_or (&local_168,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40); knifeFlags = BitSet128::__bnot(knifeFlags,&local_178); knifeFlags = BitSet128::operator_and(&local_24,(BitSet128 *)(iVar8 + 8),knifeFlags); uVar1 = *(undefined4 *)((int)&knifeFlags->_l + 4); qVar4 = knifeFlags->_h; uVar2 = *(undefined4 *)((int)&knifeFlags->_h + 4); *(int *)((int)knife + 0x410) = (int)knifeFlags->_l; *(undefined4 *)((int)knife + 0x414) = uVar1; *(int *)((int)knife + 0x418) = (int)qVar4; *(undefined4 *)((int)knife + 0x41c) = uVar2; (**(code **)(*(int *)knife + 0x40))(familiar->_collisionDamage * 0.5); knifeSlot = (EntityPtr *)(iVar8 + 0x4c); *(undefined4 *)((int)knife + 0x43c) = 0; fVar9 = (familiar->_sprite)._scale.y * 0.5 * g_vectorOne.y; *(float *)((int)knife + 0xe4) = (familiar->_sprite)._scale.x * 0.5 * g_vectorOne.x; *(float *)((int)knife + 0xe8) = fVar9; if (*knifeSlot != knife) { if (*knifeSlot != (EntityPtr)0x0) { local_150 = knifeSlot; std::multiset::erase(&local_150); } *knifeSlot = knife; std::multiset::insert(knifeSlot); } (**(code **)(*(int *)knife + 0xc))(); } local_24._h._4_4_ = 0xf; local_24._h._0_4_ = 0; tmpString[0] = (void *)0x0; local_8 = (void *)0xd; anm2_apply_gfx_overrides((int)wispEntry + 0x20,tmpString,&familiar->_sprite); if (0xf < local_24._h._4_4_) { uVar6 = local_24._h._4_4_ + 1; pvVar7 = tmpString[0]; if (0xfff < uVar6) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar6 = local_24._h._4_4_ + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) { LAB_00649265: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar6); } ExceptionList = local_10; return; } //@@ 00649290 Entity_Familiar::apply_tear_flag_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Entity_Familiar (AbyssLocustData extra data), args (?, BitSet128* tearFlags, Entity* target); called from Entity_Familiar::HandleCollision right after Entity_Tear::ApplyTearFlagEffects; per-flag contact effects: spawn tears, Fart/ButterBeanFart, DevolveEnemy, SpawnMawOfVoid, BombExplosionEffects, HitList, tears_brokenbone.png prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_Familiar::apply_tear_flag_effects (Entity_Familiar *this,BitSet128 *tearFlags,uint *effectFlags,Entity *target) { BitSet128 flags; ANM2 *pAVar1; Entity_Tear *pEVar2; byte isSameGfx; byte bVar3; char cVar4; BitSet128 *pBVar5; uint uVar6; Entity *pEVar7; byte *gfxPath; EntityPtr EVar8; BitSet128 *pBVar9; int *effect; Entity *spawnedEffect; Entity_Laser *laser; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; EntityPtr EVar10; uint *unk1; uint *extraout_ECX; uint *extraout_ECX_00; uint *extraout_ECX_01; uint *extraout_ECX_02; uint *extraout_ECX_03; uint *extraout_ECX_04; uint *unusedArg; uint *extraout_ECX_05; uint *extraout_ECX_06; byte *ptr; Vector *pos; bool isImmuneType; float fVar11; float fVar12; undefined4 uVar13; TypeDescriptor *pTVar14; TypeDescriptor *pTVar15; undefined4 uVar16; BitSet128 notLudovicoFlags; BitSet128 notSplitFlags; BitSet128 local_100; float local_f0; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 uStack_e4; Vector spawnPos; Vector local_cc; Vector local_c4; BitSet128 *local_bc; EntityPtr local_b8; EntityPtr local_b4; EntityPtr local_b0; int local_ac; char isAnyErased; EntityPtr local_a4; Entity_Tear *local_a0; ColorMod fartColor; byte *local_70; char acStack_6c [12]; Vector local_60 [2]; char effectColor [16]; void *local_40; void *pvStack_3c; void *pvStack_38; void *pvStack_34; undefined8 local_30; undefined1 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; undefined4 local_14; Manager *manager; void *room; qword tearFlagsHigh; int vtable; puStack_20 = effectColor + 0x4c; local_14 = (void *)0xffffffff; puStack_18 = &DAT_00af723d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(effectColor + 0x40); ExceptionList = &local_1c; local_bc = tearFlags; local_b8 = (EntityPtr)target; local_c4.y = (float)this; local_ac = __RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0,local_24) ; pBVar5 = BitSet128::operator_and((BitSet128 *)&local_f0,local_bc,(BitSet128 *)&DAT_00c348f0); if (((int)pBVar5->_l != 0 || *(int *)((int)&pBVar5->_l + 4) != 0) || ((int)pBVar5->_h != 0 || *(int *)((int)&pBVar5->_h + 4) != 0)) { local_a4 = (EntityPtr)0x0; do { uVar6 = Random(); fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_b4 = (EntityPtr)(fVar11 + fVar11); local_a0 = (Entity_Tear *)sin((float)local_b4); local_cc.x = cos((float)local_b4); local_cc.x = local_cc.x * 10.0; local_cc.y = (float)local_a0 * 10.0; uVar6 = Random(); spawnPos.x = (this->_pos).x - (this->_velocity).x; spawnPos.y = (this->_pos).y - (this->_velocity).y; uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; pEVar7 = Game::Spawn(g_game,2,0x1d,&spawnPos,&local_cc,this->_player,0,uVar6); local_a0 = (Entity_Tear *)__RTDynamicCast(pEVar7,uVar13,pTVar14,pTVar15,uVar16); if (this->_variant == 0x1d) { local_b4 = (EntityPtr)&local_a0->_sprite; gfxPath = std::_Allocate(0x20); local_60[0].x = 3.36312e-44; local_60[0].y = 4.34403e-44; gfxPath[0] = 'g'; gfxPath[1] = 'f'; gfxPath[2] = 'x'; gfxPath[3] = '/'; gfxPath[4] = 't'; gfxPath[5] = 'e'; gfxPath[6] = 'gfxPath'; gfxPath[7] = 'r'; gfxPath[8] = 's'; gfxPath[9] = '_'; gfxPath[10] = 'b'; gfxPath[0xb] = 'r'; gfxPath[0xc] = 'o'; gfxPath[0xd] = 'k'; gfxPath[0xe] = 'e'; gfxPath[0xf] = 'n'; gfxPath[0x10] = 0x62; gfxPath[0x11] = 0x6f; gfxPath[0x12] = 0x6e; gfxPath[0x13] = 0x65; gfxPath[0x14] = 0x2e; gfxPath[0x15] = 0x70; gfxPath[0x16] = 0x6e; gfxPath[0x17] = 0x67; gfxPath[0x18] = 0; local_14 = (void *)0x0; local_70 = gfxPath; bVar3 = extraout_CL; if (0 < (local_a0->_sprite)._layerCount) { local_b0 = (EntityPtr)(local_a0->_sprite)._layerState; EVar10 = (EntityPtr)((int)local_b0 + 8); if (0xf < (uint)*(EntityPtr *)((int)local_b0 + 0x1c)) { EVar10 = *(EntityPtr *)((int)local_b0 + 8); } isSameGfx = str_eq(gfxPath,0x18,(byte *)EVar10,(uint)*(EntityPtr *)((int)local_b0 + 0x18)) ; bVar3 = extraout_CL_00; if (isSameGfx == 0) { EVar10 = (EntityPtr)((int)local_b0 + 8); EVar8 = local_b0; if (EVar10 != (EntityPtr)&local_70) { std::string::assign((char *)EVar10,gfxPath,0x18); EVar8 = *(EntityPtr *)((int)local_b4 + 0x7c); EVar10 = local_b4; gfxPath = local_70; } bVar3 = SUB41(EVar10,0); *(undefined1 *)((int)EVar8 + 0x30) = 0; } } local_14 = (void *)0xffffffff; if (0xf < (uint)local_60[0].y) { uVar6 = (int)local_60[0].y + 1; ptr = gfxPath; if (0xfff < uVar6) { ptr = *(byte **)(gfxPath + -4); uVar6 = (int)local_60[0].y + 0x24; if ((byte *)0x1f < gfxPath + (-4 - (int)ptr)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); bVar3 = extraout_CL_01; } ANM2::LoadGraphics((ANM2 *)local_b4,bVar3); } (**(code **)(*(int *)local_a0 + 0x40))(*(float *)((int)this->_player + 0x157c) * 0.25); pBVar5 = BitSet128::__bnot((BitSet128 *)&DAT_00c348f0,¬SplitFlags); pBVar9 = BitSet128::__bnot(&g_tearFlagLudovico,¬LudovicoFlags); pBVar9 = BitSet128::operator_and(&local_100,local_bc,pBVar9); BitSet128::operator_and((BitSet128 *)&local_f0,pBVar9,pBVar5); pEVar2 = local_a0; flags._l._4_4_ = uStack_ec; flags._l._0_4_ = local_f0; flags._h._0_4_ = uStack_e8; flags._h._4_4_ = uStack_e4; Entity_Tear::SetTearFlags(local_a0,flags); (**(code **)(*(int *)pEVar2 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); local_b4 = this->_parent; if (pEVar2->_parent != (EntityPtr)0x0) { local_b0 = (EntityPtr)&pEVar2->_parent; std::multiset::erase(&local_b0); } pEVar2->_parent = local_b4; if (local_b4 != (EntityPtr)0x0) { std::multiset::insert(&pEVar2->_parent); } (**(code **)(*(int *)pEVar2 + 0xc))(); local_a4 = (EntityPtr)((int)local_a4 + 1); } while ((int)local_a4 < 2); target = (Entity *)local_b8; } pBVar5 = BitSet128::operator_and(&local_100,local_bc,(BitSet128 *)&DAT_00c34900); if (((int)pBVar5->_l == 0 && *(int *)((int)&pBVar5->_l + 4) == 0) && ((int)pBVar5->_h == 0 && *(int *)((int)&pBVar5->_h + 4) == 0)) { local_a0 = (Entity_Tear *)&this->_pos; } else { local_a0 = (Entity_Tear *)&this->_pos; local_b4 = (EntityPtr) spawn_chain_lightning ((Vector *)local_a0,*local_bc,this->_player, this->_player[5]._sprite._championColor._offset[1] * 0.25); if ((EntityPtr)target != (EntityPtr)0x0) { local_a4 = (EntityPtr)((int)local_b4 + 0x3c4); if (*(EntityPtr *)local_a4 != (EntityPtr)0x0) { local_b0 = local_a4; std::multiset::erase(&local_b0); } *(Entity **)local_a4 = target; std::multiset::insert(local_a4); local_a0 = (Entity_Tear *)&this->_pos; } (**(code **)(*(int *)local_b4 + 0xc))(); } pBVar5 = BitSet128::operator_and(&local_100,local_bc,(BitSet128 *)&DAT_00c34970); if ((!((int)pBVar5->_l == 0 && *(int *)((int)&pBVar5->_l + 4) == 0)) || (!((int)pBVar5->_h == 0 && *(int *)((int)&pBVar5->_h + 4) == 0))) { pos = &this->_pos; local_a0 = (Entity_Tear *)pos; bVar3 = Room::IsPositionInRoom(g_game->_room,pos,-10.0); if (bVar3 != 0) { local_b0 = (EntityPtr)(*(float *)((int)this->_player + 0x157c) * 0.25); Room::GetClampedPositionImpl(g_game->_room,&spawnPos,pos,0.0,0.0,0.0,0.0); uVar6 = Random(); pEVar7 = Game::Spawn(g_game,1000,0xb4,&spawnPos,&g_vectorZero,this->_player,0,uVar6); fVar11 = (this->_sprite)._scale.x * g_vectorOne.x; vtable = *(int *)pEVar7; (pEVar7->_sprite)._scale.y = (this->_sprite)._scale.y * g_vectorOne.y; (pEVar7->_sprite)._scale.x = fVar11; (**(code **)(vtable + 0x40))(local_b0); uVar13 = 0x3c; if (1 < *(int *)&g_game->_deathmatchManager) { uVar13 = 0x1e; } vtable = *(int *)pEVar7; *(undefined4 *)(pEVar7[1]._sprite._filename._buf + 8) = uVar13; *(undefined4 *)(pEVar7[1]._sprite._filename._buf + 0xc) = uVar13; (**(code **)(vtable + 0xc))(); manager = g_manager; local_a4 = (EntityPtr)0x440; seed_fart_sound_override((int *)&local_a4); SoundEffects::Play(&manager->_sfxManager,(int)local_a4,1.0,2,0,1.0,0.0); local_a0 = (Entity_Tear *)&this->_pos; } } pos = &this->_pos; local_70 = (byte *)0x3f19999a; acStack_6c[0] = '\0'; acStack_6c[1] = '\0'; acStack_6c[2] = '\0'; acStack_6c[3] = '\0'; acStack_6c[4] = '\0'; acStack_6c[5] = '\0'; acStack_6c[6] = '\0'; acStack_6c[7] = '\0'; acStack_6c[8] = '\0'; acStack_6c[9] = '\0'; acStack_6c[10] = '\0'; acStack_6c[0xb] = '\0'; unk1 = (uint *)*effectFlags; if (((uint)unk1 & 1) != 0) { Game::BombExplosionEffects (g_game,pos,20.0,(BitSet128)ZEXT816(0),&(this->_sprite)._color,(Entity *)this,0.6,1,4, 0); unk1 = (uint *)*effectFlags; } if (((uint)unk1 & 0x20000) != 0) { uVar6 = Random(); uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; pEVar7 = Game::Spawn(g_game,1000,0x5d,pos,&g_vectorZero,(Entity *)this,0,uVar6); effect = (int *)__RTDynamicCast(pEVar7,uVar13,pTVar14,pTVar15,uVar16); fVar11 = (this->_sprite)._scale.x; effect[0x117] = 0x2d; effect[0x11e] = (int)(fVar11 * 32.0); effect[0x118] = 0x2d; (**(code **)(*effect + 0xc))(); unk1 = (uint *)*effectFlags; } local_f0 = 0.8; uStack_ec = 0; uStack_e8 = 0; uStack_e4 = 0; if (((uint)unk1 & 0x1e000) != 0) { Room::GetClampedPositionImpl(g_game->_room,&local_cc,pos,15.0,15.0,15.0,15.0); effectColor[0] = '\0'; effectColor[1] = '\0'; effectColor[2] = -0x80; effectColor[3] = '?'; effectColor[4] = '\0'; effectColor[5] = '\0'; effectColor[6] = -0x80; effectColor[7] = '?'; effectColor[8] = '\0'; effectColor[9] = '\0'; effectColor[10] = -0x80; effectColor[0xb] = '?'; uVar6 = *effectFlags; local_30._0_4_ = 0.0; local_30._4_1_ = 0; local_30._5_3_ = 0; local_28 = (undefined1 *)0x0; if ((uVar6 & 0x2000) == 0) { if ((uVar6 & 0x4000) == 0) { if ((uVar6 & 0x8000) == 0) { if ((uVar6 & 0x10000) != 0) { effectColor[0] = '\0'; effectColor[1] = '\0'; effectColor[2] = '\0'; effectColor[3] = '\0'; effectColor[4] = '\0'; effectColor[5] = '\0'; effectColor[6] = '\0'; effectColor[7] = '\0'; effectColor[8] = '\0'; effectColor[9] = '\0'; effectColor[10] = '\0'; effectColor[0xb] = '\0'; local_28 = (undefined1 *)0x400ccccd; local_30._4_4_ = local_70; local_30._0_4_ = (float)local_70; } } else { effectColor[0] = '\0'; effectColor[1] = '\0'; effectColor[2] = -0x80; effectColor[3] = '?'; effectColor[4] = '\0'; effectColor[5] = '\0'; effectColor[6] = '\0'; effectColor[7] = '\0'; effectColor[8] = '\0'; effectColor[9] = '\0'; effectColor[10] = '\0'; effectColor[0xb] = '\0'; local_28 = &DAT_bf800000; local_30._4_4_ = &DAT_bf800000; local_30._0_4_ = local_f0; } } else { local_28 = (undefined1 *)0x0; effectColor[0] = '\0'; effectColor[1] = '\0'; effectColor[2] = '\0'; effectColor[3] = '\0'; effectColor[4] = '\0'; effectColor[5] = '\0'; effectColor[6] = '\0'; effectColor[7] = '\0'; effectColor[8] = '\0'; effectColor[9] = '\0'; effectColor[10] = '\0'; effectColor[0xb] = '\0'; local_30._0_4_ = 2.2; local_30._4_1_ = 0xcd; local_30._5_3_ = 0x400ccc; } } else { effectColor[0] = '\0'; effectColor[1] = '\0'; effectColor[2] = -0x80; effectColor[3] = '?'; effectColor[4] = '\0'; effectColor[5] = '\0'; effectColor[6] = -0x80; effectColor[7] = '?'; effectColor[8] = '\0'; effectColor[9] = '\0'; effectColor[10] = -0x80; effectColor[0xb] = '?'; local_28 = (undefined1 *)0x0; local_30._0_4_ = 0.0; local_30._4_1_ = 0; local_30._5_3_ = 0; } pvStack_34 = (void *)0x0; pvStack_38 = (void *)0x0; pvStack_3c = (void *)0x0; local_40 = (void *)0x0; effectColor[0xc] = '\0'; effectColor[0xd] = '\0'; effectColor[0xe] = -0x80; effectColor[0xf] = '?'; uVar6 = Random(); uVar16 = 0; pTVar15 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar14 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar13 = 0; pEVar7 = Game::Spawn(g_game,1000,0x35,&local_cc,&g_vectorZero,(Entity *)this->_spawnerEntity,0, uVar6); effect = (int *)__RTDynamicCast(pEVar7,uVar13,pTVar14,pTVar15,uVar16); fVar12 = g_vectorOne.y * 0.4; fVar11 = (this->_sprite)._scale.y; effect[0x39] = (int)(g_vectorOne.x * 0.4 * (this->_sprite)._scale.x); effect[0x3a] = (int)(fVar12 * fVar11); (**(code **)(*effect + 0x3c))(effectColor,0xffffffff,0xff,0,1); (**(code **)(*effect + 0xc))(); unk1 = (uint *)*effectFlags; } EVar10 = local_b8; if (((uint)unk1 & 8) == 0) goto LAB_00649d22; if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)local_b8 + 0x28) != 1)) { unk1 = *(uint **)((int)local_b8 + 0x28); if (((undefined1 *)0x3dd < (undefined1 *)((int)unk1 + -10)) || (((unk1 == (uint *)0x21 || (unk1 == (uint *)&DAT_00000011)) || (unk1 == (uint *)0x124)))) goto LAB_00649d22; if (unk1 == (uint *)0x375) { isImmuneType = *(int *)((int)local_b8 + 0x2c) == 10; } else { if ((unk1 == (uint *)0x3c0) || (unk1 == (uint *)0x3c5)) goto LAB_00649d22; isImmuneType = unk1 == (uint *)0xf5; } if (isImmuneType) goto LAB_00649d22; } else { unk1 = (uint *)0x1; } if ((*(char *)((int)local_b8 + 0x173) == '\0') && (unk1 != (uint *)0x1)) { bVar3 = EntityList::HitListContains((EntityList *)(local_ac + 0x40),(Entity *)local_b8); unk1 = extraout_ECX; if ((bVar3 == 0) && ((*(float *)((int)EVar10 + 0x14) < *(float *)((int)EVar10 + 0x380) && (*(char *)((int)EVar10 + 0x173) == '\0')))) { bVar3 = Entity::CanDevolve((Entity *)EVar10); manager = g_manager; unk1 = extraout_ECX_00; if (bVar3 != 0) { local_a4 = (EntityPtr)0x253; seed_fart_sound_override((int *)&local_a4); SoundEffects::Play(&manager->_sfxManager,(int)local_a4,1.0,2,0,1.0,0.0); EVar10 = local_b8; local_a4 = (EntityPtr)0x0; Game::DevolveEnemy((Entity *)local_b8,(Entity **)&local_a4); unk1 = (uint *)0x0; if (local_a4 != (EntityPtr)0x0) { uVar6 = Entity::GetHitListIndex((Entity *)local_a4); sorted_vector_insert_unique((void *)(local_ac + 0x40),uVar6); unk1 = extraout_ECX_01; } } } } LAB_00649d22: uVar6 = *effectFlags; if ((uVar6 & 0x10) != 0) { Entity_Player::UseActiveItem(this->_player,(short *)&local_b8.field_0x2,0x23,1,-1,0); uVar6 = *effectFlags; unk1 = effectFlags; } if ((uVar6 & 0x20) != 0) { bVar3 = Entity::IsVulnerableEnemy((Entity *)EVar10,(Entity *)0x0); unk1 = extraout_ECX_02; if ((bVar3 != 0) && ((cVar4 = (**(code **)(*(int *)EVar10 + 0x4c))(), cVar4 == '\0' || (unk1 = extraout_ECX_03, *(float *)((int)EVar10 + 0x380) <= *(float *)((int)EVar10 + 0x14))) )) { isAnyErased = '\0'; Game::AddErasedEnemy(EVar10); uVar6 = 0; room = g_game->_room; unk1 = extraout_ECX_04; if (*(int *)((int)room + 0x1264) != 0) { do { bVar3 = Game::ShouldEraseEnemy(*(Entity **)(*(int *)((int)room + 0x125c) + uVar6 * 4)); unk1 = unusedArg; if (bVar3 != 0) { Entity::RemoveWithPoof (*(Entity **)(*(int *)((int)room + 0x125c) + uVar6 * 4),(int)unusedArg); isAnyErased = '\x01'; unk1 = extraout_ECX_05; } this = (Entity_Familiar *)local_c4.y; manager = g_manager; uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)room + 0x1264)); if (isAnyErased != '\0') { local_ac = 0xed; seed_fart_sound_override(&local_ac); SoundEffects::Play(&manager->_sfxManager,local_ac,1.0,2,0,1.0,0.0); unk1 = extraout_ECX_06; } } } } manager = g_manager; uVar6 = *effectFlags; if ((char)uVar6 < '\0') { local_ac = 0x23f; seed_fart_sound_override(&local_ac); SoundEffects::Play(&manager->_sfxManager,local_ac,0.8,2,0,2.5,0.0); Game::ShakeScreen(g_game,8); uVar6 = Random(); local_a0 = (Entity_Tear *)&this->_pos; spawnedEffect = Game::Spawn(g_game,1000,0x7f,(Vector *)local_a0,&g_vectorZero,(Entity *)this,1,uVar6); fVar11 = (this->_pos).y; (spawnedEffect->_targetPosition).x = (this->_pos).x; (spawnedEffect->_targetPosition).y = fVar11; vtable = *(int *)spawnedEffect; pEVar7 = spawnedEffect + 1; (pEVar7->_sprite)._filename._buf[0] = '\0'; (pEVar7->_sprite)._filename._buf[1] = '\0'; (pEVar7->_sprite)._filename._buf[2] = '`'; (pEVar7->_sprite)._filename._buf[3] = '@'; pAVar1 = &spawnedEffect[1]._sprite; (pAVar1->_filename)._buf[4] = -0x1f; (pAVar1->_filename)._buf[5] = 'z'; (pAVar1->_filename)._buf[6] = ':'; (pAVar1->_filename)._buf[7] = 'B'; (**(code **)(vtable + 0x40))(0x41f00000); (**(code **)(*(int *)spawnedEffect + 0xc))(); uVar6 = *effectFlags; unk1 = effectFlags; } if ((uVar6 & 0x100) != 0) { laser = Entity_Player::SpawnMawOfVoid(this->_player,0x3c); (laser->_pos).x = *(float *)&local_a0->field_0x0; (laser->_pos).y = *(float *)&local_a0->field_0x4; laser->_disableFollowParent = 1; laser->_damageMultiplier = 0.5; laser->_scale = 0.5; Entity_Laser::ResetSpriteScale(laser); laser->_radius = laser->_radius * 0.1; (**(code **)(*(int *)laser + 0xc))(); uVar6 = *effectFlags; unk1 = effectFlags; } pEVar2 = local_a0; if ((uVar6 & 0x400) != 0) { fartColor._tint[0] = 1.0; fartColor._tint[1] = 1.0; fartColor._tint[2] = 1.0; fartColor._tint[3] = 1.0; fartColor._offset[0] = 0.0; fartColor._colorize[0] = 0.0; fartColor._colorize[1] = 0.0; fartColor._colorize[2] = 0.0; fartColor._colorize[3] = 0.0; fartColor._offset[1] = 0.0; fartColor._offset[2] = 0.0; Game::Fart(g_game,(Vector *)local_a0,15.0,(Entity *)this,0.4,0,&fartColor); uVar6 = *effectFlags; unk1 = effectFlags; } if ((uVar6 & 0x800) != 0) { Game::ButterBeanFart(g_game,(Vector *)pEVar2,40.0,this->_player,1,1); uVar6 = *effectFlags; unk1 = effectFlags; } if ((uVar6 & 0x1000) != 0) { fVar11 = (this->_velocity).x; fVar12 = (this->_velocity).y; if (ABS(fVar11) <= ABS(fVar12)) { local_c4.x = 0.0; local_c4.y = (float)&DAT_bf800000; if (0.0 <= fVar12) { local_c4.y = 1.0; } } else { local_c4.y = 0.0; if (0.0 <= fVar11) { local_c4.x = 1.0; } else { local_c4.x = (float)&DAT_bf800000; } } laser = Weapon::FireBrimstone((Entity *)this,&this->_pos,&local_c4,1.0,(float)unk1,0); local_f0 = *(float *)&(laser->_tearFlags)._l; uStack_ec = *(undefined4 *)((int)&(laser->_tearFlags)._l + 4); uStack_e8 = (undefined4)(laser->_tearFlags)._h; uStack_e4 = *(undefined4 *)((int)&(laser->_tearFlags)._h + 4); pBVar5 = BitSet128::operator_or(&local_100,(BitSet128 *)&local_f0,(BitSet128 *)&DAT_00c34b40); uVar13 = *(undefined4 *)((int)&pBVar5->_l + 4); tearFlagsHigh = pBVar5->_h; uVar16 = *(undefined4 *)((int)&pBVar5->_h + 4); *(int *)&(laser->_tearFlags)._l = (int)pBVar5->_l; *(undefined4 *)((int)&(laser->_tearFlags)._l + 4) = uVar13; *(int *)&(laser->_tearFlags)._h = (int)tearFlagsHigh; *(undefined4 *)((int)&(laser->_tearFlags)._h + 4) = uVar16; laser->_scale = laser->_scale * 1.5; Entity_Laser::ResetSpriteScale(laser); } pBVar5 = BitSet128::operator_and(&local_100,local_bc,(BitSet128 *)&DAT_00c34970); pEVar2 = local_a0; if ((((int)pBVar5->_l != 0 || *(int *)((int)&pBVar5->_l + 4) != 0) || ((int)pBVar5->_h != 0 || *(int *)((int)&pBVar5->_h + 4) != 0)) && (bVar3 = Room::IsPositionInRoom(g_game->_room,(Vector *)local_a0,-10.0), bVar3 != 0)) { local_c4.y = *(float *)((int)this->_player + 0x157c) * 0.25; Room::GetClampedPositionImpl(g_game->_room,local_60,(Vector *)pEVar2,0.0,0.0,0.0,0.0); uVar6 = Random(); pEVar7 = Game::Spawn(g_game,1000,0xb4,local_60,&g_vectorZero,this->_player,0,uVar6); fVar11 = g_vectorOne.x * 0.4; vtable = *(int *)pEVar7; (pEVar7->_sprite)._scale.y = g_vectorOne.y * 0.4; (pEVar7->_sprite)._scale.x = fVar11; (**(code **)(vtable + 0x40))(local_c4.y); uVar13 = 0x3c; if (1 < *(int *)&g_game->_deathmatchManager) { uVar13 = 0x1e; } *(undefined4 *)(pEVar7[1]._sprite._filename._buf + 8) = uVar13; *(undefined4 *)(pEVar7[1]._sprite._filename._buf + 0xc) = uVar13; (**(code **)(*(int *)pEVar7 + 0xc))(); manager = g_manager; local_ac = 0x440; seed_fart_sound_override(&local_ac); SoundEffects::Play(&manager->_sfxManager,local_ac,1.0,2,0,1.0,0.0); } ExceptionList = local_1c; return; } //@@ 0064a2d0 Entity_Familiar::break_grid_ahead /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=familiar: grid index at _pos+2*_velocity, AbyssLocustData dyncast caches last index (+0x3c), item-config tear flags rolled per chance, grid vtable +0x14 hit then Room::TryMakeBridge; returns bool; only from FamiliarAI::apollyons_best_friend prototype: db/protos.zhl */ byte __thiscall Entity_Familiar::break_grid_ahead(Entity_Familiar *this) { float fVar1; char cVar2; int gridY; int gridY; uint rngValue; float fVar4; Vector *gridPos; int iVar5; uint uVar6; float *tearEffectEntry; uint uVar7; uint tearFlags1; uint tearFlags3; uint rolledEffectMask; uint tearFlags2; uint tearFlags0; Vector local_68; Vector local_60; Vector local_58; uint uStack_50; uint uStack_4c; uint uStack_48; uint uStack_44; int sourceRef; int iStack_34; int iStack_30; int iStack_2c; float fStack_28; float fStack_24; float fStack_20; float fStack_1c; uint uStack_18; Entity_Familiar *pEStack_14; GridEntity *gridEntity; Room *room; fVar1 = (this->_velocity).y; fVar4 = (this->_velocity).x; local_58.x = (float)((10.0 < this->_collisionDamage) + 1); local_60.x = (float)&this->_velocity; iVar5 = (int)(((fVar4 + fVar4 + (this->_pos).x) - 40.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (gridY = *(int *)((int)g_game->_room + 0xc), gridY <= iVar5)) || (gridY = (int)(((fVar1 + fVar1 + (this->_pos).y) - 120.0) / 40.0 + 0.5), gridY < 0)) || ((*(int *)((int)g_game->_room + 0x10) <= gridY || (iVar5 = gridY * gridY + iVar5, iVar5 < 0)))) { return 0; } local_68.x = (float)this; gridY = __RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0); if (gridY != 0) { if (*(int *)(gridY + 0x3c) == iVar5) { return 0; } *(int *)(gridY + 0x3c) = iVar5; } if (0x1bf < iVar5) { return 0; } gridEntity = *(GridEntity **)((int)g_game->_room + iVar5 * 4 + 0x24); if (gridEntity == (GridEntity *)0x0) { return 0; } if (gridEntity->_collisionClass == 1) { return 0; } if (gridEntity->_collisionClass == 0) { return 0; } iVar5 = get_item_config_entry(this); uVar6 = 0; rolledEffectMask = 0; tearFlags0 = *(uint *)(iVar5 + 8); tearFlags1 = *(uint *)(iVar5 + 0xc); tearFlags2 = *(uint *)(iVar5 + 0x10); tearFlags3 = *(uint *)(iVar5 + 0x14); tearEffectEntry = *(float **)(iVar5 + 0x68); uStack_50 = tearFlags0; uStack_4c = tearFlags1; uStack_48 = tearFlags2; uStack_44 = tearFlags3; if (tearEffectEntry != *(float **)(iVar5 + 0x6c)) { uVar7 = 1; do { if (((uVar6 & uVar7) == 0) && (0.0 < *tearEffectEntry)) { rngValue = Random(); uVar6 = rolledEffectMask; if ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 < *tearEffectEntry) { tearFlags0 = tearFlags0 | (uint)tearEffectEntry[2]; tearFlags1 = tearFlags1 | (uint)tearEffectEntry[3]; tearFlags2 = tearFlags2 | (uint)tearEffectEntry[4]; tearFlags3 = tearFlags3 | (uint)tearEffectEntry[5]; rolledEffectMask = rolledEffectMask | (uint)tearEffectEntry[7]; uVar6 = rolledEffectMask; } } tearEffectEntry = tearEffectEntry + 0x1a; uVar7 = uVar7 << 1 | (uint)((int)uVar7 < 0); } while (tearEffectEntry != *(float **)(iVar5 + 0x6c)); } cVar2 = (**(code **)(*(int *)gridEntity + 0x1c))(); fVar1 = local_68.x; if (cVar2 != '\0') { if (((tearFlags0 & DAT_00c34a30) == 0 && (tearFlags1 & DAT_00c34a34) == 0) && ((tearFlags2 & DAT_00c34a38) == 0 && (tearFlags3 & DAT_00c34a3c) == 0)) { if (((tearFlags0 & _DAT_00c34980) == 0 && (tearFlags1 & DAT_00c34984) == 0) && ((tearFlags2 & _DAT_00c34988) == 0 && (tearFlags3 & DAT_00c3498c) == 0)) goto LAB_0064a73c; } fStack_28 = ((Vector *)((int)local_68.x + 0x33c))->x; fStack_24 = ((Vector *)((int)local_68.x + 0x33c))->y; fStack_20 = ((Vector *)((int)local_68.x + 0x360))->x; sourceRef = *(int *)((int)local_68.x + 0x28); iStack_34 = *(int *)((int)local_68.x + 0x2c); iStack_30 = *(int *)((int)local_68.x + 0x34); iStack_2c = *(int *)((int)local_68.x + 0x38); fStack_1c = ((Vector *)((int)local_68.x + 0x360))->y; if ((*(qword *)((int)local_68.x + 0x168) & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } fVar4 = (float)(*(uint *)((int)((int)local_68.x + 0x168) + 4) & 0x400000); if (fVar4 == 0.0) { uVar7 = 0; } else { uVar7 = 4; } pEStack_14 = (Entity_Familiar *)local_68.x; uStack_18 = uVar7 | uVar6 | (uint)((*(qword *)((int)local_68.x + 0x168) & 0x100) != 0); local_68.x = fVar4; cVar2 = (**(code **)(*(int *)gridEntity + 0x14))(0,&sourceRef); if (cVar2 != '\0') { Vector::ToCardinal(&local_58,(Vector *)local_60.x); if ((local_58.x == g_vectorZero.x) && (local_58.y == g_vectorZero.y)) { return 1; } gridPos = GridEntity::Position(gridEntity,&local_68); local_60.x = local_58.x * 40.0 + gridPos->x; local_60.y = local_58.y * 40.0 + gridPos->y; room = g_game->_room; iVar5 = Room::GetGridIndex(room,&local_60); if (iVar5 < 0) { return 1; } if (iVar5 < 0x1c0) { Room::TryMakeBridge(room,room->_gridEntities[iVar5],gridEntity); return 1; } Room::TryMakeBridge(room,(GridEntity *)0x0,gridEntity); return 1; } } LAB_0064a73c: fStack_28 = ((Vector *)((int)fVar1 + 0x33c))->x; fStack_24 = ((Vector *)((int)fVar1 + 0x33c))->y; local_68.x = *(float *)(*(int *)gridEntity + 0x10); sourceRef = *(int *)((int)fVar1 + 0x28); iStack_34 = *(int *)((int)fVar1 + 0x2c); iStack_30 = *(int *)((int)fVar1 + 0x34); iStack_2c = *(int *)((int)fVar1 + 0x38); fStack_20 = ((Vector *)((int)fVar1 + 0x360))->x; fStack_1c = ((Vector *)((int)fVar1 + 0x360))->y; if ((*(qword *)((int)fVar1 + 0x168) & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } local_60.x = (float)(*(uint *)((int)((int)fVar1 + 0x168) + 4) & 0x400000); if (local_60.x == 0.0) { uVar7 = 0; } else { uVar7 = 4; } pEStack_14 = (Entity_Familiar *)fVar1; uStack_18 = uVar7 | uVar6 | (uint)((*(qword *)((int)fVar1 + 0x168) & 0x100) != 0); (*(code *)local_68.x)(local_58.x,&sourceRef); return 1; } //@@ 0064a830 Entity_Familiar::load_config_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Familiar::Init (and Menu_Stats::Render preview): ItemConfig::get_wisp_entry, ANM2::Load(entry+0x74), Hungry Soul ReplaceSpritesheet "hungry_%d.png" (hp/5) */ void __thiscall Entity_Familiar::load_config_graphics(Entity_Familiar *this) { byte bVar1; uint uVar2; void *wispEntry; byte *pbVar3; uint animCompare; int iVar4; undefined4 *appendedPath; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; int collectibleId; std_string *animNameCursor; void *freeBlock; bool isLess; std_string *defaultAnim; void *sheetPath; char acStack_70 [4]; char acStack_6c [4]; char acStack_68 [8]; uint sheetPathCapacity; void *basePath [4]; undefined4 basePathSize; uint basePathCapacity; byte sheetFileName [32]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = sheetFileName + 0x40; local_14 = -1; puStack_18 = &LAB_00af7285; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(sheetFileName + 0x34); ExceptionList = &local_1c; if (this->_variant == 0xe7) { iVar4 = this->_coins; collectibleId = this->_subtype; } else { collectibleId = 0x19; iVar4 = 0; } local_24 = uVar2; wispEntry = ItemConfig::get_wisp_entry(collectibleId,iVar4); if (this->_config == (void *)0x0) goto LAB_0064aa74; ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); defaultAnim = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { defaultAnim = *(std_string **)defaultAnim->_buf; } pbVar3 = (this->_sprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_0064a90e: bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)defaultAnim,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } animNameCursor = defaultAnim; do { bVar1 = *pbVar3; isLess = bVar1 < (byte)animNameCursor->_buf[0]; if (bVar1 != animNameCursor->_buf[0]) { LAB_0064a8f6: animCompare = -(uint)isLess | 1; goto LAB_0064a8fb; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; isLess = bVar1 < (byte)animNameCursor->_buf[1]; if (bVar1 != animNameCursor->_buf[1]) goto LAB_0064a8f6; pbVar3 = pbVar3 + 2; animNameCursor = (std_string *)(animNameCursor->_buf + 2); } while (bVar1 != 0); animCompare = 0; LAB_0064a8fb: if ((animCompare != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0064a90e; } iVar4 = __RTDynamicCast(this->_extraData,0, &IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor, &IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0,uVar2); if (((*(uint *)(iVar4 + 0x18) | *(uint *)((int)wispEntry + 0x18)) & 0x40000) != 0) { sprintf(sheetFileName,(byte *)"hungry_%d.png"); std::string::string((char *)basePath,&(g_manager->_itemConfig)._wispGfxRoot); pbVar3 = sheetFileName; local_14 = 0; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); appendedPath = std::string::append((char *)basePath,sheetFileName, (int)pbVar3 - (int)(sheetFileName + 1)); sheetPath = (void *)*appendedPath; acStack_70 = (char [4])appendedPath[1]; acStack_6c = (char [4])appendedPath[2]; acStack_68._0_4_ = appendedPath[3]; unique0x0000a400 = *(undefined8 *)(appendedPath + 4); appendedPath[4] = 0; appendedPath[5] = 0xf; *(undefined1 *)appendedPath = 0; local_14._0_1_ = 1; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,(std_string *)&sheetPath); local_14 = (uint)local_14._1_3_ << 8; bVar1 = extraout_CL; if (0xf < sheetPathCapacity) { uVar2 = sheetPathCapacity + 1; freeBlock = sheetPath; if (0xfff < uVar2) { freeBlock = *(void **)((int)sheetPath + -4); uVar2 = sheetPathCapacity + 0x24; if (0x1f < (uint)((int)sheetPath + (-4 - (int)freeBlock))) goto LAB_0064aa4a; } operator_delete(freeBlock,uVar2); bVar1 = extraout_CL_00; } local_14 = -1; if (0xf < basePathCapacity) { uVar2 = basePathCapacity + 1; freeBlock = basePath[0]; if (0xfff < uVar2) { freeBlock = *(void **)((int)basePath[0] + -4); uVar2 = basePathCapacity + 0x24; if (0x1f < (uint)((int)basePath[0] + (-4 - (int)freeBlock))) { LAB_0064aa4a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); bVar1 = extraout_CL_01; } basePathSize = 0; basePathCapacity = 0xf; basePath[0] = (void *)((uint)basePath[0] & 0xffffff00); ANM2::LoadGraphics(&this->_sprite,bVar1); } LAB_0064aa74: anm2_apply_gfx_overrides((int)wispEntry + 0x84,(int)wispEntry + 0x9c,&this->_sprite); ExceptionList = local_1c; return; } //@@ 0064aab0 anm2_apply_gfx_overrides /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: parses 'anm2=' 'spritesheet=' 'animation=' entries of a split string into an ANM2 (ANM2::Load, ReplaceSpritesheet, SetAnimation); used by locust config and Entity_NPC::HandleCollision */ void anm2_apply_gfx_overrides(undefined4 param_1,undefined4 param_2,ANM2 *param_3) { char cVar1; int *piVar2; float fVar3; float fVar4; bool bVar5; int *piVar6; byte bVar7; char *pcVar8; undefined4 *puVar9; char *******pppppppcVar10; float *pfVar11; std_string *pngFilename; void *pvVar12; std_string *psVar13; LayerState *pLVar14; byte extraout_CL; byte extraout_CL_00; uint uVar15; byte *pbVar16; void *pvVar17; byte *******pppppppbVar18; int *extraout_ECX; int *extraout_ECX_00; int *piVar19; byte *******pppppppbVar20; float fVar21; char *pcVar22; ANM2 *pAVar23; int *piVar24; uint uVar25; int iVar26; int *piStack_124; int *piStack_120; float fStack_11c; undefined4 local_114; undefined8 local_110; uint local_104; int *local_100; int local_fc; int *local_f8; int *piStack_f4; float local_f0; uint local_ec; ANM2 *local_e8; uint local_e4; void *local_e0 [4]; undefined4 local_d0; uint local_cc; void *local_c8 [4]; undefined4 local_b8; uint local_b4; float local_b0; float fStack_ac; float fStack_a8; float fStack_a4; float local_a0; undefined1 auStack_9c [8]; float fStack_94; float local_90; int *piStack_8c; float local_88; byte *******local_84; int *piStack_80; int *piStack_7c; float fStack_78; undefined8 local_74; std_string *local_6c [4]; int local_5c; uint local_58; char *******local_54 [4]; undefined4 local_44; uint local_40; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char ******local_14; puStack_20 = (undefined1 *)(local_54 + 0x14); local_14 = (char ******)0xffffffff; puStack_18 = &LAB_00af7351; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_54 + 0x11); ExceptionList = &local_1c; uVar25 = 0; local_114 = param_2; local_e8 = param_3; local_e4 = 0; local_104 = 0; string_split(0x26,local_24); local_74 = 0xf00000000; local_84 = (byte *******)0x0; local_14 = (char ******)0x1; local_100 = (int *)0x0; local_fc = 0; local_100 = operator_new(0x2c); *local_100 = (int)local_100; local_100[1] = (int)local_100; local_100[2] = (int)local_100; *(undefined2 *)(local_100 + 3) = 0x101; local_5c = 0; local_58 = 0xf; local_6c[0] = (std_string *)0x0; local_14._0_1_ = 3; local_ec = 0; uVar15 = (int)piStack_f4 - (int)local_f8; if ((int)uVar15 / 0x18 + ((int)uVar15 >> 0x1f) == (int)uVar15 >> 0x1f) { LAB_0064b108: bVar7 = (byte)uVar15; pAVar23 = local_e8; } else { local_110 = local_110 & 0xffffffff; do { pcVar22 = (char *)((int)local_f8 + uVar25); if (0xf < *(uint *)(pcVar22 + 0x14)) { pcVar22 = *(char **)pcVar22; } pcVar8 = strstr(pcVar22,"anm2="); if (pcVar8 == pcVar22) { puVar9 = (undefined4 *)((int)local_f8 + uVar25); if (0xf < (uint)puVar9[5]) { puVar9 = (undefined4 *)*puVar9; } std::string::string((char *)local_c8,&(g_manager->_itemConfig)._wispGfxRoot); local_e4 = local_e4 | 2; local_14._0_1_ = 4; pbVar16 = (byte *)((int)puVar9 + 5); do { bVar7 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar7 != 0); puVar9 = std::string::append((char *)local_c8,(byte *)((int)puVar9 + 5), (int)pbVar16 - (int)((int)puVar9 + 6)); local_e4 = local_e4 | 4; pppppppbVar20 = (byte *******)*puVar9; piStack_124 = (int *)puVar9[1]; piStack_120 = (int *)puVar9[2]; fStack_11c = (float)puVar9[3]; local_110 = *(ulonglong *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; if (0xf < local_74._4_4_) { uVar15 = local_74._4_4_ + 1; pppppppbVar18 = local_84; if (0xfff < uVar15) { pppppppbVar18 = (byte *******)local_84[-1]; uVar15 = local_74._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_84 + (-4 - (int)pppppppbVar18))) goto LAB_0064b07d; } operator_delete(pppppppbVar18,uVar15); } local_14._0_1_ = 3; local_74 = local_110; local_84 = pppppppbVar20; piStack_80 = piStack_124; piStack_7c = piStack_120; fStack_78 = fStack_11c; if (0xf < local_b4) { uVar15 = local_b4 + 1; pvVar17 = local_c8[0]; if (0xfff < uVar15) { pvVar17 = *(void **)((int)local_c8[0] + -4); uVar15 = local_b4 + 0x24; if (0x1f < (uint)((int)local_c8[0] + (-4 - (int)pvVar17))) goto LAB_0064b07d; } operator_delete(pvVar17,uVar15); } local_b8 = 0; local_b4 = 0xf; local_c8[0] = (void *)((uint)local_c8[0] & 0xffffff00); } else { pcVar22 = (char *)((int)local_f8 + uVar25); if (0xf < *(uint *)(pcVar22 + 0x14)) { pcVar22 = *(char **)pcVar22; } pcVar8 = strstr(pcVar22,"spritesheet="); if (pcVar8 == pcVar22) { puVar9 = (undefined4 *)((int)local_f8 + uVar25); if (0xf < (uint)puVar9[5]) { puVar9 = (undefined4 *)*puVar9; } pbVar16 = (byte *)(puVar9 + 3); pcVar22 = strchr((char *)pbVar16,0x2d); if (pcVar22 != (char *)0x0) { local_44 = 0; local_40 = 0xf; local_54[0] = (char *******)0x0; std::string::assign((char *)local_54,pbVar16,(int)pcVar22 - (int)pbVar16); local_14._0_1_ = 5; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (std_string *)0x0; pbVar16 = (byte *)(pcVar22 + 1); do { bVar7 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar7 != 0); std::string::assign(local_3c._buf,(byte *)(pcVar22 + 1), (int)pbVar16 - (int)(pcVar22 + 2)); local_14._0_1_ = 6; pppppppcVar10 = (char *******)local_54; if (0xf < local_40) { pppppppcVar10 = local_54[0]; } local_104 = atoi((char *)pppppppcVar10); std::string::string((char *)local_e0,&(g_manager->_itemConfig)._wispGfxRoot); uVar15 = local_e4; local_14._0_1_ = 7; psVar13 = &local_3c; if (0xf < local_3c._capacity) { psVar13 = (std_string *)local_3c._buf._0_4_; } pfVar11 = std::string::append((char *)local_e0,(byte *)psVar13,local_3c._size); local_e4 = uVar15 | 0x18; pvVar17 = (void *)*pfVar11; fVar21 = pfVar11[1]; fVar3 = pfVar11[2]; fVar4 = pfVar11[3]; piStack_120 = (int *)pfVar11[4]; fStack_11c = pfVar11[5]; pfVar11[4] = 0.0; pfVar11[5] = 2.10195e-44; *(undefined1 *)pfVar11 = 0; local_14 = (char ******)CONCAT31(local_14._1_3_,8); auStack_9c._0_4_ = pvVar17; auStack_9c._4_4_ = fVar21; fStack_94 = fVar3; local_90 = fVar4; piStack_8c = piStack_120; local_88 = fStack_11c; pfVar11 = (float *)FUN_006518d0(&local_104); if (pfVar11 == (float *)auStack_9c) { fVar21 = local_88; } else { std::string::_Tidy_deallocate((char *)pfVar11); auStack_9c._0_4_ = auStack_9c._0_4_ & 0xffffff00; *pfVar11 = (float)pvVar17; pfVar11[1] = fVar21; pfVar11[2] = fVar3; pfVar11[3] = fVar4; pfVar11[4] = (float)piStack_120; pfVar11[5] = fStack_11c; fVar21 = 2.10195e-44; } local_14._0_1_ = 7; if (0xf < (uint)fVar21) { uVar15 = (int)fVar21 + 1; pvVar17 = (void *)auStack_9c._0_4_; if (0xfff < uVar15) { pvVar17 = *(void **)(auStack_9c._0_4_ + -4); uVar15 = (int)fVar21 + 0x24; if (0x1f < (uint)(auStack_9c._0_4_ + (-4 - (int)pvVar17))) goto LAB_0064b07d; } operator_delete(pvVar17,uVar15); } local_14._0_1_ = 6; if (0xf < local_cc) { uVar15 = local_cc + 1; pvVar17 = local_e0[0]; if (0xfff < uVar15) { pvVar17 = *(void **)((int)local_e0[0] + -4); uVar15 = local_cc + 0x24; if (0x1f < (uint)((int)local_e0[0] + (-4 - (int)pvVar17))) goto LAB_0064b07d; } operator_delete(pvVar17,uVar15); } local_14._0_1_ = 5; local_d0 = 0; local_cc = 0xf; local_e0[0] = (void *)((uint)local_e0[0] & 0xffffff00); if (0xf < local_3c._capacity) { uVar15 = local_3c._capacity + 1; psVar13 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar15) { psVar13 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar15 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar13))) goto LAB_0064b07d; } operator_delete(psVar13,uVar15); } local_14._0_1_ = 3; if (0xf < local_40) { uVar15 = local_40 + 1; pppppppcVar10 = local_54[0]; if (0xfff < uVar15) { pppppppcVar10 = (char *******)local_54[0][-1]; uVar15 = local_40 + 0x24; if ((char *)0x1f < (char *)((int)local_54[0] + (-4 - (int)pppppppcVar10))) goto LAB_0064b07d; } operator_delete(pppppppcVar10,uVar15); } local_44 = 0; local_40 = 0xf; local_54[0] = (char *******)((uint)local_54[0] & 0xffffff00); } uVar25 = local_110._4_4_; } else { pcVar22 = (char *)((int)local_f8 + uVar25); if (0xf < *(uint *)(pcVar22 + 0x14)) { pcVar22 = *(char **)pcVar22; } pcVar8 = strstr(pcVar22,"animation="); if (pcVar8 == pcVar22) { puVar9 = (undefined4 *)((int)local_f8 + uVar25); if (0xf < (uint)puVar9[5]) { puVar9 = (undefined4 *)*puVar9; } pbVar16 = (byte *)((int)puVar9 + 10); do { bVar7 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar7 != 0); std::string::assign((char *)local_6c,(byte *)((int)puVar9 + 10), (int)pbVar16 - (int)((int)puVar9 + 0xb)); } } } uVar25 = uVar25 + 0x18; uVar15 = local_ec + 1; local_110 = CONCAT44(uVar25,(undefined4)local_110); local_ec = uVar15; } while (uVar15 < (uint)(((int)piStack_f4 - (int)local_f8) / 0x18)); if ((int)local_74 == 0) { uVar25 = local_e4; goto LAB_0064b108; } pppppppbVar20 = (byte *******)&local_84; if (0xf < local_74._4_4_) { pppppppbVar20 = local_84; } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (std_string *)0x0; pppppppbVar18 = pppppppbVar20; do { bVar7 = *(byte *)pppppppbVar18; pppppppbVar18 = (byte *******)((int)pppppppbVar18 + 1); } while (bVar7 != 0); std::string::assign(local_3c._buf,(byte *)pppppppbVar20, (int)pppppppbVar18 - (int)((int)pppppppbVar20 + 1)); pAVar23 = local_e8; local_14._0_1_ = 9; ANM2::Load(local_e8,&local_3c,1); local_14._0_1_ = 3; bVar7 = extraout_CL; if (0xf < local_3c._capacity) { uVar15 = local_3c._capacity + 1; psVar13 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar15) { psVar13 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar15 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar13))) goto LAB_0064b07d; } operator_delete(psVar13,uVar15); bVar7 = extraout_CL_00; } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; uVar25 = local_e4; } if (pAVar23->_loaded != 0) { if (local_fc != 0) { piVar24 = (int *)*local_100; if (piVar24 != local_100) { do { ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)auStack_9c,(std_string *)(piVar24 + 5)); local_14._0_1_ = 10; Sprite::ReplaceSpritesheet((Sprite *)local_e8,piVar24[4],pngFilename); local_14._0_1_ = 3; piVar19 = extraout_ECX; if (0xf < (uint)local_88) { uVar15 = (int)local_88 + 1; pvVar17 = (void *)auStack_9c._0_4_; if (0xfff < uVar15) { pvVar17 = *(void **)(auStack_9c._0_4_ + -4); uVar15 = (int)local_88 + 0x24; if (0x1f < (uint)(auStack_9c._0_4_ + (-4 - (int)pvVar17))) goto LAB_0064b07d; } operator_delete(pvVar17,uVar15); piVar19 = extraout_ECX_00; } piVar2 = (int *)piVar24[2]; if (*(char *)((int)piVar2 + 0xd) == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar24 = piVar2; piVar19 = (int *)*piVar2; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar19 + 0xd); piVar24 = piVar19; piVar19 = (int *)*piVar19; } } else { cVar1 = *(char *)(piVar24[1] + 0xd); piVar6 = (int *)piVar24[1]; piVar2 = piVar24; while ((piVar24 = piVar6, cVar1 == '\0' && (piVar2 == (int *)piVar24[2]))) { cVar1 = *(char *)(piVar24[1] + 0xd); piVar6 = (int *)piVar24[1]; piVar2 = piVar24; } } bVar7 = (byte)piVar19; } while (piVar24 != local_100); } pAVar23 = local_e8; ANM2::LoadGraphics(local_e8,bVar7); } if (local_5c == 0) { psVar13 = &pAVar23->_animDefaultName; if (0xf < (pAVar23->_animDefaultName)._capacity) { psVar13 = (std_string *)*(std_string ***)(pAVar23->_animDefaultName)._buf; } } else { psVar13 = (std_string *)local_6c; if (0xf < local_58) { psVar13 = local_6c[0]; } } bVar7 = ANM2::SetAnimation(pAVar23,(byte *)psVar13,1); if (bVar7 != 0) { AnimationState::Rewind(&pAVar23->_animState); (pAVar23->_animState)._isPlaying = 1; } local_14._0_1_ = 0xb; local_104 = uVar25 | 0x20; piStack_124 = (int *)0x0; piStack_120 = (int *)0x0; fStack_11c = 0.0; string_split(&piStack_124); piVar19 = piStack_f4; piVar24 = local_f8; if (local_f8 != (int *)0x0) { for (; piVar24 != piVar19; piVar24 = piVar24 + 6) { uVar15 = piVar24[5]; if (0xf < uVar15) { pvVar17 = (void *)*piVar24; uVar25 = uVar15 + 1; pvVar12 = pvVar17; if (0xfff < uVar25) { pvVar12 = *(void **)((int)pvVar17 + -4); uVar25 = uVar15 + 0x24; if (0x1f < (uint)((int)pvVar17 + (-4 - (int)pvVar12))) goto LAB_0064b07d; } operator_delete(pvVar12,uVar25); } piVar24[4] = 0; piVar24[5] = 0xf; *(undefined1 *)piVar24 = 0; } uVar15 = (((int)local_f0 - (int)local_f8) / 0x18) * 0x18; piVar24 = local_f8; if (0xfff < uVar15) { piVar24 = (int *)local_f8[-1]; uVar15 = uVar15 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_f8 + (-4 - (int)piVar24))) goto LAB_0064b07d; } operator_delete(piVar24,uVar15); } local_f0 = fStack_11c; local_14._0_1_ = 3; local_ec = 0; local_f8 = piStack_124; piStack_f4 = piStack_120; iVar26 = (int)piStack_120 - (int)piStack_124 >> 0x1f; if (((int)piStack_120 - (int)piStack_124) / 0x18 + iVar26 != iVar26) { iVar26 = 0; local_110 = local_110 & 0xffffffff; do { pbVar16 = (byte *)((int)local_f8 + iVar26); if (0xf < *(uint *)(pbVar16 + 0x14)) { pbVar16 = *(byte **)pbVar16; } pcVar22 = strchr((char *)pbVar16,0x2d); if (pcVar22 != (char *)0x0) { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (std_string *)0x0; std::string::assign(local_3c._buf,pbVar16,(int)pcVar22 - (int)pbVar16); local_14._0_1_ = 0xc; local_44 = 0; local_40 = 0xf; local_54[0] = (char *******)0x0; pbVar16 = (byte *)(pcVar22 + 1); do { bVar7 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar7 != 0); std::string::assign((char *)local_54,(byte *)(pcVar22 + 1), (int)pbVar16 - (int)(pcVar22 + 2)); local_14 = (char ******)CONCAT31(local_14._1_3_,0xd); psVar13 = &local_3c; if (0xf < local_3c._capacity) { psVar13 = (std_string *)local_3c._buf._0_4_; } pbVar16 = (byte *)atoi(psVar13->_buf); pAVar23 = local_e8; if (((int)pbVar16 < 0) || (local_e8->_layerCount <= (int)pbVar16)) { bVar5 = false; } else { bVar5 = true; } if (bVar5) { color_preset_lookup(&(g_manager->_itemConfig)._locustConfigs); pLVar14 = ANM2::GetLayer(pAVar23,pbVar16); if (&pLVar14->_color != (ColorMod *)&local_b0) { (pLVar14->_color)._tint[0] = local_b0; (pLVar14->_color)._tint[1] = fStack_ac; (pLVar14->_color)._tint[2] = fStack_a8; (pLVar14->_color)._tint[3] = fStack_a4; (pLVar14->_color)._colorize[0] = local_a0; (pLVar14->_color)._colorize[1] = (float)auStack_9c._0_4_; (pLVar14->_color)._colorize[2] = (float)auStack_9c._4_4_; (pLVar14->_color)._colorize[3] = fStack_94; (pLVar14->_color)._offset[0] = local_90; (pLVar14->_color)._offset[1] = (float)piStack_8c; (pLVar14->_color)._offset[2] = local_88; } } local_14._0_1_ = 0xc; if (0xf < local_40) { uVar15 = local_40 + 1; pppppppcVar10 = local_54[0]; if (0xfff < uVar15) { pppppppcVar10 = (char *******)local_54[0][-1]; uVar15 = local_40 + 0x24; if ((char *)0x1f < (char *)((int)local_54[0] + (-4 - (int)pppppppcVar10))) goto LAB_0064b07d; } operator_delete(pppppppcVar10,uVar15); } local_14._0_1_ = 3; if (0xf < local_3c._capacity) { uVar15 = local_3c._capacity + 1; psVar13 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar15) { psVar13 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar15 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar13))) goto LAB_0064b07d; } operator_delete(psVar13,uVar15); } } local_ec = local_ec + 1; iVar26 = local_110._4_4_ + 0x18; local_110 = CONCAT44(iVar26,(undefined4)local_110); } while (local_ec < (uint)(((int)piStack_f4 - (int)local_f8) / 0x18)); } } if (0xf < local_58) { uVar15 = local_58 + 1; psVar13 = local_6c[0]; if (0xfff < uVar15) { psVar13 = *(std_string **)(local_6c[0][-1]._buf + 0x14); uVar15 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)psVar13))) goto LAB_0064b07d; } operator_delete(psVar13,uVar15); } local_5c = 0; local_58 = 0xf; local_6c[0] = (std_string *)((uint)local_6c[0] & 0xffffff00); FUN_00652780(&local_100,local_100[1]); operator_delete(local_100,0x2c); if (0xf < local_74._4_4_) { uVar15 = local_74._4_4_ + 1; pppppppbVar20 = local_84; if (0xfff < uVar15) { pppppppbVar20 = (byte *******)local_84[-1]; uVar15 = local_74._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_84 + (-4 - (int)pppppppbVar20))) { LAB_0064b07d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar20,uVar15); } piVar19 = piStack_f4; piVar24 = local_f8; if (local_f8 != (int *)0x0) { for (; piVar24 != piVar19; piVar24 = piVar24 + 6) { uVar15 = piVar24[5]; if (0xf < uVar15) { pvVar17 = (void *)*piVar24; uVar25 = uVar15 + 1; pvVar12 = pvVar17; if (0xfff < uVar25) { pvVar12 = *(void **)((int)pvVar17 + -4); uVar25 = uVar15 + 0x24; if (0x1f < (uint)((int)pvVar17 + (-4 - (int)pvVar12))) goto LAB_0064b07d; } operator_delete(pvVar12,uVar25); } piVar24[4] = 0; piVar24[5] = 0xf; *(undefined1 *)piVar24 = 0; } deallocate(local_f8,((int)local_f0 - (int)local_f8) / 0x18); } ExceptionList = local_1c; return; } //@@ 0064b6a0 FUN_0064b6a0 void FUN_0064b6a0(void) { int *in_ECX; FUN_00652780(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x2c); return; } //@@ 0064b6c0 Entity_Familiar::render_abyss_locust_sprite /* DB: ? ECX=familiar, (ANM2*, offset): called from Entity_Familiar::Render over the two ANM2 vectors (stride 0x114) of AbyssLocustData (before and after Entity::Render); fades the sprite alpha +-0.04 by this+0xd88 == -1 (ANM2::Reset at 0), scales by ItemConfig::get_wisp_entry +0x78 * 0.45 * sprite scale (+0x374/+0x378), AnimationState::Update x2, ANM2::Render */ void __thiscall Entity_Familiar::render_abyss_locust_sprite(Entity_Familiar *this,ANM2 *param_2,float *param_3) { void *pvVar1; int collectibleId; int index; float fVar2; float fVar3; double dVar4; Vector local_48 [8]; if (param_2->_loaded != 0) { fVar2 = (param_2->_color)._tint[3]; if (this->_state == -1) { fVar2 = fVar2 + 0.04; fVar3 = 1.0; if (fVar2 <= 1.0) { fVar3 = fVar2; } } else { fVar2 = fVar2 - 0.04; fVar3 = 0.0; if (0.0 <= fVar2) { fVar3 = fVar2; } if (fVar3 == 0.0) { ANM2::Reset(param_2); return; } } (param_2->_color)._tint[3] = fVar3; if (0.0 < fVar3) { if (this->_variant == 0xe7) { collectibleId = this->_subtype; index = this->_coins; } else { collectibleId = 0x19; index = 0; } pvVar1 = ItemConfig::get_wisp_entry(collectibleId,index); fVar3 = *(float *)((int)pvVar1 + 0x78) * 0.45; fVar2 = (this->_sizeMulti).x; (param_2->_scale).y = fVar3 * (this->_sizeMulti).y; (param_2->_scale).x = fVar3 * fVar2; if (param_2->_loaded != 0) { AnimationState::Update(¶m_2->_animState); AnimationState::Update(¶m_2->_overlayAnimState); } fVar2 = g_displayPixelRatio * g_screenPointScale; dVar4 = floor((double)(((((this->_pos).x + 0.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5 ) * fVar2 + 0.5)); local_48[0].x = (float)dVar4 / fVar2; dVar4 = floor((double)(((((this->_pos).y - 25.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar2 + 0.5)); local_48[0].x = local_48[0].x + *param_3; local_48[0].y = (float)dVar4 / fVar2 + param_3[1]; ANM2::Render(param_2,local_48,&g_vectorZero,&g_vectorZero); } } return; } //@@ 0064b920 Entity_Familiar::siren_charm /* DB: ? ECX = familiar, (siren, player): remembers the original player (+0x414), set_player, timer +0xd4c = 45, spawns 0x3c6 (966 ENTITY_SIREN_HELPER) with spawner = Siren and parent = the familiar, counts it for the player, sets +0xef0 = 1 and the familiar's parent to the helper; NpcAI::ENTITY_SIREN_main */ void __thiscall Entity_Familiar::siren_charm(Entity_Familiar *this,EntityPtr param_2,Entity_Player *param_3) { int *piVar1; uint seed; EntityPtr EVar2; EntityPtr *pEVar3; Entity_Familiar *local_c [2]; if (this->_sirenOriginalPlayer == (void *)0x0) { this->_sirenOriginalPlayer = this->_player; } local_c[0] = this; if (this->_player != param_3) { set_player(this,param_3); } this->_fireCooldown = 0x2d; if (this->_target != (EntityPtr)0x0) { local_c[0] = (Entity_Familiar *)&this->_target; std::multiset::erase(local_c); } this->_target = (EntityPtr)0x0; seed = Random(); EVar2 = (EntityPtr)Game::SpawnEx(g_game,0x3c6,0,&this->_pos,&g_vectorZero,(Entity *)0x0,0,seed,0); if (*(EntityPtr *)((int)EVar2 + 0x3bc) != (EntityPtr)0x0) { local_c[0] = (Entity_Familiar *)((int)EVar2 + 0x3bc); std::multiset::erase(local_c); } *(EntityPtr *)((int)EVar2 + 0x3bc) = param_2; if (param_2 != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar2 + 0x3bc)); } if (*(EntityPtr *)((int)EVar2 + 0x3c4) != (EntityPtr)0x0) { local_c[0] = (Entity_Familiar *)((int)EVar2 + 0x3c4); std::multiset::erase(local_c); } *(EntityPtr *)((int)EVar2 + 0x3c4) = (EntityPtr)this; std::multiset::insert((EntityPtr *)((int)EVar2 + 0x3c4)); *(uint *)((int)EVar2 + 0x168) = *(uint *)((int)EVar2 + 0x168) & 0xfffffffb; *(undefined4 *)((int)EVar2 + 0x16c) = *(undefined4 *)((int)EVar2 + 0x16c); *(float *)((int)EVar2 + 0x380) = *(float *)((int)EVar2 + 900); (**(code **)(*(int *)EVar2 + 0xc))(); if (this->_variant == 0x41) { piVar1 = (int *)((int)(param_3->_collectibleCounts)._begin + 0x45c); *piVar1 = *piVar1 + 1; } else if (this->_variant == 0x20) { piVar1 = (int *)((int)(param_3->_collectibleCounts)._begin + 0x1c0); *piVar1 = *piVar1 + 1; } this->_sirenCharmFrames = 1; pEVar3 = &this->_sirenHelper; if (*pEVar3 != EVar2) { if (*pEVar3 != (EntityPtr)0x0) { local_c[0] = (Entity_Familiar *)pEVar3; std::multiset::erase(local_c); } *pEVar3 = EVar2; std::multiset::insert(pEVar3); } return; } //@@ 0064bab0 Entity_Familiar::RemoveFromPlayer /* DB: ? clears owner 0x414/0x410 slots, Siren/ClearReferences */ void __thiscall Entity_Familiar::RemoveFromPlayer(Entity_Familiar *this) { int *piVar1; EntityPtr *pEVar2; void *pvVar3; EntityPtr *local_8; if (this->_sirenOriginalPlayer != (void *)0x0) { pvVar3 = this->_player; if (*(char *)((int)pvVar3 + 0x170) == '\0') { if (this->_variant == 0x41) { piVar1 = (int *)(*(int *)((int)pvVar3 + 0x16c8) + 0x45c); *piVar1 = *piVar1 + -1; } else if (this->_variant == 0x20) { piVar1 = (int *)(*(int *)((int)pvVar3 + 0x16c8) + 0x1c0); *piVar1 = *piVar1 + -1; } } set_player(this,this->_sirenOriginalPlayer); } pEVar2 = &this->_sirenHelper; this->_sirenCharmFrames = 0; this->_sirenOriginalPlayer = (void *)0x0; if (this->_sirenHelper != (EntityPtr)0x0) { (**(code **)(*(int *)this->_sirenHelper + 0x28))(); if (*pEVar2 != (EntityPtr)0x0) { local_8 = pEVar2; std::multiset::erase(&local_8); *pEVar2 = (EntityPtr)0x0; } } if (this->_variant == 0xdc) { (**(code **)(*(int *)this + 0x28))(); } return; } //@@ 0064bb70 Entity::convert_shot_for_enemy_owner /* DB: ? if owner chain has flag 0x100, respawns tear as projectile/attack fly/spider prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::convert_shot_for_enemy_owner(Entity *this,Entity *shot) { Vector *pVVar1; byte *pbVar2; EntityPtr spawner; int iVar3; Vector targetPos; uint seed; Entity *pEVar4; Entity_NPC *pEVar5; float fVar6; uint variant; Vector local_20; Vector local_18; Vector local_10; undefined4 flagsHigh; float *shotOffsetY; if ((((this->_flags & 0x100) != 0) && (spawner = *(EntityPtr *)(*(int *)&this[1].field_0x4 + 0x3c8), spawner != (EntityPtr)0x0)) && (((local_20.x = (float)((int)spawner + 0x28), 1 < *(int *)&g_game->_deathmatchManager && (*(int *)local_20.x == 1)) || (*(int *)local_20.x - 10U < 0x3de)))) { iVar3 = shot->_type; local_18.x = (float)this; if (iVar3 == 2) { seed = Random(); local_20.x = (shot->_pos).x; local_18.x = (shot->_velocity).x * 0.8; local_20.y = (shot->_pos).y; local_18.y = (shot->_velocity).y * 0.8; pEVar4 = Game::SpawnEx(g_game,9,0,&local_20,&local_18,(Entity *)spawner,0,seed,0); iVar3 = *(int *)pEVar4; pEVar4[1]._damageEvents._end = shot[1]._damageEvents._end; pEVar4[1]._damageEvents._begin = shot[1]._damageEvents._begin; *(undefined4 *)&pEVar4[1].field_0x4 = *(undefined4 *)&shot[1].field_0x4; pEVar4[1]._pendingDamage = shot[1]._pendingDamage; (**(code **)(iVar3 + 0x3c))(&shot->_color,0xffffffff,0xff,0,1); (**(code **)(*(int *)shot + 0x28))(); return; } if (iVar3 == 3) { if (shot->_variant == 0x2b) { seed = Random(); local_20.x = (shot->_velocity).x; local_20.y = (shot->_velocity).y; local_10.x = (shot->_pos).x; local_10.y = (shot->_pos).y; pEVar4 = Game::SpawnEx(g_game,0x12,0,&local_10,&local_20,(Entity *)spawner,0,seed,0); flagsHigh = *(undefined4 *)((int)&pEVar4->_flags + 4); fVar6 = pEVar4->_maxHitPoints + pEVar4->_maxHitPoints; *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = flagsHigh; pEVar4->_maxHitPoints = fVar6; pEVar4->_health = fVar6; (**(code **)(*(int *)shot + 0x28))(); if (*(int *)((int)local_18.x + 0x2c) == 0x36) { pVVar1 = &((Entity *)((int)local_18.x + 0xc24))->_gridCollisionNormal; if ((((Entity *)((int)local_18.x + 0xc24))->_gridCollisionNormal).x != 0.0) { local_18.x = (float)pVVar1; std::multiset::erase(&local_18); } pVVar1->x = (float)pEVar4; std::multiset::insert(pVVar1); } return; } if (shot->_variant == 0x49) { shotOffsetY = &(shot->_posOffset).y; if ((*shotOffsetY <= 0.0 && *shotOffsetY != 0.0) || (pbVar2 = &shot[3]._sprite._flipX, *(float *)pbVar2 <= 0.0 && *(float *)pbVar2 != 0.0)) { local_20.y = (shot->_pos).y; local_20.x = (shot->_pos).x; targetPos.y = g_vectorZero.y; targetPos.x = g_vectorZero.x; pEVar5 = Entity_NPC::ThrowSpider (&local_20,(Entity *)spawner,targetPos,0,(this->_posOffset).y); } else { seed = Random(); local_10.x = (shot->_velocity).x; local_10.y = (shot->_velocity).y; local_18.x = (shot->_pos).x; local_18.y = (shot->_pos).y; pEVar5 = (Entity_NPC *) Game::SpawnEx(g_game,0x55,0,&local_18,&local_10,(Entity *)spawner,0,seed,0); } flagsHigh = *(undefined4 *)((int)&pEVar5->_flags + 4); fVar6 = pEVar5->_maxHitPoints + pEVar5->_maxHitPoints; *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar5->_flags + 4) = flagsHigh; pEVar5->_maxHitPoints = fVar6; pEVar5->_health = fVar6; (**(code **)(*(int *)shot + 0x28))(); return; } } else if (iVar3 == 7) { local_18.x = (float)&shot->_spawnerEntity; pEVar4 = this; if (shot->_spawnerEntity != (EntityPtr)0x0) { std::multiset::erase(&local_18); pEVar4 = (Entity *)local_18.x; } local_18.x = (float)pEVar4; shot->_spawnerEntity = spawner; std::multiset::insert(&shot->_spawnerEntity); shot->_spawnerType = *(int *)local_20.x; shot->_spawnerVariant = *(int *)((int)spawner + 0x2c); } else if (iVar3 == 1000) { if (((shot->_variant != 0x2e) || (fVar6 = this[3]._entityRef4._position.x, fVar6 == 0.0)) || (*(float *)((int)fVar6 + 0x3a4) <= 30.0)) { if (shot->_variant != 0x2c) { return; } seed = Random(); variant = 0x19; } else { seed = Random(); variant = 0x16; } local_10.x = (shot->_velocity).x; local_10.y = (shot->_velocity).y; local_18.x = (shot->_pos).x; local_18.y = (shot->_pos).y; pEVar4 = Game::SpawnEx(g_game,1000,variant,&local_18,&local_10,(Entity *)spawner,0,seed,0); iVar3 = *(int *)pEVar4; (pEVar4->_sprite)._scale.x = (shot->_sprite)._scale.x; (pEVar4->_sprite)._scale.y = (shot->_sprite)._scale.y; (**(code **)(iVar3 + 0xc))(); (**(code **)(*(int *)shot + 0x28))(); return; } } return; } //@@ 0064bfa0 FamiliarAI::worm_friend /* DB: Entity_Familiar::Update case 0xe9 (variant 233); EvaluateItems CheckFamiliar(0xe9) from collectible 0x2aa COLLECTIBLE_WORM_FRIEND; strs GrabLoop/GrabEnd/Shoot, Entity::AddSlowing */ int __fastcall FamiliarAI::worm_friend(Entity_Familiar *familiar) { ColorMod color; undefined1 auVar1 [32]; byte bVar2; uint uVar3; EntityPtr EVar4; byte *animNameChar; uint uVar5; int iVar6; byte extraout_CL; char *expectedNameChar; Vector *familiarPos; bool isLess; float fVar7; float fVar8; float fVar9; float local_38; EntityPtr local_34; EntityRef sourceRef; byte *animData; int cooldown; Manager *manager; EntityPtr *ptrSlot; if ((familiar->_fireCooldown == 0) && (familiar->_visible == 0)) { Entity_Familiar::PickEnemyTarget(familiar,365.0,0xd,4,&g_vectorZero,15.0); } fVar7 = (familiar->_targetPosition).x; if ((fVar7 == g_vectorZero.x) && ((familiar->_targetPosition).y == g_vectorZero.y)) { EVar4 = familiar->_target; familiarPos = &familiar->_pos; if (EVar4 == (EntityPtr)0x0) { local_38 = *(float *)((int)familiar->_player + 0x33c) - familiarPos->x; fVar7 = *(float *)((int)familiar->_player + 0x340) - (familiar->_pos).y; fVar8 = local_38 * local_38 + fVar7 * fVar7; if (6400.0 < fVar8) { fVar9 = sqrtf(fVar8); fVar8 = local_38; if (0.0 < fVar9) { fVar7 = fVar7 * (1.0 / fVar9); fVar8 = local_38 * (1.0 / fVar9); } fVar9 = familiar->_speedMultiplier; (familiar->_velocity).y = fVar9 * fVar7 + (familiar->_velocity).y; (familiar->_velocity).x = fVar9 * fVar8 + (familiar->_velocity).x; } } else { fVar7 = (familiar->_pos).y - *(float *)((int)EVar4 + 0x340); fVar8 = familiarPos->x - *(float *)((int)EVar4 + 0x33c); fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); local_38 = (fVar7 * 0.1 * *(float *)((int)EVar4 + 0x364) + *(float *)((int)EVar4 + 0x340)) - (familiar->_pos).y; fVar9 = (fVar7 * 0.1 * *(float *)((int)EVar4 + 0x360) + *(float *)((int)EVar4 + 0x33c)) - familiarPos->x; local_34 = (EntityPtr)(local_38 * local_38 + fVar9 * fVar9); fVar9 = (*(float *)((int)EVar4 + 0x360) * 5.0 - (familiar->_velocity).x * 5.0) + fVar9; local_38 = (*(float *)((int)EVar4 + 0x364) * 5.0 - (familiar->_velocity).y * 5.0) + local_38; fVar8 = sqrtf(fVar9 * fVar9 + local_38 * local_38); fVar7 = local_38; if (0.0 < fVar8) { fVar7 = local_38 * (1.0 / fVar8); fVar9 = fVar9 * (1.0 / fVar8); } fVar8 = familiar->_speedMultiplier; (familiar->_velocity).y = fVar8 * fVar7 + (familiar->_velocity).y; (familiar->_velocity).x = fVar8 * fVar9 + (familiar->_velocity).x; if ((familiar->_visible == 0) && ((float)local_34 < 900.0)) { ptrSlot = &familiar->_child; bVar2 = 0; if (familiar->_child != (EntityPtr)0x0) { (**(code **)(*(int *)familiar->_child + 0x28))(); bVar2 = 0; if (*ptrSlot != (EntityPtr)0x0) { local_34 = (EntityPtr)ptrSlot; std::multiset::erase(&local_34); bVar2 = extraout_CL; } *ptrSlot = (EntityPtr)0x0; } Entity_Familiar::UpdateDirtColor(familiar,bVar2); bVar2 = ANM2::SetAnimation(&familiar->_sprite,&DAT_00b60954,1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } manager = g_manager; familiar->_visible = 1; local_38 = 1.00893e-43; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)familiar->_target + 0x28) != 1)) { familiar->_fireCooldown = 0x96; } else { familiar->_fireCooldown = 0x2d; } } } } else { fVar8 = (familiar->_targetPosition).y; fVar9 = (familiar->_pos).y; (familiar->_velocity).x = fVar7 - (familiar->_pos).x; (familiar->_velocity).y = fVar8 - fVar9; } familiarPos = &familiar->_pos; if (((familiar->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(familiar->_sprite)._animState,(byte *)"Shoot"), bVar2 != 0)) { if (familiar->_state == 0) { EVar4 = familiar->_target; if ((EVar4 != (EntityPtr)0x0) && (fVar8 = familiarPos->x - *(float *)((int)EVar4 + 0x33c), fVar7 = (familiar->_pos).y - *(float *)((int)EVar4 + 0x340), fVar7 * fVar7 + fVar8 * fVar8 < 900.0)) { uVar3 = Random(); EVar4 = (EntityPtr) Game::SpawnEx(g_game,1000,0xb8,familiarPos,&g_vectorZero,(Entity *)familiar,0,uVar3, 0); if (*(EntityPtr *)((int)EVar4 + 0x3bc) != (EntityPtr)0x0) { local_34 = (EntityPtr)((int)EVar4 + 0x3bc); std::multiset::erase(&local_34); } *(EntityPtr *)((int)EVar4 + 0x3bc) = (EntityPtr)familiar; std::multiset::insert((EntityPtr *)((int)EVar4 + 0x3bc)); *(undefined4 *)((int)EVar4 + 0x450) = 2; *(int *)((int)EVar4 + 0x354) = 200; if (familiar->_child != (EntityPtr)0x0) { local_34 = (EntityPtr)&familiar->_child; std::multiset::erase(&local_34); } familiar->_child = EVar4; std::multiset::insert(&familiar->_child); (**(code **)(*(int *)EVar4 + 0xc))(); familiar->_state = 1; (familiar->_targetPosition).x = familiarPos->x; (familiar->_targetPosition).y = (familiar->_pos).y; goto LAB_0064c5a7; } ptrSlot = &familiar->_child; if (familiar->_child != (EntityPtr)0x0) { (**(code **)(*(int *)familiar->_child + 0x28))(); if (*ptrSlot != (EntityPtr)0x0) { local_34 = (EntityPtr)ptrSlot; std::multiset::erase(&local_34); } *ptrSlot = (EntityPtr)0x0; } animData = (familiar->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0064c4fe: bVar2 = ANM2::SetAnimation(&familiar->_sprite,(byte *)"GrabEnd",1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedNameChar = "GrabEnd"; do { bVar2 = *animNameChar; isLess = bVar2 < (byte)*expectedNameChar; if (bVar2 != *expectedNameChar) { LAB_0064c4e0: uVar3 = -(uint)isLess | 1; goto LAB_0064c4e5; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; isLess = bVar2 < (byte)expectedNameChar[1]; if (bVar2 != expectedNameChar[1]) goto LAB_0064c4e0; animNameChar = animNameChar + 2; expectedNameChar = expectedNameChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0064c4e5: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((familiar->_sprite)._animState._isPlaying == 0)))) goto LAB_0064c4fe; } if ((familiar->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(familiar->_sprite)._animState,10.0); } (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; } else { if (familiar->_state != 1) goto LAB_0064c5a7; familiar->_state = 2; } manager = g_manager; local_38 = 9.24857e-44; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); } LAB_0064c5a7: if ((familiar->_state == 1) && (((familiar->_target == (EntityPtr)0x0 || (*(int *)((int)familiar->_target + 0x188) == 0)) || (familiar->_fireCooldown < 1)))) { animData = (familiar->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedNameChar = "GrabEnd"; do { bVar2 = *animNameChar; isLess = bVar2 < (byte)*expectedNameChar; if (bVar2 != *expectedNameChar) { LAB_0064c606: uVar3 = -(uint)isLess | 1; goto LAB_0064c60b; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; isLess = bVar2 < (byte)expectedNameChar[1]; if (bVar2 != expectedNameChar[1]) goto LAB_0064c606; animNameChar = animNameChar + 2; expectedNameChar = expectedNameChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0064c60b: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_0064c642; } bVar2 = ANM2::SetAnimation(&familiar->_sprite,(byte *)"GrabEnd",1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } LAB_0064c642: if ((familiar->_visible != 0) && (((familiar->_sprite)._animState._animData == (void *)0x0 || ((familiar->_sprite)._animState._isPlaying == 0)))) { if (familiar->_state == 1) { animData = (familiar->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedNameChar = "GrabLoop"; do { bVar2 = *animNameChar; isLess = bVar2 < (byte)*expectedNameChar; if (bVar2 != *expectedNameChar) { LAB_0064c6a1: uVar3 = -(uint)isLess | 1; goto LAB_0064c6a6; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; isLess = bVar2 < (byte)expectedNameChar[1]; if (bVar2 != expectedNameChar[1]) goto LAB_0064c6a1; animNameChar = animNameChar + 2; expectedNameChar = expectedNameChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0064c6a6: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((familiar->_sprite)._animState._isPlaying != 0)))) goto LAB_0064c748; } bVar2 = ANM2::SetAnimation(&familiar->_sprite,(byte *)"GrabLoop",1); if (bVar2 != 0) { AnimationState::Rewind(&(familiar->_sprite)._animState); (familiar->_sprite)._animState._isPlaying = 1; } } else { familiar->_fireCooldown = 0x5a; ptrSlot = &familiar->_target; familiar->_state = 0; familiar->_visible = 0; (familiar->_targetPosition).x = g_vectorZero.x; (familiar->_targetPosition).y = g_vectorZero.y; if (*ptrSlot != (EntityPtr)0x0) { local_34 = (EntityPtr)ptrSlot; std::multiset::erase(&local_34); } *ptrSlot = (EntityPtr)0x0; } } LAB_0064c748: if (0 < familiar->_fireCooldown) { familiar->_fireCooldown = familiar->_fireCooldown + -1; } iVar6 = familiar->_state; familiar->_entityCollisionClass = 0; fVar7 = (familiar->_velocity).x; if (iVar6 == 0) { (familiar->_velocity).x = fVar7 * 0.9; (familiar->_velocity).y = (familiar->_velocity).y * 0.9; return 0; } (familiar->_velocity).x = fVar7 * 0.5; (familiar->_velocity).y = (familiar->_velocity).y * 0.5; if (iVar6 == 1) { EVar4 = familiar->_target; iVar6 = 0; if (EVar4 != (EntityPtr)0x0) { fVar7 = (familiar->_pos).y; *(float *)((int)EVar4 + 0x360) = familiarPos->x - *(float *)((int)EVar4 + 0x33c); *(float *)((int)EVar4 + 0x364) = fVar7 - *(float *)((int)EVar4 + 0x340); local_34 = familiar->_target; sourceRef._position.x = familiarPos->x; sourceRef._position.y = (familiar->_pos).y; sourceRef._type = familiar->_type; sourceRef._variant = familiar->_variant; sourceRef._spawnerType = familiar->_spawnerType; sourceRef._spawnerVariant = familiar->_spawnerVariant; sourceRef._velocity.x = (familiar->_velocity).x; sourceRef._velocity.y = (familiar->_velocity).y; if ((familiar->_flags & 0x20000000) == 0) { uVar3 = 0; } else { uVar3 = 2; } if ((familiar->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } sourceRef._flags = uVar5 | uVar3 | (uint)((familiar->_flags & 0x100) != 0); auVar1 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3fa66666,0x3f8000003f800000))); color._offset[0] = 0.15686275; color._tint[0] = (float)auVar1._0_4_; color._tint[1] = (float)auVar1._4_4_; color._tint[2] = (float)auVar1._8_4_; color._tint[3] = (float)auVar1._12_4_; color._colorize[0] = (float)auVar1._16_4_; color._colorize[1] = (float)auVar1._20_4_; color._colorize[2] = (float)auVar1._24_4_; color._colorize[3] = (float)auVar1._28_4_; color._offset[1] = 0.15686275; color._offset[2] = 0.15686275; sourceRef._entity = familiar; Entity::AddSlowing((Entity *)local_34,&sourceRef,-1,0.9,color,0); cooldown = familiar->_fireCooldown; iVar6 = cooldown; if ((0 < cooldown) && (iVar6 = cooldown / 0xf, cooldown % 0xf == 0)) { fVar7 = Entity_Familiar::apply_tear_modifiers(familiar); sourceRef._position.x = familiarPos->x; sourceRef._position.y = (familiar->_pos).y; local_34 = *(EntityPtr *)(*(int *)familiar->_target + 0x20); sourceRef._velocity.x = (familiar->_velocity).x; sourceRef._type = familiar->_type; sourceRef._variant = familiar->_variant; sourceRef._spawnerType = familiar->_spawnerType; sourceRef._spawnerVariant = familiar->_spawnerVariant; sourceRef._velocity.y = (familiar->_velocity).y; if ((familiar->_flags & 0x20000000) == 0) { uVar3 = 0; } else { uVar3 = 2; } if ((familiar->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } sourceRef._flags = uVar5 | uVar3 | (uint)((familiar->_flags & 0x100) != 0); sourceRef._entity = familiar; iVar6 = (*(code *)local_34)(fVar7 * familiar->_collisionDamage,0,0,&sourceRef,0x1e); } } } return iVar6; } //@@ 0064ca30 Entity_Familiar::UpdateDirtColor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix75/77] __thiscall void Entity_Familiar::UpdateDirtColor(bool Immediate); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Familiar::UpdateDirtColor(Entity_Familiar *this,byte Immediate) { float fVar1; float fVar2; float fVar3; byte bVar4; LayerState *layer; ColorMod *lerpedColor; byte *****pppppbVar5; byte *****pppppbVar6; uint uVar7; ColorMod *layerColor; uint freeSize; ColorMod lerpResult; ANM2 *sprite; Entity_Familiar *familiar; ColorMod *dirtColor; LayerState *currentLayer; byte *****layerNameBuf; uint local_64; byte *layerIndex; char isDirtLayer; uint cleanupFlags; byte *****layerName [4]; uint layerNameSize; uint layerNameCapacity; byte *****layerNameCopy; KColor local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(layerName + 0x14); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00af739e; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(layerName + 0x11); ExceptionList = &local_1c; local_64 = 0; cleanupFlags = 0; familiar = this; Room::GetFloorColorAt(g_game->_room,&local_38,&this->_pos,this->_size); dirtColor = &this->_dirtColor; (this->_dirtColor)._tint[3] = 1.0; dirtColor->_tint[0] = local_38._red * 2.0; (this->_dirtColor)._tint[1] = local_38._green * 2.0; (this->_dirtColor)._tint[2] = local_38._blue * 2.0; layerIndex = (byte *)0x0; if ((this->_sprite)._layerCount == 0) { ExceptionList = local_1c; return; } sprite = &this->_sprite; do { layer = ANM2::GetLayer(sprite,layerIndex); cleanupFlags = cleanupFlags | 4; currentLayer = layer; if (layer->_layerData == (void *)0x0) { layerNameCapacity = 0xf; layerNameSize = 0; layerName[0] = (byte *****)0x0; } else { std::string::string((char *)layerName,(void *)((int)layer->_layerData + 8)); } local_14 = (byte ****)0x0; local_64 = cleanupFlags | 1; pppppbVar6 = (byte *****)layerName; if (0xf < layerNameCapacity) { pppppbVar6 = layerName[0]; } layerNameBuf = layerName[0]; cleanupFlags = local_64; bVar4 = str_eq((byte *)pppppbVar6,layerNameSize,&DAT_00b64428,4); if (bVar4 == 0) { cleanupFlags = cleanupFlags | 8; if (layer->_layerData == (void *)0x0) { layerNameCopy = (byte *****)0x0; local_38._unk = 0xf; local_38._alpha = 0.0; } else { std::string::string((char *)&layerNameCopy,(void *)((int)layer->_layerData + 8)); } uVar7 = local_38._unk; pppppbVar6 = layerNameCopy; cleanupFlags = cleanupFlags | 2; pppppbVar5 = (byte *****)&layerNameCopy; if (0xf < (uint)local_38._unk) { pppppbVar5 = layerNameCopy; } bVar4 = str_eq((byte *)pppppbVar5,(uint)local_38._alpha,&DAT_00b1d57c,4); if (bVar4 != 0) goto LAB_0064cbdf; isDirtLayer = '\0'; } else { pppppbVar6 = layerNameCopy; uVar7 = local_38._unk; LAB_0064cbdf: isDirtLayer = '\x01'; } if (((cleanupFlags & 2) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffd, 0xf < uVar7)) { freeSize = uVar7 + 1; pppppbVar5 = pppppbVar6; if (0xfff < freeSize) { pppppbVar5 = (byte *****)pppppbVar6[-1]; freeSize = uVar7 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar6 + (-4 - (int)pppppbVar5))) goto LAB_0064ccc7; } operator_delete(pppppbVar5,freeSize); } local_14 = (byte ****)0xffffffff; if (((cleanupFlags & 1) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffe, 0xf < layerNameCapacity)) { uVar7 = layerNameCapacity + 1; pppppbVar6 = layerNameBuf; if (0xfff < uVar7) { pppppbVar6 = (byte *****)layerNameBuf[-1]; uVar7 = layerNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)layerNameBuf + (-4 - (int)pppppbVar6))) { LAB_0064ccc7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar6,uVar7); } layer = currentLayer; if (isDirtLayer != '\0') { layerColor = ¤tLayer->_color; lerpedColor = Color::Lerp(&lerpResult,layerColor,dirtColor,1.0); if (layerColor != lerpedColor) { fVar1 = lerpedColor->_tint[1]; fVar2 = lerpedColor->_tint[2]; fVar3 = lerpedColor->_tint[3]; layerColor->_tint[0] = lerpedColor->_tint[0]; (layer->_color)._tint[1] = fVar1; (layer->_color)._tint[2] = fVar2; (layer->_color)._tint[3] = fVar3; fVar1 = lerpedColor->_colorize[1]; fVar2 = lerpedColor->_colorize[2]; fVar3 = lerpedColor->_colorize[3]; (layer->_color)._colorize[0] = lerpedColor->_colorize[0]; (layer->_color)._colorize[1] = fVar1; (layer->_color)._colorize[2] = fVar2; (layer->_color)._colorize[3] = fVar3; fVar1 = lerpedColor->_offset[1]; (layer->_color)._offset[0] = lerpedColor->_offset[0]; (layer->_color)._offset[1] = fVar1; (layer->_color)._offset[2] = lerpedColor->_offset[2]; } } layerIndex = layerIndex + 1; if ((byte *)(familiar->_sprite)._layerCount <= layerIndex) { ExceptionList = local_1c; return; } } while( true ); } //@@ 0064ccf0 FUN_0064ccf0 int FUN_0064ccf0(void) { int in_ECX; if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && (g_game->_stage == 0xb)) && (in_ECX == -7)) { return g_game->_startingRoomIdx + -0xd; } if (in_ECX < 0) { return 0xa8 - in_ECX; } return in_ECX; } //@@ 0064cd30 level_get_room_neighbors /* DB: ? param_1 room grid index (13x13 map, < 0xa9), param_2 out array: appends the 4 orthogonal neighbours present in Game::_roomMap (FUN_0064ccf0 maps negative/special indices), plus the special links of stage 8 alt path (0xb2) and stage 11 starting room; returns the count; BFS helper of 0064cf20 Level::compute_room_distances int level_get_room_neighbors(uint param_1,uint *param_2) { bool bVar1; bool bVar2; Game *pGVar3; uint uVar4; uint uVar5; uint uVar6; int iVar7; uint uVar8; uint *puVar9; pGVar3 = g_game; puVar9 = param_2; if (param_1 < 0xa9) { if ((0 < (int)param_1 % 0xd) && (g_game->_roomMap[param_1 - 1] != -1)) { uVar4 = FUN_0064ccf0(); *param_2 = uVar4; puVar9 = param_2 + 1; } if (((int)param_1 % 0xd < 0xc) && (pGVar3->_roomMap[param_1 + 1] != -1)) { uVar4 = FUN_0064ccf0(); *puVar9 = uVar4; puVar9 = puVar9 + 1; } if ((0 < (int)param_1 / 0xd) && (pGVar3->_roomMap[param_1 - 0xd] != -1)) { uVar4 = FUN_0064ccf0(); *puVar9 = uVar4; puVar9 = puVar9 + 1; } if (((int)param_1 / 0xd < 0xc) && (pGVar3->_roomMap[param_1 + 0xd] != -1)) { uVar4 = FUN_0064ccf0(); *puVar9 = uVar4; puVar9 = puVar9 + 1; } } if ((g_game->_difficulty == 2) || (bVar1 = false, g_game->_difficulty == 3)) { bVar1 = true; } iVar7 = g_game->_stage; if ((g_game->_stageType == 4) || (bVar2 = false, g_game->_stageType == 5)) { bVar2 = true; } if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 5)) || (iVar7 == 7)) { uVar4 = g_game->_debugCurses; uVar8 = g_game->_curses; uVar5 = Seeds::GetForcedCurses(); uVar6 = Seeds::GetPreventedCurses(); if ((~uVar6 & (uVar5 | uVar4 | uVar8) & 2) != 0) { iVar7 = iVar7 + 1; } } pGVar3 = g_game; if (!bVar1) { if (iVar7 == 8) { if ((bVar2) && (-1 < g_game->_lastBossRoomListIdx)) { uVar4 = FUN_0064ccf0(); if (param_1 == uVar4) { *puVar9 = 0xb2; puVar9 = puVar9 + 1; } if (param_1 == 0xb2) { *puVar9 = uVar4; return (int)puVar9 + (4 - (int)param_2) >> 2; } } } else if (iVar7 == 0xb) { uVar4 = FUN_0064ccf0(); if (((pGVar3->_difficulty == 2) || (pGVar3->_difficulty == 3)) || (pGVar3->_stage != 0xb)) { uVar8 = 0xaf; } else { uVar8 = pGVar3->_startingRoomIdx - 0xd; } if (param_1 == uVar4) { *puVar9 = uVar8; puVar9 = puVar9 + 1; } if (param_1 == uVar8) { *puVar9 = uVar4; puVar9 = puVar9 + 1; } } } return (int)puVar9 - (int)param_2 >> 2; } //@@ 0064cf20 Level::compute_room_distances /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? fills a 0x17a-byte buffer with 0xff, then BFS over Game::_roomMap with a std::deque, ushort distance per room, neighbour helper 0064cd30; callers Entity_Familiar::update_star_of_bethlehem_speed, FamiliarAI::star_of_bethlehem (was a weak ZHL prefix match Entity_Player::ChangePlayerType) */ undefined4 __thiscall Level::compute_room_distances(Level *this,int param_2,uint param_3,uint *param_4) { ushort *currentDistance; undefined2 extraout_var; void *queueMapBlock; void *pvVar1; uint newDistance; int iVar2; uint uVar3; uint neighborRoom; int fromRoomIdx; uint *outNextRoomIdx; int neighborCount; uint local_54; Level *distances; int *queueProxyRef; void *queueMap; int queueMapSize; uint queueOffset; int queueSize; int *local_38; uint neighbors [8]; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; Level *distancesCopy; undefined2 fromDistance; ushort neighborDistance; int *queueProxy; local_8 = 0xffffffff; puStack_c = &LAB_00af73dd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(neighbors + 0xc); ExceptionList = &local_10; local_54 = param_3; outNextRoomIdx = param_4; local_38 = g_game->_roomMap; fromRoomIdx = param_2; distances = this; memset(this,0xff,0x17a); queueProxyRef = (int *)0x0; queueMap = (void *)0x0; queueMapSize = 0; queueOffset = 0; queueSize = 0; queueProxyRef = operator_new(8); queueProxyRef[1] = 0; *queueProxyRef = (int)&queueProxyRef; local_8 = 0; std::deque::push_front(&local_54); *(undefined2 *)((int)this->_roomList[0]._doors + local_54 * 2 + -0x30) = 0; if (queueSize != 0) { do { queueSize = queueSize + -1; uVar3 = *(uint *)(*(int *)((int)queueMap + (queueOffset >> 2 & queueMapSize - 1U) * 4) + (queueOffset & 3) * 4); if (queueSize == 0) { queueOffset = 0; } else { queueOffset = queueOffset + 1; } neighborCount = level_get_room_neighbors(uVar3,neighbors); iVar2 = 0; if (0 < neighborCount) { currentDistance = (ushort *)((int)distances->_roomList[0]._doors + uVar3 * 2 + -0x30); do { distancesCopy = distances; local_54 = (uint)*currentDistance; neighborRoom = neighbors[iVar2]; newDistance = local_54 + 3; if (((uVar3 < 0xa9) && (neighborRoom < 0xa9)) && (local_38[neighborRoom] == local_38[uVar3])) { newDistance = local_54 + 1; } if (newDistance < *(ushort *)((int)distances->_roomList[0]._doors + neighborRoom * 2 + -0x30)) { *(short *)((int)distances->_roomList[0]._doors + neighborRoom * 2 + -0x30) = (short)newDistance; std::deque::push_front(&neighborRoom); } iVar2 = iVar2 + 1; currentDistance = (ushort *)((int)distancesCopy->_roomList[0]._doors + uVar3 * 2 + -0x30); } while (iVar2 < neighborCount); } } while (queueSize != 0); param_2 = fromRoomIdx; } if (outNextRoomIdx != (uint *)0x0) { neighborCount = level_get_room_neighbors(param_2,neighbors); uVar3 = 0xffffffff; iVar2 = 0; local_38 = (int *)0xffff; if (0 < neighborCount) { do { neighborDistance = *(ushort *)((int)distances->_roomList[0]._doors + neighbors[iVar2] * 2 + -0x30); if (neighborDistance < (ushort)local_38) { local_38 = (int *)(uint)neighborDistance; uVar3 = neighbors[iVar2]; } iVar2 = iVar2 + 1; } while (iVar2 < neighborCount); } *outNextRoomIdx = uVar3; } fromDistance = *(undefined2 *)((int)distances->_roomList[0]._doors + fromRoomIdx * 2 + -0x30); if (queueSize != 0) { do { queueSize = queueSize + -1; } while (queueSize != 0); queueOffset = 0; queueSize = 0; } queueMapBlock = queueMap; iVar2 = queueMapSize; if (queueMapSize != 0) { do { pvVar1 = *(void **)((int)queueMapBlock + iVar2 * 4 + -4); iVar2 = iVar2 + -1; if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x10); queueMapBlock = queueMap; } } while (iVar2 != 0); } if (queueMapBlock != (void *)0x0) { uVar3 = queueMapSize * 4; pvVar1 = queueMapBlock; if (0xfff < uVar3) { pvVar1 = *(void **)((int)queueMapBlock + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)queueMapBlock + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,uVar3); } queueProxy = queueProxyRef; queueMapSize = 0; queueMap = (void *)0x0; queueProxyRef = (int *)0x0; operator_delete(queueProxy,8); ExceptionList = local_10; return CONCAT22(extraout_var,fromDistance); } //@@ 0064d1d0 Entity_Familiar::update_star_of_bethlehem_speed /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall familiar (Star of Bethlehem): unless forced, compares grid path distances (FUN_0064cf20) from the star target cell (+0xd90) and from the player to the exit, and sets the speed multiplier +0xd60 to 0.25/0.5/1/4/8; Entity_Familiar::room_enter, FamiliarAI::star_of_bethlehem */ void __thiscall Entity_Familiar::update_star_of_bethlehem_speed(Entity_Familiar *this,char param_2) { float fVar1; float fVar2; int iVar3; short sVar4; short sVar5; undefined4 uVar6; undefined1 local_18c [388]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18c + 0x188); if ((param_2 == '\0') && ((fVar1 = (this->_formationOffset).x, fVar1 != g_vectorZero.x || ((this->_formationOffset).y != g_vectorZero.y)))) { if (g_game->_currentDimensionIdx != 0) { LAB_0064d32e: this->_orbitAngleOffset = 0.25; return; } fVar2 = (this->_formationOffset).y; iVar3 = g_game->_currentRoomIdx; uVar6 = star_of_bethlehem_get_target_room(); if (-1 < iVar3) { sVar4 = Level::compute_room_distances ((Level *)local_18c,(int)(fVar2 + 0.5) * 0xd + (int)(fVar1 + 0.5),uVar6,0); sVar5 = Level::compute_room_distances((Level *)local_18c,iVar3,uVar6,0); if (sVar4 + 9 < (int)sVar5) goto LAB_0064d32e; if (sVar4 < sVar5) { this->_orbitAngleOffset = 0.5; return; } if (sVar5 + 9 < (int)sVar4) { this->_orbitAngleOffset = 8.0; return; } if (sVar5 < sVar4) { this->_orbitAngleOffset = 4.0; return; } } } this->_orbitAngleOffset = 1.0; return; } //@@ 0064d370 star_of_bethlehem_get_target_room /* DB: ? no this: picks the room index the Star of Bethlehem walks to: _lastBossRoomListIdx, curse of labyrinth stage+1, stage 12 / 8 alt (0x204) / 11 special cases; Entity_Familiar::update_star_of_bethlehem_speed, FamiliarAI::star_of_bethlehem */ int star_of_bethlehem_get_target_room(void) { uint uVar1; void *pvVar2; bool bVar3; bool bVar4; uint uVar5; uint uVar6; int iVar7; RoomDescriptor *pRVar8; RoomDescriptor *pRVar9; int iVar10; uint uVar11; Game *pGVar12; int iVar13; pGVar12 = g_game; if ((g_game->_difficulty == 2) || (bVar3 = false, g_game->_difficulty == 3)) { bVar3 = true; } iVar7 = g_game->_stage; if ((g_game->_stageType == 4) || (bVar4 = false, g_game->_stageType == 5)) { bVar4 = true; } if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 5)) || (iVar7 == 7)) { uVar11 = g_game->_debugCurses; uVar1 = g_game->_curses; uVar5 = Seeds::GetForcedCurses(); uVar6 = Seeds::GetPreventedCurses(); if ((~uVar6 & (uVar5 | uVar11 | uVar1) & 2) != 0) { iVar7 = iVar7 + 1; } } iVar13 = pGVar12->_lastBossRoomListIdx; if (!bVar3) { if (iVar7 == 0xc) { iVar13 = *(int *)&pGVar12->field_0x18330; } else if (iVar7 == 8) { if (bVar4) { iVar13 = 0x204; goto LAB_0064d516; } } else if (iVar7 == 0xb) { pRVar8 = Level::GetRoomByIdx((Level *)pGVar12,pGVar12->_startingRoomIdx,-1); if ((pRVar8->Data != (void *)0x0) && (-1 < pRVar8->_doors[1])) { pRVar9 = Level::GetRoomByIdx((Level *)g_game,pRVar8->_doors[1],-1); if (pRVar9->Data == (void *)0x0) { pRVar9 = Game::GetCurrentRoomDesc(g_game); pGVar12 = g_game; if (pRVar9 == pRVar8) { iVar7 = *(int *)((int)g_game->_room + 0x728); if ((iVar7 != 0) && (*(int *)(iVar7 + 0x394) == -7)) { iVar7 = *(int *)(iVar7 + 0xc); LAB_0064d503: if (iVar7 == 2) { iVar13 = 0x201; goto LAB_0064d516; } } } else { iVar7 = *(int *)((int)pRVar8->Data + 0x48); uVar11 = (uint)*(byte *)((int)pRVar8->Data + 0x46); iVar10 = 0; if (iVar7 == 9) { iVar7 = (uVar11 + 1) * 7; } else if (iVar7 == 10) { iVar7 = 7; } else if (iVar7 == 0xb) { iVar7 = 7; } else if (iVar7 == 0xc) { iVar7 = 7; } else { if ((iVar7 == 2) || (iVar7 == 7)) { iVar10 = 3; } iVar7 = uVar11 * iVar10 + 7; } pvVar2 = (pRVar8->SavedGridEntities)._begin; if (*(int *)((int)pvVar2 + iVar7 * 0x20) == 0x10) { iVar7 = *(int *)((int)pvVar2 + iVar7 * 0x20 + 8); goto LAB_0064d503; } } goto LAB_0064d512; } } pGVar12 = g_game; } } LAB_0064d512: if (iVar13 < 0) { return -1; } LAB_0064d516: iVar7 = pGVar12->_roomList[iVar13].SafeGridIndex; if ((((pGVar12->_difficulty != 2) && (pGVar12->_difficulty != 3)) && (pGVar12->_stage == 0xb)) && (iVar7 == -7)) { return pGVar12->_startingRoomIdx + -0xd; } if (iVar7 < 0) { return 0xa8 - iVar7; } return iVar7; } //@@ 0064d570 FUN_0064d570 void FUN_0064d570(uint param_1) { float *in_ECX; int in_EDX; *in_ECX = (float)(in_EDX % 0xd) + (float)(int)((param_1 & 0xffff) - 0x8000) * 1.5258789e-05; in_ECX[1] = (float)(int)(((int)param_1 >> 0x10 & 0xffffU) - 0x8000) * 1.5258789e-05 + (float)(in_EDX / 0xd); return; } //@@ 0064d5f0 FamiliarAI::star_of_bethlehem /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Unable to use type for symbol nextRoomIdx */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Entity_Familiar::Update case 0xec (variant 236); EvaluateItems CheckFamiliar(0xec) from collectible 0x28b COLLECTIBLE_STAR_OF_BETHLEHEM; Level::GetRoomByIdx path toward boss, SpawnEx 1000.0x70 */ void __fastcall FamiliarAI::star_of_bethlehem(Entity_Familiar *familiar) { byte isInRoom; RoomDescriptor *roomDesc; RoomDescriptor *targetRoomDesc; uint uVar1; float *pfVar2; int iVar3; int iVar4; void *pvVar5; EntityPtr *pEVar6; PlayerManager *playerManager; Game *game; EntityPtr EVar7; float fVar8; float fVar9; float stepY; undefined1 auStack_1c8 [4]; EntityPtr *local_1c4; float targetX; float targetY; EntityPtr local_1b8; EntityPtr *local_1b4; Vector local_1b0; Vector local_1a8; EntityPtr *targetRoomIdx; undefined1 roomDistances [388]; uint local_c; EntityPtr *nextRoomIdx; local_c = __security_cookie ^ (uint)auStack_1c8; local_1b0.x = (familiar->_formationOffset).x; local_1a8.x = (familiar->_formationOffset).y; targetX = (float)(familiar->_coins % 0xd) + (float)(int)((familiar->_hearts & 0xffffU) - 0x8000) * 1.5258789e-05; targetY = (float)(int)((familiar->_hearts >> 0x10 & 0xffffU) - 0x8000) * 1.5258789e-05 + (float)(familiar->_coins / 0xd); pEVar6 = (EntityPtr *)((int)(local_1a8.x + 0.5) * 0xd + (int)(local_1b0.x + 0.5)); local_1c4 = pEVar6; local_1b8 = (EntityPtr)familiar; local_1b4 = (EntityPtr *)star_of_bethlehem_get_target_room(); EVar7 = local_1b8; if (*(int *)((int)local_1b8 + 0xd84) != 0) goto LAB_0064d837; if ((((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || (g_game->_stage != 0xb)) || (pEVar6 != (EntityPtr *)(g_game->_startingRoomIdx - 0xdU))) { if ((int)pEVar6 < 0) { pEVar6 = (EntityPtr *)(0xa8 - (int)pEVar6); } if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) goto LAB_0064d72f; LAB_0064d74b: targetRoomIdx = local_1b4; if ((int)local_1b4 < 0) { targetRoomIdx = (EntityPtr *)(0xa8 - (int)local_1b4); } } else { pEVar6 = (EntityPtr *)0xfffffff9; LAB_0064d72f: if ((g_game->_stage != 0xb) || (local_1b4 != (EntityPtr *)(g_game->_startingRoomIdx - 0xdU))) goto LAB_0064d74b; targetRoomIdx = (EntityPtr *)0xfffffff9; } roomDesc = Level::GetRoomByIdx((Level *)g_game,(int)pEVar6,0); targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,(int)targetRoomIdx,0); if ((roomDesc == targetRoomDesc) && (targetRoomDesc->Data != (void *)0x0)) { uVar1 = 0x80008000; *(EntityPtr **)((int)EVar7 + 0xd7c) = local_1b4; *(undefined4 *)((int)EVar7 + 0xd80) = 0x80008000; *(undefined4 *)((int)EVar7 + 0xd84) = 1; pvVar5 = targetRoomDesc->Data; if (0xd < *(byte *)((int)pvVar5 + 0x46)) { *(undefined4 *)((int)EVar7 + 0xd80) = 0x8000ffff; uVar1 = 0x8000ffff; pvVar5 = targetRoomDesc->Data; } if (7 < *(byte *)((int)pvVar5 + 0x47)) { uVar1 = uVar1 | 0xffff0000; *(uint *)((int)EVar7 + 0xd80) = uVar1; } if (targetRoomIdx == (EntityPtr *)0xfffffff9) { *(undefined4 *)((int)EVar7 + 0xd80) = 0x60008000; uVar1 = 0x60008000; } pfVar2 = (float *)FUN_0064d570(uVar1); targetX = *pfVar2; targetY = pfVar2[1]; } pEVar6 = local_1c4; LAB_0064d837: nextRoomIdx = *(EntityPtr **)((int)EVar7 + 0xd7c); if ((((((int)nextRoomIdx < 0) || ((local_1b0.x == targetX && (local_1a8.x == targetY)))) && (*(float *)((int)EVar7 + 0xd6c) == 0.0)) || (*(int *)((int)EVar7 + 0xd88) == 1)) && (-1 < (int)local_1b4)) { if ((*(int *)((int)EVar7 + 0xd88) == 1) && (-1 < (int)nextRoomIdx)) { pEVar6 = nextRoomIdx; } *(undefined4 *)((int)EVar7 + 0xd88) = 0; if (pEVar6 != local_1b4) { local_1c4 = (EntityPtr *)0xffffffff; Level::compute_room_distances((Level *)roomDistances,pEVar6,local_1b4,&local_1c4); if (-1 < (int)local_1c4) { *(EntityPtr **)((int)EVar7 + 0xd7c) = local_1c4; *(undefined4 *)((int)EVar7 + 0xd80) = 0x80008000; *(undefined4 *)((int)EVar7 + 0xd84) = 0; pfVar2 = (float *)FUN_0064d570(0x80008000); targetX = *pfVar2; targetY = pfVar2[1]; if ((pEVar6 < (EntityPtr *)0xa9) && (local_1c4 < (EntityPtr *)0xa9)) { *(undefined4 *)((int)EVar7 + 0xd6c) = 0; } else { *(undefined4 *)((int)EVar7 + 0xd6c) = 0x3ccccccd; } } } } if (-1 < *(int *)((int)EVar7 + 0xd7c)) { fVar8 = *(float *)((int)EVar7 + 0xd6c); if (fVar8 <= 0.0) { if (0.0 <= fVar8) { local_1a8.x = local_1a8.x * _DAT_00c3455c; local_1b0.x = local_1b0.x * _DAT_00c34558; local_1b4 = (EntityPtr *)(targetY * _DAT_00c3455c - local_1a8.x); local_1c4 = (EntityPtr *)(targetX * _DAT_00c34558 - local_1b0.x); fVar9 = sqrtf((float)local_1b4 * (float)local_1b4 + (float)local_1c4 * (float)local_1c4); fVar8 = *(float *)((int)EVar7 + 0xd60); if (fVar9 <= fVar8) { *(float *)((int)EVar7 + 0xd9c) = targetY; *(float *)((int)EVar7 + 0xd94) = targetY; fVar8 = targetX; } else { stepY = ((fVar8 * (float)local_1b4) / fVar9 + local_1a8.x) / _DAT_00c3455c; fVar8 = ((fVar8 * (float)local_1c4) / fVar9 + local_1b0.x) / _DAT_00c34558; *(float *)((int)EVar7 + 0xd9c) = stepY; *(float *)((int)EVar7 + 0xd94) = stepY; } *(float *)((int)EVar7 + 0xd90) = fVar8; *(float *)((int)EVar7 + 0xd98) = fVar8; } else { *(float *)((int)EVar7 + 0xd6c) = fVar8 + 0.025; if (0.0 <= fVar8 + 0.025) { *(undefined4 *)((int)EVar7 + 0xd6c) = 0; } } } else { *(float *)((int)EVar7 + 0xd6c) = fVar8 + 0.025; if (1.0 <= fVar8 + 0.025) { *(undefined1 **)((int)EVar7 + 0xd6c) = &DAT_bf800000; *(float *)((int)EVar7 + 0xd98) = targetX; *(float *)((int)EVar7 + 0xd9c) = targetY; *(float *)((int)EVar7 + 0xd90) = targetX; *(float *)((int)EVar7 + 0xd94) = targetY; } } } roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); game = g_game; local_1c4 = (EntityPtr *)roomDesc->GridIndex; if ((((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || (g_game->_stage != 0xb)) || (local_1c4 != (EntityPtr *)0xfffffff9)) { if ((int)local_1c4 < 0) { local_1c4 = (EntityPtr *)(0xa8 - (int)local_1c4); } } else { local_1c4 = (EntityPtr *)(g_game->_startingRoomIdx + -0xd); } iVar4 = *(int *)((int)g_game->_room + 0xc); if ((iVar4 < 8) || (*(int *)((int)g_game->_room + 0x10) < 5)) { iVar3 = -1; } else { iVar3 = iVar4 * 4 + 7; } if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || (g_game->_stage != 0xb)) { pEVar6 = (EntityPtr *)0xaf; } else { pEVar6 = (EntityPtr *)(g_game->_startingRoomIdx + -0xd); } if (local_1c4 == pEVar6) { fVar8 = 0.0; fVar9 = 280.0; } else { fVar8 = g_vectorZero.x; fVar9 = g_vectorZero.y; } local_1b0.x = (*(float *)((int)EVar7 + 0xd90) - (float)((int)local_1c4 % 0xd)) * _DAT_00c34558 + fVar8 + (float)(iVar3 % iVar4) * 40.0 + 40.0; local_1b0.y = (*(float *)((int)EVar7 + 0xd94) - (float)((int)local_1c4 / 0xd)) * _DAT_00c3455c + fVar9 + (float)(iVar3 / iVar4) * 40.0 + 120.0; if ((g_game->_currentDimensionIdx == 0) && (isInRoom = Room::IsPositionInRoom(g_game->_room,&local_1b0,-60.0), isInRoom != 0)) { if (*(char *)((int)EVar7 + 0x171) == '\0') { *(undefined4 *)((int)EVar7 + 0xd60) = 0x3f800000; } *(undefined1 *)((int)EVar7 + 0x171) = 1; *(undefined4 *)((int)EVar7 + 0xdc) = 0; *(float *)((int)EVar7 + 0xe0) = *(float *)((int)EVar7 + 0xd6c) * 26.0; Room::GetClampedPositionImpl(game->_room,&local_1a8,&local_1b0,0.0,0.0,0.0,0.0); local_1c4 = (EntityPtr *)((uint)*(float *)((int)EVar7 + 0xd6c) & 0x7fffffff); fVar8 = sqrtf((local_1b0.x - local_1a8.x) * (local_1b0.x - local_1a8.x) + (local_1b0.y - local_1a8.y) * (local_1b0.y - local_1a8.y)); fVar8 = (((float)local_1c4 * 60.0 + fVar8) - 0.0) / 60.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } local_1b4 = (EntityPtr *)(1.0 - fVar8); if (((*(char *)game->_room == '\0') || (game->_frameCount - *(int *)((int)game->_room + 0x11f0) < 2)) || (game->_frameCount - *(int *)((int)EVar7 + 0x328) < 2)) { *(float *)((int)EVar7 + 0x33c) = local_1b0.x; *(float *)((int)EVar7 + 0x340) = local_1b0.y; *(float *)((int)EVar7 + 0x360) = g_vectorZero.x; *(float *)((int)EVar7 + 0x364) = g_vectorZero.y; } else { *(float *)((int)EVar7 + 0x360) = local_1b0.x - *(float *)((int)EVar7 + 0x33c); *(float *)((int)EVar7 + 0x364) = local_1b0.y - *(float *)((int)EVar7 + 0x340); } local_1a8.x = (float)((int)EVar7 + 0x33c); playerManager = &game->_playerManager; local_1c4 = (EntityPtr *)0x0; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { game = g_game; do { pvVar5 = (playerManager->_playerList)._end; if ((int)pvVar5 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (playerManager->_playerList)._end; game = g_game; } pfVar2 = (playerManager->_playerList)._begin; if (local_1c4 < (EntityPtr *)((int)pvVar5 - (int)pfVar2 >> 2)) { pfVar2 = pfVar2 + (int)local_1c4; } local_1b0.x = *pfVar2; fVar8 = *(float *)local_1a8.x - *(float *)((int)local_1b0.x + 0x33c); fVar9 = *(float *)((int)local_1a8.x + 4) - *(float *)((int)local_1b0.x + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); if (fVar8 < *(float *)((int)local_1b0.x + 0x370) + 70.0) { iVar3 = *(int *)((int)local_1b0.x + 0x1d90); iVar4 = iVar3 + 2; if (4 < iVar4) { iVar4 = 4; } *(int *)((int)local_1b0.x + 0x1d90) = iVar4; if (0 < iVar3 != 0 < iVar4) { *(uint *)((int)local_1b0.x + 0x1574) = *(uint *)((int)local_1b0.x + 0x1574) | 99; Entity_Player::EvaluateItems(); game = g_game; } } playerManager = &game->_playerManager; local_1c4 = (EntityPtr *)&local_1c4->field_0x1; } while (local_1c4 < (undefined1 *) ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); EVar7 = local_1b8; } if (*(int *)((int)EVar7 + 0x3c0) == 0) { uVar1 = Random(); local_1b8 = (EntityPtr) Game::SpawnEx(g_game,1000,0x70,(Vector *)((int)EVar7 + 0x33c),&g_vectorZero, (Entity *)0x0,0,uVar1,0); local_1a8.x = (float)((int)local_1b8 + 0x3bc); if (*(EntityPtr *)((int)local_1b8 + 0x3bc) != (EntityPtr)0x0) { local_1c4 = (EntityPtr *)local_1a8.x; std::multiset::erase(&local_1c4); } *(EntityPtr *)local_1a8.x = EVar7; std::multiset::insert(local_1a8.x); fVar8 = ((Vector *)((int)EVar7 + 0x33c))->x; fVar9 = *(float *)((int)EVar7 + 0x340); *(undefined1 *)((int)local_1b8 + 0x464) = 1; *(int *)((int)local_1b8 + 0xdc) = 0; *(float *)((int)local_1b8 + 0x468) = *(float *)((int)local_1b8 + 0x33c) - fVar8; *(float *)((int)local_1b8 + 0x46c) = *(float *)((int)local_1b8 + 0x340) - fVar9; *(int *)((int)local_1b8 + 0xe0) = -0x3ec00000; *(int *)((int)local_1b8 + 0x354) = 10000; (**(code **)(*(int *)local_1b8 + 0xc))(); pEVar6 = (EntityPtr *)((int)EVar7 + 0x3c0); if (*(int *)((int)EVar7 + 0x3c0) != 0) { local_1c4 = pEVar6; std::multiset::erase(&local_1c4); } *pEVar6 = local_1b8; std::multiset::insert(pEVar6); } *(EntityPtr **)((int)EVar7 + 0xfc) = local_1b4; if (*(int *)((int)EVar7 + 0x3c0) != 0) { *(EntityPtr **)(*(int *)((int)EVar7 + 0x3c0) + 0xfc) = local_1b4; return; } } else { if (*(char *)((int)EVar7 + 0x171) != '\0') { Entity_Familiar::update_star_of_bethlehem_speed((Entity_Familiar *)EVar7,0); } *(undefined1 *)((int)EVar7 + 0x171) = 0; *(float *)((int)EVar7 + 0x360) = g_vectorZero.x; *(float *)((int)EVar7 + 0x364) = g_vectorZero.y; EVar7 = (EntityPtr)((int)EVar7 + 0x3c0); iVar4 = *(int *)EVar7; if (iVar4 != 0) { if (*(int *)(iVar4 + 0x3bc) != 0) { local_1b8 = (EntityPtr)(iVar4 + 0x3bc); std::multiset::erase(&local_1b8); } *(undefined4 *)(iVar4 + 0x3bc) = 0; if (*(int *)EVar7 != 0) { local_1b8 = EVar7; std::multiset::erase(&local_1b8); } *(int *)EVar7 = 0; } } return; } //@@ 0064e0c0 Entity_Familiar::ai_blood_clot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs Float/Walk*; salvage c4_clot.c (Tainted Eve) */ void __thiscall Entity_Familiar::ai_blood_clot(Entity_Familiar *this,Entity *param_2) { Entity **ppEVar1; ANM2 *pAVar2; char **ppcVar3; byte bVar4; char cVar5; uint uVar6; uint uVar7; uint rngResult; Entity *pEVar8; Entity **ppEVar9; undefined4 gridCollisionClass; LayerState *layer; Vector *pVVar10; int *piVar11; void *nearbyPlayer; int iVar12; Entity_Player *extraout_ECX; Entity_Player *player; void *nearbyEntity; float fVar13; float fVar14; float fVar15; float fVar16; float distSq; float dx; Entity *pEVar17; EntityRef sourceRef; Vector local_8c; float local_84; EntityList_EL local_80; float local_6c; float local_68; EntityPtr selfFamiliar; undefined1 local_60 [12]; float local_54; float local_50; float local_4c; char isMoving; Entity *local_44; Entity *local_40; Entity *local_3c; Entity *local_38; char *walkAnims [4]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; ColorMod *effectColor; Manager *manager; EntityPtr oldParent; code *takeDamageFn; puStack_20 = (undefined1 *)(walkAnims + 0xc); local_14 = (char *)0xffffffff; puStack_18 = &LAB_00af741d; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(walkAnims + 9); iVar12 = this->_state; walkAnims[0] = "WalkLeft"; walkAnims[1] = "WalkUp"; walkAnims[2] = "WalkRight"; walkAnims[3] = "WalkDown"; if (iVar12 == 1) { if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { return; } if ((char)param_2 == '\0') { this->_entityCollisionClass = 3; this->_state = 0; return; } return; } ExceptionList = &local_1c; selfFamiliar = (EntityPtr)this; local_24 = uVar6; if (iVar12 < 2) { ppcVar3 = walkAnims + 0xc; if ((iVar12 == -1000) && ((ppcVar3 = walkAnims + 0xc, this->_player == (void *)0x0 || (bVar4 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this->_player + 0x1508),0x2c9), ppcVar3 = (char **)puStack_20, bVar4 == 0)))) { puStack_20 = (undefined1 *)ppcVar3; this->_state = 0; ppcVar3 = (char **)puStack_20; } puStack_20 = (undefined1 *)ppcVar3; player = this->_player; local_40 = (Entity *)g_vectorZero.x; iVar12 = player->_entityGridCollisionClass; local_3c = (Entity *)g_vectorZero.y; if ((((iVar12 == 0) || (iVar12 == 3)) || (iVar12 == 1)) || (fVar13 = 7.00649e-45, iVar12 == 2)) { fVar13 = 4.2039e-45; } this->_entityGridCollisionClass = (int)fVar13; local_38 = (Entity *)player->_movespeed; local_4c = 1.0; local_50 = fVar13; if ((player->_isControlsEnabled != 0) && (player->_controlsCooldown < 1)) { pVVar10 = Entity_Player::GetMovementJoystick(player,(Vector *)(local_60 + 8)); local_40 = (Entity *)pVVar10->x; local_3c = (Entity *)pVVar10->y; if (((this->_flags & 0x8000) != 0) && (fVar13 == 7.00649e-45)) { local_3c = (Entity *)0x0; } fVar13 = sqrtf((float)local_3c * (float)local_3c + (float)local_40 * (float)local_40); player = extraout_ECX; if ((local_4c < fVar13) && (0.0 < fVar13)) { local_40 = (Entity *)((local_4c / fVar13) * (float)local_40); local_3c = (Entity *)((float)local_3c * (local_4c / fVar13)); } } bVar4 = input_is_action_pressed (0xb,(int)this->_player[5]._color._offset[1],this->_player,(int)player); if (bVar4 == 0) { pEVar8 = local_3c; } else { local_40 = (Entity *)g_vectorZero.x; pEVar8 = (Entity *)g_vectorZero.y; } (this->_targetPosition).x = (float)local_40; (this->_targetPosition).y = (float)pEVar8; local_3c = (Entity *)0x0; local_44 = (Entity *)0x0; if (((float)local_40 != g_vectorZero.x) || ((float)pEVar8 != g_vectorZero.y)) { local_44 = local_40; local_3c = pEVar8; } this->_moveDirection = -1; local_68 = (float)local_38 * 0.25 + 0.75; local_40 = (Entity *)((float)local_40 * local_68); local_68 = local_68 * (float)pEVar8; if (ABS((float)local_40) <= ABS(local_68)) { if (local_68 < 0.0) { this->_moveDirection = 1; goto LAB_0064eea4; } iVar12 = this->_moveDirection; if (0.0 < local_68) { iVar12 = 3; } } else { iVar12 = 0; if (0.0 <= (float)local_40) { iVar12 = 2; } } this->_moveDirection = iVar12; LAB_0064eea4: uVar6 = (uint)this->_flags; local_60._8_4_ = local_44; local_54 = (float)local_3c; if ((((float)local_40 != 0.0) || (local_68 != 0.0)) && (((uVar6 & 0x8000) == 0 || (local_50 != 7.00649e-45)))) { local_80._size = (int)(this->_velocity).y; local_8c.y = (this->_velocity).x; local_6c = local_68 * (float)local_80._size + (float)local_40 * local_8c.y; local_84 = (float)local_40 * local_6c; local_6c = local_6c * local_68; fVar13 = sqrtf(0.8); (this->_velocity).y = ((float)local_80._size - local_6c) * fVar13 + local_6c; (this->_velocity).x = (local_8c.y - local_84) * fVar13 + local_84; uVar6 = (uint)this->_flags; } local_6c = 0.0; local_80._size = (int)((local_68 * (this->_velocity).y + (float)local_40 * (this->_velocity).x) * -0.2); piVar11 = &local_80._size; if ((float)local_80._size <= 0.0) { piVar11 = (int *)&local_6c; } local_80._size = (int)(((float)*piVar11 / (float)local_38 + 3.0) * 0.4); fVar13 = sqrtf(0.775); fVar15 = ((float)local_80._size * 0.25 - (float)local_80._size) * 0.0 + (float)local_80._size; fVar14 = local_68 * 0.5 * fVar15 + (this->_velocity).y; (this->_velocity).x = ((float)local_40 * 0.5 * fVar15 + (this->_velocity).x) * fVar13; if (((uVar6 & 0x8000) == 0) || (local_50 != 7.00649e-45)) { fVar14 = fVar14 * fVar13; } else { fVar14 = fVar14 + 0.225; } (this->_velocity).y = fVar14; local_38 = param_2; if ((char)param_2 == '\0') { if (((float)local_44 != g_vectorZero.x) || (isMoving = (char)param_2, (float)local_3c != g_vectorZero.y)) { isMoving = '\x01'; } pEVar8 = local_44; pEVar17 = local_3c; fVar13 = g_vectorZero.y; fVar14 = g_vectorZero.x; if (this->_entityGridCollisionClass == 5) { if (((float)local_44 == g_vectorZero.x) && ((float)local_3c == g_vectorZero.y)) { local_40 = (Entity *)s_Idle; } else { iVar12 = vector_to_direction((Vector *)(local_60 + 8)); local_40 = (Entity *)walkAnims[iVar12]; pEVar17 = local_3c; } } else { local_40 = (Entity *)0xb1d4d0; } fVar15 = 24.0; uVar7 = -(uint)(this->_subtype != 0) & this->_subtype; uVar6 = 7; if (uVar7 < 7) { uVar6 = uVar7; } fVar16 = *(float *)(&DAT_00c3423c + uVar6 * 100); local_3c = *(Entity **)(&DAT_00c34240 + uVar6 * 100); if (8 < this->_headFrameDelay) { local_3c = (Entity *)((float)local_3c + 24.0); } local_80._size = (int)fVar16; cVar5 = CanPlayerFire(this); if (((cVar5 == '\0') || (*(int *)((int)this->_player + 0x162c) == -1)) || (this->_shootDirection == -1)) { if (((float)pEVar8 == fVar14) && ((float)pEVar17 == fVar13)) { fVar13 = 3.0; } else { iVar12 = vector_to_direction((Vector *)(local_60 + 8)); fVar15 = 24.0; fVar13 = (float)iVar12; fVar16 = (float)local_80._size; } local_50 = (72.0 - fVar13 * fVar15) + fVar16; } else { local_50 = (72.0 - (float)this->_shootDirection * fVar15) + fVar16; } layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); (layer->_cropOffset).x = local_50; (layer->_cropOffset).y = (float)local_3c; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); (layer->_cropOffset).x = local_50; (layer->_cropOffset).y = (float)local_3c; ANM2::Play(&this->_sprite,(byte *)local_40,0); fVar13 = local_4c; if (((isMoving != '\0') && (local_80._size = (int)local_4c, (this->_sprite)._animState._animData != (void *)0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { fVar13 = (this->_velocity).y; fVar14 = (this->_velocity).x; fVar14 = sqrtf(fVar14 * fVar14 + fVar13 * fVar13); if (2.3 <= fVar14) { fVar15 = (float)local_80._size; fVar13 = (float)local_80._size; } else { fVar13 = (fVar14 - local_4c) / 1.3; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (local_4c <= fVar13) { fVar13 = local_4c; } fVar15 = local_4c; fVar13 = fVar13 * 0.5 + 0.5; } if (6.0 < fVar14) { fVar13 = (fVar14 - 6.0) * 0.25; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (fVar15 <= fVar13) { fVar13 = fVar15; } fVar13 = fVar13 + fVar15; } } (this->_sprite)._playbackSpeed = fVar13; pVVar10 = &this->_pos; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,pVVar10,8.0, 0x21); fVar13 = 0.0; fVar14 = 0.0; fVar15 = 0.0; local_3c = (Entity *)0x0; local_40 = (Entity *)0x0; if (local_54 != 0.0) { do { nearbyEntity = *(void **)(local_60._4_4_ + (int)fVar13 * 4); if ((nearbyEntity == (void *)0x0) || (nearbyPlayer = nearbyEntity, *(int *)((int)nearbyEntity + 0x28) != 1)) { if (nearbyEntity == (void *)0x0) { nearbyPlayer = (void *)0x0; goto LAB_0064f6c1; } nearbyPlayer = (void *)0x0; if (*(int *)((int)nearbyEntity + 0x28) != 3) goto LAB_0064f6c1; LAB_0064f36a: if ((nearbyEntity != (void *)0x0) && ((*(int *)((int)nearbyEntity + 0x2c) == this->_variant && (*(void **)((int)nearbyEntity + 0x410) == this->_player)))) { dx = pVVar10->x - *(float *)((int)nearbyEntity + 0x33c); fVar16 = (this->_pos).y - *(float *)((int)nearbyEntity + 0x340); goto LAB_0064f39d; } } else { LAB_0064f6c1: nearbyEntity = (void *)0x0; if ((nearbyPlayer == (void *)0x0) || (nearbyPlayer != this->_player)) goto LAB_0064f36a; dx = pVVar10->x - *(float *)((int)nearbyPlayer + 0x33c); fVar16 = (this->_pos).y - *(float *)((int)nearbyPlayer + 0x340); LAB_0064f39d: if ((dx != g_vectorZero.x) || (fVar16 != g_vectorZero.y)) { distSq = fVar16 * fVar16 + dx * dx; fVar15 = fVar15 + (dx * 0.5) / distSq; fVar14 = fVar14 + (fVar16 * 0.5) / distSq; } } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)local_54); local_40 = (Entity *)fVar15; local_3c = (Entity *)fVar14; } fVar13 = sqrtf((float)local_3c * (float)local_3c + (float)local_40 * (float)local_40); pEVar8 = local_3c; pEVar17 = local_40; if ((2.0 < fVar13) && (0.0 < fVar13)) { pEVar8 = (Entity *)((float)local_3c * (2.0 / fVar13)); pEVar17 = (Entity *)((float)local_40 * (2.0 / fVar13)); } fVar13 = this->_speedMultiplier; (this->_velocity).y = fVar13 * (float)pEVar8 + (this->_velocity).y; (this->_velocity).x = fVar13 * (float)pEVar17 + (this->_velocity).x; if (local_60[0] == '\0') { local_14 = (char *)0x2; tracked_alloc(1,(void *)local_60._4_4_,0); local_14 = (char *)0xffffffff; } } update_weapon(local_38); if ((this->_state + 999U < 999) && (iVar12 = this->_state + 1, this->_state = iVar12, -1 < iVar12)) { this->_state = 2; this->_visible = 0; play_sound_with_fart_seed(0x1e,local_4c,2,0,1.0); uVar6 = Random(); pEVar8 = Game::Spawn(g_game,1000,2,&this->_pos,&g_vectorZero,(Entity *)0x0,2,uVar6); (**(code **)(*(int *)pEVar8 + 0x3c)) ((ColorMod *)((int)selfFamiliar + 0x1e4),0xffffffff,0xff,0,1); iVar12 = *(int *)pEVar8; (pEVar8->_sprite)._offset.x = 0.0; (pEVar8->_sprite)._offset.y = -6.0; pEVar8->_renderDepthOffset = 10.0; (**(code **)(iVar12 + 0xc))(); *(int *)((int)selfFamiliar + 0x188) = 0; *(int *)((int)selfFamiliar + 0x184) = 0; local_60._8_4_ = (this->_pos).x - *(float *)((int)*(void **)((int)selfFamiliar + 0x410) + 0x33c); local_54 = (this->_pos).y - *(float *)((int)*(void **)((int)selfFamiliar + 0x410) + 0x340); pVVar10 = Vector::Resized((Vector *)(local_60 + 8),&local_8c,6.0); uVar6 = Random(); local_80._size = (int)(((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292); local_6c = cos((float)local_80._size); fVar15 = sin((float)local_80._size); fVar13 = pVVar10->x; fVar14 = pVVar10->y; ((Vector *)((int)selfFamiliar + 0x360))->x = fVar13 * local_6c - fVar14 * fVar15; ((Vector *)((int)selfFamiliar + 0x360))->y = fVar14 * local_6c + fVar13 * fVar15; ((std_vector *)((int)selfFamiliar + 0xdac))->_end = ((std_vector *)((int)selfFamiliar + 0xdac))->_begin; this = (Entity_Familiar *)selfFamiliar; } if ((char)local_38 == '\0') { uVar6 = this->_subtype; if (uVar6 == 7) { fVar13 = this->_health / DAT_00c344f4; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (local_4c <= fVar13) { fVar13 = local_4c; } fVar14 = fVar13 * 0.39999998 + 0.6; fVar13 = fVar14 * g_vectorOne.x; (this->_sprite)._scale.y = fVar14 * g_vectorOne.y; (this->_sprite)._scale.x = fVar13; } else { bVar4 = Entity::IsFrame((Entity *)this,0xf,0); if (bVar4 != 0) { if (uVar6 == 0) { uVar7 = 0; } else { uVar7 = uVar6; if (6 < uVar6) { uVar7 = 7; } } fVar13 = this->_health; if ((float)(&DAT_00c34238)[uVar7 * 0x19] <= fVar13 && fVar13 != (float)(&DAT_00c34238)[uVar7 * 0x19]) { fVar13 = fVar13 - 0.2; if (uVar6 == 0) { uVar6 = 0; } else if (6 < uVar6) { uVar6 = 7; } if (fVar13 <= (float)(&DAT_00c34238)[uVar6 * 0x19]) { fVar13 = (float)(&DAT_00c34238)[uVar6 * 0x19]; } this->_health = fVar13; } } nearbyEntity = this->_config; fVar13 = this->_health; fVar14 = *(float *)((int)nearbyEntity + 0x50); (this->_sprite)._color._colorize[0] = 1.0; (this->_sprite)._color._colorize[1] = 1.0; (this->_sprite)._color._colorize[2] = 1.0; fVar14 = (fVar13 * fVar13) / (fVar14 * fVar14); if (fVar14 <= 0.0) { fVar14 = 0.0; } if (local_4c <= fVar14) { fVar14 = local_4c; } (this->_sprite)._color._colorize[3] = 0.6 - fVar14 * 1.1; fVar13 = sqrtf(fVar13 / *(float *)((int)nearbyEntity + 0x50)); if (fVar13 <= 0.0) { fVar13 = 0.0; } if (local_4c <= fVar13) { fVar13 = local_4c; } fVar13 = fVar13 * 0.5 + 0.6; fVar14 = fVar13 * g_vectorOne.x; (this->_sprite)._scale.y = fVar13 * g_vectorOne.y; (this->_sprite)._scale.x = fVar14; } } ExceptionList = local_1c; return; } if ((char)param_2 != '\0') goto LAB_0064ea36; puStack_20 = (undefined1 *)(walkAnims + 0xc); bVar4 = Entity::IsFrame((Entity *)this,2,0); if (bVar4 != 0) { uVar7 = Random(); rngResult = Random(); fVar13 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.25 + 0.25; local_54 = fVar13 * (this->_velocity).y; local_60._8_4_ = fVar13 * (this->_velocity).x; pEVar8 = Game::Spawn(g_game,1000,0x6f,&this->_pos,(Vector *)(local_60 + 8),(Entity *)0x0,0,uVar7 ); (**(code **)(*(int *)pEVar8 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1,uVar6); local_44 = (Entity *)g_vectorOne.x; local_68 = g_vectorOne.y; uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; (pEVar8->_sprite)._scale.y = fVar13 * local_68; (pEVar8->_sprite)._scale.x = fVar13 * (float)local_44; fVar13 = (this->_posOffset).y; (pEVar8->_posOffset).x = (this->_posOffset).x + 0.0; (pEVar8->_posOffset).y = fVar13 - 8.0; } EntityList::QueryRadius((EntityList *)((int)g_game->_room + 0x1218),&local_80,&this->_pos,20.0,8); local_14 = (char *)0x0; local_38 = (Entity *)0x0; if ((undefined1 *)local_80._size != (undefined1 *)0x0) { do { pEVar8 = local_38; bVar4 = Entity::IsVulnerableEnemy (*(Entity **)((int)local_80._data + (int)local_38 * 4),(Entity *)0x0); if ((bVar4 != 0) && (pEVar17 = *(Entity **)((int)local_80._data + (int)pEVar8 * 4), (pEVar17->_flags & 0x20000000) == 0)) { local_44 = (Entity *)((int)this + 0xdac); bVar4 = EntityList::HitListContains((EntityList *)local_44,pEVar17); if (bVar4 == 0) { uVar6 = Entity::GetHitListIndex(*(Entity **)((int)local_80._data + (int)pEVar8 * 4)); sorted_vector_insert_unique(local_44,uVar6); takeDamageFn = *(code **)(**(int **)((int)local_80._data + (int)pEVar8 * 4) + 0x20); EntityRef::constructor(&sourceRef,(Entity *)selfFamiliar); (*takeDamageFn)(*(float *)(*(int *)((int)selfFamiliar + 0x410) + 0x157c) * 3.0,0,0, &sourceRef,0x1e); pEVar8 = local_38; this = (Entity_Familiar *)selfFamiliar; } } local_38 = (Entity *)&pEVar8->field_0x1; } while (local_38 < (uint)local_80._size); } iVar12 = *(int *)((int)this + 0xd88); *(int *)((int)this + 0xd88) = iVar12 + 1; local_68 = *(float *)(*(int *)((int)this + 0x410) + 0x33c); local_50 = *(float *)(*(int *)((int)this + 0x410) + 0x340); local_38 = (Entity *)(local_68 - *(float *)((int)this + 0x33c)); local_3c = (Entity *)(local_50 - *(float *)((int)this + 0x340)); fVar13 = sqrtf((float)local_38 * (float)local_38 + (float)local_3c * (float)local_3c); pEVar8 = local_38; if (0.0 < fVar13) { local_3c = (Entity *)((float)local_3c * (1.0 / fVar13)); pEVar8 = (Entity *)((float)local_38 * (1.0 / fVar13)); } fVar13 = (float)(iVar12 + -1); local_3c = (Entity *) ((float)local_3c * fVar13 * fVar13 * *(float *)((int)this + 0x39c) + *(float *)((int)this + 0x364)); local_44 = (Entity *) (fVar13 * (float)pEVar8 * fVar13 * *(float *)((int)this + 0x39c) + *(float *)((int)this + 0x360)); *(Entity **)((int)this + 0x364) = local_3c; *(Entity **)((int)this + 0x360) = local_44; fVar13 = sqrtf((float)local_3c * (float)local_3c + (float)local_44 * (float)local_44); pEVar8 = local_3c; if ((20.0 < fVar13) && (0.0 < fVar13)) { pEVar8 = (Entity *)((float)local_3c * (20.0 / fVar13)); *(float *)((int)this + 0x360) = (float)local_44 * (20.0 / fVar13); *(Entity **)((int)this + 0x364) = pEVar8; } fVar13 = sqrtf(*(float *)((int)this + 0x360) * *(float *)((int)this + 0x360) + (float)pEVar8 * (float)pEVar8); local_44 = (Entity *)(fVar13 + 2.0); fVar14 = *(float *)((int)this + 0x33c) - local_68; local_38 = (Entity *)0x41200000; fVar13 = *(float *)((int)this + 0x340) - local_50; local_3c = local_44; fVar13 = sqrtf(fVar13 * fVar13 + fVar14 * fVar14); ppEVar1 = (Entity **)((int)this + 0xd88); ppEVar9 = &local_44; if ((float)local_3c <= 10.0) { ppEVar9 = &local_38; } if (fVar13 <= (float)*ppEVar9) { local_44 = (Entity *)0x59; ppEVar9 = &local_44; if (0x58 < (int)*ppEVar1) { ppEVar9 = ppEVar1; } *ppEVar1 = *ppEVar9; manager = g_manager; switch(*(undefined4 *)((int)this + 0x30)) { case 0: cVar5 = Entity_Player::CanPickRedHearts(*(Entity_Player **)((int)this + 0x410)); manager = g_manager; if (cVar5 == '\0') goto switchD_0064e588_default; local_38 = (Entity *)0xb9; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddHearts(*(Entity_Player **)((int)this + 0x410),1,1,0); (**(code **)(*(int *)this + 0x28))(); break; case 1: bVar4 = Entity_Player::CanPickSoulHearts(*(Entity_Player **)((int)this + 0x410)); if (bVar4 == 0) goto switchD_0064e588_default; uVar6 = (*(Entity_Player **)((int)this + 0x410))->_soulHearts; if (((uVar6 & 1) == 0) || (cVar5 = Entity_Player::IsBlackHeart(*(Entity_Player **)((int)this + 0x410),uVar6), cVar5 != '\0')) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,3, *(int *)((int)this + 0x2c),-1,0,0); fVar13 = 0.0; if (local_54 != 0.0) { do { iVar12 = *(int *)(local_60._4_4_ + (int)fVar13 * 4); if (((iVar12 != 0) && (*(int *)(iVar12 + 0x28) == 3)) && ((*(int *)(iVar12 + 0x410) == *(int *)((int)this + 0x410) && (*(int *)(iVar12 + 0x30) == 2)))) goto LAB_0064e7f1; fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)local_54); } EntityList_Query::~EntityList_Query(local_60); } manager = g_manager; local_38 = (Entity *)0x36; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddSoulHearts(*(Entity_Player **)((int)this + 0x410),1,0); (**(code **)(*(int *)this + 0x28))(); break; case 2: cVar5 = Entity_Player::CanPickBlackHearts(*(Entity_Player **)((int)this + 0x410)); if (cVar5 == '\0') goto switchD_0064e588_default; uVar6 = (*(Entity_Player **)((int)this + 0x410))->_soulHearts; if (((uVar6 & 1) != 0) && (cVar5 = Entity_Player::IsBlackHeart(*(Entity_Player **)((int)this + 0x410),uVar6), cVar5 == '\0')) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,3, *(int *)((int)this + 0x2c),-1,0,0); fVar13 = 0.0; if (local_54 != 0.0) { do { iVar12 = *(int *)(local_60._4_4_ + (int)fVar13 * 4); if ((((iVar12 != 0) && (*(int *)(iVar12 + 0x28) == 3)) && (*(int *)(iVar12 + 0x410) == *(int *)((int)this + 0x410))) && (*(int *)(iVar12 + 0x30) == 1)) goto LAB_0064e7f1; fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)local_54); } EntityList_Query::~EntityList_Query(local_60); } manager = g_manager; local_38 = (Entity *)0x1d4; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddBlackHearts(*(Entity_Player **)((int)this + 0x410),1); (**(code **)(*(int *)this + 0x28))(); break; case 3: local_38 = (Entity *)0x10a; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddEternalHearts(*(Entity_Player **)((int)this + 0x410),1); (**(code **)(*(int *)this + 0x28))(); break; case 4: cVar5 = Entity_Player::CanPickGoldenHearts(*(Entity_Player **)((int)this + 0x410)); manager = g_manager; if (cVar5 == '\0') goto switchD_0064e588_default; local_38 = (Entity *)0x1d1; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddGoldenHearts(*(Entity_Player **)((int)this + 0x410),1,0); (**(code **)(*(int *)this + 0x28))(); break; case 5: cVar5 = Entity_Player::CanPickBoneHearts(*(Entity_Player **)((int)this + 0x410)); manager = g_manager; if (cVar5 == '\0') goto switchD_0064e588_default; local_38 = (Entity *)0x1cd; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddBoneHearts(*(Entity_Player **)((int)this + 0x410),1); (**(code **)(*(int *)this + 0x28))(); break; case 6: cVar5 = Entity_Player::CanPickRottenHearts(*(Entity_Player **)((int)this + 0x410)); manager = g_manager; if (cVar5 == '\0') goto switchD_0064e588_default; local_38 = (Entity *)0x1f1; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); Entity_Player::AddRottenHearts(*(Entity_Player **)((int)this + 0x410),2,0); (**(code **)(*(int *)this + 0x28))(); break; default: switchD_0064e588_default: if (0x5c < *(int *)((int)this + 0xd88)) { *(int *)((int)this + 0xd88) = -1000; if (*(int **)((int)this + 0x3c0) != (int *)0x0) { (**(code **)(**(int **)((int)this + 0x3c0) + 0x28))(); } *(undefined1 *)((int)this + 0x171) = 1; iVar12 = *(int *)(*(int *)((int)this + 0x410) + 0x184); if ((((iVar12 == 0) || (iVar12 == 3)) || (iVar12 == 1)) || (gridCollisionClass = 5, iVar12 == 2)) { gridCollisionClass = 3; } *(undefined4 *)((int)this + 0x184) = gridCollisionClass; *(undefined4 *)((int)this + 0x188) = 3; *(float *)((int)this + 0x360) = *(float *)((int)this + 0x360) * 0.25; *(float *)((int)this + 0x364) = *(float *)((int)this + 0x364) * 0.25; } } } if ((*(int *)((int)this + 0x3c0) == 0) && (1 < *(int *)((int)this + 0xd88))) { uVar6 = Random(); local_38 = Game::Spawn(g_game,1000,0xa6,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)this,0,uVar6); uVar7 = -(uint)(*(int *)((int)this + 0x30) != 0) & *(uint *)((int)this + 0x30); uVar6 = 7; if (uVar7 < 7) { uVar6 = uVar7; } effectColor = &(local_38->_sprite)._color; iVar12 = uVar6 * 100; if (effectColor != (ColorMod *)(&DAT_00c34270 + iVar12)) { fVar13 = *(float *)(iVar12 + 0xc34274); fVar14 = *(float *)(iVar12 + 0xc34278); fVar15 = *(float *)(iVar12 + 0xc3427c); effectColor->_tint[0] = *(float *)(&DAT_00c34270 + iVar12); (local_38->_sprite)._color._tint[1] = fVar13; (local_38->_sprite)._color._tint[2] = fVar14; (local_38->_sprite)._color._tint[3] = fVar15; fVar13 = *(float *)(iVar12 + 0xc34284); fVar14 = *(float *)(iVar12 + 0xc34288); fVar15 = *(float *)(iVar12 + 0xc3428c); (local_38->_sprite)._color._colorize[0] = *(float *)(&DAT_00c34280 + iVar12); (local_38->_sprite)._color._colorize[1] = fVar13; (local_38->_sprite)._color._colorize[2] = fVar14; (local_38->_sprite)._color._colorize[3] = fVar15; *(undefined8 *)(local_38->_sprite)._color._offset = *(undefined8 *)(&DAT_00c34290 + iVar12); (local_38->_sprite)._color._offset[2] = *(float *)(&DAT_00c34298 + iVar12); } fVar13 = g_vectorOne.y * 2.0; (local_38->_sprite)._scale.x = g_vectorOne.x * 2.0; (local_38->_sprite)._scale.y = fVar13; uVar6 = g_graphicsManager_flags; layer = ANM2::GetLayer(&local_38->_sprite,(byte *)0x0); pEVar8 = local_38; iVar12 = 1; if ((uVar6 & 4) == 0) { iVar12 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar12; layer->_blendMode[2] = 7; layer->_blendMode[3] = 1; layer->_blendMode[4] = 7; oldParent = local_38->_parent; pEVar17 = local_38 + 1; (pEVar17->_sprite)._filename._buf[0] = -0x66; (pEVar17->_sprite)._filename._buf[1] = -0x67; (pEVar17->_sprite)._filename._buf[2] = '\x19'; (pEVar17->_sprite)._filename._buf[3] = '>'; pAVar2 = &local_38[1]._sprite; (pAVar2->_filename)._buf[4] = -0x66; (pAVar2->_filename)._buf[5] = -0x67; (pAVar2->_filename)._buf[6] = '\x19'; (pAVar2->_filename)._buf[7] = '>'; if (oldParent != (EntityPtr)0x0) { local_44 = (Entity *)&local_38->_parent; std::multiset::erase(&local_44); } pEVar8->_parent = (EntityPtr)this; std::multiset::insert(&pEVar8->_parent); (**(code **)(*(int *)pEVar8 + 0xc))(); if (*(int *)((int)this + 0x3c0) != 0) { local_44 = (Entity *)((int)this + 0x3c0); std::multiset::erase(&local_44); } *(undefined4 *)((int)this + 0x3c0) = pEVar8; std::multiset::insert((undefined4 *)((int)this + 0x3c0)); } if (local_80._0_1_ == '\0') { local_14 = (char *)0x1; tracked_alloc(1,local_80._data,0); } LAB_0064ea36: if (*(int *)((int)this + 0x3c0) == 0) { ExceptionList = local_1c; return; } *(undefined4 *)(*(int *)((int)this + 0x3c0) + 0xfc) = 0x3ecccccd; fVar13 = *(float *)((int)this + 0x34c); fVar14 = *(float *)((int)this + 0x33c); iVar12 = *(int *)((int)this + 0x3c0); *(float *)(iVar12 + 0x340) = (*(float *)((int)this + 0x350) + *(float *)((int)this + 0x340)) - 8.0 ; *(float *)(iVar12 + 0x33c) = fVar13 + fVar14 + 0.0; ExceptionList = local_1c; return; LAB_0064e7f1: EntityList_Query::~EntityList_Query(local_60); goto switchD_0064e588_default; } //@@ 0064f860 FamiliarAI::thrown_familiar_239 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Entity_Familiar::Update case 0xef (FamiliarVariant 239); thrown/bouncing object: height +0x350 and fall speed +0xd6c (+0.7 gravity), grid collision class +0x184 set 3 in air / 5 on landing, friction +0x36c, spawns effect 1000/0x36 dust and 1000/0x3b on landing */ void __fastcall FamiliarAI::thrown_familiar_239(Entity_Familiar *familiar) { qword qVar1; uint rngResult; Entity *pEVar2; LayerState *layer; int iVar3; float fVar4; float fVar5; undefined1 spinStep [12]; double dVar6; undefined1 auStack_b8 [60]; Vector local_7c; float spinFrame; undefined4 auStack_70 [8]; undefined4 uStack_50; undefined4 uStack_4c; float fStack_48; uint local_44; uint *flagsHigh; float *posOffsetY; local_44 = __security_cookie ^ (uint)auStack_b8; fVar4 = (familiar->_velocity).x; fVar5 = (familiar->_velocity).y; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); spinStep = ZEXT812(0x3e000000); if (fVar4 / 120.0 <= spinStep._0_4_) { spinStep._4_8_ = spinStep._4_8_; spinStep._0_4_ = fVar4 / 120.0; } if ((familiar->_velocity).x <= 0.0 && (familiar->_velocity).x != 0.0) { spinStep._4_8_ = spinStep._4_8_; spinStep._0_4_ = spinStep._0_4_ * -1.0; } if ((familiar->_flags & 0x200000000000000) == 0) { spinFrame = spinStep._0_4_ + 1.0 + familiar->_orbitAngleOffset; dVar6 = floor((double)spinFrame); local_7c.x = (float)dVar6; familiar->_orbitAngleOffset = spinFrame - local_7c.x; if ((familiar->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat (&(familiar->_sprite)._animState,(float)(int)((spinFrame - local_7c.x) * 8.0)); } } if ((familiar->_orbitSpeed < 0.0) || (posOffsetY = &(familiar->_posOffset).y, *posOffsetY <= 0.0 && *posOffsetY != 0.0)) { fVar4 = familiar->_orbitSpeed + 0.7; familiar->_fireCooldown = 0x1e; familiar->_orbitSpeed = fVar4; fVar4 = fVar4 + (familiar->_posOffset).y; (familiar->_posOffset).y = fVar4; if (-26.0 <= fVar4) { familiar->_entityGridCollisionClass = (fVar4 < -3.0) + 5; } else { familiar->_entityGridCollisionClass = 3; } if (0.0 <= fVar4) { (familiar->_posOffset).y = 0.0; familiar->_orbitSpeed = 0.0; qVar1 = familiar->_flags; flagsHigh = (uint *)((int)&familiar->_flags + 4); *flagsHigh = *flagsHigh & 0xfbffffff; familiar->_entityGridCollisionClass = 5; *(int *)&familiar->_flags = (int)qVar1; } } if (familiar->_fireCooldown < 1) { fVar4 = (familiar->_velocity).y; fVar5 = (familiar->_velocity).x; fVar4 = sqrtf(fVar5 * fVar5 + fVar4 * fVar4); fVar4 = (fVar4 - 0.0) / 6.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } familiar->_friction = fVar4 * 0.060000002 + 0.94; } else { familiar->_friction = 1.0; familiar->_fireCooldown = ((int)familiar->_prevUpdateTime - (int)familiar->_updateTime) + familiar->_fireCooldown; rngResult = Random(); if ((rngResult & 1) == 0) { rngResult = Random(); pEVar2 = Game::SpawnEx(g_game,1000,0x36,&familiar->_pos,&g_vectorZero,(Entity *)0x0,0, rngResult,0); rngResult = Random(); iVar3 = *(int *)pEVar2; fVar5 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; fVar4 = fVar5 * g_vectorOne.x; (pEVar2->_sprite)._scale.y = fVar5 * g_vectorOne.y; (pEVar2->_sprite)._scale.x = fVar4; (**(code **)(iVar3 + 0xc))(); } rngResult = Random(); local_7c.x = (familiar->_velocity).x * 0.14; local_7c.y = (familiar->_velocity).y * 0.14; pEVar2 = Game::SpawnEx(g_game,1000,0x3b,&familiar->_pos,&local_7c,(Entity *)0x0,0,rngResult,0); rngResult = Random(); *(float *)(pEVar2[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; rngResult = Random(); uStack_50 = 0x3f4ccccd; uStack_4c = 0x3f666666; iVar3 = rngResult % 0xf + 0xf; fStack_48 = 1.0; *(int *)(pEVar2[1]._sprite._filename._buf + 8) = iVar3; *(int *)(pEVar2[1]._sprite._filename._buf + 0xc) = iVar3; (pEVar2->_posOffset).x = (familiar->_posOffset).x; (pEVar2->_posOffset).y = (familiar->_posOffset).y; layer = ANM2::GetLayer(&pEVar2->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)auStack_70) { (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 0.4; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_4c,uStack_50); (layer->_color)._offset[2] = fStack_48; } fVar4 = (familiar->_velocity).x; fVar5 = (familiar->_velocity).y; fVar4 = fVar4 * fVar4 + fVar5 * fVar5; if (familiar->_collidesWithGrid != 0) { local_7c.x = sqrtf(fVar4); if (0.0 < local_7c.x) { fVar4 = (familiar->_gridCollisionVelocity).y; fVar5 = (familiar->_gridCollisionVelocity).x; fVar4 = sqrtf(fVar5 * fVar5 + fVar4 * fVar4); (familiar->_velocity).y = (fVar4 / local_7c.x) * (familiar->_velocity).y; (familiar->_velocity).x = (fVar4 / local_7c.x) * (familiar->_velocity).x; } familiar->_fireCooldown = familiar->_fireCooldown + -6; return; } local_7c.x = fVar5; fVar4 = sqrtf(fVar4); if ((fVar4 < 10.0) && (0.0 < fVar4)) { (familiar->_velocity).y = (10.0 / fVar4) * local_7c.x; (familiar->_velocity).x = (10.0 / fVar4) * (familiar->_velocity).x; return; } } return; } //@@ 0064fd40 FamiliarAI::variant_241 /* DB: ? Entity_Familiar::Update case 0xf1 (241); Idle/Move Down/Hori/Up, PickEnemyTarget, FindGridPath, MakeSplat, AddPersistentEntity, cap 5 (10 with Mom's Wig 217) */ void __fastcall FamiliarAI::variant_241(Entity_Familiar *familiar) { EntityPtr EVar1; int *targetHitCounter; undefined4 *targetHitCounterEntry; uint rngResult; int mountType; int desiredState; float fVar2; float dx; float fVar3; Vector local_14; EntityPtr local_c; EntityPtr *local_8; ANM2 *sprite; desiredState = 0; if (familiar->_coins < 0x28) { if (0xe < familiar->_coins) { desiredState = 1; } } else { desiredState = 2; } if (((desiredState == familiar->_state) && (desiredState != 0)) && (familiar->_linkedEntity == (EntityPtr)0x0)) { desiredState = 0; familiar->_state = 0; familiar->_coins = 0; } if ((1 < *(int *)&g_game->_deathmatchManager) && (familiar->_target != (EntityPtr)0x0)) { local_c = *(EntityPtr *)((int)familiar->_target + 0x20); targetHitCounter = map_find_value(&familiar[1]._pendingDamageFlags,(uint)&local_c); if (599 < *targetHitCounter) { local_c = *(EntityPtr *)((int)familiar->_target + 0x20); targetHitCounterEntry = map_find_value(&familiar[1]._pendingDamageFlags,(uint)&local_c); *targetHitCounterEntry = 0xfffffc7c; } } if (desiredState == familiar->_state) goto LAB_0064ff34; mountType = 0; local_c = (EntityPtr)0x0; local_8 = (EntityPtr *)0x0; if (desiredState == 1) { local_8 = (EntityPtr *)0x0; LAB_0064fe0c: mountType = 0x322; local_c = (EntityPtr)0x322; } else if (desiredState == 2) { local_8 = (EntityPtr *)0x1; goto LAB_0064fe0c; } EVar1 = familiar->_linkedEntity; if (EVar1 == (EntityPtr)0x0) { LAB_0064fe64: if (local_c != (EntityPtr)0x0) { rngResult = Random(); local_c = (EntityPtr) Game::Spawn(g_game,(uint)local_c,(uint)local_8,&familiar->_pos,&g_vectorZero, familiar->_player,0,rngResult); local_8 = (EntityPtr *)((int)local_c + 0x3bc); if (*(EntityPtr *)((int)local_c + 0x3bc) != (EntityPtr)0x0) { local_14.y = (float)local_8; std::multiset::erase(&local_14.y); } *local_8 = (EntityPtr)familiar; std::multiset::insert(local_8); (**(code **)(*(int *)local_c + 0xc))(); *(byte *)((int)local_c + 0x148) = (familiar->_sprite)._flipX; EntityList::AddPersistentEntity((EntityList *)((int)g_game->_room + 0x1218),(Entity *)local_c) ; if (familiar->_linkedEntity != (EntityPtr)0x0) { local_14.y = (float)&familiar->_linkedEntity; std::multiset::erase(&local_14.y); } familiar->_linkedEntity = local_c; std::multiset::insert(&familiar->_linkedEntity); } } else if ((*(int *)((int)EVar1 + 0x28) != mountType) || ((EntityPtr *)*(undefined1 **)((int)EVar1 + 0x2c) != local_8)) { (**(code **)(*(int *)EVar1 + 0x28))(); if (familiar->_linkedEntity != (EntityPtr)0x0) { local_14.y = (float)&familiar->_linkedEntity; std::multiset::erase(&local_14.y); } familiar->_linkedEntity = (EntityPtr)0x0; goto LAB_0064fe64; } familiar->_state = desiredState; LAB_0064ff34: EVar1 = familiar->_linkedEntity; if (EVar1 != (EntityPtr)0x0) { familiar->_visible = 0; familiar->_entityCollisionClass = 0; familiar->_entityGridCollisionClass = 0; fVar3 = *(float *)((int)EVar1 + 0x340); (familiar->_pos).x = *(float *)((int)EVar1 + 0x33c); (familiar->_pos).y = fVar3; (familiar->_velocity).x = g_vectorZero.x; (familiar->_velocity).y = g_vectorZero.y; return; } familiar->_visible = 1; familiar->_entityCollisionClass = 4; familiar->_entityGridCollisionClass = 5; local_14.x = *(float *)((int)familiar->_player + 0x33c); local_14.y = *(float *)((int)familiar->_player + 0x340); Entity_Familiar::PickEnemyTarget(familiar,120.0,6,0,&g_vectorZero,15.0); EVar1 = familiar->_target; if (EVar1 == (EntityPtr)0x0) { fVar3 = 6400.0; } else { local_14.x = *(float *)((int)EVar1 + 0x33c); fVar3 = 0.0; local_14.y = *(float *)((int)EVar1 + 0x340); } fVar2 = local_14.y - (familiar->_pos).y; dx = local_14.x - (familiar->_pos).x; if (fVar3 < fVar2 * fVar2 + dx * dx) { PathFinder::FindGridPath((PathFinder *)&familiar->_pathfinder,&local_14,1.328,0,1); } rngResult = Random(); if ((rngResult & 3) == 0) { rngResult = Random(); Entity_NPC::MakeSplat ((Entity_NPC *)familiar, (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.1); } familiar->_friction = familiar->_friction * 0.9; fVar3 = (familiar->_velocity).x; fVar2 = (familiar->_velocity).y; fVar3 = sqrtf(fVar3 * fVar3 + fVar2 * fVar2); sprite = &familiar->_sprite; if (2.0 <= fVar3) { fVar3 = (familiar->_velocity).x; fVar2 = (familiar->_velocity).y; if (ABS(fVar2) < ABS(fVar3)) { if (0.0 <= fVar3) { familiar->_moveDirection = 2; } else { familiar->_moveDirection = 0; } ANM2::Play(sprite,(byte *)"Move Hori",0); (familiar->_sprite)._flipX = familiar->_moveDirection == 0; return; } if (fVar2 < 0.0) { familiar->_moveDirection = 1; ANM2::Play(sprite,(byte *)"Move Up",0); (familiar->_sprite)._flipX = 0; return; } familiar->_moveDirection = 3; ANM2::Play(sprite,(byte *)"Move Down",0); (familiar->_sprite)._flipX = 0; return; } if (familiar->_moveDirection == 1) { ANM2::Play(sprite,(byte *)"Idle Up",0); (familiar->_sprite)._flipX = 0; return; } if (familiar->_moveDirection == 3) { ANM2::Play(sprite,(byte *)"Idle Down",0); (familiar->_sprite)._flipX = 0; return; } ANM2::Play(sprite,(byte *)"Idle Hori",0); (familiar->_sprite)._flipX = familiar->_moveDirection == 0; return; } //@@ 00650220 Entity_Familiar::predict_player_movement /* DB: ? called from Entity_Familiar::FollowParent: player (+0x410) movement joystick (normalized), input_is_action_pressed(0xb), NPCAI_Pathfinder::SimulatePlayerMovement, Room::GetClampedPositionImpl: predicted follow target */ void __thiscall Entity_Familiar::predict_player_movement(Entity_Familiar *this) { EntityPtr EVar1; Game *pGVar2; EntityPtr EVar3; byte bVar4; Vector *pVVar5; Entity_Player *extraout_ECX; Entity_Player *this_00; undefined4 extraout_ECX_00; EntityPtr EVar6; float fVar7; float fVar8; float fVar9; float fVar10; float local_20; float local_1c; Vector local_18; Vector local_10; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; this_00 = this->_player; local_18.x = this_00->_movespeed; if ((this_00->_isControlsEnabled != 0) && (this_00->_controlsCooldown < 1)) { pVVar5 = Entity_Player::GetMovementJoystick(this_00,&local_10); local_1c = pVVar5->y; local_20 = pVVar5->x; fVar7 = sqrtf(local_1c * local_1c + local_20 * local_20); this_00 = extraout_ECX; if ((1.0 < fVar7) && (0.0 < fVar7)) { local_1c = (1.0 / fVar7) * pVVar5->y; local_20 = (1.0 / fVar7) * pVVar5->x; } } bVar4 = input_is_action_pressed (0xb,(int)this->_player[5]._color._offset[1],this->_player,(int)this_00); if (bVar4 != 0) { local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; } NPCAI_Pathfinder::SimulatePlayerMovement(&this->_pathfinder,&local_20,extraout_ECX_00); EVar3 = this->_parent; EVar6 = (EntityPtr)this; while ((EVar1 = EVar3, EVar1 != (EntityPtr)0x0 && (*(int *)((int)EVar1 + 0x28) == 3))) { EVar6 = EVar1; EVar3 = *(EntityPtr *)((int)EVar1 + 0x3bc); } fVar7 = (this->_pos).x; local_20 = 0.0; local_18.x = 0.0; do { if (*(int *)((int)EVar6 + 0x28) != 3) break; fVar7 = (this->_pos).x; fVar10 = fVar7 - ((Vector *)((int)EVar6 + 0x33c))->x; fVar9 = (this->_pos).y - *(float *)((int)EVar6 + 0x340); if ((fVar10 != g_vectorZero.x) || (fVar9 != g_vectorZero.y)) { fVar8 = fVar9 * fVar9 + fVar10 * fVar10; local_18.x = local_18.x + (fVar10 * 0.5) / fVar8; local_20 = local_20 + (fVar9 * 0.5) / fVar8; } EVar6 = *(EntityPtr *)((int)EVar6 + 0x3c0); } while (EVar6 != (EntityPtr)0x0); fVar7 = fVar7 - *(float *)((int)this->_player + 0x33c); fVar9 = (this->_pos).y - *(float *)((int)this->_player + 0x340); if ((fVar7 != g_vectorZero.x) || (fVar9 != g_vectorZero.y)) { fVar10 = fVar7 * fVar7 + fVar9 * fVar9; local_20 = (fVar9 * 0.5) / fVar10 + local_20; local_18.x = local_18.x + (fVar7 * 0.5) / fVar10; } fVar10 = sqrtf(local_20 * local_20 + local_18.x * local_18.x); pGVar2 = g_game; fVar7 = local_20; fVar9 = local_18.x; if ((2.0 < fVar10) && (0.0 < fVar10)) { fVar7 = local_20 * (2.0 / fVar10); fVar9 = local_18.x * (2.0 / fVar10); } fVar10 = this->_speedMultiplier; (this->_velocity).x = fVar10 * fVar9 + (this->_velocity).x; (this->_velocity).y = fVar10 * fVar7 + (this->_velocity).y; Room::GetClampedPositionImpl(pGVar2->_room,&local_18,&this->_pos,0.0,0.0,0.0,0.0); local_20 = local_18.x - (this->_pos).x; local_18.x = local_18.y - (this->_pos).y; if ((local_20 != g_vectorZero.x) || (local_18.x != g_vectorZero.y)) { fVar7 = sqrtf(local_18.x * local_18.x + local_20 * local_20); if (0.0 < fVar7) { local_18.x = local_18.x * (1.0 / fVar7); local_20 = local_20 * (1.0 / fVar7); } fVar7 = (this->_velocity).x; fVar9 = this->_speedMultiplier; fVar10 = -(local_18.x * (this->_velocity).y + fVar7 * local_20); if (fVar10 <= 1.0) { fVar10 = 1.0; } if (16.0 <= fVar10) { fVar10 = 16.0; } (this->_velocity).x = local_20 * fVar10 * fVar9 + fVar7; (this->_velocity).y = local_18.x * fVar10 * fVar9 + (this->_velocity).y; } return; } //@@ 00650610 Entity_Familiar::ai_variant_242 /* DB: ? Entity_Familiar::Update case 0xf2: "Transform" anim, GetSeededCollectible + MakeShopItem + AssignOptionsIndex, FirstPlayerByType(0x21), RemoveFromFollowers */ void __thiscall Entity_Familiar::ai_variant_242(Entity_Familiar *this) { void *pvVar1; code *pcVar2; byte bVar3; char cVar4; Vector *pVVar5; byte *curAnimName; EntityPtr EVar6; Entity *poof; Entity_Player *player; uint subType; Entity_Pickup *optionPickup; uint uVar7; char *expectedAnimStr; int iVar8; byte *expectedAnim; int centerGridIdx; EntityPtr *entityIt; int iVar9; bool bVar10; float fVar11; float fVar12; float fVar13; undefined1 local_60 [12]; uint local_54; Vector centerPos; Vector local_48; Vector tmpPos; EntityPtr local_38; Vector local_34; Entity_Familiar *local_2c; EntityPtr local_28; float local_24; Entity_Pickup *local_20; Vector local_1c; char isShopItem; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; Game *game; Manager *manager; Entity_Familiar *otherFamiliar; Room *room; pvVar1 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00af745d; local_10 = ExceptionList; ExceptionList = &local_10; this->_entityCollisionClass = 0; if (this->_state == 1) { this->_visible = 0; ExceptionList = pvVar1; return; } local_2c = this; if (this->_coins == 0) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnim = s_Idle; do { bVar3 = *curAnimName; bVar10 = bVar3 < *expectedAnim; if (bVar3 != *expectedAnim) { LAB_00651780: uVar7 = -(uint)bVar10 | 1; goto LAB_00651785; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar10 = bVar3 < expectedAnim[1]; if (bVar3 != expectedAnim[1]) goto LAB_00651780; curAnimName = curAnimName + 2; expectedAnim = expectedAnim + 2; } while (bVar3 != 0); uVar7 = 0; LAB_00651785: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_006517bc; } bVar3 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_006517bc: FollowParent(this); this->_visible = 1; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; this->_state = 0; this->_fireCooldown = 0; ExceptionList = local_10; return; } if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y) ) { room = g_game->_room; Room::GetCenterPos(&tmpPos); if (this->_coins == 0x38b) { tmpPos.y = (room->_topLeftPos).y + 100.0; } pVVar5 = Room::FindFreePickupSpawnPosition(room,&local_48,&tmpPos,0.0,1,0,0); iVar8 = this->_variant; (this->_targetPosition).x = pVVar5->x; iVar9 = this->_type; (this->_targetPosition).y = pVVar5->y; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,iVar9,iVar8,-1, 0,0); local_8 = 0; uVar7 = 0; if (local_54 != 0) { do { otherFamiliar = *(Entity_Familiar **)(local_60._4_4_ + uVar7 * 4); if (((otherFamiliar != this) && ((otherFamiliar->_targetPosition).x == (this->_targetPosition).x)) && ((otherFamiliar->_targetPosition).y == (this->_targetPosition).y)) { uVar7 = Random(); fVar11 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_34.y = fVar11 + fVar11; local_24 = sin(local_34.y); uVar7 = Random(); local_28 = (EntityPtr) ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 15.0 + 15.0); fVar11 = cos(local_34.y); (this->_targetPosition).x = fVar11 * (float)local_28 + (this->_targetPosition).x; (this->_targetPosition).y = (float)local_28 * local_24 + (this->_targetPosition).y; break; } uVar7 = uVar7 + 1; } while (uVar7 < local_54); } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0065088e: bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"Transform",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimStr = "Transform"; do { bVar3 = *curAnimName; bVar10 = bVar3 < (byte)*expectedAnimStr; if (bVar3 != *expectedAnimStr) { LAB_00650870: uVar7 = -(uint)bVar10 | 1; goto LAB_00650875; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar10 = bVar3 < (byte)expectedAnimStr[1]; if (bVar3 != expectedAnimStr[1]) goto LAB_00650870; curAnimName = curAnimName + 2; expectedAnimStr = expectedAnimStr + 2; } while (bVar3 != 0); uVar7 = 0; LAB_00650875: if ((uVar7 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0065088e; } RemoveFromFollowers(this); if (local_60[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_60._4_4_,0); } } local_8 = 0xffffffff; if ((this->_visible != 0) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { this->_visible = 0; uVar7 = RNG::Next(&this->_dropRNG); EVar6 = (EntityPtr) Game::Spawn(g_game,this->_coins,this->_keys,&this->_pos,&g_vectorZero,(Entity *)0x0,0, uVar7); local_28 = EVar6; if (*(void **)((int)EVar6 + 0xf54) != this) { if (*(void **)((int)EVar6 + 0xf54) != (Entity_Familiar *)0x0) { local_34.y = (float)((int)EVar6 + 0xf54); std::multiset::erase(&local_34.y); } *(void **)((int)EVar6 + 0xf54) = this; std::multiset::insert((void **)((int)EVar6 + 0xf54)); } (**(code **)(*(int *)EVar6 + 0xc))(); if (this->_target != (EntityPtr)0x0) { local_34.y = (float)&this->_target; std::multiset::erase(&local_34.y); } this->_target = EVar6; std::multiset::insert(&this->_target); iVar8 = *(int *)((int)EVar6 + 0x28); if (iVar8 == 0x13) { local_1c.y = (this->_pos).x - *(float *)((int)this->_player + 0x33c); local_20 = (Entity_Pickup *)((this->_pos).y - *(float *)((int)this->_player + 0x340)); local_34.y = (float)EVar6; fVar11 = sqrtf(local_1c.y * local_1c.y + (float)local_20 * (float)local_20); if (0.0 < fVar11) { local_1c.y = (1.0 / fVar11) * local_1c.y; local_20 = (Entity_Pickup *)((float)local_20 * (1.0 / fVar11)); } uVar7 = Random(); local_38 = (EntityPtr)((float)(int)(uVar7 % 0x5a - 0x2d) * 0.017453292); local_24 = cos((float)local_38); fVar11 = sin((float)local_38); fVar12 = fVar11 * (float)local_20; fVar13 = local_24 * (float)local_20; local_20 = (Entity_Pickup *)0x1; fVar11 = fVar11 * local_1c.y; local_1c.y = local_24 * local_1c.y - fVar12; local_24 = fVar13 + fVar11; do { tmpPos.x = local_1c.y * (float)(int)local_20 * 20.0 + (this->_pos).x; tmpPos.y = (float)(int)local_20 * 20.0 * local_24 + (this->_pos).y; uVar7 = Random(); EVar6 = (EntityPtr) Game::Spawn(g_game,*(int *)((int)local_28 + 0x28),*(int *)((int)local_28 + 0x2c), &tmpPos,&g_vectorZero,(Entity *)this,0,uVar7); if (*(void **)((int)EVar6 + 0xf54) != this) { if (*(void **)((int)EVar6 + 0xf54) != (Entity_Familiar *)0x0) { local_38 = (EntityPtr)((int)EVar6 + 0xf54); std::multiset::erase(&local_38); } *(void **)((int)EVar6 + 0xf54) = this; std::multiset::insert((void **)((int)EVar6 + 0xf54)); } if (*(EntityPtr *)((int)EVar6 + 0x3bc) != (EntityPtr)0x0) { local_38 = (EntityPtr)((int)EVar6 + 0x3bc); std::multiset::erase(&local_38); } *(EntityPtr *)((int)EVar6 + 0x3bc) = (EntityPtr)local_34.y; if ((EntityPtr)local_34.y != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar6 + 0x3bc)); } (**(code **)(*(int *)EVar6 + 0xc))(); local_20 = (Entity_Pickup *)((int)local_20 + 1); local_34.y = (float)EVar6; } while ((int)local_20 < 5); EVar6 = local_28; } else if (iVar8 == 0xed) { uVar7 = Random(); pVVar5 = MusicManager::RandomVector(&local_48); EVar6 = local_28; tmpPos.x = pVVar5->x * 20.0 + (this->_pos).x; tmpPos.y = pVVar5->y * 20.0 + (this->_pos).y; local_28 = (EntityPtr) Game::Spawn(g_game,*(int *)((int)local_28 + 0x28),*(int *)((int)local_28 + 0x2c), &tmpPos,&g_vectorZero,(Entity *)this,0,uVar7); local_34.y = (float)((int)local_28 + 0xf54); if (*(Entity_Familiar **)((int)local_28 + 0xf54) != this) { if (*(Entity_Familiar **)((int)local_28 + 0xf54) != (Entity_Familiar *)0x0) { local_38 = (EntityPtr)local_34.y; std::multiset::erase(&local_38); } *(Entity_Familiar **)local_34.y = this; std::multiset::insert(local_34.y); } (**(code **)(*(int *)local_28 + 0xc))(); } else if (iVar8 == 0x38b) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60,0x38b,-1,-1,0 ,0); if (local_54 < 2) { local_34.y = *(float *)((int)g_game->_room + 0x18) + 60.0; } else { local_34.y = *(float *)(*(int *)local_60._4_4_ + 0x338); } pVVar5 = Room::GetCenterPos(&local_48); uVar7 = 0; fVar11 = pVVar5->x - ((float)((double)(int)local_54 + __uint_to_double_fixup[-((int)local_54 >> 0x1f)]) - 1.0) * 40.0; if (local_54 != 0) { do { iVar8 = *(int *)(local_60._4_4_ + uVar7 * 4); uVar7 = uVar7 + 1; *(float *)(iVar8 + 0x334) = fVar11; *(float *)(iVar8 + 0x338) = local_34.y; *(float *)(iVar8 + 0x33c) = fVar11; fVar11 = fVar11 + 80.0; *(undefined4 *)(iVar8 + 0x340) = *(undefined4 *)(iVar8 + 0x338); } while (uVar7 < local_54); this = local_2c; } if (local_60[0] == '\0') { local_8 = 2; tracked_alloc(1,(void *)local_60._4_4_,0); local_8 = 0xffffffff; } } if ((*(uint *)((int)EVar6 + 0x168) & 4) == 0) { uVar7 = Random(); poof = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)poof + 0xc))(); } manager = g_manager; local_34.y = 3.71344e-43; seed_fart_sound_override((int *)&local_34.y); SoundEffects::Play(&manager->_sfxManager,(int)local_34.y,1.0,2,0,1.0,0.0); pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0xae4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) ) && (iVar8 = *(int *)((int)pvVar1 + 0xae4), iVar8 != 0)) { local_60._8_4_ = *(int *)(iVar8 + 0x78); local_60._4_4_ = (int *)0x0; local_54 = 0; local_60._0_4_ = iVar8; TemporaryEffects::AddEffect((TemporaryEffects *)((int)g_game->_room + 0x7310),local_60,1,1); } local_34.y = (float)g_game->_room; uVar7 = 0; if (*(int *)((int)local_34.y + 0x1264) != 0) { do { cVar4 = (**(code **)(**(int **)(*(int *)((int)local_34.y + 0x125c) + uVar7 * 4) + 0x4c))(); if (cVar4 != '\0') { iVar8 = *(int *)(*(int *)((int)local_34.y + 0x125c) + uVar7 * 4); if (*(int *)(iVar8 + 0x28) == 0x38b) { if (*(int *)(iVar8 + 0x30) == 0) { *(float *)(iVar8 + 0x380) = *(float *)(iVar8 + 0x380) + 2.0; iVar8 = *(int *)(*(int *)((int)local_34.y + 0x125c) + uVar7 * 4); *(float *)(iVar8 + 900) = *(float *)(iVar8 + 900) + 2.0; game = g_game; iVar8 = *(int *)(*(int *)((int)local_34.y + 0x125c) + uVar7 * 4); if (*(int *)(iVar8 + 0x3bc) == 0) { fVar11 = *(float *)(iVar8 + 900); *(short *)&(g_game->_hud).field_0x54b8 = (short)(int)((fVar11 - *(float *)(iVar8 + 0x380)) + 1.0); *(short *)&(game->_hud).field_0x54ba = (short)(int)fVar11; } } } else { *(float *)(iVar8 + 0x380) = *(float *)(iVar8 + 0x380) * 0.75; } } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)((int)local_34.y + 0x1264)); this = local_2c; } } if (((this->_fireCooldown < 0) || (this->_target != (EntityPtr)0x0)) || (this->_visible != 0)) goto LAB_00651625; local_28 = (EntityPtr)0x0; if (*(int *)((int)g_game->_room + 0x1264) != 0) { entityIt = *(EntityPtr **)((int)g_game->_room + 0x125c); do { EVar6 = *entityIt; if ((EVar6 != (EntityPtr)0x0) && ((((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar6 + 0x28) == 1)) || (*(int *)((int)EVar6 + 0x28) - 10U < 0x3de)) && (*(Entity_Familiar **)((int)EVar6 + 0xf54) == this)))) { this->_target = EVar6; std::multiset::insert(&this->_target); break; } local_28 = (EntityPtr)((int)local_28 + 1); entityIt = entityIt + 1; } while ((uint)local_28 < (uint)*(EntityPtr *)((int)g_game->_room + 0x1264)); } game = g_game; if (this->_target != (EntityPtr)0x0) { this->_fireCooldown = 0; goto LAB_00651625; } this->_fireCooldown = this->_fireCooldown + 1; if (this->_fireCooldown < 4) goto LAB_00651625; this->_fireCooldown = -1; this->_state = 1; if (((game->_levelStateFlags & 0x20000U) == 0) || (*(int *)((int)game->_room + 8) != 5)) { player = PlayerManager::FirstPlayerByType(&game->_playerManager,0x21); isShopItem = '\0'; if (player != (Entity_Player *)0x0) goto LAB_00651068; } else { LAB_00651068: isShopItem = '\x01'; } local_38 = (EntityPtr)&this->_pos; Room::FindFreePickupSpawnPosition(g_game->_room,&local_1c,(Vector *)local_38,0.0,1,0,0); EVar6 = local_38; local_28 = (EntityPtr)0x0; while( true ) { local_34.y = (float)g_game->_room; iVar9 = (int)((local_1c.y - 120.0) / 40.0 + 0.5); iVar8 = (int)((local_1c.x - 40.0) / 40.0 + 0.5); if ((((iVar8 < 0) || (((Room *)local_34.y)->_gridWidth <= iVar8)) || (iVar9 < 0)) || (((Room *)local_34.y)->_gridHeight <= iVar9)) { iVar8 = -1; } else { iVar8 = iVar9 * ((Room *)local_34.y)->_gridWidth + iVar8; } pVVar5 = Room::GetCenterPos(&local_48); this = local_2c; centerGridIdx = (int)(((pVVar5->x + 0.0) - 40.0) / 40.0 + 0.5); iVar9 = (int)(((pVVar5->y - 80.0) - 120.0) / 40.0 + 0.5); if (((centerGridIdx < 0) || (*(int *)((int)local_34.y + 0xc) <= centerGridIdx)) || ((iVar9 < 0 || (*(int *)((int)local_34.y + 0x10) <= iVar9)))) { centerGridIdx = -1; } else { centerGridIdx = iVar9 * *(int *)((int)local_34.y + 0xc) + centerGridIdx; } if (iVar8 != centerGridIdx) break; local_28 = (EntityPtr)((float)local_28 + 10.0); pVVar5 = Room::FindFreePickupSpawnPosition ((Room *)local_34.y,&tmpPos,(Vector *)EVar6,(float)local_28,1,0,0); local_1c.x = pVVar5->x; local_1c.y = pVVar5->y; } uVar7 = (local_2c->_dropRNG)._seed; pvVar1 = g_game->_room; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (this->_dropRNG)._seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar7; (this->_dropRNG)._seed = uVar7; subType = ItemPool::GetSeededCollectible(uVar7,0,*(RoomDescriptor **)((int)pvVar1 + 4)); uVar7 = (this->_dropRNG)._seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (this->_dropRNG)._seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar7; (this->_dropRNG)._seed = uVar7; local_20 = (Entity_Pickup *) Game::Spawn(game,5,100,&local_1c,&g_vectorZero,(Entity *)0x0,subType,uVar7); if (isShopItem != '\0') { Entity_Pickup::MakeShopItem(local_20,-1); } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xf9,(RNG **)&g_game->_playerManager,1); if (player != (Entity_Player *)0x0) { uVar7 = (this->_dropRNG)._seed; pvVar1 = g_game->_room; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (this->_dropRNG)._seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar7; (this->_dropRNG)._seed = uVar7; local_24 = (float)ItemPool::GetSeededCollectible(uVar7,0,*(RoomDescriptor **)((int)pvVar1 + 4)); ItemPool::RemoveCollectible(&g_game->_itemPool,(int)local_24,0,0); room = g_game->_room; uVar7 = Random(); fVar11 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38 = (EntityPtr)(fVar11 + fVar11); fVar11 = cos((float)local_38); local_34.x = fVar11 * 24.0 + local_1c.x; fVar11 = sin((float)local_38); local_34.y = fVar11 * 24.0 + local_1c.y; Room::FindFreePickupSpawnPosition(room,&tmpPos,&local_34,0.0,1,0,0); local_2c = (Entity_Familiar *)0x0; while( true ) { local_28 = (EntityPtr)g_game->_room; iVar8 = (int)((tmpPos.y - 120.0) / 40.0 + 0.5); iVar9 = (int)((tmpPos.x - 40.0) / 40.0 + 0.5); if (((iVar9 < 0) || ((int)*(void **)((int)local_28 + 0xc) <= iVar9)) || ((iVar8 < 0 || ((int)*(void **)((int)local_28 + 0x10) <= iVar8)))) { iVar9 = -1; } else { iVar9 = (int)*(void **)((int)local_28 + 0xc) * iVar8 + iVar9; } pVVar5 = Room::GetCenterPos(¢erPos); local_34.y = (float)(int)(((pVVar5->x + 0.0) - 40.0) / 40.0 + 0.5); iVar8 = (int)(((pVVar5->y - 80.0) - 120.0) / 40.0 + 0.5); if (((((int)local_34.y < 0) || ((int)*(void **)((int)local_28 + 0xc) <= (int)local_34.y)) || (iVar8 < 0)) || ((int)*(void **)((int)local_28 + 0x10) <= iVar8)) { iVar8 = -1; } else { iVar8 = (int)*(void **)((int)local_28 + 0xc) * iVar8 + (int)local_34.y; } if (iVar9 != iVar8) break; local_2c = (Entity_Familiar *)((float)local_2c + 10.0); uVar7 = Random(); fVar11 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38 = (EntityPtr)(fVar11 + fVar11); fVar11 = cos((float)local_38); local_48.x = fVar11 * 24.0 + local_1c.x; fVar11 = sin((float)local_38); local_48.y = fVar11 * 24.0 + local_1c.y; pVVar5 = Room::FindFreePickupSpawnPosition ((Room *)local_28,(Vector *)(local_60 + 8),&local_48,(float)local_2c,1,0,0) ; tmpPos.x = pVVar5->x; tmpPos.y = pVVar5->y; } uVar7 = (this->_dropRNG)._seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (this->_dropRNG)._seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar7; (this->_dropRNG)._seed = uVar7; optionPickup = (Entity_Pickup *) Game::Spawn(game,5,100,&tmpPos,&g_vectorZero,(Entity *)0x0,(uint)local_24,uVar7); if (isShopItem != '\0') { Entity_Pickup::MakeShopItem(optionPickup,-1); } iVar8 = Entity_Pickup::AssignOptionsIndex(local_20); optionPickup->_optionsPickupIndex = iVar8; } LAB_00651625: EVar6 = this->_target; if (EVar6 != (EntityPtr)0x0) { fVar11 = *(float *)((int)EVar6 + 0x340); (this->_pos).x = *(float *)((int)EVar6 + 0x33c); (this->_pos).y = fVar11; ExceptionList = local_10; return; } if ((this->_visible != 0) && ((fVar11 = (this->_targetPosition).x, fVar11 != g_vectorZero.x || ((this->_targetPosition).y != g_vectorZero.y)))) { local_38 = (EntityPtr)((fVar11 - (this->_pos).x) * 0.1); local_34.y = ((this->_targetPosition).y - (this->_pos).y) * 0.1; (this->_velocity).x = (float)local_38; (this->_velocity).y = local_34.y; fVar11 = sqrtf((float)local_38 * (float)local_38 + local_34.y * local_34.y); if ((20.0 < fVar11) && (0.0 < fVar11)) { (this->_velocity).x = (float)local_38 * (20.0 / fVar11); (this->_velocity).y = (20.0 / fVar11) * local_34.y; ExceptionList = local_10; return; } } ExceptionList = local_10; return; } //@@ 00651810 apply_forgotten_lullaby /* DB: trinket 141 divides fire delay prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall apply_forgotten_lullaby(void *this,int fireDelay) { byte bVar1; int iVar2; bVar1 = Entity_Player::HasTrinket(*(Entity_Player **)((int)this + 0x410),0x8d,0); if (bVar1 == 0) { return fireDelay; } iVar2 = Entity_Player::GetTrinketMultiplier(*(Entity_Player **)((int)this + 0x410),0x8d); if (iVar2 == 2) { return (int)((float)fireDelay / 2.5); } if (iVar2 < 3) { return fireDelay / 2; } return (int)((float)fireDelay / 3.0); } //@@ 00651890 Entity_Familiar::TriggerGlowingHourglass /* ZHL [vtable slot 11] */ void __thiscall Entity_Familiar::TriggerGlowingHourglass(Entity_Familiar *this) { if ((this->_variant == 0xd3) && (this->_state == 2)) { this->_state = 0; (**(code **)(*(int *)this + 0xc))(); } this->_isHourglassRewound = 1; return; } //@@ 006518c0 FUN_006518c0 void FUN_006518c0(void) { int in_ECX; *(undefined1 *)(in_ECX + 0xd78) = 0; return; } //@@ 006518d0 FUN_006518d0 int FUN_006518d0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x14; } //@@ 006518f0 set_iterator_post_increment /* DB: tree iterator ++ */ undefined4 * set_iterator_post_increment(undefined4 *param_1) { _Tree_unchecked_const_iterator_>,std::_Iterator_base0> *in_ECX; *param_1 = *(undefined4 *)in_ECX; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++(in_ECX); return param_1; } //@@ 00651910 FUN_00651910 void FUN_00651910(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_006524a0(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x114) * 0x114; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00651990 map_find_value /* DB: ? returns found node +0x14 (map value) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall map_find_value(void *this,uint key) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,key); return (void *)(*piVar1 + 0x14); } //@@ 006519b0 FUN_006519b0 void FUN_006519b0(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (DAT_00c7e818 != (code *)0x0)) { (*DAT_00c7e818)(); } } ExceptionList = local_10; return; } //@@ 00651a10 FUN_00651a10 void FUN_00651a10(int *param_1) { int *piVar1; int *in_ECX; piVar1 = param_1; if ((int *)*in_ECX != param_1) { if ((int *)*in_ECX != (int *)0x0) { param_1 = in_ECX; std::multiset::erase(¶m_1); } *in_ECX = (int)piVar1; if (piVar1 != (int *)0x0) { std::multiset::insert(in_ECX); } } return; } //@@ 00651a50 FUN_00651a50 void FUN_00651a50(undefined4 *param_1) { undefined4 *in_ECX; if (in_ECX != param_1) { std::vector::_Tidy(); *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = param_1[2]; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; } return; } //@@ 00651a90 FUN_00651a90 char * FUN_00651a90(char *param_1,uint param_2,uint param_3) { uint uVar1; undefined4 *in_ECX; param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; if ((uint)in_ECX[4] < param_2) { /* WARNING: Subroutine does not return */ FUN_00499950(); } uVar1 = in_ECX[4] - param_2; if (uVar1 < param_3) { param_3 = uVar1; } if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } std::string::assign(param_1,(byte *)((int)in_ECX + param_2),param_3); return param_1; } //@@ 00651af0 FUN_00651af0 void FUN_00651af0(byte *param_1) { uint *puVar1; char *in_ECX; puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::append(in_ECX,param_1,*puVar1); return; } //@@ 00651b10 std_string_insert /* DB: std::string::insert(pos, const char*, count): length check (+0x10 size, +0x14 cap, SSO <=0xf), memmove tail and memcpy in place or reallocates; Console::Update, theora_create_video_clip prototype: db/protos.zhl, confirmed by RET 12 */ std_string * __thiscall std_string_insert(void *this,uint pos,byte *str,uint count) { byte *_Src; uint uVar1; void *_Src_00; uint uVar2; void *_Dst; uint uVar3; uint uVar4; size_t _Size; void *pvVar5; uVar3 = pos; uVar4 = *(uint *)((int)this + 0x10); if (uVar4 < pos) { /* WARNING: Subroutine does not return */ FUN_00499950(); } uVar1 = *(uint *)((int)this + 0x14); if (count <= uVar1 - uVar4) { *(uint *)((int)this + 0x10) = uVar4 + count; pos = (uint)this; if (0xf < uVar1) { pos = *(uint *)this; } _Src = (byte *)(pos + uVar3); if ((_Src < str + count) && (str <= (byte *)(pos + uVar4))) { if (str < _Src) { pos = (int)_Src - (int)str; } else { pos = 0; } } else { pos = count; } memmove(_Src + count,_Src,(uVar4 - uVar3) + 1); memcpy(_Src,str,pos); memcpy(_Src + pos,str + count + pos,count - pos); return this; } if (0x7fffffff - uVar4 < count) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar3 = uVar4 + count | 0xf; if (uVar3 < 0x80000000) { if (0x7fffffff - (uVar1 >> 1) < uVar1) { uVar3 = 0x7fffffff; } else { uVar2 = (uVar1 >> 1) + uVar1; if (uVar3 < uVar2) { uVar3 = uVar2; } } } else { uVar3 = 0x7fffffff; } _Dst = std::_Allocate(uVar3 + 1); *(uint *)((int)this + 0x14) = uVar3; *(uint *)((int)this + 0x10) = uVar4 + count; _Size = (uVar4 - pos) + 1; pvVar5 = (void *)((int)_Dst + pos); if (uVar1 < 0x10) { memcpy(_Dst,this,pos); memcpy(pvVar5,str,count); memcpy((void *)((int)pvVar5 + count),(void *)(pos + (int)this),_Size); *(void **)this = _Dst; return this; } _Src_00 = *(void **)this; memcpy(_Dst,_Src_00,pos); memcpy(pvVar5,str,count); memcpy((void *)((int)pvVar5 + count),(void *)(pos + (int)_Src_00),_Size); uVar4 = uVar1 + 1; pvVar5 = _Src_00; if (0xfff < uVar4) { pvVar5 = *(void **)((int)_Src_00 + -4); uVar4 = uVar1 + 0x24; if (0x1f < (uint)((int)_Src_00 + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar4); *(void **)this = _Dst; return this; } //@@ 00651cf0 FUN_00651cf0 void FUN_00651cf0(void) { FUN_006524a0(); return; } //@@ 00651d10 FUN_00651d10 void FUN_00651d10(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x114; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 00651d50 FUN_00651d50 void FUN_00651d50(byte *param_1) { uint *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined4 *in_ECX; char *in_EDX; puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } puVar5 = std::string::append(in_EDX,param_1,*puVar1); *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar2 = puVar5[1]; uVar3 = puVar5[2]; uVar4 = puVar5[3]; *in_ECX = *puVar5; in_ECX[1] = uVar2; in_ECX[2] = uVar3; in_ECX[3] = uVar4; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(puVar5 + 4); puVar5[4] = 0; puVar5[5] = 0xf; *(undefined1 *)puVar5 = 0; return; } //@@ 00651db0 FUN_00651db0 void FUN_00651db0(undefined4 *param_1,void *param_2) { void *ptr; void *in_ECX; void *local_8; local_8 = param_2; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); ptr = std_tree_extract(in_ECX,param_2); operator_delete(ptr,0x18); *param_1 = local_8; return; } //@@ 00651df0 std::map::try_emplace /* DB: MSVC _Tree try_emplace keyed by uint: lower_bound on node +0x10, returns {node,false} when found, else operator_new(0x2c) node (key + empty std::string at +0x14..+0x28), max_size 0x5d1745d; caller 006518d0 (FXLayers area) */ void std::map::try_emplace(undefined4 *param_1,uint *param_2) { char cVar1; int *piVar2; undefined4 *puVar3; int *piVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined4 *puVar6; int *piVar7; undefined4 *puVar8; bool bVar9; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af748d; local_10 = ExceptionList; piVar2 = (int *)*in_ECX; bVar9 = false; local_14 = (int *)piVar2[1]; piVar7 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar4 = local_14; do { local_14 = piVar4; bVar9 = *param_2 <= (uint)local_14[4]; if (bVar9) { piVar4 = (int *)*local_14; piVar7 = local_14; } else { piVar4 = (int *)local_14[2]; } } while (*(char *)((int)piVar4 + 0xd) == '\0'); } if ((*(char *)((int)piVar7 + 0xd) == '\0') && ((uint)piVar7[4] <= *param_2)) { *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 0; return; } ExceptionList = &local_10; if (in_ECX[1] == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; puVar5 = operator_new(0x2c); puVar5[4] = *param_2; puVar5[5] = 0; puVar5[9] = 0; puVar5[10] = 0xf; *puVar5 = piVar2; puVar5[1] = piVar2; puVar5[2] = piVar2; *(undefined2 *)(puVar5 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; puVar5[1] = local_14; if (local_14 == piVar2) { *piVar2 = (int)puVar5; piVar2[1] = (int)puVar5; piVar2[2] = (int)puVar5; *(undefined1 *)(puVar5 + 3) = 1; } else { if (bVar9) { *local_14 = (int)puVar5; if (local_14 == (int *)*piVar2) { *piVar2 = (int)puVar5; } } else { local_14[2] = (int)puVar5; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)puVar5; } } cVar1 = *(char *)(puVar5[1] + 0xc); puVar8 = puVar5; while (cVar1 == '\0') { puVar3 = (undefined4 *)puVar8[1]; puVar6 = *(undefined4 **)puVar3[1]; if (puVar3 == puVar6) { puVar6 = (undefined4 *)((undefined4 *)puVar3[1])[2]; if (*(char *)(puVar6 + 3) == '\0') goto LAB_00651f6b; if (puVar8 == (undefined4 *)puVar3[2]) { FUN_00415fe0(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar8[1] + 4)); } else if (*(char *)(puVar6 + 3) == '\0') { LAB_00651f6b: *(undefined1 *)(puVar3 + 3) = 1; *(undefined1 *)(puVar6 + 3) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; puVar8 = *(undefined4 **)(puVar8[1] + 4); } else { if (puVar8 == (undefined4 *)*puVar3) { FUN_00415f80(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar8[1] + 4)); } cVar1 = *(char *)(puVar8[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *param_1 = puVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00651ff0 std::vector::_Emplace_reallocate /* DB: vector grow of 0x114-byte ANM2 elements (max 0xed7303), copy-constructs with ANM2::ANM2; from Entity_NPC::HandleCollision which otherwise ANM2::ANM2-constructs in place and bumps the end by 0x114 */ ANM2 * std::vector::_Emplace_reallocate(ANM2 *param_1,ANM2 *param_2) { int iVar1; ANM2 *pAVar2; void *pvVar3; int iVar4; uint uVar5; ANM2 *pAVar6; int *in_ECX; ANM2 *extraout_ECX; uint uVar7; ANM2 *this; ANM2 *this_00; ANM2 *other; void *ptr; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af74bd; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; iVar4 = (in_ECX[1] - iVar1) / 0x114; if (iVar4 == 0xed7303) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = iVar4 + 1; uVar7 = (in_ECX[2] - iVar1) / 0x114; if (0xed7303 - (uVar7 >> 1) < uVar7) { local_20 = 0xed7303; } else { uVar7 = (uVar7 >> 1) + uVar7; local_20 = uVar5; if (uVar5 <= uVar7) { local_20 = uVar7; } if (0xed7303 < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pAVar6 = _Allocate(local_20 * 0x114); local_8 = 0; this_00 = pAVar6 + ((int)param_1 - iVar1) / 0x114; ANM2::ANM2(this_00,param_2); pAVar2 = (ANM2 *)in_ECX[1]; other = (ANM2 *)*in_ECX; if (param_1 == pAVar2) { local_8 = CONCAT31(local_8._1_3_,1); this = pAVar6; for (; other != pAVar2; other = other + 1) { ANM2::ANM2(this,other); this = this + 1; param_1 = extraout_ECX; } FUN_006524a0(param_1); } else { FUN_00652600(other,param_1,pAVar6); FUN_00652600(param_1,in_ECX[1],this_00 + 1); } if (*in_ECX != 0) { FUN_006524a0(*in_ECX); pvVar3 = (void *)*in_ECX; uVar7 = ((in_ECX[2] - (int)pvVar3) / 0x114) * 0x114; ptr = pvVar3; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar3 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)pAVar6; in_ECX[1] = (int)(pAVar6 + uVar5); in_ECX[2] = (int)(pAVar6 + local_20); ExceptionList = local_10; return this_00; } //@@ 006521e4 Catch_All@006521e4 void Catch_All_006521e4(void) { int unaff_EBP; FUN_00651cf0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x2c)); FUN_00651d10(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x24)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00652210 std::map::try_emplace /* DB: _Find_lower_bound; existing -> {node,false}; else new 0x18 node {key +0x10, value 0 +0x14} inserted (0xaaaaaaa max size check), returns {node,true}; Entity_Familiar::PickEnemyTarget, map_find_value */ void std::map::try_emplace(int *param_1,uint *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x18); piVar6[4] = *param_2; piVar6[5] = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_0065235a: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_0065235a; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 006523e0 std::string::find_last_of /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=data, EDX=size: builds 256-byte lookup of chars param_2[0..param_3), scans backward from min(pos,size-1), returns index or -1; Isaac::SaveModData/LoadModData path handling prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl std::string::find_last_of(byte *data,uint size,uint position,byte *chars,uint count) { byte *pbVar1; char cVar2; byte *pbVar3; uint local_114; char local_110 [260]; uint local_c; local_c = __security_cookie ^ (uint)&local_114; if ((count != 0) && (size != 0)) { local_114 = size; memset(local_110,0,0x100); pbVar3 = chars + count; for (; chars != pbVar3; chars = chars + 1) { local_110[*chars] = '\x01'; } if (local_114 - 1 < position) { position = local_114 - 1; } pbVar3 = data + position; cVar2 = local_110[data[position]]; while( true ) { if (cVar2 != '\0') { return (int)pbVar3 - (int)data; } if (pbVar3 == data) break; pbVar1 = pbVar3 + -1; pbVar3 = pbVar3 + -1; cVar2 = local_110[*pbVar1]; } } return -1; } //@@ 006524a0 FUN_006524a0 void FUN_006524a0(void) { int *piVar1; int iVar2; uint uVar3; qword qVar4; int *in_ECX; int *in_EDX; qword *pqVar5; int *piVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af74e0; local_10 = ExceptionList; ExceptionList = &local_10; if (in_ECX != in_EDX) { piVar6 = in_ECX + 0x17; do { local_8 = 0; ANM2::Reset((ANM2 *)(piVar6 + -0x17)); iVar2 = piVar6[-1]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar6[-1] = 0; } iVar2 = *piVar6; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); *piVar6 = 0; } iVar2 = piVar6[-9]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar6[-9] = 0; } iVar2 = piVar6[-8]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar6[-8] = 0; } std::string::_Tidy_deallocate((char *)(piVar6 + -0x11)); std::string::_Tidy_deallocate((char *)(piVar6 + -0x17)); piVar1 = piVar6 + 0x2e; piVar6 = piVar6 + 0x45; } while (piVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00652600 FUN_00652600 ANM2 * FUN_00652600(ANM2 *param_1,ANM2 *param_2,ANM2 *param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af750d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 1) { ANM2::ANM2(param_3,param_1); param_3 = param_3 + 1; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_006524a0(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 00652690 FUN_00652690 undefined4 * FUN_00652690(undefined4 *param_1,undefined4 param_2) { uint uVar1; undefined4 *puVar2; void *pvVar3; int *in_ECX; uint childSide; undefined4 *parent; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af753d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_0043edf0(in_ECX,*in_ECX,param_2); local_8 = 0; childSide = 0; parent = *(undefined4 **)(*in_ECX + 4); if (*(char *)((int)parent + 0xd) == '\0') { puVar2 = parent; do { parent = puVar2; if (*(int *)((int)local_14 + 0x10) < (int)parent[4]) { puVar2 = (undefined4 *)*parent; } else { puVar2 = (undefined4 *)parent[2]; } childSide = (uint)(*(int *)((int)local_14 + 0x10) < (int)parent[4]); } while (*(char *)((int)puVar2 + 0xd) == '\0'); } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar1); } pvVar3 = std::_Tree::_Insert_node(in_ECX,parent,childSide,local_14); *param_1 = pvVar3; ExceptionList = local_10; return param_1; } //@@ 00652750 FUN_00652750 void FUN_00652750(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_00652820(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00652780 FUN_00652780 void FUN_00652780(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00652780(param_1,param_2[2]); piVar2 = (int *)*param_2; std::string::_Tidy_deallocate((char *)(param_2 + 5)); operator_delete(param_2,0x2c); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 006527d0 FID_conflict:_Erase_tree_>_> /* Library Function - Multiple Matches With Different Base Names public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree_and_orphan > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Erase_tree_>_> (void *this,fuzzer_allocator_> *param_1, _Tree_node *param_2) { _Tree_node _Var1; _Tree_node *p_Var2; _Var1 = param_2[0xd]; while (_Var1 == (_Tree_node)0x0) { FID_conflict__Erase_tree_>_> (this,param_1,*(_Tree_node **)(param_2 + 8)); p_Var2 = *(_Tree_node **)param_2; operator_delete(param_2,0x1c); param_2 = p_Var2; _Var1 = p_Var2[0xd]; } return; } //@@ 00652810 FUN_00652810 void FUN_00652810(void) { FUN_006524a0(); return; } //@@ 00652820 FUN_00652820 void FUN_00652820(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af756d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)_Find_lower_bound<>(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(uint *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x1c); piVar8[4] = *param_2; uVar6 = param_2[2]; piVar8[5] = param_2[1]; local_28 = (int *)uVar1; piVar8[6] = uVar6; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_00652972: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_00652972; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00652a00 FUN_00652a00 int FUN_00652a00(void) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)FUN_0041d4c0(); iVar2 = __stdio_common_vsprintf_s(*puVar1,puVar1[1]); if (iVar2 < 0) { iVar2 = -1; } return iVar2; } //@@ 00652a30 FUN_00652a30 int FUN_00652a30(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)FUN_0041d4c0(param_1,param_2,param_3,0,¶m_4); iVar2 = __stdio_common_vsprintf_s(*puVar1,puVar1[1]); if (iVar2 < 0) { iVar2 = -1; } return iVar2; } //@@ 00652a70 FUN_00652a70 void FUN_00652a70(void) { libm_sse2_acos_precise(); return; } //@@ 00652a90 _has_flag_0x110 /* DB: ? ? (this+0x110 & mask)!=0 */ bool _has_flag_0x110(uint param_1) { int in_ECX; return (*(uint *)(in_ECX + 0x110) & param_1) != 0; } //@@ 00652ab0 Room::ScreenWrapPosition /* ZHL [lua] Lua binding Room:ScreenWrapPosition */ Vector * Room::ScreenWrapPosition(Vector *param_1,Vector *param_2,float param_3) { Room *in_ECX; ScreenWrapPositionImpl(in_ECX,param_1,param_2,param_3,param_3,param_3,param_3); return param_1; } //@@ 00652ae0 FUN_00652ae0 int FUN_00652ae0(void) { int iVar1; int iVar2; float in_XMM0_Da; iVar2 = (int)(in_XMM0_Da * 3.0 + 3.0); iVar1 = 0xd; if (iVar2 < 0xd) { iVar1 = iVar2; } return iVar1; } //@@ 00652b00 Entity_Projectile::Constructor /* ZHL [exact] __thiscall void Entity_Projectile::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Projectile::Constructor(Entity_Projectile *this) { Entity::constructor((Entity *)this); *(undefined ***)this = IsaacRepentancePlus::Entity_Projectile::vftable; this->_isRenderedAtGround = 0; *(undefined4 *)&this[1].field_0x4 = 0; *(undefined4 *)(this + 1) = 0; this[1]._damageEvents._end = (void *)0x0; this[1]._damageEvents._begin = (void *)0x0; return; } //@@ 00652b50 Entity_Projectile::Free /* ZHL [vtable slot 0] */ Entity_Projectile * __thiscall Entity_Projectile::Free(Entity_Projectile *this,byte param_2) { *(undefined ***)this = IsaacRepentancePlus::Entity_Projectile::vftable; Entity::destructor((Entity *)this); if ((param_2 & 1) != 0) { operator_delete(this,0x478); } return this; } //@@ 00652b90 Entity_Projectile::Init /* ZHL [vtable slot 1] */ void __thiscall Entity_Projectile::Init(Entity_Projectile *this,int param_2,int param_3,int param_4,uint param_5) { uint *puVar1; float fVar2; double dVar3; qword qVar4; uint uVar5; LayerState *pLVar6; int iVar7; Entity::Init((Entity *)this,param_2,param_3,param_4,param_5); this->_entityGridCollisionClass = 4; if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); } this->_height = -23.0; uVar5 = Random(); this->_fallingAccel = 0.0; this->_scale = 1.0; *(undefined4 *)&this->_projectileFlags = 0; iVar7 = this->_variant; *(undefined4 *)((int)&this->_projectileFlags + 4) = 0; this->_homingStrength = 1.0; this->_curvingStrength = 0.015; this->_acceleration = 1.01; dVar3 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; this->_orbitDistance = 0.0; this->_animKey = -1; this->_collisionDamage = 1.0; this->_isRenderedAtGround = 0; *(undefined4 *)&this->_changeFlags = 0; *(undefined4 *)((int)&this->_changeFlags + 4) = 0; this->_changeVelocity = 0.0; this->_changeTimeout = 0x1e; this->_maxHitPoints = 0.0; this->_fallingSpeed = ((float)((double)(int)uVar5 + dVar3) * 2.3283064e-10 - 0.5) * 0.2; *(float *)(this + 1) = g_vectorZero.x; *(float *)&this[1].field_0x4 = g_vectorZero.y; this[1]._damageEvents._capacity = (void *)0x0; uVar5 = g_graphicsManager_flags; if (iVar7 == 2) { pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); iVar7 = 1; if ((uVar5 & 4) == 0) { iVar7 = 6; } pLVar6->_blendMode[0] = 0; pLVar6->_blendMode[1] = iVar7; pLVar6->_blendMode[2] = 1; pLVar6->_blendMode[3] = 1; pLVar6->_blendMode[4] = 1; if (*(int *)((int)g_game->_room + 8) == 0x10) { pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); (pLVar6->_pos).x = 0.0; (pLVar6->_pos).y = 8.0; } } if ((this->_spawnerEntity != (EntityPtr)0x0) && ((*(uint *)((int)this->_spawnerEntity + 0x16c) & 0x400000) != 0)) { fVar2 = (this->_velocity).x; qVar4 = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 | 0x400000; *(int *)&this->_flags = (int)qVar4; (this->_velocity).x = fVar2 * 0.8; (this->_velocity).y = (this->_velocity).y * 0.8; } this[1]._damageEvents._begin = (void *)g_vectorZero.x; this[1]._damageEvents._end = (void *)g_vectorZero.y; FUN_008624b0(this); return; } //@@ 00652df0 FUN_00652df0 void FUN_00652df0(void) { Game *pGVar1; byte bVar2; TemporaryEffects *this; Vector *in_ECX; Room::GetTimeScale(g_game->_room,in_ECX,(Entity *)in_ECX); pGVar1 = g_game; if ((((uint)in_ECX[0x87].x & 0x80000080) != 0x80000080) && ((in_ECX[0x77].y == 0.0 || ((*(uint *)((int)in_ECX[0x77].y + 0x168) & 0x20000000) == 0)))) { this = (TemporaryEffects *)((int)g_game->_room + 0x7310); bVar2 = TemporaryEffects::HasCollectibleEffect(this,0xe8); if ((bVar2 == 0) && ((pGVar1->_challenge == 0x16 || (*(int *)((int)pGVar1->_room + 0x1210) != 1)))) { TemporaryEffects::GetCollectibleEffect(this,0x42); } } return; } //@@ 00652f60 Entity_Projectile::CanShutDoors /* ZHL [vtable slot 18] */ uint __thiscall Entity_Projectile::CanShutDoors(Entity_Projectile *this) { uint in_EAX; if ((this->_variant == 0xb) && (in_EAX = (uint)this->_projectileFlags & 0x80000000, in_EAX == 0)) { return 1; } return in_EAX & 0xffffff00; } //@@ 00652f80 FUN_00652f80 void FUN_00652f80(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x438) = 0; *(undefined4 *)(in_ECX + 0x43c) = 0; *(undefined1 *)(in_ECX + 0x173) = 1; return; } //@@ 00652fa0 Entity_Projectile::Reflect /* ZHL [exact] __thiscall void Entity_Projectile::Reflect(Entity* unused, Vector* newVelocity); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Projectile::Reflect(Entity_Projectile *this,Entity *unused,Vector *newVelocity) { EntityPtr *pEVar1; uint *puVar2; qword qVar3; qword qVar4; EntityPtr *local_c [2]; qVar3 = this->_changeFlags; pEVar1 = &this->_parent; qVar4 = this->_projectileFlags; puVar2 = (uint *)((int)&this->_projectileFlags + 4); *puVar2 = *puVar2 & 0xfffffffe; puVar2 = (uint *)((int)&this->_changeFlags + 4); *puVar2 = *puVar2 & 0xfffffffe; *(uint *)&this->_changeFlags = (uint)qVar3 & 0xfbe3e7fe | 0x80000080; *(uint *)&this->_projectileFlags = (uint)qVar4 & 0xfbe3e7fe | 0x80000080; (this->_velocity).x = newVelocity->x; (this->_velocity).y = newVelocity->y; if (*pEVar1 != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)0x0; this->_dead = 0; if ((0.0 < this->_fallingAccel) && (0.0 < this->_fallingSpeed)) { this->_fallingSpeed = -this->_fallingSpeed * 0.85; } return; } //@@ 00653070 Entity_Projectile::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Projectile::Update(Entity_Projectile *this) { Vector pos; Vector pos_00; Vector pos_01; qword qVar1; byte bVar2; char cVar3; uint uVar4; void *extraout_EAX; int sizeIndex; AnimationState *animState; Room *room; int iVar5; EntityPtr EVar6; ColorMod *tmpColor; Vector *vecResult; Font *spriteColor; Vector *vecResult2; Entity *tmpEntity; Sprite *sprite; LayerState *layer; Entity_Projectile *otherProjectile; Entity_Effect *pEVar7; ANM2 *anm2; EntityList *entityList; Entity_Projectile *pEVar8; uint uVar9; undefined4 *listEntry; ColorMod *color; EntityPtr *pEVar10; float *pfVar11; Entity_Player *player; PlayerManager *playerManager; RNG *this_00; Entity_Tear *this_01; EntityPtr EVar12; TemporaryEffects *tempEffects; int *piVar13; KColor *this_02; char *animFormat; code *vfunc; Entity_NPC *this_03; float10 fVar14; float in_XMM0_Da; float fVar15; undefined1 auVar16 [16]; float fVar17; float fVar18; Color aCStackY_1c2c [128]; void *pvVar19; undefined1 *puVar20; KColor KStack_5c8; KColor KStack_5b4; Vector VStack_5a0; Vector VStack_598; Vector VStack_590; Vector VStack_588; Vector VStack_580; Vector VStack_578; Vector VStack_570; Vector VStack_568; Vector VStack_560; Vector VStack_558; Vector VStack_550; Vector VStack_548; Vector VStack_540; Vector VStack_538; Vector VStack_530; Vector VStack_528; Vector VStack_520; Vector VStack_518; Vector VStack_510; Vector VStack_508; Vector VStack_500; EntityList_EL entityQuery2; Vector VStack_4e8; Vector VStack_4e0; int modemChance; float fStack_4d4; float speed; Vector VStack_4cc; Vector VStack_4c4; Vector VStack_4bc; Vector VStack_4b4; Vector VStack_4ac; Vector VStack_4a4; float fStack_49c; float fStack_498; float fStack_494; float fStack_490; float fStack_48c; float fStack_488; float fStack_484; float fStack_480; Vector VStack_47c; Vector VStack_474; Vector VStack_46c; EntityList_EL entityQuery; undefined1 auStack_454 [12]; Vector VStack_448; Vector VStack_440; Vector VStack_438; Vector VStack_430; Vector VStack_428; Vector VStack_420; Vector VStack_418; float fStack_410; float fStack_40c; Vector VStack_408; Vector VStack_400; Vector VStack_3f8; Vector VStack_3f0; Vector VStack_3e4; Vector VStack_3dc; byte isSideView; Vector *pVStack_3d0; Vector VStack_3cc; Vector *pVStack_3c4; char isCircleProc; float fStack_3bc; Vector VStack_3b8; Vector VStack_3b0; Vector VStack_3a8; Vector VStack_3a0; Vector *pVStack_398; Vector scratchVec; Vector VStack_38c; Vector *pVStack_384; float fStack_380; float fStack_37c; EntityPtr EStack_378; EntityPtr EStack_374; Vector VStack_370; EntityPtr EStack_368; EntityPtr EStack_364; EntityPtr EStack_360; EntityPtr EStack_35c; Entity_Effect *pEStack_358; EntityPtr EStack_354; Entity_Projectile *projectile; EntityPtr aEStack_34c [27]; TearParams tearParams [2]; float fStack_22c; Color CStack_1e4; Color CStack_1b8; Color CStack_18c; undefined1 auStack_160 [44]; Color purpleTint; Color CStack_108; RNG rng; undefined1 auStack_cc [64]; undefined1 auStack_8c [40]; byte animName [12]; KColor KStack_58; uint subtypeHigh; uint subtypeLow; undefined1 auStack_3c [8]; Vector VStack_34; float forwardDirX; float forwardDirY; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; undefined4 projFlagsHigh; undefined4 projFlagsLow; puStack_20 = auStack_3c + 0x38; uStack_14 = 0xffffffff; puStack_18 = &UNK_00af75f6; pvStack_1c = ExceptionList; uStack_24 = __security_cookie ^ (uint)(auStack_3c + 0x2c); ExceptionList = &pvStack_1c; EStack_368 = (EntityPtr)0x0; VStack_3cc.y = (float)&this->_speedMultiplier; projectile = this; FUN_00652df0(); this->_speedMultiplier = in_XMM0_Da; if (0 < this->_pauseTimer) { this->_pauseTimer = this->_pauseTimer + -1; } if ((this->_projectileFlags & 0x40003810) != 0) { this->_collidesWithGrid = 0; } if (((this->_flags & 0x20) != 0) && (this->_freezeCountdown < 1)) { uVar4 = Random(); bVar2 = Entity::IsFrame((Entity *)this,uVar4 % 7 + 0xc,0); if (bVar2 != 0) { *(uint *)&this->_flags = (uint)this->_flags & 0xffffffdf; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); *(float *)(this + 1) = g_vectorZero.x; *(float *)&this[1].field_0x4 = g_vectorZero.y; goto LAB_00653169; } } if (((this->_flags & 0x20) != 0) && (this->_dead == 0)) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; Entity::Update((Entity *)this); ExceptionList = pvStack_1c; return; } iVar5 = this->_variant; if ((((iVar5 == 0) || (iVar5 == 3)) || (iVar5 == 4)) || (iVar5 == 6)) { sizeIndex = (int)(this->_scale * 3.0 + 3.0); iVar5 = 0xd; if (sizeIndex < 0xd) { iVar5 = sizeIndex; } if (this->_animKey != iVar5) { if (this->_spawnerType == 0x3b6) { animFormat = "DogmaElectricTear%d"; if ((this->_projectileFlags & 0xc00000000000) == 0) { animFormat = "DogmaTear%d"; } sprintf_s((byte *)&subtypeHigh,0x20,(byte *)animFormat); this->_renderDepthOffset = 300.0; piVar13 = &(this->_sprite)._bitflags; *piVar13 = *piVar13 | 0x20; } else { sprintf_s((byte *)&subtypeHigh,0x20,(byte *)"RegularTear%d"); } ANM2::Play(&this->_sprite,(byte *)&subtypeHigh,0); this->_animKey = iVar5; } } else if (iVar5 == 1) { if (this->_animKey != 100) { if ((this->_projectileFlags & 0x200000000000) != 0) { std::string::string_from_cstr(auStack_3c,(byte *)"gfx/bone_projectile_holy.png"); uStack_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,(std_string *)auStack_3c); uStack_14 = 0xffffffff; std::string::_Tidy_deallocate(auStack_3c); ANM2::LoadGraphics(&this->_sprite,0); } ANM2::Play(&this->_sprite,&DAT_00b1d6fc,0); pvVar19 = (this->_sprite)._animState._animData; if (pvVar19 != (void *)0x0) { AnimationState::SetFrameFloat (&(this->_sprite)._animState, (float)(int)((uint)(this->_dropRNG)._seed % *(uint *)((int)pvVar19 + 0x30))); } this->_animKey = 100; } } else if (iVar5 == 2) { if (this->_animKey != 200) { ANM2::Play(&this->_sprite,(byte *)"Flickering",0); animState = (AnimationState *)Config::GetPillEffects(); uVar4 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); Sprite::SetFrame_1((Sprite *)&this->_sprite,uVar9 % uVar4); BlendMode::SetMode(auStack_cc + 0x2c,2,0); pvVar19 = extraout_EAX; layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,pvVar19); this->_animKey = 200; this->_isInitFlag176 = 0; } aEStack_34c[0] = (EntityPtr)Math::clamp(0.1,1.0,this->_updateTime / 15.0); pEVar10 = aEStack_34c; vecResult = &VStack_370; LAB_0065334c: vecResult = Vector::__mul(&g_vectorOne,vecResult,(float *)pEVar10); layer = Sprite::GetLayer((Sprite *)&this->_sprite,(byte *)0x0); Vector::operator_assign(&layer->_size,vecResult); } else if (iVar5 == 5) { if (this->_animKey != 300) { animFormat = "Small%02d"; if (6.0 < this->_scale * 3.0 + 3.0) { animFormat = &UNK_00b64a24; } Isaac::Random(4); sprintf_s(auStack_8c + 8,0x20,(byte *)animFormat); ANM2::Play(&this->_sprite,auStack_8c + 8,0); this->_animKey = 300; } } else { if (iVar5 == 7) { if (this->_animKey != 400) { ANM2::Play(&this->_sprite,(byte *)"MoveHori",0); animState = (AnimationState *)Config::GetPillEffects(); uVar4 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); Sprite::SetFrame_1((Sprite *)&this->_sprite,uVar9 % uVar4); this->_animKey = 400; } fVar17 = (this->_velocity).y; FUN_00456230(); Sprite::SetRotation((Sprite *)&this->_sprite,fVar17 * 57.295776); pEVar10 = &EStack_354; EStack_354 = (EntityPtr)(this->_scale / 2.75); vecResult = &VStack_38c; goto LAB_0065334c; } if ((iVar5 == 0xc) && (this->_animKey != 700)) { animFormat = &UNK_00b64a64; if (this->_scale <= 1.5 && this->_scale != 1.5) { animFormat = "Small"; } ANM2::Play(&this->_sprite,(byte *)animFormat,0); this->_animKey = 700; } } pEStack_358 = (Entity_Effect *)&this->_scale; fVar17 = this->_scale * *(float *)((int)this->_config + 0x24); iVar5 = this->_variant; this->_shadowSize = fVar17; if (iVar5 == 8) { this->_shadowSize = fVar17 + fVar17; } else if (iVar5 == 9) { if (this->_animKey != 500) { sprintf_s(animName,0x20,(byte *)"Rotate%d"); ANM2::Play(&this->_sprite,animName,0); this->_animKey = 500; } } else if (iVar5 == 0xb) { if (this->_animKey != 600) { ANM2::Play(&this->_sprite,&DAT_00b1d6fc,0); animState = (AnimationState *)Config::GetPillEffects(); uVar4 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); Sprite::SetFrame_1((Sprite *)&this->_sprite,uVar9 % uVar4); projectile->_animKey = 600; this = projectile; } } else { if (iVar5 == 0xd) { EVar6 = (EntityPtr)&this->_sprite; EStack_35c = EVar6; if (this->_animKey != 800) { ANM2::Play((ANM2 *)EVar6,&DAT_00b1d6fc,0); EntityPtr::Ref(); set_byte_0x101(); animState = (AnimationState *)Config::GetPillEffects(); uVar4 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); EVar6 = EStack_35c; Sprite::SetFrame_1((Sprite *)EStack_35c,uVar9 % uVar4); this = projectile; projectile->_animKey = 800; Entity::AddFlagsLow((Entity *)EVar6); LAB_00653797: vecResult = Vector::__mul(&g_vectorOne,&VStack_3b8,(float *)((int)this + 0x420)); Sprite::SetScale((Sprite *)EVar6,vecResult); } } else { if (iVar5 != 0xe) { if (iVar5 == 0xf) { if (this->_animKey != 1000) { anm2 = &this->_sprite; ANM2::Play(anm2,s_Idle,0); this = projectile; bVar2 = EntityPtr::Ref(); Sprite::set_flip_x((Sprite *)anm2,bVar2 & 1); uVar4 = RNG::RandomInt(&this->_dropRNG,4); EStack_35c = (EntityPtr) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)] ) * 48.0); layer = Sprite::GetLayer((Sprite *)anm2,(byte *)0x0); (layer->_cropOffset).x = (float)EStack_35c; fVar17 = random_float(); Sprite::SetRotation((Sprite *)anm2,fVar17 * 20.0 - 10.0); this->_animKey = 1000; vecResult = Vector::__mul(&g_vectorOne,&VStack_3b8,(float *)pEStack_358); Sprite::SetScale((Sprite *)anm2,vecResult); } } else if (iVar5 == 0x10) { pVStack_3c4 = (Vector *)&DAT_0000000d; EStack_35c = (EntityPtr)(int)(this->_scale * 3.0 + 3.0); piVar13 = (int *)std::min(); EStack_35c = (EntityPtr)(*piVar13 + 0x44c); if ((EntityPtr)this->_animKey != EStack_35c) { sprintf_s(animName,0x20,(byte *)"RegularTear%d"); ANM2::Play(&this->_sprite,animName,0); this->_animKey = (int)EStack_35c; } EStack_35c = (EntityPtr)Vector::GetAngleDegrees(&this->_velocity); if (((float)EStack_35c < -90.0) || (90.0 < (float)EStack_35c)) { EStack_364 = (EntityPtr)(180.0 - (float)EStack_35c); EStack_360._0_1_ = 1; } else { EStack_360 = (EntityPtr)((uint)(uint3)EStack_360._1_3_ << 8); EStack_364 = EStack_35c; } Sprite::set_flip_x((Sprite *)&this->_sprite,EStack_360._0_1_); Sprite::SetRotation((Sprite *)&this->_sprite,(float)EStack_364); if (this->_child == (EntityPtr)0x0) { uVar4 = Random(); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,0xa6,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4); sprite = (Sprite *)Entity::GetSprite((Entity *)pEVar7); tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,tmpColor); BlendMode::SetMode(auStack_cc + 0x2c,1,0); sprite = (Sprite *)Entity::GetSprite((Entity *)pEVar7); puVar20 = auStack_cc + 0x2c; layer = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,puVar20); sprite = (Sprite *)Entity::GetSprite((Entity *)pEVar7); EStack_35c = (EntityPtr)(*(float *)pEStack_358 + *(float *)pEStack_358); vecResult = Vector::operator_mul(&VStack_3b8,(float *)&EStack_35c,&g_vectorOne); Sprite::SetScale(sprite,vecResult); Entity_Effect::SetRadii(pEVar7,0.15,0.15); Entity::SetParent((Entity *)pEVar7,(Entity *)projectile); (**(code **)(*(int *)pEVar7 + 0xc))(); this = projectile; Entity::SetChild((Entity *)projectile,(Entity *)pEVar7); if (this->_child == (EntityPtr)0x0) goto LAB_00653bc5; } if (*(char *)((int)this + 0x171) == '\0') { sprite = (Sprite *)Entity::GetSprite(); spriteColor = (Font *)Sprite::Color(sprite); Font::SetLineHeightModifier(spriteColor,0.0); } else { sprite = (Sprite *)Entity::GetSprite(); spriteColor = (Font *)Sprite::Color(sprite); Sprite::Color((Sprite *)((int)this + 0x48)); fVar14 = (float10)Color::A(); EStack_35c = (EntityPtr)(float)(fVar14 * (float10)0.5); Font::SetLineHeightModifier(spriteColor,(float)EStack_35c); tmpEntity = *(Entity **)((int)this + 0x3c0); vecResult = Vector::__add((Vector *)((int)this + 0x33c),&VStack_3b8, (Vector *)((int)this + 0x34c)); Entity::SetPosition(tmpEntity,vecResult); Entity::SetVelocity(*(Entity **)((int)this + 0x3c0),(Vector *)((int)this + 0x360)); } } goto LAB_00653bc5; } EVar6 = (EntityPtr)&this->_sprite; EStack_35c = EVar6; if (this->_animKey != 900) { ANM2::Play((ANM2 *)EVar6,&DAT_00b1d6fc,0); EntityPtr::Ref(); set_byte_0x101(); animState = (AnimationState *)Config::GetPillEffects(); uVar4 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); EVar6 = EStack_35c; Sprite::SetFrame_1((Sprite *)EStack_35c,uVar9 % uVar4); projectile->_animKey = 900; this = projectile; goto LAB_00653797; } } fVar17 = *(float *)((int)this + 0x364); FUN_00456230(); EStack_35c = (EntityPtr)(fVar17 * 57.295776); cVar3 = Sprite::FlipY((Sprite *)EVar6); if (cVar3 == '\0') { puVar20 = (undefined1 *)0x3f800000; } else { puVar20 = &DAT_bf800000; } Sprite::SetRotation((Sprite *)EVar6,((float)EStack_35c + 180.0) * (float)puVar20); } LAB_00653bc5: room = (Room *)Level::GetCurrentRoom((Level *)g_game); isSideView = Room::is_type_16(room); if ((isSideView != 0) && (iVar5 = Entity::FrameCount((Entity *)this), iVar5 == 1)) { if (0.0 < *(float *)((int)this + 0x418)) { aEStack_34c[0] = *(EntityPtr *)((int)this + 0x364); fVar17 = *(float *)((int)this + 0x360); FUN_0041d510(); if ((float)aEStack_34c[0] < fVar17) { *(float *)((int)this + 0x364) = *(float *)((int)this + 0x414) * 0.5 + (float)aEStack_34c[0]; } } room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::IsBeastDungeon(room); if (bVar2 == 0) { if ((*(uint *)((int)this + 0x438) & 2) != 0) { *(undefined4 *)((int)this + 0x43c) = *(undefined4 *)((int)this + 0x43c); *(uint *)((int)this + 0x438) = *(uint *)((int)this + 0x438) & 0xffffdfef; } } } Entity::Update((Entity *)this); iVar5 = Entity::FrameCount((Entity *)this); fVar17 = 0.2; if (iVar5 == 1) { uVar4 = *(uint *)((int)this + 0x43c); if ((uVar4 & 0x98) == 0) { if (((*(uint *)((int)this + 0x438) & 2) != 0) && (*(int *)((int)this + 0x34) == 0x389)) { fVar18 = 1.0; fVar15 = 0.8; this_02 = &KStack_5c8; goto LAB_00653d5c; } if ((uVar4 & 0x2000) != 0) { fVar18 = 1.0; fVar17 = 0.8; fVar15 = 0.1; this_02 = &KStack_58; goto LAB_00653d5c; } if ((uVar4 & 0x800000) != 0) { fVar17 = 0.0; this_02 = (KColor *)(auStack_8c + 0x14); goto LAB_00653d51; } if ((uVar4 & 0x8000) != 0) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x7b,(Vector *)((int)this + 0x33c), (Vector *)((int)this + 0x360),*(Entity **)((int)this + 0x3c8),4, uVar4); vecResult = Vector::__mul(&g_vectorOne,&VStack_370,(float *)((int)this + 0x420)); Entity::SetSpriteScale(tmpEntity,vecResult); Entity::SetParent(tmpEntity,(Entity *)this); (**(code **)(*(int *)tmpEntity + 0xc))(); } } else { this_02 = &KStack_5b4; LAB_00653d51: fVar15 = 1.0; fVar18 = 0.0; LAB_00653d5c: KColor::KColor(this_02,fVar15,fVar17,fVar18,1.0); Entity::AddFear((Entity *)((int)this + 0x33c)); } if (((*(uint *)((int)this + 0x43c) & 0x200000) != 0) && (EStack_35c = *(EntityPtr *)((int)this + 0x30), (undefined1 *)((int)EStack_35c - 1U) < (undefined1 *)0x3e7)) { fStack_380 = *(float *)((int)this + 0x420); EStack_360 = EStack_35c; if (100 < (int)EStack_35c) { EStack_360 = (EntityPtr)((int)EStack_35c + -100); } if (0 < (int)EStack_360) { EStack_374 = EStack_360; do { uVar4 = Random(); EVar6 = (EntityPtr) Game::Spawn(g_game,9,0,(Vector *)((int)this + 0x33c),&g_vectorZero, *(Entity **)((int)this + 0x3c8),0,uVar4); EStack_354 = EVar6; Entity::SetTarget((Entity *)EVar6,(Entity *)this); Entity::SetParent((Entity *)EVar6,*(Entity **)((int)this + 0x3bc)); tmpColor = (ColorMod *)Sprite::Color((Sprite *)((int)this + 0x48)); Color::operator_assign((Color *)auStack_cc,tmpColor); iVar5 = Isaac::Random(2); if (iVar5 == 0) { EStack_364 = (EntityPtr)0x40800000; } else { EStack_364 = (EntityPtr)0x3f800000; } FUN_005cd370(); FUN_005cd380(); FUN_005cd3a0(); (**(code **)(*(int *)EVar6 + 0x3c))(); set_projectile_flags((Entity_Projectile *)EVar6); random_float(); FUN_00565de0(); vecResult = Vector::Vector(&VStack_370,20.0,8.0); vecResult = Vector::operator_mul(&VStack_38c,&fStack_380,vecResult); fVar17 = random_float(); aEStack_34c[0] = (EntityPtr)(fVar17 * 0.2 + 0.8); vecResult = Vector::__mul(vecResult,&VStack_3b8,(float *)aEStack_34c); Entity::SetTargetPosition((Entity *)EStack_354,*vecResult); random_float(); FUN_004508a0(); if (100 < (int)EStack_35c) { FUN_00435cd0(); } EStack_374 = (EntityPtr)((int)EStack_374 + -1); } while (EStack_374 != (EntityPtr)0x0); EStack_374 = (EntityPtr)0x0; } spriteColor = (Font *)Sprite::Color((Sprite *)((int)this + 0x48)); Font::SetLineHeightModifier(spriteColor,0.0); *(undefined4 *)((int)this + 0x30) = 1000; } } VStack_408.x = *(float *)((int)this + 0x438); if ((*(uint *)((int)this + 0x43c) & 0x40) != 0) { fVar17 = 45.0; if (((*(int *)((int)this + 0x30) == 0) && (*(int *)((int)this + 0x34) == 0x3d)) && (*(int *)((int)this + 0x38) == 7)) { fVar17 = 10.0; } if (fVar17 < *(float *)((int)this + 0x3a4)) { *(undefined1 *)((int)this + 0x173) = 1; } } if ((((*(uint *)((int)this + 0x43c) & 0x200000) != 0) && (*(Entity **)((int)this + 0x3c4) != (Entity *)0x0)) && (bVar2 = Entity::IsProjectile(*(Entity **)((int)this + 0x3c4)), bVar2 != 0)) { vecResult = Vector::FromAngle(&VStack_370,*(float *)((int)this + 0x424)); Vector::operator_mul(&VStack_418,(float *)((int)this + 0x334),vecResult); vecResult = Vector::FromAngle(&VStack_370,*(float *)((int)this + 0x424) + 90.0); Vector::operator_mul(&VStack_438,(float *)((int)this + 0x338),vecResult); iVar5 = Game::GetFrameCount(g_game); EStack_360 = (EntityPtr) ((((float)((uint)(iVar5 + *(int *)((int)this + 0x3ec)) % 0x1e) + 0.0) * 6.2831855) / 30.0); vecResult = Entity::Position(*(Entity **)((int)this + 0x3c4),&VStack_370); EVar6 = EStack_360; FUN_00417150(); aEStack_34c[0] = EVar6; vecResult2 = Vector::operator_mul(&VStack_38c,(float *)aEStack_34c,&VStack_418); vecResult = Vector::__add(vecResult,&VStack_3b8,vecResult2); EStack_354 = (EntityPtr)sinf_wrapper((float)EStack_360); vecResult2 = Vector::operator_mul(&VStack_3f8,(float *)&EStack_354,&VStack_438); Vector::__add(vecResult,&VStack_46c,vecResult2); vecResult = Vector::__sub(&VStack_46c,&VStack_3b0,(Vector *)((int)this + 0x33c)); Vector::operator_assign((Vector *)((int)this + 0x360),vecResult); *(undefined4 *)((int)this + 0x36c) = 0x3f800000; *(undefined4 *)((int)this + 0x414) = 0; *(undefined4 *)((int)this + 0x410) = 0xc1b80000; } if (((*(uint *)((int)this + 0x43c) & 0x2000) == 0) || (iVar5 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar5 == 0)) { if ((*(int *)((int)this + 0x34) == 0x33c) && ((*(int *)((int)this + 0x2c) == 1 && (iVar5 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar5 != 0)))) { uVar4 = Random(); aEStack_34c[0] = (EntityPtr)0x3f000000; vecResult = Vector::__mul((Vector *)((int)this + 0x360),&VStack_370,(float *)aEStack_34c); tmpEntity = Game::Spawn(g_game,1000,0x6f,(Vector *)((int)this + 0x33c),vecResult, (Entity *)this,0,uVar4); BlendMode::SetMode(auStack_cc + 0x2c,2,0); sprite = (Sprite *)Entity::GetSprite(tmpEntity); puVar20 = auStack_cc + 0x2c; layer = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,puVar20); vecResult = &projectile->_posOffset; vecResult2 = Vector::Vector(&VStack_38c,0.0,projectile->_fallingSpeed * 0.5); vecResult = Vector::__add(vecResult,&VStack_3b8,vecResult2); Entity::SetPositionOffset(tmpEntity,vecResult); fVar17 = random_float(); EStack_354 = (EntityPtr)(fVar17 * 0.7 + 0.3); Color::Color(); Color::SetOffset(&CStack_1b8,(float)EStack_354 * 0.4,(float)EStack_354 * 0.3, (float)EStack_354 * 0.7); EStack_354 = (EntityPtr)0x3f28f5c3; vecResult = Vector::operator_mul(&VStack_38c,(float *)&EStack_354,&g_vectorOne); Entity::SetSpriteScale(tmpEntity,vecResult); goto LAB_0065453a; } } else { uVar4 = Random(); aEStack_34c[0] = (EntityPtr)0x3f000000; vecResult = Vector::__mul((Vector *)((int)this + 0x360),&VStack_370,(float *)aEStack_34c); tmpEntity = Game::Spawn(g_game,1000,0x6f,(Vector *)((int)this + 0x33c),vecResult,(Entity *)this, 0,uVar4); BlendMode::SetMode(auStack_cc + 0x2c,2,0); sprite = (Sprite *)Entity::GetSprite(tmpEntity); puVar20 = auStack_cc + 0x2c; layer = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,puVar20); vecResult = &projectile->_posOffset; vecResult2 = Vector::Vector(&VStack_38c,0.0,projectile->_fallingSpeed * 0.5); vecResult = Vector::__add(vecResult,&VStack_3b8,vecResult2); Entity::SetPositionOffset(tmpEntity,vecResult); fVar17 = random_float(); EStack_354 = (EntityPtr)(fVar17 * 0.7 + 0.3); Color::Color(); Color::SetOffset(&CStack_1e4,0.0,(float)EStack_354 * 0.7,(float)EStack_354); LAB_0065453a: (**(code **)(*(int *)tmpEntity + 0x3c))(); set_field_358(tmpEntity,-5.0); (**(code **)(*(int *)tmpEntity + 0xc))(); this = projectile; } if (((*(uint *)((int)this + 0x43c) & 0x800000) != 0) && (iVar5 = Entity::GetIntervalTicks((Entity *)this,8.0,0.0), iVar5 != 0)) { Vector::Rotated((Vector *)((int)this + 0x360),&VStack_3f8,90.0); EStack_360 = (EntityPtr)0x0; do { EVar6 = EStack_360; EStack_35c = (EntityPtr)Random(); aEStack_34c[0] = (EntityPtr)0x3e19999a; vecResult = Vector::__mul(&VStack_3f8,&VStack_370,(float *)aEStack_34c); if (EVar6 == (EntityPtr)0x0) { EStack_354 = (EntityPtr)&DAT_bf800000; } else { EStack_354 = (EntityPtr)0x3f800000; } vecResult = Vector::__mul(vecResult,&VStack_38c,(float *)&EStack_354); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,(Vector *)((int)this + 0x33c),vecResult,(Entity *)0x0,0, (uint)EStack_35c); Entity::SetSpawnerEntity((Entity *)otherProjectile,*(Entity **)((int)this + 0x3c8)); FUN_004316b0(); FUN_004b7070(); (**(code **)(*(int *)otherProjectile + 0x3c))(); FUN_00450880(); set_projectile_flags(otherProjectile); set_falling_accel(otherProjectile,-0.04); FUN_004aad70(); (**(code **)(*(int *)otherProjectile + 0xc))(); EStack_360 = (EntityPtr)((int)EStack_360 + 1); } while ((int)EStack_360 < 2); } if ((*(int *)((int)this + 0x2c) == 0xe) && (iVar5 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar5 != 0)) { if (*(float *)((int)this + 0x3a4) <= 40.0 && *(float *)((int)this + 0x3a4) != 40.0) { fVar17 = random_float(); if (fVar17 < (50.0 - *(float *)((int)this + 0x3a4)) / 40.0) { uVar4 = Random(); aEStack_34c[0] = (EntityPtr)0x3f000000; vecResult = Vector::__mul((Vector *)((int)this + 0x360),&VStack_370,(float *)aEStack_34c); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,0x3b,(Vector *)((int)this + 0x33c),vecResult,(Entity *)this ,0,uVar4); vecResult = &projectile->_posOffset; vecResult2 = Vector::Vector(&VStack_38c,0.0,projectile->_fallingSpeed * 0.5); vecResult = Vector::__add(vecResult,&VStack_3b8,vecResult2); Entity::SetPositionOffset((Entity *)pEVar7,vecResult); EStack_354 = (EntityPtr)0x3fc00000; vecResult = Vector::operator_mul(&VStack_38c,(float *)&EStack_354,&g_vectorOne); Entity::SetSpriteScale((Entity *)pEVar7,vecResult); fVar17 = random_float(); Entity_Effect::set_rotation(pEVar7,fVar17 * 10.0 + 2.0); iVar5 = Isaac::Random(0xf); Entity_Effect::SetTimeout(pEVar7,iVar5 + 0xf); vfunc = *(code **)(*(int *)pEVar7 + 0x3c); Color::Color(); (*vfunc)(); vfunc = *(code **)(*(int *)pEVar7 + 0x3c); Color::Color(); (*vfunc)(); set_field_358(pEVar7,-1000.0); (**(code **)(*(int *)pEVar7 + 0xc))(); this = projectile; } } EStack_35c = (EntityPtr)Random(); aEStack_34c[0] = (EntityPtr)0x3f000000; pVStack_3c4 = Vector::__mul((Vector *)((int)this + 0x360),&VStack_370,(float *)aEStack_34c); vecResult = MusicManager::RandomVector(&VStack_38c); vecResult = Vector::operator_mul(&VStack_3b8,&projectile->_size,vecResult); EStack_354 = (EntityPtr)random_float(); vecResult = Vector::__mul(vecResult,&VStack_3a8,(float *)&EStack_354); vecResult = Vector::__add((Vector *)((int)this + 0x33c),&VStack_408,vecResult); otherProjectile = projectile; tmpEntity = Game::Spawn(g_game,1000,0x6f,vecResult,pVStack_3c4,(Entity *)projectile,0, (uint)EStack_35c); vecResult = Vector::Vector(&VStack_448,0.0,otherProjectile->_fallingSpeed * 0.5); vecResult = Vector::__add(&otherProjectile->_posOffset,&VStack_474,vecResult); Entity::SetPositionOffset(tmpEntity,vecResult); fVar17 = random_float(); EStack_35c = (EntityPtr)(fVar17 * 0.7 + 0.3); Color::Color(); Color::SetOffset(&CStack_18c,1.0,(float)EStack_35c,0.0); fVar17 = random_float(); EStack_35c = (EntityPtr)(fVar17 + 1.0); vecResult = Vector::operator_mul(&VStack_448,(float *)&EStack_35c,&g_vectorOne); Entity::SetSpriteScale(tmpEntity,vecResult); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*vfunc)(); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Isaac::Random(0x13); (*vfunc)(); FUN_00440e90(); anm2 = (ANM2 *)Entity::GetSprite(tmpEntity); set_PlaybackSpeed(anm2,0.6); (**(code **)(*(int *)tmpEntity + 0xc))(); this = projectile; } if (((((*(uint *)((int)this + 0x438) & 2) != 0) && (*(int *)((int)this + 0x34) == 0x3b7)) && (*(int *)((int)this + 0x38) == 0x14)) && (iVar5 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar5 != 0)) { uVar4 = Random(); aEStack_34c[0] = (EntityPtr)0x3f000000; vecResult = Vector::__mul((Vector *)((int)this + 0x360),&VStack_370,(float *)aEStack_34c); tmpEntity = Game::Spawn(g_game,1000,0x6f,(Vector *)((int)this + 0x33c),vecResult,(Entity *)this, 0,uVar4); vecResult = &projectile->_posOffset; vecResult2 = Vector::Vector(&VStack_38c,0.0,projectile->_fallingSpeed * 0.5); vecResult = Vector::__add(vecResult,&VStack_3b8,vecResult2); Entity::SetPositionOffset(tmpEntity,vecResult); random_float(); Color::Color(); (**(code **)(*(int *)tmpEntity + 0x3c))(); FUN_00440e90(); (**(code **)(*(int *)tmpEntity + 0xc))(); this = projectile; } EStack_364 = (EntityPtr)0xc2a00000; if (((*(uint *)((int)this + 0x43c) & 0x200000) != 0) && (*(int *)((int)this + 0x30) == 1000)) { if (*(char *)((int)this + 0x173) == '\0') { if (*(int *)((int)this + 0x34) != 0x390) { if ((*(int *)((int)this + 0x3c4) == 0) && (player = Game::GetNearestPlayerEx((Vector *)((int)this + 0x33c),0,0,0), player != (Entity_Player *)0x0)) { Entity::SetTarget((Entity *)this,(Entity *)player); } if (*(Entity **)((int)this + 0x3c4) != (Entity *)0x0) { vecResult = Entity::Position(*(Entity **)((int)this + 0x3c4),&VStack_370); vecResult = Vector::__sub(vecResult,&VStack_38c,(Vector *)((int)this + 0x33c)); Vector::Normalized(vecResult,&VStack_3a0); aEStack_34c[0] = (EntityPtr)Vector::Dot((Vector *)((int)this + 0x360),&VStack_3a0); if (0.0 < (float)aEStack_34c[0]) { aEStack_34c[0] = (EntityPtr)Vector::Length((Vector *)((int)this + 0x360)); vecResult = Vector::__mul(&VStack_3a0,&VStack_370,(float *)((int)this + 0x39c)); Vector::operator_add_assign((Vector *)((int)this + 0x360),vecResult); Vector::Resize((Vector *)((int)this + 0x360),(float)aEStack_34c[0]); } } } iVar5 = Entity::GetIntervalTicks((Entity *)this,4.0,0.0); if (iVar5 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&entityQuery,9,-1,-1,0,0); uStack_14 = 3; uVar4 = 0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { std::vector::operator_index(); tmpEntity = (Entity *)FUN_004aad40(); EVar6 = (EntityPtr)Entity::Target(tmpEntity); if (EVar6 == (EntityPtr)this) goto LAB_006555d5; uVar4 = uVar4 + 1; uVar9 = EntityList::Size(); } while (uVar4 < uVar9); } (**(code **)(*(int *)this + 0x28))(); LAB_006555d5: uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&entityQuery); } } else { *(undefined4 *)((int)this + 0x30) = 0; SoundEffects::PlayWithFartOverride(0x1e,1.0,2,0,1.0); uVar4 = Random(); EStack_354 = (EntityPtr)((int)this + 0x33c); tmpEntity = Game::Spawn(g_game,1000,2,(Vector *)EStack_354,&g_vectorZero,(Entity *)0x0,3,uVar4 ); aEStack_34c[0] = (EntityPtr)0x3fc00000; vecResult = Vector::operator_mul(&VStack_370,(float *)aEStack_34c,&g_vectorOne); Entity::SetSpriteScale(tmpEntity,vecResult); vecResult = Vector::Vector(&VStack_370,0.0,-20.0); Entity::SetPositionOffset(tmpEntity,vecResult); set_field_358(tmpEntity,4.0); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*vfunc)(); FUN_00424510(); uStack_14 = 1; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&entityQuery2,9,-1,-1,0,0); uStack_14 = CONCAT31(uStack_14._1_3_,2); uVar4 = 0; iVar5 = EntityList::Size(); otherProjectile = projectile; if (iVar5 != 0) { do { std::vector::operator_index(); aEStack_34c[0] = (EntityPtr)FUN_004aad40(); if ((aEStack_34c[0] != (EntityPtr)0x0) && (pEVar8 = (Entity_Projectile *)Entity::Target((Entity *)aEStack_34c[0]), pEVar8 == otherProjectile)) { std::vector::push_back(); } uVar4 = uVar4 + 1; uVar9 = EntityList::Size(); } while (uVar4 < uVar9); } this_03 = (Entity_NPC *)projectile; vecResult = Vector::Normalized(&projectile->_velocity,&VStack_370); Vector::__unm(vecResult,&VStack_3f0); EStack_374 = (EntityPtr)0x42a00000; bVar2 = Vector::operator_eq(&VStack_3f0,&g_vectorZero); if (bVar2 != 0) { vecResult = MusicManager::RandomVector(&VStack_370); Vector::operator_assign(&VStack_3f0,vecResult); EStack_364 = (EntityPtr)0xc3340000; EStack_374 = (EntityPtr)0x43340000; } uVar4 = std::vector::size(auStack_454); if (uVar4 < 2) { EStack_374 = (EntityPtr)0x0; EStack_364 = (EntityPtr)0x0; } else { EStack_374 = (EntityPtr)((float)EStack_374 - (float)EStack_364); iVar5 = std::vector::size(auStack_454); EStack_374 = (EntityPtr) ((float)EStack_374 / (float)((double)(iVar5 + -1) + __uint_to_double_fixup[-(iVar5 + -1 >> 0x1f)])); } iVar5 = std::vector::size(auStack_454); if (iVar5 != 0) { uVar4 = 0; do { listEntry = (undefined4 *)FUN_0042c810(); otherProjectile = (Entity_Projectile *)*listEntry; Vector::Rotated(&VStack_3f0,&VStack_3a0, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)] ) * (float)EStack_374 + (float)EStack_364); aEStack_34c[0] = (EntityPtr)0x40c00000; vecResult = Vector::__mul(&VStack_3a0,&VStack_370,(float *)aEStack_34c); vecResult = Vector::__add((Vector *)EStack_354,&VStack_38c,vecResult); Entity::SetPosition((Entity *)otherProjectile,vecResult); fVar17 = random_float(); EStack_35c = (EntityPtr)(fVar17 * 3.0 + 9.0); vecResult = Vector::__mul(&VStack_3a0,&VStack_3b8,(float *)&EStack_35c); Entity::SetVelocity((Entity *)otherProjectile,vecResult); set_projectile_flags(otherProjectile); iVar5 = Entity::SubType((Entity *)otherProjectile); if (iVar5 == 1000) { ProjectileFlags(otherProjectile); set_projectile_flags(otherProjectile); } FUN_0044bfa0(); set_falling_accel(otherProjectile,-0.094); Entity::SetTarget((Entity *)otherProjectile,(Entity *)0x0); Isaac::Random(0x1e); FUN_00444cb0(); uVar4 = uVar4 + 1; uVar9 = std::vector::size(auStack_454); } while (uVar4 < uVar9); this_03 = (Entity_NPC *)projectile; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::GetClampedPositionImpl(room,&VStack_370,&this_03->_pos,3.0,3.0,3.0,3.0); Vector::operator_assign(&this_03->_pos,vecResult); if (this_03->_spawnerType != 0x390) { EStack_360 = (EntityPtr)0x6; do { vecResult = MusicManager::RandomVector(&VStack_370); aEStack_34c[0] = (EntityPtr)random_float(); vecResult = Vector::__mul(vecResult,&VStack_38c,(float *)aEStack_34c); EStack_354 = (EntityPtr)0x42a00000; vecResult = Vector::__mul(vecResult,&VStack_3b8,(float *)&EStack_354); Vector::__add(&this_03->_pos,&scratchVec,vecResult); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pos.y = scratchVec.y; pos.x = scratchVec.x; iVar5 = Room::GetGridCollisionAtPos(room,pos); if (0 < iVar5) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreeTilePosition(room,&VStack_408,&scratchVec,64.0); fVar17 = random_float(); EStack_35c = (EntityPtr)(fVar17 * 38.0 - 19.0); fVar17 = random_float(); vecResult2 = Vector::Vector(&VStack_448,fVar17 * 38.0 - 19.0,(float)EStack_35c); vecResult = Vector::__add(vecResult,&VStack_474,vecResult2); Vector::operator_assign(&scratchVec,vecResult); } vecResult = Vector::__sub(&scratchVec,&VStack_4b4,&this_03->_pos); Vector::Normalized(vecResult,&VStack_3a8); fVar17 = random_float(); EStack_35c = (EntityPtr)(fVar17 * 15.0 - 30.0); fVar17 = random_float(); pVStack_3c4 = (Vector *)(fVar17 * 15.0); vecResult = Vector::operator_mul(&VStack_4c4,(float *)&pVStack_3c4,&VStack_3a8); vecResult = Vector::__add(&this_03->_pos,&VStack_4cc,vecResult); spawn_small_maggot_jump(vecResult,(float)EStack_35c,&this_03->_pos); EStack_360 = (EntityPtr)((int)EStack_360 + -1); } while (EStack_360 != (EntityPtr)0x0); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x17,&this_03->_pos,&g_vectorZero,(Entity *)this_03,0, uVar4); aEStack_34c[0] = (EntityPtr)0x3fc00000; vecResult = Vector::operator_mul(&VStack_370,(float *)aEStack_34c,&g_vectorOne); Entity::SetSpriteScale(tmpEntity,vecResult); } fVar17 = random_float(); pEVar7 = Entity_NPC::MakeSplat(this_03,(fVar17 * 0.5 + 0.5) * 1.5); vfunc = *(code **)(*(int *)pEVar7 + 0x3c); Color::Color(0x3f800000,0); (*vfunc)(); (**(code **)(*(int *)pEVar7 + 0xc))(); Game::ShakeScreen(g_game,5); EntityList_Query::~EntityList_Query(&entityQuery2); uStack_14 = 0xffffffff; FID_conflict__Tidy(auStack_454); this = projectile; } } if (*(int *)((int)this + 0x2c) == 0xe) { *(byte *)((int)this + 0x173) = 0; } if ((((*(int *)((int)this + 0x34) == 0x390) && (*(int *)((int)this + 0x38) == 0)) && (*(int *)((int)this + 0x30) == 1)) && (iVar5 = Entity::GetIntervalTicks((Entity *)this,4.0,0.0), iVar5 != 0)) { uVar4 = Random(); aEStack_34c[0] = (EntityPtr)0x3e4ccccd; vecResult = Vector::__mul((Vector *)((int)this + 0x360),&VStack_370,(float *)aEStack_34c); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,(Vector *)((int)this + 0x33c),vecResult,(Entity *)0x0,0,uVar4); Entity::SetSpawnerEntity((Entity *)otherProjectile,(Entity *)*(EntityPtr *)((int)this + 0x3c8)); FUN_004316b0(); FUN_004b7070(); (**(code **)(*(int *)otherProjectile + 0x3c))(); FUN_00444c70(); set_falling_accel(otherProjectile,1.0); (**(code **)(*(int *)otherProjectile + 0xc))(); } if (*(byte *)((int)this + 0x173) != 0) { bVar2 = Entity::HasEntityFlags((Entity *)this,0x20); if (bVar2 != 0) goto LAB_00653169; EStack_374 = (EntityPtr)0x0; EStack_368 = (EntityPtr)0xa; if ((*(uint *)((int)this + 0x438) & 2) == 0) { iVar5 = *(int *)((int)this + 0x2c); if (((((iVar5 == 0) || (iVar5 == 3)) || ((iVar5 == 4 || ((iVar5 == 5 || (iVar5 == 6)))))) || (iVar5 == 0xc)) || ((iVar5 == 0xd || (iVar5 == 0x10)))) { fStack_380 = *(float *)((int)this + 0x410); EStack_368 = (EntityPtr)0x96; fVar17 = *(float *)((int)this + 0x420); uVar4 = 0xb; EStack_360 = (EntityPtr)(fVar17 * 0.8); if (-5.0 < fStack_380) { EStack_368 = (EntityPtr)0x102; } EStack_364 = (EntityPtr)0x3f800000; if (iVar5 == 4) { if (0.4 <= fVar17) { if (0.8 <= fVar17) { if (fStack_380 <= -5.0) { uVar4 = 0xc; } else { uVar4 = 0xd; } } else { uVar4 = 0x4f; EStack_364 = (EntityPtr)0x3f59999a; EStack_360 = (EntityPtr)0x3f800000; } } else { uVar4 = 0x50; EStack_364 = (EntityPtr)0x3f333333; EStack_360 = (EntityPtr)0x3f800000; } } else if (iVar5 == 5) { tmpColor = (ColorMod *)Sprite::Color((Sprite *)((int)this + 0x48)); fVar17 = random_float(); Game::SpawnParticles (g_game,(Vector *)((int)this + 0x33c),0x3a,4,fVar17 * 2.0 + 1.0,tmpColor, fStack_380,0); uVar4 = 0x2b; } else if (iVar5 == 6) { uVar4 = 0x66; } else { cVar3 = _has_flag_0x110(); if (cVar3 != '\0') { uVar4 = 200; } } uVar9 = Random(); Game::Spawn(g_game,1000,uVar4,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)0x0,0, uVar9); EVar6 = (EntityPtr)__RTDynamicCast(); EStack_374 = EVar6; Entity::SetPositionOffset((Entity *)EVar6,(Vector *)((int)this + 0x34c)); vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)&EStack_360); Entity::SetSpriteScale((Entity *)EVar6,vecResult); Isaac::Random(4); FUN_0043eea0(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::IsPositionInRoom(room,(Vector *)((int)this + 0x33c),-80.0); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride2 ((int)EStack_368,(int)this + 0x33c,2,0,1.0,(float)EStack_364); } } else if (iVar5 == 1) { fStack_380 = *(float *)((int)this + 0x410); tmpColor = (ColorMod *)Sprite::Color((Sprite *)((int)this + 0x48)); fVar17 = random_float(); Game::SpawnParticles (g_game,(Vector *)((int)this + 0x33c),0x23,8,fVar17 * 2.0 + 1.0,tmpColor, fStack_380,1); } else if (iVar5 == 2) { uVar4 = Random(); vecResult = Entity::Position((Entity *)projectile,&VStack_3b0); vecResult2 = Vector::Vector(&VStack_370,0.0,-10.0); vecResult = Vector::__add(vecResult,&VStack_38c,vecResult2); tmpEntity = Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,1,uVar4); this = projectile; tmpColor = (ColorMod *)Sprite::Color((Sprite *)&projectile->_sprite); Color::operator_assign((Color *)auStack_cc,tmpColor); fVar14 = (float10)Color::A(); Font::SetLineHeightModifier((Font *)auStack_cc,(float)(fVar14 * (float10)0.3)); (**(code **)(*(int *)tmpEntity + 0x3c))(); } else if (iVar5 == 7) { uVar4 = Random(); vecResult = Entity::Position((Entity *)projectile,&VStack_3b0); vecResult2 = Vector::Vector(&VStack_370,0.0,-10.0); vecResult = Vector::__add(vecResult,&VStack_38c,vecResult2); tmpEntity = Game::Spawn(g_game,1000,0x61,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar4); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*vfunc)(); otherProjectile = projectile; fStack_380 = projectile->_height; tmpColor = (ColorMod *)Sprite::Color((Sprite *)&projectile->_sprite); fVar17 = random_float(); EStack_368 = (EntityPtr)(fVar17 * 3.0 + 2.0); iVar5 = Isaac::Random(2); Game::SpawnParticles (g_game,&otherProjectile->_pos,0x62,iVar5 + 4,(float)EStack_368,tmpColor, fStack_380,0); fVar17 = random_float(); SoundEffects::PlayWithFartOverride2 (0x8a,(int)&otherProjectile->_pos,2,0,fVar17 * 0.5 + 2.0,0.2); LAB_00655e83: this = projectile; } else if (iVar5 == 8) { Color::Color(&CStack_108); Sprite::SetColor((Sprite *)((int)this + 0x48),color); rng_pair_init(); subtypeHigh = (uint)*(int *)((int)this + 0x30) >> 0x10; subtypeLow = *(int *)((int)this + 0x30) & 0xffff; VStack_34.x = *(float *)((int)this + 0x3ec); bVar2 = Entity::HasEntityFlags((Entity *)this,0x40000); auStack_3c._0_4_ = (BADTYPE)*(float *)((int)this + 0x380); VStack_34.y = (float)(uint)(bVar2 != 0); Entity::DestroyRockGridAt(); } else { if (iVar5 == 9) { Color::Color((Color *)auStack_160); KColor::FromRGBA255((KColor *)auStack_160,0x8c,0x7b,0x7b,0xff); tmpColor = (ColorMod *)Sprite::Color((Sprite *)((int)this + 0x48)); Color::__mul((Color *)auStack_160,tmpColor); uVar4 = Random(); EStack_360 = (EntityPtr)((int)this + 0x33c); tmpEntity = Game::Spawn(g_game,1000,0x91,(Vector *)EStack_360,&g_vectorZero,(Entity *)this ,0,uVar4); pVStack_384 = &projectile->_posOffset; Entity::SetPositionOffset(tmpEntity,pVStack_384); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); sprite = (Sprite *)Entity::GetSprite(tmpEntity); vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)pEStack_358); Sprite::SetScale(sprite,vecResult); sprite = (Sprite *)Entity::GetSprite(tmpEntity); Sprite::SetRotation(sprite,0.0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); EVar6 = EStack_360; bVar2 = Room::IsPositionInRoom(room,(Vector *)EStack_360,-20.0); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride2(0x89,(int)EVar6,2,0,1.0,1.0); aEStack_34c[0] = (EntityPtr)0x10; fStack_380 = 1.4013e-45; fVar17 = random_float(); EStack_368 = (EntityPtr)(int)(*(float *)pEStack_358 * 4.0 * (fVar17 * 0.5 + 1.0)); std::max(); pEVar10 = (EntityPtr *)std::min(); EVar12 = *pEVar10; EStack_354 = EVar12; if (0 < (int)EVar12) { EStack_35c = (EntityPtr)&projectile->_size; do { fVar17 = random_float(); Vector::FromAngle(&VStack_3a0,fVar17 * 360.0); fVar17 = random_float(); pVStack_3c4 = (Vector *)(fVar17 * 2.0 + 1.0); EStack_354 = (EntityPtr)random_float(); vecResult = Vector::__mul(&VStack_3a0,&VStack_3b0,(float *)&EStack_354); vecResult = Vector::__mul(vecResult,&VStack_370,(float *)EStack_35c); Vector::__add((Vector *)EVar6,&VStack_46c,vecResult); uVar4 = Random(); vecResult = Vector::__mul(&VStack_3a0,&VStack_38c,(float *)&pVStack_3c4); tmpEntity = Game::Spawn(g_game,1000,0x23,&VStack_46c,vecResult,(Entity *)0x0,1,uVar4 ); Entity::SetPositionOffset(tmpEntity,pVStack_384); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); EVar12 = (EntityPtr) ((int)&((Entity_Projectile *)((int)EVar12 + -0x460))->_changeTimeout + 3); EVar6 = EStack_360; } while (EVar12 != (EntityPtr)0x0); } } goto LAB_00655e83; } if (iVar5 == 0xb) { uVar4 = Random(); EVar6 = (EntityPtr)((int)this + 0x33c); aEStack_34c[0] = EVar6; tmpEntity = Game::Spawn(g_game,1000,2,(Vector *)EVar6,&g_vectorZero,(Entity *)0x0,2,uVar4) ; Entity::SetPositionOffset(tmpEntity,(Vector *)((int)this + 0x34c)); SoundEffects::PlayWithFartOverride2(0x102,(int)EVar6,2,0,1.0,1.0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); VStack_3f0.x = *(float *)EVar6; VStack_3f0.y = *(float *)((int)this + 0x340); iVar5 = Room::GetGridCollisionAtPos(room,*(Vector *)EVar6); if (iVar5 == 0) { uVar4 = Random(); EVar6 = *(EntityPtr *)((int)this + 0x3c8); fStack_380 = 0.1; vecResult = Vector::__mul(&projectile->_velocity,&VStack_3b0,&fStack_380); tmpEntity = Game::Spawn(g_game,0x18, (uint)((uint)projectile->_initSeed % (uint)EStack_368 == 0), (Vector *)aEStack_34c[0],vecResult,(Entity *)EVar6,0,uVar4); Entity::ClearEntityFlags(tmpEntity,4); Entity::SetField380(tmpEntity,24.0); anm2 = (ANM2 *)Entity::GetSprite(tmpEntity); ANM2::Play(anm2,(byte *)"ReGenProjectile",0); FUN_00440ed0(); this = projectile; bVar2 = Entity::HasEntityFlags((Entity *)projectile,0x1000000); if (bVar2 != 0) { EntityRef::constructor((EntityRef *)auStack_8c,(Entity *)this); Entity::AddShrink(tmpEntity,(EntityRef *)auStack_8c,-0x96,0,0); } } } } if ((*(uint *)((int)this + 0x438) & 0x4000) != 0) { uVar4 = Random(); Game::Spawn(g_game,1000,0x38,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0, uVar4); pEVar7 = (Entity_Effect *)__RTDynamicCast(); (**(code **)(*(int *)pEVar7 + 0xc))(); Entity_Effect::SetTimeout(pEVar7,0xb4); } } else { uVar4 = Random(); pEVar7 = (Entity_Effect *)((int)this + 0x33c); pEStack_358 = pEVar7; EStack_374 = (EntityPtr) Game::Spawn(g_game,1000,1,(Vector *)pEVar7,&g_vectorZero,(Entity *)0x0,0,uVar4); if (*(EntityPtr *)((int)this + 0x3bc) == (EntityPtr)0x0) { EVar6 = (EntityPtr)this; } else { EVar6 = *(EntityPtr *)((int)this + 0x3bc); } Game::BombDamage(g_game,(Vector *)pEVar7,50.0,60.0,1,(Entity *)EVar6,g_tearFlagsNone,4,0); *(uint *)((int)this + 0x438) = *(uint *)((int)this + 0x438) & 0xfffffffd; *(undefined4 *)((int)this + 0x43c) = *(undefined4 *)((int)this + 0x43c); iVar5 = *(int *)((int)this + 0x34); if (iVar5 == 0x389) { EStack_360 = (EntityPtr)0x0; do { vecResult = Vector::FromAngle(&VStack_3b0,(float)(int)EStack_360 * 60.0 + 0.0); fStack_380 = 8.0; Vector::operator_mul(&VStack_3f8,&fStack_380,vecResult); uVar4 = Random(); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,2,(Vector *)((int)this + 0x33c),&VStack_3f8, *(Entity **)((int)this + 0x3bc),0,uVar4); FUN_004316b0(); FUN_004b7070(); set_falling_accel(otherProjectile,0.05); (**(code **)(*(int *)otherProjectile + 0x3c))(); EStack_360 = (EntityPtr)((int)EStack_360 + 1); } while ((int)EStack_360 < 6); iVar5 = *(int *)((int)this + 0x34); } if ((iVar5 == 0x3b7) && (*(int *)((int)this + 0x38) == 0x14)) { Game::ShakeScreen(g_game,8); EStack_360 = (EntityPtr)0x0; do { EVar6 = EStack_360; uVar4 = Random(); EStack_368 = projectile->_spawnerEntity; vecResult = Vector::Vector(&VStack_3b0,0.0,-2.0 - (float)(int)EVar6 * 7.0); vecResult2 = MusicManager::RandomVector(&VStack_370); fStack_380 = 10.0; vecResult2 = Vector::__mul(vecResult2,&VStack_38c,&fStack_380); vecResult2 = Vector::__add((Vector *)pEStack_358,&VStack_3b8,vecResult2); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,0x8d,vecResult2,vecResult,(Entity *)EStack_368,0,uVar4); FUN_004316b0(); FUN_004b7070(); fVar17 = random_float(); aEStack_34c[0] = (EntityPtr)(fVar17 * 0.3 + 1.2); vecResult = Vector::__mul(&g_vectorOne,&VStack_46c,(float *)aEStack_34c); Entity::SetSpriteScale((Entity *)pEVar7,vecResult); (**(code **)(*(int *)pEVar7 + 0xc))(); Entity_Effect::SetTimeout(pEVar7,0x168); uVar4 = Random(); fVar17 = random_float(); vecResult = Vector::Vector(&VStack_438,0.0,-10.0 - fVar17 * 28.0); fVar17 = random_float(); EStack_368 = (EntityPtr)(fVar17 * 20.0 - 10.0); fVar17 = random_float(); vecResult2 = Vector::Vector(&VStack_418,fVar17 * 60.0 - 30.0,(float)EStack_368); vecResult2 = Vector::__add((Vector *)pEStack_358,&VStack_3a8,vecResult2); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,vecResult2,vecResult,(Entity *)0x0,0,uVar4); fVar17 = random_float(); fVar17 = fVar17 * 0.7 + 1.0; FUN_004508a0(); this = projectile; Entity::SetSpawnerEntity((Entity *)otherProjectile,(Entity *)projectile->_spawnerEntity); FUN_004316b0(); FUN_004b7070(); (**(code **)(*(int *)otherProjectile + 0x3c))(); FUN_00444c70(); set_falling_accel(otherProjectile,1.0); (**(code **)(*(int *)otherProjectile + 0xc))(); EStack_360 = (EntityPtr)((int)EStack_360 + 1); } while ((int)EStack_360 < 0xe); Level::GetCurrentRoom((Level *)g_game); Room::get_lava_line_y(); fVar15 = (this->_pos).y; if (fVar17 <= fVar15) { VStack_3f0.x = (this->_pos).x; auVar16 = ZEXT416((uint)fVar15); VStack_3f0.y = fVar15; Level::GetCurrentRoom((Level *)g_game); Room::get_lava_line_y(); VStack_3f0.y = auVar16._0_4_; pEVar7 = Entity_Effect::CreateTimer(reroll_entity_to_free_tile,5,4,0); Entity::SetSpawnerEntity((Entity *)pEVar7,(Entity *)this->_spawnerEntity); FUN_004316b0(); FUN_004b7070(); Entity::SetPosition((Entity *)pEVar7,&VStack_3f0); Entity_Effect::set_state(pEVar7,1); } } } VStack_438.y = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); if ((uVar4 & 0x104) != 0) { uVar4 = Random(); uVar9 = 0x17; if ((*(uint *)((int)this + 0x438) & 4) == 0) { uVar9 = 0x16; } Game::Spawn(g_game,1000,uVar9,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0, uVar4); pEVar7 = (Entity_Effect *)__RTDynamicCast(); FUN_004316b0(); if ((*(uint *)((int)this + 0x438) & 0x10) == 0) { EStack_354 = (EntityPtr)0x40400000; vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)&EStack_354); Entity::SetSpriteScale((Entity *)pEVar7,vecResult); } else { EStack_354 = (EntityPtr)0x3fc00000; vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)&EStack_354); Entity::SetSpriteScale((Entity *)pEVar7,vecResult); Entity_Effect::SetTimeout(pEVar7,10); } (**(code **)(*(int *)pEVar7 + 0xc))(); uVar4 = Random(); Game::Spawn(g_game,1000,7,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)0x0,0,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); fVar17 = random_float(); EStack_354 = (EntityPtr)(fVar17 + 0.8); vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)&EStack_354); Entity::SetSpriteScale(tmpEntity,vecResult); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Sprite::Color((Sprite *)&projectile->_sprite); (*vfunc)(); (**(code **)(*(int *)tmpEntity + 0xc))(); VStack_438.y = *(float *)((int)&projectile->_projectileFlags + 4); uVar4 = (uint)projectile->_projectileFlags; this = projectile; } if ((uVar4 & 8) != 0) { iVar5 = *(int *)((int)this + 0x34); if (iVar5 == 0x3e) { uVar4 = Random(); Game::Spawn(g_game,1000,0x19,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0, uVar4); tmpEntity = (Entity *)__RTDynamicCast(); EStack_354 = (EntityPtr)0x40000000; vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)&EStack_354); Entity::SetSpriteScale(tmpEntity,vecResult); (**(code **)(*(int *)tmpEntity + 0xc))(); SoundEffects::PlayWithFartOverride(0x3a6,1.0,2,0,1.0); } else { if ((iVar5 == 0x133) || (iVar5 == 0x22)) { uVar4 = Random(); Game::Spawn(g_game,1000,0x1a,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0, uVar4); pEVar7 = (Entity_Effect *)__RTDynamicCast(); Entity_Effect::SetTimeout(pEVar7,0x96); EStack_354 = (EntityPtr)0x40000000; } else { uVar4 = Random(); Game::Spawn(g_game,1000,0x1a,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0, uVar4); pEVar7 = (Entity_Effect *)__RTDynamicCast(); EStack_354 = (EntityPtr)0x40400000; } vecResult = Vector::__mul(&g_vectorOne,&VStack_3b0,(float *)&EStack_354); Entity::SetSpriteScale((Entity *)pEVar7,vecResult); (**(code **)(*(int *)pEVar7 + 0xc))(); } } if ((*(uint *)((int)this + 0x438) & 0x10000) != 0) { if (*(int *)((int)this + 0x34) == 0x3e) { EStack_354 = (EntityPtr)Vector::Length((Vector *)((int)this + 0x360)); Vector::Vector(&VStack_3cc,(float)EStack_354,0.0); iVar5 = Isaac::Random(2); if (iVar5 == 0) { vecResult = Vector::Rotated(&VStack_3cc,&VStack_3b0,45.0); Vector::operator_assign(&VStack_3cc,vecResult); } EStack_354 = (EntityPtr)Vector::LengthSquared(&VStack_3cc); if (25.0 <= (float)EStack_354) { vecResult = &VStack_400; VStack_400.x = VStack_3cc.x; VStack_400.y = VStack_3cc.y; } else { EStack_35c = (EntityPtr)0x3fcccccd; vecResult = Vector::__mul(&VStack_3cc,&VStack_3b0,(float *)&EStack_35c); } Vector::operator_assign(&VStack_3cc,vecResult); EStack_364 = (EntityPtr)((int)this + 0x48); pEStack_358 = (Entity_Effect *)0x4; do { uVar4 = Random(); vecResult = Vector::__sub((Vector *)((int)this + 0x33c),&VStack_370, (Vector *)((int)this + 0x360)); Game::Spawn(g_game,*(int *)((int)this + 0x28),*(int *)((int)this + 0x2c),vecResult, &VStack_3cc,(Entity *)0x0,0,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); otherProjectile = projectile; FUN_004316b0(); FUN_004b7070(); EStack_354 = (EntityPtr)(otherProjectile->_height * 0.6); pVStack_384 = (Vector *)0xc1b80000; std::min(); FUN_00450880(); EStack_354 = (EntityPtr)(otherProjectile->_scale - 0.667); pVStack_384 = (Vector *)0x3f800000; std::max(); FUN_004508a0(); qVar1 = otherProjectile->_projectileFlags; tmpEntity[1]._subtype = *(int *)((int)&otherProjectile->_projectileFlags + 4); iVar5 = *(int *)tmpEntity; tmpEntity[1]._variant = (uint)qVar1 & 0xfffeffff; tmpEntity[1]._damageEvents._end = (void *)0x3dcccccd; vfunc = *(code **)(iVar5 + 0x3c); tmpEntity[1]._damageEvents._begin = (void *)0xc0400000; Sprite::Color((Sprite *)EStack_364); (*vfunc)(); Entity::SetParent(tmpEntity,(Entity *)projectile->_parent); (**(code **)(*(int *)tmpEntity + 0xc))(); vecResult = Vector::Vector(&VStack_38c,VStack_3cc.y,-VStack_3cc.x); Vector::operator_assign(&VStack_3cc,vecResult); pEStack_358 = (Entity_Effect *)((int)&pEStack_358[-1]._hitList._capacity + 3); this = projectile; } while (pEStack_358 != (Entity_Effect *)0x0); pEStack_358 = (Entity_Effect *)0x0; } else if ((*(int *)((int)this + 0x34) == 0x38f) && (*(int *)((int)this + 0x38) == 2)) { EStack_354 = (EntityPtr)((int)this + 0x33c); pEStack_358 = (Entity_Effect *)0xffffffff; do { pEVar7 = pEStack_358; uVar4 = Random(); EStack_35c = projectile->_spawnerEntity; fVar17 = random_float(); fVar17 = Math::lerp(-6.0,-10.0,fVar17,0); vecResult = Vector::Vector(&VStack_3b0,0.0,fVar17); vecResult = Vector::Rotated(vecResult,&VStack_370,(float)(int)pEVar7 * 30.0); vecResult2 = Vector::Vector(&VStack_38c,0.0,-6.0); vecResult2 = Vector::__add((Vector *)EStack_354,&VStack_3b8,vecResult2); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,vecResult2,vecResult,(Entity *)EStack_35c,0,uVar4); set_projectile_flags(otherProjectile); FUN_004aad90(); FUN_004aadd0(); this = projectile; FUN_004316b0(); FUN_004b7070(); set_falling_accel(otherProjectile,0.2); (**(code **)(*(int *)otherProjectile + 0x3c))(); pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x2; } while ((int)pEStack_358 < 2); } else { MusicManager::RandomVector(&VStack_3e4); EStack_35c = (EntityPtr)((int)this + 0x360); EStack_354 = (EntityPtr)Vector::Length((Vector *)EStack_35c); Vector::operator_mul_assign(&VStack_3e4,(float *)&EStack_354); pVStack_384 = (Vector *)((int)this + 0x33c); pEStack_358 = (Entity_Effect *)0x0; EStack_364 = (EntityPtr)((int)this + 0x48); do { EntityPtr::clear((EntityPtr *)&scratchVec); if (pEStack_358 < (Entity_Effect *)0x2) { vecResult = &VStack_3e4; } else { vecResult = Vector::Vector(&VStack_3b0,VStack_3e4.y,-VStack_3e4.x); } Vector::operator_assign(&scratchVec,vecResult); if (((uint)pEStack_358 & 1) != 0) { vecResult = Vector::__unm(&scratchVec,&VStack_370); Vector::operator_assign(&scratchVec,vecResult); } uVar4 = Random(); EVar6 = *(EntityPtr *)((int)this + 0x3bc); vecResult = Vector::__sub(pVStack_384,&VStack_38c,(Vector *)EStack_35c); otherProjectile = projectile; Game::Spawn(g_game,projectile->_type,projectile->_variant,vecResult,&scratchVec, (Entity *)EVar6,0,uVar4); tmpEntity = (Entity *)__RTDynamicCast(); FUN_00450880(); tmpEntity[1]._damageEvents._end = (void *)otherProjectile->_fallingAccel; random_float(); FUN_00444c70(); (**(code **)(*(int *)tmpEntity + 0x40))(); iVar5 = *(int *)((int)&otherProjectile->_projectileFlags + 4); tmpEntity[1]._variant = (uint)otherProjectile->_projectileFlags & 0xfffeffff; tmpEntity[1]._subtype = iVar5; FUN_004508a0(); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Sprite::Color((Sprite *)EStack_364); (*vfunc)(); Entity::SetParent(tmpEntity,(Entity *)projectile->_parent); (**(code **)(*(int *)tmpEntity + 0xc))(); pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x1; this = projectile; } while ((int)pEStack_358 < 4); } } if ((*(uint *)((int)this + 0x43c) & 8) != 0) { SoundEffects::PlayWithFartOverride2(0x1e3,(int)((int)this + 0x33c),0x2d,0,1.0,1.0); iVar5 = 0; do { uVar4 = Random(); pEStack_358 = (Entity_Effect *) Game::Spawn(g_game,1000,0x94,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,uVar4); Entity::SetParent((Entity *)pEStack_358,(Entity *)this); Entity_Effect::set_rotation(pEStack_358,(float)iVar5 * 90.0 + 0.0); bVar2 = Entity::HasEntityFlags((Entity *)this,0x20000000); if ((bVar2 != 0) || ((*(uint *)((int)this + 0x438) & 0x80000000) != 0)) { Entity::AddEntityFlags((Entity *)pEStack_358,0x20000000); } iVar5 = iVar5 + 1; } while (iVar5 < 4); } if ((*(uint *)((int)this + 0x43c) & 0x10) != 0) { SoundEffects::PlayWithFartOverride2(0x1e3,(int)((int)this + 0x33c),0x2d,0,1.0,1.0); pEStack_358 = (Entity_Effect *)0x0; do { uVar4 = Random(); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,0x94,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,uVar4); Entity::SetParent((Entity *)pEVar7,(Entity *)this); FUN_004316b0(); FUN_004b7070(); Entity_Effect::set_rotation(pEVar7,(float)(int)pEStack_358 * 90.0 + 45.0); bVar2 = Entity::HasEntityFlags((Entity *)this,0x20000000); if ((bVar2 != 0) || ((*(uint *)((int)this + 0x438) & 0x80000000) != 0)) { Entity::AddEntityFlags((Entity *)pEVar7,0x20000000); } pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x1; } while ((int)pEStack_358 < 4); } uVar4 = *(uint *)((int)this + 0x43c); VStack_418.x = *(float *)((int)this + 0x438); if ((uVar4 & 0x40) != 0) { pVStack_384 = (Vector *)0x40000000; vecResult = (Vector *)((int)this + 0x33c); pVStack_398 = vecResult; vecResult2 = Vector::__mul((Vector *)((int)this + 0x194),&VStack_370,(float *)&pVStack_384); Vector::operator__(vecResult,vecResult2); SoundEffects::PlayWithFartOverride2(0x1e,(int)vecResult,2,0,1.0,1.0); uVar4 = Random(); Game::Spawn(g_game,1000,2,vecResult,&g_vectorZero,(Entity *)0x0,3,uVar4); EVar6 = (EntityPtr)0x8; EStack_364 = (EntityPtr)0x8; if (*(int *)((int)this + 0x34) == 0x3d) { if (*(int *)((int)this + 0x38) == 7) { EVar6 = (EntityPtr)0x6; } EStack_364 = EVar6; } fStack_37c = (float)(int)EStack_364; pEStack_358 = (Entity_Effect *)0x0; do { vecResult = Vector::FromAngle(&VStack_370, ((float)(int)pEStack_358 * 360.0) / fStack_37c + 0.0); pVStack_384 = (Vector *)0x41200000; Vector::__mul(vecResult,&VStack_430,(float *)&pVStack_384); uVar4 = Random(); EVar6 = *(EntityPtr *)((int)this + 0x3c8); vecResult = Vector::__add(pVStack_398,&VStack_3b8,&VStack_430); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,vecResult,&VStack_430,(Entity *)EVar6,0,uVar4); this = projectile; FUN_004316b0(); FUN_004b7070(); if (this->_subtype != 0) { FUN_004508a0(); FUN_00435cd0(); } set_projectile_flags(otherProjectile); pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x1; } while ((int)pEStack_358 < (int)EStack_364); VStack_418.x = *(float *)&this->_projectileFlags; uVar4 = *(uint *)((int)&this->_projectileFlags + 4); } if ((uVar4 & 0x400000) != 0) { vecResult = Vector::Normalized((Vector *)((int)this + 0x360),&VStack_370); Vector::__unm(vecResult,&VStack_438); pVStack_398 = (Vector *)((int)this + 0x33c); pEStack_358 = (Entity_Effect *)0xffffffff; do { vecResult = Vector::Rotated(&VStack_438,&VStack_3b8,(float)(int)pEStack_358 * 24.0); fStack_37c = 10.0; Vector::__mul(vecResult,&VStack_428,&fStack_37c); uVar4 = Random(); EVar6 = *(EntityPtr *)((int)this + 0x3c8); vecResult = Vector::__add(pVStack_398,&VStack_418,&VStack_428); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,vecResult,&VStack_428,(Entity *)EVar6,0,uVar4); this = projectile; FUN_004316b0(); FUN_004b7070(); set_falling_accel(otherProjectile,-0.04); set_projectile_flags(otherProjectile); pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x2; } while ((int)pEStack_358 < 2); VStack_418.x = *(float *)&this->_projectileFlags; uVar4 = *(uint *)((int)&this->_projectileFlags + 4); } if ((uVar4 & 0x20000) != 0) { SoundEffects::PlayWithFartOverride2(0x1e,(int)this + 0x33c,2,0,1.0,1.0); uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,2,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)0x0,3,uVar4); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*vfunc)(); this = projectile; if ((projectile->_spawnerType == 0x38f) && (projectile->_spawnerVariant == 2)) { EStack_364 = *(EntityPtr *)&projectile->_projectileFlags; pVStack_398 = (Vector *)(*(uint *)((int)&projectile->_projectileFlags + 4) & 0xfffdffff); pEStack_358 = (Entity_Effect *)0x0; fStack_37c = (float)((uint)pVStack_398 | 0x401); do { fVar17 = random_float(); fVar17 = Math::lerp(-6.0,-10.0,fVar17,0); vecResult = Vector::Vector(&VStack_3b8,0.0,fVar17); fVar17 = assert_lerp_range((float)(int)pEStack_358,0.0,12.0,-75.0,75.0,1); Vector::Rotated(vecResult,&VStack_418,fVar17); uVar4 = Random(); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,&this->_pos,&VStack_418,(Entity *)this->_spawnerEntity,0,uVar4 ); set_projectile_flags(otherProjectile); FUN_004aad90(); FUN_004aadd0(); FUN_004316b0(); FUN_004b7070(); set_falling_accel(otherProjectile,-0.1); random_float(); FUN_004508a0(); pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x1; } while ((int)pEStack_358 < 0xd); } else { pEStack_358 = (Entity_Effect *)0x10; do { fVar17 = random_float(); fVar17 = Math::lerp(-10.0,-22.0,fVar17,0); vecResult = Vector::Vector(&VStack_3b8,0.0,fVar17); fVar17 = random_float(); fVar17 = Math::lerp(-70.0,70.0,fVar17,0); Vector::Rotated(vecResult,&VStack_3a8,fVar17); uVar4 = Random(); otherProjectile = (Entity_Projectile *) Game::Spawn(g_game,9,0,&this->_pos,&VStack_3a8,(Entity *)this->_spawnerEntity,0,uVar4 ); (**(code **)(*(int *)otherProjectile + 0x3c))(); set_projectile_flags(otherProjectile); FUN_004316b0(); FUN_004b7070(); set_falling_accel(otherProjectile,0.75); random_float(); FUN_004508a0(); pEStack_358 = (Entity_Effect *)((int)&pEStack_358[-1]._hitList._capacity + 3); } while (pEStack_358 != (Entity_Effect *)0x0); } } if ((*(uint *)((int)this + 0x43c) & 0x2000) != 0) { if (*(int *)((int)this + 0x2c) == 1) { SoundEffects::PlayWithFartOverride2(0x1eb,(int)this + 0x33c,2,0,1.0,1.0); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::IsPositionInRoom(room,(Vector *)((int)this + 0x33c),0.0); if (bVar2 != 0) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,uVar4); vfunc = *(code **)(*(int *)tmpEntity + 0x3c); Color::Color(); (*vfunc)(); (**(code **)(*(int *)tmpEntity + 0xc))(); this = projectile; bVar2 = Entity::HasEntityFlags((Entity *)projectile,0x20000000); if ((bVar2 == 0) && ((this->_projectileFlags & 0x80000000) == 0)) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,0x21,0xc,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4); Entity::SetTargetPosition(tmpEntity,this->_pos); fVar14 = (float10)Entity::HitPoints(tmpEntity); pVStack_398 = (Vector *)(float)fVar14; fVar17 = random_float(); fStack_37c = fVar17 * 0.2 + 0.6; Entity::SetField380(tmpEntity,fStack_37c * (float)pVStack_398); } else { uVar4 = Random(); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,10,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar4); FUN_004316b0(); FUN_004b7070(); random_float(); FUN_00435ed0(); (**(code **)(*(int *)pEVar7 + 0x40))(); Entity_Effect::SetTimeout(pEVar7,0x96); } SoundEffects::PlayWithFartOverride2(0x1d7,(int)&this->_pos,2,0,1.0,1.0); } } if ((*(uint *)((int)this + 0x43c) & 0x80) != 0) { uVar4 = Random(); vecResult = (Vector *)((int)this + 0x33c); pEStack_358 = (Entity_Effect *) Game::Spawn(g_game,1000,0x93,vecResult,&g_vectorZero, (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,uVar4); FUN_004316b0(); FUN_004b7070(); bVar2 = Entity::HasEntityFlags((Entity *)this,0x20000000); if ((bVar2 != 0) || ((*(uint *)((int)this + 0x438) & 0x80000000) != 0)) { Entity::AddEntityFlags((Entity *)pEStack_358,0x20000000); } iVar5 = Isaac::Random(10); if (iVar5 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::IsPositionInRoom(room,vecResult,0.0); if (bVar2 != 0) { bVar2 = Entity::HasEntityFlags((Entity *)this,0x20000000); if ((bVar2 == 0) && ((*(uint *)((int)this + 0x438) & 0x80000000) == 0)) { uVar4 = Random(); tmpEntity = Game::Spawn(g_game,0x21,10,vecResult,&g_vectorZero,(Entity *)this,0,uVar4); Entity::SetTargetPosition(tmpEntity,*(Vector *)((int)this + 0x33c)); fVar14 = (float10)Entity::HitPoints(tmpEntity); pVStack_398 = (Vector *)(float)fVar14; fVar17 = random_float(); fStack_37c = fVar17 * 0.2 + 0.4; Entity::SetField380(tmpEntity,fStack_37c * (float)pVStack_398); } else { uVar4 = Random(); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,0x34,vecResult,&g_vectorZero,(Entity *)this,0,uVar4); random_float(); FUN_00435ed0(); (**(code **)(*(int *)pEVar7 + 0x40))(); iVar5 = Isaac::Random(0x78); Entity_Effect::SetTimeout(pEVar7,iVar5 + 300); } } } } uVar4 = *(uint *)((int)this + 0x438); if ((*(uint *)((int)this + 0x43c) & 0x4000) != 0) { if (*(EntityPtr *)((int)this + 0x3c4) == (EntityPtr)0x0) { VStack_3f8.y = *(float *)((int)this + 0x43c); EVar6 = (EntityPtr)0x0; if (*(EntityPtr *)((int)this + 0x3c8) == (EntityPtr)0x0) { LAB_00657ca1: if ((uVar4 & 0x80000000) != 0) goto LAB_00657cca; tmpEntity = Game::GetNearestTargetPlayer ((Vector *)((int)this + 0x33c),(Entity *)EVar6,0,1,(void *)0x0, 5000.0); } else { bVar2 = Entity::HasEntityFlags((Entity *)*(EntityPtr *)((int)this + 0x3c8),0x100); EVar6 = *(EntityPtr *)((int)this + 0x3c8); if (bVar2 == 0) { VStack_3f8.y = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); goto LAB_00657ca1; } LAB_00657cca: tmpEntity = (Entity *)Game::GetNearestEnemy(); } Entity::SetTarget((Entity *)this,tmpEntity); } uVar4 = Random(); pEStack_358 = (Entity_Effect *) Game::Spawn(g_game,1000,0x7e,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)*(EntityPtr *)((int)this + 0x3c8),1,uVar4); sprite = (Sprite *)Entity::GetSprite((Entity *)pEStack_358); tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,tmpColor); if (*(EntityPtr *)((int)this + 0x3c4) == (EntityPtr)0x0) { vecResult = Vector::Normalized((Vector *)((int)this + 0x360),&VStack_3b0); vecResult = Vector::__unm(vecResult,&VStack_370); } else { vecResult = Entity::Position((Entity *)*(EntityPtr *)((int)this + 0x3c4),&VStack_3b0); vecResult = Vector::__sub(vecResult,&VStack_370,(Vector *)((int)this + 0x33c)); vecResult = Vector::Normalized(vecResult,&VStack_38c); } pEVar7 = pEStack_358; Entity::SetTargetPosition((Entity *)pEStack_358,*vecResult); (**(code **)(*(int *)pEVar7 + 0xc))(); } if ((*(uint *)((int)this + 0x43c) & 0x800000) != 0) { vecResult = Vector::Normalized((Vector *)((int)this + 0x360),&VStack_3b0); Vector::__unm(vecResult,&VStack_3f8); play_sound_with_fart_seed(0x1e,1.0,2,0,1.0); uVar4 = Random(); pVStack_398 = (Vector *)((int)this + 0x33c); tmpEntity = Game::Spawn(g_game,1000,2,pVStack_398,&g_vectorZero,(Entity *)0x0,3,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); pEStack_358 = (Entity_Effect *)0xfffffffe; do { uVar4 = Random(); EVar6 = *(EntityPtr *)((int)this + 0x3c8); vecResult = Vector::Rotated(&VStack_3f8,&VStack_3b0,(float)(int)pEStack_358 * 24.0); fStack_37c = 10.0; vecResult = Vector::__mul(vecResult,&VStack_370,&fStack_37c); tmpEntity = Game::Spawn(g_game,9,0,pVStack_398,vecResult,(Entity *)EVar6,0,uVar4); this = projectile; Entity::SetTarget(tmpEntity,(Entity *)projectile); Entity::SetParent(tmpEntity,(Entity *)this->_parent); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); pEStack_358 = (Entity_Effect *)&pEStack_358->field_0x1; } while ((int)pEStack_358 < 3); } if (*(int *)((int)this + 0x2c) == 0xf) { uVar4 = Random(); vecResult = (Vector *)((int)this + 0x33c); tmpEntity = Game::Spawn(g_game,1000,2,vecResult,&g_vectorZero,(Entity *)0x0,3,uVar4); (**(code **)(*(int *)tmpEntity + 0x3c))(); (**(code **)(*(int *)tmpEntity + 0xc))(); this = projectile; play_sound_with_fart_seed(0x1e,1.0,2,0,1.0); FUN_00557b50(); spawn_gibs(vecResult,8,40.0,(uint *)&fStack_37c,(Entity *)this,&g_colorGreenSplat, &g_vectorZero,1.0); } if (EStack_374 != (EntityPtr)0x0) { vfunc = *(code **)(*(int *)EStack_374 + 0x3c); Sprite::Color((Sprite *)((int)this + 0x48)); (*vfunc)(); if (*(int *)((int)this + 0x2c) == 3) { vfunc = *(code **)(*(int *)EStack_374 + 0x3c); Color::Color(); } else { if (*(int *)((int)this + 0x2c) != 0xc) goto LAB_006580b1; vfunc = *(code **)(*(int *)EStack_374 + 0x3c); Color::Color(); } (*vfunc)(); } LAB_006580b1: (**(code **)(*(int *)this + 0x28))(); if (*(int *)((int)this + 0x2c) != 2) { ExceptionList = pvStack_1c; return; } if (*(int *)((int)this + 0x34) == 0x3b7) { play_sound_with_fart_seed(700,1.0,2,0,1.0); ExceptionList = pvStack_1c; return; } ExceptionList = pvStack_1c; return; } VStack_408.x = *(float *)((int)this + 0x438); if ((*(uint *)((int)this + 0x43c) & 4) != 0) { if ((*(EntityPtr *)((int)this + 0x3bc) != (EntityPtr)0x0) && ((((*(uint *)((int)this + 0x43c) & 1) == 0 || (iVar5 = Entity::FrameCount((Entity *)this), iVar5 < 1)) || ((0 < *(int *)((int)this + 0x45c) && (iVar5 = Entity::GetIntervalTicks((Entity *)this,(float)*(int *)((int)this + 0x45c),0.0), iVar5 == 0)))))) { pEStack_358 = (Entity_Effect *)((int)this + 0x360); vecResult = Vector::__add((Vector *)((int)this + 0x33c),&VStack_3b0,(Vector *)pEStack_358); vecResult2 = (Vector *)FUN_004172b0(); Vector::__sub(vecResult,&VStack_3a0,vecResult2); EStack_360 = (EntityPtr)Vector::Length(&VStack_3a0); if ((float)EStack_360 != 0.0) { Vector::__div(&VStack_3a0,&VStack_400,(float *)&EStack_360); fVar17 = Vector::GetAngleDegrees(&VStack_400); *(float *)((int)this + 0x428) = fVar17; Vector::operator__((Vector *)pEStack_358,(Vector *)((int)this + 0x334)); bVar2 = 0; fStack_37c = (50.0 - (float)EStack_360) * 0.1; vecResult = Vector::__mul(&VStack_400,&VStack_3b0,&fStack_37c); vecResult = vector_lerp(&VStack_370,(Vector *)pEStack_358,vecResult,bVar2,0.3); vecResult2 = Entity::Velocity((Entity *)projectile->_parent,&VStack_38c); vecResult = Vector::__add(vecResult,&VStack_3b8,vecResult2); Vector::operator_assign((Vector *)pEStack_358,vecResult); vecResult = Entity::Velocity((Entity *)projectile->_parent,&VStack_3f8); Vector::operator_assign((Vector *)((int)this + 0x334),vecResult); this = projectile; } fVar17 = Math::lerp(*(float *)((int)this + 0x410),-23.0,0.4,0); *(float *)((int)this + 0x410) = fVar17; update_height_collision(this); bVar2 = Entity::IsFrame((Entity *)this,8,0); if (bVar2 != 0) { vfunc = *(code **)(*(int *)this + 0x3c); Color::Color(); Color::operator_assign(aCStackY_1c2c + 0x81,&projectile->_color); FUN_004072e0(); (*vfunc)(); } goto LAB_0065acd8; } vecResult = Vector::FromAngle(&VStack_580,*(float *)((int)this + 0x428)); vecResult = Vector::operator_mul(&VStack_578,(float *)((int)this + 0x458),vecResult); Vector::operator_assign((Vector *)((int)this + 0x360),vecResult); *(float *)((int)this + 0x428) = 0.015; } if (*(void **)((int)this + 0x470) != (code *)0x0) { (**(void **)((int)this + 0x470))(); } fVar17 = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); if (((uint)fVar17 & 0x10000) == 0) { if ((uVar4 & 1) != 0) { bVar2 = Entity::IsFrame((Entity *)this,3,0); if (bVar2 != 0) { Entity::SetTarget((Entity *)this,(Entity *)0x0); } EVar6 = *(EntityPtr *)((int)this + 0x3c4); if (EVar6 == (EntityPtr)0x0) { if (((*(EntityPtr *)((int)this + 0x3c8) == (EntityPtr)0x0) || (bVar2 = Entity::HasEntityFlags((Entity *)*(EntityPtr *)((int)this + 0x3c8),0x100), bVar2 == 0)) && ((*(uint *)((int)this + 0x438) & 0x80000000) == 0)) { tmpEntity = Game::GetNearestTargetPlayer ((Vector *)((int)this + 0x33c), (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,1,(void *)0x0,500.0); } else { tmpEntity = (Entity *)Game::GetNearestEnemy(); } Entity::SetTarget((Entity *)this,tmpEntity); EVar6 = *(EntityPtr *)((int)this + 0x3c4); if (EVar6 != (EntityPtr)0x0) goto LAB_00658602; } else { LAB_00658602: Entity::Position((Entity *)EVar6,&VStack_3a0); Entity::Velocity((Entity *)*(EntityPtr *)((int)this + 0x3c4),&VStack_3a8); fStack_3bc = 0.5; vecResult = Vector::__mul(&VStack_3a8,&VStack_4a4,&fStack_3bc); vecResult = Vector::__add(&VStack_3a0,&VStack_4e8,vecResult); Vector::__sub(vecResult,&scratchVec,(Vector *)((int)this + 0x33c)); fStack_3bc = Vector::Length(&scratchVec); if (fStack_3bc < 100.0) { vecResult = Vector::__sub(&VStack_3a0,&VStack_4a4,(Vector *)((int)this + 0x33c)); Vector::operator_assign(&scratchVec,vecResult); vecResult = Vector::Normalized(&scratchVec,&VStack_4e8); fStack_3bc = 1.4; vecResult = Vector::__mul(vecResult,&VStack_4a4,&fStack_3bc); vecResult = Vector::__mul(vecResult,&VStack_510,(float *)((int)this + 0x424)); vecResult = Vector::__mul(vecResult,&VStack_518,(float *)((int)this + 0x39c)); Vector::operator_add_assign((Vector *)((int)this + 0x360),vecResult); fStack_3bc = *(float *)((int)this + 0x39c); fVar17 = Math::lerp(1.0,0.92,*(float *)((int)this + 0x424),0); fStack_37c = Math::timescale_factor(fVar17,fStack_3bc); Vector::operator_mul_assign((Vector *)((int)this + 0x360),&fStack_37c); } } Entity::GetColor((Entity *)this); fVar14 = (float10)Color::R(); fStack_3bc = (float)fVar14; if (fStack_3bc == 1.0) { Color::Color(&purpleTint); Color::SetColorize(&purpleTint,0.8,0.15,1.0,1.0); Color::SetOffset(&purpleTint,0.26,0.05,0.4); (**(code **)(*(int *)this + 0x3c))(); } } } else { EVar6 = *(EntityPtr *)((int)this + 0x3c4); if (EVar6 == (EntityPtr)0x0) { VStack_3a8.y = fVar17; if (*(EntityPtr *)((int)this + 0x3c8) == (EntityPtr)0x0) { LAB_00658433: if ((uVar4 & 0x80000000) != 0) goto LAB_00658462; tmpEntity = Game::GetNearestTargetPlayer ((Vector *)((int)this + 0x33c), (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,1,(void *)0x0,5000.0); } else { bVar2 = Entity::HasEntityFlags((Entity *)*(EntityPtr *)((int)this + 0x3c8),0x100); if (bVar2 == 0) { VStack_3a8.y = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); goto LAB_00658433; } LAB_00658462: tmpEntity = (Entity *)Game::GetNearestEnemy(); } Entity::SetTarget((Entity *)this,tmpEntity); EVar6 = *(EntityPtr *)((int)this + 0x3c4); if (EVar6 == (EntityPtr)0x0) goto LAB_00658802; } vecResult = Entity::Position((Entity *)EVar6,&VStack_570); vecResult = Vector::__sub(vecResult,&VStack_518,(Vector *)((int)this + 0x33c)); fStack_37c = 0.1; vecResult = Vector::__mul(vecResult,&VStack_510,&fStack_37c); vecResult = Vector::__add((Vector *)((int)this + 0x360),&VStack_4e8,vecResult); pVStack_398 = (Vector *)Vector::Length((Vector *)((int)this + 0x360)); fStack_3bc = 0.001; pfVar11 = (float *)std::max(); vecResult = Vector::Resized(vecResult,&VStack_4a4,*pfVar11); Vector::operator_assign((Vector *)((int)this + 0x360),vecResult); } LAB_00658802: uVar4 = *(uint *)((int)this + 0x438); VStack_3a0.y = *(float *)((int)this + 0x43c); if (((uVar4 & 0x10) != 0) && (*(int *)((int)this + 0x34) != 0x11d)) { vfunc = *(code **)(*(int *)this + 0x3c); Color::Color(); (*vfunc)(); VStack_3a0.y = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); } if (((uVar4 & 0x400) != 0) && (bVar2 = Entity::IsFrame((Entity *)this,2,0), bVar2 != 0)) { uVar4 = Random(); pEVar7 = (Entity_Effect *) Game::Spawn(g_game,1000,0x16,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this ,0,uVar4); if (*(int *)((int)this + 0x34) != 0x10e) { Entity_Effect::SetTimeout(pEVar7,0x5a); } } if (((*(uint *)((int)this + 0x438) & 0x4000) != 0) && (iVar5 = Entity::GetIntervalTicks((Entity *)this,20.0,0.0), iVar5 != 0)) { uVar4 = Random(); Game::Spawn(g_game,1000,0x38,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0,uVar4) ; pEVar7 = (Entity_Effect *)__RTDynamicCast(); (**(code **)(*(int *)pEVar7 + 0xc))(); Entity_Effect::SetTimeout(pEVar7,0xb4); } if ((*(uint *)((int)this + 0x438) & 0x40000000) == 0) goto LAB_00658b5a; Level::GetCurrentRoom((Level *)g_game); vecResult = (Vector *)Room::ScreenWrapPosition(); Vector::operator_assign((Vector *)((int)this + 0x33c),vecResult); bVar2 = Entity::IsFrame((Entity *)this,2,*(int *)((int)this + 0x20)); if (bVar2 == 0) goto LAB_00658b5a; fVar17 = *(float *)((int)this + 0x3a4); Color::Color((Color *)auStack_cc); switch((int)(fVar17 * 0.5) % 9) { case 0: fVar17 = 0.33; goto LAB_00658b2f; case 1: fVar17 = 0.66; goto LAB_00658b2f; case 2: fVar17 = 1.0; goto LAB_00658b2f; case 3: fVar18 = 0.66; fVar17 = 0.66; fVar15 = 0.66; break; case 4: fVar18 = 0.33; fVar17 = 0.33; fVar15 = 0.33; break; case 5: Color::SetTint((Color *)auStack_cc,0.0,0.0,0.0,1.0); goto LAB_00658b41; case 6: fVar18 = 0.33; fVar17 = 0.0; fVar15 = 0.33; break; case 7: fVar18 = 0.66; fVar17 = 0.0; fVar15 = 0.66; break; case 8: fVar17 = 0.0; LAB_00658b2f: fVar18 = 1.0; fVar15 = 1.0; break; default: goto LAB_00658b41; } Color::SetColorize((Color *)auStack_cc,fVar15,fVar17,fVar18,1.0); LAB_00658b41: (**(code **)(*(int *)this + 0x3c))(); LAB_00658b5a: if ((*(uint *)((int)this + 0x438) & 0x1800) != 0) { if (((*(uint *)((int)this + 0x43c) & 0x1000000) == 0) || (*(EntityPtr *)((int)this + 0x3bc) == (EntityPtr)0x0)) { Vector::__sub((Vector *)((int)this + 0x33c),&VStack_3e4,(Vector *)((int)this + 0x334)); Vector::Vector(&VStack_428,-VStack_3e4.y,VStack_3e4.x); if ((*(uint *)((int)this + 0x438) & 0x1000) != 0) { vecResult = Vector::__unm(&VStack_428,&VStack_508); Vector::operator_assign(&VStack_428,vecResult); } if (*(float *)((int)this + 0x430) <= 0.0) { aEStack_34c[0] = (EntityPtr)0x3f000000; pEVar10 = aEStack_34c; } else { fVar17 = Vector::Length(&VStack_3e4); aEStack_34c[0] = (EntityPtr)(1.0 - fVar17 / *(float *)((int)this + 0x430)); fVar17 = Math::clamp(-1.0,1.0,(float)aEStack_34c[0]); EStack_354 = (EntityPtr)(fVar17 * 0.5); pEVar10 = &EStack_354; } Vector::operator_mul_assign(&VStack_3e4,(float *)pEVar10); vecResult = Vector::__add(&VStack_3e4,&VStack_560,&VStack_428); vecResult = Vector::Normalized(vecResult,&VStack_550); speed = Vector::Length((Vector *)((int)this + 0x360)); vecResult = Vector::__mul(vecResult,&VStack_540,&speed); Vector::operator_assign((Vector *)((int)this + 0x360),vecResult); this = projectile; } else { Vector::operator__((Vector *)((int)this + 0x360),(Vector *)((int)this + 0x468)); vecResult = Entity::Position((Entity *)*(EntityPtr *)((int)this + 0x3bc),&VStack_370); Vector::__sub((Vector *)((int)this + 0x33c),&VStack_420,vecResult); Vector::Vector(&VStack_4ac,-VStack_420.y,VStack_420.x); if ((*(uint *)((int)this + 0x438) & 0x1000) != 0) { vecResult = Vector::__unm(&VStack_4ac,&VStack_370); Vector::operator_assign(&VStack_4ac,vecResult); } if (*(float *)((int)this + 0x430) <= 0.0) { aEStack_34c[0] = (EntityPtr)0x3f000000; pEVar10 = aEStack_34c; } else { fVar17 = Vector::Length(&VStack_420); aEStack_34c[0] = (EntityPtr)(1.0 - fVar17 / *(float *)((int)this + 0x430)); fVar17 = Math::clamp(-1.0,1.0,(float)aEStack_34c[0]); EStack_354 = (EntityPtr)(fVar17 * 0.5); pEVar10 = &EStack_354; } Vector::operator_mul_assign(&VStack_420,(float *)pEVar10); vecResult = Vector::__add(&VStack_420,&VStack_370,&VStack_4ac); vecResult = Vector::Normalized(vecResult,&VStack_38c); aEStack_34c[0] = (EntityPtr)Vector::Length((Vector *)((int)this + 0x360)); vecResult = Vector::__mul(vecResult,&VStack_3b8,(float *)aEStack_34c); Vector::operator_assign((Vector *)((int)this + 0x360),vecResult); vecResult = Entity::Velocity((Entity *)*(EntityPtr *)((int)this + 0x3bc),&VStack_3a8); Vector::operator_add_assign((Vector *)((int)this + 0x360),vecResult); vecResult = Entity::Velocity((Entity *)*(EntityPtr *)((int)this + 0x3bc),&VStack_408); Vector::operator_assign((Vector *)((int)this + 0x468),vecResult); vecResult = Entity::Position((Entity *)*(EntityPtr *)((int)this + 0x3bc),&VStack_508); Vector::operator_assign((Vector *)((int)this + 0x334),vecResult); } } EStack_364 = (EntityPtr)((int)this + 0x360); if ((*(uint *)((int)this + 0x438) & 0xc0000) != 0) { vecResult = (Vector *)((int)this + 0x360); EStack_374 = (EntityPtr)Vector::Length(vecResult); Vector::Vector(&VStack_430,-*(float *)((int)this + 0x364),((Vector *)((int)this + 0x360))->x); if ((*(uint *)((int)this + 0x438) & 0x40000) != 0) { vecResult2 = Vector::__unm(&VStack_430,&VStack_370); Vector::operator_assign(&VStack_430,vecResult2); } vecResult2 = Vector::__mul(&VStack_430,&VStack_370,(float *)&EStack_374); vecResult2 = Vector::__mul(vecResult2,&VStack_38c,(float *)((int)this + 0x428)); vecResult2 = Vector::__mul(vecResult2,&VStack_3b8,(float *)((int)this + 0x39c)); Vector::operator_add_assign(vecResult,vecResult2); Vector::Resize(vecResult,(float)EStack_374); } EStack_364 = (EntityPtr)((int)this + 0x360); if ((*(uint *)((int)this + 0x438) & 0x100000) != 0) { uVar4 = 0; iVar5 = Game::GetNumPlayers(g_game); if (0 < iVar5) { do { player = Game::GetPlayer(g_game,uVar4); vecResult = Entity::Position((Entity *)player,&VStack_370); Vector::__sub(vecResult,&VStack_4e0,(Vector *)((int)this + 0x33c)); Vector::Vector(&VStack_3b8,0.0,1.0); vecResult = Vector::Normalized(&VStack_4e0,&VStack_38c); aEStack_34c[0] = (EntityPtr)Vector::Dot(&VStack_3b8,vecResult); if (((float)aEStack_34c[0] < 0.05) && (-0.4 < (float)aEStack_34c[0])) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pfVar11 = (float *)Room::GetTopLeftPos(room); if (*pfVar11 - 120.0 < ((Vector *)((int)this + 0x33c))->x) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pfVar11 = (float *)Room::GetBottomRightPos(room); if (((Vector *)((int)this + 0x33c))->x <= *pfVar11 + 120.0 && *pfVar11 + 120.0 != ((Vector *)((int)this + 0x33c))->x) { vecResult = Vector::Vector(&VStack_370,1.0,0.0); aEStack_34c[0] = (EntityPtr)Vector::Length((Vector *)((int)this + 0x360)); vecResult = Vector::__mul(vecResult,&VStack_38c,(float *)aEStack_34c); EStack_354 = (EntityPtr)0x40000000; Vector::__mul(vecResult,&VStack_400,(float *)&EStack_354); aEStack_34c[0] = (EntityPtr)Vector::Dot(&VStack_4e0,&VStack_400); if ((float)aEStack_34c[0] <= 0.0) { vecResult = Vector::__unm(&VStack_400,&VStack_538); } else { vecResult = &VStack_400; } Vector::operator_assign((Vector *)((int)this + 0x360),vecResult); *(uint *)((int)this + 0x438) = *(uint *)((int)this + 0x438) & 0xffefffff; *(undefined4 *)((int)this + 0x43c) = *(undefined4 *)((int)this + 0x43c); break; } } } uVar4 = uVar4 + 1; iVar5 = Game::GetNumPlayers(g_game); } while ((int)uVar4 < iVar5); } } fVar17 = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); if (((uint)fVar17 & 0x200) != 0) { if (*(EntityPtr *)((int)this + 0x3c8) == (EntityPtr)0x0) { LAB_006592f6: Entity::Die((Entity *)this); uVar4 = *(uint *)((int)this + 0x438); *(uint *)((int)this + 0x43c) = *(uint *)((int)this + 0x43c) & 0xfffffdff; *(uint *)((int)this + 0x438) = uVar4; } else { vecResult = (Vector *)Entity::TargetPosition(); bVar2 = Vector::operator_ne(vecResult,&g_vectorZero); if (bVar2 == 0) goto LAB_006592f6; Entity::Position((Entity *)*(EntityPtr *)((int)this + 0x3c8),&VStack_4c4); pfVar11 = (float *)Entity::TargetPosition((Entity *)*(EntityPtr *)((int)this + 0x3c8)); scratchVec.x = *pfVar11; scratchVec.y = pfVar11[1]; pVStack_384 = (Vector *)Vector::Length(&scratchVec); Vector::__div_assign(&scratchVec,(float *)&pVStack_384); Vector::__sub((Vector *)((int)this + 0x33c),&VStack_4cc,&VStack_4c4); pEStack_358 = (Entity_Effect *)Vector::Length(&VStack_4cc); aEStack_34c[0] = (EntityPtr)Vector::Dot(&VStack_4cc,&scratchVec); EVar6 = EStack_364; if ((float)aEStack_34c[0] < 0.0) { pEStack_358 = (Entity_Effect *)((float)pEStack_358 * -1.0); } fStack_4d4 = Vector::Length((Vector *)EStack_364); if (((float)pEStack_358 < 0.0) || ((float)pVStack_384 < (float)pEStack_358)) goto LAB_006592f6; vecResult = Vector::operator_mul(&VStack_370,(float *)&pEStack_358,&scratchVec); vecResult = Vector::__add(&VStack_4c4,&VStack_38c,vecResult); Vector::operator_assign((Vector *)((int)this + 0x33c),vecResult); vecResult = Vector::operator_mul(&VStack_568,&fStack_4d4,&scratchVec); Vector::operator_assign((Vector *)EVar6,vecResult); uVar4 = *(uint *)((int)this + 0x438); } fVar17 = *(float *)((int)this + 0x43c); } if (((uint)fVar17 & 0x40000) != 0) { RNG::game_constructor((RNG *)(auStack_cc + 0x30),*(int *)((int)this + 0x3ec),8); uStack_14 = 4; aEStack_34c[0] = (EntityPtr)RNG::RandomFloat((RNG *)(auStack_cc + 0x30)); fStack_480 = Math::lerp(2.0,5.0,(float)aEStack_34c[0],0); fVar17 = RNG::RandomFloat((RNG *)(auStack_cc + 0x30)); VStack_3dc.y = *(float *)((int)this + 0x338); VStack_3dc.x = ((Vector *)((int)this + 0x334))->x; aEStack_34c[0] = (EntityPtr)(*(float *)((int)this + 0x3a4) / 100.0 + fVar17); EStack_360 = (EntityPtr)Vector::Length(&VStack_3dc); Vector::__div_assign(&VStack_3dc,(float *)&EStack_360); Vector::Rotated(&VStack_3dc,&VStack_38c,90.0); pVStack_3c4 = (Vector *)Vector::Dot((Vector *)EStack_364,&VStack_3dc); Vector::__mul(&VStack_3dc,&VStack_4b4,(float *)&pVStack_3c4); vecResult = Vector::__mul(&VStack_38c,&VStack_3a8,&fStack_480); EStack_354 = (EntityPtr) sinf_wrapper(((float)aEStack_34c[0] + (float)aEStack_34c[0]) * 3.1415927); Vector::__mul(vecResult,&VStack_370,(float *)&EStack_354); if ((float)pVStack_3c4 < (float)EStack_360) { vecResult = Vector::__mul(&VStack_3dc,&VStack_3a8,(float *)&EStack_360); aEStack_34c[0] = (EntityPtr)0x3bf5c28f; vecResult = Vector::__mul(vecResult,&VStack_408,(float *)aEStack_34c); Vector::operator_add_assign(&VStack_4b4,vecResult); } vecResult = Vector::__add(&VStack_4b4,&VStack_3a8,&VStack_370); Vector::operator_assign((Vector *)EStack_364,vecResult); uStack_14 = 0xffffffff; guard_check_icall(); uVar4 = *(uint *)((int)this + 0x438); fVar17 = *(float *)((int)this + 0x43c); } if ((uVar4 & 0x200000) != 0) { fVar17 = *(float *)((int)this + 0x3a4) * 3.1415927; fStack_484 = sinf_wrapper((fVar17 + fVar17) / 30.0); vecResult = Vector::__mul((Vector *)((int)this + 0x360),&VStack_598,&fStack_484); Vector::operator_add_assign((Vector *)((int)this + 0x33c),vecResult); uVar4 = *(uint *)((int)this + 0x438); fVar17 = *(float *)((int)this + 0x43c); } EStack_364 = (EntityPtr)((int)this + 0x33c); if ((uVar4 & 0x20) != 0) { Vector::Vector(&VStack_474,*(float *)((int)this + 0x364),-((Vector *)((int)this + 0x360))->x); Vector::Normalize(&VStack_474); fVar17 = 1.0; if (*(int *)((int)this + 0x34) == 0x390) { fVar17 = 2.0; } fVar17 = ((float)*(int *)((int)this + 0x448) + *(float *)((int)this + 0x3a4)) * fVar17 * 3.1415927; fVar17 = (fVar17 + fVar17) / 30.0; FUN_00417150(); fStack_488 = fVar17 * 3.0; vecResult = Vector::__mul(&VStack_474,&VStack_530,&fStack_488); Vector::operator_add_assign((Vector *)EStack_364,vecResult); uVar4 = *(uint *)((int)this + 0x438); fVar17 = *(float *)((int)this + 0x43c); } vecResult = (Vector *)((int)this + 0x360); VStack_3a8.y = fVar17; if ((uVar4 & 0x400000) != 0) { Vector::Vector(&VStack_448,*(float *)((int)this + 0x364),-vecResult->x); Vector::Normalize(&VStack_448); aEStack_34c[0] = (EntityPtr)0x40800000; EStack_354 = (EntityPtr) (((float)*(int *)((int)this + 0x448) + *(float *)((int)this + 0x3a4)) * 0.04); pfVar11 = (float *)std::min(); aEStack_34c[0] = (EntityPtr)(*pfVar11 + 3.0); fVar17 = ((float)*(int *)((int)this + 0x448) + *(float *)((int)this + 0x3a4)) * 3.1415927; fVar17 = (fVar17 + fVar17) / 30.0; FUN_00417150(); fStack_48c = fVar17 * (float)aEStack_34c[0]; vecResult2 = Vector::__mul(&VStack_448,&VStack_548,&fStack_48c); Vector::operator_add_assign((Vector *)((int)this + 0x33c),vecResult2); VStack_3a8.y = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); } if ((uVar4 & 0x800000) != 0) { fVar17 = sqrtf(2.0); aEStack_34c[0] = (EntityPtr)(fVar17 * 30.0); fVar17 = sqrtf(2.0); aEStack_34c[0] = (EntityPtr)(int)((float)aEStack_34c[0] / (fVar17 + 1.0)); iVar5 = Entity::FrameCount((Entity *)this); if (iVar5 == 1) { fVar17 = 45.0; vecResult2 = &VStack_558; } else { iVar5 = Entity::GetHitPointsLost((Entity *)this); if (iVar5 < 1) goto LAB_00659836; EVar6 = (EntityPtr)((int)*(float *)((int)this + 0x3a4) % 0x1e); if (EVar6 == aEStack_34c[0]) { fVar17 = -135.0; vecResult2 = &VStack_588; } else { if (EVar6 != (EntityPtr)0x0) goto LAB_00659836; fVar17 = 135.0; vecResult2 = &VStack_590; } } vecResult2 = Vector::Rotated(vecResult,vecResult2,fVar17); Vector::operator_assign(vecResult,vecResult2); } LAB_00659836: if ((*(uint *)((int)this + 0x438) & 0x2000000) != 0) { fVar17 = sqrtf(2.0); aEStack_34c[0] = (EntityPtr)(fVar17 * 15.0); fVar17 = sqrtf(2.0); aEStack_34c[0] = (EntityPtr)(int)((float)aEStack_34c[0] / (fVar17 + 1.0)); iVar5 = Entity::FrameCount((Entity *)this); if (iVar5 == 1) { fVar17 = 45.0; vecResult2 = &VStack_5a0; } else { iVar5 = Entity::GetHitPointsLost((Entity *)this); if (iVar5 < 1) goto LAB_00659903; EVar6 = (EntityPtr)((int)*(float *)((int)this + 0x3a4) % 0xf); if (EVar6 == aEStack_34c[0]) { fVar17 = -90.0; vecResult2 = &VStack_520; } else { if (EVar6 != (EntityPtr)0x0) goto LAB_00659903; fVar17 = 90.0; vecResult2 = &VStack_528; } } vecResult2 = Vector::Rotated(vecResult,vecResult2,fVar17); Vector::operator_assign(vecResult,vecResult2); } LAB_00659903: if (((*(uint *)((int)this + 0x438) & 0x4000000) != 0) && (*(EntityPtr *)((int)this + 0x3bc) != (EntityPtr)0x0)) { vecResult2 = Entity::Position((Entity *)*(EntityPtr *)((int)this + 0x3bc),&VStack_3a8); Vector::__sub(vecResult2,&VStack_408,(Vector *)((int)this + 0x33c)); fVar17 = Vector::Length(vecResult); vecResult2 = Vector::Resized(&VStack_408,&VStack_3a8,fVar17); Vector::operator_assign(vecResult,vecResult2); EStack_354 = (EntityPtr)Vector::LengthSquared(&VStack_408); aEStack_34c[0] = (EntityPtr)Vector::LengthSquared(vecResult); if ((float)EStack_354 < (float)aEStack_34c[0]) { LAB_00653169: (**(code **)(*(int *)this + 0x28))(); ExceptionList = pvStack_1c; return; } } if ((*(uint *)((int)this + 0x43c) & 0x100000) != 0) { Vector::__sub((Vector *)((int)this + 0x334),&VStack_3a0,(Vector *)((int)this + 0x33c)); EStack_35c = (EntityPtr)Vector::Length(&VStack_3a0); if (10.0 <= (float)EStack_35c) { Vector::__div_assign(&VStack_3a0,(float *)&EStack_35c); bVar2 = 0; vecResult2 = Vector::__mul(&VStack_3a0,&VStack_500,(float *)((int)this + 0x424)); Entity::AddVelocity((Entity *)this,vecResult2,bVar2); if (*(float *)((int)this + 0x3a4) <= 150.0 && *(float *)((int)this + 0x3a4) != 150.0) { *(float *)((int)this + 0x414) = 0.0; *(float *)((int)this + 0x410) = -15.0; } } else { Entity::Die((Entity *)this); } } if ((*(uint *)((int)this + 0x438) & 0x8000000) != 0) { fStack_49c = Math::timescale_factor(*(float *)((int)this + 0x42c),*(float *)((int)this + 0x39c)) ; Vector::operator_mul_assign(vecResult,&fStack_49c); if (*(int *)((int)this + 0x34) == 0x197) { aEStack_34c[0] = (EntityPtr)Vector::Length(vecResult); if (9.0 < (float)aEStack_34c[0]) { fStack_40c = 9.0 / (float)aEStack_34c[0]; pfVar11 = &fStack_40c; goto LAB_00659b08; } } else if ((*(int *)((int)this + 0x34) == 0x378) && (fStack_40c = Vector::Length(vecResult), 10.0 < fStack_40c)) { fStack_490 = 10.0 / fStack_40c; pfVar11 = &fStack_490; LAB_00659b08: Vector::operator_mul_assign(vecResult,pfVar11); } } uVar4 = *(uint *)((int)this + 0x438); fVar17 = *(float *)((int)this + 0x43c); if ((uVar4 & 0x10000000) != 0) { fStack_494 = Math::timescale_factor (1.0 / *(float *)((int)this + 0x42c),*(float *)((int)this + 0x39c)); Vector::operator_mul_assign(vecResult,&fStack_494); uVar4 = *(uint *)((int)this + 0x438); fVar17 = *(float *)((int)this + 0x43c); } VStack_3a8.y = fVar17; if (((uint)fVar17 & 0x20) != 0) { aEStack_34c[0] = (EntityPtr)(*(float *)((int)this + 0x3a4) / 20.0); EStack_354 = (EntityPtr)0x3f800000; pfVar11 = (float *)std::min(); EStack_364 = *(EntityPtr *)((int)this + 0x39c); fVar17 = Math::lerp(1.0,*(float *)((int)this + 0x42c),*pfVar11,0); fStack_498 = Math::timescale_factor(fVar17,(float)EStack_364); Vector::operator_mul_assign(vecResult,&fStack_498); VStack_3a8.y = *(float *)((int)this + 0x43c); uVar4 = *(uint *)((int)this + 0x438); } if ((((uVar4 & 0x20000000) != 0) && (20.0 < *(float *)((int)this + 0x3a4))) && (((iVar5 = Entity::GetHitPointsLost((Entity *)this), 0 < iVar5 && (iVar5 = Isaac::Random(0x1e), iVar5 == 0)) || (*(int *)((int)this + 0x34) == 0x3e)))) { Vector::Vector((Vector *)auStack_3c,-*(float *)((int)this + 0x364), ((Vector *)((int)this + 0x360))->x); Vector::Vector(&VStack_34,*(float *)((int)this + 0x364),-((Vector *)((int)this + 0x360))->x); forwardDirX = ((Vector *)((int)this + 0x360))->x; aEStack_34c[0] = (EntityPtr)auStack_3c; forwardDirY = *(float *)((int)this + 0x364); rng._shift1 = 0x40000; rng._shift2 = 0x80000; rng._shift3 = 0x200000; EStack_364 = (EntityPtr)0x0; do { EVar6 = aEStack_34c[0]; EStack_354 = (EntityPtr)Vector::LengthSquared((Vector *)aEStack_34c[0]); if (25.0 <= (float)EStack_354) { VStack_47c.y = *(float *)((int)EVar6 + 4); vecResult = &VStack_47c; VStack_47c.x = *(float *)EVar6; } else { fStack_410 = 1.6; vecResult = Vector::__mul((Vector *)EVar6,&VStack_4bc,&fStack_410); } VStack_3a8.x = vecResult->x; VStack_3a8.y = vecResult->y; uVar4 = Random(); vecResult = Vector::__sub((Vector *)((int)this + 0x33c),&VStack_440, (Vector *)((int)this + 0x360)); Game::Spawn(g_game,*(int *)((int)this + 0x28),*(int *)((int)this + 0x2c),vecResult,&VStack_3a8 ,(Entity *)0x0,0,uVar4); EVar6 = (EntityPtr)__RTDynamicCast(); EStack_354 = EVar6; FUN_004316b0(); FUN_004b7070(); pVStack_3d0 = (Vector *)(*(float *)((int)this + 0x410) * 0.6); EStack_378 = (EntityPtr)0xc1b80000; std::min(); FUN_00450880(); EStack_378 = (EntityPtr)(*(float *)((int)this + 0x420) - 0.667); pVStack_3d0 = (Vector *)0x3f800000; std::max(); FUN_004508a0(); if (1.0 < *(float *)((int)this + 0x420)) { *(float *)((int)EVar6 + 0x418) = *(float *)((int)this + 0x418); random_float(); } else { *(uint *)((int)this + 0x438) = *(uint *)((int)this + 0x438) & 0xdfffffff; *(undefined4 *)((int)this + 0x43c) = *(undefined4 *)((int)this + 0x43c); *(float *)((int)EVar6 + 0x418) = 0.1; *(float *)((int)EVar6 + 0x414) = -3.0; } uVar4 = *(uint *)((int)this + 0x438); *(int *)((int)EVar6 + 0x43c) = *(int *)((int)this + 0x43c); *(uint *)((int)EVar6 + 0x438) = (uint)(&CStack_108)[1]._tint[(int)((int)EStack_364 + 1)] | uVar4 & 0xffd3ffff; vfunc = *(code **)(*(int *)EVar6 + 0x3c); Sprite::Color((Sprite *)((int)this + 0x48)); (*vfunc)(); EVar6 = EStack_354; Entity::SetParent((Entity *)EStack_354,(Entity *)*(EntityPtr *)((int)this + 0x3bc)); (**(code **)(*(int *)EVar6 + 0xc))(); EStack_364 = (EntityPtr)((int)EStack_364 + 1); aEStack_34c[0] = (EntityPtr)((int)aEStack_34c[0] + 8); } while ((int)EStack_364 < 3); vfunc = *(code **)(*(int *)this + 0x24); EntityRef::EntityRef((EntityRef *)(auStack_160 + 4)); (*vfunc)(); } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar2 = PlayerManager::AnyoneHasCollectible(playerManager,0x1a7); if (bVar2 == 0) { LAB_00659f8a: isCircleProc = '\0'; } else { RNG::game_constructor(&rng,*(int *)((int)this + 0x3ec),0x2c); uStack_14 = 5; EStack_368 = (EntityPtr)0x1; uVar4 = RNG::RandomInt(this_00,100); isCircleProc = '\x01'; if (0x20 < uVar4) goto LAB_00659f8a; } uStack_14 = 0xffffffff; if (((uint)EStack_368 & 1) != 0) { guard_check_icall(); } if (isCircleProc != '\0') { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&entityQuery,7,8,3,1,0); uStack_14 = 6; EVar6 = (EntityPtr)0x0; aEStack_34c[0] = (EntityPtr)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { std::vector::operator_index(); EStack_368 = (EntityPtr)__RTDynamicCast(); fVar14 = (float10)Entity_Laser::Radius((Entity_Laser *)EStack_368); EStack_378 = (EntityPtr)(float)fVar14; vecResult = Entity::Position((Entity *)EStack_368,&VStack_440); pVStack_3d0 = (Vector *)Vector::DistanceSquared((Vector *)((int)this + 0x33c),vecResult); if ((float)pVStack_3d0 < (float)EStack_378 * (float)EStack_378) { (**(code **)(*(int *)this + 0x28))(); EVar6 = (EntityPtr)Entity::SpawnerEntity((Entity *)EStack_368); EStack_360 = EVar6; if (EVar6 == (EntityPtr)0x0) { LAB_0065a0e7: TearParams::constructor(tearParams); } else { bVar2 = Entity::is_player((Entity *)EVar6); if (bVar2 == 0) { EVar6 = (EntityPtr)0x0; } EStack_360 = EVar6; if (EVar6 == (EntityPtr)0x0) goto LAB_0065a0e7; Isaac::Random(2); Entity_Player::GetTearHitParams(); } TearParams::copy(); uVar4 = Random(); vecResult = Vector::__unm((Vector *)((int)this + 0x360),&VStack_4bc); Game::Spawn(g_game,2,0,(Vector *)((int)this + 0x33c),vecResult,(Entity *)EStack_360,0, uVar4); this_01 = (Entity_Tear *)__RTDynamicCast(); SetHeight((Entity_Projectile *)this_01,*(float *)((int)this + 0x410)); FUN_00444c70(); (**(code **)(*(int *)this_01 + 0x40))(); Entity_Tear::SetTearFlags(this_01,g_tearFlagHoming); Entity_Tear::SetScale(this_01,fStack_22c); set_falling_accel((Entity_Projectile *)this_01,*(float *)((int)this + 0x418)); Color::Color(); (**(code **)(*(int *)this_01 + 0x3c))(); Entity::SetParent((Entity *)this_01,(Entity *)EStack_360); (**(code **)(*(int *)this_01 + 0xc))(); EVar6 = aEStack_34c[0]; } EVar6 = (EntityPtr)((int)EVar6 + 1); aEStack_34c[0] = EVar6; EVar12 = (EntityPtr)EntityList::Size(); } while ((uint)EVar6 < (uint)EVar12); } uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&entityQuery); } fVar15 = Math::timescale_factor(0.9,*(float *)((int)this + 0x39c)); fVar17 = *(float *)((int)this + 0x39c); fVar15 = fVar17 * *(float *)((int)this + 0x418) + fVar17 * 0.1 + fVar15 * *(float *)((int)this + 0x414); *(float *)((int)this + 0x414) = fVar15; fVar17 = fVar15 * fVar17 + *(float *)((int)this + 0x410); *(float *)((int)this + 0x410) = fVar17; if (*(int *)((int)this + 0x2c) == 0xf) { FUN_00431290(); FUN_004312b0(); EStack_378 = (EntityPtr)(fVar15 * 2.0); fVar14 = (float10)Sprite::Rotation((Sprite *)((int)this + 0x48)); EStack_378 = (EntityPtr)(float)(fVar14 + (float10)(float)EStack_378); fVar17 = normalize_angle_degrees((float)EStack_378); Sprite::SetRotation((Sprite *)((int)this + 0x48),fVar17); fVar17 = *(float *)((int)this + 0x410); } EStack_368 = (EntityPtr)((int)this + 0x360); if (isSideView != 0) { if (*(float *)((int)this + 0x418) < 0.001) { if (-10.0 < fVar17) { fVar17 = *(float *)((int)this + 0x39c) * 0.5; goto LAB_0065a376; } } else { fVar17 = *(float *)((int)this + 0x418) * *(float *)((int)this + 0x39c); LAB_0065a376: *(float *)((int)this + 0x364) = fVar17 + *(float *)((int)this + 0x364); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = (Vector *)((int)this + 0x33c); Room::GetClampedPositionImpl(room,&VStack_3a8,vecResult,-600.0,-200.0,-200.0,-200.0); bVar2 = Vector::operator_ne(vecResult,&VStack_3a8); if (bVar2 != 0) { vecResult2 = Vector::__sub(&VStack_3a8,&VStack_440,vecResult); EStack_378 = (EntityPtr)Vector::Dot(vecResult2,(Vector *)EStack_368); if ((float)EStack_378 < 0.0) { (**(code **)(*(int *)this + 0x28))(); } } room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar2 = Room::IsBeastDungeon(room); if (((bVar2 != 0) && (iVar5 = Entity::FrameCount((Entity *)this), 2 < iVar5)) && (fVar17 = *(float *)((int)this + 0x364), 0.0 < fVar17)) { Level::GetCurrentRoom((Level *)g_game); Room::get_lava_line_y(); if (fVar17 < *(float *)((int)this + 0x340)) { if ((*(uint *)((int)this + 0x438) & 2) == 0) { (**(code **)(*(int *)this + 0x28))(); EStack_368 = (EntityPtr)0x42; if ((*(int *)((int)this + 0x2c) == 0xe) && (*(int *)((int)this + 0x34) == 0x3b7)) { play_sound_with_fart_seed(0x2bf,1.0,2,0,1.0); EStack_368 = (EntityPtr)0x43; } uVar4 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x10,vecResult,&g_vectorZero,(Entity *)0x0, (uint)EStack_368,uVar4); (**(code **)(*(int *)tmpEntity + 0xc))(); } else { *(byte *)((int)this + 0x173) = 1; } } } } VStack_408.y = *(float *)((int)this + 0x43c); if ((*(uint *)((int)this + 0x438) & 0x1000000) == 0) { if ((*(uint *)((int)this + 0x438) & 0x80000080) == 0x80000080) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); cVar3 = Room::HasSlowDown(room); if (cVar3 != '\0') goto LAB_0065a5c5; } else if ((*(EntityPtr *)((int)this + 0x3bc) == (EntityPtr)0x0) || (bVar2 = Entity::HasEntityFlags((Entity *)*(EntityPtr *)((int)this + 0x3bc),0x20000000), bVar2 == 0)) { Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); bVar2 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x42); if (bVar2 == 0) { Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); bVar2 = TemporaryEffects::HasCollectibleEffect(tempEffects,0xe8); if (bVar2 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar4 = Room::GetBrokenWatchState(room); if (uVar4 != 1) goto LAB_0065a621; } } goto LAB_0065a5c5; } } else { LAB_0065a5c5: otherProjectile = projectile; vfunc = *(code **)(*(int *)this + 0x3c); Color::Color(0x3f800000,0x28,0x28,0x28); FUN_004072e0(); (*vfunc)(); this = otherProjectile; } LAB_0065a621: if (((*(uint *)((int)this + 0x43c) & 2) != 0) && ((((*(int *)((int)this + 0x45c) < 1 || (iVar5 = Entity::GetIntervalTicks((Entity *)this,(float)*(int *)((int)this + 0x45c),0.0), iVar5 != 0)) && (iVar5 = Entity::FrameCount((Entity *)this), 0 < iVar5)) && (Vector::Resize((Vector *)((int)this + 0x360),*(float *)((int)this + 0x458)), (*(uint *)((int)this + 0x454) & 3) != 3)))) { *(uint *)((int)this + 0x43c) = *(uint *)((int)this + 0x43c) & 0xfffffffd; *(undefined4 *)((int)this + 0x438) = *(undefined4 *)((int)this + 0x438); } if ((*(uint *)((int)this + 0x43c) & 0x800) != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); VStack_3a0.x = ((Vector *)((int)this + 0x33c))->x; VStack_3a0.y = *(float *)((int)this + 0x340); iVar5 = Room::GetGridCollisionAtPos(room,*(Vector *)((int)this + 0x33c)); if ((iVar5 == 2) || (iVar5 == 3)) { fVar17 = -50.0; } else { if (iVar5 != 0) goto LAB_0065a73e; fVar17 = -5.0; } if ((fVar17 < *(float *)((int)this + 0x410)) && (2.0 < *(float *)((int)this + 0x414))) { *(float *)((int)this + 0x410) = fVar17; *(float *)((int)this + 0x414) = *(float *)((int)this + 0x414) * -2.0; } } LAB_0065a73e: if ((*(uint *)((int)this + 0x43c) & 0x400) != 0) { pVStack_3d0 = (Vector *)((int)this + 0x33c); VStack_3dc.x = g_vectorZero.x; VStack_3dc.y = g_vectorZero.y; uVar4 = 0; fStack_410 = (float)((uint)(*(float *)((int)this + 0x410) < -50.0) * 2 + 2); EStack_378 = (EntityPtr)((int)this + 0x178); iVar5 = FUN_0042f160(); if (iVar5 != 0) { do { vecResult = (Vector *)std::vector::operator__(); Vector::__add(pVStack_3d0,&scratchVec,vecResult); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pos_00.y = scratchVec.y; pos_00.x = scratchVec.x; Room::GetGridCollisionAtPos(room,pos_00); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pos_01.y = scratchVec.y; pos_01.x = scratchVec.x; iVar5 = Room::GetGridCollisionAtPos(room,pos_01); if ((int)fStack_410 <= iVar5) { vecResult = (Vector *)std::vector::operator__(); Vector::operator_add_assign(&VStack_3dc,vecResult); } uVar4 = uVar4 + 1; uVar9 = FUN_0042f160(); } while (uVar4 < uVar9); this = projectile; } bVar2 = Vector::operator_ne(&VStack_3dc,&g_vectorZero); if (bVar2 != 0) { Vector::Normalize(&VStack_3dc); vecResult = (Vector *)((int)this + 0x360); EStack_378 = (EntityPtr) (-VStack_3dc.x * vecResult->x - VStack_3dc.y * *(float *)((int)this + 0x364)); if ((float)EStack_378 < 0.0) { vecResult2 = Vector::__mul(&VStack_3dc,&VStack_440,(float *)&EStack_378); pVStack_3d0 = (Vector *)0x40000000; vecResult2 = Vector::__mul(vecResult2,&VStack_4bc,(float *)&pVStack_3d0); Vector::operator_add_assign(vecResult,vecResult2); Vector::operator_add_assign((Vector *)((int)this + 0x33c),vecResult); } } } if ((((*(uint *)((int)this + 0x43c) & 1) != 0) && (iVar5 = Entity::FrameCount((Entity *)this), 0 < iVar5)) && ((*(int *)((int)this + 0x45c) < 1 || (iVar5 = Entity::GetIntervalTicks((Entity *)this,(float)*(int *)((int)this + 0x45c),0.0), iVar5 != 0)))) { projFlagsLow = *(undefined4 *)((int)this + 0x438); projFlagsHigh = *(undefined4 *)((int)this + 0x43c); *(undefined4 *)((int)this + 0x438) = *(undefined4 *)((int)this + 0x450); *(undefined4 *)((int)this + 0x43c) = *(undefined4 *)((int)this + 0x454); *(undefined4 *)((int)this + 0x450) = projFlagsLow; *(undefined4 *)((int)this + 0x454) = projFlagsHigh; } update_height_collision(this); iVar5 = Entity::GetHitPointsLost((Entity *)this); if ((0 < iVar5) && (iVar5 = Isaac::Random(3), iVar5 == 0)) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar2 = PlayerManager::AnyoneHasCollectible(playerManager,0x14f); if (bVar2 != 0) { uVar4 = 0; EStack_360 = (EntityPtr)0x4e6e6b28; aEStack_34c[0] = (EntityPtr)0x0; iVar5 = Game::GetNumPlayers(g_game); if (iVar5 != 0) { do { EStack_368 = (EntityPtr)Game::GetPlayer(g_game,uVar4); bVar2 = Entity_Player::HasCollectible((Entity_Player *)EStack_368,0x14f,0); if (bVar2 != 0) { vecResult = Entity::Position((Entity *)EStack_368,&VStack_440); EStack_378 = (EntityPtr)Vector::DistanceSquared(vecResult,(Vector *)((int)this + 0x33c)) ; if ((float)EStack_378 < (float)EStack_360) { aEStack_34c[0] = EStack_368; EStack_360 = EStack_378; } } uVar4 = uVar4 + 1; uVar9 = Game::GetNumPlayers(g_game); EVar6 = aEStack_34c[0]; } while (uVar4 < uVar9); if ((aEStack_34c[0] != (EntityPtr)0x0) && ((float)EStack_360 < 6400.0)) { EStack_378 = (EntityPtr)sqrtf((float)EStack_360); vecResult = Entity::Position((Entity *)EVar6,&VStack_440); vecResult = Vector::__sub((Vector *)((int)this + 0x33c),&VStack_4bc,vecResult); fVar17 = random_float(); vecResult = Vector::Resized(vecResult,&VStack_500, fVar17 * (80.0 - (float)EStack_378) * 0.1 + 0.05); Vector::operator_add_assign((Vector *)((int)this + 0x360),vecResult); } } } } if ((-5.0 < *(float *)((int)this + 0x410)) || ((*(char *)((int)this + 400) != '\0' && (-50.0 <= *(float *)((int)this + 0x410))))) { *(undefined1 *)((int)this + 0x173) = 1; } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar2 = PlayerManager::AnyoneHasCollectible(playerManager,0x202); if (bVar2 != 0) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); fVar17 = PlayerManager::get_total_luck(playerManager); VStack_47c.y = 7.00649e-44; modemChance = 0x43 - (int)fVar17; piVar13 = (int *)std::max(); iVar5 = Isaac::Random(*piVar13); if ((iVar5 == 0) && (*(char *)((int)this + 0x173) == '\0')) { Vector::operator_assign((Vector *)((int)this + 0x460),(Vector *)((int)this + 0x33c)); Entity::AddEntityFlags((Entity *)this,0x20); Vector::operator_assign((Vector *)((int)this + 0x360),&g_vectorZero); } } if ((*(uint *)((int)this + 0x43c) & 0x2000000) != 0) { *(undefined4 *)((int)this + 0x188) = 0; sprite = (Sprite *)((int)this + 0x48); spriteColor = (Font *)Sprite::Color(sprite); Sprite::Color(sprite); fVar14 = (float10)Color::A(); VStack_3cc.y = (float)(fVar14 - (float10)(*(float *)VStack_3cc.y * 0.1)); Font::SetLineHeightModifier(spriteColor,VStack_3cc.y); Sprite::Color(sprite); fVar14 = (float10)Color::A(); this = projectile; VStack_3cc.y = (float)fVar14; if (VStack_3cc.y <= 0.0) { (**(code **)(*(int *)projectile + 0x28))(); } } if ((*(uint *)((int)this + 0x43c) & 0x100) != 0) { fVar17 = Math::lerp(*(float *)((int)this + 0x410),-50.0,0.2,0); *(float *)((int)this + 0x410) = fVar17; *(undefined4 *)((int)this + 0x414) = 0; fVar17 = sinf_wrapper(*(float *)((int)this + 0x3a4) * 0.2); *(float *)((int)this + 0x350) = fVar17 * 2.0 + *(float *)((int)this + 0x410); if (*(int *)((int)this + 0x3bc) == 0) { Entity::Die((Entity *)this); } } LAB_0065acd8: FUN_00862590(); ExceptionList = pvStack_1c; return; } //@@ 0065ad30 reroll_entity_to_free_tile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? no callers; same callee set as 006b5320 Entity_Tear::reroll_hit_entity ShouldEraseEnemy, RemoveWithPoof, ItemPool::GetTrinket/GetCardEx/GetPill) but first searches up to 0x20 Room::GetRandomPosition/FindFreeTilePosition spots >20px from param_1 and >80px from the nearest player */ void reroll_entity_to_free_tile(int param_1) { EntityPtr *pEVar1; code *pcVar2; EntityPtr EVar3; EntityPtr EVar4; longlong lVar5; longlong lVar6; longlong lVar7; Entity *pEVar8; Game *pGVar9; char cVar10; byte bVar11; uint uVar12; uint uVar13; int iVar14; int *piVar15; int unusedArg; void *pvVar16; uint uVar17; PlayerManager *pPVar18; bool bVar19; float fVar20; ulonglong uVar21; uint local_dc; uint local_d8; int *local_d4; Entity *local_d0; float local_cc; uint local_c8; uint local_c4; uint local_c0; uint local_b8; void *pvStack_b4; int local_b0; int local_ac; int local_a8; Vector local_a0; Game *local_98; uint local_8c; EntityPtr *local_88; EntityPtr *local_84; Vector local_80; int iStack_78; int iStack_74; int aiStack_70 [3]; undefined8 local_64; undefined4 local_5c; undefined1 auStack_58 [4]; undefined1 local_54 [8]; int local_4c; RNG RStack_48; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; uint local_c; local_c = __security_cookie ^ (uint)&local_dc; local_b0 = param_1; local_ac = -1; do { local_a0.y = *(float *)(param_1 + 0x340) + 0.0; local_a0.x = (float)local_ac * (float)*(int *)(param_1 + 0x450) * 40.0 + *(float *)(param_1 + 0x33c); uVar12 = Random(); local_80.x = 0.0; fVar20 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10; local_cc = ((float)*(int *)(param_1 + 0x450) * 3.0 - 30.0) + fVar20 + fVar20; local_80.y = local_cc; local_b8 = Random(); local_98 = g_game; local_dc = 0; local_c4 = 0; local_c8 = 9; lua_callback_run_pre_entity_spawn ((int *)&local_c8,(int *)&local_c4,&local_a0,&local_80,(Entity *)0x0,(int *)&local_dc, &local_b8); uVar12 = local_c4; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0065b0b4: local_d8 = local_dc; } else { piVar15 = (g_game->_deathmatchManager)._type; local_d4 = piVar15; uVar13 = Random(); uVar17 = local_dc; local_64 = 0x900000005; local_d0 = (Entity *)&DAT_00000007; local_5c = 7; if (local_c8 != 5) goto LAB_0065b0b4; if (uVar12 < 0x12d) { if (uVar12 == 300) { while ((local_d8 = local_dc, local_dc == 0 || (cVar10 = (**(code **)(*piVar15 + 0x24))(local_dc), cVar10 != '\0'))) { if (uVar13 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar13 = uVar13 >> ((byte)local_64 & 0x1f) ^ uVar13; uVar13 = uVar13 << ((byte)((ulonglong)local_64 >> 0x20) & 0x1f) ^ uVar13; uVar13 = uVar13 >> ((byte)local_d0 & 0x1f) ^ uVar13; iVar14 = ItemPool::GetCardEx(uVar13,0x19,10,10,1); RStack_48._shift1 = 5; RStack_48._shift2 = 9; RStack_48._shift3 = 7; RStack_48._seed = uVar13; local_dc = lua_callback_run_get_card(&RStack_48,iVar14,1,1,0); } } else { if (uVar12 == 0x46) { local_c0 = local_dc >> 0xb; do { local_d8 = local_dc; if (local_dc != 0) { pcVar2 = *(code **)(*piVar15 + 0x28); iVar14 = ItemPool::GetPillEffect(&g_game->_itemPool,local_dc,(Entity_Player *)0x0); cVar10 = (*pcVar2)(iVar14); if (cVar10 == '\0') goto LAB_0065b0bc; piVar15 = local_d4; } if (uVar13 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar13 = uVar13 >> ((byte)local_64 & 0x1f) ^ uVar13; uVar13 = uVar13 << ((byte)((ulonglong)local_64 >> 0x20) & 0x1f) ^ uVar13; uVar13 = uVar13 >> ((byte)local_d0 & 0x1f) ^ uVar13; local_dc = ItemPool::GetPill(uVar13); local_dc = local_dc | (local_c0 & 1) << 0xb; } while( true ); } if (uVar12 != 100) goto LAB_0065b0b4; local_d8 = local_dc; if (local_dc == 0x19) { LAB_0065af04: bVar19 = false; } else { local_8c = local_dc; std::set::find_node(local_54,&local_8c); if (((*(char *)(local_4c + 0xd) == '\0') && (*(int *)(local_4c + 0x10) <= (int)uVar17)) && (local_4c != piVar15[8])) goto LAB_0065af04; bVar19 = true; } if ((uVar17 == 0) || (bVar19)) { local_dc = (**(code **)(*piVar15 + 0x84))(0); local_d8 = local_dc; } } } else { if (uVar12 != 0x15e) goto LAB_0065b0b4; while ((local_d8 = local_dc, local_dc == 0 || (cVar10 = (**(code **)(*piVar15 + 0x2c))(local_dc), cVar10 != '\0'))) { local_dc = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0065b0bc: local_d0 = EntityFactory::Create(local_98->_entityFactory,local_c8,0); if (local_d0 != (Entity *)0x0) { uVar21 = GetTimeNs(); pEVar8 = local_d0; uVar17 = (uint)(uVar21 >> 0x20); lVar5 = (uVar21 & 0xffffffff) * 0x431bde82; local_a8 = (int)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar17 * 0xd7b634db + ((uVar21 & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)((ulonglong)lVar6 >> 0x20); uVar12 = local_a8 + (uint)CARRY4((uint)lVar5,(uint)lVar6); lVar5 = (ulonglong)uVar17 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar12),uVar13 + uVar12); local_c0 = (uint)((ulonglong)lVar5 >> 0x20); pEVar1 = &local_d0->_spawnerEntity; local_d4 = (int *)((uint)lVar5 >> 0x12 | local_c0 * 0x4000); local_c0 = local_c0 >> 0x12; local_d0->_spawnerType = 0; local_d0->_spawnerVariant = 0; if (*pEVar1 != (EntityPtr)0x0) { local_88 = pEVar1; std::multiset::erase(&local_88); } iVar14 = *(int *)pEVar8; *pEVar1 = (EntityPtr)0x0; (pEVar8->_pos).x = local_a0.x; (pEVar8->_pos).y = local_a0.y; (pEVar8->_velocity).x = 0.0; (pEVar8->_velocity).y = local_cc; (**(code **)(iVar14 + 4))(local_c8,local_c4,local_d8,local_b8); pGVar9 = local_98; pvVar16 = local_98->_room; iVar14 = *(int *)((int)pvVar16 + 0x1214); *(int *)((int)pvVar16 + 0x1214) = iVar14 + 1; pEVar8->_index = iVar14; EntityList::AddEntity((EntityList *)((int)pvVar16 + 0x1218),pEVar8); bVar11 = Game::ShouldEraseEnemy(pEVar8); if (bVar11 != 0) { Entity::RemoveWithPoof(pEVar8,unusedArg); } if ((pEVar8->_exists != 0) && ((pGVar9->_proceduralItemManager)._proceduralItems._begin != (pGVar9->_proceduralItemManager)._proceduralItems._end)) { iStack_74 = pEVar8->_variant; iVar14 = pEVar8->_type; iStack_78 = iVar14; std::map::find(&pvStack_b4,&iStack_78); if (pvStack_b4 == (pGVar9->_proceduralItemManager)._spawnTriggerTargets._head) { aiStack_70[1] = 0xffffffff; aiStack_70[0] = iVar14; piVar15 = (int *)std::map::find(auStack_58,aiStack_70); pvStack_b4 = (void *)*piVar15; if (pvStack_b4 == (pGVar9->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_0065b313; } uVar12 = 0; pPVar18 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar18->_playerList)._begin >> 2 != 0) { do { pvVar16 = (pPVar18->_playerList)._end; if ((int)pvVar16 - (int)(pPVar18->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar16 = (pPVar18->_playerList)._end; } piVar15 = (pPVar18->_playerList)._begin; if (uVar12 < (uint)((int)pvVar16 - (int)piVar15 >> 2)) { piVar15 = piVar15 + uVar12; } trigger_set_dispatch((void *)(*piVar15 + 0x1fc8),6,pEVar8,&local_a0,&local_80); uVar12 = uVar12 + 1; pPVar18 = &g_game->_playerManager; } while (uVar12 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar18->_playerList)._begin >> 2)); } } LAB_0065b313: uVar21 = GetTimeNs(); uVar12 = (uint)(uVar21 >> 0x20); lVar5 = (uVar21 & 0xffffffff) * 0x431bde82; local_a8 = (int)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar12 * 0x431bde82; local_cc = (float)lVar6; lVar7 = (ulonglong)uVar12 * 0xd7b634db + ((uVar21 & 0xffffffff) * 0xd7b634db >> 0x20); local_98 = (Game *)(lVar7 + lVar5); lVar6 = lVar6 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar7 >> 0x20), local_a8 + (uint)CARRY4((uint)lVar5,(uint)lVar7)), (int)((ulonglong)(lVar7 + lVar5) >> 0x20)); uVar17 = (uint)((ulonglong)lVar6 >> 0x20); piVar15 = (int *)((uint)lVar6 >> 0x12 | uVar17 * 0x4000); uVar12 = (int)piVar15 - (int)local_d4; bVar19 = CARRY4((uint)g_entitySpawnTimeMs,uVar12); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar12; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar17 >> 0x12) - local_c0) - (uint)(piVar15 < local_d4)) + (uint)bVar19; } pEVar8 = local_d0; pEVar1 = &local_d0->_spawnerEntity; EVar3 = *pEVar1; local_d0[1]._pendingDamage = 1.5; EVar4 = *(EntityPtr *)(local_b0 + 0x3c8); if (EVar3 != (EntityPtr)0x0) { local_84 = pEVar1; std::multiset::erase(&local_84); } *pEVar1 = EVar4; if (EVar4 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } param_1 = local_b0; pEVar8->_spawnerType = *(int *)(local_b0 + 0x34); pEVar8->_spawnerVariant = *(int *)(local_b0 + 0x38); uStack_38 = 0x40000000; uStack_34 = 0x40000000; uStack_30 = 0x40000000; uStack_2c = 0x3f800000; uStack_18 = 0x3ecccccd; uStack_14 = 0x3df5c28f; uStack_10 = 0xbe99999a; uStack_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; (**(code **)(*(int *)pEVar8 + 0x3c))(&uStack_38,0xffffffff,0xff,0,1); iVar14 = *(int *)pEVar8; pEVar8[1]._damageEvents._begin = (void *)0x0; pEVar8[1]._damageEvents._end = (void *)0x3f800000; (**(code **)(iVar14 + 0xc))(); local_ac = local_ac + 2; if (1 < local_ac) { *(int *)(param_1 + 0x450) = *(int *)(param_1 + 0x450) + 1; return; } } while( true ); } //@@ 0065b490 TearParams::copy /* DB: ? 0x64-byte struct copy; Tear/Projectile Update */ void TearParams::copy(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[1] = param_1[1]; uVar1 = param_1[3]; uVar2 = param_1[4]; uVar3 = param_1[5]; in_ECX[2] = param_1[2]; in_ECX[3] = uVar1; in_ECX[4] = uVar2; in_ECX[5] = uVar3; uVar1 = param_1[7]; uVar2 = param_1[8]; uVar3 = param_1[9]; in_ECX[6] = param_1[6]; in_ECX[7] = uVar1; in_ECX[8] = uVar2; in_ECX[9] = uVar3; *(undefined8 *)(in_ECX + 10) = *(undefined8 *)(param_1 + 10); in_ECX[0xc] = param_1[0xc]; uVar1 = param_1[0xf]; uVar2 = param_1[0x10]; uVar3 = param_1[0x11]; in_ECX[0xe] = param_1[0xe]; in_ECX[0xf] = uVar1; in_ECX[0x10] = uVar2; in_ECX[0x11] = uVar3; in_ECX[0x12] = param_1[0x12]; in_ECX[0x13] = param_1[0x13]; in_ECX[0x14] = param_1[0x14]; in_ECX[0x15] = param_1[0x15]; in_ECX[0x16] = param_1[0x16]; in_ECX[0x17] = param_1[0x17]; in_ECX[0x18] = param_1[0x18]; return; } //@@ 0065b500 Entity_Projectile::update_height_collision /* DB: ECX=projectile: from height (+0x410) sets sprite offset Y (+0x350), _entityCollisionClass (+0x188) and _entityGridCollisionClass (+0x184) by ProjectileFlags (+0x438/+0x43c); fixed height -5.1 in room type 16 (crawlspace); called twice from Entity_Projectile::Update */ void __thiscall Entity_Projectile::update_height_collision(Entity_Projectile *this) { float fVar1; int *piVar2; Game *pGVar3; int iVar4; float fVar5; pGVar3 = g_game; fVar1 = this->_height; if (*(int *)((int)g_game->_room + 8) == 0x10) { (this->_posOffset).y = -15.0; if (-5.1 < fVar1) { this->_height = -5.1; } this->_entityCollisionClass = 4; if (((this->_projectileFlags & 0x40003810) == 0 && (this->_projectileFlags & 0x40000000000) == 0 ) || ((this->_projectileFlags & 2) != 0)) { iVar4 = 4; } else { iVar4 = 0; } this->_entityGridCollisionClass = iVar4; piVar2 = *(int **)(*(int *)((int)pGVar3->_room + 4) + 0x10); if (((piVar2 != (int *)0x0) && (piVar2[2] == 0x10)) && (*piVar2 == 0x23)) { this->_entityGridCollisionClass = 0; } } else { if (0.0 < this->_fallingAccel || this->_fallingAccel == 0.0) { fVar5 = fVar1; } else { fVar5 = fVar1 + 8.5; if (fVar5 <= 0.0) { fVar5 = 0.0; } fVar5 = (fVar1 * 0.5 - 15.0) + fVar5 * fVar5; } (this->_posOffset).y = fVar5; if (-50.0 <= fVar1) { this->_entityCollisionClass = 4; if ((this->_projectileFlags & 0x40003810) == 0 && (this->_projectileFlags & 0x40000000000) == 0) { this->_entityGridCollisionClass = 4; } else { this->_entityGridCollisionClass = 0; } } else if ((this->_projectileFlags & 0x20000) == 0) { this->_entityCollisionClass = 0; } } if ((this->_flags & 0x20) != 0) { this->_entityCollisionClass = 0; } return; } //@@ 0065b670 Entity_Projectile::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [vtable slot 23] prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Projectile::HandleCollision(Entity_Projectile *this,Entity *collider,byte low) { EntityPtr EVar1; byte bVar2; char isDamaged; int iVar3; EntityRef *sourceRef; uint uVar4; Entity_Player *player; Vector *toProjectileDir; uint uVar5; uint uVar6; float fVar7; float fVar8; Game *game; bool isLava; float fVar9; undefined3 in_stack_00000009; Vector VStack_64; code *pcStack_58; Entity_Projectile *pEStack_54; Vector VStack_50; Entity_Player *local_48; EntityRef EStack_44; undefined4 uStack_1c; uint stackCookie; bool isInfamyBlocked; Manager *manager; float *posOffsetY; qword projFlags; stackCookie = __security_cookie ^ (uint)&VStack_64; local_48 = (Entity_Player *)this; iVar3 = LuaEngine::PreProjectileCollision((LuaEngine *)this,this,collider,_low); if (iVar3 == 1) { return 1; } if (iVar3 == -1) { return 0; } isLava = this->_variant == 0xe; if (low != 0) { iVar3 = collider->_type; if ((iVar3 == 0x393) && (collider->_variant == 1)) { this->_dead = 1; fVar8 = collider->_friction; fVar7 = (this->_velocity).y; if (fVar8 == 0.0) { return isLava; } fVar9 = collider->_speedMultiplier; (collider->_velocity).x = ((this->_velocity).x * 0.2 * fVar9) / fVar8 + (collider->_velocity).x; (collider->_velocity).y = (fVar7 * 0.2 * fVar9) / fVar8 + (collider->_velocity).y; return isLava; } bVar2 = Entity::IsEnemy(collider); if ((bVar2 != 0) && (bVar2 = Entity::HasEntityFlags(collider,0x2000000000000), bVar2 != 0)) { sourceRef = EntityRef::EntityRef(&EStack_44); bVar2 = 0; (**(code **)(*(int *)collider + 0x20))(0x3f800000,0,0,sourceRef,0x1e); this->_dead = 1; return bVar2; } if (iVar3 == 0xf5) { EStack_44._position.x = (this->_pos).x; EStack_44._position.y = (this->_pos).y; pEStack_54 = *(Entity_Projectile **)(*(int *)collider + 0x20); EStack_44._type = this->_type; EStack_44._variant = this->_variant; EStack_44._spawnerType = this->_spawnerType; EStack_44._spawnerVariant = this->_spawnerVariant; EStack_44._velocity.x = (this->_velocity).x; EStack_44._velocity.y = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } EStack_44._flags = uVar4 | uVar6 | (uint)((this->_flags & 0x100) != 0); bVar2 = 0; EStack_44._entity = this; (*(code *)pEStack_54)(0x3f800000,0x40,0,&EStack_44,0x1e); this->_dead = 1; return bVar2; } } if (this->_spawnerType == 0x362) { if (collider->_type == 3) { return 1; } if (((collider->_type == 1) && (this->_spawnerEntity != (EntityPtr)0x0)) && (*(Entity **)((int)this->_spawnerEntity + 0x3c8) != collider)) { return 1; } } if (low == 0) { if (collider->_type == 1) { if ((this->_projectileFlags & 0x80000000) != 0) { EVar1 = this->_spawnerEntity; if (EVar1 == (EntityPtr)0x0) { return 1; } bVar2 = Entity::HasEntityFlags((Entity *)EVar1,0x20000100); if (bVar2 == 0) { return 1; } EStack_44._variant = collider->_variant; EStack_44._position.x = (collider->_pos).x; EStack_44._position.y = (collider->_pos).y; EStack_44._spawnerType = collider->_spawnerType; EStack_44._spawnerVariant = collider->_spawnerVariant; EStack_44._velocity.x = (collider->_velocity).x; EStack_44._velocity.y = (collider->_velocity).y; EStack_44._type = 1; if ((collider->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((collider->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } EStack_44._entity = collider; EStack_44._flags = uVar4 | uVar6 | (uint)((collider->_flags & 0x100) != 0); bVar2 = Entity::IsDamageSourceFriendly((Entity *)EVar1,&EStack_44); if (bVar2 != 0) { return 1; } } if ((1 < *(int *)&g_game->_deathmatchManager) && (bVar2 = Entity::IsDescendantOf((Entity *)this,collider), bVar2 != 0)) { return 1; } player = (Entity_Player *) __RTDynamicCast(collider,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); if (player->_isCoopGhost != 0) { return 1; } fVar8 = (player->_sprite)._scale.y; if (fVar8 <= 0.5) { fVar8 = 0.5; } if (1.0 <= fVar8) { fVar8 = 1.0; } posOffsetY = &(this->_posOffset).y; if (*posOffsetY <= fVar8 * -50.0 && fVar8 * -50.0 != *posOffsetY) { return 1; } this->_dead = 1; isDamaged = '\0'; VStack_64.x = 0.0; VStack_64.y = 0.0; if ((this->_projectileFlags & 0x8000) == 0) { pcStack_58 = (code *)0x0; } else { pcStack_58 = (code *)0x2; } local_48 = player; if ((this->_projectileFlags & 2) != 0) goto LAB_0065bd53; bVar2 = Entity_Player::HasCollectible(player,0x5b,0); if ((bVar2 == 0) && (bVar2 = Entity_Player::HasCollectible(player,0x177,0), bVar2 == 0)) { game = g_game; } else { game = g_game; if (*(int *)((int)g_game->_room + 8) == 0x10) { VStack_64.y = (this->_pos).y - (player->_pos).y; VStack_64.x = (this->_pos).x - (player->_pos).x; toProjectileDir = Vector::Normalized(&VStack_64,&VStack_50); if (toProjectileDir->x <= 0.8 && toProjectileDir->x != 0.8) goto LAB_0065bd53; } else if ((0.0 < this->_fallingAccel) && (this->_height - this->_fallingSpeed * this->_speedMultiplier < -50.0)) goto LAB_0065bd53; } iVar3 = *(int *)&game->_deathmatchManager; bVar2 = Entity_Player::HasCollectible(player,0xf2,0); if ((bVar2 == 0) || (iVar3 = Isaac::Random((uint)(1 < iVar3) * 2 + 2), manager = g_manager, iVar3 != 0)) { EStack_44._position.x = (this->_pos).x; EStack_44._position.y = (this->_pos).y; VStack_50.x = *(float *)(*(int *)player + 0x20); EStack_44._type = this->_type; EStack_44._variant = this->_variant; EStack_44._spawnerType = this->_spawnerType; EStack_44._spawnerVariant = this->_spawnerVariant; EStack_44._velocity.x = (this->_velocity).x; EStack_44._velocity.y = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } EStack_44._flags = uVar4 | uVar6 | (uint)((this->_flags & 0x100) != 0); EStack_44._entity = this; isDamaged = (*(code *)VStack_50.x)(this->_collisionDamage,pcStack_58,0,&EStack_44,0x1e); } else { seed_fart_sound_override((int *)((int)register0x00000010 + -0x68)); SoundEffects::Play(&manager->_sfxManager,0x35f,1.0,2,0,1.0,0.0); EStack_44._flags = 0x3e808081; EStack_44._position.x = 0.0; EStack_44._position.y = 0.0; EStack_44._velocity.x = 0.0; EStack_44._velocity.y = 0.0; EStack_44._type = 0x3f800000; EStack_44._variant = 0x3f800000; EStack_44._spawnerType = 0x3f800000; EStack_44._spawnerVariant = 0x3f800000; EStack_44._entity = (Entity_Projectile *)0x3e808081; uStack_1c = 0x3f008081; (**(code **)(*(int *)player + 0x3c))(&EStack_44,0xf,0xff,1,1); } LAB_0065bd53: fVar8 = *(float *)&this->_projectileFlags; uVar6 = *(uint *)((int)&this->_projectileFlags + 4); VStack_64.x = fVar8; if (((((uint)fVar8 & 0x200) != 0) && (isDamaged != '\0')) && (0 < player->_numCoins)) { Entity_Player::AddCoins(player,-1); uVar6 = Random(); fVar7 = (float)(uVar6 % 3 + 1); fVar8 = (float)player->_numCoins; if ((int)fVar7 < player->_numCoins) { fVar8 = fVar7; } VStack_64.x = fVar8; if (0 < (int)fVar8) { do { uVar6 = Random(); uVar4 = Random(); fVar7 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; pcStack_58 = (code *)(fVar7 + fVar7); uVar4 = Random(); fVar7 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 2.0; fVar9 = cos((float)pcStack_58); VStack_50.x = fVar9 * fVar7; VStack_50.y = sin((float)pcStack_58); VStack_50.y = VStack_50.y * fVar7; Game::SpawnEx(g_game,5,0x14,&this->_pos,&VStack_50,(Entity *)0x0,1,uVar6,0); fVar8 = (float)((int)fVar8 - 1); } while (fVar8 != 0.0); player = local_48; this = pEStack_54; } Entity_Player::AddCoins(player,-(int)VStack_64.x); uVar6 = *(uint *)((int)&this->_projectileFlags + 4); } if ((uVar6 & 0x80000) != 0) { player->_controlsCooldown = 0x1e; EStack_44._position.x = 0.0; EStack_44._position.y = 0.0; EStack_44._velocity.x = 0.0; EStack_44._velocity.y = 0.0; EStack_44._type = 0x3f19999a; EStack_44._variant = 0x3f19999a; EStack_44._spawnerType = 0x3f19999a; EStack_44._spawnerVariant = 0x3f800000; EStack_44._flags = 0x3ecccccd; EStack_44._entity = (void *)0x3ecccccd; uStack_1c = 0x3ecccccd; (**(code **)(*(int *)player + 0x3c))(&EStack_44,0x1e,0xffffffff,1,1); } if (this->_dead == 0) { return 1; } return isLava; } } else { bVar2 = Entity::IsVulnerableEnemy(collider,(Entity *)0x0); if ((bVar2 != 0) || (collider->_type == 0x362)) { if (this->_parent == (EntityPtr)0x0) { LAB_0065c185: projFlags = this->_projectileFlags; VStack_64.y = *(float *)((int)&this->_projectileFlags + 4); if ((projFlags & 0x80000000) != 0) { bVar2 = Entity::HasEntityFlags(collider,0x20000000); if (bVar2 != 0) { return 1; } if (collider->_type == 0x362) { return 1; } } if ((((projFlags & 0x80) == 0) && (bVar2 = Entity::HasEntityFlags(collider,0x10000020000000), bVar2 == 0)) && (collider->_type != 0x362)) { return 1; } EVar1 = this->_parent; if (EVar1 != (EntityPtr)0x0) { iVar3 = *(int *)((int)EVar1 + 0x28); if (iVar3 == 0x390) { if (((*(int *)((int)EVar1 + 0x2c) == 10) && (collider->_type == 0x390)) && (collider->_variant == 10)) { this->_dead = 1; return isLava; } } else if ((iVar3 == 0x112) || (iVar3 == 0x113)) { if (collider->_type == 0x112) { return isLava; } if (collider->_type == 0x113) { return isLava; } } } this->_dead = 1; if ((projFlags & 2) != 0) { return isLava; } EStack_44._variant = this->_variant; pcStack_58 = *(code **)(*(int *)collider + 0x20); uVar6 = (uint)this->_flags; if (EStack_44._variant == 8) { EStack_44._type = this->_type; EStack_44._position.x = (this->_pos).x; EStack_44._position.y = (this->_pos).y; EStack_44._spawnerType = this->_spawnerType; EStack_44._velocity.x = (this->_velocity).x; EStack_44._velocity.y = (this->_velocity).y; EStack_44._spawnerVariant = this->_spawnerVariant; EStack_44._variant = 8; if ((uVar6 & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } EStack_44._flags = uVar5 | uVar4 | (uint)((uVar6 & 0x100) != 0); fVar8 = 35.0; } else { EStack_44._type = this->_type; EStack_44._position.x = (pEStack_54->_pos).x; EStack_44._position.y = (pEStack_54->_pos).y; EStack_44._spawnerType = pEStack_54->_spawnerType; EStack_44._velocity.x = (pEStack_54->_velocity).x; EStack_44._velocity.y = (pEStack_54->_velocity).y; EStack_44._spawnerVariant = pEStack_54->_spawnerVariant; if ((uVar6 & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } fVar8 = pEStack_54->_collisionDamage + 5.0; EStack_44._flags = uVar5 | uVar4 | (uint)((uVar6 & 0x100) != 0); this = pEStack_54; } EStack_44._entity = this; (*pcStack_58)(fVar8,0,0,&EStack_44,0x1e); if ((this->_projectileFlags & 0x8000000000000) == 0) { return isLava; } EStack_44._type = this->_type; EStack_44._position.x = (this->_pos).x; EStack_44._position.y = (this->_pos).y; EStack_44._variant = this->_variant; EStack_44._spawnerType = this->_spawnerType; EStack_44._spawnerVariant = this->_spawnerVariant; EStack_44._velocity.x = (this->_velocity).x; EStack_44._velocity.y = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } EStack_44._flags = uVar4 | uVar6 | (uint)((this->_flags & 0x100) != 0); EStack_44._entity = this; Entity::AddFreeze(collider,&EStack_44,0x5a,0); return isLava; } uVar6 = Entity::GetHitListIndex((Entity *)this->_parent); uVar4 = Entity::GetHitListIndex(collider); if (uVar6 != uVar4) goto LAB_0065c185; if (*(int *)((int)this->_parent + 0x28) != 0x390) { return isLava; } if (*(int *)((int)this->_parent + 0x2c) != 10) { return isLava; } if (5 < g_game->_frameCount - this->_spawnFrame) goto LAB_0065c185; } } game = g_game; if (low != 0) { return isLava; } if (collider->_type != 3) { return isLava; } iVar3 = collider->_variant; if ((iVar3 != 0x3e) && (iVar3 != 0x43)) { if (iVar3 == 0xce) { if (collider->_subtype == 0x2be) { return isLava; } } else if (((iVar3 != 0xed) && (iVar3 != 0xd3)) && (iVar3 != 100)) { return isLava; } } if ((this->_projectileFlags & 0x80000000) != 0) { return 1; } this->_dead = 1; VStack_64.x = (float)((uint)(1 < *(int *)&game->_deathmatchManager) * 2 + 2); if (((collider->_variant == 0x3e) || (collider->_variant == 0x43)) && (bVar2 = Entity_Player::HasCollectible(*(Entity_Player **)&collider[1].field_0x4,0xf2,0), bVar2 != 0)) { iVar3 = Isaac::Random((int)VStack_64.x); if (iVar3 == 0) { isInfamyBlocked = true; goto LAB_0065c079; } } isInfamyBlocked = false; LAB_0065c079: if (((this->_projectileFlags & 2) != 0) || (isInfamyBlocked)) { return isLava; } EStack_44._position.x = (this->_pos).x; EStack_44._position.y = (this->_pos).y; VStack_64.x = (float)*(code **)(*(int *)collider + 0x20); EStack_44._type = this->_type; EStack_44._variant = this->_variant; EStack_44._spawnerType = this->_spawnerType; EStack_44._spawnerVariant = this->_spawnerVariant; EStack_44._velocity.x = (this->_velocity).x; EStack_44._velocity.y = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar6 = 0; } else { uVar6 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } EStack_44._flags = uVar4 | uVar6 | (uint)((this->_flags & 0x100) != 0); bVar2 = 0; EStack_44._entity = this; (**(code **)(*(int *)collider + 0x20))(this->_collisionDamage,0,0,&EStack_44,0x1e); return bVar2; } //@@ 0065c510 Entity_Projectile::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_Projectile::Interpolate(Entity_Projectile *this) { uint flagsLo; float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float perpY; float perpX; float distAlongSpawner; code *interpolateCallback; uint projectileFlagsHi; EntityPtr spawner; flagsLo = (uint)this->_flags; if ((flagsLo & 2) != 0) { *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = flagsLo & 0xfffffffd; return; } (this->_preInterpolatePos).x = (this->_pos).x; (this->_preInterpolatePos).y = (this->_pos).y; fVar1 = this->_friction; fVar2 = this->_speedMultiplier; (this->_pos).x = fVar1 * (this->_velocity).x * fVar2 * 0.5 + (this->_pos).x; (this->_pos).y = fVar1 * (this->_velocity).y * fVar2 * 0.5 + (this->_pos).y; interpolateCallback = this[1]._damageEvents._capacity; if (interpolateCallback != (code *)0x0) { (*interpolateCallback)(this,1); } flagsLo = (uint)this->_projectileFlags; projectileFlagsHi = *(uint *)((int)&this->_projectileFlags + 4); if ((flagsLo & 0x200000) != 0) { fVar1 = this->_updateTime * 3.1415927; fVar2 = sin((fVar1 + fVar1) / 30.0); fVar1 = (this->_velocity).y; (this->_pos).x = fVar2 * (this->_velocity).x * 0.5 + (this->_pos).x; (this->_pos).y = fVar1 * fVar2 * 0.5 + (this->_pos).y; flagsLo = (uint)this->_projectileFlags; projectileFlagsHi = *(uint *)((int)&this->_projectileFlags + 4); } if ((flagsLo & 0x20) != 0) { perpX = (this->_velocity).y; perpY = -(this->_velocity).x; fVar1 = sqrtf(perpY * perpY + perpX * perpX); if (0.0 < fVar1) { perpX = (1.0 / fVar1) * perpX; perpY = perpY * (1.0 / fVar1); } fVar1 = 1.0; if (this->_spawnerType == 0x390) { fVar1 = 2.0; } fVar1 = ((float)this->_wiggleFrameOffset + this->_updateTime) * fVar1 * 3.1415927; fVar1 = cos((fVar1 + fVar1) / 30.0); (this->_pos).x = perpX * fVar1 * 3.0 * 0.5 + (this->_pos).x; (this->_pos).y = perpY * fVar1 * 3.0 * 0.5 + (this->_pos).y; flagsLo = (uint)this->_projectileFlags; projectileFlagsHi = *(uint *)((int)&this->_projectileFlags + 4); } if ((flagsLo & 0x400000) != 0) { perpX = (this->_velocity).y; perpY = -(this->_velocity).x; fVar1 = sqrtf(perpY * perpY + perpX * perpX); if (0.0 < fVar1) { perpX = perpX * (1.0 / fVar1); perpY = perpY * (1.0 / fVar1); } fVar2 = (float)this->_wiggleFrameOffset + this->_updateTime; fVar1 = fVar2 * 3.1415927; fVar3 = cos((fVar1 + fVar1) / 30.0); fVar2 = fVar2 * 0.04; fVar1 = 4.0; if (fVar2 <= 4.0) { fVar1 = fVar2; } fVar3 = fVar3 * (fVar1 + 3.0); (this->_pos).x = perpX * fVar3 * 0.5 + (this->_pos).x; (this->_pos).y = perpY * fVar3 * 0.5 + (this->_pos).y; projectileFlagsHi = *(uint *)((int)&this->_projectileFlags + 4); } if (((projectileFlagsHi & 0x200) != 0) && (spawner = this->_spawnerEntity, spawner != (EntityPtr)0x0)) { fVar1 = *(float *)((int)spawner + 0x334); if ((fVar1 != g_vectorZero.x) || (*(float *)((int)spawner + 0x338) != g_vectorZero.y)) { fVar2 = *(float *)((int)spawner + 0x338); fVar3 = sqrtf(fVar2 * fVar2 + fVar1 * fVar1); fVar1 = fVar1 / fVar3; fVar5 = (this->_pos).x - *(float *)((int)spawner + 0x33c); fVar2 = fVar2 / fVar3; fVar4 = (this->_pos).y - *(float *)((int)spawner + 0x340); distAlongSpawner = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if (fVar4 * fVar2 + fVar5 * fVar1 < 0.0) { distAlongSpawner = distAlongSpawner * -1.0; } fVar4 = (this->_velocity).y; fVar5 = (this->_velocity).x; fVar4 = sqrtf(fVar5 * fVar5 + fVar4 * fVar4); if ((0.0 <= distAlongSpawner) && (distAlongSpawner <= fVar3)) { fVar3 = *(float *)((int)spawner + 0x33c); (this->_pos).y = fVar2 * distAlongSpawner + *(float *)((int)spawner + 0x340); (this->_pos).x = fVar1 * distAlongSpawner + fVar3; (this->_velocity).x = fVar4 * fVar1; (this->_velocity).y = fVar4 * fVar2; } } } this->_isInterpolating = 1; Entity::CollideWithGrid((Entity *)this,1); if (*(int *)((int)g_game->_room + 8) == 0x10) { (this->_posOffset).y = -15.0; return; } if ((this->_projectileFlags & 0x400000000) == 0) { fVar1 = this->_fallingSpeed * this->_speedMultiplier * 0.5; } else { fVar1 = (-23.0 - this->_height) * 0.2; } fVar1 = fVar1 + this->_height; if (this->_fallingAccel <= 0.0 && this->_fallingAccel != 0.0) { fVar2 = fVar1 + 8.5; if (fVar2 <= 0.0) { fVar2 = 0.0; } fVar1 = (fVar1 * 0.5 - 15.0) + fVar2 * fVar2; } if ((this->_projectileFlags & 0x10000000000) != 0) { fVar1 = sin((this->_speedMultiplier * 0.5 + this->_updateTime) * 0.2); fVar1 = fVar1 + fVar1 + this->_height; } (this->_posOffset).y = fVar1; return; } //@@ 0065cb60 Entity_Projectile::Render /* ZHL [exact] __thiscall void Entity_Projectile::Render(Vector *offset); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Projectile::Render(Entity_Projectile *this,Vector *offset) { float fVar1; code *pcVar2; byte bVar3; uint uVar4; uint uVar5; double dVar6; Vector local_20; Vector local_18; float local_10; float local_c; undefined4 local_8; if (this->_isRenderedAtGround != 0) { (this->_posOffset).y = (this->_posOffset).y - this->_height; } local_8 = 0xc; local_20.y = (float)((g_game->_frameCount / 0x1e) * 100 + 1); if (((this->_flags & 0x20) == 0) || ((*(float *)(this + 1) == g_vectorZero.x && (*(float *)&this[1].field_0x4 == g_vectorZero.y)))) { Entity::Render((Entity *)this,offset); } else { local_c = g_displayPixelRatio * g_screenPointScale; local_10 = (((*(float *)(this + 1) + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_c + 0.5; dVar6 = floor((double)local_10); local_18.y = (float)dVar6 / local_c; local_10 = (((*(float *)&this[1].field_0x4 + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_c + 0.5; dVar6 = floor((double)local_10); local_10 = (float)dVar6; uVar4 = (uint)local_20.y >> 5 ^ (uint)local_20.y; uVar4 = uVar4 << 0x15 ^ uVar4; local_20.y = (float)(uVar4 >> 0xc ^ uVar4); fVar1 = offset->x; (this->_renderPosition).y = local_10 / local_c + offset->y; (this->_renderPosition).x = local_18.y + fVar1; if (local_20.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = (uint)local_20.y >> 5 ^ (uint)local_20.y; local_18.y = (float)((double)(int)local_20.y + __uint_to_double_fixup[-((int)local_20.y >> 0x1f)]) * 2.3283062e-10 * 16.0; uVar4 = uVar4 << 0x15 ^ uVar4; bVar3 = (byte)local_8; uVar4 = uVar4 >> (bVar3 & 0x1f) ^ uVar4; local_18.x = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 16.0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> 5 ^ uVar4; uVar4 = uVar4 << 0x15 ^ uVar4; uVar4 = uVar4 >> (bVar3 & 0x1f) ^ uVar4; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar4 >> 5 ^ uVar4; local_20.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 16.0; uVar5 = uVar5 << 0x15 ^ uVar5; uVar5 = uVar5 >> (bVar3 & 0x1f) ^ uVar5; local_20.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10 * 16.0; ANM2::Render(&this->_sprite,&this->_renderPosition,&local_18,&local_20); } if (this->_isRenderedAtGround != 0) { (this->_posOffset).y = this->_height + (this->_posOffset).y; } FUN_00862670(this,offset); return; } //@@ 0065cef0 Room::IsFirstVisit /* ZHL [lua] Lua binding Room:IsFirstVisit */ undefined1 Room::IsFirstVisit(void) { int in_ECX; return *(undefined1 *)(in_ECX + 1); } //@@ 0065cf00 Level::AddAngelRoomChance /* ZHL [lua] Lua binding Level:AddAngelRoomChance */ void __thiscall Level::AddAngelRoomChance(Level *this,float param_2) { this->_angelRoomChance = param_2 + this->_angelRoomChance; return; } //@@ 0065cf20 Entity_Player::GetBrokenHearts /* ZHL [lua] Lua binding EntityPlayer:GetBrokenHearts */ int __thiscall Entity_Player::GetBrokenHearts(Entity_Player *this) { return this->_brokenHearts; } //@@ 0065cf30 Entity_Player::GetNumBombs /* ZHL [lua] Lua binding EntityPlayer:GetNumBombs */ int __thiscall Entity_Player::GetNumBombs(Entity_Player *this) { return this->_numBombs; } //@@ 0065cf40 Entity_Player::HasGoldenKey /* ZHL [lua] Lua binding EntityPlayer:HasGoldenKey */ byte __thiscall Entity_Player::HasGoldenKey(Entity_Player *this) { return this->_hasGoldenKey; } //@@ 0065cf50 Entity_Player::HasGoldenBomb /* ZHL [lua] Lua binding EntityPlayer:HasGoldenBomb */ byte __thiscall Entity_Player::HasGoldenBomb(Entity_Player *this) { return this->_hasGoldenBomb; } //@@ 0065cf60 Entity_Player::IsP2Appearing /* ZHL [lua] Lua binding EntityPlayer:IsP2Appearing */ undefined1 __thiscall Entity_Player::IsP2Appearing(Entity_Player *this) { if ((this->_variant == 1) && (0 < this->_damageCooldown)) { return 1; } return 0; } //@@ 0065cf80 Entity_Player::GetTrinketRNG /* ZHL [lua] Lua binding EntityPlayer:GetTrinketRNG prototype: REPENTOGON, confirmed by RET 4 */ RNG * __thiscall Entity_Player::GetTrinketRNG(Entity_Player *this,int id) { void *pvVar1; uint uVar2; uint uVar3; if ((id < 0) || ((int)(this->_trinketRNGs)._end - (int)(this->_trinketRNGs)._begin >> 4 <= id)) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); } pvVar1 = (this->_trinketRNGs)._begin; uVar2 = ((int)(this->_trinketRNGs)._end - (int)pvVar1 >> 4) - 1; uVar3 = -(uint)(id != 0) & id; if (uVar3 < uVar2) { uVar2 = uVar3; } return (RNG *)(uVar2 * 0x10 + (int)pvVar1); } //@@ 0065cfe0 FUN_0065cfe0 bool FUN_0065cfe0(uint param_1) { Entity_Player *pEVar1; PlayerManager *in_ECX; pEVar1 = PlayerManager::FirstBirthrightOwner(in_ECX,param_1); return pEVar1 != (Entity_Player *)0x0; } //@@ 0065d000 Game::GetDonationModGreed /* ZHL [lua] Lua binding Game:GetDonationModGreed */ int __thiscall Game::GetDonationModGreed(Game *this) { return this->_donationModGreed; } //@@ 0065d010 FUN_0065d010 int FUN_0065d010(void) { return g_game->_reviveMachineCoinsLeft; } //@@ 0065d020 FUN_0065d020 void FUN_0065d020(void) { int iVar1; int in_ECX; int iVar2; iVar1 = *(int *)(in_ECX + 0x26578) * 2; iVar2 = 10; if (iVar1 < 10) { iVar2 = iVar1; } *(int *)(in_ECX + 0x26574) = iVar2 + 10; return; } //@@ 0065d040 FUN_0065d040 void FUN_0065d040(void) { g_game->_reviveMachineUses = g_game->_reviveMachineUses + 1; return; } //@@ 0065d060 FUN_0065d060 undefined4 * FUN_0065d060(void) { return &g_game->_revivePlayerMenu; } //@@ 0065d070 FUN_0065d070 void FUN_0065d070(void) { Game::ShowFortuneText(&g_game->_fortuneRNG,(byte *)"Fortune_Seeds"); return; } //@@ 0065d090 FUN_0065d090 std_vector * FUN_0065d090(void) { return &g_game->_onlinePlayerStats; } //@@ 0065d0a0 FUN_0065d0a0 void FUN_0065d0a0(void) { int in_ECX; /* WARNING: Could not recover jumptable at 0x0065d0af. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)(in_ECX + 0x370) + 0x14))(); return; } //@@ 0065d0c0 FUN_0065d0c0 void FUN_0065d0c0(void) { Entity *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af762d; local_10 = ExceptionList; ExceptionList = &local_10; Entity::constructor(in_ECX); local_8 = 0; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Slot::vftable; *(undefined1 *)&in_ECX[1]._damageEvents._end = 0; ANM2::constructor((ANM2 *)&in_ECX[1]._index); *(undefined1 *)(in_ECX[1]._sprite._championColor._colorize + 3) = 0; ExceptionList = local_10; return; } //@@ 0065d130 Entity_Slot::Free /* ZHL [vtable slot 0] */ Entity_Slot * __thiscall Entity_Slot::Free(Entity_Slot *this,byte param_2) { FUN_0065d160(); if ((param_2 & 1) != 0) { operator_delete(this,0x550); } return this; } //@@ 0065d160 FUN_0065d160 void FUN_0065d160(void) { Entity *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Slot::vftable; local_8 = 0; ANM2::Reset((ANM2 *)&in_ECX[1]._index); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._sprite._animDefaultName._size); AnimationState::~AnimationState((AnimationState *)(in_ECX[1]._sprite._filename._buf + 8)); std::string::_Tidy_deallocate((char *)&in_ECX[1]._spawnerVariant); std::string::_Tidy_deallocate((char *)&in_ECX[1]._index); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 0065d1f0 FUN_0065d1f0 undefined * FUN_0065d1f0(void) { uint uVar1; uVar1 = Random(); return (&PTR_s_CoinJam_00b64c3c)[uVar1 & 3]; } //@@ 0065d200 Entity_Slot::Init /* ZHL [vtable slot 1] prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Entity_Slot::Init(Entity_Slot *this,int type,int variant,int subType,uint seed) { ANM2 other; byte bVar1; byte *curAnimChar; uint uVar2; float fVar3; Entity_Player *player; int iVar4; byte extraout_CL; byte extraout_CL_00; byte *defaultAnimChar; Game *game; bool isLess; ANM2 aAStackY_8c38 [128]; undefined1 in_stack_fffffedc [256]; undefined4 uVar5; int iVar6; int iVar7; byte *animData; iVar4 = variant; if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) && (variant == 2)) { iVar4 = 5; } this[1]._sprite._championColor._offset[0] = (float)&g_manager->_persistentGameData; uVar5._0_1_ = 0x4d; uVar5._1_1_ = 0xd2; uVar5._2_2_ = 0x65; iVar6 = iVar4; Entity::Init((Entity *)this,type,iVar4,subType,seed); if (this->_config != (void *)0x0) { subType = (int)this->_config + 0x74; iVar6 = 0x65d269; ANM2::Load(&this->_sprite,(std_string *)subType,1); variant = (int)&(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { variant = *(int *)((std_string *)variant)->_buf; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; defaultAnimChar = (byte *)variant; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar1 = *curAnimChar; isLess = bVar1 < *defaultAnimChar; if (bVar1 != *defaultAnimChar) { LAB_0065d2b0: uVar2 = -(uint)isLess | 1; goto LAB_0065d2b5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < defaultAnimChar[1]; if (bVar1 != defaultAnimChar[1]) goto LAB_0065d2b0; curAnimChar = curAnimChar + 2; defaultAnimChar = defaultAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0065d2b5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0065d2ea; } iVar6 = 0x65d2da; bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)variant,1); subType = variant; if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; subType = variant; } } LAB_0065d2ea: (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; (this->_posOffset).x = g_vectorZero.x; (this->_posOffset).y = g_vectorZero.y; (this->_sizeMulti).x = g_vectorOne.x; (this->_sizeMulti).y = g_vectorOne.y; this[1]._pendingDamage = 0.0; *(undefined4 *)&this[1]._pendingDamageFlags = 0; *(undefined4 *)((int)&this[1]._pendingDamageFlags + 4) = 0; *(undefined1 *)(this[1]._sprite._championColor._colorize + 3) = 0; *(undefined1 *)&this[1]._damageEvents._end = 0; *(undefined4 *)&this[1].field_0x4 = 1; iVar7 = 0x65d387; ANM2::Reset((ANM2 *)&this[1]._index); this[1]._sprite._championColor._colorize[2] = 0.0; game = g_game; if (((iVar4 == 2) || (iVar4 == 3)) || ((iVar4 == 1 || ((iVar4 == 0x11 || (iVar4 == 0x10)))))) { (this->_posOffset).y = -8.0; (this->_sizeMulti).x = 1.5; (this->_sizeMulti).y = 0.75; if (iVar4 == 2) { (this->_posOffset).x = -5.0; } goto LAB_0065d8c2; } if ((iVar4 == 6) || (iVar4 == 0xf)) { (this->_posOffset).y = -8.0; (this->_sizeMulti).x = 3.0; (this->_sizeMulti).y = 0.75; ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x124),&this->_sprite); other._flipX = (byte)uVar5; other._flipY = SUB41(uVar5,1); other._258_2_ = SUB42(uVar5,2); other._filename._buf[0] = in_stack_fffffedc[0]; other._filename._buf[1] = in_stack_fffffedc[1]; other._filename._buf[2] = in_stack_fffffedc[2]; other._filename._buf[3] = in_stack_fffffedc[3]; other._filename._buf[4] = in_stack_fffffedc[4]; other._filename._buf[5] = in_stack_fffffedc[5]; other._filename._buf[6] = in_stack_fffffedc[6]; other._filename._buf[7] = in_stack_fffffedc[7]; other._filename._buf[8] = in_stack_fffffedc[8]; other._filename._buf[9] = in_stack_fffffedc[9]; other._filename._buf[10] = in_stack_fffffedc[10]; other._filename._buf[0xb] = in_stack_fffffedc[0xb]; other._filename._buf[0xc] = in_stack_fffffedc[0xc]; other._filename._buf[0xd] = in_stack_fffffedc[0xd]; other._filename._buf[0xe] = in_stack_fffffedc[0xe]; other._filename._buf[0xf] = in_stack_fffffedc[0xf]; other._filename._size = in_stack_fffffedc._16_4_; other._filename._capacity = in_stack_fffffedc._20_4_; other._animDefaultName._buf[0] = in_stack_fffffedc[0x18]; other._animDefaultName._buf[1] = in_stack_fffffedc[0x19]; other._animDefaultName._buf[2] = in_stack_fffffedc[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffedc[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffedc[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffedc[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffedc[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffedc[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffedc[0x20]; other._animDefaultName._buf[9] = in_stack_fffffedc[0x21]; other._animDefaultName._buf[10] = in_stack_fffffedc[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffedc[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffedc[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffedc[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffedc[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffedc[0x27]; other._animDefaultName._size = in_stack_fffffedc._40_4_; other._animDefaultName._capacity = in_stack_fffffedc._44_4_; other._animState._animation = (void *)in_stack_fffffedc._48_4_; other._animState._animData = (void *)in_stack_fffffedc._52_4_; other._animState._layerFrames = (void *)in_stack_fffffedc._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffedc._60_4_; other._animState._animFrame = (float)in_stack_fffffedc._64_4_; other._animState._isPlaying = in_stack_fffffedc[0x44]; other._animState._21_3_ = in_stack_fffffedc._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffedc._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffedc._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffedc._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffedc._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffedc._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffedc._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffedc._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffedc[100]; other._overlayAnimState._21_3_ = in_stack_fffffedc._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffedc._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffedc._108_4_; other._overlayRenderFirst = in_stack_fffffedc[0x70]; other._113_3_ = in_stack_fffffedc._113_3_; other._animData = (void *)in_stack_fffffedc._116_4_; other._animCount = in_stack_fffffedc._120_4_; other._layerState = (void *)in_stack_fffffedc._124_4_; other._layerCount = in_stack_fffffedc._128_4_; other._nullLayerNames = (void *)in_stack_fffffedc._132_4_; other._numNullLayers = in_stack_fffffedc._136_4_; other._eventNames = (void *)in_stack_fffffedc._140_4_; other._numEvents = in_stack_fffffedc._144_4_; other._offset.x = (float)in_stack_fffffedc._148_4_; other._offset.y = (float)in_stack_fffffedc._152_4_; other._scale.x = (float)in_stack_fffffedc._156_4_; other._scale.y = (float)in_stack_fffffedc._160_4_; other._rotation = (float)in_stack_fffffedc._164_4_; other._color._tint[0] = (float)in_stack_fffffedc._168_4_; other._color._tint[1] = (float)in_stack_fffffedc._172_4_; other._color._tint[2] = (float)in_stack_fffffedc._176_4_; other._color._tint[3] = (float)in_stack_fffffedc._180_4_; other._color._colorize[0] = (float)in_stack_fffffedc._184_4_; other._color._colorize[1] = (float)in_stack_fffffedc._188_4_; other._color._colorize[2] = (float)in_stack_fffffedc._192_4_; other._color._colorize[3] = (float)in_stack_fffffedc._196_4_; other._color._offset[0] = (float)in_stack_fffffedc._200_4_; other._color._offset[1] = (float)in_stack_fffffedc._204_4_; other._color._offset[2] = (float)in_stack_fffffedc._208_4_; other._championColor._tint[0] = (float)in_stack_fffffedc._212_4_; other._championColor._tint[1] = (float)in_stack_fffffedc._216_4_; other._championColor._tint[2] = (float)in_stack_fffffedc._220_4_; other._championColor._tint[3] = (float)in_stack_fffffedc._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffedc._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffedc._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffedc._236_4_; other._championColor._colorize[3] = (float)in_stack_fffffedc._240_4_; other._championColor._offset[0] = (float)in_stack_fffffedc._244_4_; other._championColor._offset[1] = (float)in_stack_fffffedc._248_4_; other._championColor._offset[2] = (float)in_stack_fffffedc._252_4_; other._playbackSpeed = (float)type; other._264_4_ = iVar6; other._shadowLayerIndex = subType; other._bitflags = iVar7; ANM2::operator_assign((ANM2 *)&this[1]._index,other); goto LAB_0065d8c2; } if (((((iVar4 == 4) || (iVar4 == 5)) || (iVar4 == 7)) || ((iVar4 == 9 || (iVar4 == 0xd)))) || (iVar4 == 0x12)) { (this->_posOffset).y = 8.0; goto LAB_0065d8c2; } if (iVar4 == 8) { (this->_posOffset).y = -8.0; (this->_sizeMulti).x = 1.5; (this->_sizeMulti).y = 0.75; iVar4 = *(int *)((int)this[1]._sprite._championColor._offset[0] + 0x30c); ANM2::SetFrame(&this->_sprite,(std_string *)"Prize",0); ANM2::SetLayerFrame(&this->_sprite,1,(iVar4 / 100) % 10); ANM2::SetLayerFrame(&this->_sprite,2,(iVar4 / 10) % 10); ANM2::SetLayerFrame(&this->_sprite,3,iVar4 % 10); game = g_game; bVar1 = Game::GetStateFlag(g_game,0x11); if (bVar1 == 0) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { bVar1 = Game::AchievementUnlocksDisallowed(game); if (bVar1 != 0) goto LAB_0065d4fa; goto LAB_0065d501; } if ((game->_challenge != 0) || ((game->_dailyChallenge)._id != 0)) goto LAB_0065d4fa; } else { LAB_0065d4fa: (**(code **)(*(int *)this + 0x28))(); LAB_0065d501: game = g_game; } bVar1 = Game::GetStateFlag(game,0x12); if (bVar1 != 0) { uVar2 = Random(); ANM2::Play(&this->_sprite,(&PTR_s_CoinJam_00b64c3c)[uVar2 & 3],0); *(undefined4 *)&this[1].field_0x4 = 3; } } else { if (iVar4 == 0xb) { if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (fVar3 = (float)NetplayManager::get_player_persistent_game_data(), fVar3 != 0.0)) { this[1]._sprite._championColor._offset[0] = fVar3; } fVar3 = this[1]._sprite._championColor._offset[0]; (this->_posOffset).y = -8.0; (this->_sizeMulti).x = 1.5; (this->_sizeMulti).y = 0.75; iVar4 = *(int *)((int)fVar3 + 0x488); ANM2::SetFrame(&this->_sprite,(std_string *)"Prize",0); ANM2::SetLayerFrame(&this->_sprite,1,(iVar4 / 100) % 10); ANM2::SetLayerFrame(&this->_sprite,2,(iVar4 / 10) % 10); ANM2::SetLayerFrame(&this->_sprite,3,iVar4 % 10); bVar1 = Game::AchievementUnlocksDisallowed(g_game); if ((bVar1 != 0) && (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) { (**(code **)(*(int *)this + 0x28))(); } bVar1 = Game::GetStateFlag(g_game,0x22); if (bVar1 != 0) { uVar2 = Random(); ANM2::Play(&this->_sprite,(&PTR_s_CoinJam_00b64c3c)[uVar2 & 3],0); *(undefined4 *)&this[1].field_0x4 = 3; } goto LAB_0065d8c2; } if (iVar4 != 10) { if (iVar4 == 0xc) { (this->_sizeMulti).x = 1.5; (this->_sizeMulti).y = 0.75; if (*(char *)((int)game->_room + 1) == '\0') { ANM2::Play(&this->_sprite,s_Idle,0); } else { ANM2::Play(&this->_sprite,(byte *)"Appear",0); this->_visible = 0; } } else if (iVar4 == 0xe) { player = Game::GetPlayer(g_game,0); iVar4 = player->_playerType; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { FUN_0090b070(); iVar4 = FUN_004253d0(); iVar4 = *(int *)(iVar4 + 0x13c0); } switch(iVar4) { case 0: break; case 1: break; case 2: break; case 3: case 0xc: break; case 4: break; case 5: break; case 6: break; case 7: break; case 8: case 0xb: break; case 9: break; case 10: break; case 0xd: break; case 0xe: break; case 0xf: break; case 0x10: case 0x11: break; case 0x12: break; case 0x13: case 0x14: } iVar4 = FUN_0069bd10(); if (iVar4 != 0) { uVar2 = 0; bVar1 = extraout_CL; if ((this->_sprite)._layerCount != 0) { do { Sprite::ReplaceSpritesheet ((Sprite *)&this->_sprite,uVar2,(std_string *)(iVar4 + 0x1c)); uVar2 = uVar2 + 1; bVar1 = extraout_CL_00; } while (uVar2 < (uint)(this->_sprite)._layerCount); } ANM2::LoadGraphics(&this->_sprite,bVar1); } } else if (iVar4 == 0x13) { bVar1 = PlayerManager::IsCoopPlay(&g_game->_playerManager); if ((bVar1 == 0) || (game->_currentRoomIdx == -0x14)) { (**(code **)(*(int *)this + 0x28))(); } else { FUN_006655e0(); } } goto LAB_0065d8c2; } (this->_posOffset).y = -8.0; (this->_sizeMulti).x = 1.5; (this->_sizeMulti).y = 0.75; } uVar5 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x4000000; *(undefined4 *)((int)&this->_flags + 4) = uVar5; LAB_0065d8c2: this->_entityGridCollisionClass = 0; *(undefined2 *)&this[1]._damageEvents._capacity = 0; return; } //@@ 0065d950 Entity_Slot::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Slot::Update(Entity_Slot *this) { short *psVar1; code *pcVar2; Vector targetPos; undefined1 *puVar3; byte bVar4; char cVar5; undefined1 uVar6; undefined2 uVar7; int iVar8; byte *pbVar9; uint uVar10; uint uVar11; Entity *pEVar12; Vector *tmpVec; ItemPool *itemPool; ItemPool *persistentData; Entity_Pickup *pickup; Level *level; StringTable *stringTable; undefined4 *puVar13; RNG *this_01; ANM2 *pAVar14; RNG *this_02; Room *room; ColorMod *color; float *pfVar15; int *piVar16; PlayerManager *playerManager; void *pvVar17; undefined4 uVar18; undefined2 *puVar19; Entity_Effect *effect; Vector *pVVar20; AnimationState *pAVar21; short sVar22; char *pcVar23; ANM2 *pAVar24; Entity_Slot *pEVar25; Entity_Player *player; Sprite *sprite; RNG *pRVar26; bool bVar27; float fVar28; float fVar29; TypeDescriptor *pTVar30; TypeDescriptor *pTVar31; byte unk2; undefined4 uVar32; Vector local_110; Vector local_108; Vector local_100; undefined8 local_f8; Vector local_f0; Vector local_e8; Vector local_e0; Vector local_d8; Vector local_d0; Vector local_c8; Vector local_c0; Vector local_b8; Vector local_b0; Vector local_a8; Vector local_a0; Entity_Slot *savedSlot; Color tmpColor; char local_64 [8]; float local_5c [2]; Vector VStack_54; undefined1 local_4c [20]; uint local_38; RNG prizeRng; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; PersistentGameData *persistentData; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af768c; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; local_b0.y = 0.0; local_e8.y = 0.0; iVar8 = this->_variant; savedSlot = this; puVar3 = local_4c + 0x48; if (iVar8 == 0x10) { puVar3 = local_4c + 0x48; if ((*(int *)&this[1].field_0x4 != 3) && (puVar3 = local_4c + 0x48, this[1]._sprite._championColor._colorize[2] == 0.0)) { iVar8 = ItemPool::GetCollectible(&g_game->_itemPool,0x17,(this->_dropRNG)._seed,0,0x206,0); SetPrizeType(this,iVar8); iVar8 = this->_variant; puVar3 = puStack_20; goto LAB_0065d9f6; } } else { LAB_0065d9f6: puStack_20 = puVar3; puVar3 = puStack_20; if (((iVar8 == 0xc) && (1 < g_game->_frameCount - this->_spawnFrame)) && (this->_visible = 1, (this->_sprite)._animState._animData != (void *)0x0)) { bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Ground"); manager = g_manager; puVar3 = puStack_20; if (bVar4 != 0) { local_d0.y = 2.94273e-44; seed_fart_sound_override((int *)&local_d0.y); SoundEffects::Play(&manager->_sfxManager,(int)local_d0.y,1.0,2,0,1.0,0.0); this = savedSlot; puVar3 = puStack_20; } } } puStack_20 = puVar3; uVar10 = (uint)this->_flags; uVar18 = *(undefined4 *)((int)&this->_flags + 4); if ((uVar10 & 4) != 0) { *(undefined4 *)&this[1].field_0x4 = 0; *(undefined2 *)&this[1]._damageEvents._capacity = 0; iVar8 = this->_variant; *(uint *)&this->_flags = uVar10 & 0xfffffffb; *(undefined4 *)((int)&this->_flags + 4) = uVar18; if (iVar8 == 0xb) { ANM2::Play(&this->_sprite,(byte *)"Appear",0); this->_visible = 1; } } if (*(int *)&this[1].field_0x4 == 0) { pcVar23 = (this->_sprite)._animState._animData; if (pcVar23 == (char *)0x0) { pbVar9 = &s_empty; } else { pbVar9 = std::string::c_str(pcVar23); } pcVar23 = "Appear"; do { bVar4 = *pbVar9; bVar27 = bVar4 < (byte)*pcVar23; if (bVar4 != *pcVar23) { LAB_0065db20: uVar10 = -(uint)bVar27 | 1; goto LAB_0065db25; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar27 = bVar4 < (byte)pcVar23[1]; if (bVar4 != pcVar23[1]) goto LAB_0065db20; pbVar9 = pbVar9 + 2; pcVar23 = pcVar23 + 2; } while (bVar4 != 0); uVar10 = 0; LAB_0065db25: if (uVar10 != 0) { sVar22 = *(short *)&this[1]._damageEvents._capacity; if (sVar22 == 0) { iVar8 = this->_variant; uVar10 = 3; if ((((iVar8 == 4) || (iVar8 == 5)) || ((iVar8 == 7 || ((iVar8 == 9 || (iVar8 == 0xd)))))) || (iVar8 == 0x12)) { uVar10 = 2; } uVar11 = Random(); Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,uVar10,uVar11); sVar22 = *(short *)&this[1]._damageEvents._capacity; } *(short *)&this[1]._damageEvents._capacity = sVar22 + 1; if ((short)(sVar22 + 1) < 3) { ExceptionList = local_1c; return; } this->_visible = 1; *(undefined4 *)&this[1].field_0x4 = 1; ExceptionList = local_1c; return; } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } bVar4 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar4 == 0) { ExceptionList = local_1c; return; } fVar28 = this[1]._sprite._championColor._offset[0]; *(undefined4 *)&this[1].field_0x4 = 1; iVar8 = *(int *)((int)fVar28 + 0x488); ANM2::SetFrame(&this->_sprite,(std_string *)"Prize",0); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } AnimationState::SetLayerFrame(&(this->_sprite)._animState,1,(iVar8 / 100) % 10); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } AnimationState::SetLayerFrame(&(this->_sprite)._animState,2,(iVar8 / 10) % 10); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_1c; return; } AnimationState::SetLayerFrame(&(this->_sprite)._animState,3,iVar8 % 10); ExceptionList = local_1c; return; } local_c8.y = 0.65; if ((this->_variant == 0x12) && (g_game->_frameCount - this->_spawnFrame == 1)) { uVar10 = Random(); pEVar12 = Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); uVar10 = Random(); pcVar2 = *(code **)(*(int *)pEVar12 + 0x3c); fVar29 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.2; fVar28 = fVar29 * g_vectorOne.x; (pEVar12->_sprite)._scale.y = fVar29 * g_vectorOne.y; (pEVar12->_sprite)._scale.x = fVar28; Color::Reset(&tmpColor); Color::SetTint(&tmpColor,0.7,0.9,0.65,1.0); (*pcVar2)(&tmpColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar12 + 0xc))(); Color::Reset(&tmpColor); uVar10 = Random(); this = savedSlot; Game::SpawnParticles (g_game,&savedSlot->_pos,0x3f,uVar10 % 3 + 1,2.0,(ColorMod *)&tmpColor,100000.0,0); } local_e0.y = *(float *)&this->_target; if ((EntityPtr)local_e0.y == (EntityPtr)0x0) { local_e0.y = (float)PlayerManager::GetPlayer(&g_game->_playerManager,0); } player = (Entity_Player *)local_e0.y; local_d0.y = (float)Entity_Player::GetTrinketRNG((Entity_Player *)local_e0.y,0x16); local_e8.y = (float)Entity_Player::GetCollectibleRNG(player,0x2e); if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y) ) { (this->_targetPosition).x = (this->_pos).x; (this->_targetPosition).y = (this->_pos).y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; } pEVar25 = this; if ((((*(int *)&this[1].field_0x4 == 3) && (iVar8 = this->_variant, iVar8 != 6)) && (iVar8 != 0xf) ) && ((iVar8 != 8 && (iVar8 != 0xb)))) { this->_friction = this->_friction * 0.8; LAB_0065df30: this->_entityGridCollisionClass = 5; if (this->_variant == 10) { iVar8 = (int)this[1]._pendingDamageFlags; if ((iVar8 != 0) && (iVar8 = iVar8 + -1, *(int *)&this[1]._pendingDamageFlags = iVar8, iVar8 == 0)) { Room::ShopRestockFull(g_game->_room); } goto LAB_0065df69; } } else { fVar28 = (this->_targetPosition).x; fVar29 = (this->_pos).x; (this->_velocity).y = (this->_targetPosition).y - (this->_pos).y; (this->_velocity).x = fVar28 - fVar29; iVar8 = *(int *)&this[1].field_0x4; this->_friction = this->_friction * 0.8; if (iVar8 == 3) goto LAB_0065df30; LAB_0065df69: if ((this->_variant == 10) && (bVar4 = ANM2::IsFinishedImpl(&this->_sprite,(byte *)"WiggleEnd"), bVar4 != 0)) { Room::ShopRestockFull(g_game->_room); this[1]._pendingDamage = 0.0; ANM2::Play(&this->_sprite,s_Idle,0); *(int *)&this[1]._pendingDamageFlags = (int)this[1]._pendingDamageFlags + 1; if (4 < (uint)this[1]._pendingDamageFlags) { RNG::Next(&this->_dropRNG); pEVar25 = savedSlot; if (((this->_dropRNG)._seed & 1U) == 0) { *(undefined4 *)&savedSlot[1]._pendingDamageFlags = 0; uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); spawn_break_drops(pEVar25); *(undefined4 *)&pEVar25[1].field_0x4 = 3; ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); } } } } local_c0.y = (float)&DAT_00000005; if (((pEVar25->_variant == 9) && (uVar10 = (uint)pEVar25[1]._pendingDamageFlags, uVar10 != 0)) && (*(uint *)&pEVar25[1]._pendingDamageFlags = uVar10 - 1, uVar10 % 5 == 0)) { Room::get_random_pickup_position(g_game->_room,&local_a0,0,0); local_c0.y = (float)g_game->_room; uVar10 = Room::GetGridIndex((Room *)local_c0.y,&local_a0); if ((uVar10 < 0x1c0) && (((int *)((int)local_c0.y + 0x76c))[uVar10] < 0x3b7)) { ((int *)((int)local_c0.y + 0x76c))[uVar10] = 900; } uVar10 = Random(); Game::Spawn(g_game,4,3,&local_a0,&g_vectorZero,(Entity *)pEVar25,0,uVar10); } sVar22 = *(short *)&pEVar25[1]._damageEvents._capacity; if (0 < sVar22) { sVar22 = sVar22 + -1; *(short *)&pEVar25[1]._damageEvents._capacity = sVar22; if (((sVar22 == 0) && (*(int *)&pEVar25[1].field_0x4 == 2)) && (pEVar25->_variant == 1)) { ANM2::Play(&pEVar25->_sprite,(byte *)"WiggleEnd",0); sVar22 = *(short *)&pEVar25[1]._damageEvents._capacity; } } local_c0.y = 1.4013e-44; local_a8.y = (float)&DAT_0000000f; if (sVar22 == 0) { bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,(byte *)"WiggleEnd"); if ((bVar4 != 0) && (pEVar25->_variant == 1)) { ANM2::SetFrame(&pEVar25->_sprite,(std_string *)"Prize",0); RNG::Next(&pEVar25->_dropRNG); if ((uint)(pEVar25->_dropRNG)._seed % 0x32 == 0) { uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); spawn_break_drops(pEVar25); *(undefined4 *)&pEVar25[1].field_0x4 = 3; ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); } else { pEVar25[1]._damageEvents._begin = (void *)0x0; bVar4 = Entity_Player::HasCollectible(player,0x2e,0); if ((bVar4 == 0) && ((bVar4 = Entity_Player::HasTrinket(player,0x4c,0), bVar4 == 0 || (RNG::Next(&pEVar25->_dropRNG), ((pEVar25->_dropRNG)._seed & 3U) != 0)))) { RNG::Next(&pEVar25->_dropRNG); local_a8.y = 2.94273e-44; uVar10 = (uint)(pEVar25->_dropRNG)._seed % 0x15; } else { RNG::Next(&pEVar25->_dropRNG); uVar10 = (uint)(pEVar25->_dropRNG)._seed % (uint)local_a8.y; } pvVar17 = (void *)(uVar10 + 3); pEVar25[1]._damageEvents._begin = pvVar17; if (pvVar17 == (void *)0x9) { RNG::Next(&pEVar25->_dropRNG); if ((uint)(pEVar25->_dropRNG)._seed % (uint)local_c0.y < 3) { pvVar17 = pEVar25[1]._damageEvents._begin; goto LAB_0065e2a5; } LAB_0065e2c8: pEVar25[1]._damageEvents._begin = (void *)0xb; } else { LAB_0065e2a5: bVar27 = false; if (pvVar17 == (void *)0xa) { RNG::Next(&pEVar25->_dropRNG); if (4 < (uint)(pEVar25->_dropRNG)._seed % (uint)local_c0.y) goto LAB_0065e2c8; pvVar17 = pEVar25[1]._damageEvents._begin; bVar27 = pvVar17 == (void *)0xa; } if (((void *)0x9 < pvVar17 && !bVar27) && (RNG::Next(&pEVar25->_dropRNG), (uint)(pEVar25->_dropRNG)._seed % (uint)local_c0.y != 0 )) { pEVar25[1]._damageEvents._begin = (void *)((int)pEVar25[1]._damageEvents._begin + 1); } } if ((pEVar25[1]._damageEvents._begin == (void *)0x7) && (RNG::Next(&pEVar25->_dropRNG), (uint)(pEVar25->_dropRNG)._seed % 3 == 0)) { pEVar25[1]._damageEvents._begin = (void *)0xb; } pvVar17 = pEVar25[1]._damageEvents._begin; if ((((pvVar17 == (void *)0x6) || (pvVar17 == (void *)0x5)) && (bVar4 = Entity_Player::HasTrinket(player,0x16,0), bVar4 != 0)) && (RNG::Next((RNG *)local_d0.y), (uint)*(int *)local_d0.y % 5 != 0)) { pEVar25[1]._damageEvents._begin = (void *)0xb; } if ((g_game->_difficulty == 1) && (RNG::Next(&pEVar25->_dropRNG), ((pEVar25->_dropRNG)._seed & 1U) == 0)) { pEVar25[1]._damageEvents._begin = (void *)0x0; } if (1 < *(int *)&g_game->_deathmatchManager) { if ((pEVar25[1]._damageEvents._begin == (void *)0x9) && (cVar5 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x30))(0x12), cVar5 != '\0')) { pEVar25[1]._damageEvents._begin = (void *)0xb; } if ((pEVar25[1]._damageEvents._begin == (void *)0xa) && (cVar5 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x30))(0xb1), cVar5 != '\0')) { pEVar25[1]._damageEvents._begin = (void *)0x3; } } switch(pEVar25[1]._damageEvents._begin) { case (void *)0x3: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,0), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,0), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,0); } break; case (void *)0x4: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,2), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,2), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,2); } break; case (void *)0x5: case (void *)0x6: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,6), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,6), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,6); } break; case (void *)0x7: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,4), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,4), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,4); } break; case (void *)0x8: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,5), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,5), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,5); } break; case (void *)0x9: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,1), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,1), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,1); } break; case (void *)0xa: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,7), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,7), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,7); } break; case (void *)0xb: case (void *)0xc: case (void *)0xd: if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,3), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,3), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,3); } break; default: pRVar26 = &pEVar25->_dropRNG; do { RNG::Next(pRVar26); local_a8.y = (float)(pRVar26->_seed & 7); RNG::Next(pRVar26); local_c0.y = (float)(pRVar26->_seed & 7); RNG::Next(pRVar26); player = (Entity_Player *)local_e0.y; local_f8._4_4_ = (ANM2 *)(pRVar26->_seed & 7); if (local_a8.y != local_c0.y) break; } while ((ANM2 *)local_c0.y == local_f8._4_4_); if ((((pEVar25->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,1,(int)local_a8.y), (pEVar25->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,2,(int)local_c0.y), (pEVar25->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetLayerFrame(&(pEVar25->_sprite)._animState,3,(int)local_f8._4_4_); } manager = g_manager; local_c0.y = 3.48923e-43; seed_fart_sound_override((int *)&local_c0.y); SoundEffects::Play(&manager->_sfxManager,(int)local_c0.y,1.0,2,0,1.0,0.0); pEVar25 = savedSlot; } } } } if (*(short *)&pEVar25[1]._damageEvents._capacity == 0) { if (pEVar25->_variant == 0x10) { local_c0.y = (float)&pEVar25->_sprite; bVar4 = ANM2::IsFinishedImpl((ANM2 *)local_c0.y,(byte *)"Wiggle"); if (bVar4 == 0) { sprite = (Sprite *)&pEVar25->_sprite; } else { RNG::Next(&pEVar25->_dropRNG); uVar10 = (uint)(pEVar25->_dropRNG)._seed % 100; bVar4 = Entity_Player::HasTrinket(player,0x4c,0); sprite = (Sprite *)local_c0.y; if (bVar4 != 0) { uVar10 = uVar10 - 5; } if ((int)uVar10 < 0x19) { ANM2::Play((ANM2 *)local_c0.y,(byte *)"Prize",0); iVar8 = 0x10c; } else { ANM2::Play((ANM2 *)local_c0.y,(byte *)"NoPrize",0); iVar8 = 0x10b; } SoundEffects::PlayWithFartOverride(iVar8,1.0,2,0,1.0); pEVar25 = savedSlot; } bVar4 = Sprite::IsEventTriggered(sprite,"Prize"); if (bVar4 != 0) { uVar10 = RNG::Next(&pEVar25->_dropRNG); fVar28 = savedSlot[1]._sprite._championColor._colorize[2]; tmpVec = (Vector *)FUN_006653c0(&local_c0); pEVar12 = Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,(uint)fVar28,uVar10); (**(code **)(*(int *)pEVar12 + 0xc))(); SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar10 = EntityPtr::Ref(); iVar8 = ItemPool::GetCollectible(itemPool,0x17,uVar10,0,0x206,0); pEVar25 = savedSlot; SetPrizeType(savedSlot,iVar8); sprite = (Sprite *)&pEVar25->_sprite; } bVar4 = Sprite::IsEventTriggered(sprite,"Explosion"); if (bVar4 != 0) { uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); spawn_break_drops(pEVar25); *(undefined4 *)&pEVar25[1].field_0x4 = 3; ANM2::Play((ANM2 *)sprite,(byte *)"Death",0); } bVar4 = ANM2::IsFinishedImpl((ANM2 *)sprite,(byte *)"Prize"); if (bVar4 != 0) { pEVar25[1]._pendingDamage = (float)((int)pEVar25[1]._pendingDamage + 1); if ((uint)pEVar25[1]._pendingDamage < 3) { ANM2::Play((ANM2 *)sprite,(byte *)"Regenerate",0); } else { *(undefined4 *)&pEVar25[1].field_0x4 = 4; ANM2::Play((ANM2 *)sprite,(byte *)"OutOfPrizes",0); } } } else if (pEVar25->_variant == 0x11) { bVar4 = ANM2::IsPlaying(&pEVar25->_sprite,(byte *)"Wiggle"); if (bVar4 != 0) { local_c0.y = 0.3; iVar8 = Game::Difficulty(g_game); if (iVar8 == 1) { local_c0.y = 0.25; } bVar4 = Entity_Player::HasCollectible(player,0x2e,0); if (bVar4 != 0) { local_c0.y = local_c0.y * 1.5; } local_a8.y = RNG::RandomFloat(&pEVar25->_dropRNG); if (local_c0.y <= local_a8.y) { pcVar23 = "NoPrize"; } else { pcVar23 = "Prize"; } ANM2::Play(&pEVar25->_sprite,(byte *)pcVar23,0); } bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { local_c0.y = (float)&pEVar25->_dropRNG; uVar10 = RNG::RandomInt((RNG *)local_c0.y,0x14); if (uVar10 == 0) { uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); spawn_break_drops(pEVar25); ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); *(undefined4 *)&pEVar25[1].field_0x4 = 3; } else { uVar10 = RNG::RandomInt(&pEVar25->_dropRNG,0x1e); if (uVar10 == 0) { (**(code **)(*(int *)pEVar25 + 0x28))(); uVar10 = Random(); local_a8.y = (float)&pEVar25->_pos; Game::Spawn(g_game,1000,1,(Vector *)local_a8.y,&g_vectorZero,(Entity *)0x0,0,uVar10); iVar8 = Game::GetDevilRoomDeals(g_game); if (iVar8 < 1) { LAB_0065eb25: itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar10 = pEVar25->_initSeed; persistentData = (ItemPool *)Game::GetItemPool(g_game); iVar8 = ItemPool::GetPoolForRoom(persistentData,0xf,savedSlot->_initSeed); uVar10 = ItemPool::GetCollectible(itemPool,iVar8,uVar10,0,0x21,0); if (uVar10 == 0) goto LAB_0065ed10; } else { itemPool = (ItemPool *)Game::GetItemPool(g_game); bVar4 = ItemPool::RemoveCollectible(itemPool,0x2a1,1,0); if (bVar4 == 0) goto LAB_0065eb25; uVar10 = 0x2a1; } uVar11 = RNG::Next((RNG *)local_c0.y); pickup = (Entity_Pickup *) Game::Spawn(g_game,5,100,(Vector *)local_a8.y,&g_vectorZero,(Entity *)0x0, uVar10,uVar11); Entity_Pickup::SetAlternatePedestal(pickup,0xf); (**(code **)(*(int *)pickup + 0xc))(); } else { iVar8 = Entity_Player::GetBrokenHearts(player); if (0 < iVar8) { Entity_Player::AddBrokenHearts(player,-1); Entity_Player::UseActiveItem(player,(short *)((int)&local_f8 + 6),0x23,1,-1,0); SoundEffects::PlayWithFartOverride(0x10c,1.0,2,0,1.0); goto LAB_0065ed16; } uVar10 = RNG::RandomInt(&pEVar25->_dropRNG,2); if ((uVar10 == 0) && ((bVar4 = Entity_Player::HasTrinket(player,0x16,0), bVar4 == 0 || (uVar10 = RNG::RandomInt((RNG *)local_d0.y,5), uVar10 == 0)))) { Entity_Player::AddSoulHearts(player,2,0); iVar8 = 0x36; LAB_0065ec99: play_sound_with_fart_seed(iVar8,1.0,2,0,1.0); Entity_Player::AnimateHappy(player); goto LAB_0065ed16; } uVar10 = RNG::RandomInt(&pEVar25->_dropRNG,0x10); if ((uVar10 == 0) && ((bVar4 = Entity_Player::HasTrinket(player,0x16,0), bVar4 == 0 || (uVar10 = RNG::RandomInt((RNG *)local_d0.y,5), uVar10 == 0)))) { Entity_Player::AddEternalHearts(player,1); iVar8 = 0x10a; goto LAB_0065ec99; } level = (Level *)Config::GetCollectibles(); Level::RemoveCurses(level,0xffffffff); level = (Level *)Config::GetCollectibles(); Level::AddAngelRoomChance(level,0x3dcccccd); Game::GetHUD(g_game); stringTable = (StringTable *)FUN_004253c0(); pbVar9 = string_table_translate(stringTable,(byte *)"#YOU_FEEL_BLESSED"); HUD::show_fortune_text_impl(pbVar9); } LAB_0065ed10: pEVar25 = savedSlot; } } } } LAB_0065ed16: if (((*(int *)&pEVar25[1].field_0x4 != 2) || (*(short *)&pEVar25[1]._damageEvents._capacity != 0)) || (((((iVar8 = pEVar25->_variant, iVar8 == 4 || ((((iVar8 == 5 || (iVar8 == 7)) || (iVar8 == 9)) || ((iVar8 == 0xd || (iVar8 == 0x12)))) )) || (iVar8 == 0xe)) && ((bVar4 = ANM2::IsPlaying(&pEVar25->_sprite,(byte *)"PayPrize"), bVar4 != 0 && (bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty), bVar4 == 0)))) || ((pEVar25->_variant == 6 || (pEVar25->_variant == 0xf)))))) { iVar8 = *(int *)&pEVar25[1].field_0x4; if (iVar8 != 5) { if (iVar8 == 2) { iVar8 = pEVar25->_variant; if (((((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 2)) || ((iVar8 == 0x10 || (iVar8 == 0x11)))) && (bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty), bVar4 != 0)) { ANM2::Play(&pEVar25->_sprite,(byte *)"Wiggle",0); } if (pEVar25->_variant == 0xe) { tmpVec = &pEVar25->_pos; local_a0.y = (float)tmpVec; bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,&DAT_00b64ba4); if (bVar4 != 0) { uVar10 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xc,tmpVec,&g_vectorZero,(Entity *)0x0,10,uVar10); Entity_Effect::FollowParent(effect,(Entity *)pEVar25); set_field_358(effect,-10.0); tmpVec = (Vector *)Sprite::Scale((Sprite *)&pEVar25->_sprite); Entity::SetSpriteScale((Entity *)effect,tmpVec); tmpVec = (Vector *)Entity::SpriteScale((Entity *)effect); pVVar20 = Vector::Vector((Vector *)(local_4c + 0x10),0.0,-20.0); tmpVec = Vector::Mul(tmpVec,&VStack_54,pVVar20); FUN_004563c0(tmpVec); Entity::AddEntityFlags((Entity *)effect,0x100000000000); (**(code **)(*(int *)effect + 0xc))(); Entity_Effect::set_rotation(effect,0.0); pEVar25 = savedSlot; tmpVec = (Vector *)local_a0.y; } bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,&DAT_00b1d534); if (bVar4 != 0) { uVar10 = Random(); Game::Spawn(g_game,1000,0xf,tmpVec,&g_vectorZero,(Entity *)0x0,0,uVar10); } } } else if (iVar8 == 3) { iVar8 = pEVar25->_variant; if (((iVar8 == 1) || (iVar8 == 2)) || ((iVar8 == 3 || (((iVar8 == 0x13 || (iVar8 == 0x10)) || (iVar8 == 0x11)))))) { pAVar21 = (AnimationState *)Config::GetPillEffects(); bVar4 = AnimationState::IsLoopingAnimation(pAVar21); if ((bVar4 != 0) || (bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty), bVar4 != 0) ) { ANM2::Play(&pEVar25->_sprite,(byte *)"Broken",0); } } } else if ((iVar8 == 4) && (pEVar25->_variant != 0x10)) { pEVar25->_entityCollisionClass = 0; bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Disappear"); if (bVar4 != 0) { pEVar25->_shadowSize = 0.0; } bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty); if (bVar4 != 0) { (**(code **)(*(int *)pEVar25 + 0x28))(); } } goto LAB_00662654; } iVar8 = pEVar25->_variant; if ((iVar8 != 6) && (iVar8 != 0xf)) { if (iVar8 == 9) { bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { *(undefined4 *)&pEVar25[1]._pendingDamageFlags = 0x1e; } bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty); if (bVar4 != 0) { *(undefined4 *)&pEVar25[1].field_0x4 = 1; ANM2::Play(&pEVar25->_sprite,s_Idle,0); } } goto LAB_00662654; } } pAVar14 = (ANM2 *)&pEVar25->_dropRNG; uVar11 = 3; local_c0.y = (float)pAVar14; uVar10 = EntityPtr::Ref(); RNG::game_constructor(&prizeRng,uVar10,uVar11); local_14 = 0; bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x4c,0); if (bVar4 == 0) { local_a8.y = 1.4013e-45; } else { local_a8.y = (float)Entity_Player::GetTrinketMultiplier((Entity_Player *)local_e0.y,0x4c); local_f8._4_4_ = (ANM2 *)0x3; puVar13 = (undefined4 *)std::min(); local_a8.y = (float)*puVar13; } switch(pEVar25->_variant) { case 1: std::string::string_from_cstr(local_64,(byte *)"Prize"); local_14._0_1_ = 1; pAVar24 = (ANM2 *)Config::GetPillEffects(); ANM2::GetAnimation(pAVar24,(std_string *)local_4c); uVar6 = FUN_0040c790(); local_f8._4_4_ = (ANM2 *)CONCAT13(uVar6,local_f8._4_3_); std::string::_Tidy_deallocate(local_4c); local_14 = (uint)local_14._1_3_ << 8; std::string::_Tidy_deallocate(local_64); pEVar25 = savedSlot; if (local_f8._7_1_ != '\0') { switch(savedSlot[1]._damageEvents._begin) { case (void *)0x3: uVar10 = RNG::RandomInt((RNG *)pAVar14,3); if (uVar10 == 0) { Entity_Player::AddPrettyFly((Entity_Player *)local_e0.y); Entity_Player::AnimateHappy((Entity_Player *)local_e0.y); *(undefined4 *)&pEVar25[1].field_0x4 = 1; } else { local_c8.y = (float)&pEVar25->_pos; local_a0.x = g_vectorZero.x; iVar8 = 0; local_a0.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector(&local_d8,uVar10); local_e8.y = 5.0; tmpVec = Vector::__mul(tmpVec,&local_b8,&local_e8.y); Vector::operator_assign(&local_a0,tmpVec); local_a0.y = local_a0.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_b0.y = 7.0; tmpVec = Vector::__mul(&local_a0,&local_f0,&local_b0.y); tmpVec = Vector::__add((Vector *)local_c8.y,&local_d0,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_c8.y,tmpVec,1,0,0,0,(Vector *)0x0); if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::Next((RNG *)local_c0.y); Game::Spawn(g_game,0xd,0,(Vector *)local_c8.y,&local_a0,(Entity *)0x0,0,uVar10); Entity_Player::AnimateSad((Entity_Player *)local_e0.y); *(undefined4 *)&savedSlot[1].field_0x4 = 1; pEVar25 = savedSlot; } break; case (void *)0x4: SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); HandleCollision(pEVar25,0x28,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); *(undefined4 *)&pEVar25[1].field_0x4 = 1; break; case (void *)0x5: case (void *)0x6: SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); HandleCollision(pEVar25,10,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); *(undefined4 *)&pEVar25[1].field_0x4 = 1; break; case (void *)0x7: SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); HandleCollision(pEVar25,0x1e,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); *(undefined4 *)&pEVar25[1].field_0x4 = 1; break; case (void *)0x8: SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); HandleCollision(pEVar25,0x46,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); *(undefined4 *)&pEVar25[1].field_0x4 = 1; break; case (void *)0x9: case (void *)0xa: SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); Game::ButterBeanFart(g_game,&pEVar25->_pos,9.0,(Entity *)pEVar25,0,0); (**(code **)(*(int *)pEVar25 + 0x28))(); uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); pvVar17 = pEVar25[1]._damageEvents._begin; if (pvVar17 == (void *)0x9) { uVar10 = RNG::Next((RNG *)pAVar14); uVar32 = 0; pTVar31 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar30 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar12 = Game::Spawn(g_game,5,100,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0x12,uVar10) ; pickup = (Entity_Pickup *)__RTDynamicCast(pEVar12,uVar18,pTVar30,pTVar31,uVar32); } else if (pvVar17 == (void *)0xa) { uVar10 = RNG::Next((RNG *)pAVar14); uVar32 = 0; pTVar31 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar30 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar12 = Game::Spawn(g_game,5,100,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0xb1,uVar10) ; pickup = (Entity_Pickup *)__RTDynamicCast(pEVar12,uVar18,pTVar30,pTVar31,uVar32); itemPool = (ItemPool *)Game::GetItemPool(g_game); ItemPool::RemoveCollectible(itemPool,0xb1,0,0); } else { pickup = (Entity_Pickup *)0x0; } FUN_005b1990(1); Entity_Pickup::SetAlternatePedestal(pickup,3); (**(code **)(*(int *)pickup + 0xc))(); default: switchD_0065eef5_default: *(undefined4 *)&pEVar25[1].field_0x4 = 1; break; case (void *)0xb: case (void *)0xc: case (void *)0xd: SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); local_e8.y = (float)RNG::RandomInt((RNG *)pAVar14,3); local_b0.y = 1.4013e-45; puVar13 = (undefined4 *)FUN_0040cdc0(); fVar28 = local_a8.y; local_b0.y = (float)*puVar13; if ((ANM2 *)local_b0.y == (ANM2 *)0x0) goto switchD_0065eef5_default; do { HandleCollision(pEVar25,0x14,0,fVar28,&prizeRng,&g_vectorZero,&g_vectorZero); local_b0.y = (float)((int)&((ANM2 *)((int)local_b0.y + -0x114))->_bitflags + 3); } while ((ANM2 *)local_b0.y != (ANM2 *)0x0); *(undefined4 *)&pEVar25[1].field_0x4 = 1; local_b0.y = 0.0; } } break; case 2: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,100); if (uVar10 == 0) { itemPool = (ItemPool *)Game::GetItemPool(g_game); cVar5 = ItemPool::RemoveTrinket(itemPool,0x22); if (cVar5 == '\0') goto LAB_0065f619; iVar8 = 0; local_d0.x = g_vectorZero.x; local_c8.y = (float)&savedSlot->_pos; local_d0.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector(&local_a0,uVar10); local_e8.y = 5.0; tmpVec = Vector::__mul(tmpVec,&local_d8,&local_e8.y); Vector::operator_assign(&local_d0,tmpVec); local_d0.y = local_d0.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_b0.y = 7.0; tmpVec = Vector::__mul(&local_d0,&local_b8,&local_b0.y); tmpVec = Vector::__add((Vector *)local_c8.y,&local_f0,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_c8.y,tmpVec,1,0,0,0,(Vector *)0x0); if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = Random(); Game::Spawn(g_game,5,0x15e,(Vector *)local_c8.y,&local_d0,(Entity *)0x0,0x22,uVar10); LAB_0065f522: pEVar25 = savedSlot; } else { LAB_0065f619: uVar10 = RNG::RandomInt((RNG *)pAVar14,0xf); if (uVar10 == 0) { local_d0.y = 1.89175e-43; uVar10 = RNG::RandomInt((RNG *)pAVar14,2); if (uVar10 == 0) { LAB_0065f65e: pEVar25 = savedSlot; bVar4 = PersistentGameData::Unlocked ((PersistentGameData *)savedSlot[1]._sprite._championColor._offset[0], 0x93); local_d0.y = 1.89175e-43; if (bVar4 != 0) { local_d0.y = 1.66755e-43; } } else { itemPool = (ItemPool *)Game::GetItemPool(g_game); bVar4 = ItemPool::is_collectible_available(itemPool,0x87,0); if (bVar4 == 0) goto LAB_0065f65e; pEVar25 = savedSlot; } Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 != '\0') { Game::GetField26614(g_game); piVar16 = (int *)EntityList::Size(); cVar5 = (**(code **)(*piVar16 + 0x30))(local_d0.y); if (cVar5 != '\0') goto LAB_0065f76e; } itemPool = (ItemPool *)Game::GetItemPool(g_game); ItemPool::RemoveCollectible(itemPool,(int)local_d0.y,0,0); (**(code **)(*(int *)pEVar25 + 0x28))(); uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); uVar10 = RNG::Next((RNG *)pAVar14); uVar32 = 0; pTVar31 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar30 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar12 = Game::Spawn(g_game,5,100,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0, (uint)local_d0.y,uVar10); pickup = (Entity_Pickup *)__RTDynamicCast(pEVar12,uVar18,pTVar30,pTVar31,uVar32); Entity_Pickup::SetAlternatePedestal(pickup,2); (**(code **)(*(int *)pickup + 0xc))(); goto LAB_0065f522; } LAB_0065f76e: fVar28 = local_e0.y; if (((EntityPtr)local_e0.y == (EntityPtr)0x0) || (iVar8 = Entity_Player::GetHealthType((Entity_Player *)local_e0.y), iVar8 != 3)) { bVar4 = Game::IsHardMode(); if (bVar4 == 0) { local_d8.y = (float)RNG::RandomInt((RNG *)pAVar14,3); local_a0.y = 1.4013e-45; } else { local_f0.y = (float)RNG::RandomInt((RNG *)pAVar14,2); local_b8.y = 1.4013e-45; } puVar13 = (undefined4 *)FUN_0040cdc0(); pAVar14 = (ANM2 *)*puVar13; local_c0.y = (float)pAVar14; bVar4 = Entity_Player::HasCollectible((Entity_Player *)fVar28,0x4b,0); } else { local_c0.y = (float)RNG::RandomInt((RNG *)pAVar14,2); bVar4 = Entity_Player::HasCollectible((Entity_Player *)fVar28,0x4b,0); if (bVar4 == 0) { LAB_0065f7e9: local_f8._4_4_ = (ANM2 *)((uint)local_f8._4_4_ & 0xffffff); } else { uVar11 = 8; uVar10 = EntityPtr::Ref(); RNG::game_constructor((RNG *)(local_4c + 8),uVar10,uVar11); local_14 = CONCAT31(local_14._1_3_,2); local_e8.y = (float)((uint)local_b0.y | 1); local_b0.y = local_e8.y; uVar10 = RNG::RandomInt(this_01,4); local_f8._4_4_ = (ANM2 *)CONCAT13(1,local_f8._4_3_); if (uVar10 != 0) goto LAB_0065f7e9; } local_14 = 0; if (((uint)local_b0.y & 1) != 0) { guard_check_icall(); } pAVar14 = (ANM2 *)local_c0.y; bVar4 = local_f8._7_1_; } pEVar25 = savedSlot; fVar28 = local_a8.y; if (bVar4 != 0) { pAVar14 = (ANM2 *)((pAVar14->_filename)._buf + 1); local_c0.y = (float)pAVar14; } if (pAVar14 == (ANM2 *)0x0) goto LAB_0065f522; do { HandleCollision(pEVar25,0x14,0,fVar28,&prizeRng,&g_vectorZero,&g_vectorZero); local_c0.y = (float)((int)&((ANM2 *)((int)local_c0.y + -0x114))->_bitflags + 3); } while ((ANM2 *)local_c0.y != (ANM2 *)0x0); local_c0.y = 0.0; } if (pEVar25->_exists == 0) break; SoundEffects::PlayWithFartOverride(0xaf,1.0,2,0,1.0); uVar10 = Random(); pEVar12 = Game::Spawn(g_game,1000,2,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,3,uVar10); tmpVec = Vector::Vector(&local_a0,0.0,-2.0); FUN_004563c0(tmpVec); set_field_358(pEVar12,5.0); } LAB_0065f5b0: pEVar25 = savedSlot; break; case 3: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { iVar8 = Game::Difficulty(g_game); if (iVar8 == 1) { local_c8.y = 0.85; } bVar4 = Entity_Player::HasCollectible((Entity_Player *)local_e0.y,0x2e,0); if ((bVar4 != 0) || ((bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x4c,0), bVar4 != 0 && (uVar10 = RNG::RandomInt((RNG *)pAVar14,5), uVar10 == 0)))) { local_c8.y = local_c8.y * 0.46; } local_a0.y = RNG::RandomFloat((RNG *)pAVar14); if (local_c8.y <= local_a0.y) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); uVar10 = RNG::RandomInt((RNG *)pAVar14,0x14); if (uVar10 == 0) { uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); spawn_break_drops(pEVar25); ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); *(undefined4 *)&pEVar25[1].field_0x4 = 3; } else { uVar10 = RNG::RandomInt((RNG *)pAVar14,0x1e); if (uVar10 == 0) { (**(code **)(*(int *)pEVar25 + 0x28))(); uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); uVar10 = RNG::Next((RNG *)pAVar14); uVar32 = 0; pTVar31 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar30 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar12 = Game::Spawn(g_game,5,100,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0x9e, uVar10); pickup = (Entity_Pickup *)__RTDynamicCast(pEVar12,uVar18,pTVar30,pTVar31,uVar32); Entity_Pickup::SetAlternatePedestal(pickup,1); (**(code **)(*(int *)pickup + 0xc))(); goto LAB_0065f5b0; } uVar10 = RNG::RandomInt((RNG *)pAVar14,3); if (uVar10 == 0) goto LAB_0065facd; uVar10 = RNG::RandomInt((RNG *)pAVar14,3); if ((uVar10 != 0) || ((bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x16,0), bVar4 != 0 && (uVar10 = RNG::RandomInt((RNG *)local_d0.y,5), uVar10 != 0)))) { local_b0.y = (float)&pEVar25->_pos; local_b8.x = g_vectorZero.x; iVar8 = 0; local_b8.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector(&local_f0,uVar10); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&local_e8,&local_a0.y); Vector::operator_assign(&local_b8,tmpVec); local_b8.y = local_b8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_c8,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_d0,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::Next((RNG *)local_c0.y); goto LAB_0065fc5e; } HandleCollision(pEVar25,10,3,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); } } else if (0.002 <= local_a0.y) { Game::ShowFortune(g_game); } else { FUN_0065d070(); } } break; case 4: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); uVar10 = RNG::RandomInt((RNG *)pAVar14,2); if (uVar10 == 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,3); if ((uVar10 == 0) && ((bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x16,0), bVar4 == 0 || (uVar10 = RNG::RandomInt((RNG *)local_d0.y,5), uVar10 == 0)))) { HandleCollision(pEVar25,10,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); } else { uVar10 = RNG::RandomInt((RNG *)pAVar14,2); if (uVar10 == 0) { HandleCollision(pEVar25,0x1e,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); } else { HandleCollision(pEVar25,0x28,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); } } } else { uVar10 = RNG::RandomInt((RNG *)pAVar14,2); if (uVar10 == 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,2); if (uVar10 != 0) { LAB_0065facd: HandleCollision(pEVar25,300,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); break; } uVar10 = RNG::RandomInt((RNG *)pAVar14,5); local_b0.y = (float)(uVar10 + 0x16); Game::GetPlayerManager(g_game); cVar5 = FUN_0060d1c0(0x1f); if (cVar5 == '\0') { Game::GetPlayerManager(g_game); cVar5 = FUN_0065cfe0(10); if (cVar5 != '\0') goto LAB_0065fdc3; } else { LAB_0065fdc3: itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar10 = RNG::Next((RNG *)pAVar14); local_b0.y = (float)ItemPool::GetCollectible(itemPool,10,uVar10,0,0,0); } uVar10 = RNG::Next((RNG *)pAVar14); tmpVec = (Vector *)FUN_006653c0(&local_a0); pAVar14 = (ANM2 *)local_b0.y; } else { uVar10 = RNG::Next((RNG *)pAVar14); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar11 = RNG::Next((RNG *)local_c0.y); pAVar14 = (ANM2 *)ItemPool::GetCollectible(itemPool,10,uVar11,0,0,0); tmpVec = (Vector *)FUN_006653c0(&local_a0); } Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,(uint)pAVar14,uVar10); pEVar25 = savedSlot; *(undefined4 *)&savedSlot[1].field_0x4 = 4; ANM2::Play(&savedSlot->_sprite,(byte *)"Teleport",0); level = (Level *)Config::GetCollectibles(); Level::SetStateFlag(level,3,1); } } break; case 5: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); local_b0.y = (float)&pEVar25->_pos; local_b8.x = g_vectorZero.x; iVar8 = 0; local_b8.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector(&local_f0,uVar10); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&local_e8,&local_a0.y); Vector::operator_assign(&local_b8,tmpVec); local_b8.y = local_b8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_c8,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_d0,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); fVar28 = local_c0.y; if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::RandomInt((RNG *)local_c0.y,2); if (uVar10 == 0) { uVar10 = RNG::RandomInt((RNG *)fVar28,2); pEVar25 = savedSlot; if (uVar10 == 0) { HandleCollision(savedSlot,0x46,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); } else { HandleCollision(savedSlot,300,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); } } else { uVar10 = RNG::RandomInt((RNG *)fVar28,4); if (uVar10 == 0) { uVar10 = RNG::Next((RNG *)fVar28); LAB_0065fc5e: Game::Spawn(g_game,5,0x15e,(Vector *)local_b0.y,&local_b8,(Entity *)0x0,0,uVar10); goto LAB_0065f5b0; } uVar10 = RNG::Next((RNG *)fVar28); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar11 = RNG::Next((RNG *)local_c0.y); uVar11 = ItemPool::GetCollectible(itemPool,0xb,uVar11,0,0,0); tmpVec = (Vector *)FUN_006653c0(&local_a0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,uVar11,uVar10); pEVar25 = savedSlot; *(undefined4 *)&savedSlot[1].field_0x4 = 4; ANM2::Play(&savedSlot->_sprite,(byte *)"Teleport",0); level = (Level *)Config::GetCollectibles(); Level::SetStateFlag(level,4,1); } } break; case 6: case 0xf: ANM2::Play(&pEVar25->_sprite, (&PTR_s_Shell1Prize_00b64c30)[*(short *)((int)&pEVar25[1]._damageEvents._end + 2)],0) ; bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,3); if (((uVar10 == 0) || ((bVar4 = Entity_Player::HasCollectible((Entity_Player *)local_e0.y,0x2e,0), bVar4 != 0 && (uVar10 = RNG::RandomInt((RNG *)local_e8.y,3), uVar10 == 0)))) || ((bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x4c,0), bVar4 != 0 && (uVar10 = RNG::RandomInt((RNG *)local_e8.y,0x14), uVar10 == 0)))) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); pvVar17 = pEVar25[1]._damageEvents._begin; local_d0.y = 1.4013e-45; if (pvVar17 == (void *)0x14) { uVar10 = RNG::RandomInt((RNG *)pAVar14,2); local_d0.y = (float)(uVar10 + 2); } else if (pvVar17 != (void *)0x64) { local_a0.y = 2.8026e-45; local_d8.y = (float)RNG::RandomInt((RNG *)pAVar14,3); pfVar15 = (float *)FUN_0040cdc0(); local_d0.y = *pfVar15; } pvVar17 = pEVar25[1]._damageEvents._begin; if (pvVar17 == (void *)0x0) { Vector::Vector(&local_d8, (float)(*(short *)((int)&pEVar25[1]._damageEvents._end + 2) + -1) * 37.0, 5.0); fVar28 = local_e0.y; if ((RNG *)local_d0.y != (RNG *)0x0) { local_a0.y = (float)&pEVar25->_pos; pRVar26 = (RNG *)local_d0.y; do { pVVar20 = &g_vectorZero; tmpVec = Vector::__add((Vector *)local_a0.y,&local_b8,&local_d8); Entity_Player::ThrowBlueSpider((Entity_Player *)fVar28,tmpVec,pVVar20); pRVar26 = (RNG *)((int)&pRVar26[-1]._shift3 + 3); } while (pRVar26 != (RNG *)0x0); pEVar25 = savedSlot; } } else if (pvVar17 == (void *)0x64) { if (pEVar25->_variant == 0xf) { uVar10 = RNG::Next((RNG *)pAVar14); fVar28 = pEVar25[1]._sprite._championColor._colorize[2]; tmpVec = (Vector *)FUN_006653c0(local_4c + 0x10); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,(uint)fVar28,uVar10); itemPool = (ItemPool *)Game::GetItemPool(g_game); pEVar25 = savedSlot; ItemPool::RemoveCollectible (itemPool,(int)savedSlot[1]._sprite._championColor._colorize[2],0,0); } else { uVar10 = RNG::Next((RNG *)pAVar14); tmpVec = (Vector *)FUN_006653c0(local_4c + 0x10); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,9,uVar10); pEVar25 = savedSlot; } *(undefined4 *)&pEVar25[1].field_0x4 = 4; ANM2::Play(&pEVar25->_sprite,(byte *)"Teleport",0); } else { local_c8.y = 0.0; if (pvVar17 == (void *)0xa) { if (pEVar25->_variant != 0xf) goto LAB_00660ed1; local_c8.y = (float)&DAT_00000006; local_d0.y = 1.4013e-45; } else if (pvVar17 == (void *)0x12c) { local_d0.y = 1.4013e-45; } else { LAB_00660ed1: if ((RNG *)local_d0.y == (RNG *)0x0) goto LAB_0066113f; } local_e8.y = (float)&pEVar25->_pos; do { EntityPtr::clear((EntityPtr *)&local_b8); EntityPtr::clear((EntityPtr *)&local_f0); local_b0.y = 0.0; do { tmpVec = Vector::Vector(&local_c0, (float)(*(short *)((int)&pEVar25[1]._damageEvents._end + 2) + -1) * 4.0,4.0); pVVar20 = MusicManager::RandomVector(&local_e0); local_a0.y = 2.0; pVVar20 = Vector::__mul(pVVar20,(Vector *)&local_f8,&local_a0.y); tmpVec = Vector::__add(tmpVec,&local_110,pVVar20); Vector::operator_assign(&local_b8,tmpVec); tmpVec = Vector::Vector(&local_108, (float)(*(short *)((int)&savedSlot[1]._damageEvents._end + 2) + -1) * 37.0,5.0); Vector::operator_assign(&local_f0,tmpVec); room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_100,&local_d8.y); tmpVec = Vector::__add((Vector *)local_e8.y,&VStack_54,tmpVec); pVVar20 = Vector::__add((Vector *)local_e8.y,(Vector *)(local_4c + 0x10),&local_f0); bVar4 = Room::CheckLine(room,pVVar20,tmpVec,1,0,0,0,(Vector *)0x0); pEVar25 = savedSlot; if (bVar4 != 0) break; local_b0.y = (float)((int)((std_string *)local_b0.y)->_buf + 1); } while ((uint)local_b0.y < (ANM2 *)0xa); HandleCollision(savedSlot,savedSlot[1]._damageEvents._begin,local_c8.y,local_a8.y, &prizeRng,&local_f0,&local_b8); local_d0.y = (float)((int)&((RNG *)((int)local_d0.y + -0x10))->_shift3 + 3); } while ((RNG *)local_d0.y != (RNG *)0x0); local_d0.y = 0.0; } } else { SoundEffects::PlayWithFartOverride(0xbb,1.0,2,0,1.0); tmpVec = Vector::Vector(&local_f0, (float)(*(short *)((int)&pEVar25[1]._damageEvents._end + 2) + -1) * 4.0,4.0); pVVar20 = MusicManager::RandomVector(&local_e8); local_a0.y = 2.0; pVVar20 = Vector::__mul(pVVar20,&local_b0,&local_a0.y); Vector::__add(tmpVec,&local_b8,pVVar20); pEVar25 = savedSlot; Vector::Vector(&local_d8, (float)(*(short *)((int)&savedSlot[1]._damageEvents._end + 2) + -1) * 37.0, 5.0); if (pEVar25->_variant == 0xf) { local_a0.x = g_vectorZero.x; local_a0.y = g_vectorZero.y; tmpVec = Vector::__add(&pEVar25->_pos,&local_f0,&local_d8); targetPos.y = local_a0.y; targetPos.x = local_a0.x; Entity_NPC::ThrowSpider(tmpVec,(Entity *)0x0,targetPos,0,-30.0); } else { local_a0.y = (float)&pEVar25->_pos; uVar10 = RNG::Next((RNG *)pAVar14); tmpVec = Vector::__add((Vector *)local_a0.y,&local_f0,&local_d8); Game::Spawn(g_game,0x12,0,tmpVec,&local_b8,(Entity *)0x0,0,uVar10); pEVar25 = savedSlot; } } } LAB_0066113f: bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty); if (bVar4 != 0) { *(undefined4 *)&pEVar25[1].field_0x4 = 1; ANM2::Play(&pEVar25->_sprite,s_Idle,0); } break; case 7: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); uVar10 = RNG::RandomInt((RNG *)pAVar14,8); if ((uVar10 != 0) && (*(char *)&pEVar25[1]._damageEvents._end == '\0')) { local_b0.y = (float)&pEVar25->_pos; local_b8.x = g_vectorZero.x; iVar8 = 0; local_b8.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector((Vector *)(local_4c + 0x10),uVar10); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&VStack_54,&local_a0.y); Vector::operator_assign(&local_b8,tmpVec); local_b8.y = local_b8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_100,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_108,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::Next((RNG *)local_c0.y); local_a0.y = 5.0; tmpVec = Vector::__mul(&local_b8,(Vector *)(local_4c + 0x10),&local_a0.y); uVar11 = RNG::RandomInt((RNG *)local_c0.y,3); Game::Spawn(g_game,5,*(uint *)(&DAT_00b62fd0 + uVar11 * 4),(Vector *)local_b0.y,tmpVec, (Entity *)0x0,0,uVar10); goto LAB_0065f5b0; } local_b0.y = (float)&pEVar25->_pos; local_b8.x = g_vectorZero.x; iVar8 = 0; local_b8.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector((Vector *)(local_4c + 0x10),uVar10); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&VStack_54,&local_a0.y); Vector::operator_assign(&local_b8,tmpVec); local_b8.y = local_b8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_100,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_108,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); pEVar25 = savedSlot; if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); pRVar26 = &savedSlot->_dropRNG; if ((*(char *)&(((Entity *)(savedSlot + 1))->_damageEvents)._end == '\0') && (uVar10 = RNG::RandomInt(pRVar26,2), uVar10 == 0)) { itemPool = (ItemPool *)Game::GetItemPool(g_game); cVar5 = ItemPool::RemoveTrinket(itemPool,0x13); if (cVar5 == '\0') goto LAB_0066148d; uVar10 = RNG::Next(pRVar26); Game::Spawn(g_game,5,0x15e,&pEVar25->_pos,&local_b8,(Entity *)pEVar25,0x13,uVar10); } else { LAB_0066148d: local_a0.y = (float)RNG::Next(pRVar26); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar10 = RNG::Next(pRVar26); uVar10 = ItemPool::GetCollectible(itemPool,0xd,uVar10,0,0,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Vector::Vector((Vector *)(local_4c + 0x10),0.0,80.0); tmpVec = Vector::__add((Vector *)local_b0.y,&VStack_54,tmpVec); tmpVec = Room::FindFreePickupSpawnPosition(room,&local_100,tmpVec,0.0,0,0,0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,uVar10,(uint)local_a0.y); pEVar25 = savedSlot; } *(undefined1 *)&pEVar25[1]._damageEvents._end = 0; *(undefined4 *)&pEVar25[1].field_0x4 = 4; ANM2::Play(&pEVar25->_sprite,(byte *)"Teleport",0); } break; case 8: local_c8.y = (float)&pEVar25->_sprite; pAVar21 = (AnimationState *)FUN_0041e470(); bVar4 = AnimationState::IsEventTriggered(pAVar21,(byte *)"CoinInsert"); if (bVar4 != 0) { *(undefined4 *)&pEVar25[1].field_0x4 = 1; uVar10 = FUN_00424e60(0x14); local_a8.y = (float)(uVar10 % 1000); PersistentGameData::IncreaseEventCounter ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x14,1); pAVar24 = (ANM2 *)((int)local_a8.y + 1); local_a8.y = (float)pAVar24; ANM2::SetFrame((ANM2 *)local_c8.y,(std_string *)"Prize",0); ANM2::SetLayerFrame((ANM2 *)local_c8.y,1,((int)pAVar24 / 100) % 10); ANM2::SetLayerFrame((ANM2 *)local_c8.y,2,((int)pAVar24 / 10) % 10); ANM2::SetLayerFrame((ANM2 *)local_c8.y,3,(int)((int)local_a8.y + ((int)pAVar24 / 10) * -10)); uVar10 = RNG::RandomInt((RNG *)pAVar14,0x32); fVar28 = local_e0.y; if (uVar10 == 0) { Entity_Player::DonateLuck((Entity_Player *)local_e0.y,1); } bVar4 = Entity_Player::HasTrinket((Entity_Player *)fVar28,0x55,0); if ((bVar4 == 0) || (uVar10 = RNG::RandomInt((RNG *)pAVar14,3), uVar10 != 0)) { LAB_006616a8: pEVar25 = savedSlot; } else { local_a0.y = RNG::RandomFloat((RNG *)pAVar14); if (local_a0.y < 0.4) { iVar8 = Entity_Player::GetTrinketMultiplier((Entity_Player *)fVar28,0x55); Entity_Player::AddCoins((Entity_Player *)fVar28,iVar8); goto LAB_006616a8; } if (local_a0.y < 0.8) { unk2 = 0; bVar4 = 0; iVar8 = Entity_Player::GetTrinketMultiplier((Entity_Player *)fVar28,0x55); Entity_Player::AddHearts((Entity_Player *)fVar28,iVar8 * 2,bVar4,unk2); goto LAB_006616a8; } if (local_a0.y < 0.95) { iVar8 = Entity_Player::GetTrinketMultiplier((Entity_Player *)fVar28,0x55); Entity_Player::DonateLuck((Entity_Player *)fVar28,iVar8); goto LAB_006616a8; } local_a0.y = (float)RNG::Next((RNG *)pAVar14); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar25 = savedSlot; tmpVec = Vector::Vector((Vector *)(local_4c + 0x10),0.0,40.0); tmpVec = Vector::__add(&pEVar25->_pos,&VStack_54,tmpVec); tmpVec = Room::FindFreePickupSpawnPosition(room,&local_100,tmpVec,0.0,0,0,0); Game::Spawn(g_game,6,4,tmpVec,&g_vectorZero,(Entity *)pEVar25,0,(uint)local_a0.y); pAVar14 = (ANM2 *)&pEVar25->_dropRNG; } Game::DonateAngel(g_game,1); Game::DonateGreed(g_game,1); if (9 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x86); } if (0x13 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x97); } if (0x31 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x87); } if (99 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x98); } if (0x95 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x88); } if (199 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x99); } if (399 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x89); } if (599 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x9a); } if (899 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x3b); } if (0x3e6 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x8a); } if (999 < (int)local_a8.y) { uVar10 = Random(); local_b0.y = (float)&pEVar25->_pos; Game::Spawn(g_game,1000,1,(Vector *)local_b0.y,&g_vectorZero,(Entity *)0x0,0,uVar10); ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); *(undefined4 *)&pEVar25[1].field_0x4 = 3; local_e8.y = (float)&DAT_0000000f; do { iVar8 = 0; local_b8.x = g_vectorZero.x; local_b8.y = g_vectorZero.y; do { tmpVec = MusicManager::RandomVector((Vector *)(local_4c + 0x10)); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&VStack_54,&local_a0.y); Vector::operator_assign(&local_b8,tmpVec); local_b8.y = local_b8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_100,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_108,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); pAVar14 = (ANM2 *)local_c0.y; if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::Next((RNG *)local_c0.y); Game::Spawn(g_game,5,0x14,(Vector *)local_b0.y,&local_b8,(Entity *)0x0,3,uVar10); local_e8.y = (float)((int)&((ANM2 *)((int)local_e8.y + -0x114))->_bitflags + 3); } while ((ANM2 *)local_e8.y != (ANM2 *)0x0); Game::SetStateFlag(0x11,1); } pEVar25 = savedSlot; if ((ANM2 *)local_a8.y == (ANM2 *)0x3e7) { *(undefined2 *)((int)&savedSlot[1]._pendingDamageFlags + 6) = 0; uVar7 = 0x14; } else { local_e8.y = 0.0; local_b0.y = (float)(0xf - *(ushort *)((int)&savedSlot[1]._pendingDamageFlags + 6) / 10); puVar19 = (undefined2 *)std::max(); uVar7 = *puVar19; } *(undefined2 *)&pEVar25[1]._damageEvents._capacity = uVar7; SoundEffects::PlayWithFartOverride(0x18,1.0,2,0,1.0); iVar8 = Game::GetDonationModGreed(g_game); local_d0.y = (float)(iVar8 * 3); local_a0.y = (float)Entity_Player::GetTrinketMultiplier((Entity_Player *)local_e0.y,0x55); piVar16 = (int *)std_min_ptr(); local_d0.y = (float)((int)local_d0.y - *piVar16); if (*(int *)&pEVar25[1].field_0x4 != 3) { uVar10 = RNG::RandomInt((RNG *)pAVar14,3000); if (uVar10 < (uint)((int)local_d0.y * 3)) { bVar4 = 0; pbVar9 = (byte *)FUN_0065d1f0(); ANM2::Play(&pEVar25->_sprite,pbVar9,bVar4); uVar18 = 0x12; LAB_00661b4b: Game::SetStateFlag(uVar18,1); *(undefined4 *)&pEVar25[1].field_0x4 = 3; } } } break; case 9: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); pvVar17 = pEVar25[1]._damageEvents._begin; if ((pvVar17 == (void *)0x1) || (pvVar17 == (void *)0x2)) { local_c8.y = 1.4013e-44; local_b0.y = 1.4013e-45; if ((pvVar17 == (void *)0x1) || ((bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x16,0), bVar4 != 0 && (uVar10 = RNG::RandomInt((RNG *)local_d0.y,5), uVar10 != 0)))) { local_c8.y = (float)&DAT_00000014; uVar10 = RNG::RandomInt((RNG *)pAVar14,3); local_b0.y = (float)(uVar10 + 1); if ((int)local_b0.y < 1) break; } fVar28 = local_a8.y; do { HandleCollision(pEVar25,local_c8.y,0,fVar28,&prizeRng,&g_vectorZero,&g_vectorZero); local_b0.y = (float)((int)&((ANM2 *)((int)local_b0.y + -0x114))->_bitflags + 3); } while ((ANM2 *)local_b0.y != (ANM2 *)0x0); local_b0.y = 0.0; } else { uVar10 = RNG::Next((RNG *)pAVar14); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar11 = RNG::Next((RNG *)local_c0.y); uVar11 = ItemPool::GetCollectible(itemPool,0x19,uVar11,0,0,0); tmpVec = (Vector *)FUN_006653c0(&local_a0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,uVar11,uVar10); pEVar25 = savedSlot; *(undefined4 *)&savedSlot[1].field_0x4 = 4; ANM2::Play(&savedSlot->_sprite,(byte *)"Teleport",0); } } break; case 10: pAVar21 = (AnimationState *)FUN_0041e470(); bVar4 = AnimationState::IsEventTriggered(pAVar21,(byte *)"CoinInsert"); if (bVar4 != 0) { fVar28 = pEVar25[1]._pendingDamage; *(undefined4 *)&pEVar25[1].field_0x4 = 1; if (fVar28 == 0.0) { uVar10 = 4; LAB_00662124: uVar10 = RNG::RandomInt((RNG *)pAVar14,uVar10); local_f8._4_4_ = (ANM2 *)CONCAT13(uVar10 == 0,local_f8._4_3_); } else { if (fVar28 == 1.4013e-45) { uVar10 = 3; goto LAB_00662124; } if (fVar28 == 2.8026e-45) { uVar10 = 2; goto LAB_00662124; } uVar10 = RNG::RandomInt((RNG *)pAVar14,4); local_f8._4_4_ = (ANM2 *)CONCAT13(uVar10 != 0,local_f8._4_3_); } bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x4c,0); if (((bVar4 == 0) || (uVar10 = RNG::RandomInt((RNG *)pAVar14,0x14), uVar10 != 0)) && (local_f8._7_1_ == '\0')) { pEVar25[1]._pendingDamage = (float)((int)pEVar25[1]._pendingDamage + 1); } else { *(int *)&pEVar25[1]._pendingDamageFlags = (int)pEVar25[1]._pendingDamageFlags + 1; pEVar25[1]._pendingDamage = 0.0; bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_e0.y,0x70,0); if (bVar4 == 0) { uVar10 = 2; } else { iVar8 = Entity_Player::GetTrinketMultiplier((Entity_Player *)local_e0.y,0x70); uVar10 = iVar8 + 1; } if (((uint)pEVar25[1]._pendingDamageFlags < 5) || (uVar10 = RNG::RandomInt((RNG *)pAVar14,uVar10), uVar10 != 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::ShopRestockFull(room); } else { uVar10 = Random(); Game::Spawn(g_game,1000,1,&pEVar25->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); spawn_break_drops(pEVar25); *(undefined4 *)&pEVar25[1].field_0x4 = 3; ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); } } uVar7 = 0xf; LAB_00662215: *(undefined2 *)&pEVar25[1]._damageEvents._capacity = uVar7; SoundEffects::PlayWithFartOverride(0x18,1.0,2,0,1.0); } break; case 0xb: local_c8.y = (float)&pEVar25->_sprite; pAVar21 = (AnimationState *)FUN_0041e470(); bVar4 = AnimationState::IsEventTriggered(pAVar21,(byte *)"CoinInsert"); if (bVar4 != 0) { *(undefined4 *)&pEVar25[1].field_0x4 = 1; uVar10 = FUN_00424e60(0x73); local_a8.y = (float)(uVar10 % 1000); if (*(char *)(pEVar25[1]._sprite._championColor._colorize + 3) != '\0') { iVar8 = Entity_Player::GetPlayerType((Entity_Player *)local_e0.y); if (iVar8 < 0x29) { persistentData = (PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0]; Entity_Player::GetPlayerType((Entity_Player *)local_e0.y); iVar8 = FUN_00929b20(); PersistentGameData::IncreaseEventCounter(persistentData,iVar8,1); pEVar25 = savedSlot; } PersistentGameData::IncreaseEventCounter ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x73,1); local_a8.y = (float)((int)((std_string *)local_a8.y)->_buf + 1); } fVar28 = local_a8.y; ANM2::SetFrame((ANM2 *)local_c8.y,(std_string *)"Prize",0); ANM2::SetLayerFrame((ANM2 *)local_c8.y,1,((int)fVar28 / 100) % 10); iVar8 = (int)fVar28 / 10; ANM2::SetLayerFrame((ANM2 *)local_c8.y,2,iVar8 % 10); ANM2::SetLayerFrame((ANM2 *)local_c8.y,3,(int)((int)local_a8.y + iVar8 * -10)); pEVar25 = savedSlot; if (1 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *) (((Entity *)(savedSlot + 1))->_sprite)._championColor._offset[0],0xf2); } if (0xd < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *) (((Entity *)(pEVar25 + 1))->_sprite)._championColor._offset[0],0xf3); } if (0x20 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *) (((Entity *)(pEVar25 + 1))->_sprite)._championColor._offset[0],0xf4); } if (0x43 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *) (((Entity *)(pEVar25 + 1))->_sprite)._championColor._offset[0],0xf5); } if ((int)local_a8.y < 999) { if (0x6e < (int)local_a8.y) goto LAB_00661da8; } else { bVar4 = PersistentGameData::TryUnlock ((PersistentGameData *) (((Entity *)(pEVar25 + 1))->_sprite)._championColor._offset[0],0x113); if (bVar4 != 0) { uVar10 = Random(); uVar32 = 0; pTVar31 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar30 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar12 = Game::Spawn(g_game,1000,0x68,&pEVar25->_pos,&g_vectorZero,(Entity *)pEVar25,0, uVar10); effect = (Entity_Effect *)__RTDynamicCast(pEVar12,uVar18,pTVar30,pTVar31,uVar32); Entity_Effect::SetTimeout(effect,0x1c2); tmpVec = Vector::Vector((Vector *)(local_4c + 0x10),0.0,-80.0); Entity::SetPositionOffset((Entity *)effect,tmpVec); (**(code **)(*(int *)effect + 0xc))(); pEVar25 = savedSlot; } LAB_00661da8: PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0xf6); } if (0xe9 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0xf7); } if (0x1b6 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0xf8); } if (499 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x155); } if (0x299 < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0xf9); } if (0x36e < (int)local_a8.y) { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0xfa); } if ((int)local_a8.y < 1000) { if ((ANM2 *)local_a8.y != (ANM2 *)0x3e7) goto LAB_00661fe0; *(undefined2 *)((int)&pEVar25[1]._pendingDamageFlags + 6) = 0; uVar7 = 0x14; } else { PersistentGameData::TryUnlock ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0xfb); uVar10 = Random(); local_b0.y = (float)&pEVar25->_pos; Game::Spawn(g_game,1000,1,(Vector *)local_b0.y,&g_vectorZero,(Entity *)0x0,0,uVar10); ANM2::Play(&pEVar25->_sprite,(byte *)"Death",0); *(undefined4 *)&pEVar25[1].field_0x4 = 3; local_e8.y = 2.10195e-44; do { iVar8 = 0; local_c8.x = g_vectorZero.x; local_c8.y = g_vectorZero.y; do { tmpVec = MusicManager::RandomVector((Vector *)(local_4c + 0x10)); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&VStack_54,&local_a0.y); Vector::operator_assign(&local_c8,tmpVec); local_c8.y = local_c8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_c8,&local_100,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_108,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); pAVar14 = (ANM2 *)local_c0.y; if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::Next((RNG *)local_c0.y); Game::Spawn(g_game,5,0x14,(Vector *)local_b0.y,&local_c8,(Entity *)0x0,3,uVar10); local_e8.y = (float)((int)local_e8.y + -1); } while (local_e8.y != 0.0); pEVar25 = savedSlot; LAB_00661fe0: local_e8.y = 0.0; local_b0.y = (float)(0xf - *(ushort *)((int)&pEVar25[1]._pendingDamageFlags + 6) / 10); puVar19 = (undefined2 *)std::max(); uVar7 = *puVar19; } *(undefined2 *)&pEVar25[1]._damageEvents._capacity = uVar7; SoundEffects::PlayWithFartOverride(0x18,1.0,2,0,1.0); local_a0.y = Entity_Player::GetGreedDonationJamChance ((Entity_Player *)local_e0.y, (PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0]); if (*(int *)&pEVar25[1].field_0x4 != 3) { local_d8.y = RNG::RandomFloat((RNG *)pAVar14); local_d8.y = local_d8.y * 100.0; if (local_d8.y < local_a0.y) { bVar4 = 0; pbVar9 = (byte *)FUN_0065d1f0(); ANM2::Play(&pEVar25->_sprite,pbVar9,bVar4); uVar18 = 0x22; goto LAB_00661b4b; } } } break; default: KAGE_LogMessage(1,(byte *)"Slot type %d is not implemented!\n"); break; case 0xd: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,0x10); if (uVar10 == 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar10 = RNG::Next((RNG *)pAVar14); uVar10 = ItemPool::GetCollectible(itemPool,0xe,uVar10,0,0x25b,0); uVar11 = RNG::Next((RNG *)local_c0.y); tmpVec = (Vector *)FUN_006653c0(&local_a0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,uVar10,uVar11); pEVar25 = savedSlot; *(undefined4 *)&savedSlot[1].field_0x4 = 4; ANM2::Play(&savedSlot->_sprite,(byte *)"Teleport",0); level = (Level *)Config::GetCollectibles(); Level::SetStateFlag(level,3,1); PersistentGameData::IncreaseEventCounter ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0],0x1ef,1); pEVar25[1]._pendingDamage = 0.0; } else { uVar10 = RNG::RandomInt((RNG *)pAVar14,8); if (uVar10 == 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); local_c8.y = (float)&pEVar25->_pos; local_b8.x = g_vectorZero.x; iVar8 = 0; local_b8.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector(&local_f0,uVar10); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&local_e8,&local_a0.y); Vector::operator_assign(&local_b8,tmpVec); local_b8.y = local_b8.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_b8,&local_b0,&local_d8.y); tmpVec = Vector::__add((Vector *)local_c8.y,&local_d0,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_c8.y,tmpVec,1,0,0,0,(Vector *)0x0); fVar28 = local_c0.y; if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::RandomInt((RNG *)local_c0.y,10); if (uVar10 == 0) { itemPool = (ItemPool *)Game::GetItemPool(g_game); cVar5 = ItemPool::RemoveTrinket(itemPool,3); if (cVar5 == '\0') goto LAB_00660524; uVar10 = RNG::Next((RNG *)fVar28); fVar28 = 4.2039e-45; LAB_006604ee: tmpVec = &local_b8; pAVar14 = (ANM2 *)local_c8.y; LAB_006604fd: Game::Spawn(g_game,5,0x15e,(Vector *)pAVar14,tmpVec,(Entity *)0x0,(uint)fVar28,uVar10); savedSlot[1]._pendingDamage = 0.0; pEVar25 = savedSlot; } else { LAB_00660524: uVar10 = RNG::RandomInt((RNG *)fVar28,10); if (uVar10 == 0) { itemPool = (ItemPool *)Game::GetItemPool(g_game); cVar5 = ItemPool::RemoveTrinket(itemPool,0x48); if (cVar5 != '\0') { uVar10 = RNG::Next((RNG *)fVar28); fVar28 = 1.00893e-43; goto LAB_006604ee; } } pEVar25 = savedSlot; HandleCollision(savedSlot,0x5a,0,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); pEVar25[1]._pendingDamage = 0.0; } } else { local_4c[0] = '\x01'; local_4c[1] = '\0'; local_4c[2] = '\0'; local_4c[3] = '\0'; local_4c[4] = '\x01'; local_4c[5] = '\0'; local_4c[6] = '\0'; local_4c[7] = '\0'; local_4c[8] = '\x01'; local_4c[9] = '\0'; local_4c[10] = '\0'; local_4c[0xb] = '\0'; local_4c[0xc] = '\x02'; local_4c[0xd] = '\0'; local_4c[0xe] = '\0'; local_4c[0xf] = '\0'; local_4c._16_4_ = 2; local_38 = 3; uVar10 = RNG::RandomInt((RNG *)pAVar14,6); fVar28 = local_e0.y; uVar11 = 0; local_a0.y = *(float *)(local_4c + uVar10 * 4); do { iVar8 = Entity_Player::GetActiveMaxCharge((Entity_Player *)fVar28,uVar11); if (iVar8 == 0) { if (0 < (int)local_a0.y) { effect = Entity_Effect::CreateTimer (&LAB_0065d930,(uint)(0x14 / (longlong)(int)local_a0.y), (uint)local_a0.y,1); Entity::SetParent((Entity *)effect,(Entity *)fVar28); (**(code **)(*(int *)effect + 0xc))(); } break; } uVar11 = uVar11 + 1; } while (uVar11 < 4); Entity_Player::AnimateHappy((Entity_Player *)fVar28); SoundEffects::PlayWithFartOverride(0xaa,1.0,2,0,1.0); uVar10 = Random(); tmpVec = Entity::Position((Entity *)fVar28,&local_a0); uVar32 = 0; pTVar31 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar30 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; pEVar12 = Game::Spawn(g_game,1000,0x31,tmpVec,&g_vectorZero,(Entity *)0x0,1,uVar10); pvVar17 = (void *)__RTDynamicCast(pEVar12,uVar18,pTVar30,pTVar31,uVar32); tmpVec = Vector::Vector(&local_d8,0.0,-24.0); FUN_004563c0(tmpVec); set_field_358(pvVar17,1.0); pEVar25 = savedSlot; LAB_006606b2: pEVar25[1]._pendingDamage = 0.0; } } } break; case 0xe: (**(code **)(*(int *)pEVar25 + 0x28))(); PlayerManager::unlock_completion_mark(0xf); guard_check_icall(); ExceptionList = local_1c; return; case 0x10: case 0x11: break; case 0x12: ANM2::Play(&pEVar25->_sprite,(byte *)"Prize",0); bVar4 = Sprite::IsEventTriggered((Sprite *)&pEVar25->_sprite,"Prize"); if (bVar4 != 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,0x18); if (uVar10 == 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar10 = RNG::Next((RNG *)pAVar14); uVar10 = ItemPool::GetCollectible(itemPool,0x1e,uVar10,0,0x1a,0); uVar11 = RNG::Next((RNG *)local_c0.y); tmpVec = (Vector *)FUN_006653c0(&local_a0); Game::Spawn(g_game,5,100,tmpVec,&g_vectorZero,(Entity *)0x0,uVar10,uVar11); pEVar25 = savedSlot; *(undefined4 *)&savedSlot[1].field_0x4 = 4; ANM2::Play(&savedSlot->_sprite,(byte *)"Teleport",0); level = (Level *)Config::GetCollectibles(); Level::SetStateFlag(level,3,1); pEVar25[1]._pendingDamage = 0.0; } else { uVar10 = RNG::RandomInt((RNG *)pAVar14,4); if (uVar10 == 0) { uVar10 = RNG::RandomInt((RNG *)pAVar14,6); if (uVar10 == 0) { bVar4 = PersistentGameData::Unlocked ((PersistentGameData *)pEVar25[1]._sprite._championColor._offset[0], 0x187); if (bVar4 == 0) goto LAB_006608b1; SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); HandleCollision(pEVar25,10,0xb,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); pEVar25[1]._pendingDamage = 0.0; } else { if ((2 < uVar10 - 1) || (bVar4 = PersistentGameData::Unlocked ((PersistentGameData *) pEVar25[1]._sprite._championColor._offset[0],0x19b), bVar4 == 0)) { LAB_006608b1: uVar11 = 7; local_5c[0] = 4.06377e-44; local_5c[1] = 1.31722e-43; VStack_54.x = 9.94922e-44; VStack_54.y = 1.76564e-43; uVar10 = EntityPtr::Ref(); RNG::game_constructor((RNG *)(local_4c + 8),uVar10,uVar11); local_14._0_1_ = 3; local_b0.y = (float)RNG::RandomInt(this_02,8); local_14 = (uint)local_14._1_3_ << 8; guard_check_icall(); if ((ANM2 *)&DAT_00000004 <= (uint)local_b0.y) { LAB_00660a66: Color::Color(&tmpColor); fVar28 = local_e0.y; Game::Fart(g_game,&pEVar25->_pos,85.0,(Entity *)local_e0.y,1.0,0,color); Game::ButterBeanFart(g_game,&pEVar25->_pos,120.0,(Entity *)fVar28,0,0); savedSlot[1]._pendingDamage = 0.0; pEVar25 = savedSlot; break; } itemPool = (ItemPool *)Game::GetItemPool(g_game); local_b8.y = local_5c[(int)local_b0.y]; cVar5 = ItemPool::RemoveTrinket(itemPool,local_b8.y); if (cVar5 == '\0') goto LAB_00660a66; SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); local_b0.y = (float)&pEVar25->_pos; local_f0.x = g_vectorZero.x; iVar8 = 0; local_f0.y = g_vectorZero.y; do { uVar10 = RNG::Next(&prizeRng); tmpVec = RandomVector(&local_e8,uVar10); local_a0.y = 5.0; tmpVec = Vector::__mul(tmpVec,&local_c8,&local_a0.y); Vector::operator_assign(&local_f0,tmpVec); local_f0.y = local_f0.y * 0.2 + 3.0; room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_d8.y = 7.0; tmpVec = Vector::__mul(&local_f0,&local_d0,&local_d8.y); tmpVec = Vector::__add((Vector *)local_b0.y,&local_a8,tmpVec); bVar4 = Room::CheckLine(room,(Vector *)local_b0.y,tmpVec,1,0,0,0,(Vector *)0x0); if (bVar4 != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < 10); uVar10 = RNG::Next((RNG *)local_c0.y); tmpVec = &local_f0; pAVar14 = (ANM2 *)local_b0.y; fVar28 = local_b8.y; goto LAB_006604fd; } SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); HandleCollision(pEVar25,10,0xc,local_a8.y,&prizeRng,&g_vectorZero,&g_vectorZero); pEVar25[1]._pendingDamage = 0.0; } } else { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); pEVar12 = (Entity *)RNG::RandomInt((RNG *)pAVar14,2); if (pEVar12 == (Entity *)0x0) { tmpVec = &pEVar25->_pos; uVar10 = RNG::RandomInt((RNG *)pAVar14,3); Entity_Player::AddBlueFlies((Entity_Player *)local_e0.y,uVar10 + 1,tmpVec,pEVar12); pEVar25[1]._pendingDamage = 0.0; } else { uVar10 = RNG::RandomInt((RNG *)pAVar14,3); fVar28 = local_e0.y; iVar8 = uVar10 + 1; if (iVar8 < 1) goto LAB_006606b2; local_a0.y = (float)&pEVar25->_pos; do { Entity_Player::ThrowBlueSpider ((Entity_Player *)fVar28,(Vector *)local_a0.y,&g_vectorZero); iVar8 = iVar8 + -1; } while (iVar8 != 0); savedSlot[1]._pendingDamage = 0.0; pEVar25 = savedSlot; } } } } break; case 0x13: pAVar21 = (AnimationState *)FUN_0041e470(); bVar4 = AnimationState::IsEventTriggered(pAVar21,(byte *)"CoinInsert"); if (bVar4 != 0) { *(undefined4 *)&pEVar25[1].field_0x4 = 1; FUN_00704b50(1); iVar8 = FUN_0065d010(); game = g_game; if (iVar8 < 1) { *(undefined2 *)((int)&pEVar25[1]._pendingDamageFlags + 6) = 0; playerManager = (PlayerManager *)Game::GetPlayerManager(game); iVar8 = PlayerManager::GetNumCoopPlayers(playerManager); if (iVar8 == 1) { SoundEffects::PlayWithFartOverride(0x36,1.0,2,0,1.0); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); PlayerManager::revive_player_ghosts(playerManager); FUN_0065d040(1); pvVar17 = (void *)FUN_0065d090(); Player_stats_add(pvVar17,0xc,(Entity_Player *)local_e0.y,1.0); } else { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); uVar10 = PlayerManager::GetNumCoopPlayers(playerManager); if (uVar10 < 2) { SoundEffects::PlayWithFartOverride(0x10b,1.0,2,0,1.0); } else { cVar5 = FUN_00423960(); if (cVar5 == '\0') { FUN_0065d060(); uVar18 = Entity_Player::ControllerIndex((Entity_Player *)local_e0.y); LAB_006623ad: FUN_008ef840(uVar18); pEVar25 = savedSlot; } else { pvVar17 = (void *)FUN_00417920(); InputManager::GetDeviceByPlayerEntity(pvVar17,(Entity_Player *)local_e0.y); cVar5 = FUN_0065d0a0(); if (cVar5 != '\0') { FUN_0065d060(); uVar18 = FUN_00423970(); goto LAB_006623ad; } } FUN_0065d040(1); } } FUN_0065d020(); } FUN_00665630(); local_a0.y = 0.0; local_d8.y = (float)(0xf - *(ushort *)((int)&pEVar25[1]._pendingDamageFlags + 6) / 10); puVar19 = (undefined2 *)std::max(); uVar7 = *puVar19; goto LAB_00662215; } } if ((((((*(int *)&pEVar25[1].field_0x4 == 2) && (bVar4 = ANM2::IsFinishedImpl(&pEVar25->_sprite,&s_empty), bVar4 != 0)) && (iVar8 = pEVar25->_variant, iVar8 != 1)) && ((iVar8 != 8 && (iVar8 != 10)))) && (iVar8 != 0xb)) && (iVar8 != 0x13)) { *(undefined4 *)&pEVar25[1].field_0x4 = 1; ANM2::Play(&pEVar25->_sprite,s_Idle,0); } local_14 = 0xffffffff; guard_check_icall(); LAB_00662654: if (((((Entity *)pEVar25)->_variant == 6) || (((Entity *)pEVar25)->_variant == 0xf)) && ((bVar4 = ANM2::IsPlaying(&((Entity *)pEVar25)->_sprite,(byte *)"PayShuffle"), bVar4 != 0 && (bVar4 = Sprite::IsEventTriggered((Sprite *)&((Entity *)pEVar25)->_sprite,"Shuffle"), bVar4 != 0)))) { fVar28 = random_float(); local_a0.y = fVar28 * 0.1 + 1.0; fVar28 = random_float(); SoundEffects::PlayWithFartOverride(0xfc,fVar28 * 0.1 + 0.5,2,0,local_a0.y); } sVar22 = *(short *)((int)&((Entity *)(pEVar25 + 1))->_pendingDamageFlags + 4); if (sVar22 == 0) { *(undefined2 *)((int)&((Entity *)(pEVar25 + 1))->_pendingDamageFlags + 6) = 0; } else { psVar1 = (short *)((int)&((Entity *)(pEVar25 + 1))->_pendingDamageFlags + 6); *psVar1 = *psVar1 + 1; *(short *)((int)&((Entity *)(pEVar25 + 1))->_pendingDamageFlags + 4) = sVar22 + -1; } Entity::Update((Entity *)pEVar25); ANM2::Update((ANM2 *)&((Entity *)(pEVar25 + 1))->_index); ExceptionList = local_1c; return; } //@@ 006627e0 Entity_Slot::HandleCollision /* ZHL [vtable slot 23] prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity_Slot::HandleCollision(Entity_Slot *this,Entity *collider,byte isLow) { float fVar1; void *pvVar2; EntityPtr EVar3; char cVar4; undefined2 playerSide; Vector *position; ItemConfig_Item *collectibleConfig; int iVar5; LayerState *layer; uint rollB; uint rollC; int hardMinRoll; void *pvVar6; undefined4 uVar7; uint playerSide; ItemConfig *pIVar9; int roll; int *id; Entity_Player *pEVar10; int *piVar11; ItemConfig *ptr; byte *prizeLayer; int *idsCapacityEnd; bool bVar12; bool bVar13; byte bVar14; EntityRef sourceRef; ItemConfig *wispIdsBegin; int *wispIdsEnd; int *wispIdsCapacityEnd; Vector freePos; RNG *daemonsTailRng; Entity_Slot *local_28; Vector VStack_24; ItemConfig *local_1c; Entity_Player *player; char isForcedCollide; void *local_10; undefined1 *puStack_c; undefined4 local_8; char *animName; ushort donationCount; RNG *dropRng; Game *game; byte isGolden; Manager *manager; PersistentGameData *persistentData; float slotX; EntityPtr *targetRef; local_8 = 0xffffffff; puStack_c = &LAB_00af76cd; local_10 = ExceptionList; ExceptionList = &local_10; isForcedCollide = g_forceCollideDepth != 0; local_28 = this; if ((collider->_type != 1) || (iVar5 = this->_variant, iVar5 == 0xc)) { LAB_006639ef: if (((((this->_variant == 0xc) && (collider->_type == 1)) && (collider->_variant == 0)) && (*(int *)&this[1].field_0x4 != 3)) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { uVar7 = __RTDynamicCast(collider,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0, __security_cookie ^ (int)register0x00000010 - 4U); FUN_006653e0(uVar7); } goto LAB_00663323; } if (*(int *)&this[1].field_0x4 != 1) { if (*(int *)&this[1].field_0x4 == 2) { if (iVar5 != 6) { bVar13 = iVar5 == 0xf; goto LAB_00662890; } goto LAB_00662896; } goto LAB_006639ef; } if (0 < *(short *)&this[1]._damageEvents._capacity) goto LAB_006639ef; if (((((iVar5 == 4) || (iVar5 == 5)) || (iVar5 == 7)) || (((iVar5 == 9 || (iVar5 == 0xd)) || (iVar5 == 0x12)))) && ((pvVar6 = (this->_sprite)._animState._animData, pvVar6 != (void *)0x0 && (*(char *)((int)pvVar6 + 0x34) == '\0')))) { bVar13 = (this->_sprite)._animState._isPlaying == 0; LAB_00662890: if (!bVar13) goto LAB_006639ef; } LAB_00662896: if ((collider[4]._prevPosition.y != 5.60519e-44) || (player = (Entity_Player *)collider[7]._damageCountdown, player == (Entity_Player *)0x0)) { player = (Entity_Player *)collider; } pEVar10 = player; pvVar6 = (player->_trinketRNGs)._end; if ((int)pvVar6 - (int)(player->_trinketRNGs)._begin >> 4 < 0x17) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar6 = (pEVar10->_trinketRNGs)._end; } pvVar2 = (pEVar10->_trinketRNGs)._begin; playerSide = ((int)pvVar6 - (int)pvVar2 >> 4) - 1; if (0x16 < playerSide) { playerSide = 0x16; } daemonsTailRng = (RNG *)(playerSide * 0x10 + (int)pvVar2); if (isForcedCollide != '\0') goto LAB_00662c91; if (pEVar10->_isCoopGhost != 0) goto LAB_00663320; switch(this->_variant) { case 1: case 3: case 4: case 8: case 10: case 0xb: case 0xd: case 0x12: case 0x13: if (0 < pEVar10->_numCoins) { Entity_Player::AddCoins(pEVar10,-1); isGolden = Entity_Player::HasTrinket(pEVar10,0x55,0); if ((isGolden != 0) && (playerSide = RNG::RandomInt(&this->_dropRNG,3), playerSide == 0)) { if (this->_variant == 4) { isGolden = Entity_Player::HasTrinket(pEVar10,0x55,0); if (isGolden != 0) { VStack_24.y = RNG::RandomFloat(&this->_dropRNG); if (VStack_24.y < 0.4) { iVar5 = Entity_Player::GetTrinketMultiplier(pEVar10,0x55); goto code_r0x00662c8a; } if (0.8 <= VStack_24.y) { bVar13 = VStack_24.y == 0.95; bVar12 = 0.95 < VStack_24.y; goto code_r0x006629f0; } bVar14 = 0; isGolden = 0; iVar5 = Entity_Player::GetTrinketMultiplier(pEVar10,0x55); Entity_Player::AddHearts(pEVar10,iVar5 * 2,isGolden,bVar14); } } else if (this->_variant == 10) { VStack_24.y = RNG::RandomFloat(&this->_dropRNG); bVar13 = VStack_24.y == 0.15; bVar12 = 0.15 < VStack_24.y; code_r0x006629f0: if (!bVar12 && !bVar13) { iVar5 = Entity_Player::GetTrinketMultiplier(pEVar10,0x55); Entity_Player::DonateLuck(pEVar10,iVar5); } } } goto LAB_00662c91; } break; case 2: case 5: case 0xf: case 0x11: if (this->_variant == 0xf) { if (*(int *)&this[1].field_0x4 == 2) goto LAB_00662c91; if (*(int *)&this[1].field_0x4 != 1) { ExceptionList = local_10; return 0; } } cVar4 = Entity_Player::IsP2Appearing(pEVar10); game = g_game; if (cVar4 != '\0') { ExceptionList = local_10; return 0; } if (pEVar10->_damageCooldown < 0xf) { local_1c = (ItemConfig *)0x20; if (g_game->_challenge == 0x1e) { local_1c = (ItemConfig *)0x820; } pEVar10->_damageCooldown = 0; VStack_24.y = *(float *)(*(int *)pEVar10 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); if (*(int *)&game->_deathmatchManager < 2) { uVar7 = 0x3f800000; } else { uVar7 = 0x41000000; } (*(code *)VStack_24.y)(uVar7,local_1c,0,&sourceRef,0x1e); local_1c = *(ItemConfig **)&this[1].field_0x4; isGolden = Entity_Player::HasTrinket(pEVar10,0x55,0); if (((isGolden != 0) && (isGolden = Entity_Player::HasTrinket(pEVar10,0x55,0), isGolden != 0)) && (playerSide = RNG::RandomInt(&this->_dropRNG,3), playerSide == 0)) { VStack_24.y = RNG::RandomFloat(&this->_dropRNG); if (0.4 <= VStack_24.y) { if (0.8 <= VStack_24.y) { if (VStack_24.y < 0.95) { iVar5 = Entity_Player::GetTrinketMultiplier(pEVar10,0x55); Entity_Player::DonateLuck(pEVar10,iVar5); } } else { bVar14 = 0; isGolden = 0; iVar5 = Entity_Player::GetTrinketMultiplier(pEVar10,0x55); Entity_Player::AddHearts(pEVar10,iVar5 * 2,isGolden,bVar14); } } else { playerSide = RNG::Next(&this->_dropRNG); VStack_24.x = (this->_pos).x + 0.0; VStack_24.y = (this->_pos).y + 40.0; position = Room::FindFreePickupSpawnPosition(g_game->_room,&freePos,&VStack_24,0.0,0,0,0); Game::Spawn(g_game,6,4,position,&g_vectorZero,(Entity *)this,0,playerSide); } } if (local_1c == (ItemConfig *)0x1) goto LAB_00662c91; } break; case 6: if (*(int *)&this[1].field_0x4 == 2) goto LAB_00662c91; if ((*(int *)&this[1].field_0x4 == 1) && (0 < pEVar10->_numCoins)) { iVar5 = -1; goto code_r0x00662c8a; } break; case 7: if (pEVar10->_hasGoldenKey == 0) { if (pEVar10->_numKeys < 1) break; Entity_Player::AddKeys(pEVar10,-1); } case 0xe: LAB_00662c91: iVar5 = this->_variant; if ((((iVar5 == 1) || (iVar5 == 3)) || ((iVar5 == 4 || (((iVar5 == 5 || (iVar5 == 6)) || (iVar5 == 7)))))) || (((iVar5 == 9 || (iVar5 == 0xd)) || ((iVar5 == 0xf || (((iVar5 == 0x10 || (iVar5 == 0x11)) || (iVar5 == 0x12)))))))) { Player_stats_add(&g_game->_onlinePlayerStats,0xb,pEVar10,1.0); } targetRef = &this->_target; if (this->_target != (EntityPtr)0x0) { VStack_24.y = (float)targetRef; std::multiset::erase(&VStack_24.y); } *targetRef = (EntityPtr)pEVar10; if (pEVar10 != (Entity_Player *)0x0) { std::multiset::insert(targetRef); } iVar5 = this->_variant; if ((((((iVar5 == 4) || (iVar5 == 5)) || (iVar5 == 7)) || ((iVar5 == 9 || (iVar5 == 0xd)))) || (iVar5 == 0x12)) && (isGolden = Entity_Player::HasTrinket(pEVar10,0xb6,0), isGolden != 0)) { pvVar6 = (pEVar10->_trinketRNGs)._end; if ((int)pvVar6 - (int)(pEVar10->_trinketRNGs)._begin >> 4 < 0xb7) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar6 = (pEVar10->_trinketRNGs)._end; } pvVar2 = (pEVar10->_trinketRNGs)._begin; playerSide = ((int)pvVar6 - (int)pvVar2 >> 4) - 1; if (0xb6 < playerSide) { playerSide = 0xb6; } playerSide = RNG::RandomInt((RNG *)(playerSide * 0x10 + (int)pvVar2),4); if (playerSide == 0) { pvVar6 = (pEVar10->_trinketRNGs)._end; if ((int)pvVar6 - (int)(pEVar10->_trinketRNGs)._begin >> 4 < 0xb7) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar6 = (pEVar10->_trinketRNGs)._end; } pvVar2 = (pEVar10->_trinketRNGs)._begin; playerSide = ((int)pvVar6 - (int)pvVar2 >> 4) - 1; if (0xb6 < playerSide) { playerSide = 0xb6; } playerSide = RNG::RandomInt((RNG *)(playerSide * 0x10 + (int)pvVar2), ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) - 1); VStack_24.y = (float)(playerSide + 1); local_1c = &g_manager->_itemConfig; collectibleConfig = ItemConfig::GetCollectible(local_1c,(int)VStack_24.y); if (((collectibleConfig == (ItemConfig_Item *)0x0) || (isGolden = ItemConfig::IsValidCollectible((int)VStack_24.y), isGolden == 0)) || (collectibleConfig->type != 3)) { pvVar6 = (local_1c->_collectibles)._begin; if ((int)(local_1c->_collectibles)._end - (int)pvVar6 >> 2 < 0x249) { collectibleConfig = (ItemConfig_Item *)0x0; } else { collectibleConfig = *(ItemConfig_Item **)((int)pvVar6 + 0x920); } } if ((collectibleConfig[1].type == 0) || (*(short *)(collectibleConfig[1].type + 400) < 1)) { pvVar6 = (local_1c->_collectibles)._begin; if ((int)(local_1c->_collectibles)._end - (int)pvVar6 >> 2 < 0x249) { collectibleConfig = (ItemConfig_Item *)0x0; } else { collectibleConfig = *(ItemConfig_Item **)((int)pvVar6 + 0x920); } } iVar5 = Entity_Player::GetTrinketMultiplier(pEVar10,0xb6); if (iVar5 == 1) { Entity_Player::AddWisp(pEVar10,collectibleConfig->id,&this->_pos,1,0); } else if ((iVar5 == 2) || (iVar5 == 3)) { piVar11 = (int *)0x0; local_1c = (ItemConfig *)0x0; wispIdsBegin = (ItemConfig *)0x0; wispIdsEnd = (int *)0x0; VStack_24.y = 0.0; wispIdsCapacityEnd = (int *)0x0; local_8 = 0; pIVar9 = &g_manager->_itemConfig; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(pIVar9->_collectibles)._begin >> 2 != 0) { id = (int *)0x0; idsCapacityEnd = (int *)0x0; do { collectibleConfig = ItemConfig::GetCollectible(pIVar9,(int)id); if (collectibleConfig != (ItemConfig_Item *)0x0) { if (collectibleConfig->type == 3) { if (collectibleConfig[1].type != 0) { if (0 < *(short *)(collectibleConfig[1].type + 400)) { VStack_24.y = (float)id; if (piVar11 == idsCapacityEnd) { std::vector::_Emplace_reallocate(piVar11,&VStack_24.y); piVar11 = wispIdsEnd; idsCapacityEnd = wispIdsCapacityEnd; } else { *piVar11 = (int)id; wispIdsEnd = piVar11 + 1; piVar11 = wispIdsEnd; } } } } } id = (int *)((int)id + 1); pIVar9 = &g_manager->_itemConfig; } while (id < (int *)((int)(g_manager->_itemConfig)._collectibles._end - (int)(pIVar9->_collectibles)._begin >> 2)); local_1c = wispIdsBegin; pEVar10 = player; this = local_28; VStack_24.y = (float)idsCapacityEnd; } pvVar6 = (pEVar10->_trinketRNGs)._end; wispIdsBegin = local_1c; if ((int)pvVar6 - (int)(pEVar10->_trinketRNGs)._begin >> 4 < 0xb7) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar6 = (pEVar10->_trinketRNGs)._end; } pvVar2 = (pEVar10->_trinketRNGs)._begin; playerSide = ((int)pvVar6 - (int)pvVar2 >> 4) - 1; if (0xb6 < playerSide) { playerSide = 0xb6; } playerSide = RNG::RandomInt((RNG *)(playerSide * 0x10 + (int)pvVar2), (int)piVar11 - (int)local_1c >> 2); pIVar9 = local_1c; Entity_Player::AddWisp (pEVar10,*(int *)((local_1c->_wispGfxRoot)._buf + playerSide * 4 + -0x50),&this->_pos ,1,0); local_8 = 0xffffffff; if (pIVar9 != (ItemConfig *)0x0) { playerSide = (int)VStack_24.y - (int)pIVar9 & 0xfffffffc; ptr = pIVar9; if (0xfff < playerSide) { ptr = *(ItemConfig **)((int)(pIVar9 + -1) + 0x10c); playerSide = playerSide + 0x23; if (0x1f < (uint)((int)pIVar9 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,playerSide); } } manager = g_manager; VStack_24.y = 6.60012e-43; seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,1.0,2,0,1.0,0.0); } } manager = g_manager; iVar5 = this->_variant; if ((iVar5 == 6) || (iVar5 == 0xf)) { if (*(int *)&this[1].field_0x4 == 1) { ANM2::Play(&this->_sprite,(byte *)"PayShuffle",0); isGolden = ANM2::SetAnimation((ANM2 *)&this[1]._index,(byte *)"Prizes",1); if (isGolden != 0) { AnimationState::Rewind((AnimationState *)(this[1]._sprite._filename._buf + 8)); this[1]._sprite._animDefaultName._buf[4] = '\x01'; } dropRng = &this->_dropRNG; if (this->_variant == 0xf) { playerSide = RNG::RandomInt(dropRng,6); this[1]._damageEvents._begin = *(void **)(&DAT_00b64c18 + playerSide * 4); playerSide = RNG::RandomInt(dropRng,0xd); if (playerSide == 0) { this[1]._damageEvents._begin = (void *)0x64; pvVar6 = (void *)0x64; } else { pvVar6 = this[1]._damageEvents._begin; } prizeLayer = (byte *)0x0; if (this[1]._sprite._overlayAnimState._layerFrames != (void *)0x0) { do { pvVar6 = this[1]._damageEvents._begin; if (prizeLayer == (byte *)0x0) { bVar13 = pvVar6 == (void *)0x0; LAB_0066371c: if (bVar13) goto LAB_006637e7; LAB_00663722: layer = ANM2::GetLayer((ANM2 *)&this[1]._index,prizeLayer); layer->_visible = 0; } else { if (prizeLayer == (byte *)0x1) { bVar13 = pvVar6 == (void *)0x28; goto LAB_0066371c; } if (prizeLayer == (byte *)0x2) { bVar13 = pvVar6 == (void *)0xa; goto LAB_0066371c; } if (prizeLayer == (byte *)0x3) { bVar13 = pvVar6 == (void *)0x1e; goto LAB_0066371c; } if (prizeLayer == &DAT_00000004) { bVar13 = pvVar6 == (void *)0x14; goto LAB_0066371c; } if (prizeLayer == &DAT_00000006) { bVar13 = pvVar6 == (void *)0x12c; goto LAB_0066371c; } if (prizeLayer == &DAT_00000007) { bVar13 = pvVar6 == (void *)0x64; goto LAB_0066371c; } if (prizeLayer != &DAT_00000005) goto LAB_00663722; LAB_006637e7: layer = ANM2::GetLayer((ANM2 *)&this[1]._index,prizeLayer); layer->_visible = 1; } prizeLayer = prizeLayer + 1; } while (prizeLayer < this[1]._sprite._overlayAnimState._layerFrames); pvVar6 = this[1]._damageEvents._begin; } if (pvVar6 == (void *)0x64) { if ((g_game->_difficulty == 2) || (piVar11 = (int *)&(g_game->_itemPool).field_0x6d4, g_game->_difficulty == 3)) { piVar11 = (int *)&(g_game->_itemPool).field_0x750; } iVar5 = ItemPool::GetCollectible(&g_game->_itemPool,*piVar11,this->_initSeed,1,0x71,0); SetPrizeType(this,iVar5); } } else { playerSide = RNG::RandomInt(dropRng,4); this[1]._damageEvents._begin = *(void **)(&DAT_00b64c08 + playerSide * 4); playerSide = RNG::RandomInt(dropRng,0xd); if ((playerSide == 0) && (isGolden = ItemPool::is_collectible_available(&g_game->_itemPool,9,0), isGolden != 0)) { this[1]._damageEvents._begin = (void *)0x64; } if (((this[1]._damageEvents._begin == (void *)0xa) && (isGolden = Entity_Player::HasTrinket(pEVar10,0x16,0), isGolden != 0)) && (playerSide = RNG::RandomInt(daemonsTailRng,5), playerSide != 0)) { playerSide = RNG::RandomInt(dropRng,3); this[1]._damageEvents._begin = *(void **)(&DAT_00b64c0c + playerSide * 4); } else { RNG::Next(dropRng); } prizeLayer = (byte *)0x0; if (this[1]._sprite._overlayAnimState._layerFrames != (void *)0x0) { do { if (prizeLayer == (byte *)0x0) { bVar13 = this[1]._damageEvents._begin == (void *)0x64; LAB_0066389f: if (bVar13) goto LAB_0066396a; LAB_006638a5: layer = ANM2::GetLayer((ANM2 *)&this[1]._index,prizeLayer); layer->_visible = 0; } else { if (prizeLayer == (byte *)0x1) { bVar13 = this[1]._damageEvents._begin == (void *)0x28; goto LAB_0066389f; } if (prizeLayer == (byte *)0x2) { bVar13 = this[1]._damageEvents._begin == (void *)0xa; goto LAB_0066389f; } if (prizeLayer == (byte *)0x3) { bVar13 = this[1]._damageEvents._begin == (void *)0x1e; goto LAB_0066389f; } if (prizeLayer == &DAT_00000004) { bVar13 = this[1]._damageEvents._begin == (void *)0x14; goto LAB_0066389f; } if (prizeLayer != &DAT_00000005) goto LAB_006638a5; LAB_0066396a: layer = ANM2::GetLayer((ANM2 *)&this[1]._index,prizeLayer); layer->_visible = 1; } prizeLayer = prizeLayer + 1; } while (prizeLayer < this[1]._sprite._overlayAnimState._layerFrames); } } persistentData = (PersistentGameData *)this[1]._sprite._championColor._offset[0]; *(undefined4 *)&this[1].field_0x4 = 2; PersistentGameData::IncreaseEventCounter(persistentData,0xe,1); manager = g_manager; VStack_24.y = 3.48923e-43; seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,1.0,2,0,1.0,0.0); } else if ((*(int *)&this[1].field_0x4 == 2) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { slotX = (this->_pos).x; fVar1 = (collider->_pos).x; if (slotX - 20.0 <= fVar1) { playerSide = 2; if (fVar1 <= slotX + 20.0) { playerSide = 1; } } else { playerSide = 0; } *(undefined2 *)((int)&this[1]._damageEvents._end + 2) = playerSide; *(undefined4 *)&this[1].field_0x4 = 5; goto LAB_00663323; } } else { if (iVar5 == 4) { LAB_00663566: VStack_24.y = 3.48923e-43; LAB_0066356d: seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,1.0,2,0,1.0,0.0); this[1]._pendingDamage = (float)((int)this[1]._pendingDamage + 1); if ((this->_variant == 0xd) || (this->_variant == 0x12)) { playerSide = RNG::RandomInt(&this->_dropRNG,3); rollB = RNG::RandomInt(&this->_dropRNG,2); iVar5 = rollB + playerSide; if (g_game->_difficulty == 1) { hardMinRoll = 2; roll = iVar5; goto LAB_0066362f; } } else { playerSide = RNG::RandomInt(&this->_dropRNG,4); rollB = RNG::RandomInt(&this->_dropRNG,4); rollC = RNG::RandomInt(&this->_dropRNG,2); iVar5 = rollC + playerSide + rollB; if (g_game->_difficulty == 1) { hardMinRoll = 5; roll = iVar5; LAB_0066362f: iVar5 = hardMinRoll; if (hardMinRoll < roll) { iVar5 = roll; } } } if (iVar5 < (int)this[1]._pendingDamage) { playerSide = RNG::RandomInt(&this->_dropRNG,2); this[1]._pendingDamage = (float)(playerSide + 2); isGolden = Entity_Player::HasCollectible(pEVar10,0x2e,0); if (isGolden != 0) { this[1]._pendingDamage = (float)((int)this[1]._pendingDamage + 1); } LAB_00663164: *(undefined4 *)&this[1].field_0x4 = 2; animName = "PayPrize"; } else { LAB_0066312b: animName = "PayNothing"; } } else { if (iVar5 == 5) { VStack_24.y = 2.10195e-43; goto LAB_0066356d; } if ((iVar5 == 0xd) || (iVar5 == 0x12)) goto LAB_00663566; if (iVar5 == 7) { VStack_24.y = 8.26766e-44; seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,2.0,2,0,1.0,0.0); local_28 = (Entity_Slot *)RNG::RandomInt(&this->_dropRNG,100); isGolden = pEVar10->_hasGoldenKey; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x2); pEVar10 = player; layer->_visible = isGolden == 0; isGolden = player->_hasGoldenKey; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x3); layer->_visible = isGolden; if (pEVar10->_hasGoldenKey != 0) { Entity_Player::RemoveGoldenKey(); *(undefined1 *)&this[1]._damageEvents._end = 1; goto LAB_00663164; } if (local_28 < (Entity_Slot *)&DAT_00000023) goto LAB_00663164; goto LAB_0066312b; } if (iVar5 != 9) { if ((iVar5 == 8) || (iVar5 == 10)) { LAB_006634f6: animName = "CoinInsert"; if (((iVar5 == 8) || (iVar5 == 0xb)) || (iVar5 == 0x13)) { LAB_0066350d: donationCount = *(ushort *)((int)&this[1]._pendingDamageFlags + 6); if (donationCount < 0x79) { animName = "CoinInsert2"; if (donationCount < 0x3d) { animName = "CoinInsert"; } } else { animName = "CoinInsert3"; } } isGolden = ANM2::SetOverlayAnimation(&this->_sprite,(byte *)animName,1); if (isGolden != 0) { AnimationState::Rewind(&(this->_sprite)._overlayAnimState); (this->_sprite)._overlayAnimState._isPlaying = 1; } *(undefined4 *)&this[1].field_0x4 = 2; goto LAB_00663323; } if (iVar5 == 0xb) { EVar3 = this->_spawnerEntity; if (EVar3 == (EntityPtr)0x0) { *(undefined1 *)(this[1]._sprite._championColor._colorize + 3) = 1; } else if (((EVar3 == (EntityPtr)collider) || (EVar3 == (EntityPtr)collider[7]._damageCountdown)) || (collider[7]._freezeCountdown != 0)) { *(undefined1 *)(this[1]._sprite._championColor._colorize + 3) = 1; } else { *(undefined1 *)(this[1]._sprite._championColor._colorize + 3) = 0; } goto LAB_0066350d; } if (iVar5 == 0x13) goto LAB_006634f6; if (iVar5 == 2) { PersistentGameData::IncreaseEventCounter ((PersistentGameData *)this[1]._sprite._championColor._offset[0],0x11,1); VStack_24.y = 2.43826e-43; LAB_006632c1: manager = g_manager; seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,1.0,2,0,1.0,0.0); *(undefined4 *)&this[1].field_0x4 = 2; *(undefined2 *)&this[1]._damageEvents._capacity = 0x1e; animName = "Initiate"; } else { if ((iVar5 == 1) || (iVar5 == 3)) { VStack_24.y = 3.36312e-44; goto LAB_006632c1; } if (iVar5 != 0xe) { if (iVar5 == 0x11) { *(undefined4 *)&this[1].field_0x4 = 2; *(undefined2 *)&this[1]._damageEvents._capacity = 0x1e; ANM2::Play(&this->_sprite,(byte *)"Initiate",0); animName = "HeartInsert"; } else { if (iVar5 != 0x10) break; VStack_24.y = 3.36312e-44; seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,1.0,2,0,1.0,0.0); *(undefined4 *)&this[1].field_0x4 = 2; *(undefined2 *)&this[1]._damageEvents._capacity = 0x1e; ANM2::Play(&this->_sprite,(byte *)"Initiate",0); animName = "CoinInsert"; } isGolden = ANM2::SetOverlayAnimation(&this->_sprite,(byte *)animName,1); if (isGolden != 0) { AnimationState::Rewind(&(this->_sprite)._overlayAnimState); (this->_sprite)._overlayAnimState._isPlaying = 1; } break; } *(undefined4 *)&this[1].field_0x4 = 2; *(undefined2 *)&this[1]._damageEvents._capacity = 0x1e; animName = "PayPrize"; } ANM2::Play(&this->_sprite,(byte *)animName,0); break; } VStack_24.y = 3.48923e-43; seed_fart_sound_override((int *)&VStack_24.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_24.y,1.0,2,0,1.0,0.0); this[1]._damageEvents._begin = (void *)0x0; isGolden = pEVar10->_hasGoldenBomb; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x2); pEVar10 = player; layer->_visible = isGolden == 0; isGolden = player->_hasGoldenBomb; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x3); layer->_visible = isGolden; if (pEVar10->_hasGoldenBomb == 0) { playerSide = RNG::RandomInt(&this->_dropRNG,100); if (playerSide < 0x19) { this[1]._damageEvents._begin = (void *)0x1; } else if (playerSide < 0x23) { this[1]._damageEvents._begin = (void *)0x2; } else if (playerSide < 0x28) { this[1]._damageEvents._begin = (void *)0x3; } } else { this[1]._damageEvents._begin = (void *)0x3; Entity_Player::RemoveGoldenBomb(); } if (this[1]._damageEvents._begin == (void *)0x0) { animName = "PayNothing"; } else { *(undefined4 *)&this[1].field_0x4 = 2; animName = "PayPrize"; } } isGolden = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (isGolden != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } break; case 9: if (pEVar10->_hasGoldenBomb == 0) { if (pEVar10->_numBombs < 1) break; Entity_Player::AddBombs(pEVar10,-1); } goto LAB_00662c91; case 0x10: if (4 < pEVar10->_numCoins) { iVar5 = -5; code_r0x00662c8a: Entity_Player::AddCoins(pEVar10,iVar5); goto LAB_00662c91; } } LAB_00663320: LAB_00663323: if (((collider->_type == 1) && (collider->_variant == 0)) && (*(int *)&this[1].field_0x4 != 3)) { *(undefined2 *)((int)&this[1]._pendingDamageFlags + 4) = 4; } if (((*(int *)&g_game->_deathmatchManager < 2) || (collider->_type != 1)) && (((iVar5 = collider->_type, iVar5 - 10U < 0x3de && (iVar5 != 1)) || (iVar5 == 4)))) { ExceptionList = local_10; return 1; } ExceptionList = local_10; return 0; } //@@ 00663aa0 Entity_Slot::spawn_break_drops /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: RNG pickups/spiders/gibs, Slot Update/TakeDamage */ void __thiscall Entity_Slot::spawn_break_drops(Entity_Slot *this) { Vector targetPos; Vector targetPos_00; byte isTrinketHeld; ColorMod *color; uint uVar1; uint uVar2; Entity *spawnedPedestal; Entity_Pickup *pedestal; float randomCount; RNG *tmpRng; float fVar3; Vector *slotPos; RNG *dropRng; int iVar4; undefined4 uVar5; Vector *velocity; TypeDescriptor *pTVar6; TypeDescriptor *pTVar7; uint subType; undefined4 uVar8; Vector keyVelocity; Vector heartVelocity; Vector pickupVelocity; undefined1 local_90 [16]; RNG velocityRng; Vector local_70; Vector local_68; RNG *trinketOwnerRng; Vector local_5c; Vector local_54; RNG *local_4c; Color gibColor; uint dropTrinkets [6]; Game *game; dropTrinkets[5] = __security_cookie ^ (uint)(dropTrinkets + 6); trinketOwnerRng = (RNG *)0x0; local_5c.y = (float)this; PlayerManager::RandomTrinketOwner(&g_game->_playerManager,0x16,this->_initSeed,&trinketOwnerRng); velocityRng._seed = this->_initSeed; velocityRng._shift3 = 0x1d; iVar4 = this->_variant; velocityRng._shift1 = 1; velocityRng._shift2 = 9; if ((iVar4 == 5) || (iVar4 == 0xf)) { targetPos.y = g_vectorZero.y; targetPos.x = g_vectorZero.x; Entity_NPC::ThrowSpider(&this->_pos,(Entity *)this,targetPos,0,-30.0); targetPos_00.y = g_vectorZero.y; targetPos_00.x = g_vectorZero.x; Entity_NPC::ThrowSpider(&this->_pos,(Entity *)this,targetPos_00,0,-30.0); } else if (iVar4 == 0x12) { slotPos = &this->_pos; Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); spawn_small_maggot(slotPos,-10.0,&local_5c,-8.0); Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); spawn_small_maggot(slotPos,-10.0,&local_5c,-8.0); Color::Color(&gibColor); local_5c.y = 9.80909e-44; spawn_gibs(slotPos,5,40.0,(uint *)&local_5c.y,(Entity *)0x0,color,&g_vectorZero,1.0); uVar1 = RNG::RandomInt(&this->_dropRNG,3); if (uVar1 == 0) { uVar1 = RNG::Next(&this->_dropRNG); Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); Game::Spawn(g_game,5,10,slotPos,&local_5c,(Entity *)0x0,0xc,uVar1); return; } } else if (iVar4 == 10) { dropRng = &this->_dropRNG; local_5c.y = (float)dropRng; uVar1 = RNG::RandomInt(dropRng,4); if (0 < (int)uVar1) { do { uVar2 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_54,&this->_pos,1,&velocityRng); Game::Spawn(g_game,5,0x14,&this->_pos,&local_54,(Entity *)0x0,0,uVar2); uVar1 = uVar1 - 1; dropRng = (RNG *)local_5c.y; } while (uVar1 != 0); return; } } else if (iVar4 == 2) { dropRng = &this->_dropRNG; local_4c = dropRng; uVar1 = RNG::RandomInt(dropRng,2); local_54.y = (float)(uVar1 + 1); if (0 < (int)local_54.y) { do { tmpRng = trinketOwnerRng; uVar1 = RNG::RandomInt(dropRng,2); if ((uVar1 == 0) || ((tmpRng != (RNG *)0x0 && (uVar1 = RNG::RandomInt(tmpRng,5), uVar1 != 0)))) { uVar1 = RNG::RandomInt(dropRng,4); iVar4 = uVar1 + 1; if (0 < iVar4) { do { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_68,&this->_pos,1,&velocityRng); Game::Spawn(g_game,5,0x14,&this->_pos,&local_68,(Entity *)0x0,0,uVar1); iVar4 = iVar4 + -1; dropRng = local_4c; } while (iVar4 != 0); this = (Entity_Slot *)local_5c.y; } } else { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_70,&this->_pos,1,&velocityRng); Game::Spawn(g_game,5,10,&this->_pos,&local_70,(Entity *)0x0,0,uVar1); dropRng = local_4c; } local_54.y = (float)((int)local_54.y + -1); } while (local_54.y != 0.0); return; } } else if (iVar4 == 0xc) { RNG::game_constructor((RNG *)local_90,velocityRng._seed,0x1f); uVar1 = RNG::RandomInt((RNG *)local_90,100); game = g_game; if (uVar1 == 0) { uVar1 = RNG::Next((RNG *)local_90); uVar1 = ItemPool::GetCollectibleFromList (&game->_itemPool,(int *)&DAT_00b64be0,10,uVar1,0x1e,1,0); uVar2 = RNG::Next((RNG *)local_90); uVar8 = 0; pTVar7 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar6 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar5 = 0; spawnedPedestal = Game::Spawn(g_game,5,100,&this->_pos,&g_vectorZero,(Entity *)0x0,uVar1,uVar2); pedestal = (Entity_Pickup *)__RTDynamicCast(spawnedPedestal,uVar5,pTVar6,pTVar7,uVar8); Entity_Pickup::SetAlternatePedestal(pedestal,9); (**(code **)(*(int *)pedestal + 0xc))(); (**(code **)(*(int *)this + 0x28))(); return; } uVar1 = RNG::RandomInt((RNG *)local_90,4); iVar4 = uVar1 + 1; if (0 < iVar4) { do { uVar1 = RNG::Next((RNG *)local_90); Isaac::GetRandomPickupVelocity(&local_5c,&this->_pos,1,&velocityRng); Game::Spawn(g_game,5,0x46,&this->_pos,&local_5c,(Entity *)0x0,0,uVar1); iVar4 = iVar4 + -1; } while (iVar4 != 0); return; } } else if (iVar4 == 0x13) { if (*(char *)((int)g_game->_room + 1) != '\0') { dropRng = &this->_dropRNG; uVar1 = RNG::RandomInt(dropRng,100); if (0x20 < uVar1) { slotPos = &this->_pos; if (uVar1 < 0x42) { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); subType = 3; } else { if (0x5e < uVar1) { uVar1 = RNG::Next(dropRng); Game::Spawn(g_game,5,100,slotPos,&g_vectorZero,(Entity *)0x0,0xb,uVar1); return; } uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); subType = 4; } uVar2 = 10; goto LAB_00663f4c; } } } else { dropRng = &this->_dropRNG; uVar1 = RNG::RandomInt(dropRng,5); if (uVar1 == 0) { slotPos = &this->_pos; uVar1 = RNG::RandomInt(dropRng,2); if (uVar1 != 0) { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); local_54.x = local_5c.x * 0.4; local_54.y = local_5c.y * 0.4; Game::Spawn(g_game,5,0x46,slotPos,&local_54,(Entity *)0x0,0,uVar1); return; } uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&local_5c,slotPos,1,&velocityRng); subType = 0; uVar2 = 0x15e; LAB_00663f4c: local_54.x = local_5c.x * 0.4; local_54.y = local_5c.y * 0.4; Game::Spawn(g_game,5,uVar2,&this->_pos,&local_54,(Entity *)0x0,subType,uVar1); return; } local_54.y = RNG::RandomFloat(dropRng); if (local_54.y < 0.01) { uVar1 = RNG::Next(dropRng); Game::Spawn(g_game,5,0x32,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar1); return; } local_54.y = RNG::RandomFloat(dropRng); if (local_54.y < 0.01) { uVar1 = RNG::Next(dropRng); Game::Spawn(g_game,5,0x3c,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar1); return; } RNG::game_constructor((RNG *)local_90,this->_initSeed,0x1b); randomCount = (float)RNG::RandomInt(dropRng,4); fVar3 = 2.8026e-45; if (2 < (int)randomCount) { fVar3 = randomCount; } local_68.y = fVar3; uVar1 = RNG::RandomInt(dropRng,3); if ((uVar1 != 0) && (isTrinketHeld = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x2a), isTrinketHeld != 0)) { local_68.y = (float)((int)fVar3 + 1); } dropTrinkets[0] = 0x2d; dropTrinkets[1] = 0x2c; dropTrinkets[2] = 0x22; dropTrinkets[3] = 0x29; dropTrinkets[4] = 0x24; local_4c = (RNG *)0x0; do { game = g_game; uVar1 = RNG::Next((RNG *)local_90); local_70.y = (float)PlayerManager::RandomTrinketOwner (&game->_playerManager,dropTrinkets[(int)local_4c],uVar1, (RNG **)0x0); if ((Entity_Player *)local_70.y != (Entity_Player *)0x0) { uVar1 = dropTrinkets[(int)local_4c]; isTrinketHeld = Entity_Player::HasTrinket((Entity_Player *)local_70.y,uVar1,0); if ((isTrinketHeld != 0) && (((uVar1 != 0x22 || (isTrinketHeld = Entity_Player::HasTrinket((Entity_Player *)local_70.y,0x16,0), isTrinketHeld == 0)) || (uVar2 = Random(), uVar2 % 5 == 0)))) { iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,uVar1); local_54.y = 4.62428e-44; if (iVar4 == 2) { local_54.y = 9.24857e-44; } else if (2 < iVar4) { local_54.y = 1.4013e-43; } tmpRng = Entity_Player::GetTrinketRNG((Entity_Player *)local_70.y,uVar1); fVar3 = (float)RNG::RandomInt(tmpRng,100); if ((uint)fVar3 < (uint)local_54.y) { local_4c = (RNG *)0xa; switch(uVar1) { case 0x22: local_4c = (RNG *)0xa; break; case 0x24: local_4c = (RNG *)0x1e; break; case 0x29: local_4c = (RNG *)0x28; break; case 0x2c: local_4c = (RNG *)0x46; break; case 0x2d: local_4c = (RNG *)0x12c; } slotPos = &this->_pos; local_54.y = (float)slotPos; Isaac::GetRandomPickupVelocity(&pickupVelocity,slotPos,1,&velocityRng); tmpRng = Entity_Player::GetTrinketRNG((Entity_Player *)local_70.y,uVar1); uVar1 = RNG::Next(tmpRng); Game::Spawn(g_game,5,(uint)local_4c,slotPos,&pickupVelocity,(Entity *)0x0,0,uVar1); goto LAB_00664266; } } } local_4c = (RNG *)((int)local_4c + 1); } while (local_4c < 5); local_54.y = (float)&this->_pos; LAB_00664266: slotPos = &this->_pos; local_4c = (RNG *)0x0; if (0 < (int)local_68.y) { tmpRng = trinketOwnerRng; do { RNG::Next(dropRng); local_70.y = (float)((double)dropRng->_seed + __uint_to_double_fixup[-(dropRng->_seed >> 0x1f)]) * 2.3283062e-10; if (0.35 <= local_70.y) { if ((0.55 <= local_70.y) || ((tmpRng != (RNG *)0x0 && (uVar1 = RNG::RandomInt(tmpRng,5), uVar1 != 0)))) { if (0.7 <= local_70.y) { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity((Vector *)(local_90 + 8),slotPos,1,&velocityRng); velocity = (Vector *)(local_90 + 8); uVar2 = 0x28; } else { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&keyVelocity,slotPos,1,&velocityRng); velocity = &keyVelocity; uVar2 = 0x1e; } Game::Spawn(g_game,5,uVar2,slotPos,velocity,(Entity *)0x0,0,uVar1); } else { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&heartVelocity,slotPos,1,&velocityRng); Game::Spawn(g_game,5,10,slotPos,&heartVelocity,(Entity *)0x0,0,uVar1); uVar1 = RNG::RandomInt(dropRng,2); if (uVar1 == 0) { local_68.y = (float)((int)local_68.y - 1); } } LAB_00664483: tmpRng = trinketOwnerRng; } else { uVar1 = RNG::RandomInt(dropRng,3); iVar4 = uVar1 + 1; if (0 < iVar4) { local_70.y = (float)((int)local_5c.y + 0x33c); do { uVar1 = RNG::Next(dropRng); Isaac::GetRandomPickupVelocity(&pickupVelocity,(Vector *)local_70.y,1,&velocityRng); Game::Spawn(g_game,5,0x14,(Vector *)local_70.y,&pickupVelocity,(Entity *)0x0,0,uVar1); iVar4 = iVar4 + -1; } while (iVar4 != 0); slotPos = (Vector *)local_54.y; goto LAB_00664483; } slotPos = (Vector *)local_54.y; } local_4c = (RNG *)((int)local_4c + 1); if ((int)local_68.y <= (int)local_4c) { return; } } while( true ); } } return; } //@@ 00664560 Entity_Slot::TakeDamage /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] prototype: db/protos.zhl, confirmed by RET 20 */ byte __thiscall Entity_Slot::TakeDamage (Entity_Slot *this,float damage,ulonglong damageFlags,EntityRef *source, int damageCountdown) { undefined4 uVar1; code *pcVar2; longlong lVar3; longlong lVar4; longlong lVar5; byte bVar6; char cVar7; uint uVar8; Entity *spawnedEntity; int *piVar9; byte *animNameCh; int unusedArg; void *pvVar10; int iVar11; Vector *slotPos; uint uVar12; uint seed; PlayerManager *playerManager; bool bVar13; float fVar14; float fVar15; float fVar16; ulonglong timeNs; uint subType; uint chosenSubType; int *local_b4; float local_b0; float local_ac; float local_a8; Vector spawnPos; Entity *local_9c; uint spawnType; float local_94; uint spawnVariant; float trailStepX; uint local_88; uint spawnSeed; void *triggerIt; float trailStepY; Entity_Slot *local_74; float local_70; Game *local_68; uint lookupKey; EntityPtr *local_58; Vector *slotPosition; Vector local_50; int triggerKeyType; int triggerKeyVariant; int fallbackTriggerKey [3]; undefined8 local_34; undefined4 local_2c; undefined1 local_28 [8]; int local_20; RNG RStack_1c; uint local_c; char *animName; byte *curAnimData; RNG *dropRng; Game *game; EntityPtr *spawnerSlot; local_c = __security_cookie ^ (uint)&subType; iVar11 = this->_variant; local_74 = this; if (iVar11 == 0xe) { if (*(int *)&this[1].field_0x4 != 1) { return 0; } *(undefined4 *)&this[1].field_0x4 = 2; *(undefined2 *)&this[1]._damageEvents._capacity = 0x1e; animName = "PayPrize"; LAB_006645b4: ANM2::Play(&this->_sprite,(byte *)animName,0); return 0; } if ((damageFlags & 4) == 0) { return 0; } if (iVar11 == 8) { if (*(int *)&this[1].field_0x4 != 3) { ANM2::Play(&this->_sprite,(byte *)"Death",0); fVar14 = this[1]._sprite._championColor._offset[0]; dropRng = &this->_dropRNG; *(undefined4 *)&this[1].field_0x4 = 3; uVar12 = *(uint *)((int)fVar14 + 0x30c) % 1000; uVar8 = RNG::RandomInt(dropRng,9); if ((int)(uVar8 + 7) <= (int)uVar12) { uVar12 = uVar8 + 7; } PersistentGameData::IncreaseEventCounter ((PersistentGameData *)this[1]._sprite._championColor._offset[0],0x14,-uVar12); local_b0 = (float)(uVar12 - 1); if (0 < (int)local_b0) { do { iVar11 = 0; do { uVar12 = dropRng->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = dropRng->_seed; if (uVar12 == 0) { pcVar2 = (code *)swi(3); bVar6 = (*pcVar2)(); return bVar6; } } uVar12 = uVar12 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar12; RStack_1c._shift1 = 3; RStack_1c._shift2 = 1; uVar12 = uVar12 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar12; uVar8 = uVar12 >> ((byte)(this->_dropRNG)._shift3 & 0x1f); seed = uVar8 ^ uVar12; local_a8 = 1.96182e-44; dropRng->_seed = seed; if (uVar8 == uVar12) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar6 = (*pcVar2)(); return bVar6; } seed = seed >> 3 ^ seed; seed = seed << 1 ^ seed; seed = seed >> 0xe ^ seed; local_a8 = (float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10 * 3.14; local_a8 = local_a8 + local_a8; local_94 = cos(local_a8); local_94 = local_94 * 5.0; local_50.x = local_94; fVar14 = sin(local_a8); slotPos = &local_74->_pos; spawnPos.x = local_94 * 7.0 + slotPos->x; local_50.y = fVar14 * 5.0 * 0.2 + 3.0; spawnPos.y = local_50.y * 7.0 + (local_74->_pos).y; bVar6 = Room::CheckLine(g_game->_room,slotPos,&spawnPos,1,0,0,0,(Vector *)0x0); } while ((bVar6 == 0) && (iVar11 = iVar11 + 1, iVar11 < 10)); uVar12 = dropRng->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = dropRng->_seed; if (uVar12 == 0) { pcVar2 = (code *)swi(3); bVar6 = (*pcVar2)(); return bVar6; } } game = g_game; uVar12 = uVar12 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar12; dropRng->_seed = uVar12; Game::SpawnEx(game,5,0x14,slotPos,&local_50,(Entity *)0x0,1,uVar12,0); local_b0 = (float)((int)local_b0 + -1); } while (local_b0 != 0.0); } game = g_game; uVar1 = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x40020000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar1; return 0; } } else { if (iVar11 == 0xb) { playerManager = &g_game->_playerManager; bVar6 = PlayerManager::IsCoopPlay(playerManager); if (bVar6 == 0) { return 0; } uVar12 = PlayerManager::count_main_players(playerManager); if (uVar12 < 2) { return 0; } ANM2::Play(&this->_sprite,(byte *)"Death",0); *(undefined4 *)&this[1].field_0x4 = 3; return 1; } if ((iVar11 == 10) && (*(int *)&this[1].field_0x4 != 3)) { Room::ShopRestockFull(g_game->_room); *(undefined4 *)&this[1]._pendingDamageFlags = 0; uVar12 = Random(); Game::SpawnEx(g_game,1000,1,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar12,0); spawn_break_drops(this); *(undefined4 *)&this[1].field_0x4 = 3; animName = "Death"; goto LAB_006645b4; } } if (*(int *)&this[1].field_0x4 == 3) { return 0; } if (iVar11 == 9) { if ((damageFlags & 0x1000000) == 0) { if (*(int *)&this[1].field_0x4 != 1) { return 0; } if (source->_spawnerType == 6) { return 0; } bVar6 = ANM2::SetAnimation(&this->_sprite,(byte *)"Bombed",1); if (bVar6 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } *(undefined4 *)&this[1].field_0x4 = 5; return 0; } *(undefined4 *)&this[1].field_0x4 = 3; } else { *(undefined4 *)&this[1].field_0x4 = 3; if (iVar11 == 1) { PersistentGameData::IncreaseEventCounter ((PersistentGameData *)this[1]._sprite._championColor._offset[0],0x12,1); iVar11 = this->_variant; } } if (iVar11 == 2) { uVar12 = Random(); slotPos = &this->_pos; slotPosition = slotPos; spawnedEntity = Game::SpawnEx(g_game,1000,2,slotPos,&g_vectorZero,(Entity *)0x0,4,uVar12,0); local_a8 = 7.00649e-45; (spawnedEntity->_sprite)._offset.x = 0.0; (spawnedEntity->_sprite)._offset.y = -10.0; spawnedEntity->_renderDepthOffset = 5.0; do { uVar12 = Random(); local_b0 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_b0 = local_b0 + local_b0; uVar12 = Random(); local_b4 = (int *)((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 20.0 + 30.0); fVar14 = cos(local_b0); trailStepX = fVar14 * (float)local_b4; fVar14 = sin(local_b0); trailStepY = fVar14 * (float)local_b4 * 0.65; spawnPos.x = trailStepX * 0.2 + slotPos->x; spawnPos.y = trailStepY * 0.2 + slotPos->y; uVar12 = Random(); local_94 = 5.60519e-45; fVar14 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10; local_b0 = fVar14 + fVar14 + 2.0; do { spawnSeed = Random(); local_68 = g_game; subType = 0; spawnVariant = 7; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&spawnPos,&g_vectorZero,(Entity *)0x0, (int *)&subType,&spawnSeed); uVar12 = spawnVariant; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00664dda: chosenSubType = subType; } else { piVar9 = (g_game->_deathmatchManager)._type; local_b4 = piVar9; seed = Random(); uVar8 = subType; local_34 = 0x900000005; local_9c = (Entity *)&DAT_00000007; local_2c = 7; if (spawnType != 5) goto LAB_00664dda; if (uVar12 < 0x12d) { if (uVar12 == 300) { while ((chosenSubType = subType, subType == 0 || (cVar7 = (**(code **)(*piVar9 + 0x24))(subType), cVar7 != '\0'))) { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar6 = (*pcVar2)(); return bVar6; } seed = seed >> ((byte)local_34 & 0x1f) ^ seed; seed = seed << ((byte)((ulonglong)local_34 >> 0x20) & 0x1f) ^ seed; seed = seed >> ((byte)local_9c & 0x1f) ^ seed; iVar11 = ItemPool::GetCardEx(seed,0x19,10,10,1); RStack_1c._shift1 = 5; RStack_1c._shift2 = 9; RStack_1c._shift3 = 7; RStack_1c._seed = seed; subType = lua_callback_run_get_card(&RStack_1c,iVar11,1,1,0); } } else { if (uVar12 == 0x46) { local_88 = subType >> 0xb; do { chosenSubType = subType; if (subType != 0) { pcVar2 = *(code **)(*piVar9 + 0x28); iVar11 = ItemPool::GetPillEffect (&g_game->_itemPool,subType,(Entity_Player *)0x0); cVar7 = (*pcVar2)(iVar11); if (cVar7 == '\0') goto LAB_00664de2; piVar9 = local_b4; } if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar6 = (*pcVar2)(); return bVar6; } seed = seed >> ((byte)local_34 & 0x1f) ^ seed; seed = seed << ((byte)((ulonglong)local_34 >> 0x20) & 0x1f) ^ seed; seed = seed >> ((byte)local_9c & 0x1f) ^ seed; subType = ItemPool::GetPill(seed); subType = subType | (local_88 & 1) << 0xb; } while( true ); } if (uVar12 != 100) goto LAB_00664dda; chosenSubType = subType; if (subType == 0x19) { LAB_00664c2a: bVar13 = false; } else { lookupKey = subType; std::set::find_node(local_28,&lookupKey); if (((*(char *)(local_20 + 0xd) == '\0') && (*(int *)(local_20 + 0x10) <= (int)uVar8)) && (local_20 != piVar9[8])) goto LAB_00664c2a; bVar13 = true; } if ((uVar8 == 0) || (bVar13)) { subType = (**(code **)(*piVar9 + 0x84))(0); chosenSubType = subType; } } } else { if (uVar12 != 0x15e) goto LAB_00664dda; while ((chosenSubType = subType, subType == 0 || (cVar7 = (**(code **)(*piVar9 + 0x2c))(subType), cVar7 != '\0'))) { subType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_00664de2: local_9c = EntityFactory::Create(local_68->_entityFactory,spawnType,0); if (local_9c == (Entity *)0x0) { LAB_006650d5: spawnedEntity = (Entity *)0x0; } else { timeNs = GetTimeNs(); spawnedEntity = local_9c; local_88 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_ac = (float)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)local_88 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar8 = (uint)((ulonglong)lVar4 >> 0x20); uVar12 = (int)local_ac + (uint)CARRY4((uint)lVar3,(uint)lVar4); lVar3 = (ulonglong)local_88 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar8,uVar12),uVar8 + uVar12); uVar12 = (uint)((ulonglong)lVar3 >> 0x20); spawnerSlot = &local_9c->_spawnerEntity; local_b4 = (int *)((uint)lVar3 >> 0x12 | uVar12 * 0x4000); local_70 = (float)(uVar12 >> 0x12); local_9c->_spawnerType = 0; local_9c->_spawnerVariant = 0; if (*spawnerSlot != (EntityPtr)0x0) { local_58 = spawnerSlot; std::multiset::erase(&local_58); } iVar11 = *(int *)spawnedEntity; *spawnerSlot = (EntityPtr)0x0; (spawnedEntity->_pos).x = spawnPos.x; (spawnedEntity->_pos).y = spawnPos.y; (spawnedEntity->_velocity).x = g_vectorZero.x; (spawnedEntity->_velocity).y = g_vectorZero.y; (**(code **)(iVar11 + 4))(spawnType,spawnVariant,chosenSubType,spawnSeed); game = local_68; pvVar10 = local_68->_room; iVar11 = *(int *)((int)pvVar10 + 0x1214); *(int *)((int)pvVar10 + 0x1214) = iVar11 + 1; spawnedEntity->_index = iVar11; EntityList::AddEntity((EntityList *)((int)pvVar10 + 0x1218),spawnedEntity); bVar6 = Game::ShouldEraseEnemy(spawnedEntity); if (bVar6 != 0) { Entity::RemoveWithPoof(spawnedEntity,unusedArg); } if ((spawnedEntity->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { triggerKeyVariant = spawnedEntity->_variant; iVar11 = spawnedEntity->_type; triggerKeyType = iVar11; std::map::find(&triggerIt,&triggerKeyType); if (triggerIt == (game->_proceduralItemManager)._spawnTriggerTargets._head) { fallbackTriggerKey[1] = 0xffffffff; fallbackTriggerKey[0] = iVar11; piVar9 = (int *)std::map::find(&local_50,fallbackTriggerKey); triggerIt = (void *)*piVar9; if (triggerIt == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_00665048; } uVar12 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (playerManager->_playerList)._end; } piVar9 = (playerManager->_playerList)._begin; if (uVar12 < (uint)((int)pvVar10 - (int)piVar9 >> 2)) { piVar9 = piVar9 + uVar12; } trigger_set_dispatch ((void *)(*piVar9 + 0x1fc8),6,spawnedEntity,&spawnPos,&g_vectorZero); uVar12 = uVar12 + 1; playerManager = &g_game->_playerManager; } while (uVar12 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00665048: timeNs = GetTimeNs(); uVar12 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_88 = (uint)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar12 * 0x431bde82; local_ac = (float)lVar4; lVar5 = (ulonglong)uVar12 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_68 = (Game *)(lVar5 + lVar3); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), local_88 + CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar8 = (uint)((ulonglong)lVar4 >> 0x20); piVar9 = (int *)((uint)lVar4 >> 0x12 | uVar8 * 0x4000); uVar12 = (int)piVar9 - (int)local_b4; bVar13 = CARRY4((uint)g_entitySpawnTimeMs,uVar12); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar12; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar8 >> 0x12) - (int)local_70) - (uint)(piVar9 < local_b4)) + (uint)bVar13; spawnedEntity = local_9c; if (local_9c->_type != 1000) goto LAB_006650d5; } iVar11 = *(int *)spawnedEntity; (spawnedEntity->_sprite)._scale.x = local_b0; (spawnedEntity->_sprite)._scale.y = local_b0; (**(code **)(iVar11 + 0xc))(); uVar12 = Random(); local_70 = ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; local_ac = cos(local_70); fVar14 = sin(local_70); local_94 = (float)((int)local_94 + -1); fVar16 = trailStepX * 0.9; fVar15 = trailStepY * local_ac; spawnPos.x = (trailStepX * local_ac - trailStepY * fVar14) + spawnPos.x; trailStepY = trailStepY * 0.9; local_b0 = local_b0 * 0.6; spawnPos.y = trailStepX * fVar14 + fVar15 + spawnPos.y; trailStepX = fVar16; } while (local_94 != 0.0); local_a8 = (float)((int)local_a8 + -1); local_94 = 0.0; slotPos = slotPosition; } while (local_a8 != 0.0); local_94 = 0.0; local_a8 = 0.0; this = local_74; } iVar11 = ((Entity *)this)->_variant; if (((((iVar11 == 4) || (iVar11 == 5)) || (iVar11 == 7)) || ((iVar11 == 6 || (iVar11 == 9)))) || ((iVar11 == 0xf || ((iVar11 == 0xd || (iVar11 == 0x12)))))) { uVar12 = Random(); spawnedEntity = Game::SpawnEx(g_game,1000,2,&((Entity *)this)->_pos,&g_vectorZero,(Entity *)0x0,0,uVar12,0) ; iVar11 = __RTDynamicCast(spawnedEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar11 + 0xdc) = 0; *(undefined4 *)(iVar11 + 0xe0) = 0xc1200000; Entity::BloodExplode((Entity *)this); (**(code **)(*(int *)this + 0x28))(); iVar11 = ((Entity *)this)->_variant; if ((iVar11 == 4) || ((((iVar11 == 5 || (iVar11 == 0x12)) || (iVar11 == 7)) || (iVar11 == 9)))) { g_game->_levelStateFlags = g_game->_levelStateFlags | 1; } else if (iVar11 == 0xd) { g_game->_levelStateFlags = g_game->_levelStateFlags | 1; PersistentGameData::IncreaseEventCounter ((PersistentGameData *)(((Entity *)(this + 1))->_sprite)._championColor._offset[0], 0x1ee,1); } } if (((Entity *)this)->_variant != 0xc) goto LAB_00665342; curAnimData = (((Entity *)this)->_sprite)._animState._animData; if (curAnimData == (byte *)0x0) { LAB_00665316: bVar6 = ANM2::SetAnimation(&((Entity *)this)->_sprite,(byte *)"Broken",1); if (bVar6 != 0) { AnimationState::Rewind(&(((Entity *)this)->_sprite)._animState); (((Entity *)this)->_sprite)._animState._isPlaying = 1; } } else { animNameCh = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { animNameCh = *(byte **)curAnimData; } animName = "Broken"; do { bVar6 = *animNameCh; bVar13 = bVar6 < (byte)*animName; if (bVar6 != *animName) { LAB_00665300: uVar12 = -(uint)bVar13 | 1; goto LAB_00665305; } if (bVar6 == 0) break; bVar6 = animNameCh[1]; bVar13 = bVar6 < (byte)animName[1]; if (bVar6 != animName[1]) goto LAB_00665300; animNameCh = animNameCh + 2; animName = animName + 2; } while (bVar6 != 0); uVar12 = 0; LAB_00665305: if ((uVar12 != 0) || ((curAnimData[0x34] != 0 && ((((Entity *)this)->_sprite)._animState._isPlaying == 0)))) goto LAB_00665316; } *(undefined4 *)&((Entity *)(this + 1))->field_0x4 = 3; LAB_00665342: spawn_break_drops(this); return 1; } //@@ 00665370 Entity_Slot::Render /* ZHL [exact] __thiscall void Entity_Slot::Render(Vector *offset); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Slot::Render(Entity_Slot *this,Vector *offset) { Entity::Render((Entity *)this,offset); if ((((this->_variant == 6) || (this->_variant == 0xf)) && (*(int *)(this[1]._sprite._filename._buf + 0xc) != 0)) && (this[1]._sprite._animDefaultName._buf[4] != '\0')) { ANM2::Render((ANM2 *)&this[1]._index,&this->_renderPosition,&g_vectorZero,&g_vectorZero); } return; } //@@ 006653c0 FUN_006653c0 undefined4 FUN_006653c0(undefined4 param_1) { Isaac::GetCollectibleSpawnPosition(); return param_1; } //@@ 006653e0 FUN_006653e0 void FUN_006653e0(int param_1) { code *pcVar1; Manager *pMVar2; byte bVar3; uint uVar4; Entity *pEVar5; int in_ECX; int iStack_14; Vector local_10; bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),&DAT_00b64bd4,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x78)); *(undefined1 *)(in_ECX + 0x8c) = 1; } uVar4 = Random(); local_10.x = *(float *)(param_1 + 0x33c); local_10.y = *(float *)(param_1 + 0x340); pEVar5 = Game::SpawnEx(g_game,1000,0xf,&local_10,&g_vectorZero,(Entity *)0x0,0,uVar4,0); (**(code **)(*(int *)pEVar5 + 0xc))(); pMVar2 = g_manager; iStack_14 = 0x16; seed_fart_sound_override(&iStack_14); SoundEffects::Play(&pMVar2->_sfxManager,iStack_14,1.0,2,0,1.0,0.0); uVar4 = *(uint *)(in_ECX + 0x3dc); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *(uint *)(in_ECX + 0x3dc); if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)(in_ECX + 0x3e0) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)(in_ECX + 0x3e4) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)(in_ECX + 1000) & 0x1f) ^ uVar4; *(uint *)(in_ECX + 0x3dc) = uVar4; FUN_0075d9f0(uVar4); return; } //@@ 00665500 Entity_Slot::SetPrizeType /* DB: ? writes 0x540, reloads graphics per variant 15/16 */ void __thiscall Entity_Slot::SetPrizeType(Entity_Slot *this,float param_2) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; byte bVar5; this[1]._sprite._championColor._colorize[2] = param_2; if (this->_variant == 0xf) { uVar1 = g_game->_debugCurses; uVar2 = g_game->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); bVar5 = (byte)(~uVar4 >> 6) & (byte)((uVar3 | uVar1 | uVar2) >> 6) & 1; Entity_Pickup::load_collectible_gfx (this[1]._sprite._championColor._colorize[2],(this->_dropRNG)._seed); ANM2::LoadGraphics((ANM2 *)&this[1]._index,bVar5); return; } if (this->_variant == 0x10) { uVar1 = g_game->_debugCurses; uVar2 = g_game->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); bVar5 = (byte)(~uVar4 >> 6) & (byte)((uVar3 | uVar1 | uVar2) >> 6) & 1; Entity_Pickup::load_collectible_gfx (this[1]._sprite._championColor._colorize[2],(this->_dropRNG)._seed); ANM2::LoadGraphics(&this->_sprite,bVar5); } return; } //@@ 006655e0 FUN_006655e0 void FUN_006655e0(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x350) = 0xc1000000; *(undefined4 *)(in_ECX + 0x374) = 0x3fc00000; *(undefined4 *)(in_ECX + 0x378) = 0x3f400000; FUN_00665630(); *(uint *)(in_ECX + 0x168) = *(uint *)(in_ECX + 0x168) | 0x4000000; *(undefined4 *)(in_ECX + 0x16c) = *(undefined4 *)(in_ECX + 0x16c); return; } //@@ 00665630 FUN_00665630 void FUN_00665630(void) { int iVar1; int iVar2; int iVar3; byte bVar4; int in_ECX; bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),(byte *)"Prize",1); if (((bVar4 != 0) && (*(int *)(in_ECX + 0x7c) != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x78),0.0), *(int *)(in_ECX + 0x7c) != 0)) { *(undefined1 *)(in_ECX + 0x8c) = 0; } iVar1 = g_game->_reviveMachineCoinsLeft; if (*(int *)(in_ECX + 0x7c) == 0) { return; } if ((1 < *(int *)(*(int *)(in_ECX + 0x78) + 0x80)) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 1 < *(int *)(*(int *)(in_ECX + 0x78) + 0x80))) { iVar2 = *(int *)(in_ECX + 0x7c); iVar3 = *(int *)(iVar2 + 0x3c); if ((iVar2 == 0) || ((iVar3 < 0 || (*(int *)(iVar2 + 0x1c) <= iVar3)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)(in_ECX + 0x80) + iVar3 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(in_ECX + 0x78),iVar3,(float)((iVar1 / 10) % 10)); } if (*(int *)(in_ECX + 0x7c) != 0) { if ((*(int *)(*(int *)(in_ECX + 0x78) + 0x80) < 3) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)(*(int *)(in_ECX + 0x78) + 0x80) < 3)) { return; } iVar2 = *(int *)(in_ECX + 0x7c); iVar3 = *(int *)(iVar2 + 0x40); if (((iVar2 == 0) || (iVar3 < 0)) || (*(int *)(iVar2 + 0x1c) <= iVar3)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)(in_ECX + 0x80) + iVar3 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(in_ECX + 0x78),iVar3,(float)(iVar1 % 10)); } return; } //@@ 006657a0 Entity_Slot::HandleCollision /* ZHL [exact] bool HandleCollision(Entity *Collider, bool Low); */ void __thiscall Entity_Slot::HandleCollision (Entity_Slot *this,uint param_2,uint param_3,int param_4,uint *param_5,float *param_6, Vector *param_7) { code *pcVar1; bool bVar2; byte bVar3; uint uVar4; uint uVar5; Vector *velocity; int iVar6; uint uVar7; float fVar8; float fVar9; Vector local_30; Vector local_28; Vector local_20; undefined8 local_14; if (0 < param_4) { do { iVar6 = 0; local_30.x = g_vectorZero.x; local_30.y = g_vectorZero.y; do { uVar4 = *param_5; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *param_5; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)param_5[1] & 0x1f) ^ uVar4; local_14 = 0x100000003; uVar4 = uVar4 << ((byte)param_5[2] & 0x1f) ^ uVar4; uVar5 = uVar4 >> ((byte)param_5[3] & 0x1f); uVar7 = uVar5 ^ uVar4; *param_5 = uVar7; if (uVar5 == uVar4) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = uVar7 >> 3 ^ uVar7; uVar7 = uVar7 << 1 ^ uVar7; uVar7 = uVar7 >> 0xe ^ uVar7; fVar8 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10 * 3.14; fVar8 = fVar8 + fVar8; fVar9 = cos(fVar8); local_30.x = fVar9 * 5.0; fVar8 = sin(fVar8); local_28.x = fVar9 * 5.0 * 7.0 + (this->_pos).x; local_30.y = fVar8 * 5.0 * 0.2 + 3.0; local_28.y = local_30.y * 7.0 + (this->_pos).y; bVar3 = Room::CheckLine(g_game->_room,&this->_pos,&local_28,1,0,0,0,(Vector *)0x0); } while ((bVar3 == 0) && (iVar6 = iVar6 + 1, iVar6 < 10)); uVar4 = (this->_dropRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (this->_dropRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar4; (this->_dropRNG)._seed = uVar4; if ((param_7->x == g_vectorZero.x) && (param_7->y == g_vectorZero.y)) { bVar2 = false; } else { bVar2 = true; } local_20.x = *param_6 + (this->_pos).x; local_20.y = param_6[1] + (this->_pos).y; velocity = &local_30; if (bVar2) { velocity = param_7; } Game::SpawnEx(g_game,5,param_2,&local_20,velocity,(Entity *)0x0,param_3,uVar4,0); param_4 = param_4 + -1; } while (param_4 != 0); } return; } //@@ 00665a30 FUN_00665a30 void FUN_00665a30(void) { return; } //@@ 00665a50 FUN_00665a50 void FUN_00665a50(void) { uint *in_ECX; *in_ECX = *in_ECX ^ DAT_00c348b0; in_ECX[1] = in_ECX[1] ^ DAT_00c348b4; in_ECX[2] = in_ECX[2] ^ DAT_00c348b8; in_ECX[3] = in_ECX[3] ^ DAT_00c348bc; return; } //@@ 00665a80 Entity::CollidesWithGrid /* ZHL [lua] Lua binding Entity:CollidesWithGrid */ undefined1 Entity::CollidesWithGrid(void) { int in_ECX; return *(undefined1 *)(in_ECX + 400); } //@@ 00665a90 FUN_00665a90 void FUN_00665a90(Entity *param_1) { uint *puVar1; uint *_Dst; uint uVar2; uint uVar3; int *in_ECX; uint uVar4; uVar3 = Entity::GetHitListIndex(param_1); puVar1 = (uint *)in_ECX[1]; _Dst = (uint *)*in_ECX; uVar4 = (int)puVar1 - (int)_Dst >> 2; while (uVar2 = uVar4, 0 < (int)uVar2) { uVar4 = uVar2 >> 1; if (_Dst[uVar4] < uVar3) { _Dst = _Dst + uVar4 + 1; uVar4 = uVar2 + (-1 - uVar4); } } if ((_Dst != puVar1) && (*_Dst == uVar3)) { memmove(_Dst,_Dst + 1,(int)puVar1 - (int)(_Dst + 1)); in_ECX[1] = in_ECX[1] + -4; } return; } //@@ 00665b00 Entity_Tear::GetRootPlayer /* DB: walks +0x3c8, returns if type 1 */ EntityPtr __thiscall Entity_Tear::GetRootPlayer(Entity_Tear *this) { EntityPtr EVar1; EntityPtr EVar2; EVar2 = this->_spawnerEntity; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { this = (Entity_Tear *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3c8); } if (*(int *)((int)this + 0x28) != 1) { this = (Entity_Tear *)0x0; } return (EntityPtr)this; } //@@ 00665b30 FUN_00665b30 void FUN_00665b30(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x828) = 0; *(undefined4 *)(in_ECX + 0x82c) = 0; *(undefined4 *)(in_ECX + 0x830) = 0; *(undefined4 *)(in_ECX + 0x834) = 0; return; } //@@ 00665b70 FUN_00665b70 void FUN_00665b70(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xc) = param_1; return; } //@@ 00665b80 FUN_00665b80 void FUN_00665b80(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int in_ECX; *(undefined4 *)(in_ECX + 0x420) = param_1; *(undefined4 *)(in_ECX + 0x424) = param_2; *(undefined4 *)(in_ECX + 0x428) = param_3; *(undefined4 *)(in_ECX + 0x42c) = param_4; return; } //@@ 00665ba0 FUN_00665ba0 undefined1 FUN_00665ba0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x465); } //@@ 00665bb0 FUN_00665bb0 undefined1 FUN_00665bb0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x466); } //@@ 00665bc0 FUN_00665bc0 void FUN_00665bc0(undefined2 param_1) { int in_ECX; *(undefined2 *)(in_ECX + 0x4ec) = param_1; *(undefined2 *)(in_ECX + 0x4ee) = 0; return; } //@@ 00665be0 FUN_00665be0 void FUN_00665be0(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x460) = in_XMM1_Da; return; } //@@ 00665bf0 FUN_00665bf0 void FUN_00665bf0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x4e8) = param_1; return; } //@@ 00665c00 FUN_00665c00 void FUN_00665c00(void) { return; } //@@ 00665c10 Entity_Player::GetTractorBeam /* ZHL [lua] Lua binding EntityPlayer:GetTractorBeam */ int __thiscall Entity_Player::GetTractorBeam(Entity_Player *this) { return this->_tractorBeam; } //@@ 00665c20 Entity_Player::get_laser_color_copy /* DB: copies the 0x2c-byte _laserColor ColorMod at +0x14c4 into the out pointer prototype: db/protos.zhl, confirmed by RET 4 */ ColorMod * __thiscall Entity_Player::get_laser_color_copy(Entity_Player *this,ColorMod *outColor) { float fVar1; float fVar2; float fVar3; fVar1 = (this->_laserColor)._tint[1]; fVar2 = (this->_laserColor)._tint[2]; fVar3 = (this->_laserColor)._tint[3]; outColor->_tint[0] = (this->_laserColor)._tint[0]; outColor->_tint[1] = fVar1; outColor->_tint[2] = fVar2; outColor->_tint[3] = fVar3; fVar1 = (this->_laserColor)._colorize[1]; fVar2 = (this->_laserColor)._colorize[2]; fVar3 = (this->_laserColor)._colorize[3]; outColor->_colorize[0] = (this->_laserColor)._colorize[0]; outColor->_colorize[1] = fVar1; outColor->_colorize[2] = fVar2; outColor->_colorize[3] = fVar3; fVar1 = (this->_laserColor)._offset[2]; *(undefined8 *)outColor->_offset = *(undefined8 *)(this->_laserColor)._offset; outColor->_offset[2] = fVar1; return outColor; } //@@ 00665c60 Game::IsInTimedSet /* DB: ? std::set lookup with value<=param check, Game+0x1bbd8 end prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Game::IsInTimedSet(Game *this,int key) { int iVar1; undefined1 local_10 [8]; void *local_8; iVar1 = key; std::set::find_node(local_10,&key); if ((*(char *)((int)local_8 + 0xd) == '\0') && (*(int *)((int)local_8 + 0x10) <= iVar1)) { return local_8 != (this->_seedEffects)._seedEffects; } return 0; } //@@ 00665cc0 FUN_00665cc0 undefined1 FUN_00665cc0(void) { int in_ECX; if (((((in_ECX == 2) || (in_ECX == 0x16)) || (in_ECX == 0x1a)) || ((in_ECX == 0x1b || (in_ECX == 0x1c)))) || ((in_ECX == 0x1d || ((in_ECX == 0x1e || (in_ECX == 0x30)))))) { return 0; } return 1; } //@@ 00665cf0 Entity_Tear::Constructor /* ZHL [exact] __thiscall void Entity_Tear::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Tear::Constructor(Entity_Tear *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af776d; local_10 = ExceptionList; ExceptionList = &local_10; Entity::constructor((Entity *)this); *(undefined ***)this = IsaacRepentancePlus::Entity_Tear::vftable; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; (this->_continueVelocity).y = 0.0; (this->_continueVelocity).x = 0.0; (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; (this->_stickDiff).y = 0.0; (this->_stickDiff).x = 0.0; this->_linkPrev = (EntityPtr)0x0; this->_linkNext = (EntityPtr)0x0; this->_attachedEffect = (EntityPtr)0x0; *(undefined4 *)&this->field_0x4a0 = 0; *(undefined4 *)&this->field_0x4a4 = 0; local_8 = 6; ANM2::constructor(&this->_tearHaloANM2); local_8._0_1_ = 7; ANM2::constructor(&this->_tearEffectANM2); local_8 = CONCAT31(local_8._1_3_,8); ANM2::constructor(&this->_deadEyeANM2); (this->_posDisplacement).y = 0.0; (this->_posDisplacement).x = 0.0; (this->_parentOffset).y = 0.0; (this->_parentOffset).x = 0.0; (this->_holdOffset).y = 0.0; (this->_holdOffset).x = 0.0; (this->_holdVelocity).y = 0.0; (this->_holdVelocity).x = 0.0; (this->_orbitVelocity).y = 0.0; (this->_orbitVelocity).x = 0.0; *(undefined4 *)&this[1].field_0x4 = 0; this[1]._damageEvents._begin = (void *)0x0; this[1]._damageEvents._end = (void *)0x0; this[1]._damageEvents._capacity = (void *)0x0; ExceptionList = local_10; return; } //@@ 00665ea0 Entity_Tear::Free /* ZHL [vtable slot 0] */ Entity_Tear * __thiscall Entity_Tear::Free(Entity_Tear *this,byte param_2) { ~Entity_Tear(); if ((param_2 & 1) != 0) { operator_delete(this,0x848); } return this; } //@@ 00665ed0 Entity_Tear::~Entity_Tear /* DB: sets Entity_Tear vftable, resets the tear's three ANM2s and AnimationStates, releases its EntityPtrs, then the Entity base; only caller Entity_Tear::Free (scalar deleting destructor) */ void Entity_Tear::~Entity_Tear(void) { AnimationState *pAVar1; int *piVar2; byte *pbVar3; float *pfVar4; Entity *in_ECX; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af7790; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Tear::vftable; local_8 = 0; local_14 = in_ECX; ANM2::Reset((ANM2 *)&in_ECX[1]._entityRef4._position); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._pausePosition.y); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._knockbackCountdown); std::string::_Tidy_deallocate((char *)&in_ECX[1]._poisonDamageTimer); std::string::_Tidy_deallocate((char *)&in_ECX[1]._entityRef4._position); local_8 = 1; ANM2::Reset((ANM2 *)&in_ECX[1]._colorParams._capacity); AnimationState::~AnimationState((AnimationState *)in_ECX[1]._splatColor._offset); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._splatColor); std::string::_Tidy_deallocate((char *)(in_ECX[1]._color._colorize + 1)); std::string::_Tidy_deallocate((char *)&in_ECX[1]._colorParams._capacity); local_8 = 2; ANM2::Reset((ANM2 *)&in_ECX[1]._sprite._overlayAnimState._layerFrames); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._sprite._color); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._sprite._numNullLayers); std::string::_Tidy_deallocate((char *)&in_ECX[1]._sprite._overlayRenderFirst); std::string::_Tidy_deallocate((char *)&in_ECX[1]._sprite._overlayAnimState._layerFrames); pAVar1 = &in_ECX[1]._sprite._overlayAnimState; if (pAVar1->_animation != (void *)0x0) { local_14 = (Entity *)pAVar1; std::multiset::erase(&local_14); pAVar1->_animation = (void *)0x0; } piVar2 = &in_ECX[1]._sprite._animState._previouslyTriggeredEvents; if (*piVar2 != 0) { local_14 = (Entity *)piVar2; std::multiset::erase(&local_14); *piVar2 = 0; } piVar2 = &in_ECX[1]._sprite._animState._currentlyTriggeredEvents; if (*piVar2 != 0) { local_14 = (Entity *)piVar2; std::multiset::erase(&local_14); *piVar2 = 0; } pbVar3 = &in_ECX[1]._sprite._animState._isPlaying; if (*(int *)pbVar3 != 0) { local_14 = (Entity *)pbVar3; std::multiset::erase(&local_14); *(undefined4 *)pbVar3 = 0; } pfVar4 = &in_ECX[1]._sprite._animState._animFrame; if (*pfVar4 != 0.0) { local_14 = (Entity *)pfVar4; std::multiset::erase(&local_14); *pfVar4 = 0.0; } FID_conflict__Tidy(&in_ECX[1]._spawnerVariant); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 006660a0 Entity_Tear::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Entity_Tear::Init(Entity_Tear *this,int type,int variant,int subType,uint initSeed) { uint uVar1; LayerState *layer; int iVar2; char *pcVar3; float heightOffsetY; EntityPtr *local_48; std_string bulletAnm2Path; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; Game *game; byte *layerIndex; EntityPtr *linkPrevSlot; local_8 = 0xffffffff; puStack_c = &LAB_00af77c5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; Entity::Init((Entity *)this,type,variant,subType,initSeed); if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); } this->_entityGridCollisionClass = 4; this->_collisionDamage = 3.5; this->_baseDamage = 3.5; uVar1 = Random(); this->_fallingAccel = 0.0; this->_height = -23.0; this->_fallingSpeed = ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 0.2; heightOffsetY = get_height_offset_y(this,-23.0); game = g_game; (this->_posOffset).y = heightOffsetY; if (*(int *)((int)game->_room + 8) == 0x10) { (this->_posOffset).y = -18.0; } this->_homingFriction = 0.85; linkPrevSlot = &this->_linkPrev; this->_fScale = 1.0; this->_baseScale = 1.0; this->_rotation = 0.0; this->_scaleAnimNum = -1; this->_knockbackMultiplier = 1.7; this->_maxHitPoints = 0.0; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; this->_waitFrames = 0; (this->_continueVelocity).x = g_vectorZero.x; (this->_continueVelocity).y = g_vectorZero.y; (this->_hitList)._end = (this->_hitList)._begin; (this->_posDisplacement).x = g_vectorZero.x; (this->_posDisplacement).y = g_vectorZero.y; (this->_parentOffset).x = g_vectorZero.x; (this->_parentOffset).y = g_vectorZero.y; this->_stickTarget = (void *)0x0; (this->_stickDiff).x = g_vectorZero.x; (this->_stickDiff).y = g_vectorZero.y; this->_techZeroLaser = (EntityPtr)0x0; this->_techZeroTarget = (EntityPtr)0x0; this->_laserShotLaser = (EntityPtr)0x0; if (*linkPrevSlot != (EntityPtr)0x0) { local_48 = linkPrevSlot; std::multiset::erase(&local_48); *linkPrevSlot = (EntityPtr)0x0; } if (this->_linkNext != (EntityPtr)0x0) { local_48 = &this->_linkNext; std::multiset::erase(&local_48); this->_linkNext = (EntityPtr)0x0; } *(undefined4 *)&this->field_0x4a8 = 0; this->_deadEyeIntensity = 0.0; this->_multidimensionalTouched = 0; this->_prismTouched = 0; this->_isFireSoundPending = 1; this->field_0x46b = 0; this->_canTriggerStreakEnd = 1; this->_isHovering = 0; this->_isFireSoundMuted = 0; (this->_holdOffset).x = g_vectorZero.x; (this->_holdOffset).y = g_vectorZero.y; this->_holdTimer = 0; *(undefined4 *)&this->_popBounceCount = 0; this->_hitCount = 0; this->_deathFlags = 0; uVar1 = g_graphicsManager_flags; if (this->_variant == 0x25) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); iVar2 = 1; if ((uVar1 & 4) == 0) { iVar2 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar2; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; } this->_orbitAngle = 0.0; this->_orbitRadius = 0.0; (this->_orbitVelocity).x = g_vectorZero.x; (this->_orbitVelocity).y = g_vectorZero.y; this->_tearRange = 260.0; this->_tearIdx = -1; *(undefined4 *)&this[1].field_0x4 = 0; this[1]._damageEvents._begin = (void *)0x0; this[1]._damageEvents._end = (void *)0x0; this[1]._damageEvents._capacity = (void *)0x0; iVar2 = this->_variant; this[1]._pendingDamage = 0.0; *(undefined4 *)&this[1]._pendingDamageFlags = 0x1e; *(undefined4 *)((int)&this[1]._pendingDamageFlags + 4) = 0x3c75c28f; game = g_game; if (iVar2 == 0xd) { local_48 = (EntityPtr *)&DAT_0000004f; std::set::find_node(local_2c._buf + 0xc,&local_48); if (((*(char *)(local_2c._capacity + 0xd) != '\0') || (0x4f < *(int *)(local_2c._capacity + 0x10))) || ((void *)local_2c._capacity == (game->_seedEffects)._seedEffects)) goto LAB_0066669b; bulletAnm2Path._size = 0; bulletAnm2Path._capacity = 0xf; bulletAnm2Path._buf[0] = '\0'; bulletAnm2Path._buf[1] = '\0'; bulletAnm2Path._buf[2] = '\0'; bulletAnm2Path._buf[3] = '\0'; bulletAnm2Path._buf._0_4_ = std::_Allocate(0x30); bulletAnm2Path._size = 0x20; bulletAnm2Path._capacity = 0x2f; builtin_strncpy((char *)bulletAnm2Path._buf._0_4_,"gfx/promo/gfuel/bullet tear.anm2",0x21); local_8 = 0; ANM2::Load(&this->_sprite,&bulletAnm2Path,1); local_8 = 0xffffffff; if (0xf < bulletAnm2Path._capacity) { uVar1 = bulletAnm2Path._capacity + 1; pcVar3 = (char *)bulletAnm2Path._buf._0_4_; if (0xfff < uVar1) { pcVar3 = *(char **)(bulletAnm2Path._buf._0_4_ + -4); uVar1 = bulletAnm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(bulletAnm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar1); } layerIndex = (byte *)0x0; } else { if (iVar2 != 0x17) goto LAB_0066669b; local_48 = (EntityPtr *)&DAT_0000004f; std::set::find_node(local_2c._buf + 0xc,&local_48); if (((*(char *)(local_2c._capacity + 0xd) != '\0') || (0x4f < *(int *)(local_2c._capacity + 0x10))) || ((void *)local_2c._capacity == (game->_seedEffects)._seedEffects)) goto LAB_0066669b; local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x1c; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/promo/gfuel/missile.anm2",0x1d); local_8 = 1; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar1 = local_2c._capacity + 1; pcVar3 = (char *)local_2c._buf._0_4_; if (0xfff < uVar1) { pcVar3 = *(char **)(local_2c._buf._0_4_ + -4); uVar1 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar1); } local_2c._size = 0; local_2c._capacity = (uint)&DAT_0000000f; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; layerIndex = (byte *)0x1; } uVar1 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_sprite,layerIndex); iVar2 = 1; if ((uVar1 & 4) == 0) { iVar2 = 6; } layer->_blendMode[4] = 1; layer->_blendMode[3] = 1; layer->_blendMode[2] = 1; layer->_blendMode[1] = iVar2; layer->_blendMode[0] = 0; LAB_0066669b: FUN_008629c0(this); ExceptionList = local_10; return; } //@@ 006666c0 Entity_Tear::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_Tear::ClearReferences(Entity_Tear *this) { EntityPtr *pEVar1; EntityPtr *pEVar2; int iVar3; EntityPtr EVar4; Entity_Tear *apEStack_c [2]; pEVar1 = &this->_techZeroLaser; apEStack_c[0] = this; if (this->_techZeroLaser != (EntityPtr)0x0) { (**(code **)(*(int *)this->_techZeroLaser + 0x28))(); } pEVar2 = &this->_laserShotLaser; if (this->_laserShotLaser != (EntityPtr)0x0) { (**(code **)(*(int *)this->_laserShotLaser + 0x28))(); } Entity::ClearReferences((Entity *)this); ANM2::Reset(&this->_tearHaloANM2); ANM2::Reset(&this->_tearEffectANM2); ANM2::Reset(&this->_deadEyeANM2); if (this->_stickTarget != (void *)0x0) { apEStack_c[0] = (Entity_Tear *)&this->_stickTarget; std::multiset::erase(apEStack_c); } this->_stickTarget = (void *)0x0; if (*pEVar1 != (EntityPtr)0x0) { apEStack_c[0] = (Entity_Tear *)pEVar1; std::multiset::erase(apEStack_c); } *pEVar1 = (EntityPtr)0x0; pEVar1 = &this->_techZeroTarget; if (*pEVar1 != (EntityPtr)0x0) { apEStack_c[0] = (Entity_Tear *)pEVar1; std::multiset::erase(apEStack_c); } *pEVar1 = (EntityPtr)0x0; if (*pEVar2 != (EntityPtr)0x0) { apEStack_c[0] = (Entity_Tear *)pEVar2; std::multiset::erase(apEStack_c); } *pEVar2 = (EntityPtr)0x0; pEVar1 = &this->_linkPrev; if (*pEVar1 != (EntityPtr)0x0) { EVar4 = this->_linkNext; if (EVar4 != (EntityPtr)0x0) { if (*(int *)((int)*pEVar1 + 0x28) == 2) { FUN_0067dac0(&this->_linkNext); EVar4 = this->_linkNext; } if (*(int *)((int)EVar4 + 0x28) == 2) { FUN_0067dac0(pEVar1); } } } if (*pEVar1 != (EntityPtr)0x0) { apEStack_c[0] = (Entity_Tear *)pEVar1; std::multiset::erase(apEStack_c); *pEVar1 = (EntityPtr)0x0; } if (this->_linkNext != (EntityPtr)0x0) { apEStack_c[0] = (Entity_Tear *)&this->_linkNext; std::multiset::erase(apEStack_c); this->_linkNext = (EntityPtr)0x0; } if (this->_attachedEffect != (EntityPtr)0x0) { (**(code **)(*(int *)this->_attachedEffect + 0x28))(); } if (((((uint)(this->_tearFlags)._l & (uint)g_tearFlagLudovico._l) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagLudovico._l._4_4_) != 0) || (((uint)(this->_tearFlags)._h & (uint)g_tearFlagLudovico._h) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagLudovico._h._4_4_) != 0)) && (EVar4 = this->_child, EVar4 != (EntityPtr)0x0)) { iVar3 = *(int *)((int)EVar4 + 0x28); while (iVar3 == 2) { (**(code **)(*(int *)EVar4 + 0x28))(); EVar4 = *(EntityPtr *)((int)EVar4 + 0x3c0); if (EVar4 == (EntityPtr)0x0) { return; } iVar3 = *(int *)((int)EVar4 + 0x28); } } return; } //@@ 006668c0 Entity_Tear::apply_wiggle /* DB: ? sinusoidal offset perpendicular to velocity (wiggle worm style), flag 0x450&1 phase */ void __thiscall Entity_Tear::apply_wiggle(Entity_Tear *this) { float fVar1; float in_XMM1_Da; float fVar2; float local_18; float local_14; local_18 = (this->_velocity).y; local_14 = -(this->_velocity).x; fVar2 = local_18 * local_18; fVar1 = sqrtf(local_14 * local_14 + fVar2); if (0.0 < fVar1) { local_18 = (1.0 / fVar1) * local_18; local_14 = local_14 * (1.0 / fVar1); } fVar1 = (this->_velocity).x; fVar1 = sqrtf(fVar1 * fVar1 + fVar2); fVar1 = fVar1 * 0.5; if (5.0 <= fVar1) { fVar1 = 5.0; } if ((this->_tearIdx & 1) == 0) { fVar2 = 0.0; } else { fVar2 = 3.1415927; } fVar2 = cos(((float)(g_game->_frameCount - this->_spawnFrame) + 0.5) * 0.7 + fVar2); fVar2 = fVar2 * fVar1 * in_XMM1_Da; (this->_pos).x = local_18 * fVar2 + (this->_pos).x; (this->_pos).y = local_14 * fVar2 + (this->_pos).y; return; } //@@ 00666a00 Entity_Tear::apply_wiggle /* DB: sin/cos offset perpendicular to velocity; Update/Interpolate */ void __thiscall Entity_Tear::apply_wiggle(Entity_Tear *this) { uint uVar1; float fVar2; float fVar3; float in_XMM1_Da; float fVar4; float fVar5; float fVar6; uVar1 = g_manager->_framecount & 0x80000001; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffe) + 1; } fVar6 = (this->_velocity).y; fVar4 = (float)(g_game->_frameCount - this->_spawnFrame) + (float)(int)uVar1 * 0.5; fVar5 = (this->_velocity).x; if (ABS(fVar5) <= ABS(fVar6)) { fVar4 = fVar4 * 0.7; } else { fVar4 = -fVar4 * 0.7 + 1.5707964; } fVar2 = cos(fVar4); fVar4 = sin(fVar4); fVar3 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if (0.0 < fVar3) { fVar5 = fVar5 * (1.0 / fVar3); fVar6 = fVar6 * (1.0 / fVar3); } (this->_pos).x = fVar2 * fVar6 * 10.0 * in_XMM1_Da + fVar2 * fVar5 * 20.0 + (this->_pos).x; (this->_pos).y = -fVar5 * fVar4 * 10.0 * in_XMM1_Da + fVar4 * fVar6 * 20.0 + (this->_pos).y; return; } //@@ 00666ba0 Entity_Tear::update_wiggle /* DB: sin/cos lateral offset over frame count, Update/Interpolate */ void __thiscall Entity_Tear::update_wiggle(Entity_Tear *this) { uint uVar1; float fVar2; float fVar3; float in_XMM1_Da; float fVar4; float fVar5; float fVar6; uVar1 = g_manager->_framecount & 0x80000001; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffe) + 1; } fVar6 = (this->_velocity).y; fVar5 = (float)(g_game->_frameCount - this->_spawnFrame) + (float)(int)uVar1 * 0.5; fVar4 = (this->_velocity).x; if (ABS(fVar4) <= ABS(fVar6)) { fVar5 = fVar5 * 0.2; } else { fVar5 = -fVar5 * 0.2 + 1.5707964; } fVar2 = cos(fVar5); fVar5 = sin(fVar5); fVar3 = sqrtf(fVar4 * fVar4 + fVar6 * fVar6); if (0.0 < fVar3) { fVar4 = fVar4 * (1.0 / fVar3); fVar6 = fVar6 * (1.0 / fVar3); } (this->_pos).x = fVar2 * fVar6 * 15.0 * in_XMM1_Da + fVar2 * fVar4 * 15.0 + (this->_pos).x; (this->_pos).y = -fVar4 * fVar5 * 15.0 * in_XMM1_Da + fVar5 * fVar6 * 15.0 + (this->_pos).y; return; } //@@ 00666d40 Entity_Tear::play_fire_sound /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Entity_Tear::Update when +0x46a pending flag: skips variants 9/40/46, variant 50 -> sound 0xed, else 0x99 SOUND_TEARS_FIRE (pitch 1.2 for variants 13/23 with seed effect 0x4f) */ void __thiscall Entity_Tear::play_fire_sound(Entity_Tear *this) { int iVar1; byte bVar2; uint uVar3; Manager *pMVar4; float fVar5; int local_14; uint local_10; float local_c; iVar1 = this->_variant; this->_isFireSoundPending = 0; pMVar4 = g_manager; if ((((iVar1 != 9) && (iVar1 != 0x2e)) && (this->_isFireSoundMuted == 0)) && (iVar1 != 0x28)) { if (iVar1 == 0x32) { local_14 = 0xed; seed_fart_sound_override(&local_14); fVar5 = 1.2; } else { if (((iVar1 == 0xd) || (iVar1 == 0x17)) && (bVar2 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f), bVar2 != 0)) goto LAB_00666e14; pMVar4 = g_manager; local_14 = 0x99; seed_fart_sound_override(&local_14); fVar5 = 1.0; } SoundEffects::Play(&pMVar4->_sfxManager,local_14,1.0,2,0,fVar5,0.0); } LAB_00666e14: pMVar4 = g_manager; local_10 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34a0c; uVar3 = (uint)(this->_tearFlags)._h; if ((((uint)(this->_tearFlags)._l & DAT_00c34a00) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34a04) != 0) || ((uVar3 & DAT_00c34a08) != 0 || local_10 != 0)) { local_14 = 0x364; seed_fart_sound_override(&local_14); SoundEffects::Play(&pMVar4->_sfxManager,local_14,1.0,2,0,1.0,0.0); uVar3 = (uint)(this->_tearFlags)._h; } local_10 = (uint)(this->_tearFlags)._l; if (((local_10 & DAT_00c34b60) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b64) != 0) || ((uVar3 & DAT_00c34b68) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b6c) != 0)) { if (this->_fallingSpeed < 0.0) { this->_fallingSpeed = this->_fallingSpeed * 3.0; } this->_isHovering = 1; } uVar3 = (uint)(this->_tearFlags)._h; if (((local_10 & _DAT_00c345e0) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c345e4) == 0) && ((uVar3 & _DAT_00c345e8) == 0 && (*(uint *)((int)&(this->_tearFlags)._h + 4) & _DAT_00c345ec) == 0)) { if (((local_10 & DAT_00c34860) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34864) != 0) || ((uVar3 & DAT_00c34868) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3486c) != 0)) { this->_fallingSpeed = this->_fallingSpeed * 0.5; this->_fallingAccel = (this->_fallingAccel + 0.08) * 0.25 - 0.08; } } else { this->_isHovering = 0; this->_fallingSpeed = this->_fallingSpeed - 15.0; this->_fallingAccel = this->_fallingAccel + 3.0; } if (*(int *)((int)g_game->_room + 8) == 0x10) { (this->_pos).y = (this->_pos).y - 4.0; if ((0.0 < this->_fallingAccel) && (fVar5 = (this->_velocity).y, fVar5 < ABS((this->_velocity).x))) { (this->_velocity).y = this->_fallingSpeed * 0.5 + fVar5; } fVar5 = (this->_velocity).x; if (ABS((this->_velocity).y) < ABS(fVar5)) { local_c = (this->_velocity).y; fVar5 = sqrtf(local_c * local_c + fVar5 * fVar5); if (0.0 < fVar5) { local_c = (this->_velocity).y * (1.0 / fVar5); } if ((0.0 < local_c) && (local_c < 0.05)) { (this->_velocity).y = 0.0; } } } return; } //@@ 006670f0 Entity_Tear::Update /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Tear::Update(Entity_Tear *this) { void *pvVar1; code *pcVar2; BitSet128 flags; BitSet128 flags_00; BitSet128 flags_01; BitSet128 tearFlags; BitSet128 flags_02; Vector pos; qword qVar3; undefined1 *puVar4; byte bVar5; char cVar6; BitSet128 *pBVar7; int iVar8; BitSet128 *pBVar9; TemporaryEffects *playerEffects; Room *room; Seeds *seeds; Entity_Familiar *familiar; Vector *pVVar10; uint uVar11; Entity *familiar; EntityList *entityList; int *piVar13; undefined4 *puVar14; EntityPtr EVar15; Vector *pVVar16; Entity_Laser *laser; float *pfVar17; Entity_Player *pEVar18; uint uVar19; Entity_Knife *knife; char *_Str1; AnimationState *animState; EntityPtr *pEVar20; LayerState *layer; byte *layerCount; Entity_Effect *effect; Sprite *sprite; int tintedRockIdx; PersistentGameData *persistentGameData; GridEntity *gridEntity; PlayerManager *playerManager; RNG *playerEffects; Entity_Tear *spawnedTear; Font *laser; ANM2 *pAVar21; byte *layerIndex; Vector *pVVar22; bool bVar23; float10 fVar24; float fVar25; EntityPtr EVar26; EntityPtr EVar27; Entity_Projectile *pEVar28; undefined1 extraout_var [12]; undefined1 auVar29 [16]; undefined1 extraout_var_00 [12]; undefined1 extraout_var_01 [12]; undefined1 extraout_var_02 [12]; undefined1 extraout_var_03 [12]; undefined1 extraout_var_04 [12]; undefined1 extraout_var_05 [12]; undefined1 extraout_var_06 [12]; undefined1 extraout_var_07 [12]; undefined1 extraout_var_08 [12]; undefined1 extraout_var_09 [12]; undefined1 extraout_var_10 [12]; undefined1 auVar31 [12]; undefined1 extraout_var_11 [12]; undefined1 auVar30 [16]; undefined1 extraout_var_12 [12]; undefined1 extraout_var_13 [12]; undefined1 extraout_var_14 [12]; undefined1 extraout_var_15 [12]; undefined1 extraout_var_16 [12]; undefined1 extraout_var_17 [12]; undefined1 extraout_var_18 [12]; undefined1 extraout_var_19 [12]; undefined1 extraout_var_20 [12]; undefined1 extraout_var_21 [12]; undefined1 extraout_var_22 [12]; undefined1 extraout_var_23 [12]; undefined1 extraout_var_24 [12]; undefined1 extraout_var_25 [12]; undefined1 extraout_var_26 [12]; undefined1 extraout_var_27 [12]; Color aCStackY_3c4c [128]; BitSet128 *pBVar32; BitSet128 *pBVar33; int variant; Vector *in_stack_ffffd9fc; TypeDescriptor *outResult; undefined1 uVar34; undefined1 uVar35; undefined2 uVar36; size_t _MaxCount; undefined4 uVar37; EntityRef local_25e8; EntityRef local_25c0; EntityRef local_2598; EntityRef local_2570; BitSet128 local_2548; BitSet128 local_2538; BitSet128 local_2528; BitSet128 local_2518; BitSet128 local_2508; BitSet128 local_24f8; BitSet128 local_24e8; BitSet128 local_24d8; BitSet128 local_24c8; BitSet128 local_24b8; BitSet128 local_24a8; BitSet128 local_2498; BitSet128 local_2488; BitSet128 local_2478; BitSet128 local_2468; BitSet128 local_2458; BitSet128 local_2448; BitSet128 local_2438; BitSet128 local_2428; BitSet128 local_2418; BitSet128 local_2408; BitSet128 local_23f8; BitSet128 local_23e8; BitSet128 local_23d8; BitSet128 local_23c8; BitSet128 local_23b8; BitSet128 local_23a8; BitSet128 local_2398; BitSet128 local_2388; BitSet128 local_2378; BitSet128 local_2368; BitSet128 local_2358; BitSet128 local_2348; BitSet128 local_2338; BitSet128 local_2328; BitSet128 local_2318; BitSet128 local_2308; BitSet128 local_22f8; BitSet128 local_22e8; BitSet128 local_22d8; BitSet128 local_22c8; BitSet128 local_22b8; BitSet128 local_22a8; BitSet128 local_2298; BitSet128 local_2288; BitSet128 local_2278; BitSet128 local_2268; BitSet128 local_2258; BitSet128 local_2248; BitSet128 local_2238; BitSet128 local_2228; BitSet128 local_2218; BitSet128 local_2208; BitSet128 local_21f8; BitSet128 local_21e8; BitSet128 local_21d8; BitSet128 local_21c8; BitSet128 local_21b8; BitSet128 local_21a8; BitSet128 local_2198; BitSet128 local_2188; BitSet128 local_2178; BitSet128 local_2168; BitSet128 local_2158; BitSet128 local_2148; BitSet128 local_2138; BitSet128 local_2128; BitSet128 local_2118; BitSet128 local_2108; BitSet128 local_20f8; BitSet128 local_20e8; BitSet128 local_20d8; BitSet128 local_20c8; BitSet128 local_20b8; BitSet128 local_20a8; BitSet128 local_2098; BitSet128 local_2088; BitSet128 local_2078; BitSet128 local_2068; BitSet128 local_2058; BitSet128 local_2048; BitSet128 local_2038; BitSet128 local_2028; BitSet128 local_2018; BitSet128 local_2008; BitSet128 local_1ff8; BitSet128 local_1fe8; BitSet128 local_1fd8; BitSet128 local_1fc8; BitSet128 local_1fb8; BitSet128 local_1fa8; BitSet128 local_1f98; BitSet128 local_1f88; BitSet128 local_1f78; BitSet128 local_1f68; BitSet128 local_1f58; BitSet128 local_1f48; BitSet128 local_1f38; BitSet128 local_1f28; BitSet128 local_1f18; BitSet128 local_1f08; BitSet128 local_1ef8; BitSet128 local_1ee8; BitSet128 local_1ed8; BitSet128 local_1ec8; BitSet128 local_1eb8; BitSet128 local_1ea8; BitSet128 local_1e98; BitSet128 local_1e88; BitSet128 local_1e78; BitSet128 local_1e68; BitSet128 local_1e58; BitSet128 local_1e48; BitSet128 local_1e38; BitSet128 local_1e28; BitSet128 local_1e18; BitSet128 local_1e08; BitSet128 local_1df8; BitSet128 local_1de8; BitSet128 local_1dd8; BitSet128 local_1dc8; BitSet128 local_1db8; BitSet128 local_1da8; BitSet128 local_1d98; BitSet128 local_1d88; BitSet128 local_1d78; BitSet128 local_1d68; BitSet128 local_1d58; BitSet128 local_1d48; BitSet128 local_1d38; BitSet128 local_1d28; BitSet128 local_1d18; BitSet128 local_1d08; BitSet128 local_1cf8; BitSet128 local_1ce8; BitSet128 local_1cd8; BitSet128 local_1cc8; BitSet128 local_1cb8; BitSet128 local_1ca8; BitSet128 local_1c98; BitSet128 local_1c88; BitSet128 local_1c78; BitSet128 local_1c68; BitSet128 local_1c58; BitSet128 local_1c48; BitSet128 local_1c38; BitSet128 local_1c28; BitSet128 local_1c18; BitSet128 local_1c08; BitSet128 local_1bf8; BitSet128 local_1be8; BitSet128 local_1bd8; BitSet128 local_1bc8; BitSet128 local_1bb8; BitSet128 local_1ba8; BitSet128 local_1b98; BitSet128 local_1b88; BitSet128 local_1b78; BitSet128 local_1b68; BitSet128 local_1b58; BitSet128 local_1b48; BitSet128 local_1b38; BitSet128 local_1b28; BitSet128 local_1b18; BitSet128 local_1b08; BitSet128 local_1af8; BitSet128 local_1ae8; BitSet128 local_1ad8; BitSet128 local_1ac8; BitSet128 local_1ab8; BitSet128 local_1aa8; BitSet128 local_1a98; BitSet128 local_1a88; BitSet128 local_1a78; BitSet128 local_1a68; BitSet128 local_1a58; BitSet128 local_1a48; BitSet128 local_1a38; BitSet128 local_1a28; BitSet128 local_1a18; BitSet128 local_1a08; BitSet128 local_19f8; BitSet128 local_19e8; BitSet128 local_19d8; BitSet128 local_19c8; BitSet128 local_19b8; BitSet128 local_19a8; BitSet128 local_1998; BitSet128 local_1988; BitSet128 local_1978; BitSet128 local_1968; BitSet128 local_1958; BitSet128 local_1948; BitSet128 local_1938; BitSet128 local_1928; BitSet128 local_1918; BitSet128 local_1908; BitSet128 local_18f8; BitSet128 local_18e8; BitSet128 local_18d8; BitSet128 local_18c8; BitSet128 local_18b8; BitSet128 local_18a8; BitSet128 local_1898; BitSet128 local_1888; BitSet128 local_1878; BitSet128 local_1868; BitSet128 local_1858; BitSet128 local_1848; BitSet128 local_1838; BitSet128 local_1828; BitSet128 local_1818; BitSet128 local_1808; BitSet128 local_17f8; BitSet128 local_17e8; BitSet128 local_17d8; BitSet128 local_17c8; BitSet128 local_17b8; BitSet128 local_17a8; BitSet128 local_1798; BitSet128 local_1788; BitSet128 local_1778; BitSet128 local_1768; BitSet128 local_1758; BitSet128 local_1748; BitSet128 local_1738; BitSet128 local_1728; BitSet128 local_1718; BitSet128 local_1708; BitSet128 local_16f8; BitSet128 local_16e8; Vector local_16d8; Vector local_16d0; Vector local_16c8; Vector local_16c0; Vector local_16b8; Vector local_16b0; Vector local_16a8 [2]; Vector local_1698; Vector local_1690; Vector local_1688; Vector local_1680; Vector local_1678; Vector local_1670; Vector local_1668; Vector VStack_1660; Vector VStack_1658; Vector VStack_1650; Vector VStack_1648; Vector VStack_1640; Vector VStack_1638; Vector VStack_1630; Vector VStack_1628; Vector local_1620; Vector local_1618; Vector local_1610; Vector local_1608; Vector local_1600; Vector local_15f8; Vector local_15f0; Vector local_15e8; Vector local_15e0; Vector local_15d8; Vector local_15d0; Vector local_15c8; Vector local_15c0; Vector local_15b8; Vector VStack_15b0; Vector VStack_15a8; Vector VStack_15a0; Vector local_1598; Vector local_1590; Vector local_1588; float local_1580; float fStack_157c; float fStack_1578; float fStack_1574; BitSet128 local_1570; BitSet128 local_1560; Vector local_1550; BitSet128 local_1548; Vector local_1538; Vector local_1530; Vector local_1528; Vector local_1520; Vector local_1518; Vector local_1510; Vector local_1508; Vector local_1500; Vector local_14f8; Vector local_14f0; Vector local_14e8; Vector local_14e0; Vector local_14d8; Vector local_14d0; Vector local_14c8; Vector local_14c0; Vector local_14b8; Vector local_14b0; Vector local_14a8; Vector local_14a0; Vector local_1498; Vector local_1490; Vector local_1488; Vector local_1480; Vector local_1478 [2]; Vector local_1468; Vector local_1460; Vector local_1458; Vector local_1450; Vector local_1448; Vector local_1440; Vector local_1438; Vector local_1430; Vector local_1428; Vector local_1420; Vector local_1418; Vector local_1410; Vector local_1408; Vector local_1400; Vector local_13f8; Vector local_13f0; Vector local_13e8; Vector local_13e0; Vector local_13d8; Vector local_13d0; Vector local_13c8 [2]; Vector local_13b8; Vector local_13b0; Vector local_13a8; Vector local_13a0; Vector local_1398; Vector local_1390; Vector local_1388; Vector local_1380; Vector local_1378; Vector local_1370; Vector local_1368; Vector local_1360; Vector local_1358; Vector local_1350; Vector local_1348; Vector local_1340; Vector local_1338; Vector local_1330; Vector local_1328; Vector local_1320; Vector local_1318; Vector local_1310; Vector local_1308; Vector local_1300; Vector local_12f8; Vector local_12f0; Vector local_12e8; Vector local_12e0; Vector local_12d8; Vector local_12d0; Vector local_12c8; Vector local_12c0; Vector local_12b8; Vector local_12b0; Vector local_12a8; Vector local_12a0; Vector local_1298; Vector local_1290; Vector local_1288; Vector local_1280; Vector local_1278; Vector local_1270; Vector local_1268; Vector local_1260; Vector local_1258; Vector local_1250; Vector local_1248; Vector local_1240; Vector local_1238; Vector local_1230; Vector local_1228; Vector local_1220; Vector local_1218; Vector local_1210; Vector local_1208; Vector local_1200; Vector local_11f8; Vector local_11f0; Vector local_11e8; Vector local_11e0; Vector local_11d8; Vector local_11d0; Vector local_11c8; Vector local_11c0; Vector local_11b8; Vector local_11b0; Vector local_11a8; Vector local_11a0; Vector local_1198; Vector local_1190; Vector local_1188; Vector local_1180; Vector local_1178; Vector local_1170; Vector local_1168; Vector local_1160; Vector local_1158; Vector local_1150; Vector local_1148; Vector local_1140; Vector local_1138; Vector local_1130; Vector local_1128; Vector local_1120; Vector local_1118; Vector local_1110; Vector local_1108; Vector local_1100; Vector local_10f8; Vector local_10f0; Vector local_10e8; Vector local_10e0; Vector local_10d8; Vector local_10d0; Vector local_10c8; Vector local_10c0; Vector local_10b8 [2]; Vector local_10a8; Vector local_10a0; Vector local_1098; Vector local_1090; Vector local_1088; Vector local_1080; Vector local_1078; Vector local_1070; Vector local_1068; Vector local_1060; Vector local_1058; Vector local_1050; Vector local_1048; Vector local_1040; Vector local_1038; Vector local_1030; Vector local_1028; Vector local_1020; Vector local_1018; Vector local_1010; Vector local_1008; Vector local_1000; Vector local_ff8; Vector local_ff0; Vector local_fe8; Vector local_fe0; Vector local_fd8; Vector local_fd0; Vector local_fc8; Vector local_fc0; Vector local_fb8; Vector local_fb0; Vector local_fa8; Vector local_fa0; Vector local_f98; Vector local_f90; Vector local_f88; Vector local_f80; Vector local_f78; Vector local_f70; Vector local_f68; Vector local_f60; Vector local_f58; Vector local_f50; Vector local_f48; Vector local_f40; Vector local_f38; Vector local_f30; Vector local_f28; Vector local_f20; Vector local_f18; Vector local_f10; Vector local_f08; Vector local_f00; Vector local_ef8; Vector local_ef0; Vector local_ee8; Vector local_ee0; Vector local_ed8; Vector local_ed0; Vector local_ec8; Vector local_ec0; Vector local_eb8; Vector local_eb0; Vector local_ea8; Vector local_ea0; Vector local_e98; Vector local_e90; Vector local_e88; Vector local_e80; Vector local_e78; Vector local_e70; Vector local_e68; Vector local_e60; Vector local_e58; Vector local_e50; Vector local_e48; Vector local_e40; BitSet128 local_e38; BitSet128 local_e28; uint local_e18; uint local_e14; int local_e10; int local_e08; uint local_e04; Vector VStack_df8; Vector local_df0; Vector local_de8; Vector local_de0; Vector local_dd8; Vector local_dd0; Vector local_dc8; Vector local_dc0; Vector local_db8; Vector local_db0; Vector local_da8; Vector local_da0; Vector local_d98; Vector local_d90; Vector local_d88; Vector local_d80; EntityList_EL local_d78; EntityList_EL local_d68; undefined1 local_d58 [16]; undefined1 local_d48 [16]; EntityList_EL local_d38; EntityList_EL local_d28; EntityList_EL local_d18; EntityList_EL local_d08; undefined1 local_cf8 [16]; Vector local_ce8; Vector local_ce0; Vector local_cd8; Vector VStack_cd0; Vector local_cc8; Vector local_cc0; Vector local_cb8; Vector local_cb0; Vector local_ca8; Vector local_ca0; Vector local_c98; Vector local_c90; Vector local_c88; undefined1 local_c80 [28]; EntityList_EL local_c64; EntityList_EL local_c54; float local_c44; float local_c40; void *local_c3c; float local_c38; float local_c34; float local_c30; void *local_c2c; float local_c28; float local_c24; float local_c20; float local_c1c; float local_c18; undefined4 local_c14; float local_c10; undefined4 local_c0c; float local_c08; undefined4 local_c04; float local_c00; float local_bfc; undefined4 local_bf8; float local_bf4; EntityList_EL local_bf0; int local_be0; float local_bdc; undefined4 local_bd8; float local_bd4; float local_bd0; float local_bcc; float local_bc8; float local_bc4; float local_bc0; float local_bbc; float local_bb8; float local_bb4; float local_bb0; float local_bac; float local_ba8; float local_ba4; float local_ba0; undefined4 uStack_b9c; float local_b98; Vector local_b94; Vector local_b8c; Vector local_b84; Vector local_b7c; Vector local_b74; Vector local_b6c; Vector local_b64; Vector local_b5c; Vector local_b54; float local_b4c; float local_b48; float local_b44; float local_b40; float local_b3c; float local_b38; undefined4 local_b34; undefined4 local_b30; float local_b2c; undefined4 local_b28; undefined4 local_b24; float local_b20; float local_b1c; float local_b18; undefined4 local_b14; float local_b10; undefined1 *local_b0c; float local_b08; undefined4 local_b04; undefined4 local_b00; float local_afc; EntityPtr local_af8; float local_af4; float local_af0; float local_aec; float local_ae8; float local_ae4; float local_ae0; undefined4 local_adc; undefined4 local_ad8; float local_ad4; float local_ad0; float local_acc; undefined4 local_ac8; undefined4 local_ac4; float local_ac0; undefined4 local_abc; float local_ab8; undefined4 local_ab4; float local_ab0; EntityPtr local_aac; undefined4 local_aa8; undefined4 local_aa4; int local_aa0; undefined4 local_a9c; float local_a98; undefined4 local_a94; float local_a90; float local_a8c; undefined4 local_a88; float local_a84; undefined4 local_a80; EntityPtr local_a7c; undefined4 local_a78; EntityPtr local_a74; undefined4 local_a70; float local_a6c; float local_a68; float local_a64; float local_a60; undefined4 local_a5c; float local_a58; float local_a54; float local_a50; float local_a4c; float local_a48; float local_a44; float local_a40; undefined4 local_a3c; float local_a38; undefined4 local_a34; float local_a30; float local_a2c; float local_a28; undefined1 *local_a24; float local_a20; float local_a1c; undefined4 local_a18; float local_a14; float local_a10; float local_a0c; float local_a08; float local_a04; undefined4 local_a00; float local_9fc; float local_9f8; undefined4 local_9f4; float fStack_9f0; float fStack_9ec; undefined4 uStack_9e8; int iStack_9e4; undefined1 local_9e0 [12]; Vector local_9d4; Vector local_9cc; Vector local_9c4; Vector local_9bc; Vector local_9b4; Vector local_9ac; Vector local_9a4; Vector local_99c; Vector local_994; Vector local_98c; Vector local_984; float local_97c; EntityPtr local_978; float local_974; float local_970; undefined1 *local_96c; float local_968; Vector local_964; float local_95c; Vector local_958; Vector local_950; float local_948; Entity *local_944; float local_940; float local_93c; float local_938; Vector local_934; float local_92c; float local_928; float local_924; int local_920; Vector local_91c; float local_914; float local_910; float local_90c; BitSet128 *tearFlagsPtr; EntityPtr local_904; float local_900; EntityPtr local_8fc; EntityPtr local_8f8; Entity_Player *local_8f4; float local_8f0; float local_8ec; EntityPtr local_8e8; EntityPtr local_8e4; Entity_Player *local_8e0; EntityPtr local_8dc; EntityPtr local_8d8; EntityPtr local_8d4; EntityPtr local_8d0; EntityPtr local_8cc; ANM2 *local_8c8; EntityPtr local_8c4; EntityPtr local_8c0; char local_8b9; EntityPtr local_8b8; EntityPtr local_8b4; EntityPtr local_8b0; EntityPtr local_8ac; EntityPtr local_8a8; char local_8a1; EntityPtr local_8a0; EntityPtr local_89c; EntityPtr local_898; EntityPtr local_894; EntityPtr local_890; EntityPtr local_88c; EntityPtr local_888; Entity_Tear *tear; undefined4 local_880; EntityPtr local_87c; TearParams local_878 [10]; ColorMod local_514 [9]; Color aCStack_388 [5]; float local_28c; undefined1 local_1d8 [68]; std_string local_194; Color CStack_17c; undefined1 local_150 [44]; Color CStack_124; int local_f8; BitSet128 local_c0; float local_b0; RNG local_8c; undefined1 local_7c [88]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ColorMod *color; float decayFactor; Game *game; puStack_20 = local_7c + 0x78; local_14 = 0xffffffff; puStack_18 = &LAB_00af78c4; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_7c + 0x6c); ExceptionList = &local_1c; local_87c = (EntityPtr)0x0; local_8f8 = (EntityPtr)0x0; tear = this; puVar4 = local_7c + 0x78; if (this->_isFireSoundPending != 0) { play_fire_sound(); this->_isFireSoundPending = 0; puVar4 = puStack_20; } puStack_20 = puVar4; tearFlagsPtr = &this->_tearFlags; pBVar7 = BitSet128::operator_and(&local_18e8,tearFlagsPtr,&g_tearFlagLudovico); if (((((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) && ((this->_subtype & 4) != 0) ) && (this->_parent == (EntityPtr)0x0)) goto LAB_006684e5; EVar15 = this->_spawnerEntity; local_8d8 = (EntityPtr)this; if (this->_spawnerEntity != (EntityPtr)0x0) { do { local_8d8 = EVar15; EVar15 = *(EntityPtr *)((int)local_8d8 + 0x3c8); } while (*(EntityPtr *)((int)local_8d8 + 0x3c8) != (EntityPtr)0x0); } pVVar10 = &this->_pos; if (*(int *)((int)local_8d8 + 0x28) != 1) { local_8d8 = (EntityPtr)0x0; } local_8e8 = (EntityPtr)pVVar10; fVar25 = Room::GetTimeScale(g_game->_room,pVVar10,(Entity *)this); game = g_game; local_8d0 = (EntityPtr)&this->_speedMultiplier; local_8ec = 0.75; *(float *)local_8d0 = fVar25; if (0 < *(int *)((int)game->_room + 0x722c)) { *(float *)local_8d0 = fVar25 * 0.75; } if (0 < this->_holdTimer) { iVar8 = this->_holdTimer + -1; this->_holdTimer = iVar8; if (iVar8 != 0) { EVar15 = this->_parent; if (EVar15 != (EntityPtr)0x0) { fVar25 = *(float *)((int)EVar15 + 0x340); decayFactor = (this->_holdOffset).y; pVVar10->x = *(float *)((int)EVar15 + 0x33c) + (this->_holdOffset).x; (this->_pos).y = fVar25 + decayFactor; } (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; if ((this->_holdTimer / 0xf & 1U) == 0) { fVar25 = this->_height + 0.5; } else { fVar25 = this->_height - 0.5; } this->_height = fVar25; Entity_Projectile::SetHeight((Entity_Projectile *)this,fVar25); Entity::Update((Entity *)this); ExceptionList = local_1c; return; } (this->_velocity).x = (this->_holdVelocity).x; (this->_velocity).y = (this->_holdVelocity).y; } pBVar7 = &this->_tearFlags; pBVar9 = BitSet128::operator_and(&local_22a8,pBVar7,(BitSet128 *)&DAT_00c34800); bVar5 = BitSet128::IsNonZero(pBVar9); local_890 = (EntityPtr)0x40400000; if ((bVar5 != 0) && (local_8d8 != (EntityPtr)0x0)) { playerEffects = (TemporaryEffects *)Entity_Player::GetEffects((Entity_Player *)local_8d8); bVar5 = TemporaryEffects::HasCollectibleEffect(playerEffects,0x89); if (bVar5 != 0) { BitSet128::__bnot((BitSet128 *)&DAT_00c34800,&local_22b8); FUN_005cd430(); BitSet128::operator__(); (**(code **)(*(int *)this + 0x40))(); Entity::Die((Entity *)this); this->_deathFlags = 0x40; } } room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); local_8f0 = 0.6; if (((bVar5 != 0) && (-5.1 <= this->_height)) && (this->_tearRange * 0.6 < this->_updateTime)) { pBVar9 = BitSet128::operator_and(&local_22c8,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar9); if (bVar5 != 0) { Entity::Die((Entity *)this); this->_deathFlags = 0x40; } } if ((this->_variant == 0xd) || (this->_variant == 0x17)) { seeds = (Seeds *)Game::GetSeeds(g_game); bVar5 = Seeds::HasSeedEffect(seeds,0x4f); if (bVar5 != 0) { BitSet128::__bnot((BitSet128 *)&DAT_00c345d0,&local_22d8); FUN_005cd430(); } } local_8dc = (EntityPtr)0x3f800000; local_8a8 = local_8dc; pBVar7 = BitSet128::operator_and(&local_22e8,pBVar7,(BitSet128 *)&DAT_00c34b40); bVar5 = BitSet128::IsNonZero(pBVar7); local_8b8 = (EntityPtr)0x3f000000; if (bVar5 == 0) { if (0 < this->_waitFrames) { if (this->_parent != (EntityPtr)0x0) { iVar8 = Entity::Type(); EVar15 = this->_parent; if (iVar8 != 1) { iVar8 = Entity::Type(); if (iVar8 != 3) goto LAB_0066757c; familiar = (Entity_Familiar *)FUN_00435de0(); EVar15 = (EntityPtr)Entity_Familiar::Player(familiar); } pEVar18 = Entity::ToPlayer((Entity *)EVar15); if ((pEVar18 != (Entity_Player *)0x0) && (iVar8 = Entity_Player::GetFireDirection(pEVar18), iVar8 == -1)) { this->_waitFrames = 1; } } LAB_0066757c: piVar13 = &this->_waitFrames; *piVar13 = *piVar13 + -1; iVar8 = this->_waitFrames; if (*piVar13 == 0) { Vector::operator_add_assign(&this->_velocity,&this->_continueVelocity); Vector::operator_assign(&this->_continueVelocity,&g_vectorZero); iVar8 = this->_waitFrames; } if ((iVar8 / 0xf & 1U) == 0) { fVar25 = this->_height + (float)local_8b8; } else { fVar25 = this->_height - (float)local_8b8; } this->_height = fVar25; Entity_Projectile::SetHeight((Entity_Projectile *)this,fVar25); } } else { this->_waitFrames = 0x5a; BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,&local_22f8); FUN_005cd430(); Vector::operator_assign(&this->_continueVelocity,&this->_velocity); Vector::operator_assign(&this->_velocity,&g_vectorZero); } pBVar7 = &this->_tearFlags; pBVar9 = BitSet128::operator_and(&local_2308,pBVar7,(BitSet128 *)&DAT_00c34ac0); bVar5 = BitSet128::IsNonZero(pBVar9); local_8fc = (EntityPtr)0x41700000; local_900 = 0.4; if (bVar5 != 0) { local_888._0_1_ = this->_dead != 0; pBVar9 = BitSet128::operator_and(&local_2318,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { bVar5 = Entity::IsFrame((Entity *)this,5,this->_index); local_888 = (EntityPtr)((uint)local_888 & 0xff); if (bVar5 != 0) { local_888 = (EntityPtr)0x1; } } if (this->_dead != 0) { pBVar9 = BitSet128::operator_and(&local_2328,pBVar7,&g_tearFlagExplosive); bVar5 = BitSet128::IsNonZero(pBVar9); if ((bVar5 != 0) || (this->_variant == 4)) goto LAB_006677ce; } if (local_888._0_1_ != '\0') { local_994.y = (this->_pos).y; local_994.x = (this->_pos).x; room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar10 = Room::GetClampedPosition(room,&local_14c0,&local_994,15.0); Vector::operator_assign(&local_994,pVVar10); uVar11 = Random(); in_stack_ffffd9fc = (Vector *)0x0; Game::Spawn(g_game,1000,0x35,&local_994,&g_vectorZero,(Entity *)this->_spawnerEntity,0,uVar11) ; familiar = (Entity *)__RTDynamicCast(); local_b3c = 0.4; pVVar10 = Vector::__mul(&g_vectorOne,&local_14c8,&local_b3c); fVar24 = (float10)Scale(tear); local_b40 = (float)fVar24; pVVar10 = Vector::__mul(pVVar10,&local_14d0,&local_b40); Entity::SetSpriteScale(familiar,pVVar10); (**(code **)(*(int *)familiar + 0xc))(); pBVar7 = tearFlagsPtr; this = tear; } } LAB_006677ce: pBVar9 = BitSet128::operator_and(&local_2338,pBVar7,(BitSet128 *)&DAT_00c346a0); bVar5 = BitSet128::IsNonZero(pBVar9); if ((bVar5 != 0) && (this->_dead != 0)) { pBVar9 = BitSet128::operator_and(&local_2348,pBVar7,&g_tearFlagExplosive); bVar5 = BitSet128::IsNonZero(pBVar9); if ((bVar5 == 0) && (this->_variant != 4)) { local_99c.y = (this->_pos).y; local_99c.x = (this->_pos).x; room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar10 = Room::GetClampedPosition(room,&local_14d8,&local_99c,15.0); Vector::operator_assign(&local_99c,pVVar10); uVar11 = Random(); in_stack_ffffd9fc = (Vector *)0x0; Game::Spawn(g_game,1000,0x2e,&local_99c,&g_vectorZero,(Entity *)this->_spawnerEntity,0,uVar11) ; familiar = (Entity *)__RTDynamicCast(); local_b48 = 0.4; pVVar10 = Vector::__mul(&g_vectorOne,&local_14e0,&local_b48); fVar24 = (float10)Scale(tear); local_b4c = (float)fVar24; pVVar10 = Vector::__mul(pVVar10,&local_14e8,&local_b4c); Entity::SetSpriteScale(familiar,pVVar10); (**(code **)(*(int *)familiar + 0xc))(); pBVar7 = tearFlagsPtr; } } pBVar7 = BitSet128::operator_and(&local_2358,pBVar7,(BitSet128 *)&DAT_00c345a0); bVar5 = BitSet128::IsNonZero(pBVar7); this = tear; local_894 = (EntityPtr)0x0; local_8d4 = (EntityPtr)0x3e99999a; if (bVar5 != 0) { local_8b9 = '\0'; if (tear->_techZeroTarget == (EntityPtr)0x0) { local_8a0 = (EntityPtr)0x0; local_8b0 = (EntityPtr)0x47fd2000; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); in_stack_ffffd9fc = (Vector *)0x6679c9; EntityList::QueryRadius(entityList,&local_c54,&this->_pos,350.0,4); local_14 = 0; local_898 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { piVar13 = (int *)std::vector::operator_index(); if ((Entity_Tear *)*piVar13 != this) { puVar14 = (undefined4 *)std::vector::operator_index(); iVar8 = Entity::Type((Entity *)*puVar14); if (iVar8 == 2) { std::vector::operator_index(); in_stack_ffffd9fc = (Vector *)0x0; local_904 = (EntityPtr)__RTDynamicCast(); pVVar10 = Entity::Position((Entity *)local_904,&local_14f0); local_8e4 = (EntityPtr)Vector::DistanceSquared(pVVar10,&this->_pos); if ((float)local_8e4 < (float)local_8b0) { local_8a0 = local_904; local_8b0 = local_8e4; } } } local_898 = (EntityPtr)((int)local_898 + 1); EVar15 = (EntityPtr)EntityList::Size(); } while ((uint)local_898 < (uint)EVar15); if (((local_8a0 != (EntityPtr)0x0) && (*(Entity_Tear **)((int)local_8a0 + 0x48c) != this)) && (local_8d8 != (EntityPtr)0x0)) { pVVar10 = Entity::Position((Entity *)local_8a0,&local_14f8); pVVar16 = (Vector *)Entity::PositionOffset((Entity *)local_8a0); pVVar10 = Vector::__add(pVVar10,&local_1500,pVVar16); pVVar16 = Vector::__add(&this->_pos,&local_1508,&this->_velocity); pVVar16 = Vector::__add(pVVar16,&local_1510,&this->_posOffset); Vector::__sub(pVVar10,&local_d98,pVVar16); if (this->_techZeroLaser == (EntityPtr)0x0) { pVVar10 = Vector::Vector(&local_1518,(float)local_894,-15.0); local_8e4 = (EntityPtr)Vector::GetAngleDegrees(&local_d98); in_stack_ffffd9fc = (Vector *)0x3; laser = Entity_Laser::ShootAngle (10,&this->_pos,(float)local_8e4,3,pVVar10,(Entity *)local_8d8,1); if (laser == (Entity_Laser *)0x0) { BitSet128::__bnot((BitSet128 *)&DAT_00c345a0,&local_2368); FUN_005cd430(); local_8b9 = '\0'; EntityPtr::SetReference(&this->_techZeroTarget,(Entity *)0x0); goto LAB_00667cb7; } Isaac::Random(2); Entity_Player::GetTearHitParams(); (**(code **)(*(int *)laser + 0x40))(); Entity_Laser::set_scale(); FUN_00435cd0(); in_stack_ffffd9fc = (Vector *)g_tearFlagSpectral._l; FUN_00456830(); set_field_0x37c(); Entity::SetParent((Entity *)laser,(Entity *)this); FUN_00435f70(); EntityPtr::SetReference(&this->_techZeroLaser,(Entity *)laser); local_8b9 = '\x01'; } EntityPtr::SetReference(&this->_techZeroTarget,(Entity *)local_8a0); } } LAB_00667cb7: local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_c54); } pEVar20 = &this->_techZeroTarget; local_8e4 = (EntityPtr)&this->_techZeroLaser; if ((this->_techZeroLaser != (EntityPtr)0x0) && (((this->_dead != 0 || (*pEVar20 == (EntityPtr)0x0)) || (cVar6 = Entity::IsDead(), cVar6 != '\0')))) { (**(code **)(*(int *)this->_techZeroLaser + 0x28))(); EntityPtr::SetReference(&this->_techZeroLaser,(Entity *)0x0); EntityPtr::SetReference(pEVar20,(Entity *)0x0); } if ((((this->_dead != 0) || ((*pEVar20 != (EntityPtr)0x0 && (cVar6 = Entity::IsDead(), cVar6 != '\0')))) || (*pEVar20 == (EntityPtr)0x0)) && (this->_techZeroLaser != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_techZeroLaser + 0x28))(); } if ((this->_techZeroLaser != (EntityPtr)0x0) && (*pEVar20 != (EntityPtr)0x0)) { pVVar10 = Entity::Position((Entity *)*pEVar20,&local_1520); pVVar16 = (Vector *)Entity::PositionOffset((Entity *)this->_techZeroTarget); pVVar10 = Vector::__add(pVVar10,&local_1528,pVVar16); pVVar16 = Vector::__add(&this->_pos,&local_1530,&this->_velocity); pVVar16 = Vector::__add(pVVar16,&local_1538,&this->_posOffset); Vector::__sub(pVVar10,&local_ce0,pVVar16); local_89c = (EntityPtr)Vector::Length(&local_ce0); in_stack_ffffd9fc = (Vector *)0x0; EVar15 = (EntityPtr)__RTDynamicCast(); local_8b0 = EVar15; fVar25 = Vector::GetAngleDegrees(&local_ce0); Entity_NPC::SetAimAngle((Entity_NPC *)EVar15,fVar25); Entity_Laser::SetMaxDistance((Entity_Laser *)EVar15,(float)local_89c); Entity_Laser::SetTimeout((Entity_Laser *)EVar15); pVVar10 = Vector::__add((Vector *)local_8e8,&local_1550,&this->_posOffset); this = tear; pVVar10 = Vector::__add(pVVar10,&local_1588,&tear->_velocity); pVVar16 = (Vector *)Entity::PositionOffset((Entity *)local_8b0); pVVar10 = Vector::__sub(pVVar10,&local_1590,pVVar16); EVar15 = local_8b0; Entity::SetPosition((Entity *)local_8b0,pVVar10); if (350.0 < (float)local_89c) { (**(code **)(*(int *)EVar15 + 0x28))(); } if (local_8b9 != '\0') { (**(code **)(*(int *)EVar15 + 0xc))(); } } } pBVar7 = BitSet128::operator_and(&local_2378,&this->_tearFlags,(BitSet128 *)&DAT_00c345d0); bVar5 = BitSet128::IsNonZero(pBVar7); local_8f4 = (Entity_Player *)0x41f00000; if (bVar5 == 0) { if (this->_laserShotLaser == (EntityPtr)0x0) goto LAB_00668237; this->_visible = 1; this->_entityCollisionClass = 4; (**(code **)(*(int *)this->_laserShotLaser + 0x28))(); LAB_00668224: EntityPtr::SetReference(&this->_laserShotLaser,(Entity *)0x0); } else { pVVar10 = &this->_continueVelocity; if (this->_waitFrames < 1) { pVVar10 = &this->_velocity; } local_b54.x = pVVar10->x; local_b54.y = pVVar10->y; if (this->_laserShotLaser == (EntityPtr)0x0) { local_8b0 = local_8d8; if (local_8d8 == (EntityPtr)0x0) { local_8b0 = (EntityPtr)Game::GetPlayer(g_game,0); } Vector::operator__(&this->_pos,&this->_velocity); pVVar10 = Vector::Vector(&local_1598,(float)local_894,this->_height); local_8e4 = (EntityPtr)Vector::GetAngleDegrees(&this->_velocity); in_stack_ffffd9fc = (Vector *)0x3e8; EVar15 = (EntityPtr) Entity_Laser::ShootAngle (3,&this->_pos,(float)local_8e4,1000,pVVar10,(Entity *)local_8b0,1); local_888 = EVar15; if (EVar15 != (EntityPtr)0x0) { Entity::SetParent((Entity *)EVar15,(Entity *)this); Entity_Laser::SetMaxDistance((Entity_Laser *)EVar15,30.0); (**(code **)(*(int *)EVar15 + 0x40))(); pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Entity::GetColor((Entity *)this); in_stack_ffffd9fc = (Vector *)0xff; (*pcVar2)(); pBVar33 = (BitSet128 *)&DAT_00c348d0; pBVar32 = (BitSet128 *)&DAT_00c34850; pBVar9 = (BitSet128 *)&DAT_00c345e0; pBVar7 = BitSet128::operator_or (&local_2388,(BitSet128 *)&DAT_00c34b80,(BitSet128 *)&DAT_00c34b60); pBVar7 = BitSet128::operator_or(&local_2398,pBVar7,pBVar9); pBVar7 = BitSet128::operator_or(&local_23a8,pBVar7,pBVar32); pBVar7 = BitSet128::operator_or(&local_23b8,pBVar7,pBVar33); pBVar7 = BitSet128::__bnot(pBVar7,&local_23c8); pBVar9 = TearFlags(this,&local_23d8); BitSet128::operator_and(&local_23e8,pBVar9,pBVar7); EVar15 = local_888; FUN_00456830(); Entity_Laser::set_disable_init_sound((Entity_Laser *)EVar15); Entity_Laser::SetMultidimensionalTouched((Entity_Laser *)EVar15); FUN_005cd5a0(); fVar25 = Vector::GetAngleDegrees(&local_b54); Entity_NPC::SetAimAngle((Entity_NPC *)EVar15,fVar25); (**(code **)(*(int *)EVar15 + 0xc))(); EntityPtr::SetReference(&this->_laserShotLaser,(Entity *)EVar15); this->_visible = 0; pBVar7 = BitSet128::operator_and(&local_23f8,&this->_tearFlags,&g_tearFlagExplosive); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { this->_entityCollisionClass = 0; } goto LAB_00668180; } BitSet128::__bnot((BitSet128 *)&DAT_00c345d0,&local_2408); FUN_005cd430(); this->_visible = 1; this->_entityCollisionClass = 4; } else { in_stack_ffffd9fc = (Vector *)0x0; EVar15 = (EntityPtr)__RTDynamicCast(); if (EVar15 != (EntityPtr)0x0) { LAB_00668180: local_8e4 = (EntityPtr)Vector::GetAngleDegrees(&local_b54); fVar24 = (float10)Entity_Projectile::Damage((Entity_Projectile *)EVar15); local_904 = (EntityPtr)(float)fVar24; fVar25 = LerpAngleDeg((float)local_904,(float)local_8e4,(float)local_8b8); Entity_NPC::SetAimAngle((Entity_NPC *)EVar15,fVar25); if (this->_dead != 0) { iVar8 = FUN_00579760(); if (10 < iVar8) { Entity_Laser::SetTimeout((Entity_Laser *)EVar15); } Entity::SetVelocity((Entity *)EVar15,&this->_velocity); goto LAB_00668224; } Entity_Laser::SetTimeout((Entity_Laser *)EVar15); } } } LAB_00668237: pVVar10 = &this->_pos; pEVar18 = (Entity_Player *)this->_fallingSpeed; local_8e0 = pEVar18; pBVar7 = BitSet128::operator_and(&local_2418,&this->_tearFlags,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and(&local_2428,&this->_tearFlags,(BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { Entity::GetRootParent((Entity *)this); local_888 = (EntityPtr)(3.1415927 / (float)pEVar18); iVar8 = Entity::FrameCount((Entity *)this); local_8b0 = (EntityPtr)sinf_wrapper((float)(iVar8 + -1) * (float)local_888); iVar8 = Entity::FrameCount((Entity *)this); fVar25 = sinf_wrapper((float)iVar8 * (float)local_888); FUN_0041d510(); (this->_posOffset).y = fVar25 * this->_height; EVar15 = local_8b0; FUN_0041d510(); local_8e0 = (Entity_Player *)((this->_posOffset).y - (float)EVar15 * this->_height); iVar8 = Entity::FrameCount((Entity *)this); fVar25 = sinf_wrapper((float)iVar8 * (float)local_888); if (fVar25 * (float)local_8b0 < (float)local_894) { this->_deathFlags = 4; this->_dead = 1; UpdateBoneTear(this,(Entity *)0x0); } } } local_8e4 = (EntityPtr)0xc1200000; local_8cc = (EntityPtr)0xc1a00000; local_904 = (EntityPtr)0x3e800000; auVar29._0_12_ = ZEXT812(0xc1be0000); auVar29._12_4_ = 0; local_8b0 = auVar29._0_4_; if ((this->_dead == 0) || (this->_variant == 9)) goto LAB_0066a370; if (this->_variant == 0x28) { rng_pair_init(); local_e18 = (uint)this->_subtype >> 0x10; local_e14 = this->_subtype & 0xffff; local_e08 = this->_initSeed; bVar5 = Entity::HasEntityFlags((Entity *)this,0x40000); local_e04 = (uint)(bVar5 != 0); local_e10 = (int)this->_health; Entity::DestroyRockGridAt(); if (this->_spawnerEntity != (EntityPtr)0x0) { bVar5 = Entity::is_player((Entity *)this->_spawnerEntity); if (bVar5 != 0) { local_904 = (EntityPtr)Entity::ToPlayer((Entity *)this->_spawnerEntity); if (local_904 != (EntityPtr)0x0) { bVar5 = Entity_Player::HasCollectible((Entity_Player *)local_904,0x248,0); if (bVar5 != 0) { iVar8 = Isaac::Random(3); EVar15 = (EntityPtr)(iVar8 + 1); local_8e4 = EVar15; if (0 < (int)EVar15) { do { local_8e4 = (EntityPtr) Entity_Player::AddWisp((Entity_Player *)local_904,0x25c,pVVar10,0,1); if (local_8e4 != (EntityPtr)0x0) { Entity::SetTargetPosition((Entity *)local_8e4,*pVVar10); (**(code **)(*(int *)local_8e4 + 0xc))(); } EVar15 = (EntityPtr)((int)EVar15 + -1); } while (EVar15 != (EntityPtr)0x0); this = tear; } } } } } LAB_006684e5: (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } local_888 = (EntityPtr)((uint)local_888 & 0xffffff00); pBVar7 = BitSet128::operator_and(&local_2438,&this->_tearFlags,(BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (this->_deathFlags == 4)) { pBVar7 = BitSet128::operator_and(&local_2448,&this->_tearFlags,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); local_8c0 = local_8e4; if (bVar5 == 0) { pBVar9 = (BitSet128 *)&DAT_00c34960; pBVar7 = BitSet128::operator_or(&local_2458,&g_tearFlagExplosive,(BitSet128 *)&DAT_00c34880); pBVar7 = BitSet128::operator_or(&local_2468,pBVar7,pBVar9); pBVar7 = BitSet128::operator_and(&local_2478,&this->_tearFlags,pBVar7); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { EVar15 = local_8c0; } else { EVar15 = local_8cc; } EVar26 = (EntityPtr)this->_fallingSpeed; if (((float)EVar15 < (float)EVar26) && (*(short *)&this->field_0x46e == 0)) { this->_fallingSpeed = (float)EVar15; EVar26 = EVar15; } if ((float)EVar15 < (float)EVar26) goto LAB_0066863a; } *(short *)&this->field_0x46e = *(short *)&this->field_0x46e + 1; this->_dead = 0; in_stack_ffffd9fc = *(Vector **)&(this->_tearFlags)._l; local_888._0_1_ = 1; tear_flags_area_apply(); } LAB_0066863a: local_910 = 1.0; auVar29 = ZEXT416((uint)local_8a8); iVar8 = this->_variant; local_8c8 = (ANM2 *)0x0; local_898 = (EntityPtr)0x0; local_88c = (EntityPtr)0x0; local_8c4 = local_8a8; local_8a0 = local_8a8; switch(iVar8) { case 0: case 3: case 5: case 6: case 7: case 10: case 0xb: case 0xe: case 0x10: case 0x13: case 0x15: case 0x18: case 0x1a: case 0x1b: case 0x1f: case 0x24: case 0x29: case 0x2d: case 0x30: if (local_900 <= this->_fScale) { if (0.8 <= this->_fScale) { auVar29 = ZEXT416((uint)local_8a8); if (this->_height <= -5.0) { local_88c = (EntityPtr)0x96; local_8c8 = (ANM2 *)0xc; } else { local_88c = (EntityPtr)0x102; local_8c8 = (ANM2 *)&DAT_0000000d; } break; } auVar29 = ZEXT816(0x3f59999a); local_88c = (EntityPtr)0x102; local_8c8 = (ANM2 *)&DAT_0000004f; } else { auVar29 = ZEXT816(0x3f333333); local_88c = (EntityPtr)0x102; local_8c8 = (ANM2 *)&DAT_00000050; } goto LAB_00668f76; case 1: case 0xc: case 0xf: case 0x11: case 0x19: case 0x20: case 0x21: case 0x22: case 0x23: case 0x25: case 0x26: case 0x27: local_8c8 = (ANM2 *)&DAT_0000000b; local_88c = (EntityPtr)0x96; goto LAB_00668f76; case 2: case 0x1e: color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); Color::operator_assign(&CStack_17c,color); if (this->_variant == 0x1e) { Color::Color(aCStack_388); Color::operator_assign(aCStackY_3c4c + 0x81,(ColorMod *)&CStack_17c); color = (ColorMod *)FUN_004072e0(); Color::operator_assign(&CStack_17c,color); } local_8c0 = (EntityPtr)this->_height; fVar25 = random_float(); in_stack_ffffd9fc = (Vector *)(fVar25 * (float)local_890 + 2.0); Game::SpawnParticles (g_game,&this->_pos,0x23,8,(float)in_stack_ffffd9fc,(ColorMod *)&CStack_17c, (float)local_8c0,1); local_8c8 = (ANM2 *)0x61; local_88c = (EntityPtr)0xb5; local_8c4 = local_8b8; fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)(fVar25 * 0.2 + (float)local_8a8); auVar29._4_12_ = extraout_var; local_8a0 = auVar29._0_4_; break; case 8: local_8c8 = (ANM2 *)&DAT_00000014; local_88c = (EntityPtr)0x31; local_8c4 = local_8d4; fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)(fVar25 * 0.1 + 0.95); auVar29._4_12_ = extraout_var_01; local_8a0 = auVar29._0_4_; break; case 0xd: case 0x17: case 0x1c: if ((iVar8 == 0xd) || (iVar8 == 0x17)) { seeds = (Seeds *)Game::GetSeeds(g_game); bVar5 = Seeds::HasSeedEffect(seeds,0x4f); if (bVar5 == 0) goto LAB_00668a9b; iVar8 = Isaac::Random(5); if ((iVar8 == 0) && ((this->_deathFlags & 1) != 0)) { local_88c = (EntityPtr)0x33f; local_8c4 = local_8a8; fVar25 = random_float(); local_8c8 = (ANM2 *)0x61; auVar29._0_4_ = (EntityPtr)(fVar25 * local_8f0 + 0.8); auVar29._4_12_ = extraout_var_03; local_8a0 = auVar29._0_4_; break; } local_8c4 = local_894; } else { LAB_00668a9b: local_8c0 = (EntityPtr)this->_height; color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); fVar25 = random_float(); local_8b4 = (EntityPtr)(fVar25 * (float)local_890 + 2.0); iVar8 = Isaac::Random(2); in_stack_ffffd9fc = (Vector *)local_8b4; Game::SpawnParticles (g_game,&this->_pos,0x56,iVar8 + 2,(float)local_8b4,color,(float)local_8c0,1); local_8c4 = local_8d4; } local_88c = (EntityPtr)0x8a; fVar25 = random_float(); local_8c8 = (ANM2 *)0x61; auVar29._0_4_ = (EntityPtr)(fVar25 * (float)local_8b8 + 2.0); auVar29._4_12_ = extraout_var_04; local_8a0 = auVar29._0_4_; break; case 0x12: local_8c0 = (EntityPtr)this->_height; color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); fVar25 = random_float(); local_8b4 = (EntityPtr)(fVar25 * (float)local_890 + 2.0); iVar8 = Isaac::Random(2); iVar8 = iVar8 + 2; uVar34 = local_8c0._0_1_; uVar35 = local_8c0._1_1_; uVar36 = local_8c0._2_2_; variant = 0x55; goto LAB_006689b3; case 0x14: local_8c0 = (EntityPtr)this->_height; color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); fVar25 = random_float(); local_8b4 = (EntityPtr)(fVar25 * (float)local_890 + 2.0); iVar8 = Isaac::Random(2); iVar8 = iVar8 + 4; uVar34 = local_8c0._0_1_; uVar35 = local_8c0._1_1_; uVar36 = local_8c0._2_2_; variant = 0x62; LAB_006689b3: in_stack_ffffd9fc = (Vector *)local_8b4; Game::SpawnParticles (g_game,&this->_pos,variant,iVar8,(float)local_8b4,color, (float)CONCAT22(uVar36,CONCAT11(uVar35,uVar34)),1); local_8c8 = (ANM2 *)0x61; local_88c = (EntityPtr)0x8a; local_8c4 = local_8d4; fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)(fVar25 * (float)local_8b8 + 2.0); auVar29._4_12_ = extraout_var_02; local_8a0 = auVar29._0_4_; break; case 0x1d: local_8c0 = (EntityPtr)this->_height; color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); fVar25 = random_float(); in_stack_ffffd9fc = (Vector *)(fVar25 * (float)local_890 + 2.0); Game::SpawnParticles (g_game,&this->_pos,0x23,4,(float)in_stack_ffffd9fc,color,(float)local_8c0,1); local_8c8 = (ANM2 *)0x61; local_88c = (EntityPtr)0x8a; local_8c4 = local_8d4; fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)(fVar25 * (float)local_8b8 + (float)local_890); auVar29._4_12_ = extraout_var_00; local_8a0 = auVar29._0_4_; break; case 0x2a: local_88c = (EntityPtr)0x1e7; local_8c4 = (EntityPtr)Math::clamp((float)local_8b8,(float)local_8a8,this->_fScale * 1.4); auVar29._0_4_ = (EntityPtr)Math::clamp(0.95,1.8,(float)local_8a8 / this->_fScale); auVar29._4_12_ = extraout_var_05; local_8c8 = (ANM2 *)0x91; local_8a0 = auVar29._0_4_; room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::IsPositionInRoom(room,pVVar10,-20.0); if (bVar5 != 0) { Color::Color((Color *)(local_150 + 0x2c)); in_stack_ffffd9fc = (Vector *)0x8c; KColor::FromRGBA255((KColor *)(local_150 + 0x2c),0x8c,0x7b,0x7b,0xff); color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); Color::__mul((Color *)(local_150 + 0x2c),color); uStack_9e8 = 0x10; uStack_b9c = 1; fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)(fVar25 * (float)local_8b8 + (float)local_8a8); auVar29._4_12_ = extraout_var_06; iStack_9e4 = (int)(this->_fScale * 4.0 * (float)auVar29._0_4_); std::max(); pEVar20 = (EntityPtr *)std::min(); local_89c = *pEVar20; if (0 < (int)local_89c) { do { fVar25 = random_float(); Vector::FromAngle(&VStack_cd0,fVar25 * 360.0); fVar25 = random_float(); fStack_9f0 = fVar25 * 2.0 + (float)local_8a8; auVar29._0_4_ = (EntityPtr)random_float(); auVar29._4_12_ = extraout_var_07; fStack_9ec = (float)auVar29._0_4_; pVVar10 = Vector::__mul(&VStack_cd0,&VStack_15a0,&fStack_9ec); pVVar10 = Vector::__mul(pVVar10,&VStack_15a8,&this->_size); Vector::__add(&this->_pos,&VStack_df8,pVVar10); uVar11 = Random(); pVVar10 = Vector::__mul(&VStack_cd0,&VStack_15b0,&fStack_9f0); familiar = Game::Spawn(g_game,1000,0x23,&VStack_df8,pVVar10,(Entity *)0x0,1,uVar11); Entity::SetPositionOffset(familiar,&this->_posOffset); in_stack_ffffd9fc = (Vector *)0xffffffff; (**(code **)(*(int *)familiar + 0x3c))(); (**(code **)(*(int *)familiar + 0xc))(); local_89c = (EntityPtr)((int)local_89c + -1); } while (local_89c != (EntityPtr)0x0); local_89c = (EntityPtr)0x0; } } break; case 0x2b: case 0x2c: local_8c0 = (EntityPtr)this->_height; color = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); fVar25 = random_float(); local_8b4 = (EntityPtr)(fVar25 * (float)local_890 + 2.0); iVar8 = Isaac::Random(2); in_stack_ffffd9fc = (Vector *)local_8b4; Game::SpawnParticles (g_game,&this->_pos,0x56,iVar8 + 2,(float)local_8b4,color,(float)local_8c0,1); local_88c = (EntityPtr)0x8a; fVar25 = random_float(); local_8c8 = (ANM2 *)0xc; local_8a0 = (EntityPtr)(fVar25 * (float)local_8b8 + 2.0); local_898 = (EntityPtr)((this->_variant == 0x2c) + 0x14); auVar29 = ZEXT416((uint)local_8d4); goto LAB_00668f76; case 0x2f: local_88c = (EntityPtr)0x31; goto LAB_00668eec; case 0x31: local_88c = (EntityPtr)0x86; LAB_00668eec: fVar25 = random_float(); local_8c8 = (ANM2 *)0xc; local_898 = (EntityPtr)0x16; local_8a0 = (EntityPtr)(fVar25 * (float)local_8b8 + 2.0); auVar29 = ZEXT416((uint)local_8d4); goto LAB_00668f76; case 0x32: local_88c = (EntityPtr)0x1e; fVar25 = random_float(); local_8c8 = (ANM2 *)0x2; local_898 = (EntityPtr)0x2; local_8a0 = (EntityPtr)(fVar25 * (float)local_8b8 + 1.5); auVar29 = ZEXT416((uint)local_8f0); LAB_00668f76: local_8c4 = auVar29._0_4_; } pBVar7 = BitSet128::operator_and(&local_2488,&this->_tearFlags,&g_tearFlagExplosive); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 == 0) || ((this->_subtype & 2) != 0)) { LAB_00668fdf: if (this->_variant == 4) goto LAB_00668fe9; } else { pBVar7 = BitSet128::operator_and(&local_2498,&this->_tearFlags,&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if ((bVar5 == 0) && ((*(short *)&this->field_0x46e < 2 && ((this->_deathFlags & 0x20) == 0)))) goto LAB_00668fdf; LAB_00668fe9: local_8c8 = (ANM2 *)0x1; Game::BombTearflagEffects(); Game::GetField26614(g_game); cVar6 = FUN_00429550(); if (cVar6 == '\0') { local_89c = (EntityPtr)this->_collisionDamage; } else { local_89c = (EntityPtr)0x420c0000; } if (local_888._0_1_ != '\0') { local_89c = (EntityPtr)((float)local_89c * (float)local_8b8); } local_8b4 = (EntityPtr)0x4; if (this->_variant == 4) { local_8b4 = (EntityPtr)0x40000004; } fVar25 = this->_size; if (8.75 <= fVar25) { local_9fc = fVar25 + (float)local_8f4; local_a00 = 0x42700000; } else { local_9f4 = 0x41f00000; local_9f8 = (fVar25 * 60.0) / 8.75; } pfVar17 = (float *)std::max(); local_910 = *pfVar17 / 60.0; in_stack_ffffd9fc = *(Vector **)((int)&(this->_tearFlags)._h + 4); auVar29 = ZEXT416((uint)local_89c); Game::BombDamage(g_game,&this->_pos,(float)local_89c,*pfVar17,1,(Entity *)this,this->_tearFlags, (ulonglong)(uint)local_8b4,0); pBVar7 = BitSet128::operator_and(&local_24a8,&this->_tearFlags,&g_tearFlagPoison); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { uVar11 = Random(); Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar11); familiar = (Entity *)__RTDynamicCast(); fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)((fVar25 + (float)local_8a8) * local_910); auVar29._4_12_ = extraout_var_08; pVVar10 = Vector::Vector(&local_15b8,(float)auVar29._0_4_,(float)auVar29._0_4_); Entity::SetSpriteScale(familiar,pVVar10); pcVar2 = *(code **)(*(int *)familiar + 0x3c); Color::Color(); in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); (**(code **)(*(int *)familiar + 0xc))(); uVar11 = Random(); familiar = Game::Spawn(g_game,1000,2,(Vector *)local_8e8,&g_vectorZero,(Entity *)0x0,4,uVar11); pcVar2 = *(code **)(*(int *)familiar + 0x3c); Color::Color(); (*pcVar2)(); pVVar10 = Vector::Vector(&local_15c0,local_910,local_910 * local_900); Entity::SetSpriteScale(familiar,pVVar10); set_field_358(familiar,-5.0); (**(code **)(*(int *)familiar + 0xc))(); this = tear; } } pBVar7 = &this->_tearFlags; pBVar9 = BitSet128::operator_and(&local_24b8,pBVar7,(BitSet128 *)&DAT_00c345d0); bVar5 = BitSet128::IsNonZero(pBVar9); if ((bVar5 != 0) && (local_8c8 != (ANM2 *)0x1)) { local_8c8 = (ANM2 *)0x0; } EVar15 = local_8c4; if ((local_888._0_1_ != '\0') && (local_8c8 != (ANM2 *)0x1)) { EVar15 = (EntityPtr)((float)local_8c4 * (float)local_8b8); bVar23 = local_8c8 == (ANM2 *)&DAT_0000000b; local_8c8 = (ANM2 *)&DAT_0000000e; local_898._1_3_ = 0; local_898._0_1_ = bVar23; } if (local_88c != (EntityPtr)0x0) { auVar29 = ZEXT416((uint)local_8a0); in_stack_ffffd9fc = &this->_pos; SoundEffects::PlayWithFartOverride2 ((int)local_88c,(int)in_stack_ffffd9fc,2,0,(float)local_8a0,(float)EVar15); } pBVar9 = BitSet128::operator_and(&local_24c8,pBVar7,(BitSet128 *)&DAT_00c34880); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { MusicManager::RandomVector(&local_9ac); pVVar10 = &this->_velocity; local_88c = (EntityPtr)pVVar10; local_8c0 = (EntityPtr)Vector::LengthSquared(pVVar10); auVar29._0_12_ = ZEXT812(0x3dcccccd); auVar29._12_4_ = 0; if (auVar29._0_4_ <= (float)local_8c0) { local_a08 = Vector::Length(pVVar10); pfVar17 = &local_a08; } else { local_a04 = 10.0; pfVar17 = &local_a04; } Vector::operator_mul_assign(&local_9ac,pfVar17); local_8a0 = (EntityPtr)0x0; do { EntityPtr::clear((EntityPtr *)&local_9a4); if ((uint)local_8a0 < 2) { pVVar10 = &local_9ac; } else { pVVar10 = Vector::Vector(&local_15c8,local_9ac.y,-local_9ac.x); } Vector::operator_assign(&local_9a4,pVVar10); if (((uint)local_8a0 & 1) != 0) { pVVar10 = Vector::__unm(&local_9a4,&local_15d0); Vector::operator_assign(&local_9a4,pVVar10); } local_8b4 = (EntityPtr)GetRootPlayer(this); local_8c0 = (EntityPtr)this->_variant; if (local_8c0 == (EntityPtr)0x32) { local_8c0 = (EntityPtr)0x1; } uVar11 = Random(); EVar15 = this->_spawnerEntity; pVVar10 = Vector::__sub((Vector *)local_8e8,&local_15d8,(Vector *)local_88c); spawnedTear = tear; Game::Spawn(g_game,tear->_type,(uint)local_8c0,pVVar10,&local_9a4,(Entity *)EVar15,0,uVar11); EVar15 = (EntityPtr)__RTDynamicCast(); local_89c = EVar15; if (local_8b4 == (EntityPtr)0x0) { EVar26 = local_8b0; } else { FUN_005cd770(); EVar26 = auVar29._0_4_; } EVar26 = (EntityPtr)((float)EVar26 * (float)local_8b8); Entity_Projectile::SetHeight((Entity_Projectile *)EVar15,(float)EVar26); pBVar7 = BitSet128::operator_and (&local_24d8,&spawnedTear->_tearFlags,(BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { EVar26 = (EntityPtr)spawnedTear->_fallingAccel; } else if (local_8b4 == (EntityPtr)0x0) { EVar26 = local_894; } else { FUN_0060d070(); } Entity_Projectile::set_falling_accel((Entity_Projectile *)EVar15,(float)EVar26); Game::GetPlayer(g_game,0); FUN_0060d060(); local_8b4 = EVar26; if ((float)local_894 < (float)EVar26) { local_8b4 = (EntityPtr)((float)EVar26 * (float)local_8d4); } local_87c = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c34780,&local_24e8); local_8ac = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c345e0,&local_24f8); local_8c4 = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c345c0,&local_2508); local_8c0 = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c348f0,&local_2518); pBVar7 = BitSet128::__bnot(&g_tearFlagLudovico,&local_2528); pBVar9 = BitSet128::__bnot((BitSet128 *)&DAT_00c34850,&local_2538); pBVar32 = BitSet128::__bnot((BitSet128 *)&DAT_00c34880,&local_16e8); pBVar32 = BitSet128::operator_and(&local_16f8,tearFlagsPtr,pBVar32); pBVar9 = BitSet128::operator_and(&local_1708,pBVar32,pBVar9); pBVar7 = BitSet128::operator_and(&local_1718,pBVar9,pBVar7); pBVar7 = BitSet128::operator_and(&local_1728,pBVar7,(BitSet128 *)local_8c0); pBVar7 = BitSet128::operator_and(&local_1738,pBVar7,(BitSet128 *)local_8c4); pBVar7 = BitSet128::operator_and(&local_1748,pBVar7,(BitSet128 *)local_8ac); BitSet128::operator_and(&local_e38,pBVar7,(BitSet128 *)local_87c); if (local_888._0_1_ != '\0') { BitSet128::__bnot(&g_tearFlagExplosive,&local_1758); FUN_005cd430(); } random_float(); EVar15 = local_89c; FUN_00444c70(); this = tear; (**(code **)(*(int *)EVar15 + 0x40))(); flags._l._4_4_ = local_e38._l._4_4_; flags._l._0_4_ = (undefined4)local_e38._l; flags._h._0_4_ = (undefined4)local_e38._h; flags._h._4_1_ = (char)local_e38._h._4_4_; flags._h._5_1_ = (char)((uint)local_e38._h._4_4_ >> 8); flags._h._6_2_ = (short)((uint)local_e38._h._4_4_ >> 0x10); SetTearFlags((Entity_Tear *)EVar15,flags); fVar25 = this->_fScale * local_8f0; auVar29 = ZEXT416((uint)fVar25); SetScale((Entity_Tear *)EVar15,fVar25); pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&this->_sprite); in_stack_ffffd9fc = (Vector *)0xff; (*pcVar2)(); EVar15 = local_89c; Entity::SetParent((Entity *)local_89c,(Entity *)this->_parent); (**(code **)(*(int *)EVar15 + 0xc))(); local_8a0 = (EntityPtr)((int)local_8a0 + 1); } while ((int)local_8a0 < 4); pBVar7 = &this->_tearFlags; } pBVar9 = BitSet128::operator_and(&local_1768,pBVar7,(BitSet128 *)&DAT_00c34960); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { fire_split_projectiles(this,local_888._0_1_); } pBVar7 = BitSet128::operator_and(&local_1778,pBVar7,(BitSet128 *)&DAT_00c345a0); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (((this->_dead != 0 || (this->_techZeroTarget == (EntityPtr)0x0)) && (this->_techZeroLaser != (EntityPtr)0x0)))) { (**(code **)(*(int *)this->_techZeroLaser + 0x28))(); } pAVar21 = local_8c8; if (local_8c8 != (ANM2 *)0x0) { uVar11 = Random(); Game::Spawn(g_game,1000,(uint)pAVar21,&this->_pos,&g_vectorZero,(Entity *)this,(uint)local_898, uVar11); EVar15 = (EntityPtr)__RTDynamicCast(); local_88c = EVar15; Entity::SetPositionOffset((Entity *)EVar15,&this->_posOffset); if (((local_8c8 != (ANM2 *)0x1) && (local_8c8 != (ANM2 *)&DAT_0000004f)) && (local_8c8 != (ANM2 *)&DAT_00000050)) { if (local_8c8 == (ANM2 *)&DAT_0000000e) { local_a0c = (this->_size + 8.0) / 28.0; pVVar10 = Vector::__mul(&g_vectorOne,&local_15e0,&local_a0c); Entity::SetSpriteScale((Entity *)EVar15,pVVar10); pVVar10 = Vector::Vector(&local_15e8,(this->_posOffset).x,(float)local_894); Entity::SetPositionOffset((Entity *)EVar15,pVVar10); } else { if (((local_8c8 == (ANM2 *)&DAT_00000014) || (this->_variant == 0xf)) || (this->_variant == 0xe)) { pfVar17 = &local_a14; local_a14 = this->_fScale * local_900; pVVar10 = &local_15f8; } else { pfVar17 = &local_a10; local_a10 = this->_fScale * 0.8; pVVar10 = &local_15f0; } pVVar10 = Vector::__mul(&g_vectorOne,pVVar10,pfVar17); Entity::SetSpriteScale((Entity *)EVar15,pVVar10); } Isaac::Random(4); FUN_0043eea0(); } auVar29 = ZEXT416((uint)local_910); if (local_910 != (float)local_8a8) { pVVar10 = (Vector *)Entity::SpriteScale((Entity *)EVar15); pVVar10 = Vector::__mul(pVVar10,&local_1600,&local_910); Entity::SetSpriteScale((Entity *)EVar15,pVVar10); } switch(this->_variant) { case 3: case 0x13: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT416((uint)local_8d4); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 4: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); Color::Color(0x3f800000,0,0x55,0); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 5: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 6: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT816(0x3dcccccd); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 7: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; default: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&this->_sprite); in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); EVar15 = local_88c; break; case 0x12: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT416((uint)local_8a8); Color::Color(0x3f800000,0,0x46,0xff); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x14: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT416((uint)local_8a8); Color::Color(0x3f800000,0xe6,0xe6,0); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x1a: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); Color::Color(0x3f800000,0,0,0); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x1b: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT416((uint)local_8b8); Color::Color(0x3f800000,0x3f000000,0x3f000000,0x3f000000); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x1f: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT816(0x3dcccccd); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x26: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT416((uint)local_8d4); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x2d: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); auVar29 = ZEXT416((uint)local_8a8); Color::Color(0x3f800000,0x3f800000,0x3f19999a,0x3f47ae14,0x3f800000,0,0,0); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; break; case 0x30: pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&tear->_sprite); Color::Color(aCStackY_3c4c + 0x81); FUN_004072e0(); EVar15 = local_88c; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); this = tear; } pEVar18 = (Entity_Player *)__RTDynamicCast(); if ((pEVar18 != (Entity_Player *)0x0) && (bVar5 = Entity_Player::IsLocalPlayer(pEVar18), bVar5 == 0)) { color = (ColorMod *)Entity::GetColor((Entity *)EVar15); Color::operator_assign((Color *)local_150,color); FUN_00417900(); FUN_00925df0(); local_87c = auVar29._0_4_; fVar24 = (float10)Color::A(); auVar29 = ZEXT416((uint)local_87c); Font::SetLineHeightModifier((Font *)local_150,(float)(fVar24 * (float10)(float)local_87c)); in_stack_ffffd9fc = (Vector *)0xffffffff; (**(code **)(*(int *)EVar15 + 0x3c))(); } } iVar8 = this->_variant; if (((((((iVar8 == 0) || (iVar8 == 0x18)) || (iVar8 == 0x10)) || ((iVar8 == 0x1b || (iVar8 == 0x21)))) || (iVar8 == 0x22)) || ((iVar8 == 0x23 || (iVar8 == 0x24)))) || ((iVar8 == 0x25 || (iVar8 == 0x26)))) { local_920 = Isaac::Random(5); if (this->_variant == 0x1b) { local_a18 = 3; piVar13 = (int *)std::max(); local_920 = *piVar13; } local_8b4 = (EntityPtr)GetRootPlayer(this); local_89c = (EntityPtr)0x0; if (0 < local_920) { do { uVar11 = Random(); pVVar10 = MusicManager::RandomVector(&local_1608); local_a1c = random_float(); local_a1c = local_a1c * 24.0; pVVar10 = Vector::__mul(pVVar10,&local_1610,&local_a1c); pVVar10 = Vector::__add((Vector *)local_8e8,&local_1618,pVVar10); Game::Spawn(g_game,1000,7,pVVar10,&g_vectorZero,(Entity *)0x0,0,uVar11); familiar = (Entity *)__RTDynamicCast(); local_a20 = 0.3; pVVar10 = Vector::__mul(&g_vectorOne,&local_1620,&local_a20); Entity::SetSpriteScale(familiar,pVVar10); auVar29 = ZEXT416((uint)local_894); Color::Color((Color *)local_7c); Font::SetLineHeightModifier((Font *)local_7c,0.08); this = tear; if (tear->_variant == 0x1b) { LAB_0066a2e0: auVar29 = ZEXT416((uint)local_894); color = (ColorMod *)Color::Color(); Color::operator_assign((Color *)local_7c,color); } else if (local_8b4 == (EntityPtr)0x0) { LAB_0066a2bc: if ((this->_variant == 0x21) || (this->_variant == 0x22)) goto LAB_0066a2e0; } else { bVar5 = Entity_Player::HasCollectible((Entity_Player *)local_8b4,0x136,0); if (bVar5 == 0) { bVar5 = Entity_Player::HasCollectible((Entity_Player *)local_8b4,6,0); if (bVar5 != 0) goto LAB_0066a2e0; goto LAB_0066a2bc; } fVar25 = random_float(); auVar29._0_4_ = (EntityPtr)(fVar25 * (float)local_8d4 + 0.2); auVar29._4_12_ = extraout_var_09; Font::SetLineHeightModifier((Font *)local_7c,(float)auVar29._0_4_); } in_stack_ffffd9fc = (Vector *)0xffffffff; (**(code **)(*(int *)familiar + 0x3c))(); (**(code **)(*(int *)familiar + 0xc))(); local_89c = (EntityPtr)((int)local_89c + 1); } while ((int)local_89c < local_920); } } if (this->_dead != 0) { pBVar7 = BitSet128::operator_and(&local_1788,&this->_tearFlags,(BitSet128 *)&DAT_00c34b20); BitSet128::IsNonZero(pBVar7); (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } LAB_0066a370: pBVar7 = BitSet128::operator_and(&local_1798,&this->_tearFlags,(BitSet128 *)&DAT_00c348c0); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 == 0) || (iVar8 = Entity::FrameCount((Entity *)this), iVar8 < 3)) goto LAB_0066a545; if (local_8d8 == (EntityPtr)0x0) { auVar31 = (undefined1 [12])0x0; EVar15 = local_8a8; } else { EVar15 = (EntityPtr)get_tear_trinket_multiplier((Entity_Player *)local_8d8,0x1e); auVar31 = extraout_var_10; } auVar29._0_4_ = (EntityPtr)((float)EVar15 * (float)local_8b8 + (float)local_8b8); auVar29._4_12_ = auVar31; local_90c = (float)auVar29._0_4_; iVar8 = Entity::FrameCount((Entity *)this); if (iVar8 < 5) { iVar8 = Entity::FrameCount((Entity *)this); if (iVar8 == 3) { pVVar16 = Vector::Vector(&local_1668,(this->_velocity).y,-(this->_velocity).x); pVVar10 = &local_1670; goto LAB_0066a52b; } goto LAB_0066a545; } iVar8 = Entity::FrameCount((Entity *)this); switch((iVar8 + -5) % 0x16) { case 0: pVVar10 = Vector::Vector(&VStack_1628,-(this->_velocity).y,(this->_velocity).x); pVVar10 = Vector::__div(pVVar10,&VStack_1630,&local_90c); break; default: goto LAB_0066a545; case 7: pVVar16 = Vector::Vector(&VStack_1638,-(this->_velocity).y,(this->_velocity).x); pVVar10 = &VStack_1640; goto LAB_0066a52b; case 10: pVVar10 = Vector::Vector(&VStack_1648,(this->_velocity).y,-(this->_velocity).x); pVVar10 = Vector::__div(pVVar10,&VStack_1650,&local_90c); break; case 0x13: pVVar16 = Vector::Vector(&VStack_1658,(this->_velocity).y,-(this->_velocity).x); pVVar10 = &VStack_1660; LAB_0066a52b: pVVar10 = Vector::__mul(pVVar16,pVVar10,&local_90c); } Vector::operator_assign(&this->_velocity,pVVar10); LAB_0066a545: pBVar9 = &this->_tearFlags; pBVar7 = BitSet128::operator_or(&local_17a8,(BitSet128 *)&DAT_00c34b60,(BitSet128 *)&DAT_00c34600) ; pBVar7 = BitSet128::operator_and(&local_17b8,pBVar9,pBVar7); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (this->_target == (EntityPtr)0x0)) { local_8a0 = this->_spawnerEntity; if (local_8a0 == (EntityPtr)0x0) { local_8a0 = this->_parent; } pBVar7 = BitSet128::operator_and(&local_17c8,pBVar9,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { if ((local_8a0 != (EntityPtr)0x0) || (bVar5 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar5 != 0)) { pBVar7 = BitSet128::operator_and(&local_17d8,pBVar9,(BitSet128 *)&DAT_00c34580); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and(&local_17e8,pBVar9,(BitSet128 *)&DAT_00c34600); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 == 0) && (this->_waitFrames < 2)) { if ((this->_tearIdx & 1) == 0) { local_8b4 = local_8a8; } else { local_8b4 = (EntityPtr)&DAT_bf800000; } EntityPtr::clear((EntityPtr *)&local_98c); EntityPtr::clear((EntityPtr *)&local_b6c); bVar5 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero); if (bVar5 == 0) { pVVar10 = Vector::__add(&this->_pos,&local_16b8,&this->_velocity); pVVar10 = Vector::__sub(pVVar10,&local_16c0,&this->_targetPosition); Vector::operator_assign(&local_98c,pVVar10); pVVar10 = &this->_orbitVelocity; pVVar16 = &g_vectorZero; } else { pVVar10 = Vector::__add(&this->_pos,&local_1698,&this->_velocity); pVVar16 = (Vector *)FUN_004172b0(); pVVar10 = Vector::__sub(pVVar10,local_16a8,pVVar16); Vector::operator_assign(&local_98c,pVVar10); pVVar16 = Entity::Velocity((Entity *)local_8a0,&local_16b0); pVVar10 = &local_b6c; } Vector::operator_assign(pVVar10,pVVar16); bVar5 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero); if ((bVar5 != 0) && (bVar5 = Entity::is_player((Entity *)local_8a0), bVar5 != 0)) { pVVar10 = (Vector *)Entity_Player::GetAimDirection((Entity_Player *)local_8a0); local_a30 = 60.0; pVVar10 = Vector::operator_mul(&local_16c8,&local_a30,pVVar10); Vector::operator__(&local_98c,pVVar10); } local_928 = Vector::Length(&local_98c); auVar29 = ZEXT416((uint)local_928); if (local_928 != (float)local_894) { Vector::__div(&local_98c,&local_c90,&local_928); Vector::operator__(&this->_velocity,&this->_orbitVelocity); local_888 = (EntityPtr)0x42f00000; local_924 = 0.1; pBVar7 = BitSet128::operator_and (&local_17f8,&this->_tearFlags,(BitSet128 *)&DAT_00c34860); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { EVar15 = (EntityPtr)0x42f00000; } else { local_938 = assert_lerp_range(this->_height,-5.0,-24.0,0.05,1.5,1); pBVar7 = BitSet128::operator_and(&local_1808,&this->_tearFlags,&g_tearFlagExplosive) ; bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { local_a34 = 0x3ecccccd; pfVar17 = (float *)std::max(); local_938 = *pfVar17; } local_888 = (EntityPtr)(local_938 * 120.0); local_924 = (2.5 - local_938) * local_924; EVar15 = local_888; } local_924 = ((float)EVar15 - local_928) * local_924; fVar25 = Vector::GetAngleDegrees(&local_c90); local_87c = (EntityPtr)((float)local_8b4 * 90.0); local_89c = (EntityPtr)(fVar25 + (float)local_87c); EVar15 = local_894; FUN_00a155f0(); fVar25 = Math::clamp((float)local_894,(float)local_8a8,(float)EVar15); local_8ac = (EntityPtr)pow(fVar25,2.0); fVar25 = Vector::GetAngleDegrees(&this->_velocity); local_87c = (EntityPtr)((float)local_89c - fVar25); fVar25 = normalize_angle_degrees((float)local_87c); local_87c = (EntityPtr)(fVar25 * (float)local_8ac); fVar25 = Vector::GetAngleDegrees(&this->_velocity); local_89c = (EntityPtr)(fVar25 + (float)local_87c); auVar29 = ZEXT416((uint)local_89c); Vector::FromAngle(&local_da0,(float)local_89c); local_968 = Vector::Length(&this->_velocity); pVVar10 = Vector::__mul(&local_da0,&local_16d0,&local_968); pVVar16 = Vector::__mul(&local_c90,&local_16d8,&local_924); pVVar10 = Vector::__add(pVVar10,&local_e40,pVVar16); pVVar10 = Vector::Normalized(pVVar10,&local_e48); pVVar10 = Vector::__mul(pVVar10,&local_e50,&local_968); pVVar10 = Vector::__add(pVVar10,&local_e58,&local_b6c); Vector::operator_assign(&this->_velocity,pVVar10); pVVar10 = &local_b6c; pVVar16 = &this->_orbitVelocity; goto LAB_0066aff6; } } else { EntityPtr::clear((EntityPtr *)&local_9bc); EntityPtr::clear((EntityPtr *)&local_c98); bVar5 = Vector::operator_eq(&this->_targetPosition,&g_vectorZero); if (bVar5 == 0) { Vector::operator_assign(&local_9bc,&this->_targetPosition); pVVar10 = &g_vectorZero; } else { pVVar10 = Entity::Position((Entity *)local_8a0,&local_e60); Vector::operator_assign(&local_9bc,pVVar10); pVVar10 = Entity::Velocity((Entity *)local_8a0,&local_e68); Entity::get_friction(); local_a38 = auVar29._0_4_; pVVar10 = Vector::__div(pVVar10,&local_e70,&local_a38); } Vector::operator_assign(&local_c98,pVVar10); if (this->_orbitRadius == (float)local_894) { Vector::__sub(&this->_pos,&local_b74,&local_9bc); local_950.x = (this->_velocity).x; local_950.y = (this->_velocity).y; if (1 < this->_waitFrames) { Vector::operator_assign(&local_950,&this->_continueVelocity); } pVVar10 = Vector::Normalized(&local_b74,&local_e78); pVVar16 = Vector::Normalized(&local_950,&local_e80); local_87c = (EntityPtr)Vector::Dot(pVVar10,pVVar16); if ((float)local_87c < 0.8) { pVVar10 = Vector::Rotated(&local_b74,&local_e88,90.0); local_87c = (EntityPtr)Vector::Dot(pVVar10,&local_950); local_8b4 = (EntityPtr)&DAT_bf800000; if ((float)local_894 <= (float)local_87c) { local_8b4 = (EntityPtr)0x3f800000; } fVar25 = Vector::Length(&local_950); fVar25 = fVar25 * (float)local_8b4; pVVar10 = &local_b74; } else { local_8b4 = (EntityPtr)0x3f800000; if ((this->_tearIdx & 1) == 0) { local_8b4 = (EntityPtr)&DAT_bf800000; } fVar25 = Vector::Length(&local_950); fVar25 = fVar25 * (float)local_8b4; pVVar10 = &local_950; } this->_orbitRadius = fVar25; fVar25 = Vector::GetAngleDegrees(pVVar10); this->_orbitAngle = fVar25; } local_93c = 90.0; if (0 < this->_waitFrames) { local_93c = 30.0; } pVVar10 = Vector::FromAngle(&local_e90,this->_orbitAngle); pVVar10 = Vector::__mul(pVVar10,&local_e98,&local_93c); Vector::__add(&local_9bc,&local_da8,pVVar10); local_a3c = 0x40a00000; fVar25 = this->_orbitRadius; FUN_0041d510(); local_a40 = fVar25; puVar14 = (undefined4 *)std::max(); local_8ac = (EntityPtr)*puVar14; local_a44 = 2.0; Vector::operator_mul(&local_ca0,&local_a44,&local_c98); pVVar10 = Vector::__add(&this->_pos,&local_ea0,&local_ca0); pVVar10 = Vector::__sub(&local_da8,&local_ea8,pVVar10); local_a48 = 0.5; Vector::operator_mul(&local_b7c,&local_a48,pVVar10); local_87c = (EntityPtr)Vector::Length(&local_b7c); if ((float)local_8ac < (float)local_87c) { Vector::Resize(&local_b7c,(float)local_8ac); } pVVar10 = Vector::__add(&local_ca0,&local_eb0,&local_b7c); pVVar10 = Vector::__div(pVVar10,&local_eb8,&this->_friction); Vector::operator_assign(&this->_velocity,pVVar10); auVar29._0_4_ = (EntityPtr) normalize_angle_degrees ((((this->_orbitRadius / local_93c) * 180.0) / 3.1415927) * this->_speedMultiplier + this->_orbitAngle); auVar29._4_12_ = extraout_var_11; this->_orbitAngle = (float)auVar29._0_4_; if (1 < this->_waitFrames) { pVVar10 = Vector::FromAngle(&local_ec0,(float)auVar29._0_4_); auVar29 = ZEXT416((uint)this->_orbitRadius); FUN_0041d510(); local_a4c = auVar29._0_4_; in_stack_ffffd9fc = (Vector *)0x66afed; pVVar10 = Vector::operator_mul(&local_ec8,&local_a4c,pVVar10); pVVar16 = &this->_continueVelocity; LAB_0066aff6: Vector::operator_assign(pVVar16,pVVar10); } } } } } else { cVar6 = is_not_familiar_spawned(this); if ((cVar6 != '\0') && (local_8a0 != (EntityPtr)0x0)) { pVVar10 = Entity::Position((Entity *)local_8a0,&local_1678); Vector::__sub(&this->_pos,&local_ce8,pVVar10); local_92c = Vector::Length(&local_ce8); if (local_92c == (float)local_894) { local_92c = 0.1; } Vector::__div(&local_ce8,&local_b64,&local_92c); local_a2c = (100.0 - local_92c) * 0.01; Vector::Vector(&local_b5c,local_b64.y,-local_b64.x); local_87c = (EntityPtr)Vector::Dot(&local_b5c,&this->_velocity); auVar29 = ZEXT416((uint)local_894); if ((float)local_87c < (float)local_894) { local_a24 = &DAT_bf800000; Vector::operator_mul_assign(&local_b5c,(float *)&local_a24); } local_a28 = 1.0; pVVar10 = Vector::__mul(&local_b5c,&local_1680,&local_a28); pVVar16 = Vector::__mul(&local_b64,&local_1688,&local_a2c); bVar5 = 0; in_stack_ffffd9fc = (Vector *)0x66a724; pVVar10 = Vector::__add(pVVar10,&local_1690,pVVar16); Entity::AddVelocity_divided((Entity *)this,pVVar10,bVar5); } } } pBVar7 = BitSet128::operator_and(&local_1818,&this->_tearFlags,(BitSet128 *)&DAT_00c34780); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { pBVar7 = BitSet128::operator_and(&local_1a38,&this->_tearFlags,&g_tearFlagHoming); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { pBVar7 = BitSet128::operator_and(&local_1a48,&this->_tearFlags,(BitSet128 *)&DAT_00c34950); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) goto LAB_0066d04f; } if ((this->_target != (EntityPtr)0x0) && (bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)this->_target), bVar5 != 0)) { Entity::SetTarget((Entity *)this,(Entity *)0x0); } if (this->_target == (EntityPtr)0x0) { bVar5 = Entity::IsFrame((Entity *)this,4,this->_index); if (bVar5 != 0) { auVar29._0_12_ = ZEXT812(0x4e6e6b28); auVar29._12_4_ = 0; local_8a0 = (EntityPtr)0x0; local_898 = auVar29._0_4_; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); local_c30 = 5.0; pVVar10 = Vector::operator_mul(&local_1030,&local_c30,&this->_velocity); pVVar10 = Vector::__add(&this->_pos,&local_1038,pVVar10); in_stack_ffffd9fc = (Vector *)0x66cbd8; EntityList::QueryRadius(entityList,(EntityList_EL *)(local_c80 + 0xc),pVVar10,128.0,8); local_14 = 3; local_888 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { pEVar20 = (EntityPtr *)std::vector::operator_index(); EVar15 = *pEVar20; local_89c = EVar15; bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar15,(Entity *)0x0); if (bVar5 != 0) { if (this->_spawnerEntity != (EntityPtr)0x0) { bVar5 = Entity::IsDescendantOf((Entity *)this->_spawnerEntity,(Entity *)EVar15); if (bVar5 != 0) goto LAB_0066cdbc; } bVar5 = Entity::HasEntityFlags((Entity *)EVar15,0x20000010); if (bVar5 == 0) { bVar5 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)EVar15); if (bVar5 == 0) { puVar14 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::is_player((Entity *)*puVar14); if (bVar5 != 0) { puVar14 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity_Player::IsInvisible((Entity_Player *)*puVar14); if (bVar5 != 0) goto LAB_0066cdbc; } iVar8 = Isaac::Random(2); if (iVar8 != 0) { if (this->_entityGridCollisionClass == 4) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar10 = Entity::Position((Entity *)local_89c,&local_1040); in_stack_ffffd9fc = (Vector *)0x0; bVar5 = Room::CheckLine(room,&this->_pos,pVVar10,3,0,0,0,(Vector *)0x0); if (bVar5 == 0) goto LAB_0066cdbc; } local_c2c = (void *)0x40a00000; pVVar10 = Vector::operator_mul(&local_1048,(float *)&local_c2c,&this->_velocity) ; pVVar10 = Vector::__add(&this->_pos,&local_1050,pVVar10); pVVar16 = Entity::Position((Entity *)local_89c,&local_1058); local_8ac = (EntityPtr)Vector::Distance(pVVar10,pVVar16); fVar25 = random_float(); EVar26 = local_89c; local_87c = (EntityPtr)(fVar25 * 128.0); local_8d0 = (EntityPtr)((float)local_87c + (float)local_8ac); bVar5 = EntityList::HitListContains ((EntityList *)&this->_hitList,(Entity *)local_89c); EVar15 = local_8d0; if (bVar5 != 0) { EVar15 = (EntityPtr)((float)local_8d0 + 1000.0); } auVar29 = ZEXT416((uint)EVar15); if ((float)EVar15 < (float)local_898) { local_8a0 = EVar26; local_898 = EVar15; } } } } } LAB_0066cdbc: local_888 = (EntityPtr)((int)local_888 + 1); EVar15 = (EntityPtr)EntityList::Size(); } while ((uint)local_888 < (uint)EVar15); } Game::GetField26614(g_game); cVar6 = FUN_00429550(); if (cVar6 != '\0') { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); in_stack_ffffd9fc = (Vector *)0x43; EntityList::QuerySublist(entityList,&local_c64,3,0x43,-1,1,0); EVar15 = (EntityPtr)0x0; local_14 = CONCAT31(local_14._1_3_,4); local_888 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(); bVar5 = Entity::IsDescendantOf((Entity *)*puVar14,(Entity *)this->_spawnerEntity); if (bVar5 == 0) { local_c28 = 5.0; pVVar10 = Vector::operator_mul(&local_1060,&local_c28,&this->_velocity); pVVar10 = Vector::__add(&this->_pos,&local_1068,pVVar10); puVar14 = (undefined4 *)std::vector::operator_index(); pVVar16 = Entity::Position((Entity *)*puVar14,&local_1070); local_8ac = (EntityPtr)Vector::Distance(pVVar10,pVVar16); fVar25 = random_float(); EVar15 = local_888; local_87c = (EntityPtr)(fVar25 * 128.0); local_8d0 = (EntityPtr)((float)local_87c + (float)local_8ac); auVar29 = ZEXT416((uint)local_898); if ((float)local_8d0 < (float)local_898) { pEVar20 = (EntityPtr *)std::vector::operator_index(); auVar29 = ZEXT416((uint)local_8d0); local_898 = local_8d0; local_8a0 = *pEVar20; } } EVar15 = (EntityPtr)((int)EVar15 + 1); local_888 = EVar15; EVar26 = (EntityPtr)EntityList::Size(); } while ((uint)EVar15 < (uint)EVar26); } local_14 = CONCAT31(local_14._1_3_,3); EntityList_Query::~EntityList_Query(&local_c64); } Entity::SetTarget((Entity *)this,(Entity *)local_8a0); local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_c80 + 0xc); } if (this->_target == (EntityPtr)0x0) goto LAB_0066d04f; } pBVar7 = BitSet128::operator_and(&local_1a58,&this->_tearFlags,&g_tearFlagHoming); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pVVar10 = Entity::Position((Entity *)this->_target,&local_1078); Vector::__sub(&this->_pos,&local_dd0,pVVar10); pVVar10 = Vector::Normalized(&local_dd0,&local_1080); pVVar10 = Vector::operator_mul(&local_1088,&this->_speedMultiplier,pVVar10); local_c24 = 2.0; pVVar10 = Vector::__mul(pVVar10,&local_1090,&local_c24); Vector::operator__(&this->_velocity,pVVar10); auVar29._0_4_ = (EntityPtr)Math::timescale_factor(this->_homingFriction,this->_speedMultiplier); auVar29._4_12_ = extraout_var_14; local_c20 = (float)auVar29._0_4_; Vector::operator_mul_assign(&this->_velocity,&local_c20); } } else { local_88c = (EntityPtr)GetRootPlayer(this); local_8c8 = &this->_sprite; _empty_check_0x34(); auVar30._4_12_ = auVar29._4_12_; auVar30._0_4_ = (EntityPtr)((auVar29._0_4_ * 360.0) / (float)local_8fc + 90.0); local_8c4 = auVar30._0_4_; if (local_88c == (EntityPtr)0x0) { local_8c0 = local_894; } else { FUN_00665c00(); local_8c0 = auVar30._0_4_; } local_8a1 = '\0'; pBVar7 = BitSet128::operator_and(&local_1828,&this->_tearFlags,(BitSet128 *)&DAT_00c34740); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { iVar8 = EntityPtr::Ref(); if ((iVar8 == 0) && (this->_dead == 0)) { uVar11 = Random(); in_stack_ffffd9fc = (Vector *)local_88c; local_8a0 = (EntityPtr) Game::SpawnEx(g_game,7,2,&this->_pos,&g_vectorZero,(Entity *)local_88c,3,uVar11, 1); if (local_8a0 == (EntityPtr)0x0) { BitSet128::__bnot((BitSet128 *)&DAT_00c34740,&local_1878); FUN_005cd430(); } else { if (local_88c != (EntityPtr)0x0) { pcVar2 = *(code **)(*(int *)local_8a0 + 0x3c); Entity_Player::get_laser_color_copy((Entity_Player *)local_88c,local_514); (*pcVar2)(); } Entity::SetPositionOffset((Entity *)local_8a0,&this->_posOffset); Entity::SetParent((Entity *)local_8a0,(Entity *)this); set_field_358((void *)local_8a0,3000.0); pBVar9 = (BitSet128 *)&DAT_00c34780; pBVar7 = BitSet128::operator_or (&local_1838,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40); pBVar7 = BitSet128::operator_or(&local_1848,pBVar7,pBVar9); pBVar7 = BitSet128::__bnot(pBVar7,&local_1858); pBVar7 = BitSet128::operator_and(&local_1868,&this->_tearFlags,pBVar7); in_stack_ffffd9fc = *(Vector **)&pBVar7->_l; FUN_00456830(); (**(code **)(*(int *)local_8a0 + 0x40))(); Entity_Laser::SetTimeout((Entity_Laser *)local_8a0); Entity_Laser::set_scale(); FUN_0060ce80(); Entity::SetSpawnerEntity((Entity *)local_8a0,(Entity *)local_88c); (**(code **)(*(int *)local_8a0 + 0xc))(); EntityPtr::Set((EntityPtr *)&this->field_0x4a4,(Entity *)local_8a0); } } iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { EntityPtr::Ref(); Entity_Laser::set_scale(); EntityPtr::Ref(); FUN_0060ce80(); } } pBVar7 = BitSet128::operator_and(&local_1888,&this->_tearFlags,(BitSet128 *)&DAT_00c34710); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { pBVar7 = BitSet128::operator_and(&local_18d8,&this->_tearFlags,(BitSet128 *)&DAT_00c34730); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { pBVar7 = BitSet128::operator_and(&local_1918,&this->_tearFlags,(BitSet128 *)&DAT_00c34720); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { local_87c = (EntityPtr)&this->_attachedEffect; iVar8 = EntityPtr::Ref(); if ((iVar8 == 0) && (this->_dead == 0)) { uVar11 = Random(); in_stack_ffffd9fc = &g_vectorZero; EVar15 = (EntityPtr) Game::Spawn(g_game,8,1,&this->_pos,&g_vectorZero,(Entity *)local_88c,0,uVar11); local_8b4 = EVar15; if (EVar15 != (EntityPtr)0x0) { Entity::SetParent((Entity *)EVar15,(Entity *)this); pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&this->_sprite); in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); pBVar7 = BitSet128::operator_or (&local_1928,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40) ; pBVar7 = BitSet128::__bnot(pBVar7,&local_1938); BitSet128::operator_and(&local_1948,&this->_tearFlags,pBVar7); EVar15 = local_8b4; FUN_005cd5c0(); (**(code **)(*(int *)EVar15 + 0x40))(); FUN_0060cf20(); local_a68 = this->_fScale * local_8f0; pVVar10 = Vector::operator_mul(&local_f28,&local_a68,&g_vectorOne); Entity::SetSpriteScale((Entity *)EVar15,pVVar10); (**(code **)(*(int *)EVar15 + 0xc))(); FUN_00651a10(); } } iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { familiar = (Entity *)EntityPtr::Ref(); this = tear; pVVar10 = Vector::Vector(&local_f30,(float)local_894,6.0); pVVar10 = Vector::__mul(pVVar10,&local_f38,&this->_fScale); pVVar10 = Vector::__add(&this->_posOffset,&local_f40,pVVar10); Entity::SetPositionOffset(familiar,pVVar10); EntityPtr::Ref(); FUN_005b15d0(); EntityPtr::Ref(); cVar6 = FUN_00665ba0(); if (cVar6 == '\0') { Vector::FromAngle(&local_db8,(float)local_8c4); if (this->_target != (EntityPtr)0x0) { pVVar10 = Entity::Position((Entity *)this->_target,&local_f48); pVVar10 = Vector::__sub(pVVar10,&local_f50,&this->_pos); pVVar10 = Vector::Normalized(pVVar10,&local_f58); local_87c = (EntityPtr)Vector::Dot(pVVar10,&local_db8); if (0.1 < (float)local_87c) { pVVar10 = Entity::Position((Entity *)this->_target,&local_f60); local_87c = (EntityPtr)Vector::Distance(pVVar10,&this->_pos); if ((float)local_87c < this->_fScale * 50.0) { familiar = (Entity *)EntityPtr::Ref(); pfVar17 = (float *)Entity::SpriteScale(familiar); local_a70 = 0x3f000000; local_a6c = (float)local_8a8 / (*pfVar17 * (float)local_8b8 + (float)local_8b8); pEVar20 = (EntityPtr *)std::max(); local_87c = *pEVar20; fVar25 = random_float(); in_stack_ffffd9fc = (Vector *)0xfc; SoundEffects::PlayWithFartOverride (0xfc,(float)local_8a8,1,0,(fVar25 * 0.2 + 0.9) * (float)local_87c); EntityPtr::Ref(); FUN_00665bc0(); knife = (Entity_Knife *)EntityPtr::Ref(); Entity_Knife::SetAttackAnimation(knife); local_8a1 = '\x01'; goto LAB_0066b8aa; } } } } local_8a1 = '\x01'; } } } else { local_87c = (EntityPtr)&this->_attachedEffect; iVar8 = EntityPtr::Ref(); if ((iVar8 == 0) && (this->_dead == 0)) { uVar11 = Random(); in_stack_ffffd9fc = &g_vectorZero; EVar15 = (EntityPtr) Game::Spawn(g_game,8,0,&this->_pos,&g_vectorZero,(Entity *)local_88c,0,uVar11); local_8b4 = EVar15; if (EVar15 != (EntityPtr)0x0) { Entity::SetParent((Entity *)EVar15,(Entity *)this); pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&this->_sprite); in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); pBVar7 = BitSet128::operator_or (&local_1f38,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40); pBVar7 = BitSet128::__bnot(pBVar7,&local_18f8); BitSet128::operator_and(&local_1908,&this->_tearFlags,pBVar7); EVar15 = local_8b4; FUN_005cd5c0(); (**(code **)(*(int *)EVar15 + 0x40))(); FUN_0060cf20(); local_a60 = this->_fScale * (float)local_8b8; pVVar10 = Vector::operator_mul(&local_f00,&local_a60,&g_vectorOne); Entity::SetSpriteScale((Entity *)EVar15,pVVar10); (**(code **)(*(int *)EVar15 + 0xc))(); FUN_00651a10(); } } iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { piVar13 = (int *)EntityPtr::Ref(); (**(code **)(*piVar13 + 0x40))(); familiar = (Entity *)EntityPtr::Ref(); local_a64 = this->_fScale * (float)local_8b8; pVVar10 = Vector::operator_mul(&local_f08,&local_a64,&g_vectorOne); Entity::SetSpriteScale(familiar,pVVar10); familiar = (Entity *)EntityPtr::Ref(); this = tear; pVVar10 = Vector::Vector(&local_f10,(float)local_894,4.0); pVVar10 = Vector::__mul(pVVar10,&local_f18,&this->_fScale); pVVar10 = Vector::__add(&this->_posOffset,&local_f20,pVVar10); Entity::SetPositionOffset(familiar,pVVar10); EntityPtr::Ref(); FUN_005b15d0(); } } } else { local_87c = (EntityPtr)&this->_attachedEffect; iVar8 = EntityPtr::Ref(); if ((iVar8 == 0) && (this->_dead == 0)) { uVar11 = 10; pBVar7 = BitSet128::operator_and(&local_1898,&this->_tearFlags,(BitSet128 *)&DAT_00c34750); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { uVar11 = 0xb; } uVar19 = Random(); in_stack_ffffd9fc = &g_vectorZero; EVar15 = (EntityPtr) Game::Spawn(g_game,8,uVar11,&this->_pos,&g_vectorZero,(Entity *)local_88c,0,uVar19) ; local_8b4 = EVar15; if (EVar15 == (EntityPtr)0x0) { KAGE_LogMessage(8,(byte *)"BAD THINGS! \n"); } else { Entity::SetParent((Entity *)EVar15,(Entity *)this); pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)&this->_sprite); in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); pBVar7 = BitSet128::operator_or (&local_18a8,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40); pBVar7 = BitSet128::__bnot(pBVar7,&local_18b8); BitSet128::operator_and(&local_18c8,&this->_tearFlags,pBVar7); EVar15 = local_8b4; FUN_005cd5c0(); (**(code **)(*(int *)EVar15 + 0x40))(); FUN_0060cf20(); local_a50 = this->_fScale * local_8f0; pVVar10 = Vector::operator_mul(&local_ed0,&local_a50,&g_vectorOne); Entity::SetSpriteScale((Entity *)EVar15,pVVar10); (**(code **)(*(int *)EVar15 + 0xc))(); FUN_00651a10(); EntityPtr::Ref(); FUN_005b15d0(); } } iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { piVar13 = (int *)EntityPtr::Ref(); (**(code **)(*piVar13 + 0x40))(); familiar = (Entity *)EntityPtr::Ref(); local_a54 = this->_fScale * local_8f0; pVVar10 = Vector::operator_mul(&local_ed8,&local_a54,&g_vectorOne); Entity::SetSpriteScale(familiar,pVVar10); familiar = (Entity *)EntityPtr::Ref(); spawnedTear = tear; pVVar10 = Vector::Vector(&local_ee0,(float)local_894,6.0); pVVar10 = Vector::__mul(pVVar10,&local_ee8,&spawnedTear->_fScale); pVVar10 = Vector::__add(&spawnedTear->_posOffset,&local_ef0,pVVar10); Entity::SetPositionOffset(familiar,pVVar10); EVar15 = local_8c4; Vector::FromAngle(&local_ef8,(float)local_8c4); EntityPtr::Ref(); FUN_0060ccf0(); if ((float)EVar15 <= 1.1) { EntityPtr::Ref(); cVar6 = FUN_00665bb0(); if (cVar6 == '\0') { EntityPtr::Ref(); cVar6 = FUN_00665ba0(); if (cVar6 == '\0') { familiar = (Entity *)EntityPtr::Ref(); pfVar17 = (float *)Entity::SpriteScale(familiar); local_a5c = 0x3f000000; local_a58 = (float)local_8a8 / (*pfVar17 * (float)local_8b8 + (float)local_8b8); pEVar20 = (EntityPtr *)std::max(); local_87c = *pEVar20; fVar25 = random_float(); in_stack_ffffd9fc = (Vector *)0xfc; SoundEffects::PlayWithFartOverride (0xfc,(float)local_8a8,1,0,(fVar25 * 0.2 + 0.9) * (float)local_87c); EntityPtr::Ref(); FUN_00665bc0(); knife = (Entity_Knife *)EntityPtr::Ref(); Entity_Knife::SetAttackAnimation(knife); } } else { EntityPtr::Ref(); EntityPtr::Ref(); FUN_0060ccf0(); FUN_00665be0(); EntityPtr::Ref(); EntityPtr::Ref(); FUN_0060ccf0(); FUN_00665bf0(); } } else { knife = (Entity_Knife *)EntityPtr::Ref(); Entity_Knife::SpinAttack(knife,1,0); iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { EntityPtr::Ref(); FUN_00665be0(); EntityPtr::Ref(); FUN_00665bf0(); } } iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { knife = (Entity_Knife *)EntityPtr::Ref(); cVar6 = Entity_Knife::IsFlying(knife); if (cVar6 == '\0') { EntityPtr::Ref(); cVar6 = FUN_00665ba0(); if (cVar6 == '\0') { EntityPtr::Ref(); cVar6 = FUN_00665bb0(); if (cVar6 == '\0') { piVar13 = (int *)EntityPtr::Ref(); (**(code **)(*piVar13 + 0x28))(); } } } } iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { familiar = (Entity *)EntityPtr::Ref(); cVar6 = Entity::Exists(familiar); if (cVar6 != '\0') { _MaxCount = 4; uVar34 = 0xe8; uVar35 = 2; uVar36 = 0xb6; familiar = (Entity *)EntityPtr::Ref(); Entity::GetSprite(familiar); Config::GetPillEffects(); _Str1 = (char *)_string_holder_c_str(); in_stack_ffffd9fc = (Vector *)0x66b80b; iVar8 = strncmp(_Str1,(char *)CONCAT22(uVar36,CONCAT11(uVar35,uVar34)),_MaxCount); if (iVar8 == 0) { familiar = (Entity *)EntityPtr::Ref(); Entity::GetNullOffset(familiar,&local_db0,&DAT_00b1d3b0); animState = (AnimationState *)Config::GetPillEffects(); iVar8 = AnimationState::GetAnimationLength(animState); local_8ac = (EntityPtr)(360.0 / (float)iVar8); local_87c = (EntityPtr)Vector::GetAngleDegrees(&local_db0); normalize_angle_degrees((float)local_87c); FUN_0040a740(); } else { EntityPtr::Ref(); FUN_005b15d0(); } } } this = tear; } } LAB_0066b8aa: pBVar7 = BitSet128::operator_and(&local_1958,&this->_tearFlags,(BitSet128 *)&DAT_00c34750); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if (*(int *)&this->field_0x4a8 < 1) { Vector::FromAngle(&local_dc0,(float)local_8c4); local_8b4 = (EntityPtr)0x0; local_898 = (EntityPtr)&DAT_bf800000; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); in_stack_ffffd9fc = (Vector *)0x66bfad; EntityList::QueryRadius(entityList,&local_d18,&this->_pos,140.0,8); local_14 = 1; local_89c = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { pEVar20 = (EntityPtr *)std::vector::operator_index(); local_888 = *pEVar20; bVar5 = Entity::IsVulnerableEnemy((Entity *)local_888,(Entity *)0x0); if (bVar5 != 0) { bVar5 = Entity::HasEntityFlags((Entity *)local_888,0x20000010); if (bVar5 == 0) { if (this->_entityGridCollisionClass == 4) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar10 = Entity::Position((Entity *)local_888,&local_f68); in_stack_ffffd9fc = (Vector *)0x0; bVar5 = Room::CheckLine(room,&this->_pos,pVVar10,3,0,0,0,(Vector *)0x0); if (bVar5 == 0) goto LAB_0066c0c5; } pVVar10 = Entity::Position((Entity *)local_888,&local_f70); pVVar10 = Vector::__sub(pVVar10,&local_f78,&this->_pos); pVVar10 = Vector::Normalized(pVVar10,&local_f80); local_87c = (EntityPtr)Vector::Dot(pVVar10,&local_dc0); if ((float)local_898 < (float)local_87c) { local_8b4 = local_888; local_898 = local_87c; } } } LAB_0066c0c5: local_89c = (EntityPtr)((int)local_89c + 1); EVar15 = (EntityPtr)EntityList::Size(); } while ((uint)local_89c < (uint)EVar15); if ((0.85 < (float)local_898) && (local_8b4 != (EntityPtr)0x0)) { *(undefined4 *)&this->field_0x4a8 = 8; pVVar10 = Entity::Position((Entity *)local_8b4,&local_f88); pVVar10 = Vector::__sub(pVVar10,&local_f90,&this->_pos); Vector::Normalized(pVVar10,&local_b84); bVar5 = 1; uVar34 = local_88c._0_1_; uVar35 = local_88c._1_1_; uVar36 = local_88c._2_2_; pVVar10 = &this->_posOffset; in_stack_ffffd9fc = (Vector *)0x3; fVar25 = Vector::GetAngleDegrees(&local_b84); EVar15 = (EntityPtr) Entity_Laser::ShootAngle (2,&this->_pos,fVar25,(int)in_stack_ffffd9fc,pVVar10, (Entity *)CONCAT22(uVar36,CONCAT11(uVar35,uVar34)),bVar5); local_888 = EVar15; if (EVar15 != (EntityPtr)0x0) { Entity_Laser::SetOneHit((Entity_Laser *)EVar15); FUN_00435f70(); pBVar7 = BitSet128::operator_or (&local_1968,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40) ; pBVar7 = BitSet128::__bnot(pBVar7,&local_1978); pBVar7 = BitSet128::operator_and(&local_1988,&this->_tearFlags,pBVar7); in_stack_ffffd9fc = *(Vector **)&pBVar7->_l; FUN_00456830(); local_a78 = 1; local_a74 = (EntityPtr)(int)(20.0 - (float)local_8c0); local_87c = local_a74; piVar13 = (int *)std::max(); iVar8 = Isaac::Random(*piVar13); if (iVar8 != 0) { pBVar9 = (BitSet128 *)&DAT_00c34630; pBVar7 = BitSet128::operator_or (&local_1998,(BitSet128 *)&DAT_00c34930, (BitSet128 *)&DAT_00c34a50); pBVar7 = BitSet128::operator_or(&local_19a8,pBVar7,pBVar9); pBVar7 = BitSet128::__bnot(pBVar7,&local_19b8); pBVar9 = TearFlags((Entity_Tear *)local_888,&local_19c8); pBVar7 = BitSet128::operator_and(&local_19d8,pBVar9,pBVar7); EVar15 = local_888; in_stack_ffffd9fc = *(Vector **)&pBVar7->_l; FUN_00456830(); } local_a7c = local_87c; local_a80 = 1; piVar13 = (int *)std::max(); iVar8 = Isaac::Random(*piVar13); if (iVar8 != 0) { pBVar7 = BitSet128::operator_or (&local_19e8,(BitSet128 *)&DAT_00c345b0, (BitSet128 *)&DAT_00c345c0); pBVar7 = BitSet128::__bnot(pBVar7,&local_19f8); pBVar9 = TearFlags((Entity_Tear *)local_888,&local_1a08); pBVar7 = BitSet128::operator_and(&local_1a18,pBVar9,pBVar7); EVar15 = local_888; in_stack_ffffd9fc = *(Vector **)&pBVar7->_l; FUN_00456830(); } (**(code **)(*(int *)EVar15 + 0x40))(); if ((local_b84.y < -0.5) || (local_b84.x < -0.5)) { uVar34 = 0; uVar36 = 0xc120; } else { uVar34 = 0x80; uVar36 = 0x453b; } set_field_358((void *)EVar15,(float)((uint)CONCAT21(uVar36,uVar34) << 8)); if (local_88c != (EntityPtr)0x0) { Entity_Player::get_laser_color_copy ((Entity_Player *)local_88c,(ColorMod *)local_1d8); Sprite::Color((Sprite *)&this->_sprite); fVar24 = (float10)Color::A(); Font::SetLineHeightModifier((Font *)local_1d8,(float)fVar24); in_stack_ffffd9fc = (Vector *)0xff; (**(code **)(*(int *)EVar15 + 0x3c))(); } Entity_Laser::SetMaxDistance((Entity_Laser *)EVar15,140.0); Entity_Laser::set_scale(); (**(code **)(*(int *)EVar15 + 0xc))(); } } } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_d18); } else { *(int *)&this->field_0x4a8 = *(int *)&this->field_0x4a8 + -1; } } fVar25 = Math::clamp((float)local_894,2.0,this->_updateTime / 10.0); fVar25 = pow((float)local_8a8 - fVar25,2.0); this->_friction = fVar25 * 0.1 + 0.9; local_a84 = this->_updateTime / 45.0; local_a88 = 0x3f800000; pEVar20 = (EntityPtr *)std::min(); local_898 = *pEVar20; auVar29 = ZEXT416((uint)local_898); bVar5 = Entity::IsFrame((Entity *)this,8,this->_index); if ((bVar5 != 0) && (this->_stickTarget == (void *)0x0)) { std::vector::clear(&this->_hitList,0); } if ((this->_target == (EntityPtr)0x0) && (bVar5 = Entity::IsFrame((Entity *)this,4,this->_index), bVar5 != 0)) { auVar29._0_12_ = ZEXT812(0x4e6e6b28); auVar29._12_4_ = 0; local_888 = (EntityPtr)0x0; local_8c0 = auVar29._0_4_; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); local_b44 = 5.0; pVVar10 = Vector::operator_mul(&local_f98,&local_b44,&this->_velocity); pVVar10 = Vector::__add(&this->_pos,&local_fa0,pVVar10); in_stack_ffffd9fc = (Vector *)0x66c558; EntityList::QueryRadius(entityList,&local_d28,pVVar10,128.0,8); local_14 = 2; local_8b4 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { pEVar20 = (EntityPtr *)std::vector::operator_index(); EVar15 = *pEVar20; local_89c = EVar15; bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar15,(Entity *)0x0); if (bVar5 != 0) { if (this->_spawnerEntity != (EntityPtr)0x0) { bVar5 = Entity::IsDescendantOf((Entity *)this->_spawnerEntity,(Entity *)EVar15); if (bVar5 != 0) goto LAB_0066c6d8; } bVar5 = Entity::HasEntityFlags((Entity *)EVar15,0x20000010); if (bVar5 == 0) { iVar8 = Isaac::Random(2); if (iVar8 != 0) { if (this->_entityGridCollisionClass == 4) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar10 = Entity::Position((Entity *)local_89c,&local_fa8); in_stack_ffffd9fc = (Vector *)0x0; bVar5 = Room::CheckLine(room,&this->_pos,pVVar10,3,0,0,0,(Vector *)0x0); if (bVar5 == 0) goto LAB_0066c6d8; } local_a8c = 5.0; pVVar10 = Vector::operator_mul(&local_fb0,&local_a8c,&this->_velocity); pVVar10 = Vector::__add(&this->_pos,&local_fb8,pVVar10); pVVar16 = Entity::Position((Entity *)local_89c,&local_fc0); local_8ac = (EntityPtr)Vector::Distance(pVVar10,pVVar16); fVar25 = random_float(); local_87c = (EntityPtr)(fVar25 * 128.0 + (float)local_8ac); auVar29 = ZEXT416((uint)local_87c); if ((float)local_87c < (float)local_8c0) { local_888 = local_89c; local_8c0 = local_87c; } } } } LAB_0066c6d8: EVar26 = (EntityPtr)((int)local_8b4 + 1); local_8b4 = EVar26; EVar15 = (EntityPtr)EntityList::Size(); } while ((uint)EVar26 < (uint)EVar15); } Entity::SetTarget((Entity *)this,(Entity *)local_888); local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_d28); } if (this->_target != (EntityPtr)0x0) { pVVar10 = Entity::Position((Entity *)this->_target,&local_fc8); Vector::__sub(&this->_pos,&local_934,pVVar10); pVVar16 = &this->_velocity; local_8ac = (EntityPtr)pVVar16; pVVar10 = Vector::Normalized(&local_934,&local_fd0); local_87c = (EntityPtr)Vector::Dot(pVVar16,pVVar10); local_c44 = ((float)local_87c * 0.1 + 1.35) * (float)local_898; pVVar10 = Vector::Normalized(pVVar16,&local_fd8); pVVar16 = Vector::Normalized(&local_934,&local_fe0); fVar25 = Vector::Length(&local_934); local_a94 = 0; local_a90 = 0.08 - fVar25 * 0.0005; fVar25 = Vector::Dot(pVVar10,pVVar16); local_87c = (EntityPtr)(0.92 - fVar25 * 0.05); pfVar17 = (float *)std::max(); local_a98 = (float)local_87c + *pfVar17; local_a9c = 0x3f7ae148; pfVar17 = (float *)std::min(); local_87c = (EntityPtr)*pfVar17; pVVar10 = Vector::Normalized(&local_934,&local_fe8); EVar15 = local_8d0; pVVar10 = Vector::operator_mul(&local_ff0,(float *)local_8d0,pVVar10); pVVar10 = Vector::__mul(pVVar10,&local_ff8,&local_c44); EVar26 = local_8ac; Vector::operator__((Vector *)local_8ac,pVVar10); local_c40 = Math::timescale_factor((float)local_87c,*(float *)EVar15); Vector::operator_mul_assign((Vector *)EVar26,&local_c40); local_89c = (EntityPtr)0x40000000; pBVar7 = BitSet128::operator_and(&local_1a28,tearFlagsPtr,&g_tearFlagHoming); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { local_89c = (EntityPtr)0x41400000; } local_89c = (EntityPtr)((float)local_89c * *(float *)EVar15); pVVar10 = Vector::__unm(&local_934,&local_1000); local_87c = (EntityPtr)Vector::GetAngleDegrees(pVVar10); local_8ac = (EntityPtr)Vector::GetAngleDegrees((Vector *)EVar26); auVar29._0_4_ = (EntityPtr)approach_angle((float)local_8ac,(float)local_87c,(float)local_89c); auVar29._4_12_ = extraout_var_12; pVVar10 = Vector::FromAngle(&local_1008,(float)auVar29._0_4_); local_c3c = (void *)Vector::Length((Vector *)EVar26); pVVar10 = Vector::operator_mul(&local_1010,(float *)&local_c3c,pVVar10); Vector::operator_assign((Vector *)EVar26,pVVar10); if ((local_8a1 != '\0') && (bVar5 = Vector::operator_ne(&local_934,&g_vectorZero), bVar5 != 0) ) { animState = (AnimationState *)Config::GetPillEffects(); iVar8 = AnimationState::GetAnimationLength(animState); fVar25 = (float)iVar8; local_8c0 = (EntityPtr)(360.0 / fVar25); _empty_check_0x34(); pVVar10 = Vector::FromAngle(&local_1018,fVar25 * (float)local_8c0); local_c38 = *(float *)local_8d0 * (float)local_8fc; in_stack_ffffd9fc = (Vector *)0x66ca43; pVVar16 = Vector::operator_mul(&local_1020,&local_c38,&local_934); local_c34 = Vector::LengthSquared(&local_934); pVVar16 = Vector::__div(pVVar16,&local_1028,&local_c34); Vector::__add(pVVar10,&local_dc8,pVVar16); local_87c = (EntityPtr)Vector::GetAngleDegrees(&local_dc8); fVar25 = normalize_angle_degrees((float)local_87c); if (fVar25 < (float)local_894) { fVar25 = fVar25 + 360.0; } auVar29._0_4_ = (EntityPtr)(fVar25 / (float)local_8c0); auVar29._4_12_ = extraout_var_13; FUN_0040a740(); } } } LAB_0066d04f: pBVar7 = tearFlagsPtr; pBVar9 = BitSet128::operator_and(&local_1a68,tearFlagsPtr,(BitSet128 *)&DAT_00c34b70); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 == 0) { LAB_0066d2f2: EVar15 = (EntityPtr)tear; } else { pBVar9 = BitSet128::operator_and(&local_1a78,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar9); if (bVar5 == 0) goto LAB_0066d2f2; pBVar9 = BitSet128::operator_and(&local_1a88,pBVar7,(BitSet128 *)&DAT_00c34780); bVar5 = BitSet128::IsZero(pBVar9); EVar15 = local_8d8; if ((bVar5 == 0) || (local_8d8 == (EntityPtr)0x0)) goto LAB_0066d2f2; Entity_Player::ControllerIndex((Entity_Player *)local_8d8); local_91c.x = g_vectorZero.x; local_91c.y = g_vectorZero.y; EVar26 = (EntityPtr)g_vectorZero.y; iVar8 = FUN_007826c0(); if (iVar8 == 0) { pVVar10 = (Vector *)FUN_005cd7e0(); Vector::operator_assign(&local_91c,pVVar10); Entity_Player::GetMouseAimTarget((Entity_Player *)EVar15,&local_91c,0); } else { familiar = (Entity *)FUN_007826c0(); pVVar10 = Entity::Position(familiar,&local_1098); pVVar10 = Vector::__sub(pVVar10,&local_10a0,(Vector *)local_8e8); local_c1c = 10.0; pVVar10 = Vector::__div(pVVar10,&local_10a8,&local_c1c); Vector::operator_assign(&local_91c,pVVar10); EVar26 = (EntityPtr)Vector::Length(&local_91c); local_87c = EVar26; if ((float)local_8a8 < (float)EVar26) { Vector::Normalize(&local_91c); } } FUN_00436190(); local_914 = (float)EVar26 * (float)local_890; bVar5 = Entity_Player::HasWeaponType((Entity_Player *)EVar15,8); if (bVar5 == 0) { pBVar9 = BitSet128::operator_and(&local_1a98,pBVar7,(BitSet128 *)&DAT_00c34860); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { local_914 = local_914 * (float)local_8b8; } } else { local_914 = local_914 * local_900; } auVar29 = ZEXT416((uint)local_91c.x); if ((local_91c.x == (float)local_894) && (auVar29 = ZEXT416((uint)local_91c.y), local_91c.y == (float)local_894)) { pBVar9 = BitSet128::operator_and(&local_1aa8,pBVar7,(BitSet128 *)&DAT_00c34860); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 == 0) { pBVar9 = BitSet128::operator_and(&local_1ab8,pBVar7,&g_tearFlagHoming); bVar5 = BitSet128::IsNonZero(pBVar9); EVar15 = (EntityPtr)tear; if (bVar5 == 0) goto LAB_0066d2e6; tear->_friction = 0.9; } else { tear->_friction = 1.0; EVar15 = (EntityPtr)tear; } } else { Vector::Normalize(&local_91c); pVVar10 = Vector::__mul(&local_91c,local_10b8,&local_914); EVar15 = (EntityPtr)tear; Vector::operator_add_assign(&tear->_velocity,pVVar10); LAB_0066d2e6: *(float *)((int)EVar15 + 0x36c) = 0.8; } } pBVar9 = BitSet128::operator_and(&local_1ac8,pBVar7,(BitSet128 *)&DAT_00c34b30); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and(&local_1ad8,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { if (*(int *)((int)EVar15 + 0x438) < 1) { fVar25 = Vector::Length((Vector *)((int)EVar15 + 0x7ec)); local_87c = (EntityPtr)(fVar25 * 0.014); *(float *)((int)EVar15 + 0x388) = (float)local_87c + *(float *)((int)EVar15 + 0x388); fVar25 = *(float *)((int)EVar15 + 0x424) + 0.01; auVar29 = ZEXT416((uint)fVar25); *(float *)((int)EVar15 + 0x424) = fVar25; } } else { cVar6 = is_not_familiar_spawned((Entity_Tear *)EVar15); if (cVar6 != '\0') { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_10c0); local_87c = (EntityPtr)Vector::Distance(pVVar10,(Vector *)((int)EVar15 + 0x33c)); fVar25 = Math::clamp((float)local_8a8,700.0,(float)local_87c); auVar29._0_4_ = (EntityPtr)(fVar25 / 700.0 + (float)local_8a8); auVar29._4_12_ = extraout_var_15; *(float *)((int)EVar15 + 0x388) = (float)auVar29._0_4_ * (float)*(void **)((int)EVar15 + 0x454); local_8dc = auVar29._0_4_; } } } pBVar7 = BitSet128::operator_and (&local_1ae8,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34c40); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and (&local_1af8,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { if (*(int *)((int)EVar15 + 0x438) < 1) { auVar29 = ZEXT416((uint)*(float *)((int)EVar15 + 0x3a4)); if (4.0 < *(float *)((int)EVar15 + 0x3a4)) { pBVar7 = BitSet128::operator_and (&local_1b08,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34780); bVar5 = BitSet128::IsNonZero(pBVar7); pvVar1 = *(void **)((int)EVar15 + 0x454); fVar25 = *(float *)((int)EVar15 + 0x388); if (bVar5 == 0) { if ((float)pvVar1 / (float)local_890 < fVar25) { decayFactor = 0.08; } else { decayFactor = 0.03; } local_c0c = 0x3dcccccd; local_c10 = fVar25 - decayFactor * (float)pvVar1; } else { if ((float)pvVar1 / (float)local_890 < fVar25) { decayFactor = 0.022; } else { decayFactor = 0.006; } local_c14 = 0x3dcccccd; local_c18 = fVar25 - decayFactor * (float)pvVar1; } pfVar17 = (float *)std::max(); fVar25 = *pfVar17; *(float *)((int)EVar15 + 0x388) = fVar25; EVar26 = (EntityPtr)(fVar25 / (float)*(void **)((int)EVar15 + 0x454)); FUN_00431260(); auVar29._0_12_ = ZEXT812(0x3dcccccd); auVar29._12_4_ = 0; local_8dc = EVar26; if (*(float *)((int)EVar15 + 0x388) <= auVar29._0_4_) { *(byte *)((int)EVar15 + 0x173) = 1; *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 0x10) ; } } } } else { cVar6 = is_not_familiar_spawned((Entity_Tear *)EVar15); if (cVar6 != '\0') { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_10c8); local_87c = (EntityPtr)Vector::Distance(pVVar10,(Vector *)((int)EVar15 + 0x33c)); fVar25 = Math::clamp((float)local_894,900.0,(float)local_87c); fVar25 = (float)local_8a8 - fVar25 / 900.0; local_8dc = (EntityPtr)(fVar25 * (float)local_8dc); auVar29 = ZEXT416((uint)local_8dc); *(float *)((int)EVar15 + 0x388) = fVar25 * (float)*(void **)((int)EVar15 + 0x454); } } } pBVar7 = BitSet128::operator_and (&local_1b18,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagSpectral); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if ((*(int *)((int)EVar15 + 0x2c) == 4) || (*(int *)((int)EVar15 + 0x2c) == 9)) { iVar8 = 3; } else { iVar8 = 0; } *(int *)((int)EVar15 + 0x184) = iVar8; pBVar7 = BitSet128::operator_and (&local_1b28,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { if (*(char *)((int)EVar15 + 0x46b) == '\0') { cVar6 = try_make_bridges(); if (cVar6 != '\0') { UpdateBoneTear((Entity_Tear *)EVar15,(Entity *)0x0); *(undefined1 *)((int)EVar15 + 0x46b) = 1; } } else { iVar8 = Isaac::Random(8); if (iVar8 == 0) { try_make_bridges(); } } } } pBVar7 = BitSet128::operator_and (&local_1b38,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34860); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0)) { pBVar9 = (BitSet128 *)&DAT_00c34600; pBVar7 = BitSet128::operator_or(&local_1b48,&g_tearFlagLudovico,(BitSet128 *)&DAT_00c34b60); pBVar7 = BitSet128::operator_or(&local_1b58,pBVar7,pBVar9); pBVar7 = BitSet128::operator_and(&local_1b68,(BitSet128 *)((int)EVar15 + 0x428),pBVar7); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_10d0); pVVar16 = Vector::Vector(&local_10d8,(float)local_894,2.0); pVVar10 = Vector::__add(pVVar10,&local_10e0,pVVar16); Vector::__sub((Vector *)((int)EVar15 + 0x33c),&local_ca8,pVVar10); bVar5 = Vector::operator_ne((Vector *)((int)EVar15 + 0x334),&g_vectorZero); if (bVar5 != 0) { pVVar10 = Vector::Vector(&local_10e8,(float)local_894,2.0); pVVar10 = Vector::__sub((Vector *)((int)EVar15 + 0x334),&local_10f0,pVVar10); pVVar10 = Vector::__sub((Vector *)((int)EVar15 + 0x33c),&local_10f8,pVVar10); Vector::operator_assign(&local_ca8,pVVar10); } local_87c = (EntityPtr)GetRootPlayer((Entity_Tear *)EVar15); local_c04 = 0x41a00000; local_c08 = (*(float *)((int)EVar15 + 0x820) - 60.0) * (float)local_8b8; auVar29 = ZEXT416((uint)local_c08); puVar14 = (undefined4 *)std::max(); local_8ac = (EntityPtr)*puVar14; if (local_87c == (EntityPtr)0x0) { auVar29 = ZEXT416((uint)local_8a8); } else { FUN_00436190(); } fVar25 = auVar29._0_4_ * 10.0; auVar29._0_4_ = (EntityPtr)((fVar25 * fVar25) / ((float)local_8ac + (float)local_8ac)); local_c00 = (float)auVar29._0_4_; pVVar10 = Vector::Normalized(&local_ca8,&local_1100); pVVar10 = Vector::__mul(pVVar10,&local_1108,&local_c00); Vector::operator__((Vector *)((int)EVar15 + 0x360),pVVar10); } } pBVar7 = BitSet128::operator_and (&local_1b78,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34870); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if (local_8d8 != (EntityPtr)0x0) { auVar29._0_4_ = (EntityPtr)get_tear_trinket_multiplier((Entity_Player *)local_8d8,10); auVar29._4_12_ = extraout_var_16; local_bf8 = 0x3f800000; local_bfc = (float)auVar29._0_4_; std::max(); } apply_wiggle((Entity_Tear *)EVar15); } pBVar7 = BitSet128::operator_and (&local_1b88,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c348a0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if (local_8d8 != (EntityPtr)0x0) { auVar29._0_4_ = (EntityPtr)get_tear_trinket_multiplier((Entity_Player *)local_8d8,0x1a); auVar29._4_12_ = extraout_var_17; local_bf0._0_4_ = 0x3f800000; local_bf4 = (float)auVar29._0_4_; std::max(); } apply_wiggle((Entity_Tear *)EVar15); } pBVar7 = BitSet128::operator_and (&local_1b98,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c348e0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if (local_8d8 != (EntityPtr)0x0) { auVar29._0_4_ = (EntityPtr)get_tear_trinket_multiplier((Entity_Player *)local_8d8,0x2e); auVar29._4_12_ = extraout_var_18; local_bf0._capacity = 0x3f800000; local_bf0._data = (void *)auVar29._0_4_; std::max(); } update_wiggle((Entity_Tear *)EVar15); } pBVar7 = BitSet128::operator_and (&local_1ba8,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34b20); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { auVar29._0_4_ = (EntityPtr) Math::clamp((float)local_894,(float)local_8a8, (*(float *)((int)EVar15 + 0x3a4) - 10.0) / 10.0); auVar29._4_12_ = extraout_var_19; local_87c = *(EntityPtr *)((int)EVar15 + 0x478); local_8d0 = (EntityPtr)((float)auVar29._0_4_ * 20.0 * (float)auVar29._0_4_); if (local_87c != (EntityPtr)0x0) { auVar29._0_12_ = ZEXT812(0x41000000); auVar29._12_4_ = 0; local_8d0 = auVar29._0_4_; } local_bf0._size = 0x40800000; pVVar10 = Vector::operator_mul (&local_1110,(float *)&local_bf0._size,(Vector *)((int)EVar15 + 0x360)); pVVar10 = Vector::__add((Vector *)((int)EVar15 + 0x33c),&local_1118,pVVar10); in_stack_ffffd9fc = (Vector *)0x66dae1; Game::AttractEntities(g_game,pVVar10,FUN_005cd950,(void *)local_87c,(float)local_8d0,250.0); } pBVar7 = (BitSet128 *)((int)EVar15 + 0x428); pBVar9 = BitSet128::operator_and(&local_1bb8,pBVar7,(BitSet128 *)&DAT_00c34890); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { if (local_8d8 == (EntityPtr)0x0) { local_8d0 = local_8a8; } else { local_ba0 = get_tear_trinket_multiplier((Entity_Player *)local_8d8,0x19); local_be0 = 0x3f800000; pEVar20 = (EntityPtr *)std::max(); local_8d0 = *pEVar20; } local_8d0 = (EntityPtr)((float)local_8d0 * (float)local_8d4); auVar29 = ZEXT416((uint)local_8d0); pBVar9 = BitSet128::operator_and(&local_1bc8,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 == 0) { iVar8 = Entity::FrameCount((Entity *)EVar15); fVar25 = sinf_wrapper((float)iVar8 * 0.7); auVar29._0_4_ = (EntityPtr)((fVar25 + 0.7) * (float)local_8d0 + local_8f0); auVar29._4_12_ = extraout_var_21; local_8dc = (EntityPtr)((float)local_8dc * (float)auVar29._0_4_); } else if ((*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) && (iVar8 = Entity::Type(), iVar8 == 1)) { iVar8 = Entity::FrameCount((Entity *)EVar15); fVar25 = sinf_wrapper((float)iVar8 * 0.2); auVar29._0_4_ = (EntityPtr)((fVar25 + 0.2) * (float)local_8d0 + 1.1); auVar29._4_12_ = extraout_var_20; local_8dc = (EntityPtr)((float)local_8dc * (float)auVar29._0_4_); } } local_8b4 = local_8dc; pBVar9 = BitSet128::operator_and(&local_1bd8,pBVar7,(BitSet128 *)&DAT_00c34930); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 == 0) { pBVar9 = BitSet128::operator_and(&local_1be8,pBVar7,(BitSet128 *)&DAT_00c34630); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) goto LAB_0066dc7d; } else { LAB_0066dc7d: if ((*(void **)((int)EVar15 + 0x478) != (void *)0x0) && (0 < *(int *)((int)EVar15 + 0x484))) { fVar25 = (float)local_8a8 - (float)*(int *)((int)EVar15 + 0x484) / 60.0; local_8dc = (EntityPtr)((float)local_8dc + fVar25 + fVar25); auVar29 = ZEXT416((uint)local_8dc); } } local_8a0 = (EntityPtr)((int)EVar15 + 0x48); Sprite::SetRotation((Sprite *)local_8a0,0.0); local_87c = (EntityPtr)((int)EVar15 + 0x5c0); local_8b9 = '\0'; cVar6 = Sprite::IsLoaded((Sprite *)local_87c); if (cVar6 == '\0') { LAB_0066dd14: local_8a1 = '\0'; } else { cVar6 = _has_flag_0x110(); local_8a1 = '\x01'; if (cVar6 == '\0') goto LAB_0066dd14; } pBVar9 = BitSet128::operator_and(&local_1bf8,pBVar7,(BitSet128 *)&DAT_00c348b0); bVar5 = BitSet128::IsNonZero(pBVar9); if ((bVar5 != 0) && (iVar8 = *(int *)((int)EVar15 + 0x2c), iVar8 != 4)) { if (local_8d8 == (EntityPtr)0x0) { EVar26 = local_8a8; } else { local_bdc = get_tear_trinket_multiplier((Entity_Player *)local_8d8,0x1b); local_bd8 = 0x3f800000; pEVar20 = (EntityPtr *)std::max(); iVar8 = *(int *)((int)EVar15 + 0x2c); EVar26 = *pEVar20; } fVar25 = (float)EVar26 * (float)local_8b8 + (float)local_8a8; auVar29 = ZEXT416((uint)fVar25); if (iVar8 == 0x32) { pVVar10 = Vector::Vector(&local_1120,fVar25,(float)local_8a8); Vector::operator_assign((Vector *)((int)EVar15 + 0x374),pVVar10); } else { pVVar10 = Vector::Vector(&local_1128,(float)local_8a8,fVar25); Vector::operator_assign((Vector *)((int)EVar15 + 0x374),pVVar10); local_8b9 = '\x01'; } } if (((*(int *)((int)EVar15 + 0x2c) == 0xd) || (*(int *)((int)EVar15 + 0x2c) == 0x17)) && (bVar5 = Game::IsInTimedSet(g_game,0x4f), bVar5 != 0)) { ((Vector *)((int)EVar15 + 0x374))->x = 3.0; } iVar8 = *(int *)((int)EVar15 + 0x2c); if ((iVar8 == 0xe) || (iVar8 == 0xf)) { pBVar7 = BitSet128::operator_and(&local_1c08,pBVar7,(BitSet128 *)&DAT_00c34860); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { iVar8 = *(int *)((int)EVar15 + 0x2c); goto LAB_0066de6b; } fVar25 = *(float *)((int)EVar15 + 0x3a4) * 45.0; auVar29 = ZEXT416((uint)fVar25); Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),fVar25); local_8b9 = '\0'; } else { LAB_0066de6b: if (((((iVar8 == 0xb) || (iVar8 == 0xc)) || ((iVar8 == 0xd || (((iVar8 == 0xe || (iVar8 == 0xf)) || (iVar8 == 0x17)))))) || ((iVar8 == 0x1f || (iVar8 == 0x21)))) || ((iVar8 == 0x22 || (((iVar8 == 0x14 || (iVar8 == 0x27)) || ((iVar8 == 0x29 || ((((iVar8 == 0x2b || (iVar8 == 0x2c)) || (iVar8 == 0x2d)) || ((iVar8 == 0x2f || (iVar8 == 0x31)))))))))))) { local_8b9 = '\x01'; } } if (*(int *)((int)EVar15 + 0x2c) == 0x32) { fVar25 = Vector::Length((Vector *)((int)EVar15 + 0x360)); local_8d0 = (EntityPtr)(fVar25 + fVar25); if (((Vector *)((int)EVar15 + 0x360))->x <= (float)local_894 && (float)local_894 != ((Vector *)((int)EVar15 + 0x360))->x) { local_8d0 = (EntityPtr)((float)local_8d0 * -1.0); } animState = (AnimationState *)Config::GetPillEffects(); iVar8 = AnimationState::GetAnimationLength(animState); fVar25 = (float)iVar8; local_8c0 = (EntityPtr)(360.0 / fVar25); _empty_check_0x34(); fVar25 = normalize_angle_degrees (fVar25 * (float)local_8c0 + (float)local_8d0 * *(float *)((int)EVar15 + 0x39c)); if (fVar25 < (float)local_894) { fVar25 = fVar25 + 360.0; } auVar29._0_4_ = (EntityPtr)(fVar25 / (float)local_8c0); auVar29._4_12_ = extraout_var_22; FUN_0040a740(); } if ((local_8b9 != '\0') || (local_8a1 != '\0')) { local_9c4.x = ((Vector *)((int)EVar15 + 0x360))->x; local_8ac = (EntityPtr)((int)EVar15 + 0x360); local_9c4.y = *(float *)((int)EVar15 + 0x364); if (*(int *)((int)EVar15 + 0x438) < 1) { fVar25 = ((Vector *)((int)EVar15 + 0x418))->x; auVar29 = ZEXT416((uint)fVar25); if (0.001 < fVar25) { LAB_0066e037: pVVar10 = Vector::Vector(&local_1130,(float)local_894,(float)local_8e0); Vector::operator_add_assign(&local_9c4,pVVar10); } else { pBVar7 = BitSet128::operator_and (&local_1c18,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and (&local_1c28,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) goto LAB_0066e037; } } } else { Vector::operator_assign(&local_9c4,(Vector *)((int)EVar15 + 0x43c)); } local_89c = (EntityPtr)Vector::GetAngleDegrees(&local_9c4); if (local_8b9 != '\0') { auVar29 = ZEXT416((uint)local_89c); Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),(float)local_89c); } if (local_8a1 != '\0') { layerIndex = (byte *)0x0; iVar8 = Sprite::GetLayerCount((Sprite *)((int)EVar15 + 0x5c0)); EVar26 = local_87c; if (iVar8 != 0) { do { layer = Sprite::GetLayer((Sprite *)EVar26,layerIndex); if ((layer->_bitflags & 0x1000U) != 0) { auVar29 = ZEXT416((uint)local_89c); layer->_rotation = (float)local_89c; } layerIndex = layerIndex + 1; layerCount = (byte *)Sprite::GetLayerCount((Sprite *)EVar26); } while (layerIndex < layerCount); EVar15 = (EntityPtr)tear; } } if (*(int *)((int)EVar15 + 0x2c) == 0x17) { seeds = (Seeds *)Game::GetSeeds(g_game); bVar5 = Seeds::HasSeedEffect(seeds,0x4f); if (((bVar5 != 0) && (iVar8 = Entity::GetIntervalTicks((Entity *)EVar15,2.0,(float)local_894), iVar8 != 0)) && (*(byte *)((int)EVar15 + 0x171) != 0)) { uVar11 = Random(); local_bd4 = 0.14; pVVar10 = Vector::__mul((Vector *)local_8ac,&local_1138,&local_bd4); pVVar16 = Vector::FromAngle(&local_1140,(float)local_89c); local_bd0 = 5.0; pVVar16 = Vector::operator_mul(&local_1148,&local_bd0,pVVar16); pVVar16 = Vector::__mul(pVVar16,&local_1150,&tear->_fScale); pVVar16 = Vector::__sub((Vector *)local_8e8,&local_1158,pVVar16); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x3b,pVVar16,pVVar10,(Entity *)0x0,0,uVar11); pcVar2 = *(code **)(*(int *)effect + 0x3c); Color::Color(); in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); fVar25 = random_float(); Entity_Effect::set_rotation(effect,fVar25 * 10.0 + 2.0); iVar8 = Isaac::Random(0xf); Entity_Effect::SetTimeout(effect,iVar8 + 0xf); EVar15 = (EntityPtr)tear; local_bcc = tear->_fScale * local_900; auVar29 = ZEXT416((uint)local_bcc); pVVar10 = Vector::operator_mul(&local_1160,&local_bcc,&g_vectorOne); Entity::SetSpriteScale((Entity *)effect,pVVar10); set_field_358(effect,-18.0); Entity::SetPositionOffset((Entity *)effect,&((Entity_Tear *)EVar15)->_posOffset); } } } iVar8 = *(int *)((int)EVar15 + 0x2c); if ((((iVar8 == 0x23) || (iVar8 == 0x25)) || (iVar8 == 0x26)) && (bVar5 = Entity::IsFrame((Entity *)EVar15,2,0), bVar5 != 0)) { if (*(int *)((int)EVar15 + 0x2c) == 0x26) { local_87c = (EntityPtr)Random(); local_bc8 = 0.3; pVVar10 = Vector::__mul((Vector *)((int)EVar15 + 0x360),&local_1168,&local_bc8); pVVar16 = MusicManager::RandomVector(&local_1170); local_bc4 = random_float(); pVVar16 = Vector::__mul(pVVar16,&local_1178,&local_bc4); local_bc0 = 3.0; pVVar16 = Vector::__mul(pVVar16,&local_1180,&local_bc0); pfVar17 = &tear->_fScale; pVVar16 = Vector::__mul(pVVar16,&local_1188,pfVar17); in_stack_ffffd9fc = Vector::__add(pVVar10,&local_1190,pVVar16); local_89c = (EntityPtr) Game::Spawn(g_game,1000,0x58,(Vector *)local_8e8,in_stack_ffffd9fc,(Entity *)0x0,0 ,(uint)local_87c); sprite = (Sprite *)Entity::GetSprite((Entity *)local_89c); pVVar10 = Vector::__mul(&g_vectorOne,&local_1198,pfVar17); local_bbc = 0.8; pVVar16 = Vector::__mul(pVVar10,&local_11a0,&local_bbc); fVar25 = random_float(); pfVar17 = &local_bb4; pVVar10 = &local_11a8; auVar29._0_4_ = (EntityPtr)(fVar25 * local_8f0 + local_8f0); auVar29._4_12_ = extraout_var_23; local_bb4 = (float)auVar29._0_4_; } else { local_87c = (EntityPtr)Random(); local_bb0 = 0.3; pVVar10 = Vector::__mul((Vector *)((int)EVar15 + 0x360),&local_11b0,&local_bb0); pVVar16 = MusicManager::RandomVector(&local_11b8); local_bac = random_float(); pVVar16 = Vector::__mul(pVVar16,&local_11c0,&local_bac); local_ba8 = 3.0; pVVar16 = Vector::__mul(pVVar16,&local_11c8,&local_ba8); pVVar16 = Vector::__mul(pVVar16,&local_11d0,&tear->_fScale); in_stack_ffffd9fc = Vector::__add(pVVar10,&local_11d8,pVVar16); EVar15 = (EntityPtr) Game::Spawn(g_game,1000,0x6f,(Vector *)local_8e8,in_stack_ffffd9fc,(Entity *)0x0,0, (uint)local_87c); local_89c = EVar15; pAVar21 = (ANM2 *)Entity::GetSprite((Entity *)EVar15); fVar25 = random_float(); set_PlaybackSpeed(pAVar21,fVar25 * local_8f0 + (float)local_8b8); sprite = (Sprite *)Entity::GetSprite((Entity *)EVar15); pVVar10 = Vector::__mul(&g_vectorOne,&local_11e0,&tear->_fScale); local_ba4 = 0.5; pVVar16 = Vector::__mul(pVVar10,&local_11e8,&local_ba4); fVar25 = random_float(); pfVar17 = &local_b98; pVVar10 = &local_11f0; auVar29._0_4_ = (EntityPtr)(fVar25 * local_8f0 + local_8f0); auVar29._4_12_ = extraout_var_24; local_b98 = (float)auVar29._0_4_; } pVVar10 = Vector::__mul(pVVar16,pVVar10,pfVar17); Sprite::SetScale(sprite,pVVar10); EVar15 = (EntityPtr)tear; EVar26 = local_89c; Entity::SetPositionOffset((Entity *)local_89c,&tear->_posOffset); FUN_00440e90(); sprite = (Sprite *)Entity::GetSprite((Entity *)EVar26); color = (ColorMod *)Sprite::Color((Sprite *)&((Entity_Tear *)EVar15)->_sprite); Sprite::SetColor(sprite,color); (**(code **)(*(int *)local_89c + 0xc))(); } pBVar7 = BitSet128::operator_and (&local_1c38,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34920); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); in_stack_ffffd9fc = (Vector *)0x66e65e; EntityList::QueryRadius (entityList,&local_d08,(Vector *)((int)EVar15 + 0x33c), *(float *)((int)EVar15 + 0x370) * (float)local_890 + 100.0,0xffffffff); local_14 = 5; local_888 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { pEVar20 = (EntityPtr *)std::vector::operator_index(); local_898 = *pEVar20; bVar5 = Entity::IsVulnerableEnemy((Entity *)local_898,(Entity *)0x0); if ((bVar5 != 0) && ((*(EntityPtr *)((int)EVar15 + 0x3c8) == (EntityPtr)0x0 || (bVar5 = Entity::IsDescendantOf ((Entity *)*(EntityPtr *)((int)EVar15 + 0x3c8),(Entity *)local_898), bVar5 == 0)))) { FUN_00417340(); fVar25 = auVar29._0_4_ + *(float *)((int)EVar15 + 0x370); local_89c = (EntityPtr)fVar25; FUN_00417340(); fVar25 = fVar25 + *(float *)((int)EVar15 + 0x370) * 4.0; local_89c = (EntityPtr)((float)local_89c * (float)local_89c); local_8ac = (EntityPtr)(fVar25 * fVar25); pVVar10 = Entity::Position((Entity *)local_898,&local_11f8); local_87c = (EntityPtr)Vector::DistanceSquared(pVVar10,(Vector *)((int)EVar15 + 0x33c)); auVar29 = ZEXT416((uint)local_8ac); if (((float)local_87c < (float)local_8ac) && ((float)local_89c < (float)local_87c)) { pcVar2 = *(code **)(*(int *)local_898 + 0x20); EntityRef::constructor(&local_2570,(Entity *)EVar15); in_stack_ffffd9fc = (Vector *)0x0; (*pcVar2)(); } } local_888 = (EntityPtr)((int)local_888 + 1); EVar26 = (EntityPtr)EntityList::Size(); } while ((uint)local_888 < (uint)EVar26); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_d08); } pBVar9 = (BitSet128 *)((int)EVar15 + 0x428); pBVar7 = BitSet128::operator_and(&local_1c48,pBVar9,(BitSet128 *)&DAT_00c34680); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pBVar32 = (BitSet128 *)&DAT_00c345b0; pBVar7 = BitSet128::operator_or(&local_1c58,(BitSet128 *)&DAT_00c345c0,&g_tearFlagLudovico); pBVar7 = BitSet128::operator_or(&local_1c68,pBVar7,pBVar32); pBVar7 = BitSet128::operator_and(&local_1c78,pBVar9,pBVar7); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { fVar25 = assert_lerp_range(*(float *)((int)EVar15 + 0x3a4),(float)local_894,10.0, (float)local_8a8,0.8,1); auVar29._0_4_ = (EntityPtr)(fVar25 * *(float *)((int)EVar15 + 0x36c)); auVar29._4_12_ = extraout_var_25; *(EntityPtr *)((int)EVar15 + 0x36c) = auVar29._0_4_; } } pBVar7 = BitSet128::operator_and(&local_1c88,pBVar9,(BitSet128 *)&DAT_00c34690); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pBVar32 = (BitSet128 *)&DAT_00c345b0; pBVar7 = BitSet128::operator_or(&local_1c98,(BitSet128 *)&DAT_00c345c0,&g_tearFlagLudovico); pBVar7 = BitSet128::operator_or(&local_1ca8,pBVar7,pBVar32); pBVar7 = BitSet128::operator_and(&local_1cb8,pBVar9,pBVar7); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { local_87c = (EntityPtr) assert_lerp_range(*(float *)((int)EVar15 + 0x3a4),(float)local_894,10.0,0.8,1.2,1) ; local_b2c = Vector::Length((Vector *)((int)EVar15 + 0x360)); local_b2c = local_b2c * (float)local_87c; local_b28 = 0x41f00000; pfVar17 = (float *)std::min(); auVar29 = ZEXT416((uint)*pfVar17); Vector::Resize((Vector *)((int)EVar15 + 0x360),*pfVar17); } } pBVar7 = (BitSet128 *)((int)EVar15 + 0x428); pBVar9 = BitSet128::operator_and(&local_1cc8,pBVar7,(BitSet128 *)&DAT_00c345c0); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { pBVar9 = BitSet128::operator_and(&local_1cd8,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar9); if (bVar5 != 0) { local_89c = (EntityPtr)GetRootPlayer((Entity_Tear *)EVar15); if (local_89c == (EntityPtr)0x0) { local_8d8 = (EntityPtr)0x40600000; local_888 = (EntityPtr)0x41200000; local_aac = local_8a8; } else { FUN_005cd770(); local_8b0 = auVar29._0_4_; FUN_0060d040(); local_8d8 = auVar29._0_4_; FUN_005cd750(); local_888 = auVar29._0_4_; FUN_00436190(); local_aac = auVar29._0_4_; } EVar27 = (EntityPtr)((float)local_888 / 10.0); local_b34 = 0x40400000; pow_wrapper(); EVar26 = local_8d8; local_87c = EVar27; FUN_00431260(); local_bb8 = (float)local_87c * (float)EVar26; local_b30 = 0x41200000; std::min(); pfVar17 = (float *)std::max(); local_940 = *pfVar17; auVar29 = ZEXT416((uint)local_8b0); Entity_Projectile::SetHeight((Entity_Projectile *)EVar15,(float)local_8b0); Entity_Projectile::set_falling_accel((Entity_Projectile *)EVar15,0.0); FUN_00444c70(); pBVar9 = BitSet128::operator_or (&local_1ce8,(BitSet128 *)&DAT_00c34b60,(BitSet128 *)&DAT_00c34600); pBVar9 = BitSet128::operator_and(&local_1cf8,pBVar7,pBVar9); bVar5 = BitSet128::IsZero(pBVar9); if (bVar5 != 0) { fVar25 = *(float *)((int)EVar15 + 0x36c) * 0.95; auVar29 = ZEXT416((uint)fVar25); *(float *)((int)EVar15 + 0x36c) = fVar25; } iVar8 = Entity::FrameCount((Entity *)EVar15); if (10 < iVar8) { if (local_940 <= ((Vector *)((int)EVar15 + 0x420))->x) { LAB_0066ebda: pBVar7 = (BitSet128 *)((int)EVar15 + 0x428); auVar29._0_4_ = (EntityPtr) Math::clamp((float)local_894,8.0,((Vector *)((int)EVar15 + 0x420))->x * 5.0); auVar29._4_12_ = extraout_var_26; local_890 = (EntityPtr)(int)(float)auVar29._0_4_; pBVar9 = BitSet128::operator_and(&local_1d08,pBVar7,(BitSet128 *)&DAT_00c34850); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { local_890 = (EntityPtr)((int)local_890 + 4); } pBVar9 = BitSet128::operator_and(&local_1d18,pBVar7,(BitSet128 *)&DAT_00c34880); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { auVar29 = ZEXT416((uint)((float)(int)local_890 * 1.5)); local_890 = (EntityPtr)(int)((float)(int)local_890 * 1.5); } if ((int)local_890 < 3) { BitSet128::__bnot((BitSet128 *)&DAT_00c345c0,&local_1d88); FUN_005cd430(); FUN_00444c70(); goto LAB_0066ef8a; } fVar25 = random_float(); local_8ac = (EntityPtr)(fVar25 * 360.0); local_8e0 = (Entity_Player *)((int)EVar15 + 0x410); local_8b0 = (EntityPtr)0x0; local_87c = (EntityPtr)(360.0 / (float)(int)local_890); while( true ) { pBVar33 = (BitSet128 *)&DAT_00c34780; uVar34 = 0x50; uVar35 = 0x4c; uVar36 = 0xc3; pBVar32 = (BitSet128 *)&DAT_00c345c0; pBVar9 = BitSet128::operator_or (&local_1d28,(BitSet128 *)&DAT_00c34850,(BitSet128 *)&DAT_00c34880); pBVar9 = BitSet128::operator_or(&local_1d38,pBVar9,pBVar32); pBVar9 = BitSet128::operator_or (&local_1d48,pBVar9, (BitSet128 *)CONCAT22(uVar36,CONCAT11(uVar35,uVar34))); pBVar9 = BitSet128::operator_or(&local_1d58,pBVar9,pBVar33); pBVar9 = BitSet128::__bnot(pBVar9,&local_1d68); BitSet128::operator_and(&local_1548,pBVar7,pBVar9); uVar19 = Random(); EVar15 = *(EntityPtr *)((int)EVar15 + 0x3c8); pVVar10 = Vector::FromAngle(&local_1200, (float)(int)local_8b0 * (float)local_87c + (float)local_8ac) ; pVVar10 = Vector::__mul(pVVar10,&local_1208,(float *)&local_aac); local_ab0 = 10.0; pVVar10 = Vector::__mul(pVVar10,&local_1210,&local_ab0); uVar11 = tear->_variant; if (uVar11 == 0x24) { uVar11 = 1; } Game::Spawn(g_game,2,uVar11,(Vector *)local_8e8,pVVar10,(Entity *)EVar15,0,uVar19); EVar26 = (EntityPtr)__RTDynamicCast(); local_ab4 = 0xc0c00000; local_898 = EVar26; pfVar17 = (float *)std::min(); Entity_Projectile::SetHeight((Entity_Projectile *)EVar26,*pfVar17); EVar15 = (EntityPtr)tear; SetScale((Entity_Tear *)EVar26,tear->_baseScale * (float)local_8b8); flags_00._l._4_4_ = local_1548._l._4_4_; flags_00._l._0_4_ = (undefined4)local_1548._l; flags_00._h._0_1_ = (char)(undefined4)local_1548._h; flags_00._h._1_1_ = (char)((uint)(undefined4)local_1548._h >> 8); flags_00._h._2_2_ = (short)((uint)(undefined4)local_1548._h >> 0x10); flags_00._h._4_4_ = local_1548._h._4_4_; SetTearFlags((Entity_Tear *)EVar26,flags_00); auVar29 = ZEXT416((uint)(((Entity_Tear *)EVar15)->_collisionDamage * (float)local_8b8)); (**(code **)(*(int *)EVar26 + 0x40))(); pcVar2 = *(code **)(*(int *)EVar26 + 0x3c); Entity::GetColor((Entity *)EVar15); in_stack_ffffd9fc = (Vector *)0xff; (*pcVar2)(); FUN_0060cd70(); FUN_0060cd90(); pVVar10 = &((Entity_Tear *)EVar15)->_pos; Entity::SetTargetPosition((Entity *)local_898,*pVVar10); pBVar7 = BitSet128::operator_and (&local_1d78,&((Entity_Tear *)EVar15)->_tearFlags, (BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { FallingSpeed((Entity_Tear *)local_898); FUN_00444c70(); Entity_Projectile::set_falling_accel((Entity_Projectile *)local_898,3.0); } local_8b0 = (EntityPtr)((int)local_8b0 + 1); if ((int)local_890 <= (int)local_8b0) break; pBVar7 = &((Entity_Tear *)EVar15)->_tearFlags; } (**(code **)(*(int *)EVar15 + 0x28))(); } else { auVar29 = ZEXT416((uint)((float)local_888 * 5.0)); local_aa4 = 0x96; local_aa0 = (int)((float)local_888 * 5.0); std::min(); local_aa8 = 0x50; piVar13 = (int *)std::max(); iVar8 = Entity::FrameCount((Entity *)EVar15); if ((*piVar13 <= iVar8) || (cVar6 = Entity::CollidesWithGrid(), cVar6 != '\0')) goto LAB_0066ebda; LAB_0066ef8a: pVVar10 = (Vector *)((int)EVar15 + 0x33c); } if (*(byte *)((int)EVar15 + 0x173) == 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); in_stack_ffffd9fc = (Vector *)0x66efd8; EntityList::QueryRadius (entityList,&local_d38,pVVar10, ((Vector *)((int)EVar15 + 0x420))->x * *(float *)((int)EVar15 + 0x370) * 4.0,4) ; local_14 = 6; local_8b0 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(); local_890 = (EntityPtr)Entity::ToTear((Entity *)*puVar14); if (((local_890 != (EntityPtr)0x0) && (local_890 != EVar15)) && (cVar6 = Entity::IsDead((Entity *)local_890), cVar6 == '\0')) { pBVar9 = &g_tearFlagLudovico; pBVar7 = TearFlags((Entity_Tear *)local_890,&local_1d98); pBVar7 = BitSet128::operator_and(&local_1da8,pBVar7,pBVar9); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { Game::GetField26614(g_game); cVar6 = FUN_00429550(); if ((cVar6 == '\0') || (bVar5 = Entity::IsDescendantOf ((Entity *)local_890, (Entity *)*(EntityPtr *)((int)EVar15 + 0x3c8)), bVar5 != 0) ) { FUN_00417340(); local_ab8 = auVar29._0_4_ + *(float *)((int)EVar15 + 0x370); local_abc = 0x40a00000; pEVar20 = (EntityPtr *)std::max(); local_87c = *pEVar20; pVVar16 = Entity::Position((Entity *)local_890,&local_1218); local_8ac = (EntityPtr)Vector::DistanceSquared(pVVar16,pVVar10); EVar26 = local_890; auVar29 = ZEXT416((uint)((float)local_87c * (float)local_87c)); if ((float)local_8ac <= (float)local_87c * (float)local_87c) { fVar24 = (float10)Scale((Entity_Tear *)local_890); local_87c = (EntityPtr)(float)fVar24; if (((Vector *)((int)EVar15 + 0x420))->x <= (float)local_87c) { pBVar9 = (BitSet128 *)&DAT_00c345c0; pBVar7 = TearFlags((Entity_Tear *)EVar26,&local_1db8); pBVar7 = BitSet128::operator_and(&local_1dc8,pBVar7,pBVar9); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 == 0) { local_ad8 = 0x3e4ccccd; local_ad4 = ((float)local_888 * *(float *)((int)EVar26 + 0x424)) / 50.0; std::max(); local_adc = 0x3f800000; pfVar17 = (float *)std::min(); local_ae0 = *(float *)((int)EVar26 + 0x424) + *pfVar17; pfVar17 = (float *)std::min(); SetScale((Entity_Tear *)EVar26,*pfVar17); pcVar2 = *(code **)(*(int *)EVar26 + 0x40); fVar24 = (float10)Entity::CollisionDamage((Entity *)local_890); local_ae4 = (float)fVar24; pfVar17 = (float *)std::max(); auVar29 = ZEXT416((uint)((float)local_8d8 + *pfVar17)); (*pcVar2)(); (**(code **)(*(int *)EVar15 + 0x28))(); break; } } local_ac4 = 0x3e4ccccd; local_ac0 = ((float)local_888 * *(float *)((int)EVar15 + 0x424)) / 50.0; std::max(); local_ac8 = 0x3f800000; pfVar17 = (float *)std::min(); local_acc = *(float *)((int)EVar15 + 0x424) + *pfVar17; pfVar17 = (float *)std::min(); SetScale((Entity_Tear *)EVar15,*pfVar17); pcVar2 = *(code **)(*(int *)EVar15 + 0x40); fVar24 = (float10)Entity::CollisionDamage((Entity *)local_890); local_ad0 = (float)fVar24; pfVar17 = (float *)std::max(); auVar29 = ZEXT416((uint)((float)local_8d8 + *pfVar17)); (*pcVar2)(); (**(code **)(*(int *)local_890 + 0x28))(); pVVar10 = (Vector *)((int)EVar15 + 0x33c); } } } } local_8b0 = (EntityPtr)((int)local_8b0 + 1); EVar26 = (EntityPtr)EntityList::Size(); } while ((uint)local_8b0 < (uint)EVar26); } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_d38); } pBVar7 = (BitSet128 *)((int)EVar15 + 0x428); } } } pBVar9 = BitSet128::operator_and(&local_1dd8,pBVar7,(BitSet128 *)&DAT_00c34810); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { iVar8 = EntityPtr::Ref(); if (iVar8 == 0) { if (8.0 < *(float *)((int)EVar15 + 0x3a4) || *(float *)((int)EVar15 + 0x3a4) == 8.0) { BitSet128::__bnot((BitSet128 *)&DAT_00c34810,&local_1de8); FUN_005cd430(); } else { if (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_1220); local_87c = (EntityPtr)Vector::Distance((Vector *)((int)EVar15 + 0x33c),pVVar10); if (10.0 < (float)local_87c) { EntityPtr::Set((EntityPtr *)((int)EVar15 + 0x494), (Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)); goto LAB_0066f416; } } iVar8 = find_nearest_linkable_tear((Entity_Tear *)EVar15); if (iVar8 != 0) { FUN_0067ae30(); } } } LAB_0066f416: auVar29 = ZEXT416((uint)*(float *)((int)EVar15 + 0x3a4)); if ((float)local_8fc < *(float *)((int)EVar15 + 0x3a4)) { iVar8 = EntityPtr::Ref(); if (iVar8 != 0) { familiar = (Entity *)EntityPtr::Ref(); bVar5 = Entity::IsTear(familiar); if (bVar5 != 0) goto LAB_0066f4a9; } bVar5 = Entity::IsFrame((Entity *)EVar15,4,*(int *)((int)EVar15 + 0x20)); if (((bVar5 != 0) && (iVar8 = FUN_0067adc0(), iVar8 < 5)) && ((iVar8 = Isaac::Random(10), iVar8 == 0 && (local_87c = (EntityPtr)find_link_partner((Entity_Tear *)EVar15), local_87c != (EntityPtr)0x0)))) { EntityPtr::Set((EntityPtr *)((int)EVar15 + 0x494),(Entity *)local_87c); EntityPtr::Set((EntityPtr *)((int)local_87c + 0x498),(Entity *)EVar15); } } LAB_0066f4a9: apply_link_spring_forces((Entity_Tear *)EVar15); } pBVar9 = BitSet128::operator_and(&local_1df8,pBVar7,(BitSet128 *)&DAT_00c34580); bVar5 = BitSet128::IsNonZero(pBVar9); if (bVar5 != 0) { pBVar9 = BitSet128::operator_and(&local_1e08,pBVar7,&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar9); if ((((bVar5 != 0) && (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0)) && (iVar8 = Entity::Type(), iVar8 == 1)) && (*(void **)((int)EVar15 + 0x478) == (void *)0x0)) { local_8e0 = (Entity_Player *)__RTDynamicCast(); in_stack_ffffd9fc = (Vector *)0x0; Entity_Player::GetTractorBeam(local_8e0); local_8ac = (EntityPtr)__RTDynamicCast(); if (local_8ac != (EntityPtr)0x0) { pVVar10 = Entity::Position((Entity *)local_8e0,&local_1228); Vector::__sub((Vector *)((int)EVar15 + 0x33c),&local_cb0,pVVar10); local_96c = (undefined1 *)0x3f800000; pBVar7 = BitSet128::operator_and(&local_1e18,pBVar7,(BitSet128 *)&DAT_00c34860); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (local_87c = (EntityPtr)Vector::Dot((Vector *)((int)EVar15 + 0x360),&local_cb0), (float)local_87c < (float)local_894)) { local_96c = &DAT_bf800000; } local_87c = (EntityPtr)Vector::Length((Vector *)((int)EVar15 + 0x360)); fVar24 = (float10)Entity_Projectile::Damage((Entity_Projectile *)local_8ac); Vector::FromAngle(&local_cb8,(float)fVar24); auVar29 = ZEXT416((uint)local_87c); pVVar10 = Vector::Resized(&local_cb8,&local_1230,(float)local_87c); pVVar10 = Vector::__mul(pVVar10,&local_1238,(float *)&local_96c); Vector::operator_assign((Vector *)((int)EVar15 + 0x360),pVVar10); pVVar10 = Entity::Position((Entity *)local_8e0,&local_1240); local_ae8 = Vector::Length(&local_cb0); pVVar16 = Vector::__mul(&local_cb8,&local_1248,&local_ae8); pVVar10 = Vector::__add(pVVar10,&local_1250,pVVar16); Vector::operator_assign((Vector *)((int)EVar15 + 0x33c),pVVar10); } } } EVar26 = (EntityPtr)((int)EVar15 + 0x33c); outResult = (TypeDescriptor *)0x66f6d1; bVar5 = Entity::HasEntityFlags((Entity *)EVar15,0x80000); if (bVar5 != 0) { fVar25 = *(float *)((int)EVar15 + 0x3a4); auVar29 = ZEXT416((uint)fVar25); if (5.0 <= fVar25) { outResult = (TypeDescriptor *)0x66f72f; Entity::ClearEntityFlags((Entity *)EVar15,0x80000); } else { fVar25 = assert_lerp_range(fVar25,(float)local_894,5.0,0.55,1.0,1); auVar29._0_4_ = (EntityPtr)(fVar25 * *(float *)((int)EVar15 + 0x36c)); auVar29._4_12_ = extraout_var_27; *(EntityPtr *)((int)EVar15 + 0x36c) = auVar29._0_4_; } } pBVar7 = BitSet128::operator_and (&local_1e28,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c345b0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and (&local_1e38,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); outResult = (TypeDescriptor *)local_d48; in_stack_ffffd9fc = (Vector *)0x66f7b2; EntityList::QueryRadius (entityList,(EntityList_EL *)outResult,(Vector *)EVar26, *(float *)((int)EVar15 + 0x370) * 4.0,4); local_14 = 7; local_8b0 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(); local_898 = (EntityPtr)Entity::ToTear((Entity *)*puVar14); if ((local_898 != (EntityPtr)0x0) && (uVar11 = PathFinder::GetGridIndex(), uVar11 <= (uint)*(int *)((int)EVar15 + 0x20))) { pVVar10 = Entity::Position((Entity *)local_898,&local_1258); outResult = (TypeDescriptor *)0x66f832; Vector::__sub((Vector *)EVar26,&local_9b4,pVVar10); FUN_00417340(); local_8c0 = (EntityPtr)((auVar29._0_4_ + *(float *)((int)EVar15 + 0x370)) * 0.9); local_87c = (EntityPtr)Vector::LengthSquared(&local_9b4); auVar29 = ZEXT416((uint)local_87c); if ((float)local_87c <= (float)local_8c0 * (float)local_8c0) { local_87c = (EntityPtr)Vector::LengthSquared(&local_9b4); auVar29 = ZEXT416((uint)local_87c); if ((float)local_87c != (float)local_894) { Vector::Normalized(&local_9b4,&local_964); pVVar22 = (Vector *)((int)EVar15 + 0x360); local_8e0 = (Entity_Player *)Vector::Dot(pVVar22,&local_964); pVVar10 = Entity::Velocity((Entity *)local_898,&local_1260); local_8d0 = (EntityPtr)Vector::Dot(pVVar10,&local_964); local_b38 = (float)local_8d0 - (float)local_8e0; local_970 = 1.1; pVVar10 = Vector::__mul(&local_964,&local_1268,&local_b38); pVVar10 = Vector::__mul(pVVar10,&local_1270,&local_970); Vector::__add(pVVar22,&local_dd8,pVVar10); pVVar10 = Entity::Velocity((Entity *)local_898,&local_1278); local_aec = (float)local_8e0 - (float)local_8d0; auVar29 = ZEXT416((uint)local_aec); pVVar16 = Vector::__mul(&local_964,&local_1280,&local_aec); pVVar16 = Vector::__mul(pVVar16,&local_1288,&local_970); Vector::__add(pVVar10,&local_de0,pVVar16); fVar25 = Vector::Length(&local_9b4); local_974 = ((float)local_8c0 - fVar25) * 0.5; pVVar10 = Vector::__mul(&local_964,&local_1290,&local_974); Vector::__add((Vector *)local_8e8,&local_de8,pVVar10); pVVar10 = Entity::Position((Entity *)local_898,&local_1298); pVVar16 = Vector::__mul(&local_964,&local_12a0,&local_974); Vector::__sub(pVVar10,&local_df0,pVVar16); Vector::operator_assign(pVVar22,&local_dd8); Entity::SetVelocity((Entity *)local_898,&local_de0); EVar26 = local_8e8; Vector::operator_assign((Vector *)local_8e8,&local_de8); Entity::SetPosition((Entity *)local_898,&local_df0); EVar15 = (EntityPtr)tear; tear->_popBounceCount = tear->_popBounceCount + 1; *(short *)&((AnimationState *)((int)local_898 + 0x46c))->_animation = *(short *)&((AnimationState *)((int)local_898 + 0x46c))->_animation + 1; outResult = (TypeDescriptor *)0x2; in_stack_ffffd9fc = (Vector *)EVar26; SoundEffects::PlayWithFartOverride2(0x1ca,(int)EVar26,2,0,1.0,(float)local_8a8); } } } local_8b0 = (EntityPtr)((int)local_8b0 + 1); EVar27 = (EntityPtr)EntityList::Size(); } while ((uint)local_8b0 < (uint)EVar27); } local_14 = 0xffffffff; *(float *)((int)EVar15 + 0x36c) = *(float *)((int)EVar15 + 0x36c) * 0.96; EntityList_Query::~EntityList_Query(local_d48); } } if (-5.0 < *(float *)((int)EVar15 + 0x410)) { LAB_0066fb70: pBVar7 = BitSet128::operator_and (&local_1e58,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 == 0) goto LAB_0066fc9b; if ((*(int *)((int)EVar15 + 0x2c) == 9) && (*(byte *)((int)EVar15 + 0x173) == 0)) { Vector::operator_assign((Vector *)((int)EVar15 + 0x360),&g_vectorZero); *(int *)((int)EVar15 + 0x184) = 0; *(int *)((int)EVar15 + 0x188) = 0; Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),180.0); outResult = (TypeDescriptor *)0x66fbea; ANM2::Play((ANM2 *)((int)EVar15 + 0x48),(byte *)"Stuck",0); } pBVar7 = BitSet128::operator_and (&local_1e68,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { ((NPCAI_Pathfinder *)((int)EVar15 + 0x414))->_entity = (void *)((float)((NPCAI_Pathfinder *)((int)EVar15 + 0x414))->_entity * -1.6); Entity_Projectile::SetHeight((Entity_Projectile *)EVar15,-5.0); } *(byte *)((int)EVar15 + 0x173) = 1; *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 4); UpdateBoneTear((Entity_Tear *)EVar15,(Entity *)0x0); if ((*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) && (*(char *)((int)EVar15 + 0x7e8) != '\0')) { pEVar18 = Entity::ToPlayer((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)); if (pEVar18 != (Entity_Player *)0x0) { outResult = (TypeDescriptor *)0x66fc84; bVar5 = Entity_Player::HasCollectible(pEVar18,0x175,0); if (bVar5 != 0) { Entity_Player::ClearDeadEyeCharge(pEVar18); } FUN_007cb4f0(); } } goto LAB_00670391; } pBVar7 = BitSet128::operator_and (&local_1e48,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c345e0); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (-5.0 < (float)((NPCAI_Pathfinder *)((int)EVar15 + 0x414))->_entity + *(float *)((int)EVar15 + 0x410))) goto LAB_0066fb70; LAB_0066fc9b: pBVar7 = BitSet128::operator_or(&local_1e78,(BitSet128 *)&DAT_00c34b80,(BitSet128 *)&DAT_00c346e0) ; outResult = (TypeDescriptor *)0x66fcc2; pBVar7 = BitSet128::operator_and(&local_1e88,(BitSet128 *)((int)EVar15 + 0x428),pBVar7); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 == 0) && (*(int *)((int)EVar15 + 0x2c) != 0x2e)) { LAB_0066fcf0: pBVar7 = BitSet128::operator_and (&local_1e98,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && ((*(byte *)((int)EVar15 + 0x30) & 2) != 0)) goto LAB_00670254; pBVar7 = BitSet128::operator_and (&local_1ea8,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34790); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar28 = (Entity_Projectile *)Room::GetGridIndex(room,(Vector *)EVar26); local_8ac = (EntityPtr)pEVar28; if (-1 < (int)pEVar28) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_8e0 = (Entity_Player *)Room::GetGridEntity(room,(uint)pEVar28); if ((local_8e0 != (Entity_Player *)0x0) && (bVar5 = GridEntity::IsBreakableRock((GridEntity *)local_8e0), bVar5 != 0)) { BitSet128::__bnot((BitSet128 *)&DAT_00c34790,&local_1eb8); FUN_005cd430(); FUN_00665b70(); GridEntity_Rock::UpdateNeighbors((GridEntity_Rock *)local_8e0); local_87c = (EntityPtr)RNG::RandomInt((RNG *)((int)EVar15 + 0x3dc),6); room = (Room *)Level::GetCurrentRoom((Level *)g_game); tintedRockIdx = Room::GetTintedRockIdx(room); local_890 = (EntityPtr)((uint)(pEVar28 == (Entity_Projectile *)tintedRockIdx) * 2 + 2); if ((pEVar28 == (Entity_Projectile *)tintedRockIdx) && (uVar11 = RNG::RandomInt((RNG *)((int)EVar15 + 0x3dc),0x14), uVar11 == 0)) { persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar5 = PersistentGameData::Unlocked(persistentGameData,0x143); if (bVar5 != 0) { local_890 = (EntityPtr)0x16; } } local_888 = (EntityPtr)0x0; switch(local_87c) { case (EntityPtr)0x0: local_87c = (EntityPtr)RNG::RandomFloat((RNG *)((int)EVar15 + 0x3dc)); local_890 = (EntityPtr)0xe; if (local_8f0 <= (float)local_87c) { if (0.8 <= (float)local_87c) { if (0.95 <= (float)local_87c) { if (0.97 <= (float)local_87c) { local_888 = (EntityPtr)(((float)local_87c < 0.98) + 3); } else { local_888 = (EntityPtr)0x5; } } else { local_888 = (EntityPtr)0x1; } } else { local_888 = (EntityPtr)0x2; } } break; case (EntityPtr)0x1: local_890 = (EntityPtr)0x5; break; case (EntityPtr)0x2: local_890 = (EntityPtr)0x6; break; case (EntityPtr)0x3: local_890 = (EntityPtr)0x3; break; case (EntityPtr)0x4: local_890 = (EntityPtr)0xc; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::SetGridPath(room,(int)pEVar28,0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar11 = RNG::Next((RNG *)((int)EVar15 + 0x3dc)); in_stack_ffffd9fc = (Vector *)local_890; outResult = (TypeDescriptor *)local_888; Room::SpawnGridEntity(room,(int)local_8ac,(uint)local_890,(uint)local_888,uVar11,0); } } goto LAB_00670391; } if ((*(byte *)((int)EVar15 + 400) != 0) && (-60.0 < *(float *)((int)EVar15 + 0x410))) { pBVar7 = BitSet128::operator_and (&local_1ec8,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if ((bVar5 == 0) || (*(int *)((int)EVar15 + 0x2c) == 9)) goto LAB_0066ffc8; LAB_00670079: pBVar7 = BitSet128::operator_and (&local_1ed8,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagSpectral); bVar5 = BitSet128::IsZero(pBVar7); if ((bVar5 == 0) && (*(int *)((int)EVar15 + 0x2c) != 4)) goto LAB_00670391; pBVar7 = BitSet128::operator_and (&local_1ee8,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34930) ; bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 == 0) { LAB_00670113: if (*(void **)((int)EVar15 + 0x478) != (void *)0x0) goto LAB_00670391; } else { pBVar7 = BitSet128::operator_and (&local_1ef8,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34a50); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 == 0) goto LAB_00670113; pBVar7 = BitSet128::operator_and (&local_1f08,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34630); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 == 0) goto LAB_00670113; } game = g_game; *(byte *)((int)EVar15 + 0x173) = 1; *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 1); room = (Room *)Level::GetCurrentRoom((Level *)game); local_880 = *(undefined4 *)EVar26; local_87c = *(EntityPtr *)((int)EVar26 + 4); outResult = (TypeDescriptor *)0x670165; iVar8 = Room::GetGridCollisionAtPos(room,*(Vector *)EVar26); if (iVar8 == 4) { LAB_006701a6: *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 2); } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_880 = *(undefined4 *)EVar26; local_87c = *(EntityPtr *)((int)EVar26 + 4); outResult = (TypeDescriptor *)0x6701a1; iVar8 = Room::GetGridCollisionAtPos(room,*(Vector *)EVar26); if (iVar8 == 5) goto LAB_006701a6; } UpdateBoneTear((Entity_Tear *)EVar15,(Entity *)0x0); try_make_bridges(); if (((*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) && (*(char *)((int)EVar15 + 0x7e8) != '\0')) && (local_87c = (EntityPtr)Entity::ToPlayer((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)), local_87c != (EntityPtr)0x0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntityFromPos(room,(Vector *)EVar26); if ((gridEntity == (GridEntity *)0x0) || ((iVar8 = GridEntity::GetType(), iVar8 != 0xe && (iVar8 = GridEntity::GetType(), iVar8 != 0xc)))) { EVar26 = local_87c; FUN_007cb4f0(); outResult = (TypeDescriptor *)0x670240; bVar5 = Entity_Player::HasCollectible((Entity_Player *)EVar26,0x175,0); if (bVar5 != 0) { Entity_Player::ClearDeadEyeCharge((Entity_Player *)EVar26); } } } goto LAB_00670391; } LAB_0066ffc8: room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_880 = *(undefined4 *)EVar26; local_87c = *(EntityPtr *)((int)EVar26 + 4); outResult = (TypeDescriptor *)0x66ffff; iVar8 = Room::GetGridCollisionAtPos(room,*(Vector *)EVar26); if (iVar8 != 4) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_880 = *(undefined4 *)EVar26; local_87c = *(EntityPtr *)((int)EVar26 + 4); outResult = (TypeDescriptor *)0x67003b; iVar8 = Room::GetGridCollisionAtPos(room,*(Vector *)EVar26); if (iVar8 == 5) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar8 = Room::GetGridPathFromPos(room,(Vector *)EVar26); if (iVar8 < 3000) goto LAB_00670062; } goto LAB_00670391; } LAB_00670062: if (*(byte *)((int)EVar15 + 400) == 0) goto LAB_00670391; if (*(int *)((int)EVar15 + 0x2c) != 9) goto LAB_00670079; LAB_0067039b: if (*(byte *)((int)EVar15 + 0x173) == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); EVar26 = (EntityPtr)((int)EVar15 + 0x33c); outResult = (TypeDescriptor *)&DAT_bf800000; in_stack_ffffd9fc = (Vector *)EVar26; Room::GetClampedPositionImpl (room,&local_d80,(Vector *)EVar26,-1.0,-20.0,-40.0,(float)local_8cc); bVar5 = Vector::operator_ne(&local_d80,(Vector *)EVar26); if (bVar5 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar20 = (EntityPtr *)Room::GetTopLeftPos(room); local_87c = *pEVar20; local_8cc = pEVar20[1]; room = (Room *)Level::GetCurrentRoom((Level *)g_game); puVar14 = (undefined4 *)Room::GetBottomRightPos(room); local_8ac = (EntityPtr)*puVar14; local_8e0 = (Entity_Player *)puVar14[1]; outResult = (TypeDescriptor *)0x670463; ANM2::Play((ANM2 *)((int)EVar15 + 0x48),(byte *)"Stuck",0); if ((float)local_87c <= *(float *)EVar26) { if (*(float *)EVar26 <= (float)local_8ac) { if ((float)local_8cc <= *(float *)((int)EVar15 + 0x340)) { if ((float)local_8e0 < *(float *)((int)EVar15 + 0x340)) { Sprite::set_flip_x((Sprite *)((int)EVar15 + 0x48), (float)local_894 < ((Vector *)((int)EVar15 + 0x360))->x); set_byte_0x101(); } } else { Sprite::set_flip_x((Sprite *)((int)EVar15 + 0x48), ((Vector *)((int)EVar15 + 0x360))->x <= (float)local_894 && (float)local_894 != ((Vector *)((int)EVar15 + 0x360))->x); } } else { Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),90.0); } } else { Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),90.0); Sprite::set_flip_x((Sprite *)((int)EVar15 + 0x48),1); } Vector::operator_assign((Vector *)((int)EVar15 + 0x360),&g_vectorZero); *(int *)((int)EVar15 + 0x184) = 0; *(int *)((int)EVar15 + 0x188) = 0; *(byte *)((int)EVar15 + 0x173) = 1; *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 3); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_87c = (EntityPtr)Room::GetGridIndex(room,(Vector *)EVar26); if (-1 < (int)local_87c) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); EntityRef::constructor(&local_2598,(Entity *)EVar15); outResult = (TypeDescriptor *)0x0; in_stack_ffffd9fc = (Vector *)local_87c; Room::DestroyGridWithSource(room); } } } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::IsBeastDungeon(room); if (bVar5 != 0) goto LAB_0066fcf0; LAB_00670254: pBVar7 = BitSet128::operator_and (&local_1f18,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagSpectral); bVar5 = BitSet128::IsNonZero(pBVar7); iVar8 = 6; if (bVar5 != 0) { iVar8 = 3; } *(int *)((int)EVar15 + 0x184) = iVar8; if (*(byte *)((int)EVar15 + 400) != 0) { pVVar10 = (Vector *)((int)EVar15 + 0x360); Vector::__sub((Vector *)((int)EVar15 + 0x33c),&local_12a8,pVVar10); try_make_bridges(); Vector::Normalize(pVVar10); local_af0 = Vector::Length((Vector *)((int)EVar15 + 0x194)); Vector::operator_mul_assign(pVVar10,&local_af0); BitSet128::__bnot((BitSet128 *)&DAT_00c34580,&local_1f28); FUN_005cd430(); std::vector::clear((uint *)((int)EVar15 + 0x444),0); local_87c = local_8a8; EVar26 = local_8a8; if (*(EntityPtr *)((int)EVar15 + 0x3c8) != (EntityPtr)0x0) { bVar5 = Entity::is_player((Entity *)*(EntityPtr *)((int)EVar15 + 0x3c8)); if (bVar5 == 0) { EVar26 = local_87c; } else { Entity_Player::IsLocalPlayer((Entity_Player *)*(EntityPtr *)((int)EVar15 + 0x3c8)); } } outResult = (TypeDescriptor *)0x2; in_stack_ffffd9fc = (Vector *)0x389; SoundEffects::PlayWithFartOverride(0x389,(float)EVar26,2,0,1.0); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); if (bVar5 != 0) { BitSet128::__bnot((BitSet128 *)&DAT_00c34b80,&local_2548); FUN_005cd430(); } } LAB_00670391: if (*(int *)((int)EVar15 + 0x2c) == 9) goto LAB_0067039b; } EVar26 = (EntityPtr)((int)EVar15 + 0x33c); if (((*(int *)((int)EVar15 + 0x2c) == 0x2b) || (*(int *)((int)EVar15 + 0x2c) == 0x2c)) && ((*(byte *)((int)EVar15 + 0x173) == 0 && (local_8b0 = (EntityPtr)Entity::ToPlayer((Entity *)*(EntityPtr *)((int)EVar15 + 0x3c8)), local_8b0 != (EntityPtr)0x0)))) { Vector::__add((Vector *)EVar26,&local_9cc,(Vector *)((int)EVar15 + 0x360)); bVar5 = Vector::operator_ne((Vector *)((int)EVar15 + 0x360),&g_vectorZero); if (bVar5 != 0) { pVVar10 = Vector::Normalized((Vector *)((int)EVar15 + 0x360),&local_12b0); pVVar10 = Vector::__mul(pVVar10,&local_12b8,(float *)((int)EVar15 + 0x370)); Vector::operator_add_assign(&local_9cc,pVVar10); } local_890 = (EntityPtr)Level::GetCurrentRoom((Level *)g_game); uVar11 = Room::GetGridIndex((Room *)local_890,&local_9cc); if (-1 < (int)uVar11) { local_88c = (EntityPtr)Room::GetGridEntity((Room *)local_890,uVar11); pos.y = local_9cc.y; pos.x = local_9cc.x; local_8cc = (EntityPtr)Room::GetGridCollisionAtPos((Room *)local_890,pos); local_898 = *(EntityPtr *)((int)EVar15 + 0x184); if (local_88c != (EntityPtr)0x0) { iVar8 = GridEntity::GetType(); if ((iVar8 == 0x10) && (local_8cc == (EntityPtr)0x4)) { cVar6 = GridEntity_Door::IsLocked(); if ((cVar6 == '\0') || (cVar6 = FUN_00436000(), cVar6 != '\0')) { bVar5 = GridEntity_Door::IsRoomType((GridEntity_Door *)local_88c,7); if ((bVar5 == 0) && (bVar5 = GridEntity_Door::IsRoomType((GridEntity_Door *)local_88c,8), bVar5 == 0)) { iVar8 = EntityList::Size(); if (iVar8 == 2) goto LAB_006708cc; GridEntity_Door::Open((GridEntity_Door *)local_88c); } else { pcVar2 = *(code **)(*(int *)local_88c + 0x14); EntityRef::EntityRef(&local_25e8); (*pcVar2)(); } } else { GridEntity_Door::TryUnlock((GridEntity_Door *)local_88c,(Entity_Player *)local_8b0,1); } LAB_00670792: if (local_898 == (EntityPtr)0x4) { Entity::Die((Entity *)EVar15); } } else { iVar8 = GridEntity::GetType(); if (iVar8 == 0xb) { iVar8 = EntityList::Size(); if (iVar8 == 0) { GridEntity_Lock::try_unlock(); goto LAB_00670792; } } else if ((((local_8cc == (EntityPtr)0x3) || (local_8cc == (EntityPtr)0x2)) && (iVar8 = FUN_00499db0(), iVar8 == 3)) && ((local_898 == (EntityPtr)0x4 || (iVar8 = Isaac::Random(8), iVar8 == 0)))) { pcVar2 = *(code **)(*(int *)local_88c + 0x14); EntityRef::constructor(&local_25c0,(Entity *)EVar15); cVar6 = (*pcVar2)(); if (cVar6 != '\0') { if (local_898 == (EntityPtr)0x4) { Entity::Die((Entity *)EVar15); } GridEntity::Position((GridEntity *)local_88c,&local_cc0); pVVar10 = Vector::__sub(&local_cc0,&local_12c0,(Vector *)((int)EVar15 + 0x33c)); pVVar10 = Vector::ToCardinal(&local_12c8,pVVar10); local_af4 = 40.0; pVVar10 = Vector::operator_mul(&local_12d0,&local_af4,pVVar10); pVVar10 = Vector::__add(&local_cc0,&local_12d8,pVVar10); uVar11 = Room::GetGridIndex((Room *)local_890,pVVar10); if (-1 < (int)uVar11) { EVar26 = local_88c; gridEntity = Room::GetGridEntity((Room *)local_890,uVar11); Room::TryMakeBridge((Room *)local_890,gridEntity,(GridEntity *)EVar26); } } } } } } LAB_006708cc: EVar26 = (EntityPtr)((int)EVar15 + 0x33c); entityList = (EntityList *)FUN_00428a60(); outResult = (TypeDescriptor *)local_cf8; in_stack_ffffd9fc = (Vector *)0x6708f0; EntityList::QueryRadius(entityList,(EntityList_EL *)outResult,(Vector *)EVar26,24.0,0x10); local_14 = 8; iVar8 = EntityList::Size(); EVar27 = local_8b0; if (iVar8 != 0) { uVar11 = 0; do { pEVar20 = (EntityPtr *)std::vector::operator_index(); local_890 = *pEVar20; if (local_890 != (EntityPtr)0x0) { cVar6 = Entity::is_pickup((Entity *)local_890); if ((cVar6 == '\0') || (((iVar8 = Entity::Variant((Entity *)local_890), iVar8 != 0x3c && (iVar8 = Entity::Variant((Entity *)local_890), iVar8 != 0x35)) && (iVar8 = Entity::Variant((Entity *)local_890), iVar8 != 0x37)))) { cVar6 = FUN_00435da0(); if ((cVar6 != '\0') && (iVar8 = Entity::Variant((Entity *)local_890), iVar8 == 7)) { Entity::ForceCollide((Entity *)EVar27,(Entity *)local_890,1); } } else { Entity_Pickup::TryOpenChest((Entity_Pickup *)local_890,(Entity_Player *)EVar27); } } uVar11 = uVar11 + 1; uVar19 = EntityList::Size(); } while (uVar11 < uVar19); EVar26 = (EntityPtr)&tear->_pos; EVar15 = (EntityPtr)tear; } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_cf8); } pBVar7 = BitSet128::operator_and (&local_1f48,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { local_888 = (EntityPtr)((uint)*(int *)((int)EVar15 + 0x30) >> 1 & 0xffffff01); local_8a1 = is_not_familiar_spawned((Entity_Tear *)EVar15); if (local_888._0_1_ == '\0') { fVar25 = 0.7; } else { fVar25 = 0.98; } EVar27 = (EntityPtr)(fVar25 * *(float *)((int)EVar15 + 0x36c)); *(EntityPtr *)((int)EVar15 + 0x36c) = EVar27; local_890 = (EntityPtr)GetRootPlayer((Entity_Tear *)EVar15); if (local_890 == (EntityPtr)0x0) { EVar27 = (EntityPtr)0x41200000; } else { FUN_005cd750(); } local_8cc = EVar27; pBVar7 = BitSet128::operator_and (&local_1f58,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c348b0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if (local_890 == (EntityPtr)0x0) { outResult = (TypeDescriptor *)0x670aac; bVar5 = Entity_Player::HasTrinket((Entity_Player *)0x0,0xc,0); if (bVar5 != 0) goto LAB_00670ae2; } pVVar10 = Vector::Vector(&local_12e0,(float)local_8a8,(float)local_8a8); Vector::operator_assign((Vector *)((int)EVar15 + 0x374),pVVar10); FUN_00665a50(); } LAB_00670ae2: if ((*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) && (bVar5 = Entity::IsFamiliar((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)), bVar5 != 0)) { local_8dc = (EntityPtr)((float)local_8dc * local_8ec); } local_8b0 = (EntityPtr)Vector::Length((Vector *)((int)EVar15 + 0x360)); if (local_888._0_1_ != '\0') { fVar25 = assert_lerp_range((float)local_8b0,10.0,20.0,0.9,2.0,1); local_8dc = (EntityPtr)(fVar25 * (float)local_8dc); } local_89c = (EntityPtr) Entity::GetIntervalTicks((Entity *)EVar15,(float)local_8cc,(float)local_894); if (local_89c != (EntityPtr)0x0) { std::vector::clear((uint *)((int)EVar15 + 0x444),0); try_make_bridges(); if (local_890 != (EntityPtr)0x0) { Isaac::Random(2); EVar26 = local_890; Entity_Player::GetTearHitParams(); *(int *)((int)EVar15 + 0x484) = 0; if (*(int *)((int)EVar15 + 0x2c) != local_f8) { *(int *)((int)EVar15 + 0x2c) = local_f8; cVar6 = FUN_00665cc0(); if (cVar6 != '\0') { Entity::LoadEntityConfig((Entity *)EVar15); *(int *)((int)EVar15 + 0x184) = 0; if (*(void **)((int)EVar15 + 0x330) != (void *)0x0) { ANM2::Load((ANM2 *)((int)EVar15 + 0x48), (std_string *)((int)*(void **)((int)EVar15 + 0x330) + 0x74),1); Sprite::GetDefaultAnimationName((Sprite *)((int)EVar15 + 0x48)); Sprite::Play(); Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),0.0); ResetSpriteScale((Entity_Tear *)EVar15); } } } if (local_888._0_1_ != '\0') { if (10.0 < (float)local_8b0) { fVar25 = assert_lerp_range((float)local_8b0,10.0,20.0,(float)local_8a8,6.0,1); local_b0 = fVar25 * local_b0; fVar25 = assert_lerp_range((float)local_8b0,10.0,(float)local_8fc,(float)local_894,6.0,1 ); local_b0 = fVar25 + local_b0; } BitSet128::operator__(); } pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); *(float *)((int)EVar15 + 0x388) = local_b0; (*pcVar2)(); pBVar9 = &g_tearFlagLudovico; pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b80,&local_1f68); pBVar7 = BitSet128::operator_and(&local_1f78,&local_c0,pBVar7); pBVar7 = BitSet128::operator_or(&local_1f88,pBVar7,pBVar9); EVar27 = *(EntityPtr *)&pBVar7->_l; outResult = *(TypeDescriptor **)((int)&pBVar7->_l + 4); flags_01._h._1_1_ = (char)(pBVar7->_h >> 8); flags_01._0_9_ = *(unkbyte9 *)pBVar7; flags_01._h._2_2_ = (short)(pBVar7->_h >> 0x10); flags_01._h._4_4_ = *(undefined4 *)((int)&pBVar7->_h + 4); in_stack_ffffd9fc = (Vector *)EVar27; SetTearFlags((Entity_Tear *)EVar15,flags_01); if (local_8a1 != '\0') { pBVar7 = BitSet128::operator_and (&local_1f98,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34b30); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_12e8); local_87c = (EntityPtr)Vector::Distance(pVVar10,(Vector *)((int)EVar15 + 0x33c)); fVar25 = Math::clamp((float)local_8a8,700.0,(float)local_87c); EVar27 = (EntityPtr) ((fVar25 / 700.0 + (float)local_8a8) * *(float *)((int)EVar15 + 0x388)); *(EntityPtr *)((int)EVar15 + 0x388) = EVar27; } pBVar7 = BitSet128::operator_and (&local_1fa8,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34c40); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_12f0); local_87c = (EntityPtr)Vector::Distance(pVVar10,(Vector *)((int)EVar15 + 0x33c)); fVar25 = Math::clamp((float)local_894,700.0,(float)local_87c); EVar27 = (EntityPtr)(fVar25 / 900.0); *(float *)((int)EVar15 + 0x388) = ((float)local_8a8 - (float)EVar27) * *(float *)((int)EVar15 + 0x388); } EVar26 = local_890; } pBVar7 = BitSet128::operator_and (&local_1fb8,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34b70); bVar5 = BitSet128::IsNonZero(pBVar7); if (((bVar5 == 0) || (iVar8 = Entity_Player::GetFireDirection((Entity_Player *)EVar26), iVar8 == -1)) || ((int)local_89c < 1)) { EVar26 = (EntityPtr)((int)EVar15 + 0x33c); } else { do { pVVar10 = MusicManager::RandomVector(&local_12f8); FUN_00436190(); EVar27 = (EntityPtr)((float)EVar27 * 10.0); local_af8 = EVar27; pVVar10 = Vector::operator_mul(&local_1300,(float *)&local_af8,pVVar10); EVar26 = (EntityPtr)((int)EVar15 + 0x33c); outResult = (TypeDescriptor *)0x7; in_stack_ffffd9fc = (Vector *)pVVar10->y; Entity_Player::FireTear ((Entity_Player *)local_890,(Vector *)EVar26,*pVVar10,7,(Entity *)EVar15,1.0); local_89c = (EntityPtr)((int)local_89c + -1); } while (local_89c != (EntityPtr)0x0); local_89c = (EntityPtr)0x0; } } } if (local_8a1 == '\0') { if (((*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) && (iVar8 = Entity::Type(), iVar8 == 2)) && (iVar8 = Entity::Variant((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)), *(int *)((int)EVar15 + 0x2c) != iVar8)) { *(int *)((int)EVar15 + 0x2c) = iVar8; cVar6 = FUN_00665cc0(); if (cVar6 != '\0') { Entity::LoadEntityConfig((Entity *)EVar15); if (*(void **)((int)EVar15 + 0x330) != (void *)0x0) { ANM2::Load((ANM2 *)((int)EVar15 + 0x48), (std_string *)((int)*(void **)((int)EVar15 + 0x330) + 0x74),1); Sprite::GetDefaultAnimationName((Sprite *)((int)EVar15 + 0x48)); outResult = (TypeDescriptor *)0x6715e3; Sprite::Play(); ResetSpriteScale((Entity_Tear *)EVar15); } } } iVar8 = *(int *)((int)EVar15 + 0x2c); if (((iVar8 == 5) || (iVar8 == 6)) || ((iVar8 == 7 || (((iVar8 == 0x14 || (iVar8 == 0x21)) || (iVar8 == 0x22)))))) { LAB_0067162f: Sprite::SetRotation((Sprite *)((int)EVar15 + 0x48),(float)*(void **)((int)EVar15 + 0x458)); } else { pBVar7 = BitSet128::operator_and (&local_1ff8,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c348b0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) goto LAB_0067162f; } if ((*(byte *)((int)EVar15 + 0x30) & 1) != 0) { if (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_1378); pVVar22 = (Vector *)((int)EVar15 + 0x7f4); iVar8 = Entity::FrameCount((Entity *)tear); iVar8 = iVar8 + tear->_index * 0x32; fVar25 = sinf_wrapper((float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) * 0.08); local_87c = (EntityPtr)(fVar25 * (float)local_8b8 + (float)local_8a8); fVar25 = Vector::Length(pVVar22); pVVar16 = Vector::Resized(pVVar22,&local_1380,fVar25 * (float)local_87c); pVVar10 = Vector::__add(pVVar10,&local_1388,pVVar16); EVar26 = local_8e8; Vector::operator_assign((Vector *)local_8e8,pVVar10); outResult = (TypeDescriptor *)0x67174f; pVVar10 = Vector::Rotated(pVVar22,&local_1390, ((float)((uint)tear->_index % 10) + 0.0) * 0.1 - 4.0); Vector::operator_assign(pVVar22,pVVar10); EVar15 = (EntityPtr)tear; } } if (*(EntityPtr *)((int)EVar15 + 0x3bc) == (EntityPtr)0x0) { (**(code **)(*(int *)EVar15 + 0x28))(); } } else { FUN_00424510(); local_14 = 9; for (local_944 = (Entity *)Entity::Child((Entity *)EVar15); local_944 != (Entity *)0x0; local_944 = (Entity *)Entity::Child(local_944)) { std::vector::push_back(); } local_8ec = 0.0; iVar8 = std::vector::size(local_9e0); if (iVar8 != 0) { do { pEVar20 = (EntityPtr *)FUN_0042c810(); local_898 = *pEVar20; Entity::SetVelocity((Entity *)local_898,(Vector *)((int)EVar15 + 0x360)); local_8b0 = (EntityPtr) ((float)((double)(int)local_8ec + __uint_to_double_fixup[-((int)local_8ec >> 0x1f)]) * 360.0); iVar8 = std::vector::size(local_9e0); local_8b0 = (EntityPtr) ((float)local_8b0 / (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)])); iVar8 = Entity::FrameCount((Entity *)EVar15); local_8cc = (EntityPtr)((float)iVar8 * 5.0 + (float)local_8b0); local_948 = *(float *)((int)EVar15 + 0x370) + *(float *)((int)EVar15 + 0x370); iVar8 = Entity::FrameCount((Entity *)local_898); if (iVar8 < 0x32) { iVar8 = Entity::FrameCount((Entity *)local_898); local_948 = ((float)iVar8 / 50.0) * local_948; } pVVar10 = Vector::FromAngle(&local_1308,(float)local_8cc); pVVar10 = Vector::__mul(pVVar10,&local_1310,&local_948); pVVar10 = Vector::__add((Vector *)EVar26,&local_1318,pVVar10); pVVar16 = Entity::Position((Entity *)local_898,&local_1320); bVar5 = 0; pVVar10 = Vector::__sub(pVVar10,&local_1328,pVVar16); EVar26 = local_898; Entity::AddVelocity_divided((Entity *)local_898,pVVar10,bVar5); fVar24 = (float10)Scale((Entity_Tear *)EVar15); SetScale((Entity_Tear *)EVar26,(float)(fVar24 * (float10)0.5)); pcVar2 = *(code **)(*(int *)EVar26 + 0x3c); Entity::GetColor((Entity *)EVar15); outResult = (TypeDescriptor *)0xff; in_stack_ffffd9fc = (Vector *)0xffffffff; (*pcVar2)(); pBVar7 = BitSet128::__bnot(&g_tearFlagExplosive,&local_1fc8); pBVar7 = BitSet128::operator_and(&local_1fd8,(BitSet128 *)((int)EVar15 + 0x428),pBVar7); EVar26 = local_898; SetTearFlags((Entity_Tear *)local_898,*pBVar7); FUN_0044bfa0(); (**(code **)(*(int *)EVar26 + 0x40))(); normalize_angle_degrees((float)local_8cc + 90.0); FUN_004aadb0(); decayFactor = (float)((int)local_8ec + 1); local_8ec = decayFactor; fVar25 = (float)std::vector::size(local_9e0); EVar26 = (EntityPtr)((int)EVar15 + 0x33c); } while ((uint)decayFactor < (uint)fVar25); } if (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) { bVar5 = Entity::IsFamiliar((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)); if (bVar5 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); outResult = (TypeDescriptor *)local_d58; in_stack_ffffd9fc = (Vector *)0x67126f; EntityList::QueryRadius (entityList,(EntityList_EL *)outResult,(Vector *)((int)EVar15 + 0x33c),24.0,4); local_14 = CONCAT31(local_14._1_3_,10); local_8b0 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(); local_8cc = (EntityPtr)Entity::ToTear((Entity *)*puVar14); if ((local_8cc != (EntityPtr)0x0) && (local_8cc != EVar15)) { pBVar7 = BitSet128::operator_and (&local_1fe8,(BitSet128 *)((int)local_8cc + 0x428), &g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (cVar6 = is_not_familiar_spawned((Entity_Tear *)local_8cc), cVar6 != '\0')) { pVVar10 = Entity::Position((Entity *)local_8cc,&local_1330); outResult = (TypeDescriptor *)0x671317; Vector::__sub((Vector *)((int)EVar15 + 0x33c),&local_984,pVVar10); local_87c = (EntityPtr)Vector::Length(&local_984); if (24.0 <= (float)local_87c) { local_978 = local_894; } else { fVar25 = Vector::Length(&local_984); local_87c = (EntityPtr)(4.0 / (fVar25 + 1.0)); local_978 = local_87c; } bVar5 = Vector::operator_eq(&local_984,&g_vectorZero); if (bVar5 != 0) { pVVar10 = MusicManager::RandomVector(&local_1338); Vector::operator_assign(&local_984,pVVar10); } if ((float)local_894 < (float)local_978) { pVVar10 = Vector::Normalized(&local_984,&local_1340); bVar5 = 0; in_stack_ffffd9fc = (Vector *)0x6713d7; pVVar10 = Vector::__mul(pVVar10,&local_1348,(float *)&local_978); outResult = (TypeDescriptor *)0x6713df; Entity::AddVelocity_divided((Entity *)EVar15,pVVar10,bVar5); } } } local_8b0 = (EntityPtr)((int)local_8b0 + 1); EVar26 = (EntityPtr)EntityList::Size(); } while ((uint)local_8b0 < (uint)EVar26); } local_14 = CONCAT31(local_14._1_3_,9); EntityList_Query::~EntityList_Query(local_d58); } EVar26 = (EntityPtr)((int)EVar15 + 0x33c); pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_1350); local_87c = (EntityPtr)Vector::DistanceSquared(pVVar10,(Vector *)EVar26); if (local_888._0_1_ != '\0') { if ((float)local_87c <= 1600.0) { local_14 = 0xffffffff; *(float *)((int)EVar15 + 0x36c) = *(float *)((int)EVar15 + 0x36c) * 0.9; FID_conflict__Tidy(local_9e0); } else { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_1358); pVVar10 = Vector::__sub(pVVar10,&local_1360,(Vector *)EVar26); pVVar10 = Vector::Normalized(pVVar10,&local_1368); bVar5 = 0; local_afc = 0.1; in_stack_ffffd9fc = (Vector *)0x6714a7; pVVar10 = Vector::__mul(pVVar10,&local_1370,&local_afc); outResult = (TypeDescriptor *)0x6714af; Entity::AddVelocity_divided((Entity *)EVar15,pVVar10,bVar5); local_14 = 0xffffffff; FID_conflict__Tidy(local_9e0); } goto LAB_0067176f; } bVar5 = Entity::is_player((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc)); if (bVar5 != 0) { outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; in_stack_ffffd9fc = (Vector *)0x0; pEVar18 = (Entity_Player *)__RTDynamicCast(); bVar5 = Entity_Player::HasWeaponType(pEVar18,8); if (bVar5 == 0) { EVar26 = (EntityPtr)Entity::Child((Entity *)EVar15); while (EVar26 != (EntityPtr)0x0) { local_87c = (EntityPtr)Entity::Child((Entity *)EVar26); (**(code **)(*(int *)EVar26 + 0x28))(); EVar26 = local_87c; } } } } EVar26 = (EntityPtr)((int)EVar15 + 0x33c); local_14 = 0xffffffff; FID_conflict__Tidy(local_9e0); } } LAB_0067176f: Game::GetField26614(g_game); cVar6 = FUN_00429550(); if (cVar6 == '\0') { LAB_006717e1: local_8a1 = '\0'; } else { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar5 = PlayerManager::AnyoneHasCollectible(playerManager,0x1a7); if (bVar5 == 0) goto LAB_006717e1; outResult = (TypeDescriptor *)0x6717b0; RNG::game_constructor(&local_8c,*(int *)((int)EVar15 + 0x3ec),0x2c); local_14 = 0xb; local_8f8 = (EntityPtr)((uint)local_8f8 | 1); local_87c = local_8f8; uVar11 = RNG::RandomInt(playerEffects,100); local_8a1 = '\x01'; if (0x20 < uVar11) goto LAB_006717e1; } local_14 = 0xffffffff; if (((uint)local_8f8 & 1) != 0) { guard_check_icall(); } if (local_8a1 != '\0') { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); outResult = (TypeDescriptor *)0x3; in_stack_ffffd9fc = (Vector *)0x8; EntityList::QuerySublist(entityList,&local_d68,7,8,3,1,0); local_14 = 0xc; local_8f8 = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { while( true ) { std::vector::operator_index(); outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; in_stack_ffffd9fc = (Vector *)0x0; local_8cc = (EntityPtr)__RTDynamicCast(); local_888 = (EntityPtr)Entity::SpawnerEntity((Entity *)local_8cc); if ((local_888 != (EntityPtr)0x0) && (bVar5 = Entity::is_player((Entity *)local_888), bVar5 == 0)) { local_888 = (EntityPtr)0x0; } if (*(EntityPtr *)((int)EVar15 + 0x3c8) != local_888) { fVar24 = (float10)Entity_Laser::Radius((Entity_Laser *)local_8cc); local_87c = (EntityPtr)(float)fVar24; pVVar10 = Entity::Position((Entity *)local_8cc,&local_1398); local_8ac = (EntityPtr)Vector::DistanceSquared((Vector *)EVar26,pVVar10); if ((float)local_8ac < (float)local_87c * (float)local_87c) { (**(code **)(*(int *)EVar15 + 0x28))(); if (local_888 == (EntityPtr)0x0) { TearParams::constructor(local_878); } else { Isaac::Random(2); Entity_Player::GetTearHitParams(); } TearParams::copy(); uVar11 = Random(); pVVar10 = Vector::__unm((Vector *)((int)EVar15 + 0x360),&local_13a0); Game::Spawn(g_game,2,0,(Vector *)((int)EVar15 + 0x33c),pVVar10,(Entity *)local_888,0, uVar11); spawnedTear = (Entity_Tear *)__RTDynamicCast(); Entity_Projectile::SetHeight ((Entity_Projectile *)spawnedTear,*(float *)((int)EVar15 + 0x410)); FUN_00444c70(); (**(code **)(*(int *)spawnedTear + 0x40))(); SetTearFlags(spawnedTear,g_tearFlagHoming); SetScale(spawnedTear,local_28c); Entity_Projectile::set_falling_accel ((Entity_Projectile *)spawnedTear,((Vector *)((int)EVar15 + 0x418))->x); Color::Color(); outResult = (TypeDescriptor *)0x0; in_stack_ffffd9fc = (Vector *)0xff; (**(code **)(*(int *)spawnedTear + 0x3c))(); Entity::SetParent((Entity *)spawnedTear,(Entity *)local_888); (**(code **)(*(int *)spawnedTear + 0xc))(); } } EVar27 = (EntityPtr)((int)local_8f8 + 1); local_8f8 = EVar27; EVar26 = (EntityPtr)EntityList::Size(); if ((uint)EVar26 <= (uint)EVar27) break; EVar26 = (EntityPtr)((int)EVar15 + 0x33c); } } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_d68); } pVVar10 = (Vector *)((int)EVar15 + 0x420); pVVar10->x = (float)local_8dc * *(float *)((int)EVar15 + 0x424); local_b00 = 0x3c23d70a; local_8c0 = (EntityPtr)pVVar10; pfVar17 = (float *)std::max(); pVVar10->x = *pfVar17; ResetSpriteScale((Entity_Tear *)EVar15); if (*(int *)((int)EVar15 + 0x2c) == 0x2e) { pEVar28 = *(void **)((int)EVar15 + 0x454); local_8ac = (EntityPtr)pEVar28; if (*(EntityPtr *)((int)EVar15 + 0x3c8) != (EntityPtr)0x0) { local_87c = (EntityPtr)((float)pEVar28 * local_8f0); pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3c8),&local_13a8); local_8cc = (EntityPtr)Vector::Distance(pVVar10,(Vector *)((int)EVar15 + 0x33c)); pEVar28 = (Entity_Projectile *) assert_lerp_range((float)local_8cc,(float)local_894,160.0,(float)local_8ac, (float)local_87c,1); } *(Entity_Projectile **)((int)EVar15 + 0x388) = pEVar28; local_97c = Math::clamp((float)local_8d4,(float)local_8a8, *(float *)((int)EVar15 + 0x3a4) / (float)local_8fc); outResult = (TypeDescriptor *)0x671bef; pVVar10 = Vector::__mul(&g_vectorOne,&local_13b0,&local_97c); Sprite::SetScale((Sprite *)((int)EVar15 + 0x48),pVVar10); laser = (Font *)Sprite::Color((Sprite *)((int)EVar15 + 0x48)); fVar25 = Math::clamp((float)local_894,local_8f0, *(float *)((int)EVar15 + 0x3a4) / (float)local_8f4); Font::SetLineHeightModifier(laser,(float)local_8a8 - fVar25); local_b04 = 0x3f19999a; pfVar17 = (float *)std::max(); *(float *)((int)EVar15 + 0x370) = *(float *)((int)*(void **)((int)EVar15 + 0x330) + 0x38) * *pfVar17 * 5.0; } bVar5 = Game::IsInTimedSet(g_game,0x25); if (bVar5 != 0) { pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Color::Color(); (*pcVar2)(); outResult = (TypeDescriptor *)0x0; in_stack_ffffd9fc = (Vector *)0x3f800000; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)((int)EVar15 + 0x48),color); } local_b94.y = *(float *)((int)EVar15 + 0x340); EVar26 = (EntityPtr)((int)EVar15 + 0x33c); local_b94.x = *(float *)EVar26; Entity::Update((Entity *)EVar15); pBVar7 = BitSet128::operator_and (&local_2008,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c346d0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { if (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0) { pBVar7 = BitSet128::operator_and (&local_2018,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c346b0) ; bVar5 = BitSet128::IsNonZero(pBVar7); if (((bVar5 == 0) || (iVar8 = Entity::FrameCount((Entity *)EVar15), iVar8 < 1)) || ((0 < (int)*(float *)((int)EVar15 + 0x83c) && (iVar8 = Entity::GetIntervalTicks ((Entity *)EVar15,(float)(int)*(float *)((int)EVar15 + 0x83c), (float)local_894), iVar8 == 0)))) { local_8f4 = (Entity_Player *)((int)EVar15 + 0x360); pVVar10 = Vector::__add((Vector *)EVar26,&local_13b8,(Vector *)local_8f4); pVVar16 = (Vector *)FUN_004172b0(); Vector::__sub(pVVar10,&local_cc8,pVVar16); local_95c = Vector::Length(&local_cc8); if (local_95c != (float)local_894) { Vector::__div(&local_cc8,&local_c88,&local_95c); fVar25 = Vector::GetAngleDegrees(&local_c88); *(float *)((int)EVar15 + 0x840) = fVar25; Vector::operator__((Vector *)local_8f4,(Vector *)((int)EVar15 + 0x334)); bVar5 = 0; local_b08 = (50.0 - local_95c) * 0.1; pVVar10 = Vector::__mul(&local_c88,local_13c8,&local_b08); pVVar10 = vector_lerp(&local_13d0,(Vector *)local_8f4,pVVar10,bVar5,(float)local_8d4); pVVar16 = Entity::Velocity((Entity *)tear->_parent,&local_13d8); pVVar10 = Vector::__add(pVVar10,&local_13e0,pVVar16); Vector::operator_assign((Vector *)local_8f4,pVVar10); pVVar10 = Entity::Velocity((Entity *)tear->_parent,&local_13e8); Vector::operator_assign((Vector *)((int)EVar15 + 0x334),pVVar10); EVar15 = (EntityPtr)tear; } fVar25 = Math::lerp(*(float *)((int)EVar15 + 0x410),-23.0,local_900,0); *(float *)((int)EVar15 + 0x410) = fVar25; bVar5 = Entity::IsFrame((Entity *)EVar15,8,0); if (bVar5 != 0) { pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Color::Color(); Color::operator_assign(aCStackY_3c4c + 0x81,&tear->_color); FUN_004072e0(); (*pcVar2)(); } goto LAB_00673502; } } outResult = (TypeDescriptor *)Vector::FromAngle(&local_13f0,*(float *)((int)EVar15 + 0x840)); in_stack_ffffd9fc = (Vector *)0x67201c; pVVar10 = Vector::operator_mul(&local_13f8,(float *)((int)EVar15 + 0x838),(Vector *)outResult); Vector::operator_assign((Vector *)((int)EVar15 + 0x360),pVVar10); *(float *)((int)EVar15 + 0x840) = 0.015; } if (*(EntityPtr *)((int)EVar15 + 0x3c4) != (EntityPtr)0x0) { pBVar7 = BitSet128::operator_and (&local_2028,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34950); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { Vector::Normalized((Vector *)((int)EVar15 + 0x360),&local_958); pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3c4),&local_1400); pVVar10 = Vector::__sub(pVVar10,&local_1408,&local_b94); pVVar10 = Vector::__sub(pVVar10,&local_1410,(Vector *)((int)EVar15 + 0x360)); Vector::Normalized(pVVar10,&local_d88); local_8ac = (EntityPtr)Vector::Dot(&local_d88,&local_958); pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3c4),&local_1418); pVVar10 = Vector::__sub(pVVar10,&local_1420,(Vector *)EVar26); outResult = (TypeDescriptor *)0x672114; pVVar10 = Vector::__sub(pVVar10,&local_1428,(Vector *)((int)EVar15 + 0x360)); Vector::Normalized(pVVar10,&local_cd8); local_87c = (EntityPtr)Vector::Dot(&local_cd8,&local_958); if (((float)local_894 < (float)local_87c) || (((float)local_8ac <= (float)local_894 && ((float)local_87c < -0.1)))) { if (((float)local_87c < -0.1) && ((float)local_8ac < -0.1)) { pBVar7 = BitSet128::operator_and (&local_2048,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagHoming); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { Entity::SetTarget((Entity *)EVar15,(Entity *)0x0); } } } else { pVVar10 = Vector::Rotated(&local_958,&local_1430,90.0); Vector::operator_assign(&local_958,pVVar10); local_87c = (EntityPtr)Vector::Dot(&local_958,&local_cd8); if ((float)local_87c < (float)local_894) { local_b0c = &DAT_bf800000; Vector::operator_mul_assign(&local_958,(float *)&local_b0c); } local_b10 = Vector::Length((Vector *)((int)EVar15 + 0x360)); outResult = (TypeDescriptor *)0x672206; pVVar10 = Vector::__mul(&local_958,&local_1438,&local_b10); Vector::operator_assign((Vector *)((int)EVar15 + 0x360),pVVar10); BitSet128::__bnot((BitSet128 *)&DAT_00c34950,&local_2038); FUN_005cd430(); } } } pBVar7 = BitSet128::operator_and (&local_2058,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34930); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { pBVar7 = BitSet128::operator_and (&local_2068,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34a50); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) goto LAB_006722d8; pBVar7 = BitSet128::operator_and (&local_2078,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34630); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) goto LAB_006722d8; } else { LAB_006722d8: local_8b0 = (EntityPtr)((int)EVar15 + 0x478); if (*(void **)((int)EVar15 + 0x478) == (void *)0x0) { if (((*(int *)((int)EVar15 + 0x2c) == 0x1a) || (*(int *)((int)EVar15 + 0x2c) == 0x30)) && (bVar5 = ANM2::IsPlaying((ANM2 *)((int)EVar15 + 0x48),&s_empty), bVar5 == 0)) { pAVar21 = (ANM2 *)Config::GetPillEffects(); ANM2::GetAnimation(pAVar21,(std_string *)(local_1d8 + 0x2c)); local_14 = 0x10; Sprite::Play(); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_1d8 + 0x2c); } } else { cVar6 = Entity::Visible(); if ((cVar6 == '\0') || (iVar8 = Entity::EntityCollisionClass(*(void **)((int)EVar15 + 0x478)), iVar8 == 0)) { EntityPtr::SetReference((EntityPtr *)((int)EVar15 + 0x478),(Entity *)0x0); std::vector::clear((uint *)((int)EVar15 + 0x444),0); if ((*(int *)((int)EVar15 + 0x2c) == 0x1a) || (*(int *)((int)EVar15 + 0x2c) == 0x30)) { pAVar21 = (ANM2 *)Config::GetPillEffects(); ANM2::GetAnimation(pAVar21,&local_194); local_14 = 0xd; outResult = (TypeDescriptor *)0x6723d6; Sprite::Play(); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_194._buf); } } else { pVVar10 = Entity::Velocity(*(void **)((int)EVar15 + 0x478),&local_1440); Vector::operator_assign((Vector *)((int)EVar15 + 0x360),pVVar10); pVVar10 = Entity::Position(*(void **)((int)EVar15 + 0x478),&local_1448); outResult = (TypeDescriptor *)0x672353; pVVar10 = Vector::__add(pVVar10,&local_1450,(Vector *)((int)EVar15 + 0x47c)); Vector::operator_assign((Vector *)EVar26,pVVar10); if (((*(int *)((int)EVar15 + 0x2c) == 0x1a) || (*(int *)((int)EVar15 + 0x2c) == 0x30)) && (bVar5 = ANM2::IsPlaying((ANM2 *)((int)EVar15 + 0x48),&s_empty), bVar5 != 0)) { Sprite::Stop((Sprite *)((int)EVar15 + 0x48)); } } *(int *)((int)EVar15 + 0x484) = *(int *)((int)EVar15 + 0x484) + -1; if (*(int *)((int)EVar15 + 0x484) < 1) { *(byte *)((int)EVar15 + 0x173) = 1; *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 0x40); ((Vector *)((int)EVar15 + 0x420))->x = (float)local_8b4 * *(float *)((int)EVar15 + 0x424); local_b14 = 0x3c23d70a; pfVar17 = (float *)std::max(); ((Vector *)((int)EVar15 + 0x420))->x = *pfVar17; ResetSpriteScale((Entity_Tear *)EVar15); pBVar7 = BitSet128::operator_and (&local_2088,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34930); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { uVar34 = 0x83; uVar35 = 0x24; uVar36 = 0x67; BitSet128::operator__(); *(void **)((int)EVar15 + 0x474) = (void *)((uint)*(void **)((int)EVar15 + 0x474) | 0x20); *(float *)((int)EVar15 + 0x388) = *(float *)((int)EVar15 + 0x388) + 60.0; local_8f4 = (Entity_Player *)GetRootPlayer((Entity_Tear *)EVar15); if (local_8f4 != (Entity_Player *)0x0) { uVar37 = 0; FUN_00435bc0(); Entity_Player::GetBombVariant(); FUN_00435bc0(); tearFlags._l._4_4_ = (EntityPtr)outResult; tearFlags._l._0_4_ = (EntityPtr)in_stack_ffffd9fc; tearFlags._h._0_1_ = uVar34; tearFlags._h._1_1_ = uVar35; tearFlags._h._2_2_ = uVar36; tearFlags._h._4_4_ = uVar37; fVar25 = Entity_Player::check_bomb_tearflags(local_8f4,tearFlags); if (1.5 <= fVar25) { *(float *)((int)EVar15 + 0x388) = *(float *)((int)EVar15 + 0x388) + 50.0; } } } pBVar7 = BitSet128::operator_and (&local_2098,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34630); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { EVar26 = (EntityPtr)GetRootPlayer((Entity_Tear *)EVar15); color = (ColorMod *)Color::Color(); EVar27 = EVar15; if (EVar26 != (EntityPtr)0x0) { EVar27 = EVar26; } EVar26 = (EntityPtr)((int)EVar15 + 0x33c); Game::Fart(g_game,(Vector *)EVar26,85.0,(Entity *)EVar27,1.0,0,color); if (*(void **)((int)EVar15 + 0x478) != (void *)0x0) { bVar5 = Entity::HasEntityFlags((Entity *)EVar15,0x80000000000); if (bVar5 == 0) { iVar8 = Isaac::Random(3); local_8ec = (float)(iVar8 + 2); } else { local_8ec = (float)Isaac::Random(2); } fVar25 = random_float(); local_87c = (EntityPtr)(fVar25 * 360.0); FUN_00424510(); local_14 = 0xe; FUN_00431620(); Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,&local_d78,(Vector *)EVar26,200.0,8); local_14 = CONCAT31(local_14._1_3_,0xf); local_8f8 = (EntityPtr)0x0; if (0 < (int)local_8ec) { local_8e0 = (Entity_Player *)((int)EVar15 + 0x360); do { fVar25 = local_8ec; decayFactor = random_float(); Vector::FromAngle(&local_b8c, ((decayFactor * 0.8 + ((float)(int)local_8f8 - local_900)) * 360.0 ) / (float)(int)fVar25 + (float)local_87c); local_8fc = (EntityPtr)0x0; local_8f4 = (Entity_Player *)0x4e6e6b28; local_8ac = (EntityPtr)0x0; iVar8 = EntityList::Size(); if (iVar8 != 0) { EVar15 = local_8ac; do { pEVar20 = (EntityPtr *)std::vector::operator_index(); EVar26 = *pEVar20; local_8cc = EVar26; bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar26,(Entity *)0x0); if (((bVar5 != 0) && (bVar5 = Entity::HasEntityFlags((Entity *)EVar26,0x20000000), bVar5 == 0)) && (bVar5 = EntityList::HitListContains ((EntityList *)local_c80,(Entity *)EVar26), bVar5 == 0) ) { local_b18 = 200.0; pVVar10 = Vector::operator_mul(&local_1458,&local_b18,&local_b8c); pVVar10 = Vector::__add((Vector *)local_8e8,&local_1460,pVVar10); pVVar16 = Entity::Position((Entity *)local_8cc,&local_1468); local_8ac = (EntityPtr)Vector::DistanceSquared(pVVar10,pVVar16); if ((float)local_8ac < (float)local_8f4) { local_8fc = local_8cc; local_8f4 = (Entity_Player *)local_8ac; } } EVar26 = local_8fc; EVar15 = (EntityPtr)((int)EVar15 + 1); fVar25 = (float)EntityList::Size(); spawnedTear = tear; } while ((uint)EVar15 < (uint)fVar25); if (EVar26 != (EntityPtr)0x0) { FUN_00431620(); pVVar10 = (Vector *)FUN_006b6e40(); pVVar10 = Vector::__sub(pVVar10,local_1478,&spawnedTear->_pos); pVVar10 = Vector::Normalized(pVVar10,&local_1480); Vector::operator_assign(&local_b8c,pVVar10); } } uVar11 = Random(); local_8ac = tear->_spawnerEntity; fVar25 = random_float(); local_b1c = fVar25 * 4.0 + 8.0; pVVar10 = Vector::__mul(&local_b8c,&local_1488,&local_b1c); pVVar16 = Vector::__sub((Vector *)local_8e8,&local_1490,(Vector *)local_8e0); local_8d0 = (EntityPtr) Game::Spawn(g_game,tear->_type,tear->_variant,pVVar16,pVVar10, (Entity *)local_8ac,0,uVar11); Entity_Projectile::SetHeight((Entity_Projectile *)local_8d0,-23.75); local_8cc = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c345e0,&local_20a8); local_8f4 = (Entity_Player *) BitSet128::__bnot((BitSet128 *)&DAT_00c345c0,&local_20b8); local_8ac = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c348f0,&local_20c8); pBVar7 = BitSet128::__bnot(&g_tearFlagLudovico,&local_20d8); pBVar9 = BitSet128::__bnot((BitSet128 *)&DAT_00c34850,&local_20e8); pBVar32 = BitSet128::__bnot((BitSet128 *)&DAT_00c34880,&local_20f8); pBVar32 = BitSet128::operator_and(&local_2108,tearFlagsPtr,pBVar32); pBVar9 = BitSet128::operator_and(&local_2118,pBVar32,pBVar9); pBVar7 = BitSet128::operator_and(&local_2128,pBVar9,pBVar7); pBVar7 = BitSet128::operator_and(&local_2138,pBVar7,(BitSet128 *)local_8ac); pBVar7 = BitSet128::operator_and(&local_2148,pBVar7,(BitSet128 *)local_8f4); BitSet128::operator_and(&local_e28,pBVar7,(BitSet128 *)local_8cc); pBVar9 = &g_tearFlagHoming; pBVar7 = BitSet128::operator_or (&local_2158,(BitSet128 *)&DAT_00c34b50,&g_tearFlagSpectral); BitSet128::operator_or(&local_2168,pBVar7,pBVar9); BitSet128::operator__(); EVar15 = local_8d0; flags_02._l._4_4_ = local_e28._l._4_4_; flags_02._l._0_4_ = (undefined4)local_e28._l; flags_02._h._0_1_ = (char)(undefined4)local_e28._h; flags_02._h._1_1_ = (char)((uint)(undefined4)local_e28._h >> 8); flags_02._h._2_2_ = (short)((uint)(undefined4)local_e28._h >> 0x10); flags_02._h._4_4_ = local_e28._h._4_4_; SetTearFlags((Entity_Tear *)local_8d0,flags_02); SetScale((Entity_Tear *)EVar15,*(float *)local_8c0 * 0.2); pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Sprite::Color((Sprite *)local_8a0); (*pcVar2)(); Entity::SetParent((Entity *)EVar15,(Entity *)tear->_parent); FUN_00431620(); Entity::AddEntityFlags((Entity *)EVar15,0x80000000000); (**(code **)(*(int *)EVar15 + 0xc))(); local_8f8 = (EntityPtr)((int)local_8f8 + 1); } while ((int)local_8f8 < (int)local_8ec); EVar26 = local_8e8; EVar15 = (EntityPtr)tear; } EntityList_Query::~EntityList_Query(&local_d78); local_14 = 0xffffffff; FID_conflict__Tidy(local_c80); } } } } } pBVar7 = BitSet128::operator_and (&local_2178,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34a50); bVar5 = BitSet128::IsNonZero(pBVar7); if (((bVar5 != 0) && (bVar5 = Entity::IsFrame((Entity *)EVar15,0x1e,*(int *)((int)EVar15 + 0x20)), bVar5 != 0)) && ((*(void **)((int)EVar15 + 0x478) != (Entity *)0x0 && (bVar5 = Entity::IsVulnerableEnemy(*(void **)((int)EVar15 + 0x478),(Entity *)0x0), bVar5 != 0) ))) { FUN_00665a90(); } pBVar7 = BitSet128::operator_and (&local_2188,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (cVar6 = is_not_familiar_spawned((Entity_Tear *)EVar15), cVar6 != '\0')) { pBVar7 = BitSet128::operator_and (&local_2198,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c348d0); bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar10 = Room::GetClampedPosition(room,&local_1498,(Vector *)EVar26,0.0); Vector::operator_assign((Vector *)EVar26,pVVar10); } } pBVar7 = BitSet128::operator_and (&local_21a8,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c346c0); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && ((((int)*(float *)((int)EVar15 + 0x83c) < 1 || (iVar8 = Entity::GetIntervalTicks ((Entity *)EVar15,(float)(int)*(float *)((int)EVar15 + 0x83c), (float)local_894), iVar8 != 0)) && (iVar8 = Entity::FrameCount((Entity *)EVar15), 0 < iVar8)))) { Vector::Resize((Vector *)((int)EVar15 + 0x360),*(float *)((int)EVar15 + 0x838)); local_1560._l._0_4_ = _DAT_00c346b0; local_1560._l._4_4_ = uRam00c346b4; local_1560._h._0_4_ = uRam00c346b8; local_1560._h._4_4_ = uRam00c346bc; pBVar7 = BitSet128::operator_and(&local_21b8,(BitSet128 *)((int)EVar15 + 0x828),&local_1560); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) { local_1570._l._0_4_ = _DAT_00c346c0; local_1570._l._4_4_ = uRam00c346c4; local_1570._h._0_4_ = uRam00c346c8; local_1570._h._4_4_ = uRam00c346cc; pBVar7 = BitSet128::operator_and(&local_21c8,(BitSet128 *)((int)EVar15 + 0x828),&local_1570); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 != 0) goto LAB_00672d53; } pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c346c0,&local_21d8); pBVar7 = BitSet128::operator_and(&local_21e8,(BitSet128 *)((int)EVar15 + 0x428),pBVar7); uVar11 = *(uint *)((int)&pBVar7->_l + 4); qVar3 = pBVar7->_h; iVar8 = *(int *)((int)&pBVar7->_h + 4); *(int *)((int)EVar15 + 0x428) = (int)pBVar7->_l; *(uint *)((int)EVar15 + 0x42c) = uVar11; *(uint *)((int)EVar15 + 0x430) = (uint)qVar3; *(int *)((std_string *)((int)EVar15 + 0x434))->_buf = iVar8; } LAB_00672d53: pBVar7 = BitSet128::operator_and (&local_21f8,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c346b0); bVar5 = BitSet128::IsNonZero(pBVar7); if (((bVar5 != 0) && (iVar8 = Entity::FrameCount((Entity *)EVar15), 0 < iVar8)) && (((int)*(float *)((int)EVar15 + 0x83c) < 1 || (iVar8 = Entity::GetIntervalTicks ((Entity *)EVar15,(float)(int)*(float *)((int)EVar15 + 0x83c), (float)local_894), iVar8 != 0)))) { BitSet128::IsNonZero((BitSet128 *)((int)EVar15 + 0x428)); fVar25 = ((ColorMod *)((int)EVar15 + 0x82c))->_tint[0]; *(float *)((int)EVar15 + 0x428) = *(float *)((int)EVar15 + 0x828); *(float *)((int)EVar15 + 0x42c) = fVar25; *(float *)((int)EVar15 + 0x430) = *(float *)((int)EVar15 + 0x830); *(float *)((std_string *)((int)EVar15 + 0x434))->_buf = *(float *)((int)EVar15 + 0x834); FUN_00435bc0(); *(float *)((int)EVar15 + 0x828) = local_1580; ((ColorMod *)((int)EVar15 + 0x82c))->_tint[0] = fStack_157c; *(float *)((int)EVar15 + 0x830) = fStack_1578; *(float *)((int)EVar15 + 0x834) = fStack_1574; } pVVar10 = Vector::__sub((Vector *)EVar26,&local_14a0,&local_b94); Vector::operator_assign((Vector *)((int)EVar15 + 0x7ec),pVVar10); if (*(int *)((int)EVar15 + 0x438) < 1) { pBVar7 = BitSet128::operator_and (&local_2208,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if (((bVar5 != 0) && (*(byte *)((int)EVar15 + 0x173) == 0)) && (*(void **)((int)EVar15 + 0x478) == (void *)0x0)) { pBVar7 = BitSet128::operator_and (&local_2218,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34810) ; bVar5 = BitSet128::IsZero(pBVar7); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and (&local_2228,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c345b0); bVar5 = BitSet128::IsZero(pBVar7); if (((bVar5 != 0) || (8 < *(short *)&((AnimationState *)((int)EVar15 + 0x46c))->_animation)) || (local_87c = (EntityPtr)Vector::LengthSquared((Vector *)((int)EVar15 + 0x360)), (float)local_87c < 0.01)) { pBVar7 = BitSet128::operator_and (&local_2238,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34780); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { decayFactor = Math::timescale_factor(0.9,*(float *)((int)EVar15 + 0x39c)); fVar25 = *(float *)((int)EVar15 + 0x39c); EVar27 = (EntityPtr) (fVar25 * 0.1 + decayFactor * (float)((NPCAI_Pathfinder *)((int)EVar15 + 0x414))->_entity + fVar25 * ((Vector *)((int)EVar15 + 0x418))->x); } else if (*(float *)((int)EVar15 + 0x3a4) <= *(float *)((int)EVar15 + 0x820) * (float)local_904) { fVar25 = *(float *)((int)EVar15 + 0x39c); EVar27 = local_894; } else { local_b20 = ((Vector *)((int)EVar15 + 0x418))->x + 0.2; local_b24 = 0; local_87c = (EntityPtr)((NPCAI_Pathfinder *)((int)EVar15 + 0x414))->_entity; fVar25 = Math::timescale_factor(0.9,*(float *)((int)EVar15 + 0x39c)); local_87c = (EntityPtr)(fVar25 * (float)local_87c); pfVar17 = (float *)std::max(); fVar25 = *(float *)((int)EVar15 + 0x39c); EVar27 = (EntityPtr)(fVar25 * *pfVar17 + (float)local_87c); } *(EntityPtr *)((int)EVar15 + 0x414) = EVar27; Entity_Projectile::SetHeight ((Entity_Projectile *)EVar15, fVar25 * (float)EVar27 + *(float *)((int)EVar15 + 0x410)); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and (&local_2248,(BitSet128 *)((int)EVar15 + 0x428), (BitSet128 *)&DAT_00c34780); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { fVar25 = ((Vector *)((int)EVar15 + 0x418))->x; if (fVar25 < 0.001) { if (*(float *)((int)EVar15 + 0x410) <= (float)local_8e4) goto LAB_0067308c; fVar25 = *(float *)((int)EVar15 + 0x364) + (float)local_8b8; } else { fVar25 = fVar25 + *(float *)((int)EVar15 + 0x364); } *(float *)((int)EVar15 + 0x364) = fVar25; } LAB_0067308c: room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::IsBeastDungeon(room); if (((bVar5 != 0) && (iVar8 = Entity::FrameCount((Entity *)EVar15), 2 < iVar8)) && (fVar25 = *(float *)((int)EVar15 + 0x364), (float)local_894 < fVar25)) { Level::GetCurrentRoom((Level *)g_game); Room::get_lava_line_y(); if (fVar25 < *(float *)((int)EVar15 + 0x340)) { pBVar7 = BitSet128::operator_and (&local_2258,(BitSet128 *)((int)EVar15 + 0x428), &g_tearFlagExplosive); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) { (**(code **)(*(int *)EVar15 + 0x28))(); uVar11 = Random(); familiar = Game::Spawn(g_game,1000,0x10,(Vector *)EVar26,&g_vectorZero, (Entity *)0x0,0x42,uVar11); (**(code **)(*(int *)familiar + 0xc))(); } else { *(byte *)((int)EVar15 + 0x173) = 1; } } } } } } } } room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(room); if (bVar5 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::IsPositionInRoom(room,(Vector *)EVar26,-256.0); if (bVar5 == 0) { (**(code **)(*(int *)EVar15 + 0x28))(); } } pBVar7 = BitSet128::operator_and (&local_2268,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c348d0); bVar5 = BitSet128::IsNonZero(pBVar7); if (bVar5 == 0) goto LAB_006734ab; pBVar7 = BitSet128::operator_and (&local_2278,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsZero(pBVar7); if ((bVar5 == 0) && (cVar6 = is_not_familiar_spawned((Entity_Tear *)EVar15), cVar6 == '\0')) goto LAB_006734ab; Level::GetCurrentRoom((Level *)g_game); Room::ScreenWrapPosition(); Vector::__sub(&local_9d4,&local_d90,(Vector *)EVar26); bVar5 = Vector::operator_ne((Vector *)EVar26,&local_9d4); if (bVar5 != 0) { pBVar7 = BitSet128::operator_and (&local_2288,(BitSet128 *)((int)EVar15 + 0x428),(BitSet128 *)&DAT_00c34580); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (*(EntityPtr *)((int)EVar15 + 0x3bc) != (EntityPtr)0x0)) { pVVar10 = Entity::Position((Entity *)*(EntityPtr *)((int)EVar15 + 0x3bc),&local_14a8); Vector::operator_assign(&local_9d4,pVVar10); } } Vector::operator_assign((Vector *)EVar26,&local_9d4); pBVar7 = BitSet128::operator_and (&local_2298,(BitSet128 *)((int)EVar15 + 0x428),&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(pBVar7); if ((bVar5 != 0) && (cVar6 = is_not_familiar_spawned((Entity_Tear *)EVar15), cVar6 != '\0')) { for (EVar26 = *(EntityPtr *)((int)EVar15 + 0x3c0); EVar26 != (EntityPtr)0x0; EVar26 = (EntityPtr)Entity::Child((Entity *)EVar26)) { pVVar10 = Entity::Position((Entity *)EVar26,&local_14b0); pVVar10 = Vector::__add(pVVar10,&local_14b8,&local_d90); Entity::SetPosition((Entity *)EVar26,pVVar10); } } bVar5 = Entity::IsFrame((Entity *)EVar15,2,*(int *)((int)EVar15 + 0x20)); if (bVar5 == 0) goto LAB_006734ab; iVar8 = Entity::FrameCount((Entity *)EVar15); Color::Color((Color *)(local_7c + 0x2c)); switch((iVar8 / 2) % 9) { case 0: fVar25 = 0.33; goto LAB_00673484; case 1: fVar25 = 0.66; goto LAB_00673484; case 2: fVar25 = 1.0; goto LAB_00673484; case 3: uVar34 = 0xc3; uVar35 = 0xf5; uVar36 = 0x3f28; fVar25 = 0.66; decayFactor = 0.66; break; case 4: uVar34 = 0xc3; uVar35 = 0xf5; uVar36 = 0x3ea8; fVar25 = 0.33; decayFactor = 0.33; break; case 5: Color::SetTint((Color *)(local_7c + 0x2c),0.0,0.0,0.0,1.0); goto LAB_00673493; case 6: uVar34 = 0xc3; uVar35 = 0xf5; uVar36 = 0x3ea8; fVar25 = 0.0; decayFactor = 0.33; break; case 7: uVar34 = 0xc3; uVar35 = 0xf5; uVar36 = 0x3f28; fVar25 = 0.0; decayFactor = 0.66; break; case 8: fVar25 = 0.0; LAB_00673484: uVar36 = 0x3f80; uVar35 = 0; uVar34 = 0; decayFactor = 1.0; break; default: goto LAB_00673493; } Color::SetColorize((Color *)(local_7c + 0x2c),decayFactor,fVar25, (float)CONCAT22(uVar36,CONCAT11(uVar35,uVar34)),1.0); LAB_00673493: (**(code **)(*(int *)EVar15 + 0x3c))(); LAB_006734ab: room = (Room *)Level::GetCurrentRoom((Level *)g_game); cVar6 = Room::HasSlowDown(room); if (cVar6 != '\0') { pcVar2 = *(code **)(*(int *)EVar15 + 0x3c); Color::Color(); (*pcVar2)(); } LAB_00673502: FUN_00862aa0(); ExceptionList = local_1c; return; } //@@ 00673660 Entity_Tear::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [vtable slot 23] */ undefined4 __thiscall Entity_Tear::HandleCollision(Entity_Tear *this,EntityPtr param_2,byte param_3) { qword *pqVar1; uint *puVar2; int iVar3; qword qVar4; qword qVar5; byte bVar6; char cVar7; int iVar8; BitSet128 *pBVar9; Vector *pVVar10; uint uVar11; Entity_NPC *npcCollider; Entity *pEVar12; Entity_Player *player; RNG *trinketRng; ItemConfig_Item *costumeItem; void *pvVar13; ColorMod *other; Vector *pVVar14; int unusedArg; int extraout_ECX; char extraout_DL; code *pcVar15; Entity_Tear *pEVar16; EntityPtr EVar17; uint uVar18; float fVar19; float fVar20; undefined1 *scale; Color aCStackY_1834 [128]; BitSet128 *pBVar21; BitSet128 *b; BitSet128 *b_00; BitSet128 *b_01; BitSet128 *b_02; BitSet128 *b_03; BitSet128 *b_04; BitSet128 BStack_1a0; BitSet128 BStack_190; BitSet128 BStack_180; BitSet128 BStack_170; undefined1 auStack_160 [8]; Vector VStack_158; Vector VStack_150; undefined1 auStack_148 [8]; Vector VStack_140; undefined1 auStack_138 [8]; Vector VStack_130; BitSet128 BStack_128; EntityPtr EStack_114; EntityPtr EStack_110; float fStack_10c; char isExplosive; Entity_Tear *tear; char cStack_fd; Entity_Tear *pEStack_fc; float fStack_ac; Color CStack_90; undefined1 auStack_64 [8]; float fStack_5c; float fStack_58; float fStack_54; float fStack_50; float fStack_4c; float fStack_48; float fStack_44; float fStack_40; float fStack_3c; undefined1 auStack_38 [12]; Entity_Tear *pEStack_2c; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; void *collectibles; Game *game; puStack_20 = auStack_38 + 0x34; uStack_14 = 0xffffffff; puStack_18 = &UNK_00af78fd; pvStack_1c = ExceptionList; uStack_24 = __security_cookie ^ (uint)(auStack_38 + 0x28); ExceptionList = &pvStack_1c; EStack_114 = param_2; tear = this; iVar8 = LuaEngine::PreTearCollision((LuaEngine *)this,this,(Entity *)param_2,param_3); if (iVar8 == 1) { ExceptionList = pvStack_1c; return 1; } if (iVar8 == -1) { ExceptionList = pvStack_1c; return 0; } VStack_150.y = (float)&this->_tearFlags; pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_38,(BitSet128 *)VStack_150.y,&g_tearFlagExplosive); if (((((int)pBVar9->_l == 0 && *(int *)((int)&pBVar9->_l + 4) == 0) && ((int)pBVar9->_h == 0 && *(int *)((int)&pBVar9->_h + 4) == 0)) || (pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_138,&this->_tearFlags,&g_tearFlagLudovico), (int)pBVar9->_l != 0 || *(int *)((int)&pBVar9->_l + 4) != 0)) || (isExplosive = '\x01', (int)pBVar9->_h != 0 || *(int *)((int)&pBVar9->_h + 4) != 0)) { isExplosive = '\0'; } if (param_3 == 0) { ExceptionList = pvStack_1c; return 0; } if (this->_dead != 0) { ExceptionList = pvStack_1c; return 0; } EStack_110 = (EntityPtr)Entity::GetPlayerAncestor((Entity *)this); if (EStack_110 == param_2) { ExceptionList = pvStack_1c; return 1; } iVar8 = *(int *)((int)param_2 + 0x28); if (iVar8 == 1) { bVar6 = Entity::IsDescendantOf((Entity *)this,(Entity *)param_2); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } if (((this->_spawnerEntity != (EntityPtr)0x0) && (bVar6 = Entity::HasEntityFlags((Entity *)this->_spawnerEntity,0x100), bVar6 != 0)) && ((pEVar12 = *(Entity **)((int)this->_spawnerEntity + 0x264), pEVar12 != (Entity *)0x0 && (bVar6 = Entity::IsDescendantOf(pEVar12,(Entity *)param_2), bVar6 != 0)))) { pVVar10 = MusicManager::RandomVector((Vector *)(auStack_38 + 8)); pEVar16 = tear; fVar20 = (tear->_velocity).y; fVar19 = (tear->_velocity).x; fVar19 = sqrtf(fVar19 * fVar19 + fVar20 * fVar20); fVar20 = pVVar10->x; (pEVar16->_velocity).y = fVar19 * pVVar10->y; (pEVar16->_velocity).x = fVar19 * fVar20; ExceptionList = pvStack_1c; return 1; } VStack_158.y = (float)((uint)(1 < *(int *)&g_game->_deathmatchManager) * 2 + 2); bVar6 = Entity_Player::HasCollectible((Entity_Player *)param_2,0xf2,0); if ((bVar6 != 0) && (iVar8 = Isaac::Random((int)VStack_158.y), iVar8 == 0)) { fStack_44 = 0.2509804; fStack_54 = 0.0; fStack_50 = 0.0; fStack_4c = 0.0; fStack_48 = 0.0; auStack_64._0_4_ = 1.0; auStack_64._4_4_ = 1.0; fStack_5c = 1.0; fStack_58 = 1.0; fStack_40 = 0.2509804; fStack_3c = 0.5019608; (**(code **)(*(int *)param_2 + 0x3c))(); pcVar15 = *(code **)(*(int *)this + 0x24); EntityRef::constructor((EntityRef *)(auStack_64 + 4),(Entity *)param_2); (*pcVar15)(); ExceptionList = pvStack_1c; return 1; } iVar8 = *(int *)((int)param_2 + 0x28); } if (iVar8 == 2) { if (this->_spawnerEntity == *(EntityPtr *)((int)param_2 + 0x3c8)) { ExceptionList = pvStack_1c; return 1; } auStack_38._0_4_ = SUB84((this->_tearFlags)._l,0); auStack_38._4_8_ = *(undefined8 *)((int)&(this->_tearFlags)._l + 4); pEStack_2c = *(Entity_Tear **)((int)&(this->_tearFlags)._h + 4); pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_138,(BitSet128 *)auStack_38,(BitSet128 *)&DAT_00c34c60) ; bVar6 = BitSet128::IsZero(pBVar9); if (bVar6 != 0) { auStack_38._0_4_ = *(int *)((int)param_2 + 0x428); auStack_38._4_8_ = *(undefined8 *)((int)param_2 + 0x42c); pEStack_2c = *(Entity_Tear **)((int)param_2 + 0x434); pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_138,(BitSet128 *)auStack_38, (BitSet128 *)&DAT_00c34c60); bVar6 = BitSet128::IsZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } auStack_38._0_4_ = SUB84((this->_tearFlags)._l,0); auStack_38._4_8_ = *(undefined8 *)((int)&(this->_tearFlags)._l + 4); pEStack_2c = *(Entity_Tear **)((int)&(this->_tearFlags)._h + 4); pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_138,(BitSet128 *)auStack_38,(BitSet128 *)&DAT_00c34c60) ; bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { pcVar15 = *(code **)(*(int *)this + 0x24); EntityRef::constructor((EntityRef *)(auStack_64 + 4),(Entity *)param_2); } else { pcVar15 = *(code **)(*(int *)param_2 + 0x24); EntityRef::constructor((EntityRef *)(auStack_64 + 4),(Entity *)tear); } (*pcVar15)(); this = tear; } if ((*(int *)((int)param_2 + 0x28) == 3) && (bVar6 = Entity::IsDescendantOf((Entity *)param_2,(Entity *)EStack_110), bVar6 != 0)) { ExceptionList = pvStack_1c; return 1; } if (*(int *)((int)param_2 + 0x28) == 0x362) { ExceptionList = pvStack_1c; return 1; } bVar6 = Entity::IsEnemy((Entity *)param_2); if ((bVar6 != 0) && (bVar6 = Entity::HasEntityFlags((Entity *)param_2,0x20000000), bVar6 != 0)) { EntityRef::constructor((EntityRef *)(auStack_64 + 4),(Entity *)this); bVar6 = Entity::IsDamageSourceFriendly((Entity *)param_2,(EntityRef *)(auStack_64 + 4)); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } iVar8 = *(int *)((int)param_2 + 0x28); if (iVar8 == 0x3c3) { if (param_2 == this->_spawnerEntity) { ExceptionList = pvStack_1c; return 0; } } else { if (iVar8 == 4) { bVar6 = Entity_Bomb::IsRocket((Entity_Bomb *)param_2); } else { if (iVar8 != 3) goto LAB_00673a48; bVar6 = Entity::IsDescendantOf((Entity *)param_2,(Entity *)this->_spawnerEntity); } if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } LAB_00673a48: if (this->_variant == 9) { iVar8 = *(int *)((int)param_2 + 0x28); if (iVar8 == 0x3c0) { ExceptionList = pvStack_1c; return 1; } if ((iVar8 == 0x3b6) || (iVar8 == 0x3b7)) { if (*(int *)((int)param_2 + 0x2c) == 0) { ExceptionList = pvStack_1c; return 1; } } else if (iVar8 == 0x19c) { (**(code **)(*(int *)this + 0x28))(); *(uint *)((int)param_2 + 0xbe0) = *(uint *)((int)param_2 + 0xbe0) & 0xffff807f | 0x7f80; *(undefined4 *)((int)param_2 + 0xbe4) = 0; ExceptionList = pvStack_1c; return 1; } bVar6 = Entity::IsEnemy((Entity *)param_2); if (bVar6 != 0) { pcVar15 = *(code **)(*(int *)param_2 + 0x24); EntityRef::constructor((EntityRef *)(auStack_64 + 4),(Entity *)tear); (*pcVar15)(); if (*(int *)((int)param_2 + 0x28) == 0x38b) { (**(code **)(*(int *)tear + 0x28))(); ExceptionList = pvStack_1c; return 1; } ExceptionList = pvStack_1c; return 1; } } if (*(int *)((int)param_2 + 0x28) == 0x197) { bVar6 = *(byte *)((int)param_2 + 0x3b0); joined_r0x00673c0b: if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } else if (*(int *)((int)param_2 + 0x28) == 4) { pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34810); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34600); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } if (((*(float *)((int)param_2 + 0x340) - (this->_pos).y) * (this->_velocity).y + (*(float *)((int)param_2 + 0x33c) - (this->_pos).x) * (this->_velocity).x < 0.0) && (g_game->_frameCount - this->_spawnFrame < 3)) { ExceptionList = pvStack_1c; return 1; } iVar8 = __RTDynamicCast(); if ((iVar8 != 0) && (*(char *)(iVar8 + 0x448) != '\0')) { if (this->_spawnerType != 1) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34780); bVar6 = BitSet128::IsNonZero(pBVar9); goto joined_r0x00673c0b; } } iVar8 = *(int *)((int)param_2 + 0x28); if (iVar8 == 0x123) { ExceptionList = pvStack_1c; return 1; } if (iVar8 == 0x19b) { if (*(char *)((int)param_2 + 0x3b0) != '\0') { ExceptionList = pvStack_1c; return 1; } } else if ((iVar8 == 3) && (*(int *)((int)param_2 + 0x2c) == 0xef)) { bVar6 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)param_2); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } uVar11 = Entity::GetHitListIndex((Entity *)param_2); sorted_vector_insert_unique(&this->_hitList,uVar11); VStack_150.y = *(float *)((int)param_2 + 0x340) - (this->_pos).y; VStack_150.x = *(float *)((int)param_2 + 0x33c) - (this->_pos).x; EStack_110 = (EntityPtr)VStack_150.x; pEStack_fc = (Entity_Tear *)VStack_150.y; fStack_10c = sqrtf(VStack_150.y * VStack_150.y + VStack_150.x * VStack_150.x); if (0.0001 <= fStack_10c) { VStack_158.y = (this->_velocity).y - *(float *)((int)param_2 + 0x364); VStack_140.y = (this->_velocity).x - *(float *)((int)param_2 + 0x360); VStack_130.y = VStack_158.y; VStack_130.x = VStack_140.y; EStack_114 = (EntityPtr)(VStack_158.y * VStack_158.y + VStack_140.y * VStack_140.y); fVar20 = sqrtf((float)EStack_114); if (((*(float *)((int)param_2 + 0x370) + this->_size) * 0.5 < fVar20) && (VStack_158.y * (float)pEStack_fc + VStack_140.y * (float)EStack_110 < 0.0)) { pVVar10 = Vector::Normalized(&VStack_130,(Vector *)(auStack_38 + 8)); pVVar14 = Vector::Normalized(&VStack_150,&VStack_130); fVar20 = pVVar10->y * pVVar14->y + pVVar10->x * pVVar14->x; fVar19 = fVar20 * (float)pEStack_fc; fVar20 = fVar20 * (float)EStack_110; pEStack_fc = (Entity_Tear *)(fVar19 + fVar19 + (float)pEStack_fc); EStack_110 = (EntityPtr)((float)EStack_110 + fVar20 + fVar20); fStack_10c = sqrtf((float)pEStack_fc * (float)pEStack_fc + (float)EStack_110 * (float)EStack_110); this = tear; } fVar20 = Entity::IsCollisionIgnored((Entity *)this,(Entity *)param_2); VStack_150.y = fVar20 * 0.1; fVar20 = Entity::IsCollisionIgnored((Entity *)param_2,(Entity *)this); VStack_150.y = VStack_150.y / (fVar20 + VStack_150.y); fVar20 = sqrtf((float)EStack_114); *(float *)((int)param_2 + 0x360) = ((float)EStack_110 / fStack_10c) * fVar20 * VStack_150.y + *(float *)((int)param_2 + 0x360); *(float *)((int)param_2 + 0x364) = ((float)pEStack_fc / fStack_10c) * fVar20 * VStack_150.y + *(float *)((int)param_2 + 0x364); ExceptionList = pvStack_1c; return 1; } ExceptionList = pvStack_1c; return 1; } if (((isExplosive == '\0') && (iVar8 == 0x336)) && (*(int *)((int)param_2 + 0xb64) == 0x10)) { auStack_38._0_4_ = *(int *)((int)param_2 + 0x3ec) + this->_initSeed; auStack_38._4_4_ = 5; auStack_38._8_4_ = 9; pEStack_2c = (Entity_Tear *)&DAT_00000007; uVar11 = RNG::RandomInt((RNG *)auStack_38,5); if (uVar11 == 0) { VStack_130.y = (this->_pos).y - *(float *)((int)param_2 + 0x340); VStack_130.x = (this->_pos).x - *(float *)((int)param_2 + 0x33c); Vector::Normalized(&VStack_130,&VStack_158); fVar20 = (this->_velocity).x; fVar19 = VStack_158.y * (this->_velocity).y + VStack_158.x * fVar20; if (fVar19 < 0.0) { (this->_velocity).x = fVar20 - VStack_158.x * (fVar19 + fVar19); (this->_velocity).y = (this->_velocity).y - VStack_158.y * (fVar19 + fVar19); ExceptionList = pvStack_1c; return 1; } ExceptionList = pvStack_1c; return 1; } } if (*(int *)((int)param_2 + 0x28) == 9) { pBVar9 = BitSet128::operator_and ((BitSet128 *)auStack_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34c60); bVar6 = BitSet128::IsZero(pBVar9); if (((bVar6 != 0) || ((*(uint *)((int)param_2 + 0x438) & 0x80000000) != 0)) && ((*(uint *)((int)param_2 + 0x43c) & 0x1000) == 0)) { ExceptionList = pvStack_1c; return 1; } *(uint *)((int)param_2 + 0x438) = 0; *(undefined4 *)((int)param_2 + 0x43c) = 0; *(undefined1 *)((int)param_2 + 0x173) = 1; } bVar6 = EntityList::HitListContains((EntityList *)&this->_hitList,(Entity *)param_2); if (bVar6 != 0) { b_04 = (BitSet128 *)&DAT_00c34780; b_03 = (BitSet128 *)&DAT_00c34630; b_02 = (BitSet128 *)&DAT_00c34930; b_01 = (BitSet128 *)&DAT_00c34a50; b_00 = &g_tearFlagLudovico; b = (BitSet128 *)&DAT_00c34b80; pBVar21 = &g_tearFlagSpectral; pBVar9 = BitSet128::operator_or ((BitSet128 *)auStack_38,(BitSet128 *)&DAT_00c34b50, (BitSet128 *)&DAT_00c34910); pBVar9 = BitSet128::operator_or((BitSet128 *)auStack_138,pBVar9,pBVar21); pBVar9 = BitSet128::operator_or((BitSet128 *)auStack_160,pBVar9,b); pBVar9 = BitSet128::operator_or((BitSet128 *)auStack_148,pBVar9,b_00); pBVar9 = BitSet128::operator_or(&BStack_190,pBVar9,b_01); pBVar9 = BitSet128::operator_or(&BStack_1a0,pBVar9,b_02); pBVar9 = BitSet128::operator_or(&BStack_180,pBVar9,b_03); pBVar9 = BitSet128::operator_or(&BStack_170,pBVar9,b_04); pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,pBVar9); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } uVar11 = Entity::GetHitListIndex((Entity *)param_2); sorted_vector_insert_unique(&this->_hitList,uVar11); iVar8 = 0x67412f; bVar6 = Entity::IsActiveEnemy((Entity *)param_2,0); if (bVar6 != 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34930); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34a50); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { iVar8 = 0x674195; pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34630); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) goto LAB_0067441d; } } iVar8 = 0x6741bd; pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagLudovico); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { if (this->_stickTarget == (void *)0x0) { VStack_130 = *(Vector *)((int)param_2 + 0x33c); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_38, &VStack_130, *(float *)((int)param_2 + 0x370) + *(float *)((int)param_2 + 0x370) + 100.0,4); uVar11 = 0; uStack_14 = 0; uVar18 = 0; if (pEStack_2c != (Entity_Tear *)0x0) { do { iVar8 = *(int *)(auStack_38._4_4_ + uVar11 * 4); if (((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 2)) && (*(EntityPtr *)(iVar8 + 0x478) == param_2)) { uVar18 = uVar18 + 1; } uVar11 = uVar11 + 1; } while (uVar11 < pEStack_2c); this = tear; if (0xf < uVar18) { (**(code **)(*(int *)tear + 0x28))(); goto LAB_00674576; } } EntityPtr::SetReference((EntityPtr *)&this->_stickTarget,(Entity *)param_2); fVar20 = (this->_pos).y; fVar19 = *(float *)((int)param_2 + 0x340); (this->_stickDiff).x = (this->_pos).x - *(float *)((int)param_2 + 0x33c); (this->_stickDiff).y = fVar20 - fVar19; pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34930); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34630) ; bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) goto LAB_00674658; pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34a50) ; bVar6 = BitSet128::IsNonZero(pBVar9); game = g_game; if (bVar6 != 0) { this->_stickTimer = 300; iVar8 = this->_stickTimer; if (1 < *(int *)&game->_deathmatchManager) { iVar8 = 0x3c; } this->_stickTimer = iVar8; goto LAB_00674662; } } else { LAB_00674658: this->_stickTimer = 0x3c; LAB_00674662: if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } pBVar9 = BitSet128::operator_or (&BStack_128,(BitSet128 *)&DAT_00c34b30,(BitSet128 *)&DAT_00c34c40); iVar8 = 0x674695; pBVar9 = BitSet128::__bnot(pBVar9,&BStack_170); *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l & (uint)pBVar9->_l; puVar2 = (uint *)((int)&(this->_tearFlags)._l + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_l + 4); pqVar1 = &(this->_tearFlags)._h; *(uint *)pqVar1 = (uint)*pqVar1 & (uint)pBVar9->_h; puVar2 = (uint *)((int)&(this->_tearFlags)._h + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_h + 4); if (g_forceCollideDepth != 0) { LAB_00674576: EntityList_Query::~EntityList_Query(auStack_38); ExceptionList = pvStack_1c; return 1; } uStack_14 = 0xffffffff; EntityList_Query::~EntityList_Query(auStack_38); } } else { fStack_10c = (this->_pos).y - *(float *)((int)param_2 + 0x340); pEStack_fc = (Entity_Tear *)((this->_pos).x - *(float *)((int)param_2 + 0x33c)); fVar20 = sqrtf(fStack_10c * fStack_10c + (float)pEStack_fc * (float)pEStack_fc); if ((*(float *)((int)param_2 + 0x370) < fVar20) && (0.0 < fVar20)) { fVar20 = *(float *)((int)param_2 + 0x370) / fVar20; pEStack_fc = (Entity_Tear *)(fVar20 * (float)pEStack_fc); fStack_10c = fStack_10c * fVar20; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34a50); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34630); bVar6 = BitSet128::IsNonZero(pBVar9); VStack_140.y = 2.66247e-44; if (bVar6 != 0) { VStack_140.y = 6.72623e-44; } } else { VStack_140.y = 3.64338e-44; } uVar11 = Random(); VStack_130.y = fStack_10c + *(float *)((int)param_2 + 0x340); VStack_130.x = (float)pEStack_fc + *(float *)((int)param_2 + 0x33c); pEStack_fc = (Entity_Tear *) Game::Spawn(g_game,2,(uint)VStack_140.y,&VStack_130,&g_vectorZero, (Entity *)this->_spawnerEntity,0,uVar11); (**(code **)(*(int *)pEStack_fc + 0xc))(); pBVar9 = BitSet128::__bnot(&g_tearFlagLudovico,&BStack_128); pBVar9 = BitSet128::operator_and(&BStack_170,&this->_tearFlags,pBVar9); SetTearFlags(pEStack_fc,*pBVar9); (**(code **)(*(int *)pEStack_fc + 0x40))(); fVar20 = this->_fScale; if (fVar20 <= 0.01) { fVar20 = 0.01; } pEStack_fc->_baseScale = fVar20; pEStack_fc->_fScale = fVar20; ResetSpriteScale(pEStack_fc); if (EStack_110 != (EntityPtr)0x0) { Random(); Entity_Player::GetTearHitParams(); SetScale(pEStack_fc,fStack_ac); } g_forceCollideDepth = g_forceCollideDepth + 1; iVar8 = 1; (**(code **)(*(int *)pEStack_fc + 0x5c))(); (**(code **)(*(int *)param_2 + 0x5c))(); g_forceCollideDepth = g_forceCollideDepth + -1; } } LAB_0067441d: if (isExplosive != '\0') goto LAB_0067588d; VStack_130.x = 0.0; VStack_130.y = 0.0; fStack_10c = this->_collisionDamage; get_tear_flags_from_player ((ulonglong *)&VStack_130,(int)&this->_tearFlags,this->_tearFlags,iVar8,(Entity *)this); npcCollider = (Entity_NPC *)__RTDynamicCast(param_2); if (npcCollider == (Entity_NPC *)0x0) { LAB_0067449c: cStack_fd = '\x01'; } else { bVar6 = Entity_NPC::CanBeDamagedFromVelocity(npcCollider,this->_velocity); cStack_fd = '\0'; if (bVar6 != 0) goto LAB_0067449c; } if (this->_spawnerEntity == (EntityPtr)0x0) { LAB_006746d2: cVar7 = '\x01'; } else { bVar6 = Entity::IsDescendantOf((Entity *)this->_spawnerEntity,(Entity *)param_2); if (bVar6 == 0) { pEVar12 = (Entity *)GetRootPlayer(this); bVar6 = Entity::IsDescendantOf((Entity *)param_2,pEVar12); if (bVar6 == 0) goto LAB_006746d2; } cVar7 = '\0'; } iVar8 = *(int *)((int)param_2 + 0x28); VStack_158.y = 1.4013e-45; if (iVar8 - 10U < 0x3de) { bVar6 = Entity::IsFriendly((Entity *)param_2); iVar8 = *(int *)((int)param_2 + 0x28); cVar7 = extraout_DL; if (bVar6 == 0) { cVar7 = SUB41(VStack_158.y,0); } } if ((((iVar8 == 0x21) || (iVar8 == 0xf5)) || (iVar8 == 0x322)) || (cVar7 != '\0')) { bVar6 = Entity::IsEnemy((Entity *)param_2); if (bVar6 != 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34b50); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 == 0) || (cVar7 = func_0x006ac660(), cVar7 != '\0')) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagSpectral); bVar6 = BitSet128::IsNonZero(pBVar9); if (((bVar6 == 0) || (cVar7 = func_0x006ac660(), cVar7 == '\0')) && (cStack_fd == '\0')) goto LAB_00675369; } } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagSpectral); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 != 0) && (cVar7 = func_0x006ac660(), cVar7 != '\0')) { pBVar9 = BitSet128::operator_and(&BStack_170,&this->_tearFlags,(BitSet128 *)&DAT_00c346f0); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } if (((1 < *(int *)&g_game->_deathmatchManager) && (player = (Entity_Player *)__RTDynamicCast(), player != (Entity_Player *)0x0)) && (Entity_Player::trigger_vampire_charm_kill(), *(int *)((int)param_2 + 0x28) == 1)) { bVar6 = Entity_Player::HasTrinket(player,0x71,0); if ((bVar6 != 0) && (uVar11 = Random(), (uVar11 & 0xf) == 0)) { pEStack_fc = (Entity_Tear *)0x1; bVar6 = Entity_Player::HasTrinket(player,0x5e,0); if (bVar6 != 0) { pEStack_fc = (Entity_Tear *)0x2; iVar8 = Entity_Player::GetTrinketMultiplier(player,0x5e); if (iVar8 == 2) { uVar11 = Random(); if (uVar11 % 5 == 0) { pEStack_fc = (Entity_Tear *)0x3; } } else if ((iVar8 == 3) && (uVar11 = Random(), uVar11 % 5 == 0)) { pEStack_fc = (Entity_Tear *)&DAT_00000004; } } pEVar16 = pEStack_fc; do { uVar11 = Random(); VStack_140.x = (player->_pos).x; VStack_140.y = (player->_pos).y; pEVar12 = Game::Spawn(g_game,3,0x2b,&VStack_140,&g_vectorZero,(Entity *)player,1,uVar11); *(uint *)&pEVar12->_flags = (uint)pEVar12->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar12->_flags + 4) = *(undefined4 *)((int)&pEVar12->_flags + 4); pEVar16 = (Entity_Tear *)((int)&pEVar16[-1]._tearRange + 3); } while (pEVar16 != (Entity_Tear *)0x0); param_2 = EStack_114; } bVar6 = Entity_Player::HasTrinket(player,0x72,0); if (bVar6 != 0) { uVar11 = Random(); if ((uVar11 & 0xf) == 0) { pEStack_fc = (Entity_Tear *)0x1; bVar6 = Entity_Player::HasTrinket(player,0x5e,0); if (bVar6 != 0) { pEStack_fc = (Entity_Tear *)0x2; iVar8 = Entity_Player::GetTrinketMultiplier(player,0x5e); if (iVar8 == 2) { uVar11 = Random(); if (uVar11 % 5 == 0) { pEStack_fc = (Entity_Tear *)0x3; } } else if ((iVar8 == 3) && (uVar11 = Random(), uVar11 % 5 == 0)) { pEStack_fc = (Entity_Tear *)&DAT_00000004; } } pEVar16 = pEStack_fc; do { uVar11 = Random(); VStack_140.x = (player->_pos).x; VStack_140.y = (player->_pos).y; pEVar12 = Game::Spawn(g_game,3,0x2b,&VStack_140,&g_vectorZero,(Entity *)player,2,uVar11) ; *(uint *)&pEVar12->_flags = (uint)pEVar12->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar12->_flags + 4) = *(undefined4 *)((int)&pEVar12->_flags + 4); pEVar16 = (Entity_Tear *)((int)&pEVar16[-1]._tearRange + 3); } while (pEVar16 != (Entity_Tear *)0x0); param_2 = EStack_114; } } bVar6 = Entity_Player::HasTrinket(player,0x73,0); if (bVar6 != 0) { uVar11 = Random(); if ((uVar11 & 0xf) == 0) { pEStack_fc = (Entity_Tear *)0x1; bVar6 = Entity_Player::HasTrinket(player,0x5e,0); if (bVar6 != 0) { pEStack_fc = (Entity_Tear *)0x2; iVar8 = Entity_Player::GetTrinketMultiplier(player,0x5e); if (iVar8 == 2) { uVar11 = Random(); if (uVar11 % 5 == 0) { pEStack_fc = (Entity_Tear *)0x3; } } else if ((iVar8 == 3) && (uVar11 = Random(), uVar11 % 5 == 0)) { pEStack_fc = (Entity_Tear *)&DAT_00000004; } } pEVar16 = pEStack_fc; do { uVar11 = Random(); VStack_140.x = (player->_pos).x; VStack_140.y = (player->_pos).y; pEVar12 = Game::Spawn(g_game,3,0x2b,&VStack_140,&g_vectorZero,(Entity *)player,3,uVar11) ; *(uint *)&pEVar12->_flags = (uint)pEVar12->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar12->_flags + 4) = *(undefined4 *)((int)&pEVar12->_flags + 4); pEVar16 = (Entity_Tear *)((int)&pEVar16[-1]._tearRange + 3); } while (pEVar16 != (Entity_Tear *)0x0); param_2 = EStack_114; } } bVar6 = Entity_Player::HasTrinket(player,0x74,0); if (bVar6 != 0) { uVar11 = Random(); if ((uVar11 & 0xf) == 0) { pEStack_fc = (Entity_Tear *)0x1; bVar6 = Entity_Player::HasTrinket(player,0x5e,0); if (bVar6 != 0) { pEStack_fc = (Entity_Tear *)0x2; iVar8 = Entity_Player::GetTrinketMultiplier(player,0x5e); if (iVar8 == 2) { uVar11 = Random(); if (uVar11 % 5 == 0) { pEStack_fc = (Entity_Tear *)0x3; } } else if ((iVar8 == 3) && (uVar11 = Random(), uVar11 % 5 == 0)) { pEStack_fc = (Entity_Tear *)&DAT_00000004; } } pEVar16 = pEStack_fc; do { uVar11 = Random(); VStack_140.x = (player->_pos).x; VStack_140.y = (player->_pos).y; pEVar12 = Game::Spawn(g_game,3,0x2b,&VStack_140,&g_vectorZero,(Entity *)player,4,uVar11) ; *(uint *)&pEVar12->_flags = (uint)pEVar12->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar12->_flags + 4) = *(undefined4 *)((int)&pEVar12->_flags + 4); pEVar16 = (Entity_Tear *)((int)&pEVar16[-1]._tearRange + 3); } while (pEVar16 != (Entity_Tear *)0x0); param_2 = EStack_114; } } bVar6 = Entity_Player::HasTrinket(player,0x75,0); if (bVar6 != 0) { uVar11 = Random(); if ((uVar11 & 0xf) == 0) { VStack_140.y = 2.8026e-45; bVar6 = Entity_Player::HasTrinket(player,0x5e,0); if (bVar6 != 0) { iVar8 = Entity_Player::GetTrinketMultiplier(player,0x5e); if (iVar8 == 2) { uVar11 = Random(); iVar8 = 2; if (uVar11 % 5 == 0) { iVar8 = 3; } } else if ((iVar8 == 3) && (uVar11 = Random(), uVar11 % 5 == 0)) { iVar8 = 4; } else { iVar8 = 2; } VStack_140.y = (float)(iVar8 * 2); } EVar17 = (EntityPtr)VStack_140.y; do { uVar11 = Random(); VStack_140.x = (player->_pos).x; VStack_140.y = (player->_pos).y; pEVar12 = Game::Spawn(g_game,3,0x2b,&VStack_140,&g_vectorZero,(Entity *)player,5,uVar11) ; *(uint *)&pEVar12->_flags = (uint)pEVar12->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar12->_flags + 4) = *(undefined4 *)((int)&pEVar12->_flags + 4); EVar17 = (EntityPtr)((int)EVar17 + -1); } while (EVar17 != (EntityPtr)0x0); param_2 = EStack_114; } } bVar6 = Entity_Player::HasTrinket(player,0x76,0); if ((bVar6 != 0) && (bVar6 = TemporaryEffects::HasTrinketEffect(&player->_temporaryeffects,0x76), bVar6 == 0)) { trinketRng = Entity_Player::GetTrinketRNG(player,0x76); uVar11 = RNG::RandomInt(trinketRng,0x32); if (uVar11 == 0) { TemporaryEffects::AddTrinketEffect(&player->_temporaryeffects,0x76,1,1); pvVar13 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar13 & 0xfffffffcU) < 0xa1) { costumeItem = (ItemConfig_Item *)0x0; } else { costumeItem = *(ItemConfig_Item **)((int)pvVar13 + 0xa0); } Entity_Player::AddCostume(player,costumeItem,0); } } bVar6 = Entity_Player::HasTrinket(player,0xb9,0); if ((bVar6 != 0) && (uVar11 = Random(), uVar11 % 0x21 == 0)) { _Entity_Player::SpawnTrinketRandomPickup(); } bVar6 = Entity_Player::HasTrinket(player,0xbd,0); if (((bVar6 != 0) && (uVar11 = Random(), uVar11 % 10 == 0)) && ((pvVar13 = TemporaryEffects::GetCollectibleEffect(&player->_temporaryeffects,0x3a), pvVar13 == (void *)0x0 || (*(int *)((int)pvVar13 + 8) < 0x96)))) { collectibles = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)collectibles & 0xfffffffcU ) < 0xe9) { auStack_38._0_4_ = 0; } else { auStack_38._0_4_ = *(int *)((int)collectibles + 0xe8); } pEStack_2c = (Entity_Tear *)0x0; auStack_38._4_4_ = 0; auStack_38._8_4_ = 0x1e; if (pvVar13 == (void *)0x0) { SoundEffects::PlayWithFartOverride(0x404,1.0,2,0,1.0); } pEStack_2c = (Entity_Tear *)(uint)(pvVar13 == (void *)0x0); TemporaryEffects::AddEffect(&player->_temporaryeffects,auStack_38,1,1); } } pcVar15 = *(code **)(*(int *)param_2 + 0x20); EntityRef::constructor((EntityRef *)(auStack_64 + 4),(Entity *)tear); (*pcVar15)(); fVar20 = VStack_150.y; pBVar9 = BitSet128::operator_and (&BStack_128,(BitSet128 *)VStack_150.y,(BitSet128 *)&DAT_00c34780); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 == 0) || (cVar7 = func_0x006ac660(), cVar7 != '\0')) { this = tear; } else { pBVar9 = BitSet128::operator_or (&BStack_128,(BitSet128 *)&DAT_00c34b50,(BitSet128 *)&DAT_00c34910); pBVar9 = BitSet128::operator_and(&BStack_170,(BitSet128 *)fVar20,pBVar9); bVar6 = BitSet128::IsZero(pBVar9); this = tear; if (bVar6 != 0) { fVar20 = (tear->_velocity).x; fVar19 = (tear->_velocity).y; VStack_130.y = (tear->_pos).y - *(float *)((int)param_2 + 0x340); VStack_130.x = (tear->_pos).x - *(float *)((int)param_2 + 0x33c); fVar20 = sqrtf(fVar20 * fVar20 + fVar19 * fVar19); fVar20 = fVar20 * 0.5 + 2.0; if (10.0 <= fVar20) { fVar20 = 10.0; } pVVar10 = Vector::Resized(&VStack_130,(Vector *)(auStack_38 + 8),fVar20); fVar20 = this->_speedMultiplier; fVar19 = pVVar10->y; (this->_velocity).x = fVar20 * pVVar10->x + (this->_velocity).x; (this->_velocity).y = fVar19 * fVar20 + (this->_velocity).y; } iVar8 = this->_hitCount; if (iVar8 == 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34770); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 == 0) { iVar8 = 0; } else { pBVar9 = BitSet128::__bnot((BitSet128 *)&DAT_00c34770,&BStack_128); fStack_10c = 1.0; *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l & (uint)pBVar9->_l; puVar2 = (uint *)((int)&(this->_tearFlags)._l + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_l + 4); pqVar1 = &(this->_tearFlags)._h; *(uint *)pqVar1 = (uint)*pqVar1 & (uint)pBVar9->_h; puVar2 = (uint *)((int)&(this->_tearFlags)._h + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_h + 4); fVar20 = this->_fScale * 0.5; if (EStack_110 != (EntityPtr)0x0) { if (0.55 < fVar20) { if (fVar20 <= 0.75) { fStack_10c = 0.8; } } else { fStack_10c = 0.65; } } VStack_140.y = this->_collisionDamage * 0.5; uVar11 = Random(); Game::Spawn(g_game,4,0,&this->_pos,&g_vectorZero,(Entity *)this->_spawnerEntity,0,uVar11); pEVar12 = (Entity *)__RTDynamicCast(); pEVar12[1].field_0x3c = 1; pEVar12->_spawnerType = tear->_spawnerType; pEVar12->_spawnerVariant = tear->_spawnerVariant; qVar5 = (tear->_tearFlags)._l; iVar8 = *(int *)((int)&(tear->_tearFlags)._l + 4); qVar4 = (tear->_tearFlags)._h; iVar3 = *(int *)((int)&(tear->_tearFlags)._h + 4); pEVar12[1]._sprite._filename._buf[0xf] = '\x01'; pEVar12[1]._variant = (int)qVar5; pEVar12[1]._subtype = iVar8; pEVar12[1]._spawnerType = (int)qVar4; pEVar12[1]._spawnerVariant = iVar3; pEVar12[1]._type = (int)(tear->_fScale * 0.5); VStack_130 = (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000); Entity::SetSize(pEVar12,tear->_fScale * 0.5, (Vector)(CONCAT44(g_vectorOne.y,VStack_130.x) ^ 0x8000000000000000),-1); pvVar13 = (void *)(VStack_140.y * 5.0 + 30.0); if (VStack_140.y * 10.0 <= (float)pvVar13) { pvVar13 = (void *)(VStack_140.y * 10.0); } pEVar12[1]._damageEvents._end = pvVar13; *(float *)&pEVar12[1].field_0x40 = fStack_10c; uVar11 = Random(); *(uint *)&pEVar12->_flags = (uint)pEVar12->_flags | 0x4000000; (pEVar12->_posOffset).x = 0.0; (pEVar12->_posOffset).y = -3.0; puVar2 = (uint *)((int)&pEVar12->_flags + 4); *puVar2 = *puVar2 | 0x400; *(undefined4 *)&pEVar12[1].field_0x4 = 0x14; pEVar12[1]._damageEvents._begin = (void *)0x14; pEVar12[1]._damageEvents._capacity = (void *)(-3.0 - (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 5.0); iVar8 = tear->_hitCount; this = tear; } } this->_hitCount = iVar8 + 1; pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c345b0); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { this->_popBounceCount = this->_popBounceCount + 1; } } bVar6 = Entity::IsEnemy((Entity *)param_2); if (bVar6 != 0) { this->_canTriggerStreakEnd = 0; } bVar6 = Entity::IsEnemy((Entity *)param_2); if (bVar6 != 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34a50); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34930); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34630); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { ExceptionList = pvStack_1c; return 1; } } bVar6 = Entity::IsActiveEnemy((Entity *)param_2,0); if ((((bVar6 != 0) && (VStack_140.y = *(float *)&this->_parent, (EntityPtr)VStack_140.y != (EntityPtr)0x0)) && (*(int *)((int)VStack_140.y + 0x28) == 1)) && (bVar6 = Entity_Player::HasCollectible((Entity_Player *)VStack_140.y,0x175,0), bVar6 != 0)) { Entity_Player::AddDeadEyeCharge((Entity_Player *)VStack_140.y); } } LAB_00675369: pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34c00); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 != 0) && (*(int *)((int)param_2 + 0x28) != 0x21)) { if (EStack_110 == (EntityPtr)0x0) { fVar20 = 0.0; } else { fVar20 = *(float *)((int)EStack_110 + 0x156c); } EVar17 = (EntityPtr)(10 - (int)(fVar20 * 0.7)); if ((int)EVar17 < 1) { EVar17 = (EntityPtr)VStack_158.y; } iVar8 = Isaac::Random((int)EVar17); if (iVar8 == 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagLudovico); bVar6 = BitSet128::IsZero(pBVar9); if ((bVar6 != 0) || (cVar7 = is_not_familiar_spawned(this), cVar7 != '\0')) { *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l | (uint)g_tearFlagExplosive._l ; puVar2 = (uint *)((int)&(this->_tearFlags)._l + 4); *puVar2 = *puVar2 | g_tearFlagExplosive._l._4_4_; pqVar1 = &(this->_tearFlags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | (uint)g_tearFlagExplosive._h; puVar2 = (uint *)((int)&(this->_tearFlags)._h + 4); *puVar2 = *puVar2 | g_tearFlagExplosive._h._4_4_; } } } if ((this->_variant == 2) || (this->_variant == 0x1e)) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagLudovico); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 != 0) && (bVar6 = Entity::IsVulnerableEnemy((Entity *)param_2,(Entity *)0x0), bVar6 != 0)) { Color::operator_assign((Color *)auStack_64,&(this->_sprite)._color); if (this->_variant == 0x1e) { Color::Color(&CStack_90); Color::operator_assign(aCStackY_1834 + 0x81,(ColorMod *)auStack_64); other = (ColorMod *)FUN_004072e0(); Color::operator_assign((Color *)auStack_64,other); } VStack_158.y = this->_height; uVar11 = Random(); Game::SpawnParticles (g_game,&this->_pos,0x23,1, (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0,(ColorMod *)auStack_64,VStack_158.y,0); } } pBVar21 = (BitSet128 *)&DAT_00c34780; pBVar9 = BitSet128::operator_or(&BStack_128,(BitSet128 *)&DAT_00c34b50,(BitSet128 *)&DAT_00c34910) ; pBVar9 = BitSet128::operator_or(&BStack_170,pBVar9,pBVar21); pBVar9 = BitSet128::operator_and(&BStack_180,&this->_tearFlags,pBVar9); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 != 0) && (bVar6 = Entity::HasEntityFlags((Entity *)param_2,0x40000000), bVar6 == 0)) { pEStack_fc = (Entity_Tear *)(*(float *)((int)param_2 + 0x340) - (this->_pos).y); EStack_110 = (EntityPtr)(*(float *)((int)param_2 + 0x33c) - (this->_pos).x); auStack_38._8_4_ = EStack_110; pEStack_2c = pEStack_fc; VStack_158.y = sqrtf((float)pEStack_fc * (float)pEStack_fc + (float)EStack_110 * (float)EStack_110); if (0.0001 <= VStack_158.y) { VStack_140.y = (this->_velocity).y - *(float *)((int)param_2 + 0x364); fStack_10c = (this->_velocity).x - *(float *)((int)param_2 + 0x360); VStack_130.y = VStack_140.y; VStack_130.x = fStack_10c; fVar20 = sqrtf(VStack_140.y * VStack_140.y + fStack_10c * fStack_10c); if (((*(float *)((int)param_2 + 0x370) + this->_size) * 0.5 < fVar20) && (VStack_140.y * (float)pEStack_fc + fStack_10c * (float)EStack_110 < 0.0)) { pVVar10 = Vector::Normalized(&VStack_130,&VStack_158); pVVar14 = Vector::Normalized((Vector *)(auStack_38 + 8),&VStack_130); fVar20 = pVVar10->y * pVVar14->y + pVVar10->x * pVVar14->x; fVar19 = fVar20 * (float)pEStack_fc; fVar20 = fVar20 * (float)EStack_110; pEStack_fc = (Entity_Tear *)(fVar19 + fVar19 + (float)pEStack_fc); EStack_110 = (EntityPtr)((float)EStack_110 + fVar20 + fVar20); VStack_158.y = sqrtf((float)pEStack_fc * (float)pEStack_fc + (float)EStack_110 * (float)EStack_110); this = tear; } fStack_10c = Entity::IsCollisionIgnored((Entity *)this,(Entity *)param_2); fVar20 = Entity::IsCollisionIgnored((Entity *)param_2,(Entity *)this); fStack_10c = fStack_10c / (fVar20 + fStack_10c); fVar20 = *(float *)((int)param_2 + 0x364) - (this->_velocity).y; fVar19 = *(float *)((int)param_2 + 0x360) - (this->_velocity).x; fVar20 = sqrtf(fVar20 * fVar20 + fVar19 * fVar19); *(float *)((int)param_2 + 0x360) = ((float)EStack_110 / VStack_158.y) * fVar20 * fStack_10c + *(float *)((int)param_2 + 0x360); *(float *)((int)param_2 + 0x364) = ((float)pEStack_fc / VStack_158.y) * fVar20 * fStack_10c + *(float *)((int)param_2 + 0x364); } } if ((*(int *)((int)param_2 + 0x28) == 0xe) || (*(int *)((int)param_2 + 0x28) == 0x12)) { pBVar9 = BitSet128::operator_or (&BStack_128,(BitSet128 *)&DAT_00c34b50,(BitSet128 *)&DAT_00c34910); pBVar9 = BitSet128::operator_and(&BStack_170,&this->_tearFlags,pBVar9); bVar6 = BitSet128::IsZero(pBVar9); if (bVar6 != 0) { fVar20 = (this->_velocity).y; *(float *)((int)param_2 + 0x360) = (this->_velocity).x * 0.5 + *(float *)((int)param_2 + 0x360); *(float *)((int)param_2 + 0x364) = fVar20 * 0.5 + *(float *)((int)param_2 + 0x364); } } LAB_0067588d: ApplyTearFlagEffects ((Entity *)param_2,&this->_pos,this->_tearFlags,(Entity *)this,this->_collisionDamage); if (((this->_variant == 0x2d) && (bVar6 = Entity::IsVulnerableEnemy((Entity *)param_2,(Entity *)0x0), bVar6 != 0)) && ((cVar7 = (**(code **)(*(int *)param_2 + 0x4c))(), cVar7 == '\0' || (*(float *)((int)param_2 + 0x380) <= *(float *)((int)param_2 + 0x14))))) { cStack_fd = '\0'; Game::AddErasedEnemy(); pvVar13 = g_game->_room; if (*(int *)((int)pvVar13 + 0x1264) != 0) { uVar11 = 0; do { VStack_158.y = *(float *)(*(int *)((int)pvVar13 + 0x125c) + uVar11 * 4); bVar6 = Game::ShouldEraseEnemy((Entity *)VStack_158.y); iVar8 = unusedArg; if (bVar6 != 0) { Entity::RemoveWithPoof((Entity *)VStack_158.y,unusedArg); cStack_fd = '\x01'; iVar8 = extraout_ECX; } this = tear; param_2 = EStack_114; uVar11 = uVar11 + 1; } while (uVar11 < *(uint *)((int)pvVar13 + 0x1264)); if (cStack_fd != '\0') { SoundEffects::PlayWithFartOverride2(0x359,iVar8,2,0,1.0,1.0); } } } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)0xc34670); bVar6 = BitSet128::IsNonZero(pBVar9); if (((bVar6 != 0) && (bVar6 = Entity::IsVulnerableEnemy((Entity *)param_2,(Entity *)0x0), bVar6 != 0)) && (cVar7 = (**(code **)(*(int *)param_2 + 0x4c))(), cVar7 == '\0')) { reroll_hit_entity((Entity_Tear *)param_2); } if (isExplosive == '\0') { UpdateBoneTear(this,(Entity *)param_2); pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34940); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { pBVar9 = BitSet128::__bnot((BitSet128 *)&DAT_00c34940,&BStack_170); this = tear; *(uint *)(qword *)VStack_150.y = (uint)*(qword *)VStack_150.y & (uint)pBVar9->_l; puVar2 = (uint *)((int)(qword *)VStack_150.y + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_l + 4); *(uint *)((int)VStack_150.y + 8) = (uint)*(qword *)((int)VStack_150.y + 8) & (uint)pBVar9->_h; puVar2 = (uint *)((int)((int)VStack_150.y + 8) + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_h + 4); uVar18 = *(uint *)((int)(qword *)VStack_150.y + 4) | g_tearFlagHoming._l._4_4_; qVar5 = *(qword *)((int)VStack_150.y + 8); uVar11 = *(uint *)((int)((int)VStack_150.y + 8) + 4); *(uint *)(qword *)VStack_150.y = (uint)*(qword *)VStack_150.y | (uint)g_tearFlagHoming._l; *(uint *)((int)(qword *)VStack_150.y + 4) = uVar18; uVar11 = uVar11 | g_tearFlagHoming._h._4_4_; *(uint *)((int)VStack_150.y + 8) = (uint)qVar5 | (uint)g_tearFlagHoming._h; *(uint *)((int)((int)VStack_150.y + 8) + 4) = uVar11; iVar8 = tear->_variant; pBVar9 = (BitSet128 *)VStack_150.y; if (((iVar8 != 0x23) && (iVar8 != 0x25)) && (iVar8 != 0x26)) { ChangeVariant(tear,0x20); pBVar9 = &this->_tearFlags; } this->_collisionDamage = this->_collisionDamage + this->_collisionDamage; pBVar9 = BitSet128::operator_and(&BStack_170,pBVar9,&g_tearFlagLudovico); bVar6 = BitSet128::IsZero(pBVar9); if (bVar6 != 0) { scale = (undefined1 *)(this->_baseScale * 1.3); if (32.0 <= (float)scale) { scale = &DAT_42000000; } SetScale(this,(float)scale); } fVar20 = this->_deadEyeIntensity; if (fVar20 <= 0.3) { fVar20 = 0.3; } SetDeadEyeIntensity(this,fVar20); param_2 = EStack_114; } if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)param_2 + 0x28) == 3)) && (bVar6 = Entity_Familiar::CanBlockProjectiles((Entity_Familiar *)param_2), bVar6 == 0)) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34780); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { this->_canTriggerStreakEnd = 0; ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34b80); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34b50); bVar6 = BitSet128::IsNonZero(pBVar9); if (((bVar6 == 0) || (cVar7 = func_0x006ac660(), cVar7 != '\0')) || (uVar11 = Random(), (uVar11 & 3) == 0)) { pVVar10 = MusicManager::RandomVector((Vector *)(auStack_38 + 8)); pEVar16 = tear; fVar20 = (tear->_velocity).y; fVar19 = (tear->_velocity).x; fVar19 = sqrtf(fVar19 * fVar19 + fVar20 * fVar20); fVar20 = pVVar10->y; (pEVar16->_velocity).x = fVar19 * pVVar10->x; (pEVar16->_velocity).y = fVar19 * fVar20; pBVar9 = BitSet128::__bnot((BitSet128 *)&DAT_00c34580,&BStack_128); *(uint *)&(pEVar16->_tearFlags)._l = (uint)(pEVar16->_tearFlags)._l & (uint)pBVar9->_l; puVar2 = (uint *)((int)&(pEVar16->_tearFlags)._l + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_l + 4); pqVar1 = &(pEVar16->_tearFlags)._h; *(uint *)pqVar1 = (uint)*pqVar1 & (uint)pBVar9->_h; puVar2 = (uint *)((int)&(pEVar16->_tearFlags)._h + 4); *puVar2 = *puVar2 & *(uint *)((int)&pBVar9->_h + 4); pEVar16->_canTriggerStreakEnd = 0; ExceptionList = pvStack_1c; return 1; } } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34910); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34b50); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 == 0) || (cVar7 = func_0x006ac660(), cVar7 != '\0')) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagLudovico); bVar6 = BitSet128::IsZero(pBVar9); if (bVar6 != 0) { pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagSpectral); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 == 0) || (cVar7 = func_0x006ac660(), cVar7 == '\0')) { npcCollider = (Entity_NPC *)__RTDynamicCast(); if ((this->_collisionDamage < *(float *)((int)param_2 + 0x380) || this->_collisionDamage == *(float *)((int)param_2 + 0x380)) || ((npcCollider != (Entity_NPC *)0x0 && (bVar6 = Entity_NPC::CanBeDamagedFromVelocity(npcCollider,this->_velocity), bVar6 == 0)))) { this->_deathFlags = this->_deathFlags | 8; this->_dead = 1; } else { fVar20 = this->_collisionDamage; fVar19 = fVar20 - *(float *)((int)param_2 + 0x380); this->_collisionDamage = fVar19; SetScale(this,(fVar19 * this->_baseScale) / fVar20); this->_canTriggerStreakEnd = 0; } EVar17 = this->_parent; if (EVar17 == (EntityPtr)0x0) { ExceptionList = pvStack_1c; return 1; } bVar6 = Entity::IsActiveEnemy((Entity *)param_2,0); if (bVar6 == 0) { ExceptionList = pvStack_1c; return 1; } if (*(int *)((int)EVar17 + 0x28) != 1) { ExceptionList = pvStack_1c; return 1; } bVar6 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x175,0); if (bVar6 == 0) { ExceptionList = pvStack_1c; return 1; } Entity_Player::AddDeadEyeCharge((Entity_Player *)EVar17); ExceptionList = pvStack_1c; return 1; } } } } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,(BitSet128 *)&DAT_00c34b50); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 != 0) && (cVar7 = func_0x006ac660(), cVar7 == '\0')) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagLudovico); bVar6 = BitSet128::IsZero(pBVar9); if (bVar6 == 0) { ExceptionList = pvStack_1c; return 1; } pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagSpectral); bVar6 = BitSet128::IsNonZero(pBVar9); if ((bVar6 != 0) && (cVar7 = func_0x006ac660(), cVar7 != '\0')) { ExceptionList = pvStack_1c; return 1; } if (this->_variant == 9) { ExceptionList = pvStack_1c; return 1; } fVar20 = *(float *)((int)param_2 + 0x360); fVar19 = *(float *)((int)param_2 + 0x364); this->_deathFlags = this->_deathFlags | 8; this->_dead = 1; (this->_pos).x = fVar20 * 0.8 + (this->_pos).x; (this->_pos).y = fVar19 * 0.8 + (this->_pos).y; } else { this->_deathFlags = this->_deathFlags | 0x28; this->_dead = 1; pBVar9 = BitSet128::operator_and(&BStack_128,&this->_tearFlags,&g_tearFlagLudovico); bVar6 = BitSet128::IsNonZero(pBVar9); if (bVar6 != 0) { cVar7 = is_not_familiar_spawned(this); if (cVar7 != '\0') { EVar17 = this->_child; VStack_158.y = (float)EVar17; if (EVar17 != (EntityPtr)0x0) { do { EntityRef::EntityRef((EntityRef *)(auStack_64 + 4)); (**(code **)(*(int *)EVar17 + 0x24))(); EVar17 = *(EntityPtr *)((int)EVar17 + 0x3c0); } while (EVar17 != (EntityPtr)0x0); param_2 = EStack_114; } } } } EVar17 = this->_parent; if ((((EVar17 != (EntityPtr)0x0) && (bVar6 = Entity::IsActiveEnemy((Entity *)param_2,0), bVar6 != 0)) && (*(int *)((int)EVar17 + 0x28) == 1)) && (bVar6 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x175,0), bVar6 != 0)) { Entity_Player::AddDeadEyeCharge((Entity_Player *)EVar17); } ExceptionList = pvStack_1c; return 0; } //@@ 00675fa0 Entity_Tear::SetCollisionDamage /* ZHL [vtable slot 16] */ void __thiscall Entity_Tear::SetCollisionDamage(Entity_Tear *this,float param_2) { this->_collisionDamage = param_2; this->_baseDamage = param_2; return; } //@@ 00675fc0 Entity_Projectile::SetHeight /* DB: ? sets 0x410 height and 0x350 offset, room-type 16 clamp prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Projectile::SetHeight(Entity_Projectile *this,float height) { Game *pGVar1; float fVar2; this->_height = height; fVar2 = Entity_Tear::get_height_offset_y((Entity_Tear *)this,height); pGVar1 = g_game; (this->_posOffset).y = fVar2; if ((*(int *)((int)pGVar1->_room + 8) == 0x10) && ((this->_posOffset).y = -18.0, -5.1 < height)) { this->_height = -5.1; } return; } //@@ 00676020 Entity_Tear::get_height_offset_y /* DB: thiscall float(height in xmm1)->float; Entity_Projectile::SetHeight passes height then stores result in _posOffset.y; variant 46 (FIRE) -> -8, 47/49 sword beams constant unless falling (0x418 _fallingAccel), NAIL with SEED_G_FUEL(79) -> -12, else height*0.4-15 + max(h+8.5,0)^2 prototype: db/protos.zhl */ float __thiscall Entity_Tear::get_height_offset_y(Entity_Tear *this,float height) { int iVar1; byte bVar2; float fVar3; iVar1 = this->_variant; if ((iVar1 != 0x2e) && (((iVar1 != 0x2f && (iVar1 != 0x31)) || ((0.001 < this->_fallingAccel && (this->_isHovering == 0)))))) { if ((((iVar1 == 0xd) || (iVar1 == 0x17)) && (bVar2 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f), bVar2 != 0)) && ((this->_fallingAccel <= 0.001 || (this->_isHovering != 0)))) { return -12.0; } if ((this->_fallingAccel <= 0.001) || (this->_isHovering != 0)) { fVar3 = this->_height + 8.5; if (fVar3 <= 0.0) { fVar3 = 0.0; } height = (this->_height * 0.4 - 15.0) + fVar3 * fVar3; } return height; } return -8.0; } //@@ 00676120 Entity_Tear::SetScale /* ZHL [exact] __thiscall void Entity_Tear::SetScale(float scale); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Tear::SetScale(Entity_Tear *this,float scale) { if (scale <= 0.01) { scale = 0.01; } this->_baseScale = scale; this->_fScale = scale; ResetSpriteScale(this); return; } //@@ 00676150 Entity_Tear::SetTearFlags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called after BitSet128 or/and on tear flags; loads per-flag effect anm2s (TearHalo, DarkMatter...) prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity_Tear::SetTearFlags(Entity_Tear *this,BitSet128 flags) { byte bVar1; BitSet128 *maskedFlags; LayerState *layer; byte *pbVar2; int blendDst; char *freeBlock; byte *expectedNameCh; uint uVar3; bool bVar4; byte *pbVar5; byte *layerIdx; std_string anm2Path; undefined4 local_58 [5]; undefined1 local_44 [12]; float local_38; float fStack_34; float local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int *anmBitflags; puStack_20 = local_44 + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00af7975; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_44 + 0x34); ExceptionList = &local_1c; maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34920); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && ((this->_tearHaloANM2)._loaded == 0)) { fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 2.38221e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/TearHalo.anm2",0x12); local_14 = 0; ANM2::Load(&this->_tearHaloANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } ANM2::Play(&this->_tearHaloANM2,s_Idle,0); } if ((this->_tearEffectANM2)._loaded != 0) goto LAB_00676b9b; maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34a00); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 4.06377e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/LittleHornTearEffect.anm2",0x1e); local_14 = 1; ANM2::Load(&this->_tearEffectANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } layerIdx = (byte *)0x0; if ((this->_tearEffectANM2)._layerCount != 0) { do { uVar3 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_tearEffectANM2,layerIdx); blendDst = 1; if ((uVar3 & 4) == 0) { blendDst = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = blendDst; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; layerIdx = layerIdx + 1; } while (layerIdx < (byte *)(this->_tearEffectANM2)._layerCount); } pbVar5 = (this->_tearEffectANM2)._animState._animData; if (pbVar5 != (byte *)0x0) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar2 = s_Idle; do { bVar1 = *pbVar5; bVar4 = bVar1 < *pbVar2; if (bVar1 != *pbVar2) { LAB_00676b65: uVar3 = -(uint)bVar4 | 1; goto LAB_00676b6a; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar4 = bVar1 < pbVar2[1]; if (bVar1 != pbVar2[1]) goto LAB_00676b65; pbVar5 = pbVar5 + 2; pbVar2 = pbVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00676b6a: if ((uVar3 == 0) && ((*(char *)((int)(this->_tearEffectANM2)._animState._animData + 0x34) == '\0' || ((this->_tearEffectANM2)._animState._isPlaying != 0)))) goto LAB_00676b9b; } bVar1 = ANM2::SetAnimation(&this->_tearEffectANM2,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_tearEffectANM2)._animState); (this->_tearEffectANM2)._animState._isPlaying = 1; } goto LAB_00676b9b; } maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34970); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34ab0); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34900); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34ac0); bVar1 = BitSet128::IsNonZero(maskedFlags); if (bVar1 != 0) { fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 4.06377e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/MysteriousTearEffect.anm2",0x1e); local_14 = 5; ANM2::Load(&this->_tearEffectANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } anmBitflags = &(this->_tearEffectANM2)._bitflags; *anmBitflags = *anmBitflags | 0x3000; layer = ANM2::GetLayer(&this->_tearEffectANM2,(byte *)0x0); pbVar5 = (byte *)0x1; layer->_bitflags = 0x1000; goto LAB_00676426; } maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34c00); bVar1 = BitSet128::IsNonZero(maskedFlags); if (bVar1 == 0) { maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_44 + 4),&flags,(BitSet128 *)&DAT_00c34820); bVar1 = BitSet128::IsNonZero(maskedFlags); if (bVar1 == 0) goto LAB_00676b9b; std::string::string_from_cstr(anm2Path._buf,(byte *)"gfx/DarkMatterTearEffect.anm2"); local_14 = 7; ANM2::Load(&this->_tearEffectANM2,&anm2Path,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); } else { fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 3.78351e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/FireMindTearEffect.anm2",0x1c); local_14 = 6; ANM2::Load(&this->_tearEffectANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } } anmBitflags = &(this->_tearEffectANM2)._bitflags; *anmBitflags = *anmBitflags | 0x3000; layer = ANM2::GetLayer(&this->_tearEffectANM2,(byte *)0x0); layer->_bitflags = 0x1000; } else { fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 4.34403e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/JacobsLadderTearEffect.anm2",0x20); local_14 = 4; ANM2::Load(&this->_tearEffectANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } pbVar5 = (byte *)0x0; LAB_00676426: uVar3 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_tearEffectANM2,pbVar5); blendDst = 1; if ((uVar3 & 4) == 0) { blendDst = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = blendDst; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; } ANM2::Play(&this->_tearEffectANM2,s_Idle,0); goto LAB_00676b9b; } fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 3.92364e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/HolyLightTearEffect.anm2",0x1d); local_14 = 3; ANM2::Load(&this->_tearEffectANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } uVar3 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_tearEffectANM2,(byte *)0x0); blendDst = 1; if ((uVar3 & 4) == 0) { blendDst = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = blendDst; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; pbVar5 = (this->_tearEffectANM2)._animState._animData; if (pbVar5 != (byte *)0x0) { pbVar2 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar2 = *(byte **)pbVar5; } expectedNameCh = s_Idle; do { bVar1 = *pbVar2; bVar4 = bVar1 < *expectedNameCh; if (bVar1 != *expectedNameCh) goto LAB_006767e0; if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar4 = bVar1 < expectedNameCh[1]; if (bVar1 != expectedNameCh[1]) goto LAB_006767e0; pbVar2 = pbVar2 + 2; expectedNameCh = expectedNameCh + 2; } while (bVar1 != 0); LAB_006767dc: uVar3 = 0; goto LAB_006767e5; } } else { fStack_34 = 0.0; local_30 = 2.10195e-44; local_44[0] = '\0'; local_44[1] = '\0'; local_44[2] = '\0'; local_44[3] = '\0'; local_44._0_4_ = std::_Allocate(0x20); fStack_34 = 4.06377e-44; local_30 = 4.34403e-44; builtin_strncpy((char *)local_44._0_4_,"gfx/LittleHornTearEffect.anm2",0x1e); local_14 = 2; ANM2::Load(&this->_tearEffectANM2,(std_string *)local_44,1); local_14 = 0xffffffff; if (0xf < (uint)local_30) { uVar3 = (int)local_30 + 1; freeBlock = (char *)local_44._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(local_44._0_4_ + -4); uVar3 = (int)local_30 + 0x24; if ((char *)0x1f < (char *)(local_44._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } layerIdx = (byte *)0x0; if ((this->_tearEffectANM2)._layerCount != 0) { do { uVar3 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_tearEffectANM2,layerIdx); local_38 = 0.0; fStack_34 = 0.0; blendDst = 1; layer->_blendMode[0] = 0; if ((uVar3 & 4) == 0) { blendDst = 6; } layer->_blendMode[2] = 1; layer->_blendMode[1] = blendDst; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; local_30 = 0.0; layer = ANM2::GetLayer(&this->_tearEffectANM2,layerIdx); if (&layer->_color != (ColorMod *)local_58) { (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 0.7; (layer->_color)._tint[2] = 0.7; (layer->_color)._tint[3] = 1.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; (layer->_color)._offset[0] = local_38; (layer->_color)._offset[1] = fStack_34; (layer->_color)._offset[2] = local_30; } layerIdx = layerIdx + 1; } while (layerIdx < (byte *)(this->_tearEffectANM2)._layerCount); } pbVar5 = (this->_tearEffectANM2)._animState._animData; if (pbVar5 != (byte *)0x0) { pbVar2 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar2 = *(byte **)pbVar5; } expectedNameCh = s_Idle; do { bVar1 = *pbVar2; bVar4 = bVar1 < *expectedNameCh; if (bVar1 != *expectedNameCh) goto LAB_006767e0; if (bVar1 == 0) goto LAB_006767dc; bVar1 = pbVar2[1]; bVar4 = bVar1 < expectedNameCh[1]; if (bVar1 != expectedNameCh[1]) goto LAB_006767e0; pbVar2 = pbVar2 + 2; expectedNameCh = expectedNameCh + 2; } while (bVar1 != 0); uVar3 = 0; LAB_006767e5: if ((uVar3 == 0) && ((pbVar5[0x34] == 0 || ((this->_tearEffectANM2)._animState._isPlaying != 0)))) goto LAB_00676b9b; } } bVar1 = ANM2::SetAnimation(&this->_tearEffectANM2,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_tearEffectANM2)._animState); (this->_tearEffectANM2)._animState._isPlaying = 1; } LAB_00676b9b: *(undefined4 *)&(this->_tearFlags)._l = (undefined4)flags._l; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = flags._l._4_4_; *(undefined4 *)&(this->_tearFlags)._h = (undefined4)flags._h; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = flags._h._4_4_; ExceptionList = local_1c; return; LAB_006767e0: uVar3 = -(uint)bVar4 | 1; goto LAB_006767e5; } //@@ 00676bd0 FUN_00676bd0 void FUN_00676bd0(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x41c) = in_XMM1_Da; return; } //@@ 00676be0 Entity_Tear::UpdateBoneTear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? uses tears_brokenbone.png prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Tear::UpdateBoneTear(Entity_Tear *this,Entity *target) { uint *puVar1; float fVar2; BitSet128 flags; BitSet128 flags_00; byte bVar3; uint uVar4; BitSet128 *pBVar5; int iVar6; BitSet128 *pBVar7; Entity *spawned; Entity_Tear *childTear; EntityPtr *childScalePtr; BitSet128 *pBVar8; uint seed; byte extraout_CL; byte extraout_CL_00; char *ptr; float fVar9; undefined4 uVar10; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; BitSet128 local_110; BitSet128 local_100; BitSet128 local_f0; BitSet128 local_e0; BitSet128 local_d0; BitSet128 local_c0; BitSet128 local_b0; Vector local_a0; Vector local_98; BitSet128 *tearFlags; Vector local_8c; BitSet128 childFlags; EntityPtr local_74; EntityPtr local_70; float alphaMultiplier; Entity_Tear *local_68; EntityPtr local_64; Entity_Tear *local_60; char isDeadRising; char *spritesheetPath [2]; BitSet128 local_50; ColorMod color; void *local_10; undefined1 *puStack_c; float local_8; float childScale; Game *game; Manager *manager; local_8 = -NAN; puStack_c = &LAB_00af79ad; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(&color)[1]._colorize; ExceptionList = &local_10; local_70 = (EntityPtr)target; local_a0.y = (float)this; if ((this->_dead == 0) || (((pBVar5 = BitSet128::operator_and(&childFlags,&this->_tearFlags,(BitSet128 *)&DAT_00c345e0), (int)pBVar5->_l == 0 && *(int *)((int)&pBVar5->_l + 4) == 0 && ((int)pBVar5->_h == 0 && *(int *)((int)&pBVar5->_h + 4) == 0)) || (isDeadRising = '\x01', 0.0 < this->_fallingSpeed || this->_fallingSpeed == 0.0)))) { isDeadRising = '\0'; } alphaMultiplier = 1.0; iVar6 = __RTDynamicCast(this->_spawnerEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0,uVar4); if (((iVar6 != 0) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) && (bVar3 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar6 + 0x1618)), bVar3 == 0)) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { alphaMultiplier = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } else { alphaMultiplier = 1.0; } } fVar9 = 1.0; pBVar5 = &this->_tearFlags; tearFlags = pBVar5; pBVar7 = BitSet128::operator_and(&childFlags,pBVar5,(BitSet128 *)&DAT_00c34850); if (((((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) && (fVar9 < this->_collisionDamage)) && ((this->_height <= -5.0 && this->_height != -5.0 || (isDeadRising != '\0')))) { local_68 = (Entity_Tear *)0x0; local_74 = (EntityPtr)0x3c23d70a; do { fVar9 = (this->_velocity).x; local_8c.x = (this->_velocity).y; local_8c.y = -fVar9; if (local_68 == (Entity_Tear *)0x1) { local_8c.x = -local_8c.x; local_8c.y = fVar9; } uVar4 = Random(); local_98.x = (this->_pos).x - (this->_velocity).x; local_98.y = (this->_pos).y - (this->_velocity).y; uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; spawned = Game::Spawn(g_game,2,0,&local_98,&local_8c,(Entity *)this->_spawnerEntity,0,uVar4); childTear = (Entity_Tear *)__RTDynamicCast(spawned,uVar10,pTVar11,pTVar12,uVar13); local_60 = childTear; if (isDeadRising == '\0') { local_64 = (EntityPtr)(this->_height / 1.5); childTear->_height = (float)local_64; fVar9 = get_height_offset_y(childTear,(float)local_64); game = g_game; (childTear->_posOffset).y = fVar9; if ((*(int *)((int)game->_room + 8) == 0x10) && ((childTear->_posOffset).y = -18.0, -5.1 < (float)local_64)) { childTear->_height = -5.1; } childTear->_fallingSpeed = this->_fallingSpeed; fVar9 = this->_collisionDamage * 0.5; } else { childTear->_height = -5.1; fVar9 = get_height_offset_y(childTear,-5.1); game = g_game; (childTear->_posOffset).y = fVar9; if (*(int *)((int)game->_room + 8) == 0x10) { (childTear->_posOffset).y = -18.0; } childTear->_fallingSpeed = this->_fallingSpeed; childTear->_fallingAccel = 2.0; fVar9 = this->_collisionDamage * 0.25; } (**(code **)(*(int *)childTear + 0x40))(fVar9); local_64 = (EntityPtr)(this->_fScale * 0.5); childScalePtr = &local_64; if ((float)local_64 <= 0.01) { childScalePtr = &local_74; } childScale = *(float *)childScalePtr; childTear->_baseScale = childScale; childTear->_fScale = childScale; ResetSpriteScale(childTear); local_64 = (EntityPtr)BitSet128::__bnot((BitSet128 *)&DAT_00c34780,&local_110); pBVar5 = BitSet128::__bnot((BitSet128 *)&DAT_00c345e0,&local_50); pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c345c0,&local_c0); pBVar8 = BitSet128::__bnot(&g_tearFlagLudovico,&local_d0); pBVar8 = BitSet128::operator_and(&local_e0,tearFlags,pBVar8); pBVar7 = BitSet128::operator_and(&local_f0,pBVar8,pBVar7); pBVar5 = BitSet128::operator_and(&local_100,pBVar7,pBVar5); BitSet128::operator_and(&childFlags,pBVar5,(BitSet128 *)local_64); if (isDeadRising != '\0') { pBVar5 = BitSet128::__bnot(&g_tearFlagExplosive,&local_b0); childFlags._l._0_4_ = (uint)childFlags._l & (uint)pBVar5->_l; childFlags._l._4_4_ = childFlags._l._4_4_ & *(uint *)((int)&pBVar5->_l + 4); childFlags._h._0_4_ = (uint)childFlags._h & (uint)pBVar5->_h; childFlags._h._4_4_ = childFlags._h._4_4_ & *(uint *)((int)&pBVar5->_h + 4); } childTear = local_60; this = (Entity_Tear *)local_a0.y; color._tint[0] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[0]; color._tint[1] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[1]; color._tint[2] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[2]; color._offset[2] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._offset[2]; color._colorize[0] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[0]; color._colorize[1] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[1]; color._colorize[2] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[2]; color._colorize[3] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[3]; color._tint[3] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[3] * alphaMultiplier; color._offset._0_8_ = *(undefined8 *)(((ANM2 *)((int)local_a0.y + 0x48))->_color)._offset; (**(code **)(*(int *)local_60 + 0x3c))(&color,0xffffffff,0xff,0,1); flags._l._4_4_ = childFlags._l._4_4_; flags._l._0_4_ = (uint)childFlags._l; flags._h._0_4_ = (uint)childFlags._h; flags._h._4_4_ = childFlags._h._4_4_; SetTearFlags(childTear,flags); local_64 = *(EntityPtr *)((int)this + 0x3bc); if (childTear->_parent != (EntityPtr)0x0) { local_60 = (Entity_Tear *)&childTear->_parent; std::multiset::erase(&local_60); } childTear->_parent = local_64; if (local_64 != (EntityPtr)0x0) { std::multiset::insert(&childTear->_parent); } (**(code **)(*(int *)childTear + 0xc))(); local_68 = (Entity_Tear *)((int)local_68 + 1); } while ((int)local_68 < 2); pBVar5 = (BitSet128 *)((int)this + 0x428); } fVar9 = -5.0; pBVar7 = BitSet128::operator_and(&local_b0,pBVar5,(BitSet128 *)&DAT_00c348f0); if ((((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) && (this->_height <= fVar9 && fVar9 != this->_height)) { local_64 = (EntityPtr)0x0; do { uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_60 = (Entity_Tear *)(fVar9 + fVar9); local_68 = (Entity_Tear *)sin((float)local_60); fVar9 = (this->_velocity).y; fVar2 = (this->_velocity).x; local_74 = (EntityPtr)sqrtf(fVar2 * fVar2 + fVar9 * fVar9); local_98.x = cos((float)local_60); local_98.x = local_98.x * (float)local_74; uVar4 = this->_variant; local_98.y = (float)local_68 * (float)local_74; if (uVar4 == 0x32) { uVar4 = 0x1d; } seed = Random(); local_8c.x = (this->_pos).x - (this->_velocity).x; local_8c.y = (this->_pos).y - (this->_velocity).y; uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; spawned = Game::Spawn(g_game,2,uVar4,&local_8c,&local_98,(Entity *)this->_spawnerEntity,0,seed ); childTear = (Entity_Tear *)__RTDynamicCast(spawned,uVar10,pTVar11,pTVar12,uVar13); local_68 = childTear; if (uVar4 == 0x1d) { spritesheetPath[0] = std::_Allocate(0x20); local_50._h._0_4_ = 0x18; local_50._h._4_4_ = 0x1f; builtin_strncpy(spritesheetPath[0],"gfx/tears_brokenbone.png",0x19); local_8 = 0.0; Sprite::ReplaceSpritesheet((Sprite *)&childTear->_sprite,0,(std_string *)spritesheetPath); local_8 = -NAN; bVar3 = extraout_CL; if (0xf < local_50._h._4_4_) { uVar4 = local_50._h._4_4_ + 1; ptr = spritesheetPath[0]; if (0xfff < uVar4) { ptr = *(char **)(spritesheetPath[0] + -4); uVar4 = local_50._h._4_4_ + 0x24; if ((char *)0x1f < spritesheetPath[0] + (-4 - (int)ptr)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); bVar3 = extraout_CL_00; } ANM2::LoadGraphics(&childTear->_sprite,bVar3); } local_60 = (Entity_Tear *)this->_height; childTear->_height = (float)local_60; fVar9 = get_height_offset_y(childTear,(float)local_60); game = g_game; (childTear->_posOffset).y = fVar9; if ((*(int *)((int)game->_room + 8) == 0x10) && ((childTear->_posOffset).y = -18.0, -5.1 < (float)local_60)) { childTear->_height = -5.1; } childTear->_fallingSpeed = this->_fallingSpeed; (**(code **)(*(int *)childTear + 0x40))(this->_collisionDamage * 0.5); pBVar5 = BitSet128::__bnot((BitSet128 *)&DAT_00c34780,&local_b0); pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c348f0,&local_100); pBVar8 = BitSet128::__bnot(&g_tearFlagLudovico,&local_f0); pBVar8 = BitSet128::operator_and(&local_e0,tearFlags,pBVar8); pBVar7 = BitSet128::operator_and(&local_d0,pBVar8,pBVar7); BitSet128::operator_and(&childFlags,pBVar7,pBVar5); if (isDeadRising != '\0') { pBVar5 = BitSet128::__bnot(&g_tearFlagExplosive,&local_c0); childFlags._l._0_4_ = (uint)childFlags._l & (uint)pBVar5->_l; childFlags._l._4_4_ = childFlags._l._4_4_ & *(uint *)((int)&pBVar5->_l + 4); childFlags._h._0_4_ = (uint)childFlags._h & (uint)pBVar5->_h; childFlags._h._4_4_ = childFlags._h._4_4_ & *(uint *)((int)&pBVar5->_h + 4); } childTear = local_68; this = (Entity_Tear *)local_a0.y; color._tint[0] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[0]; color._tint[1] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[1]; color._tint[2] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[2]; color._offset[2] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._offset[2]; color._colorize[0] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[0]; color._colorize[1] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[1]; color._colorize[2] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[2]; color._colorize[3] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._colorize[3]; color._tint[3] = (((ANM2 *)((int)local_a0.y + 0x48))->_color)._tint[3] * alphaMultiplier; color._offset._0_8_ = *(undefined8 *)(((ANM2 *)((int)local_a0.y + 0x48))->_color)._offset; (**(code **)(*(int *)local_68 + 0x3c))(&color,0xffffffff,0xff,0,1); flags_00._l._4_4_ = childFlags._l._4_4_; flags_00._l._0_4_ = (uint)childFlags._l; flags_00._h._0_4_ = (uint)childFlags._h; flags_00._h._4_4_ = childFlags._h._4_4_; SetTearFlags(childTear,flags_00); local_74 = *(EntityPtr *)((int)this + 0x3bc); if (childTear->_parent != (EntityPtr)0x0) { local_60 = (Entity_Tear *)&childTear->_parent; std::multiset::erase(&local_60); } childTear->_parent = local_74; if (local_74 != (EntityPtr)0x0) { std::multiset::insert(&childTear->_parent); } (**(code **)(*(int *)childTear + 0xc))(); local_64 = (EntityPtr)((int)local_64 + 1); } while ((int)local_64 < 2); pBVar5 = (BitSet128 *)((int)this + 0x428); } pBVar7 = BitSet128::operator_and(&local_b0,pBVar5,(BitSet128 *)&DAT_00c34900); if ((((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) && (this->_height <= -5.0 && this->_height != -5.0)) { spawned = spawn_chain_lightning (&this->_pos,*pBVar5,(Entity *)this->_spawnerEntity, this->_collisionDamage * 0.5); if (local_70 != (EntityPtr)0x0) { if (spawned->_target != (EntityPtr)0x0) { local_60 = (Entity_Tear *)&spawned->_target; std::multiset::erase(&local_60); } spawned->_target = local_70; std::multiset::insert(&spawned->_target); } color._tint[0] = (spawned->_sprite)._color._tint[0]; color._tint[1] = (spawned->_sprite)._color._tint[1]; color._tint[2] = (spawned->_sprite)._color._tint[2]; color._colorize[0] = (spawned->_sprite)._color._colorize[0]; color._colorize[1] = (spawned->_sprite)._color._colorize[1]; color._colorize[2] = (spawned->_sprite)._color._colorize[2]; color._colorize[3] = (spawned->_sprite)._color._colorize[3]; color._tint[3] = (spawned->_sprite)._color._tint[3] * alphaMultiplier; color._offset._0_8_ = *(undefined8 *)(spawned->_sprite)._color._offset; color._offset[2] = (spawned->_sprite)._color._offset[2]; (**(code **)(*(int *)spawned + 0x3c))(&color,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawned + 0xc))(); pBVar5 = &this->_tearFlags; } pBVar7 = BitSet128::operator_and(&local_b0,pBVar5,(BitSet128 *)&DAT_00c34970); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c34970,&local_b0); *(uint *)&pBVar5->_l = (uint)pBVar5->_l & (uint)pBVar7->_l; puVar1 = (uint *)((int)&pBVar5->_l + 4); *puVar1 = *puVar1 & *(uint *)((int)&pBVar7->_l + 4); *(uint *)&pBVar5->_h = (uint)pBVar5->_h & (uint)pBVar7->_h; puVar1 = (uint *)((int)&pBVar5->_h + 4); *puVar1 = *puVar1 & *(uint *)((int)&pBVar7->_h + 4); game = g_game; bVar3 = Room::IsPositionInRoom(g_game->_room,&this->_pos,-10.0); if (bVar3 != 0) { local_60 = (Entity_Tear *)(this->_collisionDamage * 0.5); Room::GetClampedPositionImpl(game->_room,&local_a0,&this->_pos,0.0,0.0,0.0,0.0); uVar4 = Random(); spawned = Game::Spawn(g_game,1000,0xb4,&local_a0,&g_vectorZero,(Entity *)this->_spawnerEntity, 0,uVar4); fVar9 = this->_fScale * g_vectorOne.x; iVar6 = *(int *)spawned; (spawned->_sprite)._scale.y = this->_fScale * g_vectorOne.y; (spawned->_sprite)._scale.x = fVar9; (**(code **)(iVar6 + 0x40))(local_60); uVar10 = 0x3c; iVar6 = *(int *)spawned; if (1 < *(int *)&g_game->_deathmatchManager) { uVar10 = 0x1e; } *(undefined4 *)(spawned[1]._sprite._filename._buf + 8) = uVar10; *(undefined4 *)(spawned[1]._sprite._filename._buf + 0xc) = uVar10; (**(code **)(iVar6 + 0xc))(); manager = g_manager; local_70 = (EntityPtr)0x440; seed_fart_sound_override((int *)&local_70); SoundEffects::Play(&manager->_sfxManager,(int)local_70,0.5,2,0,1.0,0.0); } } ExceptionList = local_10; return; } //@@ 00677780 Entity_Tear::ResetSpriteScale /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void Entity_Tear::ResetSpriteScale(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Tear::ResetSpriteScale(Entity_Tear *this) { float *scaleThreshold; uint startFrame; void *animData; int iVar1; LayerState *layer; char *format; int scaleAnimBase; byte *layerIndex; uint uVar2; float fVar3; float fVar4; float fVar5; float local_4c; float local_48; float sizeMultiX; float local_40; float layerSizeY; undefined1 local_38 [8]; void *seedEffectNode; byte animName [32]; uint local_c; Game *game; local_c = __security_cookie ^ (uint)&local_4c; local_4c = 1.0; iVar1 = this->_variant; scaleAnimBase = iVar1 * 100; local_48 = (float)scaleAnimBase; switch(iVar1) { case 0: case 1: case 2: case 3: case 10: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x29: case 0x30: uVar2 = 1; scaleThreshold = (float *)&DAT_00b64e30; do { if (this->_fScale <= *scaleThreshold + 0.05) break; uVar2 = uVar2 + 1; scaleThreshold = scaleThreshold + 1; } while (uVar2 < 0xd); if (this->_scaleAnimNum != scaleAnimBase + uVar2) { if (((((iVar1 == 1) || (iVar1 == 0xc)) || (iVar1 == 0xf)) || ((iVar1 == 0x11 || (iVar1 == 0x22)))) || (iVar1 == 0x19)) { format = "BloodTear%d"; } else if ((iVar1 == 2) || (iVar1 == 0x1e)) { format = "Tooth%dMove"; } else if (iVar1 == 0x14) { format = "Rotate%d"; } else if ((((iVar1 == 0x16) || (iVar1 == 0x1a)) || (iVar1 == 0x1b)) || (((iVar1 == 0x1c || (iVar1 == 0x1d)) || (iVar1 == 0x30)))) { format = "Stone%dMove"; } else { format = "RegularTear%d"; } sprintf_s(animName,0x20,(byte *)format); ANM2::Play(&this->_sprite,animName,0); this->_scaleAnimNum = scaleAnimBase + uVar2; } if ((int)uVar2 < 0xd) { if ((((DAT_00c34b30 | (uint)g_tearFlagLudovico._l) & (uint)(this->_tearFlags)._l) == 0 && ((DAT_00c34b34 | g_tearFlagLudovico._l._4_4_) & *(uint *)((int)&(this->_tearFlags)._l + 4)) == 0) && (((DAT_00c34b38 | (uint)g_tearFlagLudovico._h) & (uint)(this->_tearFlags)._h) == 0 && (*(uint *)((int)&(this->_tearFlags)._h + 4) & (DAT_00c34b3c | g_tearFlagLudovico._h._4_4_) ) == 0)) { local_4c = 1.0; fVar3 = 1.0; } else { local_4c = this->_fScale / *(float *)(&DAT_00b64e2c + uVar2 * 4); fVar3 = local_4c; } } else { local_4c = this->_fScale / 2.75; fVar3 = local_4c; } break; default: if (this->_scaleAnimNum != scaleAnimBase) { ANM2::Play(&this->_sprite,s_Idle,0); this->_scaleAnimNum = scaleAnimBase; } case 0x28: switchD_006777c1_caseD_28: fVar3 = 1.0; break; case 5: case 6: case 7: if (this->_scaleAnimNum != scaleAnimBase) { ANM2::Play(&this->_sprite,(byte *)"MoveHori",0); this->_scaleAnimNum = scaleAnimBase; } local_4c = this->_fScale / 2.75; fVar3 = (this->_velocity).x + 0.0; fVar4 = this->_fallingSpeed + (this->_velocity).y; if (0 < this->_waitFrames) { fVar3 = (this->_continueVelocity).x; fVar4 = (this->_continueVelocity).y; } fVar3 = atan2f(fVar4,fVar3); (this->_sprite)._rotation = fVar3 * 57.295776; fVar3 = local_4c; break; case 8: case 0x2a: local_4c = this->_fScale; iVar1 = 0; do { if (local_4c <= (float)(&DAT_00b64e90)[iVar1]) break; iVar1 = iVar1 + 1; } while (iVar1 < 5); sprintf(animName,(byte *)"Rotate%d"); if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&this->_sprite,animName,0); animData = (this->_sprite)._animState._animData; if ((animData == (void *)0x0) || (uVar2 = *(uint *)((int)animData + 0x30), uVar2 == 0)) { startFrame = 0; } else { startFrame = Random(); startFrame = startFrame % uVar2; animData = (this->_sprite)._animState._animData; } if (animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)startFrame); } } else { ANM2::SetAnimation(&this->_sprite,animName,0); } fVar3 = local_4c; if (this->_variant == 8) { this->_fScale = this->_fScale + this->_fScale; } break; case 9: if (this->_dead == 0) { if (this->_scaleAnimNum != scaleAnimBase) { ANM2::Play(&this->_sprite,(byte *)"Rotate",0); this->_scaleAnimNum = scaleAnimBase; } (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; } goto switchD_006777c1_caseD_28; case 0x2e: ANM2::Play(&this->_sprite,(byte *)"Flickering",0); uVar2 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); iVar1 = 1; if ((uVar2 & 4) == 0) { iVar1 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar1; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; goto switchD_006777c1_caseD_28; case 0x2f: case 0x31: ANM2::Play(&this->_sprite,s_Idle,0); local_4c = this->_fScale; fVar3 = local_4c; break; case 0x32: uVar2 = 0; fVar3 = this->_fScale + 0.25; this->_fScale = fVar3; do { if (fVar3 <= (float)(&DAT_00b64e70)[uVar2]) break; uVar2 = uVar2 + 1; } while ((int)uVar2 < 4); if (this->_scaleAnimNum != uVar2 + scaleAnimBase) { this->_scaleAnimNum = uVar2 + scaleAnimBase; sprintf(animName,(byte *)"Rotate%d"); if (this->_scaleAnimNum / 100 == (int)local_48 / 100) { iVar1 = ANM2::GetFrame(&this->_sprite); ANM2::Play(&this->_sprite,animName,0); if (iVar1 < 0) goto LAB_00677c46; } else { ANM2::Play(&this->_sprite,animName,0); LAB_00677c46: animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { iVar1 = 0; } else { iVar1 = *(int *)((int)animData + 0x30); } iVar1 = Isaac::Random(iVar1); } if (((this->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar1), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } } if (uVar2 < 5) { local_4c = this->_fScale / (float)(&DAT_00b64e70)[uVar2]; fVar3 = local_4c; } else { local_4c = this->_fScale / 2.25; fVar3 = local_4c; } } game = g_game; fVar4 = (this->_sizeMulti).x; fVar5 = (this->_sizeMulti).y; uVar2 = this->_variant; local_48 = fVar5; sizeMultiX = fVar4; if (uVar2 < 0x33) { if ((uVar2 == 0xd) || (uVar2 == 0x17)) { local_40 = 1.10703e-43; std::set::find_node(local_38,&local_40); if ((*(char *)((int)seedEffectNode + 0xd) == '\0') && ((*(int *)((int)seedEffectNode + 0x10) < 0x50 && (seedEffectNode != (game->_seedEffects)._seedEffects)))) { fVar4 = fVar4 / 3.0; sizeMultiX = fVar4; } } layerIndex = (byte *)0x0; if ((this->_sprite)._layerCount != 0) { do { local_40 = fVar3 * g_vectorOne.x * fVar4; layerSizeY = fVar3 * g_vectorOne.y * fVar5; layer = ANM2::GetLayer(&this->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_size).x = local_40; (layer->_size).y = layerSizeY; fVar4 = sizeMultiX; fVar5 = local_48; fVar3 = local_4c; } while (layerIndex < (byte *)(this->_sprite)._layerCount); } } else { layerIndex = (byte *)0x0; if ((this->_sprite)._layerCount != 0) { do { local_40 = this->_fScale * g_vectorOne.y * local_48; local_4c = this->_fScale * g_vectorOne.x * sizeMultiX; layer = ANM2::GetLayer(&this->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_size).x = local_4c; (layer->_size).y = local_40; fVar4 = sizeMultiX; fVar5 = local_48; } while (layerIndex < (byte *)(this->_sprite)._layerCount); } } if ((((uint)(this->_tearFlags)._l & _DAT_00c34920) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34924) != 0) || (((uint)(this->_tearFlags)._h & _DAT_00c34928) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3492c) != 0)) { fVar3 = this->_fScale * 0.45; (this->_tearHaloANM2)._scale.y = fVar3 * fVar5; (this->_tearHaloANM2)._scale.x = fVar3 * fVar4; if ((this->_tearHaloANM2)._loaded != 0) { AnimationState::Update(&(this->_tearHaloANM2)._animState); AnimationState::Update(&(this->_tearHaloANM2)._overlayAnimState); } } if ((this->_tearEffectANM2)._loaded != 0) { fVar3 = this->_fScale * 0.45; (this->_tearEffectANM2)._scale.y = fVar3 * local_48; (this->_tearEffectANM2)._scale.x = fVar3 * sizeMultiX; AnimationState::Update(&(this->_tearEffectANM2)._animState); AnimationState::Update(&(this->_tearEffectANM2)._overlayAnimState); } if (this->_deadEyeIntensity != 0.0) { fVar3 = this->_fScale * 0.45; (this->_deadEyeANM2)._scale.y = fVar3 * local_48; (this->_deadEyeANM2)._scale.x = fVar3 * sizeMultiX; if ((this->_deadEyeANM2)._loaded != 0) { AnimationState::Update(&(this->_deadEyeANM2)._animState); AnimationState::Update(&(this->_deadEyeANM2)._overlayAnimState); } } Entity::SetSize((Entity *)this,*(float *)((int)this->_config + 0x38) * this->_fScale, this->_sizeMulti,*(int *)((int)this->_config + 0x48)); this->_shadowSize = *(float *)((int)this->_config + 0x24) * this->_fScale * (sizeMultiX + local_48) * 0.5; return; } //@@ 00678060 Entity_Tear::is_not_familiar_spawned /* DB: ? +0x3bc type != 2... returns true */ int __thiscall Entity_Tear::is_not_familiar_spawned(Entity_Tear *this) { EntityPtr EVar1; EVar1 = this->_parent; if ((EVar1 == (EntityPtr)0x0) || (*(int *)((int)EVar1 + 0x28) != 2)) { return CONCAT31(EVar1._1_3_,1); } return (uint)EVar1._1_3_ << 8; } //@@ 00678080 Entity_Tear::fire_split_projectiles /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? Entity_Tear::Update when (flags & mask) nonzero: spawns child projectiles matching the owner weapon: FireTechLaser/FireTechXLaser/FireDelayedBrimstone/FireBomb or SpawnEx tears with SetTearFlags/ResetSpriteScale, sin/cos spread prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Tear::fire_split_projectiles(Entity_Tear *this,byte isHalved) { uint *puVar1; double dVar2; EntityPtr EVar3; code *pcVar4; BitSet128 flags; qword qVar5; byte isOwned; uint uVar6; Entity_Tear *childShot; Entity_Bomb *childBomb; uint uVar7; Entity_Laser *techXLaser; Entity *spawned; uint uVar8; int iVar9; uint uVar10; uint uVar11; float fVar12; float fVar13; float fVar14; Entity_Player *player; uint splitCount; float shotSpeed; Vector bombVelocity; Vector bombPos; Vector techXVelocity; Vector laserDirection; Vector tearVelocity; uint uStack_20; uint uStack_1c; uint uStack_18; uint uStack_14; Game *game; player = (Entity_Player *)0x0; EVar3 = this->_parent; if (EVar3 == (EntityPtr)0x0) { LAB_006780c0: splitCount = 6; if (player == (Entity_Player *)0x0) goto LAB_00678128; } else { if (*(int *)((int)EVar3 + 0x28) != 1) { if (*(int *)((int)EVar3 + 0x28) == 3) { player = *(Entity_Player **)((int)EVar3 + 0x410); } goto LAB_006780c0; } player = (Entity_Player *)EVar3; } isOwned = Entity_Player::HasCollectible(player,0xe5,0); if ((isOwned == 0) && (isOwned = Entity_Player::HasCollectible(player,0x18b,0), isOwned == 0)) { isOwned = Entity_Player::HasCollectible(player,0x76,0); if (isOwned != 0) { splitCount = 4; goto LAB_00678128; } splitCount = 6; isOwned = Entity_Player::HasCollectible(player,0x34,0); if (isOwned == 0) goto LAB_00678128; } splitCount = 3; LAB_00678128: uVar6 = Random(); splitCount = splitCount + uVar6 % splitCount; if (isHalved != 0) { splitCount = (splitCount + 1) / 2; } shotSpeed = 1.0; if (player != (Entity_Player *)0x0) { shotSpeed = player->_shotspeed; } if (splitCount != 0) { do { if (player == (Entity_Player *)0x0) { LAB_00678885: uVar6 = Random(); EVar3 = this->_spawnerEntity; uVar7 = Random(); fVar12 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; fVar13 = cos(fVar12); fVar12 = sin(fVar12); tearVelocity.x = fVar13 * shotSpeed * 10.0 - fVar12 * 0.0; tearVelocity.y = fVar12 * shotSpeed * 10.0 + fVar13 * 0.0; spawned = Game::SpawnEx(g_game,2,1,&this->_pos,&tearVelocity,(Entity *)EVar3,0,uVar6,0); childShot = (Entity_Tear *) __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80008) && (_Init_thread_header(&DAT_00c80008), DAT_00c80008 == -1)) { DAT_00c80010 = DAT_00c34630 | DAT_00c34b70 | DAT_00c349c0 | DAT_00c349d0 | DAT_00c349e0 | DAT_00c349f0 | DAT_00c345f0 | _DAT_00c345e0 | _DAT_00c345d0 | _DAT_00c345a0 | DAT_00c34a00 | _DAT_00c34900 | DAT_00c34a10 | DAT_00c34a20 | _DAT_00c34940 | DAT_00c34a30 | DAT_00c34a40 | DAT_00c34a50 | DAT_00c34a60 | DAT_00c348e0 | DAT_00c34a70 | DAT_00c34a80 | DAT_00c34a90 | DAT_00c34aa0 | DAT_00c34ab0 | _DAT_00c348d0 | DAT_00c34930 | _DAT_00c34ac0 | DAT_00c34ad0 | _DAT_00c34920 | DAT_00c348c0 | DAT_00c348b0 | DAT_00c348a0 | DAT_00c34890 | _DAT_00c34ae0 | DAT_00c34b20 | DAT_00c34c00 | DAT_00c34c40 | DAT_00c34c20 | DAT_00c34b80 | DAT_00c34af0 | DAT_00c34bf0 | DAT_00c34c10 | DAT_00c34b00 | DAT_00c34870 | _DAT_00c34910 | DAT_00c34b30 | DAT_00c34be0 | (uint)g_tearFlagPoison._l | DAT_00c34c30 | (uint)g_tearFlagHoming._l | (uint)g_tearFlagSpectral._l | DAT_00c34b50; DAT_00c80014 = DAT_00c34634 | DAT_00c34b74 | DAT_00c349c4 | DAT_00c349d4 | DAT_00c349e4 | DAT_00c349f4 | DAT_00c345f4 | _DAT_00c345e4 | _DAT_00c345d4 | _DAT_00c345a4 | DAT_00c34a04 | _DAT_00c34904 | DAT_00c34a14 | DAT_00c34a24 | _DAT_00c34944 | DAT_00c34a34 | DAT_00c34a44 | DAT_00c34a54 | DAT_00c34a64 | DAT_00c348e4 | DAT_00c34a74 | DAT_00c34a84 | DAT_00c34a94 | DAT_00c34aa4 | DAT_00c34ab4 | _DAT_00c348d4 | DAT_00c34934 | _DAT_00c34ac4 | DAT_00c34ad4 | DAT_00c34924 | DAT_00c348c4 | DAT_00c348b4 | DAT_00c348a4 | DAT_00c34894 | _DAT_00c34ae4 | DAT_00c34b24 | DAT_00c34c04 | DAT_00c34c44 | DAT_00c34c24 | DAT_00c34b84 | DAT_00c34af4 | DAT_00c34bf4 | DAT_00c34c14 | DAT_00c34b04 | DAT_00c34874 | DAT_00c34914 | DAT_00c34b34 | DAT_00c34be4 | g_tearFlagPoison._l._4_4_ | DAT_00c34c34 | g_tearFlagHoming._l._4_4_ | g_tearFlagSpectral._l._4_4_ | DAT_00c34b54; DAT_00c80018 = DAT_00c34638 | DAT_00c34b78 | DAT_00c349c8 | DAT_00c349d8 | DAT_00c349e8 | DAT_00c349f8 | DAT_00c345f8 | _DAT_00c345e8 | _DAT_00c345d8 | _DAT_00c345a8 | DAT_00c34a08 | _DAT_00c34908 | DAT_00c34a18 | DAT_00c34a28 | _DAT_00c34948 | DAT_00c34a38 | DAT_00c34a48 | DAT_00c34a58 | DAT_00c34a68 | DAT_00c348e8 | DAT_00c34a78 | DAT_00c34a88 | DAT_00c34a98 | DAT_00c34aa8 | DAT_00c34ab8 | _DAT_00c348d8 | DAT_00c34938 | _DAT_00c34ac8 | DAT_00c34ad8 | _DAT_00c34928 | DAT_00c348c8 | DAT_00c348b8 | DAT_00c348a8 | DAT_00c34898 | _DAT_00c34ae8 | DAT_00c34b28 | DAT_00c34c08 | DAT_00c34c48 | DAT_00c34c28 | DAT_00c34b88 | DAT_00c34af8 | DAT_00c34bf8 | DAT_00c34c18 | DAT_00c34b08 | DAT_00c34878 | _DAT_00c34918 | DAT_00c34b38 | DAT_00c34be8 | (uint)g_tearFlagPoison._h | DAT_00c34c38 | (uint)g_tearFlagHoming._h | (uint)g_tearFlagSpectral._h | DAT_00c34b58; DAT_00c8001c = DAT_00c3463c | DAT_00c34b7c | DAT_00c349cc | DAT_00c349dc | DAT_00c349ec | DAT_00c349fc | DAT_00c345fc | _DAT_00c345ec | _DAT_00c345dc | _DAT_00c345ac | DAT_00c34a0c | DAT_00c3490c | DAT_00c34a1c | DAT_00c34a2c | _DAT_00c3494c | DAT_00c34a3c | DAT_00c34a4c | DAT_00c34a5c | DAT_00c34a6c | DAT_00c348ec | DAT_00c34a7c | DAT_00c34a8c | DAT_00c34a9c | DAT_00c34aac | DAT_00c34abc | _DAT_00c348dc | DAT_00c3493c | _DAT_00c34acc | DAT_00c34adc | DAT_00c3492c | DAT_00c348cc | DAT_00c348bc | DAT_00c348ac | DAT_00c3489c | _DAT_00c34aec | DAT_00c34b2c | DAT_00c34c0c | DAT_00c34c4c | DAT_00c34c2c | DAT_00c34b8c | DAT_00c34afc | DAT_00c34bfc | DAT_00c34c1c | DAT_00c34b0c | DAT_00c3487c | DAT_00c3491c | DAT_00c34b3c | DAT_00c34bec | g_tearFlagPoison._h._4_4_ | DAT_00c34c3c | g_tearFlagHoming._h._4_4_ | g_tearFlagSpectral._h._4_4_ | DAT_00c34b5c; _Init_thread_footer(&DAT_00c80008); } uStack_1c = DAT_00c80014 & *(uint *)((int)&(this->_tearFlags)._l + 4); uStack_20 = DAT_00c80010 & (uint)(this->_tearFlags)._l; uStack_14 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c8001c; uStack_18 = DAT_00c80018 & (uint)(this->_tearFlags)._h; flags._l._4_4_ = uStack_1c; flags._l._0_4_ = uStack_20; flags._h._0_4_ = uStack_18; flags._h._4_4_ = uStack_14; SetTearFlags(childShot,flags); uVar6 = Random(); (**(code **)(*(int *)childShot + 0x40)) ((this->_collisionDamage / 1.5) * ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.75)); fVar12 = fVar13 * this->_fScale * 0.55; if (fVar12 <= 0.01) { fVar12 = 0.01; } childShot->_baseScale = fVar12; childShot->_fScale = fVar12; ResetSpriteScale(childShot); fVar12 = -6.0; if (this->_height <= -6.0) { fVar12 = this->_height; } childShot->_height = fVar12; fVar13 = get_height_offset_y(childShot,fVar12); game = g_game; (childShot->_posOffset).y = fVar13; if ((*(int *)((int)game->_room + 8) == 0x10) && ((childShot->_posOffset).y = -18.0, -5.1 < fVar12)) { childShot->_height = -5.1; } uVar6 = Random(); childShot->_fallingAccel = 1.3; childShot->_fallingSpeed = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.75 + 0.5) * (float)this * 0.5; (**(code **)(*(int *)childShot + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); childShot->_prismTouched = this->_prismTouched; childShot->_multidimensionalTouched = this->_multidimensionalTouched; LAB_00678b68: (**(code **)(*(int *)childShot + 0xc))(); } else { isOwned = Entity_Player::HasCollectible(player,0x76,0); if (isOwned != 0) { uVar6 = Random(); childShot = (Entity_Tear *) Entity_Player::FireDelayedBrimstone (player,(float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0,player); (childShot->_pos).x = (this->_pos).x; (childShot->_pos).y = (this->_pos).y; iVar9 = *(int *)childShot; *(undefined1 *)&(childShot->_tearHaloANM2)._animState._layerFrames = 1; (**(code **)(iVar9 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); *(byte *)&(childShot->_tearHaloANM2)._overlayAnimState._currentlyTriggeredEvents = this->_prismTouched; *(byte *)&(childShot->_tearHaloANM2)._overlayAnimState._animData = this->_multidimensionalTouched; goto LAB_00678b68; } isOwned = Entity_Player::HasCollectible(player,0x34,0); if (isOwned == 0) { isOwned = Entity_Player::HasCollectible(player,0x18b,0); if (isOwned == 0) { isOwned = Entity_Player::HasCollectible(player,0x44,0); if (isOwned == 0) goto LAB_00678885; uVar6 = Random(); fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; fVar13 = cos(fVar12); laserDirection.y = sin(fVar12); laserDirection.x = fVar13 - laserDirection.y * 0.0; laserDirection.y = fVar13 * 0.0 + laserDirection.y; childShot = (Entity_Tear *) Entity_Player::FireTechLaser (player,&this->_pos,1,&laserDirection,0,0,(Entity *)0x0,1.0); (**(code **)(*(int *)childShot + 0x40))(childShot->_collisionDamage / 1.5); (childShot->_pos).x = (this->_pos).x; (childShot->_pos).y = (this->_pos).y; iVar9 = *(int *)childShot; *(undefined1 *)&(childShot->_tearHaloANM2)._animState._layerFrames = 1; (**(code **)(iVar9 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); *(byte *)&(childShot->_tearHaloANM2)._overlayAnimState._currentlyTriggeredEvents = this->_prismTouched; *(byte *)&(childShot->_tearHaloANM2)._overlayAnimState._animData = this->_multidimensionalTouched; goto LAB_00678b68; } uVar6 = Random(); dVar2 = __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]; fVar12 = player->_shotspeed * 10.0; uVar7 = Random(); fVar13 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; fVar14 = cos(fVar13); fVar13 = sin(fVar13); techXVelocity.y = fVar13 * fVar12 + fVar14 * 0.0; techXVelocity.x = fVar14 * fVar12 - fVar13 * 0.0; techXLaser = Entity_Player::FireTechXLaser (player,&this->_pos,&techXVelocity, (float)((double)(int)uVar6 + dVar2) * 2.3283064e-10 * 60.0 + 20.0, (Entity *)0x0,1.0); techXLaser->_prismTouched = this->_prismTouched; techXLaser->_multidimensionalTouched = this->_multidimensionalTouched; (**(code **)(*(int *)techXLaser + 0xc))(); } else { uVar6 = Random(); fVar12 = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 3.0) * player->_shotspeed; uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; fVar14 = cos(fVar13); fVar13 = sin(fVar13); bombVelocity.x = fVar12 * fVar14 - fVar13 * 0.0; bombVelocity.y = fVar12 * fVar13 + fVar14 * 0.0; uVar6 = Random(); fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar12 = fVar12 + fVar12; uVar6 = Random(); fVar13 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar14 = cos(fVar12); bombPos.x = fVar14 * fVar13 * 10.0 + (this->_pos).x; fVar12 = sin(fVar12); bombPos.y = fVar12 * fVar13 * 10.0 + (this->_pos).y; childBomb = Entity_Player::FireBomb(player,&bombPos,&bombVelocity,(Entity *)0x0); (**(code **)(*(int *)childBomb + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); childBomb->_prismTouched = this->_prismTouched; if (this->_canTriggerStreakEnd == 0) { uVar6 = *(uint *)((int)&(childBomb->_tearFlags)._l + 4); qVar5 = (childBomb->_tearFlags)._h; uVar7 = *(uint *)((int)&(childBomb->_tearFlags)._h + 4); uVar11 = ~DAT_00c34b98; uVar10 = ~DAT_00c34b9c; uVar8 = ~DAT_00c34b94; *(uint *)&(childBomb->_tearFlags)._l = ~DAT_00c34b90 & (uint)(childBomb->_tearFlags)._l; *(uint *)((int)&(childBomb->_tearFlags)._l + 4) = uVar8 & uVar6; *(uint *)&(childBomb->_tearFlags)._h = uVar11 & (uint)qVar5; *(uint *)((int)&(childBomb->_tearFlags)._h + 4) = uVar10 & uVar7; } childBomb->_loadCostumes = 1; childBomb->_scale = childBomb->_scale * 0.5; childBomb->_explosionDamage = childBomb->_explosionDamage * 0.5; childBomb->_radiusMultiplier = childBomb->_radiusMultiplier * 0.65; Entity::SetSize((Entity *)childBomb,childBomb->_size * 0.5, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); if ((childBomb->_variant != 0x13) && (childBomb->_variant != 0x14)) { uVar6 = Random(); childBomb->_fallSpeed = -3.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 5.0; uVar6 = (childBomb->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (childBomb->_dropRNG)._seed; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar6 = uVar6 >> ((byte)(childBomb->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(childBomb->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(childBomb->_dropRNG)._shift3 & 0x1f) ^ uVar6; (childBomb->_dropRNG)._seed = uVar6; (childBomb->_posOffset).x = 0.0; iVar9 = uVar6 % 0xe + 10; (childBomb->_posOffset).y = -3.0; childBomb->_explosionCountdown1 = iVar9; *(int *)&childBomb->field_0x414 = iVar9; } *(uint *)&childBomb->_flags = (uint)childBomb->_flags | 0x4000000; puVar1 = (uint *)((int)&childBomb->_flags + 4); *puVar1 = *puVar1 | 0x400; } } splitCount = splitCount - 1; } while (splitCount != 0); } return; } //@@ 006790c0 Entity_Tear::Render /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void Entity_Tear::Render(Vector *offset); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Tear::Render(Entity_Tear *this,Vector *offset) { Vector *position; ColorMod *pCVar1; float fVar2; undefined8 uVar3; byte bVar4; int iVar5; float fVar6; float fVar7; double dVar8; double dVar9; ColorMod CStack_bc; float fStack_90; float fStack_8c; float fStack_88; float fStack_84; float fStack_80; float fStack_7c; float fStack_78; float fStack_74; undefined4 auStack_6c [26]; if ((this->_exists != 0) && (this->_visible != 0)) { fVar7 = g_displayPixelRatio * g_screenPointScale; dVar8 = floor((double)(((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar7 + 0.5)); dVar9 = floor((double)(((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar7 + 0.5)); position = &this->_renderPosition; fVar2 = offset->y; position->x = (float)dVar8 / fVar7 + offset->x; (this->_renderPosition).y = (float)dVar9 / fVar7 + fVar2; if ((((uint)(this->_tearFlags)._l & _DAT_00c34920) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34924) != 0) || (((uint)(this->_tearFlags)._h & _DAT_00c34928) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3492c) != 0)) { ANM2::Render(&this->_tearHaloANM2,position,&g_vectorZero,&g_vectorZero); } if (((this->_tearEffectANM2)._loaded != 0) && (((uint)(this->_tearEffectANM2)._bitflags >> 0xd & 1) != 0)) { ANM2::Render(&this->_tearEffectANM2,position,&g_vectorZero,&g_vectorZero); } iVar5 = __RTDynamicCast(this->_spawnerEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor); fStack_90 = (this->_sprite)._color._tint[0]; fStack_8c = (this->_sprite)._color._tint[1]; fStack_88 = (this->_sprite)._color._tint[2]; fStack_84 = (this->_sprite)._color._tint[3]; pCVar1 = &(this->_sprite)._color; fVar2 = (this->_sprite)._color._offset[2]; fStack_80 = (this->_sprite)._color._colorize[0]; fStack_7c = (this->_sprite)._color._colorize[1]; fStack_78 = (this->_sprite)._color._colorize[2]; fStack_74 = (this->_sprite)._color._colorize[3]; uVar3 = *(undefined8 *)(this->_sprite)._color._offset; if ((iVar5 != 0) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) { bVar4 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar5 + 0x1618)); if (bVar4 == 0) { CStack_bc._colorize[0] = (this->_sprite)._color._colorize[0]; CStack_bc._colorize[1] = (this->_sprite)._color._colorize[1]; CStack_bc._colorize[2] = (this->_sprite)._color._colorize[2]; CStack_bc._colorize[3] = (this->_sprite)._color._colorize[3]; CStack_bc._tint[0] = pCVar1->_tint[0]; CStack_bc._tint[1] = (this->_sprite)._color._tint[1]; CStack_bc._tint[2] = (this->_sprite)._color._tint[2]; fVar7 = (this->_sprite)._color._tint[3]; CStack_bc._offset[2] = (this->_sprite)._color._offset[2]; fVar6 = (this->_sprite)._color._offset[0]; CStack_bc._offset[1] = (this->_sprite)._color._offset[1]; CStack_bc._tint[3] = fVar7; CStack_bc._offset[0] = fVar6; FUN_00925df0(); CStack_bc._tint[3] = fVar6 * fVar7; Sprite::SetColor((Sprite *)&this->_sprite,&CStack_bc); } } Entity::Render((Entity *)this,offset); if (pCVar1 != (ColorMod *)auStack_6c) { pCVar1->_tint[0] = fStack_90; (this->_sprite)._color._tint[1] = fStack_8c; (this->_sprite)._color._tint[2] = fStack_88; (this->_sprite)._color._tint[3] = fStack_84; (this->_sprite)._color._colorize[0] = fStack_80; (this->_sprite)._color._colorize[1] = fStack_7c; (this->_sprite)._color._colorize[2] = fStack_78; (this->_sprite)._color._colorize[3] = fStack_74; *(undefined8 *)(this->_sprite)._color._offset = uVar3; (this->_sprite)._color._offset[2] = fVar2; } if (((this->_tearEffectANM2)._loaded != 0) && (((uint)(this->_tearEffectANM2)._bitflags >> 0xd & 1) == 0)) { ANM2::Render(&this->_tearEffectANM2,position,&g_vectorZero,&g_vectorZero); } if (this->_deadEyeIntensity != 0.0) { ANM2::Render(&this->_deadEyeANM2,position,&g_vectorZero,&g_vectorZero); } FUN_00862b80(this,offset); } return; } //@@ 00679400 Entity_Tear::Interpolate /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [vtable slot 4] */ void __thiscall Entity_Tear::Interpolate(Entity_Tear *this) { byte isFlagSet; int iVar1; int playerLaser; Vector *pVVar2; int extraout_EDX; uint uVar3; EntityPtr EVar4; Game *game; float fVar5; undefined1 *puVar6; float fVar7; float fVar8; Vector local_34; undefined1 *local_2c; float local_28; Vector local_24; Entity_Tear *local_1c; undefined1 auStack_18 [8]; uint uStack_10; uint uStack_c; EntityPtr nextSpawner; EntityPtr spawner; Entity_Tear *tear; uint tearFlagsLo; if (0 < this->_holdTimer) { EVar4 = this->_parent; if (EVar4 == (EntityPtr)0x0) { return; } fVar5 = *(float *)((int)EVar4 + 0x340); fVar8 = (this->_holdOffset).y; (this->_pos).x = *(float *)((int)EVar4 + 0x33c) + (this->_holdOffset).x; (this->_pos).y = fVar5 + fVar8; return; } uVar3 = (uint)(this->_tearFlags)._h; local_2c = (undefined1 *)(uVar3 & DAT_00c34588); tearFlagsLo = (uint)(this->_tearFlags)._l; local_34.x = (float)(*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3458c); local_1c = this; if (((tearFlagsLo & DAT_00c34580) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34584) != 0) || (local_2c != (undefined1 *)0x0 || local_34.x != 0.0)) { if ((((tearFlagsLo & (uint)g_tearFlagLudovico._l) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagLudovico._l._4_4_) == 0) && ((((uVar3 & (uint)g_tearFlagLudovico._h) == 0 && (*(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagLudovico._h._4_4_) == 0 && (EVar4 = this->_parent, EVar4 != (EntityPtr)0x0)) && (*(int *)((int)EVar4 + 0x28) == 1)))) && (this->_stickTarget == (void *)0x0)) { iVar1 = __RTDynamicCast(EVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); playerLaser = __RTDynamicCast(*(undefined4 *)(iVar1 + 0x1430),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); if (playerLaser != 0) { auStack_18._0_4_ = (uint)(this->_tearFlags)._l & DAT_00c34860; auStack_18._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34864; fVar5 = (this->_pos).x - *(float *)(iVar1 + 0x33c); fVar8 = (this->_pos).y - *(float *)(iVar1 + 0x340); uStack_10 = (uint)(this->_tearFlags)._h & DAT_00c34868; uStack_c = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3486c; local_2c = (undefined1 *)0x3f800000; local_28 = fVar8; local_24.x = fVar5; isFlagSet = BitSet128::IsNonZero((BitSet128 *)auStack_18); if ((isFlagSet != 0) && (fVar8 * (this->_velocity).y + fVar5 * (this->_velocity).x < 0.0)) { local_2c = &DAT_bf800000; } local_34.x = *(float *)(extraout_EDX + 0x41c) * 0.017453292; auStack_18._0_4_ = cos(local_34.x); auStack_18._4_4_ = sin(local_34.x); fVar5 = (this->_velocity).y; fVar8 = (this->_velocity).x; fVar5 = sqrtf(fVar8 * fVar8 + fVar5 * fVar5); pVVar2 = Vector::Resized((Vector *)auStack_18,&local_34,fVar5); fVar5 = pVVar2->y; (this->_velocity).x = (float)local_2c * pVVar2->x; (this->_velocity).y = (float)local_2c * fVar5; fVar8 = sqrtf(local_28 * local_28 + local_24.x * local_24.x); fVar5 = *(float *)(iVar1 + 0x33c); (this->_pos).y = fVar8 * (float)auStack_18._4_4_ + *(float *)(iVar1 + 0x340); (this->_pos).x = fVar8 * (float)auStack_18._0_4_ + fVar5; } } } uVar3 = (uint)(this->_tearFlags)._h; local_24.x = (float)(uVar3 & _DAT_00c345a8); local_34.x = *(float *)((int)&(this->_tearFlags)._h + 4); local_28 = (float)((uint)local_34.x & _DAT_00c345ac); if (((!(((uint)(this->_tearFlags)._l & _DAT_00c345a0) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c345a4) == 0)) || (!(local_24.x == 0.0 && local_28 == 0.0))) && ((this->_techZeroLaser != (EntityPtr)0x0 && (this->_techZeroTarget != (EntityPtr)0x0)))) { iVar1 = __RTDynamicCast(this->_techZeroLaser,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); EVar4 = this->_techZeroTarget; local_28 = (*(float *)((int)EVar4 + 0x33c) + *(float *)((int)EVar4 + 0x34c)) - ((this->_velocity).x + (this->_pos).x + (this->_posOffset).x); local_24.x = (*(float *)((int)EVar4 + 0x340) + *(float *)((int)EVar4 + 0x350)) - ((this->_velocity).y + (this->_pos).y + (this->_posOffset).y); fVar5 = atan2f(local_24.x,local_28); fVar5 = fVar5 * 57.295776; *(undefined4 *)(iVar1 + 0x420) = *(undefined4 *)(iVar1 + 0x41c); *(float *)(iVar1 + 0x418) = fVar5; *(float *)(iVar1 + 0x41c) = fVar5; *(float *)(iVar1 + 0xec) = fVar5 - 90.0; fVar5 = sqrtf(local_24.x * local_24.x + local_28 * local_28); *(float *)(iVar1 + 0x4d0) = fVar5; fVar5 = (this->_posOffset).y; fVar8 = (this->_pos).y; fVar7 = (this->_velocity).y; *(float *)(iVar1 + 0x33c) = ((this->_posOffset).x + (this->_pos).x + (this->_velocity).x) - *(float *)(iVar1 + 0x34c); *(float *)(iVar1 + 0x340) = (fVar5 + fVar8 + fVar7) - *(float *)(iVar1 + 0x350); uVar3 = (uint)(this->_tearFlags)._h; local_34.x = *(float *)((int)&(this->_tearFlags)._h + 4); } tear = local_1c; local_24.x = (float)(uVar3 & (uint)g_tearFlagLudovico._h); if ((((uint)(this->_tearFlags)._l & (uint)g_tearFlagLudovico._l) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagLudovico._l._4_4_) == 0) && (local_24.x == 0.0 && ((uint)local_34.x & g_tearFlagLudovico._h._4_4_) == 0)) { nextSpawner = this->_spawnerEntity; EVar4 = (EntityPtr)this; while (spawner = nextSpawner, spawner != (EntityPtr)0x0) { EVar4 = spawner; nextSpawner = *(EntityPtr *)((int)spawner + 0x3c8); } if (*(int *)((int)EVar4 + 0x28) != 1) { EVar4 = (EntityPtr)0x0; } if ((((uint)(this->_tearFlags)._l & DAT_00c34870) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34874) != 0) || ((uVar3 & DAT_00c34878) != 0 || ((uint)local_34.x & DAT_00c3487c) != 0)) { if (EVar4 != (EntityPtr)0x0) { get_tear_trinket_multiplier((Entity_Player *)EVar4,10); } apply_wiggle(tear); } local_1c = (Entity_Tear *)(*(uint *)((int)&(tear->_tearFlags)._h + 4) & DAT_00c348ac); if ((((uint)(tear->_tearFlags)._l & DAT_00c348a0) != 0 || (*(uint *)((int)&(tear->_tearFlags)._l + 4) & DAT_00c348a4) != 0) || (((uint)(tear->_tearFlags)._h & DAT_00c348a8) != 0 || local_1c != (Entity_Tear *)0x0)) { if (EVar4 != (EntityPtr)0x0) { Entity_Player::GetTrinketMultiplier((Entity_Player *)EVar4,0xb); } apply_wiggle(tear); } local_1c = (Entity_Tear *)(*(uint *)((int)&(tear->_tearFlags)._h + 4) & DAT_00c348ec); if ((((uint)(tear->_tearFlags)._l & DAT_00c348e0) != 0 || (*(uint *)((int)&(tear->_tearFlags)._l + 4) & DAT_00c348e4) != 0) || (((uint)(tear->_tearFlags)._h & DAT_00c348e8) != 0 || local_1c != (Entity_Tear *)0x0)) { if (EVar4 != (EntityPtr)0x0) { Entity_Player::GetTrinketMultiplier((Entity_Player *)EVar4,0x60); } update_wiggle(tear); } Entity::Interpolate((Entity *)tear); this = tear; } else { if ((this->_subtype & 2) != 0) { uVar3 = (uint)this->_flags; if ((uVar3 & 2) != 0) { *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = uVar3 & 0xfffffffd; return; } } pVVar2 = &this->_pos; (this->_preInterpolatePos).x = (this->_pos).x; (this->_preInterpolatePos).y = (this->_pos).y; fVar5 = this->_friction; fVar8 = (this->_velocity).y; fVar7 = this->_speedMultiplier; puVar6 = (undefined1 *)(fVar5 * (this->_velocity).x * fVar7 * 0.5 + pVVar2->x); pVVar2->x = (float)puVar6; (this->_pos).y = fVar8 * fVar5 * fVar7 * 0.5 + (this->_pos).y; this->_isInterpolating = 1; local_34.x = *(float *)&this->_parent; if (((EntityPtr)local_34.x == (EntityPtr)0x0) || (*(int *)((int)local_34.x + 0x28) != 2)) { local_1c = (Entity_Tear *)((uint)(this->_tearFlags)._h & _DAT_00c348d8); local_24.x = (float)(*(uint *)((int)&(this->_tearFlags)._h + 4) & _DAT_00c348dc); if ((((uint)(this->_tearFlags)._l & _DAT_00c348d0) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c348d4) == 0) && (local_1c == (Entity_Tear *)0x0 && local_24.x == 0.0)) { Room::GetClampedPositionImpl(g_game->_room,(Vector *)auStack_18,pVVar2,0.0,0.0,0.0,0.0); pVVar2->x = (float)auStack_18._0_4_; (this->_pos).y = (float)auStack_18._4_4_; local_34.x = *(float *)&this->_parent; puVar6 = (undefined1 *)auStack_18._4_4_; } if (((EntityPtr)local_34.x != (EntityPtr)0x0) && (*(int *)((int)local_34.x + 0x28) == 2)) goto LAB_00679c17; } else { LAB_00679c17: if ((this->_subtype & 1) != 0) { local_1c = (Entity_Tear *) ((((float)((uint)this->_index % 10) + 0.0) * 0.1 * 0.5 + 2.0) * 0.017453292); local_2c = (undefined1 *)cos((float)local_1c); fVar7 = sin((float)local_1c); fVar5 = (this->_parentOffset).x; fVar8 = (this->_parentOffset).y; auStack_18._4_4_ = (float)local_2c * fVar8 + fVar7 * fVar5; local_28 = *(float *)((int)local_34.x + 0x33c); local_34.x = *(float *)((int)local_34.x + 0x340); local_1c = (Entity_Tear *)((float)local_2c * fVar5 - fVar7 * fVar8); iVar1 = this->_index * 0x32; local_2c = (undefined1 *)auStack_18._4_4_; auStack_18._0_4_ = local_1c; local_24.x = sin(((float)(g_game->_frameCount - this->_spawnFrame) + 0.5 + (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])) * 0.08); fVar5 = sqrtf((float)local_1c * (float)local_1c + (float)local_2c * (float)local_2c); pVVar2 = Vector::Resized((Vector *)auStack_18,&local_24,fVar5 * (local_24.x * 0.5 + 1.0)); puVar6 = (undefined1 *)(local_28 + pVVar2->x); fVar5 = pVVar2->y; (this->_pos).x = (float)puVar6; (this->_pos).y = local_34.x + fVar5; } } if ((((uint)(this->_tearFlags)._l & _DAT_00c345e0) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c345e4) != 0) || (((uint)(this->_tearFlags)._h & _DAT_00c345e8) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & _DAT_00c345ec) != 0)) { Entity::GetRootParent((Entity *)this); game = g_game; fVar5 = sin(((float)(g_game->_frameCount - this->_spawnFrame) + 0.5) * (3.1415927 / (float)puVar6)); (this->_posOffset).y = ABS(fVar5) * this->_height; goto LAB_00679a3a; } } game = g_game; LAB_00679a3a: if (this->_waitFrames < 1) { local_1c = (Entity_Tear *) (*(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagLudovico._h._4_4_); if (((((uint)g_tearFlagLudovico._l & (uint)(this->_tearFlags)._l) == 0 && (g_tearFlagLudovico._l._4_4_ & *(uint *)((int)&(this->_tearFlags)._l + 4)) == 0) && (((uint)(this->_tearFlags)._h & (uint)g_tearFlagLudovico._h) == 0 && local_1c == (Entity_Tear *)0x0)) && (this->_dead == 0)) { if (*(int *)((int)game->_room + 8) == 0x10) { (this->_posOffset).y = -18.0; return; } fVar5 = get_height_offset_y(this,this->_fallingSpeed * this->_speedMultiplier * 0.5 + this->_height); (this->_posOffset).y = fVar5; } } return; } //@@ 00679e80 Entity_Tear::SetDeadEyeIntensity /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityTear:SetDeadEyeIntensity prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Tear::SetDeadEyeIntensity(Entity_Tear *this,float intensity) { LayerState *pLVar1; char *ptr; int iVar2; uint uVar3; ColorMod *pCVar4; undefined4 local_68 [11]; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)(local_68 + 0x19); local_14 = 0xffffffff; puStack_18 = &LAB_00af33dd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_68 + 0x16); ExceptionList = &local_1c; this->_deadEyeIntensity = intensity; if ((intensity != 0.0) && ((this->_deadEyeANM2)._loaded == 0)) { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x1a; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/DeadEyeTearEffect.anm2",0x1b); local_14 = 0; ANM2::Load(&this->_deadEyeANM2,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar3 = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < uVar3) { ptr = *(char **)(local_3c._buf._0_4_ + -4); uVar3 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } uVar3 = g_graphicsManager_flags; pLVar1 = ANM2::GetLayer(&this->_deadEyeANM2,(byte *)0x0); iVar2 = 1; if ((uVar3 & 4) == 0) { iVar2 = 6; } pLVar1->_blendMode[1] = iVar2; pLVar1->_blendMode[0] = 0; pLVar1->_blendMode[2] = 1; pLVar1->_blendMode[3] = 1; pLVar1->_blendMode[4] = 1; ANM2::Play(&this->_deadEyeANM2,s_Idle,0); pCVar4 = &(this->_deadEyeANM2)._color; if (pCVar4 != (ColorMod *)local_68) { (this->_deadEyeANM2)._color._colorize[0] = 0.0; (this->_deadEyeANM2)._color._colorize[1] = 0.0; (this->_deadEyeANM2)._color._colorize[2] = 0.0; (this->_deadEyeANM2)._color._colorize[3] = 0.0; pCVar4->_tint[0] = 1.0; (this->_deadEyeANM2)._color._tint[1] = 1.0; (this->_deadEyeANM2)._color._tint[2] = 1.0; (this->_deadEyeANM2)._color._tint[3] = intensity; (this->_deadEyeANM2)._color._offset[0] = 0.0; (this->_deadEyeANM2)._color._offset[1] = 0.0; (this->_deadEyeANM2)._color._offset[2] = 0.0; } } ExceptionList = local_1c; return; } //@@ 0067a080 Entity_Projectile::Deflect /* DB: clears flags, sets velocity, new spawner multiset; ButterBeanFart/familiar collision prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Projectile::Deflect(Entity_Projectile *this,Entity *newSpawner,Vector *velocity) { EntityPtr *pEVar1; EntityPtr *local_c [2]; Entity_Tear::SetTearFlags((Entity_Tear *)this,(BitSet128)ZEXT816(0)); pEVar1 = &this->_parent; this[1]._spawnerEntity = (EntityPtr)0x0; this[1]._entityPtrReferrers._head = (void *)0x0; this[1]._entityPtrReferrers._size = 0; this[1]._minecart = (EntityPtr)0x0; (this->_velocity).x = velocity->x; (this->_velocity).y = velocity->y; if (*pEVar1 != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)0x0; pEVar1 = &this->_spawnerEntity; if (this->_spawnerEntity != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)newSpawner; if (newSpawner != (Entity *)0x0) { std::multiset::insert(pEVar1); } this->_dead = 0; if ((0.0 < this->_fallingAccel) && (0.0 < this->_fallingSpeed)) { this->_fallingSpeed = -this->_fallingSpeed * 0.85; } return; } //@@ 0067a190 Entity_Tear::MakeMultidimensionalCopy /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall Entity_Tear* Entity_Tear::MakeMultidimensionalCopy(Entity * spawner); prototype: REPENTOGON, confirmed by RET 4 */ Entity_Tear * __thiscall Entity_Tear::MakeMultidimensionalCopy(Entity_Tear *this,Entity *spawner) { EntityPtr *pEVar1; BitSet128 flags; Game *pGVar2; Entity *pEVar3; Entity_Tear *this_00; uint variant; float fVar4; EntityPtr aEStack_28 [2]; uint uStack_20; uint uStack_1c; uint uStack_18; uint uStack_14; variant = this->_variant; if (((variant != 0x23) && (variant != 0x25)) && (variant != 0x26)) { variant = 0x15; } pEVar3 = Game::SpawnEx(g_game,2,variant,&this->_pos,&this->_velocity,spawner,this->_subtype, (this->_dropRNG)._seed,0); this_00 = (Entity_Tear *) __RTDynamicCast(pEVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0); aEStack_28[0] = (EntityPtr)this->_height; this_00->_height = (float)aEStack_28[0]; fVar4 = get_height_offset_y(this_00,(float)aEStack_28[0]); pGVar2 = g_game; (this_00->_posOffset).y = fVar4; if ((*(int *)((int)pGVar2->_room + 8) == 0x10) && ((this_00->_posOffset).y = -18.0, -5.1 < (float)aEStack_28[0])) { this_00->_height = -5.1; } this_00->_fallingSpeed = this->_fallingSpeed; this_00->_fallingAccel = this->_fallingAccel; this_00->_homingFriction = this->_homingFriction; this_00->_tearRange = this->_tearRange; fVar4 = this->_fScale; if (fVar4 <= 0.01) { fVar4 = 0.01; } this_00->_baseScale = fVar4; this_00->_fScale = fVar4; ResetSpriteScale(this_00); uStack_1c = ~g_tearFlagLudovico._l._4_4_ & *(uint *)((int)&(this->_tearFlags)._l + 4); uStack_20 = ~(uint)g_tearFlagLudovico._l & (uint)(this->_tearFlags)._l; uStack_14 = ~g_tearFlagLudovico._h._4_4_ & *(uint *)((int)&(this->_tearFlags)._h + 4); uStack_18 = ~(uint)g_tearFlagLudovico._h & (uint)(this->_tearFlags)._h; flags._l._4_4_ = uStack_1c; flags._l._0_4_ = uStack_20; flags._h._0_4_ = uStack_18; flags._h._4_4_ = uStack_14; SetTearFlags(this_00,flags); this_00->_waitFrames = this->_waitFrames; this_00->_tearIdx = this->_tearIdx; (**(code **)(*(int *)this_00 + 0x40))(this->_collisionDamage); this_00->_rotation = this->_rotation; this_00->_knockbackMultiplier = this->_knockbackMultiplier; SetDeadEyeIntensity(this_00,this->_deadEyeIntensity); this_00->_multidimensionalTouched = this->_multidimensionalTouched; (this_00->_continueVelocity).x = (this->_continueVelocity).x; (this_00->_continueVelocity).y = (this->_continueVelocity).y; aEStack_28[0] = this->_parent; pEVar1 = &this_00->_parent; if (*pEVar1 != (EntityPtr)0x0) { std::multiset::erase((int)aEStack_28 + 0xfffffffc); } *pEVar1 = aEStack_28[0]; if (aEStack_28[0] != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } pEVar1 = &this_00->_spawnerEntity; if (this_00->_spawnerEntity != (EntityPtr)0x0) { aEStack_28[0] = (EntityPtr)pEVar1; std::multiset::erase(aEStack_28); } *pEVar1 = (EntityPtr)spawner; if (spawner != (Entity *)0x0) { std::multiset::insert(pEVar1); } return this_00; } //@@ 0067a400 Entity_Tear::ChangeVariant /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityTear:ChangeVariant prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Tear::ChangeVariant(Entity_Tear *this,int variant) { byte isGfuelSeed; LayerState *layer; int blendSrc; char *freeBlock; uint uVar1; std_string bulletAnmPath; std_string missileAnmPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; float savedCollisionDamage; int savedGridCollisionClass; float savedScale; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af79f5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; savedGridCollisionClass = this->_entityGridCollisionClass; savedCollisionDamage = this->_collisionDamage; this->_variant = variant; savedScale = this->_fScale; (**(code **)(*(int *)this + 100))(local_24); if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); if (this->_variant == 0xd) { isGfuelSeed = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (isGfuelSeed != 0) { bulletAnmPath._size = 0; bulletAnmPath._capacity = 0xf; bulletAnmPath._buf[0] = '\0'; bulletAnmPath._buf[1] = '\0'; bulletAnmPath._buf[2] = '\0'; bulletAnmPath._buf[3] = '\0'; bulletAnmPath._buf._0_4_ = std::_Allocate(0x30); bulletAnmPath._size = 0x20; bulletAnmPath._capacity = 0x2f; builtin_strncpy((char *)bulletAnmPath._buf._0_4_,"gfx/promo/gfuel/bullet tear.anm2",0x21); local_14 = 0; ANM2::Load(&this->_sprite,&bulletAnmPath,1); local_14 = 0xffffffff; if (0xf < bulletAnmPath._capacity) { uVar1 = bulletAnmPath._capacity + 1; freeBlock = (char *)bulletAnmPath._buf._0_4_; if (0xfff < uVar1) { freeBlock = *(char **)(bulletAnmPath._buf._0_4_ + -4); uVar1 = bulletAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(bulletAnmPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar1); } uVar1 = g_graphicsManager_flags; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); blendSrc = 1; if ((uVar1 & 4) == 0) { blendSrc = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = blendSrc; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; } } else if (this->_variant == 0x17) { isGfuelSeed = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (isGfuelSeed != 0) { missileAnmPath._size = 0; missileAnmPath._capacity = 0xf; missileAnmPath._buf[0] = '\0'; missileAnmPath._buf[1] = '\0'; missileAnmPath._buf[2] = '\0'; missileAnmPath._buf[3] = '\0'; missileAnmPath._buf._0_4_ = std::_Allocate(0x20); missileAnmPath._size = 0x1c; missileAnmPath._capacity = 0x1f; builtin_strncpy((char *)missileAnmPath._buf._0_4_,"gfx/promo/gfuel/missile.anm2",0x1d); local_14 = 1; ANM2::Load(&this->_sprite,&missileAnmPath,1); local_14 = 0xffffffff; if (0xf < missileAnmPath._capacity) { uVar1 = missileAnmPath._capacity + 1; freeBlock = (char *)missileAnmPath._buf._0_4_; if (0xfff < uVar1) { freeBlock = *(char **)(missileAnmPath._buf._0_4_ + -4); uVar1 = missileAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(missileAnmPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar1); } uVar1 = g_graphicsManager_flags; missileAnmPath._size = 0; missileAnmPath._capacity = 0xf; missileAnmPath._buf._0_4_ = missileAnmPath._buf._0_4_ & 0xffffff00; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); blendSrc = 1; if ((uVar1 & 4) == 0) { blendSrc = 6; } layer->_blendMode[1] = blendSrc; layer->_blendMode[0] = 0; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_bitflags = layer->_bitflags | 1; } } } this->_fScale = savedScale; ResetSpriteScale(this); this->_collisionDamage = savedCollisionDamage; this->_entityGridCollisionClass = savedGridCollisionClass; ExceptionList = local_1c; return; } //@@ 0067a720 Entity::GetRootParent /* DB: walks +0x3c8 parent chain, checks type 1 */ void __thiscall Entity::GetRootParent(Entity *this) { EntityPtr EVar1; EntityPtr EVar2; EVar2 = this->_spawnerEntity; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { this = (Entity *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3c8); } if (*(int *)((int)this + 0x28) == 1) { return; } return; } //@@ 0067a770 Entity_Tear::find_nearest_linkable_tear /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=tear: EntityList::QuerySublist over room tears (Room+0x1218), skips self, keeps tears whose TearFlags (+0x428..0x434) intersect a flag mask and whose +0x494 link is null or not a tear (type 2), returns the nearest within 40; Entity_Tear::Update then calls FUN_0067ae30 to link this+0x494/0x498 with it (multiset EntityPtr refs) */ int __thiscall Entity_Tear::find_nearest_linkable_tear(void) { int iVar1; qword qVar2; void *pvVar3; qword *pqVar4; int iVar5; int iVar6; uint uVar7; float fVar8; float fVar9; EntityList_EL local_2c; float local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af7a20; local_10 = ExceptionList; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_2c,2,-1,-1,0,0); iVar6 = 0; uVar7 = 0; local_1c = 40.0; local_18 = 0; if (local_2c._size != 0) { pvVar3 = local_2c._data; iVar5 = local_14; do { iVar1 = *(int *)((int)pvVar3 + uVar7 * 4); if (iVar1 != iVar5) { if (((((*(uint *)(iVar1 + 0x428) & _DAT_00c34810) == 0 && (*(uint *)(iVar1 + 0x42c) & _DAT_00c34814) == 0) && ((*(uint *)(iVar1 + 0x430) & _DAT_00c34818) == 0 && (*(uint *)(iVar1 + 0x434) & _DAT_00c3481c) == 0)) || ((*(int *)(iVar1 + 0x494) != 0 && (*(int *)(*(int *)(iVar1 + 0x494) + 0x28) == 2)))) || (fVar8 = *(float *)(local_14 + 0x340) - *(float *)(iVar1 + 0x340), fVar9 = *(float *)(local_14 + 0x33c) - *(float *)(iVar1 + 0x33c), fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9), local_1c <= fVar8)) { pvVar3 = local_2c._data; iVar5 = local_14; iVar6 = local_18; } else { pvVar3 = local_2c._data; iVar5 = local_14; iVar6 = iVar1; local_1c = fVar8; local_18 = iVar1; } } uVar7 = uVar7 + 1; } while (uVar7 < (uint)local_2c._size); } if (local_2c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (local_2c._data != (void *)0x0) { uVar7 = *(uint *)((int)local_2c._data + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar7; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar7); free((uint *)((int)local_2c._data + -4)); } } ExceptionList = local_10; return iVar6; } //@@ 0067a8f0 Entity_Tear::find_link_partner /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=Entity_Tear: QuerySublist of tears, returns the nearest other tear (within 20) whose 128-bit tear flags (+0x428..+0x434) intersect the mask at DAT_00c34810 and which has no link yet (+0x498==0); Entity_Tear::Update links the two with EntityPtr::Set on a random 1/10 roll */ int __thiscall Entity_Tear::find_link_partner(Entity_Tear *this) { uint uVar1; bool bVar2; bool bVar3; qword qVar4; void *pvVar5; qword *pqVar6; EntityPtr EVar7; int iVar8; bool bVar9; float fVar10; float fVar11; EntityList_EL local_30; float local_20; uint local_1c; int local_18; EntityPtr local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af4e20; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = (EntityPtr)this; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_30,2,-1,-1,0,0); iVar8 = 0; local_20 = 20.0; local_18 = 0; local_1c = 0; if (local_30._size != 0) { pvVar5 = local_30._data; do { EVar7 = *(EntityPtr *)((int)pvVar5 + local_1c * 4); if (EVar7 != (EntityPtr)this) { this = (Entity_Tear *)local_14; if ((((*(uint *)((int)EVar7 + 0x428) & _DAT_00c34810) == 0 && (*(uint *)((int)EVar7 + 0x42c) & _DAT_00c34814) == 0) && ((*(uint *)((int)EVar7 + 0x430) & _DAT_00c34818) == 0 && (*(uint *)((int)EVar7 + 0x434) & _DAT_00c3481c) == 0)) || (*(int *)((int)EVar7 + 0x498) != 0)) { pvVar5 = local_30._data; } else { bVar3 = true; do { if (EVar7 == (EntityPtr)0x0) goto LAB_0067aa2a; if ((((uint)((BitSet128 *)((int)EVar7 + 0x428))->_l & _DAT_00c34810) == 0 && (*(uint *)((int)EVar7 + 0x42c) & _DAT_00c34814) == 0) && (bVar2 = bVar3, (*(uint *)((int)EVar7 + 0x430) & _DAT_00c34818) == 0 && (*(uint *)((int)EVar7 + 0x434) & _DAT_00c3481c) == 0)) break; bVar9 = EVar7 != local_14; EVar7 = *(EntityPtr *)((int)EVar7 + 0x494); bVar2 = false; if (bVar9) { bVar2 = bVar3; } if ((EVar7 == (EntityPtr)0x0) || (*(int *)((int)EVar7 + 0x28) != 2)) { EVar7 = (EntityPtr)0x0; } bVar3 = bVar2; } while (bVar2); if (bVar2) { LAB_0067aa2a: iVar8 = *(int *)((int)local_30._data + local_1c * 4); fVar10 = *(float *)((int)local_14 + 0x340) - *(float *)(iVar8 + 0x340); fVar11 = *(float *)((int)local_14 + 0x33c) - *(float *)(iVar8 + 0x33c); fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (fVar10 < local_20) { pvVar5 = local_30._data; local_20 = fVar10; local_18 = iVar8; goto LAB_0067aa8b; } } pvVar5 = local_30._data; iVar8 = local_18; } } LAB_0067aa8b: local_1c = local_1c + 1; } while (local_1c < (uint)local_30._size); } if (local_30._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } if (local_30._data != (void *)0x0) { uVar1 = *(uint *)((int)local_30._data + -4); qVar4 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar1; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar4 < uVar1); free((uint *)((int)local_30._data + -4)); } } ExceptionList = local_10; return iVar8; } //@@ 0067aaf0 Entity_Tear::apply_link_spring_forces /* DB: ? called once from Entity_Tear::Update; this=Tear with two linked entity refs (+0x494/+0x498): spring toward rest distance 10 using +0x38c/+0x390 pos, +0x394/+0x398 vel, +0x39c mass, writes velocity +0x360 */ void __thiscall Entity_Tear::apply_link_spring_forces(Entity_Tear *this) { float fVar1; int iVar2; EntityPtr EVar3; float fVar4; float fVar5; float fVar6; float local_10; float local_c; iVar2 = g_game->_frameCount; if (0 < iVar2 - this->_spawnFrame) { EVar3 = this->_linkPrev; local_c = 0.0; local_10 = 0.0; if ((EVar3 != (EntityPtr)0x0) && (0 < iVar2 - *(int *)((int)EVar3 + 0x328))) { fVar5 = (this->_prevPosition).y - *(float *)((int)EVar3 + 0x390); fVar6 = (this->_prevPosition).x - *(float *)((int)EVar3 + 0x38c); fVar4 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if (0.0 < fVar4) { fVar6 = fVar6 * (1.0 / fVar4); fVar5 = fVar5 * (1.0 / fVar4); } fVar1 = this->_speedMultiplier; local_10 = (0.0 - ((fVar4 - 10.0) * fVar6 * 0.3) / fVar1) - (((this->_prevVelocity).x - *(float *)((int)EVar3 + 0x394)) * 0.3) / fVar1; local_c = (0.0 - ((fVar4 - 10.0) * fVar5 * 0.3) / fVar1) - (((this->_prevVelocity).y - *(float *)((int)EVar3 + 0x398)) * 0.3) / fVar1; } EVar3 = this->_linkNext; if ((EVar3 != (EntityPtr)0x0) && (0 < iVar2 - *(int *)((int)EVar3 + 0x328))) { fVar5 = (this->_prevPosition).y - *(float *)((int)EVar3 + 0x390); fVar6 = (this->_prevPosition).x - *(float *)((int)EVar3 + 0x38c); fVar4 = sqrtf(fVar5 * fVar5 + fVar6 * fVar6); if (0.0 < fVar4) { fVar5 = fVar5 * (1.0 / fVar4); fVar6 = fVar6 * (1.0 / fVar4); } fVar1 = this->_speedMultiplier; local_10 = (local_10 - ((fVar4 - 10.0) * fVar6 * 0.3) / fVar1) - (((this->_prevVelocity).x - *(float *)((int)EVar3 + 0x394)) * 0.3) / fVar1; local_c = (local_c - ((fVar4 - 10.0) * fVar5 * 0.3) / fVar1) - (((this->_prevVelocity).y - *(float *)((int)EVar3 + 0x398)) * 0.3) / fVar1; } if ((local_10 != g_vectorZero.x) || (local_c != g_vectorZero.y)) { fVar4 = this->_speedMultiplier; (this->_velocity).x = local_10 * fVar4 + (this->_velocity).x; (this->_velocity).y = fVar4 * local_c + (this->_velocity).y; } this->_friction = this->_friction * 0.95; } return; } //@@ 0067adc0 FUN_0067adc0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ int FUN_0067adc0(void) { int in_ECX; int iVar1; iVar1 = 0; if (in_ECX != 0) { while( true ) { if (((*(uint *)(in_ECX + 0x428) & _DAT_00c34810) == 0 && (*(uint *)(in_ECX + 0x42c) & _DAT_00c34814) == 0) && ((*(uint *)(in_ECX + 0x430) & _DAT_00c34818) == 0 && (*(uint *)(in_ECX + 0x434) & _DAT_00c3481c) == 0)) break; in_ECX = *(int *)(in_ECX + 0x498); iVar1 = iVar1 + 1; if (in_ECX == 0) { return iVar1; } if (*(int *)(in_ECX + 0x28) != 2) { return iVar1; } } } return iVar1; } //@@ 0067ae30 FUN_0067ae30 void FUN_0067ae30(int *param_1) { int iVar1; int iVar2; int in_ECX; int *piVar3; int *piVar4; piVar4 = param_1; piVar3 = (int *)(in_ECX + 0x498); if (*(int **)(in_ECX + 0x498) != param_1) { if (*(int **)(in_ECX + 0x498) != (int *)0x0) { param_1 = piVar3; std::multiset::erase(¶m_1); } *piVar3 = (int)piVar4; if (piVar4 != (int *)0x0) { std::multiset::insert(piVar3); } } iVar1 = piVar4[0x125]; iVar2 = *(int *)(in_ECX + 0x494); piVar4 = piVar4 + 0x125; if (iVar2 != iVar1) { if (iVar2 != 0) { param_1 = (int *)(in_ECX + 0x494); std::multiset::erase(¶m_1); } *(int *)(in_ECX + 0x494) = iVar1; if (iVar1 != 0) { std::multiset::insert((int *)(in_ECX + 0x494)); } } iVar1 = *piVar4; if ((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 2)) { piVar3 = (int *)(iVar1 + 0x498); if (*(int *)(iVar1 + 0x498) != in_ECX) { if (*(int *)(iVar1 + 0x498) != 0) { param_1 = piVar3; std::multiset::erase(¶m_1); } *piVar3 = in_ECX; if (in_ECX != 0) { std::multiset::insert(piVar3); } } } if (*piVar4 != in_ECX) { if (*piVar4 != 0) { param_1 = piVar4; std::multiset::erase(¶m_1); } *piVar4 = in_ECX; if (in_ECX != 0) { std::multiset::insert(piVar4); } } return; } //@@ 0067af30 FUN_0067af30 void FUN_0067af30(void) { int in_ECX; if (in_ECX < 1) { return; } if (in_ECX < 0xe) { return; } return; } //@@ 0067af60 Entity_Tear::ApplyTearFlagEffects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] static cleanup void Entity_Tear::ApplyTearFlagEffects(Entity* entity, Vector* position, BitSet128 flags, Entity* source, float damage); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl Entity_Tear::ApplyTearFlagEffects (Entity *entity,Vector *position,BitSet128 flags,Entity *source,float damage) { ColorMod color; Vector sizeMulti; Vector pos; int iVar1; byte bVar2; char cVar3; Entity_Player *pEVar4; BitSet128 *maskedFlags; int iVar5; uint rngValue; Vector *pVVar6; Entity *tmpEntity; uint rngValue2; Vector *coinSpawnPos; TearParams *hitParams; GridEntity *gridEntity; EntityConfig_Entity *entityConfig; byte unused; byte unused_00; byte unused_01; float *extraout_EDX; int iVar7; float fVar8; float fVar9; Color aCStackY_180c [128]; undefined4 in_stack_fffffe20; undefined4 in_stack_fffffe24; undefined4 in_stack_fffffe28; undefined4 in_stack_fffffe2c; undefined4 in_stack_fffffe30; undefined4 in_stack_fffffe34; undefined4 in_stack_fffffe38; undefined4 in_stack_fffffe3c; undefined4 in_stack_fffffe40; undefined4 in_stack_fffffe44; TearParams tearParams; BitSet128 inheritedFlags; BitSet128 invertedMask; Entity *hitEntity; BitSet128 flagsResult; Vector hitPos; Vector local_100; undefined1 local_f8 [8]; Vector scratchVec; Vector local_e8; Entity_Player *local_e0; EntityPtr local_dc; Vector local_d8; Vector local_d0; undefined1 local_c8 [12]; float local_bc; Vector local_b8; Entity *damageSource; Entity_Player *local_ac [27]; undefined4 local_40; EntityRef EStack_3c; uint local_14; void *local_10; undefined1 *puStack_c; Entity_Player *local_8; qword entityFlags; code *entityFn; undefined4 flagsHigh; uint *flagsHighPtr; Manager *manager; Room *room; local_8 = (Entity_Player *)0xffffffff; puStack_c = &LAB_00af7a50; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_ac + 0x2a); ExceptionList = &local_10; damageSource = source; hitEntity = entity; local_e0 = (Entity_Player *)position; if (entity == (Entity *)0x0) { LAB_0067afce: if ((source == (Entity *)0x0) || (local_dc = source->_spawnerEntity, local_dc == (EntityPtr)0x0) ) goto LAB_0067afe2; } else { if (source != (Entity *)0x0) { EntityRef::constructor(&EStack_3c,source); bVar2 = Entity::IsDamageSourceFriendly(entity,&EStack_3c); if (bVar2 != 0) { ExceptionList = local_10; return; } goto LAB_0067afce; } LAB_0067afe2: local_dc = (EntityPtr)source; } hitPos.x = *(float *)local_e0; fVar8 = *(float *)&local_e0->field_0x4; hitPos.y = fVar8; if (source == (Entity *)0x0) { local_b8.y = (entity->_pos).x - *(float *)local_e0; local_d8.y = (entity->_pos).y - fVar8; fVar8 = sqrtf(local_b8.y * local_b8.y + local_d8.y * local_d8.y); if (0.0 < fVar8) { local_b8.y = (1.0 / fVar8) * local_b8.y; local_d8.y = local_d8.y * (1.0 / fVar8); } } else { iVar7 = source->_type; if (iVar7 == 8) { pEVar4 = Entity_Knife::GetPlayer((Entity_Knife *)source); fVar9 = (entity->_pos).x; local_d8.y = (entity->_pos).y; if (pEVar4 == (Entity_Player *)0x0) { local_b8.y = fVar9 - *extraout_EDX; local_d8.y = local_d8.y - fVar8; fVar8 = local_b8.y * local_b8.y; fVar9 = local_d8.y * local_d8.y; } else { local_b8.y = fVar9 - (pEVar4->_pos).x; local_d8.y = local_d8.y - (pEVar4->_pos).y; fVar9 = local_b8.y * local_b8.y; fVar8 = local_d8.y * local_d8.y; } fVar8 = sqrtf(fVar8 + fVar9); if (0.0 < fVar8) { local_b8.y = (1.0 / fVar8) * local_b8.y; local_d8.y = local_d8.y * (1.0 / fVar8); } } else if (iVar7 == 2) { fVar8 = (source->_velocity).y; fVar9 = (source->_velocity).x; fVar8 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8); if (0.02 <= fVar8) { scratchVec.x = (source->_velocity).x; scratchVec.y = (source->_velocity).y; pVVar6 = Vector::Normalized(&scratchVec,(Vector *)(local_c8 + 8)); local_d8.y = pVVar6->y; local_b8.y = pVVar6->x; } else { pVVar6 = MusicManager::RandomVector((Vector *)(local_c8 + 8)); local_d8.y = pVVar6->y; local_b8.y = pVVar6->x; } } else if (iVar7 == 7) { cVar3 = Entity_Laser::IsCircleLaser((Entity_Laser *)source); if (cVar3 == '\0') { local_ac[0] = (Entity_Player *)((float)source[1]._damageEvents._capacity * 0.017453292); local_d8.y = sin((float)local_ac[0]); local_b8.y = cos((float)local_ac[0]); hitPos.x = (entity->_pos).x - local_b8.y * entity->_size; hitPos.y = (entity->_pos).y - entity->_size * local_d8.y; } else { scratchVec.x = (source->_velocity).x; scratchVec.y = (source->_velocity).y; pVVar6 = Vector::Normalized(&scratchVec,(Vector *)(local_c8 + 8)); local_b8.y = pVVar6->x; local_d8.y = pVVar6->y; scratchVec.x = (entity->_pos).x - *(float *)local_e0; scratchVec.y = (entity->_pos).y - *(float *)&local_e0->field_0x4; pVVar6 = Vector::Normalized(&scratchVec,(Vector *)(local_c8 + 8)); hitPos.x = (entity->_pos).x - entity->_size * pVVar6->x; hitPos.y = (entity->_pos).y - entity->_size * pVVar6->y; } } else { scratchVec.x = (entity->_pos).x - (source->_pos).x; scratchVec.y = (entity->_pos).y - (source->_pos).y; pVVar6 = Vector::Normalized(&scratchVec,(Vector *)(local_c8 + 8)); local_b8.y = pVVar6->x; local_d8.y = pVVar6->y; } if ((source->_type == 2) && ((maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,&g_tearFlagExplosive), (int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0 || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)))) goto LAB_0067cba7; } bVar2 = Entity::IsVulnerableEnemy(entity,(Entity *)0x0); if (bVar2 != 0) { maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34c30); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34ad0) ; if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { EntityRef::constructor(&EStack_3c,source); bVar2 = 0; in_stack_fffffe30 = 0; in_stack_fffffe34 = 0; in_stack_fffffe38 = 0; in_stack_fffffe3c = 0; in_stack_fffffe20 = 0x3f800000; in_stack_fffffe24 = 0x3f800000; in_stack_fffffe28 = 0x3fa66666; in_stack_fffffe2c = 0x3f800000; in_stack_fffffe40 = 0x3e20a0a1; in_stack_fffffe44 = 0x3e20a0a1; fVar8 = 0.15686275; } else { fVar8 = 9.52384e-39; EntityRef::constructor(&EStack_3c,source); bVar2 = 0; Color::Color(aCStackY_180c + 0x81); } color._tint[1] = (float)in_stack_fffffe24; color._tint[0] = (float)in_stack_fffffe20; color._tint[2] = (float)in_stack_fffffe28; color._tint[3] = (float)in_stack_fffffe2c; color._colorize[0] = (float)in_stack_fffffe30; color._colorize[1] = (float)in_stack_fffffe34; color._colorize[2] = (float)in_stack_fffffe38; color._colorize[3] = (float)in_stack_fffffe3c; color._offset[0] = (float)in_stack_fffffe40; color._offset[1] = (float)in_stack_fffffe44; color._offset[2] = fVar8; Entity::AddSlowing(entity,&EStack_3c,0x3c,0.9,color,bVar2); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,&g_tearFlagPoison); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { iVar7 = 0x28; if (1 < *(int *)&g_game->_deathmatchManager) { iVar7 = 0x3c; } EntityRef::constructor(&EStack_3c,damageSource); Entity::AddPoison(entity,&EStack_3c,iVar7,0.0,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34be0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { iVar7 = *(int *)&g_game->_deathmatchManager; EntityRef::constructor(&EStack_3c,damageSource); iVar5 = -0x2d; if (iVar7 < 2) { iVar5 = -0x32; } Entity::AddFreeze(entity,&EStack_3c,iVar5,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34c10); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,damageSource); Entity::AddCharmed(entity,&EStack_3c,0x96,0,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34bf0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { rngValue = Random(); EntityRef::constructor(&EStack_3c,damageSource); Entity::AddConfusion(entity,&EStack_3c,rngValue % 0x1e + 0x96,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34a60); tmpEntity = damageSource; if ((!((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0)) || (!((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0))) { if ((*(int *)&g_game->_deathmatchManager < 2) || (entity->_type != 1)) { cVar3 = (**(code **)(*(int *)entity + 0x4c))(); tmpEntity = damageSource; if (cVar3 == '\0') { EntityRef::constructor(&EStack_3c,damageSource); Entity::AddConfusion(entity,&EStack_3c,-99999999,0); } else { EntityRef::constructor(&EStack_3c,damageSource); Entity::AddConfusion(entity,&EStack_3c,-300,0); } } else { EntityRef::constructor(&EStack_3c,damageSource); Entity::AddConfusion(entity,&EStack_3c,-0xf0,0); } } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34c20); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,tmpEntity); Entity::AddFear(entity,&EStack_3c,-0x96,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34c00); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { pEVar4 = (Entity_Player *)0x28; local_ac[0] = (Entity_Player *)0x28; if ((tmpEntity != (Entity *)0x0) && (tmpEntity->_type == 1000)) { if (tmpEntity->_variant == 0x93) { pEVar4 = (Entity_Player *)&DAT_00000050; } local_ac[0] = pEVar4; } EntityRef::constructor(&EStack_3c,tmpEntity); Entity::AddBurn(entity,&EStack_3c,(int)local_ac[0],0.0,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34a20); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,tmpEntity); Entity::AddMidasFreeze(entity,&EStack_3c,0x5a,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34700); if (((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (((**(code **)(*(int *)entity + 0x58))(), scratchVec.x != g_vectorZero.x || (scratchVec.y != g_vectorZero.y)))) && (0.0 < local_d8.y * scratchVec.y + local_b8.y * scratchVec.x)) { local_ac[0] = *(Entity_Player **)(*(int *)entity + 0x20); EntityRef::constructor(&EStack_3c,tmpEntity); if (*(int *)&g_game->_deathmatchManager < 2) { local_d0.x = 0.0; local_d0.y = 0.0; } (*(code *)local_ac[0])(); EntityRef::constructor(&EStack_3c,tmpEntity); Entity::AddBleeding(entity,&EStack_3c,-0x96,unused); manager = g_manager; local_ac[0] = (Entity_Player *)0x4d; seed_fart_sound_override((int *)local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac[0],0.7,8,0,1.0,0.0); rngValue = Random(); local_ac[0] = (Entity_Player *)(local_b8.y * -4.0); local_e8.y = local_d8.y * -4.0; pVVar6 = MusicManager::RandomVector((Vector *)(local_c8 + 8)); local_d0.y = local_e8.y + pVVar6->y; local_d0.x = (float)local_ac[0] + pVVar6->x; local_100.x = (entity->_pos).x - entity->_size * local_b8.y * 0.5; local_100.y = (entity->_pos).y - entity->_size * local_d8.y * 0.5; tmpEntity = Game::Spawn(g_game,1000,2,&local_100,&local_d0,(Entity *)0x0,2,rngValue); (**(code **)(*(int *)tmpEntity + 0x3c))(); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -15.0; rngValue = Random(); iVar7 = *(int *)tmpEntity; *(float *)(tmpEntity[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 360.0; (**(code **)(iVar7 + 0xc))(); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c349d0); source = damageSource; if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,damageSource); Entity::AddMagnetized(entity,&EStack_3c,0x96,unused_00); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c349c0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,source); Entity::AddBaited(entity,&EStack_3c,0xb4,unused_01); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c349e0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,source); Entity::AddIce(entity,&EStack_3c,10); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c349f0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { scratchVec.x = local_b8.y * 26.0; scratchVec.y = local_d8.y * 26.0; rngValue = Random(); manager = g_manager; local_ac[0] = (Entity_Player *)0x1de; local_e8.y = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.95; seed_fart_sound_override((int *)local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac[0],1.0,8,0,local_e8.y,0.0); source = damageSource; EntityRef::constructor(&EStack_3c,damageSource); Entity::AddKnockback(entity,&EStack_3c,&scratchVec,0xe,1); EntityRef::constructor(&EStack_3c,source); Entity::AddConfusion(entity,&EStack_3c,0x3c,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34a90); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { flagsHigh = *(undefined4 *)((int)&entity->_flags + 4); *(uint *)&entity->_flags = (uint)entity->_flags | 0x800000; *(undefined4 *)((int)&entity->_flags + 4) = flagsHigh; } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34a80); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { EntityRef::constructor(&EStack_3c,source); Entity::AddShrink(entity,&EStack_3c,-0x96,0,0); } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34aa0); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) || (((maskedFlags = BitSet128::operator_and ((BitSet128 *)local_f8,&flags,(BitSet128 *)&DAT_00c34a70), (int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0 || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (rngValue = Random(), rngValue % 0x14 == 0)))) { pos.y = hitPos.y; pos.x = hitPos.x; iVar7 = Room::GetGridCollisionAtPos(g_game->_room,pos); if (iVar7 == 0) { rngValue = Random(); rngValue2 = Random(); local_e8.y = ((float)((double)(int)rngValue2 + __uint_to_double_fixup[-((int)rngValue2 >> 0x1f)]) * 2.3283064e-10 * 40.0 + 160.0) * 0.017453292; local_ac[0] = (Entity_Player *)cos(local_e8.y); fVar8 = sin(local_e8.y); local_e8.y = local_b8.y * (float)local_ac[0] - local_d8.y * fVar8; local_b8.y = local_b8.y * fVar8 + local_d8.y * (float)local_ac[0]; rngValue2 = Random(); pVVar6 = &scratchVec; coinSpawnPos = &hitPos; fVar8 = (float)((double)(int)rngValue2 + __uint_to_double_fixup[-((int)rngValue2 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; scratchVec.x = local_e8.y * fVar8; scratchVec.y = local_b8.y * fVar8; } else { rngValue = Random(); coinSpawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_c8 + 8),&hitPos,40.0,0,0,0); pVVar6 = &g_vectorZero; } Game::Spawn(g_game,5,0x14,coinSpawnPos,pVVar6,(Entity *)0x0,1,rngValue); source = damageSource; } } maskedFlags = BitSet128::operator_and((BitSet128 *)local_c8,&flags,(BitSet128 *)&DAT_00c34a10); if ((((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (bVar2 = Entity::IsActiveEnemy(entity,0), bVar2 != 0)) && ((cVar3 = (**(code **)(*(int *)entity + 0x4c))(), cVar3 == '\0' && (*(char *)((int)entity->_config + 0x2c) == '\0')))) && (entity->_type != 1)) { entityFn = *(code **)(*(int *)entity + 0x24); EntityRef::constructor(&EStack_3c,damageSource); (*entityFn)(); local_b8.y = 0.0; if ((damageSource != (Entity *)0x0) && ((local_b8.y = (float)Entity::GetLastSpawner(damageSource), (Entity_Tear *)local_b8.y == (Entity_Tear *)0x0 || (((Entity_Tear *)local_b8.y)->_type != 1) ))) { local_b8.y = 0.0; } rngValue = Random(); fVar8 = local_b8.y; local_d8.y = 0.0; local_d0.y = 0.01; local_e8.y = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10; do { TearParams::constructor(&tearParams); if ((Entity_Tear *)fVar8 != (Entity_Tear *)0x0) { Random(); hitParams = (TearParams *)Entity_Player::GetTearHitParams(); TearParams::operator_(&tearParams,hitParams); } local_100.y = (float)Random(); local_ac[0] = (Entity_Player *) (((float)(int)local_d8.y / 10.0 + local_e8.y) * 360.0 * 0.017453292); local_b8.y = sin((float)local_ac[0]); local_ac[0] = (Entity_Player *)cos((float)local_ac[0]); fVar9 = sqrtf(local_b8.y * local_b8.y + (float)local_ac[0] * (float)local_ac[0]); if (fVar9 <= 0.0) { scratchVec.x = (float)local_ac[0]; scratchVec.y = local_b8.y; } else { scratchVec.y = local_b8.y * (10.0 / fVar9); scratchVec.x = (10.0 / fVar9) * (float)local_ac[0]; } local_c8._8_4_ = (entity->_pos).x; local_bc = (entity->_pos).y; local_b8.y = (float)Game::Spawn(g_game,2,1,(Vector *)(local_c8 + 8),&scratchVec, (Entity *)local_dc,0,(uint)local_100.y); local_100.y = tearParams._tearScale * 1.355; pVVar6 = &local_100; if ((float)(tearParams._tearScale * 1.355) <= 0.01) { pVVar6 = &local_d0; } fVar9 = pVVar6->y; ((Entity_Tear *)local_b8.y)->_baseScale = fVar9; ((Entity_Tear *)local_b8.y)->_fScale = fVar9; ResetSpriteScale((Entity_Tear *)local_b8.y); maskedFlags = BitSet128::__bnot((BitSet128 *)&DAT_00c34a10,&invertedMask); maskedFlags = BitSet128::operator_and(&inheritedFlags,&tearParams._flags,maskedFlags); SetTearFlags((Entity_Tear *)local_b8.y,*maskedFlags); (**(code **)(*(int *)local_b8.y + 0x40))(); local_40 = 0x3f59999a; EStack_3c._type = 0x3f59999a; EStack_3c._variant = 0x3f59999a; EStack_3c._spawnerType = 0x3f800000; EStack_3c._spawnerVariant = 0x3f800000; EStack_3c._position.x = 1.0; EStack_3c._position.y = 1.0; EStack_3c._velocity.x = 1.0; EStack_3c._velocity.y = -0.2; EStack_3c._flags = -0x41b33333; EStack_3c._entity = (void *)0xbe4ccccd; (**(code **)(*(int *)local_b8.y + 0x3c))(); *(byte *)((int)local_b8.y + 0x7e8) = 0; maskedFlags = BitSet128::operator_and (&flagsResult,(BitSet128 *)((int)local_b8.y + 0x428), (BitSet128 *)&DAT_00c345e0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { *(float *)((int)local_b8.y + 0x418) = 3.0; *(float *)((int)local_b8.y + 0x414) = -15.0 - *(float *)((int)local_b8.y + 0x414); } local_d8.y = (float)((int)local_d8.y + 1); } while ((int)local_d8.y < 10); source = damageSource; } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34a00); if (((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (bVar2 = Entity::IsActiveEnemy(entity,0), bVar2 != 0)) && ((entity->_flags & 0x10) == 0)) { local_b8.x = (entity->_pos).x; local_b8.y = (entity->_pos).y; cVar3 = (**(code **)(*(int *)entity + 0x4c))(); if (((cVar3 != '\0') || (*(char *)((int)entity->_config + 0x2c) != '\0')) || (entity->_type == 1)) { room = g_game->_room; local_100.y = (entity->_velocity).y * 8.0 + local_b8.y; local_d0.y = (entity->_velocity).x * 8.0 + local_b8.x; rngValue = Random(); local_e8.y = -20.0 - (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 20.0; rngValue = Random(); local_bc = local_100.y + local_e8.y; local_c8._8_4_ = ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) + local_d0.y; Room::GetClampedPositionImpl(room,&scratchVec,(Vector *)(local_c8 + 8),10.0,10.0,10.0,10.0); local_b8.x = scratchVec.x; local_b8.y = scratchVec.y; source = damageSource; } local_d0.y = (float)g_game->_room; gridEntity = Room::GetGridEntityFromPos(g_game->_room,&local_b8); if ((gridEntity == (GridEntity *)0x0) || (gridEntity->_collisionClass == 0)) { EntityList::QuerySublist ((EntityList *)((int)local_d0.y + 0x1218),(EntityList_EL *)local_c8,1000,0x7d,-1,0,0 ); local_8 = (Entity_Player *)0x0; if ((uint)local_bc < 2) { rngValue = Random(); local_ac[0] = (Entity_Player *)(rngValue & 0xffffff01); if (local_bc == 1.4013e-45) { rngValue = (uint)local_ac[0] >> 8; local_ac[0] = (Entity_Player *) CONCAT31((int3)rngValue,*(char *)(*(int *)local_c8._4_4_ + 0x148) == '\0'); } cVar3 = (**(code **)(*(int *)entity + 0x4c))(); if ((cVar3 == '\0') && (entity->_type != 1)) { Entity_NPC::hold_set((Entity_NPC *)entity); EntityRef::constructor(&EStack_3c,source); Entity::AddFear(entity,&EStack_3c,-0x32,0); } rngValue = Random(); tmpEntity = Game::Spawn(g_game,1000,0x7d,&local_b8,&g_vectorZero,(Entity *)local_dc,0, rngValue); Entity::SetTarget(tmpEntity,entity); iVar7 = *(int *)tmpEntity; (tmpEntity->_sprite)._flipX = (byte)local_ac[0]; (**(code **)(iVar7 + 0xc))(); } local_8 = (Entity_Player *)0xffffffff; EntityList_Query::~EntityList_Query(local_c8); } } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34af0); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (rngValue = Random(), rngValue % 3 == 0)) { entityFn = *(code **)(*(int *)entity + 0x20); EntityRef::constructor(&EStack_3c,damageSource); (*entityFn)(); } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c349a0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { entityFn = *(code **)(*(int *)entity + 0x20); EntityRef::constructor(&EStack_3c,damageSource); (*entityFn)(); } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34650); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { entityFn = *(code **)(*(int *)entity + 0x20); EntityRef::constructor(&EStack_3c,damageSource); (*entityFn)(); } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34660); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { entityFn = *(code **)(*(int *)entity + 0x20); EntityRef::constructor(&EStack_3c,damageSource); (*entityFn)(); } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34ae0); source = damageSource; if (((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && ((entity->_flags & 0x4000000) == 0)) && (damageSource != (Entity *)0x0)) { iVar7 = damageSource->_type; if (iVar7 == 2) { local_c8._8_4_ = (damageSource->_velocity).x; local_bc = (damageSource->_velocity).y; Vector::Normalized((Vector *)(local_c8 + 8),&local_d0); fVar8 = entity->_mass; fVar9 = source->_mass * local_d0.x; local_d0.y = source->_mass * local_d0.y; if (0.0 < fVar8) { fVar9 = fVar9 / fVar8; local_d0.y = local_d0.y / fVar8; } fVar8 = *(float *)(source[1]._sprite._filename._buf + 0xc); local_d0.y = fVar8 * local_d0.y; local_d0.x = fVar8 * fVar9; Entity::AddVelocity_divided(entity,&local_d0,0); } else { if (iVar7 == 8) { fVar8 = ((damageSource->_sprite)._rotation + 90.0) * 0.017453292; local_d0.y = fVar8; local_ac[0] = (Entity_Player *)cos(fVar8); local_bc = sin(local_d0.y); pEVar4 = local_ac[0]; } else { if ((iVar7 != 1000) || (damageSource->_variant != 0x71)) goto LAB_0067c928; local_bc = (damageSource->_velocity).y; local_c8._8_4_ = (damageSource->_velocity).x; bVar2 = Vector::operator_eq((Vector *)(local_c8 + 8),&g_vectorZero); if (bVar2 == 0) { local_c8._8_4_ = (source->_velocity).x; local_bc = (source->_velocity).y; } else { local_c8._8_4_ = (entity->_pos).x - (source->_pos).x; local_bc = (entity->_pos).y - (source->_pos).y; } pVVar6 = Vector::Normalized((Vector *)(local_c8 + 8),&scratchVec); pEVar4 = (Entity_Player *)pVVar6->x; local_bc = pVVar6->y; } fVar8 = entity->_mass; if (0.0 < fVar8) { pEVar4 = (Entity_Player *)((float)pEVar4 / fVar8); local_bc = local_bc / fVar8; } local_c8._8_4_ = (float)pEVar4 * 51.0; local_bc = local_bc * 51.0; Entity::AddVelocity_divided(entity,(Vector *)(local_c8 + 8),0); } } LAB_0067c928: cVar3 = Entity_NPC::CanReroll((Entity_NPC *)entity); if (((cVar3 == '\0') || (iVar7 = entity->_type, iVar7 == 0xf5)) || ((iVar7 == 0x1c || (iVar7 == 0xd5)))) goto LAB_0067cba7; maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c349b0); bVar2 = BitSet128::IsNonZero(maskedFlags); if (((bVar2 != 0) && (bVar2 = Entity::IsVulnerableEnemy(entity,(Entity *)0x0), bVar2 != 0)) && (entity->_type != 1)) { (**(code **)(*(int *)entity + 0x28))(); rngValue = Random(); local_c8._8_4_ = (entity->_pos).x; local_bc = (entity->_pos).y; tmpEntity = Game::Spawn(g_game,0xf5,0,(Vector *)(local_c8 + 8),&g_vectorZero,(Entity *)0x0,0, rngValue); local_d0.y = (float)tmpEntity; Color::Color(); Color::assign(); if (entity->_minecart != (EntityPtr)0x0) { Entity_NPC::MinecartUpdateChild((Entity_NPC *)entity->_minecart,(Entity *)local_d0.y); } } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c347b0); bVar2 = BitSet128::IsNonZero(maskedFlags); if ((bVar2 != 0) && (bVar2 = Entity::IsVulnerableEnemy(entity,(Entity *)0x0), bVar2 != 0)) { if ((source == (Entity *)0x0) || ((tmpEntity = Entity::GetLastSpawner(source), tmpEntity == (Entity *)0x0 || (tmpEntity->_type != 3)))) { local_ac[0] = (Entity_Player *)Entity::GetLastSpawner(source); if ((local_ac[0] != (Entity_Player *)0x0) && (local_ac[0]->_type == 1)) goto LAB_0067ca94; } else { local_ac[0] = *(Entity_Player **)&tmpEntity[1].field_0x4; if (local_ac[0] != (Entity_Player *)0x0) { LAB_0067ca94: local_bc = (source->_pos).y; local_c8._8_4_ = (source->_pos).x; iVar7 = Entity_Familiar::GetRandomWisp(&source->_dropRNG); Entity_Player::AddWisp(local_ac[0],iVar7,(Vector *)(local_c8 + 8),0,0); (**(code **)(*(int *)entity + 0x28))(); } } } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c347c0); bVar2 = BitSet128::IsNonZero(maskedFlags); if ((bVar2 != 0) && (bVar2 = Entity::IsVulnerableEnemy(entity,(Entity *)0x0), bVar2 != 0)) { Game::DevolveEnemy(entity,(Entity **)0x0); } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c347a0); bVar2 = BitSet128::IsNonZero(maskedFlags); if ((bVar2 != 0) && (bVar2 = Entity::IsVulnerableEnemy(entity,(Entity *)0x0), bVar2 != 0)) { rngValue = Random(); local_c8._8_4_ = (entity->_pos).x; local_bc = (entity->_pos).y; Game::Spawn(g_game,1000,0x1d,(Vector *)(local_c8 + 8),&g_vectorZero,(Entity *)0x0,0,rngValue); tmpEntity = (Entity *)__RTDynamicCast(); Entity::SetTarget(tmpEntity,entity); (**(code **)(*(int *)tmpEntity + 0xc))(); source = damageSource; } LAB_0067cba7: maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34ab0); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (bVar2 = Entity::IsActiveEnemy(entity,0), bVar2 != 0)) { if (((source == (Entity *)0x0) || (local_ac[0] = (Entity_Player *)Entity::GetLastSpawner(source), local_ac[0] == (Entity_Player *)0x0)) || (local_ac[0]->_type != 1)) { local_ac[0] = Game::GetPlayer(g_game,0); } rngValue = Random(); local_c8._8_4_ = (entity->_pos).x; local_bc = (entity->_pos).y; Game::Spawn(g_game,1000,0x13,(Vector *)(local_c8 + 8),&g_vectorZero,source,0,rngValue); local_dc = (EntityPtr)__RTDynamicCast(); local_100.y = (float)((int)local_dc + 0x3bc); if (*(int *)local_100.y != 0) { local_d0.y = local_100.y; std::multiset::erase(); } *(Entity_Player **)local_100.y = local_ac[0]; if (local_ac[0] != (Entity_Player *)0x0) { std::multiset::insert(); } (**(code **)(*(int *)local_dc + 0x40))(); iVar1 = DAT_00c34b1c; iVar5 = _DAT_00c34b18; iVar7 = DAT_00c34b14; if (1 < *(int *)&g_game->_deathmatchManager) { *(int *)((int)local_dc + 0x420) = _DAT_00c34b10; *(int *)((int)local_dc + 0x424) = iVar7; *(int *)((int)local_dc + 0x428) = iVar5; *(int *)((int)local_dc + 0x42c) = iVar1; } entityConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,1000,0x13,0); sizeMulti.y = g_vectorOne.y; sizeMulti.x = g_vectorOne.x; Entity::SetSize((Entity *)local_dc,100.0,sizeMulti,entityConfig->gridCollisionPoints); *(int *)((int)local_dc + 0x30) = 1; } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c34a40); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { local_e8.x = *(float *)local_e0; local_e8.y = *(float *)&local_e0->field_0x4; if ((source != (Entity *)0x0) && (source->_type == 7)) { local_e8.x = (entity->_pos).x; local_e8.y = (entity->_pos).y; } rngValue = Random(); tmpEntity = Game::Spawn(g_game,1000,0x2c,&local_e8,&g_vectorZero,source,0,rngValue); (**(code **)(*(int *)tmpEntity + 0xc))(); if ((source == (Entity *)0x0) || (local_e0 = (Entity_Player *)__RTDynamicCast(), local_e0 == (Entity_Player *)0x0)) { local_e0 = Game::GetPlayer(g_game,0); } bVar2 = Entity::IsVulnerableEnemy(entity,(Entity *)0x0); if ((bVar2 != 0) || (cVar3 = (**(code **)(*(int *)entity + 0x48))(), cVar3 != '\0')) { rngValue = Random(); manager = g_manager; local_ac[0] = (Entity_Player *)0xb5; local_d0.y = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.0; seed_fart_sound_override((int *)local_ac); SoundEffects::Play(&manager->_sfxManager,(int)local_ac[0],0.5,2,0,local_d0.y,0.0); local_d8.x = local_e8.x; local_d8.y = local_e8.y; if (damageSource != (Entity *)0x0) { local_d8.x = local_e8.x - (damageSource->_velocity).x; local_d8.y = local_e8.y - (damageSource->_velocity).y; } rngValue = Random(); if ((rngValue & 1) == 0) { rngValue = Random(); pEVar4 = local_e0; local_b8.y = (float)((rngValue & 1) + 1); if ((Entity_Tear *)local_b8.y != (Entity_Tear *)0x0) { do { local_ac[0] = (Entity_Player *)Entity_Player::AddBlueFlies(pEVar4,1,&local_d8,entity); local_e0 = (Entity_Player *)((pEVar4->_pos).x - local_e8.x); local_dc = (EntityPtr)((pEVar4->_pos).y - local_e8.y); fVar8 = sqrtf((float)local_e0 * (float)local_e0 + (float)local_dc * (float)local_dc); if (0.0 < fVar8) { local_e0 = (Entity_Player *)((float)local_e0 * (1.0 / fVar8)); local_dc = (EntityPtr)((float)local_dc * (1.0 / fVar8)); } rngValue = Random(); fVar8 = ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 48.0 - 24.0) * 0.017453292; local_d0.y = fVar8; local_100.y = cos(fVar8); local_d0.y = sin(local_d0.y); rngValue = Random(); fVar8 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)] ) * 2.3283064e-10 * 4.0 + 10.0; (local_ac[0]->_velocity).x = ((float)local_e0 * local_100.y - (float)local_dc * local_d0.y) * fVar8; (local_ac[0]->_velocity).y = ((float)local_e0 * local_d0.y + (float)local_dc * local_100.y) * fVar8; rngValue = Random(); local_b8.y = (float)((int)&((Entity_Tear *)((int)local_b8.y + -0x824))->_tearRange + 3); local_ac[0]->_chargeBarSprites[5]._color._offset[1] = (float)(rngValue % 10 + 0x14); } while ((Entity_Tear *)local_b8.y != (Entity_Tear *)0x0); local_b8.y = 0.0; } } else { rngValue = Random(); pEVar4 = local_e0; fVar8 = (float)((rngValue & 1) + 1); local_d0.y = fVar8; if (fVar8 != 0.0) { do { local_bc = (pEVar4->_pos).y; local_c8._8_4_ = (pEVar4->_pos).x; pVVar6 = Room::FindFreePickupSpawnPosition (g_game->_room,&scratchVec,(Vector *)(local_c8 + 8),0.0,0,0,0); pEVar4->_numBlueSpiders = pEVar4->_numBlueSpiders + 1; spawn_blue_spider(&local_d8,(Entity *)pEVar4,pVVar6); fVar8 = (float)((int)fVar8 + -1); } while (fVar8 != 0.0); entity = hitEntity; } } } } maskedFlags = BitSet128::operator_and(&flagsResult,&flags,(BitSet128 *)&DAT_00c347e0); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (((1 < *(int *)&g_game->_deathmatchManager && (entity->_type == 1)) || (entity->_type - 10U < 0x3de)))) { entityFlags = entity->_flags; flagsHighPtr = (uint *)((int)&entity->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x800000; *(int *)&entity->_flags = (int)entityFlags; } ExceptionList = local_10; return; } //@@ 0067d1f0 get_tear_flags_from_player /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? builds TearFlags from bitmasks, Dead Eye-ish 0x97 chance, ancestor player prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl get_tear_flags_from_player (ulonglong *outDamageFlags,int unused,BitSet128 tearFlags,int unused2,Entity *source) { int iVar1; byte bVar2; uint uVar3; EntityPtr this; float local_c; if (((source == (Entity *)0x0) || (this = source->_spawnerEntity, this == (EntityPtr)0x0)) || ((*(int *)((int)this + 0x28) != 1 && ((((this == (EntityPtr)0x0 || (*(int *)((int)this + 0x28) != 3)) || (*(int *)((int)this + 0x2c) != 0x50)) || (this = *(EntityPtr *)((int)this + 0x410), this == (EntityPtr)0x0)))))) goto LAB_0067d323; local_c = 0.0; bVar2 = Entity_Player::HasCollectible((Entity_Player *)this,0x97,0); if (bVar2 != 0) { local_c = 0.166; } if (((*(byte *)((int)this + 0x202c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) && (2 < *(int *)((int)this + 0x17dc))) { local_c = 0.66; } if (source->_type == 1000) { if (source->_variant == 0x71) { iVar1 = *(int *)(source[1]._sprite._filename._buf + 8); joined_r0x0067d2c6: if (iVar1 == -1) { local_c = local_c * 0.1; } } } else if (source->_type == 7) { iVar1 = *(int *)(source[1]._sprite._filename._buf + 4); goto joined_r0x0067d2c6; } if (((0.0 < local_c) && (*(int *)((int)this + 0x136c) < 0x1e)) && (uVar3 = Random(), (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 < local_c)) { *(uint *)outDamageFlags = (uint)*outDamageFlags | 0x4000; *(undefined4 *)((int)outDamageFlags + 4) = *(undefined4 *)((int)outDamageFlags + 4); } LAB_0067d323: if (1 < *(int *)&g_game->_deathmatchManager) { if ((((uint)tearFlags._l & _DAT_00c34920) != 0 || (DAT_00c34924 & tearFlags._l._4_4_) != 0) || (((uint)tearFlags._h & _DAT_00c34928) != 0 || (DAT_00c3492c & tearFlags._h._4_4_) != 0)) { *(uint *)((int)outDamageFlags + 4) = *(uint *)((int)outDamageFlags + 4) | 8; *(int *)outDamageFlags = (int)*outDamageFlags; } } if ((source != (Entity *)0x0) && (source->_type == 2)) { if ((((uint)tearFlags._l & DAT_00c34a50) != 0 || (DAT_00c34a54 & tearFlags._l._4_4_) != 0) || (((uint)tearFlags._h & DAT_00c34a58) != 0 || (DAT_00c34a5c & tearFlags._h._4_4_) != 0)) { *(uint *)outDamageFlags = (uint)*outDamageFlags | 0x400000; *(undefined4 *)((int)outDamageFlags + 4) = *(undefined4 *)((int)outDamageFlags + 4); } } if ((((uint)tearFlags._l & _DAT_00c34980) != 0 || (DAT_00c34984 & tearFlags._l._4_4_) != 0) || (((uint)tearFlags._h & _DAT_00c34988) != 0 || (DAT_00c3498c & tearFlags._h._4_4_) != 0)) { *(uint *)outDamageFlags = (uint)*outDamageFlags | 0x1000000; *(undefined4 *)((int)outDamageFlags + 4) = *(undefined4 *)((int)outDamageFlags + 4); } if ((((uint)tearFlags._l & _DAT_00c34b10) != 0 || (DAT_00c34b14 & tearFlags._l._4_4_) != 0) || (((uint)tearFlags._h & _DAT_00c34b18) != 0 || (DAT_00c34b1c & tearFlags._h._4_4_) != 0)) { *(uint *)((int)outDamageFlags + 4) = *(uint *)((int)outDamageFlags + 4) | 8; *(int *)outDamageFlags = (int)*outDamageFlags; } return; } //@@ 0067d430 tear_flags_area_apply /* DB: QueryRadius, damage vulnerable enemies, ApplyTearFlagEffects */ void tear_flags_area_apply (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { code *pcVar1; BitSet128 flags; qword qVar2; byte bVar3; uint uVar4; Vector *in_ECX; Entity *in_EDX; qword *pqVar5; uint uVar6; float in_XMM1_Da; float in_XMM2_Da; EntityRef local_58; EntityList_EL local_30; Vector *local_20; uint local_1c; Entity *local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af229d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_20 = in_ECX; local_18 = in_EDX; local_14 = in_XMM2_Da; EntityList::QueryRadius((EntityList *)((int)g_game->_room + 0x1218),&local_30,in_ECX,in_XMM1_Da,8) ; local_8 = 0; local_1c = 0; if (local_30._size != 0) { do { uVar6 = local_1c; bVar3 = Entity::IsVulnerableEnemy (*(Entity **)((int)local_30._data + local_1c * 4),(Entity *)0x0); if (bVar3 != 0) { pcVar1 = *(code **)(**(int **)((int)local_30._data + uVar6 * 4) + 0x20); EntityRef::constructor(&local_58,local_18); (*pcVar1)(local_14,0,0,&local_58,0x1e,uVar4); uVar6 = local_1c; flags._l._4_4_ = param_2; flags._l._0_4_ = param_1; flags._h._0_4_ = param_3; flags._h._4_4_ = param_4; Entity_Tear::ApplyTearFlagEffects (*(Entity **)((int)local_30._data + local_1c * 4),local_20,flags,local_18,local_14 ); } local_1c = uVar6 + 1; } while (local_1c < (uint)local_30._size); } if (local_30._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } if (local_30._data != (void *)0x0) { uVar4 = *(uint *)((int)local_30._data + -4); qVar2 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar4; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar2 < uVar4); free((void *)((int)local_30._data + -4)); } } ExceptionList = local_10; return; } //@@ 0067d560 Entity_Tear::try_make_bridges /* DB: ? bool; from Entity_Tear::Update for tears without the masked flags (or 1-in-N random): walks the tear path vector (+0x178/+0x17c, 8-byte entries) against room grid entries, Room::TryMakeBridge, set of touched indices */ undefined1 Entity_Tear::try_make_bridges(float *param_1) { GridEntity *rock; Room *this; char cVar1; uint uVar2; BitSet128 *maskedFlags; int iVar3; GridEntity *pit; Entity *in_ECX; void *collisionPoints; int iVar4; int iVar5; uint uVar6; Entity *pEVar7; float dirX; float dirY; EntityRef tearRef; BitSet128 local_58; BitSet128 local_48; BitSet128 local_38; int *local_28; int *local_24; int rockDamage; void *local_1c; Entity *local_18; undefined1 isHitSolid; char isRockDestroyed; void *local_10; undefined1 *puStack_c; undefined4 local_8; float velX; float velY; code *virtualFn; local_8 = 0xffffffff; puStack_c = &LAB_00af7a8d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = in_ECX; maskedFlags = BitSet128::operator_and (&local_48,(BitSet128 *)((int)&in_ECX[1]._pendingDamageFlags + 4), (BitSet128 *)&DAT_00c346f0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || (local_28 = (int *)((uint)maskedFlags->_h | *(uint *)((int)&maskedFlags->_h + 4)), local_28 != (int *)0x0)) { ExceptionList = local_10; return 0; } isHitSolid = 0; isRockDestroyed = '\0'; rockDamage = (10.0 < in_ECX->_collisionDamage) + 1; local_24 = local_28; local_28 = operator_new(0x14); *local_28 = (int)local_28; local_28[1] = (int)local_28; local_28[2] = (int)local_28; *(undefined2 *)(local_28 + 3) = 0x101; local_8 = 0; uVar6 = 0; collisionPoints = (in_ECX->_collisionPoints)._begin; if ((int)(in_ECX->_collisionPoints)._end - (int)collisionPoints >> 3 != 0) { do { local_1c = g_game->_room; iVar4 = (int)(((*param_1 + *(float *)((int)collisionPoints + uVar6 * 8)) - 40.0) / 40.0 + 0.5) ; iVar3 = (int)(((*(float *)((int)collisionPoints + uVar6 * 8 + 4) + param_1[1]) - 120.0) / 40.0 + 0.5); if ((((-1 < iVar4) && (iVar4 < *(int *)((int)local_1c + 0xc))) && (-1 < iVar3)) && ((in_ECX = local_18, iVar3 < *(int *)((int)local_1c + 0x10) && (local_1c = (void *)(iVar3 * *(int *)((int)local_1c + 0xc) + iVar4), -1 < (int)local_1c))) ) { std::set::insert(&local_38._h,&local_1c); } uVar6 = uVar6 + 1; collisionPoints = (in_ECX->_collisionPoints)._begin; } while (uVar6 < (uint)((int)(in_ECX->_collisionPoints)._end - (int)collisionPoints >> 3)); } param_1 = (float *)*local_28; if (param_1 != (float *)local_28) { pEVar7 = local_18; do { if ((((uint)param_1[4] < 0x1c0) && (rock = *(GridEntity **)((int)g_game->_room + (int)param_1[4] * 4 + 0x24), rock != (GridEntity *)0x0)) && ((rock->_collisionClass != 1 && ((rock->_collisionClass != 0 && (isHitSolid = 1, isRockDestroyed == '\0')))))) { cVar1 = (**(code **)(*(int *)rock + 0x1c))(uVar2); if ((cVar1 != '\0') && (((maskedFlags = BitSet128::operator_and (&local_38, (BitSet128 *)((int)&pEVar7[1]._pendingDamageFlags + 4), (BitSet128 *)&DAT_00c34a30), (int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0 || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) || (((maskedFlags = BitSet128::operator_and (&local_58, (BitSet128 *)((int)&pEVar7[1]._pendingDamageFlags + 4), (BitSet128 *)&DAT_00c34980), (int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0 || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (uVar6 = Random(), (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 < pEVar7->_collisionDamage * 0.1)))))) { virtualFn = *(code **)(*(int *)rock + 0x14); EntityRef::constructor(&tearRef,local_18); cVar1 = (*virtualFn)(0,&tearRef); if (cVar1 != '\0') { isRockDestroyed = '\x01'; velX = (local_18->_velocity).x; velY = (local_18->_velocity).y; if (ABS(velX) <= ABS(velY)) { dirX = 0.0; if (0.0 <= velY) { dirY = 1.0; } else { dirY = (float)&DAT_bf800000; } } else { dirY = 0.0; if (0.0 <= velX) { dirX = 1.0; } else { dirX = (float)&DAT_bf800000; } } if ((dirX != g_vectorZero.x) || (dirY != g_vectorZero.y)) { this = g_game->_room; iVar3 = this->_gridWidth; iVar5 = (int)((((float)(rock->_gridIndex % iVar3) * 40.0 + 40.0 + dirX * 40.0) - 40.0) / 40.0 + 0.5); iVar4 = (int)((((float)(rock->_gridIndex / iVar3) * 40.0 + 120.0 + dirY * 40.0) - 120.0) / 40.0 + 0.5); if (((-1 < iVar5) && (((iVar5 < iVar3 && (-1 < iVar4)) && (iVar4 < this->_gridHeight)))) && (iVar5 = iVar3 * iVar4 + iVar5, -1 < iVar5)) { if (iVar5 < 0x1c0) { pit = this->_gridEntities[iVar5]; } else { pit = (GridEntity *)0x0; } Room::TryMakeBridge(this,pit,rock); } } } pEVar7 = local_18; } if (isRockDestroyed == '\0') { virtualFn = *(code **)(*(int *)rock + 0x10); EntityRef::constructor(&tearRef,local_18); (*virtualFn)(rockDamage,&tearRef); pEVar7 = local_18; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } while (param_1 != (float *)local_28); } FID_conflict__Erase_tree_>_> (&local_28,(fuzzer_allocator_> *)&local_28, (_Tree_node *)local_28[1]); operator_delete(local_28,0x14); ExceptionList = local_10; return isHitSolid; } //@@ 0067d9b0 FUN_0067d9b0 undefined4 FUN_0067d9b0(void) { undefined4 in_ECX; switch(in_ECX) { case 0: return 1; default: return in_ECX; case 0xb: return 0xc; case 0xd: return 0x17; case 0xe: return 0xf; case 0x10: return 0x11; case 0x18: return 0x19; case 0x21: return 0x22; } } //@@ 0067da40 FUN_0067da40 void FUN_0067da40(void) { float in_XMM1_Da; float in_XMM2_Da; pow(0.9,in_XMM1_Da / in_XMM2_Da); return; } //@@ 0067dac0 FUN_0067dac0 void FUN_0067dac0(int *param_1) { int iVar1; int *in_ECX; iVar1 = *param_1; if (*in_ECX != iVar1) { if (*in_ECX != 0) { param_1 = in_ECX; std::multiset::erase(¶m_1); } *in_ECX = iVar1; if (iVar1 != 0) { std::multiset::insert(in_ECX); } } return; } //@@ 0067db00 GridEntity_Fire::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Fire::BeginBatches(GridEntity_Fire *this) { byte bVar1; uint uVar2; byte *animNameChar; EntityConfig_Entity *preloadEntry; char *pcVar3; byte *expectedByte; Manager *manager; EntityConfig *entityConfig; bool bVar4; undefined4 local_98 [11]; undefined4 local_6c [8]; undefined4 local_4c; undefined4 uStack_48; undefined4 local_44; undefined1 lowerBound [8]; void *foundNode; EntityConfig *local_34; EntityConfig *local_30; std_string anm2Path; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; byte *animData; void **emberColor; int *fireColor; local_8 = 0xffffffff; puStack_c = &LAB_00af7acd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&anm2Path)[1]._size; ExceptionList = &local_10; if ((((this->_desc)._spawnCount < 2) && ((this->_desc)._variant == 0)) && (uVar2 = Random(), uVar2 % 0x28 == 0)) { (this->_desc)._variant = 1; } if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 0x578; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1c; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/grid_fireplace.anm2",0x1d); local_8 = 0; ANM2::Load(&this->_sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar2) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar2 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar2); } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0067dc72: bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Flickering",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } pcVar3 = "Flickering"; do { bVar1 = *animNameChar; bVar4 = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_0067dc54: uVar2 = -(uint)bVar4 | 1; goto LAB_0067dc59; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_0067dc54; animNameChar = animNameChar + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0067dc59: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0067dc72; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1d; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/effect_005_fire.anm2",0x1e); local_8 = 1; ANM2::Load((ANM2 *)(this + 1),&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar2) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar2 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar2); } animData = (byte *)this[1]._rng._shift2; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; if (animData == (byte *)0x0) { LAB_0067ddb6: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 1),(byte *)"FireStage00",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)&this[1]._rng._shift1); this[1]._sprite._filename._buf[4] = '\x01'; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } pcVar3 = "FireStage00"; do { bVar1 = *animNameChar; bVar4 = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_0067dd92: uVar2 = -(uint)bVar4 | 1; goto LAB_0067dd97; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_0067dd92; animNameChar = animNameChar + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0067dd97: if ((uVar2 != 0) || ((animData[0x34] != 0 && (this[1]._sprite._filename._buf[4] == '\0')))) goto LAB_0067ddb6; } manager = g_manager; local_34 = (EntityConfig *)0x3e800f00; local_30 = &g_manager->_entityConfig; _Find_lower_bound<>(lowerBound,&local_34); entityConfig = &manager->_entityConfig; if (((*(char *)((int)foundNode + 0xd) == '\0') && (*(uint *)((int)foundNode + 0x10) < 0x3e800f01)) && (foundNode != (entityConfig->_entities)._head)) { preloadEntry = (EntityConfig_Entity *)((int)foundNode + 0x18); } else { preloadEntry = EntityConfig::GetEntity(entityConfig,1000,0,0); } if (preloadEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(local_30,preloadEntry); manager = g_manager; } local_30 = (EntityConfig *)&DAT_00500a00; local_34 = &manager->_entityConfig; _Find_lower_bound<>(lowerBound,&local_30); if (((*(char *)((int)foundNode + 0xd) == '\0') && (*(undefined **)((int)foundNode + 0x10) <= &DAT_00500a00)) && (foundNode != (manager->_entityConfig)._entities._head)) { preloadEntry = (EntityConfig_Entity *)((int)foundNode + 0x18); } else { preloadEntry = EntityConfig::GetEntity(&manager->_entityConfig,5,0,0); } if (preloadEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(local_34,preloadEntry); manager = g_manager; } local_30 = (EntityConfig *)&DAT_00501400; entityConfig = &manager->_entityConfig; _Find_lower_bound<>(lowerBound,&local_30); if (((*(char *)((int)foundNode + 0xd) == '\0') && (*(undefined **)((int)foundNode + 0x10) <= &DAT_00501400)) && (foundNode != (entityConfig->_entities)._head)) { preloadEntry = (EntityConfig_Entity *)((int)foundNode + 0x18); } else { preloadEntry = EntityConfig::GetEntity(entityConfig,5,0,0); } if (preloadEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(entityConfig,preloadEntry); } if ((this->_desc)._variant == 1) { fireColor = &this[1]._sprite._overlayAnimState._currentlyTriggeredEvents; local_4c = 0; uStack_48 = 0; local_44 = 0; if (fireColor != local_6c) { this[1]._sprite._animCount = 0; this[1]._sprite._layerState = (void *)0x0; this[1]._sprite._layerCount = 0; this[1]._sprite._nullLayerNames = (void *)0x0; this[1]._sprite._numNullLayers = 0; this[1]._sprite._eventNames = (void *)0x0; *fireColor = 0x3f28a8a9; this[1]._sprite._overlayAnimState._previouslyTriggeredEvents = 0x3cc0c0c1; *(undefined4 *)&this[1]._sprite._overlayRenderFirst = 0x3cc0c0c1; this[1]._sprite._animData = (void *)0x3f800000; this[1]._sprite._numEvents = 0; } } this[1]._sprite._championColor._tint[0] = 0.0; uVar2 = Random(); anm2Path._size = 0; anm2Path._capacity = 0xf; this[1]._sprite._championColor._tint[1] = (float)(uVar2 % 3); anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1a; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/Effect_Ember.anm2",0x1b); local_8 = 2; ANM2::Load((ANM2 *)(this[1]._sprite._championColor._colorize + 1),&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar2) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar2 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar2); } animData = (byte *)this[2]._desc._variant; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedByte = s_Idle; do { bVar1 = *animNameChar; bVar4 = bVar1 < *expectedByte; if (bVar1 != *expectedByte) { LAB_0067e036: uVar2 = -(uint)bVar4 | 1; goto LAB_0067e03b; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; bVar4 = bVar1 < expectedByte[1]; if (bVar1 != expectedByte[1]) goto LAB_0067e036; animNameChar = animNameChar + 2; expectedByte = expectedByte + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0067e03b: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((char)this[2]._desc._varData != '\0')))) goto LAB_0067e078; } bVar1 = ANM2::SetAnimation((ANM2 *)(this[1]._sprite._championColor._colorize + 1),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)&this[2]._desc); *(undefined1 *)&this[2]._desc._varData = 1; } LAB_0067e078: if (((this->_desc)._variant == 1) && (emberColor = &this[2]._sprite._animState._nullLayerFrames, emberColor != (void **)local_98)) { this[2]._sprite._animState._previouslyTriggeredEvents = 0; this[2]._sprite._overlayAnimState._animation = (void *)0x0; this[2]._sprite._overlayAnimState._animData = (void *)0x0; this[2]._sprite._overlayAnimState._layerFrames = (void *)0x0; this[2]._sprite._overlayAnimState._nullLayerFrames = (void *)0x0; this[2]._sprite._overlayAnimState._animFrame = 0.0; *emberColor = (void *)0x3f800000; this[2]._sprite._animState._animFrame = 0.15; *(undefined4 *)&this[2]._sprite._animState._isPlaying = 0x3e19999a; this[2]._sprite._animState._currentlyTriggeredEvents = 0x3f800000; *(undefined4 *)&this[2]._sprite._overlayAnimState._isPlaying = 0; } this[1]._sprite._championColor._tint[3] = this[1]._sprite._championColor._tint[2]; ExceptionList = local_10; return; } //@@ 0067e0f0 GridEntity_Fire::Update /* ZHL [vtable slot 2] */ float * __thiscall GridEntity_Fire::Update(GridEntity_Fire *this) { byte bVar1; LayerState *layer; byte *curAnimChar; uint uVar2; int iVar3; Entity_Player *nearestPlayer; Vector *dirToPlayer; Entity *projectile; float *pfVar4; byte *expectedName; float *pfVar5; float *pfVar6; float *pfVar7; bool isLess; float fVar8; float deltaX; float *particleVelYPtr; Vector local_40; Vector local_38; Vector local_30; Vector normalized; float particleX; float particleY; float particleVelX; float particleVelY; undefined4 particleFrame; float *particleLifetime; char *room; switch((this->_desc)._state) { case 0: ANM2::Play((ANM2 *)(this + 1),(byte *)"FireStage00",0); break; case 1: ANM2::Play((ANM2 *)(this + 1),(byte *)"FireStage01",0); break; case 2: ANM2::Play((ANM2 *)(this + 1),(byte *)"FireStage02",0); break; case 3: ANM2::Play((ANM2 *)(this + 1),(byte *)"FireStage03",0); break; case 4: if (this[1]._rng._shift2 != 0) { this[1]._sprite._filename._buf[4] = '\0'; } layer = ANM2::GetLayer((ANM2 *)(this + 1),(byte *)0x0); layer->_visible = 0; } fVar8 = this[1]._sprite._championColor._tint[1]; if (3 < (this->_desc)._state) { curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == (byte *)0x0) { LAB_0067e2a3: bVar1 = ANM2::SetAnimation(&this->_sprite,(&PTR_s_NoFire_00b64fdc)[(int)fVar8],1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } expectedName = (&PTR_s_NoFire_00b64fdc)[(int)fVar8]; do { bVar1 = *curAnimChar; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0067e288: uVar2 = -(uint)isLess | 1; goto LAB_0067e28d; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0067e288; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0067e28d: if ((uVar2 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0067e2a3; } iVar3 = 0; goto LAB_0067e2c6; } curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == (byte *)0x0) { LAB_0067e1fb: bVar1 = ANM2::SetAnimation(&this->_sprite,(&PTR_s_Flickering_00b64fd0)[(int)fVar8],1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } expectedName = (&PTR_s_Flickering_00b64fd0)[(int)fVar8]; do { bVar1 = *curAnimChar; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0067e1e0: uVar2 = -(uint)isLess | 1; goto LAB_0067e1e5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0067e1e0; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0067e1e5: if ((uVar2 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0067e1fb; } GridEntity::hurt_surroundings((GridEntity *)this,38.0,38.0,16.0,1,2,1); iVar3 = 2; LAB_0067e2c6: this->_collisionClass = iVar3; if (*(char *)((int)this[1]._sprite._color._offset + 1) != '\0') { AnimationState::Update((AnimationState *)&this[1]._rng._shift1); AnimationState::Update((AnimationState *)&this[1]._sprite._filename._size); } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } if ((((((this->_desc)._variant == 1) && ((int)this[1]._sprite._championColor._tint[0] < 1)) && ((this->_desc)._state < 4)) && ((uVar2 = Random(), uVar2 % 5 == 0 && (room = g_game->_room, *room != '\0')))) && (0x3c < g_game->_frameCount - *(int *)(room + 0x11f0))) { local_38.x = (float)(this->_gridIndex % *(int *)(room + 0xc)) * 40.0 + 40.0; local_38.y = (float)(this->_gridIndex / *(int *)(room + 0xc)) * 40.0 + 120.0; nearestPlayer = Game::GetNearestPlayer(g_game,&local_38); local_30.x = (nearestPlayer->_pos).x; local_30.y = (nearestPlayer->_pos).y; deltaX = local_30.x - local_38.x; fVar8 = local_30.y - local_38.y; local_40.x = deltaX; local_40.y = fVar8; dirToPlayer = Vector::Normalized(&local_40,&normalized); local_38.x = dirToPlayer->x * 25.0 + local_38.x; local_38.y = dirToPlayer->y * 25.0 + local_38.y; fVar8 = sqrtf(fVar8 * fVar8 + deltaX * deltaX); if (((fVar8 < 160.0) && (bVar1 = Room::CheckLine(g_game->_room,&local_38,&local_30,3,0,0,0,(Vector *)0x0), bVar1 != 0)) && (uVar2 = Random(), uVar2 % 0xf == 0)) { uVar2 = Random(); dirToPlayer = Vector::Normalized(&local_40,&normalized); local_30.x = dirToPlayer->x * 5.0; local_30.y = dirToPlayer->y * 5.0; projectile = Game::SpawnEx(g_game,9,0,&local_38,&local_30,(Entity *)0x0,0,uVar2,0); iVar3 = __RTDynamicCast(projectile,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor,0); *(uint *)(iVar3 + 0x438) = *(uint *)(iVar3 + 0x438) | 0x8000; *(undefined4 *)(iVar3 + 0x43c) = *(undefined4 *)(iVar3 + 0x43c); this[1]._sprite._championColor._tint[0] = 1.17709e-43; } } else { fVar8 = this[1]._sprite._championColor._tint[0]; if (0 < (int)fVar8) { this[1]._sprite._championColor._tint[0] = (float)((int)fVar8 + -1); } } uVar2 = Random(); pfVar4 = (float *)(uVar2 / 7); if ((uVar2 % 7 == 0) && (pfVar4 = (float *)(((int)this[1]._sprite._championColor._tint[3] - (int)this[1]._sprite._championColor._tint[2]) / 0x18), pfVar4 < &DAT_00000005)) { uVar2 = Random(); pfVar4 = (float *)(uVar2 % 0x1e); uVar2 = Random(); local_38.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * -1.6 - 0.8; uVar2 = Random(); local_40.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.4 - 0.2; uVar2 = Random(); fVar8 = -15.0 - (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 15.0; uVar2 = Random(); pfVar6 = (float *)this[1]._sprite._championColor._tint[3]; particleVelY = local_38.x; particleFrame = 0; particleX = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0 - 8.0; particleVelX = local_40.x; particleY = fVar8; particleLifetime = pfVar4; if (pfVar6 == (float *)this[1]._sprite._championColor._colorize[0]) { pfVar4 = (float *)std::vector<24byte>::_Emplace_reallocate(pfVar6,&particleX); } else { *pfVar6 = particleX; pfVar6[1] = fVar8; pfVar6[2] = local_40.x; pfVar6[3] = local_38.x; pfVar6[4] = 0.0; pfVar6[5] = (float)pfVar4; pfVar6 = this[1]._sprite._championColor._tint + 3; *pfVar6 = (float)((int)*pfVar6 + 0x18); } } pfVar6 = (float *)this[1]._sprite._championColor._tint[2]; if (pfVar6 != (float *)this[1]._sprite._championColor._tint[3]) { particleVelYPtr = pfVar6 + 3; do { pfVar7 = particleVelYPtr + -2; *pfVar6 = particleVelYPtr[-1] + *pfVar6; *pfVar7 = *pfVar7 + *particleVelYPtr; uVar2 = Random(); local_38.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.1 - 0.05; uVar2 = Random(); particleVelYPtr[1] = (float)((int)particleVelYPtr[1] + 1); particleVelYPtr[-1] = (((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.4 - 0.2) + particleVelYPtr[-1]) * 0.98; *particleVelYPtr = (local_38.x + *particleVelYPtr) * 0.97; if ((int)particleVelYPtr[1] < (int)particleVelYPtr[2]) { pfVar6 = pfVar6 + 6; particleVelYPtr = particleVelYPtr + 6; pfVar4 = (float *)this[1]._sprite._championColor._tint[3]; } else { pfVar5 = particleVelYPtr + 3; pfVar4 = (float *)this[1]._sprite._championColor._tint[3]; if (pfVar5 != pfVar4) { do { pfVar7[-1] = *pfVar5; pfVar5 = pfVar5 + 6; *pfVar7 = pfVar7[6]; pfVar7[1] = pfVar7[7]; pfVar7[2] = pfVar7[8]; pfVar7[3] = pfVar7[9]; pfVar7[4] = pfVar7[10]; pfVar7 = pfVar7 + 6; } while (pfVar5 != pfVar4); pfVar4 = (float *)this[1]._sprite._championColor._tint[3]; } pfVar4 = pfVar4 + -6; this[1]._sprite._championColor._tint[3] = (float)pfVar4; } } while (pfVar6 != pfVar4); } return pfVar4; } //@@ 0067e880 GridEntity_Fire::Render /* ZHL [exact] void Render(Vector& Offset); */ void GridEntity_Fire::Render(float *param_1) { int iVar1; Vector *pVVar2; GridEntity *in_ECX; AnimationState *pAVar3; float *pfVar4; Vector local_18; Vector local_10; pVVar2 = GridEntity::get_render_position(in_ECX,&local_10); local_18.x = pVVar2->x + *param_1; local_18.y = pVVar2->y + param_1[1]; if ((in_ECX->_sprite)._loaded != 0) { if ((in_ECX->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(in_ECX->_sprite)._animState,&local_18,&g_vectorZero,&g_vectorZero); pAVar3 = &(in_ECX->_sprite)._overlayAnimState; } else { AnimationState::Render (&(in_ECX->_sprite)._overlayAnimState,&local_18,&g_vectorZero,&g_vectorZero); pAVar3 = &(in_ECX->_sprite)._animState; } AnimationState::Render(pAVar3,&local_18,&g_vectorZero,&g_vectorZero); } if (*(char *)((int)in_ECX[1]._sprite._color._offset + 1) != '\0') { if (*(char *)&in_ECX[1]._sprite._animState._animation == '\0') { AnimationState::Render ((AnimationState *)&in_ECX[1]._rng._shift1,&local_18,&g_vectorZero,&g_vectorZero); pAVar3 = (AnimationState *)&in_ECX[1]._sprite._filename._size; } else { AnimationState::Render ((AnimationState *)&in_ECX[1]._sprite._filename._size,&local_18,&g_vectorZero, &g_vectorZero); pAVar3 = (AnimationState *)&in_ECX[1]._rng._shift1; } AnimationState::Render(pAVar3,&local_18,&g_vectorZero,&g_vectorZero); } if (((in_ECX->_desc)._state < 4) && (pfVar4 = (float *)in_ECX[1]._sprite._championColor._tint[2], pfVar4 != (float *)in_ECX[1]._sprite._championColor._tint[3])) { do { iVar1 = in_ECX[2]._desc._variant; pAVar3 = (AnimationState *)&in_ECX[2]._desc; if (iVar1 != 0) { AnimationState::SetFrameFloat (pAVar3,(float)(int)(((float)(int)pfVar4[4] / (float)(int)pfVar4[5]) * (float)*(int *)(iVar1 + 0x30))); } local_10.x = local_18.x + *pfVar4; local_10.y = local_18.y + pfVar4[1]; if (*(char *)((int)&in_ECX[2]._sprite._scale.x + 1) != '\0') { if (in_ECX[2]._sprite._filename._buf[4] == '\0') { AnimationState::Render(pAVar3,&local_10,&g_vectorZero,&g_vectorZero); pAVar3 = (AnimationState *)&in_ECX[2]._gridIndex; } else { AnimationState::Render ((AnimationState *)&in_ECX[2]._gridIndex,&local_10,&g_vectorZero,&g_vectorZero); } AnimationState::Render(pAVar3,&local_10,&g_vectorZero,&g_vectorZero); } pfVar4 = pfVar4 + 6; } while (pfVar4 != (float *)in_ECX[1]._sprite._championColor._tint[3]); } return; } //@@ 0067ea60 GridEntity_Fire::Hurt /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 4] */ undefined4 __thiscall GridEntity_Fire::Hurt(GridEntity_Fire *this,int param_2,float param_3) { Manager *pMVar1; byte bVar2; uint uVar3; int iVar4; Entity_Player *player; ColorMod *Color; Vector *pVVar5; int iVar6; undefined1 auStack_4c [4]; Vector local_48; Vector local_40; Color local_38; uint local_c; local_c = __security_cookie ^ (uint)auStack_4c; local_40.x = param_3; uVar3 = Random(); if (uVar3 % 3 == 0) { iVar6 = 4; if (param_2 + 1 < 4) { iVar6 = param_2 + 1; } } else { iVar6 = param_2; } if ((iVar6 < 1) || (iVar4 = (this->_desc)._state, 3 < iVar4)) { return 0; } iVar4 = iVar4 + iVar6; iVar6 = 4; if (iVar4 < 4) { iVar6 = iVar4; } (this->_desc)._state = iVar6; pMVar1 = g_manager; if (iVar6 == 4) { local_48.x = 3.65739e-43; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_48.x,0.85,2,0,1.0,0.0); uVar3 = Random(); iVar6 = *(int *)((int)g_game->_room + 0xc); local_48.x = (float)(this->_gridIndex % iVar6) * 40.0 + 40.0 + 0.0; local_48.y = ((float)(this->_gridIndex / iVar6) * 40.0 + 120.0) - 10.0; Game::SpawnEx(g_game,1000,0xf,&local_48,&g_vectorZero,(Entity *)0x0,0,uVar3,0); if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 900; } if ((*(Entity **)((int)local_40.x + 0x24) != (Entity *)0x0) && (player = (Entity_Player *)Entity::GetPlayerAncestor(*(Entity **)((int)local_40.x + 0x24)), player != (Entity_Player *)0x0)) { Player_stats_add(&g_game->_onlinePlayerStats,0xe,player,1.0); bVar2 = Entity_Player::HasCollectible(player,0x1a4,0); if (bVar2 != 0) { ::Color::Color(&local_38); pVVar5 = GridEntity::Position((GridEntity *)this,&local_40); Game::BombExplosionEffects (g_game,pVVar5,20.0,(BitSet128)ZEXT816(0),Color,(Entity *)player,1.0,1,4,0); } } uVar3 = Random(); if ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 < 0.1) { uVar3 = Random(); if (((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 < 0.25) && ((bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16), bVar2 == 0 || (uVar3 = Random(), uVar3 % 5 == 0)))) { uVar3 = Random(); pVVar5 = GridEntity::Position((GridEntity *)this,&local_40); Game::SpawnEx(g_game,5,10,pVVar5,&g_vectorZero,(Entity *)0x0,0,uVar3,0); return 1; } uVar3 = Random(); pVVar5 = GridEntity::Position((GridEntity *)this,&local_40); Game::SpawnEx(g_game,5,0x14,pVVar5,&g_vectorZero,(Entity *)0x0,0,uVar3,0); } } return 1; } //@@ 0067ed90 std::vector<24byte>::_Emplace_reallocate /* DB: growth/max 0xaaaaaaa by /0x18, 24-byte POD element; caller GridEntity_Fire::Update */ undefined4 * std::vector<24byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; undefined4 *puVar3; int iVar4; undefined4 uVar5; undefined4 *puVar6; void *pvVar7; int iVar8; void *pvVar9; undefined4 *puVar10; int *in_ECX; uint uVar11; uint uVar12; undefined4 *puVar13; void *ptr; iVar4 = *in_ECX; iVar8 = (in_ECX[1] - iVar4) / 0x18; if (iVar8 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar8 + 1; uVar12 = (in_ECX[2] - iVar4) / 0x18; if (0xaaaaaaa - (uVar12 >> 1) < uVar12) { uVar11 = 0xaaaaaaa; } else { uVar12 = (uVar12 >> 1) + uVar12; uVar11 = uVar1; if (uVar1 <= uVar12) { uVar11 = uVar12; } if (0xaaaaaaa < uVar11) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar9 = _Allocate(uVar11 * 0x18); puVar3 = (undefined4 *)((int)pvVar9 + (((int)param_1 - iVar4) / 0x18) * 0x18); uVar5 = *param_2; puVar3[1] = param_2[1]; *puVar3 = uVar5; uVar5 = param_2[2]; puVar3[3] = param_2[3]; puVar3[2] = uVar5; puVar3[4] = param_2[4]; puVar3[5] = param_2[5]; puVar10 = (undefined4 *)*in_ECX; puVar6 = (undefined4 *)in_ECX[1]; if (param_1 == puVar6) { if (puVar10 != puVar6) { puVar13 = (undefined4 *)((int)pvVar9 + 0x10); do { uVar5 = puVar10[1]; puVar13[-4] = *puVar10; puVar13[-3] = uVar5; uVar5 = puVar10[3]; puVar13[-2] = puVar10[2]; puVar13[-1] = uVar5; *puVar13 = puVar10[4]; puVar2 = puVar10 + 5; puVar10 = puVar10 + 6; puVar13[1] = *puVar2; puVar13 = puVar13 + 6; } while (puVar10 != puVar6); } } else { FUN_0067ef50(puVar10,param_1,pvVar9); FUN_0067ef50(param_1,in_ECX[1],puVar3 + 6); } pvVar7 = (void *)*in_ECX; if (pvVar7 != (void *)0x0) { uVar12 = ((in_ECX[2] - (int)pvVar7) / 0x18) * 0x18; ptr = pvVar7; if (0xfff < uVar12) { ptr = *(void **)((int)pvVar7 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar12); } *in_ECX = (int)pvVar9; in_ECX[1] = (int)((int)pvVar9 + uVar1 * 0x18); in_ECX[2] = (int)(uVar11 * 0x18 + (int)pvVar9); return puVar3; } //@@ 0067ef50 FUN_0067ef50 undefined4 * FUN_0067ef50(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *puVar4; puVar4 = param_3; if (param_1 != param_2) { puVar3 = param_1 + 4; do { uVar2 = puVar3[-4]; puVar4[1] = puVar3[-3]; *puVar4 = uVar2; uVar2 = puVar3[-2]; puVar4[3] = puVar3[-1]; puVar4[2] = uVar2; *(undefined4 *)((int)param_3 + (-0x18 - (int)param_1) + (int)(puVar3 + 6)) = *puVar3; puVar4[5] = puVar3[1]; puVar1 = puVar3 + 2; puVar4 = puVar4 + 6; puVar3 = puVar3 + 6; } while (puVar1 != param_2); } return puVar4; } //@@ 0067efb0 FUN_0067efb0 undefined4 FUN_0067efb0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x1c); } //@@ 0067efc0 GridEntity::VarData /* ZHL [lua] Lua binding GridEntity:VarData */ int __thiscall GridEntity::VarData(GridEntity *this) { return (this->_desc)._varData; } //@@ 0067efd0 FUN_0067efd0 undefined1 FUN_0067efd0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x21); } //@@ 0067efe0 random_float /* DB: ? tail-calls Random, result used as 0..1 float (ICF-foldable) prototype: db/protos.zhl */ float __cdecl random_float(void) { uint uVar1; uVar1 = Random(); return (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 ; } //@@ 0067f010 Isaac::Random /* ZHL [exact] static __fastcall int Isaac::Random(int Max); prototype: REPENTOGON, confirmed by RET 0 */ int __fastcall Isaac::Random(int Max) { uint uVar1; if (Max == 0) { return 0; } uVar1 = ::Random(); return uVar1 % (uint)Max; } //@@ 0067f030 FUN_0067f030 uint FUN_0067f030(void) { uint uVar1; uint in_ECX; uint in_EDX; uint uVar2; if (in_EDX < in_ECX) { return in_EDX; } uVar2 = (in_EDX - in_ECX) + 1; if (uVar2 == 0) { return in_ECX; } uVar1 = Random(); return uVar1 % uVar2 + in_ECX; } //@@ 0067f070 MusicManager::RandomVector /* ZHL [lua] Lua binding MusicManager:RandomVector prototype: db/protos.zhl, confirmed by RET 0 */ Vector * __cdecl MusicManager::RandomVector(Vector *outVec) { uint uVar1; float fVar2; float fVar3; uVar1 = ::Random(); fVar2 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar2 = fVar2 + fVar2; fVar3 = cos(fVar2); outVec->x = fVar3; fVar2 = sin(fVar2); outVec->y = fVar2; return outVec; } //@@ 0067f0d0 RandomVector /* DB: RNG xorshift(3,1,14) float*2pi -> cos,sin unit vector prototype: db/protos.zhl */ Vector * __fastcall RandomVector(Vector *out,uint seed) { code *pcVar1; Vector *pVVar2; uint uVar3; float fVar4; float fVar5; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pVVar2 = (Vector *)(*pcVar1)(); return pVVar2; } uVar3 = seed >> 3 ^ seed; uVar3 = uVar3 << 1 ^ uVar3; uVar3 = uVar3 >> 0xe ^ uVar3; fVar4 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283062e-10 * 3.14; fVar4 = fVar4 + fVar4; fVar5 = cos(fVar4); out->x = fVar5; fVar4 = sin(fVar4); out->y = fVar4; return out; } //@@ 0067f170 Vector::ToCardinal /* DB: snaps vector to dominant axis unit vector (+-1,0)/(0,+-1) prototype: db/protos.zhl */ Vector * __fastcall Vector::ToCardinal(Vector *outResult,Vector *vec) { float fVar1; float fVar2; fVar1 = vec->x; fVar2 = vec->y; if (ABS(fVar1) <= ABS(fVar2)) { outResult->x = 0.0; if (fVar2 < 0.0) { outResult->y = (float)&DAT_bf800000; return outResult; } outResult->y = 1.0; return outResult; } outResult->y = 0.0; if (fVar1 < 0.0) { outResult->x = (float)&DAT_bf800000; return outResult; } outResult->x = 1.0; return outResult; } //@@ 0067f1d0 Isaac::GetAxisAlignedUnitVectorFromDir /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] static __x86_64_output Vector Isaac::GetAxisAlignedUnitVectorFromDir(int eDir); prototype: db/protos.zhl, confirmed by RET 0 */ Vector * __fastcall Isaac::GetAxisAlignedUnitVectorFromDir(Vector *outVector,int direction) { float fVar1; fVar1 = g_vectorZero.y; if (3 < (uint)direction) { outVector->x = g_vectorZero.x; outVector->y = fVar1; return outVector; } if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80020) { _Init_thread_header(&DAT_00c80020); if (DAT_00c80020 == -1) { _DAT_00c80024 = &DAT_bf800000; _DAT_00c80028 = 0; uRam00c8002c = 0; puRam00c80030 = &DAT_bf800000; _DAT_00c80034 = 0x3f800000; uRam00c80038 = 0; uRam00c8003c = 0; uRam00c80040 = 0x3f800000; _Init_thread_footer(&DAT_00c80020); } } fVar1 = *(float *)(&DAT_00c80028 + direction * 8); outVector->x = *(float *)(&DAT_00c80024 + direction * 8); outVector->y = fVar1; return outVector; } //@@ 0067f260 vector_to_direction /* DB: returns LEFT 0/UP 1/RIGHT 2/DOWN 3 from dominant axis sign of a Vector prototype: db/protos.zhl */ int __fastcall vector_to_direction(Vector *vec) { int iVar1; if (ABS(vec->y) < ABS(vec->x)) { iVar1 = 2; if (vec->x < 0.0) { iVar1 = 0; } return iVar1; } return (uint)(0.0 <= vec->y) * 2 + 1; } //@@ 0067f2b0 Vector::mul_065 /* DB: out = in * 0.65 (world to sprite-space for texel tests and sprite offsets) (dogma_effects.md) */ void Vector::mul_065(void) { float *in_ECX; float *in_EDX; *in_ECX = *in_EDX * 0.65; in_ECX[1] = in_EDX[1] * 0.65; return; } //@@ 0067f2e0 FUN_0067f2e0 void FUN_0067f2e0(void) { float *in_ECX; float *in_EDX; *in_ECX = *in_EDX / 0.65; in_ECX[1] = in_EDX[1] / 0.65; return; } //@@ 0067f310 Isaac::GetRenderPosition /* ZHL [exact] static __x86_64_output Vector Isaac::GetRenderPosition(Vector* source, bool scale); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Vector * __cdecl Isaac::GetRenderPosition(Vector *outPosition,Vector *source,byte isScale) { float fVar1; float fVar2; float fVar3; double dVar4; fVar2 = g_screenHeight - 182.0; fVar1 = (g_screenWidth - 338.0) * 0.5 + (source->x - 60.0) * 0.65; fVar3 = source->y; outPosition->x = fVar1; fVar3 = fVar2 * 0.5 + (fVar3 - 140.0) * 0.65; outPosition->y = fVar3; if (isScale != 0) { fVar2 = g_displayPixelRatio * g_screenPointScale; dVar4 = floor((double)(fVar1 * fVar2 + 0.5)); outPosition->x = (float)dVar4 / fVar2; dVar4 = floor((double)(fVar3 * fVar2 + 0.5)); outPosition->y = (float)dVar4 / fVar2; } return outPosition; } //@@ 0067f420 string_split /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: builds stringstream over input, getline loop (FUN_006858b0) pushing std::string into vector param_1 (stride 0x18), returns it; used by xml loaders for tag/list attributes */ void * string_split(void *param_1) { byte bVar1; std_string *where; int *piVar2; undefined4 in_ECX; void *ptr; uint size; undefined4 in_stack_ffffff08; undefined4 in_stack_ffffff0c; int aiStack_e4 [9]; basic_iostream_> local_c0 [72]; basic_ios_> local_78 [72]; void *local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af7b18; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; FUN_00684ce0(in_ECX,in_stack_ffffff08,in_stack_ffffff0c); local_20 = 0; local_1c = 0xf; local_30[0] = (void *)0x0; local_8 = (void *)0x1; piVar2 = (int *)FUN_006858b0(); bVar1 = *(byte *)(*(int *)(*piVar2 + 4) + 0xc + (int)piVar2); while ((bVar1 & 6) == 0) { where = *(std_string **)((int)param_1 + 4); if (where == *(std_string **)((int)param_1 + 8)) { vector_string_emplace_reallocate(param_1,where,local_30); } else { std::string::string(where->_buf,local_30); *(int *)((int)param_1 + 4) = *(int *)((int)param_1 + 4) + 0x18; } piVar2 = (int *)FUN_006858b0(); bVar1 = *(byte *)(*(int *)(*piVar2 + 4) + 0xc + (int)piVar2); } if (0xf < local_1c) { size = local_1c + 1; ptr = local_30[0]; if (0xfff < size) { ptr = *(void **)((int)local_30[0] + -4); size = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined ***)((int)aiStack_e4 + *(int *)(aiStack_e4[1] + 4) + 4) = std::basic_stringstream,std::allocator_>::vftable; *(int *)((int)aiStack_e4 + *(int *)(aiStack_e4[1] + 4)) = *(int *)(aiStack_e4[1] + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>::~basic_iostream_> (local_c0); std::basic_ios_>::~basic_ios_>(local_78); ExceptionList = local_10; return param_1; } //@@ 0067f580 string_split /* DB: zeroes a std::vector (ECX result) then FUN_0067f420 reads tokens via an istringstream into it; ItemConfig::parse_tags calls it with ' ' (0x20); also Console::RunCommand, EntityConfig::parse_entity_tags */ void string_split(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af7b6e; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; local_8 = 0; string_split(); ExceptionList = local_10; return; } //@@ 0067f600 string_to_bool /* DB: ECX std::string: false when empty; true for "true"/"True" (DAT_00b64fe8/DAT_00b64ff0 = 0x65757274/0x65757254), else atoi() != 0; used for bool XML attributes in Backdrop::LoadConfig and challenges_xml_load */ undefined4 string_to_bool(void) { uint lengthA; uint uVar1; byte bVar2; int iVar3; byte *in_ECX; byte *pbVar4; lengthA = *(uint *)(in_ECX + 0x10); if (lengthA == 0) { return 0; } uVar1 = *(uint *)(in_ECX + 0x14); pbVar4 = in_ECX; if (0xf < uVar1) { pbVar4 = *(byte **)in_ECX; } bVar2 = str_eq(pbVar4,lengthA,&DAT_00b64fe8,4); if (bVar2 == 0) { pbVar4 = in_ECX; if (0xf < uVar1) { pbVar4 = *(byte **)in_ECX; } bVar2 = str_eq(pbVar4,lengthA,&DAT_00b64ff0,4); if (bVar2 == 0) { if (0xf < uVar1) { in_ECX = *(byte **)in_ECX; } iVar3 = atoi((char *)in_ECX); if (iVar3 == 0) { return 0; } } } return 1; } //@@ 0067f670 ResolveRelativePath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/anm2 decompile labels (ResolveRelativePath(out,anmPath,edx=rel)) */ void ResolveRelativePath(char *param_1) { char ****ppppcVar1; int *piVar2; std_string *psVar3; byte bVar4; uint uVar5; char *_Source; void *pvVar6; byte *in_ECX; byte *pbVar7; uint uVar8; int iVar9; void *pvVar10; byte *in_EDX; char ****ppppcVar11; int *piVar12; std_string *psVar13; byte *value; int local_160 [8]; basic_iostream_> local_140 [72]; basic_ios_> local_f8 [80]; char *local_a8; uint local_a4; int *local_a0; int *local_9c; int local_98; uint local_94; std_string *local_90; std_string *local_8c; std_string *local_88; void *local_84 [4]; undefined4 local_74; uint local_70; char ****local_6c [4]; int local_5c; uint local_58; void *local_54; char acStack_50 [4]; char acStack_4c [4]; char acStack_48 [4]; uint local_44; uint uStack_40; char ****local_3c [4]; int local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char ***local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (char ***)0xffffffff; puStack_18 = &LAB_00af7bd3; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; local_a8 = param_1; local_5c = 0; local_58 = 0xf; local_6c[0] = (char ****)0x0; pbVar7 = in_ECX; do { bVar4 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar4 != 0); local_24 = uVar5; std::string::assign((char *)local_6c,in_ECX,(int)pbVar7 - (int)(in_ECX + 1)); local_14 = (char ***)0x0; ppppcVar11 = (char ****)local_6c; if (0xf < local_58) { ppppcVar11 = local_6c[0]; } ppppcVar11 = (char ****)((int)ppppcVar11 + local_5c); ppppcVar1 = (char ****)local_6c; if (0xf < local_58) { ppppcVar1 = local_6c[0]; } for (; ppppcVar1 != ppppcVar11; ppppcVar1 = (char ****)((int)ppppcVar1 + 1)) { if (*(char *)ppppcVar1 == '\\') { *(char *)ppppcVar1 = '/'; } } string_split(0x2f,uVar5); psVar13 = local_8c; local_14._0_1_ = 1; uVar5 = local_8c[-1]._capacity; if (0xf < uVar5) { pvVar10 = *(void **)local_8c[-1]._buf; uVar8 = uVar5 + 1; pvVar6 = pvVar10; if (0xfff < uVar8) { pvVar6 = *(void **)((int)pvVar10 + -4); uVar8 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar6))) goto LAB_0067fdbc; } operator_delete(pvVar6,uVar8); } psVar13[-1]._size = 0; psVar13[-1]._capacity = 0xf; psVar13[-1]._buf[0] = '\0'; local_8c = local_8c + -1; local_2c = 0; local_28 = 0xf; local_3c[0] = (char ****)0x0; pbVar7 = in_EDX; do { bVar4 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar4 != 0); std::string::assign((char *)local_3c,in_EDX,(int)pbVar7 - (int)(in_EDX + 1)); local_14._0_1_ = 2; ppppcVar11 = (char ****)local_3c; if (0xf < local_28) { ppppcVar11 = local_3c[0]; } ppppcVar11 = (char ****)((int)ppppcVar11 + local_2c); ppppcVar1 = (char ****)local_3c; if (0xf < local_28) { ppppcVar1 = local_3c[0]; } for (; ppppcVar1 != ppppcVar11; ppppcVar1 = (char ****)((int)ppppcVar1 + 1)) { if (*(char *)ppppcVar1 == '\\') { *(char *)ppppcVar1 = '/'; } } string_split(0x2f); local_14._0_1_ = 3; std::string::string((char *)local_84,local_9c + -6); piVar12 = local_9c; local_14._0_1_ = 4; uVar5 = local_9c[-1]; if (0xf < uVar5) { pvVar10 = (void *)local_9c[-6]; uVar8 = uVar5 + 1; pvVar6 = pvVar10; if (0xfff < uVar8) { pvVar6 = *(void **)((int)pvVar10 + -4); uVar8 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar6))) goto LAB_0067fdbc; } operator_delete(pvVar6,uVar8); } piVar12[-2] = 0; piVar12[-1] = 0xf; *(undefined1 *)(piVar12 + -6) = 0; local_9c = local_9c + -6; iVar9 = (int)local_9c - (int)local_a0; local_a4 = 0; if (iVar9 / 0x18 + (iVar9 >> 0x1f) != iVar9 >> 0x1f) { local_94 = 0; do { psVar13 = local_8c; value = (byte *)((int)local_a0 + local_94); pbVar7 = value; if (0xf < *(uint *)(value + 0x14)) { pbVar7 = *(byte **)value; } bVar4 = str_eq(pbVar7,*(uint *)(value + 0x10),&DAT_00b1ceb8,2); if (bVar4 == 0) { if (psVar13 == local_88) { vector_string_emplace_reallocate(&local_90,psVar13,value); } else { std::string::string(psVar13->_buf,value); local_8c = local_8c + 1; } } else { iVar9 = (int)psVar13 - (int)local_90 >> 0x1f; if (((int)psVar13 - (int)local_90) / 0x18 + iVar9 == iVar9) { uStack_40 = 0xf; local_44 = 2; local_54 = (void *)0x2e2e; local_14._0_1_ = 5; if (psVar13 == local_88) { vector_string_emplace_reallocate_move(&local_90,psVar13,(std_string *)&local_54); } else { psVar13->_buf[0] = '\0'; psVar13->_buf[1] = '\0'; psVar13->_buf[2] = '\0'; psVar13->_buf[3] = '\0'; local_54 = (void *)0x2e00; psVar13->_buf[0] = '.'; psVar13->_buf[1] = '.'; psVar13->_buf[2] = '\0'; psVar13->_buf[3] = '\0'; *(char (*) [4])(psVar13->_buf + 4) = acStack_50; *(char (*) [4])(psVar13->_buf + 8) = acStack_4c; *(char (*) [4])(psVar13->_buf + 0xc) = acStack_48; psVar13->_size = 2; psVar13->_capacity = 0xf; local_8c = local_8c + 1; } local_14._0_1_ = 4; if (0xf < uStack_40) { uVar5 = uStack_40 + 1; pvVar10 = local_54; if (0xfff < uVar5) { pvVar10 = *(void **)((int)local_54 + -4); uVar5 = uStack_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar10))) goto LAB_0067fdbc; } operator_delete(pvVar10,uVar5); } } else { uVar5 = psVar13[-1]._capacity; if (0xf < uVar5) { pvVar10 = *(void **)psVar13[-1]._buf; uVar8 = uVar5 + 1; pvVar6 = pvVar10; if (0xfff < uVar8) { pvVar6 = *(void **)((int)pvVar10 + -4); uVar8 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar6))) goto LAB_0067fdbc; } operator_delete(pvVar6,uVar8); } psVar13[-1]._size = 0; psVar13[-1]._capacity = 0xf; psVar13[-1]._buf[0] = '\0'; local_8c = local_8c + -1; } } iVar9 = (int)local_9c - (int)local_a0; local_a4 = local_a4 + 1; local_94 = local_94 + 0x18; } while (local_a4 < (uint)(iVar9 / 0x18)); } std_stringstream_constructor(iVar9); local_14._0_1_ = 6; local_94 = 0; iVar9 = (int)local_8c - (int)local_90 >> 0x1f; if (((int)local_8c - (int)local_90) / 0x18 + iVar9 != iVar9) { iVar9 = 0; do { FUN_00685a20(*(undefined4 *)(local_90->_buf + iVar9 + 0x10)); std::operator<<_char(); iVar9 = iVar9 + 0x18; local_94 = local_94 + 1; } while (local_94 < (uint)(((int)local_8c - (int)local_90) / 0x18)); } FUN_00685a20(local_74); _Source = (char *)FUN_00414250((std_string *)&local_54); if (0xf < *(uint *)(_Source + 0x14)) { _Source = *(char **)_Source; } strncpy(local_a8,_Source,0x104); if (0xf < uStack_40) { uVar5 = uStack_40 + 1; pvVar10 = local_54; if (0xfff < uVar5) { pvVar10 = *(void **)((int)local_54 + -4); uVar5 = uStack_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar5); } *(undefined ***)((int)local_160 + *(int *)(local_160[0] + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)((int)local_160 + *(int *)(local_160[0] + 4) + -4) = *(int *)(local_160[0] + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>::~basic_iostream_> (local_140); std::basic_ios_>::~basic_ios_>(local_f8); if (0xf < local_70) { uVar5 = local_70 + 1; pvVar10 = local_84[0]; if (0xfff < uVar5) { pvVar10 = *(void **)((int)local_84[0] + -4); uVar5 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar10))) goto LAB_0067fdbc; } operator_delete(pvVar10,uVar5); } piVar2 = local_9c; local_74 = 0; local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); piVar12 = local_a0; if (local_a0 != (int *)0x0) { for (; piVar12 != piVar2; piVar12 = piVar12 + 6) { uVar5 = piVar12[5]; if (0xf < uVar5) { pvVar10 = (void *)*piVar12; uVar8 = uVar5 + 1; pvVar6 = pvVar10; if (0xfff < uVar8) { pvVar6 = *(void **)((int)pvVar10 + -4); uVar8 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar6))) goto LAB_0067fdbc; } operator_delete(pvVar6,uVar8); } piVar12[4] = 0; piVar12[5] = 0xf; *(undefined1 *)piVar12 = 0; } uVar5 = ((local_98 - (int)local_a0) / 0x18) * 0x18; piVar12 = local_a0; if (0xfff < uVar5) { piVar12 = (int *)local_a0[-1]; uVar5 = uVar5 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_a0 + (-4 - (int)piVar12))) goto LAB_0067fdbc; } operator_delete(piVar12,uVar5); local_a0 = (int *)0x0; local_9c = (int *)0x0; local_98 = 0; } if (0xf < local_28) { uVar5 = local_28 + 1; ppppcVar11 = local_3c[0]; if (0xfff < uVar5) { ppppcVar11 = (char ****)local_3c[0][-1]; uVar5 = local_28 + 0x24; if ((char *)0x1f < (char *)((int)local_3c[0] + (-4 - (int)ppppcVar11))) goto LAB_0067fdbc; } operator_delete(ppppcVar11,uVar5); } psVar3 = local_8c; local_2c = 0; local_28 = 0xf; local_3c[0] = (char ****)((uint)local_3c[0] & 0xffffff00); psVar13 = local_90; if (local_90 != (std_string *)0x0) { for (; psVar13 != psVar3; psVar13 = psVar13 + 1) { uVar5 = psVar13->_capacity; if (0xf < uVar5) { pvVar10 = *(void **)psVar13->_buf; uVar8 = uVar5 + 1; pvVar6 = pvVar10; if (0xfff < uVar8) { pvVar6 = *(void **)((int)pvVar10 + -4); uVar8 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar6))) goto LAB_0067fdbc; } operator_delete(pvVar6,uVar8); } psVar13->_size = 0; psVar13->_capacity = 0xf; psVar13->_buf[0] = '\0'; } uVar5 = (((int)local_88 - (int)local_90) / 0x18) * 0x18; psVar13 = local_90; if (0xfff < uVar5) { psVar13 = (std_string *)local_90[-1]._capacity; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_90 + (-4 - (int)psVar13))) goto LAB_0067fdbc; } operator_delete(psVar13,uVar5); local_90 = (std_string *)0x0; local_8c = (std_string *)0x0; local_88 = (std_string *)0x0; } if (0xf < local_58) { uVar5 = local_58 + 1; ppppcVar11 = local_6c[0]; if (0xfff < uVar5) { ppppcVar11 = (char ****)local_6c[0][-1]; uVar5 = local_58 + 0x24; if ((char *)0x1f < (char *)((int)local_6c[0] + (-4 - (int)ppppcVar11))) { LAB_0067fdbc: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppcVar11,uVar5); } ExceptionList = local_1c; return; } //@@ 0067fdf0 ExtractAngleBracketText /* DB: game's own name in its log "ExtractAngleBracketText() Couldn't find opening bracket in string: %s": copies the text between < and > of EDX string into ECX string (handles \> escapes); from rich_text_parse_icon_tag */ void ExtractAngleBracketText(void) { uint uVar1; undefined1 *puVar2; undefined1 uVar3; uint uVar4; size_t _Size; void *_Src; bool bVar5; undefined4 *puVar6; uint uVar7; undefined4 *puVar8; void *_Dst; undefined4 *in_ECX; undefined4 *puVar9; undefined4 *in_EDX; uint uVar10; void *ptr; undefined4 *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af7c1e; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0xf; *(undefined1 *)in_ECX = 0; local_8 = 0; bVar5 = false; local_18 = (undefined4 *)0x0; if (in_EDX[4] != 0) { do { puVar6 = local_18; uVar4 = in_EDX[5]; if (bVar5) { puVar9 = in_EDX; if (0xf < uVar4) { puVar9 = (undefined4 *)*in_EDX; } if (*(char *)((int)puVar9 + (int)local_18) == '>') { puVar9 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar9 = (undefined4 *)*in_ECX; } if (*(char *)(in_ECX[4] + -1 + (int)puVar9) != '\\') { ExceptionList = local_10; return; } puVar9 = in_EDX; if (0xf < uVar4) { puVar9 = (undefined4 *)*in_EDX; } puVar8 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar8 = (undefined4 *)*in_ECX; } *(undefined1 *)(in_ECX[4] + -1 + (int)puVar8) = *(undefined1 *)((int)puVar9 + (int)local_18); } else { puVar9 = in_EDX; if (0xf < uVar4) { puVar9 = (undefined4 *)*in_EDX; } uVar3 = *(undefined1 *)((int)puVar9 + (int)local_18); uVar4 = in_ECX[5]; _Size = in_ECX[4]; if (uVar4 == _Size) { if (_Size == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar7); } uVar10 = _Size + 1 | 0xf; if (uVar10 < 0x80000000) { if (0x7fffffff - (uVar4 >> 1) < uVar4) { uVar10 = 0x7fffffff; } else { uVar1 = (uVar4 >> 1) + uVar4; if (uVar10 < uVar1) { uVar10 = uVar1; } } } else { uVar10 = 0x7fffffff; } _Dst = std::_Allocate(uVar10 + 1); in_ECX[4] = _Size + 1; in_ECX[5] = uVar10; puVar2 = (undefined1 *)((int)_Dst + _Size); if (uVar4 < 0x10) { memcpy(_Dst,in_ECX,_Size); *puVar2 = uVar3; puVar2[1] = 0; } else { _Src = (void *)*in_ECX; memcpy(_Dst,_Src,_Size); *puVar2 = uVar3; uVar10 = uVar4 + 1; puVar2[1] = 0; ptr = _Src; if (0xfff < uVar10) { ptr = *(void **)((int)_Src + -4); uVar10 = uVar4 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar10); } *in_ECX = _Dst; } else { in_ECX[4] = _Size + 1; local_18 = in_ECX; if (0xf < uVar4) { local_18 = (undefined4 *)*in_ECX; } *(undefined1 *)((int)local_18 + _Size) = uVar3; *(undefined1 *)((int)local_18 + _Size + 1) = 0; } } } else { puVar9 = in_EDX; if (0xf < uVar4) { puVar9 = (undefined4 *)*in_EDX; } if (*(char *)((int)puVar9 + (int)local_18) == '<') { bVar5 = true; } } local_18 = (undefined4 *)((int)puVar6 + 1); } while (local_18 < (uint)in_EDX[4]); if (bVar5) { ExceptionList = local_10; return; } } KAGE_LogMessage(4,(byte *) "ExtractAngleBracketText() Couldn\'t find opening bracket in string: %s \n"); ExceptionList = local_10; return; } //@@ 00680060 FUN_00680060 void FUN_00680060(size_t param_1) { char *in_ECX; char *in_EDX; _strnicmp(in_ECX,in_EDX,param_1); return; } //@@ 00680080 FUN_00680080 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00680080(void) { undefined8 uVar1; undefined4 *puVar2; int *piVar3; undefined4 ****ppppuVar4; undefined4 *puVar5; char *pcVar6; byte *pbVar7; byte *pbVar8; undefined4 ****ppppuVar9; void *pvVar10; uint uVar11; char acStack_194 [24]; char acStack_17c [24]; char acStack_164 [24]; char acStack_14c [24]; char acStack_134 [24]; char acStack_11c [24]; char acStack_104 [24]; char acStack_ec [24]; char acStack_d4 [24]; char acStack_bc [24]; undefined4 ****ppppuStack_a4; int iStack_a0; int iStack_9c; int iStack_98; undefined8 uStack_94; void *pvStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined8 uStack_7c; char *apcStack_74 [4]; undefined4 uStack_64; uint uStack_60; undefined4 ****ppppuStack_5c; int iStack_58; int iStack_54; int iStack_50; undefined8 uStack_4c; char *apcStack_44 [4]; undefined4 uStack_34; uint uStack_30; void *pvStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined8 uStack_1c; uint local_14; void *local_10; undefined1 *puStack_c; char *pcStack_8; pcStack_8 = (char *)0xffffffff; puStack_c = &LAB_00af8098; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(apcStack_44 + 0x10); ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"***************************************\n"); KAGE_LogMessage(1,(byte *)"* Shader Initialization Start *\n"); KAGE_LogMessage(1,(byte *)"***************************************\n"); KAGE_LogMessage(1,(byte *)"Initialize ColorOffset Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; apcStack_44[0] = std::_Allocate(0x20); uStack_34 = 0x12; uStack_30 = 0x1f; builtin_strncpy(apcStack_44[0],"resources/shaders/",0x13); pcStack_8 = (char *)0x0; puVar2 = std::string::append((char *)apcStack_44,(byte *)"coloroffset",0xb); pvStack_2c = (void *)*puVar2; uStack_28 = puVar2[1]; uStack_24 = puVar2[2]; uStack_20 = puVar2[3]; uStack_1c = *(undefined8 *)(puVar2 + 4); puVar2[4] = 0; puVar2[5] = 0xf; *(undefined1 *)puVar2 = 0; pcStack_8._0_1_ = 1; piVar3 = std::string::append((char *)&pvStack_2c,&UNK_00b65240,3); ppppuStack_5c = (undefined4 ****)*piVar3; iStack_58 = piVar3[1]; iStack_54 = piVar3[2]; iStack_50 = piVar3[3]; uVar1 = *(undefined8 *)(piVar3 + 4); piVar3[4] = 0; piVar3[5] = 0xf; *(undefined1 *)piVar3 = 0; pcStack_8._0_1_ = 2; uStack_4c._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); ppppuVar9 = &ppppuStack_5c; if (0xf < uStack_4c._4_4_) { ppppuVar9 = ppppuStack_5c; } uStack_64 = 0; uStack_60 = 0xf; apcStack_74[0] = (char *)0x0; uStack_4c = uVar1; apcStack_74[0] = std::_Allocate(0x20); uStack_64 = 0x12; uStack_60 = 0x1f; builtin_strncpy(apcStack_74[0],"resources/shaders/",0x13); pcStack_8._0_1_ = 3; puVar2 = std::string::append((char *)apcStack_74,(byte *)"basic_colored_textured",0x16); pvStack_8c = (void *)*puVar2; uStack_88 = puVar2[1]; uStack_84 = puVar2[2]; uStack_80 = puVar2[3]; uStack_7c = *(undefined8 *)(puVar2 + 4); puVar2[4] = 0; puVar2[5] = 0xf; *(undefined1 *)puVar2 = 0; pcStack_8._0_1_ = 4; piVar3 = std::string::append((char *)&pvStack_8c,&UNK_00b651ac,3); ppppuStack_a4 = (undefined4 ****)*piVar3; iStack_a0 = piVar3[1]; iStack_9c = piVar3[2]; iStack_98 = piVar3[3]; uVar1 = *(undefined8 *)(piVar3 + 4); piVar3[4] = 0; piVar3[5] = 0xf; *(undefined1 *)piVar3 = 0; pcStack_8._0_1_ = 5; uStack_94._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); ppppuVar4 = &ppppuStack_a4; if (0xf < uStack_94._4_4_) { ppppuVar4 = ppppuStack_a4; } uStack_94 = uVar1; FUN_00a147e0("ColorOffset",&PTR_s_Position_00c0f8f0,ppppuVar4,ppppuVar9); pcStack_8._0_1_ = 4; if (0xf < uStack_94._4_4_) { uVar11 = uStack_94._4_4_ + 1; ppppuVar9 = ppppuStack_a4; if (0xfff < uVar11) { ppppuVar9 = (undefined4 ****)ppppuStack_a4[-1]; uVar11 = uStack_94._4_4_ + 0x24; if (0x1f < (uint)((int)ppppuStack_a4 + (-4 - (int)ppppuVar9))) goto LAB_006804ab; } operator_delete(ppppuVar9,uVar11); } pcStack_8._0_1_ = 3; uStack_94 = 0xf00000000; ppppuStack_a4 = (undefined4 ****)((uint)ppppuStack_a4 & 0xffffff00); if (0xf < uStack_7c._4_4_) { uVar11 = uStack_7c._4_4_ + 1; pvVar10 = pvStack_8c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_8c + -4); uVar11 = uStack_7c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_8c + (-4 - (int)pvVar10))) goto LAB_006804ab; } operator_delete(pvVar10,uVar11); } pcStack_8._0_1_ = 2; uStack_7c = 0xf00000000; pvStack_8c = (void *)((uint)pvStack_8c & 0xffffff00); if (0xf < uStack_60) { uVar11 = uStack_60 + 1; pcVar6 = apcStack_74[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_74[0] + -4); uVar11 = uStack_60 + 0x24; if ((char *)0x1f < apcStack_74[0] + (-4 - (int)pcVar6)) goto LAB_006804ab; } operator_delete(pcVar6,uVar11); } pcStack_8._0_1_ = 1; uStack_64 = 0; uStack_60 = 0xf; apcStack_74[0] = (char *)((uint)apcStack_74[0] & 0xffffff00); if (0xf < uStack_4c._4_4_) { uVar11 = uStack_4c._4_4_ + 1; ppppuVar9 = ppppuStack_5c; if (0xfff < uVar11) { ppppuVar9 = (undefined4 ****)ppppuStack_5c[-1]; uVar11 = uStack_4c._4_4_ + 0x24; if (0x1f < (uint)((int)ppppuStack_5c + (-4 - (int)ppppuVar9))) goto LAB_006804ab; } operator_delete(ppppuVar9,uVar11); } pcStack_8._0_1_ = 0; uStack_4c = 0xf00000000; ppppuStack_5c = (undefined4 ****)((uint)ppppuStack_5c & 0xffffff00); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_006804ab; } operator_delete(pvVar10,uVar11); } pcStack_8._0_1_ = 0xff; pcStack_8._1_3_ = 0xffffff; uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_006804ab: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize ColorOffset Attribute Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; apcStack_44[0] = std::_Allocate(0x20); uStack_34 = 0x12; uStack_30 = 0x1f; builtin_strncpy(apcStack_44[0],"resources/shaders/",0x13); pcStack_8 = (char *)0x6; puVar2 = std::string::append((char *)apcStack_44,(byte *)"coloroffset_attr",0x10); pvStack_8c = (void *)*puVar2; uStack_88 = puVar2[1]; uStack_84 = puVar2[2]; uStack_80 = puVar2[3]; uStack_7c = *(undefined8 *)(puVar2 + 4); puVar2[4] = 0; puVar2[5] = 0xf; *(undefined1 *)puVar2 = 0; pcStack_8._0_1_ = 7; piVar3 = std::string::append((char *)&pvStack_8c,&UNK_00b65240,3); ppppuStack_a4 = (undefined4 ****)*piVar3; iStack_a0 = piVar3[1]; iStack_9c = piVar3[2]; iStack_98 = piVar3[3]; uVar1 = *(undefined8 *)(piVar3 + 4); piVar3[4] = 0; piVar3[5] = 0xf; *(undefined1 *)piVar3 = 0; pcStack_8._0_1_ = 8; uStack_94._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); ppppuVar9 = &ppppuStack_a4; if (0xf < uStack_94._4_4_) { ppppuVar9 = ppppuStack_a4; } uStack_64 = 0; uStack_60 = 0xf; apcStack_74[0] = (char *)0x0; uStack_94 = uVar1; apcStack_74[0] = std::_Allocate(0x20); uStack_64 = 0x12; uStack_60 = 0x1f; builtin_strncpy(apcStack_74[0],"resources/shaders/",0x13); pcStack_8._0_1_ = 9; puVar2 = std::string::append((char *)apcStack_74,(byte *)"coloroffset_attr",0x10); pvStack_2c = (void *)*puVar2; uStack_28 = puVar2[1]; uStack_24 = puVar2[2]; uStack_20 = puVar2[3]; uStack_1c = *(undefined8 *)(puVar2 + 4); puVar2[4] = 0; puVar2[5] = 0xf; *(undefined1 *)puVar2 = 0; pcStack_8._0_1_ = 10; piVar3 = std::string::append((char *)&pvStack_2c,&UNK_00b651ac,3); ppppuStack_5c = (undefined4 ****)*piVar3; iStack_58 = piVar3[1]; iStack_54 = piVar3[2]; iStack_50 = piVar3[3]; uVar1 = *(undefined8 *)(piVar3 + 4); piVar3[4] = 0; piVar3[5] = 0xf; *(undefined1 *)piVar3 = 0; pcStack_8._0_1_ = 0xb; uStack_4c._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); ppppuVar4 = &ppppuStack_5c; if (0xf < uStack_4c._4_4_) { ppppuVar4 = ppppuStack_5c; } uStack_4c = uVar1; FUN_00a147e0("ColorOffsetAttr",&PTR_s_Position_00bf93ec,ppppuVar4,ppppuVar9); pcStack_8._0_1_ = 10; if (0xf < uStack_4c._4_4_) { uVar11 = uStack_4c._4_4_ + 1; ppppuVar9 = ppppuStack_5c; if (0xfff < uVar11) { ppppuVar9 = (undefined4 ****)ppppuStack_5c[-1]; uVar11 = uStack_4c._4_4_ + 0x24; if (0x1f < (uint)((int)ppppuStack_5c + (-4 - (int)ppppuVar9))) goto LAB_00680896; } operator_delete(ppppuVar9,uVar11); } pcStack_8._0_1_ = 9; uStack_4c = 0xf00000000; ppppuStack_5c = (undefined4 ****)((uint)ppppuStack_5c & 0xffffff00); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00680896; } operator_delete(pvVar10,uVar11); } pcStack_8._0_1_ = 8; uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); if (0xf < uStack_60) { uVar11 = uStack_60 + 1; pcVar6 = apcStack_74[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_74[0] + -4); uVar11 = uStack_60 + 0x24; if ((char *)0x1f < apcStack_74[0] + (-4 - (int)pcVar6)) goto LAB_00680896; } operator_delete(pcVar6,uVar11); } pcStack_8._0_1_ = 7; uStack_64 = 0; uStack_60 = 0xf; apcStack_74[0] = (char *)((uint)apcStack_74[0] & 0xffffff00); if (0xf < uStack_94._4_4_) { uVar11 = uStack_94._4_4_ + 1; ppppuVar9 = ppppuStack_a4; if (0xfff < uVar11) { ppppuVar9 = (undefined4 ****)ppppuStack_a4[-1]; uVar11 = uStack_94._4_4_ + 0x24; if (0x1f < (uint)((int)ppppuStack_a4 + (-4 - (int)ppppuVar9))) goto LAB_00680896; } operator_delete(ppppuVar9,uVar11); } pcStack_8._0_1_ = 6; uStack_94 = 0xf00000000; ppppuStack_a4 = (undefined4 ****)((uint)ppppuStack_a4 & 0xffffff00); if (0xf < uStack_7c._4_4_) { uVar11 = uStack_7c._4_4_ + 1; pvVar10 = pvStack_8c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_8c + -4); uVar11 = uStack_7c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_8c + (-4 - (int)pvVar10))) goto LAB_00680896; } operator_delete(pvVar10,uVar11); } pcStack_8._0_1_ = 0xff; pcStack_8._1_3_ = 0xffffff; uStack_7c = 0xf00000000; pvStack_8c = (void *)((uint)pvStack_8c & 0xffffff00); if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00680896: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Color Offset Dogma Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0xc; FUN_0060c790("coloroffset_dogma"); pcStack_8._0_1_ = 0xd; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0xe; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0xf; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x10; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x11; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("ColorOffsetDogma",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0xe); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00680a2d; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00680a2d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Color Offset Gold Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x12; FUN_0060c790("coloroffset_gold"); pcStack_8._0_1_ = 0x13; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x14; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x15; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x16; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x17; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("ColorOffsetGold",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x14); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00680bc4; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00680bc4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Color Offset Champion Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x18; FUN_0060c790("coloroffset_champion"); pcStack_8._0_1_ = 0x19; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x1a; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x1b; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x1c; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x1d; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("ColorOffsetChampion",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x1a); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00680d5b; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00680d5b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Pixelation Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x1e; FUN_0060c790("pixelation"); pcStack_8._0_1_ = 0x1f; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x20; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x21; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x22; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x23; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("Pixelation",&PTR_s_Position_00c0f8d8,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x20); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00680ef2; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00680ef2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Bloom Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x24; FUN_0060c790("bloom"); pcStack_8._0_1_ = 0x25; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x26; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x27; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x28; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x29; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("Bloom",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x26); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00681089; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00681089: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Colormod Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x2a; FUN_0060c790("colormod"); pcStack_8._0_1_ = 0x2b; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x2c; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x2d; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x2e; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x2f; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("ColorMod",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x2c); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00681220; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00681220: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Color Correction Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x30; FUN_0060c790("colorcorrection"); pcStack_8._0_1_ = 0x31; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x32; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x33; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x34; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x35; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("ColorCorrection",&PTR_s_Position_00c0f8d8,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x32); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_006813b7; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_006813b7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize HQ4X Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x36; FUN_0060c790(&UNK_00b65454); pcStack_8._0_1_ = 0x37; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x38; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x39; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x3a; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x3b; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0(&DAT_00b650bc,&PTR_s_Position_00c0f8d8,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x38); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_0068154e; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_0068154e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize OldTV Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x3c; FUN_0060c790(&UNK_00b65478); pcStack_8._0_1_ = 0x3d; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x3e; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x3f; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x40; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x41; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("OldTV",&PTR_s_Position_00c0f8d8,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x3e); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_006816e5; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_006816e5: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Shockwave Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x42; FUN_0060c790("shockwave"); pcStack_8._0_1_ = 0x43; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x44; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x45; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x46; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x47; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("Shockwave",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x44); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Hallucination Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x48; FUN_0060c790("hallucination"); pcStack_8._0_1_ = 0x49; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x4a; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x4b; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x4c; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x4d; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("Hallucination",&PTR_s_Position_00c0f8d8,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x4a); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00681a19; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00681a19: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Background Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x4e; FUN_0060c790(&UNK_00b654f0); pcStack_8._0_1_ = 0x4f; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x50; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x51; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x52; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x53; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("Background",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x50); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) goto LAB_00681bb0; } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; if (0xf < uStack_30) { uVar11 = uStack_30 + 1; pcVar6 = apcStack_44[0]; if (0xfff < uVar11) { pcVar6 = *(char **)(apcStack_44[0] + -4); uVar11 = uStack_30 + 0x24; if ((char *)0x1f < apcStack_44[0] + (-4 - (int)pcVar6)) { LAB_00681bb0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar11); } KAGE_LogMessage(1,(byte *)"Initialize Water Overlay Shader\n"); uStack_34 = 0; uStack_30 = 0xf; apcStack_44[0] = (char *)0x0; std::string::assign((char *)apcStack_44,(byte *)"resources/shaders/",0x12); pcStack_8 = (char *)0x54; FUN_0060c790("water_overlay"); pcStack_8._0_1_ = 0x55; puVar2 = (undefined4 *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x56; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } uStack_1c = 0xf00000000; pvStack_2c = (void *)0x0; std::string::assign((char *)&pvStack_2c,(byte *)"resources/shaders/",0x12); pcStack_8._0_1_ = 0x57; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x58; puVar5 = (undefined4 *)FUN_0060c790(&UNK_00b651ac); pcStack_8._0_1_ = 0x59; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } FUN_00a147e0("WaterOverlay",&PTR_s_Position_00c0f8f0,puVar5,puVar2); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x56); if (0xf < uStack_1c._4_4_) { uVar11 = uStack_1c._4_4_ + 1; pvVar10 = pvStack_2c; if (0xfff < uVar11) { pvVar10 = *(void **)((int)pvStack_2c + -4); uVar11 = uStack_1c._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar11); } uStack_1c = 0xf00000000; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); std::string::_Tidy_deallocate((char *)apcStack_74); std::string::_Tidy_deallocate((char *)&ppppuStack_a4); pcStack_8 = (char *)0xffffffff; std::string::_Tidy_deallocate((char *)apcStack_44); KAGE_LogMessage(1,(byte *)"Initialize Dizzy Shader\n"); std::string::string_from_cstr(acStack_bc,(byte *)"resources/shaders/"); pcStack_8 = (char *)0x5a; FUN_0060c790(&UNK_00b6549c); pcStack_8._0_1_ = 0x5b; pcVar6 = (char *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x5c; pbVar7 = std::string::c_str(pcVar6); std::string::string_from_cstr((char *)&pvStack_8c,(byte *)"resources/shaders/"); pcStack_8._0_1_ = 0x5d; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x5e; pcVar6 = (char *)FUN_0060c790(&UNK_00b651ac); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x5f); pbVar8 = std::string::c_str(pcVar6); FUN_00a147e0("Dizzy",&PTR_s_Position_00c0f8d8,pbVar8,pbVar7); std::string::_Tidy_deallocate((char *)apcStack_44); std::string::_Tidy_deallocate((char *)&pvStack_2c); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); std::string::_Tidy_deallocate((char *)apcStack_74); pcStack_8 = (char *)0xffffffff; std::string::_Tidy_deallocate(acStack_bc); KAGE_LogMessage(1,(byte *)"Initialize Heat Wave Shader\n"); std::string::string_from_cstr(acStack_d4,(byte *)"resources/shaders/"); pcStack_8 = (char *)0x60; FUN_0060c790("heat_wave"); pcStack_8._0_1_ = 0x61; pcVar6 = (char *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x62; pbVar7 = std::string::c_str(pcVar6); std::string::string_from_cstr((char *)&pvStack_2c,(byte *)"resources/shaders/"); pcStack_8._0_1_ = 99; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 100; pcVar6 = (char *)FUN_0060c790(&UNK_00b651ac); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x65); pbVar8 = std::string::c_str(pcVar6); FUN_00a147e0("HeatWave",&PTR_s_Position_00c0f8f0,pbVar8,pbVar7); std::string::_Tidy_deallocate(acStack_bc); std::string::_Tidy_deallocate((char *)apcStack_44); std::string::_Tidy_deallocate((char *)&pvStack_2c); std::string::_Tidy_deallocate((char *)&pvStack_8c); std::string::_Tidy_deallocate((char *)&ppppuStack_5c); pcStack_8 = (char *)0xffffffff; std::string::_Tidy_deallocate(acStack_d4); KAGE_LogMessage(1,(byte *)"Initialize Mirror Shader\n"); std::string::string_from_cstr(acStack_ec,(byte *)"resources/shaders/"); pcStack_8 = (char *)0x66; FUN_0060c790("mirror"); pcStack_8._0_1_ = 0x67; pcVar6 = (char *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x68; pbVar7 = std::string::c_str(pcVar6); std::string::string_from_cstr((char *)apcStack_44,(byte *)"resources/shaders/"); pcStack_8._0_1_ = 0x69; FUN_0060c790("basic_textured"); pcStack_8._0_1_ = 0x6a; pcVar6 = (char *)FUN_0060c790(&UNK_00b651ac); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x6b); pbVar8 = std::string::c_str(pcVar6); FUN_00a147e0("Mirror",&PTR_s_Position_00c0f8d8,pbVar8,pbVar7); std::string::_Tidy_deallocate(acStack_d4); std::string::_Tidy_deallocate(acStack_bc); std::string::_Tidy_deallocate((char *)apcStack_44); std::string::_Tidy_deallocate((char *)&pvStack_2c); std::string::_Tidy_deallocate((char *)&pvStack_8c); pcStack_8 = (char *)0xffffffff; std::string::_Tidy_deallocate(acStack_ec); KAGE_LogMessage(1,(byte *)"Initialize Water Surface Shader\n"); std::string::string_from_cstr(acStack_104,(byte *)"resources/shaders/"); pcStack_8 = (char *)0x6c; FUN_0060c790("water"); pcStack_8._0_1_ = 0x6d; pcVar6 = (char *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x6e; pbVar7 = std::string::c_str(pcVar6); std::string::string_from_cstr(acStack_bc,(byte *)"resources/shaders/"); pcStack_8._0_1_ = 0x6f; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x70; pcVar6 = (char *)FUN_0060c790(&UNK_00b651ac); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x71); pbVar8 = std::string::c_str(pcVar6); FUN_00a147e0("WaterSurface",&PTR_s_Position_00c0f8f0,pbVar8,pbVar7); std::string::_Tidy_deallocate(acStack_ec); std::string::_Tidy_deallocate(acStack_d4); std::string::_Tidy_deallocate(acStack_bc); std::string::_Tidy_deallocate((char *)apcStack_44); std::string::_Tidy_deallocate((char *)&pvStack_2c); pcStack_8 = (char *)0xffffffff; std::string::_Tidy_deallocate(acStack_104); KAGE_LogMessage(1,(byte *)"Initialize Water Surface V2 Shader\n"); std::string::string_from_cstr(acStack_194,(byte *)"resources/shaders/"); pcStack_8 = (char *)0x72; FUN_0060c790("water_v2"); pcStack_8._0_1_ = 0x73; pcVar6 = (char *)FUN_0060c790(&UNK_00b65240); pcStack_8._0_1_ = 0x74; pbVar7 = std::string::c_str(pcVar6); std::string::string_from_cstr(acStack_14c,(byte *)"resources/shaders/"); pcStack_8._0_1_ = 0x75; FUN_0060c790("basic_colored_textured"); pcStack_8._0_1_ = 0x76; pcVar6 = (char *)FUN_0060c790(&UNK_00b651ac); pcStack_8 = (char *)CONCAT31(pcStack_8._1_3_,0x77); pbVar8 = std::string::c_str(pcVar6); FUN_00a147e0("WaterSurfaceV2",&PTR_s_Position_00c0f8f0,pbVar8,pbVar7); std::string::_Tidy_deallocate(acStack_11c); std::string::_Tidy_deallocate(acStack_134); std::string::_Tidy_deallocate(acStack_14c); std::string::_Tidy_deallocate(acStack_164); std::string::_Tidy_deallocate(acStack_17c); pcStack_8 = (char *)0xffffffff; std::string::_Tidy_deallocate(acStack_194); KAGE_LogMessage(1,(byte *)"***************************************\n"); KAGE_LogMessage(1,(byte *)"* Shader Initialization End *\n"); KAGE_LogMessage(1,(byte *)"***************************************\n"); ExceptionList = local_10; return; } //@@ 00682260 FUN_00682260 void FUN_00682260(void) { int in_ECX; if ((&g_shaders + in_ECX * 0x50 != (undefined *)0x0) && (((&DAT_00c7911c)[in_ECX * 0x50] & 1) != 0)) { g_currentShader = &g_shaders + in_ECX * 0x50; } return; } //@@ 00682280 shader_stack_push /* DB: ECX = shader index: pushes &g_shaders[idx] (stride 0x50) onto the global shader deque (_Growmap) and makes it g_currentShader when its enabled bit is set; Room::Render, HUD::render_boss_health_bar */ void shader_stack_push(void) { undefined *puVar1; int iVar2; void *pvVar3; int in_ECX; uint uVar4; puVar1 = &g_shaders + in_ECX * 0x50; if (((DAT_00c7976c + DAT_00c79770 & 3) == 0) && (DAT_00c79768 <= DAT_00c79770 + 4U >> 2)) { std::deque<4byte>::_Growmap(DAT_00c79768); } DAT_00c7976c = DAT_00c7976c & DAT_00c79768 * 4 - 1; uVar4 = DAT_00c7976c + DAT_00c79770; iVar2 = (DAT_00c79768 - 1 & uVar4 >> 2) * 4; if (*(int *)(iVar2 + DAT_00c79764) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar2 + DAT_00c79764) = pvVar3; } *(undefined **)(*(int *)(iVar2 + DAT_00c79764) + (uVar4 & 3) * 4) = puVar1; DAT_00c79770 = DAT_00c79770 + 1; if ((puVar1 != (undefined *)0x0) && (((&DAT_00c7911c)[in_ECX * 0x50] & 1) != 0)) { g_currentShader = puVar1; } return; } //@@ 00682350 FUN_00682350 void FUN_00682350(void) { void *pvVar1; int *piVar2; piVar2 = (int *)FUN_00684fc0(); pvVar1 = (void *)*piVar2; if ((pvVar1 != (void *)0x0) && ((*(byte *)((int)pvVar1 + 4) & 1) != 0)) { g_currentShader = pvVar1; } DAT_00c79770 = DAT_00c79770 + -1; if (DAT_00c79770 == 0) { DAT_00c7976c = 0; } return; } //@@ 00682390 text_wrap_lines /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? (out vector) splits text on "\n" and wraps to a width with Font::get_string_width_n, pushing each line (vector_string_emplace_reallocate_move); only caller Popup::build_lines 009c27c0 Popup::build_lines void text_wrap_lines(int *param_1) { char cVar1; std_string *psVar2; undefined4 uVar3; int iVar4; char *in_ECX; char *pcVar5; void *pvVar6; Font *in_EDX; uint uVar7; uint uVar8; char *pcVar9; char *pcVar10; char *pcVar11; size_t _Count; float in_XMM3_Da; char *local_50; char *local_48; std_string local_3c; uint local_24; char *pcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pcStack_20 = (char *)((int)register0x00000010 + 0xfffffffc); local_14 = 0xffffffff; puStack_18 = &LAB_00af80ed; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((int)register0x00000010 + 0xfffffff0U); ExceptionList = &local_1c; pcVar10 = (char *)param_1[1]; pcVar9 = (char *)*param_1; pcVar11 = (char *)((int)register0x00000010 + 0xfffffffc); if (pcVar9 != pcVar10) { do { std::string::_Tidy_deallocate(pcVar9); pcVar9 = pcVar9 + 0x18; } while (pcVar9 != pcVar10); pcVar9 = (char *)*param_1; pcVar11 = pcStack_20; } pcStack_20 = pcVar11; param_1[1] = (int)pcVar9; pcVar10 = &DAT_00c80050; local_48 = in_ECX; if (in_ECX != (char *)0x0) { do { local_50 = strchr(local_48,0x20); pcVar9 = strstr(local_48,"\\n"); if (((pcVar9 == (char *)0x0) || (local_50 <= pcVar9)) && (pcVar9 = local_50, local_50 == (char *)0x0)) { pcVar9 = in_ECX; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); pcVar9 = pcVar9 + (-1 - (int)in_ECX) + (int)in_ECX; } else { local_50 = pcVar9; pcVar9 = local_50; } pcVar11 = pcVar10; if (&DAT_00c80050 < pcVar10) { *pcVar10 = ' '; pcVar11 = pcVar10 + 1; } strncpy(pcVar11,local_48,(int)pcVar9 - (int)local_48); pcVar11 = pcVar11 + ((int)pcVar9 - (int)local_48); *pcVar11 = '\0'; iVar4 = Font::get_string_width_n(in_EDX,&DAT_00c80050,-1); if (in_XMM3_Da <= (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)])) { local_3c._size = 0; local_3c._capacity = 0xf; *pcVar10 = '\0'; local_3c._buf._0_4_ = (void *)0x0; pcVar9 = &DAT_00c80050; do { pcVar5 = pcVar9; pcVar9 = pcVar5 + 1; } while (*pcVar5 != '\0'); std::string::assign(local_3c._buf,&DAT_00c80050,(uint)(pcVar5 + -0xc80050)); uVar3 = local_3c._buf._0_4_; local_14 = 0; psVar2 = (std_string *)param_1[1]; if (psVar2 == (std_string *)param_1[2]) { vector_string_emplace_reallocate_move(param_1,psVar2,&local_3c); uVar8 = local_3c._capacity; } else { local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; *(undefined4 *)psVar2->_buf = uVar3; *(undefined4 *)(psVar2->_buf + 4) = local_3c._buf._4_4_; *(undefined4 *)(psVar2->_buf + 8) = local_3c._buf._8_4_; *(undefined4 *)(psVar2->_buf + 0xc) = local_3c._buf._12_4_; psVar2->_size = local_3c._size; psVar2->_capacity = local_3c._capacity; param_1[1] = param_1[1] + 0x18; uVar8 = 0xf; } local_14 = 0xffffffff; if (0xf < uVar8) { uVar7 = uVar8 + 1; pvVar6 = (void *)local_3c._buf._0_4_; if (0xfff < uVar7) { pvVar6 = *(void **)(local_3c._buf._0_4_ + -4); uVar7 = uVar8 + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar6))) goto LAB_00682710; } operator_delete(pvVar6,uVar7); } _Count = (int)pcVar11 - (int)(pcVar10 + 1); strncpy(&DAT_00c80050,pcVar10 + 1,_Count); pcVar11 = &DAT_00c80050 + _Count; LAB_00682670: *pcVar11 = '\0'; } else if (*pcVar9 != ' ') { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pcVar10 = &DAT_00c80050; do { pcVar9 = pcVar10; pcVar10 = pcVar9 + 1; } while (*pcVar9 != '\0'); std::string::assign(local_3c._buf,&DAT_00c80050,(uint)(pcVar9 + -0xc80050)); uVar3 = local_3c._buf._0_4_; local_14 = 1; psVar2 = (std_string *)param_1[1]; if (psVar2 == (std_string *)param_1[2]) { vector_string_emplace_reallocate_move(param_1,psVar2,&local_3c); uVar8 = local_3c._capacity; } else { local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; *(undefined4 *)psVar2->_buf = uVar3; *(undefined4 *)(psVar2->_buf + 4) = local_3c._buf._4_4_; *(undefined4 *)(psVar2->_buf + 8) = local_3c._buf._8_4_; *(undefined4 *)(psVar2->_buf + 0xc) = local_3c._buf._12_4_; psVar2->_size = local_3c._size; psVar2->_capacity = local_3c._capacity; param_1[1] = param_1[1] + 0x18; uVar8 = 0xf; } local_14 = 0xffffffff; if (0xf < uVar8) { uVar7 = uVar8 + 1; pvVar6 = (void *)local_3c._buf._0_4_; if (0xfff < uVar7) { pvVar6 = *(void **)(local_3c._buf._0_4_ + -4); uVar7 = uVar8 + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar6))) goto LAB_00682710; } operator_delete(pvVar6,uVar7); } pcVar11 = &DAT_00c80050; goto LAB_00682670; } if (local_50 == (char *)0x0) break; if (*local_50 == '\\') { local_50 = local_50 + 1; } local_48 = local_50 + 1; pcVar10 = pcVar11; } while (local_48 != (char *)0x0); if (&DAT_00c80050 < pcVar11) { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pcVar10 = &DAT_00c80050; do { pcVar9 = pcVar10; pcVar10 = pcVar9 + 1; } while (*pcVar9 != '\0'); std::string::assign(local_3c._buf,&DAT_00c80050,(uint)(pcVar9 + -0xc80050)); local_14 = 2; FUN_0042f0f0(&local_3c); if (0xf < local_3c._capacity) { uVar8 = local_3c._capacity + 1; pvVar6 = (void *)local_3c._buf._0_4_; if (0xfff < uVar8) { pvVar6 = *(void **)(local_3c._buf._0_4_ + -4); uVar8 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar6))) { LAB_00682710: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar8); } } } ExceptionList = local_1c; return; } //@@ 00682740 normalize_angle_degrees /* DB: fmod by 360 when |a|>360, compare against 180 prototype: db/protos.zhl */ float __cdecl normalize_angle_degrees(float angle) { if (360.0 < ABS(angle)) { angle = fmodf(angle,360.0); } if (180.0 < angle) { return angle - 360.0; } if (angle < -180.0) { angle = angle + 360.0; } return angle; } //@@ 006827a0 angle_difference /* DB: takes no t: returns the shortest signed difference to - from (xmm0, xmm1 -> xmm0) prototype: db/protos.zhl */ float __cdecl angle_difference(float from,float to) { if (360.0 < ABS(from)) { from = fmodf(from,360.0); } if (from <= 180.0) { if (from < -180.0) { from = from + 360.0; } } else { from = from - 360.0; } if (360.0 < ABS(to)) { to = fmodf(to,360.0); } if (to <= 180.0) { if (to < -180.0) { to = to + 360.0; } } else { to = to - 360.0; } if (180.0 < ABS(to - from)) { if (from < to) { return to - (from + 360.0); } to = to + 360.0; } return to - from; } //@@ 006828b0 LerpAngleDeg /* DB: src/anm2 decompile labels (LerpAngleDeg(xmm0 a,xmm1 b,xmm2 t)) prototype: db/protos.zhl */ float __cdecl LerpAngleDeg(float from,float to,float t) { float x; if (360.0 < ABS(from)) { from = fmodf(from,360.0); } if (from <= 180.0) { if (from < -180.0) { from = from + 360.0; } } else { from = from - 360.0; } if (360.0 < ABS(to)) { to = fmodf(to,360.0); } if (to <= 180.0) { if (to < -180.0) { to = to + 360.0; } } else { to = to - 360.0; } if (180.0 < ABS(to - from)) { if (to <= from) { to = to + 360.0; } else { from = from + 360.0; } } x = (to - from) * t + from; if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (180.0 < x) { return x - 360.0; } if (x < -180.0) { x = x + 360.0; } return x; } //@@ 00682a20 FUN_00682a20 void FUN_00682a20(void) { float in_XMM0_Da; float in_XMM1_Da; float in_XMM2_Da; if (ABS(in_XMM0_Da - in_XMM1_Da) <= in_XMM2_Da) { return; } if (in_XMM0_Da < in_XMM1_Da) { return; } return; } //@@ 00682a50 approach_angle /* DB: steps angle toward target by max delta with 360 wrap prototype: db/protos.zhl */ float __cdecl approach_angle(float current,float target,float maxStep) { float fVar1; fVar1 = target - current; if (360.0 < ABS(fVar1)) { fVar1 = fmodf(fVar1,360.0); } if (fVar1 <= 180.0) { if (fVar1 < -180.0) { fVar1 = fVar1 + 360.0; } } else { fVar1 = fVar1 - 360.0; } if (ABS(fVar1) <= maxStep) { return target; } if (fVar1 <= 0.0) { fVar1 = current - maxStep; if (360.0 < ABS(fVar1)) { fVar1 = fmodf(fVar1,360.0); } } else { fVar1 = current + maxStep; if (360.0 < ABS(fVar1)) { fVar1 = fmodf(fVar1,360.0); } } if (180.0 < fVar1) { return fVar1 - 360.0; } if (fVar1 < -180.0) { fVar1 = fVar1 + 360.0; } return fVar1; } //@@ 00682b90 string_scramble_seeded /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x00682e44) */ /* DB: ? std::string by value + RNG; used by curse name, UsePill, pickup collision prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl string_scramble_seeded (void *outString,void *textBuf,int textBuf1,int textBuf2,int textBuf3,uint textSize, uint textCapacity) { byte *pbVar1; undefined1 uVar2; code *pcVar3; void *pvVar4; void **ppvVar5; void **ppvVar6; uint uVar7; uint uVar8; uint uVar9; bool bVar10; int local_40; void *local_3c [4]; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); puStack_18 = &LAB_00af8138; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; local_14 = (void *)0x0; uVar9 = 0x811c9dc5; ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } uVar7 = 0; if (textSize != 0) { do { pbVar1 = (byte *)(uVar7 + (int)ppvVar6); uVar7 = uVar7 + 1; uVar9 = (*pbVar1 ^ uVar9) * 0x1000193; } while (uVar7 < textSize); } uVar7 = 0; if (0 < (int)textSize) { local_40 = 1; do { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); pvVar4 = (void *)(*pcVar3)(); return pvVar4; } uVar9 = uVar9 >> 5 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 7 ^ uVar9; uVar8 = uVar9 % 0xf; if (uVar8 < 2) { ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } uVar2 = *(undefined1 *)((int)ppvVar6 + uVar7); if ((local_40 < (int)textSize) && (uVar8 == 0)) { ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } ppvVar5 = &textBuf; if (0xf < textCapacity) { ppvVar5 = textBuf; } *(undefined1 *)((int)ppvVar5 + uVar7) = *(undefined1 *)((int)ppvVar6 + uVar7 + 1); ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } *(undefined1 *)((int)ppvVar6 + uVar7 + 1) = uVar2; } else if ((0 < (int)uVar7) && (uVar8 == 1)) { ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } ppvVar5 = &textBuf; if (0xf < textCapacity) { ppvVar5 = textBuf; } *(undefined1 *)((int)ppvVar5 + uVar7) = *(undefined1 *)((int)ppvVar6 + (uVar7 - 1)); ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } *(undefined1 *)((int)ppvVar6 + (uVar7 - 1)) = uVar2; } } else if (uVar8 < 4) { bVar10 = textSize != uVar7; ppvVar6 = &textBuf; if (0xf < textCapacity) { ppvVar6 = textBuf; } textSize = textSize - bVar10; memmove((void *)(uVar7 + (int)ppvVar6),(void *)((int)(uVar7 + (int)ppvVar6) + (uint)bVar10), (textSize - uVar7) + 1); uVar7 = uVar7 - 1; local_40 = local_40 + -1; } else if (uVar8 < 5) { local_28 = 0xf; local_2c = 1; local_3c[0] = (void *)0x61; local_14._0_1_ = 1; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); pvVar4 = (void *)(*pcVar3)(); return pvVar4; } uVar9 = uVar9 >> 5 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 7 ^ uVar9; local_3c[0] = (void *)(uint)(byte)((char)uVar9 + (char)(uVar9 / 0x1a) * -0x1a + 0x61); std_string_insert(&textBuf,uVar7,(byte *)local_3c,1); local_40 = local_40 + 1; uVar7 = uVar7 + 1; local_14 = (void *)((uint)local_14._1_3_ << 8); if (0xf < local_28) { uVar8 = local_28 + 1; pvVar4 = local_3c[0]; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_3c[0] + -4); uVar8 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar8); } local_2c = 0; local_28 = 0xf; local_3c[0] = (void *)((uint)local_3c[0] & 0xffffff00); } else if (uVar8 < 6) { std_string_insert(&textBuf,uVar7,&DAT_00b656ec,1); uVar7 = uVar7 + 1; local_40 = local_40 + 1; } uVar7 = uVar7 + 1; local_40 = local_40 + 1; } while ((int)uVar7 < (int)textSize); } *(undefined4 *)outString = 0; *(undefined4 *)((int)outString + 0x10) = 0; *(undefined4 *)((int)outString + 0x14) = 0; *(void **)outString = textBuf; *(int *)((int)outString + 4) = textBuf1; *(int *)((int)outString + 8) = textBuf2; *(int *)((int)outString + 0xc) = textBuf3; *(ulonglong *)((int)outString + 0x10) = CONCAT44(textCapacity,textSize); ExceptionList = local_1c; return outString; } //@@ 00682ed0 Color::Reset /* ZHL [lua] Lua binding Color:Reset prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Color::Reset(Color *this) { this->_tint[0] = 1.0; this->_tint[1] = 1.0; this->_tint[2] = 1.0; this->_tint[3] = 1.0; this->_colorize[0] = 0.0; this->_colorize[1] = 0.0; this->_colorize[2] = 0.0; this->_colorize[3] = 0.0; this->_offset[0] = 0.0; this->_offset[1] = 0.0; this->_offset[2] = 0.0; return; } //@@ 00682f20 Color::SetTint /* ZHL [lua] Lua binding Color:SetTint prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Color::SetTint(Color *this,float r,float g,float b,float a) { this->_tint[0] = r; this->_tint[1] = g; this->_tint[2] = b; this->_tint[3] = a; return; } //@@ 00682f50 KColor::FromRGBA255 /* DB: ints * 1/255 prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall KColor::FromRGBA255(KColor *this,int red,int green,int blue,int alpha) { this->_red = (float)red * 0.003921569; this->_green = (float)green * 0.003921569; this->_blue = (float)blue * 0.003921569; this->_alpha = (float)alpha * 0.003921569; return; } //@@ 00682fb0 Color::SetColorize /* ZHL [lua] Lua binding Color:SetColorize prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Color::SetColorize(Color *this,float red,float green,float blue,float amount) { this->_colorize[0] = red; this->_colorize[1] = green; this->_colorize[2] = blue; this->_colorize[3] = amount; return; } //@@ 00682fe0 Color::SetOffset /* ZHL [lua] Lua binding Color:SetOffset prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Color::SetOffset(Color *this,float redOffset,float greenOffset,float blueOffset) { this->_offset[0] = redOffset; this->_offset[1] = greenOffset; this->_offset[2] = blueOffset; return; } //@@ 00683010 FUN_00683010 void FUN_00683010(int param_1,int param_2,int param_3) { int in_ECX; *(float *)(in_ECX + 0x20) = (float)param_1 * 0.003921569; *(float *)(in_ECX + 0x24) = (float)param_2 * 0.003921569; *(float *)(in_ECX + 0x28) = (float)param_3 * 0.003921569; return; } //@@ 00683060 apply_sprite_shader_params /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? sets ColorOffset/Colorize/ClipPlane/PixelationAmount/TextureSize uniforms prototype: db/protos.zhl, confirmed by RET 12 */ void apply_sprite_shader_params(ColorMod *color,byte isApplyColor,void *image,void *imageRefCount) { void *this; char cVar1; uint uVar2; int unused; ColorMod *extraout_ECX; int unused_00; int unused_01; float local_30; float local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; this = g_currentShader; puStack_c = &LAB_00af816d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; local_30 = (float)((double)*(int *)((int)image + 0x10) + __uint_to_double_fixup[-(*(int *)((int)image + 0x10) >> 0x1f)]); local_2c = (float)((double)*(int *)((int)image + 0x14) + __uint_to_double_fixup[-(*(int *)((int)image + 0x14) >> 0x1f)]); local_28 = DAT_00c79a4c; local_24 = DAT_00c79c50; local_20 = DAT_00c79c54; local_1c = DAT_00c7165c; local_18 = uVar2; if (isApplyColor != 0) { Shader::set_uniform(g_currentShader,(byte *)"Colorize",0xb,color->_colorize,(int)color); Shader::set_uniform(this,(byte *)"ColorOffset",10,color->_offset,unused); color = extraout_ECX; } Shader::set_uniform(this,(byte *)"TextureSize",9,&local_30,(int)color); Shader::set_uniform(this,(byte *)"PixelationAmount",8,&local_28,unused_00); Shader::set_uniform(this,(byte *)"ClipPlane",10,&local_24,unused_01); local_8 = 1; if (imageRefCount != (void *)0x0) { cVar1 = (**(code **)(*(int *)imageRefCount + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&image); } } ExceptionList = local_10; return; } //@@ 006831c0 Color::__mul /* ZHL [lua] Lua binding Color:__mul prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Color::__mul(Color *this,ColorMod *other) { float fVar1; float fVar2; float fVar3; this->_tint[0] = other->_tint[0] * this->_tint[0]; this->_tint[1] = other->_tint[1] * this->_tint[1]; this->_tint[2] = other->_tint[2] * this->_tint[2]; this->_tint[3] = other->_tint[3] * this->_tint[3]; fVar1 = other->_colorize[0]; if (fVar1 + other->_colorize[1] + other->_colorize[2] != 0.0) { fVar2 = this->_colorize[1]; fVar3 = this->_colorize[2]; if (this->_colorize[0] + fVar2 + fVar3 == 0.0) { this->_colorize[0] = fVar1; this->_colorize[1] = other->_colorize[1]; this->_colorize[2] = other->_colorize[2]; this->_colorize[3] = other->_colorize[3]; } else { this->_colorize[0] = (this->_colorize[0] + fVar1) * 0.5; this->_colorize[1] = (fVar2 + other->_colorize[1]) * 0.5; this->_colorize[2] = (fVar3 + other->_colorize[2]) * 0.5; this->_colorize[3] = (this->_colorize[3] + other->_colorize[3]) * 0.5; } } this->_offset[0] = other->_offset[0] + this->_offset[0]; this->_offset[1] = other->_offset[1] + this->_offset[1]; this->_offset[2] = other->_offset[2] + this->_offset[2]; return; } //@@ 006832e0 Color::Lerp /* DB: src/anm2 decompile labels (Color::Lerp(out,a,b,t)) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ ColorMod * __cdecl Color::Lerp(ColorMod *out,ColorMod *from,ColorMod *to,float t) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; float fVar19; float fVar20; float fVar21; fVar21 = 1.0 - t; fVar15 = to->_tint[1]; fVar16 = to->_tint[2]; fVar17 = to->_tint[3]; fVar18 = from->_tint[1]; fVar19 = from->_tint[2]; fVar20 = from->_tint[3]; fVar1 = from->_colorize[0]; fVar2 = from->_colorize[1]; fVar3 = to->_colorize[0]; fVar4 = from->_colorize[2]; fVar5 = from->_colorize[3]; fVar6 = to->_colorize[1]; fVar7 = from->_offset[1]; fVar8 = to->_colorize[2]; fVar9 = from->_offset[0]; fVar10 = to->_colorize[3]; fVar11 = to->_offset[0]; fVar12 = to->_offset[1]; fVar13 = to->_offset[2]; fVar14 = from->_offset[2]; out->_tint[0] = t * to->_tint[0] + fVar21 * from->_tint[0]; out->_tint[1] = t * fVar15 + fVar21 * fVar18; out->_tint[2] = t * fVar16 + fVar21 * fVar19; out->_tint[3] = t * fVar17 + fVar21 * fVar20; out->_offset[1] = fVar21 * fVar7 + t * fVar12; out->_offset[0] = fVar21 * fVar9 + t * fVar11; out->_offset[2] = fVar21 * fVar14 + t * fVar13; out->_colorize[0] = fVar21 * fVar1 + t * fVar3; out->_colorize[1] = fVar21 * fVar2 + t * fVar6; out->_colorize[2] = fVar21 * fVar4 + t * fVar8; out->_colorize[3] = fVar21 * fVar5 + t * fVar10; return out; } //@@ 00683410 Checksum::Update /* DB: mode this[3]==0: rotating add-hash over 4-byte chunks; mode 1: CRC32 (poly 0xedb88320, lazy table at 0xc7e860) into this[2]; used by PersistentGameData::write prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Checksum::Update(void *this,byte *data,uint size) { byte *pbVar1; uint uVar2; uint uVar3; if (*(int *)((int)this + 0xc) == 0) { uVar3 = 0; if (size != 0) { do { *(byte *)((uint)*(byte *)((int)this + 4) + (int)this) = data[uVar3]; *(char *)((int)this + 4) = *(char *)((int)this + 4) + '\x01'; if ((3 < *(byte *)((int)this + 4)) && (*(int *)((int)this + 0xc) == 0)) { *(undefined1 *)((int)this + 4) = 0; *(uint *)((int)this + 8) = (*(uint *)((int)this + 8) >> 1) + *(uint *)((int)this + 8) * -0x80000000 + *(int *)this; } uVar3 = uVar3 + 1; } while (uVar3 < size); return; } } else if (*(int *)((int)this + 0xc) == 1) { if (DAT_00c7e864 == 0) { uVar3 = 0; do { uVar2 = -(uint)((uVar3 & 1) != 0) & 0xedb88320 ^ uVar3 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; (&DAT_00c7e860)[uVar3] = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar3 = uVar3 + 1; } while ((int)uVar3 < 0x100); } uVar2 = 0; uVar3 = ~*(uint *)((int)this + 8); *(uint *)((int)this + 8) = uVar3; if (size != 0) { do { pbVar1 = data + uVar2; uVar2 = uVar2 + 1; uVar3 = uVar3 >> 8 ^ (&DAT_00c7e860)[(uint)*pbVar1 ^ uVar3 & 0xff]; *(uint *)((int)this + 8) = uVar3; } while (uVar2 < size); } *(uint *)((int)this + 8) = ~uVar3; } return; } //@@ 00683580 checksum_stream /* DB: EDX = stream object (vtable +4 size, +0xc seek, +0x14 read): seeks to arg1, reads size-arg1-arg2 bytes into a tracked buffer and runs Checksum::Update over them, returns the checksum; AfterbirthPersistentGameData::check_header calls (0x10,4) and compares with the stored trailing dword, GameState::read_rerun and netplay save-sync use it too prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ uint __cdecl checksum_stream(void *stream,int offset,int trailingSize) { int iVar1; byte *data; int extraout_ECX; uint uVar2; int local_20; byte local_1c; uint local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = (**(code **)(*(int *)stream + 4))(__security_cookie ^ (int)register0x00000010 - 4U); uVar2 = (iVar1 - offset) - trailingSize; (**(code **)(*(int *)stream + 0xc))(offset,0); data = tracked_alloc(0,(void *)0x0,(ulonglong)uVar2); (**(code **)(*(int *)stream + 0x14))(data,1,uVar2); local_14 = 1; local_20 = 0; local_1c = 0; local_18 = 0xfedcba76; Checksum::Update(&local_20,data,uVar2); if ((local_14 == 0) && (local_1c != 0)) { if (local_1c < 4) { memset((void *)(extraout_ECX + (uint)local_1c),0,(uint)(byte)(4 - local_1c)); } uVar2 = local_18 * -0x80000000 + (local_18 >> 1) + local_20; } else { uVar2 = local_18; } local_8 = 0; tracked_alloc(1,data,0); ExceptionList = local_10; return uVar2; } //@@ 00683680 FUN_00683680 void FUN_00683680(void) { undefined4 *puVar1; undefined8 local_c; local_c = 0; std::vector::resize(&local_c); puVar1 = std::deque::back(); if ((byte *)(puVar1 + 1) != (byte *)0x0) { *(byte *)(puVar1 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar1 = g_graphicsManager_renderTarget; return; } //@@ 006836c0 pop_render_target /* DB: "PopRenderTarget: stack is empty!" prototype: db/protos.zhl */ void __cdecl pop_render_target(void) { undefined4 *puVar1; if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } puVar1 = std::deque::back(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*puVar1,*(byte *)(puVar1 + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } return; } //@@ 00683710 FUN_00683710 void FUN_00683710(byte param_1) { uint3 uVar1; uint uVar2; int *piVar3; undefined4 *puVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af81a0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = IsaacRepentancePlus::SteamCloudFile::vftable; if ((in_ECX[1] == 1) && (in_ECX[4] != 0)) { piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar2); if (*piVar3 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar2); (*(code *)**(undefined4 **)*puVar4)(in_ECX[3],in_ECX[4],in_ECX[7]); } } local_8._0_1_ = 1; tracked_alloc(1,(void *)in_ECX[4],0); uVar1 = local_8._1_3_; local_8 = (uint)local_8._1_3_ << 8; in_ECX[4] = 0; in_ECX[7] = 0; in_ECX[6] = 0; in_ECX[1] = 2; if ((void *)in_ECX[2] == (void *)0x0) { *in_ECX = KAGE::Filesys::FileStream::vftable; } else { local_8 = CONCAT31(uVar1,2); tracked_alloc(1,(void *)in_ECX[2],0); in_ECX[2] = 0; in_ECX[1] = 2; } *in_ECX = KAGE::Filesys::StreamBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x24); } ExceptionList = local_10; return; } //@@ 00683820 FUN_00683820 undefined4 FUN_00683820(byte *param_1) { char cVar1; uint uVar2; int *piVar3; undefined4 *puVar4; void *pvVar5; int iVar6; byte *pbVar7; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar2); if (*piVar3 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar2); cVar1 = (**(code **)(*(int *)*puVar4 + 0x34))(param_1); if (cVar1 != '\0') { *(byte **)(in_ECX + 0xc) = param_1; puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); uVar2 = (**(code **)(*(int *)*puVar4 + 0x3c))(param_1); *(uint *)(in_ECX + 0x1c) = uVar2; *(uint *)(in_ECX + 0x14) = uVar2; pvVar5 = tracked_alloc(0,(void *)0x0,(ulonglong)uVar2); *(void **)(in_ECX + 0x10) = pvVar5; puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); iVar6 = (**(code **)(*(int *)*puVar4 + 4)) (param_1,*(undefined4 *)(in_ECX + 0x10),*(undefined4 *)(in_ECX + 0x1c)); if (iVar6 != 0) { *(undefined4 *)(in_ECX + 4) = 0; pbVar7 = path_join(param_1,(byte *)0x0,0,0); *(byte **)(in_ECX + 8) = pbVar7; ExceptionList = local_10; return 1; } local_8 = iVar6; tracked_alloc(1,*(void **)(in_ECX + 0x10),0); *(undefined4 *)(in_ECX + 0x10) = 0; } } ExceptionList = local_10; return 0; } //@@ 00683930 FUN_00683930 undefined4 FUN_00683930(byte *param_1,uint param_2) { int *piVar1; void *pvVar2; byte *pbVar3; int in_ECX; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if (*piVar1 == 0) { return 0; } *(byte **)(in_ECX + 0xc) = param_1; *(undefined4 *)(in_ECX + 0x1c) = 0; pvVar2 = tracked_alloc(0,(void *)0x0,(ulonglong)param_2); *(void **)(in_ECX + 0x10) = pvVar2; *(uint *)(in_ECX + 0x14) = param_2; *(undefined4 *)(in_ECX + 4) = 1; pbVar3 = path_join(param_1,(byte *)0x0,0,0); *(byte **)(in_ECX + 8) = pbVar3; return 1; } //@@ 006839b0 FUN_006839b0 void FUN_006839b0(void) { uint uVar1; int *piVar2; undefined4 *puVar3; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af81c0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((*(int *)(in_ECX + 4) == 1) && (*(int *)(in_ECX + 0x10) != 0)) { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar1); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar1); (*(code *)**(undefined4 **)*puVar3) (*(undefined4 *)(in_ECX + 0xc),*(undefined4 *)(in_ECX + 0x10), *(undefined4 *)(in_ECX + 0x1c)); } } local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x10),0); *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 4) = 2; if (*(void **)(in_ECX + 8) != (void *)0x0) { local_8 = 1; tracked_alloc(1,*(void **)(in_ECX + 8),0); *(undefined4 *)(in_ECX + 8) = 0; } ExceptionList = local_10; return; } //@@ 00683a90 FUN_00683a90 void FUN_00683a90(int param_1,int param_2) { uint *puVar1; uint uVar2; int in_ECX; int iVar3; if (param_2 == 0) { iVar3 = 0; if (0 < param_1) { iVar3 = param_1; } *(int *)(in_ECX + 0x18) = iVar3; } else if (param_2 == 1) { puVar1 = (uint *)(in_ECX + 0x18); if ((param_1 < 0) && (*puVar1 < (uint)-param_1)) { *puVar1 = 0; uVar2 = 0; } else { *puVar1 = *puVar1 + param_1; uVar2 = *puVar1; } if (*(uint *)(in_ECX + 0x1c) < uVar2) { *puVar1 = *(uint *)(in_ECX + 0x1c); *(bool *)(in_ECX + 0x21) = *(uint *)(in_ECX + 0x1c) <= *(uint *)(in_ECX + 0x18); return; } } else if (param_2 == 2) { if (0 < param_1) { *(uint *)(in_ECX + 0x18) = *(uint *)(in_ECX + 0x1c); *(bool *)(in_ECX + 0x21) = *(uint *)(in_ECX + 0x1c) <= *(uint *)(in_ECX + 0x1c); return; } if ((param_1 < 0) && (*(uint *)(in_ECX + 0x1c) < (uint)-param_1)) { *(undefined4 *)(in_ECX + 0x18) = 0; *(bool *)(in_ECX + 0x21) = *(int *)(in_ECX + 0x1c) == 0; return; } uVar2 = *(int *)(in_ECX + 0x1c) + param_1; *(uint *)(in_ECX + 0x18) = uVar2; *(bool *)(in_ECX + 0x21) = *(uint *)(in_ECX + 0x1c) <= uVar2; return; } *(bool *)(in_ECX + 0x21) = *(uint *)(in_ECX + 0x1c) <= *(uint *)(in_ECX + 0x18); return; } //@@ 00683b60 FUN_00683b60 size_t FUN_00683b60(void *param_1,int param_2,int param_3) { int in_ECX; uint _Size; _Size = *(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18); if ((uint)(param_2 * param_3) < _Size) { _Size = param_2 * param_3; } memcpy(param_1,(void *)(*(int *)(in_ECX + 0x10) + *(int *)(in_ECX + 0x18)),_Size); *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + _Size; *(bool *)(in_ECX + 0x21) = *(uint *)(in_ECX + 0x1c) <= *(uint *)(in_ECX + 0x18); return _Size; } //@@ 00683bb0 FUN_00683bb0 int FUN_00683bb0(char *param_1,char *param_2) { int iVar1; int *in_ECX; int iVar2; int iVar3; char local_5; iVar3 = 0; local_5 = '\0'; iVar2 = 1 - (int)param_1; do { if (param_2 <= param_1 + iVar2) break; iVar1 = (**(code **)(*in_ECX + 0x14))(&local_5,1,1); if (iVar1 == 0) break; iVar3 = iVar3 + 1; *param_1 = local_5; param_1 = param_1 + 1; } while (local_5 != '\n'); *param_1 = '\0'; return iVar3; } //@@ 00683c10 FUN_00683c10 uint FUN_00683c10(void *param_1,int param_2,int param_3) { void *_Dst; int in_ECX; uint _Size; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; _Size = param_2 * param_3; if (*(uint *)(in_ECX + 0x14) - *(int *)(in_ECX + 0x18) < _Size) { if (_Size <= ~*(uint *)(in_ECX + 0x14)) { KAGE_LogMessage(0x10,(byte *) "SteamCloudFile::Write() exeeds max buffer size limits! Current Buffer Size = %u, write size = %u\n" ); } KAGE_LogMessage(4,(byte *) "SteamCloudFile::Write() exceeds buffer size, expanding buffer size. Previous Buffer Size = %u, New Buffer Size = %u\n" ); _Dst = tracked_alloc(0,(void *)0x0,(ulonglong)(*(int *)(in_ECX + 0x14) + _Size)); memcpy(_Dst,*(void **)(in_ECX + 0x10),*(size_t *)(in_ECX + 0x14)); if (*(void **)(in_ECX + 0x10) != (void *)0x0) { uStack_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x10),0); } *(void **)(in_ECX + 0x10) = _Dst; } else { _Dst = *(void **)(in_ECX + 0x10); } memcpy((void *)(*(int *)(in_ECX + 0x18) + (int)_Dst),param_1,_Size); *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + _Size; *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *) ((-(uint)(*(uint *)(in_ECX + 0x1c) < *(uint *)(in_ECX + 0x18)) & 0xfffffffc) + 0x1c + in_ECX ); ExceptionList = local_10; return _Size; } //@@ 00683d00 keyvalue_map_parse /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? constructor-like: builds an empty std::map at this (+0 head, +4 size), splits the input C string into tokens (FUN_0067f420 into a vector), and for each token splits at '=' (FUN_0067f580(0x3d)) inserting key/value; init_engine_parameters, OptionsConfig::Load */ undefined4 * keyvalue_map_parse(byte *param_1) { byte bVar1; uint uVar2; void *pvVar3; byte *this; void *pvVar4; int *piVar5; undefined4 *in_ECX; byte *pbVar6; uint uVar7; int *piVar8; int *piVar9; undefined4 *local_40; int *local_3c; int *local_38; int local_34; undefined4 *local_30; void *local_2c [3]; int *local_20; int *local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af8216; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; local_30 = in_ECX; local_14 = uVar2; pvVar3 = operator_new(0x40); *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; *(undefined2 *)((int)pvVar3 + 0xc) = 0x101; *in_ECX = pvVar3; local_8 = (void *)0x0; local_1c = (int *)0x0; local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar6 = param_1; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,param_1,(int)pbVar6 - (int)(param_1 + 1)); local_8._0_1_ = 2; local_3c = (int *)0x0; local_38 = (int *)0x0; local_34 = 0; string_split(&local_3c,uVar2); local_8 = (void *)CONCAT31(local_8._1_3_,3); if (0xf < local_18) { uVar2 = local_18 + 1; pvVar3 = local_2c[0]; if (0xfff < uVar2) { pvVar3 = *(void **)((int)local_2c[0] + -4); uVar2 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar3))) goto LAB_006840f1; } operator_delete(pvVar3,uVar2); } local_40 = (undefined4 *)0x0; local_30 = (undefined4 *)(((int)local_38 - (int)local_3c) / 0x18); piVar8 = local_3c; if (local_30 != (undefined4 *)0x0) { do { FUN_006844a0(); if (piVar8[4] != 0) { string_split(0x3d); piVar5 = local_1c; local_8._0_1_ = 4; if (((int)local_1c - (int)local_20) / 0x18 == 2) { FUN_006844a0(); FUN_006844a0(); piVar9 = local_1c; piVar5 = local_20; if (local_20[4] == 0) { local_8 = (void *)CONCAT31(local_8._1_3_,3); for (; piVar5 != piVar9; piVar5 = piVar5 + 6) { uVar2 = piVar5[5]; if (0xf < uVar2) { pvVar3 = (void *)*piVar5; uVar7 = uVar2 + 1; pvVar4 = pvVar3; if (0xfff < uVar7) { pvVar4 = *(void **)((int)pvVar3 + -4); uVar7 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar4))) goto LAB_006840f1; } operator_delete(pvVar4,uVar7); } piVar5[4] = 0; piVar5[5] = 0xf; *(undefined1 *)piVar5 = 0; } } else { pbVar6 = (byte *)(local_20 + 6); this = (byte *)FUN_00684e10(local_20); if (this != pbVar6) { if (0xf < (uint)piVar5[0xb]) { pbVar6 = *(byte **)pbVar6; } std::string::assign((char *)this,pbVar6,piVar5[10]); } piVar9 = local_1c; local_8 = (void *)CONCAT31(local_8._1_3_,3); piVar5 = local_20; if (local_20 == (int *)0x0) goto LAB_00684047; for (; piVar5 != piVar9; piVar5 = piVar5 + 6) { uVar2 = piVar5[5]; if (0xf < uVar2) { pvVar3 = (void *)*piVar5; uVar7 = uVar2 + 1; pvVar4 = pvVar3; if (0xfff < uVar7) { pvVar4 = *(void **)((int)pvVar3 + -4); uVar7 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar4))) goto LAB_006840f1; } operator_delete(pvVar4,uVar7); } piVar5[4] = 0; piVar5[5] = 0xf; *(undefined1 *)piVar5 = 0; } } } else { local_8 = (void *)CONCAT31(local_8._1_3_,3); piVar9 = local_20; if (local_20 == (int *)0x0) goto LAB_00684047; for (; piVar9 != piVar5; piVar9 = piVar9 + 6) { uVar2 = piVar9[5]; if (0xf < uVar2) { pvVar3 = (void *)*piVar9; uVar7 = uVar2 + 1; pvVar4 = pvVar3; if (0xfff < uVar7) { pvVar4 = *(void **)((int)pvVar3 + -4); uVar7 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar4))) goto LAB_006840f1; } operator_delete(pvVar4,uVar7); } piVar9[4] = 0; piVar9[5] = 0xf; *(undefined1 *)piVar9 = 0; } } uVar2 = ((int)(local_18 - (int)local_20) / 0x18) * 0x18; piVar5 = local_20; if (0xfff < uVar2) { piVar5 = (int *)local_20[-1]; uVar2 = uVar2 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_20 + (-4 - (int)piVar5))) goto LAB_006840f1; } operator_delete(piVar5,uVar2); local_20 = (int *)0x0; local_1c = (int *)0x0; local_18 = 0; } LAB_00684047: piVar8 = piVar8 + 6; local_40 = (undefined4 *)((int)local_40 + 1); } while (local_40 < local_30); } piVar8 = local_3c; if (local_3c != (int *)0x0) { piVar5 = local_38; piVar9 = local_3c; if (local_3c != local_38) { do { uVar2 = piVar9[5]; if (0xf < uVar2) { pvVar3 = (void *)*piVar9; uVar7 = uVar2 + 1; pvVar4 = pvVar3; if (0xfff < uVar7) { pvVar4 = *(void **)((int)pvVar3 + -4); uVar7 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar4))) goto LAB_006840f1; } operator_delete(pvVar4,uVar7); piVar5 = local_38; } piVar9[4] = 0; piVar9[5] = 0xf; *(undefined1 *)piVar9 = 0; piVar9 = piVar9 + 6; } while (piVar9 != piVar5); } uVar2 = ((local_34 - (int)piVar8) / 0x18) * 0x18; piVar5 = piVar8; if (0xfff < uVar2) { piVar5 = (int *)piVar8[-1]; uVar2 = uVar2 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar8 + (-4 - (int)piVar5))) { LAB_006840f1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar5,uVar2); } ExceptionList = local_10; return in_ECX; } //@@ 00684130 FUN_00684130 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ int FUN_00684130(undefined4 param_1,int param_2) { char ****ppppcVar1; undefined4 in_ECX; uint size; char ****local_24 [4]; int local_14; uint local_10; uint local_c; local_c = __security_cookie ^ (uint)local_24; FUN_00684590(local_24,param_1,in_ECX); if (local_14 != 0) { ppppcVar1 = (char ****)local_24; if (0xf < local_10) { ppppcVar1 = local_24[0]; } param_2 = atoi((char *)ppppcVar1); } if (0xf < local_10) { size = local_10 + 1; ppppcVar1 = local_24[0]; if (0xfff < size) { ppppcVar1 = (char ****)local_24[0][-1]; size = local_10 + 0x24; if ((char *)0x1f < (char *)((int)local_24[0] + (-4 - (int)ppppcVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppcVar1,size); } return param_2; } //@@ 006841d0 OptionsConfig::read_bool /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX ini/options object: looks up key arg1 (FUN_00684590), returns true for "true"/"True", false for other non-empty values, arg2 default when missing/empty; OptionsConfig::Load reads "MusicEnabled", "Filter", "ControllerHotplug" with it (companion float reader FUN_006843a0 "MapOpacity"/"Exposure") */ undefined1 OptionsConfig::read_bool(undefined4 param_1,undefined1 param_2) { byte bVar1; uint uVar2; int ****ppppiVar3; int iVar4; undefined4 in_ECX; byte ****ppppbVar5; byte ****ppppbVar6; bool bVar7; byte ****local_44 [4]; int local_34; uint local_30; int ****local_2c [4]; int local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; int ***local_8; local_8 = (int ***)0xffffffff; puStack_c = &LAB_00af824d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; FUN_00684590(local_44,param_1,in_ECX); local_8 = (int ***)0x0; if (local_34 == 0) goto LAB_00684346; local_2c[0] = (int ****)0x0; ppppbVar6 = (byte ****)local_44; if (0xf < local_30) { ppppbVar6 = local_44[0]; } local_1c = 0; local_18 = 0xf; ppppbVar5 = ppppbVar6; do { bVar1 = *(byte *)ppppbVar5; ppppbVar5 = (byte ****)((int)ppppbVar5 + 1); } while (bVar1 != 0); std::string::assign((char *)local_2c,(byte *)ppppbVar6,(int)ppppbVar5 - (int)((int)ppppbVar6 + 1)) ; if (local_1c == 0) { LAB_00684309: param_2 = 0; } else { ppppiVar3 = (int ****)local_2c; if (0xf < local_18) { ppppiVar3 = local_2c[0]; } if (local_1c == 4) { if ((*ppppiVar3 == (int ***)0x65757274) || ((((bVar1 = (byte)*ppppiVar3, bVar7 = bVar1 < 0x74, bVar1 == 0x74 && (bVar7 = *(byte *)((int)ppppiVar3 + 1) < 0x72, *(byte *)((int)ppppiVar3 + 1) == 0x72)) && (bVar7 = *(byte *)((int)ppppiVar3 + 2) < 0x75, *(byte *)((int)ppppiVar3 + 2) == 0x75)) && (bVar7 = *(byte *)((int)ppppiVar3 + 3) < 0x65, *(byte *)((int)ppppiVar3 + 3) == 0x65))) ) { uVar2 = 0; } else { uVar2 = -(uint)bVar7 | 1; } if (uVar2 != 0) goto LAB_006842a6; } else { LAB_006842a6: ppppiVar3 = (int ****)local_2c; if (0xf < local_18) { ppppiVar3 = local_2c[0]; } if (local_1c == 4) { if ((*ppppiVar3 == (int ***)0x65757254) || (((bVar1 = (byte)*ppppiVar3, bVar7 = bVar1 < 0x54, bVar1 == 0x54 && (bVar7 = *(byte *)((int)ppppiVar3 + 1) < 0x72, *(byte *)((int)ppppiVar3 + 1) == 0x72)) && ((bVar7 = *(byte *)((int)ppppiVar3 + 2) < 0x75, *(byte *)((int)ppppiVar3 + 2) == 0x75 && (bVar7 = *(byte *)((int)ppppiVar3 + 3) < 0x65, *(byte *)((int)ppppiVar3 + 3) == 0x65)))))) { uVar2 = 0; } else { uVar2 = -(uint)bVar7 | 1; } if (uVar2 == 0) goto LAB_00684305; } ppppiVar3 = (int ****)local_2c; if (0xf < local_18) { ppppiVar3 = local_2c[0]; } iVar4 = atoi((char *)ppppiVar3); if (iVar4 == 0) goto LAB_00684309; } LAB_00684305: param_2 = 1; } if (0xf < local_18) { uVar2 = local_18 + 1; ppppiVar3 = local_2c[0]; if (0xfff < uVar2) { ppppiVar3 = (int ****)local_2c[0][-1]; uVar2 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppiVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppiVar3,uVar2); } LAB_00684346: if (0xf < local_30) { uVar2 = local_30 + 1; ppppbVar6 = local_44[0]; if (0xfff < uVar2) { ppppbVar6 = (byte ****)local_44[0][-1]; uVar2 = local_30 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44[0] + (-4 - (int)ppppbVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar6,uVar2); } ExceptionList = local_10; return param_2; } //@@ 006843a0 FUN_006843a0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_006843a0(undefined4 param_1) { char ****ppppcVar1; undefined4 in_ECX; uint size; float in_XMM2_Da; double dVar2; float local_28; char ****local_24 [4]; int local_14; uint local_10; uint local_c; local_c = __security_cookie ^ (uint)&local_28; local_28 = in_XMM2_Da; FUN_00684590(local_24,param_1,in_ECX); if (local_14 != 0) { ppppcVar1 = (char ****)local_24; if (0xf < local_10) { ppppcVar1 = local_24[0]; } dVar2 = atof((char *)ppppcVar1); local_28 = (float)dVar2; } if (0xf < local_10) { size = local_10 + 1; ppppcVar1 = local_24[0]; if (0xfff < size) { ppppcVar1 = (char ****)local_24[0][-1]; size = local_10 + 0x24; if ((char *)0x1f < (char *)((int)local_24[0] + (-4 - (int)ppppcVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppcVar1,size); } return; } //@@ 00684450 FUN_00684450 void FUN_00684450(void) { char cVar1; char *pcVar2; char *in_ECX; cVar1 = *in_ECX; pcVar2 = in_ECX; while (cVar1 != '\0') { pcVar2 = pcVar2 + 1; cVar1 = *pcVar2; } do { pcVar2 = pcVar2 + -1; if (pcVar2 < in_ECX) break; cVar1 = *pcVar2; } while ((((cVar1 == ' ') || (cVar1 == '\t')) || (cVar1 == '\f')) || (((cVar1 == 'v' || (cVar1 == '\r')) || (cVar1 == '\n')))); pcVar2[1] = '\0'; return; } //@@ 006844a0 FUN_006844a0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_006844a0(void) { uint *puVar1; uint uVar2; int iVar3; undefined4 *in_ECX; undefined4 *puVar4; undefined4 local_30; undefined4 local_2c; undefined2 local_28; undefined1 local_26; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af828d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = 0xf; local_1c = 6; local_2c = 0xb0c0920; local_28 = 0xa0d; local_26 = 0; local_8 = 0; puVar1 = in_ECX + 4; puVar4 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar4 = (undefined4 *)*in_ECX; } local_14 = uVar2; iVar3 = FUN_00685620(puVar4,&local_2c,6); if (iVar3 == -1) { if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } *puVar1 = 0; *(undefined1 *)in_ECX = 0; } else { FUN_00684ee0(0,iVar3); puVar4 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar4 = (undefined4 *)*in_ECX; } iVar3 = FUN_00685570(puVar4,&local_2c,6,local_30,uVar2); uVar2 = iVar3 + 1; if (*puVar1 < uVar2) { /* WARNING: Subroutine does not return */ FUN_00499950(); } if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } *puVar1 = uVar2; *(undefined1 *)((int)in_ECX + uVar2) = 0; } ExceptionList = local_10; return; } //@@ 00684590 FUN_00684590 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ char * FUN_00684590(char *param_1,byte *param_2) { byte bVar1; byte ****ppppbVar2; int iVar3; byte *pbVar4; byte ****ppppbVar5; uint size; undefined1 auStack_3c [4]; int *local_38; char *local_34; undefined1 local_30 [8]; int local_28; byte ****local_24 [4]; uint local_14; uint local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_3c; local_24[0] = (byte ****)0x0; local_34 = param_1; local_14 = 0; local_10 = 0xf; pbVar4 = param_2; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)local_24,param_2,(int)pbVar4 - (int)(param_2 + 1)); std::map::_Find_lower_bound(local_30,local_24); ppppbVar2 = local_24[0]; if (*(char *)(local_28 + 0xd) == '\0') { pbVar4 = (byte *)(local_28 + 0x10); if (0xf < *(uint *)(local_28 + 0x24)) { pbVar4 = *(byte **)pbVar4; } ppppbVar5 = (byte ****)local_24; if (0xf < local_10) { ppppbVar5 = local_24[0]; } iVar3 = string_compare((byte *)ppppbVar5,local_14,pbVar4,*(uint *)(local_28 + 0x20)); if (-1 < iVar3) goto LAB_00684639; } local_28 = *local_38; LAB_00684639: if (0xf < local_10) { size = local_10 + 1; ppppbVar5 = ppppbVar2; if (0xfff < size) { ppppbVar5 = (byte ****)ppppbVar2[-1]; size = local_10 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbVar2 + (-4 - (int)ppppbVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar5,size); } if (local_28 == *local_38) { param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; std::string::assign(param_1,&s_empty,0); } else { std::string::string(param_1,(void *)(local_28 + 0x28)); } return param_1; } //@@ 006846c0 sha1_transform /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: SHA-1 block function: 16 big-endian words, 80-word schedule with rol1 (W[t-3]^W[t-8]^W[t-14]^W[t-16]), 0x5a827999.. round constants on the 5-word state in EDX; caller sha1_digest 00684920 sha1_digest void sha1_transform(void) { uint uVar1; int in_ECX; uint uVar2; uint uVar3; uint *in_EDX; uint *puVar4; uint uVar5; undefined1 *puVar6; int iVar7; uint uVar8; uint local_154; uint local_150; uint local_14c; uint local_148 [80]; uint local_8; local_8 = __security_cookie ^ (uint)(local_148 + 0x51); iVar7 = 0; puVar6 = (undefined1 *)(in_ECX + 2); do { local_148[iVar7] = CONCAT31(CONCAT21(CONCAT11(puVar6[-2],puVar6[-1]),*puVar6),puVar6[1]); iVar7 = iVar7 + 1; puVar6 = puVar6 + 4; } while (iVar7 < 0x10); iVar7 = 0x40; puVar4 = local_148 + 2; do { uVar1 = puVar4[0xb] ^ puVar4[6] ^ puVar4[-2] ^ *puVar4; puVar4[0xe] = uVar1 >> 0x1f | uVar1 * 2; iVar7 = iVar7 + -1; puVar4 = puVar4 + 1; } while (iVar7 != 0); local_150 = in_EDX[4]; uVar5 = 0; uVar1 = in_EDX[2]; uVar8 = in_EDX[1]; local_154 = in_EDX[3]; local_14c = *in_EDX; do { uVar3 = uVar1; puVar4 = local_148 + uVar5; uVar5 = uVar5 + 1; uVar2 = local_14c * 0x20 + (local_14c >> 0x1b) + 0x5a827999 + local_150 + ((local_154 ^ uVar3) & uVar8 ^ local_154) + *puVar4; local_150 = local_154; uVar1 = uVar8 * 0x40000000 + (uVar8 >> 2); uVar8 = local_14c; local_154 = uVar3; local_14c = uVar2; } while ((int)uVar5 < 0x14); do { local_14c = uVar2; local_154 = uVar3; uVar3 = uVar1; puVar4 = local_148 + uVar5; uVar5 = uVar5 + 1; uVar2 = local_14c * 0x20 + (local_14c >> 0x1b) + local_150 + (local_154 ^ uVar3 ^ uVar8) + 0x6ed9eba1 + *puVar4; local_150 = local_154; uVar1 = uVar8 * 0x40000000 + (uVar8 >> 2); uVar8 = local_14c; } while ((int)uVar5 < 0x28); if (uVar5 < 0x3c) { local_154 = uVar3; local_14c = uVar2; do { uVar3 = uVar1; puVar4 = local_148 + uVar5; uVar5 = uVar5 + 1; uVar2 = local_14c * 0x20 + -0x70e44324 + (local_14c >> 0x1b) + local_150 + ((uVar3 ^ uVar8) & local_154) + *puVar4 + (uVar3 & uVar8); local_150 = local_154; uVar1 = uVar8 * 0x40000000 + (uVar8 >> 2); uVar8 = local_14c; local_154 = uVar3; local_14c = uVar2; } while ((int)uVar5 < 0x3c); } local_14c = uVar2; local_154 = uVar3; uVar3 = local_14c; uVar2 = local_154; if (uVar5 < 0x50) { do { uVar2 = uVar1; puVar4 = local_148 + uVar5; uVar5 = uVar5 + 1; uVar3 = local_14c * 0x20 + (local_14c >> 0x1b) + local_150 + (local_154 ^ uVar2 ^ uVar8) + 0xca62c1d6 + *puVar4; local_150 = local_154; uVar1 = uVar8 * 0x40000000 + (uVar8 >> 2); uVar8 = local_14c; local_154 = uVar2; local_14c = uVar3; } while ((int)uVar5 < 0x50); } in_EDX[1] = in_EDX[1] + uVar8; in_EDX[4] = in_EDX[4] + local_150; in_EDX[2] = in_EDX[2] + uVar1; in_EDX[3] = in_EDX[3] + uVar2; *in_EDX = uVar3 + *in_EDX; return; } //@@ 00684920 sha1_digest /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? SHA-1 one-shot: pads to 64-byte blocks with 0x80 and a big-endian bit length, compresses with FUN_006846c0, SHA-1 IV bytes 67452301 EFCDAB89 98BADCFE 10325476 C3D2E1F0 at ECX, EDX=data, param=length; Seeds::GetSeedEffect compares the 20-byte result against hard-coded seed-code hashes */ void sha1_digest(uint param_1) { undefined1 *in_ECX; uint uVar1; uint uVar2; int in_EDX; uint uVar3; byte local_90 [132]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); uVar1 = param_1 & 0xffffffc0; uVar3 = uVar1 - 0x40; if ((param_1 + 9 & 0xffffffc0) != uVar1) { uVar3 = uVar1; } if (uVar3 + 0x80 < param_1 + 9) { KAGE_LogMessage(0x10,(byte *)"Assert"); } if ((param_1 <= uVar3) && (0x36 < param_1)) { KAGE_LogMessage(0x10,(byte *)"Assert"); } uVar2 = -(uint)(param_1 < uVar3) & -uVar3; uVar1 = uVar2 + uVar3; if (uVar1 < param_1) { do { uVar2 = uVar2 + 1; local_90[uVar1 - uVar3] = *(byte *)(uVar1 + in_EDX); uVar1 = uVar1 + 1; } while (uVar1 < param_1); } local_90[uVar2] = 0x80; while (uVar1 = uVar2 + 1, uVar1 < 0x7b) { local_90[uVar1] = 0; uVar2 = uVar1; } local_90[uVar1] = (byte)(param_1 >> 0x1d); local_90[uVar2 + 2] = (byte)(param_1 >> 0x15); local_90[uVar2 + 3] = (byte)(param_1 >> 0xd); local_90[uVar2 + 4] = (byte)(param_1 >> 5); local_90[uVar2 + 5] = (char)param_1 << 3; if (uVar1 != 0x7b) { KAGE_LogMessage(0x10,(byte *)"Assert"); } uVar1 = 0; if (uVar3 != 0xffffff80) { do { sha1_transform(); uVar1 = uVar1 + 0x40; } while (uVar1 < uVar3 + 0x80); } *in_ECX = 0x67; in_ECX[1] = 0x45; in_ECX[2] = 0x23; in_ECX[3] = 1; in_ECX[4] = 0xef; in_ECX[5] = 0xcd; in_ECX[6] = 0xab; in_ECX[7] = 0x89; in_ECX[8] = 0x98; in_ECX[9] = 0xba; in_ECX[10] = 0xdc; in_ECX[0xb] = 0xfe; in_ECX[0xc] = 0x10; in_ECX[0xd] = 0x32; in_ECX[0xe] = 0x54; in_ECX[0xf] = 0x76; in_ECX[0x10] = 0xc3; in_ECX[0x11] = 0xd2; in_ECX[0x12] = 0xe1; in_ECX[0x13] = 0xf0; return; } //@@ 00684b90 hsv_to_rgb /* DB: hue/60 sextant switch, chroma*value prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ KColor * __cdecl hsv_to_rgb(KColor *outColor,float hue,float saturation,float value,float alpha) { float fVar1; float fVar2; float fVar3; float fVar4; fVar4 = saturation * value; fVar1 = fmodf(hue / 60.0,2.0); fVar2 = (1.0 - ABS(fVar1 - 1.0)) * fVar4; fVar1 = fVar4; fVar3 = fVar4; switch((int)(hue / 60.0) % 6) { case 0: goto LAB_00684c54; case 1: fVar1 = fVar2; fVar2 = fVar4; goto LAB_00684c54; case 2: fVar1 = 0.0; fVar3 = fVar2; fVar2 = fVar4; break; case 3: fVar1 = 0.0; break; case 4: fVar1 = fVar2; fVar2 = 0.0; break; case 5: fVar3 = fVar2; fVar2 = 0.0; break; default: fVar1 = 0.0; fVar2 = 0.0; LAB_00684c54: fVar3 = 0.0; } fVar4 = value - fVar4; outColor->_unk = 0; outColor->_red = fVar1 + fVar4; outColor->_green = fVar2 + fVar4; outColor->_blue = fVar3 + fVar4; outColor->_alpha = alpha; return outColor; } //@@ 00684cb0 Math::timescale_factor /* DB: a / (a + t - a * t), a when t == 1: ACCELERATE's per-tick factor with the timescale (Entity_Projectile::Update 00659a72); was nullsub_684cb0 prototype: db/protos.zhl */ float __cdecl Math::timescale_factor(float acceleration,float timeScale) { if (timeScale != 1.0) { acceleration = acceleration / ((acceleration + timeScale) - acceleration * timeScale); } return acceleration; } //@@ 00684ce0 FUN_00684ce0 void FUN_00684ce0(undefined4 *param_1) { basic_streambuf_> *this; uint size; int iVar1; void *_Dst; basic_iostream_> *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af82f7; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined **)in_ECX = &DAT_00b1b17c; *(undefined **)(in_ECX + 0x10) = &DAT_00b1b174; std::basic_ios_>::basic_ios_> ((basic_ios_> *)(in_ECX + 0x68)); this = (basic_streambuf_> *)(in_ECX + 0x18); local_8 = 0; std::basic_iostream_>::basic_iostream_> (in_ECX,this); local_8 = 1; *(undefined ***)(in_ECX + *(int *)(*(int *)in_ECX + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)(in_ECX + *(int *)(*(int *)in_ECX + 4) + -4) = *(int *)(*(int *)in_ECX + 4) + -0x68; std::basic_streambuf_>::basic_streambuf_> (this); local_8 = CONCAT31(local_8._1_3_,2); *(undefined ***)this = std::basic_stringbuf,std::allocator_>::vftable; size = param_1[4]; if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } if (0x7fffffff < size) { /* WARNING: Subroutine does not return */ std::_Xbad_alloc(); } if (size == 0) { *(undefined4 *)(in_ECX + 0x50) = 0; } else { _Dst = std::_Allocate(size); memcpy(_Dst,param_1,size); *(uint *)(in_ECX + 0x50) = size + (int)_Dst; **(undefined4 **)(in_ECX + 0x24) = _Dst; **(undefined4 **)(in_ECX + 0x34) = _Dst; **(uint **)(in_ECX + 0x44) = size; iVar1 = *(int *)(in_ECX + 0x50); **(undefined4 **)(in_ECX + 0x28) = _Dst; **(undefined4 **)(in_ECX + 0x38) = _Dst; **(int **)(in_ECX + 0x48) = iVar1 - (int)_Dst; } *(uint *)(in_ECX + 0x54) = (uint)(size != 0); ExceptionList = local_10; return; } //@@ 00684e10 FUN_00684e10 int FUN_00684e10(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x28; } //@@ 00684e30 std::basic_string,std::allocator_>::end /* Library Function - Single Match public: class std::_String_iterator > > __thiscall std::basic_string,class std::allocator >::end(void) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void __thiscall std::basic_string,std::allocator_>::end (basic_string,std::allocator_> *this) { basic_string,std::allocator_> *pbVar1; undefined4 *in_stack_00000004; pbVar1 = this; if (0xf < *(uint *)(this + 0x14)) { pbVar1 = *(basic_string,std::allocator_> **)this; } *in_stack_00000004 = pbVar1 + *(int *)(this + 0x10); return; } //@@ 00684e50 FUN_00684e50 void FUN_00684e50(undefined4 *param_1) { undefined4 *in_ECX; if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } *param_1 = in_ECX; return; } //@@ 00684e70 FUN_00684e70 void FUN_00684e70(int *param_1,int param_2) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *in_ECX; int iVar3; uint uVar4; if ((uint)in_ECX[5] < 0x10) { puVar2 = in_ECX; puVar1 = in_ECX; } else { puVar2 = (undefined4 *)*in_ECX; puVar1 = (undefined4 *)*in_ECX; } param_2 = param_2 - (int)puVar1; uVar4 = (uint)(in_ECX[4] != param_2); iVar3 = in_ECX[4] - uVar4; in_ECX[4] = iVar3; memmove((void *)((int)puVar2 + param_2),(void *)((int)puVar2 + param_2 + uVar4), (iVar3 - param_2) + 1); if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } *param_1 = (int)in_ECX + param_2; return; } //@@ 00684ee0 FUN_00684ee0 void FUN_00684ee0(uint param_1,uint param_2) { uint uVar1; undefined4 *puVar2; undefined4 *in_ECX; uVar1 = in_ECX[4]; if (uVar1 < param_1) { /* WARNING: Subroutine does not return */ FUN_00499950(); } if (uVar1 - param_1 < param_2) { param_2 = uVar1 - param_1; } puVar2 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar2 = (undefined4 *)*in_ECX; } in_ECX[4] = uVar1 - param_2; memmove((void *)((int)puVar2 + param_1),(void *)((int)((int)puVar2 + param_1) + param_2), ((uVar1 - param_2) - param_1) + 1); return; } //@@ 00684f30 std::deque::back /* DB: deque back element prototype: db/protos.zhl */ void * __cdecl std::deque::back(void) { uint uVar1; uVar1 = (DAT_00c7978c + g_renderTargetStackSize) - 1; return (void *)(*(int *)(DAT_00c79784 + (uVar1 >> 1 & DAT_00c79788 - 1U) * 4) + (uVar1 & 1) * 8); } //@@ 00684f70 FUN_00684f70 void FUN_00684f70(int param_1,uint param_2) { uint uVar1; undefined4 *puVar2; undefined4 *in_ECX; int iVar3; uVar1 = in_ECX[4] - param_1; if (uVar1 < param_2) { param_2 = uVar1; } puVar2 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar2 = (undefined4 *)*in_ECX; } iVar3 = in_ECX[4] - param_2; in_ECX[4] = iVar3; memmove((void *)((int)puVar2 + param_1),(void *)((int)puVar2 + param_1 + param_2), (iVar3 - param_1) + 1); return; } //@@ 00684fc0 FUN_00684fc0 int FUN_00684fc0(void) { uint uVar1; int in_ECX; uVar1 = (*(int *)(in_ECX + 0x10) + *(int *)(in_ECX + 0xc)) - 1; return *(int *)(*(int *)(in_ECX + 4) + (uVar1 >> 2 & *(int *)(in_ECX + 8) - 1U) * 4) + (uVar1 & 3) * 4; } //@@ 00685000 std::operator<<_char /* DB: ? ostream sentry (FUN_00414690), pads to width (left/right by flags 0x1c0) around a single sputc of '/' (constant-folded char); caller ResolveRelativePath */ int * std::operator<<_char(void) { int iVar1; uint uVar2; int iVar3; int *in_ECX; int iVar4; bool bVar5; int local_2c; int iStack_28; basic_ostream_> *local_24; char local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af832d; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = 0; FUN_00414690(in_ECX); if (local_20 != '\0') { iVar3 = *in_ECX; iVar1 = *(int *)(iVar3 + 4); iStack_28 = *(int *)(iVar1 + 0x24 + (int)in_ECX); uVar2 = *(uint *)(iVar1 + 0x20 + (int)in_ECX); if ((iStack_28 < 1) && ((iStack_28 < 0 || (uVar2 < 2)))) { iStack_28 = 0; local_2c = 0; } else { local_2c = uVar2 - 1; iStack_28 = iStack_28 - (uint)(uVar2 == 0); } local_8 = 1; if ((*(uint *)(iVar1 + 0x14 + (int)in_ECX) & 0x1c0) == 0x40) { LAB_006850d1: iVar3 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(iVar3 + 4) + 0x38 + (int)in_ECX),'/'); if (iVar3 == -1) { iVar4 = 4; } for (; ((iVar4 == 0 && (-1 < iStack_28)) && ((0 < iStack_28 || (local_2c != 0)))); local_2c = local_2c + -1) { iVar3 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(*in_ECX + 4) + 0x38 + (int)in_ECX), *(char *)(*(int *)(*in_ECX + 4) + 0x40 + (int)in_ECX)); if (iVar3 == -1) { iVar4 = 4; } iStack_28 = iStack_28 + -1 + (uint)(local_2c != 0); } } else { while (iVar4 == 0) { if ((iStack_28 < 0) || ((iStack_28 < 1 && (local_2c == 0)))) { iVar3 = *in_ECX; goto LAB_006850d1; } iVar3 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(*in_ECX + 4) + 0x38 + (int)in_ECX), *(char *)(*(int *)(*in_ECX + 4) + 0x40 + (int)in_ECX)); if (iVar3 == -1) { iVar4 = 4; } bVar5 = local_2c != 0; local_2c = local_2c + -1; iStack_28 = iStack_28 + -1 + (uint)bVar5; } } } local_8 = 0; iVar3 = *(int *)(*in_ECX + 4); *(undefined4 *)(iVar3 + 0x20 + (int)in_ECX) = 0; *(undefined4 *)(iVar3 + 0x24 + (int)in_ECX) = 0; std::basic_ios_>::setstate ((basic_ios_> *)(*(int *)(*in_ECX + 4) + (int)in_ECX),iVar4, false); local_8 = 3; bVar5 = std::uncaught_exception(); if (!bVar5) { std::basic_ostream_>::_Osfx(local_24); } local_8 = CONCAT31(local_8._1_3_,4); if (*(int **)(local_24 + *(int *)(*(int *)local_24 + 4) + 0x38) != (int *)0x0) { (**(code **)(**(int **)(local_24 + *(int *)(*(int *)local_24 + 4) + 0x38) + 8))(); } ExceptionList = local_10; return in_ECX; } //@@ 00685126 Catch_All@00685126 undefined * Catch_All_00685126(void) { int unaff_EBP; std::basic_ios_>::setstate ((basic_ios_> *) (*(int *)(**(int **)(unaff_EBP + -0x14) + 4) + (int)*(int **)(unaff_EBP + -0x14)),4, true); return &DAT_00685140; } //@@ 006851c0 FUN_006851c0 void FUN_006851c0(char *param_1,char *param_2) { char *in_ECX; char *in_EDX; for (; param_1 != param_2; param_1 = param_1 + 1) { if (*param_1 == *in_ECX) { *param_1 = *in_EDX; } } return; } //@@ 006851f0 vector_string_emplace_reallocate /* DB: std::vector::_Emplace_reallocate (elem 0x18, max 0xaaaaaaa, constructs std::string(param_2) at the insert position); ResolveRelativePath, FXLayers::LoadConfig prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall vector_string_emplace_reallocate(void *this,std_string *where,void *value) { std_string *this_00; uint uVar1; int iVar2; int iVar3; std_string *psVar4; uint uVar5; std_string *psVar6; undefined4 uVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af8350; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *(int *)this; iVar3 = (*(int *)((int)this + 4) - iVar2) / 0x18; if (iVar3 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = (*(int *)((int)this + 8) - iVar2) / 0x18; if (0xaaaaaaa - (uVar1 >> 1) < uVar1) { uVar5 = 0xaaaaaaa; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0xaaaaaaa < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } psVar4 = std::_Allocate(uVar5 * 0x18); local_8 = 0; this_00 = psVar4 + ((int)where - iVar2) / 0x18; std::string::string(this_00->_buf,value); uVar7 = *(undefined4 *)this; psVar6 = psVar4; if (where != *(std_string **)((int)this + 4)) { FUN_0042f7a0(psVar4,uVar7); psVar6 = this_00 + 1; } FUN_0042f7a0(psVar6,uVar7); std::vector::_Change_array(psVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return this_00; } //@@ 0068532b Catch_All@0068532b void Catch_All_0068532b(void) { int unaff_EBP; FUN_00414ae0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00685360 std::map::try_emplace /* DB: std::map: _Find_lower_bound (00685bc0) + string_compare, on miss allocates a 0x40-byte node (key string copied at +0x10, empty value string +0x28 with cap 0xf at +0x3c), max-size 0x3ffffff check, insert/rebalance; only caller 00684e10 = operator[] (returns node+0x28), used by keyvalue_map_parse */ void std::map::try_emplace(int *param_1,byte *param_2) { int *piVar1; uint uVar2; byte *b; int iVar3; int *piVar4; int *in_ECX; byte *a; int *piVar5; int *piVar6; int *local_24; int local_20; int local_1c; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af8385; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; map::_Find_lower_bound(&local_24,param_2); if (*(char *)(local_1c + 0xd) == '\0') { b = (byte *)(local_1c + 0x10); if (0xf < *(uint *)(local_1c + 0x24)) { b = *(byte **)b; } a = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { a = *(byte **)param_2; } iVar3 = string_compare(a,*(uint *)(param_2 + 0x10),b,*(uint *)(local_1c + 0x20)); if (-1 < iVar3) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0x3ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } iVar3 = *in_ECX; local_8 = 0; local_14 = (int *)0x0; piVar4 = operator_new(0x40); local_8 = 1; local_14 = piVar4; string::string((char *)(piVar4 + 4),param_2); piVar4[10] = 0; piVar4[0xe] = 0; piVar4[0xf] = 0xf; *local_14 = iVar3; local_14[1] = iVar3; local_14[2] = iVar3; *(undefined2 *)(local_14 + 3) = 0; in_ECX[1] = in_ECX[1] + 1; piVar4 = (int *)*in_ECX; local_14[1] = (int)local_24; if (local_24 == piVar4) { *piVar4 = (int)local_14; piVar4[1] = (int)local_14; piVar4[2] = (int)local_14; *(undefined1 *)(local_14 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)local_14; if (local_24 == (int *)piVar4[2]) { piVar4[2] = (int)local_14; } } else { *local_24 = (int)local_14; if (local_24 == (int *)*piVar4) { *piVar4 = (int)local_14; } } piVar6 = local_14; if (*(char *)(local_14[1] + 0xc) == '\0') { do { piVar1 = (int *)piVar6[1]; piVar5 = *(int **)piVar1[1]; if (piVar1 == piVar5) { piVar5 = (int *)((undefined4 *)piVar1[1])[2]; if ((char)piVar5[3] == '\0') goto LAB_006854ea; if (piVar6 == (int *)piVar1[2]) { FUN_00415fe0(piVar1); piVar6 = piVar1; } *(undefined1 *)(piVar6[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar6[1] + 4)); } else if ((char)piVar5[3] == '\0') { LAB_006854ea: *(undefined1 *)(piVar1 + 3) = 1; *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; piVar6 = *(int **)(piVar6[1] + 4); } else { if (piVar6 == (int *)*piVar1) { FUN_00415f80(piVar1); piVar6 = piVar1; } *(undefined1 *)(piVar6[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar6[1] + 4)); } } while (*(char *)(piVar6[1] + 0xc) == '\0'); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)local_14; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00685570 FUN_00685570 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ int FUN_00685570(undefined4 param_1,byte *param_2,int param_3) { char cVar1; int iVar2; int iVar3; int in_ECX; byte *pbVar4; int in_EDX; undefined1 auStack_114 [4]; char local_110 [260]; uint local_c; local_c = __security_cookie ^ (uint)auStack_114; if (in_EDX != 0) { memset(local_110,0,0x100); pbVar4 = param_2 + param_3; for (; param_2 != pbVar4; param_2 = param_2 + 1) { local_110[*param_2] = '\x01'; } iVar2 = -1; if (in_EDX + -1 != -1) { iVar2 = in_EDX + -1; } iVar3 = iVar2 + in_ECX; cVar1 = local_110[*(byte *)(iVar2 + in_ECX)]; while( true ) { if (cVar1 == '\0') { return iVar3 - in_ECX; } if (iVar3 == in_ECX) break; pbVar4 = (byte *)(iVar3 + -1); iVar3 = iVar3 + -1; cVar1 = local_110[*pbVar4]; } } return -1; } //@@ 00685620 FUN_00685620 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ int FUN_00685620(undefined4 param_1,byte *param_2,int param_3) { byte *in_ECX; byte *pbVar1; int in_EDX; undefined1 auStack_114 [4]; char local_110 [260]; uint local_c; local_c = __security_cookie ^ (uint)auStack_114; if (in_EDX != 0) { memset(local_110,0,0x100); pbVar1 = param_2 + param_3; for (; param_2 != pbVar1; param_2 = param_2 + 1) { local_110[*param_2] = '\x01'; } for (pbVar1 = in_ECX; pbVar1 < in_ECX + in_EDX; pbVar1 = pbVar1 + 1) { if (local_110[*pbVar1] == '\0') { return (int)pbVar1 - (int)in_ECX; } } } return -1; } //@@ 006856c0 std::vector::resize /* DB: ? memset/memmove realloc prototype: db/protos.zhl, confirmed by RET 4 */ void std::vector::resize(void *item) { int iVar1; undefined4 uVar2; void *pvVar3; void *_Dst; uint uVar4; size_t sVar5; uint uVar6; size_t sVar7; uint uVar8; if (((DAT_00c7978c + g_renderTargetStackSize & 1) == 0) && (DAT_00c79788 <= g_renderTargetStackSize + 2 >> 1)) { uVar8 = 1; if (DAT_00c79788 != 0) { uVar8 = DAT_00c79788; } for (; (uVar4 = uVar8 - DAT_00c79788, uVar4 == 0 || (uVar8 < 8)); uVar8 = uVar8 * 2) { if (0xfffffff - uVar8 < uVar8) { FUN_0040cad0(); LAB_006858a6: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar6 = DAT_00c7978c >> 1; if (0x3fffffff < uVar8) goto LAB_006858a6; pvVar3 = _Allocate(uVar8 * 4); sVar5 = uVar6 * 4; sVar7 = (DAT_00c79788 * 4 - (int)(sVar5 + (int)DAT_00c79784)) + (int)DAT_00c79784; memmove((void *)(sVar5 + (int)pvVar3),(void *)(sVar5 + (int)DAT_00c79784),sVar7); _Dst = (void *)((int)pvVar3 + sVar7 + sVar5); if (uVar4 < uVar6) { sVar7 = uVar4 * 4; memmove(_Dst,DAT_00c79784,sVar7); sVar5 = (sVar5 - (int)(sVar7 + (int)DAT_00c79784)) + (int)DAT_00c79784; memmove(pvVar3,(void *)(sVar7 + (int)DAT_00c79784),sVar5); memset((void *)((int)pvVar3 + sVar5),0,sVar7); } else { memmove(_Dst,DAT_00c79784,sVar5); memset((void *)((int)_Dst + sVar5),0,(uVar4 - uVar6) * 4); memset(pvVar3,0,sVar5); } if (DAT_00c79784 != (void *)0x0) { deallocate(DAT_00c79784,DAT_00c79788); } DAT_00c79788 = DAT_00c79788 + uVar4; DAT_00c79784 = pvVar3; } DAT_00c7978c = DAT_00c7978c & DAT_00c79788 * 2 - 1; uVar8 = DAT_00c7978c + g_renderTargetStackSize; iVar1 = (DAT_00c79788 - 1 & uVar8 >> 1) * 4; if (*(int *)(iVar1 + (int)DAT_00c79784) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar1 + (int)DAT_00c79784) = pvVar3; } uVar8 = uVar8 & 1; uVar2 = *(undefined4 *)((int)item + 4); iVar1 = *(int *)(iVar1 + (int)DAT_00c79784); *(undefined4 *)(iVar1 + uVar8 * 8) = *(undefined4 *)item; *(undefined4 *)(iVar1 + 4 + uVar8 * 8) = uVar2; g_renderTargetStackSize = g_renderTargetStackSize + 1; return; } //@@ 006858b0 FUN_006858b0 void FUN_006858b0(byte param_1) { bool bVar1; uint uVar2; basic_istream_> *in_ECX; char *pcVar3; char *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af83c5; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38) + 4))(); } local_8 = 0; bVar1 = std::basic_istream_>::_Ipfx(in_ECX,true); local_8 = 1; if (bVar1) { local_8 = 2; pcVar3 = in_EDX; if (0xf < *(uint *)(in_EDX + 0x14)) { pcVar3 = *(char **)in_EDX; } in_EDX[0x10] = '\0'; in_EDX[0x11] = '\0'; in_EDX[0x12] = '\0'; in_EDX[0x13] = '\0'; *pcVar3 = '\0'; uVar2 = std::basic_streambuf_>::sgetc (*(basic_streambuf_> **) (in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38)); while( true ) { if (uVar2 == 0xffffffff) { FUN_006859cd(); return; } if (uVar2 == param_1) break; if (0x7ffffffe < *(uint *)(in_EDX + 0x10)) { FUN_006859cd(); return; } std::string::push_back(in_EDX,(byte)uVar2); uVar2 = std::basic_streambuf_>::snextc (*(basic_streambuf_> **) (in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38)); } std::basic_streambuf_>::sbumpc (*(basic_streambuf_> **) (in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38)); FUN_006859cd(); return; } std::basic_ios_>::setstate ((basic_ios_> *)(in_ECX + *(int *)(*(int *)in_ECX + 4)),2, false); local_8 = 4; if (*(int **)(in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + *(int *)(*(int *)in_ECX + 4) + 0x38) + 8))(); } ExceptionList = local_10; return; } //@@ 006859aa Catch_All@006859aa undefined * Catch_All_006859aa(void) { int unaff_EBP; std::basic_ios_>::setstate ((basic_ios_> *) (*(int *)(**(int **)(unaff_EBP + -0x1c) + 4) + (int)*(int **)(unaff_EBP + -0x1c)),4, true); return &DAT_006859c4; } //@@ 006859cd FUN_006859cd void FUN_006859cd(void) { int *piVar1; char unaff_BL; int unaff_EBP; int *unaff_ESI; uint unaff_EDI; *(undefined4 *)(unaff_EBP + -4) = 1; if (unaff_BL == '\0') { unaff_EDI = unaff_EDI | 2; } std::basic_ios_>::setstate ((basic_ios_> *)(*(int *)(*unaff_ESI + 4) + (int)unaff_ESI), unaff_EDI,false); *(undefined4 *)(unaff_EBP + -4) = 4; piVar1 = *(int **)(*(int *)(**(int **)(unaff_EBP + -0x2c) + 4) + 0x38 + (int)*(int **)(unaff_EBP + -0x2c)); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 8))(); } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00685a20 FUN_00685a20 void FUN_00685a20(uint param_1) { uint uVar1; bool bVar2; uint uVar3; int iVar4; int *in_ECX; char *in_EDX; int iVar5; __int64 _Var6; basic_ostream_> *local_2c; char local_28; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af83fd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar1 = *(uint *)(*(int *)(*in_ECX + 4) + 0x20 + (int)in_ECX); iVar5 = *(int *)(*(int *)(*in_ECX + 4) + 0x24 + (int)in_ECX); if ((iVar5 < 0) || (((iVar5 < 1 && (uVar1 == 0)) || (uVar1 <= param_1)))) { iVar5 = 0; } else { iVar5 = uVar1 - param_1; } FUN_00414690(in_ECX); local_8 = 0; if (local_28 == '\0') { std::basic_ios_>::setstate ((basic_ios_> *)(*(int *)(*in_ECX + 4) + (int)in_ECX),4, false); local_8 = 3; bVar2 = std::uncaught_exception(); if (!bVar2) { std::basic_ostream_>::_Osfx(local_2c); } local_8 = CONCAT31(local_8._1_3_,4); if (*(int **)(local_2c + *(int *)(*(int *)local_2c + 4) + 0x38) != (int *)0x0) { (**(code **)(**(int **)(local_2c + *(int *)(*(int *)local_2c + 4) + 0x38) + 8))(); } ExceptionList = local_10; return; } local_8 = 1; iVar4 = *in_ECX; if ((*(uint *)(*(int *)(iVar4 + 4) + 0x14 + (int)in_ECX) & 0x1c0) != 0x40) { for (; iVar5 != 0; iVar5 = iVar5 + -1) { iVar4 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(*in_ECX + 4) + 0x38 + (int)in_ECX), *(char *)(*(int *)(*in_ECX + 4) + 0x40 + (int)in_ECX)); if (iVar4 == -1) goto LAB_00685b00; } iVar4 = *in_ECX; } _Var6 = std::basic_streambuf_>::sputn (*(basic_streambuf_> **) (*(int *)(iVar4 + 4) + 0x38 + (int)in_ECX),in_EDX,(ulonglong)uVar3 << 0x20); if (((uint)_Var6 == param_1) && ((int)((ulonglong)_Var6 >> 0x20) == 0)) { LAB_00685b00: while ((iVar5 != 0 && (iVar4 = std::basic_streambuf_>::sputc (*(basic_streambuf_> **) (*(int *)(*in_ECX + 4) + 0x38 + (int)in_ECX), *(char *)(*(int *)(*in_ECX + 4) + 0x40 + (int)in_ECX)), iVar4 != -1)) ) { iVar5 = iVar5 + -1; } } iVar5 = *(int *)(*in_ECX + 4); *(undefined4 *)(iVar5 + 0x20 + (int)in_ECX) = 0; *(undefined4 *)(iVar5 + 0x24 + (int)in_ECX) = 0; FUN_00685b61(); return; } //@@ 00685b41 Catch_All@00685b41 undefined * Catch_All_00685b41(void) { int unaff_EBP; std::basic_ios_>::setstate ((basic_ios_> *) (*(int *)(**(int **)(unaff_EBP + -0x18) + 4) + (int)*(int **)(unaff_EBP + -0x18)),4, true); return &DAT_00685b5b; } //@@ 00685b61 FUN_00685b61 void FUN_00685b61(void) { int *piVar1; bool bVar2; int *unaff_EBX; int unaff_EBP; int unaff_EDI; *(undefined4 *)(unaff_EBP + -4) = 0; std::basic_ios_>::setstate ((basic_ios_> *)(*(int *)(*unaff_EBX + 4) + (int)unaff_EBX), unaff_EDI,false); *(undefined4 *)(unaff_EBP + -4) = 3; bVar2 = std::uncaught_exception(); if (!bVar2) { std::basic_ostream_>::_Osfx (*(basic_ostream_> **)(unaff_EBP + -0x28)); } *(undefined1 *)(unaff_EBP + -4) = 4; piVar1 = *(int **)(*(int *)(**(int **)(unaff_EBP + -0x28) + 4) + 0x38 + (int)*(int **)(unaff_EBP + -0x28)); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 8))(); } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00685bc0 std::map::_Find_lower_bound /* DB: tree walk from head(this)->parent comparing std::string key (FUN_00423480) storing {node, isLeft, bound} into param_1; callers parse tag/flag name maps (EntityConfig::parse_entity_tags, ItemConfig::parse_cache_flags) */ int * std::map::_Find_lower_bound(int *param_1,byte *param_2) { char cVar1; uint uVar2; uint lengthB; byte *b; int iVar3; int *in_ECX; byte *a; undefined4 *puVar4; iVar3 = *in_ECX; puVar4 = *(undefined4 **)(iVar3 + 4); *param_1 = (int)puVar4; cVar1 = *(char *)((int)puVar4 + 0xd); param_1[1] = 0; param_1[2] = iVar3; if (cVar1 == '\0') { uVar2 = *(uint *)(param_2 + 0x14); lengthB = *(uint *)(param_2 + 0x10); do { *param_1 = (int)puVar4; a = (byte *)(puVar4 + 4); b = param_2; if (0xf < uVar2) { b = *(byte **)param_2; } if (0xf < (uint)puVar4[9]) { a = *(byte **)a; } iVar3 = string_compare(a,puVar4[8],b,lengthB); if (-1 < iVar3) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(-1 < iVar3); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 00685c40 FUN_00685c40 void FUN_00685c40(void) { int *piVar1; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11c0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; piVar1 = *(int **)(*(int *)(*(int *)*in_ECX + 4) + 0x38 + *in_ECX); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 8))(__security_cookie ^ (int)register0x00000010 - 4U); } ExceptionList = local_10; return; } //@@ 00685ca0 FUN_00685ca0 void FUN_00685ca0(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("STEAMREMOTESTORAGE_INTERFACE_VERSION016"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 00685cc0 FUN_00685cc0 undefined4 FUN_00685cc0(void) { return *(undefined4 *)((int)g_luaEngine + 0x18); } //@@ 00685cd0 FUN_00685cd0 void FUN_00685cd0(void) { char *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if (*(void **)(in_ECX + 0x20) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x20),0); } std::string::_Tidy_deallocate(in_ECX); ExceptionList = local_10; return; } //@@ 00685d30 Config::GetTrinkets /* ZHL [lua] Lua binding Config:GetTrinkets */ int Config::GetTrinkets(void) { int in_ECX; return in_ECX + 0xc; } //@@ 00685d40 Config::GetCards /* ZHL [lua] Lua binding Config:GetCards */ int Config::GetCards(void) { int in_ECX; return in_ECX + 0x24; } //@@ 00685d50 FUN_00685d50 int FUN_00685d50(void) { int in_ECX; return in_ECX + 8; } //@@ 00685d60 FUN_00685d60 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00685d60(void) { Random(); Room::SpawnEntry(); return; } //@@ 00685db0 FUN_00685db0 void FUN_00685db0(undefined1 param_1) { undefined1 *in_ECX; *in_ECX = param_1; return; } //@@ 00685dc0 Seeds::GetStartSeedString /* ZHL [lua] Lua binding Seeds:GetStartSeedString */ std_string * Seeds::GetStartSeedString(std_string *param_1) { uint seed; int in_ECX; seed = *(uint *)(in_ECX + 4); if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); seed = *(uint *)(in_ECX + 4); } Seed2String(param_1,seed); return param_1; } //@@ 00685e00 FUN_00685e00 bool FUN_00685e00(void *param_1) { std_string seedString; int iVar1; int in_ECX; char acStackY_b8 [128]; undefined1 in_stack_ffffffcc [12]; undefined4 in_stack_ffffffd8; undefined4 in_stack_ffffffdc; uint in_stack_ffffffe0; int local_c; std::string::string(acStackY_b8 + 0x84,param_1); seedString._buf[0xc] = (char)in_stack_ffffffd8; seedString._buf[0xd] = (char)((uint)in_stack_ffffffd8 >> 8); seedString._buf[0xe] = (char)((uint)in_stack_ffffffd8 >> 0x10); seedString._buf[0xf] = (char)((uint)in_stack_ffffffd8 >> 0x18); seedString._buf[0] = in_stack_ffffffcc[0]; seedString._buf[1] = in_stack_ffffffcc[1]; seedString._buf[2] = in_stack_ffffffcc[2]; seedString._buf[3] = in_stack_ffffffcc[3]; seedString._buf[4] = in_stack_ffffffcc[4]; seedString._buf[5] = in_stack_ffffffcc[5]; seedString._buf[6] = in_stack_ffffffcc[6]; seedString._buf[7] = in_stack_ffffffcc[7]; seedString._buf[8] = in_stack_ffffffcc[8]; seedString._buf[9] = in_stack_ffffffcc[9]; seedString._buf[10] = in_stack_ffffffcc[10]; seedString._buf[0xb] = in_stack_ffffffcc[0xb]; seedString._size = in_stack_ffffffdc; seedString._capacity = in_stack_ffffffe0; iVar1 = Seeds::GetSeedEffect(seedString); std::set::find_node(); if ((*(char *)(local_c + 0xd) == '\0') && (*(int *)(local_c + 0x10) <= iVar1)) { return local_c != *(int *)(in_ECX + 0x54); } return false; } //@@ 00685e70 Seeds::ClearSeedEffects /* ZHL [lua] Lua binding Seeds:ClearSeedEffects */ void __thiscall Seeds::ClearSeedEffects(Seeds *this) { void *pvVar1; pvVar1 = this->_seedEffects; FID_conflict__Erase_tree_>_> (&this->_seedEffects, (fuzzer_allocator_> *)&this->_seedEffects, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; this->_seedEffectsCount = 0; return; } //@@ 00685ea0 Seeds::IsSpecialSeed /* ZHL [lua] Lua binding Seeds:IsSpecialSeed */ bool Seeds::IsSpecialSeed(void *param_1) { int iVar1; char acStackY_a4 [128]; std_string in_stack_ffffffe0; std::string::string(acStackY_a4 + 0x84,param_1); iVar1 = GetSeedEffect(in_stack_ffffffe0); return iVar1 != 0; } //@@ 00685ed0 FUN_00685ed0 Console * FUN_00685ed0(void) { return &g_game->_console; } //@@ 00685ee0 FUN_00685ee0 void FUN_00685ee0(void) { g_game->_isInstantFadeIn = 1; return; } //@@ 00685ef0 FUN_00685ef0 BossPool * FUN_00685ef0(void) { return &g_game->_bossPool; } //@@ 00685f00 FUN_00685f00 int FUN_00685f00(void) { return g_game->_timeCounter; } //@@ 00685f10 FUN_00685f10 void FUN_00685f10(uint param_1) { if (0xd < param_1) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } *(uint *)(g_game->_giantBookClickerImage + (param_1 >> 5) * 4 + 0x24) = *(uint *)(g_game->_giantBookClickerImage + (param_1 >> 5) * 4 + 0x24) ^ 1 << (param_1 & 0x1f) ; return; } //@@ 00685f50 FUN_00685f50 void FUN_00685f50(int param_1) { g_game->_debugCurses = param_1; return; } //@@ 00685f70 FUN_00685f70 int FUN_00685f70(void) { return ((int)(g_manager->_challengeParams)._end - (int)(g_manager->_challengeParams)._begin) / 0xa4; } //@@ 00685fa0 FUN_00685fa0 undefined1 FUN_00685fa0(void) { int *in_ECX; if (((*in_ECX == 5) && (in_ECX[1] == 300)) && (in_ECX[2] != 0)) { return 0; } return 1; } //@@ 00685fc0 Console::destructor /* DB: Game::~Game does LEA ECX,[EDI+0x68d78]; CALL 0x00685fc0 (006f33ab), the console object (FUN_0090d4a0 passes g_game+0x68d78 as Console); destroys 6 strings at +0x74, two owned 8-byte nodes +0x40/+0x54, history containers and a string */ void Console::destructor(void) { void *pvVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0a50; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x74),0x18,6,std::string::_Tidy_deallocate); FUN_006936f0(uVar2); pvVar1 = *(void **)(in_ECX + 0x54); *(undefined4 *)(in_ECX + 0x54) = 0; operator_delete(pvVar1,8); FUN_00693ac0(); pvVar1 = *(void **)(in_ECX + 0x40); *(undefined4 *)(in_ECX + 0x40) = 0; operator_delete(pvVar1,8); FUN_0042f240(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); ExceptionList = local_10; return; } //@@ 00686060 FUN_00686060 void FUN_00686060(void) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *puVar2; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = &DAT_bf800000; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[0x41] = 0; FUN_00686110(); puVar1 = in_ECX + 7; if (0xf < (uint)in_ECX[0xc]) { puVar1 = (undefined4 *)in_ECX[7]; } in_ECX[0xb] = 0; puVar2 = in_ECX + 7; *(undefined1 *)puVar1 = 0; in_ECX[0xe] = in_ECX[0xd]; if (0xf < (uint)in_ECX[0xc]) { puVar2 = (undefined4 *)in_ECX[7]; } in_ECX[0x43] = 0; in_ECX[0x42] = in_ECX[0xb] + (int)puVar2; FUN_006936f0(); Console::LoadCommandHistory(); in_ECX[0x1a] = in_ECX[0x15]; in_ECX[0x1c] = in_ECX[0x18]; return; } //@@ 00686110 FUN_00686110 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00686110(void) { Console *in_ECX; char *ptr; uint size; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af84fd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; FUN_00693ac0(local_24); in_ECX[2] = (Console)0x0; in_ECX[3] = (Console)0x0; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x14; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"Repentance+ Console\n",0x15); local_14 = 0; Console::Print(in_ECX,&local_3c,0xffd3d3d3,0); if (0xf < local_3c._capacity) { size = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_1c; return; } //@@ 00686220 Console::LoadCommandHistory /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=Console: sprintf "%s/%s" g_userDataDir "cmd_history.txt", only when not online/daily (or practice) and OptionsConfig _enableDebugConsole && _enableSaveCommandHistory; SaveDataManager::open_file_read, reads 0x400 chunk, splits lines (isspace trim) into the history deque up to 0x40 entries (+100 count); counterpart of REPENTOGON Console::SaveCommandHistory; caller FUN_00686060 (console init) */ void Console::LoadCommandHistory(void) { byte bVar1; code *pcVar2; uint uVar3; int *file; int iVar4; void *newBlock; int in_ECX; byte *lineEnd; int historyMap; uint uVar5; std_string line; byte lineBuf [1024]; byte historyPath [260]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *entry; puStack_20 = historyPath + 0x124; local_14 = 0xffffffff; puStack_18 = &LAB_00af8540; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(historyPath + 0x118); ExceptionList = &local_1c; local_24 = uVar3; sprintf_s(historyPath,0x100,&DAT_00b60c28); if (((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) && (((g_game == (Game *)0x0 || ((g_game->_dailyChallenge)._id == 0)) || ((g_game->_dailyChallenge)._isPractice != 0)))) && (((g_manager->_optionsConfig)._enableDebugConsole != 0 && ((g_manager->_optionsConfig)._enableSaveCommandHistory != 0)))) { file = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,historyPath); if (file != (int *)0x0) { uVar3 = (**(code **)(*file + 0x18))(lineBuf,0x400,uVar3); while (0 < (int)uVar3) { do { iVar4 = isspace((int)line._buf[uVar3 + 0x17]); if (iVar4 == 0) { if (*(uint *)(in_ECX + 100) < 0x40) { lineEnd = lineBuf; line._size = 0; line._capacity = 0xf; line._buf[0] = '\0'; line._buf[1] = '\0'; line._buf[2] = '\0'; line._buf[3] = '\0'; do { bVar1 = *lineEnd; lineEnd = lineEnd + 1; } while (bVar1 != 0); std::string::assign(line._buf,lineBuf,(int)lineEnd - (int)(lineBuf + 1)); local_14 = 0; iVar4 = *(int *)(in_ECX + 100); uVar3 = *(uint *)(in_ECX + 0x5c); if (uVar3 <= iVar4 + 1U) { FUN_006937a0(uVar3); uVar3 = *(uint *)(in_ECX + 0x5c); iVar4 = *(int *)(in_ECX + 100); } uVar5 = uVar3 - 1 & *(uint *)(in_ECX + 0x60); *(uint *)(in_ECX + 0x60) = uVar5; iVar4 = (uVar3 - 1 & uVar5 + iVar4) * 4; historyMap = *(int *)(in_ECX + 0x58); if (*(int *)(historyMap + iVar4) == 0) { newBlock = operator_new(0x18); *(void **)(iVar4 + *(int *)(in_ECX + 0x58)) = newBlock; historyMap = *(int *)(in_ECX + 0x58); } entry = *(char **)(iVar4 + historyMap); *(undefined4 *)entry = line._buf._0_4_; *(undefined4 *)(entry + 4) = line._buf._4_4_; *(undefined4 *)(entry + 8) = line._buf._8_4_; *(undefined4 *)(entry + 0xc) = line._buf._12_4_; *(uint *)(entry + 0x10) = line._size; *(uint *)(entry + 0x14) = line._capacity; *(int *)(in_ECX + 100) = *(int *)(in_ECX + 100) + 1; local_14 = 0xffffffff; } break; } uVar5 = uVar3 - 1; if (0x3ff < uVar5) { FUN_00aef86f(); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } line._buf[uVar3 + 0x17] = '\0'; uVar3 = uVar5; } while (0 < (int)uVar5); uVar3 = (**(code **)(*file + 0x18))(lineBuf,0x400); } (**(code **)*file)(1); } } else { remove((char *)historyPath); } ExceptionList = local_1c; return; } //@@ 006864a0 Console::history_push /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX = Console; only caller Console::submit_input with the typed line: drops a duplicate of the last history entry, push_front into the history deque (+0x54..+0x70, cursor +0x60/+0x68 reset), then echoes it as a ConsoleLine (color 0xffd3d3d3, 0x96 frames) via std::deque::push_front */ void Console::history_push(void *param_1) { qword qVar1; byte bVar2; int iVar3; byte *b; int slotOffset; void *pvVar4; undefined4 containerProxy; int in_ECX; byte *a; qword *heapCounter; uint uVar5; uint frontOffset; uint in_stack_00000018; char consoleLine [24]; undefined4 lineFrames; undefined4 lineColor; int local_34; undefined4 local_30; void *emptyText [3]; undefined1 eraseResult [4]; undefined4 emptyTextSize; uint emptyTextCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *historyProxy; uint *lastEntrySize; puStack_c = &LAB_00af858d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(eraseResult + 0x1c); ExceptionList = &local_10; local_8 = 0; uVar5 = *(uint *)(in_ECX + 0x70); if (*(uint *)(in_ECX + 0x60) < uVar5) { historyProxy = *(int **)(in_ECX + 0x68); if (historyProxy == (int *)0x0) { iVar3 = 0; } else { iVar3 = *historyProxy; } a = *(byte **)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & uVar5 - 1) * 4); b = (byte *)(in_ECX + 0x1c); if (0xf < *(uint *)(in_ECX + 0x30)) { b = *(byte **)b; } lastEntrySize = (uint *)(a + 0x10); if (0xf < *(uint *)(a + 0x14)) { a = *(byte **)a; } bVar2 = str_eq(a,*lastEntrySize,b,*(uint *)(in_ECX + 0x2c)); if (bVar2 != 0) { FUN_006938e0(eraseResult,historyProxy,0,uVar5 - 1,historyProxy,0,uVar5); } } uVar5 = *(uint *)(in_ECX + 0x5c); if (uVar5 <= *(int *)(in_ECX + 100) + 1U) { FUN_006937a0(uVar5); uVar5 = *(uint *)(in_ECX + 0x5c); } frontOffset = uVar5 - 1 & *(uint *)(in_ECX + 0x60); *(uint *)(in_ECX + 0x60) = frontOffset; if (frontOffset == 0) { frontOffset = uVar5; } iVar3 = *(int *)(in_ECX + 0x58); frontOffset = frontOffset - 1; slotOffset = (uVar5 - 1 & frontOffset) * 4; if (*(int *)(iVar3 + slotOffset) == 0) { pvVar4 = operator_new(0x18); *(void **)(slotOffset + *(int *)(in_ECX + 0x58)) = pvVar4; iVar3 = *(int *)(in_ECX + 0x58); } std::string::string(*(char **)(iVar3 + slotOffset),¶m_1); *(int *)(in_ECX + 100) = *(int *)(in_ECX + 100) + 1; *(uint *)(in_ECX + 0x60) = frontOffset; if ((undefined4 *)(in_ECX + 0x54) == (undefined4 *)0x0) { containerProxy = 0; } else { containerProxy = *(undefined4 *)(in_ECX + 0x54); } *(undefined4 *)(in_ECX + 0x68) = containerProxy; *(uint *)(in_ECX + 0x70) = frontOffset; if ((*(int *)(in_ECX + 0x50) != 0) && (*(int *)(*(int *)(*(int *)(in_ECX + 0x44) + (*(int *)(in_ECX + 0x48) - 1U & *(uint *)(in_ECX + 0x4c)) * 4) + 0x10) != 0)) { emptyTextSize = 0; emptyTextCapacity = 0xf; emptyText[0] = (void *)0x0; local_8._0_1_ = 1; std::string::string(consoleLine,emptyText); lineFrames = 0x96; lineColor = 0xffd3d3d3; local_34 = 0; local_30 = 1; local_8 = CONCAT31(local_8._1_3_,2); std::deque::push_front(consoleLine); if (local_34 != 0) { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(local_34 + -4); qVar1 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar5; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar1 < uVar5); free((void *)(local_34 + -4)); } std::string::_Tidy_deallocate(consoleLine); local_8 = local_8 & 0xffffff00; if (0xf < emptyTextCapacity) { uVar5 = emptyTextCapacity + 1; pvVar4 = emptyText[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)emptyText[0] + -4); uVar5 = emptyTextCapacity + 0x24; if (0x1f < (uint)((int)emptyText[0] + (-4 - (int)pvVar4))) goto LAB_006866f9; } operator_delete(pvVar4,uVar5); } } FUN_00693180(); if (0xf < in_stack_00000018) { uVar5 = in_stack_00000018 + 1; pvVar4 = param_1; if (0xfff < uVar5) { pvVar4 = *(void **)((int)param_1 + -4); uVar5 = in_stack_00000018 + 0x24; if (0x1f < (uint)((int)param_1 + (-4 - (int)pvVar4))) { LAB_006866f9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } ExceptionList = local_10; return; } //@@ 00686730 FUN_00686730 void FUN_00686730(undefined4 param_1,uint param_2) { Game *pGVar1; int *piVar2; int iVar3; int *piVar4; pGVar1 = g_game; if ((((g_game != (Game *)0x0) && (g_game->_console == (Console)0x2)) && (0x1f < param_2)) && (param_2 < 0x80)) { piVar4 = &g_game[1]._roomList[0].SafeGridIndex; piVar2 = piVar4; if (0xf < (uint)g_game[1]._roomList[0].AllowedDoors) { piVar2 = (int *)*piVar4; } iVar3 = g_game[1]._roomList[1]._doors[7] - (int)piVar2; FUN_00693d20(iVar3,piVar2,param_2); if (0xf < (uint)pGVar1[1]._roomList[0].AllowedDoors) { piVar4 = (int *)*piVar4; } pGVar1[1]._roomList[1].DisplayFlags = 0; pGVar1[1]._roomList[1]._doors[7] = iVar3 + 1 + (int)piVar4; FUN_006924d0(); } return; } //@@ 006867b0 FUN_006867b0 Font * FUN_006867b0(void) { int iVar1; iVar1 = (g_manager->_optionsConfig)._consoleFont; if (iVar1 != 0) { if (iVar1 == 1) { return &g_manager->_font5_terminus8; } if (iVar1 == 2) { return &g_manager->_font8_LuaMiniOutlined; } } return &g_manager->_font4_terminus; } //@@ 006867e0 Console::get_visible_line_range /* DB: ? (out pair): from the history deque (+0x44..+0x50) and console font size option (0xf/0xc/8 px) computes the first/last visible lines for the screen height; Console::Update, Console::Print */ void Console::get_visible_line_range(uint *param_1) { uint uVar1; bool bVar2; int iVar3; int in_ECX; uint *puVar4; int iVar5; int iVar6; uint local_20; int local_1c; uint local_18 [5]; local_20 = *(uint *)(in_ECX + 0x50); if (local_20 == 0) { *param_1 = 0; param_1[1] = 0; return; } iVar3 = (g_manager->_optionsConfig)._consoleFont; if (iVar3 != 0) { if (iVar3 == 1) { iVar3 = 0xc; goto LAB_00686833; } if (iVar3 == 2) { iVar3 = 8; goto LAB_00686833; } } iVar3 = 0xf; LAB_00686833: local_18[2] = *(int *)(in_ECX + 0x4c); local_1c = 0; iVar5 = (int)(g_screenHeight / ((float)iVar3 + 0.0)) + -7; iVar3 = *(int *)(in_ECX + 0x50) + local_18[2]; do { local_20 = local_20 - 1; if (iVar3 == local_18[2]) { local_1c = 0; LAB_006868b5: local_18[1] = 0; local_18[0] = (uint)(*(int *)(*(int *)(*(int *)(in_ECX + 0x44) + (*(int *)(in_ECX + 0x48) - 1U & *(uint *)(in_ECX + 0x4c) ) * 4) + 0x10) == 0); if (((int)local_20 < (int)local_18[0]) || ((local_20 == local_18[0] && (local_1c < 0)))) { bVar2 = true; } else { bVar2 = false; } puVar4 = local_18; if (!bVar2) { puVar4 = &local_20; } uVar1 = puVar4[1]; *param_1 = *puVar4; param_1[1] = uVar1; return; } if (*(int **)(in_ECX + 0x40) == (int *)0x0) { iVar6 = 0; } else { iVar6 = **(int **)(in_ECX + 0x40); } local_1c = *(int *)(*(int *)(*(int *)(iVar6 + 4) + (*(int *)(iVar6 + 8) - 1U & iVar3 - 1U) * 4) + 0x24); if (iVar5 <= local_1c) { local_1c = local_1c - iVar5; goto LAB_006868b5; } iVar5 = iVar5 - local_1c; iVar3 = iVar3 + -1; } while( true ); } //@@ 00686910 FUN_00686910 void FUN_00686910(undefined4 *param_1) { int in_ECX; if ((*(int *)(in_ECX + 0x50) == 0) || (*(int *)(*(int *)(*(int *)(in_ECX + 0x44) + (*(int *)(in_ECX + 0x48) - 1U & *(uint *)(in_ECX + 0x4c)) * 4) + 0x10) != 0)) { *param_1 = 0; param_1[1] = 0; return; } *param_1 = 1; param_1[1] = 0; return; } //@@ 00686950 Console::Close /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? state > 1 -> state 4 (closing), then when the debug console and enableSaveCommandHistory are on (no daily run) writes the history deque to /cmd_history.txt or removes it when empty (REPENTOGON's SaveCommandHistory is probably inlined here; frame differs from its sig); caller Console::Update */ void Console::Close(void) { int *piVar1; Manager *pMVar2; int *piVar3; int iVar4; int iVar5; int *piVar6; uint *in_ECX; uint uVar7; byte local_10c [260]; undefined4 local_8; pMVar2 = g_manager; local_8 = __security_cookie ^ (uint)(local_10c + 0x108); if (1 < *in_ECX) { *in_ECX = 4; in_ECX[1] = 0; pMVar2->_isHotkeysEnabled = 1; if (((pMVar2->_netplayManager == *(NetplayManager *)(pMVar2 + 1)) && (((g_game == (Game *)0x0 || ((g_game->_dailyChallenge)._id == 0)) || ((g_game->_dailyChallenge)._isPractice != 0)))) && (((pMVar2->_optionsConfig)._enableDebugConsole != 0 && ((pMVar2->_optionsConfig)._enableSaveCommandHistory != 0)))) { sprintf_s(local_10c,0x100,&DAT_00b60c28); if (in_ECX[0x19] == 0) { remove((char *)local_10c); return; } piVar3 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_10c,0); if (piVar3 != (int *)0x0) { piVar1 = (int *)in_ECX[0x15]; for (uVar7 = in_ECX[0x18]; uVar7 != in_ECX[0x19] + in_ECX[0x18]; uVar7 = uVar7 + 1) { if (piVar1 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *piVar1; } if (piVar1 == (int *)0x0) { iVar5 = 0; } else { iVar5 = *piVar1; } piVar6 = *(int **)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & uVar7) * 4); if (0xf < (uint)piVar6[5]) { piVar6 = (int *)*piVar6; } (*(code *)((undefined4 *)*piVar3)[7]) (piVar6,1,*(undefined4 *) (*(int *)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & uVar7) * 4) + 0x10)); (**(code **)(*piVar3 + 0x1c))(&DAT_00b657f8,1,2); } (**(code **)*piVar3)(1); } } } return; } //@@ 00686ad0 FUN_00686ad0 undefined4 FUN_00686ad0(int param_1) { int iVar1; char cVar2; int in_ECX; iVar1 = param_1; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,¶m_1,0,0); if (cVar2 == '\0') { if (*(int *)(in_ECX + 0x14) == iVar1) { *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; } } else { if (*(int *)(in_ECX + 0x14) == iVar1) { *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + 1; } else { *(int *)(in_ECX + 0x14) = iVar1; *(undefined4 *)(in_ECX + 0x18) = 0; } param_1 = iVar1; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,¶m_1,0,0); if ((cVar2 != '\0') || (((*(int *)(in_ECX + 0x14) == iVar1 && (0x13 < *(uint *)(in_ECX + 0x18))) && ((*(uint *)(in_ECX + 0x18) & 1) == 0)))) { return 1; } } return 0; } //@@ 00686b70 Console::submit_input /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=Console: counts spaces in the input string at +0x1c (len +0x2c), when not blank copies it to history (FUN_006864a0) and calls Console::RunCommand; from Console::Update on Enter */ void Console::submit_input(void) { int iVar1; std_string *where; undefined4 uVar2; undefined4 uVar3; char isLocalPlayer; char *inputEnd; int iVar4; undefined4 uVar5; int in_ECX; char *cursor; NetplayManager netPlayers; void *ptr; char *inputText; uint uVar6; char historyEntry [8]; undefined4 uStack_64; void **ppvStack_60; int *inputSize; void *command; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = historyEntry + 0x68; local_14 = 0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(historyEntry + 0x5c); ExceptionList = &local_1c; inputText = (char *)(in_ECX + 0x1c); if (*(uint *)(in_ECX + 0x30) < 0x10) { inputEnd = inputText + *(int *)(in_ECX + 0x2c); cursor = inputText; } else { inputEnd = *(char **)inputText + *(int *)(in_ECX + 0x2c); cursor = *(char **)inputText; } inputSize = (int *)(in_ECX + 0x2c); iVar1 = 0; for (; cursor != inputEnd; cursor = cursor + 1) { iVar4 = iVar1 + 1; if (*cursor != ' ') { iVar4 = iVar1; } iVar1 = iVar4; } if (iVar1 != *(int *)(in_ECX + 0x2c)) { std::string::string(historyEntry,inputText); history_push(); local_14 = 0; command = *(void **)inputText; uVar5 = *(undefined4 *)(in_ECX + 0x20); uVar2 = *(undefined4 *)(in_ECX + 0x24); uVar3 = *(undefined4 *)(in_ECX + 0x28); local_2c = *(undefined8 *)(in_ECX + 0x2c); inputText[0] = '\0'; inputText[1] = '\0'; inputText[2] = '\0'; inputText[3] = '\0'; *(undefined4 *)(in_ECX + 0x20) = uStack_38; *(undefined4 *)(in_ECX + 0x24) = uStack_34; *(undefined4 *)(in_ECX + 0x28) = uStack_30; *(undefined8 *)(in_ECX + 0x2c) = 0xf00000000; *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(in_ECX + 0x34); if (0xf < *(uint *)(in_ECX + 0x30)) { inputText = *(char **)inputText; } *(char **)(in_ECX + 0x108) = inputText + *inputSize; manager = g_manager; netPlayers = g_manager->_netplayManager; uStack_38 = uVar5; uStack_34 = uVar2; uStack_30 = uVar3; if (netPlayers == *(NetplayManager *)(g_manager + 1)) { ppvStack_60 = &command; uStack_64 = 0x686d01; RunCommand(); } else { uVar6 = 0; if ((int)*(NetplayManager *)(g_manager + 1) - (int)netPlayers >> 2 != 0) { do { iVar1 = *(int *)((int)netPlayers + uVar6 * 4); isLocalPlayer = (**(code **)(*(int *)(iVar1 + 0x370) + 0x14))(); if (isLocalPlayer != '\0') { where = *(std_string **)(iVar1 + 0x3dc); if (where == *(std_string **)(iVar1 + 0x3e0)) { ppvStack_60 = (void **)0x686cf0; vector_string_emplace_reallocate((void *)(iVar1 + 0x3d8),where,&command); } else { std::string::string(where->_buf,&command); *(int *)(iVar1 + 0x3dc) = *(int *)(iVar1 + 0x3dc) + 0x18; } break; } uVar6 = uVar6 + 1; netPlayers = manager->_netplayManager; } while (uVar6 < (uint)(*(int *)(manager + 1) - (int)netPlayers >> 2)); } } if ((*(int *)(in_ECX + 0x50) == 0) || (*(int *)(*(int *)(*(int *)(in_ECX + 0x44) + (*(int *)(in_ECX + 0x48) - 1U & *(uint *)(in_ECX + 0x4c)) * 4) + 0x10) != 0 )) { uVar5 = 0; } else { uVar5 = 1; } *(undefined4 *)(in_ECX + 8) = uVar5; *(undefined4 *)(in_ECX + 0xc) = 0; if (0xf < local_2c._4_4_) { uVar6 = local_2c._4_4_ + 1; ptr = command; if (0xfff < uVar6) { ptr = *(void **)((int)command + -4); uVar6 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)command + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } ppvStack_60 = (void **)0x686d60; operator_delete(ptr,uVar6); } } ExceptionList = local_1c; return; } //@@ 00686da0 Console::FillOmnicomplete /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void Console::FillOmnicomplete(); */ void __thiscall Console::FillOmnicomplete(void) { byte bVar1; char cVar2; undefined4 *newNode; int iVar3; char *pcVar4; std_string *psVar5; undefined4 *puVar6; EntityConfig_Entity *entityConfigEntry; ItemConfig_Item **ppIVar7; uint *doorMask; int iVar8; ItemConfig_Card *cardConfig; Manager *pMVar9; void *pvVar10; Font *font; byte unused; byte unused_00; byte *nameEnd; byte *pbVar11; SimpleString freeBlock; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 extraout_ECX_03; undefined4 extraout_ECX_04; ItemConfig *itemConfig; undefined4 extraout_ECX_05; undefined4 extraout_ECX_06; undefined4 extraout_ECX_07; undefined4 extraout_ECX_08; uint uVar12; uint uVar13; int extraout_EDX; undefined4 extraout_EDX_00; undefined4 extraout_EDX_01; ItemConfig_Item **roomVariantPtr; basic_string,std::allocator_> *omnicompleteText; ItemConfig_Item *pIVar14; int *listNode; ItemConfig_Item *maxRoomVariant; EntityConfig_Entity *pEVar15; undefined8 uVar16; undefined4 uVar17; undefined4 uVar18; undefined4 *gridEntityNames; undefined4 *curseNames; undefined4 *commandNames; int *roomTypeNames; int roomTypeNameCount; undefined1 local_204 [4]; undefined1 local_200 [4]; undefined1 local_1fc [4]; undefined1 local_1f8 [4]; undefined1 local_1f4 [4]; undefined1 local_1f0 [4]; int **local_1ec; undefined4 local_1e8; EntityConfig_Entity *local_1e4; Manager *local_1e0; ItemConfig_Item *local_1dc; uint cleanupFlags; undefined1 local_1d2; undefined1 local_1d1; undefined1 local_1d0 [4]; int *debugFlagNames; undefined4 debugFlagNameCount; ItemConfig_Item *local_1c4; char local_1bd; EntityConfig_Entity *local_1bc; char local_1ac [24]; std_string local_194; std_string local_17c; basic_string,std::allocator_> local_164 [8]; byte stageIdText [4]; EntityConfig_Entity *rooms; EntityConfig_Entity *roomsEnd; basic_string,std::allocator_> local_14c [24]; byte completionEntry [128]; byte local_b4 [32]; byte idText [32]; byte cardIdText [8]; std_string local_6c; byte debugFlagText [32]; byte pillIdText [8]; SimpleString tmpString [2]; byte roomIdText [8]; undefined4 tmpStringSize; uint tmpStringCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; RoomConfig *roomConfig; ItemConfig_Item *roomVariant; local_8 = 0xffffffff; puStack_c = &LAB_00af8e99; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(roomIdText + 0x20); ExceptionList = &local_10; cleanupFlags = 0; local_1c4 = *(ItemConfig_Item **)ThreadLocalStoragePointer; if ((*(int *)((local_1c4->name)._buf + 4) < DAT_00c80250) && (_Init_thread_header(&DAT_00c80250,local_14), DAT_00c80250 == -1)) { _DAT_00c5cab8 = 0x77617073; DAT_00c5cabc = 0x6e; DAT_00c5cae8 = 's'; DAT_00c5cae8_1._0_1_ = 't'; DAT_00c5cae8_1._1_1_ = 'a'; DAT_00c5cae8_1._2_1_ = 'g'; DAT_00c5caec = 0x65; _DAT_00c5cb00 = 0x7761707364697267; DAT_00c5cb08 = 0x6e; DAT_00c5cb18 = 'd'; DAT_00c5cb18_1._0_1_ = 'e'; DAT_00c5cb18_1._1_1_ = 'b'; DAT_00c5cb18_1._2_1_ = 'u'; DAT_00c5cb1c = 0x67; DAT_00c5cb30 = 'g'; DAT_00c5cb30_1._0_1_ = 'i'; DAT_00c5cb30_1._1_1_ = 'v'; DAT_00c5cb30_1._2_1_ = 'e'; DAT_00c5cb34 = 'i'; DAT_00c5cb34_1._0_1_ = 't'; DAT_00c5cb34_1._1_1_ = 'e'; DAT_00c5cb34_1._2_1_ = 'm'; DAT_00c5cb48 = 'r'; DAT_00c5cb48_1._0_1_ = 'e'; DAT_00c5cb48_1._1_1_ = 'm'; DAT_00c5cb48_1._2_1_ = 'o'; _DAT_00c5cb4c = 0x6576; local_8 = 6; std::string::assign(&DAT_00c5cb60,(byte *)"costumetest",0xb); local_8._0_1_ = 7; _DAT_00c5cb88 = 0; _DAT_00c5cb8c = 0xf; _DAT_00c5cb78 = 0; std::string::assign(&DAT_00c5cb78,&DAT_00b65858,4); local_8._0_1_ = 8; _DAT_00c5cba0 = 0; _DAT_00c5cba4 = 0xf; _DAT_00c5cb90 = 0; std::string::assign(&DAT_00c5cb90,(byte *)"restart",7); local_8._0_1_ = 9; _DAT_00c5cbb8 = 0; _DAT_00c5cbbc = 0xf; _DAT_00c5cba8 = 0; std::string::assign(&DAT_00c5cba8,(byte *)"listcollectibles",0x10); local_8._0_1_ = 10; _DAT_00c5cbd0 = 0; _DAT_00c5cbd4 = 0xf; _DAT_00c5cbc0 = 0; std::string::assign(&DAT_00c5cbc0,(byte *)"repeat",6); local_8._0_1_ = 0xb; _DAT_00c5cbe8 = 0; _DAT_00c5cbec = 0xf; _DAT_00c5cbd8 = 0; std::string::assign(&DAT_00c5cbd8,(byte *)"clearseeds",10); local_8._0_1_ = 0xc; _DAT_00c5cc00 = 0; _DAT_00c5cc04 = 0xf; _DAT_00c5cbf0 = 0; std::string::assign(&DAT_00c5cbf0,&DAT_00b658e4,4); local_8._0_1_ = 0xd; _DAT_00c5cc18 = 0; _DAT_00c5cc1c = 0xf; _DAT_00c5cc08 = 0; std::string::assign(&DAT_00c5cc08,(byte *)"challenge",9); local_8._0_1_ = 0xe; _DAT_00c5cc30 = 0; _DAT_00c5cc34 = 0xf; _DAT_00c5cc20 = 0; std::string::assign(&DAT_00c5cc20,(byte *)"combo",5); local_8._0_1_ = 0xf; _DAT_00c5cc48 = 0; _DAT_00c5cc4c = 0xf; _DAT_00c5cc38 = 0; std::string::assign(&DAT_00c5cc38,(byte *)"cutscene",8); local_8._0_1_ = 0x10; _DAT_00c5cc60 = 0; _DAT_00c5cc64 = 0xf; _DAT_00c5cc50 = 0; std::string::assign(&DAT_00c5cc50,(byte *)"clearcache",10); local_8._0_1_ = 0x11; _DAT_00c5cc78 = 0; _DAT_00c5cc7c = 0xf; _DAT_00c5cc68 = 0; std::string::assign(&DAT_00c5cc68,(byte *)"macro",5); local_8._0_1_ = 0x12; _DAT_00c5cc90 = 0; _DAT_00c5cc94 = 0xf; _DAT_00c5cc80 = 0; std::string::assign(&DAT_00c5cc80,(byte *)"playsfx",7); local_8._0_1_ = 0x13; _DAT_00c5cca8 = 0; _DAT_00c5ccac = 0xf; _DAT_00c5cc98 = 0; std::string::assign(&DAT_00c5cc98,&DAT_00b6591c,4); local_8._0_1_ = 0x14; _DAT_00c5ccc0 = 0; _DAT_00c5ccc4 = 0xf; _DAT_00c5ccb0 = 0; std::string::assign(&DAT_00c5ccb0,(byte *)"profstop",8); local_8._0_1_ = 0x15; _DAT_00c5ccd8 = 0; _DAT_00c5ccdc = 0xf; _DAT_00c5ccc8 = 0; std::string::assign(&DAT_00c5ccc8,(byte *)"curse",5); local_8._0_1_ = 0x16; _DAT_00c5ccf0 = 0; _DAT_00c5ccf4 = 0xf; _DAT_00c5cce0 = 0; std::string::assign(&DAT_00c5cce0,(byte *)"reseed",6); local_8._0_1_ = 0x17; _DAT_00c5cd08 = 0; _DAT_00c5cd0c = 0xf; _DAT_00c5ccf8 = 0; std::string::assign(&DAT_00c5ccf8,&DAT_00b658fc,4); local_8._0_1_ = 0x18; _DAT_00c5cd20 = 0; _DAT_00c5cd24 = 0xf; _DAT_00c5cd10 = 0; std::string::assign(&DAT_00c5cd10,&DAT_00b65904,4); local_8._0_1_ = 0x19; _DAT_00c5cd38 = 0; _DAT_00c5cd3c = 0xf; _DAT_00c5cd28 = 0; std::string::assign(&DAT_00c5cd28,(byte *)"clear",5); local_8._0_1_ = 0x1a; _DAT_00c5cd50 = 0; _DAT_00c5cd54 = 0xf; _DAT_00c5cd40 = 0; std::string::assign(&DAT_00c5cd40,(byte *)"metro",5); local_8 = CONCAT31(local_8._1_3_,0x1b); _DAT_00c5cd68 = 0; _DAT_00c5cd6c = 0xf; _DAT_00c5cd58 = 0; std::string::assign(&DAT_00c5cd58,(byte *)"delirious",9); local_8 = 0xffffffff; _atexit(FUN_00b15690); _Init_thread_footer(&DAT_00c80250); } FUN_00693f00(&DAT_00c5cab8,&DAT_00c5cd70); local_8 = 0x1c; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; std::string::assign((char *)tmpString,(byte *)"luarun",6); local_8._0_1_ = 0x1d; list_string_push_back_move(tmpString); local_8._0_1_ = 0x1c; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; std::string::assign((char *)tmpString,(byte *)"luamem",6); local_8._0_1_ = 0x1e; list_string_push_back_move(tmpString); local_8._0_1_ = 0x1c; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; std::string::assign((char *)tmpString,(byte *)"luamod",6); local_8._0_1_ = 0x1f; list_string_push_back_move(tmpString); local_8._0_1_ = 0x1c; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; std::string::assign((char *)tmpString,(byte *)"reloadshaders",0xd); local_8._0_1_ = 0x20; list_string_push_back_move(tmpString); local_8._0_1_ = 0x1c; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; std::string::assign((char *)tmpString,(byte *)"reloadfx",8); local_8._0_1_ = 0x21; list_string_push_back_move(tmpString); local_8._0_1_ = 0x1c; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; std::string::assign((char *)tmpString,&DAT_00b659d8,3); local_8._0_1_ = 0x22; list_string_push_back_move(tmpString); local_8._0_1_ = 0x1c; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } roomTypeNames = (int *)0x0; roomTypeNameCount = 0; roomTypeNames = operator_new(0x20); *roomTypeNames = (int)roomTypeNames; roomTypeNames[1] = (int)roomTypeNames; local_8._0_1_ = 0x23; uVar12 = 1; do { if (((int)uVar12 < 0) || (0x1d < uVar12)) { pbVar11 = &s_empty; } else { pbVar11 = (&PTR_DAT_00b1fd50)[uVar12]; } if (*pbVar11 != 0) { tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; nameEnd = pbVar11; do { bVar1 = *nameEnd; nameEnd = nameEnd + 1; } while (bVar1 != 0); std::string::assign((char *)tmpString,pbVar11,(int)nameEnd - (int)(pbVar11 + 1)); listNode = roomTypeNames; local_8 = CONCAT31(local_8._1_3_,0x24); if (roomTypeNameCount == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_1ec = &roomTypeNames; local_8._0_1_ = 0x25; local_1e8 = 0; newNode = operator_new(0x20); FUN_00417100(tmpString); roomTypeNameCount = roomTypeNameCount + 1; puVar6 = (undefined4 *)listNode[1]; *newNode = listNode; newNode[1] = puVar6; local_8._0_1_ = 0x23; listNode[1] = (int)newNode; local_1e8 = 0; *puVar6 = newNode; if (0xf < tmpStringCapacity) { uVar13 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar13) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar13 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar13); } } pIVar14 = local_1c4; uVar12 = uVar12 + 1; } while (uVar12 < 0x1f); if ((*(int *)((local_1c4->name)._buf + 4) < DAT_00c80254) && (_Init_thread_header(&DAT_00c80254), DAT_00c80254 == -1)) { std::string::assign(&DAT_00c5cd70,(byte *)"1000:Rock",9); local_8._0_1_ = 0x26; _DAT_00c5cd98 = 0; _DAT_00c5cd9c = 0xf; _DAT_00c5cd88 = 0; std::string::assign(&DAT_00c5cd88,(byte *)"1001:Rock Bomb",0xe); local_8._0_1_ = 0x27; _DAT_00c5cdb0 = 0; _DAT_00c5cdb4 = 0xf; _DAT_00c5cda0 = 0; std::string::assign(&DAT_00c5cda0,(byte *)"1002:Alt Rock",0xd); local_8._0_1_ = 0x28; _DAT_00c5cdc8 = 0; _DAT_00c5cdcc = 0xf; _DAT_00c5cdb8 = 0; std::string::assign(&DAT_00c5cdb8,(byte *)"1003:Tainted Rock",0x11); local_8._0_1_ = 0x29; _DAT_00c5cde0 = 0; _DAT_00c5cde4 = 0xf; _DAT_00c5cdd0 = 0; std::string::assign(&DAT_00c5cdd0,(byte *)"1004:Super Tainted Rock",0x17); local_8._0_1_ = 0x2a; _DAT_00c5cdf8 = 0; _DAT_00c5cdfc = 0xf; _DAT_00c5cde8 = 0; std::string::assign(&DAT_00c5cde8,(byte *)"1300:TNT",8); local_8._0_1_ = 0x2b; _DAT_00c5ce10 = 0; _DAT_00c5ce14 = 0xf; _DAT_00c5ce00 = 0; std::string::assign(&DAT_00c5ce00,(byte *)"1400:Fireplace1498:White Poop",0x1d); local_8._0_1_ = 0x2c; _DAT_00c5ce28 = 0; _DAT_00c5ce2c = 0xf; _DAT_00c5ce18 = 0; std::string::assign(&DAT_00c5ce18,(byte *)"1497:Black Poop",0xf); local_8._0_1_ = 0x2d; _DAT_00c5ce40 = 0; _DAT_00c5ce44 = 0xf; _DAT_00c5ce30 = 0; std::string::assign(&DAT_00c5ce30,(byte *)"1496:Golden Poop",0x10); local_8._0_1_ = 0x2e; _DAT_00c5ce58 = 0; _DAT_00c5ce5c = 0xf; _DAT_00c5ce48 = 0; std::string::assign(&DAT_00c5ce48,(byte *)"1495:Chunky Poop",0x10); local_8._0_1_ = 0x2f; _DAT_00c5ce70 = 0; _DAT_00c5ce74 = 0xf; _DAT_00c5ce60 = 0; std::string::assign(&DAT_00c5ce60,(byte *)"1494:Rainbow Poop",0x11); local_8._0_1_ = 0x30; _DAT_00c5ce88 = 0; _DAT_00c5ce8c = 0xf; _DAT_00c5ce78 = 0; std::string::assign(&DAT_00c5ce78,(byte *)"1490:Red Poop",0xd); local_8._0_1_ = 0x31; _DAT_00c5cea0 = 0; _DAT_00c5cea4 = 0xf; _DAT_00c5ce90 = 0; std::string::assign(&DAT_00c5ce90,(byte *)"1500:Brown Poop",0xf); local_8._0_1_ = 0x32; _DAT_00c5ceb8 = 0; _DAT_00c5cebc = 0xf; _DAT_00c5cea8 = 0; std::string::assign(&DAT_00c5cea8,(byte *)"1900:Block",10); local_8._0_1_ = 0x33; _DAT_00c5ced0 = 0; _DAT_00c5ced4 = 0xf; _DAT_00c5cec0 = 0; std::string::assign(&DAT_00c5cec0,(byte *)"1930:Spikes",0xb); local_8._0_1_ = 0x34; _DAT_00c5cee8 = 0; _DAT_00c5ceec = 0xf; _DAT_00c5ced8 = 0; std::string::assign(&DAT_00c5ced8,(byte *)"1931:On/Off Spikes",0x12); local_8._0_1_ = 0x35; _DAT_00c5cf00 = 0; _DAT_00c5cf04 = 0xf; _DAT_00c5cef0 = 0; std::string::assign(&DAT_00c5cef0,(byte *)"1940:Spider Web",0xf); local_8._0_1_ = 0x36; _DAT_00c5cf18 = 0; _DAT_00c5cf1c = 0xf; _DAT_00c5cf08 = 0; std::string::assign(&DAT_00c5cf08,(byte *)"3000:Pit",8); local_8._0_1_ = 0x37; _DAT_00c5cf30 = 0; _DAT_00c5cf34 = 0xf; _DAT_00c5cf20 = 0; std::string::assign(&DAT_00c5cf20,(byte *)"4000:Lock",9); local_8._0_1_ = 0x38; _DAT_00c5cf48 = 0; _DAT_00c5cf4c = 0xf; _DAT_00c5cf38 = 0; std::string::assign(&DAT_00c5cf38,(byte *)"4500:Pressure Plate",0x13); local_8._0_1_ = 0x39; _DAT_00c5cf60 = 0; _DAT_00c5cf64 = 0xf; _DAT_00c5cf50 = 0; std::string::assign(&DAT_00c5cf50,(byte *)"4500.1:Reward Plate",0x13); local_8._0_1_ = 0x3a; _DAT_00c5cf78 = 0; _DAT_00c5cf7c = 0xf; _DAT_00c5cf68 = 0; std::string::assign(&DAT_00c5cf68,(byte *)"5000:Devil Statue",0x11); local_8._0_1_ = 0x3b; _DAT_00c5cf90 = 0; _DAT_00c5cf94 = 0xf; _DAT_00c5cf80 = 0; std::string::assign(&DAT_00c5cf80,(byte *)"5001:Angel Statue",0x11); local_8._0_1_ = 0x3c; _DAT_00c5cfa8 = 0; _DAT_00c5cfac = 0xf; _DAT_00c5cf98 = 0; std::string::assign(&DAT_00c5cf98,(byte *)"9000:Trap Door",0xe); local_8._0_1_ = 0x3d; _DAT_00c5cfc0 = 0; _DAT_00c5cfc4 = 0xf; _DAT_00c5cfb0 = 0; std::string::assign(&DAT_00c5cfb0,(byte *)"9100:Staircase",0xe); local_8._0_1_ = 0x3e; _DAT_00c5cfd8 = 0; _DAT_00c5cfdc = 0xf; _DAT_00c5cfc8 = 0; std::string::assign(&DAT_00c5cfc8,(byte *)"10000:Gravity",0xd); local_8._0_1_ = 0x23; _atexit(FUN_00b15670); _Init_thread_footer(&DAT_00c80254); } FUN_00693f00(&DAT_00c5cd70,&DAT_00c5cfe0); local_8._0_1_ = 0x3f; uVar17 = 0x20; debugFlagNames = (int *)0x0; debugFlagNameCount = 0; debugFlagNames = operator_new(0x20); *debugFlagNames = (int)debugFlagNames; debugFlagNames[1] = (int)debugFlagNames; local_8._0_1_ = 0x40; std::list::resize(uVar17); sprintf_s(debugFlagText,0x20,(byte *)"%d:Entity Positions"); pbVar11 = debugFlagText; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)tmpString,debugFlagText,(int)pbVar11 - (int)(debugFlagText + 1)); local_8._0_1_ = 0x41; list_string_push_back_move(tmpString); local_8._0_1_ = 0x40; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } sprintf_s(debugFlagText,0x20,(byte *)"%d:Grid"); pbVar11 = debugFlagText; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)tmpString,debugFlagText,(int)pbVar11 - (int)(debugFlagText + 1)); local_8._0_1_ = 0x42; list_string_push_back_move(tmpString); local_8._0_1_ = 0x40; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } sprintf_s(debugFlagText,0x20,(byte *)"%d:Infinite HP"); pbVar11 = debugFlagText; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)tmpString,debugFlagText,(int)pbVar11 - (int)(debugFlagText + 1)); local_8._0_1_ = 0x43; list_string_push_back_move(tmpString); local_8._0_1_ = 0x40; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) goto LAB_006874b3; } operator_delete((void *)freeBlock,uVar12); } sprintf_s(debugFlagText,0x20,(byte *)"%d:High Damage"); pbVar11 = debugFlagText; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)tmpString,debugFlagText,(int)pbVar11 - (int)(debugFlagText + 1)); local_8._0_1_ = 0x44; list_string_push_back_move(tmpString); local_8._0_1_ = 0x40; if (0xf < tmpStringCapacity) { uVar12 = tmpStringCapacity + 1; freeBlock = tmpString[0]; if (0xfff < uVar12) { freeBlock = *(SimpleString *)((int)tmpString[0] + -4); uVar12 = tmpStringCapacity + 0x24; if (0x1f < ((int)tmpString[0] - (int)freeBlock) - 4U) { LAB_006874b3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)freeBlock,uVar12); } sprintf_s(debugFlagText,0x20,(byte *)"%d:Show Room Info"); pbVar11 = debugFlagText; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)tmpString,debugFlagText,(int)pbVar11 - (int)(debugFlagText + 1)); local_8._0_1_ = 0x45; list_string_push_back_move(tmpString); local_8._0_1_ = 0x40; if (0xf < tmpStringCapacity) { FUN_0040d000(tmpString[0],tmpStringCapacity + 1); } sprintf_s(debugFlagText,0x20,(byte *)"%d:Show Hitspheres"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x46; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Show Damage Values"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x47; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Infinite Item Charges"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x48; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:High Luck"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x49; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Quick Kill"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x4a; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Grid Info"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x4b; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Player Item Info"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x4c; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Show Grid Collision Points"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x4d; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); sprintf_s(debugFlagText,0x20,(byte *)"%d:Show Lua Memory Usage"); std::string::string_from_cstr((char *)local_14c,debugFlagText); local_8._0_1_ = 0x4e; list_string_push_back_move(local_14c); local_8._0_1_ = 0x40; std::string::_Tidy_deallocate((char *)local_14c); if ((*(int *)((pIVar14->name)._buf + 4) < DAT_00c80258) && (_Init_thread_header(&DAT_00c80258), DAT_00c80258 == -1)) { std::string::string_from_cstr(&DAT_00c80260,(byte *)"0:None"); local_8._0_1_ = 0x4f; std::string::string_from_cstr(&DAT_00c80278,(byte *)"1:Darkness"); local_8._0_1_ = 0x50; std::string::string_from_cstr(&DAT_00c80290,(byte *)"2:Labyrinth"); local_8._0_1_ = 0x51; std::string::string_from_cstr(&DAT_00c802a8,(byte *)"4:Lost"); local_8._0_1_ = 0x52; std::string::string_from_cstr(&DAT_00c802c0,(byte *)"8:Unknown"); local_8._0_1_ = 0x53; std::string::string_from_cstr(&DAT_00c802d8,(byte *)"16:Cursed"); local_8._0_1_ = 0x54; std::string::string_from_cstr(&DAT_00c802f0,(byte *)"32:Maze"); local_8._0_1_ = 0x55; std::string::string_from_cstr(&DAT_00c80308,(byte *)"64:Blind"); local_8._0_1_ = 0x40; _atexit(FUN_00b15650); _Init_thread_footer(&DAT_00c80258); } FUN_00693f00(&DAT_00c80260,&DAT_00c80320); local_8._0_1_ = 0x56; std::string::string_from_cstr((char *)local_14c,(byte *)"128:Giant"); local_8._0_1_ = 0x57; list_string_push_back_move(local_14c); local_8._0_1_ = 0x56; std::string::_Tidy_deallocate((char *)local_14c); uVar17 = extraout_ECX; if (*(int *)((pIVar14->name)._buf + 4) < DAT_00c80320) { _Init_thread_header(&DAT_00c80320); uVar17 = extraout_ECX_05; if (DAT_00c80320 == -1) { std::string::string_from_cstr(&DAT_00c80328,(byte *)"0: None"); local_8._0_1_ = 0x58; std::string::string_from_cstr(&DAT_00c80340,(byte *)"1: Monstro"); local_8._0_1_ = 0x59; std::string::string_from_cstr(&DAT_00c80358,(byte *)"2: LarryJr"); local_8._0_1_ = 0x5a; std::string::string_from_cstr(&DAT_00c80370,(byte *)"3: Chub"); local_8._0_1_ = 0x5b; std::string::string_from_cstr(&DAT_00c80388,(byte *)"4: Gurdy"); local_8._0_1_ = 0x5c; std::string::string_from_cstr(&DAT_00c803a0,(byte *)"5: Monstro 2"); local_8._0_1_ = 0x5d; std::string::string_from_cstr(&DAT_00c803b8,(byte *)"6: Scolex"); local_8._0_1_ = 0x5e; std::string::string_from_cstr(&DAT_00c803d0,(byte *)"7: Famine"); local_8._0_1_ = 0x5f; std::string::string_from_cstr(&DAT_00c803e8,(byte *)"8: Pestilence"); local_8._0_1_ = 0x60; std::string::string_from_cstr(&DAT_00c80400,(byte *)"9: War"); local_8._0_1_ = 0x61; std::string::string_from_cstr(&DAT_00c80418,(byte *)"10: Death"); local_8._0_1_ = 0x62; std::string::string_from_cstr(&DAT_00c80430,(byte *)"11: Duke"); local_8._0_1_ = 99; std::string::string_from_cstr(&DAT_00c80448,(byte *)"12: Peep"); local_8._0_1_ = 100; std::string::string_from_cstr(&DAT_00c80460,(byte *)"13: Loki"); local_8._0_1_ = 0x65; std::string::string_from_cstr(&DAT_00c80478,(byte *)"14: Blastocyst"); local_8._0_1_ = 0x66; std::string::string_from_cstr(&DAT_00c80490,(byte *)"15: Gemini"); local_8._0_1_ = 0x67; std::string::string_from_cstr(&DAT_00c804a8,(byte *)"16: Fistula"); local_8._0_1_ = 0x68; std::string::string_from_cstr(&DAT_00c804c0,(byte *)"17: Gish"); local_8._0_1_ = 0x69; std::string::string_from_cstr(&DAT_00c804d8,(byte *)"18: Steven"); local_8._0_1_ = 0x6a; std::string::string_from_cstr(&DAT_00c804f0,(byte *)"19: Chad"); local_8._0_1_ = 0x6b; std::string::string_from_cstr(&DAT_00c80508,(byte *)"20: Headless Horseman"); local_8._0_1_ = 0x6c; std::string::string_from_cstr(&DAT_00c80520,(byte *)"21: Fallen"); local_8._0_1_ = 0x6d; std::string::string_from_cstr(&DAT_00c80538,(byte *)"22: Hollow"); local_8._0_1_ = 0x6e; std::string::string_from_cstr(&DAT_00c80550,(byte *)"23: Carrion queen"); local_8._0_1_ = 0x6f; std::string::string_from_cstr(&DAT_00c80568,(byte *)"24: Gurdy Jr."); local_8._0_1_ = 0x70; std::string::string_from_cstr(&DAT_00c80580,(byte *)"25: Husk"); local_8._0_1_ = 0x71; std::string::string_from_cstr(&DAT_00c80598,(byte *)"26: Bloat"); local_8._0_1_ = 0x72; std::string::string_from_cstr(&DAT_00c805b0,(byte *)"27: Lokii"); local_8._0_1_ = 0x73; std::string::string_from_cstr(&DAT_00c805c8,(byte *)"28: Blighted Ovum"); local_8._0_1_ = 0x74; std::string::string_from_cstr(&DAT_00c805e0,(byte *)"29: Teratoma"); local_8._0_1_ = 0x75; std::string::string_from_cstr(&DAT_00c805f8,(byte *)"30: The Widow"); local_8._0_1_ = 0x76; std::string::string_from_cstr(&DAT_00c80610,(byte *)"31: Mask of Infamy"); local_8._0_1_ = 0x77; std::string::string_from_cstr(&DAT_00c80628,(byte *)"32: Wretched"); local_8._0_1_ = 0x78; std::string::string_from_cstr(&DAT_00c80640,(byte *)"33: Pin"); local_8._0_1_ = 0x79; std::string::string_from_cstr(&DAT_00c80658,(byte *)"34: Conquest"); local_8._0_1_ = 0x7a; std::string::string_from_cstr(&DAT_00c80670,(byte *)"35: Daddy Long Legs"); local_8._0_1_ = 0x7b; std::string::string_from_cstr(&DAT_00c80688,(byte *)"36: Triachnid"); local_8._0_1_ = 0x7c; std::string::string_from_cstr(&DAT_00c806a0,(byte *)"37: The Haunt"); local_8._0_1_ = 0x7d; std::string::string_from_cstr(&DAT_00c806b8,(byte *)"38: Dingle"); local_8._0_1_ = 0x7e; std::string::string_from_cstr(&DAT_00c806d0,(byte *)"39: Mega Maw"); local_8._0_1_ = 0x7f; std::string::string_from_cstr(&DAT_00c806e8,(byte *)"40: Gate"); local_8._0_1_ = 0x80; std::string::string_from_cstr(&DAT_00c80700,(byte *)"41: Mega Fatty"); local_8._0_1_ = 0x81; std::string::string_from_cstr(&DAT_00c80718,(byte *)"42: Cage"); local_8._0_1_ = 0x82; std::string::string_from_cstr(&DAT_00c80730,(byte *)"43: Mama Gurdy"); local_8._0_1_ = 0x83; std::string::string_from_cstr(&DAT_00c80748,(byte *)"44: Dark One"); local_8._0_1_ = 0x84; std::string::string_from_cstr(&DAT_00c80760,(byte *)"45: Adversary"); local_8._0_1_ = 0x85; std::string::string_from_cstr(&DAT_00c80778,(byte *)"46: Polycephalus"); local_8._0_1_ = 0x86; std::string::string_from_cstr(&DAT_00c80790,(byte *)"47: Mr. Fred"); local_8._0_1_ = 0x87; std::string::string_from_cstr(&DAT_00c807a8,(byte *)"48: Mega Satan"); local_8._0_1_ = 0x88; std::string::string_from_cstr(&DAT_00c807c0,(byte *)"49: Gurgling"); local_8._0_1_ = 0x89; std::string::string_from_cstr(&DAT_00c807d8,(byte *)"50: Stain"); local_8._0_1_ = 0x8a; std::string::string_from_cstr(&DAT_00c807f0,(byte *)"51: Brownie"); local_8._0_1_ = 0x8b; std::string::string_from_cstr(&DAT_00c80808,(byte *)"52: Forsaken"); local_8._0_1_ = 0x8c; std::string::string_from_cstr(&DAT_00c80820,(byte *)"53: Little Horn"); local_8._0_1_ = 0x8d; std::string::string_from_cstr(&DAT_00c80838,(byte *)"54: Rag Man"); local_8._0_1_ = 0x8e; std::string::string_from_cstr(&DAT_00c80850,(byte *)"55: Hush"); local_8._0_1_ = 0x8f; std::string::string_from_cstr(&DAT_00c80868,(byte *)"56: Dangle"); local_8._0_1_ = 0x90; std::string::string_from_cstr(&DAT_00c80880,(byte *)"57: Turdling"); local_8._0_1_ = 0x91; std::string::string_from_cstr(&DAT_00c80898,(byte *)"58: Frail"); local_8._0_1_ = 0x92; std::string::string_from_cstr(&DAT_00c808b0,(byte *)"59: Rag Mega"); local_8._0_1_ = 0x93; std::string::string_from_cstr(&DAT_00c808c8,(byte *)"60: Sisters Vis"); local_8._0_1_ = 0x94; std::string::string_from_cstr(&DAT_00c808e0,(byte *)"61: Big Horn"); local_8._0_1_ = 0x56; _atexit(FUN_00b15630); _Init_thread_footer(&DAT_00c80320); uVar17 = extraout_ECX_06; } } FUN_00694040(&DAT_00c80328,&DAT_00c808f8,uVar17); local_8._0_1_ = 0x95; uVar17 = extraout_ECX_00; if (*(int *)((pIVar14->name)._buf + 4) < DAT_00c808f8) { _Init_thread_header(&DAT_00c808f8); uVar17 = extraout_ECX_07; if (DAT_00c808f8 == -1) { std::string::string_from_cstr(&DAT_00c80900,(byte *)"0:Treasure"); local_8._0_1_ = 0x96; std::string::string_from_cstr(&DAT_00c80918,(byte *)"1:Shop"); local_8._0_1_ = 0x97; std::string::string_from_cstr(&DAT_00c80930,(byte *)"2:Boss"); local_8._0_1_ = 0x98; std::string::string_from_cstr(&DAT_00c80948,(byte *)"3:Devil"); local_8._0_1_ = 0x99; std::string::string_from_cstr(&DAT_00c80960,(byte *)"4:Angel"); local_8._0_1_ = 0x9a; std::string::string_from_cstr(&DAT_00c80978,(byte *)"5:Secret"); local_8._0_1_ = 0x9b; std::string::string_from_cstr(&DAT_00c80990,(byte *)"6:Library"); local_8._0_1_ = 0x9c; std::string::string_from_cstr(&DAT_00c809a8,(byte *)"7:Challenge"); local_8._0_1_ = 0x9d; std::string::string_from_cstr(&DAT_00c809c0,(byte *)"8:Golden_Chest"); local_8._0_1_ = 0x9e; std::string::string_from_cstr(&DAT_00c809d8,(byte *)"9:Red_Chest"); local_8._0_1_ = 0x9f; std::string::string_from_cstr(&DAT_00c809f0,(byte *)"10:Beggar"); local_8._0_1_ = 0xa0; std::string::string_from_cstr(&DAT_00c80a08,(byte *)"11:Demon_Beggar"); local_8._0_1_ = 0xa1; std::string::string_from_cstr(&DAT_00c80a20,(byte *)"12:Curse"); local_8._0_1_ = 0xa2; std::string::string_from_cstr(&DAT_00c80a38,(byte *)"13:Key_Master"); local_8._0_1_ = 0xa3; std::string::string_from_cstr(&DAT_00c80a50,(byte *)"14:Boss_Rush"); local_8._0_1_ = 0xa4; std::string::string_from_cstr(&DAT_00c80a68,(byte *)"15:Dungeon"); local_8._0_1_ = 0x95; _atexit(FUN_00b15610); _Init_thread_footer(&DAT_00c808f8); uVar17 = extraout_ECX_08; } } FUN_00694040(&DAT_00c80900,&DAT_00c80a80,uVar17); local_8._0_1_ = 0xa5; omnicompleteText = (basic_string,std::allocator_> *)&local_1bc->anm2Path; do { FUN_0040c2f0(); } while (extraout_EDX != 1); string_split(0x20); local_8 = CONCAT31(local_8._1_3_,0xa6); iVar3 = FUN_00414410(); if ((*(int *)&local_1bc->isBoss == 0) || (pcVar4 = (char *)FUN_004170e0(*(int *)&local_1bc->isBoss + -1), *pcVar4 == ' ')) { iVar3 = iVar3 + 1; } if (iVar3 == 1) { for (puVar6 = (undefined4 *)*commandNames; puVar6 != commandNames; puVar6 = (undefined4 *)*puVar6) { iVar3 = FUN_00414410(); if (iVar3 == 0) { LAB_00687925: FUN_00651af0(puVar6 + 2); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar17 = FUN_004143f0(0); iVar3 = FUN_00693650(uVar17,0); if (iVar3 == 0) goto LAB_00687925; } } goto LAB_00689dd6; } if (iVar3 < 2) goto LAB_00689dd6; psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)&DAT_00b65804); if (bVar1 != 0) { local_1e0 = g_manager; pIVar14 = (g_manager->_entityConfig)._entities._head; local_1c4 = (ItemConfig_Item *)pIVar14->type; if (local_1c4 != pIVar14) { do { pEVar15 = (EntityConfig_Entity *)&(local_1c4->name)._size; local_1bc = pEVar15; cVar2 = FUN_00685fa0(); if (cVar2 != '\0') { pIVar14 = (ItemConfig_Item *)0x1; local_1dc = (ItemConfig_Item *)0x1; iVar3 = FUN_00414410(); if (iVar3 == 2) { uVar17 = 0x2e; FUN_004143f0(1); string_split(uVar17); uVar12 = FUN_00414410(); if (1 < uVar12) { iVar3 = FUN_00499330(); pIVar14 = (ItemConfig_Item *)(iVar3 + 1); local_1dc = pIVar14; } std::vector::_Tidy(); } local_1e4 = (EntityConfig_Entity *)0x0; if (0 < (int)pIVar14) { do { if (((int)pIVar14 < 2) && (pEVar15->subtype == 0)) { sprintf_s(local_b4,0x20,(byte *)"%d.%d"); } else { sprintf_s(local_b4,0x20,(byte *)"%d.%d.%d"); } std::string::string_from_cstr(local_194._buf,local_b4); tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; local_8 = CONCAT31(local_8._1_3_,0xa8); uVar12 = FUN_00414410(); if (1 < uVar12) { uVar17 = FUN_004143f0(1); FUN_0040c310(uVar17); uVar12 = FUN_00414410(); if (2 < uVar12) { uVar13 = 2; uVar12 = FUN_00414410(); if (2 < uVar12) { do { uVar17 = FUN_004143f0(uVar13); FUN_00421620(&DAT_00b656ec); local_8._0_1_ = 0xa9; uVar17 = FUN_00651d50(uVar17); FUN_004215a0(uVar17); std::string::_Tidy_deallocate(local_1ac); local_8 = CONCAT31(local_8._1_3_,0xa8); std::string::_Tidy_deallocate(local_17c._buf); uVar13 = uVar13 + 1; uVar12 = FUN_00414410(); } while (uVar13 < uVar12); } pEVar15 = local_1bc; } puVar6 = (undefined4 *)FUN_00684e50(local_204); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) tmpString); uVar16 = FUN_00684e50(local_1fc); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); } EntityConfig_Entity::GetName(pEVar15,&local_6c,0); local_8._0_1_ = 0xaa; std::string::string((char *)local_14c,&local_6c); local_8 = CONCAT31(local_8._1_3_,0xab); puVar6 = (undefined4 *)FUN_00684e50(local_1f4); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) &local_6c); uVar16 = FUN_00684e50(local_1d0); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_00687c54: std::string::c_str((char *)local_14c); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if ((iVar3 == 0) || (iVar3 = FUN_00693650(tmpString,0), iVar3 != -1)) goto LAB_00687c54; } std::string::_Tidy_deallocate((char *)local_14c); std::string::_Tidy_deallocate(local_6c._buf); std::string::_Tidy_deallocate((char *)tmpString); local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate(local_194._buf); local_1e4 = (EntityConfig_Entity *)((int)&local_1e4->id + 1); pIVar14 = local_1dc; } while ((int)local_1e4 < (int)local_1dc); } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1c4); } while (local_1c4 != (local_1e0->_entityConfig)._entities._head); } goto LAB_00689dd6; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"delirious"); if (bVar1 == 0) { if (iVar3 != 2) { if (iVar3 < 2) { LAB_00689a8a: if (iVar3 < 2) goto LAB_00689dd6; LAB_00689a90: psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"metro"); if (bVar1 != 0) { itemConfig = &g_manager->_itemConfig; local_1bc = (EntityConfig_Entity *)0x0; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2 != 0) { do { pEVar15 = local_1bc; pMVar9 = (Manager *)ItemConfig::GetCollectible(itemConfig,(int)local_1bc); local_1e0 = pMVar9; if (pMVar9 != (Manager *)0x0) { sprintf_s(idText,0x20,&DAT_00b66204); std::string::string_from_cstr((char *)local_14c,idText); local_8._0_1_ = 0xd4; uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_00689d47: psVar5 = ItemConfig_Item::GetLocalizedName((ItemConfig_Item *)pMVar9,&local_17c,0) ; std::string::c_str(psVar5->_buf); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_00689d47; pvVar10 = (void *)FUN_004143f0(1); std::string::string((char *)tmpString,pvVar10); local_8 = CONCAT31(local_8._1_3_,0xd5); uVar12 = FUN_00414410(); if (2 < uVar12) { uVar13 = 2; uVar12 = FUN_00414410(); if (2 < uVar12) { do { uVar17 = FUN_004143f0(uVar13); FUN_00421620(&DAT_00b656ec); local_8._0_1_ = 0xd6; uVar17 = FUN_00651d50(uVar17); FUN_004215a0(uVar17); std::string::_Tidy_deallocate(local_17c._buf); local_8 = CONCAT31(local_8._1_3_,0xd5); std::string::_Tidy_deallocate((char *)local_164); uVar13 = uVar13 + 1; uVar12 = FUN_00414410(); } while (uVar13 < uVar12); } pEVar15 = local_1bc; } puVar6 = (undefined4 *)FUN_00684e50(&local_1e8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) tmpString); uVar16 = FUN_00684e50(local_1f0); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); ItemConfig_Item::GetLocalizedName((ItemConfig_Item *)local_1e0,&local_194,0); local_8._0_1_ = 0xd7; std::string::string(local_1ac,&local_194); local_8._0_1_ = 0xd8; puVar6 = (undefined4 *)FUN_00684e50(local_1f8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) &local_194); uVar16 = FUN_00684e50(local_200); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); iVar3 = FUN_00693650(tmpString,0); if (iVar3 != -1) { std::string::c_str(local_1ac); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); SimpleString::operator= ((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } std::string::_Tidy_deallocate(local_1ac); std::string::_Tidy_deallocate(local_194._buf); std::string::_Tidy_deallocate((char *)tmpString); } local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate((char *)local_14c); } local_1bc = (EntityConfig_Entity *)((int)&pEVar15->id + 1); itemConfig = &g_manager->_itemConfig; } while (local_1bc < (EntityConfig_Entity *) ((int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2)); } } } else { LAB_00688ee4: psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"giveitem"); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b66178); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"remove"); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b6617c); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"giveitem2"); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b66160); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"remove2"); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b6616c); if (bVar1 == 0) { if (iVar3 != 2) goto LAB_00689a8a; psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"combo"); if (bVar1 != 0) { uVar12 = FUN_00414410(); if (uVar12 < 2) { uVar12 = 0; iVar3 = FUN_00414410(); if (iVar3 != 0) { do { uVar17 = FUN_004143f0(uVar12); FUN_00651af0(uVar17); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); uVar12 = uVar12 + 1; uVar13 = FUN_00414410(); } while (uVar12 < uVar13); } } else { uVar17 = 0x2e; FUN_004143f0(1); string_split(uVar17); local_8 = CONCAT31(local_8._1_3_,0xd2); iVar3 = FUN_00414410(); if (((iVar3 != 0) && (uVar12 = FUN_00414410(), uVar12 < 2)) && (iVar3 = FUN_004143f0(0), *(int *)(iVar3 + 0x10) != 0)) { pcVar4 = (char *)FUN_004143f0(0); pbVar11 = std::string::c_str(pcVar4); iVar3 = atoi((char *)pbVar11); if ((-1 < iVar3) && (iVar8 = FUN_00414410(), iVar3 < iVar8)) { uVar17 = FUN_004143f0(iVar3); FUN_00651af0(uVar17); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } } local_8 = CONCAT31(local_8._1_3_,0xa6); std::vector::_Tidy(); } goto LAB_00689dd6; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"cutscene"); if (bVar1 != 0) { uVar12 = 1; pcVar4 = &(g_manager->_cutsceneManager).field_0x54; do { sprintf_s(idText,0x20,&DAT_00b66130); std::string::string_from_cstr(local_1ac,idText); local_8 = CONCAT31(local_8._1_3_,0xd3); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_00689197: std::string::c_str(pcVar4); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); SimpleString::operator= ((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_00689197; } local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate(local_1ac); uVar12 = uVar12 + 1; pcVar4 = pcVar4 + 0x4c; } while (uVar12 < 0x1b); goto LAB_00689dd6; } goto LAB_00689a90; } } } } } } } } itemConfig = &g_manager->_itemConfig; local_1bc = (EntityConfig_Entity *)0x0; pMVar9 = g_manager; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2 != 0) { do { pEVar15 = local_1bc; local_1c4 = ItemConfig::GetCollectible(itemConfig,(int)local_1bc); if (local_1c4 != (ItemConfig_Item *)0x0) { sprintf_s(local_b4,0x20,&DAT_00b66204); std::string::string_from_cstr((char *)local_14c,local_b4); local_8._0_1_ = 0xc4; uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_006894b9: psVar5 = ItemConfig_Item::GetLocalizedName(local_1c4,&local_17c,0); std::string::c_str(psVar5->_buf); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_006894b9; pvVar10 = (void *)FUN_004143f0(1); std::string::string((char *)tmpString,pvVar10); local_8 = CONCAT31(local_8._1_3_,0xc5); uVar12 = FUN_00414410(); if (2 < uVar12) { uVar13 = 2; uVar12 = FUN_00414410(); if (2 < uVar12) { do { uVar17 = FUN_004143f0(uVar13); FUN_00421620(&DAT_00b656ec); local_8._0_1_ = 0xc6; uVar17 = FUN_00651d50(uVar17); FUN_004215a0(uVar17); std::string::_Tidy_deallocate(local_17c._buf); local_8 = CONCAT31(local_8._1_3_,0xc5); std::string::_Tidy_deallocate((char *)local_164); uVar13 = uVar13 + 1; uVar12 = FUN_00414410(); } while (uVar13 < uVar12); } pEVar15 = local_1bc; } puVar6 = (undefined4 *)FUN_00684e50(&local_1e8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) tmpString); uVar16 = FUN_00684e50(local_1f0); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); psVar5 = ItemConfig_Item::GetLocalizedName(local_1c4,&local_17c,0); local_8._0_1_ = 199; pbVar11 = std::string::c_str(psVar5->_buf); std::string::string_from_cstr(local_194._buf,pbVar11); local_8._0_1_ = 0xc9; std::string::_Tidy_deallocate(local_17c._buf); std::string::string(local_1ac,&local_194); local_8._0_1_ = 0xca; puVar6 = (undefined4 *)FUN_00684e50(local_1f8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) &local_194); uVar16 = FUN_00684e50(local_200); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); iVar3 = FUN_00693650(tmpString,0); if (iVar3 != -1) { std::string::c_str(local_1ac); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } std::string::_Tidy_deallocate(local_1ac); std::string::_Tidy_deallocate(local_194._buf); std::string::_Tidy_deallocate((char *)tmpString); } local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate((char *)local_14c); pMVar9 = g_manager; } itemConfig = &pMVar9->_itemConfig; local_1bc = (EntityConfig_Entity *)((int)pEVar15 + 1); } while (local_1bc < (uint)((int)(pMVar9->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2)); } local_1bc = (EntityConfig_Entity *)0x0; if ((int)(pMVar9->_itemConfig)._trinkets._end - (int)(pMVar9->_itemConfig)._trinkets._begin >> 2 != 0) { do { pEVar15 = local_1bc; local_1c4 = ItemConfig::GetTrinket(&pMVar9->_itemConfig,(uint)local_1bc); if (local_1c4 != (ItemConfig_Item *)0x0) { sprintf_s(idText,0x20,&DAT_00b66208); std::string::string_from_cstr((char *)local_164,idText); local_8._0_1_ = 0xcb; uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_006897e1: psVar5 = ItemConfig_Item::GetLocalizedName(local_1c4,&local_17c,0); std::string::c_str(psVar5->_buf); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_006897e1; pvVar10 = (void *)FUN_004143f0(1); std::string::string((char *)tmpString,pvVar10); local_8 = CONCAT31(local_8._1_3_,0xcc); uVar12 = FUN_00414410(); if (2 < uVar12) { uVar13 = 2; uVar12 = FUN_00414410(); if (2 < uVar12) { do { uVar17 = FUN_004143f0(uVar13); FUN_00421620(&DAT_00b656ec); local_8._0_1_ = 0xcd; uVar17 = FUN_00651d50(uVar17); FUN_004215a0(uVar17); std::string::_Tidy_deallocate(local_17c._buf); local_8 = CONCAT31(local_8._1_3_,0xcc); std::string::_Tidy_deallocate(local_6c._buf); uVar13 = uVar13 + 1; uVar12 = FUN_00414410(); } while (uVar13 < uVar12); } pEVar15 = local_1bc; } puVar6 = (undefined4 *)FUN_00684e50(&local_1e8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) tmpString); uVar16 = FUN_00684e50(local_1f0); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); ItemConfig_Item::GetLocalizedName(local_1c4,&local_194,0); local_8._0_1_ = 0xce; std::string::string(local_1ac,&local_194); local_8._0_1_ = 0xcf; puVar6 = (undefined4 *)FUN_00684e50(local_1f8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) &local_194); uVar16 = FUN_00684e50(local_200); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); iVar3 = FUN_00693650(tmpString,0); if (iVar3 != -1) { std::string::c_str(local_1ac); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } std::string::_Tidy_deallocate(local_1ac); std::string::_Tidy_deallocate(local_194._buf); std::string::_Tidy_deallocate((char *)tmpString); } local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate((char *)local_164); pMVar9 = g_manager; } local_1bc = (EntityConfig_Entity *)((int)&pEVar15->id + 1); } while (local_1bc < (EntityConfig_Entity *) ((int)(pMVar9->_itemConfig)._trinkets._end - (int)(pMVar9->_itemConfig)._trinkets._begin >> 2)); } uVar12 = 0; if ((int)(pMVar9->_itemConfig)._pillEffects._end - (int)(pMVar9->_itemConfig)._pillEffects._begin >> 2 != 0) { do { sprintf_s(pillIdText,0x20,&DAT_00b6620c); std::string::string_from_cstr(local_1ac,pillIdText); local_8 = CONCAT31(local_8._1_3_,0xd0); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_006898e4: pvVar10 = (void *)Config::GetPillEffect(uVar12); psVar5 = PocketItemConfig::GetName(pvVar10,&local_17c,0); std::string::c_str(psVar5->_buf); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_006898e4; } local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate(local_1ac); uVar12 = uVar12 + 1; pMVar9 = g_manager; } while (uVar12 < (uint)((int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2)); } uVar12 = 0; if ((int)(pMVar9->_itemConfig)._cards._end - (int)(pMVar9->_itemConfig)._cards._begin >> 2 != 0) { do { sprintf_s(cardIdText,0x20,&DAT_00b66210); std::string::string_from_cstr(local_194._buf,cardIdText); local_8 = CONCAT31(local_8._1_3_,0xd1); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_006899ea: cardConfig = ItemConfig::GetCard(&g_manager->_itemConfig,uVar12); psVar5 = PocketItemConfig::GetName(cardConfig,&local_17c,0); std::string::c_str(psVar5->_buf); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_006899ea; } local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate(local_194._buf); uVar12 = uVar12 + 1; } while (uVar12 < (uint)((int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2)); } } goto LAB_00689dd6; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b6580c); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"forceroom"); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"stage"); if (bVar1 != 0) { bVar1 = Game::IsGreedMode(g_game); uVar12 = 1; if (bVar1 == 0) { do { sprintf_s(stageIdText,0x10,&DAT_00b66130); std::string::string_from_cstr((char *)local_14c,stageIdText); local_8 = CONCAT31(local_8._1_3_,0xbd); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_006883e6: FUN_00651af0(local_14c); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,0,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,extraout_EDX_01); local_8._0_1_ = 0xbe; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xbd); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_006883e6; } sprintf_s(stageIdText,0x10,&DAT_00b66138); std::string::string_from_cstr((char *)tmpString,stageIdText); local_8 = CONCAT31(local_8._1_3_,0xbf); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_006884a9: FUN_00651af0(tmpString); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,1,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,0); local_8._0_1_ = 0xc0; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xbf); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (((iVar3 == 0) && (uVar12 != 9)) && (uVar12 != 0xc)) goto LAB_006884a9; } sprintf_s(stageIdText,0x10,&DAT_00b6613c); SimpleString::operator=(tmpString,(char *)stageIdText); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_0068855f: if (uVar12 < 9) { FUN_00651af0(tmpString); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,2,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,0); local_8._0_1_ = 0xc1; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xbf); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_0068855f; } sprintf_s(stageIdText,0x10,&DAT_00b66170); SimpleString::operator=(tmpString,(char *)stageIdText); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_0068861a: if (uVar12 < 9) { FUN_00651af0(tmpString); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,4,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,0); local_8._0_1_ = 0xc2; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xbf); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_0068861a; } sprintf_s(stageIdText,0x10,&DAT_00b66174); SimpleString::operator=(tmpString,(char *)stageIdText); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_006886d5: if (uVar12 < 7) { FUN_00651af0(tmpString); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,5,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,0); local_8._0_1_ = 0xc3; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xbf); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_006886d5; } std::string::_Tidy_deallocate((char *)tmpString); local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate((char *)local_14c); uVar12 = uVar12 + 1; } while (uVar12 < 0xe); } else { do { sprintf_s(stageIdText,0x10,&DAT_00b66130); std::string::string_from_cstr((char *)local_14c,stageIdText); local_8 = CONCAT31(local_8._1_3_,0xb8); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_00688186: FUN_00651af0(local_14c); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,0,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,extraout_EDX_00); local_8._0_1_ = 0xb9; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xb8); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if (iVar3 == 0) goto LAB_00688186; } sprintf_s(stageIdText,0x10,&DAT_00b66138); std::string::string_from_cstr((char *)tmpString,stageIdText); local_8 = CONCAT31(local_8._1_3_,0xba); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_00688244: FUN_00651af0(tmpString); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,1,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,0); local_8._0_1_ = 0xbb; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xba); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if ((iVar3 == 0) && (uVar12 < 6)) goto LAB_00688244; } sprintf_s(stageIdText,0x10,&DAT_00b6613c); SimpleString::operator=(tmpString,(char *)stageIdText); uVar13 = FUN_00414410(); if (uVar13 < 2) { LAB_006882ff: FUN_00651af0(tmpString); SimpleString::operator=((SimpleString *)omnicompleteText,":"); uVar13 = RoomConfig::GetStageID(uVar12,2,-1); uVar17 = RoomConfig::GetStageDisplayName(&local_17c,uVar13,0); local_8._0_1_ = 0xbc; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xba); std::string::_Tidy_deallocate(local_17c._buf); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if ((iVar3 == 0) && (uVar12 < 6)) goto LAB_006882ff; } std::string::_Tidy_deallocate((char *)tmpString); local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate((char *)local_14c); uVar12 = uVar12 + 1; } while (uVar12 < 8); } goto LAB_00689dd6; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"gridspawn"); if (bVar1 != 0) { for (puVar6 = (undefined4 *)*gridEntityNames; puVar6 != gridEntityNames; puVar6 = (undefined4 *)*puVar6) { uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_006887c6: FUN_00651af0(puVar6 + 2); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,0); if (iVar3 == 0) goto LAB_006887c6; } } goto LAB_00689dd6; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"debug"); if (bVar1 != 0) { listNode = (int *)*debugFlagNames; if (listNode != debugFlagNames) { do { uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_00688846: FUN_00651af0(listNode + 2); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,0); if (iVar3 == 0) goto LAB_00688846; } listNode = (int *)*listNode; } while (listNode != debugFlagNames); } goto LAB_00689dd6; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,(byte *)"curse"); if (bVar1 != 0) { for (puVar6 = (undefined4 *)*curseNames; puVar6 != curseNames; puVar6 = (undefined4 *)*puVar6) { uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_006888c6: FUN_00651af0(puVar6 + 2); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,0); if (iVar3 == 0) goto LAB_006888c6; } } goto LAB_00689dd6; } goto LAB_00688ee4; } } uVar12 = FUN_00414410(); if (uVar12 < 2) { SimpleString::operator=((SimpleString *)omnicompleteText,"s#d#x"); goto LAB_00689dd6; } uVar17 = 0x2e; FUN_004143f0(1); string_split(uVar17); local_8._0_1_ = 0xb1; iVar3 = FUN_00414410(); FUN_004143f0(1); iVar8 = FUN_004143f0(1); pcVar4 = (char *)FUN_004170e0(*(int *)(iVar8 + 0x10) + -1); if (*pcVar4 == '.') { iVar3 = iVar3 + 1; } if (iVar3 == 2) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b66140); if (bVar1 != 0) { roomConfig = &g_game->_roomConfig; uVar16 = FUN_0042a020(); uVar12 = Game::GetStageID((Game *)((ulonglong)uVar16 >> 0x20),unused); RoomConfig::CollectRooms (roomConfig,&rooms,uVar12,1,0xd,0,0xffffffff,1,10,(uint *)uVar16,-1,-1); local_8._0_1_ = 0xb2; pIVar14 = (ItemConfig_Item *)0xffffffff; maxRoomVariant = (ItemConfig_Item *)0x0; local_1c4 = (ItemConfig_Item *)0xffffffff; local_1dc = (ItemConfig_Item *)0x0; local_1e4 = rooms; if (rooms != roomsEnd) { do { roomVariantPtr = (ItemConfig_Item **)(local_1e4->id + 0xc); roomVariant = *roomVariantPtr; ppIVar7 = &local_1c4; if (roomVariant < pIVar14) { ppIVar7 = roomVariantPtr; } pIVar14 = *ppIVar7; ppIVar7 = &local_1dc; if (maxRoomVariant < roomVariant) { ppIVar7 = roomVariantPtr; } local_1c4 = pIVar14; maxRoomVariant = *ppIVar7; local_1dc = maxRoomVariant; FUN_005cbb80(local_1d0,roomVariant); } while (local_1e4 != roomsEnd); } sprintf_s(idText,0x20,(byte *)"%u..%u"); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)idText); goto LAB_00688ec2; } psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b6614c); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b66150); if (bVar1 == 0) goto LAB_00688ecd; } listNode = (int *)*roomTypeNames; if (listNode != roomTypeNames) { do { uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_00688ad6: FUN_00651af0(listNode + 2); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,0); if (iVar3 == 0) goto LAB_00688ad6; } listNode = (int *)*listNode; } while (listNode != roomTypeNames); local_8 = CONCAT31(local_8._1_3_,0xa6); std::vector::_Tidy(); goto LAB_00689dd6; } } else if (iVar3 == 3) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b6614c); if (bVar1 == 0) { psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b66150); if (bVar1 == 0) goto LAB_00688ecd; } game = g_game; doorMask = (uint *)FUN_0042a020(); FUN_004143f0(1); local_1e0 = (Manager *)RoomConfig::GetStageIdByName(); psVar5 = (std_string *)FUN_004143f0(0); bVar1 = str_eq_cstr(psVar5,&DAT_00b66150); if (bVar1 == 0) { uVar12 = 0; } else { uVar12 = Game::GetStageID(g_game,unused_00); } RoomConfig::CollectRooms (&game->_roomConfig,&rooms,uVar12,(int)local_1e0,0xd,0,0xffffffff,1,10,doorMask,-1, -1); local_8._0_1_ = 0xb3; local_1bc = rooms; pEVar15 = rooms; if (rooms != roomsEnd) { do { sprintf_s(roomIdText,0x10,&DAT_00b66130); std::string::string_from_cstr(local_1ac,roomIdText); local_8._0_1_ = 0xb4; uVar12 = FUN_00414410(); uVar17 = extraout_ECX_01; if (uVar12 < 3) { LAB_00688d78: FUN_005cbb80(&local_1dc,uVar17); pEVar15 = local_1bc; } else { uVar18 = 0; uVar17 = FUN_004143f0(2); iVar3 = FUN_00693650(uVar17,uVar18); uVar17 = extraout_ECX_02; if (iVar3 == 0) goto LAB_00688d78; pvVar10 = (void *)FUN_004143f0(2); std::string::string((char *)local_14c,pvVar10); local_8._0_1_ = 0xb5; puVar6 = (undefined4 *)FUN_00684e50(local_1d0); uVar17 = *puVar6; std::basic_string,std::allocator_>::end(local_14c); uVar16 = FUN_00684e50(local_1f4); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); std::string::string(local_194._buf,(void *)(pEVar15->id + 0x14)); local_8._0_1_ = 0xb6; puVar6 = (undefined4 *)FUN_00684e50(local_1fc); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)&local_194 ); uVar16 = FUN_00684e50(local_204); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); iVar3 = FUN_00693650(local_14c,0); if (iVar3 == -1) { puVar6 = (undefined4 *) std::vector_>::erase ((vector_> *)&rooms,&local_1c4,pEVar15); local_1bc = (EntityConfig_Entity *)*puVar6; } else { FUN_005cbb80(&local_1dc,extraout_ECX_03); } pEVar15 = local_1bc; std::string::_Tidy_deallocate(local_194._buf); std::string::_Tidy_deallocate((char *)local_14c); } local_8._0_1_ = 0xb3; std::string::_Tidy_deallocate(local_1ac); } while (pEVar15 != roomsEnd); } iVar3 = (int)roomsEnd - (int)rooms; local_194._size = 0; local_194._capacity = 0xf; local_194._buf[0] = '\0'; local_194._buf[1] = '\0'; local_194._buf[2] = '\0'; local_194._buf[3] = '\0'; local_8._0_1_ = 0xb7; local_1bc = rooms; if (rooms != roomsEnd) { do { pEVar15 = local_1bc; if ((((uint)(iVar3 >> 2) < 8) || (*(int *)(local_1bc->id + 0x24) == 0)) || (cVar2 = FUN_0040c790(), cVar2 == '\0')) { FUN_0040c310(pEVar15->id + 0x14); sprintf_s(roomIdText,0x10,&DAT_00b66130); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)roomIdText); if (*(int *)(pEVar15->id + 0x24) != 0) { SimpleString::operator=((SimpleString *)omnicompleteText,":"); FUN_00651af0(pEVar15->id + 0x14); } SimpleString::operator=((SimpleString *)omnicompleteText,"#"); FUN_005cbb80(local_1d0,extraout_ECX_04); } else { puVar6 = (undefined4 *) std::vector_>::erase ((vector_> *)&rooms,&local_1e8,pEVar15); local_1bc = (EntityConfig_Entity *)*puVar6; } } while (local_1bc != roomsEnd); } std::string::_Tidy_deallocate(local_194._buf); LAB_00688ec2: FID_conflict__Tidy(&rooms); } LAB_00688ecd: local_8 = CONCAT31(local_8._1_3_,0xa6); std::vector::_Tidy(); goto LAB_00689dd6; } local_1bc = (EntityConfig_Entity *)0x0; do { pEVar15 = local_1bc; sprintf_s(idText,0x20,(byte *)"%d.%d"); std::string::string_from_cstr(local_194._buf,idText); tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (SimpleString)0x0; local_8 = CONCAT31(local_8._1_3_,0xad); uVar12 = FUN_00414410(); if (1 < uVar12) { uVar17 = FUN_004143f0(1); FUN_0040c310(uVar17); uVar12 = FUN_00414410(); if (2 < uVar12) { uVar13 = 2; uVar12 = FUN_00414410(); if (2 < uVar12) { do { uVar17 = FUN_004143f0(uVar13); FUN_00421620(&DAT_00b656ec); local_8._0_1_ = 0xae; uVar17 = FUN_00651d50(uVar17); FUN_004215a0(uVar17); std::string::_Tidy_deallocate(local_17c._buf); local_8 = CONCAT31(local_8._1_3_,0xad); std::string::_Tidy_deallocate(local_1ac); uVar13 = uVar13 + 1; uVar12 = FUN_00414410(); } while (uVar13 < uVar12); } pEVar15 = local_1bc; } puVar6 = (undefined4 *)FUN_00684e50(&local_1e8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)tmpString); uVar16 = FUN_00684e50(local_1f0); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); } entityConfigEntry = EntityConfig::GetEntity (&g_manager->_entityConfig,*(int *)&pEVar15[0x8ad6].field_0x90, *(int *)&pEVar15[0x8ad6].field_0x94,0); std::string::string_from_cstr((char *)local_164,(byte *)"unknown"); local_8._0_1_ = 0xaf; if (entityConfigEntry != (EntityConfig_Entity *)0x0) { psVar5 = EntityConfig_Entity::GetName(entityConfigEntry,&local_17c,0); FUN_004215a0(psVar5); std::string::_Tidy_deallocate(local_17c._buf); } std::string::string((char *)local_14c,local_164); local_8 = CONCAT31(local_8._1_3_,0xb0); puVar6 = (undefined4 *)FUN_00684e50(local_1f8); uVar17 = *puVar6; std::basic_string,std::allocator_>::end(local_164); uVar16 = FUN_00684e50(local_200); FUN_00693eb0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20),uVar17); uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_00687f92: std::string::c_str((char *)local_14c); sprintf_s(completionEntry,0x80,(byte *)"%s:%s"); SimpleString::operator=((SimpleString *)omnicompleteText,(char *)completionEntry); SimpleString::operator=((SimpleString *)omnicompleteText,"#"); } else { uVar18 = 0; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,uVar18); if ((iVar3 == 0) || (iVar3 = FUN_00693650(tmpString,0), iVar3 != -1)) goto LAB_00687f92; } std::string::_Tidy_deallocate((char *)local_14c); std::string::_Tidy_deallocate((char *)local_164); std::string::_Tidy_deallocate((char *)tmpString); local_8 = CONCAT31(local_8._1_3_,0xa6); std::string::_Tidy_deallocate(local_194._buf); local_1bc = (EntityConfig_Entity *)((pEVar15->name)._buf + 4); } while (local_1bc < (EntityConfig_Entity *)0x3b0); uVar12 = FUN_00414410(); if (uVar12 < 2) { LAB_00688069: local_1bd = '\x01'; } else { std::string::string_from_cstr(local_17c._buf,&DAT_00b660ec); cleanupFlags = 1; uVar17 = FUN_004143f0(1); iVar3 = FUN_00693650(uVar17,0); local_1bd = '\0'; if (iVar3 != -1) goto LAB_00688069; } if ((cleanupFlags & 1) != 0) { cleanupFlags = cleanupFlags & 0xfffffffe; std::string::_Tidy_deallocate(local_17c._buf); } if (local_1bd != '\0') { SimpleString::operator=((SimpleString *)omnicompleteText,"kill#"); } LAB_00689dd6: font = (Font *)FUN_006867b0(); string_split(0x23); local_8 = CONCAT31(local_8._1_3_,0xd9); uVar12 = 0; local_1d1 = 0x20; local_1d2 = 0x23; local_1c4 = (ItemConfig_Item *)0x6; LAB_00689e10: FUN_0040c2f0(); do { uVar13 = FUN_00414410(); if (uVar12 < uVar13) { uVar17 = FUN_004143f0(uVar12); pcVar4 = (char *)FUN_00694120(uVar17); cleanupFlags = cleanupFlags | 2; pbVar11 = std::string::c_str(pcVar4); iVar3 = Font::GetStringWidth(font,pbVar11); local_1bd = '\x01'; if (g_screenWidth - 20.0 < (float)iVar3) goto LAB_00689e7f; } else { LAB_00689e7f: local_1bd = '\0'; } if ((cleanupFlags & 2) != 0) { cleanupFlags = cleanupFlags & 0xfffffffd; std::string::_Tidy_deallocate(local_17c._buf); } if (local_1bd == '\0') break; FUN_004143f0(uVar12); uVar12 = uVar12 + 1; uVar17 = FUN_00421620(&DAT_00b66110); local_8._0_1_ = 0xda; FUN_00651af0(uVar17); local_8 = CONCAT31(local_8._1_3_,0xd9); std::string::_Tidy_deallocate(local_17c._buf); } while( true ); std::basic_string,std::allocator_>::end(omnicompleteText); uVar16 = FUN_00684e50(local_1d0); FUN_006851c0(*(undefined4 *)uVar16,(int)((ulonglong)uVar16 >> 0x20)); omnicompleteText = omnicompleteText + 0x18; local_1c4 = (ItemConfig_Item *)((int)&local_1c4[-1]._initCharge + 3); if (local_1c4 == (ItemConfig_Item *)0x0) { std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); FUN_00693420(); FUN_00693420(); FUN_00693420(); FUN_00693420(); FUN_00693420(); ExceptionList = local_10; return; } goto LAB_00689e10; } //@@ 0068b260 Console::Update /* WARNING: Removing unreachable block (ram,0x0068b5bb) */ /* DB: ? GLFW input.c asserts, Console::FillOmnicomplete; called from Manager update loop FUN_00954cd0 and FUN_006fa540 prototype: db/protos.zhl */ void __thiscall Console::Update(Console *this) { char cVar1; char isRightAltDown; byte isCallbackHandled; Console CVar2; Console *scrollPos; Console *pCVar3; char *pasteBase; undefined4 uVar4; int historyContainer; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; char *textEnd; uint uVar5; uint uVar6; Console CVar7; tagINPUT keyInput; undefined1 visibleRange [4]; Console local_28; Console local_24; int *keyboard; char *clipboardText; int lineStart; byte isOpenPressed; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *glfwWindow; bool isCtrlHeld; bool isPastRange; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00af8edd; local_10 = ExceptionList; ExceptionList = &local_10; local_28 = (Console)0x155; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0,FUN_00a20730,&local_28,0,0,__security_cookie ^ (uint)(visibleRange + 0x28)); local_28 = (Console)0x15a; isRightAltDown = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a20730,&local_28,0,0); if ((((DAT_00c7ec61 != '\0') && (DAT_00c7ec60 != '\0')) && (cVar1 != '\0')) && (isRightAltDown == '\0')) { keyInput.type = 1; keyInput.field1_0x4.mi.dx = 0x11; keyInput.field1_0x4.mi.mouseData = 0; keyInput.field1_0x4.mi.dwFlags = 0; keyInput.field1_0x4.mi.dy = 2; SendInput(1,&keyInput,0x1c); (**(code **)(PTR_vftable_00c57b18 + 0x28))(&keyboard,0); local_8 = 0; if (keyboard != (int *)0x0) { (**(code **)(*keyboard + 0x40))(0x155,0); } local_8 = 0xffffffff; cVar1 = '\0'; FUN_004242b0(); } DAT_00c7ec60 = isRightAltDown; DAT_00c7ec61 = cVar1; if (*this == (Console)0x0) { if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { ExceptionList = local_10; return; } if (((g_game != (Game *)0x0) && ((g_game->_dailyChallenge)._id != 0)) && ((g_game->_dailyChallenge)._isPractice == 0)) { ExceptionList = local_10; return; } if ((g_manager->_optionsConfig)._enableDebugConsole == 0) { ExceptionList = local_10; return; } if (((g_manager->_state != 2) || (g_luaEngine == (void *)0x0)) || (isCallbackHandled = lua_run_input_action_callback((Entity *)0x0,1,0x21,&isOpenPressed), isCallbackHandled == 0)) { local_28 = (Console)0x60; isOpenPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); } glfwWindow = g_glfwWindow; if (isOpenPressed == 0) { ExceptionList = local_10; return; } if (DAT_00c7ec62 == '\0') { if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x3bf); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(code **)((int)glfwWindow + 0x2a8) = FUN_00686730; } DAT_00c7ec62 = '\x01'; } if (*this != (Console)0x0) { ExceptionList = local_10; return; } *this = (Console)0x1; this[1] = (Console)0x0; if ((this[0x14] == (Console)0x0) || (*(int *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x10) != 0)) { CVar2 = (Console)0x0; } else { CVar2 = (Console)0x1; } this[2] = CVar2; manager = g_manager; this[3] = (Console)0x0; manager->_isHotkeysEnabled = 0; ExceptionList = local_10; return; } if (*this != (Console)0x2) { ExceptionList = local_10; return; } local_28 = (Console)0x155; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_28,0,0); if (cVar1 == '\0') { local_28 = (Console)0x157; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_28,0,0); if (cVar1 != '\0') goto LAB_0068b552; local_28 = (Console)0x159; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_28,0,0); if (cVar1 != '\0') goto LAB_0068b552; isCtrlHeld = false; } else { LAB_0068b552: isCtrlHeld = true; } cVar1 = FUN_00686ad0(0x10a); if (cVar1 == '\0') { cVar1 = FUN_00686ad0(0x10b); if (cVar1 != '\0') { pCVar3 = this + 3; *pCVar3 = (Console)((int)*pCVar3 + -1); if ((int)*pCVar3 < 0) { CVar2 = (Console)((int)this[2] + -1); this[2] = CVar2; if ((-1 < (int)CVar2) && ((int)CVar2 < (int)this[0x14])) { local_28 = this[0x13]; this[3] = (Console)(*(int *)(*(int *)((int)this[0x11] + ((int)CVar2 + (int)local_28 & (int)this[0x12] - 1U) * 4) + 0x24) + -1); } } pCVar3 = (Console *)FUN_00686910(visibleRange); if (((int)this[2] < (int)*pCVar3) || ((this[2] == *pCVar3 && ((int)this[3] < (int)pCVar3[1]))) ) { isPastRange = true; } else { isPastRange = false; } scrollPos = this + 2; if (isPastRange) { scrollPos = pCVar3; } goto LAB_0068b639; } } else { CVar2 = this[3]; this[3] = (Console)((int)CVar2 + 1); if (((int)this[2] < (int)this[0x14]) && (local_28 = this[0x13], *(int *)(*(int *)((int)this[0x11] + ((int)this[2] + (int)local_28 & (int)this[0x12] - 1U) * 4 ) + 0x24) <= (int)CVar2 + 1)) { this[2] = (Console)((int)this[2] + 1); this[3] = (Console)0x0; } scrollPos = (Console *)get_visible_line_range(visibleRange); if (((int)*scrollPos < (int)this[2]) || ((*scrollPos == this[2] && ((int)scrollPos[1] < (int)this[3])))) { } else { scrollPos = this + 2; } LAB_0068b639: CVar2 = *scrollPos; this[3] = scrollPos[1]; this[2] = CVar2; } cVar1 = FUN_00686ad0(0x107); if (cVar1 != '\0') { CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = *(Console *)CVar2; } if ((uint)CVar2 < (uint)this[0x42]) { this[0x42] = (Console)((int)this[0x42] + -1); this[0x43] = (Console)0x0; } } cVar1 = FUN_00686ad0(0x106); if (cVar1 != '\0') { CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = this[7]; } if ((uint)this[0x42] < (uint)((int)this[0xb] + (int)CVar2)) { this[0x42] = (Console)((int)this[0x42] + 1); this[0x43] = (Console)0x0; } } local_28 = (Console)0x10d; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 == '\0') { local_28 = (Console)0x10c; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 == '\0') { if (!isCtrlHeld) goto LAB_0068b719; } else { if (!isCtrlHeld) { CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = *(Console *)CVar2; } goto LAB_0068b713; } pCVar3 = (Console *)get_visible_line_range(visibleRange); CVar2 = pCVar3[1]; this[2] = *pCVar3; this[3] = CVar2; } LAB_0068b7bc: local_28 = (Console)0x56; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 == '\0') { local_28 = (Console)0x14e; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 == '\0') { local_28 = (Console)0x14d; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 == '\0') goto LAB_0068bb56; uVar5 = (g_manager->_optionsConfig)._consoleFont + 1; uVar6 = 2; if (uVar5 < 2) { uVar6 = uVar5; } (g_manager->_optionsConfig)._consoleFont = uVar6; FUN_00692960(); } else { uVar6 = (g_manager->_optionsConfig)._consoleFont - 1; (g_manager->_optionsConfig)._consoleFont = -(uint)(uVar6 != 0) & uVar6; FUN_00692960(); } goto LAB_0068bb4f; } pasteBase = (char *)FUN_00a26670(); clipboardText = pasteBase; if (pasteBase != (char *)0x0) { textEnd = pasteBase; do { cVar1 = *textEnd; textEnd = textEnd + 1; } while (cVar1 != '\0'); uVar5 = (int)textEnd - (int)(pasteBase + 1); historyContainer = 0; lineStart = 0; uVar6 = 0; if (uVar5 != 0) { do { local_28 = (Console)(pasteBase + uVar6); if (*(char *)local_28 == '\n') { LAB_0068b825: if (uVar6 != 0) { CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = this[7]; } std_string_insert(this + 7,(int)this[0x42] - (int)CVar2, (byte *)(clipboardText + lineStart),uVar6 - lineStart); submit_input(extraout_ECX); if (*(char *)local_28 == '\r') { if ((uVar6 + 1 < uVar5) && (*(char *)((int)local_28 + 1) == '\n')) { uVar6 = uVar6 + 1; } } historyContainer = uVar6 + 1; pasteBase = clipboardText; lineStart = historyContainer; } } else if (*(char *)local_28 == '\r') goto LAB_0068b825; uVar6 = uVar6 + 1; } while (uVar6 < uVar5); } CVar2 = (Console)(this + 7); if ((uint)this[0xc] < 0x10) { local_24 = CVar2; } else { pasteBase = clipboardText; local_24 = *(Console *)CVar2; } local_28 = (Console)((int)this[0x42] - (int)local_24); std_string_insert((void *)CVar2,(int)this[0x42] - (int)local_24, (byte *)(pasteBase + historyContainer),uVar5 - historyContainer); FUN_006924d0(); if (0xf < (uint)this[0xc]) { CVar2 = *(Console *)CVar2; } this[0x43] = (Console)0x0; this[0x42] = (Console)(((int)CVar2 - lineStart) + (int)local_28 + uVar5); goto LAB_0068bb4f; } } else { if (isCtrlHeld) { pCVar3 = (Console *)FUN_00686910(visibleRange); CVar2 = pCVar3[1]; this[2] = *pCVar3; this[3] = CVar2; goto LAB_0068b7bc; } CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = this[7]; } CVar2 = (Console)((int)this[0xb] + (int)CVar2); LAB_0068b713: this[0x42] = CVar2; LAB_0068b719: cVar1 = FUN_00686ad0(0x103); if (cVar1 == '\0') { cVar1 = FUN_00686ad0(0x105); if (cVar1 == '\0') { local_28 = (Console)0x101; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); uVar4 = extraout_ECX_00; if (cVar1 == '\0') { local_28 = (Console)0x14f; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_28,0,0); uVar4 = extraout_ECX_01; if (cVar1 == '\0') { local_28 = (Console)0x109; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 == '\0') { local_28 = (Console)0x108; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a207d0,&local_28,0,0); if (cVar1 != '\0') { CVar2 = this[0x1c]; if ((CVar2 == this[0x18]) || (this[0x1c] = (Console)((int)CVar2 + -1), (Console)((int)CVar2 + -1) == this[0x18])) { FUN_0040c2f0(); } else { if (this[0x1a] == (Console)0x0) { historyContainer = 0; } else { historyContainer = *(int *)this[0x1a]; } FUN_0040c310(*(undefined4 *) (*(int *)(historyContainer + 4) + (*(int *)(historyContainer + 8) - 1U & (int)CVar2 - 2U) * 4)); } CVar2 = (Console)(this + 7); FUN_006924d0(); if (0xf < (uint)this[0xc]) { CVar2 = *(Console *)CVar2; } this[0x42] = (Console)((int)this[0xb] + (int)CVar2); } } else if (this[0x1c] != (Console)((int)this[0x19] + (int)this[0x18])) { uVar4 = FUN_0060c420(); FUN_0040c310(uVar4); CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = this[7]; } this[0x42] = (Console)((int)this[0xb] + (int)CVar2); FUN_006924d0(); this[0x1c] = (Console)((int)this[0x1c] + 1); } goto LAB_0068bb4f; } } if (this[0xb] == (Console)0x0) goto LAB_0068bb7f; submit_input(uVar4); } else if (this[0xb] != (Console)0x0) { CVar7 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar7 = *(Console *)CVar7; } CVar2 = this[0x42]; if (CVar2 == (Console)((int)this[0xb] + (int)CVar7)) { CVar2 = (Console)((int)CVar2 + -1); } goto LAB_0068b9c7; } } else if (this[0xb] != (Console)0x0) { CVar2 = (Console)(this + 7); if (0xf < (uint)this[0xc]) { CVar2 = *(Console *)CVar2; } if ((uint)CVar2 < (uint)this[0x42]) { CVar2 = (Console)((int)this[0x42] + -1); LAB_0068b9c7: pCVar3 = (Console *)FUN_00684e70(&local_28,CVar2); this[0x42] = *pCVar3; FUN_006924d0(); this[0x43] = (Console)0x0; } } LAB_0068bb4f: FillOmnicomplete(this); } LAB_0068bb56: local_24 = (Console)0x100; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_24,0,0); if (cVar1 == '\0') { ExceptionList = local_10; return; } LAB_0068bb7f: Close(); ExceptionList = local_10; return; } //@@ 0068bba0 Console::update_state /* DB: ECX = Game+0x68d78 (_console): ages message deque TTLs (+0x40 deque, +0x18), Glitched Crown (0x2b1) collectible refresh, open/close state machine 1..4 with 14-frame ease on +0x10 height; returns true when open (and not netplay); Game::Update, Manager::Update */ uint Console::update_state(void) { int *piVar1; int *piVar2; void *pvVar3; Entity_Pickup *this; NetplayManager NVar4; int iVar5; Entity_Player *pEVar6; int *in_ECX; NetplayManager NVar7; uint uVar8; float fVar9; float fVar10; piVar2 = (int *)in_ECX[0x10]; for (NVar7 = *(NetplayManager *)(in_ECX + 0x13); NVar4 = (NetplayManager)(in_ECX[0x14] + in_ECX[0x13]), NVar7 != NVar4; NVar7 = (NetplayManager)((int)NVar7 + 1)) { if (piVar2 == (int *)0x0) { iVar5 = 0; } else { iVar5 = *piVar2; } NVar4 = *(NetplayManager *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & (uint)NVar7) * 4); if (*(int *)((int)NVar4 + 0x18) == 0) break; if (piVar2 == (int *)0x0) { iVar5 = 0; } else { iVar5 = *piVar2; } piVar1 = (int *)(*(int *)(*(int *)(iVar5 + 4) + (*(int *)(iVar5 + 8) - 1U & (uint)NVar7) * 4) + 0x18); *piVar1 = *piVar1 + -1; } if (*in_ECX != 0) { if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) && (pEVar6 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b1,(RNG **)&g_game->_playerManager,1), pEVar6 != (Entity_Player *)0x0)) { uVar8 = 0; pvVar3 = g_game->_room; if (*(int *)((int)pvVar3 + 0x1264) != 0) { do { this = *(Entity_Pickup **)(*(int *)((int)pvVar3 + 0x125c) + uVar8 * 4); if ((this->_type == 5) && (this->_variant == 100)) { Entity_Pickup::update_cycle_collectible(this,0); } uVar8 = uVar8 + 1; } while (uVar8 < *(uint *)((int)pvVar3 + 0x1264)); } } iVar5 = *in_ECX; fVar10 = g_screenHeight - 1.0; switch(iVar5) { case 1: *in_ECX = 2; iVar5 = 2; case 2: if ((0xe < in_ECX[1]) || (fVar9 = 1.0 - (float)in_ECX[1] / 14.0, fVar9 = (1.0 - fVar9 * fVar9) * fVar10, in_ECX[4] = (int)fVar9, fVar10 <= fVar9)) { in_ECX[4] = (int)fVar10; } break; case 3: *in_ECX = 2; iVar5 = 2; break; case 4: fVar10 = (1.0 - (float)in_ECX[1] / 14.0) * fVar10; in_ECX[4] = (int)fVar10; if (fVar10 <= 0.0) { *in_ECX = 0; iVar5 = 0; } } in_ECX[0x43] = in_ECX[0x43] + 1; in_ECX[1] = in_ECX[1] + 1; NVar4 = (NetplayManager)(-(uint)((uint)in_ECX[0x43] < 0x1e) & in_ECX[0x43]); *(NetplayManager *)(in_ECX + 0x43) = NVar4; if (iVar5 != 0) { NVar4 = *(NetplayManager *)(g_manager + 1); if ((g_manager->_netplayManager == NVar4) || (NVar4 = (NetplayManager)((int)NVar4 - (int)g_manager->_netplayManager & 0xfffffffc), NVar4 == (NetplayManager)0x4)) { return CONCAT31(NVar4._1_3_,1); } } } return (uint)NVar4 & 0xffffff00; } //@@ 0068bd70 Console::RenderHistory /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall deque_console_historyentry* Console::RenderHistory(Font *font, float unk, float unk2, bool unk3); prototype: REPENTOGON, confirmed by RET 16 */ void * __thiscall Console::RenderHistory(Console *this,Font *font,float unk,float unk2,byte unk3) { KColor color; Console *pCVar1; undefined4 *puVar2; int iVar3; byte *******pppppppbVar4; void *glyphs; Console *extraout_EAX; int *piVar5; Console *pCVar6; undefined4 *puVar7; uint uVar8; Console historyProxy; byte *text; Console historyProxy; byte *lineEnd; float ageFade; float in_XMM2_Da; float in_XMM3_Da; undefined1 glyphBuffer [24]; float blue; float green; float red; undefined4 fontSettings; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; float textX; float alpha; Console *historyIndex; Console local_44; Console local_40; Console local_3c; Font *renderFont; float fadeMult; float textY; byte *******local_2c; float local_28; float local_24; float local_20; float local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af8f28; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(glyphBuffer + 0x8c); ExceptionList = &local_10; renderFont = font; pCVar1 = &local_44; if ((int)this[2] < (int)this[0x14] + -1) { pCVar1 = this + 2; } local_44 = (Console)((int)this[0x14] + -1); fadeMult = 1.0; local_3c = *pCVar1; local_44 = (Console)(this + 0x10); pCVar1 = this + 3; local_40 = (Console)(*(int *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (int)local_3c + (int)this[0x13]) * 4 ) + 0x24) + -1); pCVar6 = &local_40; if ((int)*pCVar1 < (int)local_40) { pCVar6 = pCVar1; } historyProxy = *pCVar6; if (local_44 == (Console)0x0) { historyProxy = (Console)0x0; } else { historyProxy = *(Console *)local_44; } historyIndex = (Console *)((int)local_3c + (int)this[0x13]); textY = in_XMM3_Da; textX = in_XMM2_Da; joined_r0x0068be29: if (0.0 < textY + unk) { pCVar1 = (Console *) ((int)*(Console *)((int)local_44 + 0x10) + (int)*(Console *)((int)local_44 + 0xc)); if (historyIndex != pCVar1) { if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } local_18 = 0; uVar8 = *(uint *)(*(int *)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4) + 0x1c); red = ((float)(uVar8 >> 0x10 & 0xff) + 0.0) / 255.0; green = ((float)(uVar8 >> 8 & 0xff) + 0.0) / 255.0; blue = ((float)(uVar8 & 0xff) + 0.0) / 255.0; if (unk3 == 0) { alpha = unk2; } else { if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } iVar3 = *(int *)(*(int *)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4) + 0x18); ageFade = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) / 90.0; if (ageFade <= 0.0) { ageFade = 0.0; } if (1.0 <= ageFade) { ageFade = 1.0; } alpha = ageFade * unk2 * 0.5; } local_3c = (Console)(alpha * fadeMult); if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } local_28 = red; local_24 = green; local_20 = blue; if (*(int *)(*(int *)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4) + 0x20) != 0) { if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } puVar7 = *(undefined4 **) (*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4); puVar2 = puVar7; if (0xf < (uint)puVar7[5]) { puVar2 = (undefined4 *)*puVar7; } if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } local_40 = (Console)(*(int *)(*(int *)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4) + 0x20) + (int)historyProxy * 2); lineEnd = (byte *)(puVar7[4] + (int)puVar2); do { if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } puVar7 = *(undefined4 **) (*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4); if (0xf < (uint)puVar7[5]) { puVar7 = (undefined4 *)*puVar7; } text = (byte *)((uint)*(ushort *)local_40 + (int)puVar7); local_1c = 0.0; local_18 = 0xf; local_2c = (byte *******)0x0; if (text != lineEnd) { std::string::assign((char *)&local_2c,text,(int)lineEnd - (int)text); } fontSettings = 0; local_68 = 0xffff; local_64 = 0; local_60 = 0x3f800000; local_5c = 0xffffffff; local_58 = 0; local_54 = 0; local_8 = 1; pppppppbVar4 = (byte *******)&local_2c; if (0xf < local_18) { pppppppbVar4 = local_2c; } glyphs = Font::measure_string (renderFont,glyphBuffer,(byte *)pppppppbVar4,&fontSettings,&g_vectorOne ); local_8 = CONCAT31(local_8._1_3_,2); color._green = green; color._red = red; color._blue = blue; color._alpha = (float)local_3c; color._unk = 0; Font::render_glyph_quads(renderFont,glyphs,textX,textY,1.0,1.0,color,&fontSettings); std::vector<12byte>::clear(); pCVar1 = (Console *)std::vector<12byte>::_Tidy(); historyProxy = local_40; textY = textY - unk; if (unk3 != 0) { fadeMult = fadeMult - 0.1; local_3c = (Console)(alpha * fadeMult); if (fadeMult <= 0.0) goto LAB_0068c183; } local_8 = 0xffffffff; if (*(ushort *)local_40 == 0) goto LAB_0068c183; if (0xf < local_18) { uVar8 = local_18 + 1; pppppppbVar4 = local_2c; if (0xfff < uVar8) { pppppppbVar4 = (byte *******)local_2c[-1]; uVar8 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)pppppppbVar4))) goto LAB_0068c2aa; } operator_delete(pppppppbVar4,uVar8); } local_40 = (Console)((int)historyProxy + 2); lineEnd = text; } while( true ); } fontSettings = 0; local_68 = 0xffff; local_64 = 0; local_60 = 0x3f800000; local_5c = 0xffffffff; local_58 = 0; local_54 = 0; local_8 = 3; if (historyProxy == (Console)0x0) { iVar3 = 0; } else { iVar3 = *(int *)historyProxy; } piVar5 = *(int **)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & (uint)historyIndex) * 4); if (0xf < (uint)piVar5[5]) { piVar5 = (int *)*piVar5; } local_1c = (float)local_3c; pCVar1 = (Console *)Font::DrawString(piVar5,&local_28,&fontSettings); textY = textY - unk; local_8 = 0xffffffff; if (unk3 != 0) { fadeMult = fadeMult - 0.1; goto LAB_0068c277; } goto LAB_0068c27f; } } ExceptionList = local_10; return pCVar1; LAB_0068c183: local_8 = 0xffffffff; if (0xf < local_18) { uVar8 = local_18 + 1; pppppppbVar4 = local_2c; if (0xfff < uVar8) { pppppppbVar4 = (byte *******)local_2c[-1]; uVar8 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)pppppppbVar4))) { LAB_0068c2aa: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar4,uVar8); pCVar1 = extraout_EAX; } historyProxy = (Console)0x0; if (unk3 != 0) { LAB_0068c277: if (fadeMult <= 0.0) { ExceptionList = local_10; return pCVar1; } } LAB_0068c27f: historyIndex = (Console *)&historyIndex->field_0x1; goto joined_r0x0068be29; } //@@ 0068c2e0 Console::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: this in ESI; Manager+0x2a39c console state 0..2 selects font size 15/12/8 and history offset; Console::RenderHistory, KAGE_ColorShader, "Shader stack empty"; called last in Game::Render. REPENTOGON sig prologue differs (push ebx align), so not matched prototype: REPENTOGON */ void __thiscall Console::Render(Console *this) { KColor color; KColor color_00; KColor color_01; Console *this_00; Font *this_01; void *pvVar1; Console CVar2; byte ****ppppbVar3; undefined4 *shaderTop; Console CVar4; int unused; int unused_00; uint uVar5; Console CVar6; int iVar7; float fVar8; float cursorLeft; float fVar9; Console *right; undefined1 innerQuadBuf [112]; undefined1 quadBuf [116]; float cursorY; KColor quadColor; Console local_98; float cursorX; Console local_90; Console *local_8c; float fontOffsetY; float lineHeight; Font *local_80; float lineY; byte ****lineText [4]; undefined4 local_68; uint lineTextCapacity; byte ****segmentText [4]; undefined4 local_50; uint segmentTextCapacity; undefined4 local_48; undefined4 local_44; undefined4 local_40; byte ****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; byte ***local_14; puStack_20 = (undefined1 *)(segmentText + 0x17); local_14 = (byte ***)0xffffffff; puStack_18 = &LAB_00af8fae; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(segmentText + 0x14); ExceptionList = &local_1c; iVar7 = (g_manager->_optionsConfig)._consoleFont; if (iVar7 == 0) { LAB_0068c381: fVar9 = 15.0; lineHeight = 15.0; if (iVar7 == 2) goto LAB_0068c393; LAB_0068c35a: fontOffsetY = 0.0; lineHeight = fVar9; if (iVar7 == 0) { LAB_0068c3b3: local_80 = &g_manager->_font4_terminus; LAB_0068c3b9: fontOffsetY = 0.0; } else { if (iVar7 == 1) { local_80 = &g_manager->_font5_terminus8; goto LAB_0068c3b9; } if (iVar7 != 2) goto LAB_0068c3b3; local_80 = &g_manager->_font8_LuaMiniOutlined; } } else { if (iVar7 == 1) { fVar9 = 12.0; goto LAB_0068c35a; } if (iVar7 != 2) goto LAB_0068c381; fVar9 = 8.0; lineHeight = 8.0; LAB_0068c393: local_80 = &g_manager->_font8_LuaMiniOutlined; fontOffsetY = -4.0; } local_8c = this; ppppbVar3 = (byte ****)(segmentText + 0x17); if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) && ((((g_game == (Game *)0x0 || ((g_game->_dailyChallenge)._id == 0)) || (ppppbVar3 = (byte ****)(segmentText + 0x17), (g_game->_dailyChallenge)._isPractice != 0)) && ((ppppbVar3 = (byte ****)(segmentText + 0x17), (g_manager->_optionsConfig)._enableDebugConsole != 0 && (ppppbVar3 = (byte ****)(segmentText + 0x17), (g_manager->_optionsConfig)._enableFadedConsoleDisplay != 0)))))) { ppppbVar3 = (byte ****)(segmentText + 0x17); if ((float)this[4] != g_screenHeight - 1.0) { fVar8 = 1.0 - (float)this[4] / (g_screenHeight - 1.0); if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } RenderHistory(this,local_80,fVar9,fVar8,1); ppppbVar3 = (byte ****)puStack_20; } } puStack_20 = (undefined1 *)ppppbVar3; if (*this == (Console)0x0) { ExceptionList = local_1c; return; } quadColor._red = 0.0; quadColor._green = 0.0; quadColor._blue = 0.0; quadColor._alpha = 0.5; quadColor._unk = 0; pvVar1 = render_quad_set_uniform_color(quadBuf,0.0,0.0,g_screenWidth,(float)this[4],&quadColor); render_color_shader_pass(pvVar1); quadColor._red = 1.0; quadColor._green = 1.0; quadColor._blue = 1.0; quadColor._alpha = 0.8; quadColor._unk = 0; pvVar1 = render_quad_set_uniform_color (quadBuf,0.0,(float)this[4] - 2.0,g_screenWidth,(float)this[4],&quadColor); render_color_shader_pass(pvVar1); iVar7 = 5 - ((int)this[0xe] - (int)this[0xd] >> 1); lineY = ((float)this[4] - lineHeight) - 3.0; if (-1 < iVar7) { CVar6 = (Console)(this + iVar7 * 6 + 0x1d); do { local_40 = 0; local_3c = (byte ****)0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_14 = (byte ***)0x0; CVar2 = CVar6; if (0xf < (uint)*(Console *)((int)CVar6 + 0x14)) { CVar2 = *(Console *)CVar6; } pvVar1 = Font::measure_string(local_80,&quadColor._green,(byte *)CVar2,&local_40,&g_vectorOne) ; local_14 = (byte ***)CONCAT31(local_14._1_3_,1); color._blue = 0.8862745; color._red = 0.5411765; color._green = 0.16862746; color._alpha = 1.0; color._unk = 0; Font::render_glyph_quads(local_80,pvVar1,10.0,lineY + fontOffsetY,1.0,1.0,color,&local_40); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); CVar6 = (Console)((int)CVar6 + -0x18); iVar7 = iVar7 + -1; local_14 = (byte ***)0xffffffff; lineY = lineY - lineHeight; } while (-1 < iVar7); this = local_8c; } cursorX = (float)&DAT_bf800000; local_98 = (Console)(this + 7); CVar6 = local_98; if (0xf < (uint)this[0xc]) { CVar6 = *(Console *)local_98; } CVar6 = (Console)((int)this[0xb] + (int)CVar6); local_90 = local_8c[0xe]; CVar2 = CVar6; if (local_90 != local_8c[0xd]) { do { CVar6 = local_98; if (0xf < *(uint *)((int)local_98 + 0x14)) { CVar6 = *(Console *)local_98; } CVar6 = (Console)((uint)*(ushort *)((int)local_90 + -2) + (int)CVar6); local_50 = 0; segmentTextCapacity = 0xf; segmentText[0] = (byte ****)0x0; if (CVar6 != CVar2) { std::string::assign((char *)segmentText,(byte *)CVar6,(int)CVar2 - (int)CVar6); } local_40 = 0; local_3c = (byte ****)0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_14 = (byte ***)0x3; ppppbVar3 = (byte ****)segmentText; if (0xf < segmentTextCapacity) { ppppbVar3 = segmentText[0]; } pvVar1 = Font::measure_string (local_80,&quadColor._green,(byte *)ppppbVar3,&local_40,&g_vectorOne); local_14._0_1_ = 4; color_00._blue = 0.18431373; color_00._red = 0.6784314; color_00._green = 1.0; color_00._alpha = 1.0; color_00._unk = 0; Font::render_glyph_quads(local_80,pvVar1,10.0,lineY + fontOffsetY,1.0,1.0,color_00,&local_40); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14 = (byte ***)CONCAT31(local_14._1_3_,2); if (((cursorX < 0.0) && (CVar4 = local_8c[0x42], (uint)CVar6 <= (uint)CVar4)) && ((uint)CVar4 <= (uint)CVar2)) { local_3c = (byte ****)0x0; local_2c = 0; local_28 = 0xf; if (CVar6 != CVar4) { std::string::assign((char *)&local_3c,(byte *)CVar6,(int)CVar4 - (int)CVar6); } ppppbVar3 = (byte ****)&local_3c; if (0xf < local_28) { ppppbVar3 = local_3c; } iVar7 = Font::get_string_width_n(local_80,(byte *)ppppbVar3,-1); cursorX = ((float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) + 10.0) - 1.0; if (0xf < local_28) { uVar5 = local_28 + 1; ppppbVar3 = local_3c; if (0xfff < uVar5) { ppppbVar3 = (byte ****)local_3c[-1]; uVar5 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)ppppbVar3))) goto LAB_0068c97e; } operator_delete(ppppbVar3,uVar5); } cursorY = lineY; } lineY = lineY - lineHeight; local_14 = (byte ***)0xffffffff; if (0xf < segmentTextCapacity) { uVar5 = segmentTextCapacity + 1; ppppbVar3 = segmentText[0]; if (0xfff < uVar5) { ppppbVar3 = (byte ****)segmentText[0][-1]; uVar5 = segmentTextCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)segmentText[0] + (-4 - (int)ppppbVar3))) goto LAB_0068c97e; } operator_delete(ppppbVar3,uVar5); } local_90 = (Console)((int)local_90 + -2); CVar2 = CVar6; } while (local_90 != local_8c[0xd]); CVar2 = local_98; if (0.0 <= cursorX) goto LAB_0068c99b; } CVar2 = local_98; CVar4 = local_98; if (0xf < *(uint *)((int)local_98 + 0x14)) { CVar4 = *(Console *)local_98; } local_28 = 0xf; local_3c = (byte ****)0x0; local_2c = 0; if (CVar4 != local_8c[0x42]) { std::string::assign((char *)&local_3c,(byte *)CVar4,(int)local_8c[0x42] - (int)CVar4); } ppppbVar3 = (byte ****)&local_3c; if (0xf < local_28) { ppppbVar3 = local_3c; } iVar7 = Font::get_string_width_n(local_80,(byte *)ppppbVar3,-1); cursorX = ((float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) + 10.0) - 1.0; if (0xf < local_28) { uVar5 = local_28 + 1; ppppbVar3 = local_3c; if (0xfff < uVar5) { ppppbVar3 = (byte ****)local_3c[-1]; uVar5 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)ppppbVar3))) { LAB_0068c97e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,uVar5); } cursorY = lineY; LAB_0068c99b: if (0xf < *(uint *)((int)CVar2 + 0x14)) { CVar2 = *(Console *)CVar2; } local_68 = 0; lineTextCapacity = 0xf; lineText[0] = (byte ****)0x0; if (CVar2 != CVar6) { std::string::assign((char *)lineText,(byte *)CVar2,(int)CVar6 - (int)CVar2); } this_01 = local_80; local_40 = 0; local_3c = (byte ****)0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_14 = (byte ***)0x6; ppppbVar3 = (byte ****)lineText; if (0xf < lineTextCapacity) { ppppbVar3 = lineText[0]; } pvVar1 = Font::measure_string(local_80,&quadColor._green,(byte *)ppppbVar3,&local_40,&g_vectorOne) ; local_14._0_1_ = 7; color_01._blue = 0.18431373; color_01._red = 0.6784314; color_01._green = 1.0; color_01._alpha = 1.0; color_01._unk = 0; Font::render_glyph_quads(this_01,pvVar1,10.0,lineY + fontOffsetY,1.0,1.0,color_01,&local_40); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); this_00 = local_8c; lineY = lineY - lineHeight; local_14 = (byte ***)CONCAT31(local_14._1_3_,5); if ((uint)local_8c[0x43] < 0xf) { CVar6 = (Console)(cursorY + lineHeight); quadColor._unk = 0; right = (Console *)(cursorX + 3.0); quadColor._red = 0.0; quadColor._green = 0.0; quadColor._blue = 0.0; quadColor._alpha = 1.0; cursorLeft = cursorX; fVar9 = cursorY; local_98 = CVar6; local_8c = right; local_90 = (Console)render_quad_set_uniform_color (quadBuf,cursorX,cursorY,(float)right,(float)CVar6,&quadColor); if ((*(float *)((int)local_90 + 0x40) + *(float *)((int)local_90 + 0x2c) + *(float *)((int)local_90 + 0x54) + *(float *)((int)local_90 + 0x68)) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (byte ****)0x0; local_44 = 0; local_30 = 0x3f800000; local_40 = 0x3f800000; local_2c = 0x3f800000; local_34 = 0x3f800000; local_28 = local_28 & 0xffffff00; pvVar1 = kage_graphics_flush((void *)0x0); render_quad_draw(pvVar1,&local_48,(void *)local_90,1,unused); if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } shaderTop = (undefined4 *)FUN_00684fc0(); g_currentShader = (void *)*shaderTop; g_shaderStackSize = g_shaderStackSize - 1; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } cursorLeft = cursorX; fVar9 = cursorY; right = local_8c; CVar6 = local_98; } fVar8 = 0.25; quadColor._red = 0.6784314; quadColor._green = 1.0; quadColor._blue = 0.18431373; quadColor._alpha = 1.0; quadColor._unk = 0; local_90 = (Console)render_quad_set_uniform_color (innerQuadBuf,cursorLeft + 1.0,fVar9 + 1.0,(float)right - 1.0, (float)CVar6 - 1.0,&quadColor); if ((*(float *)((int)local_90 + 0x40) + *(float *)((int)local_90 + 0x2c) + *(float *)((int)local_90 + 0x54) + *(float *)((int)local_90 + 0x68)) * fVar8 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (byte ****)0x0; local_44 = 0; local_30 = 0x3f800000; local_40 = 0x3f800000; local_2c = 0x3f800000; local_34 = 0x3f800000; local_28 = local_28 & 0xffffff00; pvVar1 = kage_graphics_flush((void *)0x0); render_quad_draw(pvVar1,&local_48,(void *)local_90,1,unused_00); if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } shaderTop = (undefined4 *)FUN_00684fc0(); g_currentShader = (void *)*shaderTop; g_shaderStackSize = g_shaderStackSize - 1; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } } } RenderHistory(this_00,this_01,lineHeight,1.0,0); if (0xf < lineTextCapacity) { uVar5 = lineTextCapacity + 1; ppppbVar3 = lineText[0]; if (0xfff < uVar5) { ppppbVar3 = (byte ****)lineText[0][-1]; uVar5 = lineTextCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)lineText[0] + (-4 - (int)ppppbVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,uVar5); } ExceptionList = local_1c; return; } //@@ 0068cdc0 Console::RunCommand /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called by Isaac::ExecuteCommand with (in,out,player); console command strings (Spawned entity, Changed stage...); zhl Console::RunCommand(std_string&in,std_string*out,Entity_Player*) */ void Console::RunCommand(undefined4 param_1,undefined4 param_2,Entity_Player *param_3) { std_string seed; char cVar1; byte bVar2; byte *pbVar3; int iVar4; Vector *pVVar5; uint uVar6; Entity_Player *pEVar7; basic_string,std::allocator_> *pbVar8; uint uVar9; void *pvVar10; EntityConfig *entityConfig; EntityConfig_Entity *entityConfigEntry; PlayerManager *playerManager; std_string *psVar11; char *pcVar12; Level *level; RoomDescriptor *roomDesc; RoomConfig *roomConfigs; Game *game; RoomConfig_Room *roomConfig; Room *pRVar13; undefined4 uVar14; GridEntity *gridEntity; ItemConfig *itemConfig; ItemConfig_Item *configItem; Entity *itemCount; ItemPool *itemPool; Entity_NPC *pEVar15; Seeds *seeds; undefined4 *puVar16; ChallengeParam *challengeParams; int *piVar17; LuaEngine *luaEngine; ModManager *modManager; BossPool *bossPool; int leveltype; uint controllerIndex; Vector *pVVar18; HUD *hud; char *entityConfig; char *entityConfigEntry; undefined1 *puVar19; Entity *in_ECX; int *luaEngine; int iVar20; float fVar21; Entity_Player *pEVar22; Entity *pEVar23; code *pcVar24; undefined1 *puVar25; uint uVar26; float fVar27; double dVar28; char acStack_280 [8]; undefined4 in_stack_fffffd8c; undefined4 in_stack_fffffd90; undefined4 in_stack_fffffd94; undefined4 in_stack_fffffd98; char *_Str2; byte bVar29; size_t _MaxCount; Vector local_238; uint local_230; uint local_22c; Vector local_228; uint local_21c; Vector local_218; undefined1 local_20d; Entity *local_20c; Entity_Player *local_208; Entity_NPC *local_204; uint local_200; Entity_NPC *local_1fc; char local_1f5; int tokensBegin; int tokensEnd; byte local_1e5; char local_1e4 [24]; char local_1cc [24]; char local_1b4 [24]; std_string local_19c; basic_string,std::allocator_> local_184 [24]; std_string local_16c; char local_154 [24]; char local_13c [24]; char local_124 [24]; char local_10c [24]; char local_f4 [24]; char local_dc [24]; undefined1 local_c4 [24]; std_string local_ac; std_string local_94; undefined1 local_7c [12]; char *local_70; uint local_6c; uint local_68; char *macroCommands [2]; undefined1 local_5c [20]; char *local_48; char *local_44; char *local_40; char *local_3c; undefined *local_38; byte entityIdText [8]; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00af9745; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; local_208 = param_3; local_21c = 0; local_20c = in_ECX; string_split(); local_8._0_1_ = 0; local_8._1_3_ = 0; if (param_3 == (Entity_Player *)0x0) { param_3 = PlayerManager::GetPlayer(&g_game->_playerManager,0); local_208 = param_3; } cVar1 = FUN_004561f0(); if ((cVar1 == '\0') || ((uint)((tokensEnd - tokensBegin) / 0x18) < 2)) { cVar1 = FUN_004561f0(); if (cVar1 != '\0') { if ((1 < (uint)((tokensEnd - tokensBegin) / 0x18)) && (cVar1 = FUN_004561f0(), cVar1 != '\0')) { local_7c[8] = '\0'; local_7c[9] = '\0'; local_7c[10] = '\0'; local_7c[0xb] = '\0'; local_70 = (char *)0x0; local_6c = 0; local_68 = 1; pEVar22 = PlayerManager::GetPlayer(&g_game->_playerManager,0); Entity_Player::console_spawn(pEVar22,(int *)(local_7c + 8),1); goto LAB_0069249e; } uVar6 = Random(); pEVar15 = (Entity_NPC *)(&DAT_00c33d80 + (uVar6 % 0x3b) * 4); local_204 = pEVar15; if (1 < (uint)((tokensEnd - tokensBegin) / 0x18)) { cVar1 = FUN_004561f0(); if (cVar1 == '\0') { pvVar10 = (void *)FUN_004143f0(); std::string::string(local_c4,pvVar10); local_8._0_1_ = 8; uVar6 = FUN_00414410(); if (2 < uVar6) { uVar26 = 2; uVar6 = FUN_00414410(); if (2 < uVar6) { do { FUN_004143f0(); FUN_00421620(); local_8._0_1_ = 9; FUN_00651d50(); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); local_8._0_1_ = 8; std::string::_Tidy_deallocate(local_2c._buf); uVar26 = uVar26 + 1; uVar6 = FUN_00414410(); } while (uVar26 < uVar6); } } FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_c4); FUN_00684e50(); FUN_00693eb0(); local_1fc = (Entity_NPC *)&DAT_00c33d80; local_200 = 0; do { pEVar15 = local_1fc; sprintf_s(entityIdText,0x20,(byte *)"%d.%d"); std::string::string_from_cstr(local_ac._buf,entityIdText); local_8._0_1_ = 10; entityConfig = (EntityConfig *)FUN_00417910(); entityConfigEntry = EntityConfig::GetEntity (entityConfig,(int)*(void **)pEVar15,*(uint *)&pEVar15->field_0x4,0); std::string::string_from_cstr(local_7c,(byte *)"unknown"); local_8._0_1_ = 0xb; if (entityConfigEntry != (EntityConfig_Entity *)0x0) { EntityConfig_Entity::GetName(entityConfigEntry,(std_string *)(local_5c + 0x10),0); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); } std::string::string(local_94._buf,local_7c); local_8._0_1_ = 0xc; FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_7c); FUN_00684e50(); FUN_00693eb0(); FUN_004143f0(); iVar20 = FUN_00693650(); if ((iVar20 == 0) || (iVar20 = FUN_00693650(), iVar20 != -1)) { pEVar15 = (Entity_NPC *)(&DAT_00c33d80 + local_200 * 4); std::string::_Tidy_deallocate(local_94._buf); std::string::_Tidy_deallocate(local_7c); std::string::_Tidy_deallocate(local_ac._buf); goto LAB_0068d936; } std::string::_Tidy_deallocate(local_94._buf); std::string::_Tidy_deallocate(local_7c); local_8._0_1_ = 8; std::string::_Tidy_deallocate(local_ac._buf); local_200 = local_200 + 1; local_1fc = (Entity_NPC *)&(local_1fc->_damageEvents)._capacity; } while (local_200 < 0x3b); pEVar15 = local_204; LAB_0068d936: local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_c4); } else { local_7c[8] = '\0'; local_7c[9] = '\0'; local_7c[10] = '\0'; local_7c[0xb] = '\0'; local_70 = (char *)0x0; local_6c = 0; local_68 = 1; pEVar22 = PlayerManager::GetPlayer(&g_game->_playerManager,0); Entity_Player::console_spawn(pEVar22,(int *)(local_7c + 8),1); } } if (pEVar15 == (Entity_NPC *)0x0) { std::string::string_from_cstr (local_94._buf, (byte *)"Failed to spawn delirious boss: unsupported ID or Variant.\n"); local_8._0_1_ = 0xd; } else { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); pEVar22 = PlayerManager::GetPlayer(playerManager,0); Entity_Player::console_spawn(pEVar22,(int *)pEVar15,1); std::string::string_from_cstr(local_94._buf,(byte *)"Spawned delirious boss.\n"); local_8._0_1_ = 0xe; } goto LAB_0068d95d; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6580c); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"forceroom"); if (bVar2 != 0) { uVar6 = FUN_00414410(); if (uVar6 < 2) { std::string::string_from_cstr(local_94._buf,(byte *)"Cleared forced room.\n"); local_8._0_1_ = 0x16; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_94._buf); DAT_00bf9428 = 0xffffffff; DAT_00bf9424 = 1; DAT_00c71668 = 0; } else { FUN_004143f0(); pcVar12 = (char *)FUN_004170e0(); if (*pcVar12 == '.') { FUN_004143f0(); pbVar3 = (byte *)FUN_004170e0(); local_1e5 = *pbVar3; if ((local_1e5 == 0x73) || (local_1e5 == 0x78)) { FUN_004143f0(); FUN_00651a90(); local_8._0_1_ = 0x17; string_split(); local_8._0_1_ = 0x18; FUN_004143f0(); uVar14 = RoomConfig::GetStageIdByName(); local_8._0_1_ = 0x17; std::vector::_Tidy(); iVar20 = 0; string_split(); local_8._0_1_ = 0x19; uVar6 = FUN_00414410(); if (1 < uVar6) { pRVar13 = (Room *)FUN_004143f0(); iVar4 = Room::GetGridHeight(pRVar13); if (iVar4 != 0) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); iVar20 = atoi((char *)pbVar3); } } if (local_1e5 == 0x78) { game = (Game *)Config::GetCollectibles(); DAT_00bf9428 = Game::GetStageID(game,0); } else { DAT_00bf9428 = 0; } DAT_00bf9424 = uVar14; DAT_00c71668 = iVar20; std::vector::_Tidy(); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_ac._buf); } else if (local_1e5 == 100) { FUN_004143f0(); pcVar12 = (char *)FUN_00651a90(); pbVar3 = std::string::c_str(pcVar12); iVar20 = atoi((char *)pbVar3); std::string::_Tidy_deallocate(local_5c + 0x10); game = (Game *)Config::GetCollectibles(); DAT_00bf9428 = Game::GetStageID(game,0); DAT_00bf9424 = 1; DAT_00c71668 = iVar20; } FUN_00421790(); FUN_008295c0(); FUN_00421790(); pcVar12 = (char *)RoomConfig::GetStageDisplayName(); local_8._0_1_ = 0x1a; std::string::c_str(pcVar12); print_format(); std::string::_Tidy_deallocate(local_5c + 0x10); } } goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"gridspawn"); if ((bVar2 != 0) && (uVar6 = FUN_00414410(), 1 < uVar6)) { FUN_004143f0(); string_split(); local_8._0_1_ = 0x1b; local_1fc = (Entity_NPC *)0x0; iVar20 = FUN_00414410(); if (iVar20 != 0) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); atoi((char *)pbVar3); } uVar6 = FUN_00414410(); if (1 < uVar6) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_1fc = (Entity_NPC *)atoi((char *)pbVar3); } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); Random(); uVar6 = Room::GetRandomTileIndex(pRVar13); uVar26 = FUN_00414410(); if (2 < uVar26) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); uVar6 = atoi((char *)pbVar3); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::RemoveGridEntity(pRVar13,uVar6,0,0); } Level::GetCurrentRoom((Level *)g_game); FUN_00685d60(); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(pRVar13,uVar6); if (gridEntity != (GridEntity *)0x0) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(pRVar13,uVar6); (**(code **)(*(int *)gridEntity + 4))(); } std::vector::_Tidy(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"stage"); if ((bVar2 != 0) && (iVar20 = FUN_00414410(), iVar20 == 2)) { iVar20 = 0; FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); pcVar12 = (char *)FUN_004170e0(); if (*pcVar12 == 'a') { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); FUN_00684ee0(); iVar20 = 1; } else { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); pcVar12 = (char *)FUN_004170e0(); if (*pcVar12 == 'b') { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); FUN_00684ee0(); iVar20 = 2; } else { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); pcVar12 = (char *)FUN_004170e0(); if (*pcVar12 == 'c') { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); FUN_00684ee0(); iVar20 = 4; } else { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); pcVar12 = (char *)FUN_004170e0(); if (*pcVar12 == 'd') { FUN_004143f0(); pRVar13 = (Room *)FUN_004143f0(); Room::GetGridHeight(pRVar13); FUN_00684ee0(); iVar20 = 5; } } } } pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); iVar4 = atoi((char *)pbVar3); if (0xd < iVar4 - 1U) goto LAB_0069249e; level = (Level *)Config::GetCollectibles(); Level::SetStage(level,iVar4,iVar20); Config::GetCollectibles(); Level::Init(); level = (Level *)Config::GetCollectibles(); Level::Update(level); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); PlayerManager::trigger_new_room_effects(playerManager); std::string::string_from_cstr(local_94._buf,(byte *)"Changed stage.\n"); local_8._0_1_ = 0x1c; goto LAB_0068d95d; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"debug"); if ((bVar2 != 0) && (iVar20 = FUN_00414410(), iVar20 == 2)) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); iVar20 = atoi((char *)pbVar3); uVar6 = iVar20 - 1; if (uVar6 < 0xe) { FUN_00685f10(); bVar2 = Game::GetDebugFlag(g_game,uVar6); if (bVar2 == 0) { std::string::string_from_cstr(local_ac._buf,(byte *)"Disabled debug flag.\n"); local_8._0_1_ = 0x1e; Print((Console *)in_ECX,&local_ac,0xffd3d3d3,0x96); psVar11 = &local_ac; } else { std::string::string_from_cstr(local_94._buf,(byte *)"Enabled debug flag.\n"); local_8._0_1_ = 0x1d; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); psVar11 = &local_94; } local_8._0_1_ = 0; std::string::_Tidy_deallocate(psVar11->_buf); } if (uVar6 == 8) { uVar6 = 0; iVar20 = Game::GetNumPlayers(g_game); if (iVar20 != 0) { do { Game::GetPlayer(g_game,uVar6); FUN_007c2e80(); uVar6 = uVar6 + 1; uVar26 = Game::GetNumPlayers(g_game); } while (uVar6 < uVar26); } } else if (uVar6 == 3) { uVar6 = 0; iVar20 = Game::GetNumPlayers(g_game); if (iVar20 != 0) { do { pEVar22 = Game::GetPlayer(g_game,uVar6); Entity_Player::AddCacheFlags(pEVar22,1); Game::GetPlayer(g_game,uVar6); Entity_Player::EvaluateItems(); uVar6 = uVar6 + 1; uVar26 = Game::GetNumPlayers(g_game); } while (uVar6 < uVar26); } } goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"giveitem"); if (bVar2 != 0) { LAB_0068e5e5: uVar6 = FUN_00414410(); if (uVar6 < 2) goto LAB_0068ef7a; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"remove"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6617c); if (bVar2 != 0) goto LAB_0068e674; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"remove2"); if (bVar2 != 0) goto LAB_0068e674; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6616c); local_1f5 = '\0'; if (bVar2 != 0) goto LAB_0068e674; } else { LAB_0068e674: local_1f5 = '\x01'; } FUN_004143f0(); FUN_00693680(); pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_1e5 = *pbVar3; FUN_004143f0(); pcVar12 = (char *)FUN_00693680(); if ((*pcVar12 == '2') && (iVar20 = Entity_Player::GetOtherTwin(param_3), iVar20 != 0)) { param_3 = (Entity_Player *)Entity_Player::GetOtherTwin(param_3); local_208 = param_3; } if ((byte)(pbVar3[1] - 0x30) < 10) { local_20c = (Entity *)atoi((char *)(pbVar3 + 1)); } else { local_20c = (Entity *)0xffffffff; } pEVar23 = local_20c; if (local_1e5 != 0x2a) { if (local_1e5 == 99) { if (local_20c != (Entity *)0x0) { Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); itemCount = (Entity *)std::vector::size(pvVar10); if (pEVar23 < itemCount) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,(int)pEVar23); if (configItem != (ItemConfig_Item *)0x0) { if (local_1f5 == '\0') { iVar20 = Game::Challenge(g_game); if (iVar20 == 0x2b) { Entity_Player::AddItemCard(param_3,(uint)pEVar23); } else { iVar20 = Entity_Player::GetBatteryCharge(param_3,0); if ((iVar20 != 0) && (((bVar2 = Entity_Player::HasCollectible(param_3,0x216,0), bVar2 == 0 || (iVar20 = Entity_Player::GetBatteryCharge(param_3,1), iVar20 != 0)) && (configItem->type == 3)))) { itemConfig = Isaac::GetItemConfig(); iVar20 = Entity_Player::GetBatteryCharge(param_3,0); configItem = ItemConfig::GetCollectible(itemConfig,iVar20); if ((configItem != (ItemConfig_Item *)0x0) && (configItem->type == 3)) { bVar29 = 1; uVar26 = 0; bVar2 = 0; uVar6 = Entity_Player::GetBatteryCharge(param_3,0); Entity_Player::RemoveCollectible(param_3,uVar6,bVar2,uVar26,bVar29); } pEVar23 = local_20c; } Entity_Player::AddCollectible(param_3,(int)pEVar23,-1,1,0,0,0); } } else { Entity_Player::RemoveCollectible(param_3,(uint)pEVar23,0,0,1); } } goto LAB_0069249e; } } goto LAB_0068e806; } if (((local_1e5 == 0x74) || (local_1e5 == 0x54)) && (local_20c != (Entity *)0x0)) { Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetTrinkets(); itemCount = (Entity *)std::vector::size(pvVar10); if (pEVar23 < itemCount) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetTrinket(itemConfig,(uint)pEVar23); if (configItem != (ItemConfig_Item *)0x0) { if (local_1f5 == '\0') { Entity_Player::GetMaxTrinkets(param_3); iVar20 = Entity_Player::GetTrinket(param_3); if (iVar20 != 0) { uVar6 = Entity_Player::GetTrinket(param_3); Entity_Player::TryRemoveTrinket(param_3,uVar6); } if (local_1e5 == 0x54) { pEVar23 = (Entity *)((uint)pEVar23 | 0x8000); } Entity_Player::AddTrinket(param_3,(int)pEVar23,1); } else { Entity_Player::TryRemoveTrinket(param_3,(uint)pEVar23); } } goto LAB_0069249e; } } if (local_1e5 != 0x6b) { if ((local_1e5 == 0x70) || (local_1e5 == 0x50)) { Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetPillEffects(); itemCount = (Entity *)std::vector::size(pvVar10); if (pEVar23 < itemCount) { if (local_1f5 == '\0') { itemPool = (ItemPool *)Game::GetItemPool(g_game); ItemPool::ForceAddPillEffect(itemPool,(int)pEVar23); Entity_Player::AddPill(); goto LAB_0069249e; } std::string::string_from_cstr (local_94._buf,(byte *)"Removing pills has not been implemented.\n"); local_8._0_1_ = 0x22; goto LAB_0068d95d; } } goto LAB_0068e806; } if (pEVar23 == (Entity *)0x0) goto LAB_0068e806; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCards(); itemCount = (Entity *)std::vector::size(pvVar10); if (itemCount <= pEVar23) goto LAB_0068e806; if (local_1f5 == '\0') { Entity_Player::AddCard(); goto LAB_0069249e; } std::string::string_from_cstr (local_94._buf,(byte *)"Removing cards has not been implemented.\n"); local_8._0_1_ = 0x21; goto LAB_0068d95d; } if (local_1f5 == '\0') { std::string::string_from_cstr(local_94._buf,(byte *)"What are you trying to do?\n"); local_8._0_1_ = 0x20; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_94._buf); } else { std::string::string_from_cstr (local_94._buf,(byte *)"Restoring player to zero collectibles/trinkets.\n"); local_8._0_1_ = 0x1f; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_94._buf); uVar26 = 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); uVar6 = std::vector::size(pvVar10); if (1 < uVar6) { do { bVar2 = ItemConfig::IsValidCollectible(uVar26); if (bVar2 != 0) { Entity_Player::RemoveCollectible(param_3,uVar26,0,0,1); } uVar26 = uVar26 + 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); uVar6 = std::vector::size(pvVar10); } while (uVar26 < uVar6); } uVar26 = 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetTrinkets(); uVar6 = std::vector::size(pvVar10); if (1 < uVar6) { do { Entity_Player::TryRemoveTrinket(param_3,uVar26); uVar26 = uVar26 + 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetTrinkets(); uVar6 = std::vector::size(pvVar10); } while (uVar26 < uVar6); } } LAB_0068e806: pvVar10 = (void *)FUN_004143f0(); std::string::string(local_7c,pvVar10); local_8._0_1_ = 0x23; uVar6 = FUN_00414410(); if (2 < uVar6) { uVar26 = 2; uVar6 = FUN_00414410(); if (2 < uVar6) { do { FUN_004143f0(); FUN_00421620(); local_8._0_1_ = 0x24; FUN_00651d50(); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); local_8._0_1_ = 0x23; std::string::_Tidy_deallocate(local_2c._buf); uVar26 = uVar26 + 1; uVar6 = FUN_00414410(); } while (uVar26 < uVar6); } } FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_7c); FUN_00684e50(); FUN_00693eb0(); local_1e5 = 0x20; local_20d = 0x5f; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_7c); FUN_00684e50(); FUN_006851c0(); uVar6 = 0; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); iVar20 = std::vector::size(pvVar10); if (iVar20 != 0) { do { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,uVar6); if (configItem != (ItemConfig_Item *)0x0) { ItemConfig_Item::GetLocalizedName(configItem,(std_string *)local_c4,0); local_8._0_1_ = 0x25; FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_c4 ); FUN_00684e50(); FUN_00693eb0(); iVar20 = FUN_00693650(); if (iVar20 != -1) { if (local_1f5 == '\0') { iVar20 = Game::Challenge(g_game); pEVar22 = local_208; if (iVar20 == 0x2b) { Entity_Player::AddItemCard(local_208,uVar6); std::string::_Tidy_deallocate(local_c4); std::string::_Tidy_deallocate(local_7c); } else { iVar20 = Entity_Player::GetBatteryCharge(local_208,0); if ((iVar20 != 0) && ((bVar2 = Entity_Player::HasCollectible(pEVar22,0x216,0), bVar2 == 0 || (iVar20 = Entity_Player::GetBatteryCharge(pEVar22,1), iVar20 != 0)))) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,uVar6); if (configItem->type == 3) { itemConfig = Isaac::GetItemConfig(); iVar20 = Entity_Player::GetBatteryCharge(pEVar22,0); configItem = ItemConfig::GetCollectible(itemConfig,iVar20); if ((configItem != (ItemConfig_Item *)0x0) && (configItem->type == 3)) { bVar29 = 1; uVar9 = 0; bVar2 = 0; uVar26 = Entity_Player::GetBatteryCharge(pEVar22,0); Entity_Player::RemoveCollectible(pEVar22,uVar26,bVar2,uVar9,bVar29); } } } Entity_Player::AddCollectible(pEVar22,uVar6,-1,1,0,0,0); std::string::_Tidy_deallocate(local_c4); std::string::_Tidy_deallocate(local_7c); } } else { Entity_Player::RemoveCollectible(local_208,uVar6,0,0,1); std::string::_Tidy_deallocate(local_c4); std::string::_Tidy_deallocate(local_7c); } goto LAB_0069249e; } local_8._0_1_ = 0x23; std::string::_Tidy_deallocate(local_c4); } uVar6 = uVar6 + 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); uVar26 = std::vector::size(pvVar10); } while (uVar6 < uVar26); } uVar6 = 0; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetTrinkets(); iVar20 = std::vector::size(pvVar10); if (iVar20 != 0) { do { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetTrinket(itemConfig,uVar6); if (configItem != (ItemConfig_Item *)0x0) { ItemConfig_Item::GetLocalizedName(configItem,&local_ac,0); local_8._0_1_ = 0x26; FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) &local_ac); FUN_00684e50(); FUN_00693eb0(); iVar20 = FUN_00693650(); pEVar22 = local_208; if (iVar20 != -1) { if (local_1f5 != '\0') { Entity_Player::TryRemoveTrinket(local_208,uVar6); std::string::_Tidy_deallocate(local_ac._buf); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } Entity_Player::GetMaxTrinkets(local_208); iVar20 = Entity_Player::GetTrinket(pEVar22); if (iVar20 != 0) { uVar26 = Entity_Player::GetTrinket(pEVar22); Entity_Player::TryRemoveTrinket(pEVar22,uVar26); } Entity_Player::AddTrinket(pEVar22,uVar6,1); std::string::_Tidy_deallocate(local_ac._buf); goto LAB_0068ef6d; } local_8._0_1_ = 0x23; std::string::_Tidy_deallocate(local_ac._buf); } uVar6 = uVar6 + 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetTrinkets(); uVar26 = std::vector::size(pvVar10); } while (uVar6 < uVar26); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } LAB_0068ef6d: std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66178); if (bVar2 != 0) goto LAB_0068e5e5; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"remove"); if (bVar2 != 0) goto LAB_0068e5e5; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6617c); if (bVar2 != 0) goto LAB_0068e5e5; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"giveitem2"); if (bVar2 != 0) goto LAB_0068e5e5; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66160); if (bVar2 != 0) goto LAB_0068e5e5; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"remove2"); if (bVar2 != 0) goto LAB_0068e5e5; psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6616c); if (bVar2 != 0) goto LAB_0068e5e5; LAB_0068ef7a: psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"metro"); if ((bVar2 != 0) && (iVar20 = FUN_00414410(), iVar20 == 2)) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); bVar2 = *pbVar3; if ((byte)(pbVar3[1] - 0x30) < 10) { uVar6 = atoi((char *)(pbVar3 + 1)); } else { uVar6 = 0xffffffff; } if (bVar2 == 99) { Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); uVar26 = std::vector::size(pvVar10); if (uVar6 < uVar26) { DAT_00c7166c = uVar6; goto LAB_0069249e; } } pvVar10 = (void *)FUN_004143f0(); std::string::string(local_7c,pvVar10); local_8._0_1_ = 0x27; uVar6 = FUN_00414410(); if (2 < uVar6) { uVar26 = 2; uVar6 = FUN_00414410(); if (2 < uVar6) { do { FUN_004143f0(); FUN_00421620(); local_8._0_1_ = 0x28; FUN_00651d50(); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); local_8._0_1_ = 0x27; std::string::_Tidy_deallocate(local_2c._buf); uVar26 = uVar26 + 1; uVar6 = FUN_00414410(); } while (uVar26 < uVar6); } } FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_7c); FUN_00684e50(); FUN_00693eb0(); local_20d = 0x20; local_1e5 = 0x5f; std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)local_7c); FUN_00684e50(); FUN_006851c0(); uVar6 = 0; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); iVar20 = std::vector::size(pvVar10); if (iVar20 != 0) { do { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,uVar6); if (configItem != (ItemConfig_Item *)0x0) { ItemConfig_Item::GetLocalizedName(configItem,&local_ac,0); local_8._0_1_ = 0x29; FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) &local_ac); FUN_00684e50(); FUN_00693eb0(); iVar20 = FUN_00693650(); if (iVar20 != -1) { DAT_00c7166c = uVar6; std::string::_Tidy_deallocate(local_ac._buf); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } local_8._0_1_ = 0x27; std::string::_Tidy_deallocate(local_ac._buf); } uVar6 = uVar6 + 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); uVar26 = std::vector::size(pvVar10); } while (uVar6 < uVar26); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } goto LAB_0068ef6d; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"costumetest"); if (bVar2 != 0) { iVar20 = Isaac::Random(5); pEVar15 = (Entity_NPC *)(iVar20 + 2); local_1fc = pEVar15; iVar20 = FUN_00414410(); if (iVar20 == 2) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); pEVar15 = (Entity_NPC *)atoi((char *)pbVar3); local_1fc = pEVar15; } Entity_Player::ClearCostumes(param_3); if (0 < (int)pEVar15) { iVar20 = 0; do { do { do { iVar4 = Isaac::Random(0x2dd); itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,iVar4); } while (configItem == (ItemConfig_Item *)0x0); } while (configItem->type != 1); Entity_Player::AddCostume(param_3,configItem,0); iVar20 = iVar20 + 1; } while (iVar20 < (int)local_1fc); } goto LAB_00692495; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b65858); if (bVar2 != 0) { FUN_00685f00(); print_format(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"restart"); if (bVar2 != 0) { iVar20 = FUN_00414410(); if (iVar20 == 2) { pRVar13 = (Room *)FUN_004143f0(); iVar20 = Room::GetGridHeight(pRVar13); if (iVar20 != 0) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); iVar20 = atoi((char *)pbVar3); if (iVar20 < 0) { LAB_0068f438: iVar20 = 0; } else { FUN_00417910(); FUN_00685d50(); iVar4 = FUN_00693540(); if (iVar4 <= iVar20) goto LAB_0068f438; } g_manager->_startPlayerType = iVar20; } } seeds = (Seeds *)Game::GetSeeds(g_game); Seeds::construct_from_copy((Seeds *)(acStack_280 + -0x40),seeds); Manager::RestartGame(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"listcollectibles"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"repeat"); if ((bVar2 == 0) || (iVar20 = FUN_00414410(), iVar20 != 2)) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b658e4); if (bVar2 != 0) { uVar6 = FUN_00414410(); if (uVar6 < 2) { Game::GetSeeds(g_game); Seeds::GetStartSeedString(); local_8._0_1_ = 0x35; Print((Console *)in_ECX,&local_ac,0xffd3d3d3,0x96); std::string::string_from_cstr(local_94._buf,&DAT_00b66310); local_8._0_1_ = 0x36; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_94._buf); std::string::_Tidy_deallocate(local_ac._buf); } else { pvVar10 = (void *)FUN_004143f0(); std::string::string(local_7c,pvVar10); local_8._0_1_ = 0x2f; uVar6 = FUN_00414410(); if (2 < uVar6) { FUN_004143f0(); FUN_004143f0(); FUN_00694170(); local_8._0_1_ = 0x30; in_stack_fffffd98 = 0x68f7e0; FUN_00651d50(); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); local_8._0_1_ = 0x2f; std::string::_Tidy_deallocate(local_2c._buf); } cVar1 = Seeds::IsStringValidSeed(); if (cVar1 == '\0') { std::string::string_from_cstr(local_94._buf,(byte *)"Invalid seed.\n"); local_8._0_1_ = 0x34; } else { Game::GetSeeds(g_game); uVar14 = 0x68f828; cVar1 = Seeds::IsSpecialSeed(); if (cVar1 == '\0') { uVar6 = 0x68f83a; seeds = (Seeds *)Game::GetSeeds(g_game); std::string::string(acStack_280 + 0xc,local_7c); seed._buf[4] = (char)in_stack_fffffd90; seed._buf[5] = (char)((uint)in_stack_fffffd90 >> 8); seed._buf[6] = (char)((uint)in_stack_fffffd90 >> 0x10); seed._buf[7] = (char)((uint)in_stack_fffffd90 >> 0x18); seed._buf[0] = (char)in_stack_fffffd8c; seed._buf[1] = (char)((uint)in_stack_fffffd8c >> 8); seed._buf[2] = (char)((uint)in_stack_fffffd8c >> 0x10); seed._buf[3] = (char)((uint)in_stack_fffffd8c >> 0x18); seed._buf[8] = (char)in_stack_fffffd94; seed._buf[9] = (char)((uint)in_stack_fffffd94 >> 8); seed._buf[10] = (char)((uint)in_stack_fffffd94 >> 0x10); seed._buf[0xb] = (char)((uint)in_stack_fffffd94 >> 0x18); seed._buf[0xc] = (char)in_stack_fffffd98; seed._buf[0xd] = (char)((uint)in_stack_fffffd98 >> 8); seed._buf[0xe] = (char)((uint)in_stack_fffffd98 >> 0x10); seed._buf[0xf] = (char)((uint)in_stack_fffffd98 >> 0x18); seed._size = uVar14; seed._capacity = uVar6; Seeds::SetStartSeed(seeds,seed); Game::GetSeeds(g_game); FUN_00685db0(); seeds = (Seeds *)Game::GetSeeds(g_game); Seeds::construct_from_copy((Seeds *)(acStack_280 + -0x40),seeds); Manager::RestartGame(); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } Game::GetSeeds(g_game); cVar1 = FUN_009e9d10(); if (cVar1 == '\0') { Game::GetSeeds(g_game); cVar1 = FUN_00685e00(); if (cVar1 == '\0') { std::string::string_from_cstr (local_94._buf, (byte *)"Special seed conflicts with the current stack.\n"); local_8._0_1_ = 0x32; } else { Game::GetSeeds(g_game); FUN_009eba40(); std::string::string_from_cstr(local_94._buf,(byte *)"Removed special seed.\n"); local_8._0_1_ = 0x31; } } else { Game::GetSeeds(g_game); FUN_009eba00(); std::string::string_from_cstr(local_94._buf,(byte *)"Added special seed.\n"); local_8._0_1_ = 0x33; } } Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_94._buf); std::string::_Tidy_deallocate(local_7c); } goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"clearseeds"); if (bVar2 != 0) { seeds = (Seeds *)Game::GetSeeds(g_game); Seeds::ClearSeedEffects(seeds); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"challenge"); if (bVar2 != 0) { iVar20 = FUN_00414410(); if (iVar20 == 2) { pRVar13 = (Room *)FUN_004143f0(); iVar20 = Room::GetGridHeight(pRVar13); if (iVar20 != 0) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); uVar6 = atoi((char *)pbVar3); if ((-1 < (int)uVar6) && (uVar26 = FUN_00685f70(), uVar6 <= uVar26)) { challengeParams = Manager::GetChallengeParams(g_manager,uVar6); manager = g_manager; g_manager->_startChallenge = uVar6; manager->_startPlayerType = challengeParams->_playerType; game = g_game; manager->_startDifficulty = challengeParams->_difficulty; seeds = (Seeds *)Game::GetSeeds(game); Seeds::construct_from_copy((Seeds *)(acStack_280 + -0x40),seeds); Manager::RestartGame(); goto LAB_0069249e; } std::string::string_from_cstr(local_94._buf,(byte *)"Invalid challenge ID.\n"); local_8._0_1_ = 0x37; goto LAB_0068d95d; } } std::string::string_from_cstr(local_94._buf,(byte *)"Invalid challenge ID.\n"); local_8._0_1_ = 0x38; goto LAB_0068d95d; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"combo"); if ((bVar2 == 0) || (iVar20 = FUN_00414410(), iVar20 != 2)) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"cutscene"); if ((bVar2 == 0) || (iVar20 = FUN_00414410(), iVar20 != 2)) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"restock"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"clearcache"); if (bVar2 != 0) { AnmCache::Clear(); TextureCache::Purge(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"macro"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b664a4); if (bVar2 != 0) goto LAB_0068fda9; } else { LAB_0068fda9: uVar6 = FUN_00414410(); if (1 < uVar6) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b664a8); if (bVar2 != 0) { Game::ChangeRoom(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66464); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6650c); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b664c0); if (bVar2 != 0) { std::string::string_from_cstr(local_dc,(byte *)"goto s.boss.5000"); local_8._0_1_ = 0x43; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr(local_10c,(byte *)"giveitem Soy"); local_8._0_1_ = 0x44; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_10c); std::string::string_from_cstr(local_94._buf,(byte *)"giveitem Mutant"); local_8._0_1_ = 0x45; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_94._buf); std::string::string_from_cstr(local_ac._buf,(byte *)"debug 3"); local_8._0_1_ = 0x46; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_ac._buf); std::string::string_from_cstr(local_7c,(byte *)"debug 4"); local_8._0_1_ = 0x47; RunCommand(); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66558); if (bVar2 != 0) { std::string::string_from_cstr(local_dc,(byte *)"stage 11a"); local_8._0_1_ = 0x48; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr(local_10c,(byte *)"goto s.boss.6000"); local_8._0_1_ = 0x49; LAB_00690100: RunCommand(); std::string::_Tidy_deallocate(local_10c); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b6657c); if (bVar2 != 0) { std::string::string_from_cstr(local_dc,(byte *)"stage 11a"); local_8._0_1_ = 0x4a; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr(local_10c,(byte *)"goto s.boss.6000"); local_8._0_1_ = 0x4b; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_10c); std::string::string_from_cstr(local_94._buf,(byte *)"giveitem Sad Onion"); local_8._0_1_ = 0x4c; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_94._buf); std::string::string_from_cstr(local_ac._buf,(byte *)"giveitem Sad Onion"); local_8._0_1_ = 0x4d; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_ac._buf); std::string::string_from_cstr(local_7c,(byte *)"giveitem Torn"); local_8._0_1_ = 0x4e; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_7c); std::string::string_from_cstr(local_c4,(byte *)"giveitem Torn"); local_8._0_1_ = 0x4f; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_c4); std::string::string_from_cstr(local_154,(byte *)"giveitem Mutant"); local_8._0_1_ = 0x50; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr(local_13c,(byte *)"giveitem A Dollar"); local_8._0_1_ = 0x51; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr(local_124,(byte *)"giveitem Pyro"); local_8._0_1_ = 0x52; RunCommand(local_124,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_f4,(byte *)"debug 3"); local_8._0_1_ = 0x53; RunCommand(local_f4,0,0); std::string::_Tidy_deallocate(local_f4); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)&DAT_00b665a8); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66580); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"bigchest"); if (bVar2 != 0) { macroCommands[0] = "stage 10a"; uVar6 = 0; macroCommands[1] = "g Polaroid"; local_5c._0_4_ = "g Negative"; local_5c._4_4_ = "debug 3"; local_5c._8_4_ = "debug 4"; local_5c._12_4_ = "g Mutant"; local_5c._16_4_ = "g Soy"; local_48 = "giveitem Belt"; local_44 = "repeat 5"; local_40 = "giveitem Lord of the Pit"; local_3c = "debug 10"; local_38 = &DAT_00b665bc; do { std::string::string_from_cstr(local_f4,(byte *)macroCommands[uVar6]) ; local_8._0_1_ = 0x5e; RunCommand(); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_f4); uVar6 = uVar6 + 1; } while (uVar6 < 0xc); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66664); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"delirium"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"beast"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b666a4); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b667e0); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66834); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"twitch"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66918); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b668a8); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b66178); if ((bVar2 != 0) && (uVar6 = FUN_00414410(), 2 < uVar6)) { FUN_004143f0(); FUN_006941b0(); local_8._0_1_ = 0x9d; RunCommand(); std::string::_Tidy_deallocate(local_5c + 0x10); } } else { uVar6 = FUN_00414410(); if (2 < uVar6) { FUN_004143f0(); FUN_006941b0(); local_8._0_1_ = 0x9c; RunCommand(); std::string::_Tidy_deallocate(local_5c + 0x10); } } } else { uVar6 = FUN_00414410(); if (3 < uVar6) { FUN_004143f0(); FUN_006941b0(); local_8._0_1_ = 0x9a; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_5c + 0x10); FUN_004143f0(); FUN_006941b0(); local_8._0_1_ = 0x9b; RunCommand(); std::string::_Tidy_deallocate(local_5c + 0x10); } } } else { std::string::string_from_cstr (local_5c + 0x10,(byte *)"debug 16"); local_8._0_1_ = 0x98; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_5c + 0x10); std::string::string_from_cstr (local_2c._buf,(byte *)"twitch_init"); local_8._0_1_ = 0x99; RunCommand(); std::string::_Tidy_deallocate(local_2c._buf); } } else { std::string::string_from_cstr (local_5c + 0x10,(byte *)"giveitem Belt"); local_8._0_1_ = 0x92; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_5c + 0x10); std::string::string_from_cstr (local_2c._buf,(byte *)"giveitem Lord of the Pit") ; local_8._0_1_ = 0x93; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_2c._buf); std::string::string_from_cstr (local_16c._buf,(byte *)"giveitem Treasure Map"); local_8._0_1_ = 0x94; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_16c._buf); std::string::string_from_cstr (local_19c._buf,(byte *)"giveitem Blue Map"); local_8._0_1_ = 0x95; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_19c._buf); std::string::string_from_cstr (local_1b4,(byte *)"giveitem Compass"); local_8._0_1_ = 0x96; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1b4); std::string::string_from_cstr(local_1cc,(byte *)"debug 3"); local_8._0_1_ = 0x97; RunCommand(); std::string::_Tidy_deallocate(local_1cc); } } else { std::string::string_from_cstr (local_5c + 0x10,(byte *)"giveitem Belt"); local_8._0_1_ = 0x83; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_5c + 0x10); std::string::string_from_cstr (local_2c._buf,(byte *)"repeat 5"); local_8._0_1_ = 0x84; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_2c._buf); std::string::string_from_cstr (local_16c._buf,(byte *)"giveitem Lord of the Pit"); local_8._0_1_ = 0x85; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_16c._buf); std::string::string_from_cstr (local_19c._buf,(byte *)"giveitem Treasure Map"); local_8._0_1_ = 0x86; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_19c._buf); std::string::string_from_cstr (local_1b4,(byte *)"giveitem Blue Map"); local_8._0_1_ = 0x87; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1b4); std::string::string_from_cstr (local_1cc,(byte *)"giveitem Compass"); local_8._0_1_ = 0x88; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1cc); std::string::string_from_cstr (local_1e4,(byte *)"giveitem Black Candle"); local_8._0_1_ = 0x89; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1e4); std::string::string_from_cstr (local_f4,(byte *)"giveitem X-Ray"); local_8._0_1_ = 0x8a; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr (local_124,(byte *)"giveitem We Need to Go Deeper"); local_8._0_1_ = 0x8b; RunCommand(local_124,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_13c,(byte *)"debug 8"); local_8._0_1_ = 0x8c; RunCommand(local_13c,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr (local_154,(byte *)"giveitem Dollar"); local_8._0_1_ = 0x8d; RunCommand(local_154,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr (local_dc,(byte *)"giveitem Pyro"); local_8._0_1_ = 0x8e; RunCommand(local_dc,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr (local_10c,(byte *)"giveitem Skeleton Key"); local_8._0_1_ = 0x8f; RunCommand(local_10c,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_10c); std::string::string_from_cstr(local_94._buf,(byte *)"debug 3") ; local_8._0_1_ = 0x90; RunCommand(&local_94,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_94._buf); std::string::string_from_cstr (local_ac._buf,(byte *)"debug 10"); local_8._0_1_ = 0x91; RunCommand(&local_ac,0,0); std::string::_Tidy_deallocate(local_ac._buf); } } else { std::string::string_from_cstr (local_f4,(byte *)"giveitem Dead Cat"); local_8._0_1_ = 0x72; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr(local_124,(byte *)"repeat 2"); local_8._0_1_ = 0x73; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr (local_13c,(byte *)"giveitem Guppy\'s Collar"); local_8._0_1_ = 0x74; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr (local_154,(byte *)"giveitem Holy Mantle"); local_8._0_1_ = 0x75; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr (local_dc,(byte *)"giveitem Schoolbag"); local_8._0_1_ = 0x76; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr (local_10c,(byte *)"giveitem MEAT!"); local_8._0_1_ = 0x77; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_10c); std::string::string_from_cstr(local_94._buf,(byte *)"repeat 12") ; local_8._0_1_ = 0x78; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_94._buf); std::string::string_from_cstr (local_ac._buf,(byte *)"giveitem Compass"); local_8._0_1_ = 0x79; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_ac._buf); std::string::string_from_cstr (local_7c,(byte *)"giveitem Blue Map"); local_8._0_1_ = 0x7a; RunCommand(local_7c,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_7c); std::string::string_from_cstr (local_c4,(byte *)"giveitem Treasure Map"); local_8._0_1_ = 0x7b; RunCommand(local_c4,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_c4); std::string::string_from_cstr (local_1e4,(byte *)"giveitem Baggy"); local_8._0_1_ = 0x7c; RunCommand(local_1e4,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1e4); std::string::string_from_cstr(local_1cc,(byte *)"giveitem p2"); local_8._0_1_ = 0x7d; RunCommand(local_1cc,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1cc); std::string::string_from_cstr(local_1b4,(byte *)"giveitem p3"); local_8._0_1_ = 0x7e; RunCommand(local_1b4,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_1b4); std::string::string_from_cstr (local_19c._buf,(byte *)"giveitem Purse"); local_8._0_1_ = 0x7f; RunCommand(&local_19c,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_19c._buf); std::string::string_from_cstr (local_16c._buf,(byte *)"giveitem Paper Clip"); local_8._0_1_ = 0x80; RunCommand(&local_16c,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_16c._buf); std::string::string_from_cstr (local_2c._buf,(byte *)"giveitem Petrified"); local_8._0_1_ = 0x81; RunCommand(&local_2c,0,0); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_2c._buf); std::string::string_from_cstr (local_5c + 0x10,(byte *)"giveitem My Little Unicorn") ; local_8._0_1_ = 0x82; RunCommand(local_5c + 0x10,0,0); std::string::_Tidy_deallocate(local_5c + 0x10); } } else { std::string::string_from_cstr(local_f4,(byte *)"stage 13"); local_8._0_1_ = 0x6b; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr (local_124,(byte *)"goto x.itemdungeon.666"); local_8._0_1_ = 0x6c; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_13c,(byte *)"combo 0.8"); local_8._0_1_ = 0x6d; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr(local_154,(byte *)"combo 2.8"); local_8._0_1_ = 0x6e; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr(local_dc,(byte *)"combo 1.3"); local_8._0_1_ = 0x6f; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr(local_10c,(byte *)"combo 4.3"); local_8._0_1_ = 0x70; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_10c); std::string::string_from_cstr(local_94._buf,(byte *)"debug 3"); local_8._0_1_ = 0x71; RunCommand(); std::string::_Tidy_deallocate(local_94._buf); } goto LAB_0069249e; } std::string::string_from_cstr(local_f4,(byte *)"combo 0.12"); local_8._0_1_ = 0x65; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr(local_124,(byte *)"combo 2.12"); local_8._0_1_ = 0x66; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_13c,(byte *)"combo 1.3"); local_8._0_1_ = 0x67; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr(local_154,(byte *)"combo 4.3"); local_8._0_1_ = 0x68; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr(local_dc,(byte *)"debug 3"); local_8._0_1_ = 0x69; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr(local_10c,(byte *)"goto s.boss.3414"); local_8._0_1_ = 0x6a; } else { std::string::string_from_cstr(local_f4,(byte *)"stage 9"); local_8._0_1_ = 0x5f; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr(local_124,&DAT_00b665bc); local_8._0_1_ = 0x60; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_13c,(byte *)"combo 0.8"); local_8._0_1_ = 0x61; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr(local_154,(byte *)"combo 2.8"); local_8._0_1_ = 0x62; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr(local_dc,(byte *)"combo 1.3"); local_8._0_1_ = 99; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_dc); std::string::string_from_cstr(local_10c,(byte *)"combo 4.3"); local_8._0_1_ = 100; } goto LAB_00690100; } std::string::string_from_cstr(local_f4,(byte *)"stage 8"); local_8._0_1_ = 0x59; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr(local_124,(byte *)"g Bible"); local_8._0_1_ = 0x5a; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_13c,&DAT_00b665bc); local_8._0_1_ = 0x5b; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr(local_154,(byte *)"debug 3"); local_8._0_1_ = 0x5c; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr(local_dc,(byte *)"debug 4"); local_8._0_1_ = 0x5d; } else { std::string::string_from_cstr(local_f4,(byte *)"stage 6"); local_8._0_1_ = 0x54; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_f4); std::string::string_from_cstr(local_124,(byte *)"g Bible"); local_8._0_1_ = 0x55; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_124); std::string::string_from_cstr(local_13c,&DAT_00b665bc); local_8._0_1_ = 0x56; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_13c); std::string::string_from_cstr(local_154,(byte *)"debug 3"); local_8._0_1_ = 0x57; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_154); std::string::string_from_cstr(local_dc,(byte *)"debug 4"); local_8._0_1_ = 0x58; } } else { std::string::string_from_cstr(local_dc,(byte *)"goto s.boss.5000"); local_8._0_1_ = 0x42; } } else { std::string::string_from_cstr(local_94._buf,(byte *)"debug 3"); local_8._0_1_ = 0x3c; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_94._buf); std::string::string_from_cstr(local_ac._buf,(byte *)"debug 8"); local_8._0_1_ = 0x3d; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_ac._buf); std::string::string_from_cstr(local_7c,(byte *)"debug 9"); local_8._0_1_ = 0x3e; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_7c); std::string::string_from_cstr(local_c4,(byte *)"giveitem Soy"); local_8._0_1_ = 0x3f; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_c4); std::string::string_from_cstr(local_10c,(byte *)"giveitem Bar"); local_8._0_1_ = 0x40; RunCommand(); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_10c); std::string::string_from_cstr(local_dc,(byte *)"giveitem Pad"); local_8._0_1_ = 0x41; } RunCommand(); std::string::_Tidy_deallocate(local_dc); goto LAB_0069249e; } } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"playsfx"); if ((bVar2 != 0) && (uVar6 = FUN_00414410(), 1 < uVar6)) { local_1fc = (Entity_NPC *)0x3f800000; uVar6 = FUN_00414410(); if (2 < uVar6) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); dVar28 = atof((char *)pbVar3); local_204 = (Entity_NPC *)(float)dVar28; local_1fc = local_204; } pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); iVar20 = atoi((char *)pbVar3); SoundEffects::PlayWithFartOverride(iVar20,1.0,2,0,(float)local_1fc); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"curse"); if ((bVar2 != 0) && (uVar6 = FUN_00414410(), 1 < uVar6)) { uVar26 = 1; uVar6 = FUN_00414410(); if (1 < uVar6) { do { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); atoi((char *)pbVar3); uVar26 = uVar26 + 1; uVar6 = FUN_00414410(); } while (uVar26 < uVar6); } FUN_00685f50(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"reseed"); if (bVar2 != 0) { seeds = (Seeds *)Game::GetSeeds(g_game); Config::GetCollectibles(); iVar20 = _get_index_plus_one_if_kind_4_5(); Seeds::ForgetStageSeed(seeds,iVar20); Config::GetCollectibles(); Level::Init(); level = (Level *)Config::GetCollectibles(); Level::Update(level); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); PlayerManager::trigger_new_room_effects(playerManager); std::string::string_from_cstr(local_5c + 0x10,(byte *)"Changed stage.\n"); local_8._0_1_ = 0x9e; LAB_00691611: Print((Console *)in_ECX,(std_string *)(local_5c + 0x10),0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_5c + 0x10); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b658fc); if (bVar2 != 0) { iVar20 = 0; do { Room::GetTopLeftPos((Room *)g_manager); FUN_0092b230(); iVar20 = iVar20 + 1; } while (iVar20 < 0x50); std::string::string_from_cstr (local_5c + 0x10,(byte *)"All easter eggs unlocked in main menu.\n"); local_8._0_1_ = 0x9f; Print((Console *)in_ECX,(std_string *)(local_5c + 0x10),0xffd3d3d3,0x96); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_5c + 0x10); std::string::string_from_cstr (local_2c._buf,(byte *)"On the easter eggs menu press Q+E+Tab\n"); local_8._0_1_ = 0xa0; Print((Console *)in_ECX,&local_2c,0xffd3d3d3,0x96); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_2c._buf); std::string::string_from_cstr (local_16c._buf,(byte *)"or LB+RB+X to remove one from the list.\n"); local_8._0_1_ = 0xa1; Print((Console *)in_ECX,&local_16c,0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_16c._buf); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b65904); if ((bVar2 != 0) && (iVar20 = FUN_00414410(), iVar20 == 2)) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_204 = (Entity_NPC *)atoi((char *)pbVar3); std::string::string_from_cstr(local_ac._buf,&s_empty); local_8 = CONCAT31(local_8._1_3_,0xa2); Room::GetGridHeight((Room *)((in_ECX->_sprite)._filename._buf + 0xc)); piVar17 = (int *)std::min(); for (iVar20 = *piVar17; 0 < iVar20; iVar20 = iVar20 + -1) { FUN_0060c530(); FUN_00694170(); local_8._0_1_ = 0xa3; FUN_00651af0(); local_8 = CONCAT31(local_8._1_3_,0xa2); std::string::_Tidy_deallocate(local_5c + 0x10); } std::string::c_str(local_ac._buf); FUN_00a19440(); FUN_00a26620(); std::string::string_from_cstr(local_5c + 0x10,(byte *)"Copied.\n"); local_8._0_1_ = 0xa4; Print((Console *)in_ECX,(std_string *)(local_5c + 0x10),0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_5c + 0x10); std::string::_Tidy_deallocate(local_ac._buf); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"luarun"); if ((bVar2 != 0) && (iVar20 = FUN_00414410(), iVar20 == 2)) { pcVar12 = (char *)FUN_004143f0(); std::string::c_str(pcVar12); FUN_0086e6c0(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b659d8); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,&DAT_00b669b4); if (bVar2 != 0) goto LAB_006918d8; } else { LAB_006918d8: uVar6 = FUN_00414410(); if (1 < uVar6) { pvVar10 = (void *)FUN_004143f0(); std::string::string(local_ac._buf,pvVar10); local_8 = CONCAT31(local_8._1_3_,0xa5); uVar6 = FUN_00414410(); if (2 < uVar6) { uVar26 = 2; uVar6 = FUN_00414410(); if (2 < uVar6) { do { FUN_004143f0(); FUN_00421620(); local_8._0_1_ = 0xa6; FUN_00651d50(); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); local_8 = CONCAT31(local_8._1_3_,0xa5); std::string::_Tidy_deallocate(local_2c._buf); uVar26 = uVar26 + 1; uVar6 = FUN_00414410(); } while (uVar26 < uVar6); } } FUN_00865660(); local_8._0_1_ = 0xa7; cVar1 = FUN_0040c2d0(); if (cVar1 == '\0') { PrintError((Console *)in_ECX,(std_string *)local_7c); } std::string::_Tidy_deallocate(local_7c); std::string::_Tidy_deallocate(local_ac._buf); goto LAB_0069249e; } } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"luamod"); if ((bVar2 != 0) && (uVar6 = FUN_00414410(), 1 < uVar6)) { pvVar10 = (void *)FUN_004143f0(); std::string::string(local_7c,pvVar10); local_8 = CONCAT31(local_8._1_3_,0xa8); uVar6 = FUN_00414410(); if (2 < uVar6) { uVar26 = 2; uVar6 = FUN_00414410(); if (2 < uVar6) { do { FUN_004143f0(); FUN_00421620(); local_8._0_1_ = 0xa9; FUN_00651d50(); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c + 0x10); local_8 = CONCAT31(local_8._1_3_,0xa8); std::string::_Tidy_deallocate(local_2c._buf); uVar26 = uVar26 + 1; uVar6 = FUN_00414410(); } while (uVar26 < uVar6); } } FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *) local_7c); FUN_00684e50(); FUN_00693eb0(); luaEngine = (LuaEngine *)FUN_0040d210(); pbVar3 = LuaEngine::LuamodCMD(luaEngine,local_7c); if ((char)pbVar3 == '\0') { std::string::string_from_cstr(local_5c + 0x10,(byte *)"Failed to run mod!\n"); local_8._0_1_ = 0xab; } else { std::string::string_from_cstr(local_5c + 0x10,(byte *)"Success!\n"); local_8._0_1_ = 0xaa; } Print((Console *)in_ECX,(std_string *)(local_5c + 0x10),0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_5c + 0x10); std::string::_Tidy_deallocate(local_7c); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"luamem"); if (bVar2 != 0) { FUN_00685cc0(); lua_gc(); FUN_00685cc0(); lua_gc(); print_format(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"reloadshaders"); if (bVar2 != 0) { modManager = (ModManager *)FUN_0040d210(); ModManager::TriggerResize(modManager); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"testbosspool"); if (bVar2 != 0) { FUN_005cba40(); local_8._0_1_ = 0xac; iVar20 = 10000; do { FUN_00685ef0(); Random(); BossPool::init(); bossPool = (BossPool *)FUN_00685ef0(); Config::GetCollectibles(); iVar4 = GridEntity::GetType(); Config::GetCollectibles(); leveltype = EntityPtr::Ref(); local_1fc = (Entity_NPC *) BossPool::GetBossId(bossPool,leveltype,iVar4,(RNG *)0x0); std::set::find(); std::iterator_copy(&local_228,&local_218.y); cVar1 = FUN_00557bb0(); if (cVar1 == '\0') { iVar4 = FUN_005cba30(); *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 1; } else { local_204 = (Entity_NPC *)0x1; FUN_005cbfa0(); FUN_005cbfc0(); } iVar20 = iVar20 + -1; } while (iVar20 != 0); FUN_0042c770(); std::iterator_copy(&local_228,&local_204); cVar1 = FUN_0042c710(); while (cVar1 != '\0') { piVar17 = (int *)FUN_005cba30(); if (*piVar17 < 0) { if (g_game != (Game *)0x0) { FUN_00685ed0(); FUN_005cba30(); FUN_005cba30(); goto LAB_00691de8; } } else if (g_game != (Game *)0x0) { FUN_00685ed0(); FUN_005cba30(); FUN_00417910(); FUN_005cba30(); iVar20 = FUN_0069d200(); std::string::c_str((char *)(iVar20 + 4)); LAB_00691de8: print_format(); } FUN_00693270(); std::iterator_copy(&local_228,&local_204); cVar1 = FUN_0042c710(); } FUN_00436fb0(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"addplayer"); if (bVar2 == 0) { psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"reloadfx"); if (bVar2 != 0) { Level::GetCurrentRoom((Level *)g_game); Room::reload_backdrop(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"reloadwisps"); if (bVar2 != 0) { itemConfig = Isaac::GetItemConfig(); modManager = (ModManager *)FUN_0040d210(); std::string::string_from_cstr(local_5c + 0x10,(byte *)"wisps.xml"); local_8._0_1_ = 0xaf; ModManager::TryRedirectPath (modManager,&local_16c,(std_string *)(local_5c + 0x10)); local_8._0_1_ = 0xb0; pbVar3 = std::string::c_str(entityConfig); ItemConfig::load_wisps_xml(itemConfig,pbVar3,(void *)0x0); std::string::_Tidy_deallocate(local_16c._buf); local_8 = (uint)local_8._1_3_ << 8; std::string::_Tidy_deallocate(local_5c + 0x10); itemConfig = Isaac::GetItemConfig(); modManager = (ModManager *)FUN_0040d210(); std::string::string_from_cstr(local_2c._buf,(byte *)"locusts.xml"); local_8._0_1_ = 0xb1; ModManager::TryRedirectPath(modManager,&local_19c,&local_2c); local_8._0_1_ = 0xb2; pbVar3 = std::string::c_str(entityConfigEntry); ItemConfig::LoadLocustConfig(itemConfig,pbVar3,(ModEntry *)0x0); std::string::_Tidy_deallocate(local_19c._buf); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_2c._buf); Level::GetCurrentRoom((Level *)g_game); local_21c = Room::GetEntities(); local_1fc = (Entity_NPC *)0x0; iVar20 = EntityList::Size(); if (iVar20 != 0) { do { puVar16 = (undefined4 *)std::vector::operator_index(); pEVar23 = (Entity *)*puVar16; local_20c = pEVar23; bVar2 = Entity::IsType(pEVar23,3,0xce,-1); if (bVar2 == 0) { bVar2 = Entity::IsType(pEVar23,3,0xe7,-1); if (bVar2 != 0) { local_204 = *(Entity_NPC **)(*(int *)pEVar23 + 4); Entity::InitSeed(pEVar23); Entity::SubType(pEVar23); Entity::Variant(pEVar23); Entity::Type(local_20c); (*(code *)local_204)(); } } else { local_204 = *(Entity_NPC **)(*(int *)pEVar23 + 4); Entity::InitSeed(); Entity::SubType(pEVar23); Entity::Variant(pEVar23); Entity::Type(local_20c); (*(code *)local_204)(); } puVar25 = &local_1fc->field_0x1; local_1fc = (Entity_NPC *)puVar25; puVar19 = (undefined1 *)EntityList::Size(); } while (puVar25 < puVar19); } goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"rewind"); if (bVar2 != 0) { Game::rewind((Entity_Player *)0x0); seeds = (Seeds *)Game::GetSeeds(g_game); Seeds::construct_from_copy((Seeds *)(acStack_280 + -0x40),seeds); Manager::RestartGame(); seeds = (Seeds *)Game::GetSeeds(g_game); Seeds::operator_assign(&g_manager->_startSeeds,seeds); manager = g_manager; g_manager->_isSaveOnExit = 1; manager->_rerunAvailable = 1; FUN_00685ee0(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"clear"); if (bVar2 != 0) { FUN_00686110(); goto LAB_0069249e; } psVar11 = (std_string *)FUN_004143f0(); bVar2 = str_eq_cstr(psVar11,(byte *)"fix_rng_history_log"); if (bVar2 == 0) goto LAB_0069249e; iVar20 = FUN_00414410(); if (iVar20 == 2) { pcVar12 = (char *)FUN_004143f0(); std::string::c_str(pcVar12); iVar20 = write_desync_dump(); if (iVar20 == 0) { std::string::string_from_cstr (local_5c + 0x10,(byte *)"Successfully fixed history log.\n"); local_8._0_1_ = 0xb3; goto LAB_00691611; } } else { FUN_00414410(); } LAB_00692495: print_format(); goto LAB_0069249e; } local_200 = 0xffffffff; local_1fc = (Entity_NPC *)0x0; uVar6 = FUN_00414410(); if (1 < uVar6) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_1fc = (Entity_NPC *)atoi((char *)pbVar3); } uVar6 = FUN_00414410(); if (uVar6 < 3) { LAB_00691ed6: local_218.x = 0.0; local_218.y = 0.0; uVar6 = 0; iVar20 = Game::GetNumPlayers(g_game); fVar21 = local_218.x; fVar27 = local_218.y; if (iVar20 != 0) { do { pEVar22 = Game::GetPlayer(g_game,uVar6); controllerIndex = Entity_Player::ControllerIndex(pEVar22); uVar26 = 1 << (controllerIndex & 0x1f); uVar9 = 0; if (0x1f < controllerIndex) { uVar9 = uVar26; } uVar26 = uVar26 ^ uVar9; if (0x3f < controllerIndex) { uVar9 = uVar26; } fVar21 = (float)((uint)fVar21 | uVar26); fVar27 = (float)((uint)fVar27 | uVar9); uVar6 = uVar6 + 1; uVar26 = Game::GetNumPlayers(g_game); } while (uVar6 < uVar26); } uVar6 = 0; iVar20 = KAGE::Input::Manager::get_device_count(); if (iVar20 != 0) { do { KAGE::Input::Manager::get_device ((Manager *)&PTR_vftable_00c57b18,&local_218,uVar6); local_8._0_1_ = 0xad; iVar20 = EntityPtr::Ref(); if (iVar20 != 0) { uVar26 = 1 << (uVar6 & 0x1f); uVar9 = 0; if (0x1f < uVar6) { uVar9 = uVar26; } uVar26 = uVar26 ^ uVar9; if (0x3f < uVar6) { uVar9 = uVar26; } if ((uVar26 & (uint)fVar21) == 0 && (uVar9 & (uint)fVar27) == 0) { piVar17 = (int *)EntityPtr::Ref(); _MaxCount = 8; _Str2 = "Wireless"; pcVar12 = (char *)(**(code **)(*piVar17 + 0xc))(); iVar20 = strncmp(pcVar12,_Str2,_MaxCount); if (iVar20 != 0) { EntityPtr::Ref(); uVar6 = EntityList::Size(); local_8._0_1_ = 0; FUN_004242b0(); goto LAB_00691fe7; } } } local_8._0_1_ = 0; FUN_004242b0(); uVar6 = uVar6 + 1; uVar26 = KAGE::Input::Manager::get_device_count(); } while (uVar6 < uVar26); } uVar6 = local_200; LAB_00691fe7: if ((int)uVar6 < 0) { uVar6 = 0; } } else { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); uVar6 = atoi((char *)pbVar3); local_200 = uVar6; if ((int)uVar6 < 0) goto LAB_00691ed6; } if (g_game != (Game *)0x0) { FUN_00685ed0(); InputManager::get_device(&PTR_vftable_00c57b18,local_c4 + 0x10,uVar6); local_8 = CONCAT31(local_8._1_3_,0xae); local_21c = 1; piVar17 = (int *)EntityPtr::Ref(); (**(code **)(*piVar17 + 0xc))(); print_format(); } local_8._0_1_ = 0; local_8._1_3_ = 0; if ((local_21c & 1) != 0) { FUN_004242b0(); } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); pEVar22 = (Entity_Player *)PlayerManager::SpawnCoPlayer2(playerManager); Entity_Player::SetControllerIndex(pEVar22); pEVar7 = Game::GetPlayer(g_game,0); pVVar5 = Entity::Position((Entity *)pEVar7,(Vector *)(local_c4 + 0x10)); pVVar18 = MusicManager::RandomVector(&local_218); local_204 = (Entity_NPC *)0x41200000; pVVar18 = Vector::operator_mul(&local_228,(float *)&local_204,pVVar18); pVVar5 = Vector::__add(pVVar5,&local_238,pVVar18); Entity::SetPosition((Entity *)pEVar22,pVVar5); hud = (HUD *)Game::GetHUD(g_game); HUD::AssignPlayerHUDs(hud); Entity_Player::InitPostLevelInitStats(pEVar22); goto LAB_0069249e; } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::ShopRestockFull(pRVar13); std::string::string_from_cstr(local_94._buf,(byte *)"Shop is fully restocked.\n"); local_8._0_1_ = 0x3b; } else { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); uVar6 = atoi((char *)pbVar3); if (uVar6 < 0x1b) { Manager::ShowCutscene(g_manager,uVar6,0,1); goto LAB_0069249e; } std::string::string_from_cstr(local_94._buf,(byte *)"Invalid cutscene ID.\n"); local_8._0_1_ = 0x3a; } goto LAB_0068d95d; } FUN_004143f0(); string_split(); local_8._0_1_ = 0x39; iVar4 = 1; local_200 = 0; iVar20 = FUN_00414410(); pcVar24 = atoi_exref; if (iVar20 != 0) { pRVar13 = (Room *)FUN_004143f0(); iVar20 = Room::GetGridHeight(pRVar13); if (iVar20 != 0) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_200 = atoi((char *)pbVar3); if (((int)local_200 < 0) || (0x1e < (int)local_200)) { local_200 = 0; } pcVar24 = atoi_exref; } } uVar6 = FUN_00414410(); if (uVar6 < 2) { LAB_0068fc25: do { itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar6 = Random(); iVar20 = ItemPool::GetCollectible(itemPool,local_200,uVar6,0,0,0); Entity_Player::AddCollectible(param_3,iVar20,-1,1,0,0,0); iVar4 = iVar4 + -1; } while (iVar4 != 0); } else { pRVar13 = (Room *)FUN_004143f0(); iVar20 = Room::GetGridHeight(pRVar13); if (iVar20 == 0) goto LAB_0068fc25; pcVar12 = (char *)FUN_004143f0(); std::string::c_str(pcVar12); iVar4 = (*pcVar24)(); if (0 < iVar4) goto LAB_0068fc25; } std::vector::_Tidy(); goto LAB_0069249e; } pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_20c = (Entity *)atoi((char *)pbVar3); uVar6 = 1; if ((int)local_20c < 1) goto LAB_0069249e; local_204 = (Entity_NPC *)0x2710; puVar16 = (undefined4 *)std::min(); local_20c = (Entity *)*puVar16; uVar26 = Room::GetGridHeight((Room *)((in_ECX->_sprite)._filename._buf + 0xc)); if (1 < uVar26) { do { FUN_0060c560(); FUN_00693560(); FUN_0060c420(); iVar20 = FUN_00557b70(); if (iVar20 == -1) break; uVar6 = uVar6 + 1; uVar26 = Room::GetGridHeight((Room *)((in_ECX->_sprite)._filename._buf + 0xc)); } while (uVar6 < uVar26); } uVar26 = Room::GetGridHeight((Room *)((in_ECX->_sprite)._filename._buf + 0xc)); if (uVar6 < uVar26) { FUN_0060c560(); FUN_00693560(); pvVar10 = (void *)FUN_0060c420(); std::string::string(local_ac._buf,pvVar10); local_8._0_1_ = 0x2e; std::string::c_str(local_ac._buf); print_format(); iVar20 = 0; if (0 < (int)local_20c) { do { RunCommand(); iVar20 = iVar20 + 1; } while (iVar20 < (int)local_20c); } std::string::_Tidy_deallocate(local_ac._buf); goto LAB_0069249e; } std::string::string_from_cstr(local_94._buf,(byte *)"Nothing to repeat.\n"); local_8._0_1_ = 0x2d; } else { uVar6 = 1; local_1e5 = 1; local_200 = 1; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); iVar20 = std::vector::size(pvVar10); if (1 < iVar20) { do { bVar2 = Entity_Player::HasCollectible(param_3,uVar6,0); if (bVar2 != 0) { if (local_1e5 == 0) { std::string::string_from_cstr(local_94._buf,&DAT_00b66304); local_8._0_1_ = 0x2a; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_94._buf); } Entity_Player::GetCollectibleNum(param_3,uVar6,0); itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,local_200); psVar11 = ItemConfig_Item::GetLocalizedName (configItem,(std_string *)(local_5c + 0x10),0); local_8._0_1_ = 0x2b; std::string::c_str(psVar11->_buf); print_format(); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_5c + 0x10); local_1e5 = 0; uVar6 = local_200; } uVar6 = uVar6 + 1; local_200 = uVar6; Isaac::GetItemConfig(); pvVar10 = (void *)Config::GetCollectibles(); iVar20 = std::vector::size(pvVar10); } while ((int)uVar6 < iVar20); } std::string::string_from_cstr(local_94._buf,&DAT_00b66310); local_8._0_1_ = 0x2c; } } else { uVar6 = FUN_00414410(); if (2 < uVar6) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_21c = atoi((char *)pbVar3); pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); local_1fc = (Entity_NPC *)atoi((char *)pbVar3); uVar6 = FUN_00414410(); if (uVar6 < 4) { uVar6 = 0xffffffff; } else { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); uVar6 = atoi((char *)pbVar3); } if (((local_21c < 0xd) && (local_1fc < (Entity_NPC *)&DAT_0000000d)) && (uVar6 < 3)) { level = (Level *)Config::GetCollectibles(); local_204 = (Entity_NPC *)((int)local_1fc * 0xd + local_21c); roomDesc = Level::GetRoomByIdx(level,(int)local_204,uVar6); if (roomDesc->Data != (void *)0x0) { Game::StartRoomTransition(g_game,(int)local_204,-1,1,param_3,uVar6); std::string::string_from_cstr(local_94._buf,(byte *)"Changed room.\n"); local_8._0_1_ = 0xf; goto LAB_0068d95d; } } std::string::string_from_cstr(local_94._buf,(byte *)"Error changing room.\n"); local_8._0_1_ = 0x10; goto LAB_0068d95d; } iVar20 = FUN_00414410(); if (iVar20 != 2) goto LAB_0069249e; FUN_004143f0(); pcVar12 = (char *)FUN_004170e0(); if (*pcVar12 != '.') goto LAB_0069249e; FUN_004143f0(); pbVar3 = (byte *)FUN_004170e0(); local_1e5 = *pbVar3; if ((local_1e5 == 0x73) || (local_1e5 == 0x78)) { FUN_004143f0(); FUN_00651a90(); local_8._0_1_ = 0x11; string_split(); local_8._0_1_ = 0x12; FUN_004143f0(); local_204 = (Entity_NPC *)RoomConfig::GetStageIdByName(); local_8._0_1_ = 0x11; std::vector::_Tidy(); uVar26 = 0; string_split(); local_8._0_1_ = 0x13; uVar6 = FUN_00414410(); if (1 < uVar6) { pRVar13 = (Room *)FUN_004143f0(); iVar20 = Room::GetGridHeight(pRVar13); if (iVar20 != 0) { pcVar12 = (char *)FUN_004143f0(); pbVar3 = std::string::c_str(pcVar12); uVar26 = atoi((char *)pbVar3); } } roomConfigs = (RoomConfig *)FUN_00421790(); if (local_1e5 == 0x78) { game = (Game *)Config::GetCollectibles(); uVar6 = Game::GetStageID(game,0); } else { uVar6 = 0; } roomConfig = RoomConfig::GetRoomByStageTypeAndVariant (roomConfigs,uVar6,(uint)local_204,uVar26,-1); std::vector::_Tidy(); local_8._0_1_ = 0; std::string::_Tidy_deallocate(local_ac._buf); LAB_0068dccb: if (roomConfig != (RoomConfig_Room *)0x0) { level = (Level *)Config::GetCollectibles(); Level::DEBUG_goto_room(level,roomConfig); std::string::string_from_cstr(local_94._buf,(byte *)"Changed room.\n"); local_8._0_1_ = 0x14; goto LAB_0068d95d; } } else if (local_1e5 == 100) { FUN_004143f0(); pcVar12 = (char *)FUN_00651a90(); pbVar3 = std::string::c_str(pcVar12); uVar6 = atoi((char *)pbVar3); std::string::_Tidy_deallocate(local_5c + 0x10); roomConfigs = (RoomConfig *)FUN_00421790(); game = (Game *)Config::GetCollectibles(); uVar26 = Game::GetStageID(game,0); roomConfig = RoomConfig::GetRoomByStageTypeAndVariant(roomConfigs,uVar26,1,uVar6,-1); goto LAB_0068dccb; } std::string::string_from_cstr(local_94._buf,(byte *)"Error changing room.\n"); local_8._0_1_ = 0x15; } LAB_0068d95d: Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_94._buf); goto LAB_0069249e; } local_8._0_1_ = 1; FUN_00424510(); local_21c = 4; string_split(); local_22c = 0; local_1fc = (Entity_NPC *)0x0; local_230 = 0; local_1f5 = '\0'; local_1e5 = 0; local_200 = 0xffffffff; iVar20 = (int)(local_6c - (int)local_70) >> 0x1f; if ((int)(local_6c - (int)local_70) / 0x18 + iVar20 != iVar20) { pbVar3 = std::string::c_str(local_70); local_22c = atoi((char *)pbVar3); } if (1 < (uint)((int)(local_6c - (int)local_70) / 0x18)) { pbVar3 = std::string::c_str(local_70 + 0x18); local_1fc = (Entity_NPC *)atoi((char *)pbVar3); } if (2 < (uint)((int)(local_6c - (int)local_70) / 0x18)) { pbVar3 = std::string::c_str(local_70 + 0x30); local_230 = atoi((char *)pbVar3); } if (3 < (uint)((int)(local_6c - (int)local_70) / 0x18)) { iVar20 = 0; while( true ) { while( true ) { pcVar12 = local_70 + 0x48; if (0xf < *(uint *)(local_70 + 0x5c)) { pcVar12 = *(char **)pcVar12; } iVar4 = tolower((int)pcVar12[iVar20]); in_ECX = local_20c; if ((char)iVar4 != 'f') break; iVar20 = iVar20 + 1; local_1f5 = '\x01'; } if ((char)iVar4 != 'p') break; iVar20 = iVar20 + 1; local_1e5 = 1; } luaEngine = (int *)(local_70 + 0x48); piVar17 = luaEngine; if (0xf < *(uint *)(local_70 + 0x5c)) { piVar17 = (int *)*luaEngine; } if (*(char *)((int)piVar17 + iVar20) == '\0') { local_200 = 0xffffffff; } else { local_200 = iVar20; pbVar3 = std::string::c_str((char *)luaEngine); local_200 = atoi((char *)(pbVar3 + iVar20)); } } pRVar13 = g_game->_room; pVVar5 = Room::GetCenterPos(&local_218); Room::FindFreePickupSpawnPosition(pRVar13,(Vector *)(local_c4 + 0x10),pVVar5,0.0,0,0,0); pRVar13 = g_game->_room; uVar6 = Room::GetGridIndex(pRVar13,(Vector *)(local_c4 + 0x10)); if (uVar6 < 0x1c0) { pRVar13->_gridPaths[uVar6] = 900; } pEVar22 = (Entity_Player *)0x0; local_208 = (Entity_Player *)0x0; if (local_22c == 1) { pEVar22 = (Entity_Player *)PlayerManager::SpawnCoPlayerBaby(&g_game->_playerManager); local_208 = pEVar22; pEVar7 = (Entity_Player *)__RTDynamicCast(); Entity_Player::apply_coop_baby_spawn_bonus(pEVar7); HUD::AssignPlayerHUDs(&g_game->_hud); } else if (local_22c != 0) { uVar6 = Random(); pEVar22 = (Entity_Player *) Game::Spawn(g_game,local_22c,(uint)local_1fc,(Vector *)(local_c4 + 0x10),&g_vectorZero ,(Entity *)0x0,local_230,uVar6); local_208 = pEVar22; } local_1fc = (Entity_NPC *)__RTDynamicCast(); if ((local_1fc != (Entity_NPC *)0x0) && (-1 < (int)local_200)) { Entity_NPC::Morph(local_1fc,local_1fc->_type,local_1fc->_variant,local_1fc->_subtype,local_200); } if (local_1e5 != 0) { if (param_3 == (Entity_Player *)0x0) { iVar20 = 0; } else { iVar20 = param_3->_controllerIndex; } local_1fc->_controllerID = iVar20; } if ((pEVar22 == (Entity_Player *)0x0) || (pEVar22->_type == 0)) { local_204 = (Entity_NPC *)&g_manager->_entityConfig; FUN_006936e0(); FUN_006936e0(); if (local_200 != local_22c) { do { if ((pEVar22 != (Entity_Player *)0x0) && (pEVar22->_type != 0)) goto LAB_0068d54c; local_1fc = (Entity_NPC *)(local_200 + 0x18); if ((*(uint *)local_1fc != 5) || ((*(int *)(local_200 + 0x1c) != 300 || (*(int *)(local_200 + 0x20) == 0)))) { FUN_0040cca0(); FUN_0040cfe0(); local_8._0_1_ = 3; if (1 < (uint)((tokensEnd - tokensBegin) / 0x18)) { if (local_184 != (basic_string,std::allocator_> *) (tokensBegin + 0x18)) { local_230 = local_230 & 0xffffff00; FUN_0040c720(); } if (2 < (uint)((tokensEnd - tokensBegin) / 0x18)) { uVar6 = 2; do { FUN_00421620(); local_8 = CONCAT31(local_8._1_3_,4); pbVar8 = (basic_string,std::allocator_> *) FUN_00651d50(); if (local_184 != pbVar8) { FUN_004215e0(); } std::string::_Tidy_deallocate(local_5c + 0x10); local_8._0_1_ = 3; std::string::_Tidy_deallocate(local_2c._buf); uVar6 = uVar6 + 1; } while (uVar6 < (uint)((tokensEnd - tokensBegin) / 0x18)); in_ECX = local_20c; } FUN_00684e50(); std::basic_string,std::allocator_>::end(local_184); FUN_00684e50(); FUN_00693eb0(); } EntityConfig_Entity::GetName((EntityConfig_Entity *)local_1fc,&local_ac,0); local_8._0_1_ = 5; FUN_00684e50(); std::basic_string,std::allocator_>::end ((basic_string,std::allocator_> *)&local_ac); FUN_00684e50(); FUN_00693eb0(); iVar20 = FUN_00693650(); if (iVar20 == -1) { pEVar22 = local_208; } else { uVar6 = *(uint *)local_1fc; uVar26 = *(uint *)&local_1fc->field_0x4; pvVar10 = (local_1fc->_damageEvents)._begin; uVar9 = Random(); pEVar22 = (Entity_Player *) Game::Spawn(g_game,uVar6,uVar26,(Vector *)(local_c4 + 0x10),&g_vectorZero, (Entity *)0x0,(uint)pvVar10,uVar9); local_208 = pEVar22; std::string::string_from_cstr(local_94._buf,(byte *)"Spawned entity.\n"); in_ECX = local_20c; local_8._0_1_ = 6; Print((Console *)local_20c,&local_94,0xffd3d3d3,0x96); std::string::_Tidy_deallocate(local_94._buf); } std::string::_Tidy_deallocate(local_ac._buf); local_8._0_1_ = 1; std::string::_Tidy_deallocate((char *)local_184); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_200); FUN_006936e0(); } while (local_200 != local_22c); } if ((pEVar22 != (Entity_Player *)0x0) && (pEVar22->_type != 0)) goto LAB_0068d54c; std::string::string_from_cstr(local_94._buf,(byte *)"Error spawning entity.\n"); local_8._0_1_ = 7; Print((Console *)in_ECX,&local_94,0xffd3d3d3,0x96); local_8._0_1_ = 1; std::string::_Tidy_deallocate(local_94._buf); if (pEVar22 != (Entity_Player *)0x0) goto LAB_0068d54c; } else { std::string::string_from_cstr(local_ac._buf,(byte *)"Spawned entity.\n"); local_8._0_1_ = 2; Print((Console *)in_ECX,&local_ac,0xffd3d3d3,0x96); local_8._0_1_ = 1; std::string::_Tidy_deallocate(local_ac._buf); LAB_0068d54c: if (local_1f5 != '\0') { EntityRef::constructor((EntityRef *)local_5c,(Entity *)0x0); Entity::AddCharmed((Entity *)pEVar22,(EntityRef *)local_5c,-1,0,0); } } std::vector::_Tidy(); LAB_0069249e: std::vector::_Tidy(); ExceptionList = local_10; return; } //@@ 006924d0 FUN_006924d0 void FUN_006924d0(void) { char *pcVar1; ushort *puVar2; Manager *pMVar3; ushort uVar4; int iVar5; int in_ECX; char *pcVar6; char *pcVar7; int iVar8; uint local_18; int local_14; uint local_10; Font *local_c; byte local_8 [4]; pMVar3 = g_manager; iVar8 = 0; *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(in_ECX + 0x34); uVar4 = 0; local_8[0] = 0; local_8[1] = 0; local_10 = 0; iVar5 = (pMVar3->_optionsConfig)._consoleFont; if (iVar5 != 0) { if (iVar5 == 1) { local_c = &pMVar3->_font5_terminus8; goto LAB_0069252a; } if (iVar5 == 2) { local_c = &pMVar3->_font8_LuaMiniOutlined; goto LAB_0069252a; } } local_c = &pMVar3->_font4_terminus; LAB_0069252a: pcVar1 = (char *)(in_ECX + 0x1c); pcVar7 = pcVar1; local_14 = in_ECX; if (0xf < *(uint *)(in_ECX + 0x30)) { pcVar7 = *(char **)pcVar1; } do { while( true ) { local_18 = (uint)uVar4; pcVar6 = pcVar1; if (0xf < *(uint *)(in_ECX + 0x30)) { pcVar6 = *(char **)pcVar1; } if (pcVar7 == pcVar6 + *(int *)(in_ECX + 0x2c)) { return; } local_8[0] = *pcVar7; iVar5 = Font::get_string_width_n(local_c,local_8,-1); iVar8 = iVar8 + iVar5; if (g_screenWidth - 20.0 < (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)])) break; LAB_0069261d: pcVar7 = pcVar7 + 1; uVar4 = uVar4 + 1; } pcVar6 = pcVar7 + -1; while( true ) { uVar4 = uVar4 - 1; pcVar7 = pcVar7 + -1; if (uVar4 <= (ushort)local_10) break; iVar5 = isspace((int)*pcVar7); if ((iVar5 != 0) || (iVar5 = ispunct((int)*pcVar7), iVar5 != 0)) goto LAB_006925de; } uVar4 = (short)local_18 - 1; pcVar7 = pcVar6; LAB_006925de: local_18 = (uint)(ushort)(uVar4 + 1); iVar8 = 0; puVar2 = *(ushort **)(local_14 + 0x38); local_10 = local_18; if (puVar2 == *(ushort **)(local_14 + 0x3c)) { FUN_0042f580(puVar2,&local_18); local_10 = local_18; goto LAB_0069261d; } *puVar2 = uVar4 + 1; pcVar7 = pcVar7 + 1; *(int *)(local_14 + 0x38) = *(int *)(local_14 + 0x38) + 2; uVar4 = uVar4 + 1; } while( true ); } //@@ 00692630 Console::wrap_line /* WARNING: Removing unreachable block (ram,0x00692919) */ /* WARNING: Removing unreachable block (ram,0x0069292b) */ /* WARNING: Removing unreachable block (ram,0x0069293b) */ /* WARNING: Removing unreachable block (ram,0x00692941) */ /* DB: ? (line, bool rewrap): picks the console font from OptionsConfig _consoleFont (terminus/terminus8...), measures with Font::get_string_width_n and breaks at isspace/ispunct into wrapped segments stored on the line (+0x20/+0x24); Console::Print calls it on each new history entry, 00692960 re-wraps with 1 */ void Console::wrap_line(undefined4 *param_1,char param_2) { uint *_Memory; undefined2 *puVar1; ushort *ptr; qword qVar2; undefined4 *lineText; uint uVar3; int iVar4; undefined2 *breakDest; void *newBreaks; qword *allocatedBytes; char *charIndex; char *cursor; undefined2 *breaksEnd; undefined2 *local_34; char *local_28; undefined2 *local_24; char *lineStart; int lineWidth; Font *local_18; byte charText [4]; void *local_10; undefined1 *puStack_c; uint local_8; longlong allocSize; int oldBreaks; puStack_c = &LAB_00af977d; local_10 = ExceptionList; ExceptionList = &local_10; breaksEnd = (undefined2 *)0x0; local_24 = (undefined2 *)0x0; local_34 = (undefined2 *)0x0; charIndex = (char *)0x0; local_8 = 0; ptr = (ushort *)param_1[8]; if (ptr != (ushort *)0x0) { if (param_2 == '\0') { charIndex = (char *)(uint)*ptr; } else { local_8 = 1; tracked_alloc(1,ptr,0); local_8 = local_8 & 0xffffff00; param_1[8] = 0; param_1[9] = 1; } } charText[0] = 0; charText[1] = 0; lineWidth = 0; iVar4 = (g_manager->_optionsConfig)._consoleFont; if (iVar4 == 0) { LAB_006926e9: local_18 = &g_manager->_font4_terminus; } else if (iVar4 == 1) { local_18 = &g_manager->_font5_terminus8; } else { if (iVar4 != 2) goto LAB_006926e9; local_18 = &g_manager->_font8_LuaMiniOutlined; } lineText = param_1; if (0xf < (uint)param_1[5]) { lineText = (undefined4 *)*param_1; } cursor = charIndex + (int)lineText; lineStart = charIndex; while( true ) { uVar3 = (uint)charIndex & 0xffff; lineText = param_1; if (0xf < (uint)param_1[5]) { lineText = (undefined4 *)*param_1; } if (cursor == (char *)(param_1[4] + (int)lineText)) break; charText[0] = *cursor; iVar4 = Font::get_string_width_n(local_18,charText,-1); lineWidth = lineWidth + iVar4; if (g_screenWidth - 20.0 < (float)((double)lineWidth + __uint_to_double_fixup[-(lineWidth >> 0x1f)])) { local_28 = cursor + -1; while( true ) { charIndex = charIndex + 0xffff; cursor = cursor + -1; if ((ushort)charIndex <= (ushort)lineStart) break; iVar4 = isspace((int)*cursor); if ((iVar4 != 0) || (iVar4 = ispunct((int)*cursor), iVar4 != 0)) goto LAB_006927ad; } charIndex = (char *)(uVar3 - 1 & 0xffff); cursor = local_28; LAB_006927ad: lineWidth = 0; local_28 = (char *)((uint)(charIndex + 1) & 0xffff); lineStart = local_28; if (breaksEnd == local_24) { FUN_0042f580(breaksEnd,&local_28); local_24 = (undefined2 *)0x0; lineStart = local_28; breaksEnd = local_34; goto LAB_006927f2; } cursor = cursor + 1; *breaksEnd = (short)(charIndex + 1); breaksEnd = breaksEnd + 1; charIndex = charIndex + 1; local_34 = breaksEnd; } else { LAB_006927f2: cursor = cursor + 1; charIndex = charIndex + 1; } } if (breaksEnd == (undefined2 *)0x0) { ExceptionList = local_10; return; } iVar4 = (int)breaksEnd >> 1; if (param_1[8] != 0) { if (param_2 == '\0') { allocSize = (ulonglong)(uint)(param_1[9] + iVar4) * 2; breakDest = operator_new_tracked (-(uint)((int)((ulonglong)allocSize >> 0x20) != 0) | (uint)allocSize); memcpy(breakDest + iVar4,(void *)param_1[8],param_1[9] * 2); oldBreaks = param_1[8]; if (oldBreaks != 0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(oldBreaks + -4); qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar3); free((void *)(oldBreaks + -4)); } param_1[9] = param_1[9] + iVar4; param_1[8] = breakDest; goto LAB_00692900; } if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } _Memory = (uint *)(param_1[8] + -4); uVar3 = *_Memory; qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar3); free(_Memory); local_8 = local_8 & 0xffffff00; } allocSize = (ulonglong)(iVar4 + 1U) * 2; newBreaks = operator_new_tracked (-(uint)((int)((ulonglong)allocSize >> 0x20) != 0) | (uint)allocSize); param_1[8] = newBreaks; *(undefined2 *)((int)newBreaks + iVar4 * 2) = 0; param_1[9] = iVar4 + 1U; breakDest = (undefined2 *)param_1[8]; LAB_00692900: do { puVar1 = breaksEnd + -1; breaksEnd = breaksEnd + -1; *breakDest = *puVar1; breakDest = breakDest + 1; } while (breaksEnd != (undefined2 *)0x0); ExceptionList = local_10; return; } //@@ 00692960 FUN_00692960 void FUN_00692960(void) { int *piVar1; int iVar2; int *piVar3; int in_ECX; uint uVar4; int local_8; piVar1 = *(int **)(in_ECX + 0x40); for (uVar4 = *(uint *)(in_ECX + 0x4c); uVar4 != *(int *)(in_ECX + 0x4c) + *(int *)(in_ECX + 0x50); uVar4 = uVar4 + 1) { if (piVar1 == (int *)0x0) { iVar2 = 0; } else { iVar2 = *piVar1; } Console::wrap_line(*(undefined4 *)(*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & uVar4) * 4) ,1); } FUN_006924d0(); piVar1 = (int *)(in_ECX + 0xc); local_8 = *(int *)(*(int *)(*(int *)(in_ECX + 0x44) + (*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x4c) & *(int *)(in_ECX + 0x48) - 1U) * 4) + 0x24) + -1; piVar3 = &local_8; if (*piVar1 < local_8) { piVar3 = piVar1; } iVar2 = *piVar3; if (iVar2 < 0) { iVar2 = 0; } *piVar1 = iVar2; return; } //@@ 006929e0 Console::Print /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (text, color, fadeTime): Isaac::ConsoleOutput (Lua) calls it as (str, 0xffd3d3d3, 0x96); Console::PrintError calls it with red 0xfff08080; appends to the console history deque; 00738d70 currently carries this name from a ZHL prefix sig but is a Level::place_special_rooms helper prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Console::Print(Console *this,std_string *text,uint color,uint fadeTime) { qword qVar1; Console CVar2; std_string *segmentStart; void *pvVar3; Console *pCVar4; Console *pCVar5; Console CVar6; undefined4 extraout_ECX; qword *allocatedBytes; uint freeSize; std_string *cursor; undefined1 visibleRange [4]; Console local_6c; int slotOffset; Console frontIndex; int addedLineCount; char isScrolledToEnd; char newLine [24]; undefined4 newLineFadeTime; undefined4 newLineColor; int newLineWrapped; undefined4 newLineRowCount; void *emptyText [4]; undefined4 emptyTextSize; uint emptyTextCapacity; uint local_18; void *local_10; undefined1 *puStack_c; Console local_8; bool isPastVisible; char *line; uint *textSize; int wrappedLines; local_8 = (Console)0xffffffff; puStack_c = &LAB_00af97c5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(emptyText + 0xb); ExceptionList = &local_10; local_6c = (Console)text; if (this[0x41] != (Console)0x0) { textSize = &text->_size; if (0xf < text->_capacity) { text = *(std_string **)text->_buf; } std::string::append((char *)this[0x41],(byte *)text,*textSize); ExceptionList = local_10; return; } CVar6 = this[0x14]; if ((CVar6 == (Console)0x0) || (*(int *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x10) != 0)) { CVar2 = (Console)0x0; } else { CVar2 = (Console)0x1; } if ((this[2] != CVar2) || (isScrolledToEnd = '\x01', this[3] != (Console)0x0)) { isScrolledToEnd = '\0'; } addedLineCount = 0; if (CVar6 == (Console)0x0) { isScrolledToEnd = '\x01'; emptyTextSize = 0; emptyTextCapacity = 0xf; emptyText[0] = (void *)0x0; local_8 = CVar6; std::string::string(newLine,emptyText); newLineFadeTime = 0x96; newLineColor = 0xffd3d3d3; newLineWrapped = 0; newLineRowCount = 1; local_8._0_1_ = 1; std::deque::push_front(newLine); if (newLineWrapped != 0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } freeSize = *(uint *)(newLineWrapped + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - freeSize; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < freeSize); free((void *)(newLineWrapped + -4)); } std::string::_Tidy_deallocate(newLine); local_8 = (Console)0xffffffff; if (0xf < emptyTextCapacity) { freeSize = emptyTextCapacity + 1; pvVar3 = emptyText[0]; if (0xfff < freeSize) { pvVar3 = *(void **)((int)emptyText[0] + -4); freeSize = emptyTextCapacity + 0x24; if (0x1f < (uint)((int)emptyText[0] + (-4 - (int)pvVar3))) { LAB_00692d88: local_8 = (Console)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,freeSize); } addedLineCount = 1; } segmentStart = text; if (0xf < text->_capacity) { segmentStart = *(std_string **)text->_buf; } do { cursor = segmentStart; while( true ) { CVar6 = (Console)text; if (0xf < *(uint *)((int)text + 0x14)) { CVar6 = *(Console *)text; } if (cursor == (std_string *)((int)CVar6 + *(uint *)((int)text + 0x10))) { CVar6 = (Console)text; if (0xf < *(uint *)((int)text + 0x14)) { CVar6 = *(Console *)text; } textSize = (uint *)((int)text + 0x10); if (segmentStart < (std_string *)((int)CVar6 + *textSize)) { if (0xf < *(uint *)((int)text + 0x14)) { text = *(std_string **)text; } std::string::append(*(char **)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4), (byte *)segmentStart,((int)text - (int)segmentStart) + *textSize); *(uint *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x1c ) = color; *(uint *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x18 ) = fadeTime; wrap_line(*(undefined4 *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) ,0); } if (isScrolledToEnd != '\0') { if ((this[0x14] == (Console)0x0) || (*(int *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x10) != 0)) { this[2] = (Console)0x0; this[3] = (Console)0x0; ExceptionList = local_10; return; } this[3] = (Console)0x0; this[2] = (Console)0x1; ExceptionList = local_10; return; } if (addedLineCount == 0) { ExceptionList = local_10; return; } this[2] = (Console)((int)this[2] + addedLineCount); pCVar4 = (Console *)get_visible_line_range(visibleRange); if (((int)*pCVar4 < (int)this[2]) || ((*pCVar4 == this[2] && ((int)pCVar4[1] < (int)this[3])))) { isPastVisible = true; } else { isPastVisible = false; } pCVar5 = this + 2; if (isPastVisible) { pCVar5 = pCVar4; } CVar6 = *pCVar5; this[3] = pCVar5[1]; this[2] = CVar6; pCVar5 = this + 3; local_6c = (Console)(*(int *)(*(int *)((int)this[0x11] + ((int)CVar6 + (int)this[0x13] & (int)this[0x12] - 1U) * 4) + 0x24) + -1); pCVar4 = &local_6c; if ((int)*pCVar5 < (int)local_6c) { pCVar4 = pCVar5; } CVar6 = *pCVar4; if ((int)CVar6 < 0) { CVar6 = (Console)0x0; } *pCVar5 = CVar6; ExceptionList = local_10; return; } if (cursor->_buf[0] == 10) break; cursor = (std_string *)(cursor->_buf + 1); } if (segmentStart < cursor) { std::string::append(*(char **)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4 ),(byte *)segmentStart,(int)cursor - (int)segmentStart); *(uint *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x1c) = color; *(uint *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x18) = fadeTime; wrap_line(*(undefined4 *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4),0); } CVar6 = this[0x14]; do { if ((uint)CVar6 < 0x400) goto LAB_00692c3a; line = *(char **)((int)this[0x11] + ((int)this[0x12] - 1U & (int)this[0x13] + -1 + (int)CVar6) * 4); wrappedLines = *(int *)(line + 0x20); if (wrappedLines != 0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } freeSize = *(uint *)(wrappedLines + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - freeSize; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < freeSize); free((void *)(wrappedLines + -4)); } std::string::_Tidy_deallocate(line); CVar6 = (Console)((int)this[0x14] - 1); this[0x14] = CVar6; } while (CVar6 != (Console)0x0); this[0x13] = (Console)0x0; LAB_00692c3a: emptyTextSize = 0; emptyTextCapacity = 0xf; emptyText[0] = (void *)0x0; local_8 = (Console)0x4; std::string::string(newLine,emptyText); newLineFadeTime = 0x96; newLineColor = 0xffd3d3d3; newLineWrapped = 0; newLineRowCount = 1; local_8._0_1_ = 5; CVar6 = this[0x12]; if ((uint)CVar6 <= (int)this[0x14] + 1U) { FUN_00693be0(extraout_ECX); CVar6 = this[0x12]; } frontIndex = (Console)((int)CVar6 - 1U & (uint)this[0x13]); this[0x13] = frontIndex; if (frontIndex == (Console)0x0) { frontIndex = CVar6; } frontIndex = (Console)((int)frontIndex - 1); CVar2 = this[0x11]; slotOffset = ((uint)frontIndex & (int)CVar6 - 1U) * 4; if (*(int *)(slotOffset + (int)CVar2) == 0) { pvVar3 = operator_new(0x28); *(void **)(slotOffset + (int)this[0x11]) = pvVar3; CVar2 = this[0x11]; } line = *(char **)((int)CVar2 + slotOffset); std::string::string(line,newLine); *(undefined4 *)(line + 0x18) = newLineFadeTime; *(undefined4 *)(line + 0x1c) = newLineColor; *(undefined4 *)(line + 0x24) = newLineRowCount; *(int *)(line + 0x20) = newLineWrapped; this[0x14] = (Console)((int)this[0x14] + 1); this[0x13] = frontIndex; if (newLineWrapped != 0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } freeSize = *(uint *)(newLineWrapped + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - freeSize; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < freeSize); free((void *)(newLineWrapped + -4)); } std::string::_Tidy_deallocate(newLine); local_8 = (Console)0xffffffff; if (0xf < emptyTextCapacity) { freeSize = emptyTextCapacity + 1; pvVar3 = emptyText[0]; if (0xfff < freeSize) { pvVar3 = *(void **)((int)emptyText[0] + -4); freeSize = emptyTextCapacity + 0x24; if (0x1f < (uint)((int)emptyText[0] + (-4 - (int)pvVar3))) goto LAB_00692d88; } operator_delete(pvVar3,freeSize); } addedLineCount = addedLineCount + 1; segmentStart = (std_string *)(cursor->_buf + 1); text = (std_string *)local_6c; } while( true ); } //@@ 00692ed0 Console::PrintError /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Console::PrintError(const std_string &err); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Console::PrintError(Console *this,std_string *err) { qword qVar1; void *pvVar2; qword *pqVar3; uint uVar4; char local_58 [24]; undefined4 local_40; undefined4 local_3c; int local_38; undefined4 local_34; void *local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af980d; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_58 + 0x54); ExceptionList = &local_10; if ((this[0x14] != (Console)0x0) && (*(int *)(*(int *)((int)this[0x11] + ((int)this[0x12] - 1U & (uint)this[0x13]) * 4) + 0x10) != 0)) { local_20 = 0; local_1c = 0xf; local_30[0] = (void *)0x0; local_8 = 0; std::string::string(local_58,(std_string *)local_30); local_40 = 0x96; local_3c = 0xffd3d3d3; local_38 = 0; local_34 = 1; local_8 = CONCAT31(local_8._1_3_,1); std::deque::push_front(local_58); if (local_38 != 0) { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(local_38 + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar4; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar4); free((void *)(local_38 + -4)); } std::string::_Tidy_deallocate(local_58); local_8 = 0xffffffff; if (0xf < local_1c) { uVar4 = local_1c + 1; pvVar2 = local_30[0]; if (0xfff < uVar4) { pvVar2 = *(void **)((int)local_30[0] + -4); uVar4 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } } Print(this,err,0xfff08080,0x96); local_1c = 0xf; local_20 = 1; local_30[0] = (void *)0xa; local_8 = 3; Print(this,(std_string *)local_30,0xffd3d3d3,0x96); if (0xf < local_1c) { uVar4 = local_1c + 1; pvVar2 = local_30[0]; if (0xfff < uVar4) { pvVar2 = *(void **)((int)local_30[0] + -4); uVar4 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } ExceptionList = local_10; return; } //@@ 00693090 Console::print_format /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ECX Console (FUN_0090d4a0 passes g_game+0x68d78): vsprintf of (fmt, ...) into the static buffer 0x00c79c68, wraps it in std::string and calls the real print FUN_006929e0(text, 0xffd3d3d3, 150); used for netplay "Save checksum mismatch", Console::RunCommand output, PlayerManager::handle_coop_join */ void Console::print_format(Console *param_1,undefined4 param_2) { char *pcVar1; char *pcVar2; void *ptr; uint size; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af984d; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&local_2c + 0x28U; ExceptionList = &local_10; FUN_0041d4d0(param_2); local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; pcVar1 = &DAT_00c79c68; do { pcVar2 = pcVar1; pcVar1 = pcVar2 + 1; } while (*pcVar2 != '\0'); std::string::assign(local_2c._buf,&DAT_00c79c68,(uint)(pcVar2 + -0xc79c68)); local_8 = 0; Print(param_1,&local_2c,0xffd3d3d3,0x96); if (0xf < local_2c._capacity) { size = local_2c._capacity + 1; ptr = (void *)local_2c._buf._0_4_; if (0xfff < size) { ptr = *(void **)(local_2c._buf._0_4_ + -4); size = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 00693180 FUN_00693180 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ void FUN_00693180(Console *param_1,uint param_2,undefined4 param_3) { char *pcVar1; char *pcVar2; void *ptr; uint size; std_string local_30; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af84fd; local_10 = ExceptionList; local_18 = __security_cookie ^ (int)&local_30 + 0x2cU; ExceptionList = &local_10; FUN_0041d4d0(param_3); local_30._size = 0; local_30._capacity = 0xf; local_30._buf._0_4_ = (void *)0x0; pcVar1 = &DAT_00c79c68; do { pcVar2 = pcVar1; pcVar1 = pcVar2 + 1; } while (*pcVar2 != '\0'); std::string::assign(local_30._buf,&DAT_00c79c68,(uint)(pcVar2 + -0xc79c68)); local_8 = 0; Console::Print(param_1,&local_30,param_2,0x96); if (0xf < local_30._capacity) { size = local_30._capacity + 1; ptr = (void *)local_30._buf._0_4_; if (0xfff < size) { ptr = *(void **)(local_30._buf._0_4_ + -4); size = local_30._capacity + 0x24; if (0x1f < (uint)(local_30._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 00693270 FUN_00693270 void FUN_00693270(void) { _Tree_unchecked_const_iterator_>,std::_Iterator_base0> *in_ECX; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++(in_ECX); return; } //@@ 00693280 std::list::resize /* DB: resize specialized to 14: allocates 0x20-byte nodes with an empty std::string for 14 - size and splices them, else erases from the end; caller Console::FillOmnicomplete */ void std::list::resize(void) { undefined4 *puVar1; void *pvVar2; void *ptr; int *in_ECX; uint size; uint uVar3; int iVar4; int *piVar5; int iVar6; int *local_2c; int *local_28; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9895; local_10 = ExceptionList; ExceptionList = &local_10; uVar3 = in_ECX[1]; if (uVar3 < 0xe) { iVar6 = 0; if (-uVar3 == -0xe) { } else { local_8 = 1; local_28 = operator_new(0x20); local_28[2] = 0; local_28[6] = 0; iVar6 = 1; iVar4 = -uVar3 + 0xd; local_28[7] = 0xf; local_2c = local_28; if (iVar4 != 0) { piVar5 = local_28; do { local_2c = operator_new(0x20); iVar6 = iVar6 + 1; local_2c[2] = 0; local_2c[6] = 0; local_2c[7] = 0xf; *piVar5 = (int)local_2c; local_2c[1] = (int)piVar5; iVar4 = iVar4 + -1; piVar5 = local_2c; } while (iVar4 != 0); } } iVar4 = *in_ECX; if (iVar6 != 0) { puVar1 = *(undefined4 **)(iVar4 + 4); local_28[1] = (int)puVar1; *puVar1 = local_28; *local_2c = iVar4; *(int **)(iVar4 + 4) = local_2c; in_ECX[1] = in_ECX[1] + iVar6; } } else if (0xe < uVar3) { do { piVar5 = *(int **)(*in_ECX + 4); iVar6 = *piVar5; in_ECX[1] = uVar3 - 1; *(int *)piVar5[1] = iVar6; *(int *)(iVar6 + 4) = piVar5[1]; uVar3 = piVar5[7]; if (0xf < uVar3) { pvVar2 = (void *)piVar5[2]; size = uVar3 + 1; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = uVar3 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } piVar5[6] = 0; piVar5[7] = 0xf; *(undefined1 *)(piVar5 + 2) = 0; operator_delete(piVar5,0x20); uVar3 = in_ECX[1]; } while (0xe < uVar3); ExceptionList = local_10; return; } ExceptionList = local_10; return; } //@@ 00693420 FUN_00693420 void FUN_00693420(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; std::string::_Tidy_deallocate((char *)(puVar1 + 2)); operator_delete(puVar1,0x20); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x20); return; } //@@ 00693470 list_string_push_back_move /* DB: std::list::push_back(string&&): "list too long" at 0x7ffffff, new node gets the moved 0x18-byte string (source reset to empty SSO), linked before the head; Console::FillOmnicomplete, HUD::show_fortune_text_impl */ void list_string_push_back_move(int *param_1) { int iVar1; undefined4 *puVar2; int iVar3; int iVar4; int iVar5; int *piVar6; int *in_ECX; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00af98cd; local_1c = ExceptionList; ExceptionList = &local_1c; iVar1 = *in_ECX; if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_14 = 0; piVar6 = operator_new(0x20); piVar6[2] = 0; piVar6[6] = 0; piVar6[7] = 0; iVar3 = param_1[1]; iVar4 = param_1[2]; iVar5 = param_1[3]; piVar6[2] = *param_1; piVar6[3] = iVar3; piVar6[4] = iVar4; piVar6[5] = iVar5; *(undefined8 *)(piVar6 + 6) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; in_ECX[1] = in_ECX[1] + 1; puVar2 = *(undefined4 **)(iVar1 + 4); *piVar6 = iVar1; piVar6[1] = (int)puVar2; *(int **)(iVar1 + 4) = piVar6; *puVar2 = piVar6; ExceptionList = local_1c; return; } //@@ 00693540 FUN_00693540 int FUN_00693540(void) { int *in_ECX; return (in_ECX[1] - *in_ECX) / 0x148; } //@@ 00693560 FUN_00693560 void FUN_00693560(undefined4 *param_1,int param_2) { undefined4 uVar1; int iVar2; undefined4 *in_ECX; uVar1 = *in_ECX; iVar2 = in_ECX[2]; param_1[1] = 0; *param_1 = uVar1; param_1[2] = iVar2 + param_2; return; } //@@ 00693580 FUN_00693580 void FUN_00693580(void) { void *ptr; undefined4 *in_ECX; FUN_006936f0(); ptr = (void *)*in_ECX; *in_ECX = 0; operator_delete(ptr,8); return; } //@@ 006935a0 FUN_006935a0 void FUN_006935a0(void) { void *ptr; undefined4 *in_ECX; FUN_00693ac0(); ptr = (void *)*in_ECX; *in_ECX = 0; operator_delete(ptr,8); return; } //@@ 006935c0 std::deque::push_front /* DB: ? grows map (FUN_00693be0) when full, allocates a 0x28-byte block, copy-constructs std::string + 4 dwords at --offset; Console::Print, Console::PrintError */ void std::deque::push_front(void *param_1) { uint *puVar1; int iVar2; char *this; void *pvVar3; int iVar4; int in_ECX; uint uVar5; uint uVar6; uVar5 = *(uint *)(in_ECX + 8); if (uVar5 <= *(int *)(in_ECX + 0x10) + 1U) { FUN_00693be0(uVar5); uVar5 = *(uint *)(in_ECX + 8); } puVar1 = (uint *)(in_ECX + 0xc); *puVar1 = *puVar1 & uVar5 - 1; uVar6 = *(uint *)(in_ECX + 0xc); if (*puVar1 == 0) { uVar6 = uVar5; } iVar2 = (uVar5 - 1 & uVar6 - 1) * 4; iVar4 = *(int *)(in_ECX + 4); if (*(int *)(iVar4 + iVar2) == 0) { pvVar3 = operator_new(0x28); *(void **)(iVar2 + *(int *)(in_ECX + 4)) = pvVar3; iVar4 = *(int *)(in_ECX + 4); } this = *(char **)(iVar2 + iVar4); string::string(this,param_1); *(undefined4 *)(this + 0x18) = *(undefined4 *)((int)param_1 + 0x18); *(undefined4 *)(this + 0x1c) = *(undefined4 *)((int)param_1 + 0x1c); *(undefined4 *)(this + 0x20) = *(undefined4 *)((int)param_1 + 0x20); *(undefined4 *)(this + 0x24) = *(undefined4 *)((int)param_1 + 0x24); *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; *(uint *)(in_ECX + 0xc) = uVar6 - 1; return; } //@@ 00693650 FUN_00693650 void FUN_00693650(byte *param_1,uint param_2) { uint *puVar1; uint *puVar2; byte *in_ECX; puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } puVar2 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } std::string::find(in_ECX,*puVar2,param_2,param_1,*puVar1); return; } //@@ 00693680 FUN_00693680 int FUN_00693680(void) { undefined4 *in_ECX; undefined4 *puVar1; puVar1 = in_ECX; if (0xf < (uint)in_ECX[5]) { puVar1 = (undefined4 *)*in_ECX; } return in_ECX[4] + -1 + (int)puVar1; } //@@ 006936a0 FUN_006936a0 void FUN_006936a0(void) { undefined4 *puVar1; undefined4 *ptr; int in_ECX; if (*(int *)(in_ECX + 4) != 0) { *(undefined4 *)(*(int *)(in_ECX + 0xc) + 4) = 0; **(undefined4 **)(in_ECX + 8) = 0; ptr = *(undefined4 **)(in_ECX + 0xc); while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; std::string::_Tidy_deallocate((char *)(ptr + 2)); operator_delete(ptr,0x20); ptr = puVar1; } } return; } //@@ 006936e0 FUN_006936e0 void FUN_006936e0(undefined4 param_1) { undefined4 *in_ECX; *in_ECX = param_1; return; } //@@ 006936f0 FUN_006936f0 void FUN_006936f0(void) { void *pvVar1; void *ptr; int in_ECX; int iVar2; uint size; iVar2 = *(int *)(in_ECX + 0x10); do { if (iVar2 == 0) goto LAB_0069372f; std::string::_Tidy_deallocate (*(char **)(*(int *)(in_ECX + 4) + (iVar2 + *(int *)(in_ECX + 0xc) + -1 & *(int *)(in_ECX + 8) - 1U) * 4)); iVar2 = *(int *)(in_ECX + 0x10) + -1; *(int *)(in_ECX + 0x10) = iVar2; } while (iVar2 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; LAB_0069372f: iVar2 = *(int *)(in_ECX + 8); while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(*(int *)(in_ECX + 4) + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x18); } } pvVar1 = *(void **)(in_ECX + 4); if (pvVar1 != (void *)0x0) { size = *(int *)(in_ECX + 8) * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 006937a0 FUN_006937a0 void FUN_006937a0(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0xaaaaaaa - uVar3 < uVar3) { FUN_0040cad0(); LAB_006938d6: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = std::_Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_006938d6; } //@@ 006938e0 FUN_006938e0 void FUN_006938e0(undefined4 *param_1,undefined4 param_2,undefined4 param_3,uint param_4, undefined4 param_5,undefined4 param_6,uint param_7) { char *pcVar1; char *pcVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; uint uVar6; uint uVar7; uint uVar8; undefined4 *in_ECX; int *piVar9; int local_c; int local_8; if (in_ECX == (undefined4 *)0x0) { piVar9 = (int *)0x0; } else { piVar9 = (int *)*in_ECX; } uVar8 = in_ECX[3]; uVar6 = param_4 - uVar8; local_8 = param_7 - param_4; if (local_8 == 0) { *param_1 = piVar9; param_1[2] = param_4; param_1[1] = 0; return; } uVar7 = in_ECX[4] + uVar8; if (uVar6 < uVar7 - param_7) { if (piVar9 == (int *)0x0) { local_c = 0; } else { local_c = *piVar9; } while (uVar8 != param_4) { param_4 = param_4 - 1; param_7 = param_7 - 1; pcVar1 = *(char **)(*(int *)(local_c + 4) + (*(int *)(local_c + 8) - 1U & param_4) * 4); pcVar2 = *(char **)(*(int *)(local_c + 4) + (*(int *)(local_c + 8) - 1U & param_7) * 4); if (pcVar2 != pcVar1) { std::string::_Tidy_deallocate(pcVar2); uVar3 = *(undefined4 *)(pcVar1 + 4); uVar4 = *(undefined4 *)(pcVar1 + 8); uVar5 = *(undefined4 *)(pcVar1 + 0xc); *(undefined4 *)pcVar2 = *(undefined4 *)pcVar1; *(undefined4 *)(pcVar2 + 4) = uVar3; *(undefined4 *)(pcVar2 + 8) = uVar4; *(undefined4 *)(pcVar2 + 0xc) = uVar5; uVar3 = *(undefined4 *)(pcVar1 + 0x14); *(undefined4 *)(pcVar2 + 0x10) = *(undefined4 *)(pcVar1 + 0x10); *(undefined4 *)(pcVar2 + 0x14) = uVar3; pcVar1[0x10] = '\0'; pcVar1[0x11] = '\0'; pcVar1[0x12] = '\0'; pcVar1[0x13] = '\0'; pcVar1[0x14] = '\x0f'; pcVar1[0x15] = '\0'; pcVar1[0x16] = '\0'; pcVar1[0x17] = '\0'; *pcVar1 = '\0'; } } uVar8 = in_ECX[3]; do { std::string::_Tidy_deallocate(*(char **)(in_ECX[1] + (in_ECX[2] - 1 & uVar8) * 4)); piVar9 = in_ECX + 4; *piVar9 = *piVar9 + -1; if (*piVar9 == 0) { in_ECX[3] = 0; uVar8 = 0; } else { in_ECX[3] = in_ECX[3] + 1; uVar8 = in_ECX[3]; } local_8 = local_8 + -1; } while (local_8 != 0); } else { if (piVar9 == (int *)0x0) { local_c = 0; } else { local_c = *piVar9; } if (param_7 != uVar7) { do { pcVar1 = *(char **)(*(int *)(local_c + 4) + (*(int *)(local_c + 8) - 1U & param_7) * 4); pcVar2 = *(char **)(*(int *)(local_c + 4) + (*(int *)(local_c + 8) - 1U & param_4) * 4); if (pcVar2 != pcVar1) { std::string::_Tidy_deallocate(pcVar2); uVar3 = *(undefined4 *)(pcVar1 + 4); uVar4 = *(undefined4 *)(pcVar1 + 8); uVar5 = *(undefined4 *)(pcVar1 + 0xc); *(undefined4 *)pcVar2 = *(undefined4 *)pcVar1; *(undefined4 *)(pcVar2 + 4) = uVar3; *(undefined4 *)(pcVar2 + 8) = uVar4; *(undefined4 *)(pcVar2 + 0xc) = uVar5; uVar3 = *(undefined4 *)(pcVar1 + 0x14); *(undefined4 *)(pcVar2 + 0x10) = *(undefined4 *)(pcVar1 + 0x10); *(undefined4 *)(pcVar2 + 0x14) = uVar3; pcVar1[0x10] = '\0'; pcVar1[0x11] = '\0'; pcVar1[0x12] = '\0'; pcVar1[0x13] = '\0'; pcVar1[0x14] = '\x0f'; pcVar1[0x15] = '\0'; pcVar1[0x16] = '\0'; pcVar1[0x17] = '\0'; *pcVar1 = '\0'; } param_7 = param_7 + 1; param_4 = param_4 + 1; } while (param_7 != uVar7); } do { std::string::_Tidy_deallocate (*(char **)(in_ECX[1] + (in_ECX[3] + in_ECX[4] + -1 & in_ECX[2] - 1) * 4)); piVar9 = in_ECX + 4; *piVar9 = *piVar9 + -1; if (*piVar9 == 0) { in_ECX[3] = 0; } local_8 = local_8 + -1; } while (local_8 != 0); } *param_1 = *in_ECX; param_1[2] = in_ECX[3] + uVar6; param_1[1] = 0; return; } //@@ 00693ac0 FUN_00693ac0 void FUN_00693ac0(void) { char *this; void *pvVar1; qword qVar2; void **ppvVar3; void *ptr; int in_ECX; qword *pqVar4; int iVar5; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; iVar5 = *(int *)(in_ECX + 0x10); ppvVar3 = &local_10; local_10 = ExceptionList; do { ExceptionList = ppvVar3; if (iVar5 == 0) goto LAB_00693b52; this = *(char **)(*(int *)(in_ECX + 4) + (*(int *)(in_ECX + 8) - 1U & *(int *)(in_ECX + 0xc) + -1 + iVar5) * 4); iVar5 = *(int *)(this + 0x20); if (iVar5 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)(iVar5 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar6; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar6); free((void *)(iVar5 + -4)); } std::string::_Tidy_deallocate(this); iVar5 = *(int *)(in_ECX + 0x10) + -1; *(int *)(in_ECX + 0x10) = iVar5; ppvVar3 = ExceptionList; } while (iVar5 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; LAB_00693b52: iVar5 = *(int *)(in_ECX + 8); while (iVar5 != 0) { iVar5 = iVar5 + -1; pvVar1 = *(void **)(*(int *)(in_ECX + 4) + iVar5 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x28); } } pvVar1 = *(void **)(in_ECX + 4); if (pvVar1 != (void *)0x0) { uVar6 = *(int *)(in_ECX + 8) * 4; ptr = pvVar1; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar1 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; ExceptionList = local_10; return; } //@@ 00693be0 FUN_00693be0 void FUN_00693be0(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0x6666666 - uVar3 < uVar3) { FUN_0040cad0(); LAB_00693d16: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = std::_Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_00693d16; } //@@ 00693d20 FUN_00693d20 void FUN_00693d20(uint param_1,undefined4 param_2,undefined1 param_3) { size_t _Size; undefined1 *puVar1; uint uVar2; void *_Src; uint uVar3; void *_Dst; undefined4 *in_ECX; uint uVar4; uint uVar5; void *ptr; uVar4 = in_ECX[4]; if (uVar4 < param_1) { /* WARNING: Subroutine does not return */ FUN_00499950(); } uVar2 = in_ECX[5]; if (uVar2 != uVar4) { in_ECX[4] = uVar4 + 1; if (0xf < uVar2) { in_ECX = (undefined4 *)*in_ECX; } puVar1 = (undefined1 *)((int)in_ECX + param_1); memmove(puVar1 + 1,puVar1,(uVar4 - param_1) + 1); *puVar1 = param_3; return; } if (uVar4 == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar5 = uVar4 + 1 | 0xf; if (uVar5 < 0x80000000) { if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar5 = 0x7fffffff; } else { uVar3 = (uVar2 >> 1) + uVar2; if (uVar5 < uVar3) { uVar5 = uVar3; } } } else { uVar5 = 0x7fffffff; } _Dst = std::_Allocate(uVar5 + 1); in_ECX[5] = uVar5; in_ECX[4] = uVar4 + 1; _Size = (uVar4 - param_1) + 1; puVar1 = (undefined1 *)((int)_Dst + param_1); if (uVar2 < 0x10) { memcpy(_Dst,in_ECX,param_1); *puVar1 = param_3; memcpy(puVar1 + 1,(void *)(param_1 + (int)in_ECX),_Size); *in_ECX = _Dst; return; } _Src = (void *)*in_ECX; memcpy(_Dst,_Src,param_1); *puVar1 = param_3; memcpy(puVar1 + 1,(void *)(param_1 + (int)_Src),_Size); uVar4 = uVar2 + 1; ptr = _Src; if (0xfff < uVar4) { ptr = *(void **)((int)_Src + -4); uVar4 = uVar2 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); *in_ECX = _Dst; return; } //@@ 00693eb0 FUN_00693eb0 undefined4 * FUN_00693eb0(char *param_1,char *param_2,undefined1 *param_3) { undefined1 uVar1; undefined4 *in_ECX; code *in_EDX; if (param_1 != param_2) { do { uVar1 = (*in_EDX)((int)*param_1); param_1 = param_1 + 1; *param_3 = uVar1; param_3 = param_3 + 1; } while (param_1 != param_2); } *in_ECX = param_3; return in_ECX; } //@@ 00693f00 FUN_00693f00 undefined4 * FUN_00693f00(void *param_1,void *param_2) { undefined4 *puVar1; undefined4 *in_ECX; int iVar2; undefined4 *local_28; undefined4 *local_24; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af990d; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = 0; *in_ECX = 0; in_ECX[1] = 0; local_8 = 0; if (param_1 == param_2) { local_14 = local_24; } else { local_8 = 1; local_14 = operator_new(0x20); std::string::string((char *)(local_14 + 2),param_1); param_1 = (void *)((int)param_1 + 0x18); iVar2 = 1; puVar1 = local_14; local_28 = local_14; if (param_1 != param_2) { do { local_28 = operator_new(0x20); std::string::string((char *)(local_28 + 2),param_1); iVar2 = iVar2 + 1; *puVar1 = local_28; param_1 = (void *)((int)param_1 + 0x18); local_28[1] = puVar1; puVar1 = local_28; } while (param_1 != param_2); } } local_8 = CONCAT31(local_8._1_3_,2); puVar1 = operator_new(0x20); if (iVar2 == 0) { *puVar1 = puVar1; puVar1[1] = puVar1; } else { *puVar1 = local_14; puVar1[1] = local_28; local_14[1] = puVar1; *local_28 = puVar1; } *in_ECX = puVar1; in_ECX[1] = iVar2; ExceptionList = local_10; return in_ECX; } //@@ 00694040 FUN_00694040 undefined4 * FUN_00694040(void *param_1,void *param_2) { uint uVar1; uint uVar2; char *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9945; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; uVar1 = ((int)param_2 - (int)param_1) / 0x18; in_ECX[1] = 0; in_ECX[2] = 0; if (uVar1 != 0) { if (0xaaaaaaa < uVar1) { /* WARNING: Subroutine does not return */ std::_Xlen(uVar2); } this = std::_Allocate(uVar1 * 0x18); *in_ECX = this; in_ECX[1] = this; in_ECX[2] = this + uVar1 * 0x18; local_8 = 1; for (; param_1 != param_2; param_1 = (void *)((int)param_1 + 0x18)) { std::string::string(this,param_1); this = this + 0x18; } in_ECX[1] = this; } ExceptionList = local_10; return in_ECX; } //@@ 00694120 FUN_00694120 void FUN_00694120(byte *param_1) { std_string *allocSource; char *in_ECX; byte *in_EDX; byte *right; allocSource = *(std_string **)(in_EDX + 0x10); if (0x7fffffffU - (int)allocSource < *(uint *)(param_1 + 0x10)) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } right = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { right = *(byte **)param_1; } std::string::concat(in_ECX,(int)param_1,allocSource,in_EDX,(uint)allocSource,right, *(uint *)(param_1 + 0x10)); return; } //@@ 00694170 FUN_00694170 void FUN_00694170(std_string param_1) { uint *puVar1; char *in_ECX; byte *in_EDX; int local_c; puVar1 = (uint *)(in_EDX + 0x10); if (*puVar1 == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } std::string::concat(in_ECX,local_c,¶m_1,in_EDX,*puVar1,(byte *)¶m_1,1); return; } //@@ 006941b0 FUN_006941b0 void FUN_006941b0(std_string *param_1) { byte bVar1; char *in_ECX; std_string *allocSource; byte *in_EDX; byte *pbVar2; pbVar2 = in_EDX; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); if (0x7fffffff - param_1->_size < (uint)((int)pbVar2 - (int)(in_EDX + 1))) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } allocSource = param_1; if (0xf < param_1->_capacity) { allocSource = *(std_string **)param_1->_buf; } std::string::concat(in_ECX,(int)param_1,allocSource,in_EDX,(int)pbVar2 - (int)(in_EDX + 1), (byte *)allocSource,param_1->_size); return; } //@@ 00694210 FUN_00694210 void FUN_00694210(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x20); } return; } //@@ 00694230 EntityConfig_Entity::EntityConfig_Entity /* DB: default ctor: zeroes the record, empty std::strings (cap 0xf at +0x1c/+0x20, +0x84/+0x88, +0xc4/+0xc8), 1.0f at +0x38, g_vectorOne at +0x3c, +0x64 = -1, bool +0x58 = 1; per node in EntityConfig::LoadEntities */ EntityConfig_Entity * __thiscall EntityConfig_Entity::EntityConfig_Entity(EntityConfig_Entity *this) { (this->name)._buf[0] = '\0'; (this->name)._buf[1] = '\0'; (this->name)._buf[2] = '\0'; (this->name)._buf[3] = '\0'; (this->name)._size = 0; (this->name)._capacity = 0xf; this->id = 0; this->variant = 0; this->subtype = 0; this->shadowSize = 0.0; this->collisionDamage = 0.0; this->isBoss = 0; this->bossID = 0; this->canBeChampion = 0; this->collisionRadius = 1.0; (this->collisionRadiusMulti).x = g_vectorOne.x; (this->collisionRadiusMulti).y = g_vectorOne.y; this->mass = 0.0; this->gridCollisionPoints = 0; this->friction = 0.0; this->baseHP = 0.0; this->stageHP = 0.0; this->shutDoors = 1; this->gibsAmount = 0; this->gibFlags = 0; (this->_bossColors)._begin = (void *)0x0; (this->_bossColors)._end = (void *)0x0; (this->_bossColors)._capacity = (void *)0x0; (this->anm2Path)._buf[0] = '\0'; (this->anm2Path)._buf[1] = '\0'; (this->anm2Path)._buf[2] = '\0'; (this->anm2Path)._buf[3] = '\0'; (this->anm2Path)._size = 0; (this->anm2Path)._capacity = 0xf; *(undefined4 *)&this->field_0x8c = 0; *(undefined4 *)&this->field_0x90 = 0; *(undefined4 *)&this->field_0x94 = 0; (this->preloadSounds)._begin = (void *)0x0; (this->preloadSounds)._end = (void *)0x0; (this->preloadSounds)._capacity = (void *)0x0; (this->devolve)._begin = (void *)0x0; (this->devolve)._end = (void *)0x0; (this->devolve)._capacity = (void *)0x0; (this->gridCollisionClassString)._buf[0] = '\0'; (this->gridCollisionClassString)._buf[1] = '\0'; (this->gridCollisionClassString)._buf[2] = '\0'; (this->gridCollisionClassString)._buf[3] = '\0'; (this->gridCollisionClassString)._size = 0; (this->gridCollisionClassString)._capacity = 0xf; this->portrait = -1; this->isPreloaded = 0; this->reroll = 0; this->hasFloorAlts = 0; this->collisionInterval = 7; this->tags = 0; *(undefined4 *)&this->field_0xdc = 0; this->shieldStrength = 0.0; this->shieldFrames = 0x78; this->bestiary = 0; (this->bestiaryOffset).x = g_vectorZero.x; (this->bestiaryOffset).y = g_vectorZero.y; this->bestiaryScale = 1.0; (this->bestiaryAnm2Path)._buf[0] = '\0'; (this->bestiaryAnm2Path)._buf[1] = '\0'; (this->bestiaryAnm2Path)._buf[2] = '\0'; (this->bestiaryAnm2Path)._buf[3] = '\0'; (this->bestiaryAnm2Path)._size = 0; (this->bestiaryAnm2Path)._capacity = 0xf; (this->bestiaryAnim)._buf[0] = '\0'; (this->bestiaryAnim)._buf[1] = '\0'; (this->bestiaryAnim)._buf[2] = '\0'; (this->bestiaryAnim)._buf[3] = '\0'; (this->bestiaryAnim)._size = 0; (this->bestiaryAnim)._capacity = 0xf; (this->bestiaryOverlay)._buf[0] = '\0'; (this->bestiaryOverlay)._buf[1] = '\0'; (this->bestiaryOverlay)._buf[2] = '\0'; (this->bestiaryOverlay)._buf[3] = '\0'; (this->bestiaryOverlay)._size = 0; (this->bestiaryOverlay)._capacity = 0xf; (this->bestiaryFloorAlt)._buf[0] = '\0'; (this->bestiaryFloorAlt)._buf[1] = '\0'; (this->bestiaryFloorAlt)._buf[2] = '\0'; (this->bestiaryFloorAlt)._buf[3] = '\0'; (this->bestiaryFloorAlt)._size = 0; (this->bestiaryFloorAlt)._capacity = 0xf; this->bestiaryParentType = 0; this->bestiaryParentVariant = 0; this->modEntry = (void *)0x0; this->isPortraitModded = 0; return this; } //@@ 00694490 EntityConfig_Player::EntityConfig_Player /* DB: default ctor: id +0 = -1, seven empty std::strings (cap 0xf) at +4..+0x94, +0xac = -1, zeroes the rest; per node in EntityConfig::load_players_xml (copy ctor 0069e6c0, assign 0069b810) */ EntityConfig_Player * __thiscall EntityConfig_Player::EntityConfig_Player(EntityConfig_Player *this) { this->_id = -1; (this->_name)._buf[0] = '\0'; (this->_name)._buf[1] = '\0'; (this->_name)._buf[2] = '\0'; (this->_name)._buf[3] = '\0'; (this->_name)._size = 0; (this->_name)._capacity = 0xf; (this->_skinPath)._buf[0] = '\0'; (this->_skinPath)._buf[1] = '\0'; (this->_skinPath)._buf[2] = '\0'; (this->_skinPath)._buf[3] = '\0'; (this->_skinPath)._size = 0; (this->_skinPath)._capacity = 0xf; (this->_nameImagePath)._buf[0] = '\0'; (this->_nameImagePath)._buf[1] = '\0'; (this->_nameImagePath)._buf[2] = '\0'; (this->_nameImagePath)._buf[3] = '\0'; (this->_nameImagePath)._size = 0; (this->_nameImagePath)._capacity = 0xf; (this->_portraitPath)._buf[0] = '\0'; (this->_portraitPath)._buf[1] = '\0'; (this->_portraitPath)._buf[2] = '\0'; (this->_portraitPath)._buf[3] = '\0'; (this->_portraitPath)._size = 0; (this->_portraitPath)._capacity = 0xf; (this->_unkString)._buf[0] = '\0'; (this->_unkString)._buf[1] = '\0'; (this->_unkString)._buf[2] = '\0'; (this->_unkString)._buf[3] = '\0'; (this->_unkString)._size = 0; (this->_unkString)._capacity = 0xf; (this->_extraPortraitPath)._buf[0] = '\0'; (this->_extraPortraitPath)._buf[1] = '\0'; (this->_extraPortraitPath)._buf[2] = '\0'; (this->_extraPortraitPath)._buf[3] = '\0'; (this->_extraPortraitPath)._size = 0; (this->_extraPortraitPath)._capacity = 0xf; (this->_costumeSuffixName)._buf[0] = '\0'; (this->_costumeSuffixName)._buf[1] = '\0'; (this->_costumeSuffixName)._buf[2] = '\0'; (this->_costumeSuffixName)._buf[3] = '\0'; (this->_costumeSuffixName)._size = 0; (this->_costumeSuffixName)._capacity = 0xf; this->_costumeID = -1; this->_heart = 0; this->_armor = 0; this->_blackHeart = 0; this->_coins = 0; this->_bombs = 0; this->_keys = 0; this->_card = 0; this->_pill = 0; this->_canShoot = 1; (this->_collectibles)._begin = (void *)0x0; (this->_collectibles)._end = (void *)0x0; (this->_collectibles)._capacity = (void *)0x0; this->_trinket = 0; this->_skinColor = 0; this->_achievement = -1; this->_brokenHeart = 0; this->_pocketActiveID = 0; (this->_birthrightDescription)._buf[0] = '\0'; (this->_birthrightDescription)._buf[1] = '\0'; (this->_birthrightDescription)._buf[2] = '\0'; (this->_birthrightDescription)._buf[3] = '\0'; (this->_birthrightDescription)._size = 0; (this->_birthrightDescription)._capacity = 0xf; (this->_bSkinParentName)._buf[0] = '\0'; (this->_bSkinParentName)._buf[1] = '\0'; (this->_bSkinParentName)._buf[2] = '\0'; (this->_bSkinParentName)._buf[3] = '\0'; (this->_bSkinParentName)._size = 0; (this->_bSkinParentName)._capacity = 0xf; this->_moddedTaintedPlayerID = -1; this->_hidden = 0; this->_modEntry = (void *)0x0; this->_renderCustomBackground = 0; this->_moddedMenuBackgroundANM2 = (void *)0x0; this->_moddedMenuPortraitANM2 = (void *)0x0; this->_moddedGameOverANM2 = (void *)0x0; this->_moddedCoopMenuANM2 = (void *)0x0; this->_moddedControlsANM2 = (void *)0x0; return this; } //@@ 00694680 EntityConfig::parse_entity_tags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? entities2.xml tags attribute -> flag bits: static strings brimstone_soul/explosive_soul/homing_soul/ghost/spider/cansacrifice/nodelirium/noreroll, "invalid tag: %s"; called once from the entities2.xml loader 006950c0 EntityConfig::LoadEntities uint EntityConfig::parse_entity_tags(void) { int iVar1; char isKeyEqual; undefined4 *tagValue; void *pvVar2; uint uVar3; undefined1 *puVar4; undefined1 *tagNode; int tokensBegin; int tokensEnd; int tokenOffset; uint tagFlags; uint tokenIdx; void *tagName; ushort local_28; undefined1 local_26; undefined1 local_20 [4]; undefined4 tagNameSize; undefined1 *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af99d9; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80a80) && (_Init_thread_header(&DAT_00c80a80,local_14), DAT_00c80a80 == -1)) { local_8 = 0; DAT_00c80a84 = operator_new(0x2c); *(undefined1 **)DAT_00c80a84 = DAT_00c80a84; *(undefined1 **)(DAT_00c80a84 + 4) = DAT_00c80a84; *(undefined1 **)(DAT_00c80a84 + 8) = DAT_00c80a84; *(undefined2 *)(DAT_00c80a84 + 0xc) = 0x101; _atexit(FUN_00b156b0); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c80a80); } if (DAT_00c80a88 == 0) { local_18 = (undefined1 *)0xf; tagNameSize = 3; tagName = (void *)0x796c66; local_8 = 1; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 1; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagName = (void *)0x64697073; local_18 = (undefined1 *)0xf; tagNameSize = 6; local_28 = 0x7265; local_26 = 0; local_8 = 2; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 2; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } local_18 = (undefined1 *)0xf; tagNameSize = 4; tagName = (void *)0x706f6f70; local_28 = local_28 & 0xff00; local_8 = 3; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 4; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = (undefined1 *)0xf; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"ghost",5); local_8 = 4; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 8; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = (undefined1 *)0xf; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"noreroll",8); local_8 = 5; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 0x10; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = (undefined1 *)0xf; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"cansacrifice",0xc); local_8 = 6; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 0x20; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = (undefined1 *)0xf; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"explosive_soul",0xe); local_8 = 7; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 0x40; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = (undefined1 *)0xf; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"homing_soul",0xb); local_8 = 8; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 0x80; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = (undefined1 *)0xf; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"brimstone_soul",0xe); local_8 = 9; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 0x100; if (0xf < local_18) { uVar3 = (int)local_18 + 1; pvVar2 = tagName; if (0xfff < uVar3) { pvVar2 = *(void **)((int)tagName + -4); uVar3 = (int)local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } tagNameSize = 0; local_18 = &DAT_0000000f; tagName = (void *)0x0; std::string::assign((char *)&tagName,(byte *)"nodelirium",10); local_8 = 10; tagValue = (undefined4 *)FUN_0069d630(&tagName); local_8 = 0xffffffff; *tagValue = 0x200; if (&DAT_0000000f < local_18) { puVar4 = local_18 + 1; pvVar2 = tagName; if ((undefined1 *)0xfff < puVar4) { pvVar2 = *(void **)((int)tagName + -4); puVar4 = local_18 + 0x24; if (0x1f < (uint)((int)tagName + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,(uint)puVar4); } } uVar3 = 0; tagFlags = 0; string_split(0x20); local_8 = 0xb; tokenIdx = 0; iVar1 = tokensEnd - tokensBegin >> 0x1f; if ((tokensEnd - tokensBegin) / 0x18 + iVar1 != iVar1) { tokenOffset = 0; puVar4 = DAT_00c80a84; do { std::map::_Find_lower_bound(local_20,tokensBegin + tokenOffset); tagNode = local_18; isKeyEqual = FUN_006a0100(local_18,tokensBegin + tokenOffset); if (isKeyEqual == '\0') { tagNode = puVar4; LAB_00694c37: KAGE_LogMessage(0x10,(byte *)"invalid tag: %s\n"); puVar4 = DAT_00c80a84; } else if (tagNode == puVar4) goto LAB_00694c37; uVar3 = tagFlags | *(uint *)(tagNode + 0x28); tokenIdx = tokenIdx + 1; tokenOffset = tokenOffset + 0x18; tagFlags = uVar3; } while (tokenIdx < (uint)((tokensEnd - tokensBegin) / 0x18)); } std::vector::_Tidy(); ExceptionList = local_10; return uVar3; } //@@ 00694d20 EntityConfig_Entity::GetName /* DB: returns std::string of the name at ECX+0xc; if it starts with '#' looks it up in StringTable "Entities" (language param 0x14 -> Manager+0x4a920 current language); Menu_Bestiary::Render, Entity_Player::room_enter (Spindown/boss name), Console::FillOmnicomplete prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall EntityConfig_Entity::GetName(EntityConfig_Entity *this,std_string *outName,uint language) { StringTable *this_00; char *pcVar1; std_string *psVar2; byte *text; uint language_00; if ((this->name)._size == 0) { text = &s_empty; } else { text = (byte *)&this->name; if (0xf < (this->name)._capacity) { text = *(byte **)((std_string *)text)->_buf; } language_00 = language; if (language == 0x14) { language_00 = *(uint *)&g_manager->_stringTable; } this_00 = &g_manager->_stringTable; if (((std_string *)text)->_buf[0] == '#') { language = language & 0xffffff; StringTable::get_string (this_00,(byte *)"Entities",language_00,(byte *)(((std_string *)text)->_buf + 1), (byte *)((int)&language + 3)); if (language._3_1_ == '\0') { language = language & 0xffffff; text = StringTable::get_string (this_00,(byte *)"Entities",language_00, (byte *)(((std_string *)text)->_buf + 1),(byte *)((int)&language + 3)); } } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; psVar2 = (std_string *)text; do { pcVar1 = psVar2->_buf; psVar2 = (std_string *)(psVar2->_buf + 1); } while (*pcVar1 != '\0'); std::string::assign(outName->_buf,text,(int)psVar2 - (int)(((std_string *)text)->_buf + 1)); return outName; } //@@ 00694de0 EntityConfig_Player::GetDisplayName /* ZHL [exact] __thiscall std_string EntityConfig_Player::GetDisplayName(void* ptr); prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall EntityConfig_Player::GetDisplayName(EntityConfig_Player *this,std_string *outName,void *unused) { int language; char *pcVar1; Manager *pMVar2; std_string *psVar3; byte *text; byte local_5; pMVar2 = g_manager; if ((this->_name)._size == 0) { text = &s_empty; } else { text = (byte *)&this->_name; if (0xf < (this->_name)._capacity) { text = *(byte **)((std_string *)text)->_buf; } language = *(int *)&g_manager->_stringTable; if (((std_string *)text)->_buf[0] == '#') { local_5 = 0; StringTable::get_string (&g_manager->_stringTable,(byte *)"Players",language, (byte *)(((std_string *)text)->_buf + 1),&local_5); if (local_5 == 0) { local_5 = 0; text = StringTable::get_string (&pMVar2->_stringTable,(byte *)"Players",language, (byte *)(((std_string *)text)->_buf + 1),&local_5); } } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; psVar3 = (std_string *)text; do { pcVar1 = psVar3->_buf; psVar3 = (std_string *)(psVar3->_buf + 1); } while (*pcVar1 != '\0'); std::string::assign(outName->_buf,text,(int)psVar3 - (int)(((std_string *)text)->_buf + 1)); return outName; } //@@ 00694ea0 FUN_00694ea0 void FUN_00694ea0(void) { int *in_ECX; FID_conflict__Tidy(in_ECX + 0x11); FID_conflict__Tidy(in_ECX + 0xe); std::vector::_Tidy(); FUN_0069d700(); FUN_0069d7c0(); FUN_0069d860(); FUN_0069ec00(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x180); return; } //@@ 00694f00 FUN_00694f00 undefined4 * FUN_00694f00(undefined4 *param_1,int param_2) { EntityConfig_Entity *pEVar1; int *piVar2; int *in_ECX; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af9a1e; local_10 = ExceptionList; ExceptionList = &local_10; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; local_8 = 0; local_14 = *(int *)*in_ECX; if ((int *)local_14 != (int *)*in_ECX) { do { piVar2 = (int *)(local_14 + 0x18); if (*piVar2 == param_2) { pEVar1 = (EntityConfig_Entity *)param_1[1]; if (pEVar1 == (EntityConfig_Entity *)param_1[2]) { std::vector::_Emplace_reallocate(pEVar1,piVar2); } else { EntityConfig_Entity::EntityConfig_Entity(pEVar1,piVar2); param_1[1] = param_1[1] + 0x168; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } while (local_14 != *in_ECX); } ExceptionList = local_10; return param_1; } //@@ 00694fb0 EntityConfig::GetEntity /* ZHL [exact] __thiscall EntityConfig_Entity* EntityConfig::GetEntity(int id, int variant, int subtype); prototype: REPENTOGON, confirmed by RET 12 */ EntityConfig_Entity * __thiscall EntityConfig::GetEntity(EntityConfig *this,int id,int variant,int subtype) { uint uVar1; uint uVar2; undefined1 local_14 [8]; void *local_c; EntityConfig *local_8; uVar2 = subtype; local_8 = this; while( true ) { uVar1 = (id << 0xc | variant) << 8 | uVar2; subtype = uVar1; _Find_lower_bound<>(local_14,&subtype); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) <= uVar1)) && (local_c != (local_8->_entities)._head)) break; if (uVar2 == 0) { if (variant == 0) { return (EntityConfig_Entity *)0x0; } uVar2 = 0; variant = 0; } else { uVar2 = 0; } } return (EntityConfig_Entity *)((int)local_c + 0x18); } //@@ 00695030 EntityConfig::GetBestiaryConfig /* ZHL [exact] __thiscall EntityConfig_Entity* EntityConfig::GetBestiaryConfig(int id, int variant); prototype: REPENTOGON, confirmed by RET 8 */ EntityConfig_Entity * __thiscall EntityConfig::GetBestiaryConfig(EntityConfig *this,int id,int variant) { int id_00; uint uVar1; EntityConfig_Entity *pEVar2; uint uVar3; undefined1 local_10 [8]; void *local_8; pEVar2 = GetEntity(this,id,variant,0); if (pEVar2 != (EntityConfig_Entity *)0x0) { while (id_00 = pEVar2->bestiaryParentType, id_00 != 0) { uVar1 = pEVar2->bestiaryParentVariant; uVar3 = (id_00 << 0xc | uVar1) << 8; variant = uVar3; _Find_lower_bound<>(local_10,&variant); if (((*(char *)((int)local_8 + 0xd) == '\0') && (*(uint *)((int)local_8 + 0x10) <= uVar3)) && (local_8 != (this->_entities)._head)) { pEVar2 = (EntityConfig_Entity *)((int)local_8 + 0x18); } else { if (uVar1 == 0) { return (EntityConfig_Entity *)0x0; } pEVar2 = GetEntity(this,id_00,0,0); } if (pEVar2 == (EntityConfig_Entity *)0x0) { return (EntityConfig_Entity *)0x0; } } } return pEVar2; } //@@ 006950c0 EntityConfig::LoadEntities /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: (path, isMod): parses entities2.xml ("Could not find root node 'entities'", collisionRadius/gibs/bestiary attrs); called by Manager config loader with entities2.xml */ undefined4 EntityConfig::LoadEntities(byte *param_1,void *param_2) { byte bVar1; byte bVar2; uint uVar3; int *piVar4; undefined4 uVar5; int iVar6; void *pvVar7; void *pvVar8; void *deathAnm2Attr; int *piVar9; undefined4 *puVar10; uint uVar11; byte *pbVar12; int iVar13; EntityConfig_Entity *storedEntity; byte *******pppppppbVar14; byte *pbVar15; byte *******pppppppbVar16; undefined4 extraout_ECX; undefined4 extraout_ECX_00; byte *pbVar17; std_string *psVar18; byte ******this; void *extraout_EDX; byte *pbVar19; int *piVar20; undefined4 *puVar21; char *pcVar22; code *atoiFn; bool bVar23; double dVar24; char *atoiFn; byte *******text; undefined1 *puVar26; undefined1 auStack_10298 [8]; int foundNode; int iStack_1028c; char *devolveIdParts; int devolveIdPartsEnd; char *bestiaryParentParts; int bestiaryParentPartsEnd; undefined4 bestiaryParentPartsCapacity; char *bestiaryTransformParts; int bestiaryTransformPartsEnd; undefined4 bestiaryTransformPartsCapacity; int *bestiaryTransformAttrParts; int *bestiaryTransformAttrPartsEnd; int bestiaryTransformAttrPartsCapacity; int iStack_10250; void *mod; byte *fileBuffer; int *entityConfig; byte *pbStack_10240; byte isPortraitModded; void *entityNode; uint uStack_10234; byte *pbStack_10230; undefined4 *puStack_1022c; uint uStack_10228; byte bStack_10221; undefined1 auStack_10220 [36]; float fStack_101fc; float fStack_101f8; byte bStack_101f4; int iStack_101f0; byte bStack_101ec; float fStack_101e8; float fStack_101e4; float fStack_101e0; float fStack_101dc; int iStack_101d8; float fStack_101d4; byte *******pppppppbStack_101d0; float fStack_101cc; byte bStack_101c8; int iStack_101c4; uint uStack_101c0; int iStack_101bc; byte *******pppppppbStack_101ac; int iStack_101a8; uint uStack_101a4; uint uStack_101a0; byte *******pppppppbStack_1019c; float fStack_10198; int *piStack_10190; int *piStack_1018c; undefined1 auStack_10188 [4]; int *piStack_10184; int *piStack_10180; undefined4 *puStack_10178; undefined4 *puStack_10174; byte *******apppppppbStack_1016c [4]; uint uStack_1015c; uint uStack_10158; byte bStack_10154; byte bStack_10153; int iStack_10150; int iStack_10148; undefined4 uStack_10144; float fStack_10140; int iStack_1013c; byte bStack_10138; float fStack_10134; float fStack_10130; float fStack_1012c; byte *******pppppppbStack_10128; int iStack_10124; uint uStack_10120; uint uStack_1011c; byte *******pppppppbStack_10118; float fStack_10114; byte ******appppppbStack_10110 [6]; byte ******appppppbStack_100f8 [6]; byte *****apppppbStack_100e0 [6]; int iStack_100c8; int iStack_100c4; void *pvStack_100c0; byte bStack_100bc; undefined1 xmlDocument [48]; undefined1 xmlMemoryPool [65564]; byte *devolveId; undefined4 devolveVariantSubtype; undefined4 devolveWeight; byte *******anm2Root [4]; uint anm2RootSize; uint anm2RootCapacity; int preloadId; int preloadVariant; int preloadSubtype; byte *******scratchString; int iStack_38; uint uStack_34; uint uStack_30; byte *******pppppppbStack_2c; float fStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; puStack_20 = (undefined1 *)(anm2Root + 0x17); local_14 = (byte ******)0xffffffff; puStack_18 = &LAB_00af9b90; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(anm2Root + 0x14); ExceptionList = &local_1c; mod = param_2; pbStack_10230 = param_1; uStack_10234 = 0; uStack_10228 = 0; local_24 = uVar3; piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar4 == (int *)0x0) { uVar5 = 0; } else { iVar6 = (**(code **)(*piVar4 + 4))(uVar3); fileBuffer = operator_new_tracked(iVar6 + 1); (**(code **)(*piVar4 + 0x14))(fileBuffer,1,iVar6); fileBuffer[iVar6] = 0; (**(code **)*piVar4)(1); FUN_00413b90(); local_14 = (byte ******)0x0; atoiFn = (char *)0x6951a1; pbVar15 = fileBuffer; rapidxml::xml_document::parse(xmlDocument,fileBuffer); bVar2 = (byte)pbVar15; pvVar7 = xml_node::first_node(xmlDocument,(byte *)"entities",(int)atoiFn,bVar2); if (pvVar7 == (void *)0x0) { atoiFn = "Could not find root node \'entities\' in %s\n"; pbVar15 = pbStack_10230; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'entities\' in %s\n"); bVar2 = (byte)pbVar15; } pvVar8 = xml_node::first_attribute(pvVar7,(byte *)"version",(uint)atoiFn,bVar2); pppppppbVar16 = (byte *******)&g_xmlNullStr; if (*(byte ********)((int)pvVar8 + 4) != (byte *******)0x0) { pppppppbVar16 = *(byte ********)((int)pvVar8 + 4); } pvVar8 = xml_node::first_attribute(pvVar7,(byte *)"anm2root",(uint)atoiFn,bVar2); anm2RootSize = 0; anm2RootCapacity = 0xf; anm2Root[0] = (byte *******)0x0; text = (byte *******)&g_xmlNullStr; if (*(byte ********)((int)pvVar8 + 4) != (byte *******)0x0) { text = *(byte ********)((int)pvVar8 + 4); } pbStack_10240 = (byte *)((int)text + 1); pppppppbVar14 = text; do { bVar2 = *(byte *)pppppppbVar14; pppppppbVar14 = (byte *******)((int)pppppppbVar14 + 1); } while (bVar2 != 0); uVar3 = (int)pppppppbVar14 - (int)pbStack_10240; std::string::assign((char *)anm2Root,(byte *)text,uVar3); bVar2 = (byte)uVar3; local_14._0_1_ = 1; pbVar15 = &DAT_00b63160; pppppppbVar14 = pppppppbVar16; do { bVar1 = *(byte *)pppppppbVar14; bVar23 = bVar1 < *pbVar15; if (bVar1 != *pbVar15) { LAB_00695272: uVar3 = -(uint)bVar23 | 1; goto LAB_00695277; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)pppppppbVar14 + 1); bVar23 = bVar1 < pbVar15[1]; if (bVar1 != pbVar15[1]) goto LAB_00695272; pppppppbVar14 = (byte *******)((int)pppppppbVar14 + 2); pbVar15 = pbVar15 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00695277: if (uVar3 != 0) { pbVar15 = pbStack_10230; KAGE_LogMessage(0x10,(byte *)"Invalid version %s for %s\n"); bVar2 = (byte)pbVar15; text = pppppppbVar16; } pvVar8 = mod; isPortraitModded = 0; if ((mod != (void *)0x0) && (deathAnm2Attr = xml_node::first_attribute(pvVar7,(byte *)"deathanm2",(uint)text,bVar2), deathAnm2Attr != (void *)0x0)) { pbVar15 = &g_xmlNullStr; if (*(byte **)((int)deathAnm2Attr + 4) != (byte *)0x0) { pbVar15 = *(byte **)((int)deathAnm2Attr + 4); } std::string::string_from_cstr((char *)&scratchString,pbVar15); pppppppbVar16 = (byte *******)&scratchString; local_14._0_1_ = 2; text = (byte *******)0xc; Mod::load_content_anm2(0xc,pppppppbVar16); bVar2 = (byte)pppppppbVar16; local_14._0_1_ = 1; if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; text = scratchString; if (0xfff < uVar3) { text = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)text))) goto LAB_006989c8; } operator_delete(text,uVar3); bVar2 = (byte)uVar3; } isPortraitModded = *(byte *)((int)pvVar8 + 0xef9); } entityNode = xml_node::first_node(pvVar7,(byte *)"entity",(int)text,bVar2); if (entityNode != (void *)0x0) { LAB_0069533f: atoiFn = atoi_exref; EntityConfig_Entity::EntityConfig_Entity((EntityConfig_Entity *)auStack_10220); local_14._0_1_ = 3; puStack_1022c = *(undefined4 **)((int)extraout_EDX + 0x20); pvVar7 = extraout_EDX; if (puStack_1022c != (undefined4 *)0x0) { LAB_00695376: puVar21 = puStack_1022c; pbVar19 = s_id; pbVar15 = &g_xmlNullStr; if ((byte *)*puStack_1022c != (byte *)0x0) { pbVar15 = (byte *)*puStack_1022c; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar19; pbVar12 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar19) { LAB_006953ca: uVar3 = -(uint)bVar23 | 1; goto LAB_006953cf; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar19[1]; pbVar12 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar19[1]) goto LAB_006953ca; pbVar19 = pbVar19 + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_006953cf: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } auStack_10220._0_4_ = (*atoiFn)(pbVar15); } else { atoiFn = "variant"; pbVar15 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar15 = pbVar12; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069543a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069543f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069543a; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069543f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } auStack_10220._4_4_ = (*atoiFn)(pbVar15); } else { atoiFn = "subtype"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_006954aa: uVar3 = -(uint)bVar23 | 1; goto LAB_006954af; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_006954aa; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_006954af: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } auStack_10220._8_4_ = (*atoiFn)(pbVar15); } else { atoiFn = "shadowSize"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069551a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069551f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069551a; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069551f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iVar6 = (*atoiFn)(pbVar15); fStack_101fc = (float)iVar6 / 100.0; } else { pbVar12 = s_name; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar12) { LAB_0069559a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069559f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar12[1]) goto LAB_0069559a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069559f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar19 - (int)(pbVar15 + 1); pppppppbVar16 = (byte *******)(auStack_10220 + 0xc); goto LAB_006955c6; } atoiFn = "collisionDamage"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069566b: uVar3 = -(uint)bVar23 | 1; goto LAB_00695670; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069566b; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695670: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101f8 = (float)dVar24; goto LAB_006955d1; } pbVar12 = &DAT_00b66bc8; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar12) { LAB_006956da: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_006956df; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar12[1]) goto LAB_006956da; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_006956df: if (pppppppbVar16 == (byte *******)0x0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); scratchString = pppppppbVar16; pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); if (pppppppbStack_2c == (byte *******)0x0) { LAB_006957d8: bStack_101f4 = 0; } else { pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757274) || ((((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x74, bVar2 == 0x74 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 != 0) goto LAB_0069576f; } else { LAB_0069576f: pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757254) || (((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x54, bVar2 == 0x54 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && ((bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75 && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 == 0) goto LAB_006957cf; } pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } iVar6 = atoi((char *)pppppppbVar16); if (iVar6 == 0) goto LAB_006957d8; } LAB_006957cf: bStack_101f4 = 1; } if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } } else { atoiFn = "bossID"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069586a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069586f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069586a; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069586f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iStack_101f0 = (*atoiFn)(pbVar15); goto LAB_006955d1; } atoiFn = "champion"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_006958da: uVar3 = -(uint)bVar23 | 1; goto LAB_006958df; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_006958da; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_006958df: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00695921: bStack_101ec = (-(uint)bVar23 | 1) == 0; goto LAB_006955d1; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00695921; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); bStack_101ec = 1; goto LAB_006955d1; } atoiFn = "collisionRadius"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069597a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069597f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069597a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069597f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101e8 = (float)dVar24; goto LAB_006955d1; } atoiFn = "collisionRadiusXMulti"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_006959ea: uVar3 = -(uint)bVar23 | 1; goto LAB_006959ef; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_006959ea; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_006959ef: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101e4 = (float)dVar24; goto LAB_006955d1; } atoiFn = "collisionRadiusYMulti"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00695a5a: uVar3 = -(uint)bVar23 | 1; goto LAB_00695a5f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00695a5a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695a5f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101e0 = (float)dVar24; goto LAB_006955d1; } atoiFn = "collisionMass"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00695aca: uVar3 = -(uint)bVar23 | 1; goto LAB_00695acf; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00695aca; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695acf: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101dc = (float)dVar24; goto LAB_006955d1; } atoiFn = "numGridCollisionPoints"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00695b3a: uVar3 = -(uint)bVar23 | 1; goto LAB_00695b3f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00695b3a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695b3f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iStack_101d8 = (*atoiFn)(pbVar15); goto LAB_006955d1; } atoiFn = "friction"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00695baa: uVar3 = -(uint)bVar23 | 1; goto LAB_00695baf; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00695baa; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695baf: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101d4 = (float)dVar24; goto LAB_006955d1; } pbVar12 = &DAT_00b66c2c; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar12) { LAB_00695c1a: uVar3 = -(uint)bVar23 | 1; goto LAB_00695c1f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar12[1]) goto LAB_00695c1a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695c1f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); pppppppbStack_101d0 = (byte *******)(float)dVar24; goto LAB_006955d1; } pbVar12 = &DAT_00b66c34; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar12) { LAB_00695c8a: uVar3 = -(uint)bVar23 | 1; goto LAB_00695c8f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar12[1]) goto LAB_00695c8a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695c8f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_101cc = (float)dVar24; goto LAB_006955d1; } pbVar12 = &DAT_00b66cc8; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar12) { LAB_00695cfa: uVar3 = -(uint)bVar23 | 1; goto LAB_00695cff; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar12[1]) goto LAB_00695cfa; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695cff: if (uVar3 == 0) { pbVar15 = (byte *)puStack_1022c[1]; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } if (*pbVar19 == 0) goto LAB_006955d1; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } pbVar15 = pbVar19; do { bVar2 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar2 != 0); psVar18 = (std_string *)(pbVar15 + -(int)(pbVar19 + 1)); if (psVar18 <= (std_string *)(0x7fffffff - anm2RootSize)) { pppppppbVar16 = (byte *******)anm2Root; if (0xf < anm2RootCapacity) { pppppppbVar16 = anm2Root[0]; } std::string::concat((char *)&scratchString,(int)mod,psVar18, (byte *)pppppppbVar16,anm2RootSize,pbVar19,(uint)psVar18); uStack_10234 = uStack_10234 | 1; std::string::_Tidy_deallocate(auStack_10220 + 0x74); pppppppbStack_101ac = scratchString; iStack_101a8 = iStack_38; uStack_101a4 = uStack_34; uStack_101a0 = uStack_30; pppppppbStack_1019c = pppppppbStack_2c; fStack_10198 = fStack_28; goto LAB_006955cb; } goto LAB_00698aa1; } atoiFn = "portrait"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00695dea: uVar3 = -(uint)bVar23 | 1; goto LAB_00695def; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00695dea; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00695def: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iStack_101bc = (*atoiFn)(pbVar15); if (iStack_101bc < 0) { iStack_101bc = -iStack_101bc; bStack_100bc = 0; } else { bStack_100bc = isPortraitModded; } goto LAB_006955d1; } atoiFn = "shutdoors"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00695e7a: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_00695e7f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00695e7a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_00695e7f: if (pppppppbVar16 == (byte *******)0x0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); scratchString = pppppppbVar16; pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); if (pppppppbStack_2c == (byte *******)0x0) { LAB_00695f7c: bStack_101c8 = 0; } else { pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757274) || (((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x74, bVar2 == 0x74 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && ((bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75 && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 != 0) goto LAB_00695f13; } else { LAB_00695f13: pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757254) || ((((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x54, bVar2 == 0x54 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 == 0) goto LAB_00695f73; } pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } iVar6 = atoi((char *)pppppppbVar16); if (iVar6 == 0) goto LAB_00695f7c; } LAB_00695f73: bStack_101c8 = 1; } if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } } else { atoiFn = "gridCollision"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069600a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069600f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069600a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069600f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar19 - (int)(pbVar15 + 1); pppppppbVar16 = (byte *******)apppppppbStack_1016c; goto LAB_006955c6; } atoiFn = "reroll"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069608a: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_0069608f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069608a; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_0069608f: if (pppppppbVar16 == (byte *******)0x0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); scratchString = pppppppbVar16; pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); if (pppppppbStack_2c == (byte *******)0x0) { LAB_0069618c: bStack_10154 = 0; } else { pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757274) || (((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x74, bVar2 == 0x74 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && ((bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75 && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 != 0) goto LAB_00696123; } else { LAB_00696123: pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757254) || (((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x54, bVar2 == 0x54 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && ((bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75 && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 == 0) goto LAB_00696183; } pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } iVar6 = atoi((char *)pppppppbVar16); if (iVar6 == 0) goto LAB_0069618c; } LAB_00696183: bStack_10154 = 1; } if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } } else { atoiFn = "hasFloorAlts"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069621a: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_0069621f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069621a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_0069621f: if (pppppppbVar16 == (byte *******)0x0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); scratchString = pppppppbVar16; pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); if (pppppppbStack_2c == (byte *******)0x0) { LAB_0069631c: bStack_10153 = 0; } else { pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757274) || ((((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x74, bVar2 == 0x74 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 != 0) goto LAB_006962b3; } else { LAB_006962b3: pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757254) || (((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x54, bVar2 == 0x54 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && ((bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75 && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 == 0) goto LAB_00696313; } pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } iVar6 = atoi((char *)pppppppbVar16); if (iVar6 == 0) goto LAB_0069631c; } LAB_00696313: bStack_10153 = 1; } if ((uint)fStack_28 < 0x10) goto LAB_006955cb; uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } else { atoiFn = "collisionInterval"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_006963aa: uVar3 = -(uint)bVar23 | 1; goto LAB_006963af; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_006963aa; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_006963af: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iStack_10150 = (*atoiFn)(pbVar15); goto LAB_006955d1; } atoiFn = "shieldStrength"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069641a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069641f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069641a; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069641f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } dVar24 = atof((char *)pbVar15); fStack_10140 = (float)dVar24; goto LAB_006955d1; } atoiFn = "shieldFrames"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069648a: uVar3 = -(uint)bVar23 | 1; goto LAB_0069648f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069648a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_0069648f: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iStack_1013c = (*atoiFn)(pbVar15); goto LAB_006955d1; } pbVar12 = &DAT_00b66d44; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *pbVar12) { LAB_006964fa: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_006964ff; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != pbVar12[1]) goto LAB_006964fa; pbVar12 = pbVar12 + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_006964ff: if (pppppppbVar16 == (byte *******)0x0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } scratchString = (byte *******)0x0; fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); local_14._0_1_ = 4; iStack_10148 = parse_entity_tags(); local_14._0_1_ = 3; uStack_10144 = 0; if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } } else { atoiFn = "bestiary"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_006965ea: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_006965ef; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_006965ea; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_006965ef: if (pppppppbVar16 == (byte *******)0x0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); scratchString = pppppppbVar16; pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); if (pppppppbStack_2c == (byte *******)0x0) { LAB_006966ec: bStack_10138 = 0; } else { pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757274) || (((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x74, bVar2 == 0x74 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && ((bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75 && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 != 0) goto LAB_00696683; } else { LAB_00696683: pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } if (pppppppbStack_2c == (byte *******)&DAT_00000004) { if ((*pppppppbVar16 == (byte ******)0x65757254) || ((((bVar2 = (byte)*pppppppbVar16, bVar23 = bVar2 < 0x54, bVar2 == 0x54 && (bVar23 = *(byte *)((int)pppppppbVar16 + 1) < 0x72, *(byte *)((int)pppppppbVar16 + 1) == 0x72)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75)) && (bVar23 = *(byte *)((int)pppppppbVar16 + 3) < 0x65, *(byte *)((int)pppppppbVar16 + 3) == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar23 | 1; } if (uVar3 == 0) goto LAB_006966e3; } pppppppbVar16 = (byte *******)&scratchString; if (0xf < (uint)fStack_28) { pppppppbVar16 = scratchString; } iVar6 = atoi((char *)pppppppbVar16); if (iVar6 == 0) goto LAB_006966ec; } LAB_006966e3: bStack_10138 = 1; } if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } } else { atoiFn = "bestiaryTransform"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_0069677a: pppppppbVar16 = (byte *******)(-(uint)bVar23 | 1); goto LAB_0069677f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_0069677a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); pppppppbVar16 = (byte *******)0x0; LAB_0069677f: if (pppppppbVar16 != (byte *******)0x0) { atoiFn = "bestiaryAnim"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_006969ea: uVar3 = -(uint)bVar23 | 1; goto LAB_006969ef; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_006969ea; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_006969ef: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar19 - (int)(pbVar15 + 1); pppppppbVar16 = appppppbStack_10110; } else { atoiFn = "bestiaryOverlay"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00696a6a: uVar3 = -(uint)bVar23 | 1; goto LAB_00696a6f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00696a6a; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00696a6f: if (uVar3 != 0) { atoiFn = "gibAmount"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != *atoiFn) { LAB_00696aea: uVar3 = -(uint)bVar23 | 1; goto LAB_00696aef; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puStack_1022c; if (bStack_10221 != atoiFn[1]) goto LAB_00696aea; atoiFn = atoiFn + 2; pbVar15 = pbVar15 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00696aef: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } iStack_101c4 = (*atoiFn)(pbVar15); } else { pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } atoiFn = "gibFlags"; do { bVar2 = *pbVar15; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00696b40: uVar3 = -(uint)bVar23 | 1; goto LAB_00696b45; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00696b40; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00696b45: if (uVar3 == 0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80a8c) && (_Init_thread_header(&DAT_00c80a8c), DAT_00c80a8c == -1)) { local_14._0_1_ = 8; FUN_0069d650(); _atexit(FUN_00b156e0); local_14._0_1_ = 3; _Init_thread_footer(&DAT_00c80a8c); } if (DAT_00c80a94 == 0) { std::string::string_from_cstr ((char *)&scratchString,(byte *)"blood"); local_14._0_1_ = 9; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 0; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66d98); local_14._0_1_ = 10; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 1; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66da0); local_14._0_1_ = 0xb; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 2; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66da4); local_14._0_1_ = 0xc; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 3; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,(byte *)"large"); local_14._0_1_ = 0xd; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 4; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66afc); local_14._0_1_ = 0xe; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 5; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66d74); local_14._0_1_ = 0xf; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 6; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66d7c); local_14._0_1_ = 0x10; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 7; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,(byte *)"rock_small"); local_14._0_1_ = 0x11; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 8; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,(byte *)"sound_baby"); local_14._0_1_ = 0x12; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 9; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,(byte *)"sound_bone"); local_14._0_1_ = 0x13; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 10; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,(byte *)"chain"); local_14._0_1_ = 0x14; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 0xb; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66dfc); local_14._0_1_ = 0x15; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 0xc; std::string::_Tidy_deallocate((char *)&scratchString); std::string::string_from_cstr ((char *)&scratchString,&DAT_00b66da8); local_14._0_1_ = 0x16; puVar10 = (undefined4 *)FUN_0069d630(&scratchString); local_14._0_1_ = 3; *puVar10 = 0xd; std::string::_Tidy_deallocate((char *)&scratchString); } pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } std::string::string_from_cstr((char *)&scratchString,pbVar15); local_14._0_1_ = 0x17; string_split(0x20); local_14 = (byte ******)CONCAT31(local_14._1_3_,0x19); std::string::_Tidy_deallocate((char *)&scratchString); pbStack_10230 = (byte *)0x0; iVar6 = FUN_00414410(); if (iVar6 != 0) { iVar6 = 0; do { piVar4 = (int *)std::map::find (&iStack_10250, iStack_1028c + iVar6); pbStack_10240 = (byte *)*piVar4; uVar5 = extraout_ECX; if (pbStack_10240 == DAT_00c80a90) { KAGE_LogMessage(0x10,(byte *) "invalid gibflag entry: %s\n"); uVar5 = extraout_ECX_00; } FUN_0069d9d0(*(undefined4 *)(pbStack_10240 + 0x28),uVar5); pbVar19 = pbStack_10230 + 1; iVar6 = iVar6 + 0x18; pbStack_10230 = pbVar19; pbVar15 = (byte *)FUN_00414410(); } while (pbVar19 < pbVar15); puVar21 = puStack_1022c; } local_14._0_1_ = 3; std::vector::_Tidy(); } } goto LAB_006955d1; } pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar19 - (int)(pbVar15 + 1); pppppppbVar16 = appppppbStack_100f8; } LAB_006955c6: std::string::assign((char *)pppppppbVar16,pbVar15,uVar3); goto LAB_006955cb; } pbVar15 = &g_xmlNullStr; if ((byte *)puStack_1022c[1] != (byte *)0x0) { pbVar15 = (byte *)puStack_1022c[1]; } scratchString = (byte *******)0x0; fStack_28 = 2.10195e-44; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); pppppppbStack_2c = pppppppbVar16; std::string::assign((char *)&scratchString,pbVar15, (int)pbVar19 - (int)(pbVar15 + 1)); uVar3 = uStack_10234; local_14._0_1_ = 6; uStack_10228 = uStack_10234 | 2; bestiaryTransformAttrParts = (int *)0x0; bestiaryTransformAttrPartsEnd = (int *)0x0; bestiaryTransformAttrPartsCapacity = 0; string_split(&bestiaryTransformAttrParts); local_14._0_1_ = 7; if (0xf < (uint)fStack_28) { uVar11 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar11) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar11 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar11); } piVar4 = bestiaryTransformAttrParts; if (((int)bestiaryTransformAttrPartsEnd - (int)bestiaryTransformAttrParts) / 0x18 == 3) { piVar9 = bestiaryTransformAttrParts; if (0xf < (uint)bestiaryTransformAttrParts[5]) { piVar9 = (int *)*bestiaryTransformAttrParts; } dVar24 = atof((char *)piVar9); fStack_10134 = (float)dVar24; piVar9 = piVar4 + 6; if (0xf < (uint)piVar4[0xb]) { piVar9 = (int *)*piVar9; } dVar24 = atof((char *)piVar9); fStack_10130 = (float)dVar24; piVar9 = piVar4 + 0xc; if (0xf < (uint)piVar4[0x11]) { piVar9 = (int *)*piVar9; } dVar24 = atof((char *)piVar9); fStack_1012c = (float)dVar24; } uStack_10234 = uVar3 & 0xfffffffd; local_14._0_1_ = 3; if (piVar4 != (int *)0x0) { piVar9 = bestiaryTransformAttrPartsEnd; piVar20 = piVar4; if (piVar4 != bestiaryTransformAttrPartsEnd) { do { uVar3 = piVar20[5]; if (0xf < uVar3) { pvVar7 = (void *)*piVar20; uVar11 = uVar3 + 1; pvVar8 = pvVar7; if (0xfff < uVar11) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar11 = uVar3 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_006989c8; } operator_delete(pvVar8,uVar11); piVar9 = bestiaryTransformAttrPartsEnd; } piVar20[4] = 0; piVar20[5] = 0xf; *(undefined1 *)piVar20 = 0; piVar20 = piVar20 + 6; } while (piVar20 != piVar9); } uVar3 = ((bestiaryTransformAttrPartsCapacity - (int)piVar4) / 0x18) * 0x18; piVar9 = piVar4; if (0xfff < uVar3) { piVar9 = (int *)piVar4[-1]; uVar3 = uVar3 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar4 + (-4 - (int)piVar9))) goto LAB_006989c8; } operator_delete(piVar9,uVar3); bestiaryTransformAttrParts = (int *)0x0; bestiaryTransformAttrPartsEnd = (int *)0x0; bestiaryTransformAttrPartsCapacity = 0; } } } } } } } LAB_006955cb: puVar21 = puStack_1022c; } } } } LAB_006955d1: if ((puVar21[4] == 0) || (puStack_1022c = (undefined4 *)puVar21[6], puStack_1022c == (undefined4 *)0x0)) goto LAB_006955e8; atoiFn = atoi_exref; goto LAB_00695376; } goto LAB_006955ee; } piVar4 = entityConfig; LAB_0069899e: local_14._0_1_ = 0; if (0xf < anm2RootCapacity) { uVar3 = anm2RootCapacity + 1; pppppppbVar16 = anm2Root[0]; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)anm2Root[0][-1]; uVar3 = anm2RootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Root[0] + (-4 - (int)pppppppbVar16))) { LAB_006989c8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar16,uVar3); } local_14 = (byte ******)0x22; xml_memory_pool::clear(xmlMemoryPool); local_14 = (byte ******)0xffffffff; FUN_0069de80(piVar4[0x11],piVar4[0x12],iStack_10250); FUN_0069de80(piVar4[0xe],piVar4[0xf],iStack_10250); local_14 = (byte ******)0x23; tracked_alloc(1,fileBuffer,0); uVar5 = 1; } ExceptionList = local_1c; return uVar5; LAB_006955e8: pvVar7 = entityNode; LAB_006955ee: atoiFn = "gibs"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); puVar21 = *(undefined4 **)((int)pvVar7 + 0x18); pbStack_10230 = (byte *)(pcVar22 + -0xb66dcb); if (puVar21 != (undefined4 *)0x0) { do { pbVar15 = (byte *)*puVar21; if (pbVar15 == (byte *)0x0) { pbVar19 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar19 = (byte *)puVar21[2]; } if (pbVar19 == pbStack_10230) { pbVar19 = pbVar15 + (int)pbVar19; if (pbVar19 <= pbVar15) { LAB_00696f40: puVar21 = (undefined4 *)puVar21[8]; if (puVar21 != (undefined4 *)0x0) { uVar3 = uStack_101c0; goto LAB_00696f51; } break; } iVar6 = (int)&DAT_00b66dcc - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto LAB_00696f40; } } puVar21 = (undefined4 *)puVar21[0xb]; } while (puVar21 != (undefined4 *)0x0); goto LAB_00697896; } LAB_0069789c: atoiFn = "bestiary"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); puVar21 = *(undefined4 **)((int)pvVar7 + 0x18); if (puVar21 != (undefined4 *)0x0) { do { pbVar15 = (byte *)*puVar21; if (pbVar15 == (byte *)0x0) { atoiFn = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { atoiFn = (char *)puVar21[2]; } if (atoiFn == pcVar22 + -0xb66d4b) { pbVar19 = (byte *)(atoiFn + (int)pbVar15); if (pbVar19 <= pbVar15) { LAB_006978f0: pbVar15 = (byte *)puVar21[8]; bStack_10138 = 1; goto joined_r0x00697902; } iVar6 = (int)"bestiary" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto LAB_006978f0; } } puVar21 = (undefined4 *)puVar21[0xb]; } while (puVar21 != (undefined4 *)0x0); pvVar7 = entityNode; } LAB_00697958: atoiFn = "preload"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); pbStack_10230 = (byte *)(pcVar22 + -0xb66e03); for (puStack_1022c = *(undefined4 **)((int)pvVar7 + 0x18); puStack_1022c != (undefined4 *)0x0; puStack_1022c = (undefined4 *)puStack_1022c[0xb]) { pbVar15 = (byte *)*puStack_1022c; if (pbVar15 == (byte *)0x0) { pbVar19 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar19 = (byte *)puStack_1022c[2]; } if (pbVar19 == pbStack_10230) { pbVar19 = pbVar19 + (int)pbVar15; if (pbVar19 <= pbVar15) goto joined_r0x00697ee4; iVar6 = (int)"preload" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto joined_r0x00697ee4; } } } puStack_1022c = (undefined4 *)0x0; joined_r0x00697ee4: if (puStack_1022c != (undefined4 *)0x0) { preloadId = 0; preloadVariant = 0; preloadSubtype = 0; pppppppbStack_2c = (byte *******)0x0; fStack_28 = 2.10195e-44; scratchString = (byte *******)0x0; local_14 = (byte ******)CONCAT31(local_14._1_3_,0x20); for (puVar21 = (undefined4 *)puStack_1022c[8]; puVar21 != (undefined4 *)0x0; puVar21 = (undefined4 *)puVar21[6]) { pbVar15 = (byte *)*puVar21; pbVar12 = s_id; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } do { bVar2 = *pbVar19; bVar23 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_00697f61: uVar3 = -(uint)bVar23 | 1; goto LAB_00697f66; } if (bVar2 == 0) break; bVar2 = pbVar19[1]; bVar23 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_00697f61; pbVar19 = pbVar19 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697f66: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } preloadId = atoi((char *)pbVar15); } else { atoiFn = "variant"; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } do { bVar2 = *pbVar19; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00697fb8: uVar3 = -(uint)bVar23 | 1; goto LAB_00697fbd; } if (bVar2 == 0) break; bVar2 = pbVar19[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00697fb8; pbVar19 = pbVar19 + 2; atoiFn = atoiFn + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697fbd: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } preloadVariant = atoi((char *)pbVar15); } else { atoiFn = "subtype"; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } do { bVar2 = *pbVar19; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00698010: uVar3 = -(uint)bVar23 | 1; goto LAB_00698015; } if (bVar2 == 0) break; bVar2 = pbVar19[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00698010; pbVar19 = pbVar19 + 2; atoiFn = atoiFn + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00698015: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } preloadSubtype = atoi((char *)pbVar15); } else { pbVar12 = &DAT_00b66e0c; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } do { bVar2 = *pbVar19; bVar23 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_00698067: uVar3 = -(uint)bVar23 | 1; goto LAB_0069806c; } if (bVar2 == 0) break; bVar2 = pbVar19[1]; bVar23 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_00698067; pbVar19 = pbVar19 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069806c: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); std::string::assign((char *)&scratchString,pbVar15,(int)pbVar19 - (int)(pbVar15 + 1)); } } } } if (puVar21[4] == 0) break; } piVar4 = piStack_10190; if (piStack_10190 == piStack_1018c) { std::vector<36byte>::_Emplace_reallocate(piStack_10190,&preloadId); } else { *piStack_10190 = preloadId; piStack_10190[1] = preloadVariant; piStack_10190[2] = preloadSubtype; std::string::string((char *)(piStack_10190 + 3),&scratchString); piStack_10190 = piVar4 + 9; } local_14._0_1_ = 3; if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } atoiFn = "preload"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); for (puStack_1022c = (undefined4 *)puStack_1022c[0xb]; puStack_1022c != (undefined4 *)0x0; puStack_1022c = (undefined4 *)puStack_1022c[0xb]) { pbVar15 = (byte *)*puStack_1022c; if (pbVar15 == (byte *)0x0) { atoiFn = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { atoiFn = (char *)puStack_1022c[2]; } if (atoiFn == pcVar22 + -0xb66e03) { pbVar19 = pbVar15 + (int)atoiFn; if (pbVar19 <= pbVar15) goto joined_r0x00697ee4; iVar6 = (int)"preload" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto joined_r0x00697ee4; } } } puStack_1022c = (undefined4 *)0x0; goto joined_r0x00697ee4; } atoiFn = "preload-snd"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); pbStack_10230 = (byte *)(pcVar22 + -0xb66e13); for (puVar21 = *(undefined4 **)((int)entityNode + 0x18); puVar21 != (undefined4 *)0x0; puVar21 = (undefined4 *)puVar21[0xb]) { pbVar15 = (byte *)*puVar21; if (pbVar15 == (byte *)0x0) { pbVar19 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar19 = (byte *)puVar21[2]; } if (pbVar19 == pbStack_10230) { pbVar19 = pbVar19 + (int)pbVar15; if (pbVar19 <= pbVar15) { LAB_00698210: puVar10 = (undefined4 *)puVar21[8]; puStack_1022c = (undefined4 *)0x0; for (; puVar10 != (undefined4 *)0x0; puVar10 = (undefined4 *)puVar10[6]) { pbVar15 = &g_xmlNullStr; if ((byte *)*puVar10 != (byte *)0x0) { pbVar15 = (byte *)*puVar10; } pbVar19 = s_id; do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar19; if (bStack_10221 != *pbVar19) { LAB_0069828c: uVar3 = -(uint)bVar23 | 1; goto LAB_00698291; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar19[1]; if (bStack_10221 != pbVar19[1]) goto LAB_0069828c; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bStack_10221 != 0); uVar3 = 0; LAB_00698291: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar15 = (byte *)puVar10[1]; } puStack_1022c = (undefined4 *)atoi((char *)pbVar15); } if (puVar10[4] == 0) break; } if (piStack_10184 == piStack_10180) { FUN_0069efc0(piStack_10184,&puStack_1022c); } else { *piStack_10184 = (int)puStack_1022c; piStack_10184 = piStack_10184 + 1; } atoiFn = "preload-snd"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); puVar21 = (undefined4 *)puVar21[0xb]; pbStack_10230 = (byte *)(pcVar22 + -0xb66e13); do { if (puVar21 == (undefined4 *)0x0) goto LAB_0069835c; pbVar15 = (byte *)*puVar21; if (pbVar15 == (byte *)0x0) { pbVar19 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar19 = (byte *)puVar21[2]; } if (pbVar19 == pbStack_10230) { pbVar19 = pbVar19 + (int)pbVar15; if (pbVar19 <= pbVar15) goto LAB_00698210; iVar6 = (int)"preload-snd" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto LAB_00698210; } } puVar21 = (undefined4 *)puVar21[0xb]; } while( true ); } iVar6 = (int)"preload-snd" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto LAB_00698210; } } } LAB_0069835c: atoiFn = "devolve"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); for (puStack_1022c = *(undefined4 **)((int)entityNode + 0x18); puStack_1022c != (undefined4 *)0x0; puStack_1022c = (undefined4 *)puStack_1022c[0xb]) { pbVar15 = (byte *)*puStack_1022c; if (pbVar15 == (byte *)0x0) { atoiFn = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { atoiFn = (char *)puStack_1022c[2]; } if (atoiFn == pcVar22 + -0xb66e1f) { pbVar19 = pbVar15 + (int)atoiFn; if (pbVar19 <= pbVar15) goto LAB_006983c0; iVar6 = (int)"devolve" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto LAB_006983c0; } } } LAB_00698436: pvStack_100c0 = mod; if (mod != (void *)0x0) { iVar6 = *entityConfig; iVar13 = auStack_10220._0_4_; while( true ) { auStack_10220._0_4_ = iVar13; pbVar15 = (byte *)((auStack_10220._0_4_ << 0xc | auStack_10220._4_4_) << 8 | auStack_10220._8_4_); pbStack_10230 = pbVar15; _Find_lower_bound<>(auStack_10298,&pbStack_10230); if ((*(char *)(foundNode + 0xd) != '\0') || (iVar13 = foundNode, pbVar15 < *(byte **)(foundNode + 0x10))) { iVar13 = *entityConfig; } if (iVar13 == iVar6) break; if (((auStack_10220._0_4_ == 1000) || (auStack_10220._0_4_ == 0x2329)) || ((int)auStack_10220._0_4_ < 10)) { auStack_10220._4_4_ = auStack_10220._4_4_ + 1; iVar13 = auStack_10220._0_4_; } else { iVar13 = auStack_10220._0_4_ + 1; if ((iVar13 == 0x2329) || (iVar13 == 1000)) { iVar13 = auStack_10220._0_4_ + 2; } } } } piVar4 = entityConfig; pbStack_10230 = (byte *)((auStack_10220._0_4_ << 0xc | auStack_10220._4_4_) << 8 | auStack_10220._8_4_); puVar26 = auStack_10220; storedEntity = (EntityConfig_Entity *)FUN_0069d8f0(&pbStack_10230); EntityConfig_Entity::operator_assign(storedEntity,puVar26); uVar3 = uStack_1015c; if ((bStack_101f4 == 0) && (bStack_10154 != 0)) { pppppppbVar16 = (byte *******)apppppppbStack_1016c; if (0xf < uStack_10158) { pppppppbVar16 = apppppppbStack_1016c[0]; } iStack_38 = auStack_10220._0_4_; uStack_34 = auStack_10220._4_4_; pppppppbStack_2c = pppppppbStack_101d0; uStack_30 = auStack_10220._8_4_; fStack_28 = fStack_101cc; bVar2 = str_eq((byte *)pppppppbVar16,uStack_1015c,(byte *)"ground",6); if ((bVar2 == 0) && ((uVar3 != 0 || (iStack_101d8 < 1)))) { piVar9 = piVar4 + 0x11; } else { piVar9 = piVar4 + 0xe; } piVar20 = (int *)piVar9[1]; if (piVar20 == (int *)piVar9[2]) { std::vector<20byte>::_Emplace_reallocate(piVar20,&iStack_38); } else { *piVar20 = iStack_38; piVar20[1] = uStack_34; piVar20[2] = uStack_30; piVar20[3] = (int)pppppppbStack_2c; piVar20[4] = (int)fStack_28; piVar9[1] = piVar9[1] + 0x14; } } local_14._0_1_ = 1; std::string::_Tidy_deallocate((char *)apppppbStack_100e0); std::string::_Tidy_deallocate((char *)appppppbStack_100f8); std::string::_Tidy_deallocate((char *)appppppbStack_10110); if (0xf < (uint)fStack_10114) { uVar3 = (int)fStack_10114 + 1; pppppppbVar16 = pppppppbStack_10128; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)pppppppbStack_10128[-1]; uVar3 = (int)fStack_10114 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbStack_10128 + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } pppppppbStack_10118 = (byte *******)0x0; fStack_10114 = 2.10195e-44; pppppppbStack_10128 = (byte *******)((uint)pppppppbStack_10128 & 0xffffff00); std::string::_Tidy_deallocate((char *)apppppppbStack_1016c); std::vector<12byte>::_Tidy(); FID_conflict__Tidy(auStack_10188); FUN_0069db30(); if (0xf < (uint)fStack_10198) { uVar3 = (int)fStack_10198 + 1; pppppppbVar16 = pppppppbStack_101ac; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)pppppppbStack_101ac[-1]; uVar3 = (int)fStack_10198 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbStack_101ac + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } pppppppbStack_1019c = (byte *******)0x0; fStack_10198 = 2.10195e-44; pppppppbStack_101ac = (byte *******)((uint)pppppppbStack_101ac & 0xffffff00); FUN_0069dbc0(); std::string::_Tidy_deallocate(auStack_10220 + 0xc); entityNode = *(void **)((int)entityNode + 0x2c); if (entityNode == (void *)0x0) goto LAB_0069899e; goto LAB_0069533f; LAB_00696f51: do { atoiFn = "amount"; pbVar15 = &g_xmlNullStr; if ((byte *)*puVar21 != (byte *)0x0) { pbVar15 = (byte *)*puVar21; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_00696fb2: uVar11 = -(uint)bVar23 | 1; goto LAB_00696fb7; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_00696fb2; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_00696fb7: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } iStack_101c4 = atoi((char *)pbVar15); } else { atoiFn = "blood"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_0069702a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069702f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_0069702a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069702f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697065: uVar11 = -(uint)bVar23 | 1; goto LAB_0069706a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697065; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069706a: if (uVar11 == 0) { uVar3 = uVar3 | 1; LAB_0069787f: uStack_101c0 = uVar3; } } else { pbVar12 = &DAT_00b66d98; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_006970ca: uVar11 = -(uint)bVar23 | 1; goto LAB_006970cf; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_006970ca; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_006970cf: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697105: uVar11 = -(uint)bVar23 | 1; goto LAB_0069710a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697105; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069710a: if (uVar11 == 0) { uVar3 = uVar3 | 2; goto LAB_0069787f; } } else { pbVar12 = &DAT_00b66da0; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_0069716a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069716f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_0069716a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069716f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_006971a5: uVar11 = -(uint)bVar23 | 1; goto LAB_006971aa; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_006971a5; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_006971aa: if (uVar11 == 0) { uVar3 = uVar3 | 4; goto LAB_0069787f; } } else { pbVar12 = &DAT_00b66da4; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_0069720a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069720f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_0069720a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069720f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697245: uVar11 = -(uint)bVar23 | 1; goto LAB_0069724a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697245; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069724a: if (uVar11 == 0) { uVar3 = uVar3 | 8; goto LAB_0069787f; } } else { atoiFn = "large"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_006972aa: uVar11 = -(uint)bVar23 | 1; goto LAB_006972af; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_006972aa; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_006972af: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_006972e5: uVar11 = -(uint)bVar23 | 1; goto LAB_006972ea; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_006972e5; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_006972ea: if (uVar11 == 0) { uVar3 = uVar3 | 0x10; goto LAB_0069787f; } } else { pbVar12 = &DAT_00b66afc; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_0069734a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069734f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_0069734a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069734f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697385: uVar11 = -(uint)bVar23 | 1; goto LAB_0069738a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697385; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069738a: if (uVar11 == 0) { uVar3 = uVar3 | 0x20; goto LAB_0069787f; } } else { pbVar12 = &DAT_00b66d74; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_006973ea: uVar11 = -(uint)bVar23 | 1; goto LAB_006973ef; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_006973ea; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_006973ef: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697425: uVar11 = -(uint)bVar23 | 1; goto LAB_0069742a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697425; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069742a: if (uVar11 == 0) { uVar3 = uVar3 | 0x40; goto LAB_0069787f; } } else { pbVar12 = &DAT_00b66d7c; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_0069748a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069748f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_0069748a; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069748f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_006974c5: uVar11 = -(uint)bVar23 | 1; goto LAB_006974ca; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_006974c5; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_006974ca: if (uVar11 == 0) { uVar3 = uVar3 | 0x80; goto LAB_0069787f; } } else { atoiFn = "rock_small"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_0069752a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069752f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_0069752a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069752f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697565: uVar11 = -(uint)bVar23 | 1; goto LAB_0069756a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697565; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069756a: if (uVar11 == 0) { uVar3 = uVar3 | 0x100; goto LAB_0069787f; } } else { atoiFn = "sound_baby"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_006975ca: uVar11 = -(uint)bVar23 | 1; goto LAB_006975cf; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_006975ca; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_006975cf: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697605: uVar11 = -(uint)bVar23 | 1; goto LAB_0069760a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697605; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069760a: if (uVar11 == 0) { uVar3 = uVar3 | 0x200; goto LAB_0069787f; } } else { atoiFn = "sound_bone"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_0069766a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069766f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_0069766a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069766f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_006976a5: uVar11 = -(uint)bVar23 | 1; goto LAB_006976aa; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_006976a5; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_006976aa: if (uVar11 == 0) { uVar3 = uVar3 | 0x400; goto LAB_0069787f; } } else { atoiFn = "chain"; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < (byte)*atoiFn; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *atoiFn) { LAB_0069770a: uVar11 = -(uint)bVar23 | 1; goto LAB_0069770f; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < (byte)atoiFn[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != atoiFn[1]) goto LAB_0069770a; pbVar15 = pbVar15 + 2; atoiFn = atoiFn + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_0069770f: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697745: uVar11 = -(uint)bVar23 | 1; goto LAB_0069774a; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697745; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_0069774a: if (uVar11 == 0) { uVar3 = uVar3 | 0x800; goto LAB_0069787f; } } else { pbVar12 = &DAT_00b66dfc; pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } do { bStack_10221 = *pbVar15; bVar23 = bStack_10221 < *pbVar12; pbVar19 = (byte *)*puVar21; if (bStack_10221 != *pbVar12) { LAB_006977aa: uVar11 = -(uint)bVar23 | 1; goto LAB_006977af; } if (bStack_10221 == 0) break; bStack_10221 = pbVar15[1]; bVar23 = bStack_10221 < pbVar12[1]; pbVar19 = (byte *)*puVar21; if (bStack_10221 != pbVar12[1]) goto LAB_006977aa; pbVar15 = pbVar15 + 2; pbVar12 = pbVar12 + 2; } while (bStack_10221 != 0); uVar11 = 0; LAB_006977af: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_006977e5: uVar11 = -(uint)bVar23 | 1; goto LAB_006977ea; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_006977e5; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_006977ea: if (uVar11 == 0) { uVar3 = uVar3 | 0x1000; goto LAB_0069787f; } } else { pbVar15 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar15 = pbVar19; } pbVar19 = &DAT_00b66da8; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697830: uVar11 = -(uint)bVar23 | 1; goto LAB_00697835; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697830; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_00697835: if (uVar11 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } pbVar19 = &DAT_00b63104; do { bVar2 = *pbVar15; bVar23 = bVar2 < *pbVar19; if (bVar2 != *pbVar19) { LAB_00697870: uVar11 = -(uint)bVar23 | 1; goto LAB_00697875; } if (bVar2 == 0) break; bVar2 = pbVar15[1]; bVar23 = bVar2 < pbVar19[1]; if (bVar2 != pbVar19[1]) goto LAB_00697870; pbVar15 = pbVar15 + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar11 = 0; LAB_00697875: if (uVar11 == 0) { uVar3 = uVar3 | 0x2000; goto LAB_0069787f; } } } } } } } } } } } } } } } } } while ((puVar21[4] != 0) && (puVar21 = (undefined4 *)puVar21[6], puVar21 != (undefined4 *)0x0)); LAB_00697896: pvVar7 = entityNode; goto LAB_0069789c; joined_r0x00697902: if (pbVar15 == (byte *)0x0) goto LAB_00697e7d; pbVar19 = *(byte **)pbVar15; atoiFn = "transform"; pbVar12 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar12 = pbVar19; } do { bVar2 = *pbVar12; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00697994: uVar3 = -(uint)bVar23 | 1; goto LAB_00697999; } if (bVar2 == 0) break; bVar2 = pbVar12[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00697994; pbVar12 = pbVar12 + 2; atoiFn = atoiFn + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697999: pbStack_10230 = pbVar15; if (uVar3 == 0) { pppppppbStack_2c = (byte *******)0x0; pbVar19 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbVar15 + 4); } fStack_28 = 2.10195e-44; scratchString = (byte *******)0x0; pbVar12 = pbVar19; do { bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar2 != 0); std::string::assign((char *)&scratchString,pbVar19,(int)pbVar12 - (int)(pbVar19 + 1)); local_14._0_1_ = 0x1b; uStack_10234 = uStack_10234 | 4; bestiaryTransformParts = (char *)0x0; bestiaryTransformPartsEnd = 0; bestiaryTransformPartsCapacity = 0; uStack_10228 = uStack_10234; string_split(&bestiaryTransformParts); local_14._0_1_ = 0x1c; if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } atoiFn = bestiaryTransformParts; if ((bestiaryTransformPartsEnd - (int)bestiaryTransformParts) / 0x18 == 3) { pcVar22 = bestiaryTransformParts; if (0xf < *(uint *)(bestiaryTransformParts + 0x14)) { pcVar22 = *(char **)bestiaryTransformParts; } dVar24 = atof(pcVar22); fStack_10134 = (float)dVar24; pcVar22 = atoiFn + 0x18; if (0xf < *(uint *)(atoiFn + 0x2c)) { pcVar22 = *(char **)pcVar22; } dVar24 = atof(pcVar22); fStack_10130 = (float)dVar24; pcVar22 = atoiFn + 0x30; if (0xf < *(uint *)(atoiFn + 0x44)) { pcVar22 = *(char **)pcVar22; } dVar24 = atof(pcVar22); fStack_1012c = (float)dVar24; } uStack_10234 = uStack_10234 & 0xfffffffb; local_14._0_1_ = 3; std::vector::_Tidy(); } else { atoiFn = "parent"; pbVar12 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar12 = pbVar19; } do { bVar2 = *pbVar12; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00697b24: uVar3 = -(uint)bVar23 | 1; goto LAB_00697b29; } if (bVar2 == 0) break; bVar2 = pbVar12[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00697b24; pbVar12 = pbVar12 + 2; atoiFn = atoiFn + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697b29: if (uVar3 == 0) { pppppppbStack_2c = (byte *******)0x0; pbVar19 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbVar15 + 4); } fStack_28 = 2.10195e-44; scratchString = (byte *******)0x0; pbVar15 = pbVar19; do { bVar2 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar2 != 0); std::string::assign((char *)&scratchString,pbVar19,(int)pbVar15 - (int)(pbVar19 + 1)); local_14._0_1_ = 0x1e; uStack_10234 = uStack_10234 | 8; bestiaryParentParts = (char *)0x0; bestiaryParentPartsEnd = 0; bestiaryParentPartsCapacity = 0; uStack_10228 = uStack_10234; string_split(&bestiaryParentParts); local_14._0_1_ = 0x1f; if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } atoiFn = bestiaryParentParts; iVar6 = bestiaryParentPartsEnd - (int)bestiaryParentParts >> 0x1f; iVar13 = (bestiaryParentPartsEnd - (int)bestiaryParentParts) / 0x18 + iVar6; if (iVar13 != iVar6) { pcVar22 = bestiaryParentParts; if (0xf < *(uint *)(bestiaryParentParts + 0x14)) { pcVar22 = *(char **)bestiaryParentParts; } iStack_100c8 = atoi(pcVar22); if (1 < (uint)(iVar13 - iVar6)) { pcVar22 = atoiFn + 0x18; if (0xf < *(uint *)(atoiFn + 0x2c)) { pcVar22 = *(char **)pcVar22; } iStack_100c4 = atoi(pcVar22); } } uStack_10234 = uStack_10234 & 0xfffffff7; local_14._0_1_ = 3; std::vector::_Tidy(); pbVar15 = pbStack_10230; } else { pbVar17 = &DAT_00b66cc8; pbVar12 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar12 = pbVar19; } do { bVar2 = *pbVar12; bVar23 = bVar2 < *pbVar17; if (bVar2 != *pbVar17) { LAB_00697ca4: uVar3 = -(uint)bVar23 | 1; goto LAB_00697ca9; } if (bVar2 == 0) break; bVar2 = pbVar12[1]; bVar23 = bVar2 < pbVar17[1]; if (bVar2 != pbVar17[1]) goto LAB_00697ca4; pbVar12 = pbVar12 + 2; pbVar17 = pbVar17 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697ca9: if (uVar3 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbVar15 + 4); } pbVar12 = pbVar19; do { bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar2 != 0); psVar18 = (std_string *)(pbVar12 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < psVar18) { LAB_00698aa1: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar16 = (byte *******)anm2Root; if (0xf < anm2RootCapacity) { pppppppbVar16 = anm2Root[0]; } std::string::concat((char *)&scratchString,iStack_10250,psVar18,(byte *)pppppppbVar16, anm2RootSize,pbVar19,(uint)psVar18); uStack_10234 = uStack_10234 | 0x10; std::string::_Tidy_deallocate((char *)&pppppppbStack_10128); pppppppbStack_10128 = scratchString; scratchString = (byte *******)((uint)scratchString & 0xffffff00); iStack_10124 = iStack_38; uStack_10120 = uStack_34; uStack_1011c = uStack_30; pppppppbStack_10118 = pppppppbStack_2c; fStack_10114 = fStack_28; pppppppbStack_2c = (byte *******)0x0; fStack_28 = 2.10195e-44; std::string::_Tidy_deallocate((char *)&scratchString); } else { pbVar17 = &DAT_00b1bffc; pbVar12 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar12 = pbVar19; } do { bVar2 = *pbVar12; bVar23 = bVar2 < *pbVar17; if (bVar2 != *pbVar17) { LAB_00697d74: uVar3 = -(uint)bVar23 | 1; goto LAB_00697d79; } if (bVar2 == 0) break; bVar2 = pbVar12[1]; bVar23 = bVar2 < pbVar17[1]; if (bVar2 != pbVar17[1]) goto LAB_00697d74; pbVar12 = pbVar12 + 2; pbVar17 = pbVar17 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697d79: if (uVar3 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbVar15 + 4); } pbVar12 = pbVar19; do { bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar12 - (int)(pbVar19 + 1); this = (byte ******)appppppbStack_10110; } else { atoiFn = "overlay"; pbVar12 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar12 = pbVar19; } do { bVar2 = *pbVar12; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00697dd4: uVar3 = -(uint)bVar23 | 1; goto LAB_00697dd9; } if (bVar2 == 0) break; bVar2 = pbVar12[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00697dd4; pbVar12 = pbVar12 + 2; atoiFn = atoiFn + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697dd9: if (uVar3 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbVar15 + 4); } pbVar12 = pbVar19; do { bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar12 - (int)(pbVar19 + 1); this = (byte ******)appppppbStack_100f8; } else { pbVar17 = &DAT_00b66e44; pbVar12 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar12 = pbVar19; } do { bVar2 = *pbVar12; bVar23 = bVar2 < *pbVar17; if (bVar2 != *pbVar17) { LAB_00697e31: uVar3 = -(uint)bVar23 | 1; goto LAB_00697e36; } if (bVar2 == 0) break; bVar2 = pbVar12[1]; bVar23 = bVar2 < pbVar17[1]; if (bVar2 != pbVar17[1]) goto LAB_00697e31; pbVar12 = pbVar12 + 2; pbVar17 = pbVar17 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00697e36: if (uVar3 != 0) goto LAB_00697e66; pbVar19 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbVar15 + 4); } pbVar12 = pbVar19; do { bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar12 - (int)(pbVar19 + 1); this = apppppbStack_100e0; } } std::string::assign((char *)this,pbVar19,uVar3); } } } LAB_00697e66: if (*(int *)(pbVar15 + 0x10) == 0) goto LAB_00697e7d; pbVar15 = *(byte **)(pbVar15 + 0x18); goto joined_r0x00697902; LAB_00697e7d: pvVar7 = entityNode; if (iStack_100c8 != 0) { bStack_10138 = 0; } goto LAB_00697958; LAB_006983c0: puVar21 = (undefined4 *)puStack_1022c[8]; pbStack_10230 = (byte *)0x0; pbStack_10240 = (byte *)0x0; uStack_10228 = 0; for (; puVar21 != (undefined4 *)0x0; puVar21 = (undefined4 *)puVar21[6]) { pbVar15 = (byte *)*puVar21; pbVar12 = s_id; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } do { bVar2 = *pbVar19; bVar23 = bVar2 < *pbVar12; if (bVar2 != *pbVar12) { LAB_006984b5: uVar3 = -(uint)bVar23 | 1; goto LAB_006984ba; } if (bVar2 == 0) break; bVar2 = pbVar19[1]; bVar23 = bVar2 < pbVar12[1]; if (bVar2 != pbVar12[1]) goto LAB_006984b5; pbVar19 = pbVar19 + 2; pbVar12 = pbVar12 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_006984ba: if (uVar3 == 0) { pppppppbStack_2c = (byte *******)0x0; pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } fStack_28 = 2.10195e-44; scratchString = (byte *******)0x0; pbVar19 = pbVar15; do { bVar2 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar2 != 0); std::string::assign((char *)&scratchString,pbVar15,(int)pbVar19 - (int)(pbVar15 + 1)); local_14 = (byte ******)CONCAT31(local_14._1_3_,0x21); string_split(0x2e); if ((devolveIdPartsEnd - (int)devolveIdParts) / 0x18 == 3) { atoiFn = devolveIdParts; if (0xf < *(uint *)(devolveIdParts + 0x14)) { atoiFn = *(char **)devolveIdParts; } pbStack_10230 = (byte *)atoi(atoiFn); atoiFn = devolveIdParts + 0x18; if (0xf < *(uint *)(devolveIdParts + 0x2c)) { atoiFn = *(char **)atoiFn; } pbStack_10240 = (byte *)atoi(atoiFn); atoiFn = devolveIdParts + 0x30; if (0xf < *(uint *)(devolveIdParts + 0x44)) { atoiFn = *(char **)atoiFn; } uStack_10228 = atoi(atoiFn); } std::vector::_Tidy(); local_14._0_1_ = 3; if (0xf < (uint)fStack_28) { uVar3 = (int)fStack_28 + 1; pppppppbVar16 = scratchString; if (0xfff < uVar3) { pppppppbVar16 = (byte *******)scratchString[-1]; uVar3 = (int)fStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)scratchString + (-4 - (int)pppppppbVar16))) goto LAB_006989c8; } operator_delete(pppppppbVar16,uVar3); } } else { atoiFn = "weight"; pbVar19 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar19 = pbVar15; } do { bVar2 = *pbVar19; bVar23 = bVar2 < (byte)*atoiFn; if (bVar2 != *atoiFn) { LAB_00698610: uVar3 = -(uint)bVar23 | 1; goto LAB_00698615; } if (bVar2 == 0) break; bVar2 = pbVar19[1]; bVar23 = bVar2 < (byte)atoiFn[1]; if (bVar2 != atoiFn[1]) goto LAB_00698610; atoiFn = atoiFn + 2; pbVar19 = pbVar19 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00698615: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar15 = (byte *)puVar21[1]; } atof((char *)pbVar15); } } if (puVar21[4] == 0) break; } puVar21 = puStack_1022c; devolveVariantSubtype = CONCAT22((short)uStack_10228,(short)pbStack_10240); devolveWeight = 0x3f800000; devolveId = pbStack_10230; if (puStack_10178 == puStack_10174) { std::vector<12byte>::_Emplace_reallocate(puStack_10178,&devolveId); } else { *puStack_10178 = pbStack_10230; puStack_10178[1] = devolveVariantSubtype; puStack_10178[2] = 0x3f800000; puStack_10178 = puStack_10178 + 3; } atoiFn = "devolve"; do { pcVar22 = atoiFn; atoiFn = pcVar22 + 1; } while (*atoiFn != '\0'); puStack_1022c = (undefined4 *)puVar21[0xb]; if (puStack_1022c != (undefined4 *)0x0) { do { pbVar15 = (byte *)*puStack_1022c; if (pbVar15 == (byte *)0x0) { atoiFn = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { atoiFn = (char *)puStack_1022c[2]; } if (atoiFn == pcVar22 + -0xb66e1f) { pbVar19 = (byte *)(atoiFn + (int)pbVar15); if (pbVar19 <= pbVar15) goto LAB_006983c0; iVar6 = (int)"devolve" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar19 <= pbVar15) goto LAB_006983c0; } } puStack_1022c = (undefined4 *)puStack_1022c[0xb]; if (puStack_1022c == (undefined4 *)0x0) break; } while( true ); } goto LAB_00698436; } //@@ 00698ab0 EntityConfig_Entity::~EntityConfig_Entity /* DB: destroys the strings, vector<12byte>, +0x98 vector and maps of an entity config record; std::vector::_Tidy and other EntityConfig loaders prototype: db/protos.zhl */ void __thiscall EntityConfig_Entity::~EntityConfig_Entity(EntityConfig_Entity *this) { std::string::_Tidy_deallocate((this->bestiaryFloorAlt)._buf); std::string::_Tidy_deallocate((this->bestiaryOverlay)._buf); std::string::_Tidy_deallocate((this->bestiaryAnim)._buf); std::string::_Tidy_deallocate((this->bestiaryAnm2Path)._buf); std::string::_Tidy_deallocate((this->gridCollisionClassString)._buf); std::vector<12byte>::_Tidy(); FID_conflict__Tidy(&this->preloadSounds); FUN_0069db30(); std::string::_Tidy_deallocate((this->anm2Path)._buf); FUN_0069dbc0(); std::string::_Tidy_deallocate((this->name)._buf); return; } //@@ 00698b30 FUN_00698b30 void FUN_00698b30(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0xc)); return; } //@@ 00698b40 EntityConfig_Entity::operator_assign /* DB: ? copy-assigns an entity-config record: 3 dwords, std::string at +0xc, then vectors via 006a0dc0/006a0850/006a06b0; used in EntityConfig::LoadEntities to copy the parsed entity */ EntityConfig_Entity * __thiscall EntityConfig_Entity::operator_assign(EntityConfig_Entity *this,int *param_2) { size_t byteCount; byte *srcChars; void *dstBegin; std_vector *dstVector; int *src; void *srcBegin; int tagsHigh; src = param_2; this->id = *param_2; this->variant = param_2[1]; this->subtype = param_2[2]; srcChars = (byte *)(param_2 + 3); if (&this->name != (std_string *)srcChars) { if (0xf < (uint)param_2[8]) { srcChars = *(byte **)srcChars; } std::string::assign((this->name)._buf,srcChars,param_2[7]); } this->shadowSize = (float)param_2[9]; this->collisionDamage = (float)param_2[10]; this->isBoss = *(byte *)(param_2 + 0xb); this->bossID = param_2[0xc]; this->canBeChampion = *(byte *)(param_2 + 0xd); this->collisionRadius = (float)param_2[0xe]; (this->collisionRadiusMulti).x = (float)param_2[0xf]; (this->collisionRadiusMulti).y = (float)param_2[0x10]; this->mass = (float)param_2[0x11]; this->gridCollisionPoints = param_2[0x12]; this->friction = (float)param_2[0x13]; this->baseHP = (float)param_2[0x14]; this->stageHP = (float)param_2[0x15]; this->shutDoors = *(byte *)(param_2 + 0x16); this->gibsAmount = param_2[0x17]; this->gibFlags = param_2[0x18]; this->portrait = param_2[0x19]; if (&this->_bossColors != (std_vector *)(param_2 + 0x1a)) { FUN_006a0850(param_2[0x1a],param_2[0x1b],param_2); } srcChars = (byte *)(param_2 + 0x1d); if (&this->anm2Path != (std_string *)srcChars) { if (0xf < (uint)param_2[0x22]) { srcChars = *(byte **)srcChars; } std::string::assign((this->anm2Path)._buf,srcChars,param_2[0x21]); } if ((int *)&this->field_0x8c != param_2 + 0x23) { FUN_006a06b0(param_2[0x23],param_2[0x24],param_2); } dstVector = &this->preloadSounds; if (dstVector != (std_vector *)(param_2 + 0x26)) { srcBegin = (void *)param_2[0x26]; byteCount = param_2[0x27] - (int)srcBegin; dstBegin = dstVector->_begin; if ((uint)((int)(this->preloadSounds)._capacity - (int)dstBegin >> 2) < (uint)((int)byteCount >> 2)) { std::vector::reserve_clear((int)byteCount >> 2); dstBegin = dstVector->_begin; } memmove(dstBegin,srcBegin,byteCount); (this->preloadSounds)._end = (void *)(byteCount + (int)dstBegin); } dstVector = &this->devolve; if (dstVector != (std_vector *)(param_2 + 0x29)) { srcBegin = (void *)param_2[0x29]; byteCount = param_2[0x2a] - (int)srcBegin; param_2 = dstVector->_begin; if ((uint)(((int)(this->devolve)._capacity - (int)param_2) / 0xc) < (uint)((int)byteCount / 0xc) ) { FUN_006a0dc0((int)byteCount / 0xc); param_2 = dstVector->_begin; } memmove(param_2,srcBegin,byteCount); (this->devolve)._end = (void *)((int)param_2 + byteCount); } this->isPreloaded = *(byte *)(src + 0x2c); srcChars = (byte *)(src + 0x2d); if (&this->gridCollisionClassString != (std_string *)srcChars) { if (0xf < (uint)src[0x32]) { srcChars = *(byte **)srcChars; } std::string::assign((this->gridCollisionClassString)._buf,srcChars,src[0x31]); } this->reroll = *(byte *)(src + 0x33); this->hasFloorAlts = *(byte *)((int)src + 0xcd); this->collisionInterval = src[0x34]; tagsHigh = src[0x37]; this->tags = src[0x36]; *(int *)&this->field_0xdc = tagsHigh; this->shieldStrength = (float)src[0x38]; this->shieldFrames = src[0x39]; this->bestiary = *(byte *)(src + 0x3a); (this->bestiaryOffset).x = (float)src[0x3b]; (this->bestiaryOffset).y = (float)src[0x3c]; this->bestiaryScale = (float)src[0x3d]; srcChars = (byte *)(src + 0x3e); if (&this->bestiaryAnm2Path != (std_string *)srcChars) { if (0xf < (uint)src[0x43]) { srcChars = *(byte **)srcChars; } std::string::assign((this->bestiaryAnm2Path)._buf,srcChars,src[0x42]); } srcChars = (byte *)(src + 0x44); if (&this->bestiaryAnim != (std_string *)srcChars) { if (0xf < (uint)src[0x49]) { srcChars = *(byte **)srcChars; } std::string::assign((this->bestiaryAnim)._buf,srcChars,src[0x48]); } srcChars = (byte *)(src + 0x4a); if (&this->bestiaryOverlay != (std_string *)srcChars) { if (0xf < (uint)src[0x4f]) { srcChars = *(byte **)srcChars; } std::string::assign((this->bestiaryOverlay)._buf,srcChars,src[0x4e]); } srcChars = (byte *)(src + 0x50); if (&this->bestiaryFloorAlt != (std_string *)srcChars) { if (0xf < (uint)src[0x55]) { srcChars = *(byte **)srcChars; } std::string::assign((this->bestiaryFloorAlt)._buf,srcChars,src[0x54]); } this->bestiaryParentType = src[0x56]; this->bestiaryParentVariant = src[0x57]; this->modEntry = (void *)src[0x58]; this->isPortraitModded = *(byte *)(src + 0x59); return this; } //@@ 00698e80 EntityConfig::load_boss_colors /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: bosscolors.xml: 'Could not find root node bosscolors', 'Cannot patch boss colors for Entity %d.%d', EntityConfig::GetEntity; called from config loader 00952df0 Manager::load_configs undefined4 EntityConfig::load_boss_colors(byte *param_1) { void **ppvVar1; qword qVar2; uint uVar3; int *file; undefined4 isLoaded; int iVar4; byte *text; void *xmlNode; void *pvVar5; EntityConfig_Entity *entityConfig; byte ****ppppbVar6; EntityConfig *in_ECX; byte *pbVar7; byte *pbVar8; undefined4 extraout_ECX; std_string *valueLength; int iVar9; qword *allocCounter; undefined4 *attr; bool bVar10; double dVar11; char *pcVar12; byte *pbVar13; byte bVar14; int entityType; int entityVariant; undefined4 *colorNode; undefined1 doc [48]; undefined1 auStack_10108 [65560]; void *joinedPath; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 uStack_e4; undefined4 local_e0; uint uStack_dc; undefined4 bossColor; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 local_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 local_b8; undefined4 uStack_b4; undefined4 local_b0; void *local_ac [4]; undefined4 local_9c; uint suffixCapacity; void *anm2Path; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; uint anm2PathCapacity; void *portraitPath; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; uint portraitPathCapacity; float local_64; float hpScale; byte ****anm2Root [4]; uint anm2RootSize; uint anm2RootCapacity; byte ****portraitRoot [4]; uint portraitRootSize; uint portraitRootCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ***local_14; Color *bossColorsEnd; char *colorTagLast; puStack_20 = (undefined1 *)(portraitRoot + 0xe); local_14 = (byte ***)0xffffffff; puStack_18 = &LAB_00af9beb; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(portraitRoot + 0xb); ExceptionList = &local_1c; local_24 = uVar3; file = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (file == (int *)0x0) { isLoaded = 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_14 = (byte ***)0x0; pcVar12 = (char *)0x698f55; pbVar7 = text; rapidxml::xml_document::parse(doc,text); bVar14 = (byte)pbVar7; xmlNode = xml_node::first_node(doc,(byte *)"bosscolors",(int)pcVar12,bVar14); if (xmlNode == (void *)0x0) { pcVar12 = "Could not find root node \'bosscolors\' in %s\n"; pbVar7 = param_1; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'bosscolors\' in %s\n"); bVar14 = (byte)pbVar7; } pvVar5 = xml_node::first_attribute(xmlNode,(byte *)"version",(uint)pcVar12,bVar14); pbVar7 = &g_xmlNullStr; if (*(byte **)((int)pvVar5 + 4) != (byte *)0x0) { pbVar7 = *(byte **)((int)pvVar5 + 4); } pbVar13 = (byte *)0x698fad; pbVar8 = pbVar7; iVar4 = atoi((char *)pbVar7); bVar14 = (byte)pbVar8; if ((iVar4 < 0) || (1 < iVar4)) { KAGE_LogMessage(0x10,(byte *)"Invalid version %s for %s\n"); bVar14 = (byte)param_1; pbVar13 = pbVar7; } anm2RootSize = 0; anm2RootCapacity = 0xf; anm2Root[0] = (byte ****)0x0; portraitRootSize = 0; portraitRootCapacity = 0xf; portraitRoot[0] = (byte ****)0x0; local_14._0_1_ = 2; if (0 < iVar4) { pvVar5 = xml_node::first_attribute(xmlNode,(byte *)"anm2root",(uint)pbVar13,bVar14); pbVar7 = &g_xmlNullStr; if (*(byte **)((int)pvVar5 + 4) != (byte *)0x0) { pbVar7 = *(byte **)((int)pvVar5 + 4); } pbVar13 = pbVar7; do { bVar14 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar14 != 0); uVar3 = (int)pbVar13 - (int)(pbVar7 + 1); std::string::assign((char *)anm2Root,pbVar7,uVar3); pvVar5 = xml_node::first_attribute(xmlNode,(byte *)"portraitroot",(uint)pbVar7,(byte)uVar3); pbVar13 = &g_xmlNullStr; if (*(byte **)((int)pvVar5 + 4) != (byte *)0x0) { pbVar13 = *(byte **)((int)pvVar5 + 4); } pbVar7 = pbVar13; do { bVar14 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar14 != 0); uVar3 = (int)pbVar7 - (int)(pbVar13 + 1); std::string::assign((char *)portraitRoot,pbVar13,uVar3); bVar14 = (byte)uVar3; } for (xmlNode = xml_node::first_node(xmlNode,&DAT_00b66bc8,(int)pbVar13,bVar14); xmlNode != (void *)0x0; xmlNode = *(void **)((int)xmlNode + 0x2c)) { for (attr = *(undefined4 **)((int)xmlNode + 0x20); attr != (undefined4 *)0x0; attr = (undefined4 *)attr[6]) { pbVar7 = (byte *)*attr; pbVar8 = s_id; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < *pbVar8; if (bVar14 != *pbVar8) { LAB_006990e1: uVar3 = -(uint)bVar10 | 1; goto LAB_006990e6; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < pbVar8[1]; if (bVar14 != pbVar8[1]) goto LAB_006990e1; pbVar13 = pbVar13 + 2; pbVar8 = pbVar8 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_006990e6: if (uVar3 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } entityType = atoi((char *)pbVar7); } else { pcVar12 = "variant"; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < (byte)*pcVar12; if (bVar14 != *pcVar12) { LAB_00699135: uVar3 = -(uint)bVar10 | 1; goto LAB_0069913a; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < (byte)pcVar12[1]; if (bVar14 != pcVar12[1]) goto LAB_00699135; pbVar13 = pbVar13 + 2; pcVar12 = pcVar12 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_0069913a: if (uVar3 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } entityVariant = atoi((char *)pbVar7); } } if (attr[4] == 0) break; } entityConfig = GetEntity(in_ECX,entityType,entityVariant,0); if ((entityConfig == (EntityConfig_Entity *)0x0) || (entityConfig->variant != entityVariant)) { KAGE_LogMessage(1,(byte *)"Cannot patch boss colors for Entity %d.%d\n"); } else { FUN_0069f4e0(extraout_ECX); (entityConfig->_bossColors)._end = (entityConfig->_bossColors)._begin; pcVar12 = "color"; do { colorTagLast = pcVar12; pcVar12 = colorTagLast + 1; } while (*pcVar12 != '\0'); for (colorNode = *(undefined4 **)((int)xmlNode + 0x18); colorNode != (undefined4 *)0x0; colorNode = (undefined4 *)colorNode[0xb]) { pbVar7 = (byte *)*colorNode; if (pbVar7 == (byte *)0x0) { pcVar12 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar12 = (char *)colorNode[2]; } if (pcVar12 == colorTagLast + -0xb66e47) { pbVar13 = pbVar7 + (int)pcVar12; if (pbVar13 <= pbVar7) goto LAB_00699233; iVar9 = (int)"color" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar13 <= pbVar7) goto LAB_00699233; } } } colorNode = (undefined4 *)0x0; LAB_00699233: if (colorNode != (undefined4 *)0x0) { do { bossColor = 0x3f800000; uStack_d4 = 0x3f800000; uStack_d0 = 0x3f800000; uStack_cc = 0x3f800000; local_c8 = 0; uStack_c4 = 0; uStack_c0 = 0; uStack_bc = 0; local_b8 = 0; uStack_b4 = 0; local_b0 = 0; local_9c = 0; suffixCapacity = 0xf; local_ac[0] = (void *)0x0; uStack_84 = 0; anm2PathCapacity = 0xf; anm2Path = (void *)0x0; uStack_6c = 0; portraitPathCapacity = 0xf; portraitPath = (void *)0x0; local_64 = 1.0; hpScale = 1.0; local_14._0_1_ = 3; attr = (undefined4 *)colorNode[8]; if (attr != (undefined4 *)0x0) { do { pbVar7 = (byte *)*attr; pbVar8 = &DAT_00b66e50; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < *pbVar8; if (bVar14 != *pbVar8) { LAB_00699322: uVar3 = -(uint)bVar10 | 1; goto LAB_00699327; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < pbVar8[1]; if (bVar14 != pbVar8[1]) goto LAB_00699322; pbVar13 = pbVar13 + 2; pbVar8 = pbVar8 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_00699327: if (uVar3 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } iVar9 = atoi((char *)pbVar7); if (iVar9 - 1U < 0x17) { iVar9 = iVar9 * 0x2c; if (&bossColor != (undefined4 *)(&DAT_00c3508c + iVar9)) { bossColor = *(undefined4 *)(&DAT_00c3508c + iVar9); uStack_d4 = *(undefined4 *)(iVar9 + 0xc35090); uStack_d0 = *(undefined4 *)(iVar9 + 0xc35094); uStack_cc = *(undefined4 *)(&DAT_00c35098 + iVar9); local_c8 = *(undefined4 *)(&DAT_00c3509c + iVar9); uStack_c4 = *(undefined4 *)(&DAT_00c350a0 + iVar9); uStack_c0 = *(undefined4 *)(iVar9 + 0xc350a4); uStack_bc = *(undefined4 *)(iVar9 + 0xc350a8); local_b8 = *(undefined4 *)(&DAT_00c350ac + iVar9); uStack_b4 = *(undefined4 *)(iVar9 + 0xc350b0); local_b0 = *(undefined4 *)(&DAT_00c350b4 + iVar9); } } } else { pcVar12 = "suffix"; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < (byte)*pcVar12; if (bVar14 != *pcVar12) { LAB_006993c4: uVar3 = -(uint)bVar10 | 1; goto LAB_006993c9; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < (byte)pcVar12[1]; if (bVar14 != pcVar12[1]) goto LAB_006993c4; pbVar13 = pbVar13 + 2; pcVar12 = pcVar12 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_006993c9: if (uVar3 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } pbVar13 = pbVar7; do { bVar14 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar14 != 0); std::string::assign((char *)local_ac,pbVar7,(int)pbVar13 - (int)(pbVar7 + 1)); } else { pbVar8 = &DAT_00b66cc8; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < *pbVar8; if (bVar14 != *pbVar8) { LAB_00699430: uVar3 = -(uint)bVar10 | 1; goto LAB_00699435; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < pbVar8[1]; if (bVar14 != pbVar8[1]) goto LAB_00699430; pbVar8 = pbVar8 + 2; pbVar13 = pbVar13 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_00699435: if ((uVar3 == 0) && (0 < iVar4)) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } pbVar13 = pbVar7; do { bVar14 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar14 != 0); valueLength = (std_string *)(pbVar13 + -(int)(pbVar7 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < valueLength) { LAB_00699898: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar6 = (byte ****)anm2Root; if (0xf < anm2RootCapacity) { ppppbVar6 = anm2Root[0]; } std::string::concat((char *)&joinedPath,(int)in_ECX,valueLength, (byte *)ppppbVar6,anm2RootSize,pbVar7,(uint)valueLength); if (0xf < anm2PathCapacity) { uVar3 = anm2PathCapacity + 1; pvVar5 = anm2Path; if (0xfff < uVar3) { pvVar5 = *(void **)((int)anm2Path + -4); uVar3 = anm2PathCapacity + 0x24; if (0x1f < (uint)((int)anm2Path + (-4 - (int)pvVar5))) goto LAB_00699821; } operator_delete(pvVar5,uVar3); } anm2Path = joinedPath; uStack_90 = uStack_ec; uStack_8c = uStack_e8; uStack_88 = uStack_e4; uStack_84 = local_e0; anm2PathCapacity = uStack_dc; } else { pcVar12 = "portrait"; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < (byte)*pcVar12; if (bVar14 != *pcVar12) { LAB_00699530: uVar3 = -(uint)bVar10 | 1; goto LAB_00699535; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < (byte)pcVar12[1]; if (bVar14 != pcVar12[1]) goto LAB_00699530; pcVar12 = pcVar12 + 2; pbVar13 = pbVar13 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_00699535: if ((uVar3 == 0) && (0 < iVar4)) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } pbVar13 = pbVar7; do { bVar14 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar14 != 0); valueLength = (std_string *)(pbVar13 + -(int)(pbVar7 + 1)); if ((std_string *)(0x7fffffff - portraitRootSize) < valueLength) goto LAB_00699898; ppppbVar6 = (byte ****)portraitRoot; if (0xf < portraitRootCapacity) { ppppbVar6 = portraitRoot[0]; } std::string::concat((char *)&joinedPath,(int)in_ECX,valueLength, (byte *)ppppbVar6,portraitRootSize,pbVar7, (uint)valueLength); if (0xf < portraitPathCapacity) { uVar3 = portraitPathCapacity + 1; pvVar5 = portraitPath; if (0xfff < uVar3) { pvVar5 = *(void **)((int)portraitPath + -4); uVar3 = portraitPathCapacity + 0x24; if (0x1f < (uint)((int)portraitPath + (-4 - (int)pvVar5))) goto LAB_00699821; } operator_delete(pvVar5,uVar3); } portraitPath = joinedPath; uStack_78 = uStack_ec; uStack_74 = uStack_e8; uStack_70 = uStack_e4; uStack_6c = local_e0; portraitPathCapacity = uStack_dc; } else { pcVar12 = "scale"; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < (byte)*pcVar12; if (bVar14 != *pcVar12) { LAB_00699625: uVar3 = -(uint)bVar10 | 1; goto LAB_0069962a; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < (byte)pcVar12[1]; if (bVar14 != pcVar12[1]) goto LAB_00699625; pbVar13 = pbVar13 + 2; pcVar12 = pcVar12 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_0069962a: if (uVar3 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } dVar11 = atof((char *)pbVar7); local_64 = (float)dVar11; } else { pbVar8 = &DAT_00b66f08; pbVar13 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar13 = pbVar7; } do { bVar14 = *pbVar13; bVar10 = bVar14 < *pbVar8; if (bVar14 != *pbVar8) { LAB_00699676: uVar3 = -(uint)bVar10 | 1; goto LAB_0069967b; } if (bVar14 == 0) break; bVar14 = pbVar13[1]; bVar10 = bVar14 < pbVar8[1]; if (bVar14 != pbVar8[1]) goto LAB_00699676; pbVar13 = pbVar13 + 2; pbVar8 = pbVar8 + 2; } while (bVar14 != 0); uVar3 = 0; LAB_0069967b: if (uVar3 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar7 = (byte *)attr[1]; } dVar11 = atof((char *)pbVar7); hpScale = (float)dVar11; } } } } } } } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); } bossColorsEnd = (entityConfig->_bossColors)._end; if (bossColorsEnd == (entityConfig->_bossColors)._capacity) { std::vector<124byte>::_Emplace_reallocate(bossColorsEnd,&bossColor); } else { Color::copy_constructor_ext(bossColorsEnd,&bossColor); ppvVar1 = &(entityConfig->_bossColors)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x7c); } local_14._0_1_ = 2; if (0xf < portraitPathCapacity) { uVar3 = portraitPathCapacity + 1; pvVar5 = portraitPath; if (0xfff < uVar3) { pvVar5 = *(void **)((int)portraitPath + -4); uVar3 = portraitPathCapacity + 0x24; if (0x1f < (uint)((int)portraitPath + (-4 - (int)pvVar5))) goto LAB_00699821; } operator_delete(pvVar5,uVar3); } if (0xf < anm2PathCapacity) { uVar3 = anm2PathCapacity + 1; pvVar5 = anm2Path; if (0xfff < uVar3) { pvVar5 = *(void **)((int)anm2Path + -4); uVar3 = anm2PathCapacity + 0x24; if (0x1f < (uint)((int)anm2Path + (-4 - (int)pvVar5))) goto LAB_00699821; } operator_delete(pvVar5,uVar3); } if (0xf < suffixCapacity) { uVar3 = suffixCapacity + 1; pvVar5 = local_ac[0]; if (0xfff < uVar3) { pvVar5 = *(void **)((int)local_ac[0] + -4); uVar3 = suffixCapacity + 0x24; if (0x1f < (uint)((int)local_ac[0] + (-4 - (int)pvVar5))) goto LAB_00699821; } operator_delete(pvVar5,uVar3); } colorNode = (undefined4 *)colorNode[0xb]; } while (colorNode != (undefined4 *)0x0); } } } local_14._0_1_ = 1; if (0xf < portraitRootCapacity) { uVar3 = portraitRootCapacity + 1; ppppbVar6 = portraitRoot[0]; if (0xfff < uVar3) { ppppbVar6 = (byte ****)portraitRoot[0][-1]; uVar3 = portraitRootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)portraitRoot[0] + (-4 - (int)ppppbVar6))) goto LAB_00699821; } operator_delete(ppppbVar6,uVar3); } local_14._0_1_ = 0; if (0xf < anm2RootCapacity) { uVar3 = anm2RootCapacity + 1; ppppbVar6 = anm2Root[0]; if (0xfff < uVar3) { ppppbVar6 = (byte ****)anm2Root[0][-1]; uVar3 = anm2RootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Root[0] + (-4 - (int)ppppbVar6))) { LAB_00699821: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar6,uVar3); } local_14 = (byte ***)0x4; xml_memory_pool::clear(auStack_10108); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar3 = *(uint *)(text + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar3); free(text + -4); } isLoaded = 1; } ExceptionList = local_1c; return isLoaded; } //@@ 006998a0 FUN_006998a0 void FUN_006998a0(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x5c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); return; } //@@ 006998d0 EntityConfig::load_players_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: players.xml: "Could not find root node players", attributes name/skinColor/costume/pocketActive/birthright/bSkinParent; callers Game::ReloadStagesXmlOnLuaReset and the resource loaders */ undefined4 EntityConfig::load_players_xml(byte *param_1,void *param_2) { void **ppvVar1; byte bVar2; uint uVar3; void *pvVar4; int *piVar5; undefined4 uVar6; int iVar7; byte *pbVar8; byte *****pppppbVar9; int *piVar10; std_string *psVar11; LayerState *backgroundLayer; std_vector *psVar12; EntityConfig *in_ECX; byte *pbVar13; byte *pbVar14; void *extraout_ECX; void *extraout_ECX_00; void *extraout_ECX_01; void *extraout_ECX_02; void *extraout_ECX_03; void *extraout_ECX_04; void *extraout_ECX_05; void *extraout_ECX_06; void *extraout_ECX_07; void *extraout_ECX_08; void *extraout_ECX_09; void *extraout_ECX_10; void *extraout_ECX_11; void *extraout_ECX_12; void *extraout_ECX_13; void *extraout_ECX_14; void *extraout_ECX_15; void *extraout_ECX_16; void *extraout_ECX_17; void *extraout_ECX_18; byte *pbVar15; int extraout_ECX_19; int extraout_EDX; void *pvVar16; int *piVar17; ANM2 *menuAnm2; EntityConfig *pEVar18; char *pcVar19; uint uVar20; undefined4 *hairAttr; bool bVar21; undefined4 in_stack_fffefd9c; char *pcVar22; undefined4 in_stack_fffefda0; int itemId; uint uStack_10248; int *itemTokens; int *itemTokensEnd; int itemTokensCapacity; void *pvStack_10238; int *piStack_10234; byte *pbStack_10230; EntityConfig *config; void *modEntry; byte *pbStack_10224; uint cleanupFlags; char isAnimFound; undefined1 auStack_10218 [32]; char acStack_101f8 [4]; char acStack_101f4 [4]; char acStack_101f0 [4]; uint uStack_101ec; uint uStack_101e8; std_string *psStack_101e4; char acStack_101e0 [4]; char acStack_101dc [4]; char acStack_101d8 [4]; uint uStack_101d4; uint uStack_101d0; std_string *psStack_101cc; char acStack_101c8 [4]; char acStack_101c4 [4]; char acStack_101c0 [4]; uint uStack_101bc; uint uStack_101b8; char acStack_101b4 [24]; std_string *psStack_1019c; char acStack_10198 [4]; char acStack_10194 [4]; char acStack_10190 [4]; uint uStack_1018c; uint uStack_10188; char acStack_10184 [24]; int iStack_1016c; int iStack_10168; int iStack_10164; int iStack_10160; int iStack_1015c; int iStack_10158; int iStack_10154; int iStack_10150; int iStack_1014c; byte bStack_10148; undefined1 auStack_10144 [4]; int *piStack_10140; int *piStack_1013c; int iStack_10138; int iStack_10134; int iStack_10130; int iStack_1012c; int iStack_10128; char acStack_10124 [24]; char acStack_1010c [16]; uint uStack_100fc; int iStack_100f4; byte bStack_100f0; void *pvStack_100ec; byte bStack_100e8; ANM2 *pAStack_100e4; ANM2 *pAStack_100e0; ANM2 *pAStack_100dc; ANM2 *pAStack_100d8; ANM2 *pAStack_100d4; undefined1 xmlDoc [48]; undefined1 xmlPool [65564]; byte *****nameImageRoot [4]; uint nameImageRootSize; uint nameImageRootCapacity; byte *****skinRoot [4]; uint skinRootSize; uint skinRootCapacity; byte *****portraitRoot [4]; uint portraitRootSize; uint portraitRootCapacity; std_string tmpString; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(portraitRoot + 0x14); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00af9c92; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(portraitRoot + 0x11); ExceptionList = &local_1c; pbStack_10224 = param_1; modEntry = param_2; cleanupFlags = 0; uStack_10248 = 0; config = in_ECX; local_24 = uVar3; if (param_2 == (void *)0x0) { pbStack_10230 = (in_ECX->_players)._end; psVar12 = &in_ECX->_players; pvVar16 = psVar12->_begin; puStack_20 = (undefined1 *)(portraitRoot + 0x14); pppppbVar9 = (byte *****)(portraitRoot + 0x14); if (pvVar16 != pbStack_10230) { do { in_stack_fffefda0 = 0x69995e; FUN_0069b7b0(uVar3); pvVar16 = (void *)((int)pvVar16 + 0x148); } while (pvVar16 != pbStack_10230); pvVar16 = psVar12->_begin; pppppbVar9 = (byte *****)puStack_20; } puStack_20 = (undefined1 *)pppppbVar9; (in_ECX->_players)._end = pvVar16; pvStack_10238 = (void *)(((int)pvVar16 - (int)psVar12->_begin) / 0x148); if (pvStack_10238 < 0x2a) { if (pvStack_10238 < 0x29) { if ((uint)(((int)(in_ECX->_players)._capacity - (int)psVar12->_begin) / 0x148) < 0x29) { FUN_006a03a0(in_stack_fffefd9c,in_stack_fffefda0); } else { pvVar16 = (void *)FUN_0069fbd0(pvVar16,0x29 - (int)pvStack_10238,piStack_10234); (in_ECX->_players)._end = pvVar16; } } } else { pvVar4 = (void *)((int)psVar12->_begin + 0x3488); pbStack_10230 = pvVar4; if (pvVar4 != pvVar16) { do { FUN_0069b7b0(uVar3); pvVar4 = (void *)((int)pvVar4 + 0x148); } while (pvVar4 != pvVar16); } (config->_players)._end = pbStack_10230; } } piVar5 = FileSystem::Open(&PTR_vftable_00c37a10,pbStack_10224,(int *)0x0); if (piVar5 == (int *)0x0) { uVar6 = 0; } else { iVar7 = (**(code **)(*piVar5 + 4))(); pbStack_10230 = operator_new_tracked(iVar7 + 1); (**(code **)(*piVar5 + 0x14))(pbStack_10230,1,iVar7); pbStack_10230[iVar7] = 0; (**(code **)*piVar5)(1); FUN_00413b90(); local_14 = (byte ****)0x0; pcVar22 = (char *)0x699a87; pbVar15 = pbStack_10230; rapidxml::xml_document::parse(xmlDoc,pbStack_10230); bVar2 = (byte)pbVar15; pvVar16 = xml_node::first_node(xmlDoc,(byte *)"players",(int)pcVar22,bVar2); if (pvVar16 == (void *)0x0) { pcVar22 = "Could not find root node \'players\' in %s\n"; pbVar15 = pbStack_10224; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'players\' in %s\n"); bVar2 = (byte)pbVar15; } pvVar4 = xml_node::first_attribute(pvVar16,&DAT_00b66f40,(uint)pcVar22,bVar2); skinRootSize = 0; skinRootCapacity = 0xf; skinRoot[0] = (byte *****)0x0; pbVar15 = &g_xmlNullStr; if (*(byte **)((int)pvVar4 + 4) != (byte *)0x0) { pbVar15 = *(byte **)((int)pvVar4 + 4); } pbVar13 = pbVar15; do { bVar2 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar13 - (int)(pbVar15 + 1); std::string::assign((char *)skinRoot,pbVar15,uVar3); local_14._0_1_ = 1; pvVar4 = xml_node::first_attribute(pvVar16,(byte *)"portraitroot",(uint)pbVar15,(byte)uVar3); portraitRootSize = 0; portraitRootCapacity = 0xf; portraitRoot[0] = (byte *****)0x0; pbVar15 = &g_xmlNullStr; if (*(byte **)((int)pvVar4 + 4) != (byte *)0x0) { pbVar15 = *(byte **)((int)pvVar4 + 4); } pbVar13 = pbVar15; do { bVar2 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar13 - (int)(pbVar15 + 1); std::string::assign((char *)portraitRoot,pbVar15,uVar3); local_14._0_1_ = 2; pvVar4 = xml_node::first_attribute(pvVar16,(byte *)"nameimageroot",(uint)pbVar15,(byte)uVar3); nameImageRootSize = 0; nameImageRootCapacity = 0xf; nameImageRoot[0] = (byte *****)0x0; pbVar15 = &g_xmlNullStr; if (*(byte **)((int)pvVar4 + 4) != (byte *)0x0) { pbVar15 = *(byte **)((int)pvVar4 + 4); } pbVar13 = pbVar15; do { bVar2 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar2 != 0); uVar3 = (int)pbVar13 - (int)(pbVar15 + 1); std::string::assign((char *)nameImageRoot,pbVar15,uVar3); pvStack_10238 = xml_node::first_node(pvVar16,(byte *)"player",(int)pbVar15,(byte)uVar3); joined_r0x00699bbe: if (pvStack_10238 != (void *)0x0) { EntityConfig_Player::EntityConfig_Player((EntityConfig_Player *)auStack_10218); local_14._0_1_ = 4; pbVar15 = *(byte **)(extraout_EDX + 0x20); joined_r0x00699bde: pbStack_10224 = pbVar15; if (pbVar15 == (byte *)0x0) goto LAB_0069ab6f; pbVar13 = *(byte **)pbVar15; pbVar14 = s_id; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_00699c15: uVar3 = -(uint)bVar21 | 1; goto LAB_00699c1a; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_00699c15; pbVar8 = pbVar8 + 2; pbVar14 = pbVar14 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699c1a: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } auStack_10218._0_4_ = atoi((char *)pbVar13); } else { pbVar14 = s_name; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_00699c70: uVar3 = -(uint)bVar21 | 1; goto LAB_00699c75; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_00699c70; pbVar8 = pbVar8 + 2; pbVar14 = pbVar14 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699c75: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(auStack_10218 + 4,pbVar13,(int)pbVar8 - (int)(pbVar13 + 1)); } else { pbVar14 = &DAT_00b66ef4; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_00699ce0: uVar3 = -(uint)bVar21 | 1; goto LAB_00699ce5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_00699ce0; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699ce5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); psVar11 = (std_string *)(pbVar8 + -(int)(pbVar13 + 1)); if ((std_string *)(0x7fffffff - skinRootSize) < psVar11) goto LAB_0069b79c; pppppbVar9 = (byte *****)skinRoot; if (0xf < skinRootCapacity) { pppppbVar9 = skinRoot[0]; } std::string::concat(tmpString._buf,(int)piStack_10234,psVar11,(byte *)pppppbVar9, skinRootSize,pbVar13,(uint)psVar11); cleanupFlags = cleanupFlags | 0x400; std::string::_Tidy_deallocate(auStack_10218 + 0x1c); auStack_10218[0x1c] = tmpString._buf[0]; auStack_10218[0x1d] = tmpString._buf[1]; auStack_10218[0x1e] = tmpString._buf[2]; auStack_10218[0x1f] = tmpString._buf[3]; acStack_101f8[0] = tmpString._buf[4]; acStack_101f8[1] = tmpString._buf[5]; acStack_101f8[2] = tmpString._buf[6]; acStack_101f8[3] = tmpString._buf[7]; acStack_101f4[0] = tmpString._buf[8]; acStack_101f4[1] = tmpString._buf[9]; acStack_101f4[2] = tmpString._buf[10]; acStack_101f4[3] = tmpString._buf[0xb]; acStack_101f0[0] = tmpString._buf[0xc]; acStack_101f0[1] = tmpString._buf[0xd]; acStack_101f0[2] = tmpString._buf[0xe]; acStack_101f0[3] = tmpString._buf[0xf]; uStack_101ec = tmpString._size; uStack_101e8 = tmpString._capacity; } else { pcVar22 = "nameimage"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_00699da0: uVar3 = -(uint)bVar21 | 1; goto LAB_00699da5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_00699da0; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699da5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); psVar11 = (std_string *)(pbVar8 + -(int)(pbVar13 + 1)); if ((std_string *)(0x7fffffff - nameImageRootSize) < psVar11) goto LAB_0069b79c; pppppbVar9 = (byte *****)nameImageRoot; if (0xf < nameImageRootCapacity) { pppppbVar9 = nameImageRoot[0]; } std::string::concat(tmpString._buf,(int)piStack_10234,psVar11,(byte *)pppppbVar9, nameImageRootSize,pbVar13,(uint)psVar11); cleanupFlags = cleanupFlags | 0x800; std::string::_Tidy_deallocate((char *)&psStack_101e4); psStack_101e4 = (std_string *)tmpString._buf._0_4_; acStack_101e0[0] = tmpString._buf[4]; acStack_101e0[1] = tmpString._buf[5]; acStack_101e0[2] = tmpString._buf[6]; acStack_101e0[3] = tmpString._buf[7]; acStack_101dc[0] = tmpString._buf[8]; acStack_101dc[1] = tmpString._buf[9]; acStack_101dc[2] = tmpString._buf[10]; acStack_101dc[3] = tmpString._buf[0xb]; acStack_101d8[0] = tmpString._buf[0xc]; acStack_101d8[1] = tmpString._buf[0xd]; acStack_101d8[2] = tmpString._buf[0xe]; acStack_101d8[3] = tmpString._buf[0xf]; uStack_101d4 = tmpString._size; uStack_101d0 = tmpString._capacity; } else { pcVar22 = "portrait"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_00699e60: uVar3 = -(uint)bVar21 | 1; goto LAB_00699e65; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_00699e60; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699e65: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); psVar11 = (std_string *)(pbVar8 + -(int)(pbVar13 + 1)); if ((std_string *)(0x7fffffff - portraitRootSize) < psVar11) goto LAB_0069b79c; pppppbVar9 = (byte *****)portraitRoot; if (0xf < portraitRootCapacity) { pppppbVar9 = portraitRoot[0]; } std::string::concat(tmpString._buf,(int)piStack_10234,psVar11,(byte *)pppppbVar9, portraitRootSize,pbVar13,(uint)psVar11); cleanupFlags = cleanupFlags | 0x1000; std::string::_Tidy_deallocate((char *)&psStack_101cc); psStack_101cc = (std_string *)tmpString._buf._0_4_; acStack_101c8[0] = tmpString._buf[4]; acStack_101c8[1] = tmpString._buf[5]; acStack_101c8[2] = tmpString._buf[6]; acStack_101c8[3] = tmpString._buf[7]; acStack_101c4[0] = tmpString._buf[8]; acStack_101c4[1] = tmpString._buf[9]; acStack_101c4[2] = tmpString._buf[10]; acStack_101c4[3] = tmpString._buf[0xb]; acStack_101c0[0] = tmpString._buf[0xc]; acStack_101c0[1] = tmpString._buf[0xd]; acStack_101c0[2] = tmpString._buf[0xe]; acStack_101c0[3] = tmpString._buf[0xf]; uStack_101bc = tmpString._size; uStack_101b8 = tmpString._capacity; } else { pcVar22 = "extraportrait"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_00699f20: uVar3 = -(uint)bVar21 | 1; goto LAB_00699f25; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_00699f20; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699f25: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); psVar11 = (std_string *)(pbVar8 + -(int)(pbVar13 + 1)); if ((std_string *)(0x7fffffff - portraitRootSize) < psVar11) goto LAB_0069b79c; pppppbVar9 = (byte *****)portraitRoot; if (0xf < portraitRootCapacity) { pppppbVar9 = portraitRoot[0]; } std::string::concat(tmpString._buf,(int)piStack_10234,psVar11,(byte *)pppppbVar9, portraitRootSize,pbVar13,(uint)psVar11); cleanupFlags = cleanupFlags | 0x2000; std::string::_Tidy_deallocate((char *)&psStack_1019c); psStack_1019c = (std_string *)tmpString._buf._0_4_; acStack_10198[0] = tmpString._buf[4]; acStack_10198[1] = tmpString._buf[5]; acStack_10198[2] = tmpString._buf[6]; acStack_10198[3] = tmpString._buf[7]; acStack_10194[0] = tmpString._buf[8]; acStack_10194[1] = tmpString._buf[9]; acStack_10194[2] = tmpString._buf[10]; acStack_10194[3] = tmpString._buf[0xb]; acStack_10190[0] = tmpString._buf[0xc]; acStack_10190[1] = tmpString._buf[0xd]; acStack_10190[2] = tmpString._buf[0xe]; acStack_10190[3] = tmpString._buf[0xf]; uStack_1018c = tmpString._size; uStack_10188 = tmpString._capacity; } else { pcVar22 = "costume"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_00699fe0: uVar3 = -(uint)bVar21 | 1; goto LAB_00699fe5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_00699fe0; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00699fe5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_1016c = atoi((char *)pbVar13); } else { pbVar14 = &DAT_00b66f08; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_0069a040: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a045; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_0069a040; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a045: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10168 = atoi((char *)pbVar13); } else { pcVar22 = "armor"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a0a0: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a0a5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a0a0; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a0a5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10164 = atoi((char *)pbVar13); } else { pcVar22 = "black"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a100: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a105; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a100; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a105: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10160 = atoi((char *)pbVar13); } else { pcVar22 = "coins"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a160: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a165; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a160; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a165: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_1015c = atoi((char *)pbVar13); } else { pbVar14 = &DAT_00b66f50; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_0069a1c0: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a1c5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_0069a1c0; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a1c5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10158 = atoi((char *)pbVar13); } else { pbVar14 = &DAT_00b66f58; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_0069a220: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a225; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_0069a220; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a225: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10154 = atoi((char *)pbVar13); } else { pbVar14 = (byte *)&DAT_00b66f60; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_0069a280: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a285; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_0069a280; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a285: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10150 = atoi((char *)pbVar13); } else { pbVar14 = &DAT_00b66fc0; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_0069a2e0: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a2e5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_0069a2e0; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a2e5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_1014c = atoi((char *)pbVar13); } else { pbVar14 = &DAT_00b66fc8; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < *pbVar14; if (bVar2 != *pbVar14) { LAB_0069a340: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a345; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < pbVar14[1]; if (bVar2 != pbVar14[1]) goto LAB_0069a340; pbVar14 = pbVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a345: if (uVar3 == 0) { tmpString._size = 0; pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } tmpString._capacity = 0xf; tmpString._buf._0_4_ = (std_string *)0x0; pbVar15 = pbVar13; do { bVar2 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar2 != 0); std::string::assign(tmpString._buf,pbVar13, (int)pbVar15 - (int)(pbVar13 + 1)); local_14._0_1_ = 6; uStack_10248 = cleanupFlags | 0x4000; itemTokens = (int *)0x0; itemTokensEnd = (int *)0x0; itemTokensCapacity = 0; cleanupFlags = uStack_10248; string_split(&itemTokens); local_14._0_1_ = 7; if (0xf < tmpString._capacity) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *) ((std_string *)(tmpString._buf._0_4_ + -0x18))-> _capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); } uVar20 = 0; piStack_10234 = itemTokens; uVar3 = ((int)itemTokensEnd - (int)itemTokens) / 0x18; piVar5 = itemTokens; if (uVar3 != 0) { do { piVar10 = piVar5; if (0xf < (uint)piVar5[5]) { piVar10 = (int *)*piVar5; } itemId = atoi((char *)piVar10); if (piStack_10140 == piStack_1013c) { std::vector::_Emplace_reallocate (piStack_10140,&itemId); } else { *piStack_10140 = itemId; piStack_10140 = piStack_10140 + 1; } uVar20 = uVar20 + 1; piVar5 = piVar5 + 6; } while (uVar20 < uVar3); } piVar5 = piStack_10234; cleanupFlags = cleanupFlags & 0xffffbfff; local_14._0_1_ = 4; if (piStack_10234 != (int *)0x0) { piVar10 = itemTokensEnd; piVar17 = piStack_10234; if (piStack_10234 != itemTokensEnd) { do { uVar3 = piVar17[5]; if (0xf < uVar3) { pvVar16 = (void *)*piVar17; uVar20 = uVar3 + 1; pvVar4 = pvVar16; if (0xfff < uVar20) { pvVar4 = *(void **)((int)pvVar16 + -4); uVar20 = uVar3 + 0x24; if (0x1f < (uint)((int)pvVar16 + (-4 - (int)pvVar4)) ) goto LAB_0069b73d; } operator_delete(pvVar4,uVar20); piVar10 = itemTokensEnd; } piVar17[4] = 0; piVar17[5] = 0xf; *(char *)piVar17 = '\0'; piVar17 = piVar17 + 6; } while (piVar17 != piVar10); } uVar3 = ((itemTokensCapacity - (int)piVar5) / 0x18) * 0x18; piVar10 = piVar5; if (0xfff < uVar3) { piVar10 = (int *)piVar5[-1]; uVar3 = uVar3 + 0x23; if ((char *)0x1f < (char *)((int)piVar5 + (-4 - (int)piVar10))) goto LAB_0069b73d; } operator_delete(piVar10,uVar3); itemTokens = (int *)0x0; itemTokensEnd = (int *)0x0; itemTokensCapacity = 0; } } else { pcVar22 = "trinket"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a5a7: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a5ac; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a5a7; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a5ac: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10138 = atoi((char *)pbVar13); goto LAB_0069ab58; } pcVar22 = "skinColor"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a601: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a606; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a601; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a606: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10134 = atoi((char *)pbVar13); goto LAB_0069ab58; } pcVar22 = "canShoot"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a660: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a665; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a660; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a665: if (uVar3 != 0) { pcVar22 = "costumeSuffix"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a7a3: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a7a8; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a7a3; pbVar8 = pbVar8 + 2; pcVar22 = pcVar22 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a7a8: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(acStack_10184,pbVar13, (int)pbVar8 - (int)(pbVar13 + 1)); } else { pcVar22 = "achievement"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a810: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a815; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a810; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a815: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10130 = atoi((char *)pbVar13); } else { pcVar22 = "broken"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a870: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a875; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a870; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a875: if (uVar3 != 0) { pcVar22 = "pocketActive"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a8d0: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a8d5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a8d0; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a8d5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_10128 = atoi((char *)pbVar13); goto LAB_0069ab58; } pcVar22 = "birthright"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a930: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a935; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a930; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a935: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(acStack_10124,pbVar13, (int)pbVar8 - (int)(pbVar13 + 1) ); goto LAB_0069ab58; } pcVar22 = "bSkinParent"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069a9a0: uVar3 = -(uint)bVar21 | 1; goto LAB_0069a9a5; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069a9a0; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069a9a5: if (uVar3 == 0) { pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } pbVar8 = pbVar13; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(acStack_1010c,pbVar13, (int)pbVar8 - (int)(pbVar13 + 1) ); goto LAB_0069ab58; } pcVar22 = "hidden"; pbVar8 = &g_xmlNullStr; if (pbVar13 != (byte *)0x0) { pbVar8 = pbVar13; } do { bVar2 = *pbVar8; bVar21 = bVar2 < (byte)*pcVar22; if (bVar2 != *pcVar22) { LAB_0069aa10: uVar3 = -(uint)bVar21 | 1; goto LAB_0069aa15; } if (bVar2 == 0) break; bVar2 = pbVar8[1]; bVar21 = bVar2 < (byte)pcVar22[1]; if (bVar2 != pcVar22[1]) goto LAB_0069aa10; pcVar22 = pcVar22 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0069aa15: if (uVar3 != 0) goto LAB_0069ab58; tmpString._buf._0_4_ = (std_string *)0x0; tmpString._size = 0; pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } tmpString._capacity = 0xf; pbVar15 = pbVar13; do { bVar2 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar2 != 0); std::string::assign(tmpString._buf,pbVar13, (int)pbVar15 - (int)(pbVar13 + 1)) ; if (tmpString._size == 0) { LAB_0069ab15: bStack_100f0 = 0; } else { psVar11 = &tmpString; if (0xf < tmpString._capacity) { psVar11 = (std_string *)tmpString._buf._0_4_; } if (tmpString._size == 4) { if ((*(std_string **)psVar11->_buf == (std_string *)0x65757274) || (((bVar2 = (byte)*(std_string **)psVar11->_buf, bVar21 = bVar2 < 0x74, bVar2 == 0x74 && (bVar21 = (byte)psVar11->_buf[1] < 0x72, psVar11->_buf[1] == 0x72)) && ((bVar21 = (byte)psVar11->_buf[2] < 0x75, psVar11->_buf[2] == 0x75 && (bVar21 = (byte)psVar11->_buf[3] < 0x65, psVar11->_buf[3] == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar21 | 1; } if (uVar3 != 0) goto LAB_0069aaad; } else { LAB_0069aaad: psVar11 = &tmpString; if (0xf < tmpString._capacity) { psVar11 = (std_string *)tmpString._buf._0_4_; } if (tmpString._size == 4) { if ((*(std_string **)psVar11->_buf == (std_string *)0x65757254) || ((((bVar2 = (byte)*(std_string **) psVar11->_buf, bVar21 = bVar2 < 0x54, bVar2 == 0x54 && (bVar21 = (byte)psVar11->_buf[1] < 0x72, psVar11->_buf[1] == 0x72)) && (bVar21 = (byte)psVar11->_buf[2] < 0x75, psVar11->_buf[2] == 0x75)) && (bVar21 = (byte)psVar11->_buf[3] < 0x65, psVar11->_buf[3] == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar21 | 1; } if (uVar3 == 0) goto LAB_0069ab0c; } psVar11 = &tmpString; if (0xf < tmpString._capacity) { psVar11 = (std_string *)tmpString._buf._0_4_; } iVar7 = atoi(psVar11->_buf); if (iVar7 == 0) goto LAB_0069ab15; } LAB_0069ab0c: bStack_100f0 = 1; } goto LAB_0069ab22; } pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } iStack_1012c = atoi((char *)pbVar13); } } goto LAB_0069ab58; } tmpString._buf._0_4_ = (std_string *)0x0; tmpString._size = 0; pbVar13 = &g_xmlNullStr; if (*(byte **)(pbVar15 + 4) != (byte *)0x0) { pbVar13 = *(byte **)(pbVar15 + 4); } tmpString._capacity = 0xf; pbVar15 = pbVar13; do { bVar2 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar2 != 0); std::string::assign(tmpString._buf,pbVar13, (int)pbVar15 - (int)(pbVar13 + 1)); if (tmpString._size == 0) { LAB_0069a768: bStack_10148 = 0; } else { psVar11 = &tmpString; if (0xf < tmpString._capacity) { psVar11 = (std_string *)tmpString._buf._0_4_; } if (tmpString._size == 4) { if ((*(std_string **)psVar11->_buf == (std_string *)0x65757274) || ((((bVar2 = (byte)*(std_string **)psVar11->_buf, bVar21 = bVar2 < 0x74, bVar2 == 0x74 && (bVar21 = (byte)psVar11->_buf[1] < 0x72, psVar11->_buf[1] == 0x72)) && (bVar21 = (byte)psVar11->_buf[2] < 0x75, psVar11->_buf[2] == 0x75)) && (bVar21 = (byte)psVar11->_buf[3] < 0x65, psVar11->_buf[3] == 0x65)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar21 | 1; } if (uVar3 != 0) goto LAB_0069a6fd; } else { LAB_0069a6fd: psVar11 = &tmpString; if (0xf < tmpString._capacity) { psVar11 = (std_string *)tmpString._buf._0_4_; } if (tmpString._size == 4) { if ((*(std_string **)psVar11->_buf == (std_string *)0x65757254) || (((bVar2 = (byte)*(std_string **)psVar11->_buf, bVar21 = bVar2 < 0x54, bVar2 == 0x54 && (bVar21 = (byte)psVar11->_buf[1] < 0x72, psVar11->_buf[1] == 0x72)) && ((bVar21 = (byte)psVar11->_buf[2] < 0x75, psVar11->_buf[2] == 0x75 && (bVar21 = (byte)psVar11->_buf[3] < 0x65, psVar11->_buf[3] == 0x65)))))) { uVar3 = 0; } else { uVar3 = -(uint)bVar21 | 1; } if (uVar3 == 0) goto LAB_0069a75c; } psVar11 = &tmpString; if (0xf < tmpString._capacity) { psVar11 = (std_string *)tmpString._buf._0_4_; } iVar7 = atoi(psVar11->_buf); if (iVar7 == 0) goto LAB_0069a768; } LAB_0069a75c: bStack_10148 = 1; } LAB_0069ab22: if (0xf < tmpString._capacity) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *) ((std_string *)(tmpString._buf._0_4_ + -0x18))-> _capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); } } pbVar15 = pbStack_10224; } } } } } } } } } } } } } } } LAB_0069ab58: if (*(int *)(pbVar15 + 0x10) == 0) goto LAB_0069ab6f; pbVar15 = *(byte **)(pbVar15 + 0x18); goto joined_r0x00699bde; } local_14._0_1_ = 2; if (0xf < nameImageRootCapacity) { uVar3 = nameImageRootCapacity + 1; pppppbVar9 = nameImageRoot[0]; if (0xfff < uVar3) { pppppbVar9 = (byte *****)nameImageRoot[0][-1]; uVar3 = nameImageRootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)nameImageRoot[0] + (-4 - (int)pppppbVar9))) goto LAB_0069b73d; } operator_delete(pppppbVar9,uVar3); } local_14._0_1_ = 1; if (0xf < portraitRootCapacity) { uVar3 = portraitRootCapacity + 1; pppppbVar9 = portraitRoot[0]; if (0xfff < uVar3) { pppppbVar9 = (byte *****)portraitRoot[0][-1]; uVar3 = portraitRootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)portraitRoot[0] + (-4 - (int)pppppbVar9))) goto LAB_0069b73d; } operator_delete(pppppbVar9,uVar3); } local_14._0_1_ = 0; if (0xf < skinRootCapacity) { uVar3 = skinRootCapacity + 1; pppppbVar9 = skinRoot[0]; if (0xfff < uVar3) { pppppbVar9 = (byte *****)skinRoot[0][-1]; uVar3 = skinRootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)skinRoot[0] + (-4 - (int)pppppbVar9))) { LAB_0069b73d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar9,uVar3); } local_14 = (byte ****)0xa; xml_memory_pool::clear(xmlPool); local_14 = (byte ****)0xb; tracked_alloc(1,pbStack_10230,0); uVar6 = 1; } ExceptionList = local_1c; return uVar6; LAB_0069ab6f: pEVar18 = config; pvStack_100ec = modEntry; if (modEntry == (void *)0x0) { if (-1 < (int)auStack_10218._0_4_) { iStack_100f4 = auStack_10218._0_4_; EntityConfig_Player::operator_assign ((EntityConfig_Player *) (auStack_10218._0_4_ * 0x148 + (int)(config->_players)._begin),auStack_10218); goto LAB_0069b2cf; } } else { pvVar16 = (void *)((int)(config->_players)._end - (int)(config->_players)._begin); auStack_10218._0_4_ = (int)pvVar16 / 0x148; iStack_100f4 = auStack_10218._0_4_; if (uStack_100fc != 0) { menuAnm2 = (ANM2 *)((int)modEntry + 0x550); if (*(char *)((int)modEntry + 0x659) == '\0') { LAB_0069abfa: isAnimFound = '\0'; } else { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 1; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX; if (pvVar4 == (void *)0x0) goto LAB_0069abfa; } if (((cleanupFlags & 1) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffe, 0xf < tmpString._capacity)) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); pvVar16 = extraout_ECX_00; } if (isAnimFound != '\0') { pAStack_100e4 = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0x664); if (*(char *)((int)modEntry + 0x76d) == '\0') { LAB_0069aca5: isAnimFound = '\0'; } else { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 2; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_01; if (pvVar4 == (void *)0x0) goto LAB_0069aca5; } if (((cleanupFlags & 2) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffd, 0xf < tmpString._capacity)) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); pvVar16 = extraout_ECX_02; } if (isAnimFound != '\0') { pAStack_100e0 = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0x778); if (*(char *)((int)modEntry + 0x881) == '\0') { LAB_0069ad50: isAnimFound = '\0'; } else { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 4; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_03; if (pvVar4 == (void *)0x0) goto LAB_0069ad50; } if (((cleanupFlags & 4) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffb, 0xf < tmpString._capacity)) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); pvVar16 = extraout_ECX_04; } if (isAnimFound != '\0') { pAStack_100dc = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0x88c); if (*(char *)((int)modEntry + 0x995) == '\0') { LAB_0069adfb: isAnimFound = '\0'; } else { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 8; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_05; if (pvVar4 == (void *)0x0) goto LAB_0069adfb; } if (((cleanupFlags & 8) != 0) && (cleanupFlags = cleanupFlags & 0xfffffff7, 0xf < tmpString._capacity)) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); pvVar16 = extraout_ECX_06; } if (isAnimFound != '\0') { pAStack_100d8 = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0xbc8); if (*(char *)((int)modEntry + 0xcd1) == '\0') { LAB_0069aea6: isAnimFound = '\0'; } else { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 0x10; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_07; if (pvVar4 == (void *)0x0) goto LAB_0069aea6; } if (((cleanupFlags & 0x10) != 0) && (cleanupFlags = cleanupFlags & 0xffffffef, 0xf < tmpString._capacity)) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); pvVar16 = extraout_ECX_08; } if (isAnimFound != '\0') { pAStack_100d4 = menuAnm2; } } menuAnm2 = (ANM2 *)((int)modEntry + 0x100); if ((pAStack_100e4 == (ANM2 *)0x0) && (*(char *)((int)modEntry + 0x209) != '\0')) { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 0x20; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_09; if (pvVar4 == (void *)0x0) goto LAB_0069af5a; } else { LAB_0069af5a: isAnimFound = '\0'; } if (((cleanupFlags & 0x20) != 0) && (cleanupFlags = cleanupFlags & 0xffffffdf, 0xf < tmpString._capacity)) { uVar3 = tmpString._capacity + 1; psVar11 = (std_string *)tmpString._buf._0_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); pvVar16 = extraout_ECX_10; } if (isAnimFound != '\0') { pAStack_100e4 = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0x214); if ((pAStack_100e0 == (ANM2 *)0x0) && (*(char *)((int)modEntry + 0x31d) != '\0')) { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 0x40; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_11; if (pvVar4 == (void *)0x0) goto LAB_0069b00e; } else { LAB_0069b00e: isAnimFound = '\0'; } if ((cleanupFlags & 0x40) != 0) { cleanupFlags = cleanupFlags & 0xffffffbf; std::string::_Tidy_deallocate(tmpString._buf); pvVar16 = extraout_ECX_12; } if (isAnimFound != '\0') { pAStack_100e0 = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0x328); if ((pAStack_100dc == (ANM2 *)0x0) && (*(char *)((int)modEntry + 0x431) != '\0')) { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 0x80; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_13; if (pvVar4 == (void *)0x0) goto LAB_0069b099; } else { LAB_0069b099: isAnimFound = '\0'; } if ((char)cleanupFlags < '\0') { cleanupFlags = cleanupFlags & 0xffffff7f; std::string::_Tidy_deallocate(tmpString._buf); pvVar16 = extraout_ECX_14; } if (isAnimFound != '\0') { pAStack_100dc = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0x43c); if ((pAStack_100d8 == (ANM2 *)0x0) && (*(char *)((int)modEntry + 0x545) != '\0')) { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 0x100; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_15; if (pvVar4 == (void *)0x0) goto LAB_0069b126; } else { LAB_0069b126: isAnimFound = '\0'; } if ((cleanupFlags & 0x100) != 0) { cleanupFlags = cleanupFlags & 0xfffffeff; std::string::_Tidy_deallocate(tmpString._buf); pvVar16 = extraout_ECX_16; } if (isAnimFound != '\0') { pAStack_100d8 = menuAnm2; } menuAnm2 = (ANM2 *)((int)modEntry + 0xab4); if ((pAStack_100d4 == (ANM2 *)0x0) && (*(char *)((int)modEntry + 0xbbd) != '\0')) { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); cleanupFlags = cleanupFlags | 0x200; if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } pvVar4 = ANM2::GetAnimationData(menuAnm2,(byte *)psVar11); isAnimFound = '\x01'; pvVar16 = extraout_ECX_17; if (pvVar4 == (void *)0x0) goto LAB_0069b1b6; } else { LAB_0069b1b6: isAnimFound = '\0'; } if ((cleanupFlags & 0x200) != 0) { cleanupFlags = cleanupFlags & 0xfffffdff; std::string::_Tidy_deallocate(tmpString._buf); pvVar16 = extraout_ECX_18; } if (isAnimFound != '\0') { pAStack_100d4 = menuAnm2; } bStack_100e8 = 0; if (pAStack_100e4 != (ANM2 *)0x0) { psVar11 = EntityConfig_Player::GetDisplayName ((EntityConfig_Player *)auStack_10218,&tmpString,pvVar16); menuAnm2 = pAStack_100e4; local_14 = (byte ****)CONCAT31(local_14._1_3_,8); if (0xf < psVar11->_capacity) { psVar11 = *(std_string **)psVar11->_buf; } bVar2 = ANM2::SetAnimation(pAStack_100e4,(byte *)psVar11,1); if (((bVar2 != 0) && ((menuAnm2->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&menuAnm2->_animState,0.0), (menuAnm2->_animState)._animData != (void *)0x0)) { (menuAnm2->_animState)._isPlaying = 0; } local_14._0_1_ = 4; std::string::_Tidy_deallocate(tmpString._buf); menuAnm2 = pAStack_100e4; backgroundLayer = ANM2::GetLayer(pAStack_100e4,(byte *)"Background"); if (backgroundLayer != (LayerState *)0x0) { if (backgroundLayer->_layerData == (int *)0x0) { iVar7 = -1; } else { iVar7 = *(int *)backgroundLayer->_layerData; } pvVar16 = AnimationState::GetLayerFrame(&menuAnm2->_animState,iVar7); if (pvVar16 != (void *)0x0) { if (*(char *)((int)pvVar16 + 0x2c) != '\0') { bStack_100e8 = 1; } } } } pvVar16 = (pEVar18->_players)._end; if (pvVar16 == (pEVar18->_players)._capacity) { FUN_0069e8c0(pvVar16,auStack_10218); } else { EntityConfig_Player::copy_constructor(); ppvVar1 = &(pEVar18->_players)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x148); } } pEVar18 = config; LAB_0069b2cf: if (auStack_10218._0_4_ == 9) { pcVar22 = (pEVar18->_edenHair)._end; psVar12 = &pEVar18->_edenHair; pcVar19 = psVar12->_begin; if (pcVar19 != pcVar22) { do { std::string::_Tidy_deallocate(pcVar19); pcVar19 = pcVar19 + 0x18; } while (pcVar19 != pcVar22); pcVar19 = (config->_edenHair)._begin; psVar12 = &config->_edenHair; } psVar12->_end = pcVar19; iVar7 = (int)psVar12->_capacity - (int)psVar12->_begin; if ((uint)(iVar7 / 0x18) < 0x80) { FUN_0069da00(iVar7); } pcVar22 = "hair"; do { pcVar19 = pcVar22; pcVar22 = pcVar19 + 1; } while (*pcVar22 != '\0'); for (pbStack_10224 = *(byte **)((int)pvStack_10238 + 0x18); pbStack_10224 != (byte *)0x0; pbStack_10224 = *(byte **)(pbStack_10224 + 0x2c)) { pbVar15 = *(byte **)pbStack_10224; if (pbVar15 == (byte *)0x0) { pcVar22 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar22 = *(char **)(pbStack_10224 + 8); } if (pcVar22 == pcVar19 + -0xb66fe3) { pbVar13 = (byte *)(pcVar22 + (int)pbVar15); if (pbVar13 <= pbVar15) goto LAB_0069b3e3; iVar7 = (int)&DAT_00b66fe4 - (int)pbVar15; while (*pbVar15 == pbVar15[iVar7]) { pbVar15 = pbVar15 + 1; if (pbVar13 <= pbVar15) goto LAB_0069b3e3; } } } pbStack_10224 = (byte *)0x0; LAB_0069b3e3: if (pbStack_10224 != (byte *)0x0) { do { pcVar22 = "gfx"; do { pcVar19 = pcVar22; pcVar22 = pcVar19 + 1; } while (*pcVar22 != '\0'); piStack_10234 = (int *)(pcVar19 + -0xb66feb); for (hairAttr = *(undefined4 **)(pbStack_10224 + 0x20); hairAttr != (undefined4 *)0x0; hairAttr = (undefined4 *)hairAttr[6]) { pbVar15 = (byte *)*hairAttr; if (pbVar15 == (byte *)0x0) { piVar5 = (int *)0x0; pbVar15 = &g_xmlNullStr; } else { piVar5 = (int *)hairAttr[2]; } if (piVar5 == piStack_10234) { pbVar13 = pbVar15 + (int)piVar5; if (pbVar13 <= pbVar15) goto LAB_0069b451; iVar7 = (int)&DAT_00b66fec - (int)pbVar15; while (*pbVar15 == pbVar15[iVar7]) { pbVar15 = pbVar15 + 1; if (pbVar13 <= pbVar15) goto LAB_0069b451; } } } hairAttr = (undefined4 *)0x0; LAB_0069b451: pbVar15 = &g_xmlNullStr; if ((byte *)hairAttr[1] != (byte *)0x0) { pbVar15 = (byte *)hairAttr[1]; } pbVar13 = pbVar15; do { bVar2 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar2 != 0); psVar11 = (std_string *)(pbVar13 + -(int)(pbVar15 + 1)); if ((std_string *)(0x7fffffff - skinRootSize) < psVar11) { LAB_0069b79c: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppbVar9 = (byte *****)skinRoot; if (0xf < skinRootCapacity) { pppppbVar9 = skinRoot[0]; } std::string::concat(tmpString._buf,(int)piStack_10234,psVar11,(byte *)pppppbVar9, skinRootSize,pbVar15,(uint)psVar11); cleanupFlags = cleanupFlags | 0x8000; local_14 = (byte ****)CONCAT31(local_14._1_3_,9); psVar11 = (config->_edenHair)._end; if (psVar11 == (config->_edenHair)._capacity) { vector_string_emplace_reallocate_move(&config->_edenHair,psVar11,&tmpString); } else { FUN_0042f2b0(); *(int *)(extraout_ECX_19 + 4) = *(int *)(extraout_ECX_19 + 4) + 0x18; } local_14._0_1_ = 4; std::string::_Tidy_deallocate(tmpString._buf); pbStack_10224 = *(byte **)(pbStack_10224 + 0x2c); } while (pbStack_10224 != (byte *)0x0); } } local_14._0_1_ = 3; std::string::_Tidy_deallocate(acStack_1010c); std::string::_Tidy_deallocate(acStack_10124); FID_conflict__Tidy(auStack_10144); std::string::_Tidy_deallocate(acStack_10184); if (0xf < uStack_10188) { uVar3 = uStack_10188 + 1; psVar11 = psStack_1019c; if (0xfff < uVar3) { psVar11 = (std_string *)psStack_1019c[-1]._capacity; uVar3 = uStack_10188 + 0x24; if ((char *)0x1f < (char *)((int)psStack_1019c + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); } uStack_1018c = 0; uStack_10188 = 0xf; psStack_1019c = (std_string *)((uint)psStack_1019c & 0xffffff00); std::string::_Tidy_deallocate(acStack_101b4); if (0xf < uStack_101b8) { uVar3 = uStack_101b8 + 1; psVar11 = psStack_101cc; if (0xfff < uVar3) { psVar11 = (std_string *)psStack_101cc[-1]._capacity; uVar3 = uStack_101b8 + 0x24; if ((char *)0x1f < (char *)((int)psStack_101cc + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); } uStack_101bc = 0; uStack_101b8 = 0xf; psStack_101cc = (std_string *)((uint)psStack_101cc & 0xffffff00); if (0xf < uStack_101d0) { uVar3 = uStack_101d0 + 1; psVar11 = psStack_101e4; if (0xfff < uVar3) { psVar11 = (std_string *)psStack_101e4[-1]._capacity; uVar3 = uStack_101d0 + 0x24; if ((char *)0x1f < (char *)((int)psStack_101e4 + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); } uStack_101d4 = 0; uStack_101d0 = 0xf; psStack_101e4 = (std_string *)((uint)psStack_101e4 & 0xffffff00); if (0xf < uStack_101e8) { uVar3 = uStack_101e8 + 1; psVar11 = (std_string *)auStack_10218._28_4_; if (0xfff < uVar3) { psVar11 = (std_string *)((std_string *)(auStack_10218._28_4_ + -0x18))->_capacity; uVar3 = uStack_101e8 + 0x24; if ((char *)0x1f < (char *)(auStack_10218._28_4_ + (-4 - (int)psVar11))) goto LAB_0069b73d; } operator_delete(psVar11,uVar3); } uStack_101ec = 0; uStack_101e8 = 0xf; auStack_10218._28_4_ = auStack_10218._28_4_ & 0xffffff00; std::string::_Tidy_deallocate(auStack_10218 + 4); pvStack_10238 = *(void **)((int)pvStack_10238 + 0x2c); goto joined_r0x00699bbe; } //@@ 0069b7b0 FUN_0069b7b0 void FUN_0069b7b0(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x10c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xf4)); FID_conflict__Tidy((void *)(in_ECX + 0xd4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x94)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x7c)); std::string::_Tidy_deallocate((char *)(in_ECX + 100)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x4c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); return; } //@@ 0069b810 EntityConfig_Player::operator_assign /* DB: ? copy-assign of a player config record (int at +0 then a run of std::string members assigned field by field); once from EntityConfig::load_players_xml when an existing player id is redefined */ EntityConfig_Player * __thiscall EntityConfig_Player::operator_assign(EntityConfig_Player *this,int *param_2) { void *pvVar1; void *pvVar2; void *menuPortraitAnm2; int iVar4; size_t collectiblesBytes; byte *srcText; std_vector *collectibles; int *other; other = param_2; this->_id = *param_2; srcText = (byte *)(param_2 + 1); if (&this->_name != (std_string *)srcText) { if (0xf < (uint)param_2[6]) { srcText = *(byte **)srcText; } std::string::assign((this->_name)._buf,srcText,param_2[5]); } srcText = (byte *)(param_2 + 7); if (&this->_skinPath != (std_string *)srcText) { if (0xf < (uint)param_2[0xc]) { srcText = *(byte **)srcText; } std::string::assign((this->_skinPath)._buf,srcText,param_2[0xb]); } srcText = (byte *)(param_2 + 0xd); if (&this->_nameImagePath != (std_string *)srcText) { if (0xf < (uint)param_2[0x12]) { srcText = *(byte **)srcText; } std::string::assign((this->_nameImagePath)._buf,srcText,param_2[0x11]); } srcText = (byte *)(param_2 + 0x13); if (&this->_portraitPath != (std_string *)srcText) { if (0xf < (uint)param_2[0x18]) { srcText = *(byte **)srcText; } std::string::assign((this->_portraitPath)._buf,srcText,param_2[0x17]); } srcText = (byte *)(param_2 + 0x19); if (&this->_unkString != (std_string *)srcText) { if (0xf < (uint)param_2[0x1e]) { srcText = *(byte **)srcText; } std::string::assign((this->_unkString)._buf,srcText,param_2[0x1d]); } srcText = (byte *)(param_2 + 0x1f); if (&this->_extraPortraitPath != (std_string *)srcText) { if (0xf < (uint)param_2[0x24]) { srcText = *(byte **)srcText; } std::string::assign((this->_extraPortraitPath)._buf,srcText,param_2[0x23]); } srcText = (byte *)(param_2 + 0x25); if (&this->_costumeSuffixName != (std_string *)srcText) { if (0xf < (uint)param_2[0x2a]) { srcText = *(byte **)srcText; } std::string::assign((this->_costumeSuffixName)._buf,srcText,param_2[0x29]); } this->_costumeID = param_2[0x2b]; this->_heart = param_2[0x2c]; this->_armor = param_2[0x2d]; this->_blackHeart = param_2[0x2e]; this->_coins = param_2[0x2f]; this->_bombs = param_2[0x30]; this->_keys = param_2[0x31]; this->_card = param_2[0x32]; this->_pill = param_2[0x33]; collectibles = &this->_collectibles; this->_canShoot = *(byte *)(param_2 + 0x34); if (collectibles != (std_vector *)(param_2 + 0x35)) { pvVar1 = (void *)param_2[0x35]; collectiblesBytes = param_2[0x36] - (int)pvVar1; param_2 = collectibles->_begin; if ((uint)((int)(this->_collectibles)._capacity - (int)param_2 >> 2) < (uint)((int)collectiblesBytes >> 2)) { std::vector::reserve_clear((int)collectiblesBytes >> 2); param_2 = collectibles->_begin; } memmove(param_2,pvVar1,collectiblesBytes); (this->_collectibles)._end = (void *)((int)param_2 + collectiblesBytes); } this->_trinket = other[0x38]; this->_skinColor = other[0x39]; this->_achievement = other[0x3a]; this->_brokenHeart = other[0x3b]; this->_pocketActiveID = other[0x3c]; srcText = (byte *)(other + 0x3d); if (&this->_birthrightDescription != (std_string *)srcText) { if (0xf < (uint)other[0x42]) { srcText = *(byte **)srcText; } std::string::assign((this->_birthrightDescription)._buf,srcText,other[0x41]); } srcText = (byte *)(other + 0x43); if (&this->_bSkinParentName != (std_string *)srcText) { if (0xf < (uint)other[0x48]) { srcText = *(byte **)srcText; } std::string::assign((this->_bSkinParentName)._buf,srcText,other[0x47]); } this->_moddedTaintedPlayerID = other[0x49]; this->_hidden = *(byte *)(other + 0x4a); this->_modEntry = (void *)other[0x4b]; pvVar1 = (void *)other[0x4d]; pvVar2 = (void *)other[0x4e]; menuPortraitAnm2 = (void *)other[0x4f]; *(int *)&this->_renderCustomBackground = other[0x4c]; this->_moddedMenuBackgroundANM2 = pvVar1; this->_moddedMenuPortraitANM2 = pvVar2; this->_moddedGameOverANM2 = menuPortraitAnm2; iVar4 = other[0x51]; this->_moddedCoopMenuANM2 = (void *)other[0x50]; this->_moddedControlsANM2 = (void *)iVar4; return this; } //@@ 0069ba90 EntityConfig::PreloadResources /* DB: AnmCache::Preload + Preload sound %d prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntityConfig::PreloadResources(EntityConfig *this,EntityConfig_Entity *entity) { undefined1 *puVar1; int iVar2; Manager *pMVar3; char cVar4; EntityConfig_Entity *entity_00; int *piVar5; SoundEffect *this_00; byte *path; undefined1 auStackY_b0 [128]; void *pvVar6; void *imageRefCount; if ((entity == (EntityConfig_Entity *)0x0) || (entity->isPreloaded == 0)) { AnmCache::Preload(); piVar5 = (entity->preloadSounds)._begin; if (piVar5 != (entity->preloadSounds)._end) { do { pMVar3 = g_manager; iVar2 = *piVar5; if (((iVar2 != 0) && (-1 < iVar2)) && (pvVar6 = (g_manager->_sfxManager)._sounds._begin, iVar2 < ((int)(g_manager->_sfxManager)._sounds._end - (int)pvVar6) / 0x1b8)) { this_00 = (SoundEffect *)(iVar2 * 0x1b8 + (int)pvVar6); if (*(char *)(this_00 + 0x66) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load(this_00); puVar1 = &(pMVar3->_sfxManager).field_0xc; *(int *)puVar1 = *(int *)puVar1 + 1; } this_00[0x66].field_0x1 = 0; } piVar5 = piVar5 + 1; } while (piVar5 != (entity->preloadSounds)._end); } piVar5 = *(int **)&entity->field_0x8c; if (piVar5 != *(int **)&entity->field_0x90) { do { if (piVar5[7] != 0) { path = (byte *)(piVar5 + 3); if (0xf < (uint)piVar5[8]) { path = *(byte **)path; } pvVar6 = (void *)0x69bb8e; cVar4 = TextureCache::Has(); if (cVar4 == '\0') { imageRefCount = (void *)0x69bb9d; Game::IsPaused(g_game); Manager::LoadImage(auStackY_b0 + 0x88,path); TextureCache::Add(pvVar6,imageRefCount); } } if (*piVar5 != 0) { entity_00 = GetEntity(this,*piVar5,piVar5[1],piVar5[2]); PreloadResources(this,entity_00); } piVar5 = piVar5 + 9; } while (piVar5 != *(int **)&entity->field_0x90); } entity->isPreloaded = 1; } return; } //@@ 0069bbf0 FUN_0069bbf0 void FUN_0069bbf0(void) { int iVar1; void *pvVar2; char *pcVar3; int *piVar4; int *in_ECX; uint size; void *pvVar5; void *pvVar6; char *this; int local_1c [3]; int local_10; int *local_c; void *local_8; iVar1 = *in_ECX; local_c = in_ECX; FUN_0069ec00(in_ECX,*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; in_ECX[1] = 0; pvVar2 = (void *)in_ECX[3]; pvVar5 = (void *)in_ECX[2]; if (pvVar5 != pvVar2) { do { FUN_0069b7b0(); pvVar5 = (void *)((int)pvVar5 + 0x148); } while (pvVar5 != pvVar2); pvVar5 = (void *)in_ECX[2]; } piVar4 = in_ECX + 2; in_ECX[3] = (int)pvVar5; if (local_1c != piVar4) { pvVar2 = (void *)*piVar4; local_10 = in_ECX[4]; *piVar4 = 0; in_ECX[3] = 0; in_ECX[4] = 0; local_8 = pvVar5; if (pvVar2 != (void *)0x0) { pvVar6 = pvVar2; if (pvVar2 != pvVar5) { do { FUN_0069b7b0(); pvVar6 = (void *)((int)pvVar6 + 0x148); } while (pvVar6 != pvVar5); in_ECX = local_c; } size = ((local_10 - (int)pvVar2) / 0x148) * 0x148; pvVar5 = pvVar2; if (0xfff < size) { pvVar5 = *(void **)((int)pvVar2 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,size); } } FUN_0069d780(); pcVar3 = (char *)in_ECX[0xc]; this = (char *)in_ECX[0xb]; if (this != pcVar3) { do { std::string::_Tidy_deallocate(this); this = this + 0x18; } while (this != pcVar3); this = (char *)in_ECX[0xb]; } in_ECX[0xc] = (int)this; in_ECX[0xf] = in_ECX[0xe]; in_ECX[0x12] = in_ECX[0x11]; return; } //@@ 0069bd10 FUN_0069bd10 int FUN_0069bd10(int param_1) { int in_ECX; if (-1 < param_1) { if (param_1 < (*(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8)) / 0x148) { return param_1 * 0x148 + *(int *)(in_ECX + 8); } } return 0; } //@@ 0069bd50 EntityConfig::LoadBabies /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: babies.xml parse ("Could not find root node babies in %s"), param_1 = xml path, appends 0x38-byte entries to vector at this+0x14 (= zhl EntityConfig::GetBabies at 0x14); zhl EntityConfig::LoadBabies(char*) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall EntityConfig::LoadBabies(EntityConfig *this,byte *xmlpath) { void **ppvVar1; qword qVar2; int *piVar3; int iVar4; byte *text; void *xmlNode; void *xmlNode; byte ****ppppbVar6; byte *strCursor; uint uVar7; byte *keyCursor; std_string *allocSource; byte *strCursor; int babiesByteSize; qword *allocatedBytes; undefined4 *attr; bool isLess; char *pcVar9; byte bVar10; int iStack_10120; undefined1 xmlDocument [48]; undefined1 xmlMemoryPool [65564]; void *skinPathConcat; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 skinPathConcatSize; uint skinPathConcatCapacity; undefined4 fillerBabyId; void *fillerBabyName [4]; undefined4 fillerBabyNameSize; uint fillerBabyNameCapacity; void *fillerBabySkin [4]; undefined4 fillerBabySkinSize; uint fillerBabySkinCapacity; int fillerBabyAchievement; byte ****rootPath [4]; uint rootPathSize; uint rootPathCapacity; int babyId; void *babyName [4]; undefined4 babyNameSize; uint babyNameCapacity; void *babySkin; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 babySkinSize; uint babySkinCapacity; int babyAchievement; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(babyName + 0x15); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00af9d07; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(babyName + 0x12); ExceptionList = &local_1c; iStack_10120 = 0; FUN_0069d780(local_24); piVar3 = FileSystem::Open(&PTR_vftable_00c37a10,xmlpath,(int *)0x0); if (piVar3 != (int *)0x0) { iVar4 = (**(code **)(*piVar3 + 4))(); text = operator_new_tracked(iVar4 + 1); (**(code **)(*piVar3 + 0x14))(text,1,iVar4); text[iVar4] = 0; (**(code **)*piVar3)(1); FUN_00413b90(); local_14._0_1_ = 0; local_14._1_3_ = 0; pcVar9 = (char *)0x69be2f; strCursor = text; rapidxml::xml_document::parse(xmlDocument,text); bVar10 = (byte)strCursor; xmlNode = xml_node::first_node(xmlDocument,(byte *)"babies",(int)pcVar9,bVar10); if (xmlNode == (void *)0x0) { pcVar9 = "Could not find root node \'babies\' in %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'babies\' in %s\n"); bVar10 = (byte)xmlpath; } xmlNode = xml_node::first_attribute(xmlNode,&DAT_00b66f40,(uint)pcVar9,bVar10); rootPathSize = 0; rootPathCapacity = 0xf; rootPath[0] = (byte ****)0x0; strCursor = &g_xmlNullStr; if (*(byte **)((int)xmlNode + 4) != (byte *)0x0) { strCursor = *(byte **)((int)xmlNode + 4); } strCursor = strCursor; do { bVar10 = *strCursor; strCursor = strCursor + 1; } while (bVar10 != 0); uVar7 = (int)strCursor - (int)(strCursor + 1); std::string::assign((char *)rootPath,strCursor,uVar7); for (xmlNode = xml_node::first_node(xmlNode,&DAT_00b67088,(int)strCursor,(byte)uVar7); xmlNode != (void *)0x0; xmlNode = *(void **)((int)xmlNode + 0x2c)) { babyId = -1; babyNameSize = 0; babyNameCapacity = 0xf; babyName[0] = (void *)0x0; babySkinSize = 0; babySkinCapacity = 0xf; babySkin = (void *)0x0; babyAchievement = -1; local_14._0_1_ = 2; attr = *(undefined4 **)((int)xmlNode + 0x20); if (attr != (undefined4 *)0x0) { do { strCursor = (byte *)*attr; keyCursor = s_id; strCursor = &g_xmlNullStr; if (strCursor != (byte *)0x0) { strCursor = strCursor; } do { bVar10 = *strCursor; isLess = bVar10 < *keyCursor; if (bVar10 != *keyCursor) { LAB_0069bf51: uVar7 = -(uint)isLess | 1; goto LAB_0069bf56; } if (bVar10 == 0) break; bVar10 = strCursor[1]; isLess = bVar10 < keyCursor[1]; if (bVar10 != keyCursor[1]) goto LAB_0069bf51; strCursor = strCursor + 2; keyCursor = keyCursor + 2; } while (bVar10 != 0); uVar7 = 0; LAB_0069bf56: if (uVar7 == 0) { strCursor = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { strCursor = (byte *)attr[1]; } babyId = atoi((char *)strCursor); } else { keyCursor = s_name; strCursor = &g_xmlNullStr; if (strCursor != (byte *)0x0) { strCursor = strCursor; } do { bVar10 = *strCursor; isLess = bVar10 < *keyCursor; if (bVar10 != *keyCursor) { LAB_0069bfa8: uVar7 = -(uint)isLess | 1; goto LAB_0069bfad; } if (bVar10 == 0) break; bVar10 = strCursor[1]; isLess = bVar10 < keyCursor[1]; if (bVar10 != keyCursor[1]) goto LAB_0069bfa8; strCursor = strCursor + 2; keyCursor = keyCursor + 2; } while (bVar10 != 0); uVar7 = 0; LAB_0069bfad: if (uVar7 == 0) { strCursor = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { strCursor = (byte *)attr[1]; } strCursor = strCursor; do { bVar10 = *strCursor; strCursor = strCursor + 1; } while (bVar10 != 0); std::string::assign((char *)babyName,strCursor,(int)strCursor - (int)(strCursor + 1)); } else { keyCursor = &DAT_00b66ef4; strCursor = &g_xmlNullStr; if (strCursor != (byte *)0x0) { strCursor = strCursor; } do { bVar10 = *strCursor; isLess = bVar10 < *keyCursor; if (bVar10 != *keyCursor) { LAB_0069c010: uVar7 = -(uint)isLess | 1; goto LAB_0069c015; } if (bVar10 == 0) break; bVar10 = strCursor[1]; isLess = bVar10 < keyCursor[1]; if (bVar10 != keyCursor[1]) goto LAB_0069c010; keyCursor = keyCursor + 2; strCursor = strCursor + 2; } while (bVar10 != 0); uVar7 = 0; LAB_0069c015: if (uVar7 == 0) { strCursor = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { strCursor = (byte *)attr[1]; } strCursor = strCursor; do { bVar10 = *strCursor; strCursor = strCursor + 1; } while (bVar10 != 0); allocSource = (std_string *)(strCursor + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - rootPathSize) < allocSource) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar6 = (byte ****)rootPath; if (0xf < rootPathCapacity) { ppppbVar6 = rootPath[0]; } std::string::concat((char *)&skinPathConcat,iStack_10120,allocSource, (byte *)ppppbVar6,rootPathSize,strCursor,(uint)allocSource); iStack_10120 = 1; if (0xf < babySkinCapacity) { uVar7 = babySkinCapacity + 1; xmlNode = babySkin; if (0xfff < uVar7) { xmlNode = *(void **)((int)babySkin + -4); uVar7 = babySkinCapacity + 0x24; if (0x1f < (uint)((int)babySkin + (-4 - (int)xmlNode))) goto LAB_0069c39c; } operator_delete(xmlNode,uVar7); } babySkin = skinPathConcat; uStack_3c = uStack_c0; uStack_38 = uStack_bc; uStack_34 = uStack_b8; babySkinSize = skinPathConcatSize; babySkinCapacity = skinPathConcatCapacity; } else { pcVar9 = "achievement"; strCursor = &g_xmlNullStr; if (strCursor != (byte *)0x0) { strCursor = strCursor; } do { bVar10 = *strCursor; isLess = bVar10 < (byte)*pcVar9; if (bVar10 != *pcVar9) { LAB_0069c0f2: uVar7 = -(uint)isLess | 1; goto LAB_0069c0f7; } if (bVar10 == 0) break; bVar10 = strCursor[1]; isLess = bVar10 < (byte)pcVar9[1]; if (bVar10 != pcVar9[1]) goto LAB_0069c0f2; strCursor = strCursor + 2; pcVar9 = pcVar9 + 2; } while (bVar10 != 0); uVar7 = 0; LAB_0069c0f7: if (uVar7 == 0) { strCursor = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { strCursor = (byte *)attr[1]; } babyAchievement = atoi((char *)strCursor); } } } } iVar4 = babyId; } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); if (-1 < babyId) { piVar3 = (this->_babies)._end; babiesByteSize = (int)piVar3 - (int)(this->_babies)._begin; while (babiesByteSize / 0x38 < iVar4) { fillerBabyId = 0xffffffff; fillerBabyNameSize = 0; fillerBabyNameCapacity = 0xf; fillerBabyName[0] = (void *)0x0; fillerBabySkinSize = 0; fillerBabySkinCapacity = 0xf; fillerBabySkin[0] = (void *)0x0; local_14._0_1_ = 3; fillerBabyAchievement = 0; if (piVar3 == (this->_babies)._capacity) { std::vector<56byte>::_Emplace_reallocate(piVar3,&fillerBabyId); } else { *piVar3 = -1; std::string::string((char *)(piVar3 + 1),fillerBabyName); local_14._0_1_ = 4; std::string::string((char *)(piVar3 + 7),fillerBabySkin); piVar3[0xd] = fillerBabyAchievement; ppvVar1 = &(this->_babies)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x38); } local_14._0_1_ = 2; if (0xf < fillerBabySkinCapacity) { uVar7 = fillerBabySkinCapacity + 1; xmlNode = fillerBabySkin[0]; if (0xfff < uVar7) { xmlNode = *(void **)((int)fillerBabySkin[0] + -4); uVar7 = fillerBabySkinCapacity + 0x24; if (0x1f < (uint)((int)fillerBabySkin[0] + (-4 - (int)xmlNode))) goto LAB_0069c39c; } operator_delete(xmlNode,uVar7); } if (0xf < fillerBabyNameCapacity) { uVar7 = fillerBabyNameCapacity + 1; xmlNode = fillerBabyName[0]; if (0xfff < uVar7) { xmlNode = *(void **)((int)fillerBabyName[0] + -4); uVar7 = fillerBabyNameCapacity + 0x24; if (0x1f < (uint)((int)fillerBabyName[0] + (-4 - (int)xmlNode))) goto LAB_0069c39c; } operator_delete(xmlNode,uVar7); } piVar3 = (this->_babies)._end; babiesByteSize = (int)piVar3 - (int)(this->_babies)._begin; } if (piVar3 == (this->_babies)._capacity) { std::vector<56byte>::_Emplace_reallocate(piVar3,&babyId); } else { *piVar3 = iVar4; std::string::string((char *)(piVar3 + 1),babyName); local_14._0_1_ = 5; std::string::string((char *)(piVar3 + 7),&babySkin); piVar3[0xd] = babyAchievement; ppvVar1 = &(this->_babies)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x38); } } } local_14._0_1_ = 1; if (0xf < babySkinCapacity) { uVar7 = babySkinCapacity + 1; xmlNode = babySkin; if (0xfff < uVar7) { xmlNode = *(void **)((int)babySkin + -4); uVar7 = babySkinCapacity + 0x24; if (0x1f < (uint)((int)babySkin + (-4 - (int)xmlNode))) goto LAB_0069c39c; } operator_delete(xmlNode,uVar7); } if (0xf < babyNameCapacity) { uVar7 = babyNameCapacity + 1; xmlNode = babyName[0]; if (0xfff < uVar7) { xmlNode = *(void **)((int)babyName[0] + -4); uVar7 = babyNameCapacity + 0x24; if (0x1f < (uint)((int)babyName[0] + (-4 - (int)xmlNode))) goto LAB_0069c39c; } operator_delete(xmlNode,uVar7); } } local_14._0_1_ = 0; if (0xf < rootPathCapacity) { uVar7 = rootPathCapacity + 1; ppppbVar6 = rootPath[0]; if (0xfff < uVar7) { ppppbVar6 = (byte ****)rootPath[0][-1]; uVar7 = rootPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)rootPath[0] + (-4 - (int)ppppbVar6))) { LAB_0069c39c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar6,uVar7); } local_14 = (void *)0x6; xml_memory_pool::clear(xmlMemoryPool); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar7 = *(uint *)(text + -4); qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar7); free(text + -4); } } ExceptionList = local_1c; return; } //@@ 0069c420 load_bossportraits_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? bossportraits.xml: root bosses, attributes portrait/nameimage/pivotY/stage/alt/achievement; called from the resource loader 00952df0 Manager::load_configs loader as players.xml); fills EntityConfig._bosses-like vector */ undefined4 load_bossportraits_xml(byte *param_1) { uint *puVar1; uint *puVar2; uint uVar3; int *piVar4; undefined4 uVar5; int iVar6; byte *text; undefined4 *puVar7; void *pvVar8; byte ******ppppppbVar9; void *ptr; byte *pbVar10; byte *pbVar11; byte *pbVar12; std_string *psVar13; uint size; uint *puVar14; char *pcVar15; bool bVar16; double dVar17; char *pcVar18; byte bVar19; byte *pbStack_10148; uint *puStack_10144; uint *puStack_10140; undefined4 *puStack_1013c; int iStack_10138; byte ******appppppbStack_10134 [4]; uint uStack_10124; uint uStack_10120; byte ******ppppppbStack_1011c; undefined4 uStack_10118; undefined4 uStack_10114; undefined4 uStack_10110; uint uStack_1010c; uint uStack_10108; byte ******ppppppbStack_10104; undefined4 uStack_10100; undefined4 uStack_100fc; undefined4 uStack_100f8; uint uStack_100f4; uint uStack_100f0; float fStack_100ec; float fStack_100e8; int iStack_100e4; uint *puStack_100e0; uint *puStack_100dc; int iStack_100d8; undefined1 auStack_100d0 [48]; undefined1 auStack_100a0 [65560]; void *local_88 [4]; undefined4 local_78; uint local_74; byte ******local_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; uint local_60; uint uStack_5c; int local_58; byte ******local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_44; uint uStack_40; byte ******local_3c [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte *****local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (byte *****)0xffffffff; puStack_18 = &LAB_00af9d73; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; pbStack_10148 = param_1; local_24 = uVar3; piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar4 == (int *)0x0) { uVar5 = 0; } else { iVar6 = (**(code **)(*piVar4 + 4))(uVar3); text = operator_new_tracked(iVar6 + 1); (**(code **)(*piVar4 + 0x14))(text,1,iVar6); text[iVar6] = 0; (**(code **)*piVar4)(1); FUN_00413b90(); local_14 = (byte *****)0x0; pcVar18 = (char *)0x69c4f5; pbVar12 = text; rapidxml::xml_document::parse(auStack_100d0,text); bVar19 = (byte)pbVar12; puVar7 = xml_node::first_node(auStack_100d0,(byte *)"bosses",(int)pcVar18,bVar19); puStack_1013c = puVar7; if (puVar7 == (undefined4 *)0x0) { pcVar18 = "Could not find root node \'bosses\' in %s\n"; pbVar12 = pbStack_10148; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'bosses\' in %s\n"); bVar19 = (byte)pbVar12; } pvVar8 = xml_node::first_attribute(puVar7,&DAT_00b66f40,(uint)pcVar18,bVar19); local_2c = 0; local_28 = 0xf; local_3c[0] = (byte ******)0x0; pbVar12 = &g_xmlNullStr; if (*(byte **)((int)pvVar8 + 4) != (byte *)0x0) { pbVar12 = *(byte **)((int)pvVar8 + 4); } pbVar10 = pbVar12; do { bVar19 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar19 != 0); uVar3 = (int)pbVar10 - (int)(pbVar12 + 1); std::string::assign((char *)local_3c,pbVar12,uVar3); local_14._0_1_ = 1; pvVar8 = xml_node::first_attribute(puVar7,&DAT_00b1bff4,(uint)pbVar12,(byte)uVar3); local_78 = 0; local_74 = 0xf; local_88[0] = (void *)0x0; pbVar12 = &g_xmlNullStr; if (*(byte **)((int)pvVar8 + 4) != (byte *)0x0) { pbVar12 = *(byte **)((int)pvVar8 + 4); } pbVar10 = pbVar12; do { bVar19 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar19 != 0); std::string::assign((char *)local_88,pbVar12,(int)pbVar10 - (int)(pbVar12 + 1)); puStack_10144 = puStack_10140 + 8; local_14._0_1_ = 2; uVar3 = (int)(puStack_10140[9] - *puStack_10144) / 100; if (uVar3 < 0x69) { if (uVar3 < 0x68) { if ((uint)((int)(puStack_10140[10] - *puStack_10144) / 100) < 0x68) { std::vector<100byte>::_Resize_reallocate (puStack_10140[10] - *puStack_10144,&pbStack_10148); } else { uVar3 = FUN_0069fa70(puStack_10140[9],0x68 - uVar3,pbStack_10148); puStack_10144[1] = uVar3; } } } else { uVar3 = *puStack_10144; FUN_0069f520(puStack_10144); puStack_10144[1] = uVar3 + 0x28a0; } for (pbStack_10148 = (byte *)puStack_1013c[6]; pbStack_10148 != (byte *)0x0; pbStack_10148 = *(byte **)(pbStack_10148 + 0x2c)) { uStack_10124 = 0; uStack_10120 = 0xf; appppppbStack_10134[0] = (byte ******)0x0; uStack_1010c = 0; uStack_10108 = 0xf; ppppppbStack_1011c = (byte ******)0x0; uStack_100f4 = 0; uStack_100f0 = 0xf; ppppppbStack_10104 = (byte ******)0x0; fStack_100e8 = 0.0; fStack_100ec = 0.0; puStack_10140 = (uint *)0x0; puStack_100e0 = (uint *)0x0; puStack_100dc = (uint *)0x0; iStack_100d8 = 0; local_14._0_1_ = 3; puVar7 = *(undefined4 **)(pbStack_10148 + 0x20); iStack_100e4 = -1; for (; puVar7 != (undefined4 *)0x0; puVar7 = (undefined4 *)puVar7[6]) { pbVar12 = (byte *)*puVar7; pbVar11 = s_id; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < *pbVar11; if (bVar19 != *pbVar11) { LAB_0069c761: uVar3 = -(uint)bVar16 | 1; goto LAB_0069c766; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < pbVar11[1]; if (bVar19 != pbVar11[1]) goto LAB_0069c761; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069c766: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } iStack_10138 = atoi((char *)pbVar12); } else { pbVar11 = s_name; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < *pbVar11; if (bVar19 != *pbVar11) { LAB_0069c7b8: uVar3 = -(uint)bVar16 | 1; goto LAB_0069c7bd; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < pbVar11[1]; if (bVar19 != pbVar11[1]) goto LAB_0069c7b8; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069c7bd: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } pbVar10 = pbVar12; do { bVar19 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar19 != 0); std::string::assign((char *)appppppbStack_10134,pbVar12, (int)pbVar10 - (int)(pbVar12 + 1)); } else { pcVar18 = "nameimage"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < (byte)*pcVar18; if (bVar19 != *pcVar18) { LAB_0069c820: uVar3 = -(uint)bVar16 | 1; goto LAB_0069c825; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < (byte)pcVar18[1]; if (bVar19 != pcVar18[1]) goto LAB_0069c820; pbVar10 = pbVar10 + 2; pcVar18 = pcVar18 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069c825: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } pbVar10 = pbVar12; do { bVar19 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar19 != 0); psVar13 = (std_string *)(pbVar10 + -(int)(pbVar12 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar13) goto LAB_0069d13b; ppppppbVar9 = (byte ******)local_3c; if (0xf < local_28) { ppppppbVar9 = local_3c[0]; } std::string::concat((char *)&local_70,(int)text,psVar13,(byte *)ppppppbVar9,local_2c, pbVar12,(uint)psVar13); if (0xf < uStack_10108) { uVar3 = uStack_10108 + 1; ppppppbVar9 = ppppppbStack_1011c; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)ppppppbStack_1011c[-1]; uVar3 = uStack_10108 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_1011c + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } ppppppbStack_1011c = local_70; uStack_10118 = uStack_6c; uStack_10114 = uStack_68; uStack_10110 = uStack_64; uStack_1010c = local_60; uStack_10108 = uStack_5c; } else { pcVar18 = "portrait"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < (byte)*pcVar18; if (bVar19 != *pcVar18) { LAB_0069c908: uVar3 = -(uint)bVar16 | 1; goto LAB_0069c90d; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < (byte)pcVar18[1]; if (bVar19 != pcVar18[1]) goto LAB_0069c908; pbVar10 = pbVar10 + 2; pcVar18 = pcVar18 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069c90d: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } pbVar10 = pbVar12; do { bVar19 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar19 != 0); psVar13 = (std_string *)(pbVar10 + -(int)(pbVar12 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar13) { LAB_0069d13b: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppppbVar9 = (byte ******)local_3c; if (0xf < local_28) { ppppppbVar9 = local_3c[0]; } std::string::concat((char *)&local_70,(int)text,psVar13,(byte *)ppppppbVar9,local_2c ,pbVar12,(uint)psVar13); if (0xf < uStack_100f0) { uVar3 = uStack_100f0 + 1; ppppppbVar9 = ppppppbStack_10104; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)ppppppbStack_10104[-1]; uVar3 = uStack_100f0 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_10104 + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } ppppppbStack_10104 = local_70; uStack_10100 = uStack_6c; uStack_100fc = uStack_68; uStack_100f8 = uStack_64; uStack_100f4 = local_60; uStack_100f0 = uStack_5c; } else { pbVar11 = &DAT_00b670bc; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < *pbVar11; if (bVar19 != *pbVar11) { LAB_0069c9f0: uVar3 = -(uint)bVar16 | 1; goto LAB_0069c9f5; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < pbVar11[1]; if (bVar19 != pbVar11[1]) goto LAB_0069c9f0; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069c9f5: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } dVar17 = atof((char *)pbVar12); puStack_10140 = (uint *)(float)dVar17; fStack_100ec = 96.0 - (float)puStack_10140; } else { pcVar18 = "pivotY"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < (byte)*pcVar18; if (bVar19 != *pcVar18) { LAB_0069ca60: uVar3 = -(uint)bVar16 | 1; goto LAB_0069ca65; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < (byte)pcVar18[1]; if (bVar19 != pcVar18[1]) goto LAB_0069ca60; pbVar10 = pbVar10 + 2; pcVar18 = pcVar18 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069ca65: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } dVar17 = atof((char *)pbVar12); puStack_10140 = (uint *)(float)dVar17; fStack_100e8 = 132.0 - (float)puStack_10140; } else { pcVar18 = "achievement"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < (byte)*pcVar18; if (bVar19 != *pcVar18) { LAB_0069cac6: uVar3 = -(uint)bVar16 | 1; goto LAB_0069cacb; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < (byte)pcVar18[1]; if (bVar19 != pcVar18[1]) goto LAB_0069cac6; pbVar10 = pbVar10 + 2; pcVar18 = pcVar18 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069cacb: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } iStack_100e4 = atoi((char *)pbVar12); } } } } } } } if (puVar7[4] == 0) break; } puStack_10140 = puStack_100e0; if (iStack_10138 - 1U < 0x67) { piVar4 = (int *)(iStack_10138 * 100 + *puStack_10144); *piVar4 = iStack_10138; if ((byte *******)(piVar4 + 1) != appppppbStack_10134) { ppppppbVar9 = (byte ******)appppppbStack_10134; if (0xf < uStack_10120) { ppppppbVar9 = appppppbStack_10134[0]; } std::string::assign((char *)(piVar4 + 1),(byte *)ppppppbVar9,uStack_10124); } if ((byte *******)(piVar4 + 7) != &ppppppbStack_1011c) { ppppppbVar9 = (byte ******)&ppppppbStack_1011c; if (0xf < uStack_10108) { ppppppbVar9 = ppppppbStack_1011c; } puStack_10140 = puStack_100e0; std::string::assign((char *)(piVar4 + 7),(byte *)ppppppbVar9,uStack_1010c); } if ((byte *******)(piVar4 + 0xd) != &ppppppbStack_10104) { ppppppbVar9 = (byte ******)&ppppppbStack_10104; if (0xf < uStack_100f0) { ppppppbVar9 = ppppppbStack_10104; } puStack_10140 = puStack_100e0; std::string::assign((char *)(piVar4 + 0xd),(byte *)ppppppbVar9,uStack_100f4); } piVar4[0x15] = iStack_100e4; piVar4[0x13] = (int)fStack_100ec; piVar4[0x14] = (int)fStack_100e8; puStack_10140 = puStack_100e0; if ((uint **)(piVar4 + 0x16) != &puStack_100e0) { std::vector<28byte>::assign(puStack_100e0,puStack_100dc,text); } } pcVar18 = "alt"; do { pcVar15 = pcVar18; pcVar18 = pcVar15 + 1; } while (*pcVar18 != '\0'); for (puStack_1013c = *(undefined4 **)(pbStack_10148 + 0x18); puVar2 = puStack_10140, puStack_1013c != (undefined4 *)0x0; puStack_1013c = (undefined4 *)puStack_1013c[0xb]) { pbVar12 = (byte *)*puStack_1013c; if (pbVar12 == (byte *)0x0) { pcVar18 = (char *)0x0; pbVar12 = &g_xmlNullStr; } else { pcVar18 = (char *)puStack_1013c[2]; } if (pcVar18 == pcVar15 + -0xb66e43) { pbVar10 = (byte *)(pcVar18 + (int)pbVar12); if (pbVar10 <= pbVar12) goto joined_r0x0069cc85; iVar6 = (int)&DAT_00b66e44 - (int)pbVar12; while (*pbVar12 == pbVar12[iVar6]) { pbVar12 = pbVar12 + 1; if (pbVar10 <= pbVar12) goto joined_r0x0069cc85; } } } puStack_1013c = (undefined4 *)0x0; joined_r0x0069cc85: puStack_10140 = puVar2; if (puStack_1013c != (undefined4 *)0x0) { local_44 = 0; uStack_40 = 0xf; local_54 = (byte ******)0x0; local_14._0_1_ = 4; for (puVar7 = (undefined4 *)puStack_1013c[8]; puVar7 != (undefined4 *)0x0; puVar7 = (undefined4 *)puVar7[6]) { pbVar12 = (byte *)*puVar7; pcVar18 = "stage"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < (byte)*pcVar18; if (bVar19 != *pcVar18) { LAB_0069ccf1: uVar3 = -(uint)bVar16 | 1; goto LAB_0069ccf6; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < (byte)pcVar18[1]; if (bVar19 != pcVar18[1]) goto LAB_0069ccf1; pbVar10 = pbVar10 + 2; pcVar18 = pcVar18 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069ccf6: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } local_58 = atoi((char *)pbVar12); } else { pcVar18 = "portrait"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar19 = *pbVar10; bVar16 = bVar19 < (byte)*pcVar18; if (bVar19 != *pcVar18) { LAB_0069cd48: uVar3 = -(uint)bVar16 | 1; goto LAB_0069cd4d; } if (bVar19 == 0) break; bVar19 = pbVar10[1]; bVar16 = bVar19 < (byte)pcVar18[1]; if (bVar19 != pcVar18[1]) goto LAB_0069cd48; pbVar10 = pbVar10 + 2; pcVar18 = pcVar18 + 2; } while (bVar19 != 0); uVar3 = 0; LAB_0069cd4d: if (uVar3 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar7[1] != (byte *)0x0) { pbVar12 = (byte *)puVar7[1]; } pbVar10 = pbVar12; do { bVar19 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar19 != 0); psVar13 = (std_string *)(pbVar10 + -(int)(pbVar12 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar13) goto LAB_0069d13b; ppppppbVar9 = (byte ******)local_3c; if (0xf < local_28) { ppppppbVar9 = local_3c[0]; } std::string::concat((char *)&local_70,(int)text,psVar13,(byte *)ppppppbVar9,local_2c, pbVar12,(uint)psVar13); if (0xf < uStack_40) { uVar3 = uStack_40 + 1; ppppppbVar9 = local_54; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)local_54[-1]; uVar3 = uStack_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } local_54 = local_70; uStack_50 = uStack_6c; uStack_4c = uStack_68; uStack_48 = uStack_64; local_44 = local_60; uStack_40 = uStack_5c; } } if (puVar7[4] == 0) break; } iVar6 = iStack_10138 * 100 + *puStack_10144; piVar4 = *(int **)(iVar6 + 0x5c); if (piVar4 == *(int **)(iVar6 + 0x60)) { std::vector<28byte>::_Emplace_reallocate(piVar4,&local_58); } else { *piVar4 = local_58; std::string::string((char *)(piVar4 + 1),&local_54); *(int *)(iVar6 + 0x5c) = *(int *)(iVar6 + 0x5c) + 0x1c; } local_14._0_1_ = 3; if (0xf < uStack_40) { uVar3 = uStack_40 + 1; ppppppbVar9 = local_54; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)local_54[-1]; uVar3 = uStack_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } pcVar18 = "alt"; do { pcVar15 = pcVar18; pcVar18 = pcVar15 + 1; } while (*pcVar18 != '\0'); for (puStack_1013c = (undefined4 *)puStack_1013c[0xb]; puVar2 = puStack_10140, puStack_1013c != (undefined4 *)0x0; puStack_1013c = (undefined4 *)puStack_1013c[0xb]) { pbVar12 = (byte *)*puStack_1013c; if (pbVar12 == (byte *)0x0) { pcVar18 = (char *)0x0; pbVar12 = &g_xmlNullStr; } else { pcVar18 = (char *)puStack_1013c[2]; } if (pcVar18 == pcVar15 + -0xb66e43) { pbVar10 = (byte *)(pcVar18 + (int)pbVar12); if (pbVar10 <= pbVar12) goto joined_r0x0069cc85; iVar6 = (int)&DAT_00b66e44 - (int)pbVar12; while (*pbVar12 == pbVar12[iVar6]) { pbVar12 = pbVar12 + 1; if (pbVar10 <= pbVar12) goto joined_r0x0069cc85; } } } puStack_1013c = (undefined4 *)0x0; goto joined_r0x0069cc85; } local_14._0_1_ = 2; if (puVar2 != (uint *)0x0) { if (puVar2 != puStack_100dc) { puVar14 = puVar2 + 6; do { uVar3 = *puVar14; if (0xf < uVar3) { pvVar8 = (void *)puVar14[-5]; size = uVar3 + 1; ptr = pvVar8; if (0xfff < size) { ptr = *(void **)((int)pvVar8 - 4); size = uVar3 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)ptr))) goto LAB_0069d0dc; } operator_delete(ptr,size); } puVar14[-1] = 0; *puVar14 = 0xf; *(undefined1 *)(puVar14 + -5) = 0; puVar1 = puVar14 + 1; puVar14 = puVar14 + 7; } while (puVar1 != puStack_100dc); } uVar3 = ((iStack_100d8 - (int)puVar2) / 0x1c) * 0x1c; puVar14 = puVar2; if (0xfff < uVar3) { puVar14 = (uint *)puVar2[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)puVar2 + (-4 - (int)puVar14))) goto LAB_0069d0dc; } operator_delete(puVar14,uVar3); } if (0xf < uStack_100f0) { uVar3 = uStack_100f0 + 1; ppppppbVar9 = ppppppbStack_10104; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)ppppppbStack_10104[-1]; uVar3 = uStack_100f0 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_10104 + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } if (0xf < uStack_10108) { uVar3 = uStack_10108 + 1; ppppppbVar9 = ppppppbStack_1011c; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)ppppppbStack_1011c[-1]; uVar3 = uStack_10108 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_1011c + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } if (0xf < uStack_10120) { uVar3 = uStack_10120 + 1; ppppppbVar9 = appppppbStack_10134[0]; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)appppppbStack_10134[0][-1]; uVar3 = uStack_10120 + 0x24; if ((byte *)0x1f < (byte *)((int)appppppbStack_10134[0] + (-4 - (int)ppppppbVar9))) goto LAB_0069d0dc; } operator_delete(ppppppbVar9,uVar3); } } local_14._0_1_ = 1; if (0xf < local_74) { uVar3 = local_74 + 1; pvVar8 = local_88[0]; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_88[0] + -4); uVar3 = local_74 + 0x24; if (0x1f < (uint)((int)local_88[0] + (-4 - (int)pvVar8))) goto LAB_0069d0dc; } operator_delete(pvVar8,uVar3); } local_14._0_1_ = 0; if (0xf < local_28) { uVar3 = local_28 + 1; ppppppbVar9 = local_3c[0]; if (0xfff < uVar3) { ppppppbVar9 = (byte ******)local_3c[0][-1]; uVar3 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c[0] + (-4 - (int)ppppppbVar9))) { LAB_0069d0dc: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar9,uVar3); } local_14 = (byte *****)0x5; xml_memory_pool::clear(auStack_100a0); local_14 = (byte *****)0x6; tracked_alloc(1,text,0); uVar5 = 1; } ExceptionList = local_1c; return uVar5; } //@@ 0069d150 FUN_0069d150 void FUN_0069d150(void) { int in_ECX; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x18) = 0xf; *(undefined4 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x2c) = 0; *(undefined4 *)(in_ECX + 0x30) = 0xf; *(undefined4 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0xf; *(undefined4 *)(in_ECX + 0x50) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x58) = 0; *(undefined4 *)(in_ECX + 0x5c) = 0; *(undefined4 *)(in_ECX + 0x60) = 0; return; } //@@ 0069d1c0 FUN_0069d1c0 void FUN_0069d1c0(void) { int in_ECX; std::vector<28byte_string>::_Tidy(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); return; } //@@ 0069d1f0 FUN_0069d1f0 void FUN_0069d1f0(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 4)); return; } //@@ 0069d200 FUN_0069d200 int FUN_0069d200(int param_1) { int in_ECX; int iVar1; if (-1 < param_1) { iVar1 = *(int *)(in_ECX + 0x20); if (param_1 < (*(int *)(in_ECX + 0x24) - iVar1) / 100) goto LAB_0069d23e; } KAGE_LogMessage(0x10,(byte *)"BossID out of bounds\n"); iVar1 = *(int *)(in_ECX + 0x20); LAB_0069d23e: return param_1 * 100 + iVar1; } //@@ 0069d250 FUN_0069d250 uint * FUN_0069d250(void) { uint uVar1; int in_ECX; uint *puVar2; uVar1 = 0xffffffff; if (g_game != (Game *)0x0) { uVar1 = Game::GetStageID(g_game,(byte)g_game); } puVar2 = *(uint **)(in_ECX + 0x58); while( true ) { if (puVar2 == *(uint **)(in_ECX + 0x5c)) { return (uint *)(in_ECX + 0x34); } if (*puVar2 == uVar1) break; puVar2 = puVar2 + 7; } return puVar2 + 1; } //@@ 0069d290 Menu_Mods::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix64/71] __thiscall void Menu_Mods::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Mods::Update(Menu_Mods *this) { std_string *displayName; byte *b; void *freeBlock; uint size; undefined1 *nameSize; Menu_Mods playersBegin; byte *a; int iVar2; Menu_Mods playersEnd; undefined1 local_74 [4]; uint playerIndex; Menu_Mods *self; undefined1 *nameMapHead; undefined4 local_64; undefined1 *local_60; uint local_5c; void *displayNameBuf [3]; undefined1 local_4c [8]; undefined1 *local_44; void *nameKey; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; uint nameKeySize; uint nameKeyCapacity; uint local_28; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *nameSize; EntityConfig_Player *playerConfig; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af9dbd; local_1c = ExceptionList; securityCookie = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; nameMapHead = (undefined1 *)0x0; local_64 = 0; self = this; nameMapHead = operator_new(0x2c); *(undefined1 **)nameMapHead = nameMapHead; *(undefined1 **)(nameMapHead + 4) = nameMapHead; *(undefined1 **)(nameMapHead + 8) = nameMapHead; *(undefined2 *)(nameMapHead + 0xc) = 0x101; local_14._0_1_ = 0; local_14._1_3_ = 0; playersEnd = this[3]; playersBegin = this[2]; local_5c = 0x29; local_60 = nameMapHead; if (0x29 < (uint)(((int)playersEnd - (int)playersBegin) / 0x148)) { iVar2 = 0x3488; do { playerConfig = (EntityConfig_Player *)(iVar2 + (int)playersBegin); if ((*(char *)(iVar2 + 0x128 + (int)playersBegin) == '\0') && ((playerConfig->_bSkinParentName)._size == 0)) { displayName = EntityConfig_Player::GetDisplayName (playerConfig,(std_string *)displayNameBuf,playerConfig); nameKey = *(void **)displayName->_buf; uStack_3c = *(undefined4 *)(displayName->_buf + 4); uStack_38 = *(undefined4 *)(displayName->_buf + 8); uStack_34 = *(undefined4 *)(displayName->_buf + 0xc); nameKeySize = displayName->_size; nameKeyCapacity = displayName->_capacity; displayName->_size = 0; displayName->_capacity = 0xf; displayName->_buf[0] = '\0'; local_28 = local_5c; local_14._0_1_ = 2; FUN_006a00d0(local_74,&nameKey); local_14._0_1_ = 1; if (0xf < nameKeyCapacity) { size = nameKeyCapacity + 1; freeBlock = nameKey; if (0xfff < size) { freeBlock = *(void **)((int)nameKey + -4); size = nameKeyCapacity + 0x24; if (0x1f < (uint)((int)nameKey + (-4 - (int)freeBlock))) goto LAB_0069d502; } operator_delete(freeBlock,size); } local_14._0_1_ = 0; if (&DAT_0000000f < local_44) { nameSize = local_44 + 1; freeBlock = displayNameBuf[0]; if ((undefined1 *)0xfff < nameSize) { freeBlock = *(void **)((int)displayNameBuf[0] + -4); nameSize = local_44 + 0x24; if (0x1f < (uint)((int)displayNameBuf[0] + (-4 - (int)freeBlock))) { LAB_0069d502: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,(uint)nameSize); } } iVar2 = iVar2 + 0x148; local_5c = local_5c + 1; playersEnd = self[3]; playersBegin = self[2]; } while (local_5c < (uint)(((int)playersEnd - (int)playersBegin) / 0x148)); local_60 = nameMapHead; } playerIndex = 0x29; nameSize = local_60; nameMapHead = local_60; if (0x29 < (uint)(((int)playersEnd - (int)playersBegin) / 0x148)) { local_5c = 0x3488; do { if ((*(char *)(local_5c + 0x128 + (int)playersBegin) == '\0') && (*(int *)(local_5c + 0x11c + (int)playersBegin) != 0)) { a = (byte *)((int)playersBegin + local_5c + 0x10c); std::map::_Find_lower_bound(local_4c,a); nameSize = local_44; if (local_44[0xd] == '\0') { b = local_44 + 0x10; if (0xf < *(uint *)(local_44 + 0x24)) { b = *(byte **)b; } nameSize = (uint *)(a + 0x10); if (0xf < *(uint *)(a + 0x14)) { a = *(byte **)a; } iVar2 = string_compare(a,*nameSize,b,*(uint *)(local_44 + 0x20)); if ((-1 < iVar2) && (nameSize != local_60)) { *(uint *)(*(int *)(nameSize + 0x28) * 0x148 + 0x124 + (int)self[2]) = playerIndex; local_60 = nameMapHead; } } nameSize = local_60; } local_5c = local_5c + 0x148; playerIndex = playerIndex + 1; playersBegin = self[2]; } while (playerIndex < (uint)(((int)self[3] - (int)playersBegin) / 0x148)); } FUN_004235c0(&nameMapHead,*(undefined4 *)(nameSize + 4)); operator_delete(nameMapHead,0x2c); ExceptionList = local_1c; return; } //@@ 0069d580 FUN_0069d580 void FUN_0069d580(void) { int *in_ECX; FUN_004235c0(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x2c); return; } //@@ 0069d5a0 std::vector::_Tidy /* DB: destroys 0x168-byte elements with FUN_00698ab0 (strings/vectors dtor) and frees storage; the vector is filled by FUN_00694f00 from the EntityConfig map filtered by entity type (2/9/5/1000) in ProceduralEffect::roll_params helper 009e0700 ProceduralEffect::roll_trigger_target void std::vector::_Tidy(void) { uint size; int *in_ECX; EntityConfig_Entity *this; EntityConfig_Entity *pEVar1; this = (EntityConfig_Entity *)*in_ECX; if (this != (EntityConfig_Entity *)0x0) { pEVar1 = (EntityConfig_Entity *)in_ECX[1]; if (this != pEVar1) { do { EntityConfig_Entity::~EntityConfig_Entity(this); this = this + 1; } while (this != pEVar1); this = (EntityConfig_Entity *)*in_ECX; } size = ((in_ECX[2] - (int)this) / 0x168) * 0x168; pEVar1 = this; if (0xfff < size) { pEVar1 = *(EntityConfig_Entity **)&this[-1].isPortraitModded; size = size + 0x23; if (0x1f < (uint)((int)this + (-4 - (int)pEVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar1,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069d630 FUN_0069d630 int FUN_0069d630(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::_Try_emplace(local_10,param_1); return *piVar1 + 0x28; } //@@ 0069d650 FUN_0069d650 void FUN_0069d650(void) { void *pvVar1; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x2c); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *in_ECX = pvVar1; return; } //@@ 0069d690 std::map::find /* DB: _Find_lower_bound then string_compare, returns node or end (*ECX); EntityConfig::LoadEntities, PreloadManager::load_group */ void std::map::find(int *param_1,byte *param_2) { uint *puVar1; byte *b; int iVar2; int *in_ECX; undefined1 local_10 [8]; int local_8; _Find_lower_bound(local_10,param_2); if (*(char *)(local_8 + 0xd) == '\0') { b = (byte *)(local_8 + 0x10); if (0xf < *(uint *)(local_8 + 0x24)) { b = *(byte **)b; } puVar1 = (uint *)(param_2 + 0x10); if (0xf < *(uint *)(param_2 + 0x14)) { param_2 = *(byte **)param_2; } iVar2 = string_compare(param_2,*puVar1,b,*(uint *)(local_8 + 0x20)); if (-1 < iVar2) { *param_1 = local_8; return; } } *param_1 = *in_ECX; return; } //@@ 0069d700 FUN_0069d700 void FUN_0069d700(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_0069f520(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 100) * 100; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069d780 FUN_0069d780 void FUN_0069d780(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (iVar2 == iVar1) { in_ECX[1] = iVar2; return; } do { std::string::_Tidy_deallocate((char *)(iVar2 + 0x1c)); std::string::_Tidy_deallocate((char *)(iVar2 + 4)); iVar2 = iVar2 + 0x38; } while (iVar2 != iVar1); in_ECX[1] = *in_ECX; return; } //@@ 0069d7c0 FUN_0069d7c0 void FUN_0069d7c0(void) { int *in_ECX; uint size; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { std::string::_Tidy_deallocate((char *)((int)pvVar1 + 0x1c)); std::string::_Tidy_deallocate((char *)((int)pvVar1 + 4)); pvVar1 = (void *)((int)pvVar1 + 0x38); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x38) * 0x38; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069d860 FUN_0069d860 void FUN_0069d860(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FUN_0069b7b0(); pvVar1 = (void *)((int)pvVar1 + 0x148); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x148) * 0x148; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069d8f0 FUN_0069d8f0 int FUN_0069d8f0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_0069ea30(local_10,param_1); return *piVar1 + 0x18; } //@@ 0069d910 std::vector<28byte_string>::_Tidy /* DB: destroys 0x1c-byte elements (std::string at +0), frees, nulls; RoomConfig::~RoomConfig */ void std::vector<28byte_string>::_Tidy(void) { int *in_ECX; uint size; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { string::_Tidy_deallocate((char *)((int)pvVar1 + 4)); pvVar1 = (void *)((int)pvVar1 + 0x1c); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x1c) * 0x1c; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069d9d0 FUN_0069d9d0 void FUN_0069d9d0(uint param_1) { uint *puVar1; int in_ECX; if (0xd < param_1) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } puVar1 = (uint *)(in_ECX + (param_1 >> 5) * 4); *puVar1 = *puVar1 | 1 << ((byte)param_1 & 0x1f); return; } //@@ 0069da00 FUN_0069da00 void FUN_0069da00(void) { int iVar1; int iVar2; void *pvVar3; int *in_ECX; undefined4 extraout_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; pvVar3 = std::_Allocate(0xc00); FUN_0042f7a0(pvVar3,extraout_ECX); std::vector::_Change_array(pvVar3,(iVar1 - iVar2) / 0x18,0x80); return; } //@@ 0069da50 FUN_0069da50 void FUN_0069da50(char *param_1,char *param_2) { char *pcVar1; char *this; if (param_1 != param_2) { this = param_1 + 4; do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); pcVar1 = this + 0x34; this = this + 0x38; } while (pcVar1 != param_2); } return; } //@@ 0069da90 FUN_0069da90 void FUN_0069da90(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x148) { FUN_0069b7b0(); } return; } //@@ 0069dac0 std::vector<12byte>::_Tidy /* DB: stride 0xc free */ void std::vector<12byte>::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069db30 FUN_0069db30 void FUN_0069db30(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { std::string::_Tidy_deallocate((char *)((int)pvVar1 + 0xc)); pvVar1 = (void *)((int)pvVar1 + 0x24); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x24) * 0x24; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069dbc0 FUN_0069dbc0 void FUN_0069dbc0(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_0069f4e0(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x7c) * 0x7c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0069dc40 FUN_0069dc40 void FUN_0069dc40(void) { FUN_0069f4e0(); return; } //@@ 0069dc60 FUN_0069dc60 void FUN_0069dc60(EntityConfig_Entity *param_1,EntityConfig_Entity *param_2) { for (; param_1 != param_2; param_1 = param_1 + 1) { EntityConfig_Entity::~EntityConfig_Entity(param_1); } return; } //@@ 0069dc90 FUN_0069dc90 void FUN_0069dc90(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x168; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 0069dcd0 FUN_0069dcd0 void FUN_0069dcd0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x148; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 0069dd10 FUN_0069dd10 void FUN_0069dd10(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x1c) { std::string::_Tidy_deallocate((char *)(param_1 + 4)); } return; } //@@ 0069dd40 FUN_0069dd40 void FUN_0069dd40(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x1c; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 0069dd90 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0xc; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 0069ddd0 FUN_0069ddd0 void FUN_0069ddd0(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x24) { std::string::_Tidy_deallocate((char *)(param_1 + 0xc)); } return; } //@@ 0069de00 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x24; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 0069de40 FUN_0069de40 void FUN_0069de40(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x7c; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 0069de80 FUN_0069de80 void FUN_0069de80(int param_1,int param_2,undefined4 param_3) { std::_Sort_unchecked<20byte>((param_2 - param_1) / 0x14,param_3); return; } //@@ 0069deb0 std::vector::_Emplace_reallocate /* DB: round 7 agent */ EntityConfig_Entity * std::vector::_Emplace_reallocate (EntityConfig_Entity *param_1,undefined4 param_2) { undefined **ppuVar1; int iVar2; EntityConfig_Entity *this; undefined **ppuVar3; EntityConfig_Entity *pEVar4; int *in_ECX; undefined **ppuVar5; EntityConfig_Entity *pEVar6; uint uVar7; EntityConfig_Entity *pEVar8; EntityConfig_Entity *pEVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9df0; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; ppuVar3 = (undefined **)((in_ECX[1] - iVar2) / 0x168); if (ppuVar3 == &PTR_s_SummonLoop4_00b60b60) { /* WARNING: Subroutine does not return */ _Xlen(); } ppuVar3 = (undefined **)((int)ppuVar3 + 1); uVar7 = (in_ECX[2] - iVar2) / 0x168; if ((int)&PTR_s_SummonLoop4_00b60b60 - (uVar7 >> 1) < uVar7) { ppuVar5 = &PTR_s_SummonLoop4_00b60b60; } else { ppuVar1 = (undefined **)((uVar7 >> 1) + uVar7); ppuVar5 = ppuVar3; if (ppuVar3 <= ppuVar1) { ppuVar5 = ppuVar1; } if (&PTR_s_SummonLoop4_00b60b60 < ppuVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pEVar4 = _Allocate((int)ppuVar5 * 0x168); local_8 = 0; pEVar6 = pEVar4 + ((int)param_1 - iVar2) / 0x168; EntityConfig_Entity::EntityConfig_Entity(pEVar6,param_2); pEVar8 = (EntityConfig_Entity *)in_ECX[1]; pEVar9 = (EntityConfig_Entity *)*in_ECX; this = pEVar4; if (param_1 == pEVar8) { for (; pEVar9 != pEVar8; pEVar9 = pEVar9 + 1) { EntityConfig_Entity::move_constructor(this,pEVar9); this = this + 1; } } else { FUN_0069fa30(pEVar9,param_1,pEVar4); FUN_0069fa30(param_1,in_ECX[1],pEVar6 + 1); } pEVar8 = (EntityConfig_Entity *)*in_ECX; if (pEVar8 != (EntityConfig_Entity *)0x0) { pEVar9 = (EntityConfig_Entity *)in_ECX[1]; if (pEVar8 != pEVar9) { do { EntityConfig_Entity::~EntityConfig_Entity(pEVar8); pEVar8 = pEVar8 + 1; } while (pEVar8 != pEVar9); pEVar8 = (EntityConfig_Entity *)*in_ECX; } uVar7 = ((in_ECX[2] - (int)pEVar8) / 0x168) * 0x168; pEVar9 = pEVar8; if (0xfff < uVar7) { pEVar9 = *(EntityConfig_Entity **)&pEVar8[-1].isPortraitModded; uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pEVar8 + (-4 - (int)pEVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar9,uVar7); } *in_ECX = (int)pEVar4; in_ECX[1] = (int)(pEVar4 + (int)ppuVar3); in_ECX[2] = (int)(pEVar4 + (int)ppuVar5); ExceptionList = local_10; return pEVar6; } //@@ 0069e08b Catch_All@0069e08b void Catch_All_0069e08b(void) { int unaff_EBP; FUN_0069dc60(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x28)); FUN_0069dc90(*(undefined4 *)(unaff_EBP + -0x20),*(undefined4 *)(unaff_EBP + -0x1c)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0069e0c0 std::map::_Try_emplace /* DB: std::map::_Find_lower_bound then operator_new(0x2c) node (value +0x28, max_size 0x5d1745d); FUN_0069d630 returns node+0x28 (operator[]), used by EntityConfig::parse_entity_tags / LoadEntities / ItemConfig::parse_cache_flags */ void std::map::_Try_emplace(undefined4 *param_1,byte *param_2) { int *piVar1; int iVar2; int iVar3; int iVar4; uint uVar5; byte *b; int iVar6; int *in_ECX; byte *a; int *piVar7; int *piVar8; int *local_38; int local_34; int *local_30; int *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af9e1d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; string>::_Find_lower_bound(&local_38,param_2); if (*(char *)((int)local_30 + 0xd) == '\0') { b = (byte *)(local_30 + 4); if (0xf < (uint)local_30[9]) { b = *(byte **)b; } a = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { a = *(byte **)param_2; } iVar6 = string_compare(a,*(uint *)(param_2 + 0x10),b,local_30[8]); if (-1 < iVar6) { *(undefined1 *)(param_1 + 1) = 0; goto LAB_0069e2d1; } } if (in_ECX[1] == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar6 = *in_ECX; local_14 = 0; local_28 = (int *)0x0; local_24 = operator_new(0x2c); local_24[4] = 0; local_24[8] = 0; local_24[9] = 0; iVar2 = *(int *)(param_2 + 4); iVar3 = *(int *)(param_2 + 8); iVar4 = *(int *)(param_2 + 0xc); local_24[4] = *(int *)param_2; local_24[5] = iVar2; local_24[6] = iVar3; local_24[7] = iVar4; *(undefined8 *)(local_24 + 8) = *(undefined8 *)(param_2 + 0x10); param_2[0x10] = 0; param_2[0x11] = 0; param_2[0x12] = 0; param_2[0x13] = 0; param_2[0x14] = 0xf; param_2[0x15] = 0; param_2[0x16] = 0; param_2[0x17] = 0; *param_2 = 0; local_24[10] = 0; *local_24 = iVar6; local_24[1] = iVar6; local_24[2] = iVar6; *(undefined2 *)(local_24 + 3) = 0; local_28 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; local_24[1] = (int)local_38; if (local_38 == local_28) { *local_28 = (int)local_24; local_28[1] = (int)local_24; local_28[2] = (int)local_24; *(undefined1 *)(local_24 + 3) = 1; } else { if (local_34 == 0) { local_38[2] = (int)local_24; if (local_38 == (int *)local_28[2]) { local_28[2] = (int)local_24; } } else { *local_38 = (int)local_24; if (local_38 == (int *)*local_28) { *local_28 = (int)local_24; } } piVar8 = local_24; if (*(char *)(local_24[1] + 0xc) == '\0') { do { piVar1 = (int *)piVar8[1]; piVar7 = *(int **)piVar1[1]; if (piVar1 == piVar7) { piVar7 = (int *)((undefined4 *)piVar1[1])[2]; if ((char)piVar7[3] == '\0') goto LAB_0069e26a; if (piVar8 == (int *)piVar1[2]) { FUN_00415fe0(piVar1); piVar8 = piVar1; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } else if ((char)piVar7[3] == '\0') { LAB_0069e26a: *(undefined1 *)(piVar1 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)*piVar1) { FUN_00415f80(piVar1); piVar8 = piVar1; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } } while (*(char *)(piVar8[1] + 0xc) == '\0'); } *(undefined1 *)(local_28[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; local_30 = local_24; LAB_0069e2d1: *param_1 = local_30; ExceptionList = local_1c; return; } //@@ 0069e2f0 std::vector<20byte>::_Emplace_reallocate /* DB: ECX vector, args (where, const T*) for 0x14-byte trivially copied elements: 1.5x growth (max 0xccccccc), copy-insert at position, move halves; used by EntityConfig::LoadEntities and Game::RerollEnemy */ undefined4 * std::vector<20byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; void *pvVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; uint uVar8; undefined4 *puVar9; undefined4 *puVar10; int *in_ECX; uint uVar11; uint uVar12; undefined4 *puVar13; void *ptr; undefined4 *puVar14; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x14; if (iVar4 == 0xccccccc) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar8 = iVar4 + 1; uVar12 = (in_ECX[2] - *in_ECX) / 0x14; if (0xccccccc - (uVar12 >> 1) < uVar12) { uVar11 = 0xccccccc; } else { uVar12 = (uVar12 >> 1) + uVar12; uVar11 = uVar8; if (uVar8 <= uVar12) { uVar11 = uVar12; } if (0xccccccc < uVar11) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar9 = _Allocate(uVar11 * 0x14); puVar1 = puVar9 + (((int)param_1 - iVar2) / 0x14) * 5; uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; puVar1[4] = param_2[4]; puVar14 = (undefined4 *)in_ECX[1]; puVar10 = (undefined4 *)*in_ECX; puVar13 = puVar9; if (param_1 == puVar14) { for (; puVar10 != puVar14; puVar10 = puVar10 + 5) { uVar5 = puVar10[1]; uVar6 = puVar10[2]; uVar7 = puVar10[3]; *puVar13 = *puVar10; puVar13[1] = uVar5; puVar13[2] = uVar6; puVar13[3] = uVar7; puVar13[4] = puVar10[4]; puVar13 = puVar13 + 5; } } else { if (puVar10 != param_1) { do { uVar5 = puVar10[1]; uVar6 = puVar10[2]; uVar7 = puVar10[3]; *puVar13 = *puVar10; puVar13[1] = uVar5; puVar13[2] = uVar6; puVar13[3] = uVar7; puVar14 = puVar10 + 4; puVar10 = puVar10 + 5; puVar13[4] = *puVar14; puVar13 = puVar13 + 5; } while (puVar10 != param_1); puVar14 = (undefined4 *)in_ECX[1]; } if (param_1 != puVar14) { puVar10 = puVar1; do { uVar5 = param_1[1]; uVar6 = param_1[2]; uVar7 = param_1[3]; puVar10[5] = *param_1; puVar10[6] = uVar5; puVar10[7] = uVar6; puVar10[8] = uVar7; puVar13 = param_1 + 4; param_1 = param_1 + 5; puVar10[9] = *puVar13; puVar10 = puVar10 + 5; } while (param_1 != puVar14); } } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar12 = ((in_ECX[2] - (int)pvVar3) / 0x14) * 0x14; ptr = pvVar3; if (0xfff < uVar12) { ptr = *(void **)((int)pvVar3 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar12); } *in_ECX = (int)puVar9; in_ECX[1] = (int)(puVar9 + uVar8 * 5); in_ECX[2] = (int)(puVar9 + uVar11 * 5); return puVar1; } //@@ 0069e4a0 std::vector<56byte>::_Emplace_reallocate /* DB: vector grow (max 0x4924924) of 0x38-byte {int, std::string, ...} records; twice from EntityConfig::LoadBabies when the vector is full */ undefined4 * std::vector<56byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; int iVar3; undefined4 *puVar4; int *in_ECX; uint uVar5; uint uVar6; void *pvVar7; void *pvVar8; undefined4 *puVar9; int iVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9e50; local_10 = ExceptionList; ExceptionList = &local_10; iVar10 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x38; if (iVar3 == 0x4924924) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar3 + 1; uVar6 = (in_ECX[2] - *in_ECX) / 0x38; if (0x4924924 - (uVar6 >> 1) < uVar6) { uVar5 = 0x4924924; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar5 = uVar1; if (uVar1 <= uVar6) { uVar5 = uVar6; } if (0x4924924 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = _Allocate(uVar5 * 0x38); local_8 = 0; puVar2 = puVar4 + ((param_1 - iVar10) / 0x38) * 0xe; *puVar2 = *param_2; string::string((char *)(puVar2 + 1),param_2 + 1); local_8 = CONCAT31(local_8._1_3_,1); string::string((char *)(puVar2 + 7),param_2 + 7); puVar2[0xd] = param_2[0xd]; iVar10 = *in_ECX; puVar9 = puVar4; if (param_1 != in_ECX[1]) { FUN_006a09f0(puVar4,iVar10); puVar9 = puVar2 + 0xe; } FUN_006a09f0(puVar9,iVar10); pvVar7 = (void *)*in_ECX; if (pvVar7 != (void *)0x0) { pvVar8 = (void *)in_ECX[1]; if (pvVar7 != pvVar8) { do { string::_Tidy_deallocate((char *)((int)pvVar7 + 0x1c)); string::_Tidy_deallocate((char *)((int)pvVar7 + 4)); pvVar7 = (void *)((int)pvVar7 + 0x38); } while (pvVar7 != pvVar8); pvVar7 = (void *)*in_ECX; } uVar6 = ((in_ECX[2] - (int)pvVar7) / 0x38) * 0x38; pvVar8 = pvVar7; if (0xfff < uVar6) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar6); } *in_ECX = (int)puVar4; in_ECX[1] = (int)(puVar4 + uVar1 * 0xe); in_ECX[2] = (int)(puVar4 + uVar5 * 0xe); ExceptionList = local_10; return puVar2; } //@@ 0069e697 Catch_All@0069e697 void Catch_All_0069e697(void) { int unaff_EBP; FUN_0069da50(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); FUN_004aaaa0(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0069e6c0 EntityConfig_Player::copy_constructor /* DB: fastcall EDX=dst: int +0, seven std::string copies at +4..+0x94, then the POD tail; from EntityConfig::load_players_xml push_back (end += 0x148, the EntityConfig_Player stride used by Manager+0x2a678) and its realloc 0069e8c0 */ void EntityConfig_Player::copy_constructor(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9ee1; local_10 = ExceptionList; ExceptionList = &local_10; *in_EDX = *param_1; std::string::string((char *)(in_EDX + 1),param_1 + 1); local_8 = 0; std::string::string((char *)(in_EDX + 7),param_1 + 7); local_8._0_1_ = 1; std::string::string((char *)(in_EDX + 0xd),param_1 + 0xd); local_8._0_1_ = 2; std::string::string((char *)(in_EDX + 0x13),param_1 + 0x13); local_8._0_1_ = 3; std::string::string((char *)(in_EDX + 0x19),param_1 + 0x19); local_8._0_1_ = 4; std::string::string((char *)(in_EDX + 0x1f),param_1 + 0x1f); local_8._0_1_ = 5; std::string::string((char *)(in_EDX + 0x25),param_1 + 0x25); local_8._0_1_ = 6; in_EDX[0x2b] = param_1[0x2b]; in_EDX[0x2c] = param_1[0x2c]; in_EDX[0x2d] = param_1[0x2d]; in_EDX[0x2e] = param_1[0x2e]; in_EDX[0x2f] = param_1[0x2f]; in_EDX[0x30] = param_1[0x30]; in_EDX[0x31] = param_1[0x31]; in_EDX[0x32] = param_1[0x32]; in_EDX[0x33] = param_1[0x33]; *(undefined1 *)(in_EDX + 0x34) = *(undefined1 *)(param_1 + 0x34); std::vector::copy_constructor(param_1 + 0x35); local_8._0_1_ = 7; in_EDX[0x38] = param_1[0x38]; in_EDX[0x39] = param_1[0x39]; in_EDX[0x3a] = param_1[0x3a]; in_EDX[0x3b] = param_1[0x3b]; in_EDX[0x3c] = param_1[0x3c]; std::string::string((char *)(in_EDX + 0x3d),param_1 + 0x3d); local_8 = CONCAT31(local_8._1_3_,8); std::string::string((char *)(in_EDX + 0x43),param_1 + 0x43); in_EDX[0x49] = param_1[0x49]; *(undefined1 *)(in_EDX + 0x4a) = *(undefined1 *)(param_1 + 0x4a); in_EDX[0x4b] = param_1[0x4b]; uVar1 = param_1[0x4d]; uVar2 = param_1[0x4e]; uVar3 = param_1[0x4f]; in_EDX[0x4c] = param_1[0x4c]; in_EDX[0x4d] = uVar1; in_EDX[0x4e] = uVar2; in_EDX[0x4f] = uVar3; *(undefined8 *)(in_EDX + 0x50) = *(undefined8 *)(param_1 + 0x50); ExceptionList = local_10; return; } //@@ 0069e8c0 FUN_0069e8c0 void * FUN_0069e8c0(int param_1,undefined4 param_2) { undefined *puVar1; int iVar2; undefined *puVar3; uint uVar4; void *pvVar5; void *pvVar6; int *in_ECX; undefined *puVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9f00; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; puVar3 = (undefined *)((in_ECX[1] - iVar2) / 0x148); if (puVar3 == &DAT_00c7ce0c) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar4 = (in_ECX[2] - iVar2) / 0x148; if ((int)&DAT_00c7ce0c - (uVar4 >> 1) < uVar4) { puVar7 = &DAT_00c7ce0c; } else { puVar1 = (undefined *)((uVar4 >> 1) + uVar4); puVar7 = puVar3 + 1; if (puVar3 + 1 <= puVar1) { puVar7 = puVar1; } if (&DAT_00c7ce0c < puVar7) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = std::_Allocate((int)puVar7 * 0x148); local_8 = 0; pvVar6 = (void *)(((param_1 - iVar2) / 0x148) * 0x148 + (int)pvVar5); EntityConfig_Player::copy_constructor(param_2); if (param_1 == in_ECX[1]) { FUN_0069fb60(*in_ECX,in_ECX[1],pvVar5); } else { FUN_0069fb90(*in_ECX,param_1,pvVar5); FUN_0069fb90(param_1,in_ECX[1],(int)pvVar6 + 0x148); } FUN_0069fac0(pvVar5,puVar3 + 1,puVar7); ExceptionList = local_10; return pvVar6; } //@@ 0069e9fc Catch_All@0069e9fc void Catch_All_0069e9fc(void) { int unaff_EBP; FUN_0069da90(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); FUN_0069dcd0(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0069ea30 FUN_0069ea30 void FUN_0069ea30(int *param_1,uint *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9f2d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x180); piVar6[4] = *param_2; EntityConfig_Entity::EntityConfig_Entity((EntityConfig_Entity *)(piVar6 + 6)); *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_0069eb7a: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_0069eb7a; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 0069ec00 FUN_0069ec00 void FUN_0069ec00(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_0069ec00(param_1,param_2[2]); piVar2 = (int *)*param_2; EntityConfig_Entity::~EntityConfig_Entity((EntityConfig_Entity *)(param_2 + 6)); operator_delete(param_2,0x180); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 0069ec50 std::vector<28byte>::_Emplace_reallocate /* DB: growth/max 0x9249249 by /0x1c, element {int, std::string}; caller load_bossportraits_xml */ undefined4 * std::vector<28byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; int *in_ECX; uint uVar4; uint uVar5; void *pvVar6; void *pvVar7; undefined4 *puVar8; int iVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9f50; local_10 = ExceptionList; ExceptionList = &local_10; iVar9 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0x1c; if (iVar2 == 0x9249249) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = (in_ECX[2] - *in_ECX) / 0x1c; if (0x9249249 - (uVar5 >> 1) < uVar5) { uVar4 = 0x9249249; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar4 = iVar2 + 1U; if (iVar2 + 1U <= uVar5) { uVar4 = uVar5; } if (0x9249249 < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar3 = _Allocate(uVar4 * 0x1c); local_8 = 0; puVar1 = puVar3 + ((param_1 - iVar9) / 0x1c) * 7; *puVar1 = *param_2; string::string((char *)(puVar1 + 1),param_2 + 1); iVar9 = *in_ECX; puVar8 = puVar3; if (param_1 != in_ECX[1]) { FUN_006a0ab0(puVar3,iVar9); puVar8 = puVar1 + 7; } FUN_006a0ab0(puVar8,iVar9); pvVar6 = (void *)*in_ECX; if (pvVar6 != (void *)0x0) { pvVar7 = (void *)in_ECX[1]; if (pvVar6 != pvVar7) { do { string::_Tidy_deallocate((char *)((int)pvVar6 + 4)); pvVar6 = (void *)((int)pvVar6 + 0x1c); } while (pvVar6 != pvVar7); pvVar6 = (void *)*in_ECX; } uVar5 = ((in_ECX[2] - (int)pvVar6) / 0x1c) * 0x1c; pvVar7 = pvVar6; if (0xfff < uVar5) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } *in_ECX = (int)puVar3; in_ECX[1] = (int)(puVar3 + (iVar2 + 1) * 7); in_ECX[2] = (int)(puVar3 + uVar4 * 7); ExceptionList = local_10; return puVar1; } //@@ 0069ee1d Catch_All@0069ee1d void Catch_All_0069ee1d(void) { int unaff_EBP; FUN_0069dd10(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); FUN_0069dd40(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0069ee50 std::vector<12byte>::_Emplace_reallocate /* DB: element size 0xc, max 0x15555555, grows x1.5, memmove halves; EntityConfig::LoadEntities, RoomConfigRoom::ParseXml, queue_room_clear_charges (009e5960) */ undefined8 * std::vector<12byte>::_Emplace_reallocate(void *param_1,undefined8 *param_2) { undefined8 *puVar1; int iVar2; void *pvVar3; int iVar4; void *_Dst; int *in_ECX; uint uVar5; uint uVar6; void *ptr; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0xc; if (iVar4 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar6 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar6 >> 1) < uVar6) { uVar5 = 0x15555555; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar5 = iVar4 + 1U; if (iVar4 + 1U <= uVar6) { uVar5 = uVar6; } if (0x15555555 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar5 * 0xc); puVar1 = (undefined8 *)((int)_Dst + (((int)param_1 - iVar2) / 0xc) * 0xc); *puVar1 = *param_2; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(param_2 + 1); pvVar3 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar3,in_ECX[1] - (int)pvVar3); } else { memmove(_Dst,pvVar3,(int)param_1 - (int)pvVar3); memmove((void *)((int)puVar1 + 0xc),param_1,in_ECX[1] - (int)param_1); } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar6 = ((in_ECX[2] - (int)pvVar3) / 0xc) * 0xc; ptr = pvVar3; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar3 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + (iVar4 + 1) * 0xc); in_ECX[2] = (int)(uVar5 * 0xc + (int)_Dst); return puVar1; } //@@ 0069efc0 FUN_0069efc0 undefined4 * FUN_0069efc0(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 uVar3; void *pvVar4; int iVar5; uint uVar6; undefined4 *puVar7; void *ptr; int *in_ECX; uint uVar8; uint uVar9; undefined4 *puVar10; undefined4 *puVar11; undefined4 *puVar12; iVar2 = *in_ECX; iVar5 = in_ECX[1] - iVar2 >> 2; if (iVar5 == 0x3fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar6 = iVar5 + 1; uVar8 = in_ECX[2] - iVar2 >> 2; if (0x3fffffff - (uVar8 >> 1) < uVar8) { uVar9 = 0x3fffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; uVar9 = uVar6; if (uVar6 <= uVar8) { uVar9 = uVar8; } if (0x3fffffff < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = std::_Allocate(uVar9 * 4); puVar1 = puVar7 + ((int)param_1 - iVar2 >> 2); *puVar1 = *param_2; puVar12 = (undefined4 *)in_ECX[1]; puVar10 = (undefined4 *)*in_ECX; puVar11 = puVar7; if (param_1 == puVar12) { for (; puVar10 != puVar12; puVar10 = puVar10 + 1) { *puVar11 = *puVar10; puVar11 = puVar11 + 1; } } else { if (puVar10 != param_1) { do { uVar3 = *puVar10; puVar10 = puVar10 + 1; *puVar11 = uVar3; puVar11 = puVar11 + 1; } while (puVar10 != param_1); puVar12 = (undefined4 *)in_ECX[1]; } if (param_1 != puVar12) { puVar10 = param_1; do { *(undefined4 *)((int)puVar1 + (4 - (int)param_1) + (int)puVar10) = *puVar10; puVar10 = puVar10 + 1; } while (puVar10 != puVar12); } } pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { uVar8 = in_ECX[2] - (int)pvVar4 & 0xfffffffc; ptr = pvVar4; if (0xfff < uVar8) { ptr = *(void **)((int)pvVar4 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar8); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + uVar6); in_ECX[2] = (int)(puVar7 + uVar9); return puVar1; } //@@ 0069f110 std::vector<36byte>::_Emplace_reallocate /* DB: growth/max 0x71c71c7 by /0x24, element {3 ints, std::string}; caller EntityConfig::LoadEntities */ undefined4 * std::vector<36byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; int *in_ECX; uint uVar4; uint uVar5; void *pvVar6; void *pvVar7; undefined4 *puVar8; int iVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9f70; local_10 = ExceptionList; ExceptionList = &local_10; iVar9 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0x24; if (iVar2 == 0x71c71c7) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = (in_ECX[2] - *in_ECX) / 0x24; if (0x71c71c7 - (uVar5 >> 1) < uVar5) { uVar4 = 0x71c71c7; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar4 = iVar2 + 1U; if (iVar2 + 1U <= uVar5) { uVar4 = uVar5; } if (0x71c71c7 < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar3 = _Allocate(uVar4 * 0x24); local_8 = 0; puVar1 = puVar3 + ((param_1 - iVar9) / 0x24) * 9; *puVar1 = *param_2; puVar1[1] = param_2[1]; puVar1[2] = param_2[2]; string::string((char *)(puVar1 + 3),param_2 + 3); iVar9 = *in_ECX; puVar8 = puVar3; if (param_1 != in_ECX[1]) { FUN_006a0b30(puVar3,iVar9); puVar8 = puVar1 + 9; } FUN_006a0b30(puVar8,iVar9); pvVar6 = (void *)*in_ECX; if (pvVar6 != (void *)0x0) { pvVar7 = (void *)in_ECX[1]; if (pvVar6 != pvVar7) { do { string::_Tidy_deallocate((char *)((int)pvVar6 + 0xc)); pvVar6 = (void *)((int)pvVar6 + 0x24); } while (pvVar6 != pvVar7); pvVar6 = (void *)*in_ECX; } uVar5 = ((in_ECX[2] - (int)pvVar6) / 0x24) * 0x24; pvVar7 = pvVar6; if (0xfff < uVar5) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } *in_ECX = (int)puVar3; in_ECX[1] = (int)(puVar3 + (iVar2 + 1) * 9); in_ECX[2] = (int)(puVar3 + uVar4 * 9); ExceptionList = local_10; return puVar1; } //@@ 0069f2cf Catch_All@0069f2cf void Catch_All_0069f2cf(void) { int unaff_EBP; FUN_0069ddd0(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + 8)); deallocate(*(void **)(unaff_EBP + -0x18),*(uint *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0069f300 std::vector<124byte>::_Emplace_reallocate /* DB: growth/max 0x2108421 by /0x7c, element via Color::copy_constructor_ext (Color + 3 strings); caller EntityConfig::load_boss_colors */ Color * std::vector<124byte>::_Emplace_reallocate(int param_1,void *param_2) { uint uVar1; int iVar2; void *pvVar3; int iVar4; void *pvVar5; int *in_ECX; uint uVar6; uint uVar7; Color *this; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af9f90; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x7c; if (iVar4 == 0x2108421) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar4 + 1; uVar7 = (in_ECX[2] - *in_ECX) / 0x7c; if (0x2108421 - (uVar7 >> 1) < uVar7) { uVar6 = 0x2108421; } else { uVar7 = (uVar7 >> 1) + uVar7; uVar6 = uVar1; if (uVar1 <= uVar7) { uVar6 = uVar7; } if (0x2108421 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(uVar6 * 0x7c); local_8 = 0; this = (Color *)(((param_1 - iVar2) / 0x7c) * 0x7c + (int)pvVar5); Color::copy_constructor_ext(this,param_2); if (param_1 == in_ECX[1]) { FUN_006a0c40(pvVar5); } else { FUN_0069fc00(*in_ECX,param_1,pvVar5); FUN_0069fc00(param_1,in_ECX[1],this[2]._offset + 1); } if (*in_ECX != 0) { FUN_0069f4e0(*in_ECX); pvVar3 = (void *)*in_ECX; uVar7 = ((in_ECX[2] - (int)pvVar3) / 0x7c) * 0x7c; ptr = pvVar3; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar3 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)pvVar5; in_ECX[1] = (int)(uVar1 * 0x7c + (int)pvVar5); in_ECX[2] = (int)(uVar6 * 0x7c + (int)pvVar5); ExceptionList = local_10; return this; } //@@ 0069f4a2 Catch_All@0069f4a2 void Catch_All_0069f4a2(void) { int unaff_EBP; FUN_0069dc40(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x28)); FUN_0069de40(*(undefined4 *)(unaff_EBP + -0x2c),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0069f4e0 FUN_0069f4e0 void FUN_0069f4e0(void) { char *pcVar1; char *in_ECX; char *in_EDX; char *this; if (in_ECX != in_EDX) { this = in_ECX + 0x44; do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); std::string::_Tidy_deallocate(this + -0x18); pcVar1 = this + 0x38; this = this + 0x7c; } while (pcVar1 != in_EDX); } return; } //@@ 0069f520 FUN_0069f520 void FUN_0069f520(void) { char *pcVar1; char *in_ECX; char *in_EDX; char *this; if (in_ECX != in_EDX) { this = in_ECX + 0x34; do { std::vector<28byte_string>::_Tidy(); std::string::_Tidy_deallocate(this); std::string::_Tidy_deallocate(this + -0x18); std::string::_Tidy_deallocate(this + -0x30); pcVar1 = this + 0x30; this = this + 100; } while (pcVar1 != in_EDX); } return; } //@@ 0069f560 EntityConfig_Entity::EntityConfig_Entity /* DB: copy constructor of the 0x168-byte EntityConfig_Entity (id/variant/subtype +0..8, std::string name +0xc, vector of 0x7c records +0x68, string +0x74, vector of 0x24 +0x8c, vector +0x98 ...); used by FUN_00694f00 (EntityConfig filter by type -> vector, ProceduralEffect::roll_trigger_target) and its _Emplace_reallocate 0069deb0 std::vector::_Emplace_reallocate EntityConfig_Entity * __thiscall EntityConfig_Entity::EntityConfig_Entity(EntityConfig_Entity *this,int *param_2) { float fVar1; int iVar2; uint uVar3; void *pvVar4; undefined4 uVar5; void *devolveBuffer; undefined4 *dstSound; size_t devolveBytes; uint uVar6; undefined4 *srcSound; void *local_10; undefined1 *puStack_c; undefined4 local_8; std_vector *bossColors; undefined1 *field8cVector; int srcRecordsEnd; undefined4 *srcSoundsEnd; local_8 = 0xffffffff; puStack_c = &LAB_00afa03f; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this->id = *param_2; this->variant = param_2[1]; this->subtype = param_2[2]; std::string::string((this->name)._buf,param_2 + 3); local_8._0_1_ = 0; local_8._1_3_ = 0; bossColors = &this->_bossColors; this->shadowSize = (float)param_2[9]; this->collisionDamage = (float)param_2[10]; this->isBoss = *(byte *)(param_2 + 0xb); this->bossID = param_2[0xc]; this->canBeChampion = *(byte *)(param_2 + 0xd); this->collisionRadius = (float)param_2[0xe]; fVar1 = (float)param_2[0x10]; (this->collisionRadiusMulti).x = (float)param_2[0xf]; (this->collisionRadiusMulti).y = fVar1; this->mass = (float)param_2[0x11]; this->gridCollisionPoints = param_2[0x12]; this->friction = (float)param_2[0x13]; this->baseHP = (float)param_2[0x14]; this->stageHP = (float)param_2[0x15]; this->shutDoors = *(byte *)(param_2 + 0x16); this->gibsAmount = param_2[0x17]; this->gibFlags = param_2[0x18]; this->portrait = param_2[0x19]; bossColors->_begin = (void *)0x0; (this->_bossColors)._end = (void *)0x0; (this->_bossColors)._capacity = (void *)0x0; if (param_2[0x1a] != param_2[0x1b]) { uVar6 = (param_2[0x1b] - param_2[0x1a]) / 0x7c; if (0x2108421 < uVar6) goto LAB_0069f984; uVar6 = uVar6 * 0x7c; pvVar4 = std::_Allocate(uVar6); bossColors->_begin = pvVar4; (this->_bossColors)._end = pvVar4; (this->_bossColors)._capacity = (void *)((int)pvVar4 + uVar6); local_8._0_1_ = 1; pvVar4 = (void *)FUN_006a0c40(bossColors->_begin,bossColors,uVar3); (this->_bossColors)._end = pvVar4; } local_8._0_1_ = 2; std::string::string((this->anm2Path)._buf,param_2 + 0x1d); local_8._0_1_ = 3; field8cVector = &this->field_0x8c; *(undefined4 *)field8cVector = 0; *(undefined4 *)&this->field_0x90 = 0; *(undefined4 *)&this->field_0x94 = 0; iVar2 = param_2[0x23]; srcRecordsEnd = param_2[0x24]; if (iVar2 != srcRecordsEnd) { uVar3 = (srcRecordsEnd - iVar2) / 0x24; if (0x71c71c7 < uVar3) goto LAB_0069f984; uVar3 = uVar3 * 0x24; pvVar4 = std::_Allocate(uVar3); *(void **)field8cVector = pvVar4; *(void **)&this->field_0x90 = pvVar4; *(void **)&this->field_0x94 = (void *)((int)pvVar4 + uVar3); local_8._0_1_ = 4; uVar5 = FUN_006a0bb0(iVar2,srcRecordsEnd,*(undefined4 *)field8cVector); *(undefined4 *)&this->field_0x90 = uVar5; } local_8._0_1_ = 5; (this->preloadSounds)._begin = (void *)0x0; (this->preloadSounds)._end = (void *)0x0; (this->preloadSounds)._capacity = (void *)0x0; srcSoundsEnd = (undefined4 *)param_2[0x27]; srcSound = (undefined4 *)param_2[0x26]; if (srcSound != srcSoundsEnd) { uVar3 = (int)srcSoundsEnd - (int)srcSound >> 2; if (0x3fffffff < uVar3) goto LAB_0069f984; uVar3 = uVar3 * 4; pvVar4 = std::_Allocate(uVar3); (this->preloadSounds)._begin = pvVar4; (this->preloadSounds)._end = pvVar4; (this->preloadSounds)._capacity = (void *)((int)pvVar4 + uVar3); dstSound = (this->preloadSounds)._begin; do { uVar5 = *srcSound; srcSound = srcSound + 1; *dstSound = uVar5; dstSound = dstSound + 1; } while (srcSound != srcSoundsEnd); (this->preloadSounds)._end = dstSound; } local_8._0_1_ = 6; (this->devolve)._begin = (void *)0x0; (this->devolve)._end = (void *)0x0; (this->devolve)._capacity = (void *)0x0; pvVar4 = (void *)param_2[0x29]; if (pvVar4 != (void *)param_2[0x2a]) { devolveBytes = param_2[0x2a] - (int)pvVar4; uVar3 = (int)devolveBytes / 0xc; if (0x15555555 < uVar3) { LAB_0069f984: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar3 = uVar3 * 0xc; devolveBuffer = std::_Allocate(uVar3); (this->devolve)._begin = devolveBuffer; (this->devolve)._end = devolveBuffer; (this->devolve)._capacity = (void *)((int)devolveBuffer + uVar3); devolveBuffer = (this->devolve)._begin; memmove(devolveBuffer,pvVar4,devolveBytes); (this->devolve)._end = (void *)(uVar3 + (int)devolveBuffer); } local_8._0_1_ = 7; this->isPreloaded = *(byte *)(param_2 + 0x2c); std::string::string((this->gridCollisionClassString)._buf,param_2 + 0x2d); local_8._0_1_ = 8; this->reroll = *(byte *)(param_2 + 0x33); this->hasFloorAlts = *(byte *)((int)param_2 + 0xcd); this->collisionInterval = param_2[0x34]; iVar2 = param_2[0x37]; this->tags = param_2[0x36]; *(int *)&this->field_0xdc = iVar2; this->shieldStrength = (float)param_2[0x38]; this->shieldFrames = param_2[0x39]; this->bestiary = *(byte *)(param_2 + 0x3a); fVar1 = (float)param_2[0x3c]; (this->bestiaryOffset).x = (float)param_2[0x3b]; (this->bestiaryOffset).y = fVar1; this->bestiaryScale = (float)param_2[0x3d]; std::string::string((this->bestiaryAnm2Path)._buf,param_2 + 0x3e); local_8._0_1_ = 9; std::string::string((this->bestiaryAnim)._buf,param_2 + 0x44); local_8._0_1_ = 10; std::string::string((this->bestiaryOverlay)._buf,param_2 + 0x4a); local_8 = CONCAT31(local_8._1_3_,0xb); std::string::string((this->bestiaryFloorAlt)._buf,param_2 + 0x50); this->bestiaryParentType = param_2[0x56]; this->bestiaryParentVariant = param_2[0x57]; this->modEntry = (void *)param_2[0x58]; this->isPortraitModded = *(byte *)(param_2 + 0x59); ExceptionList = local_10; return this; } //@@ 0069f990 Color::copy_constructor_ext /* DB: ? copies Color + 3 strings; ICF-ish prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall Color::copy_constructor_ext(Color *this,void *other) { float fVar1; float fVar2; float fVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa07b; local_10 = ExceptionList; ExceptionList = &local_10; fVar1 = *(float *)((int)other + 4); fVar2 = *(float *)((int)other + 8); fVar3 = *(float *)((int)other + 0xc); this->_tint[0] = *(float *)other; this->_tint[1] = fVar1; this->_tint[2] = fVar2; this->_tint[3] = fVar3; fVar1 = *(float *)((int)other + 0x14); fVar2 = *(float *)((int)other + 0x18); fVar3 = *(float *)((int)other + 0x1c); this->_colorize[0] = *(float *)((int)other + 0x10); this->_colorize[1] = fVar1; this->_colorize[2] = fVar2; this->_colorize[3] = fVar3; *(undefined8 *)this->_offset = *(undefined8 *)((int)other + 0x20); this->_offset[2] = *(float *)((int)other + 0x28); std::string::string((char *)(this + 1),(void *)((int)other + 0x2c)); local_8 = 0; std::string::string((char *)(this[1]._colorize + 2),(void *)((int)other + 0x44)); local_8 = CONCAT31(local_8._1_3_,1); std::string::string((char *)(this[2]._tint + 1),(void *)((int)other + 0x5c)); this[2]._colorize[3] = *(float *)((int)other + 0x74); this[2]._offset[0] = *(float *)((int)other + 0x78); ExceptionList = local_10; return this; } //@@ 0069fa30 FUN_0069fa30 EntityConfig_Entity * FUN_0069fa30(EntityConfig_Entity *param_1,EntityConfig_Entity *param_2,EntityConfig_Entity *param_3) { for (; param_1 != param_2; param_1 = param_1 + 1) { EntityConfig_Entity::move_constructor(param_3,param_1); param_3 = param_3 + 1; } return param_3; } //@@ 0069fa70 FUN_0069fa70 void * FUN_0069fa70(void *param_1,int param_2) { undefined4 in_ECX; undefined4 extraout_ECX; for (; param_2 != 0; param_2 = param_2 + -1) { memset(param_1,0,100); FUN_0069d150(); param_1 = (void *)((int)param_1 + 100); in_ECX = extraout_ECX; } FUN_0069f520(in_ECX); return param_1; } //@@ 0069fac0 FUN_0069fac0 void FUN_0069fac0(int param_1,int param_2,int param_3) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FUN_0069b7b0(); pvVar1 = (void *)((int)pvVar1 + 0x148); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x148) * 0x148; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x148 + param_1; in_ECX[2] = param_3 * 0x148 + param_1; return; } //@@ 0069fb60 FUN_0069fb60 void FUN_0069fb60(int param_1,int param_2,int param_3) { if (param_1 != param_2) { param_3 = param_3 - param_1; do { EntityConfig_Player::EntityConfig_Player ((EntityConfig_Player *)(param_3 + param_1),param_1); param_1 = param_1 + 0x148; } while (param_1 != param_2); } return; } //@@ 0069fb90 FUN_0069fb90 EntityConfig_Player * FUN_0069fb90(int param_1,int param_2,EntityConfig_Player *param_3) { for (; param_1 != param_2; param_1 = param_1 + 0x148) { EntityConfig_Player::EntityConfig_Player(param_3,param_1); param_3 = param_3 + 1; } return param_3; } //@@ 0069fbd0 FUN_0069fbd0 int FUN_0069fbd0(int param_1,int param_2) { int extraout_ECX; int extraout_EDX; if (param_2 != 0) { do { EntityConfig_Player::EntityConfig_Player(); param_1 = extraout_ECX + 0x148; } while (extraout_EDX != 1); } return param_1; } //@@ 0069fc00 FUN_0069fc00 undefined4 * FUN_0069fc00(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *puVar5; undefined8 *puVar6; int iVar7; if (param_1 != param_2) { iVar7 = (int)param_3 - (int)param_1; puVar5 = param_1 + 0x10; puVar6 = (undefined8 *)(param_3 + 0x15); do { uVar2 = puVar5[-0xf]; uVar3 = puVar5[-0xe]; uVar4 = puVar5[-0xd]; *param_3 = puVar5[-0x10]; param_3[1] = uVar2; param_3[2] = uVar3; param_3[3] = uVar4; param_3 = param_3 + 0x1f; uVar2 = puVar5[-0xb]; uVar3 = puVar5[-10]; uVar4 = puVar5[-9]; *(undefined4 *)((int)puVar6 + -0x44) = puVar5[-0xc]; *(undefined4 *)(puVar6 + -8) = uVar2; *(undefined4 *)((int)puVar6 + -0x3c) = uVar3; *(undefined4 *)(puVar6 + -7) = uVar4; *(undefined8 *)((int)puVar6 + -0x34) = *(undefined8 *)(puVar5 + -8); *(undefined4 *)((int)puVar6 + -0x2c) = puVar5[-6]; *(undefined4 *)(puVar6 + -3) = 0; *(undefined4 *)(iVar7 + (int)puVar5) = 0; *(undefined4 *)(puVar6 + -5) = 0; uVar2 = puVar5[-4]; uVar3 = puVar5[-3]; uVar4 = puVar5[-2]; *(undefined4 *)(puVar6 + -5) = puVar5[-5]; *(undefined4 *)((int)puVar6 + -0x24) = uVar2; *(undefined4 *)(puVar6 + -4) = uVar3; *(undefined4 *)((int)puVar6 + -0x1c) = uVar4; puVar6[-3] = *(undefined8 *)(puVar5 + -1); puVar5[-1] = 0; *puVar5 = 0xf; *(undefined1 *)(puVar5 + -5) = 0; *(undefined4 *)puVar6 = 0; *(undefined4 *)((int)puVar6 + 4) = 0; *(undefined4 *)(puVar6 + -2) = 0; uVar2 = puVar5[2]; uVar3 = puVar5[3]; uVar4 = puVar5[4]; *(undefined4 *)(puVar6 + -2) = puVar5[1]; *(undefined4 *)((int)puVar6 + -0xc) = uVar2; *(undefined4 *)(puVar6 + -1) = uVar3; *(undefined4 *)((int)puVar6 + -4) = uVar4; *puVar6 = *(undefined8 *)(puVar5 + 5); puVar5[5] = 0; puVar5[6] = 0xf; *(undefined1 *)(puVar5 + 1) = 0; *(undefined4 *)(puVar6 + 3) = 0; *(undefined4 *)((int)puVar6 + 0x1c) = 0; *(undefined4 *)(puVar6 + 1) = 0; uVar2 = puVar5[8]; uVar3 = puVar5[9]; uVar4 = puVar5[10]; *(undefined4 *)(puVar6 + 1) = puVar5[7]; *(undefined4 *)((int)puVar6 + 0xc) = uVar2; *(undefined4 *)(puVar6 + 2) = uVar3; *(undefined4 *)((int)puVar6 + 0x14) = uVar4; puVar6[3] = *(undefined8 *)(puVar5 + 0xb); puVar5[0xb] = 0; puVar5[0xc] = 0xf; *(undefined1 *)(puVar5 + 7) = 0; *(undefined4 *)(puVar6 + 4) = puVar5[0xd]; in_ECX = puVar5 + 0x1f; *(undefined4 *)((int)puVar6 + 0x24) = puVar5[0xe]; puVar1 = puVar5 + 0xf; puVar5 = in_ECX; puVar6 = (undefined8 *)((int)puVar6 + 0x7c); } while (puVar1 != param_2); } FUN_0069f4e0(in_ECX); return param_3; } //@@ 0069fd40 FUN_0069fd40 void FUN_0069fd40(void) { void *pvVar1; int *piVar2; uint size; undefined4 *in_ECX; void *ptr; piVar2 = (int *)*in_ECX; if (piVar2 == (int *)0x0) { return; } if (*piVar2 != 0) { FUN_0069f4e0(*piVar2); pvVar1 = (void *)*piVar2; size = ((piVar2[2] - (int)pvVar1) / 0x7c) * 0x7c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *piVar2 = 0; piVar2[1] = 0; piVar2[2] = 0; } return; } //@@ 0069fd50 FUN_0069fd50 void FUN_0069fd50(void) { int *piVar1; uint size; undefined4 *in_ECX; void *pvVar2; void *pvVar3; piVar1 = (int *)*in_ECX; if (piVar1 == (int *)0x0) { return; } pvVar2 = (void *)*piVar1; if (pvVar2 != (void *)0x0) { pvVar3 = (void *)piVar1[1]; if (pvVar2 != pvVar3) { do { std::string::_Tidy_deallocate((char *)((int)pvVar2 + 0xc)); pvVar2 = (void *)((int)pvVar2 + 0x24); } while (pvVar2 != pvVar3); pvVar2 = (void *)*piVar1; } size = ((piVar1[2] - (int)pvVar2) / 0x24) * 0x24; pvVar3 = pvVar2; if (0xfff < size) { pvVar3 = *(void **)((int)pvVar2 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,size); *piVar1 = 0; piVar1[1] = 0; piVar1[2] = 0; } return; } //@@ 0069fd60 FUN_0069fd60 void FUN_0069fd60(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x180); } return; } //@@ 0069fd80 std::_Sort_unchecked<20byte> /* DB: MSVC STL introsort: recursive (self calls), switches to heap sort (make_heap/pop loop) when the ideal counter runs out, insertion below 0x294 bytes (32 x 20-byte elements), keyed on the float at +0xc; wrapper FUN_0069de80 (begin,end) called twice by EntityConfig::LoadEntities */ void std::_Sort_unchecked<20byte>(int param_1,undefined4 param_2) { undefined4 *puVar1; undefined4 *puVar2; float fVar3; undefined4 uVar4; uint uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 *puVar9; int iVar10; int iVar11; undefined4 *puVar12; undefined4 *in_ECX; int iVar13; undefined4 *in_EDX; int iVar14; int iVar15; undefined4 *local_90; size_t local_8c; undefined4 *local_50; undefined4 *puStack_4c; undefined4 uStack_48; float fStack_44; undefined4 local_40; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; float fStack_24; local_90 = in_EDX; if (0x293 < (int)in_EDX - (int)in_ECX) { do { if (param_1 < 1) { iVar13 = (int)local_90 - (int)in_ECX; uVar5 = iVar13 / 0x14; iVar10 = (int)uVar5 >> 1; if (0 < iVar10) { iVar11 = (int)(uVar5 - 1) >> 1; puVar12 = in_ECX + iVar10 * 5; do { local_30 = puVar12[-5]; uStack_2c = puVar12[-4]; uStack_28 = puVar12[-3]; fStack_24 = (float)puVar12[-2]; iVar10 = iVar10 + -1; uVar4 = puVar12[-1]; iVar15 = iVar10; iVar14 = iVar10; if (iVar10 < iVar11) { do { iVar14 = (uint)((float)in_ECX[iVar15 * 10 + 8] < (float)in_ECX[iVar15 * 10 + 0xd] || (float)in_ECX[iVar15 * 10 + 8] == (float)in_ECX[iVar15 * 10 + 0xd]) + iVar15 * 2 + 1; puVar1 = in_ECX + iVar14 * 5; uVar6 = puVar1[1]; uVar7 = puVar1[2]; uVar8 = puVar1[3]; puVar2 = in_ECX + iVar15 * 5; *puVar2 = *puVar1; puVar2[1] = uVar6; puVar2[2] = uVar7; puVar2[3] = uVar8; in_ECX[iVar15 * 5 + 4] = in_ECX[iVar14 * 5 + 4]; iVar15 = iVar14; } while (iVar14 < iVar11); } if ((iVar14 == iVar11) && ((uVar5 & 1) == 0)) { puVar2 = in_ECX + uVar5 * 5 + -5; uVar6 = puVar2[1]; uVar7 = puVar2[2]; uVar8 = puVar2[3]; puVar1 = in_ECX + iVar14 * 5; *puVar1 = *puVar2; puVar1[1] = uVar6; puVar1[2] = uVar7; puVar1[3] = uVar8; in_ECX[iVar14 * 5 + 4] = in_ECX[uVar5 * 5 + -1]; iVar14 = uVar5 - 1; } while ((iVar10 < iVar14 && (iVar15 = iVar14 + -1 >> 1, (float)in_ECX[iVar15 * 5 + 3] <= fStack_24 && fStack_24 != (float)in_ECX[iVar15 * 5 + 3]))) { puVar1 = in_ECX + iVar15 * 5; uVar6 = puVar1[1]; uVar7 = puVar1[2]; uVar8 = puVar1[3]; puVar2 = in_ECX + iVar14 * 5; *puVar2 = *puVar1; puVar2[1] = uVar6; puVar2[2] = uVar7; puVar2[3] = uVar8; in_ECX[iVar14 * 5 + 4] = in_ECX[iVar15 * 5 + 4]; iVar14 = iVar15; } puVar1 = in_ECX + iVar14 * 5; *puVar1 = local_30; puVar1[1] = uStack_2c; puVar1[2] = uStack_28; puVar1[3] = fStack_24; in_ECX[iVar14 * 5 + 4] = uVar4; puVar12 = puVar12 + -5; } while (0 < iVar10); } if ((int)uVar5 < 2) { return; } do { puVar12 = local_90 + -5; iVar10 = iVar13 / 0x14; iVar13 = (int)puVar12 - (int)in_ECX; if (1 < iVar10) { local_50 = (undefined4 *)*puVar12; puStack_4c = (undefined4 *)local_90[-4]; uStack_48 = local_90[-3]; fStack_44 = (float)local_90[-2]; local_40 = local_90[-1]; uVar4 = in_ECX[1]; uVar6 = in_ECX[2]; uVar7 = in_ECX[3]; *puVar12 = *in_ECX; local_90[-4] = uVar4; local_90[-3] = uVar6; local_90[-2] = uVar7; local_90[-1] = in_ECX[4]; FUN_006a14f0(iVar13 / 0x14,&local_50,param_2); } local_90 = puVar12; } while (0x27 < iVar13); return; } _Partition_by_median_guess_unchecked<20byte_floatkey>(local_90,param_2); param_1 = (param_1 >> 1) + (param_1 >> 2); if (((int)local_50 - (int)in_ECX) / 0x14 < ((int)local_90 - (int)puStack_4c) / 0x14) { _Sort_unchecked<20byte>(param_1,param_2); in_ECX = puStack_4c; } else { _Sort_unchecked<20byte>(param_1,param_2); local_90 = local_50; } } while (0x293 < (int)local_90 - (int)in_ECX); } if ((in_ECX != local_90) && (puVar12 = in_ECX + 5, puVar12 != local_90)) { local_8c = (int)puVar12 - (int)in_ECX; do { local_50 = (undefined4 *)*puVar12; puStack_4c = (undefined4 *)puVar12[1]; uStack_48 = puVar12[2]; fStack_44 = (float)puVar12[3]; uVar4 = puVar12[4]; if ((float)in_ECX[3] <= fStack_44) { fVar3 = *(float *)((int)in_ECX + (local_8c - 8)); puVar2 = (undefined4 *)((local_8c - 0x14) + (int)in_ECX); puVar1 = puVar12; while (puVar9 = puVar2, fStack_44 < fVar3) { uVar6 = puVar9[1]; uVar7 = puVar9[2]; uVar8 = puVar9[3]; *puVar1 = *puVar9; puVar1[1] = uVar6; puVar1[2] = uVar7; puVar1[3] = uVar8; puVar1[4] = puVar9[4]; puVar2 = puVar9 + -5; puVar1 = puVar9; fVar3 = (float)puVar9[-2]; } *puVar1 = local_50; puVar1[1] = puStack_4c; puVar1[2] = uStack_48; puVar1[3] = fStack_44; puVar1[4] = uVar4; } else { memmove((void *)((int)puVar12 + (0x14 - local_8c)),in_ECX,local_8c); *in_ECX = local_50; in_ECX[1] = puStack_4c; in_ECX[2] = uStack_48; in_ECX[3] = fStack_44; in_ECX[4] = uVar4; } puVar12 = puVar12 + 5; local_8c = local_8c + 0x14; } while (puVar12 != local_90); } return; } //@@ 006a00d0 FUN_006a00d0 void FUN_006a00d0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::map::emplace(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 006a0100 FUN_006a0100 undefined4 FUN_006a0100(int param_1,byte *param_2) { uint *puVar1; byte *b; int iVar2; if (*(char *)(param_1 + 0xd) == '\0') { b = (byte *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x24)) { b = *(byte **)b; } puVar1 = (uint *)(param_2 + 0x10); if (0xf < *(uint *)(param_2 + 0x14)) { param_2 = *(byte **)param_2; } iVar2 = string_compare(param_2,*puVar1,b,*(uint *)(param_1 + 0x20)); if (-1 < iVar2) { return 1; } } return 0; } //@@ 006a0150 std::vector<100byte>::_Resize_reallocate /* DB: grow to 0x68 elements of 100 bytes (max 0x28f5c28), FUN_0069fa70 constructs the new ones; from load_bossportraits_xml (resize to 104 bosses) */ void std::vector<100byte>::_Resize_reallocate(undefined4 param_1,undefined4 *param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; void *pvVar5; int iVar6; uint uVar7; undefined4 *puVar8; int *in_ECX; uint size; undefined4 *puVar9; undefined4 *puVar10; void *ptr; undefined4 *puVar11; iVar6 = (in_ECX[1] - *in_ECX) / 100; uVar7 = (in_ECX[2] - *in_ECX) / 100; if (0x28f5c28 - (uVar7 >> 1) < uVar7) { uVar7 = 0x28f5c28; } else { uVar7 = (uVar7 >> 1) + uVar7; if (uVar7 < 0x68) { uVar7 = 0x68; } else if (0x28f5c28 < uVar7) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar8 = _Allocate(uVar7 * 100); FUN_0069fa70(puVar8 + iVar6 * 0x19,0x68 - iVar6,*(undefined1 *)param_2); puVar1 = (undefined4 *)in_ECX[1]; puVar9 = (undefined4 *)*in_ECX; param_2 = puVar8; if (puVar9 != puVar1) { puVar10 = puVar9 + 6; puVar11 = puVar8 + 6; do { *param_2 = *puVar9; puVar11[-5] = 0; puVar9 = puVar9 + 0x19; puVar11[-1] = 0; *puVar11 = 0; uVar2 = puVar10[-4]; uVar3 = puVar10[-3]; uVar4 = puVar10[-2]; puVar11[-5] = puVar10[-5]; puVar11[-4] = uVar2; puVar11[-3] = uVar3; puVar11[-2] = uVar4; *(undefined8 *)(puVar11 + -1) = *(undefined8 *)(puVar10 + -1); puVar10[-1] = 0; *puVar10 = 0xf; *(undefined1 *)(puVar10 + -5) = 0; puVar11[1] = 0; puVar11[5] = 0; puVar11[6] = 0; uVar2 = puVar10[2]; uVar3 = puVar10[3]; uVar4 = puVar10[4]; puVar11[1] = puVar10[1]; puVar11[2] = uVar2; puVar11[3] = uVar3; puVar11[4] = uVar4; *(undefined8 *)(puVar11 + 5) = *(undefined8 *)(puVar10 + 5); puVar10[5] = 0; puVar10[6] = 0xf; *(undefined1 *)(puVar10 + 1) = 0; puVar11[7] = 0; puVar11[0xb] = 0; puVar11[0xc] = 0; uVar2 = puVar10[8]; uVar3 = puVar10[9]; uVar4 = puVar10[10]; puVar11[7] = puVar10[7]; puVar11[8] = uVar2; puVar11[9] = uVar3; puVar11[10] = uVar4; *(undefined8 *)(puVar11 + 0xb) = *(undefined8 *)(puVar10 + 0xb); puVar10[0xb] = 0; puVar10[0xc] = 0xf; *(undefined1 *)(puVar10 + 7) = 0; uVar2 = puVar10[0xd]; puVar11[0xe] = puVar10[0xe]; puVar11[0xd] = uVar2; puVar11[0xf] = puVar10[0xf]; uVar2 = puVar10[0x11]; uVar3 = puVar10[0x12]; uVar4 = puVar10[0x10]; puVar10[0x12] = 0; puVar10[0x11] = 0; puVar10[0x10] = 0; puVar11[0x11] = uVar2; param_2 = param_2 + 0x19; puVar11[0x10] = uVar4; puVar11[0x12] = uVar3; puVar10 = puVar10 + 0x19; puVar11 = puVar11 + 0x19; } while (puVar9 != puVar1); } FUN_0069f520(param_2); if (*in_ECX != 0) { FUN_0069f520(*in_ECX); pvVar5 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar5) / 100) * 100; ptr = pvVar5; if (0xfff < size) { ptr = *(void **)((int)pvVar5 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)puVar8; in_ECX[1] = (int)(puVar8 + 0xa28); in_ECX[2] = (int)(puVar8 + uVar7 * 0x19); return; } //@@ 006a03a0 FUN_006a03a0 void FUN_006a03a0(void) { int iVar1; uint uVar2; EntityConfig_Player *pEVar3; int *in_ECX; int extraout_ECX; EntityConfig_Player *pEVar4; int extraout_EDX; int iVar5; undefined *local_8; iVar1 = (in_ECX[1] - *in_ECX) / 0x148; uVar2 = (in_ECX[2] - *in_ECX) / 0x148; if ((int)&DAT_00c7ce0c - (uVar2 >> 1) < uVar2) { local_8 = &DAT_00c7ce0c; } else { local_8 = (undefined *)((uVar2 >> 1) + uVar2); if (local_8 < (undefined *)0x29) { local_8 = (undefined *)0x29; } else if (&DAT_00c7ce0c < local_8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pEVar3 = std::_Allocate((int)local_8 * 0x148); pEVar4 = pEVar3 + iVar1; if (iVar1 != 0x29) { do { EntityConfig_Player::EntityConfig_Player(pEVar4); pEVar4 = (EntityConfig_Player *)(extraout_ECX + 0x148); } while (extraout_EDX != 1); } iVar1 = in_ECX[1]; pEVar4 = pEVar3; for (iVar5 = *in_ECX; iVar5 != iVar1; iVar5 = iVar5 + 0x148) { EntityConfig_Player::EntityConfig_Player(pEVar4,iVar5); pEVar4 = pEVar4 + 1; } FUN_0069fac0(pEVar3,0x29,local_8); return; } //@@ 006a0490 std::vector<28byte>::assign /* DB: range assign of 0x1c-byte elements holding a std::string (shrink path destroys the tail with _Tidy_deallocate, grow path max 0x9249249); from load_bossportraits_xml */ void std::vector<28byte>::assign(int param_1,undefined4 *param_2) { void *pvVar1; uint uVar2; uint uVar3; int *in_ECX; uint uVar4; undefined4 *puVar5; void *pvVar6; void *pvVar7; undefined4 *puVar8; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa0ad; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar7 = (void *)*in_ECX; pvVar1 = (void *)in_ECX[1]; uVar2 = ((int)param_2 - param_1) / 0x1c; uVar4 = ((int)pvVar1 - (int)pvVar7) / 0x1c; if (uVar2 <= uVar4) { FUN_006a1350(pvVar7,uVar3); pvVar1 = (void *)in_ECX[1]; pvVar7 = (void *)((int)pvVar7 + uVar2 * 0x1c); for (pvVar6 = pvVar7; pvVar6 != pvVar1; pvVar6 = (void *)((int)pvVar6 + 0x1c)) { string::_Tidy_deallocate((char *)((int)pvVar6 + 4)); } in_ECX[1] = (int)pvVar7; ExceptionList = local_10; return; } local_14 = (in_ECX[2] - (int)pvVar7) / 0x1c; if (local_14 < uVar2) { if (0x9249249 < uVar2) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x9249249 - (local_14 >> 1) < local_14) { local_14 = 0x9249249; } else { local_14 = (local_14 >> 1) + local_14; if (local_14 < uVar2) { local_14 = uVar2; } } if (pvVar7 != (void *)0x0) { if (pvVar7 != pvVar1) { do { string::_Tidy_deallocate((char *)((int)pvVar7 + 4)); pvVar7 = (void *)((int)pvVar7 + 0x1c); } while (pvVar7 != pvVar1); pvVar7 = (void *)*in_ECX; } FUN_0069dd40(pvVar7,(in_ECX[2] - (int)pvVar7) / 0x1c); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x9249249 < local_14) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar7 = _Allocate(local_14 * 0x1c); uVar4 = 0; *in_ECX = (int)pvVar7; in_ECX[1] = (int)pvVar7; in_ECX[2] = (int)(local_14 * 0x1c + (int)pvVar7); } puVar5 = (undefined4 *)(param_1 + uVar4 * 0x1c); FUN_006a1350(pvVar7,uVar3); puVar8 = (undefined4 *)in_ECX[1]; local_8 = 0; for (; puVar5 != param_2; puVar5 = puVar5 + 7) { *puVar8 = *puVar5; string::string((char *)(puVar8 + 1),puVar5 + 1); puVar8 = puVar8 + 7; } in_ECX[1] = (int)puVar8; ExceptionList = local_10; return; } //@@ 006a06b0 FUN_006a06b0 void FUN_006a06b0(int param_1,int param_2) { void *pvVar1; uint uVar2; uint uVar3; int iVar4; int *in_ECX; void *pvVar5; void *pvVar6; uint local_8; uVar2 = (param_2 - param_1) / 0x24; pvVar1 = (void *)in_ECX[1]; pvVar5 = (void *)*in_ECX; uVar3 = ((int)pvVar1 - (int)pvVar5) / 0x24; if (uVar2 <= uVar3) { FUN_006a13b0(pvVar5); pvVar1 = (void *)in_ECX[1]; pvVar5 = (void *)((int)pvVar5 + uVar2 * 0x24); for (pvVar6 = pvVar5; pvVar6 != pvVar1; pvVar6 = (void *)((int)pvVar6 + 0x24)) { std::string::_Tidy_deallocate((char *)((int)pvVar6 + 0xc)); } in_ECX[1] = (int)pvVar5; return; } local_8 = (in_ECX[2] - (int)pvVar5) / 0x24; if (local_8 < uVar2) { if (0x71c71c7 < uVar2) { /* WARNING: Subroutine does not return */ std::_Xlen(); } if (0x71c71c7 - (local_8 >> 1) < local_8) { local_8 = 0x71c71c7; } else { local_8 = (local_8 >> 1) + local_8; if (local_8 < uVar2) { local_8 = uVar2; } } if (pvVar5 != (void *)0x0) { if (pvVar5 != pvVar1) { do { std::string::_Tidy_deallocate((char *)((int)pvVar5 + 0xc)); pvVar5 = (void *)((int)pvVar5 + 0x24); } while (pvVar5 != pvVar1); pvVar5 = (void *)*in_ECX; } deallocate(pvVar5,(in_ECX[2] - (int)pvVar5) / 0x24); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x71c71c7 < local_8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar5 = std::_Allocate(local_8 * 0x24); *in_ECX = (int)pvVar5; in_ECX[1] = (int)pvVar5; in_ECX[2] = (int)(local_8 * 0x24 + (int)pvVar5); uVar3 = 0; } FUN_006a13b0(pvVar5); iVar4 = FUN_006a0bb0(param_1 + uVar3 * 0x24,param_2,in_ECX[1]); in_ECX[1] = iVar4; return; } //@@ 006a0850 FUN_006a0850 void FUN_006a0850(int param_1,int param_2) { uint uVar1; void *pvVar2; int iVar3; int *in_ECX; uint uVar4; void *ptr; uint local_8; uVar4 = (param_2 - param_1) / 0x7c; pvVar2 = (void *)*in_ECX; if (uVar4 <= (uint)((in_ECX[1] - (int)pvVar2) / 0x7c)) { FUN_006a1420(pvVar2); FUN_0069f4e0(); in_ECX[1] = (int)(uVar4 * 0x7c + (int)pvVar2); return; } uVar1 = (in_ECX[2] - (int)pvVar2) / 0x7c; if (uVar1 < uVar4) { if (0x2108421 < uVar4) { /* WARNING: Subroutine does not return */ std::_Xlen(); } if (0x2108421 - (uVar1 >> 1) < uVar1) { local_8 = 0x2108421; } else { local_8 = (uVar1 >> 1) + uVar1; if (local_8 < uVar4) { local_8 = uVar4; } } if (pvVar2 != (void *)0x0) { FUN_0069f4e0(uVar1); pvVar2 = (void *)*in_ECX; uVar4 = ((in_ECX[2] - (int)pvVar2) / 0x7c) * 0x7c; ptr = pvVar2; if (0xfff < uVar4) { ptr = *(void **)((int)pvVar2 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x2108421 < local_8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar2 = std::_Allocate(local_8 * 0x7c); *in_ECX = (int)pvVar2; in_ECX[1] = (int)pvVar2; in_ECX[2] = (int)(local_8 * 0x7c + (int)pvVar2); } FUN_006a1420(pvVar2); iVar3 = FUN_006a0c40(in_ECX[1]); in_ECX[1] = iVar3; return; } //@@ 006a09f0 FUN_006a09f0 undefined4 * FUN_006a09f0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined8 *puVar6; undefined4 *puVar7; puVar7 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 6; puVar6 = (undefined8 *)(param_1 + 0xb); do { *puVar7 = puVar5[-6]; *(undefined4 *)(puVar6 + -5) = 0; puVar7 = puVar7 + 0xe; *(undefined4 *)(puVar6 + -3) = 0; *(undefined4 *)((int)param_1 + (-0x38 - (int)in_ECX) + (int)(puVar5 + 0xe)) = 0; uVar2 = puVar5[-4]; uVar3 = puVar5[-3]; uVar4 = puVar5[-2]; *(undefined4 *)(puVar6 + -5) = puVar5[-5]; *(undefined4 *)((int)puVar6 + -0x24) = uVar2; *(undefined4 *)(puVar6 + -4) = uVar3; *(undefined4 *)((int)puVar6 + -0x1c) = uVar4; puVar6[-3] = *(undefined8 *)(puVar5 + -1); puVar5[-1] = 0; *puVar5 = 0xf; *(undefined1 *)(puVar5 + -5) = 0; *(undefined4 *)(puVar6 + -2) = 0; *(undefined4 *)puVar6 = 0; *(undefined4 *)((int)puVar6 + 4) = 0; uVar2 = puVar5[2]; uVar3 = puVar5[3]; uVar4 = puVar5[4]; *(undefined4 *)(puVar6 + -2) = puVar5[1]; *(undefined4 *)((int)puVar6 + -0xc) = uVar2; *(undefined4 *)(puVar6 + -1) = uVar3; *(undefined4 *)((int)puVar6 + -4) = uVar4; *puVar6 = *(undefined8 *)(puVar5 + 5); puVar5[5] = 0; puVar5[6] = 0xf; *(undefined1 *)(puVar5 + 1) = 0; *(undefined4 *)(puVar6 + 1) = puVar5[7]; puVar1 = puVar5 + 8; puVar5 = puVar5 + 0xe; puVar6 = puVar6 + 7; } while (puVar1 != in_EDX); } return puVar7; } //@@ 006a0ab0 FUN_006a0ab0 undefined4 * FUN_006a0ab0(undefined4 *param_1) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar7; undefined4 *puVar8; undefined4 *puVar9; puVar8 = param_1; if (in_ECX != in_EDX) { puVar7 = in_ECX + 1; puVar9 = param_1 + 6; do { puVar1 = puVar7 + 7; *puVar8 = puVar7[-1]; puVar2 = puVar7 + 6; *(undefined4 *)((int)param_1 + (-0x1c - (int)in_ECX) + (int)puVar1) = 0; puVar9[-1] = 0; puVar8 = puVar8 + 7; *puVar9 = 0; uVar4 = puVar7[1]; uVar5 = puVar7[2]; uVar6 = puVar7[3]; puVar3 = (undefined4 *)((int)param_1 + (-0x1c - (int)in_ECX) + (int)puVar1); *puVar3 = *puVar7; puVar3[1] = uVar4; puVar3[2] = uVar5; puVar3[3] = uVar6; *(undefined8 *)((int)param_1 + (-0xc - (int)in_ECX) + (int)puVar1) = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; puVar7 = puVar1; puVar9 = puVar9 + 7; } while (puVar2 != in_EDX); } return puVar8; } //@@ 006a0b30 FUN_006a0b30 undefined4 * FUN_006a0b30(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 8; do { *puVar6 = puVar5[-8]; puVar1 = puVar5 + 1; puVar6[1] = puVar5[-7]; puVar6[2] = puVar5[-6]; puVar6[3] = 0; puVar6[7] = 0; *(undefined4 *)((int)param_1 + (-0x24 - (int)in_ECX) + (int)(puVar5 + 9)) = 0; uVar2 = puVar5[-4]; uVar3 = puVar5[-3]; uVar4 = puVar5[-2]; puVar6[3] = puVar5[-5]; puVar6[4] = uVar2; puVar6[5] = uVar3; puVar6[6] = uVar4; *(undefined8 *)(puVar6 + 7) = *(undefined8 *)(puVar5 + -1); puVar6 = puVar6 + 9; puVar5[-1] = 0; *puVar5 = 0xf; *(undefined1 *)(puVar5 + -5) = 0; puVar5 = puVar5 + 9; } while (puVar1 != in_EDX); } return puVar6; } //@@ 006a0bb0 FUN_006a0bb0 undefined4 * FUN_006a0bb0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afa0dd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (param_1 != param_2) { puVar2 = param_1 + 2; do { *param_3 = puVar2[-2]; param_3[1] = puVar2[-1]; param_3[2] = *puVar2; std::string::string((char *)(param_3 + 3),puVar2 + 1); param_3 = param_3 + 9; puVar1 = puVar2 + 7; puVar2 = puVar2 + 9; } while (puVar1 != param_2); } ExceptionList = local_10; return param_3; } //@@ 006a0c40 FUN_006a0c40 Color * FUN_006a0c40(Color *param_1) { void *pvVar1; void **ppvVar2; uint uVar3; void *in_ECX; void *extraout_ECX; void *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afa10d; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar2 = &local_10; pvVar1 = in_ECX; local_10 = ExceptionList; for (; ExceptionList = ppvVar2, in_ECX != in_EDX; in_ECX = (void *)((int)in_ECX + 0x7c)) { Color::copy_constructor_ext(param_1,in_ECX); param_1 = (Color *)(param_1[2]._offset + 1); ppvVar2 = ExceptionList; pvVar1 = extraout_ECX; } FUN_0069f4e0(pvVar1,uVar3); ExceptionList = local_10; return param_1; } //@@ 006a0cc0 FUN_006a0cc0 void FUN_006a0cc0(void) { FUN_0069f4e0(); return; } //@@ 006a0cd0 FUN_006a0cd0 void FUN_006a0cd0(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; for (iVar2 = *in_ECX; iVar2 != iVar1; iVar2 = iVar2 + 0x24) { std::string::_Tidy_deallocate((char *)(iVar2 + 0xc)); } return; } //@@ 006a0d00 FUN_006a0d00 void FUN_006a0d00(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; for (iVar2 = *in_ECX; iVar2 != iVar1; iVar2 = iVar2 + 0x1c) { std::string::_Tidy_deallocate((char *)(iVar2 + 4)); } return; } //@@ 006a0d30 std::vector::reserve_clear /* DB: vector reallocate (clears and allocates capacity) */ void std::vector::reserve_clear(uint param_1) { void *pvVar1; undefined4 *in_ECX; uint count; uint uVar2; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } pvVar1 = (void *)*in_ECX; count = in_ECX[2] - (int)pvVar1 >> 2; if (0x3fffffff - (count >> 1) < count) { uVar2 = 0x3fffffff; } else { uVar2 = (count >> 1) + count; if (uVar2 < param_1) { uVar2 = param_1; } } if (pvVar1 != (void *)0x0) { deallocate(pvVar1,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x3fffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar1 = _Allocate(uVar2 * 4); *in_ECX = pvVar1; in_ECX[1] = pvVar1; in_ECX[2] = (void *)((int)pvVar1 + uVar2 * 4); return; } //@@ 006a0dc0 FUN_006a0dc0 void FUN_006a0dc0(uint param_1) { uint count; void *pvVar1; int *in_ECX; uint uVar2; if (0x15555555 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } count = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (count >> 1) < count) { uVar2 = 0x15555555; } else { uVar2 = (count >> 1) + count; if (uVar2 < param_1) { uVar2 = param_1; } } if ((void *)*in_ECX != (void *)0x0) { deallocate((void *)*in_ECX,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x15555555 < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar1 = std::_Allocate(uVar2 * 0xc); *in_ECX = (int)pvVar1; in_ECX[1] = (int)pvVar1; in_ECX[2] = (int)((int)pvVar1 + uVar2 * 0xc); return; } //@@ 006a0e60 std::_Partition_by_median_guess_unchecked<20byte_floatkey> /* DB: MSVC std::sort partition: stride 0x14, _Guess_median_unchecked via FUN_006a1e00 (ninther when >40 elements), equal-range on float at +0xc; only caller FUN_0069fd80 (= std::_Sort_unchecked<20byte_floatkey>, loops while >32 elements, then halves ideal) */ void std::_Partition_by_median_guess_unchecked<20byte_floatkey> (undefined4 *param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; int iVar9; undefined4 *puVar10; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 extraout_EDX; undefined4 *puVar11; undefined4 *puVar12; undefined4 *puVar13; undefined4 *puVar14; undefined4 *puVar15; puVar13 = param_1 + -5; puVar12 = in_EDX + (((int)param_1 - (int)in_EDX) / 0x14 >> 1) * 5; iVar9 = ((int)puVar13 - (int)in_EDX) / 0x14; if (iVar9 < 0x29) { FUN_006a1e00(puVar13,param_2); } else { iVar9 = iVar9 + 1 >> 3; FUN_006a1e00(in_EDX + iVar9 * 10,param_2); FUN_006a1e00(puVar12 + iVar9 * 5,param_2); FUN_006a1e00(puVar13,param_2); FUN_006a1e00(extraout_EDX,param_2); } puVar13 = puVar12 + 5; for (; in_EDX < puVar12; puVar12 = puVar12 + -5) { if (((float)puVar12[-2] < (float)puVar12[3]) || ((float)puVar12[3] < (float)puVar12[-2])) break; } puVar14 = puVar13; param_2 = puVar12; if (puVar13 < param_1) { do { puVar14 = puVar13; if (((float)puVar13[3] < (float)puVar12[3]) || ((float)puVar12[3] < (float)puVar13[3])) break; puVar13 = puVar13 + 5; puVar14 = puVar13; } while (puVar13 < param_1); } joined_r0x006a0f82: do { if (param_1 <= puVar13) { LAB_006a0fd3: if (in_EDX < param_2) { puVar11 = puVar12; puVar10 = param_2; do { puVar15 = puVar10 + -5; puVar12 = puVar11; if ((float)puVar11[3] <= (float)puVar10[-2]) { if ((float)puVar11[3] < (float)puVar10[-2]) break; puVar12 = puVar11 + -5; if (puVar12 != puVar15) { uVar2 = puVar10[-4]; uVar3 = puVar10[-3]; uVar4 = puVar10[-2]; uVar1 = puVar11[-1]; uVar5 = *puVar12; uVar6 = puVar11[-4]; uVar7 = puVar11[-3]; uVar8 = puVar11[-2]; *puVar12 = *puVar15; puVar11[-4] = uVar2; puVar11[-3] = uVar3; puVar11[-2] = uVar4; puVar11[-1] = puVar10[-1]; *puVar15 = uVar5; puVar10[-4] = uVar6; puVar10[-3] = uVar7; puVar10[-2] = uVar8; puVar10[-1] = uVar1; } } param_2 = param_2 + -5; puVar11 = puVar12; puVar10 = puVar15; } while (in_EDX < param_2); } if (param_2 == in_EDX) { if (puVar13 == param_1) { in_ECX[1] = puVar14; *in_ECX = puVar12; return; } if (puVar14 != puVar13) { uVar2 = puVar14[1]; uVar3 = puVar14[2]; uVar4 = puVar14[3]; uVar1 = puVar12[4]; uVar5 = *puVar12; uVar6 = puVar12[1]; uVar7 = puVar12[2]; uVar8 = puVar12[3]; *puVar12 = *puVar14; puVar12[1] = uVar2; puVar12[2] = uVar3; puVar12[3] = uVar4; puVar12[4] = puVar14[4]; *puVar14 = uVar5; puVar14[1] = uVar6; puVar14[2] = uVar7; puVar14[3] = uVar8; puVar14[4] = uVar1; } uVar2 = puVar13[1]; uVar3 = puVar13[2]; uVar4 = puVar13[3]; uVar1 = puVar12[4]; uVar5 = *puVar12; uVar6 = puVar12[1]; uVar7 = puVar12[2]; uVar8 = puVar12[3]; *puVar12 = *puVar13; puVar12[1] = uVar2; puVar12[2] = uVar3; puVar12[3] = uVar4; puVar12[4] = puVar13[4]; *puVar13 = uVar5; puVar13[1] = uVar6; puVar13[2] = uVar7; puVar13[3] = uVar8; puVar13[4] = uVar1; puVar13 = puVar13 + 5; puVar14 = puVar14 + 5; puVar12 = puVar12 + 5; } else { puVar10 = param_2 + -5; if (puVar13 == param_1) { puVar11 = puVar12 + -5; if (puVar10 != puVar11) { uVar2 = puVar12[-4]; uVar3 = puVar12[-3]; uVar4 = puVar12[-2]; uVar1 = param_2[-1]; uVar5 = *puVar10; uVar6 = param_2[-4]; uVar7 = param_2[-3]; uVar8 = param_2[-2]; *puVar10 = *puVar11; param_2[-4] = uVar2; param_2[-3] = uVar3; param_2[-2] = uVar4; param_2[-1] = puVar12[-1]; *puVar11 = uVar5; puVar12[-4] = uVar6; puVar12[-3] = uVar7; puVar12[-2] = uVar8; puVar12[-1] = uVar1; } uVar2 = puVar14[-4]; uVar3 = puVar14[-3]; uVar4 = puVar14[-2]; uVar1 = puVar12[-1]; uVar5 = *puVar11; uVar6 = puVar12[-4]; uVar7 = puVar12[-3]; uVar8 = puVar12[-2]; *puVar11 = puVar14[-5]; puVar12[-4] = uVar2; puVar12[-3] = uVar3; puVar12[-2] = uVar4; puVar12[-1] = puVar14[-1]; puVar14[-5] = uVar5; puVar14[-4] = uVar6; puVar14[-3] = uVar7; puVar14[-2] = uVar8; puVar14[-1] = uVar1; puVar14 = puVar14 + -5; param_2 = puVar10; puVar12 = puVar11; } else { uVar2 = param_2[-4]; uVar3 = param_2[-3]; uVar4 = param_2[-2]; uVar1 = puVar13[4]; uVar5 = *puVar13; uVar6 = puVar13[1]; uVar7 = puVar13[2]; uVar8 = puVar13[3]; *puVar13 = *puVar10; puVar13[1] = uVar2; puVar13[2] = uVar3; puVar13[3] = uVar4; puVar13[4] = param_2[-1]; puVar13 = puVar13 + 5; *puVar10 = uVar5; param_2[-4] = uVar6; param_2[-3] = uVar7; param_2[-2] = uVar8; param_2[-1] = uVar1; param_2 = puVar10; } } goto joined_r0x006a0f82; } if ((float)puVar13[3] <= (float)puVar12[3]) { if ((float)puVar13[3] < (float)puVar12[3]) goto LAB_006a0fd3; if (puVar14 != puVar13) { uVar2 = puVar13[1]; uVar3 = puVar13[2]; uVar4 = puVar13[3]; uVar1 = puVar14[4]; uVar5 = *puVar14; uVar6 = puVar14[1]; uVar7 = puVar14[2]; uVar8 = puVar14[3]; *puVar14 = *puVar13; puVar14[1] = uVar2; puVar14[2] = uVar3; puVar14[3] = uVar4; puVar14[4] = puVar13[4]; *puVar13 = uVar5; puVar13[1] = uVar6; puVar13[2] = uVar7; puVar13[3] = uVar8; puVar13[4] = uVar1; } puVar14 = puVar14 + 5; } puVar13 = puVar13 + 5; } while( true ); } //@@ 006a1110 std::map::emplace /* DB: MSVC _Tree: std::map::_Find_lower_bound + string_compare, else new 0x2c node (16 header + moved std::string + 4-byte value), max_size 0x5d1745d; wrapper FUN_006a00d0 (pair) used by Menu_Mods::Update */ void std::map::emplace(undefined4 *param_1,byte *param_2) { int *piVar1; int iVar2; int iVar3; int iVar4; uint uVar5; undefined8 *puVar6; byte *b; int iVar7; int *in_ECX; byte *a; int *piVar8; int *piVar9; undefined1 local_44 [12]; undefined8 local_38; int *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_44 + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00afa13d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_44 + 0x34); ExceptionList = &local_1c; puVar6 = (undefined8 *)string>::_Find_lower_bound(local_44,param_2); local_38 = *puVar6; local_24 = *(int **)(puVar6 + 1); if (*(char *)((int)local_24 + 0xd) == '\0') { b = (byte *)(local_24 + 4); if (0xf < (uint)local_24[9]) { b = *(byte **)b; } a = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { a = *(byte **)param_2; } iVar7 = string_compare(a,*(uint *)(param_2 + 0x10),b,local_24[8]); if (-1 < iVar7) { *(undefined1 *)(param_1 + 1) = 0; goto LAB_006a1325; } } if (in_ECX[1] == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar7 = *in_ECX; local_14 = 0; local_28 = (int *)0x0; local_24 = operator_new(0x2c); local_24[4] = 0; local_24[8] = 0; local_24[9] = 0; iVar2 = *(int *)(param_2 + 4); iVar3 = *(int *)(param_2 + 8); iVar4 = *(int *)(param_2 + 0xc); local_24[4] = *(int *)param_2; local_24[5] = iVar2; local_24[6] = iVar3; local_24[7] = iVar4; *(undefined8 *)(local_24 + 8) = *(undefined8 *)(param_2 + 0x10); param_2[0x10] = 0; param_2[0x11] = 0; param_2[0x12] = 0; param_2[0x13] = 0; param_2[0x14] = 0xf; param_2[0x15] = 0; param_2[0x16] = 0; param_2[0x17] = 0; *param_2 = 0; local_24[10] = *(int *)(param_2 + 0x18); *local_24 = iVar7; local_24[1] = iVar7; local_24[2] = iVar7; *(undefined2 *)(local_24 + 3) = 0; local_28 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; local_24[1] = (int)(int *)local_38; if ((int *)local_38 == local_28) { *local_28 = (int)local_24; local_28[1] = (int)local_24; local_28[2] = (int)local_24; *(undefined1 *)(local_24 + 3) = 1; } else { if (local_38._4_4_ == 0) { ((int *)local_38)[2] = (int)local_24; if ((int *)local_38 == (int *)local_28[2]) { local_28[2] = (int)local_24; } } else { *(int *)local_38 = (int)local_24; if ((int *)local_38 == (int *)*local_28) { *local_28 = (int)local_24; } } piVar9 = local_24; if (*(char *)(local_24[1] + 0xc) == '\0') { do { piVar1 = (int *)piVar9[1]; piVar8 = *(int **)piVar1[1]; if (piVar1 == piVar8) { piVar8 = (int *)((undefined4 *)piVar1[1])[2]; if ((char)piVar8[3] == '\0') goto LAB_006a12be; if (piVar9 == (int *)piVar1[2]) { FUN_00415fe0(piVar1); piVar9 = piVar1; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar9[1] + 4)); } else if ((char)piVar8[3] == '\0') { LAB_006a12be: *(undefined1 *)(piVar1 + 3) = 1; *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; piVar9 = *(int **)(piVar9[1] + 4); } else { if (piVar9 == (int *)*piVar1) { FUN_00415f80(piVar1); piVar9 = piVar1; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar9[1] + 4)); } } while (*(char *)(piVar9[1] + 0xc) == '\0'); } *(undefined1 *)(local_28[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; LAB_006a1325: *param_1 = local_24; ExceptionList = local_1c; return; } //@@ 006a1350 FUN_006a1350 undefined4 * FUN_006a1350(undefined4 *param_1) { byte *pbVar1; byte *in_ECX; byte *in_EDX; byte *pbVar2; byte *this; if (in_ECX == in_EDX) { return param_1; } this = (byte *)(param_1 + 1); pbVar2 = in_ECX + 4; do { *param_1 = *(undefined4 *)(pbVar2 + -4); if (this != pbVar2) { pbVar1 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar1 = *(byte **)pbVar2; } std::string::assign((char *)this,pbVar1,*(uint *)(pbVar2 + 0x10)); } param_1 = param_1 + 7; this = this + 0x1c; pbVar1 = pbVar2 + 0x18; pbVar2 = pbVar2 + 0x1c; } while (pbVar1 != in_EDX); return param_1; } //@@ 006a13b0 FUN_006a13b0 uint * FUN_006a13b0(uint *param_1) { uint *puVar1; uint *in_ECX; uint *in_EDX; uint *puVar2; uint *this; if (in_ECX == in_EDX) { return param_1; } this = param_1 + 3; puVar2 = in_ECX + 8; do { *param_1 = puVar2[-8]; this[-2] = puVar2[-7]; this[-1] = puVar2[-6]; if (this != puVar2 + -5) { puVar1 = puVar2 + -5; if (0xf < *puVar2) { puVar1 = (uint *)*puVar1; } std::string::assign((char *)this,(byte *)puVar1,puVar2[-1]); } param_1 = param_1 + 9; this = this + 9; puVar1 = puVar2 + 1; puVar2 = puVar2 + 9; } while (puVar1 != in_EDX); return param_1; } //@@ 006a1420 FUN_006a1420 uint * FUN_006a1420(uint *param_1) { uint uVar1; uint uVar2; uint uVar3; uint *puVar4; uint *in_ECX; uint *in_EDX; uint *puVar5; uint *this; if (in_ECX == in_EDX) { return param_1; } this = param_1 + 0xb; puVar5 = in_ECX + 0x10; do { if (param_1 != puVar5 + -0x10) { uVar1 = puVar5[-0xf]; uVar2 = puVar5[-0xe]; uVar3 = puVar5[-0xd]; *param_1 = puVar5[-0x10]; param_1[1] = uVar1; param_1[2] = uVar2; param_1[3] = uVar3; uVar1 = puVar5[-0xb]; uVar2 = puVar5[-10]; uVar3 = puVar5[-9]; this[-7] = puVar5[-0xc]; this[-6] = uVar1; this[-5] = uVar2; this[-4] = uVar3; uVar1 = puVar5[-7]; this[-3] = puVar5[-8]; this[-2] = uVar1; this[-1] = puVar5[-6]; } if (this != puVar5 + -5) { puVar4 = puVar5 + -5; if (0xf < *puVar5) { puVar4 = (uint *)*puVar4; } std::string::assign((char *)this,(byte *)puVar4,puVar5[-1]); } puVar4 = puVar5 + 1; if (this + 6 != puVar4) { if (0xf < puVar5[6]) { puVar4 = (uint *)*puVar4; } std::string::assign((char *)(this + 6),(byte *)puVar4,puVar5[5]); } puVar4 = puVar5 + 7; if (this + 0xc != puVar4) { if (0xf < puVar5[0xc]) { puVar4 = (uint *)*puVar4; } std::string::assign((char *)(this + 0xc),(byte *)puVar4,puVar5[0xb]); } param_1 = param_1 + 0x1f; this[0x12] = puVar5[0xd]; this[0x13] = puVar5[0xe]; this = this + 0x1f; puVar4 = puVar5 + 0xf; puVar5 = puVar5 + 0x1f; } while (puVar4 != in_EDX); return param_1; } //@@ 006a14f0 FUN_006a14f0 void FUN_006a14f0(uint param_1,undefined4 *param_2) { undefined4 *puVar1; undefined4 *puVar2; float *pfVar3; float fVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; int in_ECX; int in_EDX; int iVar8; int iVar9; int iVar10; iVar10 = (int)(param_1 - 1) >> 1; iVar9 = in_EDX; iVar8 = in_EDX; if (in_EDX < iVar10) { do { fVar4 = *(float *)(in_ECX + 0x20 + iVar9 * 0x28); pfVar3 = (float *)(in_ECX + 0x34 + iVar9 * 0x28); iVar8 = (uint)(fVar4 < *pfVar3 || fVar4 == *pfVar3) + iVar9 * 2 + 1; puVar1 = (undefined4 *)(in_ECX + iVar8 * 0x14); uVar5 = puVar1[1]; uVar6 = puVar1[2]; uVar7 = puVar1[3]; puVar2 = (undefined4 *)(in_ECX + iVar9 * 0x14); *puVar2 = *puVar1; puVar2[1] = uVar5; puVar2[2] = uVar6; puVar2[3] = uVar7; *(undefined4 *)(in_ECX + 0x10 + iVar9 * 0x14) = *(undefined4 *)(in_ECX + 0x10 + iVar8 * 0x14); iVar9 = iVar8; } while (iVar8 < iVar10); } if ((iVar8 == iVar10) && ((param_1 & 1) == 0)) { puVar2 = (undefined4 *)(in_ECX + -0x14 + param_1 * 0x14); uVar5 = puVar2[1]; uVar6 = puVar2[2]; uVar7 = puVar2[3]; puVar1 = (undefined4 *)(in_ECX + iVar8 * 0x14); *puVar1 = *puVar2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; *(undefined4 *)(in_ECX + 0x10 + iVar8 * 0x14) = *(undefined4 *)(in_ECX + -4 + param_1 * 0x14); iVar8 = param_1 - 1; } while ((in_EDX < iVar8 && (iVar9 = iVar8 + -1 >> 1, pfVar3 = (float *)(in_ECX + 0xc + iVar9 * 0x14), *pfVar3 <= (float)param_2[3] && (float)param_2[3] != *pfVar3))) { puVar1 = (undefined4 *)(in_ECX + iVar9 * 0x14); uVar5 = puVar1[1]; uVar6 = puVar1[2]; uVar7 = puVar1[3]; puVar2 = (undefined4 *)(in_ECX + iVar8 * 0x14); *puVar2 = *puVar1; puVar2[1] = uVar5; puVar2[2] = uVar6; puVar2[3] = uVar7; *(undefined4 *)(in_ECX + 0x10 + iVar8 * 0x14) = *(undefined4 *)(in_ECX + 0x10 + iVar9 * 0x14); iVar8 = iVar9; } uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; puVar1 = (undefined4 *)(in_ECX + iVar8 * 0x14); *puVar1 = *param_2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; *(undefined4 *)(in_ECX + 0x10 + iVar8 * 0x14) = param_2[4]; return; } //@@ 006a15c0 EntityConfig_Entity::move_constructor /* DB: ? moves a 0x168-byte record (strings reset to SSO 0/0xf, vectors stolen); only from the vector realloc FUN_0069deb0/FUN_0069fa30 (0x168 stride, filled by FUN_00694f00, same element as std::vector::_Tidy 0069d5a0) prototype: db/protos.zhl, confirmed by RET 4 */ EntityConfig_Entity * __thiscall EntityConfig_Entity::move_constructor(EntityConfig_Entity *this,EntityConfig_Entity *other) { float fVar1; void *pvVar2; void *pvVar3; void *pvVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; uint uVar8; this->id = other->id; this->variant = other->variant; this->subtype = other->subtype; (this->name)._buf[0] = '\0'; (this->name)._buf[1] = '\0'; (this->name)._buf[2] = '\0'; (this->name)._buf[3] = '\0'; (this->name)._size = 0; (this->name)._capacity = 0; uVar5 = *(undefined4 *)((other->name)._buf + 4); uVar6 = *(undefined4 *)((other->name)._buf + 8); uVar7 = *(undefined4 *)((other->name)._buf + 0xc); *(undefined4 *)(this->name)._buf = *(undefined4 *)(other->name)._buf; *(undefined4 *)((this->name)._buf + 4) = uVar5; *(undefined4 *)((this->name)._buf + 8) = uVar6; *(undefined4 *)((this->name)._buf + 0xc) = uVar7; uVar8 = (other->name)._capacity; (this->name)._size = (other->name)._size; (this->name)._capacity = uVar8; (other->name)._size = 0; (other->name)._capacity = 0xf; (other->name)._buf[0] = '\0'; this->shadowSize = other->shadowSize; this->collisionDamage = other->collisionDamage; this->isBoss = other->isBoss; this->bossID = other->bossID; this->canBeChampion = other->canBeChampion; this->collisionRadius = other->collisionRadius; fVar1 = (other->collisionRadiusMulti).y; (this->collisionRadiusMulti).x = (other->collisionRadiusMulti).x; (this->collisionRadiusMulti).y = fVar1; this->mass = other->mass; this->gridCollisionPoints = other->gridCollisionPoints; this->friction = other->friction; this->baseHP = other->baseHP; this->stageHP = other->stageHP; this->shutDoors = other->shutDoors; this->gibsAmount = other->gibsAmount; this->gibFlags = other->gibFlags; this->portrait = other->portrait; pvVar2 = (other->_bossColors)._capacity; pvVar3 = (other->_bossColors)._end; pvVar4 = (other->_bossColors)._begin; (other->_bossColors)._capacity = (void *)0x0; (other->_bossColors)._end = (void *)0x0; (other->_bossColors)._begin = (void *)0x0; (this->_bossColors)._begin = pvVar4; (this->_bossColors)._end = pvVar3; (this->_bossColors)._capacity = pvVar2; (this->anm2Path)._buf[0] = '\0'; (this->anm2Path)._buf[1] = '\0'; (this->anm2Path)._buf[2] = '\0'; (this->anm2Path)._buf[3] = '\0'; (this->anm2Path)._size = 0; (this->anm2Path)._capacity = 0; uVar5 = *(undefined4 *)((other->anm2Path)._buf + 4); uVar6 = *(undefined4 *)((other->anm2Path)._buf + 8); uVar7 = *(undefined4 *)((other->anm2Path)._buf + 0xc); *(undefined4 *)(this->anm2Path)._buf = *(undefined4 *)(other->anm2Path)._buf; *(undefined4 *)((this->anm2Path)._buf + 4) = uVar5; *(undefined4 *)((this->anm2Path)._buf + 8) = uVar6; *(undefined4 *)((this->anm2Path)._buf + 0xc) = uVar7; uVar8 = (other->anm2Path)._capacity; (this->anm2Path)._size = (other->anm2Path)._size; (this->anm2Path)._capacity = uVar8; (other->anm2Path)._size = 0; (other->anm2Path)._capacity = 0xf; (other->anm2Path)._buf[0] = '\0'; uVar5 = *(undefined4 *)&other->field_0x94; uVar6 = *(undefined4 *)&other->field_0x90; uVar7 = *(undefined4 *)&other->field_0x8c; *(undefined4 *)&other->field_0x94 = 0; *(undefined4 *)&other->field_0x90 = 0; *(undefined4 *)&other->field_0x8c = 0; *(undefined4 *)&this->field_0x8c = uVar7; *(undefined4 *)&this->field_0x90 = uVar6; *(undefined4 *)&this->field_0x94 = uVar5; pvVar2 = (other->preloadSounds)._capacity; pvVar3 = (other->preloadSounds)._end; pvVar4 = (other->preloadSounds)._begin; (other->preloadSounds)._capacity = (void *)0x0; (other->preloadSounds)._end = (void *)0x0; (other->preloadSounds)._begin = (void *)0x0; (this->preloadSounds)._begin = pvVar4; (this->preloadSounds)._end = pvVar3; (this->preloadSounds)._capacity = pvVar2; pvVar2 = (other->devolve)._end; pvVar3 = (other->devolve)._begin; pvVar4 = (other->devolve)._capacity; (other->devolve)._capacity = (void *)0x0; (other->devolve)._end = (void *)0x0; (other->devolve)._begin = (void *)0x0; (this->devolve)._begin = pvVar3; (this->devolve)._end = pvVar2; (this->devolve)._capacity = pvVar4; this->isPreloaded = other->isPreloaded; (this->gridCollisionClassString)._buf[0] = '\0'; (this->gridCollisionClassString)._buf[1] = '\0'; (this->gridCollisionClassString)._buf[2] = '\0'; (this->gridCollisionClassString)._buf[3] = '\0'; (this->gridCollisionClassString)._size = 0; (this->gridCollisionClassString)._capacity = 0; uVar5 = *(undefined4 *)((other->gridCollisionClassString)._buf + 4); uVar6 = *(undefined4 *)((other->gridCollisionClassString)._buf + 8); uVar7 = *(undefined4 *)((other->gridCollisionClassString)._buf + 0xc); *(undefined4 *)(this->gridCollisionClassString)._buf = *(undefined4 *)(other->gridCollisionClassString)._buf; *(undefined4 *)((this->gridCollisionClassString)._buf + 4) = uVar5; *(undefined4 *)((this->gridCollisionClassString)._buf + 8) = uVar6; *(undefined4 *)((this->gridCollisionClassString)._buf + 0xc) = uVar7; uVar8 = (other->gridCollisionClassString)._capacity; (this->gridCollisionClassString)._size = (other->gridCollisionClassString)._size; (this->gridCollisionClassString)._capacity = uVar8; (other->gridCollisionClassString)._size = 0; (other->gridCollisionClassString)._capacity = 0xf; (other->gridCollisionClassString)._buf[0] = '\0'; this->reroll = other->reroll; this->hasFloorAlts = other->hasFloorAlts; this->collisionInterval = other->collisionInterval; uVar5 = *(undefined4 *)&other->field_0xdc; this->tags = other->tags; *(undefined4 *)&this->field_0xdc = uVar5; this->shieldStrength = other->shieldStrength; this->shieldFrames = other->shieldFrames; this->bestiary = other->bestiary; fVar1 = (other->bestiaryOffset).y; (this->bestiaryOffset).x = (other->bestiaryOffset).x; (this->bestiaryOffset).y = fVar1; this->bestiaryScale = other->bestiaryScale; (this->bestiaryAnm2Path)._buf[0] = '\0'; (this->bestiaryAnm2Path)._buf[1] = '\0'; (this->bestiaryAnm2Path)._buf[2] = '\0'; (this->bestiaryAnm2Path)._buf[3] = '\0'; (this->bestiaryAnm2Path)._size = 0; (this->bestiaryAnm2Path)._capacity = 0; uVar5 = *(undefined4 *)((other->bestiaryAnm2Path)._buf + 4); uVar6 = *(undefined4 *)((other->bestiaryAnm2Path)._buf + 8); uVar7 = *(undefined4 *)((other->bestiaryAnm2Path)._buf + 0xc); *(undefined4 *)(this->bestiaryAnm2Path)._buf = *(undefined4 *)(other->bestiaryAnm2Path)._buf; *(undefined4 *)((this->bestiaryAnm2Path)._buf + 4) = uVar5; *(undefined4 *)((this->bestiaryAnm2Path)._buf + 8) = uVar6; *(undefined4 *)((this->bestiaryAnm2Path)._buf + 0xc) = uVar7; uVar8 = (other->bestiaryAnm2Path)._capacity; (this->bestiaryAnm2Path)._size = (other->bestiaryAnm2Path)._size; (this->bestiaryAnm2Path)._capacity = uVar8; (other->bestiaryAnm2Path)._size = 0; (other->bestiaryAnm2Path)._capacity = 0xf; (other->bestiaryAnm2Path)._buf[0] = '\0'; (this->bestiaryAnim)._buf[0] = '\0'; (this->bestiaryAnim)._buf[1] = '\0'; (this->bestiaryAnim)._buf[2] = '\0'; (this->bestiaryAnim)._buf[3] = '\0'; (this->bestiaryAnim)._size = 0; (this->bestiaryAnim)._capacity = 0; uVar5 = *(undefined4 *)((other->bestiaryAnim)._buf + 4); uVar6 = *(undefined4 *)((other->bestiaryAnim)._buf + 8); uVar7 = *(undefined4 *)((other->bestiaryAnim)._buf + 0xc); *(undefined4 *)(this->bestiaryAnim)._buf = *(undefined4 *)(other->bestiaryAnim)._buf; *(undefined4 *)((this->bestiaryAnim)._buf + 4) = uVar5; *(undefined4 *)((this->bestiaryAnim)._buf + 8) = uVar6; *(undefined4 *)((this->bestiaryAnim)._buf + 0xc) = uVar7; uVar8 = (other->bestiaryAnim)._capacity; (this->bestiaryAnim)._size = (other->bestiaryAnim)._size; (this->bestiaryAnim)._capacity = uVar8; (other->bestiaryAnim)._size = 0; (other->bestiaryAnim)._capacity = 0xf; (other->bestiaryAnim)._buf[0] = '\0'; (this->bestiaryOverlay)._buf[0] = '\0'; (this->bestiaryOverlay)._buf[1] = '\0'; (this->bestiaryOverlay)._buf[2] = '\0'; (this->bestiaryOverlay)._buf[3] = '\0'; (this->bestiaryOverlay)._size = 0; (this->bestiaryOverlay)._capacity = 0; uVar5 = *(undefined4 *)((other->bestiaryOverlay)._buf + 4); uVar6 = *(undefined4 *)((other->bestiaryOverlay)._buf + 8); uVar7 = *(undefined4 *)((other->bestiaryOverlay)._buf + 0xc); *(undefined4 *)(this->bestiaryOverlay)._buf = *(undefined4 *)(other->bestiaryOverlay)._buf; *(undefined4 *)((this->bestiaryOverlay)._buf + 4) = uVar5; *(undefined4 *)((this->bestiaryOverlay)._buf + 8) = uVar6; *(undefined4 *)((this->bestiaryOverlay)._buf + 0xc) = uVar7; uVar8 = (other->bestiaryOverlay)._capacity; (this->bestiaryOverlay)._size = (other->bestiaryOverlay)._size; (this->bestiaryOverlay)._capacity = uVar8; (other->bestiaryOverlay)._size = 0; (other->bestiaryOverlay)._capacity = 0xf; (other->bestiaryOverlay)._buf[0] = '\0'; (this->bestiaryFloorAlt)._buf[0] = '\0'; (this->bestiaryFloorAlt)._buf[1] = '\0'; (this->bestiaryFloorAlt)._buf[2] = '\0'; (this->bestiaryFloorAlt)._buf[3] = '\0'; (this->bestiaryFloorAlt)._size = 0; (this->bestiaryFloorAlt)._capacity = 0; uVar5 = *(undefined4 *)((other->bestiaryFloorAlt)._buf + 4); uVar6 = *(undefined4 *)((other->bestiaryFloorAlt)._buf + 8); uVar7 = *(undefined4 *)((other->bestiaryFloorAlt)._buf + 0xc); *(undefined4 *)(this->bestiaryFloorAlt)._buf = *(undefined4 *)(other->bestiaryFloorAlt)._buf; *(undefined4 *)((this->bestiaryFloorAlt)._buf + 4) = uVar5; *(undefined4 *)((this->bestiaryFloorAlt)._buf + 8) = uVar6; *(undefined4 *)((this->bestiaryFloorAlt)._buf + 0xc) = uVar7; uVar8 = (other->bestiaryFloorAlt)._capacity; (this->bestiaryFloorAlt)._size = (other->bestiaryFloorAlt)._size; (this->bestiaryFloorAlt)._capacity = uVar8; (other->bestiaryFloorAlt)._size = 0; (other->bestiaryFloorAlt)._capacity = 0xf; (other->bestiaryFloorAlt)._buf[0] = '\0'; this->bestiaryParentType = other->bestiaryParentType; this->bestiaryParentVariant = other->bestiaryParentVariant; this->modEntry = other->modEntry; this->isPortraitModded = other->isPortraitModded; return this; } //@@ 006a1a40 EntityConfig_Player::EntityConfig_Player /* DB: move-ctor of the 0x148-byte EntityConfig_Player (int id then std::strings moved field by field, source reset to empty/cap 15); 3 callers are uninitialized-move loops (0069fb60 stride 0x148) under EntityConfig::load_players_xml's vector growth */ EntityConfig_Player * __thiscall EntityConfig_Player::EntityConfig_Player(EntityConfig_Player *this,int *param_2) { void *tmpPtr1; void *tmpPtr2; void *tmpPtr3; int tmpWord1; int tmpWord2; int tmpWord3; this->_id = *param_2; (this->_name)._buf[0] = '\0'; (this->_name)._buf[1] = '\0'; (this->_name)._buf[2] = '\0'; (this->_name)._buf[3] = '\0'; (this->_name)._size = 0; (this->_name)._capacity = 0; tmpWord1 = param_2[2]; tmpWord2 = param_2[3]; tmpWord3 = param_2[4]; *(int *)(this->_name)._buf = param_2[1]; *(int *)((this->_name)._buf + 4) = tmpWord1; *(int *)((this->_name)._buf + 8) = tmpWord2; *(int *)((this->_name)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[6]; (this->_name)._size = param_2[5]; (this->_name)._capacity = tmpWord1; param_2[5] = 0; param_2[6] = 0xf; *(undefined1 *)(param_2 + 1) = 0; (this->_skinPath)._buf[0] = '\0'; (this->_skinPath)._buf[1] = '\0'; (this->_skinPath)._buf[2] = '\0'; (this->_skinPath)._buf[3] = '\0'; (this->_skinPath)._size = 0; (this->_skinPath)._capacity = 0; tmpWord1 = param_2[8]; tmpWord2 = param_2[9]; tmpWord3 = param_2[10]; *(int *)(this->_skinPath)._buf = param_2[7]; *(int *)((this->_skinPath)._buf + 4) = tmpWord1; *(int *)((this->_skinPath)._buf + 8) = tmpWord2; *(int *)((this->_skinPath)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0xc]; (this->_skinPath)._size = param_2[0xb]; (this->_skinPath)._capacity = tmpWord1; param_2[0xb] = 0; param_2[0xc] = 0xf; *(undefined1 *)(param_2 + 7) = 0; (this->_nameImagePath)._buf[0] = '\0'; (this->_nameImagePath)._buf[1] = '\0'; (this->_nameImagePath)._buf[2] = '\0'; (this->_nameImagePath)._buf[3] = '\0'; (this->_nameImagePath)._size = 0; (this->_nameImagePath)._capacity = 0; tmpWord1 = param_2[0xe]; tmpWord2 = param_2[0xf]; tmpWord3 = param_2[0x10]; *(int *)(this->_nameImagePath)._buf = param_2[0xd]; *(int *)((this->_nameImagePath)._buf + 4) = tmpWord1; *(int *)((this->_nameImagePath)._buf + 8) = tmpWord2; *(int *)((this->_nameImagePath)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x12]; (this->_nameImagePath)._size = param_2[0x11]; (this->_nameImagePath)._capacity = tmpWord1; param_2[0x11] = 0; param_2[0x12] = 0xf; *(undefined1 *)(param_2 + 0xd) = 0; (this->_portraitPath)._buf[0] = '\0'; (this->_portraitPath)._buf[1] = '\0'; (this->_portraitPath)._buf[2] = '\0'; (this->_portraitPath)._buf[3] = '\0'; (this->_portraitPath)._size = 0; (this->_portraitPath)._capacity = 0; tmpWord1 = param_2[0x14]; tmpWord2 = param_2[0x15]; tmpWord3 = param_2[0x16]; *(int *)(this->_portraitPath)._buf = param_2[0x13]; *(int *)((this->_portraitPath)._buf + 4) = tmpWord1; *(int *)((this->_portraitPath)._buf + 8) = tmpWord2; *(int *)((this->_portraitPath)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x18]; (this->_portraitPath)._size = param_2[0x17]; (this->_portraitPath)._capacity = tmpWord1; param_2[0x17] = 0; param_2[0x18] = 0xf; *(undefined1 *)(param_2 + 0x13) = 0; (this->_unkString)._buf[0] = '\0'; (this->_unkString)._buf[1] = '\0'; (this->_unkString)._buf[2] = '\0'; (this->_unkString)._buf[3] = '\0'; (this->_unkString)._size = 0; (this->_unkString)._capacity = 0; tmpWord1 = param_2[0x1a]; tmpWord2 = param_2[0x1b]; tmpWord3 = param_2[0x1c]; *(int *)(this->_unkString)._buf = param_2[0x19]; *(int *)((this->_unkString)._buf + 4) = tmpWord1; *(int *)((this->_unkString)._buf + 8) = tmpWord2; *(int *)((this->_unkString)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x1e]; (this->_unkString)._size = param_2[0x1d]; (this->_unkString)._capacity = tmpWord1; param_2[0x1d] = 0; param_2[0x1e] = 0xf; *(undefined1 *)(param_2 + 0x19) = 0; (this->_extraPortraitPath)._buf[0] = '\0'; (this->_extraPortraitPath)._buf[1] = '\0'; (this->_extraPortraitPath)._buf[2] = '\0'; (this->_extraPortraitPath)._buf[3] = '\0'; (this->_extraPortraitPath)._size = 0; (this->_extraPortraitPath)._capacity = 0; tmpWord1 = param_2[0x20]; tmpWord2 = param_2[0x21]; tmpWord3 = param_2[0x22]; *(int *)(this->_extraPortraitPath)._buf = param_2[0x1f]; *(int *)((this->_extraPortraitPath)._buf + 4) = tmpWord1; *(int *)((this->_extraPortraitPath)._buf + 8) = tmpWord2; *(int *)((this->_extraPortraitPath)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x24]; (this->_extraPortraitPath)._size = param_2[0x23]; (this->_extraPortraitPath)._capacity = tmpWord1; param_2[0x23] = 0; param_2[0x24] = 0xf; *(undefined1 *)(param_2 + 0x1f) = 0; (this->_costumeSuffixName)._buf[0] = '\0'; (this->_costumeSuffixName)._buf[1] = '\0'; (this->_costumeSuffixName)._buf[2] = '\0'; (this->_costumeSuffixName)._buf[3] = '\0'; (this->_costumeSuffixName)._size = 0; (this->_costumeSuffixName)._capacity = 0; tmpWord1 = param_2[0x26]; tmpWord2 = param_2[0x27]; tmpWord3 = param_2[0x28]; *(int *)(this->_costumeSuffixName)._buf = param_2[0x25]; *(int *)((this->_costumeSuffixName)._buf + 4) = tmpWord1; *(int *)((this->_costumeSuffixName)._buf + 8) = tmpWord2; *(int *)((this->_costumeSuffixName)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x2a]; (this->_costumeSuffixName)._size = param_2[0x29]; (this->_costumeSuffixName)._capacity = tmpWord1; param_2[0x29] = 0; param_2[0x2a] = 0xf; *(undefined1 *)(param_2 + 0x25) = 0; this->_costumeID = param_2[0x2b]; this->_heart = param_2[0x2c]; this->_armor = param_2[0x2d]; this->_blackHeart = param_2[0x2e]; this->_coins = param_2[0x2f]; this->_bombs = param_2[0x30]; this->_keys = param_2[0x31]; this->_card = param_2[0x32]; this->_pill = param_2[0x33]; this->_canShoot = *(byte *)(param_2 + 0x34); tmpPtr1 = (void *)param_2[0x35]; tmpPtr2 = (void *)param_2[0x37]; tmpPtr3 = (void *)param_2[0x36]; param_2[0x37] = 0; param_2[0x36] = 0; param_2[0x35] = 0; (this->_collectibles)._begin = tmpPtr1; (this->_collectibles)._end = tmpPtr3; (this->_collectibles)._capacity = tmpPtr2; this->_trinket = param_2[0x38]; this->_skinColor = param_2[0x39]; this->_achievement = param_2[0x3a]; this->_brokenHeart = param_2[0x3b]; this->_pocketActiveID = param_2[0x3c]; (this->_birthrightDescription)._buf[0] = '\0'; (this->_birthrightDescription)._buf[1] = '\0'; (this->_birthrightDescription)._buf[2] = '\0'; (this->_birthrightDescription)._buf[3] = '\0'; (this->_birthrightDescription)._size = 0; (this->_birthrightDescription)._capacity = 0; tmpWord1 = param_2[0x3e]; tmpWord2 = param_2[0x3f]; tmpWord3 = param_2[0x40]; *(int *)(this->_birthrightDescription)._buf = param_2[0x3d]; *(int *)((this->_birthrightDescription)._buf + 4) = tmpWord1; *(int *)((this->_birthrightDescription)._buf + 8) = tmpWord2; *(int *)((this->_birthrightDescription)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x42]; (this->_birthrightDescription)._size = param_2[0x41]; (this->_birthrightDescription)._capacity = tmpWord1; param_2[0x41] = 0; param_2[0x42] = 0xf; *(undefined1 *)(param_2 + 0x3d) = 0; (this->_bSkinParentName)._buf[0] = '\0'; (this->_bSkinParentName)._buf[1] = '\0'; (this->_bSkinParentName)._buf[2] = '\0'; (this->_bSkinParentName)._buf[3] = '\0'; (this->_bSkinParentName)._size = 0; (this->_bSkinParentName)._capacity = 0; tmpWord1 = param_2[0x44]; tmpWord2 = param_2[0x45]; tmpWord3 = param_2[0x46]; *(int *)(this->_bSkinParentName)._buf = param_2[0x43]; *(int *)((this->_bSkinParentName)._buf + 4) = tmpWord1; *(int *)((this->_bSkinParentName)._buf + 8) = tmpWord2; *(int *)((this->_bSkinParentName)._buf + 0xc) = tmpWord3; tmpWord1 = param_2[0x48]; (this->_bSkinParentName)._size = param_2[0x47]; (this->_bSkinParentName)._capacity = tmpWord1; param_2[0x47] = 0; param_2[0x48] = 0xf; *(undefined1 *)(param_2 + 0x43) = 0; this->_moddedTaintedPlayerID = param_2[0x49]; this->_hidden = *(byte *)(param_2 + 0x4a); this->_modEntry = (void *)param_2[0x4b]; tmpPtr1 = (void *)param_2[0x4d]; tmpPtr2 = (void *)param_2[0x4e]; tmpPtr3 = (void *)param_2[0x4f]; *(int *)&this->_renderCustomBackground = param_2[0x4c]; this->_moddedMenuBackgroundANM2 = tmpPtr1; this->_moddedMenuPortraitANM2 = tmpPtr2; this->_moddedGameOverANM2 = tmpPtr3; tmpWord1 = param_2[0x51]; this->_moddedCoopMenuANM2 = (void *)param_2[0x50]; this->_moddedControlsANM2 = (void *)tmpWord1; return this; } //@@ 006a1e00 FUN_006a1e00 void FUN_006a1e00(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 *in_ECX; undefined4 *in_EDX; float fVar9; fVar9 = (float)in_EDX[3]; if (fVar9 < (float)in_ECX[3]) { uVar2 = in_ECX[1]; uVar3 = in_ECX[2]; uVar4 = in_ECX[3]; uVar1 = in_EDX[4]; uVar5 = *in_EDX; uVar6 = in_EDX[1]; uVar7 = in_EDX[2]; uVar8 = in_EDX[3]; *in_EDX = *in_ECX; in_EDX[1] = uVar2; in_EDX[2] = uVar3; in_EDX[3] = uVar4; in_EDX[4] = in_ECX[4]; *in_ECX = uVar5; in_ECX[1] = uVar6; in_ECX[2] = uVar7; in_ECX[3] = uVar8; in_ECX[4] = uVar1; fVar9 = (float)in_EDX[3]; } if ((float)param_1[3] <= fVar9 && fVar9 != (float)param_1[3]) { uVar2 = in_EDX[1]; uVar3 = in_EDX[2]; uVar4 = in_EDX[3]; uVar5 = *param_1; uVar6 = param_1[1]; uVar7 = param_1[2]; uVar8 = param_1[3]; uVar1 = param_1[4]; *param_1 = *in_EDX; param_1[1] = uVar2; param_1[2] = uVar3; param_1[3] = uVar4; param_1[4] = in_EDX[4]; *in_EDX = uVar5; in_EDX[1] = uVar6; in_EDX[2] = uVar7; in_EDX[3] = uVar8; in_EDX[4] = uVar1; if ((float)in_EDX[3] <= (float)in_ECX[3] && (float)in_ECX[3] != (float)in_EDX[3]) { uVar2 = in_ECX[1]; uVar3 = in_ECX[2]; uVar4 = in_ECX[3]; *in_EDX = *in_ECX; in_EDX[1] = uVar2; in_EDX[2] = uVar3; in_EDX[3] = uVar4; in_EDX[4] = in_ECX[4]; *in_ECX = uVar5; in_ECX[1] = uVar6; in_ECX[2] = uVar7; in_ECX[3] = uVar8; in_ECX[4] = uVar1; } } return; } //@@ 006a1e80 FUN_006a1e80 void FUN_006a1e80(void) { Entity *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af762d; local_10 = ExceptionList; ExceptionList = &local_10; Entity::constructor(in_ECX); local_8 = 0; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Bomb::vftable; in_ECX[1]._variant = 0; in_ECX[1]._subtype = 0; in_ECX[1]._spawnerType = 0; in_ECX[1]._spawnerVariant = 0; _eh_vector_constructor_iterator_ (&in_ECX[1]._sprite._filename._size,0x114,5,ANM2::constructor,ANM2::~ANM2); in_ECX[2]._colorParams._end = (void *)0x0; in_ECX[2]._colorParams._capacity = (void *)0x0; in_ECX[2]._color._tint[0] = 0.0; ExceptionList = local_10; return; } //@@ 006a1f30 Entity_Bomb::Free /* ZHL [vtable slot 0] */ Entity_Bomb * __thiscall Entity_Bomb::Free(Entity_Bomb *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; *(undefined ***)this = IsaacRepentancePlus::Entity_Bomb::vftable; FID_conflict__Tidy(&this->_hitList); _eh_vector_destructor_iterator_(this->_bombCostumesSprites,0x114,5,ANM2::~ANM2); Entity::destructor((Entity *)this); if ((param_2 & 1) != 0) { operator_delete(this,0x9d8); } ExceptionList = local_10; return this; } //@@ 006a1fc0 FUN_006a1fc0 void FUN_006a1fc0(void) { Entity *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Bomb::vftable; FID_conflict__Tidy(&in_ECX[2]._colorParams._end); _eh_vector_destructor_iterator_(&in_ECX[1]._sprite._filename._size,0x114,5,ANM2::~ANM2); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 006a2030 Entity_Bomb::IsRocket /* DB: ?variant 19/20 (BOMB_ROCKET/ROCKET_GIGA in Rep+); used in bomb update/collision prototype: db/protos.zhl */ byte __thiscall Entity_Bomb::IsRocket(Entity_Bomb *this) { if ((this->_variant == 0x13) || (this->_variant == 0x14)) { return 1; } return 0; } //@@ 006a2050 Entity_Bomb::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] */ void __thiscall Entity_Bomb::Init(Entity_Bomb *this) { code *pcVar1; byte bVar2; uint uVar3; byte *curAnimName; LayerState *pLVar4; byte *expectedAnimName; std_string *a; uint size; void *ptr; bool isLess; int in_stack_00000004; int in_stack_00000008; int in_stack_0000000c; uint in_stack_00000010; byte *pbVar5; byte *layerIndex; ColorMod floorTint; KColor floorColor; std_string layerName; undefined4 flagsHi; int variant; Entity::Init((Entity *)this,in_stack_00000004,in_stack_00000008,in_stack_0000000c, in_stack_00000010); variant = this->_variant; this->_explosionDamage = 100.0; this->_explosionCountdown1 = 0x2d; this->_updateDelay = 0; this->_scatterTimer = 0; if ((((variant == 3) || (variant == 4)) || (variant == 8)) || (variant == 0x12)) { uVar3 = (this->_dropRNG)._seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = (this->_dropRNG)._seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar3; (this->_dropRNG)._seed = uVar3; this->_explosionCountdown1 = this->_explosionCountdown1 + uVar3 % 0x1e; } variant = this->_variant; if (variant == 0xf) { this->_explosionCountdown1 = 0x5e; this->_explosionDamage = 20.0; } else if ((variant == 0x11) || (variant == 0x14)) { this->_explosionCountdown1 = 0x57; this->_explosionDamage = 300.0; } this->_scale = 1.0; this->_rocketSpeed = 0.0; this->_fallAcceleration = 0.0; this->_entityGridCollisionClass = 5; this->_collisionCooldown = 4; this->_parentCollisionCooldown = 4; this->_isFetus = 0; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; this->_prismTouched = 0; this->_bounceCount = 0; this->_fallSpeed = 0.0; this->_radiusMultiplier = 1.0; this->_stickyTarget = (EntityPtr)0x0; if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); } (this->_hitList)._end = (this->_hitList)._begin; variant = this->_variant; this->_hasCostumes = 0; this->_loadCostumes = 0; if (variant == 2) { pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { curAnimName = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnimName = *(byte **)pbVar5; } expectedAnimName = s_Idle; do { bVar2 = *curAnimName; isLess = bVar2 < *expectedAnimName; if (bVar2 != *expectedAnimName) { LAB_006a2260: uVar3 = -(uint)isLess | 1; goto LAB_006a2265; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; isLess = bVar2 < expectedAnimName[1]; if (bVar2 != expectedAnimName[1]) goto LAB_006a2260; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_006a2265: if ((uVar3 == 0) && ((pbVar5[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_006a2468; } pbVar5 = s_Idle; } else if (((variant == 4) || (variant == 3)) || ((variant == 8 || ((variant == 0x11 || (variant == 0x12)))))) { if (this->_subtype == 1) { bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"BombReturn",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } Room::GetFloorColorAt(g_game->_room,&floorColor,&this->_pos,this->_size); floorTint._tint[0] = floorColor._red * 2.0; floorTint._offset[0] = 0.0; floorTint._offset[1] = 0.0; floorTint._offset[2] = 0.0; floorTint._tint[1] = floorColor._green * 2.0; floorTint._tint[3] = 1.0; layerIndex = (byte *)0x0; floorTint._tint[2] = floorColor._blue * 2.0; if ((this->_sprite)._layerCount != 0) { do { pLVar4 = ANM2::GetLayer(&this->_sprite,layerIndex); if (pLVar4->_layerData == (void *)0x0) { layerName._buf[0] = '\0'; layerName._buf[1] = '\0'; layerName._buf[2] = '\0'; layerName._buf[3] = '\0'; layerName._capacity = 0xf; layerName._size = 0; } else { std::string::string(layerName._buf,(void *)((int)pLVar4->_layerData + 8)); } uVar3 = layerName._capacity; flagsHi = layerName._buf._0_4_; a = &layerName; if (0xf < layerName._capacity) { a = (std_string *)layerName._buf._0_4_; } bVar2 = str_eq((byte *)a,layerName._size,&DAT_00b1d57c,4); if (0xf < uVar3) { size = uVar3 + 1; ptr = (void *)flagsHi; if (0xfff < size) { ptr = *(void **)(flagsHi + -4); size = uVar3 + 0x24; if (0x1f < (flagsHi - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } if ((bVar2 != 0) && (&pLVar4->_color != &floorTint)) { (pLVar4->_color)._tint[0] = floorTint._tint[0]; (pLVar4->_color)._tint[1] = floorTint._tint[1]; (pLVar4->_color)._tint[2] = floorTint._tint[2]; (pLVar4->_color)._tint[3] = floorTint._tint[3]; (pLVar4->_color)._colorize[0] = 0.0; (pLVar4->_color)._colorize[1] = 0.0; (pLVar4->_color)._colorize[2] = 0.0; (pLVar4->_color)._colorize[3] = 0.0; (pLVar4->_color)._offset[0] = floorTint._offset[0]; (pLVar4->_color)._offset[1] = floorTint._offset[1]; (pLVar4->_color)._offset[2] = floorTint._offset[2]; } layerIndex = layerIndex + 1; } while (layerIndex < (byte *)(this->_sprite)._layerCount); } goto LAB_006a2468; } pbVar5 = (byte *)"Appear"; } else { pbVar5 = (byte *)"Pulse"; } bVar2 = ANM2::SetAnimation(&this->_sprite,pbVar5,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_006a2468: this->_rocketAngle = 0.0; this->_isSkipNextUpdate = 0; if ((this->_variant == 0x13) || (this->_variant == 0x14)) { flagsHi = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x4000000; *(undefined4 *)((int)&this->_flags + 4) = flagsHi; (this->_posOffset).y = -14.0; } FUN_00861ea0(this); return; } //@@ 006a24d0 Entity_Bomb::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Bomb::Update(Entity_Bomb *this) { float *pfVar1; BitSet128 BVar2; void *pvVar3; EntityPtr EVar4; Entity_Player **ppEVar5; byte bVar6; BitSet128 *pBVar7; uint uVar8; Entity *pEVar9; float *pfVar10; int iVar11; int iVar12; BitSet128 *maskedFlags; Vector *pVVar13; int *effect; uint rngResult; RNG *trinketRng; Entity_Player *pEVar14; Entity_Bomb *trinketRng; char extraout_DL; char cVar15; int extraout_EDX; int *extraout_EDX_00; byte *costumeLoaded; float oldFallSpeed; float fVar16; undefined1 auVar17 [16]; float fVar18; undefined1 auVar19 [12]; undefined1 auVar20 [16]; float fVar21; float fVar22; float height; float fVar23; float minBounceSpeed; undefined4 uVar24; TypeDescriptor *pTVar25; TypeDescriptor *pTVar26; undefined4 uVar27; BitSet128 local_110; BitSet128 local_100; Vector scratchVec; undefined1 local_e8 [12]; undefined1 *local_dc; Vector scratchVec2; Entity_Bomb *bomb; Vector local_cc; float rocketAngle; RNG local_c0; EntityPtr spawner; EntityPtr local_ac; char isBouncy; float local_a4; undefined1 local_a0 [8]; Vector VStack_98; float local_8c; EntityPtr local_88; undefined1 *local_84; Entity_Player *local_80 [13]; EntityRef sourceRef; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; Entity_Player *local_14; uint *entityFlagsHi; qword flagsHigh; qword flagsLow; Game *game; Manager *manager; EntityPtr stickyTarget; code *takeDamage; puStack_20 = (undefined1 *)(local_80 + 0x1f); local_14 = (Entity_Player *)0xffffffff; puStack_18 = &LAB_00afa186; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_80 + 0x1c); if (this->_isSkipNextUpdate != 0) { this->_isSkipNextUpdate = 0; return; } ExceptionList = &local_1c; bomb = this; ppEVar5 = local_80 + 0x1f; if (this->_loadCostumes != 0) { update_sparks(this,local_24); ppEVar5 = (Entity_Player **)puStack_20; } puStack_20 = (undefined1 *)ppEVar5; local_80[0] = (Entity_Player *)&this->_tearFlags; pBVar7 = BitSet128::operator_and ((BitSet128 *)&local_c0,(BitSet128 *)local_80[0],(BitSet128 *)&DAT_00c345e0); if (((int)pBVar7->_l == 0 && *(int *)((int)&pBVar7->_l + 4) == 0) && ((int)pBVar7->_h == 0 && *(int *)((int)&pBVar7->_h + 4) == 0)) { isBouncy = '\0'; } else { isBouncy = '\x01'; } rocketAngle = this->_rocketAngle; if (g_game->_frameCount - this->_spawnFrame == 1) { if (this->_spawnerType == 1) { this->_bombIndex = DAT_00c7ec64; DAT_00c7ec64 = DAT_00c7ec64 + 1; } if (isBouncy != '\0') { this->_fallSpeed = -8.0; (this->_posOffset).y = -3.0; } } if (this->_dead != 0) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; Entity::Update((Entity *)this); if (0 < this->_updateDelay) { this->_updateDelay = this->_updateDelay + -1; ExceptionList = local_1c; return; } if ((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) || (this->_variant == 2)) { (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if (this->_pitfallState != 0) { this->_friction = this->_friction * 0.6; if (0 < this->_explosionCountdown1) { this->_explosionCountdown1 = this->_explosionCountdown1 + 1; } if ((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) && ((this->_pitfallState == 1 && (this->_pitfallState = 2, this->_parent == (EntityPtr)0x0)))) { (**(code **)(*(int *)this + 0x28))(); } } fVar16 = -3.0; if ((this->_flags & 0x20) != 0) { ANM2::SetFrame(&this->_sprite,(std_string *)s_Idle,0); if (this->_hasCostumes != 0) { costumeLoaded = &this->_bombCostumesSprites[0]._loaded; local_84 = &DAT_00000005; do { if (*costumeLoaded != 0) { AnimationState::Update((AnimationState *)(costumeLoaded + -0xd9)); AnimationState::Update((AnimationState *)(costumeLoaded + -0xb9)); } costumeLoaded = costumeLoaded + 0x114; local_84 = local_84 + -1; } while (local_84 != (undefined1 *)0x0); } Entity::Update((Entity *)this); ExceptionList = local_1c; return; } fVar21 = 0.0; fVar22 = 1.0; minBounceSpeed = 2.0; fVar23 = 0.8; if (((this->_visible != 0) && (this->_pitfallState == 0)) && ((this->_dead == 0 && ((height = (this->_posOffset).y, height < 0.0 || (this->_fallSpeed <= 0.0 && this->_fallSpeed != 0.0)))))) { oldFallSpeed = this->_fallSpeed; height = oldFallSpeed + height; (this->_posOffset).y = height; bVar6 = IsRocket(this); if (bVar6 == 0) { if (isBouncy == '\0') { fVar18 = this->_fallAcceleration; if (this->_fallAcceleration == fVar21) { fVar18 = fVar23; } } else { fVar18 = 2.5; } } else if (isBouncy == '\0') { fVar18 = this->_fallAcceleration; } else { fVar18 = 1.6; } fVar18 = fVar18 + oldFallSpeed; this->_fallSpeed = fVar18; cVar15 = isBouncy; if (-26.0 <= height) { if ((fVar16 <= height) && (this->_isFetus == 0)) { bVar6 = IsRocket(trinketRng); cVar15 = extraout_DL; if (bVar6 == 0) { this->_entityGridCollisionClass = 5; goto LAB_006a2829; } } this->_entityGridCollisionClass = 6; } else { this->_entityGridCollisionClass = 3; } LAB_006a2829: if (fVar21 <= height) { if (((cVar15 == '\0') || (fVar18 <= minBounceSpeed)) || (3 < this->_bounceCount)) { (this->_posOffset).y = 0.0; this->_fallSpeed = 0.0; this->_collisionDamage = 0.0; bVar6 = IsRocket(this); if (bVar6 == 0) { pfVar1 = &this->_scale; local_80[0] = (Entity_Player *)0x3f800000; if (this->_variant == 0x12) { iVar11 = 0x1d2; pfVar10 = (float *)local_80; if (*pfVar1 <= fVar22) { pfVar10 = pfVar1; } fVar23 = *pfVar10 * fVar23; } else { iVar11 = 0x28; pfVar10 = (float *)local_80; if (*pfVar1 <= fVar22) { pfVar10 = pfVar1; } fVar23 = *pfVar10; } SoundEffects::PlayWithFartOverride(iVar11,fVar23,2,0,1.0); } else { this->_explosionCountdown1 = 0; } } else { this->_bounceCount = this->_bounceCount + 1; (this->_posOffset).y = 0.0; this->_fallSpeed = fVar18 * -0.7; uVar8 = Random(); pEVar9 = Game::Spawn(g_game,1000,0xe,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar8); (**(code **)(*(int *)pEVar9 + 0x3c))(&(bomb->_sprite)._color,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar9 + 0xc))(); SoundEffects::PlayWithFartOverride(0x96,0.5,2,0,1.0); tear_flags_area_apply (*(undefined4 *)local_80[0],*(undefined4 *)&local_80[0]->field_0x4, (local_80[0]->_damageEvents)._begin,(local_80[0]->_damageEvents)._end); this = bomb; } } } spawner = this->_spawnerEntity; if ((spawner != (EntityPtr)0x0) && (*(int *)((int)spawner + 0x28) != 1)) { spawner = (EntityPtr)0x0; } EVar4 = spawner; iVar11 = this->_variant; if ((iVar11 == 0x13) || (iVar11 == 0x14)) { bVar6 = Entity::HasEntityFlags((Entity *)this,0x200000000000000); if (bVar6 == 0) { iVar11 = this->_variant; goto LAB_006a2a0d; } (this->_sprite)._rotation = 0.0; ANM2::Play(&this->_sprite,s_Idle,0); this->_rocketSpeed = 0.0; } else { LAB_006a2a0d: if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { bVar6 = AnimationState::IsLoopingAnimation(&(this->_sprite)._animState); iVar11 = extraout_EDX; if (bVar6 == 0) goto LAB_006a2a4a; } if ((iVar11 != 2) && (this->_pitfallState == 0)) { ANM2::Play(&this->_sprite,(byte *)"Pulse",0); } } LAB_006a2a4a: bVar6 = ANM2::IsPlaying(&this->_sprite,(byte *)"Pulse"); if ((bVar6 != 0) && (bVar6 = IsRocket(this), bVar6 == 0)) { if ((this->_isFetus == 0) && (((this->_spawnerType == 1 && (EVar4 != (EntityPtr)0x0)) && (bVar6 = Entity_Player::HasCollectible((Entity_Player *)EVar4,0x89,0), bVar6 != 0)))) { iVar11 = ANM2::GetFrame(&this->_sprite); if (0xe < iVar11) { iVar11 = 0; goto LAB_006a2afe; } } else { local_80[0] = (Entity_Player *)0x0; iVar11 = AnimationState::GetAnimationLength(&(this->_sprite)._animState); iVar11 = (iVar11 - *extraout_EDX_00) + -1; if (iVar11 < 0) { iVar11 = iVar11 + (iVar11 / 0xf) * -0xf + 0xf; } iVar12 = ANM2::GetFrame(&this->_sprite); if (iVar11 != iVar12) { LAB_006a2afe: Sprite::SetFrame_1((Sprite *)&this->_sprite,iVar11); } } } pBVar7 = &this->_tearFlags; fVar16 = 90.0; uVar8 = 0x80000000; fVar23 = 0.017453292; if (this->_isFetus != 0) { maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,&g_tearFlagSpectral); bVar6 = BitSet128::IsNonZero(maskedFlags); if (bVar6 != 0) { this->_entityGridCollisionClass = 3; } bVar6 = IsRocket(this); if (bVar6 == 0) { maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34870); bVar6 = BitSet128::IsNonZero(maskedFlags); if (bVar6 != 0) { VStack_98.x = (this->_velocity).y; VStack_98.y = (float)((uint)(this->_velocity).x ^ uVar8); Vector::Normalize(&VStack_98); local_80[0] = (Entity_Player *) sin((float)g_game->_frameCount * 0.7 + (float)((double)this->_index + __uint_to_double_fixup[-(this->_index >> 0x1f)])); fVar16 = (this->_velocity).y; fVar23 = (this->_velocity).x; fVar16 = sqrtf(fVar23 * fVar23 + fVar16 * fVar16); (this->_pos).x = VStack_98.x * fVar16 * (float)local_80[0] + (this->_pos).x; (this->_pos).y = VStack_98.y * fVar16 * (float)local_80[0] + (this->_pos).y; } if (this->_collidesWithGrid != 0) { maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,&g_tearFlagExplosive); bVar6 = BitSet128::IsNonZero(maskedFlags); if (bVar6 != 0) { this->_explosionCountdown1 = 0; } } maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34580); bVar6 = BitSet128::IsNonZero(maskedFlags); if (((bVar6 != 0) && (EVar4 = this->_parent, EVar4 != (EntityPtr)0x0)) && (*(int *)((int)EVar4 + 0x28) == 1)) { local_84 = (undefined1 *) __RTDynamicCast(EVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); iVar11 = __RTDynamicCast(); if (iVar11 != 0) { local_a4 = (this->_pos).x - *(float *)(local_84 + 0x33c); local_88 = (EntityPtr)((this->_pos).y - *(float *)(local_84 + 0x340)); local_80[0] = (Entity_Player *)(*(float *)(iVar11 + 0x41c) * 0.017453292); local_8c = sin((float)local_80[0]); fVar16 = cos((float)local_80[0]); fVar23 = fVar16 * local_a4 + local_8c * (float)local_88; if (0.0 < fVar23) { local_80[0] = (Entity_Player *) (((fVar23 * fVar16 + *(float *)(local_84 + 0x33c)) - (this->_pos).x) * 0.01); local_a4 = ((fVar23 * local_8c + *(float *)(local_84 + 0x340)) - (this->_pos).y) * 0.01; VStack_98.x = (float)local_80[0]; VStack_98.y = local_a4; fVar16 = (float)local_80[0] * (float)local_80[0] + local_a4 * local_a4; if ((4.0 < fVar16) && (fVar16 = sqrtf(fVar16), 0.0 < fVar16)) { VStack_98.x = (float)local_80[0] * (2.0 / fVar16); VStack_98.y = (2.0 / fVar16) * local_a4; } Entity::AddVelocity_divided((Entity *)this,&VStack_98,0); } } } fVar16 = 0.0; maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34860); bVar6 = BitSet128::IsNonZero(maskedFlags); if ((bVar6 != 0) && (EVar4 = this->_parent, EVar4 != (EntityPtr)0x0)) { VStack_98.x = (this->_pos).x - (*(float *)((int)EVar4 + 0x33c) + fVar16); VStack_98.y = (this->_pos).y - (*(float *)((int)EVar4 + 0x340) + 2.0); pVVar13 = Vector::Normalized(&VStack_98,&local_cc); fVar16 = pVVar13->y; (this->_velocity).x = (this->_velocity).x - pVVar13->x * 0.6; (this->_velocity).y = (this->_velocity).y - fVar16 * 0.6; } } else { local_ac = (EntityPtr)(this->_updateTime - 1.0); maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34870); bVar6 = BitSet128::IsNonZero(maskedFlags); if (bVar6 != 0) { local_80[0] = (Entity_Player *)((this->_rocketAngle + fVar16) * fVar23); local_88 = (EntityPtr)sin((float)local_80[0]); fVar16 = cos((float)local_80[0]); local_80[0] = (Entity_Player *)(fVar16 * 6.0); local_88 = (EntityPtr)((float)local_88 * 6.0); local_ac = (EntityPtr)((float)local_ac * 0.8); fVar23 = sin((float)local_ac); fVar16 = this->_speedMultiplier; (this->_velocity).x = (float)local_80[0] * fVar23 * fVar16 + (this->_velocity).x; (this->_velocity).y = (float)local_88 * fVar23 * fVar16 + (this->_velocity).y; fVar16 = sin((float)local_ac - 0.5); fVar23 = 0.017453292; rocketAngle = fVar16 * 25.0 + this->_rocketAngle; } if (this->_fallAcceleration != 0.0) { rocketAngle = rocketAngle * fVar23; local_a4 = sin(rocketAngle); fVar16 = (this->_velocity).y; fVar23 = (this->_velocity).x; local_80[0] = (Entity_Player *)sqrtf(fVar23 * fVar23 + fVar16 * fVar16); fVar16 = cos(rocketAngle); rocketAngle = atan2f(this->_fallSpeed + local_a4 * (float)local_80[0], fVar16 * (float)local_80[0] + 0.0); rocketAngle = rocketAngle * 57.295776; } } } pBVar7 = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34c00); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { if (this->_spawnerType == 1) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&local_c0,&this->_pos, this->_size,8); local_14 = (Entity_Player *)0x0; local_84 = (undefined1 *)0x0; if ((undefined1 *)local_c0._shift3 != (undefined1 *)0x0) { do { pEVar14 = *(Entity_Player **)(local_c0._shift1 + (int)local_84 * 4); local_80[0] = pEVar14; bVar6 = Entity::IsVulnerableEnemy((Entity *)pEVar14,(Entity *)0x0); if ((bVar6 != 0) && (fVar23 = (pEVar14->_pos).y - (this->_pos).y, fVar16 = (pEVar14->_pos).x - (this->_pos).x, fVar21 = pEVar14->_size + this->_size, fVar23 * fVar23 + fVar16 * fVar16 < fVar21 * fVar21)) { takeDamage = *(code **)(*(int *)pEVar14 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); (*takeDamage)(0x41800000,2,0,&sourceRef,0x1e); } local_84 = local_84 + 1; } while (local_84 < (uint)local_c0._shift3); } local_14 = (Entity_Player *)0xffffffff; EntityList_Query::~EntityList_Query(&local_c0); } else { local_84 = (undefined1 *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { local_80[0] = Game::GetPlayer(g_game,(uint)local_84); if ((local_80[0] != (Entity_Player *)0x0) && (fVar23 = (local_80[0]->_pos).y - (this->_pos).y, fVar16 = (local_80[0]->_pos).x - (this->_pos).x, fVar21 = local_80[0]->_size + this->_size + 1.5, fVar23 * fVar23 + fVar16 * fVar16 < fVar21 * fVar21)) { takeDamage = *(code **)(*(int *)local_80[0] + 0x20); EntityRef::constructor(&sourceRef,(Entity *)this); (*takeDamage)(0x3f800000,2,0,&sourceRef,0x1e); } local_84 = local_84 + 1; } while (local_84 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } } pBVar7 = &this->_tearFlags; maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34b70); if (((((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) || (local_88 = this->_parent, local_88 == (EntityPtr)0x0)) || (*(int *)((int)local_88 + 0x28) != 1)) { LAB_006a34c6: fVar16 = 0.0; } else { Entity_Player::GetShootingJoystick((Entity_Player *)local_88,&VStack_98); Entity_Player::GetMouseAimTarget((Entity_Player *)local_88,&VStack_98,0); pvVar3 = *(void **)((int)local_88 + 0x140c); if (pvVar3 != (void *)0x0) { fVar16 = (*(float *)((int)pvVar3 + 0x33c) - (this->_pos).x) / 10.0; fVar23 = (*(float *)((int)pvVar3 + 0x340) - (this->_pos).y) / 10.0; VStack_98.x = fVar16; VStack_98.y = fVar23; fVar16 = sqrtf(fVar16 * fVar16 + fVar23 * fVar23); if (1.0 < fVar16) { Vector::Normalize(&VStack_98); } } EVar4 = local_88; local_88 = (EntityPtr)(*(float *)((int)local_88 + 0x1464) * 3.0); bVar6 = Entity_Player::HasCollectible((Entity_Player *)EVar4,5,0); if (bVar6 != 0) { local_88 = (EntityPtr)((float)local_88 * 0.5); } auVar20 = ZEXT816(0); if ((VStack_98.x != 0.0) || (VStack_98.y != 0.0)) { Vector::Normalize(&VStack_98); (this->_velocity).x = VStack_98.x * (float)local_88 + (this->_velocity).x; (this->_velocity).y = VStack_98.y * (float)local_88 + (this->_velocity).y; this->_friction = 0.8; goto LAB_006a34c6; } maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34860); bVar6 = BitSet128::IsNonZero(maskedFlags); fVar16 = auVar20._0_4_; if (bVar6 == 0) { maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,&g_tearFlagHoming); bVar6 = BitSet128::IsNonZero(maskedFlags); fVar16 = auVar20._0_4_; if (bVar6 == 0) { this->_friction = 0.8; } else { this->_friction = 0.9; } } else { this->_friction = 1.0; } } iVar11 = this->_variant; if ((iVar11 == 0x13) || (iVar11 == 0x14)) { fVar23 = this->_rocketSpeed - fVar16; local_a4 = fVar23 * 0.0625; if (local_a4 <= fVar16) { local_a4 = fVar16; } if (1.0 <= local_a4) { local_a4 = 1.0; } fVar21 = local_a4 * 0.19; if (iVar11 != 0x14) { fVar23 = fVar23 * 0.125; if (fVar23 <= fVar16) { fVar23 = fVar16; } if (1.0 <= fVar23) { fVar23 = 1.0; } local_a4 = fVar23 + fVar23; } local_a4 = local_a4 + fVar16; this->_friction = fVar21 + 0.8; this->_rocketSpeed = this->_rocketSpeed + this->_speedMultiplier; local_80[0] = (Entity_Player *)(this->_rocketAngle * 0.017453292); local_84 = (undefined1 *)sin((float)local_80[0]); fVar16 = cos((float)local_80[0]); bVar6 = this->_collidesWithGrid; fVar23 = fVar16 * local_a4 * this->_speedMultiplier + (this->_velocity).x; fVar16 = (float)local_84 * local_a4 * this->_speedMultiplier + (this->_velocity).y; (this->_velocity).x = fVar23; (this->_velocity).y = fVar16; if (bVar6 != 0) { this->_explosionCountdown1 = 0; fVar21 = this->_speedMultiplier; (this->_pos).x = (this->_pos).x - fVar21 * fVar23; (this->_pos).y = (this->_pos).y - fVar21 * fVar16; } } Entity::Update((Entity *)this); if ((this->_variant == 0x13) || (this->_variant == 0x14)) { maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34860); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (EVar4 = this->_parent, EVar4 != (EntityPtr)0x0)) { fVar16 = atan2f(*(float *)((int)EVar4 + 0x340) - (this->_pos).y, *(float *)((int)EVar4 + 0x33c) - (this->_pos).x); fVar16 = normalize_angle_degrees(fVar16 * 57.295776 - this->_rocketAngle); fVar23 = (this->_rocketSpeed - 1.0) / 9.0; auVar20 = ZEXT416((uint)fVar23); if (fVar23 <= 0.0) { auVar20 = ZEXT816(0); } if (1.0 <= auVar20._0_4_) { auVar20._0_4_ = 0x3f800000; } this->_rocketAngle = (auVar20._0_4_ * 0.5 + 0.0) * fVar16 * this->_speedMultiplier + this->_rocketAngle; } pBVar7 = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,&g_tearFlagHoming); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { RNG::game_constructor(&local_c0,this->_initSeed,0xe); fVar16 = RNG::RandomFloat(&local_c0); local_88 = (EntityPtr)this->_rocketSpeed; local_84 = (undefined1 *)(fVar16 * 6.0 + 3.0); local_80[0] = (Entity_Player *)((float)local_84 + 10.0); if ((float)local_84 == (float)local_80[0]) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar16 = ((float)local_88 - (float)local_84) / ((float)local_80[0] - (float)local_84); if (fVar16 <= 0.0) { fVar16 = 0.0; } if (1.0 <= fVar16) { fVar16 = 1.0; } local_88 = (EntityPtr)(fVar16 + 0.0); if ((this->_target == (EntityPtr)0x0) || (*(char *)((int)this->_target + 0x173) != '\0')) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&local_c0, &this->_pos,256.0,0xffffffff); local_14 = (Entity_Player *)0x1; local_ac = (EntityPtr)0x0; local_a4 = 1e+10; local_80[0] = (Entity_Player *)0x0; if ((undefined1 *)local_c0._shift3 != (undefined1 *)0x0) { do { EVar4 = *(EntityPtr *)(local_c0._shift1 + (int)local_80[0] * 4); bVar6 = Entity::IsVulnerableEnemy((Entity *)EVar4,(Entity *)0x0); if (bVar6 != 0) { if (this->_spawnerEntity != (EntityPtr)0x0) { bVar6 = Entity::IsDescendantOf((Entity *)this->_spawnerEntity,(Entity *)EVar4); if (bVar6 != 0) goto LAB_006a39af; } local_cc.y = (this->_pos).x; local_8c = ((Vector *)((int)EVar4 + 0x33c))->x - local_cc.y; VStack_98.y = (this->_pos).y; local_84 = (undefined1 *)(*(float *)((int)EVar4 + 0x340) - VStack_98.y); fVar16 = sqrtf((float)local_84 * (float)local_84 + local_8c * local_8c); if (0.0 < fVar16) { local_8c = (1.0 / fVar16) * local_8c; local_84 = (undefined1 *)((float)local_84 * (1.0 / fVar16)); } scratchVec.y = this->_rocketAngle * 0.017453292; local_dc = (undefined1 *)sin(scratchVec.y); fVar16 = cos(scratchVec.y); local_dc = (undefined1 *)(fVar16 * local_8c + (float)local_dc * (float)local_84); if (0.2 < (float)local_dc) { fVar16 = VStack_98.y - *(float *)((int)EVar4 + 0x340); fVar23 = local_cc.y - ((Vector *)((int)EVar4 + 0x33c))->x; fVar16 = sqrtf(fVar16 * fVar16 + fVar23 * fVar23); fVar16 = fVar16 * (1.0 - (float)local_dc); if (fVar16 < local_a4) { local_ac = EVar4; local_a4 = fVar16; } } } LAB_006a39af: EVar4 = local_ac; local_80[0] = (Entity_Player *)&local_80[0]->field_0x1; } while (local_80[0] < (uint)local_c0._shift3); if (local_ac != (EntityPtr)0x0) { if (this->_target != (EntityPtr)0x0) { VStack_98.y = (float)&this->_target; std::multiset::erase(&VStack_98.y); } this->_target = EVar4; std::multiset::insert(&this->_target); } } if ((char)local_c0._seed == '\0') { local_14 = (Entity_Player *)0x2; tracked_alloc(1,(void *)local_c0._shift1,0); } local_14 = (Entity_Player *)0xffffffff; } EVar4 = this->_target; if ((EVar4 != (EntityPtr)0x0) && (0.0 < (float)local_88)) { fVar16 = atan2f(*(float *)((int)EVar4 + 0x340) - (this->_pos).y, *(float *)((int)EVar4 + 0x33c) - (this->_pos).x); fVar16 = normalize_angle_degrees(fVar16 * 57.295776 - this->_rocketAngle); this->_rocketAngle = (float)local_88 * this->_speedMultiplier * fVar16 + this->_rocketAngle; } } } auVar17._0_12_ = ZEXT812(0xbf800000); auVar17._12_4_ = 0; local_ac = auVar17._0_4_; if (((this->_isFetus != 0) && (this->_parent != (EntityPtr)0x0)) && ((pBVar7 = BitSet128::operator_and ((BitSet128 *)&local_c0,&this->_tearFlags,(BitSet128 *)&DAT_00c34b60), (int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0 || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)))) { bVar6 = IsRocket(this); if (bVar6 == 0) { local_88 = (EntityPtr)auVar17._0_4_; if ((this->_bombIndex & 1) == 0) { local_88 = (EntityPtr)0x3f800000; } local_8c = (this->_pos).y - *(float *)((int)this->_parent + 0x340); local_84 = (undefined1 *)((this->_pos).x - *(float *)((int)this->_parent + 0x33c)); fVar16 = sqrtf(local_8c * local_8c + (float)local_84 * (float)local_84); if (fVar16 == 0.0) { fVar16 = 0.1; } local_84 = (undefined1 *)((float)local_84 / fVar16); local_8c = local_8c / fVar16; local_cc.y = (110.0 - fVar16) * 0.05; fVar23 = (float)local_88 * local_8c; local_88 = (EntityPtr)((float)local_88 * -(float)local_84); fVar16 = (this->_velocity).x; VStack_98.y = fVar23; fVar23 = (this->_velocity).y; local_dc = (undefined1 *)sqrtf(fVar16 * fVar16 + fVar23 * fVar23); VStack_98.x = (float)local_dc * VStack_98.y + local_cc.y * (float)local_84; VStack_98.y = (float)local_dc * (float)local_88 + local_cc.y * local_8c; pVVar13 = Vector::Normalized(&VStack_98,&local_cc); fVar16 = pVVar13->y; (this->_velocity).x = (float)local_dc * pVVar13->x; (this->_velocity).y = (float)local_dc * fVar16; } } fVar16 = 5.0; if (this->_spawnerType == 1) { pBVar7 = BitSet128::operator_and((BitSet128 *)&local_c0,&this->_tearFlags,&g_tearFlagHoming); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { if (this->_target == (EntityPtr)0x0) { VStack_98.x = (this->_velocity).x * fVar16 + (this->_pos).x; VStack_98.y = (this->_velocity).y * fVar16 + (this->_pos).y; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_e8,&VStack_98, 150.0,8); local_14 = (Entity_Player *)0x3; local_84 = (undefined1 *)0x0; if (local_dc != (undefined1 *)0x0) { do { EVar4 = *(EntityPtr *)(local_e8._4_4_ + (int)local_84 * 4); bVar6 = Entity::IsVulnerableEnemy((Entity *)EVar4,(Entity *)0x0); if (((bVar6 != 0) && (((this->_spawnerEntity == (EntityPtr)0x0 || (bVar6 = Entity::IsDescendantOf ((Entity *)this->_spawnerEntity, *(Entity **)(local_e8._4_4_ + (int)local_84 * 4)), bVar6 == 0) ) && ((*(uint *)((int)EVar4 + 0x168) & 0x20000010) == 0)))) && ((uVar8 = Random(), (uVar8 & 1) != 0 && (bVar6 = Entity::IsFrame((Entity *)this,5,this->_index), bVar6 != 0)))) { local_cc.y = *(float *)((int)EVar4 + 0x340); local_cc.x = ((Vector *)((int)EVar4 + 0x33c))->x; bVar6 = Room::CheckLine(g_game->_room,&this->_pos,&local_cc,1,0,0,0,(Vector *)0x0); if (bVar6 != 0) { if (this->_target != (EntityPtr)0x0) { VStack_98.y = (float)&this->_target; std::multiset::erase(&VStack_98.y); } this->_target = EVar4; std::multiset::insert(&this->_target); } } local_84 = local_84 + 1; } while (local_84 < local_dc); } local_14 = (Entity_Player *)0xffffffff; if (local_e8[0] == '\0') { local_14 = (Entity_Player *)0x4; tracked_alloc(1,(void *)local_e8._4_4_,0); local_14 = (Entity_Player *)0xffffffff; } } else { bVar6 = IsRocket(this); if ((bVar6 == 0) && (uVar8 = Random(), (uVar8 & 1) == 0)) { VStack_98.x = (this->_pos).x - *(float *)((int)this->_target + 0x33c); VStack_98.y = (this->_pos).y - *(float *)((int)this->_target + 0x340); pVVar13 = Vector::Normalized(&VStack_98,&local_cc); fVar16 = pVVar13->y; (this->_velocity).x = (this->_velocity).x - pVVar13->x * 1.33; (this->_velocity).y = (this->_velocity).y - fVar16 * 1.33; } } } if ((this->_dead == 0) && (((pBVar7 = BitSet128::operator_and ((BitSet128 *)&local_c0,&this->_tearFlags,(BitSet128 *)&DAT_00c345f0), (int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0 || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) && (bVar6 = Entity::IsFrame((Entity *)this,7,0), bVar6 != 0)))) { if (*(int *)&g_game->_deathmatchManager < 2) { auVar19 = ZEXT812(0x40c00000); fVar16 = (this->_explosionDamage - 30.0) / 3.0; if (auVar19._0_4_ <= fVar16) { auVar19._4_8_ = auVar19._4_8_; auVar19._0_4_ = fVar16; } local_80[0] = auVar19._0_4_; } else { local_80[0] = (Entity_Player *)0x40a00000; } uVar8 = Random(); uVar27 = 0; pTVar26 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar25 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar24 = 0; pEVar9 = Game::Spawn(g_game,1000,0x2e,&this->_pos,&g_vectorZero,(Entity *)this->_spawnerEntity ,0,uVar8); effect = (int *)__RTDynamicCast(pEVar9,uVar24,pTVar25,pTVar26,uVar27); uVar8 = Random(); fVar23 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.3; fVar16 = fVar23 * g_vectorOne.x; effect[0x3a] = (int)(fVar23 * g_vectorOne.y); effect[0x39] = (int)fVar16; uVar24 = Color::Color(0x3f800000,0,100,0); (**(code **)(*effect + 0x3c))(uVar24,0xffffffff,0xff,0,1); (**(code **)(*effect + 0x40))(local_80[0]); EVar4 = this->_spawnerEntity; if (((EVar4 != (EntityPtr)0x0) && (*(int *)((int)EVar4 + 0x28) == 1)) && (iVar11 = Entity_Player::GetTrinketMultiplier((Entity_Player *)EVar4,0x47), 1 < iVar11)) { fVar16 = 1.5; if (2 < iVar11) { iVar11 = effect[0x117]; fVar16 = 2.0; effect[0x117] = (int)((float)iVar11 * 1.5); effect[0x118] = (int)((float)iVar11 * 1.5); } effect[0x3a] = (int)(fVar16 * (float)effect[0x3a]); effect[0x39] = (int)(fVar16 * (float)effect[0x39]); } effect[0xd] = this->_spawnerType; effect[0xe] = this->_spawnerVariant; (**(code **)(*effect + 0xc))(); } } if (((this->_variant != 0x13) && (this->_variant != 0x14)) && ((0.0 <= (this->_posOffset).y || (this->_isFetus == 0)))) { fVar23 = (this->_velocity).x * 0.95; fVar16 = (this->_velocity).y * 0.95; (this->_velocity).x = fVar23; (this->_velocity).y = fVar16; if (fVar23 * fVar23 + fVar16 * fVar16 < 1.0) { (this->_velocity).x = fVar23 * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; } } pBVar7 = &this->_tearFlags; maskedFlags = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34930); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (EVar4 = this->_stickyTarget, EVar4 != (EntityPtr)0x0)) { *(float *)((int)EVar4 + 0x360) = *(float *)((int)EVar4 + 0x360) * 0.9; *(float *)((int)EVar4 + 0x364) = *(float *)((int)EVar4 + 0x364) * 0.9; } if (this->_explosionCountdown1 < 1) { local_80[0] = (Entity_Player *)((int)spawner + 0x1508); LAB_006a4412: if (((this->_isFetus != 0) || (spawner == (EntityPtr)0x0)) || ((bVar6 = Entity_Player::HasCollectible((Entity_Player *)spawner,0x89,0), bVar6 == 0 || ((bVar6 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)local_80[0],0x89), bVar6 != 0 || (this->_spawnerType != 1)))))) { BVar2 = *pBVar7; if ((this->_variant == 0x11) || (_local_a0 = BVar2, this->_variant == 0x14)) { local_a0._0_4_ = BVar2._l._0_4_; local_a0._4_4_ = BVar2._l._4_4_; local_a0._4_4_ = local_a0._4_4_ | DAT_00c347d4; local_a0._0_4_ = local_a0._0_4_ | DAT_00c347d0; VStack_98.x = (float)BVar2._h; VStack_98.y = BVar2._h._4_4_; VStack_98.x = (float)((uint)VStack_98.x | DAT_00c347d8); VStack_98.y = (float)((uint)VStack_98.y | DAT_00c347dc); this->_updateDelay = 5; } uVar8 = 4; if (this->_isFetus == 0) { uVar8 = 0x40000004; } local_cc.y = (float)&this->_pos; Game::BombExplosionEffects (g_game,(Vector *)local_cc.y,this->_explosionDamage,_local_a0, &(this->_sprite)._color,(Entity *)this,this->_radiusMultiplier,1,(ulonglong)uVar8,0 ); if (spawner == (EntityPtr)0x0) { local_88 = (EntityPtr)this->_variant; } else { local_88 = (EntityPtr)0x0; } maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34570); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { uVar8 = Random(); local_84 = (undefined1 *)((uVar8 & 1) + 4); do { uVar8 = Random(); fVar16 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar16 = fVar16 + fVar16; VStack_98.y = fVar16; local_80[0] = (Entity_Player *)cos(fVar16); local_a4 = sin(VStack_98.y); uVar8 = Random(); EVar4 = this->_spawnerEntity; rngResult = Random(); scratchVec.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 7.0 + 3.0; scratchVec.y = scratchVec.x * local_a4; scratchVec.x = scratchVec.x * (float)local_80[0]; rngResult = Random(); this = bomb; uVar27 = 0; pTVar26 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor; pTVar25 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar24 = 0; fVar16 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 15.0; scratchVec2.x = fVar16 * (float)local_80[0] + *(float *)local_cc.y; scratchVec2.y = fVar16 * local_a4 + (bomb->_pos).y; pEVar9 = Game::Spawn(g_game,bomb->_type,(uint)local_88,&scratchVec2,&scratchVec, (Entity *)EVar4,0,uVar8); pEVar9 = (Entity *)__RTDynamicCast(pEVar9,uVar24,pTVar25,pTVar26,uVar27); pEVar9[1].field_0x3c = this->_isFetus; pEVar9->_spawnerType = this->_spawnerType; pEVar9->_spawnerVariant = this->_spawnerVariant; pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c34570,(BitSet128 *)&local_c0); pBVar7 = BitSet128::operator_and(&local_100,&this->_tearFlags,pBVar7); flagsLow = pBVar7->_l; iVar11 = *(int *)((int)&pBVar7->_l + 4); flagsHigh = pBVar7->_h; iVar12 = *(int *)((int)&pBVar7->_h + 4); pEVar9[1]._sprite._filename._buf[0xf] = '\x01'; pEVar9[1]._variant = (int)flagsLow; pEVar9[1]._subtype = iVar11; pEVar9[1]._spawnerType = (int)flagsHigh; pEVar9[1]._spawnerVariant = iVar12; pEVar9[1]._type = (int)(this->_scale * 0.5); pEVar9[1]._damageEvents._end = (void *)(this->_explosionDamage * 0.5); *(float *)&pEVar9[1].field_0x40 = this->_radiusMultiplier * 0.65; local_dc = (undefined1 *)((uint)g_vectorOne.y ^ 0x80000000); local_e8._8_4_ = -g_vectorOne.x; Entity::SetSize(pEVar9,pEVar9->_size * 0.5, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); if ((pEVar9->_variant == 0x13) || (pEVar9->_variant == 0x14)) { uVar8 = Random(); pEVar9[1]._pendingDamage = 1.3; fVar16 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 10.0; } else { uVar8 = Random(); fVar16 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 5.0; } pEVar9[1]._damageEvents._capacity = (void *)(-3.0 - fVar16); (pEVar9->_posOffset).x = 0.0; (pEVar9->_posOffset).y = -3.0; uVar8 = RNG::RandomInt(&pEVar9->_dropRNG,0xe); *(uint *)&pEVar9->_flags = (uint)pEVar9->_flags | 0x4000000; entityFlagsHi = (uint *)((int)&pEVar9->_flags + 4); *entityFlagsHi = *entityFlagsHi | 0x400; local_84 = (undefined1 *)((int)local_84 + -1); *(void **)&pEVar9[1].field_0x4 = (void *)(uVar8 + 10); pEVar9[1]._damageEvents._begin = (void *)(uVar8 + 10); } while (local_84 != (undefined1 *)0x0); pBVar7 = &this->_tearFlags; local_84 = (undefined1 *)0x0; } pBVar7 = BitSet128::operator_and(&local_100,pBVar7,(BitSet128 *)&DAT_00c34640); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { if (0.75 < this->_scale) { uVar8 = Random(); manager = g_manager; local_80[0] = (Entity_Player *)&DAT_0000002c; VStack_98.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 2.0; seed_fart_sound_override((int *)local_80); SoundEffects::Play(&manager->_sfxManager,(int)local_80[0],0.7,2,0,VStack_98.y,0.0); local_c0._seed = this->_initSeed; local_c0._shift1 = 2; local_c0._shift2 = 7; local_c0._shift3 = 0x19; uVar8 = RNG::Next(&local_c0); pEVar9 = Game::Spawn(g_game,1000,0xba,&this->_pos,&g_vectorZero,(Entity *)spawner,1,uVar8) ; uVar24 = 0x168; if (this->_isFetus != 0) { uVar24 = 0xb4; } fVar16 = pEVar9->_collisionDamage; iVar11 = *(int *)pEVar9; *(undefined4 *)(pEVar9[1]._sprite._filename._buf + 8) = uVar24; *(undefined4 *)(pEVar9[1]._sprite._filename._buf + 0xc) = uVar24; (**(code **)(iVar11 + 0x40))(fVar16 * this->_scale); VStack_98.x = -g_vectorOne.x; VStack_98.y = -g_vectorOne.y; Entity::SetSize(pEVar9,pEVar9->_size * this->_scale, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); fVar16 = this->_scale; } else { local_c0._seed = this->_initSeed; local_c0._shift1 = 2; local_c0._shift2 = 7; local_c0._shift3 = 0x19; uVar8 = RNG::Next(&local_c0); pEVar9 = Game::Spawn(g_game,1000,0xbd,&this->_pos,&g_vectorZero,(Entity *)spawner,1,uVar8) ; if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(pEVar9->_sprite)._animState, *(int *)((int)(pEVar9->_sprite)._animState._animData + 0x30) + -1); } fVar16 = this->_scale + this->_scale; } iVar11 = *(int *)pEVar9; fVar23 = fVar16 * g_vectorOne.y; (pEVar9->_sprite)._scale.x = fVar16 * g_vectorOne.x; (pEVar9->_sprite)._scale.y = fVar23; (**(code **)(iVar11 + 0xc))(); } this->_dead = 1; if (this->_pitfallState == 0) { ANM2::Play(&this->_sprite,(byte *)"Explode",0); } if (this->_isFetus == 0) { pBVar7 = BitSet128::operator_and(&local_110,&this->_tearFlags,(BitSet128 *)&DAT_00c34930); EVar4 = spawner; if ((((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) && (stickyTarget = this->_stickyTarget, stickyTarget != (EntityPtr)0x0)) { *(uint *)((int)stickyTarget + 0x168) = *(uint *)((int)stickyTarget + 0x168) | 0x400000; *(undefined4 *)((int)stickyTarget + 0x16c) = *(undefined4 *)((int)stickyTarget + 0x16c); } if (((this->_variant != 0xd) && (spawner != (EntityPtr)0x0)) && (bVar6 = Entity_Player::HasTrinket((Entity_Player *)spawner,0x49,0), bVar6 != 0)) { trinketRng = Entity_Player::GetTrinketRNG((Entity_Player *)EVar4,0x49); iVar11 = Entity_Player::GetTrinketMultiplier((Entity_Player *)spawner,0x49); uVar8 = RNG::RandomInt(trinketRng,(uint)(10 / (longlong)iVar11)); if (uVar8 == 0) { uVar8 = Random(); Game::Spawn(g_game,5,0x28,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar8); } } } else { pBVar7 = BitSet128::operator_and(&local_100,&this->_tearFlags,(BitSet128 *)&DAT_00c34910); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { uVar8 = Random(); uVar27 = 0; pTVar26 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor; pTVar25 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar24 = 0; pEVar9 = Game::Spawn(g_game,4,this->_variant,&this->_pos,&this->_velocity, (Entity *)this->_spawnerEntity,0,uVar8); iVar11 = __RTDynamicCast(pEVar9,uVar24,pTVar25,pTVar26,uVar27); *(int *)(iVar11 + 0x34) = this->_spawnerType; *(int *)(iVar11 + 0x38) = this->_spawnerVariant; *(undefined1 *)(iVar11 + 0x448) = 1; pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c34910,&local_100); pBVar7 = BitSet128::operator_and((BitSet128 *)&local_c0,&this->_tearFlags,pBVar7); BVar2 = *pBVar7; *(undefined1 *)(iVar11 + 0x463) = 1; *(BitSet128 *)(iVar11 + 0x438) = BVar2; if ((*(int *)(iVar11 + 0x2c) == 0x13) || (*(int *)(iVar11 + 0x2c) == 0x14)) { *(float *)(iVar11 + 0x428) = this->_rocketAngle; uVar24 = 0x3c; } else { uVar24 = 0x1e; } *(undefined4 *)(iVar11 + 0x410) = uVar24; *(undefined4 *)(iVar11 + 0x414) = uVar24; *(uint *)(iVar11 + 0x168) = *(uint *)(iVar11 + 0x168) | 0x4000000; *(uint *)(iVar11 + 0x16c) = *(uint *)(iVar11 + 0x16c) | 0x400; } pBVar7 = BitSet128::operator_and(&local_100,&this->_tearFlags,(BitSet128 *)&DAT_00c34850); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { local_84 = (undefined1 *)(this->_velocity).y; local_8c = -(this->_velocity).x; fVar16 = sqrtf((float)local_84 * (float)local_84 + local_8c * local_8c); if (0.0 < fVar16) { local_84 = (undefined1 *)((float)local_84 * (1.0 / fVar16)); local_8c = local_8c * (1.0 / fVar16); } do { uVar8 = Random(); uVar27 = 0; pTVar26 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor; scratchVec2.x = (float)local_ac * (float)local_84 * 5.0; pTVar25 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar24 = 0; scratchVec2.y = (float)local_ac * local_8c * 5.0; VStack_98.x = this->_size * (float)local_84 * (float)local_ac + (this->_pos).x; VStack_98.y = this->_size * local_8c * (float)local_ac + (this->_pos).y; pEVar9 = Game::Spawn(g_game,4,(uint)local_88,&VStack_98,&scratchVec2, (Entity *)this->_spawnerEntity,0,uVar8); iVar11 = __RTDynamicCast(pEVar9,uVar24,pTVar25,pTVar26,uVar27); *(int *)(iVar11 + 0x34) = this->_spawnerType; *(int *)(iVar11 + 0x38) = this->_spawnerVariant; *(undefined1 *)(iVar11 + 0x448) = 1; pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c34850,&local_100); pBVar7 = BitSet128::operator_and((BitSet128 *)&local_c0,&this->_tearFlags,pBVar7); flagsLow = pBVar7->_l; uVar24 = *(undefined4 *)((int)&pBVar7->_l + 4); flagsHigh = pBVar7->_h; uVar27 = *(undefined4 *)((int)&pBVar7->_h + 4); *(uint *)(iVar11 + 0x168) = *(uint *)(iVar11 + 0x168) | 0x4000000; *(uint *)(iVar11 + 0x16c) = *(uint *)(iVar11 + 0x16c) | 0x400; *(int *)(iVar11 + 0x438) = (int)flagsLow; *(undefined4 *)(iVar11 + 0x43c) = uVar24; *(int *)(iVar11 + 0x440) = (int)flagsHigh; *(undefined4 *)(iVar11 + 0x444) = uVar27; *(undefined1 *)(iVar11 + 0x463) = 1; *(undefined4 *)(iVar11 + 0x410) = 0xf; *(undefined4 *)(iVar11 + 0x414) = 0xf; *(float *)(iVar11 + 0x418) = *(float *)(iVar11 + 0x418) * 0.4; local_ac = (EntityPtr)((float)local_ac + 2.0); } while ((float)local_ac <= 1.0); } pBVar7 = BitSet128::operator_and(&local_100,&this->_tearFlags,(BitSet128 *)&DAT_00c34880); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { uVar8 = Random(); fVar16 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar16 = fVar16 + fVar16; VStack_98.y = fVar16; local_84 = (undefined1 *)cos(fVar16); local_8c = sin(VStack_98.y); local_cc.y = cos(1.5707964); VStack_98.y = sin(1.5707964); local_80[0] = (Entity_Player *)0x4; do { uVar8 = Random(); scratchVec2.x = (float)local_84 * 6.5; uVar27 = 0; pTVar26 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor; pTVar25 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; scratchVec2.y = local_8c * 6.5; uVar24 = 0; scratchVec.y = this->_size * local_8c + (this->_pos).y; scratchVec.x = this->_size * (float)local_84 + (this->_pos).x; pEVar9 = Game::Spawn(g_game,this->_type,(uint)local_88,&scratchVec,&scratchVec2, (Entity *)this->_spawnerEntity,0,uVar8); pEVar9 = (Entity *)__RTDynamicCast(pEVar9,uVar24,pTVar25,pTVar26,uVar27); pEVar9->_spawnerType = this->_spawnerType; pEVar9->_spawnerVariant = this->_spawnerVariant; pEVar9[1].field_0x3c = 1; pBVar7 = BitSet128::__bnot((BitSet128 *)&DAT_00c34880,(BitSet128 *)&local_c0); pBVar7 = BitSet128::operator_and(&local_110,&this->_tearFlags,pBVar7); flagsLow = pBVar7->_l; iVar11 = *(int *)((int)&pBVar7->_l + 4); flagsHigh = pBVar7->_h; iVar12 = *(int *)((int)&pBVar7->_h + 4); pEVar9[1]._sprite._filename._buf[0xf] = '\x01'; pEVar9[1]._variant = (int)flagsLow; pEVar9[1]._subtype = iVar11; pEVar9[1]._spawnerType = (int)flagsHigh; pEVar9[1]._spawnerVariant = iVar12; pEVar9[1]._type = (int)(this->_scale * 0.5); pEVar9[1]._damageEvents._end = (void *)((float)pEVar9[1]._damageEvents._end * 0.35); *(float *)&pEVar9[1].field_0x40 = this->_radiusMultiplier * 0.5; local_dc = (undefined1 *)((uint)g_vectorOne.y ^ 0x80000000); local_e8._8_4_ = -g_vectorOne.x; Entity::SetSize(pEVar9,pEVar9->_size * 0.5, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1) ; *(uint *)&pEVar9->_flags = (uint)pEVar9->_flags | 0x4000000; entityFlagsHi = (uint *)((int)&pEVar9->_flags + 4); *entityFlagsHi = *entityFlagsHi | 0x400; *(undefined4 *)&pEVar9[1].field_0x4 = 7; pEVar9[1]._damageEvents._begin = (void *)0x7; local_80[0] = (Entity_Player *)((int)&local_80[0][-1]._replacedPlayer + 3); fVar16 = VStack_98.y * (float)local_84; local_84 = (undefined1 *)(local_cc.y * (float)local_84 - VStack_98.y * local_8c); local_8c = local_cc.y * local_8c + fVar16; } while (local_80[0] != (Entity_Player *)0x0); local_80[0] = (Entity_Player *)0x0; } } if (this->_variant == 0x12) { this->_dead = 0; uVar8 = RNG::RandomInt(&this->_dropRNG,0x1e); this->_explosionCountdown1 = uVar8 + 0x3c; bVar6 = ANM2::SetAnimation(&this->_sprite,(byte *)"Appear",1); if (bVar6 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,8.0); } uVar8 = RNG::Next(&this->_dropRNG); pVVar13 = RandomVector((Vector *)(local_e8 + 8),uVar8); RNG::Next(&this->_dropRNG); iVar11 = (this->_dropRNG)._seed; fVar23 = (float)((double)iVar11 + __uint_to_double_fixup[-(iVar11 >> 0x1f)]) * 2.3283062e-10 * 5.0 + 5.0; fVar16 = pVVar13->x; (this->_velocity).y = fVar23 * pVVar13->y; (this->_velocity).x = fVar23 * fVar16; this->_scatterTimer = 0x5a; } EVar4 = spawner; if ((((((this->_flags & 0x40000000000) == 0) && (spawner != (EntityPtr)0x0)) && (this->_spawnerEntity == spawner)) && ((this->_isFetus == 0 && (bVar6 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)spawner + 0x1508),0x89), bVar6 != 0)))) && (bVar6 = Entity_Player::HasCollectible((Entity_Player *)EVar4,0x248,0), bVar6 != 0)) { Entity_Player::AddWisp((Entity_Player *)EVar4,0x89,&this->_pos,0,0); } } } else { if ((this->_spawnerType == 1) && (spawner != (EntityPtr)0x0)) { local_80[0] = (Entity_Player *)((int)spawner + 0x1508); bVar6 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)local_80[0],0x89); if (bVar6 != 0) goto LAB_006a4412; } if (((this->_variant != 0x13) && (this->_variant != 0x14)) || (bVar6 = Entity::HasEntityFlags((Entity *)this,0x200000000000000), bVar6 == 0)) { this->_explosionCountdown1 = this->_explosionCountdown1 + -1; } pBVar7 = BitSet128::operator_and((BitSet128 *)&local_c0,pBVar7,(BitSet128 *)&DAT_00c34b20); if (((int)pBVar7->_l != 0 || *(int *)((int)&pBVar7->_l + 4) != 0) || ((int)pBVar7->_h != 0 || *(int *)((int)&pBVar7->_h + 4) != 0)) { Game::AttractEntities(g_game,&this->_pos,(void *)0x0,(void *)0x0,10.0,250.0); } bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x3f); if (((bVar6 != 0) && (this->_explosionCountdown1 == 0)) && (((iVar11 = this->_variant, iVar11 == 3 || (((iVar11 == 4 || (iVar11 == 8)) || (iVar11 == 0x12)))) || (((iVar11 == 0x11 && (this->_spawnerType != 1)) && (bVar6 = Entity::HasEntityFlags((Entity *)this,0x20000000), bVar6 == 0)))))) { (**(code **)(*(int *)this + 0x28))(); SoundEffects::PlayWithFartOverride(900,1.0,2,0,1.0); iVar11 = this->_variant; uVar8 = 1; if (iVar11 == 4) { uVar8 = 2; } else if (iVar11 == 0x12) { uVar8 = 4; } else if (iVar11 == 0x11) { uVar8 = 7; } rngResult = Random(); pEVar9 = Game::Spawn(g_game,5,0x28,&this->_pos,&this->_velocity,(Entity *)0x0,uVar8,rngResult) ; pvVar3 = (pEVar9->_sprite)._animState._animData; if (pvVar3 != (void *)0x0) { AnimationState::SetFrameFloat (&(pEVar9->_sprite)._animState,(float)(*(int *)((int)pvVar3 + 0x30) + -8)); } uVar8 = Random(); Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar8); ExceptionList = local_1c; return; } } if (this->_variant == 4) { pVVar13 = &this->_pos; pEVar14 = Game::GetNearestPlayer(g_game,pVVar13); VStack_98.y = (pEVar14->_pos).x; local_cc.y = (pEVar14->_pos).y; pEVar14 = Game::GetNearestPlayer(g_game,pVVar13); local_a4 = ((pEVar14->_velocity).y * 5.0 + local_cc.y) - (this->_pos).y; local_80[0] = (Entity_Player *)(((pEVar14->_velocity).x * 5.0 + VStack_98.y) - pVVar13->x); fVar16 = local_a4 * local_a4 + (float)local_80[0] * (float)local_80[0]; if (fVar16 < 72900.0) { fVar16 = sqrtf(fVar16); if (fVar16 <= 0.0) { pEVar14 = local_80[0]; fVar16 = local_a4; } else { pEVar14 = (Entity_Player *)((float)local_80[0] * (1.0 / fVar16)); fVar16 = local_a4 * (1.0 / fVar16); } (this->_velocity).x = (float)pEVar14 * 1.5 + (this->_velocity).x; (this->_velocity).y = fVar16 * 1.5 + (this->_velocity).y; } game = g_game; (this->_velocity).x = (this->_velocity).x * 0.8; (this->_velocity).y = (this->_velocity).y * 0.8; if (game->_frameCount - this->_spawnFrame < 0x14) { this->_friction = this->_friction * 0.8; } } if (0 < this->_collisionCooldown) { this->_collisionCooldown = this->_collisionCooldown + -1; } if (0 < this->_parentCollisionCooldown) { this->_parentCollisionCooldown = this->_parentCollisionCooldown + -1; } if (0 < this->_scatterTimer) { this->_scatterTimer = this->_scatterTimer + -1; } game = g_game; iVar11 = g_game->_frameCount; if ((0xf < iVar11 - this->_spawnFrame) && (this->_entityCollisionClass == 1)) { this->_entityCollisionClass = 4; iVar11 = game->_frameCount; } if ((this->_explosionCountdown1 < iVar11 - this->_spawnFrame) && (this->_entityCollisionClass == 0)) { this->_entityCollisionClass = 4; } if (((*(int *)((int)g_game->_room + 8) == 0x10) && (this->_variant != 0x13)) && (this->_variant != 0x14)) { (this->_velocity).y = (this->_velocity).y + 0.9; } if (this->_variant == 0xf) { if ((0.0 <= (this->_posOffset).y) && (0.0 <= this->_fallSpeed)) { this->_friction = this->_friction * 0.8; } if ((this->_sprite)._animState._animData != (void *)0x0) { bVar6 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b670d0); manager = g_manager; if (bVar6 != 0) { local_80[0] = (Entity_Player *)0xab; seed_fart_sound_override((int *)local_80); SoundEffects::Play(&manager->_sfxManager,(int)local_80[0],1.0,2,0,1.5,0.0); } } } EVar4 = this->_stickyTarget; if (EVar4 == (EntityPtr)0x0) { if (this->_entityGridCollisionClass == 0) { this->_entityGridCollisionClass = 5; } } else { fVar16 = *(float *)((int)EVar4 + 0x364); (this->_velocity).x = *(float *)((int)EVar4 + 0x360); (this->_velocity).y = fVar16; fVar16 = *(float *)((int)EVar4 + 0x340); fVar23 = (this->_targetPosition).y; (this->_pos).x = *(float *)((int)EVar4 + 0x33c) + (this->_targetPosition).x; (this->_pos).y = fVar16 + fVar23; this->_entityCollisionClass = 0; this->_entityGridCollisionClass = 0; } if (this->_visible == 0) { this->_entityCollisionClass = 0; this->_entityGridCollisionClass = 0; this->_collisionCooldown = 4; } if (((this->_sprite)._animState._animData != (void *)0x0) && (bVar6 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"DropSound"), bVar6 != 0)) { if (this->_variant == 0x11) { SoundEffects::Play(&g_manager->_sfxManager,0x28,1.0,4,0,0.8,0.0); Game::ShakeScreen(g_game,6); } else { fVar16 = this->_scale; if (this->_variant == 0x12) { if (1.0 <= fVar16) { fVar16 = 1.0; } fVar16 = fVar16 * 0.8; iVar11 = 0x1d2; } else { if (1.0 <= fVar16) { fVar16 = 1.0; } iVar11 = 0x28; } SoundEffects::Play(&g_manager->_sfxManager,iVar11,fVar16,4,0,1.0,0.0); } } if (this->_hasCostumes != 0) { costumeLoaded = &this->_bombCostumesSprites[0]._loaded; local_80[0] = (Entity_Player *)&DAT_00000005; do { if (*costumeLoaded != 0) { AnimationState::Update((AnimationState *)(costumeLoaded + -0xd9)); AnimationState::Update((AnimationState *)(costumeLoaded + -0xb9)); } costumeLoaded = costumeLoaded + 0x114; local_80[0] = (Entity_Player *)((int)&local_80[0][-1]._replacedPlayer + 3); } while (local_80[0] != (Entity_Player *)0x0); } if ((this->_variant == 0x13) || (this->_variant == 0x14)) { fVar16 = rocketAngle; if (360.0 < ABS(rocketAngle)) { fVar16 = fmodf(rocketAngle,360.0); } if (fVar16 <= 180.0) { if (fVar16 < -180.0) { fVar16 = fVar16 + 360.0; } } else { fVar16 = fVar16 - 360.0; } if ((this->_flags & 0x200000000000000) == 0) { if ((90.0 < fVar16) || (fVar16 < -90.0)) { fVar16 = 180.0 - fVar16; (this->_sprite)._flipX = 1; } else { (this->_sprite)._flipX = 0; } } else { (this->_sprite)._flipX = 0; fVar16 = 0.0; } (this->_sprite)._rotation = fVar16; iVar11 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0); if ((iVar11 != 0) && (this->_visible != 0)) { uVar8 = Random(); scratchVec2.x = (this->_velocity).x * 0.14; rocketAngle = rocketAngle * 0.017453292; scratchVec2.y = (this->_velocity).y * 0.14; fVar16 = cos(rocketAngle); VStack_98.x = (this->_pos).x - fVar16 * 5.0 * this->_scale; fVar16 = sin(rocketAngle); VStack_98.y = (this->_pos).y - fVar16 * 5.0 * this->_scale; pEVar9 = Game::Spawn(g_game,1000,0x3b,&VStack_98,&scratchVec2,(Entity *)0x0,0,uVar8); uVar24 = Color::Color(0x3e99999a); (**(code **)(*(int *)pEVar9 + 0x3c))(uVar24,0xffffffff,0xff,0,1); uVar8 = Random(); *(float *)(pEVar9[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar8 = Random(); iVar11 = uVar8 % 0xf + 0xf; *(int *)(pEVar9[1]._sprite._filename._buf + 8) = iVar11; *(int *)(pEVar9[1]._sprite._filename._buf + 0xc) = iVar11; fVar16 = this->_scale * 0.4; fVar23 = fVar16 * g_vectorOne.y; fVar16 = fVar16 * g_vectorOne.x; pEVar9->_renderDepthOffset = -18.0; (pEVar9->_sprite)._scale.y = fVar23; (pEVar9->_sprite)._scale.x = fVar16; (pEVar9->_posOffset).x = (this->_posOffset).x; (pEVar9->_posOffset).y = (this->_posOffset).y; } } if ((1 < *(int *)&g_game->_deathmatchManager) && (iVar11 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 4))(), iVar11 == 3)) { this->_entityCollisionClass = 0; } FUN_00861f80(this); ExceptionList = local_1c; return; } //@@ 006a5a60 Entity_Bomb::Render /* ZHL [exact] __thiscall void Entity_Bomb::Render(Vector *offset); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Bomb::Render(Entity_Bomb *this,Vector *offset) { Vector *position; float fVar1; void *layerFrame; ColorMod *costumeSpriteColor; AnimationState *costumeAnimState; AnimationState *pAVar2; uint costumeIndex; float fVar3; float fVar4; float fVar5; float cosRotation; float fVar6; double dVar7; double dVar8; float costumeOffsetY; float costumeOffsetX; Vector costumePos; Color costumeColor; float local_6c [26]; float spriteRotation; if ((this->_exists != 0) && (this->_visible != 0)) { if (this->_loadCostumes != 0) { update_sparks(); } fVar6 = g_displayPixelRatio * g_screenPointScale; dVar7 = floor((double)(((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar6 + 0.5)); dVar8 = floor((double)(((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar6 + 0.5)); position = &this->_renderPosition; fVar1 = offset->y; position->x = (float)dVar7 / fVar6 + offset->x; (this->_renderPosition).y = (float)dVar8 / fVar6 + fVar1; if (this->_hasCostumes != 0) { layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); fVar1 = (this->_sprite)._scale.x; fVar3 = (*(float *)((int)layerFrame + 0x10) + (this->_sprite)._offset.x) * fVar1; fVar6 = (this->_sprite)._scale.y; fVar4 = ((this->_sprite)._offset.y + *(float *)((int)layerFrame + 0x14)) * fVar6; spriteRotation = (this->_sprite)._rotation; fVar5 = spriteRotation * 0.017453292; cosRotation = cos(fVar5); fVar5 = sin(fVar5); costumeOffsetX = cosRotation * fVar3 - fVar5 * fVar4; costumeOffsetY = cosRotation * fVar4 + fVar5 * fVar3; if ((this->_sprite)._flipX != 0) { costumeOffsetX = costumeOffsetX * -1.0; } if ((this->_sprite)._flipY != 0) { costumeOffsetY = costumeOffsetY * -1.0; } fVar3 = *(float *)((int)layerFrame + 0x5c); costumeColor._offset[2] = (this->_sprite)._color._offset[2]; fVar4 = *(float *)((int)layerFrame + 0x18); fVar5 = *(float *)((int)layerFrame + 0x1c); costumeColor._tint[0] = (this->_sprite)._color._tint[0]; costumeColor._tint[1] = (this->_sprite)._color._tint[1]; costumeColor._tint[2] = (this->_sprite)._color._tint[2]; costumeColor._tint[3] = (this->_sprite)._color._tint[3]; costumeColor._colorize[0] = (this->_sprite)._color._colorize[0]; costumeColor._colorize[1] = (this->_sprite)._color._colorize[1]; costumeColor._colorize[2] = (this->_sprite)._color._colorize[2]; costumeColor._colorize[3] = (this->_sprite)._color._colorize[3]; costumeColor._offset[0] = (this->_sprite)._color._offset[0]; costumeColor._offset[1] = (this->_sprite)._color._offset[1]; Color::__mul(&costumeColor,(ColorMod *)((int)layerFrame + 0x30)); costumeIndex = 0; do { if ((this->_bombCostumesSprites[costumeIndex]._loaded != 0) && (*(char *)((int)layerFrame + 0x2c) != '\0')) { this->_bombCostumesSprites[costumeIndex]._rotation = spriteRotation + fVar3; costumeSpriteColor = &this->_bombCostumesSprites[costumeIndex]._color; this->_bombCostumesSprites[costumeIndex]._scale.x = fVar1 * fVar4; this->_bombCostumesSprites[costumeIndex]._scale.y = fVar6 * fVar5; if (costumeSpriteColor != (ColorMod *)local_6c) { *(ulonglong *)costumeSpriteColor->_offset = CONCAT44(costumeColor._offset[1],costumeColor._offset[0]); costumeSpriteColor->_tint[0] = costumeColor._tint[0]; costumeSpriteColor->_tint[1] = costumeColor._tint[1]; costumeSpriteColor->_tint[2] = costumeColor._tint[2]; costumeSpriteColor->_tint[3] = costumeColor._tint[3]; costumeSpriteColor->_offset[2] = costumeColor._offset[2]; costumeSpriteColor->_colorize[0] = costumeColor._colorize[0]; costumeSpriteColor->_colorize[1] = costumeColor._colorize[1]; costumeSpriteColor->_colorize[2] = costumeColor._colorize[2]; costumeSpriteColor->_colorize[3] = costumeColor._colorize[3]; } costumePos.x = costumeOffsetX + position->x; costumePos.y = costumeOffsetY + (this->_renderPosition).y; if (this->_bombCostumesSprites[costumeIndex]._loaded != 0) { costumeAnimState = &this->_bombCostumesSprites[costumeIndex]._animState; pAVar2 = &this->_bombCostumesSprites[costumeIndex]._overlayAnimState; if (this->_bombCostumesSprites[costumeIndex]._overlayRenderFirst == 0) { AnimationState::Render(costumeAnimState,&costumePos,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render(pAVar2,&costumePos,&g_vectorZero,&g_vectorZero); pAVar2 = costumeAnimState; } AnimationState::Render(pAVar2,&costumePos,&g_vectorZero,&g_vectorZero); } } if ((costumeIndex == 0) && ((this->_sprite)._loaded != 0)) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,position,&g_vectorZero,&g_vectorZero) ; pAVar2 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,position,&g_vectorZero,&g_vectorZero); pAVar2 = &(this->_sprite)._animState; } AnimationState::Render(pAVar2,position,&g_vectorZero,&g_vectorZero); } costumeIndex = costumeIndex + 1; } while (costumeIndex < 5); FUN_00862060(this,offset); return; } ANM2::Render(&this->_sprite,position,&g_vectorZero,&g_vectorZero); FUN_00862060(this,offset); } return; } //@@ 006a5f00 Entity_Bomb::HandleCollision /* ZHL [exact] __thiscall bool Entity_Bomb::HandleCollision(Entity* collider, bool low); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Bomb::HandleCollision(Entity_Bomb *this,Entity *collider,byte low) { byte bVar1; int iVar2; uint uVar3; Vector *relVelocityDir; Vector *pushDir; Entity_Bomb *this_00; int extraout_EDX; int extraout_EDX_00; int extraout_EDX_01; uint extraout_EDX_02; bool bVar4; float fVar5; float fVar6; float fVar7; float fVar8; undefined3 in_stack_00000009; float fStack_68; uint uStack_64; float pushDistance; Vector VStack_5c; Vector relVelocity; undefined1 auStack_4c [8]; uint uStack_44; uint uStack_40; int damageSource; int sourceVariant; int sourceSpawnerType; int sourceSpawnerVariant; float sourcePosX; float sourcePosY; float sourceVelocityX; float sourceVelocityY; uint sourceFlags; Entity_Bomb *sourceEntity; iVar2 = LuaEngine::PreBombCollision((LuaEngine *)this,this,collider,_low); if (iVar2 == 1) { return 1; } if (iVar2 == -1) { return 0; } if (this->_pitfallState != 0) { return 1; } iVar2 = collider->_type; if ((iVar2 == 2) || (iVar2 == 4)) { if ((this->_posOffset).y <= -3.0) { return 1; } if (this->_fallSpeed <= 0.0 && this->_fallSpeed != 0.0) { return 1; } bVar1 = IsRocket(this); iVar2 = extraout_EDX; if (bVar1 != 0) { return 1; } } if ((this->_isFetus != 0) && (iVar2 == 2)) { auStack_4c._0_4_ = *(uint *)((int)&collider[1]._pendingDamageFlags + 4) & DAT_00c34780; auStack_4c._4_4_ = collider[1]._index & DAT_00c34784; uStack_44 = collider[1]._collisionIndex & DAT_00c34788; uStack_40 = collider[1]._type & DAT_00c3478c; bVar1 = BitSet128::IsNonZero((BitSet128 *)auStack_4c); if (bVar1 != 0) { return 1; } } bVar1 = IsRocket(this); if ((bVar1 != 0) && (g_game->_frameCount - this->_spawnFrame < 2)) { return 1; } if ((extraout_EDX_00 == 5) || (iVar2 = extraout_EDX_00, extraout_EDX_00 == 6)) { bVar1 = IsRocket(this_00); if (bVar1 == 0) { return 1; } if (extraout_EDX_01 == 5) { if (collider->_variant != 0x33) { return 1; } if (collider->_subtype != 1) { return 1; } } else { iVar2 = extraout_EDX_01; if (extraout_EDX_01 != 6) goto LAB_006a6050; if (collider->_dead != 0) { return 1; } } LAB_006a6094: bVar1 = Entity::HasEntityFlags(collider,0x20000000); if (bVar1 != 0) goto LAB_006a60a6; } else { LAB_006a6050: if (iVar2 == 0x38a) { return 1; } if (iVar2 == 0x387) { bVar4 = collider->_variant == 10; LAB_006a6064: if (bVar4) { return 1; } goto LAB_006a6094; } if (iVar2 == 0x395) { bVar4 = this->_spawnerType == 0x395; goto LAB_006a6064; } if (iVar2 == 0x362) { return 1; } if (((iVar2 != 1) && (iVar2 != 3)) && (iVar2 != 8)) goto LAB_006a6094; LAB_006a60a6: bVar1 = IsRocket(this); if (bVar1 != 0) { return 1; } } if ((collider->_type == 1) && ((*(int *)&g_game->_deathmatchManager < 2 || (bVar1 = Entity::IsDescendantOf((Entity *)this,collider), bVar1 != 0)))) { if ((this->_parent != (EntityPtr)0x0) && (*(int *)((int)this->_parent + 0x28) == 3)) { return 1; } if (0 < this->_collisionCooldown) { this->_collisionCooldown = 4; return 1; } fVar8 = (collider->_velocity).y; (this->_velocity).x = (collider->_velocity).x * 0.4 + (this->_velocity).x; (this->_velocity).y = fVar8 * 0.4 + (this->_velocity).y; } iVar2 = collider->_type; if ((iVar2 == 1) || (bVar4 = true, iVar2 == 9)) { bVar4 = false; } if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar2 == 1)) && (bVar1 = Entity::IsDescendantOf((Entity *)this,collider), bVar1 == 0)) || (bVar4)) { bVar1 = IsRocket(this); if (bVar1 == 0) { auStack_4c._0_4_ = DAT_00c34b50 & (uint)(this->_tearFlags)._l; auStack_4c._4_4_ = DAT_00c34b54 & *(uint *)((int)&(this->_tearFlags)._l + 4); uStack_44 = (uint)(this->_tearFlags)._h & DAT_00c34b58; uStack_40 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b5c; bVar1 = BitSet128::IsNonZero((BitSet128 *)auStack_4c); if (bVar1 != 0) goto LAB_006a61dd; } else { LAB_006a61dd: bVar1 = EntityList::HitListContains((EntityList *)&this->_hitList,collider); if (bVar1 != 0) { return 1; } uVar3 = Entity::GetHitListIndex(collider); sorted_vector_insert_unique(&this->_hitList,uVar3); } if (((EntityPtr)collider == this->_parent) && (0 < this->_parentCollisionCooldown)) { this->_parentCollisionCooldown = 4; return 1; } bVar1 = IsRocket(this); if (bVar1 == 0) { bVar1 = Entity::IsVulnerableEnemy(collider,(Entity *)0x0); if (((bVar1 != 0) || (collider->_type == 6)) || ((collider->_type == 4 && ((collider[1].field_0x3c == '\0' && (this->_isFetus != 0)))))) { auStack_4c._0_4_ = (uint)(this->_tearFlags)._l & (uint)g_tearFlagExplosive._l; auStack_4c._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagExplosive._l._4_4_ ; uStack_44 = (uint)(this->_tearFlags)._h & (uint)g_tearFlagExplosive._h; uStack_40 = *(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagExplosive._h._4_4_; bVar1 = BitSet128::IsNonZero((BitSet128 *)auStack_4c); if ((bVar1 != 0) || ((*(int *)((int)g_game->_room + 8) == 0x10 && (this->_scatterTimer < 1)))) goto LAB_006a62d2; } } else { LAB_006a62d2: this->_explosionCountdown1 = 0; } auStack_4c._0_4_ = DAT_00c34930 & (uint)(this->_tearFlags)._l; auStack_4c._4_4_ = DAT_00c34934 & *(uint *)((int)&(this->_tearFlags)._l + 4); uStack_44 = (uint)(this->_tearFlags)._h & DAT_00c34938; uStack_40 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3493c; fStack_68 = *(float *)((int)&(this->_tearFlags)._h + 4); bVar1 = BitSet128::IsNonZero((BitSet128 *)auStack_4c); if (bVar1 == 0) { LAB_006a63d1: uVar3 = extraout_EDX_02; } else { fStack_68 = *(float *)((int)&(this->_tearFlags)._h + 4); bVar1 = Entity::IsEnemy(collider); if (bVar1 == 0) goto LAB_006a63d1; uVar3 = (uint)(this->_tearFlags)._h; fStack_68 = *(float *)((int)&(this->_tearFlags)._h + 4); if ((((collider->_dead == 0) && (collider->_type != 0x21)) && (collider->_type != 0x11)) && (this->_stickyTarget == (EntityPtr)0x0)) { this->_stickyTarget = (EntityPtr)collider; std::multiset::insert(&this->_stickyTarget); fVar8 = (this->_pos).y; fVar5 = (collider->_pos).y; (this->_targetPosition).x = (this->_pos).x - (collider->_pos).x; (this->_targetPosition).y = fVar8 - fVar5; uVar3 = (uint)(this->_tearFlags)._h; fStack_68 = *(float *)((int)&(this->_tearFlags)._h + 4); } } auStack_4c._0_4_ = (DAT_00c34930 | (uint)g_tearFlagExplosive._l) & (uint)(this->_tearFlags)._l; auStack_4c._4_4_ = (DAT_00c34934 | g_tearFlagExplosive._l._4_4_) & *(uint *)((int)&(this->_tearFlags)._l + 4); uStack_40 = (DAT_00c3493c | g_tearFlagExplosive._h._4_4_) & (uint)fStack_68; uStack_44 = (DAT_00c34938 | (uint)g_tearFlagExplosive._h) & uVar3; bVar1 = BitSet128::IsZero((BitSet128 *)auStack_4c); if (((bVar1 != 0) && (bVar1 = Entity::IsVulnerableEnemy(collider,(Entity *)0x0), bVar1 != 0)) && ((collider->_dead == 0 && (0.0 < this->_collisionDamage)))) { sourcePosX = (this->_pos).x; sourcePosY = (this->_pos).y; damageSource = this->_type; sourceVariant = this->_variant; sourceSpawnerType = this->_spawnerType; sourceSpawnerVariant = this->_spawnerVariant; sourceVelocityX = (this->_velocity).x; sourceVelocityY = (this->_velocity).y; uStack_64 = (uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar3 = 0; } else { uVar3 = 2; } if ((this->_flags & 0x40000000000000) == 0) { sourceFlags = 0; } else { sourceFlags = 4; } sourceFlags = uVar3 | uStack_64 | sourceFlags; sourceEntity = this; (**(code **)(*(int *)collider + 0x20))(this->_collisionDamage,0,0,&damageSource,0x1e); if (collider->_health <= collider->_pendingDamage) { LAB_006a660f: bVar1 = Entity::HasEntityFlags(collider,0x40000000); if (bVar1 != 0) { return 1; } fStack_68 = (collider->_pos).y - (this->_pos).y; fVar8 = (collider->_pos).x - (this->_pos).x; auStack_4c._0_4_ = fVar8; auStack_4c._4_4_ = fStack_68; pushDistance = sqrtf(fStack_68 * fStack_68 + fVar8 * fVar8); if (pushDistance < 0.0001) { return 1; } fVar6 = (this->_velocity).y - (collider->_velocity).y; VStack_5c.x = (this->_velocity).x - (collider->_velocity).x; relVelocity.x = VStack_5c.x; relVelocity.y = fVar6; fVar5 = sqrtf(fVar6 * fVar6 + VStack_5c.x * VStack_5c.x); if (((collider->_size + this->_size) * 0.5 < fVar5) && (fVar6 * fStack_68 + VStack_5c.x * fVar8 < 0.0)) { relVelocityDir = Vector::Normalized(&relVelocity,&VStack_5c); pushDir = Vector::Normalized((Vector *)auStack_4c,&relVelocity); fVar5 = relVelocityDir->y * pushDir->y + relVelocityDir->x * pushDir->x; fVar6 = fVar5 * fStack_68; fVar5 = fVar5 * fVar8; fStack_68 = fVar6 + fVar6 + fStack_68; fVar8 = fVar8 + fVar5 + fVar5; pushDistance = sqrtf(fStack_68 * fStack_68 + fVar8 * fVar8); } fVar5 = Entity::IsCollisionIgnored((Entity *)this,collider); fVar6 = Entity::IsCollisionIgnored(collider,(Entity *)this); fVar5 = fVar5 / (fVar6 + fVar5); fVar6 = (collider->_velocity).y - (this->_velocity).y; fVar7 = (collider->_velocity).x - (this->_velocity).x; fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); (collider->_velocity).x = (fVar8 / pushDistance) * fVar6 * fVar5 + (collider->_velocity).x; (collider->_velocity).y = (fStack_68 / pushDistance) * fVar6 * fVar5 + (collider->_velocity).y; return 1; } auStack_4c._0_4_ = (uint)(this->_tearFlags)._l & DAT_00c34b50; auStack_4c._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b54; uStack_44 = (uint)(this->_tearFlags)._h & DAT_00c34b58; uStack_40 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b5c; bVar1 = BitSet128::IsNonZero((BitSet128 *)auStack_4c); if (bVar1 != 0) goto LAB_006a660f; this->_collisionDamage = 0.0; } } if ((collider->_type == 0x194) && (collider->_spawnerType == 0x19b)) { return 1; } bVar1 = Entity::HasEntityFlags(collider,0x20000000); if (bVar1 != 0) { return 1; } iVar2 = collider->_type; if (iVar2 == 0x123) { return 1; } if (low == 0) { LAB_006a6861: if (iVar2 == 2) { if ((collider->_spawnerType != 1) && (this->_isFetus != 0)) { return 1; } } else if (iVar2 == 8) { return 1; } if (low == 0) { return 0; } if (iVar2 != 4) { if (iVar2 == 0x3e) { return 0; } goto LAB_006a68a3; } } else { if (iVar2 != 4) { if (iVar2 == 9) { return 1; } goto LAB_006a6861; } if (this->_isFetus != 0) { return 1; } } bVar1 = IsRocket((Entity_Bomb *)collider); if (bVar1 != 0) { return 0; } LAB_006a68a3: (collider->_velocity).x = (collider->_velocity).x * 0.2; (collider->_velocity).y = (collider->_velocity).y * 0.2; (this->_velocity).x = (this->_velocity).x * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; return 0; } //@@ 006a6910 FUN_006a6910 void FUN_006a6910(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int in_ECX; *(undefined1 *)(in_ECX + 0x463) = 1; *(undefined4 *)(in_ECX + 0x438) = param_1; *(undefined4 *)(in_ECX + 0x43c) = param_2; *(undefined4 *)(in_ECX + 0x440) = param_3; *(undefined4 *)(in_ECX + 0x444) = param_4; return; } //@@ 006a6930 FUN_006a6930 void FUN_006a6930(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x434) = in_XMM1_Da; *(undefined1 *)(in_ECX + 0x463) = 1; return; } //@@ 006a6940 FUN_006a6940 void FUN_006a6940(void) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; int in_ECX; char *pcVar5; bool bVar6; *(undefined4 *)(in_ECX + 0x188) = 0; *(undefined4 *)(in_ECX + 0x3fc) = 1; *(undefined4 *)(in_ECX + 0x400) = 0; pbVar1 = *(byte **)(in_ECX + 0x7c); if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Collect"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_006a69a0: uVar4 = -(uint)bVar6 | 1; goto LAB_006a69a5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_006a69a0; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_006a69a5: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if (*(char *)(in_ECX + 0x8c) != '\0') { return; } } } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),(byte *)"Collect",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x78)); *(undefined1 *)(in_ECX + 0x8c) = 1; } return; } //@@ 006a69e0 resolve_resource_path /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? (out string, path, vector roots): tries each root (0x18-byte std::string entries) then ModManager::TryRedirectPath/FileSystem::ResolvePath; called from Entity_Bomb::update_sparks for the sparks gfx */ char * resolve_resource_path(char *param_1,byte *param_2,int *param_3) { undefined8 uVar1; uint uVar2; int iVar3; qword qVar4; undefined4 uVar5; uint uVar6; byte *******pppppppbVar7; undefined4 *puVar8; undefined4 *extraout_EAX; byte *pbVar9; uint length; std_string *allocSource; void *pvVar10; byte *******pppppppbVar11; qword *pqVar12; int iVar13; uint local_b4; int local_ac; void *local_a0 [2]; byte *local_98; char acStack_94 [4]; uint uStack_90; uint uStack_8c; void *local_84 [4]; undefined4 local_74; uint local_70; byte *******local_6c [4]; uint local_5c; uint local_58; byte *******local_54; undefined1 local_50; uint local_44; uint local_40; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; puStack_20 = (undefined1 *)(local_6c + 0x1a); local_14 = (byte ******)0xffffffff; puStack_18 = &LAB_00afa1d5; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_6c + 0x17); ExceptionList = &local_1c; local_24 = uVar6; if (*param_3 == param_3[1]) { puStack_20 = (undefined1 *)(local_6c + 0x1a); std::string::string(param_1,param_2); } else { uVar2 = *(uint *)(param_2 + 0x10); local_5c = 0; local_58 = 0xf; local_6c[0] = (byte *******)0x0; length = uVar2 - 4; if (uVar2 < uVar2 - 4) { length = uVar2; } pbVar9 = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { pbVar9 = *(byte **)param_2; } std::string::assign((char *)local_6c,pbVar9,length); local_14 = (byte ******)0x0; local_44 = 0; local_40 = 0xf; uVar2 = *(uint *)(param_2 + 0x10) - 4; local_54 = (byte *******)0x0; if (*(uint *)(param_2 + 0x10) < uVar2) { /* WARNING: Subroutine does not return */ FUN_00499950(uVar6); } pbVar9 = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { pbVar9 = *(byte **)param_2; } pppppppbVar11 = *(byte ********)(pbVar9 + uVar2); local_44 = 4; local_50 = 0; local_14 = (byte ******)0x1; local_54 = pppppppbVar11; std::string::string(local_3c._buf,param_2); local_14._0_1_ = 2; local_b4 = 0; iVar13 = *param_3; iVar3 = param_3[1] - iVar13 >> 0x1f; if ((param_3[1] - iVar13) / 0x18 + iVar3 != iVar3) { local_ac = 0; do { uVar6 = *(uint *)(iVar13 + 0x10 + local_ac); allocSource = (std_string *)(iVar13 + local_ac); if (0x7fffffff - local_5c < uVar6) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar7 = (byte *******)local_6c; if (0xf < local_58) { pppppppbVar7 = local_6c[0]; } if (0xf < allocSource->_capacity) { allocSource = *(std_string **)allocSource->_buf; } std::string::concat((char *)local_84,(int)param_2,allocSource,(byte *)pppppppbVar7,local_5c, (byte *)allocSource,uVar6); local_14._0_1_ = 3; pppppppbVar7 = (byte *******)&local_54; if (0xf < local_40) { pppppppbVar7 = pppppppbVar11; } puVar8 = std::string::append((char *)local_84,(byte *)pppppppbVar7,local_44); local_98 = (byte *)*puVar8; acStack_94 = (char [4])puVar8[1]; uStack_90 = puVar8[2]; uStack_8c = puVar8[3]; uVar1 = *(undefined8 *)(puVar8 + 4); puVar8[4] = 0; puVar8[5] = 0xf; *(undefined1 *)puVar8 = 0; std::string::_Tidy_deallocate(local_3c._buf); local_3c._buf._0_4_ = local_98; local_3c._buf[4] = acStack_94[0]; local_3c._buf[5] = acStack_94[1]; local_3c._buf[6] = acStack_94[2]; local_3c._buf[7] = acStack_94[3]; local_3c._buf[8] = (undefined1)uStack_90; local_3c._buf[9] = uStack_90._1_1_; local_3c._buf[10] = uStack_90._2_1_; local_3c._buf[0xb] = uStack_90._3_1_; local_3c._buf[0xc] = (undefined1)uStack_8c; local_3c._buf[0xd] = uStack_8c._1_1_; local_3c._buf[0xe] = uStack_8c._2_1_; local_3c._buf[0xf] = uStack_8c._3_1_; local_14._0_1_ = 2; local_3c._16_8_ = uVar1; if (0xf < local_70) { uVar6 = local_70 + 1; pvVar10 = local_84[0]; if (0xfff < uVar6) { pvVar10 = *(void **)((int)local_84[0] + -4); uVar6 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar10))) goto LAB_006a6eec; } operator_delete(pvVar10,uVar6); } local_74 = 0; local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)local_a0,&local_3c); if (&local_3c != (std_string *)extraout_EAX) { if (0xf < local_3c._capacity) { uVar6 = local_3c._capacity + 1; pbVar9 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar6) { pbVar9 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar6 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar9))) goto LAB_006a6eec; } operator_delete(pbVar9,uVar6); } local_3c._buf._0_4_ = *extraout_EAX; local_3c._buf._4_4_ = extraout_EAX[1]; local_3c._buf._8_4_ = extraout_EAX[2]; local_3c._buf._12_4_ = extraout_EAX[3]; local_3c._16_8_ = *(undefined8 *)(extraout_EAX + 4); extraout_EAX[4] = 0; extraout_EAX[5] = 0xf; *(undefined1 *)extraout_EAX = 0; } if (0xf < uStack_8c) { uVar6 = uStack_8c + 1; pvVar10 = local_a0[0]; if (0xfff < uVar6) { pvVar10 = *(void **)((int)local_a0[0] + -4); uVar6 = uStack_8c + 0x24; if (0x1f < (uint)((int)local_a0[0] + (-4 - (int)pvVar10))) goto LAB_006a6eec; } operator_delete(pvVar10,uVar6); } pbVar9 = (byte *)&local_3c; if (0xf < local_3c._capacity) { pbVar9 = (byte *)local_3c._buf._0_4_; } pbVar9 = FileSystem::ResolvePath(pbVar9); if (pbVar9 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)(pbVar9 + -4); qVar4 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar6; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar4 < uVar6); free(pbVar9 + -4); local_14._0_1_ = 2; } uVar5 = local_3c._buf._0_4_; if (pbVar9 != (byte *)0x0) { local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\0'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *(undefined4 *)param_1 = uVar5; *(undefined4 *)(param_1 + 4) = local_3c._buf._4_4_; *(undefined4 *)(param_1 + 8) = local_3c._buf._8_4_; *(undefined4 *)(param_1 + 0xc) = local_3c._buf._12_4_; *(undefined8 *)(param_1 + 0x10) = local_3c._16_8_; local_3c._size = 0; local_3c._capacity = 0xf; if (0xf < local_40) { uVar6 = local_40 + 1; pppppppbVar11 = local_54; if (0xfff < uVar6) { pppppppbVar11 = (byte *******)local_54[-1]; uVar6 = local_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)pppppppbVar11))) goto LAB_006a6eec; } operator_delete(pppppppbVar11,uVar6); } if (local_58 < 0x10) { ExceptionList = local_1c; return param_1; } uVar6 = local_58 + 1; pppppppbVar11 = local_6c[0]; if (0xfff < uVar6) { pppppppbVar11 = (byte *******)local_6c[0][-1]; uVar6 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)pppppppbVar11))) goto LAB_006a6eec; } operator_delete(pppppppbVar11,uVar6); ExceptionList = local_1c; return param_1; } local_ac = local_ac + 0x18; local_b4 = local_b4 + 1; iVar13 = *param_3; pppppppbVar11 = local_54; } while (local_b4 < (uint)((param_3[1] - iVar13) / 0x18)); } std::string::string(param_1,param_2); if (0xf < local_3c._capacity) { uVar6 = local_3c._capacity + 1; pbVar9 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar6) { pbVar9 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar6 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar9))) goto LAB_006a6eec; } operator_delete(pbVar9,uVar6); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < local_40) { uVar6 = local_40 + 1; pppppppbVar7 = pppppppbVar11; if (0xfff < uVar6) { pppppppbVar7 = (byte *******)pppppppbVar11[-1]; uVar6 = local_40 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbVar11 + (-4 - (int)pppppppbVar7))) goto LAB_006a6eec; } operator_delete(pppppppbVar7,uVar6); } if (0xf < local_58) { uVar6 = local_58 + 1; pppppppbVar11 = local_6c[0]; if (0xfff < uVar6) { pppppppbVar11 = (byte *******)local_6c[0][-1]; uVar6 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)pppppppbVar11))) { LAB_006a6eec: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar11,uVar6); } } ExceptionList = local_1c; return param_1; } //@@ 006a6f10 Entity_Bomb::update_sparks /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "sparks"; Bomb Update/Render */ void __thiscall Entity_Bomb::update_sparks(Entity_Bomb *this) { uint *puVar1; int iVar2; undefined4 uVar3; byte bVar4; BitSet128 *pBVar5; byte ******ppppppbVar6; undefined4 *puVar7; byte ******ppppppbVar8; void *pvVar9; BitSet128 *text; std_string *psVar10; LayerState *layer; Entity_Bomb *pEVar11; std_string *psVar12; byte extraout_CL; byte extraout_CL_00; int iVar13; Entity_Bomb *extraout_ECX; Entity_Bomb *pEVar14; uint uVar15; byte *layerIdx; ANM2 *costumeSprite; int iVar16; BitSet128 *pBVar17; float fVar18; float fVar19; BitSet128 local_200; uint costumeEntryIdx; ANM2 *costumeIter; BitSet128 *costumeEntry; uint *local_1e4; undefined1 local_1e0 [8]; std_string *local_1d8; std_string *local_1d4; Sprite *local_1cc; uint slot; ANM2 *local_1c4; float local_1c0; std_string *local_1bc; std_string *local_1b8; uint *local_1b4; Entity_Bomb *bomb; char isAnimPlaying; void *local_1a8; undefined4 uStack_1a4; undefined4 uStack_1a0; undefined4 uStack_19c; undefined8 local_198; std_string tmpPath; std_string local_178; byte ******savedAnimName [4]; int local_150; uint local_14c; void *spritePath; char acStack_144 [4]; char acStack_140 [4]; char acStack_13c [4]; uint local_138; uint uStack_134; void *local_130 [4]; undefined4 local_120; uint local_11c; byte ******local_118; uint uStack_114; uint uStack_110; uint uStack_10c; uint *local_108; uint local_104; byte ******sizeSuffix [4]; uint local_f0; uint local_ec; void *local_e8; undefined1 local_e3; undefined4 local_d8; uint local_d4; std_string costumePaths [5]; BitSet128 local_54; int local_44; undefined1 local_3c [16]; int local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00afa2e9; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; costumeSprite = this->_bombCostumesSprites; this->_hasCostumes = 0; this->_loadCostumes = 0; iVar16 = 5; costumeIter = costumeSprite; bomb = this; do { if (costumeSprite->_loaded != 0) { ANM2::Reset(costumeSprite); } manager = g_manager; costumeSprite = costumeSprite + 1; iVar16 = iVar16 + -1; } while (iVar16 != 0); fVar18 = (float)bomb->_variant; local_1c0 = fVar18; std::set::find_node(local_1e0 + 4,&local_1c0); pEVar11 = bomb; if ((local_1d4->_buf[0xd] != '\0') || (psVar10 = local_1d4, (int)fVar18 < (int)local_1d4->_size)) { psVar10 = *(std_string **)&manager->field_0x2a514; } if ((psVar10 == *(std_string **)&manager->field_0x2a514) || (local_1cc = (Sprite *)&psVar10->_capacity, local_1cc == (Sprite *)0x0)) { if ((fVar18 == 1.4013e-44) || (((fVar18 == 8.40779e-45 || (fVar18 == 1.4013e-45)) || (fVar18 == 2.8026e-45)))) { fVar18 = bomb->_scale / 1.5; } else { fVar18 = bomb->_scale; } fVar19 = fVar18 * g_vectorOne.y; (bomb->_sprite)._scale.x = fVar18 * g_vectorOne.x; (bomb->_sprite)._scale.y = fVar19; ExceptionList = local_1c; return; } pvVar9 = (bomb->_sprite)._animState._animData; if (pvVar9 == (void *)0x0) { local_14c = 0xf; local_150 = 0; savedAnimName[0] = (byte ******)0x0; pvVar9 = (void *)0x0; } else { std::string::string((char *)savedAnimName,pvVar9); pvVar9 = (pEVar11->_sprite)._animState._animData; } local_1c0 = (pEVar11->_sprite)._animState._animFrame; if ((pvVar9 == (void *)0x0) || (isAnimPlaying = '\x01', (pEVar11->_sprite)._animState._isPlaying == 0)) { isAnimPlaying = '\0'; } local_ec = 0xf; fVar18 = pEVar11->_scale; if (0.5 < fVar18) { if (0.75 < fVar18) { bVar4 = 0x32; if (1.1 < fVar18) { bVar4 = 0x33; } } else { bVar4 = 0x31; } sizeSuffix[0] = (byte ******)(uint)bVar4; } else { sizeSuffix[0] = (byte ******)0x30; } local_1c4 = &pEVar11->_sprite; (pEVar11->_sprite)._scale.x = g_vectorOne.x; local_f0 = 1; (pEVar11->_sprite)._scale.y = g_vectorOne.y; local_138 = 0; uStack_134 = 0xf; spritePath = (void *)0x0; local_14 = 2; _eh_vector_constructor_iterator_(costumePaths,0x18,5,FUN_0040c380,std::string::_Tidy_deallocate); local_14._0_1_ = 3; _eh_vector_constructor_iterator_(&local_54,0x18,2,FUN_0040c380,std::string::_Tidy_deallocate); local_14._0_1_ = 4; costumeEntryIdx = 0; iVar16 = *(int *)(local_1cc->_filename)._buf; iVar13 = *(int *)((local_1cc->_filename)._buf + 4) - iVar16; iVar2 = iVar13 >> 0x1f; if (iVar13 / 0xe0 + iVar2 != iVar2) { local_1bc = (std_string *)&pEVar11->_tearFlags; do { pBVar17 = (BitSet128 *)(costumeEntryIdx * 0xe0 + iVar16); costumeEntry = pBVar17; pBVar5 = BitSet128::operator_and((BitSet128 *)local_1e0,(BitSet128 *)local_1bc,pBVar17); if ((((int)pBVar5->_l == (int)pBVar17->_l) && (*(int *)((int)&pBVar5->_l + 4) == *(int *)((int)&pBVar17->_l + 4))) && (((int)pBVar5->_h == (int)pBVar17->_h && (((*(int *)((int)&pBVar5->_h + 4) == *(int *)((int)&pBVar17->_h + 4) && (pBVar5 = BitSet128::operator_and(&local_200,(BitSet128 *)local_1bc,pBVar17 + 1), (int)pBVar5->_l == 0 && *(int *)((int)&pBVar5->_l + 4) == 0)) && ((int)pBVar5->_h == 0 && *(int *)((int)&pBVar5->_h + 4) == 0)))))) { if ((int)pBVar17[3]._l != 0) { local_1b8 = (std_string *)(pBVar17 + 2); puVar1 = *(uint **)&pBVar17[3]._l; if (0xf < *(uint *)((int)&pBVar17[3]._l + 4)) { local_1b8 = *(std_string **)local_1b8->_buf; } if (&DAT_0000000f < puVar1) { uVar15 = (uint)puVar1 | 0xf; if (0x7fffffff < uVar15) { uVar15 = 0x7fffffff; } local_118 = std::_Allocate(uVar15 + 1); memcpy(local_118,local_1b8,(size_t)((int)puVar1 + 1)); } else { local_118 = *(byte *******)local_1b8->_buf; uStack_114 = *(uint *)(local_1b8->_buf + 4); uStack_110 = *(uint *)(local_1b8->_buf + 8); uStack_10c = *(uint *)(local_1b8->_buf + 0xc); uVar15 = 0xf; } ppppppbVar8 = local_118; local_14._0_1_ = 5; local_1b4 = (uint *)((int)puVar1 + -5); local_d4 = 0xf; local_e8 = (void *)0x0; local_108 = puVar1; local_104 = uVar15; if (puVar1 < local_1b4) { LAB_006a7eb2: local_d4 = 0xf; local_d8 = 0; local_e8 = (void *)0x0; /* WARNING: Subroutine does not return */ FUN_00499950(); } ppppppbVar6 = (byte ******)&local_118; if (0xf < uVar15) { ppppppbVar6 = local_118; } local_d8 = 5; memmove(&local_e8,(byte *)((int)local_1b4 + (int)ppppppbVar6),5); local_e3 = 0; local_14._0_1_ = 6; ppppppbVar6 = (byte ******)&local_118; if (0xf < uVar15) { ppppppbVar6 = ppppppbVar8; } local_120 = 0; local_11c = 0xf; local_130[0] = (void *)0x0; std::string::assign((char *)local_130,(byte *)ppppppbVar6,(uint)local_1b4); local_14._0_1_ = 7; ppppppbVar8 = (byte ******)sizeSuffix; if (0xf < local_ec) { ppppppbVar8 = sizeSuffix[0]; } puVar7 = std::string::append((char *)local_130,(byte *)ppppppbVar8,local_f0); local_1a8 = (void *)*puVar7; uStack_1a4 = puVar7[1]; uStack_1a0 = puVar7[2]; uStack_19c = puVar7[3]; local_198 = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; local_14._0_1_ = 8; std::string::concat_move(local_178._buf,(int)local_1c0,&local_1a8,&local_e8); if (0xf < uStack_134) { uVar15 = uStack_134 + 1; pvVar9 = spritePath; if (0xfff < uVar15) { pvVar9 = *(void **)((int)spritePath + -4); uVar15 = uStack_134 + 0x24; if (0x1f < (uint)((int)spritePath + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } spritePath = (void *)local_178._buf._0_4_; acStack_144[0] = local_178._buf[4]; acStack_144[1] = local_178._buf[5]; acStack_144[2] = local_178._buf[6]; acStack_144[3] = local_178._buf[7]; acStack_140[0] = local_178._buf[8]; acStack_140[1] = local_178._buf[9]; acStack_140[2] = local_178._buf[10]; acStack_140[3] = local_178._buf[0xb]; acStack_13c[0] = local_178._buf[0xc]; acStack_13c[1] = local_178._buf[0xd]; acStack_13c[2] = local_178._buf[0xe]; acStack_13c[3] = local_178._buf[0xf]; local_14._0_1_ = 7; local_138 = local_178._size; uStack_134 = local_178._capacity; if (0xf < local_198._4_4_) { uVar15 = local_198._4_4_ + 1; pvVar9 = local_1a8; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_1a8 + -4); uVar15 = local_198._4_4_ + 0x24; if (0x1f < (uint)((int)local_1a8 + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } local_14._0_1_ = 6; if (0xf < local_11c) { uVar15 = local_11c + 1; pvVar9 = local_130[0]; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_130[0] + -4); uVar15 = local_11c + 0x24; if (0x1f < (uint)((int)local_130[0] + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } local_14._0_1_ = 5; local_120 = 0; local_11c = 0xf; local_130[0] = (void *)((uint)local_130[0] & 0xffffff00); if (0xf < local_d4) { uVar15 = local_d4 + 1; pvVar9 = local_e8; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_e8 + -4); uVar15 = local_d4 + 0x24; if (0x1f < (uint)((int)local_e8 + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } local_14._0_1_ = 4; if (0xf < local_104) { uVar15 = local_104 + 1; ppppppbVar8 = local_118; if (0xfff < uVar15) { ppppppbVar8 = (byte ******)local_118[-1]; uVar15 = local_104 + 0x24; if ((byte *)0x1f < (byte *)((int)local_118 + (-4 - (int)ppppppbVar8))) goto LAB_006a7e25; } operator_delete(ppppppbVar8,uVar15); } pBVar17 = costumeEntry; } local_1b8 = costumePaths; slot = 0; local_1e4 = (uint *)((int)&pBVar17[4]._h + 4); do { puVar1 = (uint *)local_1e4[-1]; if (puVar1 != (uint *)0x0) { local_1b4 = local_1e4 + -5; if (0xf < *local_1e4) { local_1b4 = (uint *)*local_1b4; } if (&DAT_0000000f < puVar1) { uVar15 = (uint)puVar1 | 0xf; if (0x7fffffff < uVar15) { uVar15 = 0x7fffffff; } local_118 = std::_Allocate(uVar15 + 1); memcpy(local_118,local_1b4,(size_t)((int)puVar1 + 1)); } else { local_118 = (byte ******)*local_1b4; uStack_114 = local_1b4[1]; uStack_110 = local_1b4[2]; uStack_10c = local_1b4[3]; uVar15 = 0xf; } local_14._0_1_ = 9; local_d4 = 0xf; local_e8 = (void *)0x0; local_108 = puVar1; local_104 = uVar15; if (puVar1 < (uint *)((int)puVar1 + -5)) goto LAB_006a7eb2; ppppppbVar8 = (byte ******)&local_118; if (0xf < uVar15) { ppppppbVar8 = local_118; } local_d8 = 5; memmove(&local_e8,(byte *)((int)puVar1 + -5 + (int)ppppppbVar8),5); local_e3 = 0; local_14._0_1_ = 10; local_120 = 0; ppppppbVar8 = (byte ******)&local_118; if (0xf < uVar15) { ppppppbVar8 = local_118; } local_11c = 0xf; local_130[0] = (void *)0x0; std::string::assign((char *)local_130,(byte *)ppppppbVar8,(uint)((int)puVar1 + -5)); local_14._0_1_ = 0xb; ppppppbVar8 = (byte ******)sizeSuffix; if (0xf < local_ec) { ppppppbVar8 = sizeSuffix[0]; } pvVar9 = std::string::append((char *)local_130,(byte *)ppppppbVar8,local_f0); FUN_00417100(pvVar9); local_14 = CONCAT31(local_14._1_3_,0xc); std::string::concat_move(local_178._buf,(int)local_1c0,&tmpPath,&local_e8); psVar10 = local_1b8; if (local_1b8 != &local_178) { std::string::_Tidy_deallocate(local_1b8->_buf); uVar3 = local_178._buf._0_4_; local_178._buf._0_4_ = local_178._buf._0_4_ & 0xffffff00; *(undefined4 *)psVar10->_buf = uVar3; *(undefined4 *)(psVar10->_buf + 4) = local_178._buf._4_4_; *(undefined4 *)(psVar10->_buf + 8) = local_178._buf._8_4_; *(undefined4 *)(psVar10->_buf + 0xc) = local_178._buf._12_4_; psVar10->_size = local_178._size; psVar10->_capacity = local_178._capacity; local_178._size = 0; local_178._capacity = 0xf; } std::string::_Tidy_deallocate(local_178._buf); std::string::_Tidy_deallocate(tmpPath._buf); local_14._0_1_ = 10; if (0xf < local_11c) { uVar15 = local_11c + 1; pvVar9 = local_130[0]; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_130[0] + -4); uVar15 = local_11c + 0x24; if (0x1f < (uint)((int)local_130[0] + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } local_14._0_1_ = 9; local_120 = 0; local_11c = 0xf; local_130[0] = (void *)((uint)local_130[0] & 0xffffff00); if (0xf < local_d4) { uVar15 = local_d4 + 1; pvVar9 = local_e8; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_e8 + -4); uVar15 = local_d4 + 0x24; if (0x1f < (uint)((int)local_e8 + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } local_14._0_1_ = 4; if (0xf < local_104) { uVar15 = local_104 + 1; ppppppbVar8 = local_118; if (0xfff < uVar15) { ppppppbVar8 = (byte ******)local_118[-1]; uVar15 = local_104 + 0x24; if ((byte *)0x1f < (byte *)((int)local_118 + (-4 - (int)ppppppbVar8))) goto LAB_006a7e25; } operator_delete(ppppppbVar8,uVar15); } local_1b8 = psVar10; } slot = slot + 1; local_1e4 = local_1e4 + 6; local_1b8 = local_1b8 + 1; } while (slot < 5); pBVar17 = &local_54; pBVar5 = costumeEntry + 0xb; local_1b4 = (uint *)0x2; do { uVar15 = (uint)pBVar5[1]._l; if ((uVar15 != 0) && (pBVar17 != pBVar5)) { text = pBVar5; if (0xf < *(uint *)((int)&pBVar5[1]._l + 4)) { text = *(BitSet128 **)&pBVar5->_l; } std::string::assign((char *)pBVar17,(byte *)text,uVar15); } pBVar5 = (BitSet128 *)&pBVar5[1]._h; pBVar17 = (BitSet128 *)&pBVar17[1]._h; local_1b4 = (uint *)((int)local_1b4 + -1); } while (local_1b4 != (uint *)0x0); } costumeEntryIdx = costumeEntryIdx + 1; iVar16 = *(int *)(local_1cc->_filename)._buf; } while (costumeEntryIdx < (uint)((*(int *)((local_1cc->_filename)._buf + 4) - iVar16) / 0xe0)); } local_1e0._4_4_ = 0; local_1d8 = (std_string *)0x0; local_1d4 = (std_string *)0x0; local_14._0_1_ = 0xd; if (local_44 == 0) { LAB_006a794a: psVar10 = local_1d4; psVar12 = local_1d8; if (local_2c != 0) { if (local_1d8 == local_1d4) { vector_string_emplace_reallocate(local_1e0 + 4,local_1d8,local_3c); psVar10 = local_1d4; } else { std::string::string(local_1d8->_buf,local_3c); local_1d8 = psVar12 + 1; } } } else { psVar10 = (std_string *)0x0; if (local_2c != 0) { psVar10 = (std_string *)FUN_00694120(local_3c); local_14._0_1_ = 0xe; vector_string_emplace_reallocate_move(local_1e0 + 4,(std_string *)0x0,psVar10); local_14._0_1_ = 0xd; std::string::_Tidy_deallocate(tmpPath._buf); goto LAB_006a794a; } } psVar12 = local_1d8; if (local_44 != 0) { if (local_1d8 == psVar10) { vector_string_emplace_reallocate(local_1e0 + 4,local_1d8,&local_54); } else { std::string::string(local_1d8->_buf,&local_54); local_1d8 = psVar12 + 1; } } if (local_138 != 0) { ANM2::Load(local_1c4,(std_string *)&spritePath,0); pEVar11 = bomb; layerIdx = (byte *)0x0; bVar4 = extraout_CL; if ((bomb->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&pEVar11->_sprite,layerIdx); if (layer->_layerData == (void *)0x0) { local_d8 = 0; local_d4 = 0xf; local_e8 = (void *)0x0; std::string::assign((char *)&local_e8,&s_empty,0); } else { std::string::string((char *)&local_e8,(void *)((int)layer->_layerData + 0x20)); } local_14._0_1_ = 0xf; resolve_resource_path(&tmpPath,&local_e8,local_1e0 + 4); local_14._0_1_ = 0x11; if (0xf < local_d4) { uVar15 = local_d4 + 1; pvVar9 = local_e8; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_e8 + -4); uVar15 = local_d4 + 0x24; if (0x1f < (uint)((int)local_e8 + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } Sprite::ReplaceSpritesheet((Sprite *)&pEVar11->_sprite,(int)layerIdx,&tmpPath); local_14._0_1_ = 0xd; std::string::_Tidy_deallocate(tmpPath._buf); layerIdx = layerIdx + 1; bVar4 = extraout_CL_00; } while (layerIdx < (byte *)(pEVar11->_sprite)._layerCount); } ANM2::LoadGraphics(local_1c4,bVar4); layer = ANM2::GetLayer(local_1c4,(byte *)"sparks"); if (layer != (LayerState *)0x0) { layer->_bitflags = layer->_bitflags | 1; } } local_1bc = costumePaths; local_1c4 = (ANM2 *)0x0; do { psVar10 = local_1bc; costumeSprite = costumeIter; if (local_1bc->_size != 0) { ANM2::Load(costumeIter,local_1bc,0); layerIdx = (byte *)0x0; pEVar11 = bomb; pEVar14 = extraout_ECX; if (bomb->_bombCostumesSprites[0]._layerCount != 0) { do { local_1cc = (Sprite *)pEVar11->_bombCostumesSprites; layer = ANM2::GetLayer((ANM2 *)local_1cc,layerIdx); if (layer->_layerData == (void *)0x0) { local_d8 = 0; local_d4 = 0xf; local_e8 = (void *)0x0; std::string::assign((char *)&local_e8,&s_empty,0); } else { std::string::string((char *)&local_e8,(void *)((int)layer->_layerData + 0x20)); } local_14._0_1_ = 0x12; resolve_resource_path(&tmpPath,&local_e8,local_1e0 + 4); local_14._0_1_ = 0x14; if (0xf < local_d4) { uVar15 = local_d4 + 1; pvVar9 = local_e8; if (0xfff < uVar15) { pvVar9 = *(void **)((int)local_e8 + -4); uVar15 = local_d4 + 0x24; if (0x1f < (uint)((int)local_e8 + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } Sprite::ReplaceSpritesheet(local_1cc,(int)layerIdx,&tmpPath); local_14._0_1_ = 0xd; std::string::_Tidy_deallocate(tmpPath._buf); layerIdx = layerIdx + 1; pEVar11 = (Entity_Bomb *)((&bomb->_sprite)[(int)(layerIdx + -1)]._color._offset + 1); } while (layerIdx < (byte *)pEVar11->_bombCostumesSprites[0]._layerCount); pEVar14 = bomb; psVar10 = local_1bc; } costumeSprite = costumeIter; ANM2::LoadGraphics(costumeIter,(byte)pEVar14); psVar12 = &costumeSprite->_animDefaultName; if (0xf < (costumeSprite->_animDefaultName)._capacity) { psVar12 = *(std_string **)psVar12->_buf; } bVar4 = ANM2::SetAnimation(costumeSprite,(byte *)psVar12,1); if (bVar4 != 0) { AnimationState::Rewind(&costumeSprite->_animState); (costumeSprite->_animState)._isPlaying = 1; } bomb->_hasCostumes = 1; } pEVar11 = bomb; local_1c4 = (ANM2 *)((local_1c4->_filename)._buf + 1); local_1bc = psVar10 + 1; costumeIter = costumeSprite + 1; } while (local_1c4 < (ANM2 *)&DAT_00000005); if (local_150 != 0) { if (isAnimPlaying == '\0') { ppppppbVar8 = (byte ******)savedAnimName; if (0xf < local_14c) { ppppppbVar8 = savedAnimName[0]; } bVar4 = ANM2::SetAnimation(&bomb->_sprite,(byte *)ppppppbVar8,1); if (((bVar4 != 0) && ((pEVar11->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(pEVar11->_sprite)._animState,local_1c0), (pEVar11->_sprite)._animState._animData != (void *)0x0)) { (pEVar11->_sprite)._animState._isPlaying = 0; } } else { ppppppbVar8 = (byte ******)savedAnimName; if (0xf < local_14c) { ppppppbVar8 = savedAnimName[0]; } bVar4 = ANM2::SetAnimation(&bomb->_sprite,(byte *)ppppppbVar8,1); if (bVar4 != 0) { AnimationState::Rewind(&(pEVar11->_sprite)._animState); (pEVar11->_sprite)._animState._isPlaying = 1; } if ((pEVar11->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar11->_sprite)._animState,local_1c0); } } } std::vector::_Tidy(); local_14._0_1_ = 3; _eh_vector_destructor_iterator_(&local_54,0x18,2,std::string::_Tidy_deallocate); local_14._0_1_ = 2; _eh_vector_destructor_iterator_(costumePaths,0x18,5,std::string::_Tidy_deallocate); if (0xf < uStack_134) { uVar15 = uStack_134 + 1; pvVar9 = spritePath; if (0xfff < uVar15) { pvVar9 = *(void **)((int)spritePath + -4); uVar15 = uStack_134 + 0x24; if (0x1f < (uint)((int)spritePath + (-4 - (int)pvVar9))) goto LAB_006a7e25; } operator_delete(pvVar9,uVar15); } local_138 = 0; uStack_134 = 0xf; spritePath = (void *)((uint)spritePath & 0xffffff00); if (0xf < local_ec) { uVar15 = local_ec + 1; ppppppbVar8 = sizeSuffix[0]; if (0xfff < uVar15) { ppppppbVar8 = (byte ******)sizeSuffix[0][-1]; uVar15 = local_ec + 0x24; if ((byte *)0x1f < (byte *)((int)sizeSuffix[0] + (-4 - (int)ppppppbVar8))) goto LAB_006a7e25; } operator_delete(ppppppbVar8,uVar15); } if (0xf < local_14c) { uVar15 = local_14c + 1; ppppppbVar8 = savedAnimName[0]; if (0xfff < uVar15) { ppppppbVar8 = (byte ******)savedAnimName[0][-1]; uVar15 = local_14c + 0x24; if ((byte *)0x1f < (byte *)((int)savedAnimName[0] + (-4 - (int)ppppppbVar8))) { LAB_006a7e25: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar8,uVar15); } ExceptionList = local_1c; return; } //@@ 006a7ec0 FUN_006a7ec0 void FUN_006a7ec0(void) { Entity *in_ECX; Entity::constructor(in_ECX); *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Dummy::vftable; return; } //@@ 006a7ee0 Entity_Dummy::Free /* DB: vtable slot 0 of Entity_Dummy; slot name from Entity */ void Entity_Dummy::Free(byte param_1) { Entity *in_ECX; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Dummy::vftable; Entity::destructor(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x410); } return; } //@@ 006a7f20 Entity_Dummy::Init /* DB: vtable slot 1 of Entity_Dummy; slot name from Entity */ void Entity_Dummy::Init(int param_1,int param_2,int param_3,uint param_4) { Entity *in_ECX; Entity::Init(in_ECX,param_1,param_2,param_3,param_4); return; } //@@ 006a7f30 Entity_Dummy::Update /* DB: vtable slot 3 of Entity_Dummy; slot name from Entity */ void Entity_Dummy::Update(void) { int *in_ECX; Entity::Update(); in_ECX[0xd8] = (int)((float)in_ECX[0xd8] * 0.965); in_ECX[0xd9] = (int)((float)in_ECX[0xd9] * 0.965); if (*(char *)((int)in_ECX + 0x173) == '\0') { return; } /* WARNING: Could not recover jumptable at 0x006a7f76. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 0x28))(); return; } //@@ 006a7f80 Entity_Dummy::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: vtable slot 5 of Entity_Dummy; slot name from Entity */ void Entity_Dummy::Render(Vector *param_1) { Entity *in_ECX; undefined4 local_144; undefined4 uStack_140; undefined4 uStack_13c; undefined4 uStack_138; undefined4 local_134; undefined4 local_130; undefined4 local_12c; undefined4 local_128; undefined4 local_124; undefined4 local_120; undefined4 local_11c; undefined4 local_118; byte local_114 [256]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa330; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_114 + 0x110); ExceptionList = &local_10; Entity::Render(in_ECX,param_1); sprintf_s(local_114,0x100,(byte *)"e%d.%d"); Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,local_114,-1); local_130 = 0; local_12c = 0xffff; local_128 = 0; local_124 = 0x3f800000; local_120 = 0xffffffff; local_11c = 0; local_118 = 0; local_8 = 0; local_144 = 0x3f800000; uStack_140 = 0x3f800000; uStack_13c = 0x3f800000; uStack_138 = 0x3f800000; local_134 = 0; Font::DrawString(local_114,&local_144,&local_130); ExceptionList = local_10; return; } //@@ 006a80c0 GridEntity::Hurt /* ZHL [exact] bool Hurt(int damage, EntityRef* source); */ undefined1 GridEntity::Hurt(void) { return 0; } //@@ 006a80d0 FUN_006a80d0 void FUN_006a80d0(void) { undefined4 *in_ECX; luaL_unref(*in_ECX,0xfff0b9d8,in_ECX[1]); return; } //@@ 006a80f0 LuaRef::push /* DB: lua_rawgeti registry ref ECX+4 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall LuaRef::push(void *this,void *luaState) { lua_rawgeti(luaState,0xfff0b9d8,*(int *)((int)this + 4),*(int *)((int)this + 4) >> 0x1f); return; } //@@ 006a8120 FUN_006a8120 void FUN_006a8120(void) { float in_XMM0_Da; floor((double)(in_XMM0_Da * 100.0 + 10030.0 + 0.5)); __ftoui3(); return; } //@@ 006a8180 FUN_006a8180 void FUN_006a8180(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x2c) = param_1; return; } //@@ 006a8190 DamageInfo::DamageInfo /* DB: ? ECX 14-dword struct zeroed: [0] damage, [2] flags, [3] countdown, [4..0xd] embedded EntityRef (pos/velocity set to g_vectorZero); Entity::TakeDamage and Entity_Player::TakeDamage build one on the stack right after this, filling damage=param_2, flags=param_3, countdown=param_4 and EntityRef::operator= the source */ void DamageInfo::DamageInfo(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = g_vectorZero.x; in_ECX[9] = g_vectorZero.y; in_ECX[10] = g_vectorZero.x; in_ECX[0xb] = g_vectorZero.y; in_ECX[0xc] = 0; in_ECX[0xd] = 0; return; } //@@ 006a8210 FUN_006a8210 void FUN_006a8210(int param_1) { int in_ECX; *(int *)(in_ECX + 0x16b8) = *(int *)(in_ECX + 0x16b8) + param_1; *(int *)(in_ECX + 0x16bc) = *(int *)(in_ECX + 0x16bc) + param_1; return; } //@@ 006a8230 Entity_NPC::GetChampionColorIdx /* ZHL [lua] Lua binding EntityNPC:GetChampionColorIdx */ int __thiscall Entity_NPC::GetChampionColorIdx(Entity_NPC *this) { return this->_championColorIdx; } //@@ 006a8240 Entity_NPC::ResetPathFinderTarget /* ZHL [lua] Lua binding EntityNPC:ResetPathFinderTarget prototype: db/protos.zhl */ void __thiscall Entity_NPC::ResetPathFinderTarget(Entity_NPC *this) { (this->_pathfinder)._movementTarget.x = g_vectorZero.x; (this->_pathfinder)._movementTarget.y = g_vectorZero.y; (this->_pathfinder)._moveDirection.x = g_vectorZero.x; (this->_pathfinder)._moveDirection.y = g_vectorZero.y; return; } //@@ 006a8290 Entity::constructor /* ZHL [exact] __thiscall void Entity::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity::constructor(Entity *this) { void *referrerHead; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afa397; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::Entity::vftable; (this->_damageEvents)._begin = (void *)0x0; (this->_damageEvents)._end = (void *)0x0; (this->_damageEvents)._capacity = (void *)0x0; local_8 = 0; this->_type = 0; this->_spawnerType = 0; this->_spawnerVariant = 0; *(undefined4 *)&this->field_0x3c = 0; *(undefined4 *)&this->field_0x40 = 0xffffffff; *(undefined4 *)&this->field_0x44 = 0xffffffff; ANM2::constructor(&this->_sprite); (this->_shadowOffset).y = 0.0; (this->_shadowOffset).x = 0.0; this->_valid = 0; this->_exists = 0; (this->_collisionPoints)._begin = (void *)0x0; (this->_collisionPoints)._end = (void *)0x0; (this->_collisionPoints)._capacity = (void *)0x0; (this->_gridCollisionVelocity).y = 0.0; (this->_gridCollisionVelocity).x = 0.0; (this->_gridCollisionNormal).y = 0.0; (this->_gridCollisionNormal).x = 0.0; (this->_renderPosition).y = 0.0; (this->_renderPosition).x = 0.0; (this->_colorParams)._begin = (void *)0x0; (this->_colorParams)._end = (void *)0x0; (this->_colorParams)._capacity = (void *)0x0; local_8 = CONCAT31(local_8._1_3_,3); (this->_color)._tint[0] = 1.0; (this->_color)._tint[1] = 1.0; (this->_color)._tint[2] = 1.0; (this->_color)._tint[3] = 1.0; (this->_color)._colorize[0] = 0.0; (this->_color)._colorize[1] = 0.0; (this->_color)._colorize[2] = 0.0; (this->_color)._colorize[3] = 0.0; (this->_color)._offset[0] = 0.0; (this->_color)._offset[1] = 0.0; (this->_color)._offset[2] = 0.0; (this->_splatColor)._tint[0] = 1.0; (this->_splatColor)._tint[1] = 1.0; (this->_splatColor)._tint[2] = 1.0; (this->_splatColor)._tint[3] = 1.0; (this->_splatColor)._colorize[0] = 0.0; (this->_splatColor)._colorize[1] = 0.0; (this->_splatColor)._colorize[2] = 0.0; (this->_splatColor)._colorize[3] = 0.0; (this->_splatColor)._offset[0] = 0.0; (this->_splatColor)._offset[1] = 0.0; (this->_splatColor)._offset[2] = 0.0; (this->_charmSource)._type = 0; (this->_charmSource)._variant = 0; (this->_charmSource)._spawnerType = 0; (this->_charmSource)._spawnerVariant = 0; (this->_charmSource)._position.x = g_vectorZero.x; (this->_charmSource)._position.y = g_vectorZero.y; (this->_charmSource)._velocity.x = g_vectorZero.x; (this->_charmSource)._velocity.y = g_vectorZero.y; (this->_charmSource)._flags = 0; (this->_charmSource)._entity = (void *)0x0; (this->_entityRef2)._type = 0; (this->_entityRef2)._variant = 0; (this->_entityRef2)._spawnerType = 0; (this->_entityRef2)._spawnerVariant = 0; (this->_entityRef2)._position.x = g_vectorZero.x; (this->_entityRef2)._position.y = g_vectorZero.y; (this->_entityRef2)._velocity.x = g_vectorZero.x; (this->_entityRef2)._velocity.y = g_vectorZero.y; (this->_entityRef2)._flags = 0; (this->_entityRef2)._entity = (void *)0x0; (this->_entityRef3)._type = 0; (this->_entityRef3)._variant = 0; (this->_entityRef3)._spawnerType = 0; (this->_entityRef3)._spawnerVariant = 0; (this->_entityRef3)._position.x = g_vectorZero.x; (this->_entityRef3)._position.y = g_vectorZero.y; (this->_entityRef3)._velocity.x = g_vectorZero.x; (this->_entityRef3)._velocity.y = g_vectorZero.y; (this->_entityRef3)._flags = 0; (this->_entityRef3)._entity = (void *)0x0; (this->_entityRef4)._type = 0; (this->_entityRef4)._variant = 0; (this->_entityRef4)._spawnerType = 0; (this->_entityRef4)._spawnerVariant = 0; (this->_entityRef4)._position.x = g_vectorZero.x; (this->_entityRef4)._position.y = g_vectorZero.y; (this->_entityRef4)._velocity.x = g_vectorZero.x; (this->_entityRef4)._velocity.y = g_vectorZero.y; (this->_entityRef4)._flags = 0; (this->_entityRef4)._entity = (void *)0x0; (this->_knockbackDirection).y = 0.0; (this->_knockbackDirection).x = 0.0; this->_iceFrozenEffect = (EntityPtr)0x0; (this->_pausePosition).y = 0.0; (this->_pausePosition).x = 0.0; (this->_targetPosition).y = 0.0; (this->_targetPosition).x = 0.0; (this->_pos).y = 0.0; (this->_pos).x = 0.0; (this->_preInterpolatePos).y = 0.0; (this->_preInterpolatePos).x = 0.0; (this->_posOffset).y = 0.0; (this->_posOffset).x = 0.0; (this->_velocity).y = 0.0; (this->_velocity).x = 0.0; (this->_sizeMulti).y = 0.0; (this->_sizeMulti).x = 0.0; (this->_prevPosition).y = 0.0; (this->_prevPosition).x = 0.0; (this->_prevVelocity).y = 0.0; (this->_prevVelocity).x = 0.0; this->_parent = (EntityPtr)0x0; this->_child = (EntityPtr)0x0; this->_target = (EntityPtr)0x0; this->_spawnerEntity = (EntityPtr)0x0; (this->_entityPtrReferrers)._head = (void *)0x0; (this->_entityPtrReferrers)._size = 0; referrerHead = operator_new(0x14); *(void **)referrerHead = referrerHead; *(void **)((int)referrerHead + 4) = referrerHead; *(void **)((int)referrerHead + 8) = referrerHead; *(undefined2 *)((int)referrerHead + 0xc) = 0x101; (this->_entityPtrReferrers)._head = referrerHead; this->_minecart = (EntityPtr)0x0; this->_hitEffect = (EntityPtr)0x0; (this->_dropRNG)._shift1 = 5; (this->_dropRNG)._shift2 = 9; (this->_dropRNG)._shift3 = 7; (this->_dropRNG)._seed = -0x55e8beb1; (this->_holdPosition).y = 0.0; (this->_holdPosition).x = 0.0; this->_scoreMultiplier = 1.0; this->_luaBridgeRef = (void *)0x0; ExceptionList = local_10; return; } //@@ 006a8820 Entity::Free /* ZHL [exact] void Free(unsigned int flags); */ void Entity::Free(byte param_1) { Entity *in_ECX; destructor(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x410); } return; } //@@ 006a8850 Entity::destructor /* ZHL [exact] __thiscall void Entity::destructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity::destructor(Entity *this) { EntityPtr *pEVar1; std_multiset *this_00; undefined4 *ptr; uint uVar2; EntityPtr *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa3c0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::Entity::vftable; if (this->_exists != 0) { Remove(this); } ptr = this->_luaBridgeRef; if (ptr != (undefined4 *)0x0) { luaL_unref(*ptr,0xfff0b9d8,ptr[1],uVar2); operator_delete(ptr,8); this->_luaBridgeRef = (void *)0x0; } pEVar1 = &this->_hitEffect; if (*pEVar1 != (EntityPtr)0x0) { local_14 = pEVar1; std::multiset::erase(&local_14); *pEVar1 = (EntityPtr)0x0; } pEVar1 = &this->_minecart; if (*pEVar1 != (EntityPtr)0x0) { local_14 = pEVar1; std::multiset::erase(&local_14); *pEVar1 = (EntityPtr)0x0; } this_00 = &this->_entityPtrReferrers; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)(this->_entityPtrReferrers)._head + 4)); operator_delete(this_00->_head,0x14); vector_0x3c_tidy(); std::vector::_Tidy(); local_8 = 2; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); FUN_0041c7d0(); ExceptionList = local_10; return; } //@@ 006a8990 Entity::GetLastParent /* ZHL [lua] Lua binding Entity:GetLastParent prototype: db/protos.zhl, confirmed by RET 0 */ Entity * __thiscall Entity::GetLastParent(Entity *this) { EntityPtr EVar1; EntityPtr EVar2; EVar2 = this->_parent; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { this = (Entity *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3bc); } return this; } //@@ 006a89b0 Entity::GetLastChild /* ZHL [lua] Lua binding Entity:GetLastChild */ EntityPtr __thiscall Entity::GetLastChild(Entity *this) { EntityPtr EVar1; EntityPtr EVar2; EVar2 = this->_child; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { this = (Entity *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3c0); } return (EntityPtr)this; } //@@ 006a89d0 Entity::GetLastSpawner /* DB: walks this+0x3c8 (_spawnerEntity) chain to root prototype: db/protos.zhl */ Entity * __thiscall Entity::GetLastSpawner(Entity *this) { EntityPtr EVar1; EntityPtr EVar2; EVar2 = this->_spawnerEntity; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { this = (Entity *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3c8); } return this; } //@@ 006a89f0 Entity::GetStatusEffectTarget /* ZHL [exact] __thiscall Entity * Entity::GetStatusEffectTarget(); prototype: REPENTOGON, confirmed by RET 0 */ Entity * __thiscall Entity::GetStatusEffectTarget(Entity *this) { EntityPtr EVar1; EntityPtr EVar2; byte bVar3; EntityPtr extraout_EDX; EntityPtr EVar4; bVar3 = DoesEntityShareStatus(this); EVar4 = extraout_EDX; if (bVar3 != 0) { EVar2 = *(EntityPtr *)((int)extraout_EDX + 0x3bc); EVar4 = extraout_EDX; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { EVar4 = EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3bc); } } return (Entity *)EVar4; } //@@ 006a8a20 Entity::CopyStatusEffects /* ZHL [exact] __thiscall void Entity::CopyStatusEffects(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity::CopyStatusEffects(Entity *this) { EntityPtr EVar1; uint uVar2; byte bVar3; char cVar4; bVar3 = DoesEntityShareStatus(this); if (bVar3 != 0) { for (EVar1 = this->_child; EVar1 != (EntityPtr)0x0; EVar1 = *(EntityPtr *)((int)EVar1 + 0x3c0)) { *(int *)((int)EVar1 + 0x218) = this->_freezeCountdown; uVar2 = *(uint *)((int)&this->_flags + 4); *(uint *)((int)EVar1 + 0x168) = *(uint *)((int)EVar1 + 0x168) & 0xdeffe01f | (uint)this->_flags & 0x21001fe0; *(uint *)((int)EVar1 + 0x16c) = *(uint *)((int)EVar1 + 0x16c) & 0xfea27fff | uVar2 & 0x15d8000 ; *(int *)((int)EVar1 + 0x21c) = this->_poisonCountdown; *(int *)((int)EVar1 + 0x220) = this->_slowingCountdown; *(int *)((int)EVar1 + 0x224) = this->_charmedCountdown; *(int *)((int)EVar1 + 0x228) = this->_confusionCountdown; *(int *)((int)EVar1 + 0x22c) = this->_midasFreezeCountdown; *(int *)((int)EVar1 + 0x230) = this->_fearCountdown; *(int *)((int)EVar1 + 0x234) = this->_burnCountdown; *(int *)((int)EVar1 + 0x2e8) = this->_bleedingCountdown; *(int *)((int)EVar1 + 0x23c) = this->_shrinkCountdown; *(float *)((int)EVar1 + 800) = this->_poisonTickDamage; *(float *)((int)EVar1 + 0x324) = this->_burnTickDamage; *(int *)((int)EVar1 + 0x2f0) = this->_magnetizedCountdown; *(int *)((int)EVar1 + 0x2f4) = this->_baitedCountdown; *(int *)((int)EVar1 + 0x2f8) = this->_knockbackCountdown; *(float *)((int)EVar1 + 0x308) = (this->_knockbackDirection).x; *(float *)((int)EVar1 + 0x30c) = (this->_knockbackDirection).y; *(int *)((int)EVar1 + 0x300) = this->_iceCountdown; *(int *)((int)EVar1 + 0x2fc) = this->_weaknessCountdown; *(int *)((int)EVar1 + 0x304) = this->_brimstoneMarkCountdown; *(float *)((int)EVar1 + 0x3b4) = this->_shrinkStatus1; *(float *)((int)EVar1 + 0x3b8) = this->_shrinkStatus2; cVar4 = (**(code **)(*(int *)this + 0x4c))(); if (((cVar4 != '\0') || ((1 < *(int *)&g_game->_deathmatchManager && (this->_type == 1)))) && ((cVar4 = (**(code **)(*(int *)EVar1 + 0x4c))(), cVar4 != '\0' || ((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar1 + 0x28) == 1)))))) { *(int *)((int)EVar1 + 0x238) = this->_bossStatusEffectCooldown; } } } return; } //@@ 006a8c00 Entity::HasCommonParentWithEntity /* ZHL [lua] Lua binding Entity:HasCommonParentWithEntity */ uint __thiscall Entity::HasCommonParentWithEntity(Entity *this,Entity *param_2) { EntityPtr EVar1; EntityPtr EVar2; EntityPtr EVar3; if ((param_2 != (Entity *)0x0) && (param_2->_type == 0xde)) { return (uint)param_2 & 0xffffff00; } EVar3 = (EntityPtr)0x0; if (param_2 != (Entity *)0x0) { EVar2 = param_2->_parent; EVar3 = (EntityPtr)param_2; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { EVar3 = EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3bc); } } EVar2 = this->_parent; while (EVar1 = EVar2, EVar1 != (EntityPtr)0x0) { this = (Entity *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3bc); } return (uint)(EVar3 == (EntityPtr)this); } //@@ 006a8c60 Entity::is_same_segmented_body /* DB: ? for segmented types (0x13 Larry Jr, 0x1c Chub, 0x23 Mr Maw, 0x3e Pin, 0x59, 0xd8, 0xef, 0xf4 v2, 0x38d/0x390/0x396) walks both entities' _parent (+0x3bc) chains and returns whether they share a root; Entity::IsValidTarget skips targets for which it is true prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::is_same_segmented_body(Entity *this,Entity *other) { int iVar1; EntityPtr EVar2; EntityPtr EVar3; iVar1 = this->_type; if (iVar1 < 0xd9) { if (iVar1 != 0xd8) { switch(iVar1) { case 0x13: case 0x1c: case 0x23: case 0x3e: case 0x59: break; default: goto switchD_006a8c86_caseD_14; } } } else if (iVar1 < 0x38e) { if ((iVar1 != 0x38d) && (iVar1 != 0xef)) { if (iVar1 != 0xf4) { return 0; } if (this->_variant != 2) { return 0; } if (other == (Entity *)0x0) { return 1; } if (other->_type == 0xde) { return 0; } EVar3 = other->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { other = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } EVar3 = this->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } if (other == this) { return 1; } return 0; } } else if ((iVar1 != 0x390) && (iVar1 != 0x396)) { return 0; } if (other == (Entity *)0x0) { return 1; } if (other->_type != 0xde) { EVar3 = other->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { other = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } EVar3 = this->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } if (other == this) { return 1; } } switchD_006a8c86_caseD_14: return 0; } //@@ 006a8db0 Entity::DoesEntityShareStatus /* ZHL [exact] __thiscall bool Entity::DoesEntityShareStatus(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity::DoesEntityShareStatus(Entity *this) { int iVar1; iVar1 = this->_type; if (iVar1 < 0x38e) { if (iVar1 != 0x38d) { switch(iVar1) { case 0x13: case 0x1c: case 0x23: case 0x3e: case 0x4f: case 0x59: case 0x5c: case 0x5d: case 0x61: case 0x62: case 0xd8: case 0xef: break; default: return 0; case 0xf4: if (this->_variant != 2) { return 0; } } } } else if ((iVar1 != 0x390) && (iVar1 != 0x396)) { return 0; } return 1; } //@@ 006a8ee0 Entity::IsValidTarget /* ZHL [vtable slot 20] */ undefined1 __thiscall Entity::IsValidTarget(Entity *this,Entity *param_2) { byte bVar1; if (param_2 != this) { bVar1 = is_same_segmented_body(this,param_2); if ((bVar1 == 0) && ((this->_type != 0xde || (param_2->_type != 0xde)))) { return 1; } } return 0; } //@@ 006a8f20 Entity::is_valid_boss_enemy /* DB: ? type 10..999 active, not 866, no flag 0x20000000; Hush/Mega Satan/Ultra Greed prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::is_valid_boss_enemy(Entity *this,int unused) { char cVar1; if (((1 < *(int *)&g_game->_deathmatchManager) && (this->_type == 1)) || (this->_type - 10U < 0x3de)) { cVar1 = (**(code **)(*(int *)this + 0x48))(); if (((cVar1 != '\0') && (this->_type != 0x362)) && ((this->_flags & 0x20000000) == 0)) { return 1; } } return 0; } //@@ 006a8f80 Entity::CanDevolve /* ZHL [exact] __thiscall bool Entity::CanDevolve(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity::CanDevolve(Entity *this) { void *pvVar1; pvVar1 = this->_config; if ((pvVar1 == (void *)0x0) || (*(int *)((int)pvVar1 + 0xa4) == *(int *)((int)pvVar1 + 0xa8))) { return 0; } return 1; } //@@ 006a8fa0 Entity::IsDescendantOf /* DB: walks _parent 0x3bc and _spawnerEntity 0x3c8 chains for target prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::IsDescendantOf(Entity *this,Entity *ancestor) { EntityPtr EVar1; Entity *pEVar2; void *pvVar3; undefined1 *puVar4; byte bVar5; undefined1 local_28 [8]; void *local_20; void *local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pEVar2 = ancestor; local_8 = 0xffffffff; puStack_c = &LAB_00afa3ed; local_10 = ExceptionList; if (ancestor == (Entity *)0x0) { return 0; } if (ancestor == this) { return 1; } local_1c = (void *)0x0; local_18 = 0; ExceptionList = &local_10; local_1c = operator_new(0x18); *(void **)local_1c = local_1c; *(void **)((int)local_1c + 4) = local_1c; *(void **)((int)local_1c + 8) = local_1c; *(undefined2 *)((int)local_1c + 0xc) = 0x101; local_8 = 0; EVar1 = this->_parent; while (ancestor = (Entity *)EVar1, EVar1 != (EntityPtr)0x0) { if (EVar1 == (EntityPtr)pEVar2) goto LAB_006a9133; _Find_lower_bound<>(local_28,&ancestor); if (((*(char *)((int)local_20 + 0xd) == '\0') && ((uint)*(EntityPtr *)((int)local_20 + 0x10) <= (uint)EVar1)) && (local_20 != local_1c)) break; puVar4 = (undefined1 *)_Entity::GetAncestorField(&ancestor); *puVar4 = 1; EVar1 = ancestor->_parent; } pvVar3 = local_1c; FID_conflict__Erase_tree_>_> (&local_1c,(fuzzer_allocator_> *)&local_1c, *(_Tree_node **)((int)local_1c + 4)); *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; EVar1 = this->_spawnerEntity; local_18 = 0; while (ancestor = (Entity *)EVar1, EVar1 != (EntityPtr)0x0) { if (EVar1 == (EntityPtr)pEVar2) goto LAB_006a9133; _Find_lower_bound<>(local_28,&ancestor); if (((*(char *)((int)local_20 + 0xd) == '\0') && ((uint)*(EntityPtr *)((int)local_20 + 0x10) <= (uint)EVar1)) && (local_20 != local_1c)) break; puVar4 = (undefined1 *)_Entity::GetAncestorField(&ancestor); *puVar4 = 1; EVar1 = ancestor->_spawnerEntity; } bVar5 = 0; LAB_006a90ff: FID_conflict__Erase_tree_>_> (&local_1c,(fuzzer_allocator_> *)&local_1c, *(_Tree_node **)((int)local_1c + 4)); operator_delete(local_1c,0x18); ExceptionList = local_10; return bVar5; LAB_006a9133: bVar5 = 1; goto LAB_006a90ff; } //@@ 006a9140 Entity::GetPlayerAncestor /* DB: walks Parent (0x3bc) then SpawnerEntity (0x3c8) chains with cycle-guard set, returns first entity of type 1 (player) prototype: db/protos.zhl */ Entity * __thiscall Entity::GetPlayerAncestor(Entity *this) { void *pvVar1; undefined1 *puVar2; EntityPtr EVar3; undefined1 local_28 [8]; void *local_20; void *local_1c; undefined4 local_18; EntityPtr local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa41d; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = (void *)0x0; local_18 = 0; local_1c = operator_new(0x18); *(void **)local_1c = local_1c; *(void **)((int)local_1c + 4) = local_1c; *(void **)((int)local_1c + 8) = local_1c; *(undefined2 *)((int)local_1c + 0xc) = 0x101; local_8 = 0; local_14 = (EntityPtr)this; if (this != (Entity *)0x0) { do { EVar3 = local_14; if (*(int *)((int)local_14 + 0x28) == 1) goto LAB_006a926c; _Find_lower_bound<>(local_28,&local_14); if (((*(char *)((int)local_20 + 0xd) == '\0') && ((uint)*(EntityPtr *)((int)local_20 + 0x10) <= (uint)EVar3)) && (local_20 != local_1c)) break; puVar2 = (undefined1 *)_Entity::GetAncestorField(&local_14); *puVar2 = 1; local_14 = *(EntityPtr *)((int)local_14 + 0x3bc); } while (local_14 != (EntityPtr)0x0); } pvVar1 = local_1c; FID_conflict__Erase_tree_>_> (&local_1c,(fuzzer_allocator_> *)&local_1c, *(_Tree_node **)((int)local_1c + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; local_18 = 0; local_14 = (EntityPtr)this; if (this != (Entity *)0x0) { do { EVar3 = local_14; if (*(int *)((int)local_14 + 0x28) == 1) goto LAB_006a926c; _Find_lower_bound<>(local_28,&local_14); if (((*(char *)((int)local_20 + 0xd) == '\0') && ((uint)*(EntityPtr *)((int)local_20 + 0x10) <= (uint)EVar3)) && (local_20 != local_1c)) break; puVar2 = (undefined1 *)_Entity::GetAncestorField(&local_14); *puVar2 = 1; local_14 = *(EntityPtr *)((int)local_14 + 0x3c8); } while (local_14 != (EntityPtr)0x0); } EVar3 = (EntityPtr)0x0; LAB_006a926c: FID_conflict__Erase_tree_>_> (&local_1c,(fuzzer_allocator_> *)&local_1c, *(_Tree_node **)((int)local_1c + 4)); operator_delete(local_1c,0x18); ExceptionList = local_10; return (Entity *)EVar3; } //@@ 006a92a0 Entity::SetParent /* DB: unregister/re-register EntityPtr at Entity+0x3bc (_parent) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetParent(Entity *this,Entity *parent) { EntityPtr *pEVar1; Entity *local_8; pEVar1 = &this->_parent; local_8 = this; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)parent; if (parent != (Entity *)0x0) { std::multiset::insert(pEVar1); } return; } //@@ 006a92e0 Entity::SetChild /* DB: EntityPtr set on Entity+0x3c0 (_child) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetChild(Entity *this,Entity *child) { EntityPtr *pEVar1; Entity *local_8; pEVar1 = &this->_child; local_8 = this; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)child; if (child != (Entity *)0x0) { std::multiset::insert(pEVar1); } return; } //@@ 006a9320 Entity::SetTarget /* DB: EntityPtr set on Entity+0x3c4 (_target) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetTarget(Entity *this,Entity *target) { EntityPtr *pEVar1; Entity *local_8; pEVar1 = &this->_target; local_8 = this; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)target; if (target != (Entity *)0x0) { std::multiset::insert(pEVar1); } return; } //@@ 006a9360 Entity::SetSpawnerEntity /* DB: EntityPtr assign to this+0x3c8 (Lua Entity.SpawnerEntity getter reads 0x3c8): unregister old, register new prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::SetSpawnerEntity(Entity *this,Entity *spawner) { EntityPtr *pEVar1; Entity *local_8; pEVar1 = &this->_spawnerEntity; local_8 = this; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)spawner; if (spawner != (Entity *)0x0) { std::multiset::insert(pEVar1); } return; } //@@ 006a93a0 Entity::Init /* ZHL [exact] void Init(unsigned int type, unsigned int variant, unsigned int subtype, unsigned int initSeed); prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Entity::Init(Entity *this,int type,int variant,int subType,uint initSeed) { float fVar1; uint noScoreFlag; undefined4 defaultColor [8]; undefined4 local_10; undefined4 uStack_c; undefined4 local_8; float baseFriction; void *damageEventsBegin; Game *game; undefined4 *luaRef; EntityPtr *minecartRef; int vtable; this->_type = type; this->_variant = variant; this->_subtype = subType; this->_initSeed = initSeed; (this->_dropRNG)._seed = initSeed; (this->_dropRNG)._shift1 = 4; (this->_dropRNG)._shift2 = 3; (this->_dropRNG)._shift3 = 0x11; (this->_splatColor)._tint[0] = 1.0; (this->_splatColor)._tint[1] = 1.0; (this->_splatColor)._tint[2] = 1.0; (this->_splatColor)._tint[3] = 1.0; (this->_splatColor)._colorize[0] = 0.0; (this->_splatColor)._colorize[1] = 0.0; (this->_splatColor)._colorize[2] = 0.0; (this->_splatColor)._colorize[3] = 0.0; (this->_splatColor)._offset[0] = 0.0; (this->_splatColor)._offset[1] = 0.0; (this->_splatColor)._offset[2] = 0.0; (**(code **)(*(int *)this + 100))(); baseFriction = this->_baseFriction; (this->_shadowOffset).x = g_vectorZero.x; fVar1 = g_vectorZero.y; this->_friction = baseFriction; game = g_game; (this->_shadowOffset).y = fVar1; this->_pauseTimer = 0; this->_index = 0; this->_collisionIndex = 0; this->_spawnFrame = game->_frameCount; this->_health = this->_maxHitPoints; this->_spawnGridIndex = -1; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; this->_speedMultiplier = 1.0; this->_prevUpdateTime = -1e-05; this->_updateTime = 0.0; (this->_posOffset).x = g_vectorZero.x; (this->_posOffset).y = g_vectorZero.y; this->_renderZOffset = 0; this->_renderDepthOffset = 0.0; this->_sortingLayer = 2; this->_visible = 1; this->_exists = 1; this->_dead = 0; this->_isKillOnTouch = 0; this->_isInitFlag176 = 0; this->_removedByFactory = 0; this->_entityCollisionClass = 4; this->_collidesWithEntity = 0; this->_collidesWithGrid = 0; (this->_gridCollisionNormal).x = g_vectorZero.x; (this->_gridCollisionNormal).y = g_vectorZero.y; (this->_gridCollisionVelocity).x = g_vectorZero.x; (this->_gridCollisionVelocity).y = g_vectorZero.y; local_10 = 0; uStack_c = 0; local_8 = 0; if (&this->_color != (ColorMod *)defaultColor) { (this->_color)._tint[0] = 1.0; (this->_color)._tint[1] = 1.0; (this->_color)._tint[2] = 1.0; (this->_color)._tint[3] = 1.0; (this->_color)._offset[0] = 0.0; (this->_color)._offset[1] = 0.0; (this->_color)._colorize[0] = 0.0; (this->_color)._colorize[1] = 0.0; (this->_color)._colorize[2] = 0.0; (this->_color)._colorize[3] = 0.0; (this->_color)._offset[2] = 0.0; } damageEventsBegin = (this->_damageEvents)._begin; minecartRef = &this->_minecart; this->_fireDamageCountdown = 0; this->_damageCountdown = 0; this->_freezeCountdown = 0; this->_poisonCountdown = 0; this->_poisonTickDamage = 2.0; this->_burnTickDamage = 2.0; this->_slowingCountdown = 0; this->_slowingAmount = 0.9; this->_charmedCountdown = 0; this->_confusionCountdown = 0; this->_midasFreezeCountdown = 0; this->_fearCountdown = 0; this->_burnCountdown = 0; this->_shrinkCountdown = 0; this->_bleedingCountdown = 0; this->_bleedDamageAccumulator = 0.0; this->_poisonDamageTimer = 0; this->_burnDamageTimer = 0; this->_magnetizedCountdown = 0; this->_baitedCountdown = 0; this->_knockbackCountdown = 0; this->_iceCountdown = 0; this->_weaknessCountdown = 0; this->_brimstoneMarkCountdown = 0; this->_iceFrozenEffect = (EntityPtr)0x0; this->_bossStatusEffectCooldown = 0; *(undefined4 *)&this->_flags = 0; *(undefined4 *)((int)&this->_flags + 4) = 0; (this->_damageEvents)._end = damageEventsBegin; this->_pendingDamage = 0.0; *(undefined4 *)&this->_pendingDamageFlags = 0; *(undefined4 *)((int)&this->_pendingDamageFlags + 4) = 0; this->_isInvicible = 0; this->_isInterpolating = 0; this->_holdCountdown = 0; this->_shrinkStatus1 = 1.0; this->_shrinkStatus2 = 1.0; this->_parent = (EntityPtr)0x0; this->_child = (EntityPtr)0x0; this->_target = (EntityPtr)0x0; if (*minecartRef != (EntityPtr)0x0) { type = (int)minecartRef; std::multiset::erase(&type); *minecartRef = (EntityPtr)0x0; } if (this->_hitEffect != (EntityPtr)0x0) { type = (int)&this->_hitEffect; std::multiset::erase(&type); this->_hitEffect = (EntityPtr)0x0; } (this->_prevPosition).x = (this->_pos).x; (this->_prevPosition).y = (this->_pos).y; (this->_prevVelocity).x = (this->_velocity).x; (this->_prevVelocity).y = (this->_velocity).y; vtable = *(int *)this; this->_pitfallState = 0; this->_pitfallTimer = 0; (this->_pausePosition).x = g_vectorZero.x; (this->_pausePosition).y = g_vectorZero.y; (**(code **)(vtable + 0x60))(); this->_scoreMultiplier = 1.0; if (this->_type == 0x110) { noScoreFlag = (uint)g_game->_gameStateFlags & 0x4000000; } else { if (this->_type != 0x10f) goto LAB_006a986e; noScoreFlag = (uint)g_game->_gameStateFlags & 0x2000000; } if (noScoreFlag != 0) { this->_scoreMultiplier = 0.0; } LAB_006a986e: luaRef = this->_luaBridgeRef; if (luaRef != (undefined4 *)0x0) { luaL_unref(*luaRef,0xfff0b9d8,luaRef[1]); operator_delete(luaRef,8); this->_luaBridgeRef = (void *)0x0; } return; } //@@ 006a98b0 Entity::LoadEntityConfig /* ZHL [vtable slot 25] */ void __thiscall Entity::LoadEntityConfig(Entity *this) { void *pvVar1; byte isMatch; EntityConfig *entityConfig; EntityConfig_Entity *pEVar2; byte *gridCollisionText; int entityType; int variant; byte *gridCollisionString; float stageClamped; float maxHp; uint gridCollisionCapacity; uint gridCollisionLength; float stageHp; entityConfig = &g_manager->_entityConfig; variant = this->_variant; entityType = this->_type; pEVar2 = EntityConfig::GetEntity(entityConfig,entityType,variant,this->_subtype); if (pEVar2 != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(entityConfig,pEVar2); variant = this->_variant; entityType = this->_type; } pEVar2 = EntityConfig::GetEntity(&g_manager->_entityConfig,entityType,variant,this->_subtype); this->_config = pEVar2; if (pEVar2 == (EntityConfig_Entity *)0x0) { pvVar1 = (this->_collisionPoints)._begin; this->_size = 1.0; (this->_sizeMulti).x = g_vectorOne.x; (this->_sizeMulti).y = g_vectorOne.y; this->_shadowSize = 0.015625; this->_collisionDamage = 0.0; this->_maxHitPoints = 0.0; this->_mass = 0.0; (this->_collisionPoints)._end = pvVar1; this->_entityGridCollisionClass = 3; this->_baseFriction = 1.0; KAGE_LogMessage(1,(byte *)"config for entity %d.%d is missing\n"); return; } this->_shadowSize = pEVar2->shadowSize; this->_collisionDamage = pEVar2->collisionDamage; this->_mass = pEVar2->mass; stageHp = pEVar2->stageHP; maxHp = pEVar2->baseHP; if (0.001 < stageHp) { stageClamped = (float)g_game->_stage; if (10.0 <= stageClamped) { stageClamped = 10.0; } if (g_game->_stage < 5) { maxHp = stageClamped * 1.0 * stageHp + maxHp; } else { maxHp = stageClamped * 0.8 * stageHp + maxHp; } } this->_maxHitPoints = maxHp; this->_size = 0.0; (this->_sizeMulti).x = g_vectorZero.x; (this->_sizeMulti).y = g_vectorZero.y; SetSize(this,pEVar2->collisionRadius,pEVar2->collisionRadiusMulti,pEVar2->gridCollisionPoints); pvVar1 = this->_config; this->_baseFriction = *(float *)((int)pvVar1 + 0x4c); if (*(int *)((int)pvVar1 + 0xc4) == 0) { this->_entityGridCollisionClass = (-(uint)((int)(this->_collisionPoints)._end - (int)(this->_collisionPoints)._begin >> 3 != 0) & 2) + 3; return; } gridCollisionCapacity = *(uint *)((int)pvVar1 + 200); gridCollisionString = (byte *)((int)pvVar1 + 0xb4); gridCollisionLength = *(uint *)((int)pvVar1 + 0xc4); gridCollisionText = gridCollisionString; if (0xf < gridCollisionCapacity) { gridCollisionText = *(byte **)gridCollisionString; } isMatch = str_eq(gridCollisionText,gridCollisionLength,(byte *)&DAT_00b671d0,4); if (isMatch != 0) { this->_entityGridCollisionClass = 0; return; } gridCollisionText = gridCollisionString; if (0xf < gridCollisionCapacity) { gridCollisionText = *(byte **)gridCollisionString; } isMatch = str_eq(gridCollisionText,gridCollisionLength,(byte *)"walls",5); if (isMatch != 0) { this->_entityGridCollisionClass = 3; return; } gridCollisionText = gridCollisionString; if (0xf < gridCollisionCapacity) { gridCollisionText = *(byte **)gridCollisionString; } isMatch = str_eq(gridCollisionText,gridCollisionLength,(byte *)"ground",6); if (isMatch != 0) { this->_entityGridCollisionClass = 5; return; } if (0xf < gridCollisionCapacity) { gridCollisionString = *(byte **)gridCollisionString; } isMatch = str_eq(gridCollisionString,gridCollisionLength,(byte *)"nopits",6); if (isMatch == 0) { KAGE_LogMessage(0x10,(byte *)"Invalid grid collision class for entity config %d.%d.%d"); return; } this->_entityGridCollisionClass = 6; return; } //@@ 006a9ba0 Entity::GetCollisionCapsule /* DB: Capsule::constructor(pos+offset, size 0x374, ...); ZHL Entity::GetCollisionCapsule(Vector*) prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall Entity::GetCollisionCapsule(Entity *this,void *outCapsule,Vector *offset) { Vector local_10; local_10.x = offset->x + (this->_pos).x; local_10.y = (this->_pos).y + offset->y; Capsule::constructor(outCapsule,&local_10,&this->_sizeMulti,(this->_sprite)._rotation,this->_size) ; return outCapsule; } //@@ 006a9c10 Entity::FrameCount /* ZHL [lua] Lua binding Entity:FrameCount prototype: db/protos.zhl, confirmed by RET 0 */ int __thiscall Entity::FrameCount(Entity *this) { return g_game->_frameCount - this->_spawnFrame; } //@@ 006a9c30 Entity::HasFullHealth /* ZHL [lua] Lua binding Entity:HasFullHealth */ bool __thiscall Entity::HasFullHealth(Entity *this) { return this->_maxHitPoints <= this->_health; } //@@ 006a9c50 Entity::AddHealth /* ZHL [lua] Lua binding Entity:AddHealth */ void __thiscall Entity::AddHealth(Entity *this,float param_2) { float *pfVar1; param_2 = param_2 + this->_health; pfVar1 = ¶m_2; if (this->_maxHitPoints <= param_2) { pfVar1 = &this->_maxHitPoints; } this->_health = *pfVar1; return; } //@@ 006a9c90 Entity::CollideWithGrid /* DB: GetGridCollision, bridges, clamped position, from Interpolate prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::CollideWithGrid(Entity *this,byte isSimulated) { void *pvVar1; byte bVar2; char isDestroyed; int iVar3; GridEntity *gridEntity; uint uVar4; int neighborRow; GridEntity *pit; uint uVar5; int iVar6; uint uVar7; undefined1 *signY; undefined1 *sign; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; byte isNoPush; float local_70; float local_6c; int gridCollisionClass; GridEntity *cellGridEntity; uint pointIndex; uint local_48; float local_44; float normalY; Vector local_38; undefined4 hitSourceType; undefined4 hitSourceVariant; int hitSpawnerType; int hitSpawnerVariant; float hitPosX; float hitPosY; float hitVelX; float hitVelY; uint hitFlags; Entity *hitSourceEntity; Vector *clampPos; void *collisionPointsEnd; Room *curRoom; bool isWallCollision; Vector *pos; Room *room; if (isSimulated == 0) { this->_collidesWithGrid = 0; } if (this->_minecart != (EntityPtr)0x0) { return; } gridCollisionClass = this->_entityGridCollisionClass; if (gridCollisionClass == 0) { return; } room = g_game->_room; if (((this->_type == 9) && (gridCollisionClass == 4)) && (room->_roomType == 0x10)) { gridCollisionClass = 6; } pos = &this->_pos; Room::GetClampedPositionImpl(room,&local_38,pos,0.0,0.0,0.0,0.0); normalY = g_vectorZero.y; local_44 = g_vectorZero.x; if (gridCollisionClass == 1) { if (isSimulated != 0) { pos->x = local_38.x; return; } pos = &this->_pos; if ((this->_pos).x == local_38.x) { this->_collidesWithGrid = 0; pos->x = local_38.x; return; } this->_collidesWithGrid = 1; (this->_gridCollisionVelocity).x = (this->_velocity).x; (this->_gridCollisionVelocity).y = (this->_velocity).y; if (pos->x <= local_38.x) { sign = (undefined1 *)0x3f800000; } else { sign = &DAT_bf800000; } (this->_gridCollisionNormal).x = (float)sign; (this->_gridCollisionNormal).y = 0.0; pos->x = local_38.x; return; } if (gridCollisionClass == 2) { if (isSimulated == 0) { fVar10 = (this->_pos).y; if (fVar10 != local_38.y) { this->_collidesWithGrid = 1; (this->_gridCollisionVelocity).x = (this->_velocity).x; (this->_gridCollisionVelocity).y = (this->_velocity).y; if (fVar10 <= local_38.y) { sign = (undefined1 *)0x3f800000; } else { sign = &DAT_bf800000; } (this->_gridCollisionNormal).x = 0.0; (this->_gridCollisionNormal).y = (float)sign; (this->_pos).y = local_38.y; return; } this->_collidesWithGrid = 0; } (this->_pos).y = local_38.y; return; } if (((gridCollisionClass == 3) || (gridCollisionClass == 5)) || ((gridCollisionClass == 6 || (gridCollisionClass == 7)))) { clampPos = &this->_pos; if (isSimulated == 0) { if ((clampPos->x == local_38.x) && ((this->_pos).y == local_38.y)) { this->_collidesWithGrid = 0; clampPos->x = local_38.x; (this->_pos).y = local_38.y; goto LAB_006a9f87; } this->_collidesWithGrid = 1; (this->_gridCollisionVelocity).x = (this->_velocity).x; (this->_gridCollisionVelocity).y = (this->_velocity).y; if (clampPos->x != local_38.x) { if (clampPos->x <= local_38.x) { sign = &DAT_bf800000; } else { sign = (undefined1 *)0x3f800000; } local_44 = (float)sign + local_44; } fVar10 = (this->_pos).y; if (fVar10 != local_38.y) { if (fVar10 <= local_38.y) { sign = &DAT_bf800000; } else { sign = (undefined1 *)0x3f800000; } normalY = (float)sign + normalY; } } clampPos->x = local_38.x; (this->_pos).y = local_38.y; } LAB_006a9f87: if (gridCollisionClass == 4) { if (isSimulated != 0) { return; } if ((*(int *)((int)g_game->_room + 0x1bb0) == 0x37) || (isNoPush = isSimulated, (*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 0xf & 1) != 0 )) { isNoPush = 1; } iVar3 = Room::GetGridCollisionAtPos(room,this->_pos); if ((iVar3 == 4) || (iVar3 == 5)) { isWallCollision = true; Room::GetClampedPositionImpl(g_game->_room,&local_38,&this->_pos,0.0,0.0,0.0,0.0); bVar2 = Vector::operator_ne(&local_38,&this->_pos); if (bVar2 != 0) { if (isNoPush != 0) { return; } if (0.0 <= (local_38.y - (this->_pos).y) * (this->_velocity).y + (local_38.x - (this->_pos).x) * (this->_velocity).x) { return; } } } else { isWallCollision = false; } if ((iVar3 != 3) && (!isWallCollision)) { if (this->_type != 2) { return; } if (iVar3 != 2) { return; } } gridEntity = Room::GetGridEntityFromPos(room,&this->_pos); if (gridEntity == (GridEntity *)0x0) { return; } gridEntity = Room::GetGridEntityFromPos(room,&this->_pos); if ((gridEntity->_desc)._type == 7) { return; } this->_collidesWithGrid = 1; (this->_gridCollisionVelocity).x = (this->_velocity).x; (this->_gridCollisionVelocity).y = (this->_velocity).y; return; } pvVar1 = (this->_collisionPoints)._begin; collisionPointsEnd = (this->_collisionPoints)._end; if (pvVar1 == collisionPointsEnd) { return; } uVar5 = (int)collisionPointsEnd - (int)pvVar1 >> 3; local_6c = g_vectorZero.x; local_38.x = g_vectorZero.x; local_70 = g_vectorZero.y; local_38.y = g_vectorZero.y; if (gridCollisionClass == 5) { if (uVar5 != 0) { uVar7 = 0; do { fVar10 = *(float *)((int)pvVar1 + uVar7 * 8); fVar11 = *(float *)((int)pvVar1 + uVar7 * 8 + 4); iVar3 = (int)((((this->_pos).y + fVar11) - 120.0) / 40.0 + 0.5); iVar6 = (int)(((fVar10 + (this->_pos).x) - 40.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar4 = Room::GetGridCollision(room,iVar6); if (uVar4 != 0) { local_6c = fVar10 + local_6c; local_70 = local_70 + fVar11; local_38.x = local_6c; local_38.y = local_70; } uVar7 = uVar7 + 1; } while (uVar7 < uVar5); } } else if (gridCollisionClass == 7) { if (uVar5 != 0) { uVar7 = 0; do { fVar10 = *(float *)((int)pvVar1 + uVar7 * 8); fVar11 = *(float *)((int)pvVar1 + uVar7 * 8 + 4); iVar3 = (int)((((this->_pos).y + fVar11) - 120.0) / 40.0 + 0.5); iVar6 = (int)(((fVar10 + (this->_pos).x) - 40.0) / 40.0 + 0.5); if (((iVar6 < 0) || (room->_gridWidth <= iVar6)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar4 = Room::GetGridCollision(room,iVar6); if (uVar4 != 1) { local_6c = fVar10 + local_6c; local_70 = local_70 + fVar11; local_38.x = local_6c; local_38.y = local_70; } uVar7 = uVar7 + 1; } while (uVar7 < uVar5); } } else if (gridCollisionClass == 6) { pointIndex = 0; if (uVar5 != 0) { do { pvVar1 = (this->_collisionPoints)._begin; iVar6 = (int)((((this->_pos).x + *(float *)((int)pvVar1 + pointIndex * 8)) - 40.0) / 40.0 + 0.5); iVar3 = (int)(((*(float *)((int)pvVar1 + pointIndex * 8 + 4) + (this->_pos).y) - 120.0) / 40.0 + 0.5); if (((iVar6 < 0) || (room->_gridWidth <= iVar6)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { local_48 = Room::GetGridCollision(room,-1); if (-1 < iVar6) goto LAB_006aa40c; LAB_006aa43d: cellGridEntity = (GridEntity *)0x0; } else { local_48 = Room::GetGridCollision(room,iVar3 * room->_gridWidth + iVar6); LAB_006aa40c: if ((((room->_gridWidth <= iVar6) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) || (uVar7 = iVar3 * room->_gridWidth + iVar6, 0x1bf < uVar7)) goto LAB_006aa43d; cellGridEntity = room->_gridEntities[uVar7]; } if (((local_48 != 0) && (local_48 != 1)) && ((cellGridEntity == (GridEntity *)0x0 || ((cellGridEntity->_desc)._type != 7)))) { pvVar1 = (this->_collisionPoints)._begin; local_6c = local_6c + *(float *)((int)pvVar1 + pointIndex * 8); local_70 = local_70 + *(float *)((int)pvVar1 + pointIndex * 8 + 4); local_38.x = local_6c; local_38.y = local_70; } if (((isSimulated == 0) && (this->_type == 3)) && (((((this->_variant == 0x4b && (((local_48 == 3 || (local_48 == 2)) && (pvVar1 = g_game->_room, -1 < iVar6)))) && (((iVar6 < *(int *)((int)pvVar1 + 0xc) && (-1 < iVar3)) && (iVar3 < *(int *)((int)pvVar1 + 0x10))))) && ((iVar6 = iVar3 * *(int *)((int)pvVar1 + 0xc) + iVar6, -1 < iVar6 && (iVar6 < 0x1c0)))) && (gridEntity = room->_gridEntities[iVar6], gridEntity != (GridEntity *)0x0)))) { fVar10 = (this->_velocity).y; fVar11 = (this->_velocity).x; if ((25.0 < fVar11 * fVar11 + fVar10 * fVar10) && (gridEntity->_collisionClass == 3)) { hitPosX = (this->_pos).x; hitPosY = (this->_pos).y; hitSpawnerType = this->_spawnerType; hitSpawnerVariant = this->_spawnerVariant; hitVelX = (this->_velocity).x; hitVelY = (this->_velocity).y; hitSourceType = 3; hitSourceVariant = 0x4b; local_48 = (uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar7 = 0; } else { uVar7 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar4 = 0; } else { uVar4 = 4; } hitFlags = uVar4 | uVar7 | local_48; hitSourceEntity = this; isDestroyed = (**(code **)(*(int *)gridEntity + 0x14))(0,&hitSourceType); if (isDestroyed != '\0') { curRoom = g_game->_room; iVar3 = curRoom->_gridWidth; fVar9 = (float)(gridEntity->_gridIndex % iVar3) * 40.0 + 40.0; fVar12 = (float)(gridEntity->_gridIndex / iVar3) * 40.0 + 120.0; fVar10 = fVar9 - (this->_pos).x; fVar11 = fVar12 - (this->_pos).y; if (ABS(fVar10) <= ABS(fVar11)) { sign = (undefined1 *)0x0; if (0.0 <= fVar11) { signY = (undefined1 *)0x3f800000; } else { signY = &DAT_bf800000; } } else { signY = (undefined1 *)0x0; if (0.0 <= fVar10) { sign = (undefined1 *)0x3f800000; } else { sign = &DAT_bf800000; } } iVar6 = (int)((((float)sign * 40.0 + fVar9) - 40.0) / 40.0 + 0.5); if ((((-1 < iVar6) && (iVar6 < iVar3)) && (neighborRow = (int)((((float)signY * 40.0 + fVar12) - 120.0) / 40.0 + 0.5), -1 < neighborRow)) && ((neighborRow < curRoom->_gridHeight && (iVar6 = neighborRow * iVar3 + iVar6, -1 < iVar6)))) { if (iVar6 < 0x1c0) { pit = room->_gridEntities[iVar6]; } else { pit = (GridEntity *)0x0; } Room::TryMakeBridge(curRoom,pit,gridEntity); } goto LAB_006aa782; } } local_6c = g_vectorZero.x; local_38.x = g_vectorZero.x; local_70 = g_vectorZero.y; local_38.y = g_vectorZero.y; } LAB_006aa782: pointIndex = pointIndex + 1; } while (pointIndex < uVar5); } } else if (uVar5 != 0) { uVar7 = 0; do { fVar10 = *(float *)((int)pvVar1 + uVar7 * 8); fVar11 = *(float *)((int)pvVar1 + uVar7 * 8 + 4); iVar6 = (int)((((this->_pos).x + fVar10) - 40.0) / 40.0 + 0.5); iVar3 = (int)((((this->_pos).y + fVar11) - 120.0) / 40.0 + 0.5); if (((iVar6 < 0) || (room->_gridWidth <= iVar6)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar4 = Room::GetGridCollision(room,iVar6); if (((uVar4 == 4) || (uVar4 == 5)) && (*(int *)((int)g_game->_room + 8) != 0x10)) { local_6c = fVar10 + local_6c; local_70 = local_70 + fVar11; local_38.x = local_6c; local_38.y = local_70; } uVar7 = uVar7 + 1; } while (uVar7 < uVar5); } if ((local_6c == g_vectorZero.x) && (local_70 == g_vectorZero.y)) { if (isSimulated == 0) { (this->_gridCollisionNormal).x = local_44; (this->_gridCollisionNormal).y = normalY; return; } return; } if ((this->_type != 2) || (0.001 <= local_70 * local_70 + local_6c * local_6c)) { bVar2 = IsEnemy(this); if ((bVar2 != 0) && ((gridCollisionClass == 5 && (local_70 * local_70 + local_6c * local_6c < 0.001)))) { pos = &this->_pos; Room::FindFreeTilePosition(g_game->_room,&local_38,pos,40.0); fVar10 = 20.0 - this->_size * (this->_sizeMulti).x; if (local_38.x - pos->x <= 0.0) { local_38.x = local_38.x + fVar10; } else { local_38.x = local_38.x - fVar10; } fVar10 = 20.0 - this->_size * (this->_sizeMulti).y; if (0.0 < local_38.y - (this->_pos).y) { pos->x = local_38.x; (this->_pos).y = local_38.y - fVar10; return; } pos->x = local_38.x; (this->_pos).y = local_38.y + fVar10; return; } } else { iVar3 = Room::GetGridIndex(room,&this->_pos); fVar10 = this->_size; fVar11 = (this->_sizeMulti).x; fVar9 = fVar10 * fVar11; fVar13 = (this->_pos).x - ((float)(iVar3 % room->_gridWidth) * 40.0 + 40.0); fVar12 = (this->_pos).y - ((float)(iVar3 / room->_gridWidth) * 40.0 + 120.0); if ((ABS(fVar13) + fVar9 < 20.0) || (ABS(fVar12) + fVar10 * (this->_sizeMulti).y < 20.0)) { local_38.y = (this->_sizeMulti).y; if (ABS(fVar11 * fVar13) <= ABS(local_38.y * fVar12)) { local_38.x = 0.0; local_38.y = local_38.y * fVar10; if (0.0 < fVar12) { local_38.y = local_38.y * -1.0; } } else { local_38.y = 0.0; local_38.x = fVar9; if (0.0 < fVar13) { local_38.x = fVar9 * -1.0; } } } } Vector::Normalize(&local_38); if (isSimulated == 0) { (this->_gridCollisionNormal).x = local_38.x; (this->_gridCollisionNormal).y = local_38.y; } fVar10 = (this->_velocity).y; fVar11 = (this->_velocity).x; fVar9 = -local_38.x * fVar11 - fVar10 * local_38.y; if (0.0 <= fVar9) { return; } if (isSimulated != 0) goto LAB_006aad6f; (this->_gridCollisionVelocity).x = fVar11; this->_collidesWithGrid = 1; (this->_gridCollisionVelocity).y = fVar10; iVar3 = this->_type; fVar10 = fVar9 * 1.8 - 0.1; if (iVar3 == 99) { fVar11 = -fVar9 * 0.05; if (1.2 <= fVar11) { fVar11 = 1.2; } play_sound_with_fart_seed(0x1c,fVar11,2,0,1.0); fVar10 = fVar10 * 1.4; goto LAB_006aad37; } if ((iVar3 == 0xd9) || (iVar3 == 0xdc)) { LAB_006aad2f: fVar10 = fVar10 * 1.2; } else if (iVar3 == 0x393) { if (this->_variant == 1) goto LAB_006aac90; } else if (iVar3 == 0x37d) { LAB_006aac90: uVar5 = Random(); fVar11 = (this->_velocity).y; fVar12 = (this->_velocity).x; fVar13 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; bVar2 = 0; iVar6 = 2; fVar11 = sqrtf(fVar12 * fVar12 + fVar11 * fVar11); iVar3 = 0x1e7; if (this->_type == 0x37d) { iVar3 = 0x245; } fVar11 = fVar11 * 0.05 + 0.2; if (1.2 <= fVar11) { fVar11 = 1.2; } play_sound_with_fart_seed(iVar3,fVar11,iVar6,bVar2,fVar13); goto LAB_006aad2f; } LAB_006aad37: (this->_velocity).x = fVar10 * (this->_gridCollisionNormal).x + (this->_velocity).x; fVar10 = fVar10 * (this->_gridCollisionNormal).y + (this->_velocity).y; (this->_velocity).y = fVar10; LAB_006aad6f: fVar11 = (this->_velocity).x; fVar10 = sqrtf(fVar11 * fVar11 + fVar10 * fVar10); if (0.0 < fVar10) { fVar11 = local_38.y * (this->_sizeMulti).y; fVar12 = local_38.x * (this->_sizeMulti).x; fVar12 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); fVar12 = fVar12 * this->_size; fVar11 = (this->_pos).x; local_70 = fVar10; if (fVar10 <= 2.0) { local_70 = 2.0; } local_70 = fVar12 - local_70; local_6c = fVar12; if (gridCollisionClass == 5) { local_44 = 1.68156e-44; do { fVar13 = (local_6c - local_70) * 0.5 + local_70; iVar6 = (int)(((fVar13 * local_38.x + fVar11) - 40.0) / 40.0 + 0.5); iVar3 = (int)(((fVar13 * local_38.y + (this->_pos).y) - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar5 = Room::GetGridCollision(room,iVar6); if (uVar5 == 0) { local_70 = fVar13; } else { local_6c = fVar13; } local_44 = (float)((int)local_44 + -1); } while (local_44 != 0.0); } else if (gridCollisionClass == 7) { local_44 = 8.40779e-45; do { fVar13 = (local_6c - local_70) * 0.5 + local_70; iVar6 = (int)(((fVar13 * local_38.x + fVar11) - 40.0) / 40.0 + 0.5); iVar3 = (int)(((fVar13 * local_38.y + (this->_pos).y) - 120.0) / 40.0 + 0.5); if (((iVar6 < 0) || (room->_gridWidth <= iVar6)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar5 = Room::GetGridCollision(room,iVar6); if (uVar5 == 1) { local_70 = fVar13; } else { local_6c = fVar13; } local_44 = (float)((int)local_44 + -1); } while (local_44 != 0.0); } else { fVar13 = (this->_pos).y; if (gridCollisionClass == 6) { local_44 = (float)gridCollisionClass; do { fVar8 = (local_6c - local_70) * 0.5 + local_70; iVar6 = (int)(((fVar8 * local_38.x + fVar11) - 40.0) / 40.0 + 0.5); iVar3 = (int)(((fVar8 * local_38.y + fVar13) - 120.0) / 40.0 + 0.5); if (((iVar6 < 0) || (room->_gridWidth <= iVar6)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar5 = Room::GetGridCollision(room,iVar6); if ((uVar5 == 0) || (uVar5 == 1)) { local_70 = fVar8; } else { local_6c = fVar8; } local_44 = (float)((int)local_44 + -1); } while (local_44 != 0.0); } else { local_44 = 8.40779e-45; do { fVar8 = (local_6c - local_70) * 0.5 + local_70; iVar6 = (int)(((fVar8 * local_38.x + fVar11) - 40.0) / 40.0 + 0.5); iVar3 = (int)(((fVar8 * local_38.y + fVar13) - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) { iVar6 = -1; } else { iVar6 = iVar3 * room->_gridWidth + iVar6; } uVar5 = Room::GetGridCollision(room,iVar6); if ((uVar5 == 4) || (uVar5 == 5)) { local_6c = fVar8; } else { local_70 = fVar8; } local_44 = (float)((int)local_44 + -1); } while (local_44 != 0.0); } } pos->x = local_38.x * (local_70 - fVar12) + pos->x; (this->_pos).y = local_38.y * (local_70 - fVar12) + (this->_pos).y; } if (isSimulated == 0) { fVar10 = 1.0 - (-fVar9 / fVar10) * 0.5; (this->_velocity).y = fVar10 * (this->_velocity).y; (this->_velocity).x = fVar10 * (this->_velocity).x; } return; } //@@ 006ab240 Entity::is_grid_collision_at /* DB: ? ECX = Entity, arg position: for each collision sample offset in the vector +0x178..+0x17c (+ position offset +0x33c/+0x340) tests Room::GetGridCollision of the tile; GridCollisionClass +0x184 == 3 (walls) hits on wall 4 or solid door (grid type 0x10), == 5 (ground) on any non-0 non-5; returns whether the summed hit offsets are nonzero; callers Entity::push_apart_circle and 3 FUN_ prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::is_grid_collision_at(Entity *this,Vector *position) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; int iVar7; void *pvVar8; Room *this_00; uint uVar9; int iVar10; uint uVar11; int iVar12; void *pvVar13; uint uVar14; float fVar15; float local_10; float local_8; iVar7 = this->_entityGridCollisionClass; if (iVar7 != 0) { pvVar8 = (this->_collisionPoints)._begin; pvVar13 = (this->_collisionPoints)._end; if (pvVar8 != pvVar13) { uVar14 = 0; uVar11 = (int)pvVar13 - (int)pvVar8 >> 3; this_00 = g_game->_room; local_10 = g_vectorZero.x; local_8 = g_vectorZero.y; fVar15 = g_vectorZero.x; if (uVar11 != 0) { fVar1 = (this->_pos).y; fVar2 = position->x; fVar3 = position->y; fVar4 = (this->_pos).x; do { fVar5 = *(float *)((int)pvVar8 + uVar14 * 8); fVar6 = *(float *)((int)pvVar8 + uVar14 * 8 + 4); iVar12 = (int)(((fVar5 + fVar2 + fVar4) - 40.0) / 40.0 + 0.5); if ((((-1 < iVar12) && (iVar12 < this_00->_gridWidth)) && (iVar10 = (int)(((fVar6 + fVar1 + fVar3) - 120.0) / 40.0 + 0.5), -1 < iVar10)) && ((iVar10 < this_00->_gridHeight && (iVar12 = this_00->_gridWidth * iVar10 + iVar12, -1 < iVar12)))) { if (iVar12 < 0x1c0) { pvVar13 = this_00->_gridEntities[iVar12]; } else { pvVar13 = (void *)0x0; } uVar9 = Room::GetGridCollision(this_00,iVar12); fVar15 = local_10; if (iVar7 == 3) { if ((uVar9 == 4) || (((uVar9 == 3 && (pvVar13 != (void *)0x0)) && (*(int *)((int)pvVar13 + 4) == 0x10)) )) { LAB_006ab3eb: local_10 = fVar5 + local_10; local_8 = fVar6 + local_8; fVar15 = local_10; } } else if (((iVar7 == 5) && (uVar9 != 0)) && (uVar9 != 5)) goto LAB_006ab3eb; } uVar14 = uVar14 + 1; } while (uVar14 < uVar11); } if ((fVar15 != g_vectorZero.x) || (local_8 != g_vectorZero.y)) { return 1; } } } return 0; } //@@ 006ab440 Entity::PlayerCollideWithGrid /* DB: (bool): __RTDynamicCast to Entity_Player else log "Called PlayerCollideWithGrid with Entity type != Entity_Player"; CanCrushRocks, TryBlowOpen, TryMakeBridge, SpawnGridEntity prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::PlayerCollideWithGrid(Entity *this,byte isSimulated) { Room *gridEntity; Room *this_01; byte bVar1; char isCollided; Entity_Player *this_02; GridEntity *newRock; uint uVar2; int iVar3; int iVar4; uint uVar5; int iVar6; int *piVar7; GridEntity_Door *gridEntity; float bridgeDirX; float fVar8; float bridgeDirY; float fVar9; float fVar10; float gridCenterY; int doorCollideInfo; int local_fc; int local_f8; int local_f4; float local_f0; float local_ec; float local_e8; float local_e4; uint local_e0; Entity *local_dc; int gridCollideInfo; int local_d4; int local_d0; int local_cc; float local_c8; float local_c4; float local_c0; float local_bc; uint local_b8; Entity *local_b4; int webCollideInfo; int local_ac; int local_a8; int local_a4; float local_a0; float local_9c; float local_98; float local_94; uint local_90; Entity *local_8c; int megaMushCollideInfo; int local_84; int local_80; int local_7c; float local_78; float local_74; float local_70; float local_6c; uint local_68; Entity *local_64; Vector *posRef; Vector local_5c; Vector local_54; Vector pointPos; float local_40; float local_3c; float local_30; uint local_2c; float normalY; float normalX; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *collisionPoints; Game *game; undefined4 *oldGridEntity; Vector *pos; local_14 = 0xffffffff; puStack_18 = &LAB_00afa457; local_1c = ExceptionList; ExceptionList = &local_1c; this_02 = (Entity_Player *) __RTDynamicCast(this,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0, __security_cookie ^ (int)register0x00000010 - 0x10U); if (this_02 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"Called PlayerCollideWithGrid with Entity type != Entity_Player\n") ; } if (isSimulated == 0) { this->_collidesWithGrid = 0; } game = g_game; if (this->_entityGridCollisionClass == 0) { ExceptionList = local_1c; return; } if ((this->_collisionPoints)._begin == (this->_collisionPoints)._end) { ExceptionList = local_1c; return; } if (this->_minecart != (EntityPtr)0x0) { ExceptionList = local_1c; return; } posRef = &this->_pos; gridEntity = g_game->_room; Room::GetClampedPositionImpl(gridEntity,&local_54,posRef,0.0,0.0,0.0,0.0); piVar7 = *(int **)((int)game->_room->_descriptor + 0x10); if (((piVar7 == (int *)0x0) || (piVar7[2] != 0x10)) || (*piVar7 != 0x23)) { pos = &this->_pos; iVar6 = Room::GetGridIndex(game->_room,pos); if ((iVar6 < 0) || (iVar6 = Entity_Player::get_grid_collision_at(pos), iVar6 == 4)) { if (isSimulated == 0) { if ((pos->x == local_54.x) && ((this->_pos).y == local_54.y)) { bVar1 = 0; } else { bVar1 = 1; } this->_collidesWithGrid = bVar1; } if (*(int *)((int)g_game->_room + 8) != 0x10) { pos->x = local_54.x; (this->_pos).y = local_54.y; } } } else { fVar8 = this->_size; pos = &this->_pos; local_54.x = pos->x - 0.0; local_54.y = (this->_pos).y - 20.0; Room::GetClampedPositionImpl(gridEntity,&local_5c,&local_54,fVar8,fVar8,fVar8,fVar8); local_5c.x = local_5c.x + 0.0; local_5c.y = local_5c.y + 20.0; if (isSimulated == 0) { if ((pos->x == local_5c.x) && ((this->_pos).y == local_5c.y)) { this->_collidesWithGrid = 0; pos->x = local_5c.x; (this->_pos).y = local_5c.y; goto LAB_006ab679; } this->_collidesWithGrid = 1; } pos->x = local_5c.x; (this->_pos).y = local_5c.y; } LAB_006ab679: local_5c.y = (float)((int)(this->_collisionPoints)._end - (int)(this->_collisionPoints)._begin >> 3); normalX = g_vectorZero.x; normalY = g_vectorZero.y; local_40 = 0.0; fVar8 = g_vectorZero.x; fVar10 = g_vectorZero.y; if (local_5c.y != 0.0) { do { collisionPoints = (this->_collisionPoints)._begin; pointPos.x = (this->_pos).x + *(float *)((int)collisionPoints + (int)local_40 * 8); pointPos.y = *(float *)((int)collisionPoints + (int)local_40 * 8 + 4) + (this->_pos).y; iVar6 = (int)((pointPos.x - 40.0) / 40.0 + 0.5); iVar4 = (int)((pointPos.y - 120.0) / 40.0 + 0.5); if (-1 < iVar6) { iVar3 = *(int *)((int)g_game->_room + 0xc); if (iVar6 < iVar3) { if (-1 < iVar4) { if (iVar4 < *(int *)((int)g_game->_room + 0x10)) { iVar6 = iVar3 * iVar4 + iVar6; if (-1 < iVar6) { if (iVar6 < 0x1c0) { gridEntity = gridEntity->_gridEntities[iVar6]; } else { gridEntity = (GridEntity_Door *)0x0; } iVar4 = Entity_Player::get_grid_collision_at(&pointPos); if (isSimulated != 0) goto LAB_006abf5a; bVar1 = TemporaryEffects::HasCollectibleEffect(&this_02->_temporaryeffects,0x271); if ((bVar1 != 0) && (gridEntity != (GridEntity_Door *)0x0)) { iVar3 = (gridEntity->_desc)._type; if (((iVar3 == 3) || ((iVar3 == 0x18 || (iVar3 == 0xb)))) && (iVar4 != 0)) { uVar5 = (gridEntity->_desc)._spawnSeed; if (iVar6 < 0x1c0) { oldGridEntity = gridEntity->_gridEntities[iVar6]; if ((oldGridEntity != (undefined4 *)0x0) && (oldGridEntity[1] != 1)) { gridEntity->_gridPaths[iVar6] = 900; gridEntity->_gridEntities[iVar6] = (void *)0x0; (**(code **)*oldGridEntity)(1); } if (gridEntity->_gridPaths[iVar6] < 0x385) { newRock = operator_new(0x198); local_14 = 1; local_54.y = (float)newRock; if (newRock == (GridEntity *)0x0) { newRock = (GridEntity *)0x0; } else { GridEntity::GridEntity(newRock); *(undefined ***)newRock = IsaacRepentancePlus::GridEntity_Rock::vftable; *(undefined4 *)(newRock + 1) = 0; newRock[1]._desc._spawnCount = 0; newRock[1]._desc._spawnSeed = 0xf; *(undefined1 *)(newRock + 1) = 0; newRock[1]._desc._varData = 0; newRock[1]._spawnFrame = 0; newRock[1]._rng._seed = 0xf; *(undefined1 *)&newRock[1]._desc._varData = 0; newRock[1]._rng._shift1 = 0; newRock[1]._rng._shift2 = 0; newRock[1]._rng._shift3 = 0; } local_14 = 0xffffffff; if (newRock != (GridEntity *)0x0) { (newRock->_desc)._type = 2; newRock->_gridIndex = iVar6; if (gridEntity->_gridEntities[iVar6] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)gridEntity->_gridEntities[iVar6])(1); } gridEntity->_gridEntities[iVar6] = newRock; (newRock->_desc)._variant = 0; (newRock->_desc)._varData = 0; GridEntity::Init(newRock,uVar5); } } piVar7 = gridEntity->_gridEntities[iVar6]; } else { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); piVar7 = (int *)0x0; } if (piVar7 != (int *)0x0) { local_78 = (this->_pos).x; local_74 = (this->_pos).y; megaMushCollideInfo = this->_type; local_84 = this->_variant; local_80 = this->_spawnerType; local_7c = this->_spawnerVariant; local_70 = (this->_velocity).x; local_6c = (this->_velocity).y; local_2c = (uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_68 = uVar2 | uVar5 | local_2c; local_64 = this; (**(code **)(*piVar7 + 0x14))(0,&megaMushCollideInfo); } } else { if ((iVar3 != 0x10) || (iVar4 != 4)) { if (iVar3 == 10) { local_a0 = (this->_pos).x; local_9c = (this->_pos).y; webCollideInfo = this->_type; local_ac = this->_variant; local_a8 = this->_spawnerType; local_a4 = this->_spawnerVariant; local_98 = (this->_velocity).x; local_94 = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_90 = uVar2 | uVar5 | (uint)((this->_flags & 0x100) != 0); local_8c = this; (**(code **)(*(int *)gridEntity + 0x14))(0,&webCollideInfo); } goto LAB_006abb5a; } GridEntity_Door::TryBlowOpen(gridEntity,1,this); } goto LAB_006ab9e8; } LAB_006abb5a: if ((iVar4 != 3) && (iVar4 != 2)) { if (gridEntity == (GridEntity_Door *)0x0) goto LAB_006abf5a; goto LAB_006abbad; } bVar1 = Entity_Player::CanCrushRocks(this_02); if (bVar1 == 0) { if (gridEntity == (GridEntity_Door *)0x0) goto LAB_006abf5a; if (((gridEntity->_desc)._type != 0xe) || (bVar1 = TemporaryEffects::HasCollectibleEffect (&this_02->_temporaryeffects,0x251), bVar1 == 0)) goto LAB_006abbad; LAB_006abcae: if ((gridEntity->_collisionClass != 3) && (gridEntity->_collisionClass != 2)) { LAB_006abbad: if (((iVar4 == 4) && ((gridEntity->_desc)._type == 0x10)) && (this_02->_itemState == 0x93)) { iVar3 = __RTDynamicCast(gridEntity,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::GridEntity_Door:: RTTI_Type_Descriptor,0); if (((*(int *)(iVar3 + 0x15c) == 7) || (*(int *)(iVar3 + 0x160) == 7)) || ((*(int *)(iVar3 + 0x15c) == 8 || (*(int *)(iVar3 + 0x160) == 8)))) { local_f0 = (this->_pos).x; local_ec = (this->_pos).y; doorCollideInfo = this->_type; local_fc = this->_variant; local_f8 = this->_spawnerType; local_f4 = this->_spawnerVariant; local_e8 = (this->_velocity).x; local_e4 = (this->_velocity).y; if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_e0 = uVar2 | uVar5 | (uint)((this->_flags & 0x100) != 0); local_dc = this; if ((iVar6 < 0x1c0) && (piVar7 = *(int **)((int)g_game->_room + iVar6 * 4 + 0x24), piVar7 != (int *)0x0)) { (**(code **)(*piVar7 + 0x14))(0,&doorCollideInfo); } goto LAB_006ab9e8; } } goto LAB_006abf5a; } local_c8 = (this->_pos).x; local_c4 = (this->_pos).y; gridCollideInfo = this->_type; local_d4 = this->_variant; local_d0 = this->_spawnerType; local_cc = this->_spawnerVariant; local_c0 = (this->_velocity).x; local_bc = (this->_velocity).y; local_2c = (uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar2 = 0; } else { uVar2 = 4; } local_b8 = uVar2 | uVar5 | local_2c; local_b4 = this; isCollided = (**(code **)(*(int *)gridEntity + 0x14))(0,&gridCollideInfo); if (isCollided == '\0') goto LAB_006abbad; this_01 = g_game->_room; iVar6 = this_01->_gridWidth; fVar9 = (float)(gridEntity->_gridIndex % iVar6) * 40.0 + 40.0; gridCenterY = (float)(gridEntity->_gridIndex / iVar6) * 40.0 + 120.0; fVar8 = fVar9 - (this->_pos).x; fVar10 = gridCenterY - (this->_pos).y; if (ABS(fVar8) <= ABS(fVar10)) { bridgeDirX = 0.0; if (0.0 <= fVar10) { bridgeDirY = 1.0; } else { bridgeDirY = (float)&DAT_bf800000; } } else { bridgeDirY = 0.0; if (0.0 <= fVar8) { bridgeDirX = 1.0; } else { bridgeDirX = (float)&DAT_bf800000; } } fVar8 = ((bridgeDirX * 40.0 + fVar9) - 40.0) / 40.0 + 0.5; iVar3 = (int)fVar8; iVar4 = (int)(((bridgeDirY * 40.0 + gridCenterY) - 120.0) / 40.0 + 0.5); if ((((-1 < iVar3) && (iVar3 < iVar6)) && (-1 < iVar4)) && ((iVar4 < this_01->_gridHeight && (iVar6 = iVar6 * iVar4 + (int)fVar8, -1 < iVar6)))) { if (iVar6 < 0x1c0) { Room::TryMakeBridge(this_01,gridEntity->_gridEntities[iVar6], (GridEntity *)gridEntity); } else { Room::TryMakeBridge(this_01,(GridEntity *)0x0,(GridEntity *)gridEntity); } goto LAB_006ab9e8; } LAB_006abfe6: fVar8 = normalX; fVar10 = normalY; goto LAB_006aba00; } if (gridEntity != (GridEntity_Door *)0x0) goto LAB_006abcae; LAB_006abf5a: if (this->_entityGridCollisionClass == 3) { if (iVar4 == 4) goto LAB_006abf9a; if (iVar4 == 3) { if (gridEntity == (GridEntity_Door *)0x0) goto LAB_006abfe6; if ((gridEntity->_desc)._type == 0x10) goto LAB_006abf9a; } } else if (((this->_entityGridCollisionClass == 5) && (iVar4 != 0)) && (iVar4 != 5)) { LAB_006abf9a: collisionPoints = (this->_collisionPoints)._begin; normalX = normalX + *(float *)((int)collisionPoints + (int)local_40 * 8); normalY = normalY + *(float *)((int)collisionPoints + (int)local_40 * 8 + 4); } LAB_006ab9e8: fVar8 = normalX; fVar10 = normalY; } } } } } LAB_006aba00: local_40 = (float)((int)local_40 + 1); } while ((uint)local_40 < (uint)local_5c.y); } fVar8 = fVar8 * fVar8 + fVar10 * fVar10; if (0.001 <= fVar8) { fVar8 = sqrtf(fVar8); if (0.0 < fVar8) { normalX = normalX * (1.0 / fVar8); normalY = normalY * (1.0 / fVar8); } if (isSimulated == 0) { (this->_gridCollisionNormal).x = normalX; (this->_gridCollisionNormal).y = normalY; } fVar8 = (this->_velocity).x; fVar10 = (this->_velocity).y; fVar9 = -normalX * fVar8 - normalY * fVar10; if ((fVar9 < 0.0) && (isSimulated == 0)) { this->_collidesWithGrid = 1; (this->_gridCollisionVelocity).x = fVar8; (this->_gridCollisionVelocity).y = fVar10; fVar10 = fVar9 * 0.9 - 0.1; fVar8 = (this->_gridCollisionNormal).x; (this->_velocity).y = (this->_gridCollisionNormal).y * fVar10 + (this->_velocity).y; (this->_velocity).x = fVar10 * fVar8 + (this->_velocity).x; } fVar8 = normalY * (this->_sizeMulti).y; fVar10 = normalX * (this->_sizeMulti).x; fVar9 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); fVar9 = fVar9 * this->_size; fVar8 = (this->_velocity).y; fVar10 = (this->_velocity).x; local_3c = sqrtf(fVar10 * fVar10 + fVar8 * fVar8); if (local_3c <= 2.0) { local_3c = 2.0; } local_3c = fVar9 - local_3c; local_30 = fVar9; if (this->_entityGridCollisionClass == 5) { iVar6 = 0xc; do { fVar8 = (local_30 - local_3c) * 0.5 + local_3c; pointPos.x = normalX * fVar8 + (this->_pos).x; pointPos.y = normalY * fVar8 + (this->_pos).y; iVar4 = Entity_Player::get_grid_collision_at(&pointPos); if ((iVar4 == 0) || (iVar4 == 5)) { local_3c = fVar8; } else { local_30 = fVar8; } iVar6 = iVar6 + -1; } while (iVar6 != 0); } else { iVar6 = 6; do { fVar8 = (local_30 - local_3c) * 0.5 + local_3c; pointPos.x = normalX * fVar8 + (this->_pos).x; pointPos.y = normalY * fVar8 + (this->_pos).y; iVar4 = Entity_Player::get_grid_collision_at(&pointPos); if (iVar4 == 4) { local_30 = fVar8; } else { local_3c = fVar8; } iVar6 = iVar6 + -1; } while (iVar6 != 0); } posRef->x = normalX * (local_3c - fVar9) + posRef->x; posRef->y = normalY * (local_3c - fVar9) + posRef->y; } else if (isSimulated == 0) { (this->_gridCollisionNormal).x = g_vectorZero.x; (this->_gridCollisionNormal).y = g_vectorZero.y; } ExceptionList = local_1c; return; } //@@ 006ac2a0 Entity::SetSize /* ZHL [lua] Lua binding Entity:SetSize prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Entity::SetSize(Entity *this,float size,Vector sizeMulti,int numGridCollisionPoints) { void **ppvVar1; float *pfVar2; int iVar3; float fVar4; double dVar5; int local_24; float local_18; float local_14; double local_10; if ((sizeMulti.x == -1.0) && (sizeMulti.y == -1.0)) { sizeMulti.x = *(float *)((int)this->_config + 0x3c); sizeMulti.y = *(float *)((int)this->_config + 0x40); } if (numGridCollisionPoints == -1) { numGridCollisionPoints = *(int *)((int)this->_config + 0x48); } if (((this->_size != size) || ((this->_sizeMulti).x != sizeMulti.x)) || ((this->_sizeMulti).y != sizeMulti.y)) { this->_size = size; (this->_collisionPoints)._end = (this->_collisionPoints)._begin; (this->_sizeMulti).x = sizeMulti.x; (this->_sizeMulti).y = sizeMulti.y; local_24 = 0; if (0 < numGridCollisionPoints) { do { dVar5 = (double)((((float)local_24 + (float)local_24) * 3.1415927) / (float)numGridCollisionPoints); local_10 = dVar5; libm_sse2_cos_precise(); fVar4 = (float)dVar5 * this->_size * (this->_sizeMulti).x; dVar5 = local_10; local_18 = fVar4; libm_sse2_sin_precise(); pfVar2 = (this->_collisionPoints)._end; local_14 = (float)dVar5 * this->_size * (this->_sizeMulti).y; if (pfVar2 == (this->_collisionPoints)._capacity) { std::vector::_Emplace_reallocate(pfVar2,&local_18); } else { *pfVar2 = fVar4; pfVar2[1] = local_14; ppvVar1 = &(this->_collisionPoints)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 8); } local_24 = local_24 + 2; } while (local_24 < numGridCollisionPoints); } iVar3 = 1; if (1 < numGridCollisionPoints) { do { dVar5 = (double)((((float)iVar3 + (float)iVar3) * 3.1415927) / (float)numGridCollisionPoints ); local_10 = dVar5; libm_sse2_cos_precise(); fVar4 = (float)dVar5 * this->_size * (this->_sizeMulti).x; dVar5 = local_10; local_18 = fVar4; libm_sse2_sin_precise(); pfVar2 = (this->_collisionPoints)._end; local_14 = (float)dVar5 * this->_size * (this->_sizeMulti).y; if (pfVar2 == (this->_collisionPoints)._capacity) { std::vector::_Emplace_reallocate(pfVar2,&local_18); } else { *pfVar2 = fVar4; pfVar2[1] = local_14; ppvVar1 = &(this->_collisionPoints)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 8); } iVar3 = iVar3 + 2; } while (iVar3 < numGridCollisionPoints); } } return; } //@@ 006ac530 Entity::IsEnemy /* ZHL [lua] Lua binding Entity:IsEnemy prototype: db/protos.zhl, confirmed by RET 0 */ byte __thiscall Entity::IsEnemy(Entity *this) { if ((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 1)) { return this->_type - 10U < 0x3de; } return 1; } //@@ 006ac560 Entity::IsVulnerableEnemy /* DB: only gameplay callee of Lua IsVulnerableEnemy glue 0085e680; type 10..999, not friendly/dead/collisionclass0 prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::IsVulnerableEnemy(Entity *this,Entity *source) { byte bVar1; Entity *pEVar2; byte extraout_DL; int iVar3; if (1 < *(int *)&g_game->_deathmatchManager) { if (((source != (Entity *)0x0) && (source->_type == 1)) && (bVar1 = IsDescendantOf(this,source), bVar1 != 0)) { return 0; } if ((1 < *(int *)&g_game->_deathmatchManager) && (this->_type == 1)) { iVar3 = 1; goto LAB_006ac5c1; } } iVar3 = this->_type; if (0x3dd < iVar3 - 10U) { return 0; } LAB_006ac5c1: if ((((this->_entityCollisionClass == 1) || (this->_entityCollisionClass == 0)) || ((this->_isInvicible != 0 || (this->_dead != 0)))) || (((bVar1 = HasEntityFlags(this,0x10), bVar1 != 0 && (iVar3 != 0x322)) && (iVar3 != 0x362)))) { return 0; } if (source == (Entity *)0x0) { return 1; } if ((this->_flags & 0x20000000) == 0) { return 1; } pEVar2 = GetLastSpawner(source); if ((((pEVar2->_flags & 0x20000000) == 0) && (pEVar2->_type != 1)) && (pEVar2->_type != 3)) { return extraout_DL; } return 0; } //@@ 006ac6c0 Entity::IsFlying /* ZHL [exact] __thiscall bool Entity::IsFlying(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity::IsFlying(Entity *this) { int iVar1; iVar1 = this->_entityGridCollisionClass; if ((((iVar1 == 0) || (iVar1 == 3)) || (iVar1 == 1)) || (iVar1 == 2)) { return 1; } return 0; } //@@ 006ac6e0 Entity::ResetColor /* ZHL [exact] void ResetColor(); */ void __thiscall Entity::ResetColor(Entity *this) { float fVar1; float fVar2; float fVar3; ColorMod *pCVar4; pCVar4 = &(this->_sprite)._color; if (pCVar4 != &this->_color) { fVar1 = (this->_color)._tint[1]; fVar2 = (this->_color)._tint[2]; fVar3 = (this->_color)._tint[3]; pCVar4->_tint[0] = (this->_color)._tint[0]; (this->_sprite)._color._tint[1] = fVar1; (this->_sprite)._color._tint[2] = fVar2; (this->_sprite)._color._tint[3] = fVar3; fVar1 = (this->_color)._colorize[1]; fVar2 = (this->_color)._colorize[2]; fVar3 = (this->_color)._colorize[3]; (this->_sprite)._color._colorize[0] = (this->_color)._colorize[0]; (this->_sprite)._color._colorize[1] = fVar1; (this->_sprite)._color._colorize[2] = fVar2; (this->_sprite)._color._colorize[3] = fVar3; *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)(this->_color)._offset; (this->_sprite)._color._offset[2] = (this->_color)._offset[2]; } return; } //@@ 006ac710 Entity::IsFrame /* ZHL [lua] Lua binding Entity:IsFrame prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity::IsFrame(Entity *this,int frequency,int offset) { Game *pGVar1; byte bVar2; pGVar1 = g_game; if ((this->_flags & 0x4000) == 0) { bVar2 = Game::IsPaused(g_game); if (bVar2 == 0) { return (pGVar1->_frameCount + offset) % frequency == 0; } } return 0; } //@@ 006ac760 Entity::GetIntervalTicks /* DB: ? (prev+off)/interval vs (cur+off)/interval tick count, 0 if paused or flag 0x4000 prototype: db/protos.zhl */ int __thiscall Entity::GetIntervalTicks(Entity *this,float interval,float offset) { byte bVar1; if ((this->_flags & 0x4000) == 0) { bVar1 = Game::IsPaused(g_game); if (bVar1 == 0) { return (int)((offset + this->_updateTime) / interval) - (int)((offset + this->_prevUpdateTime) / interval); } } return 0; } //@@ 006ac7e0 Entity::CountRelatedEntities /* DB: ?room query by partition, counts/collects entities passing Entity::IsRelatedTo; friendly spawn caps prototype: db/protos.zhl, confirmed by RET 16 */ int __thiscall Entity::CountRelatedEntities(Entity *this,int type,int variant,int unused,void *outEntities) { undefined4 *puVar1; uint uVar2; qword qVar3; byte bVar4; qword *pqVar5; int iVar6; undefined4 *puVar7; EntityList_EL local_24; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af69dd; local_10 = ExceptionList; ExceptionList = &local_10; iVar6 = 0; local_14 = this; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_24,type,variant,-1,0,0); local_8 = 0; variant = local_24._size; if (local_24._size != 0) { puVar7 = local_24._data; do { bVar4 = IsDescendantOf((Entity *)*puVar7,local_14); if ((bVar4 != 0) && (iVar6 = iVar6 + 1, outEntities != (void *)0x0)) { puVar1 = *(undefined4 **)((int)outEntities + 4); if (puVar1 == *(undefined4 **)((int)outEntities + 8)) { std::vector::_Emplace_reallocate(puVar1,puVar7); } else { *puVar1 = *puVar7; *(int *)((int)outEntities + 4) = *(int *)((int)outEntities + 4) + 4; } } puVar7 = puVar7 + 1; variant = variant + -1; } while (variant != 0); } if (local_24._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } if (local_24._data != (undefined4 *)0x0) { uVar2 = *(uint *)((int)local_24._data + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((uint *)((int)local_24._data + -4)); } } ExceptionList = local_10; return iVar6; } //@@ 006ac8d0 Entity::get_velocity_direction /* DB: returns 0..3 dir from velocity 0x360/0x364 prototype: db/protos.zhl */ int __thiscall Entity::get_velocity_direction(Entity *this) { float fVar1; float fVar2; int iVar3; fVar1 = (this->_velocity).x; fVar2 = (this->_velocity).y; if (ABS(fVar2) < ABS(fVar1)) { iVar3 = 2; if (fVar1 < 0.0) { iVar3 = 0; } return iVar3; } return (uint)(0.0 <= fVar2) * 2 + 1; } //@@ 006ac920 Entity::Kill /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 9] */ void __thiscall Entity::Kill(Entity *this,int param_2) { int iVar1; char cVar2; byte bVar3; Entity_Player *this_00; ColorMod *Color; Color local_38; uint local_c; local_c = __security_cookie ^ (uint)&local_38; if (this->_dead == 0) { this->_dead = 1; if (*(Entity **)(param_2 + 0x24) != (Entity *)0x0) { this_00 = (Entity_Player *)GetPlayerAncestor(*(Entity **)(param_2 + 0x24)); if ((((((this_00 != (Entity_Player *)0x0) && (iVar1 = this->_type, iVar1 != 0)) && (iVar1 != 1)) && (((iVar1 != 2 && (iVar1 != 3)) && ((iVar1 != 4 && ((iVar1 != 5 && (iVar1 != 6)))))))) && (iVar1 != 7)) && ((iVar1 != 8 && (iVar1 != 9)))) { if (iVar1 == 0x21) { bVar3 = Entity_Player::HasCollectible(this_00,0x1a4,0); if ((bVar3 != 0) && (((iVar1 = this->_variant, iVar1 == 0 || (iVar1 == 1)) || (iVar1 == 10)))) { ::Color::Color(&local_38); Game::BombExplosionEffects (g_game,&this->_pos,20.0,(BitSet128)ZEXT816(0),Color,(Entity *)this_00,1.0,1,4 ,0); } } else if (iVar1 != 1000) { Player_stats_add(&g_game->_onlinePlayerStats,0x11,this_00,1.0); cVar2 = (**(code **)(*(int *)this + 0x4c))(); if (cVar2 != '\0') { Player_stats_add(&g_game->_onlinePlayerStats,0x14,this_00,1.0); if (this_00->_isCoopGhost != 0) { Player_stats_add(&g_game->_onlinePlayerStats,0x15,this_00,1.0); } } } } } cVar2 = (**(code **)(*(int *)this + 0x4c))(); if ((cVar2 == '\0') && (this->_type != 3)) { BloodExplode(this); } LuaEngine::PostEntityKill(this); } return; } //@@ 006acb00 Entity::Remove /* ZHL [exact] void Remove(); prototype: db/protos.zhl */ void __thiscall Entity::Remove(Entity *this) { undefined4 *ptr; this->_exists = 0; if (this->_dead == 0) { this->_dead = 1; } ReleaseLuaRef(this); ptr = this->_luaBridgeRef; if (ptr != (undefined4 *)0x0) { luaL_unref(*ptr,0xfff0b9d8,ptr[1]); operator_delete(ptr,8); this->_luaBridgeRef = (void *)0x0; } return; } //@@ 006acb60 Entity::ClearReferences /* ZHL [exact] void ClearReferences(); prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity::ClearReferences(Entity *this) { EntityPtr *pEVar1; std_multiset *this_00; Entity *pEVar2; Entity *local_8; local_8 = this; if (this->_parent != (EntityPtr)0x0) { local_8 = (Entity *)&this->_parent; std::multiset::erase(&local_8); } this->_parent = (EntityPtr)0x0; if (this->_child != (EntityPtr)0x0) { local_8 = (Entity *)&this->_child; std::multiset::erase(&local_8); } this->_child = (EntityPtr)0x0; if (this->_target != (EntityPtr)0x0) { local_8 = (Entity *)&this->_target; std::multiset::erase(&local_8); } this->_target = (EntityPtr)0x0; if (this->_spawnerEntity != (EntityPtr)0x0) { local_8 = (Entity *)&this->_spawnerEntity; std::multiset::erase(&local_8); } this->_spawnerEntity = (EntityPtr)0x0; pEVar1 = &this->_minecart; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity *)pEVar1; std::multiset::erase(&local_8); *pEVar1 = (EntityPtr)0x0; } if (this->_hitEffect != (EntityPtr)0x0) { local_8 = (Entity *)&this->_hitEffect; std::multiset::erase(&local_8); this->_hitEffect = (EntityPtr)0x0; } pEVar1 = &this->_iceFrozenEffect; if (this->_iceFrozenEffect != (EntityPtr)0x0) { (**(code **)(*(int *)this->_iceFrozenEffect + 0x28))(); } if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)0x0; this_00 = &this->_entityPtrReferrers; pEVar2 = this_00->_head; local_8 = *(Entity **)pEVar2; if (local_8 != pEVar2) { do { *(undefined4 *)(local_8->_damageEvents)._capacity = 0; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); pEVar2 = this_00->_head; } while (local_8 != pEVar2); } FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)&pEVar2->field_0x4); *(Entity **)&pEVar2->field_0x4 = pEVar2; *(Entity **)pEVar2 = pEVar2; (pEVar2->_damageEvents)._begin = pEVar2; (this->_entityPtrReferrers)._size = 0; if (this->_valid != 0) { (this->_colorParams)._end = (this->_colorParams)._begin; (this->_damageEvents)._end = (this->_damageEvents)._begin; (this->_collisionPoints)._end = (this->_collisionPoints)._begin; ANM2::Reset(&this->_sprite); } return; } //@@ 006acd10 Entity::IsDamageSourceFriendly /* DB: ?EntityRef source vs FLAG_FRIENDLY/charm; tear/projectile collision skip prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::IsDamageSourceFriendly(Entity *this,EntityRef *source) { int iVar1; void *pvVar2; int iVar3; bool bVar4; bool bVar5; bool bVar6; qword qVar7; char cVar8; byte bVar9; iVar1 = this->_type; if (((iVar1 == 1) && (source->_type == 1)) && (*(int *)&g_game->_deathmatchManager < 2)) { return 1; } qVar7 = this->_flags; if ((((qVar7 & 0x100) == 0) || (pvVar2 = (this->_charmSource)._entity, pvVar2 == (void *)0x0)) || ((*(int *)((int)pvVar2 + 0x28) != 1 || (this->_charmedCountdown != 0)))) { bVar4 = false; } else { bVar4 = true; } if ((((qVar7 & 0x20000000) != 0) || ((iVar1 == 3 && ((qVar7 & 0x20000100) == 0)))) || (bVar6 = false, bVar4)) { bVar6 = true; } iVar3 = *(int *)&g_game->_deathmatchManager; if ((iVar3 < 2) || (iVar1 != 1)) { bVar4 = iVar1 - 10U < 0x3de; } else { bVar4 = true; } if (((((source->_spawnerType == 1) || (iVar1 = source->_type, iVar1 == 1)) || (iVar1 == 8)) || ((source->_spawnerType == 3 || (iVar1 == 3)))) || ((((uint)source->_flags >> 1 & 1) != 0 || ((iVar1 == 1000 && (cVar8 = Entity_Effect::IsPlayerCreep(source->_variant), cVar8 != '\0'))))) ) { bVar5 = true; } else { bVar5 = false; } if (bVar6) { if ((1 < iVar3) && (bVar9 = IsDescendantOf(this,source->_entity), bVar9 == 0)) { if (source->_entity == (Entity *)0x0) { return 0; } bVar9 = IsDescendantOf(source->_entity,(this->_charmSource)._entity); if (bVar9 == 0) { return 0; } } if ((bVar4) && (bVar5)) { return 1; } return 0; } return 0; } //@@ 006ace60 Entity::TakeDamage /* ZHL [exact] bool TakeDamage(float Damage, unsigned long long DamageFlags, EntityRef *Source, int DamageCountdown); prototype: db/protos.zhl, confirmed by RET 20 */ byte __thiscall Entity::TakeDamage(Entity *this,float damage,ulonglong damageFlags,EntityRef *source, int damageCountdown) { std_string *psVar1; float fVar2; byte bVar3; char cVar4; EntityPtr EVar5; EntityPtr EVar6; float *overlayNull; Entity_Player *player; LuaEngine *this_00; int iVar7; uint uVar8; EntityPtr *local_44; float damageInfo [2]; uint damageFlagsLow; uint damageFlagsHigh; EntityRef damageSource; EntityPtr *entityRefSlot; Manager *manager; uint *pendingFlagsHigh; float posOffsetY; if (this->_type == 1) { KAGE_LogMessage(0x10,(byte *)"Entity TakeDamage should not be called for Entity Player!"); } uVar8 = (uint)damageFlags & 0x2000; if (((damageFlags & 0x2000) == 0) && (bVar3 = IsDamageSourceFriendly(this,source), bVar3 != 0)) { return 0; } if (damage <= 0.0) goto LAB_006ad14f; bVar3 = IsVulnerableEnemy(this,(Entity *)0x0); if (bVar3 == 0) { if (this->_type != 0x3b6) goto LAB_006ad14f; LAB_006acf1f: if (this->_variant == 0) { EVar5 = this->_parent; EVar6 = EVar5; joined_r0x006acf5a: if (EVar6 != (EntityPtr)0x0) goto LAB_006acf96; } } else { iVar7 = this->_type; if (iVar7 == 0x325) goto LAB_006ad14f; if (iVar7 == 0x340) { if ((((this->_variant == 1) && (EVar5 = this->_spawnerEntity, EVar5 != (EntityPtr)0x0)) && (*(int *)((int)EVar5 + 0x28) == 0x389)) && ((fVar2 = this[2]._posOffset.x, fVar2 == 2.24208e-44 || (fVar2 == 7.00649e-45)))) goto LAB_006acf96; } else { if (iVar7 == 0x3b6) goto LAB_006acf1f; if (((iVar7 == 0x379) && (EVar5 = this->_parent, EVar5 != (EntityPtr)0x0)) && (*(int *)((int)EVar5 + 0x28) == 0x399)) { if (*(Entity **)((int)EVar5 + 0x3c0) != this) goto LAB_006acf96; EVar6 = *(EntityPtr *)((int)EVar5 + 0x188); goto joined_r0x006acf5a; } } } local_44 = (EntityPtr *)CONCAT31(local_44._1_3_,1); if ((this->_flags & 0x20000000) == 0) { local_44 = (EntityPtr *)((uint)local_44._1_3_ << 8); } EVar5 = (EntityPtr)find_nearest_enemy(local_44); if (EVar5 == (EntityPtr)0x0) { LAB_006ad14f: if (((damageFlags & 2) != 0) && (0.0 < damage)) { if (0 < this->_fireDamageCountdown) { return 0; } this->_fireDamageCountdown = 10; } if ((damageFlags & 0x40) != 0) { if (0 < this->_damageCountdown) { return 0; } this->_damageCountdown = damageCountdown; } if ((((damageFlags & 0x2000) == 0) && (cVar4 = (**(code **)(*(int *)this + 0x4c))(), cVar4 != '\0')) && (1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2))) { iVar7 = 0; do { EVar6 = (EntityPtr)Game::GetPlayer(g_game,uVar8); EVar5 = *(EntityPtr *)((int)EVar6 + 0x1e68); if ((((EVar5 == (EntityPtr)0x0) || (*(int *)((int)EVar5 + 0x161c) == -1)) || ((*(int *)((int)EVar6 + 0x161c) <= *(int *)((int)EVar5 + 0x161c) || (EVar6 == EVar5)))) && (*(int *)((int)EVar6 + 0x3bc) == 0)) { iVar7 = iVar7 + 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); if (1 < iVar7) { damage = damage * 0.8; } } this_00 = (LuaEngine *)(*(uint *)((int)&this->_flags + 4) & 0x400000); if (this_00 != (LuaEngine *)0x0) { damage = damage + damage; } if ((0.0 < this->_maxHitPoints) && (bVar3 = LuaEngine::EntityTakeDamage(this_00,this,damage,damageFlags,source,damageCountdown), bVar3 != 0)) { DamageInfo::DamageInfo(); damageInfo[0] = damage; damageFlagsHigh = damageFlags._4_4_; damageFlagsLow = (uint)damageFlags; EntityRef::operator_(&damageSource,source); FUN_006b7db0(damageInfo); fVar2 = this->_pendingDamage; *(uint *)&this->_pendingDamageFlags = (uint)this->_pendingDamageFlags | (uint)damageFlags; pendingFlagsHigh = (uint *)((int)&this->_pendingDamageFlags + 4); *pendingFlagsHigh = *pendingFlagsHigh | damageFlags._4_4_; this->_pendingDamage = damage + fVar2; if (source->_entity == (Entity *)0x0) { player = (Entity_Player *)0x0; } else { player = (Entity_Player *)GetPlayerAncestor(source->_entity); } if ((((1 < *(int *)&g_game->_deathmatchManager) && (this->_type == 1)) || (this->_type - 10U < 0x3de)) && (player != (Entity_Player *)0x0)) { Player_stats_add(&g_game->_onlinePlayerStats,0xf,player,damage); iVar7 = __ftoui3(); *(int *)&player->field_0x16b8 = *(int *)&player->field_0x16b8 + iVar7; *(int *)&player->field_0x16bc = *(int *)&player->field_0x16bc + iVar7; } return 1; } return 0; } LAB_006acf96: manager = g_manager; local_44 = (EntityPtr *)0x1f5; seed_fart_sound_override((int *)&local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44,1.0,10,0,1.0,0.0); if (this->_hitEffect != (EntityPtr)0x0) { (**(code **)(*(int *)this->_hitEffect + 0x28))(); } uVar8 = Random(); EVar6 = (EntityPtr) Game::SpawnEx(g_game,1000,0xa0,&this->_pos,&g_vectorZero,(Entity *)EVar5,0,uVar8,0); if (*(EntityPtr *)((int)EVar6 + 0x3bc) != (EntityPtr)0x0) { local_44 = (EntityPtr *)((int)EVar6 + 0x3bc); std::multiset::erase(&local_44); } *(EntityPtr *)((int)EVar6 + 0x3bc) = EVar5; if (EVar5 != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar6 + 0x3bc)); } entityRefSlot = (EntityPtr *)((int)EVar6 + 0x3c4); if (*(EntityPtr *)((int)EVar6 + 0x3c4) != (EntityPtr)0x0) { local_44 = entityRefSlot; std::multiset::erase(&local_44); } *entityRefSlot = (EntityPtr)this; std::multiset::insert(entityRefSlot); *(uint *)((int)EVar6 + 0x468) = 0; psVar1 = (std_string *)((int)EVar6 + 0x46c); psVar1->_buf[0] = '\0'; psVar1->_buf[1] = '\0'; psVar1->_buf[2] = -0x40; psVar1->_buf[3] = -0x3f; if (((this->_sprite)._animState._animData != (void *)0x0) && (overlayNull = AnimationState::GetNullFrame (&(this->_sprite)._animState,(byte *)"OverlayEffect"), overlayNull != (float *)0x0)) { fVar2 = overlayNull[1]; posOffsetY = (this->_posOffset).y; ((Vector *)((int)EVar6 + 0x34c))->x = ((*overlayNull - 0.0) * 0.5) / 0.65 + (this->_posOffset).x ; *(float *)((int)EVar6 + 0x350) = ((fVar2 - 4.0) * 0.5) / 0.65 + posOffsetY; } (**(code **)(*(int *)EVar6 + 0xc))(); entityRefSlot = &this->_hitEffect; if (this->_hitEffect == EVar6) { return 0; } if (this->_hitEffect != (EntityPtr)0x0) { local_44 = entityRefSlot; std::multiset::erase(&local_44); } *entityRefSlot = EVar6; std::multiset::insert(entityRefSlot); return 0; } //@@ 006ad340 Entity::HasMortalDamage /* ZHL [lua] Lua binding Entity:HasMortalDamage */ bool __thiscall Entity::HasMortalDamage(Entity *this) { return this->_health <= this->_pendingDamage; } //@@ 006ad350 Entity::apply_second_hand_duration /* DB: returns duration*2*GetTrinketMultiplier(0x4e TRINKET_SECOND_HAND) when the EntityRef source (param_2+0x24, walked up _spawnerEntity) is a player holding Second Hand, else duration; called by every Entity::Add (AddFreeze/AddPoison/AddBurn...) prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Entity::apply_second_hand_duration(Entity *this,int duration,EntityRef *source) { EntityPtr this_00; EntityPtr EVar1; byte bVar2; int iVar3; if (((this->_type != 1) || (1 < *(int *)&g_game->_deathmatchManager)) && (this_00 = (EntityPtr)source->_entity, this_00 != (EntityPtr)0x0)) { for (EVar1 = ((Entity_Player *)this_00)->_spawnerEntity; EVar1 != (EntityPtr)0x0; EVar1 = *(EntityPtr *)((int)EVar1 + 0x3c8)) { this_00 = EVar1; } if ((*(int *)((int)this_00 + 0x28) == 1) && (bVar2 = Entity_Player::HasTrinket((Entity_Player *)this_00,0x4e,0), bVar2 != 0)) { iVar3 = Entity_Player::GetTrinketMultiplier((Entity_Player *)this_00,0x4e); return iVar3 * duration * 2; } } return duration; } //@@ 006ad3c0 Entity::AddFreeze /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddFreeze(const EntityRef& ref, int duration, bool ignoreBossStatusCooldown); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddFreeze(Entity *this,EntityRef *ref,int duration,byte ignoreBossStatusCooldown) { uint uVar1; int iVar2; EntityPtr EVar3; EntityPtr EVar4; byte bVar5; char cVar6; int iVar7; int extraout_EDX; undefined1 auStack_3c [4]; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_3c; bVar5 = IsDamageSourceFriendly(this,ref); if (bVar5 == 0) { apply_second_hand_duration(this,duration,ref); bVar5 = DoesEntityShareStatus(this); if (bVar5 != 0) { EVar4 = this->_parent; while (EVar3 = EVar4, EVar3 != (EntityPtr)0x0) { this = (Entity *)EVar3; EVar4 = *(EntityPtr *)((int)EVar3 + 0x3bc); } } if (((extraout_EDX != 0) && (uVar1 = (uint)this->_flags, (uVar1 & 1) == 0)) && ((this->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { iVar2 = this->_freezeCountdown; if (extraout_EDX < 1) { iVar7 = iVar2; if (iVar2 < -extraout_EDX) { iVar7 = -extraout_EDX; } } else { iVar7 = 0x78; if (iVar2 + extraout_EDX < 0x78) { iVar7 = iVar2 + extraout_EDX; } } this->_freezeCountdown = iVar7; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; *(uint *)&this->_flags = uVar1 | 0x20; local_38 = 0x3e6147ae; uStack_34 = 0x3e6147ae; uStack_30 = 0x3e6147ae; uStack_2c = 0x3f800000; local_18 = 0x3e20a0a1; local_14 = 0x3e20a0a1; local_10 = 0x3e20a0a1; (**(code **)(*(int *)this + 0x3c))(&local_38,iVar7,0xff,0,1); if ((ignoreBossStatusCooldown == 0) && (cVar6 = FUN_006ae7a0(), cVar6 != '\0')) { this->_bossStatusEffectCooldown = 0xf0; } CopyStatusEffects(this); } } return; } //@@ 006ad500 Entity::AddPoison /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddPoison(const EntityRef& ref, int duration, float damage, bool ignoreBossStatusCooldown); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity::AddPoison(Entity *this,EntityRef *ref,int duration,float damage, byte ignoreBossStatusCooldown) { byte bVar1; char cVar2; int newCountdown; int extraout_EDX; ColorMod poisonColor; uint flags; EntityPtr nextParent; int oldCountdown; EntityPtr parent; void *sourceRoot; void *spawner; float tickDamage; bVar1 = IsDamageSourceFriendly(this,ref); if (bVar1 != 0) { return; } if (this->_type == 1) { bVar1 = Entity_Player::HasCollectible((Entity_Player *)this,0x278,0); if (bVar1 != 0) { return; } bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&this[5]._sprite._nullLayerNames,0x278); if (bVar1 != 0) { return; } } apply_second_hand_duration(this,duration,ref); if (damage <= 0.0) { if ((this->_type != 1) && (sourceRoot = ref->_entity, sourceRoot != (void *)0x0)) { for (spawner = *(void **)((int)sourceRoot + 0x3c8); spawner != (void *)0x0; spawner = *(void **)((int)spawner + 0x3c8)) { sourceRoot = spawner; } if (*(int *)((int)sourceRoot + 0x28) == 1) { damage = *(float *)((int)sourceRoot + 0x157c); goto LAB_006ad5b4; } } damage = 2.0; } LAB_006ad5b4: bVar1 = DoesEntityShareStatus(this); if (bVar1 != 0) { nextParent = this->_parent; while (parent = nextParent, parent != (EntityPtr)0x0) { this = (Entity *)parent; nextParent = *(EntityPtr *)((int)parent + 0x3bc); } } if (((extraout_EDX != 0) && (flags = (uint)this->_flags, (flags & 1) == 0)) && ((this->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { oldCountdown = this->_poisonCountdown; if (extraout_EDX < 1) { newCountdown = oldCountdown; if (oldCountdown < -extraout_EDX) { newCountdown = -extraout_EDX; } } else { newCountdown = 0x78; if (oldCountdown + extraout_EDX < 0x78) { newCountdown = oldCountdown + extraout_EDX; } } this->_poisonCountdown = newCountdown; if ((flags & 0x40) == 0) { this->_poisonDamageTimer = 0; } tickDamage = this->_poisonTickDamage; if (tickDamage <= damage) { tickDamage = damage; } poisonColor._tint[1] = 1.0; poisonColor._tint[3] = 1.0; this->_poisonTickDamage = tickDamage; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = flags | 0x40; poisonColor._offset[0] = 0.0; poisonColor._offset[2] = 0.0; poisonColor._colorize[0] = 0.0; poisonColor._colorize[1] = 0.0; poisonColor._colorize[2] = 0.0; poisonColor._colorize[3] = 0.0; poisonColor._tint[0] = (200.0 - (float)newCountdown) / 200.0 - 0.1; if (poisonColor._tint[0] <= 0.6) { poisonColor._tint[0] = 0.6; } poisonColor._offset[1] = (float)(int)((1.0 - poisonColor._tint[0]) * 90.0) * 0.003921569; poisonColor._tint[2] = poisonColor._tint[0]; (**(code **)(*(int *)this + 0x3c))(&poisonColor,newCountdown,0xff,0,1); if ((ignoreBossStatusCooldown == 0) && (cVar2 = FUN_006ae7a0(), cVar2 != '\0')) { this->_bossStatusEffectCooldown = 0xf0; } CopyStatusEffects(this); } return; } //@@ 006ad750 Entity::AddSlowing /* ZHL [exact] __thiscall void Entity::AddSlowing(const EntityRef& ref, int duration, float amount, ColorMod color, bool ignoreBossStatusCooldown); prototype: REPENTOGON, confirmed by RET 60 */ void __thiscall Entity::AddSlowing(Entity *this,EntityRef *ref,int duration,float amount,ColorMod color, byte ignoreBossStatusCooldown) { uint uVar1; undefined4 uVar2; int iVar3; EntityPtr EVar4; EntityPtr EVar5; byte bVar6; char cVar7; int extraout_EDX; bVar6 = IsDamageSourceFriendly(this,ref); if (bVar6 == 0) { apply_second_hand_duration(this,duration,ref); bVar6 = DoesEntityShareStatus(this); if (bVar6 != 0) { EVar5 = this->_parent; while (EVar4 = EVar5, EVar4 != (EntityPtr)0x0) { this = (Entity *)EVar4; EVar5 = *(EntityPtr *)((int)EVar4 + 0x3bc); } } if (extraout_EDX < 1) { if (extraout_EDX < 0) { uVar1 = (uint)this->_flags; uVar2 = *(undefined4 *)((int)&this->_flags + 4); if ((uVar1 & 1) == 0) { this->_slowingCountdown = 2; *(uint *)&this->_flags = uVar1 | 0x80; *(undefined4 *)((int)&this->_flags + 4) = uVar2; } } } else { uVar1 = (uint)this->_flags; uVar2 = *(undefined4 *)((int)&this->_flags + 4); if (((uVar1 & 1) == 0) && ((this->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { iVar3 = *(int *)this; this->_slowingCountdown = this->_slowingCountdown + extraout_EDX; *(uint *)&this->_flags = uVar1 | 0x80; *(undefined4 *)((int)&this->_flags + 4) = uVar2; (**(code **)(iVar3 + 0x3c))(&color,extraout_EDX,0xff,0,1); if ((ignoreBossStatusCooldown == 0) && (cVar7 = FUN_006ae7a0(), cVar7 != '\0')) { this->_bossStatusEffectCooldown = 0xf0; } } } this->_slowingAmount = amount; CopyStatusEffects(this); } return; } //@@ 006ad870 Entity::AddCharmed /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddCharmed(const EntityRef& ref, int duration, bool ignoreBossStatusCooldown, bool addEnemyKillScore); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity::AddCharmed(Entity *this,EntityRef *ref,int duration,byte ignoreBossStatusCooldown, byte addEnemyKillScore) { int iVar1; byte bVar2; char cVar3; uint uVar4; Entity_NPC *npc; int unusedArg; int extraout_ECX; int extraout_EDX; undefined4 *extraout_EDX_00; undefined4 *entityIt; void *sourceEntity; int iVar5; Game *game; uint uVar6; Entity *statusOwner; float sourcePosX; float sourcePosY; float sourceVelX; float sourceVelY; undefined1 auStack_54 [7]; char isAlreadyCharmed; uint uStack_4c; int sourceSpawnerVariant; EntityRef *local_44; Entity *local_40; uint uStack_3c; undefined4 charmColor; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; undefined4 flagsHigh; EntityPtr nextParent; EntityPtr parentIt; Entity *roomEntity; int *typePtr; local_c = __security_cookie ^ (uint)auStack_54; local_44 = ref; if ((this->_flags & 0x20000000) != 0) { return; } local_40 = this; apply_second_hand_duration(this,duration,ref); bVar2 = DoesEntityShareStatus(this); statusOwner = this; if (bVar2 != 0) { nextParent = this->_parent; statusOwner = this; while (parentIt = nextParent, parentIt != (EntityPtr)0x0) { statusOwner = (Entity *)parentIt; nextParent = *(EntityPtr *)((int)parentIt + 0x3bc); } } uVar6 = (uint)statusOwner->_flags; isAlreadyCharmed = (uVar6 & 0x20000100) != 0; if (extraout_EDX < 1) { if (extraout_EDX < 0) { typePtr = &this->_type; if ((((1 < *(int *)&g_game->_deathmatchManager) && (*typePtr == 1)) || (*typePtr - 10U < 0x3de)) && ((!(bool)isAlreadyCharmed && (addEnemyKillScore != 0)))) { award_fly_kill_points(&g_game->_scoreSheet,this); } flagsHigh = *(undefined4 *)((int)&statusOwner->_flags + 4); *(uint *)&statusOwner->_flags = (uint)statusOwner->_flags | 0x20000100; *(undefined4 *)((int)&statusOwner->_flags + 4) = flagsHigh; statusOwner->_charmedCountdown = 0; cVar3 = (**(code **)(*(int *)this + 0x4c))(); if ((((cVar3 == '\0') && (bVar2 = IsActiveEnemy(this,0), bVar2 != 0)) && ((*typePtr != 0x17 || ((this->_variant != 0 || (this->_subtype != 1)))))) && (bVar2 = HasEntityFlags(this,0x1000000000000000), bVar2 == 0)) { EntityList::AddPersistentEntity((EntityList *)((int)g_game->_room + 0x1218),this); } game = g_game; if ((g_game->_seedEffects)._isCustomRun == 0) { bVar2 = Seeds::AchievementUnlocksDisallowed(&g_game->_seedEffects); if (bVar2 == 0) { bVar2 = Manager::IsGameplayInputActive(unusedArg); if ((((bVar2 == 0) && (game->_isRerun == 0)) && ((g_manager->_persistentGameData)._achievements[0x183] == 0)) && (((g_manager->_state != 2 || (game == (Game *)0x0)) || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { uStack_4c = 0; iVar5 = *(int *)((int)game->_room + 0x1264); if (iVar5 != 0) { iVar1 = *(int *)&game->_deathmatchManager; entityIt = *(undefined4 **)((int)game->_room + 0x125c); do { roomEntity = (Entity *)*entityIt; if ((((1 < iVar1) && (roomEntity->_type == 1)) || (roomEntity->_type - 10U < 0x3de)) && ((roomEntity->_flags & 0x20000000) != 0)) { bVar2 = DoesEntityShareStatus(roomEntity); entityIt = extraout_EDX_00; if ((bVar2 == 0) || (*(int *)(extraout_ECX + 0x3bc) == 0)) { uStack_4c = uStack_4c + 1; } } this = local_40; entityIt = entityIt + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); game = g_game; if (2 < uStack_4c) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x183); game = g_game; } } } } } if (((1 < *(int *)&game->_deathmatchManager) && (statusOwner->_type == 1)) || (statusOwner->_type - 10U < 0x3de)) { (**(code **)(*(int *)statusOwner + 0x60))(); } } } else if (((uVar6 & 1) == 0) && ((statusOwner->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { iVar5 = statusOwner->_charmedCountdown; local_18 = 0x3e20a0a1; if (iVar5 < extraout_EDX) { iVar5 = extraout_EDX; } local_14 = 0x3e20a0a1; statusOwner->_charmedCountdown = iVar5; *(undefined4 *)((int)&statusOwner->_flags + 4) = *(undefined4 *)((int)&statusOwner->_flags + 4); local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; *(uint *)&statusOwner->_flags = uVar6 | 0x100; charmColor = 0x3f800000; uStack_34 = 0; uStack_30 = 0x3f4ccccd; uStack_2c = 0x3f800000; local_10 = 0x3e20a0a1; (**(code **)(*(int *)statusOwner + 0x3c))(&charmColor,iVar5,0xff,0,1); if ((ignoreBossStatusCooldown == 0) && (cVar3 = FUN_006ae7a0(), cVar3 != '\0')) { statusOwner->_bossStatusEffectCooldown = 0xf0; } } sourceEntity = local_44->_entity; if (sourceEntity == (void *)0x0) { uStack_4c = 0; LAB_006adc22: local_44 = (EntityRef *)0x0; local_40 = (Entity *)0x0; sourceSpawnerVariant = 0; sourcePosX = g_vectorZero.x; sourcePosY = g_vectorZero.y; sourceVelX = g_vectorZero.x; sourceVelY = g_vectorZero.y; LAB_006adc50: uVar6 = 0; if (sourceEntity != (void *)0x0) goto LAB_006adc56; uVar6 = 0; LAB_006adc72: uStack_3c = 0; if (sourceEntity != (void *)0x0) goto LAB_006adc7e; } else { for (; *(void **)((int)sourceEntity + 0x3c8) != (void *)0x0; sourceEntity = *(void **)((int)sourceEntity + 0x3c8)) { } uStack_4c = *(int *)((int)sourceEntity + 0x28); if (sourceEntity == (void *)0x0) goto LAB_006adc22; local_44 = *(EntityRef **)((int)sourceEntity + 0x2c); sourcePosX = *(float *)((int)sourceEntity + 0x33c); sourcePosY = *(float *)((int)sourceEntity + 0x340); sourceVelX = *(float *)((int)sourceEntity + 0x360); sourceVelY = *(float *)((int)sourceEntity + 0x364); local_40 = *(Entity **)((int)sourceEntity + 0x34); sourceSpawnerVariant = *(int *)((int)sourceEntity + 0x38); if ((*(uint *)((int)sourceEntity + 0x168) & 0x100) == 0) goto LAB_006adc50; uVar6 = 1; LAB_006adc56: if ((*(uint *)((int)sourceEntity + 0x168) & 0x20000000) == 0) goto LAB_006adc72; uStack_3c = 2; LAB_006adc7e: if ((*(uint *)((int)sourceEntity + 0x16c) & 0x400000) != 0) { uVar4 = 4; goto LAB_006adc99; } } uVar4 = 0; LAB_006adc99: (this->_charmSource)._type = uStack_4c; (this->_charmSource)._variant = (int)local_44; (this->_charmSource)._spawnerType = (int)local_40; (this->_charmSource)._spawnerVariant = sourceSpawnerVariant; (this->_charmSource)._position.x = sourcePosX; (this->_charmSource)._position.y = sourcePosY; (this->_charmSource)._velocity.x = sourceVelX; (this->_charmSource)._velocity.y = sourceVelY; (this->_charmSource)._flags = uVar4 | uStack_3c | uVar6; (this->_charmSource)._entity = sourceEntity; CopyStatusEffects(statusOwner); if (((statusOwner->_charmedCountdown != 0) && (isAlreadyCharmed == '\0')) && ((((1 < *(int *)&g_game->_deathmatchManager && (statusOwner->_type == 1)) || (statusOwner->_type - 10U < 0x3de)) && (npc = (Entity_NPC *) __RTDynamicCast(statusOwner,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), npc != (Entity_NPC *)0x0)))) { Entity_NPC::ResetPathFinderTarget(npc); } return; } //@@ 006add70 Entity::AddConfusion /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddConfusion(const EntityRef& ref, int duration, bool ignoreBossStatusCooldown); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddConfusion(Entity *this,EntityRef *ref,int duration,byte ignoreBossStatusCooldown) { undefined4 uVar1; EntityPtr EVar2; EntityPtr EVar3; byte bVar4; char cVar5; int iVar6; uint uVar7; Entity_NPC *this_00; int iVar8; uint uVar9; int iVar10; undefined1 auStack_44 [12]; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_44; bVar4 = IsDamageSourceFriendly(this,ref); if ((bVar4 == 0) && ((this->_type != 1 || ((bVar4 = Entity_Player::HasCollectible((Entity_Player *)this,0x278,0), bVar4 == 0 && (bVar4 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&this[5]._sprite._nullLayerNames,0x278), bVar4 == 0)) )))) { iVar6 = apply_second_hand_duration(this,duration,ref); bVar4 = DoesEntityShareStatus(this); if (bVar4 != 0) { EVar3 = this->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } } uVar9 = (uint)this->_flags; uVar7 = uVar9 & 0x200; if (((iVar6 != 0) && ((uVar9 & 1) == 0)) && ((this->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { iVar10 = this->_confusionCountdown; if (iVar6 < 1) { if (iVar10 < -iVar6) { iVar10 = -iVar6; } } else { iVar8 = 0x78; if (iVar10 + iVar6 < 0x78) { iVar8 = iVar10 + iVar6; } if (iVar10 < iVar8) { iVar10 = iVar8; } uVar9 = (uint)this->_flags; } this->_confusionCountdown = iVar10; uVar1 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = uVar9 | 0x200; *(undefined4 *)((int)&this->_flags + 4) = uVar1; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; local_38 = 0x3f000000; uStack_34 = 0x3f000000; uStack_30 = 0x3f000000; uStack_2c = 0x3f800000; local_18 = 0x3e20a0a1; local_14 = 0x3e20a0a1; local_10 = 0x3e20a0a1; (**(code **)(*(int *)this + 0x3c))(&local_38,iVar10,0xff,0,1); if ((ignoreBossStatusCooldown == 0) && (cVar5 = FUN_006ae7a0(), cVar5 != '\0')) { this->_bossStatusEffectCooldown = 0xf0; } } CopyStatusEffects(this); if ((((0 < this->_confusionCountdown) && (uVar7 == 0)) && (bVar4 = IsEnemy(this), bVar4 != 0)) && (this_00 = (Entity_NPC *) __RTDynamicCast(this,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), this_00 != (Entity_NPC *)0x0)) { Entity_NPC::ResetPathFinderTarget(this_00); } } return; } //@@ 006adf40 Entity::AddMidasFreeze /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddMidasFreeze(const EntityRef& ref, int duration, bool ignoreBossStatusCooldown); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddMidasFreeze(Entity *this,EntityRef *ref,int duration,byte ignoreBossStatusCooldown) { undefined4 uVar1; EntityPtr EVar2; EntityPtr EVar3; byte bVar4; char cVar5; int iVar6; undefined1 auStack_3c [4]; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_3c; bVar4 = IsDamageSourceFriendly(this,ref); if (bVar4 == 0) { iVar6 = apply_second_hand_duration(this,duration,ref); bVar4 = DoesEntityShareStatus(this); if (bVar4 != 0) { EVar3 = this->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } } if (((0 < iVar6) && (this->_midasFreezeCountdown == 0)) && ((this->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { if (this->_type == 0xf5) { this->_variant = 1; return; } bVar4 = HasEntityFlags(this,1); if (bVar4 == 0) { uVar1 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x420; *(undefined4 *)((int)&this->_flags + 4) = uVar1; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; this->_midasFreezeCountdown = iVar6; this->_freezeCountdown = iVar6; local_38 = 0x3fc00000; uStack_34 = 0x3fc00000; uStack_30 = 0x3e99999a; uStack_2c = 0x3f800000; local_18 = 0x3e20a0a1; local_14 = 0x3e20a0a1; local_10 = 0x3e20a0a1; (**(code **)(*(int *)this + 0x3c))(&local_38,iVar6,0xff,0,1); if ((ignoreBossStatusCooldown == 0) && (cVar5 = FUN_006ae7a0(), cVar5 != '\0')) { this->_bossStatusEffectCooldown = 0xf0; } } } CopyStatusEffects(this); } return; } //@@ 006ae0a0 Entity::AddFear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Lua Entity:AddFear; ZHL sig said Entity_Familiar::RemoveFromPlayer prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddFear(Entity *this,EntityRef *ref,int duration,byte ignoreBossStatusCooldown) { int iVar1; EntityPtr EVar2; Game *pGVar3; EntityPtr EVar4; byte bVar5; char cVar6; int iVar7; undefined4 extraout_EAX; Entity_NPC *this_00; int iVar8; undefined1 auStack_44 [7]; byte local_3d; EntityRef *local_3c; Color local_38; uint local_c; local_c = __security_cookie ^ (uint)auStack_44; local_3c = ref; bVar5 = IsDamageSourceFriendly(this,ref); if ((bVar5 == 0) && ((this->_type != 1 || ((bVar5 = Entity_Player::HasCollectible((Entity_Player *)this,0x278,0), bVar5 == 0 && (bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&this[5]._sprite._nullLayerNames,0x278), bVar5 == 0)) )))) { iVar7 = apply_second_hand_duration(this,duration,ref); bVar5 = DoesEntityShareStatus(this); if (bVar5 != 0) { EVar4 = this->_parent; while (EVar2 = EVar4, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar4 = *(EntityPtr *)((int)EVar2 + 0x3bc); } } if (((iVar7 != 0) && ((this->_flags & 1) == 0)) && ((this->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))) { local_3d = HasEntityFlags(this,0x1000800); iVar1 = this->_fearCountdown; if (iVar7 < 1) { iVar8 = iVar1; if (iVar1 < -iVar7) { iVar8 = -iVar7; } } else { iVar8 = 0x78; if (iVar1 + iVar7 < 0x78) { iVar8 = iVar1 + iVar7; } } this->_fearCountdown = iVar8; ::Color::Color(&local_38); (**(code **)(*(int *)this + 0x3c))(extraout_EAX,iVar8,0xff,0,1); *(uint *)&this->_flags = (uint)this->_flags | 0x800; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); if ((((ignoreBossStatusCooldown == 0) && (cVar6 = FUN_006ae7a0(), pGVar3 = g_game, cVar6 != '\0')) && (this->_bossStatusEffectCooldown = 0xf0, pGVar3->_challenge == 0x1e)) && (local_3c->_type == 1)) { iVar7 = this->_bossStatusEffectCooldown; if (local_3c->_variant == 0) { iVar7 = 0x5a; } this->_bossStatusEffectCooldown = iVar7; } CopyStatusEffects(this); if (((0 < this->_fearCountdown) && (local_3d == 0)) && ((bVar5 = IsEnemy(this), bVar5 != 0 && (this_00 = (Entity_NPC *) __RTDynamicCast(this,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), this_00 != (Entity_NPC *)0x0)))) { Entity_NPC::ResetPathFinderTarget(this_00); } } } return; } //@@ 006ae280 Entity::AddBurn /* ZHL [exact] __thiscall void Entity::AddBurn(const EntityRef& ref, int duration, float damage, bool ignoreBossStatusCooldown); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity::AddBurn(Entity *this,EntityRef *ref,int duration,float damage,byte ignoreBossStatusCooldown) { void *pvVar1; uint uVar2; int iVar3; void *pvVar4; EntityPtr EVar5; EntityPtr EVar6; byte bVar7; char cVar8; int iVar9; int extraout_EDX; float fVar10; bVar7 = IsDamageSourceFriendly(this,ref); if (bVar7 != 0) { return; } if (this->_type == 1) { bVar7 = Entity_Player::HasCollectible((Entity_Player *)this,0x278,0); if (bVar7 != 0) { return; } bVar7 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&this[5]._sprite._nullLayerNames,0x278); if (bVar7 != 0) { return; } } apply_second_hand_duration(this,duration,ref); if (damage <= 0.0) { if ((this->_type != 1) && (pvVar1 = ref->_entity, pvVar1 != (void *)0x0)) { for (pvVar4 = *(void **)((int)pvVar1 + 0x3c8); pvVar4 != (void *)0x0; pvVar4 = *(void **)((int)pvVar4 + 0x3c8)) { pvVar1 = pvVar4; } if (*(int *)((int)pvVar1 + 0x28) == 1) { damage = *(float *)((int)pvVar1 + 0x157c); goto LAB_006ae326; } } damage = 2.0; } LAB_006ae326: bVar7 = DoesEntityShareStatus(this); if (bVar7 != 0) { EVar6 = this->_parent; while (EVar5 = EVar6, EVar5 != (EntityPtr)0x0) { this = (Entity *)EVar5; EVar6 = *(EntityPtr *)((int)EVar5 + 0x3bc); } } if (((extraout_EDX != 0) && (uVar2 = *(uint *)((int)this + 0x168), (uVar2 & 1) == 0)) && ((*(int *)((int)this + 0x238) < 1 || (ignoreBossStatusCooldown != 0)))) { iVar3 = *(int *)((int)this + 0x234); if (extraout_EDX < 1) { iVar9 = iVar3; if (iVar3 < -extraout_EDX) { iVar9 = -extraout_EDX; } } else { iVar9 = 0xa0; if (iVar3 + extraout_EDX < 0xa0) { iVar9 = iVar3 + extraout_EDX; } } *(int *)((int)this + 0x234) = iVar9; if ((uVar2 & 0x1000) == 0) { *(undefined4 *)((int)this + 0x2e4) = 0; } fVar10 = *(float *)((int)this + 0x324); if (fVar10 <= damage) { fVar10 = damage; } *(float *)((int)this + 0x324) = fVar10; *(uint *)((int)this + 0x168) = uVar2 | 0x1000; *(undefined4 *)((int)this + 0x16c) = *(undefined4 *)((int)this + 0x16c); if ((ignoreBossStatusCooldown == 0) && (cVar8 = FUN_006ae7a0(), cVar8 != '\0')) { *(undefined4 *)((int)this + 0x238) = 0xf0; } CopyStatusEffects(this); } return; } //@@ 006ae420 Entity::AddBleeding /* ZHL [exact] __thiscall void Entity::AddBleeding(const EntityRef& ref, int duration, bool unused); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddBleeding(Entity *this,EntityRef *ref,int duration,byte unused) { uint *puVar1; int iVar2; EntityPtr EVar3; EntityPtr EVar4; byte bVar5; char cVar6; uint uVar7; int iVar8; int extraout_EDX; EntityPtr this_00; uint local_38; EntityRef local_30; bVar5 = IsDamageSourceFriendly(this,ref); if (bVar5 != 0) { return; } apply_second_hand_duration(this,duration,ref); bVar5 = DoesEntityShareStatus(this); this_00 = (EntityPtr)this; if (bVar5 != 0) { EVar4 = this->_parent; while (EVar3 = EVar4, EVar3 != (EntityPtr)0x0) { this_00 = EVar3; EVar4 = *(EntityPtr *)((int)EVar3 + 0x3bc); } } if (extraout_EDX == 0) { return; } if ((((Entity *)this_00)->_flags & 1) != 0) { return; } if (0 < ((Entity *)this_00)->_bossStatusEffectCooldown) { return; } iVar2 = ((Entity *)this_00)->_bleedingCountdown; if (extraout_EDX < 1) { iVar8 = iVar2; if (iVar2 < -extraout_EDX) { iVar8 = -extraout_EDX; } } else { iVar8 = 0x78; if (iVar2 + extraout_EDX < 0x78) { iVar8 = iVar2 + extraout_EDX; } } ((Entity *)this_00)->_bleedingCountdown = iVar8; puVar1 = (uint *)((int)&((Entity *)this_00)->_flags + 4); *puVar1 = *puVar1 | 4; *(int *)&((Entity *)this_00)->_flags = (int)((Entity *)this_00)->_flags; local_30._entity = ref->_entity; if (local_30._entity == (void *)0x0) { local_30._type = 0; LAB_006ae55a: local_30._variant = 0; local_30._spawnerType = 0; local_30._spawnerVariant = 0; local_30._position.x = g_vectorZero.x; local_30._position.y = g_vectorZero.y; local_30._velocity.x = g_vectorZero.x; local_30._velocity.y = g_vectorZero.y; LAB_006ae59a: local_30._flags = 0; if (local_30._entity != (void *)0x0) goto LAB_006ae5a0; local_30._flags = 0; LAB_006ae5bc: local_38 = 0; if (local_30._entity != (void *)0x0) goto LAB_006ae5c8; } else { while (*(void **)((int)local_30._entity + 0x3c8) != (void *)0x0) { local_30._entity = *(void **)((int)local_30._entity + 0x3c8); } local_30._type = *(int *)((int)local_30._entity + 0x28); if (local_30._entity == (void *)0x0) goto LAB_006ae55a; local_30._variant = *(int *)((int)local_30._entity + 0x2c); local_30._position.x = *(float *)((int)local_30._entity + 0x33c); local_30._position.y = *(float *)((int)local_30._entity + 0x340); local_30._spawnerType = *(int *)((int)local_30._entity + 0x34); local_30._spawnerVariant = *(int *)((int)local_30._entity + 0x38); local_30._velocity.x = *(float *)((int)local_30._entity + 0x360); local_30._velocity.y = *(float *)((int)local_30._entity + 0x364); if ((*(uint *)((int)local_30._entity + 0x168) & 0x100) == 0) goto LAB_006ae59a; local_30._flags = 1; LAB_006ae5a0: if ((*(uint *)((int)local_30._entity + 0x168) & 0x20000000) == 0) goto LAB_006ae5bc; local_38 = 2; LAB_006ae5c8: if ((*(uint *)((int)local_30._entity + 0x16c) & 0x400000) != 0) { uVar7 = 4; goto LAB_006ae5e3; } } uVar7 = 0; LAB_006ae5e3: local_30._flags = uVar7 | local_38 | local_30._flags; EntityRef::operator_(&this->_entityRef2,&local_30); cVar6 = FUN_006ae7a0(); if (cVar6 != '\0') { ((Entity *)this_00)->_bossStatusEffectCooldown = 0xf0; } CopyStatusEffects((Entity *)this_00); return; } //@@ 006ae630 Entity::RemoveStatusEffects /* ZHL [lua] Lua binding Entity:RemoveStatusEffects prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity::RemoveStatusEffects(Entity *this) { uint *puVar1; qword qVar2; (this->_colorParams)._end = (this->_colorParams)._begin; *(uint *)&this->_flags = (uint)this->_flags & 0xdeffe01f; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); this->_freezeCountdown = 0; this->_poisonCountdown = 0; this->_slowingCountdown = 0; this->_charmedCountdown = 0; this->_confusionCountdown = 0; this->_midasFreezeCountdown = 0; this->_fearCountdown = 0; this->_burnCountdown = 0; this->_shrinkCountdown = 0; SetSize(this,*(float *)((int)this->_config + 0x38), (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); qVar2 = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & 0xfea27ffb; *(int *)&this->_flags = (int)qVar2; this->_shrinkStatus2 = 1.0; this->_bleedingCountdown = 0; this->_bleedDamageAccumulator = 0.0; this->_magnetizedCountdown = 0; this->_baitedCountdown = 0; this->_knockbackCountdown = 0; this->_iceCountdown = 0; this->_weaknessCountdown = 0; this->_brimstoneMarkCountdown = 0; this->_poisonTickDamage = 2.0; this->_burnTickDamage = 2.0; (**(code **)(*(int *)this + 0x60))(); CopyStatusEffects(this); return; } //@@ 006ae7a0 FUN_006ae7a0 undefined4 FUN_006ae7a0(void) { char cVar1; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0x4c))(); if ((cVar1 == '\0') && ((*(int *)&g_game->_deathmatchManager < 2 || (in_ECX[10] != 1)))) { return 0; } return 1; } //@@ 006ae7d0 Entity::PreUpdate /* ZHL [vtable slot 2] */ void __thiscall Entity::PreUpdate(Entity *this) { (this->_prevPosition).x = (this->_pos).x; (this->_prevPosition).y = (this->_pos).y; (this->_prevVelocity).x = (this->_velocity).x; (this->_prevVelocity).y = (this->_velocity).y; return; } //@@ 006ae820 Entity::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [vtable slot 3] */ void __thiscall Entity::Update(Entity *this) { uint *puVar1; void **ppvVar2; std_set *psVar3; EntityPtr *pEVar4; void *pvVar5; code *pcVar6; longlong lVar7; longlong lVar8; BitSet128 flags; qword qVar9; byte bVar10; char cVar11; Vector *pVVar12; int iVar13; ColorMod *color; ColorMod *from; EntityRef *sourceRef; EntityPtr EVar14; int *piVar15; Entity *pEVar16; uint uVar17; uint uVar18; EntityPtr **ppEVar19; uint uVar20; int iVar21; undefined4 *puVar22; int unusedArg; void *pvVar23; code *extraout_EDX; float *pfVar24; void *pvVar25; float *pfVar26; PlayerManager *playerManager; bool bVar27; float fVar28; float fVar29; EntityPtr EVar30; float fVar31; undefined1 *puVar32; float fVar33; ulonglong uVar34; double dVar35; undefined1 auStack_328 [8]; ItemPool *local_320; byte local_319; float *local_318; float *local_314; float *local_310; float *pfStack_30c; EntityPtr local_308; float *local_304; uint uStack_300; Entity *pEStack_2fc; Game *pGStack_2f8; float *pfStack_2f4; EntityPtr *apEStack_2f0 [2]; Entity *self; Vector *local_2e4; EntityPtr *apEStack_2e0 [2]; Vector VStack_2d8; uint uStack_2d0; Vector local_2c8; uint uStack_2c0; void *pvStack_2bc; float *pfStack_2b8; int iStack_2b4; uint uStack_2b0; undefined8 uStack_2ac; uint uStack_2a4; float local_294; float local_290; float local_28c; float local_288; float local_284; float local_280; float local_27c; float fStack_278; float fStack_274; float fStack_270; EntityPtr *local_26c; int iStack_268; int iStack_264; int aiStack_260 [2]; Vector particleVelocity; undefined1 auStack_250 [4]; undefined1 auStack_24c [8]; float fStack_244; Color blendedColor; Vector local_214; KColor KStack_20c; undefined1 local_1f8 [60]; EntityRef EStack_1bc; EntityRef EStack_180; ColorMod local_158; Color CStack_12c; RNG cardRng; undefined4 uStack_f0; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 uStack_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; ColorMod CStack_40; uint local_14; Game *game; Manager *manager; local_14 = __security_cookie ^ (uint)auStack_328; local_320 = *(ItemPool **)&this->_flags; uVar20 = *(uint *)((int)&this->_flags + 4); self = this; if (((uint)local_320 & 0x4000) == 0) { this->_prevUpdateTime = this->_updateTime; this->_updateTime = this->_speedMultiplier + this->_updateTime; if ((((((uint)local_320 & 0x20) == 0) && (this->_holdCountdown < 1)) || (this->_dead != 0)) && ((uVar20 & 1) == 0)) { local_310 = (float *)(this->_sprite)._playbackSpeed; (this->_sprite)._playbackSpeed = (float)local_310 * this->_speedMultiplier; if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); local_320 = *(ItemPool **)&this->_flags; uVar20 = *(uint *)((int)&this->_flags + 4); } (this->_sprite)._playbackSpeed = (float)local_310; } } if ((uVar20 & 0x8000) != 0) { local_319 = this->_collidesWithGrid; if (local_319 == 0) { local_2e4 = (Vector *)(this->_velocity).x; local_304 = (float *)(this->_velocity).y; local_310 = (float *)sqrtf((float)local_2e4 * (float)local_2e4 + (float)local_304 * (float)local_304); fVar28 = (this->_knockbackDirection).x; fVar31 = (this->_knockbackDirection).y; fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); if (((float)local_310 < fVar28) || (0.0 <= (this->_knockbackDirection).x * (float)local_2e4 + (this->_knockbackDirection).y * (float)local_304)) goto LAB_006ae9c3; } else { LAB_006ae9c3: local_310 = (float *)(this->_knockbackDirection).x; fVar28 = (this->_knockbackDirection).y; fVar28 = sqrtf((float)local_310 * (float)local_310 + fVar28 * fVar28); if (2.0 <= fVar28) { this->_friction = this->_baseFriction * 0.95; if ((uVar20 & 0x20000) == 0) { (this->_knockbackDirection).x = (float)local_310 * 0.95; local_308 = (EntityPtr)((this->_knockbackDirection).y * 0.95); (this->_knockbackDirection).y = (float)local_308; bVar10 = this->_collidesWithGrid; local_2c8.x = *(float *)&this->_flags; uVar20 = *(uint *)((int)&this->_flags + 4); } else { local_308 = (EntityPtr)(this->_knockbackDirection).y; local_2c8.x = (float)local_320; bVar10 = local_319; } if (bVar10 != 0) { if ((uVar20 & 0x10000) != 0) { pVVar12 = Vector::Normalized(&this->_velocity,&local_214); fVar28 = (this->_knockbackDirection).x; fVar31 = sqrtf((float)local_308 * (float)local_308 + fVar28 * fVar28); fVar28 = pVVar12->y; (this->_knockbackDirection).x = fVar31 * pVVar12->x * 0.8; (this->_knockbackDirection).y = fVar31 * fVar28 * 0.8; iVar13 = _get_index_plus_one_if_kind_4_5(); fVar28 = (float)(iVar13 + -1) + (float)(iVar13 + -1) + 10.0; sourceRef = EntityRef::EntityRef((EntityRef *)local_1f8); (*extraout_EDX)(fVar28,0,0,sourceRef,0x1e); qVar9 = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & 0xfffeffff; *(int *)&this->_flags = (int)qVar9; } this->_knockbackCountdown = this->_knockbackCountdown / 2; } (this->_velocity).x = (this->_knockbackDirection).x; (this->_velocity).y = (this->_knockbackDirection).y; goto LAB_006aeb95; } } *(ItemPool **)&this->_flags = local_320; *(uint *)((int)&this->_flags + 4) = uVar20 & 0xfffe7fff; this->_knockbackCountdown = 0; } LAB_006aeb95: fVar28 = this->_speedMultiplier; fVar33 = 1.0; fVar31 = this->_friction; if (fVar28 != 1.0) { fVar31 = fVar31 / ((fVar31 + fVar28) - fVar31 * fVar28); } local_2e4 = &this->_pos; fVar29 = fVar31 * (this->_velocity).x; fVar31 = fVar31 * (this->_velocity).y; (this->_velocity).x = fVar29; (this->_velocity).y = fVar31; fVar28 = this->_speedMultiplier; (this->_pos).y = fVar28 * fVar31 + (this->_pos).y; local_2e4->x = fVar28 * fVar29 + local_2e4->x; local_318 = *(float **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); this->_friction = this->_baseFriction; if (((uint)local_318 & 0x4000) == 0) { pvVar23 = (this->_colorParams)._begin; bVar27 = false; if (pvVar23 != (this->_colorParams)._end) { do { iVar13 = *(int *)((int)pvVar23 + 0x34) + -1; *(int *)((int)pvVar23 + 0x34) = iVar13; if (*(char *)((int)pvVar23 + 0x38) != '\0') { bVar27 = true; } pvVar25 = (void *)((int)pvVar23 + 0x3c); if (iVar13 == 0) { FUN_004b6ec0(pvVar23); bVar27 = true; ppvVar2 = &(this->_colorParams)._end; *ppvVar2 = (void *)((int)*ppvVar2 + -0x3c); pvVar25 = pvVar23; } pvVar5 = (this->_colorParams)._end; pvVar23 = pvVar25; } while (pvVar25 != pvVar5); if (bVar27) { pvVar23 = (this->_colorParams)._begin; iVar21 = (int)pvVar5 - (int)pvVar23; iVar13 = iVar21 >> 0x1f; iVar21 = iVar21 / 0x3c + iVar13; if (iVar21 == iVar13) { (**(code **)(*(int *)this + 0x60))(); } else { color = (ColorMod *)((int)pvVar23 + 0x40); if ((uint)(iVar21 - iVar13) < 2) { color = &this->_color; } blendedColor._tint[0] = ((ColorMod *)((int)pvVar23 + 4))->_tint[0]; blendedColor._tint[1] = *(float *)((int)pvVar23 + 8); blendedColor._tint[2] = *(float *)((int)pvVar23 + 0xc); blendedColor._tint[3] = *(float *)((int)pvVar23 + 0x10); blendedColor._offset[2] = *(float *)((int)pvVar23 + 0x2c); blendedColor._colorize[0] = *(float *)((int)pvVar23 + 0x14); blendedColor._colorize[1] = *(float *)((int)pvVar23 + 0x18); blendedColor._colorize[2] = *(float *)((int)pvVar23 + 0x1c); blendedColor._colorize[3] = *(float *)((int)pvVar23 + 0x20); blendedColor._offset._0_8_ = *(undefined8 *)((int)pvVar23 + 0x24); if (*(char *)((int)pvVar23 + 0x38) != '\0') { color = ::Color::Lerp(&local_158,(ColorMod *)((int)pvVar23 + 4),color, fVar33 - (float)*(int *)((int)pvVar23 + 0x34) / (float)*(int *)((int)pvVar23 + 0x30)); ::Color::operator_assign(&blendedColor,color); } Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&blendedColor); } } } pfVar26 = *(float **)&this->_flags; local_318 = *(float **)((int)&this->_flags + 4); pfVar24 = local_318; if ((((uint)pfVar26 & 1) == 0) && (((1 < *(int *)&g_game->_deathmatchManager && (this->_type == 1)) || (this->_type - 10U < 0x3de)))) { bVar10 = Game::IsInTimedSet(g_game,0x11); if ((bVar10 != 0) || (bVar10 = Game::IsInTimedSet(g_game,0x15), bVar10 != 0)) { pfVar26 = (float *)((uint)pfVar26 | 0x100); this->_charmedCountdown = 2; *(float **)&this->_flags = pfVar26; *(float **)((int)&this->_flags + 4) = local_318; } local_310 = pfVar26; local_304 = local_318; bVar10 = Game::IsInTimedSet(g_game,0x12); if (bVar10 != 0) { pfVar26 = (float *)((uint)pfVar26 | 0x200); this->_confusionCountdown = 2; local_318 = local_304; *(float **)&this->_flags = pfVar26; *(float **)((int)&this->_flags + 4) = local_304; } local_310 = pfVar26; local_304 = local_318; bVar10 = Game::IsInTimedSet(g_game,0x13); if ((bVar10 == 0) && (bVar10 = Game::IsInTimedSet(g_game,0x15), bVar10 == 0)) { bVar10 = Game::IsInTimedSet(g_game,0x14); pfVar24 = local_318; if ((bVar10 == 0) || (((g_game->_frameCount - this->_spawnFrame) / 0x3c & 1U) != 0)) goto LAB_006aeed2; } pfVar26 = (float *)((uint)local_310 | 0x800); this->_fearCountdown = 2; *(float **)&this->_flags = pfVar26; *(float **)((int)&this->_flags + 4) = local_304; pfVar24 = local_304; } LAB_006aeed2: if (0 < this->_fireDamageCountdown) { this->_fireDamageCountdown = this->_fireDamageCountdown + -1; } if (0 < this->_damageCountdown) { this->_damageCountdown = this->_damageCountdown + -1; } if ((0 < this->_freezeCountdown) && (iVar13 = this->_freezeCountdown + -1, this->_freezeCountdown = iVar13, iVar13 < 1)) { pfVar26 = (float *)((uint)pfVar26 & 0xffffffdf); *(float **)&this->_flags = pfVar26; *(float **)((int)&this->_flags + 4) = pfVar24; } if ((0 < this->_poisonCountdown) && (iVar13 = this->_poisonCountdown + -1, this->_poisonCountdown = iVar13, iVar13 < 1)) { pfVar26 = (float *)((uint)pfVar26 & 0xffffffbf); *(float **)((int)&this->_flags + 4) = pfVar24; *(float **)&this->_flags = pfVar26; this->_poisonTickDamage = 2.0; } if ((0 < this->_slowingCountdown) && (iVar13 = this->_slowingCountdown + -1, this->_slowingCountdown = iVar13, iVar13 < 1)) { pfVar26 = (float *)((uint)pfVar26 & 0xffffff7f); *(float **)&this->_flags = pfVar26; *(float **)((int)&this->_flags + 4) = pfVar24; } local_314 = pfVar24; if ((0 < this->_charmedCountdown) && (iVar13 = this->_charmedCountdown + -1, this->_charmedCountdown = iVar13, iVar13 < 1)) { EVar30 = this->_target; *(float **)((int)&this->_flags + 4) = pfVar24; pfVar26 = (float *)((uint)pfVar26 & 0xfffffeff); *(float **)&this->_flags = pfVar26; if (EVar30 != (EntityPtr)0x0) { local_320 = (ItemPool *)pfVar24; local_26c = &this->_target; std::multiset::erase(&local_26c); pfVar26 = *(float **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); this->_target = (EntityPtr)0x0; } } if ((0 < this->_confusionCountdown) && (iVar13 = this->_confusionCountdown + -1, this->_confusionCountdown = iVar13, iVar13 < 1)) { pfVar26 = (float *)((uint)pfVar26 & 0xfffffdff); *(float **)&this->_flags = pfVar26; *(float **)((int)&this->_flags + 4) = pfVar24; } if ((0 < this->_fearCountdown) && (iVar13 = this->_fearCountdown + -1, this->_fearCountdown = iVar13, iVar13 < 1)) { pfVar26 = (float *)((uint)pfVar26 & 0xfffff7ff); *(float **)((int)&this->_flags + 4) = pfVar24; *(float **)&this->_flags = pfVar26; } fVar28 = this->_shrinkStatus1; if (this->_shrinkStatus2 != fVar28) { this->_shrinkStatus1 = (this->_shrinkStatus2 - fVar28) * 5.0 * 0.033333335 + fVar28; } local_320 = (ItemPool *)pfVar24; if ((0 < this->_shrinkCountdown) && (iVar13 = this->_shrinkCountdown + -1, this->_shrinkCountdown = iVar13, iVar13 < 1)) { FUN_006b5f40(); pfVar26 = *(float **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); } if (0 < this->_burnCountdown) { iVar13 = this->_burnCountdown + -1; this->_burnCountdown = iVar13; if (iVar13 < 1) { *(float **)((int)&this->_flags + 4) = pfVar24; *(uint *)&this->_flags = (uint)pfVar26 & 0xffffefff; this->_burnTickDamage = 2.0; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80a98) && (_Init_thread_header(&DAT_00c80a98), DAT_00c80a98 == -1)) { _DAT_00c80ac0 = 0; _DAT_00c80ab0 = 0; uRam00c80ab4 = 0; uRam00c80ab8 = 0; uRam00c80abc = 0; _DAT_00c80aa0 = 0x3f800000; uRam00c80aa4 = 0x3f800000; uRam00c80aa8 = 0x3f800000; uRam00c80aac = 0x3f800000; _DAT_00c80ac4 = 0; _DAT_00c80ac8 = 0; _DAT_00c80adc = 0; uRam00c80ae0 = 0; uRam00c80ae4 = 0; uRam00c80ae8 = 0; _DAT_00c80aec = 0x3e34b4b5; _DAT_00c80acc = 0x3f800000; uRam00c80ad0 = 0x3f800000; uRam00c80ad4 = 0x3f4dcdcf; uRam00c80ad8 = 0x3f800000; _DAT_00c80af0 = 0; _DAT_00c80af4 = 0; _DAT_00c80b08 = 0; uRam00c80b0c = 0; uRam00c80b10 = 0; uRam00c80b14 = 0; _DAT_00c80b18 = 0x3eb4b4b5; _DAT_00c80af8 = 0x3f800000; uRam00c80afc = 0x3f800000; uRam00c80b00 = 0x3f1b9b9c; uRam00c80b04 = 0x3f800000; _DAT_00c80b1c = 0; _DAT_00c80b20 = 0; _DAT_00c80b34 = 0; uRam00c80b38 = 0; uRam00c80b3c = 0; uRam00c80b40 = 0; _DAT_00c80b44 = 0x3e8c8c8d; _DAT_00c80b24 = 0x3f800000; uRam00c80b28 = 0x3f800000; uRam00c80b2c = 0x3f4dcdcf; uRam00c80b30 = 0x3f800000; _DAT_00c80b48 = 0x3dc8c8ca; _DAT_00c80b4c = 0; _DAT_00c80b60 = 0; uRam00c80b64 = 0; uRam00c80b68 = 0; uRam00c80b6c = 0; _DAT_00c80b70 = 0x3e48c8ca; _DAT_00c80b50 = 0x3f800000; uRam00c80b54 = 0x3f800000; uRam00c80b58 = 0x3f800000; uRam00c80b5c = 0x3f800000; _DAT_00c80b74 = 0x3e48c8ca; _DAT_00c80b78 = 0; _DAT_00c80b8c = 0; uRam00c80b90 = 0; uRam00c80b94 = 0; uRam00c80b98 = 0; _DAT_00c80b9c = 0x3dc8c8ca; _DAT_00c80b7c = 0x3f800000; uRam00c80b80 = 0x3f800000; uRam00c80b84 = 0x3f800000; uRam00c80b88 = 0x3f800000; _DAT_00c80ba0 = 0x3dc8c8ca; _DAT_00c80ba4 = 0; _Init_thread_footer(&DAT_00c80a98); } (**(code **)(*(int *)this + 0x3c)) (&DAT_00c80aa0 + ((g_game->_frameCount - this->_spawnFrame) % 6) * 0x2c,1,0xff,0,1); pfVar26 = *(float **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); } if ((this->_midasFreezeCountdown < 1) || (iVar13 = this->_midasFreezeCountdown + -1, this->_midasFreezeCountdown = iVar13, 0 < iVar13) ) { pfStack_30c = pfVar26; } else { *(float **)((int)&this->_flags + 4) = pfVar24; *(float **)&this->_flags = (float *)((uint)pfVar26 & 0xfffffbff); pfStack_30c = (float *)((uint)pfVar26 & 0xfffffbff); } local_314 = pfVar26; if (0 < this->_bleedingCountdown) { iVar13 = this->_bleedingCountdown + -1; this->_bleedingCountdown = iVar13; if (iVar13 < 1) { *(float **)&this->_flags = pfStack_30c; *(uint *)((int)&this->_flags + 4) = (uint)pfVar24 & 0xfffffffb; this->_bleedDamageAccumulator = 0.0; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80ba8) && (_Init_thread_header(&DAT_00c80ba8), DAT_00c80ba8 == -1)) { _DAT_00c80bd0 = 0; _DAT_00c80bc0 = 0; uRam00c80bc4 = 0; uRam00c80bc8 = 0; uRam00c80bcc = 0; _DAT_00c80bb0 = 0x3f800000; uRam00c80bb4 = 0x3f800000; uRam00c80bb8 = 0x3f800000; uRam00c80bbc = 0x3f800000; _DAT_00c80bd4 = 0; _DAT_00c80bd8 = 0; _DAT_00c80bec = 0; uRam00c80bf0 = 0; uRam00c80bf4 = 0; uRam00c80bf8 = 0; _DAT_00c80bfc = 0x3e34b4b5; _DAT_00c80bdc = 0x3f800000; uRam00c80be0 = 0x3f3ebebf; uRam00c80be4 = 0x3f3ebebf; uRam00c80be8 = 0x3f800000; _DAT_00c80c00 = 0; _DAT_00c80c04 = 0; _DAT_00c80c18 = 0; uRam00c80c1c = 0; uRam00c80c20 = 0; uRam00c80c24 = 0; _DAT_00c80c28 = 0x3eb4b4b5; _DAT_00c80c08 = 0x3f800000; uRam00c80c0c = 0x3ef0f0f2; uRam00c80c10 = 0x3ef0f0f2; uRam00c80c14 = 0x3f800000; _DAT_00c80c2c = 0; _DAT_00c80c30 = 0; _DAT_00c80c44 = 0; uRam00c80c48 = 0; uRam00c80c4c = 0; uRam00c80c50 = 0; _DAT_00c80c54 = 0x3e20a0a1; _DAT_00c80c34 = 0x3f5cdcde; uRam00c80c38 = 0x3e70f0f2; uRam00c80c3c = 0x3e70f0f2; uRam00c80c40 = 0x3f800000; _DAT_00c80c58 = 0; _DAT_00c80c5c = 0; _DAT_00c80c70 = 0; uRam00c80c74 = 0; uRam00c80c78 = 0; uRam00c80c7c = 0; _DAT_00c80c80 = 0; _DAT_00c80c60 = 0x3f70f0f2; uRam00c80c64 = 0x3f48c8ca; uRam00c80c68 = 0x3f48c8ca; uRam00c80c6c = 0x3f800000; _DAT_00c80c84 = 0; _DAT_00c80c88 = 0; _DAT_00c80c9c = 0; uRam00c80ca0 = 0; uRam00c80ca4 = 0; uRam00c80ca8 = 0; _DAT_00c80cac = 0x3e8c8c8d; _DAT_00c80c8c = 0x3f800000; uRam00c80c90 = 0x3f4dcdcf; uRam00c80c94 = 0x3f4dcdcf; uRam00c80c98 = 0x3f800000; _DAT_00c80cb0 = 0; _DAT_00c80cb4 = 0; _Init_thread_footer(&DAT_00c80ba8); } fVar28 = (this->_pos).y - (this->_prevPosition).y; fVar31 = (this->_pos).x - (this->_prevPosition).x; fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); fVar28 = (fVar28 * 0.02) / this->_speedMultiplier; if (fVar28 <= 0.0) { fVar28 = 0.0; } if (1.0 <= fVar28) { fVar28 = 1.0; } color = (ColorMod *) (&DAT_00c80bb0 + ((uint)(g_game->_frameCount - this->_spawnFrame) % 6) * 0x2c); ::Color::Color(&CStack_12c); color = ::Color::Lerp(&CStack_40,from,color,fVar28); (**(code **)(*(int *)this + 0x3c))(color,1,0xff,0,1); pfStack_30c = *(float **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); } if ((0 < this->_magnetizedCountdown) && (iVar13 = this->_magnetizedCountdown + -1, this->_magnetizedCountdown = iVar13, iVar13 < 1)) { pfVar24 = (float *)((uint)pfVar24 & 0xfff7ffff); *(float **)&this->_flags = pfStack_30c; *(float **)((int)&this->_flags + 4) = pfVar24; } local_320 = (ItemPool *)pfStack_30c; if ((0 < this->_baitedCountdown) && (iVar13 = this->_baitedCountdown + -1, this->_baitedCountdown = iVar13, iVar13 < 1)) { pfVar24 = (float *)((uint)pfVar24 & 0xffefffff); *(float **)&this->_flags = pfStack_30c; game = g_game; fVar28 = 0.0; *(float **)((int)&this->_flags + 4) = pfVar24; local_304 = game->_room; if (local_304[0x499] != 0.0) { do { iVar13 = *(int *)((int)local_304[0x497] + (int)fVar28 * 4); if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar13 + 0x28) == 1)) || (*(int *)(iVar13 + 0x28) - 10U < 0x3de)) { local_310 = (float *)(iVar13 + 0x3c4); if ((*(Entity **)(iVar13 + 0x3c4) == this) && ((*(uint *)(iVar13 + 0x168) & 0x20000100) == 0)) { if (*(Entity **)(iVar13 + 0x3c4) != (Entity *)0x0) { pvStack_2bc = (void *)(iVar13 + 0x3c4); std::multiset::erase(&pvStack_2bc); } *local_310 = 0.0; } } fVar28 = (float)((int)fVar28 + 1); } while ((uint)fVar28 < (uint)local_304[0x499]); local_320 = *(ItemPool **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); } } if ((0 < this->_weaknessCountdown) && (iVar13 = this->_weaknessCountdown + -1, this->_weaknessCountdown = iVar13, iVar13 < 1)) { pfVar24 = (float *)((uint)pfVar24 & 0xffbfffff); *(ItemPool **)&this->_flags = local_320; *(float **)((int)&this->_flags + 4) = pfVar24; } local_2c8.x = (float)local_320; if ((this->_iceFrozenEffect != (EntityPtr)0x0) && (((uint)pfVar24 & 0x80000) == 0)) { (**(code **)(*(int *)this->_iceFrozenEffect + 0x28))(); local_320 = *(ItemPool **)&this->_flags; pfVar24 = *(float **)((int)&this->_flags + 4); } if ((0 < this->_knockbackCountdown) && (iVar13 = this->_knockbackCountdown + -1, this->_knockbackCountdown = iVar13, iVar13 < 1)) { pfVar24 = (float *)((uint)pfVar24 & 0xfffe7fff); *(ItemPool **)&this->_flags = local_320; *(float **)((int)&this->_flags + 4) = pfVar24; } if ((0 < this->_iceCountdown) && (iVar13 = this->_iceCountdown + -1, this->_iceCountdown = iVar13, iVar13 < 1)) { pfVar24 = (float *)((uint)pfVar24 & 0xfffbffff); *(ItemPool **)&this->_flags = local_320; *(float **)((int)&this->_flags + 4) = pfVar24; } if ((0 < this->_brimstoneMarkCountdown) && (iVar13 = this->_brimstoneMarkCountdown + -1, this->_brimstoneMarkCountdown = iVar13, iVar13 < 1)) { pfVar24 = (float *)((uint)pfVar24 & 0xfeffffff); *(ItemPool **)&this->_flags = local_320; *(float **)((int)&this->_flags + 4) = pfVar24; } if (0 < this->_bossStatusEffectCooldown) { this->_bossStatusEffectCooldown = this->_bossStatusEffectCooldown + -1; } local_318 = (float *)local_320; local_314 = (float *)local_320; if (0 < this->_holdCountdown) { this->_holdCountdown = this->_holdCountdown + -1; } } if (((uint)local_318 & 0x4000) == 0) { if (this->_isInvicible == 0) { pfVar24 = (this->_damageEvents)._begin; local_319 = 0; local_284 = g_vectorZero.x; local_280 = g_vectorZero.y; local_27c = g_vectorZero.x; fStack_278 = g_vectorZero.y; local_294 = 0.0; local_290 = local_294; local_28c = local_294; local_288 = local_294; fStack_274 = local_294; fStack_270 = local_294; if (pfVar24 != (this->_damageEvents)._end) { local_320 = (ItemPool *)(pfVar24 + 0xb); do { if (0.0 < *pfVar24) { if (((uint)g_game->_debugFlags >> 6 & 1) != 0) { KColor::SetFromARGB(&KStack_20c,0xff90ee90); spawn_debug_damage_text(); } manager = g_manager; local_2c8.y = *(float *)((int)local_320 + -0x20); if ((((uint)*(float *)((int)local_320 + -0x24) & 0x202) != 0) && (((uint)*(float *)((int)local_320 + -0x24) & 4) == 0)) { iStack_2b4 = 0x2b; seed_fart_sound_override(&iStack_2b4); SoundEffects::Play(&manager->_sfxManager,iStack_2b4,1.0,2,0,1.0,0.0); this = self; } fVar28 = *(float *)((int)this + 0x380) - *pfVar24; *(float *)((int)this + 0x380) = fVar28; if ((0.0 < fVar28) || (((uint)*(float *)((int)local_320 + -0x24) & 1) != 0)) { if ((*(uint *)((int)this + 0x168) & 0x2000000) == 0) { if (fVar28 < 0.0) { *(int *)((int)this + 0x380) = 0; } if ((*(int *)((int)this + 0x28) == 0x197) || (*(int *)((int)this + 0x28) == 0x3b7)) { uStack_a4 = 0x3ec8c8ca; uStack_b4 = 0; uStack_b0 = 0; uStack_ac = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_c4 = 0x3f000000; uStack_c0 = 0x3f000000; uStack_bc = 0x3ea8f5c3; uStack_b8 = 0x3f800000; uStack_9c = 0; iVar13 = ((int)(*pfVar24 + 0.5) + 2) / 3; iVar21 = 6; if (iVar13 < 6) { iVar21 = iVar13; } if (iVar21 < 1) { iVar21 = 1; } puVar22 = &uStack_c4; } else { uStack_d0 = 0x3f48c8ca; uStack_e0 = 0; uStack_dc = 0; uStack_d8 = 0; uStack_d4 = 0; uStack_cc = 0; uStack_f0 = 0x3f000000; uStack_ec = 0x3f000000; uStack_e8 = 0x3f000000; uStack_e4 = 0x3f800000; uStack_c8 = 0; iVar13 = ((int)(*pfVar24 + 0.5) + 2) / 3; iVar21 = 6; if (iVar13 < 6) { iVar21 = iVar13; } if (iVar21 < 1) { iVar21 = 1; } puVar22 = &uStack_f0; } (**(code **)(*(int *)this + 0x3c))(puVar22,iVar21,0,0,0); } } else { local_294 = *(float *)((int)local_320 + -0x1c); local_290 = *(float *)((int)local_320 + -0x18); local_28c = *(float *)((int)local_320 + -0x14); local_288 = *(float *)((int)local_320 + -0x10); local_284 = *(float *)((int)local_320 + -0xc); local_280 = *(float *)((int)local_320 + -8); local_27c = *(float *)((int)local_320 + -4); fStack_278 = *(float *)local_320; fStack_274 = *(float *)((int)local_320 + 4); fStack_270 = *(float *)((int)local_320 + 8); local_319 = 1; } } pfVar24 = pfVar24 + 0xe; local_320 = (ItemPool *)((int)local_320 + 0x38); } while (pfVar24 != *(float **)((int)this + 0xc)); if (local_319 != 0) { (**(code **)(*(int *)this + 0x24))(&local_294); } } } *(int *)((int)this + 0xc) = *(int *)((int)this + 8); *(int *)((int)this + 0x14) = 0; *(int *)((int)this + 0x18) = 0; *(int *)((int)this + 0x1c) = 0; local_318 = *(float **)((int)this + 0x168); pfVar24 = *(float **)((int)this + 0x16c); } if (((uint)local_318 & 0x4000) == 0) { if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)this + 0x28) == 1)) || (*(int *)((int)this + 0x28) - 10U < 0x3de)) { local_308 = (EntityPtr)0x14; if ((((uint)local_318 & 0x40) != 0) && (iVar13 = *(int *)((int)this + 0x2e0), *(int *)((int)this + 0x2e0) = iVar13 + 1, iVar13 % 0x14 == 1)) { uStack_78 = 0; uStack_88 = 0; uStack_84 = 0; uStack_80 = 0; uStack_7c = 0; uStack_98 = 0x3dcccccd; uStack_94 = 0x3f000000; uStack_90 = 0x3dcccccd; uStack_8c = 0x3f800000; uStack_74 = 0x3f000000; uStack_70 = 0; (**(code **)(*(int *)this + 0x3c))(&uStack_98,2,0xff,0,1); sourceRef = EntityRef::EntityRef((EntityRef *)(local_1f8 + 0x14)); (**(code **)(*(int *)this + 0x20))(*(undefined4 *)((int)this + 800),0x8000,0,sourceRef); local_318 = *(float **)((int)this + 0x168); pfVar24 = *(float **)((int)this + 0x16c); } VStack_2d8.x = (float)local_318; if (((uint)local_318 & 0x1000) != 0) { iVar13 = *(int *)((int)this + 0x2e4); *(int *)((int)this + 0x2e4) = iVar13 + 1; if (iVar13 % (int)local_308 == 1) { uStack_4c = 0x3f000000; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; uStack_50 = 0; uStack_6c = 0x3f000000; uStack_68 = 0x3e99999a; uStack_64 = 0x3dcccccd; uStack_60 = 0x3f800000; uStack_48 = 0x3e99999a; uStack_44 = 0; (**(code **)(*(int *)this + 0x3c))(&uStack_6c,2,0xff,0,1); sourceRef = EntityRef::EntityRef(&EStack_1bc); (**(code **)(*(int *)this + 0x20))(*(undefined4 *)((int)this + 0x324),0x8000,0,sourceRef); VStack_2d8.x = *(float *)((int)this + 0x168); pfVar24 = *(float **)((int)this + 0x16c); } } if ((((uint)pfVar24 & 4) != 0) && (bVar10 = IsDescendantOf(this,*(Entity **)((int)this + 0x28c)), bVar10 == 0)) { fVar28 = *(float *)((int)this + 0x340) - *(float *)((int)this + 0x390); fVar31 = *(float *)((int)this + 0x33c) - *(float *)((int)this + 0x38c); fVar28 = sqrtf(fVar28 * fVar28 + fVar31 * fVar31); game = g_game; local_310 = (float *)(fVar28 * *(float *)((int)this + 0x39c) * 0.02 + *(float *)((int)this + 0x2ec)); *(float **)((int)this + 0x2ec) = local_310; iVar13 = game->_stageType; if ((iVar13 == 4) || (iVar13 == 5)) { iVar13 = g_game->_stage + 1; } else { iVar13 = game->_stage; } local_304 = (float *)((float)iVar13 * 0.3 + 2.8); pfStack_2f4 = local_310; dVar35 = floor((double)(float)local_310); local_308 = (EntityPtr)(float)dVar35; if (*(int *)&g_game->_deathmatchManager < 2) { pfVar24 = local_304; } else { pfVar24 = (float *)0x3f800000; } EVar30 = local_308; if (10.0 <= (float)local_308) { EVar30 = (EntityPtr)0x41200000; } *(float *)((int)this + 0x2ec) = (float)pfStack_2f4 - (float)local_308; fVar28 = (float)EVar30 * (float)pfVar24; if (0.0 < fVar28) { sourceRef = EntityRef::EntityRef(&EStack_180); (**(code **)(*(int *)this + 0x20))(fVar28,0,0,sourceRef,0x1e); local_310 = (float *)0x0; if (0.0 < (float)local_308) { do { VStack_2d8.x = ((*(float *)((int)this + 0x38c) - *(float *)((int)this + 0x33c)) * (float)local_310) / (float)local_308 + *(float *)((int)this + 0x33c); VStack_2d8.y = ((*(float *)((int)this + 0x390) - *(float *)((int)this + 0x340)) * (float)local_310) / (float)local_308 + *(float *)((int)this + 0x340); pfStack_2f4 = (float *)Random(); pGStack_2f8 = g_game; local_318 = (float *)0x0; uStack_2c0 = 0x2e; local_314 = (float *)0x3e8; lua_callback_run_pre_entity_spawn ((int *)&local_314,(int *)&uStack_2c0,&VStack_2d8,&g_vectorZero, (Entity *)0x0,(int *)&local_318,(uint *)&pfStack_2f4); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_006b0194: local_320 = (ItemPool *)local_318; } else { pfStack_30c = (g_game->_deathmatchManager)._type; uVar20 = Random(); pfVar24 = local_318; uStack_2ac = 0x900000005; pEStack_2fc = (Entity *)&DAT_00000007; uStack_2a4 = 7; uStack_300 = uVar20; if (local_314 != (float *)&DAT_00000005) goto LAB_006b0194; if (uStack_2c0 < 0x12d) { if (uStack_2c0 == 300) { while ((local_320 = (ItemPool *)local_318, local_318 == (float *)0x0 || (cVar11 = (**(code **)((int)*pfStack_30c + 0x24))(local_318), cVar11 != '\0'))) { if (uStack_300 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uStack_300 = uStack_300 >> ((byte)uStack_2ac & 0x1f) ^ uStack_300; uStack_300 = uStack_300 << ((byte)((ulonglong)uStack_2ac >> 0x20) & 0x1f) ^ uStack_300; uVar20 = uStack_300 >> ((byte)pEStack_2fc & 0x1f) ^ uStack_300; uStack_300 = uVar20; iVar13 = ItemPool::GetCardEx(uVar20,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar20; local_318 = (float *)lua_callback_run_get_card(&cardRng,iVar13,1,1,0); } } else { if (uStack_2c0 == 0x46) { uStack_2d0 = (uint)local_318 >> 0xb; do { if (local_318 != (float *)0x0) { pcVar6 = *(code **)((int)*pfStack_30c + 0x28); local_320 = (ItemPool *)local_318; iVar13 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)local_318, (Entity_Player *)0x0); cVar11 = (*pcVar6)(iVar13); if (cVar11 == '\0') goto LAB_006b019c; uVar20 = uStack_300; } local_320 = &g_game->_itemPool; if (uVar20 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar20 = uVar20 >> ((byte)uStack_2ac & 0x1f) ^ uVar20; uVar20 = uVar20 << ((byte)((ulonglong)uStack_2ac >> 0x20) & 0x1f) ^ uVar20; uVar20 = uVar20 >> ((byte)pEStack_2fc & 0x1f) ^ uVar20; uStack_300 = uVar20; uVar17 = ItemPool::GetPill(uVar20); local_318 = (float *)(uVar17 | (uStack_2d0 & 1) << 0xb); } while( true ); } if (uStack_2c0 != 100) goto LAB_006b0194; local_320 = (ItemPool *)local_318; if (local_318 == (float *)0x19) { LAB_006affca: bVar27 = false; } else { pfStack_2b8 = local_318; std::set::find_node(auStack_24c,&pfStack_2b8); if (((*(char *)((int)fStack_244 + 0xd) == '\0') && (*(int *)((int)fStack_244 + 0x10) <= (int)pfVar24)) && (fStack_244 != pfStack_30c[8])) goto LAB_006affca; bVar27 = true; } if ((pfVar24 == (float *)0x0) || (bVar27)) { local_320 = (ItemPool *)(**(code **)((int)*pfStack_30c + 0x84))(0); local_318 = (float *)local_320; } } } else { if (uStack_2c0 != 0x15e) goto LAB_006b0194; while ((local_320 = (ItemPool *)local_318, local_318 == (float *)0x0 || (cVar11 = (**(code **)((int)*pfStack_30c + 0x2c))(local_318), cVar11 != '\0'))) { local_318 = (float *)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_006b019c: pEStack_2fc = EntityFactory::Create(pGStack_2f8->_entityFactory,(uint)local_314,0); lVar7 = CONCAT44(pGStack_2f8,pfStack_2f4); if (pEStack_2fc == (Entity *)0x0) { pEVar16 = (Entity *)0x0; } else { uVar34 = GetTimeNs(); pEVar16 = pEStack_2fc; uVar17 = (uint)(uVar34 >> 0x20); lVar7 = (uVar34 & 0xffffffff) * 0x431bde82; apEStack_2f0[0] = (EntityPtr *)((ulonglong)lVar7 >> 0x20); uVar34 = (ulonglong)uVar17 * 0xd7b634db + ((uVar34 & 0xffffffff) * 0xd7b634db >> 0x20); uVar18 = (uint)(uVar34 >> 0x20); lVar7 = lVar7 + (uVar34 & 0xffffffff); uStack_2d0 = (uint)lVar7; uVar20 = (uint)((ulonglong)lVar7 >> 0x20); lVar7 = (ulonglong)uVar17 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar18,uVar20),uVar18 + uVar20); uVar20 = (uint)((ulonglong)lVar7 >> 0x20); uStack_300 = (uint)lVar7 >> 0x12 | uVar20 * 0x4000; pfStack_30c = (float *)(uVar20 >> 0x12); pEVar4 = &pEStack_2fc->_spawnerEntity; pEStack_2fc->_spawnerType = 0; pEStack_2fc->_spawnerVariant = 0; if (*pEVar4 != (EntityPtr)0x0) { apEStack_2e0[0] = pEVar4; std::multiset::erase(apEStack_2e0); } iVar13 = *(int *)pEVar16; *pEVar4 = (EntityPtr)0x0; (pEVar16->_pos).x = VStack_2d8.x; (pEVar16->_pos).y = VStack_2d8.y; (pEVar16->_velocity).x = g_vectorZero.x; (pEVar16->_velocity).y = g_vectorZero.y; (**(code **)(iVar13 + 4))(local_314,uStack_2c0,local_320,pfStack_2f4); pvVar23 = pGStack_2f8->_room; iVar13 = *(int *)((int)pvVar23 + 0x1214); *(int *)((int)pvVar23 + 0x1214) = iVar13 + 1; pEVar16->_index = iVar13; EntityList::AddEntity((EntityList *)((int)pvVar23 + 0x1218),pEVar16); bVar10 = Game::ShouldEraseEnemy(pEVar16); if (bVar10 != 0) { RemoveWithPoof(pEVar16,unusedArg); } if ((pEVar16->_exists != 0) && ((pGStack_2f8->_proceduralItemManager)._proceduralItems._begin != (pGStack_2f8->_proceduralItemManager)._proceduralItems._end)) { iStack_264 = pEVar16->_variant; iVar13 = pEVar16->_type; psVar3 = &(pGStack_2f8->_proceduralItemManager)._spawnTriggerTargets; iStack_268 = iVar13; std::map::find(&local_304,&iStack_268); if (local_304 == psVar3->_head) { aiStack_260[1] = 0xffffffff; aiStack_260[0] = iVar13; piVar15 = (int *)std::map::find(auStack_250,aiStack_260); local_304 = (float *)*piVar15; if (local_304 == psVar3->_head) goto LAB_006b0415; } uVar20 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar23 = (playerManager->_playerList)._end; if ((int)pvVar23 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar23 = (playerManager->_playerList)._end; } piVar15 = (playerManager->_playerList)._begin; if (uVar20 < (uint)((int)pvVar23 - (int)piVar15 >> 2)) { piVar15 = piVar15 + uVar20; } trigger_set_dispatch ((void *)(*piVar15 + 0x1fc8),6,pEStack_2fc,&VStack_2d8,&g_vectorZero ); uVar20 = uVar20 + 1; playerManager = &g_game->_playerManager; } while (uVar20 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_006b0415: uVar34 = GetTimeNs(); uVar20 = (uint)(uVar34 >> 0x20); lVar8 = (uVar34 & 0xffffffff) * 0x431bde82; uStack_2d0 = (uint)((ulonglong)lVar8 >> 0x20); lVar7 = (ulonglong)uVar20 * 0x431bde82; uVar34 = (ulonglong)uVar20 * 0xd7b634db + ((uVar34 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar34 >> 0x20); lVar8 = lVar8 + (uVar34 & 0xffffffff); apEStack_2f0[0] = (EntityPtr *)lVar8; uVar20 = (uint)((ulonglong)lVar8 >> 0x20); lVar8 = lVar7 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar20),uVar17 + uVar20); uVar18 = (uint)((ulonglong)lVar8 >> 0x20); uVar20 = (uint)lVar8 >> 0x12 | uVar18 * 0x4000; uVar17 = uVar20 - uStack_300; bVar27 = CARRY4((uint)g_entitySpawnTimeMs,uVar17); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar17; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar18 >> 0x12) - (int)pfStack_30c) - (uint)(uVar20 < uStack_300)) + (uint)bVar27; pEVar16 = pEStack_2fc; this = self; } pGStack_2f8 = (Game *)((ulonglong)lVar7 >> 0x20); pfStack_2f4 = (float *)lVar7; uVar20 = GetHitListIndex(this); sorted_vector_insert_unique(&pEVar16[1]._sprite._overlayAnimState._animData,uVar20); uVar20 = Random(); iVar13 = *(int *)pEVar16; fVar31 = (float)((double)(int)uVar20 + __uint_to_double_fixup[-((int)uVar20 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; fVar28 = fVar31 * g_vectorOne.x; (pEVar16->_sprite)._scale.y = fVar31 * g_vectorOne.y; (pEVar16->_sprite)._scale.x = fVar28; (**(code **)(iVar13 + 0xc))(); uVar20 = Random(); pEVar16 = Game::SpawnEx(g_game,1000,7,&VStack_2d8,&g_vectorZero,(Entity *)0x0,0,uVar20 ,0); (**(code **)(*(int *)pEVar16 + 0xc))(); uVar20 = Random(); uVar17 = Random(); uVar18 = Random(); fVar28 = (float)((double)(int)uVar18 + __uint_to_double_fixup[-((int)uVar18 >> 0x1f)]) * 2.3283064e-10 * 3.14; apEStack_2f0[0] = (EntityPtr *)(fVar28 + fVar28); particleVelocity.x = cos((float)apEStack_2f0[0]); particleVelocity.x = particleVelocity.x * 5.0; fVar28 = sin((float)apEStack_2f0[0]); particleVelocity.y = fVar28 * 0.5 * 5.0; uVar18 = Random(); fVar28 = (float)((double)(int)uVar18 + __uint_to_double_fixup[-((int)uVar18 >> 0x1f)]) * 2.3283064e-10 * 3.14; apEStack_2f0[0] = (EntityPtr *)(fVar28 + fVar28); fVar28 = cos((float)apEStack_2f0[0]); local_2c8.x = fVar28 * 0.5 * self->_size + local_2e4->x; fVar28 = sin((float)apEStack_2f0[0]); this = self; local_2c8.y = fVar28 * 0.5 * self->_size + local_2e4->y; pEVar16 = Game::SpawnEx(g_game,1000,5,&local_2c8,&particleVelocity,self,uVar17 % 3, uVar20,0); (**(code **)(*(int *)pEVar16 + 0xc))(); local_310 = (float *)((float)local_310 + 1.0); } while ((float)local_310 < (float)local_308); } } } } fVar28 = 1.0; if ((*(char *)((int)this + 0x173) == '\0') && ((*(uint *)((int)this + 0x16c) & 0x80000) != 0)) { bVar10 = DoesEntityShareStatus(this); if ((bVar10 != 0) && (EVar30 = *(EntityPtr *)((int)this + 0x3bc), *(EntityPtr *)((int)this + 0x3bc) != (EntityPtr)0x0)) { do { EVar14 = EVar30; EVar30 = *(EntityPtr *)((int)EVar14 + 0x3bc); } while (EVar30 != (EntityPtr)0x0); if (EVar14 != (EntityPtr)this) goto LAB_006b0a5d; } local_304 = (float *)0x0; pvStack_2bc = g_game->_room; pGStack_2f8 = (Game *)fVar28; if (*(int *)((int)pvStack_2bc + 0x1264) != 0) { do { EVar30 = *(EntityPtr *)(*(int *)((int)pvStack_2bc + 0x125c) + (int)local_304 * 4); local_308 = EVar30; bVar10 = DoesEntityShareStatus((Entity *)EVar30); if (bVar10 != 0) { EVar14 = *(EntityPtr *)((int)EVar30 + 0x3bc); local_308 = EVar30; if (*(EntityPtr *)((int)EVar30 + 0x3bc) != (EntityPtr)0x0) { do { local_308 = EVar14; EVar14 = *(EntityPtr *)((int)local_308 + 0x3bc); } while (*(EntityPtr *)((int)local_308 + 0x3bc) != (EntityPtr)0x0); this = self; } } EVar14 = (EntityPtr)GetStatusEffectTarget(this); if ((((EVar14 != local_308) && ((*(int *)&g_game->_deathmatchManager < 2 || (bVar10 = IsDescendantOf((Entity *)EVar30,*(Entity **)((int)this + 0x2b4)), bVar10 == 0)))) && ((bVar10 = IsVulnerableEnemy((Entity *)EVar30,(Entity *)0x0), bVar10 != 0 || ((((iVar13 = *(int *)((int)EVar30 + 0x28), iVar13 == 9 || (iVar13 == 2)) || (iVar13 == 4)) || (((iVar13 == 5 && (*(int *)((int)EVar30 + 0x534) == 0)) && ((bVar10 = Entity_Pickup::IsChest(*(int *)((int)EVar30 + 0x2c)), bVar10 == 0 || (*(int *)((int)EVar30 + 0x30) != 0)))))))))) && (EVar30 != (EntityPtr)this)) { if (((*(float *)((int)EVar30 + 0x33c) != *(float *)((int)this + 0x33c)) || (*(float *)((int)EVar30 + 0x340) != *(float *)((int)this + 0x340))) && (*(float *)((int)EVar30 + 0x36c) != 0.0)) { local_308 = (EntityPtr) (*(float *)((int)this + 0x33c) - *(float *)((int)EVar30 + 0x33c)); pEStack_2fc = (Entity *) (*(float *)((int)this + 0x340) - *(float *)((int)EVar30 + 0x340)); local_2e4 = (Vector *) ((float)pEStack_2fc * (float)pEStack_2fc + (float)local_308 * (float)local_308); if ((float)local_2e4 < 65536.0) { local_310 = (float *)sqrtf((float)local_2e4); fVar28 = sqrtf((float)local_2e4); pEVar16 = self; if (0.0 < fVar28) { local_308 = (EntityPtr)((float)local_308 * (1.0 / fVar28)); pEStack_2fc = (Entity *)((float)pEStack_2fc * (1.0 / fVar28)); } puVar32 = &DAT_42000000; iVar13 = *(int *)((int)EVar30 + 0x28); if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar13 == 1)) || (iVar13 - 10U < 0x3de)) || ((iVar13 == 2 || (iVar13 == 4)))) { puVar32 = (undefined1 *)0x42a00000; } if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar13 == 1)) || ((iVar13 - 10U < 0x3de || (iVar13 == 4)))) && ((float)local_310 < *(float *)((int)EVar30 + 0x370) + *(float *)((int)this + 0x370) + 16.0)) { pGStack_2f8 = (Game *)((float)pGStack_2f8 * 0.8); } if (8.0 <= (float)local_310) { fVar28 = 1.0 / (float)local_310; } else { fVar28 = (float)local_310 * 0.015625; } if (iVar13 == 9) { apEStack_2f0[0] = (EntityPtr *)0x3f000000; fVar31 = (float)(g_game->_frameCount - *(int *)((int)EVar30 + 0x328)) / 30.0; if (1.0 <= fVar31) { fVar31 = 1.0; } fVar31 = fVar31 * fVar28; pfVar24 = (float *)(((float)puVar32 * fVar31) / *(float *)((int)EVar30 + 0x36c)); apEStack_2e0[0] = (EntityPtr *)(1.0 - (fVar31 + fVar31)); ppEVar19 = apEStack_2e0; if ((float)apEStack_2e0[0] <= 0.5) { ppEVar19 = apEStack_2f0; } pEVar4 = *ppEVar19; *(float *)((int)EVar30 + 0x364) = (float)pEVar4 * *(float *)((int)EVar30 + 0x364); *(float *)((int)EVar30 + 0x360) = (float)pEVar4 * *(float *)((int)EVar30 + 0x360); if ((0.3 < fVar31) && (*(float *)((int)EVar30 + 0x418) <= 0.0 && *(float *)((int)EVar30 + 0x418) != 0.0)) { *(undefined4 *)((int)EVar30 + 0x418) = 0; } if ((((*(char *)((int)EVar30 + 0x173) == '\0') && ((float)local_2e4 < *(float *)((int)this + 0x370) * *(float *)((int)this + 0x370))) && (0xf < g_game->_frameCount - *(int *)((int)EVar30 + 0x328))) && (-50.0 < *(float *)((int)EVar30 + 0x410))) { *(undefined1 *)((int)EVar30 + 0x173) = 1; } } else { local_314 = (float *)(((float)puVar32 * fVar28) / *(float *)((int)EVar30 + 0x36c)) ; if (iVar13 == 2) { apEStack_2f0[0] = (EntityPtr *)0x3f000000; apEStack_2e0[0] = (EntityPtr *)(1.0 - (fVar28 + fVar28)); ppEVar19 = apEStack_2e0; if ((float)apEStack_2e0[0] <= 0.5) { ppEVar19 = apEStack_2f0; } fVar28 = (float)*ppEVar19 * *(float *)((int)EVar30 + 0x364); fVar31 = (float)*ppEVar19 * *(float *)((int)EVar30 + 0x360); *(float *)((int)EVar30 + 0x364) = fVar28; *(float *)((int)EVar30 + 0x360) = fVar31; local_320 = (ItemPool *)DAT_00c34b64; apEStack_2e0[0] = (EntityPtr *)(*(uint *)((int)EVar30 + 0x430) & DAT_00c34b68); apEStack_2f0[0] = (EntityPtr *)(*(uint *)((int)EVar30 + 0x434) & (uint)DAT_00c34b6c); pfStack_2b8 = DAT_00c34b6c; uStack_2d0 = DAT_00c34b60; this = pEVar16; if ((((*(uint *)((int)EVar30 + 0x428) & DAT_00c34b60) != 0 || (*(uint *)((int)EVar30 + 0x42c) & (uint)DAT_00c34b64) != 0) || (apEStack_2e0[0] != (EntityPtr *)0x0 || apEStack_2f0[0] != (EntityPtr *)0x0) ) && (fVar28 * fVar28 + fVar31 * fVar31 < 1.0)) { uStack_2b0 = ~DAT_00c34b60 & *(uint *)((int)EVar30 + 0x428); local_320 = (ItemPool *)(~(uint)DAT_00c34b64 & *(uint *)((int)EVar30 + 0x42c)) ; uVar20 = ~DAT_00c34b68 & *(uint *)((int)EVar30 + 0x430); uStack_2ac = CONCAT44(uVar20,local_320); uStack_2a4 = ~(uint)DAT_00c34b6c & *(uint *)((int)EVar30 + 0x434); flags._l._4_4_ = (float *)local_320; flags._l._0_4_ = uStack_2b0; flags._h._0_4_ = uVar20; flags._h._4_4_ = uStack_2a4; Entity_Tear::SetTearFlags((Entity_Tear *)EVar30,flags); } } pfVar24 = local_314; } *(float *)((int)EVar30 + 0x360) = (float)local_308 * (float)pfVar24 + *(float *)((int)EVar30 + 0x360); *(float *)((int)EVar30 + 0x364) = (float)pEStack_2fc * (float)pfVar24 + *(float *)((int)EVar30 + 0x364); } } } local_304 = (float *)((int)local_304 + 1); } while (local_304 < *(float **)((int)pvStack_2bc + 0x1264)); } *(float *)((int)this + 0x364) = (float)pGStack_2f8 * *(float *)((int)this + 0x364); *(float *)((int)this + 0x360) = (float)pGStack_2f8 * *(float *)((int)this + 0x360); } } LAB_006b0a5d: if ((((*(uint *)((int)this + 0x168) & 0x4000) == 0) && (0.0 < *(float *)((int)g_game->_room + 0x7240))) && ((((g_manager->_optionsConfig)._enableWaterSurface != 0 && (((get_water_splash_variant(&local_2c8), *(int *)((int)this + 0x188) != 0 && (*(int *)((int)this + 0x184) == 5)) || (((uint)local_2c8.x & 0x80) != 0)))) && (fVar28 = sqrtf(*(float *)((int)this + 0x360) * *(float *)((int)this + 0x360) + *(float *)((int)this + 0x364) * *(float *)((int)this + 0x364)), 0.01 < fVar28) ))) { iVar13 = 1; if (1 < (int)(20.0 / fVar28)) { iVar13 = (int)(20.0 / fVar28); } iVar13 = GetIntervalTicks(this,(float)iVar13,0.0); if (iVar13 != 0) { uVar20 = Random(); Game::SpawnEx(g_game,1000,0x85,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)0x0,0, uVar20,0); } } if (10000.0 <= ABS(*(float *)((int)this + 0x33c)) + ABS(*(float *)((int)this + 0x340))) { KAGE_LogMessage(0x10,(byte *)"Invalid entity position detected: %.2f, %.2f (%d.%d.%d)\n"); } return; } //@@ 006b0eb0 Entity::Interpolate /* ZHL [vtable slot 4] prototype: db/protos.zhl */ void __thiscall Entity::Interpolate(Entity *this) { Vector *position; float fVar1; float fVar2; float fVar3; uint uVar4; int iVar5; Game *pGVar6; float fVar7; Vector local_10; uVar4 = (uint)this->_flags; if ((uVar4 & 2) != 0) { *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = uVar4 & 0xfffffffd; return; } iVar5 = this->_type; position = &this->_pos; (this->_preInterpolatePos).x = position->x; (this->_preInterpolatePos).y = (this->_pos).y; fVar7 = this->_friction; fVar1 = (this->_velocity).y; fVar2 = (this->_velocity).x; fVar3 = this->_speedMultiplier; this->_isInterpolating = 1; position->x = fVar7 * fVar2 * fVar3 * 0.5 + position->x; (this->_pos).y = fVar7 * fVar1 * fVar3 * 0.5 + (this->_pos).y; if (iVar5 == 1) { PlayerCollideWithGrid(this,1); pGVar6 = g_game; if (this->_variant == 1) { fVar7 = this->_size; Room::GetClampedPositionImpl(g_game->_room,&local_10,position,fVar7,fVar7,fVar7,fVar7); position->x = local_10.x; (this->_pos).y = local_10.y; fVar7 = sin(((float)pGVar6->_frameCount + 0.5) * 0.2); (this->_posOffset).y = fVar7 + fVar7; return; } } else { CollideWithGrid(this,1); } return; } //@@ 006b1000 Entity::GetRenderZ /* ZHL [vtable slot 13] */ int __thiscall Entity::GetRenderZ(Entity *this) { int iVar1; int iVar2; if (this->_sortingLayer == 0) { iVar1 = this->_renderZOffset + 100 + (this->_index & 0x3ffU); iVar2 = 4999; if (iVar1 < 4999) { iVar2 = iVar1; } iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } return iVar1; } if (this->_sortingLayer == 1) { iVar1 = this->_renderZOffset + 0x13ec + (this->_index & 0x3ffU); iVar2 = 9999; if (iVar1 < 9999) { iVar2 = iVar1; } iVar1 = 5000; if (5000 < iVar2) { iVar1 = iVar2; } return iVar1; } if (*(int *)((int)g_game->_room + 8) == 0x10) { iVar1 = (this->_index & 0x3ffU) + this->_renderZOffset + 0x272e; iVar2 = 10000; if (10000 < iVar1) { iVar2 = iVar1; } return iVar2; } iVar1 = FUN_006a8120(); iVar1 = this->_renderZOffset + iVar1; iVar2 = 10000; if (10000 < iVar1) { iVar2 = iVar1; } return iVar2; } //@@ 006b10d0 Entity::CanOverwrite /* ZHL [vtable slot 14] */ uint __thiscall Entity::CanOverwrite(Entity *this) { uint uVar1; uVar1 = (uint)this->_flags & 0x200000; if (uVar1 == 0) { return 1; } return uVar1; } //@@ 006b10f0 Entity::Render /* ZHL [vtable slot 5] prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity::Render(Entity *this,Vector *offset) { float fVar1; float fVar2; double dVar3; double dVar4; if ((this->_exists != 0) && (this->_visible != 0)) { fVar2 = g_displayPixelRatio * g_screenPointScale; dVar3 = floor((double)(((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar2 + 0.5)); dVar4 = floor((double)(((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar2 + 0.5)); fVar1 = offset->y; (this->_renderPosition).x = (float)dVar3 / fVar2 + offset->x; (this->_renderPosition).y = (float)dVar4 / fVar2 + fVar1; ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); } return; } //@@ 006b1260 Entity::PostRender /* ZHL [vtable slot 7] */ void __thiscall Entity::PostRender(Entity *this) { void *pvVar1; KColor *fromColor; KColor *fromColor_00; int unused; uint uVar2; Game *game; KColor *collisionColor; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; double dVar8; double dVar9; int segment; int reverseSegment; float local_e8; Vector lineTo; float screenX; float local_d8; Vector lineFrom; float minorAxisX; float local_c8; float majorAxisX; Vector local_c0; float negMajorAxisX; float negMajorAxisY; float arcPointX; Vector arcPointA; Vector arcPointB; KColor drawColor; undefined1 renderQuad [44]; float local_4c; float local_38; float local_24; float local_10; int halfSegmentCount; int segmentCount; if (((g_game->_debugFlags & 1) != 0) && (this->_type != 7)) { fVar3 = g_screenHeight - 182.0; uVar2 = 0xffffa500; fVar4 = g_displayPixelRatio * g_screenPointScale; if (this->_type != 1000) { uVar2 = 0xffff0000; } dVar8 = floor((double)((((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar4 + 0.5)); dVar9 = floor((double)((((this->_pos).y - 140.0) * 0.65 + fVar3 * 0.5) * fVar4 + 0.5)); fVar7 = (float)dVar8 / fVar4 + *(float *)((int)g_game->_room + 0x1204); fVar5 = (float)dVar9 / fVar4 + *(float *)((int)g_game->_room + 0x1208); fVar3 = fVar5; fVar4 = fVar7; KColor::SetFromARGB(&drawColor,uVar2); lineTo.x = fVar4 + 2.0; lineTo.y = fVar3 + 0.0; lineFrom.x = fVar4 - 2.0; lineFrom.y = fVar3 - 0.0; render_color_quad(&lineFrom,&lineTo,fromColor,fromColor,1.0); KColor::SetFromARGB(&drawColor,uVar2); lineTo.x = fVar7 + 0.0; lineTo.y = fVar5 + 2.0; lineFrom.y = fVar5 - 2.0; lineFrom.x = fVar7 - 0.0; render_color_quad(&lineFrom,&lineTo,fromColor_00,fromColor_00,1.0); } game = g_game; if (((uint)g_game->_debugFlags >> 0xc & 1) != 0) { fVar3 = g_screenHeight - 182.0; fVar4 = g_displayPixelRatio * g_screenPointScale; dVar8 = floor((double)((((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar4 + 0.5)); dVar9 = floor((double)((((this->_pos).y - 140.0) * 0.65 + fVar3 * 0.5) * fVar4 + 0.5)); fVar3 = (float)dVar8 / fVar4 + *(float *)((int)game->_room + 0x1204); fVar4 = (float)dVar9 / fVar4 + *(float *)((int)game->_room + 0x1208); if (this->_entityGridCollisionClass != 0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80cb8) && (_Init_thread_header(), DAT_00c80cb8 == -1)) { KColor::SetFromARGB((KColor *)&DAT_00c80cc0,0xff000000); KColor::SetFromARGB((KColor *)&DAT_00c80cd4,0xff8b0000); KColor::SetFromARGB((KColor *)&DAT_00c80ce8,0xff006400); KColor::SetFromARGB((KColor *)&DAT_00c80cfc,0xffffff00); KColor::SetFromARGB((KColor *)&DAT_00c80d10,0xffffa500); KColor::SetFromARGB((KColor *)&DAT_00c80d24,0xffff0000); KColor::SetFromARGB((KColor *)&DAT_00c80d38,0xff00ffff); KColor::SetFromARGB((KColor *)&DAT_00c80d4c,0xffff00ff); _Init_thread_footer(); } uVar2 = this->_entityGridCollisionClass; if (((int)uVar2 < 1) || (7 < uVar2)) { collisionColor = (KColor *)&DAT_00c80cc0; } else { collisionColor = (KColor *)(&DAT_00c80cc0 + uVar2 * 0x14); } uVar2 = 0; pvVar1 = (this->_collisionPoints)._begin; if ((int)(this->_collisionPoints)._end - (int)pvVar1 >> 3 != 0) { lineTo.x = 1.0; lineTo.y = 1.0; fVar5 = fVar3; fVar7 = fVar4; do { lineFrom.x = fVar5 + *(float *)((int)pvVar1 + uVar2 * 8) * 0.65; lineFrom.y = *(float *)((int)pvVar1 + uVar2 * 8 + 4) * 0.65 + fVar7; render_quad_set_rect(renderQuad,&lineFrom,&lineTo,collisionColor); if ((local_4c + local_38 + local_24 + local_10) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); FUN_00a11080(); pvVar1 = kage_graphics_flush((void *)0x0); render_quad_draw(pvVar1,&drawColor,renderQuad,1,unused); FUN_00a14200(); fVar5 = fVar3; fVar7 = fVar4; } uVar2 = uVar2 + 1; pvVar1 = (this->_collisionPoints)._begin; } while (uVar2 < (uint)((int)(this->_collisionPoints)._end - (int)pvVar1 >> 3)); } game = g_game; } } if (((uint)game->_debugFlags >> 5 & 1) != 0) { fVar3 = g_screenHeight - 182.0; fVar4 = g_displayPixelRatio * g_screenPointScale; dVar8 = floor((double)((((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar4 + 0.5)); screenX = (float)dVar8 / fVar4; dVar8 = floor((double)((((this->_pos).y - 140.0) * 0.65 + fVar3 * 0.5) * fVar4 + 0.5)); screenX = screenX + *(float *)((int)game->_room + 0x1204); fVar3 = (float)dVar8 / fVar4 + *(float *)((int)game->_room + 0x1208); if ((0.0 < this->_size) && (this->_entityCollisionClass != 0)) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80d60) && (_Init_thread_header(), DAT_00c80d60 == -1)) { KColor::SetFromARGB((KColor *)&DAT_00c80d68,0xff000000); KColor::SetFromARGB((KColor *)&DAT_00c80d7c,0xffffa500); KColor::SetFromARGB((KColor *)&DAT_00c80d90,0xffffc0cb); KColor::SetFromARGB((KColor *)&DAT_00c80da4,0xff00ff00); KColor::SetFromARGB((KColor *)&DAT_00c80db8,0xffff0000); _Init_thread_footer(); } uVar2 = this->_entityCollisionClass; if (((int)uVar2 < 1) || (4 < uVar2)) { collisionColor = (KColor *)&DAT_00c80d68; } else { collisionColor = (KColor *)(&DAT_00c80d68 + uVar2 * 0x14); } local_e8 = this->_size; fVar4 = (this->_sizeMulti).x; fVar5 = (local_e8 * 6.2831855) / 10.0; if (fVar5 <= 2.0) { fVar5 = 2.0; } if (12.0 <= fVar5) { fVar5 = 12.0; } halfSegmentCount = (int)fVar5 * 2; if ((fVar4 == g_vectorOne.x) && ((this->_sizeMulti).y == g_vectorOne.y)) { fVar4 = cos(0.0); local_c0.x = fVar4 * this->_size * 0.65 + screenX; fVar4 = sin(0.0); segment = 1; segmentCount = (int)fVar5 << 2; if (0 < segmentCount) { local_c0.y = fVar4 * this->_size * 0.65 + fVar3; do { fVar5 = (((float)segment * 180.0) / (float)halfSegmentCount) * 0.017453292; fVar4 = cos(fVar5); fVar4 = fVar4 * this->_size * 0.65 + screenX; lineTo.x = fVar4; fVar5 = sin(fVar5); fVar5 = fVar5 * this->_size * 0.65 + fVar3; lineTo.y = fVar5; render_color_quad(&local_c0,&lineTo,collisionColor,collisionColor,1.0); segment = segment + 1; local_c0.x = fVar4; local_c0.y = fVar5; } while (segment <= segmentCount); return; } } else { local_d8 = (this->_sprite)._rotation; fVar4 = fVar4 * local_e8; local_e8 = local_e8 * (this->_sizeMulti).y; fVar5 = fVar4; if (fVar4 < local_e8) { local_d8 = local_d8 + 90.0; fVar5 = local_e8; local_e8 = fVar4; } fVar4 = local_d8 * 0.017453292; majorAxisX = cos(fVar4); majorAxisX = majorAxisX * (fVar5 - local_e8); fVar4 = sin(fVar4); fVar4 = fVar4 * (fVar5 - local_e8); local_d8 = (local_d8 + 90.0) * 0.017453292; minorAxisX = cos(local_d8); minorAxisX = minorAxisX * local_e8; local_d8 = sin(local_d8); local_d8 = local_d8 * local_e8; lineTo.x = (-minorAxisX + majorAxisX) * 0.65 + screenX; lineFrom.x = (-minorAxisX - majorAxisX) * 0.65 + screenX; lineTo.y = (-local_d8 + fVar4) * 0.65 + fVar3; lineFrom.y = (-local_d8 - fVar4) * 0.65 + fVar3; render_color_quad(&lineFrom,&lineTo,collisionColor,collisionColor,1.0); fVar5 = (minorAxisX + majorAxisX) * 0.65 + screenX; fVar7 = (local_d8 + fVar4) * 0.65 + fVar3; lineFrom.x = (minorAxisX - majorAxisX) * 0.65 + screenX; lineFrom.y = (local_d8 - fVar4) * 0.65 + fVar3; lineTo.x = fVar5; lineTo.y = fVar7; render_color_quad(&lineFrom,&lineTo,collisionColor,collisionColor,1.0); negMajorAxisX = -majorAxisX; negMajorAxisY = -fVar4; segment = 1; lineTo.x = (negMajorAxisX + minorAxisX) * 0.65 + screenX; if (0 < halfSegmentCount) { reverseSegment = -1; lineTo.y = (negMajorAxisY + local_d8) * 0.65 + fVar3; lineFrom.x = fVar5; lineFrom.y = fVar7; do { fVar5 = (((float)reverseSegment * 180.0) / (float)halfSegmentCount) * 0.017453292; local_c8 = cos(fVar5); fVar5 = sin(fVar5); fVar7 = local_c8 * local_d8; fVar6 = local_c8 * minorAxisX; local_c8 = (((float)segment * 180.0) / (float)halfSegmentCount) * 0.017453292; local_c0.x = (fVar5 * minorAxisX + fVar7 + fVar4) * 0.65 + fVar3; arcPointX = ((fVar6 - fVar5 * local_d8) + majorAxisX) * 0.65 + screenX; arcPointA.x = arcPointX; arcPointA.y = local_c0.x; fVar5 = cos(local_c8); fVar7 = sin(local_c8); local_c8 = ((fVar5 * minorAxisX - fVar7 * local_d8) + negMajorAxisX) * 0.65 + screenX; fVar5 = (fVar5 * local_d8 + fVar7 * minorAxisX + negMajorAxisY) * 0.65 + fVar3; arcPointB.x = local_c8; arcPointB.y = fVar5; render_color_quad(&lineFrom,&arcPointA,collisionColor,collisionColor,1.0); render_color_quad(&lineTo,&arcPointB,collisionColor,collisionColor,1.0); lineFrom.x = arcPointX; lineFrom.y = local_c0.x; segment = segment + 1; reverseSegment = reverseSegment + -1; lineTo.x = local_c8; lineTo.y = fVar5; } while (segment <= halfSegmentCount); } } } } return; } //@@ 006b2000 Entity::RenderShadowLayer /* ZHL [exact] __thiscall bool Entity::RenderShadowLayer(Vector *offset); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity::RenderShadowLayer(Entity *this,Vector *offset) { ColorMod *pCVar1; byte *layerName; float fVar2; float fVar3; float fVar4; LayerState *pLVar5; float *extraout_EAX; double dVar6; Vector local_cc; float local_c4; undefined8 local_c0; float local_b8; float fStack_b4; float fStack_b0; float fStack_ac; float local_a8; float fStack_a4; float fStack_a0; float fStack_9c; Color local_98; undefined4 local_6c [26]; local_c0 = CONCAT44(local_c0._4_4_,g_displayPixelRatio * g_screenPointScale); local_cc.x = ((((this->_shadowOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * g_displayPixelRatio * g_screenPointScale + 0.5; dVar6 = floor((double)local_cc.x); local_c4 = (float)dVar6 / (float)local_c0; local_cc.x = ((((this->_pos).y + (this->_shadowOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_c0 + 0.5; dVar6 = floor((double)local_cc.x); local_cc.x = local_c4 + offset->x; local_cc.y = (float)dVar6 / (float)local_c0 + offset->y; layerName = (byte *)(this->_sprite)._shadowLayerIndex; if (layerName == (byte *)0xffffffff) { return 0; } pLVar5 = ANM2::GetLayer(&this->_sprite,layerName); pCVar1 = &(this->_sprite)._color; pLVar5->_visible = 1; local_b8 = pCVar1->_tint[0]; fStack_b4 = (this->_sprite)._color._tint[1]; fStack_b0 = (this->_sprite)._color._tint[2]; fStack_ac = (this->_sprite)._color._tint[3]; local_c4 = (this->_sprite)._color._offset[2]; local_a8 = (this->_sprite)._color._colorize[0]; fStack_a4 = (this->_sprite)._color._colorize[1]; fStack_a0 = (this->_sprite)._color._colorize[2]; fStack_9c = (this->_sprite)._color._colorize[3]; local_c0 = *(undefined8 *)(this->_sprite)._color._offset; ::Color::Color(&local_98); if (pCVar1 != (ColorMod *)extraout_EAX) { fVar2 = extraout_EAX[1]; fVar3 = extraout_EAX[2]; fVar4 = extraout_EAX[3]; pCVar1->_tint[0] = *extraout_EAX; (this->_sprite)._color._tint[1] = fVar2; (this->_sprite)._color._tint[2] = fVar3; (this->_sprite)._color._tint[3] = fVar4; fVar2 = extraout_EAX[5]; fVar3 = extraout_EAX[6]; fVar4 = extraout_EAX[7]; (this->_sprite)._color._colorize[0] = extraout_EAX[4]; (this->_sprite)._color._colorize[1] = fVar2; (this->_sprite)._color._colorize[2] = fVar3; (this->_sprite)._color._colorize[3] = fVar4; *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)(extraout_EAX + 8); (this->_sprite)._color._offset[2] = extraout_EAX[10]; } Sprite::RenderLayer((Sprite *)&this->_sprite,(this->_sprite)._shadowLayerIndex,&local_cc, &g_vectorZero,&g_vectorZero); if (pCVar1 != (ColorMod *)local_6c) { pCVar1->_tint[0] = local_b8; (this->_sprite)._color._tint[1] = fStack_b4; (this->_sprite)._color._tint[2] = fStack_b0; (this->_sprite)._color._tint[3] = fStack_ac; (this->_sprite)._color._colorize[0] = local_a8; (this->_sprite)._color._colorize[1] = fStack_a4; (this->_sprite)._color._colorize[2] = fStack_a0; (this->_sprite)._color._colorize[3] = fStack_9c; *(undefined8 *)(this->_sprite)._color._offset = local_c0; (this->_sprite)._color._offset[2] = local_c4; } pLVar5->_visible = 0; return 1; } //@@ 006b2210 Entity::IsCollisionIgnored /* DB: ? player vs type 9 projectile with effect 625, collectible 276, null 59, PlayerType 35 prototype: db/protos.zhl, confirmed by RET 4 */ float __thiscall Entity::IsCollisionIgnored(Entity *this,Entity *other) { int iVar1; byte bVar2; float local_c; local_c = this->_mass; if (((this->_flags & 0x8000000000000) != 0) && (((1 < *(int *)&g_game->_deathmatchManager && (other->_type == 1)) || (other->_type - 10U < 0x3de)))) { local_c = local_c * 10.0; } iVar1 = this->_type; if (iVar1 == 1) { if ((other->_type == 3) && (other->_variant == 0xef)) { local_c = local_c * 10.0; } bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&this[5]._sprite._nullLayerNames,0x271); if (bVar2 != 0) { local_c = local_c * 10.0; } } if (((((1 < *(int *)&g_game->_deathmatchManager) && (iVar1 == 1)) || (iVar1 - 10U < 0x3de)) && ((other->_type == 2 || (other->_type == 7)))) && ((((iVar1 == 0x19 || ((((iVar1 == 0x3e || (iVar1 == 0x29)) || (iVar1 == 0xfe)) || ((iVar1 == 0x5b || (iVar1 == 0x17)))))) || (iVar1 == 0x124)) || (((iVar1 == 0xf5 || (iVar1 == 0x37)) || (iVar1 == 0x11b)))))) { local_c = local_c * 100.0; } if ((iVar1 == 1) && (other->_type == 9)) { bVar2 = Entity_Player::HasCollectible((Entity_Player *)this,0x114,0); if (bVar2 == 0) { bVar2 = TemporaryEffects::HasNullEffect ((TemporaryEffects *)&this[5]._sprite._nullLayerNames,0x3b); if ((bVar2 == 0) && (this[4]._prevPosition.y != 4.90454e-44)) { return local_c; } } local_c = local_c * 20.0; } return local_c; } //@@ 006b2390 FUN_006b2390 undefined4 FUN_006b2390(void) { int iVar1; byte bVar2; Entity *in_ECX; iVar1 = in_ECX->_type; if ((((iVar1 != 1) && (iVar1 != 2)) && (iVar1 != 3)) && ((iVar1 != 8 && (iVar1 != 4)))) { bVar2 = Entity::IsEnemy(in_ECX); if (bVar2 != 0) { bVar2 = Entity::HasEntityFlags(in_ECX,0x20000100); if (bVar2 != 0) { return 1; } if (iVar1 == 0x322) { return 1; } if (iVar1 == 0x362) { return 1; } if (iVar1 == 0xf5) { return 1; } } if ((iVar1 != 9) || ((in_ECX[1]._variant & 0x80U) == 0)) { return 0; } } return 1; } //@@ 006b2410 entity_collision_classes_match /* DB: ? fastcall (ECX entity A, EDX entity B): reads each EntityCollisionClass (+0x188), promotes 1/2 to 4 for players/NPCs with flags 0x20000100, returns true when either is 0 or the class pair passes FUN_006b2390; Entity::ForceCollide, Entity_Familiar::ai_umbilical_baby prototype: db/protos.zhl */ byte __fastcall entity_collision_classes_match(Entity *a,Entity *b) { char cVar1; byte bVar2; byte bVar3; int local_10; int local_c; local_c = a->_entityCollisionClass; local_10 = b->_entityCollisionClass; if (((local_c == 2) || (local_c == 1)) && ((((1 < *(int *)&g_game->_deathmatchManager && (a->_type == 1)) || (a->_type - 10U < 0x3de)) && ((a->_flags & 0x20000100) != 0)))) { local_c = 4; } if ((((local_10 == 2) || (local_10 == 1)) && (((1 < *(int *)&g_game->_deathmatchManager && (b->_type == 1)) || (b->_type - 10U < 0x3de)))) && ((b->_flags & 0x20000100) != 0)) { local_10 = 4; } if ((local_c == 0) || (local_10 == 0)) { bVar3 = 1; } else { bVar3 = 0; } if (((local_c == 2) && (cVar1 = FUN_006b2390(), cVar1 == '\0')) || ((local_10 == 2 && (cVar1 = FUN_006b2390(), cVar1 == '\0')))) { bVar2 = 1; } else { bVar2 = 0; } bVar3 = bVar3 | bVar2; if ((local_c == 1) || ((local_10 == 1 && (a->_type != 1)))) { bVar3 = 1; } if (((local_c == 3) && (((*(int *)&g_game->_deathmatchManager < 2 || (b->_type != 1)) && (0x3dd < b->_type - 10U)))) || (((local_10 == 3 && ((*(int *)&g_game->_deathmatchManager < 2 || (a->_type != 1)))) && (0x3dd < a->_type - 10U)))) { bVar2 = 1; } else { bVar2 = 0; } if ((a->_dead != 0) || (b->_dead != 0)) { return 1; } if ((bVar3 | bVar2) == 0) { bVar3 = (**(code **)(*(int *)a + 0x5c))(b,1); bVar2 = (**(code **)(*(int *)b + 0x5c))(a,0); return bVar2 | bVar3; } return bVar3 | bVar2; } //@@ 006b25b0 Entity::push_apart_capsule /* DB: ECX/EDX entities: Entity::collide_with_entity's non-(1,1) _sizeMulti branch: Capsule::constructor for both, Capsule::Collide, mass-weighted position/velocity push, Room::IsBeastDungeon damping prototype: db/protos.zhl */ void __thiscall Entity::push_apart_capsule(Entity *this,Entity *other) { float fVar1; byte bVar2; Game *extraout_EDX; Game *pGVar3; Entity *pEVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; Vector local_60; Capsule local_58 [10]; Capsule local_30 [11]; pEVar4 = other; if ((((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 2)) || (other->_type != 1)) && (other->_type < this->_type)) { pEVar4 = this; this = other; } local_60.x = (this->_pos).x + g_vectorZero.x; local_60.y = (this->_pos).y + g_vectorZero.y; Capsule::constructor(local_30,&local_60,&this->_sizeMulti,(this->_sprite)._rotation,this->_size); local_60.x = (pEVar4->_pos).x + g_vectorZero.x; local_60.y = (pEVar4->_pos).y + g_vectorZero.y; Capsule::constructor (local_58,&local_60,&pEVar4->_sizeMulti,(pEVar4->_sprite)._rotation,pEVar4->_size); local_60.y = 0.0; local_60.x = 0.0; bVar2 = Capsule::Collide(local_30,local_58,&local_60); if (bVar2 != 0) { bVar2 = entity_collision_classes_match(this,pEVar4); if (bVar2 == 0) { fVar5 = IsCollisionIgnored(this,pEVar4); fVar6 = IsCollisionIgnored(pEVar4,this); fVar5 = fVar5 / (fVar6 + fVar5); fVar6 = 1.0 - fVar5; if ((local_60.x != g_vectorZero.x) || (local_60.y != g_vectorZero.y)) { fVar1 = (this->_velocity).x; fVar9 = (pEVar4->_velocity).x - fVar1; fVar7 = (pEVar4->_velocity).y - (this->_velocity).y; fVar8 = sqrtf(fVar7 * fVar7 + fVar9 * fVar9); fVar7 = sqrtf(local_60.x * local_60.x + local_60.y * local_60.y); fVar11 = 0.25; fVar10 = (local_60.x / fVar7) * fVar8; fVar8 = (local_60.y / fVar7) * fVar8; pGVar3 = g_game; fVar7 = local_60.y; fVar9 = local_60.x; if ((this->_flags & 0x40000000) == 0) { bVar2 = Room::IsBeastDungeon(g_game->_room); if ((bVar2 == 0) || (this->_type != 1)) { (this->_pos).x = (this->_pos).x - fVar9 * fVar6; (this->_pos).y = (this->_pos).y - fVar7 * fVar6; (this->_velocity).x = (this->_velocity).x - fVar10 * fVar6; fVar1 = fVar8; } else { (this->_velocity).x = fVar1 - fVar10 * fVar11 * fVar6; fVar1 = fVar8 * fVar11; } (this->_velocity).y = (this->_velocity).y - fVar1 * fVar6; pGVar3 = extraout_EDX; } if ((pEVar4->_flags & 0x40000000) == 0) { bVar2 = Room::IsBeastDungeon(pGVar3->_room); if ((bVar2 == 0) || (pEVar4->_type != 1)) { (pEVar4->_pos).x = fVar9 * fVar5 + (pEVar4->_pos).x; (pEVar4->_pos).y = fVar7 * fVar5 + (pEVar4->_pos).y; } else { fVar10 = fVar10 * fVar11; fVar8 = fVar8 * fVar11; } (pEVar4->_velocity).y = fVar8 * fVar5 + (pEVar4->_velocity).y; (pEVar4->_velocity).x = fVar10 * fVar5 + (pEVar4->_velocity).x; } } return; } } return; } //@@ 006b2940 Entity::push_apart_circle /* DB: ECX/EDX entities: Entity::collide_with_entity uses it when both _sizeMulti are (1,1): distance < sum of sizes (+0x370), entity_collision_classes_match, mass split, velocity reflection via Vector::Normalized prototype: db/protos.zhl */ byte __thiscall Entity::push_apart_circle(Entity *this,Entity *other) { byte bVar1; Vector *relVelocityDir; Vector *deltaDir; uint rngResult; int unused; Game *extraout_EDX; Game *game; Entity *first; Entity *second; float fVar2; float fVar3; float pushDirX; float pushDirY; float beastDamping; Vector local_40; Vector local_38; Vector local_30; float local_28; Entity *local_24; float local_20; float local_1c; float dy; float dx; second = other; local_24 = this; if ((((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 2)) || (other->_type != 1)) && (other->_type < this->_type)) { second = this; local_24 = other; } first = local_24; local_40.y = (second->_pos).y - (local_24->_pos).y; local_40.x = (second->_pos).x - (local_24->_pos).x; local_1c = local_24->_size + second->_size; fVar3 = local_40.y * local_40.y + local_40.x * local_40.x; if (fVar3 < local_1c * local_1c) { dy = local_40.y; dx = local_40.x; local_28 = sqrtf(fVar3); bVar1 = entity_collision_classes_match(first,second); if (bVar1 == 0) { first->_collidesWithEntity = second->_type != 2; second->_collidesWithEntity = first->_type != 2; if (0.0001 <= local_28) { local_38.y = (first->_velocity).y - (second->_velocity).y; local_38.x = (first->_velocity).x - (second->_velocity).x; local_30.y = local_38.x; local_20 = local_38.y; fVar3 = sqrtf(local_38.y * local_38.y + local_38.x * local_38.x); if ((local_1c * 0.5 < fVar3) && (dy * local_20 + dx * local_30.y < 0.0)) { relVelocityDir = Vector::Normalized(&local_38,&local_30); deltaDir = Vector::Normalized(&local_40,&local_38); fVar3 = relVelocityDir->y * deltaDir->y + relVelocityDir->x * deltaDir->x; fVar2 = fVar3 * dy; fVar3 = fVar3 * dx; dy = fVar2 + fVar2 + dy; dx = dx + fVar3 + fVar3; local_28 = sqrtf(dy * dy + dx * dx); first = local_24; } local_24 = (Entity *)IsCollisionIgnored(first,second); fVar3 = IsCollisionIgnored(second,first); local_24 = (Entity *)((float)local_24 / (fVar3 + (float)local_24)); local_1c = (local_1c - local_28) / local_28; local_20 = 1.0 - (float)local_24; if ((first->_type == 1) || ((first->_type == 3 && (first->_variant == 0x43)))) { local_40.x = -dx * local_20 * local_1c; local_40.y = -dy * local_20 * local_1c; bVar1 = is_grid_collision_at(first,&local_40); if (bVar1 != 0) { local_24 = (Entity *)0x3f800000; local_20 = 0.0; } } if (first->_type == 1) { local_20 = local_20 * 0.5; } fVar3 = (second->_velocity).y - (first->_velocity).y; fVar2 = (second->_velocity).x - (first->_velocity).x; local_30.y = sqrtf(fVar3 * fVar3 + fVar2 * fVar2); local_38.y = (dx / local_28) * local_30.y; local_28 = (dy / local_28) * local_30.y; if ((((first->_type == 0x393) && (first->_variant == 1)) && (second->_type == 0x393)) && (second->_variant == 1)) { rngResult = Random(); fVar3 = local_30.y * 0.05 + 0.2; if (1.2 <= fVar3) { fVar3 = 1.2; } SoundEffects::PlayWithFartOverride2 (0x1e7,unused,2,0, (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9,fVar3); } beastDamping = 0.25; game = g_game; fVar3 = local_28; fVar2 = local_38.y; pushDirX = dx; pushDirY = dy; if ((first->_flags & 0x40000000) == 0) { bVar1 = Room::IsBeastDungeon(g_game->_room); if ((bVar1 == 0) || (first->_type != 1)) { (first->_pos).x = (first->_pos).x - pushDirX * local_20 * local_1c; (first->_pos).y = (first->_pos).y - pushDirY * local_20 * local_1c; beastDamping = 0.25; (first->_velocity).x = (first->_velocity).x - fVar2 * local_20; (first->_velocity).y = (first->_velocity).y - fVar3 * local_20; game = extraout_EDX; } else { (first->_velocity).x = (first->_velocity).x - fVar2 * beastDamping * local_20; (first->_velocity).y = (first->_velocity).y - fVar3 * beastDamping * local_20; game = extraout_EDX; } } if ((second->_flags & 0x40000000) == 0) { bVar1 = Room::IsBeastDungeon(game->_room); if ((bVar1 == 0) || (second->_type != 1)) { (second->_pos).x = pushDirX * (float)local_24 * local_1c + (second->_pos).x; (second->_pos).y = pushDirY * (float)local_24 * local_1c + (second->_pos).y; } else { fVar2 = fVar2 * beastDamping; fVar3 = fVar3 * beastDamping; } (second->_velocity).y = fVar3 * (float)local_24 + (second->_velocity).y; (second->_velocity).x = fVar2 * (float)local_24 + (second->_velocity).x; } } return 1; } } return 0; } //@@ 006b2ee0 Entity::collide_with_entity /* DB: ECX/EDX = the two entities: when both _sizeMulti (0x374/0x378) are (1,1) runs the circle push-apart FUN_006b2940 (distance < sum of sizes, entity_collision_classes_match), else the ellipse variant FUN_006b25b0; called by Entity_Familiar::ai_pickup_sack and FamiliarAI::bumbo against the pickup they touch */ void __thiscall Entity::collide_with_entity(Entity *this) { Entity *in_EDX; if (((((this->_sizeMulti).x == g_vectorOne.x) && ((this->_sizeMulti).y == g_vectorOne.y)) && ((in_EDX->_sizeMulti).x == g_vectorOne.x)) && ((in_EDX->_sizeMulti).y == g_vectorOne.y)) { push_apart_circle(this,in_EDX); return; } push_apart_capsule(this,in_EDX); return; } //@@ 006b2f50 Entity::ForceCollide /* ZHL [exact] static cleanup bool Entity::ForceCollide(Entity* boom, Entity *collider, bool low); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ byte __cdecl Entity::ForceCollide(Entity *boom,Entity *collider,byte low) { byte bVar1; byte bVar2; g_forceCollideDepth = g_forceCollideDepth + 1; if (low == 0) { bVar1 = entity_collision_classes_match(boom,collider); g_forceCollideDepth = g_forceCollideDepth + -1; return bVar1; } bVar1 = (**(code **)(*(int *)boom + 0x5c))(collider,1); bVar2 = (**(code **)(*(int *)collider + 0x5c))(boom,0); g_forceCollideDepth = g_forceCollideDepth + -1; return bVar2 | bVar1; } //@@ 006b2fa0 Entity::SetColor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 15] */ void __thiscall Entity::SetColor(Entity *this,float *param_2,float param_3,std_vector *param_4,undefined4 param_5, undefined4 param_6) { float fVar1; float fVar2; float fVar3; char isShare; undefined1 isFadeout; byte isStatusShared; undefined4 extraout_EDX; int *insertPos; undefined1 auStack_5c [4]; float colorOffsetZ; float *color; std_vector *local_50; std_vector *local_4c; float fStack_48; float fStack_44; float fStack_40; float local_3c; float fStack_38; float fStack_34; float fStack_30; float local_2c; undefined4 uStack_28; float local_24; float local_20; float local_1c; undefined4 local_18; undefined1 local_14; char local_13; uint local_c; undefined8 colorOffsetXY; void **colorParamsEnd; int *paramsEnd; ColorMod *spriteColor; void *topParams; local_c = __security_cookie ^ (uint)auStack_5c; color = param_2; isShare = (char)param_6; if ((int)param_3 < 1) { if (&this->_color != (ColorMod *)param_2) { fVar1 = param_2[1]; fVar2 = param_2[2]; fVar3 = param_2[3]; (this->_color)._tint[0] = *param_2; (this->_color)._tint[1] = fVar1; (this->_color)._tint[2] = fVar2; (this->_color)._tint[3] = fVar3; fVar1 = param_2[5]; fVar2 = param_2[6]; fVar3 = param_2[7]; (this->_color)._colorize[0] = param_2[4]; (this->_color)._colorize[1] = fVar1; (this->_color)._colorize[2] = fVar2; (this->_color)._colorize[3] = fVar3; *(undefined8 *)(this->_color)._offset = *(undefined8 *)(param_2 + 8); (this->_color)._offset[2] = param_2[10]; } (**(code **)(*(int *)this + 0x60))(); } else { colorOffsetZ = param_2[10]; local_4c = (std_vector *)*param_2; fStack_48 = param_2[1]; fStack_44 = param_2[2]; fStack_40 = param_2[3]; local_3c = param_2[4]; fStack_38 = param_2[5]; fStack_34 = param_2[6]; fStack_30 = param_2[7]; colorOffsetXY = *(undefined8 *)(param_2 + 8); isFadeout = (undefined1)param_5; local_20 = param_3; local_1c = param_3; insertPos = (this->_colorParams)._begin; local_18._0_2_ = CONCAT11(isShare,isFadeout); paramsEnd = (this->_colorParams)._end; local_50 = param_4; local_2c = (float)colorOffsetXY; uStack_28 = (undefined4)((ulonglong)colorOffsetXY >> 0x20); for (; (insertPos != paramsEnd && (*insertPos < (int)param_4)); insertPos = insertPos + 0xf) { } local_24 = colorOffsetZ; if (paramsEnd == (this->_colorParams)._capacity) { FUN_006b8160(insertPos,&local_50); } else if (insertPos == paramsEnd) { *paramsEnd = (int)param_4; *(undefined8 *)(paramsEnd + 9) = colorOffsetXY; paramsEnd[0xb] = (int)colorOffsetZ; paramsEnd[1] = (int)local_4c; paramsEnd[2] = (int)fStack_48; paramsEnd[3] = (int)fStack_44; paramsEnd[4] = (int)fStack_40; paramsEnd[5] = (int)local_3c; paramsEnd[6] = (int)fStack_38; paramsEnd[7] = (int)fStack_34; paramsEnd[8] = (int)fStack_30; *(undefined1 *)(paramsEnd + 0xe) = isFadeout; paramsEnd[0xc] = (int)param_3; paramsEnd[0xd] = (int)param_3; *(char *)((int)paramsEnd + 0x39) = isShare; colorParamsEnd = &(this->_colorParams)._end; *colorParamsEnd = (void *)((int)*colorParamsEnd + 0x3c); } else { fStack_48 = *param_2; fStack_44 = param_2[1]; fStack_40 = param_2[2]; local_3c = param_2[3]; local_50 = &this->_colorParams; local_4c = param_4; local_20 = param_2[10]; fStack_38 = param_2[4]; fStack_34 = param_2[5]; fStack_30 = param_2[6]; local_2c = param_2[7]; local_18 = param_3; uStack_28 = (undefined4)*(undefined8 *)(param_2 + 8); local_24 = (float)((ulonglong)*(undefined8 *)(param_2 + 8) >> 0x20); local_14 = isFadeout; local_13 = isShare; FUN_004b7020(paramsEnd + -0xf); colorParamsEnd = &(this->_colorParams)._end; *colorParamsEnd = (void *)((int)*colorParamsEnd + 0x3c); FUN_004b6e40(extraout_EDX); FUN_004b6fc0(&local_4c); param_2 = color; } topParams = (this->_colorParams)._begin; spriteColor = &(this->_sprite)._color; if (spriteColor != (ColorMod *)((int)topParams + 4)) { fVar1 = *(float *)((int)topParams + 8); fVar2 = *(float *)((int)topParams + 0xc); fVar3 = *(float *)((int)topParams + 0x10); spriteColor->_tint[0] = *(float *)((int)topParams + 4); (this->_sprite)._color._tint[1] = fVar1; (this->_sprite)._color._tint[2] = fVar2; (this->_sprite)._color._tint[3] = fVar3; fVar1 = *(float *)((int)topParams + 0x18); fVar2 = *(float *)((int)topParams + 0x1c); fVar3 = *(float *)((int)topParams + 0x20); (this->_sprite)._color._colorize[0] = *(float *)((int)topParams + 0x14); (this->_sprite)._color._colorize[1] = fVar1; (this->_sprite)._color._colorize[2] = fVar2; (this->_sprite)._color._colorize[3] = fVar3; *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)topParams + 0x24); (this->_sprite)._color._offset[2] = *(float *)((int)topParams + 0x2c); } } isStatusShared = DoesEntityShareStatus(this); if (((isStatusShared != 0) && (isShare != '\0')) && (this->_child != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_child + 0x3c))(param_2,param_3,param_4,param_5,param_6); } return; } //@@ 006b31b0 spawn_gibs /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (gibFlags*,entity,color/pos,vel,scale) spawns effects 0x3b,0x3a,4,5,0x23,0xa3 with Random; damage/death callers prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl spawn_gibs(Vector *position,int amount,float spread,uint *gibFlags,Entity *spawner,ColorMod *color, Vector *velocity,float scale) { uint *puVar1; double dVar2; code *pcVar3; undefined4 uVar4; float fVar5; qword qVar6; Game *pGVar7; Vector *pVVar8; ColorMod *pCVar9; uint uVar10; Entity *pEVar11; int *piVar12; Entity *pEVar13; uint uVar14; ColorMod *pCVar15; int iVar16; uint uVar17; int *unaff_ESI; float fVar18; undefined1 *subType; float fVar19; float local_168; undefined1 *local_164; float local_160; float local_15c; int *local_158; float local_154; Vector *local_150; float local_14c; Entity *local_148; float local_144; Vector local_140; ColorMod *local_138; Vector local_134; Vector local_12c; undefined1 *local_124; Vector VStack_120; Vector VStack_118; Vector VStack_110; Vector VStack_108; Vector VStack_100; Vector VStack_f8; Vector VStack_f0; Vector VStack_e8; Vector VStack_e0; Vector VStack_d8; Color CStack_d0; ColorMod CStack_9c; ColorMod CStack_70; float local_44; undefined1 *local_40; uint local_3c; uint local_38; uint local_30; uint local_2c; undefined1 *local_28; undefined1 *local_24; undefined1 *local_18; uint local_c; pGVar7 = g_game; local_c = __security_cookie ^ (uint)&local_168; local_148 = spawner; local_138 = color; if (amount != 0) { local_140.x = 3.22299e-44; local_15c = (float)amount; local_154 = spread; local_150 = position; std::set::find_node(&local_12c,&local_140); local_164 = local_124; if ((local_124[0xd] != '\0') || (0x17 < *(int *)(local_124 + 0x10))) { local_164 = (pGVar7->_seedEffects)._seedEffects; } local_140.x = (float)(pGVar7->_seedEffects)._seedEffects; uVar17 = *gibFlags; local_168 = (float)((byte)*gibFlags & 1); local_14c = (float)(uVar17 >> 1 & 1); local_144 = (float)(uVar17 >> 2 & 1); local_158 = (int *)(uVar17 >> 5 & 1); local_160 = (float)(uVar17 >> 0xb & 1); uVar10 = Random(); iVar16 = 1; if (local_164 != (undefined1 *)local_140.x) { iVar16 = 8; } local_140.x = (float)(iVar16 * (int)local_15c + (uVar10 & 1)); local_15c = (float)((int)local_158 + (int)local_168 + (int)local_14c + (int)local_144 + (int)local_160 + (uVar17 >> 8 & 1) + (uVar17 >> 7 & 1)); if (local_15c == 0.0) { fVar18 = local_140.x; } else { fVar18 = (float)((int)local_140.x / (int)local_15c); } memset(&local_44,0,0x38); fVar18 = (float)((int)fVar18 + 1); if ((*gibFlags & 1) != 0) { if (fVar18 == 0.0) { uVar17 = 0; fVar19 = 0.0; } else { uVar17 = Random(); local_168 = (float)(uVar17 % (uint)fVar18); uVar17 = Random(); uVar17 = uVar17 % (uint)fVar18; fVar19 = local_168; } local_44 = (float)((int)fVar19 + uVar17); } uVar17 = *gibFlags; if ((uVar17 >> 1 & 1) != 0) { local_164 = (undefined1 *)((int)fVar18 / 2); if (local_164 == (undefined1 *)0x0) { uVar10 = 0; } else { uVar10 = Random(); uVar17 = *gibFlags; uVar10 = uVar10 % (uint)local_164; } local_40 = local_164 + uVar10; } if ((uVar17 >> 2 & 1) != 0) { if (fVar18 == 0.0) { local_3c = 0; } else { local_3c = Random(); uVar17 = *gibFlags; local_3c = local_3c % (uint)fVar18; } } if ((uVar17 >> 3 & 1) != 0) { local_168 = 4.2039e-45; if ((int)fVar18 < 3) { local_168 = fVar18; } if (local_168 == 0.0) { local_38 = 0; } else { local_38 = Random(); uVar17 = *gibFlags; local_38 = local_38 % (uint)local_168; } } if ((uVar17 >> 5 & 1) != 0) { if (fVar18 == 0.0) { local_30 = 0; } else { local_30 = Random(); uVar17 = *gibFlags; local_30 = local_30 % (uint)fVar18; } } if ((uVar17 >> 6 & 1) != 0) { if (fVar18 == 0.0) { local_2c = 0; } else { local_2c = Random(); uVar17 = *gibFlags; local_2c = local_2c % (uint)fVar18; } } if ((uVar17 >> 7 & 1) != 0) { local_164 = (undefined1 *)((int)fVar18 / 2); if (local_164 == (undefined1 *)0x0) { uVar10 = 0; } else { uVar10 = Random(); uVar17 = *gibFlags; uVar10 = uVar10 % (uint)local_164; } local_28 = local_164 + uVar10; } if ((uVar17 >> 8 & 1) != 0) { local_164 = (undefined1 *)((int)fVar18 / 2); if (local_164 == (undefined1 *)0x0) { uVar10 = 0; } else { uVar10 = Random(); uVar17 = *gibFlags; uVar10 = uVar10 % (uint)local_164; } local_24 = local_164 + uVar10; } if ((uVar17 >> 0xb & 1) != 0) { local_164 = (undefined1 *)((int)fVar18 / 2); if (local_164 == (undefined1 *)0x0) { uVar10 = 0; } else { uVar10 = Random(); uVar17 = *gibFlags; uVar10 = uVar10 % (uint)local_164; } local_18 = local_164 + uVar10; } if (((uVar17 >> 0xc & 1) != 0) && (uVar17 = (int)fVar18 / 2, uVar17 != 0)) { uVar10 = Random(); pVVar8 = local_150; local_160 = (float)(uVar10 % uVar17 + uVar17); if (0 < (int)local_160) { do { uVar17 = Random(); local_168 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; local_144 = sin(local_168); uVar17 = Random(); local_14c = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 5.0; fVar18 = cos(local_168); local_140.x = fVar18 * local_14c; local_140.y = local_144 * local_14c; uVar17 = Random(); uVar10 = Random(); local_168 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; local_144 = sin(local_168); uVar10 = Random(); local_14c = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 20.0; fVar18 = cos(local_168); local_134.x = fVar18 * local_14c + pVVar8->x; local_134.y = local_144 * local_14c + pVVar8->y; pEVar11 = Game::SpawnEx(g_game,1000,0x3b,&local_134,&local_140,local_148,0,uVar17,0); piVar12 = (int *)__RTDynamicCast(pEVar11,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor ,0); local_164 = (undefined1 *)0x3f800000; if (((float)piVar12[0xd0] - pVVar8->y) * -local_140.x + ((float)piVar12[0xcf] - pVVar8->x) * local_140.y < 0.0) { local_164 = &DAT_bf800000; } local_158 = piVar12; uVar17 = Random(); piVar12[0x11d] = (int)(((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_164); uVar17 = Random(); iVar16 = uVar17 % 0xf + 0xf; piVar12[0x117] = iVar16; piVar12[0x118] = iVar16; pcVar3 = *(code **)(*piVar12 + 0x3c); uVar17 = Random(); CStack_d0._tint[0] = 1.0; CStack_d0._tint[1] = 1.0; CStack_d0._tint[2] = 1.0; CStack_d0._offset[0] = 0.0; CStack_d0._offset[1] = 0.0; CStack_d0._offset[2] = 0.0; CStack_d0._colorize[0] = 0.0; CStack_d0._colorize[1] = 0.0; CStack_d0._colorize[2] = 0.0; CStack_d0._colorize[3] = 0.0; CStack_d0._tint[3] = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; (*pcVar3)(&CStack_d0,0xffffffff,0xff,0,1); (**(code **)(*unaff_ESI + 0xc))(); local_160 = (float)((int)local_160 - 1); } while (local_160 != 0.0); } } if (local_15c != 0.0) { local_164 = (undefined1 *)0x0; do { local_140.x = (&CStack_70)[1]._tint[(int)local_164]; subType = local_164; if (0 < (int)local_140.x) { do { uVar17 = Random(); local_158 = (int *)(((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0) * scale); if (subType == (undefined1 *)0x5) { uVar17 = Random(); uVar10 = Random(); local_160 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_160 = local_160 + local_160; uVar10 = Random(); local_15c = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos(local_160); local_134.x = fVar18 * (float)local_158 + local_15c * velocity->x; fVar18 = sin(local_160); local_134.y = fVar18 * 0.5 * (float)local_158 + local_15c * velocity->y; uVar10 = Random(); local_168 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; fVar18 = cos(local_168); VStack_120.x = fVar18 * 0.5 * local_154 + local_150->x; fVar18 = sin(local_168); VStack_120.y = fVar18 * 0.5 * local_154 + local_150->y; pEVar11 = Game::SpawnEx(g_game,1000,0x3a,&VStack_120,&local_134,local_148,0,uVar17,0); pEVar13 = (Entity *) __RTDynamicCast(pEVar11,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0 ); } else if (subType == (undefined1 *)0x6) { uVar17 = Random(); uVar10 = Random(); uVar14 = Random(); local_15c = (float)((double)(int)uVar14 + __uint_to_double_fixup[-((int)uVar14 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_15c = local_15c + local_15c; uVar14 = Random(); local_160 = (float)((double)(int)uVar14 + __uint_to_double_fixup[-((int)uVar14 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos(local_15c); VStack_118.x = fVar18 * (float)local_158 + local_160 * velocity->x; fVar18 = sin(local_15c); VStack_118.y = fVar18 * 0.5 * (float)local_158 + local_160 * velocity->y; uVar14 = Random(); local_168 = (float)((double)(int)uVar14 + __uint_to_double_fixup[-((int)uVar14 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; fVar18 = cos(local_168); VStack_110.x = fVar18 * 0.5 * local_154 + local_150->x; fVar18 = sin(local_168); VStack_110.y = fVar18 * 0.5 * local_154 + local_150->y; pEVar11 = Game::SpawnEx(g_game,1000,0x3f,&VStack_110,&VStack_118,local_148,uVar10 & 1, uVar17,0); pEVar13 = (Entity *) __RTDynamicCast(pEVar11,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0 ); uVar17 = Random(); (pEVar13->_posOffset).x = 0.0; (pEVar13->_posOffset).y = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * -40.0; subType = local_164; } else if (subType == (undefined1 *)0x7) { Random(); Random(); Random(); Random(); uVar17 = Random(); uVar10 = Random(); local_15c = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_15c = local_15c + local_15c; uVar10 = Random(); local_160 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos(local_15c); VStack_108.x = fVar18 * (float)local_158 + local_160 * velocity->x; fVar18 = sin(local_15c); VStack_108.y = fVar18 * 0.5 * (float)local_158 + local_160 * velocity->y; uVar10 = Random(); local_168 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; fVar18 = cos(local_168); VStack_100.x = fVar18 * 0.5 * local_154 + local_150->x; fVar18 = sin(local_168); VStack_100.y = fVar18 * 0.5 * local_154 + local_150->y; pEVar11 = Game::SpawnEx(g_game,1000,4,&VStack_100,&VStack_108,local_148,0x10001,uVar17 ,0); pEVar13 = (Entity *) __RTDynamicCast(pEVar11,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0 ); (**(code **)(*(int *)pEVar13 + 0xc))(); } else { uVar17 = Random(); if (subType == (undefined1 *)0x8) { local_168 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; local_144 = sin(local_168); uVar17 = Random(); local_14c = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos(local_168); VStack_f0.x = fVar18 * local_14c * 0.5 * local_154 + local_150->x; VStack_f0.y = local_144 * local_14c * 0.5 * local_154 + local_150->y; uVar17 = Random(); local_168 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; local_158 = (int *)sin(local_168); uVar17 = Random(); local_14c = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; local_168 = cos(local_168); local_168 = local_168 * local_14c; local_158 = (int *)((float)local_158 * local_14c); uVar17 = Random(); fVar18 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10; VStack_f8.y = fVar18 * velocity->y + (float)local_158; VStack_f8.x = fVar18 * velocity->x + local_168; uVar17 = Random(); pEVar13 = Game::SpawnEx(g_game,1000,0x23,&VStack_f0,&VStack_f8,local_148,0,uVar17,0) ; (**(code **)(*(int *)pEVar13 + 0x3c))(&DAT_00c5cfe0,0xffffffff,0xff,0,1); } else if (subType == (undefined1 *)0xb) { local_15c = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_15c = local_15c + local_15c; uVar17 = Random(); local_160 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos(local_15c); pVVar8 = local_150; VStack_e0.x = fVar18 * local_160 * 0.5 * local_154 + local_150->x; fVar18 = sin(local_15c); VStack_e0.y = fVar18 * local_160 * 0.5 * local_154 + pVVar8->y; uVar17 = Random(); local_15c = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_15c = local_15c + local_15c; uVar17 = Random(); local_160 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; uVar17 = Random(); local_158 = (int *)((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10); fVar18 = cos(local_15c); VStack_e8.x = fVar18 * local_160 + (float)local_158 * velocity->x; fVar18 = sin(local_15c); VStack_e8.y = fVar18 * local_160 + (float)local_158 * velocity->y; uVar17 = Random(); pEVar13 = Game::SpawnEx(g_game,1000,0xa3,&VStack_e0,&VStack_e8,local_148,0,uVar17,0) ; } else { uVar10 = Random(); local_15c = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_15c = local_15c + local_15c; uVar10 = Random(); local_160 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; fVar18 = cos(local_15c); VStack_d8.x = fVar18 * (float)local_158 + local_160 * velocity->x; fVar18 = sin(local_15c); VStack_d8.y = fVar18 * 0.5 * (float)local_158 + local_160 * velocity->y; uVar10 = Random(); local_168 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_168 = local_168 + local_168; fVar18 = cos(local_168); local_12c.x = fVar18 * 0.5 * local_154 + local_150->x; fVar18 = sin(local_168); pEVar11 = local_148; local_12c.y = fVar18 * 0.5 * local_154 + local_150->y; pEVar13 = Game::SpawnEx(g_game,1000,5,&local_12c,&VStack_d8,local_148,(uint)subType, uVar17,0); pEVar13 = (Entity *) __RTDynamicCast(pEVar13,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor, 0); pCVar9 = local_138; if ((pEVar11 == (Entity *)0x0) || ((pEVar11->_flags & 0x40) == 0)) { (**(code **)(*(int *)pEVar13 + 0x3c))(local_138,0xffffffff,0xff,0,1); if (&pEVar13->_splatColor != pCVar9) { fVar18 = pCVar9->_tint[1]; fVar19 = pCVar9->_tint[2]; fVar5 = pCVar9->_tint[3]; (pEVar13->_splatColor)._tint[0] = pCVar9->_tint[0]; (pEVar13->_splatColor)._tint[1] = fVar18; (pEVar13->_splatColor)._tint[2] = fVar19; (pEVar13->_splatColor)._tint[3] = fVar5; fVar18 = pCVar9->_colorize[1]; fVar19 = pCVar9->_colorize[2]; fVar5 = pCVar9->_colorize[3]; (pEVar13->_splatColor)._colorize[0] = pCVar9->_colorize[0]; (pEVar13->_splatColor)._colorize[1] = fVar18; (pEVar13->_splatColor)._colorize[2] = fVar19; (pEVar13->_splatColor)._colorize[3] = fVar5; *(undefined8 *)(pEVar13->_splatColor)._offset = *(undefined8 *)pCVar9->_offset; fVar18 = pCVar9->_offset[2]; goto LAB_006b4458; } } else { CStack_70._tint[0] = 1.0; CStack_70._tint[1] = 1.0; CStack_70._tint[2] = 1.0; CStack_70._tint[3] = 1.0; CStack_70._offset[0] = 0.0; CStack_d0._offset[2] = local_138->_offset[2]; CStack_70._colorize[0] = 0.3; CStack_70._colorize[1] = 1.6; CStack_70._colorize[2] = 0.0; CStack_70._colorize[3] = 1.0; CStack_d0._tint[0] = local_138->_tint[0]; CStack_d0._tint[1] = local_138->_tint[1]; CStack_d0._tint[2] = local_138->_tint[2]; CStack_d0._tint[3] = local_138->_tint[3]; CStack_70._offset[1] = 0.0; CStack_70._offset[2] = 0.0; CStack_d0._colorize[0] = local_138->_colorize[0]; CStack_d0._colorize[1] = local_138->_colorize[1]; CStack_d0._colorize[2] = local_138->_colorize[2]; CStack_d0._colorize[3] = local_138->_colorize[3]; CStack_d0._offset._0_8_ = *(undefined8 *)local_138->_offset; Color::__mul(&CStack_d0,&CStack_70); CStack_9c._tint[0] = CStack_d0._tint[0]; CStack_9c._tint[1] = CStack_d0._tint[1]; CStack_9c._tint[2] = CStack_d0._tint[2]; CStack_9c._tint[3] = CStack_d0._tint[3]; CStack_9c._offset[2] = CStack_d0._offset[2]; CStack_9c._colorize[0] = CStack_d0._colorize[0]; CStack_9c._colorize[1] = CStack_d0._colorize[1]; CStack_9c._colorize[2] = CStack_d0._colorize[2]; CStack_9c._colorize[3] = CStack_d0._colorize[3]; pCVar15 = &CStack_9c; if (local_164 != (undefined1 *)0x0) { pCVar15 = pCVar9; } CStack_9c._offset[0] = CStack_d0._offset[0]; CStack_9c._offset[1] = CStack_d0._offset[1]; (**(code **)(*(int *)pEVar13 + 0x3c))(pCVar15,0xffffffff,0xff,0,1); if (&pEVar13->_splatColor != &CStack_9c) { (pEVar13->_splatColor)._tint[0] = CStack_9c._tint[0]; (pEVar13->_splatColor)._tint[1] = CStack_9c._tint[1]; (pEVar13->_splatColor)._tint[2] = CStack_9c._tint[2]; (pEVar13->_splatColor)._tint[3] = CStack_9c._tint[3]; (pEVar13->_splatColor)._colorize[0] = CStack_9c._colorize[0]; (pEVar13->_splatColor)._colorize[1] = CStack_9c._colorize[1]; (pEVar13->_splatColor)._colorize[2] = CStack_9c._colorize[2]; (pEVar13->_splatColor)._colorize[3] = CStack_9c._colorize[3]; *(undefined8 *)(pEVar13->_splatColor)._offset = CStack_9c._offset._0_8_; fVar18 = CStack_9c._offset[2]; LAB_006b4458: (pEVar13->_splatColor)._offset[2] = fVar18; } } subType = local_164; if (local_164 == (undefined1 *)0x1) { uVar4 = *(undefined4 *)((int)&pEVar13->_flags + 4); *(uint *)&pEVar13->_flags = (uint)pEVar13->_flags | 0x10000; *(undefined4 *)((int)&pEVar13->_flags + 4) = uVar4; } } } if ((*gibFlags >> 0xd & 1) != 0) { piVar12 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if (((piVar12 != (int *)0x0) && (piVar12[2] == 0x10)) && (*piVar12 == 0x23)) { uVar17 = Random(); fVar18 = pEVar13->_speedMultiplier; dVar2 = __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]; (pEVar13->_velocity).x = fVar18 * 0.0 + (pEVar13->_velocity).x; (pEVar13->_velocity).y = (-10.0 - (float)((double)(int)uVar17 + dVar2) * 2.3283064e-10 * 10.0) * fVar18 + (pEVar13->_velocity).y; } uVar17 = Random(); qVar6 = pEVar13->_flags; fVar18 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 + 2.0; fVar19 = fVar18 * g_vectorOne.y; fVar18 = fVar18 * g_vectorOne.x; puVar1 = (uint *)((int)&pEVar13->_flags + 4); *puVar1 = *puVar1 | 0x800000; (pEVar13->_sprite)._scale.y = fVar19; *(int *)&pEVar13->_flags = (int)qVar6; (pEVar13->_sprite)._scale.x = fVar18; } (**(code **)(*(int *)pEVar13 + 0xc))(); local_140.x = (float)((int)local_140.x + -1); } while (local_140.x != 0.0); } local_164 = (undefined1 *)((int)subType + 1); } while ((int)local_164 < 0xe); } } return; } //@@ 006b45c0 Entity::BloodExplode /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Entity:BloodExplode prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity::BloodExplode(Entity *this) { void *pvVar1; ANM2 *pAVar2; char cVar3; byte bVar4; uint uVar5; Entity *pEVar6; LayerState *layer; uint rngValue; int iVar7; Manager *manager; int *unaff_EDI; float fVar8; float fVar9; int timeout; undefined1 auStack_98 [4]; int iStack_94; Entity *pEStack_90; Entity *pEStack_8c; float fStack_88; float gibSpeed; Vector gibVelocity; Vector VStack_78; float dropVelX; float dropVelY; Vector dropVelocity; KColor bloodColor; KColor baseBloodColor; ColorMod tmpColor; uint local_c; code *setColorFn; local_c = __security_cookie ^ (uint)auStack_98; if ((this->_flags & 0x4000000000000) != 0) { cVar3 = (**(code **)(*(int *)this + 0x4c))(); if ((cVar3 == '\0') && (*(char *)((int)this->_config + 0x2c) == '\0')) { uVar5 = Random(); manager = g_manager; iStack_94 = 0x1f0; pEStack_90 = (Entity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); seed_fart_sound_override(&iStack_94); SoundEffects::Play(&manager->_sfxManager,iStack_94,1.0,2,0,(float)pEStack_90,0.0); tmpColor._tint[0] = 0.8; tmpColor._tint[1] = 0.8; tmpColor._tint[2] = 0.8; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 0.3; tmpColor._colorize[0] = 1.0; tmpColor._colorize[1] = 1.0; tmpColor._colorize[2] = 1.0; tmpColor._colorize[3] = 0.5; tmpColor._offset[1] = 0.5; tmpColor._offset[2] = 0.8; uVar5 = Random(); pEStack_90 = (Entity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10); uVar5 = Random(); Game::SpawnParticles (g_game,&this->_pos,0x23,(uVar5 & 3) + 3,(float)pEStack_90 + (float)pEStack_90 + 3.0 ,&tmpColor,100000.0,0); return; } } if ((this->_flags & 0x2000000000000) != 0) { uVar5 = Random(); manager = g_manager; iStack_94 = 0x1f2; pEStack_90 = (Entity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); seed_fart_sound_override(&iStack_94); SoundEffects::Play(&manager->_sfxManager,iStack_94,1.0,2,0,(float)pEStack_90,0.0); manager = g_manager; iStack_94 = 0x89; seed_fart_sound_override(&iStack_94); SoundEffects::Play(&manager->_sfxManager,iStack_94,1.0,2,0,1.0,0.0); tmpColor._tint[0] = 0.8; tmpColor._tint[1] = 0.8; tmpColor._tint[2] = 0.8; tmpColor._tint[3] = 1.0; tmpColor._offset[0] = 0.3; tmpColor._colorize[0] = 1.0; tmpColor._colorize[1] = 1.0; tmpColor._colorize[2] = 1.0; tmpColor._colorize[3] = 0.5; tmpColor._offset[1] = 0.5; tmpColor._offset[2] = 0.8; uVar5 = Random(); Game::SpawnParticles (g_game,&this->_pos,4,*(int *)((int)this->_config + 0x5c) + uVar5 % 3,5.0,&tmpColor, 100000.0,0); return; } iVar7 = this->_type; if ((iVar7 == 0x33e) && (this->_variant == 10)) { iStack_94 = 500; LAB_006b4a8f: manager = g_manager; seed_fart_sound_override(&iStack_94); fVar9 = 1.0; LAB_006b4abc: SoundEffects::Play(&manager->_sfxManager,iStack_94,fVar9,2,0,1.0,0.0); } else { uVar5 = *(uint *)((int)this->_config + 0x60); if ((uVar5 >> 0xb & 1) != 0) { iStack_94 = 0x1f8; goto LAB_006b4a8f; } if ((0 < this->_freezeCountdown) || ((uVar5 & 0x180) != 0)) { iStack_94 = 0x89; goto LAB_006b4a8f; } bVar4 = IsEnemy(this); manager = g_manager; if ((bVar4 != 0) && (*(int *)&this[3].field_0x40 == 0xc)) { iStack_94 = 0x1e; goto LAB_006b4a8f; } uVar5 = *(uint *)((int)this->_config + 0x60); if ((uVar5 >> 9 & 1) != 0) { iStack_94 = 0xcf; seed_fart_sound_override(&iStack_94); fVar9 = 1.8; goto LAB_006b4abc; } if ((uVar5 >> 10 & 1) != 0) { iStack_94 = 0x1b; goto LAB_006b4a8f; } if ((uVar5 >> 0xd & 1) != 0) { iStack_94 = 0x8d; goto LAB_006b4a8f; } if ((uVar5 >> 4 & 1) != 0) { if (((((this->_dead == 0) || (*(char *)((int)this->_config + 0x2c) == '\0')) || (iVar7 == 0x2e)) || (((iVar7 == 0x2f || (iVar7 == 0x30)) || ((iVar7 == 0x31 || ((iVar7 == 0x32 || (iVar7 == 0x33)))))))) || (iVar7 == 0x34)) { LAB_006b4a23: manager = g_manager; iStack_94 = 0x1c; seed_fart_sound_override(&iStack_94); fVar9 = 1.25; goto LAB_006b4abc; } iStack_94 = 0x8d; goto LAB_006b4a8f; } bVar4 = HasEntityFlags(this,0x80000000000000); pvVar1 = this->_config; if (bVar4 == 0) { LAB_006b4a5a: if (*(int *)((int)pvVar1 + 0x5c) < 1) goto LAB_006b4a6a; fVar9 = 1.0; } else { if (0 < *(int *)((int)pvVar1 + 0x5c)) { if ((*(uint *)((int)pvVar1 + 0x60) & 1) != 0) goto LAB_006b4a23; goto LAB_006b4a5a; } LAB_006b4a6a: fVar9 = 0.8; } play_sound_with_fart_seed(0x1e,fVar9,2,0,1.0); } manager = g_manager; if ((this->_type == 0x3d) && (this->_variant == 5)) { iStack_94 = 0x1ec; seed_fart_sound_override(&iStack_94); SoundEffects::Play(&manager->_sfxManager,iStack_94,1.0,2,0,1.0,0.0); uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,1000,0x79,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 1.0; pEStack_90 = pEVar6; (**(code **)(*(int *)pEVar6 + 0x3c))(&tmpColor,0xffffffff,0xff,0,1); fVar9 = g_vectorOne.x; fVar8 = g_vectorOne.y * 0.75; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[8] = '\x03'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar6[1]._sprite; (pAVar2->_filename)._buf[0xc] = '\x03'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (pEVar6->_sprite)._scale.y = fVar8; *(undefined4 *)&pEVar6[1].field_0x44 = 3; (pEVar6->_sprite)._scale.x = fVar9 * 0.75; (pEVar6->_posOffset).x = 0.0; (pEVar6->_posOffset).y = -10.0; if ((pEVar6->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar6->_sprite)._animState,1.0); } uVar5 = g_graphicsManager_flags; layer = ANM2::GetLayer(&pEStack_90->_sprite,(byte *)0x0); iVar7 = 1; if ((uVar5 & 4) == 0) { iVar7 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar7; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; } iStack_94 = *(int *)((int)this->_config + 0x5c); if (iStack_94 < 1) { VStack_78.x = *(float *)&this->_flags; uVar5 = *(uint *)((int)&this->_flags + 4); LAB_006b4d1e: pEStack_90 = (Entity *)(uVar5 & 0x800000); if (pEStack_90 == (Entity *)0x0) goto LAB_006b4cca; iStack_94 = iStack_94 * 2; LAB_006b4d45: uVar5 = *(uint *)((int)this->_config + 0x60); } else { uVar5 = *(uint *)((int)&this->_flags + 4); if ((uVar5 & 0x800) == 0) { VStack_78.x = *(float *)&this->_flags; goto LAB_006b4d1e; } iVar7 = (int)(iStack_94 + (iStack_94 >> 0x1f & 3U)) >> 2; iStack_94 = 1; if (1 < iVar7) { iStack_94 = iVar7; } if ((this->_flags & 0x80000000000000) != 0) goto LAB_006b4d45; LAB_006b4cca: gibVelocity.y = 0.0; gibVelocity.x = 0.0; uVar5 = *(uint *)((int)this->_config + 0x60); iVar7 = iStack_94; fVar9 = 1.0; if ((uVar5 >> 0xd & 1) == 0) goto LAB_006b523c; } iVar7 = iStack_94; gibVelocity.y = 0.0; gibVelocity.x = 0.0; if ((uVar5 >> 0xd & 1) == 0) { gibSpeed = 2.0; if (8 < iStack_94) { timeout = 6; goto LAB_006b4d65; } } else { gibSpeed = 4.0; timeout = 0x18; LAB_006b4d65: Game::ShakeScreen(g_game,timeout); } pvVar1 = (this->_damageEvents)._begin; if (pvVar1 != (this->_damageEvents)._end) { pEStack_8c = (Entity *)((this->_pos).y - *(float *)((int)pvVar1 + 0x24)); fStack_88 = (this->_pos).x - *(float *)((int)pvVar1 + 0x20); fVar9 = sqrtf((float)pEStack_8c * (float)pEStack_8c + fStack_88 * fStack_88); gibVelocity.x = fStack_88; pEVar6 = pEStack_8c; if (0.0 < fVar9) { gibVelocity.x = fStack_88 * (1.0 / fVar9); pEVar6 = (Entity *)((float)pEStack_8c * (1.0 / fVar9)); } gibVelocity.x = gibVelocity.x * 16.0; gibVelocity.y = (float)pEVar6 * 16.0; } if ((6 < iVar7) && ((*(byte *)((int)this->_config + 0x60) & 1) != 0)) { fStack_88 = (float)(iVar7 / 2); if (fStack_88 == 0.0) { uVar5 = 0; } else { uVar5 = Random(); uVar5 = uVar5 % (uint)fStack_88; } fStack_88 = (float)((int)fStack_88 + uVar5); baseBloodColor._unk = 0; baseBloodColor._red = 0.61960787; baseBloodColor._green = 0.043137256; baseBloodColor._blue = 0.05882353; baseBloodColor._alpha = 1.0; ::Color::apply_to_kcolor(&bloodColor,&this->_splatColor,&baseBloodColor); if (0 < (int)fStack_88) { do { uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; pEStack_8c = (Entity *)(fVar9 + fVar9); uVar5 = Random(); pEStack_90 = (Entity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0); dropVelX = cos((float)pEStack_8c); dropVelX = dropVelX * (float)pEStack_90; dropVelocity.x = dropVelX; dropVelY = sin((float)pEStack_8c); dropVelY = dropVelY * (float)pEStack_90; dropVelocity.y = dropVelY; uVar5 = Random(); rngValue = Random(); fVar9 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; pEStack_90 = (Entity *)(fVar9 + fVar9); rngValue = Random(); pEStack_8c = (Entity *) ((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar9 = cos((float)pEStack_90); VStack_78.x = fVar9 * (float)pEStack_8c + (this->_pos).x; fVar9 = sin((float)pEStack_90); VStack_78.y = fVar9 * (float)pEStack_8c + (this->_pos).y; pEVar6 = Game::SpawnEx(g_game,1000,0x3b,&VStack_78,&dropVelocity,this,0,uVar5,0); pEStack_90 = (Entity *)0x3f800000; if (((pEVar6->_pos).y - (this->_pos).y) * -dropVelX + ((pEVar6->_pos).x - (this->_pos).x) * dropVelY < 0.0) { pEStack_90 = (Entity *)&DAT_bf800000; } pEStack_8c = pEVar6; uVar5 = Random(); iVar7 = *(int *)pEVar6; *(float *)(pEVar6[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)pEStack_90; setColorFn = *(code **)(iVar7 + 0x3c); uVar5 = Random(); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[0] = bloodColor._red; tmpColor._tint[1] = bloodColor._green; tmpColor._tint[2] = bloodColor._blue; tmpColor._tint[3] = ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.25 + 0.1) * bloodColor._alpha; (*setColorFn)(&tmpColor,0xffffffff,0xff,0,1); if ((*(uint *)((int)this->_config + 0x60) >> 0xd & 1) == 0) { uVar5 = Random(); iVar7 = uVar5 % 0xf + 0xf; unaff_EDI[0x117] = iVar7; unaff_EDI[0x118] = iVar7; } else { uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; fVar8 = fVar9 + fVar9 + 2.0; fVar9 = fVar8 * g_vectorOne.x; unaff_EDI[0x3a] = (int)(fVar8 * g_vectorOne.y); unaff_EDI[0x39] = (int)fVar9; uVar5 = Random(); iVar7 = uVar5 % 0x1e + 0x14; unaff_EDI[0x117] = iVar7; unaff_EDI[0x118] = iVar7; unaff_EDI[0xd8] = (int)((float)unaff_EDI[0xd8] * 4.0); unaff_EDI[0xd9] = (int)((float)unaff_EDI[0xd9] * 4.0); } (**(code **)(*unaff_EDI + 0xc))(); fStack_88 = (float)((int)fStack_88 + -1); } while (fStack_88 != 0.0); fStack_88 = 0.0; iVar7 = iStack_94; } } fVar9 = gibSpeed; LAB_006b523c: spawn_gibs(&this->_pos,iVar7,this->_size,(uint *)((int)this->_config + 0x60),this, &this->_splatColor,&gibVelocity,fVar9); if (((this->_type != 4) && (this->_type != 5)) && ((this->_flags & 0x10000) == 0)) { uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); (**(code **)(*(int *)pEVar6 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); bVar4 = Game::IsInTimedSet(g_game,0x17); if (bVar4 != 0) { (pEVar6->_sprite)._scale.x = 2.0; (pEVar6->_sprite)._scale.y = 2.0; } (**(code **)(*(int *)pEVar6 + 0xc))(); } return; } //@@ 006b5320 Entity_Tear::reroll_hit_entity /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Entity_Tear::HandleCollision when tear flags & DAT_00c34670 (bit 81) hit a vulnerable non-boss enemy: EntityFactory::Create replacement + EntityList::AddEntity, Game::ShouldEraseEnemy -> RemoveWithPoof, rerolls pickups via ItemPool::GetTrinket/GetCardEx/GetPill, lua pre_entity_spawn */ void __thiscall Entity_Tear::reroll_hit_entity(Entity_Tear *this) { code *pcVar1; Game *pGVar2; longlong lVar3; longlong lVar4; char cVar5; byte isErased; Vector *foundPos; Entity *tmpEntity; uint uVar6; uint uVar7; int *piVar8; int unusedArg; void *pvVar9; uint uVar10; int iVar11; PlayerManager *playerManager; bool bVar12; float dy; float dx; ulonglong timeNs; undefined1 auStack_c4 [4]; uint spawnSubType; uint local_bc; int *local_b8; Vector newPos; EntityPtr *local_ac; Entity *local_a8; Game *local_a4; uint local_a0; uint spawnType; uint spawnVariant; uint spawnSeed; int local_90 [3]; Entity_Tear *local_84; int iStack_80; int iStack_7c; Vector freeTilePos [2]; undefined8 rngShifts; undefined4 local_60; undefined1 local_5c [8]; int local_54; Vector randomPos; undefined4 poofColor; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; float local_20; RNG cardRng; uint local_c; EntityPtr *spawnerPtr; ColorMod *spriteColor; local_c = __security_cookie ^ (uint)auStack_c4; iVar11 = 0x20; local_84 = this; do { newPos.x = g_vectorZero.x; newPos.y = g_vectorZero.y; foundPos = Room::GetRandomPosition(g_game->_room,&randomPos,0.0); newPos.x = foundPos->x; newPos.y = foundPos->y; foundPos = Room::FindFreeTilePosition(g_game->_room,freeTilePos,&newPos,0.0); newPos.x = foundPos->x; newPos.y = foundPos->y; dx = newPos.x - (this->_pos).x; dy = newPos.y - (this->_pos).y; if ((400.0 < dy * dy + dx * dx) && (tmpEntity = Game::GetNearestTargetPlayer(&newPos,(Entity *)this,0,0,(void *)0x0,5000.0), dx = (tmpEntity->_pos).x - newPos.x, dy = (tmpEntity->_pos).y - newPos.y, 6400.0 < dy * dy + dx * dx)) break; iVar11 = iVar11 + -1; newPos.x = g_vectorZero.x; newPos.y = g_vectorZero.y; } while (-1 < iVar11); if ((newPos.x == g_vectorZero.x) && (newPos.y == g_vectorZero.y)) { return; } uVar6 = Random(); local_38 = 0; uStack_34 = 0; uStack_30 = 0; uStack_2c = 0; poofColor = 0x3f800000; uStack_44 = 0x3f800000; uStack_40 = 0x3f800000; uStack_3c = 0x3f800000; local_28 = 0x3e808081; uStack_24 = 0x3eb2b2b3; local_20 = 0.5019608; tmpEntity = Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6,0); spriteColor = &(tmpEntity->_sprite)._color; if (spriteColor != (ColorMod *)&poofColor) { spriteColor->_tint[0] = 1.0; (tmpEntity->_sprite)._color._tint[1] = 1.0; (tmpEntity->_sprite)._color._tint[2] = 1.0; (tmpEntity->_sprite)._color._tint[3] = 1.0; (tmpEntity->_sprite)._color._colorize[0] = 0.0; (tmpEntity->_sprite)._color._colorize[1] = 0.0; (tmpEntity->_sprite)._color._colorize[2] = 0.0; (tmpEntity->_sprite)._color._colorize[3] = 0.0; *(ulonglong *)(tmpEntity->_sprite)._color._offset = CONCAT44(uStack_24,local_28); (tmpEntity->_sprite)._color._offset[2] = local_20; } spawnSeed = Random(); local_a4 = g_game; spawnSubType = 0; spawnVariant = 0xf; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&newPos,&g_vectorZero,(Entity *)0x0, (int *)&spawnSubType,&spawnSeed); uVar6 = spawnVariant; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_006b57d9: local_bc = spawnSubType; } else { piVar8 = (g_game->_deathmatchManager)._type; local_b8 = piVar8; uVar7 = Random(); uVar10 = spawnSubType; rngShifts = 0x900000005; local_a8 = (Entity *)0x7; local_60 = 7; if (spawnType != 5) goto LAB_006b57d9; if (uVar6 < 0x12d) { if (uVar6 == 300) { while ((local_bc = spawnSubType, spawnSubType == 0 || (cVar5 = (**(code **)(*piVar8 + 0x24))(spawnSubType), cVar5 != '\0'))) { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = uVar7 >> ((byte)rngShifts & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)local_a8 & 0x1f) ^ uVar7; iVar11 = ItemPool::GetCardEx(uVar7,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar7; spawnSubType = lua_callback_run_get_card(&cardRng,iVar11,1,1,0); } } else { if (uVar6 == 0x46) { local_a0 = spawnSubType >> 0xb; do { local_bc = spawnSubType; if (spawnSubType != 0) { pcVar1 = *(code **)(*piVar8 + 0x28); iVar11 = ItemPool::GetPillEffect(&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0) ; cVar5 = (*pcVar1)(iVar11); if (cVar5 == '\0') goto LAB_006b57e1; piVar8 = local_b8; } if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = uVar7 >> ((byte)rngShifts & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)local_a8 & 0x1f) ^ uVar7; spawnSubType = ItemPool::GetPill(uVar7); spawnSubType = spawnSubType | (local_a0 & 1) << 0xb; } while( true ); } if (uVar6 != 100) goto LAB_006b57d9; local_bc = spawnSubType; if (spawnSubType == 0x19) { LAB_006b5635: bVar12 = false; } else { local_a0 = spawnSubType; std::set::find_node(local_5c,&local_a0); if (((*(char *)(local_54 + 0xd) == '\0') && (*(int *)(local_54 + 0x10) <= (int)uVar10)) && (local_54 != piVar8[8])) goto LAB_006b5635; bVar12 = true; } if ((uVar10 == 0) || (bVar12)) { spawnSubType = (**(code **)(*piVar8 + 0x84))(0); local_bc = spawnSubType; } } } else { if (uVar6 != 0x15e) goto LAB_006b57d9; while ((local_bc = spawnSubType, spawnSubType == 0 || (cVar5 = (**(code **)(*piVar8 + 0x2c))(spawnSubType), cVar5 != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_006b57e1: local_a8 = EntityFactory::Create(local_a4->_entityFactory,spawnType,0); if (local_a8 == (Entity *)0x0) goto LAB_006b5ab6; timeNs = GetTimeNs(); tmpEntity = local_a8; uVar6 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_ac = (EntityPtr *)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar6 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); local_90[0] = (int)(lVar4 + lVar3); lVar3 = (ulonglong)uVar6 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (uint)(&local_ac->field_0x0 + CARRY4((uint)lVar3,(uint)lVar4))), (int)((ulonglong)(lVar4 + lVar3) >> 0x20)); local_90[2] = (int)((ulonglong)lVar3 >> 0x20); spawnerPtr = &local_a8->_spawnerEntity; local_b8 = (int *)((uint)lVar3 >> 0x12 | local_90[2] * 0x4000); local_90[2] = (uint)local_90[2] >> 0x12; local_a8->_spawnerType = 0; local_a8->_spawnerVariant = 0; if (*spawnerPtr != (EntityPtr)0x0) { local_ac = spawnerPtr; std::multiset::erase(&local_ac); } iVar11 = *(int *)tmpEntity; *spawnerPtr = (EntityPtr)0x0; (tmpEntity->_pos).x = newPos.x; (tmpEntity->_pos).y = newPos.y; (tmpEntity->_velocity).x = g_vectorZero.x; (tmpEntity->_velocity).y = g_vectorZero.y; (**(code **)(iVar11 + 4))(spawnType,spawnVariant,local_bc,spawnSeed); pGVar2 = local_a4; pvVar9 = local_a4->_room; iVar11 = *(int *)((int)pvVar9 + 0x1214); *(int *)((int)pvVar9 + 0x1214) = iVar11 + 1; tmpEntity->_index = iVar11; EntityList::AddEntity((EntityList *)((int)pvVar9 + 0x1218),tmpEntity); isErased = Game::ShouldEraseEnemy(tmpEntity); if (isErased != 0) { Entity::RemoveWithPoof(tmpEntity,unusedArg); } if ((tmpEntity->_exists != 0) && ((pGVar2->_proceduralItemManager)._proceduralItems._begin != (pGVar2->_proceduralItemManager)._proceduralItems._end)) { iStack_7c = tmpEntity->_variant; iStack_80 = tmpEntity->_type; std::map::find(&local_a4,&iStack_80); pGVar2 = (pGVar2->_proceduralItemManager)._spawnTriggerTargets._head; if (local_a4 == pGVar2) { local_90[0] = tmpEntity->_type; local_90[1] = 0xffffffff; piVar8 = (int *)std::map::find(&local_bc,local_90); local_a4 = (Game *)*piVar8; if (local_a4 == pGVar2) goto LAB_006b5a32; } uVar6 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar9 = (playerManager->_playerList)._end; if ((int)pvVar9 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar9 = (playerManager->_playerList)._end; } piVar8 = (playerManager->_playerList)._begin; if (uVar6 < (uint)((int)pvVar9 - (int)piVar8 >> 2)) { piVar8 = piVar8 + uVar6; } trigger_set_dispatch((void *)(*piVar8 + 0x1fc8),6,tmpEntity,&newPos,&g_vectorZero); uVar6 = uVar6 + 1; playerManager = &g_game->_playerManager; } while (uVar6 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_006b5a32: timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar7 = (uint)((ulonglong)lVar4 >> 0x20); uVar6 = (int)((ulonglong)lVar3 >> 0x20) + (uint)CARRY4((uint)lVar3,(uint)lVar4); lVar3 = (ulonglong)uVar10 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar7,uVar6),uVar7 + uVar6); uVar7 = (uint)((ulonglong)lVar3 >> 0x20); uVar6 = (uint)lVar3 >> 0x12 | uVar7 * 0x4000; uVar10 = uVar6 - (int)local_b8; bVar12 = CARRY4((uint)g_entitySpawnTimeMs,uVar10); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar10; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar7 >> 0x12) - local_90[2]) - (uint)(uVar6 < local_b8)) + (uint)bVar12; LAB_006b5ab6: spriteColor = &(local_a8->_sprite)._color; if (spriteColor != (ColorMod *)&poofColor) { (local_a8->_sprite)._color._colorize[0] = 0.0; (local_a8->_sprite)._color._colorize[1] = 0.0; (local_a8->_sprite)._color._colorize[2] = 0.0; (local_a8->_sprite)._color._colorize[3] = 0.0; (local_a8->_sprite)._color._offset[0] = 0.2509804; (local_a8->_sprite)._color._offset[1] = 0.34901962; spriteColor->_tint[0] = 1.0; (local_a8->_sprite)._color._tint[1] = 1.0; (local_a8->_sprite)._color._tint[2] = 1.0; (local_a8->_sprite)._color._tint[3] = 1.0; (local_a8->_sprite)._color._offset[2] = 0.5019608; } (local_84->_pos).x = newPos.x; (local_84->_pos).y = newPos.y; return; } //@@ 006b5b50 EntityPtr::SetReference /* DB: release old ref (004cf210), store entity, add ref (004cdcf0) prototype: db/protos.zhl */ void __fastcall EntityPtr::SetReference(EntityPtr *ptr,Entity *entity) { EntityPtr *local_8; local_8 = ptr; if (*ptr != (EntityPtr)0x0) { std::multiset::erase(&local_8); } *ptr = (EntityPtr)entity; if (entity != (Entity *)0x0) { std::multiset::insert(ptr); } return; } //@@ 006b5b90 Entity::IsActiveEnemy /* ZHL [exact] __thiscall bool Entity::IsActiveEnemy(bool includeDead); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity::IsActiveEnemy(Entity *this,byte includeDead) { int iVar1; bool bVar2; if ((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 1)) { iVar1 = this->_type; if (0x3dd < iVar1 - 10U) { return 0; } if (iVar1 == 0x21) { return 0; } if (iVar1 == 0x11) { return 0; } if (iVar1 == 0x124) { return 0; } if (iVar1 == 0x375) { bVar2 = this->_variant == 10; } else { if (iVar1 == 0x3c0) { return 0; } if (iVar1 == 0x3c5) { return 0; } bVar2 = iVar1 == 0xf5; } if (bVar2) { return 0; } } if ((this->_dead == 0) || (includeDead != 0)) { return 1; } return 0; } //@@ 006b5c10 Entity::AddShrink /* ZHL [exact] __thiscall void Entity::AddShrink(const EntityRef& ref, int duration, bool ignoreBossStatusCooldown, bool unk); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity::AddShrink(Entity *this,EntityRef *ref,int duration,byte ignoreBossStatusCooldown,byte unk) { int iVar1; uint uVar2; undefined4 uVar3; EntityPtr EVar4; qword qVar5; EntityPtr EVar6; byte bVar7; char cVar8; Entity_NPC *this_00; int iVar9; int extraout_EDX; EntityPtr this_01; if (((unk != 0) || (bVar7 = IsDamageSourceFriendly(this,ref), bVar7 == 0)) && (cVar8 = (**(code **)(*(int *)this + 0x4c))(), cVar8 == '\0')) { apply_second_hand_duration(this,duration,ref); bVar7 = DoesEntityShareStatus(this); this_01 = (EntityPtr)this; if (bVar7 != 0) { EVar6 = this->_parent; while (EVar4 = EVar6, EVar4 != (EntityPtr)0x0) { this_01 = EVar4; EVar6 = *(EntityPtr *)((int)EVar4 + 0x3bc); } } qVar5 = ((Entity *)this_01)->_flags; if ((unk != 0) || (((extraout_EDX != 0 && ((qVar5 & 1) == 0)) && ((((Entity *)this_01)->_bossStatusEffectCooldown < 1 || (ignoreBossStatusCooldown != 0)))))) { iVar1 = ((Entity *)this_01)->_shrinkCountdown; if (extraout_EDX < 1) { iVar9 = iVar1; if (iVar1 < -extraout_EDX) { iVar9 = -extraout_EDX; } } else { iVar9 = 0x96; if (iVar1 + extraout_EDX < 0x96) { iVar9 = iVar1 + extraout_EDX; } } ((Entity *)this_01)->_shrinkCountdown = iVar9; uVar2 = (uint)((Entity *)this_01)->_flags; if ((uVar2 & 0x1000000) == 0) { uVar3 = *(undefined4 *)((int)&((Entity *)this_01)->_flags + 4); *(uint *)&((Entity *)this_01)->_flags = uVar2 | 0x1000000; *(undefined4 *)((int)&((Entity *)this_01)->_flags + 4) = uVar3; ((Entity *)this_01)->_shrinkStatus2 = 0.333; SetSize(this,*(float *)((int)this->_config + 0x38) * this->_shrinkStatus1, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); } if ((ignoreBossStatusCooldown == 0) && (cVar8 = FUN_006ae7a0(), cVar8 != '\0')) { ((Entity *)this_01)->_bossStatusEffectCooldown = 0xf0; } CopyStatusEffects((Entity *)this_01); if ((((0 < ((Entity *)this_01)->_shrinkCountdown) && ((qVar5 & 0x1000800) == 0)) && (bVar7 = IsEnemy((Entity *)this_01), bVar7 != 0)) && (this_00 = (Entity_NPC *) __RTDynamicCast(this_01,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), this_00 != (Entity_NPC *)0x0)) { Entity_NPC::ResetPathFinderTarget(this_00); } } } return; } //@@ 006b5de0 FUN_006b5de0 void FUN_006b5de0(void) { int in_ECX; if (0 < *(int *)(in_ECX + 0x23c)) { *(uint *)(in_ECX + 0x168) = *(uint *)(in_ECX + 0x168) | 0x1000000; *(undefined4 *)(in_ECX + 0x16c) = *(undefined4 *)(in_ECX + 0x16c); *(undefined4 *)(in_ECX + 0x3b4) = *(undefined4 *)(in_ECX + 0x3b8); } return; } //@@ 006b5e20 Entity_NPC::hold_set /* DB: NPC field 0x3f0 = max(it, ticks), 0x3f4/0x3f8 = spot: holds it in place (Emergency Contact, 150) (trinkets-cards) */ void __thiscall Entity_NPC::hold_set(Entity_NPC *this,int param_2,float *param_3) { int *piVar1; piVar1 = ¶m_2; if (param_2 < this->_holdCountdown) { piVar1 = &this->_holdCountdown; } this->_holdCountdown = *piVar1; (this->_holdPosition).x = *param_3; (this->_holdPosition).y = param_3[1]; return; } //@@ 006b5e60 Entity::GetData /* ZHL [lua] Lua binding Entity:GetData */ undefined4 * __thiscall Entity::GetData(Entity *this,undefined4 *param_2) { int iVar1; void *luaState; undefined4 *this_00; undefined4 uVar2; this_00 = this->_luaBridgeRef; if (this_00 == (undefined4 *)0x0) { this_00 = operator_new(8); if (this_00 == (undefined4 *)0x0) { this_00 = (undefined4 *)0x0; } else { uVar2 = *(undefined4 *)((int)g_luaEngine + 0x18); lua_createtable(uVar2,0,0); *this_00 = uVar2; uVar2 = luaL_ref(uVar2,0xfff0b9d8); this_00[1] = uVar2; } this->_luaBridgeRef = this_00; } iVar1 = this_00[1]; luaState = (void *)*this_00; *param_2 = luaState; if (iVar1 == -1) { param_2[1] = 0xffffffff; return param_2; } LuaRef::push(this_00,luaState); uVar2 = luaL_ref(*this_00,0xfff0b9d8); param_2[1] = uVar2; return param_2; } //@@ 006b5f10 Entity::GetDebugShape /* DB: DebugRenderer::Get(this+0x20) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall Entity::GetDebugShape(Entity *this,byte isUnknown) { void *pvVar1; pvVar1 = DebugRenderer::Get(&g_game->_debugRenderer,this->_index,isUnknown); return pvVar1; } //@@ 006b5f40 FUN_006b5f40 void FUN_006b5f40(void) { Entity *in_ECX; *(uint *)&in_ECX->_flags = (uint)in_ECX->_flags & 0xfeffffff; *(undefined4 *)((int)&in_ECX->_flags + 4) = *(undefined4 *)((int)&in_ECX->_flags + 4); Entity::SetSize(in_ECX,*(float *)((int)in_ECX->_config + 0x38), (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); in_ECX->_shrinkStatus2 = 1.0; return; } //@@ 006b5fd0 Entity_Player::get_grid_collision_at /* DB: ? (pos): grid index from pos (40px cells, -40/-120 origin) on g_game->_room, Room::GetGridCollision with player special cases (IsHologram, HasInstantDeathCurse, GetHealthType); Entity::PlayerCollideWithGrid treats result 4 like out-of-room */ uint Entity_Player::get_grid_collision_at(float *param_1) { Room *this; char cVar1; byte bVar2; uint uVar3; uint gridIndex; float *gridPos; Entity_Player *in_ECX; Entity_Player *this_00; int gridRow; int iVar4; float roundBias; float dy; float dx; float gridOriginY; undefined1 gridPosOut [4]; int gridColumn; void *roomPtr; this = g_game->_room; iVar4 = (int)((*param_1 - 40.0) / 40.0 + 0.5); gridRow = (int)((param_1[1] - 120.0) / 40.0 + 0.5); if ((((iVar4 < 0) || (this->_gridWidth <= iVar4)) || (gridRow < 0)) || (this->_gridHeight <= gridRow)) { iVar4 = -1; } else { iVar4 = this->_gridWidth * gridRow + iVar4; } uVar3 = Room::GetGridCollision(this,iVar4); roundBias = 0.5; if (uVar3 == 3) { gridColumn = (int)((*param_1 - 40.0) / 40.0 + 0.5); if (-1 < gridColumn) { gridOriginY = 120.0; roomPtr = g_game->_room; if ((((gridColumn < *(int *)((int)roomPtr + 0xc)) && (iVar4 = (int)((param_1[1] - 120.0) / 40.0 + 0.5), -1 < iVar4)) && ((iVar4 < *(int *)((int)roomPtr + 0x10) && ((gridIndex = *(int *)((int)roomPtr + 0xc) * iVar4 + gridColumn, gridIndex < 0x1c0 && (iVar4 = *(int *)((int)roomPtr + gridIndex * 4 + 0x24), iVar4 != 0)))))) && (*(int *)(iVar4 + 4) == 0xe)) { if (*(int *)(iVar4 + 8) - 7U < 4) { gridPos = (float *)FUN_00718d20(gridPosOut); if (1444.0 < (param_1[1] - gridPos[1]) * (param_1[1] - gridPos[1]) + (*param_1 - *gridPos) * (*param_1 - *gridPos)) { uVar3 = 0; } } else { dx = *param_1 - ((float)(*(int *)(iVar4 + 0x24) % *(int *)((int)roomPtr + 0xc)) * 40.0 + 40.0); dy = param_1[1] - ((float)(*(int *)(iVar4 + 0x24) / *(int *)((int)roomPtr + 0xc)) * 40.0 + 120.0); if (324.0 < dy * dy + dx * dx) { uVar3 = 0; } } } goto LAB_006b61a0; } } gridOriginY = 120.0; LAB_006b61a0: if ((in_ECX == (Entity_Player *)0x0) || (in_ECX->_type != 1)) { in_ECX = (Entity_Player *)0x0; } if (uVar3 == 4) { roomPtr = g_game->_room; gridColumn = (int)((*param_1 - 40.0) / 40.0 + roundBias); if ((((gridColumn < 0) || (*(int *)((int)roomPtr + 0xc) <= gridColumn)) || (iVar4 = (int)((param_1[1] - gridOriginY) / 40.0 + roundBias), iVar4 < 0)) || ((*(int *)((int)roomPtr + 0x10) <= iVar4 || (uVar3 = *(int *)((int)roomPtr + 0xc) * iVar4 + gridColumn, 0x1bf < uVar3)))) { iVar4 = 0; } else { iVar4 = *(int *)((int)roomPtr + uVar3 * 4 + 0x24); } if (in_ECX == (Entity_Player *)0x0) { return 4; } if (iVar4 == 0) { return 4; } if (*(int *)(iVar4 + 4) != 0x10) { return 4; } if ((*(uint *)(iVar4 + 0x3a0) >> 4 & 1) == 0) { return 4; } cVar1 = FUN_007103a0(); if (cVar1 == '\0') { return 4; } iVar4 = GetHealthType(in_ECX); if (((iVar4 != 2) && (bVar2 = HasInstantDeathCurse(this_00), bVar2 == 0)) && (g_game->_currentDimensionIdx != 1)) { return 4; } uVar3 = 5; } else if (uVar3 != 5) { return uVar3; } if ((((in_ECX->_variant != 0) || (in_ECX->_isCoopGhost != 0)) || (in_ECX->_parent != (EntityPtr)0x0)) || (bVar2 = IsHologram(in_ECX), bVar2 != 0)) { uVar3 = 4; } return uVar3; } //@@ 006b62b0 Entity::GetHitListIndex /* ZHL [exact] __thiscall uint32_t Entity::GetHitListIndex(); prototype: REPENTOGON, confirmed by RET 0 */ uint __thiscall Entity::GetHitListIndex(Entity *this) { int iVar1; Entity *pEVar2; if (((1 < *(int *)&g_game->_deathmatchManager) && (this->_type == 1)) || (iVar1 = this->_type, 0x3dd < iVar1 - 10U)) goto switchD_006b62ec_caseD_14; if (iVar1 < 0xd9) { if (iVar1 != 0xd8) { switch(iVar1) { case 0x13: case 0x1c: case 0x23: case 0x3e: case 0x59: break; default: goto switchD_006b62ec_caseD_14; } } if ((iVar1 == 0x59) || (iVar1 == 0x13)) goto switchD_006b62ec_caseD_14; if ((iVar1 != 0x1c) || (this->_variant != 2)) goto LAB_006b633c; } else { if (iVar1 < 0x38e) { if (((iVar1 != 0x38d) && (iVar1 != 0xef)) && ((iVar1 != 0xf4 || (this->_variant != 2)))) goto switchD_006b62ec_caseD_14; } else if ((iVar1 != 0x390) && (iVar1 != 0x396)) goto switchD_006b62ec_caseD_14; LAB_006b633c: if ((iVar1 != 0x3e) || (this->_variant != 1)) goto LAB_006b6350; } if (this->_child != (EntityPtr)0x0) { switchD_006b62ec_caseD_14: return this->_index; } LAB_006b6350: pEVar2 = GetStatusEffectTarget(this); return pEVar2->_index; } //@@ 006b63b0 Entity::GetForwardVector /* ZHL [vtable slot 22] */ float * __thiscall Entity::GetForwardVector(Entity *this,float *param_2) { float fVar1; float fVar2; float fVar3; fVar1 = (this->_velocity).y; fVar2 = (this->_velocity).x; if (fVar2 * fVar2 + fVar1 * fVar1 <= 0.01) { *param_2 = 0.0; param_2[1] = 1.0; } else { fVar2 = (this->_velocity).x; param_2[1] = (this->_velocity).y; fVar1 = param_2[1]; *param_2 = fVar2; fVar2 = *param_2; fVar3 = sqrtf(fVar1 * fVar1 + fVar2 * fVar2); if (0.0 < fVar3) { *param_2 = fVar2 * (1.0 / fVar3); param_2[1] = fVar1 * (1.0 / fVar3); return param_2; } } return param_2; } //@@ 006b6470 play_sound_with_fart_seed /* DB: applies fart-seed override then SoundEffects::Play prototype: db/protos.zhl, confirmed by RET 16 */ void play_sound_with_fart_seed(int soundId,float volume,int frameDelay,byte isLoop,float pitch) { Manager *pMVar1; undefined3 in_stack_0000000d; pMVar1 = g_manager; seed_fart_sound_override(&soundId); SoundEffects::Play(&pMVar1->_sfxManager,soundId,volume,frameDelay,(byte)_isLoop,pitch,0.0); return; } //@@ 006b64d0 Entity_NPC::MakeSplat /* ZHL [lua] Lua binding EntityNPC:MakeSplat prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Effect * __thiscall Entity_NPC::MakeSplat(Entity_NPC *this,float size) { int iVar1; uint seed; Entity *pEVar2; Entity_Effect *pEVar3; seed = Random(); pEVar2 = Game::SpawnEx(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)this,0,seed,0); pEVar3 = (Entity_Effect *) __RTDynamicCast(pEVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); iVar1 = *(int *)pEVar3; (pEVar3->_sprite)._scale.x = size; (pEVar3->_sprite)._scale.y = size; (**(code **)(iVar1 + 0xc))(); return pEVar3; } //@@ 006b6550 Entity::MakeGroundPoof /* ZHL [exact] __thiscall Entity_Effect * Entity::MakeGroundPoof(Vector * pos, ColorMod * color, float size); prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Effect * __thiscall Entity::MakeGroundPoof(Entity *this,Vector *position,ColorMod *color,float size) { int iVar1; uint uVar2; Entity *pEVar3; EntityPtr EVar4; int *unaff_EDI; float fVar5; Entity_Effect *pEVar6; float fVar7; undefined1 auStack_12 [14]; uVar2 = Random(); pEVar3 = Game::SpawnEx(g_game,1000,0x10,position,&g_vectorZero,this,1,uVar2,0); fVar7 = 1.4013e-45; iVar1 = *(int *)pEVar3; (pEVar3->_sprite)._scale.x = size; (pEVar3->_sprite)._scale.y = size; pEVar6 = (Entity_Effect *)color; (**(code **)(iVar1 + 0x3c))(); uVar2 = Random(); *(byte *)(unaff_EDI + 0x52) = ~(byte)uVar2 & 1; (**(code **)(*unaff_EDI + 0xc))(); uVar2 = Random(); EVar4 = (EntityPtr)Game::SpawnEx(g_game,1000,0x10,position,&g_vectorZero,this,2,uVar2,0); fVar5 = 1.4013e-45; iVar1 = *(int *)EVar4; ((Vector *)((int)EVar4 + 0xe4))->x = fVar7; *(float *)((int)EVar4 + 0xe8) = fVar7; (**(code **)(iVar1 + 0x3c))(color,0xffffffff,0xff,0); ((Vector *)((int)EVar4 + 0x34c))->x = 0.0; *(float *)((int)EVar4 + 0x350) = fVar5 * -40.0; uVar2 = Random(); *(byte *)((int)EVar4 + 0x148) = ~(byte)uVar2 & 1; (**(code **)(*(int *)EVar4 + 0xc))(); if (pEVar6->_child != (EntityPtr)0x0) { std::multiset::erase(auStack_12 + -0x22); } pEVar6->_child = EVar4; std::multiset::insert(&pEVar6->_child); return pEVar6; } //@@ 006b66a0 Entity::MakeGroundPoofAtSelf /* DB: MakeGroundPoof(this,&this->_pos,arg) prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Effect * __thiscall Entity::MakeGroundPoofAtSelf(Entity *this,ColorMod *color,float size) { Entity_Effect *pEVar1; pEVar1 = MakeGroundPoof(this,&this->_pos,color,size); return pEVar1; } //@@ 006b66c0 Entity::MakeBloodPoof /* ZHL [exact] __thiscall Entity_Effect * Entity::MakeBloodPoof(Vector * pos, ColorMod * color, float size); prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Effect * __thiscall Entity::MakeBloodPoof(Entity *this,Vector *position,ColorMod *color,float scale) { int iVar1; uint uVar2; Entity *pEVar3; EntityPtr EVar4; int *unaff_EDI; float fVar5; Entity_Effect *pEVar6; float fVar7; undefined1 auStack_12 [14]; uVar2 = Random(); pEVar3 = Game::SpawnEx(g_game,1000,0x10,position,&g_vectorZero,this,3,uVar2,0); fVar7 = 1.4013e-45; iVar1 = *(int *)pEVar3; (pEVar3->_sprite)._scale.x = scale; (pEVar3->_sprite)._scale.y = scale; pEVar6 = (Entity_Effect *)color; (**(code **)(iVar1 + 0x3c))(); uVar2 = Random(); *(byte *)(unaff_EDI + 0x52) = ~(byte)uVar2 & 1; (**(code **)(*unaff_EDI + 0xc))(); uVar2 = Random(); EVar4 = (EntityPtr)Game::SpawnEx(g_game,1000,0x10,position,&g_vectorZero,this,4,uVar2,0); fVar5 = 1.4013e-45; iVar1 = *(int *)EVar4; ((Vector *)((int)EVar4 + 0xe4))->x = fVar7; *(float *)((int)EVar4 + 0xe8) = fVar7; (**(code **)(iVar1 + 0x3c))(color,0xffffffff,0xff,0); ((Vector *)((int)EVar4 + 0x34c))->x = 0.0; *(float *)((int)EVar4 + 0x350) = fVar5 * -40.0; uVar2 = Random(); *(byte *)((int)EVar4 + 0x148) = ~(byte)uVar2 & 1; (**(code **)(*(int *)EVar4 + 0xc))(); if (pEVar6->_child != (EntityPtr)0x0) { std::multiset::erase(auStack_12 + -0x22); } pEVar6->_child = EVar4; std::multiset::insert(&pEVar6->_child); return pEVar6; } //@@ 006b6810 Entity::MakeBloodPoofAtPos /* DB: MakeBloodPoof(this,&_pos,arg) */ void Entity::MakeBloodPoofAtPos(ColorMod *param_1) { Entity *in_ECX; float in_XMM1_Da; MakeBloodPoof(in_ECX,&in_ECX->_pos,param_1,in_XMM1_Da); return; } //@@ 006b6830 Entity_NPC::MakeBloodCloud /* ZHL [exact] __thiscall Entity_Effect* Entity_NPC::MakeBloodCloud(Vector* pos, ColorMod * color); prototype: REPENTOGON, confirmed by RET 8 */ Entity_Effect * __thiscall Entity_NPC::MakeBloodCloud(Entity_NPC *this,Vector *pos,ColorMod *color) { int iVar1; uint uVar2; Entity_Effect *pEVar3; float in_XMM2_Da; uVar2 = Random(); pEVar3 = (Entity_Effect *)Game::Spawn(g_game,1000,0x10,pos,&g_vectorZero,(Entity *)this,5,uVar2); iVar1 = *(int *)pEVar3; (pEVar3->_sprite)._scale.x = in_XMM2_Da; (pEVar3->_sprite)._scale.y = in_XMM2_Da; (**(code **)(iVar1 + 0x3c))(color,0xffffffff,0xff,0,1); uVar2 = Random(); (pEVar3->_sprite)._flipX = ~(byte)uVar2 & 1; uVar2 = Random(); (pEVar3->_sprite)._flipY = ~(byte)uVar2 & 1; (**(code **)(*(int *)pEVar3 + 0xc))(); return pEVar3; } //@@ 006b68c0 spawn_rock_particles /* DB: spawns 8-13 EffectVariant 99 particles around pos scaled by dir, if room flag >0.2; Fissure/Big Horn */ void * spawn_rock_particles(float *param_1,float *param_2) { float *pfVar1; float fVar2; float fVar3; int iVar4; float *pfVar5; uint uVar6; void *pvVar7; Entity *pEVar8; int iVar9; float fVar10; float fVar11; float fVar12; float fVar13; float in_XMM3_Da; float local_24; Vector local_18; Vector local_10; pvVar7 = g_game->_room; if (0.2 < *(float *)((int)pvVar7 + 0x7240)) { pfVar1 = param_2 + 1; local_24 = 1.0; pfVar5 = param_2; if (*pfVar1 <= *param_2 && *param_2 != *pfVar1) { pfVar5 = pfVar1; } fVar2 = *pfVar5; if (20.0 < fVar2) { local_24 = 2.0; } uVar6 = Random(); pvVar7 = (void *)(uVar6 / 6); for (iVar9 = uVar6 % 6 + 8; iVar9 != 0; iVar9 = iVar9 + -1) { uVar6 = Random(); fVar10 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar10 = fVar10 + fVar10; fVar11 = cos(fVar10); fVar3 = *param_2; fVar12 = sin(fVar10); fVar10 = param_2[1]; uVar6 = Random(); fVar13 = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 3.0) * in_XMM3_Da; local_18.y = (fVar13 * fVar12 * fVar10) / fVar2; local_18.x = (fVar13 * fVar11 * fVar3) / fVar2; uVar6 = Random(); local_10.x = fVar11 * fVar3 + *param_1; local_10.y = fVar12 * fVar10 + param_1[1]; pEVar8 = Game::SpawnEx(g_game,1000,99,&local_10,&local_18,(Entity *)0x0,1,uVar6,0); fVar3 = (pEVar8->_sprite)._scale.y; (pEVar8->_sprite)._scale.x = local_24 * (pEVar8->_sprite)._scale.x; (pEVar8->_sprite)._scale.y = local_24 * fVar3; uVar6 = Random(); pEVar8[1]._damageEvents._end = (void *)0x3fc00000; iVar4 = *(int *)pEVar8; pEVar8[1]._damageEvents._begin = (void *)(-4.0 - (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 8.0); pvVar7 = (void *)(**(code **)(iVar4 + 0xc))(); } } return pvVar7; } //@@ 006b6af0 Entity::GetNullOffset /* ZHL [exact] __thiscall Vector Entity::GetNullOffset(const char* nullLayerName); prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Entity::GetNullOffset(Entity *this,Vector *outOffset,byte *nullLayerName) { float *pfVar1; float fVar2; float fVar3; float fVar4; float local_18; float local_14; if ((this->_sprite)._animState._animData != (void *)0x0) { pfVar1 = AnimationState::GetNullFrame(&(this->_sprite)._animState,nullLayerName); if ((pfVar1 != (float *)0x0) && (*(char *)(pfVar1 + 3) != '\0')) { local_18 = (*pfVar1 / 0.65) * (this->_sprite)._scale.x; local_14 = (pfVar1[1] / 0.65) * (this->_sprite)._scale.y; if ((this->_sprite)._flipX != 0) { local_18 = -local_18; } if ((this->_sprite)._flipY != 0) { local_14 = -local_14; } fVar2 = (this->_sprite)._rotation; if (fVar2 != 0.0) { fVar2 = fVar2 * 0.017453292; fVar3 = cos(fVar2); fVar2 = sin(fVar2); fVar4 = fVar2 * local_14; local_14 = fVar3 * local_14 + fVar2 * local_18; local_18 = fVar3 * local_18 - fVar4; } outOffset->x = local_18; outOffset->y = local_14; return outOffset; } } fVar2 = g_vectorZero.y; outOffset->x = g_vectorZero.x; outOffset->y = fVar2; return outOffset; } //@@ 006b6c20 Entity::GetNullCapsule /* ZHL [exact] __thiscall Capsule Entity::GetNullCapsule(const char* nullLayerName); prototype: db/protos.zhl, confirmed by RET 8 */ Capsule * __thiscall Entity::GetNullCapsule(Entity *this,Capsule *outCapsule,byte *nullLayerName) { float *pfVar1; float fVar2; float fVar3; float local_28; float local_24; float local_20; Vector local_18; Vector local_10; if ((this->_sprite)._animState._animData != (void *)0x0) { pfVar1 = AnimationState::GetNullFrame(&(this->_sprite)._animState,nullLayerName); if ((pfVar1 != (float *)0x0) && (*(char *)(pfVar1 + 3) != '\0')) { local_10.x = (this->_sprite)._scale.x; local_24 = (*pfVar1 / 0.65) * local_10.x; local_10.x = ((pfVar1[4] * 4.0) / 0.65) * local_10.x; local_10.y = (this->_sprite)._scale.y; local_28 = pfVar1[0x11]; local_20 = (pfVar1[1] / 0.65) * local_10.y; local_10.y = ((pfVar1[5] * 4.0) / 0.65) * local_10.y; if ((this->_sprite)._flipX != 0) { local_10.x = -local_10.x; } if ((this->_sprite)._flipY != 0) { local_10.y = -local_10.y; } if (local_10.x < 0.0) { local_10.x = -local_10.x; local_28 = 180.0 - local_28; local_24 = -local_24; } if (local_10.y < 0.0) { local_10.y = -local_10.y; local_20 = -local_20; local_28 = -local_28; } fVar2 = (this->_sprite)._rotation; if (fVar2 != 0.0) { fVar2 = fVar2 * 0.017453292; local_18.x = cos(fVar2); fVar2 = sin(fVar2); local_28 = (this->_sprite)._rotation + local_28; fVar3 = local_20 * fVar2; local_20 = local_20 * local_18.x + fVar2 * local_24; local_24 = local_18.x * local_24 - fVar3; } local_18.x = local_24 + (this->_pos).x; local_18.y = local_20 + (this->_pos).y; Capsule::constructor(outCapsule,&local_18,&local_10,local_28,1.0); return outCapsule; } } Capsule::constructor(outCapsule,&this->_pos,&g_vectorZero,0.0,0.0); return outCapsule; } //@@ 006b6e40 FUN_006b6e40 void FUN_006b6e40(float *param_1,int param_2) { float fVar1; float fVar2; int in_ECX; float fVar3; float fVar4; float in_XMM3_Da; fVar1 = *(float *)(param_2 + 0x33c); fVar2 = *(float *)(param_2 + 0x340); fVar4 = *(float *)(in_ECX + 0x33c) - fVar1; fVar3 = *(float *)(in_ECX + 0x340) - fVar2; fVar3 = sqrtf(fVar3 * fVar3 + fVar4 * fVar4); *param_1 = *(float *)(param_2 + 0x360) * fVar3 * in_XMM3_Da + fVar1; param_1[1] = *(float *)(param_2 + 0x364) * fVar3 * in_XMM3_Da + fVar2; return; } //@@ 006b6ed0 Entity::get_water_splash_variant /* DB: ? Entity::Update when room water level >0: picks effect variant (0x40/0x26/0x25/0x1b/0x19) by entity type/variant, Room::IsMirrorWorld */ undefined4 * Entity::get_water_splash_variant(undefined4 *param_1) { int iVar1; byte bVar2; Entity_Player *in_ECX; bool isBelowThreshold; bool isAtThreshold; int entityType; float offsetY; entityType = in_ECX->_type; if (entityType == 1000) { if (((in_ECX->_variant == 0x85) || (in_ECX->_variant == 0x86)) || (in_ECX->_variant == 0x8a)) goto LAB_006b6fce; if (in_ECX->_variant == 0x8e) { if (in_ECX->_subtype == 0) { *param_1 = 0x40; param_1[1] = 0; return param_1; } } else { if (in_ECX->_variant == 0x9e) goto LAB_006b70a1; if (((in_ECX->_variant == 99) || (in_ECX->_variant == 0x1e)) || (in_ECX->_variant == 0x99)) goto LAB_006b6fce; } iVar1 = in_ECX->_variant; if (((iVar1 == 0xa8) || (iVar1 == 0x10)) || ((iVar1 == 0xa1 || (iVar1 == 0xbd)))) goto LAB_006b6f7a; } else if (entityType == 7) goto LAB_006b704a; if (in_ECX->_sortingLayer == 0) { LAB_006b70a1: *param_1 = 0x26; param_1[1] = 0; return param_1; } if (in_ECX->_sortingLayer == 1) { *param_1 = 0x25; param_1[1] = 0; return param_1; } if (entityType == 5) { if (*(int *)((in_ECX->_crownOfLightSprite)._filename._buf + 4) != 0) { LAB_006b6fce: *param_1 = 0x40; param_1[1] = 0; return param_1; } } else if ((((entityType == 1000) && (in_ECX->_variant == 0xf)) && (in_ECX->_spawnerType == 0x327)) && (bVar2 = Room::IsMirrorWorld(g_game->_room), bVar2 == 0)) { *param_1 = 0x1b; param_1[1] = 0xc0000000; return param_1; } entityType = in_ECX->_type; if (((entityType == 2) || (entityType == 9)) || (entityType == 1000)) { LAB_006b704a: param_1[1] = 0x40000000; *param_1 = 0x19; return param_1; } if (entityType == 3) { if (in_ECX->_variant == 0x4f) goto LAB_006b704a; LAB_006b7131: if (entityType == 0x32f) { offsetY = (in_ECX->_posOffset).y; isAtThreshold = offsetY == 0.0; isBelowThreshold = offsetY < 0.0; LAB_006b7143: if (!isBelowThreshold && !isAtThreshold) { *param_1 = 0x24; param_1[1] = 0; return param_1; } } else if (entityType == 0x3e) { if (in_ECX->_variant == 3) { offsetY = (in_ECX->_posOffset).y; param_1[1] = 0xc0000000; if (0.0 <= offsetY) { *param_1 = 0x26; return param_1; } if (offsetY < -16.0) { *param_1 = 0x19; return param_1; } *param_1 = 0x80; return param_1; } } else if ((entityType == 1) && (bVar2 = Entity_Player::HasCollectible(in_ECX,0x3e,0), bVar2 != 0) ) { *param_1 = 0x39; param_1[1] = 0xc0000000; return param_1; } } else { if (((entityType == 0xf0) || (entityType == 0xf2)) || ((entityType == 0xf1 || (entityType == 0x130)))) goto LAB_006b6f7a; if (entityType == 0x21) { if (in_ECX->_health <= 1.0) goto LAB_006b70a1; } else { if (entityType == 0x32a) { offsetY = (in_ECX->_posOffset).y; isAtThreshold = offsetY == -3.0; isBelowThreshold = offsetY < -3.0; goto LAB_006b7143; } if (entityType == 0x32e) { *param_1 = 0x99; param_1[1] = 0; return param_1; } if ((entityType == 0x366) || (entityType == 0x367)) { *param_1 = 0x80; param_1[1] = 0; return param_1; } if (entityType != 0x331) goto LAB_006b7131; if (in_ECX->_variant == 1) goto LAB_006b6f7a; } } if (in_ECX->_type == 1) { bVar2 = IsFlying((Entity *)in_ECX); if (bVar2 != 0) { LAB_006b6f7a: param_1[1] = 0; *param_1 = 0x19; return param_1; } } else if ((((in_ECX->_type == 5) && (in_ECX->_variant == 100)) && (*(int *)((in_ECX->_crownOfLightSprite)._filename._buf + 4) == 0)) && (((in_ECX->_sprite)._overlayAnimState._animData == (void *)0x0 || ((int)(in_ECX->_sprite)._overlayAnimState._animFrame != 0)))) { param_1[1] = 0xc0a00000; *param_1 = 0x19; return param_1; } param_1[1] = 0xc0000000; *param_1 = 0x19; return param_1; } //@@ 006b7250 Entity::GetLastParent /* DB: walks +0x3c8 prototype: db/protos.zhl */ Entity * __thiscall Entity::GetLastParent(Entity *this) { EntityPtr EVar1; EVar1 = this->_spawnerEntity; if (EVar1 != (EntityPtr)0x0) { while (*(EntityPtr *)((int)EVar1 + 0x3c8) != (EntityPtr)0x0) { EVar1 = *(EntityPtr *)((int)EVar1 + 0x3c8); } } return (Entity *)EVar1; } //@@ 006b7280 Entity::AddMagnetized /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX entity, args (EntityRef source, int duration in EDX): returns on friendly source (IsDamageSourceFriendly), Second Hand duration, follows _parent chain for shared status, skips boss cooldown (0x238 > 0); _magnetizedCountdown 0x2f0 += duration capped 300, gray color tint, flag 0x80000 in +0x16c, spawns status effect 1000.57 into +0x310, stores the source EntityRef; matches REPENTOGON Entity:AddMagnetized prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddMagnetized(Entity *this,EntityRef *ref,int duration,byte unused) { uint *puVar1; qword qVar2; byte bVar3; char cVar4; uint uVar5; EntityPtr statusEffect; uint uVar6; int newCountdown; int extraout_EDX; Entity *statusOwner; EntityPtr *pEStack_68; EntityRef *savedRef; EntityRef sourceRef; ColorMod magnetColor; EntityPtr *effectParentSlot; int oldCountdown; EntityPtr parent; savedRef = ref; bVar3 = IsDamageSourceFriendly(this,ref); if (bVar3 != 0) { return; } apply_second_hand_duration(this,duration,ref); bVar3 = DoesEntityShareStatus(this); statusOwner = this; if (bVar3 != 0) { statusEffect = this->_parent; statusOwner = this; while (parent = statusEffect, parent != (EntityPtr)0x0) { statusOwner = (Entity *)parent; statusEffect = *(EntityPtr *)((int)parent + 0x3bc); } } if (extraout_EDX == 0) { return; } if ((statusOwner->_flags & 1) != 0) { return; } if (0 < statusOwner->_bossStatusEffectCooldown) { return; } oldCountdown = statusOwner->_magnetizedCountdown; if (extraout_EDX < 1) { newCountdown = oldCountdown; if (oldCountdown < -extraout_EDX) { newCountdown = -extraout_EDX; } } else { newCountdown = 300; if (oldCountdown + extraout_EDX < 300) { newCountdown = oldCountdown + extraout_EDX; } } statusOwner->_magnetizedCountdown = newCountdown; magnetColor._tint[0] = 0.6; magnetColor._tint[1] = 0.6; magnetColor._tint[2] = 0.6; magnetColor._tint[3] = 1.0; magnetColor._colorize[0] = 1.0; magnetColor._colorize[1] = 1.0; magnetColor._colorize[2] = 1.0; magnetColor._colorize[3] = 0.9; magnetColor._offset[0] = 0.0; magnetColor._offset[1] = 0.0; magnetColor._offset[2] = 0.0; (**(code **)(*(int *)statusOwner + 0x3c))(&magnetColor,statusOwner->_magnetizedCountdown,0xff,0,1) ; qVar2 = statusOwner->_flags; puVar1 = (uint *)((int)&statusOwner->_flags + 4); *puVar1 = *puVar1 | 0x80000; *(int *)&statusOwner->_flags = (int)qVar2; cVar4 = FUN_006ae7a0(); if (cVar4 != '\0') { statusOwner->_bossStatusEffectCooldown = 0xf0; } CopyStatusEffects(statusOwner); if (statusOwner->_iceFrozenEffect == (EntityPtr)0x0) { uVar5 = Random(); statusEffect = (EntityPtr) Game::SpawnEx(g_game,1000,0x39,&statusOwner->_pos,&g_vectorZero,(Entity *)0x0,0, uVar5,0); statusOwner->_iceFrozenEffect = statusEffect; effectParentSlot = (EntityPtr *)((int)statusEffect + 0x3bc); if (*(EntityPtr *)((int)statusEffect + 0x3bc) != (EntityPtr)0x0) { pEStack_68 = effectParentSlot; std::multiset::erase(&pEStack_68); } *effectParentSlot = (EntityPtr)statusOwner; std::multiset::insert(effectParentSlot); ref = savedRef; } sourceRef._entity = ref->_entity; if (sourceRef._entity == (void *)0x0) { sourceRef._type = 0; LAB_006b74a5: 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_006b74e5: sourceRef._flags = 0; if (sourceRef._entity != (void *)0x0) goto LAB_006b74eb; sourceRef._flags = 0; LAB_006b7504: uVar5 = 0; if (sourceRef._entity != (void *)0x0) goto LAB_006b750a; } else { while (*(void **)((int)sourceRef._entity + 0x3c8) != (void *)0x0) { sourceRef._entity = *(void **)((int)sourceRef._entity + 0x3c8); } sourceRef._type = *(int *)((int)sourceRef._entity + 0x28); if (sourceRef._entity == (void *)0x0) goto LAB_006b74a5; sourceRef._variant = *(int *)((int)sourceRef._entity + 0x2c); sourceRef._position.x = *(float *)((int)sourceRef._entity + 0x33c); sourceRef._position.y = *(float *)((int)sourceRef._entity + 0x340); sourceRef._spawnerType = *(int *)((int)sourceRef._entity + 0x34); sourceRef._spawnerVariant = *(int *)((int)sourceRef._entity + 0x38); sourceRef._velocity.x = *(float *)((int)sourceRef._entity + 0x360); sourceRef._velocity.y = *(float *)((int)sourceRef._entity + 0x364); if ((*(uint *)((int)sourceRef._entity + 0x168) & 0x100) == 0) goto LAB_006b74e5; sourceRef._flags = 1; LAB_006b74eb: if ((*(uint *)((int)sourceRef._entity + 0x168) & 0x20000000) == 0) goto LAB_006b7504; uVar5 = 2; LAB_006b750a: if ((*(uint *)((int)sourceRef._entity + 0x16c) & 0x400000) != 0) { uVar6 = 4; goto LAB_006b7525; } } uVar6 = 0; LAB_006b7525: sourceRef._flags = uVar6 | uVar5 | sourceRef._flags; EntityRef::operator_(&this->_entityRef3,&sourceRef); return; } //@@ 006b7560 Entity::AddBaited /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddBaited(const EntityRef& ref, int duration, bool unused); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity::AddBaited(Entity *this,EntityRef *ref,int duration,byte unused) { byte bVar1; char cVar2; uint uVar3; int newCountdown; int extraout_EDX; uint uVar4; EntityPtr statusTarget; undefined1 auStack_64 [4]; EntityRef sourceRef; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; int baitedCountdown; uint *flagsHigh; EntityPtr nextParent; qword oldFlags; EntityPtr parent; local_c = __security_cookie ^ (uint)auStack_64; bVar1 = IsDamageSourceFriendly(this,ref); if (bVar1 != 0) { return; } apply_second_hand_duration(this,duration,ref); bVar1 = DoesEntityShareStatus(this); statusTarget = (EntityPtr)this; if (bVar1 != 0) { nextParent = this->_parent; while (parent = nextParent, parent != (EntityPtr)0x0) { statusTarget = parent; nextParent = *(EntityPtr *)((int)parent + 0x3bc); } } if (extraout_EDX == 0) { return; } if ((((Entity *)statusTarget)->_flags & 1) != 0) { return; } if (0 < ((Entity *)statusTarget)->_bossStatusEffectCooldown) { return; } baitedCountdown = ((Entity *)statusTarget)->_baitedCountdown; if (extraout_EDX < 1) { newCountdown = baitedCountdown; if (baitedCountdown < -extraout_EDX) { newCountdown = -extraout_EDX; } } else { newCountdown = 300; if (baitedCountdown + extraout_EDX < 300) { newCountdown = baitedCountdown + extraout_EDX; } } ((Entity *)statusTarget)->_baitedCountdown = newCountdown; local_38 = 0x3f333333; uStack_34 = 0x3e0f5c29; uStack_30 = 0x3dcccccd; uStack_2c = 0x3f800000; local_18 = 0x3e99999a; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; local_14 = 0; local_10 = 0; (**(code **)(*(int *)statusTarget + 0x3c)) (&local_38,((Entity *)statusTarget)->_baitedCountdown,0xff,0,1); oldFlags = ((Entity *)statusTarget)->_flags; flagsHigh = (uint *)((int)&((Entity *)statusTarget)->_flags + 4); *flagsHigh = *flagsHigh | 0x100000; *(int *)&((Entity *)statusTarget)->_flags = (int)oldFlags; cVar2 = FUN_006ae7a0(); if (cVar2 != '\0') { ((Entity *)statusTarget)->_bossStatusEffectCooldown = 0xf0; } CopyStatusEffects((Entity *)statusTarget); sourceRef._entity = ref->_entity; if (sourceRef._entity == (void *)0x0) { sourceRef._type = 0; LAB_006b7715: 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_006b7755: sourceRef._flags = 0; if (sourceRef._entity != (void *)0x0) goto LAB_006b775b; sourceRef._flags = 0; LAB_006b7774: uVar4 = 0; if (sourceRef._entity != (void *)0x0) goto LAB_006b777a; } else { while (*(void **)((int)sourceRef._entity + 0x3c8) != (void *)0x0) { sourceRef._entity = *(void **)((int)sourceRef._entity + 0x3c8); } sourceRef._type = *(int *)((int)sourceRef._entity + 0x28); if (sourceRef._entity == (void *)0x0) goto LAB_006b7715; sourceRef._variant = *(int *)((int)sourceRef._entity + 0x2c); sourceRef._position.x = *(float *)((int)sourceRef._entity + 0x33c); sourceRef._position.y = *(float *)((int)sourceRef._entity + 0x340); sourceRef._spawnerType = *(int *)((int)sourceRef._entity + 0x34); sourceRef._spawnerVariant = *(int *)((int)sourceRef._entity + 0x38); sourceRef._velocity.x = *(float *)((int)sourceRef._entity + 0x360); sourceRef._velocity.y = *(float *)((int)sourceRef._entity + 0x364); if ((*(uint *)((int)sourceRef._entity + 0x168) & 0x100) == 0) goto LAB_006b7755; sourceRef._flags = 1; LAB_006b775b: if ((*(uint *)((int)sourceRef._entity + 0x168) & 0x20000000) == 0) goto LAB_006b7774; uVar4 = 2; LAB_006b777a: if ((*(uint *)((int)sourceRef._entity + 0x16c) & 0x400000) != 0) { uVar3 = 4; goto LAB_006b7795; } } uVar3 = 0; LAB_006b7795: sourceRef._flags = uVar3 | uVar4 | sourceRef._flags; EntityRef::operator_(&this->_entityRef4,&sourceRef); return; } //@@ 006b77d0 Entity::AddWeakness /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddWeakness(const EntityRef& ref, int duration); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity::AddWeakness(Entity *this,EntityRef *ref,int duration) { uint *puVar1; int iVar2; EntityPtr EVar3; qword qVar4; EntityPtr EVar5; byte bVar6; int iVar7; int extraout_EDX; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; bVar6 = IsDamageSourceFriendly(this,ref); if (bVar6 == 0) { apply_second_hand_duration(this,-3,ref); bVar6 = DoesEntityShareStatus(this); if (bVar6 != 0) { EVar5 = this->_parent; while (EVar3 = EVar5, EVar3 != (EntityPtr)0x0) { this = (Entity *)EVar3; EVar5 = *(EntityPtr *)((int)EVar3 + 0x3bc); } } if (extraout_EDX != 0) { iVar2 = this->_weaknessCountdown; if (extraout_EDX < 1) { iVar7 = iVar2; if (iVar2 < -extraout_EDX) { iVar7 = -extraout_EDX; } } else { iVar7 = 300; if (iVar2 + extraout_EDX < 300) { iVar7 = iVar2 + extraout_EDX; } } this->_weaknessCountdown = iVar7; local_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; local_24 = 0x3fa66666; uStack_20 = 0x3f666666; uStack_1c = 0x3fc00000; uStack_18 = 0x3f19999a; local_14 = 0; local_10 = 0; local_c = 0; (**(code **)(*(int *)this + 0x3c))(&local_34,this->_weaknessCountdown,0xff,0,1); qVar4 = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 | 0x400000; *(int *)&this->_flags = (int)qVar4; CopyStatusEffects(this); } } return; } //@@ 006b78d0 Entity::AddBrimstoneMark /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity::AddBrimstoneMark(const EntityRef& ref, int duration); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity::AddBrimstoneMark(Entity *this,EntityRef *ref,int duration) { int iVar1; EntityPtr EVar2; EntityPtr EVar3; byte bVar4; int iVar5; int extraout_EDX; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; bVar4 = IsDamageSourceFriendly(this,ref); if (bVar4 == 0) { apply_second_hand_duration(this,duration,ref); bVar4 = DoesEntityShareStatus(this); if (bVar4 != 0) { EVar3 = this->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } } if (extraout_EDX != 0) { iVar1 = *(int *)((int)this + 0x304); if (extraout_EDX < 1) { iVar5 = iVar1; if (iVar1 < -extraout_EDX) { iVar5 = -extraout_EDX; } } else { iVar5 = 300; if (iVar1 + extraout_EDX < 300) { iVar5 = iVar1 + extraout_EDX; } } *(int *)((int)this + 0x304) = iVar5; local_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; uStack_28 = 0x3f800000; local_24 = 0x3f800000; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0x3e4ccccd; local_14 = 0; local_10 = 0; local_c = 0; (**(code **)(*(int *)this + 0x3c))(&local_34,*(undefined4 *)((int)this + 0x304),0xff,0,1); *(uint *)((int)this + 0x16c) = *(uint *)((int)this + 0x16c) | 0x1000000; *(undefined4 *)((int)this + 0x168) = *(undefined4 *)((int)this + 0x168); CopyStatusEffects(this); } } return; } //@@ 006b79d0 Entity::AddIce /* ZHL [exact] __thiscall void Entity::AddIce(const EntityRef& ref, int duration); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity::AddIce(Entity *this,EntityRef *ref,int duration) { int iVar1; EntityPtr EVar2; EntityPtr EVar3; byte bVar4; char cVar5; int iVar6; int extraout_EDX; bVar4 = IsDamageSourceFriendly(this,ref); if ((bVar4 == 0) && (cVar5 = (**(code **)(*(int *)this + 0x4c))(), cVar5 == '\0')) { apply_second_hand_duration(this,duration,ref); bVar4 = DoesEntityShareStatus(this); if (bVar4 != 0) { EVar3 = this->_parent; while (EVar2 = EVar3, EVar2 != (EntityPtr)0x0) { this = (Entity *)EVar2; EVar3 = *(EntityPtr *)((int)EVar2 + 0x3bc); } } iVar1 = *(int *)((int)this + 0x300); if (extraout_EDX < 1) { iVar6 = iVar1; if (iVar1 < -extraout_EDX) { iVar6 = -extraout_EDX; } } else { iVar6 = 300; if (iVar1 + extraout_EDX < 300) { iVar6 = iVar1 + extraout_EDX; } } *(int *)((int)this + 0x300) = iVar6; *(uint *)((int)this + 0x16c) = *(uint *)((int)this + 0x16c) | 0x40000; *(undefined4 *)((int)this + 0x168) = *(undefined4 *)((int)this + 0x168); CopyStatusEffects(this); } return; } //@@ 006b7a80 Entity::AddKnockback /* ZHL [exact] __thiscall void Entity::AddKnockback(const EntityRef& ref, const Vector& pushDirection, int duration, bool takeImpactDamage); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity::AddKnockback (Entity *this,EntityRef *ref,Vector *pushDirection,int duration,byte takeImpactDamage) { float fVar1; uint uVar2; undefined4 uVar3; EntityPtr EVar4; EntityPtr EVar5; byte bVar6; int iVar7; int iVar8; double dVar9; float fVar10; bVar6 = IsDamageSourceFriendly(this,ref); if (bVar6 == 0) { bVar6 = DoesEntityShareStatus(this); if (bVar6 != 0) { EVar5 = this->_parent; while (EVar4 = EVar5, EVar4 != (EntityPtr)0x0) { this = (Entity *)EVar4; EVar5 = *(EntityPtr *)((int)EVar4 + 0x3bc); } } if ((duration != 0) && (((this->_flags & 1) == 0 || ((this->_flags & 0x2000000000000) != 0)))) { this->_knockbackCountdown = duration; fVar1 = pushDirection->x; (this->_knockbackDirection).x = fVar1; (this->_knockbackDirection).y = pushDirection->y; if ((10.0 < this->_mass) && ((this->_flags & 0x2000000000000) == 0)) { dVar9 = (double)this->_mass; libm_sse2_log10_precise(); fVar10 = 1.0 / (float)dVar9; (this->_knockbackDirection).x = fVar1 * fVar10; (this->_knockbackDirection).y = fVar10 * (this->_knockbackDirection).y; iVar8 = (int)((float)this->_knockbackCountdown * fVar10); iVar7 = 1; if (1 < iVar8) { iVar7 = iVar8; } this->_knockbackCountdown = iVar7; } uVar2 = *(uint *)((int)&this->_flags + 4); uVar3 = (undefined4)this->_flags; *(undefined4 *)&this->_flags = uVar3; *(uint *)((int)&this->_flags + 4) = uVar2 | 0x8000; if (takeImpactDamage != 0) { *(undefined4 *)&this->_flags = uVar3; *(uint *)((int)&this->_flags + 4) = uVar2 | 0x18000; } CopyStatusEffects(this); } } return; } //@@ 006b7be0 Entity::GiveMinecart /* ZHL [exact] __thiscall Entity_NPC* Entity::GiveMinecart(Vector* position, Vector* velocity); prototype: REPENTOGON, confirmed by RET 8 */ Entity_NPC * __thiscall Entity::GiveMinecart(Entity *this,Vector *position,Vector *velocity) { EntityPtr *pEVar1; float fVar2; Vector *pos; Vector *pVVar3; uint seed; Entity_NPC *this_00; seed = Random(); pos = position; this_00 = (Entity_NPC *)Game::Spawn(g_game,0x3c5,0,position,&g_vectorZero,(Entity *)0x0,0,seed); pVVar3 = velocity; (this_00->_v2).x = 1.0; Entity_NPC::SetMinecartPosVel(this_00,pos,velocity); (**(code **)(*(int *)this_00 + 0xc))(); fVar2 = pVVar3->y; pEVar1 = &this->_minecart; (this_00->_targetPosition).x = pVVar3->x; (this_00->_targetPosition).y = fVar2; if (*(Entity_NPC **)&pEVar1->field_0x0 != this_00) { if (*(Entity_NPC **)&pEVar1->field_0x0 != (Entity_NPC *)0x0) { position = (Vector *)pEVar1; std::multiset::erase(&position); } *(Entity_NPC **)&pEVar1->field_0x0 = this_00; std::multiset::insert(pEVar1); } pEVar1 = &this_00->_child; if (this_00->_child != (EntityPtr)0x0) { position = (Vector *)pEVar1; std::multiset::erase(&position); } *(Entity **)&pEVar1->field_0x0 = this; if (this != (Entity *)0x0) { std::multiset::insert(pEVar1); } return this_00; } //@@ 006b7cc0 FUN_006b7cc0 void FUN_006b7cc0(float *param_1) { int iVar1; float fVar2; Vector *pVVar3; int in_ECX; fVar2 = g_vectorZero.x; iVar1 = *(int *)(in_ECX + 0x3d4); if (iVar1 == 0) { param_1[1] = g_vectorZero.y; *param_1 = fVar2; return; } if (*(int *)(iVar1 + 0x7c) != 0) { pVVar3 = AnimationState::GetNullFrameById((AnimationState *)(iVar1 + 0x78),0); if (pVVar3 != (Vector *)0x0) goto LAB_006b7ce7; } pVVar3 = &g_vectorZero; LAB_006b7ce7: fVar2 = pVVar3->x; param_1[1] = pVVar3->y; *param_1 = fVar2; return; } //@@ 006b7d20 _Entity::GetAncestorField /* DB: ? ? lookup +0x14 */ int _Entity::GetAncestorField(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x14; } //@@ 006b7d40 vector_0x3c_tidy /* DB: ? std::vector _Tidy (deallocate, zero begin/end/cap) for 0x3c-byte trivially destructible elements; Entity::destructor calls it on a vector just before std::vector::_Tidy, and its unwind funclet */ void vector_0x3c_tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x3c) * 0x3c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 006b7db0 FUN_006b7db0 void FUN_006b7db0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { FUN_006b7fd0(puVar1,param_1); return; } uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; *puVar1 = *param_1; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; uVar2 = param_1[5]; uVar3 = param_1[6]; uVar4 = param_1[7]; puVar1[4] = param_1[4]; puVar1[5] = uVar2; puVar1[6] = uVar3; puVar1[7] = uVar4; uVar2 = param_1[9]; uVar3 = param_1[10]; uVar4 = param_1[0xb]; puVar1[8] = param_1[8]; puVar1[9] = uVar2; puVar1[10] = uVar3; puVar1[0xb] = uVar4; *(undefined8 *)(puVar1 + 0xc) = *(undefined8 *)(param_1 + 0xc); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x38; return; } //@@ 006b7e00 std::map::try_emplace /* DB: _Find_lower_bound on uint key; returns existing or a new 0x18-byte node with key and value byte 0 plus inserted flag; caller _Entity::GetAncestorField */ void std::map::try_emplace(int *param_1,uint *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x18); piVar6[4] = *param_2; *(undefined1 *)(piVar6 + 5) = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_006b7f41: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_006b7f41; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 006b7fd0 FUN_006b7fd0 undefined4 * FUN_006b7fd0(int param_1,undefined4 *param_2) { undefined4 *puVar1; void *pvVar2; int iVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 *puVar7; int *in_ECX; uint uVar8; uint uVar9; void *ptr; undefined4 *puVar10; int iVar11; iVar11 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x38; if (iVar3 == 0x4924924) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar9 = (in_ECX[2] - *in_ECX) / 0x38; if (0x4924924 - (uVar9 >> 1) < uVar9) { uVar8 = 0x4924924; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar8 = iVar3 + 1U; if (iVar3 + 1U <= uVar9) { uVar8 = uVar9; } if (0x4924924 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = std::_Allocate(uVar8 * 0x38); puVar1 = puVar7 + ((param_1 - iVar11) / 0x38) * 0xe; uVar4 = param_2[1]; uVar5 = param_2[2]; uVar6 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar4; puVar1[2] = uVar5; puVar1[3] = uVar6; uVar4 = param_2[5]; uVar5 = param_2[6]; uVar6 = param_2[7]; puVar1[4] = param_2[4]; puVar1[5] = uVar4; puVar1[6] = uVar5; puVar1[7] = uVar6; uVar4 = param_2[9]; uVar5 = param_2[10]; uVar6 = param_2[0xb]; puVar1[8] = param_2[8]; puVar1[9] = uVar4; puVar1[10] = uVar5; puVar1[0xb] = uVar6; *(undefined8 *)(puVar1 + 0xc) = *(undefined8 *)(param_2 + 0xc); iVar11 = *in_ECX; puVar10 = puVar7; if (param_1 != in_ECX[1]) { FUN_0041d0e0(puVar7,iVar11); puVar10 = puVar1 + 0xe; } FUN_0041d0e0(puVar10,iVar11); pvVar2 = (void *)*in_ECX; if (pvVar2 != (void *)0x0) { uVar9 = ((in_ECX[2] - (int)pvVar2) / 0x38) * 0x38; ptr = pvVar2; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar2 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + (iVar3 + 1) * 0xe); in_ECX[2] = (int)(puVar7 + uVar8 * 0xe); return puVar1; } //@@ 006b8160 FUN_006b8160 undefined4 * FUN_006b8160(int param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; uint uVar3; int iVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; void *pvVar9; int *in_ECX; uint uVar10; iVar4 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0x3c; if (iVar5 == 0x4444444) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar5 + 1; uVar3 = (in_ECX[2] - *in_ECX) / 0x3c; if (0x4444444 - (uVar3 >> 1) < uVar3) { uVar10 = 0x4444444; } else { uVar3 = (uVar3 >> 1) + uVar3; uVar10 = uVar1; if (uVar1 <= uVar3) { uVar10 = uVar3; } if (0x4444444 < uVar10) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar9 = std::_Allocate(uVar10 * 0x3c); puVar2 = (undefined4 *)((int)pvVar9 + ((param_1 - iVar4) / 0x3c) * 0x3c); *puVar2 = *param_2; uVar6 = param_2[2]; uVar7 = param_2[3]; uVar8 = param_2[4]; puVar2[1] = param_2[1]; puVar2[2] = uVar6; puVar2[3] = uVar7; puVar2[4] = uVar8; uVar6 = param_2[6]; uVar7 = param_2[7]; uVar8 = param_2[8]; puVar2[5] = param_2[5]; puVar2[6] = uVar6; puVar2[7] = uVar7; puVar2[8] = uVar8; *(undefined8 *)(puVar2 + 9) = *(undefined8 *)(param_2 + 9); puVar2[0xb] = param_2[0xb]; puVar2[0xc] = param_2[0xc]; puVar2[0xd] = param_2[0xd]; *(undefined1 *)(puVar2 + 0xe) = *(undefined1 *)(param_2 + 0xe); *(undefined1 *)((int)puVar2 + 0x39) = *(undefined1 *)((int)param_2 + 0x39); if (param_1 == in_ECX[1]) { FUN_004b6f40(pvVar9,*in_ECX); } else { FUN_004b6dc0(*in_ECX,param_1,pvVar9); FUN_004b6dc0(param_1,in_ECX[1],puVar2 + 0xf); } FUN_004b6ce0(pvVar9,uVar1,uVar10); return puVar2; } //@@ 006b82b0 Entity::SetColor /* DB: copies KColor (0x2c bytes) to this+0xd4 */ void __thiscall Entity::SetColor(Entity *this,undefined4 *param_2) { int iVar1; float fVar2; float fVar3; float fVar4; void **ppvVar5; ppvVar5 = &(this->_sprite)._eventNames; if (ppvVar5 != (void **)param_2) { iVar1 = param_2[1]; fVar2 = (float)param_2[2]; fVar3 = (float)param_2[3]; *ppvVar5 = (void *)*param_2; (this->_sprite)._numEvents = iVar1; (this->_sprite)._offset.x = fVar2; (this->_sprite)._offset.y = fVar3; fVar2 = (float)param_2[5]; fVar3 = (float)param_2[6]; fVar4 = (float)param_2[7]; (this->_sprite)._scale.x = (float)param_2[4]; (this->_sprite)._scale.y = fVar2; (this->_sprite)._rotation = fVar3; (this->_sprite)._color._tint[0] = fVar4; *(undefined8 *)((this->_sprite)._color._tint + 1) = *(undefined8 *)(param_2 + 8); (this->_sprite)._color._tint[3] = (float)param_2[10]; } return; } //@@ 006b82f0 Entity_Projectile::AddChangeFlags /* ZHL [lua] Lua binding EntityProjectile:AddChangeFlags */ void __thiscall Entity_Projectile::AddChangeFlags(Entity_Projectile *this,uint param_2,uint param_3) { uint *puVar1; *(uint *)&this->_changeFlags = (uint)this->_changeFlags | param_2; puVar1 = (uint *)((int)&this->_changeFlags + 4); *puVar1 = *puVar1 | param_3; return; } //@@ 006b8310 FUN_006b8310 void FUN_006b8310(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x3c) = 0; return; } //@@ 006b8320 EntityList::assign /* DB: "EL: not enough space for copy" */ EntityList * EntityList::assign(EntityList *param_1,int param_2) { int in_ECX; uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afa49e; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; sublist_init(param_1,(EntityList_EL *)(in_ECX + 0x80),*(int *)(param_2 + 0xc)); local_8 = 0; uVar1 = *(uint *)(param_2 + 0xc); if (*(uint *)¶m_1->field_0x8 < uVar1) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for copy\n"); uVar1 = *(uint *)(param_2 + 0xc); } memcpy(*(void **)¶m_1->field_0x4,*(void **)(param_2 + 4),uVar1 << 2); *(undefined4 *)¶m_1->field_0xc = *(undefined4 *)(param_2 + 0xc); ExceptionList = local_10; return param_1; } //@@ 006b83d0 Room::IsInitialized /* ZHL [lua] Lua binding Room:IsInitialized */ undefined1 Room::IsInitialized(void) { undefined1 *in_ECX; return *in_ECX; } //@@ 006b83e0 Room::GetRenderSurfaceTopLeft /* ZHL [lua] Lua binding Room:GetRenderSurfaceTopLeft */ Vector * __thiscall Room::GetRenderSurfaceTopLeft(Room *this) { return &this->_renderSurfaceTopLeft; } //@@ 006b83f0 Room::IsFirstEnemyDead /* ZHL [lua] Lua binding Room:IsFirstEnemyDead */ byte __thiscall Room::IsFirstEnemyDead(Room *this) { return this->_isFirstEnemyDead; } //@@ 006b8400 Room::SetFirstEnemyDead /* ZHL [lua] Lua binding Room:SetFirstEnemyDead */ void __thiscall Room::SetFirstEnemyDead(Room *this,byte param_2) { this->_isFirstEnemyDead = param_2; return; } //@@ 006b8410 Room::has_room_config_flag /* DB: descriptor->config+0x4c & mask */ bool Room::has_room_config_flag(uint param_1) { int iVar1; int in_ECX; if ((*(int *)(in_ECX + 4) == 0) || (iVar1 = *(int *)(*(int *)(in_ECX + 4) + 0x10), iVar1 == 0)) { return false; } return (*(uint *)(iVar1 + 0x4c) & param_1) != 0; } //@@ 006b8440 FUN_006b8440 undefined1 FUN_006b8440(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x11f5); } //@@ 006b8450 Entity_NPC::CanShutDoors /* ZHL [vtable slot 18] */ uint __thiscall Entity_NPC::CanShutDoors(Entity_NPC *this) { uint in_EAX; if ((this->_canShutDoors == 0) || (in_EAX = (uint)this->_flags & 0x20000000, in_EAX != 0)) { return in_EAX & 0xffffff00; } return 1; } //@@ 006b8470 Entity_NPC::IsBoss /* ZHL [vtable slot 19] */ byte __thiscall Entity_NPC::IsBoss(Entity_NPC *this) { return this->_isBoss; } //@@ 006b8480 Entity_NPC::IsChampion /* ZHL [lua] Lua binding EntityNPC:IsChampion */ byte __thiscall Entity_NPC::IsChampion(Entity_NPC *this) { return this->_isChampion; } //@@ 006b8490 FUN_006b8490 undefined1 FUN_006b8490(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0xf5c); } //@@ 006b84a0 Entity_Player::ControlsEnabled /* ZHL [lua] Lua binding EntityPlayer:ControlsEnabled */ byte __thiscall Entity_Player::ControlsEnabled(Entity_Player *this) { return this->_isControlsEnabled; } //@@ 006b84b0 Game::GetVictoryLap /* ZHL [lua] Lua binding Game:GetVictoryLap */ int __thiscall Game::GetVictoryLap(Game *this) { return this->_victoryLap; } //@@ 006b84c0 FUN_006b84c0 void FUN_006b84c0(void) { void *ptr; undefined4 *in_ECX; std::deque::clear(); ptr = (void *)*in_ECX; *in_ECX = 0; operator_delete(ptr,8); return; } //@@ 006b84e0 std::deque::push_back /* DB: 0x14 entries, shopkeeper/fireplace loot */ void std::deque::push_back (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { void *pvVar1; int iVar2; undefined4 *puVar3; int in_ECX; int iVar4; uint uVar5; iVar4 = *(int *)(in_ECX + 0x10); uVar5 = *(uint *)(in_ECX + 8); if (uVar5 <= iVar4 + 1U) { _Growmap(iVar4); uVar5 = *(uint *)(in_ECX + 8); iVar4 = *(int *)(in_ECX + 0x10); } *(uint *)(in_ECX + 0xc) = *(uint *)(in_ECX + 0xc) & uVar5 - 1; uVar5 = iVar4 + *(int *)(in_ECX + 0xc) & uVar5 - 1; iVar2 = *(int *)(in_ECX + 4); iVar4 = uVar5 * 4; if (*(int *)(iVar2 + uVar5 * 4) == 0) { pvVar1 = operator_new(0x14); *(void **)(iVar4 + *(int *)(in_ECX + 4)) = pvVar1; iVar2 = *(int *)(in_ECX + 4); } puVar3 = *(undefined4 **)(iVar4 + iVar2); *puVar3 = 0; puVar3[1] = 0; puVar3[2] = 0; puVar3[3] = 0; puVar3[4] = 0; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; puVar3 = (undefined4 *)UmbilicalBabyData::last_point(); *puVar3 = param_1; puVar3[1] = param_2; puVar3[2] = param_3; puVar3[3] = param_4; puVar3[4] = param_5; return; } //@@ 006b8580 FUN_006b8580 void FUN_006b8580(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x171) = 1; return; } //@@ 006b8590 Entity_NPC::Constructor /* ZHL [exact] __thiscall void Entity_NPC::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_NPC::Constructor(Entity_NPC *this) { int *containerProxy; void *local_10; undefined1 *puStack_c; undefined4 local_8; std_deque *deque; undefined1 *extraDeque; local_8 = 0xffffffff; puStack_c = &LAB_00afa52f; local_10 = ExceptionList; ExceptionList = &local_10; Entity::constructor((Entity *)this); local_8 = 0; *(undefined ***)this = IsaacRepentancePlus::Entity_NPC::vftable; PathFinder::Init((PathFinder *)&this->_pathfinder,(Entity *)this); (this->_killDamageEvents)._begin = (void *)0x0; (this->_killDamageEvents)._end = (void *)0x0; (this->_killDamageEvents)._capacity = (void *)0x0; local_8._0_1_ = 2; deque = &this->_entityDeque; (this->_v1).y = 0.0; (this->_v1).x = 0.0; (this->_v2).y = 0.0; (this->_v2).x = 0.0; this->_deliriumCycleID = 0; this->_deliriumCycleIDHigh = 0; deque->_proxy = (void *)0x0; (this->_entityDeque)._map = (void *)0x0; (this->_entityDeque)._mapSize = 0; (this->_entityDeque)._offset = 0; (this->_entityDeque)._size = 0; containerProxy = operator_new(8); containerProxy[1] = 0; deque->_proxy = containerProxy; *containerProxy = (int)deque; local_8._0_1_ = 3; deque = &this->_vectorDeque1; deque->_proxy = (void *)0x0; (this->_vectorDeque1)._map = (void *)0x0; (this->_vectorDeque1)._mapSize = 0; (this->_vectorDeque1)._offset = 0; (this->_vectorDeque1)._size = 0; containerProxy = operator_new(8); containerProxy[1] = 0; deque->_proxy = containerProxy; *containerProxy = (int)deque; local_8._0_1_ = 4; deque = &this->_vectorDeque2; deque->_proxy = (void *)0x0; (this->_vectorDeque2)._map = (void *)0x0; (this->_vectorDeque2)._mapSize = 0; (this->_vectorDeque2)._offset = 0; (this->_vectorDeque2)._size = 0; containerProxy = operator_new(8); containerProxy[1] = 0; deque->_proxy = containerProxy; *containerProxy = (int)deque; local_8._0_1_ = 5; extraDeque = &this->field_0xc48; (this->_confusionTargetPos).y = 0.0; (this->_confusionTargetPos).x = 0.0; *(undefined4 *)extraDeque = 0; *(undefined4 *)&this->field_0xc4c = 0; *(undefined4 *)&this->field_0xc50 = 0; *(undefined4 *)&this->field_0xc54 = 0; *(undefined4 *)&this->field_0xc58 = 0; containerProxy = operator_new(8); containerProxy[1] = 0; *(int **)extraDeque = containerProxy; *containerProxy = (int)extraDeque; local_8._0_1_ = 6; (this->_floorColor)._tint[0] = 1.0; (this->_floorColor)._tint[1] = 1.0; (this->_floorColor)._tint[2] = 1.0; (this->_floorColor)._tint[3] = 1.0; (this->_floorColor)._colorize[0] = 0.0; (this->_floorColor)._colorize[1] = 0.0; (this->_floorColor)._colorize[2] = 0.0; (this->_floorColor)._colorize[3] = 0.0; (this->_floorColor)._offset[0] = 0.0; (this->_floorColor)._offset[1] = 0.0; (this->_floorColor)._offset[2] = 0.0; (this->_dirtColor)._tint[0] = 1.0; (this->_dirtColor)._tint[1] = 1.0; (this->_dirtColor)._tint[2] = 1.0; (this->_dirtColor)._tint[3] = 1.0; (this->_dirtColor)._colorize[0] = 0.0; (this->_dirtColor)._colorize[1] = 0.0; (this->_dirtColor)._colorize[2] = 0.0; (this->_dirtColor)._colorize[3] = 0.0; (this->_dirtColor)._offset[0] = 0.0; (this->_dirtColor)._offset[1] = 0.0; (this->_dirtColor)._offset[2] = 0.0; ANM2::constructor(&this->_statusEffectSprite); local_8 = CONCAT31(local_8._1_3_,7); ANM2::constructor(&this->_chargeBarSprite); (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; (this->_secondaryHitList)._begin = (void *)0x0; (this->_secondaryHitList)._end = (void *)0x0; (this->_secondaryHitList)._capacity = (void *)0x0; this->_pickupGhostsEntity = (void *)0x0; (this->_controllerMovement).y = 0.0; (this->_controllerMovement).x = 0.0; *(undefined4 *)(this + 1) = 0; (this->_forwardVector).y = 0.0; (this->_forwardVector).x = 0.0; *(undefined4 *)&this[1].field_0x4 = 0; *(undefined1 *)&this[1]._damageEvents._begin = 0; ExceptionList = local_10; return; } //@@ 006b88e0 Entity_NPC::Free /* ZHL [vtable slot 0] */ Entity_NPC * __thiscall Entity_NPC::Free(Entity_NPC *this,byte param_2) { ~Entity_NPC(); if ((param_2 & 1) != 0) { operator_delete(this,0xf60); } return this; } //@@ 006b8910 Entity_NPC::~Entity_NPC /* DB: destructor body: stores IsaacRepentancePlus::Entity_NPC::vftable, erases its EntityPtr refs from the multiset, frees member vectors; only caller is the scalar deleting dtor Entity_NPC::Free (operator_delete 0xf60) */ void Entity_NPC::~Entity_NPC(void) { Vector *pVVar1; void **ppvVar2; int *piVar3; void *pvVar4; EntityPtr ptr; Entity *in_ECX; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa550; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_NPC::vftable; pVVar1 = &in_ECX[3]._targetPosition; local_14 = in_ECX; if (pVVar1->x != 0.0) { local_14 = (Entity *)pVVar1; std::multiset::erase(&local_14); pVVar1->x = 0.0; } ppvVar2 = &in_ECX[3]._config; if (*ppvVar2 != (void *)0x0) { local_14 = (Entity *)ppvVar2; std::multiset::erase(&local_14); *ppvVar2 = (void *)0x0; } piVar3 = &in_ECX[3]._spawnGridIndex; if (*piVar3 != 0) { local_14 = (Entity *)piVar3; std::multiset::erase(&local_14); *piVar3 = 0; } FID_conflict__Tidy(&in_ECX[3]._bleedingCountdown); FID_conflict__Tidy(&in_ECX[3]._entityRef4._entity); local_8 = 3; ANM2::Reset((ANM2 *)in_ECX[3]._color._colorize); AnimationState::~AnimationState((AnimationState *)&in_ECX[3]._freezeCountdown); AnimationState::~AnimationState((AnimationState *)(in_ECX[3]._splatColor._colorize + 1)); std::string::_Tidy_deallocate((char *)(in_ECX[3]._color._offset + 2)); std::string::_Tidy_deallocate((char *)in_ECX[3]._color._colorize); local_8 = 4; ANM2::Reset((ANM2 *)&in_ECX[3]._sprite._overlayAnimState._previouslyTriggeredEvents); AnimationState::~AnimationState((AnimationState *)(in_ECX[3]._sprite._color._colorize + 1)); AnimationState::~AnimationState((AnimationState *)&in_ECX[3]._sprite._scale); std::string::_Tidy_deallocate((char *)&in_ECX[3]._sprite._nullLayerNames); std::string::_Tidy_deallocate ((char *)&in_ECX[3]._sprite._overlayAnimState._previouslyTriggeredEvents); std::deque::_Tidy(); pvVar4 = (void *)in_ECX[3]._collisionIndex; in_ECX[3]._collisionIndex = 0; operator_delete(pvVar4,8); std::deque::_Tidy(); pvVar4 = (void *)in_ECX[2]._pitfallTimer; in_ECX[2]._pitfallTimer = 0; operator_delete(pvVar4,8); std::deque::_Tidy(); pvVar4 = (void *)in_ECX[2]._initSeed; in_ECX[2]._initSeed = 0; operator_delete(pvVar4,8); std::deque::_Tidy(); ptr = in_ECX[2]._hitEffect; in_ECX[2]._hitEffect = (EntityPtr)0x0; operator_delete((void *)ptr,8); FUN_0041c7d0(); pVVar1 = &in_ECX[2]._preInterpolatePos; FID_conflict__Erase_tree_>_> (pVVar1,(fuzzer_allocator_> *)pVVar1, *(_Tree_node **)((int)in_ECX[2]._preInterpolatePos.x + 4)); operator_delete((void *)pVVar1->x,0x14); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 006b8b20 Entity_NPC::Init /* ZHL [vtable slot 1] */ void __thiscall Entity_NPC::Init(Entity_NPC *this,int param_2,int param_3,int param_4,uint param_5) { float fVar1; undefined4 zeroColor [8]; undefined4 local_14; undefined4 uStack_10; undefined4 local_c; Entity_NPC *eraseRef; undefined1 *field4Ref; void **pickupGhostRef; int *roomBossCount; this->_isChampion = 0; pickupGhostRef = &this->_pickupGhostsEntity; this->_championColorIdx = -1; this->_flickerTimer = 0; this->_flickerState = 0; this->_flickerAlpha = 1.0; this->_championSpeed = 1.0; this->_bosscoloridx = -1; this->_isUnreachableOnce = 0; this->_scale = 1.0; this->_shieldStrength = 0.0; this->_shieldFrames = 0x78; this->_deliriumBossType = 0; this->_deliriumBossVariant = 0; this->_deliriumTransformationTimer = 0; this->_deliriumRemainingAttacks = 0; this->_deliriumState = 0; this->_deliriumEntity = (void *)0x0; this->_isBestiaryEncountered = 0; *(undefined1 *)&this[1]._damageEvents._begin = 0; this->_aiCallFlags = 0; this->_controllerID = -1; this->field_0xf2c = 0; (this->_controllerMovement).x = g_vectorZero.x; (this->_controllerMovement).y = g_vectorZero.y; this->_aimTargetEffect = (void *)0x0; (this->_forwardVector).x = g_vectorZero.x; (this->_forwardVector).y = g_vectorZero.y; this->_forcedTarget = (EntityPtr)0x0; this->_forcedTargetTimer = 0; this->_sirenPlayerEntity = (void *)0x0; this->_hitPointsMulti = 1.0; this->_scaleMulti = 1.0; this->_lastGridIndex = -1; if (*pickupGhostRef != (int *)0x0) { (**(code **)(*(int *)*pickupGhostRef + 0x28))(); if (*pickupGhostRef != (void *)0x0) { eraseRef = (Entity_NPC *)pickupGhostRef; std::multiset::erase(&eraseRef); *pickupGhostRef = (void *)0x0; } } field4Ref = &this[1].field_0x4; if (*(int **)&this[1].field_0x4 != (int *)0x0) { (**(code **)(**(int **)&this[1].field_0x4 + 0x28))(); if (*(int *)field4Ref != 0) { eraseRef = (Entity_NPC *)field4Ref; std::multiset::erase(&eraseRef); *(undefined4 *)field4Ref = 0; } } if (*(int *)(this + 1) != 0) { eraseRef = this + 1; std::multiset::erase(&eraseRef); *(void **)(this + 1) = (void *)0x0; } (this->_killDamageEvents)._end = (this->_killDamageEvents)._begin; this->_killDamage = 0.0; *(undefined4 *)&this->_killDamageFlags = 0; *(undefined4 *)((int)&this->_killDamageFlags + 4) = 0; Entity::Init((Entity *)this,param_2,param_3,param_4,param_5); *(uint *)&this->_flags = (uint)this->_flags | 4; *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); this->_state = 1; this->_savedState = 0; this->_aiCallPhase = 0; this->_stateFrame = 0; this->_aiCounter = 0; this->_appearFrames = 0; this->_decoyTargetTimer = 0; this->_groupIdx = -1; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; (this->_confusionTargetPos).x = g_vectorZero.x; (this->_confusionTargetPos).y = g_vectorZero.y; this->_aiFloat = 1.0; (this->_v1).x = g_vectorZero.x; (this->_v1).y = g_vectorZero.y; (this->_v2).x = g_vectorZero.x; (this->_v2).y = g_vectorZero.y; this->_championRegenTimer = 0; this->_championRegenCount = 0; this->_holdCountdown = 0; this->_i1 = 0; this->_i2 = 0; this->_entityRef = (EntityPtr)0x0; this->_projectileCooldown = 0; this->_projectileDelay = -1; this->_championTimer = 0; (this->_holdPosition).x = g_vectorZero.x; fVar1 = g_vectorZero.y; *(undefined2 *)&this->field_0xc61 = 0; local_14 = 0; uStack_10 = 0; local_c = 0; (this->_holdPosition).y = fVar1; if (&this->_floorColor != (ColorMod *)zeroColor) { (this->_floorColor)._colorize[0] = 0.0; (this->_floorColor)._colorize[1] = 0.0; (this->_floorColor)._colorize[2] = 0.0; (this->_floorColor)._colorize[3] = 0.0; (this->_floorColor)._offset[0] = 0.0; (this->_floorColor)._offset[1] = 0.0; (this->_floorColor)._tint[0] = 0.0; (this->_floorColor)._tint[1] = 0.0; (this->_floorColor)._tint[2] = 0.0; (this->_floorColor)._tint[3] = 0.0; (this->_floorColor)._offset[2] = 0.0; } (this->_hitList)._end = (this->_hitList)._begin; (this->_secondaryHitList)._end = (this->_secondaryHitList)._begin; PathFinder::Reset((PathFinder *)&this->_pathfinder); if (this->_isBoss != 0) { roomBossCount = (int *)((int)g_game->_room + 0x7224); *roomBossCount = *roomBossCount + 1; } this->_totalDamageTaken = 0.0; FUN_00860880(this); return; } //@@ 006b8f00 Entity_NPC::Remove /* ZHL [exact] void Remove(); */ void __thiscall Entity_NPC::Remove(Entity_NPC *this) { if (((this->_type == 0x362) && (this->_variant == 0)) && (this->_child != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_child + 0x28))(); } Entity::Remove((Entity *)this); return; } //@@ 006b8f30 Entity_NPC::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_NPC::ClearReferences(Entity_NPC *this) { EntityPtr EVar1; qword qVar2; Entity_NPC *childNpc; int iVar3; void *pvVar4; uint uVar5; qword *allocatedBytes; EntityPtr childParentField; EntityList_EL familiars; EntityPtr local_1c; EntityPtr local_18; EntityPtr local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void **aimTargetField; EntityPtr *childField; float childHealth; float childMaxHp; undefined4 flagsHigh; Game *game; std_vector *hitList; void *oldData; EntityPtr *parentField; local_8 = 0xffffffff; puStack_c = &LAB_00af341d; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = this->_type; if (iVar3 == 0x3c6) { EVar1 = this->_target; if (((EVar1 != (EntityPtr)0x0) && (*(int *)((int)EVar1 + 0x28) == 3)) && ((*(uint *)((int)EVar1 + 0x168) & 0x100) != 0)) { Entity_Familiar::RemoveFromPlayer ((Entity_Familiar *)EVar1,__security_cookie ^ (int)register0x00000010 - 4U); iVar3 = this->_type; goto LAB_006b8f98; } } else { LAB_006b8f98: if (iVar3 == 0x38b) { EVar1 = this->_child; childField = &this->_child; if (EVar1 != (EntityPtr)0x0) { childParentField = (EntityPtr)((int)EVar1 + 0x3bc); local_18 = this->_parent; if (*(int *)((int)EVar1 + 0x3bc) != 0) { local_14 = childParentField; std::multiset::erase(&local_14); } *(EntityPtr *)childParentField = local_18; if (local_18 != (EntityPtr)0x0) { std::multiset::insert(childParentField); } } EVar1 = this->_parent; parentField = &this->_parent; if (EVar1 != (EntityPtr)0x0) { local_14 = (EntityPtr)((int)EVar1 + 0x3c0); local_1c = *childField; if (*(int *)((int)EVar1 + 0x3c0) != 0) { local_18 = local_14; std::multiset::erase(&local_18); } *(EntityPtr *)local_14 = local_1c; if (local_1c != (EntityPtr)0x0) { std::multiset::insert(local_14); } } if ((*parentField == (EntityPtr)0x0) && (childNpc = ChildNPC(this), childNpc != (Entity_NPC *)0x0)) { local_1c = (EntityPtr)ChildNPC(this); game = g_game; childMaxHp = *(float *)((int)local_1c + 900); childHealth = *(float *)((int)local_1c + 0x380); *(short *)&(g_game->_hud).field_0x54ba = (short)(int)childMaxHp; *(short *)&(game->_hud).field_0x54b8 = (short)(int)((childMaxHp - childHealth) + 1.0); uVar5 = *(uint *)((int)local_1c + 0x168); flagsHigh = *(undefined4 *)((int)local_1c + 0x16c); *(uint *)((int)local_1c + 0x168) = uVar5 & 0x7fffffff; *(undefined4 *)((int)local_1c + 0x16c) = flagsHigh; if (this->_subtype == 0) { *(undefined4 *)((int)local_1c + 0x16c) = flagsHigh; *(uint *)((int)local_1c + 0x168) = uVar5 & 0x7fefffff; } Entity::SetVisibleFlag((Entity *)local_1c,1); } if (*parentField != (EntityPtr)0x0) { local_1c = (EntityPtr)parentField; std::multiset::erase(&local_1c); } *parentField = (EntityPtr)0x0; if (*childField != (EntityPtr)0x0) { local_1c = (EntityPtr)childField; std::multiset::erase(&local_1c); } iVar3 = this->_type; *childField = (EntityPtr)0x0; } if ((iVar3 == 0x390) && ((this->_variant == 0 || (this->_variant == 10)))) { SFXManager::Stop(&g_manager->_sfxManager,0x280); SFXManager::Stop(&g_manager->_sfxManager,0x1b8); } } if (this->_pickupGhostsEntity != (void *)0x0) { local_1c = (EntityPtr)&this->_pickupGhostsEntity; std::multiset::erase(&local_1c); this->_pickupGhostsEntity = (void *)0x0; } if (*(int *)(this + 1) != 0) { local_1c = (EntityPtr)(this + 1); std::multiset::erase(&local_1c); *(undefined4 *)(this + 1) = 0; } if (*(int *)&this[1].field_0x4 != 0) { local_1c = (EntityPtr)&this[1].field_0x4; std::multiset::erase(&local_1c); *(undefined4 *)&this[1].field_0x4 = 0; } if (this->_entityRef != (EntityPtr)0x0) { local_1c = (EntityPtr)&this->_entityRef; std::multiset::erase(&local_1c); } this->_entityRef = (EntityPtr)0x0; aimTargetField = &this->_aimTargetEffect; if (*aimTargetField != (int *)0x0) { (**(code **)(*(int *)*aimTargetField + 0x28))(); } if (*aimTargetField != (void *)0x0) { local_1c = (EntityPtr)aimTargetField; std::multiset::erase(&local_1c); } *aimTargetField = (void *)0x0; ClearDequeRefs(this); if (this->_forcedTarget != (EntityPtr)0x0) { local_1c = (EntityPtr)&this->_forcedTarget; std::multiset::erase(&local_1c); } this->_forcedTarget = (EntityPtr)0x0; Entity::ClearReferences((Entity *)this); std::deque::_Tidy(); std::deque::_Tidy(); std::deque::_Tidy(); ANM2::Reset(&this->_statusEffectSprite); ANM2::Reset(&this->_chargeBarSprite); hitList = &this->_hitList; if ((std_vector *)&familiars._data != hitList) { oldData = hitList->_begin; pvVar4 = (this->_hitList)._capacity; hitList->_begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; if (oldData != (void *)0x0) { uVar5 = (int)pvVar4 - (int)oldData & 0xfffffffc; pvVar4 = oldData; if (0xfff < uVar5) { pvVar4 = *(void **)((int)oldData + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)oldData + (-4 - (int)pvVar4))) goto LAB_006b93e7; } operator_delete(pvVar4,uVar5); } } hitList = &this->_secondaryHitList; if ((std_vector *)&familiars._data != hitList) { oldData = hitList->_begin; pvVar4 = (this->_secondaryHitList)._capacity; hitList->_begin = (void *)0x0; (this->_secondaryHitList)._end = (void *)0x0; (this->_secondaryHitList)._capacity = (void *)0x0; if (oldData != (void *)0x0) { uVar5 = (int)pvVar4 - (int)oldData & 0xfffffffc; pvVar4 = oldData; if (0xfff < uVar5) { pvVar4 = *(void **)((int)oldData + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)oldData + (-4 - (int)pvVar4))) { LAB_006b93e7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } } if (this->_sirenPlayerEntity != (void *)0x0) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0); local_8 = 0; uVar5 = 0; if (familiars._size != 0) { do { iVar3 = *(int *)((int)familiars._data + uVar5 * 4); if (((iVar3 != 0) && (*(int *)(iVar3 + 0x28) == 3)) && (*(void **)(iVar3 + 0x410) == this->_sirenPlayerEntity)) { Entity_Familiar::RemoveFromPlayer(); } uVar5 = uVar5 + 1; } while (uVar5 < (uint)familiars._size); } (**(code **)(*(int *)this->_sirenPlayerEntity + 0x44))(); if (this->_sirenPlayerEntity != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_sirenPlayerEntity)(1); this->_sirenPlayerEntity = (void *)0x0; } local_8 = 0xffffffff; if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar5 = *(uint *)((int)familiars._data + -4); qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < uVar5); free((void *)((int)familiars._data + -4)); } local_8 = 0xffffffff; } } if ((this->_type == 0x387) && (this->_variant == 10)) { SFXManager::Stop(&g_manager->_sfxManager,0x1f7); } ExceptionList = local_10; return; } //@@ 006b9450 spawn_gfuel_explosion /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ECX = position, XMM1 = scale: Game::Spawn(1000,15) poof, loads "gfx/promo/gfuel/effects/explosion_big.anm2" (scale > 1.5, sound 0x337) or a random small explosion, ShakeScreen; Entity_NPC::PlayDeathEffects calls it when PlayerManager::GetGFuelCount() > 0 */ Entity * spawn_gfuel_explosion(void) { double dVar1; byte *text; Manager *pMVar2; char *pcVar3; byte bVar4; uint uVar5; Entity *pEVar6; std_string *anim; Vector *in_ECX; byte *pbVar7; void *pvVar8; char *pcVar9; float in_XMM1_Da; int timeout; float local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa585; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&local_2c + 0x28U; ExceptionList = &local_10; local_30 = in_XMM1_Da; uVar5 = Random(); pEVar6 = Game::Spawn(g_game,1000,0xf,in_ECX,&g_vectorZero,(Entity *)0x0,0,uVar5); if (1.5 < local_30) { Random(); local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; pcVar3 = "gfx/promo/gfuel/effects/explosion_big.anm2"; do { pcVar9 = pcVar3; pcVar3 = pcVar9 + 1; } while (*pcVar9 != '\0'); std::string::assign(local_2c._buf,(byte *)"gfx/promo/gfuel/effects/explosion_big.anm2", (uint)(pcVar9 + -0xb6752c)); local_8 = 1; ANM2::Load(&pEVar6->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar5 = local_2c._capacity + 1; pvVar8 = (void *)local_2c._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(local_2c._buf._0_4_ + -4); uVar5 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar5); } uVar5 = Random(); pMVar2 = g_manager; local_30 = 1.15327e-42; dVar1 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_30,1.0,2,0, (float)((double)(int)uVar5 + dVar1) * 2.3283064e-10 * 0.2 + 0.9,0.0); timeout = 0x28; } else { uVar5 = Random(); local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; text = (&PTR_s_gfx_promo_gfuel_effects_explosio_00b674d4)[uVar5 & 1]; pbVar7 = text; do { bVar4 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar4 != 0); std::string::assign(local_2c._buf,text,(int)pbVar7 - (int)(text + 1)); local_8 = 0; ANM2::Load(&pEVar6->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar5 = local_2c._capacity + 1; pvVar8 = (void *)local_2c._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(local_2c._buf._0_4_ + -4); uVar5 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar5); } uVar5 = Random(); pMVar2 = g_manager; local_30 = 1.15187e-42; dVar1 = __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_30,1.0,2,0, (float)((double)(int)uVar5 + dVar1) * 2.3283064e-10 * 0.2 + 0.9,0.0); timeout = 0x14; } Game::ShakeScreen(g_game,timeout); anim = &(pEVar6->_sprite)._animDefaultName; if (0xf < (pEVar6->_sprite)._animDefaultName._capacity) { anim = *(std_string **)anim->_buf; } bVar4 = ANM2::SetAnimation(&pEVar6->_sprite,(byte *)anim,1); if (bVar4 != 0) { AnimationState::Rewind(&(pEVar6->_sprite)._animState); (pEVar6->_sprite)._animState._isPlaying = 1; } (**(code **)(*(int *)pEVar6 + 0xc))(); ExceptionList = local_10; return pEVar6; } //@@ 006b9740 Entity::IsPlayerInRadius /* DB: ? not friendly; any player within xmm2 radius of pos, or QueryRadius finds familiar variant 0x3e prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Entity::IsPlayerInRadius(Entity *this,Vector *position,float radius,int unused1,int unused2) { int iVar1; qword qVar2; int *piVar3; void *pvVar4; Game *pGVar5; PlayerManager *pPVar6; qword *pqVar7; uint uVar8; float fVar9; float fVar10; float fVar11; EntityList_EL local_2c; float local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa5b0; local_10 = ExceptionList; ExceptionList = &local_10; if (((this->_flags & 0x20000000) == 0) && (0.0 < radius)) { uVar8 = 0; pPVar6 = &g_game->_playerManager; fVar11 = radius * radius; pGVar5 = g_game; local_1c = radius; local_18 = fVar11; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2 != 0 ) { do { pvVar4 = (pPVar6->_playerList)._end; if ((int)pvVar4 - (int)(pPVar6->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (pPVar6->_playerList)._end; pGVar5 = g_game; fVar11 = local_18; } piVar3 = (pPVar6->_playerList)._begin; if (uVar8 < (uint)((int)pvVar4 - (int)piVar3 >> 2)) { piVar3 = piVar3 + uVar8; } fVar10 = position->y - *(float *)(*piVar3 + 0x340); fVar9 = position->x - *(float *)(*piVar3 + 0x33c); if (fVar10 * fVar10 + fVar9 * fVar9 < fVar11) { ExceptionList = local_10; return 1; } pPVar6 = &pGVar5->_playerManager; uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(pGVar5->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2)); } EntityList::QueryRadius ((EntityList *)((int)pGVar5->_room + 0x1218),&local_2c,position,local_1c,1); uVar8 = 0; if (local_2c._size != 0) { do { iVar1 = *(int *)((int)local_2c._data + uVar8 * 4); if (((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 3)) && (*(int *)(iVar1 + 0x2c) == 0x3e)) { if (local_2c._0_1_ == '\0') { local_8 = 0; tracked_alloc(1,local_2c._data,0); } ExceptionList = local_10; return 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)local_2c._size); } if (local_2c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } if (local_2c._data != (void *)0x0) { uVar8 = *(uint *)((int)local_2c._data + -4); qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar8; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar2 < uVar8); free((void *)((int)local_2c._data + -4)); } } } ExceptionList = local_10; return 0; } //@@ 006b9910 Entity_NPC::TryForceTarget /* ZHL [exact] __thiscall bool Entity_NPC::TryForceTarget(Entity* Target, int Duration); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_NPC::TryForceTarget(Entity_NPC *this,Entity *Target,int Duration) { EntityPtr *pEVar1; EntityPtr EVar2; float fVar3; float fVar4; float fVar5; float fVar6; Entity_NPC *local_c [2]; if (this->_forcedTargetTimer < 0) { return 0; } EVar2 = this->_forcedTarget; pEVar1 = &this->_forcedTarget; if (EVar2 == (EntityPtr)0x0) { if (Target == (Entity *)0x0) goto LAB_006b99c8; } else { if (EVar2 == (EntityPtr)Target) goto LAB_006b99c8; fVar4 = (this->_pos).x; fVar5 = (this->_pos).y; fVar6 = fVar4 - (Target->_pos).x; fVar4 = fVar4 - *(float *)((int)EVar2 + 0x33c); fVar3 = fVar5 - (Target->_pos).y; fVar5 = fVar5 - *(float *)((int)EVar2 + 0x340); if (fVar5 * fVar5 + fVar4 * fVar4 <= fVar3 * fVar3 + fVar6 * fVar6) { return 0; } } local_c[0] = this; if (EVar2 != (EntityPtr)0x0) { local_c[0] = (Entity_NPC *)pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)Target; if (Target != (Entity *)0x0) { std::multiset::insert(pEVar1); } LAB_006b99c8: this->_forcedTargetTimer = Duration; return 1; } //@@ 006b99e0 Entity_NPC::compute_speed_multiplier /* DB: ? Entity_NPC::Update stores its XMM0 result in _speedMultiplier right after: Room::GetTimeScale, then unless flag 0x20000000 Stopwatch (232) / Hourglass (66) TemporaryEffects slowdowns, vtable +0x4c check with effect 697 */ void __thiscall Entity_NPC::compute_speed_multiplier(Entity_NPC *this) { Game *pGVar1; char cVar2; byte bVar3; TemporaryEffects *this_00; Room::GetTimeScale(g_game->_room,(Vector *)this,(Entity *)this); pGVar1 = g_game; if ((this->_flags & 0x20000000) == 0) { this_00 = (TemporaryEffects *)((int)g_game->_room + 0x7310); bVar3 = TemporaryEffects::HasCollectibleEffect(this_00,0xe8); if ((bVar3 == 0) && ((pGVar1->_challenge == 0x16 || (*(int *)((int)pGVar1->_room + 0x1210) != 1)))) { TemporaryEffects::GetCollectibleEffect(this_00,0x42); } } cVar2 = (**(code **)(*(int *)this + 0x4c))(); if (((cVar2 == '\0') || ((this->_flags & 0x20000000) != 0)) || (bVar3 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x2b9), bVar3 == 0)) { return; } return; } //@@ 006b9bb0 Level::GetStageID /* ZHL [exact] static int Level::GetStageID(); prototype: db/protos.zhl, confirmed by RET 0 */ uint __cdecl Level::GetStageID(void) { int iVar1; uint uVar2; uint uVar3; iVar1 = *(int *)((int)g_game->_room + 0x1d18); if ((iVar1 == 0x1f) || (iVar1 == 0x24)) { uVar3 = 0x1b; } else { if (iVar1 == 0x2d) { return 0x1c; } uVar3 = Game::GetStageID(g_game,(byte)g_game); if ((uVar3 == 0x1a) && (uVar2 = **(uint **)(*(int *)((int)g_game->_room + 4) + 0x10), uVar2 != 0)) { return uVar2; } } return uVar3; } //@@ 006b9c10 anm2_resolve_spritesheet_path /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? args (std::string* a, std::string* b, bool* outFound) + EDX base path: when both empty clears the flag, else joins strings, ModManager::TryRedirectPath; result fed to Sprite::ReplaceSpritesheet in Entity_NPC::load_graphics, also Menu_Character::ChangeCharacterPage and Menu_Bestiary::LoadPreview */ void anm2_resolve_spritesheet_path(std_string *param_1,byte *param_2,undefined1 *param_3) { uint *puVar1; undefined8 uVar2; uint uVar3; bool bVar4; bool bVar5; bool bVar6; byte bVar7; uint uVar8; char *this; undefined4 *puVar9; undefined4 *extraout_EAX; void **ppvVar10; byte *******pppppppbVar11; undefined4 *extraout_EAX_00; byte *pbVar12; byte *******pppppppbVar13; undefined4 uVar14; undefined4 extraout_EAX_01; int iVar15; char *in_ECX; uint length; void *pvVar16; byte *in_EDX; uint uVar17; std_string *psVar18; bool bVar19; undefined1 local_d1; undefined1 local_d0 [12]; char acStack_c4 [4]; uint uStack_c0; uint uStack_bc; byte *******local_b4; undefined1 local_b0; uint local_a4; uint local_a0; void *local_9c; void *pvStack_98; void *pvStack_94; void *pvStack_90; undefined8 local_8c; byte *******local_84 [4]; uint local_74; uint local_70; std_string local_6c; void *local_54 [4]; undefined4 local_44; uint local_40; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_54 + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00afa678; local_1c = ExceptionList; uVar8 = __security_cookie ^ (uint)(local_54 + 0x11); ExceptionList = &local_1c; uVar17 = param_1->_size; iVar15 = *(int *)(param_2 + 0x10); local_24 = uVar8; if ((uVar17 == 0) && (iVar15 == 0)) { if (param_3 != (undefined1 *)0x0) { *param_3 = 0; } puStack_20 = (undefined1 *)(local_54 + 0x14); std::string::string(in_ECX,in_EDX); ExceptionList = local_1c; return; } uVar3 = *(uint *)(in_EDX + 0x10); local_74 = 0; local_70 = 0xf; local_84[0] = (byte *******)0x0; length = uVar3 - 4; if (uVar3 < uVar3 - 4) { length = uVar3; } pbVar12 = in_EDX; if (0xf < *(uint *)(in_EDX + 0x14)) { pbVar12 = *(byte **)in_EDX; } std::string::assign((char *)local_84,pbVar12,length); local_14 = (void *)0x0; local_a4 = 0; local_a0 = 0xf; uVar3 = *(uint *)(in_EDX + 0x10) - 4; local_b4 = (byte *******)0x0; if (*(uint *)(in_EDX + 0x10) < uVar3) { /* WARNING: Subroutine does not return */ FUN_00499950(uVar8); } pbVar12 = in_EDX; if (0xf < *(uint *)(in_EDX + 0x14)) { pbVar12 = *(byte **)in_EDX; } pppppppbVar13 = *(byte ********)(pbVar12 + uVar3); local_a4 = 4; local_b0 = 0; local_14 = (void *)0x1; local_b4 = pppppppbVar13; std::string::string(local_3c._buf,in_EDX); local_8c = 0xf00000000; local_9c = (void *)0x0; local_14._0_1_ = 3; if (iVar15 == 0) { LAB_006ba0ee: if (uVar17 != 0) { local_d1 = 0; puVar1 = ¶m_1->_size; if (0x7fffffff - local_74 < *puVar1) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar11 = (byte *******)local_84; if (0xf < local_70) { pppppppbVar11 = local_84[0]; } if (0xf < param_1->_capacity) { param_1 = *(std_string **)param_1->_buf; } std::string::concat((char *)local_54,(int)in_ECX,param_1,(byte *)pppppppbVar11,local_74, (byte *)param_1,*puVar1); local_14._0_1_ = 7; pppppppbVar11 = (byte *******)&local_b4; if (0xf < local_a0) { pppppppbVar11 = pppppppbVar13; } puVar9 = std::string::append((char *)local_54,(byte *)pppppppbVar11,local_a4); local_d0._8_4_ = *puVar9; acStack_c4 = (char [4])puVar9[1]; uStack_c0 = puVar9[2]; uStack_bc = puVar9[3]; uVar2 = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; if (0xf < local_3c._capacity) { uVar17 = local_3c._capacity + 1; pbVar12 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar17) { pbVar12 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar17 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar12))) goto LAB_006ba20d; } operator_delete(pbVar12,uVar17); } local_14._0_1_ = 3; local_3c._buf._0_4_ = local_d0._8_4_; local_3c._buf._4_4_ = acStack_c4; local_3c._buf._8_4_ = uStack_c0; local_3c._buf._12_4_ = uStack_bc; local_3c._16_8_ = uVar2; if (0xf < local_40) { uVar17 = local_40 + 1; pvVar16 = local_54[0]; if (0xfff < uVar17) { pvVar16 = *(void **)((int)local_54[0] + -4); uVar17 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar16))) { LAB_006ba20d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar17); } local_44 = 0; local_40 = 0xf; local_54[0] = (void *)((uint)local_54[0] & 0xffffff00); ModManager::TryRedirectPath(&g_manager->_modManager,&local_6c,&local_3c); if (&local_3c != (std_string *)extraout_EAX_00) { if (0xf < local_3c._capacity) { uVar17 = local_3c._capacity + 1; pbVar12 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar17) { pbVar12 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar17 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar12))) goto LAB_006ba2db; } operator_delete(pbVar12,uVar17); } local_3c._buf._0_4_ = *extraout_EAX_00; local_3c._buf._4_4_ = extraout_EAX_00[1]; local_3c._buf._8_4_ = extraout_EAX_00[2]; local_3c._buf._12_4_ = extraout_EAX_00[3]; local_3c._16_8_ = *(undefined8 *)(extraout_EAX_00 + 4); extraout_EAX_00[4] = 0; extraout_EAX_00[5] = 0xf; *(undefined1 *)extraout_EAX_00 = 0; } if (0xf < local_6c._capacity) { uVar17 = local_6c._capacity + 1; pvVar16 = (void *)local_6c._buf._0_4_; if (0xfff < uVar17) { pvVar16 = *(void **)(local_6c._buf._0_4_ + -4); uVar17 = local_6c._capacity + 0x24; if (0x1f < (uint)(local_6c._buf._0_4_ + (-4 - (int)pvVar16))) { LAB_006ba2db: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar17); } pbVar12 = (byte *)&local_3c; if (0xf < local_3c._capacity) { pbVar12 = (byte *)local_3c._buf._0_4_; } bVar7 = file_exists(pbVar12); if (bVar7 == 0) { local_6c._buf._0_4_ = (void *)0x0; local_6c._capacity = 0xf; ppvVar10 = (void **)&local_6c; local_6c._size = 0; bVar19 = false; bVar4 = true; LAB_006ba352: bVar5 = bVar4; if (0xf < local_8c._4_4_) { uVar17 = local_8c._4_4_ + 1; pvVar16 = local_9c; if (0xfff < uVar17) { pvVar16 = *(void **)((int)local_9c + -4); uVar17 = local_8c._4_4_ + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar16))) goto LAB_006ba431; } operator_delete(pvVar16,uVar17); } local_9c = *ppvVar10; pvStack_98 = ppvVar10[1]; pvStack_94 = ppvVar10[2]; pvStack_90 = ppvVar10[3]; local_8c = *(undefined8 *)(ppvVar10 + 4); ppvVar10[4] = (void *)0x0; ppvVar10[5] = (void *)0xf; *(undefined1 *)ppvVar10 = 0; bVar6 = bVar19; } else { ppvVar10 = std::string::string((char *)local_54,&local_3c); local_14._0_1_ = 8; bVar5 = false; bVar19 = true; bVar4 = false; bVar6 = true; if (&local_9c != ppvVar10) goto LAB_006ba352; } if ((bVar5) && (0xf < local_6c._capacity)) { uVar17 = local_6c._capacity + 1; pvVar16 = (void *)local_6c._buf._0_4_; if (0xfff < uVar17) { pvVar16 = *(void **)(local_6c._buf._0_4_ + -4); uVar17 = local_6c._capacity + 0x24; if (0x1f < (uint)(local_6c._buf._0_4_ + (-4 - (int)pvVar16))) goto LAB_006ba431; } operator_delete(pvVar16,uVar17); } local_14._0_1_ = 3; local_14._1_3_ = 0; if ((bVar6) && (0xf < local_40)) { uVar17 = local_40 + 1; pvVar16 = local_54[0]; if (0xfff < uVar17) { pvVar16 = *(void **)((int)local_54[0] + -4); uVar17 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar16))) { LAB_006ba431: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar17); } if ((int)local_8c != 0) goto LAB_006ba5ec; pppppppbVar13 = local_b4; } LAB_006ba457: if (iVar15 != 0) { local_d1 = 1; psVar18 = *(std_string **)(param_2 + 0x10); if ((std_string *)(0x7fffffff - local_74) < psVar18) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar13 = (byte *******)local_84; if (0xf < local_70) { pppppppbVar13 = local_84[0]; } if (0xf < *(uint *)(param_2 + 0x14)) { param_2 = *(byte **)param_2; } std::string::concat(local_6c._buf,(int)in_ECX,psVar18,(byte *)pppppppbVar13,local_74,param_2, (uint)psVar18); local_14._0_1_ = 9; uVar14 = FUN_00651d50(&local_b4); FUN_004215a0(uVar14); std::string::_Tidy_deallocate((char *)local_54); local_14._0_1_ = 3; std::string::_Tidy_deallocate(local_6c._buf); ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)local_d0,&local_3c); FUN_004215a0(extraout_EAX_01); std::string::_Tidy_deallocate(local_d0); pbVar12 = (byte *)&local_3c; if (0xf < local_3c._capacity) { pbVar12 = (byte *)local_3c._buf._0_4_; } bVar7 = file_exists(pbVar12); bVar19 = bVar7 == 0; if (bVar19) { local_54[0] = (void *)0x0; local_44 = 0; local_40 = 0xf; std::string::assign((char *)local_54,&s_empty,0); ppvVar10 = local_54; } else { ppvVar10 = std::string::string(local_6c._buf,&local_3c); local_14._0_1_ = 10; } FUN_004215a0(ppvVar10); if ((bVar19) && (0xf < local_40)) { uVar17 = local_40 + 1; pvVar16 = local_54[0]; if (0xfff < uVar17) { pvVar16 = *(void **)((int)local_54[0] + -4); uVar17 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar16))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar17); } local_14._0_1_ = 3; local_14._1_3_ = 0; if (!bVar19) { std::string::_Tidy_deallocate(local_6c._buf); } if ((int)local_8c != 0) goto LAB_006ba5ec; pppppppbVar13 = local_b4; } if (param_3 != (undefined1 *)0x0) { *param_3 = 0; } std::string::string(in_ECX,in_EDX); if (0xf < local_8c._4_4_) { uVar17 = local_8c._4_4_ + 1; pvVar16 = local_9c; if (0xfff < uVar17) { pvVar16 = *(void **)((int)local_9c + -4); uVar17 = local_8c._4_4_ + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar16))) goto LAB_006ba81e; } operator_delete(pvVar16,uVar17); } if (0xf < local_3c._capacity) { uVar17 = local_3c._capacity + 1; pbVar12 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar17) { pbVar12 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar17 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar12))) goto LAB_006ba81e; } operator_delete(pbVar12,uVar17); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < local_a0) { uVar17 = local_a0 + 1; pppppppbVar11 = pppppppbVar13; if (0xfff < uVar17) { pppppppbVar11 = (byte *******)pppppppbVar13[-1]; uVar17 = local_a0 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbVar13 + (-4 - (int)pppppppbVar11))) goto LAB_006ba81e; } operator_delete(pppppppbVar11,uVar17); } if (local_70 < 0x10) { ExceptionList = local_1c; return; } uVar17 = local_70 + 1; pppppppbVar13 = local_84[0]; if (uVar17 < 0x1000) goto LAB_006ba6f3; pppppppbVar13 = (byte *******)local_84[0][-1]; iVar15 = (int)local_84[0] - (int)pppppppbVar13; } else { if (uVar17 == 0) goto LAB_006ba457; local_d1 = 1; if (0x7fffffff - local_74 < param_1->_size) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar13 = (byte *******)local_84; if (0xf < local_70) { pppppppbVar13 = local_84[0]; } psVar18 = param_1; if (0xf < param_1->_capacity) { psVar18 = *(std_string **)param_1->_buf; } std::string::concat((char *)local_54,(int)in_ECX,param_1,(byte *)pppppppbVar13,local_74, (byte *)psVar18,param_1->_size); local_14._0_1_ = 4; this = (char *)FUN_00651d50(param_2); local_14._0_1_ = 5; puVar9 = std::string::append(this,(byte *)&local_b4,4); local_d0._8_4_ = *puVar9; acStack_c4 = (char [4])puVar9[1]; uStack_c0 = puVar9[2]; uStack_bc = puVar9[3]; uVar2 = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; std::string::_Tidy_deallocate(local_3c._buf); local_3c._buf[0] = local_d0[8]; local_3c._buf[1] = local_d0[9]; local_3c._buf[2] = local_d0[10]; local_3c._buf[3] = local_d0[0xb]; local_3c._buf[4] = acStack_c4[0]; local_3c._buf[5] = acStack_c4[1]; local_3c._buf[6] = acStack_c4[2]; local_3c._buf[7] = acStack_c4[3]; local_3c._buf[8] = (undefined1)uStack_c0; local_3c._buf[9] = uStack_c0._1_1_; local_3c._buf[10] = uStack_c0._2_1_; local_3c._buf[0xb] = uStack_c0._3_1_; local_3c._buf[0xc] = (undefined1)uStack_bc; local_3c._buf[0xd] = uStack_bc._1_1_; local_3c._buf[0xe] = uStack_bc._2_1_; local_3c._buf[0xf] = uStack_bc._3_1_; local_14._0_1_ = 4; local_3c._16_8_ = uVar2; if (0xf < local_6c._capacity) { uVar8 = local_6c._capacity + 1; pvVar16 = (void *)local_6c._buf._0_4_; if (0xfff < uVar8) { pvVar16 = *(void **)(local_6c._buf._0_4_ + -4); uVar8 = local_6c._capacity + 0x24; if (0x1f < (uint)(local_6c._buf._0_4_ + (-4 - (int)pvVar16))) goto LAB_006b9ed9; } operator_delete(pvVar16,uVar8); } local_14._0_1_ = 3; local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; if (0xf < local_40) { uVar8 = local_40 + 1; pvVar16 = local_54[0]; if (0xfff < uVar8) { pvVar16 = *(void **)((int)local_54[0] + -4); uVar8 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar16))) { LAB_006b9ed9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar8); } local_44 = 0; local_40 = 0xf; local_54[0] = (void *)((uint)local_54[0] & 0xffffff00); ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)local_d0,&local_3c); if (&local_3c != (std_string *)extraout_EAX) { if (0xf < local_3c._capacity) { uVar8 = local_3c._capacity + 1; pbVar12 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar8) { pbVar12 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar8 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar12))) goto LAB_006b9fb0; } operator_delete(pbVar12,uVar8); } local_3c._buf._0_4_ = *extraout_EAX; local_3c._buf._4_4_ = extraout_EAX[1]; local_3c._buf._8_4_ = extraout_EAX[2]; local_3c._buf._12_4_ = extraout_EAX[3]; local_3c._16_8_ = *(undefined8 *)(extraout_EAX + 4); extraout_EAX[4] = 0; extraout_EAX[5] = 0xf; *(undefined1 *)extraout_EAX = 0; } if (0xf < uStack_bc) { uVar8 = uStack_bc + 1; pvVar16 = (void *)local_d0._0_4_; if (0xfff < uVar8) { pvVar16 = *(void **)(local_d0._0_4_ + -4); uVar8 = uStack_bc + 0x24; if (0x1f < (uint)(local_d0._0_4_ + (-4 - (int)pvVar16))) { LAB_006b9fb0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar8); } pbVar12 = (byte *)&local_3c; if (0xf < local_3c._capacity) { pbVar12 = (byte *)local_3c._buf._0_4_; } bVar7 = file_exists(pbVar12); if (bVar7 == 0) { bVar4 = false; bVar19 = true; local_6c._buf._0_4_ = (void *)0x0; local_6c._capacity = 0xf; ppvVar10 = (void **)&local_6c; local_6c._size = 0; LAB_006ba021: local_9c = *ppvVar10; pvStack_98 = ppvVar10[1]; pvStack_94 = ppvVar10[2]; pvStack_90 = ppvVar10[3]; local_8c = *(undefined8 *)(ppvVar10 + 4); ppvVar10[4] = (void *)0x0; ppvVar10[5] = (void *)0xf; *(undefined1 *)ppvVar10 = 0; } else { ppvVar10 = std::string::string((char *)local_54,&local_3c); local_14._0_1_ = 6; bVar4 = true; bVar19 = false; if (&local_9c != ppvVar10) goto LAB_006ba021; } if ((bVar19) && (0xf < local_6c._capacity)) { uVar8 = local_6c._capacity + 1; pvVar16 = (void *)local_6c._buf._0_4_; if (0xfff < uVar8) { pvVar16 = *(void **)(local_6c._buf._0_4_ + -4); uVar8 = local_6c._capacity + 0x24; if (0x1f < (uint)(local_6c._buf._0_4_ + (-4 - (int)pvVar16))) goto LAB_006ba0c3; } operator_delete(pvVar16,uVar8); } local_14._0_1_ = 3; local_14._1_3_ = 0; if ((bVar4) && (0xf < local_40)) { uVar8 = local_40 + 1; pvVar16 = local_54[0]; if (0xfff < uVar8) { pvVar16 = *(void **)((int)local_54[0] + -4); uVar8 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar16))) { LAB_006ba0c3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar8); } if ((int)local_8c == 0) { pppppppbVar13 = local_b4; goto LAB_006ba0ee; } LAB_006ba5ec: if (param_3 != (undefined1 *)0x0) { *param_3 = local_d1; } FUN_00417100(&local_9c); if (0xf < local_8c._4_4_) { uVar17 = local_8c._4_4_ + 1; pvVar16 = local_9c; if (0xfff < uVar17) { pvVar16 = *(void **)((int)local_9c + -4); uVar17 = local_8c._4_4_ + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar16))) goto LAB_006ba81e; } operator_delete(pvVar16,uVar17); } if (0xf < local_3c._capacity) { uVar17 = local_3c._capacity + 1; pbVar12 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar17) { pbVar12 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar17 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar12))) goto LAB_006ba81e; } operator_delete(pbVar12,uVar17); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < local_a0) { uVar17 = local_a0 + 1; pppppppbVar13 = local_b4; if (0xfff < uVar17) { pppppppbVar13 = (byte *******)local_b4[-1]; uVar17 = local_a0 + 0x24; if ((byte *)0x1f < (byte *)((int)local_b4 + (-4 - (int)pppppppbVar13))) goto LAB_006ba81e; } operator_delete(pppppppbVar13,uVar17); } if (local_70 < 0x10) { ExceptionList = local_1c; return; } uVar17 = local_70 + 1; pppppppbVar13 = local_84[0]; if (uVar17 < 0x1000) goto LAB_006ba6f3; pppppppbVar13 = (byte *******)local_84[0][-1]; iVar15 = (int)local_84[0] - (int)pppppppbVar13; } uVar17 = local_70 + 0x24; if (0x1f < iVar15 - 4U) { LAB_006ba81e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_006ba6f3: operator_delete(pppppppbVar13,uVar17); ExceptionList = local_1c; return; } //@@ 006ba840 Menu_Character::ChangeCharacterPage /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Menu_Character::ChangeCharacterPage(int menu); */ undefined4 __thiscall Menu_Character::ChangeCharacterPage(Menu_Character *this,undefined4 param_2) { byte bVar1; float fVar2; undefined1 *puVar3; uint uVar4; void **sourceName; int iVar5; byte *suffixCursor; void *freeBlock; char *suffix; uint uVar6; void *tmpString; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 tmpStringSize; uint tmpStringCapacity; void *sheetPath; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; bool isChampion; void **sourceNameSize; game = g_game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00afa6c5; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_2c = 0xf00000000; sheetPath = (void *)0x0; local_14 = 0; uVar6 = (this->_SeedEntrySprite)._animDefaultName._size; local_24 = uVar4; if ((int)uVar6 < 0) { LAB_006ba908: puVar3 = (undefined1 *)((int)register0x00000010 + -4); if (*(char *)((int)(this->_GreedDecoOverlaySprite)._color._offset[0] + 0xcd) != '\0') { uVar6 = Level::GetStageID(); std::string::string((char *)&tmpString,game->_ventricleRazorPortals + uVar6 * 0xc4 + 0x5e4); sheetPath = tmpString; uStack_38 = uStack_50; uStack_34 = uStack_4c; uStack_30 = uStack_48; local_2c = CONCAT44(tmpStringCapacity,tmpStringSize); puVar3 = puStack_20; } } else { fVar2 = (this->_GreedDecoOverlaySprite)._color._offset[0]; iVar5 = *(int *)((int)fVar2 + 0x68); if ((*(int *)((int)fVar2 + 0x6c) - iVar5) / 0x7c <= (int)uVar6) goto LAB_006ba908; sourceName = (void **)(uVar6 * 0x7c + 0x2c + iVar5); puVar3 = (undefined1 *)((int)register0x00000010 + -4); if (&sheetPath != sourceName) { sourceNameSize = sourceName + 4; if ((void *)0xf < sourceName[5]) { sourceName = *sourceName; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); std::string::assign((char *)&sheetPath,(byte *)sourceName,(uint)*sourceNameSize); puVar3 = puStack_20; } } puStack_20 = puVar3; if ((((*(char *)((int)&(this->_SeedEntrySprite)._filename._size + 3) == '\0') || (uVar6 = (this->_SeedEntrySprite)._filename._capacity, 0x19 < uVar6)) || (iVar5 = uVar6 * 0x40, iVar5 == -0xc354c0)) || (*(float *)(&DAT_00c354cc + iVar5) <= 0.0)) { isChampion = false; } else { isChampion = true; } tmpStringSize = 0; suffix = "_champion"; tmpStringCapacity = 0xf; if (!isChampion) { suffix = (char *)&s_empty; } tmpString = (void *)0x0; suffixCursor = (byte *)suffix; do { bVar1 = *suffixCursor; suffixCursor = suffixCursor + 1; } while (bVar1 != 0); std::string::assign((char *)&tmpString,(byte *)suffix,(int)suffixCursor - (int)(suffix + 1)); local_14 = CONCAT31(local_14._1_3_,1); anm2_resolve_spritesheet_path(&sheetPath,&tmpString,0,uVar4); if (0xf < tmpStringCapacity) { uVar6 = tmpStringCapacity + 1; freeBlock = tmpString; if (0xfff < uVar6) { freeBlock = *(void **)((int)tmpString + -4); uVar6 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)freeBlock))) goto LAB_006baa37; } operator_delete(freeBlock,uVar6); } if (0xf < local_2c._4_4_) { uVar6 = local_2c._4_4_ + 1; freeBlock = sheetPath; if (0xfff < uVar6) { freeBlock = *(void **)((int)sheetPath + -4); uVar6 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)sheetPath + (-4 - (int)freeBlock))) { LAB_006baa37: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar6); } ExceptionList = local_1c; return param_2; } //@@ 006baa70 _NpcHelper::spider_load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? ? load_graphics + anm path redirect, spider AIs */ undefined4 _NpcHelper::spider_load_graphics(byte *param_1) { byte bVar1; uint uVar2; int tag; byte *******pppppppbVar3; char *extraout_EAX; byte *pbVar4; byte *pbVar5; Entity_NPC *in_ECX; std_string *psVar6; std_string *psVar7; void *pvVar8; bool bVar9; void *local_9c [5]; uint local_88; void *local_84 [4]; undefined4 local_74; uint local_70; byte *******local_6c [4]; uint local_5c; uint local_58; std_string *local_54 [4]; uint local_44; uint local_40; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; puStack_20 = (undefined1 *)(local_6c + 0x1a); local_14 = (byte ******)0xffffffff; puStack_18 = &LAB_00afa720; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_6c + 0x17); pvVar8 = in_ECX->_config; if (*(int *)((int)pvVar8 + 0x84) == 0) { return 0; } pbVar4 = (byte *)((int)pvVar8 + 0x74); if (0xf < *(uint *)((int)pvVar8 + 0x88)) { pbVar4 = *(byte **)((int)pvVar8 + 0x74); } ExceptionList = &local_1c; local_24 = uVar2; tag = std::string::find_last_of(pbVar4,*(uint *)((int)pvVar8 + 0x84),0xffffffff,&DAT_00b1cebc,1); if (tag == -1) { ExceptionList = local_1c; return 0; } FUN_00651a90(local_9c,tag,0xffffffff); local_14 = (byte ******)0x0; FUN_00651a90(local_6c,0,tag); local_14._0_1_ = 1; psVar7 = *(std_string **)(param_1 + 0x10); if ((std_string *)(0x7fffffff - local_5c) < psVar7) { /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar2); } pppppppbVar3 = (byte *******)local_6c; if (0xf < local_58) { pppppppbVar3 = local_6c[0]; } if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::concat((char *)local_84,tag,psVar7,(byte *)pppppppbVar3,local_5c,param_1,(uint)psVar7 ); local_14._0_1_ = 2; FUN_00651d50(local_9c); local_14._0_1_ = 4; if (0xf < local_70) { uVar2 = local_70 + 1; pvVar8 = local_84[0]; if (0xfff < uVar2) { pvVar8 = *(void **)((int)local_84[0] + -4); uVar2 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar2); } local_74 = 0; local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)local_54,&local_3c); if (&local_3c != (std_string *)extraout_EAX) { std::string::_Tidy_deallocate(local_3c._buf); local_3c._buf._0_4_ = *(undefined4 *)extraout_EAX; local_3c._buf._4_4_ = *(undefined4 *)(extraout_EAX + 4); local_3c._buf._8_4_ = *(undefined4 *)(extraout_EAX + 8); local_3c._buf._12_4_ = *(undefined4 *)(extraout_EAX + 0xc); local_3c._16_8_ = *(undefined8 *)(extraout_EAX + 0x10); extraout_EAX[0x10] = '\0'; extraout_EAX[0x11] = '\0'; extraout_EAX[0x12] = '\0'; extraout_EAX[0x13] = '\0'; extraout_EAX[0x14] = '\x0f'; extraout_EAX[0x15] = '\0'; extraout_EAX[0x16] = '\0'; extraout_EAX[0x17] = '\0'; *extraout_EAX = '\0'; } if (0xf < local_40) { uVar2 = local_40 + 1; psVar7 = local_54[0]; if (0xfff < uVar2) { psVar7 = (std_string *)local_54[0][-1]._capacity; uVar2 = local_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54[0] + (-4 - (int)psVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar7,uVar2); } pbVar4 = (byte *)&local_3c; if (0xf < local_3c._capacity) { pbVar4 = (byte *)local_3c._buf._0_4_; } pbVar4 = FileSystem::ResolvePath(pbVar4); if (pbVar4 == (byte *)0x0) { if (0xf < local_3c._capacity) { uVar2 = local_3c._capacity + 1; pbVar4 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar2) { pbVar4 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar2 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar4))) goto LAB_006baefa; } operator_delete(pbVar4,uVar2); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < local_58) { uVar2 = local_58 + 1; pppppppbVar3 = local_6c[0]; if (0xfff < uVar2) { pppppppbVar3 = (byte *******)local_6c[0][-1]; uVar2 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)pppppppbVar3))) goto LAB_006baefa; } operator_delete(pppppppbVar3,uVar2); } if (local_88 < 0x10) { ExceptionList = local_1c; return 0; } uVar2 = local_88 + 1; pvVar8 = local_9c[0]; if (0xfff < uVar2) { pvVar8 = *(void **)((int)local_9c[0] + -4); uVar2 = local_88 + 0x24; if (0x1f < (uint)((int)local_9c[0] + (-4 - (int)pvVar8))) { LAB_006baefa: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar2); ExceptionList = local_1c; return 0; } local_14._0_1_ = 5; tracked_alloc(1,pbVar4,0); local_14._0_1_ = 4; ANM2::GetAnimation((ANM2 *)&(in_ECX->_sprite)._animState,(std_string *)local_54); local_14 = (byte ******)CONCAT31(local_14._1_3_,6); ANM2::Load(&in_ECX->_sprite,&local_3c,1); if (local_44 != 0) { pbVar4 = (in_ECX->_sprite)._animState._animData; psVar7 = (std_string *)local_54; if (0xf < local_40) { psVar7 = local_54[0]; } if (pbVar4 != (byte *)0x0) { pbVar5 = pbVar4; psVar6 = psVar7; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar5 = *(byte **)pbVar4; } do { bVar1 = *pbVar5; bVar9 = bVar1 < (byte)psVar6->_buf[0]; if (bVar1 != psVar6->_buf[0]) { LAB_006bad20: uVar2 = -(uint)bVar9 | 1; goto LAB_006bad25; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar9 = bVar1 < (byte)psVar6->_buf[1]; if (bVar1 != psVar6->_buf[1]) goto LAB_006bad20; pbVar5 = pbVar5 + 2; psVar6 = (std_string *)(psVar6->_buf + 2); } while (bVar1 != 0); uVar2 = 0; LAB_006bad25: if ((uVar2 == 0) && ((pbVar4[0x34] == 0 || ((in_ECX->_sprite)._animState._isPlaying != 0)))) goto LAB_006bad5a; } bVar1 = ANM2::SetAnimation(&in_ECX->_sprite,(byte *)psVar7,1); if (bVar1 != 0) { AnimationState::Rewind(&(in_ECX->_sprite)._animState); (in_ECX->_sprite)._animState._isPlaying = 1; } } LAB_006bad5a: Entity_NPC::load_graphics(in_ECX,0); if (0xf < local_40) { uVar2 = local_40 + 1; psVar7 = local_54[0]; if (0xfff < uVar2) { psVar7 = (std_string *)local_54[0][-1]._capacity; uVar2 = local_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54[0] + (-4 - (int)psVar7))) goto LAB_006bae48; } operator_delete(psVar7,uVar2); } local_44 = 0; local_40 = 0xf; local_54[0] = (std_string *)((uint)local_54[0] & 0xffffff00); if (0xf < local_3c._capacity) { uVar2 = local_3c._capacity + 1; pbVar4 = (byte *)local_3c._buf._0_4_; if (0xfff < uVar2) { pbVar4 = *(byte **)(local_3c._buf._0_4_ + 0xfffffffc); uVar2 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)pbVar4))) goto LAB_006bae48; } operator_delete(pbVar4,uVar2); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < local_58) { uVar2 = local_58 + 1; pppppppbVar3 = local_6c[0]; if (0xfff < uVar2) { pppppppbVar3 = (byte *******)local_6c[0][-1]; uVar2 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)pppppppbVar3))) goto LAB_006bae48; } operator_delete(pppppppbVar3,uVar2); } if (0xf < local_88) { uVar2 = local_88 + 1; pvVar8 = local_9c[0]; if (0xfff < uVar2) { pvVar8 = *(void **)((int)local_9c[0] + -4); uVar2 = local_88 + 0x24; if (0x1f < (uint)((int)local_9c[0] + (-4 - (int)pvVar8))) { LAB_006bae48: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar2); } ExceptionList = local_1c; return 1; } //@@ 006baf40 Entity_NPC::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_NPC::load_graphics(bool param_1); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_NPC::load_graphics(Entity_NPC *this,byte param_2) { byte bVar1; std_string *psVar2; void **bossColorPath; LayerState *layer; int iVar3; byte *suffixEnd; ANM2 *sprite; std_string *psVar4; undefined1 *size; byte ******ppppppbVar5; byte ******ppppppbVar6; void *freeBlock; ColorMod *championColor; uint uVar7; char *pcVar8; uint uVar9; undefined4 local_118 [8]; undefined4 local_f8; undefined4 uStack_f4; undefined4 local_f0; float local_ec; float fStack_e8; float fStack_e4; float fStack_e0; float local_dc; float fStack_d8; float fStack_d4; float fStack_d0; undefined8 local_cc; float local_c4; Entity_NPC *self; Sprite *layerSprite; byte ******local_b8; uint local_b4; byte *layerIndex; LayerState *local_ac; undefined *local_a8; uint local_a4; char isDirtColorNeeded; char isChampionSheetUsed; byte local_9d; void *resolvedSheetPath; char acStack_98 [4]; char acStack_94 [4]; char acStack_90 [4]; uint resolvedSheetPathSize; uint resolvedSheetPathCapacity; void *championSuffix [4]; undefined4 championSuffixSize; uint championSuffixCapacity; void *sheetOverridePath; char acStack_68 [4]; char acStack_64 [4]; char acStack_60 [4]; uint sheetOverridePathSize; uint sheetOverridePathCapacity; std_string local_54; byte ******layerString [4]; uint layerStringSize; uint layerStringCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte *****local_14; void **bossColorPathSize; Game *game; bool isChampionColored; int *spriteBitflags; puStack_20 = (undefined1 *)(layerString + 0xe); local_14 = (byte *****)0xffffffff; puStack_18 = &LAB_00afa79f; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(layerString + 0xb); ExceptionList = &local_1c; uVar9 = 0; local_b4 = 0; self = this; ppppppbVar6 = (byte ******)(layerString + 0xe); if (param_2 != 0) { if (this->_bosscoloridx < 0) { LAB_006bafec: psVar2 = (std_string *)((int)this->_config + 0x74); } else { local_a8 = *(undefined **)((int)this->_config + 0x68); if ((*(int *)((int)this->_config + 0x6c) - (int)local_a8) / 0x7c <= this->_bosscoloridx) goto LAB_006bafec; iVar3 = this->_bosscoloridx * 0x7c; if (*(int *)(local_a8 + iVar3 + 0x54) == 0) goto LAB_006bafec; psVar2 = (std_string *)(local_a8 + iVar3 + 0x44); } ANM2::Load(&this->_sprite,psVar2,0); local_ac = (LayerState *)&(g_game->_seedEffects)._seedEffects; local_a8 = (undefined *)0x4f; std::set::find_node(local_54._buf + 0xc,&local_a8); ppppppbVar6 = (byte ******)puStack_20; if ((((*(char *)(local_54._capacity + 0xd) == '\0') && (*(int *)(local_54._capacity + 0x10) < 0x50)) && ((undefined1 *)local_54._capacity != local_ac->_layerData)) && ((this->_type == 0x66 && (this->_variant == 1)))) { local_54._size = 0; local_54._capacity = 0xf; local_54._buf[0] = '\0'; local_54._buf[1] = '\0'; local_54._buf[2] = '\0'; local_54._buf[3] = '\0'; local_54._buf._0_4_ = std::_Allocate(0x40); local_54._size = 0x35; local_54._capacity = 0x3f; builtin_strncpy((char *)local_54._buf._0_4_, "gfx/promo/gfuel/102.001_g baby (true final boss).anm2",0x36); local_14 = (byte *****)0x0; ANM2::Load(&this->_sprite,&local_54,1); local_14 = (byte *****)0xffffffff; if (0xf < local_54._capacity) { uVar7 = local_54._capacity + 1; pcVar8 = (char *)local_54._buf._0_4_; if (0xfff < uVar7) { pcVar8 = *(char **)(local_54._buf._0_4_ + -4); uVar7 = local_54._capacity + 0x24; if ((char *)0x1f < (char *)(local_54._buf._0_4_ + (-4 - (int)pcVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar8,uVar7); } local_54._size = 0; local_54._capacity = (uint)&DAT_0000000f; local_54._buf._0_4_ = local_54._buf._0_4_ & 0xffffff00; ppppppbVar6 = (byte ******)puStack_20; } } puStack_20 = (undefined1 *)ppppppbVar6; game = g_game; sheetOverridePathSize = 0; sheetOverridePathCapacity = 0xf; sheetOverridePath = (void *)0x0; local_14 = (byte *****)0x1; if (this->_bosscoloridx < 0) { LAB_006bb1b0: if (*(char *)((int)this->_config + 0xcd) != '\0') { uVar9 = Level::GetStageID(); std::string::string((char *)&resolvedSheetPath, game->_ventricleRazorPortals + uVar9 * 0xc4 + 0x5e4); uVar9 = 4; sheetOverridePath = resolvedSheetPath; acStack_68[0] = acStack_98[0]; acStack_68[1] = acStack_98[1]; acStack_68[2] = acStack_98[2]; acStack_68[3] = acStack_98[3]; acStack_64[0] = acStack_94[0]; acStack_64[1] = acStack_94[1]; acStack_64[2] = acStack_94[2]; acStack_64[3] = acStack_94[3]; acStack_60[0] = acStack_90[0]; acStack_60[1] = acStack_90[1]; acStack_60[2] = acStack_90[2]; acStack_60[3] = acStack_90[3]; sheetOverridePathSize = resolvedSheetPathSize; sheetOverridePathCapacity = resolvedSheetPathCapacity; } } else { local_a8 = *(undefined **)((int)this->_config + 0x68); if ((*(int *)((int)this->_config + 0x6c) - (int)local_a8) / 0x7c <= this->_bosscoloridx) goto LAB_006bb1b0; bossColorPath = (void **)(local_a8 + this->_bosscoloridx * 0x7c + 0x2c); if (&sheetOverridePath != bossColorPath) { bossColorPathSize = bossColorPath + 4; if ((void *)0xf < bossColorPath[5]) { bossColorPath = *bossColorPath; } std::string::assign((char *)&sheetOverridePath,(byte *)bossColorPath,(uint)*bossColorPathSize) ; } } isChampionSheetUsed = '\0'; isDirtColorNeeded = '\0'; if ((this->_isChampion == 0) || (0x19 < (uint)this->_championColorIdx)) { local_a8 = (undefined *)0x0; LAB_006bb24b: isChampionColored = false; } else { iVar3 = this->_championColorIdx * 0x40; local_a8 = &DAT_00c354c0 + iVar3; if (local_a8 == (undefined *)0x0) goto LAB_006bb24b; if (*(float *)(&DAT_00c354cc + iVar3) <= 0.0) goto LAB_006bb24b; isChampionColored = true; } championSuffixSize = 0; pcVar8 = "_champion"; championSuffixCapacity = 0xf; if (!isChampionColored) { pcVar8 = (char *)&s_empty; } championSuffix[0] = (void *)0x0; local_ac = (LayerState *)(pcVar8 + 1); suffixEnd = (byte *)pcVar8; do { bVar1 = *suffixEnd; suffixEnd = suffixEnd + 1; } while (bVar1 != 0); std::string::assign((char *)championSuffix,(byte *)pcVar8,(int)suffixEnd - (int)local_ac); local_14._0_1_ = 2; layerIndex = (byte *)0x0; if ((this->_sprite)._layerCount == 0) { LAB_006bb675: championColor = &(this->_sprite)._championColor; local_f8 = 0; uStack_f4 = 0; local_f0 = 0; if (championColor != (ColorMod *)local_118) { local_c4 = 0.0; (this->_sprite)._championColor._colorize[0] = 0.0; (this->_sprite)._championColor._colorize[1] = 0.0; (this->_sprite)._championColor._colorize[2] = 0.0; (this->_sprite)._championColor._colorize[3] = 0.0; local_cc = 0; championColor->_tint[0] = 0.0; (this->_sprite)._championColor._tint[1] = 0.0; (this->_sprite)._championColor._tint[2] = 0.0; (this->_sprite)._championColor._tint[3] = 0.0; LAB_006bb6be: *(undefined8 *)championColor->_offset = local_cc; championColor->_offset[2] = local_c4; } } else { sprite = &this->_sprite; layerSprite = (Sprite *)sprite; do { layer = ANM2::GetLayer(sprite,layerIndex); local_ac = layer; if (layer->_layerData == (void *)0x0) { layerStringSize = 0; layerStringCapacity = 0xf; layerString[0] = (byte ******)0x0; } else { std::string::string((char *)layerString,(void *)((int)layer->_layerData + 8)); } local_b4 = uVar9 | 9; local_14._0_1_ = 3; ppppppbVar6 = (byte ******)layerString; if (0xf < layerStringCapacity) { ppppppbVar6 = layerString[0]; } local_b8 = layerString[0]; local_a4 = local_b4; bVar1 = str_eq((byte *)ppppppbVar6,layerStringSize,&DAT_00b64428,4); if (bVar1 == 0) { if (layer->_layerData == (void *)0x0) { local_54._buf._0_4_ = (std_string *)0x0; local_54._capacity = (uint)&DAT_0000000f; local_54._size = 0; } else { std::string::string(local_54._buf,(void *)((int)layer->_layerData + 8)); } psVar2 = (std_string *)local_54._buf._0_4_; local_a4 = uVar9 | 0x1b; psVar4 = &local_54; if (&DAT_0000000f < local_54._capacity) { psVar4 = (std_string *)local_54._buf._0_4_; } bVar1 = str_eq((byte *)psVar4,local_54._size,&DAT_00b1d57c,4); if (bVar1 != 0) goto LAB_006bb394; local_9d = 0; } else { psVar2 = (std_string *)local_54._buf._0_4_; LAB_006bb394: local_9d = 1; } if ((local_a4 & 2) != 0) { local_a4 = local_a4 & 0xfffffffd; if (&DAT_0000000f < local_54._capacity) { size = (undefined1 *)(local_54._capacity + 1); psVar4 = psVar2; if ((undefined1 *)0xfff < size) { psVar4 = (std_string *)psVar2[-1]._capacity; size = (undefined1 *)(local_54._capacity + 0x24); if ((byte *)0x1f < (byte *)((int)psVar2 + (-4 - (int)psVar4))) goto LAB_006bb75e; } operator_delete(psVar4,(uint)size); } } local_14._0_1_ = 2; local_14._1_3_ = 0; if ((local_a4 & 1) != 0) { local_a4 = local_a4 & 0xfffffffe; if (0xf < layerStringCapacity) { uVar9 = layerStringCapacity + 1; ppppppbVar6 = local_b8; if (0xfff < uVar9) { ppppppbVar6 = (byte ******)local_b8[-1]; uVar9 = layerStringCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)local_b8 + (-4 - (int)ppppppbVar6))) goto LAB_006bb75e; } operator_delete(ppppppbVar6,uVar9); } } layer = local_ac; if (local_9d != 0) { local_ac->_bitflags = local_ac->_bitflags | 1; isDirtColorNeeded = '\x01'; } local_a4 = local_a4 | 0x20; if (local_ac->_layerData == (void *)0x0) { layerStringCapacity = 0xf; layerString[0] = (byte ******)0x0; layerStringSize = 0; } else { std::string::string((char *)layerString,(void *)((int)local_ac->_layerData + 8)); } ppppppbVar6 = layerString[0]; ppppppbVar5 = (byte ******)layerString; if (0xf < layerStringCapacity) { ppppppbVar5 = layerString[0]; } local_9d = str_eq((byte *)ppppppbVar5,layerStringSize,(byte *)"Hole2",5); if (0xf < layerStringCapacity) { uVar9 = layerStringCapacity + 1; ppppppbVar5 = ppppppbVar6; if (0xfff < uVar9) { ppppppbVar5 = (byte ******)ppppppbVar6[-1]; uVar9 = layerStringCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbVar6 + (-4 - (int)ppppppbVar5))) goto LAB_006bb75e; } operator_delete(ppppppbVar5,uVar9); } if (local_9d != 0) { layer->_bitflags = layer->_bitflags | 1; } uVar9 = local_a4 | 0x40; local_9d = 0; if (layer->_layerData == (void *)0x0) { layerStringCapacity = 0xf; layerStringSize = 0; layerString[0] = (byte ******)0x0; } else { std::string::string((char *)layerString,(void *)((int)layer->_layerData + 0x20)); } local_14._0_1_ = 4; anm2_resolve_spritesheet_path(&sheetOverridePath,championSuffix,&local_9d); local_14._0_1_ = 6; if (0xf < layerStringCapacity) { uVar7 = layerStringCapacity + 1; ppppppbVar6 = layerString[0]; if (0xfff < uVar7) { ppppppbVar6 = (byte ******)layerString[0][-1]; uVar7 = layerStringCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)layerString[0] + (-4 - (int)ppppppbVar6))) goto LAB_006bb75e; } operator_delete(ppppppbVar6,uVar7); } Sprite::ReplaceSpritesheet(layerSprite,(int)layerIndex,(std_string *)&resolvedSheetPath); if (local_9d == 0) { uVar7 = layer->_bitflags & 0xffffffef; } else { isChampionSheetUsed = '\x01'; uVar7 = layer->_bitflags | 0x10; } local_14._0_1_ = 2; layer->_bitflags = uVar7; if (0xf < resolvedSheetPathCapacity) { uVar7 = resolvedSheetPathCapacity + 1; freeBlock = resolvedSheetPath; if (0xfff < uVar7) { freeBlock = *(void **)((int)resolvedSheetPath + -4); uVar7 = resolvedSheetPathCapacity + 0x24; if (0x1f < (uint)((int)resolvedSheetPath + (-4 - (int)freeBlock))) goto LAB_006bb75e; } operator_delete(freeBlock,uVar7); } this = self; layerIndex = layerIndex + 1; sprite = &self->_sprite; } while (layerIndex < (byte *)(self->_sprite)._layerCount); if ((isChampionSheetUsed == '\0') || (local_a8 == (undefined *)0x0)) goto LAB_006bb675; Color::Color(local_a8); championColor = &(this->_sprite)._championColor; if (championColor != (ColorMod *)&local_ec) { championColor->_tint[0] = local_ec; (this->_sprite)._championColor._tint[1] = fStack_e8; (this->_sprite)._championColor._tint[2] = fStack_e4; (this->_sprite)._championColor._tint[3] = fStack_e0; (this->_sprite)._championColor._colorize[0] = local_dc; (this->_sprite)._championColor._colorize[1] = fStack_d8; (this->_sprite)._championColor._colorize[2] = fStack_d4; (this->_sprite)._championColor._colorize[3] = fStack_d0; goto LAB_006bb6be; } } if ((this->_type == 0x3b6) || ((this->_type == 0x3c0 && (this->_variant == 4)))) { spriteBitflags = &(this->_sprite)._bitflags; *spriteBitflags = *spriteBitflags | 0x20; } else { spriteBitflags = &(this->_sprite)._bitflags; *spriteBitflags = *spriteBitflags & 0xffffffdf; } ANM2::LoadGraphics(&this->_sprite,(byte)championColor); if (isDirtColorNeeded != '\0') { UpdateDirtColor(this,1); } if (0xf < championSuffixCapacity) { uVar9 = championSuffixCapacity + 1; freeBlock = championSuffix[0]; if (0xfff < uVar9) { freeBlock = *(void **)((int)championSuffix[0] + -4); uVar9 = championSuffixCapacity + 0x24; if (0x1f < (uint)((int)championSuffix[0] + (-4 - (int)freeBlock))) goto LAB_006bb75e; } operator_delete(freeBlock,uVar9); } if (0xf < sheetOverridePathCapacity) { uVar9 = sheetOverridePathCapacity + 1; freeBlock = sheetOverridePath; if (0xfff < uVar9) { freeBlock = *(void **)((int)sheetOverridePath + -4); uVar9 = sheetOverridePathCapacity + 0x24; if (0x1f < (uint)((int)sheetOverridePath + (-4 - (int)freeBlock))) { LAB_006bb75e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar9); } ExceptionList = local_1c; return; } //@@ 006bb790 Entity_NPC::champion_init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: NPC init: champion roll (0.05, Champion Belt 0.2, Purple Heart x3 / bosses x2); ZHL exact sig hit Game::RestoreState wrongly (trinkets-cards) */ void __thiscall Entity_NPC::champion_init(Entity_NPC *this) { void *pvVar1; byte bVar2; char hasRoomConfigFlag; std_string *anim; Entity_Player *championBeltOwner; int iVar3; uint uVar4; PlayerManager *playerManager; uint uVar5; Game *game; RNG rng; RNG local_ac; float local_9c; char local_95; float championChance; Color bossColor; char local_64 [24]; char local_4c [24]; char local_34 [24]; float bossColorScale; float bossColorHealthMultiplier; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; float maxHitPoints; char *room; float scaleX; local_8 = 0xffffffff; puStack_c = &LAB_00afa7e0; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; rng._seed = this->_initSeed; rng._shift1 = 1; rng._shift2 = 5; rng._shift3 = 0x10; this->_isBoss = 0; Entity::LoadEntityConfig((Entity *)this,local_14); if (this->_config == (void *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] No entity config for NPC %d.%d\n"); ExceptionList = local_10; return; } load_graphics(this,1); anim = &(this->_sprite)._animDefaultName; (this->_sprite)._scale.x = g_vectorOne.x; (this->_sprite)._scale.y = g_vectorOne.y; if (0xf < (this->_sprite)._animDefaultName._capacity) { anim = *(std_string **)(this->_sprite)._animDefaultName._buf; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } pvVar1 = this->_config; championChance = 0.05; this->_canShutDoors = *(byte *)((int)pvVar1 + 0x58); this->_isBoss = *(byte *)((int)pvVar1 + 0x2c); this->_shieldStrength = *(float *)((int)pvVar1 + 0xe0); playerManager = &g_game->_playerManager; this->_shieldFrames = *(int *)((int)pvVar1 + 0xe4); championBeltOwner = PlayerManager::FirstCollectibleOwner(playerManager,0xd0,(RNG **)playerManager,1); if (championBeltOwner != (Entity_Player *)0x0) { championChance = 0.2; } if (g_game->_stage == 0xc) { championChance = 0.75; } bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); if (bVar2 != 0) { iVar3 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,5); championChance = (float)iVar3 * 3.0 * championChance; } game = g_game; room = g_game->_room; local_95 = *room; if (local_95 != '\0') { championChance = championChance * 0.2; } local_9c = 1.82169e-44; std::set::find_node(&local_ac._shift1,&local_9c); if (((*(char *)(local_ac._shift3 + 0xd) == '\0') && (*(int *)(local_ac._shift3 + 0x10) < 0xe)) && ((void *)local_ac._shift3 != (game->_seedEffects)._seedEffects)) { championChance = 1.0; } pvVar1 = this->_config; if (this->_isBoss == 0) { if ((((*(char *)((int)pvVar1 + 0x34) != '\0') && (this->_isChampion == 0)) && (((local_95 == '\0' && (hasRoomConfigFlag = Room::has_room_config_flag(4), hasRoomConfigFlag == '\0')) && ((*(int *)(room + 8) != 5 || (this->_type != 0x379)))))) && ((local_9c = RNG::RandomFloat(&rng), local_9c < championChance || ((g_game->_challenge == 0x22 || ((0 < g_game->_victoryLap && (local_9c = RNG::RandomFloat(&rng), local_9c < 0.25)))))))) { this->_isChampion = 1; } } else { uVar5 = (*(int *)((int)pvVar1 + 0x6c) - *(int *)((int)pvVar1 + 0x68)) / 0x7c; if ((this->_spawnerEntity != (EntityPtr)0x0) && (*(int *)((int)this->_spawnerEntity + 0x28) == 0x19b)) { uVar5 = 0; } if (DAT_00c71670 == '\0') { if (((0 < (int)uVar5) && (this->_subtype == 0)) && (((g_manager->_persistentGameData)._achievements[3] != 0 || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))) )))) { championChance = 0.1; if (((g_manager->_persistentGameData)._achievements[0x21] != 0) || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0))) ))) { championChance = 0.3; } if (game->_difficulty == 3) { championChance = 0.6; } bVar2 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,5); if (bVar2 != 0) { iVar3 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,5); championChance = ((float)iVar3 + (float)iVar3) * championChance; } if ((g_game->_challenge == 0x22) || (0 < g_game->_victoryLap)) { championChance = 1.0; } iVar3 = *(int *)((int)g_game->_room + 4); local_ac._seed = 0; if (iVar3 != 0) { local_ac._seed = *(int *)(iVar3 + 0x5c); } local_ac._shift1 = 1; local_ac._shift2 = 0xb; local_ac._shift3 = 0x10; local_9c = RNG::RandomFloat(&local_ac); if (local_9c < championChance) { uVar4 = RNG::RandomInt(&local_ac,uVar5); this->_subtype = uVar4 + 1; } game = g_game; if (((*(int *)this->_config == 0x2d) && (this->_subtype == 2)) && (g_game->_challenge == 0x1e)) { this->_subtype = 0; } } } else { uVar5 = 0; DAT_00c71670 = '\0'; } if ((game->_stageType == 4) || (game->_stageType == 5)) { if (*(int *)this->_config == 0x2d) { this->_subtype = 3; } else if (*(int *)this->_config == 0x4e) { this->_subtype = 1; } } uVar4 = this->_subtype; if ((uVar4 != 0) && (uVar4 <= uVar5)) { Color::copy_constructor_ext (&bossColor,(void *)(*(int *)((int)this->_config + 0x68) + uVar4 * 0x7c + -0x7c)); local_8 = 0; iVar3 = this->_subtype + -1; this->_bosscoloridx = iVar3; if ((iVar3 < 0) || ((int)uVar5 <= iVar3)) { KAGE_LogMessage(1,(byte *)"Invalid boss color idx: %d\n"); this->_bosscoloridx = -1; } else { scaleX = (this->_sprite)._scale.x; (this->_sprite)._scale.y = bossColorScale * (this->_sprite)._scale.y; maxHitPoints = this->_maxHitPoints; (this->_sprite)._scale.x = bossColorScale * scaleX; this->_scale = bossColorScale; this->_maxHitPoints = bossColorHealthMultiplier * maxHitPoints; } (**(code **)(*(int *)this + 0x60))(); load_graphics(this,1); ANM2::SetFrame(&this->_sprite,&(this->_sprite)._animDefaultName,0); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_34); std::string::_Tidy_deallocate(local_4c); std::string::_Tidy_deallocate(local_64); } } if (DAT_00c71670 == '\0') { if (this->_isChampion != 0) { iVar3 = this->_championColorIdx; uVar5 = RNG::Next(&rng); MakeChampion(this,uVar5,iVar3,1); } } else { this->_isChampion = 0; DAT_00c71670 = '\0'; } ExceptionList = local_10; return; } //@@ 006bbdc0 Entity_Pickup::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] void Update(); */ void __thiscall Entity_Pickup::Update(Entity_Pickup *this) { EntityPtr *pEVar1; code *pcVar2; BitSet128 flags; ANM2 *pAVar3; byte bVar4; char cVar5; EntityPtr rootParent; uint uVar6; Entity_Player *pEVar7; uint uVar8; Entity *spawned; int iVar9; float *pfVar10; Entity **ppEVar11; Entity_Tear *vasculitisTear; undefined4 *playerSlot; int iVar12; ItemConfig_Item *item; float fVar13; int *piVar14; void *pvVar15; int extraout_EDX; Entity_Player *pEVar16; float fVar17; Entity_Pickup *pEVar18; PlayerManager *playerManager; uint *puVar19; EntityPtr EVar20; bool bVar21; double dVar22; undefined4 uVar23; TypeDescriptor *pTVar24; TypeDescriptor *pTVar25; undefined4 uVar26; Vector gimpyHeartPos; Vector blackHeartDropPos; Vector redHeartDropPos; undefined8 coinRngShifts; undefined4 local_1cc; undefined8 local_1c4; undefined4 local_1bc; undefined8 local_1b4; undefined4 local_1ac; Vector coinDropPos; Vector tearPos; Vector tearVelocity; Vector cantrippedCardPos; Vector cantrippedCardVelocity; Vector boneSpurPos; Vector healEffectPos; Vector runeDropPos; Vector cardDropPos; undefined8 tearRngShifts; undefined4 local_154; Vector boneSpurVelocity; undefined8 local_144; undefined4 local_13c; float tearDamage; int hungrySoulSoundId; int boneSpurSoundId; int soundId; Vector local_128; Entity *local_120; Vector local_11c; EntityPtr local_114; char local_10d; Entity_Player *local_10c; Entity_Player *local_108; Entity_Pickup *self; undefined8 local_100; undefined8 uStack_f8; Entity_Pickup *local_f0; Entity_Player *local_ec; byte local_e5; Vector local_e4; Vector local_dc; Entity_Player *local_d4; Entity_Player *local_d0; EntityPtr local_cc; ColorMod particleColor; undefined4 tearColor; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 local_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 poofColor; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 local_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined8 local_40; undefined4 local_38; undefined8 local_30; undefined4 local_28; undefined8 rngShifts; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; void *trinketRngBegin; local_8 = 0xffffffff; puStack_c = &LAB_00afa820; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; if ((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 1)) { iVar9 = this->_type; if (0x3dd < iVar9 - 10U) { return; } if (iVar9 == 0x21) { return; } if (iVar9 == 0x11) { return; } if (iVar9 == 0x124) { return; } if (iVar9 == 0x375) { bVar21 = this->_variant == 10; } else { if (iVar9 == 0x3c0) { return; } if (iVar9 == 0x3c5) { return; } bVar21 = iVar9 == 0xf5; } if (bVar21) { return; } } ExceptionList = &local_10; self = this; bVar4 = Entity::DoesEntityShareStatus((Entity *)this); if ((bVar4 != 0) && (EVar20 = this->_parent, this->_parent != (EntityPtr)0x0)) { do { rootParent = EVar20; EVar20 = *(EntityPtr *)((int)rootParent + 0x3bc); } while (EVar20 != (EntityPtr)0x0); if (((rootParent != (EntityPtr)this) && (extraout_EDX != 0x13)) && (extraout_EDX != 0x59)) { ExceptionList = local_10; return; } } local_10d = ((uint)this[1]._priceANM2._color._tint[0] & 2) != 0; local_ec = (Entity_Player *)0x1; if ((this->_flags & 0x40000000000) == 0) { uVar6 = 10; if (10.0 <= this->_maxHitPoints) { if (this->_maxHitPoints < 30.0) { uVar6 = 0x14; } } else { uVar6 = 100; } uVar8 = uVar6 >> 1; if (!(bool)local_10d) { uVar8 = uVar6; } pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xe1,(RNG **)&g_game->_playerManager,1); if (((pEVar7 != (Entity_Player *)0x0) && (uVar6 = RNG::RandomInt(&this->_dropRNG,uVar8), uVar6 == 0)) && ((bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16), bVar4 == 0 || (uVar6 = RNG::RandomInt(&this->_dropRNG,10), uVar6 == 0)))) { uVar6 = Random(); gimpyHeartPos.x = (this->_pos).x; gimpyHeartPos.y = (this->_pos).y; Game::Spawn(g_game,5,10,&gimpyHeartPos,&g_vectorZero,(Entity *)0x0,2,uVar6); } local_128.x = this[1]._priceANM2._rotation; fVar17 = this[1]._priceANM2._color._tint[0]; if (((uint)local_128.x & 0x4000000) != 0) { uVar6 = Random(); redHeartDropPos.x = (this->_pos).x; redHeartDropPos.y = (this->_pos).y; Game::Spawn(g_game,5,10,&redHeartDropPos,&g_vectorZero,(Entity *)0x0,1,uVar6); local_128.x = this[1]._priceANM2._rotation; fVar17 = this[1]._priceANM2._color._tint[0]; } if (((uint)local_128.x & 0x8000000) != 0) { uVar6 = Random(); coinDropPos.x = (this->_pos).x; coinDropPos.y = (this->_pos).y; Game::Spawn(g_game,5,0x14,&coinDropPos,&g_vectorZero,(Entity *)0x0,0,uVar6); local_128.x = this[1]._priceANM2._rotation; fVar17 = this[1]._priceANM2._color._tint[0]; } if (((uint)local_128.x & 0x800000) != 0) { uVar6 = Random(); blackHeartDropPos.x = (this->_pos).x; blackHeartDropPos.y = (this->_pos).y; Game::Spawn(g_game,5,10,&blackHeartDropPos,&g_vectorZero,(Entity *)0x0,6,uVar6); local_128.x = this[1]._priceANM2._rotation; fVar17 = this[1]._priceANM2._color._tint[0]; } if (((uint)local_128.x & 0x80000000) != 0) { uVar6 = RNG::Next(&this->_dropRNG); uVar6 = ItemPool::GetCardEx(uVar6,0,0,0,0); uVar8 = Random(); cardDropPos.x = (this->_pos).x; cardDropPos.y = (this->_pos).y; Game::Spawn(g_game,5,300,&cardDropPos,&g_vectorZero,(Entity *)0x0,uVar6,uVar8); fVar17 = this[1]._priceANM2._color._tint[0]; local_128.x = this[1]._priceANM2._rotation; } if (((uint)fVar17 & 1) != 0) { uVar6 = RNG::Next(&this->_dropRNG); uVar6 = ItemPool::GetCardEx(uVar6,0,-1,0,0); uVar8 = Random(); runeDropPos.x = (this->_pos).x; runeDropPos.y = (this->_pos).y; Game::Spawn(g_game,5,300,&runeDropPos,&g_vectorZero,(Entity *)0x0,uVar6,uVar8); } fVar17 = this[1]._priceANM2._offset.x; if (fVar17 != this[1]._priceANM2._offset.y) { do { iVar9 = *(int *)((int)fVar17 + 0x10); if (iVar9 == 3) { local_cc = *(EntityPtr *)((int)fVar17 + 0x34); if ((local_cc != (EntityPtr)0x0) && (*(int *)((int)local_cc + 0x28) == 3)) { iVar9 = *(int *)((int)fVar17 + 0x14); if (iVar9 == 0x38) { if (((*(int *)&g_game->_deathmatchManager < 2) && (local_cc = *(EntityPtr *)((int)local_cc + 0x410), local_cc != (EntityPtr)0x0)) && (*(byte *)((int)local_cc + 0x173) == 0)) { Entity_Player::AddHearts((Entity_Player *)local_cc,1,0,0); uVar6 = Random(); uVar26 = 0; pTVar25 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar24 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; healEffectPos.x = *(float *)((int)local_cc + 0x33c); healEffectPos.y = *(float *)((int)local_cc + 0x340); uVar23 = 0; spawned = Game::Spawn(g_game,1000,0x31,&healEffectPos,&g_vectorZero,(Entity *)0x0,0, uVar6); iVar9 = __RTDynamicCast(spawned,uVar23,pTVar24,pTVar25,uVar26); *(undefined4 *)(iVar9 + 0xdc) = 0; *(undefined4 *)(iVar9 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar9 + 0x358) = 0x3f800000; } } else { if (iVar9 == 0xf1) goto LAB_006bc2a9; if (iVar9 == 0x2a) { uVar8 = *(int *)((int)local_cc + 0x30) + 1; uVar6 = 4; if (uVar8 < 4) { uVar6 = uVar8; } *(uint *)((int)local_cc + 0x30) = uVar6; } } } } else if (iVar9 == 0x322) { local_cc = *(EntityPtr *)((int)fVar17 + 0x34); if ((local_cc != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)local_cc + 0x28) == 1)) || (*(int *)((int)local_cc + 0x28) - 10U < 0x3de)))) { local_11c.y = this->_maxHitPoints + *(float *)((int)local_cc + 0x380); pfVar10 = &local_11c.y; if (*(float *)((int)local_cc + 900) <= local_11c.y) { pfVar10 = (float *)((int)local_cc + 900); } *(float *)((int)local_cc + 0x380) = *pfVar10; manager = g_manager; if (*(float *)((int)local_cc + 0xb64) == 1.12104e-44) { if ((*(void **)((int)local_cc + 0x7c) != (void *)0x0) && (*(char *)((int)*(void **)((int)local_cc + 0x7c) + 0x34) != '\0')) { soundId = 0x8e; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); this = self; } } local_cc = *(EntityPtr *)((int)local_cc + 0x3bc); if ((local_cc != (EntityPtr)0x0) && (*(int *)((int)local_cc + 0x28) == 3)) { LAB_006bc2a9: cVar5 = (**(code **)(*(int *)this + 0x4c))(); uVar23 = 1; if (cVar5 != '\0') { uVar23 = 4; } Entity_Familiar::AddCoins((Entity_Familiar *)local_cc,uVar23); } } } else if ((iVar9 == 2) && ((*(int *)((int)fVar17 + 0x14) == 0x2b || (*(int *)((int)fVar17 + 0x14) == 0x2c)))) { local_d4 = (Entity_Player *)this->_initSeed; local_144 = 0x1500000002; local_dc.y = 1.26117e-44; local_13c = 9; if (local_d4 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_d4 >> 2 ^ (uint)local_d4; uVar6 = uVar6 << 0x15 ^ uVar6; local_cc = (EntityPtr)(uVar6 >> 9 ^ uVar6); if (local_cc == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_cc >> 2 ^ (uint)local_cc; uVar6 = uVar6 << 0x15 ^ uVar6; local_d4 = (Entity_Player *)(uVar6 >> 9 ^ uVar6); if (local_d4 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_d4 >> 2 ^ (uint)local_d4; uVar6 = uVar6 << 0x15 ^ uVar6; local_e4.y = (float)(uVar6 >> 9 ^ uVar6); if (((Entity_Player *)local_e4.y == (Entity_Player *)(((uint)local_e4.y / 10) * 10)) && (*(int *)((int)fVar17 + 0x34) != 0)) { local_d4 = *(Entity_Player **)(*(int *)((int)fVar17 + 0x34) + 0x3c8); if ((local_d4 == (Entity_Player *)0x0) || (local_d4->_type != 1)) { local_d4 = (Entity_Player *)0x0; } if ((Entity_Player *)local_e4.y == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_e4.y >> 2 ^ (uint)local_e4.y; uVar6 = uVar6 << 0x15 ^ uVar6; local_f0 = (Entity_Pickup *) Game::Spawn(g_game,5,0x32,&this->_pos,&g_vectorZero,(Entity *)0x0,0, uVar6 >> 9 ^ uVar6); TryOpenChest(local_f0,local_d4); bVar4 = IsChest(local_f0->_variant); if (bVar4 != 0) { (**(code **)(*(int *)local_f0 + 0x28))(); } } } fVar17 = (float)((int)fVar17 + 0x38); } while (fVar17 != this[1]._priceANM2._offset.y); } pEVar7 = PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0xea,this->_initSeed,(RNG **)0x0); if (pEVar7 != (Entity_Player *)0x0) { fVar17 = this[1]._priceANM2._offset.x; pEVar16 = (Entity_Player *)0x0; fVar13 = this[1]._priceANM2._offset.y; if (fVar17 != fVar13) { do { if ((*(int *)((int)fVar17 + 0x10) == 3) && (pEVar16 = (Entity_Player *)((uint)pEVar16 & 0xff), *(int *)((int)fVar17 + 0x14) == 0x49)) { pEVar16 = local_ec; } fVar17 = (float)((int)fVar17 + 0x38); } while (fVar17 != fVar13); if ((char)pEVar16 != '\0') goto LAB_006bc66a; } pEVar7->_numBlueSpiders = pEVar7->_numBlueSpiders + 1; spawn_blue_spider(&this->_pos,(Entity *)pEVar7,&g_vectorZero); } LAB_006bc66a: local_10c = PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0x2ab,this->_initSeed,(RNG **)0x0); if (local_10c != (Entity_Player *)0x0) { fVar17 = this[1]._priceANM2._offset.x; bVar21 = false; fVar13 = this[1]._priceANM2._offset.y; if (fVar17 != fVar13) { do { if ((*(int *)((int)fVar17 + 0x10) == 3) && (*(int *)((int)fVar17 + 0x14) == 0xea)) { bVar21 = true; } fVar17 = (float)((int)fVar17 + 0x38); } while (fVar17 != fVar13); this = self; if (bVar21) goto LAB_006bcab7; } pEVar18 = (Entity_Pickup *)0x1; local_f0 = (Entity_Pickup *)0x1; if (8.0 < this->_maxHitPoints) { local_cc = (EntityPtr)this->_initSeed; local_30 = 0x1100000006; local_ec = (Entity_Player *)&DAT_00000009; local_28 = 9; if (local_cc == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_cc >> 6 ^ (uint)local_cc; if (((uVar6 >> 9 ^ uVar6) & 1) == 0) { pEVar18 = (Entity_Pickup *)0x2; } local_f0 = pEVar18; } iVar9 = 0; do { uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_cc = (EntityPtr)(fVar17 + fVar17); local_ec = (Entity_Player *)sin((float)local_cc); uVar6 = Random(); local_dc.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 1.0; fVar17 = cos((float)local_cc); local_e4.y = fVar17 * local_dc.y + (this->_velocity).x; local_dc.y = local_dc.y * (float)local_ec + (this->_velocity).y; if (iVar9 == 0) { local_d4 = (Entity_Player *)0x40a00000; } else { uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_d4 = (Entity_Player *)(fVar17 + fVar17 + 3.0); } fVar17 = sqrtf(local_e4.y * local_e4.y + local_dc.y * local_dc.y); if (0.0 < fVar17) { local_e4.y = local_e4.y * ((float)local_d4 / fVar17); local_dc.y = local_dc.y * ((float)local_d4 / fVar17); } boneSpurVelocity.x = local_e4.y; boneSpurVelocity.y = local_dc.y; uVar6 = Random(); boneSpurPos.x = local_e4.y * 0.25 + (this->_pos).x; boneSpurPos.y = local_dc.y * 0.25 + (this->_pos).y; spawned = Game::Spawn(g_game,3,0xea,&boneSpurPos,&boneSpurVelocity,(Entity *)local_10c,0, uVar6); uVar23 = *(undefined4 *)((int)&spawned->_flags + 4); iVar12 = *(int *)spawned; *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; *(undefined4 *)((int)&spawned->_flags + 4) = uVar23; (**(code **)(iVar12 + 0xc))(); iVar9 = iVar9 + 1; } while (iVar9 < (int)local_f0); local_cc = (EntityPtr)(this->_posOffset).y; particleColor._tint[0] = 1.0; particleColor._tint[1] = 1.0; particleColor._tint[2] = 1.0; particleColor._tint[3] = 1.0; particleColor._offset[0] = 0.0; particleColor._offset[1] = 0.0; particleColor._colorize[0] = 0.0; particleColor._colorize[1] = 0.0; particleColor._colorize[2] = 0.0; particleColor._colorize[3] = 0.0; particleColor._offset[2] = 0.0; uVar6 = Random(); Game::SpawnParticles (g_game,&this->_pos,0x23,8, (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0,&particleColor,(float)local_cc,0); uVar6 = Random(); manager = g_manager; boneSpurSoundId = 0x1ce; local_cc = (EntityPtr) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.0); seed_fart_sound_override(&boneSpurSoundId); SoundEffects::Play(&manager->_sfxManager,boneSpurSoundId,0.7,2,0,(float)local_cc,0.0); } LAB_006bcab7: local_ec = PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0x2ac,this->_initSeed,(RNG **)0x0); if (local_ec != (Entity_Player *)0x0) { fVar17 = this[1]._priceANM2._offset.x; bVar21 = false; fVar13 = this[1]._priceANM2._offset.y; if (fVar17 != fVar13) { do { if ((*(int *)((int)fVar17 + 0x10) == 1000) && (*(int *)((int)fVar17 + 0x14) == 0xba)) { bVar21 = true; } fVar17 = (float)((int)fVar17 + 0x38); } while (fVar17 != fVar13); this = self; if (bVar21) goto LAB_006bccc3; } uVar6 = this->_initSeed; local_40 = 0x700000002; local_cc = (EntityPtr)0x9; local_38 = 9; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 2 ^ uVar6; uVar6 = uVar6 << 7 ^ uVar6; uVar6 = uVar6 >> 9 ^ uVar6; if (uVar6 == (uVar6 / 3) * 3) { uVar6 = Random(); manager = g_manager; hungrySoulSoundId = 0x2c; local_cc = (EntityPtr) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 2.0); seed_fart_sound_override(&hungrySoulSoundId); SoundEffects::Play(&manager->_sfxManager,hungrySoulSoundId,0.7,2,0,(float)local_cc,0.0); uVar6 = this->_initSeed; local_cc = (EntityPtr)0x19; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 2 ^ uVar6; uVar6 = uVar6 << 7 ^ uVar6; spawned = Game::Spawn(g_game,1000,0xba,&this->_pos,&g_vectorZero,(Entity *)local_ec,0, uVar6 >> 0x19 ^ uVar6); iVar9 = *(int *)spawned; pAVar3 = &spawned[1]._sprite; (pAVar3->_filename)._buf[8] = -0x4c; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &spawned[1]._sprite; (pAVar3->_filename)._buf[0xc] = -0x4c; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; (**(code **)(iVar9 + 0xc))(); } } LAB_006bccc3: pEVar7 = PlayerManager::RandomTrinketOwner (&g_game->_playerManager,0xb9,this->_initSeed,(RNG **)0x0); local_ec = pEVar7; if (pEVar7 != (Entity_Player *)0x0) { pvVar15 = (pEVar7->_trinketRNGs)._end; if ((int)pvVar15 - (int)(pEVar7->_trinketRNGs)._begin >> 4 < 0xba) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar15 = (pEVar7->_trinketRNGs)._end; } trinketRngBegin = (pEVar7->_trinketRNGs)._begin; uVar6 = ((int)pvVar15 - (int)trinketRngBegin >> 4) - 1; if (0xb9 < uVar6) { uVar6 = 0xb9; } EVar20 = (EntityPtr)(uVar6 * 0x10 + (int)trinketRngBegin); uVar6 = *(uint *)EVar20; local_cc = EVar20; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *(uint *)EVar20; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)*(undefined4 *)((int)EVar20 + 4) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)((std_vector *)((int)EVar20 + 8))->_begin & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)*(void **)((int)local_cc + 0xc) & 0x1f) ^ uVar6; *(uint *)local_cc = uVar6; iVar9 = Entity_Player::GetTrinketMultiplier(local_ec,0xb9); if ((int)(uVar6 % 6) < iVar9) { _Entity_Player::SpawnTrinketRandomPickup(); } this = self; } if (g_game->_challenge == 0x2b) { uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(self->_dropRNG)._shift3 & 0x1f) ^ uVar6; (self->_dropRNG)._seed = uVar6; if (uVar6 == (uVar6 / 5) * 5) { uVar6 = Random(); uVar8 = Random(); fVar17 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_cc = (EntityPtr)(fVar17 + fVar17); local_dc.y = sin((float)local_cc); fVar17 = cos((float)local_cc); local_cc = (EntityPtr)(fVar17 * 3.0); local_dc.y = local_dc.y * 3.0; uVar8 = Random(); this = self; cantrippedCardPos.y = (self->_pos).y; cantrippedCardPos.x = (self->_pos).x; cantrippedCardVelocity.x = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; cantrippedCardVelocity.y = local_dc.y * cantrippedCardVelocity.x; cantrippedCardVelocity.x = cantrippedCardVelocity.x * (float)local_cc; Game::Spawn(g_game,5,300,&cantrippedCardPos,&cantrippedCardVelocity,(Entity *)0x0,1,uVar6); goto LAB_006bcf51; } } this = self; } LAB_006bcf51: pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x291,(RNG **)&g_game->_playerManager,1); pEVar18 = this; if (pEVar7 != (Entity_Player *)0x0) { tearDamage = (float)g_game->_stage * 0.3 + 3.2; local_cc = (EntityPtr)(this->_maxHitPoints / tearDamage); local_10c = (Entity_Player *)tearDamage; dVar22 = ceil((double)(float)local_cc); pEVar18 = self; local_cc = (EntityPtr)(float)dVar22; local_ec = (Entity_Player *)(int)dVar22; local_7c = 0x3e4ccccd; local_78 = 0; local_74 = 0; if (0x10 < (int)local_ec) { local_ec = (Entity_Player *)0x10; } fVar17 = (float)(int)local_ec; local_120 = (Entity *)(this->_maxHitPoints / fVar17); local_d4 = (Entity_Player *)fVar17; ppEVar11 = &local_120; if ((float)local_120 <= (float)local_10c) { ppEVar11 = (Entity **)&tearDamage; } local_f0 = *(Entity_Pickup **)((int)&this->_flags + 4); tearDamage = (float)*ppEVar11; local_100 = 0; uStack_f8 = 0; local_8c = 0; uStack_88 = 0; uStack_84 = 0; uStack_80 = 0; tearColor = 0x40000000; uStack_98 = 0; uStack_94 = 0; uStack_90 = 0x3f800000; if ((this->_flags & 0x80) == 0) { uStack_f8._4_4_ = (Entity_Player *)0x0; uStack_f8._0_4_ = (uint *)0x0; local_100._4_4_ = (uint *)0x0; local_100._0_4_ = 0; local_e4.y = (float)uStack_f8._4_4_; local_dc.y = (float)(uint *)uStack_f8; uVar6 = (uint)local_100; uVar8 = (uint)local_100._4_4_; } else { local_100 = CONCAT44(DAT_00c34c34,DAT_00c34c30); uStack_f8 = CONCAT44(DAT_00c34c3c,DAT_00c34c38); local_e4.y = (float)DAT_00c34c3c; local_dc.y = DAT_00c34c38; uVar6 = DAT_00c34c30; uVar8 = DAT_00c34c34; } if ((this->_flags & 0x40) != 0) { local_dc.y = (float)((uint)local_dc.y | (uint)g_tearFlagPoison._h); uVar6 = uVar6 | (uint)g_tearFlagPoison._l; uVar8 = uVar8 | g_tearFlagPoison._l._4_4_; local_e4.y = (float)((uint)local_e4.y | g_tearFlagPoison._h._4_4_); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } if ((this->_flags & 0x20) != 0) { local_dc.y = (float)((uint)local_dc.y | DAT_00c34be8); uVar6 = uVar6 | DAT_00c34be0; uVar8 = uVar8 | DAT_00c34be4; local_e4.y = (float)((uint)local_e4.y | DAT_00c34bec); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } if ((this->_flags & 0x100) != 0) { local_dc.y = (float)((uint)local_dc.y | DAT_00c34c18); uVar6 = uVar6 | DAT_00c34c10; uVar8 = uVar8 | DAT_00c34c14; local_e4.y = (float)((uint)local_e4.y | DAT_00c34c1c); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } if ((this->_flags & 0x200) != 0) { local_dc.y = (float)((uint)local_dc.y | DAT_00c34bf8); uVar6 = uVar6 | DAT_00c34bf0; uVar8 = uVar8 | DAT_00c34bf4; local_e4.y = (float)((uint)local_e4.y | DAT_00c34bfc); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } if ((this->_flags & 0x800) != 0) { local_dc.y = (float)((uint)local_dc.y | DAT_00c34c28); uVar6 = uVar6 | DAT_00c34c20; uVar8 = uVar8 | DAT_00c34c24; local_e4.y = (float)((uint)local_e4.y | DAT_00c34c2c); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } bVar21 = (this->_flags & 0x1000) == 0; if (!bVar21) { local_dc.y = (float)((uint)local_dc.y | DAT_00c34c08); uVar6 = uVar6 | DAT_00c34c00; uVar8 = uVar8 | DAT_00c34c04; local_e4.y = (float)((uint)local_e4.y | DAT_00c34c0c); local_e5 = 1; local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } local_10c = (Entity_Player *)&DAT_00000005; if (bVar21) { local_10c = (Entity_Player *)0x1a; } if (((uint)local_f0 & 0x80000) != 0) { local_dc.y = (float)((uint)local_dc.y | DAT_00c349d8); uVar6 = uVar6 | DAT_00c349d0; uVar8 = uVar8 | DAT_00c349d4; local_e4.y = (float)((uint)local_e4.y | DAT_00c349dc); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,local_dc.y); } fVar13 = local_dc.y; if ((self->_flags & 0x4000000000000) != 0) { uVar6 = uVar6 | DAT_00c349e0; uVar8 = uVar8 | DAT_00c349e4; fVar13 = (float)((uint)local_dc.y | DAT_00c349e8); local_e4.y = (float)((uint)local_e4.y | DAT_00c349ec); local_100 = CONCAT44(uVar8,uVar6); uStack_f8 = CONCAT44(local_e4.y,fVar13); local_10c = (Entity_Player *)0x29; } if ((self->_flags & 0x10000000000000) != 0) { local_100 = CONCAT44(uVar8 | DAT_00c349c4,uVar6 | DAT_00c349c0); uStack_f8 = CONCAT44((uint)local_e4.y | DAT_00c349cc,(uint)fVar13 | DAT_00c349c8); } uVar6 = self->_initSeed; tearRngShifts = 0x1500000002; local_f0 = (Entity_Pickup *)&DAT_00000009; local_154 = 9; local_108 = (Entity_Player *)tearDamage; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 2 ^ uVar6; uVar6 = uVar6 << 0x15 ^ uVar6; local_d4 = (Entity_Player *)0x0; pEVar7 = (Entity_Player *)(uVar6 >> 9 ^ uVar6); local_114 = (EntityPtr) ((float)((double)(int)pEVar7 + __uint_to_double_fixup[-((int)pEVar7 >> 0x1f)]) * 2.3283062e-10 * 360.0); local_cc = (EntityPtr)(360.0 / fVar17); if (0 < (int)local_ec) { do { if (pEVar7 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)pEVar7 >> ((byte)tearRngShifts & 0x1f) ^ (uint)pEVar7; uVar6 = uVar6 << ((byte)((ulonglong)tearRngShifts >> 0x20) & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)local_f0 & 0x1f) ^ uVar6; local_dc.y = ((float)(int)local_d4 * (float)local_cc + (float)local_114 + ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 - 0.5) * (float)local_cc) * 0.017453292; local_e4.y = sin(local_dc.y); local_dc.y = cos(local_dc.y); if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> ((byte)tearRngShifts & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)((ulonglong)tearRngShifts >> 0x20) & 0x1f) ^ uVar6; local_d0 = (Entity_Player *)(uVar6 >> ((byte)local_f0 & 0x1f) ^ uVar6); tearVelocity.x = (float)((double)(int)local_d0 + __uint_to_double_fixup[-((int)local_d0 >> 0x1f)]) * 2.3283062e-10 * 4.0 + 8.0; tearVelocity.y = tearVelocity.x * local_e4.y; tearVelocity.x = tearVelocity.x * local_dc.y; local_e4.y = tearVelocity.y; local_dc.y = tearVelocity.x; uVar6 = Random(); fVar17 = sqrtf(local_e4.y * local_e4.y + local_dc.y * local_dc.y); if (fVar17 <= 0.0) { fVar13 = local_dc.y; pEVar7 = (Entity_Player *)local_e4.y; } else { fVar13 = local_dc.y * (1.0 / fVar17); pEVar7 = (Entity_Player *)((1.0 / fVar17) * local_e4.y); } fVar17 = pEVar18->_shrinkStatus1 * pEVar18->_size + 1.0; tearPos.x = fVar13 * fVar17 + (pEVar18->_pos).x; tearPos.y = (float)pEVar7 * fVar17 + (pEVar18->_pos).y; vasculitisTear = (Entity_Tear *) Game::Spawn(g_game,2,(uint)local_10c,&tearPos,&tearVelocity,(Entity *)pEVar18,0,uVar6); vasculitisTear->_spawnerType = 1; (**(code **)(*(int *)vasculitisTear + 0x40))(local_108); flags._h._0_4_ = (uint *)uStack_f8; flags._l = local_100; flags._h._4_4_ = uStack_f8._4_4_; Entity_Tear::SetTearFlags(vasculitisTear,flags); (**(code **)(*(int *)vasculitisTear + 0x3c))(&tearColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)vasculitisTear + 0xc))(); local_d4 = (Entity_Player *)&local_d4->field_0x1; pEVar7 = local_d0; } while ((int)local_d4 < (int)local_ec); } } cVar5 = (**(code **)(*(int *)pEVar18 + 0x48))(); if (((cVar5 != '\0') && (g_game->_room->field_0x7768 != '\0')) && (bVar4 = Room::IsPositionInRoom(g_game->_room,&pEVar18->_pos,-10.0), bVar4 != 0)) { uVar6 = Random(); local_dc.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar9 = g_game->_stage + 1; } else { iVar9 = g_game->_stage; } local_114 = (EntityPtr)((float)iVar9 * 0.5 + 2.5 + pEVar18->_maxHitPoints * 0.04); cVar5 = (**(code **)(*(int *)pEVar18 + 0x4c))(); if (cVar5 == '\0') { if (*(char *)((int)pEVar18[1]._colorMod._offset + 7) != '\0') { local_dc.y = local_dc.y * 1.2; } } else { local_dc.y = local_dc.y * 1.5; } local_108 = (Entity_Player *)((pEVar18->_velocity).y * 20.0); local_e4.x = (pEVar18->_velocity).x * 20.0; local_e4.y = (float)local_108; local_d0 = (Entity_Player *)local_e4.x; fVar17 = sqrtf((float)local_108 * (float)local_108 + local_e4.x * local_e4.x); game = g_game; if ((8.0 < fVar17) && (0.0 < fVar17)) { local_e4.x = (float)local_d0 * (8.0 / fVar17); local_e4.y = (8.0 / fVar17) * (float)local_108; } uVar6 = Random(); pEVar7 = PlayerManager::RandomCollectibleOwner(&game->_playerManager,0x28d,uVar6,(RNG **)0x0); uVar6 = (pEVar18->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (pEVar18->_dropRNG)._seed; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar6 = uVar6 >> ((byte)(pEVar18->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(pEVar18->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(pEVar18->_dropRNG)._shift3 & 0x1f) ^ uVar6; (pEVar18->_dropRNG)._seed = uVar6; spawned = Game::Spawn(game,1000,0x90,&pEVar18->_pos,&local_e4,(Entity *)pEVar7,0,uVar6); (**(code **)(*(int *)spawned + 0x40))(local_114); fVar17 = local_dc.y * g_vectorOne.x; (spawned->_sprite)._scale.y = local_dc.y * g_vectorOne.y; (spawned->_sprite)._scale.x = fVar17; (**(code **)(*(int *)spawned + 0xc))(); } cVar5 = (**(code **)(*(int *)pEVar18 + 0x48))(); game = g_game; if ((cVar5 != '\0') && (bVar4 = Room::IsPositionInRoom(g_game->_room,&pEVar18->_pos,-10.0), bVar4 != 0)) { playerManager = &game->_playerManager; local_dc.y = 0.0; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar15 = (playerManager->_playerList)._end; if ((int)pvVar15 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar15 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if ((uint)local_dc.y < (uint)((int)pvVar15 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_dc.y; } local_d4 = (Entity_Player *)*playerSlot; if ((local_d4->_variant == 0) && (bVar4 = Entity_Player::HasCollectible(local_d4,0x295,0), bVar4 != 0)) { uVar6 = 0; iVar9 = *(int *)((int)g_game->_room + 0x1264); if (iVar9 != 0) { piVar14 = *(int **)((int)g_game->_room + 0x125c); do { iVar12 = *piVar14; if (((*(int *)(iVar12 + 0x28) == 3) && (*(char *)(iVar12 + 0xd77) != '\0')) && (*(Entity_Player **)(iVar12 + 0x410) == local_d4)) { uVar6 = uVar6 + 1; } piVar14 = piVar14 + 1; iVar9 = iVar9 + -1; } while (iVar9 != 0); pEVar18 = self; } iVar12 = Entity_Player::GetCollectibleNum(local_d4,0x295,0); iVar9 = 1; if (1 < iVar12) { iVar9 = iVar12; } if (uVar6 < (uint)(iVar9 * 5)) { uVar6 = pEVar18->_initSeed; local_1b4 = 0x300000006; local_cc = (EntityPtr)0x11; local_1ac = 0x11; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 6 ^ uVar6; uVar6 = uVar6 << 3 ^ uVar6; uVar6 = uVar6 >> 0x11 ^ uVar6; local_d0 = *(Entity_Player **)(&DAT_00b67420 + (uVar6 % 0x11) * 4); if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 6 ^ uVar6; uVar6 = uVar6 << 3 ^ uVar6; spawned = Game::Spawn(g_game,3,(uint)local_d0,&pEVar18->_pos,&g_vectorZero, (Entity *)local_d4,0xd903,uVar6 >> 0x11 ^ uVar6); (**(code **)(*(int *)spawned + 0xc))(); uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0xf,&pEVar18->_pos,&g_vectorZero,(Entity *)0x0,0,uVar6 ); poofColor = 0x3f800000; uStack_6c = 0x3f800000; uStack_68 = 0x3f800000; uStack_64 = 0x3f800000; local_60 = 0x3f000000; uStack_5c = 0x3f000000; uStack_58 = 0x3f000000; uStack_54 = 0x3f800000; local_50 = 0; local_4c = 0; local_48 = 0; (**(code **)(*(int *)spawned + 0x3c))(&poofColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawned + 0xc))(); break; } } local_dc.y = (float)((int)local_dc.y + 1); playerManager = &g_game->_playerManager; } while ((uint)local_dc.y < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } cVar5 = (**(code **)(*(int *)pEVar18 + 0x48))(); game = g_game; if (cVar5 == '\0') { ExceptionList = local_10; return; } pvVar15 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar15 >> 2 < 0x73) { item = (ItemConfig_Item *)0x0; } else { item = *(ItemConfig_Item **)((int)pvVar15 + 0x1c8); } local_e5 = PlayerManager::HasTemporaryEffect(&g_game->_playerManager,item); for (piVar14 = (game->_playerManager)._playerList._begin; piVar14 != (game->_playerManager)._playerList._end; piVar14 = piVar14 + 1) { iVar9 = *piVar14; if (((*(int *)(iVar9 + 0x2c) == 0) && (*(char *)(iVar9 + 0x20a9) == '\0')) && (*(int *)(iVar9 + 0x13c0) == 0x16)) goto LAB_006bdcff; } if (local_e5 != 0) { LAB_006bdcff: uVar6 = pEVar18->_initSeed; local_1c4 = 0x1100000007; local_cc = (EntityPtr)0x15; local_1bc = 0x15; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 7 ^ uVar6; uVar6 = uVar6 << 0x11 ^ uVar6; uVar6 = uVar6 >> 0x15 ^ uVar6; if ((((uVar6 & 1) == 0) || (((uint)pEVar18[1]._priceANM2._rotation & 0x20000000) != 0)) || (local_e5 != 0)) { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 7 ^ uVar6; uVar6 = uVar6 << 0x11 ^ uVar6; uVar8 = Random(); fVar17 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d0 = (Entity_Player *)(fVar17 + fVar17); local_114 = (EntityPtr)sin((float)local_d0); uVar8 = Random(); local_108 = (Entity_Player *) ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0); local_dc.x = cos((float)local_d0); local_dc.x = local_dc.x * (float)local_108; local_dc.y = (float)local_108 * (float)local_114; spawned = Game::Spawn(g_game,5,10,&pEVar18->_pos,&local_dc,(Entity *)pEVar18,2, uVar6 >> 0x15 ^ uVar6); iVar9 = *(int *)spawned; spawned[1]._sprite._championColor._colorize[2] = 8.40779e-44; (**(code **)(iVar9 + 0xc))(); } } for (piVar14 = (g_game->_playerManager)._playerList._begin; piVar14 != (g_game->_playerManager)._playerList._end; piVar14 = piVar14 + 1) { iVar9 = *piVar14; if (((*(int *)(iVar9 + 0x2c) == 0) && (*(char *)(iVar9 + 0x20a9) == '\0')) && (*(int *)(iVar9 + 0x13c0) == 0x21)) { iVar9 = *(int *)((int)g_game->_room + 4); if ((pEVar18->_spawnGridIndex < 0) || ((*(int *)(iVar9 + 0x40) != 1 && ((pEVar18->_flags & 0x8000000000) == 0)))) { if (9 < *(short *)(iVar9 + 0x52)) break; local_d0 = (Entity_Player *)pEVar18->_initSeed; local_114 = (EntityPtr)(*(short *)(iVar9 + 0x52) + 1); rngShifts = 0x50000000d; local_108 = (Entity_Player *)&DAT_00000013; local_18 = 0x13; if (local_d0 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_d0 >> 0xd ^ (uint)local_d0; uVar6 = uVar6 ^ uVar6 << 5; if ((local_114 != (EntityPtr)0x0) && ((uVar6 ^ uVar6 >> 0x13) % (uint)local_114 != 0)) break; *(short *)(iVar9 + 0x52) = *(short *)(iVar9 + 0x52) + 1; pEVar7 = (Entity_Player *)0x1; } else { pEVar7 = (Entity_Player *)&DAT_00000008; } local_ec = (Entity_Player *)&DAT_0000003c; cVar5 = (**(code **)(*(int *)pEVar18 + 0x4c))(); if (cVar5 == '\0') { local_d4 = (Entity_Player *)0x1; if (-1 < (int)pEVar18[1]._colorMod._offset[2]) { local_d4 = (Entity_Player *)0x2; } } else { if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar9 = g_game->_stage + 1; } else { iVar9 = g_game->_stage; } local_d0 = (Entity_Player *)(pEVar18->_maxHitPoints / ((float)iVar9 * 10.0 + 38.0)); dVar22 = ceil((double)(float)local_d0); local_d0 = (Entity_Player *)(float)dVar22; local_ec = (Entity_Player *)0x5a; local_d4 = (Entity_Player *)0x1; if (1 < (int)dVar22) { local_d4 = (Entity_Player *)(int)dVar22; } } if ((int)pEVar7 < (int)local_d4) { local_d4 = pEVar7; } coinRngShifts = 0xb00000009; uVar6 = pEVar18->_initSeed; local_cc = (EntityPtr)0x13; local_1cc = 0x13; if (local_10d != '\0') { local_d0 = (Entity_Player *)((int)local_d4 / 2 + 2); if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 9 ^ uVar6; uVar6 = uVar6 << 0xb ^ uVar6; uVar6 = uVar6 >> 0x13 ^ uVar6; uVar8 = 0; if (local_d0 != (Entity_Player *)0x0) { uVar8 = uVar6 % (uint)local_d0; } local_d4 = (Entity_Player *)((int)(&(local_d4->_sprite)._filename + -3) + uVar8); } local_10c = (Entity_Player *)0x0; if (0 < (int)local_d4) { do { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> ((byte)coinRngShifts & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)((ulonglong)coinRngShifts >> 0x20) & 0x1f) ^ uVar6; uVar6 = uVar6 >> (local_cc._0_1_ & 0x1f) ^ uVar6; uVar8 = Random(); fVar17 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d0 = (Entity_Player *)(fVar17 + fVar17); local_114 = (EntityPtr)sin((float)local_d0); uVar8 = Random(); local_108 = (Entity_Player *) ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0); local_128.x = cos((float)local_d0); local_128.x = local_128.x * (float)local_108; local_128.y = (float)local_114 * (float)local_108; spawned = Game::Spawn(g_game,5,0x14,&pEVar18->_pos,&local_128,(Entity *)pEVar18,0,uVar6); iVar9 = *(int *)spawned; spawned[1]._sprite._championColor._colorize[2] = (float)local_ec; (**(code **)(iVar9 + 0xc))(); local_10c = (Entity_Player *)&local_10c->field_0x1; } while ((int)local_10c < (int)local_d4); } break; } } local_100 = local_100 & 0xffffffff; puVar19 = (uint *)0x0; local_f0 = (Entity_Pickup *)0x0; uStack_f8 = 0; local_8 = 0; local_cc = (EntityPtr)&g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(((PlayerManager *)local_cc)->_playerList)._begin >> 2 == 0) { ExceptionList = local_10; return; } uVar6 = 0; do { pvVar15 = ((std_vector *)local_cc)->_end; playerSlot = ((std_vector *)local_cc)->_begin; if ((int)pvVar15 - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar15 = ((std_vector *)local_cc)->_end; playerSlot = ((std_vector *)local_cc)->_begin; } if (uVar6 < (uint)((int)pvVar15 - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar6; } local_108 = (Entity_Player *)*playerSlot; local_d0 = local_108; if (local_108->_variant == 0) { bVar4 = Entity_Player::HasCollectible(local_108,0x280,0); if (bVar4 != 0) { if ((Entity_Pickup *)puVar19 == local_f0) { std::vector::_Emplace_reallocate(puVar19,&local_108); local_f0 = (Entity_Pickup *)uStack_f8._4_4_; puVar19 = (uint *)uStack_f8; } else { *puVar19 = (uint)local_d0; uStack_f8 = CONCAT44(uStack_f8._4_4_,puVar19 + 1); puVar19 = puVar19 + 1; } } } pEVar18 = self; uVar6 = uVar6 + 1; local_cc = (EntityPtr)&g_game->_playerManager; } while (uVar6 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(((PlayerManager *)local_cc)->_playerList)._begin >> 2)); if (local_100._4_4_ == puVar19) goto LAB_006be69c; local_cc = (EntityPtr)self->_initSeed; local_108 = (Entity_Player *)&DAT_00000009; rngShifts = 0x1500000002; cVar5 = (**(code **)(*(int *)self + 0x4c))(); if (cVar5 == '\0') { local_d4 = (Entity_Player *)0x1; if (-1 < (int)pEVar18[1]._colorMod._offset[2]) { local_d4 = (Entity_Player *)0x2; } LAB_006be460: do { local_d0 = (Entity_Player *)((int)puVar19 - (int)local_100._4_4_ >> 2); if (local_cc == (EntityPtr)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_cc >> ((byte)rngShifts & 0x1f) ^ (uint)local_cc; uVar6 = uVar6 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar6; local_cc = (EntityPtr)(uVar6 >> ((byte)local_108 & 0x1f) ^ uVar6); uVar6 = 0; if (local_d0 != (Entity_Player *)0x0) { uVar6 = (uint)local_cc % (uint)local_d0; } local_114 = *(EntityPtr *)((int)local_100._4_4_ + uVar6 * 4); bVar4 = Entity_Player::HasCollectible((Entity_Player *)local_114,0x3b,0); local_11c.x = (pEVar18->_pos).x; local_11c.y = (pEVar18->_pos).y; uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_d0 = (Entity_Player *)(fVar17 + fVar17); local_ec = (Entity_Player *)cos((float)local_d0); local_10c = (Entity_Player *)sin((float)local_d0); uVar6 = Random(); fVar17 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0; local_11c.y = fVar17 * (float)local_10c + local_11c.y; local_11c.x = fVar17 * (float)local_ec + local_11c.x; uVar6 = Random(); local_128.x = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 10.0; local_128.y = local_128.x * (float)local_10c; local_128.x = local_128.x * (float)local_ec; uVar6 = Random(); local_120 = Game::Spawn(g_game,1000,0xb3,&local_11c,&local_128,(Entity *)pEVar18, (uint)(bVar4 != 0),uVar6); pEVar1 = &local_120->_target; if (local_120->_target != (EntityPtr)0x0) { local_d0 = (Entity_Player *)pEVar1; std::multiset::erase(&local_d0); } *pEVar1 = local_114; if (local_114 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } (**(code **)(*(int *)local_120 + 0xc))(); local_d4 = (Entity_Player *)((int)&local_d4[-1]._replacedPlayer + 3); puVar19 = (uint *)uStack_f8; } while (local_d4 != (Entity_Player *)0x0); } else { if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar9 = g_game->_stage + 1; } else { iVar9 = g_game->_stage; } local_d0 = (Entity_Player *)(pEVar18->_maxHitPoints / ((float)iVar9 * 10.0 + 38.0)); dVar22 = ceil((double)(float)local_d0); local_d0 = (Entity_Player *)(float)dVar22; local_d4 = (Entity_Player *)&DAT_00000008; if ((int)dVar22 < 8) { local_d4 = (Entity_Player *)(int)dVar22; } if (0 < (int)local_d4) goto LAB_006be460; } LAB_006be69c: if (local_100._4_4_ != (uint *)0x0) { uVar6 = (int)local_f0 - (int)local_100._4_4_ & 0xfffffffc; puVar19 = local_100._4_4_; if (0xfff < uVar6) { puVar19 = (uint *)local_100._4_4_[-1]; uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)local_100._4_4_ + (-4 - (int)puVar19))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar19,uVar6); } ExceptionList = local_10; return; } //@@ 006be6f0 Entity_NPC::Kill /* ZHL [vtable slot 9] */ void __thiscall Entity_NPC::Kill(Entity_NPC *this,undefined4 param_2) { undefined4 uVar1; (this->_killDamageEvents)._end = (this->_killDamageEvents)._begin; this->_killDamage = 0.0; uVar1 = *(undefined4 *)((int)&this->_pendingDamageFlags + 4); this->_killDamage = this->_pendingDamage; *(undefined4 *)&this->_killDamageFlags = 0; *(int *)&this->_killDamageFlags = (int)this->_pendingDamageFlags; *(undefined4 *)((int)&this->_killDamageFlags + 4) = 0; *(undefined4 *)((int)&this->_killDamageFlags + 4) = uVar1; if (&this->_killDamageEvents != &this->_damageEvents) { std::vector::assign_0x38((this->_damageEvents)._begin,(this->_damageEvents)._end,param_2); } Entity::Kill((Entity *)this,param_2); return; } //@@ 006be760 Entity_NPC::KillUnique /* ZHL [lua] Lua binding EntityNPC:KillUnique */ void __thiscall Entity_NPC::KillUnique(Entity_NPC *this) { undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; float local_1c; float local_18; float local_14; float local_10; undefined4 local_c; undefined4 local_8; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = 0; local_1c = g_vectorZero.x; local_18 = g_vectorZero.y; local_14 = g_vectorZero.x; local_10 = g_vectorZero.y; local_c = 0; local_8 = 0; (**(code **)(*(int *)this + 0x24))(&local_2c); this->_state = 0x11; this->_stateFrame = 0; return; } //@@ 006be7e0 NpcHelper::is_target_valid /* DB: NpcAI::ENTITY_BABY_BEGOTTEN attack gate: a player target not invisible (Entity_Player::IsInvisible), or with npc flag 0x100 a vulnerable enemy without flag 0x20000000 (pass7_i6.md) */ uint NpcHelper::is_target_valid(Entity_Player *param_1) { byte bVar1; undefined3 extraout_var; uint uVar2; undefined3 extraout_var_00; int in_ECX; bool bVar3; if ((*(uint *)(in_ECX + 0x168) & 0x100) == 0) { uVar2 = 0; if (param_1->_type != 1) goto LAB_006be82d; bVar1 = Entity_Player::IsInvisible(param_1); uVar2 = CONCAT31(extraout_var_00,bVar1); bVar3 = bVar1 == 0; } else { bVar1 = Entity::IsVulnerableEnemy((Entity *)param_1,(Entity *)0x0); uVar2 = CONCAT31(extraout_var,bVar1); if (bVar1 == 0) goto LAB_006be82d; uVar2 = (uint)param_1->_flags & 0x20000000; bVar3 = uVar2 == 0; } if (bVar3) { return CONCAT31((int3)(uVar2 >> 8),1); } LAB_006be82d: return uVar2 & 0xffffff00; } //@@ 006be840 Entity_NPC::GetPlayerTarget /* ZHL [exact] __thiscall Entity* Entity_NPC::GetPlayerTarget(); prototype: REPENTOGON, confirmed by RET 0 */ Entity * __thiscall Entity_NPC::GetPlayerTarget(Entity_NPC *this) { byte bVar1; uint uVar2; Entity_Player *player; void *playerListEnd; EntityPtr *pEVar3; PlayerManager *playerManager; EntityPtr candidatesBegin; EntityPtr EVar4; undefined4 killSource; undefined4 local_70; undefined4 local_6c; undefined4 local_68; float local_64; float local_60; float local_5c; float local_58; undefined4 local_54; undefined4 local_50; RNG pickRng; EntityList_EL sameTypeList; EntityPtr candidates; EntityPtr candidatesEnd; EntityPtr candidatesCapEnd; EntityPtr local_20; EntityPtr local_1c; EntityPtr candidatesCap; uint playerIndex; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity *newTarget; Entity_NPC *sibling; local_8 = 0xffffffff; puStack_c = &LAB_00afa865; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; if (this->_type != 0x35) { ExceptionList = &local_10; if ((((this->_flags & 0x100) != 0) && (*(char *)((int)g_game->_room + 0x72a1) == '\0')) && ((bVar1 = Entity::IsFrame((Entity *)this,0xf,this->_index), bVar1 != 0 || (this->_target == (EntityPtr)0x0)))) { EVar4 = (EntityPtr)Game::GetNearestEnemy(0,uVar2); pEVar3 = &this->_target; if (this->_target != (EntityPtr)0x0) { local_20 = (EntityPtr)pEVar3; std::multiset::erase(&local_20); } *pEVar3 = EVar4; if (EVar4 != (EntityPtr)0x0) { std::multiset::insert(pEVar3); } } pEVar3 = &this->_target; if (this->_target != (EntityPtr)0x0) { ExceptionList = local_10; return (Entity *)this->_target; } if ((this->_type == 0xd5) || (this->_decoyTargetTimer < 0)) { bVar1 = 0; } else { bVar1 = 1; } local_1c._0_1_ = 1; if ((this->_flags & 0x20000000) == 0) { local_1c = (EntityPtr)((uint)(uint3)local_1c._1_3_ << 8); } EVar4 = (EntityPtr) Game::GetNearestTargetPlayer (&this->_pos,(Entity *)this,local_1c._0_1_,bVar1,(void *)0x0,5000.0); if (EVar4 == (EntityPtr)0x0) { player = Game::GetPlayer(g_game,0); ExceptionList = local_10; return (Entity *)player; } bVar1 = Entity::IsEnemy((Entity *)EVar4); if (bVar1 == 0) { ExceptionList = local_10; return (Entity *)EVar4; } bVar1 = Entity::HasEntityFlags((Entity *)EVar4,0x10000000000000); if (bVar1 == 0) { ExceptionList = local_10; return (Entity *)EVar4; } if (*pEVar3 != (EntityPtr)0x0) { local_20 = (EntityPtr)pEVar3; std::multiset::erase(&local_20); } *pEVar3 = EVar4; std::multiset::insert(pEVar3); ExceptionList = local_10; return (Entity *)EVar4; } local_1c = (EntityPtr)&this->_target; candidates = this->_target; if (candidates != (EntityPtr)0x0) { return (Entity *)candidates; } EVar4 = (EntityPtr)0x0; candidatesEnd = (EntityPtr)0x0; local_8 = 0; ExceptionList = &local_10; candidatesCapEnd = candidates; candidatesCap = candidates; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&sameTypeList,0x35,-1,-1,0,0) ; local_8 = CONCAT31(local_8._1_3_,1); playerManager = &g_game->_playerManager; playerIndex = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) { candidatesBegin = (EntityPtr)0x0; } else { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; } pEVar3 = (playerManager->_playerList)._begin; if (playerIndex < (uint)((int)playerListEnd - (int)pEVar3 >> 2)) { pEVar3 = pEVar3 + playerIndex; } local_20 = *pEVar3; if (this->_controllerID == -1) { uVar2 = 0; if (sameTypeList._size != 0) { do { sibling = *(Entity_NPC **)((int)sameTypeList._data + uVar2 * 4); if ((sibling != this) && (sibling->_target == local_20)) goto LAB_006be971; uVar2 = uVar2 + 1; } while (uVar2 < (uint)sameTypeList._size); } LAB_006be94c: if (EVar4 == candidatesCap) { std::vector::_Emplace_reallocate(EVar4,&local_20); candidatesCap = candidatesCapEnd; EVar4 = candidatesEnd; } else { *(EntityPtr *)EVar4 = local_20; candidatesEnd = (EntityPtr)((int)EVar4 + 4); EVar4 = candidatesEnd; } } else if (*(int *)((int)local_20 + 0x1618) == this->_controllerID) goto LAB_006be94c; LAB_006be971: candidatesBegin = candidates; playerManager = &g_game->_playerManager; playerIndex = playerIndex + 1; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); if (candidates != EVar4) { pickRng._seed = this->_initSeed; pickRng._shift1 = 2; pickRng._shift2 = 7; pickRng._shift3 = 7; uVar2 = RNG::RandomInt(&pickRng,(int)EVar4 - (int)candidates >> 2); player = *(Entity_Player **)((int)candidatesBegin + uVar2 * 4); goto LAB_006bea36; } } killSource = 0; local_70 = 0; local_6c = 0; local_68 = 0; local_64 = g_vectorZero.x; local_60 = g_vectorZero.y; local_5c = g_vectorZero.x; local_58 = g_vectorZero.y; local_54 = 0; local_50 = 0; (**(code **)(*(int *)this + 0x24))(&killSource); player = Game::GetPlayer(g_game,0); LAB_006bea36: EVar4 = local_1c; if (*(int *)local_1c != 0) { local_20 = local_1c; std::multiset::erase(&local_20); } *(Entity_Player **)EVar4 = player; if (player != (Entity_Player *)0x0) { std::multiset::insert(EVar4); } newTarget = *(Entity **)EVar4; uVar2 = local_8 >> 8; local_8 = local_8 & 0xffffff00; if (sameTypeList._0_1_ == '\0') { local_8 = CONCAT31((int3)uVar2,2); tracked_alloc(1,sameTypeList._data,0); } if (candidatesBegin == (EntityPtr)0x0) { ExceptionList = local_10; return newTarget; } uVar2 = (int)candidatesCap - (int)candidatesBegin & 0xfffffffc; EVar4 = candidatesBegin; if (0xfff < uVar2) { EVar4 = *(EntityPtr *)((int)candidatesBegin + -4); uVar2 = uVar2 + 0x23; if (0x1f < ((int)candidatesBegin - (int)EVar4) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar4,uVar2); ExceptionList = local_10; return newTarget; } //@@ 006bec40 Entity_NPC::CalcTargetPosition /* ZHL [lua] Lua binding EntityNPC:CalcTargetPosition prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Entity_NPC::CalcTargetPosition(Entity_NPC *this,Vector *outPos,float distanceLimit) { int iVar1; byte bVar2; uint rngResult; Entity *playerTarget; Vector *randomDir; Game *game; float fVar3; float fVar4; float fVar5; Vector local_20; Vector local_18; Vector local_10; qword flags; Room *room; game = g_game; local_10.y = *(float *)((int)&this->_flags + 4); flags = this->_flags; if ((flags & 0x200) == 0) { if ((flags & 0x1000800) != 0) { iVar1 = this->_type; if (iVar1 == 0x10) { if (this->_variant == 2) { LAB_006bee6f: playerTarget = GetPlayerTarget(this); fVar3 = (this->_pos).x; local_20.x = (this->_pos).y; local_18.x = (playerTarget->_pos).x - fVar3; local_10.x = (playerTarget->_pos).y - local_20.x; fVar4 = local_18.x; if ((distanceLimit != 0.0) && (fVar5 = local_10.x * local_10.x + local_18.x * local_18.x, fVar5 != 0.0)) { fVar4 = sqrtf(fVar5); if (fVar4 <= 0.0) { fVar4 = local_18.x; } else { local_10.x = local_10.x * (distanceLimit / fVar4); fVar4 = local_18.x * (distanceLimit / fVar4); } } game = g_game; fVar5 = this->_size; fVar3 = fVar3 - fVar4; local_20.x = local_20.x - local_10.x; local_10.x = fVar3; local_10.y = local_20.x; Room::GetClampedPositionImpl(g_game->_room,&local_18,&local_10,fVar5,fVar5,fVar5,fVar5); if ((fVar3 == local_18.x) && (local_20.x == local_18.y)) { (this->_confusionTargetPos).x = g_vectorZero.x; (this->_confusionTargetPos).y = g_vectorZero.y; outPos->x = local_18.x; outPos->y = local_18.y; return outPos; } bVar2 = Vector::operator_eq(&this->_confusionTargetPos,&g_vectorZero); if (bVar2 == 0) { rngResult = Random(); bVar2 = Entity::IsFrame((Entity *)this,rngResult % 0xf + 5,0); if (bVar2 == 0) { fVar3 = (this->_confusionTargetPos).y; outPos->x = (this->_confusionTargetPos).x; outPos->y = fVar3; return outPos; } game = g_game; } local_10.x = this->_size; room = game->_room; randomDir = MusicManager::RandomVector(&local_20); rngResult = Random(); fVar3 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 100.0; local_18.x = (this->_pos).x - fVar3 * randomDir->x; local_18.y = (this->_pos).y - fVar3 * randomDir->y; Room::GetClampedPositionImpl (room,&local_10,&local_18,local_10.x,local_10.x,local_10.x,local_10.x); (this->_confusionTargetPos).x = local_10.x; (this->_confusionTargetPos).y = local_10.y; outPos->x = local_10.x; outPos->y = local_10.y; return outPos; } } else if ((iVar1 != 0x16) && (iVar1 != 0xcd)) goto LAB_006bee6f; } playerTarget = GetPlayerTarget(this); fVar3 = (playerTarget->_pos).x; outPos->y = (playerTarget->_pos).y; outPos->x = fVar3; return outPos; } if (((this->_confusionTargetPos).x != g_vectorZero.x) || ((this->_confusionTargetPos).y != g_vectorZero.y)) { if ((flags & 0x4000) != 0) goto LAB_006bee09; bVar2 = Game::IsPaused(g_game); if ((bVar2 != 0) || (game->_frameCount % 0xf != 0)) goto LAB_006bee09; } local_18.x = this->_size; room = game->_room; rngResult = Random(); local_20.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; local_20.x = local_20.x + local_20.x; rngResult = Random(); local_10.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; rngResult = Random(); fVar3 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * local_10.x * 240.0; fVar4 = cos(local_20.x); local_10.x = fVar4 * fVar3 + (this->_pos).x; fVar4 = sin(local_20.x); local_10.y = fVar4 * fVar3 + (this->_pos).y; Room::GetClampedPositionImpl(room,&local_18,&local_10,local_18.x,local_18.x,local_18.x,local_18.x) ; (this->_confusionTargetPos).x = local_18.x; (this->_confusionTargetPos).y = local_18.y; LAB_006bee09: fVar3 = (this->_confusionTargetPos).x; outPos->y = (this->_confusionTargetPos).y; outPos->x = fVar3; return outPos; } //@@ 006bf120 NpcHelper::ChampionDrop /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: champion death drop, off in greed prototype: db/protos.zhl */ void __fastcall NpcHelper::ChampionDrop(Entity_NPC *npc) { code *pcVar1; byte bVar2; float fVar3; int iVar4; uint uVar5; uint uVar6; Vector *dropDir; Entity_Pickup *pickup; Entity *spawned; Entity_Player *nearestPlayer; ProjectileParams *params; byte isDropAllowed; float fVar7; int gridY; char isDropping; uint extraout_EDX; RNG *dropRng; bool isIceFrozen; float local_138; uint dropVariant; Vector *local_130; PlayerManager *local_12c; char local_125; int dropCount; Entity_NPC *local_120; Vector local_11c; Vector local_114; Entity_Player *glyphOwner; Vector randomDir; Vector zeroDir; Vector dropVelocity; EntityRef sourceRef; RNG local_c8; ProjectileParams projParams; uint stackCookie; undefined4 flagsHigh; Game *game; Room *room; stackCookie = __security_cookie ^ (uint)&local_138; dropVariant = 0; local_130 = (Vector *)0x0; dropCount = 1; local_125 = (npc->_killDamageFlags & 0x200000000) != 0; fVar3 = 1.4013e-43; local_138 = 1.4013e-43; if (g_game->_difficulty == 1) { if (!(bool)local_125) { fVar3 = 4.62428e-44; } local_138 = fVar3; } fVar3 = local_138; local_120 = npc; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); if (bVar2 != 0) { iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,5); if (iVar4 < 3) { fVar7 = 9.24857e-44; if (iVar4 != 2) { fVar7 = 7.00649e-44; } } else { fVar7 = 1.05097e-43; } local_138 = fVar3; if ((uint)fVar3 < (uint)fVar7) { local_138 = fVar7; } } uVar5 = (npc->_dropRNG)._seed; dropRng = &npc->_dropRNG; local_11c.x = (float)dropRng; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; (npc->_dropRNG)._seed = uVar5; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { bVar2 = 0; } else { bVar2 = 1; } isDropAllowed = 0; if (npc->_spawnerType != 0x132) { isDropAllowed = bVar2; } local_138 = (float)(uint)(isDropAllowed & (g_game->_challenge != 0x22 && (uVar5 % 100 < (uint)local_138 && g_game->_victoryLap < 1)) & *(byte *)((int)g_game->_room + 1)); bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); if ((bVar2 == 0) && (g_game->_stage == 0xc)) { uVar5 = 0x14; if (local_125 != '\0') { uVar5 = 7; } uVar5 = RNG::RandomInt(&npc->_dropRNG,uVar5); if (uVar5 != 0) { local_138 = (float)(extraout_EDX & 0xffffff00); } } isIceFrozen = (npc->_flags & 0x2000000000000) != 0; local_12c = (PlayerManager *)CONCAT31(local_12c._1_3_,isIceFrozen); isDropping = SUB41(local_138,0); switch(npc->_championColorIdx) { case 0: case 0x14: dropVariant = 10; case 0x10: local_130 = (Vector *)0x1; break; case 1: dropVariant = 0x5a; break; case 2: dropVariant = 0x46; break; case 3: uVar5 = Random(); dropVariant = 0x14; dropCount = uVar5 % 3 + 1; break; case 4: if (isDropping == '\0') { return; } nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos); Entity_Player::AddBlueFlies(nearestPlayer,3,&npc->_pos,(Entity *)0x0); return; case 5: dropVariant = 0x28; if (((!isIceFrozen) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar2 == 0)) && ((dropDir = &npc->_pos, 0x1e < g_game->_frameCount - npc->_spawnFrame || (nearestPlayer = Game::GetNearestPlayer(g_game,dropDir), fVar3 = (npc->_pos).y - (nearestPlayer->_pos).y, fVar7 = dropDir->x - (nearestPlayer->_pos).x, 6400.0 < fVar3 * fVar3 + fVar7 * fVar7)))) { Game::BombDamage(g_game,dropDir,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); Game::spawn_bomb_crater(g_game,dropDir,(Entity *)0x0,1.0); uVar5 = Random(); Game::SpawnEx(g_game,1000,1,dropDir,&g_vectorZero,(Entity *)0x0,0,uVar5,0); } break; case 6: dropVariant = 10; local_130 = (Vector *)0x4; break; case 7: dropVariant = 0x1e; break; case 8: dropVariant = 0x3c; break; case 9: dropVariant = 0x168; break; default: goto switchD_006bf331_caseD_a; case 0xb: dropVariant = 0x15e; break; case 0xc: dropVariant = 10; local_130 = (Vector *)0x5; break; case 0xd: dropVariant = 10; local_130 = (Vector *)0x2; if (((!isIceFrozen) && (bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000), bVar2 == 0)) && ((dropDir = &npc->_pos, 0x1e < g_game->_frameCount - npc->_spawnFrame || (nearestPlayer = Game::GetNearestPlayer(g_game,dropDir), fVar3 = (npc->_pos).y - (nearestPlayer->_pos).y, fVar7 = dropDir->x - (nearestPlayer->_pos).x, 6400.0 < fVar3 * fVar3 + fVar7 * fVar7)))) { params = ProjectileParams::ProjectileParams(&projParams); local_11c.x = 7.0; local_11c.y = 0.0; Entity_NPC::FireProjectiles(npc,dropDir,&local_11c,8,params); } break; case 0xe: dropVariant = 300; fVar3 = (float)RNG::Next(&npc->_dropRNG); iVar4 = ItemPool::GetCardEx((int)fVar3,0,1,0,1); local_c8._shift3 = 7; local_c8._shift1 = 5; local_c8._shift2 = 9; local_c8._seed = (int)fVar3; local_130 = (Vector *)lua_callback_run_get_card(&local_c8,iVar4,0,1,1); break; case 0xf: if (!isIceFrozen) { local_120 = (Entity_NPC *)0x2; do { uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; (npc->_dropRNG)._seed = uVar5; uVar6 = Random(); fVar3 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c = (PlayerManager *)(fVar3 + fVar3); fVar3 = cos((float)local_12c); local_11c.x = fVar3 * 14.0 + (npc->_pos).x; fVar3 = sin((float)local_12c); local_11c.y = fVar3 * 14.0 + (npc->_pos).y; Game::SpawnEx(g_game,npc->_type,npc->_variant,&local_11c,&g_vectorZero,(Entity *)npc,0,uVar5 ,0); local_120 = (Entity_NPC *)((int)local_120 + -1); } while (local_120 != (Entity_NPC *)0x0); } break; case 0x11: if (!isIceFrozen) { uVar5 = Random(); spawned = Game::SpawnEx(g_game,0x12,0,&npc->_pos,&g_vectorZero,(Entity *)npc,0,uVar5,0); bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (bVar2 != 0) { *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfeffffff; *(undefined4 *)((int)&spawned->_flags + 4) = *(undefined4 *)((int)&spawned->_flags + 4); sourceRef._type = npc->_type; sourceRef._position.x = (npc->_pos).x; sourceRef._position.y = (npc->_pos).y; sourceRef._variant = npc->_variant; sourceRef._spawnerType = npc->_spawnerType; sourceRef._spawnerVariant = npc->_spawnerVariant; sourceRef._velocity.x = (npc->_velocity).x; sourceRef._velocity.y = (npc->_velocity).y; local_120 = (Entity_NPC *)(uint)((npc->_flags & 0x100) != 0); if ((npc->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((npc->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } sourceRef._flags = uVar6 | uVar5 | (uint)local_120; sourceRef._entity = npc; Entity::AddShrink(spawned,&sourceRef,0x96,0,0); if (0 < spawned->_shrinkCountdown) { flagsHigh = *(undefined4 *)((int)&spawned->_flags + 4); *(uint *)&spawned->_flags = (uint)spawned->_flags | 0x1000000; *(undefined4 *)((int)&spawned->_flags + 4) = flagsHigh; spawned->_shrinkStatus1 = spawned->_shrinkStatus2; } } } break; case 0x12: dropRng = &npc->_dropRNG; uVar5 = RNG::RandomInt(dropRng,5); if (uVar5 != 0) { return; } if (local_138._0_1_ == '\0') { return; } bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); local_138 = 0.0; dropCount = 1; if (bVar2 != 0) { dropCount = 2; } local_130 = &npc->_pos; do { uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(local_120->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; uVar6 = ItemPool::ForceAddPillEffect(&game->_itemPool,0x21); dropDir = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)&local_c8,local_130,0.0,0,0,0); npc = local_120; local_11c.y = (float)((double)(int)local_138 + __uint_to_double_fixup[-((int)local_138 >> 0x1f)]) + dropDir->y; local_11c.x = (float)((double)(int)local_138 + __uint_to_double_fixup[-((int)local_138 >> 0x1f)]) + dropDir->x; Game::SpawnEx(g_game,5,0x46,&local_11c,&g_vectorZero,(Entity *)local_120,uVar6,uVar5,0); dropRng = &npc->_dropRNG; local_138 = (float)((int)local_138 + 1); } while ((uint)local_138 < (uint)dropCount); return; case 0x13: dropRng = &npc->_dropRNG; uVar5 = RNG::RandomInt(dropRng,5); if (uVar5 != 0) { return; } if (local_138._0_1_ == '\0') { return; } bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); local_138 = 0.0; dropCount = 1; if (bVar2 != 0) { dropCount = 2; } local_130 = &npc->_pos; do { uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(local_120->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; uVar6 = ItemPool::ForceAddPillEffect(&game->_itemPool,0x20); dropDir = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)&local_c8,local_130,0.0,0,0,0); npc = local_120; local_11c.y = (float)((double)(int)local_138 + __uint_to_double_fixup[-((int)local_138 >> 0x1f)]) + dropDir->y; local_11c.x = (float)((double)(int)local_138 + __uint_to_double_fixup[-((int)local_138 >> 0x1f)]) + dropDir->x; Game::SpawnEx(g_game,5,0x46,&local_11c,&g_vectorZero,(Entity *)local_120,uVar6,uVar5,0); dropRng = &npc->_dropRNG; local_138 = (float)((int)local_138 + 1); } while ((uint)local_138 < (uint)dropCount); return; case 0x15: if (isDropping == '\0') { return; } nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos); uVar5 = RNG::RandomInt((RNG *)local_11c.x,3); Entity_Player::AddBlueFlies(nearestPlayer,uVar5 + 4,&npc->_pos,(Entity *)0x0); return; case 0x16: if (isDropping == '\0') { return; } uVar5 = RNG::RandomInt(&npc->_dropRNG,2); local_138 = (float)(uVar5 + 2); bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); if (bVar2 != 0) { local_138 = (float)((int)local_138 * 2); } if ((int)local_138 < 1) { return; } do { uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; (npc->_dropRNG)._seed = uVar5; dropDir = Room::FindFreePickupSpawnPosition (game->_room,(Vector *)&local_c8,&npc->_pos,0.0,0,0,0); Game::SpawnEx(g_game,5,0,dropDir,&g_vectorZero,(Entity *)npc,4,uVar5,0); local_138 = (float)((int)local_138 + -1); } while (local_138 != 0.0); return; case 0x17: nearestPlayer = Game::GetNearestPlayerEx(&npc->_pos,1,0,1); if (nearestPlayer == (Entity_Player *)0x0) { nearestPlayer = Game::GetPlayer(g_game,0); } Entity_Player::UseActiveItem(nearestPlayer,(short *)&local_12c,0x23,1,-1,0); ItemOverlay::Show(&g_game->_itemOverlay,0xc,3,(Entity_Player *)0x0); return; case 0x19: local_130 = (Vector *)0x0; dropRng = &npc->_dropRNG; do { if (SUB41(local_138,0) == '\0') { uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; if ((uVar5 & 1) == 0) goto LAB_006c0128; } else { LAB_006c0128: Room::FindFreePickupSpawnPosition(g_game->_room,&local_11c,&npc->_pos,40.0,0,0,0); uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; spawned = Game::SpawnEx(game,5,*(uint *)(&DAT_00b67400 + (int)local_130 * 4),&local_11c, &g_vectorZero,(Entity *)npc,0,uVar5,0); *(Vector **)&spawned[1]._sprite._flipX = local_130; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); if (bVar2 != 0) { dropDir = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)&local_c8,&npc->_pos,40.0,0,0,0); uVar5 = dropRng->_seed; local_11c.x = dropDir->x; local_11c.y = dropDir->y; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; spawned = Game::SpawnEx(game,5,*(uint *)(&DAT_00b67400 + (int)local_130 * 4),&local_11c, &g_vectorZero,(Entity *)npc,0,uVar5,0); *(Vector **)&spawned[1]._sprite._flipX = local_130; } } local_130 = (Vector *)((int)&local_130->x + 1); } while (local_130 < (Vector *)0x7); if ((char)local_12c == '\0') { bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if ((bVar2 == 0) && ((dropDir = &npc->_pos, 0x1e < g_game->_frameCount - npc->_spawnFrame || (nearestPlayer = Game::GetNearestPlayer(g_game,dropDir), fVar3 = (npc->_pos).y - (nearestPlayer->_pos).y, fVar7 = dropDir->x - (nearestPlayer->_pos).x, 6400.0 < fVar3 * fVar3 + fVar7 * fVar7)))) { Game::BombDamage(g_game,dropDir,40.0,60.0,1,(Entity *)npc,g_tearFlagsNone,4,0); Game::spawn_bomb_crater(g_game,dropDir,(Entity *)0x0,1.0); uVar5 = Random(); Game::SpawnEx(g_game,1000,1,dropDir,&g_vectorZero,(Entity *)0x0,0,uVar5,0); } bVar2 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if ((bVar2 == 0) && ((dropDir = &npc->_pos, 0x1e < g_game->_frameCount - npc->_spawnFrame || (nearestPlayer = Game::GetNearestPlayer(g_game,dropDir), fVar3 = (npc->_pos).y - (nearestPlayer->_pos).y, fVar7 = dropDir->x - (nearestPlayer->_pos).x, 6400.0 < fVar3 * fVar3 + fVar7 * fVar7)))) { params = ProjectileParams::ProjectileParams(&projParams); local_c8._seed = 0x40e00000; local_c8._4_8_ = (ulonglong)(uint)local_c8._shift2 << 0x20; Entity_NPC::FireProjectiles(npc,dropDir,(Vector *)&local_c8,8,params); } } goto switchD_006bf331_caseD_a; } if (local_138._0_1_ != '\0') { local_120 = (Entity_NPC *)(npc->_pos).x; local_138 = (npc->_pos).y; room = g_game->_room; iVar4 = (int)(((npc->_pos).x - 40.0) / 40.0 + 0.5); gridY = (int)((local_138 - 120.0) / 40.0 + 0.5); if ((((iVar4 < 0) || (room->_gridWidth <= iVar4)) || (gridY < 0)) || (room->_gridHeight <= gridY)) { iVar4 = -1; } else { iVar4 = room->_gridWidth * gridY + iVar4; } local_114.x = (float)local_120; local_114.y = local_138; uVar5 = Room::GetGridCollision(room,iVar4); if (0 < (int)uVar5) { dropDir = Room::FindFreeTilePosition(room,(Vector *)&local_c8,&local_114,40.0); local_120 = (Entity_NPC *)dropDir->x; local_138 = dropDir->y; } dropRng = &npc->_dropRNG; uVar5 = dropRng->_seed; local_12c = &g_game->_playerManager; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; glyphOwner = PlayerManager::RandomCollectibleOwner(local_12c,0x1d0,uVar5,(RNG **)0x0); if ((dropCount != 0) && (local_125 != '\0')) { uVar5 = dropRng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = dropRng->_seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; if ((uVar5 & 1) == 0) { dropCount = dropCount + 1; } } bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,5); if ((bVar2 != 0) && (npc->_isChampion != 0)) { dropCount = dropCount * 2; } if (dropCount != 0) { uVar5 = dropVariant; local_12c = (PlayerManager *)dropCount; do { if (glyphOwner != (Entity_Player *)0x0) { Entity_Player::GetGlyphOfBalanceDrop(glyphOwner,(int *)&dropVariant,(int *)&local_130); uVar5 = dropVariant; } if (uVar5 != 0) { if ((uint)dropCount < 2) { zeroDir.x = g_vectorZero.x; dropDir = &zeroDir; zeroDir.y = g_vectorZero.y; } else { uVar5 = Random(); local_114.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_114.x = local_114.x + local_114.x; randomDir.x = cos(local_114.x); randomDir.y = sin(local_114.x); dropDir = &randomDir; } local_114.x = dropDir->x; local_11c.x = dropDir->y; uVar5 = dropRng->_seed; dropVelocity.x = local_114.x; dropVelocity.y = local_11c.x; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (npc->_dropRNG)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ uVar5; local_c8._seed = (int)(local_114.x * 3.0 + (float)local_120); uVar5 = uVar5 >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ uVar5; dropRng->_seed = uVar5; local_c8._shift1 = (int)(local_11c.x * 3.0 + local_138); pickup = (Entity_Pickup *) Game::SpawnEx(game,5,dropVariant,(Vector *)&local_c8,&dropVelocity,(Entity *)npc, (uint)local_130,uVar5,0); if ((pickup->_variant == 0x15e) && ((((g_manager->_persistentGameData)._achievements[0x269] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) && (((npc->_flags & 0x400) != 0 && ((pickup->_subtype & 0x8000U) == 0)))))) { Entity_Pickup::Morph(pickup,pickup->_type,0x15e,pickup->_subtype | 0x8000,1,1,1); } uVar5 = dropVariant; } local_12c = (PlayerManager *)((int)&local_12c[-1]._extraPlayers._capacity + 3); } while (local_12c != (PlayerManager *)0x0); return; } } switchD_006bf331_caseD_a: return; } //@@ 006c04b0 Entity_NPC::UpdateDirtColor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_NPC::UpdateDirtColor(bool immediate); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_NPC::UpdateDirtColor(Entity_NPC *this,byte immediate) { float fVar1; float fVar2; byte bVar3; LayerState *layer; ColorMod *lerpedColor; byte *****pppppbVar4; byte *****pppppbVar5; uint uVar6; ColorMod *layerColor; uint size; float fVar7; ColorMod lerpResult; ANM2 *sprite; LayerState *currentLayer; byte *****layerNameData; uint local_68; Entity_NPC *npc; byte *layerIndex; char isDirtLayer; uint stringDestructFlags; byte *****layerName [4]; uint layerNameSize; uint layerNameCapacity; byte *****layerNameCopy; KColor local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(layerName + 0x14); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00afa8ae; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(layerName + 0x11); ExceptionList = &local_1c; stringDestructFlags = 0; local_68 = 0; npc = this; pppppbVar4 = (byte *****)(layerName + 0x14); if (immediate == 0) { bVar3 = Entity::IsFrame((Entity *)this,0xf,this->_index); pppppbVar4 = (byte *****)puStack_20; if (bVar3 == 0) goto LAB_006c05af; } puStack_20 = (undefined1 *)pppppbVar4; if ((this->_isChampion == 0) || (this->_championColorIdx != 2)) { Room::GetFloorColorAt(g_game->_room,&local_38,&this->_pos,this->_size); (this->_dirtColor)._tint[0] = local_38._red * 2.0; (this->_dirtColor)._tint[1] = local_38._green * 2.0; (this->_dirtColor)._tint[2] = local_38._blue * 2.0; } else { (this->_dirtColor)._tint[0] = 0.0; (this->_dirtColor)._tint[1] = 0.9; (this->_dirtColor)._tint[2] = 0.0; } (this->_dirtColor)._tint[3] = 1.0; LAB_006c05af: layerIndex = (byte *)0x0; if ((this->_sprite)._layerCount == 0) { ExceptionList = local_1c; return; } sprite = &this->_sprite; do { layer = ANM2::GetLayer(sprite,layerIndex); stringDestructFlags = stringDestructFlags | 4; currentLayer = layer; if (layer->_layerData == (void *)0x0) { layerNameCapacity = 0xf; layerNameSize = 0; layerName[0] = (byte *****)0x0; } else { std::string::string((char *)layerName,(void *)((int)layer->_layerData + 8)); } local_14 = (byte ****)0x0; local_68 = stringDestructFlags | 1; pppppbVar4 = (byte *****)layerName; if (0xf < layerNameCapacity) { pppppbVar4 = layerName[0]; } layerNameData = layerName[0]; stringDestructFlags = local_68; bVar3 = str_eq((byte *)pppppbVar4,layerNameSize,&DAT_00b64428,4); if (bVar3 == 0) { stringDestructFlags = stringDestructFlags | 8; if (layer->_layerData == (void *)0x0) { layerNameCopy = (byte *****)0x0; local_38._unk = 0xf; local_38._alpha = 0.0; } else { std::string::string((char *)&layerNameCopy,(void *)((int)layer->_layerData + 8)); } uVar6 = local_38._unk; pppppbVar4 = layerNameCopy; stringDestructFlags = stringDestructFlags | 2; pppppbVar5 = (byte *****)&layerNameCopy; if (0xf < (uint)local_38._unk) { pppppbVar5 = layerNameCopy; } bVar3 = str_eq((byte *)pppppbVar5,(uint)local_38._alpha,&DAT_00b1d57c,4); if (bVar3 != 0) goto LAB_006c06a7; isDirtLayer = '\0'; } else { pppppbVar4 = layerNameCopy; uVar6 = local_38._unk; LAB_006c06a7: isDirtLayer = '\x01'; } if (((stringDestructFlags & 2) != 0) && (stringDestructFlags = stringDestructFlags & 0xfffffffd, 0xf < uVar6)) { size = uVar6 + 1; pppppbVar5 = pppppbVar4; if (0xfff < size) { pppppbVar5 = (byte *****)pppppbVar4[-1]; size = uVar6 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar4 + (-4 - (int)pppppbVar5))) goto LAB_006c07af; } operator_delete(pppppbVar5,size); } local_14 = (byte ****)0xffffffff; if (((stringDestructFlags & 1) != 0) && (stringDestructFlags = stringDestructFlags & 0xfffffffe, 0xf < layerNameCapacity)) { uVar6 = layerNameCapacity + 1; pppppbVar4 = layerNameData; if (0xfff < uVar6) { pppppbVar4 = (byte *****)layerNameData[-1]; uVar6 = layerNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)layerNameData + (-4 - (int)pppppbVar4))) { LAB_006c07af: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,uVar6); } layer = currentLayer; if (isDirtLayer != '\0') { if (immediate == 0) { fVar7 = 0.1; } else { fVar7 = 1.0; } layerColor = ¤tLayer->_color; lerpedColor = Color::Lerp(&lerpResult,layerColor,&npc->_dirtColor,fVar7); if (layerColor != lerpedColor) { fVar7 = lerpedColor->_tint[1]; fVar1 = lerpedColor->_tint[2]; fVar2 = lerpedColor->_tint[3]; layerColor->_tint[0] = lerpedColor->_tint[0]; (layer->_color)._tint[1] = fVar7; (layer->_color)._tint[2] = fVar1; (layer->_color)._tint[3] = fVar2; fVar7 = lerpedColor->_colorize[1]; fVar1 = lerpedColor->_colorize[2]; fVar2 = lerpedColor->_colorize[3]; (layer->_color)._colorize[0] = lerpedColor->_colorize[0]; (layer->_color)._colorize[1] = fVar7; (layer->_color)._colorize[2] = fVar1; (layer->_color)._colorize[3] = fVar2; fVar7 = lerpedColor->_offset[1]; (layer->_color)._offset[0] = lerpedColor->_offset[0]; (layer->_color)._offset[1] = fVar7; (layer->_color)._offset[2] = lerpedColor->_offset[2]; } } layerIndex = layerIndex + 1; if ((byte *)(npc->_sprite)._layerCount <= layerIndex) { ExceptionList = local_1c; return; } } while( true ); } //@@ 006c07e0 Entity_NPC::Redirect /* ZHL [exact] static cleanup bool Entity_NPC::Redirect(int* EntityType,int* Variant); prototype: db/protos.zhl */ byte __cdecl Entity_NPC::Redirect(int *entityType,int *variant) { byte isGreedMode; int iVar1; int redirectedType; Game *game; undefined1 local_14 [8]; void *seedEffectNode; undefined4 seedEffectId; Manager *manager; manager = g_manager; game = g_game; if (((g_manager->_persistentGameData)._achievements[0x21] == 0) && ((((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) && ((*entityType == 0x3d && (*variant == 5)))))) { *entityType = 0xd; *variant = 0; } if (((manager->_persistentGameData)._achievements[0x15c] != 0) || (((manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) goto LAB_006c0e23; iVar1 = *entityType; if (iVar1 == 0x12f) { if ((game->_difficulty == 0) || (game->_difficulty == 2)) { *entityType = 0x1d; *variant = 1; return 1; } *entityType = 0xfa; *variant = 0; return 1; } if (iVar1 == 300) { *entityType = 0x1b; LAB_006c08b1: *variant = 0; return 1; } if (iVar1 == 0x131) { *entityType = 0x1d; *variant = 0; return 1; } if (iVar1 == 0xe7) goto LAB_006c08b1; if (iVar1 == 0x12d) { *entityType = 0x20; *variant = 0; return 1; } if (iVar1 == 0x12e) { if ((game->_difficulty == 0) || (iVar1 = 0x101, game->_difficulty == 2)) { iVar1 = 0xd0; } *entityType = iVar1; *variant = 0; return 1; } if (iVar1 == 0x130) { if ((game->_difficulty == 0) || (iVar1 = 0xf2, game->_difficulty == 2)) { iVar1 = 0xf0; } *entityType = iVar1; *variant = 0; return 1; } if (iVar1 != 0x132) { LAB_006c0e23: seedEffectId = 0x4f; std::set::find_node(local_14,&seedEffectId); if (((*(char *)((int)seedEffectNode + 0xd) != '\0') || (0x4f < *(int *)((int)seedEffectNode + 0x10))) || (seedEffectNode == (game->_seedEffects)._seedEffects)) { return 0; } iVar1 = *entityType; if (iVar1 != 0x1b) { if (iVar1 == 0xcc) { *entityType = 0xf7; return 0; } if (iVar1 != 0x35b) { if (iVar1 == 0xdd) { *entityType = 0x3a; return 0; } return 0; } *entityType = 0x19; } *variant = 1; return 0; } isGreedMode = Game::IsGreedMode(game); if (isGreedMode == 0) { iVar1 = Room::GetRoomConfigStage(game->_room); switch(iVar1) { case 0: if ((g_game->_difficulty == 0) || (iVar1 = 0x5e, g_game->_difficulty == 2)) { iVar1 = 0x55; } *entityType = iVar1; *variant = 0; return 1; case 1: case 3: iVar1 = g_game->_difficulty; goto LAB_006c0994; case 2: if ((g_game->_difficulty == 0) || (redirectedType = 0x5e, g_game->_difficulty == 2)) { *entityType = 0x55; *variant = 0; return 1; } break; case 4: if ((g_game->_difficulty == 0) || (redirectedType = 0x17, g_game->_difficulty == 2)) { *entityType = 0x15; *variant = 0; return 1; } break; case 5: if ((g_game->_difficulty == 0) || (g_game->_difficulty == 2)) { *entityType = 0x1a; *variant = 0; return 1; } *entityType = 0x1a; *variant = 1; return 1; case 6: if ((g_game->_difficulty == 0) || (g_game->_difficulty == 2)) { *entityType = 0x17; *variant = 0; return 1; } *entityType = 0x17; *variant = 1; return 1; case 7: if ((g_game->_difficulty == 0) || (redirectedType = 0xe3, g_game->_difficulty == 2)) { *entityType = 0xd1; *variant = 0; return 1; } break; case 8: if ((g_game->_difficulty == 0) || (g_game->_difficulty == 2)) { *entityType = 0xe3; *variant = 0; return 1; } *entityType = 0x18; *variant = 1; return 1; case 9: if ((g_game->_difficulty == 0) || (redirectedType = 0x115, g_game->_difficulty == 2)) { *entityType = 0x18; *variant = 0; return 1; } break; case 10: if ((g_game->_difficulty == 0) || (redirectedType = 0x3a, g_game->_difficulty == 2)) { *entityType = 0xf; *variant = 0; return 1; } break; case 0xb: if ((g_game->_difficulty == 0) || (redirectedType = 0x27, g_game->_difficulty == 2)) { *entityType = 0x3a; *variant = 0; return 1; } break; case 0xc: if ((g_game->_difficulty == 0) || (g_game->_difficulty == 2)) { *entityType = 0x27; *variant = 0; return 1; } *entityType = 0x27; *variant = 1; return 1; case 0xd: *entityType = 0x129; *variant = 0; return 1; case 0xe: if ((g_game->_difficulty == 0) || (redirectedType = 0xfc, g_game->_difficulty == 2)) { *entityType = 0x57; *variant = 0; return 1; } break; case 0xf: if ((g_game->_difficulty == 0) || (iVar1 = 0x37, g_game->_difficulty == 2)) { iVar1 = 0x1a; } *entityType = iVar1; *variant = 2; return 1; case 0x10: if ((g_game->_difficulty == 0) || (iVar1 = 0x32, g_game->_difficulty == 2)) { iVar1 = 0x30; } *entityType = iVar1; *variant = 1; return 1; case 0x11: if ((g_game->_difficulty == 0) || (redirectedType = 0x19a, g_game->_difficulty == 2)) { *entityType = 0x10b; *variant = 0; return 1; } break; default: game = g_game; goto LAB_006c0e23; case 0x1a: *entityType = 0x19c; *variant = 0; return 1; } } else { switch(game->_stage) { case 1: iVar1 = game->_difficulty; break; case 2: if ((game->_difficulty == 0) || (iVar1 = 0x17, game->_difficulty == 2)) { iVar1 = 0x15; } *entityType = iVar1; *variant = 0; return 1; case 3: if ((game->_difficulty == 0) || (iVar1 = 0xe3, game->_difficulty == 2)) { iVar1 = 0xd1; } *entityType = iVar1; *variant = 0; return 1; case 4: if ((game->_difficulty == 0) || (iVar1 = 0x3a, game->_difficulty == 2)) { iVar1 = 0xf; } *entityType = iVar1; *variant = 0; return 1; case 5: if ((game->_difficulty == 0) || (iVar1 = 0xfc, game->_difficulty == 2)) { iVar1 = 0x57; } *entityType = iVar1; *variant = 0; return 1; case 6: if ((game->_difficulty == 0) || (game->_difficulty == 2)) { *entityType = 0x32; *variant = 0; return 1; } *entityType = 0x32; *variant = 1; return 1; default: *entityType = 299; *variant = 0; return 1; } LAB_006c0994: if ((iVar1 == 0) || (redirectedType = 0x11c, iVar1 == 2)) { redirectedType = 10; } } *entityType = redirectedType; *variant = 0; return 1; } //@@ 006c0f30 Entity_NPC::Morph /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_NPC::Morph(int EntityType,int Variant,int SubType,int Championid); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity_NPC::Morph(Entity_NPC *this,int EntityType,int Variant,int SubType,int Championid) { float *pfVar1; byte bVar2; EntityConfig_Entity *pEVar3; float *pfVar4; undefined4 extraout_EAX; int unusedArg; float fVar5; Color CStack_38; uint local_c; local_c = __security_cookie ^ (uint)&CStack_38; if ((((EntityType == this->_type) && (Variant == this->_variant)) && (SubType == this->_subtype)) && ((Championid < 0 || (Championid == this->_championColorIdx)))) { return; } this->_type = EntityType; this->_variant = Variant; this->_subtype = SubType; if (-1 < Championid) { this->_championColorIdx = Championid; this->_isChampion = 1; } pEVar3 = EntityConfig::GetEntity(&g_manager->_entityConfig,EntityType,Variant,SubType); if ((pEVar3 != (EntityConfig_Entity *)0x0) && (pEVar3->canBeChampion == 0)) { this->_championColorIdx = -1; this->_isChampion = 0; } this->_flickerTimer = 0; this->_championRegenTimer = 0; this->_flickerState = 0; this->_flickerAlpha = 1.0; this->_championSpeed = 1.0; this->_championTimer = 0; (**(code **)(*(int *)this + 0x60))(); this->_scale = 1.0; fVar5 = this->_shrinkStatus1 * g_vectorOne.y; (this->_sprite)._scale.x = this->_shrinkStatus1 * g_vectorOne.x; (this->_sprite)._scale.y = fVar5; (**(code **)(*(int *)this + 100))(); pfVar4 = &this->_maxHitPoints; fVar5 = this->_hitPointsMulti * *pfVar4; pfVar1 = &this->_health; this->_totalDamageTaken = 0.0; *pfVar4 = fVar5; if (*pfVar1 <= fVar5 && fVar5 != *pfVar1) { pfVar4 = pfVar1; } *pfVar1 = *pfVar4; if ((this->_colorParams)._begin != (this->_colorParams)._end) { Color::Color(&CStack_38); (**(code **)(*(int *)this + 0x3c))(extraout_EAX,1,0xfffffc18,0,1); } PathFinder::Reset((PathFinder *)&this->_pathfinder); PersistentGameData::TryAddBestiaryEncounter (&g_manager->_persistentGameData,this->_type,this->_variant); this->_isBestiaryEncountered = 1; bVar2 = Game::ShouldEraseEnemy((Entity *)this); if (bVar2 != 0) { Entity::RemoveWithPoof((Entity *)this,unusedArg); } return; } //@@ 006c1100 Entity_NPC::ResetColor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] void ResetColor(); */ void __thiscall Entity_NPC::ResetColor(Entity_NPC *this) { float fVar1; float fVar2; float fVar3; LayerState *layer; float *championColor; char isChampionLayer; ColorMod *spriteColor; byte *layerIdx; undefined1 flashColor [44]; undefined4 local_b4 [11]; char local_85; Color bossColor; char local_58 [24]; char local_40 [24]; char local_28 [32]; undefined4 local_8; int bossColorIdx; int bossColors; local_8 = __security_cookie ^ (uint)(local_28 + 0x24); if (this->_isChampion == 0) { bossColorIdx = this->_bosscoloridx; if (bossColorIdx < 0) { spriteColor = &(this->_sprite)._color; if (spriteColor != &this->_color) { fVar1 = (this->_color)._tint[1]; fVar2 = (this->_color)._tint[2]; fVar3 = (this->_color)._tint[3]; spriteColor->_tint[0] = (this->_color)._tint[0]; (this->_sprite)._color._tint[1] = fVar1; (this->_sprite)._color._tint[2] = fVar2; (this->_sprite)._color._tint[3] = fVar3; fVar1 = (this->_color)._colorize[1]; fVar2 = (this->_color)._colorize[2]; fVar3 = (this->_color)._colorize[3]; (this->_sprite)._color._colorize[0] = (this->_color)._colorize[0]; (this->_sprite)._color._colorize[1] = fVar1; (this->_sprite)._color._colorize[2] = fVar2; (this->_sprite)._color._colorize[3] = fVar3; *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)(this->_color)._offset; (this->_sprite)._color._offset[2] = (this->_color)._offset[2]; } } else { bossColors = *(int *)((int)this->_config + 0x68); if (bossColorIdx < (*(int *)((int)this->_config + 0x6c) - bossColors) / 0x7c) { Color::copy_constructor_ext(&bossColor,(void *)(bossColorIdx * 0x7c + bossColors)); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&bossColor); std::string::_Tidy_deallocate(local_28); std::string::_Tidy_deallocate(local_40); std::string::_Tidy_deallocate(local_58); } } } else { layerIdx = (byte *)0x0; local_85 = '\0'; isChampionLayer = '\0'; if ((this->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&this->_sprite,layerIdx); if ((layer->_bitflags & 0x10) != 0) { isChampionLayer = '\x01'; goto LAB_006c115c; } layerIdx = layerIdx + 1; } while (layerIdx < (byte *)(this->_sprite)._layerCount); isChampionLayer = local_85; } LAB_006c115c: if ((uint)this->_championColorIdx < 0x1a) { spriteColor = &(this->_sprite)._color; if (isChampionLayer == '\0') { championColor = (float *)_Entity_NPC::GetColorWithFlash(flashColor); } else { championColor = (float *)(&DAT_00c354d4 + this->_championColorIdx * 0x40); } if (spriteColor != (ColorMod *)championColor) { fVar1 = championColor[1]; fVar2 = championColor[2]; fVar3 = championColor[3]; spriteColor->_tint[0] = *championColor; (this->_sprite)._color._tint[1] = fVar1; (this->_sprite)._color._tint[2] = fVar2; (this->_sprite)._color._tint[3] = fVar3; fVar1 = championColor[5]; fVar2 = championColor[6]; fVar3 = championColor[7]; (this->_sprite)._color._colorize[0] = championColor[4]; (this->_sprite)._color._colorize[1] = fVar1; (this->_sprite)._color._colorize[2] = fVar2; (this->_sprite)._color._colorize[3] = fVar3; *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)(championColor + 8); (this->_sprite)._color._offset[2] = championColor[10]; } } } if (((this->_flags & 0x20000000) != 0) && (((this->_type != 0x17 || (this->_variant != 0)) || (this->_subtype != 1)))) { spriteColor = &(this->_sprite)._color; if (spriteColor != (ColorMod *)local_b4) { spriteColor->_tint[0] = 0.8; (this->_sprite)._color._tint[1] = 0.8; (this->_sprite)._color._tint[2] = 0.8; (this->_sprite)._color._tint[3] = 1.0; (this->_sprite)._color._offset[0] = 0.1; (this->_sprite)._color._offset[1] = 0.1; (this->_sprite)._color._colorize[0] = 1.0; (this->_sprite)._color._colorize[1] = 1.0; (this->_sprite)._color._colorize[2] = 1.0; (this->_sprite)._color._colorize[3] = -0.5; (this->_sprite)._color._offset[2] = 0.1; } } fVar3 = fRam00c34218; fVar2 = fRam00c34214; fVar1 = fRam00c34210; if ((this->_type == 0x3c3) && (spriteColor = &(this->_sprite)._color, spriteColor != (ColorMod *)&DAT_00c3420c)) { spriteColor->_tint[0] = _DAT_00c3420c; (this->_sprite)._color._tint[1] = fVar1; (this->_sprite)._color._tint[2] = fVar2; (this->_sprite)._color._tint[3] = fVar3; fVar3 = fRam00c34228; fVar2 = fRam00c34224; fVar1 = fRam00c34220; (this->_sprite)._color._colorize[0] = _DAT_00c3421c; (this->_sprite)._color._colorize[1] = fVar1; (this->_sprite)._color._colorize[2] = fVar2; (this->_sprite)._color._colorize[3] = fVar3; *(undefined8 *)(this->_sprite)._color._offset = DAT_00c3422c; (this->_sprite)._color._offset[2] = DAT_00c34234; } return; } //@@ 006c1330 Entity_NPC::AnimWalkFrame /* ZHL [lua] Lua binding EntityNPC:AnimWalkFrame prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_NPC::AnimWalkFrame (Entity_NPC *this,std_string *horizontalAnim,std_string *verticalAnim,float speedThreshold ) { byte bVar1; Vector *downVector; byte *currentAnimName; uint animCompare; std_string *animNameCursor; bool isLess; undefined1 *forwardX; undefined1 *forwardY; Vector local_10; float velocityX; float velocityY; if ((this->_isChampion != 0) && (!(1.0 < this->_championSpeed || this->_championSpeed == 1.0))) { speedThreshold = speedThreshold * 0.5; } velocityX = (this->_velocity).x; velocityY = (this->_velocity).y; if (velocityX * velocityX + velocityY * velocityY < speedThreshold * speedThreshold) { if (0xf < verticalAnim->_capacity) { verticalAnim = *(std_string **)verticalAnim->_buf; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)verticalAnim,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } downVector = Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,3); (this->_forwardVector).x = downVector->x; (this->_forwardVector).y = downVector->y; return; } if (ABS(velocityX) <= ABS((this->_velocity).y)) { local_10.x = (float)verticalAnim; if (0xf < verticalAnim->_capacity) { local_10.x = *(float *)verticalAnim->_buf; } currentAnimName = (this->_sprite)._animState._animData; if (currentAnimName != (byte *)0x0) { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } animNameCursor = (std_string *)local_10.x; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)animNameCursor->_buf[0]; if (bVar1 != animNameCursor->_buf[0]) { LAB_006c1500: animCompare = -(uint)isLess | 1; goto LAB_006c1505; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)animNameCursor->_buf[1]; if (bVar1 != animNameCursor->_buf[1]) goto LAB_006c1500; currentAnimName = currentAnimName + 2; animNameCursor = (std_string *)(animNameCursor->_buf + 2); } while (bVar1 != 0); animCompare = 0; LAB_006c1505: if ((animCompare == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_006c153f; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)local_10.x,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_006c153f; } if (0xf < horizontalAnim->_capacity) { horizontalAnim = *(std_string **)horizontalAnim->_buf; } currentAnimName = (this->_sprite)._animState._animData; if (currentAnimName == (byte *)0x0) { LAB_006c147b: bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)horizontalAnim,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(currentAnimName + 0x14)) { currentAnimName = *(byte **)currentAnimName; } animNameCursor = horizontalAnim; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)animNameCursor->_buf[0]; if (bVar1 != animNameCursor->_buf[0]) { LAB_006c1460: animCompare = -(uint)isLess | 1; goto LAB_006c1465; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)animNameCursor->_buf[1]; if (bVar1 != animNameCursor->_buf[1]) goto LAB_006c1460; currentAnimName = currentAnimName + 2; animNameCursor = (std_string *)(animNameCursor->_buf + 2); } while (bVar1 != 0); animCompare = 0; LAB_006c1465: if ((animCompare != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_006c147b; } (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; LAB_006c153f: forwardY = (undefined1 *)0x0; velocityX = (this->_velocity).x; velocityY = (this->_velocity).y; if (ABS(velocityX) <= ABS(velocityY)) { forwardX = (undefined1 *)0x0; if (0.0 <= velocityY) { forwardY = (undefined1 *)0x3f800000; } else { forwardY = &DAT_bf800000; } } else if (0.0 <= velocityX) { forwardX = (undefined1 *)0x3f800000; } else { forwardX = &DAT_bf800000; } (this->_forwardVector).x = (float)forwardX; (this->_forwardVector).y = (float)forwardY; return; } //@@ 006c15c0 NpcHelper::charger_update_move_anim /* DB: sets move animation by velocity direction (Charger L2, Revenant) */ void NpcHelper::charger_update_move_anim(byte *param_1,byte *param_2,byte *param_3,float param_4) { byte bVar1; Vector *downDir; byte *curAnimChar; uint uVar2; int in_ECX; byte *wantedAnimChar; bool bVar3; float faceDirX; float faceDirY; Vector local_18; float velocityX; if ((*(char *)(in_ECX + 0xc63) != '\0') && (!(1.0 < *(float *)(in_ECX + 0xbac) || *(float *)(in_ECX + 0xbac) == 1.0))) { param_4 = param_4 * 0.5; } velocityX = *(float *)(in_ECX + 0x360); if (velocityX * velocityX + *(float *)(in_ECX + 0x364) * *(float *)(in_ECX + 0x364) < param_4 * param_4) { if (0xf < *(uint *)(param_3 + 0x14)) { param_3 = *(byte **)param_3; } bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),param_3,1); if (((bVar1 != 0) && (*(int *)(in_ECX + 0x7c) != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x78),0.0), *(int *)(in_ECX + 0x7c) != 0)) { *(undefined1 *)(in_ECX + 0x8c) = 0; } downDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_18,3); *(float *)(in_ECX + 0xf30) = downDir->x; *(float *)(in_ECX + 0xf34) = downDir->y; return; } if (ABS(velocityX) <= ABS(*(float *)(in_ECX + 0x364))) { if (*(float *)(in_ECX + 0x364) < 0.0) { param_3 = param_2; } local_18.y = (float)param_3; if (0xf < *(uint *)(param_3 + 0x14)) { local_18.y = *(float *)param_3; } curAnimChar = *(byte **)(in_ECX + 0x7c); if (curAnimChar == (byte *)0x0) { LAB_006c17ce: bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),(byte *)local_18.y,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x78)); *(undefined1 *)(in_ECX + 0x8c) = 1; } } else { wantedAnimChar = (byte *)local_18.y; if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } do { bVar1 = *curAnimChar; bVar3 = bVar1 < *wantedAnimChar; if (bVar1 != *wantedAnimChar) { LAB_006c17b0: uVar2 = -(uint)bVar3 | 1; goto LAB_006c17b5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar3 = bVar1 < wantedAnimChar[1]; if (bVar1 != wantedAnimChar[1]) goto LAB_006c17b0; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006c17b5: if ((uVar2 != 0) || ((*(char *)(*(int *)(in_ECX + 0x7c) + 0x34) != '\0' && (*(char *)(in_ECX + 0x8c) == '\0'))) ) goto LAB_006c17ce; } bVar3 = false; goto LAB_006c1801; } if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } curAnimChar = *(byte **)(in_ECX + 0x7c); if (curAnimChar == (byte *)0x0) { LAB_006c171e: bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x48),param_1,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x78)); *(undefined1 *)(in_ECX + 0x8c) = 1; } } else { wantedAnimChar = param_1; if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } do { bVar1 = *curAnimChar; bVar3 = bVar1 < *wantedAnimChar; if (bVar1 != *wantedAnimChar) { LAB_006c1700: uVar2 = -(uint)bVar3 | 1; goto LAB_006c1705; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar3 = bVar1 < wantedAnimChar[1]; if (bVar1 != wantedAnimChar[1]) goto LAB_006c1700; curAnimChar = curAnimChar + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006c1705: if ((uVar2 != 0) || ((*(char *)(*(int *)(in_ECX + 0x7c) + 0x34) != '\0' && (*(char *)(in_ECX + 0x8c) == '\0')))) goto LAB_006c171e; } bVar3 = *(float *)(in_ECX + 0x360) <= 0.0 && *(float *)(in_ECX + 0x360) != 0.0; LAB_006c1801: faceDirY = 0.0; *(bool *)(in_ECX + 0x148) = bVar3; if (ABS(*(float *)(in_ECX + 0x360)) <= ABS(*(float *)(in_ECX + 0x364))) { faceDirX = 0.0; if (0.0 <= *(float *)(in_ECX + 0x364)) { faceDirY = 1.0; } else { faceDirY = (float)&DAT_bf800000; } } else if (0.0 <= *(float *)(in_ECX + 0x360)) { faceDirX = 1.0; } else { faceDirX = (float)&DAT_bf800000; } *(float *)(in_ECX + 0xf30) = faceDirX; *(float *)(in_ECX + 0xf34) = faceDirY; return; } //@@ 006c1870 Entity_NPC::anim_walk_frame_4dir /* DB: 4 anim names by velocity, threshold; Gutted/Peeper Fatty */ void __thiscall Entity_NPC::anim_walk_frame_4dir (Entity_NPC *this,byte *param_2,byte *param_3,byte *param_4,byte *param_5,float param_6) { byte bVar1; Vector *idleDir; byte *curAnimName; uint cmpResult; byte *wantedAnimName; bool isLess; float dirX; float dirY; Vector local_18; float velX; float velY; if ((this->_isChampion != 0) && (!(1.0 < this->_championSpeed || this->_championSpeed == 1.0))) { param_6 = param_6 * 0.5; } velX = (this->_velocity).x; velY = (this->_velocity).y; local_18.y = (float)this; if (velX * velX + velY * velY < param_6 * param_6) { if (0xf < *(uint *)(param_5 + 0x14)) { param_5 = *(byte **)param_5; } bVar1 = ANM2::SetAnimation(&this->_sprite,param_5,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } idleDir = Isaac::GetAxisAlignedUnitVectorFromDir(&local_18,3); (this->_forwardVector).x = idleDir->x; (this->_forwardVector).y = idleDir->y; return; } velY = (this->_velocity).y; if (ABS(velX) <= ABS(velY)) { if (velY < 0.0) { param_5 = param_4; } if (0xf < *(uint *)(param_5 + 0x14)) { param_5 = *(byte **)param_5; } curAnimName = (this->_sprite)._animState._animData; if (curAnimName != (byte *)0x0) { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } wantedAnimName = param_5; do { bVar1 = *curAnimName; isLess = bVar1 < *wantedAnimName; if (bVar1 != *wantedAnimName) goto LAB_006c1a05; if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < wantedAnimName[1]; if (bVar1 != wantedAnimName[1]) goto LAB_006c1a05; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar1 != 0); LAB_006c1a01: cmpResult = 0; goto LAB_006c1a0a; } } else { param_5 = param_3; if (velX < 0.0) { param_5 = param_2; } if (0xf < *(uint *)(param_5 + 0x14)) { param_5 = *(byte **)param_5; } curAnimName = (this->_sprite)._animState._animData; if (curAnimName != (byte *)0x0) { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } wantedAnimName = param_5; do { bVar1 = *curAnimName; isLess = bVar1 < *wantedAnimName; if (bVar1 != *wantedAnimName) goto LAB_006c1a05; if (bVar1 == 0) goto LAB_006c1a01; bVar1 = curAnimName[1]; isLess = bVar1 < wantedAnimName[1]; if (bVar1 != wantedAnimName[1]) goto LAB_006c1a05; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_006c1a0a; } } LAB_006c1a1d: bVar1 = ANM2::SetAnimation(&this->_sprite,param_5,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_006c1a3a: dirY = 0.0; velX = ((Vector *)((int)local_18.y + 0x360))->x; velY = ((Vector *)((int)local_18.y + 0x360))->y; if (ABS(velX) <= ABS(velY)) { dirX = 0.0; if (0.0 <= velY) { dirY = 1.0; } else { dirY = (float)&DAT_bf800000; } } else if (0.0 <= velX) { dirX = 1.0; } else { dirX = (float)&DAT_bf800000; } ((Vector *)((int)local_18.y + 0xf30))->x = dirX; ((Vector *)((int)local_18.y + 0xf30))->y = dirY; return; LAB_006c1a05: cmpResult = -(uint)isLess | 1; LAB_006c1a0a: if ((cmpResult == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_006c1a3a; goto LAB_006c1a1d; } //@@ 006c1ac0 Entity_NPC::shopkeeper_get_loot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall LootList Entity_NPC::shopkeeper_get_loot(bool ShouldAdvance); prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall Entity_NPC::shopkeeper_get_loot(Entity_NPC *this,void *outLoot,byte isShouldAdvance) { code *pcVar1; byte bVar2; byte isRemoved; void *dequeMap; void *block; int triesLeft; int iVar3; uint local_ESI_258; RNG *rng; int *ptr; int *lootList; void *lootMap; int lootMapSize; undefined4 lootOffset; int lootCount; uint local_38; RNG rngCopy; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; RNG *dropRng; RNG *lootRng; int lootSubtype; undefined4 lootType; undefined4 temp_3f540a64be; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afa8ed; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; lootList = (int *)0x0; lootMap = (void *)0x0; lootMapSize = 0; lootOffset = 0; lootCount = 0; lootList = operator_new(8); lootList[1] = 0; *lootList = (int)&lootList; local_14 = 0; if ((this->_flags & 0x40000000000) != 0) { LootList::LootList(&lootList); if (lootCount != 0) { do { lootCount = lootCount + -1; } while (lootCount != 0); lootOffset = 0; lootCount = 0; } dequeMap = lootMap; iVar3 = lootMapSize; if (lootMapSize != 0) { do { block = *(void **)((int)dequeMap + iVar3 * 4 + -4); iVar3 = iVar3 + -1; if (block != (void *)0x0) { operator_delete(block,0x14); dequeMap = lootMap; } } while (iVar3 != 0); } if (dequeMap != (void *)0x0) { local_ESI_258 = lootMapSize * 4; block = dequeMap; if (0xfff < local_ESI_258) { block = *(void **)((int)dequeMap + -4); local_ESI_258 = local_ESI_258 + 0x23; if (0x1f < (uint)((int)dequeMap + (-4 - (int)block))) goto LAB_006c2071; } operator_delete(block,local_ESI_258); } ptr = lootList; goto LAB_006c2087; } lootRng = &this->_dropRNG; rng = &rngCopy; if (isShouldAdvance != 0) { rng = lootRng; } rngCopy._seed = (this->_dropRNG)._seed; rngCopy._shift1 = (this->_dropRNG)._shift1; rngCopy._shift2 = (this->_dropRNG)._shift2; rngCopy._shift3 = (this->_dropRNG)._shift3; if ((this->_variant == 3) || (this->_variant == 4)) { local_38 = rng->_seed; if (local_38 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_38 = rng->_seed; if (local_38 == 0) { pcVar1 = (code *)swi(3); dequeMap = (void *)(*pcVar1)(); return dequeMap; } } local_38 = local_38 >> ((byte)rng->_shift1 & 0x1f) ^ local_38; local_38 = local_38 ^ local_38 << ((byte)rng->_shift2 & 0x1f); local_38 = local_38 ^ local_38 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = local_38; if (((local_38 & 0x7f) == 0) && (*(int *)((int)g_game->_room + 8) != 5)) { local_ESI_258 = RNG::Next(rng); lootSubtype = 0; temp_3f540a64be = 0; lootType = 0x32; goto LAB_006c1ff3; } if (local_38 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_38 = rng->_seed; if (local_38 == 0) { pcVar1 = (code *)swi(3); dequeMap = (void *)(*pcVar1)(); return dequeMap; } } local_38 = local_38 >> ((byte)rng->_shift1 & 0x1f) ^ local_38; local_38 = local_38 ^ local_38 << ((byte)rng->_shift2 & 0x1f); local_38 = local_38 ^ local_38 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = local_38; if ((local_38 & 0x1f) == 0) { iVar3 = 3; LAB_006c1ea1: lootSubtype = 0; triesLeft = iVar3; do { iVar3 = triesLeft + -1; if (triesLeft < 1) { if (lootSubtype == 0) goto LAB_006c1ffb; LAB_006c1f71: if (isShouldAdvance != 0) { ItemPool::RemoveTrinket(&g_game->_itemPool,lootSubtype); } local_ESI_258 = RNG::Next(rng); temp_3f540a64be = 0x15e; goto LAB_006c1ff1; } if (local_38 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_38 = rng->_seed; if (local_38 == 0) { pcVar1 = (code *)swi(3); dequeMap = (void *)(*pcVar1)(); return dequeMap; } } local_38 = local_38 >> ((byte)rng->_shift1 & 0x1f) ^ local_38; local_38 = local_38 << ((byte)rng->_shift2 & 0x1f) ^ local_38; local_38 = local_38 >> ((byte)rng->_shift3 & 0x1f) ^ local_38; rng->_seed = local_38; switch(local_38 % 6) { case 0: lootSubtype = 1; break; case 1: lootSubtype = 0x18; break; case 2: lootSubtype = 0x31; break; case 3: lootSubtype = 0x32; break; case 4: lootSubtype = 0x33; break; case 5: lootSubtype = 0x34; } dequeMap = (g_game->_itemPool)._trinketPoolItems._begin; if ((*(char *)((int)dequeMap + lootSubtype * 8 + 4) == '\0') || (*(char *)((int)dequeMap + lootSubtype * 8 + 5) == '\0')) goto LAB_006c1ea1; if (lootSubtype != 0) goto LAB_006c1f71; triesLeft = iVar3; } while( true ); } if (local_38 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_38 = rng->_seed; if (local_38 == 0) { pcVar1 = (code *)swi(3); dequeMap = (void *)(*pcVar1)(); return dequeMap; } } local_ESI_258 = local_38 >> ((byte)rng->_shift1 & 0x1f) ^ local_38; local_ESI_258 = local_ESI_258 ^ local_ESI_258 << ((byte)rng->_shift2 & 0x1f); local_ESI_258 = local_ESI_258 ^ local_ESI_258 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = local_ESI_258; if (local_ESI_258 != (local_ESI_258 / 3) * 3) { local_ESI_258 = RNG::Next(rng); lootSubtype = 2; LAB_006c1fef: temp_3f540a64be = 0x14; goto LAB_006c1ff1; } } else { local_ESI_258 = rng->_seed; if (local_ESI_258 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_ESI_258 = rng->_seed; if (local_ESI_258 == 0) { pcVar1 = (code *)swi(3); dequeMap = (void *)(*pcVar1)(); return dequeMap; } } local_ESI_258 = local_ESI_258 >> ((byte)rng->_shift1 & 0x1f) ^ local_ESI_258; local_ESI_258 = local_ESI_258 ^ local_ESI_258 << ((byte)rng->_shift2 & 0x1f); local_ESI_258 = local_ESI_258 ^ local_ESI_258 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = local_ESI_258; if (local_ESI_258 % 100 == 0) { local_38 = CONCAT31((int3)((uint)g_game >> 8),isShouldAdvance) ^ 1; bVar2 = ItemPool::RemoveCollectible(&g_game->_itemPool,0x40,1,(byte)local_38); if (bVar2 == 0) { bVar2 = (byte)local_38; goto LAB_006c1cb2; } local_ESI_258 = RNG::Next(rng); lootSubtype = 0x40; temp_3f540a64be = 100; } else { bVar2 = isShouldAdvance ^ 1; LAB_006c1cb2: local_38 = CONCAT31(local_38._1_3_,bVar2); local_ESI_258 = RNG::RandomInt(rng,100); bVar2 = (byte)local_38; if ((local_ESI_258 == 0) && (isRemoved = ItemPool::RemoveCollectible(&g_game->_itemPool,0x1ad,1,bVar2), isRemoved != 0) ) { local_ESI_258 = RNG::Next(rng); lootSubtype = 0x1ad; temp_3f540a64be = 100; } else { local_ESI_258 = RNG::RandomInt(rng,100); if ((local_ESI_258 != 0) || ((((g_manager->_persistentGameData)._achievements[0x16c] == 0 && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) || (bVar2 = ItemPool::RemoveCollectible(&g_game->_itemPool,0x209,1,bVar2), bVar2 == 0)))) { local_ESI_258 = RNG::RandomInt(rng,3); if (local_ESI_258 != 1) { if (local_ESI_258 == 2) { local_ESI_258 = RNG::Next(rng); std::deque::push_back(5,0x14,0,local_ESI_258,0); local_ESI_258 = RNG::Next(rng); lootSubtype = 0; goto LAB_006c1fef; } goto LAB_006c1ffb; } lootRng = &this->_dropRNG; dropRng = lootRng; local_ESI_258 = RNG::Next(rng); std::deque::push_back(0x55,0,0,local_ESI_258,dropRng); local_ESI_258 = RNG::Next(rng); lootSubtype = 0; temp_3f540a64be = 0; lootType = 0x55; goto LAB_006c1ff3; } local_ESI_258 = RNG::Next(rng); lootSubtype = 0x209; temp_3f540a64be = 100; } } LAB_006c1ff1: lootRng = (RNG *)0x0; lootType = 5; LAB_006c1ff3: std::deque::push_back(lootType,temp_3f540a64be,lootSubtype,local_ESI_258,lootRng); } LAB_006c1ffb: LootList::LootList(&lootList); if (lootCount != 0) { do { lootCount = lootCount + -1; } while (lootCount != 0); lootOffset = 0; lootCount = 0; } dequeMap = lootMap; iVar3 = lootMapSize; if (lootMapSize != 0) { do { block = *(void **)((int)dequeMap + iVar3 * 4 + -4); iVar3 = iVar3 + -1; if (block != (void *)0x0) { operator_delete(block,0x14); dequeMap = lootMap; } } while (iVar3 != 0); } if (dequeMap != (void *)0x0) { local_ESI_258 = lootMapSize * 4; block = dequeMap; if (0xfff < local_ESI_258) { block = *(void **)((int)dequeMap + -4); local_ESI_258 = local_ESI_258 + 0x23; if (0x1f < (uint)((int)dequeMap + (-4 - (int)block))) { LAB_006c2071: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(block,local_ESI_258); } ptr = lootList; LAB_006c2087: lootMapSize = 0; lootMap = (void *)0x0; lootList = (int *)0x0; operator_delete(ptr,8); ExceptionList = local_1c; return outLoot; } //@@ 006c20e0 LootList::LootList /* DB: ? zeroes 5 dwords + list sentinel; shopkeeper/fireplace get_loot */ void LootList::LootList(int param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; int iVar6; void *pvVar7; undefined4 *in_ECX; uint uVar8; uint uVar9; int iVar10; uint uVar11; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00afa935; local_1c = ExceptionList; ExceptionList = &local_1c; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; puVar5 = operator_new(8); *puVar5 = in_ECX; puVar5[1] = 0; *in_ECX = puVar5; uVar11 = *(uint *)(param_1 + 0xc); uVar8 = *(int *)(param_1 + 0x10) + uVar11; local_14 = 1; if (uVar11 != uVar8) { iVar6 = in_ECX[4]; do { puVar5 = *(undefined4 **)(*(int *)(param_1 + 4) + (*(int *)(param_1 + 8) - 1U & uVar11) * 4); uVar9 = in_ECX[2]; if (uVar9 <= iVar6 + 1U) { std::deque::_Growmap(uVar9); iVar6 = in_ECX[4]; uVar9 = in_ECX[2]; } in_ECX[3] = in_ECX[3] & uVar9 - 1; iVar10 = in_ECX[1]; iVar6 = (in_ECX[3] + iVar6 & uVar9 - 1) * 4; if (*(int *)(iVar6 + iVar10) == 0) { pvVar7 = operator_new(0x14); *(void **)(iVar6 + in_ECX[1]) = pvVar7; iVar10 = in_ECX[1]; } puVar1 = *(undefined4 **)(iVar6 + iVar10); uVar11 = uVar11 + 1; uVar2 = puVar5[1]; uVar3 = puVar5[2]; uVar4 = puVar5[3]; *puVar1 = *puVar5; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; puVar1[4] = puVar5[4]; in_ECX[4] = in_ECX[4] + 1; iVar6 = in_ECX[4]; } while (uVar11 != uVar8); } ExceptionList = local_1c; return; } //@@ 006c2220 NpcAI::ENTITY_SHOPKEEPER /* NPC AI for entity type 17 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_SHOPKEEPER(Entity_NPC *npc) { uint *puVar1; int *piVar2; undefined4 uVar3; Vector targetPos; int **ppiVar4; byte bVar5; char cVar6; byte *curAnimChar; uint uVar7; Vector *pVVar8; Entity *lootEntity; byte *newAnimChar; int iVar9; bool bVar10; float fVar11; undefined4 splatColor [8]; undefined4 local_60; undefined4 uStack_5c; undefined4 local_58; int *loot [3]; uint lootOffset; uint lootCount; Vector freePickupPos; Vector pickupVelocity; Entity_NPC *shopkeeper; int *lootProxy; uint lootIndex; uint doorSlot; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; int currentRoomType; GridEntity_Door *door; qword flags; Game *game; void *room; float spiderTargetY; int targetRoomType; puStack_20 = (undefined1 *)(loot + 0x14); local_14 = 0xffffffff; puStack_18 = &LAB_00afa96d; local_1c = ExceptionList; ExceptionList = &local_1c; shopkeeper = npc; ppiVar4 = loot + 0x14; if (npc->_state != 0) goto LAB_006c241e; flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x11; npc->_entityCollisionClass = 1; npc->_entityGridCollisionClass = 0; npc->_subtype = (uint)npc->_initSeed % 9 + 1; ppiVar4 = loot + 0x14; switch(npc->_variant) { case 0: case 3: puStack_20 = (undefined1 *)(loot + 0x14); sprintf_s(&DAT_00c80dd0,0x40,(byte *)"Shopkeeper %u"); ppiVar4 = (int **)puStack_20; break; case 1: case 4: puStack_20 = (undefined1 *)(loot + 0x14); sprintf_s(&DAT_00c80dd0,0x40,(byte *)"Guy%u"); ppiVar4 = (int **)puStack_20; break; case 2: sprintf_s(&DAT_00c80dd0,0x40,s_Idle); ppiVar4 = (int **)puStack_20; } puStack_20 = (undefined1 *)ppiVar4; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_006c235e: bVar5 = ANM2::SetAnimation(&npc->_sprite,&DAT_00c80dd0,1); if (bVar5 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } newAnimChar = &DAT_00c80dd0; do { bVar5 = *curAnimChar; bVar10 = bVar5 < *newAnimChar; if (bVar5 != *newAnimChar) { LAB_006c2340: uVar7 = -(uint)bVar10 | 1; goto LAB_006c2345; } if (bVar5 == 0) break; bVar5 = curAnimChar[1]; bVar10 = bVar5 < newAnimChar[1]; if (bVar5 != newAnimChar[1]) goto LAB_006c2340; curAnimChar = curAnimChar + 2; newAnimChar = newAnimChar + 2; } while (bVar5 != 0); uVar7 = 0; LAB_006c2345: if ((uVar7 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_006c235e; } local_60 = 0x3e4ccccd; uStack_5c = 0x3e4ccccd; local_58 = 0x3e4ccccd; if (&npc->_splatColor != (ColorMod *)splatColor) { (npc->_splatColor)._offset[0] = 0.2; (npc->_splatColor)._offset[1] = 0.2; (npc->_splatColor)._tint[0] = 0.2; (npc->_splatColor)._tint[1] = 0.2; (npc->_splatColor)._tint[2] = 0.2; (npc->_splatColor)._tint[3] = 1.0; (npc->_splatColor)._offset[2] = 0.2; (npc->_splatColor)._colorize[0] = 0.0; (npc->_splatColor)._colorize[1] = 0.0; (npc->_splatColor)._colorize[2] = 0.0; (npc->_splatColor)._colorize[3] = 0.0; } iVar9 = npc->_variant; if ((((iVar9 == 0) || (iVar9 == 3)) || (iVar9 == 2)) && (*(int *)((int)g_game->_room + 8) == 0x10) ) { (npc->_sprite)._offset.x = 0.0; (npc->_sprite)._offset.y = 8.0; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; npc->_state = 3; Entity_NPC::UpdatePickupGhosts(npc); ppiVar4 = (int **)puStack_20; LAB_006c241e: puStack_20 = (undefined1 *)ppiVar4; bVar5 = npc->_dead; fVar11 = npc->_friction; (npc->_pos).x = (npc->_targetPosition).x; (npc->_pos).y = (npc->_targetPosition).y; npc->_friction = fVar11 * 0.8; if (bVar5 != 0) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc,1); game = g_game; uVar3 = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x80000000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar3; piVar2 = &game->_levelStateFlags; *piVar2 = *piVar2 | 0x40; Entity_NPC::shopkeeper_get_loot(npc,loot,1); local_14 = 0; lootIndex = lootOffset; lootProxy = loot[0]; while (uVar7 = lootIndex, lootIndex != lootCount + lootOffset) { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (**(int **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & lootIndex) * 4) == 0x55) { if (lootIndex == lootOffset) { pVVar8 = Room::FindFreePickupSpawnPosition (g_game->_room,&freePickupPos,&npc->_pos,70.0,0,0,0); fVar11 = pVVar8->x; spiderTargetY = pVVar8->y; } else { fVar11 = g_vectorZero.x; spiderTargetY = g_vectorZero.y; } targetPos.y = spiderTargetY; targetPos.x = fVar11; Entity_NPC::ThrowSpider(&npc->_pos,(Entity *)npc,targetPos,0,-30.0); lootIndex = uVar7 + 1; } else { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } lootEntity = EntitySpawner::Spawn (*(void **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & lootIndex) * 4),&npc->_pos, &g_vectorZero,(Entity *)0x0); if (lootEntity->_type == 0x32) { room = g_game->_room; cVar6 = (**(code **)(*(int *)lootEntity + 0x48))(); if ((cVar6 != '\0') && (lootEntity->_type != 0x362)) { piVar2 = (int *)((int)room + 0x12c0); *piVar2 = *piVar2 + 1; cVar6 = (**(code **)(*(int *)lootEntity + 0x4c))(); if (cVar6 != '\0') { piVar2 = (int *)((int)room + 0x12c8); *piVar2 = *piVar2 + 1; } } (**(code **)(*(int *)lootEntity + 0xc))(); FUN_007ebc40(); iVar9 = 0x724; *(undefined1 *)((int)g_game->_room + 0x7228) = 1; doorSlot = 0; do { doorSlot = doorSlot + 1; if (((doorSlot < 9) && (door = *(GridEntity_Door **)(iVar9 + (int)g_game->_room), door != (GridEntity_Door *)0x0)) && ((door->_desc)._state != 1)) { (door->_desc)._state = 1; GridEntity_Door::UpdateAnimation(door); currentRoomType = door->_currentRoomType; if (((((currentRoomType == 7) || (targetRoomType = door->_targetRoomType, targetRoomType == 7)) || (currentRoomType == 8)) || ((targetRoomType == 8 || (currentRoomType == 0x1d)))) || (targetRoomType == 0x1d)) { std::string::assign((door->_openAnimation)._buf,s_Open,4); } } iVar9 = iVar9 + 4; } while (iVar9 < 0x744); puVar1 = (uint *)(*(int *)((int)g_game->_room + 4) + 0x44); *puVar1 = *puVar1 & 0xfffffffe; lootIndex = lootIndex + 1; npc = shopkeeper; } else { if ((1 < lootCount) && (lootEntity->_type == 5)) { Isaac::GetRandomPickupVelocity(&pickupVelocity,&npc->_pos,0,(RNG *)0x0); (lootEntity->_velocity).x = pickupVelocity.x; (lootEntity->_velocity).y = pickupVelocity.y; } (**(code **)(*(int *)lootEntity + 0xc))(); lootIndex = lootIndex + 1; } } } if (lootCount != 0) { *(undefined1 *)((int)g_game->_room + 0x7894) = 1; } Entity_NPC::UpdatePickupGhosts(npc); std::deque::clear(); piVar2 = loot[0]; loot[0] = (int *)0x0; operator_delete(piVar2,8); } ExceptionList = local_1c; return; } //@@ 006c2750 Entity_NPC::ThrowSpider /* ZHL [lua] Lua binding EntityNPC:ThrowSpider prototype: db/protos.zhl, confirmed by RET 0 */ Entity_NPC * __cdecl Entity_NPC::ThrowSpider(Vector *position,Entity *spawner,Vector targetPos,byte isBig,float yOffset) { float fVar1; void *pvVar2; Game *pGVar3; Vector *pVVar4; uint uVar5; Entity_NPC *pEVar6; uint type; Entity *pEVar7; int iVar8; Game *pGVar9; int iVar10; float fVar11; float fVar12; Vector local_10; if ((targetPos.x == g_vectorZero.x) && (targetPos.y == g_vectorZero.y)) { pVVar4 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,position,100.0,0,0,0); targetPos.x = pVVar4->x; targetPos.y = pVVar4->y; } pGVar3 = g_game; if (g_game->_challenge == 0x2c) { uVar5 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); } else { pGVar9 = g_game; fVar11 = targetPos.x; if (g_game->_currentDimensionIdx == 2) goto LAB_006c2838; uVar5 = g_game->_stageType; } pGVar9 = g_game; fVar11 = targetPos.x; uVar5 = RoomConfig::GetStageID(pGVar3->_stage,uVar5,-1); if (((uVar5 == 0x1b) || (uVar5 == 0x1c)) && (0.1 < *(float *)((int)pGVar9->_room + 0x7240))) { pEVar6 = ThrowStrider(position,spawner,&targetPos); return pEVar6; } LAB_006c2838: pvVar2 = pGVar9->_room; iVar10 = (int)((fVar11 - 40.0) / 40.0 + 0.5); iVar8 = (int)((targetPos.y - 120.0) / 40.0 + 0.5); if ((((-1 < iVar10) && (iVar10 < *(int *)((int)pvVar2 + 0xc))) && ((-1 < iVar8 && ((iVar8 < *(int *)((int)pvVar2 + 0x10) && (uVar5 = *(int *)((int)pvVar2 + 0xc) * iVar8 + iVar10, uVar5 < 0x1c0)))))) && (*(int *)((int)pvVar2 + uVar5 * 4 + 0x76c) < 0x3b7)) { *(undefined4 *)((int)pvVar2 + uVar5 * 4 + 0x76c) = 900; } uVar5 = Random(); type = 0x55; if (isBig != 0) { type = 0x5e; } pEVar7 = Game::SpawnEx(g_game,type,0,position,&g_vectorZero,spawner,0,uVar5,0); pEVar6 = (Entity_NPC *) __RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); pEVar6->_state = 6; (pEVar6->_targetPosition).x = targetPos.x; (pEVar6->_targetPosition).y = targetPos.y; fVar11 = (pEVar6->_targetPosition).x; fVar12 = (pEVar6->_pos).x; fVar1 = (pEVar6->_pos).y; (pEVar6->_v2).y = -8.0; fVar12 = (fVar11 - fVar12) * 0.04; pEVar6->_entityCollisionClass = 0; fVar11 = (targetPos.y - fVar1) * 0.04; (pEVar6->_velocity).x = fVar12; (pEVar6->_v1).x = fVar12; (pEVar6->_velocity).y = fVar11; (pEVar6->_v1).y = fVar11; (pEVar6->_posOffset).y = yOffset; return pEVar6; } //@@ 006c2990 Entity_NPC_UpdateAI_dispatch /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* prototype: db/protos.zhl */ void Entity_NPC_UpdateAI_dispatch(Entity_NPC *npc) { float fVar1; float *pfVar2; char isSkippedByLua; uint uVar3; EntityPtr EVar4; Vector *pVVar5; EntityRef *sourceRef; uint subtypeRoll; Entity_NPC *extraout_ECX; Entity_NPC *extraout_ECX_00; Entity_NPC *extraout_ECX_01; Entity_NPC *extraout_ECX_02; Entity_NPC *extraout_ECX_03; Entity_NPC *extraout_ECX_04; Entity_NPC *extraout_ECX_05; Entity_NPC *extraout_ECX_06; Entity_NPC *npc_00; Entity_NPC *extraout_ECX_07; Entity_NPC *extraout_ECX_08; Entity_NPC *extraout_ECX_09; Entity_NPC *extraout_ECX_10; Entity_NPC *extraout_ECX_11; Entity_NPC *extraout_ECX_12; Entity_NPC *extraout_ECX_13; Entity_NPC *extraout_ECX_14; Entity_NPC *extraout_ECX_15; Entity_NPC *extraout_ECX_16; Entity_NPC *extraout_ECX_17; Entity_NPC *extraout_ECX_18; Entity_NPC *extraout_ECX_19; Entity_NPC *extraout_ECX_20; Entity_NPC *extraout_ECX_21; Entity_NPC *extraout_ECX_22; Entity_NPC *extraout_ECX_23; Entity_NPC *extraout_ECX_24; Entity_NPC *extraout_ECX_25; Entity_NPC *extraout_ECX_26; Entity_NPC *extraout_ECX_27; Entity_NPC *extraout_ECX_28; Entity_NPC *extraout_ECX_29; Entity_NPC *extraout_ECX_30; Entity_NPC *extraout_ECX_31; Entity_NPC *extraout_ECX_32; Entity_NPC *extraout_ECX_33; Entity_NPC *extraout_ECX_34; Entity_NPC *extraout_ECX_35; Entity_NPC *extraout_ECX_36; Entity_NPC *extraout_ECX_37; Entity_NPC *extraout_ECX_38; Entity_NPC *extraout_ECX_39; Entity_NPC *extraout_ECX_40; Entity_NPC *extraout_ECX_41; Entity_NPC *extraout_ECX_42; Entity_NPC *extraout_ECX_43; Entity_NPC *extraout_ECX_44; Entity_NPC *extraout_ECX_45; Entity_NPC *extraout_ECX_46; Entity_NPC *extraout_ECX_47; Entity_NPC *extraout_ECX_48; Entity_NPC *extraout_ECX_49; Entity_NPC *extraout_ECX_50; Entity_NPC *extraout_ECX_51; Entity_NPC *extraout_ECX_52; Entity_NPC *extraout_ECX_53; Entity_NPC *extraout_ECX_54; Entity_NPC *extraout_ECX_55; Entity_NPC *extraout_ECX_56; Entity_NPC *extraout_ECX_57; Entity_NPC *extraout_ECX_58; Entity_NPC *extraout_ECX_59; Entity_NPC *extraout_ECX_60; Entity_NPC *extraout_ECX_61; Entity_NPC *extraout_ECX_62; Entity_NPC *extraout_ECX_63; Entity_NPC *extraout_ECX_64; Entity_NPC *extraout_ECX_65; Entity_NPC *extraout_ECX_66; Entity_NPC *extraout_ECX_67; Entity_NPC *extraout_ECX_68; Entity_NPC *extraout_ECX_69; Entity_NPC *extraout_ECX_70; Entity_NPC *extraout_ECX_71; Entity_NPC *extraout_ECX_72; Entity_NPC *extraout_ECX_73; Entity_NPC *extraout_ECX_74; Entity_NPC *extraout_ECX_75; Entity_NPC *extraout_ECX_76; Entity_NPC *extraout_ECX_77; Entity_NPC *extraout_ECX_78; Entity_NPC *extraout_ECX_79; Entity_NPC *extraout_ECX_80; Entity_NPC *extraout_ECX_81; Entity_NPC *extraout_ECX_82; Entity_NPC *extraout_ECX_83; Entity_NPC *extraout_ECX_84; Entity_NPC *extraout_ECX_85; Entity_NPC *extraout_ECX_86; Entity_NPC *extraout_ECX_87; Entity_NPC *extraout_ECX_88; Entity_NPC *extraout_ECX_89; Entity_NPC *extraout_ECX_90; Entity_NPC *extraout_ECX_91; Entity_NPC *extraout_ECX_92; Entity_NPC *extraout_ECX_93; Entity_NPC *extraout_ECX_94; Entity_NPC *extraout_ECX_95; Entity_NPC *extraout_ECX_96; Entity_NPC *extraout_ECX_97; Entity_NPC *extraout_ECX_98; Entity_NPC *extraout_ECX_99; Entity_NPC *extraout_ECX_x00100; Entity_NPC *extraout_ECX_x00101; Entity_NPC *extraout_ECX_x00102; Entity_NPC *extraout_ECX_x00103; Entity_NPC *extraout_ECX_x00104; Entity_NPC *extraout_ECX_x00105; Entity_NPC *extraout_ECX_x00106; Entity_NPC *extraout_ECX_x00107; Entity_NPC *extraout_ECX_x00108; Entity_NPC *extraout_ECX_x00109; Entity_NPC *extraout_ECX_x00110; Entity_NPC *extraout_ECX_x00111; Entity_NPC *extraout_ECX_x00112; Entity_NPC *extraout_ECX_x00113; Entity_NPC *extraout_ECX_x00114; Entity_NPC *extraout_ECX_x00115; Entity_NPC *extraout_ECX_x00116; Entity_NPC *extraout_ECX_x00117; Entity_NPC *extraout_ECX_x00118; Entity_NPC *extraout_ECX_x00119; Entity_NPC *extraout_ECX_x00120; Entity_NPC *extraout_ECX_x00121; Entity_NPC *extraout_ECX_x00122; Entity_NPC *extraout_ECX_x00123; Entity_NPC *extraout_ECX_x00124; Entity_NPC *extraout_ECX_x00125; Entity_NPC *extraout_ECX_x00126; Entity_NPC *extraout_ECX_x00127; Entity_NPC *extraout_ECX_x00128; Entity_NPC *extraout_ECX_x00129; Entity_NPC *extraout_ECX_x00130; Entity_NPC *extraout_ECX_x00131; Entity_NPC *extraout_ECX_x00132; Entity_NPC *extraout_ECX_x00133; Entity_NPC *extraout_ECX_x00134; Entity_NPC *extraout_ECX_x00135; Entity_NPC *extraout_ECX_x00136; Entity_NPC *extraout_ECX_x00137; Entity_NPC *extraout_ECX_x00138; Entity_NPC *extraout_ECX_x00139; Entity_NPC *extraout_ECX_x00140; Entity_NPC *extraout_ECX_x00141; Entity_NPC *extraout_ECX_x00142; Entity_NPC *extraout_ECX_x00143; Entity_NPC *extraout_ECX_x00144; Entity_NPC *extraout_ECX_x00145; Entity_NPC *extraout_ECX_x00146; Entity_NPC *extraout_ECX_x00147; Entity_NPC *extraout_ECX_x00148; Entity_NPC *extraout_ECX_x00149; Entity_NPC *extraout_ECX_x00150; Entity_NPC *extraout_ECX_x00151; Entity_NPC *extraout_ECX_x00152; Entity_NPC *extraout_ECX_x00153; Entity_NPC *extraout_ECX_x00154; Entity_NPC *extraout_ECX_x00155; Entity_NPC *extraout_ECX_x00156; Entity_NPC *extraout_ECX_x00157; Entity_NPC *extraout_ECX_x00158; Entity_NPC *extraout_ECX_x00159; Entity_NPC *extraout_ECX_x00160; Entity_NPC *extraout_ECX_x00161; Entity_NPC *extraout_ECX_x00162; Entity_NPC *extraout_ECX_x00163; Entity_NPC *extraout_ECX_x00164; Entity_NPC *extraout_ECX_x00165; Entity_NPC *extraout_ECX_x00166; Entity_NPC *extraout_ECX_x00167; Entity_NPC *extraout_ECX_x00168; Entity_NPC *extraout_ECX_x00169; Entity_NPC *extraout_ECX_x00170; Entity_NPC *extraout_ECX_x00171; Entity_NPC *extraout_ECX_x00172; Entity_NPC *extraout_ECX_x00173; Entity_NPC *extraout_ECX_x00174; Entity_NPC *extraout_ECX_x00175; Entity_NPC *extraout_ECX_x00176; Entity_NPC *extraout_ECX_x00177; Entity_NPC *extraout_ECX_x00178; Entity_NPC *extraout_ECX_x00179; Entity_NPC *extraout_ECX_x00180; Entity_NPC *extraout_ECX_x00181; Entity_NPC *extraout_ECX_x00182; Entity_NPC *extraout_ECX_x00183; Entity_NPC *extraout_ECX_x00184; Entity_NPC *extraout_ECX_x00185; Entity_NPC *extraout_ECX_x00186; Entity_NPC *extraout_ECX_x00187; Entity_NPC *extraout_ECX_x00188; Entity_NPC *extraout_ECX_x00189; Entity_NPC *extraout_ECX_x00190; Entity_NPC *extraout_ECX_x00191; Entity_NPC *extraout_ECX_x00192; Entity_NPC *extraout_ECX_x00193; Entity_NPC *extraout_ECX_x00194; Entity_NPC *extraout_ECX_x00195; Entity_NPC *extraout_ECX_x00196; Entity_NPC *extraout_ECX_x00197; Entity_NPC *extraout_ECX_x00198; Entity_NPC *extraout_ECX_x00199; Entity_NPC *extraout_ECX_x00200; Entity_NPC *extraout_ECX_x00201; Entity_NPC *extraout_ECX_x00202; Entity_NPC *extraout_ECX_x00203; Entity_NPC *extraout_ECX_x00204; Entity_NPC *extraout_ECX_x00205; Entity_NPC *extraout_ECX_x00206; Entity_NPC *extraout_ECX_x00207; Entity_NPC *extraout_ECX_x00208; Entity_NPC *extraout_ECX_x00209; Entity_NPC *extraout_ECX_x00210; Entity_NPC *extraout_ECX_x00211; Entity_NPC *extraout_ECX_x00212; Entity_NPC *extraout_ECX_x00213; Entity_NPC *extraout_ECX_x00214; Entity_NPC *extraout_ECX_x00215; Entity_NPC *extraout_ECX_x00216; Entity_NPC *extraout_ECX_x00217; Entity_NPC *extraout_ECX_x00218; Entity_NPC *extraout_ECX_x00219; Entity_NPC *extraout_ECX_x00220; Entity_NPC *extraout_ECX_x00221; Entity_NPC *extraout_ECX_x00222; Entity_NPC *extraout_ECX_x00223; Entity_NPC *extraout_ECX_x00224; Entity_NPC *extraout_ECX_x00225; Entity_NPC *extraout_ECX_x00226; Entity_NPC *extraout_ECX_x00227; Entity_NPC *extraout_ECX_x00228; Entity_NPC *extraout_ECX_x00229; Entity_NPC *extraout_ECX_x00230; Entity_NPC *extraout_ECX_x00231; Entity_NPC *extraout_ECX_x00232; Entity_NPC *extraout_ECX_x00233; Entity_NPC *extraout_ECX_x00234; Entity_NPC *extraout_ECX_x00235; Entity_NPC *extraout_ECX_x00236; Entity_NPC *extraout_ECX_x00237; Entity_NPC *extraout_ECX_x00238; Entity_NPC *extraout_ECX_x00239; Entity_NPC *extraout_ECX_x00240; Entity_NPC *extraout_ECX_x00241; Entity_NPC *extraout_ECX_x00242; Entity_NPC *extraout_ECX_x00243; Entity_NPC *extraout_ECX_x00244; Entity_NPC *extraout_ECX_x00245; Entity_NPC *extraout_ECX_x00246; Entity_NPC *extraout_ECX_x00247; Entity_NPC *extraout_ECX_x00248; Entity_NPC *extraout_ECX_x00249; Entity_NPC *extraout_ECX_x00250; Entity_NPC *extraout_ECX_x00251; Entity_NPC *extraout_ECX_x00252; Entity_NPC *extraout_ECX_x00253; Entity_NPC *extraout_ECX_x00254; Entity_NPC *extraout_ECX_x00255; Entity_NPC *extraout_ECX_x00256; Entity_NPC *extraout_ECX_x00257; Entity_NPC *extraout_ECX_x00258; Entity_NPC *extraout_ECX_x00259; Entity_NPC *extraout_ECX_x00260; Entity_NPC *extraout_ECX_x00261; Entity_NPC *extraout_ECX_x00262; Entity_NPC *extraout_ECX_x00263; Entity_NPC *extraout_ECX_x00264; Entity_NPC *extraout_ECX_x00265; Entity_NPC *extraout_ECX_x00266; Entity_NPC *extraout_ECX_x00267; Entity_NPC *extraout_ECX_x00268; Entity_NPC *extraout_ECX_x00269; Entity_NPC *extraout_ECX_x00270; Entity_NPC *extraout_ECX_x00271; Entity_NPC *extraout_ECX_x00272; Entity_NPC *extraout_ECX_x00273; Entity_NPC *extraout_ECX_x00274; Entity_NPC *extraout_ECX_x00275; EntityPtr heartParentSlot; float fVar6; float fVar7; int iVar8; byte bVar9; byte bVar10; EntityRef emptyRef; EntityList_EL heartList; Vector leftHeartPos; Vector heartSpawnPos; Vector local_f4; Vector local_ec; EntityPtr local_e4; Vector local_e0; EntityPtr local_d8; char isCharmed; ProjectileParams projParams; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; uint *flagsHigh; Manager *manager; EntityPtr *parentSlot; undefined4 savedFlagsHigh; puStack_20 = (undefined1 *)((&projParams)[1].Color._tint + 2); local_14 = -NAN; puStack_18 = &LAB_00afa9a0; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)&(&projParams)[1].Spread; ExceptionList = &local_1c; npc_00 = npc; local_24 = uVar3; pfVar2 = (&projParams)[1].Color._tint + 2; if (npc->_aiCallPhase == 0) { isSkippedByLua = FUN_00860960(npc); npc_00 = extraout_ECX; pfVar2 = (float *)puStack_20; if (isSkippedByLua != '\0') { ExceptionList = local_1c; return; } } puStack_20 = (undefined1 *)pfVar2; fVar1 = g_colorGreenSplat._tint[3]; fVar7 = g_colorGreenSplat._tint[2]; fVar6 = g_colorGreenSplat._tint[1]; if (npc->_type - 10U < 0x3be) { /* WARNING (jumptable): Sanity check requires truncation of jumptable */ /* WARNING: Could not find normalized switch variable to match jumptable */ switch(*(undefined1 *)((int)&PTR_caseD_ef_006c4598 + npc->_type + 2)) { case 0: NpcAI::ENTITY_GAPER(npc); npc_00 = extraout_ECX_x00154; break; case 1: NpcAI::ENTITY_GUSHER(npc); npc_00 = extraout_ECX_90; break; case 2: NpcAI::ENTITY_HORF(npc); npc_00 = extraout_ECX_00; break; case 3: NpcAI::ENTITY_FLY(npc); npc_00 = extraout_ECX_x00171; break; case 4: NpcAI::ENTITY_CLOTTY(npc); npc_00 = extraout_ECX_x00160; break; case 5: NpcAI::ENTITY_MULLIGAN(npc); npc_00 = extraout_ECX_01; break; case 6: NpcAI::ENTITY_SHOPKEEPER(npc); npc_00 = extraout_ECX_65; break; case 7: NpcAI::ENTITY_LARRYJR(npc); npc_00 = extraout_ECX_02; break; case 8: NpcAI::ENTITY_MONSTRO(npc); npc_00 = extraout_ECX_03; break; case 9: NpcAI::ENTITY_MAGGOT(npc); npc_00 = extraout_ECX_16; break; case 10: NpcAI::ENTITY_HIVE(npc); npc_00 = extraout_ECX_x00153; break; case 0xb: NpcAI::ENTITY_GLOBIN(npc); npc_00 = extraout_ECX_92; break; case 0xc: NpcAI::ENTITY_BOOMFLY(npc); npc_00 = extraout_ECX_25; break; case 0xd: NpcAI::ENTITY_MAW(npc); npc_00 = extraout_ECX_26; break; case 0xe: NpcAI::ENTITY_HOST(npc); npc_00 = extraout_ECX_x00213; break; case 0xf: NpcAI::ENTITY_CHUB(npc); npc_00 = extraout_ECX_29; break; case 0x10: NpcAI::ENTITY_HOPPER(npc); npc_00 = extraout_ECX_x00189; break; case 0x11: NpcAI::ENTITY_BOIL(npc); npc_00 = extraout_ECX_27; break; case 0x12: NpcAI::ENTITY_BRAIN(npc); npc_00 = extraout_ECX_x00118; break; case 0x13: NpcAI::ENTITY_FIREPLACE(npc); npc_00 = extraout_ECX_87; break; case 0x14: NpcAI::ENTITY_MRMAW(npc); npc_00 = extraout_ECX_28; break; case 0x15: NpcAI::ENTITY_GURDY(npc); npc_00 = extraout_ECX_50; break; case 0x16: NpcAI::ENTITY_BABY(npc); npc_00 = extraout_ECX_17; break; case 0x17: NpcAI::ENTITY_VIS(npc); npc_00 = extraout_ECX_x00193; break; case 0x18: NpcAI::ENTITY_GUTS(npc); npc_00 = extraout_ECX_x00206; break; case 0x19: NpcAI::ENTITY_KNIGHT(npc); npc_00 = extraout_ECX_91; break; case 0x1a: NpcAI::ENTITY_STONEHEAD(npc); npc_00 = extraout_ECX_42; break; case 0x1b: NpcAI::ENTITY_POKY(npc); npc_00 = extraout_ECX_44; break; case 0x1c: NpcAI::ENTITY_MOM(npc); npc_00 = extraout_ECX_60; break; case 0x1d: NpcAI::ENTITY_SLOTH(npc); npc_00 = extraout_ECX_10; break; case 0x1e: NpcAI::ENTITY_LUST(npc); npc_00 = extraout_ECX_11; break; case 0x1f: NpcAI::ENTITY_WRATH(npc); npc_00 = extraout_ECX_12; break; case 0x20: NpcAI::ENTITY_GREED(npc); npc_00 = extraout_ECX_13; break; case 0x21: NpcAI::ENTITY_ENVY(npc); npc_00 = extraout_ECX_14; break; case 0x22: NpcAI::ENTITY_PRIDE(npc); npc_00 = extraout_ECX_15; break; case 0x23: NpcAI::ENTITY_DOPLE(npc); npc_00 = extraout_ECX_63; break; case 0x24: NpcAI::ENTITY_LUMP(npc); npc_00 = extraout_ECX_45; break; case 0x25: NpcAI::ENTITY_MEMBRAIN(npc); npc_00 = extraout_ECX_33; break; case 0x26: NpcAI::ENTITY_PARA_BITE(npc); npc_00 = extraout_ECX_58; break; case 0x27: NpcAI::ENTITY_FRED(npc); npc_00 = extraout_ECX_59; break; case 0x28: NpcAI::ENTITY_EYE(npc); npc_00 = extraout_ECX_57; break; case 0x29: NpcAI::ENTITY_PIN(npc); npc_00 = extraout_ECX_24; break; case 0x2a: NpcAI::ENTITY_FAMINE(npc); npc_00 = extraout_ECX_18; break; case 0x2b: NpcAI::ENTITY_PESTILENCE(npc); npc_00 = extraout_ECX_19; break; case 0x2c: NpcAI::ENTITY_WAR(npc); npc_00 = extraout_ECX_20; break; case 0x2d: NpcAI::ENTITY_DEATH(npc); npc_00 = extraout_ECX_21; break; case 0x2e: NpcAI::ENTITY_DUKE(npc); npc_00 = extraout_ECX_04; break; case 0x2f: NpcAI::ENTITY_PEEP(npc); npc_00 = extraout_ECX_61; break; case 0x30: NpcAI::ENTITY_LOKI(npc); npc_00 = extraout_ECX_48; break; case 0x31: NpcAI::ENTITY_FISTULA_BIG(npc); npc_00 = extraout_ECX_47; break; case 0x32: NpcAI::ENTITY_BLASTOCYST_BIG(npc); npc_00 = extraout_ECX_07; break; case 0x33: NpcAI::ENTITY_EMBRYO(npc); npc_00 = extraout_ECX_08; break; case 0x34: NpcAI::ENTITY_MOMS_HEART(npc); npc_00 = extraout_ECX_49; break; case 0x35: fVar6 = npc->_friction * 0.8; uVar3 = npc->_variant; npc->_friction = fVar6; if ((uVar3 < 10) && (npc->_subtype != 0)) { npc->_friction = fVar6 * 0.92; } if ((npc->_dead != 0) && ((uVar3 == 0xb || (uVar3 == 1)))) { ProjectileParams::ProjectileParams(&projParams); manager = g_manager; projParams.Variant = 0xc; if (npc->_variant == 1) { local_d8 = (EntityPtr)0x3c1; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); projParams.FallingAccelModifier = -0.08; projParams.Scale = 2.0; projParams.BulletFlags._0_4_ = 0x2000; projParams.BulletFlags._4_4_ = 0; local_f4.x = 8.0; local_f4.y = 0.0; Entity_NPC::FireProjectiles(npc,&npc->_pos,&local_f4,8,&projParams); local_ec.x = 4.0; pVVar5 = &local_ec; local_ec.y = 0.0; } else { local_d8 = (EntityPtr)0x3c2; seed_fart_sound_override((int *)&local_d8); SoundEffects::Play(&manager->_sfxManager,(int)local_d8,1.0,2,0,1.0,0.0); projParams.FallingAccelModifier = -0.06; pVVar5 = &local_e0; local_e0.x = 10.0; local_e0.y = 0.0; } Entity_NPC::FireProjectiles(npc,&npc->_pos,pVVar5,8,&projParams); } if ((uint)npc->_variant < 10) { NpcAI::ENTITY_GEMINI(npc); npc_00 = extraout_ECX_05; } else if ((uint)npc->_variant < 0x14) { NpcAI::ENTITY_GEMINI_baby(npc); npc_00 = extraout_ECX_06; } else { npc_00 = (Entity_NPC *)((uint)npc->_flags & 0xfffffffb | 0x40000); *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(Entity_NPC **)&npc->_flags = npc_00; } break; case 0x36: NpcAI::ENTITY_FALLEN(npc); npc_00 = extraout_ECX_23; break; case 0x37: NpcAI::ENTITY_HEADLESS_HORSEMAN(npc); npc_00 = extraout_ECX_22; break; case 0x38: NpcAI::ENTITY_SATAN(npc); npc_00 = extraout_ECX_62; break; case 0x39: NpcAI::ENTITY_SPIDER(npc); npc_00 = extraout_ECX_x00134; break; case 0x3a: NpcAI::ENTITY_GURGLE(npc); npc_00 = extraout_ECX_31; break; case 0x3b: NpcAI::ENTITY_WALKINGBOIL(npc); npc_00 = extraout_ECX_32; break; case 0x3c: NpcAI::ENTITY_HANGER(npc); npc_00 = extraout_ECX_34; break; case 0x3d: NpcAI::ENTITY_SWARMER(npc); npc_00 = extraout_ECX_30; break; case 0x3f: if (npc->_state == 0) { if (npc->_parent == (EntityPtr)0x0) { isCharmed = (npc->_flags & 0x20000000) != 0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&heartList,0x5c,npc->_variant,-1,0, 0); local_14 = 0.0; local_d8 = (EntityPtr)0x0; local_e4 = (EntityPtr)0xc9742400; local_e0.y = 0.0; local_ec.y = (float)heartList._data; npc_00 = extraout_ECX_36; if ((EntityPtr)heartList._size != (EntityPtr)0x0) { do { EVar4 = (EntityPtr) __RTDynamicCast(*(undefined4 *)((int)local_ec.y + (int)local_e0.y * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (((EVar4 != (EntityPtr)0x0) && (*(EntityPtr *)((int)EVar4 + 0x3c0) == (EntityPtr)0x0)) && (((*(uint *)((int)EVar4 + 0x168) & 0x20000000) != 0) == (bool)isCharmed)) { fVar6 = (npc->_pos).y - *(float *)((int)EVar4 + 0x340); fVar7 = (npc->_pos).x - ((Vector *)((int)EVar4 + 0x33c))->x; fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); if (local_d8 != (EntityPtr)0x0) { if (1000.0 - fVar6 <= (float)local_e4) goto LAB_006c2ef7; } local_e4 = (EntityPtr)(1000.0 - fVar6); local_d8 = EVar4; } LAB_006c2ef7: local_e0.y = (float)((int)local_e0.y + 1); } while ((uint)local_e0.y < (uint)heartList._size); npc_00 = (Entity_NPC *)0x0; if (local_d8 != (EntityPtr)0x0) { EVar4 = (EntityPtr)((int)local_d8 + 0x3c0); if (*(EntityPtr *)EVar4 != (EntityPtr)0x0) { local_e0.y = (float)EVar4; std::multiset::erase(&local_e0.y); } *(Entity_NPC **)EVar4 = npc; std::multiset::insert(EVar4); parentSlot = &npc->_parent; if (npc->_parent != (EntityPtr)0x0) { local_e0.y = (float)parentSlot; std::multiset::erase(&local_e0.y); } *parentSlot = local_d8; std::multiset::insert(parentSlot); local_e4 = *(EntityPtr *)((int)local_d8 + 0x3bc); npc_00 = (Entity_NPC *)0x0; if (local_e4 != (EntityPtr)0x0) { local_e0.y = (float)&npc->_entityRef; if (npc->_entityRef != (EntityPtr)0x0) { std::multiset::erase(&local_e0.y); } local_e0.y = (float)&npc->_entityRef; *(EntityPtr *)local_e0.y = local_e4; std::multiset::insert(local_e0.y); npc_00 = extraout_ECX_37; } } } if (npc->_parent == (EntityPtr)0x0) { Room::FindFreePickupSpawnPosition(g_game->_room,&local_f4,&npc->_pos,40.0,0,0,0); if (npc->_variant == 1) { uVar3 = Random(); leftHeartPos.x = local_f4.x - 15.0; leftHeartPos.y = local_f4.y - 0.0; EVar4 = (EntityPtr) Game::Spawn(g_game,0x5c,npc->_variant,&leftHeartPos,&g_vectorZero, (Entity *)npc,0,uVar3); local_d8 = EVar4; if (isCharmed != '\0') { bVar10 = 0; bVar9 = 0; iVar8 = -1; sourceRef = EntityRef::EntityRef(&emptyRef); Entity::AddCharmed((Entity *)EVar4,sourceRef,iVar8,bVar9,bVar10); } if (*(EntityPtr *)((int)EVar4 + 0x3c0) != (EntityPtr)0x0) { local_e0.y = (float)((int)EVar4 + 0x3c0); std::multiset::erase(&local_e0.y); } *(EntityPtr *)((int)EVar4 + 0x3c0) = (EntityPtr)npc; std::multiset::insert((EntityPtr *)((int)EVar4 + 0x3c0)); if (npc->_parent != (EntityPtr)0x0) { local_e0.y = (float)&npc->_parent; std::multiset::erase(&local_e0.y); } npc->_parent = EVar4; std::multiset::insert(&npc->_parent); uVar3 = Random(); heartSpawnPos.x = local_f4.x + 15.0; heartSpawnPos.y = local_f4.y + 0.0; EVar4 = (EntityPtr) Game::Spawn(g_game,0x5c,npc->_variant,&heartSpawnPos,&g_vectorZero, (Entity *)npc,1,uVar3); if (isCharmed != '\0') { bVar10 = 0; bVar9 = 0; iVar8 = -1; sourceRef = EntityRef::EntityRef(&emptyRef); Entity::AddCharmed((Entity *)EVar4,sourceRef,iVar8,bVar9,bVar10); } if (*(int *)((int)EVar4 + 0x3c0) != 0) { local_e0.y = (float)((int)EVar4 + 0x3c0); std::multiset::erase(&local_e0.y); } *(EntityPtr *)((int)EVar4 + 0x3c0) = local_d8; std::multiset::insert((EntityPtr *)((int)EVar4 + 0x3c0)); local_e4 = (EntityPtr)((int)local_d8 + 0x3bc); if (*(EntityPtr *)local_e4 != (EntityPtr)0x0) { local_e0.y = (float)local_e4; std::multiset::erase(&local_e0.y); } *(EntityPtr *)local_e4 = EVar4; std::multiset::insert(local_e4); if (npc->_entityRef != (EntityPtr)0x0) { local_e0.y = (float)&npc->_entityRef; std::multiset::erase(&local_e0.y); } npc->_entityRef = EVar4; std::multiset::insert(&npc->_entityRef); local_e4 = (EntityPtr)((int)local_d8 + 0xbec); if (*(EntityPtr *)local_e4 != (EntityPtr)0x0) { local_e0.y = (float)local_e4; std::multiset::erase(&local_e0.y); } *(EntityPtr *)local_e4 = EVar4; std::multiset::insert(local_e4); if (*(int *)((int)EVar4 + 0xbec) != 0) { local_e0.y = (float)((int)EVar4 + 0xbec); std::multiset::erase(&local_e0.y); } *(EntityPtr *)((int)EVar4 + 0xbec) = local_d8; std::multiset::insert((EntityPtr *)((int)EVar4 + 0xbec)); (**(code **)(*(int *)local_d8 + 0xc))(); } else { uVar3 = Random(); pVVar5 = Room::FindFreePickupSpawnPosition (g_game->_room,&heartSpawnPos,&npc->_pos,40.0,0,0,0); EVar4 = (EntityPtr) Game::Spawn(g_game,0x5c,npc->_variant,pVVar5,&g_vectorZero,(Entity *)npc,0, uVar3); local_e0.y = (float)EVar4; if (isCharmed != '\0') { bVar10 = 0; bVar9 = 0; iVar8 = -1; sourceRef = EntityRef::EntityRef(&emptyRef); Entity::AddCharmed((Entity *)EVar4,sourceRef,iVar8,bVar9,bVar10); } heartParentSlot = (EntityPtr)((int)EVar4 + 0x3c0); if (*(int *)((int)EVar4 + 0x3c0) != 0) { local_e4 = heartParentSlot; std::multiset::erase(&local_e4); } *(Entity_NPC **)heartParentSlot = npc; std::multiset::insert(heartParentSlot); parentSlot = &npc->_parent; if (npc->_parent != (EntityPtr)0x0) { local_e4 = (EntityPtr)parentSlot; std::multiset::erase(&local_e4); } EVar4 = (EntityPtr)local_e0.y; *parentSlot = (EntityPtr)local_e0.y; std::multiset::insert(parentSlot); } (**(code **)((int)*(EntityPtr *)EVar4 + 0xc))(); npc_00 = extraout_ECX_38; } local_14 = -NAN; if (heartList._0_1_ == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,(void *)local_ec.y,0); local_14 = -NAN; npc_00 = extraout_ECX_39; } } *(uint *)&npc->_flags = (uint)npc->_flags | 1; flagsHigh = (uint *)((int)&npc->_flags + 4); *flagsHigh = *flagsHigh | 8; npc->_state = 4; npc->_isInvicible = 1; break; } case 0x41: NpcAI::ENTITY_MASK_OF_INFAMY(npc); npc_00 = extraout_ECX_40; break; case 0x40: NpcAI::ENTITY_ETERNALFLY(npc); npc_00 = extraout_ECX_09; break; case 0x42: if (npc->_state == 0) { npc->_state = 4; break; } case 0x3e: NpcAI::ENTITY_HEART(npc); npc_00 = extraout_ECX_41; break; case 0x43: NpcAI::ENTITY_GURDY_JR(npc); npc_00 = extraout_ECX_35; break; case 0x44: NpcAI::ENTITY_WIDOW(npc); npc_00 = extraout_ECX_43; break; case 0x45: NpcAI::ENTITY_DADDYLONGLEGS(npc); npc_00 = extraout_ECX_64; break; case 0x46: NpcAI::ENTITY_ISAAC(npc); npc_00 = extraout_ECX_46; break; case 0x47: NpcAI::ENTITY_STONE_EYE(npc); npc_00 = extraout_ECX_56; break; case 0x48: NpcAI::ENTITY_CONSTANT_STONE_SHOOTER(npc); npc_00 = extraout_ECX_66; break; case 0x49: NpcAI::ENTITY_MOBILE_HOST(npc); npc_00 = extraout_ECX_70; break; case 0x4a: NpcAI::ENTITY_BABY_LONG_LEGS(npc); npc_00 = extraout_ECX_69; break; case 0x4b: NpcAI::ENTITY_FAT_SACK(npc); npc_00 = extraout_ECX_67; break; case 0x4c: NpcAI::ENTITY_DEATHS_HEAD(npc); npc_00 = extraout_ECX_94; break; case 0x4d: NpcAI::ENTITY_MOMS_HAND(npc); npc_00 = extraout_ECX_95; break; case 0x4e: NpcAI::ENTITY_SWINGER(npc); npc_00 = extraout_ECX_71; break; case 0x4f: NpcAI::ENTITY_DIP(npc); npc_00 = extraout_ECX_x00158; break; case 0x50: NpcAI::ENTITY_WIZOOB(npc); npc_00 = extraout_ECX_96; break; case 0x51: NpcAI::ENTITY_SQUIRT(npc); npc_00 = extraout_ECX_x00159; break; case 0x52: NpcAI::ENTITY_COD_WORM(npc); npc_00 = extraout_ECX_68; break; case 0x53: NpcAI::ENTITY_RING_OF_FLIES(npc); npc_00 = extraout_ECX_76; break; case 0x54: NpcAI::ENTITY_OOB(npc); npc_00 = extraout_ECX_74; break; case 0x55: NpcAI::ENTITY_BLACK_MAW(npc); npc_00 = extraout_ECX_75; break; case 0x56: NpcAI::ENTITY_SKINNY(npc); npc_00 = extraout_ECX_97; break; case 0x57: NpcAI::ENTITY_HOMUNCULUS(npc); npc_00 = extraout_ECX_73; break; case 0x58: NpcAI::ENTITY_NERVE_ENDING(npc); npc_00 = extraout_ECX_x00132; break; case 0x59: NpcAI::ENTITY_SKINBALL(npc); npc_00 = extraout_ECX_72; break; case 0x5a: NpcAI::ENTITY_WALL_CREEP(npc); npc_00 = extraout_ECX_x00119; break; case 0x5b: NpcAI::ENTITY_ROUND_WORM(npc); npc_00 = extraout_ECX_93; break; case 0x5c: NpcAI::ENTITY_POOP(npc); npc_00 = extraout_ECX_88; break; case 0x5d: NpcAI::ENTITY_DART_FLY(npc); npc_00 = extraout_ECX_77; break; case 0x5e: NpcAI::ENTITY_FAT_BAT(npc); npc_00 = extraout_ECX_89; break; case 0x5f: NpcAI::ENTITY_THE_HAUNT(npc); npc_00 = extraout_ECX_78; break; case 0x60: NpcAI::ENTITY_DINGLE(npc); npc_00 = extraout_ECX_80; break; case 0x61: NpcAI::ENTITY_MEGA_MAW(npc); npc_00 = extraout_ECX_54; break; case 0x62: NpcAI::ENTITY_GATE(npc); npc_00 = extraout_ECX_55; break; case 99: NpcAI::ENTITY_MEGA_FATTY(npc); npc_00 = extraout_ECX_82; break; case 100: NpcAI::ENTITY_CAGE(npc); npc_00 = extraout_ECX_83; break; case 0x65: NpcAI::ENTITY_MAMA_GURDY(npc); npc_00 = extraout_ECX_84; break; case 0x66: NpcAI::ENTITY_DARK_ONE(npc); npc_00 = extraout_ECX_52; break; case 0x67: NpcAI::ENTITY_ADVERSARY(npc); npc_00 = extraout_ECX_53; break; case 0x68: NpcAI::ENTITY_POLYCEPHALUS(npc); npc_00 = extraout_ECX_98; break; case 0x69: NpcAI::ENTITY_MR_FRED(npc); npc_00 = extraout_ECX_81; break; case 0x6a: NpcAI::ENTITY_URIEL(npc); npc_00 = extraout_ECX_51; break; case 0x6b: NpcAI::ENTITY_THE_LAMB(npc); npc_00 = extraout_ECX_79; break; case 0x6c: if (npc->_variant == 0) { NpcAI::ENTITY_MEGA_SATAN(npc); npc_00 = extraout_ECX_85; if (npc->_dead != 0) { savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags & 0xfffbffff; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; } } else { NpcAI::ENTITY_MEGA_SATAN_hand(npc); npc_00 = extraout_ECX_86; } break; case 0x6d: NpcAI::ENTITY_SWARM(npc); npc_00 = extraout_ECX_99; break; case 0x6e: NpcAI::ENTITY_DUKIE(npc); npc_00 = extraout_ECX_x00100; break; case 0x6f: NpcAI::ENTITY_MEATBALL(npc); npc_00 = extraout_ECX_x00101; break; case 0x70: NpcAI::ENTITY_PITFALL(npc); npc_00 = extraout_ECX_x00102; break; case 0x71: NpcAI::ENTITY_MOVABLE_TNT(npc); npc_00 = extraout_ECX_x00111; break; case 0x72: NpcAI::ENTITY_ULTRA_COIN(npc); npc_00 = extraout_ECX_x00109; break; case 0x73: NpcAI::ENTITY_ULTRA_DOOR(npc); npc_00 = extraout_ECX_x00110; break; case 0x74: NpcAI::ENTITY_CORN_MINE(npc); npc_00 = extraout_ECX_x00112; break; case 0x75: NpcAI::ENTITY_HUSH_FLY(npc); npc_00 = extraout_ECX_x00113; break; case 0x76: NpcAI::ENTITY_HUSH_GAPER(npc); npc_00 = extraout_ECX_x00114; break; case 0x77: NpcAI::ENTITY_HUSH_BOIL(npc); npc_00 = extraout_ECX_x00116; break; case 0x78: NpcAI::ENTITY_GREED_GAPER(npc); npc_00 = extraout_ECX_x00115; break; case 0x79: NpcAI::ENTITY_MUSHROOM(npc); npc_00 = extraout_ECX_x00103; break; case 0x7a: NpcAI::ENTITY_BLISTER(npc); npc_00 = extraout_ECX_x00121; break; case 0x7b: NpcAI::ENTITY_PORTAL(npc); npc_00 = extraout_ECX_x00124; break; case 0x7c: NpcAI::ENTITY_TARBOY(npc); npc_00 = extraout_ECX_x00126; break; case 0x7d: NpcAI::ENTITY_FISTULOID(npc); npc_00 = extraout_ECX_x00127; break; case 0x7e: NpcAI::ENTITY_GUSH(npc); npc_00 = extraout_ECX_x00128; break; case 0x7f: NpcAI::ENTITY_LEPER(npc); npc_00 = extraout_ECX_x00130; break; case 0x80: NpcAI::ENTITY_MR_MINE(npc); npc_00 = extraout_ECX_x00131; break; case 0x81: NpcAI::ENTITY_BROWNIE(npc); npc_00 = extraout_ECX_x00104; break; case 0x82: NpcAI::ENTITY_FORSAKEN(npc); npc_00 = extraout_ECX_x00105; break; case 0x83: NpcAI::ENTITY_LITTLE_HORN(npc); npc_00 = extraout_ECX_x00106; break; case 0x84: NpcAI::ENTITY_RAG_MAN(npc); npc_00 = extraout_ECX_x00107; break; case 0x85: NpcAI::ENTITY_ULTRA_GREED(npc); npc_00 = extraout_ECX_x00108; break; case 0x86: NpcAI::ENTITY_HUSH(npc); npc_00 = extraout_ECX_x00117; break; case 0x88: NpcAI::ENTITY_RAG_MEGA(npc); npc_00 = extraout_ECX_x00120; break; case 0x89: NpcAI::ENTITY_SISTERS_VIS(npc); npc_00 = extraout_ECX_x00125; break; case 0x8a: NpcAI::ENTITY_BIG_HORN(npc); npc_00 = extraout_ECX_x00123; break; case 0x8b: NpcAI::ENTITY_DELIRIUM(npc); npc_00 = extraout_ECX_x00122; break; case 0x8c: NpcAI::ENTITY_MATRIARCH(npc); npc_00 = extraout_ECX_x00129; break; case 0x8d: NpcAI::ENTITY_BLOOD_PUPPY(npc); npc_00 = extraout_ECX_x00141; break; case 0x8e: NpcAI::ENTITY_QUAKE_GRIMACE(npc); npc_00 = extraout_ECX_x00167; break; case 0x8f: NpcAI::ENTITY_BISHOP(npc); npc_00 = extraout_ECX_x00191; break; case 0x90: NpcAI::ENTITY_BUBBLES(npc); npc_00 = extraout_ECX_x00148; break; case 0x91: NpcAI::ENTITY_WILLO(npc); npc_00 = extraout_ECX_x00145; break; case 0x92: NpcAI::ENTITY_BOMB_GRIMACE(npc); npc_00 = extraout_ECX_x00168; break; case 0x93: NpcAI::ENTITY_SMALL_LEECH(npc); npc_00 = extraout_ECX_x00149; break; case 0x94: NpcAI::ENTITY_DEEP_GAPER(npc); npc_00 = extraout_ECX_x00152; break; case 0x95: NpcAI::ENTITY_SUB_HORF(npc); npc_00 = extraout_ECX_x00155; break; case 0x96: NpcAI::ENTITY_BLURB(npc); npc_00 = extraout_ECX_x00147; break; case 0x97: NpcAI::ENTITY_STRIDER(npc); npc_00 = extraout_ECX_x00150; break; case 0x98: NpcAI::ENTITY_FISSURE(npc); npc_00 = extraout_ECX_x00157; break; case 0x99: NpcAI::ENTITY_POLTY(npc); npc_00 = extraout_ECX_x00151; break; case 0x9a: NpcAI::ENTITY_ROCK_SPIDER(npc); npc_00 = extraout_ECX_x00169; break; case 0x9b: NpcAI::ENTITY_DANNY(npc); npc_00 = extraout_ECX_x00172; break; case 0x9c: NpcAI::ENTITY_BLASTER(npc); npc_00 = extraout_ECX_x00173; break; case 0x9d: NpcAI::ENTITY_BOUNCER(npc); npc_00 = extraout_ECX_x00179; break; case 0x9e: NpcAI::ENTITY_QUAKEY(npc); npc_00 = extraout_ECX_x00174; break; case 0x9f: NpcAI::ENTITY_GYRO(npc); npc_00 = extraout_ECX_x00178; break; case 0xa0: NpcAI::ENTITY_FIRE_WORM(npc); npc_00 = extraout_ECX_x00176; break; case 0xa1: NpcAI::ENTITY_HARDY(npc); npc_00 = extraout_ECX_x00177; break; case 0xa2: NpcAI::ENTITY_FACELESS(npc); npc_00 = extraout_ECX_x00170; break; case 0xa3: NpcAI::ENTITY_NECRO(npc); npc_00 = extraout_ECX_x00185; break; case 0xa4: NpcAI::ENTITY_MOLE(npc); npc_00 = extraout_ECX_x00175; break; case 0xa5: NpcAI::ENTITY_BIG_BONY(npc); npc_00 = extraout_ECX_x00183; break; case 0xa6: NpcAI::ENTITY_GUTTED_FATTY(npc); npc_00 = extraout_ECX_x00214; break; case 0xa7: NpcAI::ENTITY_EXORCIST(npc); npc_00 = extraout_ECX_x00196; break; case 0xa8: NpcAI::ENTITY_CANDLER(npc); npc_00 = extraout_ECX_x00188; break; case 0xa9: NpcAI::ENTITY_WHIPPER(npc); npc_00 = extraout_ECX_x00187; break; case 0xaa: NpcAI::ENTITY_PEEPER_FATTY(npc); npc_00 = extraout_ECX_x00143; break; case 0xab: NpcAI::ENTITY_HENRY(npc); npc_00 = extraout_ECX_x00165; break; case 0xac: NpcAI::ENTITY_WILLO_L2(npc); npc_00 = extraout_ECX_x00146; break; case 0xad: NpcAI::ENTITY_REVENANT(npc); npc_00 = extraout_ECX_x00197; break; case 0xae: NpcAI::ENTITY_BOMBGAGGER(npc); npc_00 = extraout_ECX_x00181; break; case 0xaf: NpcAI::ENTITY_GAPER_L2(npc); npc_00 = extraout_ECX_x00215; break; case 0xb0: NpcAI::ENTITY_TWITCHY(npc); npc_00 = extraout_ECX_x00207; break; case 0xb1: NpcAI::ENTITY_SPIKEBALL(npc); npc_00 = extraout_ECX_x00208; break; case 0xb2: NpcAI::ENTITY_SMALL_MAGGOT(npc); npc_00 = extraout_ECX_x00204; break; case 0xb3: NpcAI::ENTITY_ADULT_LEECH(npc); npc_00 = extraout_ECX_x00205; break; case 0xb4: NpcAI::ENTITY_CHARGER_L2(npc); npc_00 = extraout_ECX_x00216; break; case 0xb5: NpcAI::ENTITY_GASBAG(npc); npc_00 = extraout_ECX_x00210; break; case 0xb6: NpcAI::ENTITY_COHORT(npc); npc_00 = extraout_ECX_x00138; break; case 0xb7: NpcAI::ENTITY_UNBORN(npc); npc_00 = extraout_ECX_x00209; break; case 0xb8: NpcAI::ENTITY_PUSTULE(npc); npc_00 = extraout_ECX_x00211; break; case 0xb9: NpcAI::ENTITY_MORNINGSTAR(npc); npc_00 = extraout_ECX_x00203; break; case 0xba: NpcAI::ENTITY_MOCKULUS(npc); npc_00 = extraout_ECX_x00202; break; case 0xbb: NpcAI::ENTITY_EVIS(npc); npc_00 = extraout_ECX_x00212; break; case 0xbc: NpcAI::ENTITY_DARK_ESAU(npc); npc_00 = extraout_ECX_x00142; break; case 0xbd: NpcAI::ENTITY_MOTHERS_SHADOW(npc); npc_00 = extraout_ECX_x00144; break; case 0xbe: NpcAI::ENTITY_ARMYFLY(npc); npc_00 = extraout_ECX_x00133; break; case 0xbf: NpcAI::ENTITY_FLY_TRAP(npc); npc_00 = extraout_ECX_x00161; break; case 0xc0: NpcAI::ENTITY_FARTIGAN(npc); npc_00 = extraout_ECX_x00162; break; case 0xc1: NpcAI::ENTITY_POOT_MINE(npc); npc_00 = extraout_ECX_x00163; break; case 0xc2: NpcAI::ENTITY_DUMP(npc); npc_00 = extraout_ECX_x00164; break; case 0xc3: NpcAI::ENTITY_GRUDGE(npc); npc_00 = extraout_ECX_x00190; break; case 0xc4: NpcAI::ENTITY_BUTT_SLICKER(npc); npc_00 = extraout_ECX_x00135; break; case 0xc5: NpcAI::ENTITY_BLOATY(npc); npc_00 = extraout_ECX_x00156; break; case 0xc6: NpcAI::ENTITY_FLESH_MAIDEN(npc); npc_00 = extraout_ECX_x00180; break; case 199: NpcAI::ENTITY_NEEDLE(npc); npc_00 = extraout_ECX_x00136; break; case 200: NpcAI::ENTITY_DUST(npc); npc_00 = extraout_ECX_x00182; break; case 0xc9: NpcAI::ENTITY_BABY_BEGOTTEN(npc); npc_00 = extraout_ECX_x00192; break; case 0xca: NpcAI::ENTITY_SWARM_SPIDER(npc); npc_00 = extraout_ECX_x00137; break; case 0xcb: NpcAI::ENTITY_CULTIST(npc); npc_00 = extraout_ECX_x00195; break; case 0xcc: NpcAI::ENTITY_VIS_FATTY(npc); npc_00 = extraout_ECX_x00194; break; case 0xcd: NpcAI::ENTITY_DUSTY_DEATHS_HEAD(npc); npc_00 = extraout_ECX_x00184; break; case 0xce: NpcAI::ENTITY_SHADY(npc); npc_00 = extraout_ECX_x00140; break; case 0xcf: NpcAI::ENTITY_CLICKETY_CLACK(npc); npc_00 = extraout_ECX_x00186; break; case 0xd0: NpcAI::ENTITY_MAZE_ROAMER(npc); npc_00 = extraout_ECX_x00199; break; case 0xd1: NpcAI::ENTITY_GOAT(npc); npc_00 = extraout_ECX_x00198; break; case 0xd2: NpcAI::ENTITY_POOFER(npc); npc_00 = extraout_ECX_x00200; break; case 0xd3: NpcAI::ENTITY_BALL_AND_CHAIN(npc); npc_00 = extraout_ECX_x00201; break; case 0xd4: NpcAI::ENTITY_REAP_CREEP(npc); npc_00 = extraout_ECX_x00224; break; case 0xd5: NpcAI::ENTITY_LIL_BLUB(npc); npc_00 = extraout_ECX_x00218; break; case 0xd6: NpcAI::ENTITY_RAINMAKER(npc); npc_00 = extraout_ECX_x00223; break; case 0xd7: iVar8 = npc->_variant; if (iVar8 == 0) { NpcAI::ENTITY_VISAGE(npc); npc_00 = extraout_ECX_x00230; } else if (iVar8 == 1) { NpcAI::ENTITY_VISAGE_mask(npc); npc_00 = extraout_ECX_x00231; } else if (iVar8 == 10) { NpcAI::ENTITY_VISAGE_chain(npc); npc_00 = extraout_ECX_x00232; } else if (iVar8 == 0x14) { NpcAI::ENTITY_VISAGE_plasma(npc); npc_00 = extraout_ECX_x00233; } break; case 0xd8: NpcAI::ENTITY_SIREN(npc); npc_00 = extraout_ECX_x00242; break; case 0xd9: NpcAI::ENTITY_HERETIC(npc); npc_00 = extraout_ECX_x00229; break; case 0xda: Entity_NPC::Hornfel_UpdateAI(npc); npc_00 = extraout_ECX_x00221; break; case 0xdb: NpcAI::ENTITY_GIDEON(npc); npc_00 = extraout_ECX_x00220; break; case 0xdc: NpcAI::ENTITY_BABY_PLUM(npc); npc_00 = extraout_ECX_x00217; break; case 0xdd: if (npc->_variant == 10) { NpcAI::ENTITY_SCOURGE_chain(npc); npc_00 = extraout_ECX_x00246; } else { NpcAI::ENTITY_SCOURGE(npc); npc_00 = extraout_ECX_x00247; } break; case 0xde: if (npc->_variant == 2) { NpcAI::ENTITY_CHIMERA(npc); npc_00 = extraout_ECX_x00244; } else { NpcAI::ENTITY_CHIMERA_body(npc); npc_00 = extraout_ECX_x00245; } break; case 0xdf: if (npc->_variant == 2) { NpcAI::ENTITY_ROTGUT(npc); npc_00 = extraout_ECX_x00248; } else if (npc->_variant == 1) { NpcAI::ENTITY_ROTGUT_maggot(npc); npc_00 = extraout_ECX_x00249; } else { NpcAI::ENTITY_ROTGUT_face(npc); npc_00 = extraout_ECX_x00250; } break; case 0xe0: switch(npc->_variant) { case 0: NpcAI::ENTITY_MOTHER(npc); npc_00 = extraout_ECX_x00251; break; case 10: NpcAI::ENTITY_MOTHER_2(npc); npc_00 = extraout_ECX_x00253; break; case 0x14: NpcAI::ENTITY_ROTTEN_GAPER(npc); npc_00 = extraout_ECX_x00252; break; case 0x1e: NpcAI::ENTITY_MOTHER_worm(npc); npc_00 = extraout_ECX_x00254; break; case 100: NpcAI::ENTITY_MOTHER_ball(npc); npc_00 = extraout_ECX_x00255; } break; case 0xe1: NpcAI::ENTITY_MIN_MIN(npc); npc_00 = extraout_ECX_x00228; break; case 0xe2: NpcAI::ENTITY_CLOG(npc); npc_00 = extraout_ECX_x00219; break; case 0xe3: if (npc->_variant == 1) { NpcAI::ENTITY_SINGE_ball(npc); npc_00 = extraout_ECX_x00225; } else { NpcAI::ENTITY_SINGE_body(npc); npc_00 = extraout_ECX_x00226; } break; case 0xe4: NpcAI::ENTITY_BUMBINO(npc); npc_00 = extraout_ECX_x00227; break; case 0xe5: NpcAI::ENTITY_COLOSTOMIA(npc); npc_00 = extraout_ECX_x00235; break; case 0xe6: NpcAI::ENTITY_TURDLET(npc); npc_00 = extraout_ECX_x00234; break; case 0xe7: NpcAI::ENTITY_RAGLICH(npc); npc_00 = extraout_ECX_x00236; break; case 0xe8: NpcAI::ENTITY_HORNY_BOYS(npc); npc_00 = extraout_ECX_x00237; break; case 0xe9: if (npc->_variant == 0) { NpcAI::ENTITY_CLUTCH(npc); npc_00 = extraout_ECX_x00238; } else if (npc->_state == 0) { subtypeRoll = Random(); subtypeRoll = subtypeRoll & 7; npc->_subtype = subtypeRoll; subtypeRoll = -(uint)(subtypeRoll != 0) & subtypeRoll; uVar3 = 7; if (subtypeRoll < 7) { uVar3 = subtypeRoll; } ANM2::Play(&npc->_sprite,(&PTR_DAT_00b61c60)[uVar3],0); savedFlagsHigh = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x10000; npc->_entityCollisionClass = 2; npc->_state = 3; *(undefined4 *)((int)&npc->_flags + 4) = savedFlagsHigh; npc_00 = extraout_ECX_x00241; } else if (npc->_state == 3) { EVar4 = npc->_parent; if ((EVar4 == (EntityPtr)0x0) || (*(char *)((int)EVar4 + 0x173) != '\0')) { sourceRef = EntityRef::EntityRef(&emptyRef); (**(code **)(*(int *)npc + 0x24))(sourceRef,uVar3); npc_00 = extraout_ECX_x00240; } else { local_e0.y = (npc->_v1).x * 0.017453292; fVar6 = cos(local_e0.y); local_ec.y = (fVar6 * 50.0 + *(float *)((int)EVar4 + 0x33c)) - (npc->_pos).x; fVar6 = sin(local_e0.y); local_e0.y = (fVar6 * 50.0 + *(float *)((int)EVar4 + 0x340)) - (npc->_pos).y; fVar6 = sqrtf(local_e0.y * local_e0.y + local_ec.y * local_ec.y); if (fVar6 < 0.1) { fVar7 = 0.0; } else { fVar7 = fVar6 * 0.15; if (2.0 <= fVar7) { fVar7 = 2.0; } fVar7 = fVar7 / fVar6; } fVar6 = npc->_speedMultiplier; (npc->_velocity).x = local_ec.y * fVar7 * fVar6 + (npc->_velocity).x; fVar1 = (npc->_velocity).y; npc->_friction = npc->_friction * 0.8; (npc->_velocity).y = local_e0.y * fVar7 * fVar6 + fVar1; fVar6 = normalize_angle_degrees(fVar6 * 5.0 + (npc->_v1).x); (npc->_v1).x = fVar6; npc_00 = extraout_ECX_x00239; } } break; case 0xea: if (npc->_state == 0) { npc_00 = (Entity_NPC *)&npc->_splatColor; if (npc_00 != (Entity_NPC *)&g_colorGreenSplat) { ((ColorMod *)npc_00)->_tint[0] = g_colorGreenSplat._tint[0]; (npc->_splatColor)._tint[1] = fVar6; (npc->_splatColor)._tint[2] = fVar7; (npc->_splatColor)._tint[3] = fVar1; fVar1 = g_colorGreenSplat._colorize[3]; fVar7 = g_colorGreenSplat._colorize[2]; fVar6 = g_colorGreenSplat._colorize[1]; (npc->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (npc->_splatColor)._colorize[1] = fVar6; (npc->_splatColor)._colorize[2] = fVar7; (npc->_splatColor)._colorize[3] = fVar1; *(undefined8 *)(npc->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (npc->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } npc->_state = 3; } break; case 0xeb: iVar8 = npc->_variant; if (iVar8 == 1) { NpcAI::ENTITY_DOGMA_tv(npc); npc_00 = extraout_ECX_x00259; } else if (iVar8 == 2) { NpcAI::ENTITY_DOGMA_angel(npc); npc_00 = extraout_ECX_x00258; } else if (iVar8 == 10) { NpcAI::ENTITY_DOGMA_angel_baby(npc); npc_00 = extraout_ECX_x00257; } else { NpcAI::ENTITY_DOGMA(npc); npc_00 = extraout_ECX_x00256; } break; case 0xec: switch(npc->_variant) { case 1: NpcAI::ENTITY_BEAST_stalactite(npc); npc_00 = extraout_ECX_x00260; break; case 2: NpcAI::ENTITY_BEAST_rock_projectile(npc); npc_00 = extraout_ECX_x00262; break; case 3: NpcAI::ENTITY_BEAST_soul(npc); npc_00 = extraout_ECX_x00261; break; default: NpcAI::ENTITY_BEAST(npc); npc_00 = extraout_ECX_x00275; break; case 10: NpcAI::ENTITY_BEAST_ultra_famine(npc); npc_00 = extraout_ECX_x00263; break; case 0xb: NpcAI::ENTITY_BEAST_ultra_famine_fly(npc); npc_00 = extraout_ECX_x00264; break; case 0x14: NpcAI::ENTITY_BEAST_ultra_pestilence(npc); npc_00 = extraout_ECX_x00265; break; case 0x15: NpcAI::ENTITY_BEAST_pestilence_fly(npc); npc_00 = extraout_ECX_x00266; break; case 0x16: NpcAI::ENTITY_BEAST_ultra_pestilence_maggot(npc); npc_00 = extraout_ECX_x00267; break; case 0x17: NpcAI::ENTITY_BEAST_ultra_pestilence_fly_ball(npc); npc_00 = extraout_ECX_x00268; break; case 0x1e: NpcAI::ENTITY_BEAST_ultra_war(npc); npc_00 = extraout_ECX_x00269; break; case 0x1f: NpcAI::ENTITY_BEAST_ultra_war_bomb(npc); npc_00 = extraout_ECX_x00270; break; case 0x28: NpcAI::ENTITY_BEAST_ultra_death(npc); npc_00 = extraout_ECX_x00271; break; case 0x29: NpcAI::ENTITY_BEAST_ultra_death_scythe(npc); npc_00 = extraout_ECX_x00272; break; case 0x2a: NpcAI::ENTITY_BEAST_ultra_death_head(npc); npc_00 = extraout_ECX_x00273; break; case 100: case 0x65: case 0x66: case 0x67: case 0x68: NpcAI::ENTITY_BEAST_background(npc); npc_00 = extraout_ECX_x00274; } break; case 0xed: NpcAI::ENTITY_GENERIC_PROP(npc); npc_00 = extraout_ECX_x00139; break; case 0xee: NpcAI::ENTITY_MINECART(npc); npc_00 = extraout_ECX_x00166; break; case 0xef: NpcAI::ENTITY_SIREN_HELPER(npc); npc_00 = extraout_ECX_x00243; break; case 0xf0: NpcAI::ENTITY_HORNFEL_DOOR(npc); npc_00 = extraout_ECX_x00222; } } if (npc->_aiCallPhase == 0) { NpcHelper::default_case_lua_callback(npc_00); } ExceptionList = local_1c; return; } //@@ 006c4a90 FUN_006c4a90 int FUN_006c4a90(void) { uint uVar1; uint3 uVar2; int in_ECX; uVar1 = *(uint *)(in_ECX + 0x16c) & 0x2000000; uVar2 = (uint3)(uVar1 >> 8); if (((*(uint *)(in_ECX + 0x168) & 0x20) == 0 && uVar1 == 0) && (*(int *)(in_ECX + 0x3f0) < 1)) { return (uint)uVar2 << 8; } return CONCAT31(uVar2,1); } //@@ 006c4ac0 Entity_NPC::PreUpdate /* ZHL [vtable slot 2] */ void __thiscall Entity_NPC::PreUpdate(Entity_NPC *this) { (this->_prevPosition).x = (this->_pos).x; (this->_prevPosition).y = (this->_pos).y; (this->_prevVelocity).x = (this->_velocity).x; (this->_prevVelocity).y = (this->_velocity).y; if (((this->_type == 0x340) && (this->_variant == 0)) && (this->_dead == 0)) { *(undefined1 *)((int)g_game->_room + 0x7768) = 1; } return; } //@@ 006c4b30 Entity_NPC::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_NPC::Update(Entity_NPC *this) { void **ppvVar1; uint *puVar2; code *pcVar3; EntityPtr this_00; BitSet128 tearFlags; bool bVar4; byte bVar5; char cVar6; std_string *psVar7; byte *layerCount; SoundEffects *sfx; ColorMod *color; ColorMod *extraout_EAX; LayerState *pLVar8; Entity *pEVar9; void *pvVar10; uint uVar11; Entity_Effect *pEVar12; Room *pRVar13; GridEntity_Poop *poop; undefined4 *puVar14; undefined1 *puVar15; ColorMod *pCVar16; Vector *pVVar17; float *pfVar18; ColorMod *to; Sprite *sprite; ANM2 *pAVar19; ColorMod *to_00; EntityList *entityList; ColorMod *to_01; Entity_Player *player; uint uVar20; GridEntity *gridEntity; PlayerManager *playerManager; RNG *sfx; RNG *entityList; int *piVar21; Vector *pVVar22; undefined3 extraout_var; TemporaryEffects *pTVar23; undefined4 extraout_EAX_00; Color *spriteColor; EntityRef *pEVar24; PersistentGameData *this_03; AnimationState *pAVar25; Camera *camera; Entity_Projectile *projectile; int iVar26; float fVar27; int iVar28; byte *layer; undefined1 *puVar29; ANM2 *pAVar30; float10 fVar31; float fVar32; undefined1 auVar33 [12]; undefined1 in_XMM0 [16]; undefined1 auVar34 [16]; undefined1 extraout_var_00 [12]; undefined1 auVar35 [16]; undefined1 auVar36 [16]; undefined1 auVar37 [16]; undefined4 in_stack_fffffc50; undefined4 in_stack_fffffc54; undefined4 in_stack_fffffc58; undefined4 in_stack_fffffc5c; Entity_NPC *source; undefined4 uVar38; TypeDescriptor *pTVar39; TypeDescriptor *pTVar40; byte damageSource; ProjectileParams *pPVar41; KColor *src; undefined4 uVar42; undefined4 uVar43; Vector local_374; Vector local_36c; Vector local_364; Vector local_35c; Vector local_354; Vector local_34c; Vector local_344; Vector local_33c; Vector local_334; Vector local_32c; float local_324; Vector local_320; undefined1 local_318 [16]; Vector local_308; Vector local_300; Vector local_2f8; Vector local_2f0; Vector local_2e8; Vector local_2e0; Entity *local_2d8; byte isDeadBefore; Vector local_2d0; Room *local_2c4; Entity *local_2c0; Entity_NPC *npc; Vector local_2b8; Entity *local_2b0; Room *local_2ac; byte local_2a5; Entity_Effect *local_2a4; ANM2 *local_2a0; Room *local_29c; Vector local_298; Entity *local_290; Entity_Effect *local_28c; Room *local_288; byte local_281; ColorMod local_254; ProjectileParams projectileParams; Color local_17c; ColorMod local_150; Color local_124; Color local_f8; undefined1 local_cc [44]; undefined1 local_a0 [60]; char local_64 [4]; undefined1 local_60 [8]; float local_58; Vector local_54; undefined1 local_4c [20]; KColor local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *deathAnim; qword entityFlags; Game *game; short regenTimer; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00afaabc; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_4c + 0x3c); local_2a4 = (Entity_Effect *)0x0; local_28c = (Entity_Effect *)0x0; if (this->_exists == 0) { return; } ExceptionList = &local_1c; npc = this; compute_speed_multiplier(this,local_24); this->_speedMultiplier = in_XMM0._0_4_; UpdateChildEffectPosition(this,0); if (this->_controllerID == -1) { ppvVar1 = &this->_aimTargetEffect; (this->_controllerMovement).x = g_vectorZero.x; (this->_controllerMovement).y = g_vectorZero.y; if (*ppvVar1 != (int *)0x0) { (**(code **)(*(int *)*ppvVar1 + 0x28))(); if (*ppvVar1 != (void *)0x0) { local_288 = (Room *)ppvVar1; std::multiset::erase(&local_288); } *ppvVar1 = (void *)0x0; } } if ((this->_flags & 0x2000000000000) != 0) { update_frozen(); ExceptionList = local_1c; return; } bVar5 = Entity::IsFrame((Entity *)this,2,0); if ((((bVar5 != 0) && ((this->_flags & 0x20000000) == 0)) && (bVar5 = Entity::IsActiveEnemy((Entity *)this,0), bVar5 != 0)) && (bVar5 = TemporaryEffects::HasNullEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x40), bVar5 != 0)) { ::EntityRef::constructor((EntityRef *)local_4c,(Entity *)0x0); Entity::AddWeakness((Entity *)this,(EntityRef *)local_4c,-3); } iVar28 = *(int *)&this[1].field_0x4; if ((iVar28 != 0) && (*(Entity_NPC **)(iVar28 + 0x3c4) == this)) { *(float *)(iVar28 + 0x33c) = (this->_pos).x; *(float *)(iVar28 + 0x340) = (this->_pos).y; iVar28 = *(int *)&this[1].field_0x4; *(float *)(iVar28 + 0x360) = (this->_velocity).x; *(float *)(iVar28 + 0x364) = (this->_velocity).y; } if (((this->_type == 0x17) && (this->_variant == 0)) && (this->_subtype == 1)) { bVar4 = true; } else { bVar4 = false; } local_290 = (Entity *)0x0; if (this->_championColorIdx == 0x16) { local_290 = (Entity *)0xb6757c; LAB_006c4d15: iVar28 = 1; } else { iVar28 = 0; if (this->_championColorIdx == 0x17) { local_290 = (Entity *)0xb67584; goto LAB_006c4d15; } } entityFlags = this->_flags; if (((entityFlags & 0x100) == 0) || (bVar4)) { if ((this->_flags & 0x100000000000000) != 0) { local_290 = (Entity *)0xb67638; goto LAB_006c4f0d; } if ((this->_flags & 0x8000000000000) != 0) { local_290 = (Entity *)0xb67648; goto LAB_006c4f0d; } if ((this->_flags & 0x10000000000000) != 0) { local_290 = (Entity *)&DAT_00b67654; iVar28 = 0; goto LAB_006c4f12; } if ((entityFlags & 0x200) != 0) { local_290 = (Entity *)0xb67610; goto LAB_006c4f0d; } if ((entityFlags & 0x1000) != 0) { local_290 = (Entity *)0xb67618; iVar28 = 0; goto LAB_006c4f12; } if ((entityFlags & 0x40) != 0) { local_290 = (Entity *)0xb67620; goto LAB_006c4f0d; } if ((entityFlags & 0x800) != 0) { local_290 = (Entity *)&DAT_00b67628; goto LAB_006c4f0d; } if ((this->_flags & 0x400000000) != 0) { local_290 = (Entity *)0xb67690; goto LAB_006c4f0d; } if (((entityFlags & 0x80) != 0) || ((((bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0xe8), bVar5 != 0 || (bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x42), bVar5 != 0)) || ((g_game->_challenge != 0x16 && (*(int *)((int)g_game->_room + 0x1210) == 1)))) && (((this->_flags & 0x20000001) == 0 || (this->_type == 0xd4)))))) { local_290 = (Entity *)&DAT_00b6769c; goto LAB_006c4f0d; } if ((this->_flags & 0x40000000000000) != 0) { local_290 = (Entity *)0xb676a4; goto LAB_006c4f0d; } if (this->_type == 0x3c6) { local_290 = (Entity *)0xb676b0; goto LAB_006c4f0d; } if (local_290 != (Entity *)0x0) goto LAB_006c4f12; if ((this->_statusEffectSprite)._animState._animData != (void *)0x0) { (this->_statusEffectSprite)._animState._isPlaying = 0; } } else { local_290 = (Entity *)0xb67630; LAB_006c4f0d: iVar28 = 1; LAB_006c4f12: if ((this->_statusEffectSprite)._loaded == 0) { std::string::string_from_cstr(local_4c + 0x10,(byte *)"gfx/StatusEffects.anm2"); local_14 = 0; ANM2::Load(&this->_statusEffectSprite,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_4c + 0x10); } bVar5 = ANM2::IsPlaying(&this->_statusEffectSprite,&s_empty); if ((bVar5 != 0) && ((this->_statusEffectSprite)._loaded != 0)) { AnimationState::Update(&(this->_statusEffectSprite)._animState); AnimationState::Update(&(this->_statusEffectSprite)._overlayAnimState); } ANM2::Play(&this->_statusEffectSprite,(byte *)local_290,0); (this->_statusEffectSprite)._bitflags = iVar28 << 0x1f; } iVar28 = this->_pauseTimer; if ((iVar28 == 0) && ((this->_flags & 0x200000000000000) == 0)) { isDeadBefore = this->_dead; } else { if (((this->_pausePosition).x == g_vectorZero.x) && ((this->_pausePosition).y == g_vectorZero.y) ) { (this->_pausePosition).x = (this->_pos).x; (this->_pausePosition).y = (this->_pos).y; iVar28 = this->_pauseTimer; } if ((0 < iVar28) && (this->_pauseTimer = iVar28 + -1, 0 < iVar28 + -1)) { (this->_pos).x = (this->_pausePosition).x; (this->_pos).y = (this->_pausePosition).y; } (this->_velocity).x = (this->_velocity).x * 0.6; (this->_velocity).y = (this->_velocity).y * 0.6; local_281 = this->_dead; spawn_damage_numbers(this); update_damage_history(this); if ((this->_aiCallFlags & 1) != 0) { this->_aiCallPhase = 1; Entity_NPC_UpdateAI_dispatch(this); this->_aiCallPhase = 0; } uVar11 = *(uint *)((int)&this->_flags + 4); local_288 = (Room *)this->_health; if ((uVar11 & 1) == 0) { *(int *)&this->_flags = (int)this->_flags; *(uint *)((int)&this->_flags + 4) = uVar11 ^ 1; Entity::Update((Entity *)this); *(int *)&this->_flags = (int)this->_flags; puVar2 = (uint *)((int)&this->_flags + 4); *puVar2 = *puVar2 ^ 1; } else { Entity::Update((Entity *)this); } local_288 = (Room *)((float)local_288 - this->_health); local_2ac = (Room *)0x0; pfVar18 = (float *)std::max(); isDeadBefore = this->_dead; this->_totalDamageTaken = *pfVar18 + this->_totalDamageTaken; if (local_281 == isDeadBefore) { ExceptionList = local_1c; return; } } bVar5 = Entity::HasEntityFlags((Entity *)this,4); iVar28 = this->_state; if (bVar5 == 0) { if (iVar28 != 1) goto LAB_006c58e9; this->_state = this->_savedState; } else if (iVar28 == 1) { iVar28 = this->_appearFrames; if (iVar28 == 0) { this->_state = 0; if (this->_championColorIdx == 6) { this->_isInvicible = 1; Entity::AddEntityFlags((Entity *)this,1); } Entity_NPC_UpdateAI_dispatch(this); if ((this->_championColorIdx == 0x11) || (this->_championColorIdx == 0x19)) { uVar11 = Random(); pEVar9 = Game::Spawn(g_game,0x60,0,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar11); Entity::SetParent(pEVar9,(Entity *)this); } bVar5 = Entity::HasEntityFlags((Entity *)this,4); if (bVar5 != 0) { this->_visible = 0; this->_savedState = this->_state; this->_state = 1; } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar5 = PlayerManager::AnyoneHasTrinket(playerManager,0x35); if ((((bVar5 != 0) && (this->_type != 0x112)) && (this->_type != 0x113)) && (60.0 < this->_health)) { iVar26 = 0; playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); iVar28 = PlayerManager::GetTrinketMultiplier(playerManager,0x35); if (0 < iVar28) { do { game = g_game; iVar26 = iVar26 + 1; this->_health = this->_health * 0.85; playerManager = (PlayerManager *)Game::GetPlayerManager(game); iVar28 = PlayerManager::GetTrinketMultiplier(playerManager,0x35); } while (iVar26 < iVar28); } } layer = (byte *)0x0; iVar28 = Sprite::GetLayerCount((Sprite *)&this->_sprite); if (iVar28 != 0) { do { local_288 = (Room *)Sprite::GetLayer((Sprite *)&this->_sprite,layer); psVar7 = (std_string *)_get_name_string(local_64); local_14 = 1; local_2a4 = (Entity_Effect *)((uint)local_28c | 1); local_28c = local_2a4; bVar5 = str_eq_cstr(psVar7,&DAT_00b64428); if (bVar5 == 0) { psVar7 = (std_string *)_get_name_string(local_4c + 0x10); local_14 = 2; local_2a4 = (Entity_Effect *)((uint)local_28c | 2); local_28c = local_2a4; bVar5 = str_eq_cstr(psVar7,&DAT_00b1d57c); local_281 = 0; if (bVar5 != 0) goto LAB_006c5358; } else { LAB_006c5358: local_281 = 1; } if (((uint)local_28c & 2) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xfffffffd); std::string::_Tidy_deallocate(local_4c + 0x10); } local_14 = 0xffffffff; if (((uint)local_28c & 1) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xfffffffe); std::string::_Tidy_deallocate(local_64); } if (local_281 != 0) { UpdateDirtColor(this,1); break; } layer = layer + 1; layerCount = (byte *)Sprite::GetLayerCount((Sprite *)&this->_sprite); } while (layer < layerCount); } cVar6 = (**(code **)(*(int *)this + 0x4c))(); if ((cVar6 != '\0') && (iVar28 = Entity::Parent((Entity *)this), iVar28 == 0)) { Game::AddEncounteredBoss(g_game,this->_type,this->_variant); } } else if (iVar28 == 1) { uVar11 = 2; if (this->_size < 13.0) { uVar11 = 1; } if ((18.0 <= this->_size) || (30.0 < this->_shadowSize)) { uVar11 = 3; } uVar20 = Random(); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)this,uVar11,uVar20); pRVar13 = (Room *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); local_288 = pRVar13; Entity::SetPositionOffset((Entity *)pRVar13,&this->_posOffset); set_field_358(pRVar13,(this->_posOffset).y + 1.0); if ((this->_isChampion != 0) && ((uint)this->_championColorIdx < 0x1a)) { pcVar3 = *(code **)(*(int *)pRVar13 + 0x3c); uVar38 = _Entity_NPC::GetColorWithFlash(local_a0); (*pcVar3)(uVar38,0xffffffff,0xff,0,1); } iVar28 = 0x11e; cVar6 = FUN_006b8490(); if (cVar6 != '\0') { iVar28 = 0x368; } sfx = MusicManager::SFXManager(); SFXManager::Stop(sfx,iVar28); PlaySound(this,iVar28,1.0,2,0,1.0); iVar28 = this->_type; if (iVar28 == 0x191) { SoundEffects::PlayWithFartOverride(0x40,1.0,2,0,1.0); PlaySound(this,0x1a3,1.0,2,0,1.0); } else if (iVar28 == 0x193) { PlaySound(this,0x1a1,1.0,2,0,1.0); } else if ((iVar28 == 0x19b) && (this->_variant == 0)) { PlaySound(this,0xe,2.0,2,0,1.0); } } else if (iVar28 == 4) { if (this->_type != 0x3e) { this->_visible = 1; } pvVar10 = ANM2::GetAnimationData(&this->_sprite,(byte *)"Appear"); if (pvVar10 != (void *)0x0) { if (this->_type != 0x10a) { Sprite::RemoveOverlay((Sprite *)&this->_sprite); } ANM2::Play(&this->_sprite,(byte *)"Appear",1); } } else { if (iVar28 < 0x14) { LAB_006c56aa: local_281 = 0; } else { bVar5 = ANM2::IsFinishedImpl(&this->_sprite,(byte *)"Appear"); if ((bVar5 == 0) && (pvVar10 = ANM2::GetAnimationData(&this->_sprite,(byte *)"Appear"), pvVar10 != (void *)0x0)) { std::string::string_from_cstr(local_64,(byte *)"Appear"); local_14 = 3; local_2a4 = (Entity_Effect *)&DAT_00000004; pAVar30 = (ANM2 *)Config::GetPillEffects(); ANM2::GetAnimation(pAVar30,(std_string *)(local_4c + 0x10)); local_28c = (Entity_Effect *)0xc; cVar6 = FUN_0040c7c0(); if (cVar6 == '\0') goto LAB_006c56aa; } local_281 = 1; } if (((uint)local_28c & 8) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xfffffff7); std::string::_Tidy_deallocate(local_4c + 0x10); } local_14 = 0xffffffff; if (((uint)local_28c & 4) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xfffffffb); std::string::_Tidy_deallocate(local_64); } if (local_281 != 0) { this->_state = this->_savedState; this->_friction = this->_baseFriction; } } iVar28 = this->_type; if (iVar28 == 0x391) { bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if (bVar5 == 0) { iVar28 = this->_type; goto LAB_006c5752; } PlaySound(this,0x1e3,1.0,2,0,1.0); } else { LAB_006c5752: if (((iVar28 == 0x390) && (this->_variant == 0x14)) && (bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"), bVar5 != 0)) { Color::Color((Color *)local_a0); Game::SpawnParticles(g_game,&this->_pos,4,5,6.0,color,100000.0,0x20000); } else { iVar28 = this->_type; if (iVar28 == 0x395) { bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,s_Land); if (bVar5 != 0) { Game::ShakeScreen(g_game,8); this->_entityCollisionClass = 4; Entity::MakeBloodPoofAtPos(&this->_splatColor); pVVar17 = Vector::Vector(&local_2e0,100.0,60.0); spawn_rock_particles(&this->_pos,pVVar17); play_sound_with_fart_seed(0x30,1.0,2,0,1.0); goto LAB_006c58bd; } iVar28 = this->_type; } if (iVar28 == 0x194) { bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"HoleOpen"); if (bVar5 != 0) { SoundEffects::PlayWithFartOverride(0x3b3,1.0,2,0,1.0); } bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"HoleExit"); if (bVar5 != 0) { SoundEffects::PlayWithFartOverride(0x3b4,1.0,2,0,1.0); } } } } LAB_006c58bd: if (this->_state == 1) { this->_friction = this->_friction * 0.01; } this->_appearFrames = this->_appearFrames + 1; } else { LAB_006c58e9: if ((iVar28 != 0x12) && (iVar28 != 0x11)) goto LAB_006c68c7; fVar32 = this->_friction * 0.01; auVar34 = ZEXT416((uint)fVar32); this->_friction = fVar32; if (this->_stateFrame == 0) { if (iVar28 == 0x11) { iVar28 = this->_type; if ((((iVar28 == 0xd9) || (iVar28 == 0xdc)) || (iVar28 == 0xdf)) || (((((iVar28 == 0x105 || (iVar28 == 0x192)) || ((iVar28 == 0x366 || ((iVar28 == 0x367 || (iVar28 == 0x392)))))) || (iVar28 == 0x368)) || ((iVar28 == 0xed && (this->_variant == 2)))))) { pAVar30 = &this->_sprite; local_2a0 = pAVar30; pvVar10 = ANM2::GetAnimationData(pAVar30,(byte *)"Flush"); if (pvVar10 != (void *)0x0) { ANM2::Play(pAVar30,(byte *)"Flush",0); iVar28 = this->_state; this->_renderZOffset = 5000; goto LAB_006c59c4; } this->_state = 0x12; goto LAB_006c59d3; } } else { LAB_006c59c4: local_2a0 = &this->_sprite; if (iVar28 == 0x12) { LAB_006c59d3: pAVar30 = &this->_sprite; pvVar10 = ANM2::GetAnimationData(pAVar30,(byte *)"Death"); iVar28 = this->_type; if (pvVar10 == (void *)0x0) { if (iVar28 == 0x1c) { iVar28 = this->_i1; if (iVar28 == 0) { deathAnim = "DeathHead"; LAB_006c5b7b: ANM2::Play(pAVar30,(byte *)deathAnim,0); } else { if (iVar28 == 1) { deathAnim = "DeathBody01"; goto LAB_006c5b7b; } if (iVar28 == 2) { deathAnim = "DeathBody02"; goto LAB_006c5b7b; } } iVar28 = ANM2::GetFrame(pAVar30); if (iVar28 == 3) { PlaySound(this,0x74,1.0,2,0,1.0); } } else if ((iVar28 == 0x13) || (iVar28 == 0x396)) { deathAnim = "DeathBody01"; if (this->_parent == (EntityPtr)0x0) { deathAnim = "DeathHead"; } ANM2::Play(pAVar30,(byte *)deathAnim,0); } else if (iVar28 == 0x3e) { if (this->_parent == (EntityPtr)0x0) { ANM2::Play(pAVar30,(byte *)"DeathHead",0); } else if (this->_child == (EntityPtr)0x0) { (**(code **)(*(int *)this + 0x28))(); } else { ANM2::Play(pAVar30,(byte *)"DeathBody01",0); } } else if (((iVar28 != 0x4a) && (iVar28 != 0x4b)) && (iVar28 != 0x4c)) { Entity::BloodExplode((Entity *)this); trigger_kill_item_effects(this); } } else if (iVar28 == 0x19b) { if (this->_variant == 1) { local_288 = (Room *)ANM2::GetLayer(pAVar30,&DAT_00b6767c); if (local_288 == (Room *)0x0) { local_2a0 = pAVar30; } else { pAVar25 = (AnimationState *)Config::GetPillEffects(); iVar28 = _ptr_deref_or_minus1(); pvVar10 = AnimationState::GetLayerFrame(pAVar25,iVar28); if ((pvVar10 != (void *)0x0) && (*(char *)((int)pvVar10 + 0x2c) != '\0')) { ANM2::Play(local_2a0,(byte *)"HandDeath",0); goto LAB_006c5c3e; } } ANM2::Play(local_2a0,(byte *)"SmallHoleClose",0); } else if (this->_variant == 2) { FUN_0044bf90(0); } else { pAVar19 = (ANM2 *)Config::GetPillEffects(); ANM2::GetAnimation(pAVar19,(std_string *)(local_4c + 0x10)); local_14 = 4; local_281 = str_ne(); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_4c + 0x10); if (local_281 != 0) { ANM2::Play(pAVar30,(byte *)"Death",0); } } } else { if (iVar28 == 0x195) { local_29c = (Room *)ANM2::GetLayer(pAVar30,s_Head); if (local_29c != (Room *)0x0) { pAVar25 = (AnimationState *)Config::GetPillEffects(); iVar28 = _ptr_deref_or_minus1(); pvVar10 = AnimationState::GetLayerFrame(pAVar25,iVar28); if ((pvVar10 == (void *)0x0) || (*(char *)((int)pvVar10 + 0x2c) == '\0')) { bVar5 = 0; } else { bVar5 = 1; } *(byte *)(local_29c->_gridEntities + 0x14) = bVar5; pAVar30 = local_2a0; } } ANM2::Play(pAVar30,(byte *)"Death",0); } } } } LAB_006c5c3e: iVar28 = this->_type; iVar26 = this->_stateFrame + 1; this->_stateFrame = iVar26; if (iVar28 == 0x66) { if ((this->_variant != 2) && (iVar26 == 0x11)) { PlaySound(this,0x10a,2.0,2,0,1.0); iVar28 = this->_type; goto LAB_006c5c89; } } else { LAB_006c5c89: if (iVar28 == 0x38c) { bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if (bVar5 != 0) { SoundEffects::PlayWithFartOverride(0x48,1.0,2,0,1.0); } bVar5 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if ((bVar5 != 0) && (this->_dead != 0)) { ProjectileParams::ProjectileParams(&projectileParams); pPVar41 = &projectileParams; projectileParams.FallingAccelModifier = projectileParams.FallingAccelModifier - 0.099; auVar34 = ZEXT416((uint)projectileParams.FallingAccelModifier); uVar11 = 9; pVVar17 = Vector::Vector(&local_2e0,6.0,10.0); FireProjectiles(this,&this->_pos,pVVar17,uVar11,pPVar41); } } else if (iVar28 == 0x38b) { NpcHelper::gideon_update_death(); } else if (iVar28 == 900) { FUN_0041e470(); cVar6 = FUN_004073a0(); if (cVar6 == '\0') { Sprite::RemoveOverlay((Sprite *)&this->_sprite); } } else if (iVar28 == 0x393) { bVar5 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if ((bVar5 != 0) && (this->_dead != 0)) { Color::Color((Color *)local_a0); damageSource = 0; uVar43 = 0; uVar38 = 4; bVar5 = 1; fVar32 = 1.5; pCVar16 = extraout_EAX; source = this; FUN_00435bc0(0,0); tearFlags._l._4_4_ = in_stack_fffffc54; tearFlags._l._0_4_ = in_stack_fffffc50; tearFlags._h._0_4_ = in_stack_fffffc58; tearFlags._h._4_4_ = in_stack_fffffc5c; Game::BombExplosionEffects (g_game,&this->_pos,80.0,tearFlags,pCVar16,(Entity *)source,fVar32,bVar5, CONCAT44(uVar43,uVar38),damageSource); } } else if (iVar28 == 0x391) { bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"); if ((bVar5 != 0) && (local_2a4 = Sprite::GetNullFrame((Sprite *)&this->_sprite,(byte *)"BloodGuide"), local_2a4 != (Entity_Effect *)0x0)) { uVar11 = Random(); Game::Spawn(g_game,1000,2,&this->_pos,&g_vectorZero,(Entity *)0x0,2,uVar11); piVar21 = (int *)FUN_004a2920(); FUN_004563c0(local_2a4); (**(code **)(*piVar21 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); SoundEffects::PlayWithFartOverride(0x1e,1.0,2,0,1.0); pAVar25 = (AnimationState *)Config::GetPillEffects(); iVar28 = AnimationState::GetAnimationLength(pAVar25); iVar26 = ANM2::GetFrame(&this->_sprite); if (iVar28 + -1 <= iVar26) { SoundEffects::PlayWithFartOverride(0x105,1.0,2,0,1.0); uVar11 = Random(); Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar11); FUN_004563c0(local_2a4); uVar42 = 0; uVar43 = 3; uVar38 = 3; KColor::KColor((KColor *)local_60,1.0,0.6,0.0,1.0); pEVar9 = (Entity *)Entity::AddFear((Entity *)&this->_pos,uVar38,uVar43,uVar42); pVVar17 = (Vector *)FUN_0067f2e0(); Entity::SetPositionOffset(pEVar9,pVVar17); sprite = (Sprite *)Entity::GetSprite(pEVar9); Sprite::SetFrame_1(sprite,1); BlendMode::SetMode(&local_38,2,0); sprite = (Sprite *)Entity::GetSprite(pEVar9); src = &local_38; pLVar8 = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(pLVar8->_blendMode,src); } } } else if (iVar28 == 0x390) { if ((this->_variant == 10) && (bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Shoot"), bVar5 != 0)) { Game::ShakeScreen(g_game,0x14); play_sound_with_fart_seed(0x1d,1.0,2,0,0.5); } } else if ((iVar28 == 0x399) && (bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,"Explosion"), bVar5 != 0)) { uVar11 = Random(); pEVar9 = Game::Spawn(g_game,1000,0x90,&this->_pos,&g_vectorZero,(Entity *)0x0,3,uVar11); pVVar17 = Vector::Vector(&local_2e0,0.0,-20.0); Entity::SetPositionOffset(pEVar9,pVVar17); sprite = (Sprite *)Entity::GetSprite(pEVar9); fVar32 = random_float(); Sprite::SetRotation(sprite,fVar32 * 360.0); sprite = (Sprite *)Entity::GetSprite(pEVar9); local_288 = (Room *)0x3fc00000; pVVar17 = Vector::__mul(&g_vectorOne,&local_2e0,(float *)&local_288); Sprite::SetScale(sprite,pVVar17); (**(code **)(*(int *)pEVar9 + 0x40))(0x42a00000); (**(code **)(*(int *)pEVar9 + 0xc))(); fVar32 = random_float(); this = npc; auVar34._0_4_ = fVar32 * 0.2 + 0.9; auVar34._4_12_ = extraout_var_00; play_sound_with_fart_seed(0x1dd,1.25,2,0,auVar34._0_4_); Game::ShakeScreen(g_game,0xe); } } sprite = (Sprite *)&this->_sprite; local_29c = Sprite::GetNullFrame(sprite,(byte *)"BloodGuide"); if (local_29c != (Room *)0x0) { update_blood_guide_gibs(this,(float *)local_29c); bVar5 = Entity::HasEntityFlags((Entity *)this,0x10000); if (((bVar5 == 0) && ((iVar28 = PlayerManager::GetGFuelCount(), 2 < iVar28 || ((bVar5 = Entity::IsType((Entity *)this,0x38c,-1,-1), bVar5 != 0 && ((this->_initSeed & 0xfffffU) == 0xdedbb)))))) && (((this->_initSeed & 1) == 0 || (bVar5 = Entity::IsType((Entity *)this,0x38c,-1,-1), bVar5 != 0)))) { pAVar25 = (AnimationState *)Config::GetPillEffects(); iVar28 = AnimationState::NextEventTrigger(pAVar25,(byte *)"Explosion"); _empty_check_0x34(); if (auVar34._0_4_ + 10.0 <= (float)iVar28) { fVar31 = (float10)Sprite::PlaybackSpeed((Sprite *)&this->_sprite); local_288 = (Room *)((float)fVar31 * this->_speedMultiplier); auVar34 = ZEXT416(local_288); _empty_check_0x34(); if ((float)iVar28 < auVar34._0_4_ + (float)local_288 + 10.0) { uVar11 = Random(); pEVar9 = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0xb,uVar11) ; pAVar30 = (ANM2 *)Entity::GetSprite(pEVar9); std::string::string_from_cstr (local_4c + 0x10,(byte *)"gfx/promo/gfuel/effects/explosion_delayed.anm2"); local_14 = 5; ANM2::Load(pAVar30,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_4c + 0x10); Entity::GetSprite(pEVar9); sprite = (Sprite *)Entity::GetSprite(pEVar9); uVar38 = Sprite::GetDefaultAnimationName(sprite); Sprite::Play(uVar38,0); sprite = (Sprite *)Entity::GetSprite(pEVar9); iVar28 = Isaac::Random(2); Sprite::set_flip_x(sprite,iVar28 == 0); sprite = (Sprite *)Entity::GetSprite(pEVar9); local_288 = (Room *)0x3fc00000; pVVar17 = Vector::operator_mul(&local_2e0,(float *)&local_288,&g_vectorOne); Sprite::SetScale(sprite,pVVar17); (**(code **)(*(int *)pEVar9 + 0xc))(); this = npc; Entity::AddEntityFlags((Entity *)npc,0x10000); } } sprite = (Sprite *)&this->_sprite; } bVar5 = Sprite::IsEventTriggered(sprite,"Explosion"); if (bVar5 != 0) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x10000); if (bVar5 == 0) { fVar32 = this->_size; uVar11 = 2; if (fVar32 < 13.0) { uVar11 = 1; } if ((18.0 <= fVar32) || (30.0 < this->_shadowSize)) { uVar11 = 3; } if ((40.0 <= fVar32) || (50.0 < this->_shadowSize)) { uVar11 = 4; } iVar28 = PlayerManager::GetGFuelCount(); if (iVar28 < 1) { uVar20 = Random(); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,2,&this->_pos,&g_vectorZero,(Entity *)0x0,uVar11,uVar20 ); piVar21 = (int *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); FUN_004563c0(local_29c); (**(code **)(*piVar21 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); cVar6 = (**(code **)(*(int *)this + 0x4c))(); if (((cVar6 != '\0') && (cVar6 = FUN_00435880(4), cVar6 != '\0')) && ((this->_type != 0x3e || (this->_parent == (EntityPtr)0x0)))) { uVar11 = Random(); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,0x4d,&this->_pos,&g_vectorZero,(Entity *)this,0, uVar11); piVar21 = (int *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); (**(code **)(*piVar21 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); } } else { spawn_gfuel_explosion(); cVar6 = (**(code **)(*(int *)this + 0x4c))(); if (((cVar6 != '\0') && (cVar6 = FUN_00435880(4), cVar6 != '\0')) && ((this->_type != 0x3e || (this->_parent == (EntityPtr)0x0)))) { spawn_gfuel_explosion(); } } } if (this->_type == 0x4e) { ProjectileParams::ProjectileParams(&projectileParams); pPVar41 = &projectileParams; uVar11 = 9; projectileParams.HeightModifier = 5.0; projectileParams.Scale = 1.5; projectileParams.FallingAccelModifier = -0.06; projectileParams.FallingSpeedModifier = -2.0; pVVar17 = Vector::Vector(&local_2e0,5.0,14.0); FireProjectiles(this,&this->_pos,pVVar17,uVar11,pPVar41); } bVar5 = Entity::IsType((Entity *)this,0x10d,1,-1); if (bVar5 != 0) { iVar28 = Isaac::Random(0xc); local_2c4 = (Room *)(iVar28 + 0xc); if (0 < (int)local_2c4) { do { pVVar17 = MusicManager::RandomVector(&local_2e0); fVar32 = random_float(); local_288 = (Room *)(fVar32 * 5.0); Vector::__mul(pVVar17,&local_298,(float *)&local_288); local_2c0 = (Entity *)Random(); pVVar17 = Entity::Position((Entity *)this,&local_2e8); pVVar22 = MusicManager::RandomVector(&local_2d0); fVar32 = random_float(); local_2ac = (Room *)(fVar32 * 20.0); pVVar22 = Vector::__mul(pVVar22,&local_300,(float *)&local_2ac); pVVar17 = Vector::__add(pVVar17,&local_2b8,pVVar22); this = npc; uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,0x3b,pVVar17,&local_298,(Entity *)npc,0, (uint)local_2c0); local_2a4 = (Entity_Effect *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); local_2b0 = (Entity *)0x3f800000; pVVar17 = Entity::Position((Entity *)local_2a4,&local_2f0); pVVar22 = Entity::Position((Entity *)this,&local_308); pVVar17 = Vector::__sub(pVVar17,&local_320,pVVar22); pVVar22 = Vector::Vector(&local_33c,local_298.y,-local_298.x); local_2c0 = (Entity *)Vector::Dot(pVVar17,pVVar22); pEVar12 = local_2a4; if ((float)local_2c0 < 0.0) { local_2b0 = (Entity *)&DAT_bf800000; } FUN_004563c0(local_29c); fVar32 = random_float(); Entity_Effect::set_rotation(pEVar12,(fVar32 * 10.0 + 2.0) * (float)local_2b0); iVar28 = Isaac::Random(0xf); Entity_Effect::SetTimeout(pEVar12,iVar28 + 0xf); uVar42 = 0; uVar43 = 0; uVar38 = 0; pcVar3 = *(code **)(*(int *)pEVar12 + 0x3c); fVar32 = random_float(); uVar38 = Color::Color(fVar32 * 0.5 + 0.2,uVar38,uVar43,uVar42); (*pcVar3)(uVar38,0xffffffff,0xff,0,1); (**(code **)(*(int *)local_2a4 + 0xc))(); local_2c4 = (Room *)&local_2c4[-1].field_0x7897; } while (local_2c4 != (Room *)0x0); } } this->_shadowSize = 0.0; Entity::BloodExplode((Entity *)this); sprite = (Sprite *)&this->_sprite; } } if (((this->_type == 0x197) && (bVar5 = Sprite::IsEventTriggered(sprite,&DAT_00b6774c), bVar5 != 0)) && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000000000000000), bVar5 == 0)) { uVar11 = Random(); pEVar9 = Game::Spawn(g_game,1000,100,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar11); if (pEVar9 != (Entity *)0x0) { (**(code **)(*(int *)pEVar9 + 0xc))(); } Game::ShakeScreen(g_game,0x1e); SoundEffects::PlayWithFartOverride(0x10a,1.0,2,0,1.0); } bVar5 = ANM2::IsFinishedImpl((ANM2 *)sprite,&s_empty); if ((bVar5 != 0) && (this->_exists != 0)) { trigger_kill_item_effects(this); } } LAB_006c68c7: if (((this->_state == 0x12) || (this->_state == 0x11)) || (((cVar6 = FUN_006c4a90(), cVar6 != '\0' || (this->_state == 1)) && (this->_dead == 0)))) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x20); if (((bVar5 != 0) || (0 < this->_holdCountdown)) && (this->_friction = this->_friction * 0.01, 0 < this->_holdCountdown)) { bVar5 = Vector::operator_ne(&this->_holdPosition,&g_vectorZero); if (bVar5 != 0) { Vector::operator_assign(&this->_pos,&this->_holdPosition); } } LAB_006c87a7: if (this->_dead == 0) goto LAB_006c87b4; } else { bVar5 = Entity::HasEntityFlags((Entity *)this,0x100); if (bVar5 == 0) { if (this->_decoyTargetTimer < 0xb5) { if (this->_decoyTargetTimer < -0xb4) { this->_decoyTargetTimer = 0; } } else { this->_decoyTargetTimer = -1; } pEVar9 = GetPlayerTarget(this); iVar28 = Entity::Type(pEVar9); if ((iVar28 == 3) && (iVar28 = Entity::Variant(pEVar9), iVar28 == 0x43)) { this->_decoyTargetTimer = this->_decoyTargetTimer + 1; } else if (this->_decoyTargetTimer != 0) { this->_decoyTargetTimer = this->_decoyTargetTimer + -1; } } if ((this->_dead != 0) && (this->_state == 1)) { this->_friction = this->_baseFriction; this->_state = this->_savedState; this->_visible = 1; } if (this->_championRegenTimer == 0) { Entity_NPC_UpdateAI_dispatch(this); } local_2d8 = (Entity *)&this->_sprite; pvVar10 = Sprite::GetNullFrame((Sprite *)local_2d8,(byte *)"OverlayEffect"); if ((pvVar10 == (void *)0x0) || (*(char *)((int)pvVar10 + 0xc) != '\0')) { local_281 = 1; } else { local_281 = 0; } if ((((this->_championColorIdx == 2) || (this->_championColorIdx == 0x19)) && (local_281 != 0)) && ((bVar5 = Entity::IsFrame((Entity *)this,7,0), bVar5 != 0 && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000000), bVar5 == 0)))) { uVar11 = Random(); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,0x17,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar11); pEVar12 = (Entity_Effect *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); Entity_Effect::SetTimeout(pEVar12,0x1e); (**(code **)(*(int *)pEVar12 + 0xc))(); } if (this->_championColorIdx == 0x18) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(pRVar13); if ((bVar5 == 0) && (local_281 != 0)) { bVar5 = Entity::IsFrame((Entity *)this,3,0); if (bVar5 != 0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80e10) && (_Init_thread_header(&DAT_00c80e10), DAT_00c80e10 == -1)) { local_14 = 6; Color::Color(0x3f800000,0,0,0,0,0x3e828f5c,0x3e24dd2f,0x3e0c49ba); local_14 = 0xffffffff; _Init_thread_footer(&DAT_00c80e10); } fVar32 = random_float(); pEVar12 = MakeSplat(this,fVar32 * 0.5 + 0.2); (**(code **)(*(int *)pEVar12 + 0x3c))(&DAT_00c80e14,0xffffffff,0xff,0,1); } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); local_2ac = pRVar13; local_2c0 = (Entity *)Room::GetGridIndex(pRVar13,&this->_pos); if (local_2c0 != (Entity *)this->_lastGridIndex) { iVar28 = Isaac::Random(4); if ((iVar28 == 0) && (-1 < this->_lastGridIndex)) { local_288 = (Room *)Room::GetGridEntity(pRVar13,this->_lastGridIndex); uVar11 = Room::GetGridCollision(pRVar13,this->_lastGridIndex); if (uVar11 == 0) { if (local_288 != (Room *)0x0) { GridEntity::GetType(); cVar6 = is_grid_type_floor_special(); if (cVar6 != '\0') goto LAB_006c6bee; } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar11 = Random(); Room::SpawnGridEntity(pRVar13,this->_lastGridIndex,0xe,0,uVar11,0); poop = (GridEntity_Poop *)Room::GetGridEntity(local_2ac,this->_lastGridIndex); if ((poop != (GridEntity_Poop *)0x0) && (iVar28 = GridEntity::GetType(), iVar28 == 0xe)) { GridEntity_Poop::ReduceSpawnRate(poop); FUN_006b8580(1); FUN_006b8310(0); } } } LAB_006c6bee: this->_lastGridIndex = (int)local_2c0; } } } if (this->_championColorIdx == 6) { this->_isInvicible = 0; Entity::ClearEntityFlags((Entity *)this,1); Level::GetCurrentRoom((Level *)g_game); local_2b0 = (Entity *)Room::GetEntities(); puVar29 = (undefined1 *)0x0; local_29c = (Room *)0x0; iVar28 = EntityList::Size(); if (iVar28 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(puVar29); pEVar9 = (Entity *)*puVar14; bVar5 = Entity::IsEnemy(pEVar9); if (((bVar5 != 0) && (cVar6 = (**(code **)(*(int *)pEVar9 + 0x48))(), cVar6 != '\0')) && ((iVar28 = __RTDynamicCast(pEVar9,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), *(char *)(iVar28 + 0xc63) == '\0' || (*(int *)(iVar28 + 0xc64) != 6)))) { this->_isInvicible = 1; Entity::AddEntityFlags((Entity *)this,1); } puVar29 = &local_29c->field_0x1; local_29c = (Room *)puVar29; puVar15 = (undefined1 *)EntityList::Size(); } while (puVar29 < puVar15); } } if ((this->_championColorIdx == 9) || (this->_type == 0xfc)) { switch(this->_flickerState) { case 0: iVar28 = this->_flickerTimer; this->_flickerTimer = iVar28 + -1; if (iVar28 < 0) { this->_flickerState = 1; } break; case 1: if (this->_flickerAlpha <= 0.0) { this->_flickerState = 3; LAB_006c6d40: iVar28 = Isaac::Random(0x1e); this->_flickerTimer = iVar28 + 0x3c; } else { this->_flickerAlpha = this->_flickerAlpha - 0.05; } break; case 2: if (1.0 <= this->_flickerAlpha) { this->_flickerState = 0; goto LAB_006c6d40; } this->_flickerAlpha = this->_flickerAlpha + 0.05; break; case 3: iVar28 = this->_flickerTimer; this->_visible = 0; this->_flickerTimer = iVar28 + -1; if (iVar28 < 0) { this->_visible = 1; this->_flickerState = 2; } } pCVar16 = (ColorMod *)Sprite::Color((Sprite *)&this->_sprite); Color::operator_assign((Color *)local_a0,pCVar16); Font::SetLineHeightModifier((Font *)local_a0,this->_flickerAlpha); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)local_a0); } iVar28 = this->_championColorIdx; if (iVar28 == 8) { this->_entityGridCollisionClass = 3; } else if ((((iVar28 == 10) || (iVar28 == 0x19)) && (this->_championTimer = this->_championTimer + -1, this->_championTimer < 1)) && ((local_281 != 0 && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000000), bVar5 == 0)))) { local_29c = (Room *)Vector::Length(&this->_velocity); local_300.x = g_vectorZero.x; local_300.y = g_vectorZero.y; if (0.0 < (float)local_29c) { pVVar17 = Vector::__div(&this->_velocity,&local_2e0,(float *)&local_29c); Vector::operator_assign(&local_300,pVVar17); iVar28 = Isaac::Random(0x14); this->_championTimer = iVar28 + 0x28; ProjectileParams::ProjectileParams(&projectileParams); pPVar41 = &projectileParams; projectileParams.FallingAccelModifier = 0.3; uVar11 = 0; projectileParams.FallingSpeedModifier = -5.0; local_288 = (Room *)0x40a00000; pVVar17 = Vector::__mul(&local_300,&local_2e0,(float *)&local_288); FireProjectiles(this,&this->_pos,pVVar17,uVar11,pPVar41); PlaySound(this,0xb2,1.0,2,0,1.0); } } if (((this->_championColorIdx == 0xb) || (this->_championColorIdx == 0x19)) && (local_281 != 0)) { Level::GetCurrentRoom((Level *)g_game); local_2c4 = (Room *)Room::GetEntities(); puVar29 = (undefined1 *)0x0; local_2b0 = (Entity *)0x0; iVar28 = EntityList::Size(); if (iVar28 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(puVar29); pEVar9 = (Entity *)*puVar14; iVar28 = Entity::Type(pEVar9); if ((iVar28 == 1) || (iVar28 = Entity::Type(pEVar9), iVar28 == 2)) { pVVar17 = Entity::Position(pEVar9,&local_2e0); Vector::__sub(&this->_pos,&local_298,pVVar17); Vector::Normalize(&local_298); local_2a4 = (Entity_Effect *)0x3f666666; iVar28 = Entity::Type(pEVar9); if (iVar28 == 1) { local_2a4 = (Entity_Effect *)0x3f4ccccd; } pVVar17 = Entity::Position(pEVar9,&local_2e8); pVVar17 = Vector::__sub(&this->_pos,&local_2d0,pVVar17); fVar32 = Vector::Length(pVVar17); local_2ac = (Room *)0x0; local_288 = (Room *)(((300.0 - fVar32) * (float)local_2a4) / 300.0); std::max(); pfVar18 = (float *)std::min(); Vector::operator_mul_assign(&local_298,pfVar18); Entity::AddVelocity_divided(pEVar9,&local_298,0); } puVar29 = &local_2b0->field_0x1; local_2b0 = (Entity *)puVar29; puVar15 = (undefined1 *)EntityList::Size(); } while (puVar29 < puVar15); } } iVar28 = this->_championColorIdx; if (iVar28 == 0xc) { if (this->_dead == 0) { if (this->_championRegenTimer != 0) goto LAB_006c7154; } else if (this->_championRegenTimer == 0) { this->_championRegenCount = this->_championRegenCount + 1; this->_championRegenTimer = 1; this->_dead = 0; this->_health = 10.0; this->_isInvicible = 0; this->_entityCollisionClass = 4; if (this->_entityGridCollisionClass == 0) { this->_entityGridCollisionClass = 3; } this->_aiCallFlags = this->_aiCallFlags << 0x10; } else { LAB_006c7154: this->_friction = this->_friction * 0.8; pRVar13 = (Room *)Entity::GetHitPointsLost((Entity *)this); local_288 = pRVar13; if (0 < (int)pRVar13) { do { this->_championRegenTimer = this->_championRegenTimer + 1; regenTimer = this->_championRegenTimer; if ((regenTimer < 6) || ((0x50 < regenTimer && (regenTimer < 0x56)))) { fVar31 = (float10)Scale(this); SetScale(this,(float)(fVar31 * (float10)0.5)); if ((4 < this->_championRegenTimer) && ((int)this->_championRegenTimer - (int)local_288 < 5)) { std::string::string_from_cstr(local_4c + 0x10,(byte *)"gfx/024.000_Globin.anm2"); local_14 = 7; ANM2::Load(&this->_sprite,(std_string *)(local_4c + 0x10),1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_4c + 0x10); ANM2::Play(&this->_sprite,(byte *)"ReGenChamp",1); LAB_006c7308: (**(code **)(*(int *)this + 0x60))(); } } else if ((regenTimer < 10) || (0x55 < regenTimer)) { fVar31 = (float10)Scale(this); SetScale(this,(float)(fVar31 * (float10)2.0)); if (0x59 < this->_championRegenTimer) { load_graphics(this,1); this->_state = 1; this->_championRegenTimer = 0; this->_friction = this->_baseFriction; this->_aiCallFlags = (uint)*(ushort *)((int)&this->_aiCallFlags + 2); iVar28 = this->_type; if ((((iVar28 == 0x22) || (iVar28 == 0x56)) || (iVar28 == 0x36)) || ((iVar28 == 0xf6 || (iVar28 == 0x1d)))) { Vector::operator_assign(&this->_targetPosition,&g_vectorZero); } else if (iVar28 == 0x379) { Vector::operator_assign(&this->_targetPosition,&g_vectorZero); Entity::ClearEntityFlags((Entity *)this,0x800000011); this->_isInvicible = 0; PathFinder::Reset((PathFinder *)&this->_pathfinder); goto LAB_006c7308; } PathFinder::Reset((PathFinder *)&this->_pathfinder); goto LAB_006c7308; } } pRVar13 = (Room *)&pRVar13[-1].field_0x7897; } while (pRVar13 != (Room *)0x0); } } LAB_006c8133: pEVar9 = (Entity *)&this->_sprite; } else { if (iVar28 != 0xe) { if ((iVar28 == 0xf) || (iVar28 == 0x10)) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); fVar32 = sinf_wrapper((float)iVar28 * 0.1); local_2b0 = (Entity *)Math::clamp(0.0,1.0,fVar32 + 0.5); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); fVar32 = sinf_wrapper((float)iVar28 * 0.3); fVar32 = Math::clamp(0.0,1.0,fVar32 + 0.5); iVar28 = this->_championColorIdx; Color::Color(&local_f8); pCVar16 = Color::Lerp(&local_150,(ColorMod *)(&DAT_00c354d4 + iVar28 * 0x40),to_00,fVar32) ; pEVar9 = (Entity *)&this->_sprite; Sprite::SetColor((Sprite *)pEVar9,pCVar16); Color::Color(&DAT_00c354c0 + this->_championColorIdx * 0x40); fVar31 = (float10)Color::B(); local_298.y = (float)fVar31; fVar31 = (float10)Color::G(); local_2b8.y = (float)fVar31; fVar31 = (float10)Color::R(); local_2f0.y = (float)fVar31; uVar38 = Color::Color(1.0 - (float)local_2b0); Entity::SetColor(pEVar9,uVar38); if ((this->_championColorIdx != 0x10) || (0.4 <= (float)local_2b0)) goto LAB_006c8136; local_2b8.y = assert_lerp_range((float)local_2b0,0.2,0.4,1.0,0.0,1); Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); pVVar17 = &this->_pos; local_2f0.y = (float)pVVar17; EntityList::QueryRadius(entityList,(EntityList_EL *)local_318,pVVar17,100.0,4); local_14 = 9; iVar28 = EntityList::Size(); if (iVar28 != 0) { uVar11 = 0; do { puVar14 = (undefined4 *)std::vector::operator_index(uVar11); iVar28 = Entity::Type((Entity *)*puVar14); if (iVar28 == 2) { puVar14 = (undefined4 *)std::vector::operator_index(uVar11); pVVar22 = Entity::Position((Entity *)*puVar14,&local_54); Vector::__sub(pVVar22,&local_2e8,pVVar17); puVar14 = (undefined4 *)std::vector::operator_index(uVar11); pEVar9 = (Entity *)*puVar14; fVar32 = Vector::LengthSquared(&local_2e8); fVar32 = 1.0 - fVar32 / 10000.0; local_298.y = fVar32; pVVar17 = Vector::Resized(&local_2e8,&local_2f8,(fVar32 + fVar32) * local_2b8.y); Entity::AddVelocity_divided(pEVar9,pVVar17,0); pVVar17 = (Vector *)local_2f0.y; } uVar11 = uVar11 + 1; uVar20 = EntityList::Size(); } while (uVar11 < uVar20); this = npc; } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(local_318); } else if (iVar28 == 0x14) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); fVar32 = sinf_wrapper((float)iVar28 * 0.1); local_288 = (Room *)Math::clamp(0.0,1.0,fVar32 + 0.5); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); fVar32 = sinf_wrapper((float)iVar28 * 0.3); fVar32 = Math::clamp(0.0,1.0,fVar32 + 0.5); iVar28 = this->_championColorIdx; Color::Color(&local_f8); pCVar16 = Color::Lerp((ColorMod *)local_cc,(ColorMod *)(&DAT_00c354d4 + iVar28 * 0x40),to, fVar32); pEVar9 = (Entity *)&this->_sprite; Sprite::SetColor((Sprite *)pEVar9,pCVar16); Color::Color(&DAT_00c354c0 + this->_championColorIdx * 0x40); fVar31 = (float10)Color::B(); local_2ac = (Room *)(float)fVar31; fVar31 = (float10)Color::G(); local_2c0 = (Entity *)(float)fVar31; fVar31 = (float10)Color::R(); local_2d8 = (Entity *)(float)fVar31; uVar38 = Color::Color(1.0 - (float)local_288); Entity::SetColor(pEVar9,uVar38); bVar5 = Entity::IsFrame((Entity *)this,0x1e,this->_index); if (bVar5 == 0) goto LAB_006c8136; Level::GetCurrentRoom((Level *)g_game); local_290 = (Entity *)Room::GetEntities(); local_281 = 0; pAVar30 = (ANM2 *)0x0; local_2a0 = (ANM2 *)0x0; iVar28 = EntityList::Size(); if (iVar28 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); bVar5 = Entity::IsActiveEnemy((Entity *)*puVar14,0); if (bVar5 != 0) { piVar21 = (int *)std::vector::operator_index(pAVar30); if ((Entity_NPC *)*piVar21 != this) { puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); pEVar9 = (Entity *)*puVar14; local_2a5 = Entity::HasEntityFlags((Entity *)this,0x20000100); bVar5 = Entity::HasEntityFlags(pEVar9,0x20000000); pAVar30 = local_2a0; if (bVar5 == local_2a5) { puVar14 = (undefined4 *)std::vector::operator_index(local_2a0); iVar28 = __RTDynamicCast(*puVar14,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor, 0); if (*(int *)(iVar28 + 0xc64) != 0x14) { puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); fVar31 = (float10)Entity::HitPoints((Entity *)*puVar14); local_2ac = (Room *)(float)fVar31; std::vector::operator_index(pAVar30); fVar31 = (float10)Entity::MaxHitPoints(); local_288 = (Room *)(float)fVar31; if ((float)local_2ac < (float)local_288) { puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); bVar5 = Entity::IsType((Entity *)*puVar14,0x325,-1,-1); if (bVar5 == 0) { puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); pEVar9 = (Entity *)*puVar14; puVar14 = (undefined4 *)std::vector::operator_index(local_2a0); fVar31 = (float10)Entity::HitPoints((Entity *)*puVar14); local_2c0 = (Entity *)(float)(fVar31 + (float10)20.0); std::vector::operator_index(local_2a0); fVar31 = (float10)Entity::MaxHitPoints(); local_2d8 = (Entity *)(float)fVar31; pfVar18 = (float *)std::min(); Entity::SetField380(pEVar9,*pfVar18); uVar11 = Random(); puVar14 = (undefined4 *)std::vector::operator_index(local_2a0); pVVar17 = Entity::Position((Entity *)*puVar14,&local_36c); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,0x31,pVVar17,&g_vectorZero,(Entity *)0x0, 0,uVar11); __RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); pAVar30 = local_2a0; puVar14 = (undefined4 *)std::vector::operator_index(local_2a0); pVVar17 = Entity::Position((Entity *)*puVar14,&local_374); local_2a4 = (Entity_Effect *)&this->_pos; Vector::__sub(pVVar17,&local_2e8,(Vector *)local_2a4); local_288 = (Room *)0x3dcccccd; Vector::__mul(&local_2e8,&local_2d0,(float *)&local_288); local_288 = (Room *)Vector::Length(&local_2d0); if (4.0 < (float)local_288) { Vector::Resize(&local_2d0,4.0); } local_2c4 = (Room *)0xc; local_2ac = (Room *)&DAT_00000004; fVar32 = Vector::Length(&local_2e8); pRVar13 = (Room *)(fVar32 / 20.0); local_288 = pRVar13; FUN_00407140(); local_2b0 = (Entity *)(int)(float)pRVar13; std::max(); pfVar18 = (float *)std::min(); local_2b8.y = *pfVar18; if (0 < (int)local_2b8.y) { local_2c4 = (Room *)&this->_posOffset; local_298.y = (float)(int)&((Entity_Player *)local_2b8.y)->field_0x1; local_2f0.y = (float)(Vector *)0x0; fVar32 = (float)(int)&((Entity_Player *)local_2b8.y)->field_0x1; do { local_2f0.y = (float)((int)&((Vector *)local_2f0.y)->x + 1); local_2ac = (Room *)((float)(int)local_2f0.y / fVar32); local_288 = local_2ac; puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); pVVar17 = Entity::Position((Entity *)*puVar14,&local_344); pVVar17 = vector_lerp(&local_34c,(Vector *)local_2a4,pVVar17,0, (float)local_288); pVVar22 = MusicManager::RandomVector(&local_354); local_324 = random_float(); pVVar22 = Vector::__mul(pVVar22,&local_35c,&local_324); local_33c.y = 15.0; pVVar22 = Vector::__mul(pVVar22,&local_364,&local_33c.y); Vector::__add(pVVar17,&local_2e0,pVVar22); uVar11 = Random(); fVar32 = random_float(); local_320.y = fVar32 * 0.5 + 0.5; pVVar17 = Vector::__mul(&local_2d0,&local_32c,&local_320.y); pEVar9 = Game::Spawn(g_game,1000,0x6f,&local_2e0,pVVar17,(Entity *)0x0 ,0,uVar11); pcVar3 = *(code **)(*(int *)pEVar9 + 0x3c); uVar38 = Color::Color(0x3f800000,0,0,0,0,0x3e99999a,0,0); (*pcVar3)(uVar38,0xffffffff,0xff,0,1); pVVar17 = Vector::__mul(&g_vectorOne,&local_334,(float *)&local_2ac); fVar32 = random_float(); local_308.y = fVar32 * 0.3 + 0.3; pVVar17 = Vector::__mul(pVVar17,(Vector *)(local_318 + 8),&local_308.y ); Entity::SetSpriteScale(pEVar9,pVVar17); sprite = (Sprite *)Entity::GetSprite((Entity *)npc); iVar28 = Sprite::Scale(sprite); pVVar17 = Vector::Vector(&local_2f8,0.0,*(float *)(iVar28 + 4) * -16.0 ); pVVar17 = Vector::__add((Vector *)local_2c4,&local_54,pVVar17); Entity::SetPositionOffset(pEVar9,pVVar17); pAVar30 = local_2a0; fVar32 = local_298.y; } while ((int)local_2f0.y < (int)local_2b8.y); } local_281 = 1; puVar14 = (undefined4 *)std::vector::operator_index(pAVar30); pcVar3 = *(code **)(*(int *)*puVar14 + 0x3c); uVar38 = Color::Color(0x3f800000,0,0,0,0,0x3f333333,0,0); (*pcVar3)(uVar38,8,0xff,1,1); pAVar30 = local_2a0; this = npc; } } } } } } pAVar30 = (ANM2 *)((pAVar30->_filename)._buf + 1); local_2a0 = pAVar30; pAVar19 = (ANM2 *)EntityList::Size(); } while (pAVar30 < pAVar19); if (local_281 != 0) { pcVar3 = *(code **)(*(int *)this + 0x3c); uVar38 = Color::Color(0x3f800000,0,0,0,0,0x3f333333,0,0); (*pcVar3)(uVar38,8,0xff,1,1); play_sound_with_fart_seed(0x9d,1.0,2,0,1.0); } } } else if (iVar28 == 0x16) { bVar5 = Entity::IsFrame((Entity *)this,0x1e,this->_index); if (bVar5 != 0) { Level::GetCurrentRoom((Level *)g_game); local_2a0 = (ANM2 *)Room::GetEntities(); uVar11 = 0; iVar28 = EntityList::Size(); if (iVar28 != 0) { do { puVar14 = (undefined4 *)std::vector::operator_index(uVar11); bVar5 = Entity::IsActiveEnemy((Entity *)*puVar14,0); if (bVar5 != 0) { puVar14 = (undefined4 *)std::vector::operator_index(uVar11); cVar6 = (**(code **)(*(int *)*puVar14 + 0x4c))(); if ((cVar6 == '\0') && (piVar21 = (int *)std::vector::operator_index(uVar11), (Entity_NPC *)*piVar21 != this)) { puVar14 = (undefined4 *)std::vector::operator_index(uVar11); piVar21 = (int *)__RTDynamicCast(*puVar14,0, &IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC:: RTTI_Type_Descriptor,0); if ((piVar21 != (int *)0x0) && (*(char *)((int)piVar21 + 0xc63) == '\0')) { *(undefined1 *)((int)piVar21 + 0xc63) = 1; piVar21[0x319] = 1; (**(code **)(*piVar21 + 0x60))(); } } } uVar11 = uVar11 + 1; uVar20 = EntityList::Size(); } while (uVar11 < uVar20); } } } else if ((iVar28 == 0x15) && (0 < this->_championTimer)) { this->_championTimer = this->_championTimer + -1; } goto LAB_006c8133; } Isaac::GetRenderPosition(&local_298,&this->_pos,1); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar17 = (Vector *)Room::GetRenderSurfaceTopLeft(pRVar13); Vector::operator__(&local_298,pVVar17); Level::GetCurrentRoom((Level *)g_game); FUN_004177e0(&local_2e8); local_14 = 8; piVar21 = (int *)EntityPtr::Ref(); pcVar3 = *(code **)(*piVar21 + 0x2c); uVar38 = __ftoui3(); uVar38 = __ftoui3(uVar38); (*pcVar3)(local_60,uVar38); local_14 = 0xffffffff; FUN_0041c710(); pEVar9 = local_2d8; pCVar16 = (ColorMod *)Sprite::Color((Sprite *)local_2d8); Color::operator_assign(&local_17c,pCVar16); local_288 = (Room *)(local_58 * 0.9); fVar31 = (float10)Color::BO(); local_2ac = (Room *)(float)fVar31; local_2c0 = (Entity *)Math::lerp((float)local_2ac,(float)local_288,0.3,0); local_288 = (Room *)((float)local_60._4_4_ * 0.9); fVar31 = (float10)Color::GO(); local_2ac = (Room *)(float)fVar31; local_2d8 = (Entity *)Math::lerp((float)local_2ac,(float)local_288,0.3,0); local_288 = (Room *)((float)local_60._0_4_ * 0.9); fVar31 = (float10)Color::RO(); local_2ac = (Room *)(float)fVar31; fVar32 = Math::lerp((float)local_2ac,(float)local_288,0.3,0); pCVar16 = (ColorMod *)Color::Color(0x3f800000,fVar32,local_2d8,local_2c0); Sprite::SetColor((Sprite *)pEVar9,pCVar16); this = npc; } LAB_006c8136: if (this->_championColorIdx == 0x19) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); hsv_to_rgb(&local_38,((float)(iVar28 % 0x5a) * 360.0) / 90.0,1.0,1.0,1.0); uVar38 = Color::Color(0x3f800000); Entity::SetColor(pEVar9,uVar38); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000000); if ((bVar5 != 0) && (this->_shrinkCountdown - 1U < 0x3b)) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); fVar32 = sinf_wrapper((float)iVar28 * 0.1); Math::clamp(0.0,1.0,fVar32 + 0.5); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); fVar32 = sinf_wrapper((float)iVar28 * 0.3); fVar32 = Math::clamp(0.0,1.0,fVar32 + 0.5); local_298.y = fVar32; Color::Color(0x3f800000,0x3c,0x3c,0x3c); fVar32 = local_298.y; Color::Color(&local_124); pCVar16 = Color::Lerp(&local_254,(ColorMod *)local_a0,to_01,fVar32); Sprite::SetColor((Sprite *)pEVar9,pCVar16); } Level::GetCurrentRoom((Level *)g_game); cVar6 = FUN_006b8440(); if (cVar6 != '\0') { if ((((this->_dead == 0) && (this->_isBoss == 0)) && (bVar5 = Entity::IsFlying((Entity *)this), bVar5 == 0)) && (this->_entityGridCollisionClass != 6)) { fVar32 = 1.4013e-45; } else { fVar32 = 0.0; } fVar27 = 0.0; if (this->_type != 0x376) { fVar27 = fVar32; } local_298.y = fVar27; pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); if ((uint)(iVar28 + this->_index) % 0x3c == 0) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); if ((900 < iVar28) && (local_298.y._0_1_ != '\0')) { Level::GetCurrentRoom((Level *)g_game); iVar28 = GridEntity::GetVariant(); if (iVar28 == 1) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::IsClear(pRVar13); if (bVar5 == 0) { Game::GetPlayerManager(g_game); cVar6 = FUN_009be9c0(); if (cVar6 == '\0') { pRVar13 = (Room *)0x0; local_29c = (Room *)0x0; iVar28 = Game::GetNumPlayers(g_game); if (iVar28 != 0) { do { player = Game::GetPlayer(g_game,(uint)pRVar13); local_298.y = (float)player; bVar5 = Entity::IsFlying((Entity *)player); if (bVar5 == 0) { bVar5 = 1; pVVar17 = Entity::Position((Entity *)local_298.y,&local_54); bVar5 = NPCAI_Pathfinder::HasPathToPos(&this->_pathfinder,pVVar17,bVar5); if (bVar5 != 0) goto LAB_006c8453; pRVar13 = local_29c; } pRVar13 = (Room *)&pRVar13->field_0x1; local_29c = pRVar13; puVar29 = (undefined1 *)Game::GetNumPlayers(g_game); } while (pRVar13 < puVar29); } if (this->_isUnreachableOnce == 0) { this->_isUnreachableOnce = 1; } else { this->_canShutDoors = 0; } } } } } } } LAB_006c8453: if (this->_dead != 0) { if (this->_exists != 0) { PlayDeathEffects(); bVar5 = Entity::HasEntityFlags((Entity *)this,0x400); if (bVar5 != 0) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x40000000000); if (bVar5 == 0) { local_2b8.y = (float)&this->_pos; player = Game::GetNearestPlayerEx((Vector *)local_2b8.y,1,0,1); if ((player == (Entity_Player *)0x0) || (iVar28 = Entity_Player::GetHealthType(player), iVar28 != 3)) { iVar28 = Isaac::Random(3); local_2a4 = (Entity_Effect *)(iVar28 + 1); } else { local_2a4 = (Entity_Effect *)Isaac::Random(3); } if (0 < (int)local_2a4) { do { uVar11 = Random(); pVVar17 = MusicManager::RandomVector(&local_2f8); fVar32 = random_float(); local_298.y = fVar32 * 3.0; pVVar17 = Vector::__mul(pVVar17,(Vector *)(local_318 + 8),&local_298.y); Game::Spawn(g_game,5,0x14,(Vector *)local_2b8.y,pVVar17,(Entity *)0x0,1,uVar11); local_2a4 = (Entity_Effect *)((int)&local_2a4[-1]._hitList._capacity + 3); } while (local_2a4 != (Entity_Effect *)0x0); local_2a4 = (Entity_Effect *)0x0; this = npc; } } } bVar5 = Entity::HasEntityFlags((Entity *)this,0x40000); if (bVar5 == 0) { Entity_Pickup::Update((Entity_Pickup *)this); uVar11 = 0; iVar28 = Game::GetNumPlayers(g_game); if (iVar28 != 0) { do { player = Game::GetPlayer(g_game,uVar11); Entity_Player::trigger_npc_death(player,(Entity *)this); uVar11 = uVar11 + 1; uVar20 = Game::GetNumPlayers(g_game); } while (uVar11 < uVar20); } } FUN_006d5350(); if ((this->_isBoss == 0) && (this->_type != 0x1c)) { trigger_kill_item_effects(this); } else { this->_state = 0x12; this->_stateFrame = 0; } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar5 = Room::is_type_16(pRVar13); if ((bVar5 != 0) && (bVar5 = Entity::IsFlying((Entity *)this), bVar5 == 0)) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntityFromPos(pRVar13,&this->_pos); if ((gridEntity != (GridEntity *)0x0) && (iVar28 = GridEntity::GetType(), iVar28 == 0x13)) { (this->_velocity).y = (this->_velocity).y * 0.5; fVar32 = (this->_velocity).x; if (fVar32 <= 0.0) { if (fVar32 < 0.0) { fVar32 = Vector::Length(&this->_velocity); local_298.y = fVar32; (this->_velocity).x = -fVar32; } } else { fVar32 = Vector::Length(&this->_velocity); (this->_velocity).x = fVar32; } game = g_game; (this->_velocity).y = 0.0; pRVar13 = (Room *)Level::GetCurrentRoom((Level *)game); pVVar17 = Vector::Vector(&local_2f8,0.0,(this->_sizeMulti).y * this->_size + 0.5); pVVar17 = Vector::__add(&this->_pos,(Vector *)(local_318 + 8),pVVar17); local_2d0.x = pVVar17->x; local_2d0.y = pVVar17->y; iVar28 = Room::GetGridCollisionAtPos(pRVar13,*pVVar17); if (iVar28 != 4) { bVar5 = 0; pVVar17 = Vector::Vector(&local_334,0.0,3.5); Entity::AddVelocity_divided((Entity *)this,pVVar17,bVar5); } } } } goto LAB_006c87a7; } LAB_006c87b4: if ((((this->_state != 0x12) && (this->_state != 0x11)) && (bVar5 = Entity::IsFriendly((Entity *)this), bVar5 == 0)) && (bVar5 = Entity::IsVulnerableEnemy((Entity *)this,(Entity *)0x0), bVar5 != 0)) { local_2d8 = (Entity *)0x4e6e6b28; puVar29 = (undefined1 *)0x0; local_2b0 = (Entity *)0x45c80000; local_2c4 = (Room *)0x0; local_288 = (Room *)0x0; local_29c = (Room *)0x0; local_2ac = (Room *)0x0; local_2c0 = local_2d8; iVar28 = Game::GetNumPlayers(g_game); if (iVar28 != 0) { do { pRVar13 = (Room *)Game::GetPlayer(g_game,(uint)puVar29); FUN_0042a020(); bVar5 = Entity_Player::HasCollectible((Entity_Player *)pRVar13,0x14f,0); local_298.y._0_1_ = bVar5; FUN_006da770(&local_2e0,0); FUN_006da710(local_298.y); guard_check_icall(); bVar5 = Entity_Player::HasTrinket((Entity_Player *)pRVar13,0x44,0); local_2b8.y = (float)CONCAT31(local_2b8.y._1_3_,bVar5); FUN_006da770(&local_2e8,1); FUN_006da710(local_2b8.y); guard_check_icall(); bVar5 = Entity_Player::HasCollectible((Entity_Player *)pRVar13,0x2b8,0); local_2f0.y = (float)CONCAT31(local_2f0.y._1_3_,bVar5); FUN_006da770(&local_2d0,2); FUN_006da710(local_2f0.y); guard_check_icall(); cVar6 = std::bitset<8>::any(); if (cVar6 != '\0') { pVVar17 = Entity::Position((Entity *)pRVar13,&local_32c); local_290 = (Entity *)Vector::DistanceSquared(pVVar17,&this->_pos); FUN_006da770(&local_300,0); local_28c = (Entity_Effect *)((uint)local_28c | 0x10); cVar6 = FUN_006da6f0(); if ((cVar6 == '\0') || (local_281 = '\x01', (float)local_2b0 <= (float)local_290)) { local_281 = '\0'; } if (((uint)local_28c & 0x10) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xffffffef); guard_check_icall(); } if (local_281 != '\0') { local_2c4 = pRVar13; local_2b0 = local_290; } FUN_006da770(&local_308,1); local_28c = (Entity_Effect *)((uint)local_28c | 0x20); cVar6 = FUN_006da6f0(); if ((cVar6 == '\0') || (local_281 = '\x01', (float)local_2d8 <= (float)local_290)) { local_281 = '\0'; } if (((uint)local_28c & 0x20) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xffffffdf); guard_check_icall(); } if (local_281 != '\0') { local_2d8 = local_290; local_288 = pRVar13; } FUN_006da770(&local_320,2); local_14 = 10; local_2a4 = (Entity_Effect *)((uint)local_28c | 0x40); local_28c = local_2a4; cVar6 = FUN_006da6f0(); if ((cVar6 == '\0') || (auVar34 = ZEXT416(local_2c0), (float)local_2c0 <= (float)local_290)) { LAB_006c8ae8: local_281 = 0; } else { FUN_007d4340(); auVar35._4_12_ = auVar34._4_12_; auVar35._0_4_ = auVar34._0_4_ * 70.0 + this->_size; FUN_006daa90(); local_281 = 1; if (auVar35._0_8_ <= (double)(float)local_290) goto LAB_006c8ae8; } local_14 = 0xffffffff; if (((uint)local_28c & 0x40) != 0) { local_28c = (Entity_Effect *)((uint)local_28c & 0xffffffbf); guard_check_icall(); } if (local_281 != 0) { local_2c0 = local_290; local_29c = pRVar13; } } puVar29 = &local_2ac->field_0x1; local_2ac = (Room *)puVar29; puVar15 = (undefined1 *)Game::GetNumPlayers(g_game); } while (puVar29 < puVar15); if ((local_2c4 != (Room *)0x0) && (iVar28 = Isaac::Random(3), iVar28 == 0)) { pVVar17 = Entity::Position((Entity *)local_2c4,&local_32c); pVVar17 = Vector::__sub(&this->_pos,&local_364,pVVar17); fVar32 = sqrtf((float)local_2b0); local_298.y = 80.0 - fVar32; fVar32 = random_float(); this = npc; local_2b8.y = fVar32 * local_298.y * 0.1; local_298.y = Vector::Length(&npc->_velocity); pVVar17 = Vector::Resized(pVVar17,&local_35c,local_298.y * local_2b8.y * 0.2 + 0.05); Vector::operator_add_assign(&this->_velocity,pVVar17); } pRVar13 = local_288; if ((local_288 != (Room *)0x0) && (iVar28 = Isaac::Random(3), iVar28 == 0)) { pVVar17 = Entity::Position((Entity *)pRVar13,&local_354); pVVar17 = Vector::__sub(pVVar17,&local_34c,&this->_pos); pVVar17 = Vector::Resized(pVVar17,&local_344,0.5); Vector::operator_add_assign(&this->_velocity,pVVar17); } pRVar13 = local_29c; if (local_29c != (Room *)0x0) { iVar28 = EntityPtr::Ref(); if (iVar28 == 0) { uVar11 = Random(); pEVar9 = Game::Spawn(g_game,1000,0x13,&this->_pos,&g_vectorZero,(Entity *)pRVar13,3, uVar11); Entity::SetTarget(pEVar9,(Entity *)this); Entity::SetParent(pEVar9,(Entity *)local_29c); (**(code **)(*(int *)pEVar9 + 0x40))(0x40600000); (**(code **)(*(int *)pEVar9 + 0xc))(); EntityPtr::Set((EntityPtr *)&this[1].field_0x4,pEVar9); } iVar28 = EntityPtr::Ref(); if (iVar28 != 0) { pEVar12 = (Entity_Effect *)EntityPtr::Ref(); Entity_Effect::set_state(pEVar12,1); } } } } } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetFrameCount(pRVar13); if ((iVar28 == 0) && (bVar5 = Entity::IsVulnerableEnemy((Entity *)this,(Entity *)0x0), bVar5 != 0) ) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); local_2b8.y = (float)PlayerManager::FirstCollectibleOwner(playerManager,0x15e,(RNG **)0x0,0); if ((Entity_Player *)local_2b8.y != (Entity_Player *)0x0) { ::EntityRef::constructor((EntityRef *)local_4c,(Entity *)local_2b8.y); Entity::AddPoison((Entity *)this,(EntityRef *)local_4c,-0x28,0.0,0); } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); player = PlayerManager::FirstTrinketOwner(playerManager,0x87); if (player != (Entity_Player *)0x0) { auVar36._0_12_ = ZEXT812(0x3e4ccccd); auVar36._12_4_ = 0; local_29c = auVar36._0_4_; iVar28 = Entity_Player::GetTrinketMultiplier(player,0x87); if (iVar28 == 2) { auVar33 = ZEXT812(0x3ea8f5c3); LAB_006c8df9: auVar36._12_4_ = 0; auVar36._0_12_ = auVar33; local_29c = auVar33._0_4_; } else if (iVar28 == 3) { auVar33 = ZEXT812(0x3f000000); goto LAB_006c8df9; } RNG::game_constructor((RNG *)(local_60 + 4),this->_initSeed,5); local_14 = 0xb; fVar32 = RNG::RandomFloat(sfx); local_298.y = fVar32; FUN_00665c00(); local_14 = 0xffffffff; local_2a5 = local_298.y < auVar36._0_4_ * 0.02 + (float)local_29c; guard_check_icall(); if (local_2a5 != 0) { ::EntityRef::constructor((EntityRef *)local_4c,(Entity *)player); Entity::AddBurn((Entity *)this,(EntityRef *)local_4c,-0x5a,0.0,0); } } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); player = PlayerManager::FirstTrinketOwner(playerManager,0xbc); if (player != (Entity_Player *)0x0) { auVar37._0_12_ = ZEXT812(0x3e4ccccd); auVar37._12_4_ = 0; local_29c = auVar37._0_4_; iVar28 = Entity_Player::GetTrinketMultiplier(player,0xbc); if (iVar28 == 2) { auVar33 = ZEXT812(0x3ea8f5c3); LAB_006c8edb: auVar37._12_4_ = 0; auVar37._0_12_ = auVar33; local_29c = auVar33._0_4_; } else if (iVar28 == 3) { auVar33 = ZEXT812(0x3f000000); goto LAB_006c8edb; } RNG::game_constructor((RNG *)(local_60 + 4),this->_initSeed,5); local_14 = 0xc; fVar32 = RNG::RandomFloat(entityList); local_298.y = fVar32; FUN_00665c00(); local_14 = 0xffffffff; local_2a5 = local_298.y < auVar37._0_4_ * 0.02 + (float)local_29c; guard_check_icall(); fVar32 = local_2b8.y; if (local_2a5 != 0) { ::EntityRef::constructor((EntityRef *)local_4c,(Entity *)local_2b8.y); Entity::AddFreeze((Entity *)this,(EntityRef *)local_4c,-0x5a,0); ::EntityRef::constructor((EntityRef *)(local_a0 + 0x2c),(Entity *)fVar32); Entity::AddIce((Entity *)this,(EntityRef *)(local_a0 + 0x2c),-0x5a); } } } pEVar9 = GetPlayerTarget(this); player = Entity::ToPlayer(pEVar9); if ((player != (Entity_Player *)0x0) && (bVar5 = Entity_Player::IsInvisible(player), bVar5 != 0)) { ::EntityRef::constructor((EntityRef *)local_4c,(Entity *)this); Entity::AddConfusion((Entity *)this,(EntityRef *)local_4c,-2,0); } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); player = PlayerManager::FirstCollectibleOwner(playerManager,0x202,(RNG **)0x0,0); if (player != (Entity_Player *)0x0) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); fVar32 = PlayerManager::get_total_luck(playerManager); local_2b8.y = 5.32493e-44; local_298.y = (float)(0x37 - (int)fVar32); piVar21 = (int *)std::max(); iVar28 = *piVar21; cVar6 = (**(code **)(*(int *)this + 0x4c))(); if (cVar6 == '\0') { iVar28 = iVar28 * 2; } else { iVar28 = iVar28 * 3; } bVar5 = Entity::IsVulnerableEnemy((Entity *)this,(Entity *)0x0); if (((bVar5 != 0) && (iVar28 = Isaac::Random(iVar28), iVar28 == 0)) && (this->_dead == 0)) { pEVar9 = Entity::GetStatusEffectTarget((Entity *)this); Entity::AddEntityFlags(pEVar9,0x20); Entity::CopyStatusEffects(pEVar9); } } bVar5 = Entity::IsActiveEnemy((Entity *)this,0); if (((bVar5 != 0) && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x20), bVar5 != 0)) && ((this->_freezeCountdown < 1 && (bVar5 = Entity::IsFrame((Entity *)this,0x32,0), bVar5 != 0)))) { pEVar9 = Entity::GetStatusEffectTarget((Entity *)this); Entity::ClearEntityFlags(pEVar9,0x20); Entity::CopyStatusEffects(pEVar9); bVar5 = Vector::operator_ne(&this->_velocity,&g_vectorZero); if (bVar5 != 0) { EntityPtr::clear((EntityPtr *)&local_2d0); iVar28 = FUN_0067f030(); local_2d0.x = (float)((double)iVar28 + __uint_to_double_fixup[-(iVar28 >> 0x1f)]) * 14.0 - 21.0; iVar28 = FUN_0067f030(); local_2d0.y = (float)((double)iVar28 + __uint_to_double_fixup[-(iVar28 >> 0x1f)]) * 14.0 - 21.0; pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar17 = &this->_pos; pVVar22 = Room::GetClampedPosition(pRVar13,&local_54,pVVar17,0.0); local_2a5 = Vector::operator_eq(pVVar22,pVVar17); Vector::operator_add_assign(pVVar17,&local_2d0); if (local_2a5 != 0) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar22 = Room::GetClampedPosition(pRVar13,&local_54,pVVar17,0.0); Vector::operator_assign(pVVar17,pVVar22); } } } bVar5 = Entity::HasEntityFlags((Entity *)this,0x10); if (bVar5 == 0) { uVar11 = 0; local_29c = (Room *)CONCAT31(extraout_var,bVar5); pvVar10 = (void *)Game::GetPlayerManager(g_game); iVar28 = std::vector::size(pvVar10); if (iVar28 != 0) { do { player = Game::GetPlayer(g_game,uVar11); pTVar23 = (TemporaryEffects *)Entity_Player::GetEffects(player); bVar5 = TemporaryEffects::HasCollectibleEffect(pTVar23,0x5d); local_29c = (Room *)((uint)local_29c & 0xff); if (bVar5 != 0) { local_29c = (Room *)0x1; } uVar11 = uVar11 + 1; pvVar10 = (void *)Game::GetPlayerManager(g_game); uVar20 = std::vector::size(pvVar10); this = npc; } while (uVar11 < uVar20); if ((char)local_29c != '\0') { pcVar3 = *(code **)(*(int *)npc + 0x3c); Color::Color(&local_124); (*pcVar3)(extraout_EAX_00,2,0,0,1); ::EntityRef::constructor((EntityRef *)local_4c,(Entity *)this); Entity::AddFear((Entity *)this,(EntityRef *)local_4c,-2,0); } } } Level::GetCurrentRoom((Level *)g_game); pTVar23 = (TemporaryEffects *)FUN_004360d0(); bVar5 = TemporaryEffects::HasCollectibleEffect(pTVar23,0xe8); if (bVar5 == 0) { Level::GetCurrentRoom((Level *)g_game); pTVar23 = (TemporaryEffects *)FUN_004360d0(); bVar5 = TemporaryEffects::HasCollectibleEffect(pTVar23,0x42); if (bVar5 != 0) goto LAB_006c930b; pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar11 = Room::GetBrokenWatchState(pRVar13); if (uVar11 == 1) goto LAB_006c930b; } else { LAB_006c930b: bVar5 = Entity::HasEntityFlags((Entity *)this,0x20000001); if ((bVar5 == 0) || (this->_type == 0xd4)) { pcVar3 = *(code **)(*(int *)this + 0x3c); uVar38 = Color::Color(0x3f800000,0x28,0x28,0x28); (*pcVar3)(uVar38,2,0xfa,0,1); } } bVar5 = Entity::HasEntityFlags((Entity *)this,0x10000000000000); if (bVar5 != 0) { fVar32 = Math::timescale_factor(0.92,this->_speedMultiplier); this->_friction = fVar32 * this->_friction; } if (this->_isChampion != 0) { fVar32 = Math::timescale_factor (1.0 - (1.0 - this->_championSpeed) * (1.0 - this->_friction), this->_speedMultiplier); local_298.y = fVar32; Vector::operator_mul_assign(&this->_velocity,&local_298.y); } sprite = (Sprite *)&this->_sprite; local_298.y = (float)sprite; bVar5 = Sprite::IsEventTriggered(sprite,"poof02"); if (bVar5 != 0) { pvVar10 = Sprite::GetNullFrame(sprite,(byte *)"poof02"); uVar11 = Random(); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,0x10,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar11); pEVar9 = (Entity *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); FUN_004563c0(pvVar10); pVVar17 = Vector::Vector(&local_54,0.3,0.3); pVVar17 = Vector::Mul((Vector *)((int)pvVar10 + 0x10),&local_2f8,pVVar17); Entity::SetSpriteScale(pEVar9,pVVar17); set_field_358(pEVar9,10.0); pcVar3 = *(code **)(*(int *)pEVar9 + 0x3c); uVar38 = Color::Color(0x3f000000,0,0,0); (*pcVar3)(uVar38,0xffffffff,0xff,0,1); sprite = (Sprite *)local_298.y; this = npc; } spawn_damage_numbers(this); update_damage_history(this); if ((this->_aiCallFlags & 1) != 0) { this->_aiCallPhase = 1; Entity_NPC_UpdateAI_dispatch(this); this->_aiCallPhase = 0; } bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000002000000000); if (bVar5 != 0) { bVar5 = Entity::IsFrame((Entity *)this,0xf,0); if ((bVar5 != 0) && (1.0 < this->_health)) { local_298.y = this->_health - 0.25; local_2b8.y = 1.0; pfVar18 = (float *)std::max(); this->_health = *pfVar18; } fVar32 = Math::clamp(0.0,1.0,(this->_health * this->_health) / (this->_maxHitPoints * this->_maxHitPoints)); local_298.y = Math::lerp(0.6,1.0,fVar32,0); spriteColor = (Color *)Sprite::Color(sprite); Color::SetTint(spriteColor,local_298.y,local_298.y,local_298.y,1.0); fVar32 = this->_health / this->_maxHitPoints; FUN_00431260(); fVar32 = Math::clamp(0.0,1.0,fVar32); local_298.y = Math::lerp(0.6,1.1,fVar32,0); pVVar17 = Vector::__mul(&g_vectorOne,&local_54,&local_298.y); Sprite::SetScale(sprite,pVVar17); local_29c = (Room *)0x0; local_288 = (Room *)0x0; local_298.x = 0.0; local_298.y = 0.0; ::EntityRef::EntityRef((EntityRef *)local_4c); std::iterator_copy(&this->_damageEvents,&local_2a4); uVar38 = FUN_00456190(&local_2b8.y); cVar6 = FUN_0042c710(uVar38); if (cVar6 == '\0') { local_2a0 = (ANM2 *)local_298.y; local_290 = (Entity *)local_298.x; } else { local_2a0 = (ANM2 *)local_298.y; local_290 = (Entity *)local_298.x; do { puVar14 = (undefined4 *)EntityPtr::Ref(); pEVar9 = (Entity *)puVar14[2]; if (((uint)pEVar9 & 0x282) == 0) { if (((uint)pEVar9 & 0x286) != 0) { local_2a0 = (ANM2 *)puVar14[3]; local_29c = (Room *)0x40a00000; local_290 = pEVar9; ::EntityRef::operator_((EntityRef *)local_4c,(EntityRef *)(puVar14 + 4)); break; } if ((float)local_288 < (float)*puVar14) { local_2a0 = (ANM2 *)puVar14[3]; local_29c = (Room *)0x3f800000; local_290 = pEVar9; local_288 = (Room *)*puVar14; ::EntityRef::operator_((EntityRef *)local_4c,(EntityRef *)(puVar14 + 4)); } } FUN_00456170(&local_298.y,0); uVar38 = FUN_00456190(&local_2b8.y); cVar6 = FUN_0042c710(uVar38); } while (cVar6 != '\0'); sprite = (Sprite *)&this->_sprite; } FUN_00456400(); if (0.0 < (float)local_29c) { (**(code **)(*(int *)this + 0x20))(local_29c,local_290,local_2a0,local_4c,0); } } local_298.y = this->_health; if (this->_type == 0x3c5) { update_physics(); } else { Entity::Update((Entity *)this); } local_2b8.y = 0.0; local_298.y = (float)(local_298.y - this->_health); pfVar18 = (float *)std::max(); pEVar12 = (Entity_Effect *)(*pfVar18 + this->_totalDamageTaken); this->_totalDamageTaken = (float)pEVar12; if ((this->_aiCallFlags & 8) != 0) { this->_aiCallPhase = 4; Entity_NPC_UpdateAI_dispatch(this); this->_aiCallPhase = 0; } bVar5 = Game::IsInTimedSet(g_game,0xf); if (bVar5 != 0) { pcVar3 = *(code **)(*(int *)this + 0x3c); uVar38 = Color::Color(0,0,0,0); (*pcVar3)(uVar38,0xffffffff,0xff,0,1); pCVar16 = (ColorMod *)Color::Color(0,0,0,0); sprite = (Sprite *)&this->_sprite; Sprite::SetColor(sprite,pCVar16); this->_shadowSize = 0.0; } bVar5 = Game::IsInTimedSet(g_game,4); if ((bVar5 != 0) || (bVar5 = Game::IsInTimedSet(g_game,6), bVar5 != 0)) { local_298.y = (float)&this->_pos; iVar28 = Entity::FrameCount((Entity *)this); if (iVar28 < 2) { Isaac::GetRenderPosition(&local_2d0,(Vector *)local_298.y,1); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar17 = (Vector *)Room::GetRenderSurfaceTopLeft(pRVar13); Vector::operator__(&local_2d0,pVVar17); Level::GetCurrentRoom((Level *)g_game); FUN_004177e0(&local_2e0); local_14 = 0xd; piVar21 = (int *)EntityPtr::Ref(); pcVar3 = *(code **)(*piVar21 + 0x2c); uVar38 = __ftoui3(); uVar38 = __ftoui3(uVar38); (*pcVar3)(&local_38,uVar38); local_14 = 0xffffffff; FUN_0041c710(); this = npc; pCVar16 = &npc->_floorColor; KColor::FromRGBA255((KColor *)pCVar16,0,0,0,0xff); Font::SetLineHeightModifier((Font *)pCVar16,0.7); pEVar12 = (Entity_Effect *)(local_38._red * 0.9); Color::SetOffset((Color *)pCVar16,(float)pEVar12,local_38._green * 0.9,local_38._blue * 0.9); sprite = (Sprite *)&this->_sprite; Sprite::SetColor(sprite,pCVar16); } iVar28 = Game::GetFrameCount(g_game); if ((uint)(iVar28 + this->_index) % 0x1e < 2) { Isaac::GetRenderPosition(&local_2d0,&this->_pos,1); pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar17 = (Vector *)Room::GetRenderSurfaceTopLeft(pRVar13); Vector::operator__(&local_2d0,pVVar17); Level::GetCurrentRoom((Level *)g_game); FUN_004177e0(&local_2e0); local_14 = 0xe; piVar21 = (int *)EntityPtr::Ref(); (**(code **)(*piVar21 + 0x2c))(&local_38,(int)local_2d0.x,(int)local_2d0.y); local_14 = 0xffffffff; FUN_0041c710(); fVar31 = (float10)Color::A(); local_298.y = (float)fVar31; fVar32 = Math::lerp((float)fVar31,0.7,0.3,0); Font::SetLineHeightModifier((Font *)&this->_floorColor,fVar32); local_298.y = local_38._blue * 0.9; fVar31 = (float10)Color::BO(); local_2b8.y = (float)fVar31; local_2f0.y = Math::lerp(local_2b8.y,local_298.y,0.5,0); local_298.y = local_38._green * 0.9; fVar31 = (float10)Color::GO(); local_2b8.y = (float)fVar31; local_308.y = Math::lerp(local_2b8.y,local_298.y,0.5,0); local_298.y = local_38._red * 0.9; fVar31 = (float10)Color::RO(); local_2b8.y = (float)fVar31; pEVar12 = (Entity_Effect *)Math::lerp(local_2b8.y,local_298.y,0.5,0); Color::SetOffset((Color *)&this->_floorColor,(float)pEVar12,local_308.y,local_2f0.y); } pCVar16 = (ColorMod *)Sprite::Color(sprite); Color::operator_assign((Color *)local_a0,pCVar16); Color::Lerp((ColorMod *)local_cc,(ColorMod *)local_a0,&this->_floorColor,0.1); Sprite::Color(sprite); fVar31 = (float10)Color::A(); Font::SetLineHeightModifier((Font *)local_cc,(float)fVar31); Color::SetTint((Color *)local_cc,0.02,0.02,0.02,1.0); Sprite::SetColor(sprite,(ColorMod *)local_cc); } bVar5 = Game::IsInTimedSet(g_game,0x19); if (((bVar5 != 0) || (bVar5 = Game::GetDebugFlag(g_game,9), bVar5 != 0)) && (bVar5 = Entity::IsActiveEnemy((Entity *)this,0), bVar5 != 0)) { pEVar12 = (Entity_Effect *)((this->_maxHitPoints / 30.0) / 30.0); local_28c = pEVar12; bVar5 = Game::IsInTimedSet(g_game,0x19); if (bVar5 != 0) { this->_isInvicible = 1; } iVar28 = this->_type; if (iVar28 == 0x104) { if (this->_variant != 10) goto LAB_006c9e06; LAB_006c9da4: pEVar12 = (Entity_Effect *)((float)local_28c * 3.0); LAB_006c9db4: local_28c = pEVar12; } else { if ((((iVar28 == 0x47) || (iVar28 == 0x48)) || ((iVar28 == 0x49 || ((iVar28 == 0x4a || (iVar28 == 0x4b)))))) || (iVar28 == 0x4c)) goto LAB_006c9da4; LAB_006c9e06: if (iVar28 == 0x51) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetBossID(pRVar13); if (iVar28 == 0x18) goto LAB_006c9da4; iVar28 = this->_type; } if ((iVar28 != 0x112) && (iVar28 != 0x113)) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetBossID(pRVar13); if (iVar28 != 0x37) goto LAB_006c9dbc; pEVar12 = (Entity_Effect *)((float)local_28c * 4.0); goto LAB_006c9db4; } pEVar12 = (Entity_Effect *)((float)local_28c * 0.33333); local_28c = pEVar12; if (this->_isInvicible != 0) { pEVar12 = (Entity_Effect *)0x0; goto LAB_006c9db4; } } LAB_006c9dbc: Level::GetCurrentRoom((Level *)g_game); iVar28 = GridEntity::GetVariant(); if (iVar28 == 0x11) { pEVar12 = (Entity_Effect *)((float)local_28c + (float)local_28c); LAB_006c9ee0: local_28c = pEVar12; } else { Level::GetCurrentRoom((Level *)g_game); iVar28 = GridEntity::GetVariant(); if (iVar28 == 6) { pEVar12 = (Entity_Effect *)((float)local_28c * 3.0); goto LAB_006c9ee0; } Level::GetCurrentRoom((Level *)g_game); iVar28 = GridEntity::GetVariant(); if (iVar28 != 5) { pEVar12 = (Entity_Effect *)((float)local_28c * 6.0); goto LAB_006c9ee0; } } bVar5 = Game::GetDebugFlag(g_game,9); if (bVar5 != 0) { pEVar12 = (Entity_Effect *)((float)local_28c * 100.0); local_28c = pEVar12; } cVar6 = (**(code **)(*(int *)this + 0x4c))(); if ((cVar6 == '\0') && (bVar5 = Game::GetDebugFlag(g_game,9), bVar5 == 0)) { Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetAliveBossesCount(); if (iVar28 < 1) { this->_canShutDoors = 0; } } else { iVar28 = this->_type; if (((iVar28 == 0x4a) || (iVar28 == 0x4b)) || (iVar28 == 0x4c)) { pEVar12 = (Entity_Effect *)this->_health; if ((0.0 < (float)pEVar12) || (this->_entityCollisionClass == 0)) goto LAB_006ca08e; this->_isInvicible = 0; this->_health = 1.0; this->_dead = 1; } else { pEVar12 = (Entity_Effect *)this->_health; if (0.0 < (float)pEVar12) { LAB_006ca08e: pEVar12 = (Entity_Effect *)((float)pEVar12 - (float)local_28c); this->_health = (float)pEVar12; } else { bVar5 = Game::GetDebugFlag(g_game,9); if ((((bVar5 == 0) && (iVar28 = this->_type, iVar28 != 0x24)) && ((iVar28 != 0x106 && ((((iVar28 != 0x107 && (iVar28 != 0x4e)) && (iVar28 != 0x47)) && ((iVar28 != 0x48 && (iVar28 != 0x49)))))))) && ((iVar28 != 0x104 || (this->_variant != 10)))) { Level::GetCurrentRoom((Level *)g_game); iVar28 = GridEntity::GetVariant(); if (iVar28 != 0x11) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetBossID(pRVar13); if (iVar28 != 0x37) { if (this->_type == 0x51) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar28 = Room::GetBossID(pRVar13); if (iVar28 == 0x18) goto LAB_006ca02b; } this->_canShutDoors = 0; goto LAB_006ca09e; } } } LAB_006ca02b: this->_isInvicible = 0; pcVar3 = *(code **)(*(int *)this + 0x20); pEVar24 = ::EntityRef::EntityRef((EntityRef *)local_4c); (*pcVar3)(0x3f800000,0,0,pEVar24,0x1e); this->_dead = 1; } } } } LAB_006ca09e: FUN_006d6650(); bVar5 = Entity::IsFlying((Entity *)this); if ((bVar5 == 0) && (this->_visible != 0)) { bVar5 = Entity::IsActiveEnemy((Entity *)this,0); if (bVar5 != 0) { pEVar12 = (Entity_Effect *)Vector::LengthSquared(&this->_velocity); local_298.y = (float)pEVar12; if (1.0 < (float)pEVar12) { pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); cVar6 = Room::HasWater(pRVar13); if (((cVar6 != '\0') && (bVar5 = Entity::IsFrame((Entity *)this,7,this->_index), bVar5 != 0) ) && (this->_entityCollisionClass != 0)) { uVar11 = Random(); pVVar17 = Vector::__add(&this->_pos,&local_54,&this->_velocity); uVar43 = 0; pTVar40 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar39 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar38 = 0; pEVar9 = Game::Spawn(g_game,1000,99,pVVar17,&g_vectorZero,(Entity *)this,0,uVar11); pEVar9 = (Entity *)__RTDynamicCast(pEVar9,uVar38,pTVar39,pTVar40,uVar43); pEVar12 = (Entity_Effect *)(this->_size * 0.05 * this->_scale); local_298.y = (float)pEVar12; pVVar17 = Vector::__mul(&g_vectorOne,&local_2f8,&local_298.y); Entity::SetSpriteScale(pEVar9,pVVar17); set_field_358(pEVar9,-10.0); local_298.y = 0.5; pVVar17 = Vector::__mul(&this->_velocity,(Vector *)(local_318 + 8),&local_298.y); Entity::SetVelocity(pEVar9,pVVar17); (**(code **)(*(int *)pEVar9 + 0xc))(); } } } } pVVar17 = &this->_pos; local_2b8.y = (float)pVVar17; Vector::operator_assign(&this->_pausePosition,pVVar17); if (this->_isBestiaryEncountered == 0) { this_03 = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryAddBestiaryEncounter(this_03,this->_type,this->_variant); this->_isBestiaryEncountered = 1; } bVar5 = Entity::IsFrame((Entity *)this,*(int *)((int)this->_config + 0xd0) * 2,this->_index); if (bVar5 == 0) { if ((this->_type == 0x322) && (this->_state == 8)) { pAVar25 = (AnimationState *)Config::GetPillEffects(); bVar5 = AnimationState::IsLoopingAnimation(pAVar25); if ((bVar5 != 0) && (bVar5 = Entity::IsFrame((Entity *)this,3,this->_index), bVar5 != 0)) goto LAB_006ca297; } } else { LAB_006ca297: std::vector::clear(&this->_hitList,0); } iVar28 = this->_type; if (iVar28 == 0x38a) { Hornfel_UpdateFrame(this); iVar28 = this->_type; } if (iVar28 == 0x38b) { if (this->_state == 1) { Level::GetCurrentRoom((Level *)g_game); camera = (Camera *)FUN_00428a70(); Camera::SetFocusPosition(camera,pVVar17); iVar28 = this->_type; goto LAB_006ca2e9; } } else { LAB_006ca2e9: if (((iVar28 == 0x5c) && (Vector::operator_assign(&this->_targetPosition,&g_vectorZero), this->_variant == 1)) && ((this->_entityRef != (EntityPtr)0x0 && (bVar5 = Entity::IsEnemy((Entity *)this->_entityRef), bVar5 != 0)))) { this_00 = this->_entityRef; pVVar17 = Entity::Position((Entity *)this_00,&local_54); pVVar17 = Vector::__sub(pVVar17,&local_2f8,&this->_pos); Vector::operator_assign(&this->_targetPosition,pVVar17); pVVar17 = Vector::__unm(&this->_targetPosition,(Vector *)(local_318 + 8)); Vector::operator_assign((Vector *)((int)this_00 + 0x334),pVVar17); } } if (this->_type == 0x19b) { bVar5 = Sprite::IsEventTriggered((Sprite *)&this->_sprite,&DAT_00b1d534); if (bVar5 != 0) { Level::GetCurrentRoom((Level *)g_game); FUN_00407470(); if (0.2 < (float)pEVar12) { Vector::Vector(&local_2e8,this->_size,this->_size * 0.65); iVar28 = Isaac::Random(10); pEVar12 = (Entity_Effect *)(iVar28 + 0xc); local_298.y = (float)pEVar12; if (0 < (int)pEVar12) { do { pVVar17 = MusicManager::RandomVector(&local_54); Vector::Mul(&local_2e8,&local_2d0,pVVar17); fVar32 = random_float(); local_298.y = fVar32 * 5.0 + 3.0; pVVar17 = Vector::operator_mul(&local_2f8,&local_298.y,&local_2d0); Vector::__div(pVVar17,&local_2e0,&local_2e8.x); uVar11 = Random(); pVVar17 = Vector::__add((Vector *)local_2b8.y,(Vector *)(local_318 + 8),&local_2d0); projectile = (Entity_Projectile *) Game::Spawn(g_game,1000,99,pVVar17,&local_2e0,(Entity *)0x0,1,uVar11); pVVar17 = (Vector *)Entity::SpriteScale((Entity *)projectile); local_2f0.y = 2.0; pVVar17 = Vector::__mul(pVVar17,&local_334,&local_2f0.y); Entity::SetSpriteScale((Entity *)projectile,pVVar17); fVar32 = random_float(); FUN_00444c70(-4.0 - fVar32 * 8.0); Entity_Projectile::set_falling_accel(projectile,1.5); (**(code **)(*(int *)projectile + 0xc))(); pEVar12 = (Entity_Effect *)((int)&pEVar12[-1]._hitList._capacity + 3); } while (pEVar12 != (Entity_Effect *)0x0); this = npc; } } } } if (this->_dead != 0) { if ((((isDeadBefore == 0) && (cVar6 = (**(code **)(*(int *)this + 0x4c))(), cVar6 == '\0')) && (*(char *)((int)this->_config + 0x2c) == '\0')) && (bVar5 = Entity::HasEntityFlags((Entity *)this,0x4000000000000), bVar5 != 0)) { Entity_Pickup::Update((Entity_Pickup *)this); uVar11 = 0; iVar28 = Game::GetNumPlayers(g_game); if (iVar28 != 0) { do { player = Game::GetPlayer(g_game,uVar11); Entity_Player::trigger_npc_death(player,(Entity *)this); uVar11 = uVar11 + 1; uVar20 = Game::GetNumPlayers(g_game); } while (uVar11 < uVar20); } FUN_006d5350(); FUN_0042c770(&local_2a4); pvVar10 = std::iterator_copy(&this->_entityPtrReferrers,&local_298.y); cVar6 = FUN_0042c710(pvVar10); while (cVar6 != '\0') { puVar14 = (undefined4 *)FUN_005cba30(); *(undefined4 *)*puVar14 = 0; set_iterator_post_increment(&local_2b8.y,0); pvVar10 = std::iterator_copy(&this->_entityPtrReferrers,&local_298.y); cVar6 = FUN_0042c710(pvVar10); } std::set::clear(); Sprite::Stop((Sprite *)&this->_sprite); FUN_0040a9c0(); Entity::RemoveStatusEffects((Entity *)this); ANM2::Reset(&this->_statusEffectSprite); (**(code **)(*(int *)this + 0x40))(0); this->_entityCollisionClass = 4; if ((this->_entityGridCollisionClass < 3) || (this->_entityGridCollisionClass == 7)) { this->_entityGridCollisionClass = 3; } pRVar13 = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar17 = Room::GetClampedPosition(pRVar13,&local_54,&this->_pos,0.0); Vector::operator_assign(&this->_pos,pVVar17); if (*(int *)((int)this->_config + 0x48) < 1) { Entity::SetSize((Entity *)this,this->_size,this->_sizeMulti,8); } this->_mass = 1000.0; this->_dead = 0; this->_canShutDoors = 0; this->_isBoss = 0; this->_isInvicible = 1; Entity::AddEntityFlags((Entity *)this,0x2000000010011); this->_health = 10.0; this->_maxHitPoints = 10.0; if (((this->_type == 0x322) && (this->_parent != (EntityPtr)0x0)) && (bVar5 = Entity::IsFamiliar((Entity *)this->_parent), bVar5 != 0)) { FUN_0062e0e0(this); } this->_spawnerType = 0; this->_spawnerVariant = 0; Entity::SetSpawnerEntity((Entity *)this,(Entity *)0x0); Entity::SetParent((Entity *)this,(Entity *)0x0); Entity::SetChild((Entity *)this,(Entity *)0x0); Entity::SetTarget((Entity *)this,(Entity *)0x0); this->_stateFrame = this->_type; this->_type = 0x3c3; (**(code **)(*(int *)this + 0x60))(); pcVar3 = *(code **)(*(int *)this + 0x3c); uVar38 = Color::Color(0x3f800000,0x3f800000,0x3f800000,0x3f800000,0x3f000000,0x3f4ccccd, 0x3f800000,0x3f99999a); (*pcVar3)(uVar38,6,1,1,1); } if (this->_dead != 0) goto LAB_006ca82b; } if (this->_state != 0x12) { Entity::ClearEntityFlags((Entity *)this,0x80000000000000); Entity::ClearEntityFlags((Entity *)this,0x400000); } LAB_006ca82b: iVar28 = this->_forcedTargetTimer; if (iVar28 < 1) { if (iVar28 < 0) { this->_forcedTargetTimer = iVar28 + 1; } } else { this->_forcedTargetTimer = iVar28 + -1; if (iVar28 + -1 == 0) { cVar6 = (**(code **)(*(int *)this + 0x4c))(); if (cVar6 != '\0') { this->_forcedTargetTimer = -0x96; } EntityPtr::SetReference(&this->_forcedTarget,(Entity *)0x0); } } ExceptionList = local_1c; return; } //@@ 006ca930 Entity_NPC::update_frozen /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Entity_NPC::Update when _flags & (1<<49) FLAG_ICE_FROZEN, then returns; ring buffer at +0xc4c..0xc58, DoesEntityShareStatus */ void __thiscall Entity_NPC::update_frozen(Entity_NPC *this) { BitSet128 flags; uint rngResult; Entity *effect; LayerState *layer; Vector *clampedPos; Entity_Tear *iceTear; int iVar1; void *damageEvent; float fVar2; float particleScale; undefined1 auStack_78 [12]; Vector VStack_6c; int shardIdx; float angleRad; float fStack_5c; Vector VStack_58; uint uStack_50; uint uStack_4c; uint uStack_48; undefined4 sourceRef; undefined4 local_3c; undefined4 local_38; undefined4 local_34; float local_30; float local_2c; float local_28; float local_24; undefined4 local_20; undefined4 local_1c; float fStack_18; uint local_14; local_14 = __security_cookie ^ (uint)auStack_78; this->_friction = this->_friction * 0.5; damageEvent = (this->_damageEvents)._begin; if (damageEvent != (this->_damageEvents)._end) { do { if (this->_dead != 0) break; if ((*(uint *)((int)damageEvent + 8) & 0x1000004) == 0) { fVar2 = this->_health - 1.0; this->_health = fVar2; if (fVar2 <= 0.0) goto LAB_006ca9aa; } else { LAB_006ca9aa: local_30 = g_vectorZero.x; local_28 = g_vectorZero.x; local_2c = g_vectorZero.y; local_24 = g_vectorZero.y; sourceRef = 0; local_3c = 0; local_38 = 0; local_34 = 0; local_20 = 0; local_1c = 0; (**(code **)(*(int *)this + 0x24))(&sourceRef); } damageEvent = (void *)((int)damageEvent + 0x38); } while (damageEvent != (this->_damageEvents)._end); } (this->_damageEvents)._end = (this->_damageEvents)._begin; this->_pendingDamage = 0.0; *(undefined4 *)&this->_pendingDamageFlags = 0; *(undefined4 *)((int)&this->_pendingDamageFlags + 4) = 0; Entity::Update((Entity *)this); if ((this->_flags & 0x800000000000) != 0) { rngResult = Random(); if ((rngResult & 1) == 0) { rngResult = Random(); effect = Game::SpawnEx(g_game,1000,0x36,&this->_pos,&g_vectorZero,(Entity *)0x0,0,rngResult,0) ; rngResult = Random(); iVar1 = *(int *)effect; particleScale = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; fVar2 = particleScale * g_vectorOne.x; (effect->_sprite)._scale.y = particleScale * g_vectorOne.y; (effect->_sprite)._scale.x = fVar2; (**(code **)(iVar1 + 0xc))(); } rngResult = Random(); VStack_6c.x = (this->_velocity).x * 0.14; VStack_6c.y = (this->_velocity).y * 0.14; effect = Game::SpawnEx(g_game,1000,0x3b,&this->_pos,&VStack_6c,(Entity *)0x0,0,rngResult,0); rngResult = Random(); *(float *)(effect[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; rngResult = Random(); local_20 = 0x3f4ccccd; local_1c = 0x3f666666; iVar1 = rngResult % 0xf + 0xf; fStack_18 = 1.0; *(int *)(effect[1]._sprite._filename._buf + 8) = iVar1; *(int *)(effect[1]._sprite._filename._buf + 0xc) = iVar1; (effect->_posOffset).x = (this->_posOffset).x; (effect->_posOffset).y = (this->_posOffset).y; layer = ANM2::GetLayer(&effect->_sprite,(byte *)0x0); if (&layer->_color != (ColorMod *)&sourceRef) { (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 0.4; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(local_1c,local_20); (layer->_color)._offset[2] = fStack_18; } if (this->_collidesWithGrid != 0) { VStack_6c.x = (this->_pos).x - (this->_gridCollisionVelocity).x; VStack_6c.y = (this->_pos).y - (this->_gridCollisionVelocity).y; clampedPos = Room::GetClampedPositionImpl(g_game->_room,&VStack_58,&VStack_6c,4.0,4.0,4.0,4.0) ; sourceRef = 0; local_3c = 0; local_38 = 0; (this->_pos).x = clampedPos->x; (this->_pos).y = clampedPos->y; local_30 = g_vectorZero.x; local_28 = g_vectorZero.x; local_2c = g_vectorZero.y; local_24 = g_vectorZero.y; local_34 = 0; local_20 = 0; local_1c = 0; (**(code **)(*(int *)this + 0x24))(&sourceRef); } } if (this->_dead != 0) { trigger_kill_item_effects(this); fStack_5c = (float)g_game->_stage + 7.0; rngResult = Random(); shardIdx = 0; VStack_6c.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 360.0; do { angleRad = ((float)shardIdx * 36.0 + VStack_6c.x) * 0.017453292; VStack_58.x = cos(angleRad); VStack_58.x = VStack_58.x * 16.0; VStack_58.y = sin(angleRad); VStack_58.y = VStack_58.y * 16.0; rngResult = Random(); iceTear = (Entity_Tear *) Game::SpawnEx(g_game,2,0x29,&this->_pos,&VStack_58,(Entity *)0x0,0,rngResult,0); (**(code **)(*(int *)iceTear + 0x40))(fStack_5c); uStack_50 = DAT_00c349e4 | DAT_00c34c34; VStack_58.y = (float)(DAT_00c349e0 | DAT_00c34c30); uStack_48 = DAT_00c349ec | DAT_00c34c3c; uStack_4c = DAT_00c349e8 | DAT_00c34c38; flags._l._4_4_ = uStack_50; flags._l._0_4_ = VStack_58.y; flags._h._0_4_ = uStack_4c; flags._h._4_4_ = uStack_48; Entity_Tear::SetTearFlags(iceTear,flags); iceTear->_fallingAccel = 0.2; iceTear->_spawnerType = 1; (**(code **)(*(int *)iceTear + 0xc))(); shardIdx = shardIdx + 1; } while (shardIdx < 10); } return; } //@@ 006cae60 Entity_NPC::IsTargetInAttackRange /* DB: controlled->input nonzero; else player target dist_flags + 4); if (((this->_flags & 0x200) == 0) && ((this->_flags & 0x1000a00) == 0)) { local_14.y = range; if (this->_controllerID == -1) { other = GetPlayerTarget(this); bVar2 = Entity::IsHostileTo((Entity *)this,other); if (bVar2 != 0) { pVVar3 = &this->_pos; local_8 = (other->_pos).x; fVar1 = (other->_pos).y; if (isPredictVelocity == 0) { local_8 = local_8 - pVVar3->x; _isPredictVelocity = fVar1 - (this->_pos).y; } else { local_8 = ((other->_velocity).x * 5.0 + local_8) - pVVar3->x; _isPredictVelocity = ((other->_velocity).y * 5.0 + fVar1) - (this->_pos).y; } if ((frameInterval != 0) && (bVar2 = Entity::IsFrame((Entity *)this,frameInterval,this->_index), bVar2 == 0)) { return 0; } if (_isPredictVelocity * _isPredictVelocity + local_8 * local_8 < local_14.y * local_14.y) { local_14.y = (other->_pos).y; local_14.x = (other->_pos).x; bVar2 = Room::CheckLine(g_game->_room,pVVar3,&local_14,3,999,0,0,(Vector *)0x0); if (bVar2 != 0) { return 1; } if (this->_championColorIdx == 8) { return 1; } } } } else { pVVar3 = GetControllerMovementInput(this,&local_14,0.1); if ((pVVar3->x != g_vectorZero.x) || (pVVar3->y != g_vectorZero.y)) { return 1; } } } return 0; } //@@ 006cb010 Entity_Projectile::apply_spawn_flags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall on the new projectile (flags at +0x438): maps ProjectileParams flag bits (0x80, 0x100, 0x20000000) to projectile flags, with Betrayal-style collectible 391 owner and a player/charmed spawner (param_3) marks it and links the spawner EntityPtr (+0x3bc multiset); Entity_NPC::FireBossProjectiles, fire_projectile_from_params prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl Entity_Projectile::apply_spawn_flags (Entity_Projectile *projectile,int championColor,float spawnerScale,ulonglong spawnerFlags ,Entity *spawner) { Entity_Player *betrayalOwner; ColorMod *flashColor; float fVar1; Color tintedColor; float savedSpawnerScale; int savedChampionColor; EntityPtr *parentRefTmp; undefined1 flashColorBuf [44]; ColorMod finalColor; undefined4 flagsHi; EntityPtr *parentRef; if ((spawnerFlags & 0x80) != 0) { flagsHi = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x1000000; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = flagsHi; } if ((spawnerFlags & 0x100) != 0) { flagsHi = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x80; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = flagsHi; } if ((spawnerFlags & 0x20000000) != 0) { flagsHi = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x80000000; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = flagsHi; } savedSpawnerScale = spawnerScale; savedChampionColor = championColor; if (spawner != (Entity *)0x0) { if (((1 < *(int *)&g_game->_deathmatchManager) && (spawner->_type == 1)) || (spawner->_type - 10U < 0x3de)) { betrayalOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x187,(RNG **)&g_game->_playerManager,1); if (betrayalOwner != (Entity_Player *)0x0) { flagsHi = *(undefined4 *)((int)&projectile->_projectileFlags + 4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x80; *(undefined4 *)((int)&projectile->_projectileFlags + 4) = flagsHi; } } if (((projectile->_projectileFlags & 0x80) != 0) || ((spawnerFlags & 0x10000000000000) != 0)) { parentRef = &projectile->_parent; if (projectile->_parent != (EntityPtr)0x0) { parentRefTmp = parentRef; std::multiset::erase(&parentRefTmp); } *parentRef = (EntityPtr)spawner; std::multiset::insert(parentRef); championColor = savedChampionColor; } } fVar1 = 1.0; if (-1 < championColor) { if (projectile->_variant == 1) { flashColor = (ColorMod *)_Entity_NPC::GetColorWithFlash(flashColorBuf); tintedColor._tint[0] = (projectile->_color)._tint[0]; tintedColor._tint[1] = (projectile->_color)._tint[1]; tintedColor._tint[2] = (projectile->_color)._tint[2]; tintedColor._tint[3] = (projectile->_color)._tint[3]; tintedColor._offset[2] = (projectile->_color)._offset[2]; tintedColor._colorize[0] = (projectile->_color)._colorize[0]; tintedColor._colorize[1] = (projectile->_color)._colorize[1]; tintedColor._colorize[2] = (projectile->_color)._colorize[2]; tintedColor._colorize[3] = (projectile->_color)._colorize[3]; tintedColor._offset._0_8_ = *(undefined8 *)(projectile->_color)._offset; Color::__mul(&tintedColor,flashColor); finalColor._tint[0] = tintedColor._tint[0]; finalColor._tint[1] = tintedColor._tint[1]; finalColor._tint[2] = tintedColor._tint[2]; finalColor._tint[3] = tintedColor._tint[3]; finalColor._offset[2] = tintedColor._offset[2]; finalColor._colorize[0] = tintedColor._colorize[0]; finalColor._colorize[1] = tintedColor._colorize[1]; finalColor._colorize[2] = tintedColor._colorize[2]; finalColor._colorize[3] = tintedColor._colorize[3]; finalColor._offset[0] = tintedColor._offset[0]; finalColor._offset[1] = tintedColor._offset[1]; (**(code **)(*(int *)projectile + 0x3c))(&finalColor,0xffffffff,0xff,0,1); } fVar1 = 1.0; if (championColor != 0x12) { fVar1 = projectile->_collisionDamage + projectile->_collisionDamage; if (2.0 <= fVar1) { fVar1 = 2.0; } (**(code **)(*(int *)projectile + 0x40))(fVar1); fVar1 = 1.2173913; if (championColor == 3) { *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x200; } else { if (championColor != 8) goto LAB_006cb24a; *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | 0x10; } *(undefined4 *)((int)&projectile->_projectileFlags + 4) = *(undefined4 *)((int)&projectile->_projectileFlags + 4); } } LAB_006cb24a: fVar1 = fVar1 * savedSpawnerScale; if ((spawnerFlags & 0x40000000000000) != 0) { fVar1 = fVar1 * 0.8; } if (fVar1 != 1.0) { projectile->_scale = fVar1 * projectile->_scale; } return; } //@@ 006cb2a0 Entity_NPC::fire_projectile_from_params /* DB: ? calls FUN_006cb010 with fields 0x168/0x16c, per-projectile loop in FireProjectiles prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::fire_projectile_from_params(Entity_NPC *this,Entity_Projectile *projectile) { int championColor; if (this->_isChampion == 0) { championColor = -1; } else { championColor = this->_championColorIdx; } Entity_Projectile::apply_spawn_flags (projectile,championColor,this->_scale,this->_flags,(Entity *)this); return; } //@@ 006cb2e0 Entity_NPC::FireProjectiles /* WARNING: Removing unreachable block (ram,0x006ccd5b) */ /* WARNING: Removing unreachable block (ram,0x006cb892) */ /* WARNING: Removing unreachable block (ram,0x006cbdb6) */ /* WARNING: Removing unreachable block (ram,0x006cc307) */ /* WARNING: Removing unreachable block (ram,0x006cc129) */ /* WARNING: Removing unreachable block (ram,0x006cbacd) */ /* WARNING: Removing unreachable block (ram,0x006cb68e) */ /* WARNING: Removing unreachable block (ram,0x006cc4df) */ /* WARNING: Removing unreachable block (ram,0x006ccd6d) */ /* WARNING: Removing unreachable block (ram,0x006ccd7d) */ /* WARNING: Removing unreachable block (ram,0x006ccd83) */ /* WARNING: Removing unreachable block (ram,0x006cbe83) */ /* WARNING: Removing unreachable block (ram,0x006cc39a) */ /* WARNING: Removing unreachable block (ram,0x006cc1b9) */ /* WARNING: Removing unreachable block (ram,0x006cbbb2) */ /* WARNING: Removing unreachable block (ram,0x006cc56f) */ /* WARNING: Removing unreachable block (ram,0x006cbf50) */ /* WARNING: Removing unreachable block (ram,0x006cc5ff) */ /* WARNING: Removing unreachable block (ram,0x006cc69f) */ /* WARNING: Removing unreachable block (ram,0x006cc73c) */ /* WARNING: Removing unreachable block (ram,0x006cc7cf) */ /* WARNING: Removing unreachable block (ram,0x006cb52f) */ /* ZHL [exact] __thiscall void Entity_NPC::FireProjectiles(Vector* position, Vector* velocity, uint32_t mode, ProjectileParams* params); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity_NPC::FireProjectiles (Entity_NPC *this,Vector *position,Vector *velocity,uint mode,ProjectileParams *params) { int iVar1; undefined1 *puVar2; uint uVar3; uint spawnSeed; Entity *spawned; float fVar4; float *projListCursor; int projIndex; float fVar5; undefined4 uVar6; undefined4 uVar7; float *projListEnd; Vector spawnPos; Vector shotVelocity; Vector local_40; float local_38; float local_34; float local_30; float local_2c; float local_28; Entity_NPC *self; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Entity_Projectile *projectile; TypeDescriptor *castDstType; TypeDescriptor *castSrcType; uint *changeFlagsWord; int *projSlot; float selfVelY; Entity_NPC *spawner; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00afaafd; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; projListCursor = (float *)0x0; projListEnd = (float *)0x0; local_14 = 0; self = this; switch(mode) { case 0: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; shotVelocity.x = (params->PositionOffset).x + position->x; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&shotVelocity,velocity,(Entity *)self,0,spawnSeed ); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); projListCursor = projListEnd; puVar2 = puStack_20; goto LAB_006cc9af; case 1: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.961 - velocity->y * 0.276 * params->Spread; local_40.x = (params->PositionOffset).x + position->x; shotVelocity.y = velocity->x * 0.276 * params->Spread + velocity->y * 0.961; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->y * 0.276 * params->Spread + velocity->x * 0.961; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->y * 0.961 - velocity->x * 0.276 * params->Spread; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); break; case 2: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); spawner = self; uVar7 = 0; shotVelocity.x = position->x + (params->PositionOffset).x; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&shotVelocity,velocity,(Entity *)self,0,spawnSeed ); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.961 * 0.9 - velocity->y * 0.276 * 0.9 * params->Spread; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->x * 0.276 * 0.9 * params->Spread + velocity->y * 0.961 * 0.9; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = velocity->y * 0.276 * 0.9 * params->Spread + velocity->x * 0.961 * 0.9; shotVelocity.y = velocity->y * 0.961 * 0.9 - velocity->x * 0.276 * 0.9 * params->Spread; goto LAB_006cb713; case 3: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); spawner = self; uVar7 = 0; shotVelocity.x = (params->PositionOffset).x + position->x; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&shotVelocity,velocity,(Entity *)self,0,spawnSeed ); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.914 - velocity->y * 0.407 * params->Spread; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->x * 0.407 * params->Spread + velocity->y * 0.914; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = velocity->y * 0.407 * params->Spread + velocity->x * 0.914; shotVelocity.y = velocity->y * 0.914 - velocity->x * 0.407 * params->Spread; goto LAB_006cb8ff; case 4: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); spawner = self; uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.99 - velocity->y * 0.139 * params->Spread; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->x * 0.139 * params->Spread + velocity->y * 0.99; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->y * 0.139 * params->Spread + velocity->x * 0.99; local_40.x = (params->PositionOffset).x + position->x; shotVelocity.y = velocity->y * 0.99 - velocity->x * 0.139 * params->Spread; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.914 * 0.9 - velocity->y * 0.407 * 0.9 * params->Spread; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->x * 0.407 * 0.9 * params->Spread + velocity->y * 0.914 * 0.9; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->y * 0.407 * 0.9 * params->Spread + velocity->x * 0.914 * 0.9; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->y * 0.914 * 0.9 - velocity->x * 0.407 * 0.9 * params->Spread; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); break; case 5: puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); spawner = self; uVar7 = 0; shotVelocity.x = (params->PositionOffset).x + position->x; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&shotVelocity,velocity,(Entity *)self,0,spawnSeed ); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.978 - velocity->y * 0.208 * params->Spread; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->x * 0.208 * params->Spread + velocity->y * 0.978; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->y * 0.208 * params->Spread + velocity->x * 0.978; local_40.x = (params->PositionOffset).x + position->x; shotVelocity.y = velocity->y * 0.978 - velocity->x * 0.208 * params->Spread; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->x * 0.914 - velocity->y * 0.407 * params->Spread; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->x * 0.407 * params->Spread + velocity->y * 0.914; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = velocity->y * 0.407 * params->Spread + velocity->x * 0.914; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = velocity->y * 0.914 - velocity->x * 0.407 * params->Spread; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); break; case 6: local_28 = velocity->x; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); spawner = self; uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = local_28; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = 0.0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = -local_28; uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; local_40.x = (params->PositionOffset).x + position->x; shotVelocity.y = 0.0; local_40.y = (params->PositionOffset).y + position->y; local_30 = shotVelocity.x; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = local_28; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.x = 0.0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = 0.0; shotVelocity.y = local_30; LAB_006cb8ff: uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; local_40.x = (params->PositionOffset).x + position->x; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); break; case 7: local_28 = velocity->x * 0.70710677; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); spawnSeed = Random(); spawner = self; uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = local_28; shotVelocity.y = local_28; local_40.x = position->x + (params->PositionOffset).x; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = local_28; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.x = -local_28; local_40.y = (params->PositionOffset).y + position->y; local_2c = shotVelocity.x; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; shotVelocity.x = local_28; uVar6 = 0; shotVelocity.y = local_2c; local_40.x = (params->PositionOffset).x + position->x; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = local_2c; shotVelocity.y = local_2c; goto LAB_006cb713; case 8: local_28 = velocity->x; spawnSeed = Random(); spawner = self; uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = local_28; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.y = 0.0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = -local_28; uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; local_40.x = (params->PositionOffset).x + position->x; shotVelocity.y = 0.0; local_40.y = (params->PositionOffset).y + position->y; local_30 = shotVelocity.x; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)spawner,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = local_28; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.x = 0.0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = local_30; local_40.x = (params->PositionOffset).x + position->x; shotVelocity.x = 0.0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); local_28 = local_28 * 0.70710677; spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.x = local_28; shotVelocity.y = local_28; local_40.x = position->x + (params->PositionOffset).x; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; shotVelocity.y = local_28; local_40.x = position->x + (params->PositionOffset).x; shotVelocity.x = -local_28; local_40.y = (params->PositionOffset).y + position->y; local_2c = shotVelocity.x; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; shotVelocity.x = local_28; uVar6 = 0; shotVelocity.y = local_2c; local_40.x = (params->PositionOffset).x + position->x; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); std::vector::_Emplace_reallocate(0,&local_34); spawnSeed = Random(); shotVelocity.x = local_2c; shotVelocity.y = local_2c; LAB_006cb713: uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; local_40.x = position->x + (params->PositionOffset).x; uVar6 = 0; local_40.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&local_40,&shotVelocity,(Entity *)self,0, spawnSeed); local_34 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); break; case 9: local_34 = params->CircleAngle; local_30 = (float)(int)(velocity->y + 0.5); local_40.y = 6.2831855 / (float)(int)local_30; local_2c = velocity->x; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puVar2 = (undefined1 *)((int)register0x00000010 + -4); if (0 < (int)local_30) { do { local_34 = local_34 + local_40.y; shotVelocity.x = cos(local_34); shotVelocity.x = shotVelocity.x * local_2c; local_28 = shotVelocity.x; shotVelocity.y = sin(local_34); local_38 = (params->FireDirectionLimit).x; shotVelocity.y = shotVelocity.y * local_2c; if ((local_38 == g_vectorZero.x) && ((params->FireDirectionLimit).y == g_vectorZero.y)) { LAB_006cc917: spawnSeed = Random(); uVar7 = 0; castDstType = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; spawnPos.x = position->x + (params->PositionOffset).x; uVar6 = 0; spawnPos.y = (params->PositionOffset).y + position->y; spawned = Game::Spawn(g_game,9,params->Variant,&spawnPos,&shotVelocity,(Entity *)self,0, spawnSeed); local_38 = (float)__RTDynamicCast(spawned,uVar6,castSrcType,castDstType,uVar7); if (projListCursor == (float *)0x0) { std::vector::_Emplace_reallocate(0,&local_38); projListCursor = projListEnd; } else { *projListCursor = local_38; projListEnd = projListCursor + 1; projListCursor = projListEnd; } } else { fVar4 = sqrtf(shotVelocity.y * shotVelocity.y + local_28 * local_28); if (fVar4 <= 0.0) { fVar4 = shotVelocity.y; } else { local_28 = (1.0 / fVar4) * local_28; fVar4 = shotVelocity.y * (1.0 / fVar4); } fVar4 = fVar4 * (params->FireDirectionLimit).y + local_38 * local_28; if (params->DotProductLimit <= fVar4 && fVar4 != params->DotProductLimit) goto LAB_006cc917; } local_30 = (float)((int)local_30 + -1); } while (local_30 != 0.0); local_30 = 0.0; puVar2 = puStack_20; } goto LAB_006cc9af; default: puVar2 = (undefined1 *)((int)register0x00000010 + -4); goto LAB_006cc9af; } projListEnd = (float *)0x0; std::vector::_Emplace_reallocate(0,&local_34); projListCursor = projListEnd; puVar2 = puStack_20; LAB_006cc9af: puStack_20 = puVar2; fVar4 = (float)((int)projListCursor >> 2); local_34 = 0.0; local_2c = fVar4; if (fVar4 != 0.0) { do { if (*(int *)((int)local_34 * 4) == 0) { KAGE_LogMessage(0x10,(byte *)"Failed to spawn Projectile"); fVar4 = local_2c; } local_34 = (float)((int)local_34 + 1); } while ((uint)local_34 < (uint)fVar4); } if ((((params[1].GridCollision == 0) && (mode != 6)) && (mode != 7)) && ((mode != 8 && (mode != 9)))) { if (fVar4 != 0.0) { projIndex = 0; do { *(undefined4 *)(*(int *)(projIndex * 4) + 0x414) = 0xc0400000; projSlot = (int *)(projIndex * 4); projIndex = projIndex + 1; *(undefined4 *)(*projSlot + 0x418) = 0x3dcccccd; } while ((uint)projIndex < (uint)fVar4); } if (((mode == 2) || (mode == 4)) || (mode == 5)) { if (fVar4 == 0.0) { ExceptionList = local_1c; return; } fVar5 = 0.0; do { projectile = *(Entity_Projectile **)((int)fVar5 * 4); fVar5 = (float)((int)fVar5 + 1); projectile->_fallingSpeed = projectile->_fallingSpeed - 1.0; selfVelY = (self->_velocity).y; (projectile->_velocity).x = (self->_velocity).x * 0.4 + (projectile->_velocity).x * 1.2; (projectile->_velocity).y = selfVelY * 0.4 + (projectile->_velocity).y * 1.2; } while ((uint)fVar5 < (uint)fVar4); goto LAB_006ccb09; } } if (fVar4 == 0.0) { ExceptionList = local_1c; return; } LAB_006ccb09: local_28 = 0.0; do { iVar1 = *(int *)((int)local_28 * 4); *(float *)(iVar1 + 0x410) = params->HeightModifier + *(float *)(iVar1 + 0x410); *(float *)(iVar1 + 0x414) = params->FallingSpeedModifier + *(float *)(iVar1 + 0x414); *(float *)(iVar1 + 0x418) = *(float *)(iVar1 + 0x418) + params->FallingAccelModifier; *(float *)(iVar1 + 0x420) = params->Scale; fVar4 = params[1].HeightModifier; if (fVar4 < 0.0) { if (params->Scale <= 1.15) { fVar4 = 1.0; } else { fVar4 = 2.0; } } (**(code **)(**(int **)((int)local_28 * 4) + 0x40))(fVar4,uVar3); iVar1 = *(int *)((int)local_28 * 4); fVar4 = params->VelocityMulti; *(float *)(iVar1 + 0x360) = *(float *)(iVar1 + 0x360) * params->VelocityMulti; *(float *)(iVar1 + 0x364) = *(float *)(iVar1 + 0x364) * fVar4; *(uint *)(iVar1 + 0x438) = *(uint *)(iVar1 + 0x438) | (uint)params->BulletFlags; *(uint *)(iVar1 + 0x43c) = *(uint *)(iVar1 + 0x43c) | *(uint *)((int)¶ms->BulletFlags + 4); (**(code **)(**(int **)((int)local_28 * 4) + 0x3c))(¶ms->Color,0xffffffff,0xff,0,1); spawner = self; fVar5 = local_28; fVar4 = (params->TargetPosition).y; iVar1 = *(int *)((int)local_28 * 4); *(float *)(iVar1 + 0x334) = (params->TargetPosition).x; *(float *)(iVar1 + 0x338) = fVar4; *(float *)(iVar1 + 0x424) = params->HomingStrength; *(float *)(*(int *)((int)local_28 * 4) + 0x428) = params->CurvingStrength; *(float *)(*(int *)((int)local_28 * 4) + 0x42c) = params->Acceleration; *(int *)(*(int *)((int)local_28 * 4) + 0x448) = params->WiggleFrameOffset; iVar1 = *(int *)((int)local_28 * 4); changeFlagsWord = (uint *)(iVar1 + 0x450); *changeFlagsWord = *changeFlagsWord | (uint)params->ChangeFlags; changeFlagsWord = (uint *)(iVar1 + 0x454); *changeFlagsWord = *changeFlagsWord | *(uint *)((int)¶ms->ChangeFlags + 4); *(float *)(*(int *)((int)local_28 * 4) + 0x458) = params->ChangeVelocity; *(int *)(*(int *)((int)local_28 * 4) + 0x45c) = params->ChangeTimeout; *(undefined1 *)(*(int *)((int)local_28 * 4) + 0x440) = *(undefined1 *)¶ms[1].FallingAccelModifier; *(float *)(*(int *)((int)local_28 * 4) + 0x358) = params->DepthOffset - (params->PositionOffset).y; fVar4 = *(float *)((int)local_28 * 4); if ((*(float *)((int)fVar4 + 0x410) <= -50.0 && *(float *)((int)fVar4 + 0x410) != -50.0) && ((*(uint *)((int)fVar4 + 0x438) & 0x20000) == 0)) { *(undefined4 *)(*(int *)((int)local_28 * 4) + 0x188) = 0; fVar4 = (float)*(int *)((int)local_28 * 4); } local_28 = fVar4; fVar5 = (float)((int)fVar5 + 1); *(float *)((int)local_28 + 0x470) = params[1].FallingSpeedModifier; local_28 = fVar5; } while ((uint)fVar5 < (uint)local_2c); fVar4 = 0.0; do { fire_projectile_from_params(spawner,*(Entity_Projectile **)((int)fVar4 * 4)); fVar4 = (float)((int)fVar4 + 1); } while ((uint)fVar4 < (uint)local_2c); ExceptionList = local_1c; return; } //@@ 006ccdd0 Entity_NPC::FireBossProjectiles /* ZHL [exact] __thiscall Entity_Projectile* Entity_NPC::FireBossProjectiles(int32_t numProjectiles, Vector const& targetPos, float trajectoryModifier, ProjectileParams const& params); prototype: REPENTOGON, confirmed by RET 16 */ Entity_Projectile * __thiscall Entity_NPC::FireBossProjectiles (Entity_NPC *this,int numProjectiles,void *targetPos,float trajectoryModifier,void *params ) { byte isShrunk; uint uVar1; Entity *spawned; Entity_Projectile *projectile; uint changeFlagsLow; int iVar3; float fVar4; float fVar5; float targetDirX; float targetDirY; EntityPtr *local_4c; float scaleMultiplier; float fallingAccel; Vector velocity; Vector spawnPos; EntityRef sourceRef; undefined4 changeFlagsLow; uint *projectileFlagsHigh; scaleMultiplier = 1.0; if ((this->_flags & 0x40000000000000) != 0) { scaleMultiplier = 0.8; } if (numProjectiles < 1) { return (Entity_Projectile *)0x0; } fallingAccel = trajectoryModifier * 0.1 + 0.32; do { if ((*(float *)targetPos == g_vectorZero.x) && (*(float *)((int)targetPos + 4) == g_vectorZero.y)) { uVar1 = Random(); fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_4c = (EntityPtr *)(fVar4 + fVar4); fVar4 = cos((float)local_4c); fVar4 = fVar4 * 7.0; velocity.y = sin((float)local_4c); velocity.y = velocity.y * 7.0; } else { targetDirY = *(float *)((int)targetPos + 4) - (this->_pos).y; targetDirX = *(float *)targetPos - (this->_pos).x; fVar4 = sqrtf(targetDirY * targetDirY + targetDirX * targetDirX); if (0.0 < fVar4) { targetDirX = (1.0 / fVar4) * targetDirX; targetDirY = targetDirY * (1.0 / fVar4); } uVar1 = Random(); fVar5 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar5 = fVar5 + fVar5; uVar1 = Random(); local_4c = (EntityPtr *) ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10); fVar4 = cos(fVar5); fVar4 = fVar4 * (float)local_4c * 3.5 + targetDirX * 7.0; fVar5 = sin(fVar5); velocity.y = fVar5 * (float)local_4c * 3.5 + targetDirY * 7.0; } velocity.x = fVar4; uVar1 = Random(); spawnPos.x = *(float *)((int)params + 0x60) + (this->_pos).x; spawnPos.y = (this->_pos).y + *(float *)((int)params + 100); spawned = Game::SpawnEx(g_game,9,*(uint *)((int)params + 0x94),&spawnPos,&velocity, (Entity *)this,0,uVar1,0); projectile = (Entity_Projectile *) __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor,0); projectile->_fallingAccel = fallingAccel; uVar1 = Random(); projectile->_fallingSpeed = (5.0 - (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 30.0 * 0.8) - trajectoryModifier; uVar1 = Random(); changeFlagsLow = Random(); projectile->_scale = (((float)(uVar1 & 1) + 0.0) * 0.4 + 0.9 + (float)((double)(int)changeFlagsLow + __uint_to_double_fixup[-((int)changeFlagsLow >> 0x1f)]) * 2.3283064e-10 * 0.05) * *(float *)((int)params + 0x14) * scaleMultiplier; fVar4 = *(float *)((int)params + 0x9c); if (fVar4 < 0.0) { fVar4 = 1.0; } (**(code **)(*(int *)projectile + 0x40))(fVar4); *(uint *)&projectile->_projectileFlags = (uint)projectile->_projectileFlags | *(uint *)((int)params + 0x58); projectileFlagsHigh = (uint *)((int)&projectile->_projectileFlags + 4); *projectileFlagsHigh = *projectileFlagsHigh | *(uint *)((int)params + 0x5c); iVar3 = *(int *)projectile; projectile->_height = *(float *)((int)params + 4) + projectile->_height; projectile->_fallingAccel = projectile->_fallingAccel + *(float *)((int)params + 0xc); projectile->_fallingSpeed = *(float *)((int)params + 8) + projectile->_fallingSpeed; fVar4 = *(float *)((int)params + 0x10); (projectile->_velocity).y = fVar4 * (projectile->_velocity).y; (projectile->_velocity).x = fVar4 * (projectile->_velocity).x; (**(code **)(iVar3 + 0x3c))((int)params + 0x2c,0xffffffff,0xff,0,1); if (projectile->_parent != (EntityPtr)0x0) { local_4c = &projectile->_parent; std::multiset::erase(&local_4c); } projectile->_parent = (EntityPtr)this; std::multiset::insert(&projectile->_parent); projectile->_acceleration = *(float *)((int)params + 0x24); fVar4 = *(float *)((int)params + 0x6c); (projectile->_targetPosition).x = *(float *)((int)params + 0x68); (projectile->_targetPosition).y = fVar4; changeFlagsLow = *(undefined4 *)((int)params + 0x80); *(undefined4 *)((int)&projectile->_changeFlags + 4) = *(undefined4 *)((int)params + 0x84); *(undefined4 *)&projectile->_changeFlags = changeFlagsLow; projectile->_changeVelocity = *(float *)((int)params + 0x88); projectile->_changeTimeout = *(int *)((int)params + 0x8c); projectile[1]._damageEvents._capacity = *(void **)((int)params + 0xa0); isShrunk = Entity::HasEntityFlags((Entity *)this,0x1000000); if ((isShrunk != 0) && (*(int *)((int)params + 0x94) == 0xb)) { sourceRef._type = this->_type; sourceRef._position.x = (this->_pos).x; sourceRef._position.y = (this->_pos).y; sourceRef._variant = this->_variant; sourceRef._spawnerType = this->_spawnerType; sourceRef._spawnerVariant = this->_spawnerVariant; sourceRef._velocity.x = (this->_velocity).x; sourceRef._velocity.y = (this->_velocity).y; local_4c = (EntityPtr *)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar1 = 0; } else { uVar1 = 2; } if ((this->_flags & 0x40000000000000) == 0) { changeFlagsLow = 0; } else { changeFlagsLow = 4; } sourceRef._flags = changeFlagsLow | uVar1 | (uint)local_4c; sourceRef._entity = this; Entity::AddShrink((Entity *)projectile,&sourceRef,-0x96,0,0); } if (this->_isChampion == 0) { iVar3 = -1; } else { iVar3 = this->_championColorIdx; } Entity_Projectile::apply_spawn_flags(projectile,iVar3,this->_scale,this->_flags,(Entity *)this); if (projectile->_parent != (EntityPtr)0x0) { local_4c = &projectile->_parent; std::multiset::erase(&local_4c); } projectile->_parent = (EntityPtr)this; std::multiset::insert(&projectile->_parent); numProjectiles = numProjectiles + -1; projectile->_spawnerType = this->_type; } while (numProjectiles != 0); return projectile; } //@@ 006cd410 Entity_NPC::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 23] prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_NPC::HandleCollision(Entity_NPC *this,Entity *collider,byte low) { code *pcVar1; EntityPtr EVar2; byte bVar3; char cVar4; uint uVar5; int iVar6; BitSet128 *tmpFlags; float fVar7; RoomDescriptor *targetRoom; Entity *pEVar8; Entity *colliderStatusTarget; ColorMod *extraout_EAX; LayerState *layer; EntityRef *entityRef; float *pfVar9; Vector *tmpVec; undefined4 uVar10; Entity_Player *pEVar11; Entity_Player *this_00; uint extraout_ECX; uint extraout_ECX_00; uint extraout_ECX_01; uint extraout_ECX_02; uint extraout_ECX_03; byte *animNameBuf; uint extraout_ECX_04; uint uVar12; uint extraout_ECX_05; uint extraout_ECX_06; uint extraout_ECX_07; uint extraout_ECX_08; uint extraout_ECX_09; uint extraout_ECX_10; uint extraout_ECX_11; uint extraout_ECX_12; uint extraout_ECX_13; uint extraout_ECX_14; uint extraout_ECX_15; uint extraout_ECX_16; uint extraout_ECX_17; uint extraout_ECX_18; uint extraout_ECX_19; uint extraout_ECX_20; uint extraout_ECX_21; uint extraout_ECX_22; uint extraout_ECX_23; uint extraout_ECX_24; byte extraout_DL; byte extraout_DL_00; undefined1 *size; int randomCount; EntityPtr EVar13; Entity_NPC *npc; bool bVar14; float fVar15; undefined1 auVar16 [12]; float fVar17; undefined1 in_stack_fffffe5c [16]; undefined1 auVar18 [16]; undefined1 auVar19 [16]; int iVar20; ColorMod *other; EntityRef sourceRef; BitSet128 local_150; Entity_NPC *npcCopy; undefined1 local_13c [8]; Vector local_134; Vector local_12c; undefined1 local_124 [8]; Vector VStack_11c; Vector local_114; Vector local_10c; int colliderVariant; char isRelated; byte local_fd; Entity_Player *local_fc; byte isResult; int colliderType; Entity *colliderCopy; int npcType; ProjectileParams projParams; undefined1 local_40 [20]; undefined1 animName [16]; uint animNameSize; undefined1 *animNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isSegmentedType; uint *roomFlags; local_8 = 0xffffffff; puStack_c = &LAB_00afab2d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(animName + 0x28); ExceptionList = &local_10; colliderCopy = collider; auVar18._0_12_ = in_stack_fffffe5c._0_12_; auVar18._12_4_ = 0x6cd458; npcCopy = this; local_14 = uVar5; iVar6 = LuaEngine::PreNPCCollision((LuaEngine *)this,this,collider,low); if (iVar6 == 1) { ExceptionList = local_10; return 1; } if (iVar6 == -1) { ExceptionList = local_10; return 0; } iVar6 = this->_type; isResult = 1; if (iVar6 == 0x362) { iVar6 = collider->_type; if (iVar6 == 2) { ExceptionList = local_10; return 1; } if (iVar6 == 9) { ExceptionList = local_10; return 1; } if (iVar6 == 4) { ExceptionList = local_10; return 1; } iVar6 = this->_type; } uVar12 = collider->_type; if (uVar12 == 1) { if ((iVar6 == 0x21) && (this->_variant == 4)) { iVar6 = Entity_Player::GetHealthType((Entity_Player *)collider); if (iVar6 == 2) { ExceptionList = local_10; return 1; } bVar3 = Entity_Player::HasInstantDeathCurse(this_00); if (bVar3 != 0) { ExceptionList = local_10; return 1; } uVar12 = extraout_ECX; if (collider[8]._sprite._filename._buf[1] != '\0') { ExceptionList = local_10; return 1; } } } else if (uVar12 == 2) { tmpFlags = BitSet128::operator_or ((BitSet128 *)local_13c,&g_tearFlagExplosive,&g_tearFlagLudovico); local_124._0_4_ = *(undefined4 *)((int)&collider[1]._pendingDamageFlags + 4); local_124._4_4_ = collider[1]._index; VStack_11c.x = (float)collider[1]._collisionIndex; VStack_11c.y = (float)collider[1]._type; tmpFlags = BitSet128::operator_and(&local_150,(BitSet128 *)local_124,tmpFlags); uVar12 = (uint)tmpFlags->_l | *(uint *)((int)&tmpFlags->_l + 4); if ((((uVar12 == 0) && (uVar12 = (uint)tmpFlags->_h | *(uint *)((int)&tmpFlags->_h + 4), uVar12 == 0)) && (this->_type == 0x29)) && (this->_variant == 4)) { VStack_11c.x = (collider->_velocity).x; VStack_11c.y = (collider->_velocity).y; bVar3 = CanBeDamagedFromVelocity(this,collider->_velocity); uVar12 = extraout_ECX_00; if (bVar3 == 0) { bVar3 = Entity::HasEntityFlags((Entity *)this,0x1000000); uVar12 = extraout_ECX_01; if (bVar3 == 0) { uVar12 = Random(); auVar18._8_4_ = 0x6cd5f3; auVar18._12_4_ = 0xab; play_sound_with_fart_seed (0xab,0.75,2,0, (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.08 + 0.85); uVar12 = extraout_ECX_02; if (this->_projectileCooldown < 1) { local_fc = (Entity_Player *)0x0; local_10c.y = 1.0; ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState,(std_string *)animName); local_8 = 0; animNameBuf = animName; if (&DAT_0000000f < animNameCapacity) { animNameBuf = (byte *)animName._0_4_; } bVar3 = str_eq(animNameBuf,animNameSize,(byte *)&DAT_00b1cde4,2); if (bVar3 == 0) { animNameBuf = animName; if (&DAT_0000000f < animNameCapacity) { animNameBuf = (byte *)animName._0_4_; } bVar3 = str_eq(animNameBuf,animNameSize,&DAT_00b60d94,4); if (bVar3 != 0) { if ((this->_sprite)._flipX == 0) { local_fc = (Entity_Player *)0x3f800000; } else { local_fc = (Entity_Player *)&DAT_bf800000; } local_10c.y = 0.0; } } else { local_fc = (Entity_Player *)0x0; local_10c.y = (float)&DAT_bf800000; } VStack_11c.x = (collider->_velocity).x; VStack_11c.y = (collider->_velocity).y; tmpVec = Vector::Normalized(&VStack_11c,&local_114); if (ABS(local_10c.y * tmpVec->y + (float)local_fc * tmpVec->x) < 0.3) { VStack_11c.x = (collider->_pos).x - (this->_pos).x; VStack_11c.y = (collider->_pos).y - (this->_pos).y; tmpVec = Vector::Normalized(&VStack_11c,&local_114); local_fc = (Entity_Player *)tmpVec->x; local_10c.y = tmpVec->y; } ProjectileParams::ProjectileParams(&projParams); iVar6 = 1; pfVar9 = (float *)&DAT_00b64e30; do { if (collider[1]._pendingDamage <= *pfVar9 + 0.05) break; pfVar9 = pfVar9 + 1; iVar6 = iVar6 + 1; } while ((int)pfVar9 < 0xb64e60); VStack_11c.x = (collider->_velocity).x; iVar20 = 0xd; if (iVar6 < 0xd) { iVar20 = iVar6; } fVar7 = (collider->_velocity).y; projParams.Scale = ((float)iVar20 - 3.0) / 3.0; fVar15 = (float)local_fc * VStack_11c.x + local_10c.y * fVar7; fVar15 = fVar15 + fVar15; VStack_11c.x = VStack_11c.x - (float)local_fc * fVar15; VStack_11c.y = fVar7 - local_10c.y * fVar15; auVar18._8_4_ = 0x6cd845; auVar18._12_4_ = &this->_pos; FireProjectiles(this,&this->_pos,&VStack_11c,0,&projParams); local_8 = 0xffffffff; uVar12 = extraout_ECX_03; if (&DAT_0000000f < animNameCapacity) { size = animNameCapacity + 1; animNameBuf = (byte *)animName._0_4_; if ((undefined1 *)0xfff < size) { animNameBuf = *(byte **)(animName._0_4_ + -4); size = animNameCapacity + 0x24; if ((byte *)0x1f < (byte *)(animName._0_4_ + (-4 - (int)animNameBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(animNameBuf,(uint)size); uVar12 = extraout_ECX_04; } } } } } } if (((collider->_type == 1) && (this->_type == 0x3c5)) && (this->_variant == 10)) { fVar7 = (float)Room::GetGridIndex(g_game->_room,&this->_targetPosition); local_114.y = fVar7; local_12c.y = 0.0; local_fc = (Entity_Player *)0x724; do { local_12c.y = (float)&((Entity_Player *)local_12c.y)->field_0x1; if ((((uint)local_12c.y < &DAT_00000009) && (local_10c.y = *(float *)((int)local_fc + (int)g_game->_room), (GridEntity_Door *)local_10c.y != (GridEntity_Door *)0x0)) && (cVar4 = GridEntity_Door::CanBlowOpen((GridEntity_Door *)local_10c.y,uVar5), cVar4 != '\0') ) { cVar4 = room_grid_flood_fill(local_114.y,*(int *)((int)local_10c.y + 0x24)); if (cVar4 != '\0') { iVar20 = -1; iVar6 = *(int *)((int)local_10c.y + 0x394); if (iVar6 < -99) { targetRoom = Level::GetRoomByIdx((Level *)g_game,iVar6,-1); iVar20 = targetRoom->Dimension; auVar19._0_8_ = auVar18._0_8_; auVar19._8_4_ = targetRoom->GridIndex; auVar19._12_4_ = *(int *)((int)local_10c.y + 0x164); } else { auVar19._0_8_ = auVar18._0_8_; auVar19._8_4_ = iVar6; auVar19._12_4_ = *(int *)((int)local_10c.y + 0x164); } Game::StartRoomTransition (g_game,auVar19._8_4_,auVar19._12_4_,0x13,(Entity_Player *)collider,iVar20); EVar13 = (g_game->_roomTransition)._minecart; local_134.y = (float)&(g_game->_roomTransition)._minecart; if (EVar13 != (EntityPtr)this) { if (EVar13 != (EntityPtr)0x0) { local_114.y = local_134.y; std::multiset::erase(&local_114.y); } *(Entity_NPC **)local_134.y = this; std::multiset::insert(local_134.y); } roomFlags = (uint *)(*(int *)((int)g_game->_room + 4) + 0x44); *roomFlags = *roomFlags | 4; Entity_Player::PlayExtraAnimation((Entity_Player *)collider,(byte *)"MinecartEnter"); collider[6]._entityRef4._velocity.y = (this->_targetPosition).x; collider[6]._entityRef4._flags = (int)(this->_targetPosition).y; collider[1].field_0x4 = 0; ExceptionList = local_10; return 1; } } uVar12 = (int)local_fc + 4; local_fc = (Entity_Player *)uVar12; } while (uVar12 < 0x744); } if ((*(int *)&g_game->_deathmatchManager < 2) || (collider->_type != 1)) { local_fc = (Entity_Player *)collider->_type; if (&local_fc[-1].field_0x26c2 < (undefined1 *)0x3de) goto LAB_006cda58; } else { local_fc = (Entity_Player *)0x1; LAB_006cda58: if (((this->_flags & 0x8000000000000) == 0) && (bVar3 = Entity::HasEntityFlags(collider,0x8000000000000), bVar3 == 0)) { uVar12 = extraout_ECX_05; } else { pEVar8 = Entity::GetStatusEffectTarget((Entity *)this); colliderStatusTarget = Entity::GetStatusEffectTarget(colliderCopy); uVar12 = extraout_ECX_06; collider = colliderCopy; if (colliderStatusTarget != pEVar8) { isResult = 0; } } } if ((this->_type == 0x3c5) || (this->_minecart != (EntityPtr)0x0)) { if (local_fc == (Entity_Player *)0x3c5) { ExceptionList = local_10; return 1; } if (*(int *)((int)collider + 0x3d4) != 0) { ExceptionList = local_10; return 1; } } if ((this->_aiCallFlags & 4) != 0) { this->_collisionEntity = collider; this->_collisionIsLow = low; this->_collisionResult = -1; this->_aiCallPhase = 3; Entity_NPC_UpdateAI_dispatch(this); this->_aiCallPhase = 0; if (0 < this->_collisionResult) { ExceptionList = local_10; return 0; } uVar12 = extraout_ECX_07; if (this->_collisionResult == 0) { ExceptionList = local_10; return isResult; } } iVar6 = this->_type; if (iVar6 == 0x355) { if (this->_i1 == 2) { iVar6 = *(int *)((int)collider + 0x28); if (iVar6 == 4) { ExceptionList = local_10; return 1; } if (iVar6 == 2) { ExceptionList = local_10; return 1; } if (iVar6 == 9) { ExceptionList = local_10; return 1; } this->_i1 = 1; Color::Color((Color *)local_40); other = extraout_EAX; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,other); (this->_velocity).x = (this->_velocity).x * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; uVar10 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags & 0xfbffffff; *(undefined4 *)((int)&this->_flags + 4) = uVar10; iVar6 = this->_type; uVar12 = extraout_ECX_08; goto LAB_006cdbd1; } } else { LAB_006cdbd1: if (iVar6 == 0x397) { if (*(int *)((int)collider + 0x28) == 0x21) { ExceptionList = local_10; return 1; } } else if (iVar6 == 0x21) { if (*(int *)((int)collider + 0x28) == 0x397) { ExceptionList = local_10; return 1; } } else if ((iVar6 == 0x332) && (((this->_variant == 0 || (this->_variant == 1)) && (*(int *)((int)collider + 0x28) == 1)))) { bVar3 = Entity_Player::CanCrushRocks((Entity_Player *)collider); uVar12 = extraout_ECX_11; if (bVar3 != 0) { pcVar1 = *(code **)(*(int *)this + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),colliderCopy); (*pcVar1)(); ExceptionList = local_10; return 0; } } } iVar6 = this->_type; if (iVar6 == 0x21) { if (this->_variant == 0xb) { bVar3 = Entity::IsEnemy(collider); uVar12 = extraout_ECX_09; if ((bVar3 != 0) && ((*(int *)((int)collider + 0x28) != 0x21 || (*(int *)((int)collider + 0x2c) != 0xb)))) { Entity::IsFriendly((Entity *)this); bVar3 = Entity::IsFriendly(collider); uVar12 = extraout_ECX_10; if (bVar3 == extraout_DL) { ExceptionList = local_10; return 1; } } LAB_006cdccd: if (this->_variant == 0xb) goto LAB_006cdcd7; } } else { if (iVar6 == 0x332) { if ((this->_variant == 0) && (*(int *)((int)collider + 0x28) == 0x21)) { Morph(this,0x332,2,this->_subtype,-1); ExceptionList = local_10; return 0; } LAB_006cdcd7: if ((*(int *)((int)collider + 0x28) == 0x332) || ((*(int *)((int)collider + 0x28) == 0x21 && (*(int *)((int)collider + 0x2c) == 0xb)))) { Entity::IsFriendly((Entity *)this); bVar3 = Entity::IsFriendly(collider); uVar12 = extraout_ECX_12; if (bVar3 == extraout_DL_00) { ExceptionList = local_10; return 1; } } } else if (iVar6 == 0x21) goto LAB_006cdccd; iVar6 = this->_type; if (iVar6 == 0x333) { if (((*(int *)((int)collider + 0x28) == 1) && (bVar3 = Entity::HasEntityFlags((Entity *)this,0x20000000), bVar3 == 0)) || ((EntityPtr)collider == this->_target)) { LAB_006cdd6d: bVar3 = Entity::HasEntityFlags((Entity *)this,0x1000000); uVar12 = extraout_ECX_16; if (bVar3 == 0) { Game::BombDamage(g_game,&this->_pos,40.0,60.0,1,(Entity *)this,g_tearFlagsNone,4,0); uVar5 = Random(); Game::Spawn(g_game,1000,1,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_10; return 0; } } else { bVar3 = Entity::HasEntityFlags((Entity *)this,0x20000000); uVar12 = extraout_ECX_13; if (bVar3 != 0) { bVar3 = Entity::IsEnemy(collider); uVar12 = extraout_ECX_14; if (bVar3 != 0) { bVar3 = Entity::HasEntityFlags(collider,0x20000000); uVar12 = extraout_ECX_15; if (bVar3 == 0) goto LAB_006cdd6d; } } } if (*(int *)((int)collider + 0x28) == 0x335) { ExceptionList = local_10; return 1; } if (*(int *)((int)collider + 0x28) == 0x38a) { ExceptionList = local_10; return 1; } } else if (iVar6 == 0x13) { if ((this->_variant == 3) && (*(int *)((int)collider + 0x28) == 0x329)) { ExceptionList = local_10; return 1; } } else if ((((iVar6 == 0x396) && (this->_state == 6)) && ((*(int *)((int)collider + 0x28) == 0xd9 || (*(int *)((int)collider + 0x28) == 0x366))) ) && (8 < g_game->_frameCount - *(int *)((int)collider + 0x328))) { pcVar1 = *(code **)(*(int *)collider + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); (*pcVar1)(); uVar12 = extraout_ECX_17; } } pEVar8 = colliderCopy; iVar6 = this->_type; if (iVar6 == 0x336) { if ((this->_state == 0x10) && ((colliderCopy->_type == 1 || ((EntityPtr)colliderCopy == this->_target)))) { entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)this + 0x24))(entityRef); iVar6 = this->_type; uVar12 = extraout_ECX_18; goto LAB_006cdebf; } LAB_006cdee7: pEVar8 = colliderCopy; LAB_006cdeed: if (iVar6 == 0x38a) goto LAB_006cdef4; } else { LAB_006cdebf: if ((iVar6 != 0x38a) || (this->_variant != 1)) goto LAB_006cdee7; if (pEVar8->_type == 1) { entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)this + 0x24))(entityRef); iVar6 = this->_type; uVar12 = extraout_ECX_19; goto LAB_006cdeed; } LAB_006cdef4: if ((this->_minecart != (EntityPtr)0x0) && (10.0 < *(float *)((int)this->_minecart + 3000))) { local_134.y = *(float *)(*(int *)pEVar8 + 0x20); bVar3 = Entity::IsEnemy(pEVar8); if (bVar3 == 0) { ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); } else { ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); } (*(code *)local_134.y)(); uVar12 = extraout_ECX_20; } } if (this->_type == 0x393) { bVar14 = this->_variant == 1; } else { bVar14 = this->_type == 0x37d; } if (bVar14) { bVar3 = Entity::IsVulnerableEnemy(pEVar8,(Entity *)0x0); uVar12 = extraout_ECX_21; if (bVar3 != 0) { fVar7 = (this->_velocity).y; fVar15 = (this->_velocity).x; fVar7 = sqrtf(fVar15 * fVar15 + fVar7 * fVar7); uVar12 = extraout_ECX_22; if (10.0 < fVar7) { bVar3 = EntityList::HitListContains((EntityList *)&this->_hitList,pEVar8); uVar12 = extraout_ECX_23; if (bVar3 == 0) { FUN_00431620(pEVar8); pcVar1 = *(code **)(*(int *)pEVar8 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); (*pcVar1)(); uVar12 = extraout_ECX_24; } } } } pEVar8 = colliderCopy; if (this->_type == 0x387) { cVar4 = NpcHelper::visage_handle_collision(colliderCopy,uVar12); if (cVar4 != -1) { ExceptionList = local_10; return cVar4 != '\0'; } if ((pEVar8->_type == 0x387) && (this->_variant == 10)) { ExceptionList = local_10; return 1; } } iVar6 = this->_type; if (iVar6 == 0x390) { if (pEVar8->_type == 0x390) { ExceptionList = local_10; return 1; } } else if (iVar6 == 0x3b7) { if (pEVar8->_type == 0x3b7) { if (this->_variant != 10) { ExceptionList = local_10; return 1; } cVar4 = (**(code **)(*(int *)pEVar8 + 0x4c))(); if (cVar4 != '\0') { ExceptionList = local_10; return 1; } fVar7 = (this->_velocity).y; fVar15 = (this->_velocity).x; if (225.0 < fVar15 * fVar15 + fVar7 * fVar7) { ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)pEVar8 + 0x20))(); ExceptionList = local_10; return 1; } ExceptionList = local_10; return 1; } } else if (iVar6 == 0x19) { if ((this->_state == 5) && (pEVar8->_type == 1)) { entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)this + 0x24))(entityRef); ExceptionList = local_10; return 0; } } else if ((((iVar6 == 0x38e) && (pEVar8->_type == 0x355)) && (bVar3 = Entity::IsVulnerableEnemy(pEVar8,(Entity *)0x0), bVar3 != 0)) && (0.0 <= (pEVar8->_posOffset).y)) { pcVar1 = *(code **)(*(int *)pEVar8 + 0x24); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); (*pcVar1)(local_40 + 4); } EVar13 = (EntityPtr)colliderCopy; if (this->_type == 0x38d) { if (colliderCopy->_type == 0x38d) { ExceptionList = local_10; return 1; } if (((this->_variant == 10) && (this->_subtype != 0)) && ((bVar3 = Entity::IsVulnerableEnemy(colliderCopy,(Entity *)0x0), bVar3 != 0 && (60.0 < ((Entity *)EVar13)->_updateTime)))) { local_134.y = *(float *)EVar13; if (((Entity *)EVar13)->_type == 0x355) { ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); (**(code **)((int)local_134.y + 0x24))(local_40 + 4); ExceptionList = local_10; return 1; } ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); (**(code **)((int)local_134.y + 0x20))(); ExceptionList = local_10; return 1; } } npcType = this->_type; if (npcType == 0x333) { if (this->_variant == 1) { bVar14 = EVar13 == this->_parent; LAB_006ce1ed: if (bVar14) { ExceptionList = local_10; return 1; } } } else if (npcType == 0x37d) { bVar3 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero); if (bVar3 != 0) { bVar14 = ((Entity *)EVar13)->_type == 0x37d; goto LAB_006ce1ed; } } else if (npcType == 0x32f) { if (((Entity *)EVar13)->_type == 0x32f) { if (low == 0) { ExceptionList = local_10; return 1; } local_134.y = (this->_velocity).x; fVar7 = (this->_velocity).y; VStack_11c.x = (((this->_pos).x - local_134.y) - (((Entity *)EVar13)->_pos).x) + (((Entity *)EVar13)->_velocity).x; VStack_11c.y = (((this->_pos).y - fVar7) - (((Entity *)EVar13)->_pos).y) + (((Entity *)EVar13)->_velocity).y; local_114.y = fVar7; Vector::Normalized(&VStack_11c,&local_12c); fVar7 = local_12c.y * local_114.y + local_134.y * local_12c.x; (this->_velocity).x = local_134.y - local_12c.x * 2.0 * fVar7; (this->_velocity).y = local_114.y - local_12c.y * 2.0 * fVar7; fVar7 = (((Entity *)EVar13)->_velocity).x; fVar15 = (((Entity *)EVar13)->_velocity).y; fVar17 = local_12c.y * fVar15 + fVar7 * local_12c.x; (((Entity *)EVar13)->_velocity).x = fVar7 - local_12c.x * 2.0 * fVar17; (((Entity *)EVar13)->_velocity).y = fVar15 - local_12c.y * 2.0 * fVar17; ExceptionList = local_10; return 1; } } else if ((npcType == 0x390) && (((Entity *)EVar13)->_type == 0x355)) { pcVar1 = *(code **)(*(int *)EVar13 + 0x24); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)this); (*pcVar1)(local_40 + 4); ExceptionList = local_10; return 1; } npc = npcCopy; colliderVariant = ((Entity *)EVar13)->_variant; colliderType = ((Entity *)EVar13)->_type; local_10c.y = (float)this->_variant; if (npcType == 0x3c4) { if (colliderType != 1) goto LAB_006ce4af; (this->_v1).x = 0.0; LAB_006ce3ee: npc = this; if (npcType == 0x355) { if (((Entity *)EVar13)->_type == 0x355) { ExceptionList = local_10; return isResult; } if (EVar13 == (EntityPtr)*(Entity **)((int)this + 0x3c8)) { ExceptionList = local_10; return isResult; } } } else { if (npcType == 0x19c) { npcType = this->_deliriumBossType; local_10c.y = (float)this->_deliriumBossVariant; } LAB_006ce4af: if (colliderType == 0x19c) { colliderType = *(int *)&((Entity *)((int)EVar13 + 0x818))->_isInvicible; colliderVariant = (int)((Entity *)((int)EVar13 + 0x818))->_shrinkStatus1; } local_134.y = (float)colliderVariant; local_114.y = (float)colliderType; local_12c.y = (float)npcType; local_fc = (Entity_Player *)local_10c.y; if (npcType == 0x27) { if ((Entity_Player *)local_10c.y == (Entity_Player *)0x16) { bVar3 = Entity::IsActiveEnemy((Entity *)EVar13,0); if (bVar3 != 0) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000000); if (bVar3 == 0) { ExceptionList = local_10; return isResult; } } } } else if (npcType == 0x124) { if ((((Entity *)EVar13)->_type == 1) && (-4 < npcCopy->_i1)) { npcCopy->_i1 = 0; ExceptionList = local_10; return isResult; } } else if (npcType == 0x21) { if ((((Entity_Player *)local_10c.y == (Entity_Player *)0xa) || ((Entity_Player *)local_10c.y == (Entity_Player *)0xc)) || ((Entity_Player *)local_10c.y == (Entity_Player *)&DAT_0000000d)) { if (((Entity *)EVar13)->_type == 4) { ExceptionList = local_10; return 1; } bVar3 = Entity::IsEnemy((Entity *)EVar13); if (bVar3 != 0) { local_114.y = (float)*(code **)(*(int *)EVar13 + 0x20); bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000000); if (bVar3 == 0) { ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*(code *)local_114.y)(); ExceptionList = local_10; return isResult; } ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*(code *)local_114.y)(); ExceptionList = local_10; return isResult; } } } else { local_12c.y = local_10c.y; local_fc = (Entity_Player *)npcType; if (npcType == 0x328) { if (((Entity *)EVar13)->_type == 1) { if (0 < npcCopy->_projectileCooldown) { ExceptionList = local_10; return isResult; } if (npcCopy->_subtype == 0) { pfVar9 = (float *)NpcHelper::willo_slot(&VStack_11c,0); fVar7 = pfVar9[1] - (npc->_pos).y; fVar15 = *pfVar9 - (npc->_pos).x; fVar7 = sqrtf(fVar7 * fVar7 + fVar15 * fVar15); if (30.0 < fVar7) { ExceptionList = local_10; return isResult; } } } bVar3 = Entity::IsEnemy((Entity *)EVar13); if (bVar3 != 0) { ExceptionList = local_10; return isResult; } if (((Entity *)EVar13)->_type == 4) { ExceptionList = local_10; return isResult; } } else if (npcType == 0x32a) { if (npcCopy->_parent == EVar13) { ExceptionList = local_10; return isResult; } VStack_11c.y = (float)((Entity *)EVar13)->_type; if (VStack_11c.y == 1.13505e-42) { if (npcCopy->_parent != (EntityPtr)0x0) { ExceptionList = local_10; return isResult; } } else { EVar13 = (EntityPtr)colliderCopy; if ((VStack_11c.y == 2.8026e-45) && (npcCopy->_entityGridCollisionClass == 6)) { (npcCopy->_v1).x = 0.0; } } } else { local_114.y = (float)colliderVariant; local_134.y = local_10c.y; VStack_11c.y = (float)colliderType; if (npcType == 0x364) { if (((Entity *)EVar13)->_type == 0x364) { ExceptionList = local_10; return isResult; } if (((Entity *)EVar13)->_type == 0x358) { ExceptionList = local_10; return isResult; } } else { this = npcCopy; if (npcType != 0xde) goto LAB_006ce3ee; if (((Entity *)EVar13)->_type == 0x16) { ExceptionList = local_10; return isResult; } } } } } if (((*(int *)((int)npc + 0x34) == 0x369) && (*(EntityPtr *)((int)npc + 0x3bc) != (EntityPtr)0x0)) && (bVar3 = Entity::IsEnemy((Entity *)EVar13), bVar3 != 0)) { ExceptionList = local_10; return isResult; } if ((*(int *)((int)EVar13 + 0x28) == 1) && (((npcType == 0x124 || (npcType == 0xf5)) && (bVar3 = Entity_Player::CanCrushRocks((Entity_Player *)EVar13), bVar3 != 0)))) { pcVar1 = *(code **)(*(int *)npc + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),colliderCopy); (*pcVar1)(); ExceptionList = local_10; return isResult; } if (npcType == 0x134) { if (*(int *)((int)EVar13 + 0x28) == 0x19d) { ExceptionList = local_10; return isResult; } EVar2 = *(EntityPtr *)((int)npc + 0x3bc); if (EVar13 == EVar2) { ExceptionList = local_10; return isResult; } if (((*(int *)((int)EVar13 + 0x28) == 0x134) && (EVar2 != (EntityPtr)0x0)) && (EVar2 == *(EntityPtr *)((int)EVar13 + 0x3bc))) { ExceptionList = local_10; return isResult; } } else if (npcType == 0x194) { if (*(int *)((int)EVar13 + 0x28) == 0x19b) { if (*(int *)((int)EVar13 + 0x2c) != 0) { ExceptionList = local_10; return isResult; } } else if ((*(int *)((int)EVar13 + 0x28) == 4) && (*(int *)((int)npc + 0x34) == 0x19b)) { ExceptionList = local_10; return isResult; } if (((*(int *)((int)npc + 0x34) == 0x19b) && (colliderType == 0x19b)) && (0x1e < *(int *)((int)npc + 0x410))) { VStack_11c.x = ((Vector *)((int)npc + 0x33c))->x - *(float *)((int)EVar13 + 0x33c); VStack_11c.y = *(float *)((int)npc + 0x340) - *(float *)((int)EVar13 + 0x340); Vector::Normalized(&VStack_11c,&local_114); fVar7 = ((Vector *)((int)npc + 0x360))->x; fVar17 = local_114.y * *(float *)((int)npc + 0x364) + fVar7 * local_114.x; fVar17 = fVar17 + fVar17; fVar15 = *(float *)((int)npc + 0x364); ((Vector *)((int)npc + 0x360))->x = fVar7 - fVar17 * local_114.x; *(float *)((int)npc + 0x364) = fVar15 - local_114.y * fVar17; } } else { if (((npcType == 0x27) || (npcType == 0xfb)) && ((colliderType == 0x19a && (bVar3 = ANM2::IsPlaying((ANM2 *)((int)EVar13 + 0x48),(byte *)"RollLoop"), bVar3 != 0)))) goto LAB_006ceb08; if (((npcType == 0x19a) && (bVar3 = ANM2::IsPlaying((ANM2 *)((int)npc + 0x48),(byte *)"RollLoop"), bVar3 != 0)) && ((colliderType == 2 && (*(int *)((int)EVar13 + 0x34) == 1)))) { fVar7 = *(float *)((int)EVar13 + 0x364); fVar15 = *(float *)((int)npc + 0x364); ((Vector *)((int)npc + 0x360))->x = *(float *)((int)EVar13 + 0x360) * 0.3 + ((Vector *)((int)npc + 0x360))->x; *(float *)((int)npc + 0x364) = fVar7 * 0.3 + fVar15; } } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000); if (((bVar3 != 0) && (colliderType == 1)) && (cVar4 = (**(code **)(*(int *)npc + 0x4c))(), cVar4 == '\0')) { LAB_006ceb08: entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x24))(entityRef); ExceptionList = local_10; return isResult; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000000); if (bVar3 != 0) { ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)EVar13); bVar3 = Entity::IsDamageSourceFriendly((Entity *)npc,(EntityRef *)(local_40 + 4)); if (bVar3 != 0) { if (colliderType == 1) { ExceptionList = local_10; return isResult; } if (colliderType == 3) { ExceptionList = local_10; return isResult; } bVar3 = Entity::IsEnemy((Entity *)EVar13); if ((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)EVar13,0x20000000), bVar3 != 0)) { ExceptionList = local_10; return isResult; } } } if ((low == 0) && (colliderType == 9)) { ExceptionList = local_10; return isResult; } VStack_11c.y = *(float *)((int)g_game->_room + 8); if (((((Entity *)VStack_11c.y == (Entity *)&DAT_0000000b) || ((Entity *)VStack_11c.y == (Entity *)&DAT_00000011)) || ((bVar3 = Game::IsGreedMode(g_game), bVar3 != 0 && ((Entity *)VStack_11c.y == (Entity *)0x1))) ) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x8000000000), bVar3 != 0)) { if (*(int *)((int)npc + 0xb64) == 1) { ExceptionList = local_10; return isResult; } if (g_game->_frameCount - *(int *)((int)npc + 0x328) < 10) { ExceptionList = local_10; return isResult; } } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x10000000000100); if (((((bVar3 == 0) && (bVar3 = Entity::HasEntityFlags((Entity *)EVar13,0x10000000000100), bVar3 == 0)) && (*(int *)((int)npc + 0x28) != 0x322)) && ((*(int *)((int)EVar13 + 0x28) != 0x322 && (*(EntityPtr *)((int)npc + 0xf38) != EVar13)))) && ((bVar3 = Entity::IsEnemy((Entity *)EVar13), bVar3 == 0 || (*(EntityPtr *)((int)EVar13 + 0xf38) != (EntityPtr)npc)))) { isRelated = '\0'; } else { isRelated = '\x01'; } if (colliderType == 0x28) { if (npcType != 0x28) goto LAB_006ced9b; if (isRelated == '\0') { ExceptionList = local_10; return isResult; } local_fd = 0; } else { if (colliderType == 0xda) { if (npcType == 0xda) { ExceptionList = local_10; return isResult; } LAB_006ced9b: if ((((npcType == 0x1f) || (npcType == 0x15)) || (npcType == 0x17)) || ((npcType == 0x37 || (npcType == 0xf3)))) { local_fd = 1; goto LAB_006cedc6; } } else { if (colliderType == 0x3e) { if (npcType == 0x3e) { ExceptionList = local_10; return isResult; } goto LAB_006ced9b; } if (colliderType != 0x119) { if (colliderType == 0x104) { if (npcType == 0x104) { if (isRelated == '\0') { ExceptionList = local_10; return isResult; } goto LAB_006cedb6; } } else if ((colliderType == 0x1c) && (npcType == 0x1e)) { ExceptionList = local_10; return isResult; } goto LAB_006ced9b; } if (npcType != 0x119) goto LAB_006ced9b; if (isRelated == '\0') { ExceptionList = local_10; return isResult; } } LAB_006cedb6: local_fd = 0; } LAB_006cedc6: if (((colliderType == 0x1f) || (colliderType == 0x15)) || ((colliderType == 0x17 || ((colliderType == 0x37 || (colliderType == 0xf3)))))) { bVar14 = true; } else { bVar14 = false; } if (local_fd == 0) { if (npcType == 0xed) goto LAB_006cee0b; LAB_006cee5c: if ((((colliderType == 0x55) || (colliderType == 0x1e)) && ((npcType == 0xce || (npcType == 0xcf)))) && (isRelated == '\0')) { ExceptionList = local_10; return isResult; } if (colliderType != 0xd8) { if ((colliderType == 0x121) && (npcType == 0x100)) { ExceptionList = local_10; return isResult; } goto LAB_006cee47; } if (npcType != 0xd8) goto LAB_006cee47; if (((Entity_Player *)local_10c.y == (Entity_Player *)0x1) && (colliderVariant == 1)) { ExceptionList = local_10; return isResult; } if (*(EntityPtr *)((int)EVar13 + 0x3bc) == (EntityPtr)npc) { ExceptionList = local_10; return isResult; } } else { if ((bVar14) && (isRelated == '\0')) { ExceptionList = local_10; return isResult; } LAB_006cee0b: if (colliderType != 0x191) goto LAB_006cee5c; if ((isRelated == '\0') && (iVar6 = __RTDynamicCast(), *(int *)(iVar6 + 0xb64) == 0x10)) { ExceptionList = local_10; return isResult; } LAB_006cee47: if (npcType == 0x123) { if (colliderType != 0x123) { ExceptionList = local_10; return isResult; } } else if (colliderType == 0x123) { ExceptionList = local_10; return isResult; } } if (low == 0) { if (colliderType != 1) { if ((colliderType != 3) || (bVar3 = Entity_Familiar::CanBeDamagedByEnemy((Entity_Familiar *)EVar13), bVar3 == 0)) goto LAB_006cf3ac; pcVar1 = *(code **)(*(int *)EVar13 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(); goto LAB_006cf430; } local_fc = (Entity_Player *)__RTDynamicCast(); if (*(int *)((int)npc + 0x28) == 0x362) { iVar6 = Room::GetFrameCount(g_game->_room); if (iVar6 < 0x10) { ExceptionList = local_10; return 1; } EVar2 = local_fc->_darkEsau; if ((((EVar2 != (EntityPtr)0x0) && (EVar2 != (EntityPtr)npc)) && (EVar2 != *(EntityPtr *)((int)npc + 0x3bc))) && ((EVar2 != *(EntityPtr *)((int)npc + 0x3c0) && (*(Entity_Player **)((int)npc + 0x3c8) != local_fc)))) { ExceptionList = local_10; return 1; } if (*(int *)((int)npc + 0xb64) == 5) { ExceptionList = local_10; return 1; } if (*(int *)((int)npc + 0xb64) == 0xd) { ExceptionList = local_10; return 1; } } local_114.x = 0.0; local_114.y = 0.0; VStack_11c.y = *(float *)((int)npc + 0x388); if (npcType == 0x21) { local_12c.y = 2.8026e-45; } else if (((npcType == 0x379) && (*(int *)((int)npc + 0xb64) == 0x10)) && (*(int *)((int)npc + 0xbc4) == 99)) { local_12c.y = 2.8026e-45; } else { local_12c.y = 0.0; } local_134.y = 0.0; if ((*(uint *)(*(int *)((int)npc + 0x330) + 0xd8) & 1) == 0) { LAB_006cf026: if ((*(uint *)(*(int *)((int)npc + 0x330) + 0xd8) & 2) == 0) { LAB_006cf06f: if (npcType == 0x371) { bVar14 = *(int *)((int)npc + 0xb64) == 6; } else { if (npcType != 0x379) goto LAB_006cf09b; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x10); bVar14 = bVar3 == 0; } if (!bVar14) goto LAB_006cf219; } else if ((npcType != 0x332) || ((Entity_Player *)local_10c.y != (Entity_Player *)0x2)) { bVar3 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0x179); if (bVar3 != 0) goto LAB_006cf219; goto LAB_006cf06f; } LAB_006cf09b: if (0.0 < VStack_11c.y) { pcVar1 = *(code **)(*(int *)local_fc + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); cVar4 = (*pcVar1)(); pEVar11 = local_fc; if ((((cVar4 != '\0') && (*(char *)((int)npc + 0xc63) != '\0')) && (*(int *)((int)npc + 0xc64) == 3)) && (0 < local_fc->_numCoins)) { Entity_Player::AddCoins(local_fc,-1); uVar5 = Random(); local_134.y = (float)pEVar11->_numCoins; randomCount = uVar5 % 3 + 1; if (randomCount < (int)local_134.y) { local_134.y = (float)randomCount; } if (0 < (int)local_134.y) { VStack_11c.y = (float)((int)npc + 0x33c); local_114.y = local_134.y; do { uVar5 = Random(); tmpVec = MusicManager::RandomVector(&local_10c); uVar12 = Random(); local_12c.x = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 2.0; local_12c.y = local_12c.x * tmpVec->y; local_12c.x = local_12c.x * tmpVec->x; Game::Spawn(g_game,5,0x14,(Vector *)VStack_11c.y,&local_12c,(Entity *)0x0,1,uVar5); fVar7 = (float)((int)local_114.y + -1); local_114.y = fVar7; } while (fVar7 != 0.0); pEVar11 = local_fc; npc = npcCopy; } Entity_Player::AddCoins(pEVar11,-(int)local_134.y); } EVar13 = (EntityPtr)colliderCopy; } } else { bVar3 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,9); if (bVar3 == 0) goto LAB_006cf026; } LAB_006cf219: bVar3 = Entity_Player::HasCollectible(local_fc,0xec,0); if (((bVar3 != 0) && (cVar4 = CanReroll(npc), cVar4 != '\0')) && (((npcType != 0xf5 && ((npcType != 0x1c && (bVar3 = Entity::IsVulnerableEnemy((Entity *)npc,(Entity *)0x0), bVar3 != 0)))) && (npcType != 0xd5)))) { (**(code **)(*(int *)npc + 0x28))(); bVar3 = Entity_Player::HasCollectible(local_fc,0xca,0); VStack_11c.y = (float)(uint)(bVar3 != 0); uVar5 = Random(); VStack_11c.y = (float)Game::Spawn(g_game,0xf5,(uint)VStack_11c.y,(Vector *)((int)npc + 0x33c), &g_vectorZero,(Entity *)0x0,0,uVar5); uVar10 = Color::Color(); Color::assign(uVar10); if (*(Entity_NPC **)((int)npc + 0x3d4) != (Entity_NPC *)0x0) { MinecartUpdateChild(*(Entity_NPC **)((int)npc + 0x3d4),(Entity *)VStack_11c.y); } } if (*(char *)((int)npc + 0x174) != '\0') { entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x24))(entityRef); } if ((*(int *)((int)npc + 0x28) == 0x3d) && (((*(int *)((int)npc + 0x2c) == 5 || (*(int *)((int)npc + 0x2c) == 6)) && (*(int *)((int)npc + 0xb64) == 8)))) { NpcHelper::bulb_player_collision(EVar13); ExceptionList = local_10; return 1; } LAB_006cf430: EVar13 = (EntityPtr)colliderCopy; if (npcType == 0x21) { bVar3 = Entity::IsEnemy(colliderCopy); if (bVar3 != 0) { pcVar1 = *(code **)(*(int *)EVar13 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(); EVar13 = (EntityPtr)colliderCopy; } } } else { LAB_006cf3ac: if (npcType == 0x29) { iVar6 = *(int *)((int)npc + 0xb64); } else if (npcType == 0x20) { iVar6 = *(int *)((int)npc + 0xb64); } else { if (npcType != 0xed) goto LAB_006cf430; iVar6 = *(int *)((int)npc + 0xb64); } if (iVar6 == 8) { if (((colliderType != 2) && (colliderType != 3)) && (colliderType != 1)) { *(undefined4 *)((int)npc + 0xb64) = 4; NPCAI_Pathfinder::ResetMovementTarget((NPCAI_Pathfinder *)((int)npc + 0x414)); *(float *)((int)npc + 0x334) = g_vectorZero.x; *(float *)((int)npc + 0x338) = g_vectorZero.y; } goto LAB_006cf430; } } if (((low == 0) && (bVar3 = Entity::IsEnemy((Entity *)EVar13), bVar3 != 0)) && (npcType == 0x3f)) { if (*(int *)((int)npc + 0xb64) != 8) goto LAB_006cf6e7; ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)EVar13 + 0x20))(); bVar14 = false; } else if (npcType == 0x1c) { if ((*(int *)((int)npc + 0xb64) == 8) && ((colliderType == 0x17 || (colliderType == 0x55)))) { ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)EVar13 + 0x20))(); PlaySound(npc,0x8e,1.0,2,0,1.0); } LAB_006cf529: bVar14 = true; } else { if (npcType == 99) { if ((*(int *)((int)npc + 0xb64) == 8) && (colliderType == 0xe)) { pcVar1 = *(code **)(*(int *)EVar13 + 0x24); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(local_40 + 4); bVar14 = false; goto LAB_006cf52b; } } else if (npcType == 0x109) { if (((*(int *)((int)npc + 0xb64) == 8) && (*(int *)((int)npc + 0xbc0) == 1)) && (colliderType == 0x27)) { pcVar1 = *(code **)(*(int *)EVar13 + 0x24); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(local_40 + 4); bVar14 = false; goto LAB_006cf52b; } } else if (npcType == 0x42) { if (*(int *)((int)npc + 0x2c) == 0x14) { if (colliderType == 0x42) { ExceptionList = local_10; return isResult; } bVar3 = Entity::IsVulnerableEnemy((Entity *)EVar13,(Entity *)0x0); if (bVar3 != 0) { pcVar1 = *(code **)(*(int *)EVar13 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(); } if (colliderType != 1) { ExceptionList = local_10; return isResult; } } } else if (npcType == 0x2c) { if (colliderType == 0x53) { pcVar1 = *(code **)(*(int *)EVar13 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(); bVar14 = false; goto LAB_006cf52b; } } else if (npcType == 0x36e) { if ((colliderType == 0x36e) && (isRelated == '\0')) { ExceptionList = local_10; return isResult; } } else if (((npcType == 0x13) || (npcType == 0x59)) || ((npcType == 0xef || (npcType == 0x396)))) goto LAB_006cf529; LAB_006cf6e7: bVar14 = false; } LAB_006cf52b: pEVar8 = colliderCopy; if ((((colliderType == 0x13) || (colliderType == 0x59)) || (colliderType == 0xef)) || ((colliderType == 0x1c || (colliderType == 0x396)))) { isSegmentedType = true; } else { isSegmentedType = false; } if ((bVar14) && (isSegmentedType)) { bVar3 = Entity::is_same_segmented_body((Entity *)npc,colliderCopy); if (bVar3 != 0) { ExceptionList = local_10; return isResult; } bVar3 = Entity::is_same_segmented_body((Entity *)npc,pEVar8); if ((bVar3 == 0) && (isRelated == '\0')) { ExceptionList = local_10; return isResult; } } if (((npcType == 0x23) && (colliderType == 0x23)) && (bVar3 = Entity::is_same_segmented_body((Entity *)npc,pEVar8), bVar3 != 0)) { ExceptionList = local_10; return 1; } if (low == 0) { if (colliderType != 4) { LAB_006cf88b: if (npcType != 0x24) { if (npcType == 0x11) { ExceptionList = local_10; return isResult; } goto LAB_006cf8ad; } if (pEVar8->_spawnerType == 0x24) { ExceptionList = local_10; return isResult; } goto LAB_006cfb46; } if (npcType == 0x1c) { if ((*(int *)((int)npc + 0x3bc) == 0) && (*(int *)((int)npc + 0xb64) == 8)) { *(undefined4 *)((int)npc + 0xb64) = 0x10; LAB_006cf7e0: *(undefined4 *)((int)npc + 0x410) = 0; pEVar8 = (Entity *)__RTDynamicCast(); if (pEVar8 == (Entity *)0x0) { ExceptionList = local_10; return isResult; } Entity::SetParent(pEVar8,(Entity *)0x0); pEVar8[1].field_0x3c = 0; *(undefined4 *)&pEVar8[1].field_0x4 = 0x23; pEVar8[1]._damageEvents._begin = (void *)0x23; pEVar8->_entityCollisionClass = 0; pEVar8->_visible = 0; (pEVar8->_pos).x = *(float *)((int)npc + 0x33c); (pEVar8->_pos).y = *(float *)((int)npc + 0x340); (pEVar8->_velocity).x = g_vectorZero.x; (pEVar8->_velocity).y = g_vectorZero.y; SetRef_bec(npc,pEVar8); ExceptionList = local_10; return isResult; } } else { if (npcType != 0x3e) goto LAB_006cf88b; if ((((*(int *)((int)npc + 0x2c) == 3) && (*(int *)((int)npc + 0x3bc) == 0)) && ((*(int *)((int)npc + 0xb64) == 6 || (*(int *)((int)npc + 0xb64) == 4)))) && (*(int *)((int)npc + 0xbc0) == 2)) { *(undefined4 *)((int)npc + 0xb64) = 5; goto LAB_006cf7e0; } } } else { LAB_006cf8ad: if (npcType == 0xd5) { if (*(int *)((int)npc + 0xb64) == 7) { *(int *)((int)npc + 0xbc0) = colliderType; *(int *)((int)npc + 0xbc4) = colliderVariant; if (colliderType == 1) { pEVar11 = (Entity_Player *)__RTDynamicCast(); if ((pEVar11->_isControlsEnabled != 0) && (bVar3 = Entity_Player::HasInvincibility(pEVar11,0,(EntityRef *)0x0), bVar3 == 0)) { *(int *)((int)npc + 0xbc0) = pEVar11->_type; *(int *)((int)npc + 0xbc4) = pEVar11->_variant; *(undefined4 *)((int)npc + 0xb64) = 0x10; Entity::RemoveStatusEffects((Entity *)npc); *(uint *)((int)npc + 0x168) = *(uint *)((int)npc + 0x168) | 1; *(undefined1 *)((int)npc + 0x3b0) = 1; *(undefined4 *)((int)npc + 0x16c) = *(undefined4 *)((int)npc + 0x16c); *(undefined4 *)((int)npc + 0x188) = 0; *(undefined4 *)((int)npc + 0x410) = 0; FUN_007b9a60(); ExceptionList = local_10; return isResult; } goto LAB_006cfe40; } bVar3 = Entity::HasEntityFlags((Entity *)npc,0x100); if ((((bVar3 != 0) || (bVar3 = Entity::HasEntityFlags(pEVar8,0x10000000000000), bVar3 != 0)) && (bVar3 = Entity::IsVulnerableEnemy(pEVar8,(Entity *)0x0), bVar3 != 0)) && (cVar4 = (**(code **)(*(int *)pEVar8 + 0x4c))(), cVar4 == '\0')) { (**(code **)(*(int *)pEVar8 + 0x28))(); *(int *)((int)npc + 0xbc0) = colliderType; *(int *)((int)npc + 0xbc4) = colliderVariant; *(undefined4 *)((int)npc + 0xb64) = 0x10; *(undefined1 *)((int)npc + 0x3b0) = 1; *(undefined4 *)((int)npc + 0x410) = 0; ExceptionList = local_10; return isResult; } } LAB_006cfb46: if (colliderType == 9) { if (npcType == 0x127) goto LAB_006cfb67; } else if ((colliderType == 0x127) && (npcType == 9)) { LAB_006cfb67: entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x24))(entityRef); } if (npcType == 0x125) { if (*(int *)((int)npc + 0x2c) == 0) { VStack_11c.x = *(float *)((int)npc + 0x33c) - (pEVar8->_pos).x; VStack_11c.y = *(float *)((int)npc + 0x340) - (pEVar8->_pos).y; tmpVec = Vector::Normalized(&VStack_11c,&local_134); VStack_11c.y = tmpVec->x; local_114.y = tmpVec->y; uVar5 = Random(); fVar7 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; VStack_11c.x = VStack_11c.y * 9.0 * fVar7; VStack_11c.y = local_114.y * 9.0 * fVar7; Entity::AddVelocity_divided((Entity *)npc,&VStack_11c,0); } } else if (npcType == 0x196) { bVar3 = Entity::IsEnemy(pEVar8); if ((((bVar3 != 0) && (colliderType != 0x125)) && (fVar7 = sqrtf(*(float *)((int)npc + 0x360) * *(float *)((int)npc + 0x360) + *(float *)((int)npc + 0x364) * *(float *)((int)npc + 0x364)), 1.0 < fVar7 )) && (0.0 < ((pEVar8->_pos).y - *(float *)((int)npc + 0x340)) * *(float *)((int)npc + 0x364) + ((pEVar8->_pos).x - *(float *)((int)npc + 0x33c)) * *(float *)((int)npc + 0x360))) { ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)pEVar8 + 0x20))(); } if (*(int *)((int)npc + 0xb64) == 0x136) { if (pEVar8->_type == 3) { if (pEVar8->_variant == 900) goto LAB_006cfd53; } else if ((pEVar8->_type == 1) && (pEVar8->_mass == 1000.0)) { LAB_006cfd53: *(undefined4 *)((int)npc + 0x410) = 100; } } if ((pEVar8->_type == 5) && (pEVar8->_variant == 100)) { ExceptionList = local_10; return isResult; } } else if (npcType == 0x128) { if (colliderType == 0x128) { ExceptionList = local_10; return isResult; } if (colliderType == 0x197) { ExceptionList = local_10; return isResult; } } else if (npcType == 0x197) { if (colliderType == 0x128) { ExceptionList = local_10; return isResult; } bVar3 = Entity::IsEnemy(pEVar8); if ((bVar3 == 0) && (colliderType != 1)) { bVar14 = colliderType == 3; goto LAB_006cfa86; } } else if ((((npcType == 0x36d) && (bVar3 = Entity::IsEnemy(pEVar8), bVar3 != 0)) && (0.0 < *(float *)((int)npc + 0x388))) && (bVar3 = EntityList::HitListContains((EntityList *)((int)npc + 0xf00),pEVar8), bVar3 == 0)) { FUN_00431620(pEVar8); pcVar1 = *(code **)(*(int *)pEVar8 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(); } } else { if (npcType == 0xde) { if (colliderType == 0xde) { if (isRelated == '\0') { ExceptionList = local_10; return isResult; } goto LAB_006cfe40; } goto LAB_006cfb46; } if (npcType == 0x1d) { if (((colliderType == 0x106) || (colliderType == 0x107)) && (isRelated == '\0')) { ExceptionList = local_10; return isResult; } goto LAB_006cfb46; } if (npcType == 0x112) { if (colliderType == 0x112) { ExceptionList = local_10; return isResult; } goto LAB_006cfb46; } if (npcType != 0xd4) { if (npcType == 0xf5) { if (pEVar8->_entityGridCollisionClass != 5) { ExceptionList = local_10; return isResult; } goto LAB_006cfb46; } if (npcType == 0x192) { if (((*(int *)((int)npc + 0xb64) == 8) || (*(int *)((int)npc + 0xb64) == 4)) && (colliderType == 0xd9)) { *(float *)((int)npc + 0x380) = pEVar8->_health + *(float *)((int)npc + 0x380); pcVar1 = *(code **)(*(int *)pEVar8 + 0x24); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(local_40 + 4); goto LAB_006cfe40; } LAB_006cfb13: if (colliderType == 0x127) { ExceptionList = local_10; return isResult; } } else if (npcType == 0x105) goto LAB_006cfb13; if ((npcType == 0x127) && (colliderType == 1)) { entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x24))(entityRef); goto LAB_006cfe40; } goto LAB_006cfb46; } bVar14 = colliderType == 0xd4; LAB_006cfa86: if (!bVar14) { ExceptionList = local_10; return isResult; } } } LAB_006cfe40: pEVar8 = colliderCopy; if ((*(int *)((int)npc + 0x28) == 0x322) && (bVar3 = Entity::IsEnemy(colliderCopy), bVar3 != 0)) { bVar3 = EntityList::HitListContains((EntityList *)((int)npc + 0xf00),pEVar8); if (bVar3 != 0) goto LAB_006d0068; FUN_00431620(pEVar8); } else { bVar3 = Entity::IsEnemy(pEVar8); if (((bVar3 == 0) || (bVar3 = Entity::IsActiveEnemy((Entity *)npc,0), bVar3 == 0)) || (bVar3 = Entity::IsActiveEnemy(pEVar8,0), bVar3 == 0)) goto LAB_006d0068; local_fd = Entity::HasEntityFlags((Entity *)npc,0x100); bVar3 = Entity::HasEntityFlags(pEVar8,0x100); if ((((local_fd == bVar3) && (*(Entity **)((int)npc + 0x3c4) != pEVar8)) && (*(Entity **)((int)npc + 0xf38) != pEVar8)) || ((*(float *)((int)npc + 0x388) <= 0.0 || (bVar3 = EntityList::HitListContains((EntityList *)((int)npc + 0xf00),pEVar8), bVar3 != 0))) ) goto LAB_006d0068; FUN_00431620(pEVar8); fVar7 = log_precise((*(float *)((int)npc + 900) + 110.0) / 100.0); local_10c.y = fVar7 * 33.0; bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000000); if ((bVar3 != 0) && (1 < *(int *)&g_game->_deathmatchManager)) { local_10c.y = *(float *)((int)npc + 0x388); } if ((*(int *)((int)npc + 0x28) == 0x27) && (*(int *)((int)npc + 0x2c) == 0x16)) { local_10c.y = 12.0; } bVar3 = Entity::HasEntityFlags(pEVar8,0x20000000); if (bVar3 != 0) { auVar16 = ZEXT812(0x40600000); if (local_10c.y * 0.25 <= auVar16._0_4_) { auVar16._4_8_ = auVar16._4_8_; auVar16._0_4_ = local_10c.y * 0.25; } local_10c.y = auVar16._0_4_; } bVar3 = Entity::HasEntityFlags(pEVar8,0x10000000000000); if ((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x20000100), bVar3 == 0)) { (**(code **)(*(int *)npc + 0x4c))(); } } pcVar1 = *(code **)(*(int *)pEVar8 + 0x20); ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); (*pcVar1)(); pEVar8 = colliderCopy; LAB_006d0068: bVar3 = Entity::HasEntityFlags((Entity *)npc,0x800000000000); if ((bVar3 != 0) && (fVar7 = sqrtf(*(float *)((int)npc + 0x308) * *(float *)((int)npc + 0x308) + *(float *)((int)npc + 0x30c) * *(float *)((int)npc + 0x30c)), 6.0 < fVar7)) { bVar3 = Entity::HasEntityFlags((Entity *)npc,0x2000000000000); if ((bVar3 == 0) || (bVar3 = Entity::IsEnemy(pEVar8), bVar3 == 0)) { bVar3 = Entity::IsVulnerableEnemy(pEVar8,(Entity *)0x0); if (((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x1000000000000), bVar3 != 0)) && (bVar3 = EntityList::HitListContains((EntityList *)((int)npc + 0xf00),pEVar8), bVar3 == 0)) { FUN_00431620(pEVar8); _get_index_plus_one_if_kind_4_5(); ::EntityRef::EntityRef(&sourceRef); (**(code **)(*(int *)pEVar8 + 0x20))(); } } else { bVar3 = Entity::HasEntityFlags(pEVar8,0x2000000000000); if (bVar3 == 0) { ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)pEVar8 + 0x20))(); } else { VStack_11c.x = (pEVar8->_pos).x - *(float *)((int)npc + 0x33c); VStack_11c.y = (pEVar8->_pos).y - *(float *)((int)npc + 0x340); Vector::Normalize(&VStack_11c); Vector::Normalized((Vector *)((int)npc + 0x360),&local_114); local_134.x = VStack_11c.x + local_114.x; local_134.y = local_114.y + VStack_11c.y; tmpVec = Vector::Normalized(&local_134,&local_114); VStack_11c.x = tmpVec->x * 18.0; VStack_11c.y = tmpVec->y * 18.0; local_fd = Entity::HasEntityFlags(pEVar8,1); uVar10 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffe; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar10; ::EntityRef::constructor((EntityRef *)(local_40 + 4),(Entity *)npc); Entity::AddKnockback(pEVar8,(EntityRef *)(local_40 + 4),&VStack_11c,200,1); if (local_fd != 0) { uVar10 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags | 1; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar10; } } entityRef = ::EntityRef::EntityRef((EntityRef *)(local_40 + 4)); (**(code **)(*(int *)npc + 0x24))(entityRef); } } if (((*(int *)((int)npc + 0x28) != 0x27) || (*(int *)((int)npc + 0x2c) != 0x16)) || (bVar3 = Entity::HasEntityFlags((Entity *)npc,0x100), bVar3 == 0)) { ExceptionList = local_10; return 0; } bVar3 = Entity::IsEnemy(pEVar8); if (bVar3 == 0) { ExceptionList = local_10; return 0; } ExceptionList = local_10; return 1; } //@@ 006d0300 Entity_NPC::SetBossColorIdx /* DB: writes _bosscoloridx, reloads graphics and reapplies animation prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_NPC::SetBossColorIdx(Entity_NPC *this,int bossColorIdx,int unused) { byte bVar1; std_string *anim; if (this->_bosscoloridx != bossColorIdx) { this->_bosscoloridx = bossColorIdx; load_graphics(this,1); anim = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { anim = *(std_string **)anim->_buf; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if ((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } } (**(code **)(*(int *)this + 0x60))(); return; } //@@ 006d0370 FUN_006d0370 void FUN_006d0370(undefined4 *param_1) { int in_ECX; *param_1 = *(undefined4 *)(in_ECX + 0x28); param_1[1] = *(undefined4 *)(in_ECX + 0x2c); param_1[2] = *(undefined4 *)(in_ECX + 0x30); param_1[3] = *(undefined4 *)(in_ECX + 0xc64); param_1[4] = *(undefined4 *)(in_ECX + 0x380); param_1[5] = *(undefined4 *)(in_ECX + 900); if (((*(uint *)(in_ECX + 0x168) & 0x20000000) == 0) || (*(int *)(in_ECX + 0xf1c) == -1)) { *(undefined1 *)(param_1 + 6) = 0; return; } *(undefined1 *)(param_1 + 6) = 1; return; } //@@ 006d03e0 Entity_NPC::MakeChampion /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityNPC:MakeChampion prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_NPC::MakeChampion(Entity_NPC *this,uint seed,int championColor,byte isInit) { code *pcVar1; Entity *spawnedChild; undefined4 colorArg; float *clampedMaxHp; int iVar2; uint uVar3; float scaleX; float fVar4; float oldMaxHpCopy; Entity *local_40; Entity *local_3c [2]; undefined1 local_34 [24]; RNG rng; uint local_c; undefined1 auStack_8 [4]; float *maxHp; float oldMaxHp; EntityPtr *parentRef; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if ((this->_isChampion != 0) && (isInit == 0)) { return; } oldMaxHp = this->_maxHitPoints; maxHp = &this->_maxHitPoints; rng._shift1 = 5; rng._shift2 = 3; local_3c[0] = (Entity *)0x15; rng._shift3 = 0x15; *maxHp = oldMaxHp + oldMaxHp; oldMaxHpCopy = oldMaxHp; (**(code **)(*(int *)this + 0x60))(); if (0.0 < this->_collisionDamage) { this->_collisionDamage = 2.0; } this->_isChampion = 1; this->_championColorIdx = championColor; if (championColor < 0) { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = seed >> ((byte)rng._shift1 & 0x1f) ^ seed; uVar3 = uVar3 << ((byte)rng._shift2 & 0x1f) ^ uVar3; rng._seed = uVar3 >> ((byte)local_3c[0] & 0x1f) ^ uVar3; fVar4 = (float)((double)rng._seed + __uint_to_double_fixup[-(rng._seed >> 0x1f)]) * 2.3283062e-10; if ((0.01 <= fVar4) || (g_game->_stage < 5)) { if ((0.05 <= fVar4) || (g_game->_stage < 5)) { if (0.15 <= fVar4) { if (0.3 <= fVar4) { if ((0.35 <= fVar4) || (g_game->_stage < 5)) { if (g_game->_stage < 3) { uVar3 = RNG::RandomInt(&rng,6); championColor = *(int *)(&DAT_00b673c4 + uVar3 * 4); } else { uVar3 = RNG::RandomInt(&rng,7); championColor = *(int *)(&DAT_00b673dc + uVar3 * 4); } } else { uVar3 = RNG::RandomInt(&rng,4); championColor = *(int *)(&DAT_00b67380 + uVar3 * 4); } } else { uVar3 = RNG::RandomInt(&rng,(uint)(2 < g_game->_stage) * 2 + 4); championColor = *(int *)(&DAT_00b67390 + uVar3 * 4); } } else { if ((float)rng._seed == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; uVar3 = uVar3 << ((byte)rng._shift2 & 0x1f) ^ uVar3; championColor = *(int *)(&DAT_00b673a8 + ((uVar3 >> ((byte)local_3c[0] & 0x1f) ^ uVar3) % 3) * 4); } } else { uVar3 = RNG::RandomInt(&rng,4); championColor = *(int *)(&DAT_00b673b4 + uVar3 * 4); } } else { championColor = 0x19; if (fVar4 < 0.005) { championColor = 6; } } } if ((championColor == 0xc) && ((((iVar2 = this->_type, iVar2 == 0xf0 || (iVar2 == 0xf2)) || (iVar2 == 0xf1)) || (iVar2 == 0x130)))) { championColor = 0; LAB_006d0647: fVar4 = 1.15; this->_championColorIdx = championColor; if (championColor == 0x12) { Entity::SetSize((Entity *)this,this->_size * 0.5,this->_sizeMulti, *(int *)((int)this->_config + 0x48)); fVar4 = 0.5; } else if (championColor == 0x13) { fVar4 = 1.5; } } else { if ((championColor == 6) && (this->_type == 0x379)) { championColor = 0x11; goto LAB_006d0647; } if (championColor < 1) { championColor = 0; } if (championColor < 0x19) goto LAB_006d0647; fVar4 = 1.15; this->_championColorIdx = 0x19; } this->_scale = fVar4; fVar4 = fVar4 * this->_shrinkStatus1; scaleX = fVar4 * g_vectorOne.x; (this->_sprite)._scale.y = fVar4 * g_vectorOne.y; (this->_sprite)._scale.x = scaleX; load_graphics(this,0); switch(this->_championColorIdx) { case 0: *maxHp = *maxHp * 1.333; break; case 1: this->_championSpeed = 1.333; *maxHp = *maxHp * 0.75; break; case 7: *maxHp = *maxHp * 0.333; case 4: this->_championSpeed = 0.8; break; case 8: this->_entityGridCollisionClass = 3; break; case 9: uVar3 = Random(); this->_flickerTimer = uVar3 % 0x1e + 0x3c; break; case 10: uVar3 = Random(); this->_championTimer = uVar3 % 0x14 + 0x28; break; case 0xb: uVar3 = Random(); spawnedChild = Game::Spawn(g_game,1000,0x39,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar3); parentRef = &spawnedChild->_parent; if (spawnedChild->_parent != (EntityPtr)0x0) { local_3c[0] = (Entity *)parentRef; std::multiset::erase(local_3c); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); break; case 0x10: uVar3 = Random(); spawnedChild = Game::Spawn(g_game,1000,0x39,&this->_pos,&g_vectorZero,(Entity *)this,1,uVar3); parentRef = &spawnedChild->_parent; if (spawnedChild->_parent != (EntityPtr)0x0) { local_3c[0] = (Entity *)parentRef; std::multiset::erase(local_3c); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); break; case 0x11: if (isInit != 0) goto LAB_006d0b75; uVar3 = Random(); local_3c[0] = Game::Spawn(g_game,0x60,0,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar3); parentRef = &local_3c[0]->_parent; if (local_3c[0]->_parent != (EntityPtr)0x0) { local_40 = (Entity *)parentRef; std::multiset::erase(&local_40); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); ::EntityRef::constructor((EntityRef *)local_34,(Entity *)this); Entity::AddShrink(local_3c[0],(EntityRef *)local_34,0x96,1,1); FUN_006b5de0(); break; case 0x12: *maxHp = *maxHp * 0.333; this->_championSpeed = this->_championSpeed * 1.333; break; case 0x13: *maxHp = *maxHp * 1.5; this->_championSpeed = this->_championSpeed * 0.9; case 0x17: if (0.0 < this->_collisionDamage) { this->_collisionDamage = 4.0; } goto LAB_006d0b75; case 0x14: uVar3 = Random(); local_40 = Game::Spawn(g_game,1000,0x39,&this->_pos,&g_vectorZero,(Entity *)this,2,uVar3); parentRef = &local_40->_parent; if (local_40->_parent != (EntityPtr)0x0) { local_3c[0] = (Entity *)parentRef; std::multiset::erase(local_3c); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); colorArg = Color::Color(0x3f800000); (**(code **)(*(int *)local_40 + 0x3c))(colorArg,0xffffffff,0xff,0,1); break; case 0x16: *maxHp = *maxHp * 3.0; break; case 0x19: this->_championSpeed = 1.333; *maxHp = *maxHp * 1.5; uVar3 = Random(); this->_championTimer = uVar3 % 0x14 + 0x28; uVar3 = Random(); spawnedChild = Game::Spawn(g_game,1000,0x39,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar3); parentRef = &spawnedChild->_parent; if (spawnedChild->_parent != (EntityPtr)0x0) { local_40 = (Entity *)parentRef; std::multiset::erase(&local_40); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); if (isInit == 0) { uVar3 = Random(); spawnedChild = Game::Spawn(g_game,0x60,0,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar3); parentRef = &spawnedChild->_parent; if (spawnedChild->_parent != (EntityPtr)0x0) { local_40 = (Entity *)parentRef; std::multiset::erase(&local_40); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); } if (*(char *)g_game->_room == '\0') { iVar2 = -1; } else { iVar2 = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0); } hsv_to_rgb((KColor *)(local_34 + 0x14),((float)(iVar2 % 0x5a) * 360.0) / 90.0,1.0,1.0,1.0); colorArg = Color::Color(0x3f800000); Entity::SetColor((Entity *)&this->_sprite,colorArg); } LAB_006d0b75: if ((this->_type == 0x10) && (this->_variant == 2)) { clampedMaxHp = &oldMaxHpCopy; if (*maxHp <= oldMaxHp) { clampedMaxHp = maxHp; } *maxHp = *clampedMaxHp; } if (isInit == 0) { this->_health = *maxHp; } (**(code **)(*(int *)this + 0x60))(); return; } //@@ 006d0c20 Entity_NPC::SetRef_bec /* DB: ?EntityPtr setter for Entity_NPC+0xbec (unknown ref, used in segmented bosses) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::SetRef_bec(Entity_NPC *this,Entity *entity) { EntityPtr *pEVar1; Entity_NPC *local_8; pEVar1 = &this->_entityRef; local_8 = this; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity_NPC *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)entity; if (entity != (Entity *)0x0) { std::multiset::insert(pEVar1); } return; } //@@ 006d0c60 Entity_NPC::QueryNPCsType /* ZHL [lua] Lua binding EntityNPC:QueryNPCsType prototype: db/protos.zhl, confirmed by RET 12 */ void * Entity_NPC::QueryNPCsType(void *outList,int type,int variant) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),outList,type,variant,-1,0,0); return outList; } //@@ 006d0ca0 Entity_NPC::QueryNPCsSpawnerType /* DB: Lua EntityNPC:QueryNPCsSpawnerType; ZHL sig said PersistentGameData::SaveLocally prototype: db/protos.zhl, confirmed by RET 16 */ EntityList * Entity_NPC::QueryNPCsSpawnerType (EntityList *outList,int spawnerType,int entityType,byte isOnlyEnemies) { void *pvVar1; void *pvVar2; int iVar3; int iVar4; Game *pGVar5; uint uVar6; bool bVar7; pGVar5 = g_game; pvVar1 = g_game->_room; uVar6 = 0; *(undefined4 *)((int)pvVar1 + 0x1294) = 0; pvVar2 = pGVar5->_room; if (*(int *)((int)pvVar2 + 0x1264) != 0) { do { iVar3 = *(int *)(*(int *)((int)pvVar2 + 0x125c) + uVar6 * 4); if ((*(int *)(iVar3 + 0x34) != spawnerType) || ((entityType != 0 && (*(int *)(iVar3 + 0x28) != entityType)))) goto LAB_006d0d94; if (isOnlyEnemies == 0) { LAB_006d0d68: iVar4 = *(int *)((int)pvVar1 + 0x1294); if (*(uint *)((int)pvVar1 + 0x1290) < iVar4 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar4 = *(int *)((int)pvVar1 + 0x1294); pGVar5 = g_game; } *(int *)(*(int *)((int)pvVar1 + 0x128c) + iVar4 * 4) = iVar3; *(int *)((int)pvVar1 + 0x1294) = *(int *)((int)pvVar1 + 0x1294) + 1; } else if ((*(int *)&pGVar5->_deathmatchManager < 2) || (*(int *)(iVar3 + 0x28) != 1)) { iVar4 = *(int *)(iVar3 + 0x28); if ((iVar4 - 10U < 0x3de) && (((iVar4 != 0x21 && (iVar4 != 0x11)) && (iVar4 != 0x124)))) { if (iVar4 == 0x375) { bVar7 = *(int *)(iVar3 + 0x2c) == 10; } else { if ((iVar4 == 0x3c0) || (iVar4 == 0x3c5)) goto LAB_006d0d94; bVar7 = iVar4 == 0xf5; } if (!bVar7) goto LAB_006d0d5f; } } else { LAB_006d0d5f: if (*(char *)(iVar3 + 0x173) == '\0') goto LAB_006d0d68; } LAB_006d0d94: uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar2 + 0x1264)); } EntityList::assign(outList,(int)pvVar1 + 0x1288); return outList; } //@@ 006d0dd0 Entity_NPC::QueryNPCsGroup /* ZHL [lua] Lua binding EntityNPC:QueryNPCsGroup prototype: db/protos.zhl, confirmed by RET 8 */ EntityList * Entity_NPC::QueryNPCsGroup(EntityList *outList,int groupIdx) { void *pvVar1; void *pvVar2; Game *pGVar3; int iVar4; int iVar5; uint uVar6; pGVar3 = g_game; pvVar1 = g_game->_room; uVar6 = 0; *(undefined4 *)((int)pvVar1 + 0x1294) = 0; pvVar2 = pGVar3->_room; if (*(int *)((int)pvVar2 + 0x1264) != 0) { do { iVar4 = *(int *)(*(int *)((int)pvVar2 + 0x125c) + uVar6 * 4); if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar4 + 0x28) == 1)) || (*(int *)(iVar4 + 0x28) - 10U < 0x3de)) && ((iVar4 = __RTDynamicCast(iVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), iVar4 != 0 && (*(int *)(iVar4 + 0xc7c) == groupIdx)))) { iVar5 = *(int *)((int)pvVar1 + 0x1294); if (*(uint *)((int)pvVar1 + 0x1290) < iVar5 + 1U) { KAGE_LogMessage(0x10,(byte *)"EL: not enough space for push_back\n"); iVar5 = *(int *)((int)pvVar1 + 0x1294); } *(int *)(*(int *)((int)pvVar1 + 0x128c) + iVar5 * 4) = iVar4; *(int *)((int)pvVar1 + 0x1294) = *(int *)((int)pvVar1 + 0x1294) + 1; } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar2 + 0x1264)); } EntityList::assign(outList,(int)pvVar1 + 0x1288); return outList; } //@@ 006d0ec0 NpcHelper::fireplace_moveable_update /* DB: NpcAI::ENTITY_FIREPLACE for variants 10/12/13 (moveable fireplaces): Appear/Disappear anims, IsFrame, GetIntervalTicks, SoundEffects::Play prototype: db/protos.zhl */ void __fastcall NpcHelper::fireplace_moveable_update(Entity_NPC *npc) { byte bVar1; EntityRef *damageSource; byte *curAnimName; uint uVar2; LayerState *layer; int iVar3; byte *wantedAnimName; char *wantedAnimNameStr; float *damageEvent; bool isLess; float fVar4; float fVar5; EntityRef damageSourceRef; float local_10; float local_c; char isIgnoreDamage; byte *animData; void *damageEventsBegin; qword flags; Manager *manager; ANM2 *sprite; if ((npc->_variant == 0xc) || (npc->_variant == 0xd)) { isIgnoreDamage = '\x01'; } else { isIgnoreDamage = '\0'; if ((0.2 < *(float *)((int)g_game->_room + 0x7240)) && (bVar1 = Entity::IsFrame((Entity *)npc,5,npc->_index), bVar1 != 0)) { damageSource = EntityRef::EntityRef(&damageSourceRef); (**(code **)(*(int *)npc + 0x20))(0x3f800000,0,0,damageSource,0x1e); } } iVar3 = npc->_state; if (iVar3 != 0) { if (iVar3 != 3) { if (iVar3 == 0x10) { fVar4 = npc->_health - 1.0; if (fVar4 <= 0.01) { fVar4 = 0.01; } npc->_health = fVar4; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { (**(code **)(*(int *)npc + 0x28))(); } } goto LAB_006d1556; } sprite = &npc->_sprite; if (((npc->_sprite)._animState._animData == (void *)0x0) || ((npc->_sprite)._animState._isPlaying == 0)) { animData = (npc->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimName = s_Idle; do { bVar1 = *curAnimName; isLess = bVar1 < *wantedAnimName; if (bVar1 != *wantedAnimName) { LAB_006d0fd0: uVar2 = -(uint)isLess | 1; goto LAB_006d0fd5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < wantedAnimName[1]; if (bVar1 != wantedAnimName[1]) goto LAB_006d0fd0; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006d0fd5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_006d1001; } bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } LAB_006d1001: fVar4 = (npc->_targetPosition).x; if ((fVar4 == g_vectorZero.x) && ((npc->_targetPosition).y == g_vectorZero.y)) { if (npc->_spawnerType != 0x3b7) { fVar4 = npc->_friction * 0.95; goto LAB_006d107e; } } else { fVar5 = (npc->_pos).x; (npc->_velocity).y = (npc->_targetPosition).y - (npc->_pos).y; (npc->_velocity).x = fVar4 - fVar5; fVar4 = npc->_friction * 0.6; LAB_006d107e: npc->_friction = fVar4; } if (npc->_variant == 0xc) { fVar4 = npc->_speedMultiplier + (npc->_v1).x; (npc->_v1).x = fVar4; if (90.0 < fVar4) { fVar5 = npc->_health - 1.0; (npc->_v1).x = fVar4 - 90.0; if (fVar5 <= 1.0) { fVar5 = 1.0; } npc->_health = fVar5; local_c = (fVar5 * 0.9) / npc->_maxHitPoints + 0.1; local_10 = local_c * g_vectorOne.y; local_c = local_c * g_vectorOne.x; layer = ANM2::GetLayer(sprite,(byte *)0x0); (layer->_size).x = local_c; (layer->_size).y = local_10; if (npc->_health <= 1.5 && npc->_health != 1.5) goto LAB_006d114a; } } else if (npc->_variant != 0xd) { iVar3 = 300; if (npc->_entityGridCollisionClass != 0) { iVar3 = 0xb4; } if (iVar3 < g_game->_frameCount - npc->_spawnFrame) { LAB_006d114a: npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; ANM2::Play(sprite,(byte *)"Disappear",0); goto LAB_006d1556; } } if (((npc->_spawnerType == 0x3b7) && (iVar3 = Entity::GetIntervalTicks((Entity *)npc,30.0,0.0), iVar3 != 0)) && (uVar2 = Random(), (uVar2 & 3) == 0)) { damageSource = EntityRef::EntityRef(&damageSourceRef); (**(code **)(*(int *)npc + 0x20))(0x3f800000,0x20000,0,damageSource,0x1e); } if (npc->_pendingDamage <= 0.0) goto LAB_006d1556; if ((npc->_pendingDamageFlags & 4) == 0) { if (isIgnoreDamage == '\0') { damageEvent = (npc->_damageEvents)._begin; if (damageEvent == (npc->_damageEvents)._end) { fVar4 = npc->_health; } else { do { if (10.0 < *damageEvent) { uVar2 = Random(); if (uVar2 % 3 == 0) { fVar4 = 3.0; } else { fVar4 = 2.0; } LAB_006d1299: fVar4 = npc->_health - fVar4; npc->_health = fVar4; } else { if (0.0 < *damageEvent) { uVar2 = Random(); if (uVar2 % 3 == 0) { fVar4 = 2.0; } else { fVar4 = 1.0; } goto LAB_006d1299; } fVar4 = npc->_health; } damageEvent = damageEvent + 0xe; } while (damageEvent != (npc->_damageEvents)._end); } if (fVar4 < 1.0) goto LAB_006d12d6; } } else { LAB_006d12d6: npc->_health = 1.0; } local_10 = (npc->_health * 0.9) / npc->_maxHitPoints + 0.1; local_c = local_10 * g_vectorOne.y; local_10 = local_10 * g_vectorOne.x; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_size).x = local_10; (layer->_size).y = local_c; if (1.5 < npc->_health || npc->_health == 1.5) goto LAB_006d1556; npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_006d13b6: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Disappear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimNameStr = "Disappear"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_006d13a3: uVar2 = -(uint)isLess | 1; goto LAB_006d13a8; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_006d13a3; curAnimName = curAnimName + 2; wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006d13a8: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_006d13b6; } manager = g_manager; if ((npc->_pendingDamageFlags & 0x20000) == 0) { local_c = 3.65739e-43; seed_fart_sound_override((int *)&local_c); SoundEffects::Play(&manager->_sfxManager,(int)local_c,0.85,2,0,1.0,0.0); } goto LAB_006d1556; } fVar4 = npc->_health; flags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x42050011; local_10 = (fVar4 * 0.9) / npc->_maxHitPoints + 0.1; local_c = local_10 * g_vectorOne.y; local_10 = local_10 * g_vectorOne.x; layer = ANM2::GetLayer(&npc->_sprite,(byte *)0x0); (layer->_size).x = local_10; (layer->_size).y = local_c; animData = (npc->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_006d14f6: bVar1 = ANM2::SetAnimation(&npc->_sprite,(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimNameStr = "Appear"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_006d14e0: uVar2 = -(uint)isLess | 1; goto LAB_006d14e5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_006d14e0; curAnimName = curAnimName + 2; wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar2 = 0; LAB_006d14e5: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((npc->_sprite)._animState._isPlaying == 0)))) goto LAB_006d14f6; } npc->_state = 3; if (((npc->_targetPosition).x != g_vectorZero.x) || ((npc->_targetPosition).y != g_vectorZero.y)) { npc->_entityGridCollisionClass = 0; } LAB_006d1556: damageEventsBegin = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; (npc->_damageEvents)._end = damageEventsBegin; return; } //@@ 006d1580 Entity_NPC::fireplace_get_loot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall LootList Entity_NPC::fireplace_get_loot(bool ShouldAdvance); */ undefined4 __thiscall Entity_NPC::fireplace_get_loot(Entity_NPC *this,undefined4 param_2,char param_3) { int *ptr; byte bVar1; uint uVar2; int iVar3; void *lootBlocks; void *lootBlocks; RNG *rng; int *lootList; void *lootMap; int lootMapSize; undefined4 lootOffset; int lootCount; float dropChance; float local_48; RNG rngCopy; RNG trinketRng; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 pickupSubtype; undefined4 pickupVariant; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afab6d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_48 = (float)param_2; lootList = (int *)0x0; lootMap = (void *)0x0; lootMapSize = 0; lootOffset = 0; lootCount = 0; lootList = operator_new(8); lootList[1] = 0; *lootList = (int)&lootList; local_14 = 0; if ((((((this->_flags & 0x40000000000) != 0) || (iVar3 = this->_variant, iVar3 == 0xb)) || (iVar3 == 10)) || ((iVar3 == 0xc || (iVar3 == 0xd)))) || (iVar3 == 4)) { LootList::LootList(&lootList); if (lootCount != 0) { do { lootCount = lootCount + -1; } while (lootCount != 0); lootOffset = 0; lootCount = 0; } lootBlocks = lootMap; iVar3 = lootMapSize; if (lootMapSize != 0) { do { lootBlocks = *(void **)((int)lootBlocks + iVar3 * 4 + -4); iVar3 = iVar3 + -1; if (lootBlocks != (void *)0x0) { operator_delete(lootBlocks,0x14); lootBlocks = lootMap; } } while (iVar3 != 0); } if (lootBlocks != (void *)0x0) { uVar2 = lootMapSize * 4; lootBlocks = lootBlocks; if (0xfff < uVar2) { lootBlocks = *(void **)((int)lootBlocks + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)lootBlocks + (-4 - (int)lootBlocks))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(lootBlocks,uVar2); } ptr = lootList; lootMapSize = 0; lootMap = (void *)0x0; lootList = (int *)0x0; operator_delete(ptr,8); ExceptionList = local_1c; return param_2; } rngCopy._seed = (this->_dropRNG)._seed; rngCopy._shift1 = (this->_dropRNG)._shift1; rngCopy._shift2 = (this->_dropRNG)._shift2; rngCopy._shift3 = (this->_dropRNG)._shift3; rng = &rngCopy; if (param_3 != '\0') { rng = &this->_dropRNG; } if ((iVar3 == 2) || (iVar3 == 3)) { bVar1 = Game::IsHardMode(); if (bVar1 == 0) { dropChance = 0.25; } else { dropChance = 0.1; } local_48 = RNG::RandomFloat(rng); if (dropChance <= local_48) goto LAB_006d17dc; bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16); if (bVar1 != 0) { trinketRng._seed = rng->_seed; trinketRng._shift1 = 1; trinketRng._shift2 = 0xb; trinketRng._shift3 = 6; uVar2 = RNG::RandomInt(&trinketRng,5); if (uVar2 != 0) goto LAB_006d17dc; } iVar3 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x16); if (iVar3 < 2) { uVar2 = RNG::Next(rng); pickupSubtype = 3; } else { uVar2 = RNG::Next(rng); pickupSubtype = 6; } LAB_006d17d0: pickupVariant = 10; } else { bVar1 = Game::IsHardMode(); if (bVar1 == 0) { dropChance = 0.25; } else { dropChance = 0.1; } local_48 = RNG::RandomFloat(rng); if (dropChance <= local_48) goto LAB_006d17dc; local_48 = RNG::RandomFloat(rng); if (local_48 < 0.25) { bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16); if (bVar1 != 0) { trinketRng._seed = rng->_seed; trinketRng._shift1 = 1; trinketRng._shift2 = 0xb; trinketRng._shift3 = 6; uVar2 = RNG::RandomInt(&trinketRng,5); if (uVar2 != 0) goto LAB_006d1719; } uVar2 = RNG::Next(rng); pickupSubtype = 0; goto LAB_006d17d0; } LAB_006d1719: uVar2 = RNG::Next(rng); pickupSubtype = 0; pickupVariant = 0x14; } std::deque::push_back(5,pickupVariant,pickupSubtype,uVar2,0); LAB_006d17dc: LootList::LootList(&lootList); FUN_006b84c0(); ExceptionList = local_1c; return param_2; } //@@ 006d18d0 NpcAI::ENTITY_FIREPLACE /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 33 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_FIREPLACE(Entity_NPC *npc) { byte bVar1; uint uVar2; EntityRef *damageSource; int iVar3; LayerState *fireLayer; Entity *tmpEntity; Entity_Player *player; float *clampedHealth; ColorMod *Color; Vector *pVVar4; undefined4 extraout_EAX; uint fireSubtype; int iVar5; Color *emberColor; code *extraout_EDX; Game *game; void *pvVar6; float fVar7; float fVar8; undefined4 uVar9; TypeDescriptor *pTVar10; TypeDescriptor *pTVar11; undefined4 uVar12; EntityRef damageSourceRef; int *loot [3]; uint lootFirst; int lootCount; Vector local_e8; Vector local_e0; undefined1 local_d8 [12]; float local_cc; EntityPtr minecart; Vector *local_c4; Vector local_c0; float local_b8; Vector local_b4; char local_a9; Color explosionColor; Color whiteFireColor; Color fireColor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; float *health; int *lootMap; qword oldFlags; Room *room; local_14 = -NAN; puStack_18 = &LAB_00afabb0; local_1c = ExceptionList; puStack_20 = (undefined1 *)(&fireColor)[1]._offset; uVar2 = __security_cookie ^ (uint)((&fireColor)[1]._colorize + 1); local_24 = uVar2; ExceptionList = &local_1c; iVar3 = npc->_variant; local_c0.y = (float)npc; if (((iVar3 == 2) || (iVar3 == 3)) || (iVar3 == 4)) { local_a9 = '\x01'; } else { local_a9 = '\0'; if ((0.2 < *(float *)((int)g_game->_room + 0x7240)) && (bVar1 = Entity::IsFrame((Entity *)npc,5,npc->_index), bVar1 != 0)) { damageSource = EntityRef::EntityRef(&damageSourceRef); (*extraout_EDX)(0x3f800000,0,0,damageSource,0x1e,uVar2); iVar3 = npc->_variant; } } if (iVar3 == 0xb) { ENTITY_ROCK_SPIDER(npc); ExceptionList = local_1c; return; } if (((iVar3 == 10) || (iVar3 == 0xc)) || (iVar3 == 0xd)) { NpcHelper::fireplace_moveable_update(npc); ExceptionList = local_1c; return; } minecart = npc->_minecart; iVar5 = npc->_state; if (iVar5 == 0) { uVar9 = *(undefined4 *)((int)&npc->_flags + 4); *(uint *)&npc->_flags = (uint)npc->_flags | 0x40000; *(undefined4 *)((int)&npc->_flags + 4) = uVar9; local_d8._0_4_ = npc->_initSeed; local_cc = 9.80909e-45; local_d8._4_4_ = 5; local_d8._8_4_ = 9; if ((*(char *)g_game->_room != '\0') && (g_game->_frameCount == *(int *)((int)g_game->_room + 0x11f0))) { if ((iVar3 == 2) && (uVar2 = RNG::RandomInt((RNG *)local_d8,100), uVar2 == 0)) { Entity_NPC::Morph(npc,npc->_type,3,npc->_subtype,-1); } uVar2 = RNG::RandomInt((RNG *)local_d8,3); npc->_subtype = uVar2; } (npc->_targetPosition).x = (npc->_pos).x; (npc->_targetPosition).y = (npc->_pos).y; uVar2 = Random(); fVar7 = npc->_health; oldFlags = npc->_flags; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); npc->_projectileCooldown = uVar2 % 0x1e + 0x3c; *(uint *)&npc->_flags = (uint)oldFlags & 0xfffffffb | 0x42050011; if ((fVar7 <= 1.5) || ((((*(float *)((int)g_game->_room + 0x7240) <= 0.0 || (local_a9 != '\0')) || (minecart != (EntityPtr)0x0)) && (bVar1 = Level::IsMausoleumHeartStage((Level *)g_game), bVar1 == 0)))) { game = g_game; } else { game = g_game; npc->_health = 1.0; } if (1.5 < npc->_health) { if (minecart == (EntityPtr)0x0) { room = game->_room; iVar3 = Room::GetGridIndex(room,&npc->_pos); Room::SetGridPath(room,iVar3,0x3b6); } npc->_state = 8; fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_Flickering_00b64fd0)[uVar2],0); pvVar6 = (npc->_sprite)._animState._animData; if ((pvVar6 != (void *)0x0) && (uVar2 = *(uint *)((int)pvVar6 + 0x30), 0 < (int)uVar2)) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState,(float)(int)((uint)npc->_initSeed % uVar2)); } local_b4.y = npc->_health / npc->_maxHitPoints; local_b8 = local_b4.y * g_vectorOne.y; local_b4.y = local_b4.y * g_vectorOne.x; fireLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (fireLayer->_size).x = local_b4.y; (fireLayer->_size).y = local_b8; Entity_NPC::UpdatePickupGhosts(npc); ExceptionList = local_1c; return; } if (minecart == (EntityPtr)0x0) { room = game->_room; iVar3 = Room::GetGridIndex(room,&npc->_pos); Room::SetGridPath(room,iVar3,900); } npc->_state = 3; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_NoFire_00b64fdc)[uVar2],0); npc->_renderZOffset = -1000; Entity_NPC::UpdatePickupGhosts(npc); ExceptionList = local_1c; return; } if (iVar5 == 9) { npc->_health = npc->_maxHitPoints; npc->_state = 8; fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_Flickering_00b64fd0)[uVar2],0); pvVar6 = (npc->_sprite)._animState._animData; if ((pvVar6 != (void *)0x0) && (uVar2 = *(uint *)((int)pvVar6 + 0x30), 0 < (int)uVar2)) { AnimationState::SetFrameFloat (&(npc->_sprite)._animState,(float)(int)((uint)npc->_initSeed % uVar2)); } local_b4.y = npc->_health / npc->_maxHitPoints; local_b8 = local_b4.y * g_vectorOne.y; local_b4.y = local_b4.y * g_vectorOne.x; fireLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (fireLayer->_size).x = local_b4.y; (fireLayer->_size).y = local_b8; npc->_entityCollisionClass = 4; npc->_renderZOffset = 0; if (minecart == (EntityPtr)0x0) { room = g_game->_room; iVar3 = Room::GetGridIndex(room,&npc->_pos); Room::SetGridPath(room,iVar3,0x3b6); } uVar2 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&npc->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2); (tmpEntity->_posOffset).x = 0.0; (tmpEntity->_posOffset).y = -6.0; if (npc->_variant == 1) { fVar8 = 0.6; fVar7 = 0.0; } else { fVar7 = 0.5; fVar8 = 0.35; } (tmpEntity->_sprite)._color._offset[0] = fVar8; (tmpEntity->_sprite)._color._offset[1] = 0.0; (tmpEntity->_sprite)._color._offset[2] = fVar7; Entity_NPC::PlaySound(npc,0x1d7,1.0,2,0,1.0); uVar2 = Random(); iVar5 = npc->_state; npc->_projectileCooldown = uVar2 % 0x3c + 0x5a; } if ((iVar5 == 8) && (((npc->_sprite)._animState._animData == (void *)0x0 || ((npc->_sprite)._animState._isPlaying == 0)))) { fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_Flickering_00b64fd0)[uVar2],0); } pVVar4 = &npc->_pos; fVar7 = (npc->_targetPosition).y; fVar8 = (npc->_pos).y; (npc->_velocity).x = (npc->_targetPosition).x - pVVar4->x; (npc->_velocity).y = fVar7 - fVar8; local_c4 = pVVar4; if ((0.0 < npc->_pendingDamage) || (npc->_dead != 0)) { iVar3 = npc->_variant; if ((iVar3 == 0) || (iVar3 == 1)) { local_a9 = '\0'; if (((npc->_dead != 0) || ((npc->_pendingDamageFlags & 4) != 0)) || (1000.0 <= npc->_pendingDamage)) { local_a9 = '\x01'; } if (npc->_state == 8) { pvVar6 = (npc->_damageEvents)._begin; iVar5 = (int)(npc->_damageEvents)._end - (int)pvVar6; local_b8 = 0.0; iVar3 = iVar5 >> 0x1f; if (iVar5 / 0x38 + iVar3 != iVar3) { local_b4.y = 0.0; do { if (*(float *)((int)pvVar6 + (int)local_b4.y) <= 10.0) { if (0.0 < *(float *)((int)pvVar6 + (int)local_b4.y)) { uVar2 = Random(); if (uVar2 % 3 == 0) goto LAB_006d20d1; fVar7 = 1.0; goto LAB_006d20e3; } } else { uVar2 = Random(); if (uVar2 % 3 == 0) { fVar7 = 3.0; } else { LAB_006d20d1: fVar7 = 2.0; } LAB_006d20e3: npc->_health = npc->_health - fVar7; } pvVar6 = (npc->_damageEvents)._begin; local_b4.y = (float)((int)local_b4.y + 0x38); local_b8 = (float)((int)local_b8 + 1); } while ((uint)local_b8 < (uint)(((int)(npc->_damageEvents)._end - (int)pvVar6) / 0x38)); } health = &npc->_health; local_b4.y = 1.0; clampedHealth = &local_b4.y; if (1.0 < npc->_health) { clampedHealth = health; } local_b4.y = *clampedHealth; *health = local_b4.y; local_b4.y = local_b4.y / npc->_maxHitPoints; local_b8 = local_b4.y * g_vectorOne.y; local_b4.y = local_b4.y * g_vectorOne.x; fireLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (fireLayer->_size).x = local_b4.y; (fireLayer->_size).y = local_b8; if ((*health <= 1.5 && *health != 1.5) || (local_a9 != '\0')) { if (minecart == (EntityPtr)0x0) { room = g_game->_room; iVar3 = Room::GetGridIndex(room,&npc->_pos); Room::SetGridPath(room,iVar3,900); } npc->_health = 1.0; npc->_state = 3; fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_NoFire_00b64fdc)[uVar2],0); npc->_renderZOffset = -1000; Entity_NPC::PlaySound(npc,0x105,0.85,2,0,1.0); fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_Dissapear_00b67374)[uVar2],0); pvVar6 = (npc->_damageEvents)._end; iVar5 = (int)pvVar6 - (int)(npc->_damageEvents)._begin; iVar3 = iVar5 >> 0x1f; if (((iVar5 / 0x38 + iVar3 != iVar3) && (tmpEntity = *(Entity **)((int)pvVar6 + -4), tmpEntity != (Entity *)0x0)) && (player = (Entity_Player *)Entity::GetPlayerAncestor(tmpEntity), player != (Entity_Player *)0x0)) { Player_stats_add(&g_game->_onlinePlayerStats,0xe,player,1.0); bVar1 = Entity_Player::HasCollectible(player,0x1a4,0); if (bVar1 != 0) { ::Color::Color(&explosionColor); Game::BombExplosionEffects (g_game,&npc->_pos,20.0,(BitSet128)ZEXT816(0),Color,(Entity *)player,1.0,1,4 ,0); } } goto LAB_006d236b; } LAB_006d2424: pVVar4 = &npc->_pos; } } else if (((local_a9 != '\0') && (iVar3 != 4)) && (npc->_state == 8)) { if (((npc->_pendingDamageFlags & 4) != 0) || (npc->_dead != 0)) { npc->_health = 1.0; npc->_state = 3; npc->_entityCollisionClass = 0; fireSubtype = -(uint)(npc->_subtype != 0) & npc->_subtype; npc->_entityGridCollisionClass = 0; uVar2 = 2; if (fireSubtype < 2) { uVar2 = fireSubtype; } ANM2::Play(&npc->_sprite,(&PTR_s_NoFire_00b64fdc)[uVar2],0); npc->_renderZOffset = -1000; Entity_NPC::PlaySound(npc,0x105,0.85,2,0,1.0); uVar2 = Random(); Game::Spawn(g_game,1000,0xf,pVVar4,&g_vectorZero,(Entity *)0x0,0,uVar2); pvVar6 = (npc->_damageEvents)._end; iVar5 = (int)pvVar6 - (int)(npc->_damageEvents)._begin; iVar3 = iVar5 >> 0x1f; if (((iVar5 / 0x38 + iVar3 != iVar3) && (tmpEntity = *(Entity **)((int)pvVar6 + -4), tmpEntity != (Entity *)0x0)) && (player = (Entity_Player *)Entity::GetPlayerAncestor(tmpEntity), player != (Entity_Player *)0x0)) { Player_stats_add(&g_game->_onlinePlayerStats,0xe,player,1.0); } LAB_006d236b: Entity_NPC::fireplace_get_loot(npc,loot,1); lootMap = loot[0]; local_14 = 0.0; for (uVar2 = lootFirst; npc = (Entity_NPC *)local_c0.y, uVar2 != lootFirst + lootCount; uVar2 = uVar2 + 1) { if (lootMap == (int *)0x0) { iVar3 = 0; } else { iVar3 = *lootMap; } tmpEntity = EntitySpawner::Spawn (*(void **)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & uVar2) * 4),local_c4, &g_vectorZero,(Entity *)0x0); (**(code **)(*(int *)tmpEntity + 0xc))(); } if (lootCount != 0) { *(undefined1 *)((int)g_game->_room + 0x7894) = 1; } Entity_NPC::UpdatePickupGhosts((Entity_NPC *)local_c0.y); local_14 = -NAN; std::deque::clear(); lootMap = loot[0]; loot[0] = (int *)0x0; operator_delete(lootMap,8); goto LAB_006d2424; } goto LAB_006d2444; } if (npc->_dead != 0) { npc->_health = 1.0; npc->_dead = 0; } } LAB_006d2444: (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; if ((((((npc->_variant == 1) || (npc->_variant == 3)) && (npc->_spawnerType != 0x389)) && ((npc->_spawnerType != 0x397 && (npc->_projectileCooldown < 1)))) && (npc->_state == 8)) && (uVar2 = Random(), uVar2 % 5 == 0)) { local_b4.y = pVVar4->x + 0.0; local_b8 = pVVar4->y - 15.0; player = Game::GetNearestPlayer(g_game,pVVar4); fVar7 = (player->_pos).x; local_cc = (player->_pos).y; local_d8._8_4_ = fVar7; local_e0.x = fVar7 - local_b4.y; local_e0.y = local_cc - local_b8; local_c4 = (Vector *)local_e0.x; local_c0.y = local_e0.y; pVVar4 = Vector::Normalized(&local_e0,&local_e8); local_e0.x = pVVar4->x * 25.0 + local_b4.y; local_e0.y = pVVar4->y * 25.0 + local_b8; fVar7 = sqrtf(local_c0.y * local_c0.y + (float)local_c4 * (float)local_c4); if (((fVar7 < 160.0) && (bVar1 = Room::CheckLine(g_game->_room,&local_e0,(Vector *)(local_d8 + 8),3,0,0,0, (Vector *)0x0), bVar1 != 0)) && (uVar2 = Random(), uVar2 % 0xf == 0)) { ANM2::PlayOverlay(&npc->_sprite,(byte *)"Shoot",0); npc->_projectileCooldown = 0x54; } } else if (0 < npc->_projectileCooldown) { npc->_projectileCooldown = npc->_projectileCooldown + -1; } if ((npc->_sprite)._overlayAnimState._isPlaying != 0) { local_c0.y = (float)AnimationState::GetNullFrameById(&(npc->_sprite)._overlayAnimState,0); if ((Entity_NPC *)local_c0.y != (Entity_NPC *)0x0) { fireLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (fireLayer->_pos).x = *(float *)local_c0.y; (fireLayer->_pos).y = *(float *)((int)local_c0.y + 4); local_c4 = (Vector *)(npc->_health / npc->_maxHitPoints); local_b4.y = *(float *)((int)local_c0.y + 0x14); local_c0.y = (float)((std_vector *)((int)local_c0.y + 8))->_capacity; fireLayer = ANM2::GetLayer(&npc->_sprite,(byte *)0x1); (fireLayer->_size).x = local_c0.y * (float)local_c4; (fireLayer->_size).y = (float)local_c4 * local_b4.y; } bVar1 = AnimationState::IsEventTriggered(&(npc->_sprite)._overlayAnimState,(byte *)"Shoot"); if (((bVar1 != 0) && (npc->_spawnerType != 0x389)) && (npc->_spawnerType != 0x397)) { local_b4.x = (npc->_pos).x + 0.0; local_b4.y = (npc->_pos).y - 15.0; player = Game::GetNearestPlayer(g_game,&npc->_pos); local_c0.x = (player->_pos).x - local_b4.x; local_c0.y = (player->_pos).y - local_b4.y; pVVar4 = Vector::Normalized(&local_c0,(Vector *)(local_d8 + 8)); local_b4.x = pVVar4->x * 25.0 + local_b4.x; local_b4.y = pVVar4->y * 25.0 + local_b4.y; uVar2 = Random(); pVVar4 = Vector::Normalized(&local_c0,&local_e0); uVar12 = 0; pTVar11 = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; pTVar10 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar9 = 0; local_d8._8_4_ = pVVar4->x * 5.0; local_cc = pVVar4->y * 5.0; tmpEntity = Game::Spawn(g_game,9,0,&local_b4,(Vector *)(local_d8 + 8),(Entity *)npc,0,uVar2); iVar3 = __RTDynamicCast(tmpEntity,uVar9,pTVar10,pTVar11,uVar12); if (npc->_variant == 3) { *(uint *)(iVar3 + 0x438) = *(uint *)(iVar3 + 0x438) | 1; *(undefined4 *)(iVar3 + 0x43c) = *(undefined4 *)(iVar3 + 0x43c); *(undefined4 *)(iVar3 + 0x420) = 0x3fc00000; } } } if ((npc->_state != 8) || (uVar2 = Random(), uVar2 % 7 != 0)) goto LAB_006d2ac3; uVar2 = Random(); local_c4 = (Vector *) ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10); local_c0.y = npc->_health; uVar2 = Random(); local_e8.x = ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 16.0 - 8.0) + (npc->_pos).x; local_e8.y = ((-15.0 - (local_c0.y * 15.0) / 6.0) - (float)local_c4 * 15.0) + (npc->_pos).y; uVar2 = Random(); local_c0.y = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * -1.6 - 0.8; uVar2 = Random(); local_d8._8_4_ = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.4 - 0.2; local_cc = local_c0.y; uVar2 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x42,&local_e8,(Vector *)(local_d8 + 8),(Entity *)npc,0,uVar2) ; iVar3 = npc->_variant; if (iVar3 == 1) { ::Color::Color(&fireColor); (**(code **)(*(int *)tmpEntity + 0x3c))(extraout_EAX,0xffffffff,0xff,0,1); goto LAB_006d2ac3; } if (iVar3 == 2) { fireColor._colorize[0] = 0.2; fireColor._colorize[1] = 1.0; fireColor._colorize[2] = 1.5; LAB_006d2a46: fireColor._tint[3] = 1.0; fireColor._tint[2] = 1.0; fireColor._tint[1] = 1.0; fireColor._tint[0] = 1.0; fireColor._colorize[3] = 1.0; fireColor._offset[0] = 0.0; emberColor = &fireColor; fireColor._offset[1] = 0.0; fireColor._offset[2] = 0.0; } else { if (iVar3 == 3) { fireColor._colorize[0] = 1.0; fireColor._colorize[1] = 0.2; fireColor._colorize[2] = 1.0; goto LAB_006d2a46; } if (iVar3 != 4) goto LAB_006d2ac3; emberColor = &whiteFireColor; whiteFireColor._tint[0] = 1.0; whiteFireColor._tint[1] = 1.0; whiteFireColor._tint[2] = 1.0; whiteFireColor._tint[3] = 1.0; whiteFireColor._offset[0] = 0.0; whiteFireColor._colorize[0] = 1.5; whiteFireColor._colorize[1] = 1.5; whiteFireColor._colorize[2] = 1.5; whiteFireColor._colorize[3] = 1.0; whiteFireColor._offset[1] = 0.0; whiteFireColor._offset[2] = 0.0; } (**(code **)(*(int *)tmpEntity + 0x3c))(emberColor,0xffffffff,0xff,0,1); LAB_006d2ac3: if (npc->_state == 3) { local_c0.x = (npc->_pos).x; local_c0.y = (npc->_pos).y; iVar3 = Room::GetGridCollisionAtPos(g_game->_room,npc->_pos); if ((iVar3 != 0) && (minecart == (EntityPtr)0x0)) { (**(code **)(*(int *)npc + 0x28))(); } } ExceptionList = local_1c; return; } //@@ 006d2b50 Entity_NPC::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_NPC::Interpolate(Entity_NPC *this) { int iVar1; EntityPtr EVar2; byte isEnemy; int *playerSlot; void *playerListEnd; PlayerManager *playerManager; float fVar3; float dy; uint i; uint flags; int type; if (this->_pauseTimer != 0) { return; } if (this->_type == 0x3c5) { flags = (uint)this->_flags; if ((flags & 2) == 0) { (this->_preInterpolatePos).x = (this->_pos).x; (this->_preInterpolatePos).y = (this->_pos).y; if (this->_holdCountdown < 1) { apply_velocity(this,1); update_move_direction_anim(this); } this->_isInterpolating = 1; Entity::CollideWithGrid((Entity *)this,1); EVar2 = this->_child; if ((EVar2 != (EntityPtr)0x0) && (*(uint *)((int)EVar2 + 0x20) < (uint)this->_index)) { *(float *)((int)EVar2 + 0x33c) = (this->_pos).x; *(float *)((int)EVar2 + 0x340) = (this->_pos).y; } if (this->_variant == 10) { playerManager = &g_game->_playerManager; i = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (i < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + i; } iVar1 = *playerSlot; if (*(Entity_NPC **)(iVar1 + 0x3d4) == this) { fVar3 = (this->_pos).y; *(float *)(iVar1 + 0x33c) = *(float *)(iVar1 + 0x2088) + (this->_pos).x; *(float *)(iVar1 + 0x340) = *(float *)(iVar1 + 0x208c) + fVar3; *(float *)(iVar1 + 0x360) = (this->_velocity).x; *(float *)(iVar1 + 0x364) = (this->_velocity).y; *(float *)(iVar1 + 0x36c) = this->_friction; } i = i + 1; playerManager = &g_game->_playerManager; } while (i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } } else { *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = flags & 0xfffffffd; } } else { Entity::Interpolate((Entity *)this); } if ((this->_aiCallFlags & 2) != 0) { this->_aiCallPhase = 2; Entity_NPC_UpdateAI_dispatch(this); this->_aiCallPhase = 0; } UpdateChildEffectPosition(this,1); if (((((this->_flags & 0x20) != 0 || (this->_flags & 0x200000000000000) != 0) || (0 < this->_holdCountdown)) || (iVar1 = this->_state, iVar1 == 1)) || ((iVar1 == 0x12 || (iVar1 == 0x11)))) goto LAB_006d2dd8; type = this->_type; if (type == 0x3e) { if (this->_variant != 3) { LAB_006d2d6c: if (type == 0x33e) { if (this->_variant != 10) goto LAB_006d2dd8; goto LAB_006d2d79; } LAB_006d2d90: if ((((type != 0x371) && (type != 0x32f)) && ((type != 0x33f || (this->_variant != 0x14)))) || (iVar1 != 6)) goto LAB_006d2dd8; } fVar3 = (this->_v1).x; } else { if (type != 0x393) goto LAB_006d2d6c; if (this->_variant != 1) goto LAB_006d2d90; LAB_006d2d79: fVar3 = (this->_v1).y; } (this->_posOffset).y = fVar3 * this->_speedMultiplier * 0.5 + (this->_posOffset).y; LAB_006d2dd8: if ((((this->_type == 0x5c) && (this->_variant == 1)) && (EVar2 = this->_entityRef, EVar2 != (EntityPtr)0x0)) && (isEnemy = Entity::IsEnemy((Entity *)EVar2), isEnemy != 0)) { fVar3 = ((Vector *)((int)EVar2 + 0x33c))->x - (this->_pos).x; dy = *(float *)((int)EVar2 + 0x340) - (this->_pos).y; (this->_targetPosition).x = fVar3; (this->_targetPosition).y = dy; ((Vector *)((int)EVar2 + 0x334))->x = -fVar3; *(float *)((int)EVar2 + 0x338) = -dy; } return; } //@@ 006d2e50 Entity_NPC::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 5] prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_NPC::Render(Entity_NPC *this,Vector *offset) { int *piVar1; int *piVar2; byte bVar3; uint uVar4; uint curses; EntityPtr EVar5; LayerState *layer; float *pfVar6; int iVar7; Entity_Player *player; Entity_NPC *statusTarget; void *pvVar8; EntityPtr extraout_ECX; EntityPtr EVar9; EntityPtr extraout_ECX_00; EntityPtr extraout_ECX_01; EntityPtr extraout_ECX_02; EntityPtr extraout_ECX_03; EntityPtr extraout_ECX_04; AnimationState *laterAnimState; EntityPtr extraout_ECX_05; EntityPtr extraout_ECX_06; EntityPtr 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; undefined4 extraout_ECX_17; undefined4 curses; undefined4 extraout_ECX_18; EntityPtr EVar11; int *node; float fVar12; float fVar13; double dVar14; float local_118; float fStack_114; float fStack_110; float fStack_10c; undefined4 local_f8; undefined4 uStack_f4; undefined4 local_f0; ColorMod local_ec; Vector *renderOffset; float trailX; float screenScale; int renderMode; Vector renderPos; float local_a8; float local_a4; float local_a0; float *local_9c; float local_98; float fStack_94; Entity_Player *local_90; EntityPtr minecart; float local_88; Vector local_84; float local_7c; Vector baseOffset; float local_70; float alphaMult; float local_68; char local_61; void *configName; KColor local_5c; Color local_48; byte debugText [4]; Entity_NPC *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; char isNil; Manager *manager; char *room; ColorMod *spriteColor; local_8 = 0xffffffff; puStack_c = &LAB_00afac0b; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(debugText + 0x18); EVar9 = (EntityPtr)this->_type; renderOffset = offset; baseOffset.x = offset->x; fVar12 = offset->y; if (((EVar9 == (EntityPtr)0x3c5) && (this->_variant == 0)) && (this->_child != (EntityPtr)0x0)) { return; } EVar11 = this->_minecart; renderPos.y = 0.0; renderPos.x = 0.0; ExceptionList = &local_10; baseOffset.y = fVar12; local_18 = this; local_14 = uVar4; if ((EVar9 == (EntityPtr)0x3c5) && (this->_variant == 10)) { alphaMult = 1.0; renderMode = *(int *)((int)g_game->_room + 0x12bc); minecart = (EntityPtr)this; LAB_006d301b: local_61 = '\0'; } else { local_61 = '\0'; alphaMult = 1.0; renderMode = *(int *)((int)g_game->_room + 0x12bc); minecart = EVar11; if (EVar9 == (EntityPtr)0x327) { if (((g_game->_currentDimensionIdx == 1) && ((g_game->_stageType == 4 || (g_game->_stageType == 5)))) && ((g_game->_stage == 2 || ((g_game->_stage == 1 && (curses = Level::GetCurses((Level *)g_game), (curses & 2) != 0))) ))) { EVar9 = (EntityPtr)0x1; } else { EVar9 = (EntityPtr)0x0; } EVar5._1_3_ = 0; EVar5._0_1_ = renderMode != 5; minecart = EVar11; if (EVar5 != EVar9) { fVar13 = 0.0; alphaMult = 0.0; if ((*(float *)((int)g_game->_room + 0x7240) <= 0.0) || ((g_manager->_optionsConfig)._enableWaterSurface == 0)) { fVar13 = 0.2; alphaMult = 0.2; } fVar12 = g_game->_lightningIntensity; if (0.0 < fVar12) { fVar12 = fVar12 + fVar13; if (fVar12 <= fVar13) { fVar12 = fVar13; } fVar13 = fVar12; if (1.0 <= fVar12) { fVar13 = 1.0; } alphaMult = fVar13; } local_61 = '\x01'; if (fVar13 != 0.0) goto LAB_006d301b; } } } EVar11 = minecart; if (this->_type == 0x371) { NpcHelper::needle_render(); LAB_006d3040: layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); local_61 = layer->_visible == 0; EVar9 = extraout_ECX; } else if (this->_type == 0x32f) { render_v1_layer_frames(this,uVar4); goto LAB_006d3040; } if ((((this->_type == 0x32a) && (fVar12 = (this->_posOffset).y, -3.0 < fVar12)) && (EVar9 = (EntityPtr)(*(uint *)((int)&this->_flags + 4) & 0x2000000), EVar9 == (EntityPtr)0x0)) && (renderMode == 3)) { alphaMult = 0.0; } if ((EVar11 != (EntityPtr)0x0) && (this->_visible != 0)) { if (*(void **)((int)EVar11 + 0x7c) != (void *)0x0) { pfVar6 = AnimationState::GetNullFrameById((AnimationState *)((int)EVar11 + 0x78),0); if (pfVar6 == (float *)0x0) { EVar9 = extraout_ECX_00; EVar11 = minecart; } else { local_a8 = g_displayPixelRatio * g_screenPointScale; local_9c = (float *)((g_screenHeight - 182.0) * 0.5); local_7c = (((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_a8 + 0.5 ; dVar14 = floor((double)local_7c); local_98 = (float)dVar14; local_7c = (((this->_pos).y - 140.0) * 0.65 + (float)local_9c) * local_a8 + 0.5; dVar14 = floor((double)local_7c); EVar11 = minecart; local_7c = (float)dVar14; renderPos.x = local_98 / local_a8 + renderOffset->x; renderPos.y = local_7c / local_a8 + renderOffset->y; baseOffset.x = baseOffset.x + *pfVar6; fVar12 = baseOffset.y + pfVar6[1]; baseOffset.y = fVar12; Sprite::RenderLayer((Sprite *)((int)minecart + 0x48),0,&renderPos,&g_vectorZero, &g_vectorZero); EVar9 = extraout_ECX_01; } } alphaMult = alphaMult * *(float *)((int)EVar11 + 0xfc); } EVar11 = this->_spawnerEntity; if (((EVar11 != (EntityPtr)0x0) && (*(int *)((int)EVar11 + 0x28) == 1)) && (EVar9 = (EntityPtr)&g_manager->_netplayManager, *(NetplayManager *)EVar9 != *(NetplayManager *)(g_manager + 1))) { bVar3 = NetplayManager::IsIdxLocalPlayer ((NetplayManager *)EVar9,*(uint *)((int)EVar11 + 0x1618)); EVar9 = extraout_ECX_02; if (bVar3 == 0) { FUN_00925df0(); alphaMult = alphaMult * fVar12; EVar9 = extraout_ECX_03; } } game = g_game; local_9c = (float *)(this->_sprite)._scale.x; local_68 = (this->_sprite)._color._tint[3]; local_7c = (this->_sprite)._scale.y; if (0.0 < alphaMult) { (this->_sprite)._color._tint[3] = local_68 * alphaMult; if (this->_championColorIdx == 0x15) { room = game->_room; if (*room == '\0') { iVar7 = -1; } else { iVar7 = game->_frameCount - *(int *)(room + 0x11f0); } fVar12 = sin((float)iVar7 * 0.2); if (fVar12 <= 0.0) { fVar12 = 0.0; } if (1.0 <= fVar12) { fVar12 = 1.0; } fVar12 = fVar12 * 0.15 + 1.0; (this->_sprite)._scale.x = (float)local_9c * fVar12; (this->_sprite)._scale.y = local_7c * fVar12; EVar9 = extraout_ECX_04; } iVar7 = this->_type; if ((iVar7 == 0x111) && (this->_state == 9)) { if (this->_exists == 0) { ExceptionList = local_10; return; } if (this->_visible == 0) { ExceptionList = local_10; return; } local_a0 = (this->_velocity).x * 5.0 * -0.14285715; local_70 = (this->_velocity).y * 5.0 * -0.14285715; fVar12 = (this->_pos).y; fVar13 = (this->_pos).x; trailX = fVar13; local_98 = fVar12; Color::operator_assign(&local_48,&(this->_sprite)._color); local_a8 = 8.40779e-45; spriteColor = &(this->_sprite)._color; do { screenScale = g_displayPixelRatio * g_screenPointScale; local_90 = (Entity_Player *) (((fVar12 + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5); local_88 = (((fVar13 + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * screenScale + 0.5; dVar14 = floor((double)local_88); local_88 = (float)dVar14 / screenScale; local_90 = (Entity_Player *)((float)local_90 * screenScale + 0.5); dVar14 = floor((double)(float)local_90); local_90 = (Entity_Player *)(float)dVar14; local_f8 = 0; uStack_f4 = 0; local_f0 = 0; local_84.x = baseOffset.x + local_88; fStack_114 = ((float)(int)local_a8 * 0.9) / 7.0 + 0.1; local_84.y = baseOffset.y + (float)local_90 / screenScale; fStack_110 = fStack_114 * local_48._tint[2]; fStack_10c = fStack_114 * local_48._tint[3] * 0.5; local_118 = fStack_114 * local_48._tint[0]; fStack_114 = fStack_114 * local_48._tint[1]; if (spriteColor != (ColorMod *)&local_118) { (this->_sprite)._color._colorize[0] = 0.0; (this->_sprite)._color._colorize[1] = 0.0; (this->_sprite)._color._colorize[2] = 0.0; (this->_sprite)._color._colorize[3] = 0.0; spriteColor->_tint[0] = local_118; (this->_sprite)._color._tint[1] = fStack_114; (this->_sprite)._color._tint[2] = fStack_110; (this->_sprite)._color._tint[3] = fStack_10c; (this->_sprite)._color._offset[0] = 0.0; (this->_sprite)._color._offset[1] = 0.0; (this->_sprite)._color._offset[2] = 0.0; } if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_sprite)._animState,&local_84,&g_vectorZero,&g_vectorZero); laterAnimState = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_84,&g_vectorZero,&g_vectorZero); laterAnimState = &(this->_sprite)._animState; } AnimationState::Render(laterAnimState,&local_84,&g_vectorZero,&g_vectorZero); } local_a8 = (float)((int)local_a8 + -1); fVar13 = local_a0 + trailX; fVar12 = local_70 + local_98; trailX = fVar13; local_98 = fVar12; } while (-1 < (int)local_a8); local_ec._tint[3] = local_48._tint[3] * 0.2; local_ec._colorize[0] = 0.0; local_ec._colorize[1] = 0.0; local_ec._colorize[2] = 0.0; local_ec._colorize[3] = 0.0; local_ec._offset[0] = 0.0; local_ec._tint[0] = local_48._tint[0]; local_ec._offset[1] = 0.0; local_ec._offset[2] = 0.0; Sprite::SetColor((Sprite *)&this->_sprite,&local_ec); local_a0 = (this->_pos).y + (this->_posOffset).y; local_90 = (Entity_Player *)((g_screenHeight - 182.0) * 0.5); local_98 = g_displayPixelRatio * g_screenPointScale; local_70 = ((((this->_pos).x + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_98 + 0.5; dVar14 = floor((double)local_70); local_88 = (float)dVar14; local_70 = ((local_a0 - 140.0) * 0.65 + (float)local_90) * local_98 + 0.5; dVar14 = floor((double)local_70); local_70 = (float)dVar14; local_84.x = baseOffset.x + local_88 / local_98; local_84.y = baseOffset.y + local_70 / local_98; ANM2::Render(&this->_sprite,&local_84,&g_vectorZero,&g_vectorZero); Sprite::SetColor((Sprite *)&this->_sprite,(ColorMod *)&local_48); iVar7 = this->_type; EVar9 = extraout_ECX_05; } if ((((iVar7 == 0x13) && (this->_variant == 3)) && (EVar9 = this->_child, EVar9 != (EntityPtr)0x0)) && (fVar12 = (this->_pos).y, *(float *)((int)EVar9 + 0x340) <= fVar12 && fVar12 != *(float *)((int)EVar9 + 0x340))) { RenderSegmentLink(this,&baseOffset,0); iVar7 = this->_type; EVar9 = extraout_ECX_06; } if ((iVar7 == 0x3b6) && (this->_variant == 0)) { render_overlay(this,&baseOffset,0); iVar7 = this->_type; EVar9 = extraout_ECX_07; } if (iVar7 == 0x37d) { if (((this->_targetPosition).x != g_vectorZero.x) || ((this->_targetPosition).y != g_vectorZero.y)) { fVar12 = (this->_pos).y; iVar7 = 0x37d; pfVar6 = &(this->_targetPosition).y; if (*pfVar6 <= fVar12 && fVar12 != *pfVar6) { NpcHelper::ball_and_chain_render_chain(&baseOffset,EVar9); iVar7 = this->_type; } goto LAB_006d3907; } LAB_006d3c6e: LAB_006d3c74: Entity::Render((Entity *)this,&baseOffset); curses = extraout_ECX_17; } else { LAB_006d3907: if (((iVar7 == 0xf5) && (this->_entityRef != (EntityPtr)0x0)) && (this->_visible != 0)) { *(undefined1 *)((int)this->_entityRef + 0x171) = 1; EVar9 = this->_entityRef; local_a4 = baseOffset.x + ((((this->_posOffset).x + (this->_pos).x) - *(float *)((int)EVar9 + 0x33c)) - *(float *)((int)EVar9 + 0x34c)) * 0.65; local_a0 = baseOffset.y + ((((this->_pos).y + (this->_posOffset).y) - *(float *)((int)EVar9 + 0x340)) - *(float *)((int)EVar9 + 0x350)) * 0.65; (**(code **)(*(int *)EVar9 + 0x14))(); *(undefined1 *)((int)this->_entityRef + 0x171) = 0; iVar7 = this->_type; } switch(iVar7) { case 0x343: FUN_005579b0(); curses = extraout_ECX_14; break; default: goto LAB_006d3c6e; case 0x361: FUN_004e07a0(); curses = extraout_ECX_13; break; case 0x38a: Entity_Pickup::Render((Entity_Pickup *)this,&baseOffset); curses = extraout_ECX_08; break; case 0x38d: if (this->_variant == 10) { FUN_00589de0(); curses = extraout_ECX_09; break; } goto LAB_006d3c74; case 0x390: NpcHelper::mother_render(); curses = extraout_ECX_10; break; case 0x398: NpcHelper::horny_boys_render(); curses = extraout_ECX_11; break; case 0x399: NpcHelper::clutch_render(this,&baseOffset); curses = extraout_ECX_12; break; case 0x3b7: FUN_00598260(); curses = extraout_ECX_15; break; case 0x3c5: if (this->_variant != 10) goto LAB_006d3c6e; local_84.x = 0.0; local_84.y = 0.0; local_84.x = (float)operator_new(0x18); *(float *)local_84.x = local_84.x; *(float *)((int)local_84.x + 4) = local_84.x; *(float *)((int)local_84.x + 8) = local_84.x; *(undefined2 *)((int)local_84.x + 0xc) = 0x101; local_8 = 0; uVar4 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar4); if (player->_minecart == (EntityPtr)this) { fStack_94 = (player->_minecartOffset).y; local_90 = player; FUN_006dac00(&local_70,&fStack_94); } uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } node = *(int **)local_84.x; if (node != (int *)local_84.x) { do { piVar1 = (int *)node[5]; fVar12 = (local_18->_pos).x; local_70 = (float)piVar1[0xcf]; local_a0 = (float)piVar1[0xd0]; piVar1[0xd0] = (int)((float)piVar1[0x823] + (local_18->_pos).y); piVar1[0xcf] = (int)((float)piVar1[0x822] + fVar12); *(undefined1 *)((int)piVar1 + 0x171) = 1; fStack_94 = baseOffset.x + (float)piVar1[0x822] * 0.65; local_90 = (Entity_Player *)(baseOffset.y + (float)piVar1[0x823] * 0.65); (**(code **)(*piVar1 + 0x14))(); piVar1[0xcf] = (int)local_70; *(undefined1 *)((int)piVar1 + 0x171) = 0; piVar1[0xd0] = (int)local_a0; piVar1 = (int *)node[2]; if (*(char *)((int)piVar1 + 0xd) == '\0') { isNil = *(char *)(*piVar1 + 0xd); node = piVar1; piVar1 = (int *)*piVar1; while (isNil == '\0') { isNil = *(char *)(*piVar1 + 0xd); node = piVar1; piVar1 = (int *)*piVar1; } } else { isNil = *(char *)(node[1] + 0xd); piVar2 = (int *)node[1]; piVar1 = node; while ((node = piVar2, isNil == '\0' && (piVar1 == (int *)node[2]))) { isNil = *(char *)(node[1] + 0xd); piVar2 = (int *)node[1]; piVar1 = node; } } } while (node != (int *)local_84.x); this = local_18; } local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&local_84,(fuzzer_allocator_> *)&local_84, *(_Tree_node **)((int)local_84.x + 4)); operator_delete((void *)local_84.x,0x18); curses = extraout_ECX_16; } } iVar7 = this->_type; if (iVar7 == 0x376) { render_overlay(this,&baseOffset,0); iVar7 = this->_type; curses = extraout_ECX_18; } if (iVar7 == 0x37d) { if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) goto LAB_006d3d39; iVar7 = 0x37d; if ((this->_pos).y <= (this->_targetPosition).y) { NpcHelper::ball_and_chain_render_chain(&baseOffset,curses); iVar7 = this->_type; } } if (iVar7 == 0x13) { if (((this->_variant != 3) || (this->_child == (EntityPtr)0x0)) || (*(float *)((int)this->_child + 0x340) < (this->_pos).y)) goto LAB_006d3d39; RenderSegmentLink(this,&baseOffset,0); iVar7 = this->_type; } if (iVar7 == 0x38e) { NpcHelper::chimera_render_child(); } } LAB_006d3d39: if ((this->_visible == 0) || (alphaMult <= 0.0)) { local_a0 = (this->_posOffset).y + (this->_pos).y; local_90 = (Entity_Player *)((g_screenHeight - 182.0) * 0.5); local_18 = (Entity_NPC *)(g_displayPixelRatio * g_screenPointScale); local_70 = ((((this->_pos).x + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_18 + 0.5; dVar14 = floor((double)local_70); local_88 = (float)dVar14; local_70 = ((local_a0 - 140.0) * 0.65 + (float)local_90) * (float)local_18 + 0.5; dVar14 = floor((double)local_70); local_70 = (float)dVar14; (this->_renderPosition).x = baseOffset.x + local_88 / (float)local_18; (this->_renderPosition).y = baseOffset.y + local_70 / (float)local_18; } if (((this->_type == 0x19b) || (this->_type == 0x330)) && ((this->_entityRef != (EntityPtr)0x0 && ((((this->_sprite)._animState._animData != (void *)0x0 && (pfVar6 = AnimationState::GetNullFrame(&(this->_sprite)._animState,&DAT_00b67800), pfVar6 != (float *)0x0)) && (*(char *)(pfVar6 + 3) != '\0')))))) { EVar9 = this->_entityRef; fVar12 = 0.0; local_70 = *(float *)((int)EVar9 + 0xdc); local_90 = *(Entity_Player **)((int)EVar9 + 0xe4); local_88 = *(float *)((int)EVar9 + 0xe8); local_a0 = *(float *)((int)EVar9 + 0xe0); if (*(int *)((int)EVar9 + 0x28) == 5) { fVar12 = 6.5; } fVar13 = *pfVar6; *(float *)((int)EVar9 + 0xe0) = fVar12 + pfVar6[1]; *(float *)((int)EVar9 + 0xdc) = fVar13 + 0.0; EVar9 = this->_entityRef; fVar12 = pfVar6[5]; *(float *)((int)EVar9 + 0xe4) = (float)local_90 * pfVar6[4]; *(float *)((int)EVar9 + 0xe8) = local_88 * fVar12; ANM2::Render((ANM2 *)((int)this->_entityRef + 0x48),&this->_renderPosition,&g_vectorZero, &g_vectorZero); EVar9 = this->_entityRef; *(float *)((int)EVar9 + 0xdc) = local_70; *(float *)((int)EVar9 + 0xe0) = local_a0; EVar9 = this->_entityRef; *(Entity_Player **)((int)EVar9 + 0xe4) = local_90; *(float *)((int)EVar9 + 0xe8) = local_88; } if (0.0 < alphaMult) { if (this->_championColorIdx == 0x15) { (this->_sprite)._scale.x = (float)local_9c; (this->_sprite)._scale.y = local_7c; } (this->_sprite)._color._tint[3] = local_68; } FUN_00860ba0(this,&baseOffset); if (((renderMode != 1) && (renderMode != 3)) || (local_61 != '\0')) goto LAB_006d44a0; if (this->_type == 0x3c4) { sprintf((byte *)(local_48._tint + 3),&DAT_00b67750); local_ec._colorize[0] = 1.4013e-45; local_ec._colorize[1] = 9.18341e-41; local_ec._colorize[2] = 0.0; local_ec._colorize[3] = 1.0; local_ec._offset[0] = -NAN; local_ec._offset[1] = 0.0; local_ec._offset[2] = 0.0; local_8 = 1; local_5c._unk = 0; local_5c._red = 1.0; local_5c._green = 1.0; local_5c._blue = 1.0; local_5c._alpha = 1.0; Font::DrawString(local_48._tint + 3,&local_5c,local_ec._colorize); local_8 = 0xffffffff; } if ((((this->_statusEffectSprite)._loaded != 0) && ((this->_statusEffectSprite)._animState._animData != (void *)0x0)) && ((this->_statusEffectSprite)._animState._isPlaying != 0)) { local_68 = (float)((uint)(this->_statusEffectSprite)._bitflags >> 0x1f); iVar7 = AnimationData::find_null_index(); if (iVar7 < 0) { if (this->_config == (EntityConfig_Entity *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] No OverlayEffect Null found for Entity (%d)\n"); } else { EntityConfig_Entity::GetName(this->_config,(std_string *)&configName,0x14); local_8 = 2; KAGE_LogMessage(1,(byte *) "[warn] No OverlayEffect Null found for Entity %s with sprite %s\n"); local_8 = 0xffffffff; if (0xf < (uint)local_5c._unk) { uVar4 = local_5c._unk + 1; pvVar8 = configName; if (0xfff < uVar4) { pvVar8 = *(void **)((int)configName + -4); uVar4 = local_5c._unk + 0x24; if (0x1f < (uint)((int)configName + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar4); } local_5c._alpha = 0.0; local_5c._unk = 0xf; configName = (void *)((uint)configName & 0xffffff00); } } else { local_9c = ANM2::GetLayerFrame(&this->_sprite,iVar7); if (((local_9c != (float *)0x0) && (*(char *)(local_9c + 3) != '\0')) && ((local_68._0_1_ == '\0' || ((this->_parent == (EntityPtr)0x0 || (bVar3 = Entity::is_same_segmented_body((Entity *)this,(Entity *)0x0), bVar3 == 0)))))) { (this->_statusEffectSprite)._scale.x = local_9c[4]; (this->_statusEffectSprite)._scale.y = local_9c[5]; local_7c = g_displayPixelRatio * g_screenPointScale; local_70 = (((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_68 = ((((this->_pos).x + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_7c + 0.5; dVar14 = floor((double)local_68); local_a0 = (float)dVar14 / local_7c; local_68 = local_70 * local_7c + 0.5; dVar14 = floor((double)local_68); local_68 = (float)dVar14; local_84.x = baseOffset.x + local_a0 + *local_9c; local_84.y = baseOffset.y + local_68 / local_7c + local_9c[1]; ANM2::Render(&this->_statusEffectSprite,&local_84,&g_vectorZero,&g_vectorZero); } } } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x193,(RNG **)&g_game->_playerManager,1); if (((((((player == (Entity_Player *)0x0) || (this->_visible == 0)) || (bVar3 = Entity::IsActiveEnemy((Entity *)this,0), bVar3 == 0)) || ((bVar3 = Entity::HasEntityFlags((Entity *)this,0x10), bVar3 != 0 || ((this->_sprite)._color._tint[3] <= 0.0)))) || (g_game->_frameCount - this->_spawnFrame < 2)) || ((this->_health <= 0.0 || (statusTarget = (Entity_NPC *)Entity::GetStatusEffectTarget((Entity *)this), statusTarget != this)))) || (bVar3 = Entity::HasEntityFlags((Entity *)this,0x800000000), bVar3 != 0)) { if (this->_controllerID == 0xffffffff) goto LAB_006d44a0; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar3 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerID); goto LAB_006d445e; } } else { pvVar8 = Sprite::GetNullFrame((Sprite *)&this->_sprite,(byte *)"OverlayEffect"); if (pvVar8 == (void *)0x0) goto LAB_006d44a0; bVar3 = *(byte *)((int)pvVar8 + 0xc); LAB_006d445e: if (bVar3 == 0) goto LAB_006d44a0; } local_84.x = (this->_renderPosition).x + 0.0; local_84.y = (this->_renderPosition).y + 10.0; render_debug(&local_84,this); LAB_006d44a0: if (((minecart != (EntityPtr)0x0) && (this->_visible != 0)) && (Sprite::RenderLayer((Sprite *)((int)minecart + 0x48),1,&renderPos,&g_vectorZero,&g_vectorZero) , this->_type == 0x38a)) { NpcHelper::hornfel_render_minecart((int)this->_minecart + 0x48,&renderPos); } if ((((this->_controllerID != 0xffffffff) && ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1) || (bVar3 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerID), bVar3 != 0)))) && ((this->_chargeBarSprite)._loaded != 0)) && (0.0 < (this->_chargeBarSprite)._color._tint[3])) { fVar12 = (this->_sprite)._scale.y; renderPos.y = (this->_renderPosition).y - fVar12 * 35.0; renderPos.x = fVar12 * 12.0 + (this->_renderPosition).x; ANM2::Render(&this->_chargeBarSprite,&renderPos,&g_vectorZero,&g_vectorZero); } if (((this->_flags & 0x1000002000000000) != 0) && (((uint)g_game->_debugFlags >> 6 & 1) != 0)) { sprintf(debugText,(byte *)"%.02f"); manager = g_manager; local_ec._colorize[0] = 5.60519e-45; local_ec._colorize[1] = 9.18341e-41; local_ec._colorize[2] = 0.0; local_ec._colorize[3] = 1.0; local_ec._offset[0] = -NAN; local_ec._offset[1] = 0.0; local_ec._offset[2] = 0.0; local_8 = 3; local_7c = g_displayPixelRatio * g_screenPointScale; local_5c._unk = 0; local_5c._red = 1.0; local_5c._green = 0.0; local_5c._blue = 1.0; local_5c._alpha = 0.5; local_68 = ((g_screenWidth - 338.0) * 0.5 + ((this->_pos).x - 60.0) * 0.65) * local_7c + 0.5; dVar14 = floor((double)local_68); local_70 = (float)dVar14 / local_7c; local_68 = (((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_7c + 0.5; dVar14 = floor((double)local_68); local_68 = (float)dVar14; renderPos.x = local_70 + renderOffset->x; renderPos.y = local_68 / local_7c + renderOffset->y; Font::DrawStringScaled (&manager->_font2_TeamMeatEx12,debugText,&renderPos,&local_5c,local_ec._colorize); } ExceptionList = local_10; return; } //@@ 006d4840 Entity_NPC::RenderShadowLayer /* ZHL [vtable slot 6] */ void __thiscall Entity_NPC::RenderShadowLayer(Entity_NPC *this,Vector *param_2) { if (this->_type == 0x376) { render_overlay(this,param_2,1); Entity::RenderShadowLayer((Entity *)this,param_2); return; } if ((this->_type == 0x13) && (this->_variant == 3)) { RenderSegmentLink(this,param_2,1); } Entity::RenderShadowLayer((Entity *)this,param_2); return; } //@@ 006d48a0 Entity_NPC::GetForwardVector /* ZHL [vtable slot 22] */ float * __thiscall Entity_NPC::GetForwardVector(Entity_NPC *this,float *param_2) { float fVar1; float fVar2; int iVar3; float fVar4; fVar1 = g_vectorZero.y; if (((this->_forwardVector).x != g_vectorZero.x) || ((this->_forwardVector).y != g_vectorZero.y)) { fVar1 = (this->_forwardVector).y; *param_2 = (this->_forwardVector).x; param_2[1] = fVar1; return param_2; } iVar3 = this->_type; if (iVar3 == 0x2d) { *param_2 = g_vectorZero.x; param_2[1] = fVar1; return param_2; } if ((iVar3 == 0x106) || (iVar3 == 0x107)) { *param_2 = 0.0; param_2[1] = 1.0; return param_2; } fVar1 = (this->_velocity).y; fVar2 = (this->_velocity).x; if (fVar2 * fVar2 + fVar1 * fVar1 <= 0.01) { *param_2 = 0.0; param_2[1] = 1.0; } else { fVar2 = (this->_velocity).x; param_2[1] = (this->_velocity).y; fVar1 = param_2[1]; *param_2 = fVar2; fVar2 = *param_2; fVar4 = sqrtf(fVar1 * fVar1 + fVar2 * fVar2); if (0.0 < fVar4) { *param_2 = fVar2 * (1.0 / fVar4); param_2[1] = fVar1 * (1.0 / fVar4); return param_2; } } return param_2; } //@@ 006d4a00 Entity_NPC::CanBeDamagedFromVelocity /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [lua] Lua binding EntityNPC:CanBeDamagedFromVelocity prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity_NPC::CanBeDamagedFromVelocity(Entity_NPC *this,Vector velocity) { uint uVar1; int iVar2; int cmpResult; uint uVar3; byte *cmpName; bool bVar4; std_string *psVar5; Vector facingDir; byte isDamageable; std_string animName; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *animData; undefined4 animNameBuf; local_8 = 0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&animName + 0x28U; iVar2 = this->_type; if (iVar2 != 0x29) { if (iVar2 == 0x61) { ExceptionList = &local_10; iVar2 = Entity::get_velocity_direction((Entity *)this); goto LAB_006d4d66; } if ((iVar2 != 0xfe) && (iVar2 != 0x11b)) { if (iVar2 == 0x387) { if (this->_variant != 1) { return 1; } if ((velocity.x == g_vectorZero.x) && (velocity.y == g_vectorZero.y)) { return 1; } ExceptionList = &local_10; iVar2 = vector_to_direction(&velocity); if (iVar2 == this->_i1) { ExceptionList = local_10; return 1; } ExceptionList = local_10; return 0; } if (iVar2 != 0x17) { return 1; } if (this->_variant != 3) { return 1; } ExceptionList = &local_10; ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState,&animName); local_8 = 0; iVar2 = FUN_006da7d0(animName._size - 2,2,&DAT_00b1cde4); if (iVar2 == 0) { iVar2 = 1; } else { iVar2 = FUN_006da7d0(animName._size - 4,4,&DAT_00b1cddc); if (iVar2 == 0) { iVar2 = 3; } else { iVar2 = 2; if ((this->_sprite)._flipX != 0) { iVar2 = 0; } } } Isaac::GetAxisAlignedUnitVectorFromDir(&facingDir,iVar2); animNameBuf = animName._buf._0_4_; uVar3 = 6; if (animName._size < 6) { uVar3 = animName._size; } psVar5 = &animName; if (0xf < animName._capacity) { psVar5 = (std_string *)animName._buf._0_4_; } cmpResult = string_compare((byte *)psVar5,uVar3,(byte *)"Attack",6); if (cmpResult == 0) { facingDir.x = 0.70710677; psVar5 = (std_string *)0x3f3504f3; if (iVar2 == 1) { psVar5 = (std_string *)0xbf3504f3; } if ((this->_sprite)._flipX != 0) { facingDir.x = -0.70710677; } } else { psVar5 = (std_string *)facingDir.y; } isDamageable = 0.0 <= (float)psVar5 * velocity.y + facingDir.x * velocity.x; if (0xf < animName._capacity) { uVar3 = animName._capacity + 1; psVar5 = (std_string *)animNameBuf; if (0xfff < uVar3) { psVar5 = (std_string *)((std_string *)(animNameBuf + -0x18))->_capacity; uVar3 = animName._capacity + 0x24; if ((byte *)0x1f < (byte *)(animNameBuf + (-4 - (int)psVar5))) goto LAB_006d4d56; } operator_delete(psVar5,uVar3); } ExceptionList = local_10; return isDamageable; } } animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { animName._capacity = 0xf; animName._buf._0_4_ = (std_string *)0x0; animName._size = 0; ExceptionList = &local_10; } else { ExceptionList = &local_10; std::string::string(animName._buf,animData); } psVar5 = &animName; if (0xf < animName._capacity) { psVar5 = (std_string *)animName._buf._0_4_; } cmpName = (byte *)&DAT_00b1cde4; uVar3 = animName._size; if (2 < animName._size) { uVar3 = 2; } while (uVar1 = uVar3 - 4, 3 < uVar3) { if (*(std_string **)psVar5->_buf != *(std_string **)cmpName) goto LAB_006d4c56; psVar5 = (std_string *)(psVar5->_buf + 4); cmpName = cmpName + 4; uVar3 = uVar1; } if (uVar1 == 0xfffffffc) { LAB_006d4c8a: uVar3 = 0; } else { LAB_006d4c56: bVar4 = (byte)psVar5->_buf[0] < *cmpName; if ((psVar5->_buf[0] == *cmpName) && ((uVar1 == 0xfffffffd || ((bVar4 = (byte)psVar5->_buf[1] < cmpName[1], psVar5->_buf[1] == cmpName[1] && ((uVar1 == 0xfffffffe || ((bVar4 = (byte)psVar5->_buf[2] < cmpName[2], psVar5->_buf[2] == cmpName[2] && ((uVar1 == 0xffffffff || (bVar4 = (byte)psVar5->_buf[3] < cmpName[3], psVar5->_buf[3] == cmpName[3])))))))))))) goto LAB_006d4c8a; uVar3 = -(uint)bVar4 | 1; } if (((uVar3 == 0) && (1 < animName._size)) && (animName._size < 3)) { iVar2 = 1; } else { psVar5 = &animName; if (0xf < animName._capacity) { psVar5 = (std_string *)animName._buf._0_4_; } cmpName = &DAT_00b60d94; uVar3 = animName._size; if (4 < animName._size) { uVar3 = 4; } while (uVar1 = uVar3 - 4, 3 < uVar3) { if (*(std_string **)psVar5->_buf != *(std_string **)cmpName) goto LAB_006d4cd6; psVar5 = (std_string *)(psVar5->_buf + 4); cmpName = cmpName + 4; uVar3 = uVar1; } if (uVar1 == 0xfffffffc) { LAB_006d4d0a: uVar3 = 0; } else { LAB_006d4cd6: bVar4 = (byte)psVar5->_buf[0] < *cmpName; if ((psVar5->_buf[0] == *cmpName) && ((uVar1 == 0xfffffffd || ((bVar4 = (byte)psVar5->_buf[1] < cmpName[1], psVar5->_buf[1] == cmpName[1] && ((uVar1 == 0xfffffffe || ((bVar4 = (byte)psVar5->_buf[2] < cmpName[2], psVar5->_buf[2] == cmpName[2] && ((uVar1 == 0xffffffff || (bVar4 = (byte)psVar5->_buf[3] < cmpName[3], psVar5->_buf[3] == cmpName[3])))))))))))) goto LAB_006d4d0a; uVar3 = -(uint)bVar4 | 1; } if (((uVar3 == 0) && (3 < animName._size)) && (animName._size < 5)) { iVar2 = 0; if ((this->_sprite)._flipX == 0) { iVar2 = 2; } } else { iVar2 = 3; } } if (0xf < animName._capacity) { uVar3 = animName._capacity + 1; psVar5 = (std_string *)animName._buf._0_4_; facingDir.y = (float)animName._buf._0_4_; if (0xfff < uVar3) { psVar5 = (std_string *)((std_string *)(animName._buf._0_4_ + -0x18))->_capacity; uVar3 = animName._capacity + 0x24; if ((byte *)0x1f < (byte *)(animName._buf._0_4_ + (-4 - (int)psVar5))) { LAB_006d4d56: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar5,uVar3); } LAB_006d4d66: if ((((0.0 <= velocity.x) || (iVar2 != 2)) && (((velocity.x <= 0.0 || (iVar2 != 0)) && ((velocity.y <= 0.0 || (iVar2 != 1)))))) && ((0.0 <= velocity.y || (iVar2 != 3)))) { ExceptionList = local_10; return 1; } ExceptionList = local_10; return 0; } //@@ 006d4db0 Entity_NPC::CanReroll /* ZHL [lua] Lua binding EntityNPC:CanReroll */ uint __thiscall Entity_NPC::CanReroll(Entity_NPC *this) { void *pvVar1; pvVar1 = (void *)(*(uint *)((int)this->_config + 0xd8) & 0x10); if ((pvVar1 == (void *)0x0) && (((this->_type != 0x104 || (this->_variant != 10)) || (this->_parent == (EntityPtr)0x0)))) { pvVar1 = (void *)(**(code **)(*(int *)this + 0x4c))(); if (((char)pvVar1 == '\0') && (pvVar1 = this->_config, *(char *)((int)pvVar1 + 0x2c) == '\0')) { return CONCAT31((int3)((uint)pvVar1 >> 8),1); } } return (uint)pvVar1 & 0xffffff00; } //@@ 006d4e00 Entity_NPC::PlayDeathEffects /* DB: ? gfuel, layer-frame pos, death sfx; NPC Update and Rock Spider */ void Entity_NPC::PlayDeathEffects(void) { int iVar1; void *layerFrame; int *bloodEffect; uint seed; Entity *effect; Entity_NPC *in_ECX; uint uVar2; float fVar3; Vector splatOffset; Vector local_10; Manager *manager; iVar1 = PlayerManager::GetGFuelCount(); if (0 < iVar1) { spawn_gfuel_explosion(); return; } splatOffset.x = g_vectorZero.x; splatOffset.y = g_vectorZero.y; if (((in_ECX->_sprite)._animState._animData != (void *)0x0) && (((in_ECX->_type != 0x38d || (in_ECX->_variant != 10)) && (layerFrame = AnimationState::GetLayerFrame(&(in_ECX->_sprite)._animState,0), layerFrame != (void *)0x0)))) { splatOffset.x = (*(float *)((int)layerFrame + 8) * 0.5 - *(float *)((int)layerFrame + 0x20)) + *(float *)((int)layerFrame + 0x10); splatOffset.y = (*(float *)((int)layerFrame + 0xc) * 0.5 - *(float *)((int)layerFrame + 0x24)) + *(float *)((int)layerFrame + 0x14); } manager = g_manager; if ((in_ECX->_flags & 0x10000) != 0) { return; } if ((*(uint *)((int)in_ECX->_config + 0x60) >> 5 & 1) != 0) { local_10.x = 3.32108e-43; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,(int)local_10.x,0.9,2,0,1.0,0.0); uVar2 = 0x2b; goto LAB_006d51b2; } iVar1 = in_ECX->_type; if (iVar1 < 0x11a) { if (iVar1 != 0x119) { switch(iVar1) { case 0xd: case 0xe: case 0x12: case 0xd6: case 0xde: case 0xf9: case 0x100: break; default: goto LAB_006d4f7c; case 0x55: case 0x5e: case 0xd7: case 0xfa: code_r0x006d519f: uVar2 = 0x26; goto LAB_006d51b2; } } LAB_006d51a6: uVar2 = 3; } else { if (0x346 < iVar1) { switch(iVar1) { case 0x355: uVar2 = 0x83; goto LAB_006d51b2; default: goto LAB_006d4f7c; case 0x364: goto LAB_006d51a6; case 0x365: case 0x374: goto code_r0x006d519f; } } if (iVar1 == 0x346) goto LAB_006d51a6; if (iVar1 < 0x32b) { if (iVar1 != 0x32a) { if ((iVar1 != 0x128) && (iVar1 != 0x328)) goto LAB_006d4f7c; goto LAB_006d51a6; } uVar2 = 0x82; } else { if (iVar1 != 0x332) { LAB_006d4f7c: fVar3 = in_ECX->_size; uVar2 = 2; if (fVar3 < 13.0) { uVar2 = 1; } if ((18.0 <= fVar3) || (30.0 < in_ECX->_shadowSize)) { uVar2 = 3; } if ((40.0 <= fVar3) || (50.0 < in_ECX->_shadowSize)) { uVar2 = 4; } seed = Random(); effect = Game::SpawnEx(g_game,1000,2,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,uVar2,seed,0) ; bloodEffect = (int *)__RTDynamicCast(effect,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect:: RTTI_Type_Descriptor,0); bloodEffect[0x37] = (int)splatOffset.x; bloodEffect[0x38] = (int)splatOffset.y; (**(code **)(*bloodEffect + 0x3c))(&in_ECX->_splatColor,0xffffffff,0xff,0,1); bloodEffect[0xd6] = 0x41200000; goto LAB_006d505b; } uVar2 = 0x91; } } LAB_006d51b2: seed = Random(); local_10.x = splatOffset.x + (in_ECX->_pos).x; local_10.y = splatOffset.y + (in_ECX->_pos).y; effect = Game::SpawnEx(g_game,1000,uVar2,&local_10,&g_vectorZero,(Entity *)0x0,0,seed,0); (**(code **)(*(int *)effect + 0x3c))(&in_ECX->_splatColor,0xffffffff,0xff,0,1); LAB_006d505b: if (in_ECX->_type == 0x372) { uVar2 = Random(); effect = Game::SpawnEx(g_game,1000,0x12,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2,0); iVar1 = *(int *)effect; (effect->_sprite)._color._colorize[0] = 5.0; (effect->_sprite)._color._colorize[1] = 5.0; (effect->_sprite)._color._colorize[2] = 5.0; (effect->_sprite)._color._colorize[3] = 1.0; (**(code **)(iVar1 + 0xc))(); uVar2 = Random(); effect = Game::SpawnEx(g_game,1000,0x10,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,1,uVar2,0); fVar3 = g_vectorOne.y * 0.6; (effect->_sprite)._scale.x = g_vectorOne.x * 0.6; (effect->_sprite)._scale.y = fVar3; uVar2 = Random(); (effect->_sprite)._flipX = ~(byte)uVar2 & 1; (**(code **)(*(int *)effect + 0xc))(); PlaySound(in_ECX,0xcf,1.0,2,0,1.0); PlaySound(in_ECX,0x50,0.8,2,0,1.0); } return; } //@@ 006d5350 FUN_006d5350 void FUN_006d5350(void) { Entity_Player *spawner; uint seed; Entity *pEVar1; int *piVar2; int in_ECX; float fVar3; float fVar4; spawner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x15e,(RNG **)&g_game->_playerManager,0); if (spawner != (Entity_Player *)0x0) { seed = Random(); pEVar1 = Game::SpawnEx(g_game,1000,0x35,(Vector *)(in_ECX + 0x33c),&g_vectorZero, (Entity *)spawner,0,seed,0); piVar2 = (int *)__RTDynamicCast(pEVar1,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); fVar4 = *(float *)(in_ECX + 0x370) * 0.05; fVar3 = fVar4 * g_vectorOne.x; piVar2[0x3a] = (int)(fVar4 * g_vectorOne.y); piVar2[0x39] = (int)fVar3; (**(code **)(*piVar2 + 0xc))(); } return; } //@@ 006d5400 Entity_NPC::trigger_kill_item_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Contagion/Athame/Friendly Ball/Book of Virtues owners */ void __thiscall Entity_NPC::trigger_kill_item_effects(Entity_NPC *this) { Vector *pos; void **ppvVar1; undefined4 uVar2; code *pcVar3; ColorMod color; qword qVar4; byte bVar5; uint uVar6; Entity_Player *itemOwner; Entity_Laser *mawOfVoid; EntityConfig_Entity *entityConfig; ColorMod *color_00; int *playerIt; byte unused; byte unused_00; int iVar7; ActiveItemDesc *activeSlot; void *pvVar8; qword *pqVar9; int iVar10; float fVar11; PlayerManager *playerManager; float damage; Color aCStackY_1960 [128]; undefined4 in_stack_fffffcdc; undefined4 in_stack_fffffce0; Vector *in_stack_fffffce4; Vector *in_stack_fffffce8; EntityRef baitSource; EntityRef iceSource; EntityRef magnetizeSource; EntityRef burnSource; EntityRef confusionSource; EntityRef charmSource; EntityRef fearSource; EntityRef shrinkSource; EntityRef freezeSource; EntityRef midasSource; EntityRef poisonSource; EntityRef slowSource; EntityRef brimstoneMarkSource; Vector freeTilePos; undefined8 local_e0; undefined4 local_d8; undefined4 local_d4; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; float local_c4; float local_c0; float local_bc; float local_b8; undefined4 local_b4; undefined4 local_b0; EntityList_EL nearbyEnemies; EntityList_EL contagionEnemies; int local_8c [3]; undefined4 local_80; void **local_7c; float slowingAmount; Entity_Player *local_74; float local_70; Color poofColor; ColorMod fartColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Game *game; Entity_NPC *nearbyEnemy; EntityPtr spawner; local_8 = -NAN; puStack_c = &LAB_00afac5b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&fartColor)[1]._colorize; ExceptionList = &local_10; if (this->_isBoss == 0) { if (this->_isChampion != 0) { NpcHelper::ChampionDrop(this); } } else { Room::TriggerBossDeath(g_game->_room,(Entity *)this); } if ((this->_type == 0x38f) && (this->_variant == 1)) { rotgut_death_spawn_effects(); } if ((this->_flags & 0x400000) != 0) { if ((this->_killDamageFlags & 4) == 0) { uVar6 = Random(); iVar10 = uVar6 % 3 + 1; } else { uVar6 = Random(); iVar10 = uVar6 % 5 + 2; } if (iVar10 != 0) { do { itemOwner = Game::GetNearestPlayer(g_game,&this->_pos); itemOwner->_numBlueSpiders = itemOwner->_numBlueSpiders + 1; spawn_blue_spider(&this->_pos,(Entity *)itemOwner,&g_vectorZero); iVar10 = iVar10 + -1; } while (iVar10 != 0); } } local_70 = 0.0; if ((this->_flags & 0x40000000000) == 0) { if ((this->_flags & 0x800000) != 0) { uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6; (this->_dropRNG)._seed = uVar6; if (uVar6 == (uVar6 / 5) * 5) { uVar6 = Random(); game = g_game; in_stack_fffffce8 = Room::FindFreeTilePosition(g_game->_room,&freeTilePos,&this->_pos,0.0); in_stack_fffffce4 = (Vector *)0xa; in_stack_fffffce0 = 5; in_stack_fffffcdc = 0x6d55be; Game::Spawn(game,5,10,in_stack_fffffce8,&g_vectorZero,(Entity *)0x0,6,uVar6); } } game = g_game; uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6; (this->_dropRNG)._seed = uVar6; itemOwner = PlayerManager::RandomCollectibleOwner(&game->_playerManager,0x1b2,uVar6,(RNG **)0x0) ; if ((itemOwner != (Entity_Player *)0x0) && ((this->_flags & 0x10000020) != 0 || (this->_flags & 0x2000000000000) != 0)) { iVar7 = itemOwner->_jarFlies + 1; iVar10 = 0x14; if (iVar7 < 0x14) { iVar10 = iVar7; } itemOwner->_jarFlies = iVar10; game = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } } } if (this->_type == 0x197) { uVar2 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 8; *(undefined4 *)((int)&this->_flags + 4) = uVar2; } else { (**(code **)(*(int *)this + 0x28))(); } itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1d2,(RNG **)&g_game->_playerManager,0); if ((itemOwner != (Entity_Player *)0x0) && (((this->_flags & 0x200000000) != 0 || (*(char *)((int)g_game->_room + 0x72a0) == '\0')))) { pos = &this->_pos; fartColor._tint[0] = 1.0; fartColor._tint[1] = 1.0; fartColor._tint[2] = 1.0; fartColor._tint[3] = 1.0; in_stack_fffffce8 = (Vector *)0x42aa0000; fartColor._offset[0] = 0.0; fartColor._colorize[0] = 0.0; fartColor._colorize[1] = 0.0; fartColor._colorize[2] = 0.0; fartColor._colorize[3] = 0.0; fartColor._offset[1] = 0.0; fartColor._offset[2] = 0.0; in_stack_fffffce0 = 0x6d573a; in_stack_fffffce4 = pos; Game::Fart(g_game,pos,85.0,(Entity *)itemOwner,1.0,1,&fartColor); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&contagionEnemies,pos,85.0,8); uVar6 = 0; local_8 = 0.0; if (contagionEnemies._size != 0) { do { nearbyEnemy = *(Entity_NPC **)((int)contagionEnemies._data + uVar6 * 4); if ((nearbyEnemy != this) && (bVar5 = Entity::IsVulnerableEnemy((Entity *)nearbyEnemy,(Entity *)0x0), bVar5 != 0)) { iVar10 = *(int *)((int)contagionEnemies._data + uVar6 * 4); *(uint *)(iVar10 + 0x16c) = *(uint *)(iVar10 + 0x16c) | 2; *(undefined4 *)(iVar10 + 0x168) = *(undefined4 *)(iVar10 + 0x168); } uVar6 = uVar6 + 1; } while (uVar6 < (uint)contagionEnemies._size); } local_8 = -NAN; if (contagionEnemies._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } if (contagionEnemies._data != (void *)0x0) { uVar6 = *(uint *)((int)contagionEnemies._data + -4); qVar4 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar6; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar4 < uVar6); free((void *)((int)contagionEnemies._data + -4)); } local_8 = -NAN; } } local_74 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x198,(RNG **)&g_game->_playerManager,0); if (local_74 != (Entity_Player *)0x0) { uVar6 = this->_initSeed; local_e0 = 0x70000000b; local_d8 = 0xc; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar6 = uVar6 >> 0xb ^ uVar6; uVar6 = uVar6 << 7 ^ uVar6; uVar6 = uVar6 >> 0xc ^ uVar6; for (playerIt = (g_game->_playerManager)._playerList._begin; playerIt != (g_game->_playerManager)._playerList._end; playerIt = playerIt + 1) { iVar10 = *playerIt; if ((*(int *)(iVar10 + 0x2c) == 0) && (*(char *)(iVar10 + 0x20a9) == '\0')) { local_70 = local_70 + *(float *)(iVar10 + 0x156c); } } if ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 < local_70 * 0.025 + 0.25) { mawOfVoid = Entity_Player::SpawnMawOfVoid(local_74,0x3c); iVar10 = *(int *)mawOfVoid; (mawOfVoid->_pos).x = (this->_pos).x; (mawOfVoid->_pos).y = (this->_pos).y; mawOfVoid->_disableFollowParent = 1; (**(code **)(iVar10 + 0xc))(); } } if (((((this->_flags & 0x20000000) != 0) && (g_game->_challenge == 0x21)) && (itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x17e,(RNG **)&g_game->_playerManager,1), itemOwner != (Entity_Player *)0x0)) && (((this->_spawnerType == 1 || (this->_spawnerType == 3)) && ((spawner = this->_spawnerEntity, spawner != (EntityPtr)0x0 && (*(int *)((int)spawner + 0x28) == 1)))))) { uVar6 = 0; activeSlot = (ActiveItemDesc *)((int)spawner + 0x1580); do { if (activeSlot->_item == 0x17e) { if (-1 < (int)uVar6) { Entity_Player::FullCharge((Entity_Player *)spawner,uVar6,0,0); } break; } uVar6 = uVar6 + 1; activeSlot = activeSlot + 1; } while (uVar6 < 4); } game = g_game; if ((this->_flags & 0x800000000000000) != 0) { uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = (this->_dropRNG)._seed; if (uVar6 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6; (this->_dropRNG)._seed = uVar6; itemOwner = PlayerManager::RandomCollectibleOwner(&game->_playerManager,0x248,uVar6,(RNG **)0x0) ; if (((itemOwner != (Entity_Player *)0x0) && (itemOwner->_type == 1)) && (entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,this->_type,this->_variant,0), entityConfig != (EntityConfig_Entity *)0x0)) { uVar6 = entityConfig->tags; local_80 = *(undefined4 *)&entityConfig->field_0xdc; if ((uVar6 & 0x80) == 0) { if ((uVar6 & 0x40) == 0) { if ((uVar6 & 0x100) == 0) { iVar10 = 0x1000a; } else { iVar10 = 0x1000d; } } else { iVar10 = 0x1000b; } } else { iVar10 = 0x1000c; } in_stack_fffffce8 = (Vector *)0x6d5aab; Entity_Player::AddWisp(itemOwner,iVar10,&this->_pos,0,0); } } *(undefined1 *)((int)g_game->_room + 0x72a0) = 1; if (this->_type == 0x3c3) { this->_type = this->_stateFrame; Room::record_killed_npc(); this->_type = 0x3c3; } else { Room::record_killed_npc(); } if (this->_entityRef != (EntityPtr)0x0) { local_74 = (Entity_Player *)&this->_entityRef; std::multiset::erase(); } this->_entityRef = (EntityPtr)0x0; ppvVar1 = &this->_aimTargetEffect; if (*ppvVar1 != (void *)0x0) { local_7c = ppvVar1; std::multiset::erase(); } *ppvVar1 = (void *)0x0; local_8c[2] = (int)this->_flags; if (((this->_flags & 0x100000000000000) != 0) && ((this->_flags & 0x80000000000000) != 0)) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEnemies,&this->_pos,120.0,8); local_8 = 2.8026e-45; local_70 = 0.0; if ((float)nearbyEnemies._size != 0.0) { do { fVar11 = local_70; nearbyEnemy = *(Entity_NPC **)((int)nearbyEnemies._data + (int)local_70 * 4); if ((nearbyEnemy != this) && (bVar5 = Entity::IsVulnerableEnemy((Entity *)nearbyEnemy,(Entity *)0x0), bVar5 != 0)) { ::EntityRef::constructor(&brimstoneMarkSource,(Entity *)0x0); Entity::AddBrimstoneMark((Entity *)nearbyEnemy,&brimstoneMarkSource,0x96); bVar5 = Entity::HasEntityFlags((Entity *)this,0x80); if (bVar5 != 0) { slowingAmount = this->_slowingAmount; ::EntityRef::constructor(&slowSource,(Entity *)0x0); bVar5 = 0; Color::Reset(aCStackY_1960 + 0x81); color._tint[2] = 1.3; color._tint[0] = 1.0; color._tint[1] = 1.0; color._tint[3] = 1.0; color._colorize[0] = (float)in_stack_fffffcdc; color._colorize[1] = (float)in_stack_fffffce0; color._colorize[2] = (float)in_stack_fffffce4; color._colorize[3] = (float)in_stack_fffffce8; color._offset[0] = 0.15686275; color._offset[1] = 0.15686275; color._offset[2] = 0.15686275; Entity::AddSlowing((Entity *)nearbyEnemy,&slowSource,0x5a,slowingAmount,color,bVar5); fVar11 = local_70; } bVar5 = Entity::HasEntityFlags((Entity *)this,0x40); if (bVar5 != 0) { damage = this->_poisonTickDamage; ::EntityRef::constructor(&poisonSource,(Entity *)0x0); Entity::AddPoison((Entity *)nearbyEnemy,&poisonSource,0x5a,damage,0); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x400); if (bVar5 == 0) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x20); if (bVar5 != 0) { ::EntityRef::constructor(&freezeSource,(Entity *)0x0); Entity::AddFreeze((Entity *)nearbyEnemy,&freezeSource,0x5a,0); } } else { ::EntityRef::constructor(&midasSource,(Entity *)0x0); Entity::AddMidasFreeze((Entity *)nearbyEnemy,&midasSource,0x5a,0); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000000); if (bVar5 == 0) { bVar5 = Entity::HasEntityFlags((Entity *)this,0x800); if (bVar5 != 0) { ::EntityRef::constructor(&fearSource,(Entity *)0x0); Entity::AddFear((Entity *)nearbyEnemy,&fearSource,0x5a,0); } } else { ::EntityRef::constructor(&shrinkSource,(Entity *)0x0); Entity::AddShrink((Entity *)nearbyEnemy,&shrinkSource,0x5a,0,0); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x100); if (bVar5 != 0) { ::EntityRef::constructor(&charmSource,(Entity *)0x0); Entity::AddCharmed((Entity *)nearbyEnemy,&charmSource,0x5a,0,0); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x200); if (bVar5 != 0) { ::EntityRef::constructor(&confusionSource,(Entity *)0x0); Entity::AddConfusion((Entity *)nearbyEnemy,&confusionSource,0x5a,0); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x1000); if (bVar5 != 0) { ::EntityRef::constructor(&burnSource,(Entity *)0x0); Entity::AddBurn((Entity *)nearbyEnemy,&burnSource,0x5a,0.0,0); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x8000000000000); if (bVar5 != 0) { ::EntityRef::constructor(&magnetizeSource,(Entity *)0x0); Entity::AddMagnetized((Entity *)nearbyEnemy,&magnetizeSource,0x5a,unused); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x4000000000000); if (bVar5 != 0) { ::EntityRef::constructor(&iceSource,(Entity *)0x0); Entity::AddIce((Entity *)nearbyEnemy,&iceSource,0x5a); } bVar5 = Entity::HasEntityFlags((Entity *)this,0x10000000000000); if (bVar5 != 0) { ::EntityRef::constructor(&baitSource,(Entity *)0x0); Entity::AddBaited((Entity *)nearbyEnemy,&baitSource,0x5a,unused_00); } local_c4 = g_vectorZero.x; local_bc = g_vectorZero.x; local_d4 = 0; local_c0 = g_vectorZero.y; local_b8 = g_vectorZero.y; local_d0 = 0; local_cc = 0; local_c8 = 0; local_b4 = 0; local_b0 = 0; in_stack_fffffce8 = (Vector *)0x41200000; in_stack_fffffce4 = (Vector *)0x6d5f2e; (**(code **)(**(int **)((int)nearbyEnemies._data + (int)fVar11 * 4) + 0x20))(); fVar11 = local_70; } local_70 = (float)((int)fVar11 + 1); } while ((uint)local_70 < (uint)nearbyEnemies._size); } Color::Color(&poofColor); Entity::MakeBloodPoof((Entity *)this,&this->_pos,color_00,1.0); uVar6 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar8 = (playerManager->_playerList)._end; if ((int)pvVar8 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar8 = (playerManager->_playerList)._end; } playerIt = (playerManager->_playerList)._begin; if (uVar6 < (uint)((int)pvVar8 - (int)playerIt >> 2)) { playerIt = playerIt + uVar6; } iVar10 = *playerIt; iVar7 = *(int *)(iVar10 + 0x13dc); if (((iVar7 != 0) || (iVar7 = *(int *)(iVar10 + 0x13e0), iVar7 != 0)) && (*(int *)(iVar7 + 0x30) == 2)) { TemporaryEffects::RemoveNullEffect((TemporaryEffects *)(iVar10 + 0x1508),0x7f,-1); pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((0x7f < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 >> 2) && (iVar7 = *(int *)((int)pvVar8 + 0x1fc), iVar7 != 0)) { local_8c[2] = *(undefined4 *)(iVar7 + 0x78); local_8c[1] = 0; local_80 = 0; local_8c[0] = iVar7; TemporaryEffects::AddEffect((TemporaryEffects *)(iVar10 + 0x1508),local_8c,1,1); } } uVar6 = uVar6 + 1; playerManager = &g_game->_playerManager; } while (uVar6 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } local_8 = -NAN; if (nearbyEnemies._0_1_ == '\0') { local_8 = 4.2039e-45; tracked_alloc(1,nearbyEnemies._data,0); local_8 = -NAN; } } FUN_00860c90(); ExceptionList = local_10; return; } //@@ 006d60a0 Entity_NPC::TakeDamage /* ZHL [vtable slot 8] */ byte __thiscall Entity_NPC::TakeDamage (Entity_NPC *this,float param_2,uint param_3,undefined4 param_4,EntityRef *param_5, int param_6) { EntityPtr EVar1; int iVar2; Game *pGVar3; byte bVar4; byte bVar5; Entity_Player *pEVar6; Entity *pEVar7; uint uVar8; Vector *pVVar9; Entity *pEVar10; int *piVar11; EntityPtr EVar12; int iVar13; int iVar14; int iVar15; float fVar16; float fVar17; int *piVar18; int *piStack_1c; Vector local_18; Vector local_10; bVar4 = Entity::TakeDamage((Entity *)this,param_2,CONCAT44(param_4,param_3),param_5,param_6); pGVar3 = g_game; if (((this->_flags & 0x20000000) == 0) && ((((param_5->_type == 1 || (param_5->_type == 3)) || (param_5->_spawnerType == 1)) || (param_5->_spawnerType == 3)))) { *(undefined1 *)((int)g_game->_room + 0x72a1) = 0; } if (((param_5->_entity != (void *)0x0) && (pEVar6 = PlayerManager::FirstCollectibleOwner (&pGVar3->_playerManager,0x187,(RNG **)&pGVar3->_playerManager,1), pEVar6 != (Entity_Player *)0x0)) && (EVar12 = (EntityPtr)param_5->_entity, EVar12 != (EntityPtr)0x0)) { do { if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)EVar12 + 0x28) == 1)) || (*(int *)((int)EVar12 + 0x28) - 10U < 0x3de)) { if ((EVar12 != (EntityPtr)0x0) && (EVar12 != (EntityPtr)this)) { pEVar10 = Entity::GetStatusEffectTarget((Entity *)EVar12); pEVar7 = Entity::GetStatusEffectTarget((Entity *)this); if (((pEVar10 != pEVar7) && ((0 < g_game->_frameCount - *(int *)((int)EVar12 + 0x328) && (bVar5 = Entity::IsVulnerableEnemy((Entity *)EVar12,(Entity *)0x0), bVar5 != 0)))) && ((this->_forcedTarget == (EntityPtr)0x0 || ((this->_forcedTarget == EVar12 || (uVar8 = Random(), (uVar8 & 3) == 0)))))) { EVar1 = this->_forcedTarget; bVar5 = TryForceTarget(this,(Entity *)EVar12,0x96); if ((bVar5 != 0) && ((EVar1 != EVar12 && (this->_pendingDamage < this->_health)))) { uVar8 = Random(); pEVar10 = Game::SpawnEx(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,2, uVar8,0); iVar15 = __RTDynamicCast(pEVar10,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar15 + 0xdc) = 0; *(undefined4 *)(iVar15 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar15 + 0x358) = 0x3f800000; } } } break; } EVar12 = *(EntityPtr *)((int)EVar12 + 0x3bc); } while (EVar12 != (EntityPtr)0x0); } pEVar6 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1b2,(RNG **)&g_game->_playerManager,1); if (pEVar6 != (Entity_Player *)0x0) { iVar15 = param_5->_type; if ((iVar15 == 1) || ((((param_5->_spawnerType == 1 && ((iVar15 != 3 || (param_5->_variant != 0x2b)))) || ((param_3 & 0x8010) != 0)) || (iVar15 == 1000)))) { *(uint *)&this->_flags = (uint)this->_flags | 0x10000000; } else { *(uint *)&this->_flags = (uint)this->_flags & 0xefffffff; } *(undefined4 *)((int)&this->_flags + 4) = *(undefined4 *)((int)&this->_flags + 4); } if (((((this->_championColorIdx == 0x15) && (this->_dead == 0)) && (this->_pendingDamage < this->_health)) && ((this->_championTimer < 1 && ((param_3 & 0x10) == 0)))) && ((param_5->_type == 1 || ((param_5->_spawnerType == 1 && ((param_5->_type != 3 || (param_5->_variant != 0x2b)))))))) { iVar15 = *(int *)((int)g_game->_room + 0x1264); if (iVar15 != 0) { piVar18 = *(int **)((int)g_game->_room + 0x125c); iVar14 = 0; do { iVar2 = *piVar18; piVar18 = piVar18 + 1; iVar13 = iVar14 + 1; if (*(Entity_NPC **)(iVar2 + 0x3c8) != this) { iVar13 = iVar14; } iVar15 = iVar15 + -1; iVar14 = iVar13; } while (iVar15 != 0); if (4 < iVar13) goto LAB_006d6455; } uVar8 = Random(); pVVar9 = MusicManager::RandomVector(&local_10); local_18.x = this->_size * pVVar9->x + (this->_pos).x; local_18.y = pVVar9->y * this->_size + (this->_pos).y; pEVar10 = Game::SpawnEx(g_game,0x12,0,&local_18,&g_vectorZero,(Entity *)this,0,uVar8,0); piVar11 = (int *)__RTDynamicCast(pEVar10,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); *(undefined1 *)(piVar11 + 0x5d) = 1; piVar18 = piVar11 + 0xf2; if (piVar11[0xf2] != 0) { piStack_1c = piVar18; std::multiset::erase(&piStack_1c); } *piVar18 = (int)this; std::multiset::insert(piVar18); (**(code **)(*piVar11 + 0xc))(); this->_championTimer = 0x3c; } LAB_006d6455: if (bVar4 != 0) { if (((this->_flags & 1) == 0) && ((param_3 & 0x4000) != 0)) { EVar12 = (EntityPtr)param_5->_entity; if ((EVar12 == (EntityPtr)0x0) || ((((Entity_Player *)EVar12)->_type != 1 && ((EVar12 = ((Entity_Player *)EVar12)->_spawnerEntity, EVar12 == (EntityPtr)0x0 || (*(int *)((int)EVar12 + 0x28) != 1)))))) { EVar12 = (EntityPtr)Game::GetNearestPlayer(g_game,&this->_pos); } local_18.x = ((Vector *)((int)EVar12 + 0x33c))->x; local_18.y = *(float *)((int)EVar12 + 0x340); Entity_Player::AddBlueFlies((Entity_Player *)EVar12,1,&local_18,(Entity *)this); } if ((this->_flags & 1) == 0) { EVar12 = (EntityPtr)param_5->_entity; if ((EVar12 == (EntityPtr)0x0) || ((*(int *)((int)EVar12 + 0x28) != 1 && ((EVar12 = *(EntityPtr *)((int)EVar12 + 0x3c8), EVar12 == (EntityPtr)0x0 || (*(int *)((int)EVar12 + 0x28) != 1)))))) { EVar12 = (EntityPtr)Game::GetNearestPlayer(g_game,&this->_pos); } piStack_1c = (int *)((this->_pos).x - ((Vector *)((int)EVar12 + 0x33c))->x); fVar17 = (this->_pos).y - *(float *)((int)EVar12 + 0x340); local_18.x = (float)piStack_1c; local_18.y = fVar17; fVar16 = sqrtf((float)piStack_1c * (float)piStack_1c + fVar17 * fVar17); piVar18 = piStack_1c; if (0.0 < fVar16) { fVar17 = fVar17 * (1.0 / fVar16); piVar18 = (int *)((float)piStack_1c * (1.0 / fVar16)); local_18.x = (float)piVar18; local_18.y = fVar17; } local_10.x = (this->_pos).x - (float)piVar18 * this->_size; local_10.y = (this->_pos).y - fVar17 * this->_size; trigger_set_dispatch ((PlayerProceduralItems *)((int)EVar12 + 0x1fc8),2,(Entity *)this,&local_10, &local_18); return bVar4; } } return bVar4; } //@@ 006d6610 Entity_NPC::SetScale /* ZHL [exact] __thiscall void Entity_NPC::SetScale(float scale); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_NPC::SetScale(Entity_NPC *this,float scale) { float fVar1; float fVar2; this->_scale = scale; fVar2 = scale * this->_shrinkStatus1; fVar1 = fVar2 * g_vectorOne.x; (this->_sprite)._scale.y = fVar2 * g_vectorOne.y; (this->_sprite)._scale.x = fVar1; return; } //@@ 006d6650 FUN_006d6650 void FUN_006d6650(void) { int in_ECX; float fVar1; float fVar2; fVar2 = *(float *)(in_ECX + 0xc38) * *(float *)(in_ECX + 0x3b4); fVar1 = fVar2 * g_vectorOne.x; *(float *)(in_ECX + 0xe8) = fVar2 * g_vectorOne.y; *(float *)(in_ECX + 0xe4) = fVar1; return; } //@@ 006d6690 NpcAI::ENTITY_MOVABLE_TNT /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* NPC AI for entity type 292 (from dispatcher 006c2990) */ void __fastcall NpcAI::ENTITY_MOVABLE_TNT(Entity_NPC *npc) { code *pcVar1; int initialState; uint rngResult; Vector *clampedHealth; ColorMod *color; float fVar2; uint subType; byte *anim; Vector scratchVec; Vector scratchVec2; Color particleColor; uint local_c; int *availableTrinkets; qword flags; Game *game; void *trinketPool; local_c = __security_cookie ^ (uint)&scratchVec; if (npc->_state == 0) { flags = npc->_flags; fVar2 = npc->_health; *(undefined4 *)((int)&npc->_flags + 4) = *(undefined4 *)((int)&npc->_flags + 4); initialState = 0x10; *(uint *)&npc->_flags = (uint)flags & 0xfffffffb | 0x20d0011; if (1.0 < fVar2) { initialState = 3; } npc->_state = initialState; if (npc->_minecart == (EntityPtr)0x0) { npc->_renderZOffset = 100; return; } return; } if (0.0 < npc->_pendingDamage) { scratchVec2.x = 1.0; rngResult = Random(); if (rngResult % 3 == 0) { fVar2 = 2.0; } else { fVar2 = scratchVec2.x; } if ((npc->_pendingDamageFlags & 4) == 0) { if (0.0 < fVar2) goto LAB_006d677a; } else { fVar2 = 4.0; LAB_006d677a: scratchVec2.x = npc->_health - fVar2; scratchVec.x = 1.0; clampedHealth = &scratchVec2; if (scratchVec2.x <= 1.0) { clampedHealth = &scratchVec; } npc->_health = clampedHealth->x; } (npc->_damageEvents)._end = (npc->_damageEvents)._begin; npc->_pendingDamage = 0.0; *(undefined4 *)&npc->_pendingDamageFlags = 0; *(undefined4 *)((int)&npc->_pendingDamageFlags + 4) = 0; } if ((npc->_dead != 0) || (npc->_health <= 1.0)) { if (npc->_state != 0x10) { rngResult = Random(); scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; Game::SpawnEx(g_game,1000,1,&scratchVec,&g_vectorZero,(Entity *)npc,0,rngResult,0); scratchVec2.x = (npc->_pos).x; scratchVec2.y = (npc->_pos).y; Game::spawn_bomb_crater(g_game,&scratchVec2,(Entity *)npc,1.0); scratchVec.x = (npc->_pos).x; scratchVec.y = (npc->_pos).y; Game::BombDamage(g_game,&scratchVec,100.0,75.0,0,(Entity *)npc,g_tearFlagsNone,0x1004,0); Color::Color(&particleColor); rngResult = Random(); scratchVec.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; rngResult = Random(); scratchVec2.y = (npc->_pos).y; scratchVec2.x = (npc->_pos).x; Game::SpawnParticles(g_game,&scratchVec2,0x1b,rngResult % 3 + 2,scratchVec.x,color,100000.0,0) ; Isaac::GetRandomPickupVelocity(&scratchVec,&npc->_pos,1,(RNG *)0x0); rngResult = (npc->_dropRNG)._seed; if (rngResult == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); rngResult = (npc->_dropRNG)._seed; if (rngResult == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } rngResult = rngResult >> ((byte)(npc->_dropRNG)._shift1 & 0x1f) ^ rngResult; rngResult = rngResult << ((byte)(npc->_dropRNG)._shift2 & 0x1f) ^ rngResult; rngResult = rngResult >> ((byte)(npc->_dropRNG)._shift3 & 0x1f) ^ rngResult; (npc->_dropRNG)._seed = rngResult; if (rngResult % 100 == 0) { rngResult = RNG::RandomInt(&npc->_dropRNG,2); game = g_game; if ((((rngResult == 0) && (trinketPool = (g_game->_itemPool)._trinketPoolItems._begin, 400 < (int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)trinketPool & 0xfffffff8U))) && (*(char *)((int)trinketPool + 0x194) != '\0')) && (*(char *)((int)trinketPool + 0x195) != '\0')) { *(undefined1 *)((int)trinketPool + 0x194) = 0; availableTrinkets = &(game->_itemPool)._numAvailableTrinkets; *availableTrinkets = *availableTrinkets + -1; Isaac::GetRandomPickupVelocity(&scratchVec,&npc->_pos,1,(RNG *)0x0); rngResult = Random(); subType = 0x32; } else { trinketPool = (g_game->_itemPool)._trinketPoolItems._begin; if ((((int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)trinketPool & 0xfffffff8U) < 0x149) || (*(char *)((int)trinketPool + 0x14c) == '\0')) || (*(char *)((int)trinketPool + 0x14d) == '\0')) goto LAB_006d6a94; *(undefined1 *)((int)trinketPool + 0x14c) = 0; availableTrinkets = &(game->_itemPool)._numAvailableTrinkets; *availableTrinkets = *availableTrinkets + -1; Isaac::GetRandomPickupVelocity(&scratchVec,&npc->_pos,1,(RNG *)0x0); rngResult = Random(); subType = 0x29; } Game::SpawnEx(g_game,5,0x15e,&npc->_pos,&scratchVec,(Entity *)0x0,subType,rngResult,0); } } LAB_006d6a94: if (npc->_minecart == (EntityPtr)0x0) { npc->_dead = 0; npc->_state = 0x10; npc->_health = 0.5; } else { (**(code **)(*(int *)npc + 0x28))(); } } if (npc->_state != 3) { if (npc->_state == 0x10) { npc->_entityCollisionClass = 0; ANM2::Play(&npc->_sprite,(byte *)"Blown",0); npc->_friction = npc->_friction * 0.3; return; } return; } fVar2 = npc->_health; if (fVar2 <= 3.0) { if (2.0 < fVar2) { anim = (byte *)"IdleMedium"; } else { if (fVar2 <= 1.0) goto LAB_006d6b14; anim = (byte *)"ReadyToExplode"; } } else { anim = s_Idle; } ANM2::Play(&npc->_sprite,anim,0); LAB_006d6b14: npc->_friction = npc->_friction * 0.8; if (npc->_i1 < -3) { return; } npc->_i1 = npc->_i1 + -1; return; } //@@ 006d6ba0 Entity_NPC::PlaySound /* ZHL [exact] __thiscall void Entity_NPC::PlaySound(int id, float volume, int framedelay, bool loop, float pitch); prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall Entity_NPC::PlaySound(Entity_NPC *this,int id,float volume,int framedelay,byte loop,float pitch) { Manager *pMVar1; undefined3 in_stack_00000011; pMVar1 = g_manager; if (this->_championColorIdx == 0x12) { pitch = pitch + 0.5; } else if (this->_championColorIdx == 0x13) { pitch = pitch * 0.5; } seed_fart_sound_override(&id); SoundEffects::Play(&pMVar1->_sfxManager,id,volume,framedelay,(byte)_loop,pitch,0.0); return; } //@@ 006d6c20 Entity_NPC::GetAliveEnemyCount /* ZHL [lua] Lua binding EntityNPC:GetAliveEnemyCount prototype: db/protos.zhl, confirmed by RET 0 */ int __thiscall Entity_NPC::GetAliveEnemyCount(Entity_NPC *this) { uint uVar1; int iVar2; int iVar3; uint uVar4; int iVar5; bool bVar6; if ((this->_flags & 0x20000000) == 0) { iVar3 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar5 = 0; if (0 < iVar3) { iVar5 = iVar3; } return iVar5; } iVar5 = 0; uVar4 = 0; uVar1 = *(uint *)((int)g_game->_room + 0x1264); if (uVar1 != 0) { do { iVar3 = *(int *)(*(int *)((int)g_game->_room + 0x125c) + uVar4 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)(iVar3 + 0x28) != 1)) { iVar2 = *(int *)(iVar3 + 0x28); if ((iVar2 - 10U < 0x3de) && (((iVar2 != 0x21 && (iVar2 != 0x11)) && (iVar2 != 0x124)))) { if (iVar2 == 0x375) { bVar6 = *(int *)(iVar3 + 0x2c) == 10; } else { if ((iVar2 == 0x3c0) || (iVar2 == 0x3c5)) goto LAB_006d6cda; bVar6 = iVar2 == 0xf5; } if (!bVar6) goto LAB_006d6cc0; } } else { LAB_006d6cc0: if ((*(char *)(iVar3 + 0x173) == '\0') && ((*(uint *)(iVar3 + 0x168) & 0x20000000) != 0)) { iVar5 = iVar5 + 1; } } LAB_006d6cda: uVar4 = uVar4 + 1; } while (uVar4 < uVar1); } return iVar5; } //@@ 006d6d20 Entity_NPC::on_player_damaged /* DB: called by Entity_Player::TakeDamage (ECX = each IsEnemy entity) when a player is hurt: types 0x24 Gurdy / 0x54 Satan set V1.x = 1; 951.102-104 (background Pestilence/War/Death) in state 3 get state 8 and StateFrame = Random()%15 + 2, which NpcAI::ENTITY_BEAST_background turns into "Cheer" (notes/entities/beast_fight.md) */ uint __thiscall Entity_NPC::on_player_damaged(Entity_NPC *this) { uint uVar1; uVar1 = this->_type; if ((uVar1 == 0x24) || (uVar1 == 0x54)) { (this->_v1).x = 1.0; } else if (((uVar1 == 0x3b7) && (uVar1 = this->_variant - 0x66, uVar1 < 3)) && (this->_state == 3)) { this->_state = 8; uVar1 = Random(); this->_stateFrame = uVar1 % 0xf + 2; return uVar1 / 0xf; } return uVar1; } //@@ 006d6d80 Entity_NPC::room_enter /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=Entity_NPC persisting across rooms: PlayerManager::enter_level calls it for non-familiar persistent entities (Entity_Familiar::room_enter for familiars); for ENTITY_DARK_ESAU 866 / ENTITY_MOTHERS_SHADOW 867 shifts _pos by the room grid delta (520x280 per room), Dark Esau spawns effect 1000.15 unless its Jacob (player type 37/39) has Birthright (619); sets +0x214=20 when flags 0x10000020 */ void __thiscall Entity_NPC::room_enter(Entity_NPC *this) { Vector *position; int iVar1; EntityPtr this_00; code *pcVar2; byte bVar3; RoomDescriptor *pRVar4; int iVar5; uint uVar6; undefined4 extraout_EAX; code *extraout_EDX; int iVar7; bool bVar8; Color local_44; undefined8 local_14; float local_8; local_8 = (float)(__security_cookie ^ (uint)((&local_44)[1]._colorize + 1)); if (this->_type == 0x362) { bVar8 = this->_variant == 0; } else { bVar8 = this->_type == 0x363; } if ((bVar8) && (1 < g_game->_frameCount - this->_spawnFrame)) { pRVar4 = Level::GetRoomByIdx((Level *)g_game,g_game->_lastRoomIdx,g_game->_lastRoomDimensionIdx) ; iVar7 = pRVar4->GridIndex; pRVar4 = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); iVar1 = pRVar4->GridIndex; if ((iVar7 < 0) || (iVar1 < 0)) { uVar6 = g_game->_enterDoor; if ((int)uVar6 < 0) { pRVar4 = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); local_14 = 0xb00000001; uVar6 = pRVar4->DecorationSeed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 1 ^ uVar6; uVar6 = uVar6 << 0xb ^ uVar6; uVar6 = (uVar6 >> 0x10 ^ uVar6) & 3; } iVar7 = 0; iVar5 = 0; uVar6 = uVar6 & 0x80000003; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffc) + 1; } switch(uVar6) { case 0: iVar5 = -1; break; case 1: iVar7 = -1; break; case 2: iVar5 = 1; break; case 3: iVar7 = 1; } } else { iVar5 = ((iVar1 / 0xd - iVar7 / 0xd) * 0xd - iVar1) + iVar7; iVar7 = iVar7 / 0xd - iVar1 / 0xd; } iVar1 = this->_type; position = &this->_pos; position->x = (float)iVar5 * 520.0 + position->x; (this->_pos).y = (float)iVar7 * 280.0 + (this->_pos).y; if (((((iVar1 == 0x362) && (this->_variant == 0)) && (this->_subtype == 1)) && ((this->_parent != (EntityPtr)0x0 && (*(int *)((int)this->_parent + 0x28) == 0x362)))) && (((this_00 = this->_spawnerEntity, this_00 != (EntityPtr)0x0 && (*(int *)((int)this_00 + 0x28) == 1)) && (((*(int *)((int)this_00 + 0x13c0) == 0x25 || (*(int *)((int)this_00 + 0x13c0) == 0x27)) && (bVar3 = Entity_Player::HasCollectible((Entity_Player *)this_00,0x26b,0), bVar3 == 0)))))) { (**(code **)(*(int *)this + 0x28))(); uVar6 = Random(); Game::Spawn(g_game,1000,0xf,position,&g_vectorZero,(Entity *)this,0,uVar6); Color::Color(&local_44); (*extraout_EDX)(extraout_EAX,0xffffffff,0xff,0,1); } } if ((this->_flags & 0x1000002000000000) != 0) { this->_damageCountdown = 0x14; } return; } //@@ 006d7010 Entity_NPC::spawn_damage_numbers /* DB: ? ECX=Entity_NPC each Update (twice from Entity_NPC::Update before update_damage_history): when some player has Spider Mod (403) or type is 0x3c4, and the NPC is visible, alive, not invincible, spawns entity 9001.1 per pending damage record (+0x8..+0xc, 0x38 stride) above the NPC with upward velocity, parented to it */ void __thiscall Entity_NPC::spawn_damage_numbers(Entity_NPC *this) { float fVar1; byte bVar2; Entity_Player *pEVar3; Entity_NPC *pEVar4; uint seed; uint uVar5; Entity *pEVar6; float *pfVar7; float fVar8; double dVar9; Vector local_50; Vector local_48 [8]; if (this->_type != 0x3c4) { pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x193,(RNG **)&g_game->_playerManager,1); if (pEVar3 == (Entity_Player *)0x0) { return; } bVar2 = Entity::IsActiveEnemy((Entity *)this,0); if (bVar2 == 0) { return; } } if ((((this->_visible != 0) && (fVar8 = 0.0, 0.0 < (this->_sprite)._color._tint[3])) && (0.0 < this->_health)) && (((pEVar4 = (Entity_NPC *)Entity::GetStatusEffectTarget((Entity *)this), pEVar4 == this && (this->_isInvicible == 0)) && (pfVar7 = (this->_damageEvents)._begin, pfVar7 != (this->_damageEvents)._end)))) { do { if (fVar8 < *pfVar7) { seed = Random(); local_50.x = 0.0; uVar5 = Random(); fVar8 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; local_50.y = -3.0 - (fVar8 + fVar8); local_48[0].x = (this->_pos).x - 0.0; local_48[0].y = (this->_pos).y - 20.0; pEVar6 = Game::SpawnEx(g_game,0x2329,1,local_48,&local_50,(Entity *)0x0,0,seed,0); dVar9 = floor((double)(*pfVar7 * 10.0 + 0.5)); fVar8 = 9999.0; if ((float)dVar9 / 10.0 <= 9999.0) { fVar8 = (float)dVar9 / 10.0; } if (fVar8 <= 0.0) { fVar8 = 0.1; } fVar1 = this->_maxHitPoints; (pEVar6->_targetPosition).x = fVar8; (pEVar6->_targetPosition).y = fVar1; if (pEVar6->_parent != (EntityPtr)0x0) { std::multiset::erase(); } pEVar6->_parent = (EntityPtr)this; std::multiset::insert(); (**(code **)(*(int *)pEVar6 + 0xc))(); fVar8 = 0.0; } pfVar7 = pfVar7 + 0xe; } while (pfVar7 != (this->_damageEvents)._end); } return; } //@@ 006d7230 Entity_NPC::update_damage_history /* DB: ? called at the end of Entity_NPC::Update (both paths) after 006d7010; sums this frame hit-list entries (+0x8..0xc, 0x38 bytes each, skipping flag 0x2000) into a ring buffer at +0xc4c..0xc58, clears the list, spawns effect 1000/0x36 when flags bit 47 set */ void __thiscall Entity_NPC::update_damage_history(Entity_NPC *this) { byte isSharingStatus; uint ringIdx; void *pvVar2; int iVar3; int eventsBytes; uint historyIdx; float *damageEvent; float fVar4; float damageMult; float fVar5; Entity_NPC *statusOwner; uint local_20; float frameDamage; uint local_14 [4]; EntityPtr ancestor; EntityPtr nextParent; uint ringIdx; isSharingStatus = Entity::DoesEntityShareStatus((Entity *)this); statusOwner = this; if (isSharingStatus != 0) { nextParent = this->_parent; statusOwner = this; while (ancestor = nextParent, ancestor != (EntityPtr)0x0) { statusOwner = (Entity_NPC *)ancestor; nextParent = *(EntityPtr *)((int)ancestor + 0x3bc); } } if ((statusOwner == (Entity_NPC *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (statusOwner->_type != 1)) && (0x3dd < statusOwner->_type - 10U)))) { statusOwner = this; } fVar4 = 0.0; if (0.0 < statusOwner->_shieldStrength) { damageEvent = (this->_damageEvents)._begin; frameDamage = 0.0; iVar3 = ((int)(this->_damageEvents)._end - (int)damageEvent) / 0x38; if (iVar3 != 0) { do { if (((uint)damageEvent[2] & 0x2000) == 0) { fVar4 = fVar4 + *damageEvent; } damageEvent = damageEvent + 0xe; iVar3 = iVar3 + -1; } while (iVar3 != 0); frameDamage = fVar4; } if ((uint)statusOwner->_shieldFrames <= *(uint *)&statusOwner->field_0xc58) { std::deque<4byte>::erase (local_14,*(undefined4 *)&statusOwner->field_0xc48,0, *(int *)&statusOwner->field_0xc54,*(undefined4 *)&statusOwner->field_0xc48,0, *(int *)&statusOwner->field_0xc54 + 1); } local_20 = *(uint *)&statusOwner->field_0xc58; ringIdx = *(uint *)&statusOwner->field_0xc54; if (((local_20 + ringIdx & 3) == 0) && (*(uint *)&statusOwner->field_0xc50 <= local_20 + 4 >> 2)) { std::deque<4byte>::_Growmap(local_20); local_20 = *(uint *)&statusOwner->field_0xc58; ringIdx = *(uint *)&statusOwner->field_0xc54; } ringIdx = *(int *)&statusOwner->field_0xc50 * 4 - 1U & ringIdx; local_14[0] = local_20 + ringIdx; *(uint *)&statusOwner->field_0xc54 = ringIdx; ringIdx = *(int *)&statusOwner->field_0xc50 - 1U & local_14[0] >> 2; iVar3 = *(int *)&statusOwner->field_0xc4c; if (*(int *)(iVar3 + ringIdx * 4) == 0) { pvVar2 = operator_new(0x10); *(void **)(*(int *)&statusOwner->field_0xc4c + ringIdx * 4) = pvVar2; iVar3 = *(int *)&statusOwner->field_0xc4c; } fVar4 = 0.0; *(float *)(*(int *)(iVar3 + ringIdx * 4) + (local_14[0] & 3) * 4) = frameDamage; *(int *)&statusOwner->field_0xc58 = *(int *)&statusOwner->field_0xc58 + 1; ringIdx = *(uint *)&statusOwner->field_0xc58; if (ringIdx != 0) { iVar3 = *(int *)&statusOwner->field_0xc54; historyIdx = 0; do { ringIdx = iVar3 + historyIdx; historyIdx = historyIdx + 1; fVar4 = fVar4 + *(float *)(*(int *)(*(int *)&statusOwner->field_0xc4c + (ringIdx >> 2 & *(int *)&statusOwner->field_0xc50 - 1U) * 4) + (ringIdx & 3) * 4); iVar3 = *(int *)&statusOwner->field_0xc54; } while (historyIdx < ringIdx); } fVar5 = this->_maxHitPoints / statusOwner->_shieldStrength; damageMult = 1.0; fVar4 = (fVar4 / (float)((double)(int)ringIdx + __uint_to_double_fixup[-((int)ringIdx >> 0x1f)])) * 30.0; if (fVar5 < fVar4) { fVar5 = fVar5 / fVar4; damageMult = 0.09 - fVar5 * 0.18; if (damageMult <= 0.0) { damageMult = 0.0; } damageMult = damageMult + fVar5; } this->_pendingDamage = 0.0; pvVar2 = (this->_damageEvents)._begin; local_20 = 0; eventsBytes = (int)(this->_damageEvents)._end - (int)pvVar2; iVar3 = eventsBytes >> 0x1f; if (eventsBytes / 0x38 + iVar3 != iVar3) { iVar3 = 0; do { fVar4 = *(float *)(iVar3 + (int)pvVar2); if ((*(uint *)(iVar3 + 8 + (int)pvVar2) & 0x40002000) == 0) { fVar4 = fVar4 * damageMult; *(float *)(iVar3 + (int)pvVar2) = fVar4; } local_20 = local_20 + 1; iVar3 = iVar3 + 0x38; this->_pendingDamage = fVar4 + this->_pendingDamage; pvVar2 = (this->_damageEvents)._begin; } while (local_20 < (uint)(((int)(this->_damageEvents)._end - (int)pvVar2) / 0x38)); } } return; } //@@ 006d7520 Entity_NPC::update_blood_guide_gibs /* DB: ? called from Entity_NPC::Update with Sprite::GetNullFrame("BloodGuide"); for 912.10 (Mother phase 2) or entity-config flag bit 13: spawn_blood_explosion at null frame, BloodStart/BloodStop events, PlayerManager::GetGFuelCount promo effect 1000.17 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::update_blood_guide_gibs(Entity_NPC *bloodEffect,float *nullFrame) { void **ppvVar1; byte bVar2; int iVar3; Vector *randomDir; uint rngResult; Entity *spawned; Entity_Effect *bloodEffect; AnimationState *animState; float fVar4; float fVar5; double pitchRandom; float fVar6; float randomFraction; undefined4 uVar7; int framedelay; TypeDescriptor *pTVar8; TypeDescriptor *pTVar9; undefined4 uVar10; Vector local_30; Vector gibPos; int *local_20; undefined1 *local_1c; undefined1 *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; float nullPosX; float nullPosY; float nullScaleX; void *room; code *setColorFn; int *tmpEntity; local_8 = 0xffffffff; puStack_c = &LAB_00afac9d; local_10 = ExceptionList; ppvVar1 = &local_10; if (nullFrame == (float *)0x0) { if ((bloodEffect->_sprite)._animState._animData == (void *)0x0) { return; } ExceptionList = &local_10; nullFrame = AnimationState::GetNullFrame(&(bloodEffect->_sprite)._animState,(byte *)"BloodGuide"); ppvVar1 = ExceptionList; if (nullFrame == (float *)0x0) { ExceptionList = local_10; return; } } ExceptionList = ppvVar1; animState = &(bloodEffect->_sprite)._animState; if ((bloodEffect->_sprite)._animState._animData == (void *)0x0) goto LAB_006d7c3e; bVar2 = AnimationState::WasEventTriggered(animState,(byte *)"BloodStart"); if ((bVar2 != 0) && (((bloodEffect->_sprite)._animState._animData == (void *)0x0 || ((bVar2 = AnimationState::WasEventTriggered(animState,(byte *)"BloodStop"), bVar2 == 0 && (((bloodEffect->_sprite)._animState._animData == (void *)0x0 || (bVar2 = AnimationState::WasEventTriggered(animState,(byte *)"Explosion"), bVar2 == 0))))))) ) { if (((bloodEffect->_type == 0x390) && (bloodEffect->_variant == 10)) || ((*(uint *)((int)bloodEffect->_config + 0x60) >> 0xd & 1) != 0)) { iVar3 = Entity::GetIntervalTicks((Entity *)bloodEffect,3.0,0.0); if (iVar3 != 0) { Game::ShakeScreen(g_game,5); } iVar3 = Entity::GetIntervalTicks((Entity *)bloodEffect,10.0,0.0); if (iVar3 != 0) { randomDir = MusicManager::RandomVector(&local_30); rngResult = Random(); local_20 = (int *)0x47; fVar6 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; local_30.y = (fVar6 * randomDir->y * nullFrame[5] * 4.0 + nullFrame[1]) / 0.65; local_30.x = (fVar6 * randomDir->x * nullFrame[4] * 4.0 + *nullFrame) / 0.65; local_1c = (undefined1 *)local_30.x; local_18 = (undefined1 *)local_30.y; rngResult = Random(); gibPos.x = (float)local_1c + (bloodEffect->_pos).x; gibPos.y = (float)local_18 + (bloodEffect->_pos).y; spawn_gibs(&gibPos,(rngResult & 3) + 6,60.0,(uint *)&local_20,(Entity *)bloodEffect, &bloodEffect->_splatColor,&g_vectorZero,1.0); rngResult = Random(); spawn_blood_explosion ((rngResult & 1) + 3,&bloodEffect->_pos,&local_30,&bloodEffect->_splatColor,&g_vectorZero); fVar6 = 1.0; bVar2 = 0; framedelay = 2; rngResult = Random(); pitchRandom = (double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]; iVar3 = 0x8d; LAB_006d7a90: PlaySound(bloodEffect,iVar3,(float)pitchRandom * 2.3283064e-10 * 0.2 + 0.5,framedelay,bVar2,fVar6); } } else { rngResult = Random(); if ((rngResult & 1) == 0) { iVar3 = PlayerManager::GetGFuelCount(); if (iVar3 < 1) { rngResult = Random(); uVar10 = 0; pTVar9 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar7 = 0; spawned = Game::Spawn(g_game,1000,0x11,&bloodEffect->_pos,&g_vectorZero,(Entity *)bloodEffect,0, rngResult); local_20 = (int *)__RTDynamicCast(spawned,uVar7,pTVar8,pTVar9,uVar10); randomDir = MusicManager::RandomVector(&local_30); rngResult = Random(); tmpEntity = local_20; randomFraction = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; fVar6 = randomDir->y; fVar4 = randomDir->x; fVar5 = nullFrame[5]; nullScaleX = nullFrame[4]; nullPosY = nullFrame[1]; nullPosX = *nullFrame; local_20[0xd6] = 0x42480000; local_20[0x38] = (int)(randomFraction * fVar6 * fVar5 * 4.0 + nullPosY); local_20[0x37] = (int)(randomFraction * fVar4 * nullScaleX * 4.0 + nullPosX); rngResult = Random(); tmpEntity[0x3b] = (int)(((float)(rngResult & 3) + 0.0) * 90.0); rngResult = Random(); local_18 = &DAT_bf800000; local_1c = local_18; if ((rngResult & 1) == 0) { local_1c = (undefined1 *)0x3f800000; } rngResult = Random(); if ((rngResult & 1) == 0) { local_18 = (undefined1 *)0x3f800000; } rngResult = Random(); setColorFn = *(code **)(*tmpEntity + 0x3c); fVar6 = 1.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.4; tmpEntity[0x3a] = (int)(fVar6 * (float)local_1c); tmpEntity[0x39] = (int)(fVar6 * (float)local_18); (*setColorFn)(&bloodEffect->_splatColor,0xffffffff,0xff,0,1); fVar6 = 1.0; bVar2 = 0; framedelay = 2; rngResult = Random(); pitchRandom = (double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]; iVar3 = 0x48; goto LAB_006d7a90; } local_20 = (int *)spawn_gfuel_explosion(); randomDir = MusicManager::RandomVector(&local_30); rngResult = Random(); tmpEntity = local_20; randomFraction = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; fVar6 = randomDir->y; fVar4 = randomDir->x; fVar5 = nullFrame[5]; nullScaleX = nullFrame[4]; nullPosY = nullFrame[1]; nullPosX = *nullFrame; local_20[0xd6] = 0x42480000; local_20[0x38] = (int)(randomFraction * fVar6 * fVar5 * 4.0 + nullPosY); local_20[0x37] = (int)(randomFraction * fVar4 * nullScaleX * 4.0 + nullPosX); rngResult = Random(); if ((rngResult & 1) == 0) { local_18 = (undefined1 *)0x3f800000; } else { local_18 = &DAT_bf800000; } rngResult = Random(); fVar6 = 1.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.4; tmpEntity[0x3a] = (int)fVar6; tmpEntity[0x39] = (int)(fVar6 * (float)local_18); } } } if ((((bloodEffect->_sprite)._animState._animData != (void *)0x0) && (bVar2 = AnimationState::IsEventTriggered(&(bloodEffect->_sprite)._animState,(byte *)"BloodStart"), bVar2 != 0)) && (bloodEffect->_type == 0x54)) { local_1c = (undefined1 *)0x4; do { rngResult = Random(); uVar10 = 0; pTVar9 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar7 = 0; spawned = Game::Spawn(g_game,1000,0x2a,&bloodEffect->_pos,&g_vectorZero,(Entity *)bloodEffect,0,rngResult); bloodEffect = (Entity_Effect *)__RTDynamicCast(spawned,uVar7,pTVar8,pTVar9,uVar10); Entity_Effect::FollowParent(bloodEffect,(Entity *)bloodEffect); rngResult = Random(); fVar6 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar6 = fVar6 + fVar6; local_18 = (undefined1 *)sin(fVar6); rngResult = Random(); local_20 = (int *)((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10); fVar5 = cos(fVar6); fVar6 = nullFrame[5]; fVar4 = nullFrame[1]; (bloodEffect->_sprite)._offset.x = fVar5 * (float)local_20 * nullFrame[4] * 3.8 + *nullFrame; (bloodEffect->_sprite)._offset.y = (float)local_20 * (float)local_18 * fVar6 * 3.8 + fVar4; rngResult = Random(); if ((rngResult & 1) == 0) { fVar6 = 50.0; } else { fVar6 = -50.0; } bloodEffect->_renderDepthOffset = fVar6; bloodEffect->_timeout = -1; bloodEffect->_lifespan = -1; rngResult = Random(); if ((rngResult & 1) == 0) { (bloodEffect->_sprite)._flipX = 1; } (**(code **)(*(int *)bloodEffect + 0x3c))(&bloodEffect->_splatColor,0xffffffff,0xff,0,1); local_1c = local_1c + -1; } while (local_1c != (undefined1 *)0x0); } LAB_006d7c3e: animState = &(bloodEffect->_sprite)._animState; if (((bloodEffect->_sprite)._animState._animData != (void *)0x0) && ((bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"BloodStop"), bVar2 != 0 || (((bloodEffect->_sprite)._animState._animData != (void *)0x0 && (bVar2 = AnimationState::IsEventTriggered(animState,(byte *)"Explosion"), bVar2 != 0)))))) { room = g_game->_room; iVar3 = *(int *)((int)room + 0x125c); local_30.x = *(float *)((int)room + 0x1260); fVar6 = *(float *)((int)room + 0x1264); fVar4 = 0.0; local_8 = 0; local_30.y = fVar6; if (fVar6 != 0.0) { do { tmpEntity = *(int **)(iVar3 + (int)fVar4 * 4); if (((tmpEntity != (int *)0x0) && (tmpEntity[10] == 1000)) && ((tmpEntity[0xb] == 0x2a && ((Entity_NPC *)tmpEntity[0xef] == bloodEffect)))) { (**(code **)(*tmpEntity + 0x28))(); } fVar4 = (float)((int)fVar4 + 1); } while ((uint)fVar4 < (uint)fVar6); } } ExceptionList = local_10; return; } //@@ 006d7cf0 spawn_blood_explosion /* DB: Game::Spawn(1000,2=EFFECT BLOOD_EXPLOSION, pos, vel, spawner) then vtable+0x3c SetColor(color,-1,255,false,true) and sets scale prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl spawn_blood_explosion (int subType,Vector *position,Vector *spriteOffset,ColorMod *color,Vector *velocity) { uint seed; Entity *pEVar1; seed = Random(); pEVar1 = Game::Spawn(g_game,1000,2,position,velocity,(Entity *)0x0,subType,seed); (**(code **)(*(int *)pEVar1 + 0x3c))(color,0xffffffff,0xff,0,1); (pEVar1->_sprite)._offset.x = spriteOffset->x; (pEVar1->_sprite)._offset.y = spriteOffset->y; pEVar1->_renderDepthOffset = 10.0; return pEVar1; } //@@ 006d7d60 Entity::IsHostileTo /* DB: ?compares FLAG_CHARM 0x100/FLAG_FRIENDLY 0x20000000 vs other's type player/bomb/familiar prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity::IsHostileTo(Entity *this,Entity *other) { int iVar1; qword qVar2; byte bVar3; qVar2 = this->_flags; if ((qVar2 & 0x100) == 0) { if ((qVar2 & 0x20000000) == 0) { bVar3 = 1; goto LAB_006d7da5; } } else if ((qVar2 & 0x20000000) == 0) { return 1; } bVar3 = 0; LAB_006d7da5: iVar1 = other->_type; if ((((iVar1 == 1) || (iVar1 == 4)) || ((iVar1 == 3 && ((other->_flags & 0x100) == 0)))) || ((other->_flags & 0x20000000) != 0)) { return bVar3; } return bVar3 ^ 1; } //@@ 006d7df0 Entity_NPC::FollowParentSegment /* DB: ? worm segment: follows ParentNPC position history deque 0xc04, pushes own pos (max 64) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::FollowParentSegment (Entity_NPC *this,byte isFollowParent,float segmentDistance,float maxSpeed) { Entity_NPC *parent; uint uVar1; int iVar2; float *historyPoint; uint blockIdx; int slotOffset; uint uVar3; float fVar4; float fVar5; float fVar6; float distSq; float pathLength; float local_8; int *historyProxy; if ((isFollowParent != 0) && (this->_parent != (EntityPtr)0x0)) { parent = ParentNPC(this); pathLength = 0.0; _isFollowParent = (parent->_pos).distSq; local_8 = (parent->_pos).y; uVar3 = (parent->_vectorDeque1)._offset; historyProxy = (parent->_vectorDeque1)._proxy; uVar1 = (parent->_vectorDeque1)._size + uVar3; while (uVar3 != uVar1) { do { if (historyProxy == (int *)0x0) { iVar2 = 0; } else { iVar2 = *historyProxy; } blockIdx = uVar3 >> 1; slotOffset = (uVar3 & 1) * 8; iVar2 = *(int *)(*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & blockIdx) * 4); fVar6 = *(float *)(iVar2 + slotOffset) - _isFollowParent; fVar4 = *(float *)(iVar2 + 4 + slotOffset) - local_8; distSq = fVar4 * fVar4 + fVar6 * fVar6; fVar5 = sqrtf(distSq); fVar5 = fVar5 + pathLength; if (segmentDistance < fVar5) { fVar5 = sqrtf(distSq); if (0.0 < fVar5) { fVar4 = (1.0 / fVar5) * fVar4; fVar6 = fVar6 * (1.0 / fVar5); } _isFollowParent = fVar6 * (segmentDistance - pathLength) + _isFollowParent; local_8 = fVar4 * (segmentDistance - pathLength) + local_8; if (maxSpeed <= 0.0) { (this->_pos).distSq = _isFollowParent; (this->_pos).y = local_8; goto LAB_006d80fc; } local_8 = local_8 - (this->_pos).y; _isFollowParent = _isFollowParent - (this->_pos).distSq; fVar4 = sqrtf(local_8 * local_8 + _isFollowParent * _isFollowParent); if ((maxSpeed < fVar4) && (0.0 < fVar4)) { local_8 = local_8 * (maxSpeed / fVar4); _isFollowParent = _isFollowParent * (maxSpeed / fVar4); } fVar4 = this->_friction; (this->_velocity).distSq = _isFollowParent / fVar4; (this->_velocity).y = local_8 / fVar4; goto LAB_006d811c; } if (historyProxy == (int *)0x0) { iVar2 = 0; } else { iVar2 = *historyProxy; } uVar3 = uVar3 + 1; historyPoint = (float *)(*(int *)(*(int *)(iVar2 + 4) + (*(int *)(iVar2 + 8) - 1U & blockIdx) * 4) + slotOffset); _isFollowParent = *historyPoint; local_8 = historyPoint[1]; pathLength = fVar5; } while (uVar3 != uVar1); fVar5 = (this->_pos).distSq - _isFollowParent; fVar4 = (this->_pos).y - local_8; fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if (segmentDistance < fVar4) goto code_r0x006d7f5a; } } LAB_006d811c: if (((this->_vectorDeque1)._size != 0) && (uVar3 = (this->_vectorDeque1)._offset, uVar1 = uVar3 & 1, iVar2 = *(int *)((int)(this->_vectorDeque1)._map + (uVar3 >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4), fVar4 = (this->_pos).y - *(float *)(iVar2 + 4 + uVar1 * 8), fVar5 = (this->_pos).distSq - *(float *)(iVar2 + uVar1 * 8), fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5), fVar4 <= 3.0)) { return; } std::deque::push_back(&this->_vectorDeque1,&this->_pos); uVar3 = (this->_vectorDeque1)._size; if (0x40 < uVar3) { while( true ) { uVar3 = uVar3 - 1; (this->_vectorDeque1)._size = uVar3; if (uVar3 == 0) break; if (uVar3 < 0x41) { return; } } (this->_vectorDeque1)._offset = 0; } return; code_r0x006d7f5a: if (maxSpeed <= 0.0) { (this->_pos).distSq = _isFollowParent; (this->_pos).y = local_8; LAB_006d80fc: (this->_velocity).distSq = g_vectorZero.distSq; (this->_velocity).y = g_vectorZero.y; } else { local_8 = local_8 - (this->_pos).y; _isFollowParent = _isFollowParent - (this->_pos).distSq; fVar4 = sqrtf(_isFollowParent * _isFollowParent + local_8 * local_8); if ((maxSpeed < fVar4) && (0.0 < fVar4)) { _isFollowParent = _isFollowParent * (maxSpeed / fVar4); local_8 = local_8 * (maxSpeed / fVar4); } fVar4 = this->_friction; (this->_velocity).distSq = _isFollowParent / fVar4; (this->_velocity).y = local_8 / fVar4; } goto LAB_006d811c; } //@@ 006d81c0 Entity_NPC::ClearDequeRefs /* DB: ? clears EntityPtr deque at +0xbf0 prototype: db/protos.zhl */ void __thiscall Entity_NPC::ClearDequeRefs(Entity_NPC *this) { int *piVar1; int *piVar2; int iVar3; uint uVar4; int *local_8; piVar2 = (this->_entityDeque)._proxy; for (uVar4 = (this->_entityDeque)._offset; uVar4 != (this->_entityDeque)._offset + (this->_entityDeque)._size; uVar4 = uVar4 + 1) { if (piVar2 == (int *)0x0) { iVar3 = 0; } else { iVar3 = *piVar2; } piVar1 = (int *)(*(int *)(*(int *)(iVar3 + 4) + (uVar4 >> 2 & *(int *)(iVar3 + 8) - 1U) * 4) + (uVar4 & 3) * 4); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); } *piVar1 = 0; } std::deque::_Tidy(); return; } //@@ 006d8240 Game::IsHardMode /* DB: Game _difficulty 0x269c8 == 1 or 3 prototype: db/protos.zhl */ byte __cdecl Game::IsHardMode(void) { if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { return 1; } return 0; } //@@ 006d8260 Entity_NPC::IsControllerActionPressed /* DB: input_is_action_pressed on _controllerID 0xf1c prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_NPC::IsControllerActionPressed(Entity_NPC *this,int action) { byte bVar1; if (this->_controllerID != -1) { bVar1 = input_is_action_pressed(action,this->_controllerID,(Entity *)this,(int)this); if (bVar1 != 0) { return 1; } } return 0; } //@@ 006d8290 Entity_NPC::IsControllerActionTriggered /* DB: input_is_action_triggered on _controllerID 0xf1c prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_NPC::IsControllerActionTriggered(Entity_NPC *this,int buttonAction) { byte bVar1; if (this->_controllerID != -1) { bVar1 = input_is_action_triggered(g_manager,buttonAction,this->_controllerID,(Entity *)this,0); if (bVar1 != 0) { return 1; } } return 0; } //@@ 006d82d0 Entity_NPC::GetControllerInput /* DB: reads input actions 0-3/4-7 for NPC _controllerID 0xf1c; confusion/mirror-world flip prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity_NPC::GetControllerInput(Entity_NPC *this,Vector *outInput,float deadzone) { int controllerIndex; Game *this_00; Vector *pVVar1; uint uVar2; int unused; int unused_00; int unused_01; int unused_02; int unused_03; int unused_04; void *pvVar3; float fVar4; float fVar5; float local_30; float local_2c; Vector local_28; float local_20; Vector local_1c; undefined1 local_14 [8]; void *local_c; controllerIndex = this->_controllerID; if (controllerIndex != -1) { local_20 = deadzone; if (this->field_0xf2c == '\0') { fVar4 = InputManager::GetActionValue(0,controllerIndex,(Entity *)this,(int)this); local_30 = InputManager::GetActionValue(1,this->_controllerID,(Entity *)this,unused_02); local_30 = local_30 + (0.0 - fVar4); local_1c.x = local_30; fVar4 = InputManager::GetActionValue(2,this->_controllerID,(Entity *)this,unused_03); local_2c = InputManager::GetActionValue(3,this->_controllerID,(Entity *)this,unused_04); local_2c = local_2c + (0.0 - fVar4); } else { fVar4 = InputManager::GetActionValue(4,controllerIndex,(Entity *)this,(int)this); local_30 = InputManager::GetActionValue(5,this->_controllerID,(Entity *)this,unused); local_30 = local_30 + (0.0 - fVar4); local_1c.x = local_30; fVar4 = InputManager::GetActionValue(6,this->_controllerID,(Entity *)this,unused_00); local_2c = InputManager::GetActionValue(7,this->_controllerID,(Entity *)this,unused_01); local_2c = local_2c + (0.0 - fVar4); } this_00 = g_game; local_28.x = 1.68156e-44; fVar4 = local_2c; local_1c.y = local_2c; std::set::find_node(local_14,&local_28); if ((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0xd)) { pvVar3 = (this_00->_seedEffects)._seedEffects; if (local_c != pvVar3) { local_30 = local_30 * -1.0; fVar4 = fVar4 * -1.0; local_2c = fVar4; local_1c.x = local_30; local_1c.y = fVar4; } } else { pvVar3 = (this_00->_seedEffects)._seedEffects; } local_28.x = 1.06499e-43; fVar5 = local_30; std::set::find_node(local_14,&local_28); if (*(char *)((int)local_c + 0xd) == '\0') { if (*(int *)((int)local_c + 0x10) < 0x4d) { if (local_c != pvVar3) { pVVar1 = Vector::ToCardinal(&local_28,&local_1c); fVar5 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); fVar4 = fVar5 * pVVar1->y; fVar5 = fVar5 * pVVar1->x; local_30 = fVar5; local_2c = fVar4; } } } fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if ((local_20 <= 0.0) || (local_20 <= fVar4)) { if (1.0 < fVar4) { local_30 = local_30 / fVar4; local_2c = local_2c / fVar4; } if (((this_00->_currentDimensionIdx == 1) && ((this_00->_stageType == 4 || (this_00->_stageType == 5)))) && ((this_00->_stage == 2 || ((this_00->_stage == 1 && (uVar2 = Level::GetCurses((Level *)this_00), (uVar2 & 2) != 0))) ))) { local_30 = local_30 * -1.0; } outInput->x = local_30; outInput->y = local_2c; return outInput; } } fVar4 = g_vectorZero.y; outInput->x = g_vectorZero.x; outInput->y = fVar4; return outInput; } //@@ 006d85a0 Entity_NPC::GetControllerMovementInput /* DB: reads input actions 0-7 for _controllerID 0xf1c, normalizes, mirror on flipped stage prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity_NPC::GetControllerMovementInput(Entity_NPC *this,Vector *outInput,float deadzone) { byte bVar1; Vector *pVVar2; uint curses; int unused; int unused_00; int unused_01; int unused_02; int unused_03; int unused_04; int unused_05; Game *game; float fVar3; float fVar4; undefined1 local_38 [8]; void *seedNode; undefined1 local_2c [4]; Vector local_28; Vector rawInput; float minMagnitude; undefined4 seedKey; float local_10; float inputX; game = g_game; if (this->_controllerID == -1) goto LAB_006d8891; local_10 = 1.03696e-43; minMagnitude = deadzone; std::set::find_node(local_2c,&local_10); if (((*(char *)((int)local_28.y + 0xd) == '\0') && (*(int *)((int)local_28.y + 0x10) < 0x4b)) && ((void *)local_28.y != (game->_seedEffects)._seedEffects)) { pVVar2 = GetControllerInput(this,&local_28,0.0); rawInput.x = pVVar2->x; fVar4 = pVVar2->y; game = g_game; LAB_006d8761: rawInput.y = fVar4; local_10 = fVar4; inputX = rawInput.x; } else { bVar1 = Game::IsInTimedSet(game,0x4b); if (bVar1 != 0) { pVVar2 = GetControllerInput(this,&local_28,0.0); rawInput.x = pVVar2->x * -1.0; fVar4 = pVVar2->y * -1.0; game = g_game; goto LAB_006d8761; } if (this->field_0xf2c == '\0') { local_10 = InputManager::GetActionValue(4,this->_controllerID,(Entity *)this,unused); local_10 = 0.0 - local_10; rawInput.x = InputManager::GetActionValue(5,this->_controllerID,(Entity *)this,unused_03); rawInput.x = rawInput.x + local_10; inputX = rawInput.x; local_10 = InputManager::GetActionValue(6,this->_controllerID,(Entity *)this,unused_04); local_10 = 0.0 - local_10; fVar4 = InputManager::GetActionValue(7,this->_controllerID,(Entity *)this,unused_05); fVar4 = fVar4 + local_10; } else { local_10 = InputManager::GetActionValue(0,this->_controllerID,(Entity *)this,unused); local_10 = 0.0 - local_10; rawInput.x = InputManager::GetActionValue(1,this->_controllerID,(Entity *)this,unused_00); rawInput.x = rawInput.x + local_10; inputX = rawInput.x; local_10 = InputManager::GetActionValue(2,this->_controllerID,(Entity *)this,unused_01); local_10 = 0.0 - local_10; fVar4 = InputManager::GetActionValue(3,this->_controllerID,(Entity *)this,unused_02); fVar4 = fVar4 + local_10; } game = g_game; rawInput.y = fVar4; local_10 = fVar4; bVar1 = Game::IsInTimedSet(g_game,0xc); if (bVar1 != 0) { rawInput.x = inputX * -1.0; fVar4 = fVar4 * -1.0; goto LAB_006d8761; } } seedKey = 0x4c; fVar3 = inputX; std::set::find_node(local_38,&seedKey); if (*(char *)((int)seedNode + 0xd) == '\0') { if (*(int *)((int)seedNode + 0x10) < 0x4d) { if (seedNode != (game->_seedEffects)._seedEffects) { pVVar2 = Vector::ToCardinal(&local_28,&rawInput); fVar3 = sqrtf(fVar4 * fVar4 + fVar3 * fVar3); fVar4 = fVar3 * pVVar2->y; fVar3 = fVar3 * pVVar2->x; local_10 = fVar4; inputX = fVar3; } } } fVar4 = sqrtf(fVar4 * fVar4 + fVar3 * fVar3); if ((minMagnitude <= 0.0) || (minMagnitude <= fVar4)) { if (1.0 < fVar4) { inputX = inputX / fVar4; local_10 = local_10 / fVar4; } if (((game->_currentDimensionIdx == 1) && ((game->_stageType == 4 || (game->_stageType == 5)))) && ((game->_stage == 2 || ((game->_stage == 1 && (curses = Level::GetCurses((Level *)game), (curses & 2) != 0)))))) { inputX = inputX * -1.0; } outInput->x = inputX; outInput->y = local_10; return outInput; } LAB_006d8891: fVar4 = g_vectorZero.y; outInput->x = g_vectorZero.x; outInput->y = fVar4; return outInput; } //@@ 006d88b0 Entity_NPC::TransferControl /* DB: moves _controllerID 0xf1c to new npc, repoints players 0x3c4 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::TransferControl(Entity_NPC *this,Entity_NPC *target) { int iVar1; Entity_NPC *pEVar2; void *pvVar3; undefined4 *puVar4; undefined4 *local_8; pEVar2 = target; if (target != this) { if (this->_controllerID != -1) { target = (Entity_NPC *)0x0; pvVar3 = (g_game->_playerManager)._extraPlayers._begin; if ((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar3 >> 2 != 0) { do { iVar1 = *(int *)((int)pvVar3 + (int)target * 4); if (*(int *)(iVar1 + 0x1618) == this->_controllerID) { puVar4 = (undefined4 *)(iVar1 + 0x3c4); if (*(Entity_NPC **)(iVar1 + 0x3c4) == this) { if (*(Entity_NPC **)(iVar1 + 0x3c4) != (Entity_NPC *)0x0) { local_8 = puVar4; std::multiset::erase(&local_8); } *puVar4 = pEVar2; if (pEVar2 != (Entity_NPC *)0x0) { std::multiset::insert(puVar4); } } } target = (Entity_NPC *)&target->field_0x1; pvVar3 = (g_game->_playerManager)._extraPlayers._begin; } while (target < (undefined1 *) ((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar3 >> 2)); } } if (pEVar2 != (Entity_NPC *)0x0) { pEVar2->_controllerID = this->_controllerID; } this->_controllerID = -1; } return; } //@@ 006d8990 Entity::is_valid_target /* DB: ? false for non-enemy types (1 only in co-op), fire 33, shopkeeper 17, 292, 885 v10, 960, 965, 245, dead; resolves its root parent (ParentNPC for 222/281, chain for 868, DoesEntityShareStatus) and requires itself as root, not dead, +0x... == -1, no flag 0x2000; Entity_Player::Update target pick, PlayerManager::handle_coop_join */ uint Entity::is_valid_target(void) { int iVar1; byte bVar2; undefined3 extraout_var; Game *pGVar3; Entity_NPC *pEVar4; undefined3 extraout_var_00; Game *in_ECX; undefined1 *puVar5; Game *pGVar6; Game *extraout_EDX; Game *pGVar7; bool bVar8; iVar1 = *(int *)&g_game->_deathmatchManager; if ((iVar1 < 2) || (in_ECX->_roomList[0].OverrideData != (void *)0x1)) { puVar5 = in_ECX->_roomList[0].OverrideData; pGVar3 = (Game *)(puVar5 + -10); if (((Game *)0x3dd < pGVar3) || (((puVar5 == (undefined1 *)0x21 || (puVar5 == &DAT_00000011)) || (puVar5 == (undefined1 *)0x124)))) goto LAB_006d8b09; if (puVar5 == (undefined1 *)0x375) { bVar8 = in_ECX->_roomList[0].AllowedDoors == 10; } else { if ((puVar5 == (undefined1 *)0x3c0) || (puVar5 == (undefined1 *)0x3c5)) goto LAB_006d8b09; bVar8 = puVar5 == (undefined1 *)0xf5; } if (bVar8) goto LAB_006d8b09; } else { puVar5 = (undefined1 *)0x1; pGVar3 = g_game; } if (in_ECX->_roomList[1].field_0xa7 != '\0') goto LAB_006d8b09; if (puVar5 == (undefined1 *)0xde) { LAB_006d8ad0: pGVar3 = (Game *)Entity_NPC::ParentNPC((Entity_NPC *)in_ECX); pGVar7 = pGVar3; LAB_006d8ad9: if (pGVar7 != in_ECX) goto LAB_006d8b09; } else { if (puVar5 != (undefined1 *)0x119) { if (puVar5 == (undefined1 *)0x364) { pGVar3 = in_ECX->_roomList[5].Data; pGVar6 = in_ECX; while (pGVar7 = pGVar3, pGVar7 != (Game *)0x0) { pGVar6 = pGVar7; pGVar3 = pGVar7->_roomList[5].Data; } if (((iVar1 < 2) || (pGVar3 = (Game *)0x0, pGVar6->_roomList[0].OverrideData != (void *)0x1) ) && (pGVar3 = (Game *)((int)pGVar6->_roomList[0].OverrideData + -10), (Game *)0x3dd < pGVar3)) { pGVar6 = (Game *)0x0; } pGVar7 = in_ECX; if (pGVar6 != (Game *)0x0) { pGVar7 = pGVar6; } } else { bVar2 = DoesEntityShareStatus((Entity *)in_ECX); pGVar3 = (Game *)CONCAT31(extraout_var,bVar2); pGVar7 = extraout_EDX; if (bVar2 != 0) { pGVar3 = in_ECX->_roomList[5].Data; pGVar7 = extraout_EDX; while (pGVar6 = pGVar3, pGVar3 = (Game *)0x0, pGVar6 != (Game *)0x0) { pGVar7 = pGVar6; pGVar3 = pGVar6->_roomList[5].Data; } } if ((pGVar7 == (Game *)0x0) || (((iVar1 < 2 || (pGVar7->_roomList[0].OverrideData != (void *)0x1)) && (pGVar3 = (Game *)((int)pGVar7->_roomList[0].OverrideData + -10), (Game *)0x3dd < pGVar3 )))) { pGVar7 = (Game *)0x0; } } goto LAB_006d8ad9; } pEVar4 = Entity_NPC::ParentNPC((Entity_NPC *)in_ECX); pGVar3 = (Game *)0x0; if (pEVar4 != (Entity_NPC *)0x0) goto LAB_006d8ad0; } if ((in_ECX->_roomList[1].field_0xa7 == '\0') && (*(int *)&in_ECX->_roomList[0x14].field_0xa8 == -1)) { bVar2 = HasEntityFlags((Entity *)in_ECX,0x200000000000); pGVar3 = (Game *)CONCAT31(extraout_var_00,bVar2); if (bVar2 == 0) { return CONCAT31(extraout_var_00,1); } } LAB_006d8b09: return (uint)pGVar3 & 0xffffff00; } //@@ 006d8b20 Entity_NPC::SpawnControlTarget /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: controlled npc spawns effect 1000.30 target at 0xf28 using controller input prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::SpawnControlTarget(Entity_NPC *this,int inputMode,float rotation) { void **ppvVar1; ColorMod *pCVar2; int iVar3; ANM2 *pAVar4; Vector *pVVar5; uint seed; Entity *pEVar6; int *piVar7; Vector local_40; undefined4 local_38 [8]; undefined4 local_18; undefined4 uStack_14; undefined4 local_10; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); piVar7 = this->_aimTargetEffect; ppvVar1 = &this->_aimTargetEffect; if (piVar7 != (int *)0x0) { if (piVar7[10] == 1000) goto LAB_006d8cba; (**(code **)(*piVar7 + 0x28))(); if (*ppvVar1 != (void *)0x0) { local_40.y = (float)ppvVar1; std::multiset::erase(&local_40.y); } *ppvVar1 = (void *)0x0; } if (inputMode == 0) { pVVar5 = GetControllerMovementInput(this,&local_40,0.0); if ((pVVar5->x == g_vectorZero.x) && (pVVar5->y == g_vectorZero.y)) { return; } } else if (((inputMode == 1) && (pVVar5 = GetControllerInput(this,&local_40,0.0), pVVar5->x == g_vectorZero.x)) && (pVVar5->y == g_vectorZero.y)) { return; } seed = Random(); pEVar6 = Game::Spawn(g_game,1000,0x1e,&this->_pos,&g_vectorZero,(Entity *)this,0,seed); iVar3 = *(int *)pEVar6; pAVar4 = &pEVar6[1]._sprite; (pAVar4->_filename)._buf[8] = '\0'; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &pEVar6[1]._sprite; (pAVar4->_filename)._buf[0xc] = '\0'; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; (**(code **)(iVar3 + 0xc))(); pCVar2 = &(pEVar6->_sprite)._color; local_18 = 0; uStack_14 = 0; local_10 = 0; if (pCVar2 != (ColorMod *)local_38) { (pEVar6->_sprite)._color._colorize[0] = 0.0; (pEVar6->_sprite)._color._colorize[1] = 0.0; (pEVar6->_sprite)._color._colorize[2] = 0.0; (pEVar6->_sprite)._color._colorize[3] = 0.0; (pEVar6->_sprite)._color._offset[0] = 0.0; (pEVar6->_sprite)._color._offset[1] = 0.0; pCVar2->_tint[0] = 0.60784316; (pEVar6->_sprite)._color._tint[1] = 0.0; (pEVar6->_sprite)._color._tint[2] = 0.0; (pEVar6->_sprite)._color._tint[3] = 1.0; (pEVar6->_sprite)._color._offset[2] = 0.0; } if (*ppvVar1 != (void *)0x0) { local_40.y = (float)ppvVar1; std::multiset::erase(&local_40.y); } *ppvVar1 = pEVar6; std::multiset::insert(ppvVar1); piVar7 = this->_aimTargetEffect; LAB_006d8cba: piVar7[0x11d] = (int)rotation; *(undefined4 *)((int)*ppvVar1 + 0x424) = 2; *(int *)((int)*ppvVar1 + 0x428) = inputMode; return; } //@@ 006d8cf0 Entity_NPC::ClearChild /* DB: kills/clears EntityPtr at this+0xf28; Para-Bite, Baby */ void __thiscall Entity_NPC::ClearChild(Entity_NPC *this) { void **ppvVar1; Entity_NPC *local_8; ppvVar1 = &this->_aimTargetEffect; if (*ppvVar1 != (int *)0x0) { local_8 = this; (**(code **)(*(int *)*ppvVar1 + 0x28))(); if (*ppvVar1 != (void *)0x0) { local_8 = (Entity_NPC *)ppvVar1; std::multiset::erase(&local_8); } *ppvVar1 = (void *)0x0; } return; } //@@ 006d8d30 Entity_NPC::GetAimTargetPosition /* DB: ? returns pos of entity at npc+0xf28 else own pos; shooter AIs prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity_NPC::GetAimTargetPosition(Entity_NPC *this,Vector *outPosition) { void *pvVar1; float fVar2; float fVar3; pvVar1 = this->_aimTargetEffect; if (pvVar1 == (void *)0x0) { fVar2 = (this->_pos).x; fVar3 = (this->_pos).y; } else { fVar2 = *(float *)((int)pvVar1 + 0x33c); fVar3 = *(float *)((int)pvVar1 + 0x340); } outPosition->x = fVar2; outPosition->y = fVar3; return outPosition; } //@@ 006d8d80 Entity_NPC::is_controller_input_idle /* DB: controller input zero via 0xf28 player */ uint __thiscall Entity_NPC::is_controller_input_idle(Entity_NPC *this) { float fVar1; void *pvVar2; Vector *pVVar3; undefined2 uVar5; uint uVar4; Vector local_14; Vector local_c; pvVar2 = this->_aimTargetEffect; uVar4 = 0; if (pvVar2 != (void *)0x0) { if ((*(int *)((int)pvVar2 + 0x28) == 1000) && (uVar4 = *(uint *)((int)pvVar2 + 0x428), uVar4 != 0)) { if (uVar4 != 1) { if (uVar4 != 2) goto LAB_006d8dc0; goto LAB_006d8dfc; } pVVar3 = GetControllerInput(this,&local_c,0.1); } else { pVVar3 = GetControllerMovementInput(this,&local_14,0.1); } fVar1 = pVVar3->x; uVar5 = (undefined2)((uint)pVVar3 >> 0x10); uVar4 = (uint)CONCAT21(uVar5,(fVar1 == g_vectorZero.x) << 6 | (NAN(fVar1) || NAN(g_vectorZero.x)) << 2 | 2U | fVar1 < g_vectorZero.x) << 8; if (fVar1 == g_vectorZero.x) { fVar1 = pVVar3->y; uVar4 = (uint)CONCAT21(uVar5,(fVar1 == g_vectorZero.y) << 6 | (NAN(fVar1) || NAN(g_vectorZero.y)) << 2 | 2U | fVar1 < g_vectorZero.y) << 8; if (fVar1 == g_vectorZero.y) { LAB_006d8dfc: return CONCAT31((int3)(uVar4 >> 8),1); } } } LAB_006d8dc0: return uVar4 & 0xffffff00; } //@@ 006d8e10 is_local_player_owned /* DB: netplay idx 0xf1c IsIdxLocalPlayer, Effect/Game render */ undefined1 is_local_player_owned(void) { byte bVar1; int in_ECX; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (*(uint *)(in_ECX + 0xf1c) != 0xffffffff)) { bVar1 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,*(uint *)(in_ECX + 0xf1c)); if (bVar1 == 0) { return 0; } } return 1; } //@@ 006d8e40 Entity_NPC::UpdateChargeBar /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? controlled NPC (0xf1c controllerID) loads gfx/chargebar.anm2 into 0xdec, "Charging", start/end params prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::UpdateChargeBar(Entity_NPC *this,float start,float end,float value,byte isHideWhenFull) { undefined1 *puVar1; byte bVar2; LayerState *pLVar3; int iVar4; char *ptr; uint size; float fVar5; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; bVar2 = (this->_chargeBarSprite)._loaded; if (this->_controllerID == -1) { if (bVar2 == 0) { return; } } else { ExceptionList = &local_1c; puVar1 = (undefined1 *)((int)register0x00000010 + -4); if (bVar2 == 0) { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x12; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/chargebar.anm2",0x13); local_14 = 0; ANM2::Load(&this->_chargeBarSprite,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { size = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; puVar1 = puStack_20; } puStack_20 = puVar1; pLVar3 = ANM2::GetLayer(&this->_chargeBarSprite,(byte *)0x2); pLVar3->_visible = 0; if (start == end) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar5 = (value - start) / (end - start); if (fVar5 <= 0.0) { fVar5 = 0.0; } if (1.0 <= fVar5) { fVar5 = 1.0; } iVar4 = (int)(fVar5 * 100.0 + 0.0); if ((isHideWhenFull == 0) || (iVar4 < 100)) { bVar2 = ANM2::SetAnimation(&this->_chargeBarSprite,(byte *)"Charging",1); if ((bVar2 != 0) && (((this->_chargeBarSprite)._animState._animData != (void *)0x0 && (AnimationState::SetFrameFloat(&(this->_chargeBarSprite)._animState,(float)iVar4), (this->_chargeBarSprite)._animState._animData != (void *)0x0)))) { (this->_chargeBarSprite)._animState._isPlaying = 0; } (this->_chargeBarSprite)._color._tint[3] = 1.0; ExceptionList = local_1c; return; } } (this->_chargeBarSprite)._color._tint[3] = 0.0; ExceptionList = local_1c; return; } //@@ 006d9050 Entity_NPC::UpdateControllerMovement /* DB: reads controller move vector into 0xf20/0xf24, zero if _controllerID -1 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::UpdateControllerMovement(Entity_NPC *this,byte isForceUpdate) { Vector local_10; if (this->_controllerID == -1) { (this->_controllerMovement).x = g_vectorZero.x; (this->_controllerMovement).y = g_vectorZero.y; return; } GetControllerMovementInput(this,&local_10,0.1); if (((isForceUpdate != 0) || (local_10.x != g_vectorZero.x)) || (local_10.y != g_vectorZero.y)) { (this->_controllerMovement).x = local_10.x; (this->_controllerMovement).y = local_10.y; } return; } //@@ 006d90e0 Entity_NPC::UpdateChildEffectPosition /* DB: ? effect at 0xf28 (type 1000) placed relative to npc size 0x38c.. */ void __thiscall Entity_NPC::UpdateChildEffectPosition(Entity_NPC *this,char param_2) { void *pvVar1; Vector *pVVar2; float fVar3; float fVar4; Vector local_18; Vector local_10; if (this->_controllerID == -1) { return; } pvVar1 = this->_aimTargetEffect; if (pvVar1 == (void *)0x0) { return; } if (*(int *)((int)pvVar1 + 0x28) == 1000) { if (*(int *)((int)pvVar1 + 0x428) == 2) { if (param_2 == '\0') { fVar3 = (this->_prevPosition).x; fVar4 = (this->_prevPosition).y; } else { fVar4 = (this->_prevVelocity).y * 0.5 * this->_speedMultiplier + (this->_prevPosition).y; fVar3 = (this->_prevVelocity).x * 0.5 * this->_speedMultiplier + (this->_prevPosition).x; } *(float *)((int)pvVar1 + 0x33c) = fVar3; *(float *)((int)pvVar1 + 0x340) = fVar4; pvVar1 = this->_aimTargetEffect; *(float *)((int)pvVar1 + 0x360) = g_vectorZero.x; *(float *)((int)pvVar1 + 0x364) = g_vectorZero.y; return; } if (*(int *)((int)pvVar1 + 0x428) != 0) { pVVar2 = GetControllerInput(this,&local_10,0.0); goto LAB_006d91de; } } pVVar2 = GetControllerMovementInput(this,&local_18,0.0); LAB_006d91de: fVar3 = pVVar2->y; if ((pVVar2->x != g_vectorZero.x) || (fVar3 != g_vectorZero.y)) { pvVar1 = this->_aimTargetEffect; *(float *)((int)pvVar1 + 0x360) = pVVar2->x * 8.0 + *(float *)((int)pvVar1 + 0x360); *(float *)((int)pvVar1 + 0x364) = fVar3 * 8.0 + *(float *)((int)pvVar1 + 0x364); } pvVar1 = this->_aimTargetEffect; if ((*(int *)((int)pvVar1 + 0x28) == 1000) && (0.0 < *(float *)((int)pvVar1 + 0x474))) { fVar3 = *(float *)((int)pvVar1 + 0x474) - 40.0; local_18.x = (this->_pos).x - *(float *)((int)pvVar1 + 0x33c); if (fVar3 <= 0.0) { fVar3 = 0.0; } local_10.x = (this->_pos).y - *(float *)((int)pvVar1 + 0x340); fVar4 = sqrtf(local_10.x * local_10.x + local_18.x * local_18.x); if (fVar3 < fVar4) { *(float *)((int)pvVar1 + 0x360) = (local_18.x / fVar4) * (fVar4 - fVar3) * 0.1 + *(float *)((int)pvVar1 + 0x360); *(float *)((int)pvVar1 + 0x364) = (local_10.x / fVar4) * (fVar4 - fVar3) * 0.1 + *(float *)((int)pvVar1 + 0x364); } } return; } //@@ 006d9320 Entity_NPC::apply_controller_movement /* DB: GetControllerInput velocity; hopper/fat sack */ void __thiscall Entity_NPC::apply_controller_movement(Entity_NPC *this) { Vector *pVVar1; float fVar2; float in_XMM1_Da; float in_XMM2_Da; float in_XMM3_Da; Vector local_20; float local_18; float local_14; float local_10; float local_c; float local_8; fVar2 = this->_speedMultiplier; local_c = in_XMM2_Da; if (fVar2 != 1.0) { local_c = in_XMM2_Da / ((fVar2 + in_XMM2_Da) - fVar2 * in_XMM2_Da); } local_10 = (this->_velocity).x; local_14 = (this->_velocity).y; local_18 = in_XMM3_Da; local_8 = in_XMM1_Da; pVVar1 = GetControllerInput(this,&local_20,0.0); local_10 = local_8 * pVVar1->x * this->_speedMultiplier + local_10 * local_c; local_8 = local_8 * pVVar1->y * this->_speedMultiplier + local_14 * local_c; (this->_velocity).x = local_10; (this->_velocity).y = local_8; fVar2 = sqrtf(local_8 * local_8 + local_10 * local_10); if ((local_18 < fVar2) && (0.0 < fVar2)) { (this->_velocity).y = (local_18 / fVar2) * local_8; (this->_velocity).x = (local_18 / fVar2) * local_10; } return; } //@@ 006d9440 Entity_NPC::TryThrow /* ZHL [exact] bool TryThrow(const EntityRef& Source, Vector* pos, float unk); */ undefined4 __thiscall Entity_NPC::TryThrow(Entity_NPC *this,int *param_2,float *param_3,float param_4) { uint uVar1; Manager *pMVar2; int local_c [2]; if (this->_type == 0xf5) { (this->_v1).x = -20.0; (this->_v1).y = -param_4; (this->_velocity).x = *param_3; (this->_velocity).y = param_3[1]; uVar1 = *(uint *)((int)&this->_flags + 4); *(int *)&this->_flags = (int)this->_flags; *(uint *)((int)&this->_flags + 4) = uVar1 & 0xffffffdf | 0x4000000; if (*param_2 == 1) { this->_entityCollisionClass = 3; } pMVar2 = g_manager; if (25.0 < *param_3 * *param_3 + param_3[1] * param_3[1]) { local_c[0] = 0x25d; seed_fart_sound_override(local_c); SoundEffects::Play(&pMVar2->_sfxManager,local_c[0],1.0,2,0,1.0,0.0); } } else if ((this->_flags & 0x200000000000000) == 0) { return 0; } return 1; } //@@ 006d9550 NpcHelper::Polty_SpawnRockProjectile /* DB: called from NpcAI::ENTITY_POLTY; Game::SpawnEx(9,8 = PROJECTILE rock) with Isaac::SwapANM2 of grabbed object sprite, Entity::SetSize x3; returns projectile */ Entity * NpcHelper::Polty_SpawnRockProjectile (ANM2 *param_1,int *param_2,Vector *param_3,undefined4 param_4) { void *pvVar1; undefined4 uVar2; EntityPtr EVar3; EntityPtr EVar4; Entity *this; LayerState *pLVar5; EntityPtr in_ECX; uint uVar6; ANM2 *this_00; byte *layerName; ANM2 local_148; float local_30; float local_2c; EntityPtr local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)&(&local_148)[1]._animState; local_14 = 0xffffffff; puStack_18 = &LAB_00afacc0; local_1c = ExceptionList; ExceptionList = &local_1c; local_24 = in_ECX; this = Game::SpawnEx(g_game,9,8,(Vector *)((int)in_ECX + 0x33c),param_3,(Entity *)in_ECX, *param_2 << 0x10 | (uint)*(ushort *)(param_2 + 1),param_2[4],0); if (*param_2 == 0xe) { this->_health = (float)param_2[2]; if (param_2[1] == 7) { pvVar1 = this->_config; this[1]._pendingDamage = 4.0; local_2c = -g_vectorOne.y; local_30 = -g_vectorOne.x; Entity::SetSize(this,*(float *)((int)pvVar1 + 0x38) * 3.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); } if (param_2[5] == 1) { uVar2 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x40000; *(undefined4 *)((int)&this->_flags + 4) = uVar2; } } *(undefined4 *)&this[1].field_0x3c = param_4; *(undefined4 *)&this[1].field_0x4 = 0xc1f00000; this[1]._damageEvents._end = (void *)0x3f4ccccd; this[1]._damageEvents._begin = (void *)0xc0a00000; ANM2::ANM2(&local_148,param_1); Isaac::SwapANM2(&this->_sprite,&local_148); local_14 = 0; ANM2::Reset(this_00); AnimationState::~AnimationState(&local_148._overlayAnimState); AnimationState::~AnimationState(&local_148._animState); std::string::_Tidy_deallocate(local_148._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_148); layerName = (byte *)0x0; local_14 = 0xffffffff; if ((this->_sprite)._layerCount != 0) { do { pLVar5 = ANM2::GetLayer(&this->_sprite,layerName); (pLVar5->_pos).x = g_vectorZero.x; (pLVar5->_pos).y = g_vectorZero.y; pLVar5 = ANM2::GetLayer(&this->_sprite,layerName); layerName = layerName + 1; (pLVar5->_size).x = g_vectorOne.x; (pLVar5->_size).y = g_vectorOne.y; } while (layerName < (byte *)(this->_sprite)._layerCount); } EVar4 = local_24; uVar6 = *(uint *)((int)local_24 + 0x168); if ((uVar6 & 0x100) != 0) { this[1]._variant = this[1]._variant | 0x80; EVar3 = this->_parent; this[1]._subtype = this[1]._subtype; if (EVar3 != (EntityPtr)0x0) { local_24 = (EntityPtr)&this->_parent; std::multiset::erase(&local_24); } this->_parent = EVar4; std::multiset::insert(&this->_parent); uVar6 = *(uint *)((int)EVar4 + 0x168); } if ((uVar6 & 0x20000000) != 0) { this[1]._variant = this[1]._variant | 0x80000000; this[1]._subtype = this[1]._subtype; } (**(code **)(*(int *)this + 0xc))(); ExceptionList = local_1c; return this; } //@@ 006d97e0 Entity_NPC::zhl_misfit_006d97e0 /* DB: ? tests boss types (0x47..0x4c, 0xdf), Morph/BloodExplode; ZHL prefix20/55 called it Entity_Player::Update */ undefined4 __thiscall Entity_NPC::zhl_misfit_006d97e0(Entity_NPC *this,EntityPtr param_2,char param_3) { EntityPtr *pEVar1; uint *puVar2; int iVar3; code *pcVar4; qword qVar5; byte bVar6; char cVar7; uint uVar8; EntityRef *killSourceRef; undefined4 uVar9; Entity_NPC *half; byte *animNameCh; void *listData; LayerState *layer; byte unk; byte *expectedNameCh; Entity_NPC *momPart; uint uVar10; int iVar11; EntityPtr EVar12; undefined4 *parentSlot; EntityPtr EVar13; bool bVar14; bool isUnsplittable; float in_XMM1_Da; float fVar15; float fVar16; undefined1 *sideSign; EntityRef local_108; EntityRef local_e0; undefined8 local_b4; EntityList_EL hornfelDoors; EntityList_EL momParts; EntityList_EL geminiBabies; undefined8 local_74; int local_6c; EntityList_EL peeps; EntityPtr halves [2]; EntityPtr *local_50; int *local_4c; undefined4 *local_48; EntityPtr *local_44; EntityList_EL umbilicalCords; Vector spawnPos; EntityPtr *local_28; EntityPtr local_24; float local_20; int halfIndex; uint cleanupFlags; int local_14; void *local_10; undefined1 *puStack_c; EntityPtr local_8; byte *curAnimData; Game *game; Manager *manager; int *umbilicalCord; manager = g_manager; local_8 = (EntityPtr)0xffffffff; puStack_c = &LAB_00afad00; local_10 = ExceptionList; uVar8 = __security_cookie ^ (uint)(halves + 0x15); local_44 = (EntityPtr *)0x0; cleanupFlags = 0; if ((this->_dead != 0) || (this->_exists == 0)) { return 0; } ExceptionList = &local_10; local_20 = in_XMM1_Da; if (param_3 != '\0') { local_14 = 0x4d; seed_fart_sound_override(&local_14); SoundEffects::Play(&manager->_sfxManager,local_14,1.0,2,0,1.0,0.0); } iVar11 = this->_type; if ((((((iVar11 == 0xdf) || (iVar11 == 0xdc)) || (iVar11 == 0x39)) || ((iVar11 == 0x50 || (iVar11 == 0x5e)))) || ((((iVar11 == 0x47 || ((iVar11 == 0x48 || (iVar11 == 0x49)))) || (iVar11 == 0x4a)) || (((iVar11 == 0x4b || (iVar11 == 0x4c)) || (iVar11 == 0x33)))))) || (this->_championColorIdx == 0xf)) { bVar14 = true; } else { bVar14 = false; } if (iVar11 == 0x2d) { if (this->_variant != 10) goto LAB_006d98e5; LAB_006d9a09: isUnsplittable = false; } else { if (((((iVar11 != 0x4e) && (iVar11 != 0x54)) && ((iVar11 != 0x112 && ((iVar11 != 0x113 && (iVar11 != 0x66)))))) && (iVar11 != 0x111)) && ((iVar11 != 0x10a && (iVar11 != 0x65)))) { if (iVar11 == 0x387) { if (this->_variant != 0) { isUnsplittable = this->_variant == 1; goto LAB_006d9a03; } } else if ((((iVar11 != 0x3e) && (iVar11 != 0x38f)) && (iVar11 != 0x390)) && (((iVar11 != 0x197 && (iVar11 != 0x196)) && (iVar11 != 0x3b6)))) { isUnsplittable = iVar11 == 0x3b7; LAB_006d9a03: if (!isUnsplittable) goto LAB_006d9a09; } } LAB_006d98e5: isUnsplittable = true; } fVar16 = 0.5; fVar15 = local_20; if ((0.5 < this->_scale || this->_scale == 0.5) && (!isUnsplittable)) { if ((iVar11 == 0x51) && ((this->_variant == 0 && (this->_spawnerType != 0x51)))) { fVar15 = this->_maxHitPoints * 0.4; if (this->_health <= fVar15) { fVar15 = this->_health; } this->_health = fVar15; goto LAB_006d9a4d; } bVar6 = Entity::is_same_segmented_body((Entity *)this,(Entity *)0x0); if (bVar6 == 0) { if (iVar11 == 0x387) { iVar3 = this->_variant; joined_r0x006d9a82: if (iVar3 == 10) goto LAB_006d9a2b; } else if (iVar11 == 0x38d) { iVar3 = this->_variant; goto joined_r0x006d9a82; } if (!bVar14) { if ((iVar11 == 0x41) && (this->_variant == 1)) { cVar7 = (**(code **)(*(int *)this + 0x4c))(); if (cVar7 == '\0') { killSourceRef = ::EntityRef::EntityRef(&local_108); (**(code **)(*(int *)this + 0x24))(killSourceRef); goto LAB_006d9a4d; } fVar16 = 0.5; } iVar11 = 0x14; local_20 = (float)this->_initSeed; local_74 = 0x500000003; local_14 = 0x14; local_6c = 0x14; halves[0] = (EntityPtr)0x0; halves[1] = (EntityPtr)0x0; halfIndex = 0; do { iVar3 = this->_type; local_28 = (EntityPtr *)(this->_size * fVar16); spawnPos.y = 0.0; spawnPos.x = 0.0; if (iVar3 == 0x104) { if (this->_variant != 0) goto LAB_006d9b71; LAB_006d9b3e: if (halfIndex == 0) { sideSign = &DAT_bf800000; } else { sideSign = (undefined1 *)0x3f800000; } spawnPos.y = (float)local_28 * 0.0; spawnPos.x = (float)local_28 * (float)sideSign; } else { if ((((iVar3 == 0x24) || (iVar3 == 0x106)) || (iVar3 == 0x107)) || ((iVar3 == 0x45 && (this->_variant == 0)))) goto LAB_006d9b3e; LAB_006d9b71: if (local_20 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar9 = (*pcVar4)(); return uVar9; } uVar8 = (uint)local_20 >> ((byte)local_74 & 0x1f) ^ (uint)local_20; local_b4 = 0x100000003; uVar8 = uVar8 << ((byte)((ulonglong)local_74 >> 0x20) & 0x1f) ^ uVar8; local_20 = (float)(uVar8 >> ((byte)iVar11 & 0x1f) ^ uVar8); if (local_20 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar9 = (*pcVar4)(); return uVar9; } uVar8 = (uint)local_20 >> 3 ^ (uint)local_20; uVar8 = uVar8 << 1 ^ uVar8; uVar8 = uVar8 >> 0xe ^ uVar8; fVar15 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10 * 3.14; param_2 = (EntityPtr)(fVar15 + fVar15); local_24 = (EntityPtr)sin((float)param_2); spawnPos.x = cos((float)param_2); spawnPos.x = spawnPos.x * (float)local_28; spawnPos.y = (float)local_24 * (float)local_28; } spawnPos.y = spawnPos.y + (this->_pos).y; spawnPos.x = spawnPos.x + (this->_pos).x; param_2 = (EntityPtr)this->_type; uVar8 = this->_variant; if (param_2 == (EntityPtr)0x45) { if (uVar8 == 0) { uVar8 = 1; } } else if (param_2 == (EntityPtr)0x398) { uVar8 = 0; param_2 = (EntityPtr)0x38a; if (halfIndex != 0) { param_2 = (EntityPtr)0x45; } } if (local_20 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar9 = (*pcVar4)(); return uVar9; } uVar10 = (uint)local_20 >> ((byte)local_74 & 0x1f) ^ (uint)local_20; uVar10 = uVar10 << ((byte)((ulonglong)local_74 >> 0x20) & 0x1f) ^ uVar10; local_20 = (float)(uVar10 >> ((byte)local_14 & 0x1f) ^ uVar10); half = (Entity_NPC *) Game::Spawn(g_game,(uint)param_2,uVar8,&spawnPos,&g_vectorZero,(Entity *)this, this->_subtype,(uint)local_20); if (this->_isChampion != 0) { Morph(half,(int)param_2,uVar8,this->_subtype,this->_championColorIdx); } half->_scoreMultiplier = this->_scoreMultiplier * 0.5; if (half->_type == 0x322) { pEVar1 = &half->_parent; local_24 = this->_parent; if (half->_parent != (EntityPtr)0x0) { param_2 = (EntityPtr)pEVar1; std::multiset::erase(¶m_2); } *pEVar1 = local_24; if (local_24 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } if ((halfIndex == 0) && (EVar13 = this->_parent, *(int *)((int)EVar13 + 0x28) == 3)) { EVar12 = (EntityPtr)((int)EVar13 + 0xdc0); if (*(int *)((int)EVar13 + 0xdc0) != 0) { local_24 = EVar12; std::multiset::erase(&local_24); } *(Entity_NPC **)EVar12 = half; std::multiset::insert(EVar12); } EntityList::AddPersistentEntity ((EntityList *)((int)g_game->_room + 0x1218),(Entity *)half); } if (this->_type == 0x45) { if (this->_variant != 0) goto LAB_006d9ded; (half->_sprite)._flipX = halfIndex != 0; } else if (this->_type != 0x398) { LAB_006d9ded: fVar16 = this->_scale * 0.66; half->_scale = fVar16; fVar16 = fVar16 * half->_shrinkStatus1; fVar15 = fVar16 * g_vectorOne.x; (half->_sprite)._scale.y = fVar16 * g_vectorOne.y; (half->_sprite)._scale.x = fVar15; half->_scaleMulti = this->_scaleMulti * 0.66; } if (half->_type == 0x38a) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&hornfelDoors,0x3c7,-1,-1,0,0); cleanupFlags = cleanupFlags | 3; if (hornfelDoors._size != 0) goto LAB_006d9e96; param_2._3_1_ = 1; } else { LAB_006d9e96: param_2 = (EntityPtr)((uint)param_2 & 0xffffff); } if (((cleanupFlags & 1) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffe, hornfelDoors._0_1_ == '\0')) { local_8 = (EntityPtr)0x0; tracked_alloc(1,hornfelDoors._data,0); local_8 = (EntityPtr)0xffffffff; } if (param_2._3_1_ != '\0') { if (half->_minecart != (EntityPtr)0x0) { (**(code **)(*(int *)half->_minecart + 0x28))(); } half->_state = 0xd; curAnimData = (half->_sprite)._animState._animData; if (curAnimData == (byte *)0x0) { LAB_006d9f46: bVar6 = ANM2::SetAnimation(&half->_sprite,&DAT_00b1cdf8,1); if (bVar6 != 0) { AnimationState::Rewind(&(half->_sprite)._animState); (half->_sprite)._animState._isPlaying = 1; } } else { animNameCh = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { animNameCh = *(byte **)curAnimData; } expectedNameCh = &DAT_00b1cdf8; do { bVar6 = *animNameCh; bVar14 = bVar6 < *expectedNameCh; if (bVar6 != *expectedNameCh) { LAB_006d9f28: uVar8 = -(uint)bVar14 | 1; goto LAB_006d9f2d; } if (bVar6 == 0) break; bVar6 = animNameCh[1]; bVar14 = bVar6 < expectedNameCh[1]; if (bVar6 != expectedNameCh[1]) goto LAB_006d9f28; animNameCh = animNameCh + 2; expectedNameCh = expectedNameCh + 2; } while (bVar6 != 0); uVar8 = 0; LAB_006d9f2d: if ((uVar8 != 0) || ((curAnimData[0x34] != 0 && ((half->_sprite)._animState._isPlaying == 0)))) goto LAB_006d9f46; } half->_entityGridCollisionClass = 5; } half->_maxHitPoints = this->_maxHitPoints * 0.4; half->_health = this->_health * 0.4; half->_hitPointsMulti = this->_hitPointsMulti * 0.4; game = g_game; iVar11 = this->_type; if (iVar11 == 0x104) { if (this->_variant == 0) { half->_state = 3; half->_entityCollisionClass = 4; (half->_targetPosition).x = 0.3; (half->_targetPosition).y = 0.0; } else { if (this->_variant != 10) goto LAB_006da2c0; param_2 = this->_parent; if (param_2 != (EntityPtr)0x0) { pEVar1 = &half->_parent; if (half->_parent != (EntityPtr)0x0) { local_28 = pEVar1; std::multiset::erase(&local_28); } *pEVar1 = param_2; std::multiset::insert(pEVar1); if (halfIndex != 0) { *(int *)((int)*pEVar1 + 0xbc0) = *(int *)((int)*pEVar1 + 0xbc0) + 1; } half->_spawnFrame = this->_spawnFrame; half->_state = this->_state; local_14 = local_6c; } } goto LAB_006da4a7; } if (iVar11 == 0x44) { half->_i1 = this->_i1; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); Sprite::ReplaceSpritesheet((Sprite *)&half->_sprite,0,&layer->_spriteSheetPath); ANM2::LoadGraphics(&half->_sprite,unk); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&peeps,0x44,-1,-1,0,0); cleanupFlags = cleanupFlags | 4; local_8 = (EntityPtr)0x1; param_2 = (EntityPtr)0x0; if ((EntityPtr)peeps._size != (EntityPtr)0x0) { listData = peeps._data; do { iVar11 = *(int *)((int)listData + (int)param_2 * 4); if (9 < *(uint *)(iVar11 + 0x2c)) { parentSlot = (undefined4 *)(iVar11 + 0x3bc); if (*(Entity_NPC **)(iVar11 + 0x3bc) == this) { if (*(Entity_NPC **)(iVar11 + 0x3bc) != (Entity_NPC *)0x0) { local_48 = parentSlot; std::multiset::erase(&local_48); } *parentSlot = half; std::multiset::insert(parentSlot); } listData = peeps._data; } param_2 = (EntityPtr)((int)param_2 + 1); } while ((uint)param_2 < (uint)peeps._size); } local_8 = (EntityPtr)0xffffffff; if (peeps._0_1_ != '\0') goto LAB_006da4a7; local_8 = (EntityPtr)0x2; listData = peeps._data; LAB_006da145: tracked_alloc(1,listData,0); local_8 = (EntityPtr)0xffffffff; } else if (iVar11 == 0x4f) { if (((this->_variant == 0) || (this->_variant == 2)) || (this->_variant == 1)) { half->_state = 4; EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),&umbilicalCords,0x4f,0x14,-1,0,0) ; cleanupFlags = cleanupFlags | 8; EVar13 = (EntityPtr)0x0; local_8 = (EntityPtr)0x3; if ((EntityPtr)umbilicalCords._size != (EntityPtr)0x0) { listData = umbilicalCords._data; do { umbilicalCord = *(int **)((int)listData + (int)EVar13 * 4); if ((Entity_NPC *)umbilicalCord[0xef] == this) { (**(code **)(*umbilicalCord + 0x28))(); listData = umbilicalCords._data; } EVar13 = (EntityPtr)((int)EVar13 + 1); } while ((uint)EVar13 < (uint)umbilicalCords._size); } if ((this->_type == 0x4f) && (this->_variant == 2)) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&geminiBabies,0x4f,0xc,-1,0,0 ); listData = geminiBabies._data; cleanupFlags = cleanupFlags | 0x10; umbilicalCords._capacity = geminiBabies._capacity; umbilicalCords._0_1_ = '\x01'; umbilicalCords._data = geminiBabies._data; umbilicalCords._size = geminiBabies._size; if (geminiBabies._0_1_ == '\0') { local_8._0_1_ = 4; tracked_alloc(1,geminiBabies._data,0); local_8._0_1_ = 3; } param_2 = (EntityPtr)0x0; if ((EntityPtr)geminiBabies._size != (EntityPtr)0x0) { do { umbilicalCord = (int *)(*(int *)((int)listData + (int)param_2 * 4) + 0x3bc); if ((Entity_NPC *)*umbilicalCord == this) { if ((Entity_NPC *)*umbilicalCord != (Entity_NPC *)0x0) { local_4c = umbilicalCord; std::multiset::erase(&local_4c); } *umbilicalCord = (int)half; std::multiset::insert(umbilicalCord); } param_2 = (EntityPtr)((int)param_2 + 1); listData = umbilicalCords._data; } while ((uint)param_2 < (uint)geminiBabies._size); goto LAB_006da29e; } } else { LAB_006da29e: listData = umbilicalCords._data; } local_8 = (EntityPtr)0xffffffff; if (umbilicalCords._0_1_ == '\0') { local_8 = (EntityPtr)0x5; goto LAB_006da145; } } } else { LAB_006da2c0: if (iVar11 == 0x61) { half->_state = 9; } else if (iVar11 == 0x41) { if (this->_variant == 1) { half->_spawnerType = 0; half->_spawnerVariant = 0; } } else if (iVar11 == 0x40) { if (this->_i1 != 0) { half->_i1 = 1; layer = ANM2::GetLayer(&half->_sprite,(byte *)0x1); layer->_visible = 0; } } else if (iVar11 == 0x3f) { if (this->_state == 9) { half->_state = 9; } } else if (iVar11 == 900) { half->_state = this->_state; half->_entityGridCollisionClass = 3; (half->_sprite)._overlayRenderFirst = 1; } else if (iVar11 == 0x2d) { if (halfIndex == 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&momParts,0x2d,-1,-1,0,0); local_8 = (EntityPtr)0x6; param_2 = (EntityPtr)0x0; if ((EntityPtr)momParts._size != (EntityPtr)0x0) { do { momPart = *(Entity_NPC **)((int)momParts._data + (int)param_2 * 4); if ((momPart == (Entity_NPC *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (momPart->_type != 1)) && (0x3dd < momPart->_type - 10U)))) { momPart = (Entity_NPC *)0x0; } if (momPart != this) { pEVar1 = &momPart->_parent; if (momPart->_parent == (EntityPtr)this) { momPart->_health = momPart->_maxHitPoints; if (momPart->_parent != (EntityPtr)0x0) { local_50 = pEVar1; std::multiset::erase(&local_50); } *pEVar1 = (EntityPtr)half; std::multiset::insert(pEVar1); } } param_2 = (EntityPtr)((int)param_2 + 1); } while ((uint)param_2 < (uint)momParts._size); } local_8 = (EntityPtr)0xffffffff; if (momParts._0_1_ == '\0') { local_8 = (EntityPtr)0x7; listData = momParts._data; goto LAB_006da145; } } else { pEVar1 = &half->_parent; if (half->_parent != (EntityPtr)0x0) { local_44 = pEVar1; std::multiset::erase(&local_44); } *pEVar1 = halves[0]; if (halves[0] != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } } } } LAB_006da4a7: iVar11 = local_14; halves[halfIndex] = (EntityPtr)half; half->_spawnGridIndex = this->_spawnGridIndex; if ((this->_flags & 0x8000000000) != 0) { qVar5 = half->_flags; puVar2 = (uint *)((int)&half->_flags + 4); *puVar2 = *puVar2 | 0x80; *(int *)&half->_flags = (int)qVar5; } halfIndex = halfIndex + 1; if (1 < halfIndex) goto LAB_006da4fe; fVar16 = 0.5; } while( true ); } killSourceRef = ::EntityRef::EntityRef(&local_e0); (**(code **)(*(int *)this + 0x24))(killSourceRef); goto LAB_006d9a4d; } LAB_006d9a2b: fVar15 = this->_health + this->_health; } (**(code **)(*(int *)this + 0x20))(fVar15,0,0,param_2,0x1e,uVar8); LAB_006d9a4d: if (param_3 != '\0') { Game::ShakeScreen(g_game,0xf); } ExceptionList = local_10; return 1; LAB_006da4fe: Entity::BloodExplode((Entity *)this); (**(code **)(*(int *)this + 0x28))(); goto LAB_006d9a4d; } //@@ 006da530 Entity_NPC::UpdatePickupGhosts /* ZHL [exact] __thiscall void Entity_NPC::UpdatePickupGhosts(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_NPC::UpdatePickupGhosts(Entity_NPC *this) { void **ppvVar1; bool bVar2; uint uVar3; Entity_Player *pEVar4; Entity_Effect *pEVar5; void *ptr; void *local_3c [4]; int local_2c; void *local_28 [4]; int local_18; void **local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afad35; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_28 + 9); ExceptionList = &local_10; bVar2 = false; pEVar4 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x299,(RNG **)&g_game->_playerManager,1); if (pEVar4 != (Entity_Player *)0x0) { if (this->_type == 0x21) { if (this->_health <= 1.0) goto LAB_006da6c5; fireplace_get_loot(this,local_28,0); local_8 = (void *)0x0; if (local_18 != 0) { ppvVar1 = &this->_pickupGhostsEntity; pEVar5 = Entity_Effect::CreateLootPreview (local_28,&this->_pos,(Entity *)this,this->_pickupGhostsEntity); if (*ppvVar1 != pEVar5) { if (*ppvVar1 != (Entity_Effect *)0x0) { local_14 = ppvVar1; std::multiset::erase(&local_14); } *ppvVar1 = pEVar5; if (pEVar5 != (Entity_Effect *)0x0) { std::multiset::insert(ppvVar1); } } bVar2 = true; } local_8 = (void *)0xffffffff; std::deque::clear(uVar3); ptr = local_28[0]; local_28[0] = (void *)0x0; } else { if ((this->_type != 0x11) || (this->_dead != 0)) goto LAB_006da6c5; shopkeeper_get_loot(this,local_3c,0); local_8 = (void *)0x1; if (local_2c != 0) { ppvVar1 = &this->_pickupGhostsEntity; pEVar5 = Entity_Effect::CreateLootPreview (local_3c,&this->_pos,(Entity *)this,this->_pickupGhostsEntity); if (*ppvVar1 != pEVar5) { if (*ppvVar1 != (Entity_Effect *)0x0) { local_14 = ppvVar1; std::multiset::erase(&local_14); } *ppvVar1 = pEVar5; if (pEVar5 != (Entity_Effect *)0x0) { std::multiset::insert(ppvVar1); } } bVar2 = true; } local_8 = (void *)0xffffffff; std::deque::clear(uVar3); ptr = local_3c[0]; local_3c[0] = (void *)0x0; } operator_delete(ptr,8); if (bVar2) { ExceptionList = local_10; return; } } LAB_006da6c5: if (this->_pickupGhostsEntity != (int *)0x0) { (**(code **)(*(int *)this->_pickupGhostsEntity + 0x28))(); } ExceptionList = local_10; return; } //@@ 006da6f0 FUN_006da6f0 undefined4 FUN_006da6f0(void) { int *in_ECX; return CONCAT31((int3)((uint)*in_ECX >> 8), (*(uint *)(*in_ECX + ((uint)in_ECX[1] >> 5) * 4) & 1 << ((byte)in_ECX[1] & 0x1f)) != 0); } //@@ 006da710 FUN_006da710 void FUN_006da710(char param_1) { uint *puVar1; uint uVar2; int *in_ECX; puVar1 = (uint *)(*in_ECX + ((uint)in_ECX[1] >> 5) * 4); uVar2 = 1 << ((byte)in_ECX[1] & 0x1f); if (param_1 == '\0') { *puVar1 = ~uVar2 & *puVar1; return; } *puVar1 = *puVar1 | uVar2; return; } //@@ 006da750 std::bitset<8>::any /* DB: src/rooms decompile labels (std::bitset<8>::any) */ undefined4 std::bitset<8>::any(void) { int *in_ECX; if (*in_ECX == 0) { return 0; } return 1; } //@@ 006da770 FUN_006da770 void FUN_006da770(undefined4 *param_1,undefined4 param_2) { undefined4 in_ECX; *param_1 = in_ECX; param_1[1] = param_2; return; } //@@ 006da790 FUN_006da790 void FUN_006da790(undefined4 *param_1) { int iVar1; undefined4 *in_ECX; *param_1 = *in_ECX; iVar1 = in_ECX[2]; param_1[2] = iVar1; param_1[1] = 0; in_ECX[2] = iVar1 + 1; return; } //@@ 006da7b0 FUN_006da7b0 void FUN_006da7b0(void) { void *ptr; undefined4 *in_ECX; std::deque::_Tidy(); ptr = (void *)*in_ECX; *in_ECX = 0; operator_delete(ptr,8); return; } //@@ 006da7d0 FUN_006da7d0 void FUN_006da7d0(uint param_1,uint param_2,byte *param_3) { byte bVar1; byte *pbVar2; undefined4 *in_ECX; uint uVar3; if ((uint)in_ECX[4] < param_1) { /* WARNING: Subroutine does not return */ FUN_00499950(); } pbVar2 = param_3; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); uVar3 = in_ECX[4] - param_1; if (uVar3 < param_2) { param_2 = uVar3; } if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } string_compare((byte *)((int)in_ECX + param_1),param_2,param_3,(int)pbVar2 - (int)(param_3 + 1)); return; } //@@ 006da830 FUN_006da830 void FUN_006da830(void) { undefined4 *in_ECX; if ((void *)*in_ECX != (void *)0x0) { operator_delete((void *)*in_ECX,8); } return; } //@@ 006da850 std::deque::clear /* DB: deque of 0x14 blocks freed */ void std::deque::clear(void) { void *pvVar1; void *ptr; int in_ECX; uint size; int iVar2; iVar2 = *(int *)(in_ECX + 0x10); if (iVar2 != 0) { do { iVar2 = iVar2 + -1; *(int *)(in_ECX + 0x10) = iVar2; } while (iVar2 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; } iVar2 = *(int *)(in_ECX + 8); while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(*(int *)(in_ECX + 4) + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x14); } } pvVar1 = *(void **)(in_ECX + 4); if (pvVar1 != (void *)0x0) { size = *(int *)(in_ECX + 8) * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 006da8e0 std::deque<4byte>::erase /* DB: erase(first, last) by offsets: moves the shorter side (front backward or back forward) through the 4-per-block map, then pops; caller Entity_NPC::update_damage_history */ void std::deque<4byte>::erase (undefined4 *param_1,undefined4 param_2,undefined4 param_3,uint param_4, undefined4 param_5,undefined4 param_6,uint param_7) { uint uVar1; undefined4 *in_ECX; uint uVar2; int iVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; int *piVar8; int local_1c; int local_10; if (in_ECX == (undefined4 *)0x0) { piVar8 = (int *)0x0; } else { piVar8 = (int *)*in_ECX; } uVar4 = in_ECX[3]; uVar2 = param_4 - uVar4; iVar3 = param_7 - param_4; if (iVar3 == 0) { *param_1 = piVar8; param_1[2] = param_4; param_1[1] = 0; return; } uVar1 = in_ECX[4] + uVar4; if (uVar2 < uVar1 - param_7) { if (piVar8 == (int *)0x0) { local_1c = 0; } else { local_1c = *piVar8; } if (uVar4 != param_4) { do { param_4 = param_4 - 1; param_7 = param_7 - 1; *(undefined4 *) (*(int *)(*(int *)(local_1c + 4) + (param_7 >> 2 & *(int *)(local_1c + 8) - 1U) * 4) + (param_7 & 3) * 4) = *(undefined4 *) (*(int *)(*(int *)(local_1c + 4) + (param_4 >> 2 & *(int *)(local_1c + 8) - 1U) * 4) + (param_4 & 3) * 4); } while (uVar4 != param_4); } do { piVar8 = in_ECX + 4; *piVar8 = *piVar8 + -1; if (*piVar8 == 0) { in_ECX[3] = 0; } else { in_ECX[3] = in_ECX[3] + 1; } iVar3 = iVar3 + -1; } while (iVar3 != 0); } else { if (piVar8 == (int *)0x0) { local_10 = 0; } else { local_10 = *piVar8; } if (param_7 != uVar1) { do { uVar4 = param_7 >> 2; uVar6 = param_7 & 3; uVar7 = param_4 >> 2; uVar5 = param_4 & 3; param_7 = param_7 + 1; param_4 = param_4 + 1; *(undefined4 *) (*(int *)(*(int *)(local_10 + 4) + (uVar7 & *(int *)(local_10 + 8) - 1U) * 4) + uVar5 * 4) = *(undefined4 *) (*(int *)(*(int *)(local_10 + 4) + (uVar4 & *(int *)(local_10 + 8) - 1U) * 4) + uVar6 * 4); } while (param_7 != uVar1); } do { piVar8 = in_ECX + 4; *piVar8 = *piVar8 + -1; if (*piVar8 == 0) { in_ECX[3] = 0; } iVar3 = iVar3 + -1; } while (iVar3 != 0); } *param_1 = *in_ECX; param_1[2] = in_ECX[3] + uVar2; param_1[1] = 0; return; } //@@ 006daa90 FUN_006daa90 void FUN_006daa90(void) { libm_sse2_pow_precise(); return; } //@@ 006daab0 FUN_006daab0 void FUN_006daab0(void) { void *pvVar1; int iVar2; void *ptr; uint size; int *in_ECX; int iVar3; iVar2 = *in_ECX; if (iVar2 == 0) { return; } iVar3 = *(int *)(iVar2 + 0x10); if (iVar3 != 0) { do { iVar3 = iVar3 + -1; *(int *)(iVar2 + 0x10) = iVar3; } while (iVar3 != 0); *(undefined4 *)(iVar2 + 0xc) = 0; } iVar3 = *(int *)(iVar2 + 8); while (iVar3 != 0) { iVar3 = iVar3 + -1; pvVar1 = *(void **)(*(int *)(iVar2 + 4) + iVar3 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x14); } } pvVar1 = *(void **)(iVar2 + 4); if (pvVar1 != (void *)0x0) { size = *(int *)(iVar2 + 8) * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined4 *)(iVar2 + 8) = 0; *(undefined4 *)(iVar2 + 4) = 0; return; } //@@ 006daac0 std::deque::_Growmap /* DB: ECX deque: map size (+8) doubles from max(8, n), allocates a new block map, memmoves both halves around the offset (+0xc) and zero-fills, frees the old map; called by std::deque::push_back and LootList::LootList when size+1 >= map size */ void std::deque::_Growmap(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0xccccccc - uVar3 < uVar3) { FUN_0040cad0(); LAB_006dabf6: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = _Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_006dabf6; } //@@ 006dac00 FUN_006dac00 void FUN_006dac00(undefined4 *param_1,undefined4 param_2) { undefined4 local_10 [3]; std::multimap::emplace(local_10,param_2); *param_1 = local_10[0]; return; } //@@ 006dac30 log_precise /* DB: libm log wrapper prototype: db/protos.zhl */ float __cdecl log_precise(float value) { double dVar1; dVar1 = (double)value; libm_sse2_log_precise(); return (float)dVar1; } //@@ 006dac50 ItemPool::GetLastPool /* ZHL [lua] Lua binding ItemPool:GetLastPool */ int __thiscall ItemPool::GetLastPool(ItemPool *this) { return this->_lastPool; } //@@ 006dac60 ItemConfig::IsQuestItem /* ZHL [exact] static cleanup bool ItemConfig::IsQuestItem(int id); prototype: db/protos.zhl */ byte __cdecl ItemConfig::IsQuestItem(int collectibleId) { ItemConfig_Item *pIVar1; pIVar1 = GetCollectible(&g_manager->_itemConfig,collectibleId); if ((pIVar1 == (ItemConfig_Item *)0x0) || ((pIVar1->tags & 0x8000) == 0)) { return 0; } return 1; } //@@ 006daca0 FUN_006daca0 void FUN_006daca0(undefined4 param_1) { int in_ECX; if (*(uint *)(in_ECX + 0x5c0) < 8) { *(undefined4 *)(in_ECX + 0x5a0 + *(uint *)(in_ECX + 0x5c0) * 4) = param_1; *(int *)(in_ECX + 0x5c0) = *(int *)(in_ECX + 0x5c0) + 1; } return; } //@@ 006dacd0 Entity_Player::HasFullHearts /* ZHL [lua] Lua binding EntityPlayer:HasFullHearts prototype: db/protos.zhl, confirmed by RET 0 */ byte __thiscall Entity_Player::HasFullHearts(Entity_Player *this) { int iVar1; int extraout_EDX; iVar1 = GetHealthType(this); if ((iVar1 == 1) || (iVar1 == 2)) { return *(int *)(extraout_EDX + 0x1340) <= *(int *)(extraout_EDX + 0x1344); } return *(int *)(extraout_EDX + 0x1340) + *(int *)(extraout_EDX + 0x1d88) * 2 <= *(int *)(extraout_EDX + 0x1344); } //@@ 006dad10 Entity_Player::GetJarHearts /* ZHL [lua] Lua binding EntityPlayer:GetJarHearts */ int __thiscall Entity_Player::GetJarHearts(Entity_Player *this) { return this->_jarHearts; } //@@ 006dad20 Entity_Player::GetSoulCharge /* ZHL [lua] Lua binding EntityPlayer:GetSoulCharge */ int __thiscall Entity_Player::GetSoulCharge(Entity_Player *this) { return this->_effectiveSoulCharge; } //@@ 006dad30 Entity_Player::GetBloodCharge /* ZHL [lua] Lua binding EntityPlayer:GetBloodCharge */ int __thiscall Entity_Player::GetBloodCharge(Entity_Player *this) { return this->_effectiveBloodCharge; } //@@ 006dad40 Entity_Player::GetBatteryCharge /* ZHL [lua] Lua binding EntityPlayer:GetBatteryCharge prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetBatteryCharge(Entity_Player *this,int slot) { if ((uint)slot < 4) { return this->_activeDesc[slot]._batteryCharge; } return 0; } //@@ 006dad60 Entity_Player::GetVelocityBeforeUpdate /* ZHL [lua] Lua binding EntityPlayer:GetVelocityBeforeUpdate */ Vector * __thiscall Entity_Player::GetVelocityBeforeUpdate(Entity_Player *this) { return &this->_lastVelocity; } //@@ 006dad70 Entity_Player::GetEternalHearts /* ZHL [lua] Lua binding EntityPlayer:GetEternalHearts */ int __thiscall Entity_Player::GetEternalHearts(Entity_Player *this) { return this->_eternalHearts; } //@@ 006dad80 Entity_Player::set_last_damage /* DB: ECX player: writes _lastDamageFlags +0x16a8 = arg1, +0x16ac = arg2, and copies a 10-dword EntityRef (arg3) into _lastDamageSource 0x167c..0x16a0; Entity_Pickup::CollectTrinket passes (0x400, 0, empty ref), update_item_effects passes (0x125, 0, ref) after a self-damage call */ void Entity_Player::set_last_damage(undefined4 param_1,undefined4 param_2,undefined4 *param_3) { int in_ECX; *(undefined4 *)(in_ECX + 0x16ac) = param_2; *(undefined4 *)(in_ECX + 0x16a8) = param_1; *(undefined4 *)(in_ECX + 0x167c) = *param_3; *(undefined4 *)(in_ECX + 0x1680) = param_3[1]; *(undefined4 *)(in_ECX + 0x1684) = param_3[2]; *(undefined4 *)(in_ECX + 0x1688) = param_3[3]; *(undefined4 *)(in_ECX + 0x168c) = param_3[4]; *(undefined4 *)(in_ECX + 0x1690) = param_3[5]; *(undefined4 *)(in_ECX + 0x1694) = param_3[6]; *(undefined4 *)(in_ECX + 0x1698) = param_3[7]; *(undefined4 *)(in_ECX + 0x169c) = param_3[8]; *(undefined4 *)(in_ECX + 0x16a0) = param_3[9]; return; } //@@ 006dae00 Entity_Player::GetBabySkin /* ZHL [lua] Lua binding EntityPlayer:GetBabySkin */ int __thiscall Entity_Player::GetBabySkin(Entity_Player *this) { return this->_babySkin; } //@@ 006dae10 Entity_Player::GetSubPlayer /* ZHL [lua] Lua binding EntityPlayer:GetSubPlayer */ int __thiscall Entity_Player::GetSubPlayer(Entity_Player *this) { return this->_subPlayer; } //@@ 006dae20 Game::IsChallengeOrDaily /* DB: Game _challenge 0x26584 or _dailyChallenge 0x26630 nonzero */ undefined1 __thiscall Game::IsChallengeOrDaily(Game *this) { if ((this->_challenge == 0) && ((this->_dailyChallenge)._id == 0)) { return 0; } return 1; } //@@ 006dae40 Entity_Pickup::GetChestLoot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: chest content picker with trinket modifiers (0x16,0x2d,0x2c), WeightedOutcomePicker; TryOpenChest */ undefined4 __thiscall Entity_Pickup::GetChestLoot (Entity_Pickup *this,undefined4 param_2,byte param_3,Entity_Player *param_4) { int *piVar1; code *pcVar2; RNG rng; RNG rng_00; RNG rng_01; RNG rng_02; RNG rng_03; RNG rng_04; RNG rng_05; byte bVar3; undefined4 uVar4; Entity_Player *pEVar5; RNG *pRVar6; uint lootSeed; void *pvVar7; void *pvVar8; uint uVar9; uint uVar10; WeightedOutcomePicker WVar11; int iVar12; undefined4 *puVar13; Game *game; RNG *lootRng; undefined4 uVar14; undefined4 uVar15; undefined4 local_178; undefined4 local_174; undefined4 local_170; undefined4 local_16c; undefined4 local_168; undefined4 local_164; undefined4 local_160; undefined4 local_15c; undefined4 local_158; undefined4 local_154; undefined4 local_150; undefined4 local_14c; undefined4 local_148; undefined4 local_144; undefined4 local_140; undefined4 local_13c; undefined4 local_138; undefined4 local_134; undefined4 local_130; undefined4 local_12c; undefined4 local_128; Entity_Player *local_124; RNG *childsHeartRng; RNG *matchStickRng; undefined4 returnLoot; RNG *daemonsTailRng; Entity_Pickup *pickup; undefined4 local_10c; Entity_Player *local_108; RNG *aceOfSpadesRng; RNG *safetyCapRng; uint local_fc; byte isDaemonsTailHeld; uint local_f4; uint collectibleFlags; char isRustedKeyProc; char isChildsHeartProc; char isMatchStickProc; char isAceOfSpadesProc; int *tmpLootProxy; void *tmpLootMap; int tmpLootMapSize; undefined4 tmpLootOffset; int tmpLootSize; undefined4 local_d4; Entity_Player *local_d0; char isStage11NonGreed; char isPokerChipActive; char local_c9; RNG *local_c8; char local_c1; undefined4 local_c0; RNG *local_bc; Game *local_b8; WeightedOutcomePicker outcomePicker; undefined4 *outcomesEnd; undefined4 *outcomesCapacityEnd; RNG dropRngCopy; RNG aceOfSpadesRngState; RNG safetyCapRngState; RNG childsHeartRngState; RNG rustedKeyRngState; RNG matchStickRngState; RNG local_48; uint trinketIds; RNG RStack_34; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; DeathmatchManager *deathmatch; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afada9; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; pRVar6 = &this->_dropRNG; local_bc = (RNG *)param_2; returnLoot = param_2; local_d0 = param_4; local_48._seed = pRVar6->_seed; local_48._shift1 = 1; local_48._shift2 = (int)&DAT_00000005; local_48._shift3 = 0x10; pickup = this; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16); daemonsTailRng = &local_48; aceOfSpadesRngState._shift1 = 1; aceOfSpadesRngState._shift2 = 5; aceOfSpadesRngState._seed = pRVar6->_seed; if (bVar3 == 0) { daemonsTailRng = (RNG *)0x0; } aceOfSpadesRngState._shift3 = 0x13; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x2d); aceOfSpadesRng = &aceOfSpadesRngState; safetyCapRngState._shift1 = 1; safetyCapRngState._shift2 = 9; safetyCapRngState._seed = pRVar6->_seed; if (bVar3 == 0) { aceOfSpadesRng = (RNG *)0x0; } safetyCapRngState._shift3 = 0x1d; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x2c); safetyCapRng = &safetyCapRngState; matchStickRngState._shift1 = 1; matchStickRngState._shift2 = 0xb; matchStickRngState._seed = pRVar6->_seed; if (bVar3 == 0) { safetyCapRng = (RNG *)0x0; } matchStickRngState._shift3 = 6; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x29); matchStickRng = &matchStickRngState; childsHeartRngState._shift1 = 1; childsHeartRngState._shift2 = 0xb; childsHeartRngState._seed = pRVar6->_seed; if (bVar3 == 0) { matchStickRng = (RNG *)0x0; } childsHeartRngState._shift3 = 0x10; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x22); childsHeartRng = &childsHeartRngState; rustedKeyRngState._shift1 = 1; rustedKeyRngState._shift2 = 0x13; rustedKeyRngState._seed = pRVar6->_seed; if (bVar3 == 0) { childsHeartRng = (RNG *)0x0; } rustedKeyRngState._shift3 = 3; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x24); tmpLootProxy = (int *)0x0; local_bc = &rustedKeyRngState; tmpLootMap = (void *)0x0; if (bVar3 == 0) { local_bc = (RNG *)0x0; } tmpLootMapSize = 0; tmpLootOffset = 0; tmpLootSize = 0; tmpLootProxy = operator_new(8); tmpLootProxy[1] = 0; *tmpLootProxy = (int)&tmpLootProxy; local_14 = 0; lootRng = &dropRngCopy; if (param_3 != 0) { lootRng = pRVar6; } collectibleFlags = param_3 ^ 1; dropRngCopy._seed = pRVar6->_seed; dropRngCopy._shift1 = (this->_dropRNG)._shift1; dropRngCopy._shift2 = (this->_dropRNG)._shift2; dropRngCopy._shift3 = (this->_dropRNG)._shift3; if (((pickup->_variant == 0x35) && (g_game->_stage != 0xb)) && ((uint)pickup->_subtype < 2)) { uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar4 = returnLoot; uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; if ((uVar9 & 3) == 0) { LootList::LootList(&tmpLootProxy); if (tmpLootSize != 0) { do { tmpLootSize = tmpLootSize + -1; } while (tmpLootSize != 0); tmpLootOffset = 0; tmpLootSize = 0; } pvVar7 = tmpLootMap; iVar12 = tmpLootMapSize; if (tmpLootMapSize != 0) { do { pvVar8 = *(void **)((int)pvVar7 + iVar12 * 4 + -4); iVar12 = iVar12 + -1; if (pvVar8 != (void *)0x0) { operator_delete(pvVar8,0x14); pvVar7 = tmpLootMap; } } while (iVar12 != 0); } if (pvVar7 != (void *)0x0) { uVar9 = tmpLootMapSize * 4; pvVar8 = pvVar7; if (0xfff < uVar9) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_006dc7b3; } operator_delete(pvVar8,uVar9); } piVar1 = tmpLootProxy; tmpLootMapSize = 0; tmpLootMap = (void *)0x0; tmpLootProxy = (int *)0x0; operator_delete(piVar1,8); ExceptionList = local_1c; return uVar4; } } isDaemonsTailHeld = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16); isAceOfSpadesProc = '\0'; local_c9 = '\0'; isChildsHeartProc = '\0'; isMatchStickProc = '\0'; isRustedKeyProc = '\0'; trinketIds = 0x2d; RStack_34._seed = 0x2c; RStack_34._shift1 = 0x22; RStack_34._shift2 = 0x29; RStack_34._shift3 = 0x24; local_fc = 0; local_b8 = g_game; do { uVar9 = (&trinketIds)[local_fc]; local_c8 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(uVar9 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)local_c8 >> 2) && (iVar12 = *(int *)((int)local_c8 + (uVar9 & 0x7fff) * 4), iVar12 != 0)) && ((*(uint *)(iVar12 + 0xb8) & 0x80000000) != 0)) { local_c1 = '\x01'; } else { local_c1 = '\0'; } puVar13 = (local_b8->_playerManager)._playerList._begin; local_f4 = uVar9; if (puVar13 != (local_b8->_playerManager)._playerList._end) { do { local_108 = (Entity_Player *)*puVar13; if (local_108->_variant == 0) { bVar3 = Entity_Player::HasTrinket(local_108,uVar9,0); if (bVar3 == 0) { if (((local_c1 == '\0') || (local_108->_backupPlayer == (Entity_Player *)0x0)) || (bVar3 = Entity_Player::HasTrinket (local_108->_backupPlayer,(&trinketIds)[local_fc],0), bVar3 == 0)) { uVar9 = local_f4; goto LAB_006db2ef; } pEVar5 = local_108->_backupPlayer; } else { pEVar5 = local_108; } uVar9 = local_f4; if (pEVar5 != (Entity_Player *)0x0) { if ((local_f4 == 0x22) && (isDaemonsTailHeld != 0)) { uVar10 = lootRng->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = lootRng->_seed; if (uVar10 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar10 = uVar10 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)lootRng->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)lootRng->_shift3 & 0x1f) ^ uVar10; lootRng->_seed = uVar10; if (uVar10 % 5 != 0) goto switchD_006db41f_caseD_23; } iVar12 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,uVar9); local_c8 = (void *)0x21; if (iVar12 == 2) { local_c8 = (void *)0x42; } else if (2 < iVar12) { local_c8 = (void *)0x64; } uVar10 = lootRng->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = lootRng->_seed; if (uVar10 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar10 = uVar10 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)lootRng->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)lootRng->_shift3 & 0x1f) ^ uVar10; lootRng->_seed = uVar10; if ((void *)(uVar10 % 100) < local_c8) { switch(uVar9) { case 0x22: isChildsHeartProc = '\x01'; local_b8 = g_game; goto LAB_006db495; case 0x24: isRustedKeyProc = '\x01'; local_b8 = g_game; goto LAB_006db495; case 0x29: isMatchStickProc = '\x01'; local_b8 = g_game; goto LAB_006db495; case 0x2c: local_c9 = '\x01'; local_b8 = g_game; goto LAB_006db495; case 0x2d: isAceOfSpadesProc = '\x01'; } } } switchD_006db41f_caseD_23: local_b8 = g_game; goto LAB_006db495; } LAB_006db2ef: puVar13 = puVar13 + 1; } while (puVar13 != (local_b8->_playerManager)._playerList._end); local_b8 = g_game; } LAB_006db495: game = local_b8; local_fc = local_fc + 1; } while (local_fc < 5); if ((((local_b8->_difficulty == 2) || (local_b8->_difficulty == 3)) || (local_b8->_stage != 0xb)) || (1 < *(int *)&local_b8->_deathmatchManager)) { deathmatch = &local_b8->_deathmatchManager; piVar1 = &local_b8->_startingRoomIdx; local_f4 = local_b8->_currentRoomIdx; isStage11NonGreed = '\0'; local_b8 = (Game *)*piVar1; if (*(int *)deathmatch < 2) goto LAB_006db512; LAB_006db536: if (local_d0 != (Entity_Player *)0x0) { bVar3 = Entity_Player::HasTrinket(local_d0,0x4c,0); if (bVar3 != 0) goto LAB_006db557; game = g_game; } LAB_006db5e9: isPokerChipActive = '\0'; local_c8 = (RNG *)((uint)local_c8 & 0xffffff00); } else { local_f4 = local_b8->_currentRoomIdx; isStage11NonGreed = '\x01'; local_b8 = (Game *)local_b8->_startingRoomIdx; LAB_006db512: bVar3 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x4c); if (bVar3 == 0) { game = g_game; if (1 < *(int *)&g_game->_deathmatchManager) goto LAB_006db536; goto LAB_006db5e9; } LAB_006db557: uVar9 = lootRng->_seed; isPokerChipActive = '\x01'; RStack_34._shift1 = 1; RStack_34._shift2 = 0x15; local_c8 = (RNG *)0x14; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar9 = uVar9 >> 1 ^ uVar9; uVar10 = uVar9 << 0x15 ^ uVar9; local_c8 = (RNG *)(CONCAT31((uint3)(uVar10 >> 0x1c),~(byte)(uVar10 >> 0x14) ^ (byte)uVar9) & 0xffffff01); game = g_game; } local_108 = (Entity_Player *)pickup->_variant; if (local_108 == (Entity_Player *)0x38) { local_48._shift1 = 0; local_48._shift2 = 0; local_48._shift3 = 0; local_14 = CONCAT31(local_14._1_3_,1); local_c0 = 0; local_bc = (RNG *)0x2; std::vector<8byte>::_Emplace_reallocate(0,&local_c0); uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 1) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 10; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006db6c0; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 1; local_bc = (RNG *)0xa; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_c0); } else { *(undefined4 *)local_48._shift2 = 1; *(undefined4 *)(local_48._shift2 + 4) = 10; local_48._shift2 = (int)(local_48._shift2 + 8); } LAB_006db6c0: uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 2) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 10; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006db72a; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 2; local_bc = (RNG *)0xa; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_c0); } else { *(undefined4 *)local_48._shift2 = 2; *(undefined4 *)(local_48._shift2 + 4) = 10; local_48._shift2 = (int)(local_48._shift2 + 8); } LAB_006db72a: uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; rng._shift1 = 5; rng._seed = uVar9; rng._shift2 = 9; rng._shift3 = 7; local_d0 = (Entity_Player *) WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)&local_48._shift1,rng); uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; local_fc = (uVar9 & 1) + 2; uVar10 = local_fc; if (local_d0 != (Entity_Player *)0x0) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; if (uVar9 == (uVar9 / 3) * 3) { uVar10 = local_fc; } else { bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x2a); uVar10 = local_fc; if (bVar3 != 0) { uVar10 = local_fc + 1; } } } if (isAceOfSpadesProc == '\0') { if (local_c9 != '\0') { uVar9 = safetyCapRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar9 = uVar9 >> ((byte)safetyCapRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)safetyCapRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)safetyCapRng->_shift3 & 0x1f) ^ uVar9; uVar4 = 0x46; goto LAB_006db911; } } else { uVar9 = aceOfSpadesRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar9 = uVar9 >> ((byte)aceOfSpadesRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)aceOfSpadesRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)aceOfSpadesRng->_shift3 & 0x1f) ^ uVar9; uVar4 = 300; LAB_006db911: std::deque::push_back(5,uVar4,0,uVar9,0); } pEVar5 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,199,(RNG **)&g_game->_playerManager,1); if (pEVar5 != (Entity_Player *)0x0) { uVar10 = uVar10 * 2; } if (isPokerChipActive == '\0') { LAB_006db955: uVar9 = lootRng->_seed; if (uVar10 == 0) goto LAB_006dba2b; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; rng_00._shift1 = 5; rng_00._seed = uVar9; rng_00._shift2 = 9; rng_00._shift3 = 7; uVar9 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)&local_48._shift1,rng_00); if (uVar9 == 0) { pRVar6 = (RNG *)RNG::Next(lootRng); game = g_game; if (isPokerChipActive == '\0') { local_c8 = pRVar6; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,0x1d,uVar9,collectibleFlags,0,0); uVar14 = 100; uVar4 = 5; pRVar6 = local_c8; } else { iVar12 = FUN_006ee640(0x1d,0,lootRng,collectibleFlags); uVar14 = 100; uVar4 = 5; } goto LAB_006dba6b; } if (uVar9 == 1) { do { uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)lootRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)lootRng->_shift3 & 0x1f) ^ uVar9; lootRng->_seed = uVar9; std::deque::push_back(5,300,0,uVar9,0); uVar10 = uVar10 - 1; } while (uVar10 != 0); } else if (uVar9 == 2) { do { uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)lootRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)lootRng->_shift3 & 0x1f) ^ uVar9; lootRng->_seed = uVar9; std::deque::push_back(5,0x46,0,uVar9,0); uVar10 = uVar10 - 1; } while (uVar10 != 0); } } else { if ((char)local_c8 != '\0') { uVar10 = uVar10 * 2; goto LAB_006db955; } uVar9 = lootRng->_seed; LAB_006dba2b: if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); pRVar6 = (RNG *)(uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f)); iVar12 = 0; uVar14 = 0; lootRng->_seed = (int)pRVar6; uVar4 = 0x12; LAB_006dba6b: std::deque::push_back(uVar4,uVar14,iVar12,pRVar6,0); } local_14 = local_14 & 0xffffff00; if ((WeightedOutcomePicker)local_48._shift1 != (WeightedOutcomePicker)0x0) { uVar9 = local_48._shift3 - local_48._shift1 & 0xfffffff8; WVar11 = (WeightedOutcomePicker)local_48._shift1; if (0xfff < uVar9) { WVar11 = *(WeightedOutcomePicker *)(local_48._shift1 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (local_48._shift1 - (int)WVar11) - 4U) goto LAB_006dc7b3; } operator_delete((void *)WVar11,uVar9); } goto LAB_006ddbc9; } if (local_108 != (Entity_Player *)0x168) { if (local_108 == (Entity_Player *)0x186) { if (((g_manager->_persistentGameData)._achievements[0x19f] == 0) && (((g_manager->_state != 2 || (game == (Game *)0x0)) || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 0x244; } else { local_c8 = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,0xf,uVar9,collectibleFlags,0,0); pRVar6 = local_c8; } goto LAB_006ddbba; } if (local_108 != (Entity_Player *)&DAT_00000037) { if (local_108 != (Entity_Player *)0x45) { if (((local_108 == (Entity_Player *)&DAT_0000003c) || (local_108 == (Entity_Player *)&DAT_00000033)) || ((local_108 == (Entity_Player *)0x35 || (local_c1 = '\0', local_108 == (Entity_Player *)0x39)))) { local_c1 = '\x01'; } if (isStage11NonGreed == '\0') { if (local_108 == (Entity_Player *)0x39) { uVar9 = RNG::RandomInt(lootRng,2); if (uVar9 == 0) goto LAB_006ddb2c; game = g_game; } local_48._shift1 = 0; local_48._shift2 = 0; local_48._shift3 = 0; local_f4 = (uint)(local_108 == (Entity_Player *)0x39) * 4 + 1; local_14._0_1_ = 5; if ((local_c1 == '\0') || (bVar3 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x9f), bVar3 == 0)) { local_d4 = 0; local_d0 = (Entity_Player *)0xa; std::vector<8byte>::_Emplace_reallocate(0,&local_d4); pEVar5 = local_108; if (local_108 != (Entity_Player *)0x39) { uVar9 = 0; local_b8 = (Game *)(local_48._shift2 - local_48._shift1 >> 3); if (local_b8 != (Game *)0x0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 1) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dcec4; } uVar9 = uVar9 + 1; } while (uVar9 < local_b8); } local_d4 = 1; local_d0 = (Entity_Player *)0x1; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_d4); } else { *(undefined4 *)local_48._shift2 = 1; *(undefined4 *)(local_48._shift2 + 4) = 1; local_48._shift2 = local_48._shift2 + 8; } LAB_006dcec4: uVar9 = 0; local_b8 = (Game *)(local_48._shift2 - local_48._shift1 >> 3); if (local_b8 != (Game *)0x0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 2) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dcf45; } uVar9 = uVar9 + 1; } while (uVar9 < local_b8); } local_d4 = 2; local_d0 = (Entity_Player *)0x1; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_d4); } else { *(undefined4 *)local_48._shift2 = 2; *(undefined4 *)(local_48._shift2 + 4) = 1; local_48._shift2 = local_48._shift2 + 8; } } LAB_006dcf45: if (local_c1 == '\0') { WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&local_48._shift1,4,10,0); WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&local_48._shift1,3,0x4e,0); } else { uVar9 = 0; local_b8 = (Game *)(local_48._shift2 - local_48._shift1 >> 3); if (local_b8 != (Game *)0x0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 5) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 10; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dcfd4; } uVar9 = uVar9 + 1; } while (uVar9 < local_b8); } local_d4 = 5; local_d0 = (Entity_Player *)0xa; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_d4); } else { *(undefined4 *)local_48._shift2 = 5; *(undefined4 *)(local_48._shift2 + 4) = 10; local_48._shift2 = local_48._shift2 + 8; } LAB_006dcfd4: if (pEVar5 != (Entity_Player *)0x39) { uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 6) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x14; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dd046; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_d4 = 6; local_d0 = (Entity_Player *)&DAT_00000014; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_d4); } else { *(undefined4 *)local_48._shift2 = 6; *(undefined4 *)(local_48._shift2 + 4) = 0x14; local_48._shift2 = local_48._shift2 + 8; } } LAB_006dd046: uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 3) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x3a; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dd0cb; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_d4 = 3; local_d0 = (Entity_Player *)0x3a; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_d4); } else { *(undefined4 *)local_48._shift2 = 3; *(undefined4 *)(local_48._shift2 + 4) = 0x3a; local_48._shift2 = local_48._shift2 + 8; } } } else { local_d4 = 7; local_d0 = (Entity_Player *)&DAT_00000050; std::vector<8byte>::_Emplace_reallocate(0,&local_d4); if (local_108 != (Entity_Player *)0x39) { uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 6) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x14; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dd0cb; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_d4 = 6; local_d0 = (Entity_Player *)&DAT_00000014; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_d4); } else { *(undefined4 *)local_48._shift2 = 6; *(undefined4 *)(local_48._shift2 + 4) = 0x14; local_48._shift2 = local_48._shift2 + 8; } } } LAB_006dd0cb: local_fc = 0; do { uVar9 = RNG::Next(lootRng); rng_04._shift1 = 5; rng_04._seed = uVar9; rng_04._shift2 = 9; rng_04._shift3 = 7; uVar9 = WeightedOutcomePicker::PickOutcome ((WeightedOutcomePicker *)&local_48._shift1,rng_04); switch(uVar9) { case 0: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x15e; break; case 1: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x32; break; case 2: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x3c; break; case 3: case 7: uVar10 = 4; if (local_c1 != '\0') { uVar10 = 7; } uVar10 = RNG::RandomInt(lootRng,uVar10); local_b8 = (Game *)2; if (2 < (int)uVar10) { local_b8 = (Game *)uVar10; } if (isAceOfSpadesProc == '\0') { if (local_c9 != '\0') { uVar10 = RNG::Next(safetyCapRng); uVar4 = 0x46; goto LAB_006dd20c; } if (isMatchStickProc != '\0') { uVar10 = RNG::Next(matchStickRng); uVar4 = 0x28; goto LAB_006dd20c; } if (isChildsHeartProc != '\0') { uVar10 = RNG::Next(childsHeartRng); uVar4 = 10; goto LAB_006dd20c; } if (isRustedKeyProc != '\0') { uVar10 = RNG::Next(local_bc); uVar4 = 0x1e; goto LAB_006dd20c; } } else { uVar10 = RNG::Next(aceOfSpadesRng); uVar4 = 300; LAB_006dd20c: std::deque::push_back(5,uVar4,0,uVar10,0); } uVar10 = RNG::RandomInt(lootRng,3); if ((uVar10 != 0) && (bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x2a), bVar3 != 0) ) { local_b8 = (Game *)((int)local_b8 + 1); } pEVar5 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,199,(RNG **)&g_game->_playerManager,1); if (pEVar5 != (Entity_Player *)0x0) { local_b8 = (Game *)((int)local_b8 * 2); } if (isPokerChipActive != '\0') { uVar10 = (int)local_b8 * 2; if ((char)local_c8 == '\0') { uVar10 = 0; } local_b8 = (Game *)uVar10; if (uVar10 == 0) { lootSeed = RNG::Next(lootRng); std::deque::push_back(0x12,0,0,lootSeed,uVar10); local_b8 = (Game *)0x0; } } outcomePicker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacityEnd = (undefined4 *)0x0; local_14 = CONCAT31(local_14._1_3_,6); if (uVar9 == 7) { local_10c = 0; local_108 = (Entity_Player *)0x19; std::vector<8byte>::_Emplace_reallocate(0,&local_10c); local_d0 = (Entity_Player *)&DAT_00000014; if (daemonsTailRng != (RNG *)0x0) { local_d0 = (Entity_Player *)&DAT_00000004; } uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 1) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = (int)(&(local_d0->_sprite)._filename + -3) + *piVar1; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd3b2; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_128 = 1; local_124 = local_d0; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_128); } else { *outcomesEnd = 1; outcomesEnd[1] = local_d0; outcomesEnd = outcomesEnd + 2; } LAB_006dd3b2: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 2) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 10; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd42f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_130 = 2; local_12c = 10; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_130); } else { *outcomesEnd = 2; outcomesEnd[1] = 10; outcomesEnd = outcomesEnd + 2; } LAB_006dd42f: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 3) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x14; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd4af; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_138 = 3; local_134 = 0x14; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_138); } else { *outcomesEnd = 3; outcomesEnd[1] = 0x14; outcomesEnd = outcomesEnd + 2; } LAB_006dd4af: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 4) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd52f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_140 = 4; local_13c = 5; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_140); } else { *outcomesEnd = 4; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } LAB_006dd52f: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 5) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd5af; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_148 = 5; local_144 = 5; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_148); } else { *outcomesEnd = 5; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } LAB_006dd5af: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 6) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd62f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_150 = 6; local_14c = 5; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_150); } else { *outcomesEnd = 6; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } LAB_006dd62f: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 7) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd6af; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_158 = 7; local_154 = 5; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_158); } else { *outcomesEnd = 7; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } LAB_006dd6af: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 8) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd86b; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_160 = 8; local_15c = 5; if (outcomesEnd == outcomesCapacityEnd) { puVar13 = &local_160; goto LAB_006dd85a; } *outcomesEnd = 8; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } else { local_168 = 0; local_164 = 0x23; std::vector<8byte>::_Emplace_reallocate(0,&local_168); iVar12 = 0x14; if (daemonsTailRng != (RNG *)0x0) { iVar12 = 4; } WeightedOutcomePicker::AddOutcomeWeight(&outcomePicker,1,iVar12,0); uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 2) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xf; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd7f5; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_170 = 2; local_16c = 0xf; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_170); } else { *outcomesEnd = 2; outcomesEnd[1] = 0xf; outcomesEnd = outcomesEnd + 2; } LAB_006dd7f5: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 3) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x1e; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dd86b; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_178 = 3; local_174 = 0x1e; if (outcomesEnd == outcomesCapacityEnd) { puVar13 = &local_178; LAB_006dd85a: std::vector<8byte>::_Emplace_reallocate(outcomesEnd,puVar13); } else { *outcomesEnd = 3; outcomesEnd[1] = 0x1e; outcomesEnd = outcomesEnd + 2; } } LAB_006dd86b: if (0 < (int)local_b8) { do { uVar9 = RNG::Next(lootRng); rng_05._shift1 = 5; rng_05._seed = uVar9; rng_05._shift2 = 9; rng_05._shift3 = 7; uVar9 = WeightedOutcomePicker::PickOutcome(&outcomePicker,rng_05); switch(uVar9) { case 0: uVar9 = RNG::RandomInt(lootRng,3); iVar12 = uVar9 + 1; if (0 < iVar12) { do { uVar9 = RNG::Next(lootRng); std::deque::push_back(5,0x14,0,uVar9,0); iVar12 = iVar12 + -1; } while (iVar12 != 0); } goto switchD_006dd8b7_default; case 1: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 10; break; case 2: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x1e; break; case 3: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x28; break; case 4: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x46; break; case 5: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 300; break; case 6: local_d0 = (Entity_Player *)RNG::Next(lootRng); uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCardEx(uVar9,0,1,0,1); RStack_34._shift1 = 5; RStack_34._shift2 = 9; RStack_34._shift3 = 7; RStack_34._seed = uVar9; iVar12 = lua_callback_run_get_card(&RStack_34,iVar12,0,1,1); uVar4 = 300; pEVar5 = local_d0; break; case 7: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x15e; break; case 8: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x5a; break; default: goto switchD_006dd8b7_default; } std::deque::push_back(5,uVar4,iVar12,pEVar5,0); switchD_006dd8b7_default: local_b8 = (Game *)((int)local_b8 - 1); } while (local_b8 != (Game *)0x0); local_b8 = (Game *)0x0; } local_14._0_1_ = 5; if (outcomePicker != (WeightedOutcomePicker)0x0) { deallocate((void *)outcomePicker,(int)outcomesCapacityEnd - (int)outcomePicker >> 3) ; outcomePicker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacityEnd = (undefined4 *)0x0; } goto switchD_006dd10b_default; case 4: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x46; break; case 5: pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 300; break; case 6: if (isPokerChipActive == '\0') { local_d0 = (Entity_Player *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,8,uVar9,collectibleFlags,0,0); pEVar5 = local_d0; } else { local_d0 = (Entity_Player *)0x0; if (pickup->_variant == 0x35) { local_d0 = (Entity_Player *)&DAT_00000004; } pEVar5 = (Entity_Player *)RNG::Next(lootRng); iVar12 = FUN_006ee640(8,local_d0,lootRng,collectibleFlags); } uVar4 = 100; break; default: goto switchD_006dd10b_default; } std::deque::push_back(5,uVar4,iVar12,pEVar5,0); switchD_006dd10b_default: local_fc = local_fc + 1; } while ((int)local_fc < (int)local_f4); local_14 = (uint)local_14._1_3_ << 8; if ((WeightedOutcomePicker)local_48._shift1 != (WeightedOutcomePicker)0x0) { deallocate((void *)local_48._shift1,local_48._shift3 - local_48._shift1 >> 3); } goto LAB_006ddbc9; } LAB_006ddb2c: local_bc = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,0,uVar9,collectibleFlags,0,0); std::deque::push_back(5,100,iVar12,local_bc,0); if (local_108 != (Entity_Player *)0x39) goto LAB_006ddbc9; local_bc = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,0,uVar9,collectibleFlags,0,0); pRVar6 = local_bc; goto LAB_006ddbb9; } outcomePicker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacityEnd = (undefined4 *)0x0; local_14 = CONCAT31(local_14._1_3_,4); local_c0 = 0x28; local_bc = (RNG *)&DAT_0000000f; if (pickup->_subtype == 2) { std::vector<8byte>::_Emplace_reallocate(0,&local_c0); uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0x6000a) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 10; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dc8a2; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 0x6000a; local_bc = (RNG *)0xa; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 0x6000a; outcomesEnd[1] = 10; outcomesEnd = outcomesEnd + 2; } LAB_006dc8a2: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0xb000a) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dc922; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 0xb000a; local_bc = (RNG *)&DAT_00000005; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 0xb000a; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } LAB_006dc922: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0x46) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xf; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dcb9c; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 0x46; local_bc = (RNG *)&DAT_0000000f; if (outcomesEnd == outcomesCapacityEnd) goto LAB_006dcb83; *outcomesEnd = 0x46; outcomesEnd[1] = 0xf; outcomesEnd = outcomesEnd + 2; } else { std::vector<8byte>::_Emplace_reallocate(0,&local_c0); uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0x1e) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x14; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dca1f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 0x1e; local_bc = (RNG *)&DAT_00000014; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 0x1e; outcomesEnd[1] = 0x14; outcomesEnd = outcomesEnd + 2; } LAB_006dca1f: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0x14) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xf; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dca9f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 0x14; local_bc = (RNG *)&DAT_0000000f; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 0x14; outcomesEnd[1] = 0xf; outcomesEnd = outcomesEnd + 2; } LAB_006dca9f: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0x5a) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 4; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dcb1f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 0x5a; local_bc = (RNG *)&DAT_00000004; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 0x5a; outcomesEnd[1] = 4; outcomesEnd = outcomesEnd + 2; } LAB_006dcb1f: uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 300) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 4; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dcb9c; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 300; local_bc = (RNG *)&DAT_00000004; if (outcomesEnd == outcomesCapacityEnd) { LAB_006dcb83: std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 300; outcomesEnd[1] = 4; outcomesEnd = outcomesEnd + 2; } } LAB_006dcb9c: WVar11 = outcomePicker; uVar9 = RNG::RandomInt(lootRng,2); local_d0 = (Entity_Player *)(uVar9 + 2); if (0 < (int)local_d0) { do { uVar9 = RNG::Next(lootRng); rng_03._shift1 = 5; rng_03._seed = uVar9; rng_03._shift2 = 9; rng_03._shift3 = 7; uVar9 = WeightedOutcomePicker::PickOutcome(&outcomePicker,rng_03); local_c8 = (RNG *)(uVar9 & 0xffff); RNG::Next(lootRng); uVar10 = RNG::Next(lootRng); std::deque::push_back(5,local_c8,uVar9 >> 0x10,uVar10,0); if ((pickup->_subtype == 2) && (local_c8 == (RNG *)0xa)) { uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0x6000a) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + -10; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } break; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); uVar9 = 0; do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 0xb000a) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + -5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } break; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } } local_d0 = (Entity_Player *)((int)&local_d0[-1]._replacedPlayer + 3); WVar11 = outcomePicker; } while (local_d0 != (Entity_Player *)0x0); } local_14 = local_14 & 0xffffff00; if (WVar11 != (WeightedOutcomePicker)0x0) { deallocate((void *)WVar11,(int)outcomesCapacityEnd - (int)WVar11 >> 3); } goto LAB_006ddbc9; } local_48._shift1 = 0; local_48._shift2 = 0; local_48._shift3 = 0; local_bc = (RNG *)&DAT_0000002b; local_14 = CONCAT31(local_14._1_3_,3); if (daemonsTailRng != (RNG *)0x0) { local_bc = (RNG *)&DAT_00000009; } local_c0 = 0; std::vector<8byte>::_Emplace_reallocate(0,&local_c0); uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 1) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0x2a; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dc520; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 1; local_bc = (RNG *)&DAT_0000002a; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_c0); } else { *(undefined4 *)local_48._shift2 = 1; *(undefined4 *)(local_48._shift2 + 4) = 0x2a; local_48._shift2 = local_48._shift2 + 8; } LAB_006dc520: uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 2) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 10; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dc590; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 2; local_bc = (RNG *)0xa; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_c0); } else { *(undefined4 *)local_48._shift2 = 2; *(undefined4 *)(local_48._shift2 + 4) = 10; local_48._shift2 = local_48._shift2 + 8; } LAB_006dc590: uVar9 = 0; uVar10 = local_48._shift2 - local_48._shift1 >> 3; if (uVar10 != 0) { do { if (*(int *)(local_48._shift1 + uVar9 * 8) == 3) { piVar1 = (int *)(local_48._shift1 + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)(local_48._shift1 + 4 + uVar9 * 8) = 0; } goto LAB_006dc5fa; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 3; local_bc = (RNG *)&DAT_00000005; if (local_48._shift2 == local_48._shift3) { std::vector<8byte>::_Emplace_reallocate(local_48._shift2,&local_c0); } else { *(undefined4 *)local_48._shift2 = 3; *(undefined4 *)(local_48._shift2 + 4) = 5; local_48._shift2 = local_48._shift2 + 8; } LAB_006dc5fa: uVar9 = RNG::Next(lootRng); rng_02._shift1 = 5; rng_02._seed = uVar9; rng_02._shift2 = 9; rng_02._shift3 = 7; uVar9 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)&local_48._shift1,rng_02); switch(uVar9) { case 0: uVar9 = RNG::RandomInt(lootRng,3); iVar12 = uVar9 + 1; if (0 < iVar12) { do { uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)lootRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)lootRng->_shift3 & 0x1f) ^ uVar9; lootRng->_seed = uVar9; std::deque::push_back(5,10,3,uVar9,0); iVar12 = iVar12 + -1; } while (iVar12 != 0); } break; case 1: iVar12 = 3; do { uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)lootRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)lootRng->_shift3 & 0x1f) ^ uVar9; lootRng->_seed = uVar9; std::deque::push_back(5,0x15e,0,uVar9,0); iVar12 = iVar12 + -1; } while (iVar12 != 0); break; case 2: local_c8 = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = 0x1b; goto LAB_006dc757; case 3: local_c8 = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = 4; LAB_006dc757: iVar12 = ItemPool::GetCollectible(&game->_itemPool,iVar12,uVar9,collectibleFlags,0,0); std::deque::push_back(5,100,iVar12,local_c8,0); } local_14 = local_14 & 0xffffff00; if ((WeightedOutcomePicker)local_48._shift1 == (WeightedOutcomePicker)0x0) goto LAB_006ddbc9; uVar9 = local_48._shift3 - local_48._shift1 & 0xfffffff8; WVar11 = (WeightedOutcomePicker)local_48._shift1; if (0xfff < uVar9) { WVar11 = *(WeightedOutcomePicker *)(local_48._shift1 + -4); iVar12 = local_48._shift1 - (int)WVar11; goto joined_r0x006dc7ad; } goto LAB_006dc3b3; } if ((isStage11NonGreed != '\0') && (local_b8 == (Game *)local_f4)) { local_c8 = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,3,uVar9,collectibleFlags | 0x200,0,0); pRVar6 = local_c8; LAB_006ddbb9: LAB_006ddbba: std::deque::push_back(5,100,iVar12,pRVar6,0); goto LAB_006ddbc9; } if ((game->_currentRoomIdx == -1) || (local_c9 = '\x01', game->_currentRoomIdx == -0xc)) { local_c9 = '\0'; } outcomePicker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacityEnd = (undefined4 *)0x0; local_14 = CONCAT31(local_14._1_3_,2); local_c0 = 0; local_bc = (RNG *)0xa; std::vector<8byte>::_Emplace_reallocate(0,&local_c0); if (local_c9 != '\0') { uVar9 = 0; uVar10 = (int)outcomesEnd - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 1) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 5; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dbce1; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 1; local_bc = (RNG *)&DAT_00000005; if (outcomesEnd == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&local_c0); } else { *outcomesEnd = 1; outcomesEnd[1] = 5; outcomesEnd = outcomesEnd + 2; } } LAB_006dbce1: puVar13 = outcomesEnd; if (local_d0 == (Entity_Player *)0x0) { LAB_006dbcfd: uVar9 = 0; uVar10 = (int)puVar13 - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 2) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xd; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dbd7f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 2; local_bc = (RNG *)&DAT_0000000d; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); puVar13 = outcomesEnd; } else { *puVar13 = 2; puVar13[1] = 0xd; puVar13 = puVar13 + 2; outcomesEnd = puVar13; } } else { iVar12 = Entity_Player::GetTrinketMultiplier(local_d0,0x3d); if (iVar12 < 3) goto LAB_006dbcfd; } LAB_006dbd7f: uVar9 = 0; uVar10 = (int)puVar13 - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 3) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xd; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dbdff; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 3; local_bc = (RNG *)&DAT_0000000d; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); puVar13 = outcomesEnd; } else { *puVar13 = 3; puVar13[1] = 0xd; outcomesEnd = puVar13 + 2; puVar13 = outcomesEnd; } LAB_006dbdff: uVar9 = 0; uVar10 = (int)puVar13 - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 4) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 7; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dbe7f; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 4; local_bc = (RNG *)&DAT_00000007; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); puVar13 = outcomesEnd; } else { *puVar13 = 4; puVar13[1] = 7; outcomesEnd = puVar13 + 2; puVar13 = outcomesEnd; } LAB_006dbe7f: uVar9 = 0; uVar10 = (int)puVar13 - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 5) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 7; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dbeff; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 5; local_bc = (RNG *)&DAT_00000007; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); puVar13 = outcomesEnd; } else { *puVar13 = 5; puVar13[1] = 7; outcomesEnd = puVar13 + 2; puVar13 = outcomesEnd; } LAB_006dbeff: local_c8 = (RNG *)&DAT_0000000f; if (isDaemonsTailHeld != 0) { local_c8 = (RNG *)0x3; } uVar10 = (int)puVar13 - (int)outcomePicker >> 3; uVar9 = 0; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 6) { pvVar7 = (void *)((int)outcomePicker + uVar9 * 8); piVar1 = (int *)((int)pvVar7 + 4); *piVar1 = (int)((int)&local_c8->_seed + *piVar1); if (*piVar1 < 0) { *(undefined4 *)((int)pvVar7 + 4) = 0; } goto LAB_006dbf99; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 6; local_bc = local_c8; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); puVar13 = outcomesEnd; } else { *puVar13 = 6; puVar13[1] = local_c8; outcomesEnd = puVar13 + 2; puVar13 = outcomesEnd; } LAB_006dbf99: uVar9 = 0; uVar10 = (int)puVar13 - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 7) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xf; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dc015; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 7; local_bc = (RNG *)&DAT_0000000f; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); puVar13 = outcomesEnd; } else { *puVar13 = 7; puVar13[1] = 0xf; outcomesEnd = puVar13 + 2; puVar13 = outcomesEnd; } LAB_006dc015: uVar9 = 0; uVar10 = (int)puVar13 - (int)outcomePicker >> 3; if (uVar10 != 0) { do { if (*(int *)((int)outcomePicker + uVar9 * 8) == 8) { piVar1 = (int *)((int)outcomePicker + 4 + uVar9 * 8); *piVar1 = *piVar1 + 0xf; if (*piVar1 < 0) { *(undefined4 *)((int)outcomePicker + 4 + uVar9 * 8) = 0; } goto LAB_006dc085; } uVar9 = uVar9 + 1; } while (uVar9 < uVar10); } local_c0 = 8; local_bc = (RNG *)&DAT_0000000f; if (puVar13 == outcomesCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(puVar13,&local_c0); } else { *puVar13 = 8; puVar13[1] = 0xf; outcomesEnd = puVar13 + 2; } LAB_006dc085: uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; rng_01._shift1 = 5; rng_01._seed = uVar9; rng_01._shift2 = 9; rng_01._shift3 = 7; uVar9 = WeightedOutcomePicker::PickOutcome(&outcomePicker,rng_01); switch(uVar9) { case 0: local_c8 = (RNG *)RNG::Next(lootRng); game = g_game; uVar9 = RNG::Next(lootRng); iVar12 = ItemPool::GetCollectible(&game->_itemPool,9,uVar9,collectibleFlags,0,0); uVar4 = 100; pRVar6 = local_c8; goto LAB_006dc2ec; case 1: uVar15 = 0; pRVar6 = (RNG *)0x0; iVar12 = 0; uVar4 = 1; uVar14 = 0; break; case 2: uVar4 = 0; uVar9 = RNG::Next(lootRng); std::deque::push_back(0x55,0,0,uVar9,uVar4); uVar15 = 0; pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0; uVar14 = 0x55; break; case 3: uVar15 = 0; pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 4; uVar14 = 4; break; case 4: uVar4 = 0; uVar9 = RNG::Next(lootRng); std::deque::push_back(3,0x2b,0,uVar9,uVar4); uVar4 = 0; uVar9 = RNG::Next(lootRng); std::deque::push_back(3,0x2b,0,uVar9,uVar4); uVar15 = 0; pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x2b; uVar14 = 3; break; case 5: uVar4 = 0; uVar9 = RNG::Next(lootRng); std::deque::push_back(3,0x49,0,uVar9,uVar4); uVar4 = 0; uVar9 = RNG::Next(lootRng); std::deque::push_back(3,0x49,0,uVar9,uVar4); uVar15 = 0; pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x49; uVar14 = 3; break; case 6: uVar9 = RNG::Next(lootRng); std::deque::push_back(5,10,3,uVar9,0); uVar9 = RNG::RandomInt(lootRng,2); if ((uVar9 == 0) && ((daemonsTailRng == (RNG *)0x0 || (uVar9 = RNG::RandomInt(daemonsTailRng,5), uVar9 == 0)))) { pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 3; uVar4 = 10; goto LAB_006dc2ec; } goto switchD_006dc0ee_default; case 7: uVar9 = RNG::Next(lootRng); std::deque::push_back(5,0x28,3,uVar9,0); pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 3; uVar4 = 0x28; goto LAB_006dc2ec; case 8: uVar9 = RNG::Next(lootRng); std::deque::push_back(5,0x46,0,uVar9,0); pRVar6 = (RNG *)RNG::Next(lootRng); iVar12 = 0; uVar4 = 0x46; LAB_006dc2ec: uVar15 = 0; uVar14 = 5; break; default: goto switchD_006dc0ee_default; } std::deque::push_back(uVar14,uVar4,iVar12,pRVar6,uVar15); switchD_006dc0ee_default: if ((local_d0 != (Entity_Player *)0x0) && (iVar12 = Entity_Player::GetTrinketMultiplier(local_d0,0x3d), 1 < iVar12)) { uVar9 = lootRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = lootRng->_seed; if (uVar9 == 0) { pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } } uVar9 = uVar9 >> ((byte)lootRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)lootRng->_shift2 & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)lootRng->_shift3 & 0x1f); lootRng->_seed = uVar9; if ((uVar9 & 1) == 0) { uVar9 = RNG::Next(lootRng); uVar4 = 0x46; } else { uVar9 = RNG::Next(lootRng); uVar4 = 10; } std::deque::push_back(5,uVar4,3,uVar9,0); } local_14 = local_14 & 0xffffff00; if (outcomePicker != (WeightedOutcomePicker)0x0) { uVar9 = (int)outcomesCapacityEnd - (int)outcomePicker & 0xfffffff8; WVar11 = outcomePicker; if (0xfff < uVar9) { WVar11 = *(WeightedOutcomePicker *)((int)outcomePicker + -4); iVar12 = (int)outcomePicker - (int)WVar11; joined_r0x006dc7ad: uVar9 = uVar9 + 0x23; if (0x1f < iVar12 - 4U) { LAB_006dc7b3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_006dc3b3: operator_delete((void *)WVar11,uVar9); } LAB_006ddbc9: LootList::LootList(&tmpLootProxy); std::deque::clear(); piVar1 = tmpLootProxy; tmpLootProxy = (int *)0x0; operator_delete(piVar1,8); ExceptionList = local_1c; return returnLoot; } //@@ 006ddcd0 Pickup_PickVariant /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: random pickup variant/subtype picker; Daemon's Tail reroll (items sweep 10) */ undefined4 Pickup_PickVariant(uint *param_1,Entity_Player *param_2,undefined4 param_3) { void *pvVar1; code *pcVar2; RNG rng; RNG rng_00; RNG rng_01; RNG rng_02; bool bVar3; byte bVar4; undefined4 uVar5; uint uVar6; Entity_Player *pEVar7; Entity_Player *pEVar8; RoomDescriptor *pRVar9; float fVar10; int *piVar11; Entity_Player *in_ECX; WeightedOutcomePicker WVar12; void *pvVar13; uint *in_EDX; uint extraout_EDX; int iVar14; uint uVar15; uint *puVar16; Game *pGVar17; PlayerManager *pPVar18; RNG aRStackY_9b8 [128]; int iVar19; undefined4 *puVar20; undefined4 *puVar21; undefined4 local_17c; undefined4 local_178; undefined4 local_174; undefined4 local_170; undefined4 local_16c; undefined4 local_168; uint local_164; undefined8 uStack_160; int iStack_158; undefined4 local_154; undefined4 local_150; undefined4 local_14c; undefined4 local_148; undefined4 local_144; undefined4 local_140; undefined4 local_13c; undefined4 local_138; undefined4 local_134; undefined4 local_130; undefined4 local_12c; undefined4 local_128; undefined4 local_124; undefined4 local_120; undefined4 local_11c; undefined4 local_118; undefined4 local_114; undefined4 local_110; undefined4 local_10c; undefined4 local_108; undefined4 local_104; undefined4 local_100; undefined4 local_fc; undefined4 local_f8; undefined4 local_f4; undefined4 local_f0; undefined4 local_ec; undefined4 local_e8; undefined4 local_e4; undefined4 local_e0; undefined4 local_dc; undefined4 local_d8; undefined4 local_d4; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; undefined4 local_a8; uint local_a4; WeightedOutcomePicker local_a0; undefined4 *local_9c; undefined4 *local_98; WeightedOutcomePicker local_94; undefined4 *local_90; undefined4 *local_8c; Entity_Player *local_88; Entity_Player *local_84; float local_80; WeightedOutcomePicker local_7c; undefined4 *local_78; undefined4 *local_74; RNG local_70; bool local_5d; WeightedOutcomePicker local_5c; undefined4 *local_58; undefined4 *local_54; byte local_4d; uint *local_4c; uint local_48; RNG local_44; RNG local_34; RNG local_24; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afae0b; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; DAT_00c7ec68 = DAT_00c7ec68 + 1; local_70._shift1 = 5; local_70._shift2 = 9; local_80 = 9.80909e-45; local_70._shift3 = 7; local_88 = in_ECX; local_70._seed = (int)in_ECX; local_4c = in_EDX; if (*in_EDX == 0) { if (in_ECX == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar5 = (*pcVar2)(); return uVar5; } uVar6 = (uint)in_ECX >> 5 ^ (uint)in_ECX; uVar6 = uVar6 << 9 ^ uVar6; local_84 = (Entity_Player *)(uVar6 >> 7 ^ uVar6); local_80 = 2.8026e-44; local_70._seed = (int)local_84; if (local_84 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar5 = (*pcVar2)(); return uVar5; } uVar6 = (uint)local_84 >> 1 ^ (uint)local_84; uVar6 = uVar6 << 0x15 ^ uVar6; uVar6 = uVar6 >> 0x14 ^ uVar6; local_58 = (undefined4 *)0x0; local_5c = (WeightedOutcomePicker)0x0; local_54 = (undefined4 *)0x0; local_a4 = *param_1; local_80 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10; local_8 = 0; if (local_a4 != 3) { local_ac = 0x14; local_a8 = 0x14; std::vector<8byte>::_Emplace_reallocate(); } uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 10) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 0xf; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006ddea3; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_b4 = 10; local_b0 = 0xf; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 10; local_58[1] = 0xf; local_58 = local_58 + 2; } LAB_006ddea3: uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x1e) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 0xf; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006ddf15; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_bc = 0x1e; local_b8 = 0xf; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x1e; local_58[1] = 0xf; local_58 = local_58 + 2; } LAB_006ddf15: uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x28) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 0xf; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006ddf87; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_c4 = 0x28; local_c0 = 0xf; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x28; local_58[1] = 0xf; local_58 = local_58 + 2; } LAB_006ddf87: uVar6 = *param_1; if (((uVar6 != 1) && (uVar6 != 3)) && (uVar6 != 4)) { uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x32) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 5; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de016; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_cc = 0x32; local_c8 = 5; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x32; local_58[1] = 5; local_58 = local_58 + 2; } LAB_006de016: uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x3c) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 5; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de088; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_d4 = 0x3c; local_d0 = 5; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x3c; local_58[1] = 5; local_58 = local_58 + 2; } } LAB_006de088: uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x46) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 4; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de101; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_dc = 0x46; local_d8 = 4; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x46; local_58[1] = 4; local_58 = local_58 + 2; } LAB_006de101: uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 300) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 4; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de176; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_e4 = 300; local_e0 = 4; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 300; local_58[1] = 4; local_58 = local_58 + 2; } LAB_006de176: uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x5a) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 2; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de1e8; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_174 = 0x5a; local_170 = 2; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x5a; local_58[1] = 2; local_58 = local_58 + 2; } LAB_006de1e8: if (*param_1 != 4) { uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 0x15e) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de264; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_16c = 0x15e; local_168 = 1; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 0x15e; local_58[1] = 1; local_58 = local_58 + 2; } } LAB_006de264: if (*param_1 == 0) { uVar6 = 0; local_48 = (int)local_58 - (int)local_5c >> 3; if (local_48 != 0) { do { if (*(int *)((int)local_5c + uVar6 * 8) == 100) { piVar11 = (int *)((int)local_5c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)local_5c + 4 + uVar6 * 8) = 0; } goto LAB_006de2db; } uVar6 = uVar6 + 1; } while (uVar6 < local_48); } local_14c = 100; local_148 = 1; if (local_58 == local_54) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_58 = 100; local_58[1] = 1; local_58 = local_58 + 2; } } LAB_006de2db: rng._shift1 = 5; rng._seed = (int)local_84; rng._shift2 = 9; rng._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&local_5c,rng); *in_EDX = uVar6; *param_1 = 0; if ((*in_EDX == 10) && (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16), bVar4 != 0)) { uStack_160 = 0x300000006; local_48 = 0x11; iStack_158 = 0x11; if (local_84 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar5 = (*pcVar2)(); return uVar5; } local_164 = (uint)local_84 >> 6 ^ (uint)local_84; local_164 = local_164 << 3 ^ local_164; local_164 = local_164 >> 0x11 ^ local_164; if (local_164 == (local_164 / 5) * 5) { in_EDX = local_4c; } else { local_94 = (WeightedOutcomePicker)0x0; local_90 = (undefined4 *)0x0; local_8c = (undefined4 *)0x0; local_8 = CONCAT31(local_8._1_3_,1); if (*param_1 != 3) { local_144 = 0x14; local_140 = 0x14; std::vector<8byte>::_Emplace_reallocate(); } uVar6 = 0; uVar15 = (int)local_90 - (int)local_94 >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_94 + uVar6 * 8) == 0x1e) { piVar11 = (int *)((int)local_94 + 4 + uVar6 * 8); *piVar11 = *piVar11 + 0xf; if (*piVar11 < 0) { *(undefined4 *)((int)local_94 + 4 + uVar6 * 8) = 0; } goto LAB_006de46f; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_13c = 0x1e; local_138 = 0xf; if (local_90 == local_8c) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_90 = 0x1e; local_90[1] = 0xf; local_90 = local_90 + 2; } LAB_006de46f: uVar6 = 0; uVar15 = (int)local_90 - (int)local_94 >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_94 + uVar6 * 8) == 0x28) { piVar11 = (int *)((int)local_94 + 4 + uVar6 * 8); *piVar11 = *piVar11 + 0xf; if (*piVar11 < 0) { *(undefined4 *)((int)local_94 + 4 + uVar6 * 8) = 0; } goto LAB_006de4ef; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_154 = 0x28; local_150 = 0xf; if (local_90 == local_8c) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_90 = 0x28; local_90[1] = 0xf; local_90 = local_90 + 2; } LAB_006de4ef: uVar6 = 0; uVar15 = (int)local_90 - (int)local_94 >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_94 + uVar6 * 8) == 10) { piVar11 = (int *)((int)local_94 + 4 + uVar6 * 8); *piVar11 = *piVar11 + 0xf; if (*piVar11 < 0) { *(undefined4 *)((int)local_94 + 4 + uVar6 * 8) = 0; } goto LAB_006de563; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_ec = 10; local_e8 = 0xf; if (local_90 == local_8c) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_90 = 10; local_90[1] = 0xf; local_90 = local_90 + 2; } LAB_006de563: rng_00._shift1 = (undefined4)uStack_160; rng_00._seed = local_164; rng_00._shift2 = uStack_160._4_4_; rng_00._shift3 = iStack_158; uVar6 = WeightedOutcomePicker::PickOutcome(&local_94,rng_00); in_EDX = local_4c; local_8 = local_8 & 0xffffff00; *local_4c = uVar6; if (local_94 != (WeightedOutcomePicker)0x0) { uVar6 = ((int)local_8c - (int)local_94 >> 3) * 8; WVar12 = local_94; if (0xfff < uVar6) { WVar12 = *(WeightedOutcomePicker *)((int)local_94 + -4); uVar6 = uVar6 + 0x23; if (0x1f < ((int)local_94 - (int)WVar12) - 4U) goto LAB_006defb6; } operator_delete((void *)WVar12,uVar6); local_94 = (WeightedOutcomePicker)0x0; local_90 = (undefined4 *)0x0; local_8c = (undefined4 *)0x0; } } } if (((local_a4 == 3) || (*in_EDX == 0x14)) || ((bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x54), bVar4 == 0 || (0.1 <= local_80)))) { if ((((*in_EDX != 0x5a) && (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x48), bVar4 != 0)) && (0.1 <= local_80)) && (local_80 < 0.2)) { *in_EDX = 0x5a; } } else { *in_EDX = 0x14; } local_8 = 0xffffffff; if (local_5c != (WeightedOutcomePicker)0x0) { uVar6 = ((int)local_54 - (int)local_5c >> 3) * 8; WVar12 = local_5c; if (0xfff < uVar6) { WVar12 = *(WeightedOutcomePicker *)((int)local_5c + -4); uVar6 = uVar6 + 0x23; if (0x1f < ((int)local_5c - (int)WVar12) - 4U) goto LAB_006defb6; } operator_delete((void *)WVar12,uVar6); local_5c = (WeightedOutcomePicker)0x0; local_58 = (undefined4 *)0x0; local_54 = (undefined4 *)0x0; } } pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xfb,(RNG **)&g_game->_playerManager,1); local_4d = pEVar7 != (Entity_Player *)0x0; pEVar8 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xfc,(RNG **)&g_game->_playerManager,1); puVar16 = local_4c; local_5d = pEVar8 != (Entity_Player *)0x0; if ((pEVar7 == (Entity_Player *)0x0) || (!local_5d)) { bVar4 = local_4d; } else { local_5d = false; bVar4 = 0; } if (*local_4c == 0x46) { if (bVar4 != 0) { *local_4c = 300; goto LAB_006de779; } } else if (((*local_4c == 300) && (local_5d)) && (((uVar6 = *param_1, (int)uVar6 < 0 || (((pvVar13 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar13 >> 2 <= (int)uVar6 || (iVar19 = *(int *)((int)pvVar13 + uVar6 * 4), iVar19 == 0)) || (iVar19 = *(int *)(iVar19 + 0x58), iVar19 == 0)))) || (((iVar19 == 5 || (iVar19 == 1)) || (iVar19 == 3)))))) { *local_4c = 0x46; LAB_006de779: *param_1 = 0; } uVar6 = *local_4c; local_84 = param_2; if (300 < uVar6) { switch(uVar6) { case 0x154: case 0x172: case 0x17c: break; default: switchD_006de7af_caseD_b: KAGE_LogMessage(1,(byte *)"[warn] Pickup variant %d not implemented yet!\n"); break; case 0x15e: if (*param_1 == 0) { uVar6 = ItemPool::GetTrinket(&g_game->_itemPool,(byte)param_2 ^ 1); *param_1 = uVar6; if (uVar6 == 0) { *puVar16 = 300; uVar6 = RNG::Next(&local_70); iVar19 = ItemPool::GetCardEx(uVar6,0x19,10,10,1); local_34._shift1 = 5; local_34._shift2 = 9; local_34._shift3 = 7; local_34._seed = uVar6; uVar6 = lua_callback_run_get_card(&local_34,iVar19,1,1,0); *param_1 = uVar6; if (local_5d != false) { *local_4c = 0x46; goto LAB_006df31b; } } } break; case 0x168: goto switchD_006de7af_caseD_39; case 0x186: switchD_006de7af_caseD_37: if (*param_1 == 0) { *param_1 = 1; } } goto switchD_006de7af_caseD_29; } if (uVar6 == 300) { if (*param_1 == 0) { uVar6 = RNG::Next(&local_70); iVar19 = ItemPool::GetCardEx(uVar6,0x19,10,10,1); local_44._shift1 = 5; local_44._shift2 = 9; local_44._shift3 = 7; local_44._seed = uVar6; uVar6 = lua_callback_run_get_card(&local_44,iVar19,1,1,0); *param_1 = uVar6; } goto switchD_006de7af_caseD_29; } switch(uVar6) { case 10: if (*param_1 == 0) { *param_1 = 1; uVar6 = RNG::RandomInt(&local_70,2); if (uVar6 == 0) { *param_1 = 2; } bVar4 = Game::IsHardMode(); uVar6 = 0x14; if (bVar4 != 0) { uVar6 = 0x32; } uVar6 = RNG::RandomInt(&local_70,uVar6); if (uVar6 == 0) { *param_1 = 5; } uVar6 = RNG::RandomInt(&local_70,0x32); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x19b] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 0xc; } uVar6 = RNG::RandomInt(&local_70,100); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x148] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 9; } uVar6 = RNG::RandomInt(&local_70,100); if (uVar6 == 0) { *param_1 = 10; } uVar6 = RNG::RandomInt(&local_70,0x32); if (uVar6 == 0) { LAB_006de943: *param_1 = 4; } else { bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x12); if (bVar4 != 0) { iVar19 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x12); uVar6 = RNG::RandomInt(&local_70,(uint)(0x1e / (longlong)iVar19)); if (uVar6 == 0) goto LAB_006de943; } pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xee,(RNG **)&g_game->_playerManager,1); if (((pEVar7 != (Entity_Player *)0x0) && (uVar6 = RNG::RandomInt(&local_70,0x28), uVar6 == 0)) || ((pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xef,(RNG **)&g_game->_playerManager,1), pEVar7 != (Entity_Player *)0x0 && (uVar6 = RNG::RandomInt(&local_70,0x28), uVar6 == 0))) ) goto LAB_006de943; } uVar6 = RNG::RandomInt(&local_70,10); if ((uVar6 == 0) || ((pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xad,(RNG **)&g_game->_playerManager,1), pEVar7 != (Entity_Player *)0x0 && (uVar6 = RNG::RandomInt(&local_70,3), uVar6 == 0)))) { LAB_006de9f4: *param_1 = 3; uVar6 = RNG::RandomInt(&local_70,4); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x21] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 8; } uVar6 = RNG::RandomInt(&local_70,0x14); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x187] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 0xb; } uVar6 = RNG::RandomInt(&local_70,0x14); if (uVar6 == 0) { LAB_006deacc: *param_1 = 6; } else { bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x11); if (bVar4 != 0) { iVar19 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x11); uVar6 = RNG::RandomInt(&local_70,(uint)(10 / (longlong)iVar19)); if (uVar6 == 0) goto LAB_006deacc; } } uVar6 = RNG::RandomInt(&local_70,5); pGVar17 = g_game; if ((uVar6 == 0) && ((pEVar7 = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x10), pEVar7 != (Entity_Player *)0x0 || (pEVar7 = PlayerManager::FirstPlayerByType(&pGVar17->_playerManager,0x11), pEVar7 != (Entity_Player *)0x0)))) { *param_1 = 0xb; } } else { bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x26); if (bVar4 != 0) { iVar19 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x26); uVar6 = RNG::RandomInt(&local_70,(uint)(10 / (longlong)iVar19)); if (uVar6 == 0) goto LAB_006de9f4; } pEVar7 = PlayerManager::FirstPlayerByType(&g_game->_playerManager,5); if ((pEVar7 != (Entity_Player *)0x0) && (uVar6 = RNG::RandomInt(&local_70,0x10), uVar6 == 0) ) goto LAB_006de9f4; } uVar6 = RNG::RandomInt(&local_70,0xa0); pGVar17 = g_game; if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0xe0] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 7; } bVar4 = PlayerManager::AnyoneHasTrinket(&pGVar17->_playerManager,0x16); if ((bVar4 != 0) && (*(int *)((int)g_game->_room + 8) != 8)) { *param_1 = 6; } } pGVar17 = g_game; if (*(int *)((int)g_game->_room + 8) == 8) { local_4d = Game::IsGreedMode(g_game); pRVar9 = Game::GetCurrentRoomDesc(pGVar17); iVar19 = *(int *)((int)pRVar9->Data + 0xc); if (local_4d == 0) { switch(iVar19) { case 0: goto switchD_006debbd_caseD_0; case 1: case 0x10: goto switchD_006debbd_caseD_18; case 2: case 3: case 4: case 5: case 7: case 8: case 9: case 10: case 0xb: case 0xe: case 0xf: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: goto switchD_006debbd_caseD_1; case 6: case 0xd: goto switchD_006debe1_caseD_6; case 0xc: goto switchD_006debbd_caseD_4; case 0x17: if (((g_manager->_persistentGameData)._achievements[0x19b] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) goto LAB_006dec40; *param_1 = 0xc; break; default: goto switchD_006debbd_default; } break; } switch(iVar19) { case 0: goto switchD_006debbd_caseD_0; case 1: case 2: case 3: case 6: case 7: case 8: case 9: case 10: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: switchD_006debbd_caseD_1: break; case 4: goto switchD_006debbd_caseD_4; case 5: *param_1 = 6; *param_1 = 6; goto switchD_006de7af_caseD_29; case 0x18: goto switchD_006debbd_caseD_18; case 0x19: goto switchD_006debbd_caseD_19; } switchD_006debbd_default: if (iVar19 == 0) { switchD_006debbd_caseD_0: *param_1 = 1; } else if (local_4d == 0) { if (iVar19 != 1) { if (iVar19 == 6) goto switchD_006debe1_caseD_6; goto LAB_006dec40; } switchD_006debbd_caseD_18: *param_1 = 4; } else if (iVar19 == 0x18) { *param_1 = 4; } else { if (iVar19 == 0x19) { switchD_006debbd_caseD_19: *param_1 = 2; goto LAB_006dec49; } if (iVar19 == 4) { switchD_006debbd_caseD_4: *param_1 = 3; } else { if (iVar19 != 5) goto LAB_006dec40; *param_1 = 6; } } } else { LAB_006dec40: if (*param_1 == 2) { LAB_006dec49: bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x57); if (bVar4 != 0) goto switchD_006debbd_caseD_0; } } break; default: goto switchD_006de7af_caseD_b; case 0x14: if (*param_1 == 0) { *param_1 = 1; uVar6 = RNG::RandomInt(&local_70,0x14); if (uVar6 == 0) { *param_1 = 2; } else if (((*param_1 == 1) && (uVar6 = RNG::RandomInt(&local_70,100), uVar6 == 0)) && (((g_manager->_persistentGameData)._achievements[0xf0] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 6; } uVar6 = RNG::RandomInt(&local_70,100); if (uVar6 == 0) { *param_1 = 3; } else if (((*param_1 == 1) && (uVar6 = RNG::RandomInt(&local_70,100), uVar6 == 0)) && (((g_manager->_persistentGameData)._achievements[0xf2] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 5; } uVar6 = RNG::RandomInt(&local_70,200); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x265] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 7; break; } } if ((*param_1 != 2) || ((g_game->_dailyChallenge)._specialDailyId != 7)) break; switchD_006debe1_caseD_6: *param_1 = 6; break; case 0x1e: if (*param_1 == 0) { local_a0 = (WeightedOutcomePicker)0x0; local_9c = (undefined4 *)0x0; local_98 = (undefined4 *)0x0; local_8 = 2; local_f4 = 1; local_f0 = 0x31; std::vector<8byte>::_Emplace_reallocate(); uVar6 = 0; uVar15 = (int)local_9c - (int)local_a0 >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_a0 + uVar6 * 8) == 2) { piVar11 = (int *)((int)local_a0 + 4 + uVar6 * 8); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)local_a0 + 4 + uVar6 * 8) = 0; } goto LAB_006deec1; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_fc = 2; local_f8 = 1; if (local_9c == local_98) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_9c = 2; local_9c[1] = 1; local_9c = local_9c + 2; } LAB_006deec1: if (((g_manager->_persistentGameData)._achievements[0x14d] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { bVar3 = false; } else { bVar3 = true; } local_100 = 1; local_104 = 1; if (bVar3) { local_104 = 4; } if (local_9c == local_98) { std::vector<8byte>::_Emplace_reallocate(); } else { *local_9c = local_104; local_9c[1] = 1; local_9c = local_9c + 2; } uVar6 = RNG::Next(&local_70); rng_01._shift1 = 5; rng_01._seed = uVar6; rng_01._shift2 = 9; rng_01._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&local_a0,rng_01); local_8 = 0xffffffff; *param_1 = uVar6; if (local_a0 != (WeightedOutcomePicker)0x0) { uVar6 = ((int)local_98 - (int)local_a0 >> 3) * 8; WVar12 = local_a0; if (0xfff < uVar6) { WVar12 = *(WeightedOutcomePicker *)((int)local_a0 + -4); uVar6 = uVar6 + 0x23; if (0x1f < ((int)local_a0 - (int)WVar12) - 4U) { LAB_006defb6: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)WVar12,uVar6); local_a0 = (WeightedOutcomePicker)0x0; local_9c = (undefined4 *)0x0; local_98 = (undefined4 *)0x0; } } break; case 0x28: if (*param_1 == 0) { *param_1 = 1; uVar6 = RNG::RandomInt(&local_70,7); if (uVar6 == 0) { *param_1 = 2; } uVar6 = RNG::RandomInt(&local_70,100); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0xe2] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 4; } uVar6 = RNG::RandomInt(&local_70,0x32); if (uVar6 == 0) { *param_1 = (*param_1 == 4) + 5; } uVar6 = RNG::RandomInt(&local_70,10); if (uVar6 == 0) { uVar6 = 3; if (*param_1 == 4) { uVar6 = 6; } *param_1 = uVar6; } } break; case 0x29: case 0x2a: case 0x96: break; case 0x32: if (*param_1 == 0) { uVar6 = RNG::RandomInt(&local_70,0x28); if (uVar6 == 0) { *puVar16 = 0x36; } else { uVar6 = RNG::RandomInt(&local_70,0x14); if (uVar6 == 0) { *puVar16 = 0x168; } else { uVar6 = RNG::RandomInt(&local_70,0x32); if (uVar6 == 0) { *puVar16 = 0x33; } else { uVar6 = RNG::RandomInt(&local_70,0x50); if (uVar6 == 0) { *puVar16 = 0x34; } else { uVar6 = RNG::RandomInt(&local_70,100); if (uVar6 == 0) { *puVar16 = 0x45; goto LAB_006df115; } uVar6 = RNG::RandomInt(&local_70,0x50); if (uVar6 == 0) { if ((g_manager->_persistentGameData)._achievements[0x261] != 0) { LAB_006df1bd: *puVar16 = 0x38; goto switchD_006de7af_caseD_3c; } if ((g_manager->_state == 2) && (puVar16 = local_4c, g_game != (Game *)0x0)) { if ((g_game->_dailyChallenge)._id != 0) goto LAB_006df1bd; if (g_game->_isDebug != 0) { *local_4c = 0x38; goto switchD_006de7af_caseD_3c; } } } uVar6 = RNG::RandomInt(&local_70,0x28); pGVar17 = g_game; if (uVar6 == 0) { iVar19 = Room::GetRoomShape(g_game->_room); if (((((iVar19 == 2) || (iVar19 = Room::GetRoomShape(pGVar17->_room), iVar19 == 3)) || (iVar19 = Room::GetRoomShape(pGVar17->_room), iVar19 == 7)) || (iVar19 = Room::GetRoomShape(pGVar17->_room), iVar19 == 5)) || (((g_manager->_persistentGameData)._achievements[0x263] == 0 && ((g_manager->_state != 2 || (((pGVar17->_dailyChallenge)._id == 0 && (pGVar17->_isDebug == 0)))))))) { puVar16 = local_4c; } else { *local_4c = 0x3a; puVar16 = local_4c; } } } } } } goto switchD_006de7af_caseD_3c; } goto LAB_006df2eb; case 0x33: case 0x34: case 0x35: case 0x36: case 0x38: case 0x3a: switchD_006de7af_caseD_33: if (*param_1 == 0) { bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x3d); if (bVar4 != 0) { *puVar16 = 0x168; goto switchD_006de7af_caseD_39; } } goto LAB_006df2eb; case 0x37: goto switchD_006de7af_caseD_37; case 0x39: goto switchD_006de7af_caseD_39; case 0x3c: switchD_006de7af_caseD_3c: if (*param_1 == 0) { uVar6 = RNG::RandomInt(&local_70,0x640); if (uVar6 == 0) { *puVar16 = 0x35; } goto switchD_006de7af_caseD_33; } LAB_006df2eb: if ((*puVar16 == 0x34) && (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar4 != 0)) { *puVar16 = 0x36; } switchD_006de7af_caseD_39: if (*param_1 == 0) { bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x9f); if (((bVar4 == 0) || (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x3d), bVar4 != 0)) || (*puVar16 == 0x39)) { if (*puVar16 == 0x3c) goto LAB_006df530; } else { *puVar16 = 0x3c; LAB_006df530: uVar6 = RNG::RandomInt(&local_70,0x78); if (uVar6 == 0) { if ((g_manager->_persistentGameData)._achievements[0x259] == 0) { if ((g_manager->_state == 2) && (puVar16 = local_4c, g_game != (Game *)0x0)) { if ((g_game->_dailyChallenge)._id != 0) goto LAB_006df57c; if (g_game->_isDebug != 0) { *local_4c = 0x39; } } } else { LAB_006df57c: *puVar16 = 0x39; } } } if (*param_1 == 0) { if (*puVar16 == 0x39) { uVar6 = RNG::RandomInt(&local_70,4); uVar15 = RNG::RandomInt(&local_70,4); *param_1 = uVar15 + 1 + uVar6; } else { *param_1 = (*puVar16 == 0x35) + 1; } } } break; case 0x45: if (*param_1 == 0) { LAB_006df115: *param_1 = 1; uVar6 = RNG::RandomInt(&local_70,100); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x25c] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_1 = 2; } } break; case 0x46: if (*param_1 == 0) { LAB_006df31b: uVar6 = RNG::Next(&local_70); uVar6 = ItemPool::GetPill(uVar6); *param_1 = uVar6; } break; case 0x5a: if (*param_1 == 0) { *param_1 = 1; uVar6 = RNG::Next(&local_70); local_a4 = RNG::Next(&local_70); if (((((g_manager->_persistentGameData)._achievements[0x21] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) && (uVar6 != (uVar6 / 3) * 3)) || ((bVar4 = Game::IsHardMode(), bVar4 != 0 && ((extraout_EDX & 1) != 0)))) { *param_1 = 2; } uVar6 = RNG::RandomInt(&local_70,100); if (uVar6 == 0) { *param_1 = 3; } else { uVar6 = RNG::RandomInt(&local_70,0x78); if ((uVar6 == 0) && (((g_manager->_persistentGameData)._achievements[0x267] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) goto switchD_006debbd_caseD_18; } } break; case 100: if (*param_1 != 0) { pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2d1,(RNG **)&g_game->_playerManager,1); if (((pEVar7 == (Entity_Player *)0x0) || (g_pickupIgnoreModifiers != 0)) || (bVar4 = ItemConfig::IsQuestItem(*param_1), bVar4 != 0)) { if (*param_1 != 0) break; } else { *param_1 = 0; } } pvVar13 = g_game->_room; uVar6 = RNG::Next(&local_70); uVar6 = ItemPool::GetSeededCollectible (uVar6,(byte)local_84 ^ 1,*(RoomDescriptor **)((int)pvVar13 + 4)); *param_1 = uVar6; break; case 0x6e: *param_1 = 0x226; } switchD_006de7af_caseD_29: uVar5 = 0xcb; iVar19 = 0x6df689; pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xcb,(RNG **)&g_game->_playerManager,1); if ((pEVar7 == (Entity_Player *)0x0) || (((uint)local_88 & 0x8000) != 0)) { if (*local_4c == 0x28) { uVar5 = 0xfa; iVar19 = 0x6df6ba; pEVar7 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xfa,(RNG **)&g_game->_playerManager,1); if (pEVar7 != (Entity_Player *)0x0) goto LAB_006df6be; } iVar14 = g_pickupIgnoreModifiers; } else { LAB_006df6be: iVar14 = g_pickupIgnoreModifiers; if (g_pickupIgnoreModifiers == 0) { uVar6 = *local_4c; if ((uVar6 == 10) && ((*param_1 == 1 || (*param_1 == 9)))) { *param_1 = 5; uVar6 = *local_4c; } if ((uVar6 == 0x14) && (*param_1 == 1)) { *param_1 = 4; uVar6 = *local_4c; } if (uVar6 == 0x1e) { if (*param_1 != 1) goto LAB_006df725; *param_1 = 3; uVar6 = *local_4c; } if ((uVar6 == 0x28) && (*param_1 == 1)) { *param_1 = 2; } } } LAB_006df725: pGVar17 = g_game; if (((g_game->_challenge == 0x19) && (*local_4c == 10)) && ((uVar6 = *param_1, uVar6 == 1 || ((((uVar6 == 2 || (uVar6 == 5)) || (uVar6 == 10)) || ((uVar6 == 9 || (uVar6 == 0xc)))))))) { *local_4c = 0x14; if (*param_1 == 1) { *param_1 = 4; } else { *param_1 = (*param_1 == 5) + 1; } } if (pGVar17->_challenge == 0x29) { if ((iVar14 == 0) && (*local_4c == 100)) { bVar4 = ItemConfig::IsQuestItem(*param_1); if (bVar4 == 0) { *local_4c = 0x15e; uVar6 = ItemPool::GetTrinket(&pGVar17->_itemPool,(byte)local_84 ^ 1); *param_1 = uVar6; pGVar17 = g_game; if (uVar6 == 0) { *local_4c = 300; uVar6 = RNG::Next(&local_70); iVar19 = ItemPool::GetCardEx(uVar6,0x19,10,10,1); uVar5 = 1; local_24._shift1 = 5; local_24._shift2 = 9; local_24._shift3 = 7; local_24._seed = uVar6; uVar6 = lua_callback_run_get_card(&local_24,iVar19,1,1,0); *param_1 = uVar6; pGVar17 = g_game; if (local_5d != false) { *local_4c = 0x46; uVar6 = RNG::Next(&local_70); uVar6 = ItemPool::GetPill(uVar6); *param_1 = uVar6; pGVar17 = g_game; } } } } } else if (((pGVar17->_challenge == 0x2b) && (iVar14 == 0)) && (*local_4c == 100)) { bVar4 = ItemConfig::IsQuestItem(*param_1); if (bVar4 == 0) { *local_4c = 300; *param_1 = 0; } } if (pGVar17->_challenge == 0x2b) { uVar6 = *local_4c; if (uVar6 == 300) { if ((*param_1 & 0x8000) == 0) { *param_1 = 0; } } else if ((uVar6 != 0x46) && (uVar6 != 0x5a)) goto LAB_006df8a6; *local_4c = 300; } LAB_006df8a6: uVar6 = *local_4c; local_48 = param_3; if (uVar6 == 0x28) { bVar4 = PlayerManager::are_all_players_tainted_blue_baby (&pGVar17->_playerManager,(int)&pGVar17->_playerManager); if (bVar4 == 0) goto LAB_006dfdb1; uVar6 = *param_1; if (((uVar6 == 3) || (uVar6 == 5)) || (uVar6 == 6)) goto LAB_006dfdb1; *local_4c = 0x2a; *param_1 = 1; uVar6 = *local_4c; } if ((uVar6 != 0x14) && (uVar6 != 0x1e)) goto LAB_006dfdb1; if (((pGVar17->_difficulty == 2) || (((pGVar17->_difficulty == 3 || (pGVar17->_stage < 7)) || (g_pickupIgnoreModifiers != 0)))) || (1 < DAT_00c7ec68)) goto LAB_006dfdb1; puVar21 = (undefined4 *)0xa5; puVar20 = (undefined4 *)0x6df94e; bVar4 = PlayerManager::AnyoneHasTrinket(&pGVar17->_playerManager,0xa5); if (bVar4 != 0) { local_7c = (WeightedOutcomePicker)0x0; local_78 = (undefined4 *)0x0; local_74 = (undefined4 *)0x0; local_8 = 3; if (*local_4c == 0x14) { puVar21 = &local_10c; local_10c = 0; puVar20 = (undefined4 *)0x0; local_108 = 8; uVar5 = 0x6df992; std::vector<8byte>::_Emplace_reallocate(); } uVar6 = 0; uVar15 = (int)local_78 - (int)local_7c >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_7c + uVar6 * 8) == 0x28) { piVar11 = (int *)((int)local_7c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 8; if (*piVar11 < 0) { *(undefined4 *)((int)local_7c + 4 + uVar6 * 8) = 0; } goto LAB_006dfa05; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_114 = 0x28; local_110 = 8; if (local_78 == local_74) { puVar21 = &local_114; uVar5 = 0x6df9ff; puVar20 = local_78; std::vector<8byte>::_Emplace_reallocate(); } else { *local_78 = 0x28; local_78[1] = 8; local_78 = local_78 + 2; } LAB_006dfa05: uVar6 = 0; uVar15 = (int)local_78 - (int)local_7c >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_7c + uVar6 * 8) == 10) { piVar11 = (int *)((int)local_7c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 8; if (*piVar11 < 0) { *(undefined4 *)((int)local_7c + 4 + uVar6 * 8) = 0; } goto LAB_006dfa72; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_11c = 10; local_118 = 8; if (local_78 == local_74) { puVar21 = &local_11c; uVar5 = 0x6dfa6c; puVar20 = local_78; std::vector<8byte>::_Emplace_reallocate(); } else { *local_78 = 10; local_78[1] = 8; local_78 = local_78 + 2; } LAB_006dfa72: uVar6 = 0; uVar15 = (int)local_78 - (int)local_7c >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_7c + uVar6 * 8) == 0x46) { piVar11 = (int *)((int)local_7c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 5; if (*piVar11 < 0) { *(undefined4 *)((int)local_7c + 4 + uVar6 * 8) = 0; } goto LAB_006dfae0; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_124 = 0x46; local_120 = 5; if (local_78 == local_74) { puVar21 = &local_124; uVar5 = 0x6dfada; puVar20 = local_78; std::vector<8byte>::_Emplace_reallocate(); } else { *local_78 = 0x46; local_78[1] = 5; local_78 = local_78 + 2; } LAB_006dfae0: uVar6 = 0; uVar15 = (int)local_78 - (int)local_7c >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_7c + uVar6 * 8) == 300) { piVar11 = (int *)((int)local_7c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 5; if (*piVar11 < 0) { *(undefined4 *)((int)local_7c + 4 + uVar6 * 8) = 0; } goto LAB_006dfb53; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_12c = 300; local_128 = 5; if (local_78 == local_74) { puVar21 = &local_12c; uVar5 = 0x6dfb4d; puVar20 = local_78; std::vector<8byte>::_Emplace_reallocate(); } else { *local_78 = 300; local_78[1] = 5; local_78 = local_78 + 2; } LAB_006dfb53: uVar6 = 0; uVar15 = (int)local_78 - (int)local_7c >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_7c + uVar6 * 8) == 0x15e) { piVar11 = (int *)((int)local_7c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 2; if (*piVar11 < 0) { *(undefined4 *)((int)local_7c + 4 + uVar6 * 8) = 0; } goto LAB_006dfbc3; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_134 = 0x15e; local_130 = 2; if (local_78 == local_74) { puVar21 = &local_134; uVar5 = 0x6dfbbd; puVar20 = local_78; std::vector<8byte>::_Emplace_reallocate(); } else { *local_78 = 0x15e; local_78[1] = 2; local_78 = local_78 + 2; } LAB_006dfbc3: uVar6 = 0; uVar15 = (int)local_78 - (int)local_7c >> 3; if (uVar15 != 0) { do { if (*(int *)((int)local_7c + uVar6 * 8) == 0x5a) { piVar11 = (int *)((int)local_7c + 4 + uVar6 * 8); *piVar11 = *piVar11 + 2; if (*piVar11 < 0) { *(undefined4 *)((int)local_7c + 4 + uVar6 * 8) = 0; } goto LAB_006dfc2a; } uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } local_17c = 0x5a; local_178 = 2; if (local_78 == local_74) { puVar21 = &local_17c; uVar5 = 0x6dfc2a; puVar20 = local_78; std::vector<8byte>::_Emplace_reallocate(); } else { *local_78 = 0x5a; local_78[1] = 2; local_78 = local_78 + 2; } LAB_006dfc2a: uVar15 = 0x23; uVar6 = RNG::Next(&local_70); RNG::game_constructor(aRStackY_9b8 + 0x81,uVar6,uVar15); rng_02._shift1 = uVar5; rng_02._seed = iVar19; rng_02._shift2 = (int)puVar20; rng_02._shift3 = (int)puVar21; uVar6 = WeightedOutcomePicker::PickOutcome(&local_7c,rng_02); puVar16 = local_4c; *local_4c = uVar6; if (uVar6 == 0) { if ((char)local_48 == '\0') { DAT_00c7ec68 = DAT_00c7ec68 + -1; *local_4c = 0xffffffff; if (local_7c != (WeightedOutcomePicker)0x0) { deallocate((void *)local_7c,(int)local_74 - (int)local_7c >> 3); } ExceptionList = local_10; return 0; } } else { local_88 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xa5); if (local_88 == (Entity_Player *)0x0) { LAB_006dfd58: *param_1 = 0; } else { iVar19 = Entity_Player::GetTrinketMultiplier(local_88,0xa5); if (iVar19 == 2) { local_80 = 1.4013e-44; } else { if (iVar19 != 3) goto LAB_006dfd58; local_80 = 2.8026e-44; } *param_1 = 0; pvVar13 = (local_88->_trinketRNGs)._end; if ((int)pvVar13 - (int)(local_88->_trinketRNGs)._begin >> 4 < 0xa6) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar13 = (local_88->_trinketRNGs)._end; } pvVar1 = (local_88->_trinketRNGs)._begin; uVar6 = ((int)pvVar13 - (int)pvVar1 >> 4) - 1; if (0xa5 < uVar6) { uVar6 = 0xa5; } fVar10 = (float)RNG::RandomInt((RNG *)(uVar6 * 0x10 + (int)pvVar1),100); if ((uint)fVar10 < (uint)local_80) { if (*puVar16 == 10) { *param_1 = 5; } else if (*puVar16 == 0x28) { *param_1 = 2; } } } RNG::Next(&local_70); Pickup_PickVariant(); } local_8 = 0xffffffff; if (local_7c != (WeightedOutcomePicker)0x0) { deallocate((void *)local_7c,(int)local_74 - (int)local_7c >> 3); local_7c = (WeightedOutcomePicker)0x0; local_78 = (undefined4 *)0x0; local_74 = (undefined4 *)0x0; } } pGVar17 = g_game; LAB_006dfdb1: if ((char)local_48 != '\0') { pPVar18 = &pGVar17->_playerManager; local_88 = (Entity_Player *)0x0; if ((int)(pGVar17->_playerManager)._playerList._end - (int)(pPVar18->_playerList)._begin >> 2 != 0) { do { pvVar13 = (pPVar18->_playerList)._end; if ((int)pvVar13 - (int)(pPVar18->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar13 = (pPVar18->_playerList)._end; } piVar11 = (pPVar18->_playerList)._begin; if (local_88 < (uint)((int)pvVar13 - (int)piVar11 >> 2)) { piVar11 = piVar11 + (int)local_88; } if (((*(int *)(*piVar11 + 0x2c) == 0) && (iVar19 = *(int *)(*piVar11 + 0x13c0), iVar19 != 0xe)) && (iVar19 != 0x21)) goto LAB_006dfe6c; local_88 = (Entity_Player *)((int)local_88 + 1); pPVar18 = &g_game->_playerManager; } while (local_88 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar18->_playerList)._begin >> 2)); } if (*local_4c == 10) { RNG::Next(&local_70); uVar6 = 0x28; if ((local_70._seed & 1U) == 0) { uVar6 = 0x1e; } *local_4c = uVar6; *param_1 = 1; } } LAB_006dfe6c: DAT_00c7ec68 = DAT_00c7ec68 + -1; ExceptionList = local_10; return 1; } //@@ 006e0010 Entity_Pickup::Constructor /* ZHL [exact] __thiscall void Entity_Pickup::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Pickup::Constructor(Entity_Pickup *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afaea1; local_10 = ExceptionList; ExceptionList = &local_10; Entity::constructor((Entity *)this); local_8 = 0; *(undefined ***)this = IsaacRepentancePlus::Entity_Pickup::vftable; ANM2::constructor(&this->_priceANM2); (this->_colorMod)._tint[0] = 1.0; (this->_colorMod)._tint[1] = 1.0; (this->_colorMod)._tint[2] = 1.0; (this->_colorMod)._tint[3] = 1.0; (this->_colorMod)._colorize[0] = 0.0; (this->_colorMod)._colorize[1] = 0.0; (this->_colorMod)._colorize[2] = 0.0; (this->_colorMod)._colorize[3] = 0.0; (this->_colorMod)._offset[0] = 0.0; (this->_colorMod)._offset[1] = 0.0; (this->_colorMod)._offset[2] = 0.0; this->_unkEntityRef = (EntityPtr)0x0; this->_pickupGhost = (void *)0x0; this->_megaChestCollectible[0] = (void *)0x0; this->_megaChestCollectible[1] = (void *)0x0; this->_flipSaveState = 0; *(undefined4 *)&this->field_0x5cc = 0; local_8 = CONCAT31(local_8._1_3_,6); ANM2::constructor(&this->_altPedestalANM2); ExceptionList = local_10; return; } //@@ 006e0130 Entity_Pickup::Free /* ZHL [vtable slot 0] */ Entity_Pickup * __thiscall Entity_Pickup::Free(Entity_Pickup *this,byte param_2) { ~Entity_Pickup(); if ((param_2 & 1) != 0) { operator_delete(this,0x6f0); } return this; } //@@ 006e0160 Entity_Pickup::~Entity_Pickup /* DB: sets Entity_Pickup vftable, resets its ANM2/AnimationStates, releases the save state (g_entitySaveStateReleaseFn) and EntityPtrs, then the Entity base; only caller Entity_Pickup::Free */ void Entity_Pickup::~Entity_Pickup(void) { byte *pbVar1; void **ppvVar2; int *piVar3; char cVar4; Entity *in_ECX; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afaec0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Pickup::vftable; local_8 = 0; local_14 = in_ECX; ANM2::Reset((ANM2 *)(in_ECX[1]._color._tint + 3)); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._damageCountdown); AnimationState::~AnimationState((AnimationState *)in_ECX[1]._splatColor._colorize); std::string::_Tidy_deallocate((char *)(in_ECX[1]._color._offset + 1)); std::string::_Tidy_deallocate((char *)(in_ECX[1]._color._tint + 3)); local_8 = 1; piVar3 = (int *)in_ECX[1]._color._tint[2]; if (piVar3 != (int *)0x0) { cVar4 = (**(code **)(*piVar3 + 0xc))(); if ((cVar4 != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(in_ECX[1]._color._tint + 1); } } pbVar1 = &in_ECX[1]._collidesWithEntity; if (*(int *)pbVar1 != 0) { local_14 = (Entity *)pbVar1; std::multiset::erase(&local_14); *(undefined4 *)pbVar1 = 0; } piVar3 = &in_ECX[1]._entityCollisionClass; if (*piVar3 != 0) { local_14 = (Entity *)piVar3; std::multiset::erase(&local_14); *piVar3 = 0; } piVar3 = &in_ECX[1]._entityGridCollisionClass; if (*piVar3 != 0) { local_14 = (Entity *)piVar3; std::multiset::erase(&local_14); *piVar3 = 0; } ppvVar2 = &in_ECX[1]._collisionPoints._capacity; if (*ppvVar2 != (void *)0x0) { local_14 = (Entity *)ppvVar2; std::multiset::erase(&local_14); *ppvVar2 = (void *)0x0; } local_8 = 6; ANM2::Reset((ANM2 *)&in_ECX[1].field_0x4); AnimationState::~AnimationState((AnimationState *)(in_ECX[1]._sprite._filename._buf + 0xc)); AnimationState::~AnimationState((AnimationState *)&in_ECX[1]._spawnerType); std::string::_Tidy_deallocate((char *)((int)&in_ECX[1]._pendingDamageFlags + 4)); std::string::_Tidy_deallocate(&in_ECX[1].field_0x4); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 006e02f0 Entity_Pickup::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] */ void __thiscall Entity_Pickup::Init(Entity_Pickup *this) { void *pvVar1; code *pcVar2; char isVariantPicked; byte bVar3; uint uVar4; Entity *pEVar5; int iVar6; ANM2 *pAVar7; ItemConfig_Item *collectibleConfig; Entity_Player *owner; byte *curAnimName; char *pcVar8; EntityPtr itemIdsBegin; Manager *manager; EntityPtr EVar9; Game *game; EntityPtr itemIdsCapacity; bool bVar10; int in_stack_00000004; undefined4 uStack00000008; undefined4 uStack0000000c; uint in_stack_00000010; undefined4 local_80 [8]; undefined4 local_60; undefined4 uStack_5c; undefined4 local_58; RNG local_54; Entity_Pickup *local_44; uint seed; EntityPtr local_3c; EntityPtr local_38; ANM2 *local_34; Entity *local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; byte *animData; qword flags; undefined4 flagsHigh; uint *flagsHighPtr; float initCharge; void **pickupGhostSlot; int *taggedItem; EntityPtr *unkEntityRefSlot; local_8 = 0xffffffff; puStack_c = &LAB_00afaefd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; seed = in_stack_00000010; this->_isInitFlag176 = 1; this->_coopDuplicateIndex = -1; this->_price = 0; this->_shopItemId = 0; this->_timeout = -1; this->_wait = 0; this->_chestReCloseTimer = 0; this->_isTouched = 0; this->field_0x52d = 0; this->_isForceBlind = 0; this->_isPayToPlay = 0; this->_collisionCooldown = 0; this->_gridRepositionState = 0; local_60 = 0; uStack_5c = 0; local_58 = 0; if (&this->_colorMod != (ColorMod *)local_80) { (this->_colorMod)._offset[0] = 0.0; (this->_colorMod)._offset[1] = 0.0; (this->_colorMod)._tint[0] = 0.0; (this->_colorMod)._tint[1] = 0.0; (this->_colorMod)._tint[2] = 0.0; (this->_colorMod)._tint[3] = 0.0; (this->_colorMod)._offset[2] = 0.0; (this->_colorMod)._colorize[0] = 0.0; (this->_colorMod)._colorize[1] = 0.0; (this->_colorMod)._colorize[2] = 0.0; (this->_colorMod)._colorize[3] = 0.0; } unkEntityRefSlot = &this->_unkEntityRef; this->_state = 0; this->_isAutoUpdatePrice = 1; local_44 = this; local_14 = uVar4; if (*unkEntityRefSlot != (EntityPtr)0x0) { local_30 = (Entity *)unkEntityRefSlot; std::multiset::erase(&local_30); *unkEntityRefSlot = (EntityPtr)0x0; } pickupGhostSlot = &this->_pickupGhost; if ((this->_pickupGhost != (int *)0x0) && ((**(code **)(*(int *)this->_pickupGhost + 0x28))(uVar4), *pickupGhostSlot != (void *)0x0)) { local_30 = (Entity *)pickupGhostSlot; std::multiset::erase(&local_30); *pickupGhostSlot = (void *)0x0; } if (this->_megaChestCollectible[1] != (void *)0x0) { local_30 = (Entity *)(this->_megaChestCollectible + 1); std::multiset::erase(&local_30); *(EntityPtr *)(this->_megaChestCollectible + 1) = (EntityPtr)0x0; } if (this->_megaChestCollectible[0] != (void *)0x0) { local_30 = (Entity *)this->_megaChestCollectible; std::multiset::erase(&local_30); this->_megaChestCollectible[0] = (void *)0x0; } *(undefined4 *)(this + 1) = 0; *(undefined4 *)&this[1].field_0x4 = 0; EntitySaveStateRef::Set(&this->_flipSaveState,(void *)0x0); local_54._shift3 = 7; this->_dropDelay = 0; this->_cycleCollectibleCount = 0; this->_invisibleFrames = 0; this->_charge = 0; this->_varData = 0; local_54._seed = seed; local_54._shift1 = 5; local_54._shift2 = 9; isVariantPicked = Pickup_PickVariant(&uStack0000000c,1,0); if (isVariantPicked == '\0') { if (uStack00000008 == (Entity *)0xffffffff) { uVar4 = RNG::Next(&this->_dropRNG); pEVar5 = Game::Spawn(g_game,0xd,0,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); pEVar5->_scoreMultiplier = 0.0; ExceptionList = local_10; return; } ExceptionList = local_10; return; } PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xfb,(RNG **)&g_game->_playerManager,1); PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xfc,(RNG **)&g_game->_playerManager,1); if (uStack00000008 == (Entity *)0x96) { uVar4 = RNG::Next(&local_54); iVar6 = FUN_00814980(&uStack00000008,&uStack0000000c,&this->_price,uVar4); this->_shopItemId = iVar6; local_30 = uStack00000008; local_34 = uStack0000000c; isVariantPicked = Pickup_PickVariant(&uStack0000000c,1,1); if ((isVariantPicked != '\0') && ((local_30 != uStack00000008 || (local_34 != uStack0000000c)))) { iVar6 = Room::GetShopItemPrice (g_game->_room,(uint)uStack00000008,(int)uStack0000000c,this->_shopItemId, (Entity_Player *)0x0); this->_price = iVar6; iVar6 = _Room::ResolveHeartSubType(this->_shopItemId,iVar6,0); this->_price = iVar6; } iVar6 = *(int *)((int)g_game->_room + 4); if ((((iVar6 != 0) && ((*(uint *)(iVar6 + 0x44) >> 0xb & 1) != 0)) && (*(int *)(*(int *)(iVar6 + 0x10) + 8) == 4)) && (*(int *)(*(int *)(iVar6 + 0x10) + 0xc) == 0x1b)) { (this->_pos).y = (this->_pos).y - 80.0; } } manager = g_manager; if (uStack00000008 == (Entity *)0x64) { local_34 = (ANM2 *)ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)uStack0000000c); if (local_34 == (ANM2 *)0x0) { pvVar1 = g_game->_room; uVar4 = RNG::Next(&local_54); uStack0000000c = (ANM2 *)ItemPool::GetSeededCollectible(uVar4,0,*(RoomDescriptor **)((int)pvVar1 + 4)); manager = g_manager; local_34 = (ANM2 *)ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)uStack0000000c); } bVar10 = g_pickupIgnoreModifiers == 0; this->_charge = (int)local_34->_animData; pAVar7 = local_34; if (((bVar10) && (uStack0000000c == (ANM2 *)0x126)) && ((manager->_persistentGameData).field_0xc0e != '\0')) { local_2c._buf._8_4_ = Seeds::GetStartSeed(); local_2c._buf[0xc] = '\x0f'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 1; local_2c._capacity = 0x1d; uVar4 = RNG::RandomInt((RNG *)(local_2c._buf + 8),0x14); manager = g_manager; if (uVar4 == 0) { uStack0000000c = (ANM2 *)0x1e4; pAVar7 = (ANM2 *)ItemConfig::GetCollectible(&g_manager->_itemConfig,0x1e4); this->_charge = (int)pAVar7->_animData; } else { pAVar7 = local_34; } } initCharge = (pAVar7->_color)._offset[0]; if (-1 < (int)initCharge) { this->_charge = (int)initCharge; } this->_wait = 0x14; } if (uStack00000008 == (Entity *)0x6e) { uStack0000000c = (ANM2 *)0x226; collectibleConfig = ItemConfig::GetCollectible(&manager->_itemConfig,0x226); this->_charge = collectibleConfig->maxCharges; } lua_callback_run_post_pickup_selection(this,&uStack00000008,&uStack0000000c); pEVar5 = uStack00000008; if (((uStack00000008 == (Entity *)0x28) && (bVar3 = PlayerManager::are_all_players_tainted_blue_baby (&g_game->_playerManager,(int)&g_game->_playerManager), bVar3 != 0)) && ((uStack0000000c != (ANM2 *)0x3 && ((uStack0000000c != (ANM2 *)&DAT_00000005 && (uStack0000000c != (ANM2 *)&DAT_00000006)))))) { pEVar5 = (Entity *)&DAT_0000002a; uStack00000008 = (Entity *)&DAT_0000002a; uStack0000000c = (ANM2 *)0x1; } if (g_game->_challenge == 0x2b) { if (pEVar5 == (Entity *)0x12c) { uStack00000008 = pEVar5; if (((uint)uStack0000000c >> 0xf & 1) == 0 || ((uint)uStack0000000c & 0x7fff) == 0) { uVar4 = RNG::Next(&local_54); uVar4 = ItemPool::GetCardImpl(uVar4); uStack0000000c = (ANM2 *)(uVar4 | 0x8000); } Entity::Init((Entity *)this,in_stack_00000004,(int)uStack00000008,0x10,seed); this->_variant = 300; this->_subtype = (int)uStack0000000c; } else { LAB_006e08b6: Entity::Init((Entity *)this,in_stack_00000004,(int)pEVar5,(int)uStack0000000c,seed); } } else { if (pEVar5 != (Entity *)0x12c) goto LAB_006e08b6; if ((((int)uStack0000000c < 0) || (pvVar1 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar1 >> 2 <= (int)uStack0000000c)) || (iVar6 = *(int *)((int)pvVar1 + (int)uStack0000000c * 4), iVar6 == 0)) { iVar6 = 2; } else { iVar6 = *(int *)(iVar6 + 0x54); } Entity::Init((Entity *)this,in_stack_00000004,300,iVar6,seed); this->_variant = 300; this->_subtype = (int)uStack0000000c; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x17c,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { switch(this->_variant) { case 0x35: case 0x37: case 0x39: case 0x3c: this->_isPayToPlay = 1; } } if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),0); UpdateSprite(this,0); } iVar6 = this->_variant; if (((iVar6 == 0x172) || (iVar6 == 0x154)) || (((iVar6 == 0x17c || ((iVar6 == 100 || (iVar6 == 0x96)))) || (iVar6 == 0x186)))) { *(uint *)&this->_flags = (uint)this->_flags | 0x4000000; flagsHigh = *(undefined4 *)((int)&this->_flags + 4); *(undefined4 *)((int)&this->_flags + 4) = flagsHigh; if (((iVar6 == 0x172) || (iVar6 == 0x154)) || ((iVar6 == 0x17c && (this->_subtype == 10)))) { *(uint *)&this->_flags = (uint)this->_flags | 0x200000; this->_collisionCooldown = 10; *(undefined4 *)((int)&this->_flags + 4) = flagsHigh; } if (iVar6 != 0x172) goto LAB_006e0a97; bVar3 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (bVar3 != 0) { local_2c._12_8_ = local_2c._12_8_ & 0xffffffff; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x1b; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/promo/gfuel/trophy.anm2",0x1c); local_8 = 0; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar4 = local_2c._capacity + 1; pcVar8 = (char *)local_2c._buf._0_4_; if (0xfff < uVar4) { pcVar8 = *(char **)(local_2c._buf._0_4_ + -4); uVar4 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)pcVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar8,uVar4); } iVar6 = this->_variant; local_2c._12_8_ = local_2c._12_8_ & 0xffffffff; local_2c._capacity = 0xf; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; goto LAB_006e0a97; } LAB_006e10ff: if ((this->_sprite)._loaded == 0) { KAGE_LogMessage(1,(byte *)"[warn] No sprite for Pickup variant %d\n"); } else { pcVar8 = g_game->_room; if (pcVar8[1] == '\0') { if ((*pcVar8 == '\0') || (g_game->_frameCount - *(int *)(pcVar8 + 0x11f0) < 1)) { LAB_006e1197: ANM2::Play(&this->_sprite,s_Idle,0); this->_entityCollisionClass = 4; goto LAB_006e13e3; } } else if ((*pcVar8 == '\0') && (uVar4 = Game::GetStageID(g_game,(byte)pcVar8), uVar4 == 0x23)) goto LAB_006e1197; ANM2::Play(&this->_sprite,(byte *)"Appear",0); game = g_game; this->_entityCollisionClass = 0; bVar3 = Room::IsBeastDungeon(game->_room); if (bVar3 == 0) { iVar6 = PlayerManager::GetGFuelCount(); if (1 < iVar6) { Game::ShakeScreen(g_game,10); uVar4 = Random(); pEVar5 = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); local_2c._12_8_ = local_2c._12_8_ & 0xffffffff; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_34 = &pEVar5->_sprite; local_30 = pEVar5; local_2c._buf._0_4_ = std::_Allocate(0x30); local_2c._size = 0x27; local_2c._capacity = 0x2f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/promo/gfuel/effects/explosion4.anm2",0x28 ); local_8 = 2; ANM2::Load(&pEVar5->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar4 = local_2c._capacity + 1; pcVar8 = (char *)local_2c._buf._0_4_; if (0xfff < uVar4) { pcVar8 = *(char **)(local_2c._buf._0_4_ + -4); uVar4 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)pcVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar8,uVar4); } pAVar7 = local_34; local_38 = (EntityPtr)&(local_30->_sprite)._animDefaultName; if (0xf < (local_30->_sprite)._animDefaultName._capacity) { local_38 = *(EntityPtr *)((std_string *)local_38)->_buf; } animData = (pEVar5->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_006e1322: bVar3 = ANM2::SetAnimation(local_34,(byte *)local_38,1); if (bVar3 != 0) { AnimationState::Rewind(&pAVar7->_animState); (pAVar7->_animState)._isPlaying = 1; } } else { curAnimName = animData; EVar9 = local_38; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } do { bVar3 = *curAnimName; bVar10 = bVar3 < *(byte *)EVar9; if (bVar3 != *(byte *)EVar9) { LAB_006e1301: uVar4 = -(uint)bVar10 | 1; goto LAB_006e1306; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar10 = bVar3 < (byte)*(char *)((int)EVar9 + 1); if (bVar3 != *(char *)((int)EVar9 + 1)) goto LAB_006e1301; curAnimName = curAnimName + 2; EVar9 = (EntityPtr)((int)EVar9 + 2); } while (bVar3 != 0); uVar4 = 0; LAB_006e1306: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((local_34->_animState)._isPlaying == 0)))) goto LAB_006e1322; } uVar4 = Random(); (local_30->_sprite)._flipX = ~(byte)uVar4 & 1; (**(code **)(*(int *)local_30 + 0xc))(); uVar4 = Random(); manager = g_manager; local_30 = (Entity *)0x33d; local_44 = (Entity_Pickup *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,2,0,(float)local_44,0.0); } } else { Sprite::SetLastFrame((Sprite *)&this->_sprite); (this->_velocity).y = (this->_velocity).y - 15.0; } } LAB_006e13e3: game = g_game; } else { LAB_006e0a97: if (iVar6 != 100) { if (iVar6 != 0x17c) goto LAB_006e10ff; ANM2::Play(&this->_sprite,s_Idle,0); flagsHigh = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x40000000; *(undefined4 *)((int)&this->_flags + 4) = flagsHigh; goto LAB_006e13e3; } ANM2::Play(&this->_sprite,s_Idle,0); SetAlternatePedestal(this,0); if (((this->_price == 0) && (g_pickupIgnoreModifiers == 0)) && (owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x290,(RNG **)&g_game->_playerManager,1), game = g_game, owner != (Entity_Player *)0x0)) { flagsHigh = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 0x80000; *(undefined4 *)((int)&this->_flags + 4) = flagsHigh; *(undefined1 *)((int)game->_room + 0x7769) = 1; } else { game = g_game; } this->_entityCollisionClass = 4; if (*(int *)((int)game->_room + 8) == 0x10) { this->_entityGridCollisionClass = 0; } if ((g_pickupIgnoreModifiers == 0) && (bVar3 = CanReroll(this), bVar3 != 0)) { owner = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x2b1,(RNG **)&game->_playerManager,1); game = g_game; if (owner == (Entity_Player *)0x0) { owner = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x15); if ((((((owner != (Entity_Player *)0x0) || (owner = PlayerManager::FirstBirthrightOwner(&game->_playerManager,0), owner != (Entity_Player *)0x0)) && ((this->_variant == 100 && (((((this->_cycleCollectibleCount == 0 && (this->_dead == 0)) && (iVar6 = this->_subtype, iVar6 != 0x29c)) && ((bVar3 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f), bVar3 == 0 || (iVar6 != -1)))) && (iVar6 != 0x272)))))) && ((iVar6 != 0x273 && (iVar6 != 0x147)))) && (iVar6 != 0x148)) && ((((iVar6 != 0xee && (iVar6 != 0xef)) && (iVar6 != 0x147)) && (iVar6 != 0x148)))) { uVar4 = (this->_dropRNG)._seed; local_3c = (EntityPtr)0x6; local_38 = (EntityPtr)this->_cycleCollectibleList; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 0xd; this->_cycleCollectibleCount = 1; local_34 = (ANM2 *)0x0; do { local_30 = g_game->_room; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> (local_2c._buf[0xc] & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)local_2c._size & 0x1f) ^ uVar4; uVar4 = uVar4 >> (local_3c._0_1_ & 0x1f) ^ uVar4; iVar6 = ItemPool::GetSeededCollectible(uVar4,0,*(RoomDescriptor **)&local_30->field_0x4) ; local_34 = (ANM2 *)((int)(local_34->_filename)._buf + 1); *(int *)local_38 = iVar6; local_38 = (EntityPtr)((int)local_38 + 4); } while (local_34 < (ANM2 *)this->_cycleCollectibleCount); } } else if (((((this->_variant == 100) && (this->_cycleCollectibleCount == 0)) && ((this->_dead == 0 && (iVar6 = this->_subtype, iVar6 != 0x29c)))) && (((bVar3 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f), bVar3 == 0 || (iVar6 != -1)) && ((iVar6 != 0x272 && (((iVar6 != 0x273 && (iVar6 != 0x147)) && (iVar6 != 0x148))))))) ) && (((iVar6 != 0xee && (iVar6 != 0xef)) && ((iVar6 != 0x147 && (iVar6 != 0x148))))) ) { uVar4 = (this->_dropRNG)._seed; local_30 = (Entity *)&DAT_00000006; local_38 = (EntityPtr)this->_cycleCollectibleList; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 0xd; this->_cycleCollectibleCount = 4; local_34 = (ANM2 *)0x0; do { local_3c = (EntityPtr)g_game->_room; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> (local_2c._buf[0xc] & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)local_2c._size & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_30 & 0x1f) ^ uVar4; iVar6 = ItemPool::GetSeededCollectible(uVar4,0,*(RoomDescriptor **)((int)local_3c + 4)); local_34 = (ANM2 *)((int)(local_34->_filename)._buf + 1); *(int *)local_38 = iVar6; local_38 = (EntityPtr)((int)local_38 + 4); } while (local_34 < (ANM2 *)this->_cycleCollectibleCount); } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x298,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { EVar9 = (EntityPtr)0x0; local_38 = (EntityPtr)0x0; local_54._shift1 = 0; local_54._shift2 = 0; local_54._shift3 = 0; local_8 = 1; local_30 = ItemConfig::GetTaggedItems(&g_manager->_itemConfig,0x40000); local_34 = (ANM2 *)0x0; local_3c = *(EntityPtr *)local_30; if (*(int *)&local_30->field_0x4 - (int)local_3c >> 2 == 0) { itemIdsBegin = (EntityPtr)0x0; LAB_006e0f56: iVar6 = 0x19; } else { itemIdsCapacity = (EntityPtr)0x0; do { taggedItem = *(int **)((int)local_3c + (int)local_34 * 4); iVar6 = *taggedItem; if (((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) { local_3c = *(EntityPtr *)(taggedItem + 1); if (EVar9 == itemIdsCapacity) { std::vector::_Emplace_reallocate(EVar9,&local_3c); EVar9 = (EntityPtr)local_54._shift2; itemIdsCapacity = (EntityPtr)local_54._shift3; } else { *(EntityPtr *)EVar9 = local_3c; local_54._shift2 = (int)EVar9 + 4; EVar9 = (EntityPtr)((int)EVar9 + 4); } } this = local_44; local_34 = (ANM2 *)((int)(local_34->_filename)._buf + 1); local_3c = *(EntityPtr *)local_30; } while (local_34 < (ANM2 *)(*(int *)&local_30->field_0x4 - (int)local_3c >> 2)); local_3c = (EntityPtr)local_54._shift1; itemIdsBegin = (EntityPtr)local_54._shift1; local_38 = itemIdsCapacity; if ((EntityPtr)local_54._shift1 == EVar9) goto LAB_006e0f56; local_2c._buf[8] = (undefined1)seed; local_2c._buf[9] = seed._1_1_; local_2c._buf[10] = seed._2_1_; local_2c._buf[0xb] = seed._3_1_; local_2c._buf[0xc] = '\x02'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 5; local_2c._capacity = 0xf; uVar4 = RNG::RandomInt((RNG *)(local_2c._buf + 8),(int)EVar9 - local_54._shift1 >> 2); iVar6 = *(int *)((int)local_3c + uVar4 * 4); itemIdsBegin = local_3c; } if ((uint)this->_cycleCollectibleCount < 8) { this->_cycleCollectibleList[this->_cycleCollectibleCount] = iVar6; this->_cycleCollectibleCount = this->_cycleCollectibleCount + 1; } local_8 = 0xffffffff; if (itemIdsBegin != (EntityPtr)0x0) { uVar4 = (int)local_38 - (int)itemIdsBegin & 0xfffffffc; EVar9 = itemIdsBegin; if (0xfff < uVar4) { EVar9 = *(EntityPtr *)((int)itemIdsBegin + -4); uVar4 = uVar4 + 0x23; if (0x1f < ((int)itemIdsBegin - (int)EVar9) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar9,uVar4); } } pcVar8 = g_game->_room; game = g_game; if (((*pcVar8 == '\0') || (g_game->_frameCount - *(int *)(pcVar8 + 0x11f0) < 2)) && (((g_manager->_persistentGameData)._achievements[0x251] != 0 || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { if (*(int *)(pcVar8 + 8) == 3) { local_2c._buf[8] = (undefined1)seed; local_2c._buf[9] = seed._1_1_; local_2c._buf[10] = seed._2_1_; local_2c._buf[0xb] = seed._3_1_; local_2c._buf[0xc] = '\x02'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 7; local_2c._capacity = 7; uVar4 = RNG::RandomInt((RNG *)(local_2c._buf + 8),0x10); if (uVar4 != 0) goto LAB_006e1039; LAB_006e106e: flags = this->_flags; flagsHighPtr = (uint *)((int)&this->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x100; *(int *)&this->_flags = (int)flags; } else { LAB_006e1039: game = g_game; if (*(int *)((int)g_game->_room + 8) != 7) goto LAB_006e108a; local_2c._buf[8] = (undefined1)seed; local_2c._buf[9] = seed._1_1_; local_2c._buf[10] = seed._2_1_; local_2c._buf[0xb] = seed._3_1_; local_2c._buf[0xc] = '\x02'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 7; local_2c._capacity = 7; uVar4 = RNG::RandomInt((RNG *)(local_2c._buf + 8),0x3c); if (uVar4 == 0) goto LAB_006e106e; } game = g_game; } } LAB_006e108a: if ((*(char *)game->_room != '\0') && (1 < game->_frameCount - *(int *)((int)game->_room + 0x11f0))) { flagsHigh = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags | 4; this->_visible = 0; *(undefined4 *)((int)&this->_flags + 4) = flagsHigh; } } this->_optionsPickupIndex = 0; owner = PlayerManager::FirstPlayerByType(&game->_playerManager,0x21); if (((((owner == (Entity_Player *)0x0) || (g_pickupIgnoreModifiers != 0)) || (this->_variant != 100)) || ((this->_price != 0 || (*(char *)game->_room != '\0')))) || (bVar3 = ItemConfig::IsQuestItem(this->_subtype), bVar3 != 0)) { local_44 = (Entity_Pickup *)0x21; std::set::find_node(&local_54._shift1,&local_44); if ((((((*(char *)(local_54._shift3 + 0xd) == '\0') && ((int)*(uint *)(local_54._shift3 + 0x10) < 0x22)) && (((void *)local_54._shift3 != (game->_seedEffects)._seedEffects && (((this->_variant != 0x14 && (bVar3 = CanReroll(this), bVar3 != 0)) && (uVar4 = this->_variant, uVar4 != 0x32)))))) && ((uVar4 != 0x3c && (uVar4 != 0x168)))) && ((uVar4 != 0x33 && (((uVar4 != 0x35 && (uVar4 != 0x34)) && ((uVar4 != 0x36 && (((uVar4 != 0x186 && (uVar4 != 0x37)) && (uVar4 != 0x38)))))))))) && ((uVar4 != 0x39 && (uVar4 != 0x3a)))) { iVar6 = this->_subtype; goto LAB_006e14ea; } } else { iVar6 = this->_subtype; uVar4 = 100; LAB_006e14ea: this->_shopItemId = -1; iVar6 = Room::GetShopItemPrice(game->_room,uVar4,iVar6,-1,(Entity_Player *)0x0); this->_price = iVar6; iVar6 = _Room::ResolveHeartSubType(this->_shopItemId,iVar6,0); this->_price = iVar6; } update_price_sprite(this,this->_price); iVar6 = this->_variant; if ((iVar6 == 10) && (g_game->_challenge == 0x22)) { (**(code **)(*(int *)this + 0x28))(); iVar6 = this->_variant; } if (iVar6 == 0x172) { if ((g_game->_challenge != 0x1f) || ((g_game->_stage == 1 && (g_game->_currentRoomIdx == g_game->_startingRoomIdx)))) goto LAB_006e15aa; (**(code **)(*(int *)this + 0x28))(); iVar6 = this->_variant; } if (iVar6 == 0x29) { this->_entityGridCollisionClass = 5; } else if (iVar6 == 0x2a) { (this->_sprite)._flipX = (byte)this->_initSeed & 1; } LAB_006e15aa: UpdateLootPreview(this); if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { KAGE_LogMessage(1,(byte *)"[Frame %d] "); } KAGE_LogMessage(1,(byte *)"Entity Pickup Initialized as: %d.%d.%d Seed: %08x \n"); this->_itemPoolType = (g_game->_itemPool)._lastPool; FUN_00862f00(this); ExceptionList = local_10; return; } //@@ 006e1640 Entity_Pickup::TryFlip /* ZHL [exact] __thiscall bool Entity_Pickup::TryFlip(Entity_Player * unusedPlayer, unsigned int unusedSeed); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Pickup::TryFlip(Entity_Pickup *this,Entity_Player *unusedPlayer,uint unusedSeed) { undefined4 *this_00; int *piVar1; int iVar2; void *state; void *extraout_EAX; EntitySaveState *outSaveState; uint uVar3; EntitySaveState local_8c [2]; int local_84; EntitySaveState *local_14; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afaf4f; local_10 = ExceptionList; this_00 = &this->_flipSaveState; if ((this->_flipSaveState == 0) || (this->_variant != 100)) { return 0; } ExceptionList = &local_10; EntitySaveState::constructor(local_8c); local_8 = 0; CanFlip(g_game->_room,this,outSaveState,0); (this->_dropRNG)._seed = *(int *)(*this_00 + 0x38); (this->_dropRNG)._shift1 = 5; (this->_dropRNG)._shift2 = 9; (this->_dropRNG)._shift3 = 7; piVar1 = (int *)*this_00; this->_initSeed = piVar1[0xd]; Morph(this,*piVar1,piVar1[1],piVar1[2],1,1,1); this->_isTouched = *(byte *)(*this_00 + 0x22); if (*(int *)(*this_00 + 100) != 0) { this->_cycleCollectibleCount = 0; uVar3 = 0; do { iVar2 = *(int *)(uVar3 + *(int *)(*this_00 + 100)); if (iVar2 == 0) break; if ((uint)this->_cycleCollectibleCount < 8) { this->_cycleCollectibleList[this->_cycleCollectibleCount] = iVar2; this->_cycleCollectibleCount = this->_cycleCollectibleCount + 1; } uVar3 = uVar3 + 4; } while (uVar3 < 0x20); } if (local_84 == 0) { state = (void *)0x0; } else { local_14 = operator_new(0x78); local_8._0_1_ = 1; if (local_14 == (EntitySaveState *)0x0) { state = (void *)0x0; } else { EntitySaveState::copy(local_14,local_8c); state = extraout_EAX; } local_8 = (uint)local_8._1_3_ << 8; } EntitySaveStateRef::Set(this_00,state); ANM2::Reset(&this->_altPedestalANM2); invoke_pending_callbacks(local_8c); ExceptionList = local_10; return 1; } //@@ 006e17c0 Entity_Pickup::UpdateLootPreview /* DB: Guppys Eye 665 on chest/sack, CreateLootPreview at +0x590 prototype: db/protos.zhl */ void __thiscall Entity_Pickup::UpdateLootPreview(Entity_Pickup *this) { void **ppvVar1; void *ptr; byte bVar2; uint uVar3; Entity_Player *pEVar4; Entity_Effect *pEVar5; int extraout_ECX; void *local_2c [5]; Vector local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afaf7d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; pEVar4 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x299,(RNG **)&g_game->_playerManager,1); if (pEVar4 != (Entity_Player *)0x0) { bVar2 = IsChest(this->_variant); if ((((bVar2 != 0) && (this->_subtype != 0)) || ((extraout_ECX == 0x45 && (this->_dead == 0)))) && (this->_timeout < 1)) { local_18.x = (this->_pos).x; local_18.y = (this->_pos).y; pEVar4 = Game::GetNearestPlayer(g_game,&local_18); GetChestLoot(this,local_2c,0,pEVar4); local_8 = (void *)0x0; ppvVar1 = &this->_pickupGhost; pEVar5 = Entity_Effect::CreateLootPreview(local_2c,&this->_pos,(Entity *)this,*ppvVar1); if (*ppvVar1 != pEVar5) { if (*ppvVar1 != (Entity_Effect *)0x0) { local_18.y = (float)ppvVar1; std::multiset::erase(&local_18.y); } *ppvVar1 = pEVar5; if (pEVar5 != (Entity_Effect *)0x0) { std::multiset::insert(ppvVar1); } } std::deque::clear(); ptr = local_2c[0]; local_2c[0] = (void *)0x0; operator_delete(ptr,8); ExceptionList = local_10; return; } } if (this->_pickupGhost != (int *)0x0) { (**(code **)(*(int *)this->_pickupGhost + 0x28))(uVar3); } ExceptionList = local_10; return; } //@@ 006e1910 FUN_006e1910 undefined4 FUN_006e1910(uint param_1) { code *pcVar1; byte bVar2; uint uVar3; undefined4 uVar4; int iVar5; int in_ECX; uint uVar6; int *local_8; if (((*(int *)(in_ECX + 0x2c) == 100) && (*(int *)(in_ECX + 0x5c0) == 0)) && (*(char *)(in_ECX + 0x173) == '\0')) { iVar5 = *(int *)(in_ECX + 0x30); bVar2 = Entity_Pickup::CanRerollVariant(100,iVar5); if ((((bVar2 != 0) && ((bVar2 = Entity_Pickup::IsChest(100), bVar2 == 0 || (iVar5 != 0)))) && (iVar5 != 0x272)) && (((iVar5 != 0x273 && (iVar5 != 0xee)) && ((iVar5 != 0xef && ((iVar5 != 0x147 && (iVar5 != 0x148)))))))) { uVar6 = *(uint *)(in_ECX + 0x3dc); uVar3 = param_1; if (8 < param_1) { uVar3 = 8; } param_1 = 0; *(uint *)(in_ECX + 0x5c0) = uVar3; if (uVar3 != 0) { local_8 = (int *)(in_ECX + 0x5a0); do { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar4 = (*pcVar1)(); return uVar4; } uVar6 = uVar6 >> 5 ^ uVar6; uVar6 = uVar6 << 0xd ^ uVar6; uVar6 = uVar6 >> 6 ^ uVar6; iVar5 = ItemPool::GetSeededCollectible (uVar6,0,*(RoomDescriptor **)((int)g_game->_room + 4)); param_1 = param_1 + 1; *local_8 = iVar5; local_8 = local_8 + 1; } while (param_1 < *(uint *)(in_ECX + 0x5c0)); } return 1; } } return 0; } //@@ 006e1a80 Entity_Pickup::SetAlternatePedestal /* ZHL [exact] __thiscall void Entity_Pickup::SetAlternatePedestal(int pedestalType); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Pickup::SetAlternatePedestal(Entity_Pickup *this,int pedestalType) { void *pvVar1; Entity_Pickup *this_00; Manager *pMVar2; byte bVar3; Vector *pVVar4; LayerState *pLVar5; EntityConfig_Entity *pEVar6; int iVar7; uint uVar8; Vector *pVVar9; void **ppvVar10; void **local_18; undefined1 local_14 [8]; void *local_c; if ((((this->_variant == 100) && (-1 < pedestalType)) && (this->_price == 0)) && (*(int *)((int)g_game->_room + 8) != 0x10)) { bVar3 = ANM2::SetOverlayAnimation(&this->_sprite,(byte *)"Alternates",1); if ((bVar3 != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)pedestalType); } pVVar4 = AnimationState::GetNullFrameById(&(this->_sprite)._overlayAnimState,0); pVVar9 = &g_vectorZero; if (pVVar4 != (Vector *)0x0) { pVVar9 = pVVar4; } pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); (pLVar5->_pos).x = pVVar9->x; (pLVar5->_pos).y = pVVar9->y; pMVar2 = g_manager; if (pedestalType == 0xb) { local_18 = (void **)0x518600; _Find_lower_bound<>(local_14,&local_18); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) < 0x518601)) && (local_c != (pMVar2->_entityConfig)._entities._head)) { pEVar6 = (EntityConfig_Entity *)((int)local_c + 0x18); } else { pEVar6 = EntityConfig::GetEntity(&pMVar2->_entityConfig,5,0,0); } Entity::SetSize((Entity *)this,pEVar6->collisionRadius,pEVar6->collisionRadiusMulti, pEVar6->gridCollisionPoints); return; } if ((pedestalType != 0xe) && (pedestalType != 0x13)) { pvVar1 = this->_config; Entity::SetSize((Entity *)this,*(float *)((int)pvVar1 + 0x38),*(Vector *)((int)pvVar1 + 0x3c), *(int *)((int)pvVar1 + 0x48)); return; } local_18 = (void **)0x503900; _Find_lower_bound<>(local_14,&local_18); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) < 0x503901)) && (local_c != (pMVar2->_entityConfig)._entities._head)) { pEVar6 = (EntityConfig_Entity *)((int)local_c + 0x18); } else { pEVar6 = EntityConfig::GetEntity(&pMVar2->_entityConfig,5,0,0); } Entity::SetSize((Entity *)this,pEVar6->collisionRadius,pEVar6->collisionRadiusMulti, pEVar6->gridCollisionPoints); if ((this->_megaChestCollectible[0] == (void *)0x0) && (this->_megaChestCollectible[1] == (void *)0x0)) { uVar8 = 0; local_18 = g_game->_room; if (local_18[0x499] != (void *)0x0) { while ((((this_00 = *(Entity_Pickup **)((int)local_18[0x497] + uVar8 * 4), this_00 == this || (this_00->_type != 5)) || ((this_00->_variant != 100 || ((((iVar7 = GetAlternatePedestal(this_00), iVar7 != 0xe && (iVar7 = GetAlternatePedestal(this_00), iVar7 != 0x13)) || ((this_00->_pos).x != (this->_pos).x)) || (((this_00->_pos).y != (this->_pos).y || (this_00->_megaChestCollectible[0] != (void *)0x0)))))))) || (this_00->_megaChestCollectible[1] != (void *)0x0))) { uVar8 = uVar8 + 1; if (local_18[0x499] <= uVar8) { return; } } ppvVar10 = this->_megaChestCollectible; if (this->_megaChestCollectible[0] != this_00) { if (this->_megaChestCollectible[0] != (Entity_Pickup *)0x0) { local_18 = ppvVar10; std::multiset::erase(&local_18); } *ppvVar10 = this_00; std::multiset::insert(ppvVar10); } ppvVar10 = this_00->_megaChestCollectible + 1; if (this_00->_megaChestCollectible[1] != this) { if (this_00->_megaChestCollectible[1] != (Entity_Pickup *)0x0) { local_18 = ppvVar10; std::multiset::erase(&local_18); } *ppvVar10 = this; std::multiset::insert(ppvVar10); } } } } return; } //@@ 006e1d70 Entity_Pickup::GetAlternatePedestal /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall int Entity_Pickup::GetAlternatePedestal(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Pickup::GetAlternatePedestal(Entity_Pickup *this) { void *other; bool bVar1; bool bVar2; byte bVar3; byte *****pppppbVar4; byte *****pppppbVar5; uint uVar6; uint size; byte *****local_20 [4]; uint local_10; uint local_c; byte ****local_8; local_8 = (byte ****)(__security_cookie ^ (uint)(local_20 + 7)); bVar2 = false; if (this->_variant == 100) { other = (this->_sprite)._overlayAnimState._animData; if (other == (void *)0x0) { local_20[0] = (byte *****)0x0; local_c = 0xf; local_10 = 0; } else { std::string::string((char *)local_20,other); } uVar6 = local_c; pppppbVar5 = local_20[0]; bVar2 = true; pppppbVar4 = (byte *****)local_20; if (0xf < local_c) { pppppbVar4 = local_20[0]; } bVar3 = str_eq((byte *)pppppbVar4,local_10,(byte *)"Alternates",10); if (bVar3 != 0) { bVar1 = true; goto LAB_006e1df5; } } else { pppppbVar5 = local_20[0]; uVar6 = local_c; } bVar1 = false; LAB_006e1df5: if ((bVar2) && (0xf < uVar6)) { size = uVar6 + 1; pppppbVar4 = pppppbVar5; if (0xfff < size) { pppppbVar4 = (byte *****)pppppbVar5[-1]; size = uVar6 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar5 + (-4 - (int)pppppbVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,size); } if (bVar1) { return (int)(this->_sprite)._overlayAnimState._animFrame; } return -1; } //@@ 006e1e60 Entity_Pickup::SetForceBlind /* ZHL [exact] __thiscall void Entity_Pickup::SetForceBlind(bool setBlind); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Pickup::SetForceBlind(Entity_Pickup *this,byte setBlind) { byte bVar1; bVar1 = this->_isForceBlind; this->_isForceBlind = setBlind; if (((this->_variant == 100) && (this->_subtype != 0)) && (bVar1 != setBlind)) { UpdateSprite(this,0); } return; } //@@ 006e1e90 Entity_Pickup::load_collectible_gfx /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: questionmark.png, collectible gfx; UpdateSprite */ void Entity_Pickup::load_collectible_gfx(uint param_1,uint param_2,char param_3) { code *pcVar1; LayerState *layer; int iVar2; ItemConfig_Item *itemConfig; std_string *text; ANM2 *in_ECX; char *ptr; byte *in_EDX; uint size; int id; undefined1 auStackY_100 [128]; void *texture; byte *textureRefCount; std_string gfxPath; char *questionMarkPath [3]; undefined8 local_30; uint questionMarkPathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; puStack_20 = (undefined1 *)(questionMarkPath + 0xe); local_14 = (char *)0xffffffff; puStack_18 = &LAB_00afafb5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(questionMarkPath + 0xb); if (param_1 == 0) { return; } ExceptionList = &local_1c; if (param_3 == '\0') { itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_1); std::string::string(gfxPath._buf,&itemConfig->gfxFilename); local_14 = (char *)0x1; if (g_game->_challenge == 0x20) { iVar2 = 0; local_30._0_1_ = '\v'; local_30._1_1_ = '\0'; local_30._2_1_ = '\0'; local_30._3_1_ = '\0'; local_30._4_4_ = 0x15; do { if (param_2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } param_2 = param_2 >> ((byte)local_30 & 0x1f) ^ param_2; param_2 = param_2 << (SUB81(local_30,4) & 0x1f) ^ param_2; param_2 = param_2 >> 0xd ^ param_2; id = param_2 % 0x2dc + 1; if ((((id != 0) && (id < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2)) && (id != 0xeb)) && (((id != 0x2b && (id != 0x3d)) && (itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,id), itemConfig != (ItemConfig_Item *)0x0)))) { text = &itemConfig->gfxFilename; if (&gfxPath != text) { if (0xf < (itemConfig->gfxFilename)._capacity) { text = *(std_string **)text->_buf; } std::string::assign(gfxPath._buf,(byte *)text,(itemConfig->gfxFilename)._size); } break; } iVar2 = iVar2 + 1; } while (iVar2 < 0xf); } texture = (void *)0x6e20d5; textureRefCount = in_EDX; layer = ANM2::GetLayer(in_ECX,in_EDX); if ((int)param_1 < 0) { KAGE::SmartPointer::operator_assign (auStackY_100 + 0x84,&(g_game->_proceduralItemManager)._renderTarget); LayerState::SetTexture(layer,texture,textureRefCount); layer = ANM2::GetLayer(in_ECX,in_EDX); (layer->_cropOffset).x = (float)(~param_1 & 0x1f) * 32.0; (layer->_cropOffset).y = (float)(~param_1 >> 5) * 32.0; layer = ANM2::GetLayer(in_ECX,in_EDX); layer->_spriteSheetLoaded = 1; LAB_006e2157: layer = ANM2::GetLayer(in_ECX,in_EDX); layer->_bitflags = layer->_bitflags & 0xffffffdf; } else { (layer->_cropOffset).x = g_vectorZero.x; (layer->_cropOffset).y = g_vectorZero.y; Sprite::ReplaceSpritesheet((Sprite *)in_ECX,(int)in_EDX,&gfxPath); if (param_1 != 0x279) goto LAB_006e2157; layer = ANM2::GetLayer(in_ECX,in_EDX); layer->_bitflags = layer->_bitflags | 0x20; } if (gfxPath._capacity < 0x10) { ExceptionList = local_1c; return; } size = gfxPath._capacity + 1; ptr = (char *)gfxPath._buf._0_4_; if (size < 0x1000) goto LAB_006e1fa4; ptr = *(char **)(gfxPath._buf._0_4_ + -4); iVar2 = gfxPath._buf._0_4_ - (int)ptr; } else { puStack_20 = (undefined1 *)(questionMarkPath + 0xe); layer = ANM2::GetLayer(in_ECX,in_EDX); (layer->_cropOffset).x = g_vectorZero.x; (layer->_cropOffset).y = g_vectorZero.y; questionMarkPath[0] = std::_Allocate(0x30); local_30._4_4_ = 0x27; questionMarkPathCapacity = 0x2f; builtin_strncpy(questionMarkPath[0],"gfx/Items/Collectibles/questionmark.png",0x28); local_14 = (char *)0x0; Sprite::ReplaceSpritesheet((Sprite *)in_ECX,(int)in_EDX,(std_string *)questionMarkPath); if (questionMarkPathCapacity < 0x10) { ExceptionList = local_1c; return; } size = questionMarkPathCapacity + 1; ptr = questionMarkPath[0]; if (size < 0x1000) goto LAB_006e1fa4; ptr = *(char **)(questionMarkPath[0] + -4); iVar2 = (int)questionMarkPath[0] - (int)ptr; gfxPath._capacity = questionMarkPathCapacity; } size = gfxPath._capacity + 0x24; if (0x1f < iVar2 - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_006e1fa4: operator_delete(ptr,size); ExceptionList = local_1c; return; } //@@ 006e21f0 Entity_Pickup::UpdateSprite /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ?per-variant spritesheet swaps (chest coinslot, IsaacBed_Barren, blind collectible) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Pickup::UpdateSprite(Entity_Pickup *this,byte isIgnoreBlind) { char **ppcVar1; uint uVar2; int iVar3; uint curses; undefined4 isBlind; int extraout_ECX; char *ptr; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; std_string spritesheetPath; uint local_24; char **ppcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *trinketConfigs; ppcStack_20 = (char **)((int)&spritesheetPath + 0x38); local_14 = 0xffffffff; puStack_18 = &LAB_00afb00d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)&spritesheetPath + 0x2cU; ExceptionList = &local_1c; iVar3 = this->_variant; local_24 = uVar2; if (iVar3 == 0x15e) { uVar2 = this->_subtype & 0x7fff; trinketConfigs = (g_manager->_itemConfig)._trinkets._begin; if ((int)uVar2 < (int)(g_manager->_itemConfig)._trinkets._end - (int)trinketConfigs >> 2) { iVar3 = *(int *)((int)trinketConfigs + uVar2 * 4); } else { iVar3 = 0; } ppcStack_20 = (char **)((int)&spritesheetPath + 0x38); std::string::string(spritesheetPath._buf,(void *)(iVar3 + 0x38)); local_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&spritesheetPath); (this->_sprite)._bitflags = (uint)this->_subtype >> 8 & 0x80; iVar3 = extraout_ECX; } else { if (iVar3 == 100) { ppcStack_20 = (char **)((int)&spritesheetPath + 0x38); if (((isIgnoreBlind == 0) && (ppcStack_20 = (char **)((int)&spritesheetPath + 0x38), g_game->_currentDimensionIdx != 2) ) && ((ppcStack_20 = (char **)((int)&spritesheetPath + 0x38), curses = Level::GetCurses((Level *)g_game), (curses & 0x40) != 0 || (this->_isForceBlind != 0)))) { isBlind = 1; } else { isBlind = 0; } load_collectible_gfx(this->_subtype,this->_initSeed,isBlind,uVar2); iVar3 = extraout_ECX_01; ppcVar1 = ppcStack_20; goto switchD_006e23e9_caseD_1; } if ((iVar3 == 0x17c) && (*(int *)((int)g_game->_room + 8) == 0x13)) { ppcStack_20 = (char **)((int)&spritesheetPath + 0x38); spritesheetPath._buf._0_4_ = std::_Allocate(0x30); spritesheetPath._size = 0x26; spritesheetPath._capacity = 0x2f; builtin_strncpy((char *)spritesheetPath._buf._0_4_,"gfx/Items/Pick Ups/IsaacBed_Barren.png", 0x27); local_14 = 1; goto LAB_006e23b6; } ppcVar1 = (char **)((int)&spritesheetPath + 0x38); if (this->_isPayToPlay == 0) goto switchD_006e23e9_caseD_1; iVar3 = iVar3 + -0x35; ppcVar1 = (char **)((int)&spritesheetPath + 0x38); switch(iVar3) { case 0: case 7: ppcStack_20 = (char **)((int)&spritesheetPath + 0x38); spritesheetPath._buf._0_4_ = std::_Allocate(0x40); spritesheetPath._size = 0x31; spritesheetPath._capacity = 0x3f; builtin_strncpy((char *)spritesheetPath._buf._0_4_, "gfx/Items/Pick Ups/Pickup_005_Chests_coinslot.png",0x32); local_14 = 2; break; default: goto switchD_006e23e9_caseD_1; case 2: ppcStack_20 = (char **)((int)&spritesheetPath + 0x38); spritesheetPath._buf._0_4_ = std::_Allocate(0x30); spritesheetPath._size = 0x2b; spritesheetPath._capacity = 0x2f; builtin_strncpy((char *)spritesheetPath._buf._0_4_, "gfx/Items/Pick Ups/dirty_chest_coinslot.png",0x2c); local_14 = 3; break; case 4: spritesheetPath._buf._0_4_ = std::_Allocate(0x30); spritesheetPath._size = 0x2a; spritesheetPath._capacity = 0x2f; builtin_strncpy((char *)spritesheetPath._buf._0_4_, "gfx/Items/Pick Ups/mega_chest_coinslot.png",0x2b); local_14 = 4; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&spritesheetPath); local_14 = 0xffffffff; iVar3 = extraout_ECX_03; ppcVar1 = ppcStack_20; if (spritesheetPath._capacity < 0x10) goto switchD_006e23e9_caseD_1; uVar2 = spritesheetPath._capacity + 1; ptr = (char *)spritesheetPath._buf._0_4_; if (0xfff < uVar2) { ptr = *(char **)(spritesheetPath._buf._0_4_ + -4); iVar3 = spritesheetPath._buf._0_4_ - (int)ptr; goto joined_r0x006e253b; } goto LAB_006e22cc; } LAB_006e23b6: Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&spritesheetPath); iVar3 = extraout_ECX_02; } local_14 = 0xffffffff; ppcVar1 = ppcStack_20; if (0xf < spritesheetPath._capacity) { uVar2 = spritesheetPath._capacity + 1; ptr = (char *)spritesheetPath._buf._0_4_; if (0xfff < uVar2) { ptr = *(char **)(spritesheetPath._buf._0_4_ + -4); iVar3 = spritesheetPath._buf._0_4_ - (int)ptr; joined_r0x006e253b: uVar2 = spritesheetPath._capacity + 0x24; if (0x1f < iVar3 - 4U) { local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_006e22cc: local_14 = 0xffffffff; operator_delete(ptr,uVar2); iVar3 = extraout_ECX_00; ppcVar1 = ppcStack_20; } switchD_006e23e9_caseD_1: ppcStack_20 = ppcVar1; ANM2::LoadGraphics(&this->_sprite,(byte)iVar3); ExceptionList = local_1c; return; } //@@ 006e2570 Entity_Pickup::update_price_sprite /* DB: ShopIdle/NumbersRed/Hearts/SummonPayment, called with _price in Init/Morph prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Pickup::update_price_sprite(Entity_Pickup *this,int price) { byte bVar1; uint uVar2; ItemConfig_Item *item; EntityConfig_Entity *priceConfig; char *anim; LayerState *layer; uint uVar3; EntityPtr paymentEffect; int iVar4; undefined4 belowGrid; GridEntity_Spikes *spikes; GridEntity *pGVar5; void *pvVar6; int gridWidth; int iVar7; bool isUnsummon; undefined1 local_20 [4]; undefined1 local_1c [4]; void *configNode; GridEntity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; EntityPtr *childSlot; Manager *manager; undefined4 *oldGrid; ANM2 *priceSprite; Room *room; local_8 = 0xffffffff; puStack_c = &LAB_00afb057; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; item = ItemConfig::GetCollectible(&g_manager->_itemConfig,this->_subtype); pGVar5 = (GridEntity *)this->_price; if ((((pGVar5 == (GridEntity *)0xfffffff6) && (item != (ItemConfig_Item *)0x0)) && ((item->tags & 0x200000000) != 0)) && (((price != 0 && (price != -6)) && (price != -10)))) { ExceptionList = local_10; return; } this->_price = price; local_14 = pGVar5; if (price == 0) { if (this->_variant == 100) { if (*(int *)((int)g_game->_room + 8) == 0x10) { (this->_posOffset).y = 0.0; } ANM2::Play(&this->_sprite,s_Idle,0); SetAlternatePedestal(this,0); } ANM2::Reset(&this->_priceANM2); } else { AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); if (*(int *)((int)g_game->_room + 8) == 0x10) { (this->_posOffset).y = -20.0; } manager = g_manager; price = 0x509600; _Find_lower_bound<>(local_20,&price); if (((*(char *)((int)configNode + 0xd) == '\0') && (*(uint *)((int)configNode + 0x10) < 0x509601)) && (configNode != (manager->_entityConfig)._entities._head)) { priceConfig = (EntityConfig_Entity *)((int)configNode + 0x18); } else { priceConfig = EntityConfig::GetEntity(&manager->_entityConfig,5,0,0); } priceSprite = &this->_priceANM2; ANM2::Load(priceSprite,&priceConfig->anm2Path,1); if ((this->_price < 0) && (this->_price != -1000)) { anim = "Hearts"; } else { iVar4 = this->_price; iVar7 = Room::GetShopItemPrice (g_game->_room,this->_variant,this->_subtype,this->_shopItemId, (Entity_Player *)0x0); if ((iVar4 < iVar7) || (anim = "NumbersWhite", iVar4 == -1000)) { anim = "NumbersRed"; } pGVar5 = local_14; } ANM2::SetAnimation(priceSprite,(byte *)anim,1); iVar4 = this->_price; if (iVar4 < 0) { if (iVar4 < -8) { if (iVar4 == -9) { if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,7.0); } } else if (iVar4 == -1000) { layer = ANM2::GetLayer(priceSprite,(byte *)0x0); layer->_visible = 0; ANM2::SetLayerFrame(priceSprite,1,0); ANM2::SetLayerFrame(priceSprite,2,10); } } else { switch(iVar4) { case -8: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,6.0); } break; case -7: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,5.0); } break; case -6: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,4.0); } if (pGVar5 == (GridEntity *)0xfffffff6) { room = g_game->_room; iVar4 = Room::GetGridIndex(room,&this->_pos); uVar3 = room->_gridWidth + iVar4; if (uVar3 < 0x1c0) { pvVar6 = room->_gridEntities[uVar3]; } else { pvVar6 = (void *)0x0; } iVar4 = __RTDynamicCast(pvVar6,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Spikes::RTTI_Type_Descriptor,0) ; if ((((iVar4 != 0) && (price = uVar3, uVar3 < 0x1c0)) && (iVar4 = *(int *)((int)g_game->_room + uVar3 * 4 + 0x24), iVar4 != 0)) && (*(int *)(iVar4 + 4) != 1)) { *(undefined4 *)((int)g_game->_room + uVar3 * 4 + 0x76c) = 900; std::set::insert(local_1c,&price); } } break; case -5: layer = ANM2::GetLayer(priceSprite,(byte *)0x0); layer->_visible = 0; layer = ANM2::GetLayer(priceSprite,(byte *)0x1); layer->_visible = 0; layer = ANM2::GetLayer(priceSprite,(byte *)0x2); childSlot = &this->_child; layer->_visible = 0; if (*childSlot == (EntityPtr)0x0) { uVar3 = Random(); paymentEffect = (EntityPtr) Game::SpawnEx(g_game,1000,0xae,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar3,0); if (*(EntityPtr *)((int)paymentEffect + 0x3bc) != (EntityPtr)0x0) { price = (int)((int)paymentEffect + 0x3bc); std::multiset::erase(&price); } *(EntityPtr *)((int)paymentEffect + 0x3bc) = (EntityPtr)this; std::multiset::insert((EntityPtr *)((int)paymentEffect + 0x3bc)); (**(code **)(*(int *)paymentEffect + 0xc))(); if (*childSlot != (EntityPtr)0x0) { price = (int)childSlot; std::multiset::erase(&price); } *childSlot = paymentEffect; std::multiset::insert(childSlot); } break; case -4: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,3.0); } break; case -3: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,2.0); } break; case -2: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,1.0); } break; case -1: if ((this->_priceANM2)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,0.0); } } } } else { if (iVar4 < 10) { layer = ANM2::GetLayer(priceSprite,(byte *)0x0); layer->_visible = 0; } else { price = iVar4 / 10; if (((this->_priceANM2)._animState._animData != (void *)0x0) && ((0 < *(int *)((int)(this->_priceANM2)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0 < *(int *)((int)(this->_priceANM2)._animState._animation + 0x80))))) { pvVar6 = (this->_priceANM2)._animState._animData; iVar4 = *(int *)((int)pvVar6 + 0x38); if ((pvVar6 == (void *)0x0) || ((iVar4 < 0 || (*(int *)((int)pvVar6 + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_priceANM2)._animState._layerFrames + iVar4 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_priceANM2)._animState,iVar4,(float)price); } } price = this->_price % 10; if ((this->_priceANM2)._animState._animData != (void *)0x0) { if ((1 < *(int *)((int)(this->_priceANM2)._animState._animation + 0x80)) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 1 < *(int *)((int)(this->_priceANM2)._animState._animation + 0x80))) { pvVar6 = (this->_priceANM2)._animState._animData; iVar4 = *(int *)((int)pvVar6 + 0x3c); if ((pvVar6 == (void *)0x0) || ((iVar4 < 0 || (*(int *)((int)pvVar6 + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_priceANM2)._animState._layerFrames + iVar4 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_priceANM2)._animState,iVar4,(float)price); } if (((this->_priceANM2)._animState._animData != (void *)0x0) && ((2 < *(int *)((int)(this->_priceANM2)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 2 < *(int *)((int)(this->_priceANM2)._animState._animation + 0x80))))) { pvVar6 = (this->_priceANM2)._animState._animData; iVar4 = *(int *)((int)pvVar6 + 0x40); if ((pvVar6 == (void *)0x0) || ((iVar4 < 0 || (*(int *)((int)pvVar6 + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_priceANM2)._animState._layerFrames + iVar4 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_priceANM2)._animState,iVar4,10.0); } } } if (this->_variant == 100) { bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"ShopIdle",1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; this->_entityCollisionClass = 1; pGVar5 = local_14; goto LAB_006e2c1a; } } else { ANM2::Play(&this->_sprite,s_Idle,0); } this->_entityCollisionClass = 1; pGVar5 = local_14; } LAB_006e2c1a: if ((this->_price != -5) && (this->_child != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_child + 0x28))(uVar2); } if ((pGVar5 == (GridEntity *)0xfffffff6) && (this->_price == 0)) { ANM2::Play(&this->_sprite,s_Idle,0); SetAlternatePedestal(this,0); uVar2 = Random(); Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2,0); manager = g_manager; price = 0x50; seed_fart_sound_override(&price); SoundEffects::Play(&manager->_sfxManager,price,1.0,2,0,1.0,0.0); pvVar6 = g_game->_room; iVar7 = (int)(((this->_pos).x - 40.0) / 40.0 + 0.5); iVar4 = (int)(((this->_pos).y - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (gridWidth = *(int *)((int)pvVar6 + 0xc), gridWidth <= iVar7)) || (iVar4 < 0)) || (*(int *)((int)pvVar6 + 0x10) <= iVar4)) { gridWidth = *(int *)((int)pvVar6 + 0xc); iVar7 = -1; } else { iVar7 = iVar4 * gridWidth + iVar7; } if ((uint)(iVar7 + gridWidth) < 0x1c0) { belowGrid = *(undefined4 *)((int)pvVar6 + (iVar7 + gridWidth) * 4 + 0x24); } else { belowGrid = 0; } spikes = (GridEntity_Spikes *) __RTDynamicCast(belowGrid,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Spikes::RTTI_Type_Descriptor,0); if (spikes == (GridEntity_Spikes *)0x0) { ExceptionList = local_10; return; } isUnsummon = (spikes->_desc)._type == 0x1c; } else { if (this->_price == -10) { pvVar6 = g_game->_room; iVar7 = (int)(((this->_pos).x - 40.0) / 40.0 + 0.5); iVar4 = (int)(((this->_pos).y - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (gridWidth = *(int *)((int)pvVar6 + 0xc), gridWidth <= iVar7)) || (iVar4 < 0)) || (*(int *)((int)pvVar6 + 0x10) <= iVar4)) { gridWidth = *(int *)((int)pvVar6 + 0xc); iVar7 = -1; } else { iVar7 = iVar4 * gridWidth + iVar7; } uVar2 = iVar7 + gridWidth; if (uVar2 < 0x1c0) { belowGrid = *(undefined4 *)((int)pvVar6 + uVar2 * 4 + 0x24); } else { belowGrid = 0; } iVar4 = __RTDynamicCast(belowGrid,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Spikes::RTTI_Type_Descriptor,0); if ((iVar4 != 0) && (*(int *)(iVar4 + 4) == 0x1c)) { if (*(int *)(iVar4 + 0xc) == 1) { *(undefined4 *)(iVar4 + 0xc) = 0; ANM2::Play((ANM2 *)(iVar4 + 0x40),(byte *)"SummonPayment",0); ExceptionList = local_10; return; } ExceptionList = local_10; return; } pvVar6 = g_game->_room; if ((uVar2 < 0x1c0) && ((oldGrid = *(undefined4 **)((int)pvVar6 + uVar2 * 4 + 0x24), oldGrid != (undefined4 *)0x0 && (oldGrid[1] != 1)))) { *(undefined4 *)((int)pvVar6 + uVar2 * 4 + 0x76c) = 900; *(undefined4 *)((int)pvVar6 + uVar2 * 4 + 0x24) = 0; (**(code **)*oldGrid)(1); } pvVar6 = g_game->_room; price = Random(); if (((int)uVar2 < 0) || (0x1bf < (int)uVar2)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (0x1bf < uVar2) { ExceptionList = local_10; return; } if (900 < *(int *)((int)pvVar6 + uVar2 * 4 + 0x76c)) { ExceptionList = local_10; return; } pGVar5 = operator_new(0x158); local_8 = 0xd; local_14 = pGVar5; if (pGVar5 == (GridEntity *)0x0) { pGVar5 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar5); *(undefined ***)pGVar5 = IsaacRepentancePlus::GridEntity_Spikes::vftable; } local_8 = 0xffffffff; if (pGVar5 == (GridEntity *)0x0) { ExceptionList = local_10; return; } (pGVar5->_desc)._type = 0x1c; pGVar5->_gridIndex = uVar2; oldGrid = *(undefined4 **)((int)pvVar6 + uVar2 * 4 + 0x24); if (oldGrid != (undefined4 *)0x0) { (**(code **)*oldGrid)(1); } *(GridEntity **)((int)pvVar6 + uVar2 * 4 + 0x24) = pGVar5; (pGVar5->_desc)._variant = 0; (pGVar5->_desc)._varData = 0; GridEntity::Init(pGVar5,price); ExceptionList = local_10; return; } room = g_game->_room; iVar4 = Room::GetGridIndex(room,&this->_pos); uVar2 = iVar4 + room->_gridWidth; if (uVar2 < 0x1c0) { pvVar6 = room->_gridEntities[uVar2]; } else { pvVar6 = (void *)0x0; } spikes = (GridEntity_Spikes *) __RTDynamicCast(pvVar6,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Spikes::RTTI_Type_Descriptor,0); if (spikes == (GridEntity_Spikes *)0x0) { ExceptionList = local_10; return; } if ((spikes->_desc)._type != 0x1c) { ExceptionList = local_10; return; } isUnsummon = (spikes->_desc)._state == 0; } if (isUnsummon) { GridEntity_Spikes::unsummon(spikes,0); } ExceptionList = local_10; return; } //@@ 006e2ff0 FUN_006e2ff0 void FUN_006e2ff0(int param_1) { int in_ECX; *(int *)(in_ECX + 0x588) = param_1; if ((param_1 != 0) && (param_1 != -1)) { *(undefined4 *)(in_ECX + 0x5c0) = 0; } return; } //@@ 006e3020 Entity_Pickup::AppearFast /* ZHL [lua] Lua binding EntityPickup:AppearFast */ void __thiscall Entity_Pickup::AppearFast(Entity_Pickup *this) { byte bVar1; byte *pbVar2; uint uVar3; int iVar4; char *pcVar5; bool bVar6; if ((((this->_variant == 0x14) && (this->_subtype == 1)) && ((this->_sprite)._animState._animData != (void *)0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { pbVar2 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pcVar5 = "Appear"; do { bVar1 = *pbVar2; bVar6 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_006e3070: uVar3 = -(uint)bVar6 | 1; goto LAB_006e3075; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar6 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_006e3070; pbVar2 = pbVar2 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_006e3075: if (uVar3 == 0) { iVar4 = ANM2::GetFrame(&this->_sprite); if (iVar4 == 0) { ANM2::Play(&this->_sprite,(byte *)"AppearFast",0); } } } return; } //@@ 006e30a0 Entity_Pickup::Morph /* ZHL [lua] Lua binding EntityPickup:Morph prototype: REPENTOGON, confirmed by RET 24 */ void __thiscall Entity_Pickup::Morph (Entity_Pickup *this,int EntityType,int Variant,int SubType,byte KeepPrice,byte KeepSeed, byte IgnoreModifiers) { std_multiset *referrers; code *pcVar1; byte bVar2; char cVar3; uint uVar4; uint uVar5; int pedestalType; ItemConfig_Item *collectible; void *pvVar6; int *piVar7; int price; void *pvVar8; undefined4 *otherSaveState; uint pickIndex; int newSubType; ItemConfig *itemConfig; bool isNewItem; undefined3 in_stack_00000015; undefined3 in_stack_00000019; int *local_34; int *local_30; undefined1 local_2c [4]; int *local_28; RNG local_24; byte savedIsForceBlind; undefined1 savedField52d; byte savedIsTouched; void *local_10; undefined1 *puStack_c; undefined4 local_8; void **linkSlot; EntityPtr savedChild; int savedCoopDuplicateIndex; qword savedFlags; int savedIgnoreModifiers; int savedIndex; int savedItemPoolType; void *savedMegaChestPartner; int savedOptionsPickupIndex; EntityPtr savedParent; float savedPosX; float savedPosY; int savedShopItemId; int savedState; EntityPtr savedTarget; float savedTargetX; float savedTargetY; int savedTimeout; float savedVelocityX; float savedVelocityY; undefined4 swapTmp; local_8 = 0xffffffff; puStack_c = &LAB_00afb095; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; if (KeepSeed == 0) { uVar5 = this->_initSeed; local_24._shift1 = 1; local_24._shift2 = 0x15; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> 1 ^ uVar5; uVar5 = uVar5 << 0x15 ^ uVar5; this->_initSeed = uVar5 >> 0x14 ^ uVar5; } if (1 < *(int *)&g_game->_deathmatchManager) { ItemPool::ReplaceBlacklistedPickup ((g_game->_deathmatchManager)._type,&EntityType,&Variant,&SubType); } savedParent = this->_parent; savedTargetX = (this->_targetPosition).x; savedChild = this->_child; savedTarget = this->_target; savedShopItemId = this->_shopItemId; savedIsTouched = this->_isTouched; savedCoopDuplicateIndex = this->_coopDuplicateIndex; savedTargetY = (this->_targetPosition).y; savedField52d = this->field_0x52d; savedPosX = (this->_pos).x; savedIsForceBlind = this->_isForceBlind; savedPosY = (this->_pos).y; savedOptionsPickupIndex = this->_optionsPickupIndex; savedTimeout = this->_timeout; savedVelocityX = (this->_velocity).x; savedIndex = this->_index; savedVelocityY = (this->_velocity).y; savedState = this->_state; pedestalType = GetAlternatePedestal(this); pvVar8 = this->_megaChestCollectible[1]; savedMegaChestPartner = this->_megaChestCollectible[0]; FUN_004d7190(&this->_flipSaveState); savedIgnoreModifiers = g_pickupIgnoreModifiers; local_8 = 0; savedFlags = this->_flags; local_28 = *(int **)((int)&this->_flags + 4); if (IgnoreModifiers != 0) { g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; } savedItemPoolType = this->_itemPoolType; if ((savedItemPoolType == 3) && (this->_price == 0)) { _IgnoreModifiers = this->_initSeed; itemConfig = &g_manager->_itemConfig; collectible = ItemConfig::GetCollectible(itemConfig,this->_subtype); newSubType = SubType; if (((collectible != (ItemConfig_Item *)0x0) && ((collectible->tags & 0x200000000) != 0)) && ((collectible = ItemConfig::GetCollectible(itemConfig,SubType), collectible == (ItemConfig_Item *)0x0 || (bVar2 = Item::HasTags(collectible,0x200000000), bVar2 == 0)))) { pvVar6 = ItemConfig::GetTaggedItems(itemConfig,0x200000000); std::vector::copy_constructor(pvVar6); local_8 = CONCAT31(local_8._1_3_,1); isNewItem = false; uVar5 = local_24._shift2 - local_24._shift1; SubType = this->_subtype; newSubType = SubType; if (3 < uVar5) { do { if (isNewItem) break; if (_IgnoreModifiers == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } _IgnoreModifiers = _IgnoreModifiers >> 5 ^ _IgnoreModifiers; _IgnoreModifiers = _IgnoreModifiers << 9 ^ _IgnoreModifiers; _IgnoreModifiers = _IgnoreModifiers >> 7 ^ _IgnoreModifiers; pickIndex = 0; if ((int)uVar5 >> 2 != 0) { pickIndex = _IgnoreModifiers % (uint)((int)uVar5 >> 2); } newSubType = *(int *)(*(int *)(local_24._shift1 + pickIndex * 4) + 4); isNewItem = newSubType != this->_subtype; _KeepSeed = (void **)CONCAT13(isNewItem,_KeepSeed); if (isNewItem) { uVar5 = 0; if (this->_cycleCollectibleCount != 0) { piVar7 = this->_cycleCollectibleList; do { if (newSubType == *piVar7) { isNewItem = false; break; } uVar5 = uVar5 + 1; piVar7 = piVar7 + 1; } while (uVar5 < (uint)this->_cycleCollectibleCount); } } uVar5 = local_24._shift2 - local_24._shift1; } while (3 < uVar5); SubType = newSubType; } newSubType = SubType; local_8 = (uint)local_8._1_3_ << 8; FID_conflict__Tidy(&local_24._shift1); } } else { newSubType = SubType; } if (KeepPrice == 0) { price = 0; } else { price = this->_price; } if (((this->_price == 0) || (KeepPrice == 0)) || (newSubType != 0)) { (**(code **)(*(int *)this + 4))(EntityType,Variant,newSubType,this->_initSeed,uVar4); } else { local_24._seed = this->_initSeed; local_24._shift1 = 5; local_24._shift2 = 9; local_24._shift3 = 7; if (this->_shopItemId < 0) { RNG::Next(&local_24); newSubType = 0; } else { uVar4 = RNG::Next(&local_24); pickup_roll_random_variant(this->_shopItemId,&Variant,&SubType,uVar4); newSubType = SubType; } price = Room::GetShopItemPrice (g_game->_room,Variant,newSubType,this->_shopItemId,(Entity_Player *)0x0); _KeepSeed = (void **)_Room::ResolveHeartSubType(this->_shopItemId,price,0); pcVar1 = *(code **)(*(int *)this + 4); uVar4 = RNG::Next(&local_24); (*pcVar1)(EntityType,Variant,newSubType,uVar4); price = (int)_KeepSeed; } this->_itemPoolType = savedItemPoolType; g_pickupIgnoreModifiers = savedIgnoreModifiers; this->_index = savedIndex; *(int *)&this->_flags = (int)savedFlags; *(int **)((int)&this->_flags + 4) = local_28; (this->_targetPosition).x = savedTargetX; this->_parent = savedParent; this->_child = savedChild; (this->_targetPosition).y = savedTargetY; this->_target = savedTarget; (this->_pos).x = savedPosX; this->_isTouched = savedIsTouched; (this->_pos).y = savedPosY; this->_coopDuplicateIndex = savedCoopDuplicateIndex; (this->_velocity).x = savedVelocityX; this->field_0x52d = savedField52d; (this->_velocity).y = savedVelocityY; this->_optionsPickupIndex = savedOptionsPickupIndex; this->_visible = 1; this->_timeout = savedTimeout; this->_charge = 0; this->_varData = 0; this->_state = 0; this->_invisibleFrames = 0; if ((Variant == 100) && (this->_subtype != 0)) { collectible = ItemConfig::GetCollectible(&g_manager->_itemConfig,this->_subtype); if ((collectible != (ItemConfig_Item *)0x0) && (collectible->type == 3)) { this->_charge = collectible->_initCharge; } this->_state = savedState; } this->_shopItemId = savedShopItemId; update_price_sprite(this,price); SetAlternatePedestal(this,pedestalType); bVar2 = this->_isForceBlind; this->_isForceBlind = savedIsForceBlind; if (((this->_variant == 100) && (this->_subtype != 0)) && (bVar2 != savedIsForceBlind)) { UpdateSprite(this,0); } piVar7 = (this->_entityPtrReferrers)._head; referrers = &this->_entityPtrReferrers; _KeepSeed = (void **)*piVar7; if (_KeepSeed != (void **)piVar7) { do { *(undefined4 *)_KeepSeed[4] = 0; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&KeepSeed); piVar7 = referrers->_head; } while (_KeepSeed != (void **)piVar7); } FID_conflict__Erase_tree_>_> (referrers,(fuzzer_allocator_> *)referrers, (_Tree_node *)piVar7[1]); piVar7[1] = (int)piVar7; *piVar7 = (int)piVar7; piVar7[2] = (int)piVar7; (this->_entityPtrReferrers)._size = 0; if (pvVar8 != (void *)0x0) { pvVar6 = this->_megaChestCollectible[1]; linkSlot = this->_megaChestCollectible + 1; if (pvVar6 != pvVar8) { if (pvVar6 != (void *)0x0) { _KeepSeed = linkSlot; std::multiset::erase(&KeepSeed); } *linkSlot = pvVar8; std::multiset::insert(linkSlot); pvVar6 = *linkSlot; } linkSlot = (void **)((int)pvVar6 + 0x594); if (*(Entity_Pickup **)((int)pvVar6 + 0x594) != this) { if (*(Entity_Pickup **)((int)pvVar6 + 0x594) != (Entity_Pickup *)0x0) { _KeepSeed = linkSlot; std::multiset::erase(&KeepSeed); } *linkSlot = this; std::multiset::insert(linkSlot); } } if (savedMegaChestPartner != (void *)0x0) { pvVar8 = this->_megaChestCollectible[0]; linkSlot = this->_megaChestCollectible; if (pvVar8 != savedMegaChestPartner) { if (pvVar8 != (void *)0x0) { _KeepSeed = linkSlot; std::multiset::erase(&KeepSeed); } *linkSlot = savedMegaChestPartner; std::multiset::insert(linkSlot); pvVar8 = *linkSlot; } linkSlot = (void **)((int)pvVar8 + 0x598); if (*(Entity_Pickup **)((int)pvVar8 + 0x598) != this) { if (*(Entity_Pickup **)((int)pvVar8 + 0x598) != (Entity_Pickup *)0x0) { _KeepSeed = linkSlot; std::multiset::erase(&KeepSeed); } *linkSlot = this; std::multiset::insert(linkSlot); } } if (((local_34 != (int *)0x0) && (*local_34 == this->_type)) && (local_34[1] == this->_variant)) { otherSaveState = (undefined4 *)FUN_004d7190(&local_34); swapTmp = otherSaveState[1]; otherSaveState[1] = *(undefined4 *)&this->field_0x5cc; *(undefined4 *)&this->field_0x5cc = swapTmp; swapTmp = *otherSaveState; *otherSaveState = this->_flipSaveState; this->_flipSaveState = swapTmp; local_8 = CONCAT31(local_8._1_3_,2); if (((local_28 != (int *)0x0) && (cVar3 = (**(code **)(*local_28 + 0xc))(), cVar3 != '\0')) && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(local_2c); } } local_8 = 3; if (((local_30 != (int *)0x0) && (cVar3 = (**(code **)(*local_30 + 0xc))(), cVar3 != '\0')) && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(&local_34); } ExceptionList = local_10; return; } //@@ 006e3800 Entity_Pickup::TryThrow /* ZHL [vtable slot 21] */ uint __thiscall Entity_Pickup::TryThrow(Entity_Pickup *this,undefined4 *param_2,float *param_3,uint param_4) { float fVar1; byte bVar2; undefined3 extraout_var; float *pfVar3; int extraout_EDX; bVar2 = IsChest(this->_variant); pfVar3 = (float *)CONCAT31(extraout_var,bVar2); if (bVar2 != 0) { pfVar3 = (float *)(*(uint *)(extraout_EDX + 0x16c) & 0x4000000); if (pfVar3 == (float *)0x0) { *(undefined4 *)(extraout_EDX + 0x34) = *param_2; *(undefined4 *)(extraout_EDX + 0x38) = param_2[1]; *(undefined4 *)(extraout_EDX + 0x6e4) = 0; *(undefined4 *)(extraout_EDX + 0x350) = 0; *(float *)(extraout_EDX + 0x360) = *(float *)(extraout_EDX + 0x360) + *param_3; fVar1 = param_3[1]; *(undefined4 *)(extraout_EDX + 0x168) = *(undefined4 *)(extraout_EDX + 0x168); *(uint *)(extraout_EDX + 0x16c) = *(uint *)(extraout_EDX + 0x16c) & 0xfdffffff | 0x4000000; *(undefined1 *)(extraout_EDX + 0x171) = 1; *(float *)(extraout_EDX + 0x364) = fVar1 + *(float *)(extraout_EDX + 0x364); *(uint *)(extraout_EDX + 0x6e8) = param_4 ^ 0x80000000; pfVar3 = param_3; } } return (uint)pfVar3 & 0xffffff00; } //@@ 006e38d0 Entity_Pickup::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_Pickup::Interpolate(Entity_Pickup *this) { byte bVar1; float *pfVar2; Entity *this_00; float local_c; float local_8; bVar1 = IsChest(this->_variant); if (bVar1 != 0) { local_c = 0.0; local_8 = (float)this_00[1]._entityRef4._entity * this_00->_speedMultiplier * 0.5 + (float)this_00[1]._entityRef4._flags; pfVar2 = &local_8; if (0.0 <= local_8) { pfVar2 = &local_c; } (this_00->_posOffset).y = *pfVar2; } Entity::Interpolate(this_00); return; } //@@ 006e3940 Entity_Pickup::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Pickup::Update(Entity_Pickup *this) { uint *puVar1; code *pcVar2; ANM2 other; Vector pos; void **ppvVar3; byte bVar4; char cVar5; int iVar6; uint uVar7; Entity *pEVar8; Entity_Player *player; std_string *animName; byte *pbVar9; Vector *freePos; Vector *pVVar10; RNG *explosionSprite; uint uVar11; EntityPtr EVar12; void *pvVar13; char *pcVar14; int extraout_ECX; PlayerManager *playerManager; int *piVar15; undefined1 *puVar16; int extraout_EDX; code *extraout_EDX_00; byte *pbVar17; code *extraout_EDX_01; Game *game; Room *ptr; Entity *pEVar18; bool bVar19; float fVar20; float fVar21; float fVar22; float fVar23; Room *pRVar24; undefined8 uVar25; double dVar26; ANM2 aAStackY_8d5c [128]; undefined1 in_stack_fffffdb8 [244]; float in_stack_fffffeac; float in_stack_fffffeb0; EntityPtr in_stack_fffffeb4; Vector *in_stack_fffffeb8; Vector *in_stack_fffffebc; undefined4 in_stack_fffffec0; PlayerManager *in_stack_fffffec4; int iVar27; ColorMod lerpedColor; Entity_Pickup *local_f8; Vector local_f4; byte isDead; RNG local_e8; int *local_d4; Room *local_d0; Entity *local_cc; Vector local_c8; byte local_bd; undefined1 local_bc [32]; int animNameSize; undefined1 *animNameCapacity; Color tmpColor; undefined1 local_68 [24]; float local_50; undefined1 local_4c [12]; Entity *local_40; undefined1 local_34 [12]; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ANM2 *explosionSprite; qword flags; undefined4 flagsHigh; Manager *manager; ColorMod *spriteColor; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00afb109; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_34 + 0x24); ppvVar3 = &local_1c; if (0 < this->_dropDelay) { if (this->_entityCollisionClass == 0) { this->_dropDelay = this->_dropDelay + -1; return; } ExceptionList = &local_1c; this->_dropDelay = 0; ppvVar3 = ExceptionList; } ExceptionList = ppvVar3; fVar21 = *(float *)(this + 1); local_f8 = this; if ((fVar21 < 0.0) || (puVar16 = local_34 + 0x30, *(float *)&this[1].field_0x4 <= 0.0 && *(float *)&this[1].field_0x4 != 0.0)) { fVar23 = this->_speedMultiplier; iVar6 = 4; fVar20 = *(float *)&this[1].field_0x4; if (fVar21 < -50.0) { iVar6 = 0; } this->_entityCollisionClass = iVar6; iVar6 = 6; if (fVar21 < -50.0) { iVar6 = 3; } this->_entityGridCollisionClass = iVar6; *(float *)&this[1].field_0x4 = fVar23 * 1.2 + fVar20; *(float *)(this + 1) = fVar23 * fVar20 + fVar21; puVar16 = local_34 + 0x30; if (this->_collidesWithGrid != 0) { bVar4 = IsChest(this->_variant); puVar16 = puStack_20; if ((bVar4 != 0) && (this->_subtype != 0)) { in_stack_fffffec4 = (PlayerManager *)0x6e3a57; bVar4 = TryOpenChest(this,(Entity_Player *)0x0); puVar16 = puStack_20; if ((bVar4 != 0) && ((iVar6 = *(int *)((int)g_game->_room + 8), iVar6 == 0xb || (iVar6 == 0x11)))) { Ambush::StartChallenge(&g_game->_ambush); puVar16 = puStack_20; } } } puStack_20 = puVar16; puVar16 = puStack_20; if (0.0 <= *(float *)(this + 1)) { flags = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & 0xfbffffff; iVar6 = this->_variant; *(undefined4 *)(this + 1) = 0; *(undefined4 *)&this[1].field_0x4 = 0; *(int *)&this->_flags = (int)flags; this->_entityCollisionClass = 4; this->_entityGridCollisionClass = 5; bVar4 = IsChest(iVar6); puVar16 = puStack_20; if ((bVar4 != 0) && (this->_subtype != 0)) { in_stack_fffffec4 = (PlayerManager *)0x6e3af2; bVar4 = TryOpenChest(this,(Entity_Player *)0x0); puVar16 = puStack_20; if ((bVar4 != 0) && ((iVar6 = *(int *)((int)g_game->_room + 8), iVar6 == 0xb || (iVar6 == 0x11)))) { Ambush::StartChallenge(&g_game->_ambush); puVar16 = puStack_20; } } } } puStack_20 = puVar16; iVar6 = this->_variant; iVar27 = 0x6e3b2b; bVar4 = IsChest(iVar6); if (((bVar4 != 0) && (EVar12 = this->_parent, (this->_posOffset).y = *(float *)(this + 1), EVar12 != (EntityPtr)0x0 )) && ((this->_flags & 0x200000000000000) != 0)) { fVar21 = *(float *)((int)this->_parent + 0x340); fVar23 = (this->_pos).y; (this->_velocity).x = *(float *)((int)this->_parent + 0x33c) - (this->_pos).x; (this->_velocity).y = fVar21 - fVar23; iVar6 = this->_variant; } if (iVar6 == 100) { if ((this->_flags & 4) != 0) { uVar7 = Random(); pVVar10 = &this->_pos; in_stack_fffffec4 = (PlayerManager *)0x0; in_stack_fffffec0._0_1_ = 0; in_stack_fffffec0._1_1_ = 0; in_stack_fffffec0._2_2_ = 0; in_stack_fffffebc = &g_vectorZero; in_stack_fffffeb4 = (EntityPtr)0xf; in_stack_fffffeb0 = 1.4013e-42; in_stack_fffffeac = 1.0123364e-38; in_stack_fffffeb8 = pVVar10; pEVar8 = Game::Spawn(g_game,1000,0xf,pVVar10,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)pEVar8 + 0xc))(); flagsHigh = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags & 0xfffffffb; *(undefined4 *)((int)&this->_flags + 4) = flagsHigh; iVar27 = 0x6e3bf1; iVar6 = PlayerManager::GetGFuelCount(); if (1 < iVar6) { uVar7 = Random(); in_stack_fffffeac = 1.0123468e-38; local_cc = Game::Spawn(g_game,1000,0xf,pVVar10,&g_vectorZero,(Entity *)0x0,0,uVar7); local_4c._8_4_ = 0.0; explosionSprite = &local_cc->_sprite; local_40 = (Entity *)0xf; local_68._20_4_ = 0.0; local_d0 = (Room *)explosionSprite; local_68._20_4_ = std::_Allocate(0x30); local_4c._8_4_ = &DAT_00000027; local_40 = (Entity *)&DAT_0000002f; builtin_strncpy((char *)local_68._20_4_,"gfx/promo/gfuel/effects/explosion4.anm2",0x28); local_14 = 0; ANM2::Load(explosionSprite,(std_string *)(local_68 + 0x14),1); local_14 = 0xffffffff; if ((Entity *)&DAT_0000000f < local_40) { piVar15 = (int *)&local_40->field_0x1; pcVar14 = (char *)local_68._20_4_; if ((undefined1 *)0xfff < piVar15) { pcVar14 = *(char **)(local_68._20_4_ + -4); piVar15 = &local_40->_collisionIndex; if ((char *)0x1f < (char *)(local_68._20_4_ + (-4 - (int)pcVar14))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar14,(uint)piVar15); } uVar7 = Random(); manager = g_manager; local_e8._shift3 = 0x33d; local_c8.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; seed_fart_sound_override(&local_e8._shift3); in_stack_fffffebc = (Vector *)0x2; in_stack_fffffeb8 = (Vector *)0x3f800000; in_stack_fffffeb0 = 1.0123948e-38; in_stack_fffffeb4 = (EntityPtr)local_e8._shift3; SoundEffects::Play(&manager->_sfxManager,local_e8._shift3,1.0,2,0,local_c8.y,0.0); Game::ShakeScreen(g_game,10); uVar7 = Random(); pEVar8 = local_cc; (local_cc->_sprite)._flipX = ((byte)uVar7 ^ 0xff) & 1; in_stack_fffffec4 = (PlayerManager *)&(local_cc->_sprite)._animDefaultName; if (0xf < (local_cc->_sprite)._animDefaultName._capacity) { in_stack_fffffec4 = *(PlayerManager **)((std_string *)in_stack_fffffec4)->_buf; } in_stack_fffffec0._0_1_ = 0xab; in_stack_fffffec0._1_1_ = 0x3d; in_stack_fffffec0._2_2_ = 0x6e; bVar4 = ANM2::SetAnimation(&local_cc->_sprite,(byte *)in_stack_fffffec4,1); pRVar24 = local_d0; if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(local_d0->_gridEntities + 3)); *(undefined1 *)(pRVar24->_gridEntities + 8) = 1; pEVar8 = local_cc; } iVar27 = 0x6e3dce; (**(code **)(*(int *)pEVar8 + 0xc))(); } } if (((this->_visible == 0) && (this->_entityCollisionClass != 0)) && (this->_invisibleFrames = this->_invisibleFrames + 1, 3 < this->_invisibleFrames)) { this->_visible = 1; } if ((this->_flipSaveState == 0) || (this->_variant != 100)) { LAB_006e3e26: bVar4 = 0; } else { iVar27 = 1; in_stack_fffffec4 = &g_game->_playerManager; in_stack_fffffec0._0_1_ = 199; in_stack_fffffec0._1_1_ = 2; in_stack_fffffec0._2_2_ = 0; in_stack_fffffebc = (Vector *)0x6e3e1e; player = PlayerManager::FirstCollectibleOwner (in_stack_fffffec4,0x2c7,(RNG **)in_stack_fffffec4,1); if (player == (Entity_Player *)0x0) goto LAB_006e3e26; bVar4 = 1; } if (bVar4 != (this->_altPedestalANM2)._loaded) { if (bVar4 == 0) { ANM2::Reset(&this->_altPedestalANM2); } else { ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x248),&this->_sprite); other._championColor._offset[0] = in_stack_fffffeac; other._filename._buf[0] = in_stack_fffffdb8[0]; other._filename._buf[1] = in_stack_fffffdb8[1]; other._filename._buf[2] = in_stack_fffffdb8[2]; other._filename._buf[3] = in_stack_fffffdb8[3]; other._filename._buf[4] = in_stack_fffffdb8[4]; other._filename._buf[5] = in_stack_fffffdb8[5]; other._filename._buf[6] = in_stack_fffffdb8[6]; other._filename._buf[7] = in_stack_fffffdb8[7]; other._filename._buf[8] = in_stack_fffffdb8[8]; other._filename._buf[9] = in_stack_fffffdb8[9]; other._filename._buf[10] = in_stack_fffffdb8[10]; other._filename._buf[0xb] = in_stack_fffffdb8[0xb]; other._filename._buf[0xc] = in_stack_fffffdb8[0xc]; other._filename._buf[0xd] = in_stack_fffffdb8[0xd]; other._filename._buf[0xe] = in_stack_fffffdb8[0xe]; other._filename._buf[0xf] = in_stack_fffffdb8[0xf]; other._filename._size = in_stack_fffffdb8._16_4_; other._filename._capacity = in_stack_fffffdb8._20_4_; other._animDefaultName._buf[0] = in_stack_fffffdb8[0x18]; other._animDefaultName._buf[1] = in_stack_fffffdb8[0x19]; other._animDefaultName._buf[2] = in_stack_fffffdb8[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffdb8[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffdb8[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffdb8[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffdb8[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffdb8[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffdb8[0x20]; other._animDefaultName._buf[9] = in_stack_fffffdb8[0x21]; other._animDefaultName._buf[10] = in_stack_fffffdb8[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffdb8[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffdb8[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffdb8[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffdb8[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffdb8[0x27]; other._animDefaultName._size = in_stack_fffffdb8._40_4_; other._animDefaultName._capacity = in_stack_fffffdb8._44_4_; other._animState._animation = (void *)in_stack_fffffdb8._48_4_; other._animState._animData = (void *)in_stack_fffffdb8._52_4_; other._animState._layerFrames = (void *)in_stack_fffffdb8._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffdb8._60_4_; other._animState._animFrame = (float)in_stack_fffffdb8._64_4_; other._animState._isPlaying = in_stack_fffffdb8[0x44]; other._animState._21_3_ = in_stack_fffffdb8._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffdb8._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffdb8._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffdb8._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffdb8._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffdb8._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffdb8._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffdb8._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffdb8[100]; other._overlayAnimState._21_3_ = in_stack_fffffdb8._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffdb8._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffdb8._108_4_; other._overlayRenderFirst = in_stack_fffffdb8[0x70]; other._113_3_ = in_stack_fffffdb8._113_3_; other._animData = (void *)in_stack_fffffdb8._116_4_; other._animCount = in_stack_fffffdb8._120_4_; other._layerState = (void *)in_stack_fffffdb8._124_4_; other._layerCount = in_stack_fffffdb8._128_4_; other._nullLayerNames = (void *)in_stack_fffffdb8._132_4_; other._numNullLayers = in_stack_fffffdb8._136_4_; other._eventNames = (void *)in_stack_fffffdb8._140_4_; other._numEvents = in_stack_fffffdb8._144_4_; other._offset.x = (float)in_stack_fffffdb8._148_4_; other._offset.y = (float)in_stack_fffffdb8._152_4_; other._scale.x = (float)in_stack_fffffdb8._156_4_; other._scale.y = (float)in_stack_fffffdb8._160_4_; other._rotation = (float)in_stack_fffffdb8._164_4_; other._color._tint[0] = (float)in_stack_fffffdb8._168_4_; other._color._tint[1] = (float)in_stack_fffffdb8._172_4_; other._color._tint[2] = (float)in_stack_fffffdb8._176_4_; other._color._tint[3] = (float)in_stack_fffffdb8._180_4_; other._color._colorize[0] = (float)in_stack_fffffdb8._184_4_; other._color._colorize[1] = (float)in_stack_fffffdb8._188_4_; other._color._colorize[2] = (float)in_stack_fffffdb8._192_4_; other._color._colorize[3] = (float)in_stack_fffffdb8._196_4_; other._color._offset[0] = (float)in_stack_fffffdb8._200_4_; other._color._offset[1] = (float)in_stack_fffffdb8._204_4_; other._color._offset[2] = (float)in_stack_fffffdb8._208_4_; other._championColor._tint[0] = (float)in_stack_fffffdb8._212_4_; other._championColor._tint[1] = (float)in_stack_fffffdb8._216_4_; other._championColor._tint[2] = (float)in_stack_fffffdb8._220_4_; other._championColor._tint[3] = (float)in_stack_fffffdb8._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffdb8._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffdb8._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffdb8._236_4_; other._championColor._colorize[3] = (float)in_stack_fffffdb8._240_4_; other._championColor._offset[1] = in_stack_fffffeb0; other._championColor._offset[2] = (float)in_stack_fffffeb4; other._256_4_ = in_stack_fffffeb8; other._playbackSpeed = (float)in_stack_fffffebc; other._264_1_ = (char)in_stack_fffffec0; other._loaded = SUB41(in_stack_fffffec0,1); other._266_2_ = SUB42(in_stack_fffffec0,2); other._shadowLayerIndex = (int)in_stack_fffffec4; other._bitflags = iVar27; ANM2::operator_assign(&this->_altPedestalANM2,other); if ((g_game->_currentDimensionIdx == 2) || ((uVar7 = Level::GetCurses((Level *)g_game), (uVar7 & 0x40) == 0 && (this->_isForceBlind == 0)))) { bVar4 = 0; } else { bVar4 = 1; } load_collectible_gfx(); ANM2::LoadGraphics(&this->_altPedestalANM2,bVar4); animName = ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState, (std_string *)(local_bc + 0x10)); local_14 = 1; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar4 = ANM2::SetAnimation(&this->_altPedestalANM2,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_altPedestalANM2)._animState); (this->_altPedestalANM2)._animState._isPlaying = 1; } local_14 = 0xffffffff; if (&DAT_0000000f < animNameCapacity) { puVar16 = animNameCapacity + 1; pvVar13 = (void *)local_bc._16_4_; if ((undefined1 *)0xfff < puVar16) { pvVar13 = *(void **)(local_bc._16_4_ + -4); puVar16 = animNameCapacity + 0x24; if (0x1f < (uint)(local_bc._16_4_ + (-4 - (int)pvVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar13,(uint)puVar16); } animNameSize = 0; animNameCapacity = &DAT_0000000f; local_bc._16_4_ = local_bc._16_4_ & 0xffffff00; } } if ((this->_altPedestalANM2)._loaded != 0) { AnimationState::Update(&(this->_altPedestalANM2)._animState); AnimationState::Update(&(this->_altPedestalANM2)._overlayAnimState); } } if ((this->_price == 0) && (this->_variant == 10)) { local_cc = (Entity *)0x0; local_d0 = (Room *)0x0; pEVar8 = (Entity *)0x0; local_4c._4_4_ = (Room *)0x0; local_4c._8_4_ = (Entity *)0x0; local_f4.y = 0.0; local_40 = (Entity *)0x0; local_14 = 2; local_e8._shift3 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { pEVar18 = (Entity *)0x0; do { local_c8.y = (float)Game::GetPlayer(g_game,local_e8._shift3); if (((Room *)local_c8.y)->_gridEntities[2] == (void *)0x0) { local_cc = (Entity *)&local_cc->field_0x1; if (*(int *)&((Room *)local_c8.y)->field_0x13c0 != 0xe) { if (*(int *)&((Room *)local_c8.y)->field_0x13c0 != 0x21) goto LAB_006e4032; } if (pEVar8 == pEVar18) { std::vector::_Emplace_reallocate(); pEVar8 = (Entity *)local_4c._8_4_; pEVar18 = local_40; } else { *(float *)pEVar8 = local_c8.y; local_4c._8_4_ = &pEVar8->field_0x4; pEVar8 = (Entity *)local_4c._8_4_; } } LAB_006e4032: local_e8._shift3 = local_e8._shift3 + 1; } while ((uint)local_e8._shift3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); this = local_f8; local_f4.y = (float)pEVar18; } pEVar8 = (Entity *)((int)pEVar8 - local_4c._4_4_ >> 2); local_d0 = (Room *)local_4c._4_4_; if ((pEVar8 == local_cc) && (this->_subtype != 7)) { local_34._0_4_ = this->_initSeed; local_34._4_4_ = 3; local_34._8_4_ = 3; local_28 = 3.64338e-44; uVar7 = RNG::RandomInt((RNG *)local_34,(uint)pEVar8); pRVar24 = local_d0; local_c8.y = (float)local_d0->_gridEntities[uVar7 - 9]; if ((Room *)local_c8.y != (Room *)0x0) { (**(code **)(*(int *)this + 0x28))(); switch(this->_subtype) { case 1: case 8: case 9: case 10: case 0xc: iVar6 = 2; break; default: iVar6 = 1; break; case 3: iVar6 = 3; break; case 4: iVar6 = 5; break; case 5: case 6: case 0xb: iVar6 = 4; break; case 7: iVar6 = 6; } Entity_Player::AddBlueFlies((Entity_Player *)local_c8.y,iVar6,&this->_pos,(Entity *)0x0); if (pRVar24 == (Room *)0x0) { ExceptionList = local_1c; return; } uVar7 = (int)local_f4.y - (int)pRVar24 & 0xfffffffc; ptr = pRVar24; if (uVar7 < 0x1000) { LAB_006e4146: operator_delete(ptr,uVar7); ExceptionList = local_1c; return; } ptr = *(Room **)&pRVar24[-1]._isPickupVisionInvalid; uVar7 = uVar7 + 0x23; if ((uint)((int)pRVar24 + (-4 - (int)ptr)) < 0x20) goto LAB_006e4146; goto LAB_006e4192; } } local_14 = 0xffffffff; if (local_d0 != (Room *)0x0) { uVar7 = ((int)local_f4.y - (int)local_d0 >> 2) * 4; pRVar24 = local_d0; if (0xfff < uVar7) { pRVar24 = *(Room **)&local_d0[-1]._isPickupVisionInvalid; uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)local_d0 + (-4 - (int)pRVar24))) { LAB_006e4192: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pRVar24,uVar7); } } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1a8,(RNG **)&g_game->_playerManager,1); if ((player != (Entity_Player *)0x0) && (this->_price == 0)) { iVar6 = this->_spawnerType; if (iVar6 == 5) { bVar19 = this->_spawnerVariant == 0x45; } else { if (iVar6 == 1) goto LAB_006e4283; bVar19 = iVar6 == 3; } if ((!bVar19) && ((((iVar6 = this->_variant, iVar6 == 0x1e || (iVar6 == 0x28)) || (iVar6 == 0x14)) || ((iVar6 == 0x5a || (iVar6 == 300)))))) { uVar7 = 5; if (iVar6 == 0x14) { uVar7 = 10; } uVar7 = RNG::RandomInt(&this->_dropRNG,uVar7); if (uVar7 == 0) { (**(code **)(*(int *)this + 0x28))(); uVar7 = RNG::Next(&this->_dropRNG); pEVar8 = Game::Spawn(g_game,5,0x45,&this->_pos,&this->_velocity,(Entity *)0x0,0,uVar7); pEVar8[1]._sprite._championColor._tint[0] = (float)this->_optionsPickupIndex; ExceptionList = local_1c; return; } this->_spawnerType = 5; this->_spawnerVariant = 0x45; } } LAB_006e4283: if (this->_variant == 0x28) { iVar6 = this->_subtype; if (iVar6 == 3) { uVar7 = Random(); Game::Spawn(g_game,4,3,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); goto LAB_006e42ba; } if (iVar6 == 5) { uVar7 = Random(); Game::Spawn(g_game,4,4,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } if (iVar6 == 6) { uVar7 = Random(); Game::Spawn(g_game,4,0x12,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } if (((this->_spawnerType == 4) && (((iVar6 = this->_spawnerVariant, iVar6 == 3 || (iVar6 == 4)) || (iVar6 == 0x12)))) && (((this->_sprite)._animState._animData != (void *)0x0 && ((this->_sprite)._animState._isPlaying != 0)))) { pbVar9 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar14 = "Appear"; do { bVar4 = *pbVar9; bVar19 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_006e4390: uVar7 = -(uint)bVar19 | 1; goto LAB_006e4395; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar19 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_006e4390; pbVar9 = pbVar9 + 2; pcVar14 = pcVar14 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_006e4395: if (uVar7 == 0) { ANM2::Play(&this->_sprite,s_Idle,0); this->_entityCollisionClass = 4; } } } pVVar10 = &this->_targetPosition; if (((this->_targetPosition).x == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y) ) { pVVar10->x = (this->_pos).x; (this->_targetPosition).y = (this->_pos).y; if (this->_variant == 100) { local_c8.y = (float)g_game->_room; iVar6 = Room::GetGridIndex((Room *)local_c8.y,&this->_pos); if (((-1 < iVar6) && (EntityRef::EntityRef((EntityRef *)local_bc), extraout_EDX < 0x1c0)) && (((void **)((int)local_c8.y + 0x24))[extraout_EDX] != (int *)0x0)) { (**(code **)(*(int *)((void **)((int)local_c8.y + 0x24))[extraout_EDX] + 0x14))(); } } } if (this->_gridRepositionState == 2) { pVVar10->x = (this->_pos).x; (this->_targetPosition).y = (this->_pos).y; this->_gridRepositionState = 0; } iVar6 = this->_variant; if (iVar6 == 100) { pvVar13 = this->_megaChestCollectible[0]; if (pvVar13 != (void *)0x0) { pVVar10->x = *(float *)((int)pvVar13 + 0x334); (this->_targetPosition).y = *(float *)((int)pvVar13 + 0x338); pvVar13 = this->_megaChestCollectible[0]; fVar21 = *(float *)((int)pvVar13 + 0x364); (this->_velocity).x = *(float *)((int)pvVar13 + 0x360); (this->_velocity).y = fVar21; fVar21 = *(float *)((int)pvVar13 + 0x340); (this->_pos).x = *(float *)((int)pvVar13 + 0x33c); (this->_pos).y = fVar21; goto LAB_006e45ad; } LAB_006e4506: local_c8.y = (float)g_game->_room; if ((((Room *)local_c8.y)->_roomType != 0x10) && (g_game->_frameCount - this->_spawnFrame < 6)) { local_e8._shift2 = (int)pVVar10->x; local_e8._shift3 = (int)(this->_targetPosition).y; iVar6 = Room::GetGridCollisionAtPos((Room *)local_c8.y,*pVVar10); if (iVar6 != 0) { freePos = Room::FindFreePickupSpawnPosition ((Room *)local_c8.y,(Vector *)(local_4c + 8),pVVar10,40.0,1,0,0); pVVar10->x = freePos->x; (this->_targetPosition).y = freePos->y; } } fVar21 = (this->_targetPosition).y; fVar23 = (this->_pos).y; (this->_velocity).x = pVVar10->x - (this->_pos).x; (this->_velocity).y = fVar21 - fVar23; } else { if ((this->_price != 0) || (iVar6 == 0x17c)) goto LAB_006e4506; if (iVar6 == 0x14) { if (this->_subtype == 6) goto LAB_006e4506; } else if ((iVar6 == 0x186) || (iVar6 == 0x39)) goto LAB_006e4506; } LAB_006e45ad: if (this->_gridRepositionState == 1) { local_c8.y = (float)&this->_pos; player = Game::GetNearestPlayer(g_game,(Vector *)local_c8.y); iVar6 = 0; fVar21 = (player->_pos).x; fVar23 = (player->_pos).y; local_d0 = g_game->_room; do { if (local_d0->_doors[iVar6] != (void *)0x0) { local_e8._shift3 = *(int *)((int)local_d0->_doors[iVar6] + 0x24); local_cc = (Entity *)local_d0->_gridWidth; fVar20 = ((float)(local_e8._shift3 / (int)local_cc) * 40.0 + 120.0) - fVar23; fVar22 = ((float)(local_e8._shift3 % (int)local_cc) * 40.0 + 40.0) - fVar21; if (fVar20 * fVar20 + fVar22 * fVar22 < 4900.0) { if (-1 < iVar6) { local_f4.y = *(float *)local_c8.y - fVar21; local_d0 = (Room *)((float)*(void **)((int)local_c8.y + 4) - fVar23); fVar21 = sqrtf(local_f4.y * local_f4.y + (float)local_d0 * (float)local_d0); if (0.0 < fVar21) { local_f4.y = local_f4.y * (3.0 / fVar21); local_d0 = (Room *)((float)local_d0 * (3.0 / fVar21)); } pRVar24 = (Room *)(*(float *)local_c8.y - ((float)(local_e8._shift3 % (int)local_cc) * 40.0 + 40.0)); local_e8._shift3 = (int)((float)*(void **)((int)local_c8.y + 4) - ((float)(local_e8._shift3 / (int)local_cc) * 40.0 + 120.0)); local_c8.y = (float)pRVar24; fVar21 = sqrtf((float)local_e8._shift3 * (float)local_e8._shift3 + (float)pRVar24 * (float)pRVar24); if (fVar21 <= 0.0) { EVar12 = (EntityPtr)local_e8._shift3; pRVar24 = (Room *)local_c8.y; } else { EVar12 = (EntityPtr)((5.0 / fVar21) * (float)local_e8._shift3); pRVar24 = (Room *)(local_c8.y * (5.0 / fVar21)); } (this->_velocity).x = local_f4.y + (float)pRVar24 + (this->_velocity).x; (this->_velocity).y = (float)local_d0 + (float)EVar12 + (this->_velocity).y; } break; } } iVar6 = iVar6 + 1; } while (iVar6 < 8); this->_gridRepositionState = 2; } if (this->_variant == 0x17c) { this->_renderZOffset = -3000; } else if ((((this->_variant == 10) && (this->_subtype == 9)) && (this->_price == 0)) && (this->_dead == 0)) { player = Game::GetNearestPlayer(g_game,&this->_pos); fVar21 = (player->_velocity).x; fVar23 = (player->_velocity).y; local_d0 = (Room *)((fVar21 + fVar21 + (player->_pos).x) - (this->_pos).x); local_f4.y = (fVar23 + fVar23 + (player->_pos).y) - (this->_pos).y; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_34,&this->_pos, 50.0,1); fVar21 = 0.0; local_14 = 3; if (local_28 != 0.0) { do { iVar6 = *(int *)(local_34._4_4_ + (int)fVar21 * 4); if (*(int *)(iVar6 + 0x28) == 3) { if (*(int *)(iVar6 + 0x2c) != 0x40) { if (*(int *)(iVar6 + 0x2c) != 0x66) goto LAB_006e4978; } pRVar24 = (Room *)((*(float *)(iVar6 + 0x360) + *(float *)(iVar6 + 0x360) + *(float *)(iVar6 + 0x33c)) - (this->_pos).x); pEVar8 = (Entity *) ((*(float *)(iVar6 + 0x364) + *(float *)(iVar6 + 0x364) + *(float *)(iVar6 + 0x340)) - (this->_pos).y); if ((float)pEVar8 * (float)pEVar8 + (float)pRVar24 * (float)pRVar24 < (float)local_d0 * (float)local_d0 + local_f4.y * local_f4.y) { local_f4.y = (float)pEVar8; local_d0 = pRVar24; } } LAB_006e4978: fVar21 = (float)((int)fVar21 + 1); } while ((uint)fVar21 < (uint)local_28); } local_c8.y = (float)local_d0 * (float)local_d0 + local_f4.y * local_f4.y; if (2500.0 <= local_c8.y) { fVar21 = (this->_velocity).y; fVar23 = (this->_velocity).x; if (((fVar23 * fVar23 + fVar21 * fVar21 <= 4.0) && (pvVar13 = (this->_sprite)._animState._animData, pvVar13 != (void *)0x0)) && (*(char *)((int)pvVar13 + 0x34) != '\0')) { pcVar14 = (char *)s_Idle; goto LAB_006e4bf6; } } else { local_e8._shift1 = 5; local_e8._shift2 = 9; local_e8._seed = this->_initSeed * ((g_game->_frameCount - this->_spawnFrame) / 10); if (local_e8._seed == 0) { local_e8._seed = 1; } local_e8._shift3 = 7; RNG::Next(&local_e8); local_e8._shift3 = (int)((float)((double)local_e8._seed + __uint_to_double_fixup[-(local_e8._seed >> 0x1f)]) * 2.3283062e-10 * 180.0 - 90.0); local_cc = (Entity *)((local_c8.y * 3.0) / 2500.0); fVar21 = sqrtf(local_c8.y); if (fVar21 <= 0.0) { local_c8.y = (float)local_d0; local_cc = (Entity *)local_f4.y; } else { local_c8.y = ((float)local_cc / fVar21) * (float)local_d0; local_cc = (Entity *)(((float)local_cc / fVar21) * local_f4.y); } local_e8._shift3 = (int)((float)local_e8._shift3 * 0.017453292); local_d0 = (Room *)cos((float)local_e8._shift3); fVar23 = sin((float)local_e8._shift3); fVar21 = this->_friction; if (fVar21 != 0.0) { fVar20 = this->_speedMultiplier; (this->_velocity).y = (fVar20 * -(fVar23 * local_c8.y + (float)local_d0 * (float)local_cc)) / fVar21 + (this->_velocity).y; (this->_velocity).x = (fVar20 * -((float)local_d0 * local_c8.y - fVar23 * (float)local_cc)) / fVar21 + (this->_velocity).x; } if (this->_entityCollisionClass != 0) { pcVar14 = "IdlePanic"; LAB_006e4bf6: ANM2::Play(&this->_sprite,(byte *)pcVar14,0); } } local_14 = 0xffffffff; if (local_34[0] == '\0') { local_14 = 4; tracked_alloc(1,(void *)local_34._4_4_,0); local_14 = 0xffffffff; } } if (((this->_variant == 100) && (this->_subtype == 0x226)) && ((this->_isTouched != 0 && ((*(char *)g_game->_room != '\0' && (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) == 4)))))) { uVar7 = Random(); local_c8.x = (this->_pos).x + 0.0; local_c8.y = (this->_pos).y + 10.0; Game::Spawn(g_game,1000,0xf,&local_c8,&g_vectorZero,(Entity *)0x0,0,uVar7); Color::Color(&tmpColor); (*extraout_EDX_00)(); this->_timeout = 4; this->_entityCollisionClass = 0; } Entity::Update((Entity *)this); bVar4 = IsChest(this->_variant); if (bVar4 == 0) { if ((extraout_ECX == 0x154) || (extraout_ECX == 0x172)) { (this->_velocity).x = (this->_velocity).x * 0.6; (this->_velocity).y = (this->_velocity).y * 0.6; fVar21 = (this->_targetPosition).x; fVar23 = (this->_pos).x; fVar20 = (this->_targetPosition).y - (this->_pos).y; (this->_sizeMulti).x = 2.0; (this->_sizeMulti).y = 1.0; (this->_velocity).x = fVar21 - fVar23; goto LAB_006e4deb; } } else if ((this->_flags & 0x400000000000000) == 0) { (this->_velocity).x = (this->_velocity).x * 0.8; fVar20 = (this->_velocity).y * 0.8; LAB_006e4deb: (this->_velocity).y = fVar20; } if (this->_variant == 100) { this->_mass = 8.0; this->_friction = this->_friction * 0.8; update_cycle_collectible(this,0); } else if ((this->_flags & 0x400000000000000) == 0) { this->_friction = this->_friction * 0.965; } update_magnet_attraction(this); if ((this->_isAutoUpdatePrice != 0) && (this->_price != 0)) { local_c8.x = (this->_pos).x; local_c8.y = (this->_pos).y; player = Game::GetNearestPlayerEx(&local_c8,1,0,0); Room::GetShopItemPrice(g_game->_room,this->_variant,this->_subtype,this->_shopItemId,player); iVar6 = _Room::ResolveHeartSubType(); if (this->_price != iVar6) { update_price_sprite(this,iVar6); } } local_bd = IsChest(this->_variant); uVar7 = *(uint *)((int)&this->_flags + 4); flags = this->_flags; isDead = this->_dead; if ((uVar7 & 0x100) == 0) { if ((isDead == 0) || (((this->_sprite)._animState._animData != (void *)0x0 && ((this->_sprite)._animState._isPlaying != 0)))) { if ((this->_sprite)._animState._animData != (void *)0x0) { if ((this->_sprite)._animState._isPlaying == 0) { pbVar9 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar14 = "Appear"; do { bVar4 = *pbVar9; bVar19 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_006e52d2: uVar7 = -(uint)bVar19 | 1; goto LAB_006e52d7; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar19 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_006e52d2; pbVar9 = pbVar9 + 2; pcVar14 = pcVar14 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_006e52d7: if (uVar7 != 0) { if ((this->_sprite)._animState._isPlaying != 0) goto LAB_006e5393; uVar25 = _string_holder_c_str(); do { pbVar17 = (byte *)((ulonglong)uVar25 >> 0x20); pbVar9 = (byte *)uVar25; bVar4 = *pbVar9; bVar19 = bVar4 < *pbVar17; if (bVar4 != *pbVar17) { LAB_006e5320: uVar7 = -(uint)bVar19 | 1; goto LAB_006e5325; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar19 = bVar4 < pbVar17[1]; if (bVar4 != pbVar17[1]) goto LAB_006e5320; uVar25 = CONCAT44(pbVar17 + 2,pbVar9 + 2); } while (bVar4 != 0); uVar7 = 0; LAB_006e5325: if (uVar7 != 0) { uVar25 = _string_holder_c_str(); do { pbVar17 = (byte *)((ulonglong)uVar25 >> 0x20); pbVar9 = (byte *)uVar25; bVar4 = *pbVar9; bVar19 = bVar4 < *pbVar17; if (bVar4 != *pbVar17) { LAB_006e5356: uVar7 = -(uint)bVar19 | 1; goto LAB_006e535b; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar19 = bVar4 < pbVar17[1]; if (bVar4 != pbVar17[1]) goto LAB_006e5356; uVar25 = CONCAT44(pbVar17 + 2,pbVar9 + 2); } while (bVar4 != 0); uVar7 = 0; LAB_006e535b: if (uVar7 != 0) goto LAB_006e5393; } } if ((local_bd == 0) || (this->_subtype != 0)) { ANM2::Play(&this->_sprite,s_Idle,0); goto LAB_006e53e7; } ANM2::Play(&this->_sprite,(byte *)"Opened",0); } else { LAB_006e5393: bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"DropSound"); if (((bVar4 != 0) && (PlayDropSound(this), local_bd == 0)) && ((bVar4 = ANM2::IsPlaying(&this->_sprite,(byte *)"Appear"), bVar4 != 0 || ((bVar4 = ANM2::IsPlaying(&this->_sprite,(byte *)"AppearFast"), bVar4 != 0 || (bVar4 = ANM2::IsPlaying(&this->_sprite,(byte *)"Reappear"), bVar4 != 0)))))) { LAB_006e53e7: this->_entityCollisionClass = 4; if (this->_variant == 0x29) { this->_entityGridCollisionClass = 5; } } } } } else { (**(code **)(*(int *)this + 0x28))(); } } else if (isDead == 0) { iVar6 = g_game->_frameCount - this->_spawnFrame; if (this->_variant == 100) { if (iVar6 == 3) { piVar15 = &(this->_sprite)._bitflags; *piVar15 = *piVar15 | 2; } else if (iVar6 == 4) { RNG::Next(&this->_dropRNG); iVar6 = ItemPool::CreateGlitchedCollectible(); this->_subtype = iVar6; UpdateSprite(this,1); uVar7 = this->_subtype; if (g_game == (Game *)0x0) { if (-1 < (int)uVar7) goto LAB_006e4fc5; } else { if ((int)uVar7 < 0) { if (((int)uVar7 < 0) && (pvVar13 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar7 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar13 >> 2)) { iVar6 = **(int **)((int)pvVar13 + ~uVar7 * 4); } else { iVar6 = 0; } } else { LAB_006e4fc5: pvVar13 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar13 >> 2 <= (int)uVar7) goto LAB_006e5401; iVar6 = *(int *)((int)pvVar13 + uVar7 * 4); } if (iVar6 != 0) { this->_charge = *(int *)(iVar6 + 0x74); if (-1 < *(int *)(iVar6 + 200)) { this->_charge = *(int *)(iVar6 + 200); } } } } else if (4 < iVar6) goto LAB_006e5014; } else if (iVar6 < 6) { if (iVar6 == 5) { iVar6 = ANM2::GetFrame(&this->_sprite); if (((this->_sprite)._animState._animData != (void *)0x0) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(iVar6 + 2)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } } } else if ((iVar6 < 10) || ((iVar6 < 0xf && (uVar7 = Random(), (uVar7 & 7) != 0)))) { if (((uint)(this->_sprite)._bitflags >> 1 & 1) == 0) { uVar7 = Random(); if (uVar7 % 6 == 0) { piVar15 = &(this->_sprite)._bitflags; *piVar15 = *piVar15 | 2; } else { uVar7 = Random(); if ((uVar7 & 7) == 0) { uVar7 = Random(); iVar6 = ANM2::GetFrame(&this->_sprite); uVar11 = iVar6 + -2 + uVar7 % 5; uVar7 = 6; if (6 < uVar11) { uVar7 = uVar11; } Sprite::SetFrame_1((Sprite *)&this->_sprite,uVar7); } } } else { uVar7 = Random(); if ((uVar7 & 1) == 0) { piVar15 = &(this->_sprite)._bitflags; *piVar15 = *piVar15 & 0xfffffffd; } } } else { piVar15 = &(this->_sprite)._bitflags; *piVar15 = *piVar15 & 0xfffffffd; flags = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & 0xfffffeff; *(int *)&this->_flags = (int)flags; animName = ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState, (std_string *)(local_bc + 0x10)); local_14 = 5; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_bc + 0x10); pVVar10 = MusicManager::RandomVector((Vector *)(local_4c + 8)); local_c8.y = pVVar10->x * 8.0; local_e8._shift3 = (int)(pVVar10->y * 8.0); RNG::game_constructor((RNG *)local_4c,this->_initSeed,3); uVar7 = RNG::Next(explosionSprite); local_f4.x = local_c8.y + (this->_pos).x; local_f4.y = (float)local_e8._shift3 + (this->_pos).y; pEVar8 = Game::Spawn(g_game,this->_type,this->_variant,&local_f4,&g_vectorZero, (Entity *)this->_spawnerEntity,this->_subtype,uVar7); (**(code **)(*(int *)pEVar8 + 0xc))(); (this->_pos).x = (this->_pos).x - local_c8.y; (this->_pos).y = (this->_pos).y - (float)local_e8._shift3; } } else { LAB_006e5014: piVar15 = &(this->_sprite)._bitflags; *piVar15 = *piVar15 & 0xfffffffd; *(int *)&this->_flags = (int)flags; *(uint *)((int)&this->_flags + 4) = uVar7 & 0xfffffeff; } LAB_006e5401: if ((this->_variant == 0x3a) && (this->_subtype != 0)) { local_4c._4_4_ = *(undefined4 *)&this->_flags; flags = this->_flags; if (((flags & 0x200000000000000) == 0) || (((flags & 0x400000000000000) != 0 || (this->_child != (EntityPtr)0x0)))) { if ((this->_collisionCooldown < 1) && ((this->_entityCollisionClass != 0 && ((flags & 0x600000000000000) == 0)))) { pVVar10 = &this->_pos; player = Game::GetNearestPlayer(g_game,pVVar10); fVar21 = pVVar10->x - (player->_pos).x; fVar23 = (this->_pos).y - (player->_pos).y; if (fVar23 * fVar23 + fVar21 * fVar21 < 10000.0) { uVar7 = RNG::Next(&this->_dropRNG); pEVar8 = Game::Spawn(g_game,0x330,0,pVVar10,&g_vectorZero,(Entity *)this,0,uVar7); pEVar8->_renderDepthOffset = 6.0; flags = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 | 0x2000000; *(int *)&this->_flags = (int)flags; flagsHigh = *(undefined4 *)((int)&pEVar8->_flags + 4); iVar6 = *(int *)pEVar8; *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar8->_flags + 4) = flagsHigh; (**(code **)(iVar6 + 0xc))(); Color::Color(); (*extraout_EDX_01)(); Entity::SetChild((Entity *)this,pEVar8); } } } else { this->_visible = 1; bVar4 = TryOpenChest(this,(Entity_Player *)0x0); if (bVar4 != 0) { RemoveOtherOptions(); iVar6 = *(int *)((int)g_game->_room + 8); if ((iVar6 == 0xb) || (iVar6 == 0x11)) { Ambush::StartChallenge(&g_game->_ambush); } } } } if ((this->_variant == 10) && (this->_subtype == 0xc)) { if ((this->_sprite)._animState._animData == (void *)0x0) { local_bd = 0; LAB_006e55e8: fVar21 = (this->_velocity).y; fVar23 = (this->_velocity).x; fVar21 = sqrtf(fVar23 * fVar23 + fVar21 * fVar21); if (3.0 < fVar21) { uVar7 = Random(); if (uVar7 % 3 == 0) goto LAB_006e562c; } } else { local_bd = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"DropSound"); if (local_bd == 0) goto LAB_006e55e8; LAB_006e562c: uVar7 = Random(); pEVar8 = Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); uVar7 = Random(); pcVar2 = *(code **)(*(int *)pEVar8 + 0x3c); fVar23 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.2; fVar21 = fVar23 * g_vectorOne.x; (pEVar8->_sprite)._scale.y = fVar23 * g_vectorOne.y; (pEVar8->_sprite)._scale.x = fVar21; Color::Reset(&tmpColor); tmpColor._tint[0] = (float)0x3f333333; tmpColor._tint[1] = (float)0x3f666666; tmpColor._tint[2] = (float)0x3f266666; tmpColor._tint[3] = 1.0; (*pcVar2)(); (**(code **)(*(int *)pEVar8 + 0xc))(); if (local_bd == 0) { this = local_f8; } else { uVar7 = Random(); this = local_f8; for (iVar6 = uVar7 % 3 + 1; iVar6 != 0; iVar6 = iVar6 + -1) { uVar7 = Random(); fVar21 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; local_d0 = (Room *)(fVar21 + fVar21 + 1.0); uVar7 = Random(); fVar21 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c8.y = fVar21 + fVar21; local_cc = (Entity *)sin(local_c8.y); uVar7 = Random(); local_e8._shift3 = (int)((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.5 * this->_size); fVar21 = cos(local_c8.y); local_4c._8_4_ = fVar21 * (float)local_e8._shift3 + (this->_pos).x; local_40 = (Entity *)((float)local_cc * (float)local_e8._shift3 + (this->_pos).y); uVar7 = Random(); fVar21 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c8.y = fVar21 + fVar21; local_e8._shift3 = (int)sin(local_c8.y); fVar21 = cos(local_c8.y); local_34._8_4_ = fVar21 * (float)local_d0; local_28 = (float)local_d0 * (float)local_e8._shift3 * 0.5; uVar7 = Random(); Game::Spawn(g_game,1000,0x3f,(Vector *)(local_4c + 8),(Vector *)(local_34 + 8), (Entity *)0x0,0,uVar7); } } } } if ((((this->_variant == 0x39) && (this->_subtype != 0)) && ((this->_sprite)._animState._animData != (void *)0x0)) && (bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,s_Open), bVar4 != 0)) { if (this->_subtype == 1) { EVar12 = this->_target; if ((EVar12 == (EntityPtr)0x0) || (*(int *)((int)EVar12 + 0x28) != 1)) { EVar12 = (EntityPtr)0x0; } bVar4 = TryOpenChest(this,(Entity_Player *)EVar12); if (bVar4 != 0) { RemoveOtherOptions(); iVar6 = *(int *)((int)g_game->_room + 8); if ((iVar6 == 0xb) || (iVar6 == 0x11)) { Ambush::StartChallenge(&g_game->_ambush); } } } else { this->_subtype = this->_subtype + -1; } } if ((((this->_variant == 100) && (g_game->_currentDimensionIdx == 2)) && (this->_optionsPickupIndex == 1)) && ((0 < g_game->_deathCertificateExitTimer && (this->_timeout < 1)))) { uVar7 = Random(); local_28 = (this->_pos).y + 10.0; local_34._8_4_ = (this->_pos).x + 0.0; Game::Spawn(g_game,1000,0xf,(Vector *)(local_34 + 8),&g_vectorZero,(Entity *)0x0,0,uVar7); this->_timeout = 4; } if ((0 < this->_timeout) && (iVar6 = this->_timeout + -1, this->_timeout = iVar6, iVar6 == 0)) { (**(code **)(*(int *)this + 0x28))(); } if (0 < this->_wait) { this->_wait = this->_wait + -1; } if (((0 < this->_chestReCloseTimer) && (iVar6 = this->_chestReCloseTimer + -1, this->_chestReCloseTimer = iVar6, iVar6 == 0)) && (this->_variant == 0x35)) { this->_subtype = 1; ANM2::Play(&this->_sprite,(byte *)"Close",0); manager = g_manager; local_c8.y = 2.94273e-44; seed_fart_sound_override((int *)&local_c8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_c8.y,1.0,2,0,1.0,0.0); this->_wait = 0x1e; UpdateLootPreview(this); } pRVar24 = g_game->_room; if (pRVar24->_roomType == 0x10) { local_c8.x = (this->_pos).x + 0.0; local_c8.y = (this->_sizeMulti).y * this->_size + 0.5 + (this->_pos).y; pos.y = local_c8.y; pos.x = local_c8.x; iVar6 = Room::GetGridCollisionAtPos(pRVar24,pos); if (iVar6 != 4) { piVar15 = *(int **)((int)pRVar24->_descriptor + 0x10); if (((piVar15 == (int *)0x0) || (piVar15[2] != 0x10)) || (*piVar15 != 0x23)) { (this->_velocity).y = (this->_velocity).y + 0.9; } else { (this->_velocity).y = (this->_velocity).y + 0.4; this->_friction = this->_friction * 0.95; } } piVar15 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if (((piVar15 != (int *)0x0) && (piVar15[2] == 0x10)) && ((*piVar15 == 0x23 && (((2 < g_game->_frameCount - this->_spawnFrame && (0.0 < (this->_velocity).y)) && (*(float *)((int)g_game->_room + 0x20) - 30.0 < (this->_pos).y)))))) { (**(code **)(*(int *)this + 0x28))(); uVar7 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x10,&this->_pos,&g_vectorZero,(Entity *)0x0,0x42,uVar7); (**(code **)(*(int *)pEVar8 + 0xc))(); } } bVar4 = Game::IsInTimedSet(g_game,0xb); if ((bVar4 != 0) && (((iVar6 = this->_variant, iVar6 == 10 || (iVar6 == 0x1e)) || ((((iVar6 == 0x28 || ((iVar6 == 0x14 || (iVar6 == 0x46)))) || (iVar6 == 0x5a)) || (((iVar6 == 300 || (iVar6 == 0x15e)) || (bVar4 = IsChest(iVar6), bVar4 != 0)))))))) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; player = Game::GetNearestPlayerEx(&this->_pos,1,0,0); if (player != (Entity_Player *)0x0) { fVar21 = this->_friction; fVar23 = (player->_lastVelocity).x; fVar20 = (player->_lastVelocity).y; if (fVar21 != 0.0) { fVar22 = this->_speedMultiplier; (this->_velocity).y = (fVar22 * (fVar20 + fVar20)) / fVar21 + (this->_velocity).y; (this->_velocity).x = (fVar22 * (fVar23 + fVar23)) / fVar21 + (this->_velocity).x; } } } game = g_game; bVar4 = Game::IsInTimedSet(g_game,5); if ((bVar4 != 0) || (bVar4 = Game::IsInTimedSet(game,6), bVar4 != 0)) { game = g_game; if (g_game->_frameCount - this->_spawnFrame < 2) { local_cc = (Entity *)(((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5); local_c8.y = g_displayPixelRatio * g_screenPointScale; local_e8._shift3 = (int)((((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_c8.y + 0.5 ); dVar26 = floor((double)(float)local_e8._shift3); local_d0 = (Room *)((float)dVar26 / local_c8.y); local_e8._shift3 = (int)(local_c8.y * (float)local_cc + 0.5); dVar26 = floor((double)(float)local_e8._shift3); local_c8.y = (float)dVar26 / local_c8.y; pvVar13 = game->_room; local_cc = *(Entity **)((int)pvVar13 + 0x11fc); local_e8._shift3 = *(int *)((int)pvVar13 + 0x1200); shared_ptr::assign(&local_f4,(void *)((int)pvVar13 + 0x1bc8)); local_14 = 6; pcVar2 = *(code **)(*(int *)local_f4.x + 0x2c); __ftoui3(); __ftoui3(); (*pcVar2)(); local_14 = 7; if ((((Entity *)local_f4.y != (Entity *)0x0) && (cVar5 = (**(code **)(*(int *)local_f4.y + 0xc))(), cVar5 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } this = local_f8; local_14 = 0xffffffff; (local_f8->_colorMod)._tint[3] = 1.0; (local_f8->_colorMod)._tint[0] = 0.0; (local_f8->_colorMod)._tint[1] = 0.0; (local_f8->_colorMod)._tint[2] = 0.0; (local_f8->_colorMod)._tint[3] = 0.7; (local_f8->_colorMod)._offset[0] = local_50 * 0.9; (local_f8->_colorMod)._offset[1] = (float)local_4c._0_4_ * 0.9; (local_f8->_colorMod)._offset[2] = (float)local_4c._4_4_ * 0.9; Sprite::SetColor((Sprite *)&local_f8->_sprite,&local_f8->_colorMod); } game = g_game; if ((uint)(g_game->_frameCount + this->_index) % 0x1e < 2) { local_cc = (Entity *)(((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5); local_c8.y = g_displayPixelRatio * g_screenPointScale; local_e8._shift3 = (int)(local_c8.y * (((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) + 0.5 ); dVar26 = floor((double)(float)local_e8._shift3); local_f8 = (Entity_Pickup *)((float)dVar26 / local_c8.y); local_e8._shift3 = (int)(local_c8.y * (float)local_cc + 0.5); dVar26 = floor((double)(float)local_e8._shift3); local_c8.y = (float)dVar26 / local_c8.y; pvVar13 = game->_room; local_cc = *(Entity **)((int)pvVar13 + 0x11fc); local_e8._shift3 = *(int *)((int)pvVar13 + 0x1200); shared_ptr::assign(&local_d4,(void *)((int)pvVar13 + 0x1bc8)); local_14 = 8; (**(code **)(*local_d4 + 0x2c))(); local_14 = 9; if (((local_d0 != (Room *)0x0) && (cVar5 = (**(code **)((int)*(float *)local_d0 + 0xc))(), cVar5 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } local_14 = 0xffffffff; fVar21 = (this->_colorMod)._tint[3]; (this->_colorMod)._tint[3] = (0.7 - fVar21) * 0.3 + fVar21; fVar21 = (this->_colorMod)._offset[2]; fVar23 = (this->_colorMod)._offset[0]; fVar20 = (this->_colorMod)._offset[1]; (this->_colorMod)._offset[2] = ((float)local_4c._4_4_ * 0.9 - fVar21) * 0.5 + fVar21; (this->_colorMod)._offset[1] = ((float)local_4c._0_4_ * 0.9 - fVar20) * 0.5 + fVar20; (this->_colorMod)._offset[0] = (local_50 * 0.9 - fVar23) * 0.5 + fVar23; } tmpColor._tint[0] = (this->_sprite)._color._tint[0]; tmpColor._tint[1] = (this->_sprite)._color._tint[1]; tmpColor._tint[2] = (this->_sprite)._color._tint[2]; tmpColor._tint[3] = (this->_sprite)._color._tint[3]; tmpColor._offset[2] = (this->_sprite)._color._offset[2]; spriteColor = &(this->_sprite)._color; tmpColor._colorize[0] = (this->_sprite)._color._colorize[0]; tmpColor._colorize[1] = (this->_sprite)._color._colorize[1]; tmpColor._colorize[2] = (this->_sprite)._color._colorize[2]; tmpColor._colorize[3] = (this->_sprite)._color._colorize[3]; tmpColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; Color::Lerp(&lerpedColor,(ColorMod *)&tmpColor,&this->_colorMod,0.1); if (spriteColor != &lerpedColor) { spriteColor->_tint[0] = 0.01; (this->_sprite)._color._tint[1] = 0.01; (this->_sprite)._color._tint[2] = 0.01; (this->_sprite)._color._tint[3] = 1.0; (this->_sprite)._color._colorize[0] = lerpedColor._colorize[0]; (this->_sprite)._color._colorize[1] = lerpedColor._colorize[1]; (this->_sprite)._color._colorize[2] = lerpedColor._colorize[2]; (this->_sprite)._color._colorize[3] = lerpedColor._colorize[3]; *(undefined8 *)(this->_sprite)._color._offset = lerpedColor._offset._0_8_; (this->_sprite)._color._offset[2] = lerpedColor._offset[2]; } } game = g_game; uVar7 = this->_timeout; if (((int)uVar7 < 1) || (this->_variant == 100)) { bVar4 = Game::IsInTimedSet(g_game,0x48); if (bVar4 != 0) { iVar6 = this->_spawnFrame; uVar7 = game->_frameCount - iVar6; if (0x96 < (int)uVar7) { uVar7 = uVar7 & 0x80000001; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffe) + 1; } if (uVar7 == 1) { Color::Reset(&tmpColor); tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._tint[0] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 0.0; tmpColor._offset[2] = 0.0; (**(code **)(*(int *)this + 0x3c))(); iVar6 = this->_spawnFrame; } } if (0xd2 < g_game->_frameCount - iVar6) { LAB_006e42ba: (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } } } else if ((int)uVar7 < 0x1e) { uVar7 = uVar7 & 0x80000001; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffe) + 1; } if (uVar7 == 1) { Color::Reset((Color *)local_68); local_4c._4_4_ = (Room *)0x0; local_4c._8_4_ = (Entity *)0x0; local_68._0_4_ = 0.0; local_68._4_4_ = 0.0; local_68._8_4_ = 0.0; local_68._12_4_ = 0.0; local_40 = (Entity *)0x0; (**(code **)(*(int *)this + 0x3c))(); } } if ((this->_variant == 0x14) && (this->_subtype == 6)) { animName = ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState, (std_string *)(local_bc + 0x10)); puVar1 = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } local_bd = str_eq((byte *)animName,*puVar1,(byte *)"Touched",7); std::string::_Tidy_deallocate(local_bc + 0x10); if (local_bd != 0) { if ((this->_sprite)._animState._animData != (void *)0x0) { bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"DropSound"); manager = g_manager; if (bVar4 != 0) { local_c8.y = 3.237e-43; seed_fart_sound_override((int *)&local_c8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_c8.y,0.5,2,0,1.0,0.0); } } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { ANM2::Play(&this->_sprite,s_Idle,0); } } } if (0 < this->_collisionCooldown) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { LAB_006e6519: this->_collisionCooldown = this->_collisionCooldown + -1; } else { pbVar9 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar14 = "Appear"; do { bVar4 = *pbVar9; bVar19 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_006e64d7: uVar7 = -(uint)bVar19 | 1; goto LAB_006e64dc; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar19 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_006e64d7; pbVar9 = pbVar9 + 2; pcVar14 = pcVar14 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_006e64dc: if (uVar7 != 0) { pbVar9 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar9 = *(byte **)pbVar9; } pcVar14 = "AppearFast"; do { bVar4 = *pbVar9; bVar19 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_006e6510: uVar7 = -(uint)bVar19 | 1; goto LAB_006e6515; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar19 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_006e6510; pbVar9 = pbVar9 + 2; pcVar14 = pcVar14 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_006e6515: if (uVar7 != 0) goto LAB_006e6519; } } } if (this->_variant == 0x154) { local_e8._shift3 = *(int *)&this->_target; if (((EntityPtr)local_e8._shift3 == (EntityPtr)0x0) || (*(int *)(local_e8._shift3 + 0x28) != 1)) { local_e8._shift3 = (int)Game::GetPlayer(g_game,0); } if (this->_state == 1) { ANM2::Play(&this->_sprite,s_Open,0); uVar7 = 0; playerManager = &g_game->_playerManager; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { player = PlayerManager::GetPlayer(playerManager,uVar7); game = g_game; uVar7 = uVar7 + 1; playerManager = &g_game->_playerManager; (player->_velocity).x = g_vectorZero.x; (player->_velocity).y = g_vectorZero.y; player->_isControlsEnabled = 0; } while (uVar7 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } flags = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 | 0x1000; this->_state = this->_state + 1; *(int *)&this->_flags = (int)flags; this->_entityCollisionClass = 0; ((Vector *)(local_e8._shift3 + 0x1b1c))->x = g_vectorZero.x; *(float *)(local_e8._shift3 + 0x1b20) = g_vectorZero.y; Game::StartStageTransition(game); iVar6 = get_stage_ending_id(); if ((((iVar6 != 3) && (iVar6 != 4)) && (iVar6 != 5)) && ((iVar6 != 9 && (iVar6 != 0xc)))) { SoundEffects::PlayWithFartOverride(0x433,1.0,2,0,1.0); } } else if (this->_state == 2) { iVar6 = ANM2::GetFrame(&this->_sprite); if ((iVar6 == 6) && (((iVar6 = get_stage_ending_id(), iVar6 == 3 || (iVar6 == 4)) || ((iVar6 == 5 || ((iVar6 == 9 || (iVar6 == 0xc)))))))) { Game::End(g_game,iVar6); ExceptionList = local_1c; return; } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { this->_state = this->_state + 1; manager = g_manager; local_c8.y = 1.47417e-42; seed_fart_sound_override((int *)&local_c8.y); SoundEffects::Play(&manager->_sfxManager,(int)local_c8.y,1.0,2,0,1.0,0.0); iVar6 = local_e8._shift3; Entity_Player::PlayExtraAnimation((Entity_Player *)local_e8._shift3,(byte *)"Trapdoor"); fVar21 = (this->_pos).y; *(float *)(iVar6 + 0x1b1c) = (this->_pos).x + 0.0; *(float *)(iVar6 + 0x1b20) = fVar21 + 20.0; } } } if (this->_variant != 0x172) goto LAB_006e686a; EVar12 = this->_target; if ((EVar12 == (EntityPtr)0x0) || (*(int *)((int)EVar12 + 0x28) != 1)) { this->_state = 0; goto LAB_006e686a; } if (this->_state == 1) { *(int *)((int)EVar12 + 0x188) = 0; *(byte *)((int)EVar12 + 0x410) = 0; Entity_Player::AnimatePickup((Entity_Player *)EVar12,&this->_sprite,1,(byte *)"Pickup"); this->_state = this->_state + 1; this->_visible = 0; goto LAB_006e686a; } if (this->_state != 2) goto LAB_006e686a; if (*(byte *)((int)EVar12 + 0x139a) == 0) { LAB_006e67da: bVar4 = Entity_Player::IsHoldingItem((Entity_Player *)EVar12); if (bVar4 != 0) goto LAB_006e686a; } else { if (*(void **)((int)EVar12 + 0x450) == (void *)0x0) { local_c8.y = 0.0; } else { local_c8.y = *(float *)((int)*(void **)((int)EVar12 + 0x450) + 0x30); } puVar16 = (undefined1 *)ANM2::GetFrame((ANM2 *)((int)EVar12 + 0x41c)); if (puVar16 != &((Room *)((int)local_c8.y + -0x7898))->field_0x7897) goto LAB_006e67da; } game = g_game; *(int *)((int)EVar12 + 0x188) = 4; if ((((game->_dailyChallenge)._id == 0) || (iVar6 = get_stage_ending_id(), iVar6 == 0xff)) || (iVar6 == 0)) { Game::FinishChallenge(g_game); } else { Game::End(g_game,iVar6); } LAB_006e686a: if ((((this->_variant == 0x36) && (this->_subtype != 0)) && ((this->_collisionCooldown < 1 && ((this->_entityCollisionClass != 0 && (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar4 == 0)))))) && (player = Game::GetNearestPlayer(g_game,&this->_pos), fVar23 = (this->_pos).x - (player->_pos).x, fVar21 = (this->_pos).y - (player->_pos).y, fVar21 * fVar21 + fVar23 * fVar23 < 2500.0)) { Morph(this,this->_type,0x34,this->_subtype,0,0,0); ANM2::Play(&this->_sprite,(byte *)"Appear",0); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,14.0); } this->_entityCollisionClass = 4; SoundEffects::PlayWithFartOverride(0xcd,1.0,2,0,1.0); } FUN_00862fe0(); ExceptionList = local_1c; return; } //@@ 006e69b0 Entity_Pickup::Render /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [vtable slot 5] prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Pickup::Render(Entity_Pickup *this,Vector *offset) { Vector *position; float fVar1; code *pcVar2; uint uVar3; LayerState *pLVar4; double dVar5; undefined *puVar6; Vector local_24; float local_1c; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb151; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; if (((this->_exists != 0) && (this->_visible != 0)) && (this->_dropDelay < 1)) { if (this->_variant == 100) { if (this->_megaChestCollectible[0] != (void *)0x0) { return; } local_1c = (this->_pos).y + (this->_posOffset).y; local_24.y = (g_screenHeight - 182.0) * 0.5; local_14 = g_displayPixelRatio * g_screenPointScale; local_18 = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_14 + 0.5; ExceptionList = &local_10; dVar5 = floor((double)local_18); local_18 = (float)dVar5 / local_14; local_24.y = ((local_1c - 140.0) * 0.65 + local_24.y) * local_14 + 0.5; dVar5 = floor((double)local_24.y); position = &this->_renderPosition; fVar1 = offset->x; (this->_renderPosition).y = (float)dVar5 / local_14 + offset->y; position->x = local_18 + fVar1; local_24.y = 0.0; local_14 = 0.0; if (((this->_altPedestalANM2)._loaded != 0) && (*(int *)((int)g_game->_room + 0x12bc) != 5)) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80e40) && (_Init_thread_header(), DAT_00c80e40 == -1)) { _DAT_00c5d010 = 0x300000004; DAT_00c5d018 = 0x1b; puVar6 = &DAT_00b15710; _atexit((_func_4879 *)&DAT_00b15710); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c80e40,puVar6,uVar3); } if ((DAT_00c5d00c == 0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), DAT_00c5d00c == 0)) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar3 = DAT_00c5d00c >> ((byte)_DAT_00c5d010 & 0x1f) ^ DAT_00c5d00c; uVar3 = uVar3 << ((byte)((ulonglong)_DAT_00c5d010 >> 0x20) & 0x1f) ^ uVar3; DAT_00c5d00c = uVar3 >> ((byte)DAT_00c5d018 & 0x1f) ^ uVar3; (this->_altPedestalANM2)._color._tint[3] = (float)((double)(int)DAT_00c5d00c + __uint_to_double_fixup[-((int)DAT_00c5d00c >> 0x1f)]) * 2.3283062e-10 * 0.15 + 0.05; if (this->_subtype != 0) { local_24.y = -2.6; } local_24.x = local_24.y + position->x; local_24.y = local_24.y + (this->_renderPosition).y; Sprite::RenderLayer((Sprite *)&this->_altPedestalANM2,1,&local_24,&g_vectorZero, &g_vectorZero); local_14 = 2.6; } pLVar4 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar4->_visible = 0; AnimationState::Render (&(this->_sprite)._overlayAnimState,position,&g_vectorZero,&g_vectorZero); AnimationState::Render(&(this->_sprite)._animState,position,&g_vectorZero,&g_vectorZero); pLVar4 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar4->_visible = 1; if (this->_megaChestCollectible[1] == (void *)0x0) { local_24.x = local_14 + position->x; local_24.y = local_14 + (this->_renderPosition).y; Sprite::RenderLayer((Sprite *)&this->_sprite,1,&local_24,&g_vectorZero,&g_vectorZero); } else { local_24.x = (this->_sprite)._scale.x * -16.0 * 0.65 + position->x; local_24.y = (this->_sprite)._scale.y * 0.0 * 0.65 + (this->_renderPosition).y; Sprite::RenderLayer((Sprite *)&this->_sprite,1,&local_24,&g_vectorZero,&g_vectorZero); local_24.x = (this->_sprite)._scale.x * 16.0 * 0.65 + position->x; local_24.y = (this->_sprite)._scale.y * 0.0 * 0.65 + (this->_renderPosition).y; Sprite::RenderLayer((Sprite *)((int)this->_megaChestCollectible[1] + 0x48),1,&local_24, &g_vectorZero,&g_vectorZero); } } else { ExceptionList = &local_10; Entity::Render((Entity *)this,offset); } if ((this->_priceANM2)._loaded != 0) { ANM2::Render(&this->_priceANM2,&this->_renderPosition,&g_vectorZero,&g_vectorZero); } FUN_008630c0(this,offset); } ExceptionList = local_10; return; } //@@ 006e6e40 Entity_Pickup::TryOpenChest /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPickup:TryOpenChest prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Pickup::TryOpenChest(Entity_Pickup *this,Entity_Player *player) { code *pcVar1; Vector *pVVar2; Vector targetPos; Vector targetPos_00; undefined1 *puVar3; byte bVar4; uint uVar5; Entity *spawned; int lootContainer; Entity_Pickup *pEVar6; Entity_Player *pEVar7; int extraout_ECX; float fVar8; float nudgeX; int iVar9; Vector lootSpawnPos; Vector lootVelocity; Vector randomVelocity; Vector spiderTarget; Vector playerChestMidpoint; RNG dropRng; int *loot [3]; uint lootFirst; int lootCount; float local_80; void *local_7c; uint lootIndex; Vector *chestPos; float local_70; Room *local_6c; Entity_Player *openingPlayer; Vector *local_64; char isPickupSpawned; float local_5c; Entity_Pickup *chest; byte isPayToPlay; undefined4 flashColor; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int *local_14; Game *game; int *lootProxy; Manager *manager; ColorMod *poofColor; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = (int *)0xffffffff; puStack_18 = &LAB_00afb180; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(loot + 0x21); ExceptionList = &local_1c; openingPlayer = player; chest = this; puVar3 = (undefined1 *)((int)register0x00000010 + -4); if (player == (Entity_Player *)0x0) { openingPlayer = Game::GetNearestPlayerEx(&this->_pos,1,0,0); puVar3 = puStack_20; if (openingPlayer == (Entity_Player *)0x0) { openingPlayer = Game::GetPlayer(g_game,0); puVar3 = puStack_20; } } puStack_20 = puVar3; if (this->_subtype == 0) { bVar4 = 0; } else { bVar4 = ANM2::SetAnimation(&this->_sprite,s_Open,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } manager = g_manager; local_5c = 3.08286e-44; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,1.0,2,0,1.0,0.0); manager = g_manager; iVar9 = this->_variant; if (((iVar9 == 0x3c) || (iVar9 == 0x35)) || (iVar9 == 0x37)) { local_5c = 2.18603e-43; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,1.0,2,0,1.0,0.0); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc6,1); } uVar5 = Random(); pVVar2 = &this->_pos; chestPos = pVVar2; spawned = Game::Spawn(g_game,1000,0xf,pVVar2,&g_vectorZero,(Entity *)0x0,2,uVar5); fVar8 = (this->_sprite)._scale.x; local_30 = 0; uStack_2c = 0; local_28 = 0; poofColor = &(spawned->_sprite)._color; (spawned->_posOffset).y = fVar8 * -10.0; (spawned->_posOffset).x = fVar8 * 0.0; fVar8 = (this->_sprite)._scale.y; (spawned->_sprite)._scale.x = (this->_sprite)._scale.x * 0.8; (spawned->_sprite)._scale.y = fVar8 * 0.8; if (poofColor != (ColorMod *)&flashColor) { (spawned->_sprite)._color._colorize[0] = 0.0; (spawned->_sprite)._color._colorize[1] = 0.0; (spawned->_sprite)._color._colorize[2] = 0.0; (spawned->_sprite)._color._colorize[3] = 0.0; (spawned->_sprite)._color._offset[0] = 0.0; (spawned->_sprite)._color._offset[1] = 0.0; poofColor->_tint[0] = 1.0; (spawned->_sprite)._color._tint[1] = 1.0; (spawned->_sprite)._color._tint[2] = 1.0; (spawned->_sprite)._color._tint[3] = 0.3; (spawned->_sprite)._color._offset[2] = 0.0; } spawned->_renderDepthOffset = 4.0; isPickupSpawned = '\0'; local_5c = (float)this->_variant; isPayToPlay = this->_isPayToPlay; GetChestLoot(this,loot,1,openingPlayer); lootProxy = loot[0]; local_14 = (int *)0x0; chest->_subtype = 0; game = g_game; if ((chest->_variant == 0x35) && (lootCount == 0)) { chest->_chestReCloseTimer = 0; *(undefined1 *)((int)game->_room + 0x7894) = 1; if (1 < *(int *)&game->_deathmatchManager) { uVar5 = Random(); Game::Spawn(g_game,1000,0xf,pVVar2,&g_vectorZero,(Entity *)0x0,0,uVar5); manager = g_manager; local_5c = 3.71344e-43; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,0.7,2,0,1.0,0.0); (**(code **)(*(int *)chest + 0x28))(); } } else { dropRng._seed = (chest->_dropRNG)._seed; dropRng._shift1 = 2; dropRng._shift2 = 7; dropRng._shift3 = 9; local_70 = 0.0; pEVar6 = chest; uVar5 = lootFirst; while( true ) { pEVar7 = openingPlayer; lootIndex = uVar5; if (uVar5 == lootFirst + lootCount) break; if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (**(int **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) == 5) { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (*(int *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 4) != 100) goto LAB_006e746d; if (local_5c == 5.46506e-43) { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (*(int *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 8) == 0x244) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x19f); pEVar6 = chest; } } if (pEVar6->_variant == 100) { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } local_64 = *(Vector **) (*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 0xc); if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } local_6c = *(Room **)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 8); if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (lootProxy == (int *)0x0) { lootContainer = 0; } else { lootContainer = *lootProxy; } pEVar6 = (Entity_Pickup *) Game::Spawn(g_game,**(uint **)(*(int *)(lootContainer + 4) + (*(int *)(lootContainer + 8) - 1U & uVar5) * 4), *(uint *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 4), chestPos,&g_vectorZero,(Entity *)0x0,(uint)local_6c,(uint)local_64) ; } else { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (lootProxy == (int *)0x0) { lootContainer = 0; } else { lootContainer = *lootProxy; } Morph(pEVar6,5,*(int *)(*(int *)(*(int *)(lootContainer + 4) + (*(int *)(lootContainer + 8) - 1U & uVar5) * 4) + 4), *(int *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 8),0,0,0); pEVar6 = chest; } if (((local_5c == 5.04467e-43) && (g_game->_difficulty != 2)) && ((g_game->_difficulty != 3 && ((g_game->_stage == 0xb && (g_game->_startingRoomIdx == g_game->_currentRoomIdx)))))) { MakeShopItem(pEVar6,-2); uVar5 = Random(); spawned = Game::Spawn(g_game,1000,0xf,&pEVar6->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5) ; flashColor = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_44 = 0x3f800000; local_30 = 0; local_40 = 0x40000000; uStack_3c = 0x3ecccccd; uStack_38 = 0x3ecccccd; uStack_34 = 0x3f800000; uStack_2c = 0; local_28 = 0; (**(code **)(*(int *)spawned + 0x3c))(&flashColor,0xffffffff,0xff,0,1); } if (pEVar6->_variant == 100) { (pEVar6->_targetPosition).x = chestPos->x; (pEVar6->_targetPosition).y = chestPos->y; if ((int)local_5c < 0x169) { if (local_5c == 5.04467e-43) { iVar9 = 5; } else { switch(local_5c) { case 7.00649e-44: iVar9 = 10; break; case 7.14662e-44: iVar9 = 6; break; case 7.28675e-44: case 7.56701e-44: iVar9 = 7; break; case 7.42688e-44: iVar9 = 8; if (isPayToPlay != 0) { iVar9 = 0x11; } break; case 7.70714e-44: iVar9 = 0xc; if (isPayToPlay != 0) { iVar9 = 0x12; } break; case 7.84727e-44: iVar9 = 0xd; break; case 7.9874e-44: iVar9 = 0xe; if (isPayToPlay != 0) { iVar9 = 0x13; } break; default: goto switchD_006e73d9_caseD_3a; case 8.40779e-44: iVar9 = 4; if (isPayToPlay != 0) { iVar9 = 0x10; } } } } else { if (local_5c != 5.46506e-43) goto switchD_006e73d9_caseD_3a; iVar9 = 0xb; } SetAlternatePedestal(pEVar6,iVar9); } switchD_006e73d9_caseD_3a: isPickupSpawned = '\x01'; LAB_006e7459: pEVar6 = chest; uVar5 = lootIndex; LAB_006e7467: uVar5 = uVar5 + 1; } else { LAB_006e746d: if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (**(int **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) == 0) { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (*(int *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 4) != 1) goto LAB_006e74e4; Level::InitializeDevilAngelRoom((Level *)g_game,0,0); game = g_game; g_game->_leaveDoor = -1; Game::StartRoomTransition(game,-1,-1,3,openingPlayer,-1); uVar5 = uVar5 + 1; pEVar6 = chest; } else { LAB_006e74e4: if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (**(int **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) == 0x55) { local_64 = &pEVar6->_pos; if (uVar5 == lootFirst) { local_6c = g_game->_room; pEVar7 = *(Entity_Player **)&openingPlayer->field_0x1450; if ((*(Entity_Player **)&openingPlayer->field_0x1450 == (Entity_Player *)0x0) && (pEVar7 = *(Entity_Player **)&openingPlayer->field_0x144c, *(Entity_Player **)&openingPlayer->field_0x144c == (Entity_Player *)0x0)) { if (openingPlayer->_darkArtsLastSnare == (Entity *)0x0) { pEVar7 = openingPlayer; } else { pEVar7 = (Entity_Player *) Entity::GetLastParent(openingPlayer->_darkArtsLastSnare); } } playerChestMidpoint.x = ((pEVar7->_pos).x + local_64->x) * 0.5; playerChestMidpoint.y = ((pEVar7->_pos).y + local_64->y) * 0.5; Room::FindFreePickupSpawnPosition (local_6c,&spiderTarget,&playerChestMidpoint,70.0,0,0,0); targetPos.y = spiderTarget.y; targetPos.x = spiderTarget.x; Entity_NPC::ThrowSpider(&chest->_pos,(Entity *)chest,targetPos,0,-30.0); uVar5 = uVar5 + 1; pEVar6 = chest; } else { targetPos_00.y = g_vectorZero.y; targetPos_00.x = g_vectorZero.x; Entity_NPC::ThrowSpider(local_64,(Entity *)pEVar6,targetPos_00,0,-30.0); uVar5 = uVar5 + 1; pEVar6 = chest; } } else { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (**(int **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) == 3) { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (*(int *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4) + 4) == 0x2b) { Entity_Player::AddBlueFlies(openingPlayer,1,chestPos,(Entity *)0x0); uVar5 = uVar5 + 1; pEVar6 = chest; } else { if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } if (*(int *)(*(int *)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4 ) + 4) != 0x49) goto LAB_006e7467; openingPlayer->_numBlueSpiders = openingPlayer->_numBlueSpiders + 1; spawn_blue_spider(chestPos,(Entity *)openingPlayer,&g_vectorZero); uVar5 = uVar5 + 1; pEVar6 = chest; } } else { local_6c = (Room *)0x3f800000; if ((pEVar6->_variant == 0x39) && (local_6c = (Room *)((float)(int)local_70 * 0.05 + 0.4), 1.0 <= (float)local_6c)) { local_6c = (Room *)0x3f800000; } if (lootProxy == (int *)0x0) { iVar9 = 0; } else { iVar9 = *lootProxy; } local_7c = *(void **)(*(int *)(iVar9 + 4) + (*(int *)(iVar9 + 8) - 1U & uVar5) * 4); Isaac::GetRandomPickupVelocity(&randomVelocity,&pEVar6->_pos,0,&dropRng); lootVelocity.x = randomVelocity.x * (float)local_6c; lootVelocity.y = randomVelocity.y * (float)local_6c; if (dropRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); bVar4 = (*pcVar1)(); return bVar4; } dropRng._seed = (uint)dropRng._seed >> ((byte)dropRng._shift1 & 0x1f) ^ dropRng._seed; dropRng._seed = dropRng._seed << ((byte)dropRng._shift2 & 0x1f) ^ dropRng._seed; dropRng._seed = (uint)dropRng._seed >> ((byte)dropRng._shift3 & 0x1f) ^ dropRng._seed; local_64 = (Vector *)0xe; if (dropRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); bVar4 = (*pcVar1)(); return bVar4; } uVar5 = (uint)dropRng._seed >> 3 ^ dropRng._seed; uVar5 = uVar5 << 1 ^ uVar5; uVar5 = uVar5 >> 0xe ^ uVar5; fVar8 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10 * 3.14; local_64 = (Vector *)(fVar8 + fVar8); lootSpawnPos.x = cos((float)local_64); pVVar2 = chestPos; lootSpawnPos.x = lootSpawnPos.x + chestPos->x; lootSpawnPos.y = sin((float)local_64); lootSpawnPos.y = lootSpawnPos.y + pVVar2->y; spawned = EntitySpawner::Spawn(local_7c,&lootSpawnPos,&lootVelocity,(Entity *)0x0); if ((spawned->_type == 5) && (chest->_variant == 0x39)) { *(int *)&spawned[1]._sprite._flipX = (int)local_70 / 2; } (**(code **)(*(int *)spawned + 0xc))(); local_70 = (float)((int)local_70 + 1); if (((1 < *(int *)&g_game->_deathmatchManager) && (spawned->_type == 1)) || (spawned->_type - 10U < 0x3de)) { local_7c = (void *)chestPos->x; local_80 = chestPos->y; local_6c = (Room *)((float)local_7c - (openingPlayer->_pos).x); local_64 = (Vector *)(local_80 - (openingPlayer->_pos).y); fVar8 = sqrtf((float)local_64 * (float)local_64 + (float)local_6c * (float)local_6c); if (fVar8 <= 0.0) { nudgeX = (float)local_6c; pVVar2 = local_64; } else { nudgeX = (float)local_6c * (20.0 / fVar8); pVVar2 = (Vector *)((float)local_64 * (20.0 / fVar8)); } (spawned->_pos).x = (float)local_7c + nudgeX; (spawned->_pos).y = local_80 + (float)pVVar2; goto switchD_006e73d9_caseD_3a; } if ((spawned->_type != 5) || (bVar4 = IsChest(spawned->_variant), bVar4 == 0)) goto LAB_006e7459; fVar8 = (chest->_sprite)._scale.y; (spawned->_sprite)._scale.x = (chest->_sprite)._scale.x * 0.8; (spawned->_sprite)._scale.y = fVar8 * 0.8; uVar5 = lootIndex + 1; pEVar6 = chest; } } } } } pVVar2 = &pEVar6->_pos; if (isPickupSpawned != '\0') { local_70 = (pEVar6->_pos).y - (openingPlayer->_pos).y; local_5c = pVVar2->x - (openingPlayer->_pos).x; local_80 = local_70 * local_70 + local_5c * local_5c; if (local_80 < 1600.0) { local_7c = (void *)(openingPlayer->_velocity).x; local_64 = (Vector *)(openingPlayer->_velocity).y; fVar8 = sqrtf(local_80); if (0.0 < fVar8) { local_70 = (1.0 / fVar8) * local_70; local_5c = (1.0 / fVar8) * local_5c; } fVar8 = sqrtf(local_80); fVar8 = (40.0 - fVar8) * 0.4; (pEVar7->_velocity).x = ((float)local_7c - fVar8 * local_5c) * 0.5; (pEVar7->_velocity).y = ((float)local_64 - fVar8 * local_70) * 0.5; pEVar6 = chest; } pEVar6->_wait = 0x14; } if (pEVar6->_variant == 0x35) { pEVar6->_chestReCloseTimer = 0x3c; } if (((1 < *(int *)&g_game->_deathmatchManager) && (bVar4 = IsChest(pEVar6->_variant), bVar4 != 0)) && (extraout_ECX != 0x35)) { uVar5 = Random(); Game::Spawn(g_game,1000,0xf,pVVar2,&g_vectorZero,(Entity *)0x0,0,uVar5); manager = g_manager; local_64 = (Vector *)0x109; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,(int)local_64,0.7,2,0,1.0,0.0); (**(code **)(*(int *)chest + 0x28))(); } *(undefined1 *)((int)g_game->_room + 0x7894) = 1; } std::deque::clear(); lootProxy = loot[0]; loot[0] = (int *)0x0; operator_delete(lootProxy,8); bVar4 = 1; } ExceptionList = local_1c; return bVar4; } //@@ 006e7be0 Entity_Pickup::PlayDropSound /* ZHL [lua] Lua binding EntityPickup:PlayDropSound */ void __thiscall Entity_Pickup::PlayDropSound(Entity_Pickup *this) { int iVar1; Manager *pMVar2; byte bVar3; int extraout_ECX; int extraout_EDX; Entity_Pickup *local_8; iVar1 = this->_variant; if (iVar1 == 10) { if (this->_subtype == 7) { local_8 = (Entity_Pickup *)0x1d2; } else if (this->_subtype == 0xb) { local_8 = (Entity_Pickup *)0x1d3; } else { local_8 = (Entity_Pickup *)0x44; } } else if (iVar1 == 0x14) { iVar1 = this->_subtype; if (((iVar1 == 1) || (iVar1 == 5)) || (iVar1 == 4)) { local_8 = (Entity_Pickup *)0xe9; } else if ((iVar1 == 2) || (iVar1 == 6)) { local_8 = (Entity_Pickup *)0xe7; } else { if ((iVar1 != 3) && (iVar1 != 7)) { return; } local_8 = (Entity_Pickup *)0xc6; } } else if (iVar1 == 0x1e) { local_8 = (Entity_Pickup *)0x3b; } else { if (iVar1 == 0x28) { if (this->_subtype != 4) { local_8 = (Entity_Pickup *)0x28; goto LAB_006e7d6b; } } else { if (iVar1 != 0x46) { if (iVar1 == 0x45) { local_8 = (Entity_Pickup *)0x26; } else { local_8 = this; bVar3 = IsChest(iVar1); if (bVar3 == 0) { if (extraout_ECX == 300) { local_8 = (Entity_Pickup *)0xf9; } else if (extraout_ECX == 0x15e) { if (*(int *)(extraout_EDX + 0x30) == 0x7a) { local_8 = (Entity_Pickup *)0x386; } else { local_8 = (Entity_Pickup *)0xf9; } } else if (extraout_ECX == 0x6e) { local_8 = (Entity_Pickup *)0x1cf; } else if (extraout_ECX == 0x29) { local_8 = (Entity_Pickup *)0x28; } else { if (extraout_ECX != 0x2a) { return; } local_8 = (Entity_Pickup *)0x102; } } else { local_8 = (Entity_Pickup *)0x15; } } goto LAB_006e7d6b; } if ((this->_subtype & 0x7ffU) != 0xe) { local_8 = (Entity_Pickup *)0x26; goto LAB_006e7d6b; } } local_8 = (Entity_Pickup *)0x1d2; } LAB_006e7d6b: pMVar2 = g_manager; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); return; } //@@ 006e7dc0 Entity_Pickup::PlayPickupSound /* ZHL [lua] Lua binding EntityPickup:PlayPickupSound */ void __thiscall Entity_Pickup::PlayPickupSound(Entity_Pickup *this) { byte bVar1; ItemConfig_Card *cardConfig; uint uVar2; int *proceduralItem; Manager *manager; bool bVar3; float fVar4; int iVar5; RNG pitchRng; float local_8; Game *game; manager = g_manager; iVar5 = this->_variant; if (iVar5 == 10) { iVar5 = this->_subtype; if (iVar5 == 4) { local_8 = 3.72745e-43; } else if ((iVar5 == 3) || (iVar5 == 8)) { local_8 = 7.56701e-44; } else if (iVar5 == 6) { local_8 = 6.55808e-43; } else if (iVar5 == 7) { local_8 = 6.51604e-43; } else if (iVar5 == 0xb) { local_8 = 6.45999e-43; } else if (iVar5 == 0xc) { local_8 = 6.96445e-43; } else { if (iVar5 == 10) { return; } local_8 = 2.5924e-43; } LAB_006e8329: seed_fart_sound_override((int *)&local_8); iVar5 = 2; LAB_006e8344: fVar4 = 1.0; LAB_006e834c: SoundEffects::Play(&manager->_sfxManager,(int)local_8,fVar4,iVar5,0,1.0,0.0); return; } if (iVar5 == 0x14) { iVar5 = this->_subtype; if (((iVar5 == 1) || (iVar5 == 4)) || (iVar5 == 7)) { local_8 = 3.27904e-43; } else if ((iVar5 == 2) || (iVar5 == 6)) { local_8 = 3.25101e-43; } else if (iVar5 == 3) { local_8 = 2.78858e-43; } else { if (iVar5 != 5) { return; } local_8 = 2.8026e-43; } goto LAB_006e8329; } if (iVar5 == 0x1e) { iVar5 = this->_subtype; if (((iVar5 == 1) || (iVar5 == 3)) || (iVar5 == 4)) { local_8 = 8.12753e-44; seed_fart_sound_override((int *)&local_8); iVar5 = 2; fVar4 = 0.85; goto LAB_006e834c; } if (iVar5 != 2) { return; } local_8 = 2.85865e-43; goto LAB_006e8329; } if (iVar5 == 0x28) { if (this->_subtype == 4) { local_8 = 6.5861e-43; } else { local_8 = 2.81661e-43; } goto LAB_006e8329; } if (((iVar5 == 0x46) || (iVar5 == 0x15e)) || (iVar5 == 0x45)) { LAB_006e8319: local_8 = 3.53127e-43; manager = g_manager; goto LAB_006e8329; } if (iVar5 == 300) { cardConfig = ItemConfig::GetCard(&g_manager->_itemConfig,this->_subtype); if ((cardConfig == (ItemConfig_Card *)0x0) || ((((iVar5 = cardConfig->pickupSubtype, iVar5 != 3 && (iVar5 != 4)) && (((iVar5 != 6 && ((iVar5 != 7 && (iVar5 != 0xd)))) && (iVar5 != 0xf)))) && (cardConfig->cardType != 2)))) { local_8 = 1.12104e-44; } else { local_8 = 3.53127e-43; } goto LAB_006e8329; } if (iVar5 != 100) { if (iVar5 != 0x29) { if (iVar5 == 0x2a) { uVar2 = Random(); SoundEffects::PlayWithFartOverride (0x1ca,1.0,2,0, (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.9); return; } return; } local_8 = 2.81661e-43; goto LAB_006e8329; } bVar1 = Entity::HasEntityFlags((Entity *)this,0x40000); if (bVar1 != 0) goto LAB_006e8319; uVar2 = this->_subtype; if ((((int)uVar2 < 0) && (iVar5 = FUN_009e0180(uVar2), iVar5 != 0)) && (*(int *)(iVar5 + 0xc) != 0)) { pitchRng._seed = *(int *)(iVar5 + 8); pitchRng._shift1 = 1; pitchRng._shift2 = 5; pitchRng._shift3 = 0x10; fVar4 = RNG::RandomFloat(&pitchRng); local_8 = fVar4 * 1.4 + 0.2; SoundEffects::PlayWithFartOverride(*(int *)(iVar5 + 0xc),1.0,2,0,local_8); return; } game = g_game; if ((uVar2 != 0xffffffff) || (bVar1 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f), bVar1 == 0)) { manager = g_manager; if (uVar2 < 0x48) { if ((uVar2 != 0x47) && (uVar2 != 0xb)) { bVar3 = uVar2 == 0xc; LAB_006e81cf: if (!bVar3) { iVar5 = *(int *)((int)game->_room + 8); if ((iVar5 == 5) || (iVar5 == 6)) { local_8 = 1.80768e-43; } else if ((iVar5 == 4) || (iVar5 == 0xc)) { local_8 = 1.79366e-43; } else if (iVar5 == 2) { local_8 = 1.82169e-43; } else { if (((iVar5 == 0xe) || (iVar5 == 0x16)) || ((*(uint *)(*(int *)((int)game->_room + 4) + 0x44) >> 0xb & 1) != 0)) { local_8 = 4.4281e-43; goto LAB_006e8329; } local_8 = 3.22299e-44; } seed_fart_sound_override((int *)&local_8); iVar5 = 2; fVar4 = 0.5; goto LAB_006e834c; } } local_8 = 1.4013e-45; } else { if (uVar2 != 0x5c) { bVar3 = uVar2 == 0x271; goto LAB_006e81cf; } local_8 = 2.36819e-43; } seed_fart_sound_override((int *)&local_8); iVar5 = 0x1e; goto LAB_006e8344; } iVar5 = PlayerManager::GetGFuelCount(); manager = g_manager; switch(iVar5) { case 0: case 1: local_8 = 3.75548e-43; goto LAB_006e8131; case 2: case 3: goto switchD_006e808c_caseD_2; case 4: case 5: local_8 = 1.84971e-43; break; default: local_8 = 1.84971e-43; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&manager->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); local_8 = 8.46384e-43; } manager = g_manager; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&manager->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); switchD_006e808c_caseD_2: local_8 = 8.43582e-43; LAB_006e8131: manager = g_manager; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&manager->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); uVar2 = Random(); proceduralItem = (int *)FUN_009e0180(this->_subtype); SimpleString::operator= ((SimpleString *)(*proceduralItem + 0x20), (&PTR_s_GAMER_SPEED_UP__00b67e58)[uVar2 % 0x32]); return; } //@@ 006e8380 Entity_Pickup::GetCoinValue /* ZHL [exact] __thiscall int Entity_Pickup::GetCoinValue(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Pickup::GetCoinValue(Entity_Pickup *this) { if ((this->_variant == 0x14) && (this->_subtype - 1U < 7)) { return *(int *)(&DAT_00b67e34 + this->_subtype * 4); } return 0; } //@@ 006e83a0 Entity_Pickup::can_player_buy /* DB: price 0x534 vs coins, -10 free, health type checks, coop ghost rejects */ undefined4 __thiscall Entity_Pickup::can_player_buy(Entity_Pickup *this,Entity_Player *param_2) { undefined *puVar1; undefined *puVar2; byte bVar3; char cVar4; int iVar5; int iVar6; EntityRef *pEVar7; Entity_Player *this_00; int extraout_EDX; code *extraout_EDX_00; bool bVar8; bool bVar9; EntityRef local_30; if (param_2->_isCoopGhost != 0) { return 0; } iVar6 = this->_price; if (iVar6 < 1) { if (iVar6 == -10) { return 0; } } else { iVar5 = FUN_0041b770(0x209); if (iVar5 + param_2->_numCoins < iVar6) { return 0; } } iVar5 = Entity_Player::GetHealthType(param_2); if (iVar5 == 2) { return 1; } bVar3 = Entity_Player::HasInstantDeathCurse(this_00); if (bVar3 != 0) { return 1; } if (iVar6 + 9U < 9) { puVar1 = ReferenceCount::vftable[iVar6 * -2 + 4]; puVar2 = ReferenceCount::vftable[iVar6 * -2 + 5]; if ((puVar1 != (undefined *)0x0) || (puVar2 != (undefined *)0x0)) { if (((int)puVar2 < 1) || (puVar1 != (undefined *)0x0)) { if ((int)puVar1 < 1) { return 1; } if (0 < (int)puVar2) { iVar6 = Entity_Player::GetEffectiveMaxHearts(param_2); if (iVar6 < 2) { return 0; } return 1; } if (puVar2 != (undefined *)0x0) { return 1; } iVar6 = Entity_Player::GetEffectiveMaxHearts(param_2); bVar9 = false; bVar8 = iVar6 == 0; } else { iVar6 = Entity_Player::GetHealthType(param_2); if (iVar6 == 2) { return 1; } iVar5 = param_2->_soulHearts; bVar9 = SBORROW4(iVar5,extraout_EDX); iVar6 = iVar5 - extraout_EDX; bVar8 = iVar5 == extraout_EDX; } if (bVar8 || bVar9 != iVar6 < 0) { return 0; } return 1; } } if (iVar6 == -5) { pEVar7 = EntityRef::EntityRef(&local_30); cVar4 = (*extraout_EDX_00)(0x40000000,0x10002080,0,pEVar7,0x1e); if (cVar4 == '\0') { return 0; } } return 1; } //@@ 006e84d0 Entity_Pickup::CollectTrinket /* DB: ? param player; 0x534 trinket id, Trinket ID out of bounds */ void __thiscall Entity_Pickup::CollectTrinket(Entity_Pickup *this,Entity_Player *param_2,uint param_3) { byte bVar1; uint uVar2; int maxHeartsTaken; Entity_Pickup *otherPickup; Entity_Player *restockOwner; Entity_Player *room; void *rngEnd; int iVar3; uint uVar4; int iVar5; undefined4 damageSource; undefined4 local_5c; undefined4 local_58; undefined4 local_54; float local_50; float local_4c; float local_48; float local_44; undefined4 local_40; undefined4 local_3c; EntityList_EL entities; Vector poofPos; float local_20; float local_1c; Entity_Pickup *savedThis; char isStage11Normal; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isFreeDeal; bool isRemoveOtherDeals; Entity_Pickup *pickup; void *rngBegin; Room *room; local_8 = 0xffffffff; puStack_c = &LAB_00afb1c5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; savedThis = this; if ((param_3 == 0) && (param_3 = this->_price, param_3 == 0)) goto LAB_006e89de; ANM2::Reset(&this->_priceANM2); if (0 < (int)param_3) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&entities,3,0xce,0x209,0,0) ; uVar4 = 0; local_8 = 0; if (param_3 != 0) { do { if ((uint)entities._size <= uVar4) break; damageSource = 0; local_5c = 0; local_58 = 0; local_4c = g_vectorZero.y; local_44 = g_vectorZero.y; local_54 = 0; local_50 = g_vectorZero.x; local_48 = g_vectorZero.x; local_40 = 0; local_3c = 0; (**(code **)(**(int **)((int)entities._data + uVar4 * 4) + 0x24))(&damageSource,uVar2); uVar4 = uVar4 + 1; } while (uVar4 < param_3); } entities._size = param_3 - entities._size; param_3 = 0; if (0 < entities._size) { param_3 = entities._size; } if (entities._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,entities._data,0); } local_8 = 0xffffffff; Entity_Player::AddCoins(param_2,-param_3); FUN_007d8630(param_3); Player_stats_add(&g_game->_onlinePlayerStats,0xd,param_2,(float)(int)param_3); goto LAB_006e89de; } iVar5 = Entity_Player::GetHealthType(param_2); if ((iVar5 == 2) || (bVar1 = Entity_Player::HasInstantDeathCurse(room), bVar1 != 0)) { isFreeDeal = true; } else { isFreeDeal = false; } isRemoveOtherDeals = false; switch(param_3) { case 0xfffffff7: if (isFreeDeal) { isRemoveOtherDeals = true; } else { Entity_Player::AddMaxHearts(param_2,-2,0); LAB_006e873c: Entity_Player::AddSoulHearts(param_2,-2,0); } break; case 0xfffffff8: if (isFreeDeal) { isRemoveOtherDeals = true; } else { LAB_006e8700: Entity_Player::AddSoulHearts(param_2,-4,0); } break; case 0xfffffff9: if (!isFreeDeal) goto LAB_006e873c; isRemoveOtherDeals = true; break; case 0xfffffffa: local_1c = 1.0; iVar5 = Entity_Player::GetTrinketMultiplier(param_2,0xad); if (iVar5 == 2) { local_1c = 0.9; } else if (iVar5 == 3) { local_1c = 0.8; } rngEnd = (param_2->_trinketRNGs)._end; if ((int)rngEnd - (int)(param_2->_trinketRNGs)._begin >> 4 < 0xae) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); rngEnd = (param_2->_trinketRNGs)._end; } rngBegin = (param_2->_trinketRNGs)._begin; uVar2 = ((int)rngEnd - (int)rngBegin >> 4) - 1; if (0xad < uVar2) { uVar2 = 0xad; } local_20 = RNG::RandomFloat((RNG *)(uVar2 * 0x10 + (int)rngBegin)); isRemoveOtherDeals = isFreeDeal; if (local_20 <= local_1c) { Entity_Player::TryRemoveTrinket(param_2,0xad); } break; case 0xfffffffb: isRemoveOtherDeals = false; if (isFreeDeal) { isRemoveOtherDeals = true; } break; case 0xfffffffc: if (!isFreeDeal) { Entity_Player::AddMaxHearts(param_2,-2,0); goto LAB_006e8700; } isRemoveOtherDeals = true; break; case 0xfffffffd: if (isFreeDeal) { isRemoveOtherDeals = true; } else { iVar3 = (param_2->_soulHearts + 1) / 2; iVar5 = 3; if (iVar3 < 3) { iVar5 = iVar3; } maxHeartsTaken = 0; if (0 < 3 - iVar3) { maxHeartsTaken = 3 - iVar3; } Entity_Player::AddMaxHearts(param_2,maxHeartsTaken * -2,0); Entity_Player::AddSoulHearts(param_2,iVar5 * -2,0); } break; case 0xfffffffe: if (isFreeDeal) { isRemoveOtherDeals = true; } else { Entity_Player::AddMaxHearts(param_2,-4,0); } break; case 0xffffffff: if (isFreeDeal) { isRemoveOtherDeals = true; } else { Entity_Player::AddMaxHearts(param_2,-2,0); } } local_4c = g_vectorZero.y; local_44 = g_vectorZero.y; local_50 = g_vectorZero.x; local_48 = g_vectorZero.x; damageSource = 0; local_5c = 0; local_58 = 0; local_54 = 0; local_40 = 0; local_3c = 0; Entity_Player::set_last_damage(0x400,0,&damageSource); if (isRemoveOtherDeals) { if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || (isStage11Normal = '\x01', g_game->_stage != 0xb)) { isStage11Normal = '\0'; } local_1c = (float)g_game->_startingRoomIdx; local_20 = (float)g_game->_currentRoomIdx; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&entities,5,-1,-1,0,0); pickup = savedThis; uVar2 = 0; local_8 = 2; if (entities._size != 0) { do { otherPickup = (Entity_Pickup *) __RTDynamicCast(*(undefined4 *)((int)entities._data + uVar2 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); if (((otherPickup != (Entity_Pickup *)0x0) && (otherPickup != pickup)) && (((otherPickup->_variant == 100 && ((otherPickup->_subtype != 0 && (otherPickup->_price < 0)))) || ((isStage11Normal != '\0' && ((local_1c == local_20 && (otherPickup->_variant == 0x168)))))))) { uVar4 = Random(); poofPos.x = (otherPickup->_pos).x + 0.0; poofPos.y = (otherPickup->_pos).y + 10.0; Game::Spawn(g_game,1000,0xf,&poofPos,&g_vectorZero,(Entity *)0x0,0,uVar4); otherPickup->_timeout = 4; } uVar2 = uVar2 + 1; } while (uVar2 < (uint)entities._size); } local_8 = 0xffffffff; if (entities._0_1_ == '\0') { local_8 = 3; tracked_alloc(1,entities._data,0); local_8 = 0xffffffff; } } bVar1 = Entity_Player::CanPickupItem(param_2); if ((bVar1 != 0) && (bVar1 = Entity_Player::IsHoldingItem(param_2), bVar1 == 0)) { Entity_Player::try_trigger_astral_projection(param_2); } LAB_006e89de: pickup = savedThis; if ((((savedThis->_variant != 100) && (param_3 != 0)) && ((restockOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x178,(RNG **)&g_game->_playerManager,1), restockOwner != (Entity_Player *)0x0 || ((g_game->_difficulty == 2 || (g_game->_difficulty == 3)))))) && (room = g_game->_room, room->_roomType == 2)) { iVar5 = (int)(((pickup->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((pickup->_pos).y - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (room->_gridWidth <= iVar5)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)) { iVar5 = -1; } else { iVar5 = room->_gridWidth * iVar3 + iVar5; } Room::TriggerRestock(room,iVar5,pickup->_shopItemId); } ExceptionList = local_10; return; } //@@ 006e8ae0 Entity_Pickup::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [vtable slot 23] prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Pickup::HandleCollision(Entity_Pickup *this,Entity *collider,byte low) { code *pcVar1; void *pvVar2; byte bVar3; char isAllowed; int iVar4; int bloodChargeSpace; ColorMod *color; ItemConfig_Item *itemConfig; char *pcVar5; Entity_Pickup *pEVar6; Entity_Player *otherPlayer; RNG *trinketRng; uint uVar7; uint uVar8; Entity *tmpEntity; byte unusedBool; void *pvVar9; int extraout_ECX; EntitySaveState *outSaveState; byte *anim; Entity_Player *gridEntity; PlayerManager *playerManager; ItemOverlay *itemOverlay; int extraout_ECX_00; Entity_Player *extraout_EDX; Entity_Player *extraout_EDX_00; int extraout_EDX_01; code *extraout_EDX_02; Entity_Player *this_01; uint extraout_EDX_03; EntityPtr EVar10; Room *pRVar11; uint *puVar12; Vector *pos; Entity_Player *player; EntityPtr EVar13; bool bVar14; float fVar15; float fVar16; EntityPtr EVar17; EntityPtr EVar18; char acStackY_264 [128]; void *pvVar19; Entity_Familiar *pEVar20; int iVar21; int iVar22; EntitySaveState saveState [10]; float local_194; float local_190; EntityRef pickupRef; Vector local_11c; int *local_114; Vector local_110; Vector local_108; Room *local_100; Room *local_fc; int subtype; char isAddedSoulHearts; Room *local_f0; Vector local_ec; EntityPtr candidates; Vector local_e0; EntityPtr local_d8; byte local_d1; Vector local_d0; int spiderCount; Entity_Player *pickingPlayer; byte isAppleOfSodom; Vector local_bc; EntityPtr local_b4; Entity_Familiar *collidingEntity; Vector local_ac; Room *local_a4; Vector local_9c; byte local_91; Entity_Pickup *pickup; bool isAddedRedHearts; char local_8a; char isPickedUp; undefined1 local_88 [44]; char local_5c [4]; int *local_58; EntityPtr local_4c; char local_44 [8]; RNG rng; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; Game *game; qword gameStateFlags; GridEntity *gridEntity; Manager *manager; int *megaChestPartner; undefined4 tagsHigh; undefined4 tagsLow; Vector *tmpPos; local_8 = 0xffffffff; puStack_c = &LAB_00afb22b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; collidingEntity = (Entity_Familiar *)collider; pEVar6 = this; pickup = this; if (this->_variant == 100) { if ((this->_megaChestCollectible[0] != (void *)0x0) && (g_forceCollideDepth == 0)) { return 1; } megaChestPartner = this->_megaChestCollectible[1]; if ((megaChestPartner != (int *)0x0) && (fVar16 = (collider->_pos).x, pEVar6 = (Entity_Pickup *)collider, (this->_pos).x <= fVar16 && fVar16 != (this->_pos).x)) { g_forceCollideDepth = g_forceCollideDepth + 1; ExceptionList = &local_10; local_d1 = (**(code **)(*(int *)collider + 0x5c))(); bVar3 = (**(code **)(*megaChestPartner + 0x5c))(); g_forceCollideDepth = g_forceCollideDepth + -1; ExceptionList = local_10; return bVar3 | local_d1; } } ExceptionList = &local_10; iVar4 = LuaEngine::PrePickupCollision((LuaEngine *)pEVar6,this,collider,low); if (iVar4 == 1) { ExceptionList = local_10; return 1; } if (iVar4 == -1) { ExceptionList = local_10; return 0; } if (collider->_type == 1) { if (0 < this->_collisionCooldown) { this->_collisionCooldown = 10; ExceptionList = local_10; return 1; } if ((((this->_variant == 100) && (bVar3 = ItemConfig::IsQuestItem(this->_subtype), bVar3 != 0)) && (collider->_parent != (EntityPtr)0x0)) && (collider->_subtype == 0xe)) { ExceptionList = local_10; return 0; } bVar3 = Game::IsInTimedSet(g_game,0x48); if (bVar3 != 0) { (**(code **)(*(int *)this + 0x60))(); } bVar3 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); if (((bVar3 != 0) && (this->_spawnerType == 0x330)) && (g_forceCollideDepth == 0)) { pcVar1 = *(code **)(*(int *)collider + 0x20); EntityRef::constructor(&pickupRef,(Entity *)pickup); (*pcVar1)(); this = pickup; } } iVar4 = *(int *)((int)this + 0x2c); if ((iVar4 == 0x14) && (*(int *)((int)this + 0x30) == 6)) { if (collider->_type != 1) { ExceptionList = local_10; return 1; } ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)"Touched",0); *(undefined4 *)((int)this + 0x54c) = 10; bVar3 = Entity_Player::HasTrinket((Entity_Player *)collider,0xac,0); if (bVar3 == 0) { ExceptionList = local_10; return 1; } collider[4]._collisionDamage = *(float *)((int)this + 0x30); ExceptionList = local_10; return 1; } local_108.y = *(float *)((int)this + 0x534); player = (Entity_Player *)0x0; subtype = *(int *)((int)this + 0x30); isPickedUp = '\0'; local_d1 = '\0'; local_8a = '\0'; pickingPlayer = (Entity_Player *)0x0; if (low == 0) { if (collidingEntity->_type != 1) { if (collidingEntity->_type != 3) goto LAB_006ecc76; iVar21 = collidingEntity->_variant; if ((((iVar21 == 0x18) || (iVar21 == 0x58)) || (iVar21 == 0x66)) && (iVar4 == 0x14)) { pEVar20 = (Entity_Familiar *)__RTDynamicCast(); if ((*(int *)((int)this + 0x2c) == 0x14) && (*(int *)((int)this + 0x30) - 1U < 7)) { Entity_Familiar::AddCoins(pEVar20); } else { Entity_Familiar::AddCoins(pEVar20); } } else if (((collidingEntity->_variant == 0x40) || (collidingEntity->_variant == 0x66)) && (iVar4 == 10)) { iVar4 = __RTDynamicCast(); switch(*(undefined4 *)((int)this + 0x30)) { case 1: case 9: *(int *)(iVar4 + 0xd80) = *(int *)(iVar4 + 0xd80) + 2; break; case 2: *(int *)(iVar4 + 0xd80) = *(int *)(iVar4 + 0xd80) + 1; break; default: goto LAB_006ed27b; case 5: *(int *)(iVar4 + 0xd80) = *(int *)(iVar4 + 0xd80) + 4; } } else { if ((((collidingEntity->_variant != 0x5a) && (collidingEntity->_variant != 0x66)) || (iVar4 != 0x1e)) || (subtype == 2)) goto LAB_006ecc76; iVar4 = __RTDynamicCast(); *(int *)(iVar4 + 0xd84) = *(int *)(iVar4 + 0xd84) + (*(int *)((int)this + 0x30) == 3) + 1; if (*(int *)((int)this + 0x30) == 4) { uVar7 = RNG::Next((RNG *)((int)this + 0x3dc)); tmpEntity = Game::Spawn(g_game,5,0x5a,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)0x0,1,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); } } goto LAB_006ecfd0; } tmpPos = (Vector *)0x0; pvVar19 = (void *)0x6e8d41; pEVar20 = collidingEntity; pickingPlayer = (Entity_Player *)__RTDynamicCast(); if (((*(int *)((int)pickingPlayer + 0x13c0) == 0x28) && (*(EntityPtr *)((int)pickingPlayer + 0x1e68) != (EntityPtr)0x0)) && (*(int *)((int)this + 0x2c) != 0x29)) { pickingPlayer = (Entity_Player *)*(EntityPtr *)((int)pickingPlayer + 0x1e68); } player = pickingPlayer; bVar3 = Entity_Player::CanPickupItem(pickingPlayer); if (bVar3 == 0) { iVar4 = *(int *)((int)this + 0x2c); if (iVar4 == 10) { if (*(int *)((int)this + 0x30) == 4) goto LAB_006e8e25; } else if (iVar4 != 0x14) { if (iVar4 == 0x28) { if ((*(int *)((int)this + 0x30) == 5) || (*(int *)((int)this + 0x30) == 3)) goto LAB_006e8e25; } else if ((iVar4 != 0x45) && (iVar4 != 0x1e)) { LAB_006e8e25: if (player->_dead == 0) { ExceptionList = local_10; return *(int *)((int)this + 0x534) != 0; } } } } if ((player->_variant != 0) && ((((player->_variant != 1 || (player->_babySkin != 0x1a)) || (*(int *)((int)this + 0x2c) == 100)) || (bVar3 = CanReroll(this), bVar3 == 0)))) goto LAB_006ed27b; uVar7 = *(uint *)((int)this + 0x2c); if (player->_isCoopGhost == 0) { if (((uVar7 == 100) && (*(int *)((int)this + 0x30) == 0x22)) && (bVar3 = Entity_Player::HasCollectible(player,0x3b,0), bVar3 != 0)) goto LAB_006ed27b; if (player->_parent != (EntityPtr)0x0) { iVar4 = *(int *)((int)this + 0x2c); if ((iVar4 == 100) || (iVar4 == 0x6e)) { bVar3 = TemporaryEffects::HasNullEffect(&player->_temporaryeffects,0x78); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasNullEffect(&player->_temporaryeffects,0x79), bVar3 != 0)) goto LAB_006ed27b; iVar4 = *(int *)((int)this + 0x2c); } if (((iVar4 == 300) || (iVar4 == 0x46)) || (iVar4 == 0x15e)) goto LAB_006ed27b; if (iVar4 == 100) { itemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig,*(int *)((int)this + 0x30)); if ((itemConfig == (ItemConfig_Item *)0x0) || (itemConfig->type == 3)) goto LAB_006ed27b; } else if ((iVar4 == 0x17c) || ((iVar4 == 0x154 || (iVar4 == 0x172)))) goto LAB_006ed27b; } } else if (uVar7 < 0x155) { if (uVar7 != 0x154) { switch(uVar7) { case 10: if (*(int *)((int)this + 0x30) != 4) goto LAB_006ed27b; break; default: goto LAB_006ed27b; case 0x14: case 0x1e: case 0x28: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3c: case 0x45: break; } } } else if (uVar7 != 0x168) goto LAB_006ed27b; if (0 < *(int *)((int)this + 0x544)) goto LAB_006ed27b; if (player->_variant == 1) { tmpPos = (Vector *)((int)this + 0x33c); pEVar20 = (Entity_Familiar *)0x6e8f55; player = Game::GetNearestPlayerEx(tmpPos,1,0,0); pickingPlayer = player; if ((EntityPtr)player == (EntityPtr)0x0) { player = Game::GetPlayer(g_game,0); pickingPlayer = player; } } pvVar9 = *(void **)((int)player + 0x1780); if ((int)pvVar9 - (int)((std_vector *)((int)player + 0x177c))->_begin >> 4 < 0x17) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar9 = *(void **)((int)player + 0x1780); } pvVar2 = ((std_vector *)((int)player + 0x177c))->_begin; uVar7 = ((int)pvVar9 - (int)pvVar2 >> 4) - 1; if (0x16 < uVar7) { uVar7 = 0x16; } local_b4 = (EntityPtr)(uVar7 * 0x10 + (int)pvVar2); if (*(int *)((int)this + 0x534) != 0) { bVar3 = Entity_Player::IsHoldingItem(player); if (bVar3 != 0) { ExceptionList = local_10; return 1; } isAllowed = can_player_buy(this); if (isAllowed == '\0') { ExceptionList = local_10; return 1; } } EVar10 = (EntityPtr)pickup; iVar4 = *(int *)((int)this + 0x2c); local_11c.y = 0.0; if (iVar4 == 10) { iVar4 = *(int *)((int)player + 0x1d98); local_fc = (Room *)((int)player + 0x1da8); local_d8 = *(EntityPtr *)((int)player + 0x1344); if (iVar4 == 0) { local_ac.y = (float)(*(int *)((int)player + 0x134c) + *(int *)local_fc); } else { local_ac.y = (float)(*(int *)(iVar4 + 0x1da8) + *(int *)(iVar4 + 0x134c) + *(int *)((int)player + 0x134c) + *(int *)((int)player + 0x1da8)); local_d8 = (EntityPtr)((int)local_d8 + *(int *)(iVar4 + 0x1344)); } local_b4 = (EntityPtr)((int)player + 0x1da8); local_100 = (Room *)((int)player + 0x134c); local_110.y = 0.0; local_ec.y = (float)local_100; isAppleOfSodom = Entity_Player::HasTrinket(player,0x8c,0); local_9c.y = (float)Entity_Player::GetTrinketMultiplier(player,0x8c); iVar4 = ((Entity_Pickup *)EVar10)->_subtype; spiderCount = 0; if ((((iVar4 == 1) || (iVar4 == 2)) || (iVar4 == 5)) || (iVar4 == 9)) { local_a4 = (Room *)0x0; switch(iVar4) { case 1: case 9: local_a4 = (Room *)0x2; spiderCount = 3; break; case 2: local_a4 = (Room *)0x1; spiderCount = 1; break; case 5: local_a4 = (Room *)&DAT_00000004; spiderCount = 6; } local_91 = Entity_Player::HasCollectible(player,0x138,0); if (local_91 != 0) { local_a4 = (Room *)((int)local_a4 * 2); spiderCount = spiderCount * 2; } if (isAppleOfSodom == 0) { LAB_006e9b2d: if ((*(int *)((int)player + 0x13c0) == 0x24) && (isAllowed = Entity_Player::CanPickRedHearts(player), isAllowed != '\0')) { bloodChargeSpace = 99 - *(int *)((int)player + 0x1dac); pRVar11 = local_a4; if (bloodChargeSpace < (int)local_a4) { pRVar11 = (Room *)bloodChargeSpace; } Entity_Player::AddHearts(player,(int)pRVar11,0,0); local_a4 = (Room *)((int)local_a4 - (int)pRVar11); isPickedUp = '\x01'; EVar10 = (EntityPtr)pickup; } local_d0.y = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { if ((int)local_a4 < 1) break; local_e0.y = (float)Game::GetPlayer(g_game,(uint)local_d0.y); if ((*(byte *)((int)local_e0.y + 0x173) == 0) && (isAllowed = Entity_Player::CanPickRedHearts((Entity_Player *)local_e0.y), isAllowed != '\0')) { if ((Entity_Player *)local_e0.y == player) { local_f0 = local_a4; if (((*(int *)((int)local_e0.y + 0x2c) != 0) || (*(int *)((int)local_e0.y + 0x13c0) != 0x11)) || (*(Entity_Player **)((int)local_e0.y + 0x1d98) == (Entity_Player *)0x0)) goto LAB_006e9c07; iVar4 = Entity_Player::GetHealthType (*(Entity_Player **)((int)local_e0.y + 0x1d98)); if ((iVar4 == 1) || (iVar4 == 2)) { iVar4 = *(int *)(extraout_ECX + 0x1340); iVar21 = extraout_ECX; } else { iVar4 = *(int *)(extraout_EDX_00->_subPlayer + 0x1340) + *(int *)(extraout_ECX + 0x1d88) * 2; iVar21 = extraout_EDX_00->_subPlayer; } pRVar11 = (Room *)(iVar4 - *(int *)(iVar21 + 0x1344)); otherPlayer = extraout_EDX_00; if ((int)pRVar11 < (int)local_a4) { local_f0 = pRVar11; } } else { if (*(int *)((int)local_e0.y + 0x2c) != 1) goto LAB_006e9da9; LAB_006e9c07: local_f0 = local_a4; iVar4 = Entity_Player::GetHealthType((Entity_Player *)local_e0.y); if ((iVar4 == 1) || (iVar4 == 2)) { iVar4 = extraout_EDX->_maxHearts; } else { iVar4 = extraout_EDX->_maxHearts + extraout_EDX->_boneHearts * 2; } pRVar11 = (Room *)(iVar4 - extraout_EDX->_redHearts); if ((int)pRVar11 < (int)local_a4) { local_f0 = pRVar11; } otherPlayer = extraout_EDX; } if (g_game->_challenge == 0x20) { uVar7 = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; if (uVar7 == 0) { pcVar1 = (code *)swi(3); bVar3 = (*pcVar1)(); return bVar3; } } uVar7 = uVar7 >> ((byte)(((Entity_Pickup *)EVar10)->_dropRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(((Entity_Pickup *)EVar10)->_dropRNG)._shift2 & 0x1f) ^ uVar7; local_bc.y = (float)(uVar7 >> ((byte)(((Entity_Pickup *)EVar10)->_dropRNG)._shift3 & 0x1f)); uVar7 = (uint)local_bc.y ^ uVar7; (((Entity_Pickup *)EVar10)->_dropRNG)._seed = uVar7; iVar4 = (int)local_f0 / 2; uVar7 = uVar7 & 3; if (uVar7 == 0) { Entity_Player::AddKeys((Entity_Player *)local_e0.y,iVar4); } else if (uVar7 == 1) { Entity_Player::AddBombs((Entity_Player *)local_e0.y,iVar4); } else { Entity_Player::AddCoins((Entity_Player *)local_e0.y,iVar4); } } else { Entity_Player::AddHearts(otherPlayer,(int)local_f0,1,0); } Entity_Player::AddImmaculateConceptionCounter(); local_a4 = (Room *)((int)local_a4 - (int)local_f0); isPickedUp = '\x01'; } LAB_006e9da9: local_d0.y = (float)((int)local_d0.y + 1); } while ((uint)local_d0.y < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218), (EntityList_EL *)(local_2c._buf + 8),3,0xce,0x128,0,0); local_8 = 0; uVar7 = 0; if (local_2c._capacity != 0) { do { iVar4 = *(int *)(local_2c._buf._12_4_ + uVar7 * 4); if ((*(char *)(iVar4 + 0x172) != '\0') && (*(EntityPtr *)(iVar4 + 0x410) == (EntityPtr)player)) { fVar16 = *(float *)(iVar4 + 0x380); if (fVar16 < *(float *)(iVar4 + 900)) { fVar15 = *(float *)(iVar4 + 900) - fVar16; isPickedUp = '\x01'; pRVar11 = (Room *)(int)(fVar15 + fVar15); if ((int)local_a4 < (int)pRVar11) { pRVar11 = local_a4; } local_a4 = (Room *)((int)local_a4 - (int)pRVar11); *(float *)(iVar4 + 0x380) = (float)(int)pRVar11 * 0.5 + fVar16; } } uVar7 = uVar7 + 1; } while (uVar7 < local_2c._capacity); } pRVar11 = local_a4; if (local_91 != 0) { pRVar11 = (Room *)((int)local_a4 / 2); } if (((0 < (int)pRVar11) && (((ActiveItemDesc *)((int)player + 0x1580))->_item == 0x122)) && (*(int *)((int)player + 0x1354) < 8)) { Entity_Player::AddJarHearts(player,(int)pRVar11); isPickedUp = '\x01'; } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(local_2c._buf + 8); goto LAB_006e9ed6; } local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 != 0) goto LAB_006e9b2d; LAB_006e9f41: manager = g_manager; if ((*(int *)((int)EVar10 + 0x2c) == 10) || (this = (Entity_Pickup *)EVar10, 1 < (int)local_9c.y)) { local_9c.y = 4.2039e-44; seed_fart_sound_override((int *)&local_9c.y); SoundEffects::Play(&manager->_sfxManager,(int)local_9c.y,1.0,2,0,1.0,0.0); uVar7 = Random(); this = pickup; local_d0.y = (float)&pickup->_pos; tmpEntity = Game::Spawn(g_game,1000,2,(Vector *)local_d0.y,&g_vectorZero,(Entity *)0x0,3, uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,7,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar7 = Random(); local_ac.y = (float)(uVar7 % 3 + spiderCount); if (0 < (int)local_ac.y) { do { uVar7 = Random(); fVar16 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9c.y = fVar16 + fVar16; fVar16 = cos(local_9c.y); local_ec.x = fVar16 * 0.5 * this->_size + (this->_pos).x; fVar16 = sin(local_9c.y); local_ec.y = fVar16 * 0.5 * this->_size + (this->_pos).y; uVar7 = Random(); fVar16 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9c.y = fVar16 + fVar16; uVar7 = Random(); local_bc.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0; fVar16 = cos(local_9c.y); local_e0.x = fVar16 * local_bc.y; fVar16 = sin(local_9c.y); local_e0.y = fVar16 * local_bc.y; uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,5,&local_ec,&local_e0,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); local_ac.y = (float)((int)local_ac.y + -1); } while ((EntityPtr)local_ac.y != (EntityPtr)0x0); local_ac.y = 0.0; player = pickingPlayer; } uVar7 = Random(); fVar16 = local_d0.y; spiderCount = spiderCount + uVar7 % 3; if (0 < spiderCount) { do { *(int *)((int)player + 0x1370) = *(int *)((int)player + 0x1370) + 1; spawn_blue_spider((Vector *)fVar16,(Entity *)player,&g_vectorZero); spiderCount = spiderCount + -1; } while (spiderCount != 0); spiderCount = 0; this = pickup; } Game::ButterBeanFart(g_game,(Vector *)((int)this + 0x33c),100.0,(Entity *)player,1,0); (**(code **)(*(int *)this + 0x28))(); } LAB_006ec9a8: bVar3 = CanReroll(this); if ((bVar3 == 0) || (*(int *)((int)this + 0x2c) == 100)) goto LAB_006ebf8c; if (*(char *)((int)this + 400) != '\0') { *(float *)((int)this + 0x360) = *(float *)((int)this + 0x1a0) * 0.1 + *(float *)((int)this + 0x360); *(float *)((int)this + 0x364) = -*(float *)((int)this + 0x19c) * 0.1 + *(float *)((int)this + 0x364); } } else { if (iVar4 == 3) { spiderCount = 4; } else { if (iVar4 != 8) { if (iVar4 == 4) { spiderCount = 6; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } iVar4 = Entity_Player::GetHeartLimit(player,0); if (((*(int *)((int)player + 0x1340) < iVar4) || (*(int *)((int)player + 0x1348) == 0) ) && (iVar4 = Entity_Player::GetHealthType(player), iVar4 != 3)) { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt(&((Entity_Pickup *)EVar10)->_dropRNG,4); if (uVar7 == 0) { Entity_Player::AddKeys(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else if (uVar7 == 1) { Entity_Player::AddBombs(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else { Entity_Player::AddCoins(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } else { Entity_Player::AddEternalHearts(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } } else if (iVar4 == 6) { spiderCount = 5; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } isAllowed = Entity_Player::CanPickBlackHearts(player); if (isAllowed != '\0') { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt(&((Entity_Pickup *)EVar10)->_dropRNG,4); if (uVar7 == 0) { Entity_Player::AddKeys(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else if (uVar7 == 1) { Entity_Player::AddBombs(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else { Entity_Player::AddCoins(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } else { local_110.y = 2.8026e-45; Entity_Player::AddBlackHearts(player,2); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } } else if (iVar4 == 7) { spiderCount = 4; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } isAllowed = Entity_Player::CanPickGoldenHearts(player); if (isAllowed != '\0') { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt(&((Entity_Pickup *)EVar10)->_dropRNG,4); if (uVar7 == 0) { Entity_Player::AddGoldenKey(); isPickedUp = '\x01'; } else if (uVar7 == 1) { if (((g_manager->_persistentGameData)._achievements[0xe2] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) goto LAB_006e93d4; Entity_Player::AddGoldenBomb(); isPickedUp = '\x01'; } else if (uVar7 == 2) { LAB_006e93d4: Entity_Player::AddCoins(player,10); isPickedUp = '\x01'; } else { isPickedUp = '\x01'; } } else { Entity_Player::AddGoldenHearts(player,1,0); isPickedUp = '\x01'; } } } else if (iVar4 == 10) { spiderCount = 4; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt(&((Entity_Pickup *)EVar10)->_dropRNG,4); if (uVar7 == 0) { Entity_Player::AddKeys(player,1); } else if (uVar7 == 1) { Entity_Player::AddBombs(player,1); } else { Entity_Player::AddCoins(player,1); } manager = g_manager; isPickedUp = '\x01'; local_d0.y = 2.5924e-43; seed_fart_sound_override((int *)&local_d0.y); SoundEffects::Play(&manager->_sfxManager,(int)local_d0.y,1.0,2,0,1.0,0.0); } else { EVar10 = (EntityPtr)0x2; isAddedRedHearts = false; isAddedSoulHearts = '\0'; local_91 = Entity_Player::HasCollectible(player,0x138,0); do { local_bc.y = (float)local_100; local_a4 = (Room *)local_ec.y; local_f0 = local_fc; local_e0.y = (float)local_b4; local_d0.y = (float)local_d8; isAllowed = Entity_Player::CanPickRedHearts(player); if (isAllowed == '\0') { local_100 = (Room *)local_bc.y; local_ec.y = (float)local_a4; local_fc = local_f0; local_b4 = (EntityPtr)local_e0.y; local_d8 = (EntityPtr)local_d0.y; bVar3 = Entity_Player::CanPickSoulHearts(player); if (bVar3 == 0) { if (1 < (uint)EVar10) goto LAB_006e9ed6; } else { local_110.y = (float)EVar10; Entity_Player::AddSoulHearts(player,(int)EVar10,0); local_d8 = (EntityPtr)local_d0.y; local_b4 = (EntityPtr)local_e0.y; local_fc = local_f0; local_ec.y = (float)local_a4; local_100 = (Room *)local_bc.y; isAddedSoulHearts = '\x01'; } if (isAddedRedHearts == false) goto LAB_006e96a6; break; } Entity_Player::AddHearts(player,(local_91 != 0) + 1,1,0); EVar10 = (EntityPtr)((int)EVar10 + -1); isAddedRedHearts = true; } while (0 < (int)EVar10); manager = g_manager; local_bc.y = 2.5924e-43; seed_fart_sound_override((int *)&local_bc.y); SoundEffects::Play(&manager->_sfxManager,(int)local_bc.y,1.0,2,0,1.0,0.0); Entity_Player::AddImmaculateConceptionCounter(); LAB_006e96a6: manager = g_manager; isPickedUp = '\x01'; if (isAddedSoulHearts != '\0') { local_bc.y = 7.56701e-44; seed_fart_sound_override((int *)&local_bc.y); SoundEffects::Play(&manager->_sfxManager,(int)local_bc.y,1.0,2,0,1.0,0.0); isPickedUp = '\x01'; } } } else if (iVar4 == 0xb) { spiderCount = 3; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } isAllowed = Entity_Player::CanPickBoneHearts(player); if (isAllowed != '\0') { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt(&((Entity_Pickup *)EVar10)->_dropRNG,4); if (uVar7 == 0) { Entity_Player::AddKeys(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else if (uVar7 == 1) { Entity_Player::AddBombs(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else { Entity_Player::AddCoins(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } else { Entity_Player::AddBoneHearts(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } } else if (iVar4 == 0xc) { if ((*(int *)((int)player + 0x13c0) == 0x24) && (isAllowed = Entity_Player::CanPickRedHearts(player), isAllowed != '\0')) { iVar21 = 99 - *(int *)((int)player + 0x1dac); iVar4 = 1; if (iVar21 < 1) { iVar4 = iVar21; } Entity_Player::AddHearts(player,iVar4,0,0); isPickedUp = '\x01'; } else { spiderCount = 3; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = (((Entity_Pickup *)EVar10)->_dropRNG)._seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } isAllowed = Entity_Player::CanPickRottenHearts(player); if (isAllowed != '\0') { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt(&((Entity_Pickup *)EVar10)->_dropRNG,4); if (uVar7 == 0) { Entity_Player::AddKeys(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else if (uVar7 == 1) { Entity_Player::AddBombs(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else { Entity_Player::AddCoins(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } else { Entity_Player::AddRottenHearts(player,2,0); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } } } goto LAB_006e9ed6; } spiderCount = 2; } local_bc.y = (float)&((Entity_Pickup *)EVar10)->_dropRNG; if (1 < (int)local_9c.y) { local_2c._buf._8_4_ = ((RNG *)local_bc.y)->_seed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_2c._capacity = 0x1f; uVar7 = RNG::RandomInt((RNG *)(local_2c._buf + 8),2); if (uVar7 == 0) goto LAB_006e9ed6; } bVar3 = Entity_Player::CanPickSoulHearts(player); if (bVar3 != 0) { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt((RNG *)local_bc.y,4); if (uVar7 == 0) { Entity_Player::AddKeys(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else if (uVar7 == 1) { Entity_Player::AddBombs(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } else { Entity_Player::AddCoins(player,1); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } else { local_110.y = (float)((((Entity_Pickup *)EVar10)->_subtype == 3) + 1); Entity_Player::AddSoulHearts(player,(int)local_110.y,0); Entity_Player::AddImmaculateConceptionCounter(); isPickedUp = '\x01'; } } LAB_006e9ed6: if (isAppleOfSodom == 0) { if (isPickedUp == '\0') { this = pickup; goto LAB_006ec9a8; } } else if (isPickedUp == '\0') { EVar10 = (EntityPtr)pickup; goto LAB_006e9f41; } g_game->field_0x10 = 1; iVar4 = *(int *)((int)player + 0x1d98); local_e0.y = *(float *)((int)player + 0x1344); if (iVar4 == 0) { pRVar11 = (Room *)(*(int *)local_ec.y + *(uint *)local_b4); } else { pRVar11 = (Room *)(*(int *)(iVar4 + 0x1da8) + *(int *)(iVar4 + 0x134c) + *(int *)local_fc + *(int *)local_100); local_e0.y = (float)((int)local_e0.y + *(int *)(iVar4 + 0x1344)); player = pickingPlayer; } local_ec.y = (float)pRVar11; iVar4 = Entity_Player::GetHealthType(player); if (iVar4 == 2) { pRVar11 = (Room *)((int)local_ac.y + extraout_EDX_01); local_ec.y = (float)pRVar11; } bVar3 = Entity_Player::HasCollectible(player,0x29f,0); if ((bVar3 != 0) && ((int)local_d8 < (int)local_e0.y)) { local_e0.y = (float)((int)local_e0.y - (int)local_d8); if (0 < (int)local_e0.y) { do { pvVar19 = ((std_vector *)((int)player + 6000))->_begin; puVar12 = (uint *)((int)pvVar19 + 0x29f0); uVar7 = *puVar12; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar12; if (uVar7 == 0) { pcVar1 = (code *)swi(3); bVar3 = (*pcVar1)(); return bVar3; } } uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar19 + 0x29f4) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)((int)pvVar19 + 0x29f8) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar19 + 0x29fc) & 0x1f) ^ uVar7; *puVar12 = uVar7; uVar7 = uVar7 % 6; *(int *)((int)player + 0x1574) = *(int *)((int)player + 0x1574) | *(uint *)(&DAT_00b6bab0 + uVar7 * 4); *(short *)((undefined1 *)((int)player + 0x1db0) + uVar7 * 2) = *(short *)((undefined1 *)((int)player + 0x1db0) + uVar7 * 2) + 1; local_e0.y = (float)((int)local_e0.y + -1); } while ((EntityPtr)local_e0.y != (EntityPtr)0x0); Entity_Player::EvaluateItems(); pRVar11 = (Room *)local_ec.y; } } bVar3 = Entity_Player::HasCollectible(player,0x2ae,0); if (((bVar3 != 0) && ((int)local_ac.y < (int)pRVar11)) && (local_ec.y = (float)((int)pRVar11 - (int)local_ac.y), 0 < (int)local_ec.y)) { do { pvVar19 = ((std_vector *)((int)player + 6000))->_begin; puVar12 = (uint *)((int)pvVar19 + 0x2ae0); uVar7 = *puVar12; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar12; if (uVar7 == 0) { pcVar1 = (code *)swi(3); bVar3 = (*pcVar1)(); return bVar3; } } uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar19 + 0x2ae4) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)((int)pvVar19 + 0x2ae8) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar19 + 0x2aec) & 0x1f) ^ uVar7; *puVar12 = uVar7; uVar7 = uVar7 % 6; *(int *)((int)player + 0x1574) = *(int *)((int)player + 0x1574) | *(uint *)(&DAT_00b6bab0 + uVar7 * 4); *(short *)((undefined1 *)((int)player + 0x1dbc) + uVar7 * 2) = *(short *)((undefined1 *)((int)player + 0x1dbc) + uVar7 * 2) + 1; local_ec.y = (float)&((Room *)((int)local_ec.y + -0x7898))->field_0x7897; } while ((undefined1 *)local_ec.y != (undefined1 *)0x0); Entity_Player::EvaluateItems(); } Player_stats_add(&g_game->_onlinePlayerStats,7,player,1.0); playerManager = &g_game->_playerManager; local_9c.y = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { local_d0.y = (float)PlayerManager::GetPlayer(playerManager,(int)local_9c.y); if (((Entity_Player *)local_d0.y != player) && ((EntityPtr)local_d0.y != *(EntityPtr *)((int)player + 0x1e68))) { isAllowed = Entity_Player::CanPickRedHearts((Entity_Player *)local_d0.y); this = pickup; if (((((isAllowed != '\0') && (((iVar4 = pickup->_subtype, iVar4 == 1 || (iVar4 == 2)) || ((iVar4 == 5 || (iVar4 == 9)))))) || ((bVar3 = Entity_Player::CanPickSoulHearts((Entity_Player *)local_d0.y), bVar3 != 0 && (((iVar4 = this->_subtype, iVar4 == 3 || (iVar4 == 8)) || (iVar4 == 10)))))) || ((isAllowed = Entity_Player::CanPickBlackHearts((Entity_Player *)local_d0.y), isAllowed != '\0' && (this->_subtype == 6)))) && ((int)(*(int *)((int)local_d0.y + 0x134c) + *(int *)((int)local_d0.y + 0x1344) + 3U ) < (int)local_d8 + (int)local_ac.y)) { Player_stats_add(&g_game->_onlinePlayerStats,0x12,player,1.0); goto LAB_006ea527; } } playerManager = &g_game->_playerManager; local_9c.y = (float)((int)local_9c.y + 1); } while ((uint)local_9c.y < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } this = pickup; LAB_006ea527: if (isPickedUp == '\0') goto LAB_006ec9a8; } } else { if (iVar4 == 0x14) { local_ac.y = (float)GetCoinValue(this); if (g_game->_challenge == 0x20) { if ((int)local_ac.y < 6) { local_d8 = (EntityPtr)local_ac.y; if (1 < (int)local_ac.y) { local_d8 = (EntityPtr)0x2; } } else { local_d8 = (EntityPtr)0x3; } local_9c.y = RNG::RandomFloat((RNG *)((int)this + 0x3dc)); if (0.12 <= local_9c.y) { if (0.24 <= local_9c.y) { if (0.36 <= local_9c.y) { if (0.42 <= local_9c.y) { if (0.48 <= local_9c.y) { if (0.5 <= local_9c.y) { if (0.75 <= local_9c.y) { Game::ButterBeanFart (g_game,(Vector *)((int)this + 0x33c),120.0,(Entity *)player,1,0); } else { Entity_Player::AddBlueFlies (player,(int)local_d8,(Vector *)((int)this + 0x33c),(Entity *)0x0) ; } } else if (((g_manager->_persistentGameData)._achievements[0xe0] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { Entity_Player::AddHearts(player,(int)local_d8,1,0); } else { Entity_Player::AddGoldenHearts(player,1,0); } } else { Entity_Player::AddBlackHearts(player,(int)local_d8); } } else { Entity_Player::AddSoulHearts(player,(int)local_d8,0); } } else { Entity_Player::AddHearts(player,(int)local_d8,1,0); } } else { Entity_Player::AddKeys(player,(int)local_d8); } } else { Entity_Player::AddBombs(player,(int)local_d8); } } else { Entity_Player::AddCoins(player,(int)local_ac.y); Player_stats_add(&g_game->_onlinePlayerStats,1,player,(float)(int)local_ac.y); iVar4 = Entity_Player::GetHealthType(player); if (iVar4 == 3) { Player_stats_add(&g_game->_onlinePlayerStats,7,player,1.0); } } pvVar19 = *(void **)((int)player + 0x1780); if ((int)((int)pvVar19 - (int)((std_vector *)((int)player + 0x177c))->_begin & 0xfffffff0U) < 0x321) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar19 = *(void **)((int)player + 0x1780); } pvVar9 = ((std_vector *)((int)player + 0x177c))->_begin; iVar4 = (int)pvVar19 - (int)pvVar9 >> 4; uVar7 = iVar4 - 1; if (0x32 < uVar7) { uVar7 = 0x32; } local_9c.y = (float)(uVar7 * 0x10 + (int)pvVar9); if (iVar4 < 0x34) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar19 = *(void **)((int)player + 0x1780); } pvVar9 = ((std_vector *)((int)player + 0x177c))->_begin; uVar7 = ((int)pvVar19 - (int)pvVar9 >> 4) - 1; if (0x33 < uVar7) { uVar7 = 0x33; } EVar10 = (EntityPtr)(uVar7 * 0x10 + (int)pvVar9); local_e0.y = (float)EVar10; local_ec.y = (float)Entity_Player::GetTrinketRNG(player,0x31); local_100 = (Room *)Entity_Player::GetTrinketRNG(player,0x34); local_f0 = (Room *)Entity_Player::GetTrinketRNG(player,0x18); local_110.y = (float)Entity_Player::GetTrinketRNG(player,0x83); local_d8 = (EntityPtr)Entity_Player::GetTrinketRNG(player,0x93); local_d0.y = pow(0.75,(float)(int)local_ac.y); local_fc = (Room *)pow(0.5,(float)(int)local_ac.y); bVar3 = Entity_Player::HasTrinket(player,0x32,0); if (bVar3 != 0) { iVar4 = Entity_Player::GetTrinketMultiplier(player,0x32); local_bc.y = local_d0.y - (float)(iVar4 + -1) * 0.25; local_9c.y = RNG::RandomFloat((RNG *)local_9c.y); if (local_bc.y <= local_9c.y) { uVar7 = Random(); local_9c.x = (pickingPlayer->_pos).x; local_9c.y = (pickingPlayer->_pos).y; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_bc,&local_9c,40.0,0,0,0) ; Game::Spawn(g_game,5,0x28,tmpPos,&g_vectorZero,(Entity *)0x0,1,uVar7); EVar10 = (EntityPtr)local_e0.y; player = pickingPlayer; } } bVar3 = Entity_Player::HasTrinket(player,0x33,0); if (bVar3 != 0) { iVar4 = Entity_Player::GetTrinketMultiplier(player,0x33); local_bc.y = local_d0.y - (float)(iVar4 + -1) * 0.25; local_9c.y = RNG::RandomFloat((RNG *)EVar10); if (local_bc.y <= local_9c.y) { uVar7 = Random(); local_9c.x = (pickingPlayer->_pos).x; local_9c.y = (pickingPlayer->_pos).y; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_bc,&local_9c,40.0,0,0,0) ; Game::Spawn(g_game,5,0x1e,tmpPos,&g_vectorZero,(Entity *)0x0,1,uVar7); player = pickingPlayer; } } bVar3 = Entity_Player::HasTrinket(player,0x31,0); if (bVar3 != 0) { iVar4 = Entity_Player::GetTrinketMultiplier(player,0x31); local_bc.y = local_d0.y - (float)(iVar4 + -1) * 0.25; local_9c.y = RNG::RandomFloat((RNG *)local_ec.y); if (local_bc.y <= local_9c.y) { bVar3 = Entity_Player::HasTrinket(player,0x16,0); if (bVar3 != 0) { uVar7 = RNG::RandomInt((RNG *)local_b4,5); if (uVar7 != 0) goto LAB_006eab20; } uVar7 = Random(); local_9c.x = (pickingPlayer->_pos).x; local_9c.y = (pickingPlayer->_pos).y; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_bc,&local_9c,40.0,0,0,0) ; Game::Spawn(g_game,5,10,tmpPos,&g_vectorZero,(Entity *)0x0,2,uVar7); player = pickingPlayer; } } LAB_006eab20: bVar3 = Entity_Player::HasTrinket(player,0x34,0); if ((bVar3 != 0) && (local_9c.y = RNG::RandomFloat((RNG *)local_100), (float)local_fc <= local_9c.y)) { iVar4 = Entity_Player::GetTrinketMultiplier(player,0x34); Entity_Player::AddCoins(player,iVar4); } bVar3 = Entity_Player::HasTrinket(player,0x83,0); if (bVar3 != 0) { local_b4 = (EntityPtr)0x3e2e147b; iVar4 = Entity_Player::GetTrinketMultiplier(player,0x83); if (iVar4 == 2) { EVar10 = (EntityPtr)0x3e800000; EVar13 = (EntityPtr)0x3ecccccd; EVar17 = (EntityPtr)0x3f333333; EVar18 = (EntityPtr)0x3f666666; local_b4 = (EntityPtr)0x3e800000; } else if (iVar4 == 3) { EVar10 = (EntityPtr)0x3e99999a; EVar13 = (EntityPtr)0x3f000000; EVar17 = (EntityPtr)0x3f400000; EVar18 = (EntityPtr)0x3f800000; local_b4 = (EntityPtr)0x3e99999a; } else { EVar10 = (EntityPtr)0x3e2e147b; EVar13 = (EntityPtr)0x3e99999a; EVar17 = (EntityPtr)0x3f19999a; EVar18 = (EntityPtr)0x3f547ae1; } switch(local_ac.y) { case 1.4013e-45: break; case 2.8026e-45: local_b4 = EVar13; break; default: local_b4 = EVar10; break; case 7.00649e-45: local_b4 = EVar17; break; case 1.4013e-44: local_b4 = EVar18; } local_9c.y = RNG::RandomFloat((RNG *)local_110.y); if (local_9c.y <= (float)local_b4) { uVar7 = Random(); local_9c.x = (pickingPlayer->_pos).x; local_9c.y = (pickingPlayer->_pos).y; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_bc,&local_9c,40.0,0,0,0) ; Game::Spawn(g_game,5,10,tmpPos,&g_vectorZero,(Entity *)0x0,8,uVar7); player = pickingPlayer; } } bVar3 = Entity_Player::HasTrinket(player,0x93,0); if ((bVar3 != 0) && (local_9c.y = RNG::RandomFloat((RNG *)local_d8), local_d0.y <= local_9c.y)) { local_ac.y = 1.4013e-45; iVar4 = Entity_Player::GetTrinketMultiplier(player,0x93); if (iVar4 == 2) { EVar10 = (EntityPtr)0x2; local_ac.y = 2.8026e-45; } else if (iVar4 == 3) { EVar10 = (EntityPtr)0x3; local_ac.y = 4.2039e-45; } else { EVar10 = (EntityPtr)0x1; } uVar7 = 0; do { iVar4 = Entity_Player::AddActiveCharge(player,(int)EVar10,uVar7,0,0,0); if (iVar4 != 0) break; uVar7 = uVar7 + 1; EVar10 = (EntityPtr)local_ac.y; } while (uVar7 < 4); } bVar3 = Entity_Player::HasTrinket(player,0xac,0); if ((bVar3 != 0) && (bVar3 = Entity_Player::HasCollectible(player,0x104,0), bVar3 == 0)) { *(int *)((int)player + 0x13b8) = pickup->_subtype; } this = pickup; bVar3 = Entity_Player::HasTrinket(player,0x18,0); if (bVar3 != 0) { Color::Color((Color *)local_88); Game::Fart(g_game,&this->_pos,85.0,(Entity *)player,1.0,0,color); local_9c.y = *(float *)((int)player + 0x340); local_9c.x = *(float *)((int)player + 0x33c); Game::ButterBeanFart(g_game,&local_9c,120.0,(Entity *)player,0,0); uVar7 = RNG::RandomInt((RNG *)local_f0,2); if ((uVar7 == 0) && (bVar3 = Entity_Player::HasCollectible(player,0x240,0), bVar3 != 0)) { local_9c.y = *(float *)((int)player + 0x340); local_9c.x = *(float *)((int)player + 0x33c); Room::FindFreePickupSpawnPosition(g_game->_room,&local_ac,&local_9c,40.0,0,0,0); local_bc.x = *(float *)((int)player + 0x33c); local_bc.y = *(float *)((int)player + 0x340); Entity_Player::ThrowFriendlyDip(); } } bVar3 = Entity_Player::HasTrinket(player,0x7e,0); if (bVar3 != 0) { local_ac.y = 1.4013e-45; iVar4 = Entity_Player::GetTrinketMultiplier(player,0x7e); if (iVar4 == 2) { local_ac.y = 2.8026e-45; } else if (iVar4 == 3) { local_ac.y = 4.2039e-45; } local_d0.x = *(float *)((int)player + 0x33c); local_d0.y = *(float *)((int)player + 0x340); Entity_Player::AddBlueFlies(player,(int)local_ac.y,&local_d0,(Entity *)0x0); } if (this->_subtype == 5) { Entity_Player::DonateLuck(player,1); string_table_translate(&g_manager->_stringTable,(byte *)"#LUCKY_PENNY_DESCRIPTION"); string_table_translate(&g_manager->_stringTable,(byte *)"#LUCKY_PENNY_NAME"); PlayerHUD::show_pill_name(); player = pickingPlayer; Entity_Player::AnimateHappy(pickingPlayer); this = pickup; } LAB_006eafa4: isPickedUp = '\x01'; goto LAB_006ebf92; } if (iVar4 == 0x1e) { iVar4 = *(int *)((int)this + 0x30); if (iVar4 != 1) { if (iVar4 != 3) { if (iVar4 == 2) { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt((RNG *)((int)this + 0x3dc),3); if (uVar7 == 0) { LAB_006eb304: Entity_Player::AddEternalHearts(player,1); isPickedUp = '\x01'; } else { if (uVar7 != 1) { if (uVar7 == 2) goto LAB_006eb15c; goto LAB_006eafa4; } Entity_Player::AddGoldenBomb(); isPickedUp = '\x01'; } } else { Entity_Player::AddGoldenKey(); isPickedUp = '\x01'; } } else { if (iVar4 != 4) goto LAB_006ec9a8; Entity_Player::AddKeys(player,1); uVar7 = 0; do { iVar4 = Entity_Player::AddActiveCharge(player,6,uVar7,1,0,0); if (iVar4 != 0) break; uVar7 = uVar7 + 1; } while (uVar7 < 4); isPickedUp = '\x01'; this = pickup; } goto LAB_006ebf92; } if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt((RNG *)((int)this + 0x3dc),6); switch(uVar7) { case 0: Entity_Player::AddBombs(player,2); isPickedUp = '\x01'; break; case 1: goto LAB_006eb10f; case 2: LAB_006eb0af: Entity_Player::AddHearts(player,2,1,0); isPickedUp = '\x01'; break; case 3: LAB_006eb0c9: Entity_Player::AddSoulHearts(player,2,0); isPickedUp = '\x01'; break; case 4: LAB_006eb0e1: Entity_Player::AddBlackHearts(player,2); isPickedUp = '\x01'; break; case 5: Entity_Player::AddGoldenHearts(player,2,0); isPickedUp = '\x01'; break; default: goto LAB_006eafa4; } } else { LAB_006eb10f: Entity_Player::AddKeys(player,2); isPickedUp = '\x01'; } goto LAB_006ebf92; } if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt((RNG *)((int)this + 0x3dc),6); switch(uVar7) { case 0: Entity_Player::AddBombs(player,1); isPickedUp = '\x01'; break; case 1: goto LAB_006eb04b; case 2: LAB_006eb003: Entity_Player::AddHearts(player,1,1,0); isPickedUp = '\x01'; break; case 3: LAB_006eb01d: Entity_Player::AddSoulHearts(player,1,0); isPickedUp = '\x01'; break; case 4: LAB_006eb035: Entity_Player::AddBlackHearts(player,1); isPickedUp = '\x01'; break; case 5: LAB_006eb15c: Entity_Player::AddGoldenHearts(player,1,0); isPickedUp = '\x01'; break; default: goto LAB_006eafa4; } } else { LAB_006eb04b: Entity_Player::AddKeys(player,1); isPickedUp = '\x01'; } goto LAB_006ebf92; } if (iVar4 == 0x28) { iVar4 = *(int *)((int)this + 0x30); if (iVar4 == 1) { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt((RNG *)((int)this + 0x3dc),5); switch(uVar7) { case 0: Entity_Player::AddCoins(player,1); isPickedUp = '\x01'; break; case 1: Entity_Player::AddKeys(player,1); isPickedUp = '\x01'; break; case 2: goto LAB_006eb003; case 3: goto LAB_006eb01d; case 4: goto LAB_006eb035; default: goto LAB_006eafa4; } } else { Entity_Player::AddBombs(player,1); isPickedUp = '\x01'; } } else if (iVar4 == 2) { if (g_game->_challenge == 0x20) { uVar7 = RNG::RandomInt((RNG *)((int)this + 0x3dc),5); switch(uVar7) { case 0: Entity_Player::AddCoins(player,2); isPickedUp = '\x01'; break; case 1: Entity_Player::AddKeys(player,2); isPickedUp = '\x01'; break; case 2: goto LAB_006eb0af; case 3: goto LAB_006eb0c9; case 4: goto LAB_006eb0e1; default: goto LAB_006eafa4; } } else { Entity_Player::AddBombs(player,2); isPickedUp = '\x01'; } } else if (iVar4 == 4) { if (g_game->_challenge == 0x20) { LAB_006eb2e0: uVar7 = RNG::RandomInt((RNG *)((int)this + 0x3dc),3); if (uVar7 != 0) { if (uVar7 == 1) goto LAB_006eb15c; if (uVar7 == 2) goto LAB_006eb304; goto LAB_006eafa4; } Entity_Player::AddGoldenKey(); isPickedUp = '\x01'; } else { Entity_Player::AddGoldenBomb(); isPickedUp = '\x01'; } } else { if (iVar4 != 7) goto LAB_006ec9a8; if (g_game->_challenge == 0x20) goto LAB_006eb2e0; Entity_Player::AddBombs(player,1); Entity_Player::AddGigaBombs(player,1); isPickedUp = '\x01'; } goto LAB_006ebf92; } if (iVar4 != 0x5a) { if ((((((iVar4 == 0x32) || (iVar4 == 0x168)) || (iVar4 == 0x36)) || ((iVar4 == 0x3c || (iVar4 == 0x34)))) || (iVar4 == 0x35)) || (((iVar4 == 0x186 || (iVar4 == 0x37)) || (iVar4 == 0x38)))) { bVar3 = Entity_Player::HasTrinket(player,0x13,0); if ((bVar3 == 0) && (((iVar4 = *(int *)((int)this + 0x2c), iVar4 == 0x3c || (iVar4 == 0x35)) || (iVar4 == 0x37)))) { if (*(int *)((int)this + 0x30) == 0) goto LAB_006ec9a8; if ((g_game->_stage != 9) || (iVar4 = Entity_Player::GetTrinketMultiplier(player,0xaf), iVar4 < 2)) { if (*(char *)((int)this + 0x52f) == '\0') { bVar3 = Entity_Player::TryUseKey(player); } else { local_91 = 0 < *(int *)((int)player + 0x1368); bVar3 = local_91; if (0 < *(int *)((int)player + 0x1368)) { Entity_Player::AddCoins(player,-1); bVar3 = local_91; } } if (bVar3 == 0) goto LAB_006ec9a8; } } local_9c.y = *(float *)((int)this + 0x2c); bVar3 = TryOpenChest(this,player); if ((bVar3 != 0) && ((Room *)local_9c.y == (Room *)0x34)) { fVar16 = *(float *)((int)this + 0x340) - *(float *)((int)player + 0x340); fVar15 = *(float *)((int)this + 0x33c) - ((Vector *)((int)player + 0x33c))->x; fVar16 = sqrtf(fVar16 * fVar16 + fVar15 * fVar15); if (fVar16 <= *(float *)((int)this + 0x370) + *(float *)((int)player + 0x370)) { pcVar1 = *(code **)(*(int *)player + 0x20); EntityRef::constructor((EntityRef *)(local_88 + 4),(Entity *)pickup); FUN_00665a30(); (*pcVar1)(); this = pickup; } } local_8a = '\x01'; } else { if (iVar4 == 0x39) { if ((*(int *)((int)this + 0x30) != 0) && ((*(int *)((int)this + 0x7c) == 0 || (*(char *)((int)this + 0x8c) == '\0')))) { if (*(char *)((int)this + 0x52f) == '\0') { bVar3 = Entity_Player::TryUseKey(player); } else { local_91 = 0 < *(int *)((int)player + 0x1368); bVar3 = local_91; if (0 < *(int *)((int)player + 0x1368)) { Entity_Player::AddCoins(player,-1); bVar3 = local_91; } } if (bVar3 != 0) { Entity::SetTarget((Entity *)this,(Entity *)player); if (*(char *)((int)this + 0x52f) == '\0') { play_sound_with_fart_seed(0x9c,1.0,2,0,1.0); pcVar5 = "UseGoldenKey"; if (*(byte *)((int)player + 0x1360) == 0) { pcVar5 = "UseKey"; } ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)pcVar5,1); } else { play_sound_with_fart_seed(0x2d,1.0,2,0,1.0); ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)"UseCoin",1); } } } goto LAB_006ec9a8; } if (((iVar4 == 100) || (iVar4 == 0x6e)) && (local_ec.y = *(float *)((int)this + 0x30), (Room *)local_ec.y != (Room *)0x0)) { bVar3 = Entity_Player::IsHoldingItem(player); if (((bVar3 == 0) && (isAllowed = Entity_Player::CanAddCollectible(player), isAllowed != '\0')) && (*(int *)((int)this + 0x544) < 1)) { local_fc = *(Room **)((int)this + 0x534); *(undefined4 *)((int)this + 0x540) = 0xffffffff; isPickedUp = '\x01'; if (*(int *)((int)player + 0x13c0) == 0x17) { tagsHigh = 0; tagsLow = 0x8000; itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_ec.y); bVar3 = Item::HasTags(itemConfig,CONCAT44(tagsHigh,tagsLow)); if (((bVar3 != 0) || (g_game->_challenge == 0x2b)) || ((g_game->_currentDimensionIdx == 2 || (g_game->_currentRoomIdx == -0xc)))) goto LAB_006eb939; RNG::Next((RNG *)((int)this + 0x3dc)); Entity_Player::tainted_cain_pedestal_burst(); empty_pedestal(this); uVar7 = Random(); local_9c.x = (collidingEntity->_pos).x + 0.0; local_9c.y = (collidingEntity->_pos).y + 10.0; Game::Spawn(g_game,1000,0xf,&local_9c,&g_vectorZero,(Entity *)0x0,0,uVar7); *(undefined4 *)((int)this + 0x540) = 2; play_sound_with_fart_seed(0x10b,1.0,2,0,1.0); Entity_Player::FlushQueueItem(player); } else { LAB_006eb939: if ((Room *)local_ec.y == (Room *)0x29c) { Game::save_rewind_state(-1); Music::Fadeout((Music *)&g_manager->_musicManager,0.01); local_ec.y = *(float *)((int)this + 0x30); } ItemPool::RemoveCollectible(&g_game->_itemPool,(int)local_ec.y,0,0); local_bc.y = *(float *)((int)this + 0x2c); isAppleOfSodom = 0; if ((Room *)local_bc.y != (Room *)0x64) { *(undefined4 *)((int)this + 0x334) = *(undefined4 *)((int)this + 0x33c); *(undefined4 *)((int)this + 0x338) = *(undefined4 *)((int)this + 0x340); *(undefined4 *)((int)this + 0x2c) = 100; } PlayPickupSound(this); local_b4 = (EntityPtr) ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_ec.y); if (((Room *)local_ec.y == (Room *)0x227) && (bVar3 = Entity_Player::HasCollectible(player,0x226,0), bVar3 != 0)) { local_ac.y = 0.0; local_9c.y = (float)Entity_Player::GetActiveItemSlot(player,0x226); if (-1 < (int)local_9c.y) { local_ac.y = (float)Entity_Player::GetActiveItem(player,(int)local_9c.y); iVar4 = Entity_Player::GetBatteryCharge(player,(int)local_9c.y); local_ac.y = (float)((int)local_ac.y + iVar4); } Entity_Player::RemoveCollectible(player,0x226,0,0,1); PersistentGameData::AddToCollection(&g_manager->_persistentGameData,0x227); local_b4 = (EntityPtr)ItemConfig::GetCollectible(&g_manager->_itemConfig,0x228); *(float *)((int)this + 0x524) = local_ac.y; LAB_006ebab5: UpdateSprite(this,1); } else { uVar7 = Level::GetCurses((Level *)g_game); if ((((uVar7 & 0x40) != 0) || (*(char *)((int)this + 0x52e) != '\0')) && (local_b4 != (EntityPtr)0x0)) goto LAB_006ebab5; } HUD::ShowItemText(&g_game->_hud,player,(ItemConfig_Item *)local_b4); local_100 = *(Room **)((int)this + 0x524); local_ec.y = *(float *)((int)this + 0x59c); local_e0.y = (float)GetAlternatePedestal(this); local_9c.y = (float)CONCAT31(local_9c.y._1_3_,*(undefined1 *)((int)this + 0x52c)); if ((Room *)local_bc.y == (Room *)0x64) { AnimationState::SetAnimationData((AnimationState *)((int)this + 0x98),(void *)0x0) ; anim = (byte *)"PlayerPickupSparkle"; } else { anim = s_Idle; } ANM2::Play((ANM2 *)((int)this + 0x48),anim,0); bVar3 = Entity::HasEntityFlags((Entity *)this,0x40000); pcVar5 = "Pickup"; if (bVar3 != 0) { pcVar5 = "UseItem"; } Entity_Player::AnimatePickup(player,(ANM2 *)((int)this + 0x48),0,(byte *)pcVar5); if (*(int *)local_b4 == 3) { Entity_Player::FlushQueueItem(player); local_ac.y = *(float *)((int)player + 0x1580); bVar3 = ItemConfig::IsValidCollectible((int)local_ac.y); if (((bVar3 == 0) || (isAllowed = FUN_007da7a0(), isAllowed != '\0')) || ((bVar3 = Entity_Player::HasCollectible(player,0x216,0), bVar3 != 0 && ((bVar3 = ItemConfig::IsValidCollectible (((ActiveItemDesc *)((int)player + 0x15a0))->_item), bVar3 == 0 || (isAllowed = FUN_007da7a0(), isAllowed != '\0')))))) goto LAB_006ebd7b; iVar4 = *(int *)((int)player + 0x1588); local_d0.y = (float)pickingPlayer->_activeDesc[0]._varData; iVar21 = pickingPlayer->_activeDesc[0]._batteryCharge; pickup->_subtype = (int)local_ac.y; Entity_Player::RemoveCollectible(pickingPlayer,(uint)local_ac.y,0,0,0); Morph(pickup,pickup->_type,pickup->_variant,pickup->_subtype,0,1,1); this = pickup; pickup->_charge = iVar21 + iVar4; pickup->_varData = (int)local_d0.y; UpdateSprite(pickup,1); player = pickingPlayer; LAB_006ebcdd: local_d0.y = (float)((int)g_game->_room + 0x724); local_ac.y = 0.0; do { gridEntity = *(GridEntity **)((int)local_d0.y + (int)local_ac.y * 4); if ((gridEntity != (GridEntity *)0x0) && (tmpPos = GridEntity::Position(gridEntity,&local_110), fVar15 = tmpPos->x - ((Vector *)((int)player + 0x33c))->x, fVar16 = tmpPos->y - *(float *)((int)player + 0x340), fVar16 * fVar16 + fVar15 * fVar15 < 4900.0)) { if (-1 < (int)local_ac.y) { *(undefined4 *)((int)this + 0x550) = 1; } break; } local_ac.y = (float)((int)local_ac.y + 1); } while ((int)local_ac.y < 8); isAppleOfSodom = 1; } else { if ((*(int *)((int)player + 0x13c0) == 0x15) && (bVar3 = Entity_Player::CanAddCollectibleToInventory (gridEntity,*(int *)((int)local_b4 + 4)), bVar3 != 0)) { Entity_Player::FlushQueueItem(player); iVar4 = Entity_Player::GetMaxInventorySize(player); if ((-1 < (int)((void **)((int)player + 0x1dfc))[iVar4]) && (pEVar6 = Entity_Player::DropCollectibleByHistoryIndex (player,*(int *)((int)player + 0x1e00),this,unusedBool), pEVar6 != (Entity_Pickup *)0x0)) { iVar4 = 0xf; do { ((int *)((int)player + 0x1e00))[iVar4] = (int)((void **)((int)player + 0x1dfc))[iVar4]; iVar4 = iVar4 + -1; } while (0 < iVar4); *(int *)((int)player + 0x1e00) = -1; goto LAB_006ebcdd; } } LAB_006ebd7b: if (1 < *(int *)&g_game->_deathmatchManager) { uVar7 = Random(); Game::Spawn(g_game,1000,0xf,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)0x0,0,uVar7); play_sound_with_fart_seed(0x109,0.7,2,0,1.0); EntityRef::EntityRef((EntityRef *)(local_88 + 4)); (**(code **)(*(int *)this + 0x24))(); } } SetAlternatePedestal(this,(int)local_e0.y); Entity_Player::SetQueuedItem (player,(ItemConfig_Item *)local_b4,(int)local_100,SUB41(local_9c.y,0), (int)local_ec.y,*(int *)((int)this + 0x530)); if ((local_9c.y._0_1_ == '\0') && (*(int *)((int)g_game->_room + 8) == 0xf)) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xf,1); } if (isAppleOfSodom == 0) { KAGE_LogMessage(1,(byte *)"item taken without exchange\n"); *(float *)((int)this + 0x2c) = local_bc.y; empty_pedestal(this); } else { *(undefined1 *)((int)this + 0x52c) = 1; ANM2::Play((ANM2 *)((int)this + 0x48),s_Idle,0); if (*(char *)((int)this + 0x6d9) != '\0') { ANM2::Play((ANM2 *)((int)this + 0x5d0),s_Idle,0); } } *(undefined4 *)((int)this + 0x5c0) = 0; *(undefined1 *)((int)this + 0x52e) = 0; } if (local_fc != (Room *)0x0) { bVar3 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0x178); if (bVar3 == 0) { bVar3 = Game::IsGreedMode(g_game); if (bVar3 == 0) goto LAB_006ebf7e; } local_9c.y = (float)g_game->_room; if (((Room *)local_9c.y)->_roomType == 2) { pos = (Vector *)((int)this + 0x33c); iVar4 = Room::GetGridIndex((Room *)local_9c.y,pos); Room::TriggerRestock((Room *)local_9c.y,iVar4,pickup->_shopItemId); tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_e0,pos,10.0,0,0,0) ; fVar16 = tmpPos->x; (pickup->_targetPosition).x = fVar16; fVar15 = tmpPos->y; pos->x = fVar16; *(float *)((int)this + 0x340) = fVar15; (pickup->_targetPosition).y = fVar15; pickup->_wait = 0x14; this = pickup; } } LAB_006ebf7e: local_d1 = '\x01'; local_8a = '\x01'; goto LAB_006ebf8c; } iVar4 = *(int *)((int)this + 0x2c); } if ((iVar4 == 300) || (iVar4 == 0x46)) { bVar3 = Entity_Player::IsHoldingItem(player); if (bVar3 == 0) { uVar7 = *(uint *)((int)this + 0x30); if (g_game->_challenge == 0x2b) { uVar7 = Entity_Player::AddItemCard(player,uVar7 & 0x7fff); if (uVar7 == 0) goto LAB_006ec9a8; Entity_Player::AnimateCollectible (player,uVar7,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); isPickedUp = '\x01'; } else if (*(int *)((int)this + 0x2c) == 300) { Entity_Player::AddPocketItem(player,uVar7,1); Entity_Player::AnimateCard(player,*(int *)((int)this + 0x30),(byte *)"UseItem"); local_9c.y = (float)ItemConfig::GetCard(&g_manager->_itemConfig, *(int *)((int)this + 0x30)); if (((*(int *)((int)player + 0x13c0) == 0x13) || (*(int *)((int)player + 0x13c0) == 0x14)) || ((Room *)local_9c.y == (Room *)0x0) ) goto LAB_006eafa4; PocketItemConfig::GetName((void *)local_9c.y,&local_2c,0x14); local_8 = 3; iVar4 = 0x6ec0cf; ItemConfig_Card::get_display_desc((ItemConfig_Card *)local_9c.y); local_8 = CONCAT31(local_8._1_3_,4); bVar3 = Game::IsInTimedSet(g_game,0x1e); if (bVar3 != 0) { tmpPos = (Vector *)0x6ec0fe; pcVar5 = (char *)FUN_009587e0(); SimpleString::operator=((SimpleString *)&local_2c,pcVar5); iVar4 = 0x6ec116; std::string::assign(local_44,&s_empty,0); } uVar8 = 9; uVar7 = 0x6ec123; bVar3 = Game::IsInTimedSet(g_game,9); if (bVar3 != 0) { std::string::string(acStackY_264 + 0x84,&local_2c); string_scramble_seeded (local_5c,pvVar19,(int)pEVar20,(int)tmpPos,iVar4,uVar7,uVar8); uVar7 = 0x6ec149; FUN_004215a0(); uVar8 = 0x6ec151; std::string::_Tidy_deallocate(local_5c); std::string::string(acStackY_264 + 0x84,local_44); string_scramble_seeded (local_5c,pvVar19,(int)pEVar20,(int)tmpPos,iVar4,uVar7,uVar8); FUN_004215a0(); std::string::_Tidy_deallocate(local_5c); } PlayerHUD::show_pill_name(); std::string::_Tidy_deallocate(local_44); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_2c._buf); isPickedUp = '\x01'; } else { Entity_Player::AddPocketItem(player,uVar7,0); Entity_Player::AnimatePill(player,*(int *)((int)this + 0x30),(byte *)"UseItem"); isPickedUp = '\x01'; } goto LAB_006ebf92; } iVar4 = *(int *)((int)this + 0x2c); } if (iVar4 == 0x15e) { bVar3 = Entity_Player::IsHoldingItem(player); if ((bVar3 == 0) && (*(EntityPtr *)((int)player + 0x3bc) == (EntityPtr)0x0)) { local_ac.y = *(float *)((int)this + 0x30); isAllowed = Entity_Player::TryHoldTrinket(); if (isAllowed != '\0') { itemConfig = ItemConfig::GetTrinket(&g_manager->_itemConfig,(uint)local_ac.y); if (itemConfig != (ItemConfig_Item *)0x0) { HUD::ShowItemText(&g_game->_hud,player,itemConfig); } local_d0.y = (float)((int)player + 0x16c0); local_9c.y = 0.0; while( true ) { local_bc.y = 1.4013e-45; bVar3 = Entity_Player::HasCollectible(player,0x8b,0); if ((bVar3 == 0) && (bVar3 = Entity_Player::HasCollectible(player,0x1ca,0), bVar3 == 0)) { pRVar11 = (Room *)local_bc.y; } else { pRVar11 = (Room *)0x2; } if (pRVar11 <= (uint)local_9c.y) goto LAB_006ec302; if (((uint)local_9c.y < (Room *)0x2) && ((*(uint *)local_d0.y & 0x7fff) == 0x35)) break; local_9c.y = (float)((int)local_9c.y + 1); local_d0.y = (float)((int)local_d0.y + 4); } isAllowed = is_trinket_unpickable_id(); local_d0.y = (float)CONCAT31(local_d0.y._1_3_,1); if (isAllowed == '\0') { LAB_006ec302: local_d0.y = (float)((uint)local_d0.y & 0xffffff00); } if (((*(int *)((int)player + 0x16c0) != 0) && ((uVar7 = Entity_Player::GetMaxTrinkets(player), uVar7 < 2 || (*(int *)((int)player + 0x16c4) != 0)))) || (local_d0.y._0_1_ != '\0')) { local_9c.x = ((Vector *)((int)player + 0x33c))->x; local_9c.y = *(float *)((int)player + 0x340); pEVar6 = Entity_Player::DropTrinket(player,&local_9c,SUB41(local_d0.y,0)); local_11c.y = (float)(Entity_Pickup *)0x0; if (pEVar6 != (Entity_Pickup *)0x0) { local_11c.y = (float)pEVar6; } } bVar14 = *(char *)((int)this + 0x52c) != '\0'; iVar4 = -1; bVar3 = bVar14 | 2; if (((uint)local_ac.y & 0x8000) == 0) { bVar3 = bVar14; } iVar22 = 0; iVar21 = 0; itemConfig = ItemConfig::GetTrinket(&g_manager->_itemConfig,(uint)local_ac.y); Entity_Player::SetQueuedItem(player,itemConfig,iVar21,bVar3,iVar22,iVar4); isPickedUp = '\x01'; goto LAB_006ebf92; } } } else if (iVar4 == 0x154) { if (g_game->_challenge != 0x1f) goto LAB_006ec3db; } else if (iVar4 == 0x172) { LAB_006ec3db: if (*(int *)((int)this + 0x584) == 0) { Entity::SetTarget((Entity *)this,(Entity *)player); *(undefined4 *)((int)this + 0x584) = 1; } } else { if (iVar4 != 0x17c) { if (iVar4 == 0x45) { GetChestLoot(this); local_8 = 5; RNG::game_constructor(&rng,*(uint *)((int)this + 0x3ec),0x17); local_e0.y = (float)local_4c; local_110.y = (float)local_4c; local_114 = local_58; local_110.x = 0.0; iVar4 = _range_to_span(); if (local_4c != *(EntityPtr *)(iVar4 + 8)) { while( true ) { if (local_58 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *local_58; } if (**(int **)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & (uint)local_e0.y) * 4) == 3) { if (local_58 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *local_58; } if (*(int *)(*(int *)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & (uint)local_e0.y) * 4) + 4) == 0x2b) { Entity_Player::AddBlueFlies (player,1,(Vector *)((int)this + 0x33c),(Entity *)0x0); } else { if (local_58 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *local_58; } if (*(int *)(*(int *)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & (uint)local_e0.y) * 4) + 4) == 0x49) { Entity_Player::ThrowBlueSpider (player,(Vector *)((int)this + 0x33c),&g_vectorZero); } } } else { if (local_58 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *local_58; } pvVar19 = *(void **)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & (uint)local_e0.y) * 4); uVar7 = RNG::Next(&rng); tmpPos = RandomVector(&local_d0,uVar7); fVar16 = RNG::RandomFloat(&rng); local_9c.y = fVar16 * 3.0 + 2.0; local_bc.y = local_9c.y * tmpPos->y; local_bc.x = local_9c.y * tmpPos->x; uVar7 = RNG::Next(&rng); tmpPos = RandomVector(&local_ec,uVar7); this = pickup; local_ac.x = (pickup->_pos).x + tmpPos->x; local_ac.y = tmpPos->y + (pickup->_pos).y; tmpEntity = EntitySpawner::Spawn(pvVar19,&local_ac,&local_bc,(Entity *)pickup) ; (**(code **)(*(int *)tmpEntity + 0xc))(); player = pickingPlayer; } FUN_006da790(); iVar4 = _range_to_span(); local_e0.y = local_110.y; if ((EntityPtr)local_110.y == *(EntityPtr *)(iVar4 + 8)) break; local_58 = local_114; } } isPickedUp = '\x01'; local_8a = '\x01'; local_8 = 0xffffffff; *(undefined1 *)((int)g_game->_room + 0x7894) = 1; FUN_006b84c0(); goto LAB_006ebf8c; } if (iVar4 == 0x2a) { Entity_Player::AddPoopMana(player,(uint)(*(int *)((int)this + 0x30) == 1) * 2 + 1); isPickedUp = '\x01'; } else { if (((iVar4 != 0x29) || (bVar3 = Entity_Player::IsHoldingItem(player), bVar3 != 0)) || (*(int *)((int)player + 0x1884) != 0)) goto LAB_006ec9a8; uVar7 = Random(); local_9c.y = (float)Game::Spawn(g_game,4,0xd,(Vector *)((int)this + 0x33c), &g_vectorZero,(Entity *)player,0,uVar7); Entity_Player::TryHoldEntity(player,(Entity *)local_9c.y); tmpEntity = *(Entity **)((int)this + 0x3bc); if ((tmpEntity != (Entity *)0x0) && (tmpEntity->_child == (EntityPtr)this)) { Entity::SetChild(tmpEntity,(Entity *)local_9c.y); } (**(code **)(*(int *)this + 0x28))(); isPickedUp = '\x01'; } goto LAB_006ebf92; } if (*(char *)((int)this + 0x52c) == '\0') { local_bc.y = *(float *)((int)this + 0x30); isAddedRedHearts = (Room *)local_bc.y == (Room *)0xa; playerManager = &g_game->_playerManager; local_9c.y = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { if (isAddedRedHearts != false) goto LAB_006ec4ec; otherPlayer = PlayerManager::GetPlayer(playerManager,(int)local_9c.y); iVar4 = Entity_Player::GetHealthType(otherPlayer); if ((iVar4 == 1) || (iVar4 == 2)) { iVar4 = this_01->_maxHearts; } else { iVar4 = this_01->_maxHearts + this_01->_boneHearts * 2; } if (iVar4 < 1) { LAB_006ec4b3: isAddedRedHearts = true; } else { bVar3 = Entity_Player::HasFullHearts(this_01); isAddedRedHearts = false; if (bVar3 == 0) goto LAB_006ec4b3; } playerManager = &g_game->_playerManager; local_9c.y = (float)((int)local_9c.y + 1); } while ((uint)local_9c.y < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } if (isAddedRedHearts != false) { LAB_006ec4ec: if ((Room *)local_bc.y == (Room *)0xa) { PlayerManager::revive_player_ghosts(&g_game->_playerManager); *(undefined1 *)((int)this + 0x52c) = 1; Entity::SetTarget((Entity *)this,(Entity *)player); itemOverlay = &g_game->_itemOverlay; if ((g_game->_stage == 0xd) && (g_game->_stageType == 0)) { ItemOverlay::Show(itemOverlay,0x2c,0,(Entity_Player *)0x0); goto LAB_006ec9a8; } } else { *(undefined1 *)((int)this + 0x52c) = 1; Entity::SetTarget((Entity *)this,(Entity *)player); itemOverlay = &g_game->_itemOverlay; } ItemOverlay::Show(itemOverlay,0x21,0,(Entity_Player *)0x0); } } } } goto LAB_006ec9a8; } local_9c.y = (float)((int)player + 0x1580); local_e0.y = 0.0; do { itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)*(float *)local_9c.y); local_bc.y = (float)Entity_Player::GetActiveMaxCharge(player,(int)local_e0.y); iVar4 = Entity_Player::GetActiveMaxCharge(player,(int)local_e0.y); this = pickup; if ((itemConfig != (ItemConfig_Item *)0x0) && ((iVar4 == 1 || (iVar4 == 0)))) { iVar4 = pickup->_subtype; if (iVar4 == 3) { iVar21 = (int)local_bc.y * 2; } else { iVar21 = (uint)(iVar4 != 2) * 4 + 2; } iVar4 = Entity_Player::AddActiveCharge(player,iVar21,(int)local_e0.y,1,iVar4 == 3,0); if ((iVar4 != 0) && (isPickedUp = '\x01', this->_subtype != 3)) goto LAB_006eb472; } local_e0.y = (float)((int)local_e0.y + 1); local_9c.y = (float)&((Vector *)((int)local_9c.y + 0x1c))->y; } while ((uint)local_e0.y < 4); if (isPickedUp == '\0') goto LAB_006ec9a8; LAB_006eb472: PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc3,1); if (this->_subtype == 4) { EntityRef::EntityRef((EntityRef *)(local_88 + 4)); (*extraout_EDX_02)(); candidates = (EntityPtr)0x0; local_e0.x = 0.0; local_d0.y = 0.0; local_e0.y = 0.0; local_8 = 1; local_bc.y = (float)g_game->_roomList; local_9c.y = (float)Game::GetCurrentRoomDesc(g_game); local_ac.y = 0.0; if (0 < g_game->_nbRooms) { EVar13 = (EntityPtr)0x0; EVar10 = (EntityPtr)0x0; pRVar11 = (Room *)local_bc.y; do { if (pRVar11->_gridHeight != 0) { if (-1 < (int)pRVar11->_descriptor) { if (*(int *)(pRVar11->_gridHeight + 8) != 0x1d) { if (pRVar11 != (Room *)local_9c.y) { if (pRVar11->_gridEntities[0x24] != ((void **)((int)local_9c.y + 0x24))[0x24]) { if (pRVar11->_gridEntities[0x24] != (void *)0xffffffff) goto LAB_006eb595; } local_bc.y = (float)pRVar11; if (EVar13 == EVar10) { std::vector<4byte>::_Emplace_reallocate(); local_d0.y = local_e0.y; EVar10 = (EntityPtr)local_e0.y; EVar13 = (EntityPtr)local_e0.x; } else { *(Room **)EVar13 = pRVar11; local_e0.x = (float)((int)EVar13 + 4); EVar13 = (EntityPtr)local_e0.x; } } } } } LAB_006eb595: this = pickup; player = pickingPlayer; local_ac.y = (float)((int)local_ac.y + 1); pRVar11 = (Room *)(pRVar11->_gridEntities + 0x25); } while ((int)local_ac.y < g_game->_nbRooms); local_ac.y = (float)EVar13; if (candidates != EVar13) { uVar7 = RNG::RandomInt(&pickup->_dropRNG,(int)EVar13 - (int)candidates >> 2); local_9c.y = *(float *)((int)candidates + uVar7 * 4); EntitySaveState::constructor(saveState); local_8 = CONCAT31(local_8._1_3_,2); bVar3 = CanFlip(g_game->_room,this,outSaveState,0); if (bVar3 != 0) { local_194 = g_vectorZero.x; local_190 = g_vectorZero.y; FUN_004d7100(); } invoke_pending_callbacks(saveState); } } local_8 = 0xffffffff; if (candidates != (EntityPtr)0x0) { deallocate((void *)candidates,(int)local_d0.y - (int)candidates >> 2); } goto LAB_006ea527; } LAB_006ebf8c: } LAB_006ebf92: if (local_108.y == -NAN) { if (isPickedUp == '\0') goto LAB_006ecd3d; if ((((Entity_Pickup *)local_11c.y == (Entity_Pickup *)0x0) || (*(int *)((int)local_11c.y + 0x28) != 5)) || (*(int *)((int)local_11c.y + 0x2c) != 0x15e)) { LAB_006eca72: iVar4 = 0x6eca7d; bVar3 = Entity_Player::HasTrinket(player,0xd,0); if (bVar3 == 0) { iVar4 = 0xd; local_ac.y = (float)PlayerManager::FirstTrinketOwner(); } else { local_ac.y = (float)player; } if ((EntityPtr)local_ac.y != (EntityPtr)0x0) { bVar3 = Entity_Player::HasGoldenTrinket((Entity_Player *)local_ac.y,0xd); if (bVar3 == 0) { Entity_Player::TryRemoveTrinket((Entity_Player *)local_ac.y,0xd); } else { trinketRng = Entity_Player::GetTrinketRNG((Entity_Player *)local_ac.y,0xd); iVar22 = 4; iVar21 = 0x6ecad3; uVar7 = RNG::RandomInt(trinketRng,4); if (uVar7 == 0) { Entity_Player::replace_trinket((Entity_Player *)local_ac.y,iVar4,iVar21,iVar22); } } } } else if (*(int *)((int)local_11c.y + 0x30) == 0xd) { (**(code **)(*(int *)local_11c.y + 0x28))(); } else { if ((*(int *)((int)local_11c.y + 0x2c) != 0x15e) || (*(int *)((int)local_11c.y + 0x30) != 0x800d)) goto LAB_006eca72; trinketRng = Entity_Player::GetTrinketRNG(player,0xd); uVar7 = RNG::RandomInt(trinketRng,4); if (uVar7 == 0) { Morph((Entity_Pickup *)local_11c.y,5,0x15e,0xd,0,1,1); } } } else { LAB_006ecd39: if (isPickedUp != '\0') goto LAB_006ecd4b; LAB_006ecd3d: if (local_8a == '\0') goto LAB_006ed27b; } LAB_006ecd4b: RemoveOtherOptions(); game = g_game; if ((EntityPtr)player != (EntityPtr)0x0) { iVar4 = *(int *)((int)g_game->_room + 8); if (((iVar4 == 0xe) || ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 0xb & 1) != 0)) || ((iVar4 == 5 && ((g_game->_levelStateFlags & 0x20000U) != 0)))) { if ((*(int *)((int)this + 0x584) == 1) || (local_108.y != 0.0)) { g_game->_devilRoomDeals = g_game->_devilRoomDeals + 1; if (2 < game->_devilRoomDeals) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x4f); } PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x10,1); } else if (*(int *)((int)this + 0x32c) < 0) goto LAB_006ece45; if ((((*(int *)((int)player + 0x1f04) != 0) && (*(int *)(*(int *)((int)player + 0x1f04) + 0x28) == 1000)) && (*(byte *)((int)player + 0x1519) == 0)) && ((pvVar19 = TemporaryEffects::GetCollectibleEffect ((TemporaryEffects *)((int)player + 0x1508),0x2a1), pvVar19 != (void *)0x0 && (*(int *)((int)pvVar19 + 4) == 1)))) { TemporaryEffects::AddCollectibleEffect ((TemporaryEffects *)((int)player + 0x1508),0x2a1,1,1); *(undefined4 *)(*(int *)((int)player + 0x1f04) + 0x450) = 1; } } } LAB_006ece45: if (isPickedUp != '\0') { ScoreSheet::add_pickup_points(); pickingPlayer = player; if (local_d1 == '\0') goto LAB_006ecfff; goto LAB_006ed006; } } else { LAB_006ecc76: iVar21 = collidingEntity->_type; if ((iVar21 == 0x196) || (iVar21 == 0x394)) { if ((iVar4 != 0x14) || (local_9c.y = (float)Entity::to_npc_or_coop_player((Entity *)collidingEntity), (Room *)local_9c.y == (Room *)0x0)) goto LAB_006ed27b; if (((Room *)local_9c.y)->_gridEntities[1] == (void *)0x196) { iVar4 = __RTDynamicCast(); if (iVar4 != 0) { NpcHelper::UltraGreed_Heal(); ((void **)((int)local_9c.y + 0x24))[0xfd] = (void *)g_vectorZero.x; ((void **)((int)local_9c.y + 0x24))[0xfe] = (void *)g_vectorZero.y; ((void **)((int)local_9c.y + 0x24))[0xff] = (void *)g_vectorZero.x; ((void **)((int)local_9c.y + 0x24))[0x100] = (void *)g_vectorZero.y; } } else if ((((Room *)local_9c.y)->_gridEntities[1] == (void *)0x394) && (*(int *)((int)this + 0x28) == 5)) { if (subtype - 1U < 7) { iVar4 = *(int *)(&DAT_00b67e34 + subtype * 4); } else { iVar4 = 0; } ((Room *)local_9c.y)->_gridPaths[0x116] = ((Room *)local_9c.y)->_gridPaths[0x116] + iVar4; ((Room *)local_9c.y)->_gridEntities[0xfd] = (void *)g_vectorZero.x; ((Room *)local_9c.y)->_gridEntities[0xfe] = (void *)g_vectorZero.y; ((Room *)local_9c.y)->_gridEntities[0xff] = (void *)g_vectorZero.x; ((Room *)local_9c.y)->_gridEntities[0x100] = (void *)g_vectorZero.y; } LAB_006ecfd0: isPickedUp = '\x01'; goto LAB_006ecfd7; } if ((((low != 0) || (iVar21 != 3)) || ((collidingEntity->_variant != 0xe8 && (collidingEntity->_variant != 0xe7)))) || (bVar3 = Entity_Familiar::is_detached_from_follow(collidingEntity), bVar3 != 0)) goto LAB_006ed27b; if (extraout_EDX_03 < 0x47) { if (extraout_EDX_03 != 0x46) { switch(extraout_EDX_03) { case 10: case 0x14: case 0x1e: case 0x28: break; default: goto LAB_006ed27b; } } } else if (((extraout_EDX_03 != 0x5a) && (extraout_EDX_03 != 300)) && (extraout_EDX_03 != 0x15e)) goto LAB_006ed27b; isPickedUp = '\x01'; if (*(int *)(extraout_ECX_00 + 0x2c) == 0xe8) { Entity_Familiar::AddCoins(); } else if (*(int *)(extraout_ECX_00 + 0x2c) == 0xe7) { isPickedUp = Entity_Familiar::abyss_locust_eat(); goto LAB_006ecd39; } LAB_006ecfd7: RemoveOtherOptions(); ScoreSheet::add_pickup_points(); LAB_006ecfff: PlayPickupSound(this); LAB_006ed006: if ((EntityPtr)player != (EntityPtr)0x0) { trigger_set_dispatch ((void *)((int)player + 0x1fc8),7,(Entity *)this,(Vector *)((int)this + 0x33c), &g_vectorZero); } if (((local_108.y == 0.0) && (iVar4 = *(int *)((int)this + 0x2c), iVar4 != 0x15e)) || (iVar4 = *(int *)((int)this + 0x2c), (EntityPtr)player == (EntityPtr)0x0)) { if (iVar4 != 100) { *(float *)((int)this + 0x360) = g_vectorZero.x; *(float *)((int)this + 0x364) = g_vectorZero.y; *(undefined4 *)((int)this + 0x188) = 0; *(undefined4 *)((int)this + 0x184) = 3; ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)"Collect",0); *(undefined1 *)((int)this + 0x173) = 1; UpdateLootPreview(this); if ((*(int *)((int)this + 0x2c) == 0x14) && (*(int *)((int)this + 0x30) == 7)) { local_9c.y = pow(0.98,(float)*(int *)((int)this + 0x59c)); local_bc.y = RNG::RandomFloat((RNG *)((int)this + 0x3dc)); if (local_bc.y <= local_9c.y) { pRVar11 = g_game->_room; tmpPos = Room::GetRandomPosition(pRVar11,&local_9c,0.0); Room::FindFreePickupSpawnPosition(pRVar11,&local_bc,tmpPos,0.0,1,0,0); g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; uVar7 = RNG::Next((RNG *)((int)this + 0x3dc)); this = pickup; tmpEntity = Game::Spawn(g_game,pickup->_type,pickup->_variant,&local_bc,&g_vectorZero, (Entity *)0x0,pickup->_subtype,uVar7); *(int *)&tmpEntity[1]._collidesWithGrid = this->_varData + 1; ANM2::Play(&tmpEntity->_sprite,(byte *)"Reappear",0); g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1; } } } } else { if (iVar4 == 0x15e) { ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)"PlayerPickupSparkle",0); iVar4 = *(int *)((int)this + 0x2c); } if (iVar4 != 100) { Entity_Player::AnimatePickup(player,(ANM2 *)((int)this + 0x48),0,(byte *)"Pickup"); } if (local_108.y != 0.0) { CollectTrinket(this); } if (*(int *)((int)this + 0x2c) != 100) { (**(code **)(*(int *)this + 0x28))(); UpdateLootPreview(this); } } game = g_game; iVar4 = *(int *)((int)this + 0x2c); if (((iVar4 == 10) || (iVar4 == 0x28)) || (iVar4 == 0x14)) { gameStateFlags = g_game->_gameStateFlags; puVar12 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar12 = *puVar12 | 0x200; *(int *)&game->_gameStateFlags = (int)gameStateFlags; } if (local_108.y != 0.0) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc5,1); } } if ((local_8a != '\0') && ((iVar4 = *(int *)((int)g_game->_room + 8), iVar4 == 0xb || (iVar4 == 0x11)))) { Ambush::StartChallenge(&g_game->_ambush); } LAB_006ed27b: local_9c.y = (float)&g_game->_playerManager; bVar3 = PlayerManager::IsCoopPlay((PlayerManager *)local_9c.y); if (((bVar3 != 0) && (iVar4 = *(int *)((int)this + 0x588), iVar4 != -1)) && (((uVar7 = PlayerManager::GetNumAlivePlayers(), iVar4 + 1U < uVar7 && (isPickedUp != '\0')) && (((*(int *)((int)this + 0x30) == 0 || (collidingEntity->_type != 1)) || (*(int *)&collidingEntity[1].field_0x49c != 0x15)))))) { local_11c.x = *(float *)((int)this + 0x33c); local_11c.y = *(float *)((int)this + 0x340); if (*(int *)((int)this + 0x30) == 0) { (**(code **)(*(int *)this + 0x28))(); } else { tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_108,(Vector *)((int)this + 0x33c),40.0,1,0,0); local_11c.x = tmpPos->x; local_11c.y = tmpPos->y; } this = pickup; game = g_game; uVar7 = RNG::Next(&pickup->_dropRNG); uVar7 = ItemPool::GetCollectible(&game->_itemPool,2,uVar7,0,0,0); uVar8 = RNG::Next(&this->_dropRNG); tmpEntity = Game::Spawn(g_game,5,100,&local_11c,&g_vectorZero,(Entity *)0x0,uVar7,uVar8); FUN_006e2ff0(); (**(code **)(*(int *)tmpEntity + 0xc))(); if (this->_subtype != 0) { this->_coopDuplicateIndex = -1; } } pEVar20 = collidingEntity; if (((*(int *)((int)g_game->_room + 8) == 0x10) || ((bVar3 = Entity::IsEnemy((Entity *)collidingEntity), bVar3 != 0 && (*(int *)((int)this + 0x2c) == 0x154)))) || ((pEVar20->_type == 4 || (((isPickedUp != '\0' && (*(int *)((int)this + 0x2c) != 100)) || ((*(int *)((int)this + 0x534) != 0 || ((pickingPlayer != (Entity_Player *)0x0 && (pickingPlayer->_variant == 1)))))))))) { ExceptionList = local_10; return 1; } ExceptionList = local_10; return 0; } //@@ 006ed580 Entity_Pickup::empty_pedestal /* DB: variant 100 with a subtype: subtype 0 and the "Empty" animation; a priced one (+0x534) is removed unless kept; hides itemshadow. Spindown Dice below id 1 (UseActiveItem case 0x2d3) (items-verify) */ undefined4 __thiscall Entity_Pickup::empty_pedestal(Entity_Pickup *this) { byte bVar1; LayerState *pLVar2; if (this->_variant == 100) { if (this->_subtype != 0) { this->_subtype = 0; if (this->_price == 0) { bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Empty",1); if ((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } } else { if ((this->_flipSaveState == 0) || ((this->_altPedestalANM2)._loaded == 0)) { (**(code **)(*(int *)this + 0x28))(); return 1; } update_price_sprite(this,0); SetAlternatePedestal(this,0); ANM2::SetFrame(&this->_sprite,(std_string *)"Empty",0); bVar1 = ANM2::SetAnimation(&this->_altPedestalANM2,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_altPedestalANM2)._animState); (this->_altPedestalANM2)._animState._isPlaying = 1; } } pLVar2 = ANM2::GetLayer(&this->_sprite,(byte *)"itemshadow"); if (pLVar2 != (LayerState *)0x0) { pLVar2->_visible = 0; } return 1; } } else if (this->_variant == 0x6e) { (**(code **)(*(int *)this + 0x28))(); return 1; } return 0; } //@@ 006ed690 Entity_Pickup::update_magnet_attraction /* DB: Entity_Pickup::Update helper: early-out unless FirstCollectibleOwner(0x35 Magneto) or AnyoneHasTrinket(0x44 Super Magnet / 6 Broken Magnet); GetTrinketMultiplier scaling, pulls pickup toward player, chest/variant checks prototype: db/protos.zhl */ void __thiscall Entity_Pickup::update_magnet_attraction(Entity_Pickup *this) { byte bVar1; char isCanPickRed; byte isCanCollect; Entity_Player *pEVar2; int iVar3; int iVar4; int *playerSlot; int extraout_ECX; undefined4 *playerEntry; uint uVar5; PlayerManager *playerManager; bool bVar6; bool bVar7; bool bVar8; float fVar9; float fVar10; float fVar11; Entity_Player *closestPlayer; float closestDistSq; uint playerIndex; Game *game; void *listEnd; if (this->_variant == 0x29) { return; } pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x35,(RNG **)&g_game->_playerManager,1); if (((pEVar2 == (Entity_Player *)0x0) && (bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x44), bVar1 == 0)) && (bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,6), bVar1 == 0)) { if (this->_entityGridCollisionClass == 3) { this->_entityGridCollisionClass = 5; } } else { PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x44); if ((((this->_price == 0) || (iVar3 = this->_variant, iVar3 == 0x1e)) || ((iVar3 == 0x28 || ((iVar3 == 0x14 || (iVar3 == 10)))))) || (iVar3 == 0x5a)) { playerManager = &g_game->_playerManager; closestDistSq = 1e+09; closestPlayer = (Entity_Player *)0x0; playerIndex = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { LAB_006ed780: listEnd = (playerManager->_playerList)._end; playerEntry = (playerManager->_playerList)._begin; if ((int)listEnd - (int)playerEntry >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); listEnd = (playerManager->_playerList)._end; playerEntry = (playerManager->_playerList)._begin; } if (playerIndex < (uint)((int)listEnd - (int)playerEntry >> 2)) { playerEntry = playerEntry + playerIndex; } pEVar2 = (Entity_Player *)*playerEntry; bVar1 = Entity_Player::HasCollectible(pEVar2,0x35,0); if ((bVar1 == 0) && (iVar3 = Entity_Player::GetTrinketMultiplier(pEVar2,6), iVar3 < 2)) { bVar6 = false; } else { bVar6 = true; } bVar1 = Entity_Player::HasCollectible(pEVar2,0x35,0); fVar9 = pEVar2[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar9 == 0.0) || (fVar9 != 8.40779e-45)) { iVar3 = Entity_Player::GetTrinketMultiplier(pEVar2,6); bVar7 = false; bVar8 = iVar3 == 0; LAB_006ed81f: bVar8 = !bVar8 && bVar7 == iVar3 < 0; } else { if (*(char *)(pEVar2[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar4 = Entity_Player::GetTrinketMultiplier(pEVar2,6); bVar7 = SBORROW4(iVar4,1); iVar3 = iVar4 + -1; bVar8 = iVar4 == 1; goto LAB_006ed81f; } bVar8 = true; } if (pEVar2->_variant == 0) { if (bVar6) { LAB_006ed878: if (this->_price == 0) { uVar5 = this->_variant; if (uVar5 < 0x15f) { if (uVar5 == 0x15e) { LAB_006ed91d: iVar4 = Entity_Player::GetTrinketMultiplier(pEVar2,0x44); bVar8 = SBORROW4(iVar4,1); iVar3 = iVar4 + -1; bVar6 = iVar4 == 1; code_r0x006ed929: isCanCollect = !bVar6 && bVar8 == iVar3 < 0; goto LAB_006ed92c; } switch(uVar5) { case 10: goto code_r0x006ed8b3; default: break; case 0x14: case 0x1e: case 0x28: goto LAB_006ed930; case 0x32: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3c: iVar4 = Entity_Player::GetTrinketMultiplier(pEVar2,0x44); bVar8 = SBORROW4(iVar4,2); iVar3 = iVar4 + -2; bVar6 = iVar4 == 2; goto code_r0x006ed929; case 0x45: goto LAB_006ed91d; case 0x5a: isCanCollect = Entity_Player::NeedsCharge(pEVar2,0); goto LAB_006ed92c; } } } } else { fVar9 = pEVar2[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar9 == 0.0) || (fVar9 != 9.52883e-44)) { iVar3 = Entity_Player::GetTrinketMultiplier(pEVar2,0x44); bVar7 = false; bVar6 = iVar3 == 0; } else { if (*(char *)(pEVar2[1]._chargeBarSprites[0]._color._offset + 1) != '\0') goto LAB_006ed878; iVar4 = Entity_Player::GetTrinketMultiplier(pEVar2,0x44); bVar7 = SBORROW4(iVar4,1); iVar3 = iVar4 + -1; bVar6 = iVar4 == 1; } if ((!bVar6 && bVar7 == iVar3 < 0) || ((bVar8 && (this->_variant == 0x14)))) goto LAB_006ed878; } goto LAB_006ed989; } goto LAB_006eda62; } } } LAB_006edb53: if ((this->_price == 0) && (this->_variant == 0x14)) { uVar5 = 1; playerManager = &g_game->_playerManager; if (1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)) { do { listEnd = (playerManager->_playerList)._end; if ((int)listEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); listEnd = (playerManager->_playerList)._end; } game = g_game; playerSlot = (playerManager->_playerList)._begin; if (uVar5 < (uint)((int)listEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar5; } if (*(int *)(*playerSlot + 0x1aec) == 0x12) { listEnd = (g_game->_playerManager)._playerList._end; playerSlot = (g_game->_playerManager)._playerList._begin; if ((int)listEnd - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); listEnd = (game->_playerManager)._playerList._end; playerSlot = (game->_playerManager)._playerList._begin; } if (uVar5 < (uint)((int)listEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar5; } fVar10 = *(float *)(*playerSlot + 0x33c) - (this->_pos).x; fVar11 = *(float *)(*playerSlot + 0x340) - (this->_pos).y; fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (0.0 < fVar9) { fVar11 = (1.0 / fVar9) * fVar11; fVar10 = (1.0 / fVar9) * fVar10; } this->_entityGridCollisionClass = 3; (this->_velocity).x = (fVar10 * 0.5 + (this->_velocity).x) * 0.8; (this->_velocity).y = (fVar11 * 0.5 + (this->_velocity).y) * 0.8; } uVar5 = uVar5 + 1; playerManager = &g_game->_playerManager; } while (uVar5 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } return; code_r0x006ed8b3: switch(this->_subtype) { case 1: case 2: case 5: case 9: isCanCollect = Entity_Player::CanPickRedHearts(pEVar2); break; case 3: case 8: LAB_006ed8d7: isCanCollect = Entity_Player::CanPickSoulHearts(pEVar2); break; default: goto LAB_006ed930; case 6: isCanCollect = Entity_Player::CanPickBlackHearts(pEVar2); break; case 7: isCanCollect = Entity_Player::CanPickGoldenHearts(pEVar2); break; case 10: isCanPickRed = Entity_Player::CanPickRedHearts(pEVar2); if (isCanPickRed == '\0') goto LAB_006ed8d7; goto LAB_006ed930; case 0xb: isCanCollect = Entity_Player::CanPickBoneHearts(pEVar2); break; case 0xc: isCanCollect = Entity_Player::CanPickRottenHearts(pEVar2); } LAB_006ed92c: if (isCanCollect == 0) { LAB_006ed989: if ((((pEVar2->_variant == 0) && (bVar1 != 0)) && (bVar1 = IsChest(this->_variant), bVar1 != 0)) && (this->_subtype != 0)) { if (((extraout_ECX != 0x32) && (extraout_ECX != 0x38)) && ((extraout_ECX != 0x168 && ((extraout_ECX != 0x34 && (extraout_ECX != 0x36)))))) { fVar9 = pEVar2[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar9 == 0.0) || (fVar9 != 2.66247e-44)) { iVar3 = Entity_Player::GetTrinketMultiplier(pEVar2,0x13); bVar8 = false; bVar6 = iVar3 == 0; LAB_006eda04: if (bVar6 || bVar8 != iVar3 < 0) goto LAB_006eda62; } else if (*(char *)(pEVar2[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar4 = Entity_Player::GetTrinketMultiplier(pEVar2,0x13); bVar8 = SBORROW4(iVar4,1); iVar3 = iVar4 + -1; bVar6 = iVar4 == 1; goto LAB_006eda04; } iVar3 = this->_variant; if (((iVar3 != 0x3c) && (iVar3 != 0x35)) && (iVar3 != 0x37)) goto LAB_006eda62; } fVar10 = (this->_pos).x - (pEVar2->_pos).x; fVar9 = (this->_pos).y - (pEVar2->_pos).y; if (fVar9 * fVar9 + fVar10 * fVar10 < 6400.0) { TryOpenChest(this,pEVar2); } } } else { LAB_006ed930: fVar9 = (this->_pos).x - (pEVar2->_pos).x; fVar10 = (this->_pos).y - (pEVar2->_pos).y; fVar9 = fVar10 * fVar10 + fVar9 * fVar9; if (fVar9 < closestDistSq) { closestPlayer = pEVar2; closestDistSq = fVar9; } } LAB_006eda62: playerManager = &g_game->_playerManager; playerIndex = playerIndex + 1; if ((uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2) <= playerIndex) goto code_r0x006eda8d; goto LAB_006ed780; code_r0x006eda8d: if (closestPlayer != (Entity_Player *)0x0) { fVar10 = (closestPlayer->_pos).x - (this->_pos).x; fVar11 = (closestPlayer->_pos).y - (this->_pos).y; fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (0.0 < fVar9) { fVar11 = (1.0 / fVar9) * fVar11; fVar10 = (1.0 / fVar9) * fVar10; } (this->_velocity).x = (fVar10 * 0.5 + (this->_velocity).x) * 0.8; (this->_velocity).y = (fVar11 * 0.5 + (this->_velocity).y) * 0.8; this->_entityGridCollisionClass = 3; } goto LAB_006edb53; } //@@ 006edda0 Entity_Pickup::TakeDamage /* ZHL [vtable slot 8] */ uint __thiscall Entity_Pickup::TakeDamage (Entity_Pickup *this,float param_2,uint param_3,undefined4 param_4,int param_5) { Manager *pMVar1; byte bVar2; uint in_EAX; undefined3 extraout_var; Entity_Player *pEVar3; undefined3 extraout_var_00; Entity_Player *pEVar4; uint uVar5; uint extraout_EAX; uint extraout_EAX_00; int extraout_EDX; int iVar6; Entity_Pickup *local_c [2]; if ((param_2 <= 0.0) || (in_EAX = 0, (param_3 & 0x1000004) == 0)) goto LAB_006edf86; local_c[0] = this; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x88); in_EAX = CONCAT31(extraout_var,bVar2); if (1 < *(int *)&g_game->_deathmatchManager) { if (*(Entity **)(param_5 + 0x24) != (Entity *)0x0) { pEVar3 = (Entity_Player *)Entity::GetPlayerAncestor(*(Entity **)(param_5 + 0x24)); in_EAX = 0; if (pEVar3 != (Entity_Player *)0x0) { bVar2 = Entity_Player::HasTrinket(pEVar3,0x88,0); in_EAX = CONCAT31(extraout_var_00,bVar2); goto LAB_006ede17; } } in_EAX = in_EAX & 0xffffff00; } LAB_006ede17: iVar6 = this->_variant; if (((iVar6 == 0x33) || (((char)in_EAX != '\0' && (((((iVar6 == 0x3c || (iVar6 == 0x32)) || (iVar6 == 0x168)) || ((iVar6 == 0x35 || (iVar6 == 0x34)))) || ((iVar6 == 0x36 || ((iVar6 == 0x37 || (iVar6 == 0x39)))))))))) && (uVar5 = this->_subtype, uVar5 != 0)) { pEVar3 = (Entity_Player *)0x0; if (*(Entity **)(param_5 + 0x24) != (Entity *)0x0) { pEVar4 = (Entity_Player *)Entity::GetLastSpawner(*(Entity **)(param_5 + 0x24)); iVar6 = extraout_EDX; if ((pEVar4 != (Entity_Player *)0x0) && (pEVar4->_type == 1)) { pEVar3 = pEVar4; } } if ((iVar6 == 0x39) && (1 < uVar5)) { this->_subtype = uVar5 - 1; return uVar5 - 1 & 0xffffff00; } bVar2 = TryOpenChest(this,pEVar3); if ((bVar2 != 0) && (1 < *(int *)&g_game->_deathmatchManager)) { uVar5 = Random(); Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar5,0); pMVar1 = g_manager; local_c[0] = (Entity_Pickup *)0x109; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_c[0],0.7,2,0,1.0,0.0); (**(code **)(*(int *)this + 0x28))(); } in_EAX = *(uint *)((int)g_game->_room + 8); if ((in_EAX == 0xb) || (in_EAX == 0x11)) { Ambush::StartChallenge(&g_game->_ambush); return extraout_EAX & 0xffffff00; } } else if ((iVar6 == 0x14) && (this->_subtype == 6)) { this->_subtype = 2; this->_collisionCooldown = 0; ANM2::Play(&this->_sprite,s_Idle,0); in_EAX = extraout_EAX_00; } LAB_006edf86: return in_EAX & 0xffffff00; } //@@ 006edfa0 Entity_Pickup::update_cycle_collectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: thiscall Entity_Pickup: when _cycleCollectibleCount != 0 (subtype 0 resets it) and forced / on Entity::IsFrame / paused, rotates _cycleCollectibleList and morphs to the next collectible; Entity_Pickup::Update, netplay_lobby_menu_update prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Pickup::update_cycle_collectible(Entity_Pickup *this,byte isForce) { uint uVar1; void *pvVar2; byte bVar3; int frequency; double dVar4; int local_48; int local_44 [4]; int iStack_34; int local_30; int iStack_2c; int iStack_28; int iStack_24; uint local_14; local_14 = __security_cookie ^ (uint)&local_48; uVar1 = this->_cycleCollectibleCount; if (uVar1 == 0) { return; } frequency = (-(uint)(uVar1 < 4) & 0x18) + 6; if (7 < uVar1) { frequency = 1; } if (this->_subtype == 0) { this->_cycleCollectibleCount = 0; return; } if ((isForce == 0) && (((g_game->_frameCount - this->_spawnFrame < 1 || (bVar3 = Entity::IsFrame((Entity *)this,frequency,0), bVar3 == 0)) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)))) { return; } memcpy(local_44 + 1,this->_cycleCollectibleList + 1,uVar1 * 4 - 4); pvVar2 = (this->_sprite)._animState._animData; local_44[uVar1] = this->_subtype; local_44[0] = this->_wait; if (pvVar2 == (void *)0x0) { local_48 = -1; } else { dVar4 = floor((double)(this->_sprite)._animState._animFrame); local_48 = (int)dVar4; } Morph(this,this->_type,this->_variant,this->_cycleCollectibleList[0],1,1,1); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)local_48); } this->_wait = local_44[0]; this->_cycleCollectibleList[0] = local_44[1]; this->_cycleCollectibleList[1] = local_44[2]; this->_cycleCollectibleList[2] = local_44[3]; this->_cycleCollectibleList[3] = iStack_34; this->_cycleCollectibleCount = uVar1; this->_cycleCollectibleList[4] = local_30; this->_cycleCollectibleList[5] = iStack_2c; this->_cycleCollectibleList[6] = iStack_28; this->_cycleCollectibleList[7] = iStack_24; return; } //@@ 006ee110 Entity_Pickup::Remove /* ZHL [exact] void Remove(); */ void __thiscall Entity_Pickup::Remove(Entity_Pickup *this) { if (this->_pickupGhost != (int *)0x0) { (**(code **)(*(int *)this->_pickupGhost + 0x28))(); } Entity::Remove((Entity *)this); return; } //@@ 006ee130 Entity_Pickup::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_Pickup::ClearReferences(Entity_Pickup *this) { void **ppvVar1; Entity_Pickup *local_8; ppvVar1 = &this->_pickupGhost; local_8 = this; if (this->_pickupGhost != (int *)0x0) { (**(code **)(*(int *)this->_pickupGhost + 0x28))(); } if (this->_unkEntityRef != (EntityPtr)0x0) { local_8 = (Entity_Pickup *)&this->_unkEntityRef; std::multiset::erase(&local_8); this->_unkEntityRef = (EntityPtr)0x0; } if (*ppvVar1 != (void *)0x0) { local_8 = (Entity_Pickup *)ppvVar1; std::multiset::erase(&local_8); *ppvVar1 = (void *)0x0; } if (this->_megaChestCollectible[0] != (void *)0x0) { local_8 = (Entity_Pickup *)this->_megaChestCollectible; std::multiset::erase(&local_8); this->_megaChestCollectible[0] = (void *)0x0; } if (this->_megaChestCollectible[1] != (void *)0x0) { local_8 = (Entity_Pickup *)(this->_megaChestCollectible + 1); std::multiset::erase(&local_8); *(undefined4 *)(this->_megaChestCollectible + 1) = 0; } Entity::ClearReferences((Entity *)this); return; } //@@ 006ee200 Entity_Pickup::CanReroll /* ZHL [exact] __thiscall bool Entity_Pickup::CanReroll(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Pickup::CanReroll(Entity_Pickup *this) { int subType; int variant; byte bVar1; if (this->_dead == 0) { subType = this->_subtype; variant = this->_variant; bVar1 = CanRerollVariant(variant,subType); if (bVar1 != 0) { bVar1 = IsChest(variant); if ((bVar1 == 0) || (subType != 0)) { return 1; } } } return 0; } //@@ 006ee240 Entity_Pickup::CanRerollVariant /* ZHL [exact] static cleanup bool Entity_Pickup::CanRerollVariant(int variant, int subtype); prototype: db/protos.zhl */ byte __cdecl Entity_Pickup::CanRerollVariant(int variant,int subType) { Game *pGVar1; byte bVar2; char cVar3; ChallengeParam *pCVar4; Game *this; Game *this_00; Game *this_01; bool bVar5; pGVar1 = g_game; if (((((variant != 0x17c) && (variant != 0x172)) && (variant != 0x154)) && ((variant != 0x29 && (variant != 0x186)))) && ((variant != 100 || (subType != 0x29c)))) { bVar2 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (variant != 100) { return 1; } if ((bVar2 != 0) && (subType == -1)) { return 0; } if (subType == 0x272) { cVar3 = Game::IsChallengeOrDaily(pGVar1); if (cVar3 == '\0') { return 1; } pCVar4 = Game::GetChallengeParams(this); bVar5 = pCVar4->_pathType == 2; } else if (subType == 0x273) { cVar3 = Game::IsChallengeOrDaily(pGVar1); if (cVar3 == '\0') { return 1; } pCVar4 = Game::GetChallengeParams(this_00); bVar5 = pCVar4->_pathType == 2; } else { if ((subType != 0x147) && (subType != 0x148)) { return 1; } cVar3 = Game::IsChallengeOrDaily(pGVar1); if (cVar3 == '\0') { return 1; } pCVar4 = Game::GetChallengeParams(this_01); if (pCVar4->_pathType == 3) { return 0; } bVar5 = pCVar4->_endStage == 0xc; } if (!bVar5) { return 1; } } return 0; } //@@ 006ee330 FUN_006ee330 void FUN_006ee330(void) { int in_ECX; Entity_Pickup::IsChest(*(int *)(in_ECX + 0x2c)); return; } //@@ 006ee340 Entity_Pickup::IsChest /* ZHL [exact] static cleanup bool Entity_Pickup::IsChest(uint32_t variant); prototype: db/protos.zhl, confirmed by RET 0 */ byte __fastcall Entity_Pickup::IsChest(int variant) { if (((((variant == 0x32) || (variant == 0x3c)) || (variant == 0x168)) || ((((variant == 0x33 || (variant == 0x35)) || ((variant == 0x34 || ((variant == 0x36 || (variant == 0x186)))))) || (variant == 0x37)))) || (((variant == 0x38 || (variant == 0x39)) || (variant == 0x3a)))) { return 1; } return 0; } //@@ 006ee390 Entity_Pickup::CanBePickedUp /* ZHL [exact] __thiscall bool Entity_Pickup::CanBePickedUp(bool ignorePrice); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Pickup::CanBePickedUp(Entity_Pickup *this,byte ignorePrice) { int iVar1; iVar1 = this->_variant; if ((((((((iVar1 == 10) || (iVar1 == 0x14)) || (iVar1 == 0x5a)) || ((iVar1 == 0x28 || (iVar1 == 0x1e)))) || ((iVar1 == 0x46 || ((iVar1 == 300 || (iVar1 == 0x15e)))))) || (iVar1 == 0x45)) || ((iVar1 == 0x29 || (iVar1 == 0x2a)))) && ((ignorePrice != 0 || (this->_price == 0)))) { return 1; } return 0; } //@@ 006ee3f0 Entity_Pickup::CanJeraDuplicate /* ZHL [exact] __thiscall bool Entity_Pickup::CanJeraDuplicate(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Pickup::CanJeraDuplicate(Entity_Pickup *this) { int variant; byte bVar1; if ((((this->_dead == 0) && (variant = this->_variant, variant != 100)) && (variant != 0x15e)) && ((variant != 300 || (this->_subtype != 0x21)))) { bVar1 = CanReroll(this); if (bVar1 != 0) { bVar1 = IsChest(variant); if ((bVar1 == 0) || (this->_subtype != 0)) { return 1; } } } return 0; } //@@ 006ee440 Isaac::GetRandomPickupVelocity /* ZHL [exact] static __fastcall void Isaac::GetRandomPickupVelocity(Vector * buffer, Vector * position, unsigned int ePickupVelType, RNG * rng); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Vector * __cdecl Isaac::GetRandomPickupVelocity(Vector *outVelocity,Vector *position,uint pickupVelType,RNG *rng) { code *pcVar1; Game *pGVar2; byte bVar3; Vector *pVVar4; uint uVar5; uint uVar6; uint uVar7; float fVar8; float fVar9; int local_28; Vector local_20; undefined8 local_14; local_28 = 0; outVelocity->x = g_vectorZero.x; outVelocity->y = g_vectorZero.y; do { if (rng == (RNG *)0x0) { uVar5 = ::Random(); fVar8 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; } else { uVar5 = rng->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = rng->_seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); pVVar4 = (Vector *)(*pcVar1)(); return pVVar4; } } uVar5 = uVar5 >> ((byte)rng->_shift1 & 0x1f) ^ uVar5; local_14 = 0x100000003; uVar5 = uVar5 << ((byte)rng->_shift2 & 0x1f) ^ uVar5; uVar6 = uVar5 >> ((byte)rng->_shift3 & 0x1f); uVar7 = uVar6 ^ uVar5; rng->_seed = uVar7; if (uVar6 == uVar5) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pVVar4 = (Vector *)(*pcVar1)(); return pVVar4; } uVar7 = uVar7 >> 3 ^ uVar7; uVar7 = uVar7 << 1 ^ uVar7; uVar7 = uVar7 >> 0xe ^ uVar7; fVar8 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10; } fVar8 = fVar8 * 3.14 + fVar8 * 3.14; fVar9 = cos(fVar8); fVar9 = fVar9 * 5.0; fVar8 = sin(fVar8); pGVar2 = g_game; fVar8 = fVar8 * 5.0; outVelocity->x = fVar9; outVelocity->y = fVar8; if (pickupVelType == 0) { if (*(int *)((int)pGVar2->_room + 8) == 0xb) { fVar9 = fVar9 * 0.4; fVar8 = fVar8 * 0.4; outVelocity->x = fVar9; goto LAB_006ee5d1; } } else { fVar8 = fVar8 * 0.2 + 3.0; LAB_006ee5d1: outVelocity->y = fVar8; } local_20.x = fVar9 * 7.0 + position->x; local_20.y = fVar8 * 7.0 + position->y; bVar3 = Room::CheckLine(pGVar2->_room,position,&local_20,1,0,0,0,(Vector *)0x0); if (bVar3 != 0) { return outVelocity; } local_28 = local_28 + 1; if (9 < local_28) { return outVelocity; } } while( true ); } //@@ 006ee640 FUN_006ee640 int FUN_006ee640(int param_1,int param_2,uint *param_3,uint param_4) { code *pcVar1; Game *pGVar2; ItemPool *this; int iVar3; uint uVar4; int id; ItemConfig_Item *pIVar5; int iVar6; this = &g_game->_itemPool; uVar4 = *param_3; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *param_3; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)param_3[1] & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)param_3[2] & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)param_3[3] & 0x1f) ^ uVar4; *param_3 = uVar4; id = ItemPool::GetCollectible(this,param_1,uVar4,param_4 | 1,0,0); pIVar5 = ItemConfig::GetCollectible(&g_manager->_itemConfig,id); pGVar2 = g_game; iVar3 = pIVar5->quality; iVar6 = iVar3 + 1; if (2 < iVar3) { iVar6 = iVar3; } uVar4 = *param_3; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *param_3; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)param_3[1] & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)param_3[2] & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)param_3[3] & 0x1f) ^ uVar4; *param_3 = uVar4; iVar3 = ItemPool::GetCollectible (&pGVar2->_itemPool,param_1,uVar4, ~(0x10 << ((byte)iVar6 & 0x1f)) & (param_4 | 0x1f0),0,param_2); if (iVar3 == 0x19) { iVar3 = id; } return iVar3; } //@@ 006ee750 Entity_Pickup::RemoveOtherOptions /* DB: pickups with same OptionsPickupIndex 0x528 poof (1000.15) and vanish */ void Entity_Pickup::RemoveOtherOptions(void) { int *piVar1; qword qVar2; uint uVar3; uint uVar4; void *listData; Entity_Pickup *in_ECX; qword *heapCounter; uint i; EntityList_EL collectibles; undefined1 local_28 [12]; float local_1c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Pickup *other; Game *game; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afb275; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; if (in_ECX->_optionsPickupIndex != 0) { if ((((in_ECX->_optionsPickupIndex == 1) && (in_ECX->_variant == 100)) && (g_game->_currentDimensionIdx == 2)) && (g_game->_deathCertificateExitTimer < 1)) { g_game->_deathCertificateExitTimer = 0x5a; } EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),(EntityList_EL *)local_28,5,-1,-1,0,0); i = 0; local_8 = 0; if (local_1c != 0.0) { listData = (void *)local_28._4_4_; do { other = *(Entity_Pickup **)((int)listData + i * 4); if ((other != (Entity_Pickup *)0x0) && (other->_type == 5)) { if (((other->_optionsPickupIndex == in_ECX->_optionsPickupIndex) && (other != in_ECX)) && ((other->_variant != 100 || (other->_subtype != 0)))) { uVar4 = Random(); local_18.x = (other->_pos).x + 0.0; local_18.y = (other->_pos).y + 10.0; Game::Spawn(g_game,1000,0xf,&local_18,&g_vectorZero,(Entity *)0x0,0,uVar4); if (other->_variant == 100) { other->_timeout = 4; } else { (**(code **)(*(int *)other + 0x28))(uVar3); } } listData = (void *)local_28._4_4_; } i = i + 1; } while (i < (uint)local_1c); } local_8 = 0xffffffff; in_ECX->_optionsPickupIndex = 0; if (local_28[0] == '\0') { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_28._4_4_ != (void *)0x0) { uVar3 = *(uint *)(local_28._4_4_ + -4); qVar2 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar3; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar2 < uVar3); free((uint *)(local_28._4_4_ + -4)); } } } local_8 = 0xffffffff; if (((in_ECX->_variant == 100) && (g_game->_currentRoomIdx == -0xc)) && ((in_ECX->_flags & 0x40000) != 0)) { local_18.y = (float)g_game->_room; EntityList::QuerySublist((EntityList *)((int)local_18.y + 0x1218),&collectibles,5,100,-1,0,0); local_8 = 2; uVar4 = 0; uVar3 = collectibles._size; if (collectibles._size != 0) { do { piVar1 = *(int **)((int)collectibles._data + uVar4 * 4); if (((piVar1 != (int *)0x0) && (piVar1[10] == 5)) && ((piVar1[0x5a] & 0x40000U) != 0)) { uVar3 = Random(); local_28._8_4_ = (float)piVar1[0xcf] + 0.0; local_1c = (float)piVar1[0xd0] + 10.0; Game::Spawn(g_game,1000,0xf,(Vector *)(local_28 + 8),&g_vectorZero,(Entity *)0x0,0,uVar3); (**(code **)(*piVar1 + 0x28))(); uVar3 = collectibles._size; } uVar4 = uVar4 + 1; } while (uVar4 < uVar3); } *(undefined4 *)((int)local_18.y + 0x7764) = 10; if (collectibles._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if (collectibles._data != (void *)0x0) { uVar3 = *(uint *)((int)collectibles._data + -4); qVar2 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar3; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar2 < uVar3); free((void *)((int)collectibles._data + -4)); } } } ExceptionList = local_10; return; } //@@ 006eea30 Entity_Pickup::MakeShopItem /* DB: sets ShopItemId +0x53c, Price +0x534 via GetShopItemPrice prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Pickup::MakeShopItem(Entity_Pickup *this,int shopId) { Game *pGVar1; int iVar2; pGVar1 = g_game; if (this->_price == 0) { this->_shopItemId = shopId; iVar2 = Room::GetShopItemPrice (pGVar1->_room,this->_variant,this->_subtype,shopId,(Entity_Player *)0x0); this->_price = iVar2; iVar2 = _Room::ResolveHeartSubType(0xffffffff,iVar2,0); this->_price = iVar2; update_price_sprite(this,iVar2); } return; } //@@ 006eeaa0 Isaac::GetCollectibleSpawnPosition /* ZHL [exact] static __x86_64_output Vector Isaac::GetCollectibleSpawnPosition(Vector* target); */ Vector * Isaac::GetCollectibleSpawnPosition(void) { Room *this; bool bVar1; Game *pGVar2; uint uVar3; Vector *pVVar4; Vector *in_ECX; int iVar5; float *in_EDX; int iVar6; int *piVar7; void *pvVar8; bool bVar9; float fVar10; float fVar11; float fVar12; float fVar13; int local_1c; Vector local_10; fVar12 = in_EDX[1]; in_ECX->x = *in_EDX; bVar1 = false; in_ECX->y = fVar12; local_1c = 1; pvVar8 = g_game->_room; do { pGVar2 = g_game; fVar13 = *in_EDX + 0.0; fVar12 = (float)local_1c * 40.0 + in_EDX[1]; iVar6 = (int)((fVar13 - 40.0) / 40.0 + 0.5); if ((((((-1 < iVar6) && (iVar6 < *(int *)((int)pvVar8 + 0xc))) && (iVar5 = (int)((fVar12 - 120.0) / 40.0 + 0.5), -1 < iVar5)) && ((iVar5 < *(int *)((int)pvVar8 + 0x10) && (uVar3 = *(int *)((int)pvVar8 + 0xc) * iVar5 + iVar6, uVar3 < 0x1c0)))) && (iVar6 = *(int *)((int)pvVar8 + uVar3 * 4 + 0x24), iVar6 != 0)) && (((*(int *)(iVar6 + 0x3c) != 0 || (iVar6 = *(int *)(iVar6 + 4), iVar6 == 8)) || ((iVar6 == 0x11 || ((iVar6 == 0x12 || (iVar6 == 9)))))))) break; in_ECX->x = fVar13; in_ECX->y = fVar12; pvVar8 = pGVar2->_room; bVar1 = true; iVar6 = *(int *)((int)pvVar8 + 0x1264); if (iVar6 != 0) { piVar7 = *(int **)((int)pvVar8 + 0x125c); do { iVar5 = *piVar7; if (*(int *)(iVar5 + 0x28) == 5) { bVar9 = *(int *)(iVar5 + 0x2c) == 100; LAB_006eebdf: if ((bVar9) && (fVar10 = *(float *)(iVar5 + 0x33c) - fVar13, fVar11 = *(float *)(iVar5 + 0x340) - fVar12, fVar11 * fVar11 + fVar10 * fVar10 < 400.0) ) { bVar1 = false; } } else if (*(int *)(iVar5 + 0x28) == 6) { bVar9 = *(char *)(iVar5 + 0x173) == '\0'; goto LAB_006eebdf; } piVar7 = piVar7 + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); } local_1c = local_1c + 1; } while (local_1c < 3); if (!bVar1) { pVVar4 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,in_ECX,0.0,0,0,0); in_ECX->x = pVVar4->x; in_ECX->y = pVVar4->y; } iVar6 = 0; this = g_game->_room; while ((this->_doors[iVar6] == (void *)0x0 || (iVar5 = *(int *)((int)this->_doors[iVar6] + 0x24), fVar12 = ((float)(iVar5 / this->_gridWidth) * 40.0 + 120.0) - in_ECX->y, fVar13 = ((float)(iVar5 % this->_gridWidth) * 40.0 + 40.0) - in_ECX->x, 2500.0 <= fVar12 * fVar12 + fVar13 * fVar13))) { iVar6 = iVar6 + 1; if (7 < iVar6) { return in_ECX; } } if (-1 < iVar6) { pVVar4 = Room::FindFreePickupSpawnPosition(this,&local_10,in_ECX,40.0,0,0,0); in_ECX->x = pVVar4->x; in_ECX->y = pVVar4->y; } return in_ECX; } //@@ 006eed30 Entity_Pickup::AssignOptionsIndex /* DB: ? max +0x528 over pickups +1 prototype: db/protos.zhl */ int __thiscall Entity_Pickup::AssignOptionsIndex(Entity_Pickup *this) { Entity_Pickup *pEVar1; qword qVar2; qword *pqVar3; uint uVar4; int iVar5; EntityList_EL local_20; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = 2; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_20,5,-1,-1,0,0); uVar4 = 0; if (local_20._size != 0) { do { pEVar1 = *(Entity_Pickup **)((int)local_20._data + uVar4 * 4); if ((((pEVar1 != (Entity_Pickup *)0x0) && (pEVar1->_type == 5)) && (pEVar1 != this)) && (iVar5 < pEVar1->_optionsPickupIndex)) { iVar5 = pEVar1->_optionsPickupIndex; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_20._size); } this->_optionsPickupIndex = iVar5 + 1; if (local_20._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } if (local_20._data != (void *)0x0) { uVar4 = *(uint *)((int)local_20._data + -4); qVar2 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar4; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar2 < uVar4); free((void *)((int)local_20._data + -4)); } } ExceptionList = local_10; return iVar5 + 1; } //@@ 006eee10 EntitySaveStateRef::Set /* DB: ReferenceCount alloc prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall EntitySaveStateRef::Set(void *this,void *state) { char cVar1; uint uVar2; ReferenceCountBase *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this_00 = operator_new(0x18); local_8 = 0; if (this_00 == (ReferenceCountBase *)0x0) { this_00 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this_00); *(undefined ***)this_00 = ReferenceCount::vftable; *(void **)(this_00 + 0x14) = state; } local_8 = 0xffffffff; if (*(int **)((int)this + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 4) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(this); } } *(ReferenceCountBase **)((int)this + 4) = this_00; *(void **)this = state; ExceptionList = local_10; return; } //@@ 006eeeb0 FUN_006eeeb0 undefined4 FUN_006eeeb0(void) { void *owner; short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); owner = (void *)in_ECX[5]; if (owner != (void *)0x0) { invoke_pending_callbacks(owner); operator_delete(owner,0x78); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x006eef04. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 006eef20 FUN_006eef20 void FUN_006eef20(void) { undefined4 in_ECX; DAT_00c34f04 = 1; DAT_00c7ac70 = in_ECX; do { (&DAT_00c7ac70)[DAT_00c34f04] = ((uint)(&DAT_00c7ac6c)[DAT_00c34f04] >> 0x1e ^ (&DAT_00c7ac6c)[DAT_00c34f04]) * 0x6c078965 + DAT_00c34f04; DAT_00c34f04 = DAT_00c34f04 + 1; } while (DAT_00c34f04 < 0x270); return; } //@@ 006eef60 Random /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: global MT19937 genrand (624-word state, tempering) with rand() fallback; ZHL `unsigned int Random()`; result used as spawn seed prototype: db/protos.zhl */ uint __cdecl Random(void) { uint *puVar1; int *ptr; Manager *pMVar2; uint uVar3; int iVar4; undefined4 *puVar5; uint uVar6; undefined4 *puVar7; uint *puVar8; undefined4 *puVar9; undefined4 local_12c [67]; undefined4 **local_20; undefined4 local_1c; uint local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb2ad; local_10 = ExceptionList; ExceptionList = &local_10; if (DAT_00c7ac68 != '\0') { uVar3 = rand(); ExceptionList = local_10; return uVar3; } if (0x26f < DAT_00c34f04) { if (DAT_00c34f04 == 0x271) { FUN_006eef20(__security_cookie ^ (uint)(local_12c + 0x4a)); } iVar4 = 0; do { uVar3 = ((&DAT_00c7ac74)[iVar4] ^ (&DAT_00c7ac70)[iVar4]) & 0x7fffffff ^ (&DAT_00c7ac70)[iVar4]; (&DAT_00c7ac70)[iVar4] = uVar3 >> 1 ^ (uint)(&PTR_00b67f8c)[uVar3 & 1] ^ (&DAT_00c7b2a4)[iVar4]; iVar4 = iVar4 + 1; } while (iVar4 < 0xe3); uVar3 = (&DAT_00c7ac70)[iVar4]; puVar8 = &DAT_00c7ac70 + iVar4; do { puVar1 = puVar8 + 1; uVar3 = (uVar3 ^ *puVar1) & 0x7fffffff ^ uVar3; *puVar8 = (uint)(&PTR_00b67f8c)[uVar3 & 1] ^ puVar8[-0xe3] ^ uVar3 >> 1; uVar3 = *puVar1; puVar8 = puVar1; } while ((int)puVar1 < 0xc7b62c); _DAT_00c7b62c = (DAT_00c7ac70 ^ _DAT_00c7b62c) & 0x7fffffff ^ _DAT_00c7b62c; _DAT_00c7b62c = _DAT_00c7b62c >> 1 ^ (uint)(&PTR_00b67f8c)[_DAT_00c7b62c & 1] ^ _DAT_00c7b2a0; DAT_00c34f04 = 0; } puVar8 = &DAT_00c7ac70 + DAT_00c34f04; DAT_00c34f04 = DAT_00c34f04 + 1; local_18 = *puVar8 ^ *puVar8 >> 0xb; local_18 = local_18 ^ (local_18 & 0xff3a58ad) << 7; local_18 = local_18 ^ (local_18 & 0xffffdf8c) << 0xf; local_18 = local_18 ^ local_18 >> 0x12; memset(local_12c,0,0x10c); local_14 = DAT_00c79864; if (DAT_00c79868 == 0xed7303) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_20 = &DAT_00c79864; local_8 = 0; local_1c = 0; puVar5 = operator_new(0x114); puVar7 = local_12c; puVar9 = puVar5 + 2; for (iVar4 = 0x43; iVar4 != 0; iVar4 = iVar4 + -1) { *puVar9 = *puVar7; puVar7 = puVar7 + 1; puVar9 = puVar9 + 1; } DAT_00c79868 = DAT_00c79868 + 1; puVar7 = (undefined4 *)local_14[1]; *puVar5 = local_14; puVar5[1] = puVar7; local_14[1] = puVar5; *puVar7 = puVar5; iVar4 = DAT_00c79864[1]; memset((void *)(iVar4 + 0xc),0,0x108); uVar3 = local_18; pMVar2 = g_manager; *(uint *)(iVar4 + 8) = local_18; *(int *)(iVar4 + 0xc) = pMVar2[1]._state; uVar6 = RtlCaptureStackBackTrace(0,0x40,iVar4 + 0x10,0); *(uint *)(iVar4 + 0x110) = uVar6 & 0xffff; while ((DAT_00c79868 != 0 && (ptr = (int *)*DAT_00c79864, (uint)ptr[3] < (g_manager[1]._state + g_manager[1]._previousState * -2) - 2U))) { *(int *)ptr[1] = *ptr; *(int *)(*ptr + 4) = ptr[1]; DAT_00c79868 = DAT_00c79868 + -1; operator_delete(ptr,0x114); } ExceptionList = local_10; return uVar3; } //@@ 006ef1f0 get_mt_state_checksum /* DB: CRC32 (poly 0xedb88320, lazily built table) over 0x9c0 bytes at 0x00c7ac70 (624 dwords = Mersenne Twister state) plus the dword at 0x00c34f04 (MT index); printed as "Global Seed = %08x" in NpcAI::ENTITY_ULTRA_GREED desync log and fed to Checksum::Update in EntityList::Update */ uint get_mt_state_checksum(void) { int iVar1; uint uVar2; uint uVar3; if (DAT_00c7ec74 == 0) { uVar3 = 0; do { uVar2 = -(uint)((uVar3 & 1) != 0) & 0xedb88320 ^ uVar3 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar2 = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; (&DAT_00c7ec70)[uVar3] = -(uint)((uVar2 & 1) != 0) & 0xedb88320 ^ (int)uVar2 >> 1; uVar3 = uVar3 + 1; } while ((int)uVar3 < 0x100); } uVar3 = 0xffffffff; uVar2 = 0; do { uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[(uint)*(byte *)((int)&DAT_00c7ac70 + uVar2) ^ uVar3 & 0xff] ; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[uVar3 & 0xff ^ (uint)*(byte *)((int)&DAT_00c7ac70 + uVar2 + 1)]; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[(uint)*(byte *)((int)&DAT_00c7ac70 + uVar2 + 2) ^ uVar3 & 0xff]; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[(uint)*(byte *)((int)&DAT_00c7ac70 + uVar2 + 3) ^ uVar3 & 0xff]; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[(uint)*(byte *)((int)&DAT_00c7ac74 + uVar2) ^ uVar3 & 0xff] ; iVar1 = uVar2 + 1; uVar2 = uVar2 + 6; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[(uint)*(byte *)((int)&DAT_00c7ac74 + iVar1) ^ uVar3 & 0xff] ; } while (uVar2 < 0x9c0); uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[uVar3 & 0xff ^ DAT_00c34f04 & 0xff]; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[uVar3 & 0xff ^ DAT_00c34f04 >> 8 & 0xff]; uVar3 = uVar3 >> 8 ^ (&DAT_00c7ec70)[uVar3 & 0xff ^ DAT_00c34f04 >> 0x10 & 0xff]; return ~(uVar3 >> 8 ^ (&DAT_00c7ec70)[uVar3 & 0xff ^ DAT_00c34f04 >> 0x18]); } //@@ 006ef3c0 Item::IsAvailable /* ZHL [lua] Lua binding Item:IsAvailable prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Item::IsAvailable(void *this,uint flags) { byte bVar1; bVar1 = IsAvailable(this,(flags & 0xff ^ 1) * 2 - 3); return bVar1; } //@@ 006ef3e0 RoomConfigRoom::dtor /* DB: src/rooms decompile labels (RoomConfigRoom::dtor (name only)) */ void RoomConfigRoom::dtor(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x14)); return; } //@@ 006ef3f0 FUN_006ef3f0 int FUN_006ef3f0(void) { int in_ECX; return in_ECX + 0x44; } //@@ 006ef400 Entity::SpawnGridIndex /* ZHL [lua] Lua binding Entity:SpawnGridIndex */ int __thiscall Entity::SpawnGridIndex(Entity *this) { return this->_spawnGridIndex; } //@@ 006ef410 ColorModState::move_toward /* DB: ECX 6-float color mod (R,G,B,A,brightness,contrast): each component moves toward arg1 target by at most arg2 step; Game::Update calls it while _shouldLerpColorModState and compares the result with the target at Game+0x676d0; MenuManager::Update uses it for the menu color mod */ void ColorModState::move_toward(float *param_1,float *param_2) { float fVar1; float fVar2; float *in_ECX; float fVar3; fVar1 = *in_ECX; fVar3 = *param_1; fVar2 = *param_2; if (fVar2 < ABS(fVar1 - fVar3)) { if (fVar3 <= fVar1) { fVar3 = fVar1 - fVar2; } else { fVar3 = fVar1 + fVar2; } } fVar1 = in_ECX[1]; *in_ECX = fVar3; fVar3 = param_1[1]; fVar2 = param_2[1]; if (fVar2 < ABS(fVar1 - fVar3)) { if (fVar3 <= fVar1) { fVar3 = fVar1 - fVar2; } else { fVar3 = fVar1 + fVar2; } } fVar1 = in_ECX[2]; in_ECX[1] = fVar3; fVar3 = param_1[2]; fVar2 = param_2[2]; if (fVar2 < ABS(fVar1 - fVar3)) { if (fVar3 <= fVar1) { fVar3 = fVar1 - fVar2; } else { fVar3 = fVar1 + fVar2; } } fVar1 = in_ECX[3]; in_ECX[2] = fVar3; fVar3 = param_1[3]; fVar2 = param_2[3]; if (fVar2 < ABS(fVar1 - fVar3)) { if (fVar3 <= fVar1) { fVar3 = fVar1 - fVar2; } else { fVar3 = fVar1 + fVar2; } } fVar1 = in_ECX[4]; in_ECX[3] = fVar3; fVar3 = param_1[4]; fVar2 = param_2[4]; if (fVar2 < ABS(fVar1 - fVar3)) { if (fVar3 <= fVar1) { fVar3 = fVar1 - fVar2; } else { fVar3 = fVar1 + fVar2; } } in_ECX[4] = fVar3; fVar1 = in_ECX[5]; fVar3 = param_1[5]; fVar2 = param_2[5]; if (ABS(fVar1 - fVar3) <= fVar2) { in_ECX[5] = fVar3; return; } if (fVar1 < fVar3) { in_ECX[5] = fVar1 + fVar2; return; } in_ECX[5] = fVar1 - fVar2; return; } //@@ 006ef570 FUN_006ef570 void FUN_006ef570(void) { FUN_00708c10(); FUN_00708c10(); return; } //@@ 006ef590 RoomDescriptor::constructor /* ZHL [exact] __thiscall RoomConfig_Room* RoomDescriptor::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ RoomConfig_Room * __thiscall RoomDescriptor::constructor(RoomDescriptor *this) { void *pvVar1; void *pvVar2; undefined4 *gridSave; int gridSavesLeft; uint gridSaveOffset; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb307; local_10 = ExceptionList; ExceptionList = &local_10; this->GridIndex = -1; this->SafeGridIndex = -1; this->ListIndex = -1; this->Dimension = 0; this->Data = (void *)0x0; this->OverrideData = (void *)0x0; this->AllowedDoors = 0; this->DisplayFlags = 0; this->VisitedCount = 0; this->Flags = 0; this->TotalMoneySpent = 0; this->ClearCount = 0; this->GreedSubType = 0; this->PoopCount = 0; this->TKeeperCoinSpawns = 0; this->PitsCount = 0; this->DecorationSeed = 0; this->SpawnSeed = 0; this->AwardSeed = 0; this->BossDeathSeed = 0; (this->SavedGridEntities)._begin = (void *)0x0; (this->SavedGridEntities)._end = (void *)0x0; (this->SavedGridEntities)._capacity = (void *)0x0; pvVar1 = operator_new(0x3823); if (pvVar1 == (void *)0x0) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } pvVar2 = (void *)((int)pvVar1 + 0x23U & 0xffffffe0); *(void **)((int)pvVar2 - 4) = pvVar1; gridSavesLeft = 0x1c0; (this->SavedGridEntities)._begin = pvVar2; (this->SavedGridEntities)._capacity = (void *)((int)pvVar2 + 0x3800); gridSave = (this->SavedGridEntities)._begin; do { *gridSave = 0; gridSave[1] = 0; gridSave[2] = 0; gridSave[3] = 0; gridSave[4] = 0x16a9de81; gridSave[5] = 0; *(undefined1 *)(gridSave + 6) = 0; gridSave[7] = 0x16a9de81; gridSave = gridSave + 8; gridSavesLeft = gridSavesLeft + -1; } while (gridSavesLeft != 0); (this->SavedGridEntities)._end = gridSave; (this->SavedEntities)._begin = (void *)0x0; (this->SavedEntities)._end = (void *)0x0; (this->SavedEntities)._capacity = (void *)0x0; local_8._1_3_ = 0; local_8._0_1_ = 1; (this->RestrictedGridIndexes)._head = (void *)0x0; (this->RestrictedGridIndexes)._size = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; (this->RestrictedGridIndexes)._head = pvVar1; (this->SavedEffects)._begin = (void *)0x0; (this->SavedEffects)._end = (void *)0x0; (this->SavedEffects)._capacity = (void *)0x0; local_8 = CONCAT31(local_8._1_3_,3); this->ShopItemIdx = -1; this->ShopItemDiscountIdx = -1; this->DeliriumDistance = 0; this->Group = -1; pvVar1 = (this->SavedEntities)._end; pvVar2 = (this->SavedEntities)._begin; if (pvVar2 != pvVar1) { do { invoke_pending_callbacks(pvVar2); pvVar2 = (void *)((int)pvVar2 + 0x78); } while (pvVar2 != pvVar1); pvVar2 = (this->SavedEntities)._begin; } (this->SavedEntities)._end = pvVar2; if ((uint)(((int)(this->SavedEntities)._capacity - (int)(this->SavedEntities)._begin) / 0x78) < 0x10) { std::vector::_Reallocate_exactly(0x10); } pvVar1 = (this->SavedEffects)._end; pvVar2 = (this->SavedEffects)._begin; if (pvVar2 != pvVar1) { do { invoke_pending_callbacks(pvVar2); pvVar2 = (void *)((int)pvVar2 + 0x78); } while (pvVar2 != pvVar1); pvVar2 = (this->SavedEffects)._begin; } (this->SavedEffects)._end = pvVar2; if ((uint)(((int)(this->SavedEffects)._capacity - (int)(this->SavedEffects)._begin) / 0x78) < 0x20 ) { std::vector::_Reallocate_exactly(0x20); } pvVar1 = (this->RestrictedGridIndexes)._head; FID_conflict__Erase_tree_>_> (&this->RestrictedGridIndexes, (fuzzer_allocator_> *)&this->RestrictedGridIndexes, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; gridSaveOffset = 0; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; (this->RestrictedGridIndexes)._size = 0; this->_doors[0] = -1; this->_doors[1] = -1; this->_doors[2] = -1; this->_doors[3] = -1; this->_doors[4] = -1; this->_doors[5] = -1; this->_doors[6] = -1; this->_doors[7] = -1; do { *(undefined4 *)(gridSaveOffset + (int)(this->SavedGridEntities)._begin) = 0; gridSaveOffset = gridSaveOffset + 0x20; } while (gridSaveOffset < 0x3800); *(undefined4 *)&this->field_0x94 = 0; *(undefined4 *)&this->field_0x98 = 0; *(undefined4 *)&this->field_0x9c = 0; *(undefined4 *)&this->field_0xa0 = 0; ExceptionList = local_10; return (RoomConfig_Room *)this; } //@@ 006ef880 Level::LeaveDoor /* ZHL [lua] Lua binding Level:LeaveDoor */ int __thiscall Level::LeaveDoor(Level *this) { return this->_leaveDoor; } //@@ 006ef890 Seeds::GetNextSeed /* ZHL [lua] Lua binding Seeds:GetNextSeed */ void __thiscall Seeds::GetNextSeed(Seeds *this) { code *pcVar1; uint uVar2; if (this->_gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } uVar2 = (this->_rng)._seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_rng)._seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar2; (this->_rng)._seed = uVar2 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar2; return; } //@@ 006ef8f0 Seeds::AddSeedEffect /* ZHL [lua] Lua binding Seeds:AddSeedEffect prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Seeds::AddSeedEffect(Seeds *this,int seedEffect) { undefined1 local_10 [12]; if ((uint)seedEffect < 0x50) { std::set::insert(local_10,&seedEffect); } return; } //@@ 006ef920 FUN_006ef920 void FUN_006ef920(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb34b; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_constructor_iterator_ (in_ECX,0xb8,2,RoomDescriptor::constructor,RoomDescriptor::destructor); local_8 = 0; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x188),0xb8,2,RoomDescriptor::constructor, RoomDescriptor::destructor); *(undefined4 *)((int)in_ECX + 0x310) = 0; *(undefined4 *)((int)in_ECX + 0x314) = 0; *(undefined4 *)((int)in_ECX + 0x318) = 0; *(undefined1 *)((int)in_ECX + 0x31c) = 0; ExceptionList = local_10; return; } //@@ 006ef9c0 RoomDescriptor::destructor /* ZHL [exact] __thiscall void RoomDescriptor::destructor(); */ void __thiscall RoomDescriptor::destructor(RoomDescriptor *this) { std_set *this_00; std::vector::_Tidy(); this_00 = &this->RestrictedGridIndexes; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)(this->RestrictedGridIndexes)._head + 4)); operator_delete(this_00->_head,0x14); std::vector::_Tidy(); FUN_00708f90(); return; } //@@ 006efa40 FUN_006efa40 void FUN_006efa40(void) { undefined4 *puVar1; undefined4 *in_ECX; int iVar2; *in_ECX = 0; iVar2 = 10; puVar1 = in_ECX + 1; do { *puVar1 = 0; puVar1[1] = 0; puVar1[2] = 0; puVar1[3] = 0x3c23d70a; puVar1[4] = 0; iVar2 = iVar2 + -1; puVar1 = puVar1 + 5; } while (iVar2 != 0); return; } //@@ 006efac0 FUN_006efac0 void FUN_006efac0(void) { undefined4 *puVar1; char cVar2; uint uVar3; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afb38f; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar1 = in_ECX + 2; *puVar1 = 0; in_ECX[3] = 0; local_8 = 0; in_ECX[5] = 0; in_ECX[4] = 0; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8._0_1_ = 1; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = (uint)local_8._1_3_ << 8; if ((int *)in_ECX[3] != (int *)0x0) { cVar2 = (**(code **)(*(int *)in_ECX[3] + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(puVar1); } } in_ECX[3] = this; *puVar1 = 0; ExceptionList = local_10; return; } //@@ 006efb90 FUN_006efb90 void FUN_006efb90(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE::SmartPointer::reset((void *)(in_ECX + 8),(void *)0x0); local_8 = 0; if (*(int **)(in_ECX + 0xc) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0xc) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((void *)(in_ECX + 8)); } } ExceptionList = local_10; return; } //@@ 006efc00 FUN_006efc00 void FUN_006efc00(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb3c0; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::constructor((ANM2 *)(in_ECX + 2)); local_8 = 0; *in_ECX = 0; in_ECX[1] = 0; ANM2::Reset((ANM2 *)(in_ECX + 2)); ExceptionList = local_10; return; } //@@ 006efc70 FUN_006efc70 void FUN_006efc70(void) { undefined4 *puVar1; undefined4 *in_ECX; int iVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb415; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; *(undefined4 *)((int)in_ECX + 10) = 0; iVar2 = 0x18; *(undefined1 *)((int)in_ECX + 0xe) = 0; puVar1 = in_ECX; do { puVar1[4] = 0; puVar1[6] = &s_empty; puVar1[7] = &s_empty; *(undefined1 *)(puVar1 + 5) = 0; iVar2 = iVar2 + -1; puVar1 = puVar1 + 4; } while (iVar2 != 0); _eh_vector_constructor_iterator_ (in_ECX + 100,0x1c,4,(_func_void_void_ptr *)&LAB_006efa80,FUN_006eff00); local_8 = 0; _eh_vector_constructor_iterator_(in_ECX + 0x80,0x18,2,FUN_006efac0,FUN_006efb90); local_8 = CONCAT31(local_8._1_3_,1); _eh_vector_constructor_iterator_(in_ECX + 0x8c,0x11c,4,FUN_006efc00,FUN_006effa0); in_ECX[0x1a8] = 0; in_ECX[0x1a9] = 0; in_ECX[0x1aa] = 0; *(undefined2 *)(in_ECX + 0x1ab) = 0; in_ECX[0x1ac] = 0; in_ECX[0x1ad] = 0; in_ECX[0x1ae] = 0; in_ECX[0x1b3] = 0; in_ECX[0x1b4] = 0; in_ECX[0x1af] = 0x4b189680; in_ECX[0x1b0] = 0x4b189680; in_ECX[0x1b1] = 0xcb189680; in_ECX[0x1b2] = 0xcb189680; in_ECX[0x1b5] = 0; in_ECX[0x1b6] = 0; ExceptionList = local_10; return; } //@@ 006efde0 FUN_006efde0 void FUN_006efde0(void) { char cVar1; uint uVar2; PlayerHUD *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb440; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; PlayerHUD::reset(in_ECX); local_8 = 0; if (*(int **)&in_ECX[1].field_0x28 != (int *)0x0) { cVar1 = (**(code **)(**(int **)&in_ECX[1].field_0x28 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&in_ECX[1].field_0x24); } } local_8 = 1; if (*(int **)&in_ECX[1].field_0x20 != (int *)0x0) { cVar1 = (**(code **)(**(int **)&in_ECX[1].field_0x20 + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&in_ECX[1].field_0x1c); } } local_8 = 2; if (in_ECX[1]._HUD != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1]._HUD + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 1); } } local_8 = 0xffffffff; FUN_00708a60(); _eh_vector_destructor_iterator_(&in_ECX->field_0x230,0x11c,4,FUN_006effa0); _eh_vector_destructor_iterator_(&in_ECX->field_0x200,0x18,2,FUN_006efb90); _eh_vector_destructor_iterator_(in_ECX->_activeItem,0x1c,4,FUN_006eff00); ExceptionList = local_10; return; } //@@ 006eff00 FUN_006eff00 void FUN_006eff00(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 0x14) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x14) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x10); } } local_8 = 1; if (*(int **)(in_ECX + 0xc) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0xc) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 8); } } ExceptionList = local_10; return; } //@@ 006effa0 FUN_006effa0 void FUN_006effa0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x58)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 006f0010 FUN_006f0010 undefined1 FUN_006f0010(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x52); } //@@ 006f0020 Entity_Player::SetSoulCharge /* ZHL [lua] Lua binding EntityPlayer:SetSoulCharge */ void __thiscall Entity_Player::SetSoulCharge(Entity_Player *this,int param_2) { this->_effectiveSoulCharge = param_2; return; } //@@ 006f0030 Entity_Player::SetBloodCharge /* ZHL [lua] Lua binding EntityPlayer:SetBloodCharge */ void __thiscall Entity_Player::SetBloodCharge(Entity_Player *this,int param_2) { this->_effectiveBloodCharge = param_2; return; } //@@ 006f0040 FUN_006f0040 int FUN_006f0040(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x1e68); uVar2 = (uint3)((uint)iVar1 >> 8); if ((((iVar1 == 0) || (*(int *)(iVar1 + 0x161c) == -1)) || (*(int *)(in_ECX + 0x161c) <= *(int *)(iVar1 + 0x161c))) || (iVar1 == in_ECX)) { return (uint)uVar2 << 8; } return CONCAT31(uVar2,1); } //@@ 006f0070 Game::IsRoomTransitionActive /* DB: ? returns this[0]!=0 && this[0x8e]!=0 */ undefined1 Game::IsRoomTransitionActive(void) { int *in_ECX; if ((*in_ECX == 0) || (in_ECX[0x8e] == 0)) { return 0; } return 1; } //@@ 006f0090 EntityFactory::Create /* DB: pool alloc by type (1000 -> effect ring of 0x400), strings 'EntityFactory cannot spawn Entity_Player' prototype: REPENTOGON, confirmed by RET 8 */ Entity * __thiscall EntityFactory::Create(void *this,uint type,byte force) { char cVar1; uint slot; uint tries; undefined *npcPool; bool isRetrying; if ((int)type < 0x3e9) { if (type == 1000) { tries = 0; do { slot = *(int *)((int)this + 0x130000) + 1U & 0x3ff; *(uint *)((int)this + 0x130000) = slot; cVar1 = *(char *)(slot * 0x4c0 + 0x170 + (int)this); if (cVar1 == '\0') goto LAB_006f0d18; isRetrying = tries < 0x401; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)(slot * 0x4c0 + (int)this) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x130000) + 1U & 0x3ff; *(uint *)((int)this + 0x130000) = slot; cVar1 = (**(code **)(*(int *)(slot * 0x4c0 + (int)this) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x400; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)(*(int *)((int)this + 0x130000) * 0x4c0 + (int)this) + 0x38)) (); if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5db84,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)(*(int *)((int)this + 0x130000) * 0x4c0 + 0x177 + (int)this) = 1; (**(code **)(*(int *)(*(int *)((int)this + 0x130000) * 0x4c0 + (int)this) + 0x28))(); (**(code **)(*(int *)(*(int *)((int)this + 0x130000) * 0x4c0 + (int)this) + 0x44))(); *(undefined1 *)(*(int *)((int)this + 0x130000) * 0x4c0 + 0x177 + (int)this) = 0; slot = *(uint *)((int)this + 0x130000); } LAB_006f0d18: return (Entity *)(slot * 0x4c0 + (int)this); } switch(type) { case 1: KAGE_LogMessage(0x10,(byte *)"EntityFactory cannot spawn Entity_Player.\n"); return (Entity *)0x0; case 2: tries = 0; do { slot = *(int *)((int)this + 0x32c820) + 1U & 0x1ff; *(uint *)((int)this + 0x32c820) = slot; cVar1 = *(char *)((int)this + slot * 0x848 + 0x223990); if (cVar1 == '\0') goto LAB_006f0638; isRetrying = tries < 0x201; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x848 + 0x223820) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x32c820) + 1U & 0x1ff; *(uint *)((int)this + 0x32c820) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x848 + 0x223820) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x200; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x32c820) * 0x848 + 0x223820) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5db4c,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x32c820) * 0x848 + 0x223997) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x32c820) * 0x848 + 0x223820) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x32c820) * 0x848 + 0x223820) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x32c820) * 0x848 + 0x223997) = 0; slot = *(uint *)((int)this + 0x32c820); } LAB_006f0638: return (Entity *)((int)this + slot * 0x848 + 0x223820); case 3: tries = 0; do { slot = *(int *)((int)this + 0x16d208) + 1U & 0x3f; *(uint *)((int)this + 0x16d208) = slot; cVar1 = *(char *)((int)this + slot * 0xf48 + 0x130178); if (cVar1 == '\0') goto LAB_006f021a; isRetrying = tries < 0x41; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0xf48 + 0x130008) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x16d208) + 1U & 0x3f; *(uint *)((int)this + 0x16d208) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0xf48 + 0x130008) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x40; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x16d208) * 0xf48 + 0x130008) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5daa4,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x16d208) * 0xf48 + 0x13017f) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x16d208) * 0xf48 + 0x130008) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x16d208) * 0xf48 + 0x130008) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x16d208) * 0xf48 + 0x13017f) = 0; slot = *(uint *)((int)this + 0x16d208); } LAB_006f021a: return (Entity *)((int)this + slot * 0xf48 + 0x130008); case 4: tries = 0; do { slot = *(int *)((int)this + 0x194810) + 1U & 0x3f; *(uint *)((int)this + 0x194810) = slot; cVar1 = *(char *)((int)this + slot * 0x9d8 + 0x16d380); if (cVar1 == '\0') goto LAB_006f0374; isRetrying = tries < 0x41; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x9d8 + 0x16d210) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x194810) + 1U & 0x3f; *(uint *)((int)this + 0x194810) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x9d8 + 0x16d210) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x40; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x194810) * 0x9d8 + 0x16d210) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5dadc,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x194810) * 0x9d8 + 0x16d387) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x194810) * 0x9d8 + 0x16d210) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x194810) * 0x9d8 + 0x16d210) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x194810) * 0x9d8 + 0x16d387) = 0; slot = *(uint *)((int)this + 0x194810); } LAB_006f0374: return (Entity *)((int)this + slot * 0x9d8 + 0x16d210); case 5: tries = 0; do { slot = *(int *)((int)this + 0x435c30) + 1U & 0x1ff; *(uint *)((int)this + 0x435c30) = slot; cVar1 = *(char *)((int)this + slot * 0x6f0 + 0x357da0); if (cVar1 == '\0') goto LAB_006f08f8; isRetrying = tries < 0x201; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x6f0 + 0x357c30) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x435c30) + 1U & 0x1ff; *(uint *)((int)this + 0x435c30) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x6f0 + 0x357c30) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x200; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x435c30) * 0x6f0 + 0x357c30) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5dc90,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x435c30) * 0x6f0 + 0x357da7) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x435c30) * 0x6f0 + 0x357c30) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x435c30) * 0x6f0 + 0x357c30) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x435c30) * 0x6f0 + 0x357da7) = 0; slot = *(uint *)((int)this + 0x435c30); } LAB_006f08f8: return (Entity *)((int)this + slot * 0x6f0 + 0x357c30); case 6: tries = 0; do { slot = *(int *)((int)this + 0x460438) + 1U & 0x7f; *(uint *)((int)this + 0x460438) = slot; if (*(char *)((int)this + (int)(&UNK_00435da8 + slot * 0x550)) == '\0') goto LAB_006f0a56; isRetrying = tries < 0x81; tries = tries + 1; } while (isRetrying); if (*(char *)((int)this + (int)(&UNK_00435da8 + slot * 0x550)) != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x550 + 0x435c38) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x460438) + 1U & 0x7f; *(uint *)((int)this + 0x460438) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x550 + 0x435c38) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x80; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x460438) * 0x550 + 0x435c38) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5dbbc,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + (int)(&UNK_00435daf + *(int *)((int)this + 0x460438) * 0x550)) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x460438) * 0x550 + 0x435c38) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x460438) * 0x550 + 0x435c38) + 0x44) )(); *(undefined1 *)((int)this + (int)(&UNK_00435daf + *(int *)((int)this + 0x460438) * 0x550)) = 0; slot = *(uint *)((int)this + 0x460438); } LAB_006f0a56: return (Entity *)((int)this + slot * 0x550 + 0x435c38); case 7: tries = 0; do { slot = *(int *)((int)this + 0x357c28) + 1U & 0x7f; *(uint *)((int)this + 0x357c28) = slot; cVar1 = *(char *)((int)this + slot * 0x568 + 0x32c998); if (cVar1 == '\0') goto LAB_006f0796; isRetrying = tries < 0x81; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x568 + 0x32c828) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x357c28) + 1U & 0x7f; *(uint *)((int)this + 0x357c28) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x568 + 0x32c828) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x80; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x357c28) * 0x568 + 0x32c828) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5dc58,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x357c28) * 0x568 + 0x32c99f) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x357c28) * 0x568 + 0x32c828) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x357c28) * 0x568 + 0x32c828) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x357c28) * 0x568 + 0x32c99f) = 0; slot = *(uint *)((int)this + 0x357c28); } LAB_006f0796: return (Entity *)((int)this + slot * 0x568 + 0x32c828); case 8: tries = 0; do { slot = *(int *)((int)this + 0x6aac58) + 1U & 0x3f; *(uint *)((int)this + 0x6aac58) = slot; cVar1 = *(char *)((int)this + slot * 0x520 + 0x6965c8); if (cVar1 == '\0') goto LAB_006f0bb4; isRetrying = tries < 0x41; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x520 + 0x696458) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x6aac58) + 1U & 0x3f; *(uint *)((int)this + 0x6aac58) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x520 + 0x696458) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x40; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x6aac58) * 0x520 + 0x696458) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5dcc8,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x6aac58) * 0x520 + 0x6965cf) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x6aac58) * 0x520 + 0x696458) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x6aac58) * 0x520 + 0x696458) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x6aac58) * 0x520 + 0x6965cf) = 0; slot = *(uint *)((int)this + 0x6aac58); } LAB_006f0bb4: return (Entity *)((int)this + slot * 0x520 + 0x696458); case 9: tries = 0; do { slot = *(int *)((int)this + 0x223818) + 1U & 0x1ff; *(uint *)((int)this + 0x223818) = slot; cVar1 = *(char *)((int)this + slot * 0x478 + 0x194988); if (cVar1 == '\0') goto LAB_006f04d8; isRetrying = tries < 0x201; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x478 + 0x194818) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x223818) + 1U & 0x1ff; *(uint *)((int)this + 0x223818) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x478 + 0x194818) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x200; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x223818) * 0x478 + 0x194818) + 0x38))() ; if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5db10,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x223818) * 0x478 + 0x19498f) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x223818) * 0x478 + 0x194818) + 0x28) )(); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x223818) * 0x478 + 0x194818) + 0x44) )(); *(undefined1 *)((int)this + *(int *)((int)this + 0x223818) * 0x478 + 0x19498f) = 0; slot = *(uint *)((int)this + 0x223818); } LAB_006f04d8: return (Entity *)((int)this + slot * 0x478 + 0x194818); } } else if (type == 0x2329) { tries = 0; do { slot = *(int *)((int)this + 0x675c48) + 1U & 0x7f; *(uint *)((int)this + 0x675c48) = slot; cVar1 = *(char *)((int)this + slot * 0x530 + 0x64c5b8); if (cVar1 == '\0') goto LAB_006f0fe6; isRetrying = tries < 0x81; tries = tries + 1; } while (isRetrying); if (cVar1 != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)((int)this + slot * 0x530 + 0x64c448) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x675c48) + 1U & 0x7f; *(uint *)((int)this + 0x675c48) = slot; cVar1 = (**(code **)(*(int *)((int)this + slot * 0x530 + 0x64c448) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x80; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x675c48) * 0x530 + 0x64c448) + 0x38))(); if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *) "Overwritten an entity with don\'t overwrite flag at index %d!\n"); } } __std_type_info_name(0xc5dc24,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n" ); *(undefined1 *)((int)this + *(int *)((int)this + 0x675c48) * 0x530 + 0x64c5bf) = 1; (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x675c48) * 0x530 + 0x64c448) + 0x28)) (); (**(code **)(*(int *)((int)this + *(int *)((int)this + 0x675c48) * 0x530 + 0x64c448) + 0x44)) (); *(undefined1 *)((int)this + *(int *)((int)this + 0x675c48) * 0x530 + 0x64c5bf) = 0; slot = *(uint *)((int)this + 0x675c48); } LAB_006f0fe6: return (Entity *)((int)this + slot * 0x530 + 0x64c448); } npcPool = &DAT_00460440 + (int)this; tries = 0; do { slot = *(int *)((int)this + 0x64c440) + 1U & 0x1ff; *(uint *)((int)this + 0x64c440) = slot; if (npcPool[slot * 0xf60 + 0x170] == '\0') goto LAB_006f0e88; isRetrying = tries < 0x201; tries = tries + 1; } while (isRetrying); if (npcPool[slot * 0xf60 + 0x170] != '\0') { if (force != 0) { return (Entity *)0x0; } cVar1 = (**(code **)(*(int *)(npcPool + slot * 0xf60) + 0x38))(); if (cVar1 == '\0') { tries = 0; do { slot = *(int *)((int)this + 0x64c440) + 1U & 0x1ff; *(uint *)((int)this + 0x64c440) = slot; cVar1 = (**(code **)(*(int *)(npcPool + slot * 0xf60) + 0x38))(); if (cVar1 != '\0') break; isRetrying = tries < 0x200; tries = tries + 1; } while (isRetrying); cVar1 = (**(code **)(*(int *)(npcPool + *(int *)((int)this + 0x64c440) * 0xf60) + 0x38))(); if (cVar1 == '\0') { KAGE_LogMessage(4,(byte *)"Overwritten an entity with don\'t overwrite flag at index %d!\n") ; } } __std_type_info_name(0xc5dbf0,&DAT_00c71620); KAGE_LogMessage(4,(byte *) "Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"); npcPool[*(int *)((int)this + 0x64c440) * 0xf60 + 0x177] = 1; (**(code **)(*(int *)(npcPool + *(int *)((int)this + 0x64c440) * 0xf60) + 0x28))(); (**(code **)(*(int *)(npcPool + *(int *)((int)this + 0x64c440) * 0xf60) + 0x44))(); npcPool[*(int *)((int)this + 0x64c440) * 0xf60 + 0x177] = 0; slot = *(uint *)((int)this + 0x64c440); } LAB_006f0e88: return (Entity *)(npcPool + slot * 0xf60); } //@@ 006f1020 Game::constructor /* ZHL [exact] __thiscall void Game::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Game::constructor(Game *this) { int *piVar1; uint uVar2; void *allocation; undefined4 uVar3; DebugRenderer debugRenderer; undefined4 *puVar4; int *containerProxy; 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 ^ (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; *(undefined4 *)&this->field_0x182f8 = 0; *(undefined4 *)&this->field_0x182fc = 0; this->_room = (void *)0x0; (this->_dungeonReturnPosition).y = 0.0; (this->_dungeonReturnPosition).x = 0.0; *(undefined4 *)&this->field_0x18398 = 0; *(undefined4 *)&this->field_0x18394 = 0; this->_levelStateFlags = 0; (this->_myosotisPickups)._begin = (void *)0x0; (this->_myosotisPickups)._end = (void *)0x0; (this->_myosotisPickups)._capacity = (void *)0x0; local_14 = 2; this->field_0x188f8 = 0; *(undefined4 *)&this->field_0x188fc = 0xffffffff; *(undefined4 *)&this->field_0x18900 = 0; this->field_0x18904 = 0; *(undefined4 *)&this->field_0x18908 = 0; this->field_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; local_14._0_1_ = 5; _eh_vector_constructor_iterator_ (&this->field_0x1a570,0x1c,0x10,(_func_void_void_ptr *)&LAB_00829650,FUN_0069d1f0); local_14._0_1_ = 6; *(undefined4 *)&this->field_0x1a730 = 0; *(undefined4 *)&this->field_0x1a734 = 0; allocation = operator_new(100); *(void **)allocation = allocation; *(void **)((int)allocation + 4) = allocation; *(void **)&this->field_0x1a730 = allocation; local_14._0_1_ = 7; this->_preloadManager = 0; *(undefined4 *)&this->field_0x1a73c = 0; allocation = operator_new(0x50); *(void **)allocation = allocation; *(void **)((int)allocation + 4) = allocation; *(void **)((int)allocation + 8) = allocation; *(undefined2 *)((int)allocation + 0xc) = 0x101; this->_preloadManager = allocation; local_14._0_1_ = 8; _eh_vector_constructor_iterator_ ((this->_itemPool)._pools,0x34,0x1f,(_func_void_void_ptr *)&LAB_00732c20, (_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; *(undefined8 *)&(this->_itemPool).field_0x69c = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6a4 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6ac = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6b4 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6bc = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6c4 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6cc = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6d4 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6dc = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6e4 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6ec = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6f4 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x6fc = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x704 = 0xffffffffffffffff; *(undefined8 *)&(this->_itemPool).field_0x70c = 0xffffffffffffffff; *(undefined4 *)&(this->_itemPool).field_0x714 = 0xffffffff; *(undefined4 *)&(this->_itemPool).field_0x6d8 = 4; *(undefined4 *)&(this->_itemPool).field_0x6c8 = 0; *(undefined4 *)&(this->_itemPool).field_0x6c4 = 0xc; *(undefined4 *)&(this->_itemPool).field_0x6d4 = 3; *(undefined4 *)&(this->_itemPool).field_0x6cc = 6; *(undefined4 *)&(this->_itemPool).field_0x6a4 = 1; *(undefined4 *)&(this->_itemPool).field_0x6ac = 0; *(undefined4 *)&(this->_itemPool).field_0x6b0 = 2; *(undefined4 *)&(this->_itemPool).field_0x6b8 = 5; *(undefined4 *)&(this->_itemPool).field_0x6bc = 5; *(undefined4 *)&(this->_itemPool).field_0x6e0 = 0; *(undefined4 *)&(this->_itemPool).field_0x6e4 = 0; *(undefined4 *)&(this->_itemPool).field_0x6e8 = 0; *(undefined4 *)&(this->_itemPool).field_0x6dc = 0; *(undefined4 *)&(this->_itemPool).field_0x6f4 = 1; *(undefined4 *)&(this->_itemPool).field_0x6ec = 8; *(undefined4 *)&(this->_itemPool).field_0x6f0 = 0; *(undefined4 *)&(this->_itemPool).field_0x6fc = 0x1a; *(undefined4 *)&(this->_itemPool).field_0x710 = 0x18; puVar4 = (undefined4 *)&(this->_itemPool).field_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); local_14._0_1_ = 9; _eh_vector_constructor_iterator_ (&this->_bossPool,0x3c,0x25,(_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; *(undefined4 *)&this->field_0x1b82c = 0; *(undefined4 *)&this->field_0x1b830 = 0; *(undefined4 *)&this->field_0x1b834 = 0; *(undefined4 *)&this->field_0x1b838 = 0; *(undefined4 *)&this->_roomTransition = 0; (this->_roomTransition)._frame = 0; (this->_roomTransition)._duration = 0; *(undefined4 *)&(this->_roomTransition).field_0x20 = 0; (this->_roomTransition)._flags = 0; *(undefined4 *)&(this->_roomTransition).field_0x28 = 0; *(undefined4 *)&(this->_roomTransition).field_0x2c = 0; *(undefined4 *)&(this->_roomTransition).field_0x30 = 0; *(undefined4 *)&(this->_roomTransition).field_0x34 = 0; local_14._0_1_ = 0xc; ANM2::constructor(&(this->_roomTransition)._versusScreenSprite); local_14._0_1_ = 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 **)((int)allocation + 4) = allocation; *(void **)((int)allocation + 8) = allocation; *(undefined2 *)((int)allocation + 0xc) = 0x101; roomTransitionSprites->_head = allocation; (this->_roomTransition)._slideOffset.y = 0.0; (this->_roomTransition)._slideOffset.x = 0.0; (this->_roomTransition)._minecart = (EntityPtr)0x0; local_14._0_1_ = 0xf; FUN_0082ed00(); (this->_roomTransition)._bossIntroBossId = 0; *(undefined4 *)&this->_stageTransition = 0; (this->_stageTransition)._frame = 0; (this->_stageTransition)._duration = 0x32; this->field_0x1ba8c = 0; *(undefined4 *)&this->field_0x1ba94 = 0; *(undefined4 *)&this->field_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; (this->_playerManager).field_0x5c = 1; (this->_playerManager)._coopPlayerTypes._begin = (void *)0x0; (this->_playerManager)._coopPlayerTypes._end = (void *)0x0; (this->_playerManager)._coopPlayerTypes._capacity = (void *)0x0; *(undefined4 *)&(this->_playerManager).field_0x7c = 0; *(undefined4 *)&(this->_playerManager).field_0xa4 = 0; *(undefined8 *)&(this->_playerManager).field_0xac = 0x900000005; *(undefined4 *)&(this->_playerManager).field_0xb4 = 7; *(undefined4 *)&(this->_playerManager).field_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); *(undefined4 *)&(this->_playerManager).field_0x80 = 0; *(undefined4 *)&(this->_playerManager).field_0x84 = 0; *(undefined4 *)&(this->_playerManager).field_0x88 = 0; *(undefined4 *)&(this->_playerManager).field_0x8c = 0; *(undefined4 *)&(this->_playerManager).field_0x60 = 0xffffffff; *(undefined4 *)&(this->_playerManager).field_0x64 = 0xffffffff; *(undefined4 *)&(this->_playerManager).field_0x68 = 0xffffffff; *(undefined4 *)&(this->_playerManager).field_0x6c = 0xffffffff; local_14._0_1_ = 0x11; Seeds::constructor(); (this->_onlinePlayerStats)._begin = (void *)0x0; (this->_onlinePlayerStats)._end = (void *)0x0; (this->_onlinePlayerStats)._capacity = (void *)0x0; local_14._0_1_ = 0x13; _eh_vector_constructor_iterator_ (&this->field_0x1bbec,0x34,0x15,(_func_void_void_ptr *)&LAB_00425360,FUN_00425410); local_14._0_1_ = 0x14; this->field_0x1c030 = 0; init_coop_awards(); local_14._0_1_ = 0x15; ANM2::constructor(&(this->_itemOverlay)._sprite); local_14._0_1_ = 0x16; _eh_vector_constructor_iterator_ (&(this->_itemOverlay).field_0x11c,0x58,0x30,(_func_void_void_ptr *)&LAB_009abcf0, FUN_009abd50); (this->_itemOverlay)._player = (EntityPtr)0x0; local_14._0_1_ = 0x18; ANM2::constructor(&(this->_itemOverlay)._megaMushPlayerSprite); local_14._0_1_ = 0x19; ANM2::constructor((ANM2 *)&this->field_0x1d2f4); local_14._0_1_ = 0x1a; _eh_vector_constructor_iterator_ (&this->field_0x1d408,0x38,5,(_func_void_void_ptr *)&LAB_00420aa0,FUN_00420b00); local_14._0_1_ = 0x1b; *(undefined4 *)&this->_gameOver = 0; *(undefined4 *)&(this->_gameOver).field_0x4 = 0; ANM2::constructor((ANM2 *)&(this->_gameOver).field_0x8); (this->_gameOver)._isStopSoundsPending = 0; *(undefined4 *)&this->field_0x1d640 = 0; *(undefined4 *)&this->field_0x1d644 = 0; *(undefined4 *)&this->field_0x1d648 = 0; *(undefined4 *)&this->field_0x1d64c = 0; local_14._0_1_ = 0x1c; Leaderboard::constructor(); local_14._0_1_ = 0x1d; HUD::constructor(); local_14._0_1_ = 0x1e; PauseScreen::constructor(); local_14._0_1_ = 0x1f; this->_revivePlayerMenu = 0; *(undefined4 *)&this->field_0x24ed0 = 0xffffffff; *(undefined4 *)&this->field_0x24ed4 = 0; *(undefined4 *)&this->field_0x24ed8 = 0; ANM2::constructor((ANM2 *)&this->field_0x24edc); local_14._0_1_ = 0x20; ANM2::constructor((ANM2 *)&this->field_0x24ff0); *(undefined4 *)&this->field_0x25104 = 0x3f400000; local_14._0_1_ = 0x21; this->field_0x25108 = 0; this->_emoteMenuState = 0; OnlineEmotes::constructor(); *(undefined4 *)&this->field_0x258d4 = 0; *(undefined4 *)&this->field_0x258d8 = 0; *(undefined4 *)&this->field_0x258dc = 0; local_14._0_1_ = 0x23; *(undefined4 *)&this->field_0x258e0 = 0; SharedPtrPair::constructor(); local_14._0_1_ = 0x24; SharedPtrPair::constructor(); *(undefined4 *)&this->field_0x2593c = 0xffffffff; *(undefined4 *)&this->field_0x25940 = 0; *(undefined4 *)&this->field_0x25944 = 0; *(undefined4 *)&this->field_0x25948 = 0; *(undefined4 *)&this->field_0x2594c = 0x42dc0000; *(undefined4 *)&this->field_0x25950 = 0x428c0000; local_14._0_1_ = 0x25; (this->_onlineStatsScreen)._isActive = 0; ANM2::constructor((ANM2 *)&(this->_onlineStatsScreen).field_0x4); local_14._0_1_ = 0x26; _eh_vector_constructor_iterator_ (&(this->_onlineStatsScreen).field_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; local_14._0_1_ = 0x27; *(undefined4 *)&(this->_minimap).field_0x14 = 0; *(undefined4 *)&(this->_minimap).field_0x10 = 0; _eh_vector_constructor_iterator_((this->_minimap)._config,0x160,2,FUN_0098b0a0,FUN_0098b130); local_14._0_1_ = 0x28; ANM2::constructor(&(this->_minimap)._itemIconsSprite); local_14._0_1_ = 0x29; ANM2::constructor(&(this->_minimap)._hudPickupSprite); local_14._0_1_ = 0x2a; ANM2::constructor(&(this->_minimap)._iconsSprite); *(undefined4 *)&(this->_minimap).field_0x614 = 0; *(undefined4 *)&(this->_minimap).field_0x618 = 0; (this->_minimap)._shakeOffset.y = 0.0; (this->_minimap)._shakeOffset.x = 0.0; local_14._0_1_ = 0x2b; (this->_screenShakeOffset).y = 0.0; (this->_screenShakeOffset).x = 0.0; KAGE::SmartPointer::SmartPointer(this->_giantBookClickerImage,(void *)0x0); this->_triggerWindowResize = 0; this->_debugFlags = 0; this->_gameStateFlags = 0; *(undefined2 *)&this->_isStarted = 0; KColor::SetFromARGB(&this->_fadeInColor,0xffffffff); KColor::SetFromARGB(&this->_fadeOutColor,0xffffffff); this->_framesSinceRoomTransition = 0; *(undefined4 *)&this->_ambush = 0; *(undefined4 *)&(this->_ambush).field_0x4 = 0; *(undefined4 *)&(this->_ambush).field_0x8 = 0; (this->_ambush)._bossRushWaves._begin = (void *)0x0; (this->_ambush)._bossRushWaves._end = (void *)0x0; (this->_ambush)._bossRushWaves._capacity = (void *)0x0; *(undefined8 *)&this->field_0x265f8 = 0x900000005; *(undefined4 *)&this->field_0x265f4 = 0xaa17414f; *(undefined4 *)&this->field_0x26600 = 7; *(undefined8 *)&this->field_0x26608 = 0x900000005; *(undefined4 *)&this->field_0x26604 = 0xaa17414f; *(undefined4 *)&this->field_0x26610 = 7; (this->_ambush)._isActive = 0; (this->_ambush)._currentWave = 0; *(undefined4 *)&this->field_0x265f0 = 0; local_14 = CONCAT31(local_14._1_3_,0x2d); *(undefined4 *)&this->_deathmatchManager = 0; *(undefined4 *)&(this->_deathmatchManager).field_0x4 = 0; (this->_deathmatchManager)._type = (void *)0x0; *(undefined4 *)&this->field_0x26628 = 0; *(undefined4 *)&this->field_0x26624 = 0; this->field_0x2662c = 0; uVar2 = Random(); if ((uVar2 & 1) == 0) { iVar5 = 1; } else { uVar2 = Random(); iVar5 = uVar2 % 10 + 2; } DeathmatchManager::set_type(&this->_deathmatchManager,iVar5); local_14._0_1_ = 0x2e; ChallengeParams::ChallengeParams(&(this->_dailyChallenge)._params); (this->_dailyChallenge)._id = 0; (this->_dailyChallenge)._seed = 0; (this->_dailyChallenge)._specialDailyId = 0; (this->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(this->_dailyChallenge)._params); ScoreSheet::ScoreSheet(&this->_scoreSheet); local_14._0_1_ = 0x30; ANM2::constructor(&(this->_genericPrompt)._sprite); (this->_genericPrompt)._isOnlineVote = 0; *(undefined4 *)&(this->_genericPrompt).field_0x114 = 0; *(undefined4 *)&(this->_genericPrompt).field_0x118 = 0; *(undefined4 *)&(this->_genericPrompt).field_0x11c = 0; *(undefined4 *)&(this->_genericPrompt).field_0x120 = 0; *(undefined4 *)&(this->_genericPrompt).field_0x124 = 0; local_14._0_1_ = 0x31; ANM2::constructor(&this->_completionWidgetSprite); 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; local_14._0_1_ = 0x33; this->_isInstantFadeIn = 0; _eh_vector_constructor_iterator_ (this->_glowingHourglassStates,0x20660,2,FUN_006f2970, (_func_void_void_ptr *)&LAB_006f2990); local_14._0_1_ = 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; *(undefined4 *)&this->field_0x67700 = 0x3f800000; *(undefined4 *)&this->field_0x67704 = 0x3f800000; *(undefined4 *)&this->field_0x67708 = 0x3f800000; *(undefined4 *)&this->field_0x6770c = 0x3f800000; *(undefined4 *)&this->field_0x67710 = 0; *(undefined4 *)&this->field_0x67714 = 0; *(undefined4 *)&this->field_0x67718 = 0; *(undefined4 *)&this->field_0x6771c = 0; *(undefined4 *)&this->field_0x67720 = 0; *(undefined4 *)&this->field_0x67724 = 0; *(undefined4 *)&this->field_0x67728 = 0; this->_debugRenderer = (DebugRenderer)0x0; *(undefined4 *)&this->field_0x67730 = 0; debugRenderer = (DebugRenderer)operator_new(0x40); *(DebugRenderer *)debugRenderer = debugRenderer; *(DebugRenderer *)((int)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; *(undefined4 *)&(this->_proceduralItemManager).field_0x10 = 0; *(undefined4 *)&(this->_proceduralItemManager).field_0x14 = 0; *(undefined4 *)&(this->_proceduralItemManager).field_0x18 = 0; *(undefined4 *)&(this->_proceduralItemManager).field_0x1c = 0; *(undefined4 *)&(this->_proceduralItemManager).field_0x20 = 0; *(undefined4 *)&(this->_proceduralItemManager).field_0x24 = 0; spawnTriggerTargets = &(this->_proceduralItemManager)._spawnTriggerTargets; local_14._0_1_ = 0x3a; spawnTriggerTargets->_head = (void *)0x0; (this->_proceduralItemManager)._spawnTriggerTargets._size = 0; allocation = operator_new(0x18); *(void **)allocation = allocation; *(void **)((int)allocation + 4) = allocation; *(void **)((int)allocation + 8) = allocation; *(undefined2 *)((int)allocation + 0xc) = 0x101; spawnTriggerTargets->_head = allocation; local_14._0_1_ = 0x3b; _eh_vector_constructor_iterator_(&this->field_0x6778c,800,7,FUN_006ef920,FUN_006f29a0); this->_isPocketItemRewindSaved = 0; *(undefined4 *)&this->field_0x68d74 = 0; this->_console = (Console)0x0; this[1]._stageType = 0; this[1]._bossChallenge = 0; this[1]._devilRoomDisabled = 0; *(undefined2 *)&this[1].field_0xa = 0; this[1]._roomList[0].SafeGridIndex = 0; this[1]._roomList[0].OverrideData = (void *)0x0; this[1]._roomList[0].AllowedDoors = 0xf; *(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; local_14._0_1_ = 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 = (int)puVar4; *puVar4 = piVar1; local_14._0_1_ = 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 = (int)containerProxy; *containerProxy = (int)piVar1; local_14._0_1_ = 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; local_14._0_1_ = 0x41; allocation = operator_new(0x6aac60); local_14._0_1_ = 0x42; if (allocation == (void *)0x0) { allocation = (void *)0x0; } else { allocation = (void *)EntityFactory::constructor(); } local_14 = CONCAT31(local_14._1_3_,0x41); this->_entityFactory = allocation; create_render_surfaces(); ModManager::create_shader_render_targets(&g_manager->_modManager); ExceptionList = local_1c; return; } //@@ 006f2040 FUN_006f2040 void FUN_006f2040(void) { int *in_ECX; FUN_00709420(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x50); return; } //@@ 006f2060 HUD::constructor /* DB: called from Game::constructor; constructs ANM2s at +0x3778,+0x388c,+0x39a0,+0x3ab4,+0x3bc8 = zhl HUD _chargeBarSprite 0x3798/_heartsSprite 0x39c0/_pickupHUDSprite 0x3ad4/_cardsPillsSprite 0x3be8 minus the 0x20 drift seen for this exe; HUD render (009a6fe0) passes +0x39a0 as the hearts ANM2 */ void HUD::constructor(void) { void *in_ECX; int remaining; undefined4 *cursor; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afba54; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_constructor_iterator_(in_ECX,0x6dc,8,FUN_006efc70,FUN_006efde0); local_8 = 0; Font::Font((Font *)((int)in_ECX + 0x36e0)); local_8._0_1_ = 1; Font::Font((Font *)((int)in_ECX + 0x372c)); local_8._0_1_ = 2; ANM2::constructor((ANM2 *)((int)in_ECX + 0x3778)); local_8._0_1_ = 3; ANM2::constructor((ANM2 *)((int)in_ECX + 0x388c)); local_8._0_1_ = 4; ANM2::constructor((ANM2 *)((int)in_ECX + 0x39a0)); local_8._0_1_ = 5; ANM2::constructor((ANM2 *)((int)in_ECX + 0x3ab4)); local_8._0_1_ = 6; ANM2::constructor((ANM2 *)((int)in_ECX + 0x3bc8)); local_8._0_1_ = 7; FUN_008405b0(); local_8._0_1_ = 8; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x3ed0),500,6,FUN_008405b0,HUD_Message::~HUD_Message); local_8._0_1_ = 9; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x4a88),500,4,FUN_008405b0,HUD_Message::~HUD_Message); local_8._0_1_ = 10; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5258)); *(undefined4 *)((int)in_ECX + 0x536c) = 0; *(undefined4 *)((int)in_ECX + 0x5370) = 0; local_8._0_1_ = 0xc; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5374)); *(undefined4 *)((int)in_ECX + 0x5488) = 0; *(undefined4 *)((int)in_ECX + 0x548c) = 0; *(undefined4 *)((int)in_ECX + 0x54a0) = 0; *(undefined4 *)((int)in_ECX + 0x54a4) = 0; *(undefined4 *)((int)in_ECX + 0x54a8) = 0; *(undefined4 *)((int)in_ECX + 0x54ac) = 0; *(undefined4 *)((int)in_ECX + 0x54b0) = 0; *(undefined4 *)((int)in_ECX + 0x54b4) = 0; *(undefined4 *)((int)in_ECX + 0x54bc) = 0; *(undefined4 *)((int)in_ECX + 0x54c0) = 0; *(undefined4 *)((int)in_ECX + 0x54c4) = 0; *(undefined4 *)((int)in_ECX + 0x54c8) = 0; local_8._0_1_ = 0x13; ANM2::constructor((ANM2 *)((int)in_ECX + 0x54dc)); local_8._0_1_ = 0x14; ANM2::constructor((ANM2 *)((int)in_ECX + 22000)); local_8._0_1_ = 0x15; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5704)); local_8._0_1_ = 0x16; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5818)); *(undefined4 *)((int)in_ECX + 0x592c) = 0; *(undefined4 *)((int)in_ECX + 0x5930) = 0; local_8._0_1_ = 0x18; remaining = 4; cursor = (undefined4 *)((int)in_ECX + 0x5934); do { cursor[1] = 0; *cursor = 0; remaining = remaining + -1; cursor = cursor + 2; } while (remaining != 0); remaining = 8; cursor = (undefined4 *)((int)in_ECX + 0x5954); do { cursor[1] = 0; *cursor = 0; remaining = remaining + -1; cursor = cursor + 2; } while (remaining != 0); *(undefined4 *)((int)in_ECX + 0x59a0) = 0; *(undefined4 *)((int)in_ECX + 0x599c) = 0; ANM2::constructor((ANM2 *)((int)in_ECX + 0x59a4)); local_8._0_1_ = 0x19; cursor = (undefined4 *)((int)in_ECX + 0x5ab8); remaining = 2; do { *cursor = 0; _vector_constructor_iterator_(cursor + 1,0x14,10,(_func_void_ptr_void_ptr *)&LAB_006efa10); cursor = cursor + 0x33; remaining = remaining + -1; } while (remaining != 0); local_8._0_1_ = 0x1a; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x5c54),0x14,2,(_func_void_void_ptr *)&LAB_0083ab90, (_func_void_void_ptr *)&LAB_006f3050); local_8._0_1_ = 0x1b; text_image_cache_clear((void *)((int)in_ECX + 0x5c54)); *(undefined4 *)((int)in_ECX + 0x5c84) = 0; *(undefined4 *)((int)in_ECX + 0x5c88) = 0; *(undefined4 *)((int)in_ECX + 0x5c8c) = 0; local_8._0_1_ = 0x1d; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5c90)); local_8._0_1_ = 0x1e; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5da4)); local_8._0_1_ = 0x1f; SharedPtrPair::constructor(); local_8._0_1_ = 0x20; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5ee4)); *(undefined4 *)((int)in_ECX + 0x5ff8) = 0xffffffff; *(undefined4 *)((int)in_ECX + 0x6000) = 0; *(undefined4 *)((int)in_ECX + 0x5ffc) = 0; *(undefined4 *)((int)in_ECX + 0x6004) = 0; *(undefined4 *)((int)in_ECX + 0x6014) = 0; *(undefined4 *)((int)in_ECX + 0x6018) = 0xf; *(undefined1 *)((int)in_ECX + 0x6004) = 0; local_8 = CONCAT31(local_8._1_3_,0x22); Font::Font((Font *)((int)in_ECX + 0x601c)); *(undefined4 *)((int)in_ECX + 0x6068) = 0; *(undefined4 *)((int)in_ECX + 0x606c) = 0x3f800000; ExceptionList = local_10; return; } //@@ 006f23d0 HUD::destructor /* DB: ECX object ends with an 8-element array of 0x6dc-byte PlayerHUDs (_eh_vector_destructor_iterator_(this,0x6dc,8,...)), fonts, many ANM2 sprites and render targets; called from Game::~Game (Game::_hud at 0x1da04) and its unwind funclet */ void __thiscall HUD::destructor(HUD *this) { std_map *fontCharMap; char isLastRef; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afba80; local_10 = ExceptionList; ExceptionList = &local_10; FUN_0083c4c0(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 0; _eh_vector_destructor_iterator_(&this->_historyHUD,0x14,2,(_func_void_void_ptr *)&LAB_006f3050); local_8 = 1; ANM2::Reset((ANM2 *)&this->_statHUD); AnimationState::~AnimationState((AnimationState *)&this->field_0x59f4); AnimationState::~AnimationState((AnimationState *)&this->field_0x59d4); std::string::_Tidy_deallocate(&this->field_0x59bc); std::string::_Tidy_deallocate((char *)&this->_statHUD); local_8 = 2; if (*(int **)&this->field_0x5930 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x5930 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x592c); } } local_8 = 3; ANM2::Reset(&this->_poopSpellsSprite); AnimationState::~AnimationState(&(this->_poopSpellsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_poopSpellsSprite)._animState); std::string::_Tidy_deallocate((this->_poopSpellsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_poopSpellsSprite); local_8 = 4; ANM2::Reset(&this->_craftingTableSprite); AnimationState::~AnimationState(&(this->_craftingTableSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_craftingTableSprite)._animState); std::string::_Tidy_deallocate((this->_craftingTableSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_craftingTableSprite); local_8 = 5; ANM2::Reset(&this->_inventorySprite); AnimationState::~AnimationState(&(this->_inventorySprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_inventorySprite)._animState); std::string::_Tidy_deallocate((this->_inventorySprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_inventorySprite); local_8 = 6; ANM2::Reset(&this->_coopMenuSprite); AnimationState::~AnimationState(&(this->_coopMenuSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_coopMenuSprite)._animState); std::string::_Tidy_deallocate((this->_coopMenuSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_coopMenuSprite); local_8 = 7; if (*(int **)&this->field_0x54c8 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x54c8 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x54c4); } } local_8 = 8; if (*(int **)&this->field_0x54c0 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x54c0 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x54bc); } } local_8 = 9; if (*(int **)&this->field_0x54b4 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x54b4 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x54b0); } } local_8 = 10; if (*(int **)&this->field_0x54ac != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x54ac + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x54a8); } } local_8 = 0xb; if (*(int **)&this->field_0x54a4 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x54a4 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x54a0); } } local_8 = 0xc; if (*(int **)&this->field_0x548c != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x548c + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x5488); } } local_8 = 0xd; ANM2::Reset(&this->_statsSprite); AnimationState::~AnimationState(&(this->_statsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_statsSprite)._animState); std::string::_Tidy_deallocate((this->_statsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_statsSprite); local_8 = 0xe; if (*(int **)&this->field_0x5370 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x5370 + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&this->field_0x536c); } } local_8 = 0xf; ANM2::Reset(&this->_fortuneSprite); AnimationState::~AnimationState(&(this->_fortuneSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_fortuneSprite)._animState); std::string::_Tidy_deallocate((this->_fortuneSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_fortuneSprite); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(this->_messagePlayerHUD,500,4,HUD_Message::~HUD_Message); _eh_vector_destructor_iterator_(this->_messageStack,500,6,HUD_Message::~HUD_Message); HUD_Message::~HUD_Message(); local_8 = 0x10; ANM2::Reset(&this->_cardsPillsSprite); AnimationState::~AnimationState(&(this->_cardsPillsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_cardsPillsSprite)._animState); std::string::_Tidy_deallocate((this->_cardsPillsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_cardsPillsSprite); local_8 = 0x11; ANM2::Reset(&this->_pickupHUDSprite); AnimationState::~AnimationState(&(this->_pickupHUDSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_pickupHUDSprite)._animState); std::string::_Tidy_deallocate((this->_pickupHUDSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_pickupHUDSprite); local_8 = 0x12; ANM2::Reset(&this->_heartsSprite); AnimationState::~AnimationState(&(this->_heartsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_heartsSprite)._animState); std::string::_Tidy_deallocate((this->_heartsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_heartsSprite); local_8 = 0x13; ANM2::Reset(&this->_chargeBarSmallSprite); AnimationState::~AnimationState(&(this->_chargeBarSmallSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_chargeBarSmallSprite)._animState); std::string::_Tidy_deallocate((this->_chargeBarSmallSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_chargeBarSmallSprite); local_8 = 0x14; ANM2::Reset(&this->_chargeBarSprite); AnimationState::~AnimationState(&(this->_chargeBarSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_chargeBarSprite)._animState); std::string::_Tidy_deallocate((this->_chargeBarSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_chargeBarSprite); local_8 = 0xffffffff; Font::Unload(&this->_fontKR); fontCharMap = &(this->_fontKR)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharMap,(fuzzer_allocator_> *)fontCharMap, *(_Tree_node **)((int)(this->_fontKR)._charsBlock._head + 4)); operator_delete(fontCharMap->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font); fontCharMap = &(this->_font)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharMap,(fuzzer_allocator_> *)fontCharMap, *(_Tree_node **)((int)(this->_font)._charsBlock._head + 4)); operator_delete(fontCharMap->_head,0x18); FUN_004b3950(); _eh_vector_destructor_iterator_(this,0x6dc,8,FUN_006efde0); ExceptionList = local_10; return; } //@@ 006f2960 FUN_006f2960 void FUN_006f2960(void) { FUN_004269f0(); return; } //@@ 006f2970 FUN_006f2970 void FUN_006f2970(void) { int in_ECX; GameState::constructor((GameState *)(in_ECX + 4)); return; } //@@ 006f29a0 FUN_006f29a0 void FUN_006f29a0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_((void *)((int)in_ECX + 0x188),0xb8,2,RoomDescriptor::destructor); _eh_vector_destructor_iterator_(in_ECX,0xb8,2,RoomDescriptor::destructor); ExceptionList = local_10; return; } //@@ 006f2a10 EntityFactory::constructor /* DB: Game::constructor stores its result in Game+0x26580 _entityFactory; eh_vector_constructor_iterator over pools: 0x400 Entity_Effect (0x4c0), 0x40 Entity_Familiar (0xf48), 0x40 of 0x9d8 (006a1e80 ctor), 0x200 Entity_Projectile (0x478), ... with count ints after each pool */ void EntityFactory::constructor(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afbb39; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_constructor_iterator_(in_ECX,0x4c0,0x400,Entity_Effect::constructor,FUN_005cda90); *(undefined4 *)((int)in_ECX + 0x130000) = 0; local_8 = 0; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x130008),0xf48,0x40,Entity_Familiar::Constructor,FUN_0060d400); *(undefined4 *)((int)in_ECX + 0x16d208) = 0; local_8._0_1_ = 1; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x16d210),0x9d8,0x40,FUN_006a1e80,FUN_006a1fc0); *(undefined4 *)((int)in_ECX + 0x194810) = 0; local_8._0_1_ = 2; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x194818),0x478,0x200,Entity_Projectile::Constructor, (_func_void_void_ptr *)&LAB_00652b80); *(undefined4 *)((int)in_ECX + 0x223818) = 0; local_8._0_1_ = 3; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x223820),0x848,0x200,Entity_Tear::Constructor, Entity_Tear::~Entity_Tear); *(undefined4 *)((int)in_ECX + 0x32c820) = 0; local_8._0_1_ = 4; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x32c828),0x568,0x80,Entity_Laser::Constructor, Entity_Laser::destructor); *(undefined4 *)((int)in_ECX + 0x357c28) = 0; local_8._0_1_ = 5; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x357c30),0x6f0,0x200,Entity_Pickup::Constructor, Entity_Pickup::~Entity_Pickup); *(undefined4 *)((int)in_ECX + 0x435c30) = 0; local_8._0_1_ = 6; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x435c38),0x550,0x80,FUN_0065d0c0,FUN_0065d160); *(undefined4 *)((int)in_ECX + 0x460438) = 0; local_8._0_1_ = 7; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x460440),0xf60,0x200,Entity_NPC::Constructor, Entity_NPC::~Entity_NPC); *(undefined4 *)((int)in_ECX + 0x64c440) = 0; local_8._0_1_ = 8; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x64c448),0x530,0x80,FUN_005ccc30, (_func_void_void_ptr *)&LAB_005ccc90); *(undefined4 *)((int)in_ECX + 0x675c48) = 0; local_8._0_1_ = 9; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x675c50),0x410,0x80,FUN_006a7ec0, (_func_void_void_ptr *)&LAB_006a7f10); *(undefined4 *)((int)in_ECX + 0x696450) = 0; local_8 = CONCAT31(local_8._1_3_,10); _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x696458),0x520,0x40,Entity_Knife::Constructor,FUN_00960bc0); *(undefined4 *)((int)in_ECX + 0x6aac58) = 0; ExceptionList = local_10; return; } //@@ 006f2c90 FUN_006f2c90 void FUN_006f2c90(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x14,2,(_func_void_void_ptr *)&LAB_006f3050); ExceptionList = local_10; return; } //@@ 006f2ce0 FUN_006f2ce0 void FUN_006f2ce0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x4c0,0x400,FUN_005cda90); ExceptionList = local_10; return; } //@@ 006f2d30 FUN_006f2d30 void FUN_006f2d30(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0xf48,0x40,FUN_0060d400); ExceptionList = local_10; return; } //@@ 006f2d80 FUN_006f2d80 void FUN_006f2d80(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x9d8,0x40,FUN_006a1fc0); ExceptionList = local_10; return; } //@@ 006f2dd0 FUN_006f2dd0 void FUN_006f2dd0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x478,0x200,(_func_void_void_ptr *)&LAB_00652b80); ExceptionList = local_10; return; } //@@ 006f2e20 FUN_006f2e20 void FUN_006f2e20(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x848,0x200,Entity_Tear::~Entity_Tear); ExceptionList = local_10; return; } //@@ 006f2e70 FUN_006f2e70 void FUN_006f2e70(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x568,0x80,Entity_Laser::destructor); ExceptionList = local_10; return; } //@@ 006f2ec0 FUN_006f2ec0 void FUN_006f2ec0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x6f0,0x200,Entity_Pickup::~Entity_Pickup); ExceptionList = local_10; return; } //@@ 006f2f10 FUN_006f2f10 void FUN_006f2f10(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x550,0x80,FUN_0065d160); ExceptionList = local_10; return; } //@@ 006f2f60 FUN_006f2f60 void FUN_006f2f60(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0xf60,0x200,Entity_NPC::~Entity_NPC); ExceptionList = local_10; return; } //@@ 006f2fb0 FUN_006f2fb0 void FUN_006f2fb0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x530,0x80,(_func_void_void_ptr *)&LAB_005ccc90); ExceptionList = local_10; return; } //@@ 006f3000 FUN_006f3000 void FUN_006f3000(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX,0x410,0x80,(_func_void_void_ptr *)&LAB_006a7f10); ExceptionList = local_10; return; } //@@ 006f3060 Game::~Game /* DB: no callers; destroys members up to treeHead+0x6778c (DebugRenderer list via 0x42f060, ANM2s, Console/HUD sub-objects); next to Game::Update/Render */ void Game::~Game(void) { 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::reset(in_ECX); KAGE::SmartPointer::reset(extraout_ECX); KAGE::SmartPointer::reset(extraout_ECX_00); KAGE::SmartPointer::reset(&DAT_00c797c4,(void *)0x0); KAGE::SmartPointer::reset(extraout_ECX_01); KAGE::SmartPointer::reset(extraout_ECX_02); KAGE::SmartPointer::reset(extraout_ECX_03); KAGE::SmartPointer::reset(extraout_ECX_04); KAGE::SmartPointer::reset(extraout_ECX_05); KAGE::SmartPointer::reset(extraout_ECX_06); KAGE::SmartPointer::reset(extraout_ECX_07); KAGE::SmartPointer::reset(extraout_ECX_08); KAGE::SmartPointer::reset(extraout_ECX_09); KAGE::SmartPointer::reset(&DAT_00c7983c,(void *)0x0); KAGE::SmartPointer::reset(extraout_ECX_10); KAGE::SmartPointer::reset(&DAT_00c79804,(void *)0x0); KAGE::SmartPointer::reset(&DAT_00c7980c,(void *)0x0); KAGE::SmartPointer::reset(&DAT_00c79814,(void *)0x0); KAGE::SmartPointer::reset(&DAT_00c79844,(void *)0x0); KAGE::SmartPointer::reset(extraout_ECX_11); KAGE::SmartPointer::reset(extraout_ECX_12); room = *(Room **)(in_ECX + 0x18300); uVar1 = extraout_ECX_13; if (room != (Room *)0x0) { Room::~Room(room); operator_delete(room,0x7898); *(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 *)((int)entityPool + 0x696458),0x520,0x40,FUN_00960bc0); local_8 = 1; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x675c50),0x410,0x80,(_func_void_void_ptr *)&LAB_006a7f10) ; local_8 = 2; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x64c448),0x530,0x80,(_func_void_void_ptr *)&LAB_005ccc90) ; local_8 = 3; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x460440),0xf60,0x200,Entity_NPC::~Entity_NPC); local_8 = 4; _eh_vector_destructor_iterator_((void *)((int)entityPool + 0x435c38),0x550,0x80,FUN_0065d160); local_8 = 5; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x357c30),0x6f0,0x200,Entity_Pickup::~Entity_Pickup); local_8 = 6; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x32c828),0x568,0x80,Entity_Laser::destructor); local_8 = 7; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x223820),0x848,0x200,Entity_Tear::~Entity_Tear); local_8 = 8; _eh_vector_destructor_iterator_ ((void *)((int)entityPool + 0x194818),0x478,0x200,(_func_void_void_ptr *)&LAB_00652b80 ); local_8 = 9; _eh_vector_destructor_iterator_((void *)((int)entityPool + 0x16d210),0x9d8,0x40,FUN_006a1fc0); local_8 = 10; _eh_vector_destructor_iterator_((void *)((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::reset(uVar1); KAGE::SmartPointer::reset(extraout_ECX_16); KAGE::SmartPointer::reset(extraout_ECX_17); KAGE::SmartPointer::reset(extraout_ECX_18); KAGE::SmartPointer::reset(extraout_ECX_19); KAGE::SmartPointer::reset(extraout_ECX_20); KAGE::SmartPointer::reset((void *)(in_ECX + 0x26520),(void *)0x0); FUN_008f7dd0(); Console::destructor(); _eh_vector_destructor_iterator_((void *)(in_ECX + 0x6778c),800,7,FUN_006f29a0); ProceduralItemManager::~ProceduralItemManager(); std::vector<12byte>::_Tidy(); FUN_0042f060(); _eh_vector_destructor_iterator_ ((void *)(in_ECX + 0x269ec),0x20660,2,(_func_void_void_ptr *)&LAB_006f2990); std::vector::_Tidy(); local_8 = 0xc; ANM2::Reset((ANM2 *)(in_ECX + 0x268ac)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x268fc)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x268dc)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x268c4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x268ac)); local_8 = 0xd; ANM2::Reset((ANM2 *)(in_ECX + 0x26778)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x267c8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x267a8)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x26790)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x26778)); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); FUN_004269f0(); local_8 = 0xe; if (*(undefined4 **)(in_ECX + 0x26620) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 0x26620))(1); *(undefined4 *)(in_ECX + 0x26620) = 0; } FUN_00708c10(); FUN_00708c10(); local_8 = 0xf; if (*(int **)(in_ECX + 0x26524) != (int *)0x0) { isLastRef = (**(code **)(**(int **)(in_ECX + 0x26524) + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((void *)(in_ECX + 0x26520)); } } Minimap::~Minimap((Minimap *)(in_ECX + 0x25ecc)); OnlineStatsScreen::~OnlineStatsScreen(); if (*(char *)(in_ECX + 0x25108) != '\0') { *(undefined4 *)(in_ECX + 0x2510c) = 0; *(undefined1 *)(in_ECX + 0x25108) = 0; } SharedPtrPair::~SharedPtrPair((void *)(in_ECX + 0x25910)); SharedPtrPair::~SharedPtrPair((void *)(in_ECX + 0x258e4)); std::vector>::_Tidy(); OnlineEmotes::destructor((void *)(in_ECX + 0x25110)); RevivePlayerMenu::~RevivePlayerMenu(); PauseScreen::~PauseScreen(); HUD::destructor((HUD *)(in_ECX + 0x1da04)); Leaderboard::~Leaderboard((Leaderboard *)(in_ECX + 0x1d650)); std::vector<56byte_string>::_Tidy(); local_8 = 0x10; ANM2::Reset((ANM2 *)(in_ECX + 0x1d528)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1d578)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1d558)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1d540)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1d528)); local_8 = 0x11; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x1d408),0x38,5,FUN_00420b00); local_8 = CONCAT31(local_8._1_3_,0x12); ANM2::Reset((ANM2 *)(in_ECX + 0x1d2f4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1d344)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1d324)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1d30c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1d2f4)); ItemOverlay::~ItemOverlay((ItemOverlay *)(in_ECX + 0x1c034)); online_stats_destroy(); treeHead = (undefined4 *)(in_ECX + 0x1bbd8); FID_conflict__Erase_tree_>_> (treeHead,(fuzzer_allocator_> *)treeHead, *(_Tree_node **)(*(int *)(in_ECX + 0x1bbd8) + 4)); operator_delete((void *)*treeHead,0x14); PlayerManager::~PlayerManager(); 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::_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,(_func_void_void_ptr *)&LAB_00732c80); FUN_00709420((undefined4 *)(in_ECX + 0x1a738),*(undefined4 *)(*(int *)(in_ECX + 0x1a738) + 4)); operator_delete(*(void **)(in_ECX + 0x1a738),0x50); RoomConfig::~RoomConfig(); local_8 = 0x15; room = *(Room **)(in_ECX + 0x18300); if (room != (Room *)0x0) { Room::~Room(room); operator_delete(room,0x7898); *(undefined4 *)(in_ECX + 0x18300) = 0; } std::vector::_Tidy(); local_8._0_1_ = 0x16; if (*(int **)(in_ECX + 0x182fc) != (int *)0x0) { isLastRef = (**(code **)(**(int **)(in_ECX + 0x182fc) + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x182f8); } } local_8 = CONCAT31(local_8._1_3_,0x15); _eh_vector_destructor_iterator_((void *)(in_ECX + 0x14),0xb8,0x20f,RoomDescriptor::destructor); ExceptionList = local_10; return; } //@@ 006f37e0 Game::create_render_surfaces /* DB: Game::constructor + resize path 007084c0: creates "Pixelation Surface", "Bloom Surface", "Old TV Surface", "Hallucination Surface/Snapshot", "Colormod Surface" */ void Game::create_render_surfaces(void) { 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 ^ (uint)(tmpTarget + 0x14); ExceptionList = &local_10; if (DAT_00c79758 == (int *)0x0) { KColor::SetFromARGB(&transparentColor,0); newTarget = KAGE_Graphics::create_render_target (tmpTarget,g_framebufferWidth,DAT_00c79114,(byte *)"Pixelation Surface", clearColor); local_8 = 0; shared_ptr::operator_assign(&DAT_00c79758,newTarget); local_8 = 1; if (tmpTargetRefCount != (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 == (int *)0x0) && ((g_manager->_optionsConfig)._enableBloom != 0)) { KColor::SetFromARGB(&transparentColor,0); newTarget = KAGE_Graphics::create_render_target (tmpTarget,g_framebufferWidth,DAT_00c79114,(byte *)"Bloom Surface", clearColor_00); local_8 = 2; shared_ptr::operator_assign(&DAT_00c79774,newTarget); local_8 = 3; if (tmpTargetRefCount != (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 == (int *)0x0) { KColor::SetFromARGB(&transparentColor,0); newTarget = KAGE_Graphics::create_render_target (tmpTarget,g_framebufferWidth,DAT_00c79114,(byte *)"Old TV Surface", clearColor_01); local_8 = 4; shared_ptr::operator_assign(&DAT_00c79794,newTarget); local_8 = 5; if (tmpTargetRefCount != (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 == (int *)0x0) { KColor::SetFromARGB(&transparentColor,0); newTarget = KAGE_Graphics::create_render_target (tmpTarget,g_framebufferWidth,DAT_00c79114,(byte *)"Hallucination Surface" ,clearColor_02); local_8 = 6; shared_ptr::operator_assign(&DAT_00c7979c,newTarget); local_8 = 7; if (tmpTargetRefCount != (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 == (int *)0x0) { KColor::SetFromARGB(&transparentColor,0); newTarget = KAGE_Graphics::create_render_target (tmpTarget,g_framebufferWidth,DAT_00c79114, (byte *)"Hallucination Snapshot",clearColor_03); local_8 = 8; shared_ptr::operator_assign(&DAT_00c797a4,newTarget); local_8 = 9; if (tmpTargetRefCount != (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 == (int *)0x0) { KColor::SetFromARGB(&transparentColor,0); newTarget = KAGE_Graphics::create_render_target (colormodTarget,g_framebufferWidth,DAT_00c79114,(byte *)"Colormod Surface" ,clearColor_04); local_8 = 10; shared_ptr::operator_assign(&DAT_00c797ac,newTarget); local_8 = 0xb; if (colormodTargetRefCount != (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 Game::ReloadStagesXmlOnLuaReset /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (Game::ReloadStagesXmlOnLuaReset) */ void Game::ReloadStagesXmlOnLuaReset(void) { byte bVar1; byte *extraout_EAX; byte *extraout_EAX_00; byte *stagePathChars; undefined4 *extraout_EAX_01; undefined4 *extraout_EAX_02; undefined4 *xmlPathChars; 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_3fe1e7c421; temp_3fe1e7c421 = g_game; puStack_20 = (undefined1 *)(redirectedPathA + 0x14); puStack_18 = &LAB_00afbc2d; local_1c = ExceptionList; local_24 = __security_cookie ^ (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; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPathA,&fileName); local_14._0_1_ = 1; stagePathChars = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { stagePathChars = *(byte **)extraout_EAX; } RoomConfig::LoadStagesXml(&temp_3fe1e7c421->_roomConfig,stagePathChars); local_14 = (void *)((uint)local_14._1_3_ << 8); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; freePtr = redirectedPathA[0]; if (0xfff < freeSize) { freePtr = *(void **)((int)redirectedPathA[0] + -4); freeSize = redirectedPathACapacity + 0x24; if (0x1f < (uint)((int)redirectedPathA[0] + (-4 - (int)freePtr))) goto LAB_006f3d18; } operator_delete(freePtr,freeSize); } local_14 = (void *)0xffffffff; redirectedPathASize = 0; redirectedPathACapacity = 0xf; redirectedPathA[0] = (void *)((uint)redirectedPathA[0] & 0xffffff00); if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freePtr = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freePtr = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (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; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPathB,&fileName); local_14._0_1_ = 3; stagePathChars = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { stagePathChars = *(byte **)extraout_EAX_00; } RoomConfig::LoadCursesXml(&temp_3fe1e7c421->_roomConfig,stagePathChars,0); local_14 = (void *)CONCAT31(local_14._1_3_,2); if (0xf < redirectedPathBCapacity) { freeSize = redirectedPathBCapacity + 1; freePtr = redirectedPathB[0]; if (0xfff < freeSize) { freePtr = *(void **)((int)redirectedPathB[0] + -4); freeSize = redirectedPathBCapacity + 0x24; if (0x1f < (uint)((int)redirectedPathB[0] + (-4 - (int)freePtr))) goto LAB_006f3dfe; } operator_delete(freePtr,freeSize); } local_14 = (void *)0xffffffff; redirectedPathBSize = 0; redirectedPathBCapacity = 0xf; redirectedPathB[0] = (void *)((uint)redirectedPathB[0] & 0xffffff00); if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freePtr = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freePtr = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (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; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPathA,&fileName); local_14._0_1_ = 5; xmlPathChars = extraout_EAX_01; if (0xf < (uint)extraout_EAX_01[5]) { xmlPathChars = (undefined4 *)*extraout_EAX_01; } LoadMinibossesXml(xmlPathChars); local_14 = (void *)CONCAT31(local_14._1_3_,4); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; freePtr = redirectedPathA[0]; if (0xfff < freeSize) { freePtr = *(void **)((int)redirectedPathA[0] + -4); freeSize = redirectedPathACapacity + 0x24; if (0x1f < (uint)((int)redirectedPathA[0] + (-4 - (int)freePtr))) goto LAB_006f3eea; } operator_delete(freePtr,freeSize); } local_14 = (void *)0xffffffff; redirectedPathASize = 0; redirectedPathACapacity = 0xf; redirectedPathA[0] = (void *)((uint)redirectedPathA[0] & 0xffffff00); if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freePtr = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freePtr = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freePtr))) { LAB_006f3eea: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,freeSize); } fileName._capacity = 0xf; fileName._size = 0xb; builtin_strncpy(fileName._buf,"players.xml",0xc); local_14 = (void *)0x6; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPathB,&fileName); local_14._0_1_ = 7; xmlPathChars = extraout_EAX_02; if (0xf < (uint)extraout_EAX_02[5]) { xmlPathChars = (undefined4 *)*extraout_EAX_02; } EntityConfig::load_players_xml(xmlPathChars,0); local_14 = (void *)CONCAT31(local_14._1_3_,6); if (0xf < redirectedPathBCapacity) { freeSize = redirectedPathBCapacity + 1; freePtr = redirectedPathB[0]; if (0xfff < freeSize) { freePtr = *(void **)((int)redirectedPathB[0] + -4); freeSize = redirectedPathBCapacity + 0x24; if (0x1f < (uint)((int)redirectedPathB[0] + (-4 - (int)freePtr))) goto LAB_006f3fd9; } operator_delete(freePtr,freeSize); } local_14 = (void *)0xffffffff; redirectedPathBSize = 0; redirectedPathBCapacity = 0xf; redirectedPathB[0] = (void *)((uint)redirectedPathB[0] & 0xffffff00); if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freePtr = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freePtr = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freePtr))) { LAB_006f3fd9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,freeSize); } *(undefined4 *)&temp_3fe1e7c421->_gameOver = 0; *(undefined4 *)&(temp_3fe1e7c421->_gameOver).field_0x4 = 0; (temp_3fe1e7c421->_gameOver)._isStopSoundsPending = 0; *(undefined4 *)&temp_3fe1e7c421->field_0x1d64c = 0; ScoreSheet::LoadAnm2(); HUD::LoadGraphics(&temp_3fe1e7c421->_hud); PauseScreen::Init(&temp_3fe1e7c421->_pauseScreen); RevivePlayerMenu::Init(); GenericPrompt::Initialize(&temp_3fe1e7c421->_genericPrompt,0); VictoryRunPrompt::Load(extraout_ECX); fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; anm2PathBuf = std::_Allocate(0x20); fileName._size = 0x1d; fileName._capacity = 0x1f; builtin_strncpy(anm2PathBuf,"gfx/ui/completion_widget.anm2",0x1e); fileName._buf._0_4_ = anm2PathBuf; local_14 = (void *)0x8; ANM2::Load(&temp_3fe1e7c421->_completionWidgetSprite,&fileName,1); local_14 = (void *)0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freePtr = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freePtr = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,freeSize); } fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffffffffff00; bVar1 = ANM2::SetAnimation(&temp_3fe1e7c421->_completionWidgetSprite,s_Idle,1); if ((bVar1 != 0) && ((temp_3fe1e7c421->_completionWidgetSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(temp_3fe1e7c421->_completionWidgetSprite)._animState,0.0); if ((temp_3fe1e7c421->_completionWidgetSprite)._animState._animData != (void *)0x0) { (temp_3fe1e7c421->_completionWidgetSprite)._animState._isPlaying = 0; } } ExceptionList = local_1c; return; } //@@ 006f4170 FUN_006f4170 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_006f4170(void) { uint uVar1; basic_ostream_> *pbVar2; byte *pbVar3; undefined4 in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar4; void *pvVar5; int aiStack_190 [9]; basic_iostream_> abStack_16c [72]; basic_ios_> abStack_124 [68]; int aiStack_e0 [9]; basic_iostream_> abStack_bc [72]; basic_ios_> abStack_74 [72]; void *local_2c [5]; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afbc8b; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_14 = uVar1; std_stringstream_constructor(in_ECX); local_8 = (void *)0x0; pbVar2 = (basic_ostream_> *)FUN_00414b50(uVar1); std::basic_ostream_>::operator<< (pbVar2,CONCAT44(g_entitySpawnTimeMs._4_4_,(undefined4)g_entitySpawnTimeMs)); pbVar2 = (basic_ostream_> *)FUN_00414b50(); std::basic_ostream_>::operator<<(pbVar2,FUN_00414d30); pbVar3 = (byte *)FUN_00414250(local_2c); local_8._0_1_ = 1; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } KAGE_LogMessage(1,pbVar3); local_8 = (void *)((uint)local_8._1_3_ << 8); uVar4 = extraout_ECX; if (0xf < uStack_18) { uVar1 = uStack_18 + 1; pvVar5 = local_2c[0]; if (0xfff < uVar1) { pvVar5 = *(void **)((int)local_2c[0] + -4); uVar1 = uStack_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar1); uVar4 = extraout_ECX_00; } std_stringstream_constructor(uVar4); local_8._0_1_ = 2; pbVar2 = (basic_ostream_> *)FUN_00414b50(); std::basic_ostream_>::operator<< (pbVar2,CONCAT44(_DAT_00c79c44,_DAT_00c79c40)); pbVar2 = (basic_ostream_> *)FUN_00414b50(); std::basic_ostream_>::operator<<(pbVar2,FUN_00414d30); pbVar3 = (byte *)FUN_00414250(local_2c); local_8._0_1_ = 3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } KAGE_LogMessage(1,pbVar3); local_8._0_1_ = 2; if (0xf < uStack_18) { uVar1 = uStack_18 + 1; pvVar5 = local_2c[0]; if (0xfff < uVar1) { pvVar5 = *(void **)((int)local_2c[0] + -4); uVar1 = uStack_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar1); } local_8 = (void *)((uint)local_8._1_3_ << 8); *(undefined ***)((int)aiStack_e0 + *(int *)(aiStack_e0[1] + 4) + 4) = std::basic_stringstream,std::allocator_>::vftable; *(int *)((int)aiStack_e0 + *(int *)(aiStack_e0[1] + 4)) = *(int *)(aiStack_e0[1] + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>::~basic_iostream_> (abStack_bc); std::basic_ios_>::~basic_ios_>(abStack_74) ; AnmCache::LogMemoryUsage(); *(undefined ***)((int)aiStack_190 + *(int *)(aiStack_190[1] + 4) + 4) = std::basic_stringstream,std::allocator_>::vftable; *(int *)((int)aiStack_190 + *(int *)(aiStack_190[1] + 4)) = *(int *)(aiStack_190[1] + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>::~basic_iostream_> (abStack_16c); std::basic_ios_>::~basic_ios_> (abStack_124); ExceptionList = local_10; return; } //@@ 006f43b0 Game::reset_run_state /* DB: zeroes Game fields + ResetState; LoadConfigXmls/Exit */ void Game::reset_run_state(void) { void *pvVar1; Game *in_ECX; in_ECX->_isRerun = 0; in_ECX->_isDebug = 0; in_ECX->_frameCount = 0; in_ECX->_timeCounter = 0; in_ECX->_screenShakeTimer = 0; ResetState(in_ECX); in_ECX->_freezeFrames = 0; (in_ECX->_fadeInColor)._red = 0.0; (in_ECX->_fadeInColor)._green = 0.0; (in_ECX->_fadeInColor)._blue = 0.0; (in_ECX->_fadeInColor)._alpha = 0.0; in_ECX->_debugFlags = 0; (in_ECX->_fadeOutColor)._red = 0.0; (in_ECX->_fadeOutColor)._green = 0.0; (in_ECX->_fadeOutColor)._blue = 0.0; (in_ECX->_fadeOutColor)._alpha = 0.0; in_ECX->_debugCurses = 0; (in_ECX->_fadeInColor)._unk = 0; (in_ECX->_fadeOutColor)._unk = 0; in_ECX->_fadeOutTarget = 0; in_ECX->_restartHoldFrames = 0; in_ECX->_framesSinceRoomTransition = 0; (in_ECX->_dailyChallenge)._id = 0; (in_ECX->_dailyChallenge)._seed = 0; (in_ECX->_dailyChallenge)._specialDailyId = 0; (in_ECX->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(in_ECX->_dailyChallenge)._params); ScoreSheet::Reset(); (in_ECX->_currentColorModifier)._red = 1.0; (in_ECX->_currentColorModifier)._green = 1.0; (in_ECX->_currentColorModifier)._blue = 1.0; (in_ECX->_currentColorModifier)._amount = 0.0; in_ECX->_pixelationDuration = 0; in_ECX->_pixelationTimer = 0; in_ECX->_isStartingFromState = 0; in_ECX->_shouldLerpColorModState = 0; (in_ECX->_currentColorModifier)._brightness = 0.0; (in_ECX->_currentColorModifier)._contrast = 1.0; pvVar1 = (in_ECX->_erasedEntities)._begin; in_ECX->_lightningIntensity = 0.0; in_ECX->_dizzyIntensity = 0.0; in_ECX->_dizzyTargetIntensity = 0.0; in_ECX->_dizzyIntensityChangeSpeed = 0.001; in_ECX->_isRoomRespawned = 0; in_ECX->_magicSkinUses = 0; (in_ECX->_erasedEntities)._end = pvVar1; in_ECX->_isPocketItemRewindSaved = 0; return; } //@@ 006f4520 Game::ResetState /* ZHL [exact] __thiscall void Game::ResetState(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Game::ResetState(Game *this) { 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; *(undefined4 *)&this->_gameStateFlags = 0; *(undefined4 *)((int)&this->_gameStateFlags + 4) = 0; this->_ascentTimer = 0; this->field_0x67aa8 = 0; *(undefined4 *)&this->field_0x67a9c = 0; *(undefined4 *)&this->field_0x67aa0 = 0; this->field_0x67dc8 = 0; *(undefined4 *)&this->field_0x67dbc = 0; *(undefined4 *)&this->field_0x67dc0 = 0; this->field_0x680e8 = 0; *(undefined4 *)&this->field_0x680dc = 0; *(undefined4 *)&this->field_0x680e0 = 0; this->field_0x68408 = 0; *(undefined4 *)&this->field_0x683fc = 0; *(undefined4 *)&this->field_0x68400 = 0; this->field_0x68728 = 0; *(undefined4 *)&this->field_0x6871c = 0; *(undefined4 *)&this->field_0x68720 = 0; this->field_0x68a48 = 0; *(undefined4 *)&this->field_0x68a3c = 0; *(undefined4 *)&this->field_0x68a40 = 0; this->field_0x68d68 = 0; *(undefined4 *)&this->field_0x68d5c = 0; *(undefined4 *)&this->field_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; *(undefined4 *)(this->_encounteredBosses + 4) = *(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 Game::LoadConfigXmls /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (Game::LoadConfigXmls(stages,curses,...)) */ void Game::LoadConfigXmls(void) { Game *pGVar1; byte isIdleSet; char isReleased; byte *extraout_EAX; byte *extraout_EAX_00; byte *stagesPath; undefined4 *extraout_EAX_01; undefined4 *extraout_EAX_02; char *longNameBuf; undefined4 *extraout_EAX_03; undefined4 *extraout_EAX_04; undefined4 *extraout_EAX_05; undefined4 *puVar2; 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 = (undefined1 *)(local_6c + 0x1a); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00afbd65; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_6c + 0x17); ExceptionList = &local_1c; reset_run_state(local_24); manager = g_manager; pGVar1->_challenge = 0; pGVar1->_isRerun = 0; (pGVar1->_screenShakeOffset).x = g_vectorZero.x; (pGVar1->_screenShakeOffset).y = g_vectorZero.y; pGVar1->_isPocketItemRewindSaved = 0; *(undefined4 *)&pGVar1->field_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; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)local_6c,&tmpName); local_14._0_1_ = 1; stagesPath = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { stagesPath = *(byte **)extraout_EAX; } RoomConfig::LoadStagesXml(&pGVar1->_roomConfig,stagesPath); local_14 = (void *)((uint)local_14._1_3_ << 8); if (0xf < local_58) { uVar4 = local_58 + 1; pvVar3 = local_6c[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_6c[0] + -4); uVar4 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar3))) goto LAB_006f48a1; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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; ModManager::TryRedirectPath(&g_manager->_modManager,&tmpPath,&tmpName); local_14._0_1_ = 3; stagesPath = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { stagesPath = *(byte **)extraout_EAX_00; } RoomConfig::LoadCursesXml(&pGVar1->_roomConfig,stagesPath,0); local_14 = (void *)CONCAT31(local_14._1_3_,2); if (0xf < tmpPath._capacity) { uVar4 = tmpPath._capacity + 1; pvVar3 = (void *)tmpPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpPath._buf._0_4_ + -4); uVar4 = tmpPath._capacity + 0x24; if (0x1f < (uint)(tmpPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_006f4987; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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; ModManager::TryRedirectPath(&g_manager->_modManager,&tmpPath,&tmpName); local_14._0_1_ = 5; puVar2 = extraout_EAX_01; if (0xf < (uint)extraout_EAX_01[5]) { puVar2 = (undefined4 *)*extraout_EAX_01; } LoadMinibossesXml(puVar2); local_14 = (void *)CONCAT31(local_14._1_3_,4); if (0xf < tmpPath._capacity) { uVar4 = tmpPath._capacity + 1; pvVar3 = (void *)tmpPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpPath._buf._0_4_ + -4); uVar4 = tmpPath._capacity + 0x24; if (0x1f < (uint)(tmpPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_006f4a84; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)local_6c,&tmpName); local_14._0_1_ = 7; puVar2 = extraout_EAX_02; if (0xf < (uint)extraout_EAX_02[5]) { puVar2 = (undefined4 *)*extraout_EAX_02; } load_giantbook_xml(puVar2); local_14 = (void *)CONCAT31(local_14._1_3_,6); if (0xf < local_58) { uVar4 = local_58 + 1; pvVar3 = local_6c[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_6c[0] + -4); uVar4 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar3))) goto LAB_006f4b6e; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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); tmpName._buf._0_4_ = longNameBuf; local_14 = (void *)0x8; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&tmpName); local_14._0_1_ = 9; puVar2 = extraout_EAX_03; if (0xf < (uint)extraout_EAX_03[5]) { puVar2 = (undefined4 *)*extraout_EAX_03; } load_bossoverlays_xml(puVar2); local_14 = (void *)CONCAT31(local_14._1_3_,8); if (0xf < tmpPath._capacity) { uVar4 = tmpPath._capacity + 1; pvVar3 = (void *)tmpPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpPath._buf._0_4_ + -4); uVar4 = tmpPath._capacity + 0x24; if (0x1f < (uint)(tmpPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_006f4c52; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (int)pvVar3))) { LAB_006f4c52: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } *(undefined4 *)&pGVar1->_gameOver = 0; *(undefined4 *)&(pGVar1->_gameOver).field_0x4 = 0; (pGVar1->_gameOver)._isStopSoundsPending = 0; *(undefined4 *)&pGVar1->field_0x1d64c = 0; ScoreSheet::LoadAnm2(); OnlineEmotes::init(); CompletionWidget::Load(); FUN_009a1970(); PauseScreen::Init(&pGVar1->_pauseScreen); RevivePlayerMenu::Init(); Minimap::Init(&pGVar1->_minimap); 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; ModManager::TryRedirectPath(&g_manager->_modManager,&tmpPath,&tmpName); local_14._0_1_ = 0xb; puVar2 = extraout_EAX_04; if (0xf < (uint)extraout_EAX_04[5]) { puVar2 = (undefined4 *)*extraout_EAX_04; } LoadBossRushXml(puVar2); local_14 = (void *)CONCAT31(local_14._1_3_,10); if (0xf < tmpPath._capacity) { uVar4 = tmpPath._capacity + 1; pvVar3 = (void *)tmpPath._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpPath._buf._0_4_ + -4); uVar4 = tmpPath._capacity + 0x24; if (0x1f < (uint)(tmpPath._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_006f4da8; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)local_6c,&tmpName); local_14._0_1_ = 0xd; puVar2 = extraout_EAX_05; if (0xf < (uint)extraout_EAX_05[5]) { puVar2 = (undefined4 *)*extraout_EAX_05; } load_preloads_xml(puVar2); local_14 = (void *)CONCAT31(local_14._1_3_,0xc); if (0xf < local_58) { uVar4 = local_58 + 1; pvVar3 = local_6c[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_6c[0] + -4); uVar4 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar3))) goto LAB_006f4e94; } operator_delete(pvVar3,uVar4); } local_14 = (void *)0xffffffff; local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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; PreloadManager::load_group(&tmpPath); local_14 = (void *)0xffffffff; tmpName._capacity = 0xf; tmpName._size = 0; tmpName._buf._0_8_ = tmpName._buf._0_8_ & 0xffffffff00000000; std::string::assign(tmpName._buf,&DAT_00b68200,5); local_14 = (void *)0xf; PreloadManager::load_group(&tmpName); local_14 = (void *)0xffffffff; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_006f5040; } operator_delete(pvVar3,uVar4); } tmpName._size = 0; tmpName._capacity = 0xf; tmpName._buf._0_8_ = tmpName._buf._0_8_ & 0xffffffff00000000; std::string::assign(tmpName._buf,(byte *)"pickups",7); local_14 = (void *)0x10; PreloadManager::load_group(&tmpName); local_14 = (void *)0xffffffff; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (int)pvVar3))) goto LAB_006f5040; } operator_delete(pvVar3,uVar4); } tmpName._size = 0; tmpName._capacity = 0xf; tmpName._buf._0_8_ = tmpName._buf._0_8_ & 0xffffffff00000000; std::string::assign(tmpName._buf,(byte *)"icons",5); local_14 = (void *)0x11; PreloadManager::load_group(&tmpName); local_14 = (void *)0xffffffff; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (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; GenericPrompt::Initialize(&pGVar1->_genericPrompt,0); VictoryRunPrompt::Load(extraout_ECX); tmpName._size = 0; tmpName._capacity = 0xf; tmpName._buf._0_8_ = tmpName._buf._0_8_ & 0xffffffff00000000; std::string::assign(tmpName._buf,(byte *)"gfx/ui/completion_widget.anm2",0x1d); local_14 = (void *)0x12; ANM2::Load(&pGVar1->_completionWidgetSprite,&tmpName,1); local_14 = (void *)0xffffffff; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; pvVar3 = (void *)tmpName._buf._0_4_; if (0xfff < uVar4) { pvVar3 = *(void **)(tmpName._buf._0_4_ + -4); uVar4 = tmpName._capacity + 0x24; if (0x1f < (uint)(tmpName._buf._0_4_ + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } isIdleSet = ANM2::SetAnimation(&pGVar1->_completionWidgetSprite,s_Idle,1); if ((isIdleSet != 0) && ((pGVar1->_completionWidgetSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pGVar1->_completionWidgetSprite)._animState,0.0); if ((pGVar1->_completionWidgetSprite)._animState._animData != (void *)0x0) { (pGVar1->_completionWidgetSprite)._animState._isPlaying = 0; } } if (*(int *)pGVar1->_giantBookClickerImage == 0) { pvVar3 = Manager::LoadImage(loadedImage,(byte *)"gfx/ui/giantbook/GiantBook_Clicker.png"); local_14 = (void *)0x13; KAGE::SmartPointer::operator_assign(pGVar1->_giantBookClickerImage,pvVar3); local_14 = (void *)0x14; if (loadedImageRefCount != (int *)0x0) { isReleased = (**(code **)(*loadedImageRefCount + 0xc))(); if ((isReleased != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImage); } } local_14 = (void *)0xffffffff; clickerImage = *(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 = (undefined4 *)&pGVar1->field_0x1bc14; do { puVar2[1] = *puVar2; entriesLeft = entriesLeft + -1; puVar2 = puVar2 + 0xd; } while (entriesLeft != 0); pGVar1->field_0x1c030 = 0; FUN_00686060(); ExceptionList = local_1c; return; } //@@ 006f5210 Game::Fadein /* ZHL [lua] Lua binding Game:Fadein */ void __thiscall Game::Fadein(Game *this,float param_2,byte param_3,float *param_4) { byte bVar1; int iVar2; float fVar3; float fVar4; int *piVar5; float fVar6; bVar1 = this->_isInstantFadeIn; fVar6 = param_4[1]; fVar3 = param_4[2]; fVar4 = param_4[3]; (this->_fadeInColor)._red = *param_4; (this->_fadeInColor)._green = fVar6; (this->_fadeInColor)._blue = fVar3; (this->_fadeInColor)._alpha = fVar4; (this->_fadeInColor)._unk = (int)param_4[4]; if (bVar1 == 0) { fVar6 = 1.0; } else { fVar6 = 1e-05; } (this->_fadeInColor)._alpha = fVar6; this->_fadeSpeed = param_2; this->_isFadeInIconShown = param_3; piVar5 = (this->_playerManager)._playerList._begin; if (piVar5 != (this->_playerManager)._playerList._end) { do { iVar2 = *piVar5; piVar5 = piVar5 + 1; *(undefined1 *)(iVar2 + 0x410) = 0; } while (piVar5 != (this->_playerManager)._playerList._end); } return; } //@@ 006f5290 Game::Fadeout /* ZHL [lua] Lua binding Game:Fadeout */ void __thiscall Game::Fadeout(Game *this,float param_2,uint param_3,float *param_4) { float fVar1; float fVar2; float fVar3; float fVar4; if (param_3 < 0xc) { this->_fadeSpeed = param_2; fVar1 = *param_4; fVar2 = param_4[1]; fVar3 = param_4[2]; fVar4 = (this->_fadeOutColor)._alpha; this->_fadeOutTarget = param_3; (this->_fadeOutColor)._red = fVar1; (this->_fadeOutColor)._green = fVar2; (this->_fadeOutColor)._blue = fVar3; (this->_fadeOutColor)._alpha = fVar4; (this->_fadeOutColor)._unk = 0; (this->_fadeOutColor)._alpha = param_2 + (this->_fadeOutColor)._alpha; return; } KAGE_LogMessage(8,(byte *)"Invalid target specified to Game::Fadeout()\n"); return; } //@@ 006f5320 Game::Start /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Game::Start(int playertype,int challenge,Seeds seeds,unsigned int difficulty); */ void __thiscall Game::Start(undefined4 param_1,int param_2,int param_3,undefined4 param_4,int param_5) { void **seedEffectSet; byte bVar1; Seeds *other; ChallengeParam *challengeParams; byte *extraout_EAX; undefined4 *onlineStatEntry; int unusedArg; void *pvVar2; int iVar3; uint uVar4; Seeds *game; int *playerIt; byte *filename; void *in_stack_00000060; int in_stack_00000068; Seeds seedsCopy; void *itemPoolPath [4]; uint itemPoolPathSize; uint itemPoolPathCapacity; undefined1 tmpString [12]; undefined4 uStack_20; int *piStack_1c; uint tmpStringCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; int *playersEnd; game = g_game; puStack_c = &LAB_00afbdc8; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(tmpString + 0x28); ExceptionList = &local_10; local_8 = 0; iVar3 = 0x15; pvVar2 = (g_game->_onlinePlayerStats)._begin; onlineStatEntry = (undefined4 *)&g_game->field_0x1bc14; g_game->_isStarted = 1; (game->_onlinePlayerStats)._end = pvVar2; do { onlineStatEntry[1] = *onlineStatEntry; iVar3 = iVar3 + -1; onlineStatEntry = onlineStatEntry + 0xd; } while (iVar3 != 0); game->field_0x1c030 = 0; game->_difficulty = in_stack_00000068; game->_challenge = param_3; manager = g_manager; *(undefined4 *)&game->field_0x68d74 = 0; game->_victoryLap = 0; game->_isConsoleUsedThisRun = manager->_isConsoleEnabled; HUD::LoadGraphics(&game->_hud); if (param_5 == 0) { KAGE_LogMessage(0x10,(byte *)"Start seed is not initialized"); } Seeds::construct_from_copy(&seedsCopy,(Seeds *)¶m_4); local_8._0_1_ = 1; Seeds::operator_assign(&game->_seedEffects,other); local_8 = (uint)local_8._1_3_ << 8; FID_conflict__Erase_tree_>_> (&seedsCopy._seedEffects, (fuzzer_allocator_> *)&seedsCopy._seedEffects, *(_Tree_node **)((int)seedsCopy._seedEffects + 4)); operator_delete(seedsCopy._seedEffects,0x14); if (game->_challenge != 0) { pvVar2 = (game->_seedEffects)._seedEffects; seedEffectSet = &(game->_seedEffects)._seedEffects; FID_conflict__Erase_tree_>_> (seedEffectSet,(fuzzer_allocator_> *)seedEffectSet, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (game->_seedEffects)._seedEffectsCount = 0; challengeParams = GetChallengeParams(game); uVar4 = 0; if ((int)(challengeParams->_seedEffects)._end - (int)(challengeParams->_seedEffects)._begin >> 2 != 0) { do { Seeds::AddSeedEffect (&game->_seedEffects, *(int *)((int)(challengeParams->_seedEffects)._begin + uVar4 * 4)); uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(challengeParams->_seedEffects)._end - (int)(challengeParams->_seedEffects)._begin >> 2)); } } game = &game->_seedEffects; iVar3 = Seeds::GetNextSeed(game); manager = g_manager; (game->_fortuneRNG)._seed = iVar3; (game->_fortuneRNG)._shift1 = 5; (game->_fortuneRNG)._shift2 = 9; (game->_fortuneRNG)._shift3 = 7; if ((((game->_isCustomRun == 0) && (bVar1 = Seeds::AchievementUnlocksDisallowed(game), bVar1 == 0)) && (bVar1 = Manager::IsGameplayInputActive(unusedArg), bVar1 == 0)) && ((game->_isRerun == 0 && (game->_challenge == 0)))) { bVar1 = 0; } else { bVar1 = 1; } KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = bVar1; uVar4 = (game->_seedEffects)._gameStartSeed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar4 = (game->_seedEffects)._gameStartSeed; } if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar4 = (game->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)tmpString,uVar4); local_8._0_1_ = 2; KAGE_LogMessage(1,(byte *)"RNG Start Seed: %s (%u) [New, %d]\n"); local_8 = (uint)local_8._1_3_ << 8; if (0xf < tmpStringCapacity) { uVar4 = tmpStringCapacity + 1; pvVar2 = (void *)tmpString._0_4_; if (0xfff < uVar4) { pvVar2 = *(void **)(tmpString._0_4_ + -4); uVar4 = tmpStringCapacity + 0x24; if (0x1f < (uint)(tmpString._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } init_procedural_item_surfaces(&game->_proceduralItemManager); tmpString[8] = 's'; tmpString[9] = '.'; tmpString[10] = 'x'; tmpString[0xb] = 'm'; tmpStringCapacity = 0xf; piStack_1c = (int *)&DAT_0000000d; tmpString._0_8_ = 0x6c6f6f706d657469; uStack_20 = (int *)CONCAT22(uStack_20._2_2_,0x6c); local_8._0_1_ = 3; ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)itemPoolPath,(std_string *)tmpString); local_8._0_1_ = 4; filename = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { filename = *(byte **)extraout_EAX; } uVar4 = Seeds::GetNextSeed(game); ItemPool::Init(&game->_itemPool,uVar4,filename); local_8._0_1_ = 3; if (0xf < itemPoolPathCapacity) { uVar4 = itemPoolPathCapacity + 1; pvVar2 = itemPoolPath[0]; if (0xfff < uVar4) { pvVar2 = *(void **)((int)itemPoolPath[0] + -4); uVar4 = itemPoolPathCapacity + 0x24; if (0x1f < (uint)((int)itemPoolPath[0] + (-4 - (int)pvVar2))) goto LAB_006f56df; } operator_delete(pvVar2,uVar4); } local_8._0_1_ = 0; itemPoolPathSize = 0; itemPoolPathCapacity = 0xf; itemPoolPath[0] = (void *)((uint)itemPoolPath[0] & 0xffffff00); if (0xf < tmpStringCapacity) { uVar4 = tmpStringCapacity + 1; pvVar2 = (void *)tmpString._0_4_; if (0xfff < uVar4) { pvVar2 = *(void **)(tmpString._0_4_ + -4); uVar4 = tmpStringCapacity + 0x24; if (0x1f < (uint)(tmpString._0_4_ + (-4 - (int)pvVar2))) { LAB_006f56df: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } iVar3 = (game->_seedEffects)._gameStartSeed; if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); iVar3 = (game->_seedEffects)._gameStartSeed; } BossPool::init(iVar3); if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player (&game->_playerManager,param_2,(game->_seedEffects)._playerInitSeed); Level::SetNextStage((Level *)game); if (param_3 == 0x1f) { Level::SetStage((Level *)game,0xb,0); } Level::Init(1); std::vector::copy_constructor(&game->_playerManager); playersEnd = piStack_1c; local_8._0_1_ = 5; for (playerIt = uStack_20; playerIt != playersEnd; playerIt = playerIt + 1) { if (*(int *)(*playerIt + 0x2c) == 0) { Entity_Player::InitPostLevelInitStats(); } } local_8 = (uint)local_8._1_3_ << 8; FID_conflict__Tidy(&uStack_20); Manager::save_game_state(); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); tmpStringCapacity = 0; tmpString._0_8_ = tmpString._0_8_ & 0xffffffff; tmpString[8] = '\0'; tmpString[9] = '\0'; tmpString[10] = '\0'; tmpString[0xb] = '\0'; uStack_20._0_1_ = '\0'; uStack_20._1_1_ = '\0'; uStack_20._2_1_ = '\0'; uStack_20._3_1_ = '\0'; piStack_1c = (int *)0x3f800000; Fadein(game,0x3d23d70a,1,tmpString + 4); FUN_009b5cb0(); *(undefined4 *)(game->_encounteredBosses + 4) = *(undefined4 *)game->_encounteredBosses; Room::Update(); game->_framesSinceRoomTransition = 0; LuaEngine::PostGameStart(0); FID_conflict__Erase_tree_>_> (&stack0x00000060, (fuzzer_allocator_> *)&stack0x00000060, *(_Tree_node **)((int)in_stack_00000060 + 4)); operator_delete(in_stack_00000060,0x14); ExceptionList = local_10; return; } //@@ 006f5850 FUN_006f5850 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_006f5850(int *param_1,int *param_2,int param_3,undefined4 param_4,int param_5) { Seeds *this; NetplayManager NVar1; NetplayManager NVar2; code *pcVar3; std_string seed; Game *this_00; Game *pGVar4; Manager *pMVar5; int *piVar6; byte bVar7; Seeds *other; byte *extraout_EAX; int *piVar8; int unusedArg; HUD *this_01; uint uVar9; byte *filename; PlayerManager *this_02; int iVar10; void *in_stack_00000064; int in_stack_0000006c; int in_stack_00000070; std_string asStackY_d2c [128]; undefined4 in_stack_fffffeec; undefined4 in_stack_fffffef0; void *pvVar11; undefined4 in_stack_fffffef4; void *messageRefCount; undefined4 uVar12; void **ppvVar13; _Tree_node *p_Var14; Seeds SStack_d4; void *apvStack_74 [4]; uint uStack_64; uint uStack_60; void *apvStack_5c [4]; uint uStack_4c; uint uStack_48; void *apvStack_44 [4]; uint uStack_34; uint uStack_30; undefined1 auStack_2c [12]; undefined4 uStack_20; int *piStack_1c; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar10 = in_stack_00000070; this_00 = g_game; puStack_c = &LAB_00afbe40; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(auStack_2c + 0x28); ExceptionList = &local_10; local_8 = 0; KAGE_LogMessage(1,(byte *)"Start Networked \n"); NVar1 = *(NetplayManager *)(g_manager + 1); NVar2 = g_manager->_netplayManager; pvVar11 = this_00->_entityFactory; *(undefined4 *)((int)pvVar11 + 0x130000) = 0; *(undefined4 *)((int)pvVar11 + 0x16d208) = 0; *(undefined4 *)((int)pvVar11 + 0x194810) = 0; *(undefined4 *)((int)pvVar11 + 0x223818) = 0; *(undefined4 *)((int)pvVar11 + 0x32c820) = 0; *(undefined4 *)((int)pvVar11 + 0x357c28) = 0; *(undefined4 *)((int)pvVar11 + 0x435c30) = 0; *(undefined4 *)((int)pvVar11 + 0x460438) = 0; *(undefined4 *)((int)pvVar11 + 0x64c440) = 0; *(undefined4 *)((int)pvVar11 + 0x675c48) = 0; *(undefined4 *)((int)pvVar11 + 0x696450) = 0; *(undefined4 *)((int)pvVar11 + 0x6aac58) = 0; *(undefined2 *)&this_00->_isStarted = 0x101; if (iVar10 == 0) { (this_00->_dailyChallenge)._id = *param_2; (this_00->_dailyChallenge)._seed = param_2[1]; (this_00->_dailyChallenge)._isPractice = *(byte *)(param_2 + 2); (this_00->_dailyChallenge)._specialDailyId = param_2[3]; daily_challenge_params_assign(); this_00->_difficulty = in_stack_0000006c; this_00->_challenge = param_3; pMVar5 = g_manager; this_00->_victoryLap = 0; this_00->_isConsoleUsedThisRun = pMVar5->_isConsoleEnabled; HUD::LoadGraphics(&this_00->_hud); if (param_5 == 0) { KAGE_LogMessage(0x10,(byte *)"Start seed is not initialized"); } if ((this_00->_dailyChallenge)._id == 0) { Seeds::construct_from_copy(&SStack_d4,(Seeds *)¶m_4); local_8._0_1_ = 2; Seeds::operator_assign(&this_00->_seedEffects,other); local_8 = (uint)local_8._1_3_ << 8; FID_conflict__Erase_tree_>_> (&SStack_d4._seedEffects, (fuzzer_allocator_> *)&SStack_d4._seedEffects, *(_Tree_node **)((int)SStack_d4._seedEffects + 4)); operator_delete(SStack_d4._seedEffects,0x14); if (this_00->_challenge != 0) { pvVar11 = (this_00->_seedEffects)._seedEffects; ppvVar13 = &(this_00->_seedEffects)._seedEffects; FID_conflict__Erase_tree_>_> (ppvVar13,(fuzzer_allocator_> *)ppvVar13, *(_Tree_node **)((int)pvVar11 + 4)); *(void **)((int)pvVar11 + 4) = pvVar11; *(void **)pvVar11 = pvVar11; *(void **)((int)pvVar11 + 8) = pvVar11; (this_00->_seedEffects)._seedEffectsCount = 0; } } else { iVar10 = (this_00->_dailyChallenge)._params._difficulty; this_00->_challenge = 0; pvVar11 = (this_00->_seedEffects)._seedEffects; (this_00->_seedEffects)._gameStartSeed = 0; (this_00->_seedEffects)._isCustomRun = 0; ppvVar13 = &(this_00->_seedEffects)._seedEffects; this_00->_difficulty = iVar10; p_Var14 = *(_Tree_node **)((int)pvVar11 + 4); uVar12 = 0x6f5a6a; FID_conflict__Erase_tree_>_> (ppvVar13,(fuzzer_allocator_> *)ppvVar13,p_Var14 ); *(void **)((int)pvVar11 + 4) = pvVar11; *(void **)pvVar11 = pvVar11; *(void **)((int)pvVar11 + 8) = pvVar11; (this_00->_seedEffects)._seedEffectsCount = 0; this = &this_00->_seedEffects; this->_isCustomRun = 1; Seeds::Seed2String(asStackY_d2c + 0x81,(this_00->_dailyChallenge)._seed); seed._buf[4] = (char)in_stack_fffffef0; seed._buf[5] = (char)((uint)in_stack_fffffef0 >> 8); seed._buf[6] = (char)((uint)in_stack_fffffef0 >> 0x10); seed._buf[7] = (char)((uint)in_stack_fffffef0 >> 0x18); seed._buf[0] = (char)in_stack_fffffeec; seed._buf[1] = (char)((uint)in_stack_fffffeec >> 8); seed._buf[2] = (char)((uint)in_stack_fffffeec >> 0x10); seed._buf[3] = (char)((uint)in_stack_fffffeec >> 0x18); seed._buf[8] = (char)in_stack_fffffef4; seed._buf[9] = (char)((uint)in_stack_fffffef4 >> 8); seed._buf[10] = (char)((uint)in_stack_fffffef4 >> 0x10); seed._buf[0xb] = (char)((uint)in_stack_fffffef4 >> 0x18); seed._buf[0xc] = (char)uVar12; seed._buf[0xd] = (char)((uint)uVar12 >> 8); seed._buf[0xe] = (char)((uint)uVar12 >> 0x10); seed._buf[0xf] = (char)((uint)uVar12 >> 0x18); seed._size = (uint)ppvVar13; seed._capacity = (uint)p_Var14; Seeds::SetStartSeed(this,seed); uVar9 = 0; if ((int)(this_00->_dailyChallenge)._params._seedEffects._end - (int)(this_00->_dailyChallenge)._params._seedEffects._begin >> 2 != 0) { do { Seeds::AddSeedEffect (this,*(int *)((int)(this_00->_dailyChallenge)._params._seedEffects._begin + uVar9 * 4)); uVar9 = uVar9 + 1; } while (uVar9 < (uint)((int)(this_00->_dailyChallenge)._params._seedEffects._end - (int)(this_00->_dailyChallenge)._params._seedEffects._begin >> 2)); } pMVar5 = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar5->_persistentGameData)._isReadOnly = 1; uVar9 = (this_00->_seedEffects)._gameStartSeed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar9 = (this_00->_seedEffects)._gameStartSeed; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar9 = (this_00->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)apvStack_44,uVar9); local_8._0_1_ = 1; KAGE_LogMessage(1,(byte *)"RNG Start Seed: %s (%u) [Daily, %d]\n"); local_8 = (uint)local_8._1_3_ << 8; if (0xf < uStack_30) { uVar9 = uStack_30 + 1; pvVar11 = apvStack_44[0]; if (0xfff < uVar9) { pvVar11 = *(void **)((int)apvStack_44[0] + -4); uVar9 = uStack_30 + 0x24; if (0x1f < (uint)((int)apvStack_44[0] + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar9); } uStack_34 = 0; uStack_30 = 0xf; apvStack_44[0] = (void *)((uint)apvStack_44[0] & 0xffffff00); } pMVar5 = g_manager; if (((((this_00->_seedEffects)._isCustomRun == 0) && (bVar7 = Seeds::AchievementUnlocksDisallowed(&this_00->_seedEffects), bVar7 == 0)) && (bVar7 = Manager::IsGameplayInputActive(unusedArg), bVar7 == 0)) && ((this_00->_isRerun == 0 && (this_00->_challenge == 0)))) { bVar7 = 0; } else { bVar7 = 1; } KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar5->_persistentGameData)._isReadOnly = bVar7; if ((this_00->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } uVar9 = (this_00->_seedEffects)._rng._seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = (this_00->_seedEffects)._rng._seed; if (uVar9 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar9 = uVar9 >> ((byte)(this_00->_seedEffects)._rng._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(this_00->_seedEffects)._rng._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(this_00->_seedEffects)._rng._shift3 & 0x1f) ^ uVar9; (this_00->_seedEffects)._rng._seed = uVar9; (this_00->_fortuneRNG)._seed = uVar9; (this_00->_fortuneRNG)._shift1 = 5; (this_00->_fortuneRNG)._shift2 = 9; (this_00->_fortuneRNG)._shift3 = 7; uVar9 = (this_00->_seedEffects)._gameStartSeed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar9 = (this_00->_seedEffects)._gameStartSeed; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar9 = (this_00->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)apvStack_5c,uVar9); local_8._0_1_ = 3; KAGE_LogMessage(1,(byte *)"RNG Start Seed: %s (%u) [Net, %d]\n"); local_8 = (uint)local_8._1_3_ << 8; if (0xf < uStack_48) { uVar9 = uStack_48 + 1; pvVar11 = apvStack_5c[0]; if (0xfff < uVar9) { pvVar11 = *(void **)((int)apvStack_5c[0] + -4); uVar9 = uStack_48 + 0x24; if (0x1f < (uint)((int)apvStack_5c[0] + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar9); } uStack_4c = 0; uStack_48 = 0xf; apvStack_5c[0] = (void *)((uint)apvStack_5c[0] & 0xffffff00); init_procedural_item_surfaces(&this_00->_proceduralItemManager); auStack_2c[8] = 's'; auStack_2c[9] = '.'; auStack_2c[10] = 'x'; auStack_2c[0xb] = 'm'; uStack_18 = 0xf; piStack_1c = (int *)&DAT_0000000d; auStack_2c._0_8_ = 0x6c6f6f706d657469; uStack_20 = (int *)CONCAT22(uStack_20._2_2_,0x6c); local_8._0_1_ = 4; ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)apvStack_74,(std_string *)auStack_2c); local_8 = CONCAT31(local_8._1_3_,5); filename = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { filename = *(byte **)extraout_EAX; } if ((this_00->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } uVar9 = (this_00->_seedEffects)._rng._seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = (this_00->_seedEffects)._rng._seed; if (uVar9 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar9 = uVar9 >> ((byte)(this_00->_seedEffects)._rng._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(this_00->_seedEffects)._rng._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(this_00->_seedEffects)._rng._shift3 & 0x1f) ^ uVar9; (this_00->_seedEffects)._rng._seed = uVar9; ItemPool::Init(&this_00->_itemPool,uVar9,filename); local_8._0_1_ = 4; if (0xf < uStack_60) { uVar9 = uStack_60 + 1; pvVar11 = apvStack_74[0]; if (0xfff < uVar9) { pvVar11 = *(void **)((int)apvStack_74[0] + -4); uVar9 = uStack_60 + 0x24; if (0x1f < (uint)((int)apvStack_74[0] + (-4 - (int)pvVar11))) goto LAB_006f5f27; } operator_delete(pvVar11,uVar9); } local_8._0_1_ = 0; uStack_64 = 0; uStack_60 = 0xf; apvStack_74[0] = (void *)((uint)apvStack_74[0] & 0xffffff00); if (0xf < uStack_18) { uVar9 = uStack_18 + 1; pvVar11 = (void *)auStack_2c._0_4_; if (0xfff < uVar9) { pvVar11 = *(void **)(auStack_2c._0_4_ + -4); uVar9 = uStack_18 + 0x24; if (0x1f < (uint)(auStack_2c._0_4_ + (-4 - (int)pvVar11))) { LAB_006f5f27: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar9); } auStack_2c._0_8_ = auStack_2c._0_8_ & 0xffffffffffffff00; if ((this_00->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } BossPool::init(); Game::add_players(this_00,param_1,(uint)(NVar2 != NVar1)); uVar9 = 0; this_02 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(this_02->_playerList)._begin >> 2 != 0) { do { pvVar11 = (this_02->_playerList)._end; if ((int)pvVar11 - (int)(this_02->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar11 = (this_02->_playerList)._end; } piVar8 = (this_02->_playerList)._begin; if (uVar9 < (uint)((int)pvVar11 - (int)piVar8 >> 2)) { piVar8 = piVar8 + uVar9; } PlayerManager::GetPlayerSlotFromController(this_02,*(int *)(*piVar8 + 0x1618)); uVar9 = uVar9 + 1; this_02 = &g_game->_playerManager; } while (uVar9 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(this_02->_playerList)._begin >> 2)); } this_01 = &g_game->_hud; (this_00->_playerManager)._coopSlots[0]._controllerIndex = -1; (this_00->_playerManager)._coopSlots[1]._controllerIndex = -1; (this_00->_playerManager)._coopSlots[0]._state = -1; (this_00->_playerManager)._coopSlots[0]._menuPosition = 0.0; (this_00->_playerManager)._coopSlots[0]._playerType = 0; (this_00->_playerManager)._coopSlots[1]._state = -1; (this_00->_playerManager)._coopSlots[1]._menuPosition = 0.0; (this_00->_playerManager)._coopSlots[1]._playerType = 0; (this_00->_playerManager)._coopSlots[2]._controllerIndex = -1; (this_00->_playerManager)._coopSlots[2]._state = -1; (this_00->_playerManager)._coopSlots[2]._menuPosition = 0.0; (this_00->_playerManager)._coopSlots[2]._playerType = 0; (this_00->_playerManager)._coopSlots[3]._controllerIndex = -1; (this_00->_playerManager)._coopSlots[3]._state = -1; (this_00->_playerManager)._coopSlots[3]._menuPosition = 0.0; (this_00->_playerManager)._coopSlots[3]._playerType = 0; HUD::AssignPlayerHUDs(this_01); Level::SetNextStage((Level *)this_00); if (param_3 == 0x1f) { iVar10 = this_00->_stage; if ((0 < iVar10) && ((6 < iVar10 || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { if ((this_00->_stageType == 4) || (this_00->_stageType == 5)) { iVar10 = iVar10 + 1; } if (iVar10 < 8) { Game::SaveBackwardsStage(iVar10); } } pMVar5 = g_manager; pGVar4 = g_game; this_00->_stage = 0xb; this_00->_stageType = 0; pMVar5->field_0x21c10 = 0; if ((pGVar4->_difficulty == 2) || (iVar10 = 0xf, pGVar4->_difficulty == 3)) { iVar10 = 0x11; } (pMVar5->_nightmareScene)._stageBarIcons[0xb] = iVar10; if ((((pGVar4->_difficulty == 2) || (pGVar4->_difficulty == 3)) || (6 < this_00->_stage)) || ((this_00->_stageType != 4 && (this_00->_stageType != 5)))) { pGVar4->_bossRushParTime = 36000; } else { pGVar4->_bossRushParTime = 45000; } } Level::Init(); std::vector::copy_constructor(); piVar6 = piStack_1c; local_8._0_1_ = 6; for (piVar8 = uStack_20; piVar8 != piVar6; piVar8 = piVar8 + 1) { if (*(int *)(*piVar8 + 0x2c) == 0) { Entity_Player::InitPostLevelInitStats(); } } local_8 = (uint)local_8._1_3_ << 8; FID_conflict__Tidy(&uStack_20); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); uStack_18 = 0; auStack_2c._0_8_ = auStack_2c._0_8_ & 0xffffffff; auStack_2c[8] = '\0'; auStack_2c[9] = '\0'; auStack_2c[10] = '\0'; auStack_2c[0xb] = '\0'; uStack_20._0_1_ = '\0'; uStack_20._1_1_ = '\0'; uStack_20._2_1_ = '\0'; uStack_20._3_1_ = '\0'; piStack_1c = (int *)0x3f800000; messageRefCount = (void *)0x3d23d70a; pvVar11 = (void *)0x6f61b9; Game::Fadein(this_00); FUN_009b5cb0(); *(undefined4 *)(this_00->_encounteredBosses + 4) = *(undefined4 *)this_00->_encounteredBosses; Room::Update(); } else { this_00->_isStartingFromState = 1; HUD::LoadGraphics(&this_00->_hud); FUN_0090e2a0(); func_0x0090d3f0(); messageRefCount = (void *)0x1; pvVar11 = (void *)0x6f59a2; FUN_009baa10(); } pMVar5 = g_manager; FUN_0090f4c0(); NetplayManager::send_message(&pMVar5->_netplayManager,1,pvVar11,messageRefCount); LuaEngine::PostGameStart(0); this_00->_isStartingFromState = 0; this_00->_framesSinceRoomTransition = 0; FID_conflict__Erase_tree_>_> (&stack0x00000064, (fuzzer_allocator_> *)&stack0x00000064, *(_Tree_node **)((int)in_stack_00000064 + 4)); operator_delete(in_stack_00000064,0x14); ExceptionList = local_10; return; } //@@ 006f6260 daily_challenge_params_assign /* DB: ? called from Game::StartDailyChallenge with the params struct; copy-assigns string (+0), set (+0x18), two int vectors (+0x20, +0x2c) from param_1 into this */ void daily_challenge_params_assign(byte *param_1) { int iVar1; void *pvVar2; byte *pbVar3; size_t sVar4; byte *in_ECX; void *local_8; if (in_ECX != param_1) { pbVar3 = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { pbVar3 = *(byte **)param_1; } std::string::assign((char *)in_ECX,pbVar3,*(uint *)(param_1 + 0x10)); } pbVar3 = in_ECX + 0x18; if (pbVar3 != param_1 + 0x18) { iVar1 = *(int *)pbVar3; FID_conflict__Erase_tree_>_> (pbVar3,(fuzzer_allocator_> *)pbVar3, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; in_ECX[0x1c] = 0; in_ECX[0x1d] = 0; in_ECX[0x1e] = 0; in_ECX[0x1f] = 0; std_set_uint_copy(in_ECX + 0x18,param_1 + 0x18,(int)param_1); } pbVar3 = in_ECX + 0x20; if (pbVar3 != param_1 + 0x20) { pvVar2 = *(void **)(param_1 + 0x20); sVar4 = *(int *)(param_1 + 0x24) - (int)pvVar2; local_8 = *(void **)pbVar3; if ((uint)(*(int *)(in_ECX + 0x28) - (int)local_8 >> 2) < (uint)((int)sVar4 >> 2)) { std::vector::reserve_clear((int)sVar4 >> 2); local_8 = *(void **)pbVar3; } memmove(local_8,pvVar2,sVar4); *(size_t *)(in_ECX + 0x24) = sVar4 + (int)local_8; } pbVar3 = in_ECX + 0x2c; if (pbVar3 != param_1 + 0x2c) { pvVar2 = *(void **)(param_1 + 0x2c); sVar4 = *(int *)(param_1 + 0x30) - (int)pvVar2; local_8 = *(void **)pbVar3; if ((uint)(*(int *)(in_ECX + 0x34) - (int)local_8 >> 2) < (uint)((int)sVar4 >> 2)) { std::vector::reserve_clear((int)sVar4 >> 2); local_8 = *(void **)pbVar3; } memmove(local_8,pvVar2,sVar4); *(size_t *)(in_ECX + 0x30) = sVar4 + (int)local_8; } *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(param_1 + 0x38); pbVar3 = in_ECX + 0x48; *(undefined4 *)(in_ECX + 0x3c) = *(undefined4 *)(param_1 + 0x3c); *(undefined4 *)(in_ECX + 0x40) = *(undefined4 *)(param_1 + 0x40); *(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(param_1 + 0x44); if (pbVar3 != param_1 + 0x48) { pvVar2 = *(void **)(param_1 + 0x48); sVar4 = *(int *)(param_1 + 0x4c) - (int)pvVar2; local_8 = *(void **)pbVar3; if ((uint)(*(int *)(in_ECX + 0x50) - (int)local_8 >> 2) < (uint)((int)sVar4 >> 2)) { std::vector::reserve_clear((int)sVar4 >> 2); local_8 = *(void **)pbVar3; } memmove(local_8,pvVar2,sVar4); *(size_t *)(in_ECX + 0x4c) = sVar4 + (int)local_8; } *(undefined4 *)(in_ECX + 0x54) = *(undefined4 *)(param_1 + 0x54); pbVar3 = in_ECX + 0x8c; *(undefined4 *)(in_ECX + 0x58) = *(undefined4 *)(param_1 + 0x58); *(undefined4 *)(in_ECX + 0x5c) = *(undefined4 *)(param_1 + 0x5c); *(undefined4 *)(in_ECX + 0x60) = *(undefined4 *)(param_1 + 0x60); *(undefined4 *)(in_ECX + 100) = *(undefined4 *)(param_1 + 100); *(undefined4 *)(in_ECX + 0x68) = *(undefined4 *)(param_1 + 0x68); in_ECX[0x6c] = param_1[0x6c]; *(undefined4 *)(in_ECX + 0x70) = *(undefined4 *)(param_1 + 0x70); in_ECX[0x74] = param_1[0x74]; *(undefined4 *)(in_ECX + 0x78) = *(undefined4 *)(param_1 + 0x78); in_ECX[0x7c] = param_1[0x7c]; in_ECX[0x7d] = param_1[0x7d]; in_ECX[0x7e] = param_1[0x7e]; in_ECX[0x7f] = param_1[0x7f]; *(undefined4 *)(in_ECX + 0x80) = *(undefined4 *)(param_1 + 0x80); *(undefined4 *)(in_ECX + 0x84) = *(undefined4 *)(param_1 + 0x84); *(undefined4 *)(in_ECX + 0x88) = *(undefined4 *)(param_1 + 0x88); if (pbVar3 != param_1 + 0x8c) { pvVar2 = *(void **)(param_1 + 0x8c); sVar4 = *(int *)(param_1 + 0x90) - (int)pvVar2; local_8 = *(void **)pbVar3; if ((uint)(*(int *)(in_ECX + 0x94) - (int)local_8 >> 2) < (uint)((int)sVar4 >> 2)) { std::vector::reserve_clear((int)sVar4 >> 2); local_8 = *(void **)pbVar3; } memmove(local_8,pvVar2,sVar4); *(size_t *)(in_ECX + 0x90) = sVar4 + (int)local_8; } pbVar3 = in_ECX + 0x98; if (pbVar3 != param_1 + 0x98) { pvVar2 = *(void **)(param_1 + 0x98); sVar4 = *(int *)(param_1 + 0x9c) - (int)pvVar2; param_1 = *(byte **)pbVar3; if ((uint)(*(int *)(in_ECX + 0xa0) - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { std::vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)pbVar3; } memmove(param_1,pvVar2,sVar4); *(size_t *)(in_ECX + 0x9c) = (int)param_1 + sVar4; } return; } //@@ 006f6500 Game::add_players /* DB: ? ECX is Game (+0x1bb88 = Seeds._gameStartSeed "Error: Game Start Seed was not set."); iterates a vector of 0x14-byte user entries, logs "Adding local player, device ID"/"Adding remote player, UserID", new 0x3f8 netplay player object, PlayerManager::get_player_by_user_id, SpawnCoPlayer2, init_main_player, SetControllerIndex prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Game::add_players(Game *this,int *users,uint flags) { code *pcVar1; bool bVar2; byte bVar3; char cVar4; uint uVar5; Entity_Player *pEVar6; undefined4 userIdLo; 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 *local_6c; 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 ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_30 = 0; local_34 = 0; local_2c = (Entity_Player *)0x0; newPlayersEnd = (int *)0x0; newPlayersCapacity = (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 = (ItemPool *)(flags & 1); local_50 = flags & 2; do { iVar11 = userIdx * 0x14; iStack_40 = iVar11; if (local_54 == (ItemPool *)0x0) { cVar4 = (**(code **)(*(int *)(iVar11 + iVar7) + 0x14))(uVar5); manager = g_manager; if (cVar4 == '\0') { local_3c = CONCAT44(*users + iVar11,(undefined4)local_3c); iVar7 = *(int *)(*users + iVar11 + 4); if (iVar7 == 0) { local_24 = 0; local_24._4_4_ = (Entity_Player *)0x0; local_24._0_4_ = 0; userIdLo = (undefined4)local_24; userIdHi = local_24._4_4_; } else { userIdLo = *(undefined4 *)(iVar7 + 8); userIdHi = *(undefined4 *)(iVar7 + 0xc); } local_7c = CONCAT44(userIdHi,userIdLo); pEVar6 = PlayerManager::get_player_by_user_id ((PlayerManager *)&g_manager->_netplayManager,&local_7c); local_24 = CONCAT44(pEVar6,(undefined4)local_24); if (pEVar6 == (Entity_Player *)0x0) { local_5c = operator_new(0x3f8); local_8._0_1_ = 2; if (local_5c == (int *)0x0) { pEVar6 = (Entity_Player *)0x0; } else { pEVar6 = (Entity_Player *)NetInputDevice::NetInputDevice(local_3c._4_4_); } local_8 = (uint)local_8._1_3_ << 8; local_24 = CONCAT44(pEVar6,(undefined4)local_24); FUN_00905f60(pEVar6); puVar9 = *(undefined4 **)(manager + 1); if (puVar9 == *(undefined4 **)&manager[1].field_0x4) { std::vector<4byte>::_Emplace_reallocate(puVar9,(int)&local_24 + 4); pEVar6 = local_24._4_4_; } else { *puVar9 = pEVar6; *(int *)(manager + 1) = *(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 { iVar7 = g_manager->_activeControllerIndex; KAGE_LogMessage(1,(byte *)"[Frame: %d] Adding local player, device ID = %d \n"); deviceAlloc = operator_new(0x3f8); local_8._0_1_ = 1; if (deviceAlloc == (void *)0x0) { pEVar6 = (Entity_Player *)0x0; } else { pEVar6 = (Entity_Player *)NetInputDevice::NetInputDevice(iVar7); } local_8 = (uint)local_8._1_3_ << 8; (pEVar6->_sizeMulti).x = (float)g_userProfile; local_2c = pEVar6; FUN_00905f60(pEVar6); puVar9 = *(undefined4 **)(manager + 1); if (puVar9 == *(undefined4 **)&manager[1].field_0x4) { std::vector<4byte>::_Emplace_reallocate(puVar9,&local_2c); pEVar6 = local_2c; } else { *puVar9 = pEVar6; *(int *)(manager + 1) = *(int *)(manager + 1) + 4; } } pvVar12 = (pEVar6->_damageEvents)._end; } else { iVar7 = ((int *)(iVar11 + iVar7))[1]; if (iVar7 == 0) { local_44 = 0; iStack_40 = 0; local_70 = (int *)0x0; local_74 = (undefined **)0x0; } else { local_74 = *(undefined ***)(iVar7 + 8); local_70 = *(int **)(iVar7 + 0xc); } pEVar6 = PlayerManager::get_player_by_user_id ((PlayerManager *)&g_manager->_netplayManager,(ulonglong *)&local_74); if (pEVar6 == (Entity_Player *)0x0) { if (iVar7 == 0) { local_44 = 0; iStack_40 = 0; } KAGE_LogMessage(0x10,(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,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player (&game->_playerManager,*(int *)(*users + 0xc), (game->_seedEffects)._playerInitSeed); puVar9 = (game->_playerManager)._playerList._begin; if ((int)(game->_playerManager)._playerList._end - (int)puVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); puVar9 = (game->_playerManager)._playerList._begin; } local_14 = (Entity_Player *)*puVar9; uVar10 = userIdx; } else { local_14 = (Entity_Player *) PlayerManager::SpawnCoPlayer2 (&local_28->_playerManager,*(undefined4 *)(*users + 0xc + iVar11)); if (newPlayersEnd == newPlayersCapacity) { std::vector::_Emplace_reallocate(newPlayersEnd,&local_14); uVar10 = userIdx; goto LAB_006f68af; } *newPlayersEnd = (int)local_14; newPlayersEnd = newPlayersEnd + 1; uVar10 = userIdx; } } else { local_14 = PlayerManager::get_main_player(&local_28->_playerManager,userIdx); if (newPlayersEnd == newPlayersCapacity) { std::vector::_Emplace_reallocate(newPlayersEnd,&local_14); LAB_006f68af: newPlayersCapacity = (int *)0x0; } else { *newPlayersEnd = (int)local_14; newPlayersEnd = newPlayersEnd + 1; } } Entity_Player::SetControllerIndex(local_14,pvVar12,1); userIdx = uVar10 + 1; iVar7 = *users; } while (userIdx < (uint)((users[1] - iVar7) / 0x14)); } local_2c = (Entity_Player *)0x0; newPlayerIt = (int *)0x0; if ((flags & 2) == 0) { FUN_00959500(); } if ((flags & 4) != 0) { local_74 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_70 = (int *)0x0; local_6c = (int *)0x0; local_8._0_1_ = 3; std::shared_ptr::assign(&local_70,&g_multiplayerLobbyPtr); local_74 = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = CONCAT31(local_8._1_3_,4); local_30 = 0xd; if (local_70 == (int *)0x0) { local_5c = (int *)0x0; } else { iVar7 = (**(code **)(*local_70 + 0x20))(&local_7c); local_5c = *(int **)(iVar7 + 4); } local_7c = CONCAT44(local_7c._4_4_,KAGE::System::UserProfileBase::vftable); local_60 = KAGE::System::UserProfile::vftable; local_8 = 5; local_34 = 0x4f; local_30 = 0x4f; bVar3 = KAGE::System::UserProfile::is_local_user(&local_60); 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 (((local_6c != (int *)0x0) && (cVar4 = (**(code **)(*local_6c + 0xc))(), cVar4 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_70); } local_8 = local_8 & 0xffffff00; } if ((bVar2) && (newPlayersEnd != (int *)0x0)) { do { Entity_Player::InitPostLevelInitStats((Entity_Player *)*newPlayerIt); users = (int *)0x1; InputManager::get_device(&PTR_vftable_00c57b18,&local_60,*(int *)(*newPlayerIt + 0x1618)); local_8 = CONCAT31(local_8._1_3_,7); if ((local_60 != (undefined **)0x0) && (iVar7 = __RTDynamicCast(local_60,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0), iVar7 != 0)) { iVar7 = *(int *)(iVar7 + 0x374); if (iVar7 == 0) { local_7c = 0; local_7c._4_4_ = (int *)0x0; local_7c._0_4_ = (undefined **)0x0; local_70 = local_7c._4_4_; local_74 = (undefined **)local_7c; } else { local_70 = *(int **)(iVar7 + 0xc); local_74 = *(undefined ***)(iVar7 + 8); } users = (int *)NetplayManager::restore_player_state(&local_74,*newPlayerIt); } manager = g_manager; if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) { KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); game = g_game; (manager->_persistentGameData)._isReadOnly = 1; local_28 = (Game *)((game->_stage - (int)users) + -1); if (0 < (int)local_28) { local_34 = 0x13; uVar10 = 0; uVar5 = *(uint *)(*newPlayerIt + 0x3ec); piVar8 = (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,(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 = (-(uint)(uVar10 < 0x23) & 6) + 2; } local_54 = &game->_itemPool; if (uVar5 == 0) { KAGE_LogMessage(0x10,(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 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar12 >> 2)) && (iVar7 != 0xeb)) && ((iVar7 != 0x2b && (iVar7 != 0x3d)))) { if (g_game == (Game *)0x0) { if (-1 < iVar7) goto LAB_006f6c78; } else { if (iVar7 < 0) { iVar11 = -1 - iVar7; if ((iVar11 < 0) || (proceduralItems = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)proceduralItems >> 2 <= iVar11)) { iVar11 = 0; } else { iVar11 = **(int **)((int)proceduralItems + iVar11 * 4); } } else { LAB_006f6c78: iVar11 = *(int *)((int)pvVar12 + iVar7 * 4); } if (iVar11 != 0) { if (g_game == (Game *)0x0) { if (-1 < iVar7) goto LAB_006f6cb6; } else { if (iVar7 < 0) { iVar11 = -1 - iVar7; if ((iVar11 < 0) || (pvVar12 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar12 >> 2 <= iVar11)) { piVar8 = (int *)0x0; } else { piVar8 = (int *)**(undefined4 **)((int)pvVar12 + iVar11 * 4); } } else { LAB_006f6cb6: piVar8 = *(int **)((int)pvVar12 + iVar7 * 4); } if ((piVar8 != (int *)0x0) && (bVar3 = Item::IsAvailable(piVar8,0xffffffff), bVar3 != 0)) { if (*piVar8 == 3) { if (bVar2) goto LAB_006f6d10; bVar2 = true; } Entity_Player::AddCollectible((Entity_Player *)*newPlayerIt,iVar7,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,iVar7,0,0); local_28 = (Game *)&local_28[-1]._console.field_0x3; } } } } } LAB_006f6d10: game = g_game; uVar5 = local_50; } while (0 < (int)local_28); } manager = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = 0; } local_8._0_1_ = 8; if (((local_5c != (int *)0x0) && (cVar4 = (**(code **)(*local_5c + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_60); } newPlayerIt = newPlayerIt + 1; local_8 = (uint)local_8._1_3_ << 8; } while (newPlayerIt != newPlayersEnd); } if (local_2c != (Entity_Player *)0x0) { uVar5 = (int)newPlayersCapacity - (int)local_2c & 0xfffffffc; pEVar6 = local_2c; if (0xfff < uVar5) { pEVar6 = local_2c[-1]._replacedPlayer; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_2c + (-4 - (int)pEVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar6,uVar5); } ExceptionList = local_10; return; } //@@ 006f6dd0 Game::StartDailyChallenge /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Game::StartDailyChallenge(DailyChallenge * daily); */ void __thiscall Game::StartDailyChallenge(undefined4 param_1,int *param_2) { code *pcVar1; std_string seed; byte *extraout_EAX; void *pvVar2; uint uVar3; byte *filename; int *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 [12]; undefined4 uStack_24; int *piStack_20; uint tmpStringCapacity; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; Game *game; Manager *manager; int *playersEnd; _Tree_node *seedEffectRoot; void **seedEffectSet; game = g_game; uStack_8 = 0xffffffff; puStack_c = &LAB_00afbf35; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(tmpString + 0x2c); ExceptionList = &local_10; g_game->_isStarted = 1; game->_difficulty = param_2[0x20]; manager = g_manager; game->_challenge = 0; game->_isConsoleUsedThisRun = manager->_isConsoleEnabled; HUD::LoadGraphics(&game->_hud); (game->_dailyChallenge)._id = *param_2; (game->_dailyChallenge)._seed = param_2[1]; (game->_dailyChallenge)._isPractice = *(byte *)(param_2 + 2); (game->_dailyChallenge)._specialDailyId = param_2[3]; daily_challenge_params_assign(); seedEffectSet = &(game->_seedEffects)._seedEffects; (game->_seedEffects)._gameStartSeed = 0; pvVar2 = *seedEffectSet; (game->_seedEffects)._isCustomRun = 0; seedEffectRoot = *(_Tree_node **)((int)pvVar2 + 4); uVar4 = 0x6f6e9a; FID_conflict__Erase_tree_>_> (seedEffectSet,(fuzzer_allocator_> *)seedEffectSet, seedEffectRoot); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (game->_seedEffects)._seedEffectsCount = 0; (game->_seedEffects)._isCustomRun = 1; Seeds::Seed2String(asStackY_c98 + 0x81,param_2[1]); seed._buf[4] = (char)in_stack_ffffff84; seed._buf[5] = (char)((uint)in_stack_ffffff84 >> 8); seed._buf[6] = (char)((uint)in_stack_ffffff84 >> 0x10); seed._buf[7] = (char)((uint)in_stack_ffffff84 >> 0x18); seed._buf[0] = (char)in_stack_ffffff80; seed._buf[1] = (char)((uint)in_stack_ffffff80 >> 8); seed._buf[2] = (char)((uint)in_stack_ffffff80 >> 0x10); seed._buf[3] = (char)((uint)in_stack_ffffff80 >> 0x18); seed._buf[8] = (char)in_stack_ffffff88; seed._buf[9] = (char)((uint)in_stack_ffffff88 >> 8); seed._buf[10] = (char)((uint)in_stack_ffffff88 >> 0x10); seed._buf[0xb] = (char)((uint)in_stack_ffffff88 >> 0x18); seed._buf[0xc] = (char)uVar4; seed._buf[0xd] = (char)((uint)uVar4 >> 8); seed._buf[0xe] = (char)((uint)uVar4 >> 0x10); seed._buf[0xf] = (char)((uint)uVar4 >> 0x18); seed._size = (uint)seedEffectSet; seed._capacity = (uint)seedEffectRoot; Seeds::SetStartSeed(&game->_seedEffects,seed); uVar3 = 0; if (param_2[0x2b] - param_2[0x2a] >> 2 != 0) { do { Seeds::AddSeedEffect(&game->_seedEffects,*(int *)(param_2[0x2a] + uVar3 * 4)); uVar3 = uVar3 + 1; } while (uVar3 < (uint)(param_2[0x2b] - param_2[0x2a] >> 2)); } if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } uVar3 = (game->_seedEffects)._rng._seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = (game->_seedEffects)._rng._seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } manager = g_manager; uVar3 = uVar3 >> ((byte)(game->_seedEffects)._rng._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(game->_seedEffects)._rng._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(game->_seedEffects)._rng._shift3 & 0x1f) ^ uVar3; (game->_seedEffects)._rng._seed = uVar3; (game->_fortuneRNG)._seed = uVar3; (game->_fortuneRNG)._shift1 = 5; (game->_fortuneRNG)._shift2 = 9; (game->_fortuneRNG)._shift3 = 7; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = 1; uVar3 = (game->_seedEffects)._gameStartSeed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar3 = (game->_seedEffects)._gameStartSeed; } if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar3 = (game->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)tmpString,uVar3); uStack_8 = 0; KAGE_LogMessage(1,(byte *)"RNG Start Seed: %s (%u) [Daily, %d]\n"); uStack_8 = 0xffffffff; if (0xf < tmpStringCapacity) { uVar3 = tmpStringCapacity + 1; pvVar2 = (void *)tmpString._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(tmpString._0_4_ + -4); uVar3 = tmpStringCapacity + 0x24; if (0x1f < (uint)(tmpString._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } piStack_20 = (int *)0x0; tmpStringCapacity = 0xf; tmpString._0_8_ = tmpString._0_8_ & 0xffffffffffffff00; init_procedural_item_surfaces(&game->_proceduralItemManager); tmpString[8] = 's'; tmpString[9] = '.'; tmpString[10] = 'x'; tmpString[0xb] = 'm'; tmpStringCapacity = 0xf; piStack_20 = (int *)&DAT_0000000d; tmpString._0_8_ = 0x6c6f6f706d657469; uStack_24 = (int *)CONCAT22(uStack_24._2_2_,0x6c); uStack_8 = 1; ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)itemPoolPath,(std_string *)tmpString); uStack_8 = CONCAT31(uStack_8._1_3_,2); filename = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { filename = *(byte **)extraout_EAX; } if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } uVar3 = (game->_seedEffects)._rng._seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = (game->_seedEffects)._rng._seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(game->_seedEffects)._rng._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(game->_seedEffects)._rng._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(game->_seedEffects)._rng._shift3 & 0x1f) ^ uVar3; (game->_seedEffects)._rng._seed = uVar3; ItemPool::Init(&game->_itemPool,uVar3,filename); uStack_8 = CONCAT31(uStack_8._1_3_,1); if (0xf < itemPoolPathCapacity) { uVar3 = itemPoolPathCapacity + 1; pvVar2 = itemPoolPath[0]; if (0xfff < uVar3) { pvVar2 = *(void **)((int)itemPoolPath[0] + -4); uVar3 = itemPoolPathCapacity + 0x24; if (0x1f < (uint)((int)itemPoolPath[0] + (-4 - (int)pvVar2))) goto LAB_006f71ce; } operator_delete(pvVar2,uVar3); } uStack_8 = 0xffffffff; itemPoolPathSize = 0; itemPoolPathCapacity = 0xf; itemPoolPath[0] = (void *)((uint)itemPoolPath[0] & 0xffffff00); if (0xf < tmpStringCapacity) { uVar3 = tmpStringCapacity + 1; pvVar2 = (void *)tmpString._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(tmpString._0_4_ + -4); uVar3 = tmpStringCapacity + 0x24; if (0x1f < (uint)(tmpString._0_4_ + (-4 - (int)pvVar2))) { LAB_006f71ce: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } BossPool::init(); if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player (&game->_playerManager,param_2[0x15],(game->_seedEffects)._playerInitSeed); Level::SetNextStage((Level *)game); Level::Init(); std::vector::copy_constructor(); playersEnd = piStack_20; uStack_8 = 3; for (playerIt = uStack_24; playerIt != playersEnd; playerIt = playerIt + 1) { if (*(int *)(*playerIt + 0x2c) == 0) { Entity_Player::InitPostLevelInitStats(); } } uStack_8 = 0xffffffff; FID_conflict__Tidy(&uStack_24); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); tmpStringCapacity = 0; tmpString._0_8_ = tmpString._0_8_ & 0xffffffff; tmpString[8] = '\0'; tmpString[9] = '\0'; tmpString[10] = '\0'; tmpString[0xb] = '\0'; uStack_24._0_1_ = '\0'; uStack_24._1_1_ = '\0'; uStack_24._2_1_ = '\0'; uStack_24._3_1_ = '\0'; piStack_20 = (int *)0x3f800000; Fadein(game); FUN_009b5cb0(); LuaEngine::PostGameStart(0); ExceptionList = local_10; return; } //@@ 006f72f0 Game::StartFromRerunState /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON Game::StartFromRerunState(GameState*): HUD::LoadGraphics, challenge/difficulty from the state, _isRerun = 1, Seeds copied from state+0x1e724 and reseeded, "Setting PersistentGameData ReadOnly to %s"; Manager::start_pending_game on the rerun flag (sibling of Game::Start/StartDebug/StartDailyChallenge) */ void Game::StartFromRerunState(GameState *param_1) { void **hud; byte bVar1; Seeds *other; uint uVar2; int seedValue; byte *extraout_EAX; int unusedArg; void *pvVar3; undefined4 extraout_ECX; 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; Game *game; HUD *hud; Manager *manager; Seeds *seeds; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afbf88; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(auStack_30 + 0x2c); ExceptionList = &local_10; hud = &g_game->_hud; g_game->_isStarted = 1; HUD::LoadGraphics(hud); game->_challenge = *(int *)param_1; if ((param_1->field_0x5 == '\0') && (g_manager->_isConsoleEnabled == 0)) { bVar1 = 0; } else { bVar1 = 1; } game->_isConsoleUsedThisRun = bVar1; game->_difficulty = *(int *)¶m_1->field_0x8; game->_isRerun = 1; Seeds::construct_from_copy(&seedsCopy,(Seeds *)¶m_1->field_0x1e724); local_8 = 0; Seeds::operator_assign(&game->_seedEffects,other); local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&seedsCopy._seedEffects, (fuzzer_allocator_> *)&seedsCopy._seedEffects, *(_Tree_node **)((int)seedsCopy._seedEffects + 4)); operator_delete(seedsCopy._seedEffects,0x14); pvVar3 = (game->_seedEffects)._seedEffects; hud = &(game->_seedEffects)._seedEffects; FID_conflict__Erase_tree_>_> (hud,(fuzzer_allocator_> *)hud, *(_Tree_node **)((int)pvVar3 + 4)); *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; (game->_seedEffects)._seedEffectsCount = 0; seeds = &game->_seedEffects; uVar2 = Seeds::GetNextSeed(seeds); Seeds::set_start_seed(seeds,uVar2); seedValue = Seeds::GetNextSeed(seeds); manager = g_manager; (game->_fortuneRNG)._seed = seedValue; (game->_fortuneRNG)._shift1 = 5; (game->_fortuneRNG)._shift2 = 9; (game->_fortuneRNG)._shift3 = 7; if ((((seeds->_isCustomRun == 0) && (bVar1 = Seeds::AchievementUnlocksDisallowed(seeds), bVar1 == 0)) && (bVar1 = Manager::IsGameplayInputActive(unusedArg), bVar1 == 0)) && (game->_isRerun == 0)) { bVar1 = 0; } else { bVar1 = 1; } KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = bVar1; uVar2 = (game->_seedEffects)._gameStartSeed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar2 = (game->_seedEffects)._gameStartSeed; } if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar2 = (game->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)auStack_30,uVar2); local_8 = 1; KAGE_LogMessage(1,(byte *)"RNG Start Seed: %s (%u) [Rerun, %d]\n"); local_8 = 0xffffffff; if (0xf < uStack_1c) { uVar2 = uStack_1c + 1; pvVar3 = (void *)auStack_30._0_4_; if (0xfff < uVar2) { pvVar3 = *(void **)(auStack_30._0_4_ + -4); uVar2 = uStack_1c + 0x24; if (0x1f < (uint)(auStack_30._0_4_ + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } init_procedural_item_surfaces(&game->_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,(std_string *)itemPoolsPath,(std_string *)auStack_30); local_8._0_1_ = 3; filename = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { filename = *(byte **)extraout_EAX; } uVar2 = Seeds::GetNextSeed(seeds); ItemPool::Init(&game->_itemPool,uVar2,filename); local_8 = CONCAT31(local_8._1_3_,2); if (0xf < itemPoolsPathCapacity) { uVar2 = itemPoolsPathCapacity + 1; pvVar3 = itemPoolsPath[0]; if (0xfff < uVar2) { pvVar3 = *(void **)((int)itemPoolsPath[0] + -4); uVar2 = itemPoolsPathCapacity + 0x24; if (0x1f < (uint)((int)itemPoolsPath[0] + (-4 - (int)pvVar3))) goto LAB_006f7624; } operator_delete(pvVar3,uVar2); } local_8 = 0xffffffff; itemPoolsPathSize = 0; itemPoolsPathCapacity = 0xf; itemPoolsPath[0] = (void *)((uint)itemPoolsPath[0] & 0xffffff00); if (0xf < uStack_1c) { uVar2 = uStack_1c + 1; pvVar3 = (void *)auStack_30._0_4_; if (0xfff < uVar2) { pvVar3 = *(void **)(auStack_30._0_4_ + -4); uVar2 = uStack_1c + 0x24; if (0x1f < (uint)(auStack_30._0_4_ + (-4 - (int)pvVar3))) { LAB_006f7624: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } seedValue = (game->_seedEffects)._gameStartSeed; if (seedValue == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); seedValue = (game->_seedEffects)._gameStartSeed; } BossPool::init(seedValue); if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player (&game->_playerManager,*(int *)¶m_1->field_0x19d7c, (game->_seedEffects)._playerInitSeed); PlayerManager::RestoreGameState(&game->_playerManager,param_1); Level::SetNextStage((Level *)game); Level::Init(1); PlayerManager::RestoreGameState_PostLevelInit(&game->_playerManager,param_1); Manager::save_game_state(); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); FUN_009b5cb0(); *(undefined4 *)(game->_encounteredBosses + 4) = *(undefined4 *)game->_encounteredBosses; Room::Update(); KColor::SetFromARGB((KColor *)(auStack_30 + 4),0xff000000); Fadein(game,0x3d23d70a,1,extraout_ECX); game->_framesSinceRoomTransition = 0; LuaEngine::PostGameStart(1); ExceptionList = local_10; return; } //@@ 006f7750 Game::StartDebug /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void Game::StartDebug(int levelStage,int stageType,int difficulty,std_string* unk); */ void __thiscall Game::StartDebug(undefined4 param_1,int param_2,int param_3,int param_4,void *param_5) { std_string seed; undefined1 auVar1 [20]; byte isReadOnly; byte *extraout_EAX; uint uVar2; int iVar3; int unusedArg; void *freeBlock; int extraout_ECX; int extraout_ECX_00; byte *itemPoolPath; int in_stack_00000020; uint in_stack_00000024; 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; Game *game; Manager *manager; manager = g_manager; game = g_game; puStack_c = &LAB_00afbfe9; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(redirectedPath + 0x11); ExceptionList = &local_10; local_8 = (void *)0x0; g_game->_isStarted = 1; game->_isConsoleUsedThisRun = manager->_isConsoleEnabled; game->_difficulty = param_4; game->_isDebug = 1; (game->_seedEffects)._isCustomRun = 1; auVar1._4_4_ = in_stack_ffffff90; auVar1._0_4_ = in_stack_ffffff8c; auVar1._8_4_ = in_stack_ffffff94; auVar1._12_8_ = 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 = auVar1._16_4_; Seeds::SetStartSeed(&game->_seedEffects,seed); manager = g_manager; if (((((game->_seedEffects)._isCustomRun == 0) && (isReadOnly = Seeds::AchievementUnlocksDisallowed(&game->_seedEffects), isReadOnly == 0)) && (isReadOnly = Manager::IsGameplayInputActive(unusedArg), isReadOnly == 0)) && (game->_isRerun == 0)) { isReadOnly = 0; } else { isReadOnly = 1; } KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = isReadOnly; HUD::LoadGraphics(&game->_hud); game->_challenge = 0; init_procedural_item_surfaces(&game->_proceduralItemManager); builtin_strncpy(itemPoolFile._buf + 8,"s.xml",6); itemPoolFile._capacity = 0xf; itemPoolFile._size = 0xd; builtin_strncpy(itemPoolFile._buf,"itempool",8); local_8._0_1_ = 1; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPath,&itemPoolFile); local_8._0_1_ = 2; itemPoolPath = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { itemPoolPath = *(byte **)extraout_EAX; } uVar2 = Seeds::GetNextSeed(&game->_seedEffects); ItemPool::Init(&game->_itemPool,uVar2,itemPoolPath); local_8._0_1_ = 1; if (0xf < redirectedPathCapacity) { uVar2 = redirectedPathCapacity + 1; freeBlock = redirectedPath[0]; if (0xfff < uVar2) { freeBlock = *(void **)((int)redirectedPath[0] + -4); uVar2 = redirectedPathCapacity + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)freeBlock))) goto LAB_006f793a; } operator_delete(freeBlock,uVar2); } local_8._0_1_ = 0; redirectedPathSize = 0; redirectedPathCapacity = 0xf; redirectedPath[0] = (void *)((uint)redirectedPath[0] & 0xffffff00); if (0xf < itemPoolFile._capacity) { uVar2 = itemPoolFile._capacity + 1; freeBlock = (void *)itemPoolFile._buf._0_4_; if (0xfff < uVar2) { freeBlock = *(void **)(itemPoolFile._buf._0_4_ + -4); uVar2 = itemPoolFile._capacity + 0x24; if (0x1f < (uint)(itemPoolFile._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_006f793a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); } iVar3 = (game->_seedEffects)._gameStartSeed; if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); iVar3 = (game->_seedEffects)._gameStartSeed; } BossPool::init(iVar3); if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player(&game->_playerManager,0,(game->_seedEffects)._playerInitSeed); Level::SetStage((Level *)game,param_2,param_3); Level::Init(1); if (in_stack_00000020 != 0) { iVar3 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar3 + 0xc) < DAT_00c80e44) && (_Init_thread_header(&DAT_00c80e44), iVar3 = extraout_ECX, DAT_00c80e44 == -1)) { local_8._0_1_ = 3; RoomConfig::LoadRoomFromXmlFile(); _atexit((_func_4879 *)&LAB_00b159c0); local_8._0_1_ = 0; _Init_thread_footer(&DAT_00c80e44); iVar3 = extraout_ECX_00; } _DAT_00c80e48 = GetStageID(game,(byte)iVar3); Level::DEBUG_goto_room((Level *)g_game,(RoomConfig_Room *)&DAT_00c80e48); } FUN_009ba9a0(); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); LuaEngine::PostGameStart(0); if (0xf < in_stack_00000024) { uVar2 = in_stack_00000024 + 1; freeBlock = param_5; if (0xfff < uVar2) { freeBlock = *(void **)((int)param_5 + -4); uVar2 = in_stack_00000024 + 0x24; if (0x1f < (uint)((int)param_5 + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); } ExceptionList = local_10; return; } //@@ 006f7ac0 Game::NextVictoryLap /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Game:NextVictoryLap */ void Game::NextVictoryLap(void) { undefined1 *puVar1; undefined4 uVar2; code *pcVar3; char cVar4; uint uVar5; int iVar6; byte *extraout_EAX; void *pvVar7; Level *in_ECX; int *piVar8; byte *filename; void *redirectedPath [4]; uint redirectedPathSize; uint redirectedPathCapacity; undefined1 auStack_44 [16]; int *local_34; int *local_30; void *seedString; char acStack_28 [8]; undefined8 local_20; int *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; bool isLobbyActive; Manager *manager; puStack_c = &LAB_00afc04d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(acStack_28 + 0x24); ExceptionList = &local_10; auStack_44._12_4_ = KAGE::Network::Multiplayer::ConstLobby::vftable; local_34 = (int *)0x0; local_30 = (int *)0x0; local_8 = 0; local_14 = uVar5; std::shared_ptr::assign(auStack_44 + 0x10,&g_multiplayerLobbyPtr); auStack_44._12_4_ = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 1; if ((local_34 == (int *)0x0) || (cVar4 = (**(code **)(*local_34 + 0xc))(uVar5), cVar4 == '\0')) { isLobbyActive = false; } else { isLobbyActive = true; } auStack_44._12_4_ = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 2; if (((local_30 != (int *)0x0) && (cVar4 = (**(code **)(*local_30 + 0xc))(), cVar4 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(auStack_44 + 0x10); } if (isLobbyActive) { local_20._0_1_ = -0x44; local_20._1_1_ = -0x3f; local_20._2_1_ = -0x47; local_20._3_1_ = '\0'; local_20._4_4_ = (int *)0x0; local_18 = (int *)0x0; local_8 = 3; std::shared_ptr::assign((void *)((int)&local_20 + 4),&g_multiplayerLobbyPtr); local_20._0_4_ = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 4; if (local_20._4_4_ != (int *)0x0) { (**(code **)(*local_20._4_4_ + 0x38))(0); } local_20._0_4_ = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if (((local_18 != (int *)0x0) && (cVar4 = (**(code **)(*local_18 + 0xc))(), cVar4 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)&local_20 + 4); } } manager = g_manager; local_8 = 0xffffffff; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = 1; puVar1 = &in_ECX[1]._roomList[0x13c].field_0xa0; *(int *)puVar1 = *(int *)puVar1 + 1; if (*(int *)&in_ECX[1]._roomList[0x13c].field_0xa0 == 1) { in_ECX[1]._roomList[0x140].OverrideData = (void *)0x1; } iVar6 = in_ECX[1]._roomList[0x4c].DecorationSeed; uVar5 = 0; piVar8 = (int *)in_ECX[1]._roomList[0x4c].PitsCount; if (iVar6 - (int)piVar8 >> 2 != 0) { do { if (iVar6 - (int)piVar8 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); iVar6 = in_ECX[1]._roomList[0x4c].DecorationSeed; piVar8 = (int *)in_ECX[1]._roomList[0x4c].PitsCount; } if (uVar5 < (uint)(iVar6 - (int)piVar8 >> 2)) { piVar8 = piVar8 + uVar5; } if (*(int *)(*piVar8 + 0x2c) == 0) { pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; if (pvVar7 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; } Entity_Player::apply_victory_lap_penalty(pvVar7); } iVar6 = in_ECX[1]._roomList[0x4c].DecorationSeed; uVar5 = uVar5 + 1; piVar8 = (int *)in_ECX[1]._roomList[0x4c].PitsCount; } while (uVar5 < (uint)(iVar6 - (int)piVar8 >> 2)); } uVar2 = *(undefined4 *)&in_ECX[1]._roomList[0x139].field_0x9c; puVar1 = &in_ECX[1]._roomList[0x139].field_0xa0; *(uint *)puVar1 = *(uint *)puVar1 & 0xfffdffff; *(undefined4 *)&in_ECX[1]._roomList[0x139].field_0x9c = uVar2; pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; if (pvVar7 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; local_20._0_1_ = '\x01'; local_20._1_1_ = '\0'; local_20._2_1_ = '\0'; local_20._3_1_ = '\0'; local_20._4_4_ = (int *)0x9; if (pvVar7 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } local_20 = 0x900000001; uVar5 = (uint)pvVar7 >> 1 ^ (uint)pvVar7; uVar5 = uVar5 << 9 ^ uVar5; Seeds::set_start_seed ((Seeds *)&in_ECX[1]._roomList[0x4d].SavedEntities._end,uVar5 >> 0x1d ^ uVar5); iVar6 = Seeds::GetNextSeed((Seeds *)&in_ECX[1]._roomList[0x4d].SavedEntities._end); in_ECX[1]._roomList[0x4c].Flags = iVar6; in_ECX[1]._roomList[0x4c].TotalMoneySpent = 5; in_ECX[1]._roomList[0x4c].ClearCount = 0; in_ECX[1]._roomList[0x4c].GreedSubType = 9; in_ECX[1]._roomList[0x4c].PoopCount = 7; in_ECX[1]._roomList[0x4c].TKeeperCoinSpawns = 0; pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; if (pvVar7 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; } if (pvVar7 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; } Seeds::Seed2String((std_string *)&seedString,(uint)pvVar7); local_8 = 6; KAGE_LogMessage(1,(byte *)"RNG Victory Lap Start Seed: %s (%u)\n"); local_8 = 0xffffffff; if (&DAT_0000000f < local_18) { piVar8 = (int *)((int)local_18 + 1); pvVar7 = seedString; if ((int *)0xfff < piVar8) { pvVar7 = *(void **)((int)seedString + -4); piVar8 = local_18 + 9; if (0x1f < (uint)((int)seedString + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,(uint)piVar8); } auStack_44[8] = 's'; auStack_44[9] = '.'; auStack_44[10] = 'x'; auStack_44[0xb] = 'm'; local_20 = local_20 & 0xffffffff; local_18 = (int *)0xf; seedString = (void *)((uint)seedString & 0xffffff00); local_30 = (int *)0xf; local_34 = (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'; auStack_44._12_2_ = 0x6c; local_8 = 7; ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)redirectedPath,(std_string *)auStack_44); local_8._0_1_ = 8; filename = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { filename = *(byte **)extraout_EAX; } uVar5 = Seeds::GetNextSeed((Seeds *)&in_ECX[1]._roomList[0x4d].SavedEntities._end); ItemPool::Init((ItemPool *)&in_ECX[1]._roomList[0x31].PitsCount,uVar5,filename); local_8 = CONCAT31(local_8._1_3_,7); if (0xf < redirectedPathCapacity) { uVar5 = redirectedPathCapacity + 1; pvVar7 = redirectedPath[0]; if (0xfff < uVar5) { pvVar7 = *(void **)((int)redirectedPath[0] + -4); uVar5 = redirectedPathCapacity + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)pvVar7))) goto LAB_006f7f31; } operator_delete(pvVar7,uVar5); } local_8 = 0xffffffff; redirectedPathSize = 0; redirectedPathCapacity = 0xf; redirectedPath[0] = (void *)((uint)redirectedPath[0] & 0xffffff00); if (0xf < local_30) { uVar5 = (int)local_30 + 1; pvVar7 = (void *)auStack_44._0_4_; if (0xfff < uVar5) { pvVar7 = *(void **)(auStack_44._0_4_ + -4); uVar5 = (int)local_30 + 0x24; if (0x1f < (uint)(auStack_44._0_4_ + (-4 - (int)pvVar7))) { LAB_006f7f31: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; if (pvVar7 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); pvVar7 = in_ECX[1]._roomList[0x4d].SavedEntities._capacity; } BossPool::init(pvVar7); iVar6 = in_ECX->_stage; if ((0 < iVar6) && ((6 < iVar6 || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { if ((in_ECX->_stageType == 4) || (in_ECX->_stageType == 5)) { iVar6 = iVar6 + 1; } if (iVar6 < 8) { SaveBackwardsStage(iVar6); } } manager = g_manager; game = g_game; in_ECX->_stage = 0; in_ECX->_stageType = 0; manager->field_0x21c10 = 0; if ((game->_difficulty == 2) || (game->_difficulty == 3)) { iVar6 = -3; } else { iVar6 = 0; } (manager->_nightmareScene)._stageBarIcons[0] = iVar6; if ((((game->_difficulty == 2) || (game->_difficulty == 3)) || (6 < in_ECX->_stage)) || ((in_ECX->_stageType != 4 && (in_ECX->_stageType != 5)))) { game->_bossRushParTime = 36000; } else { game->_bossRushParTime = 45000; } Level::SetNextStage(in_ECX); Level::Init(1); Manager::save_game_state(); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); *(undefined2 *)&g_manager->_isNightmarePending = 0x101; Manager::Update(0); in_ECX[1]._roomList[0x139].GreedSubType = 0; in_ECX[1]._roomList[0x139].PoopCount = 0; in_ECX[1]._roomList[0x139].TKeeperCoinSpawns = 0; in_ECX[1]._roomList[0x13a].GreedSubType = 0; in_ECX[1]._roomList[0x13a].DecorationSeed = 4; GenericPrompt::Disappear((ANM2 *)&in_ECX[1]._roomList[0x13c].field_0xa4); if (in_ECX[1]._roomList[0x13d]._doors[1] != 0) { *(undefined1 *)(in_ECX[1]._roomList[0x13d]._doors + 5) = 0; } in_ECX[1]._roomList[0x13e].AwardSeed = 0; in_ECX[1]._roomList[0x13e].SpawnSeed = 0; local_18 = (int *)0x0; acStack_28[0] = '\0'; acStack_28[1] = '\0'; acStack_28[2] = '\0'; acStack_28[3] = '\0'; acStack_28[4] = '\0'; acStack_28[5] = '\0'; acStack_28[6] = '\0'; acStack_28[7] = '\0'; local_20._0_1_ = '\0'; local_20._1_1_ = '\0'; local_20._2_1_ = '\0'; local_20._3_1_ = '\0'; local_20._4_4_ = (int *)0x3f800000; Fadein(); in_ECX[1]._roomList[0x13a].SpawnSeed = 0; ExceptionList = local_10; return; } //@@ 006f8100 Game::IsHardMode /* ZHL [exact] static bool Game::IsHardMode(); prototype: db/protos.zhl, confirmed by RET 0 */ byte __cdecl Game::IsHardMode(void) { if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) { return 1; } return 0; } //@@ 006f8120 Game::IsGreedMode /* ZHL [exact] __thiscall bool Game::IsGreedMode(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Game::IsGreedMode(Game *this) { if ((this->_difficulty == 2) || (this->_difficulty == 3)) { return 1; } return 0; } //@@ 006f8140 Game::restore_game_state /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (GameState* state, bool) copies seeds/stage/flags from state into Game, Level::RestoreGameState, Ambush::StartChallenge, 'RNG Start Seed: %s (%u) [Continue, %d]'; callers 00706020 Game::rewind restore) and 00959720 prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Game::restore_game_state(Game *this,GameState *state,byte isContinue) { void **ppvVar1; PlayerManager *pPVar2; int iVar3; byte isConsoleUsed; Seeds *other; size_t _Size; byte *extraout_EAX; byte *pbVar4; uint bitsLow; void *pvVar5; int unusedArg; int *dstIcon; uint wordIndex; int *srcIcon; uint bitsHigh; undefined1 *slotState; int iVar6; 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 ^ (uint)&(&tmpString)[1]._size; ExceptionList = &local_10; Seeds::construct_from_copy(&seedsCopy,(Seeds *)&state->field_0x1e724); local_8 = 0; Seeds::operator_assign(&this->_seedEffects,other); local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&seedsCopy._seedEffects, (fuzzer_allocator_> *)&seedsCopy._seedEffects, *(_Tree_node **)((int)seedsCopy._seedEffects + 4)); operator_delete(seedsCopy._seedEffects,0x14); this->_challenge = *(int *)state; if ((state->field_0x5 == '\0') && (g_manager->_isConsoleEnabled == 0)) { isConsoleUsed = 0; } else { isConsoleUsed = 1; } this->_isConsoleUsedThisRun = isConsoleUsed; this->_difficulty = *(int *)&state->field_0x8; bitIndex = 0; if (*(short *)&state->field_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 ((&state->field_0xe)[bitIndex & 0xffff] == '\0') { bitsLow = ~bitsLow & *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x28); bitsHigh = *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x2c) & ~bitsHigh; } else { bitsLow = *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x28) | bitsLow; bitsHigh = *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x2c) | bitsHigh; } *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x2c) = bitsHigh; *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x28) = bitsLow; bitIndex = bitIndex + 1; } while ((ushort)bitIndex < *(ushort *)&state->field_0xc); } this->_lastDevilRoomStage = *(int *)&state->field_0x44; pbVar4 = this->_encounteredBosses; this->_treasureRoomsVisited = *(int *)&state->field_0x48; this->_planetariumsVisited = *(int *)&state->field_0x4c; this->_stagesWithoutHeartsPicked = *(int *)&state->field_0x50; this->_stagesWithoutDamage = *(int *)&state->field_0x54; this->_devilRoomDeals = *(int *)&state->field_0x58; this->_shopVisits = *(int *)&state->field_0x5c; this->_donationModGreed = *(int *)&state->field_0x60; this->_donationModAngel = *(int *)&state->field_0x64; this->_reviveMachineCoinsLeft = *(int *)&state->field_0x68; this->_reviveMachineUses = *(int *)&state->field_0x6c; this->_bossRushParTime = *(int *)&state->field_0x70; this->_blueWombParTime = *(int *)&state->field_0x74; this->_frameCount = *(int *)&state->field_0x78; this->_timeCounter = *(int *)&state->field_0x7c; this->_stageNameNumeral = *(int *)&state->field_0x80; this->_victoryLap = *(int *)&state->field_0xdc; this->_lastLevelWithoutHalfHp = *(int *)&state->field_0xe0; this->_isRerun = state->field_0x4; this->_lastLevelWithDamage = *(int *)&state->field_0x1e788; if (pbVar4 != &state->field_0x1e79c) { pvVar5 = *(void **)&state->field_0x1e79c; _Size = *(int *)&state->field_0x1e7a0 - (int)pvVar5; destData = *(void **)pbVar4; if ((uint)(*(int *)(this->_encounteredBosses + 8) - (int)destData >> 3) < (uint)((int)_Size >> 3)) { std::vector<8byte>::_Clear_and_reserve((int)_Size >> 3); destData = *(void **)pbVar4; } memmove(destData,pvVar5,_Size); *(size_t *)(this->_encounteredBosses + 4) = _Size + (int)destData; } this->_magicSkinUses = *(int *)&state->field_0x1e78c; std::vector<12byte>::operator_assign(&state->field_0x1e790); this->_pixelationTimer = *(int *)&state->field_0x1e7a8; this->_pixelationDuration = *(int *)&state->field_0x1e7ac; if (isContinue != 0) { init_procedural_item_surfaces(&this->_proceduralItemManager); iVar6 = -2; if (g_manager->_networkPlay == 0) { iVar6 = *(int *)&state->field_0x19d7c; } if ((this->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } PlayerManager::init_main_player (&this->_playerManager,iVar6,(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; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPath,&tmpString); local_8._0_1_ = 2; pbVar4 = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { pbVar4 = *(byte **)extraout_EAX; } ItemPool::Init(&this->_itemPool,*(uint *)&state->field_0x1e5bc,pbVar4); local_8 = CONCAT31(local_8._1_3_,1); if (0xf < redirectedPathCapacity) { bitsLow = redirectedPathCapacity + 1; pvVar5 = redirectedPath[0]; if (0xfff < bitsLow) { pvVar5 = *(void **)((int)redirectedPath[0] + -4); bitsLow = redirectedPathCapacity + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)pvVar5))) goto LAB_006f8543; } operator_delete(pvVar5,bitsLow); } local_8 = 0xffffffff; redirectedPathSize = 0; redirectedPathCapacity = 0xf; redirectedPath[0] = (void *)((uint)redirectedPath[0] & 0xffffff00); if (0xf < tmpString._capacity) { bitsLow = tmpString._capacity + 1; pvVar5 = (void *)tmpString._buf._0_4_; if (0xfff < bitsLow) { pvVar5 = *(void **)(tmpString._buf._0_4_ + -4); bitsLow = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)pvVar5))) { LAB_006f8543: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,bitsLow); } iVar6 = (this->_seedEffects)._gameStartSeed; if (iVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); iVar6 = (this->_seedEffects)._gameStartSeed; } BossPool::init(iVar6); (this->_fortuneRNG)._seed = *(int *)&state->field_0x1e784; (this->_fortuneRNG)._shift1 = 5; (this->_fortuneRNG)._shift2 = 9; (this->_fortuneRNG)._shift3 = 7; bitsLow = (this->_seedEffects)._gameStartSeed; if (bitsLow == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); bitsLow = (this->_seedEffects)._gameStartSeed; } if (bitsLow == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); bitsLow = (this->_seedEffects)._gameStartSeed; } Seeds::Seed2String(&tmpString,bitsLow); local_8 = 3; KAGE_LogMessage(1,(byte *)"RNG Start Seed: %s (%u) [Continue, %d]\n"); local_8 = 0xffffffff; if (0xf < tmpString._capacity) { bitsLow = tmpString._capacity + 1; pvVar5 = (void *)tmpString._buf._0_4_; if (0xfff < bitsLow) { pvVar5 = *(void **)(tmpString._buf._0_4_ + -4); bitsLow = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,bitsLow); } manager = g_manager; tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_8_ = tmpString._buf._0_8_ & 0xffffffffffffff00; if (g_manager->_networkPlay == 0) { if (((((this->_seedEffects)._isCustomRun == 0) && (isConsoleUsed = Seeds::AchievementUnlocksDisallowed(&this->_seedEffects), isConsoleUsed == 0)) && (isConsoleUsed = Manager::IsGameplayInputActive(unusedArg), isConsoleUsed == 0)) && ((this->_isRerun == 0 && (this->_victoryLap < 1)))) { isConsoleUsed = 0; } else { isConsoleUsed = 1; } KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = isConsoleUsed; } } pPVar2 = &this->_playerManager; (this->_playerManager)._rng._seed = *(int *)&state->field_0x1e780; (this->_playerManager)._rng._shift1 = 5; (this->_playerManager)._rng._shift2 = 7; (this->_playerManager)._rng._shift3 = 0x16; (this->_fortuneRNG)._seed = *(int *)&state->field_0x1e784; (this->_fortuneRNG)._shift1 = 5; (this->_fortuneRNG)._shift2 = 9; (this->_fortuneRNG)._shift3 = 7; ItemPool::RestoreGameState(&this->_itemPool,(GameStateItemPool *)&state->field_0x1e3cc); FUN_00422ea0(&state->field_0x1e680); FUN_009e0340(&state->field_0x1fd98); this->_ascentTimer = (uint)(state->field_0x1e7b0 != '\0'); slotState = &state->field_0x1e7b4; iVar6 = 7; do { Game_StateSlot::operator_assign(slotState); slotState = slotState + 800; iVar6 = iVar6 + -1; } while (iVar6 != 0); this->_deathCertificateExitTimer = (int)*(short *)&state->field_0x1fd94; oldModeHandler = (this->_deathmatchManager)._type; *(undefined4 *)&this->_deathmatchManager = 0; *(undefined4 *)&(this->_deathmatchManager).field_0x4 = 0; if (oldModeHandler != (undefined4 *)0x0) { (**(code **)*oldModeHandler)(1); (this->_deathmatchManager)._type = (void *)0x0; } DeathmatchManager::set_type(&this->_deathmatchManager,(uint)(byte)state->field_0x1fddc); (**(code **)(*(int *)(this->_deathmatchManager)._type + 0x74))(state); PlayerManager::RestoreGameState(&this->_playerManager,state); Level::RestoreGameState((Level *)this,state); PlayerManager::RestoreGameState_PostLevelInit(&this->_playerManager,state); srcIcon = (int *)&state->field_0x164; dstIcon = (g_manager->_nightmareScene)._stageBarIcons; iVar6 = 0xe; do { iVar3 = *srcIcon; srcIcon = srcIcon + 1; *dstIcon = iVar3; dstIcon = dstIcon + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); isConsoleUsed = state->field_0x84; (this->_ambush)._isActive = isConsoleUsed; (this->_ambush)._currentWave = *(int *)&state->field_0x88; if (isConsoleUsed != 0) { if (*(int *)((int)g_game->_room + 8) == 0x11) { Ambush::shuffle_waves(); waveIndex = 0; if (0 < ((this->_ambush)._currentWave + -1) * *(int *)&(this->_ambush).field_0x1c) { do { if ((this->_ambush)._bossRushWaves._begin == (this->_ambush)._bossRushWaves._end) break; std::vector<12byte>::_Tidy(); ppvVar1 = &(this->_ambush)._bossRushWaves._end; *ppvVar1 = (void *)((int)*ppvVar1 + -0xc); waveIndex = waveIndex + 1; } while (waveIndex < ((this->_ambush)._currentWave + -1) * *(int *)&(this->_ambush).field_0x1c); } } else { (this->_ambush)._isActive = 0; Ambush::StartChallenge(&this->_ambush); (this->_ambush)._currentWave = *(int *)&state->field_0x88; } *(undefined4 *)&this->field_0x265f0 = 0x1e; iVar6 = (g_manager->_musicManager)._currentMusicID; if ((iVar6 == 0x5f) || (iVar6 == 0x40)) { iVar6 = (*(int *)((int)g_game->_room + 8) == 0x11) + 0x26; if (iVar6 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60) { (g_manager->_musicManager)._queuedMusicID = iVar6; } } else { Music::Play((Music *)&g_manager->_musicManager, (*(int *)((int)g_game->_room + 8) == 0x11) + 0x26, (g_manager->_optionsConfig)._musicVolume); } } ScoreSheet::restore_state(&state->field_0x8c); bitsLow = 0; pvVar5 = (this->_playerManager)._playerList._end; oldModeHandler = (pPVar2->_playerList)._begin; if ((int)pvVar5 - (int)oldModeHandler >> 2 != 0) { do { if ((int)pvVar5 - (int)oldModeHandler >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (this->_playerManager)._playerList._end; oldModeHandler = (pPVar2->_playerList)._begin; } if (bitsLow < (uint)((int)pvVar5 - (int)oldModeHandler >> 2)) { oldModeHandler = oldModeHandler + bitsLow; } Entity_Player::update_mini_mush_costume((Entity_Player *)*oldModeHandler); pvVar5 = (this->_playerManager)._playerList._end; bitsLow = bitsLow + 1; oldModeHandler = (pPVar2->_playerList)._begin; } while (bitsLow < (uint)((int)pvVar5 - (int)oldModeHandler >> 2)); } ExceptionList = local_10; return; } //@@ 006f8a40 Game_StateSlot::operator_assign /* DB: ? copy-assign of a 0xc80-byte state block (2 x 0x23-dword arrays, then vectors) ; Game::store_game_state/restore_game_state call it in a loop over 7 blocks at Game+0x6778c */ int Game_StateSlot::operator_assign(int param_1) { int *piVar1; int in_ECX; int *dst; undefined4 *src; RoomDescriptor *roomList; size_t copySize; int iVar2; int blocksLeft; void *dstBegin; void *srcBegin; src = (undefined4 *)(param_1 + 0x8c); dst = (int *)(in_ECX + 0x6c); blocksLeft = 2; do { dst[-0x1b] = src[-0x23]; dst[-0x1a] = src[-0x22]; dst[-0x19] = src[-0x21]; dst[-0x18] = src[-0x20]; dst[-0x17] = src[-0x1f]; dst[-0x16] = src[-0x1e]; dst[-0x15] = src[-0x1d]; dst[-0x14] = src[-0x1c]; dst[-0x13] = src[-0x1b]; dst[-0x12] = src[-0x1a]; dst[-0x11] = src[-0x19]; dst[-0x10] = src[-0x18]; dst[-0xf] = src[-0x17]; dst[-0xe] = src[-0x16]; dst[-0xd] = src[-0x15]; dst[-0xc] = src[-0x14]; dst[-0xb] = src[-0x13]; dst[-10] = src[-0x12]; *(undefined2 *)(dst + -9) = *(undefined2 *)(src + -0x11); *(undefined2 *)((int)dst + -0x22) = *(undefined2 *)((int)src + -0x42); dst[-8] = src[-0x10]; *(undefined2 *)(dst + -7) = *(undefined2 *)(src + -0xf); *(undefined2 *)((int)dst + -0x1a) = *(undefined2 *)((int)src + -0x3a); dst[-6] = src[-0xe]; dst[-5] = src[-0xd]; dst[-4] = src[-0xc]; dst[-3] = src[-0xb]; dst[-2] = src[-10]; if (dst != src + -8) { srcBegin = (void *)src[-9]; copySize = *(int *)((param_1 - in_ECX) + (int)dst) - (int)srcBegin; dstBegin = (void *)dst[-1]; if ((uint)(dst[1] - (int)dstBegin >> 5) < (uint)((int)copySize >> 5)) { std::vector<32byte>::_Clear_and_reserve_geometric((int)copySize >> 5); dstBegin = (void *)dst[-1]; } memmove(dstBegin,srcBegin,copySize); *dst = (int)dstBegin + copySize; } if (dst + 2 != src + -6) { std::vector::assign(src[-6],src[-5],param_1); } piVar1 = dst + 5; if (piVar1 != src + -3) { iVar2 = *piVar1; FID_conflict__Erase_tree_>_> (piVar1,(fuzzer_allocator_> *)piVar1, *(_Tree_node **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; dst[6] = 0; std_set_uint_copy(dst + 5,src + -3,param_1); } if (dst + 7 != src + -1) { std::vector::assign(src[-1],*src,param_1); } *(undefined2 *)(dst + 10) = *(undefined2 *)(src + 2); *(undefined2 *)((int)dst + 0x2a) = *(undefined2 *)((int)src + 10); *(undefined2 *)(dst + 0xb) = *(undefined2 *)(src + 3); *(undefined2 *)((int)dst + 0x2e) = *(undefined2 *)((int)src + 0xe); *(undefined2 *)(dst + 0xc) = *(undefined2 *)(src + 4); *(undefined2 *)((int)dst + 0x32) = *(undefined2 *)((int)src + 0x12); *(undefined2 *)(dst + 0xd) = *(undefined2 *)(src + 5); *(undefined2 *)((int)dst + 0x36) = *(undefined2 *)((int)src + 0x16); *(undefined1 *)(dst + 0xe) = *(undefined1 *)(src + 6); *(undefined1 *)((int)dst + 0x39) = *(undefined1 *)((int)src + 0x19); *(undefined1 *)((int)dst + 0x3a) = *(undefined1 *)((int)src + 0x1a); *(undefined1 *)((int)dst + 0x3b) = *(undefined1 *)((int)src + 0x1b); *(undefined1 *)(dst + 0xf) = *(undefined1 *)(src + 7); *(undefined1 *)((int)dst + 0x3d) = *(undefined1 *)((int)src + 0x1d); *(undefined1 *)((int)dst + 0x3e) = *(undefined1 *)((int)src + 0x1e); *(undefined1 *)((int)dst + 0x3f) = *(undefined1 *)((int)src + 0x1f); *(undefined2 *)(dst + 0x10) = *(undefined2 *)(src + 8); *(undefined2 *)((int)dst + 0x42) = *(undefined2 *)((int)src + 0x22); dst[0x11] = src[9]; piVar1 = src + 10; src = src + 0x2e; dst[0x12] = *piVar1; dst = dst + 0x2e; blocksLeft = blocksLeft + -1; } while (blocksLeft != 0); iVar2 = 2; *(undefined8 *)(in_ECX + 0x170) = *(undefined8 *)(param_1 + 0x170); roomList = (RoomDescriptor *)(in_ECX + 0x188); *(undefined4 *)(in_ECX + 0x178) = *(undefined4 *)(param_1 + 0x178); *(undefined8 *)(in_ECX + 0x17c) = *(undefined8 *)(param_1 + 0x17c); *(undefined4 *)(in_ECX + 0x184) = *(undefined4 *)(param_1 + 0x184); do { GameState::copy_room_list(roomList,(RoomDescriptor *)((param_1 - in_ECX) + (int)roomList)); roomList = roomList + 1; iVar2 = iVar2 + -1; } while (iVar2 != 0); *(undefined8 *)(in_ECX + 0x2f8) = *(undefined8 *)(param_1 + 0x2f8); *(undefined4 *)(in_ECX + 0x300) = *(undefined4 *)(param_1 + 0x300); *(undefined8 *)(in_ECX + 0x304) = *(undefined8 *)(param_1 + 0x304); *(undefined4 *)(in_ECX + 0x30c) = *(undefined4 *)(param_1 + 0x30c); *(undefined4 *)(in_ECX + 0x310) = *(undefined4 *)(param_1 + 0x310); *(undefined4 *)(in_ECX + 0x314) = *(undefined4 *)(param_1 + 0x314); *(undefined4 *)(in_ECX + 0x318) = *(undefined4 *)(param_1 + 0x318); *(undefined1 *)(in_ECX + 0x31c) = *(undefined1 *)(param_1 + 0x31c); return in_ECX; } //@@ 006f8d60 GameState::copy_room_list /* DB: ? memmove vector copy, SaveBackwardsStage/RestoreGameState prototype: db/protos.zhl, confirmed by RET 4 */ RoomDescriptor * GameState::copy_room_list(RoomDescriptor *dest,RoomDescriptor *source) { std_set *this; void *pvVar1; RoomDescriptor *pRVar2; size_t _Size; void *local_8; pRVar2 = source; dest->GridIndex = source->GridIndex; dest->SafeGridIndex = source->SafeGridIndex; dest->ListIndex = source->ListIndex; dest->Dimension = source->Dimension; dest->Data = source->Data; dest->OverrideData = source->OverrideData; dest->AllowedDoors = source->AllowedDoors; dest->_doors[0] = source->_doors[0]; dest->_doors[1] = source->_doors[1]; dest->_doors[2] = source->_doors[2]; dest->_doors[3] = source->_doors[3]; dest->_doors[4] = source->_doors[4]; dest->_doors[5] = source->_doors[5]; dest->_doors[6] = source->_doors[6]; dest->_doors[7] = source->_doors[7]; dest->DisplayFlags = source->DisplayFlags; dest->VisitedCount = source->VisitedCount; dest->Flags = source->Flags; dest->TotalMoneySpent = source->TotalMoneySpent; dest->ClearCount = source->ClearCount; dest->GreedSubType = source->GreedSubType; dest->PoopCount = source->PoopCount; dest->TKeeperCoinSpawns = source->TKeeperCoinSpawns; dest->PitsCount = source->PitsCount; dest->DecorationSeed = source->DecorationSeed; dest->SpawnSeed = source->SpawnSeed; dest->AwardSeed = source->AwardSeed; dest->BossDeathSeed = source->BossDeathSeed; if (&dest->SavedGridEntities != &source->SavedGridEntities) { pvVar1 = (source->SavedGridEntities)._begin; _Size = (int)(source->SavedGridEntities)._end - (int)pvVar1; local_8 = (dest->SavedGridEntities)._begin; source = (RoomDescriptor *)((int)_Size >> 5); if ((RoomDescriptor *)((int)(dest->SavedGridEntities)._capacity - (int)local_8 >> 5) < source) { std::vector<32byte>::_Clear_and_reserve_geometric(source); local_8 = (dest->SavedGridEntities)._begin; } memmove(local_8,pvVar1,_Size); (dest->SavedGridEntities)._end = (void *)((int)local_8 + _Size); } if (&dest->SavedEntities != &pRVar2->SavedEntities) { std::vector::assign ((pRVar2->SavedEntities)._begin,(pRVar2->SavedEntities)._end,source); } this = &dest->RestrictedGridIndexes; if (this != &pRVar2->RestrictedGridIndexes) { pvVar1 = this->_head; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; (dest->RestrictedGridIndexes)._size = 0; std_set_uint_copy(&dest->RestrictedGridIndexes,&pRVar2->RestrictedGridIndexes,(int)source); } if (&dest->SavedEffects != &pRVar2->SavedEffects) { std::vector::assign ((pRVar2->SavedEffects)._begin,(pRVar2->SavedEffects)._end,source); } *(undefined2 *)&dest->field_0x94 = *(undefined2 *)&pRVar2->field_0x94; *(undefined2 *)&dest->field_0x96 = *(undefined2 *)&pRVar2->field_0x96; *(undefined2 *)&dest->field_0x98 = *(undefined2 *)&pRVar2->field_0x98; *(undefined2 *)&dest->field_0x9a = *(undefined2 *)&pRVar2->field_0x9a; *(undefined2 *)&dest->field_0x9c = *(undefined2 *)&pRVar2->field_0x9c; *(undefined2 *)&dest->field_0x9e = *(undefined2 *)&pRVar2->field_0x9e; *(undefined2 *)&dest->field_0xa0 = *(undefined2 *)&pRVar2->field_0xa0; *(undefined2 *)&dest->field_0xa2 = *(undefined2 *)&pRVar2->field_0xa2; dest->field_0xa4 = pRVar2->field_0xa4; dest->field_0xa5 = pRVar2->field_0xa5; dest->field_0xa6 = pRVar2->field_0xa6; dest->field_0xa7 = pRVar2->field_0xa7; dest->field_0xa8 = pRVar2->field_0xa8; dest->field_0xa9 = pRVar2->field_0xa9; dest->field_0xaa = pRVar2->field_0xaa; dest->field_0xab = pRVar2->field_0xab; dest->ShopItemIdx = pRVar2->ShopItemIdx; dest->ShopItemDiscountIdx = pRVar2->ShopItemDiscountIdx; dest->DeliriumDistance = pRVar2->DeliriumDistance; dest->Group = pRVar2->Group; return dest; } //@@ 006f9000 Game::store_game_state /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (GameState*) mirror of 006f8140: ItemPool::StoreGameState, Seeds copy, 009bd150; callers Game::save_rewind_state, 009172f0, 00958ed0 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Game::store_game_state(Game *this,GameState *state) { void *_Src; undefined1 uVar1; Seeds *other; uint bitIndex; uint wordIndex; int iVar2; uint highMask; int *dstIcon; uint lowMask; int *srcIcon; uint i; size_t bossesBytes; int iVar3; undefined1 *stateSlot; void *dstBosses; Seeds seedsCopy; uint securityCookie; void *local_10; undefined1 *puStack_c; int local_8; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00afc0ed; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)&(&seedsCopy)[1]._rng._shift3; ExceptionList = &local_10; GameState::Clear(state); Seeds::construct_from_copy(&seedsCopy,&this->_seedEffects); local_8 = 0; Seeds::operator_assign((Seeds *)&state->field_0x1e724,other); local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&seedsCopy._seedEffects, (fuzzer_allocator_> *)&seedsCopy._seedEffects, *(_Tree_node **)((int)seedsCopy._seedEffects + 4)); operator_delete(seedsCopy._seedEffects,0x14); *(int *)&state->field_0x1e780 = (this->_playerManager)._rng._seed; i = 0; *(int *)&state->field_0x1e784 = (this->_fortuneRNG)._seed; *(int *)state = this->_challenge; state->field_0x4 = this->_isRerun; state->field_0x5 = this->_isConsoleUsedThisRun; *(int *)&state->field_0x8 = this->_difficulty; *(undefined2 *)&state->field_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; (&state->field_0xe)[bitIndex] = (lowMask & *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x28)) != 0 || (highMask & *(uint *)(this->_giantBookClickerImage + wordIndex * 8 + 0x2c)) != 0; } while ((ushort)i < *(ushort *)&state->field_0xc); *(int *)&state->field_0x44 = this->_lastDevilRoomStage; *(int *)&state->field_0x48 = this->_treasureRoomsVisited; *(int *)&state->field_0x4c = this->_planetariumsVisited; *(int *)&state->field_0x50 = this->_stagesWithoutHeartsPicked; *(int *)&state->field_0x54 = this->_stagesWithoutDamage; *(int *)&state->field_0x58 = this->_devilRoomDeals; *(int *)&state->field_0x5c = this->_shopVisits; *(int *)&state->field_0x60 = this->_donationModGreed; *(int *)&state->field_0x64 = this->_donationModAngel; *(int *)&state->field_0x68 = this->_reviveMachineCoinsLeft; *(int *)&state->field_0x6c = this->_reviveMachineUses; *(int *)&state->field_0x70 = this->_bossRushParTime; *(int *)&state->field_0x74 = this->_blueWombParTime; *(int *)&state->field_0x78 = this->_frameCount; *(int *)&state->field_0x7c = this->_timeCounter; *(int *)&state->field_0x80 = this->_stageNameNumeral; *(int *)&state->field_0xdc = this->_victoryLap; *(int *)&state->field_0xe0 = this->_lastLevelWithoutHalfHp; *(int *)&state->field_0x1e788 = this->_lastLevelWithDamage; if (&state->field_0x1e79c != this->_encounteredBosses) { _Src = *(void **)this->_encounteredBosses; bossesBytes = *(int *)(this->_encounteredBosses + 4) - (int)_Src; dstBosses = *(void **)&state->field_0x1e79c; if ((uint)(*(int *)&state->field_0x1e7a4 - (int)dstBosses >> 3) < (uint)((int)bossesBytes >> 3)) { std::vector<8byte>::_Clear_and_reserve((int)bossesBytes >> 3); dstBosses = *(void **)&state->field_0x1e79c; } memmove(dstBosses,_Src,bossesBytes); *(size_t *)&state->field_0x1e7a0 = (int)dstBosses + bossesBytes; } *(int *)&state->field_0x1e7a8 = this->_pixelationTimer; *(int *)&state->field_0x1e7ac = this->_pixelationDuration; *(int *)&state->field_0x1e78c = this->_magicSkinUses; std::vector<12byte>::operator_assign(&this->_erasedEntities); ItemPool::StoreGameState(&this->_itemPool,(GameStateItemPool *)&state->field_0x1e3cc); FUN_00422f80(&state->field_0x1e680); std::vector<4byte>::resize ((int)(this->_proceduralItemManager)._proceduralItems._end - (int)(this->_proceduralItemManager)._proceduralItems._begin >> 2); i = 0; if ((int)(this->_proceduralItemManager)._proceduralItems._end - (int)(this->_proceduralItemManager)._proceduralItems._begin >> 2 != 0) { do { *(undefined4 *)(*(int *)&state->field_0x1fd98 + i * 4) = *(undefined4 *) (*(int *)((int)(this->_proceduralItemManager)._proceduralItems._begin + i * 4) + 8); i = i + 1; } while (i < (uint)((int)(this->_proceduralItemManager)._proceduralItems._end - (int)(this->_proceduralItemManager)._proceduralItems._begin >> 2)); } Room::on_leave(this->_room); Level::store_game_state(state); PlayerManager::store_game_state(state); state->field_0x1e7b0 = 0 < this->_ascentTimer; stateSlot = &this->field_0x6778c; iVar3 = 7; do { Game_StateSlot::operator_assign(stateSlot); stateSlot = stateSlot + 800; iVar3 = iVar3 + -1; } while (iVar3 != 0); iVar3 = 0xe; srcIcon = (g_manager->_nightmareScene)._stageBarIcons; *(short *)&state->field_0x1fd94 = (short)this->_deathCertificateExitTimer; dstIcon = (int *)&state->field_0x164; do { iVar2 = *srcIcon; srcIcon = srcIcon + 1; *dstIcon = iVar2; game = g_game; dstIcon = dstIcon + 1; iVar3 = iVar3 + -1; } while (iVar3 != 0); state->field_0x84 = (g_game->_ambush)._isActive; iVar3 = (game->_ambush)._currentWave; iVar2 = iVar3 + -1; if (iVar3 < 1) { iVar2 = iVar3; } *(int *)&state->field_0x88 = iVar2; ScoreSheet::store_state(&state->field_0x8c); uVar1 = (**(code **)(*(int *)(this->_deathmatchManager)._type + 4))(); state->field_0x1fddc = uVar1; (**(code **)(*(int *)(this->_deathmatchManager)._type + 0x70))(state); ExceptionList = local_10; return; } //@@ 006f9400 Seeds::GetForcedCurses /* DB: src/rooms decompile labels (Seeds::GetForcedCurses?) prototype: db/protos.zhl */ uint __cdecl Seeds::GetForcedCurses(void) { void *pvVar1; uint uVar2; uint uVar3; void **ppvVar4; void *pvVar5; undefined1 local_18 [8]; void *local_10; undefined4 local_c; void *local_8; local_8 = (void *)0x38; ppvVar4 = &(g_game->_seedEffects)._seedEffects; std::set::find_node(local_18,&local_8); if ((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x39)) { pvVar1 = local_10; local_8 = *ppvVar4; } else { pvVar1 = *ppvVar4; local_8 = pvVar1; } pvVar5 = local_8; local_c = 0x39; uVar3 = (uint)(pvVar1 != local_8); std::set::find_node(local_18,&local_c); if ((((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x3a)) && (local_10 != local_8)) && (g_game->_challenge != 0x2c)) { uVar2 = g_game->_stage & 0x80000001; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffe) + 1; } if (((uVar2 == 1) && (g_game->_stage < 8)) && ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { uVar3 = uVar3 | 2; } } local_c = 0x3a; std::set::find_node(local_18,&local_c); if (((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x3b)) && (pvVar5 = *ppvVar4, local_10 != pvVar5)) { uVar3 = uVar3 | 4; } local_c = 0x3b; std::set::find_node(local_18,&local_c); if (((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x3c)) && (local_10 != pvVar5)) { uVar3 = uVar3 | 8; } local_c = 0x3c; std::set::find_node(local_18,&local_c); if (((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x3d)) && (local_10 != pvVar5)) { uVar3 = uVar3 | 0x20; } local_c = 0x3d; std::set::find_node(local_18,&local_c); if (((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x3e)) && (local_10 != pvVar5)) { uVar3 = uVar3 | 0x40; } local_c = 0x3e; std::set::find_node(local_18,&local_c); if (((*(char *)((int)local_10 + 0xd) == '\0') && (*(int *)((int)local_10 + 0x10) < 0x3f)) && (local_10 != pvVar5)) { uVar3 = uVar3 | 0x10; } return uVar3; } //@@ 006f95a0 Seeds::GetPreventedCurses /* DB: src/rooms decompile labels (Seeds::GetPreventedCurses?) prototype: db/protos.zhl */ uint __cdecl Seeds::GetPreventedCurses(void) { void *pvVar1; uint uVar2; void *pvVar3; void **ppvVar4; undefined1 local_14 [8]; void *local_c; undefined4 local_8; local_8 = 0x3f; ppvVar4 = &(g_game->_seedEffects)._seedEffects; std::set::find_node(local_14,&local_8); if ((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x40)) { pvVar1 = local_c; pvVar3 = *ppvVar4; } else { pvVar1 = *ppvVar4; pvVar3 = pvVar1; } local_8 = 0x40; uVar2 = (uint)(pvVar1 != pvVar3); std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x41)) && (local_c != pvVar3)) { uVar2 = uVar2 | 2; } local_8 = 0x41; std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x42)) && (local_c != pvVar3)) { uVar2 = uVar2 | 4; } local_8 = 0x42; std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x43)) && (local_c != pvVar3)) { uVar2 = uVar2 | 8; } local_8 = 0x43; std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x44)) && (local_c != pvVar3)) { uVar2 = uVar2 | 0x20; } local_8 = 0x44; std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x45)) && (local_c != pvVar3)) { uVar2 = uVar2 | 0x40; } local_8 = 0x46; std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x47)) && (local_c != pvVar3)) { uVar2 = 0x7f; } local_8 = 0x4f; std::set::find_node(local_14,&local_8); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x50)) && (local_c != pvVar3)) { uVar2 = uVar2 | 0x40; } return uVar2; } //@@ 006f9730 FUN_006f9730 undefined1 FUN_006f9730(void) { int in_ECX; if ((((*(float *)(in_ECX + 0x26598) <= 0.0) && (*(int *)(in_ECX + 0x1ba78) == 0)) && (*(int *)(in_ECX + 0x1d520) == 0)) && ((*(char *)(in_ECX + 0x25954) == '\0' && (*(int *)(in_ECX + 0x1d654) == 0)))) { return 1; } return 0; } //@@ 006f9770 Game::End /* ZHL [exact] __thiscall void Game::End(int EndingID); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Game::End(Game *this,int EndingID) { char isEndHandled; byte isCleanup; uint uVar1; Manager *nextMenuState; Manager *manager; Game *game; int *cutsceneCounter; manager = g_manager; game = g_game; if (0xe < (uint)EndingID) { KAGE_LogMessage(1,(byte *)"Invalid ending specified to Game::End()\n"); return; } if ((1 < *(int *)&this->_deathmatchManager) && (*(int *)&this->_deathmatchManager != 6)) { return; } if (EndingID == 1) { DeleteSaveState(); LAB_006f97bc: manager = g_manager; game = g_game; } else { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) goto LAB_006f97bc; if ((((g_game->_dailyChallenge)._id == 0) && (g_game->_challenge == 0)) && (uVar1 = PlayerManager::count_main_players(&g_game->_playerManager), 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 == *(NetplayManager *)(manager + 1)) { FUN_006f9f20(EndingID); FUN_00864fc0(EndingID == 1); return; } online_stats_finalize(EndingID); FUN_00864fc0(EndingID == 1); return; } if ((manager->_netplayManager == *(NetplayManager *)(manager + 1)) || (manager[1]._persistentGameData._achievements[0] == 0)) { isCleanup = 1; } else { isCleanup = 0; } nextMenuState = (Manager *)0x1; if (manager->_netplayManager != *(NetplayManager *)(manager + 1)) { nextMenuState = (Manager *)&DAT_00000011; } switch(EndingID) { case 1: GameOver::Show(); persistent_game_data_set_writable(); FUN_00864fc0(EndingID == 1); return; case 2: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 3; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (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; } Manager::ShowCutscene(nextMenuState,uVar1,isCleanup,(uint)nextMenuState); manager = g_manager; game = g_game; goto LAB_006f995b; case 4: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0xf; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0xf; break; case 5: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x10; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x10; break; case 6: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x12; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x12; break; case 7: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x11; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x11; break; case 8: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x13; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x13; break; case 9: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x15; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x15; break; case 10: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x14; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x14; break; case 0xb: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x16; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x16; break; case 0xc: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x17; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x17; break; case 0xd: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x18; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (int)nextMenuState; (manager->_cutsceneManager)._queuedCutsceneId = 0x18; break; case 0xe: cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x1a; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2; *cutsceneCounter = *cutsceneCounter + 1; *(undefined1 *)&manager->_persistentGameData = 1; (manager->_cutsceneManager).field_0x848 = 1; (manager->_cutsceneManager)._isQueuedCleanup = isCleanup; manager->_cutsceneNextMenuState = (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 != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))) { save_rerun_to_steam_cloud(); } end_save_progress(); LAB_006f9993: FUN_00864fc0(EndingID == 1); return; } //@@ 006f9d20 get_stage_ending_id /* DB: no ECX, reads g_game: maps RoomConfig::GetStageID() (+ challenge end stage/path, Polaroid 327/Negative 328 owners on stage 10, difficulty 3, current room -7) to an ending id 2..13, 0 = none, 0xff = no ending; result passed to Game::End by Entity_Pickup::Update (big chest, "[warn] No ending for big chest!" at the StageTransition site) and StageTransition::Update */ undefined4 get_stage_ending_id(char param_1) { bool bVar1; bool bVar2; ChallengeParam *pCVar3; uint uVar4; Entity_Player *pEVar5; undefined4 uVar6; Game *pGVar7; pGVar7 = g_game; pCVar3 = Game::GetChallengeParams(g_game); if (((pGVar7->_challenge == 0) && ((pGVar7->_dailyChallenge)._id == 0)) || (pCVar3->_endStage < 0xb)) { bVar1 = false; } else { bVar1 = true; } if (((pGVar7->_challenge == 0) && ((pGVar7->_dailyChallenge)._id == 0)) || (pCVar3->_pathType != 1)) { bVar2 = false; } else { bVar2 = true; } uVar4 = RoomConfig::GetStageID(pGVar7->_stage,pGVar7->_stageType,-1); if ((param_1 == '\0') && (pGVar7->_stage == 10)) { if (uVar4 == 0xf) { pEVar5 = PlayerManager::FirstCollectibleOwner (&pGVar7->_playerManager,0x147,(RNG **)&pGVar7->_playerManager,1); if (pEVar5 != (Entity_Player *)0x0) { return 0; } if (bVar1) { if (bVar2) { return 0; } pGVar7 = g_game; goto LAB_006f9dee; } } else { if (uVar4 != 0xe) goto LAB_006f9de2; pEVar5 = PlayerManager::FirstCollectibleOwner (&pGVar7->_playerManager,0x148,(RNG **)&pGVar7->_playerManager,1); if (pEVar5 != (Entity_Player *)0x0) { return 0; } if ((bVar1) && (!bVar2)) { return 0; } } pGVar7 = g_game; } LAB_006f9de2: if (0x1b < uVar4 - 7) { return 0xff; } LAB_006f9dee: /* WARNING (jumptable): Sanity check requires truncation of jumptable */ /* WARNING: Could not find normalized switch variable to match jumptable */ switch((&LAB_006f9ef5)[uVar4]) { case 0: return 2; case 1: return 3; case 2: return 10; case 3: return 4; case 4: return 5; case 5: if (pGVar7->_currentRoomIdx != -7) { return 6; } break; case 6: if (pGVar7->_currentRoomIdx != -7) { return 7; } break; case 7: uVar6 = 9; if (pGVar7->_difficulty == 3) { uVar6 = 0xc; } return uVar6; case 8: return 0xb; case 9: return 0xd; case 10: return 0xff; } return 8; } //@@ 006f9f20 FUN_006f9f20 void FUN_006f9f20(int param_1) { uint uVar1; int iVar2; uint uVar3; uint uVar4; uint uVar5; int iVar6; int *in_ECX; Manager *pMVar7; pMVar7 = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar7->_persistentGameData)._isReadOnly = 0; pMVar7 = g_manager; if ((char)in_ECX[0x998e] == '\0') { if (param_1 == 1) { (g_manager->_persistentGameData)._eventCounters[0xc0] = 0; PersistentGameData::IncreaseEventCounter(&pMVar7->_persistentGameData,0x20a,1); } else { (g_manager->_persistentGameData)._eventCounters[0x20a] = 0; PersistentGameData::IncreaseEventCounter(&pMVar7->_persistentGameData,0xc0,1); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc1,1); if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x280); } } pMVar7 = g_manager; uVar1 = (g_manager->_persistentGameData)._eventCounters[0xc0]; if ((uint)(g_manager->_persistentGameData)._eventCounters[0x209] < uVar1) { (g_manager->_persistentGameData)._eventCounters[0x209] = uVar1; } (pMVar7->_persistentGameData)._eventCounters[0xbf] = 0; } else { } KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar7->_persistentGameData)._isReadOnly = 1; in_ECX[0x99cf] = param_1; if (param_1 != 1) { iVar2 = *in_ECX; uVar1 = g_game->_debugCurses; uVar3 = g_game->_curses; uVar4 = Seeds::GetForcedCurses(); uVar5 = Seeds::GetPreventedCurses(); iVar6 = iVar2 + 1; if ((~uVar5 & (uVar4 | uVar1 | uVar3) & 2) == 0) { iVar6 = iVar2; } FUN_009e5a30(iVar6,in_ECX[1],in_ECX[0x993f],0); } ScoreSheet::Calculate((ScoreSheet *)(in_ECX + 0x99b9)); Leaderboard::Show((Leaderboard *)(in_ECX + 0x7594),in_ECX[0x998c],(ScoreSheet *)(in_ECX + 0x99b9), (char)in_ECX[0x998e] == '\0', g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)); return; } //@@ 006fa0c0 Game::Exit /* ZHL [exact] __stdcall void Game::Exit(bool ShouldSave); prototype: REPENTOGON, confirmed by RET 4 */ void Game::Exit(byte ShouldSave) { 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; Game *game; char isNil; Manager *manager; void *playersEnd; game = g_game; if (g_game->_isStarted != 0) { FUN_008650a0(_ShouldSave); SFXManager::StopLoopingSounds(&g_manager->_sfxManager); SFXManager::Stop(&g_manager->_sfxManager,0x256); SFXManager::Stop(&g_manager->_sfxManager,599); SFXManager::Stop(&g_manager->_sfxManager,600); SFXManager::Stop(&g_manager->_sfxManager,0x259); SFXManager::Stop(&g_manager->_sfxManager,0x3f0); iVar4 = (game->_itemOverlay)._state; if ((iVar4 != 0) && (iVar4 == 2)) { ItemOverlay::Update(&game->_itemOverlay,1); } manager = g_manager; iVar4 = (g_manager->_musicManager)._currentChannel; (g_manager->_musicManager)._pitch = 1.0; (manager->_musicManager)._targetPitch = 1.0; Music::SetPitchAll((Music *)((manager->_musicManager)._channels + iVar4),1.0); gameData = &g_manager->_persistentGameData; if ((*(char *)gameData != '\0') && ((g_manager->_persistentGameData)._isFileLoaded != 0)) { *(undefined1 *)gameData = 0; Manager::BackupSaveFile((Manager *)gameData); manager = g_manager; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar3 == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(gameData); } else { PersistentGameData::SaveToSteamCloud(gameData); } } if (game->field_0x2658b == '\0') { if (ShouldSave == 0) { DeleteSaveState(); } else { Manager::save_game_state(); } } game->_emoteMenuState = 0; *(undefined4 *)&game->field_0x2593c = 0; FUN_008d26c0(0,0); *(undefined4 *)&game->field_0x25948 = 0; *(undefined4 *)&game->field_0x2590c = 0; *(undefined4 *)&game->_gameOver = 0; ANM2::Reset((ANM2 *)&(game->_gameOver).field_0x8); (game->_leaderboard)._state = 0; playersEnd = (game->_onlineStatsScreen)._players._end; statsEntry = (game->_onlineStatsScreen)._players._begin; if (statsEntry != playersEnd) { do { std::string::_Tidy_deallocate((char *)((int)statsEntry + 8)); statsEntry = (void *)((int)statsEntry + 0x38); } while (statsEntry != playersEnd); statsEntry = (game->_onlineStatsScreen)._players._begin; } (game->_onlineStatsScreen)._players._end = statsEntry; (game->_onlineStatsScreen)._isActive = 0; reset_run_state(); manager = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); pGVar1 = g_game; (manager->_persistentGameData)._isReadOnly = 0; (pGVar1->_playerManager)._stageTransitionPlayer = (void *)0x0; *(undefined4 *)&game->_stageTransition = 0; (game->_stageTransition)._frame = 0; game->field_0x1ba84 = 0; *(undefined4 *)&game->field_0x1ba88 = 0; *(float *)&game->field_0x1ba90 = g_vectorZero.x; *(float *)&game->field_0x1ba94 = g_vectorZero.y; (game->_stageTransition)._duration = 0x32; (game->_roomTransition)._frame = 0; *(undefined4 *)&(game->_roomTransition).field_0xc = 0; *(undefined4 *)&game->_roomTransition = 0; (game->_roomTransition)._direction = 0; (game->_roomTransition)._animation = 0; *(undefined4 *)&(game->_roomTransition).field_0x20 = 0; (game->_roomTransition)._flags = 0; (pGVar1->_playerManager)._roomTransitionPlayer = (void *)0x0; game->_gameStateFlags = 0; ANM2::Reset(&(game->_itemOverlay)._sprite); ANM2::Reset(&(game->_itemOverlay)._megaMushPlayerSprite); (game->_itemOverlay)._state = 0; (game->_itemOverlay)._overlayID = 0; FUN_00421260(); _ShouldSave = (uint *)&(game->_roomConfig).field_0x80; piStack_8 = (int *)0x25; do { iVar4 = 2; roomList = _ShouldSave; do { if (((char)roomList[3] != '\0') && (entryIndex = 0, *roomList != 0)) { entryOffset = 0; do { entryIndex = entryIndex + 1; *(undefined4 *)(entryOffset + 0x34 + roomList[-1]) = *(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 = (int *)((int)piStack_8 + -1); } while (piStack_8 != (int *)0x0); Console::Close(); FUN_007384d0(); FUN_009b9150(); HUD::unload_graphics(&game->_hud); FUN_009a19a0(); TextureCache::Purge(); piVar3 = (int *)game->_preloadManager; _ShouldSave = (uint *)*piVar3; if (_ShouldSave != (uint *)piVar3) { do { std::map::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 { KAGE::SmartPointer::reset((void *)(iVar4 + 0x18),(void *)0x0); iVar4 = iVar4 + 0x20; } while (iVar4 != piVar2[0x12]); } *(undefined1 *)(piStack_8 + 10) = 0; } TextureCache::Purge(); piVar3 = (int *)_ShouldSave[2]; if (*(char *)((int)piVar3 + 0xd) == '\0') { isNil = *(char *)(*piVar3 + 0xd); _ShouldSave = (uint *)piVar3; piVar3 = (int *)*piVar3; while (isNil == '\0') { isNil = *(char *)(*piVar3 + 0xd); _ShouldSave = (uint *)piVar3; piVar3 = (int *)*piVar3; } } else { isNil = *(char *)((int)_ShouldSave[1] + 0xd); piVar2 = (int *)_ShouldSave[1]; piVar3 = (int *)_ShouldSave; while ((_ShouldSave = (uint *)piVar2, isNil == '\0' && (piVar3 == (int *)_ShouldSave[2]))) { isNil = *(char *)((int)_ShouldSave[1] + 0xd); piVar2 = (int *)_ShouldSave[1]; piVar3 = (int *)_ShouldSave; } } piVar3 = (int *)game->_preloadManager; } while (_ShouldSave != (uint *)piVar3); } FUN_009b5cb0(); game->_framesSinceRoomTransition = 0; *(undefined2 *)&game->_isStarted = 0; } return; } //@@ 006fa540 Manager::update_ingame_input /* DB: ? called from Manager::Update case 2 (in game) when no overlay/menu consumed input; ACTION_PAUSE (0xc) -> Game+0x26534 pause request, ACTION_MUTE (0x12) per controller ("Out of bounds"), menu confirm/back (0xe/0xf), Player_stats_add(8,..) */ void Manager::update_ingame_input(void) { Game *pGVar1; Game *pGVar2; char cVar3; char isActionHeld; byte bVar4; undefined4 uVar5; int iVar6; Entity_Player *player; char *anim; int netplayPeer; PersistentGameData *saveData; int *piVar7; NetplayManager NVar8; NetplayManager *netplayManager; void *statsPlayer; KColor fadeColor; float local_24; float fStack_20; float fStack_1c; float fStack_18; int local_10; int local_c; uint playerIndex; code *actionTriggeredFn; float fadeAlpha; bool isRestartReady; Manager *manager; undefined1 *prevHoldState; void *statsPlayersEnd; pGVar1 = g_game; actionTriggeredFn = *(code **)(PTR_vftable_00c57b18 + 0x44); uVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x14))(0xc); cVar3 = (*actionTriggeredFn)(uVar5,0,0); if (cVar3 != '\0') { pGVar1->_triggerWindowResize = 1; } piVar7 = (pGVar1->_playerManager)._playerList._begin; local_10 = (g_manager->_persistentGameData)._eventCounters[0x15]; if ((int)(pGVar1->_playerManager)._playerList._end - (int)piVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar7 = (pGVar1->_playerManager)._playerList._begin; } local_c = *(int *)(*piVar7 + 0x13c0); cVar3 = is_any_player_restart_held(); netplayManager = &g_manager->_netplayManager; if ((*netplayManager != *(NetplayManager *)(g_manager + 1)) && (1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)*netplayManager >> 2))) { cVar3 = '\x01'; playerIndex = 0; do { NVar8 = *netplayManager; if ((uint)((int)netplayManager[1] - (int)NVar8 >> 2) <= playerIndex) { KAGE_LogMessage(0x10,(byte *)"Out of bounds\n"); NVar8 = *netplayManager; } piVar7 = *(int **)((int)NVar8 + playerIndex * 4); if ((piVar7 == (int *)0x0) || (iVar6 = FUN_004253d0(), iVar6 == 0)) { cVar3 = '\0'; } else { isActionHeld = (**(code **)(*piVar7 + 0x30))(0x12); player = (Entity_Player *)FUN_004253d0(); if (isActionHeld == '\0') { cVar3 = '\0'; if ((*(char *)&player[1]._damageEvents._end != '\0') && (player[1]._damageEvents._capacity == &DAT_00000014)) { *(undefined1 *)&player[1]._damageEvents._end = 0; player[1]._damageEvents._capacity = &DAT_0000003c; player[1]._pendingDamage = 0.0; *(undefined4 *)&player[1]._pendingDamageFlags = 0; } } else { Player_stats_add(&g_game->_onlinePlayerStats,8,player,1.0); prevHoldState = player[1]._damageEvents._capacity; *(undefined1 *)&player[1]._damageEvents._end = 1; *(undefined4 *)&player[1]._pendingDamageFlags = 0; if (prevHoldState != &DAT_00000014) { anim = player[1]._bodySprite._filename._buf + 0xc; player[1]._damageEvents._capacity = &DAT_00000014; player[1]._pendingDamage = 0.0; if (0xf < *(uint *)(player[1]._bodySprite._animDefaultName._buf + 8)) { anim = *(char **)anim; } ANM2::Play((ANM2 *)(player[1]._sprite._championColor._colorize + 2),(byte *)anim,0); if (*(char *)((int)&player[1]._shrinkCountdown + 1) != '\0') { AnimationState::Update((AnimationState *)&player[1]._shadowOffset.y); AnimationState::Update((AnimationState *)&player[1]._entityGridCollisionClass); } } } } playerIndex = playerIndex + 1; netplayManager = &g_manager->_netplayManager; } while (playerIndex < (uint)(*(int *)(g_manager + 1) - (int)*netplayManager >> 2)); } if (cVar3 == '\0') { pGVar1->_restartHoldFrames = 0; } else if (pGVar1->_fadeOutTarget != 6) { pGVar1->_restartHoldFrames = pGVar1->_restartHoldFrames + 1; } if ((((local_c == 9) || (local_c == 0x1e)) && (local_10 == 0)) || (((pGVar1->_dailyChallenge)._id != 0 || (pGVar1->_restartHoldFrames < 0x10)))) { isRestartReady = false; } else { isRestartReady = true; } if (cVar3 == '\0') { if (pGVar1->_fadeOutTarget == 6) { pGVar1->_fadeSpeed = 0.13333334; pGVar1->_fadeOutTarget = 0; } } else if ((isRestartReady) && (pGVar1->_fadeOutTarget != 6)) { KColor::SetFromARGB(&fadeColor,0xff000000); local_24 = fadeColor._red; fStack_20 = fadeColor._green; fStack_1c = fadeColor._blue; fStack_18 = (pGVar1->_fadeOutColor)._alpha; pGVar1->_fadeSpeed = 0.033333335; pGVar1->_fadeOutTarget = 6; (pGVar1->_fadeOutColor)._red = fadeColor._red; (pGVar1->_fadeOutColor)._green = fadeColor._green; (pGVar1->_fadeOutColor)._blue = fadeColor._blue; (pGVar1->_fadeOutColor)._alpha = fStack_18; (pGVar1->_fadeOutColor)._unk = 0; fadeAlpha = (pGVar1->_fadeOutColor)._alpha; pGVar1->_restartHoldFrames = 0; (pGVar1->_fadeOutColor)._alpha = fadeAlpha + 0.033333335; } Console::Update(&pGVar1->_console); if (pGVar1->_console == (Console)0x0) { if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) goto LAB_006fa894; } else { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { return; } if (((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager & 0xfffffffcU) == 4) { return; } LAB_006fa894: EmoteWheel::Update(); } if ((pGVar1->_onlineStatsScreen)._isActive != 0) { uVar5 = 0xffffffff; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar6 = FUN_0090b070(); if (*(int *)(iVar6 + 0x378) == 0) { uVar5 = 0xdeadbeef; } else { uVar5 = *(undefined4 *)(*(int *)(iVar6 + 0x378) + 0xc); } } if ((g_game == (Game *)0x0) || ((g_game->_dailyChallenge)._id == 0)) { local_10 = 0xe; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(uVar5,FUN_00a209e0,&local_10,0,0); if (cVar3 == '\0') { local_c = 0xf; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(uVar5,FUN_00a209e0,&local_c,0,0); if (cVar3 == '\0') goto LAB_006fa9cc; } online_vote_send(0); } else { local_10 = 0xe; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(uVar5,FUN_00a209e0,&local_10,0,0); if (cVar3 != '\0') { if ((pGVar1->_onlineStatsScreen)._isActive != 0) { statsPlayersEnd = (pGVar1->_onlineStatsScreen)._players._end; statsPlayer = (pGVar1->_onlineStatsScreen)._players._begin; if (statsPlayer != statsPlayersEnd) { do { std::string::_Tidy_deallocate((char *)((int)statsPlayer + 8)); statsPlayer = (void *)((int)statsPlayer + 0x38); } while (statsPlayer != statsPlayersEnd); statsPlayer = (pGVar1->_onlineStatsScreen)._players._begin; } (pGVar1->_onlineStatsScreen)._players._end = statsPlayer; (pGVar1->_onlineStatsScreen)._isActive = 0; } FUN_006f9f20(*(undefined4 *)&pGVar1->field_0x25ec8); } } LAB_006fa9cc: manager = g_manager; if ((g_game->_dailyChallenge)._id == 0) { iVar6 = FUN_0091cb10(); (manager->_popupButtons)._buttons[1]._isVisible = iVar6 == 0; } else { (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (manager->_popupButtons)._buttons[0]._slideOffset = 96.0; (manager->_popupButtons)._buttons[1]._textFrame = 6; (manager->_popupButtons)._buttons[1]._isVisible = 1; } if ((pGVar1->_onlineStatsScreen)._isActive != 0) { return; } } cVar3 = FUN_009c3990(); if (cVar3 == '\0') { if (*(int *)&pGVar1->_gameOver == 0) goto LAB_006fac27; iVar6 = -1; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (netplayPeer = FUN_0090b070(), netplayPeer != 0)) { if (*(int *)(netplayPeer + 0x378) == 0) { iVar6 = -0x21524111; } else { iVar6 = *(int *)(*(int *)(netplayPeer + 0x378) + 0xc); } } bVar4 = input_is_action_triggered(g_manager,0xe,iVar6,(Entity *)0x0,0); if (bVar4 == 0) { bVar4 = input_is_action_triggered(g_manager,0xf,iVar6,(Entity *)0x0,0); manager = g_manager; if (bVar4 != 0) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { KColor::SetFromARGB(&fadeColor,0xff000000); pGVar2 = g_game; local_24 = fadeColor._red; fStack_20 = fadeColor._green; fStack_1c = fadeColor._blue; fStack_18 = (g_game->_fadeOutColor)._alpha; g_game->_fadeSpeed = 0.08; pGVar2->_fadeOutTarget = 2; (pGVar2->_fadeOutColor)._red = fadeColor._red; (pGVar2->_fadeOutColor)._green = fadeColor._green; (pGVar2->_fadeOutColor)._blue = fadeColor._blue; (pGVar2->_fadeOutColor)._alpha = fStack_18; (pGVar2->_fadeOutColor)._unk = 0; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08; (manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; } else { online_vote_send(0); } } } else if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { input_poll_active_device(); KColor::SetFromARGB(&fadeColor,0xff000000); pGVar2 = g_game; local_24 = fadeColor._red; fStack_20 = fadeColor._green; fStack_1c = fadeColor._blue; fStack_18 = (g_game->_fadeOutColor)._alpha; g_game->_fadeSpeed = 0.08; pGVar2->_fadeOutTarget = 5; (pGVar2->_fadeOutColor)._red = fadeColor._red; (pGVar2->_fadeOutColor)._green = fadeColor._green; (pGVar2->_fadeOutColor)._blue = fadeColor._blue; (pGVar2->_fadeOutColor)._alpha = fStack_18; (pGVar2->_fadeOutColor)._unk = 0; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08; manager = g_manager; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; } else { online_vote_send(0); } } if (*(int *)&pGVar1->_gameOver != 0) { return; } LAB_006fac27: Leaderboard::update_input(); if ((pGVar1->_leaderboard)._state == 0) { bVar4 = input_is_action_triggered(g_manager,0xe,-1,(Entity *)0x0,0); iVar6 = *(int *)&pGVar1->_roomTransition; if (iVar6 == 2) { if ((pGVar1->_roomTransition)._bossIntroBossId == 0) { return; } if (bVar4 == 0) { return; } if ((pGVar1->_roomTransition)._versusScreenSprite._animState._animData == (void *)0x0) { return; } (pGVar1->_roomTransition)._versusScreenSprite._animState._isPlaying = 0; } if (iVar6 == 0) { if (((pGVar1->_genericPrompt)._sprite._animState._animData != (void *)0x0) && ((pGVar1->_genericPrompt)._sprite._animState._isPlaying != 0)) { GenericPrompt::handle_input(); return; } if (((((pGVar1->_fadeInColor)._alpha <= 0.0) && (*(int *)&pGVar1->_stageTransition == 0)) && (*(int *)&pGVar1->_gameOver == 0)) && (((pGVar1->_onlineStatsScreen)._isActive == 0 && ((pGVar1->_leaderboard)._state == 0)))) { PauseScreen::Update(&pGVar1->_pauseScreen); bVar4 = is_single_player(&pGVar1->_pauseScreen); if (bVar4 != 0) { return; } coop_join_menu_update(); } if ((pGVar1->_pauseScreen)._state == 0) { saveData = (PersistentGameData *)(g_manager[1]._persistentGameData._achievements + 0xc); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { saveData = &g_manager->_persistentGameData; } if ((saveData->_achievements[0x281] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_10 = 0x1f; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_10,0,0); if (cVar3 != '\0') { (g_manager->_optionsConfig)._itemInfoDisplayEnabled = (g_manager->_optionsConfig)._itemInfoDisplayEnabled == 0; } } } PlayerManager::handle_coop_join(&pGVar1->_playerManager); } } return; } //@@ 006fadc0 Game::Update /* ZHL [lua] Lua binding Game:Update prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Game::Update(Game *this) { 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 = (PauseScreen *)0x0; local_1c = 0; savedThis = this; cVar6 = Console::update_state(); if (cVar6 != '\0') { ExceptionList = local_10; return; } update_trapdoor_loop_sfx(); local_34 = &this->_hud; HUD::Update(local_34); 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(), *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: KColor::SetFromARGB(&fadeColor,0xff000000); manager = g_manager; g_manager->_pendingMenuState = 2; goto LAB_006fb36f; case 2: LAB_006fafdc: KColor::SetFromARGB(&fadeColor,0xff000000); manager = g_manager; g_manager->_pendingMenuState = 3; goto LAB_006fb36f; case 3: KColor::SetFromARGB(&fadeColor,0xff000000); manager = g_manager; g_manager->_pendingMenuState = 0x13; goto LAB_006fb36f; case 4: KColor::SetFromARGB(&fadeColor,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; PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x15,-1); LAB_006fb0d4: Seeds::construct_from_copy((Seeds *)seedsCopy,&g_game->_seedEffects); Manager::RestartGame(); } else { Seeds::construct_from_copy((Seeds *)seedsCopy,&g_game->_seedEffects); Manager::RestartGame(); } break; case 6: if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_006fb16a: local_11 = '\x01'; } else { Multiplayer::get_lobby(&DAT_00c79a50,lobby); uStack_8 = 0; local_1c = 1; piVar8 = (int *)FUN_00a286f0(); uStack_8 = 1; local_24 = (PauseScreen *)0x3; local_1c = 3; cVar6 = (**(code **)(*piVar8 + 0x14))(); if ((cVar6 != '\0') && (cVar6 = FUN_0090c400(), cVar6 != '\0')) goto LAB_006fb16a; local_11 = '\0'; } pPVar9 = local_24; if (((uint)local_24 & 2) != 0) { pPVar9 = (PauseScreen *)((uint)local_24 & 0xfffffffd); local_30 = KAGE::System::UserProfileBase::vftable; } uStack_8 = 0xffffffff; if (((uint)pPVar9 & 1) != 0) { KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(lobby); } if (local_11 != '\0') { player = PlayerManager::GetPlayer(&this->_playerManager,0); iVar7 = player->_playerType; local_24 = (PauseScreen *)(g_manager->_persistentGameData)._eventCounters[0x15]; PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,0x16, -(g_manager->_persistentGameData)._eventCounters[0x16]); if (((iVar7 == 9) || (iVar7 == 0x1e)) && (local_24 != (PauseScreen *)0x0)) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x15,-1); } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { FUN_0090c560(); } goto LAB_006fb0d4; } NetplayManager::process_pending_joins(); break; case 7: NextVictoryLap(); break; case 8: Multiplayer::get_lobby(&DAT_00c79a50,lobby); uStack_8 = 2; local_1c = 4; piVar8 = (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; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(lobby); manager = g_manager; if (local_11 != '\0') { local_1c = 0; lobbyMembersBytes = (int)(g_manager->_lobbyMembers)._end - (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; *(byte *)(iVar7 + 8 + (int)pvVar1) = *(byte *)(iVar7 + 8 + (int)pvVar1) | 1; iVar7 = iVar7 + 0x14; } while (local_1c < (uint)(((int)(manager->_lobbyMembers)._end - (int)(manager->_lobbyMembers)._begin) / 0x14)); this = savedThis; } FUN_0090c560(); NetplayManager::process_pending_joins(); } break; case 10: DeathmatchManager::enter_arena(); break; case 0xb: KColor::SetFromARGB(&fadeColor,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: HUD::PostUpdate(pHVar12); LAB_006fb3bd: if (0 < this->_freezeFrames) { this->_freezeFrames = this->_freezeFrames + -1; HUD::PostUpdate(pHVar12); ExceptionList = local_10; return; } if (*(int *)&this->_gameOver != 0) { if ((this->_gameOver)._isStopSoundsPending != 0) { SFXManager::StopLoopingSounds(&g_manager->_sfxManager); (this->_gameOver)._isStopSoundsPending = 0; } pvVar1 = g_onlineVoteMap; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pPVar9 = (PauseScreen *)0x0; local_24 = *(PauseScreen **)g_onlineVoteMap; if (local_24 != g_onlineVoteMap) { pPVar13 = (PauseScreen *)0x0; do { pPVar9 = (PauseScreen *)((int)&pPVar13->_state + 1); if (*(int *)&local_24->field_0x18 != 0) { pPVar9 = pPVar13; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); pPVar13 = pPVar9; } while (local_24 != pvVar1); this = savedThis; local_24 = pPVar9; } (g_manager->_popupButtons)._buttons[1]._isVisible = pPVar9 == (PauseScreen *)0x0; } netplay_lobby_menu_update(); if (this->_revivePlayerMenu == 0) { ExceptionList = local_10; return; } this->_revivePlayerMenu = 2; *(undefined4 *)&this->field_0x24ed8 = 8; *(undefined4 *)&this->field_0x24ed0 = 0xffffffff; ExceptionList = local_10; return; } if ((this->_leaderboard)._state != 0) { Leaderboard::Update(); ExceptionList = local_10; return; } if (*(int *)&this->_stageTransition != 0) { StageTransition::Update(&this->_stageTransition); HUD::PostUpdate(pHVar12); ExceptionList = local_10; return; } if (*(int *)&this->_roomTransition != 0) { RoomTransition::Update(&this->_roomTransition); update_map_input(); HUD::PostUpdate(pHVar12); cVar6 = IsRoomTransitionActive(); if (cVar6 == '\0') { ExceptionList = local_10; return; } this->_framesSinceRoomTransition = 0; ExceptionList = local_10; return; } if ((this->_itemOverlay)._state == 0) { cVar6 = is_screen_transition_active(); if (cVar6 != '\0') { GenericPrompt::Update(genericPrompt,0); if ((this->_genericPrompt)._isOnlineVote != 0) { ExceptionList = local_10; return; } if (*(int *)&(this->_genericPrompt).field_0x12c == 1) { KColor::SetFromARGB(&fadeColor,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 == *(NetplayManager *)(g_manager + 1)) goto LAB_006fb6ae; pHVar12 = &this->_hud; } ItemOverlay::Update(&this->_itemOverlay,0); if ((this->_itemOverlay)._state == 2) { HUD::PostUpdate(pHVar12); 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 == *(NetplayManager *)(g_manager + 1)) && (local_11 == 0)) { timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); uVar2 = (timeNs & 0xffffffff) * 0xd7b634db; local_30 = (undefined **)uVar2; lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_28 = (undefined4)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar10 * 0xd7b634db; local_1c = (uint)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar10 * 0x431bde82; local_24 = (PauseScreen *)lVar5; uVar2 = lVar4 + (uVar2 >> 0x20); uVar11 = (uint)(uVar2 >> 0x20); lVar3 = lVar3 + (uVar2 & 0xffffffff); local_20 = (undefined4)lVar3; uVar10 = (uint)((ulonglong)lVar3 >> 0x20); lVar5 = lVar5 + (ulonglong)CONCAT14(CARRY4(uVar11,uVar10),uVar11 + uVar10); uVar10 = (uint)((ulonglong)lVar5 >> 0x20); uVar11 = (uint)lVar5 >> 0x12 | uVar10 * 0x4000; local_2c = (PauseScreen *) (((uVar10 >> 0x12) - *(int *)&g_manager->field_0x4ae24) - (uint)(uVar11 < *(uint *)&g_manager->field_0x4ae20)); this = savedThis; if ((local_2c == (PauseScreen *)0x0) && (manager = g_manager, uVar11 - *(int *)&g_manager->field_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 = *(int *)&this->_deathmatchManager; this->_isInstantFadeIn = 0; (this->_fadeInColor)._alpha = 0.0; if (iVar7 < 2) { Level::ShowName((Level *)this,0); entity_vector_set_flag_410(&this->_playerManager,1); manager = g_manager; } KAGE::SmartPointer::reset(&manager->field_0x4ae0c,(void *)0x0); KAGE::SmartPointer::reset(&manager->field_0x4ae14,(void *)0x0); manager = g_manager; } } LAB_006fb811: if (0.0 < (this->_fadeInColor)._alpha) { HUD::PostUpdate(local_34); ExceptionList = local_10; return; } if ((((manager->_isWindowFocused == 0) && ((manager->_optionsConfig)._enablePauseOnFocusLost != 0) ) && (manager->_netplayManager == *(NetplayManager *)(manager + 1))) && ((this->_pauseScreen)._state == 0)) { PauseScreen::Show(&this->_pauseScreen); manager = g_manager; } local_2c = &this->_pauseScreen; if ((this->_pauseScreen)._state != 0) { netplay_lobby_menu_update(); pHVar12 = this->_room; iVar7 = *(int *)(pHVar12->_playerHUD + 0x12f8); local_34 = pHVar12; std::map::destroy_subtree (pHVar12->_playerHUD + 0x12f8,pHVar12->_playerHUD + 0x12f8,*(void **)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(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 == *(NetplayManager *)(manager + 1)) && (this->_revivePlayerMenu != 0)) { coop_join_menu_update(); 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); } } 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,*(int *)&game->field_0x18900,-1,0x14,(Entity_Player *)0x0, (int)(char)game->field_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; } Room::Update(); PlayerManager::Update(playerManager); 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; } HUD::PostUpdate(&this->_hud); if ((*(int *)&this->field_0x67730 != 0) && (debugNode = *(DebugRenderer *)this->_debugRenderer, debugNode != this->_debugRenderer)) { do { iVar7 = *(int *)((int)debugNode + 0xc); if (iVar7 == 0) { nextDebugNode = *(DebugRenderer *)debugNode; **(DebugRenderer **)((int)debugNode + 4) = nextDebugNode; *(int *)(*(int *)debugNode + 4) = *(int *)((int)debugNode + 4); *(int *)&savedThis->field_0x67730 = *(int *)&savedThis->field_0x67730 + -1; std::vector::_Tidy(); std::vector::_Tidy(); FID_conflict__Tidy((int *)((int)debugNode + 0x1c)); FUN_0042f240(); operator_delete((void *)debugNode,0x40); this = savedThis; } else { if (0 < iVar7) { *(int *)((int)debugNode + 0xc) = iVar7 + -1; } nextDebugNode = *(DebugRenderer *)debugNode; } debugNode = nextDebugNode; } while (nextDebugNode != this->_debugRenderer); } FUN_008607a0(); ExceptionList = local_10; return; } //@@ 006fbc10 Game::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Game:Render prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Game::Render(Game *this) { code *pcVar1; Vector pos; char cVar2; byte bVar3; undefined4 *puVar4; uint uVar5; int iVar6; float *fadeAmountPtr; float *pixelationAmountPtr; undefined *shader; ColorMod *color; 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; undefined4 *in_XMM0_Da; float fVar8; 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 local_138; undefined4 local_134; undefined4 local_130; undefined4 local_12c; undefined4 local_128; undefined4 local_124; undefined4 local_120; undefined1 local_11c; undefined4 bloomParams; undefined4 local_114; undefined4 local_110; undefined4 local_10c; undefined4 local_108; undefined4 local_104; undefined4 local_100; undefined4 local_fc; undefined1 local_f8; undefined4 shaderParams; undefined4 local_f0; undefined4 local_ec; undefined4 local_e8; undefined4 local_e4; undefined4 local_e0; undefined4 local_dc; undefined4 local_d8; undefined1 local_d4; float local_d0; float local_cc; float local_c8; float local_c4; KColor local_c0; undefined4 quadParams; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined1 local_8c; Game *local_88; Vector local_84; char isColorModifierActive; char isRoomSnapshot; undefined4 *local_78; Color clickerColor; KColor local_48; float screenSize; float local_30; 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 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afc1d6; local_1c = ExceptionList; stackCookie = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_88 = this; puVar9 = (undefined1 *)((int)register0x00000010 + -4); if (this->_triggerWindowResize != 0) { recreate_render_targets(); this->_triggerWindowResize = 0; puVar9 = puStack_20; } puStack_20 = puVar9; Room::render_lighting(this->_room); if (*(int *)&this->_deathmatchManager == 4) { (**(code **)(*(int *)(this->_deathmatchManager)._type + 0x14))(); } game = g_game; local_78 = (undefined4 *)&DAT_00000008; std::set::find_node(); if ((*(char *)((int)local_2c.y + 0xd) != '\0') || (pvVar10 = (void *)local_2c.y, 8 < *(int *)((int)local_2c.y + 0x10))) { pvVar10 = (game->_seedEffects)._seedEffects; } if (pvVar10 != (game->_seedEffects)._seedEffects) { in_XMM0_Da = (undefined4 *)0x0; local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); puVar4 = std::deque::back(); if ((byte *)(puVar4 + 1) != (byte *)0x0) { *(byte *)(puVar4 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar4 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c79794,1); } if (0 < this->_hallucinationTimer) { in_XMM0_Da = (undefined4 *)0x0; local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); puVar4 = std::deque::back(); if ((byte *)(puVar4 + 1) != (byte *)0x0) { *(byte *)(puVar4 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar4 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c7979c,1); } fVar8 = 0.0; transitionProgress = 1.0; if ((g_manager->_optionsConfig)._enablePixelation != 0) { iVar6 = *(int *)&this->_stageTransition; if ((iVar6 == 3) || (iVar6 == 2)) { iVar7 = (this->_stageTransition)._frame; transitionDuration = (this->_stageTransition)._duration; in_XMM0_Da = (undefined4 *) ((float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) / (float)((double)transitionDuration + __uint_to_double_fixup[-(transitionDuration >> 0x1f)])); if (iVar6 == 3) { in_XMM0_Da = (undefined4 *)(1.0 - (float)in_XMM0_Da); } if (((float)in_XMM0_Da < 0.0) || (cVar2 = FUN_009301d0(), cVar2 == '\0')) goto LAB_006fbde8; } else { LAB_006fbde8: if (*(int *)&this->_roomTransition == 2) { in_XMM0_Da = (undefined4 *)(float)(this->_roomTransition)._duration; transitionProgress = (float)(this->_roomTransition)._frame / (float)in_XMM0_Da; } else { if (*(int *)&this->_roomTransition != 3) goto LAB_006fbe57; in_XMM0_Da = (undefined4 *)(float)(this->_roomTransition)._duration; transitionProgress = transitionProgress - (float)(this->_roomTransition)._frame / (float)in_XMM0_Da; } if ((transitionProgress < fVar8) || ((this->_roomTransition)._animation != 2)) goto LAB_006fbe57; } FUN_00683680(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c79758,1); } LAB_006fbe57: if ((0 < this->_bloomTimer) && ((g_manager->_optionsConfig)._enableBloom != 0)) { RenderTarget::Clear(&DAT_00c798e0); in_XMM0_Da = (undefined4 *)0x0; local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); puVar4 = std::deque::back(); if ((byte *)(puVar4 + 1) != (byte *)0x0) { *(byte *)(puVar4 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar4 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c79774,1); } room = this->_room; if ((*room == '\0') || (g_game->_frameCount - *(int *)(room + 0x11f0) != 0x1e)) { LAB_006fbf42: if (this->_isRoomSnapshotTaken != 0xff) { isRoomSnapshot = '\0'; goto LAB_006fbfa2; } } else { in_XMM0_Da = (undefined4 *)0x9; local_48._blue = 1.26117e-44; local_48._alpha = 7.00649e-45; uVar5 = *(uint *)(*(int *)(room + 4) + 0x5c); local_78 = (undefined4 *)0x19; if (uVar5 == 0) { KAGE_LogMessage(0x10,(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'; in_XMM0_Da = (undefined4 *)0x0; local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); puVar4 = std::deque::back(); if ((byte *)(puVar4 + 1) != (byte *)0x0) { *(byte *)(puVar4 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar4 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797a4,1); this->_isRoomSnapshotTaken = 1; LAB_006fbfa2: FUN_008f7420(); iVar6 = *(int *)&this->_roomTransition; if (((((iVar6 == 2) || (iVar6 == 3)) && ((this->_roomTransition)._bossIntroBossId != 0)) && (iVar6 == 2)) || ((g_manager->_optionsConfig)._enableColorModifier == 0)) { isColorModifierActive = '\0'; } else { isColorModifierActive = '\x01'; in_XMM0_Da = (undefined4 *)0x0; local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); local_78 = std::deque::back(); if ((byte *)(local_78 + 1) != (byte *)0x0) { *(byte *)(local_78 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *local_78 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797ac,1); } RenderTarget::Clear(&DAT_00c798e0); 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 ((*(int *)&this->_roomTransition == 2) || (*(int *)&this->_roomTransition == 3)) { Entity_Player::TriggerRoomExit((Entity_Player *)&this->_roomTransition); } else { Room::Render(); } LuaEngine::PostRender(); iVar6 = this->_hallucinationDuration + -0x14; if (iVar6 < 0) { iVar6 = 0; } if (((iVar6 < this->_hallucinationTimer) && (isRoomSnapshot == '\0')) && (DAT_00c797a4 != (int *)0x0)) { local_9c = 0; quadParams = 0; local_a0 = 0; local_a8 = 0; local_8c = 0; local_94 = 0x3f800000; local_a4 = 0x3f800000; local_90 = 0x3f800000; local_98 = 0x3f800000; KColor::SetFromARGB(&local_48,0xffffffff); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_00); fVar8 = sin(((float)((this->_hallucinationTimer - this->_hallucinationDuration) + 0x14) * 3.1415927) / 20.0); in_XMM0_Da = (undefined4 *)(fVar8 * 0.5); local_48._unk = 0; local_48._red = 1.0; local_48._green = 1.0; local_48._alpha = (float)in_XMM0_Da; local_48._blue = 1.0; (**(code **)(*DAT_00c797a4 + 0x14))(&quadParams); } if (isColorModifierActive != '\0') { _glfw_context_reset(); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); 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; Shader::set_uniform(shader,(byte *)"Amount",8,&(this->_currentColorModifier)._amount,(int)shader ); Shader::set_uniform(g_currentShader,(byte *)"Brightness",8, &(this->_currentColorModifier)._brightness,unused); Shader::set_uniform(g_currentShader,(byte *)"Contrast",8, &(this->_currentColorModifier)._contrast,unused_00); local_9c = 0; quadParams = 0; local_a0 = 0; local_a8 = 0; local_94 = 0x3f800000; local_a4 = 0x3f800000; local_90 = 0x3f800000; local_98 = 0x3f800000; local_8c = 0; KColor::SetFromARGB(&local_48,0xffffffff); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_01); in_XMM0_Da = (undefined4 *)(this->_currentColorModifier)._red; local_48._green = (this->_currentColorModifier)._green; local_48._unk = 0; local_48._alpha = 1.0; local_48._blue = (this->_currentColorModifier)._blue; local_48._red = (float)in_XMM0_Da; (**(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); } DebugRenderer::Render(); FUN_009c3890(); HUD::Render(&this->_hud); if (*(int *)&this->_deathmatchManager == 4) { (**(code **)(*(int *)(this->_deathmatchManager)._type + 0x18))(); } StageTransition::Render(); ItemOverlay::Render(&this->_itemOverlay); FUN_00421400(); FUN_009c3890(); if ((((this->_genericPrompt)._sprite._animState._animData != (void *)0x0) && ((this->_genericPrompt)._sprite._animState._isPlaying != 0)) && (GenericPrompt::Render(&this->_genericPrompt), (this->_genericPrompt)._isOnlineVote != 0)) { local_84.y = g_screenHeight - 55.0; local_84.x = g_screenWidth * 0.5 - 32.0; ANM2::Render(&this->_completionWidgetSprite,&local_84,&g_vectorZero,&g_vectorZero); sprintf((byte *)&local_48._green,(byte *)"%d/%d"); manager = g_manager; FUN_00a1a580(); local_14 = 0; KColor::SetFromARGB(&local_c0,0xff362f2d); local_78 = (undefined4 *)(local_84.x + 28.0); in_XMM0_Da = (undefined4 *)(local_84.y + 6.0); local_2c.y = (float)in_XMM0_Da; local_2c.x = (float)local_78; Font::DrawStringScaled (&manager->_font2_TeamMeatEx12,(byte *)&local_48._green,&local_2c,color_02,&local_a4); local_14 = 0xffffffff; if (DAT_00c79880 != 0) { FUN_0091cac0(); sprintf((byte *)&local_48._green,s__d); manager = g_manager; FUN_00a1a580(); local_14 = 1; KColor::SetFromARGB(&local_c0,0xff362f2d); in_XMM0_Da = (undefined4 *)(local_84.y + 28.0); local_2c.y = (float)in_XMM0_Da; local_2c.x = (float)local_78; Font::DrawStringScaled (&manager->_font2_TeamMeatEx12,(byte *)&local_48._green,&local_2c,color_03,&local_a4 ); local_14 = 0xffffffff; } } if ((this->_pauseScreen)._state != 0) { PauseScreen::Render(&this->_pauseScreen); } EmoteWheel::Render(&this->field_0x25108); RevivePlayerMenu::Render(); GameOver::Render(&this->_gameOver); Leaderboard::Render(); netplay_lobby_render(); FUN_009c3890(); render_mod_shaders(); if (isRoomSnapshot != '\0') { _glfw_context_reset(); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); set_blend_mode(&DAT_00c798e0,0); local_9c = 0; quadParams = 0; local_a0 = 0; local_a8 = 0; local_94 = 0x3f800000; local_a4 = 0x3f800000; local_90 = 0x3f800000; local_98 = 0x3f800000; local_8c = 0; KColor::SetFromARGB(&local_c0,0xffffffff); in_XMM0_Da = (undefined4 *)g_screenHeight; 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(); RenderTarget::Clear(&DAT_00c798e0); set_blend_mode(&DAT_00c798e0,0); shader = &DAT_00c792f8; if ((DAT_00c792fc & 1) == 0) { shader = g_currentShader; } fVar8 = (float)this->_bloomDuration * 0.5; g_currentShader = shader; fVar8 = sin((1.0 - ABS((float)this->_bloomTimer - fVar8) / fVar8) * 3.1415927 * 0.5); local_78 = (undefined4 *)(fVar8 * 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)]); Shader::set_uniform(shader,(byte *)"BloomAmount",8,&local_78,(int)DAT_00c79774); Shader::set_uniform(g_currentShader,(byte *)"Ratio",9,&local_2c,unused_01); local_108 = 0; bloomParams = 0; local_10c = 0; local_114 = 0; local_100 = 0x3f800000; local_110 = 0x3f800000; local_fc = 0x3f800000; local_104 = 0x3f800000; local_f8 = 0; KColor::SetFromARGB(&local_c0,0xffffffff); in_XMM0_Da = (undefined4 *)g_screenHeight; 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) { StageTransition::get_fade_progress(); fVar8 = 0.0; if (((0.0 <= (float)in_XMM0_Da) && (cVar2 = FUN_009301d0(), cVar2 != '\0')) || ((FUN_00832fd0(), fVar8 <= (float)in_XMM0_Da && ((this->_roomTransition)._animation == 2)))) { _glfw_context_reset(); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); FUN_00832fd0(); puVar4 = in_XMM0_Da; local_78 = in_XMM0_Da; StageTransition::get_fade_progress(); local_84.y = (float)puVar4; fadeAmountPtr = (float *)&local_78; if ((float)in_XMM0_Da <= (float)puVar4) { fadeAmountPtr = &local_84.y; } shader = &DAT_00c792a8; if ((DAT_00c792ac & 1) == 0) { shader = g_currentShader; } local_78 = (undefined4 *)0x38d1b717; local_84.y = *fadeAmountPtr * 0.3; pixelationAmountPtr = &local_84.y; if (*fadeAmountPtr * 0.3 <= 0.0001) { pixelationAmountPtr = (float *)&local_78; } local_84.y = *pixelationAmountPtr; screenSize = (float)((double)DAT_00c79758[4] + __uint_to_double_fixup[-(DAT_00c79758[4] >> 0x1f)]); local_30 = (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; Shader::set_uniform(shader,(byte *)"PixelationAmount",8,&local_84.y,(int)DAT_00c79758); Shader::set_uniform(g_currentShader,(byte *)"ScreenSize",0xb,&screenSize,unused_02); local_12c = 0; pixelationParams = 0; local_130 = 0; local_138 = 0; local_124 = 0x3f800000; local_134 = 0x3f800000; local_120 = 0x3f800000; local_128 = 0x3f800000; local_11c = 0; KColor::SetFromARGB(&local_c0,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(); RenderTarget::Clear(&DAT_00c798e0); set_blend_mode(&DAT_00c798e0,0); local_e4 = 0; shaderParams = 0; local_e8 = 0; local_f0 = 0; local_dc = 0x3f800000; local_ec = 0x3f800000; local_d8 = 0x3f800000; local_e0 = 0x3f800000; local_d4 = 0; KColor::SetFromARGB(&local_c0,0xffffffff); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_07); local_78 = (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 = (undefined4 *)(1.0 - (float)(iVar6 - iVar7) / 10.0); } else if (iVar6 < 10) { local_78 = (undefined4 *)((float)iVar6 / 10.0); } screenSize = (float)((double)DAT_00c7979c[4] + __uint_to_double_fixup[-(DAT_00c7979c[4] >> 0x1f)]); local_30 = (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; Shader::set_uniform(shader,(byte *)"Amount",8,&local_78,(int)DAT_00c7979c); Shader::set_uniform(g_currentShader,(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 ((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 = *(int *)(*(int *)this->_giantBookClickerImage + 0x14); local_c0._green = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]); } if (isFlipX) { local_c8 = 0.0; } else { iVar6 = *(int *)(*(int *)this->_giantBookClickerImage + 0x10); local_c8 = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]); } if (isFlipY) { iVar6 = *(int *)(*(int *)this->_giantBookClickerImage + 0x14); local_cc = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]); } else { local_cc = 0.0; } local_d0 = 0.0; if (isFlipX) { iVar6 = *(int *)(*(int *)this->_giantBookClickerImage + 0x10); local_d0 = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]); } shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_c0._unk._0_1_ = 1; pvVar10 = (void *)0x6fce6d; g_currentShader = shader; local_c4 = local_cc; local_c0._red = local_d0; local_c0._blue = local_c8; local_c0._alpha = local_c0._green; Color::Color(&clickerColor); KAGE::SmartPointer::operator_assign(auStack_30a + -10,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 **)(**(int **)this->_giantBookClickerImage + 0x14))(&local_d0); this = local_88; } } bVar3 = IsInTimedSet(g_game,8); iVar6 = extraout_ECX; if (bVar3 != 0) { _glfw_context_reset(); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); set_blend_mode(&DAT_00c798e0,0); local_e4 = 0; shaderParams = 0; local_e8 = 0; local_f0 = 0; local_dc = 0x3f800000; local_ec = 0x3f800000; local_d8 = 0x3f800000; local_e0 = 0x3f800000; local_d4 = 0; KColor::SetFromARGB(&local_c0,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 = (Game *)((float)g_game->_frameCount * 0.05); screenSize = (float)((double)DAT_00c79794[4] + __uint_to_double_fixup[-(DAT_00c79794[4] >> 0x1f)]); local_30 = (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; Shader::set_uniform(shader,&DAT_00b6837c,8,&local_88,(int)DAT_00c79794); Shader::set_uniform(g_currentShader,(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); } fVar8 = 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,fVar8,g_screenWidth,g_screenHeight,&this->_fadeInColor); render_color_shader_pass(overlayQuad); if (this->_isFadeInIconShown != 0) { Manager::render_loading_icon(); } } if ((((uint)this->_debugFlags >> 0xb & 1) != 0) && ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { GetPlayer(g_game,0); local_2c.x = 10.0; local_2c.y = 10.0; render_debug_player_info(); } if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (*(int *)&g_manager[1]._gamestate.field_0x220 != 0)) { desyncFont = &g_manager->_font6_PFTempestaSevenCondensed; fVar8 = sin(((float)(g_manager->_framecount % 0x1e) * 3.1415927) / 15.0); fVar8 = fVar8 * 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 = fVar8; pos.y = 10.0; pos.x = g_screenWidth * 0.5; local_48._green = fVar8; Font::DrawString(desyncFont,(byte *)"DESYNCED",pos,(Vector)0x4000000040000000,&local_48,settings ); local_14 = 0xffffffff; } render_debug_lua_memory(); Console::Render(&this->_console); ExceptionList = local_1c; return; } //@@ 006fd350 Game::IsPaused /* ZHL [exact] __thiscall bool Game::IsPaused(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Game::IsPaused(Game *this) { int iVar1; Manager *pMVar2; byte bVar3; char cVar4; int extraout_EDX; pMVar2 = g_manager; if (this->_console != (Console)0x0) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { return 1; } if (((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager & 0xfffffffcU) == 4) { return 1; } } if ((((((this->_freezeFrames < 1) && (*(int *)&this->_gameOver == 0)) && ((this->_leaderboard)._state == 0)) && ((*(int *)&this->_stageTransition == 0 && (*(int *)&this->_roomTransition == 0)))) && ((iVar1 = (this->_itemOverlay)._state, iVar1 == 0 || (iVar1 != 2)))) && ((((bVar3 = is_single_player(&this->_pauseScreen), bVar3 == 0 && (pMVar2->_state == 2)) && (cVar4 = is_screen_transition_active(), cVar4 == '\0')) && (*(char *)(extraout_EDX + 0x25954) == '\0')))) { return 0; } return 1; } //@@ 006fd3f0 Game::interpolate_update /* DB: Manager::Update odd frames: entity Interpolate (vtable +0x10) and the BeastArena half-step scroll (beast.md) */ void Game::interpolate_update(void) { int iVar1; int iVar2; Entity *pEVar3; char isConsoleBlocking; byte isPaused; void *pvVar4; uint i; float scrollStep; undefined4 flagsHigh; Game *game; int sortingLayer; int *tmpEntity; game = g_game; isConsoleBlocking = Console::update_state(); if (isConsoleBlocking == '\0') { iVar1 = *(int *)&game->_roomTransition; if (iVar1 == 0) { iVar1 = *(int *)&game->_stageTransition; if ((iVar1 != 0) && ((iVar1 == 1 || (iVar1 == 4)))) { i = 0; pvVar4 = g_game->_room; if (*(int *)((int)pvVar4 + 0x1264) != 0) { do { tmpEntity = *(int **)(*(int *)((int)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]; StageTransition::update_player_trapdoor_scale(tmpEntity,1); } else if ((tmpEntity[0x5b] & 0x1000U) != 0) { (**(code **)(*tmpEntity + 0x10))(); } i = i + 1; } while (i < *(uint *)((int)pvVar4 + 0x1264)); } } } else { iVar2 = (game->_roomTransition)._duration; if ((game->_roomTransition)._frame != iVar2) { *(float *)&(game->_roomTransition).field_0xc = 0.5 / (float)iVar2 + *(float *)&(game->_roomTransition).field_0xc; } if ((iVar1 == 1) || (iVar1 == 4)) { i = 0; pvVar4 = g_game->_room; if (*(int *)((int)pvVar4 + 0x1264) != 0) { do { tmpEntity = *(int **)(*(int *)((int)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 < *(uint *)((int)pvVar4 + 0x1264)); } } } isPaused = IsPaused(game); if ((isPaused == 0) && (((g_manager->_isWindowFocused != 0 || ((g_manager->_optionsConfig)._enablePauseOnFocusLost == 0)) || (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))))) { pvVar4 = game->_room; i = 0; if (*(int *)((int)pvVar4 + 0x1264) != 0) { do { pEVar3 = *(Entity **)(*(int *)((int)pvVar4 + 0x125c) + i * 4); iVar1 = *(int *)pEVar3; if (pEVar3->_type == 1) { flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags | 0x4000; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; (**(code **)(iVar1 + 0xc))(); Entity::PlayerCollideWithGrid(pEVar3,0); flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xffffbfff; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; } else { (**(code **)(iVar1 + 0x10))(); } i = i + 1; } while (i < *(uint *)((int)pvVar4 + 0x1264)); } if (*(char *)((int)pvVar4 + 0x7884) != '\0') { i = 0; iVar1 = *(int *)((int)pvVar4 + 0x776c); *(float *)((int)pvVar4 + 0x7888) = *(float *)((int)pvVar4 + 0x788c) * 0.5 + *(float *)((int)pvVar4 + 0x7888); if (*(int *)(iVar1 + 0x1264) != 0) { do { pEVar3 = *(Entity **)(*(int *)(iVar1 + 0x125c) + i * 4); iVar2 = pEVar3->_type; if (iVar2 == 1) { LAB_006fd6e6: flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags | 0x4000; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; Entity::PlayerCollideWithGrid(pEVar3,0); flagsHigh = *(undefined4 *)((int)&pEVar3->_flags + 4); *(uint *)&pEVar3->_flags = (uint)pEVar3->_flags & 0xffffbfff; *(undefined4 *)((int)&pEVar3->_flags + 4) = flagsHigh; } else { if (iVar2 != 3) { scrollStep = *(float *)((int)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 < *(uint *)(iVar1 + 0x1264)); } } game = g_game; i = 0; *(undefined1 *)((int)pvVar4 + 0x7220) = 1; pvVar4 = (game->_playerManager)._extraPlayers._begin; if ((int)(game->_playerManager)._extraPlayers._end - (int)pvVar4 >> 2 != 0) { do { tmpEntity = *(int **)((int)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 < (uint)((int)(g_game->_playerManager)._extraPlayers._end - (int)pvVar4 >> 2)); } } } return; } //@@ 006fd7c0 Game::StartRoomTransition /* ZHL [lua] Lua binding Game:StartRoomTransition prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Game::StartRoomTransition (Game *this,int roomIndex,int direction,int animation,Entity_Player *player,int dimension) { void *pvVar1; byte bVar2; char cVar3; uint uVar4; int iVar5; Game *extraout_EDX; Game *extraout_EDX_00; Game *pGVar6; int iVar7; Entity_Player *teleportPlayer; char *format; Capsule searchCapsule [10]; EntityList_EL capsuleHits; Vector teleportPos; Vector candidatePos; Game *game; void *local_10; undefined1 *puStack_c; Capsule local_8; Manager *manager; iVar7 = dimension; local_8 = (Capsule)0xffffffff; puStack_c = &LAB_00afc200; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(searchCapsule + 0x16); ExceptionList = &local_10; game = this; if (0xbc < roomIndex + 0x14U) { format = "Invalid room index passed to Game::StartRoomTransition()\n"; LAB_006fdbe2: KAGE_LogMessage(8,(byte *)format); ExceptionList = local_10; return; } if (0x16 < (uint)animation) { format = "Invalid animation passed to Game::StartRoomTransition()\n"; goto LAB_006fdbe2; } if (2 < dimension) { format = "Invalid dimension passed to Game::StartRoomTransition()\n"; goto LAB_006fdbe2; } if (*(int *)&this->_deathmatchManager == 4) { player = (Entity_Player *)0xbb; LAB_006fd82c: manager = g_manager; seed_fart_sound_override((int *)&player); SoundEffects::Play(&manager->_sfxManager,(int)player,1.0,2,0,1.0,0.0); ExceptionList = local_10; return; } if ((((animation == 0xc) && (this->_stage == 1)) && (bVar2 = Level::IsAltPath((Level *)this), this = extraout_EDX, bVar2 == 0)) && ((extraout_EDX->_currentRoomIdx == extraout_EDX->_startingRoomIdx && (*(char *)((int)extraout_EDX->_room + 1) != '\0')))) { bVar2 = IsGreedMode(g_game); if (bVar2 == 0) { StartStageTransition(game,0,6,0); if (player == (Entity_Player *)0x0) { ExceptionList = local_10; return; } Entity_Player::PlayExtraAnimation(player,(byte *)"TeleportUp"); player = (Entity_Player *)0xd7; goto LAB_006fd82c; } roomIndex = -2; animation = 3; this = game; LAB_006fd8f5: iVar7 = 0; dimension = 0; } else if (roomIndex == -2) goto LAB_006fd8f5; if (player == (Entity_Player *)0x0) { if (animation != 3) goto LAB_006fdb29; LAB_006fdb4d: save_rewind_state(-1); this = game; } else { if ((animation == 3) || (animation == 0xc)) { bVar2 = Room::IsBeastDungeon(g_game->_room); if (bVar2 != 0) { dimension = 0; teleportPos.x = (player->_pos).x; teleportPos.y = (player->_pos).y; pGVar6 = extraout_EDX_00; teleportPlayer = player; do { Room::GetRandomPosition(pGVar6->_room,&candidatePos,0.0); if (candidatePos.y < ((*(float *)((int)game->_room + 0x20) - 30.0) - teleportPlayer->_size) - 20.0) { Capsule::constructor (searchCapsule,&candidatePos,&g_vectorOne,0.0,teleportPlayer->_size + 40.0); EntityList::query_player_capsule_hits ((EntityList *)((int)game->_room + 0x1218),&capsuleHits,searchCapsule,10); uVar4 = 0; if (capsuleHits._size == 0) { LAB_006fda7d: teleportPos.x = candidatePos.x; teleportPos.y = candidatePos.y; EntityList_Query::~EntityList_Query(&capsuleHits); break; } while (((((iVar7 = *(int *)((int)capsuleHits._data + uVar4 * 4), *(int *)&g_game->_deathmatchManager < 2 || (iVar5 = 1, *(int *)(iVar7 + 0x28) != 1)) && (iVar5 = *(int *)(iVar7 + 0x28), 0x3dd < iVar5 - 10U)) || ((*(uint *)(iVar7 + 0x168) & 0x20000000) != 0)) && ((iVar5 != 9 || ((*(uint *)(iVar7 + 0x438) & 0x80000000) != 0))))) { uVar4 = uVar4 + 1; if ((uint)capsuleHits._size <= uVar4) { teleportPlayer = player; goto LAB_006fda7d; } } if (capsuleHits._0_1_ == '\0') { local_8 = (Capsule)0x0; tracked_alloc(1,capsuleHits._data,0); local_8 = (Capsule)0xffffffff; } teleportPlayer = player; } dimension = dimension + 1; pGVar6 = game; } while (dimension < 0x32); Entity_Player::Teleport(teleportPlayer,&teleportPos,1,1); iVar7 = teleportPlayer->_damageCooldown; if (iVar7 < 0x3c) { iVar7 = 0x3c; } teleportPlayer->_damageCooldown = iVar7; ExceptionList = local_10; return; } this = extraout_EDX_00; if (animation == 3) { pvVar1 = extraout_EDX_00->_room; iVar5 = *(int *)((int)pvVar1 + 8); if (iVar5 == 0xb) { bVar2 = *(byte *)(*(int *)((int)pvVar1 + 4) + 0x44); joined_r0x006fdafc: if ((bVar2 & 1) != 0) goto LAB_006fdb4d; } else { if (iVar5 == 0x11) { bVar2 = *(byte *)(*(int *)((int)pvVar1 + 4) + 0x44); goto joined_r0x006fdafc; } if ((iVar5 != 10) && (iVar5 != 3)) goto LAB_006fdb4d; } Player_stats_add(&extraout_EDX_00->_onlinePlayerStats,9,player,1.0); goto LAB_006fdb4d; } } LAB_006fdb29: if (animation == 0x10) goto LAB_006fdb4d; if ((this->_currentRoomIdx == this->_startingRoomIdx) && (*(char *)((int)this->_room + 1) != '\0')) { if (animation == 0xc) goto LAB_006fdb87; goto LAB_006fdb4d; } } if ((animation == 0) && (((iVar7 < 0 || (iVar7 == g_game->_currentDimensionIdx)) && (cVar3 = Level::prepare_blue_room(this->_currentRoomIdx,roomIndex,direction), cVar3 != '\0'))) ) { roomIndex = -0x10; } LAB_006fdb87: pGVar6 = game; RoomTransition::start(&game->_roomTransition,roomIndex,direction,animation,player,dimension,uVar4) ; cVar3 = IsRoomTransitionActive(); if (cVar3 != '\0') { pGVar6->_framesSinceRoomTransition = 0; } pGVar6->_isRoomRespawned = 0; ExceptionList = local_10; return; } //@@ 006fdc10 Game::StartStageTransition /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Game:StartStageTransition */ void __thiscall Game::StartStageTransition(Game *this,char param_2,uint param_3,Entity_Player *param_4) { NetplayManager unused; NetplayManager NVar1; byte bVar2; char cVar3; uint uVar4; byte *name; int iVar5; undefined4 uVar6; uint forcedCurses; uint preventedCurses; Entity_Player *player; undefined4 *playerIt; void *pvVar7; PlayerManager *playerManager; int *piVar8; int *piVar9; undefined1 *size; Game *game; uint uVar10; int iVar11; longlong 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; uVar4 = __security_cookie ^ (uint)(aiStack_24 + 8); ExceptionList = &local_10; local_14 = uVar4; if (6 < param_3) { KAGE_LogMessage(8,(byte *)"Invalid animation passed to 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; uStack_38._4_4_ = 2.8026e-45; unused = g_manager->_netplayManager; NVar1 = *(NetplayManager *)(g_manager + 1); iVar5 = 0; if (unused != NVar1) { iVar5 = 2; } *(int *)&g_game->field_0x1d658 = iVar5; if (unused != NVar1) { if (*(int *)&game->field_0x1d890 == 0) goto LAB_006fdcc2; uVar10 = *(uint *)&game->field_0x1d890; } else { if (*(int *)&game->field_0x1d888 == 0) { LAB_006fdcc2: name = leaderboard_name_format (leaderboardName,(game->_dailyChallenge)._id,(int)unused,iVar5); local_8 = 0; if (0xf < *(uint *)(name + 0x14)) { name = *(byte **)name; } leaderboard_find_async(name,0,FUN_0085ae10,userData); local_8 = 0xffffffff; if (&DAT_0000000f < local_18) { size = local_18 + 1; pvVar7 = leaderboardName[0]; if ((undefined1 *)0xfff < size) { pvVar7 = *(void **)((int)leaderboardName[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)leaderboardName[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,(uint)size); } aiStack_24[2] = 0; local_18 = &DAT_0000000f; leaderboardName[0] = (void *)((uint)leaderboardName[0] & 0xffffff00); goto LAB_006fdd5c; } uVar10 = *(uint *)&game->field_0x1d888; } iVar5 = KAGE::System::LeaderboardManager::get_result(uVar10); FUN_0085ae10(iVar5,userData,uVar4); } LAB_006fdd5c: if (param_3 != 5) { save_rewind_state(-1); } KAGE_LogMessage(1,(byte *)"[Frame %d] Starting stage transition (transition type: %d) \n"); uVar4 = *(uint *)((int)&this->_gameStateFlags + 4) & 0x10000; if (param_2 == '\0') { uStack_38._4_4_ = (float)this->_stage; if (uVar4 == 0) { uVar6 = 0; } else { uVar6 = CONCAT31((int3)(uVar4 >> 8),1); } FUN_009e5a30(uStack_38._4_4_,this->_stageType,this->_timeCounter,uVar6); uVar4 = g_game->_debugCurses; uVar10 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (forcedCurses | uVar4 | uVar10) & 2) != 0) { bVar2 = GetStateFlag(this,0x30); FUN_009e5a30((int)uStack_38._4_4_ + 1,this->_stageType,this->_timeCounter,bVar2); } } else { iStack_3c = this->_stage; uStack_38._4_4_ = (float)CONCAT31(uStack_38._5_3_,uVar4 != 0); piVar9 = *(int **)&this->field_0x26728; uStack_38._0_4_ = (float)this->_stageType; if (piVar9 == *(int **)&this->field_0x2672c) { std::vector<12byte>::_Emplace_reallocate(piVar9,&iStack_3c); } else { *piVar9 = iStack_3c; piVar9[1] = (int)(float)uStack_38; piVar9[2] = (int)uStack_38._4_4_; *(int *)&this->field_0x26728 = *(int *)&this->field_0x26728 + 0xc; } } pvVar7 = (this->_playerManager)._playerList._begin; playerIdx = 0; if ((int)(this->_playerManager)._playerList._end - (int)pvVar7 >> 2 != 0) { do { iVar5 = *(int *)((int)pvVar7 + playerIdx * 4); iVar11 = *(int *)(iVar5 + 0x1e68); if ((((iVar11 == 0) || (*(int *)(iVar11 + 0x161c) == -1)) || ((*(int *)(iVar5 + 0x161c) <= *(int *)(iVar11 + 0x161c) || (iVar11 == iVar5)))) && (*(int *)&g_game->_deathmatchManager < 2)) { netUserId = player_get_net_user_id(iVar5); uStack_38._4_4_ = (float)((ulonglong)netUserId >> 0x20); if (((netUserId != -1) && (*(int *)&g_game->_deathmatchManager < 2)) && (this->field_0x1c030 == '\0')) { cVar3 = FUN_00425a70(netUserId); if (cVar3 == '\0') { online_stats_add_user((int)netUserId,uStack_38._4_4_); } iVar5 = FUN_00426560((int)netUserId,uStack_38._4_4_); if (iVar5 != 0) { *(float *)(iVar5 + 0xc) = *(float *)(iVar5 + 0xc) + 1.0; } } } pvVar7 = (this->_playerManager)._playerList._begin; playerIdx = playerIdx + 1; } while (playerIdx < (uint)((int)(this->_playerManager)._playerList._end - (int)pvVar7 >> 2)); } game = g_game; if (param_4 == (Entity_Player *)0x0) { param_4 = GetPlayer(g_game,0); } playerManager = &g_game->_playerManager; (game->_playerManager)._stageTransitionPlayer = param_4; *(undefined4 *)&this->_stageTransition = 1; (this->_stageTransition)._frame = 0; this->field_0x1ba84 = param_2; *(uint *)&this->field_0x1ba88 = param_3; player = PlayerManager::FirstCollectibleOwner(playerManager,0x236,(RNG **)playerManager,1); game = g_game; (this->_stageTransition)._duration = 0x32; this->field_0x1ba8c = player != (Entity_Player *)0x0; playerIt = (game->_playerManager)._playerList._begin; *(float *)&this->field_0x1ba90 = g_vectorZero.x; *(float *)&this->field_0x1ba94 = g_vectorZero.y; if (playerIt != (game->_playerManager)._playerList._end) { do { player = (Entity_Player *)*playerIt; if ((player != (Entity_Player *)0x0) && (player->_variant == 0)) { (player->_velocity).x = g_vectorZero.x; (player->_velocity).y = g_vectorZero.y; uStack_38._0_4_ = (player->_velocity).x * 0.1; uStack_38._4_4_ = (player->_velocity).y * 0.1; player->_isControlsEnabled = 0; Entity_Player::ThrowHeldEntity(player,(Vector *)&uStack_38); game = g_game; } playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); } iVar5 = game->_stage; if (((0 < iVar5) && (iVar5 < 7)) && ((game->_gameStateFlags & 0x1000000000000) != 0)) { if ((game->_stageType == 4) || (game->_stageType == 5)) { iVar5 = iVar5 + 1; } if (iVar5 != 1) { (this->_stageTransition)._duration = 8; goto LAB_006fe0c8; } } if (param_3 == 5) { iVar5 = (this->_stageTransition)._duration; this->field_0x1ba8c = 0; (this->_stageTransition)._frame = iVar5; *(undefined4 *)&this->_stageTransition = 2; Room::on_leave(game->_room); Level::SetStage((Level *)g_game,g_game->_stage,4); } LAB_006fe0c8: this->_isRoomRespawned = 0; Room::on_leave(this->_room); pvVar7 = (this->_playerManager)._playerList._end; piVar9 = (this->_playerManager)._playerList._begin; playerIdx = 0; if ((int)pvVar7 - (int)piVar9 >> 2 != 0) { do { uVar4 = playerIdx; if ((int)pvVar7 - (int)piVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (this->_playerManager)._playerList._end; } playerIt = (this->_playerManager)._playerList._begin; if (uVar4 < (uint)((int)pvVar7 - (int)playerIt >> 2)) { playerIt = playerIt + uVar4; } Entity_Player::room_exit((Entity_Player *)*playerIt,0); while( true ) { pvVar7 = (this->_playerManager)._playerList._end; piVar9 = (this->_playerManager)._playerList._begin; if ((int)pvVar7 - (int)piVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (this->_playerManager)._playerList._end; piVar9 = (this->_playerManager)._playerList._begin; } uVar10 = (int)pvVar7 - (int)piVar9 >> 2; piVar8 = piVar9 + uVar4; if (uVar10 <= uVar4) { piVar8 = piVar9; } iVar5 = *piVar8; pvVar7 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar7 & 0xfffffffcU) < 0x1d5) { iVar11 = 0; } else { iVar11 = *(int *)((int)pvVar7 + 0x1d4); } if (*(char *)(iVar5 + 0x1519) != '\0') break; piVar8 = *(int **)(iVar5 + 0x150c); while( true ) { if (piVar8 == *(int **)(iVar5 + 0x1510)) goto LAB_006fe1cd; if (*piVar8 == iVar11) break; piVar8 = piVar8 + 4; } pvVar7 = (this->_playerManager)._playerList._end; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (this->_playerManager)._playerList._end; } uVar4 = playerIdx; piVar9 = (this->_playerManager)._playerList._begin; if (playerIdx < (uint)((int)pvVar7 - (int)piVar9 >> 2)) { piVar9 = piVar9 + playerIdx; } pvVar7 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar7 & 0xfffffffcU) < 0x1d5) { aiStack_24[0] = 0; } else { aiStack_24[0] = *(int *)((int)pvVar7 + 0x1d4); } aiStack_24[1] = 0; aiStack_24[2] = *(undefined4 *)(aiStack_24[0] + 0x78); local_18 = (undefined1 *)0x0; TemporaryEffects::RemoveEffect((TemporaryEffects *)(*piVar9 + 0x1508),aiStack_24,1); } LAB_006fe1cd: pvVar7 = (this->_playerManager)._playerList._end; playerIdx = playerIdx + 1; } while (playerIdx < uVar10); } uStack_38._4_4_ = 2.24208e-44; std::set::find_node(aiStack_24 + 1,(int)&uStack_38 + 4); if (((local_18[0xd] == '\0') && (*(int *)(local_18 + 0x10) < 0x11)) && (local_18 != (this->_seedEffects)._seedEffects)) { this->_stageNameNumeral = this->_stageNameNumeral + 1; } ExceptionList = local_10; return; } //@@ 006fe2f0 Game::ChangeRoom /* ZHL [lua] Lua binding Game:ChangeRoom */ void Game::ChangeRoom(int param_1,int param_2) { void *pvVar1; int iVar2; Level *in_ECX; undefined4 *puVar3; uint uVar4; uVar4 = 0; iVar2 = in_ECX[1]._roomList[0x4c].DecorationSeed; puVar3 = (undefined4 *)in_ECX[1]._roomList[0x4c].PitsCount; if (iVar2 - (int)puVar3 >> 2 != 0) { do { if (iVar2 - (int)puVar3 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); iVar2 = in_ECX[1]._roomList[0x4c].DecorationSeed; puVar3 = (undefined4 *)in_ECX[1]._roomList[0x4c].PitsCount; } if (uVar4 < (uint)(iVar2 - (int)puVar3 >> 2)) { puVar3 = puVar3 + uVar4; } Entity_Player::room_exit((Entity_Player *)*puVar3,0); iVar2 = in_ECX[1]._roomList[0x4c].DecorationSeed; uVar4 = uVar4 + 1; puVar3 = (undefined4 *)in_ECX[1]._roomList[0x4c].PitsCount; } while (uVar4 < (uint)(iVar2 - (int)puVar3 >> 2)); } Level::ChangeRoom(in_ECX,param_1,param_2); Room::Update(); pvVar1 = g_game->_room; Random(); iVar2 = ItemPool::get_pool_from_room_entities(*(undefined4 *)((int)pvVar1 + 0x1bb0)); in_ECX[1]._roomList[0x3a]._doors[4] = iVar2; if (iVar2 == -1) { in_ECX[1]._roomList[0x3a]._doors[4] = 0; } return; } //@@ 006fe3d0 Game::MoveToRandomRoom /* ZHL [exact] __thiscall void Game::MoveToRandomRoom(bool iAmErrorRoom, int Seed, Entity_Player* player); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Game::MoveToRandomRoom(Game *this,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 = Level::GetRandomRoomIndex((Level *)this,iAmErrorRoom,Seed); StartRoomTransition(this,roomIndex,direction,animation,player,dimension); return; } //@@ 006fe410 Game::SpawnEx /* DB: Game::Spawn (lua) is a thunk passing all args plus trailing 0 flag prototype: db/protos.zhl, confirmed by RET 32 */ Entity * __thiscall Game::SpawnEx(Game *this,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; void *pvVar11; uint unaff_EBX; uint uVar12; uint uVar13; int unaff_ESI; void **ppvVar14; PlayerManager *playerManager; uint uVar15; bool bVar16; float fVar17; float fVar18; ulonglong timeNs; byte addEnemyKillScore; Entity *pEStack_64; uint local_60; uint local_58; Entity *local_54; uint local_50; void **ppvStack_4c; Game *local_48; EntityRef sourceRef; int nextIndex; Entity *spawnerEntity; EntityPtr *spawnerSlot; spawnerEntity = spawner; local_54 = (Entity *)type; local_48 = this; lua_callback_run_pre_entity_spawn ((int *)&local_54,(int *)&variant,position,velocity,spawner,(int *)&subType,&seed); pEVar8 = local_54; type = (uint)local_54; if (1 < *(int *)&g_game->_deathmatchManager) { ItemPool::ReplaceBlacklistedPickup((g_game->_deathmatchManager)._type,&type,&variant,&subType); } if (((spawnerEntity == (Entity *)0x0) || ((spawnerEntity->_flags & 0x20000000) == 0)) || (pEVar8 != (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; } } uVar15 = local_60; local_54 = EntityFactory::Create(this->_entityFactory,(uint)pEVar8,(byte)flags & 1); if (local_54 == (Entity *)0x0) { return (Entity *)0x0; } timeNs = GetTimeNs(); entity = local_54; spawnerEntity = spawner; local_50 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; sourceRef._variant = (int)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)local_50 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)((ulonglong)lVar4 >> 0x20); lVar3 = (ulonglong)local_50 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4(uVar12,(uint)(&((EntityPtr *)sourceRef._variant)->field_0x0 + CARRY4((uint)lVar3,(uint)lVar4))), &((EntityPtr *)sourceRef._variant)->field_0x0 + CARRY4((uint)lVar3,(uint)lVar4) + uVar12); sourceRef._spawnerType = (int)((ulonglong)lVar3 >> 0x20); local_58 = (uint)lVar3 >> 0x12 | sourceRef._spawnerType * 0x4000; sourceRef._spawnerType = (uint)sourceRef._spawnerType >> 0x12; if (spawner == (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 = (int)spawnerSlot; std::multiset::erase(&sourceRef._variant); } *spawnerSlot = (EntityPtr)spawnerEntity; if (spawnerEntity != (Entity *)0x0) { std::multiset::insert(spawnerSlot); } (entity->_pos).x = position->x; (entity->_pos).y = position->y; (entity->_velocity).x = velocity->x; (entity->_velocity).y = velocity->y; (**(code **)(*(int *)entity + 4))(pEVar8,local_60,subType,seed); iVar7 = *(int *)(local_58 + 0x18300); nextIndex = *(int *)(iVar7 + 0x1214); *(int *)(iVar7 + 0x1214) = nextIndex + 1; entity->_index = nextIndex; EntityList::AddEntity((EntityList *)(iVar7 + 0x1218),entity); if ((spawnerEntity != (Entity *)0x0) && (bVar5 = Entity::IsActiveEnemy(spawnerEntity,1), bVar5 != 0)) { if ((spawnerEntity->_flags & 0x1000000000000000) == 0) { bVar5 = Entity::HasEntityFlags(spawnerEntity,0x20000000); if (bVar5 != 0) { addEnemyKillScore = 0; bVar5 = 0; iVar7 = -1; ref = EntityRef::EntityRef(&sourceRef); Entity::AddCharmed(entity,ref,iVar7,bVar5,addEnemyKillScore); } } else { uVar12 = *(uint *)((int)&entity->_flags + 4); uVar1 = (undefined4)entity->_flags; *(undefined4 *)&entity->_flags = uVar1; *(uint *)((int)&entity->_flags + 4) = uVar12 | 0x10000000; if ((unaff_ESI != 9) && (unaff_ESI != 7)) { *(undefined4 *)&entity->_flags = uVar1; *(uint *)((int)&entity->_flags + 4) = uVar12 | 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: uVar12 = 0; } else { sourceRef._type = *(int *)((int)sourceRef._entity + 0x28); sourceRef._position.x = *(float *)((int)sourceRef._entity + 0x33c); sourceRef._position.y = *(float *)((int)sourceRef._entity + 0x340); sourceRef._variant = *(int *)((int)sourceRef._entity + 0x2c); sourceRef._spawnerType = *(uint *)((int)sourceRef._entity + 0x34); sourceRef._spawnerVariant = *(int *)((int)sourceRef._entity + 0x38); sourceRef._velocity.x = *(float *)((int)sourceRef._entity + 0x360); sourceRef._velocity.y = *(float *)((int)sourceRef._entity + 0x364); if ((*(uint *)((int)sourceRef._entity + 0x168) & 0x100) == 0) goto LAB_006fe765; sourceRef._flags = 1; LAB_006fe771: if ((*(uint *)((int)sourceRef._entity + 0x168) & 0x20000000) == 0) goto LAB_006fe793; local_60 = 2; LAB_006fe79f: if ((*(uint *)((int)sourceRef._entity + 0x16c) & 0x400000) == 0) goto LAB_006fe7b8; uVar12 = 4; } sourceRef._flags = uVar12 | local_60 | sourceRef._flags; Entity::AddCharmed(entity,&sourceRef,-1,0,0); if (unaff_ESI - 10U < 0x3de) { ANM2::LoadDeliriumForm(&entity->_sprite,unaff_ESI,uVar15,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 != (Entity *)0x0)) { bVar5 = Entity::HasEntityFlags(pEVar8,1); if (bVar5 == 0) { bVar5 = Entity::HasEntityFlags(spawnerEntity,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; Entity::AddBrimstoneMark(pEVar8,&sourceRef,0x5a); } bVar5 = Entity::HasEntityFlags(spawnerEntity,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; Entity::AddShrink(pEVar8,&sourceRef,0x5a,0,0); if (0 < pEVar8->_shrinkCountdown) { uVar1 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags | 0x1000000; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar1; pEVar8->_shrinkStatus1 = pEVar8->_shrinkStatus2; } } } fVar18 = *(float *)(iVar7 + 0xf48) * pEVar8[3]._pendingDamage; pcVar2 = *(code **)(*(int *)pEVar8 + 0x4c); pEVar8[3]._pendingDamage = fVar18; fVar18 = fVar18 * pEVar8->_shrinkStatus1; fVar17 = fVar18 * g_vectorOne.x; (pEVar8->_sprite)._scale.y = fVar18 * g_vectorOne.y; (pEVar8->_sprite)._scale.x = fVar17; pEVar8[3]._burnTickDamage = pEVar8[3]._burnTickDamage * *(float *)(iVar7 + 0xf48); pEVar8[3]._poisonTickDamage = pEVar8[3]._poisonTickDamage * *(float *)(iVar7 + 0xf44); pEVar8->_maxHitPoints = pEVar8->_maxHitPoints * *(float *)(iVar7 + 0xf44); pEVar8->_health = pEVar8->_health * *(float *)(iVar7 + 0xf44); cVar6 = (*pcVar2)(); if (cVar6 != '\0') { pvVar11 = *(void **)(iVar7 + 0xf54); ppvVar14 = &pEVar8[3]._config; if (*ppvVar14 != pvVar11) { if (*ppvVar14 != (void *)0x0) { ppvStack_4c = ppvVar14; std::multiset::erase(&ppvStack_4c); } *ppvVar14 = pvVar11; if (pvVar11 != (void *)0x0) { std::multiset::insert(ppvVar14); } } } } } bVar5 = ShouldEraseEnemy(entity); if (bVar5 != 0) { Entity::RemoveWithPoof(entity,unusedArg); } if ((entity->_exists != 0) && (*(int *)(local_58 + 0x67758) != *(int *)(local_58 + 0x6775c))) { local_54 = (Entity *)entity->_variant; piVar10 = (int *)(local_58 + 0x67780); uVar15 = entity->_type; local_58 = uVar15; std::map::find(&ppvStack_4c,&local_58); if (ppvStack_4c == (void **)*piVar10) { local_54 = (Entity *)0xffffffff; local_58 = uVar15; piVar9 = (int *)std::map::find(&ppvStack_4c,&local_58); if (*piVar9 == *piVar10) goto LAB_006feb8d; } uVar15 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar11 = (playerManager->_playerList)._end; if ((int)pvVar11 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar11 = (playerManager->_playerList)._end; } piVar10 = (playerManager->_playerList)._begin; if (uVar15 < (uint)((int)pvVar11 - (int)piVar10 >> 2)) { piVar10 = piVar10 + uVar15; } trigger_set_dispatch((void *)(*piVar10 + 0x1fc8),6,entity,position,velocity); uVar15 = uVar15 + 1; playerManager = &g_game->_playerManager; } while (uVar15 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_006feb8d: timeNs = GetTimeNs(); uVar12 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; lVar4 = (ulonglong)uVar12 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar13 = (uint)((ulonglong)lVar4 >> 0x20); uVar15 = (int)((ulonglong)lVar3 >> 0x20) + (uint)CARRY4((uint)lVar3,(uint)lVar4); lVar3 = (ulonglong)uVar12 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar13,uVar15),uVar13 + uVar15); uVar13 = (uint)((ulonglong)lVar3 >> 0x20); uVar15 = (uint)lVar3 >> 0x12 | uVar13 * 0x4000; uVar12 = uVar15 - unaff_EBX; bVar16 = CARRY4((uint)g_entitySpawnTimeMs,uVar12); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar12; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar13 >> 0x12) - (int)local_48) - (uint)(uVar15 < unaff_EBX)) + (uint)bVar16; return pEStack_64; } //@@ 006fec30 spawn_enemy_spawner_effect /* DB: ? Game::Spawn(1000, 203) at pos param_3 then stores type/variant (+0x47c/+0x480), position (+0x484), subtype/seed/etc (+0x494..+0x4a4); callers Ambush::SpawnWave, Ambush::SpawnBossrushWave, NpcHelper::gideon_spawn_wave (delayed wave spawn) */ Entity * spawn_enemy_spawner_effect (uint param_1,uint param_2,Vector *param_3,undefined4 param_4,float param_5, undefined4 param_6,int param_7,undefined4 param_8,void *param_9) { float fVar1; uint seed; Entity *pEVar2; seed = Random(); pEVar2 = Game::Spawn(g_game,1000,0xcb,param_3,&g_vectorZero,(Entity *)0x0,0,seed); pEVar2[1]._sprite._animDefaultName._size = param_1; pEVar2[1]._sprite._animDefaultName._capacity = param_2; pEVar2[1]._sprite._animState._animation = (void *)param_3->x; pEVar2[1]._sprite._animState._animData = (void *)param_3->y; pEVar2[1]._sprite._animState._layerFrames = (void *)g_vectorZero.x; fVar1 = g_vectorZero.y; pEVar2[1]._sprite._animState._animFrame = param_5; *(undefined4 *)&pEVar2[1]._sprite._animState._isPlaying = param_6; pEVar2[1]._sprite._animState._currentlyTriggeredEvents = param_7; pEVar2[1]._sprite._overlayAnimState._animation = param_9; pEVar2[1]._sprite._animState._nullLayerFrames = (void *)fVar1; pEVar2[1]._sprite._animState._previouslyTriggeredEvents = 0; return pEVar2; } //@@ 006fece0 Game::SpawnEntityDesc /* ZHL [lua] Lua binding Game:SpawnEntityDesc */ Entity_NPC * Game::SpawnEntityDesc(uint *param_1,Vector *param_2,Entity *param_3) { uint seed; Entity *pEVar1; Entity_NPC *this; undefined4 uVar2; TypeDescriptor *pTVar3; TypeDescriptor *pTVar4; undefined4 uVar5; seed = Random(); uVar5 = 0; pTVar4 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar3 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar2 = 0; pEVar1 = Spawn(g_game,*param_1,param_1[1],param_2,&g_vectorZero,param_3,param_1[2],seed); this = (Entity_NPC *)__RTDynamicCast(pEVar1,uVar2,pTVar3,pTVar4,uVar5); if (this != (Entity_NPC *)0x0) { this->_health = (float)param_1[4]; this->_maxHitPoints = (float)param_1[5]; Entity_NPC::Morph(this,*param_1,param_1[1],param_1[2],param_1[3]); } return this; } //@@ 006fed60 Game::DamageRadius /* DB: ? QueryRadius, TakeDamage players/enemies with source/flags, ApplyTearFlagEffects; Mom/Mega Fatty stomps prototype: db/protos.zhl, confirmed by RET 44 */ 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 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afc22d; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; enemyDamage = damage; EntityRef::constructor(&sourceRef,source); if ((source == (Entity *)0x0) || ((source->_type != 1 && ((source->_type != 3 || ((source->_flags & 0x100) != 0)))))) { isPlayerSource = false; if (source != (Entity *)0x0) { if ((source->_flags & 0x20000000) != 0) { isPlayerSource = false; isHitPlayers = 0; goto LAB_006fee08; } isPlayerSource = false; } LAB_006fee00: isPlayerSource = isPlayerSource; isHitPlayers = 1; if (source != (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 = *(undefined4 *)((int)&source->_flags + 4); if (((source->_flags & 0x100) == 0) && ((source->_flags & 0x20000100) == 0)) goto LAB_006fee31; } } isDamageEnemies = '\x01'; LAB_006fee3d: EntityList::QueryRadius ((EntityList *)((int)game->_room + 0x1218),&hits,position,radius,0xffffffff); local_14 = 0; local_2c = 0; if (hits._size != 0) { do { target = *(Entity_Player **)((int)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 ((((int)poisonBits->_l != 0 || *(int *)((int)&poisonBits->_l + 4) != 0) || ((int)poisonBits->_h != 0 || *(int *)((int)&poisonBits->_h + 4) != 0)) && (targetType == 1)) { isPoisonImmune = Entity_Player::HasPoisonImmunity(target); if (isPoisonImmune != 0) goto LAB_006fef6e; } if (enemyDamage < playerDamageThreshold) { playerDamage = 1.0; } else { playerDamage = 2.0; } (**(code **)(*(int *)target + 0x20))(playerDamage,damageFlags,&sourceRef,0x1e); } else if ((((1 < *(int *)&g_game->_deathmatchManager) && (targetType == 1)) || (targetType - 10U < 0x3de)) && ((isDamageEnemies != '\0' && (targetType != 1)))) { (**(code **)(*(int *)target + 0x20))(enemyDamage,damageFlags,&sourceRef,0x1e,uVar3); flags._l._4_4_ = tearFlags._l._4_4_; flags._l._0_4_ = (undefined4)tearFlags._l; flags._h._0_4_ = (undefined4)tearFlags._h; flags._h._4_4_ = tearFlags._h._4_4_; Entity_Tear::ApplyTearFlagEffects((Entity *)target,position,flags,source,3.5); } } LAB_006fef6e: local_2c = local_2c + 1; } while (local_2c < (uint)hits._size); } if (hits._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (hits._data != (void *)0x0) { uVar3 = *(uint *)((int)hits._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)hits._data + -4)); } } ExceptionList = local_1c; return; } //@@ 006fefd0 apply_tear_effects_in_rect /* DB: ? (Vector* min, Vector* max, Entity* source): EntityList::QueryRadius then Entity_Tear::ApplyTearFlagEffects on each hit with EntityRef(source), source type/flag checks; only caller NpcAI::ENTITY_NERVE_ENDING */ void apply_tear_effects_in_rect(float *param_1,float *param_2,Entity *param_3) { float fVar1; Entity *entity; int iVar2; BitSet128 flags; bool bVar3; qword qVar4; Game *pGVar5; uint uVar6; qword *pqVar7; float fVar8; undefined4 uVar9; float in_XMM3_Da; float fVar10; float fVar11; float fVar12; float in_stack_00000020; undefined4 in_stack_00000024; undefined4 in_stack_00000028; undefined4 in_stack_0000002c; undefined4 in_stack_00000030; EntityRef local_70; EntityList_EL local_48; Vector local_38; uint local_2c; float local_28; char local_22; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pGVar5 = g_game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afc25d; local_1c = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_28 = in_XMM3_Da; EntityRef::constructor(&local_70,param_3); if (param_3 == (Entity *)0x0) { LAB_006ff066: bVar3 = false; local_21 = '\x01'; if (param_3 != (Entity *)0x0) goto LAB_006ff070; LAB_006ff09f: local_22 = '\0'; } else { if ((param_3->_type == 1) || ((param_3->_type == 3 && ((param_3->_flags & 0x100) == 0)))) { bVar3 = true; local_21 = '\0'; } else { if ((param_3 == (Entity *)0x0) || ((param_3->_flags & 0x20000000) == 0)) goto LAB_006ff066; bVar3 = false; local_21 = '\0'; } LAB_006ff070: if (!bVar3) { if (((param_3->_flags & 0x100) == 0) && ((param_3->_flags & 0x20000100) == 0)) goto LAB_006ff09f; } local_22 = '\x01'; } fVar11 = param_2[1] - param_1[1]; fVar12 = *param_2 - *param_1; local_38.y = (param_2[1] + param_1[1]) * 0.5; local_38.x = (*param_2 + *param_1) * 0.5; fVar11 = sqrtf(fVar11 * fVar11 + fVar12 * fVar12); EntityList::QueryRadius ((EntityList *)((int)pGVar5->_room + 0x1218),&local_48,&local_38,fVar11 * 0.5,0xffffffff ); local_14 = 0; local_2c = 0; if (local_48._size != 0) { do { entity = *(Entity **)((int)local_48._data + local_2c * 4); fVar11 = (entity->_pos).x; fVar12 = *param_2; fVar1 = (entity->_pos).y; fVar8 = fVar11; if (fVar11 <= *param_1) { fVar8 = *param_1; } fVar10 = fVar1; if (fVar1 <= param_1[1]) { fVar10 = param_1[1]; } if (fVar12 <= fVar8) { fVar8 = fVar12; } if (fVar12 <= fVar10) { fVar10 = fVar12; } if (((fVar8 == fVar11) && (fVar10 == fVar1)) && (entity->_entityCollisionClass != 0)) { iVar2 = entity->_type; if (((iVar2 == 1) || (iVar2 == 3)) && (local_21 != '\0')) { if (local_28 < in_stack_00000020) { uVar9 = 0x3f800000; } else { uVar9 = 0x40000000; } (**(code **)(*(int *)entity + 0x20))(uVar9,0,0,&local_70,0x1e); } else if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar2 == 1)) || (iVar2 - 10U < 0x3de)) && (local_22 != '\0')) { (**(code **)(*(int *)entity + 0x20))(local_28,0,0,&local_70,0x1e,uVar6); flags._l._4_4_ = in_stack_00000028; flags._l._0_4_ = in_stack_00000024; flags._h._0_4_ = in_stack_0000002c; flags._h._4_4_ = in_stack_00000030; Entity_Tear::ApplyTearFlagEffects(entity,&local_38,flags,param_3,3.5); } } local_2c = local_2c + 1; } while (local_2c < (uint)local_48._size); } if (local_48._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } if (local_48._data != (void *)0x0) { uVar6 = *(uint *)((int)local_48._data + -4); qVar4 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar6; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar4 < uVar6); free((void *)((int)local_48._data + -4)); } } ExceptionList = local_1c; return; } //@@ 006ff2a0 Game::BombDamage /* ZHL [lua] Lua binding Game:BombDamage prototype: REPENTOGON, confirmed by RET 48 */ void __thiscall Game::BombDamage(Game *this,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 *pVVar7; float fVar8; Entity **clampedValue; GridEntity *pGVar9; Entity_Player *player; GridEntity *pit; int gridX; int *piVar10; Vector *player; byte bVar11; Entity *pEVar12; float fVar13; Room *pRVar14; float fVar15; float fVar16; double dVar17; undefined1 auStackY_1f4 [128]; BitSet128 local_140; BitSet128 local_130; BitSet128 local_120; BitSet128 local_110; BitSet128 local_100; BitSet128 local_f0; 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 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afc2b9; local_1c = ExceptionList; ExceptionList = &local_1c; savedGame = this; puVar1 = (undefined1 *)((int)register0x00000010 + -4); if (source == (Entity *)0x0) { LAB_006ff2fb: puStack_20 = puVar1; iVar5 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3f); if (iVar5 == 2) { radius = radius * 0.75; } else { puVar1 = puStack_20; if (iVar5 < 3) goto LAB_006ff333; radius = radius * 0.5; } } else { puVar1 = (undefined1 *)((int)register0x00000010 + -4); if (source->_type != 1) { pEVar4 = Entity::GetPlayerAncestor(source); puVar1 = puStack_20; if (pEVar4 == (Entity *)0x0) goto LAB_006ff2fb; } LAB_006ff333: puStack_20 = puVar1; } effectiveRadius = radius; if (damage < 166.0) { fVar8 = damage; maskedFlags = BitSet128::operator_and(&local_78,&tearFlags,(BitSet128 *)&DAT_00c34590); if ((((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) || (fVar8 < 125.0)) goto LAB_006ff38e; } uVar6 = Random(); ShakeScreen(this,uVar6 % 7 + 7); LAB_006ff38e: if (((source == (Entity *)0x0) || (source->_type != 1)) || (isPlayerSource = 1, damageSource != 0) ) { isPlayerSource = 0; } EntityList::QueryRadius ((EntityList *)((int)this->_room + 0x1218),&nearby,pos,effectiveRadius,0xffffffff); local_14 = 0; local_40 = (GridEntity *)0x0; if (nearby._size != 0) { do { pEVar4 = *(Entity **)((int)nearby._data + (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 == (Entity *)0x0 || ((iVar5 != 0x112 || (source->_type != 0x112)))) || (g_game->_challenge == 0x17)))) { local_38 = (Entity *)(effectiveRadius + pEVar4->_size); local_30 = (Room *)((pEVar4->_pos).x - pos->x); local_24 = (pEVar4->_pos).y - pos->y; local_3c = (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 = Room::CheckLine(g_game->_room,pos,&local_50,2,0,1,0,(Vector *)0x0); if (bVar2 == 0) goto LAB_006ffd46; } if ((source != (Entity *)0x0) && (source->_type == 4)) { iVar5 = __RTDynamicCast(); tearFlags._l._0_4_ = (uint)tearFlags._l | *(uint *)(iVar5 + 0x438); tearFlags._l._4_4_ = tearFlags._l._4_4_ | *(uint *)(iVar5 + 0x43c); tearFlags._h._0_4_ = (uint)tearFlags._h | *(uint *)(iVar5 + 0x440); tearFlags._h._4_4_ = tearFlags._h._4_4_ | *(uint *)(iVar5 + 0x444); } if ((0.0 < (float)local_3c) && (pEVar4->_type != 1000)) { iVar5 = __RTDynamicCast(); if (((pEVar4->_flags & 0x4000000) == 0) && ((pEVar4->_type != 1 || ((((iVar5 == 0 || (*(float *)(iVar5 + 0x37c) != 1000.0)) && ((source == (Entity *)0x0 || ((source->_flags & 0x20000000) == 0)))) && (isPlayerSource == 0)))))) { fVar8 = pEVar4->_mass; local_38 = (Entity *)((float)local_38 - (float)local_3c); local_34 = (Entity *)0x41700000; clampedValue = &local_34; if ((float)local_38 <= 15.0) { clampedValue = &local_38; } pEVar12 = *clampedValue; if (fVar8 <= 20.0) { if (fVar8 <= 30.0) { if (fVar8 <= 50.0) { if (150.0 < fVar8) { pEVar12 = (Entity *)((float)pEVar12 * 0.005); } } else { pEVar12 = (Entity *)((float)pEVar12 * 0.015); } } else { pEVar12 = (Entity *)((float)pEVar12 * 0.2); } } else { pEVar12 = (Entity *)((float)pEVar12 * 0.5); } fVar8 = 0.5; piVar10 = local_3c; maskedFlags = BitSet128::operator_and(&local_f0,&tearFlags,(BitSet128 *)&DAT_00c34ae0); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { iVar5 = pEVar4->_type; LAB_006ff827: fVar16 = (pEVar4->_velocity).x; fVar13 = ((float)local_30 / (float)piVar10) * (float)pEVar12; fVar15 = (local_24 / (float)piVar10) * (float)pEVar12; if (iVar5 != 1) goto LAB_006ff6ce; local_34 = (Entity *)0x41200000; local_30 = (Room *)(fVar13 + fVar16 * fVar8); local_24 = fVar15 + (pEVar4->_velocity).y * fVar8; local_38 = (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) { fVar15 = local_24; pRVar14 = local_30; } else { fVar15 = local_24 * ((float)*clampedValue / (float)local_38); pRVar14 = (Room *)((float)local_30 * ((float)*clampedValue / (float)local_38)); } } else { iVar5 = 1; if (pEVar4->_type == 1) goto LAB_006ff827; fVar16 = (pEVar4->_velocity).x; fVar13 = ((float)local_30 / (float)piVar10) * ((float)pEVar12 + (float)pEVar12); fVar15 = (local_24 / (float)piVar10) * ((float)pEVar12 + (float)pEVar12); LAB_006ff6ce: fVar15 = fVar15 + (pEVar4->_velocity).y * fVar8; pRVar14 = (Room *)(fVar13 + fVar16 * fVar8); } (pEVar4->_velocity).y = fVar15; (pEVar4->_velocity).x = (float)pRVar14; } } iVar5 = pEVar4->_type; if ((iVar5 == 1) || (iVar5 == 3)) { if (0.0 < damage) { fVar8 = damage; EntityRef::constructor(&playerDamageSource,source); playerDamageSource._flags = playerDamageSource._flags | (uint)isPlayerSource * 2; if (fVar8 < 85.0) { local_24 = 1.0; } else { local_24 = 2.0; } if ((damageFlags & 0x10000000) != 0) { local_24 = 1.0; } if (1 < *(int *)&g_game->_deathmatchManager) { local_24 = fVar8 * 0.2; } if (pEVar4->_type == 1) { player = (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 = Entity_Player::is_evil_charm_immune(player,source_00); if (bVar2 != 0) goto LAB_006ffd46; } (**(code **)(*(int *)pEVar4 + 0x20))(); } } 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 = (Entity *)Random(); room = g_game->_room; pVVar7 = Room::GetCenterPos(&local_68); gridX = (int)((pVVar7->x - 40.0) / 40.0 + 0.5); iVar5 = (int)((pVVar7->y - 120.0) / 40.0 + 0.5); if (((gridX < 0) || (gridWidth = *(int *)((int)room + 0xc), gridWidth <= gridX)) || ((iVar5 < 0 || (*(int *)((int)room + 0x10) <= iVar5)))) { local_24 = -NAN; LAB_006ff8e1: fVar8 = local_24; KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } else { fVar8 = (float)(iVar5 * gridWidth + gridX); local_24 = fVar8; if (((int)fVar8 < 0) || (0x1bf < (int)fVar8)) goto LAB_006ff8e1; } if ((uint)fVar8 < 0x1c0) { uVar6 = Room::GetGridCollision(local_30,(int)fVar8); if ((int)uVar6 < 1) { pGVar9 = operator_new(0x154); local_14._0_1_ = 0x12; local_90.y = (float)pGVar9; if (pGVar9 == (GridEntity *)0x0) { pGVar9 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar9); *(undefined ***)pGVar9 = IsaacRepentancePlus::GridEntity_Stairs::vftable; } local_14 = (uint)local_14._1_3_ << 8; if (pGVar9 != (GridEntity *)0x0) { (pGVar9->_desc)._type = 0x12; goto LAB_006ffa6f; } } } } else { bVar2 = Level::CanSpawnTrapDoor((Level *)g_game); if (bVar2 != 0) { local_30 = g_game->_room; local_34 = (Entity *)Random(); room = g_game->_room; pVVar7 = Room::GetCenterPos((Vector *)&local_78._h); gridX = (int)((pVVar7->x - 40.0) / 40.0 + 0.5); iVar5 = (int)((pVVar7->y - 120.0) / 40.0 + 0.5); if ((((gridX < 0) || (gridWidth = *(int *)((int)room + 0xc), gridWidth <= gridX)) || (iVar5 < 0)) || (*(int *)((int)room + 0x10) <= iVar5)) { local_24 = -NAN; LAB_006ff9ff: fVar8 = local_24; KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } else { fVar8 = (float)(iVar5 * gridWidth + gridX); local_24 = fVar8; if (((int)fVar8 < 0) || (0x1bf < (int)fVar8)) goto LAB_006ff9ff; } if ((uint)fVar8 < 0x1c0) { uVar6 = Room::GetGridCollision(local_30,(int)fVar8); if (0 < (int)uVar6) goto LAB_006ffaab; pGVar9 = operator_new(0x158); local_14._0_1_ = 0x28; local_58.y = (float)pGVar9; if (pGVar9 == (GridEntity *)0x0) { pGVar9 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar9); *(undefined ***)pGVar9 = IsaacRepentancePlus::GridEntity_TrapDoor::vftable; *(undefined4 *)(pGVar9 + 1) = 0; } local_14 = (uint)local_14._1_3_ << 8; if (pGVar9 == (GridEntity *)0x0) goto LAB_006ffaab; (pGVar9->_desc)._type = 0x11; LAB_006ffa6f: pGVar9->_gridIndex = (int)local_24; if (local_30->_gridEntities[(int)local_24] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_30->_gridEntities[(int)local_24])(); } local_30->_gridEntities[(int)local_24] = pGVar9; (pGVar9->_desc)._variant = 0; (pGVar9->_desc)._varData = 0; GridEntity::Init(pGVar9,(uint)local_34); } } } LAB_006ffaab: pEVar4->_subtype = 1000; } else { LAB_006ffac3: local_3c = (int *)damage; fVar8 = damage; maskedFlags = BitSet128::operator_and(&local_100,&tearFlags,(BitSet128 *)&DAT_00c34590); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { bVar2 = 0; local_38 = (Entity *) (((int)(pEVar4->_damageEvents)._end - (int)(pEVar4->_damageEvents)._begin) / 0x38); if (local_38 != (Entity *)0x0) { piVar10 = (int *)((int)(pEVar4->_damageEvents)._begin + 0x34); pEVar4 = local_38; bVar11 = bVar2; do { pEVar12 = (Entity *)*piVar10; piVar10 = piVar10 + 0xe; bVar2 = bVar11 + 1; if (pEVar12 != source) { bVar2 = bVar11; } pEVar4 = (Entity *)((int)&pEVar4[-1]._luaBridgeRef + 3); bVar11 = bVar2; } while (pEVar4 != (Entity *)0x0); pEVar4 = local_28; } iVar5 = 1 << (bVar2 & 0x1f); local_3c = (int *)(fVar8 / (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)])); } maskedFlags = BitSet128::__bnot(&g_tearFlagExplosive,&local_110); iVar5 = 0x6ffb82; maskedFlags = BitSet128::operator_and(&local_120,&tearFlags,maskedFlags); get_tear_flags_from_player (&damageFlags,(int)(auStackY_1f4 + 0x90),*maskedFlags,iVar5,source); takeDamageFn = *(code **)(*(int *)pEVar4 + 0x20); EntityRef::constructor(&sourceRef,source); (*takeDamageFn)(); if ((((!((uint)tearFlags._l == 0 && tearFlags._l._4_4_ == 0)) || (!((uint)tearFlags._h == 0 && tearFlags._h._4_4_ == 0))) && (source != (Entity *)0x0) ) && ((source->_spawnerType < 10 || (999 < source->_spawnerType)))) { bVar2 = Entity::IsVulnerableEnemy(pEVar4,(Entity *)0x0); if (bVar2 != 0) { maskedFlags = BitSet128::__bnot(&g_tearFlagExplosive,&local_130); maskedFlags = BitSet128::operator_and(&local_140,&tearFlags,maskedFlags); Entity_Tear::ApplyTearFlagEffects(pEVar4,pos,*maskedFlags,source,3.5); } } } } LAB_006ffd46: local_40 = (GridEntity *)((int)local_40 + 1); } while (local_40 < (uint)nearby._size); } FUN_005cbe20(); local_14 = CONCAT31(local_14._1_3_,0x2f); local_28 = (Entity *)((effectiveRadius * 8.0) / 40.0); dVar17 = ceil((double)(float)local_28); local_28 = (Entity *)(float)dVar17; pGVar9 = (GridEntity *)(int)dVar17; local_38 = (Entity *)(6.2831855 / (float)(int)pGVar9); local_24 = 0.0; local_40 = pGVar9; local_28 = (Entity *)Room::GetGridIndex(g_game->_room,pos); if (-1 < (int)local_28) { std::set::insert(); } if (0 < (int)pGVar9) { do { local_50.x = cos(local_24); local_50.y = sin(local_24); pEVar4 = (Entity *)0x0; if (0.0 < effectiveRadius) { do { local_34 = (Entity *)((float)pEVar4 + 20.0); if (effectiveRadius <= (float)pEVar4 + 20.0) { local_34 = (Entity *)effectiveRadius; } local_28 = local_34; pVVar7 = Vector::__mul(&local_50,(Vector *)&local_78._h,(float *)&local_28); Vector::__add(pos,&local_58,pVVar7); pGVar9 = Room::GetGridEntityFromPos(g_game->_room,&local_58); if (pGVar9 != (GridEntity *)0x0) { local_28 = (Entity *)pGVar9->_gridIndex; std::set::insert(); if ((pGVar9->_desc)._type == 3) break; } pEVar4 = local_34; } while ((float)local_34 < effectiveRadius); pGVar9 = local_40; } pGVar9 = (GridEntity *)((int)&pGVar9[-1]._sprite._bitflags + 3); local_24 = local_24 + (float)local_38; local_40 = pGVar9; } while (pGVar9 != (GridEntity *)0x0); } local_3c = (int *)*hitGridSet; if (local_3c != hitGridSet) { do { piVar10 = local_3c; Room::GetGridPosition(g_game->_room,&local_58,local_3c[4]); bVar2 = Room::CheckLine(savedGame->_room,pos,&local_58,2,0,0,0,(Vector *)0x0); if (bVar2 != 0) { uVar6 = piVar10[4]; local_28 = (Entity *)Room::GetGridCollision(savedGame->_room,uVar6); if (uVar6 < 0x1c0) { pGVar9 = *(GridEntity **)((int)savedGame->_room + uVar6 * 4 + 0x24); local_40 = pGVar9; if ((pGVar9 == (GridEntity *)0x0) || ((pGVar9->_desc)._type != 0xb)) goto LAB_006fff72; cVar3 = FUN_00711fd0(); if (cVar3 == '\0') goto LAB_006fff72; } else { local_40 = (GridEntity *)0x0; LAB_006fff72: pRVar14 = savedGame->_room; EntityRef::constructor(&sourceRef,source); cVar3 = Room::DestroyGridWithSource(pRVar14); if (cVar3 == '\0') goto LAB_0070001a; pGVar9 = local_40; } if (local_28 == (Entity *)0x3) { pVVar7 = Vector::__sub(&local_58,(Vector *)&local_78._h,pos); Vector::ToCardinal(&local_50,pVVar7); local_28 = (Entity *)0x42200000; pVVar7 = Vector::__mul(player,&local_68,(float *)&local_28); pVVar7 = Vector::__add(&local_58,&local_90,pVVar7); iVar5 = Room::GetGridIndex(g_game->_room,pVVar7); if (-1 < iVar5) { if (iVar5 < 0x1c0) { pit = savedGame->_room->_gridEntities[iVar5]; } else { pit = (GridEntity *)0x0; } Room::TryMakeBridge(savedGame->_room,pit,pGVar9); } } } LAB_0070001a: std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_3c); } while (local_3c != hitGridSet); } FUN_00424420(); EntityList_Query::~EntityList_Query(&nearby); ExceptionList = local_1c; return; } //@@ 00700060 Game::BombExplosionEffects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Game::BombExplosionEffects(Vector* pos, float damage, BitSet128 tearFlags, ColorMod* Color, Entity* source, float radiusMult, bool lineCheck, uint64_t damageFlags, bool damageSource); prototype: REPENTOGON, confirmed by RET 52 */ void __thiscall Game::BombExplosionEffects (Game *this,Vector *pos,float damage,BitSet128 tearFlags,ColorMod *Color,Entity *source, float radiusMult,byte lineCheck,ulonglong damageFlags,byte damageSource) { uint *puVar1; undefined4 uVar2; BitSet128 tearFlags_00; qword qVar3; uint uVar4; Entity *pEVar5; int iVar6; Entity *spawnedEffect; Vector **colorWord; KColor *whiteWord; undefined4 unaff_EDI; Game *game; bool bVar7; float fVar8; int *piVar9; float ringRadiusMult; Vector VStack_104; Entity *pEStack_fc; Vector *pVStack_f8; EntityPtr *pEStack_f4; Vector VStack_f0; Entity *pEStack_e8; Vector *pVStack_e4; Game *pGStack_e0; float fStack_dc; float fStack_d8; ColorMod *pCStack_d4; KColor white; undefined4 poisonColor; undefined4 uStack_a8; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; uint uStack_14; ColorMod *explosionColor; uStack_14 = __security_cookie ^ (uint)&ringRadiusMult; pVStack_e4 = pos; pCStack_d4 = Color; pEStack_e8 = source; pEStack_fc = (Entity *)0x42960000; if (damage < 175.0) { if (140.0 < damage) { pEStack_fc = (Entity *)0x42b40000; } } else { pEStack_fc = (Entity *)0x42d20000; } pGStack_e0 = this; if (source != (Entity *)0x0) { pEStack_f4 = (EntityPtr *)(tearFlags._h._4_4_ & DAT_00c347dc); if ((((uint)tearFlags._l & DAT_00c347d0) != 0 || (tearFlags._l._4_4_ & DAT_00c347d4) != 0) || (((uint)tearFlags._h & DAT_00c347d8) != 0 || pEStack_f4 != (EntityPtr *)0x0)) { pEStack_fc = (Entity *)0x43020000; uVar4 = Random(); VStack_104.y = (float)SpawnEx(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0, uVar4,0); iVar6 = *(int *)VStack_104.y; ((Entity *)((int)VStack_104.y + 0x40c))->_pendingDamage = (float)FUN_007008b0; *(undefined4 *)&((Entity *)((int)VStack_104.y + 0x40c))->_pendingDamageFlags = 2; *(undefined4 *)((int)&((Entity *)((int)VStack_104.y + 0x40c))->_pendingDamageFlags + 4) = 3; (((Entity *)VStack_104.y)->_pos).x = pos->x; (((Entity *)VStack_104.y)->_pos).y = pos->y; (**(code **)(iVar6 + 0x40))(damage * 0.33); ((Entity *)((int)VStack_104.y + 0x40c))->_collisionIndex = (int)damageFlags; *(float *)((((Entity *)((int)VStack_104.y + 0x40c))->_sprite)._animDefaultName._buf + 0xc) = radiusMult * 130.0; ((Entity *)((int)VStack_104.y + 0x40c))->_type = damageFlags._4_4_; if (lineCheck != 0) { uVar2 = *(undefined4 *)((int)((int)VStack_104.y + 0x168) + 4); *(uint *)((int)VStack_104.y + 0x168) = (uint)*(qword *)((int)VStack_104.y + 0x168) | 0x400000; *(undefined4 *)((int)((int)VStack_104.y + 0x168) + 4) = uVar2; } VStack_f0.x = (float)((int)VStack_104.y + 0x3bc); if (*(EntityPtr *)VStack_f0.x != (EntityPtr)0x0) { pEStack_f4 = (EntityPtr *)VStack_f0.x; std::multiset::erase(&pEStack_f4); } *(Entity **)VStack_f0.x = source; std::multiset::insert(VStack_f0.x); if (damageSource != 0) { qVar3 = *(qword *)((int)VStack_104.y + 0x168); puVar1 = (uint *)((int)((int)VStack_104.y + 0x168) + 4); *puVar1 = *puVar1 | 0x400; *(int *)((int)VStack_104.y + 0x168) = (int)qVar3; } } } VStack_104.y = (float)(tearFlags._h._4_4_ & DAT_00c3459c); pEStack_f4 = (EntityPtr *)0x3f400000; if ((((uint)tearFlags._l & DAT_00c34590) != 0 || (tearFlags._l._4_4_ & DAT_00c34594) != 0) || (((uint)tearFlags._h & DAT_00c34598) != 0 || VStack_104.y != 0.0)) { damage = damage * 0.75; } VStack_f0.x = ((float)pEStack_fc / 75.0) * radiusMult; if ((source == (Entity *)0x0) || ((source->_type != 1 && (pEVar5 = Entity::GetPlayerAncestor(source), pEVar5 == (Entity *)0x0))) ) { iVar6 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3f); if (iVar6 == 2) { VStack_f0.x = VStack_f0.x * 0.75; } else if (2 < iVar6) { VStack_f0.x = VStack_f0.x * 0.5; } } pEStack_fc = (Entity *)((float)pEStack_fc * radiusMult); BombDamage(pGStack_e0,pos,damage,(float)pEStack_fc,lineCheck,source,tearFlags,damageFlags, damageSource); spawn_bomb_crater(pGStack_e0,pos,(Entity *)0x0,VStack_f0.x); uVar4 = Random(); VStack_104.y = (float)SpawnEx(g_game,1000,1,pos,&g_vectorZero,source,0,uVar4,0); explosionColor = pCStack_d4; piVar9 = (int *)0x1; (**(code **)(*(int *)VStack_104.y + 0x3c))(pCStack_d4,0xffffffff,0xff,0); VStack_f0.x = (float)((uint)tearFlags._h & (uint)g_tearFlagPoison._h); if ((!(((uint)tearFlags._l & (uint)g_tearFlagPoison._l) == 0 && (tearFlags._l._4_4_ & g_tearFlagPoison._l._4_4_) == 0)) || (!(VStack_f0.x == 0.0 && (tearFlags._h._4_4_ & g_tearFlagPoison._h._4_4_) == 0))) { pVStack_e4 = (Vector *)explosionColor->_tint[0]; pGStack_e0 = (Game *)explosionColor->_tint[1]; fStack_dc = explosionColor->_tint[2]; fStack_d8 = explosionColor->_tint[3]; pCStack_d4 = (ColorMod *)0x0; KColor::SetFromARGB(&white,0xffffffff); colorWord = &pVStack_e4; uVar4 = 0xc; whiteWord = &white; do { if (*colorWord != (Vector *)whiteWord->_red) goto LAB_00700468; colorWord = colorWord + 1; whiteWord = (KColor *)&whiteWord->_green; bVar7 = 3 < uVar4; uVar4 = uVar4 - 4; } while (bVar7); uStack_9c = 0; uStack_98 = 0; uStack_94 = 0; uStack_90 = 0; uStack_8c = 0; uStack_88 = 0; uStack_84 = 0; poisonColor = 0x3ecccccd; uStack_a8 = 0x3f7851ec; uStack_a4 = 0x3f000000; uStack_a0 = 0x3f800000; (**(code **)(*piVar9 + 0x3c))(&poisonColor,0xffffffff,0xff,0,1); } LAB_00700468: pEVar5 = pEStack_fc; if ((((uint)tearFlags._l & DAT_00c34560) != 0 || (tearFlags._l._4_4_ & DAT_00c34564) != 0) || (((uint)tearFlags._h & DAT_00c34568) != 0 || (tearFlags._h._4_4_ & DAT_00c3456c) != 0)) { uStack_60 = 0; uStack_70 = 0; uStack_6c = 0; uStack_68 = 0; uStack_64 = 0; uStack_80 = 0x3ee2e2e4; uStack_7c = 0x3e949495; uStack_78 = 0x3d888889; uStack_74 = 0x3f800000; uStack_5c = 0; uStack_58 = 0; (**(code **)(*piVar9 + 0x3c))(&uStack_80,0xffffffff,0xff,0,1); } fVar8 = VStack_104.x * g_vectorOne.x; piVar9[0x3a] = (int)(VStack_104.x * g_vectorOne.y); piVar9[0x39] = (int)fVar8; if (((pEVar5 == (Entity *)0x0) || (pEVar5->_type != 4)) || (pEVar5->_variant != 0xf)) { if ((((uint)tearFlags._l & DAT_00c347d0) != 0 || (tearFlags._l._4_4_ & DAT_00c347d4) != 0) || (((uint)tearFlags._h & DAT_00c347d8) != 0 || (tearFlags._h._4_4_ & DAT_00c347dc) != 0)) { fVar8 = radiusMult * g_vectorOne.x; piVar9[0x3a] = (int)(radiusMult * g_vectorOne.y + radiusMult * g_vectorOne.y); piVar9[0x39] = (int)(fVar8 + fVar8); } } else { uStack_34 = 0; uStack_44 = 0; uStack_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_30 = 0; uStack_2c = 0; uStack_54 = 0x3f800000; uStack_50 = 0; uStack_4c = 0; uStack_48 = 0x3f800000; (**(code **)(*piVar9 + 0x3c))(&uStack_54,0xffffffff,0xff,0,1); } if ((((g_game->_dailyChallenge)._specialDailyId == 0xc) && (pEVar5 != (Entity *)0x0)) && ((pEVar5->_type == 4 && (pEVar5[1].field_0x3c != '\0')))) { uVar4 = Random(); spawnedEffect = SpawnEx(g_game,1000,0x68,pVStack_f8,&g_vectorZero,(Entity *)0x0,1,uVar4,0); spawnedEffect->_dead = 1; (**(code **)(*(int *)spawnedEffect + 0xc))(); } if ((((uint)tearFlags._l & DAT_00c34590) != 0 || (tearFlags._l._4_4_ & DAT_00c34594) != 0) || (((uint)tearFlags._h & DAT_00c34598) != 0 || (tearFlags._h._4_4_ & DAT_00c3459c) != 0)) { pVStack_e4 = (Vector *) (~(DAT_00c34620 | DAT_00c34990 | DAT_00c34b90 | DAT_00c34560 | DAT_00c34590) & (uint)tearFlags._l); pGStack_e0 = (Game *)(~(DAT_00c34624 | DAT_00c34994 | DAT_00c34b94 | DAT_00c34564 | DAT_00c34594 ) & tearFlags._l._4_4_); fStack_dc = (float)(~(DAT_00c34628 | DAT_00c34998 | DAT_00c34b98 | DAT_00c34568 | DAT_00c34598) & (uint)tearFlags._h); fStack_d8 = (float)(~(DAT_00c3462c | DAT_00c3499c | DAT_00c34b9c | DAT_00c3456c | DAT_00c3459c) & tearFlags._h._4_4_); if ((1 < *(int *)&g_game->_deathmatchManager) && (iVar6 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 4))(), iVar6 == 3)) { ringRadiusMult = 0.45; } iVar6 = 1; game = g_game; do { uVar4 = 0; fVar8 = (float)iVar6; do { VStack_f0.x = radiusMult * *(float *)((int)&DAT_00c5d01c + uVar4) * fVar8 + pVStack_f8->x; VStack_f0.y = radiusMult * *(float *)((int)&DAT_00c5d020 + uVar4) * fVar8 + pVStack_f8->y; Room::GetClampedPositionImpl(game->_room,&VStack_104,&VStack_f0,0.0,0.0,0.0,0.0); if ((VStack_104.x == VStack_f0.x) && (VStack_104.y == VStack_f0.y)) { tearFlags_00._l._4_4_ = pGStack_e0; tearFlags_00._l._0_4_ = pVStack_e4; tearFlags_00._h._0_4_ = fStack_dc; tearFlags_00._h._4_4_ = fStack_d8; BombExplosionEffects (game,&VStack_f0,damage,tearFlags_00,(ColorMod *)pEStack_e8,pEStack_fc, ringRadiusMult * radiusMult,1,4,0); game = g_game; } uVar4 = uVar4 + 8; } while (uVar4 < 0x20); iVar6 = iVar6 + 1; } while (iVar6 < 3); pEVar5 = pEStack_fc; } BombTearflagEffects(pVStack_f8,unaff_EDI,(uint)tearFlags._l,tearFlags._l._4_4_,(uint)tearFlags._h, tearFlags._h._4_4_,pEVar5,radiusMult); FUN_008207a0(); return; } //@@ 00700061 Game::BombExplosionEffects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: spurious split: 00700060 is PUSH EBP and 00700061 Game::BombExplosionEffects EBP,ESP of the same function body (BombDamage/BombTearflagEffects callees); not a separate function prototype: REPENTOGON, confirmed by RET 52 */ void __thiscall Game::BombExplosionEffects (Game *this,Vector *pos,float damage,BitSet128 tearFlags,ColorMod *Color,Entity *source, float radiusMult,byte lineCheck,ulonglong damageFlags,byte damageSource) { uint *puVar1; undefined4 uVar2; BitSet128 BVar3; BitSet128 tearFlags_00; qword qVar4; uint uVar5; Entity *pEVar6; int iVar7; Entity *spawnedEffect; float *pfVar8; KColor *pKVar9; undefined4 unaff_EDI; Game *game; bool bVar10; float fVar11; undefined3 in_stack_00000029; undefined3 in_stack_00000035; byte in_stack_00000038; int *piVar12; float fStack_f8; Vector VStack_f4; Entity *local_ec; Vector *pVStack_e8; EntityPtr *local_e4; Vector VStack_e0; ColorMod *local_d8; float local_d4; Game *local_d0; void *pvStack_cc; void *pvStack_c8; Entity *local_c4; KColor whiteColor; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; uint local_4; BVar3 = tearFlags; local_4 = __security_cookie ^ (uint)&fStack_f8; local_d4 = damage; local_c4 = source; local_d8 = (ColorMod *)radiusMult; local_ec = (Entity *)0x42960000; if ((float)tearFlags._l < 175.0) { if (140.0 < (float)tearFlags._l) { local_ec = (Entity *)0x42b40000; } } else { local_ec = (Entity *)0x42d20000; } local_d0 = this; if (radiusMult != 0.0) { local_e4 = (EntityPtr *)((uint)Color & DAT_00c347dc); if (((tearFlags._l._4_4_ & DAT_00c347d0) != 0 || ((uint)tearFlags._h & DAT_00c347d4) != 0) || ((tearFlags._h._4_4_ & DAT_00c347d8) != 0 || local_e4 != (EntityPtr *)0x0)) { local_ec = (Entity *)0x43020000; uVar5 = Random(); VStack_f4.y = (float)SpawnEx(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0, uVar5,0); iVar7 = *(int *)VStack_f4.y; ((Entity *)((int)VStack_f4.y + 0x40c))->_pendingDamage = (float)FUN_007008b0; *(undefined4 *)&((Entity *)((int)VStack_f4.y + 0x40c))->_pendingDamageFlags = 2; *(undefined4 *)((int)&((Entity *)((int)VStack_f4.y + 0x40c))->_pendingDamageFlags + 4) = 3; (((Entity *)VStack_f4.y)->_pos).x = *(float *)damage; (((Entity *)VStack_f4.y)->_pos).y = *(float *)((int)damage + 4); (**(code **)(iVar7 + 0x40))((float)tearFlags._l * 0.33); ((Entity *)((int)VStack_f4.y + 0x40c))->_collisionIndex = damageFlags._4_4_; *(float *)((((Entity *)((int)VStack_f4.y + 0x40c))->_sprite)._animDefaultName._buf + 0xc) = _lineCheck * 130.0; ((Entity *)((int)VStack_f4.y + 0x40c))->_type = _damageSource; if ((byte)damageFlags != 0) { uVar2 = *(undefined4 *)((int)((int)VStack_f4.y + 0x168) + 4); *(uint *)((int)VStack_f4.y + 0x168) = (uint)*(qword *)((int)VStack_f4.y + 0x168) | 0x400000; *(undefined4 *)((int)((int)VStack_f4.y + 0x168) + 4) = uVar2; } VStack_e0.x = (float)((int)VStack_f4.y + 0x3bc); if (*(EntityPtr *)VStack_e0.x != (EntityPtr)0x0) { local_e4 = (EntityPtr *)VStack_e0.x; std::multiset::erase(&local_e4); } *(float *)VStack_e0.x = radiusMult; std::multiset::insert(VStack_e0.x); if (in_stack_00000038 != 0) { qVar4 = *(qword *)((int)VStack_f4.y + 0x168); puVar1 = (uint *)((int)((int)VStack_f4.y + 0x168) + 4); *puVar1 = *puVar1 | 0x400; *(int *)((int)VStack_f4.y + 0x168) = (int)qVar4; } } } VStack_f4.y = (float)((uint)Color & DAT_00c3459c); local_e4 = (EntityPtr *)0x3f400000; if (((tearFlags._l._4_4_ & DAT_00c34590) != 0 || ((uint)tearFlags._h & DAT_00c34594) != 0) || ((tearFlags._h._4_4_ & DAT_00c34598) != 0 || VStack_f4.y != 0.0)) { tearFlags._l._0_4_ = (float)tearFlags._l * 0.75; } VStack_e0.x = ((float)local_ec / 75.0) * _lineCheck; if ((radiusMult == 0.0) || ((*(int *)((int)radiusMult + 0x28) != 1 && (pEVar6 = Entity::GetPlayerAncestor((Entity *)radiusMult), pEVar6 == (Entity *)0x0)))) { iVar7 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3f); if (iVar7 == 2) { VStack_e0.x = VStack_e0.x * 0.75; } else if (2 < iVar7) { VStack_e0.x = VStack_e0.x * 0.5; } } local_ec = (Entity *)((float)local_ec * _lineCheck); tearFlags_00._h._4_4_ = Color; tearFlags_00._0_12_ = BVar3._4_12_; BombDamage(local_d0,(Vector *)damage,(float)tearFlags._l,(float)local_ec,(byte)damageFlags, (Entity *)radiusMult,tearFlags_00,CONCAT44(_damageSource,damageFlags._4_4_), in_stack_00000038); spawn_bomb_crater(local_d0,(Vector *)damage,(Entity *)0x0,VStack_e0.x); uVar5 = Random(); VStack_f4.y = (float)SpawnEx(g_game,1000,1,(Vector *)damage,&g_vectorZero,(Entity *)radiusMult,0, uVar5,0); pEVar6 = local_c4; piVar12 = (int *)0x1; (**(code **)(*(int *)VStack_f4.y + 0x3c))(local_c4,0xffffffff,0xff,0); VStack_e0.x = (float)(tearFlags._h._4_4_ & (uint)g_tearFlagPoison._h); if ((!((tearFlags._l._4_4_ & (uint)g_tearFlagPoison._l) == 0 && ((uint)tearFlags._h & g_tearFlagPoison._l._4_4_) == 0)) || (!(VStack_e0.x == 0.0 && ((uint)Color & g_tearFlagPoison._h._4_4_) == 0))) { local_d4 = *(float *)pEVar6; local_d0 = *(Game **)&pEVar6->field_0x4; pvStack_cc = (pEVar6->_damageEvents)._begin; pvStack_c8 = (pEVar6->_damageEvents)._end; local_c4 = (Entity *)0x0; KColor::SetFromARGB(&whiteColor,0xffffffff); pfVar8 = &local_d4; uVar5 = 0xc; pKVar9 = &whiteColor; do { if (*pfVar8 != pKVar9->_red) goto LAB_00700468; pfVar8 = pfVar8 + 1; pKVar9 = (KColor *)&pKVar9->_green; bVar10 = 3 < uVar5; uVar5 = uVar5 - 4; } while (bVar10); uStack_8c = 0; uStack_88 = 0; uStack_84 = 0; uStack_80 = 0; uStack_7c = 0; uStack_78 = 0; uStack_74 = 0; uStack_9c = 0x3ecccccd; uStack_98 = 0x3f7851ec; uStack_94 = 0x3f000000; uStack_90 = 0x3f800000; (**(code **)(*piVar12 + 0x3c))(&uStack_9c,0xffffffff,0xff,0,1); } LAB_00700468: pEVar6 = local_ec; if (((tearFlags._l._4_4_ & DAT_00c34560) != 0 || ((uint)tearFlags._h & DAT_00c34564) != 0) || ((tearFlags._h._4_4_ & DAT_00c34568) != 0 || ((uint)Color & DAT_00c3456c) != 0)) { uStack_50 = 0; uStack_60 = 0; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; uStack_70 = 0x3ee2e2e4; uStack_6c = 0x3e949495; uStack_68 = 0x3d888889; uStack_64 = 0x3f800000; uStack_4c = 0; uStack_48 = 0; (**(code **)(*piVar12 + 0x3c))(&uStack_70,0xffffffff,0xff,0,1); } fVar11 = VStack_f4.x * g_vectorOne.x; piVar12[0x3a] = (int)(VStack_f4.x * g_vectorOne.y); piVar12[0x39] = (int)fVar11; if (((pEVar6 == (Entity *)0x0) || (pEVar6->_type != 4)) || (pEVar6->_variant != 0xf)) { if (((tearFlags._l._4_4_ & DAT_00c347d0) != 0 || ((uint)tearFlags._h & DAT_00c347d4) != 0) || ((tearFlags._h._4_4_ & DAT_00c347d8) != 0 || ((uint)Color & DAT_00c347dc) != 0)) { fVar11 = _lineCheck * g_vectorOne.x; piVar12[0x3a] = (int)(_lineCheck * g_vectorOne.y + _lineCheck * g_vectorOne.y); piVar12[0x39] = (int)(fVar11 + fVar11); } } else { uStack_24 = 0; uStack_34 = 0; uStack_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_20 = 0; uStack_1c = 0; uStack_44 = 0x3f800000; uStack_40 = 0; uStack_3c = 0; uStack_38 = 0x3f800000; (**(code **)(*piVar12 + 0x3c))(&uStack_44,0xffffffff,0xff,0,1); } if ((((g_game->_dailyChallenge)._specialDailyId == 0xc) && (pEVar6 != (Entity *)0x0)) && ((pEVar6->_type == 4 && (pEVar6[1].field_0x3c != '\0')))) { uVar5 = Random(); spawnedEffect = SpawnEx(g_game,1000,0x68,pVStack_e8,&g_vectorZero,(Entity *)0x0,1,uVar5,0); spawnedEffect->_dead = 1; (**(code **)(*(int *)spawnedEffect + 0xc))(); } if (((tearFlags._l._4_4_ & DAT_00c34590) != 0 || ((uint)tearFlags._h & DAT_00c34594) != 0) || ((tearFlags._h._4_4_ & DAT_00c34598) != 0 || ((uint)Color & DAT_00c3459c) != 0)) { local_d4 = (float)(~(DAT_00c34620 | DAT_00c34990 | DAT_00c34b90 | DAT_00c34560 | DAT_00c34590) & tearFlags._l._4_4_); local_d0 = (Game *)(~(DAT_00c34624 | DAT_00c34994 | DAT_00c34b94 | DAT_00c34564 | DAT_00c34594) & (uint)tearFlags._h); pvStack_cc = (void *)(~(DAT_00c34628 | DAT_00c34998 | DAT_00c34b98 | DAT_00c34568 | DAT_00c34598 ) & tearFlags._h._4_4_); pvStack_c8 = (void *)(~(DAT_00c3462c | DAT_00c3499c | DAT_00c34b9c | DAT_00c3456c | DAT_00c3459c ) & (uint)Color); if ((1 < *(int *)&g_game->_deathmatchManager) && (iVar7 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 4))(), iVar7 == 3)) { fStack_f8 = 0.45; } iVar7 = 1; game = g_game; do { uVar5 = 0; fVar11 = (float)iVar7; do { VStack_e0.x = _lineCheck * *(float *)((int)&DAT_00c5d01c + uVar5) * fVar11 + pVStack_e8->x; VStack_e0.y = _lineCheck * *(float *)((int)&DAT_00c5d020 + uVar5) * fVar11 + pVStack_e8->y; Room::GetClampedPositionImpl(game->_room,&VStack_f4,&VStack_e0,0.0,0.0,0.0,0.0); if ((VStack_f4.x == VStack_e0.x) && (VStack_f4.y == VStack_e0.y)) { BVar3._l._4_4_ = local_d0; BVar3._l._0_4_ = local_d4; BVar3._h._0_4_ = pvStack_cc; BVar3._h._4_4_ = pvStack_c8; BombExplosionEffects (game,&VStack_e0,(float)tearFlags._l,BVar3,local_d8,local_ec, fStack_f8 * _lineCheck,1,4,0); game = g_game; } uVar5 = uVar5 + 8; } while (uVar5 < 0x20); iVar7 = iVar7 + 1; } while (iVar7 < 3); pEVar6 = local_ec; } BombTearflagEffects(pVStack_e8,unaff_EDI,tearFlags._l._4_4_,(uint)tearFlags._h,tearFlags._h._4_4_, Color,pEVar6,_lineCheck); FUN_008207a0(); return; } //@@ 007008b0 FUN_007008b0 void FUN_007008b0(int *param_1) { BitSet128 tearFlags; int iVar1; int iVar2; Vector local_20; undefined8 uStack_18; if (param_1[0xef] == 0) { (**(code **)(*param_1 + 0x28))(); return; } uStack_18 = 0; if (param_1[10] == 4) { local_20.x = (float)param_1[0x10e]; local_20.y = (float)param_1[0x10f]; iVar1 = param_1[0x110]; iVar2 = param_1[0x111]; } else { local_20.x = 0.0; local_20.y = 0.0; uStack_18._0_4_ = 0; uStack_18._4_4_ = 0; iVar1 = (int)uStack_18; iVar2 = uStack_18._4_4_; } tearFlags._l._4_4_ = local_20.y; tearFlags._l._0_4_ = local_20.x; tearFlags._h._0_4_ = iVar1; tearFlags._h._4_4_ = iVar2; local_20 = *(Vector *)(param_1 + 0xcf); Game::BombDamage(g_game,&local_20,(float)param_1[0xe2],(float)param_1[0x11e], (param_1[0x5a] & 0x400000U) != 0,(Entity *)param_1[0xef],tearFlags, *(ulonglong *)(param_1 + 0x10c),(param_1[0x5b] & 0x400U) != 0); return; } //@@ 007009a0 Game::BombTearflagEffects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding Game:BombTearflagEffects */ void Game::BombTearflagEffects (Vector *param_1,float param_2,uint param_3,uint param_4,uint param_5,uint param_6, EntityPtr param_7,float param_8) { code *pcVar1; Vector velocity; Vector direction; ANM2 *pAVar2; undefined1 *puVar3; byte bVar4; uint uVar5; EntityPtr EVar6; uint uVar7; Entity_Laser *laser; Entity *pEVar8; int *piVar9; uint uVar10; EntityRef *ref; EntityPtr EVar11; Entity_Tear *tear; Game *in_ECX; float unk1; int extraout_ECX; int gridX; int iVar12; bool isPoopHealedEnemy; float fVar13; float fVar14; undefined4 uVar15; TypeDescriptor *pTVar16; TypeDescriptor *pTVar17; byte addEnemyKillScore; undefined4 uVar18; Vector local_f0; Vector rockTearPos; int centerGridX; Vector spawnPos; Vector rockTearVelocity; float ringStepY; int sideStep; int ringGridY; int ringGridX; float pitX; Vector local_b8; code *local_b0; Entity *local_ac; EntityPtr source; Vector scratchVec; Game *local_9c; Vector *position; Room *local_94; EntityPtr local_90; EntityPtr local_8c; GridEntity *local_88; Entity *local_84; EntityPtr local_80; Color color; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float local_2c; EntityPtr local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; Game *game; Vector *positionRef; Room *room; EntityPtr spawnerIter; puStack_20 = local_50 + 0x4c; uStack_14 = 0xffffffff; puStack_18 = &LAB_00afc2e0; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; position = param_1; source = param_7; local_9c = in_ECX; local_24 = uVar5; if (((param_3 & DAT_00c34560) != 0 || (param_4 & DAT_00c34564) != 0) || (puVar3 = local_50 + 0x4c, (param_5 & DAT_00c34568) != 0 || (param_6 & DAT_00c3456c) != 0)) { pEVar8 = g_game->_room; local_ac = pEVar8; EVar6 = (EntityPtr) __RTDynamicCast(param_7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0,uVar5); local_84 = (Entity *)0x0; local_8c = EVar6; if (pEVar8[4]._burnCountdown != 0) { do { pEVar8 = *(Entity **)(pEVar8[4]._midasFreezeCountdown + (int)local_84 * 4); local_80 = (EntityPtr)pEVar8->_type; if ((local_80 == (EntityPtr)0x192) || (local_80 == (EntityPtr)0x105)) { LAB_00700aa5: if (((((param_7 != (EntityPtr)0x0) && (*(int *)((int)param_7 + 0x28) == 1000)) && (*(int *)((int)param_7 + 0x2c) == 0x1f)) || ((EVar6 != (EntityPtr)0x0 && (*(char *)((int)EVar6 + 0x448) != '\0')))) || (g_game->_challenge == 0xd)) goto LAB_00700aff; fVar14 = pEVar8->_maxHitPoints; fVar13 = fVar14 * 0.25 + pEVar8->_health; if (fVar13 <= fVar14) { fVar14 = fVar13; } pEVar8->_health = fVar14; } else { if (local_80 == (EntityPtr)0xed) { isPoopHealedEnemy = pEVar8->_variant == 2; } else { isPoopHealedEnemy = local_80 == (EntityPtr)0x392; } if (isPoopHealedEnemy) goto LAB_00700aa5; LAB_00700aff: if (((1 < *(int *)&g_game->_deathmatchManager) && (local_80 == (EntityPtr)0x1)) || ((9 < (int)local_80 && ((int)local_80 < 1000)))) { if ((((pEVar8->_entityCollisionClass != 1) && (pEVar8->_entityCollisionClass != 0)) && (pEVar8->_isInvicible == 0)) && (pEVar8->_dead == 0)) { bVar4 = Entity::HasEntityFlags(pEVar8,0x10); if ((((bVar4 == 0) || (local_80 == (EntityPtr)0x322)) || (local_80 == (EntityPtr)0x362)) && ((param_7 == (EntityPtr)0x0 || (bVar4 = Entity::IsDescendantOf((Entity *)param_7,pEVar8), bVar4 == 0)))) { local_90 = *(EntityPtr *)(*(int *)pEVar8 + 0x20); if (param_7 == (EntityPtr)0x0) { local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.0; local_40 = 0.0; fStack_3c = g_vectorZero.x; fStack_38 = g_vectorZero.y; fStack_34 = g_vectorZero.x; local_30 = g_vectorZero.y; LAB_00700c46: local_80 = (EntityPtr)0x0; if (param_7 != (EntityPtr)0x0) goto LAB_00700c51; local_80 = (EntityPtr)0x0; LAB_00700c6f: uVar10 = 0; if (param_7 != (EntityPtr)0x0) goto LAB_00700c75; LAB_00700c8e: uVar7 = 0; } else { local_50._4_4_ = *(float *)((int)param_7 + 0x28); fStack_3c = *(float *)((int)param_7 + 0x33c); fStack_38 = *(float *)((int)param_7 + 0x340); fStack_48 = *(float *)((int)param_7 + 0x2c); fStack_44 = *(float *)((int)param_7 + 0x34); local_40 = *(float *)((int)param_7 + 0x38); fStack_34 = *(float *)((int)param_7 + 0x360); local_30 = *(float *)((int)param_7 + 0x364); if ((*(uint *)((int)param_7 + 0x168) & 0x100) == 0) goto LAB_00700c46; local_80 = (EntityPtr)0x1; LAB_00700c51: if ((*(uint *)((int)param_7 + 0x168) & 0x20000000) == 0) goto LAB_00700c6f; uVar10 = 2; LAB_00700c75: if ((*(uint *)((int)param_7 + 0x16c) & 0x400000) == 0) goto LAB_00700c8e; uVar7 = 4; } local_2c = (float)(uVar10 | (uint)local_80 | uVar7); local_28 = param_7; (*(code *)local_90)(param_8 * 10.0,0,0,local_50 + 4,0x1e); if (param_7 == (EntityPtr)0x0) { local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.0; local_40 = 0.0; fStack_3c = g_vectorZero.x; fStack_38 = g_vectorZero.y; fStack_34 = g_vectorZero.x; local_30 = g_vectorZero.y; LAB_00700d64: uVar10 = 0; if (param_7 != (EntityPtr)0x0) goto LAB_00700d6a; uVar10 = 0; LAB_00700d85: local_80 = (EntityPtr)0x0; if (param_7 != (EntityPtr)0x0) goto LAB_00700d90; LAB_00700da9: uVar7 = 0; } else { local_50._4_4_ = *(float *)((int)param_7 + 0x28); fStack_3c = *(float *)((int)param_7 + 0x33c); fStack_38 = *(float *)((int)param_7 + 0x340); fStack_48 = *(float *)((int)param_7 + 0x2c); fStack_44 = *(float *)((int)param_7 + 0x34); local_40 = *(float *)((int)param_7 + 0x38); fStack_34 = *(float *)((int)param_7 + 0x360); local_30 = *(float *)((int)param_7 + 0x364); if ((*(uint *)((int)param_7 + 0x168) & 0x100) == 0) goto LAB_00700d64; uVar10 = 1; LAB_00700d6a: if ((*(uint *)((int)param_7 + 0x168) & 0x20000000) == 0) goto LAB_00700d85; local_80 = (EntityPtr)0x2; LAB_00700d90: if ((*(uint *)((int)param_7 + 0x16c) & 0x400000) == 0) goto LAB_00700da9; uVar7 = 4; } local_28 = param_7; local_2c = (float)(uVar7 | uVar10 | (uint)local_80); Entity::AddConfusion(pEVar8,(EntityRef *)(local_50 + 4),0x3c,0); } EVar6 = local_8c; } } } local_84 = (Entity *)&local_84->field_0x1; pEVar8 = local_ac; } while (local_84 < (undefined1 *)local_ac[4]._burnCountdown); } local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; fStack_44 = 1.0; local_30 = 0.0; local_2c = 0.0; local_28 = (EntityPtr)0x0; local_40 = 0.0; fStack_3c = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),(ColorMod *)local_50); puVar3 = puStack_20; } puStack_20 = puVar3; if (((param_3 & DAT_00c34b90) != 0 || (param_4 & DAT_00c34b94) != 0) || ((param_5 & DAT_00c34b98) != 0 || (param_6 & DAT_00c34b9c) != 0)) { __RTDynamicCast(param_7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0,uVar5); if (param_7 == (EntityPtr)0x0) { LAB_00701398: EVar6 = (EntityPtr)0x0; local_94 = (Room *)0x3f800000; local_80 = (EntityPtr)0x0; uVar5 = Random(); local_84 = (Entity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0); } else { if (*(int *)((int)param_7 + 0x34) - 10U < 0x3de) { iVar12 = 0; local_ac = (Entity *)*(EntityPtr *)((int)param_7 + 0x3c8); do { uVar5 = Random(); local_90 = (EntityPtr)((float)iVar12 * 360.0 * 0.125 * 0.017453292); local_b8.x = cos((float)local_90); local_b8.x = local_b8.x * 10.0; local_b8.y = sin((float)local_90); local_b8.y = local_b8.y * 10.0; Spawn(g_game,9,0,position,&local_b8,local_ac,0,uVar5); iVar12 = iVar12 + 1; } while (iVar12 < 8); param_7 = source; goto LAB_007015ea; } EVar11 = *(EntityPtr *)((int)param_7 + 0x3c8); EVar6 = param_7; while (spawnerIter = EVar11, spawnerIter != (EntityPtr)0x0) { EVar6 = spawnerIter; EVar11 = *(EntityPtr *)((int)spawnerIter + 0x3c8); } local_8c = EVar6; if (*(int *)((int)EVar6 + 0x28) != 1) goto LAB_00701398; local_94 = *(Room **)((int)EVar6 + 0x1464); uVar5 = Random(); local_84 = (Entity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0); local_80 = EVar6; if (EVar6 != (EntityPtr)0x0) { bVar4 = Entity_Player::HasCollectible((Entity_Player *)EVar6,0x76,0); if ((bVar4 == 0) && (*(char *)((int)EVar6 + 0x13f2) == '\0')) { bVar4 = Entity_Player::HasCollectible((Entity_Player *)EVar6,0x72,0); if ((bVar4 == 0) && (*(char *)((int)EVar6 + 0x13f4) == '\0')) { bVar4 = Entity_Player::HasCollectible((Entity_Player *)EVar6,0x44,0); if ((((bVar4 == 0) && (*(char *)((int)EVar6 + 0x13f3) == '\0')) && (bVar4 = Entity_Player::HasCollectible((Entity_Player *)EVar6,0x18b,0), bVar4 == 0)) && (*(char *)((int)EVar6 + 0x13f9) == '\0')) { local_80 = EVar6; goto LAB_00701402; } EVar6 = local_8c; local_80 = (EntityPtr)0x0; do { local_90 = (EntityPtr) ((((float)(int)local_80 * 360.0) / 10.0 + (float)local_84) * 0.017453292); scratchVec.x = cos((float)local_90); scratchVec.y = sin((float)local_90); laser = Entity_Player::FireTechLaser ((Entity_Player *)EVar6,position,0xffffffff,&scratchVec,1,1, (Entity *)0x0,1.0); fVar14 = laser->_collisionDamage; (laser->_pos).x = position->x; (laser->_pos).y = position->y; (laser->_posOffset).x = 0.0; (laser->_posOffset).y = -8.0; laser->_disableFollowParent = 1; (**(code **)(*(int *)laser + 0x40))((fVar14 + 25.0) * param_8); (**(code **)(*(int *)laser + 0xc))(); local_80 = (EntityPtr)((int)local_80 + 1); } while ((int)local_80 < 10); param_7 = source; } else { iVar12 = 0; do { local_94 = (Room *)Entity_Player::FireKnife ((Entity_Player *)EVar6,(Entity *)EVar6,0,0.0,0,1); (((Entity_Knife *)local_94)->_pos).x = position->x; (((Entity_Knife *)local_94)->_pos).y = position->y; fVar14 = (float)iVar12 * 36.0 + (float)local_84; if (360.0 < ABS(fVar14)) { fVar14 = fmodf(fVar14,360.0); } if (fVar14 <= 180.0) { if (fVar14 < -180.0) { fVar14 = fVar14 + 360.0; } } else { fVar14 = fVar14 - 360.0; } *(float *)((int)local_94 + 0x438) = fVar14; (**(code **)(*(int *)local_94 + 0x40)) ((*(float *)((int)local_94 + 0x388) + 25.0) * param_8); local_ac = (Entity *)((int)local_94 + 0x3bc); if (*(EntityPtr *)local_ac != (EntityPtr)0x0) { local_90 = (EntityPtr)local_ac; std::multiset::erase(&local_90); } *(EntityPtr *)local_ac = EVar6; std::multiset::insert(local_ac); local_90 = (EntityPtr)(*(float *)((int)local_94 + 0x438) * 0.017453292); scratchVec.x = cos((float)local_90); scratchVec.y = sin((float)local_90); direction.y = scratchVec.y; direction.x = scratchVec.x; Entity_Knife::InitHomingPath((Entity_Knife *)local_94,direction,(Entity *)EVar6,0.0); (**(code **)(*(int *)local_94 + 0xc))(); iVar12 = iVar12 + 1; } while (iVar12 < 10); param_7 = source; } } else { iVar12 = 0; do { local_90 = (EntityPtr)(((float)iVar12 / 10.0 + (float)local_84) * 360.0 * 0.017453292); scratchVec.x = cos((float)local_90); scratchVec.y = sin((float)local_90); laser = Weapon::FireBrimstone ((Entity *)EVar6,(Vector *)((int)EVar6 + 0x33c),&scratchVec,1.0,unk1,0 ); color._tint[0] = ((ColorMod *)((int)local_8c + 0x14c4))->_tint[0]; color._tint[1] = *(float *)((int)local_8c + 0x14c8); color._tint[2] = *(float *)((int)local_8c + 0x14cc); color._tint[3] = *(float *)((int)local_8c + 0x14d0); color._colorize[0] = *(float *)((int)local_8c + 0x14d4); color._colorize[1] = *(float *)((int)local_8c + 0x14d8); color._colorize[2] = *(float *)((int)local_8c + 0x14dc); color._colorize[3] = *(float *)((int)local_8c + 0x14e0); color._offset._0_8_ = *(undefined8 *)((int)local_8c + 0x14e4); color._offset[2] = *(float *)((int)local_8c + 0x14ec); (**(code **)(*(int *)laser + 0x3c))(&color,0xffffffff,0xff,0,1); (**(code **)(*(int *)laser + 0x40))(param_8 * laser->_collisionDamage); (laser->_pos).x = position->x; (laser->_pos).y = position->y; laser->_disableFollowParent = 1; (**(code **)(*(int *)laser + 0xc))(); iVar12 = iVar12 + 1; EVar6 = local_8c; } while (iVar12 < 10); param_7 = source; } goto LAB_007015ea; } } LAB_00701402: local_94 = (Room *)((float)local_94 * 10.0); local_88 = (GridEntity *)0x0; do { local_8c = (EntityPtr)(((float)(int)local_88 * 360.0) / 10.0 + (float)local_84); if (EVar6 == (EntityPtr)0x0) { uVar5 = Random(); local_8c = (EntityPtr)((float)local_8c * 0.017453292); local_b8.x = cos((float)local_8c); local_b8.x = local_b8.x * (float)local_94; local_b8.y = sin((float)local_8c); local_b8.y = local_b8.y * (float)local_94; tear = (Entity_Tear *)Spawn(g_game,2,0,position,&local_b8,(Entity *)param_7,0,uVar5); } else { local_8c = (EntityPtr)((float)local_8c * 0.017453292); scratchVec.x = cos((float)local_8c); scratchVec.x = scratchVec.x * (float)local_94; scratchVec.y = sin((float)local_8c); scratchVec.y = scratchVec.y * (float)local_94; velocity.y = scratchVec.y; velocity.x = scratchVec.x; tear = Entity_Player::FireTear((Entity_Player *)EVar6,position,velocity,7,(Entity *)0x0,1.0) ; } local_90 = (EntityPtr)(param_6 & DAT_00c3461c); if ((((param_3 & DAT_00c34610) != 0 || (param_4 & DAT_00c34614) != 0) || ((param_5 & DAT_00c34618) != 0 || local_90 != (EntityPtr)0x0)) && (iVar12 = FUN_0067d9b0(), extraout_ECX != iVar12)) { Entity_Tear::ChangeVariant(tear,iVar12); } fVar14 = tear->_fScale * 1.355 * param_8; if (fVar14 <= 0.01) { fVar14 = 0.01; } tear->_baseScale = fVar14; tear->_fScale = fVar14; Entity_Tear::ResetSpriteScale(tear); (**(code **)(*(int *)tear + 0x40))((tear->_collisionDamage + 25.0) * param_8); fVar14 = position->x; local_88 = (GridEntity *)((int)local_88 + 1); (tear->_targetPosition).y = position->y; (tear->_targetPosition).x = fVar14; EVar6 = local_80; } while ((int)local_88 < 10); } LAB_007015ea: if (((param_3 & _DAT_00c34ac0) != 0 || (param_4 & _DAT_00c34ac4) != 0) || ((param_5 & _DAT_00c34ac8) != 0 || (param_6 & _DAT_00c34acc) != 0)) { Room::GetClampedPositionImpl(g_game->_room,&spawnPos,position,15.0,15.0,15.0,15.0); uVar5 = Random(); if (param_7 == (EntityPtr)0x0) { pEVar8 = (Entity *)0x0; } else { pEVar8 = *(Entity **)((int)param_7 + 0x3c8); } uVar18 = 0; pTVar17 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar16 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar15 = 0; pEVar8 = Spawn(g_game,1000,0x35,&spawnPos,&g_vectorZero,pEVar8,0,uVar5); piVar9 = (int *)__RTDynamicCast(pEVar8,uVar15,pTVar16,pTVar17,uVar18); fVar14 = param_2 * g_vectorOne.y; piVar9[0x39] = (int)(param_2 * g_vectorOne.x * 0.05); piVar9[0x3a] = (int)(fVar14 * 0.05); (**(code **)(*piVar9 + 0xc))(); } if (((param_3 & DAT_00c34c00) != 0 || (DAT_00c34c04 & param_4) != 0) || ((param_5 & DAT_00c34c08) != 0 || (DAT_00c34c0c & param_6) != 0)) { if ((param_7 == (EntityPtr)0x0) || ((((*(int *)((int)param_7 + 0x28) == 1 || (*(int *)((int)param_7 + 0x34) == 1)) || (*(int *)((int)param_7 + 0x28) == 3)) || (*(int *)((int)param_7 + 0x34) == 3)))) { uVar5 = Random(); uVar18 = 0; pTVar17 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar16 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar15 = 0; pEVar8 = Spawn(g_game,1000,0x34,position,&g_vectorZero,(Entity *)param_7,0,uVar5); piVar9 = (int *)__RTDynamicCast(pEVar8,uVar15,pTVar16,pTVar17,uVar18); piVar9[0x11e] = (int)param_8; if (*(int *)&g_game->_deathmatchManager < 2) { uVar15 = 0x41b80000; } else { uVar15 = 0x41900000; } (**(code **)(*piVar9 + 0x40))(uVar15); uVar5 = Random(); iVar12 = uVar5 % 0x78 + 300; piVar9[0x117] = iVar12; piVar9[0x118] = iVar12; } else { uVar5 = Random(); positionRef = position; pEVar8 = Spawn(g_game,0x21,10,position,&g_vectorZero,(Entity *)param_7,0,uVar5); fVar14 = positionRef->y; iVar12 = *(int *)pEVar8; (pEVar8->_targetPosition).x = positionRef->x; (pEVar8->_targetPosition).y = fVar14; (**(code **)(iVar12 + 0xc))(); } } if (((param_3 & DAT_00c34990) != 0 || (DAT_00c34994 & param_4) != 0) || ((param_5 & DAT_00c34998) != 0 || (DAT_00c3499c & param_6) != 0)) { uVar5 = Random(); if (g_game->_bombPickupsSpawned + 0x24 < (int)(uVar5 % 100)) { if (param_7 == (EntityPtr)0x0) { uVar5 = Random(); } else { uVar5 = *(uint *)((int)param_7 + 0x3dc); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = *(uint *)((int)param_7 + 0x3dc); if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)*(undefined4 *)((int)param_7 + 0x3e0) & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)*(undefined4 *)((int)param_7 + 0x3e4) & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)*(undefined4 *)((int)param_7 + 1000) & 0x1f) ^ uVar5; *(uint *)((int)param_7 + 0x3dc) = uVar5; } if ((g_game->_difficulty == 2) || (local_88 = (GridEntity *)0x1, g_game->_difficulty == 3)) { local_88 = (GridEntity *)0x3; } uVar10 = Random(); fVar14 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_90 = (EntityPtr)(fVar14 + fVar14); scratchVec.x = cos((float)local_90); scratchVec.x = scratchVec.x * 3.0; scratchVec.y = sin((float)local_90); scratchVec.y = scratchVec.y * 3.0; Spawn(g_game,5,0,position,&scratchVec,(Entity *)param_7,(uint)local_88,uVar5); g_game->_bombPickupsSpawned = g_game->_bombPickupsSpawned + 1; } uVar5 = Random(); if (uVar5 % 100 < 0xf) { local_84 = (Entity *)0x0; local_80 = (EntityPtr)0x0; if (*(int *)((int)g_game->_room + 0x1264) != 0) { do { pEVar8 = *(Entity **)(*(int *)((int)g_game->_room + 0x125c) + (int)local_80 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (iVar12 = 1, pEVar8->_type != 1)) { iVar12 = pEVar8->_type; if (iVar12 - 10U < 0x3de) goto LAB_007019e8; } else { LAB_007019e8: if ((((pEVar8->_entityCollisionClass != 1) && (pEVar8->_entityCollisionClass != 0)) && (pEVar8->_isInvicible == 0)) && (pEVar8->_dead == 0)) { local_f0.y = *(float *)((int)&pEVar8->_flags + 4); if (((((pEVar8->_flags & 0x10) == 0) || (iVar12 == 0x322)) || (iVar12 == 0x362)) && (local_84 = pEVar8, (pEVar8->_flags & 0x100) == 0)) break; } } local_80 = (EntityPtr)((int)local_80 + 1); } while ((uint)local_80 < (uint)*(EntityPtr *)((int)g_game->_room + 0x1264)); pEVar8 = local_84; param_7 = source; if (local_84 != (Entity *)0x0) { addEnemyKillScore = 0; bVar4 = 0; iVar12 = 0x96; ref = EntityRef::EntityRef((EntityRef *)(local_50 + 4)); Entity::AddCharmed(pEVar8,ref,iVar12,bVar4,addEnemyKillScore); } } } } positionRef = position; if (((param_3 & DAT_00c34a40) != 0 || (DAT_00c34a44 & param_4) != 0) || ((param_5 & DAT_00c34a48) != 0 || (DAT_00c34a4c & param_6) != 0)) { local_8c = (EntityPtr)0x0; do { scratchVec.x = positionRef->x; scratchVec.y = positionRef->y; if (local_8c == (EntityPtr)0x0) { fVar14 = 1.0; } else { uVar5 = Random(); fVar14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_88 = (GridEntity *)(fVar14 + fVar14); uVar5 = Random(); local_80 = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 70.0 + 40.0); fVar14 = cos((float)local_88); scratchVec.x = fVar14 * (float)local_80 * param_8 + scratchVec.x; fVar14 = sin((float)local_88); scratchVec.y = fVar14 * (float)local_80 * param_8 + scratchVec.y; uVar5 = Random(); fVar14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; } local_90 = (EntityPtr)(fVar14 * param_8); local_80 = local_90; uVar5 = Random(); pEVar8 = Spawn(g_game,1000,0x2c,&scratchVec,&g_vectorZero,(Entity *)0x0,0,uVar5); iVar12 = *(int *)pEVar8; fVar13 = (float)local_80 * 3.0 * g_vectorOne.y; fVar14 = (float)local_80 * 3.0 * g_vectorOne.x; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[8] = -0x3e; (pAVar2->_filename)._buf[9] = '\x01'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; (pEVar8->_sprite)._scale.y = fVar13; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[0xc] = -0x3e; (pAVar2->_filename)._buf[0xd] = '\x01'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (pEVar8->_sprite)._scale.x = fVar14; (**(code **)(iVar12 + 0xc))(); if ((float)local_80 < 0.6) { local_80 = (EntityPtr)((float)local_80 + (float)local_80); } uVar5 = Random(); pEVar8 = Spawn(g_game,1000,2,&scratchVec,&g_vectorZero,(Entity *)0x0, (uint)(0.6 <= (float)local_90) * 2 + 2,uVar5); uVar5 = Random(); color._offset[0] = 1.0; color._offset[1] = 1.0; color._offset[2] = 1.0; *(float *)(pEVar8[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; fVar14 = (float)local_80 * g_vectorOne.y; (pEVar8->_sprite)._scale.x = (float)local_80 * g_vectorOne.x; (pEVar8->_sprite)._scale.y = fVar14; color._tint[0] = 0.0; color._tint[1] = 0.0; color._tint[2] = 0.0; color._tint[3] = 1.0; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; (**(code **)(*(int *)pEVar8 + 0x3c))(&color,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar8 + 0xc))(); local_8c = (EntityPtr)((int)local_8c + 1); } while ((int)local_8c < 6); param_7 = source; } if ((((param_3 & (uint)g_tearFlagPoison._l) != 0 || (g_tearFlagPoison._l._4_4_ & param_4) != 0) || ((param_5 & (uint)g_tearFlagPoison._h) != 0 || (g_tearFlagPoison._h._4_4_ & param_6) != 0)) && (param_7 != (EntityPtr)0x0)) { iVar12 = *(int *)((int)param_7 + 0x28); if (iVar12 == 1000) { if (*(int *)((int)param_7 + 0x2c) == 0x1f) goto LAB_00701def; } else if ((iVar12 == 4) || ((iVar12 == 2 && (*(int *)((int)param_7 + 0x2c) == 4)))) { LAB_00701def: EVar11 = *(EntityPtr *)((int)param_7 + 0x3c8); EVar6 = param_7; while (spawnerIter = EVar11, spawnerIter != (EntityPtr)0x0) { EVar6 = spawnerIter; EVar11 = *(EntityPtr *)((int)spawnerIter + 0x3c8); } uVar5 = Random(); pEVar8 = Spawn(g_game,1000,0x8d,position,&g_vectorZero,(Entity *)EVar6,0,uVar5); fVar14 = param_2 * g_vectorOne.y; param_2 = param_2 * g_vectorOne.x; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[8] = -0x6a; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[0xc] = -0x6a; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (pEVar8->_sprite)._scale.y = (fVar14 * param_8) / 60.0; (pEVar8->_sprite)._scale.x = (param_2 * param_8) / 60.0; (**(code **)(*(int *)pEVar8 + 0x40))(0x40a00000); (**(code **)(*(int *)pEVar8 + 0xc))(); } } positionRef = position; if (((param_3 & DAT_00c34610) != 0 || (param_4 & DAT_00c34614) != 0) || ((param_5 & DAT_00c34618) != 0 || (param_6 & DAT_00c3461c) != 0)) { local_8c = (EntityPtr)0x0; if ((1 < *(int *)&g_game->_deathmatchManager) && (local_8c = param_7, param_7 != (EntityPtr)0x0) ) { do { if (*(int *)((int)param_7 + 0x28) == 1) break; param_7 = *(EntityPtr *)((int)param_7 + 0x3c8); } while (param_7 != (EntityPtr)0x0); local_8c = param_7; } local_84 = (Entity *)0x0; do { EVar6 = local_8c; scratchVec.x = positionRef->x; scratchVec.y = positionRef->y; if (local_84 == (Entity *)0x0) { fVar14 = 1.0; } else { uVar5 = Random(); fVar14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_88 = (GridEntity *)(fVar14 + fVar14); uVar5 = Random(); local_80 = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 70.0 + 40.0); fVar14 = cos((float)local_88); scratchVec.x = fVar14 * (float)local_80 * param_8 + scratchVec.x; fVar14 = sin((float)local_88); scratchVec.y = fVar14 * (float)local_80 * param_8 + scratchVec.y; uVar5 = Random(); fVar14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; } local_90 = (EntityPtr)(fVar14 * param_8); local_80 = local_90; uVar5 = Random(); pEVar8 = Spawn(g_game,1000,0x2e,&scratchVec,&g_vectorZero,(Entity *)EVar6,0,uVar5); iVar12 = *(int *)pEVar8; fVar13 = (float)local_80 * 3.0 * g_vectorOne.y; fVar14 = (float)local_80 * 3.0 * g_vectorOne.x; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[8] = -0x3e; (pAVar2->_filename)._buf[9] = '\x01'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; (pEVar8->_sprite)._scale.y = fVar13; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[0xc] = -0x3e; (pAVar2->_filename)._buf[0xd] = '\x01'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; (pEVar8->_sprite)._scale.x = fVar14; (**(code **)(iVar12 + 0xc))(); if ((float)local_80 < 0.6) { local_80 = (EntityPtr)((float)local_80 + (float)local_80); } uVar5 = Random(); pEVar8 = Spawn(g_game,1000,2,&scratchVec,&g_vectorZero,(Entity *)0x0, (uint)(0.6 <= (float)local_90) * 2 + 2,uVar5); uVar5 = Random(); iVar12 = *(int *)pEVar8; *(float *)(pEVar8[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 360.0; fVar14 = (float)local_80 * g_vectorOne.y; (pEVar8->_sprite)._scale.x = (float)local_80 * g_vectorOne.x; (pEVar8->_sprite)._scale.y = fVar14; (**(code **)(iVar12 + 0xc))(); local_84 = (Entity *)((int)local_84 + 1); } while ((int)local_84 < 6); param_7 = source; } game = local_9c; if (((param_7 == (EntityPtr)0x0) || (*(int *)((int)param_7 + 0x28) != 4)) || (*(int *)((int)param_7 + 0x2c) != 0xf)) { if (((param_3 & DAT_00c34620) == 0 && (DAT_00c34624 & param_4) == 0) && ((param_5 & DAT_00c34628) == 0 && (DAT_00c3462c & param_6) == 0)) goto LAB_007023cf; if (param_7 != (EntityPtr)0x0) goto LAB_007021c5; local_84 = (Entity *)0x0; local_80 = (EntityPtr)0x0; local_8c = (EntityPtr)0x0; } else { LAB_007021c5: EVar6 = *(EntityPtr *)((int)param_7 + 0x3c8); local_80 = param_7; if (*(EntityPtr *)((int)param_7 + 0x3c8) != (EntityPtr)0x0) { do { local_80 = EVar6; EVar6 = *(EntityPtr *)((int)local_80 + 0x3c8); } while (*(EntityPtr *)((int)local_80 + 0x3c8) != (EntityPtr)0x0); param_7 = source; } local_8c = *(EntityPtr *)((int)local_80 + 0x34); local_84 = *(Entity **)((int)local_80 + 0x38); if (*(int *)((int)local_80 + 0x28) == 1) { local_84 = *(Entity **)((int)local_80 + 0x2c); local_8c = (EntityPtr)0x1; } } if ((*(int *)((int)param_7 + 0x28) == 4) && (*(int *)((int)param_7 + 0x2c) == 0xf)) { ShakeScreen(local_9c,0xc); } uVar5 = Random(); pEVar8 = Spawn(game,1000,1,position,&g_vectorZero,(Entity *)param_7,0,uVar5); color._tint[0] = 1.0; color._tint[1] = 0.0; color._tint[2] = 0.0; color._tint[3] = 1.0; color._offset[0] = 0.0; color._offset[1] = 0.0; color._offset[2] = 0.0; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; local_ac = pEVar8; (**(code **)(*(int *)pEVar8 + 0x3c))(&color,0xffffffff,0xff,0,1); EVar6 = (EntityPtr)0x0; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[8] = '('; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = &pEVar8[1]._sprite; (pAVar2->_filename)._buf[0xc] = '('; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; local_88 = (GridEntity *)0x0; do { EVar11 = (EntityPtr) Entity_Laser::ShootAngle (1,position,(float)(int)local_88 * 90.0,0x1e,&g_vectorZero,pEVar8,0); if (*(EntityPtr *)((int)EVar11 + 0x3c8) != (EntityPtr)0x0) { local_90 = (EntityPtr)((int)EVar11 + 0x3c8); std::multiset::erase(&local_90); } *(EntityPtr *)((int)EVar11 + 0x3c8) = local_80; if (local_80 != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar11 + 0x3c8)); } *(EntityPtr *)((int)EVar11 + 0x34) = local_8c; *(Entity **)((int)EVar11 + 0x38) = local_84; *(float *)((int)EVar11 + 0x4e0) = param_8; Entity_Laser::ResetSpriteScale((Entity_Laser *)EVar11); if (*(EntityPtr *)((int)EVar11 + 0x52c) != EVar6) { if (*(EntityPtr *)((int)EVar11 + 0x52c) != (EntityPtr)0x0) { local_90 = (EntityPtr)((int)EVar11 + 0x52c); std::multiset::erase(&local_90); } *(EntityPtr *)((int)EVar11 + 0x52c) = EVar6; if (EVar6 != (EntityPtr)0x0) { std::multiset::insert((EntityPtr *)((int)EVar11 + 0x52c)); } } if ((local_80 == (EntityPtr)0x0) || (*(int *)((int)local_80 + 0x28) != 1)) { fVar14 = 8.0; } else { fVar14 = param_8 * 8.0; } (**(code **)(*(int *)EVar11 + 0x40))(fVar14); (**(code **)(*(int *)EVar11 + 0xc))(); if (EVar6 == (EntityPtr)0x0) { EVar6 = EVar11; } local_88 = (GridEntity *)((int)local_88 + 1); pEVar8 = local_ac; } while ((int)local_88 < 4); param_7 = source; LAB_007023cf: game = local_9c; if (((param_3 & DAT_00c347d0) != 0 || (DAT_00c347d4 & param_4) != 0) || ((param_5 & DAT_00c347d8) != 0 || (DAT_00c347dc & param_6) != 0)) { ShakeScreen(local_9c,0x14); game->_bloomDuration = 6; game->_bloomTimer = 6; game->_bloomStrength = 1.0; ButterBeanFart(game,position,200.0,(Entity *)param_7,0,0); uVar5 = 0; do { uVar10 = Random(); local_88 = (GridEntity *) ((((((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 + (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)])) - 0.5) * 360.0) / 15.0) * 0.017453292); uVar10 = Random(); local_80 = (EntityPtr) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 15.0); scratchVec.x = cos((float)local_88); scratchVec.x = scratchVec.x * (float)local_80; fVar14 = sin((float)local_88); scratchVec.y = fVar14 * (float)local_80 * 0.85; uVar10 = Random(); pEVar8 = Spawn(g_game,1000,0x3b,position,&scratchVec,(Entity *)0x0,0,uVar10); uVar10 = Random(); if ((uVar10 & 1) == 0) { local_88 = (GridEntity *)&DAT_bf800000; } else { local_88 = (GridEntity *)0x3f800000; } uVar10 = Random(); *(float *)(pEVar8[1]._sprite._animDefaultName._buf + 8) = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_88; uVar10 = Random(); fVar13 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 1.0; fVar14 = fVar13 * g_vectorOne.x; (pEVar8->_sprite)._scale.y = fVar13 * g_vectorOne.y; (pEVar8->_sprite)._scale.x = fVar14; uVar10 = Random(); iVar12 = uVar10 % 0x28 + 0x28; *(int *)(pEVar8[1]._sprite._filename._buf + 8) = iVar12; *(int *)(pEVar8[1]._sprite._filename._buf + 0xc) = iVar12; Color::Reset(&color); color._tint[0] = 0.45; color._tint[1] = 0.45; color._tint[2] = 0.46; color._tint[3] = 0.75; (**(code **)(*(int *)pEVar8 + 0x3c))(&color,0xffffffff,0xff,0,1); uVar5 = uVar5 + 1; } while (uVar5 < 0xf); uVar5 = Random(); EVar6 = source; pEVar8 = Spawn(g_game,1000,0x10,position,&g_vectorZero,(Entity *)source,1,uVar5); fVar14 = g_vectorOne.y * 2.0; (pEVar8->_sprite)._scale.x = g_vectorOne.x * 2.0; (pEVar8->_sprite)._scale.y = fVar14; uVar5 = Random(); (pEVar8->_sprite)._flipX = ~(byte)uVar5 & 1; (**(code **)(*(int *)pEVar8 + 0xc))(); room = local_9c->_room; gridX = (int)((position->x - 40.0) / 40.0 + 0.5); iVar12 = (int)((position->y - 120.0) / 40.0 + 0.5); if ((((gridX < 0) || (room->_gridWidth <= gridX)) || (iVar12 < 0)) || (room->_gridHeight <= iVar12)) { local_84 = (Entity *)0xffffffff; } else { local_84 = (Entity *)(room->_gridWidth * iVar12 + gridX); } local_94 = room; bVar4 = Room::CanSpawnObstacleAtPosition(room,(int)local_84,0); if ((bVar4 != 0) && (((local_90 = (EntityPtr)Random(), -1 < (int)local_84 && ((int)local_84 < 0x1c0)) || ((KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"), -1 < (int)local_84 && ((int)local_84 < 0x1c0)))))) { if ((room->_gridPaths[(int)local_84] < 0x385) && (local_88 = Isaac::CreateGridEntity(7,(uint)local_84), local_88 != (GridEntity *)0x0)) { if (room->_gridEntities[(int)local_84] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)room->_gridEntities[(int)local_84])(1); } room->_gridEntities[(int)local_84] = local_88; (local_88->_desc)._spawnSeed = (int)local_90; iVar12 = *(int *)local_88; (local_88->_desc)._variant = 0; (local_88->_desc)._varData = 0; local_88->_collisionClass = 0; (**(code **)(iVar12 + 0x20))(); game = g_game; piVar9 = &(local_88->_desc)._spawnCount; *piVar9 = *piVar9 + 1; (local_88->_desc)._initialized = 1; local_88->_spawnFrame = game->_frameCount; } piVar9 = room->_gridEntities[(int)local_84]; if ((piVar9 != (int *)0x0) && (piVar9[1] == 7)) { (**(code **)(*piVar9 + 4))(); } } local_b8.y = (float)((int)local_84 / room->_gridWidth); centerGridX = (int)local_84 % room->_gridWidth; local_8c = (EntityPtr)0x1; do { local_90 = (EntityPtr)0x4; local_ac = (Entity *)0xffffffff; ringStepY = 0.0; do { ringGridX = (int)local_ac * (int)local_8c + centerGridX; ringGridY = (int)ringStepY * (int)local_8c + (int)local_b8.y; sideStep = (int)local_8c; scratchVec.y = ringStepY; do { if ((((ringGridX < 0) || (local_94->_gridWidth <= ringGridX)) || (ringGridY < 0)) || (local_94->_gridHeight <= ringGridY)) { uVar5 = 0xffffffff; } else { uVar5 = local_94->_gridWidth * ringGridY + ringGridX; } bVar4 = Room::CanSpawnObstacleAtPosition(local_94,uVar5,0); if (bVar4 != 0) { if (((uVar5 < 0x1c0) && (piVar9 = local_94->_gridEntities[uVar5], piVar9 != (int *)0x0)) && (piVar9[0xf] != 0)) { local_b0 = *(code **)(*piVar9 + 0x14); if (EVar6 == (EntityPtr)0x0) { local_50._4_4_ = 0.0; fStack_48 = 0.0; fStack_44 = 0.0; local_40 = 0.0; fStack_3c = g_vectorZero.x; fStack_38 = g_vectorZero.y; fStack_34 = g_vectorZero.x; local_30 = g_vectorZero.y; LAB_00702995: local_9c = (Game *)0x0; if (EVar6 != (EntityPtr)0x0) goto LAB_007029a3; local_9c = (Game *)0x0; LAB_007029c6: local_88 = (GridEntity *)0x0; if (EVar6 != (EntityPtr)0x0) goto LAB_007029d1; LAB_007029ea: uVar10 = 0; } else { local_50._4_4_ = *(float *)((int)EVar6 + 0x28); fStack_3c = *(float *)((int)EVar6 + 0x33c); fStack_38 = *(float *)((int)EVar6 + 0x340); fStack_48 = *(float *)((int)EVar6 + 0x2c); fStack_44 = *(float *)((int)EVar6 + 0x34); local_40 = *(float *)((int)EVar6 + 0x38); fStack_34 = *(float *)((int)EVar6 + 0x360); local_30 = *(float *)((int)EVar6 + 0x364); if ((*(uint *)((int)EVar6 + 0x168) & 0x100) == 0) goto LAB_00702995; local_9c = (Game *)0x1; LAB_007029a3: if ((*(uint *)((int)EVar6 + 0x168) & 0x20000000) == 0) goto LAB_007029c6; local_88 = (GridEntity *)0x2; LAB_007029d1: if ((*(uint *)((int)EVar6 + 0x16c) & 0x400000) == 0) goto LAB_007029ea; uVar10 = 4; } local_2c = (float)(uVar10 | (uint)local_88 | (uint)local_9c); local_28 = EVar6; (*local_b0)(1,local_50 + 4); } local_b0 = (code *)Random(); if (((-1 < (int)uVar5) && ((int)uVar5 < 0x1c0)) || ((KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"), -1 < (int)uVar5 && ((int)uVar5 < 0x1c0)))) { if ((local_94->_gridPaths[uVar5] < 0x385) && (local_88 = Isaac::CreateGridEntity(7,uVar5), local_88 != (GridEntity *)0x0)) { if (local_94->_gridEntities[uVar5] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_94->_gridEntities[uVar5])(1); } local_94->_gridEntities[uVar5] = local_88; (local_88->_desc)._spawnSeed = (int)local_b0; iVar12 = *(int *)local_88; (local_88->_desc)._variant = 0; (local_88->_desc)._varData = 0; local_88->_collisionClass = 0; (**(code **)(iVar12 + 0x20))(); game = g_game; piVar9 = &(local_88->_desc)._spawnCount; *piVar9 = *piVar9 + 1; (local_88->_desc)._initialized = 1; local_88->_spawnFrame = game->_frameCount; } piVar9 = local_94->_gridEntities[uVar5]; if ((piVar9 != (int *)0x0) && (piVar9[1] == 7)) { (**(code **)(*piVar9 + 4))(); pitX = (float)((int)uVar5 % local_94->_gridWidth) * 40.0 + 40.0; local_b0 = (code *)((float)((int)uVar5 / local_94->_gridWidth) * 40.0 + 120.0); local_9c = (Game *)(pitX - position->x); local_80 = (EntityPtr)((float)local_b0 - position->y); fVar14 = sqrtf((float)local_9c * (float)local_9c + (float)local_80 * (float)local_80 ); if (0.0 < fVar14) { local_9c = (Game *)((float)local_9c * (1.0 / fVar14)); local_80 = (EntityPtr)((float)local_80 * (1.0 / fVar14)); } iVar12 = 5; do { uVar5 = Random(); uVar10 = Random(); local_88 = (GridEntity *) (((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292); local_84 = (Entity *)cos((float)local_88); local_88 = (GridEntity *)sin((float)local_88); uVar10 = Random(); local_f0.y = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 6.0; local_f0.x = ((float)local_84 * (float)local_9c - (float)local_88 * (float)local_80) * local_f0.y; local_f0.y = ((float)local_88 * (float)local_9c + (float)local_84 * (float)local_80) * local_f0.y; uVar10 = Random(); fVar14 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_88 = (GridEntity *)(fVar14 + fVar14); uVar10 = Random(); local_84 = (Entity *) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar14 = cos((float)local_88); spawnPos.x = fVar14 * (float)local_84 + pitX; fVar14 = sin((float)local_88); spawnPos.y = fVar14 * (float)local_84 + (float)local_b0; pEVar8 = Spawn(g_game,1000,4,&spawnPos,&local_f0,(Entity *)0x0,0x20000,uVar5); uVar5 = Random(); EVar6 = source; pEVar8[1]._damageEvents._begin = (void *)(-5.0 - (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 20.0); iVar12 = iVar12 + -1; } while (iVar12 != 0); local_84 = (Entity *)0x2; do { uVar5 = Random(); fVar14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_88 = (GridEntity *)(fVar14 + fVar14); uVar5 = Random(); local_80 = (EntityPtr) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10) ; fVar14 = cos((float)local_88); rockTearPos.x = fVar14 * (float)local_80 * 25.0 + pitX; local_9c = (Game *)rockTearPos.x; fVar14 = sin((float)local_88); local_9c = (Game *)((float)local_9c - position->x); rockTearPos.y = fVar14 * (float)local_80 * 25.0 + (float)local_b0; local_80 = (EntityPtr)(rockTearPos.y - position->y); uVar5 = Random(); local_88 = (GridEntity *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 12.0); fVar14 = sqrtf((float)local_9c * (float)local_9c + (float)local_80 * (float)local_80); if (fVar14 <= 0.0) { rockTearVelocity.x = (float)local_9c; rockTearVelocity.y = (float)local_80; } else { rockTearVelocity.x = (float)local_9c * ((float)local_88 / fVar14); rockTearVelocity.y = (float)local_80 * ((float)local_88 / fVar14); } if ((EVar6 == (EntityPtr)0x0) || ((*(int *)((int)EVar6 + 0x28) != 1 && (*(int *)((int)EVar6 + 0x34) != 1)))) { uVar5 = Random(); tear = (Entity_Tear *) Spawn(g_game,9,9,&rockTearPos,&rockTearVelocity, *(Entity **)((int)EVar6 + 0x3c8),0,uVar5); uVar5 = Random(); tear->_fScale = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.7; } else { uVar5 = Random(); tear = (Entity_Tear *) Spawn(g_game,2,0x2a,&rockTearPos,&rockTearVelocity, *(Entity **)((int)EVar6 + 0x3c8),0,uVar5); uVar5 = Random(); fVar14 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.7; if (fVar14 <= 0.01) { fVar14 = 0.01; } tear->_baseScale = fVar14; tear->_fScale = fVar14; Entity_Tear::ResetSpriteScale(tear); (**(code **)(*(int *)tear + 0x40))(0x41700000); } (**(code **)(*(int *)tear + 0xc))(); local_84 = (Entity *)((int)local_84 - 1); } while (local_84 != (Entity *)0x0); } } } ringGridX = ringGridX - ((int)ringStepY + (int)local_ac); ringGridY = ringGridY + ((int)local_ac - (int)ringStepY); sideStep = sideStep + -1; } while (sideStep != 0); ringStepY = (float)local_ac; local_ac = (Entity *)-(int)scratchVec.y; local_90 = (EntityPtr)((int)local_90 + -1); } while (local_90 != (EntityPtr)0x0); local_8c = (EntityPtr)((int)local_8c + 1); } while ((int)local_8c < 3); uVar5 = Random(); pEVar8 = Spawn(g_game,1000,0x77,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,uVar5); pEVar8[1]._pendingDamage = (float)FUN_00703140; *(undefined4 *)&pEVar8[1]._pendingDamageFlags = 0x1e; *(undefined4 *)((int)&pEVar8[1]._pendingDamageFlags + 4) = 0; } ExceptionList = local_1c; return; } //@@ 00703140 FUN_00703140 void FUN_00703140(void) { Manager *pMVar1; int local_8; pMVar1 = g_manager; local_8 = 0xba; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.1,2,0,1.0,0.0); return; } //@@ 00703190 Game::spawn_bomb_crater /* DB: spawns effect 1000.18 (BOMB_CRATER) at pos, sprite scale from XMM2, and appends an EntitySaveState (1000.18) to the room save list; called from NpcAI::ENTITY_SKINNY Black Bony death after BombDamage (pass5_g2) prototype: db/protos.zhl, confirmed by RET 8 */ Entity * __thiscall Game::spawn_bomb_crater(Game *this,Vector *position,Entity *spawner,float scale) { int iVar1; void *pvVar2; EntitySaveState *this_00; uint uVar3; uint seed; Entity *pEVar4; int iVar5; float fVar6; EntitySaveState local_8c; undefined4 local_88; float local_80; float local_64; float local_60; int local_58; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc320; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = scale; seed = Random(); pEVar4 = Spawn(g_game,1000,0x12,position,&g_vectorZero,spawner,0,seed); fVar6 = local_14 * g_vectorOne.y; iVar1 = *(int *)pEVar4; (pEVar4->_sprite)._scale.x = local_14 * g_vectorOne.x; (pEVar4->_sprite)._scale.y = fVar6; (**(code **)(iVar1 + 0xc))(uVar3); EntitySaveState::constructor(&local_8c); local_8 = 0; local_64 = position->x; pvVar2 = this->_room; local_60 = position->y; local_8c = (EntitySaveState)0x3e8; local_88 = 0x12; local_58 = pEVar4->_initSeed; iVar1 = *(int *)((int)pvVar2 + 4); iVar5 = *(int *)(iVar1 + 0x8c) - *(int *)(iVar1 + 0x88); local_80 = local_14; while (0x80 < iVar5 / 0x78 + 1U) { std::vector::erase(&spawner,*(undefined4 *)(*(int *)((int)pvVar2 + 4) + 0x88)); iVar1 = *(int *)((int)pvVar2 + 4); iVar5 = *(int *)(iVar1 + 0x8c) - *(int *)(iVar1 + 0x88); } this_00 = *(EntitySaveState **)(iVar1 + 0x8c); if (this_00 == *(EntitySaveState **)(iVar1 + 0x90)) { std::vector::_Emplace_reallocate(this_00,&local_8c); } else { EntitySaveState::copy(this_00,&local_8c); *(int *)(iVar1 + 0x8c) = *(int *)(iVar1 + 0x8c) + 0x78; } invoke_pending_callbacks(&local_8c); ExceptionList = local_10; return pEVar4; } //@@ 00703330 Game::SpawnParticles /* ZHL [lua] Lua binding Game:SpawnParticles prototype: db/protos.zhl, confirmed by RET 28 */ void __thiscall Game::SpawnParticles (Game *this,Vector *position,int variant,int count,float speed,ColorMod *color, float height,int subType) { uint seed; uint uVar1; Entity *pEVar2; int *piVar3; float fVar4; Vector local_10; if (0 < count) { do { seed = Random(); uVar1 = Random(); fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; local_10.x = cos(fVar4); local_10.x = local_10.x * speed; fVar4 = sin(fVar4); local_10.y = fVar4 * 0.5 * speed; pEVar2 = SpawnEx(this,1000,variant,position,&local_10,(Entity *)0x0,subType,seed,0); piVar3 = (int *)__RTDynamicCast(pEVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); (**(code **)(*piVar3 + 0x3c))(color,0xffffffff,0xff,0,1); if (height != 100000.0) { piVar3[0x104] = (int)height; } if (*(int *)&g_game->_roomTransition != 0) { piVar3[0x5b] = piVar3[0x5b] | 0x1000; piVar3[0x5a] = piVar3[0x5a]; } (**(code **)(*piVar3 + 0xc))(); count = count + -1; } while (count != 0); } return; } //@@ 00703460 Game::GetFont /* ZHL [lua] Lua binding Game:GetFont */ Font * Game::GetFont(void) { return &g_manager->_font2_TeamMeatEx12; } //@@ 00703470 Game::AddEncounteredBoss /* ZHL [lua] Lua binding Game:AddEncounteredBoss */ void __thiscall Game::AddEncounteredBoss(Game *this,int param_2,int param_3) { int iVar1; int *piVar2; uint uVar3; uint uVar4; int local_10; int local_c; Game *local_8; iVar1 = *(int *)this->_encounteredBosses; uVar3 = 0; uVar4 = *(int *)(this->_encounteredBosses + 4) - iVar1 >> 3; if (uVar4 != 0) { do { if ((*(int *)(iVar1 + uVar3 * 8) == param_2) && (*(int *)(iVar1 + 4 + uVar3 * 8) == param_3)) { return; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } if ((((param_2 < 0x2e) || (0x34 < param_2)) && (param_2 != 0x26)) && ((param_2 != 0x104 || (param_3 != 10)))) { local_10 = param_2; local_c = param_3; piVar2 = *(int **)(this->_encounteredBosses + 4); if (piVar2 != *(int **)(this->_encounteredBosses + 8)) { *piVar2 = param_2; piVar2[1] = param_3; *(int *)(this->_encounteredBosses + 4) = *(int *)(this->_encounteredBosses + 4) + 8; return; } local_8 = this; std::vector<8byte>::_Emplace_reallocate(piVar2,&local_10); } return; } //@@ 00703510 Game::HasEncounteredBoss /* ZHL [lua] Lua binding Game:HasEncounteredBoss */ uint __thiscall Game::HasEncounteredBoss(Game *this,int param_2,int param_3) { int iVar1; uint uVar2; uint uVar3; iVar1 = *(int *)this->_encounteredBosses; uVar2 = 0; uVar3 = *(int *)(this->_encounteredBosses + 4) - iVar1 >> 3; if (uVar3 != 0) { do { if ((*(int *)(iVar1 + uVar2 * 8) == param_2) && (*(int *)(iVar1 + 4 + uVar2 * 8) == param_3)) { return CONCAT31((int3)(uVar2 >> 8),1); } uVar2 = uVar2 + 1; } while (uVar2 < uVar3); } return uVar2 & 0xffffff00; } //@@ 00703560 Game::GetGreedWavesNum /* ZHL [lua] Lua binding Game:GetGreedWavesNum */ char __thiscall Game::GetGreedWavesNum(Game *this) { return (this->_difficulty == 3) + '\v'; } //@@ 00703570 Game::GetGreedBossWaveNum /* ZHL [lua] Lua binding Game:GetGreedBossWaveNum */ char __thiscall Game::GetGreedBossWaveNum(Game *this) { return (this->_difficulty == 3) + '\t'; } //@@ 00703580 spawn_debug_damage_text /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: formats the damage amount (arg4 float) into a buffer, spawns Entity_Text (type 9001) at arg2 position, sets its color from arg3 KColor and sprintf's the text into it; both callers gate on debug flag 6 (Game::GetDebugFlag(6) in Entity_Player::TakeDamage, _debugFlags bit 6 in Entity::Update damage loop) */ void spawn_debug_damage_text (undefined4 param_1,Vector *param_2,undefined4 *param_3,undefined4 param_4, undefined1 param_5) { uint seed; Entity *pEVar1; int *piVar2; undefined4 uVar3; TypeDescriptor *pTVar4; TypeDescriptor *pTVar5; undefined4 uVar6; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; FUN_00709bc0(param_4,¶m_5); perror(&DAT_00c80ea8); seed = Random(); uVar6 = 0; pTVar5 = &IsaacRepentancePlus::Entity_Text::RTTI_Type_Descriptor; pTVar4 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar3 = 0; pEVar1 = Game::Spawn(g_game,0x2329,0,param_2,&g_vectorZero,(Entity *)0x0,0,seed); piVar2 = (int *)__RTDynamicCast(pEVar1,uVar3,pTVar4,pTVar5,uVar6); local_14 = 0; local_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; local_10 = 0; local_34 = *param_3; uStack_30 = param_3[1]; uStack_2c = param_3[2]; uStack_28 = param_3[3]; local_c = 0; (**(code **)(*piVar2 + 0x3c))(&local_34,0xffffffff,0xff,0,1); sprintf_s((byte *)(piVar2 + 0x106),0x100,&DAT_00b62fdc); (**(code **)(*piVar2 + 0xc))(); return; } //@@ 00703670 Game::ShakeScreen /* ZHL [lua] Lua binding Game:ShakeScreen prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Game::ShakeScreen(Game *this,int timeout) { Manager *pMVar1; void *pvVar2; int *piVar3; uint uVar4; float local_c [2]; pMVar1 = g_manager; this->_screenShakeTimer = timeout; if ((pMVar1->_optionsConfig)._enableRumble != 0) { pvVar2 = (this->_playerManager)._playerList._end; uVar4 = 0; piVar3 = (this->_playerManager)._playerList._begin; if ((int)pvVar2 - (int)piVar3 >> 2 != 0) { do { if ((int)pvVar2 - (int)piVar3 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar2 = (this->_playerManager)._playerList._end; piVar3 = (this->_playerManager)._playerList._begin; } if (uVar4 < (uint)((int)pvVar2 - (int)piVar3 >> 2)) { piVar3 = piVar3 + uVar4; } local_c[1] = 0.5; local_c[0] = (float)timeout / 60.0; (**(code **)(PTR_vftable_00c57b18 + 0x74)) (*(undefined4 *)(*piVar3 + 0x1618),FUN_00a20b70,local_c,local_c + 1,0); pvVar2 = (this->_playerManager)._playerList._end; uVar4 = uVar4 + 1; piVar3 = (this->_playerManager)._playerList._begin; } while (uVar4 < (uint)((int)pvVar2 - (int)piVar3 >> 2)); } } return; } //@@ 00703770 Game::MakeShockwave /* ZHL [exact] __thiscall void Game::MakeShockwave(const Vector& pos, float amplitude, float speed, int duration); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Game::MakeShockwave(Game *this,Vector *pos,float amplitude,float speed,int duration) { int *piVar1; int iVar2; float fVar3; float fVar4; void *pvVar5; void *pvVar6; uint uVar7; pvVar5 = this->_room; fVar3 = pos->x; fVar4 = pos->y; pvVar6 = g_game->_room; piVar1 = (int *)((int)pvVar6 + 0x70fc); *piVar1 = *piVar1 + 1; uVar7 = *(uint *)((int)pvVar6 + 0x70fc) & 0x80000001; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffe) + 1; } if (1 < uVar7) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } iVar2 = uVar7 + 0x407; *(float *)((int)pvVar5 + iVar2 * 0x1c) = fVar3; *(float *)((int)pvVar5 + iVar2 * 0x1c + 4) = fVar4; *(float *)((int)pvVar5 + iVar2 * 0x1c + 0xc) = amplitude; *(undefined4 *)((int)pvVar5 + iVar2 * 0x1c + 8) = 0; *(float *)((int)pvVar5 + iVar2 * 0x1c + 0x10) = speed; *(undefined4 *)((int)pvVar5 + iVar2 * 0x1c + 0x14) = 0; *(int *)((int)pvVar5 + iVar2 * 0x1c + 0x18) = duration; return; } //@@ 00703830 Game::SetBloom /* ZHL [exact] __thiscall void Game::SetBloom(int Time, float Strength); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Game::SetBloom(Game *this,int Time,float Strength) { this->_bloomDuration = Time; this->_bloomTimer = Time; this->_bloomStrength = Strength; return; } //@@ 00703850 Game::GetRandomPlayer /* ZHL [lua] Lua binding Game:GetRandomPlayer prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Player * __thiscall Game::GetRandomPlayer(Game *this,Vector *position,float radius) { undefined4 uVar1; uint uVar2; uint uVar3; int iVar4; Entity_Player *pEVar5; float fVar6; float fVar7; int local_20; int local_1c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc34d; local_10 = ExceptionList; ExceptionList = &local_10; std::vector::copy_constructor(&this->_playerManager); local_8 = 0; uVar2 = local_1c - local_20 >> 2; iVar4 = uVar2 - 1; local_14 = uVar2; if (0 < iVar4) { do { if (uVar2 == 0) { uVar3 = 0; } else { uVar3 = Random(); uVar3 = uVar3 % uVar2; } uVar1 = *(undefined4 *)(local_20 + iVar4 * 4); uVar2 = uVar2 - 1; *(undefined4 *)(local_20 + iVar4 * 4) = *(undefined4 *)(local_20 + uVar3 * 4); iVar4 = iVar4 + -1; *(undefined4 *)(local_20 + uVar3 * 4) = uVar1; } while (0 < iVar4); } uVar2 = 0; if (local_14 != 0) { do { pEVar5 = *(Entity_Player **)(local_20 + uVar2 * 4); fVar6 = position->y - (pEVar5->_pos).y; fVar7 = position->x - (pEVar5->_pos).x; if (fVar6 * fVar6 + fVar7 * fVar7 < radius * radius) goto LAB_00703922; uVar2 = uVar2 + 1; } while (uVar2 < local_14); } pEVar5 = *(Entity_Player **)(local_1c + -4); LAB_00703922: FID_conflict__Tidy(&local_20); ExceptionList = local_10; return pEVar5; } //@@ 00703950 Game::GetNearestPlayer /* ZHL [lua] Lua binding Game:GetNearestPlayer prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Player * __thiscall Game::GetNearestPlayer(Game *this,Vector *pos) { int *piVar1; Entity_Player *pEVar2; int *piVar3; uint uVar4; void *pvVar5; float fVar6; float fVar7; float fVar8; float fVar9; Entity_Player *local_14; float local_10; pvVar5 = (this->_playerManager)._playerList._end; piVar3 = (this->_playerManager)._playerList._begin; if ((int)pvVar5 - (int)piVar3 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (this->_playerManager)._playerList._end; piVar3 = (this->_playerManager)._playerList._begin; } uVar4 = 1; local_14 = (Entity_Player *)*piVar3; fVar6 = pos->x - (local_14->_pos).x; fVar9 = pos->y - (local_14->_pos).y; local_10 = fVar9 * fVar9 + fVar6 * fVar6; fVar6 = local_10; if (1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)) { do { fVar9 = fVar6; if ((int)pvVar5 - (int)piVar3 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (this->_playerManager)._playerList._end; fVar9 = local_10; } piVar3 = (this->_playerManager)._playerList._begin; piVar1 = piVar3 + uVar4; if ((uint)((int)pvVar5 - (int)piVar3 >> 2) <= uVar4) { piVar1 = piVar3; } pEVar2 = (Entity_Player *)*piVar1; fVar8 = pos->y - (pEVar2->_pos).y; fVar7 = pos->x - (pEVar2->_pos).x; fVar7 = fVar8 * fVar8 + fVar7 * fVar7; if (fVar7 < fVar9) { fVar9 = fVar7; local_10 = fVar7; } if (fVar6 <= fVar7) { pEVar2 = local_14; } uVar4 = uVar4 + 1; fVar6 = fVar9; local_14 = pEVar2; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } return local_14; } //@@ 00703ab0 Game::GetNearestPlayerEx /* DB: ? nearest player loop with bool filters (hologram), next to GetNearestPlayer prototype: db/protos.zhl, confirmed by RET 16 */ Entity_Player * Game::GetNearestPlayerEx (Vector *pos,byte isMainPlayerOnly,byte isGroundedOnly,byte isIncludeUncollidable) { PlayerManager *pPVar1; Game *pGVar2; byte bVar3; undefined4 *puVar4; void *pvVar5; Entity_Player *extraout_ECX; Entity_Player *this; Entity_Player *pEVar6; Game *pGVar7; uint uVar8; float fVar9; float fVar10; float fVar11; Entity_Player *local_10; float local_c; pGVar2 = g_game; fVar11 = 1e+10; pEVar6 = (Entity_Player *)0x0; pPVar1 = &g_game->_playerManager; uVar8 = 0; local_10 = (Entity_Player *)0x0; local_c = 1e+10; pGVar7 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar5 = (pGVar2->_playerManager)._playerList._end; if ((int)pvVar5 - (int)(pPVar1->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (pGVar2->_playerManager)._playerList._end; pEVar6 = local_10; pGVar7 = g_game; fVar11 = local_c; } puVar4 = (pPVar1->_playerList)._begin; if (uVar8 < (uint)((int)pvVar5 - (int)puVar4 >> 2)) { puVar4 = puVar4 + uVar8; } this = (Entity_Player *)*puVar4; fVar10 = pos->y - (this->_pos).y; fVar9 = pos->x - (this->_pos).x; fVar9 = fVar10 * fVar10 + fVar9 * fVar9; if (fVar9 < fVar11) { if (isMainPlayerOnly == 0) { LAB_00703b89: if (((isGroundedOnly == 0) || (this->_entityGridCollisionClass == 5)) && ((isIncludeUncollidable != 0 || (this->_entityCollisionClass != 0)))) { pEVar6 = this; fVar11 = fVar9; local_10 = this; local_c = fVar9; } else { LAB_00703bb8: pEVar6 = local_10; } } else if (((this->_variant == 0) && (this->_isCoopGhost == 0)) && (this->_parent == (EntityPtr)0x0)) { bVar3 = Entity_Player::IsHologram(this); this = extraout_ECX; if (bVar3 == 0) goto LAB_00703b89; goto LAB_00703bb8; } } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(pGVar7->_playerManager)._playerList._end - (int)(pGVar7->_playerManager)._playerList._begin >> 2)); } return pEVar6; } //@@ 00703be0 Game::Fart /* ZHL [lua] Lua binding Game:Fart prototype: db/protos.zhl, confirmed by RET 24 */ void __thiscall Game::Fart(Game *this,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 == (Entity *)0x0) || (sourcePlayer = (Entity_Player *)Entity::GetPlayerAncestor(source), sourcePlayer == (Entity_Player *)0x0)) || (bVar2 = Entity_Player::HasTrinket(sourcePlayer,0x86,0), bVar2 == 0)) { fartScale = scale; } else { radius = radius + radius; fartScale = scale + scale; trinketMultiplier = Entity_Player::GetTrinketMultiplier(sourcePlayer,0x86); } EntityList::QueryRadius((EntityList *)((int)this->_room + 0x1218),&entities,pos,radius,0xffffffff) ; local_8 = 0; source = (Entity *)0x0; if ((undefined1 *)entities._size != (undefined1 *)0x0) { do { pEVar4 = *(Entity **)((int)entities._data + (int)source * 4); if ((((pEVar4 != fartSource) && (pEVar4->_entityGridCollisionClass != 4)) && ((pEVar4->_mass != 0.0 && (bVar2 = Entity::IsVulnerableEnemy(pEVar4,(Entity *)0x0), bVar2 != 0)))) && (((pEVar4->_type != 1 || (fartSource == (Entity *)0x0)) || (bVar2 = Entity::IsDescendantOf(fartSource,pEVar4), bVar2 == 0)))) { EntityRef::constructor(&sourceRef,fartSource); Entity::AddPoison(pEVar4,&sourceRef,200,0.0,0); takeDamage = *(code **)(*(int *)pEVar4 + 0x20); EntityRef::constructor(&sourceRef,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; EntityRef::constructor(&sourceRef,fartSource); Entity::AddKnockback(pEVar4,&sourceRef,&knockback,0x12,0); } if (2 < multiplier) { EntityRef::constructor(&sourceRef,fartSource); Entity::AddConfusion(pEVar4,&sourceRef,0x5a,0); } } source = (Entity *)&source->field_0x1; } while (source < (uint)entities._size); } uVar3 = Random(); pEVar4 = Spawn(g_game,1000,0x22,pos,&g_vectorZero,fartSource,subType,uVar3); (**(code **)(*(int *)pEVar4 + 0x3c))(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) { SFXManager::Stop(&g_manager->_sfxManager,0x25); SoundEffects::Play(&g_manager->_sfxManager,0x25,1.0,0,0,1.0,0.0); SoundEffects::Play(&g_manager->_sfxManager,0x25,1.2,0x14,0,0.5,0.0); ShakeScreen(g_game,3); direction = extraout_ECX_00; } if ((fartSource != (Entity *)0x0) && (fartSource->_type == 1)) { Entity_Player::ShootCandle((Entity_Player *)fartSource,direction); } if (entities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapUsage = &g_allocatedBytesNoHeap; } else { heapUsage = (qword *)((int)g_mainHeap + 0x30); } if (entities._data != (void *)0x0) { uVar3 = *(uint *)((int)entities._data + -4); qVar1 = *heapUsage; *(uint *)heapUsage = (uint)*heapUsage - uVar3; *(uint *)((int)heapUsage + 4) = *(uint *)((int)heapUsage + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)entities._data + -4)); } } ExceptionList = local_10; return; } //@@ 00703f90 Game::CharmFart /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Game:CharmFart */ void Game::CharmFart(Vector *param_1,float param_2,Entity_Player *param_3) { qword qVar1; byte bVar2; Entity_Player *pEVar3; Entity *fartEffect; Vector *extraout_ECX; Vector *extraout_ECX_00; Vector *direction; qword *heapUsage; uint uVar4; float fVar5; EntityRef sourceRef; EntityList_EL entities; Vector knockback; float fartScale; Vector *position; 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; position = param_1; fartScale = 1.0; trinketMultiplier = 0; if (((param_3 == (Entity_Player *)0x0) || (pEVar3 = (Entity_Player *)Entity::GetPlayerAncestor((Entity *)param_3), pEVar3 == (Entity_Player *)0x0)) || (bVar2 = Entity_Player::HasTrinket(pEVar3,0x86,0), bVar2 == 0)) { } else { local_48 = param_2 + param_2; fartScale = 2.0; trinketMultiplier = Entity_Player::GetTrinketMultiplier(pEVar3,0x86); param_2 = local_48; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&entities,param_1,param_2,0xffffffff); uVar4 = 0; local_8 = 0; if (entities._size != 0) { do { pEVar3 = *(Entity_Player **)((int)entities._data + uVar4 * 4); if ((((pEVar3 != param_3) && (pEVar3->_entityGridCollisionClass != 4)) && ((pEVar3->_mass != 0.0 && (bVar2 = Entity::IsVulnerableEnemy((Entity *)pEVar3,(Entity *)0x0), bVar2 != 0)))) && (((pEVar3->_type != 1 || (param_3 == (Entity_Player *)0x0)) || (bVar2 = Entity::IsDescendantOf((Entity *)param_3,(Entity *)pEVar3), bVar2 == 0)))) { EntityRef::constructor(&sourceRef,(Entity *)param_3); Entity::AddCharmed((Entity *)pEVar3,&sourceRef,0x96,0,0); if (1 < trinketMultiplier) { local_48 = (pEVar3->_pos).y - position->y; pushDirX = (pEVar3->_pos).x - position->x; fVar5 = sqrtf(local_48 * local_48 + pushDirX * pushDirX); if (fVar5 <= 0.0) { knockback.y = local_48; knockback.x = pushDirX; } else { knockback.y = local_48 * (1.0 / fVar5); knockback.x = pushDirX * (1.0 / fVar5); } knockback.x = knockback.x * 8.0; knockback.y = knockback.y * 8.0; EntityRef::constructor(&sourceRef,(Entity *)param_3); Entity::AddKnockback((Entity *)pEVar3,&sourceRef,&knockback,0x12,0); } if (2 < trinketMultiplier) { EntityRef::constructor(&sourceRef,(Entity *)param_3); Entity::AddConfusion((Entity *)pEVar3,&sourceRef,0x5a,0); } } uVar4 = uVar4 + 1; } while (uVar4 < (uint)entities._size); } uVar4 = Random(); fartEffect = Spawn(g_game,1000,0x22,position,&g_vectorZero,(Entity *)0x0,0,uVar4); 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; (**(code **)(*(int *)fartEffect + 0x3c))(&charmColor,0xffffffff,0xff,0,1); fVar5 = fartScale * g_vectorOne.y; (fartEffect->_sprite)._scale.x = fartScale * g_vectorOne.x; (fartEffect->_sprite)._scale.y = fVar5; direction = extraout_ECX; if (1.8 < fartScale) { SFXManager::Stop(&g_manager->_sfxManager,0x25); SoundEffects::Play(&g_manager->_sfxManager,0x25,1.0,0,0,1.0,0.0); SoundEffects::Play(&g_manager->_sfxManager,0x25,1.2,0x14,0,0.5,0.0); ShakeScreen(g_game,3); direction = extraout_ECX_00; } if ((param_3 != (Entity_Player *)0x0) && (param_3->_type == 1)) { Entity_Player::ShootCandle(param_3,direction); } if (entities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapUsage = &g_allocatedBytesNoHeap; } else { heapUsage = (qword *)((int)g_mainHeap + 0x30); } if (entities._data != (void *)0x0) { uVar4 = *(uint *)((int)entities._data + -4); qVar1 = *heapUsage; *(uint *)heapUsage = (uint)*heapUsage - uVar4; *(uint *)((int)heapUsage + 4) = *(uint *)((int)heapUsage + 4) - (uint)((uint)qVar1 < uVar4); free((void *)((int)entities._data + -4)); } } ExceptionList = local_10; return; } //@@ 00704360 Game::ButterBeanFart /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Game:ButterBeanFart prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Game::ButterBeanFart (Game *this,Vector *pos,float radius,Entity *source,byte isShowEffect, byte isSuperKnockback) { byte bVar1; uint uVar2; Entity_Player *ownerPlayer; int trinketMult; uint seed; Entity *fartEffect; int trinketMult; EntityRef *emptyRef; Vector *pushDirection; Entity *unused; Entity *unused_00; float fVar4; float fVar5; double dVar6; Vector knockbackVec; EntityList_EL nearby; Vector victimPos; Vector pushDir; Vector deflectVelocity; Vector reflectVelocity; int i; int trinketMultiplier; float effectiveRadius; Vector *fartPos; float local_60; float fartScale; float dy; float dx; float local_50; float local_4c; char isPlayerSource; undefined4 local_44; EntityRef EStack_40; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Projectile *victim; local_8 = 0xffffffff; puStack_c = &LAB_00afc3f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; fartPos = pos; fartScale = 1.0; trinketMultiplier = 0; local_18 = uVar2; if (((source == (Entity *)0x0) || (ownerPlayer = (Entity_Player *)Entity::GetPlayerAncestor(source), ownerPlayer == (Entity_Player *)0x0)) || (bVar1 = Entity_Player::HasTrinket(ownerPlayer,0x86,0), bVar1 == 0)) { trinketMult = 0; effectiveRadius = radius; } else { effectiveRadius = radius + radius; fartScale = 2.0; trinketMult = Entity_Player::GetTrinketMultiplier(ownerPlayer,0x86); trinketMultiplier = trinketMult; } if (isShowEffect != 0) { seed = Random(); fartEffect = Spawn(g_game,1000,0x22,fartPos,&g_vectorZero,(Entity *)0x0,0,seed); EStack_40._velocity.y = 0.0; EStack_40._flags = 0; EStack_40._spawnerVariant = 0; EStack_40._position.x = 0.0; EStack_40._position.y = 0.0; EStack_40._velocity.x = 0.0; EStack_40._entity = (void *)0x0; local_44 = 0x3fe66666; EStack_40._type = 0x3f333333; EStack_40._variant = 0x3fc00000; EStack_40._spawnerType = 0x3f800000; (**(code **)(*(int *)fartEffect + 0x3c))(&local_44,0xffffffff,0xff,0,1,uVar2); fVar5 = fartScale * g_vectorOne.x; (fartEffect->_sprite)._scale.y = fartScale * g_vectorOne.y; (fartEffect->_sprite)._scale.x = fVar5; trinketMult = trinketMultiplier; } if (1.8 < fartScale) { SFXManager::Stop(&g_manager->_sfxManager,0x25); SoundEffects::Play(&g_manager->_sfxManager,0x25,1.0,0,0,1.0,0.0); SoundEffects::Play(&g_manager->_sfxManager,0x25,1.2,0x14,0,0.5,0.0); ShakeScreen(g_game,3); } EntityList::QueryRadius ((EntityList *)((int)this->_room + 0x1218),&nearby,fartPos,effectiveRadius,0xffffffff); local_8 = 0; i = 0; if (nearby._size != 0) { do { victim = *(Entity_Projectile **)((int)nearby._data + i * 4); if (victim->_type == 1) { if (source == (Entity *)0x0) goto LAB_007045a9; bVar1 = Entity::HasEntityFlags(source,0x20000000); if (bVar1 == 0) goto LAB_0070459f; } else { if (source == (Entity *)0x0) { LAB_007045a9: isPlayerSource = '\0'; } else { LAB_0070459f: isPlayerSource = '\x01'; if (source->_type != 1) goto LAB_007045a9; } bVar1 = Entity::IsVulnerableEnemy((Entity *)victim,(Entity *)0x0); if ((((((bVar1 != 0) || (trinketMult = victim->_type, trinketMult == 4)) || ((trinketMult == 5 || ((trinketMult == 9 && (isPlayerSource != '\0')))))) || ((1 < *(int *)&g_game->_deathmatchManager && ((trinketMult == 2 && (bVar1 = Entity::IsDescendantOf((Entity *)victim,source), bVar1 == 0)) )))) || ((isPlayerSource == '\0' && (victim->_type == 1)))) && (((victim != (Entity_Projectile *)source && (victim->_mass != 0.0)) && ((victim->_flags & 0x4000000) == 0)))) { local_4c = effectiveRadius + victim->_size; dx = (victim->_pos).x - fartPos->x; dy = (victim->_pos).y - fartPos->y; local_50 = dy * dy + dx * dx; local_60 = sqrtf(local_50); if (0.0 < local_60) { if (victim->_type == 9) { if ((source != (Entity *)0x0) && ((source->_type == 1 || (source->_type == 3)))) { fVar5 = (victim->_velocity).x; fVar4 = (victim->_velocity).y; if (local_60 <= 0.0) { reflectVelocity.x = dx; reflectVelocity.y = dy; Entity_Projectile::Reflect(victim,unused,&reflectVelocity); } else { fVar5 = sqrtf(fVar5 * fVar5 + fVar4 * fVar4); reflectVelocity.y = (fVar5 / local_60) * dy; reflectVelocity.x = (fVar5 / local_60) * dx; Entity_Projectile::Reflect(victim,unused_00,&reflectVelocity); } } } else if ((victim->_type == 2) && (trinketMult = __RTDynamicCast(victim,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor ), trinketMult != 0)) { if ((source != (Entity *)0x0) && ((source->_type == 1 || (source->_type == 3)))) { local_60 = (victim->_velocity).x; local_4c = (victim->_velocity).y; local_50 = sqrtf(local_50); if (local_50 <= 0.0) { deflectVelocity.x = dx; deflectVelocity.y = dy; Entity_Projectile::Deflect(victim,source,&deflectVelocity); } else { fVar5 = sqrtf(local_60 * local_60 + local_4c * local_4c); deflectVelocity.y = (fVar5 / local_50) * dy; deflectVelocity.x = (fVar5 / local_50) * dx; Entity_Projectile::Deflect(victim,source,&deflectVelocity); } } } else { local_50 = 7.0; if (local_4c - local_60 <= 7.0) { local_50 = local_4c - local_60; } local_50 = local_50 + local_50; if (1 < trinketMult) { local_50 = local_50 * 1.5; } if (2 < trinketMult) { EntityRef::constructor(&EStack_40,source); Entity::AddConfusion((Entity *)victim,&EStack_40,0x5a,0); } fVar5 = victim->_mass; if (fVar5 <= 20.0) { if (fVar5 <= 30.0) { fVar4 = local_50; if (50.0 < fVar5) { fVar4 = local_50 * 0.015; } } else { fVar4 = local_50 * 0.2; } } else { fVar4 = local_50 * 0.5; } (victim->_velocity).x = (dx / local_60) * fVar4 * fartScale + (victim->_velocity).x * 0.5; (victim->_velocity).y = (dy / local_60) * fVar4 * fartScale + (victim->_velocity).y * 0.5; bVar1 = Entity::IsVulnerableEnemy((Entity *)victim,(Entity *)0x0); if (((bVar1 != 0) && (isPlayerSource != '\0')) && (1.8 < fartScale)) { emptyRef = EntityRef::EntityRef(&EStack_40); (**(code **)(*(int *)victim + 0x20))(0x41200000,0,0,emptyRef); } if (((isSuperKnockback != 0) && (bVar1 = Entity::IsVulnerableEnemy((Entity *)victim,(Entity *)0x0), bVar1 != 0)) && ((0.0 < victim->_mass && ((bVar1 = Entity::HasEntityFlags((Entity *)victim,0x4000000), bVar1 == 0 && (bVar1 = Entity::HasEntityFlags((Entity *)victim,0x20000000), bVar1 == 0)))))) { victimPos.x = (victim->_pos).x; victimPos.y = (victim->_pos).y; Vector::__sub(&victimPos,&pushDir,fartPos); fVar5 = Vector::Length(&pushDir); local_4c = fVar5; Vector::__div_assign(&pushDir,&local_4c); if (source == (Entity *)0x0) { fVar4 = 12.0; } else { fVar4 = source->_size; } local_4c = assert_lerp_range((fVar5 - (fVar4 + victim->_size)) + victim->_mass,10.0, effectiveRadius,20.0,1.0,1); dVar6 = floor((double)local_4c); local_50 = (float)dVar6; local_4c = 16.0; pushDirection = Vector::__mul(&pushDir,&knockbackVec,&local_4c); EntityRef::constructor(&EStack_40,source); Entity::AddKnockback((Entity *)victim,&EStack_40,pushDirection,(int)local_50,1); } } } } } i = i + 1; trinketMult = trinketMultiplier; } while ((uint)i < (uint)nearby._size); } if (((source != (Entity *)0x0) && (source->_type == 1)) && (isShowEffect != 0)) { Entity_Player::ShootCandle((Entity_Player *)source,(Vector *)i); } EntityList_Query::~EntityList_Query(&nearby); ExceptionList = local_10; return; } //@@ 00704b10 Game::AddDevilRoomDeal /* ZHL [lua] Lua binding Game:AddDevilRoomDeal */ void __thiscall Game::AddDevilRoomDeal(Game *this) { this->_devilRoomDeals = this->_devilRoomDeals + 1; if (2 < this->_devilRoomDeals) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x4f); } return; } //@@ 00704b30 Game::DonateGreed /* ZHL [lua] Lua binding Game:DonateGreed */ void __thiscall Game::DonateGreed(Game *this,int param_2) { this->_donationModGreed = this->_donationModGreed + param_2; return; } //@@ 00704b40 Game::DonateAngel /* ZHL [lua] Lua binding Game:DonateAngel */ void __thiscall Game::DonateAngel(Game *this,int param_2) { this->_donationModAngel = this->_donationModAngel + param_2; return; } //@@ 00704b50 FUN_00704b50 void FUN_00704b50(void) { g_game->_reviveMachineCoinsLeft = g_game->_reviveMachineCoinsLeft + -1; return; } //@@ 00704b70 Game::RerollLevelCollectibles /* ZHL [lua] Lua binding Game:RerollLevelCollectibles */ void __thiscall Game::RerollLevelCollectibles(Game *this) { int iVar1; byte bVar2; int iVar3; std_vector *psVar4; void *pvVar5; int local_10; uint local_c; int local_8; local_10 = 0; if (0 < this->_nbRooms) { psVar4 = &this->_roomList[0].SavedEntities; do { pvVar5 = psVar4->_begin; local_c = 0; iVar3 = (int)psVar4->_end - (int)pvVar5; iVar1 = iVar3 >> 0x1f; if (iVar3 / 0x78 + iVar1 != iVar1) { local_8 = 0; do { if ((((*(int *)(local_8 + (int)pvVar5) == 5) && (*(int *)(local_8 + 4 + (int)pvVar5) == 100)) && (iVar1 = *(int *)(local_8 + 8 + (int)pvVar5), iVar1 != 0)) && (bVar2 = Entity_Pickup::CanRerollVariant(100,iVar1), bVar2 != 0)) { *(undefined4 *)(local_8 + 8 + (int)pvVar5) = 0; *(undefined1 *)(local_8 + 0x22 + (int)psVar4->_begin) = 0; pvVar5 = psVar4->_begin; } local_c = local_c + 1; local_8 = local_8 + 0x78; } while (local_c < (uint)(((int)psVar4->_end - (int)pvVar5) / 0x78)); } local_10 = local_10 + 1; psVar4 = (std_vector *)((int)(psVar4 + 0xf) + 4); } while (local_10 < this->_nbRooms); } return; } //@@ 00704c50 Game::RerollLevelPickups /* ZHL [lua] Lua binding Game:RerollLevelPickups */ void __thiscall Game::RerollLevelPickups(Game *this,uint param_2) { 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 = (int)savedEntities->_end - (int)pvVar5; pickupVariant = iVar4 >> 0x1f; if (iVar4 / 0x78 + pickupVariant != pickupVariant) { entityOffset = 0; LAB_00704ca2: if (((*(int *)((int)pvVar5 + entityOffset) == 5) && (pickupVariant = *(int *)((int)pvVar5 + entityOffset + 4), pickupVariant != 100)) && (bVar3 = Entity_Pickup::CanRerollVariant (pickupVariant,*(int *)((int)pvVar5 + entityOffset + 8)), bVar3 != 0)) { if (*(int *)((int)pvVar5 + entityOffset + 0x14) == 0) { rerollSeed = param_2; 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 ((((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar5 & 0xfffffffcU) < 0x59) || (iVar4 = *(int *)((int)pvVar5 + 0x58), iVar4 == 0)) || (bVar2 = true, (*(uint *)(iVar4 + 0xb8) & 0x80000000) == 0)) { bVar2 = false; } playerSlot = (g_game->_playerManager)._playerList._begin; if (playerSlot != (g_game->_playerManager)._playerList._end) { do { player = (Entity_Player *)*playerSlot; if (player->_variant == 0) { bVar3 = Entity_Player::HasTrinket(player,0x16,0); if (bVar3 != 0) goto LAB_00704e59; if (((bVar2) && (player->_backupPlayer != (Entity_Player *)0x0)) && (bVar3 = Entity_Player::HasTrinket(player->_backupPlayer,0x16,0), bVar3 != 0) ) goto LAB_00704e53; } playerSlot = playerSlot + 1; if (playerSlot == (game->_playerManager)._playerList._end) break; } while( true ); } } goto LAB_00704eb0; } *(undefined4 *)((int)pvVar5 + entityOffset + 4) = 0x96; goto LAB_00704ebe; } goto LAB_00704ec8; } LAB_00704ef7: roomIdx = roomIdx + 1; savedEntities = (std_vector *)((int)(savedEntities + 0xf) + 4); } while (roomIdx < this->_nbRooms); } return; LAB_00704e53: player = player->_backupPlayer; LAB_00704e59: if (player == (Entity_Player *)0x0) goto LAB_00704eb0; if (rerollSeed == 0) { KAGE_LogMessage(0x10,(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: *(int *)((int)savedEntities->_begin + entityOffset + 4) = pickupVariant; LAB_00704ebe: *(undefined4 *)((int)savedEntities->_begin + entityOffset + 8) = 0; LAB_00704ec8: pvVar5 = savedEntities->_begin; entityOffset = entityOffset + 0x78; entityIndex = entityIndex + 1; if ((uint)(((int)savedEntities->_end - (int)pvVar5) / 0x78) <= entityIndex) goto LAB_00704ef7; goto LAB_00704ca2; } //@@ 00704f20 Game::FinishChallenge /* ZHL [lua] Lua binding Game:FinishChallenge */ void __thiscall Game::FinishChallenge(Game *this) { float fVar1; Game *pGVar2; Manager *pMVar3; Manager *pMVar4; byte bVar5; int in_stack_ffffffbc; int unused2; KColor local_2c [2]; if ((this->_fadeOutColor)._alpha <= 0.0) { if (g_game->_challenge != 0) { bVar5 = Manager::IsGameplayInputActive((int)this); pMVar3 = g_manager; if (bVar5 == 0) { KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); pMVar4 = g_manager; pGVar2 = g_game; (pMVar3->_persistentGameData)._isReadOnly = 0; PersistentGameData::AddChallenge(&pMVar4->_persistentGameData,pGVar2->_challenge); pMVar3 = g_manager; in_stack_ffffffbc = 0x704fa0; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar3->_persistentGameData)._isReadOnly = 1; } } (g_manager->_achievementOverlay)._isPopupBlocked = 1; DeleteSaveState(); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { KColor::SetFromARGB(local_2c,0xff000000); this->_fadeOutTarget = 4; } else { unused2 = 0x704fd4; FUN_0090cd10(1,0); netplay_leave_lobby(&g_manager->_netplayManager,in_stack_ffffffbc,unused2); KColor::SetFromARGB(local_2c,0xff000000); this->_fadeOutTarget = 3; } fVar1 = (this->_fadeOutColor)._alpha; this->_fadeSpeed = 0.04; (this->_fadeOutColor)._red = local_2c[0]._red; (this->_fadeOutColor)._green = local_2c[0]._green; (this->_fadeOutColor)._blue = local_2c[0]._blue; (this->_fadeOutColor)._alpha = fVar1; (this->_fadeOutColor)._unk = 0; (this->_fadeOutColor)._alpha = (this->_fadeOutColor)._alpha + 0.04; } return; } //@@ 00705080 Game::AchievementUnlocksDisallowed /* ZHL [exact] __thiscall bool Game::AchievementUnlocksDisallowed(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Game::AchievementUnlocksDisallowed(Game *this) { byte bVar1; int unusedArg; if ((this->_seedEffects)._isCustomRun == 0) { bVar1 = Seeds::AchievementUnlocksDisallowed(&this->_seedEffects); if (bVar1 == 0) { bVar1 = Manager::IsGameplayInputActive(unusedArg); if ((bVar1 == 0) && (this->_isRerun == 0)) { return 0; } } } return 1; } //@@ 007050c0 Game::RerollEnemy /* ZHL [lua] Lua binding Game:RerollEnemy prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Game::RerollEnemy(Game *newNpc,Entity_NPC *npc,byte isIgnoreHealthMatch) { uint *puVar1; float fVar2; int iVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; qword qVar7; char cVar8; byte bVar9; void **pool; Entity_NPC *newNpc; undefined4 *puVar10; void *pvVar11; undefined4 *puVar12; uint uVar13; undefined4 *poolEntry; float fVar14; float fVar15; 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 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &DAT_00afc42d; local_1c = ExceptionList; ExceptionList = &local_1c; if ((npc != (Entity_NPC *)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (npc->_type == 1)) || (npc->_type - 10U < 0x3de)) )) { self = newNpc; cVar8 = Entity_NPC::CanReroll(npc,__security_cookie ^ (int)register0x00000010 - 0x10U); if (cVar8 != '\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 **)&g_manager->field_0x2a6b4; } else { pool = (void **)&g_manager->field_0x2a6a8; } puVar12 = (undefined4 *)0x0; local_28.y = (float)pool; local_38 = (undefined4 *)0x0; puVar10 = (undefined4 *)0x0; filteredBegin = (void *)0x0; filteredEnd = (undefined4 *)0x0; filteredCapacity = (undefined4 *)0x0; local_14 = 0; fVar2 = *(float *)((int)npc->_config + 0x54); local_30.y = *(float *)((int)npc->_config + 0x50); if (fVar2 <= 0.001) { } else { fVar14 = (float)g_game->_stage; if (10.0 <= fVar14) { fVar14 = 10.0; } if (g_game->_stage < 5) { fVar15 = 1.0; } else { fVar15 = 0.8; } local_30.y = fVar15 * fVar14 * fVar2 + local_30.y; } poolEntry = *pool; if (poolEntry != pool[1]) { do { if (isIgnoreHealthMatch == 0) { fVar2 = (float)poolEntry[4]; fVar14 = (float)poolEntry[3]; if (0.001 < fVar2) { fVar15 = (float)g_game->_stage; if (10.0 <= fVar15) { fVar15 = 10.0; } if (g_game->_stage < 5) { fVar14 = fVar15 * 1.0 * fVar2 + fVar14; } else { fVar14 = fVar15 * 0.8 * fVar2 + fVar14; } } if (ABS(local_30.y - fVar14) <= 5.0) goto LAB_007052ae; } else { LAB_007052ae: if (puVar10 == puVar12) { std::vector<20byte>::_Emplace_reallocate(puVar10,poolEntry); puVar10 = filteredEnd; puVar12 = filteredCapacity; } else { uVar4 = poolEntry[1]; uVar5 = poolEntry[2]; uVar6 = poolEntry[3]; *puVar10 = *poolEntry; puVar10[1] = uVar4; puVar10[2] = uVar5; puVar10[3] = uVar6; puVar10[4] = poolEntry[4]; filteredEnd = puVar10 + 5; puVar10 = puVar10 + 5; } } poolEntry = poolEntry + 5; } while (poolEntry != pool[1]); local_38 = puVar12; } filteredData = filteredBegin; iVar3 = (int)puVar10 - (int)filteredBegin >> 0x1f; pool = &filteredBegin; if (((int)puVar10 - (int)filteredBegin) / 0x14 + iVar3 == iVar3) { pool = (void **)local_28.y; } pvVar11 = *pool; local_28.y = (float)(((int)pool[1] - (int)pvVar11) / 0x14); local_30.y = (float)pvVar11; if (local_28.y == 0.0) { uVar13 = 0; } else { uVar13 = Random(); pvVar11 = *pool; uVar13 = uVar13 % (uint)local_28.y; } puVar1 = (uint *)((int)pvVar11 + uVar13 * 0x14); newType = *puVar1; newVariant = puVar1[1]; uStack_58 = puVar1[2]; uStack_54 = puVar1[3]; local_50 = *(undefined4 *)((int)pvVar11 + uVar13 * 0x14 + 0x10); Entity_NPC::Redirect((int *)&newType,(int *)&newVariant); uVar13 = 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,(Entity *)0x0,0,uVar13); if (-1 < championColor) { Entity_NPC::Morph(newNpc,newNpc->_type,newNpc->_variant,newNpc->_subtype,championColor); } qVar7 = newNpc->_flags; puVar1 = (uint *)((int)&newNpc->_flags + 4); *puVar1 = *puVar1 | 0x80; *(int *)&newNpc->_flags = (int)qVar7; (**(code **)(*(int *)newNpc + 0xc))(); newNpc->_health = healthFraction * newNpc->_maxHitPoints; (**(code **)(*(int *)npc + 0x28))(); if (filteredData != (void *)0x0) { uVar13 = (((int)local_38 - (int)filteredData) / 0x14) * 0x14; pvVar11 = filteredData; if (0xfff < uVar13) { pvVar11 = *(void **)((int)filteredData + -4); uVar13 = uVar13 + 0x23; if (0x1f < (uint)((int)filteredData + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar13); } bVar9 = 1; goto LAB_00705462; } } bVar9 = 0; LAB_00705462: ExceptionList = local_1c; return bVar9; } //@@ 00705480 Game::DevolveEnemy /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static void Game::DevolveEnemy(Entity* ent, int* unk); prototype: db/protos.zhl, confirmed by RET 8 */ byte Game::DevolveEnemy(Entity *entity,Entity **outEntity) { void *pvVar1; code *pcVar2; char cVar3; byte isDevolvedFlying; uint *puVar5; Entity *poofEffect; EntityConfig_Entity *devolvedConfig; float *reachablePos; Entity_NPC *devolved; byte *gridCollisionClass; int *extraout_ECX; std_string *devolvedGridCollisionClass; undefined4 extraout_ECX_00; uint uVar6; int iVar7; int iVar8; float fVar9; 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 ^ (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 = *(int *)((int)pvVar1 + 0xa4); scratchVec.y = (float)((int)pvVar1 + 0xa4); if ((iVar8 != *(int *)((int)pvVar1 + 0xa8)) && (entity->_type != 0x19c)) { healthFraction = 1.0; championColor = -1; isDevolvedFlying = Entity::IsEnemy(entity); fVar9 = 0.0; local_1c = 0.0; if (isDevolvedFlying != 0) { championColor = *(int *)&entity[3].field_0x40; 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 = *(int *)((int)game->_room + 4); if (iVar7 == 0) { local_20 = 0; } else { local_20 = *(uint *)(iVar7 + 0x58); } local_40.y = 3.78351e-44; local_10.y = (float)((int)pvVar1 + 0xa8); if (iVar8 != *(int *)local_10.y) { do { fVar9 = fVar9 + *(float *)(iVar8 + 8); iVar8 = iVar8 + 0xc; } while (iVar8 != *(int *)local_10.y); local_1c = fVar9; } gridCollisionClass = (byte *)((int)pvVar1 + 0xb4); if (0xf < *(uint *)((int)pvVar1 + 200)) { gridCollisionClass = *(byte **)gridCollisionClass; } fVar9 = local_1c; isDevolvedFlying = str_eq(gridCollisionClass,*(uint *)((int)pvVar1 + 0xc4),(byte *)"ground",6); if ((isDevolvedFlying == 0) && ((*(int *)((int)pvVar1 + 0xc4) != 0 || (*(int *)((int)pvVar1 + 0x48) < 1)))) { isFlying = '\x01'; } else { isFlying = '\0'; } if (local_20 == 0) { KAGE_LogMessage(0x10,(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)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 * fVar9; for (puVar5 = *(uint **)scratchVec.y; puVar5 != *(uint **)local_10.y; puVar5 = puVar5 + 3) { if (fVar9 < (float)puVar5[2]) { uVar6 = *puVar5; if (999 < (int)uVar6) { pvVar1 = game->_room; iVar8 = (int)(((entity->_pos).x - 40.0) / 40.0 + 0.5); if ((((iVar8 < 0) || (*(int *)((int)pvVar1 + 0xc) <= iVar8)) || (iVar7 = (int)(((entity->_pos).y - 120.0) / 40.0 + 0.5), iVar7 < 0)) || (*(int *)((int)pvVar1 + 0x10) <= iVar7)) { iVar8 = -1; } else { iVar8 = iVar7 * *(int *)((int)pvVar1 + 0xc) + iVar8; if (iVar8 != -1) { local_10.x = (float)CONCAT22(local_10.x._2_2_,(short)puVar5[1]); entryType = uVar6; Random(); Room::SpawnEntry(); } } if ((-1 < entity->_spawnGridIndex) && (cVar3 = Room::IsPersistentRoomEntity (entity->_type,entity->_variant,entity->_spawnGridIndex), cVar3 != '\0')) { local_10.y = (float)extraout_ECX; std::set::insert(&scratchVec,&local_10.y); } (**(code **)(*(int *)entity + 0x28))(); uVar6 = Random(); iVar7 = *(int *)((int)game->_room + 0xc); local_10.x = (float)(iVar8 % iVar7) * 40.0 + 40.0; local_10.y = (float)(iVar8 / iVar7) * 40.0 + 120.0; poofEffect = Spawn(g_game,1000,0xf,&local_10,&g_vectorZero,(Entity *)0x0,0,uVar6); (**(code **)(*(int *)poofEffect + 0xc))(); if (savedOutEntity == (Entity **)0x0) { return 1; } *savedOutEntity = poofEffect; return 1; } if (uVar6 == 0) { return 0; } local_1c = (float)(uint)(ushort)puVar5[1]; devolvedSubtype = *(ushort *)((int)puVar5 + 6); if (uVar6 == 999) { uVar6 = 1000; } local_20 = uVar6; local_10.y = (float)(uint)devolvedSubtype; Entity_NPC::Redirect((int *)&local_20,(int *)&local_1c); devolvedConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,local_20,(int)local_1c,(uint)devolvedSubtype); if (devolvedConfig != (EntityConfig_Entity *)0x0) { devolvedGridCollisionClass = &devolvedConfig->gridCollisionClassString; if (0xf < (devolvedConfig->gridCollisionClassString)._capacity) { devolvedGridCollisionClass = *(std_string **)devolvedGridCollisionClass->_buf; } isDevolvedFlying = str_eq((byte *)devolvedGridCollisionClass, (devolvedConfig->gridCollisionClassString)._size,(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 = FUN_00823be0(&scratchVec,0,0); if (cVar3 == '\0') { scratchVec.x = (entity->_pos).x; scratchVec.y = (entity->_pos).y; reachablePos = (float *)Room::find_reachable_position (savedGame->_room,&local_40,&scratchVec, extraout_ECX_00); (entity->_pos).x = *reachablePos; (entity->_pos).y = reachablePos[1]; (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,(uint)local_1c,&local_40,&scratchVec,(Entity *)0x0, (uint)local_10.y,uVar6); isDevolvedFlying = Entity::IsEnemy((Entity *)devolved); if (isDevolvedFlying != 0) { if (-1 < championColor) { Entity_NPC::Morph(devolved,devolved->_type,devolved->_variant,devolved->_subtype, championColor); } fVar9 = devolved->_maxHitPoints; flags = devolved->_flags; puVar5 = (uint *)((int)&devolved->_flags + 4); *puVar5 = *puVar5 | 0x80; *(int *)&devolved->_flags = (int)flags; devolved->_health = healthFraction * fVar9; } (**(code **)(*(int *)devolved + 0xc))(); devolved->_spawnGridIndex = entity->_spawnGridIndex; if (savedOutEntity != (Entity **)0x0) { *savedOutEntity = (Entity *)devolved; } (**(code **)(*(int *)entity + 0x28))(); return 1; } fVar9 = fVar9 - (float)puVar5[2]; } } } } return 0; } //@@ 007059f0 Game::ShowHallucination /* ZHL [lua] Lua binding Game:ShowHallucination */ void __thiscall Game::ShowHallucination(Game *this,int param_2,int param_3) { int *piVar1; Game *pGVar2; Manager *pMVar3; uint uVar4; int iVar5; void *pvVar6; int local_10; Game *local_c; pMVar3 = g_manager; local_10 = 0x21; if (param_3 < 1) { param_3 = 0; } iVar5 = 0x3f; if (param_3 < 0x3f) { iVar5 = param_3; } this->_hallucinationDuration = param_2; this->_hallucinationTimer = param_2; local_c = this; seed_fart_sound_override(&local_10); SoundEffects::Play(&pMVar3->_sfxManager,local_10,3.0,2,0,0.5,0.0); if (((iVar5 != 0) && (pvVar6 = this->_room, *(int *)((int)pvVar6 + 0x1d18) != 0x12)) && (*(int *)((int)g_game->_room + 8) != 0x10)) { if (iVar5 == 0x3f) { uVar4 = Random(); iVar5 = *(int *)(&DAT_00b67fb0 + (uVar4 & 0xf) * 4); pvVar6 = local_c->_room; } uVar4 = 0; if (*(int *)((int)pvVar6 + 0x1264) != 0) { do { piVar1 = *(int **)(*(int *)((int)pvVar6 + 0x125c) + uVar4 * 4); if ((piVar1[0x5b] & 0x40U) != 0) { (**(code **)(*piVar1 + 0x28))(); } uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)pvVar6 + 0x1264)); pvVar6 = local_c->_room; } pGVar2 = g_game; if ((iVar5 < 0) || (0x3e < iVar5)) { iVar5 = 1; } *(int *)((int)pvVar6 + 0x1d18) = iVar5; *(undefined4 *)((int)pvVar6 + 0x6ae0) = 0x42500000; *(undefined4 *)((int)pvVar6 + 0x6ae4) = 0x42500000; iVar5 = *(int *)((int)pGVar2->_room + 0x10); *(float *)((int)pvVar6 + 0x6ae8) = (float)(*(int *)((int)pGVar2->_room + 0xc) + -2) * 26.0 + 52.0; *(float *)((int)pvVar6 + 0x6aec) = (float)(iVar5 + -2) * 26.0 + 52.0; Backdrop::load_details((Backdrop *)((int)pvVar6 + 0x1bc8)); } return; } //@@ 00705b90 Game::AttractEntities /* DB: loops room entities in radius, pulls velocity toward pos with optional filter callback; Game::UpdateStrangeAttractor(pos,0,0) prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Game::AttractEntities (Game *this,Vector *position,void *filter,void *filterData,float strength,float radius) { void *pvVar1; int iVar2; byte bVar3; char cVar4; uint uVar5; int iVar6; int extraout_EDX; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af6e50; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar1 = this->_room; local_20 = 0; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { iVar2 = *(int *)(*(int *)((int)pvVar1 + 0x125c) + local_20 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)(iVar2 + 0x28) != 1)) { iVar6 = *(int *)(iVar2 + 0x28); if (iVar6 - 10U < 0x3de) goto LAB_00705c22; LAB_00705c79: if (iVar6 == 5) goto LAB_00705c84; } else { iVar6 = 1; LAB_00705c22: if ((((*(int *)(iVar2 + 0x188) == 1) || (*(int *)(iVar2 + 0x188) == 0)) || (*(char *)(iVar2 + 0x3b0) != '\0')) || ((*(char *)(iVar2 + 0x173) != '\0' || (((((*(uint *)(iVar2 + 0x168) & 0x10) != 0 && (iVar6 != 0x322)) && (iVar6 != 0x362)) || ((*(uint *)(iVar2 + 0x168) & 0x20000000) != 0)))))) goto LAB_00705c79; LAB_00705c84: if (((iVar6 != 5) || ((iVar6 = __RTDynamicCast(iVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0, uVar5), *(int *)(iVar6 + 0x534) == 0 && ((bVar3 = Entity_Pickup::IsChest(*(int *)(iVar6 + 0x2c)), bVar3 == 0 || (*(int *)(extraout_EDX + 0x30) != 0)))))) && ((filter == (void *)0x0 || (cVar4 = (*filter)(iVar2,filterData), cVar4 != '\0')))) { fVar9 = position->y - *(float *)(iVar2 + 0x340); fVar7 = position->x - *(float *)(iVar2 + 0x33c); fVar11 = fVar9 * fVar9 + fVar7 * fVar7; if (fVar11 < radius * radius) { fVar8 = sqrtf(fVar11); fVar11 = 5.0; if (5.0 <= fVar8) { fVar11 = fVar8; } if (0.0 < fVar8) { fVar9 = fVar9 * (1.0 / fVar8); fVar7 = fVar7 * (1.0 / fVar8); } if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar2 + 0x28) == 1)) || (fVar8 = strength, *(int *)(iVar2 + 0x28) - 10U < 0x3de)) { fVar8 = strength * 4.0; } if (10.0 <= fVar11) { fVar10 = *(float *)(iVar2 + 0x36c); if (fVar10 != 0.0) { fVar9 = (*(float *)(iVar2 + 0x39c) * (fVar8 / fVar11) * fVar9) / fVar10; fVar8 = (*(float *)(iVar2 + 0x39c) * (fVar8 / fVar11) * fVar7) / fVar10 + *(float *)(iVar2 + 0x360); goto LAB_00705e92; } } else { fVar8 = *(float *)(iVar2 + 0x39c); if (fVar8 == 1.0) { fVar10 = 0.9; } else { fVar10 = 0.9 / ((fVar8 + 0.9) - fVar8 * 0.9); } fVar8 = *(float *)(iVar2 + 0x360) * fVar10; *(float *)(iVar2 + 0x364) = *(float *)(iVar2 + 0x364) * fVar10; *(float *)(iVar2 + 0x360) = fVar8; fVar10 = *(float *)(iVar2 + 0x36c); if (fVar10 != 0.0) { fVar9 = (*(float *)(iVar2 + 0x39c) * (fVar11 / 100.0) * fVar9) / fVar10; fVar8 = (*(float *)(iVar2 + 0x39c) * (fVar11 / 100.0) * fVar7) / fVar10 + fVar8; LAB_00705e92: *(float *)(iVar2 + 0x364) = fVar9 + *(float *)(iVar2 + 0x364); *(float *)(iVar2 + 0x360) = fVar8; } } } } } local_20 = local_20 + 1; } while (local_20 < *(uint *)((int)pvVar1 + 0x1264)); } ExceptionList = local_10; return; } //@@ 00705ee0 Game::save_rewind_state /* DB: ? two 0x8198-stride state slots, frame<15 guard; room/stage transition, door callers prototype: db/protos.zhl, confirmed by RET 4 */ void Game::save_rewind_state(int leaveDoor) { undefined4 uVar1; bool bVar2; Game *this; Manager *pMVar3; GlowingHourglassState *pGVar4; int *piVar5; int iVar6; int *piVar7; int iVar8; this = g_game; if (((g_game->_isStoringGlowingHourglassState == 0) && (g_game->_isRestoringGlowingHourglassState == 0)) && (g_game->_isPocketItemRewindSaved == 0)) { iVar8 = g_game->_currentGlowingHourglassSlot; bVar2 = false; iVar6 = 0; if ((-1 < iVar8) && (pGVar4 = g_game->_glowingHourglassStates + iVar8, pGVar4->_isUsable != 0)) { if ((*(int *)&(pGVar4->_gameState).field_0x19d1c == g_game->_currentRoomIdx) && (*(int *)&(pGVar4->_gameState).field_0xe4 == g_game->_stage)) { bVar2 = true; iVar6 = iVar8; if (-1 < leaveDoor) { if (leaveDoor == pGVar4->_leaveDoor) { return; } if ((-1 < pGVar4->_leaveDoor) && ((uint)(g_game->_frameCount - pGVar4->_timeCounter) < 0xf)) { return; } } } else { iVar6 = 1 - iVar8; *(int *)&(pGVar4->_gameState).field_0x19d50 = g_game->_leaveDoor; } } this->_currentGlowingHourglassSlot = iVar6; this->_isStoringGlowingHourglassState = 1; pGVar4 = this->_glowingHourglassStates + iVar6; uVar1 = *(undefined4 *)&(pGVar4->_gameState).field_0x44; store_game_state(this,&pGVar4->_gameState); if (bVar2) { *(undefined4 *)&(pGVar4->_gameState).field_0x44 = uVar1; } pMVar3 = g_manager; piVar5 = pGVar4->_eventCounters; pGVar4->_isUsable = 1; piVar7 = (pMVar3->_persistentGameData)._eventCounters; pGVar4->_leaveDoor = leaveDoor; pGVar4->_timeCounter = this->_frameCount; iVar8 = 0x20b; do { iVar6 = *piVar7; piVar7 = piVar7 + 1; *piVar5 = iVar6; piVar5 = piVar5 + 1; iVar8 = iVar8 + -1; } while (iVar8 != 0); this->_isStoringGlowingHourglassState = 0; } return; } //@@ 00706020 Game::rewind /* DB: ? Glowing Hourglass style restore: Level::GetRoomByIdx current room, Room::Update, TryDecreaseGlowingHourglassUses, RemoveCoPlayer, IncreaseEventCounter; called from the console command handler 0068cdc0 Console::RunCommand 00830950 prototype: db/protos.zhl, confirmed by RET 4 */ 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; 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; void **roomPtr2; GlowingHourglassState *savedState; local_8 = 0xffffffff; puStack_c = &LAB_00afc45d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; local_30 = g_game; iVar6 = g_game->_currentGlowingHourglassSlot; if (iVar6 < 0) { return; } hourglassState = (GlowingHourglassState *)((int)g_game + iVar6 * -0x20660 + 0x4704c); bVar8 = hourglassState->_isUsable; if (bVar8 == 0) { hourglassState = g_game->_glowingHourglassStates + iVar6; bVar8 = hourglassState->_isUsable; } local_2c = (GlowingHourglassState *)0x0; if (bVar8 != 0) { local_2c = hourglassState; } if (local_2c == (GlowingHourglassState *)0x0) { return; } roomPtr = &g_game->_room; hourglassWispCount = (PlayerManager *)0x0; local_28 = *roomPtr; local_1c = (int *)0x0; local_24 = *(uint *)((int)local_28 + 0x1264) - 1; ExceptionList = &local_10; if (local_24 < *(uint *)((int)local_28 + 0x1264)) { game = g_game; do { pEVar5 = *(Entity_Player **)(*(int *)((int)local_28 + 0x125c) + local_24 * 4); iVar6 = pEVar5->_type; if ((pEVar5 == (Entity_Player *)0x0) || (iVar6 != 3)) { local_1c = &pEVar5->_type; local_20 = hourglassWispCount; if ((iVar6 == 3) || ((((1 < *(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 = (PlayerManager *)((int)hourglassWispCount + 1); } local_20 = hourglassWispCount; LAB_00706148: hourglassWispCount = local_20; local_1c = &pEVar5->_type; (**(code **)(*(int *)pEVar5 + 0x44))(uVar4); pvVar7 = g_game->_room; EntityList_EL::remove((EntityList_EL *)((int)pvVar7 + 0x1238),(Entity *)pEVar5); EntityList_EL::remove((EntityList_EL *)((int)pvVar7 + 0x1258),(Entity *)pEVar5); EntityList_EL::remove((EntityList_EL *)((int)pvVar7 + 0x1248),(Entity *)pEVar5); EntityList_EL::remove((EntityList_EL *)((int)pvVar7 + 0x1268),(Entity *)pEVar5); EntityList_EL::remove((EntityList_EL *)((int)pvVar7 + 0x12a8),(Entity *)pEVar5); pEVar5->_valid = 0; EntityList::invalidate_type_cache ((EntityList *)((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)) { PlayerManager::RemoveCoPlayer(&game->_playerManager,pEVar5,(byte)&game->_playerManager); game = g_game; } local_24 = local_24 - 1; } while (local_24 < *(uint *)((int)local_28 + 0x1264)); local_1c = (int *)pPVar3; } hourglassState = local_2c; game = local_30; local_24 = 0; local_38.y = 0.0; if (player != (Entity_Player *)0x0) { local_24 = player->_effectiveSoulCharge; local_38.y = (float)player->_effectiveBloodCharge; } if ((*(int *)&(local_2c->_gameState).field_0xe4 != local_30->_stage) || (local_28 = (void *)((uint)local_28 & 0xffffff00), *(int *)&(local_2c->_gameState).field_0xe8 != local_30->_stageType)) { local_28 = (void *)CONCAT31(local_28._1_3_,1); } local_3c = local_30->_rewindsThisFloor; local_20 = (PlayerManager *)Level::GetRoomByIdx((Level *)local_30,local_30->_currentRoomIdx,-1); if ((*(int *)((int)((RoomDescriptor *)local_20)->Data + 8) == 4) && (((RoomDescriptor *)local_20)->VisitedCount == 1)) { pEVar5 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x19e,(RNG **)&g_game->_playerManager,1); isHasMoreOptions = pEVar5 != (Entity_Player *)0x0; if ((((g_game->_stage == 10) && ((((g_game->_stageType == 0 && (pEVar5 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xa1), pEVar5 != (Entity_Player *)0x0)) && (iVar6 = Entity_Player::GetTrinketMultiplier(pEVar5,0xa1), 1 < iVar6)) || (((g_game->_stage == 10 && (g_game->_stageType == 1)) && ((pEVar5 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x9b), pEVar5 != (Entity_Player *)0x0 && (iVar6 = Entity_Player::GetTrinketMultiplier(pEVar5,0x9b), 1 < iVar6)))))))) || ((((g_game->_stage == 7 || (g_game->_stage == 8)) && (pEVar5 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x6f), pEVar5 != (Entity_Player *)0x0)) && (iVar6 = Entity_Player::GetTrinketMultiplier(pEVar5,0x6f), 1 < iVar6)))) || (isHasMoreOptions != '\0')) { *(undefined4 *)((int)*(void **)((int)local_20 + 0x10) + 0x34) = 0x3f800000; } } game->_isRestoringGlowingHourglassState = 1; restore_game_state(game,&hourglassState->_gameState,0); local_20 = &game->_playerManager; 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 = *(int *)((int)savedState->_eventCounters + (uVar4 - 700)); iVar2 = *(int *)((g_manager->_persistentGameData)._achievements + (uVar4 - 0x38)); if (iVar2 != iVar1) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,iVar6,iVar1 - iVar2); } piVar12 = local_1c; uVar4 = uVar4 + 4; iVar6 = iVar6 + 1; } while (uVar4 < 0xae8); local_30->_rewindsThisFloor = local_3c + 1; if (player != (Entity_Player *)0x0) { local_30 = (Game *)CONCAT31((int3)(local_3c + 1 >> 8),1); playerQueueProxy = (int *)0x0; local_2c = (GlowingHourglassState *)CONCAT31(local_2c._1_3_,1); playerQueueMap = (void *)0x0; playerQueueMapSize = 0; playerQueueOffset = 0; playerQueueSize = 0; playerQueueProxy = operator_new(8); playerQueueProxy[1] = 0; *playerQueueProxy = (int)&playerQueueProxy; local_8 = 0; pvVar7 = (local_20->_playerList)._end; playerIt = (local_20->_playerList)._begin; iVar6 = playerQueueSize; if ((int)pvVar7 - (int)playerIt >> 2 != 0) { uVar4 = 0; do { if ((int)pvVar7 - (int)playerIt >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (local_20->_playerList)._end; playerIt = (local_20->_playerList)._begin; iVar6 = playerQueueSize; } if (uVar4 < (uint)((int)pvVar7 - (int)playerIt >> 2)) { playerIt = playerIt + uVar4; } iVar1 = *playerIt; iVar2 = playerQueueSize; if ((*(int *)(iVar1 + 0x2c) == 0) && (*(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 (*(int *)((int)playerQueueMap + uVar10 * 4) == 0) { pvVar7 = operator_new(0x10); *(void **)((int)playerQueueMap + uVar10 * 4) = pvVar7; } *(int *)(*(int *)((int)playerQueueMap + uVar10 * 4) + (local_3c & 3) * 4) = iVar1; iVar6 = playerQueueSize + 1; local_3c = *(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 (*(int *)((int)playerQueueMap + uVar11 * 4) == 0) { pvVar7 = operator_new(0x10); *(void **)((int)playerQueueMap + uVar11 * 4) = pvVar7; } *(uint *)(*(int *)((int)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 < (uint)((int)pvVar7 - (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 **) (*(int *)((int)playerQueueMap + (playerQueueMapSize - 1 & uVar4) * 4) + uVar10 * 4 ),(int)local_2c,(byte)local_28); local_30 = (Game *)((uint)local_30 & 0xff); if (extraout_AL != '\0') { local_30 = (Game *)0x0; } local_2c = (GlowingHourglassState *)CONCAT31(local_2c._1_3_,(char)local_30); iVar6 = playerQueueSize; } player->_effectiveSoulCharge = local_24; player->_effectiveBloodCharge = (int)local_38.y; iVar6 = 0; if (0 < (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 = (int *)((int)piVar12 + -1); } while (piVar12 != (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 **)((int)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 **)((int)pvVar7 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar4); } piVar12 = playerQueueProxy; playerQueueMapSize = 0; playerQueueMap = (void *)0x0; playerQueueProxy = (int *)0x0; operator_delete(piVar12,8); } roomPtr2 = roomPtr; uVar4 = 0; pvVar7 = *roomPtr; if (*(int *)((int)pvVar7 + 0x1264) != 0) { do { (**(code **)(**(int **)(*(int *)((int)pvVar7 + 0x125c) + uVar4 * 4) + 0x2c))(); uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)pvVar7 + 0x1264)); } PlayerManager::enter_level(local_20); PlayerManager::trigger_new_room_effects(local_20); pvVar7 = *roomPtr2; uVar4 = 0; if (*(int *)((int)pvVar7 + 0x1264) != 0) { do { (**(code **)(**(int **)(*(int *)((int)pvVar7 + 0x125c) + uVar4 * 4) + 0x30))(); uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)pvVar7 + 0x1264)); } Room::Update(); ExceptionList = local_10; return; } //@@ 00706780 Game::GetGlowingHourglassState /* ZHL [exact] __thiscall GlowingHourglassState* Game::GetGlowingHourglassState(); prototype: REPENTOGON, confirmed by RET 0 */ GlowingHourglassState * __thiscall Game::GetGlowingHourglassState(Game *this) { int iVar1; GlowingHourglassState *pGVar2; GlowingHourglassState *pGVar3; byte bVar4; iVar1 = this->_currentGlowingHourglassSlot; if (iVar1 < 0) { return (GlowingHourglassState *)0x0; } pGVar3 = (GlowingHourglassState *)((int)this + iVar1 * -0x20660 + 0x4704c); bVar4 = pGVar3->_isUsable; if (bVar4 == 0) { pGVar3 = this->_glowingHourglassStates + iVar1; bVar4 = pGVar3->_isUsable; } pGVar2 = (GlowingHourglassState *)0x0; if (bVar4 != 0) { pGVar2 = pGVar3; } return pGVar2; } //@@ 007067c0 Game::SetColorModifier /* ZHL [exact] __thiscall void Game::SetColorModifier(ColorModState* color, bool lerp, float rate); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Game::SetColorModifier(Game *this,ColorModState *color,byte lerp,float rate) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; Game *pGVar11; pGVar11 = g_game; fVar1 = color->_green; fVar2 = color->_blue; fVar3 = color->_amount; (g_game->_targetColorModifier)._red = color->_red; (pGVar11->_targetColorModifier)._green = fVar1; (pGVar11->_targetColorModifier)._blue = fVar2; (pGVar11->_targetColorModifier)._amount = fVar3; fVar1 = color->_contrast; (pGVar11->_targetColorModifier)._brightness = color->_brightness; (pGVar11->_targetColorModifier)._contrast = fVar1; if (lerp == 0) { fVar1 = (pGVar11->_targetColorModifier)._green; fVar2 = (pGVar11->_targetColorModifier)._blue; fVar3 = (pGVar11->_targetColorModifier)._amount; (pGVar11->_currentColorModifier)._red = (pGVar11->_targetColorModifier)._red; (pGVar11->_currentColorModifier)._green = fVar1; (pGVar11->_currentColorModifier)._blue = fVar2; (pGVar11->_currentColorModifier)._amount = fVar3; fVar1 = (pGVar11->_targetColorModifier)._contrast; (pGVar11->_currentColorModifier)._brightness = (pGVar11->_targetColorModifier)._brightness; (pGVar11->_currentColorModifier)._contrast = fVar1; pGVar11->_shouldLerpColorModState = 0; return; } fVar1 = (pGVar11->_targetColorModifier)._contrast; fVar2 = (pGVar11->_targetColorModifier)._brightness; fVar3 = (pGVar11->_targetColorModifier)._amount; fVar4 = (pGVar11->_targetColorModifier)._blue; fVar5 = (pGVar11->_targetColorModifier)._red; fVar6 = (pGVar11->_currentColorModifier)._contrast; fVar7 = (pGVar11->_currentColorModifier)._brightness; fVar8 = (pGVar11->_currentColorModifier)._amount; fVar9 = (pGVar11->_currentColorModifier)._blue; fVar10 = (pGVar11->_currentColorModifier)._red; (pGVar11->_lerpColorModifier)._green = ABS((pGVar11->_targetColorModifier)._green - (pGVar11->_currentColorModifier)._green) * rate; (pGVar11->_lerpColorModifier)._blue = ABS(fVar4 - fVar9) * rate; (pGVar11->_lerpColorModifier)._red = ABS(fVar5 - fVar10) * rate; (pGVar11->_lerpColorModifier)._amount = ABS(fVar3 - fVar8) * rate; (pGVar11->_lerpColorModifier)._brightness = ABS(fVar2 - fVar7) * rate; (pGVar11->_lerpColorModifier)._contrast = ABS(fVar1 - fVar6) * rate; pGVar11->_shouldLerpColorModState = 1; return; } //@@ 007068f0 FUN_007068f0 void FUN_007068f0(int param_1) { int in_ECX; int iVar1; iVar1 = ((int)(g_manager->_challengeParams)._end - (int)(g_manager->_challengeParams)._begin) / 0xa4 + -1; if (param_1 < 1) { param_1 = 0; } if (param_1 < iVar1) { iVar1 = param_1; } *(int *)(in_ECX + 0x26584) = iVar1; return; } //@@ 00706940 Game::GetChallengeParams /* DB: returns Game+0x26640 daily params if _dailyChallenge else Manager table[Game::_challenge] prototype: REPENTOGON */ ChallengeParam * __thiscall Game::GetChallengeParams(Game *this) { void *pvVar1; uint uVar2; uint uVar3; if ((this->_dailyChallenge)._id != 0) { return &(this->_dailyChallenge)._params; } pvVar1 = (g_manager->_challengeParams)._begin; uVar3 = ((int)(g_manager->_challengeParams)._end - (int)pvVar1) / 0xa4 - 1; uVar2 = -(uint)(this->_challenge != 0) & this->_challenge; if (uVar2 < uVar3) { uVar3 = uVar2; } return (ChallengeParam *)(uVar3 * 0xa4 + (int)pvVar1); } //@@ 007069a0 Game::GetNearestTargetPlayer /* DB: ? iterates players, decoys/friendly checks; used by Entity_NPC::GetPlayerTarget prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity * __cdecl Game::GetNearestTargetPlayer (Vector *position,Entity *source,byte isPlayersOnly,byte isTargetDecoyFamiliars, void *distanceFunc,float maxDistance) { byte bVar1; char cVar2; ItemConfig_Item *activeItemConfig; int activeMaxCharge; int **ppiVar3; float *queryRadius; void *playerListEnd; EntityPtr *playerSlot; qword *heapByteCounter; EntityPtr player; PlayerManager *playerManager; uint uVar4; float fVar5; int iVar6; bool bVar7; float10 customDistance; float fVar8; float fVar9; float distanceScore; float fVar10; undefined3 in_stack_00000005; EntityRef candidateRef; EntityList_EL enemyQuery; int *minPriority; EntityList_EL local_60; float enemyDistanceScale; uint isPlayersOnlyFinal; EntityList_EL local_44; Vector *positionCopy; uint playerIndex; float maxDistanceCopy; EntityPtr nearest; EntityPtr candidateTarget; float bestDistanceSq; float distanceSq; int *local_18 [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword allocatedBytes; EntityPtr candidate; Entity *forcedTarget; Vector *searchPos; local_8 = 0xffffffff; puStack_c = &LAB_00afc49d; local_10 = ExceptionList; ExceptionList = &local_10; local_60._size = (int)source; maxDistanceCopy = maxDistance; positionCopy = position; nearest = (EntityPtr)0x0; bestDistanceSq = maxDistance * maxDistance; bVar1 = isPlayersOnly; if ((isPlayersOnly == 0) && (isTargetDecoyFamiliars != 0)) { if (source != (Entity *)0x0) { bVar1 = Entity::IsEnemy(source); if ((bVar1 != 0) && (forcedTarget = (Entity *)source[3]._pausePosition.x, forcedTarget != (Entity *)0x0)) { ExceptionList = local_10; return forcedTarget; } bVar1 = isPlayersOnly; goto LAB_00706a19; } LAB_00706a2d: cVar2 = '\0'; } else { if (source == (Entity *)0x0) goto LAB_00706a2d; LAB_00706a19: if ((source->_type != 0x3d) || (source->_variant != 5)) goto LAB_00706a2d; cVar2 = '\x01'; } isPlayersOnlyFinal = 1; if (cVar2 == '\0') { isPlayersOnlyFinal = (uint)bVar1; } _isPlayersOnly = (EntityPtr)CONCAT13(cVar2,_isPlayersOnly); local_44._size = (int)0.0; if (cVar2 == '\0') { local_44._size = (uint)isTargetDecoyFamiliars; } playerManager = &g_game->_playerManager; playerIndex = 0; enemyDistanceScale = 1.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; if ((int)playerListEnd - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; } if (playerIndex < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + playerIndex; } candidate = *playerSlot; if ((*(byte *)((int)candidate + 0x20a9) == 0) && (((*(byte *)((int)candidate + 0x172) == 0 || ((((*(float *)((int)candidate + 0x13c0) != 4.06377e-44 && (*(float *)((int)candidate + 0x13c0) != 5.32493e-44)) || (player = *(EntityPtr *)((int)candidate + 0x1e68), player == (EntityPtr)0x0)) || ((*(float *)((int)player + 0x161c) == -NAN || ((int)*(float *)((int)candidate + 0x161c) <= (int)*(float *)((int)player + 0x161c)))))) ) || (player == candidate)))) { if (((EntityPtr)source != (EntityPtr)0x0) && ((*(uint *)((int)source + 0x168) & 0x20000000) != 0)) { EntityRef::constructor(&candidateRef,(Entity *)candidate); bVar1 = Entity::IsDamageSourceFriendly(source,&candidateRef); if (bVar1 != 0) goto LAB_00706e2d; } if ((char)isPlayersOnlyFinal == '\0') { candidateTarget = *(EntityPtr *)((int)candidate + 0x1450); if ((*(EntityPtr *)((int)candidate + 0x1450) == (EntityPtr)0x0) && (candidateTarget = *(EntityPtr *)((int)candidate + 0x144c), *(EntityPtr *)((int)candidate + 0x144c) == (EntityPtr)0x0)) { if (*(Entity **)((int)candidate + 0x200c) == (Entity *)0x0) { candidateTarget = candidate; } else { candidateTarget = (EntityPtr)Entity::GetLastParent(*(Entity **)((int)candidate + 0x200c)); } goto LAB_00706b84; } LAB_00706b88: if (*(int *)((int)candidateTarget + 0x28) != 1) goto LAB_00706b92; player = candidateTarget; } else { candidateTarget = candidate; LAB_00706b84: if (candidateTarget != (EntityPtr)0x0) goto LAB_00706b88; LAB_00706b92: player = (EntityPtr)0x0; } if (((((EntityPtr)source == (EntityPtr)0x0) || (*(int *)((int)source + 0x28) != 0x362)) || (fVar9 = *(float *)((int)candidate + 0x13c0), fVar9 == 2.66247e-44)) || ((fVar9 == 5.1848e-44 || (fVar9 == 5.46506e-44)))) { if ((*(int *)((int)candidateTarget + 0x28) == 3) && (*(int *)((int)candidateTarget + 0x2c) == 0x3e)) { player = *(EntityPtr *)((int)candidateTarget + 0x410); } if ((player == (EntityPtr)0x0) || (bVar1 = Entity_Player::IsInvisible((Entity_Player *)player), bVar1 == 0)) { searchPos = positionCopy; if (distanceFunc == (void *)0x0) { fVar5 = *(float *)((int)candidateTarget + 0x340) - positionCopy->y; fVar9 = ((Vector *)((int)candidateTarget + 0x33c))->x - positionCopy->x; distanceSq = fVar5 * fVar5 + fVar9 * fVar9; } else { customDistance = (float10)(*distanceFunc)(positionCopy,source,candidateTarget); distanceSq = (float)customDistance; local_18[0] = (int *)distanceSq; } distanceScore = distanceSq; if (player != (EntityPtr)0x0) { bVar1 = Entity_Player::HasInvincibility((Entity_Player *)player,0,(EntityRef *)0x0); if (bVar1 == 0) { if ((((*(byte *)((int)player + 0x410) == 0) || (0 < *(int *)((int)player + 0x414))) && ((EntityPtr)source != (EntityPtr)0x0)) && (*(int *)((int)source + 0x28) == 0x322)) { distanceSq = distanceSq + 800.0; } else { candidate = *(EntityPtr *)((int)player + 0x1e68); if (candidate != (EntityPtr)0x0) { fVar5 = *(float *)((int)candidate + 0x33c) - ((Vector *)((int)player + 0x33c))->x; fVar9 = *(float *)((int)candidate + 0x340) - *(float *)((int)player + 0x340); if (((*(float *)((int)player + 0x364) + *(float *)((int)candidate + 0x364)) * fVar9 + (((Vector *)((int)player + 0x360))->x + *(float *)((int)candidate + 0x360)) * fVar5 < 0.0) && (fVar9 * fVar9 + fVar5 * fVar5 < 10000.0)) { if (distanceFunc == (void *)0x0) { fVar5 = *(float *)((int)candidate + 0x33c) - searchPos->x; fVar9 = *(float *)((int)candidate + 0x340) - searchPos->y; distanceSq = fVar9 * fVar9 + fVar5 * fVar5 + 1.0; } else { customDistance = (float10)(*distanceFunc)(searchPos,source,candidate); local_18[0] = (int *)(float)customDistance; distanceSq = (float)customDistance + 1.0; } } } } } else { distanceSq = distanceSq + 400.0; } distanceScore = distanceSq; if (in_stack_00000005._2_1_ != '\0') { local_18[0] = (int *)((int)player + 0x1588); iVar6 = 0; uVar4 = 0; do { activeItemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig, ((ActiveItemDesc *)(local_18[0] + -2))->_item); if ((activeItemConfig != (ItemConfig_Item *)0x0) && (activeMaxCharge = Entity_Player::GetActiveMaxCharge((Entity_Player *)player,uVar4), 0 < activeMaxCharge)) { activeMaxCharge = Entity_Player::GetActiveMaxCharge((Entity_Player *)player,uVar4); if (activeMaxCharge == 1) { iVar6 = iVar6 + 1; } else { iVar6 = iVar6 + *local_18[0]; } } uVar4 = uVar4 + 1; local_18[0] = local_18[0] + 8; } while (uVar4 < 4); minPriority = (int *)0x0; local_18[0] = (int *)(10000.0 - (float)iVar6 * 2000.0); ppiVar3 = local_18; if ((float)local_18[0] <= 0.0) { ppiVar3 = &minPriority; } distanceScore = distanceSq * 0.001 + (float)*ppiVar3; source = (Entity *)local_60._size; } } if (distanceScore < bestDistanceSq) { nearest = candidateTarget; bestDistanceSq = distanceScore; } } } } LAB_00706e2d: playerManager = &g_game->_playerManager; playerIndex = playerIndex + 1; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); position = positionCopy; } if ((char)isPlayersOnlyFinal == '\0') { if ((char)local_44._size != '\0') { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_44,3,0x43,-1,1,0); local_8 = 0; fVar5 = 0.0; fVar9 = (float)local_44._size; if ((float)local_44._size != 0.0) { do { if (distanceFunc == (void *)0x0) { iVar6 = *(int *)((int)local_44._data + (int)fVar5 * 4); fVar10 = *(float *)(iVar6 + 0x340) - position->y; fVar8 = *(float *)(iVar6 + 0x33c) - position->x; fVar8 = fVar10 * fVar10 + fVar8 * fVar8; } else { customDistance = (float10)(*distanceFunc)(position,source, *(undefined4 *)((int)local_44._data + (int)fVar5 * 4)); fVar8 = (float)customDistance; fVar9 = (float)local_44._size; _isPlayersOnly = (EntityPtr)fVar8; } if (fVar8 < bestDistanceSq) { nearest = *(EntityPtr *)((int)local_44._data + (int)fVar5 * 4); bestDistanceSq = fVar8; } fVar5 = (float)((int)fVar5 + 1); } while ((uint)fVar5 < (uint)fVar9); } local_8 = 0xffffffff; if (local_44._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapByteCounter = &g_allocatedBytesNoHeap; } else { heapByteCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_44._data != (void *)0x0) { uVar4 = *(uint *)((int)local_44._data + -4); allocatedBytes = *heapByteCounter; *(uint *)heapByteCounter = (uint)*heapByteCounter - uVar4; *(uint *)((int)heapByteCounter + 4) = *(uint *)((int)heapByteCounter + 4) - (uint)((uint)allocatedBytes < uVar4); free((void *)((int)local_44._data + -4)); } local_8 = 0xffffffff; } } if ((*(byte *)((int)g_game->_room + 0x12d8) & 1) != 0) { _isPlayersOnly = (EntityPtr)0x43fa0000; queryRadius = (float *)&isPlayersOnly; if (maxDistanceCopy <= 500.0) { queryRadius = &maxDistanceCopy; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&local_60,position,*queryRadius,8); local_8 = 2; _isPlayersOnly = (EntityPtr)0x0; if ((EntityPtr)local_60._size != (EntityPtr)0x0) { do { candidate = *(EntityPtr *)((int)local_60._data + (int)_isPlayersOnly * 4); if ((*(int *)((int)candidate + 0x28) == 1) && (bVar1 = Entity::HasEntityFlags(source,0x20000000), bVar1 != 0)) { EntityRef::constructor(&candidateRef,(Entity *)candidate); bVar1 = Entity::IsDamageSourceFriendly(source,&candidateRef); if (bVar1 == 0) goto LAB_00706ff8; } else { LAB_00706ff8: if ((((*(byte *)((int)candidate + 0x173) == 0) && ((*(uint *)((int)candidate + 0x16c) & 0x100000) != 0)) && ((EntityPtr)source != (EntityPtr)0x0)) && (cVar2 = (**(code **)(*(int *)source + 0x50))(candidate), cVar2 != '\0')) { if (distanceFunc == (void *)0x0) { fVar5 = *(float *)((int)candidate + 0x340) - position->y; fVar9 = ((Vector *)((int)candidate + 0x33c))->x - position->x; fVar9 = fVar5 * fVar5 + fVar9 * fVar9; } else { customDistance = (float10)(*distanceFunc)(position,source,candidate); fVar9 = (float)customDistance; local_44._size = (int)fVar9; } if (fVar9 * 1e-05 < bestDistanceSq) { nearest = candidate; bestDistanceSq = fVar9 * 1e-05; } } } _isPlayersOnly = (EntityPtr)((int)_isPlayersOnly + 1); } while ((uint)_isPlayersOnly < (uint)local_60._size); } if (local_60._0_1_ != '\0') { ExceptionList = local_10; return (Entity *)nearest; } if (g_mainHeap == (void *)0x0) { heapByteCounter = &g_allocatedBytesNoHeap; } else { heapByteCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_60._data == (void *)0x0) { ExceptionList = local_10; return (Entity *)nearest; } uVar4 = *(uint *)((int)local_60._data + -4); allocatedBytes = *heapByteCounter; *(uint *)heapByteCounter = (uint)*heapByteCounter - uVar4; *(uint *)((int)heapByteCounter + 4) = *(uint *)((int)heapByteCounter + 4) - (uint)((uint)allocatedBytes < uVar4); goto LAB_00707347; } } if ((EntityPtr)source == (EntityPtr)0x0) { ExceptionList = local_10; return (Entity *)nearest; } if (*(int *)((int)source + 0x28) != 0x322) { ExceptionList = local_10; return (Entity *)nearest; } if (*(int *)((int)source + 0x2c) == 0) { enemyDistanceScale = 0.5; } _isPlayersOnly = (EntityPtr)0x43fa0000; queryRadius = (float *)&isPlayersOnly; if (maxDistanceCopy <= 500.0) { queryRadius = &maxDistanceCopy; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&enemyQuery,position,*queryRadius,8); local_8 = 4; _isPlayersOnly = (EntityPtr)0x0; if ((EntityPtr)enemyQuery._size != (EntityPtr)0x0) { do { candidate = *(EntityPtr *)((int)enemyQuery._data + (int)_isPlayersOnly * 4); if ((*(int *)((int)candidate + 0x28) == 1) && (bVar1 = Entity::HasEntityFlags(source,0x20000000), bVar1 != 0)) { EntityRef::constructor(&candidateRef,(Entity *)candidate); bVar1 = Entity::IsDamageSourceFriendly(source,&candidateRef); if (bVar1 == 0) goto LAB_00707193; } else { LAB_00707193: if (*(byte *)((int)candidate + 0x173) == 0) { if (candidate != (EntityPtr)source) { if ((1 < g_game->_frameCount - *(int *)((int)candidate + 0x328)) && (bVar1 = Entity::IsVulnerableEnemy((Entity *)candidate,(Entity *)0x0), bVar1 != 0)) { if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)candidate + 0x28) != 1)) { iVar6 = *(int *)((int)candidate + 0x28); if ((((iVar6 - 10U < 0x3de) && (iVar6 != 0x21)) && (iVar6 != 0x11)) && (iVar6 != 0x124)) { if (iVar6 == 0x375) { bVar7 = *(int *)((int)candidate + 0x2c) == 10; } else { if ((iVar6 == 0x3c0) || (iVar6 == 0x3c5)) goto LAB_0070730d; bVar7 = iVar6 == 0xf5; } if (!bVar7) goto LAB_0070724f; } } else { iVar6 = 1; LAB_0070724f: if ((*(byte *)((int)candidate + 0x173) == 0) && (uVar4 = *(uint *)((int)candidate + 0x168), (uVar4 & 0x10) == 0)) { if (distanceFunc == (void *)0x0) { fVar5 = *(float *)((int)candidate + 0x340) - position->y; fVar9 = ((Vector *)((int)candidate + 0x33c))->x - position->x; fVar9 = fVar5 * fVar5 + fVar9 * fVar9; } else { customDistance = (float10)(*distanceFunc)(position,source,candidate); iVar6 = *(int *)((int)candidate + 0x28); uVar4 = *(uint *)((int)candidate + 0x168); fVar9 = (float)customDistance; local_44._capacity = (int)fVar9; } if (iVar6 == 0x325) { if ((uVar4 & 0x20000000) == 0) { fVar9 = fVar9 * 0.01; goto LAB_007072ee; } } else { if (iVar6 == 0x322) { fVar9 = fVar9 + 250000.0; } if ((uVar4 & 0x20000000) == 0) { LAB_007072ee: fVar9 = fVar9 * enemyDistanceScale; } } if (fVar9 < bestDistanceSq) { nearest = candidate; bestDistanceSq = fVar9; } } } } } } } LAB_0070730d: _isPlayersOnly = (EntityPtr)((int)_isPlayersOnly + 1); } while ((uint)_isPlayersOnly < (uint)enemyQuery._size); } if (enemyQuery._0_1_ != '\0') { ExceptionList = local_10; return (Entity *)nearest; } if (g_mainHeap == (void *)0x0) { heapByteCounter = &g_allocatedBytesNoHeap; } else { heapByteCounter = (qword *)((int)g_mainHeap + 0x30); } if (enemyQuery._data == (void *)0x0) { ExceptionList = local_10; return (Entity *)nearest; } uVar4 = *(uint *)((int)enemyQuery._data + -4); allocatedBytes = *heapByteCounter; *(uint *)heapByteCounter = (uint)*heapByteCounter - uVar4; *(uint *)((int)heapByteCounter + 4) = *(uint *)((int)heapByteCounter + 4) - (uint)((uint)allocatedBytes < uVar4); local_60._data = enemyQuery._data; LAB_00707347: free((void *)((int)local_60._data + -4)); ExceptionList = local_10; return (Entity *)nearest; } //@@ 00707370 Game::GetNearestEnemy /* DB: ? scans room entities for nearest valid vulnerable target in radius, skipping friendly/descendants; used by GetPlayerTarget */ Entity * Game::GetNearestEnemy(code *param_1) { byte bVar1; char cVar2; uint uVar3; uint uVar4; float *in_ECX; uint uVar5; Entity *in_EDX; Entity *entity; int entityType; bool isSpecialTarget; float10 customDist; float in_XMM1_Da; float dy; float distSq; EntityRef entityRef; float local_38; void *local_30; int local_28; uint i; float bestDistSq; float *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 ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; bestDistSq = in_XMM1_Da * in_XMM1_Da; local_14 = (Entity *)0x0; i = 0; local_30 = g_game->_room; entity = (Entity *)0x0; pos = in_ECX; if (*(int *)((int)local_30 + 0x1264) != 0) { do { entity = *(Entity **)(*(int *)((int)local_30 + 0x125c) + i * 4); if (((entity->_type == 1) && (in_EDX != (Entity *)0x0)) && (bVar1 = Entity::HasEntityFlags(in_EDX,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 | (uint)((entity->_flags & 0x100) != 0); entityRef._entity = entity; bVar1 = Entity::IsDamageSourceFriendly(in_EDX,&entityRef); if (bVar1 == 0) goto LAB_007074b5; } else { LAB_007074b5: if (*(int *)&g_game->_deathmatchManager < 2) { LAB_007074d7: if ((in_EDX != (Entity *)0x0) && (cVar2 = (**(code **)(*(int *)in_EDX + 0x50))(entity,uVar3), cVar2 == '\0')) goto LAB_0070769b; } else if (in_EDX != (Entity *)0x0) { bVar1 = Entity::IsDescendantOf(in_EDX,entity); if (bVar1 != 0) goto LAB_0070769b; goto LAB_007074d7; } if (1 < g_game->_frameCount - entity->_spawnFrame) { local_28 = *(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 = Entity::HasEntityFlags(entity,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 = (uint)entity->_flags; if (((uVar5 & 0x20000000) == 0) && ((uVar5 & 0x10) == 0)) { if (param_1 == (code *)0x0) { dy = pos[1] - (entity->_pos).y; distSq = *pos - (entity->_pos).x; distSq = dy * dy + distSq * distSq; local_28 = *(int *)((int)&entity->_flags + 4); } else { customDist = (float10)(*param_1)(pos); uVar5 = (uint)entity->_flags; distSq = (float)customDist; local_38 = distSq; local_28 = *(int *)((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 < *(uint *)((int)local_30 + 0x1264)); } ExceptionList = local_10; return entity; } //@@ 007076d0 Game::FixErasedEnemyID /* ZHL [exact] static cleanup void Game::FixErasedEnemyID(int* type, int* variant, int* subtype); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ void __cdecl Game::FixErasedEnemyID(int *type,int *variant,int *subtype) { int iVar1; if (0 < *subtype) { *subtype = 0; } iVar1 = *type; if (iVar1 < 0xda) { if (iVar1 != 0xd9) { switch(iVar1) { 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 (iVar1 < 0x32d) { if (iVar1 == 0x32c) { *type = 0xc; return; } if ((iVar1 != 0x129) && (iVar1 != 299)) { return; } switchD_007076fd_caseD_a: *type = 10; if (*variant < 1) { return; } *variant = 0; return; } if (iVar1 == 0x32e) { *type = 0x55; return; } if (iVar1 != 0x338) { return; } } if (*variant < 1) { return; } *variant = 0; return; } //@@ 00707840 Game::AddErasedEnemy /* ZHL [exact] static void Game::AddErasedEnemy(Entity* entity); */ void Game::AddErasedEnemy(int param_1) { void *pvVar1; Game *pGVar2; int iVar3; int iVar4; int iVar5; int *piVar6; int local_c; int local_8; pGVar2 = g_game; local_8 = *(int *)(param_1 + 0x2c); local_c = *(int *)(param_1 + 0x28); if (local_c != 0x3b6) { param_1 = *(int *)(param_1 + 0x30); FixErasedEnemyID(&local_c,&local_8,¶m_1); iVar5 = local_8; iVar4 = local_c; iVar3 = param_1; for (piVar6 = (pGVar2->_erasedEntities)._begin; piVar6 != (pGVar2->_erasedEntities)._end; piVar6 = piVar6 + 3) { if (((*piVar6 == local_c) && (piVar6[1] == local_8)) && (piVar6[2] == param_1)) { return; } } vector12_resize(((int)(pGVar2->_erasedEntities)._end - (int)(pGVar2->_erasedEntities)._begin) / 0xc + 1); pvVar1 = (pGVar2->_erasedEntities)._end; *(int *)((int)pvVar1 + -0xc) = iVar4; *(int *)((int)pvVar1 + -8) = iVar5; *(int *)((int)pvVar1 + -4) = iVar3; } return; } //@@ 007078f0 Game::ShouldEraseEnemy /* ZHL [exact] static bool Game::ShouldEraseEnemy(Entity* Entity); prototype: db/protos.zhl, confirmed by RET 4 */ byte Game::ShouldEraseEnemy(Entity *entity) { Game *pGVar1; int *piVar2; int local_14; int local_10; int local_c [2]; pGVar1 = g_game; local_c[0] = entity->_type; if ((local_c[0] != 0x3b6) && ((((*(int *)&g_game->_deathmatchManager < 2 || (local_c[0] != 1)) && (0x3dd < local_c[0] - 10U) ) || ((entity->_flags & 0x20000000) == 0)))) { local_14 = entity->_subtype; piVar2 = (g_game->_erasedEntities)._begin; local_10 = entity->_variant; if (piVar2 != (g_game->_erasedEntities)._end) { FixErasedEnemyID(local_c,&local_10,&local_14); for (; piVar2 != (pGVar1->_erasedEntities)._end; piVar2 = piVar2 + 3) { if (((*piVar2 == local_c[0]) && ((piVar2[1] < 0 || (piVar2[1] == local_10)))) && ((piVar2[2] < 0 || (piVar2[2] == local_14)))) { return 1; } } } } return 0; } //@@ 007079c0 Entity::RemoveWithPoof /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: spawns effect 1000.15 poof with color then vtable Remove prototype: db/protos.zhl, confirmed by RET 8 */ void Entity::RemoveWithPoof(Entity *entity,int unusedArg) { char cVar1; uint seed; Entity *pEVar2; Vector local_40; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; local_c = __security_cookie ^ (uint)&local_40; if (entity->_type != 0x3b6) { seed = Random(); local_40.x = (entity->_pos).x; local_40.y = (entity->_pos).y; pEVar2 = Game::SpawnEx(g_game,1000,0xf,&local_40,&g_vectorZero,(Entity *)0x0,0,seed,0); local_18 = 0x3e4ccccd; local_38 = 0x3f800000; uStack_34 = 0x3f19999a; uStack_30 = 0x3f666666; uStack_2c = 0x3f800000; local_14 = 0x3e19999a; local_10 = 0x3e3851ec; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; (**(code **)(*(int *)pEVar2 + 0x3c))(&local_38,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar2 + 0xc))(); if (((1 < *(int *)&g_game->_deathmatchManager) && (entity->_type == 1)) || (entity->_type - 10U < 0x3de)) { cVar1 = (**(code **)(*(int *)entity + 0x4c))(); if (cVar1 != '\0') { Room::TriggerBossDeath(g_game->_room,entity); } } (**(code **)(*(int *)entity + 0x28))(); } return; } //@@ 00707ad0 r_key_timer_callback /* DB: reached only via thunk 0x5c7ee0, which Entity_Player::UseActiveItem passes to Entity_Effect::CreateTimer (mov ecx,0x5c7ee0 at 0x5c3855) in case COLLECTIBLE_R_KEY (use_dispatch.tsv 005c383b); Game::ResetState, reseeds, Level::SetNextStage/Init, Game::SaveBackwardsStage, StartRoomTransition */ void r_key_timer_callback(void) { Entity_Player *this; code *pcVar1; Game *this_00; Game *pGVar2; Manager *pMVar3; byte bVar4; uint uVar5; uint uVar6; void *pvVar7; uint uVar8; int iVar9; float fVar10; uint uStack_28; int *local_24; this_00 = g_game; Game::ResetState(g_game); uVar8 = 0; while( true ) { uVar5 = -(uint)(uVar8 != 0) & uVar8; uVar6 = 0xd; if (uVar5 < 0xd) { uVar6 = uVar5; } uVar5 = (this_00->_seedEffects)._stageSeeds[uVar6]; if (uVar5 == 0) break; uVar8 = uVar8 + 1; uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 0xf ^ uVar5; (this_00->_seedEffects)._stageSeeds[uVar6] = uVar5 >> 0x11 ^ uVar5; if (0xd < uVar8) { iVar9 = this_00->_stage; if ((0 < iVar9) && ((6 < iVar9 || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { if ((this_00->_stageType == 4) || (this_00->_stageType == 5)) { iVar9 = iVar9 + 1; } if (iVar9 < 8) { Game::SaveBackwardsStage(iVar9); } } pMVar3 = g_manager; pGVar2 = g_game; this_00->_stage = 0; this_00->_stageType = 0; pMVar3->field_0x21c10 = 0; if ((pGVar2->_difficulty == 2) || (pGVar2->_difficulty == 3)) { iVar9 = -3; } else { iVar9 = 0; } (pMVar3->_nightmareScene)._stageBarIcons[0] = iVar9; if ((((pGVar2->_difficulty == 2) || (pGVar2->_difficulty == 3)) || (6 < this_00->_stage)) || ((this_00->_stageType != 4 && (this_00->_stageType != 5)))) { pGVar2->_bossRushParTime = 36000; } else { pGVar2->_bossRushParTime = 45000; } Level::SetNextStage((Level *)this_00); Level::Init(1); pGVar2 = g_game; if (*(int *)&this_00->_roomTransition != 0) { iVar9 = (this_00->_roomTransition)._animation; if (((iVar9 == 3) || (iVar9 == 0xc)) || ((iVar9 == 0xd || (iVar9 == 0xb)))) { Game::StartRoomTransition (this_00,this_00->_startingRoomIdx,-1,3, (g_game->_playerManager)._roomTransitionPlayer,-1); } else { (this_00->_roomTransition)._frame = 0; *(undefined4 *)&(this_00->_roomTransition).field_0xc = 0; *(undefined4 *)&this_00->_roomTransition = 0; (this_00->_roomTransition)._direction = 0; (this_00->_roomTransition)._animation = 0; *(undefined4 *)&(this_00->_roomTransition).field_0x20 = 0; (this_00->_roomTransition)._flags = 0; (pGVar2->_playerManager)._roomTransitionPlayer = (void *)0x0; } } pvVar7 = (this_00->_playerManager)._playerList._end; local_24 = (this_00->_playerManager)._playerList._begin; uStack_28 = 0; if ((int)pvVar7 - (int)local_24 >> 2 != 0) { do { if ((int)pvVar7 - (int)local_24 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (this_00->_playerManager)._playerList._end; local_24 = (this_00->_playerManager)._playerList._begin; } if (uStack_28 < (uint)((int)pvVar7 - (int)local_24 >> 2)) { local_24 = local_24 + uStack_28; } this = (Entity_Player *)*local_24; bVar4 = Entity_Player::IsHoldingItem(this); if (bVar4 != 0) { ANM2::Reset(&this->_heldSprite); } (this->_queuedItem)._item = (void *)0x0; (this->_queuedItem)._charge = 0; (this->_queuedItem)._flags = 0; *(undefined4 *)&this->field_0x17d0 = 0; pvVar7 = (this_00->_playerManager)._playerList._end; local_24 = (this_00->_playerManager)._playerList._begin; uStack_28 = uStack_28 + 1; } while (uStack_28 < (uint)((int)pvVar7 - (int)local_24 >> 2)); } bVar4 = this_00->_isInstantFadeIn; (this_00->_fadeInColor)._red = 0.0; (this_00->_fadeInColor)._green = 0.0; (this_00->_fadeInColor)._blue = 0.0; (this_00->_fadeInColor)._alpha = 1.0; (this_00->_fadeInColor)._unk = 0; if (bVar4 == 0) { fVar10 = 1.0; } else { fVar10 = 1e-05; } (this_00->_fadeInColor)._alpha = fVar10; this_00->_fadeSpeed = 0.04; this_00->_isFadeInIconShown = 1; if (local_24 != (this_00->_playerManager)._playerList._end) { do { iVar9 = *local_24; local_24 = local_24 + 1; *(undefined1 *)(iVar9 + 0x410) = 0; } while (local_24 != (this_00->_playerManager)._playerList._end); } return; } } KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } //@@ 00707e10 spawn_chain_lightning /* DB: spawns EFFECT 1000.167 CHAIN_LIGHTNING (Jacob's Ladder) (Game::SpawnEx(1000,0xa7)) at pos; walks spawner chain to the player, arc count 4 (+2 The Battery 63, +2 Jumper Cables 520, +2 Charged Baby 372, +1 trinket 3), damage mult 1.5/+0.5 (items 356/205), sets count at +0x458; callers tear/laser/knife/familiar tear-flag effect paths prototype: db/protos.zhl, confirmed by RET 24 */ Entity * spawn_chain_lightning(Vector *position,BitSet128 tearFlags,Entity *spawner,float damage) { undefined4 uVar1; bool bVar2; EntityPtr EVar3; EntityPtr this; EntityPtr EVar4; byte bVar5; byte bVar6; uint seed; Entity *pEVar7; undefined4 unaff_EBX; int iVar8; float local_10; local_10 = 1.0; iVar8 = 4; bVar2 = false; if (spawner != (Entity *)0x0) { EVar4 = spawner->_spawnerEntity; this = (EntityPtr)spawner; while (EVar3 = EVar4, EVar3 != (EntityPtr)0x0) { this = EVar3; EVar4 = *(EntityPtr *)((int)EVar3 + 0x3c8); } if (*(int *)((int)this + 0x28) == 1) { Entity_Player::HasCollectible((Entity_Player *)this,0x74,0); bVar5 = Entity_Player::HasCollectible((Entity_Player *)this,0x3f,0); if (bVar5 != 0) { iVar8 = 6; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this,0x208,0); if (bVar5 != 0) { iVar8 = iVar8 + 2; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this,0x174,0); if (bVar5 != 0) { iVar8 = iVar8 + 2; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this,0x25b,0); bVar6 = Entity_Player::HasCollectible((Entity_Player *)this,0x164,0); if (bVar6 != 0) { local_10 = 1.5; } bVar6 = Entity_Player::HasCollectible((Entity_Player *)this,0xcd,0); if (bVar6 != 0) { local_10 = local_10 + 0.5; } bVar6 = Entity_Player::HasTrinket((Entity_Player *)this,3,0); if (bVar6 != 0) { iVar8 = iVar8 + 1; } Entity_Player::HasTrinket((Entity_Player *)this,0x48,0); Entity_Player::HasTrinket((Entity_Player *)this,0x78,0); bVar6 = Entity_Player::HasTrinket((Entity_Player *)this,0x8f,0); bVar2 = bVar5 != 0; if (bVar6 != 0) { bVar2 = true; } } } seed = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0xa7,position,&g_vectorZero,spawner,0,seed,0); (**(code **)(*(int *)pEVar7 + 0x40))(local_10 * damage); *(undefined4 *)pEVar7[1]._sprite._filename._buf = unaff_EBX; *(float *)(pEVar7[1]._sprite._filename._buf + 4) = (float)iVar8; if (bVar2) { uVar1 = *(undefined4 *)((int)&pEVar7->_flags + 4); *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags | 0x400000; *(undefined4 *)((int)&pEVar7->_flags + 4) = uVar1; } pEVar7[1]._collisionIndex = (int)pEVar7->_collisionDamage; pEVar7[1]._type = 0x3f800000; pEVar7[1]._pendingDamage = (float)tearFlags._l; *(undefined4 *)&pEVar7[1]._pendingDamageFlags = tearFlags._l._4_4_; *(undefined4 *)((int)&pEVar7[1]._pendingDamageFlags + 4) = (undefined4)tearFlags._h; pEVar7[1]._index = tearFlags._h._4_4_; return pEVar7; } //@@ 00708050 Game::SaveBackwardsStage /* ZHL [exact] __stdcall void Game::SaveBackwardsStage(int stage); prototype: REPENTOGON, confirmed by RET 4 */ void Game::SaveBackwardsStage(int stage) { RoomDescriptor *dest; void *roomConfig; uint uVar1; Game *pGVar2; Game *this; int iVar3; RoomDescriptor *source; int local_8; pGVar2 = g_game; if ((stage < 1) || (7 < stage)) { KAGE_LogMessage(0x10,(byte *)"Invalid backwards path stage ID"); } this = g_game; dest = (RoomDescriptor *)(pGVar2->_glowingHourglassStates[1]._eventCounters + stage * 200 + 0x17b) ; *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4) = 0; *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x36) * 4) = this->_stageType ; *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4) = 1; GameState::copy_room_list(dest,this->_roomList + this->_lastBossRoomListIdx); roomConfig = (void *)pGVar2->_glowingHourglassStates[1]._eventCounters[stage * 200 + 0x17f]; if (roomConfig != (void *)0x0) { Level::write_room_config ((Level *)this,roomConfig, pGVar2->_glowingHourglassStates[1]._eventCounters + stage * 200 + 0x1d7,(void *)0x0); } pGVar2->_glowingHourglassStates[1]._eventCounters[stage * 200 + 0x17f] = 0; local_8 = 0; if (0 < this->_nbRooms) { source = this->_roomList; do { if ((source->Data != (void *)0x0) && (source->Dimension == 0)) { iVar3 = *(int *)((int)source->Data + 8); if (iVar3 == 5) { if ((local_8 != this->_lastBossRoomListIdx) && ((uint)*(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4) < 2)) { GameState::copy_room_list (dest + *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4),source); iVar3 = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4); if (dest[iVar3].Data != (void *)0x0) { Level::write_room_config ((Level *)this,dest[iVar3].Data,dest[2]._doors + iVar3 * 3 + -7,(void *)0x0) ; iVar3 = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4 ); } dest[iVar3].Data = (void *)0x0; *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4) = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4) + 1 ; } } else if ((iVar3 == 4) && ((uint)*(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4) < 2)) { GameState::copy_room_list ((RoomDescriptor *) (pGVar2->_glowingHourglassStates[1]._eventCounters + stage * 200 + *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4) * 0x2e + 0x1dd),source); iVar3 = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4); if ((void *)dest[iVar3 + 2]._doors[3] != (void *)0x0) { Level::write_room_config ((Level *)this,(void *)dest[iVar3 + 2]._doors[3], dest[4]._doors + iVar3 * 3 + -1,(void *)0x0); iVar3 = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4); } dest[iVar3 + 2]._doors[3] = 0; *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4) = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x35) * 4) + 1; } } local_8 = local_8 + 1; source = source + 1; } while (local_8 < this->_nbRooms); } uVar1 = *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x34) * 4); *(bool *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0x37) * 4) = 1 < uVar1; if ((1 < uVar1) && (stage < 7)) { *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0xfc) * 4) = 0; *(int *)((int)(pGVar2->_glowingHourglassStates + 2) + (stage * 200 + 0xfd) * 4) = 0; } return; } //@@ 00708250 PlayerManager::GetGFuelCount /* DB: ? only if SEED_G_FUEL (79) active; sums FUN_007db860 over main players prototype: db/protos.zhl */ int __cdecl PlayerManager::GetGFuelCount(void) { Entity_Player *player; Game *pGVar1; int iVar2; void *pvVar3; undefined4 *puVar4; uint uVar5; undefined1 local_18 [8]; void *local_10; void *local_c; int local_8; pGVar1 = g_game; local_c = (void *)0x4f; std::set::find_node(local_18,&local_c); if (((*(char *)((int)local_10 + 0xd) != '\0') || (0x4f < *(int *)((int)local_10 + 0x10))) || (local_10 == (pGVar1->_seedEffects)._seedEffects)) { return 0; } local_c = (pGVar1->_playerManager)._playerList._end; puVar4 = (pGVar1->_playerManager)._playerList._begin; local_8 = 0; uVar5 = 0; iVar2 = 0; if ((int)local_c - (int)puVar4 >> 2 != 0) { do { if ((int)local_c - (int)puVar4 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); puVar4 = (pGVar1->_playerManager)._playerList._begin; pvVar3 = (pGVar1->_playerManager)._playerList._end; } else { pvVar3 = local_c; } if (uVar5 < (uint)((int)pvVar3 - (int)puVar4 >> 2)) { puVar4 = puVar4 + uVar5; } player = (Entity_Player *)*puVar4; if ((player->_variant == 0) && (player->_parent == (EntityPtr)0x0)) { iVar2 = is_achievement_79_unlocked(player); local_8 = local_8 + iVar2; pvVar3 = (pGVar1->_playerManager)._playerList._end; } puVar4 = (pGVar1->_playerManager)._playerList._begin; uVar5 = uVar5 + 1; local_c = pvVar3; } while (uVar5 < (uint)((int)pvVar3 - (int)puVar4 >> 2)); iVar2 = local_8; } return iVar2; } //@@ 00708350 FUN_00708350 uint FUN_00708350(void) { NetplayManager NVar1; NVar1 = g_manager->_netplayManager; if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (NVar1 = (NetplayManager)g_game, 7 < (uint)g_game->_framesSinceRoomTransition)) { return (uint)NVar1 & 0xffffff00; } return CONCAT31((int3)((uint)g_game >> 8),1); } //@@ 00708380 FUN_00708380 void FUN_00708380(void) { int iVar1; uint uVar2; undefined4 uVar3; undefined4 uStack_18; undefined4 uStack_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00afc4ed; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"[Frame: %d] Victory lap vote finished \n"); iVar1 = g_manager[1]._state; uVar3 = online_vote_get_local_choice(uVar2); uStack_8 = 0; if (g_userProfile == (void *)0x0) { uStack_14 = 0; uStack_18 = 0; } else { uStack_18 = *(undefined4 *)((int)g_userProfile + 8); uStack_14 = *(undefined4 *)((int)g_userProfile + 0xc); } FUN_0090a4b0(uStack_18,uStack_14,uVar3,iVar1 + 1); ExceptionList = local_10; return; } //@@ 00708430 FUN_00708430 void FUN_00708430(undefined4 param_1,undefined4 param_2,int param_3) { KColor local_2c [2]; KColor::SetFromARGB(local_2c,0xff000000); *(undefined4 *)(param_3 + 0x265b8) = 0x3da3d70a; *(undefined4 *)(param_3 + 0x265bc) = 7; *(float *)(param_3 + 0x265a4) = local_2c[0]._red; *(float *)(param_3 + 0x265a8) = local_2c[0]._green; *(float *)(param_3 + 0x265ac) = local_2c[0]._blue; *(undefined4 *)(param_3 + 0x265b0) = *(undefined4 *)(param_3 + 0x265b0); *(undefined4 *)(param_3 + 0x265b4) = 0; *(float *)(param_3 + 0x265b0) = *(float *)(param_3 + 0x265b0) + 0.08; return; } //@@ 007084c0 Game::recreate_render_targets /* DB: called from Game::Render only when this->_triggerWindowResize != 0 (then cleared): resets ~18 KAGE::SmartPointer, init_room_render_surfaces, recenters a HUD element from g_screenWidth/Height, Game::create_render_surfaces, ModManager::create_shader_render_targets */ void __thiscall Game::recreate_render_targets(Game *this) { void *pvVar1; Manager *pMVar2; 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 fVar3; float fVar4; FUN_0082ed00(); pvVar1 = this->_room; KAGE::SmartPointer::reset(extraout_ECX); KAGE::SmartPointer::reset(extraout_ECX_00); KAGE::SmartPointer::reset(extraout_ECX_01); KAGE::SmartPointer::reset(extraout_ECX_02); KAGE::SmartPointer::reset(extraout_ECX_03); KAGE::SmartPointer::reset(extraout_ECX_04); KAGE::SmartPointer::reset(extraout_ECX_05); KAGE::SmartPointer::reset(extraout_ECX_06); KAGE::SmartPointer::reset(extraout_ECX_07); KAGE::SmartPointer::reset(extraout_ECX_08); KAGE::SmartPointer::reset(extraout_ECX_09); KAGE::SmartPointer::reset(extraout_ECX_10); init_room_render_surfaces(); fVar4 = g_screenWidth - 338.0; fVar3 = g_screenHeight - 182.0; *(undefined1 *)((int)pvVar1 + 0x11f6) = 1; *(float *)((int)pvVar1 + 0x11fc) = fVar4 * 0.5 - 52.0; *(float *)((int)pvVar1 + 0x1200) = fVar3 * 0.5 - 52.0; KAGE::SmartPointer::reset(extraout_ECX_11); KAGE::SmartPointer::reset(extraout_ECX_12); KAGE::SmartPointer::reset(extraout_ECX_13); KAGE::SmartPointer::reset(extraout_ECX_14); KAGE::SmartPointer::reset(extraout_ECX_15); KAGE::SmartPointer::reset(extraout_ECX_16); create_render_surfaces(); FUN_00692960(); pMVar2 = g_manager; FUN_008f7dd0(); ModManager::create_shader_render_targets(&pMVar2->_modManager); return; } //@@ 00708630 Game::update_trapdoor_loop_sfx /* DB: ? Game::Update helper: skips states 2/3 and stages 9/0xd; in boss room (type 5) with room data [4]==0x58 or 0x37 finds GRID_TRAPDOOR (17) position, SoundEffects::Play looping sound, SFXManager::AdjustVolume(0x3f0, by distance), Stop/IsPlaying; Level::GetRoomByIdx */ void Game::update_trapdoor_loop_sfx(void) { void *pvVar1; byte isPlaying; uint gridIndex; RoomDescriptor *neighborRoom; Vector *pVVar2; Entity_Player *player; float *pfVar3; Level *in_ECX; undefined4 *gridSlot; int iVar4; float fVar5; float local_24; Vector local_20; float distanceVolume; undefined1 local_14 [16]; int door; void *gameState; bool isTrapdoorRoom; Manager *manager; int *roomConfig; SoundEffects *sfxManager; GridEntity *trapdoor; local_20.x = 0.0; pvVar1 = in_ECX->_room; local_24 = 0.0; isTrapdoorRoom = false; local_14._0_4_ = 0.0; distanceVolume = 1.0; if ((((pvVar1 != (void *)0x0) && (gameState = in_ECX[1]._roomList[0x140].OverrideData, gameState != (void *)0x2)) && (gameState != (void *)0x3)) && ((in_ECX->_stage != 9 && (in_ECX->_stage != 0xd)))) { if ((*(int *)((int)pvVar1 + 8) == 5) && ((roomConfig = *(int **)(*(int *)((int)pvVar1 + 4) + 0x10), *roomConfig == 0 && (roomConfig[4] == 0x58)))) { iVar4 = *(int *)((int)pvVar1 + 0x10) * *(int *)((int)pvVar1 + 0xc); gridIndex = 0; isTrapdoorRoom = true; if (0 < iVar4) { gridSlot = (undefined4 *)((int)pvVar1 + 0x24); do { if (((gridIndex < 0x1c0) && (trapdoor = (GridEntity *)*gridSlot, trapdoor != (GridEntity *)0x0)) && ((trapdoor->_desc)._type == 0x11)) { pVVar2 = GridEntity::Position(trapdoor,(Vector *)(local_14 + 4)); local_24 = pVVar2->x; local_20.x = pVVar2->y; break; } gridIndex = gridIndex + 1; gridSlot = gridSlot + 1; } while ((int)gridIndex < iVar4); } } iVar4 = 0; do { if (isTrapdoorRoom) { LAB_00708805: player = PlayerManager::get_first_local_main_player ((PlayerManager *)&in_ECX[1]._roomList[0x4c].PitsCount); if (player != (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) { local_14._0_4_ = 0.6; distanceVolume = 200.0 / fVar5; pfVar3 = (float *)local_14; if (0.6 <= 200.0 / fVar5) { pfVar3 = &distanceVolume; } distanceVolume = *pfVar3; if (1.0 <= distanceVolume) { distanceVolume = 1.0; } } local_14._0_4_ = 0.75; local_20.x = local_24 / 300.0; pVVar2 = (Vector *)local_14; if (local_24 / 300.0 <= 0.75) { pVVar2 = &local_20; } local_14._0_4_ = pVVar2->x; if ((float)local_14._0_4_ <= -0.75) { local_14._0_4_ = -0.75; } } isPlaying = SFXManager::IsPlaying(&g_manager->_sfxManager,0x3f0); manager = g_manager; fVar5 = (float)in_ECX[4]._roomList[0xb0].AwardSeed; if (isPlaying == 0) { local_20.x = 1.41251e-42; seed_fart_sound_override((int *)&local_20); SoundEffects::Play(&manager->_sfxManager,(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; in_ECX[4]._roomList[0xb0].AwardSeed = (int)fVar5; SFXManager::AdjustVolume(sfxManager,0x3f0,fVar5 * distanceVolume); SFXManager::adjust_pan(0x3f0); return; } door = *(int *)((int)pvVar1 + iVar4 * 4 + 0x724); if ((door != 0) && (*(int *)(door + 0x160) == 5)) { neighborRoom = Level::GetRoomByIdx(in_ECX,*(int *)(door + 0x394),-1); roomConfig = neighborRoom->Data; if ((((roomConfig == (int *)0x0) || (*roomConfig != 0)) || ((roomConfig[4] != 0x58 && (roomConfig[4] != 0x37)))) && (((neighborRoom->Flags & 1) == 0 && (((*(byte *)(*(int *)((int)pvVar1 + 4) + 0x44) & 1) != 0 || (*(int *)((int)pvVar1 + 0x1bb0) == 0)))))) { pVVar2 = GridEntity::Position(*(GridEntity **)((int)pvVar1 + iVar4 * 4 + 0x724),&local_20) ; local_24 = pVVar2->x; local_20.x = pVVar2->y; goto LAB_00708805; } } iVar4 = iVar4 + 1; } while (iVar4 < 8); } isPlaying = SFXManager::IsPlaying(&g_manager->_sfxManager,0x3f0); if (isPlaying != 0) { fVar5 = (float)in_ECX[4]._roomList[0xb0].AwardSeed; if (0.05 <= fVar5) { fVar5 = fVar5 - 0.05; sfxManager = &g_manager->_sfxManager; in_ECX[4]._roomList[0xb0].AwardSeed = (int)fVar5; SFXManager::AdjustVolume(sfxManager,0x3f0,fVar5); return; } SFXManager::Stop(&g_manager->_sfxManager,0x3f0); } return; } //@@ 007089f0 FUN_007089f0 void FUN_007089f0(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_007091f0(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xffffffe0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00708a50 FUN_00708a50 int FUN_00708a50(void) { int in_ECX; return *(int *)(in_ECX + 4) + -4; } //@@ 00708a60 FUN_00708a60 void FUN_00708a60(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00709380(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00708ae0 vector12_resize /* DB: std::vector<12-byte element>::resize(n) with zero-fill (memset) or reallocation (FUN_00709480); Game::AddErasedEnemy, GameState::write */ void vector12_resize(uint param_1) { uint uVar1; int *in_ECX; void *_Dst; size_t _Size; _Dst = (void *)in_ECX[1]; uVar1 = ((int)_Dst - *in_ECX) / 0xc; if (param_1 < uVar1) { in_ECX[1] = *in_ECX + param_1 * 0xc; return; } if (uVar1 < param_1) { if ((uint)((in_ECX[2] - *in_ECX) / 0xc) < param_1) { FUN_00709480(param_1,in_ECX[2] - *in_ECX); return; } if (param_1 - uVar1 != 0) { _Size = (param_1 - uVar1) * 0xc; memset(_Dst,0,_Size); _Dst = (void *)((int)_Dst + _Size); } in_ECX[1] = (int)_Dst; } return; } //@@ 00708b70 std::vector<12byte>::operator_assign /* DB: copy-assign when this != other: reserve (FUN_006a0dc0) if capacity/12 is short, memmove the bytes, set end; Game::store_game_state/restore_game_state, Leaderboard::Show */ void std::vector<12byte>::operator_assign(int *param_1) { void *_Src; int *in_ECX; size_t _Size; void *_Dst; if (in_ECX != param_1) { _Src = (void *)*param_1; _Size = param_1[1] - (int)_Src; _Dst = (void *)*in_ECX; if ((uint)((in_ECX[2] - (int)_Dst) / 0xc) < (uint)((int)_Size / 0xc)) { FUN_006a0dc0((int)_Size / 0xc); _Dst = (void *)*in_ECX; } memmove(_Dst,_Src,_Size); in_ECX[1] = (int)_Dst + _Size; } return; } //@@ 00708c10 FUN_00708c10 void FUN_00708c10(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { std::vector<12byte>::_Tidy(); pvVar1 = (void *)((int)pvVar1 + 0xc); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00708c90 FUN_00708c90 void FUN_00708c90(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } } in_ECX[1] = this; *in_ECX = 0; ExceptionList = local_10; return; } //@@ 00708d40 FUN_00708d40 void FUN_00708d40(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } ExceptionList = local_10; return; } //@@ 00708e20 std::vector::_Tidy /* DB: ? frees vector of 0x78 elems; RoomDescriptor dtor, reset_room_list */ void std::vector::_Tidy(void) { int *in_ECX; uint size; void *owner; void *pvVar1; owner = (void *)*in_ECX; if (owner != (void *)0x0) { pvVar1 = (void *)in_ECX[1]; if (owner != pvVar1) { do { invoke_pending_callbacks(owner); owner = (void *)((int)owner + 0x78); } while (owner != pvVar1); owner = (void *)*in_ECX; } size = ((in_ECX[2] - (int)owner) / 0x78) * 0x78; pvVar1 = owner; if (0xfff < size) { pvVar1 = *(void **)((int)owner + -4); size = size + 0x23; if (0x1f < (uint)((int)owner + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00708eb0 std::vector::_Reallocate_exactly /* DB: ECX vector, arg new capacity (max 0x2222222): allocate, EntitySaveState::copy each 0x78 element, adopt (FUN_004d7340); RoomDescriptor::constructor reserves 0x10 / 0x20 when capacity is below, restore_save_state_part2 grows to the saved count */ void std::vector::_Reallocate_exactly(uint param_1) { int iVar1; int iVar2; void *pvVar3; EntitySaveState *pEVar4; int *in_ECX; EntitySaveState *this; void *other; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc55d; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x2222222 < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pEVar4 = _Allocate(param_1 * 0x78); pvVar3 = (void *)in_ECX[1]; other = (void *)*in_ECX; local_8 = 1; this = pEVar4; for (; other != pvVar3; other = (void *)((int)other + 0x78)) { EntitySaveState::copy(this,other); this = this + 0x1e; } _Change_array(pEVar4,(iVar1 - iVar2) / 0x78,param_1); ExceptionList = local_10; return; } //@@ 00708f78 Catch_All@00708f78 void Catch_All_00708f78(void) { int unaff_EBP; FUN_004d7450(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + 8)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00708f90 FUN_00708f90 void FUN_00708f90(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xffffffe0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00708ff0 FUN_00708ff0 void FUN_00708ff0(void) { FUN_007091f0(); return; } //@@ 00709010 FUN_00709010 void FUN_00709010(void) { FUN_00709300(); return; } //@@ 00709030 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x28; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 00709070 FUN_00709070 void FUN_00709070(void) { FUN_00709380(); return; } //@@ 00709090 FUN_00709090 void FUN_00709090(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0xc) { std::vector<12byte>::_Tidy(); } return; } //@@ 007090c0 shared_ptr::operator_assign /* DB: copy-and-swap: temp from shared_ptr::assign (0041c770, really the copy ctor), swap two words with ECX, release old refcount (vtable +0xc, deleter g_renderTargetReleaseFn); render-surface assignment in Game::create_render_surfaces, Minimap::Init prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall shared_ptr::operator_assign(void *this,void *other) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *extraout_EAX; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; assign(local_1c,other); uVar1 = extraout_EAX[1]; extraout_EAX[1] = *(undefined4 *)((int)this + 4); *(undefined4 *)((int)this + 4) = uVar1; uVar1 = *extraout_EAX; *extraout_EAX = *(undefined4 *)this; *(undefined4 *)this = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_1c); } } ExceptionList = local_10; return; } //@@ 00709150 KAGE::SmartPointer::reset /* DB: allocates empty ReferenceCount control block, releases old one at this+4, sets ptr=0; Game::~Game, Room::LoadBackdropGraphics */ void KAGE::SmartPointer::reset(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } } *in_ECX = 0; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 007091f0 FUN_007091f0 void FUN_007091f0(void) { void **ppvVar1; char cVar2; uint uVar3; char *in_ECX; char *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1360; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, in_ECX != in_EDX; in_ECX = in_ECX + 0x20) { local_8 = 0; if (((*(int **)(in_ECX + 0x1c) != (int *)0x0) && (cVar2 = (**(code **)(**(int **)(in_ECX + 0x1c) + 0xc))(uVar3), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x18); } local_8 = 0xffffffff; std::string::_Tidy_deallocate(in_ECX); ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 00709280 std_set_uint_copy /* DB: std::_Tree copy-assign body: copies nodes (FUN_00709770) from param tree, sets size, then fixes leftmost/rightmost head links; used by Seeds::construct_from_copy/Seeds::operator_assign for _seedEffects and GameState::copy_room_list prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall std_set_uint_copy(void *this,void *other,int copyTag) { char cVar1; int *piVar2; int *piVar3; int iVar4; int iVar5; int *piVar6; undefined4 uVar7; uVar7 = FUN_00709770(*(undefined4 *)(*(int *)other + 4),*(undefined4 *)this,copyTag); *(undefined4 *)(*(int *)this + 4) = uVar7; piVar2 = *(int **)this; *(undefined4 *)((int)this + 4) = *(undefined4 *)((int)other + 4); piVar3 = (int *)piVar2[1]; if (*(char *)((int)piVar3 + 0xd) != '\0') { *piVar2 = (int)piVar2; *(int *)(*(int *)this + 8) = *(int *)this; return; } cVar1 = *(char *)(*piVar3 + 0xd); piVar6 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar6 + 0xd); piVar3 = piVar6; piVar6 = (int *)*piVar6; } *piVar2 = (int)piVar3; iVar4 = *(int *)(*(int *)this + 4); iVar5 = *(int *)(iVar4 + 8); cVar1 = *(char *)(iVar5 + 0xd); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar5 + 8) + 0xd); iVar4 = iVar5; iVar5 = *(int *)(iVar5 + 8); } *(int *)(*(int *)this + 8) = iVar4; return; } //@@ 00709300 FUN_00709300 void FUN_00709300(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { iVar4 = in_ECX + 4; do { local_8 = 0; if (*(int **)(iVar4 + 4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar4 + 4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(iVar4); } } iVar1 = iVar4 + 0x24; iVar4 = iVar4 + 0x28; } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00709380 FUN_00709380 void FUN_00709380(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { iVar4 = in_ECX + 4; do { local_8 = 0; if (*(int **)(iVar4 + 4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar4 + 4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(iVar4); } } iVar1 = iVar4 + 8; iVar4 = iVar4 + 0xc; } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00709400 FUN_00709400 int FUN_00709400(void) { char cVar1; int iVar2; int iVar3; int in_ECX; cVar1 = *(char *)(*(int *)(in_ECX + 8) + 0xd); iVar2 = *(int *)(in_ECX + 8); while (iVar3 = iVar2, cVar1 == '\0') { iVar2 = *(int *)(iVar3 + 8); cVar1 = *(char *)(iVar2 + 0xd); in_ECX = iVar3; } return in_ECX; } //@@ 00709420 FUN_00709420 void FUN_00709420(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00709420(param_1,param_2[2]); piVar2 = (int *)*param_2; FUN_007089f0(); std::string::_Tidy_deallocate((char *)(param_2 + 0xb)); std::string::_Tidy_deallocate((char *)(param_2 + 4)); operator_delete(param_2,0x50); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00709480 FUN_00709480 void FUN_00709480(uint param_1) { void *pvVar1; int iVar2; uint uVar3; void *_Dst; int iVar4; int *in_ECX; uint size; void *ptr; if (0x15555555 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar2 = (in_ECX[1] - *in_ECX) / 0xc; uVar3 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar3 >> 1) < uVar3) { uVar3 = 0x15555555; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < param_1) { uVar3 = param_1; } else if (0x15555555 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar3 * 0xc); iVar4 = param_1 - iVar2; if (iVar4 != 0) { memset((void *)((int)_Dst + iVar2 * 0xc),0,iVar4 * 0xc); } memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + param_1 * 0xc); in_ECX[2] = (int)(uVar3 * 0xc + (int)_Dst); return; } //@@ 007095c0 std::vector::assign /* DB: ECX vector, args [first,last) of 0x78-byte elements (max 0x2222222), destroys surplus, reallocates 1.5x, copy-constructs range (FUN_004d76f0); used by Game_StateSlot::operator_assign, GameState::copy_room_list, Level::generate_boss_room */ void std::vector::assign(int param_1,int param_2) { void *pvVar1; uint uVar2; int iVar3; int *in_ECX; uint uVar4; void *pvVar5; void *owner; uint local_8; pvVar1 = (void *)in_ECX[1]; pvVar5 = (void *)*in_ECX; uVar2 = (param_2 - param_1) / 0x78; uVar4 = ((int)pvVar1 - (int)pvVar5) / 0x78; if (uVar2 <= uVar4) { _Copy_unchecked(pvVar5); pvVar1 = (void *)in_ECX[1]; pvVar5 = (void *)((int)pvVar5 + uVar2 * 0x78); for (owner = pvVar5; owner != pvVar1; owner = (void *)((int)owner + 0x78)) { invoke_pending_callbacks(owner); } in_ECX[1] = (int)pvVar5; return; } local_8 = (in_ECX[2] - (int)pvVar5) / 0x78; if (local_8 < uVar2) { if (0x2222222 < uVar2) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x2222222 - (local_8 >> 1) < local_8) { local_8 = 0x2222222; } else { local_8 = (local_8 >> 1) + local_8; if (local_8 < uVar2) { local_8 = uVar2; } } if (pvVar5 != (void *)0x0) { if (pvVar5 != pvVar1) { do { invoke_pending_callbacks(pvVar5); pvVar5 = (void *)((int)pvVar5 + 0x78); } while (pvVar5 != pvVar1); pvVar5 = (void *)*in_ECX; } FUN_004d7450(pvVar5,(in_ECX[2] - (int)pvVar5) / 0x78); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x2222222 < local_8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar5 = _Allocate(local_8 * 0x78); uVar4 = 0; *in_ECX = (int)pvVar5; in_ECX[1] = (int)pvVar5; in_ECX[2] = (int)(local_8 * 0x78 + (int)pvVar5); } _Copy_unchecked(pvVar5); iVar3 = _Uninitialized_copy(param_1 + uVar4 * 0x78,param_2,in_ECX[1]); in_ECX[1] = iVar3; return; } //@@ 00709770 FUN_00709770 int * FUN_00709770(undefined4 *param_1,int param_2,undefined4 param_3) { int *piVar1; int iVar2; undefined4 *in_ECX; int *piVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afc58d; local_10 = ExceptionList; ExceptionList = &local_10; piVar3 = (int *)*in_ECX; if (*(char *)((int)param_1 + 0xd) == '\0') { local_8 = 0; piVar1 = operator_new(0x14); piVar1[4] = param_1[4]; *piVar1 = (int)piVar3; piVar1[2] = (int)piVar3; *(undefined2 *)(piVar1 + 3) = 0; piVar1[1] = param_2; *(undefined1 *)(piVar1 + 3) = *(undefined1 *)(param_1 + 3); local_8 = 1; if (*(char *)((int)piVar3 + 0xd) != '\0') { piVar3 = piVar1; } iVar2 = FUN_00709770(*param_1,piVar1,param_3); *piVar1 = iVar2; iVar2 = FUN_00709770(param_1[2],piVar1,param_3); piVar1[2] = iVar2; } ExceptionList = local_10; return piVar3; } //@@ 00709832 Catch_All@00709832 void Catch_All_00709832(void) { fuzzer_allocator_> *pfVar1; void *this; int unaff_EBP; _Tree_node *p_Var2; p_Var2 = *(_Tree_node **)(unaff_EBP + 0xc); pfVar1 = (fuzzer_allocator_> *)Config::GetCollectibles(); FID_conflict__Erase_tree_>_> (this,pfVar1,p_Var2); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00709850 FUN_00709850 void FUN_00709850(void) { char cVar1; char *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 0x1c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x1c) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x18); } } std::string::_Tidy_deallocate(in_ECX); ExceptionList = local_10; return; } //@@ 007098c0 FUN_007098c0 void FUN_007098c0(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 8) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 8) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 4); } } ExceptionList = local_10; return; } //@@ 00709930 FUN_00709930 void FUN_00709930(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 007099a0 std::vector<8byte>::_Clear_and_reserve /* DB: frees old buffer and allocates a new one for param_1 8-byte elements with 1.5x growth (max 0x1fffffff), begin=end; Game::store_game_state/restore_game_state */ void std::vector<8byte>::_Clear_and_reserve(uint param_1) { void *pvVar1; undefined4 *in_ECX; uint count; uint uVar2; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } pvVar1 = (void *)*in_ECX; count = in_ECX[2] - (int)pvVar1 >> 3; if (0x1fffffff - (count >> 1) < count) { uVar2 = 0x1fffffff; } else { uVar2 = (count >> 1) + count; if (uVar2 < param_1) { uVar2 = param_1; } } if (pvVar1 != (void *)0x0) { deallocate(pvVar1,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x1fffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar1 = _Allocate(uVar2 * 8); *in_ECX = pvVar1; in_ECX[1] = pvVar1; in_ECX[2] = (void *)((int)pvVar1 + uVar2 * 8); return; } //@@ 00709a30 std::_Copy_unchecked /* DB: copies [ECX, EDX) of 0x68-byte EntitySaveState field by field into param_1; caller std::vector::assign */ undefined4 * std::_Copy_unchecked(undefined4 *param_1) { int iVar1; undefined4 uVar2; char cVar3; uint uVar4; int iVar5; undefined4 *puVar6; int in_ECX; int in_EDX; undefined4 *puVar7; undefined4 *puVar8; undefined1 local_20 [4]; int *local_1c; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_20 + 0x1c); if (in_ECX == in_EDX) { return param_1; } puVar8 = (undefined4 *)(in_ECX + 4); iVar5 = (in_ECX - (int)param_1) + -0x68; puVar7 = param_1 + 0x1a; ExceptionList = &local_10; local_18 = in_EDX; do { *param_1 = *(undefined4 *)((int)puVar7 + iVar5); puVar7[-0x19] = *puVar8; puVar7[-0x18] = puVar8[1]; puVar7[-0x17] = puVar8[2]; puVar7[-0x16] = puVar8[3]; puVar7[-0x15] = puVar8[4]; puVar7[-0x14] = puVar8[5]; *(undefined1 *)((int)puVar7 + -0x46) = *(undefined1 *)((int)puVar8 + 0x1e); puVar7[-0x11] = puVar8[8]; puVar7[-0x13] = puVar8[6]; *(undefined2 *)(puVar7 + -0x12) = *(undefined2 *)(puVar8 + 7); puVar7[-0x10] = puVar8[9]; puVar7[-0xf] = puVar8[10]; puVar7[-0xe] = puVar8[0xb]; puVar7[-0xd] = puVar8[0xc]; puVar7[-0xc] = puVar8[0xd]; puVar7[-0xb] = puVar8[0xe]; puVar7[-10] = puVar8[0xf]; iVar1 = puVar8[0xe]; puVar7[-8] = iVar1; puVar7[-7] = iVar1 >> 0x1f; *(undefined1 *)((int)puVar7 + -0x45) = *(undefined1 *)((int)puVar8 + 0x1f); puVar7[-6] = puVar8[0x13]; puVar7[-5] = puVar8[0x14]; *(undefined1 *)(puVar7 + -2) = *(undefined1 *)(puVar8 + 0x17); puVar7[-4] = puVar8[0x15]; puVar7[-3] = puVar8[0x16]; puVar6 = (undefined4 *)FUN_004d7250(puVar8 + 0x18); uVar2 = puVar6[1]; puVar6[1] = *puVar7; *puVar7 = uVar2; uVar2 = *puVar6; *puVar6 = puVar7[-1]; puVar7[-1] = uVar2; local_8 = 0; if (local_1c != (int *)0x0) { cVar3 = (**(code **)(*local_1c + 0xc))(uVar4); if ((cVar3 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(local_20); } } local_8 = 0xffffffff; SharedPtr::assign(puVar7 + 1,puVar8 + 0x1a); puVar7 = puVar7 + 0x1e; param_1 = param_1 + 0x1e; puVar8 = puVar8 + 0x1e; } while ((int)puVar7 + iVar5 != local_18); ExceptionList = local_10; return param_1; } //@@ 00709bc0 FUN_00709bc0 int FUN_00709bc0(void) { uint *puVar1; int iVar2; puVar1 = (uint *)FUN_0041d4c0(); iVar2 = __stdio_common_vsprintf(*puVar1 | 2,puVar1[1]); if (iVar2 < 0) { iVar2 = -1; } return iVar2; } //@@ 00709c00 GridEntity::SetType /* ZHL [lua] Lua binding GridEntity:SetType */ void GridEntity::SetType(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 4) = param_1; return; } //@@ 00709c10 GridEntity::Destroy /* ZHL [vtable slot 5] */ void __thiscall GridEntity::Destroy(GridEntity *this) { undefined4 uStack00000004; uStack00000004 = 4; /* WARNING: Could not recover jumptable at 0x00709c20. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x10))(); return; } //@@ 00709c30 GridEntity::CanTakeDamageFromTearEffects /* ZHL [vtable slot 7] */ undefined1 __thiscall GridEntity::CanTakeDamageFromTearEffects(void) { return 1; } //@@ 00709c40 GridEntity::GridEntity /* DB: writes GridEntity vftable and constructs ANM2 member prototype: db/protos.zhl */ void __thiscall GridEntity::GridEntity(GridEntity *this) { *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; (this->_desc)._type = 0; (this->_desc)._variant = 0; (this->_desc)._state = 0; (this->_desc)._spawnCount = 0; (this->_desc)._spawnSeed = 0x16a9de81; (this->_desc)._varData = 0; (this->_desc)._initialized = 0; (this->_desc)._variableSeed = 0x16a9de81; (this->_rng)._shift1 = 5; (this->_rng)._shift2 = 9; (this->_rng)._seed = -0x55e8beb1; (this->_rng)._shift3 = 7; ANM2::constructor(&this->_sprite); return; } //@@ 00709cb0 GridEntity::Free /* ZHL [vtable slot 0] */ GridEntity * __thiscall GridEntity::Free(GridEntity *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x154); } ExceptionList = local_10; return this; } //@@ 00709d40 GridEntity::~GridEntity /* DB: sets GridEntity::vftable then destroys _sprite (+0x40: ANM2::Reset, 2 AnimationState dtors, 2 strings); same body as GridEntity::Free (00709cb0) without the operator_delete(0x154); only unwind callers prototype: db/protos.zhl */ void __thiscall GridEntity::~GridEntity(GridEntity *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); ExceptionList = local_10; return; } //@@ 00709db0 GridEntity::Init /* ZHL [exact] __thiscall void GridEntity::Init(unsigned int Seed); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall GridEntity::Init(GridEntity *this,uint Seed) { int *piVar1; Game *pGVar2; (this->_desc)._spawnSeed = Seed; this->_collisionClass = 0; (**(code **)(*(int *)this + 0x20))(); pGVar2 = g_game; piVar1 = &(this->_desc)._spawnCount; *piVar1 = *piVar1 + 1; (this->_desc)._initialized = 1; this->_spawnFrame = pGVar2->_frameCount; return; } //@@ 00709df0 GridEntity::Position /* ZHL [lua] Lua binding GridEntity:Position prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall GridEntity::Position(GridEntity *this,Vector *outPosition) { int iVar1; int iVar2; iVar1 = this->_gridIndex; iVar2 = *(int *)((int)g_game->_room + 0xc); outPosition->x = (float)(iVar1 % iVar2) * 40.0 + 40.0; outPosition->y = (float)(iVar1 / iVar2) * 40.0 + 120.0; return outPosition; } //@@ 00709e50 GridEntity::get_render_position /* DB: thiscall(out Vector*) on GridEntity (+0x24 grid index): x = (idx%width*40+40-60)*0.65 + (screenCenterX-338)*0.5, y likewise from idx/width, pixel-snapped; first call in every GridEntity_*::Render prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall GridEntity::get_render_position(GridEntity *this,Vector *outPosition) { int iVar1; int iVar2; float fVar3; double dVar4; iVar1 = this->_gridIndex; fVar3 = g_displayPixelRatio * g_screenPointScale; iVar2 = *(int *)((int)g_game->_room + 0xc); dVar4 = floor((double)(((((float)(iVar1 % iVar2) * 40.0 + 40.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar3 + 0.5)); outPosition->x = (float)dVar4 / fVar3; dVar4 = floor((double)(((((float)(iVar1 / iVar2) * 40.0 + 120.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar3 + 0.5)); outPosition->y = (float)dVar4 / fVar3; return outPosition; } //@@ 00709f90 GridEntity_Wall::GetWaterClipInfo /* ZHL [exact] WaterClipInfo* GetWaterClipInfo(WaterClipInfo* out); */ void GridEntity_Wall::GetWaterClipInfo(undefined4 *param_1) { *param_1 = 0x39; param_1[1] = 0; return; } //@@ 00709fb0 GridEntity::hurt_func /* DB: zhl hurt_func(Entity*,DamageAmount,PlayerDamage,u64 DamageFlags,bool IgnoreGridCollisionClass); called per entity from GridEntity::hurt_surroundings; sacrifice-room spikes "#YOU_FEEL_BLESSED"/TeleportUp prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall GridEntity::hurt_func (GridEntity *this,Entity *ent,float DamageAmount,int PlayerDamage,ulonglong DamageFlags, byte IgnoreGridCollisionClass) { int *piVar1; Room *this_00; code *pcVar2; KColor color; qword qVar3; void **ppvVar4; byte bVar5; char isDamaged; uint isSpikeDamage3; Entity_Player *player; int iVar7; Entity **ppEVar8; Vector *tmpPos; StringTable *stringTable; byte *fortuneText; ChallengeParam *challengeParams; Entity_Pickup *pickup; int extraout_EDX; qword *allocatedBytes; EntityPtr rewardPlayer; Entity_Pickup *nearestPickup; float fVar9; float offsetY; Entity *pEVar10; undefined3 in_stack_00000015; uint queryEntities; EntityRef sourceRef; RNG spikeRng; Vector local_30; undefined1 local_28 [12]; uint local_1c; float damage; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; int gridWidth; ulonglong isSpikeDamage; ulonglong isSpikeDamage2; ulonglong isSpikeDamage3; ulonglong isSpikeDamage4; Manager *manager; undefined4 queryEntities; pEVar10 = ent; local_8 = 0xffffffff; puStack_c = &LAB_00afc5bd; local_10 = ExceptionList; isSpikeDamage3 = __security_cookie ^ (uint)(local_28 + 0x24); if ((IgnoreGridCollisionClass == 0) && ((((iVar7 = ent->_entityGridCollisionClass, iVar7 == 0 || (iVar7 == 3)) || (iVar7 == 1)) || (iVar7 == 2)))) { return; } isSpikeDamage = DamageFlags & 0x80; isSpikeDamage2 = DamageFlags & 0x80; isSpikeDamage3 = DamageFlags & 0x80; isSpikeDamage4 = DamageFlags & 0x80; if (((DamageFlags & 0x80) != 0) && ((ent->_flags & 0x80000) != 0)) { return; } iVar7 = ent->_type; if (iVar7 == 0x362) { return; } if (iVar7 == 0x322) { return; } local_1c = (uint)(float)DamageFlags & 2; ppvVar4 = &local_10; local_30.y = (float)this; damage = DamageAmount; if ((DamageFlags & 2) != 0) { if (iVar7 == 0x36) { return; } if (iVar7 == 0x1c) { if (ent->_variant == 2) { return; } } else if (iVar7 == 1) { ExceptionList = &local_10; bVar5 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&ent[5]._sprite._nullLayerNames,0x53); if (bVar5 != 0) { ExceptionList = local_10; return; } iVar7 = pEVar10->_type; ppvVar4 = ExceptionList; } } ExceptionList = ppvVar4; ent = (Entity *)((uint)(float)DamageFlags & 0x200); if (((ent != (Entity *)0x0) && (iVar7 == 0x1c)) && (pEVar10->_variant == 2)) { ExceptionList = local_10; return; } if (((isSpikeDamage != 0) && (iVar7 == 1)) && (IgnoreGridCollisionClass == 0)) { bVar5 = Entity_Player::HasTrinket((Entity_Player *)pEVar10,0xe,0); if (bVar5 != 0) { ExceptionList = local_10; return; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)pEVar10,0x23b,0); if (bVar5 != 0) { ExceptionList = local_10; return; } } if (((ent != (Entity *)0x0) && (pEVar10->_type == 3)) && (pEVar10->_variant == 0xc9)) { ExceptionList = local_10; return; } if (pEVar10->_type == 3) { if (pEVar10->_variant == 0xce) { ExceptionList = local_10; return; } if (pEVar10->_variant == 0xed) { ExceptionList = local_10; return; } if (pEVar10->_variant == 0xee) { ExceptionList = local_10; return; } } EntityRef::EntityRef(&sourceRef); sourceRef._variant = (this->_desc)._type; sourceRef._type = 0; if ((extraout_EDX == 1) || ((extraout_EDX == 3 && ((pEVar10->_variant == 0x3e || (pEVar10->_variant == 0x43)))))) { if (*(int *)&g_game->_deathmatchManager < 2) { damage = (float)PlayerDamage; player = (Entity_Player *)Entity::GetPlayerAncestor(pEVar10); iVar7 = Entity_Player::GetTrinketMultiplier(player,0xe); if (((1 < iVar7) && (*(int *)((int)g_game->_room + 8) == 0xd)) && ((this->_desc)._type == 8)) { damage = damage * 0.5; } } if ((pEVar10->_type == 1) && (isSpikeDamage2 != 0)) { color._alpha = 1.0; color._red = 0.47058824; color._green = 0.0; color._blue = 0.0; color._unk = 0; Entity_Player::SetFootprintColor((Entity_Player *)pEVar10,color,1); } } if (pEVar10->_isInvicible != 0) { ExceptionList = local_10; return; } isDamaged = (**(code **)(*(int *)pEVar10 + 0x20))(damage,DamageFlags,&sourceRef,0x1e,isSpikeDamage3); if (isDamaged == '\0') { ExceptionList = local_10; return; } if (local_1c != 0) { _IgnoreGridCollisionClass = (Entity *)(pEVar10->_health * 0.05 + 0.5); ent = (Entity *)0x3f800000; ppEVar8 = (Entity **)&IgnoreGridCollisionClass; if (1.0 <= (float)_IgnoreGridCollisionClass) { ppEVar8 = &ent; } SoundEffects::PlayWithFartOverride(0x2b,(float)*ppEVar8,2,0,1.0); } tmpPos = Position(this,(Vector *)&DamageFlags); DamageFlags._0_4_ = (pEVar10->_pos).x - tmpPos->x; DamageFlags._4_4_ = (pEVar10->_pos).y - tmpPos->y; tmpPos = Vector::Normalized((Vector *)&DamageFlags,(Vector *)(local_28 + 8)); fVar9 = tmpPos->y; (pEVar10->_velocity).x = tmpPos->x * 4.0 + (pEVar10->_velocity).x; (pEVar10->_velocity).y = fVar9 * 4.0 + (pEVar10->_velocity).y; iVar7 = (this->_desc)._type; if (iVar7 != 8) { if (iVar7 != 0x1c) { ExceptionList = local_10; return; } if (pEVar10->_type != 1) { if (pEVar10->_type != 3) { ExceptionList = local_10; return; } if (pEVar10->_variant != 0x3e) { ExceptionList = local_10; return; } } if (isSpikeDamage4 == 0) { ExceptionList = local_10; return; } piVar1 = &(this->_desc)._varData; *piVar1 = *piVar1 + 1; spikeRng._seed = (this->_desc)._spawnSeed; spikeRng._shift1 = 5; spikeRng._shift2 = 9; spikeRng._shift3 = 7; if ((((this->_desc)._varData < 2) && (isSpikeDamage3 = RNG::RandomInt(&spikeRng,2), isSpikeDamage3 != 0)) && (iVar7 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x38), iVar7 < 3)) { ExceptionList = local_10; return; } if ((this->_desc)._type != 0x1c) { ExceptionList = local_10; return; } nearestPickup = (Entity_Pickup *)0x0; iVar7 = *(int *)((int)g_game->_room + 0xc); ent = (Entity *)((float)(this->_gridIndex % iVar7) * 40.0 + 40.0); PlayerDamage = (int)((float)(this->_gridIndex / iVar7) * 40.0 + 120.0); _IgnoreGridCollisionClass = (Entity *)0x7f7fffff; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_28,5,100,-1,0,0); queryEntities = local_28._4_4_; isSpikeDamage3 = 0; local_8 = 1; if (local_1c != 0) { do { pickup = (Entity_Pickup *) __RTDynamicCast(*(undefined4 *)(queryEntities + isSpikeDamage3 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); this = (GridEntity *)local_30.y; if (((pickup != (Entity_Pickup *)0x0) && (pickup->_price == -10)) && (fVar9 = (pickup->_pos).x - (float)ent, offsetY = (pickup->_pos).y - (float)PlayerDamage, pEVar10 = (Entity *)(offsetY * offsetY + fVar9 * fVar9), (float)pEVar10 < (float)_IgnoreGridCollisionClass)) { nearestPickup = pickup; _IgnoreGridCollisionClass = pEVar10; } isSpikeDamage3 = isSpikeDamage3 + 1; } while (isSpikeDamage3 < local_1c); if (nearestPickup != (Entity_Pickup *)0x0) { Entity_Pickup::update_price_sprite(nearestPickup,0); nearestPickup->_isAutoUpdatePrice = 0; if (nearestPickup->_variant == 100) { nearestPickup->_state = 1; } } } GridEntity_Spikes::unsummon((GridEntity_Spikes *)this,0); if (local_28[0] != '\0') { ExceptionList = local_10; return; } if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_28._4_4_ == (void *)0x0) { ExceptionList = local_10; return; } isSpikeDamage3 = *(uint *)(local_28._4_4_ + -4); qVar3 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - isSpikeDamage3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar3 < isSpikeDamage3); free((uint *)(local_28._4_4_ + -4)); ExceptionList = local_10; return; } if (pEVar10->_type != 1) { if (pEVar10->_type != 3) { ExceptionList = local_10; return; } if (pEVar10->_variant != 0x3e) { ExceptionList = local_10; return; } } if (isSpikeDamage3 == 0) { ExceptionList = local_10; return; } if ((*(int *)((int)g_game->_room + 8) != 0xd) && ((uint)(this->_desc)._variant < 100)) { ExceptionList = local_10; return; } if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 2 & 1) != 0) { ExceptionList = local_10; return; } player = (Entity_Player *)Entity::GetLastSpawner(pEVar10); if ((player == (Entity_Player *)0x0) || (player->_type != 1)) { player = (Entity_Player *)0x0; rewardPlayer = (EntityPtr)0x0; } else if ((player->_playerType != 0x28) || (rewardPlayer = player->_twinPlayer, player->_twinPlayer == (EntityPtr)0x0)) { rewardPlayer = (EntityPtr)player; } local_28._0_4_ = RNG::Next(&this->_rng); iVar7 = (this->_desc)._varData; local_1c = 0x13; (this->_desc)._varData = iVar7 + 1; local_28._4_4_ = 1; local_28._8_4_ = 5; if (99 < (uint)(this->_desc)._variant) { _IgnoreGridCollisionClass = (Entity *)RNG::RandomFloat((RNG *)local_28); if ((float)_IgnoreGridCollisionClass < 0.15) { iVar7 = 6; isSpikeDamage3 = local_28._0_4_; do { if (isSpikeDamage3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } isSpikeDamage3 = isSpikeDamage3 >> (local_28[4] & 0x1f) ^ isSpikeDamage3; isSpikeDamage3 = isSpikeDamage3 << (local_28[8] & 0x1f) ^ isSpikeDamage3; isSpikeDamage3 = isSpikeDamage3 >> ((byte)local_1c & 0x1f) ^ isSpikeDamage3; gridWidth = g_game->_room->_gridWidth; DamageFlags._0_4_ = (float)(this->_gridIndex % gridWidth) * 40.0 + 40.0; DamageFlags._4_4_ = (float)(this->_gridIndex / gridWidth) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpPos,&g_vectorZero,(Entity *)0x0,1,isSpikeDamage3); iVar7 = iVar7 + -1; } while (iVar7 != 0); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } if (0.48 <= (float)_IgnoreGridCollisionClass) { if ((float)_IgnoreGridCollisionClass < 0.58) { iVar7 = 2; isSpikeDamage3 = local_28._0_4_; do { if (isSpikeDamage3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } isSpikeDamage3 = isSpikeDamage3 >> (local_28[4] & 0x1f) ^ isSpikeDamage3; isSpikeDamage3 = isSpikeDamage3 << (local_28[8] & 0x1f) ^ isSpikeDamage3; isSpikeDamage3 = isSpikeDamage3 >> ((byte)local_1c & 0x1f) ^ isSpikeDamage3; gridWidth = g_game->_room->_gridWidth; DamageFlags._0_4_ = (float)(this->_gridIndex % gridWidth) * 40.0 + 40.0; DamageFlags._4_4_ = (float)(this->_gridIndex / gridWidth) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,10,tmpPos,&g_vectorZero,(Entity *)0x0,6,isSpikeDamage3); iVar7 = iVar7 + -1; } while (iVar7 != 0); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } if ((float)_IgnoreGridCollisionClass < 0.63) { isSpikeDamage3 = RNG::Next((RNG *)local_28); this_00 = g_game->_room; tmpPos = Position(this,(Vector *)&DamageFlags); tmpPos = Room::FindFreePickupSpawnPosition(this_00,&local_30,tmpPos,0.0,0,0,0); queryEntities = 0; goto LAB_0070ab5f; } if (((float)_IgnoreGridCollisionClass < 0.65) && (rewardPlayer != (EntityPtr)0x0)) { Entity_Player::IncrementPlayerFormCounter((Entity_Player *)rewardPlayer,8,3); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } } else if (rewardPlayer != (EntityPtr)0x0) { TemporaryEffects::AddCollectibleEffect ((TemporaryEffects *)((int)rewardPlayer + 0x1508),0x2b4,0,1); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } goto LAB_0070af38; } switch(iVar7) { case 0: case 1: if (((g_game->_levelStateFlags & 0x10000U) != 0) && (player = Game::GetPlayer(g_game,0), player->_numBombs < 1)) { RNG::Next((RNG *)local_28); isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,0x28,tmpPos,&g_vectorZero,(Entity *)0x0,1,isSpikeDamage3); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,2); if (isSpikeDamage3 == 0) { isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpPos,&g_vectorZero,(Entity *)0x0,1,isSpikeDamage3); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } break; case 2: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,2); if (isSpikeDamage3 == 0) { fVar9 = g_game->_angelRoomChance + 0.15; goto LAB_0070a7f1; } break; case 3: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,2); if (isSpikeDamage3 == 0) goto LAB_0070a846; break; case 4: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,2); if (isSpikeDamage3 != 0) { iVar7 = 3; isSpikeDamage3 = local_28._0_4_; do { if (isSpikeDamage3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } isSpikeDamage3 = isSpikeDamage3 >> (local_28[4] & 0x1f) ^ isSpikeDamage3; DamageFlags._0_4_ = 320.0; isSpikeDamage3 = isSpikeDamage3 << (local_28[8] & 0x1f) ^ isSpikeDamage3; DamageFlags._4_4_ = 340.0; isSpikeDamage3 = isSpikeDamage3 >> ((byte)local_1c & 0x1f) ^ isSpikeDamage3; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpPos,&g_vectorZero,(Entity *)0x0,1,isSpikeDamage3); iVar7 = iVar7 + -1; } while (iVar7 != 0); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } fVar9 = g_game->_angelRoomChance + 0.5; LAB_0070a7f1: stringTable = &g_manager->_stringTable; g_game->_angelRoomChance = fVar9; fortuneText = string_table_translate(stringTable,(byte *)"#YOU_FEEL_BLESSED"); HUD::show_fortune_text_impl(fortuneText); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; case 5: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,3); if (isSpikeDamage3 == 0) { Level::InitializeDevilAngelRoom((Level *)g_game,1,0); game = g_game; g_game->_leaveDoor = -1; Level::InitializeDevilAngelRoom((Level *)game,0,0); Game::StartRoomTransition(g_game,-1,-1,3,player,-1); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } LAB_0070a846: isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,0x32,tmpPos,&g_vectorZero,(Entity *)0x0,0,isSpikeDamage3); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; case 6: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,3); if (isSpikeDamage3 == 0) { isSpikeDamage3 = RNG::Next((RNG *)local_28); game = g_game; queryEntities = RNG::Next((RNG *)local_28); queryEntities = ItemPool::GetCollectible(&game->_itemPool,4,queryEntities,0,0,0); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); } else { if ((((isSpikeDamage3 != 2) || (g_game->_devilRoomDeals < 1)) || (bVar5 = ItemPool::is_collectible_available(&g_game->_itemPool,0x2a1,0), bVar5 == 0)) || (6 < g_game->_stage)) { isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,10,tmpPos,&g_vectorZero,(Entity *)0x0,3,isSpikeDamage3); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); queryEntities = 0x2a1; } LAB_0070ab5f: Game::Spawn(g_game,5,100,tmpPos,&g_vectorZero,(Entity *)0x0,queryEntities,isSpikeDamage3); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; case 7: *(undefined4 *)((int)g_game->_room + 0x7230) = 0x23; (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; case 8: isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); queryEntities = 0x10f; goto LAB_0070ac10; case 9: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,2); if (isSpikeDamage3 != 0) { iVar7 = 0x1e; isSpikeDamage3 = local_28._0_4_; do { if (isSpikeDamage3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } isSpikeDamage3 = isSpikeDamage3 >> (local_28[4] & 0x1f) ^ isSpikeDamage3; DamageFlags._0_4_ = 320.0; isSpikeDamage3 = isSpikeDamage3 << (local_28[8] & 0x1f) ^ isSpikeDamage3; DamageFlags._4_4_ = 340.0; isSpikeDamage3 = isSpikeDamage3 >> ((byte)local_1c & 0x1f) ^ isSpikeDamage3; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,0x14,tmpPos,&g_vectorZero,(Entity *)0x0,1,isSpikeDamage3); iVar7 = iVar7 + -1; } while (iVar7 != 0); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } iVar7 = 7; isSpikeDamage3 = local_28._0_4_; do { if (isSpikeDamage3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } isSpikeDamage3 = isSpikeDamage3 >> (local_28[4] & 0x1f) ^ isSpikeDamage3; DamageFlags._0_4_ = 320.0; isSpikeDamage3 = isSpikeDamage3 << (local_28[8] & 0x1f) ^ isSpikeDamage3; DamageFlags._4_4_ = 340.0; isSpikeDamage3 = isSpikeDamage3 >> ((byte)local_1c & 0x1f) ^ isSpikeDamage3; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); Game::Spawn(g_game,5,10,tmpPos,&g_vectorZero,(Entity *)0x0,3,isSpikeDamage3); iVar7 = iVar7 + -1; } while (iVar7 != 0); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; case 10: isSpikeDamage3 = RNG::Next((RNG *)local_28); DamageFlags._0_4_ = 320.0; DamageFlags._4_4_ = 340.0; tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_30,(Vector *)&DamageFlags,0.0,0,0,0); queryEntities = 0x110; LAB_0070ac10: pEVar10 = Game::Spawn(g_game,queryEntities,0,tmpPos,&g_vectorZero,(Entity *)0x0,0,isSpikeDamage3); (**(code **)(*(int *)pEVar10 + 0xc))(); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; default: isSpikeDamage3 = RNG::RandomInt((RNG *)local_28,2); game = g_game; if (((isSpikeDamage3 == 0) && (g_game->_difficulty != 2)) && (g_game->_difficulty != 3)) { challengeParams = Game::GetChallengeParams(g_game); iVar7 = 0xc; if ((challengeParams->_endStage != 0xc) && (((game->_challenge != 0 || ((game->_dailyChallenge)._id != 0)) || (((g_manager->_persistentGameData)._achievements[0x140] == 0 && ((g_manager->_state != 2 || (game->_isDebug == 0)))))))) { iVar7 = 0xb; } if (challengeParams->_isPathTypeSet != 0) { if (challengeParams->_pathType == 1) break; if (challengeParams->_endStage != 0) { iVar7 = challengeParams->_endStage; } if (challengeParams->_pathType == 3) break; } if (10 < iVar7) { if ((game->_stage == 0xb) && (game->_stageType == 0)) { game->_leaveDoor = -1; Game::StartRoomTransition(game,game->_startingRoomIdx,-1,3,player,0); (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } Game::StartStageTransition(game,0,2,0); Entity_Player::PlayExtraAnimation(player,(byte *)"TeleportUp"); manager = g_manager; _IgnoreGridCollisionClass = (Entity *)0xd7; seed_fart_sound_override((int *)&IgnoreGridCollisionClass); SoundEffects::Play(&manager->_sfxManager,(int)_IgnoreGridCollisionClass,1.0,2,0,1.0,0.0); } } } LAB_0070af38: (this->_desc)._variableSeed = (this->_rng)._seed; ExceptionList = local_10; return; } //@@ 0070b170 GridEntity::hurt_surroundings /* ZHL [exact] __thiscall void GridEntity::hurt_surroundings(float Distance, float PlayerDistance, float DamageAmount, int PlayerDamage, uint64_t DamageFlags, bool IgnoreGridCollisionClass); prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall GridEntity::hurt_surroundings (GridEntity *this,float distance,float playerDistance,float damageAmount,int playerDamage, ulonglong damageFlags,byte isIgnoreGridCollisionClass) { void *pvVar1; Entity *ent; int iVar2; uint uVar3; float fVar4; float fVar5; float local_8; uVar3 = 0; pvVar1 = g_game->_room; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { ent = *(Entity **)(*(int *)((int)pvVar1 + 0x125c) + uVar3 * 4); iVar2 = *(int *)((int)g_game->_room + 0xc); fVar5 = (ent->_pos).x - ((float)(this->_gridIndex % iVar2) * 40.0 + 40.0); fVar4 = (ent->_pos).y - ((float)(this->_gridIndex / iVar2) * 40.0 + 120.0); local_8 = distance; if (ent->_type == 1) { local_8 = playerDistance; } fVar4 = sqrtf(fVar4 * fVar4 + fVar5 * fVar5); if ((fVar4 < local_8 + ent->_size) && (ent->_entityCollisionClass != 0)) { hurt_func(this,ent,damageAmount,playerDamage,damageFlags,isIgnoreGridCollisionClass); } uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)pvVar1 + 0x1264)); } return; } //@@ 0070b2a0 GridEntity::IsBreakableRock /* ZHL [exact] __thiscall bool GridEntity::IsBreakableRock(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall GridEntity::IsBreakableRock(GridEntity *this) { int iVar1; iVar1 = (this->_desc)._type; if ((iVar1 == 2) || ((iVar1 != 3 && (((((iVar1 == 4 || (iVar1 == 5)) || (iVar1 == 6)) || (iVar1 == 0x16)) || ((iVar1 != 0x18 && (((iVar1 == 0x19 || (iVar1 == 0x1a)) || (iVar1 == 0x1b)))))))))) { return 1; } return 0; } //@@ 0070b2e0 Isaac::CreateGridEntity /* ZHL [exact] static cleanup GridEntity* Isaac::CreateGridEntity(int Type, unsigned int Index); prototype: db/protos.zhl */ GridEntity * __cdecl Isaac::CreateGridEntity(int type,uint gridIndex) { GridEntity *pGVar1; ANM2 *pAVar2; GridEntity *gridEntity; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc759; local_10 = ExceptionList; switch(type) { default: return (GridEntity *)0x0; case 1: ExceptionList = &local_10; gridEntity = operator_new(0x154); local_8 = 0; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Decoration::vftable; goto LAB_0070b8aa; } break; case 2: case 3: case 4: case 5: case 6: case 0x16: case 0x18: case 0x19: case 0x1a: case 0x1b: ExceptionList = &local_10; gridEntity = operator_new(0x198); local_8 = 1; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Rock::vftable; *(undefined4 *)(gridEntity + 1) = 0; gridEntity[1]._desc._spawnCount = 0; gridEntity[1]._desc._spawnSeed = 0xf; *(undefined1 *)(gridEntity + 1) = 0; gridEntity[1]._desc._varData = 0; gridEntity[1]._spawnFrame = 0; gridEntity[1]._rng._seed = 0xf; *(undefined1 *)&gridEntity[1]._desc._varData = 0; gridEntity[1]._rng._shift1 = 0; gridEntity[1]._rng._shift2 = 0; gridEntity[1]._rng._shift3 = 0; goto LAB_0070b8aa; } break; case 7: ExceptionList = &local_10; gridEntity = operator_new(0x158); local_8 = 6; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Pit::vftable; goto LAB_0070b8aa; } break; case 8: case 9: case 0x1c: ExceptionList = &local_10; gridEntity = operator_new(0x158); local_8 = 0xd; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Spikes::vftable; goto LAB_0070b8aa; } break; case 10: ExceptionList = &local_10; gridEntity = operator_new(0x154); local_8 = 0xe; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Web::vftable; goto LAB_0070b8aa; } break; case 0xb: ExceptionList = &local_10; gridEntity = operator_new(0x158); local_8 = 0xf; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Lock::vftable; goto LAB_0070b8aa; } break; case 0xc: ExceptionList = &local_10; gridEntity = operator_new(0x158); local_8 = 0xc; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_TNT::vftable; goto LAB_0070b8aa; } break; case 0xd: ExceptionList = &local_10; gridEntity = operator_new(0x390); local_8 = 8; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); local_8._0_1_ = 9; *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Fire::vftable; ANM2::constructor((ANM2 *)(gridEntity + 1)); gridEntity[1]._sprite._championColor._tint[2] = 0.0; gridEntity[1]._sprite._championColor._tint[3] = 0.0; gridEntity[1]._sprite._championColor._colorize[0] = 0.0; local_8 = CONCAT31(local_8._1_3_,0xb); ANM2::constructor((ANM2 *)(gridEntity[1]._sprite._championColor._colorize + 1)); goto LAB_0070b8aa; } break; case 0xe: ExceptionList = &local_10; gridEntity = operator_new(0x19c); local_8 = 7; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Poop::vftable; gridEntity[1]._desc._type = 0; gridEntity[1]._desc._spawnSeed = 0; gridEntity[1]._desc._varData = 0xf; *(undefined1 *)&gridEntity[1]._desc._type = 0; gridEntity[1]._desc._variableSeed = 0; gridEntity[1]._gridIndex = 0; gridEntity[1]._spawnFrame = 0; gridEntity[1]._rng._seed = 0; gridEntity[1]._rng._shift1 = (int)g_vectorZero.x; gridEntity[1]._rng._shift2 = (int)g_vectorZero.y; gridEntity[1]._rng._shift3 = (int)g_vectorZero.x; gridEntity[1]._collisionClass = (int)g_vectorZero.y; pGVar1 = gridEntity + 1; (pGVar1->_sprite)._filename._buf[0] = '\0'; (pGVar1->_sprite)._filename._buf[1] = '\0'; (pGVar1->_sprite)._filename._buf[2] = '\0'; (pGVar1->_sprite)._filename._buf[3] = '\0'; pAVar2 = &gridEntity[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; goto LAB_0070b8aa; } break; case 0xf: ExceptionList = &local_10; gridEntity = operator_new(0x154); local_8 = 5; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Wall::vftable; goto LAB_0070b8aa; } break; case 0x10: ExceptionList = &local_10; gridEntity = operator_new(0x404); local_8 = 2; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); local_8._0_1_ = 3; *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Door::vftable; ANM2::constructor((ANM2 *)&gridEntity[1]._desc._spawnSeed); local_8 = CONCAT31(local_8._1_3_,4); ANM2::constructor((ANM2 *)(gridEntity[1]._sprite._championColor._colorize + 1)); gridEntity[2]._sprite._color._colorize[1] = 0.0; gridEntity[2]._sprite._color._offset[1] = 0.0; gridEntity[2]._sprite._color._offset[2] = 2.10195e-44; *(undefined1 *)(gridEntity[2]._sprite._color._colorize + 1) = 0; gridEntity[2]._sprite._championColor._tint[0] = 0.0; gridEntity[2]._sprite._championColor._colorize[0] = 0.0; gridEntity[2]._sprite._championColor._colorize[1] = 2.10195e-44; *(undefined1 *)gridEntity[2]._sprite._championColor._tint = 0; gridEntity[2]._sprite._championColor._colorize[2] = 0.0; gridEntity[2]._sprite._championColor._offset[2] = 0.0; gridEntity[2]._sprite._flipX = 0xf; gridEntity[2]._sprite._flipY = 0; *(undefined2 *)&gridEntity[2]._sprite.field_0x102 = 0; *(undefined1 *)(gridEntity[2]._sprite._championColor._colorize + 2) = 0; gridEntity[2]._sprite._playbackSpeed = 0.0; *(undefined4 *)(gridEntity + 3) = 0; gridEntity[3]._desc._type = 0xf; *(undefined1 *)&gridEntity[2]._sprite._playbackSpeed = 0; goto LAB_0070b8aa; } break; case 0x11: ExceptionList = &local_10; gridEntity = operator_new(0x158); local_8 = 0x10; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_TrapDoor::vftable; *(undefined4 *)(gridEntity + 1) = 0; goto LAB_0070b8aa; } break; case 0x12: ExceptionList = &local_10; gridEntity = operator_new(0x154); local_8 = 0x11; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Stairs::vftable; goto LAB_0070b8aa; } break; case 0x13: ExceptionList = &local_10; gridEntity = operator_new(0x154); local_8 = 0x12; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Gravity::vftable; goto LAB_0070b8aa; } break; case 0x14: ExceptionList = &local_10; gridEntity = operator_new(0x27c); local_8 = 0x13; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); local_8 = CONCAT31(local_8._1_3_,0x14); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_PressurePlate::vftable; ANM2::constructor((ANM2 *)(gridEntity + 1)); gridEntity[1]._sprite._championColor._tint[2] = 7.00649e-45; gridEntity[1]._sprite._championColor._tint[3] = 1.26117e-44; gridEntity[1]._sprite._championColor._tint[1] = -1.3434153e-13; gridEntity[1]._sprite._championColor._colorize[0] = 9.80909e-45; goto LAB_0070b8aa; } break; case 0x15: ExceptionList = &local_10; gridEntity = operator_new(0x158); local_8 = 0x15; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Statue::vftable; goto LAB_0070b8aa; } break; case 0x17: ExceptionList = &local_10; gridEntity = operator_new(0x154); local_8 = 0x16; if (gridEntity != (GridEntity *)0x0) { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Teleporter::vftable; goto LAB_0070b8aa; } } gridEntity = (GridEntity *)0x0; LAB_0070b8aa: if (gridEntity == (GridEntity *)0x0) { ExceptionList = local_10; return (GridEntity *)0x0; } (gridEntity->_desc)._type = type; gridEntity->_gridIndex = gridIndex; ExceptionList = local_10; return gridEntity; } //@@ 0070b950 GridEntity_Fire::InitSubclass /* ZHL [vtable slot 10] */ GridEntity_Fire * __thiscall GridEntity_Fire::InitSubclass(GridEntity_Fire *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; std::vector::_Tidy(__security_cookie ^ (int)register0x00000010 - 4U); std::string::_Tidy_deallocate((char *)&this[1]._desc._varData); std::string::_Tidy_deallocate((char *)(this + 1)); *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x198); } ExceptionList = local_10; return this; } //@@ 0070ba00 GridEntity::InitSubclass /* ZHL [vtable slot 10] */ GridEntity * __thiscall GridEntity::InitSubclass(GridEntity *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afb440; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(this[1]._sprite._championColor._colorize + 1)); AnimationState::~AnimationState((AnimationState *)&this[2]._gridIndex); AnimationState::~AnimationState((AnimationState *)&this[2]._desc); std::string::_Tidy_deallocate((char *)&this[1]._sprite._flipX); std::string::_Tidy_deallocate((char *)(this[1]._sprite._championColor._colorize + 1)); FID_conflict__Tidy(this[1]._sprite._championColor._tint + 2); local_8 = 1; ANM2::Reset((ANM2 *)(this + 1)); AnimationState::~AnimationState((AnimationState *)&this[1]._sprite._filename._size); AnimationState::~AnimationState((AnimationState *)&this[1]._rng._shift1); std::string::_Tidy_deallocate((char *)&this[1]._desc._varData); std::string::_Tidy_deallocate((char *)(this + 1)); *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 2; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x390); } ExceptionList = local_10; return this; } //@@ 0070bb20 GridEntity_Door::Free /* ZHL [vtable slot 0] */ GridEntity_Door * __thiscall GridEntity_Door::Free(GridEntity_Door *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb440; local_10 = ExceptionList; ExceptionList = &local_10; std::string::_Tidy_deallocate((this->_openLockedAnimation)._buf); std::string::_Tidy_deallocate((this->_lockedAnimation)._buf); std::string::_Tidy_deallocate((this->_closeAnimation)._buf); std::string::_Tidy_deallocate((this->_openAnimation)._buf); local_8 = 0; ANM2::Reset(&this->_extraSprite); AnimationState::~AnimationState(&(this->_extraSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_extraSprite)._animState); std::string::_Tidy_deallocate((this->_extraSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_extraSprite); local_8 = 1; ANM2::Reset(&this->_sparkleSprite); AnimationState::~AnimationState(&(this->_sparkleSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sparkleSprite)._animState); std::string::_Tidy_deallocate((this->_sparkleSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sparkleSprite); *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 2; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x404); } ExceptionList = local_10; return this; } //@@ 0070bc60 GridEntity_Poop::Free /* ZHL [vtable slot 0] */ GridEntity_Poop * __thiscall GridEntity_Poop::Free(GridEntity_Poop *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::GridEntity_Poop::vftable; std::string::_Tidy_deallocate((this->_stateAnimation)._buf); *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x19c); } ExceptionList = local_10; return this; } //@@ 0070bd00 GridEntity_PressurePlate::Free /* ZHL [vtable slot 0] */ GridEntity_PressurePlate * __thiscall GridEntity_PressurePlate::Free(GridEntity_PressurePlate *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset(&this->_timerPlate); AnimationState::~AnimationState(&(this->_timerPlate)._overlayAnimState); AnimationState::~AnimationState(&(this->_timerPlate)._animState); std::string::_Tidy_deallocate((this->_timerPlate)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_timerPlate); *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 1; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x27c); } ExceptionList = local_10; return this; } //@@ 0070bdd0 GridEntity_Lock::Free /* ZHL [vtable slot 0] */ GridEntity_Lock * __thiscall GridEntity_Lock::Free(GridEntity_Lock *this,byte param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x158); } ExceptionList = local_10; return this; } //@@ 0070be60 FUN_0070be60 bool FUN_0070be60(void) { undefined4 in_ECX; int in_EDX; switch(in_ECX) { default: return false; case 1: case 2: case 3: break; case 5: if (in_EDX == 1) { return true; } case 4: case 6: if ((((in_EDX == 2) || (in_EDX == 3)) || (in_EDX == 4)) || (in_EDX == 5)) { return true; } return false; case 7: return in_EDX != 1; } if (in_EDX == 4) { return true; } if (in_EDX == 5) { return true; } return false; } //@@ 0070bec0 GridEntity::IsEasyCrushableOrWalkable /* ZHL [exact] __thiscall bool GridEntity::IsEasyCrushableOrWalkable(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall GridEntity::IsEasyCrushableOrWalkable(GridEntity *this) { int iVar1; if (((((((uint)this->_gridIndex < 0x1c0) && (0 < *(int *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c))) && (iVar1 = (this->_desc)._type, iVar1 != 2)) && ((iVar1 != 6 && (iVar1 != 4)))) && ((iVar1 != 0x16 && (iVar1 != 0x1a)))) && ((iVar1 != 0xe || ((this->_desc)._variant == 1)))) { return 0; } return 1; } //@@ 0070bf10 GridEntity::IsDangerousCrushableOrWalkable /* ZHL [exact] __thiscall bool GridEntity::IsDangerousCrushableOrWalkable(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall GridEntity::IsDangerousCrushableOrWalkable(GridEntity *this) { int iVar1; if ((((((uint)this->_gridIndex < 0x1c0) && (999 < *(int *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c))) && (iVar1 = (this->_desc)._type, iVar1 != 0xc)) && ((iVar1 != 5 && (iVar1 != 8)))) && ((iVar1 != 9 && ((iVar1 != 0xe || ((this->_desc)._variant != 1)))))) { return 0; } return 1; } //@@ 0070bf60 FUN_0070bf60 undefined1 FUN_0070bf60(void) { byte bVar1; GridEntity *in_ECX; GridEntity *this; bVar1 = GridEntity::IsEasyCrushableOrWalkable(in_ECX); if (bVar1 == 0) { bVar1 = GridEntity::IsDangerousCrushableOrWalkable(this); if (bVar1 == 0) { return 0; } } return 1; } //@@ 0070bf80 is_grid_type_floor_special /* DB: ? grid types 17/18/20/23 */ undefined1 is_grid_type_floor_special(void) { int in_ECX; if ((((in_ECX == 0x11) || (in_ECX == 0x12)) || (in_ECX == 0x14)) || (in_ECX == 0x17)) { return 1; } return 0; } //@@ 0070bfa0 FUN_0070bfa0 void FUN_0070bfa0(int param_1,int param_2,undefined4 param_3,float param_4) { Manager *pMVar1; float in_XMM2_Da; pMVar1 = g_manager; seed_fart_sound_override(¶m_1); SoundEffects::Play(&pMVar1->_sfxManager,param_1,in_XMM2_Da,param_2,0,param_4,0.0); return; } //@@ 0070c000 Entity::DestroyRockGridAt /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? rubble anm, RegisterRockDestroyed, PlayBreakSound; tear/projectile */ void __cdecl Entity::DestroyRockGridAt(void) { int variant; byte isAnimSet; ColorMod *Color; ColorMod *Color_00; uint uVar1; EntityRef *source; Entity *pEVar2; char *name; byte *anim; Vector *in_ECX; undefined4 extraout_ECX; Vector *pVVar3; int *in_EDX; ANM2 *this; uint uVar4; int GridEntityType; float spreadFactor; Entity *in_stack_00000004; int in_stack_00000008; ANM2 sourceSprite; EntityRef dropSource; Vector rubblePos; Vector rubbleVelocity; Vector *position; int rubbleLeft; int gridTypeCopy; float local_60; Entity *local_5c; float local_58; int variantCopy; int *gridDesc; float local_4c; uint local_48; char isNormalRock; Color local_40; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; local_8 = -NAN; puStack_c = &LAB_00afc780; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&local_40)[1]._colorize; GridEntityType = *in_EDX; variant = in_EDX[1]; gridTypeCopy = GridEntityType; variantCopy = variant; if (GridEntityType == 5) { ExceptionList = &local_10; ::Color::Color(&local_40); Game::BombExplosionEffects (g_game,in_ECX,60.0,(BitSet128)ZEXT816(0),Color,in_stack_00000004,1.0,1,4,0); ExceptionList = local_10; return; } gridDesc = in_EDX; if (GridEntityType == 0xc) { ExceptionList = &local_10; ::Color::Color(&local_40); Game::BombExplosionEffects (g_game,in_ECX,60.0,(BitSet128)ZEXT816(0),Color_00,in_stack_00000004,1.0,1,4,0); spawn_rock_particles(); FUN_0071f4b0(gridDesc[4],extraout_ECX); ExceptionList = local_10; return; } if ((((GridEntityType == 2) || (GridEntityType == 4)) || (GridEntityType == 6)) || (((GridEntityType == 0x16 || (GridEntityType == 0x1a)) || (GridEntityType == 0x1b)))) { ExceptionList = &local_10; position = in_ECX; GridEntity_Rock::PlayBreakSound(GridEntityType,in_stack_00000008); isNormalRock = '\x01'; if (variantCopy == 9000) { local_48 = 0x10001; isNormalRock = '\0'; } else { if ((GridEntityType == 6) || (local_48 = 1, GridEntityType == 0x1a)) { local_48 = 2; } GridEntity_Rock::RegisterRockDestroyed(GridEntityType); } rubbleLeft = 4; do { uVar4 = Random(); local_58 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; local_4c = sin(local_58); local_60 = cos(local_58); local_58 = local_60 * 12.0; local_5c = (Entity *)(local_4c * 12.0); uVar4 = Random(); spreadFactor = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; rubblePos.y = spreadFactor * (float)local_5c + in_ECX->y; rubblePos.x = spreadFactor * local_58 + in_ECX->x; uVar4 = Random(); rubbleVelocity.x = local_60 * 5.0; rubbleVelocity.y = local_4c * 5.0; pEVar2 = Game::SpawnEx(g_game,1000,4,&rubblePos,&rubbleVelocity,(Entity *)0x0,local_48,uVar4,0 ); local_5c = pEVar2; if (isNormalRock != '\0') { if (in_stack_00000004 != (Entity *)0x0) { ANM2::ANM2(&sourceSprite,&in_stack_00000004->_sprite); Isaac::SwapANM2(&pEVar2->_sprite,&sourceSprite); local_8 = 0.0; ANM2::Reset(this); AnimationState::~AnimationState(&sourceSprite._overlayAnimState); AnimationState::~AnimationState(&sourceSprite._animState); std::string::_Tidy_deallocate(sourceSprite._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&sourceSprite); local_8 = -NAN; } if ((GridEntityType == 6) || (name = "rubble", GridEntityType == 0x1a)) { name = "rubble_alt"; } anim = ANM2::GetAnimationData(&pEVar2->_sprite,(byte *)name); if (anim != (byte *)0x0) { local_60 = *(float *)(anim + 0x30); if (local_60 == 0.0) { local_4c = 0.0; } else { uVar4 = Random(); local_4c = (float)(uVar4 % (uint)local_60); } if (0xf < *(uint *)(anim + 0x14)) { anim = *(byte **)anim; } isAnimSet = ANM2::SetAnimation(&pEVar2->_sprite,anim,1); if (((isAnimSet != 0) && ((pEVar2->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(pEVar2->_sprite)._animState,(float)(int)local_4c), (pEVar2->_sprite)._animState._animData != (void *)0x0)) { (pEVar2->_sprite)._animState._isPlaying = 0; } } *(undefined4 *)&local_5c[1].field_0x44 = 1; GridEntityType = gridTypeCopy; } rubbleLeft = rubbleLeft + -1; in_ECX = position; } while (rubbleLeft != 0); if (isNormalRock == '\0') { ExceptionList = local_10; return; } GridEntity_Rock::SpawnDrops(variantCopy,gridDesc[4],1,in_stack_00000008); ExceptionList = local_10; return; } if (GridEntityType != 0xe) { return; } if (in_stack_00000004 == (Entity *)0x0) { local_40._tint[1] = 0.0; local_40._tint[2] = 0.0; local_40._tint[3] = 0.0; local_40._colorize[0] = 0.0; local_40._colorize[1] = g_vectorZero.x; local_40._colorize[2] = g_vectorZero.y; local_40._colorize[3] = g_vectorZero.x; local_40._offset[0] = g_vectorZero.y; LAB_0070c1f2: uVar4 = 0; if (in_stack_00000004 != (Entity *)0x0) goto LAB_0070c1f8; uVar4 = 0; LAB_0070c213: local_48 = 0; pVVar3 = in_ECX; if (in_stack_00000004 != (Entity *)0x0) goto LAB_0070c21e; } else { local_40._tint[1] = (float)in_stack_00000004->_type; local_40._colorize[1] = (in_stack_00000004->_pos).x; local_40._colorize[2] = (in_stack_00000004->_pos).y; local_40._tint[2] = (float)in_stack_00000004->_variant; local_40._tint[3] = (float)in_stack_00000004->_spawnerType; local_40._colorize[0] = (float)in_stack_00000004->_spawnerVariant; local_40._colorize[3] = (in_stack_00000004->_velocity).x; local_40._offset[0] = (in_stack_00000004->_velocity).y; if ((in_stack_00000004->_flags & 0x100) == 0) goto LAB_0070c1f2; uVar4 = 1; LAB_0070c1f8: if ((in_stack_00000004->_flags & 0x20000000) == 0) goto LAB_0070c213; local_48 = 2; LAB_0070c21e: pVVar3 = (Vector *)(*(uint *)((int)&in_stack_00000004->_flags + 4) & 0x400000); if (pVVar3 != (Vector *)0x0) { uVar1 = 4; goto LAB_0070c239; } } uVar1 = 0; LAB_0070c239: local_40._offset[1] = (float)(uVar1 | local_48 | uVar4); ExceptionList = &local_10; spawn_poop_rewards(in_EDX[4],in_EDX[2],1000,0,pVVar3,local_40._tint + 1,local_14); GridEntity_Poop::destroy_effects(); GridEntity_Poop::spawn_hit_gibs(4); source = EntityRef::EntityRef(&dropSource); GridEntity_Poop::spawn_drops(in_ECX,variant,gridDesc[4],gridDesc[5] == 1,1,source); ExceptionList = local_10; return; } //@@ 0070c550 RoomDescriptor::ChallengeDone /* ZHL [lua] Lua binding RoomDescriptor:ChallengeDone */ uint __thiscall RoomDescriptor::ChallengeDone(RoomDescriptor *this) { return CONCAT31((uint3)((uint)this->Flags >> 0xb),(char)((uint)this->Flags >> 3)) & 0xffffff01; } //@@ 0070c560 Room::IsAmbushDone /* ZHL [lua] Lua binding Room:IsAmbushDone */ uint Room::IsAmbushDone(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); return CONCAT31((uint3)(uVar1 >> 0xb),(char)(uVar1 >> 3)) & 0xffffff01; } //@@ 0070c570 FUN_0070c570 void FUN_0070c570(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; uVar1 = *(undefined4 *)(in_ECX + 0x72d4); uVar2 = *(undefined4 *)(in_ECX + 0x72d8); uVar3 = *(undefined4 *)(in_ECX + 0x72dc); *param_1 = *(undefined4 *)(in_ECX + 0x72d0); param_1[1] = uVar1; param_1[2] = uVar2; param_1[3] = uVar3; uVar1 = *(undefined4 *)(in_ECX + 0x72e4); uVar2 = *(undefined4 *)(in_ECX + 0x72e8); uVar3 = *(undefined4 *)(in_ECX + 0x72ec); param_1[4] = *(undefined4 *)(in_ECX + 0x72e0); param_1[5] = uVar1; param_1[6] = uVar2; param_1[7] = uVar3; uVar1 = *(undefined4 *)(in_ECX + 0x72f8); *(undefined8 *)(param_1 + 8) = *(undefined8 *)(in_ECX + 0x72f0); param_1[10] = uVar1; return; } //@@ 0070c5b0 Level::GreedModeWave /* ZHL [lua] Lua binding Level:GreedModeWave */ int __thiscall Level::GreedModeWave(Level *this) { return this->_greedModeWave; } //@@ 0070c5c0 GridEntity_Door::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] void Update(); */ void __thiscall GridEntity_Door::Update(GridEntity_Door *this) { void *pvVar1; qword qVar2; byte bVar3; char isChallengeOpen; int iVar4; uint uVar5; std_string *animName; byte *animNameCursor; uint forcedCurses; uint preventedCurses; Entity_Player *player; RoomDescriptor *targetRoomDesc; LayerState *layer; char *expectedName; int iVar6; uint uVar7; bool isLess; double dVar8; undefined4 uVar9; ColorMod *pCVar10; undefined1 auStack_f4 [47]; byte local_c5; float local_c4; float boxTop; float local_bc; float local_b8; undefined4 auStack_b4 [8]; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; ColorMod local_88; undefined4 uStack_5c; undefined4 local_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; uint local_44; byte *animData; AnimationState *animState; uint *flagsHigh; Game *game; Manager *manager; float playerX; float playerY; int *roomConfig; local_44 = __security_cookie ^ (uint)auStack_f4; this->_updateCount = this->_updateCount + 1; game = g_game; if ((this->_desc)._variant == 5) { uVar7 = *(uint *)((int)&g_game->_gameStateFlags + 4); if ((uVar7 & 0x20000) != 0) { *(int *)&g_game->_gameStateFlags = (int)g_game->_gameStateFlags; *(uint *)((int)&game->_gameStateFlags + 4) = uVar7 | 0x20000; (this->_desc)._variant = 8; UpdateAnimation(this); Open(this); } } iVar4 = get_secret_exit_kind(this); game = g_game; if ((iVar4 == 4) && ((g_game->_gameStateFlags & 0x10000000000000) != 0)) { iVar4 = (this->_desc)._variant; if ((iVar4 == 1) || ((((iVar4 == 4 || (iVar4 == 3)) || (iVar4 == 2)) || ((iVar4 == 5 || ((this->_desc)._state != 2)))))) { if ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0) { if (iVar4 != 4) { if (iVar4 == 5) { qVar2 = g_game->_gameStateFlags; flagsHigh = (uint *)((int)&g_game->_gameStateFlags + 4); *flagsHigh = *flagsHigh | 0x20000; *(int *)&game->_gameStateFlags = (int)qVar2; } (this->_desc)._variant = 8; UpdateAnimation(this); } Open(this); } goto LAB_0070c6c5; } LAB_0070c6cb: if ((this->_doorFlags & 0x10) != 0) goto LAB_0070c737; if ((this->_targetRoomIdx == -7) || (g_game->_currentRoomIdx == -7)) { LAB_0070c718: if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { LAB_0070c72b: this->_collisionClass = 5; } } else { if (this->_targetRoomType != 5) { if (this->_targetRoomType == 0x1b) { bVar3 = Level::HasPhotoDoor((Level *)g_game); if (bVar3 != 0) goto LAB_0070c718; } goto LAB_0070c72b; } if (g_game->_stage == 9) goto LAB_0070c718; this->_collisionClass = 5; } } else { LAB_0070c6c5: if ((this->_desc)._state == 2) goto LAB_0070c6cb; LAB_0070c737: animName = &this->_closeAnimation; this->_collisionClass = 4; if (0xf < (this->_closeAnimation)._capacity) { animName = *(std_string **)animName->_buf; } bVar3 = ANM2::IsPlaying(&this->_sprite,(byte *)animName); if (((bVar3 != 0) && (pvVar1 = (this->_sprite)._animState._animData, pvVar1 != (void *)0x0)) && (*(char *)((int)pvVar1 + 0x34) == '\0')) { dVar8 = floor((double)(this->_sprite)._animState._animFrame); manager = g_manager; local_c4 = (float)dVar8; if ((int)dVar8 == 2) { local_c4 = 6.44597e-44; if ((this->_doorFlags & 8) == 0) { local_c4 = 4.90454e-44; } seed_fart_sound_override((int *)&local_c4); SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,10,0,1.0,0.0); } } } uVar7 = this->_doorFlags; uVar5 = uVar7 & 0xff; if (((uVar7 & 8) != 0) && ((this->_desc)._state == 2)) { animName = &this->_openAnimation; if (0xf < (this->_openAnimation)._capacity) { animName = *(std_string **)animName->_buf; } uVar9 = 0x70c823; local_c5 = (byte)uVar7; bVar3 = ANM2::IsPlaying(&this->_sprite,(byte *)animName); if (bVar3 == 0) { LAB_0070c871: uVar5 = (uint)local_c5; } else { pvVar1 = (this->_sprite)._animState._animData; if ((pvVar1 == (void *)0x0) || (uVar5 = this->_doorFlags & 0xff, *(char *)((int)pvVar1 + 0x34) == '\0')) { local_c5 = (byte)this->_doorFlags; iVar4 = ANM2::GetFrame(&this->_sprite); if (iVar4 != 2) goto LAB_0070c871; FUN_0070bfa0(0x2f,10,uVar9,0x3f800000); uVar5 = (uint)(byte)this->_doorFlags; } } } if ((((this->_desc)._variant == 8) && ((((uVar5 & 1) != 0 || (this->_targetRoomType == 0x17)) && (this->_currentRoomType == 1)))) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { iVar4 = (this->_desc)._state; if (iVar4 == 2) { ANM2::Play(&this->_sprite,(byte *)"Opened",0); } else if (iVar4 == 1) { ANM2::Play(&this->_sprite,(byte *)"Closed",0); } } else { iVar4 = this->_currentRoomType; if ((iVar4 == 7) || (((iVar6 = this->_targetRoomType, iVar6 == 7 || (iVar4 == 8)) || ((iVar6 == 8 || ((iVar4 == 0x1d || (iVar6 == 0x1d)))))))) { LAB_0070c926: animName = &this->_openAnimation; if (0xf < (this->_openAnimation)._capacity) { animName = *(std_string **)animName->_buf; } bVar3 = ANM2::IsFinishedImpl(&this->_sprite,(byte *)animName); if (bVar3 != 0) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = "Opened"; do { bVar3 = *animNameCursor; isLess = bVar3 < (byte)*expectedName; if (bVar3 != *expectedName) { LAB_0070c980: uVar7 = -(uint)isLess | 1; goto LAB_0070c985; } if (bVar3 == 0) break; bVar3 = animNameCursor[1]; isLess = bVar3 < (byte)expectedName[1]; if (bVar3 != expectedName[1]) goto LAB_0070c980; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar3 != 0); uVar7 = 0; LAB_0070c985: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0070c9b8; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"Opened",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } else if (iVar6 == 5) { targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if ((targetRoomDesc->Flags & 1) == 0) goto LAB_0070c926; } } LAB_0070c9b8: uVar7 = g_game->_debugCurses; uVar5 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((((~preventedCurses & (forcedCurses | uVar7 | uVar5) & 0x10) == 0) || (this->_targetRoomType != 1)) || (local_c5 = '\x01', this->_currentRoomType != 1)) { local_c5 = '\0'; } if ((((this->_doorFlags & 4) != 0) && (uVar7 = this->_direction, uVar7 < 4)) && ((this->_desc)._varData == 0)) { local_88._tint[0] = -43.0; local_88._tint[1] = -20.0; local_88._tint[2] = 15.0; local_88._tint[3] = 20.0; iVar4 = *(int *)((int)g_game->_room + 0xc); local_88._colorize[0] = -20.0; local_88._colorize[1] = -43.0; local_88._colorize[2] = 20.0; local_88._colorize[3] = 15.0; local_88._offset[0] = -15.0; local_88._offset[1] = -20.0; local_88._offset[2] = 43.0; uStack_5c = 0x41a00000; local_58 = 0xc1a00000; uStack_54 = 0xc1700000; uStack_50 = 0x41a00000; uStack_4c = 0x422c0000; local_bc = (float)(this->_gridIndex % iVar4) * 40.0 + 40.0; local_b8 = (float)(this->_gridIndex / iVar4) * 40.0 + 120.0; local_c4 = local_bc + local_88._tint[uVar7 * 4]; local_bc = local_bc + local_88._tint[uVar7 * 4 + 2]; boxTop = local_b8 + local_88._tint[uVar7 * 4 + 1]; local_b8 = local_b8 + local_88._tint[uVar7 * 4 + 3]; uVar7 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar7); if (((player->_entityGridCollisionClass == 5) || (*(int *)((int)g_game->_room + 8) == 10)) || (local_c5 != '\0')) { playerX = (player->_pos).x; playerY = (player->_pos).y; if ((local_c4 <= playerX) && (boxTop <= playerY)) { if (playerX <= local_bc) { if (playerY <= local_b8) { Game::save_rewind_state(this->_slot); local_88._tint[0] = 0.0; local_88._tint[1] = 0.0; local_88._tint[2] = 0.0; local_88._tint[3] = 0.0; local_88._colorize[0] = g_vectorZero.x; local_88._colorize[1] = g_vectorZero.y; local_88._colorize[2] = g_vectorZero.x; local_88._colorize[3] = g_vectorZero.y; local_88._offset[0] = 0.0; local_88._offset[1] = 0.0; (**(code **)(*(int *)player + 0x20))(0x3f800000,0x10010000,0,&local_88); } } } } uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } if ((((((this->_targetRoomType == 0xb) && ((this->_doorFlags & 8) != 0)) && (this->_isBusted == 0) ) && ((this->_currentRoomType != 0x1d && ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 10 & 1) == 0)))) && ((this->_desc)._state != 1)) && (this->_isUnlockedByPlayer == 0)) { isChallengeOpen = Level::CanOpenChallengeRoom(); if (isChallengeOpen == '\0') { Close(this); } } animState = &(this->_sprite)._animState; if ((this->_sprite)._loaded != 0) { AnimationState::Update(animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } if ((this->_extraSprite)._loaded != 0) { AnimationState::Update(&(this->_extraSprite)._animState); AnimationState::Update(&(this->_extraSprite)._overlayAnimState); } if ((this->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,(byte *)"ScreenshakeStop") ; if (bVar3 == 0) { if ((this->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::WasEventTriggered(animState,(byte *)"ScreenshakeStart"); if (bVar3 != 0) { Game::ShakeScreen(g_game,4); if ((this->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"ScreenshakeStart"); manager = g_manager; if (bVar3 != 0) { local_c4 = 7.28675e-44; seed_fart_sound_override((int *)&local_c4); SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,2,0,0.33,0.0); } } } } } else { Game::ShakeScreen(g_game,0); } } if (this->_targetRoomType == 0x1b) { iVar4 = get_secret_exit_kind(this); if ((iVar4 == 3) && ((this->_sprite)._animState._animData != (void *)0x0)) { bVar3 = AnimationState::IsEventTriggered(animState,(byte *)"Sound"); if (bVar3 != 0) { bVar3 = Level::HasPhotoDoor((Level *)g_game); manager = g_manager; if (bVar3 == 0) { local_c4 = 9.52883e-44; seed_fart_sound_override((int *)&local_c4); uVar9 = 0x3f800000; SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,2,0,1.0,0.0); if ((this->_desc)._variant == 8) { FUN_0070bfa0(0x9c,2,uVar9,0x3f800000); } } else { local_c4 = 7.28675e-44; seed_fart_sound_override((int *)&local_c4); SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,2,0,0.33,0.0); } } if ((this->_sprite)._animState._animData != (void *)0x0) { bVar3 = AnimationState::IsEventTriggered(animState,&DAT_00b64ba4); if (bVar3 != 0) { Game::ShakeScreen(g_game,8); SpawnDust(this); } } } } targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if ((targetRoomDesc->Flags & 0x40000U) != 0) { layer = ANM2::GetLayer(&this->_sprite,(byte *)"Background"); if (layer != (LayerState *)0x0) { uStack_94 = 0; uStack_90 = 0; uStack_8c = 0; if (&layer->_color != (ColorMod *)auStack_b4) { (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; (layer->_color)._offset[0] = 0.0; (layer->_color)._offset[1] = 0.0; (layer->_color)._colorize[0] = 0.8; (layer->_color)._colorize[1] = 1.1; (layer->_color)._colorize[2] = 1.8; (layer->_color)._colorize[3] = 0.8; (layer->_color)._offset[2] = 0.0; } } } roomConfig = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if ((((roomConfig != (int *)0x0) && (*roomConfig == 0x23)) && (pvVar1 = targetRoomDesc->Data, pvVar1 != (void *)0x0)) && (((*(int *)((int)pvVar1 + 8) == 1 && (*(int *)((int)pvVar1 + 0x10) == 3)) && (g_game->_stageType == 1)))) { uVar7 = Random(); local_c4 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.5; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x3); local_88._offset[0] = 0.0; local_88._colorize[0] = 0.0; local_88._colorize[1] = 0.0; local_88._colorize[2] = 0.0; local_88._colorize[3] = 0.0; local_88._offset[1] = 0.0; layer->_visible = 1; pCVar10 = &local_88; local_88._offset[2] = 0.0; local_88._tint[0] = 0.9; local_88._tint[1] = 0.93; local_88._tint[2] = 1.0; local_88._tint[3] = local_c4; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x3); Color::operator_assign((Color *)&layer->_color,pCVar10); pCVar10 = &local_88; local_88._tint[0] = 1.0; local_88._tint[1] = 1.0; local_88._tint[2] = 1.0; local_88._tint[3] = 1.0; local_88._colorize[0] = 3.0; local_88._colorize[1] = 3.0; local_88._colorize[2] = 3.2; local_88._colorize[3] = local_c4; local_88._offset[0] = 0.0; local_88._offset[1] = 0.0; local_88._offset[2] = 0.0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,pCVar10); } if ((this->_desc)._state != 2) { iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3e); if (1 < iVar4) { if ((this->_currentRoomType != 7) && (this->_targetRoomType != 7)) { iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3e); if ((iVar4 < 3) || ((this->_currentRoomType != 8 && (this->_targetRoomType != 8)))) goto LAB_0070d1ab; } iVar6 = 300; iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3e); manager = g_manager; if (2 < iVar4) { iVar6 = 0x96; } if (*(char *)g_game->_room == '\0') { iVar4 = -1; } else { iVar4 = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0); } if ((iVar4 % iVar6 < 0xb) && (iVar4 % iVar6 == 0)) { local_c4 = 1.42092e-42; seed_fart_sound_override((int *)&local_c4); SoundEffects::Play(&manager->_sfxManager,(int)local_c4,1.0,2,0,1.0,0.0); bVar3 = ANM2::SetAnimation(&this->_sparkleSprite,(byte *)"Sparkle",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sparkleSprite)._animState); (this->_sparkleSprite)._animState._isPlaying = 1; } } } } LAB_0070d1ab: if ((this->_sparkleSprite)._loaded != 0) { AnimationState::Update(&(this->_sparkleSprite)._animState); AnimationState::Update(&(this->_sparkleSprite)._overlayAnimState); } return; } //@@ 0070d1e0 GridEntity_Door::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity_Door::Render(GridEntity_Door *this,float *param_2) { ColorMod *pCVar1; void *pvVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; byte bVar12; Vector *pVVar13; int iVar14; AnimationState *this_00; Vector local_44; Vector local_3c; undefined4 local_34 [12]; if (0.0 < (this->_sprite)._color._tint[3]) { pVVar13 = GridEntity::get_render_position((GridEntity *)this,&local_3c); local_44.x = pVVar13->x + *param_2; local_44.y = pVVar13->y + param_2[1]; pvVar2 = g_game->_room; fVar4 = *(float *)((int)pvVar2 + 0x72d0); fVar5 = *(float *)((int)pvVar2 + 0x72d4); fVar6 = *(float *)((int)pvVar2 + 0x72d8); fVar7 = *(float *)((int)pvVar2 + 0x72dc); fVar3 = *(float *)((int)pvVar2 + 0x72f8); fVar8 = *(float *)((int)pvVar2 + 0x72e0); fVar9 = *(float *)((int)pvVar2 + 0x72e4); fVar10 = *(float *)((int)pvVar2 + 0x72e8); fVar11 = *(float *)((int)pvVar2 + 0x72ec); pCVar1 = &(this->_sprite)._color; if (pCVar1 != (ColorMod *)local_34) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar2 + 0x72f0); pCVar1->_tint[0] = fVar4; (this->_sprite)._color._tint[1] = fVar5; (this->_sprite)._color._tint[2] = fVar6; (this->_sprite)._color._tint[3] = fVar7; (this->_sprite)._color._offset[2] = fVar3; (this->_sprite)._color._colorize[0] = fVar8; (this->_sprite)._color._colorize[1] = fVar9; (this->_sprite)._color._colorize[2] = fVar10; (this->_sprite)._color._colorize[3] = fVar11; } if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._animState; } AnimationState::Render(this_00,&local_44,&g_vectorZero,&g_vectorZero); } if (this->_isExtraVisible != 0) { ANM2::Render(&this->_extraSprite,&local_44,&g_vectorZero,&g_vectorZero); } iVar14 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3e); if ((1 < iVar14) && ((this->_desc)._state != 2)) { if ((this->_currentRoomType != 7) && (this->_targetRoomType != 7)) { iVar14 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3e); if (iVar14 < 3) { return; } bVar12 = IsRoomType(this,8); if (bVar12 == 0) { return; } } ANM2::Render(&this->_sparkleSprite,&local_44,&g_vectorZero,&g_vectorZero); } } return; } //@@ 0070d360 GridEntity_Door::get_secret_exit_kind /* DB: the -10 room's subtype for a secret exit door, 4 for a subtype 90 boss room (alt_path.md) prototype: db/protos.zhl */ int __thiscall GridEntity_Door::get_secret_exit_kind(GridEntity_Door *this) { int iVar1; RoomDescriptor *pRVar2; if (this->_targetRoomType == 0x1b) { pRVar2 = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if (pRVar2->Data != (void *)0x0) { return *(int *)((int)pRVar2->Data + 0x10); } } else if (this->_currentRoomType == 0x1b) { iVar1 = *(int *)(*(int *)((int)g_game->_room + 4) + 0x10); if (iVar1 != 0) { return *(int *)(iVar1 + 0x10); } } else { if (this->_targetRoomType == 5) { pRVar2 = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); } else { if (this->_currentRoomType != 5) { return 0; } pRVar2 = *(RoomDescriptor **)((int)g_game->_room + 4); } if ((pRVar2->Data != (void *)0x0) && (*(int *)((int)pRVar2->Data + 0x10) == 0x5a)) { return 4; } } return 0; } //@@ 0070d3f0 GridEntity_Door::LoadSprite /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: door setup: loads Door_*.anm2 by room type / target idx (-7 Mega Satan, -8 blue womb, -9 Hush), greed treasure door 31 for the room that is not _greedModeTreasureRoomIdx, exit door 32 for type 0x17 prototype: db/protos.zhl */ void __thiscall GridEntity_Door::LoadSprite(GridEntity_Door *this) { undefined1 *puVar1; byte bVar2; int iVar3; LayerState *layer; RoomDescriptor *roomDesc; RoomDescriptor *targetRoomDesc; ColorMod *extraout_EAX; Entity_Player *payToPlayOwner; void *pvVar4; byte unk; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; byte extraout_CL_05; byte extraout_CL_06; byte extraout_CL_07; byte extraout_CL_08; byte extraout_CL_09; byte extraout_CL_10; byte extraout_CL_11; byte extraout_CL_12; byte unk_00; std_string *pathString; char *pcVar5; Game *extraout_ECX; byte *pbVar6; uint uVar7; uint uVar8; ANM2 *sprite; float colorizeG; undefined4 local_1c8 [11]; float offsetLength; float local_198; RoomDescriptor *local_194; byte *local_190; char isExtraSpriteAllowed; std_string local_188; std_string local_170; std_string local_158; std_string local_140; std_string local_128; std_string local_110; std_string local_f8; std_string local_e0; undefined1 local_c8 [44]; std_string local_9c; std_string local_84; std_string local_6c; std_string local_54; std_string tmpString; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ColorMod *color; float colorizeA; float colorizeB; float colorizeG; float colorizeR; Game *game; int *roomData; void *targetRoomData; int targetRoomType; float tintA; float tintB; float tintG; float tintR; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afc928; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; puVar1 = (undefined1 *)((int)register0x00000010 + -4); if ((this->_extraSprite)._loaded != 0) { ANM2::Reset(&this->_extraSprite); puVar1 = puStack_20; } puStack_20 = puVar1; isExtraSpriteAllowed = '\x01'; this->_doorFlags = 0; std::string::assign((this->_openAnimation)._buf,s_Open,4); std::string::assign((this->_closeAnimation)._buf,(byte *)"Close",5); offsetLength = 15.0; if (this->_targetRoomIdx == -100) { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x22; tmpString._capacity = 0x2f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/grid/door_downpour_mirror.anm2",0x23); local_14 = 0; ANM2::Load(&this->_sprite,&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) { LAB_0070d535: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } this->_doorFlags = this->_doorFlags | 0x10; std::string::assign((this->_openAnimation)._buf,(byte *)"Break",5); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"Break",5); std::string::assign((this->_lockedAnimation)._buf,(byte *)"Closed",6); goto LAB_0070eb83; } if (this->_targetRoomIdx == -0x65) { if (g_game->_currentDimensionIdx == 1) { local_84._size = 0; local_84._capacity = 0xf; local_84._buf[0] = '\0'; local_84._buf[1] = '\0'; local_84._buf[2] = '\0'; local_84._buf[3] = '\0'; local_84._buf._0_4_ = std::_Allocate(0x30); local_84._size = 0x28; local_84._capacity = 0x2f; builtin_strncpy((char *)local_84._buf._0_4_,"gfx/grid/door_mines_mineshaft_light.anm2",0x29); local_14 = 1; ANM2::Load(&this->_sprite,&local_84,1); local_14 = 0xffffffff; if (0xf < local_84._capacity) { uVar7 = local_84._capacity + 1; pcVar5 = (char *)local_84._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(local_84._buf._0_4_ + -4); uVar7 = local_84._capacity + 0x24; if ((char *)0x1f < (char *)(local_84._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } local_84._size = 0; local_84._capacity = 0xf; local_84._buf._0_4_ = local_84._buf._0_4_ & 0xffffff00; } else { local_9c._size = 0; local_9c._capacity = 0xf; local_9c._buf[0] = '\0'; local_9c._buf[1] = '\0'; local_9c._buf[2] = '\0'; local_9c._buf[3] = '\0'; local_9c._buf._0_4_ = std::_Allocate(0x30); local_9c._size = 0x27; local_9c._capacity = 0x2f; builtin_strncpy((char *)local_9c._buf._0_4_,"gfx/grid/door_mines_mineshaft_dark.anm2",0x28); local_14 = 2; ANM2::Load(&this->_sprite,&local_9c,1); local_14 = 0xffffffff; if (0xf < local_9c._capacity) { uVar7 = local_9c._capacity + 1; pcVar5 = (char *)local_9c._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(local_9c._buf._0_4_ + -4); uVar7 = local_9c._capacity + 0x24; if ((char *)0x1f < (char *)(local_9c._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } local_9c._size = 0; local_9c._capacity = 0xf; local_9c._buf._0_4_ = local_9c._buf._0_4_ & 0xffffff00; } this->_doorFlags = this->_doorFlags | 0x20; if ((this->_desc)._variant == 4) { isExtraSpriteAllowed = '\0'; std::string::assign((this->_closeAnimation)._buf,(byte *)"Collapse",8); std::string::assign((this->_lockedAnimation)._buf,(byte *)"Collapsed",9); } goto LAB_0070eb83; } iVar3 = this->_currentRoomType; if (iVar3 == 7) { LAB_0070e8c5: local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf[0] = '\0'; local_6c._buf[1] = '\0'; local_6c._buf[2] = '\0'; local_6c._buf[3] = '\0'; local_6c._buf._0_4_ = std::_Allocate(0x20); local_6c._size = 0x15; local_6c._capacity = 0x1f; builtin_strncpy((char *)local_6c._buf._0_4_,"gfx/door_sparkle.anm2",0x16); local_14 = 3; ANM2::Load(&this->_sparkleSprite,&local_6c,1); local_14 = 0xffffffff; if (0xf < local_6c._capacity) { uVar7 = local_6c._capacity + 1; pcVar5 = (char *)local_6c._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(local_6c._buf._0_4_ + -4); uVar7 = local_6c._capacity + 0x24; if ((char *)0x1f < (char *)(local_6c._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; LAB_0070e980: tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; if (*(int *)((int)g_game->_room + 0x1d18) == 0x10) { tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x2a; tmpString._capacity = 0x2f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/grid/door_08_holeinwall _darkroom.anm2",0x2b ); local_14 = 4; ANM2::Load(&this->_sprite,&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = tmpString._buf._0_4_ & 0xffffff00; } else { tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x20; tmpString._capacity = 0x2f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/grid/Door_08_HoleInWall.anm2",0x21); local_14 = 5; ANM2::Load(&this->_sprite,&tmpString,0); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = tmpString._buf._0_4_ & 0xffffff00; Sprite::ReplaceSpritesheet ((Sprite *)&this->_sprite,0, (std_string *) ((int)g_game->_room + *(int *)((int)g_game->_room + 0x1d18) * 0x13c + 0x1e24)); ANM2::LoadGraphics(&this->_sprite,unk_00); } pvVar4 = g_game->_room; tintR = *(float *)((int)pvVar4 + 0x72d0); tintG = *(float *)((int)pvVar4 + 0x72d4); tintB = *(float *)((int)pvVar4 + 0x72d8); tintA = *(float *)((int)pvVar4 + 0x72dc); colorizeG = *(float *)((int)pvVar4 + 0x72f8); colorizeR = *(float *)((int)pvVar4 + 0x72e0); colorizeG = *(float *)((int)pvVar4 + 0x72e4); colorizeB = *(float *)((int)pvVar4 + 0x72e8); colorizeA = *(float *)((int)pvVar4 + 0x72ec); color = &(this->_sprite)._color; if (color != (ColorMod *)local_1c8) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar4 + 0x72f0); color->_tint[0] = tintR; (this->_sprite)._color._tint[1] = tintG; (this->_sprite)._color._tint[2] = tintB; (this->_sprite)._color._tint[3] = tintA; (this->_sprite)._color._offset[2] = colorizeG; (this->_sprite)._color._colorize[0] = colorizeR; (this->_sprite)._color._colorize[1] = colorizeG; (this->_sprite)._color._colorize[2] = colorizeB; (this->_sprite)._color._colorize[3] = colorizeA; } this->_doorFlags = this->_doorFlags | 2; offsetLength = 0.0; goto LAB_0070eb83; } targetRoomType = this->_targetRoomType; if ((((targetRoomType == 7) || (iVar3 == 8)) || (targetRoomType == 8)) || ((iVar3 == 0x1d || (targetRoomType == 0x1d)))) { if ((this->_targetRoomType == 7) || ((iVar3 == 8 || (this->_targetRoomType == 8)))) goto LAB_0070e8c5; goto LAB_0070e980; } iVar3 = get_secret_exit_kind(this); if (iVar3 == 0) { bVar2 = IsRoomType(this,10); if ((bVar2 != 0) || (((uVar7 = Level::GetCurses((Level *)g_game), (uVar7 & 0x10) != 0 && (this->_targetRoomType == 1)) && (this->_currentRoomType == 1)))) { std::string::string_from_cstr (local_c8 + 0x14,(byte *)"gfx/grid/Door_04_SelfSacrificeRoomDoor.anm2"); local_14 = 0xd; ANM2::Load(&this->_sprite,(std_string *)(local_c8 + 0x14),1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_c8 + 0x14); bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97); if ((bVar2 != 0) || ((this->_desc)._varData == 1)) { uVar7 = 0; bVar2 = extraout_CL_10; if ((this->_sprite)._layerCount != 0) { do { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (char *)0x0; std::string::assign(tmpString._buf, (byte *)"gfx/grid/door_04_selfsacrificeroomdoor_nospikes.png",0x33); local_14 = 0xe; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar7,&tmpString); local_14 = 0xffffffff; bVar2 = extraout_CL_11; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar8) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar8 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) goto LAB_0070d535; } operator_delete(pcVar5,uVar8); bVar2 = extraout_CL_12; } uVar7 = uVar7 + 1; } while (uVar7 < (uint)(this->_sprite)._layerCount); } ANM2::LoadGraphics(&this->_sprite,bVar2); (this->_desc)._varData = 1; } this->_doorFlags = this->_doorFlags | 4; goto LAB_0070eb83; } bVar2 = IsRoomType(this,9); if (bVar2 != 0) { std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/Door_05_ArcadeRoomDoor.anm2"); local_14 = 0xf; ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_54._buf); std::string::assign((this->_lockedAnimation)._buf,(byte *)"KeyClosed",9); std::string::assign((this->_openAnimation)._buf,s_Open,4); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"KeyOpen",7); ANM2::LoadGraphics(&this->_sprite,unk); this->_doorFlags = this->_doorFlags | 1; goto LAB_0070eb83; } if (this->_targetRoomType == 0x17) { std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/Door_32_ExitDoor.anm2"); local_14 = 0x10; ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_54._buf); std::string::assign((this->_openAnimation)._buf,s_Open,4); goto LAB_0070eb83; } bVar2 = IsRoomType(this,4); game = g_game; if (bVar2 != 0) { bVar2 = Game::IsGreedMode(g_game); if (((bVar2 == 0) || (game->_greedModeTreasureRoomIdx == this->_targetRoomIdx)) || (game->_greedModeTreasureRoomIdx == game->_currentRoomIdx)) { roomDesc = Game::GetCurrentRoomDesc(game); if ((((uint)roomDesc->Flags >> 0xb & 1) == 0) && (roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1), ((uint)roomDesc->Flags >> 0xb & 1) == 0)) { std::string::string_from_cstr (local_54._buf,(byte *)"gfx/grid/Door_02_TreasureRoomDoor.anm2"); local_14 = 0x13; } else { std::string::string_from_cstr (local_54._buf,(byte *)"gfx/grid/Door_02_TreasureRoomDoor_Devil.anm2"); local_14 = 0x12; } } else { std::string::string_from_cstr (local_54._buf,(byte *)"gfx/grid/Door_31_TreasureRoomDoorGreed.anm2"); local_14 = 0x11; } LAB_0070dd51: ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_54._buf); std::string::assign((this->_openAnimation)._buf,s_Open,4); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"KeyOpen",7); std::string::assign((this->_lockedAnimation)._buf,(byte *)"KeyClosed",9); goto LAB_0070eb83; } bVar2 = IsRoomType(this,0x18); if (bVar2 != 0) { std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/Door_00x_PlanetariumDoor.anm2"); local_14 = 0x14; goto LAB_0070dd51; } bVar2 = IsRoomType(this,0x11); game = g_game; if (bVar2 != 0) { std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/Door_15_BossRushDoor.anm2"); local_14 = 0x15; ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_54._buf); LAB_0070e789: std::string::assign((this->_openAnimation)._buf,(byte *)"Opened",6); goto LAB_0070eb83; } if ((this->_targetRoomIdx == -8) || (g_game->_currentRoomIdx == -8)) { std::string::string_from_cstr(local_c8 + 0x14,(byte *)"gfx/grid/door_29_doortobluewomb.anm2"); local_14 = 0x16; ANM2::Load(&this->_sprite,(std_string *)(local_c8 + 0x14),0); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_c8 + 0x14); bVar2 = extraout_CL_07; if ((g_game->_currentRoomIdx == -8) && (uVar7 = 0, (this->_sprite)._layerCount != 0)) { do { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (char *)0x0; std::string::assign(tmpString._buf,(byte *)"gfx/grid/door_29_doortobluewomb_blue.png",0x28 ); local_14 = 0x17; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar7,&tmpString); local_14 = 0xffffffff; bVar2 = extraout_CL_08; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar8) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar8 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) goto LAB_0070d535; } operator_delete(pcVar5,uVar8); bVar2 = extraout_CL_09; } uVar7 = uVar7 + 1; } while (uVar7 < (uint)(this->_sprite)._layerCount); } ANM2::LoadGraphics(&this->_sprite,bVar2); goto LAB_0070e789; } if ((this->_targetRoomIdx == -7) || (g_game->_currentRoomIdx == -7)) { std::string::string_from_cstr(local_c8 + 0x14,(byte *)"gfx/grid/Door_24_MegaSatanDoor.anm2"); local_14 = 0x18; ANM2::Load(&this->_sprite,(std_string *)(local_c8 + 0x14),1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_c8 + 0x14); std::string::assign((this->_closeAnimation)._buf,(byte *)"Closed",6); goto LAB_0070eb83; } if (g_game->_stage == 9) { bVar2 = IsRoomType(this,5); if ((((bVar2 != 0) && (-1 < game->_currentRoomIdx)) && (-1 < this->_targetRoomIdx)) || ((this->_targetRoomIdx == -9 || (game->_currentRoomIdx == -9)))) { std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/door_30_HushDoor.anm2"); local_14 = 0x19; ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_54._buf); std::string::assign((this->_closeAnimation)._buf,(byte *)"Closed",6); std::string::assign((this->_lockedAnimation)._buf,(byte *)"Closed",6); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"Opening",7); std::string::assign((this->_openAnimation)._buf,(byte *)"Opening",7); goto LAB_0070eb83; } } bVar2 = IsRoomType(this,5); if (bVar2 == 0) { bVar2 = IsRoomType(this,0xb); if (bVar2 != 0) { roomDesc = Game::GetCurrentRoomDesc(game); targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); pvVar4 = roomDesc->Data; if (((pvVar4 == (void *)0x0) || (targetRoomData = targetRoomDesc->Data, targetRoomData == (void *)0x0)) || (((*(int *)((int)pvVar4 + 8) != 0xb || (*(int *)((int)pvVar4 + 0x10) != 1)) && ((*(int *)((int)targetRoomData + 8) != 0xb || (*(int *)((int)targetRoomData + 0x10) != 1)))))) { std::string::string_from_cstr (local_140._buf,(byte *)"gfx/grid/Door_03_AmbushRoomDoor.anm2"); local_14 = 0x1c; ANM2::Load(&this->_sprite,&local_140,1); pathString = &local_140; } else { std::string::string_from_cstr (local_128._buf,(byte *)"gfx/grid/Door_09_BossAmbushRoomDoor.anm2"); local_14 = 0x1b; ANM2::Load(&this->_sprite,&local_128,1); pathString = &local_128; } local_14 = 0xffffffff; std::string::_Tidy_deallocate(pathString->_buf); this->_doorFlags = this->_doorFlags | 8; goto LAB_0070eb83; } bVar2 = IsRoomType(this,0xe); if (bVar2 != 0) { roomDesc = Game::GetCurrentRoomDesc(game); if ((((uint)roomDesc->Flags >> 0xb & 1) == 0) && (roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1), ((uint)roomDesc->Flags >> 0xb & 1) == 0)) { std::string::string_from_cstr (local_158._buf,(byte *)"gfx/grid/Door_07_DevilRoomDoor.anm2"); local_14 = 0x1e; ANM2::Load(&this->_sprite,&local_158,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_158._buf); } else { std::string::string_from_cstr (local_170._buf,(byte *)"gfx/grid/Door_02_TreasureRoomDoor_Devil.anm2"); local_14 = 0x1d; ANM2::Load(&this->_sprite,&local_170,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_170._buf); } goto LAB_0070eb83; } bVar2 = IsRoomType(this,0xf); if (bVar2 != 0) { std::string::string_from_cstr(local_c8 + 0x14,(byte *)"gfx/grid/Door_07_HolyRoomDoor.anm2"); local_14 = 0x1f; ANM2::Load(&this->_sprite,(std_string *)(local_c8 + 0x14),1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_c8 + 0x14); goto LAB_0070eb83; } roomData = *(int **)(*(int *)((int)game->_room + 4) + 0x10); if ((roomData != (int *)0x0) && (*roomData == 0x23)) { sprite = &this->_sprite; std::string::string_from_cstr(local_c8 + 0x14,(byte *)"gfx/grid/Door_House.anm2"); local_14 = 0x20; ANM2::Load(sprite,(std_string *)(local_c8 + 0x14),0); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_c8 + 0x14); layer = ANM2::GetLayer(sprite,(byte *)0x3); layer->_visible = 0; layer = ANM2::GetLayer(sprite,&DAT_00000004); game = g_game; layer->_visible = 0; local_190 = *(byte **)((int)game->_room + 4); local_194 = Level::GetRoomByIdx((Level *)game,this->_targetRoomIdx,-1); if ((local_190 == (byte *)0x0) || ((iVar3 = *(int *)(local_190 + 0x10), iVar3 == 0 || (*(int *)(iVar3 + 8) != 1)))) { iVar3 = -1; } else { iVar3 = *(int *)(iVar3 + 0x10); } if (((local_194 == (RoomDescriptor *)0x0) || (pvVar4 = local_194->Data, pvVar4 == (void *)0x0)) || (*(int *)((int)pvVar4 + 8) != 1)) { local_198 = -NAN; } else { local_198 = *(float *)((int)pvVar4 + 0x10); } if ((iVar3 == 0) || (local_198 == 0.0)) { uVar7 = 0; if ((this->_sprite)._layerCount != 0) { do { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (char *)0x0; std::string::assign(tmpString._buf,(byte *)"gfx/grid/door_house_cracked.png",0x1f); local_14 = 0x21; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar7,&tmpString); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar8) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar8 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) goto LAB_0070d535; } operator_delete(pcVar5,uVar8); } uVar7 = uVar7 + 1; } while (uVar7 < (uint)(this->_sprite)._layerCount); } } else { uVar7 = *(uint *)(local_190 + 0x44); if ((((uVar7 >> 10 & 1) != 0) || (((uint)local_194->Flags >> 10 & 1) != 0)) || (g_game->_currentDimensionIdx == 2)) { uVar8 = 0; if ((this->_sprite)._layerCount != 0) { do { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (char *)0x0; std::string::assign(tmpString._buf,(byte *)"gfx/grid/door_closet_red.png",0x1c); local_14 = 0x22; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar8,&tmpString); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) goto LAB_0070d535; } operator_delete(pcVar5,uVar7); } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(this->_sprite)._layerCount); uVar7 = *(uint *)(local_190 + 0x44); } if ((((uVar7 >> 10 & 1) != 0) && (((uint)local_194->Flags >> 10 & 1) == 0)) && (g_game->_stageType == 0)) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x3); layer->_visible = 1; layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); layer->_visible = 1; } } } sprite = &this->_sprite; if (local_198 == 2.8026e-45) { color = (ColorMod *)Color::Color(0x3f800000); layer = ANM2::GetLayer(sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,color); } if (g_game->_stageType == 1) { Color::Color((Color *)local_c8); color = extraout_EAX; layer = ANM2::GetLayer(sprite,(byte *)0x0); Color::__mul((Color *)&layer->_color,color); } iVar3 = this->_direction; (this->_sprite)._flipX = iVar3 == 3; (this->_sprite)._flipY = iVar3 == 2; ANM2::LoadGraphics(sprite,(byte)iVar3); goto LAB_0070eb83; } std::string::string_from_cstr(local_c8 + 0x14,(byte *)"gfx/grid/Door_01_NormalDoor.anm2"); local_14 = 0x23; ANM2::Load(&this->_sprite,(std_string *)(local_c8 + 0x14),0); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_c8 + 0x14); game = g_game; if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 10 & 1) == 0) { roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); game = extraout_ECX; if (((uint)roomDesc->Flags >> 10 & 1) != 0) goto LAB_0070e564; bVar2 = IsRoomType(this,2); if (bVar2 != 0) { local_190 = (byte *)0xb68c48; bVar2 = extraout_CL; goto LAB_0070e56f; } bVar2 = IsRoomType(this,0x14); if (bVar2 != 0) { local_190 = (byte *)0xb68c68; bVar2 = extraout_CL_00; goto LAB_0070e56f; } bVar2 = IsRoomType(this,0xc); if (bVar2 != 0) { local_190 = (byte *)0xb68c8c; bVar2 = extraout_CL_01; goto LAB_0070e56f; } bVar2 = IsRoomType(this,0x15); if (bVar2 != 0) { local_190 = (byte *)0xb68cb0; bVar2 = extraout_CL_02; goto LAB_0070e56f; } bVar2 = IsRoomType(this,0xd); if (bVar2 != 0) { local_190 = (byte *)0xb68da4; bVar2 = extraout_CL_03; goto LAB_0070e56f; } local_190 = std::string::c_str((char *)((int)g_game->_room + *(int *)((int)g_game->_room + 0x1d18) * 0x13c + 0x1e0c)); bVar2 = extraout_CL_04; if (local_190 != (byte *)0x0) goto LAB_0070e56f; } else { LAB_0070e564: bVar2 = (byte)game; local_190 = (byte *)0xb68d30; LAB_0070e56f: uVar7 = 0; if ((this->_sprite)._layerCount != 0) { do { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (char *)0x0; local_194 = (RoomDescriptor *)(local_190 + 1); pbVar6 = local_190; do { bVar2 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar2 != 0); std::string::assign(tmpString._buf,local_190,(int)pbVar6 - (int)local_194); local_14 = 0x24; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar7,&tmpString); local_14 = 0xffffffff; bVar2 = extraout_CL_05; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar8) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar8 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) goto LAB_0070d535; } operator_delete(pcVar5,uVar8); bVar2 = extraout_CL_06; } uVar7 = uVar7 + 1; } while (uVar7 < (uint)(this->_sprite)._layerCount); } } ANM2::LoadGraphics(&this->_sprite,bVar2); std::string::assign((this->_lockedAnimation)._buf,(byte *)"KeyClosed",9); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"KeyOpen",7); goto LAB_0070eb83; } std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/Door_10_BossRoomDoor.anm2"); local_14 = 0x1a; ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_54._buf); layer = ANM2::GetLayer(&this->_sprite,&DAT_00b1ce2c); if (this->_targetRoomType == 5) { layer->_visible = 1; goto LAB_0070eb83; } goto LAB_0070db6f; } std::string::assign((this->_openAnimation)._buf,s_Open,4); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"KeyOpen",7); std::string::assign((this->_lockedAnimation)._buf,(byte *)"KeyClosed",9); iVar3 = get_secret_exit_kind(this); switch(iVar3) { case 1: local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf[0] = '\0'; local_6c._buf[1] = '\0'; local_6c._buf[2] = '\0'; local_6c._buf[3] = '\0'; local_6c._buf._0_4_ = std::_Allocate(0x20); local_6c._size = 0x1b; local_6c._capacity = 0x1f; builtin_strncpy((char *)local_6c._buf._0_4_,"gfx/grid/Door_Downpour.anm2",0x1c); local_14 = 6; ANM2::Load(&this->_sprite,&local_6c,1); local_14 = 0xffffffff; if (0xf < local_6c._capacity) { uVar7 = local_6c._capacity + 1; pcVar5 = (char *)local_6c._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(local_6c._buf._0_4_ + -4); uVar7 = local_6c._capacity + 0x24; if ((char *)0x1f < (char *)(local_6c._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; break; case 2: tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x20); tmpString._size = 0x18; tmpString._capacity = 0x1f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/grid/Door_Mines.anm2",0x19); local_14 = 7; ANM2::Load(&this->_sprite,&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pcVar5 = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { pcVar5 = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar7); } std::string::string_from_cstr(local_e0._buf,(byte *)"gfx/grid/Door_Mines_Planks.anm2"); local_14 = 8; ANM2::Load(&this->_extraSprite,&local_e0,1); pathString = &local_e0; goto LAB_0070db14; case 3: bVar2 = Level::HasPhotoDoor((Level *)g_game); if (bVar2 == 0) { std::string::string_from_cstr(local_f8._buf,(byte *)"gfx/grid/Door_Mausoleum.anm2"); local_14 = 10; ANM2::Load(&this->_sprite,&local_f8,1); pathString = &local_f8; goto LAB_0070db14; } std::string::string_from_cstr(local_e0._buf,(byte *)"gfx/grid/Door_Mausoleum_Alt.anm2"); local_14 = 9; ANM2::Load(&this->_sprite,&local_e0,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_e0._buf); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_visible = 1; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x2); layer->_visible = 0; layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); layer->_visible = 0; this->_doorFlags = this->_doorFlags | 0x40; std::string::assign((this->_openLockedAnimation)._buf,s_Open,4); break; case 4: std::string::string_from_cstr(local_110._buf,(byte *)"gfx/grid/Door_MomsHeart.anm2"); local_14 = 0xb; ANM2::Load(&this->_sprite,&local_110,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_110._buf); isExtraSpriteAllowed = '\0'; if (g_game->_currentRoomIdx == -10) { std::string::assign((this->_closeAnimation)._buf,(byte *)"Disappear",9); } break; default: std::string::string_from_cstr(local_54._buf,(byte *)"gfx/grid/Door_01_NormalDoor.anm2"); local_14 = 0xc; ANM2::Load(&this->_sprite,&local_54,1); pathString = &local_54; LAB_0070db14: local_14 = 0xffffffff; std::string::_Tidy_deallocate(pathString->_buf); } if (this->_targetRoomType != 0x1b) { layer = ANM2::GetLayer(&this->_sprite,(byte *)"Background"); if (layer != (LayerState *)0x0) { (layer->_color)._colorize[0] = 0.5; (layer->_color)._colorize[1] = 0.5; (layer->_color)._colorize[2] = 0.5; (layer->_color)._colorize[3] = 0.6; } layer = ANM2::GetLayer(&this->_sprite,(byte *)"Light"); if (layer != (LayerState *)0x0) { LAB_0070db6f: layer->_visible = 0; } } LAB_0070eb83: payToPlayOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x17c,(RNG **)&g_game->_playerManager,1); if ((((payToPlayOwner != (Entity_Player *)0x0) || (g_game->_challenge == 0x18)) && ((iVar3 = (this->_desc)._variant, iVar3 == 1 || (iVar3 == 2)))) && ((this->_currentRoomType != 9 && (this->_targetRoomType != 9)))) { pathString = &this->_openLockedAnimation; if (0xf < (this->_openLockedAnimation)._capacity) { pathString = *(std_string **)(this->_openLockedAnimation)._buf; } bVar2 = str_eq((byte *)pathString,(this->_openLockedAnimation)._size,(byte *)"KeyOpen",7); if ((bVar2 != 0) || (g_game->_challenge == 0x18)) { pvVar4 = ANM2::GetAnimationData(&this->_sprite,(byte *)"CoinClosed"); if (pvVar4 != (void *)0x0) { std::string::assign((this->_lockedAnimation)._buf,(byte *)"CoinClosed",10); std::string::assign((this->_openLockedAnimation)._buf,(byte *)"CoinOpen",8); } this->_doorFlags = this->_doorFlags | 1; } } local_194 = (RoomDescriptor *)(((this->_sprite)._rotation + 90.0) * 0.017453292); local_198 = sin((float)local_194); colorizeG = cos((float)local_194); (this->_sprite)._offset.x = colorizeG * offsetLength; (this->_sprite)._offset.y = local_198 * offsetLength; bVar2 = (this->_extraSprite)._loaded; (this->_extraSprite)._offset.x = colorizeG * offsetLength; (this->_extraSprite)._offset.y = (this->_sprite)._offset.y; if ((bVar2 == 0) && (isExtraSpriteAllowed != '\0')) { iVar3 = (this->_desc)._variant; if (iVar3 == 2) { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (void *)0x0; std::string::assign(tmpString._buf,(byte *)"gfx/grid/door_16_doublelock.anm2",0x20); local_14 = 0x25; ANM2::Load(&this->_extraSprite,&tmpString,1); if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pvVar4 = (void *)tmpString._buf._0_4_; if (0xfff < uVar7) { pvVar4 = *(void **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar7); } } else if (iVar3 == 3) { std::string::string_from_cstr(local_c8 + 0x14,(byte *)"gfx/grid/door_18_crackeddoor.anm2"); local_14 = 0x26; ANM2::Load(&this->_extraSprite,(std_string *)(local_c8 + 0x14),1); std::string::_Tidy_deallocate(local_c8 + 0x14); } else if ((iVar3 == 4) || (iVar3 == 6)) { std::string::string_from_cstr(local_188._buf,(byte *)"gfx/grid/door_17_bardoor.anm2"); local_14 = 0x27; ANM2::Load(&this->_extraSprite,&local_188,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_188._buf); std::string::assign((this->_closeAnimation)._buf,(byte *)"Closed",6); } } this->_isExtraVisible = 0; ExceptionList = local_1c; return; } //@@ 0070ee40 GridEntity_Door::UpdateAnimation /* DB: door anm2 states Hidden/Idle/KeyOpen/GoldenKeyOpen prototype: db/protos.zhl */ void __thiscall GridEntity_Door::UpdateAnimation(GridEntity_Door *this) { int iVar1; byte bVar2; LayerState *layer; Entity_Player *player; byte *animNameCursor; uint uVar3; int iVar4; char *pcVar5; std_string *expectedName; int *variantPtr; std_string *animName; GridEntity_Door *variantRef; Sprite *sprite; bool bVar6; EntityList_EL familiars; int roomAge; int spawnAge; GridEntity_Door *local_18; GridEntity_Door *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; Game *game; int variant; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afc96d; local_10 = ExceptionList; if ((this->_sprite)._loaded == 0) { return; } ExceptionList = &local_10; this->_isExtraVisible = 0; roomAge = game->_frameCount; pcVar5 = game->_room; spawnAge = roomAge - this->_spawnFrame; if (*pcVar5 == '\0') { roomAge = -1; } else { roomAge = roomAge - *(int *)(pcVar5 + 0x11f0); } sprite = (Sprite *)&this->_sprite; local_18 = this; layer = ANM2::GetLayer((ANM2 *)sprite,(byte *)0x0); layer->_visible = 1; iVar4 = this->_targetRoomType; if (iVar4 == 0) { ExceptionList = local_10; return; } iVar1 = (this->_desc)._state; if ((((iVar1 == 1) || (iVar1 == 4)) || (iVar1 == 3)) || (iVar1 == 5)) { iVar1 = this->_currentRoomType; if (((((iVar1 == 7) || (iVar4 == 7)) || ((iVar1 == 8 || ((iVar4 == 8 || (iVar1 == 0x1d)))))) || (iVar4 == 0x1d)) && ((this->_desc)._variant == 7)) { ANM2::Play((ANM2 *)sprite,(byte *)"Hidden",0); variantRef = (GridEntity_Door *)&(this->_desc)._variant; } else { variantPtr = &(this->_desc)._variant; variant = *variantPtr; local_18 = (GridEntity_Door *)variantPtr; if (variant == 1) { if ((((iVar1 == 0x1b) || (iVar4 == 0x1b)) && (iVar4 = get_secret_exit_kind(this), iVar4 == 3)) && ((this->_desc)._state == 3)) { bVar2 = ANM2::SetAnimation((ANM2 *)sprite,&DAT_00b68d9c,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_previousState = (this->_desc)._state; this->_previousVariant = *variantPtr; ExceptionList = local_10; return; } animName = &this->_lockedAnimation; if (0xf < (this->_lockedAnimation)._capacity) { animName = *(std_string **)animName->_buf; } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0070f2ee: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = animName; do { bVar2 = *animNameCursor; bVar6 = bVar2 < (byte)expectedName->_buf[0]; if (bVar2 != expectedName->_buf[0]) { LAB_0070f2d0: uVar3 = -(uint)bVar6 | 1; goto LAB_0070f2d5; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar6 = bVar2 < (byte)expectedName->_buf[1]; if (bVar2 != expectedName->_buf[1]) goto LAB_0070f2d0; animNameCursor = animNameCursor + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_0070f2d5: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0070f2ee; } variantRef = local_18; LAB_0070f30b: local_14 = variantRef; } else if ((((variant == 4) || (variant == 3)) || (variant == 2)) || (variant == 6)) { animName = &this->_closeAnimation; if (0xf < (this->_closeAnimation)._capacity) { animName = *(std_string **)animName->_buf; } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0070f4b6: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = animName; do { bVar2 = *animNameCursor; bVar6 = bVar2 < (byte)expectedName->_buf[0]; if (bVar2 != expectedName->_buf[0]) { LAB_0070f4a0: uVar3 = -(uint)bVar6 | 1; goto LAB_0070f4a5; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar6 = bVar2 < (byte)expectedName->_buf[1]; if (bVar2 != expectedName->_buf[1]) goto LAB_0070f4a0; animNameCursor = animNameCursor + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_0070f4a5: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0070f4b6; } if ((this->_doorFlags & 0x20) == 0) { Sprite::SetLastFrame((Sprite *)&this->_sprite); } variantRef = local_18; local_14 = local_18; if ((this->_extraSprite)._loaded != 0) { iVar4 = *(int *)local_18; iVar1 = (this->_desc)._state; this->_isExtraVisible = 1; if (iVar4 == 2) { if (iVar1 != 3) { ANM2::Play(&this->_extraSprite,(byte *)"TwoChains",0); goto LAB_0070f311; } if (this->_previousState == 3) { pcVar5 = "OneChain"; } else { player = Game::GetPlayer(g_game,0); pcVar5 = "GoldenKeyOpenChain1"; if (player->_hasGoldenKey == 0) { pcVar5 = "KeyOpenChain1"; } } ANM2::Play(&this->_extraSprite,(byte *)pcVar5,0); local_14 = variantRef; } else { if (iVar1 == 4) { pcVar5 = "Damaged"; } else if (((iVar4 != 4) && (iVar4 != 6)) || (pcVar5 = "Appear", spawnAge < 0xb)) { pcVar5 = (char *)s_Idle; } ANM2::Play(&this->_extraSprite,(byte *)pcVar5,0); if (((this->_currentRoomType == 0x1b) || (this->_targetRoomType == 0x1b)) && (iVar4 = get_secret_exit_kind(this), iVar4 == 2)) { iVar4 = (this->_desc)._state; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x2); layer->_visible = iVar4 != 4; variantRef = local_18; } local_14 = variantRef; } } } else { local_14 = (GridEntity_Door *)variantPtr; if ((this->_closeAnimation)._size != 0) { animName = &this->_closeAnimation; if (0xf < (this->_closeAnimation)._capacity) { animName = *(std_string **)animName->_buf; } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0070f3fe: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = animName; do { bVar2 = *animNameCursor; bVar6 = bVar2 < (byte)expectedName->_buf[0]; if (bVar2 != expectedName->_buf[0]) { LAB_0070f3e0: uVar3 = -(uint)bVar6 | 1; goto LAB_0070f3e5; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar6 = bVar2 < (byte)expectedName->_buf[1]; if (bVar2 != expectedName->_buf[1]) goto LAB_0070f3e0; animNameCursor = animNameCursor + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_0070f3e5: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0070f3fe; } variantRef = local_18; local_14 = local_18; if (((this->_extraSprite)._loaded == 0) || (local_14 = local_18, *(int *)local_18 == 8)) goto LAB_0070f30e; this->_isExtraVisible = 1; ANM2::Play(&this->_extraSprite,(byte *)"Appear",0); goto LAB_0070f30b; } } LAB_0070f30e: variantRef = local_14; } LAB_0070f311: if (((spawnAge < roomAge) || ((((this->_doorFlags & 8) != 0 && (this->_slot != g_game->_enterDoor)) && (spawnAge == 0)))) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } goto LAB_0070f174; } if (((iVar4 == 5) && (-1 < this->_targetRoomIdx)) && (g_game->_stage == 9)) { bVar6 = true; } else { bVar6 = false; } iVar4 = (this->_desc)._variant; if (iVar4 == 1) { player = Game::GetPlayer(g_game,0); if (((player->_hasGoldenKey == 0) || (bVar2 = IsRoomType(this,9), bVar2 != 0)) || ((bVar2 = IsRoomType(this,0xb), bVar2 != 0 || ((player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x17c,(RNG **)&g_game->_playerManager,1), player != (Entity_Player *)0x0 || (bVar6)))))) { animName = &this->_openLockedAnimation; if (0xf < (this->_openLockedAnimation)._capacity) { animName = *(std_string **)animName->_buf; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = animName; do { bVar2 = *animNameCursor; bVar6 = bVar2 < (byte)expectedName->_buf[0]; if (bVar2 != expectedName->_buf[0]) { LAB_0070efc2: uVar3 = -(uint)bVar6 | 1; goto LAB_0070efc7; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar6 = bVar2 < (byte)expectedName->_buf[1]; if (bVar2 != expectedName->_buf[1]) goto LAB_0070efc2; animNameCursor = animNameCursor + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_0070efc7: if ((uVar3 == 0) && ((sprite = (Sprite *)&this->_sprite, animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0070f148; } sprite = (Sprite *)&this->_sprite; bVar2 = ANM2::SetAnimation((ANM2 *)sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; goto LAB_0070f145; } } else { ANM2::Play((ANM2 *)sprite,(byte *)"GoldenKeyOpen",0); } } else { if (iVar4 == 2) { bVar2 = 0; player = Game::GetPlayer(g_game,0); pcVar5 = "KeyOpenChain2"; if (player->_hasGoldenKey != 0) { pcVar5 = "GoldenKeyOpenChain2"; } ANM2::Play(&this->_extraSprite,(byte *)pcVar5,bVar2); this->_isExtraVisible = 1; } animName = &this->_openAnimation; if (0xf < (this->_openAnimation)._capacity) { animName = *(std_string **)animName->_buf; } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0070f0a0: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameCursor = *(byte **)animData; } expectedName = animName; do { bVar2 = *animNameCursor; bVar6 = bVar2 < (byte)expectedName->_buf[0]; if (bVar2 != expectedName->_buf[0]) { LAB_0070f085: uVar3 = -(uint)bVar6 | 1; goto LAB_0070f08a; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; bVar6 = bVar2 < (byte)expectedName->_buf[1]; if (bVar2 != expectedName->_buf[1]) goto LAB_0070f085; animNameCursor = animNameCursor + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar2 != 0); uVar3 = 0; LAB_0070f08a: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0070f0a0; } sprite = (Sprite *)&this->_sprite; if (this->_targetRoomIdx == -7) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0); local_8 = 0; uVar3 = 0; if (familiars._size != 0) { do { iVar4 = __RTDynamicCast(*(undefined4 *)((int)familiars._data + uVar3 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (*(int *)(iVar4 + 0x2c) == 0xec) { *(undefined4 *)(iVar4 + 0xd88) = 1; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)familiars._size); this = local_18; } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&familiars); LAB_0070f145: sprite = (Sprite *)&this->_sprite; } } LAB_0070f148: if ((roomAge <= spawnAge) && (((spawnAge < 10 && ((this->_doorFlags & 0x40) == 0)) || (spawnAge < 2)))) { Sprite::SetLastFrame(sprite); this->_isExtraVisible = 0; } variantRef = (GridEntity_Door *)&(this->_desc)._variant; LAB_0070f174: iVar4 = *(int *)variantRef; if (((iVar4 != 4) && (iVar4 != 6)) && ((this->_previousVariant == 4 || (this->_previousVariant == 6)))) { ANM2::Play(&this->_extraSprite,(byte *)"Vanish",0); iVar4 = *(int *)variantRef; this->_isExtraVisible = 1; } this->_previousState = (this->_desc)._state; this->_previousVariant = iVar4; ExceptionList = local_10; return; } //@@ 0070f5e0 GridEntity_Door::Destroy /* ZHL [vtable slot 5] */ byte __thiscall GridEntity_Door::Destroy(GridEntity_Door *this,undefined4 param_2,int *param_3) { byte bVar1; RoomDescriptor *pRVar2; Entity_Player *player; bVar1 = TryBlowOpen(this,1,(Entity *)param_3[9]); if (((bVar1 != 0) && ((*param_3 == 1 || (param_3[2] == 1)))) && ((this->_targetRoomType == 7 || (this->_targetRoomType == 8)))) { pRVar2 = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if ((pRVar2->VisitedCount == 0) && ((Entity *)param_3[9] != (Entity *)0x0)) { player = (Entity_Player *)Entity::GetPlayerAncestor((Entity *)param_3[9]); if (player != (Entity_Player *)0x0) { Player_stats_add(&g_game->_onlinePlayerStats,0x13,player,1.0); } } } return bVar1; } //@@ 0070f670 GridEntity_Door::CanTakeDamageFromTearEffects /* ZHL [vtable slot 7] */ uint __thiscall GridEntity_Door::CanTakeDamageFromTearEffects(GridEntity_Door *this) { return CONCAT31((uint3)((uint)this->_doorFlags >> 0xc),~(byte)((uint)this->_doorFlags >> 4)) & 0xffffff01; } //@@ 0070f680 GridEntity_Door::CanBlowOpen /* ZHL [lua] Lua binding GridEntityDoor:CanBlowOpen */ undefined4 __thiscall GridEntity_Door::CanBlowOpen(GridEntity_Door *this) { int iVar1; void *pvVar2; Game *pGVar3; byte bVar4; Entity_Player *this_00; int iVar5; if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((g_game->_stage == 0xb || (g_game->_stage == 0xc)))) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { return 0; } if (this->_targetRoomType == 0) { return 0; } if ((this->_desc)._state == 2) { return 0; } if (g_game->_stage == 0xd) { return 0; } bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x88); pGVar3 = g_game; if (bVar4 != 0) { iVar5 = (this->_desc)._variant; if (iVar5 == 1) { return 1; } if (iVar5 == 2) { return 1; } } iVar5 = this->_currentRoomType; if (iVar5 == 1) { if (this->_targetRoomType == 1) { iVar1 = (this->_desc)._variant; if ((((iVar1 != 1) && (iVar1 != 4)) && (iVar1 != 2)) && (iVar1 != 5)) { return 1; } LAB_0070f748: bVar4 = IsRoomType(this,8); if ((bVar4 == 0) && (bVar4 = IsRoomType(this,0x1d), bVar4 == 0)) goto LAB_0070f79f; } else { LAB_0070f73f: if (this->_targetRoomType != 7) goto LAB_0070f748; } if (iVar5 == 5) goto LAB_0070f79f; } else if (iVar5 != 7) goto LAB_0070f73f; if ((this->_targetRoomType != 5) && (((pvVar2 = pGVar3->_room, *(char *)((int)pvVar2 + 0x7228) == '\0' && (iVar5 != 6)) || ((*(byte *)(*(int *)((int)pvVar2 + 4) + 0x44) & 1) != 0)))) { if (iVar5 != 0xb) { return 1; } if ((*(uint *)(*(int *)((int)pvVar2 + 4) + 0x44) >> 3 & 1) != 0) { return 1; } } LAB_0070f79f: iVar5 = (this->_desc)._variant; if (iVar5 == 3) { return 1; } if (((((this->_doorFlags & 9) != 0) || (this->_targetRoomType == 5)) || (iVar5 == 5)) && (this_00 = PlayerManager::FirstTrinketOwner(&pGVar3->_playerManager,0x88), this_00 != (Entity_Player *)0x0)) { iVar5 = Entity_Player::GetTrinketMultiplier(this_00,0x88); if (iVar5 == 2) { if ((this->_doorFlags & 9) != 0) { return 1; } iVar5 = (this->_desc)._variant; } else { if (iVar5 < 3) { return 0; } iVar5 = this->_targetRoomType; } if (iVar5 == 5) { return 1; } } return 0; } //@@ 0070f810 GridEntity_Door::SpawnDust /* ZHL [lua] Lua binding GridEntityDoor:SpawnDust */ void __thiscall GridEntity_Door::SpawnDust(GridEntity_Door *this) { float fVar1; int iVar2; Vector *pVVar3; uint uVar4; uint uVar5; Entity *pEVar6; int *piVar7; int iVar8; float fVar9; float fVar10; float fVar11; float fVar12; undefined1 *local_30; int local_24; Vector local_18; Vector local_10; pVVar3 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,this->_direction); fVar1 = pVVar3->x; fVar12 = -pVVar3->y; uVar4 = Random(); local_24 = (uVar4 & 3) + 3; if (local_24 != 0) { do { uVar4 = Random(); uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0; uVar5 = Random(); iVar8 = this->_gridIndex; fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 - 2.5; local_18.y = fVar11 * fVar1 + fVar9 * fVar12; local_18.x = fVar11 * fVar12 + fVar9 * -fVar1; iVar2 = *(int *)((int)g_game->_room + 0xc); uVar5 = Random(); fVar9 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar9 = fVar9 + fVar9; uVar5 = Random(); fVar11 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 20.0; fVar10 = cos(fVar9); local_10.x = fVar10 * fVar11 + (float)(iVar8 % iVar2) * 40.0 + 40.0; fVar9 = sin(fVar9); local_10.y = fVar9 * fVar11 + (float)(iVar8 / iVar2) * 40.0 + 120.0; pEVar6 = Game::SpawnEx(g_game,1000,0x3b,&local_10,&local_18,(Entity *)0x0,0,uVar4,0); piVar7 = (int *)__RTDynamicCast(pEVar6,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); iVar8 = *(int *)((int)g_game->_room + 0xc); local_30 = (undefined1 *)0x3f800000; if (((float)piVar7[0xcf] - ((float)(this->_gridIndex % iVar8) * 40.0 + 40.0)) * fVar12 + ((float)piVar7[0xd0] - ((float)(this->_gridIndex / iVar8) * 40.0 + 120.0)) * fVar1 < 0.0) { local_30 = &DAT_bf800000; } uVar4 = Random(); piVar7[0x11d] = (int)(((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_30); uVar4 = Random(); iVar8 = uVar4 % 0xf + 0xf; piVar7[0x117] = iVar8; piVar7[0x118] = iVar8; (**(code **)(*piVar7 + 0xc))(); local_24 = local_24 + -1; } while (local_24 != 0); } return; } //@@ 0070fb60 GridEntity_Door::TryBlowOpen /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding GridEntityDoor:TryBlowOpen prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall GridEntity_Door::TryBlowOpen(GridEntity_Door *this,byte isFromExplosion,Entity *source) { uint *puVar1; qword qVar2; char cVar3; byte bVar4; ChallengeParam *challengeParams; Entity_Player *player; int iVar5; ColorMod *color; uint rngResult; ColorMod *color_00; Entity *poof; RoomDescriptor *targetRoomDesc; ColorMod *color_01; Vector *pVVar6; ColorMod *color_02; ColorMod *color_03; char *pcVar7; int soundId; Vector doorPos; Color particleColor; uint stackCookie; Game *game; Manager *manager; void *room; int variant; stackCookie = __security_cookie ^ (uint)&soundId; if (((isFromExplosion == 0) && (source == (Entity *)0x0)) && (cVar3 = FUN_00711740(), cVar3 == '\0')) { return 0; } if ((this->_doorFlags & 0x10) != 0) { if (((g_game->_challenge != 0) || ((g_game->_dailyChallenge)._id != 0)) && (challengeParams = Game::GetChallengeParams(g_game), challengeParams->_pathType == 2)) { return 0; } if ((this->_desc)._state == 2) { return 0; } (this->_desc)._variant = 8; this->_isBusted = 1; (this->_desc)._state = 2; UpdateAnimation(this); manager = g_manager; soundId = 0x262; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); g_game->_levelStateFlags = g_game->_levelStateFlags | 0x800000; if (source == (Entity *)0x0) { return 1; } player = (Entity_Player *)Entity::GetPlayerAncestor(source); if (player == (Entity_Player *)0x0) { return 1; } Entity_Player::DonateLuck(player,-7); return 1; } iVar5 = get_secret_exit_kind(this); if (iVar5 == 4) { if (source == (Entity *)0x0) { return 0; } if (source->_type != 3) { return 0; } if (source->_variant == 0xdf) { GridEntity::Position((GridEntity *)this,&doorPos); Color::Color(&particleColor); rngResult = Random(); Game::SpawnParticles(g_game,&doorPos,4,rngResult % 5 + 6,8.0,color,100000.0,10); Color::Color(&particleColor); rngResult = Random(); Game::SpawnParticles(g_game,&doorPos,5,rngResult % 6 + 9,8.0,color_00,100000.0,0); rngResult = Random(); poof = Game::SpawnEx(g_game,1000,2,&doorPos,&g_vectorZero,(Entity *)0x0,0,rngResult,0); ANM2::Play(&poof->_sprite,(byte *)"Poof_Large1",0); poof->_renderDepthOffset = 5.0; manager = g_manager; (this->_desc)._variant = 8; this->_isBusted = 1; (this->_desc)._state = 2; soundId = 0x4d; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); manager = g_manager; soundId = 0x1c; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); UpdateAnimation(this); Game::UpdateVisibility(g_game); game = g_game; qVar2 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x100000; *(int *)&game->_gameStateFlags = (int)qVar2; return 1; } return 0; } iVar5 = this->_targetRoomType; if (((iVar5 == 7) || (iVar5 == 8)) || (iVar5 == 0x1d)) { bVar4 = 0xff; iVar5 = this->_targetRoomIdx; targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,iVar5,-1); if ((targetRoomDesc->VisitedCount == 0) && ((this->_desc)._variant == 7)) { Music::PlayJingle((Music *)&g_manager->_musicManager,0x55,iVar5,bVar4); } } iVar5 = (this->_desc)._variant; if ((iVar5 == 7) || (iVar5 == 0)) { Level::UncoverHiddenDoor(g_game->_currentRoomIdx,this->_slot); } if (((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((g_game->_stage == 0xb || (g_game->_stage == 0xc)))) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) || (((this->_targetRoomType == 0 || ((this->_desc)._state == 2)) || (g_game->_stage == 0xd)))) goto LAB_00710310; bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x88); if ((bVar4 == 0) || ((iVar5 = (this->_desc)._variant, iVar5 != 1 && (iVar5 != 2)))) { iVar5 = this->_currentRoomType; if (iVar5 == 1) { if (this->_targetRoomType == 1) { variant = (this->_desc)._variant; if (((variant != 1) && (variant != 4)) && ((variant != 2 && (variant != 5)))) goto LAB_00710063; LAB_0070ff8f: bVar4 = IsRoomType(this,8); if ((bVar4 != 0) || (bVar4 = IsRoomType(this,0x1d), bVar4 != 0)) goto LAB_0070ffa9; } else { LAB_0070ff86: if (this->_targetRoomType != 7) goto LAB_0070ff8f; LAB_0070ffa9: if (iVar5 != 5) goto LAB_0070ffae; } } else { if (iVar5 != 7) goto LAB_0070ff86; LAB_0070ffae: if ((this->_targetRoomType != 5) && ((((room = g_game->_room, *(char *)((int)room + 0x7228) == '\0' && (iVar5 != 6)) || ((*(byte *)(*(int *)((int)room + 4) + 0x44) & 1) != 0)) && ((iVar5 != 0xb || ((*(uint *)(*(int *)((int)room + 4) + 0x44) >> 3 & 1) != 0)))))) goto LAB_00710063; } iVar5 = (this->_desc)._variant; if (iVar5 != 3) { if (((((this->_doorFlags & 9) != 0) || (this->_targetRoomType == 5)) || (iVar5 == 5)) && (player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x88), player != (Entity_Player *)0x0)) { iVar5 = Entity_Player::GetTrinketMultiplier(player,0x88); if (iVar5 == 2) { if ((this->_doorFlags & 9) != 0) goto LAB_00710063; iVar5 = (this->_desc)._variant; } else { if (iVar5 < 3) goto LAB_00710310; iVar5 = this->_targetRoomType; } if (iVar5 == 5) goto LAB_00710063; } LAB_00710310: iVar5 = (this->_desc)._variant; if ((iVar5 != 7) && (iVar5 != 0)) { return 0; } if ((this->_currentRoomType == 6) || (iVar5 = 8, *(char *)((int)g_game->_room + 0x7228) != '\0')) { iVar5 = 4; } (this->_desc)._variant = iVar5; if (isFromExplosion != 0) { SpawnDust(this); } goto LAB_00710353; } } LAB_00710063: iVar5 = (this->_desc)._variant; if (((iVar5 == 1) || (iVar5 == 2)) && (bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x88), bVar4 != 0)) { (this->_desc)._variant = 8; } if (((this->_currentRoomType == 1) && (this->_targetRoomType == 1)) && (((this->_desc)._variant != 3 && (std::string::assign((this->_openAnimation)._buf,(byte *)"Break",5), isFromExplosion != 0)))) { Color::Color(&particleColor); rngResult = Random(); pVVar6 = GridEntity::Position((GridEntity *)this,&doorPos); Game::SpawnParticles(g_game,pVVar6,0x1b,rngResult % 5 + 6,8.0,color_01,100000.0,0); SpawnDust(this); } if (((this->_currentRoomType == 7) || (this->_targetRoomType == 7)) || ((this->_currentRoomType == 8 || (this->_targetRoomType == 8)))) { LAB_00710147: pcVar7 = "Opened"; std::string::assign((this->_openAnimation)._buf,(byte *)"Opened",6); if (isFromExplosion != 0) { Color::Color(&particleColor); rngResult = Random(); pVVar6 = GridEntity::Position((GridEntity *)this,&doorPos); Game::SpawnParticles(g_game,pVVar6,4,rngResult % 5 + 6,8.0,color_02,100000.0,0); SpawnDust(this); manager = g_manager; soundId = 0x89; seed_fart_sound_override(&soundId); pcVar7 = (char *)0x3f800000; SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); } } else { pcVar7 = (char *)0x71013f; bVar4 = IsRoomType(this,0x1d); if (bVar4 != 0) goto LAB_00710147; } if ((this->_desc)._variant == 3) { Color::Color(&particleColor); rngResult = Random(); pVVar6 = GridEntity::Position((GridEntity *)this,&doorPos); pcVar7 = (char *)0x47c35000; Game::SpawnParticles(g_game,pVVar6,0x1b,rngResult % 5 + 6,8.0,color_03,100000.0,0); if ((this->_desc)._state == 1) { (this->_desc)._state = 4; LAB_00710353: UpdateAnimation(this); return 0; } } iVar5 = (this->_desc)._variant; if (iVar5 != 1) { if (((iVar5 == 7) && (*(int *)((int)g_game->_room + 8) == 6)) || (*(char *)((int)g_game->_room + 0x7228) != '\0')) { (this->_desc)._variant = 4; } else { if (iVar5 == 3) { FUN_0070bfa0(0x1e1,2,pcVar7,0x3f800000); } (this->_desc)._variant = 8; this->_isBusted = 1; (this->_desc)._state = 2; } } UpdateAnimation(this); Game::UpdateVisibility(g_game); if (isFromExplosion != 0) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,199,1); } return 1; } //@@ 00710370 FUN_00710370 undefined4 FUN_00710370(void) { int iVar1; GridEntity_Door *in_ECX; if (((in_ECX->_doorFlags & 0x50U) == 0) && (((in_ECX->_doorFlags & 0x20U) == 0 || ((in_ECX->_desc)._variant != 4)))) { iVar1 = GridEntity_Door::get_secret_exit_kind(in_ECX); if (iVar1 != 4) { return 1; } } return 0; } //@@ 007103a0 FUN_007103a0 undefined4 FUN_007103a0(void) { int iVar1; undefined3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0xc); uVar2 = (undefined3)((uint)iVar1 >> 8); if ((*(byte *)(in_ECX + 0x3a0) & 0x10) == 0) { return CONCAT31(uVar2,iVar1 == 2); } return CONCAT31(uVar2,iVar1 != 2); } //@@ 007103c0 FUN_007103c0 EntityPtr FUN_007103c0(undefined4 *param_1) { byte bVar1; EntityPtr EVar2; EntityPtr in_ECX; undefined4 *in_EDX; bVar1 = Entity_Player::HasTrinket((Entity_Player *)in_ECX,0x45,1); while( true ) { if (bVar1 != 0) { *param_1 = 0x45; return in_ECX; } bVar1 = Entity_Player::HasCollectible((Entity_Player *)in_ECX,0x147,1); if (bVar1 != 0) { *in_EDX = 0x147; return in_ECX; } bVar1 = Entity_Player::HasCollectible((Entity_Player *)in_ECX,0x148,1); if (bVar1 != 0) { *in_EDX = 0x148; return in_ECX; } if (*(byte *)((int)in_ECX + 0x170) == 0) break; EVar2 = (EntityPtr)Entity_Player::GetMainTwin((Entity_Player *)in_ECX); if ((EVar2 != in_ECX) || (EVar2 = *(EntityPtr *)((int)in_ECX + 0x1e68), EVar2 == (EntityPtr)0x0) ) { if ((*(int *)((int)in_ECX + 0x13c0) != 0x1d) && (*(int *)((int)in_ECX + 0x13c0) != 0x26)) { return (EntityPtr)0x0; } EVar2 = *(EntityPtr *)((int)in_ECX + 0x1e6c); if (EVar2 == (EntityPtr)0x0) { return (EntityPtr)0x0; } } bVar1 = Entity_Player::HasTrinket((Entity_Player *)EVar2,0x45,1); in_ECX = EVar2; } return (EntityPtr)0x0; } //@@ 00710480 GridEntity_Door::TryUnlock /* WARNING: Removing unreachable block (ram,0x0071058e) */ /* ZHL [lua] Lua binding GridEntityDoor:TryUnlock prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall GridEntity_Door::TryUnlock(GridEntity_Door *this,Entity_Player *player,byte isForce) { byte bVar1; char isDamaged; int iVar2; Entity_Player *trinketHolder; Vector *pVVar3; uint rngResult; Entity *particle; byte *pbVar4; uint uVar5; byte *pbVar6; LayerState *layer; RoomDescriptor *targetRoomDesc; Entity_Player *trinketHolder; undefined4 extraout_ECX; char *wantedAnimNameStr; ANM2 *sprite; bool bVar7; uint in_stack_ffffff80; float local_64; uint local_60; float cosSpread; float negDirY; uint slowParticleCount; int particleCount; Vector particleVelocity; Vector particlePos; Vector VStack_3c; ColorMod local_34; float dirX; Game *game; qword gameStateFlags; uint *gameStateFlagsHigh; Manager *manager; code *takeDamage; int variant; game = g_game; if ((this->_doorFlags & 0x10) != 0) { return 0; } if (player->_isCoopGhost != 0) { return 0; } iVar2 = (this->_desc)._variant; if (isForce == 0) { if (((iVar2 == 1) && (this->_targetRoomType == 0x1b)) && (iVar2 = get_secret_exit_kind(this), iVar2 == 3)) { if ((this->_doorFlags & 0x40) != 0) { local_64 = 0.0; trinketHolder = (Entity_Player *)FUN_007103c0(&local_64); if (trinketHolder == (Entity_Player *)0x0) { return 0; } if (local_64 != 0.0) { Entity_Player::TryRemoveTrinket(trinketHolder,(uint)local_64); } manager = g_manager; local_60 = 8; seed_fart_sound_override((int *)&local_60); bVar1 = 0; iVar2 = 0x3f800000; SoundEffects::Play(&manager->_sfxManager,local_60,1.0,2,0,1.0,0.0); Music::PlayJingle((Music *)&g_manager->_musicManager,0x44,iVar2,bVar1); (this->_desc)._state = 2; UpdateAnimation(this); (this->_desc)._variant = 8; sprite = &this->_sprite; layer = ANM2::GetLayer(sprite,(byte *)0x1); layer->_visible = 0; bVar7 = local_64 == 9.66896e-44; layer = ANM2::GetLayer(sprite,(byte *)0x2); layer->_visible = bVar7; layer = ANM2::GetLayer(sprite,&DAT_00000004); layer->_visible = 0; return 1; } if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { pbVar6 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pbVar4 = &DAT_00b68d9c; do { bVar1 = *pbVar6; bVar7 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_007106c0: uVar5 = -(uint)bVar7 | 1; goto LAB_007106c5; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar7 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_007106c0; pbVar6 = pbVar6 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_007106c5: if (uVar5 == 0) { return 0; } } iVar2 = Entity_Player::GetHealthType(player); if ((iVar2 != 2) && (bVar1 = Entity_Player::HasInstantDeathCurse(trinketHolder), bVar1 == 0)) { in_stack_ffffff80 = 0x7106fd; bVar1 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x49); if (bVar1 == 0) { EntityRef::EntityRef((EntityRef *)&local_34); takeDamage = *(code **)(*(int *)player + 0x20); local_34._tint[0] = 0.0; local_34._tint[1] = 1.40172e-41; player->_damageCooldown = 0; isDamaged = (*takeDamage)(0x40000000,0x12002080,0,extraout_ECX,0x1e); if (isDamaged == '\0') { return 0; } pVVar3 = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_3c,this->_direction); dirX = pVVar3->x; negDirY = -pVVar3->y; in_stack_ffffff80 = Random(); pVVar3 = GridEntity::Position((GridEntity *)this,&VStack_3c); Game::SpawnEx(g_game,1000,2,pVVar3,&g_vectorZero,(Entity *)0x0,3,in_stack_ffffff80,0); uVar5 = Random(); slowParticleCount = (uVar5 & 1) + 2; rngResult = Random(); particleCount = (uVar5 & 1) + 8 + rngResult % 10; local_60 = 0; if (particleCount != 0) { do { uVar5 = local_60; rngResult = Random(); local_64 = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0) * 0.017453292; cosSpread = cos(local_64); local_64 = sin(local_64); rngResult = Random(); particleVelocity.y = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 15.0 + 5.0; particleVelocity.x = (-dirX * cosSpread - negDirY * local_64) * particleVelocity.y; particleVelocity.y = (negDirY * cosSpread + -dirX * local_64) * particleVelocity.y; iVar2 = *(int *)((int)g_game->_room + 0xc); particlePos.x = (float)(this->_gridIndex % iVar2) * 40.0 + 40.0 + particleVelocity.x; particlePos.y = (float)(this->_gridIndex / iVar2) * 40.0 + 120.0 + particleVelocity.y; in_stack_ffffff80 = Random(); if (uVar5 < slowParticleCount) { VStack_3c.x = particleVelocity.x * 0.2; VStack_3c.y = particleVelocity.y * 0.2; particle = Game::SpawnEx(g_game,1000,5,&particlePos,&VStack_3c,(Entity *)0x0,0, in_stack_ffffff80,0); (**(code **)(*(int *)particle + 0xc))(); local_60 = uVar5; } else { particle = Game::SpawnEx(g_game,1000,5,&particlePos,&particleVelocity,(Entity *)0x0, 99,in_stack_ffffff80,0); (**(code **)(*(int *)particle + 0xc))(); particle[1]._damageEvents._begin = (void *)0xc1000000; } local_60 = local_60 + 1; } while ((int)local_60 < particleCount); } goto LAB_007109b9; } } (this->_desc)._varData = 0; LAB_007109b9: (this->_desc)._state = ((this->_desc)._varData != 0) + 2; UpdateAnimation(this); iVar2 = (this->_desc)._varData; if (iVar2 < 1) { (this->_desc)._variant = 8; } else { (this->_desc)._varData = iVar2 + -1; } FUN_0070bfa0(0x48,2,in_stack_ffffff80,0x3f800000); return 1; } } else if (iVar2 == 5) { gameStateFlags = g_game->_gameStateFlags; gameStateFlagsHigh = (uint *)((int)&g_game->_gameStateFlags + 4); *gameStateFlagsHigh = *gameStateFlagsHigh | 0x20000; *(int *)&game->_gameStateFlags = (int)gameStateFlags; } iVar2 = (this->_desc)._variant; bVar7 = false; if ((iVar2 == 1) || (iVar2 == 2)) { in_stack_ffffff80 = 0x96; bVar1 = Entity_Player::HasTrinket(player,0x96,0); if (bVar1 != 0) { isForce = 1; bVar7 = true; } } if (g_game->_stage == 9) { in_stack_ffffff80 = 0x71051b; iVar2 = Entity_Player::GetTrinketMultiplier(player,0xaf); if (iVar2 < 2) goto LAB_00710a08; isForce = 1; } else { LAB_00710a08: if (isForce == 0) { iVar2 = (this->_desc)._state; if (iVar2 == 2) { return 0; } variant = (this->_desc)._variant; if ((variant != 1) && (variant != 2)) { return 0; } if ((this->_isExtraVisible != 0) && (iVar2 == 3)) { bVar1 = ANM2::IsPlaying(&this->_extraSprite,(byte *)"GoldenKeyOpenChain1"); if (bVar1 != 0) { return 0; } in_stack_ffffff80 = 0x710a68; bVar1 = ANM2::IsPlaying(&this->_extraSprite,(byte *)"KeyOpenChain1"); if (bVar1 != 0) { return 0; } } if ((this->_doorFlags & 1) == 0) { if (this->_targetRoomType == 2) { in_stack_ffffff80 = 0x53; bVar1 = Entity_Player::HasTrinket(player,0x53,0); if (bVar1 != 0) goto LAB_00710af5; } } else if (0 < player->_numCoins) goto LAB_00710af5; if (((this->_targetRoomType != 5) || (this->_targetRoomIdx < 0)) || (g_game->_stage != 9)) { if ((this->_doorFlags & 1) != 0) { return 0; } iVar2 = (this->_desc)._variant; if ((iVar2 == 1) || (iVar2 == 2)) { in_stack_ffffff80 = 0x710ade; iVar2 = Entity_Player::GetTrinketMultiplier(player,0x13); if (2 < iVar2) goto LAB_00710af5; } bVar1 = Entity_Player::TryUseKey(player); if (bVar1 == 0) { return 0; } } } } LAB_00710af5: if ((this->_doorFlags & 1) == 0) { if (isForce == 0) goto LAB_00710b1b; } else if (isForce == 0) { in_stack_ffffff80 = 0x710b0b; Entity_Player::AddCoins(player,-1); goto LAB_00710b1b; } this->_isUnlockedByPlayer = 1; LAB_00710b1b: if ((((this->_desc)._variant == 2) && ((this->_desc)._state != 3)) && (isForce == 0)) { (this->_desc)._state = 3; UpdateAnimation(this); return 1; } (this->_desc)._state = 2; UpdateAnimation(this); iVar2 = this->_targetRoomType; (this->_desc)._variant = 8; manager = g_manager; if (((iVar2 == 5) && (-1 < this->_targetRoomIdx)) && (g_game->_stage == 9)) { FUN_0070bfa0(0xe,2,in_stack_ffffff80,0x3e99999a); } else { local_60 = 0x2d; if ((this->_doorFlags & 1) == 0) { local_60 = 0x9c; } seed_fart_sound_override((int *)&local_60); SoundEffects::Play(&manager->_sfxManager,local_60,1.0,2,0,1.0,0.0); } if (bVar7) { pbVar6 = (this->_sprite)._animState._animData; if (pbVar6 != (byte *)0x0) { if ((this->_sprite)._animState._isPlaying != 0) { pbVar4 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar4 = *(byte **)pbVar6; } wantedAnimNameStr = "GoldenKeyOpen"; do { bVar1 = *pbVar4; bVar7 = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_00710c35: uVar5 = -(uint)bVar7 | 1; goto LAB_00710c3a; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar7 = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_00710c35; pbVar4 = pbVar4 + 2; wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00710c3a: if (uVar5 == 0) { ANM2::Play(&this->_sprite,(byte *)"KeyOpen",0); pbVar6 = (this->_sprite)._animState._animData; } } if ((pbVar6 != (byte *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { pbVar6 = (this->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } wantedAnimNameStr = "KeyOpen"; do { bVar1 = *pbVar6; bVar7 = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_00710ca0: uVar5 = -(uint)bVar7 | 1; goto LAB_00710ca5; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar7 = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_00710ca0; pbVar6 = pbVar6 + 2; wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00710ca5: if ((uVar5 == 0) && (layer = ANM2::GetLayer(&this->_sprite,&DAT_00b1ce2c), layer != (LayerState *)0x0)) { local_34._tint[0] = 1.0; local_34._tint[1] = 1.0; local_34._tint[2] = 1.0; local_34._tint[3] = 1.0; local_34._colorize[0] = 0.4; local_34._colorize[1] = 0.6; local_34._colorize[2] = 1.0; local_34._colorize[3] = 1.0; local_34._offset[0] = 0.0; local_34._offset[1] = 0.0; local_34._offset[2] = 0.0; Color::operator_assign((Color *)&layer->_color,&local_34); } } } targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if (targetRoomDesc->Data != (void *)0x0) { targetRoomDesc->Flags = targetRoomDesc->Flags | 0x40000; } } return 1; } //@@ 00710d30 GridEntity_Door::Close /* ZHL [lua] Lua binding GridEntityDoor:Close */ void __thiscall GridEntity_Door::Close(GridEntity_Door *this,char param_2) { int iVar1; int iVar2; if (((this->_desc)._state != 1) || (param_2 != '\0')) { (this->_desc)._state = 1; UpdateAnimation(this); iVar1 = this->_currentRoomType; if (((iVar1 == 7) || (((iVar2 = this->_targetRoomType, iVar2 == 7 || (iVar1 == 8)) || (iVar2 == 8)))) || ((iVar1 == 0x1d || (iVar2 == 0x1d)))) { std::string::assign((this->_openAnimation)._buf,s_Open,4); } } return; } //@@ 00710d90 GridEntity_Door::Bar /* ZHL [lua] Lua binding GridEntityDoor:Bar */ void __thiscall GridEntity_Door::Bar(GridEntity_Door *this) { byte bVar1; bVar1 = (this->_extraSprite)._loaded; (this->_desc)._state = 1; (this->_desc)._variant = 4; if ((bVar1 == 0) || ((this->_doorFlags & 0x20) != 0)) { LoadSprite(this); } UpdateAnimation(this); return; } //@@ 00710dd0 GridEntity_Door::Open /* ZHL [lua] Lua binding GridEntityDoor:Open prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall GridEntity_Door::Open(GridEntity_Door *this) { uint *puVar1; int iVar2; bool bVar3; qword qVar4; Game *pGVar5; char cVar6; byte bVar7; int iVar8; RoomDescriptor *pRVar9; if (((this->_doorFlags & 0x10U) != 0) && ((this->_desc)._variant != 8)) { return; } if (((this->_doorFlags & 0x20U) != 0) && ((this->_desc)._variant == 4)) { return; } if ((this->_desc)._state == 2) { return; } iVar8 = (this->_desc)._variant; if (iVar8 == 7) { return; } iVar2 = this->_currentRoomType; if (this->_targetRoomType == 0xb) { if ((iVar2 == 7) || (iVar2 == 8)) { bVar3 = true; } else { bVar3 = false; } cVar6 = Level::CanOpenChallengeRoom(this->_targetRoomIdx); if (((cVar6 == '\0') && (this->_isUnlockedByPlayer == 0)) && (!bVar3)) { return; } goto LAB_00710e57; } if (iVar2 == 0xb) { if (((g_game->_ambush)._isActive != 0) && (this->_isUnlockedByPlayer == 0)) { return; } } else { bVar7 = IsRoomType(this,0); if (bVar7 != 0) { return; } if (iVar8 != 4) { if (iVar8 == 6) { cVar6 = FUN_00710f70(g_game->_greedModeWave); if (cVar6 != '\0') { LAB_00710f2b: if ((this->_desc)._variant != 8) { return; } } } else if ((iVar8 != 1) || (pRVar9 = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1), pRVar9->VisitedCount == 0)) goto LAB_00710f2b; } } cVar6 = FUN_00711740(); if (cVar6 == '\0') { (this->_desc)._state = 5; return; } LAB_00710e57: pGVar5 = g_game; iVar8 = (this->_desc)._variant; if (iVar8 == 5) { qVar4 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x20000; *(int *)&pGVar5->_gameStateFlags = (int)qVar4; iVar8 = (this->_desc)._variant; } if (((iVar8 == 6) && (this->_targetRoomType == 4)) && (this->_targetRoomIdx == g_game->_greedModeTreasureRoomIdx)) { (this->_desc)._variant = 1; UpdateAnimation(this); return; } (this->_desc)._state = 2; (this->_desc)._variant = 8; UpdateAnimation(this); return; } //@@ 00710f70 FUN_00710f70 uint FUN_00710f70(int param_1) { Game *in_EAX; int in_EDX; if ((in_EDX == 0x17) && (in_EAX = g_game, param_1 < (int)((g_game->_difficulty == 3) + 10))) { return CONCAT31((int3)((uint)g_game >> 8),1); } return (uint)in_EAX & 0xffffff00; } //@@ 00710fa0 GridEntity_Door::SetRoomTypes /* ZHL [exact] __thiscall void GridEntity_Door::SetRoomTypes(int CurrentRoomType, int TargetRoomType); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall GridEntity_Door::SetRoomTypes(GridEntity_Door *this,int CurrentRoomType,int TargetRoomType) { byte bVar1; RoomDescriptor *currentRoomDesc; RoomDescriptor *targetRoomDesc; RoomDescriptor *roomDesc; void *roomData; undefined4 roomSubtype; Entity_Player *taintedKeeper; int iVar2; int iVar3; Game *game; bool isGreedMode; bool isMirrorWorld; int targetType; game = g_game; if ((g_game->_difficulty == 2) || (isGreedMode = false, g_game->_difficulty == 3)) { isGreedMode = true; } this->_currentRoomType = CurrentRoomType; this->_targetRoomType = TargetRoomType; bVar1 = Level::HasMirrorDimension((Level *)game); if ((bVar1 == 0) || (isMirrorWorld = true, g_game->_currentDimensionIdx != 1)) { isMirrorWorld = false; } currentRoomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,g_game->_currentDimensionIdx); targetRoomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if ((((uint)currentRoomDesc->Flags >> 10 & 1) != 0) || (((uint)targetRoomDesc->Flags >> 10 & 1) != 0)) { if ((this->_currentRoomType == 7) || (this->_currentRoomType == 8)) { this->_currentRoomType = 1; } if ((this->_targetRoomType == 7) || (this->_targetRoomType == 8)) { this->_targetRoomType = 1; } } iVar2 = (this->_desc)._variant; if (iVar2 != 0) goto LAB_00711235; iVar2 = g_game->_difficulty; if ((iVar2 == 2) || (iVar2 == 3)) { iVar3 = this->_targetRoomType; if ((iVar3 == 0x17) && (g_game->_greedModeWave < (int)((iVar2 == 3) + 10))) { (this->_desc)._variant = 6; goto LAB_00711262; } } else { iVar3 = this->_targetRoomType; } iVar2 = this->_currentRoomType; if ((((iVar2 != 7) && (iVar2 != 8)) && (iVar2 != 0x1d)) && (iVar2 != 10)) { if (iVar3 == 0x1b) { roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); roomData = roomDesc->Data; if (roomData != (void *)0x0) { LAB_0071111e: if (*(int *)((int)roomData + 0x10) != 0) { LAB_007111ae: game = g_game; if (this->_targetRoomType == 0x1b) { roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); LAB_007111e8: game = g_game; if (roomDesc->Data == (void *)0x0) { roomSubtype = 0; } else { roomSubtype = *(undefined4 *)((int)roomDesc->Data + 0x10); } switch(roomSubtype) { case 2: case 4: (this->_desc)._variant = 3; iVar2 = 3; break; case 3: (this->_desc)._varData = 1; default: switchD_007111fc_caseD_1: iVar2 = 1; (this->_desc)._variant = 1; } } else { if (this->_currentRoomType == 0x1b) { roomDesc = *(RoomDescriptor **)((int)g_game->_room + 4); goto LAB_007111e8; } if (this->_targetRoomType != 5) { if (((this->_currentRoomType == 5) && (iVar2 = *(int *)(*(int *)((int)g_game->_room + 4) + 0x10), iVar2 != 0)) && (*(int *)(iVar2 + 0x10) == 0x5a)) { (this->_desc)._variant = 3; iVar2 = 3; goto LAB_00711220; } goto switchD_007111fc_caseD_1; } roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); game = g_game; if ((roomDesc->Data == (void *)0x0) || (*(int *)((int)roomDesc->Data + 0x10) != 0x5a)) goto switchD_007111fc_caseD_1; iVar2 = 3; (this->_desc)._variant = 3; } LAB_00711220: if (game->_currentRoomIdx == -10) { (this->_desc)._variant = 8; iVar2 = 8; } goto LAB_00711235; } } } else if (iVar2 == 0x1b) { roomData = *(void **)(*(int *)((int)g_game->_room + 4) + 0x10); if (roomData != (void *)0x0) goto LAB_0071111e; } else if (iVar3 == 5) { roomDesc = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,-1); if (roomDesc->Data != (void *)0x0) { iVar2 = *(int *)((int)roomDesc->Data + 0x10); goto joined_r0x007111a8; } } else if ((iVar2 == 5) && (iVar2 = *(int *)(*(int *)((int)g_game->_room + 4) + 0x10), iVar2 != 0) ) { iVar2 = *(int *)(iVar2 + 0x10); joined_r0x007111a8: if (iVar2 == 0x5a) goto LAB_007111ae; } } game = g_game; if (g_game->_currentRoomIdx != -0x10) { iVar2 = this->_targetRoomIdx; if (iVar2 != -0x65) { if (iVar2 != -100) goto LAB_0071132c; goto LAB_007113a8; } if (g_game->_currentDimensionIdx == 0) { (this->_desc)._variant = 3; LAB_00711244: if ((((uint)currentRoomDesc->Flags >> 10 & 1) == 0) || (((uint)targetRoomDesc->Flags >> 10 & 1) != 0)) goto LAB_00711262; goto LAB_0071125b; } LAB_0071132c: iVar3 = this->_currentRoomType; if (((iVar3 == 7) || (iVar3 == 8)) || ((iVar3 == 0x1d || (iVar3 == 10)))) goto LAB_007113fb; targetType = this->_targetRoomType; if (targetType == 9) goto LAB_007113a8; if (g_game->_challenge == 0x18) { if (((targetType != 7) && (targetType != 8)) && (targetType != 0xb)) { if (targetType != 0x1d) goto LAB_007113a8; goto LAB_0071137e; } LAB_007113be: if (targetType == 2) { if (!isMirrorWorld) { if ((((g_game->_stage != 1) || (bVar1 = Level::IsAltPath((Level *)g_game), bVar1 != 0)) && (bVar1 = Game::IsGreedMode(game), bVar1 == 0)) && (taintedKeeper = PlayerManager::FirstPlayerByType(&game->_playerManager,0x21), taintedKeeper == (Entity_Player *)0x0)) goto LAB_007113a8; iVar2 = this->_targetRoomIdx; } } else if (((targetType == 5) && (-1 < iVar2)) && (g_game->_stage == 9)) { LAB_007113a8: (this->_desc)._variant = 1; goto LAB_00711244; } LAB_007113fb: if (isGreedMode) goto LAB_00711401; LAB_0071143f: if ((iVar3 == 7) || (iVar3 == 8)) goto LAB_0071146d; LAB_00711449: if (iVar3 == 0x1d) goto LAB_0071146d; targetType = this->_targetRoomType; if ((targetType == 0x12) || (targetType == 0x13)) { iVar2 = 3; (this->_desc)._variant = 3; LAB_00711235: if (((iVar2 != 1) && (iVar2 != 3)) && (iVar2 != 2)) goto LAB_00711262; goto LAB_00711244; } if ((targetType == 0x15) || (targetType == 0x14)) { iVar2 = 2; (this->_desc)._variant = 2; goto LAB_00711235; } if (iVar3 != 6) goto LAB_0071146d; LAB_0071147c: if ((((*(byte *)(*(int *)((int)game->_room + 4) + 0x44) & 1) == 0) && (targetType = this->_targetRoomType, targetType != 7)) && ((targetType != 8 && (targetType != 0x1d)))) { (this->_desc)._variant = 4; goto LAB_00711262; } } else { LAB_0071137e: if (targetType != 4) { if ((targetType == 0x18) || (targetType == 0xc)) goto LAB_007113a8; goto LAB_007113be; } if (isMirrorWorld) goto LAB_007113fb; if (g_game->_stage == 1) { bVar1 = Level::IsAltPath((Level *)g_game); iVar2 = this->_targetRoomIdx; if (bVar1 == 0) goto LAB_007113fb; } if (!isGreedMode) goto LAB_007113a8; LAB_00711401: if (this->_targetRoomType != 4) goto LAB_0071143f; if ((iVar3 != 7) && (iVar3 != 8)) { if (iVar2 == game->_greedModeTreasureRoomIdx) { (this->_desc)._variant = 1; goto LAB_00711244; } goto LAB_00711449; } LAB_0071146d: if (*(char *)((int)game->_room + 0x7228) != '\0') goto LAB_0071147c; } if (iVar2 == -7) { (this->_desc)._variant = 5; goto LAB_00711262; } if (((((iVar3 == 7) || (iVar2 = this->_targetRoomType, iVar2 == 7)) || (iVar3 == 8)) || ((iVar2 == 8 || (iVar3 == 0x1d)))) || (iVar2 == 0x1d)) { (this->_desc)._variant = 7; goto LAB_00711262; } } LAB_0071125b: (this->_desc)._variant = 8; LAB_00711262: LoadSprite(this); UpdateAnimation(this); if (this->_targetRoomType == 0x1d) { TryBlowOpen(this,0,(Entity *)0x0); } if (((this->_doorFlags & 0x20) != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } return; } //@@ 00711530 FUN_00711530 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00711530(int param_1) { uint uVar1; int in_ECX; uint local_18 [5]; local_18[4] = __security_cookie ^ (uint)(local_18 + 5); local_18[0] = 0xc2b40000; local_18[1] = 0; local_18[2] = 0x42b40000; local_18[3] = 0x43340000; *(int *)(in_ECX + 0x164) = param_1; uVar1 = local_18[param_1]; *(uint *)(in_ECX + 0xe4) = uVar1; *(uint *)(in_ECX + 800) = uVar1; *(uint *)(in_ECX + 0x20c) = uVar1; return; } //@@ 00711590 GridEntity_Door::BeginBatches /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Door::BeginBatches(GridEntity_Door *this) { int iVar1; iVar1 = (this->_desc)._state; if ((iVar1 == 0) || (iVar1 == 2)) { (this->_desc)._state = 1; iVar1 = 1; } this->_previousState = iVar1; this->_previousVariant = (this->_desc)._variant; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 1000; } this->_updateCount = 0; this->_targetRoomType = 0; this->_currentRoomType = 0; this->_targetRoomIdx = -1; this->_isExtraVisible = 0; this->_isBusted = 0; this->_isUnlockedByPlayer = 0; this->_doorFlags = 0; this->_direction = -1; return; } //@@ 00711630 GridEntity_Door::SetLocked /* ZHL [lua] Lua binding GridEntityDoor:SetLocked */ void GridEntity_Door::SetLocked(char param_1) { uint *puVar1; qword qVar2; Game *pGVar3; int iVar4; GridEntity_Door *in_ECX; pGVar3 = g_game; iVar4 = (in_ECX->_desc)._variant; if (iVar4 == 4) { if (param_1 == '\0') { return; } } else if ((param_1 == '\0') && (iVar4 == 5)) { qVar2 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x20000; *(int *)&pGVar3->_gameStateFlags = (int)qVar2; } iVar4 = 8; if (param_1 != '\0') { iVar4 = 1; } (in_ECX->_desc)._variant = iVar4; UpdateAnimation(in_ECX); return; } //@@ 00711690 GridEntity_Door::IsTargetRoomArcade /* ZHL [lua] Lua binding GridEntityDoor:IsTargetRoomArcade */ undefined4 __thiscall GridEntity_Door::IsTargetRoomArcade(GridEntity_Door *this) { int iVar1; Entity_Player *pEVar2; iVar1 = this->_targetRoomType; if (iVar1 == 9) { return 1; } if ((((((iVar1 == 2) || (iVar1 == 4)) || (iVar1 == 0x18)) || ((iVar1 == 0x14 || (iVar1 == 0x15)))) || ((iVar1 = get_secret_exit_kind(this), iVar1 == 1 || (this->_targetRoomType == 0xc)))) && (pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x17c,(RNG **)&g_game->_playerManager,1), pEVar2 != (Entity_Player *)0x0)) { return 1; } if (((g_game->_challenge == 0x18) && (iVar1 = this->_targetRoomType, iVar1 != 7)) && ((iVar1 != 8 && ((iVar1 != 0xb && (iVar1 != 0x1d)))))) { return 1; } return 0; } //@@ 00711720 GridEntity_Door::GetWaterClipInfo /* ZHL [vtable slot 6] */ void __thiscall GridEntity_Door::GetWaterClipInfo(undefined4 param_1,undefined4 *param_2) { *param_2 = 0; param_2[1] = 0; return; } //@@ 00711740 FUN_00711740 undefined4 FUN_00711740(void) { int iVar1; NetplayManager NVar2; int in_ECX; NVar2 = (NetplayManager)g_game; if (*(int *)(in_ECX + 0x394) == g_game->_lastRoomIdx) { NVar2 = *(NetplayManager *)(g_manager + 1); if (g_manager->_netplayManager != NVar2) { iVar1 = (int)NVar2 - (int)g_manager->_netplayManager; NVar2 = (NetplayManager)(iVar1 >> 2); if (1 < (uint)NVar2) { return CONCAT31((int3)(iVar1 >> 10),0x1e < *(uint *)(in_ECX + 0x154)); } } } return CONCAT31(NVar2._1_3_,1); } //@@ 00711780 GridEntity_Lock::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Lock::BeginBatches(GridEntity_Lock *this) { int iVar1; byte bVar2; Entity_Player *pEVar3; char *pcVar4; uint size; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc99d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x18; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/grid/grid_locks.anm2",0x19); local_8 = 0; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { size = local_2c._capacity + 1; pcVar4 = (char *)local_2c._buf._0_4_; if (0xfff < size) { pcVar4 = *(char **)(local_2c._buf._0_4_ + -4); size = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)pcVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,size); } local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x17c,(RNG **)&g_game->_playerManager,1); iVar1 = (this->_desc)._state; *(bool *)(this + 1) = pEVar3 != (Entity_Player *)0x0; if (iVar1 == 0) { pcVar4 = "IdleCoin"; if (pEVar3 == (Entity_Player *)0x0) { pcVar4 = (char *)s_Idle; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)pcVar4,1); if ((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } this->_collisionClass = 4; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 4000; } } else { bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"Broken",1); if ((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } this->_collisionClass = 0; } ExceptionList = local_10; return; } //@@ 00711950 GridEntity_Lock::Update /* ZHL [exact] void Update(); */ void __thiscall GridEntity_Lock::Update(GridEntity_Lock *this) { int iVar1; int iVar2; byte bVar3; int *piVar4; void *pvVar5; Game *pGVar6; PlayerManager *pPVar7; uint uVar8; float fVar9; float fVar10; if (((this->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Break"), bVar3 != 0)) { this->_collisionClass = 0; pGVar6 = g_game; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 0; goto LAB_007119ac; } } pGVar6 = g_game; LAB_007119ac: if ((this->_desc)._state == 0) { pPVar7 = &pGVar6->_playerManager; uVar8 = 0; if ((int)(pGVar6->_playerManager)._playerList._end - (int)(pPVar7->_playerList)._begin >> 2 != 0 ) { do { pvVar5 = (pPVar7->_playerList)._end; if ((int)pvVar5 - (int)(pPVar7->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (pPVar7->_playerList)._end; pGVar6 = g_game; } piVar4 = (pPVar7->_playerList)._begin; if (uVar8 < (uint)((int)pvVar5 - (int)piVar4 >> 2)) { piVar4 = piVar4 + uVar8; } iVar1 = *piVar4; if ((*(int *)(iVar1 + 0x2c) == 0) && (iVar2 = *(int *)((int)pGVar6->_room + 0xc), fVar9 = *(float *)(iVar1 + 0x33c) - ((float)(this->_gridIndex % iVar2) * 40.0 + 40.0), fVar10 = *(float *)(iVar1 + 0x340) - ((float)(this->_gridIndex / iVar2) * 40.0 + 120.0), fVar10 * fVar10 + fVar9 * fVar9 < 961.0)) { try_unlock(iVar1,0); pGVar6 = g_game; } pPVar7 = &pGVar6->_playerManager; uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(pGVar6->_playerManager)._playerList._end - (int)(pPVar7->_playerList)._begin >> 2)); } } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } //@@ 00711af0 GridEntity_Lock::try_unlock /* DB: ? thiscall (player, force): if not unlocked (+0xc state 0) requires a key (Entity_Player::TryUseKey, skipped with Paper Clip trinket 19 multiplier>=2) or one coin when the coin-lock flag +0x154 is set (AddCoins -1), then plays unlock sound 0x9c / coin 0x2d and opens; GridEntity_Lock::Update, Entity_Tear::Update (key tears) */ void GridEntity_Lock::try_unlock(Entity_Player *param_1,char param_2) { Manager *pMVar1; byte bVar2; int iVar3; int in_ECX; int local_c [2]; if (*(int *)(in_ECX + 0xc) == 0) { if (param_2 == '\0') { if (*(char *)(in_ECX + 0x154) == '\0') { iVar3 = Entity_Player::GetTrinketMultiplier(param_1,0x13); if ((iVar3 < 2) && (bVar2 = Entity_Player::TryUseKey(param_1), bVar2 == 0)) { return; } } else { if (param_1->_numCoins < 1) { return; } Entity_Player::AddCoins(param_1,-1); } } pMVar1 = g_manager; local_c[0] = 0x9c; if (*(char *)(in_ECX + 0x154) != '\0') { local_c[0] = 0x2d; } seed_fart_sound_override(local_c); SoundEffects::Play(&pMVar1->_sfxManager,local_c[0],1.0,2,0,1.0,0.0); break_open(param_1); } return; } //@@ 00711bb0 GridEntity_Lock::break_open /* DB: ? ECX=GridEntity_Lock: sfx 0xe5, anim "Breaking"/"BreakingGolden" (player _hasGoldenKey)/"BreakingCoin", RNG::Next, Game::Spawn, Entity_Player::HasTrinket; from GridEntity_Lock::try_unlock and 00711fd0 */ void GridEntity_Lock::break_open(Entity_Player *param_1) { byte bVar1; int iVar2; int in_ECX; uint uVar3; int gridX; void *trinketRngEnd; uint *trinketRng; undefined4 *playerIt; uint variant; char *anim; RNG dropRng; int lock; Vector local_10; code *debugBreak; Game *game; Manager *manager; void *trinketRngBegin; manager = g_manager; local_10.y = 3.20897e-43; lock = in_ECX; seed_fart_sound_override((int *)&local_10.y); SoundEffects::Play(&manager->_sfxManager,(int)local_10.y,1.0,2,0,1.0,0.0); if (*(char *)(in_ECX + 0x154) == '\0') { if ((param_1 == (Entity_Player *)0x0) || (anim = "BreakingGolden", param_1->_hasGoldenKey == 0)) { anim = "Breaking"; } } else { anim = "BreakingCoin"; } bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x40),(byte *)anim,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x70)); *(undefined1 *)(in_ECX + 0x84) = 1; } uVar3 = *(uint *)(in_ECX + 0x14); *(undefined4 *)(in_ECX + 0xc) = 1; game = g_game; dropRng._shift1 = 1; dropRng._shift2 = 5; dropRng._shift3 = 0x10; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } uVar3 = uVar3 >> 1 ^ uVar3; uVar3 = uVar3 << 5 ^ uVar3; local_10.y = (float)(uVar3 >> 0x10 ^ uVar3); if (0.1 <= (float)((double)(int)local_10.y + __uint_to_double_fixup[-((int)local_10.y >> 0x1f)]) * 2.3283062e-10) { return; } if (param_1 == (Entity_Player *)0x0) { playerIt = (g_game->_playerManager)._playerList._begin; if (playerIt != (g_game->_playerManager)._playerList._end) { do { param_1 = (Entity_Player *)*playerIt; if ((param_1->_variant == 0) && (bVar1 = Entity_Player::HasTrinket(param_1,0x16,0), bVar1 != 0)) goto LAB_00711d1a; playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); } param_1 = (Entity_Player *)0x0; } LAB_00711d1a: if (local_10.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } uVar3 = (uint)local_10.y >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)local_10.y; uVar3 = uVar3 << ((byte)dropRng._shift2 & 0x1f) ^ uVar3; dropRng._seed = uVar3 >> 0x10 ^ uVar3; local_10.y = (float)dropRng._seed; if (0.25 <= (float)((double)dropRng._seed + __uint_to_double_fixup[-(dropRng._seed >> 0x1f)]) * 2.3283062e-10) { LAB_00711e7c: if (local_10.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } uVar3 = (uint)local_10.y >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)local_10.y; uVar3 = uVar3 << ((byte)dropRng._shift2 & 0x1f) ^ uVar3; iVar2 = *(int *)((int)g_game->_room + 0xc); gridX = *(int *)(lock + 0x24) % iVar2; iVar2 = *(int *)(lock + 0x24) / iVar2; uVar3 = uVar3 >> 0x10 ^ uVar3; variant = 0x14; } else { if (param_1 != (Entity_Player *)0x0) { trinketRngEnd = (param_1->_trinketRNGs)._end; if ((int)((int)trinketRngEnd - (int)(param_1->_trinketRNGs)._begin & 0xfffffff0U) < 0x161) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); trinketRngEnd = (param_1->_trinketRNGs)._end; } trinketRngBegin = (param_1->_trinketRNGs)._begin; uVar3 = ((int)trinketRngEnd - (int)trinketRngBegin >> 4) - 1; if (0x16 < uVar3) { uVar3 = 0x16; } trinketRng = (uint *)(uVar3 * 0x10 + (int)trinketRngBegin); uVar3 = *trinketRng; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *trinketRng; if (uVar3 == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } uVar3 = uVar3 >> ((byte)trinketRng[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)trinketRng[2] & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)trinketRng[3] & 0x1f) ^ uVar3; *trinketRng = uVar3; if (uVar3 != (uVar3 / 5) * 5) goto LAB_00711e7c; } uVar3 = RNG::Next(&dropRng); iVar2 = *(int *)((int)g_game->_room + 0xc); gridX = *(int *)(lock + 0x24) % iVar2; iVar2 = *(int *)(lock + 0x24) / iVar2; variant = 10; } local_10.x = (float)gridX * 40.0 + 40.0; local_10.y = (float)iVar2 * 40.0 + 120.0; Game::Spawn(g_game,5,variant,&local_10,&g_vectorZero,(Entity *)0x0,0,uVar3); return; } //@@ 00711f30 GridEntity_Teleporter::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity_Teleporter::Render(GridEntity_Teleporter *this,float *param_2) { Vector *pVVar1; AnimationState *this_00; Vector local_18; Vector local_10; pVVar1 = GridEntity::get_render_position((GridEntity *)this,&local_10); local_18.x = pVVar1->x + *param_2; local_18.y = pVVar1->y + param_2[1]; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_18,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_18,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._animState; } AnimationState::Render(this_00,&local_18,&g_vectorZero,&g_vectorZero); } return; } //@@ 00711fd0 FUN_00711fd0 undefined4 FUN_00711fd0(void) { byte bVar1; undefined4 uVar2; int *in_ECX; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; if (in_ECX[3] == 0) { bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x88); if (bVar1 != 0) { GridEntity_Lock::break_open(0); if (in_ECX[0x1d] != 0) { AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x1c),20.0); } return 1; } } local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; uVar2 = (**(code **)(*in_ECX + 0x10))(4,&local_30); return uVar2; } //@@ 00712090 GridEntity_Lock::GetWaterClipInfo /* ZHL [exact] WaterClipInfo* GetWaterClipInfo(WaterClipInfo* out); */ void __thiscall GridEntity_Lock::GetWaterClipInfo(GridEntity_Lock *this,undefined4 *param_2) { undefined4 uVar1; uVar1 = 0x26; if (this->_collisionClass != 0) { uVar1 = 0x39; } *param_2 = uVar1; param_2[1] = 0; return; } //@@ 007120c0 Room::GetLavaIntensity /* ZHL [lua] Lua binding Room:GetLavaIntensity */ float10 __thiscall Room::GetLavaIntensity(Room *this) { return (float10)this->_lavaIntensity; } //@@ 007120d0 GridEntity_Pit::Free /* ZHL [vtable slot 0] */ GridEntity_Pit * __thiscall GridEntity_Pit::Free(GridEntity_Pit *this,byte param_2) { void *pvVar1; Game *pGVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar2 = g_game; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = IsaacRepentancePlus::GridEntity_Pit::vftable; if ((pGVar2 != (Game *)0x0) && (pvVar1 = pGVar2->_room, pvVar1 != (void *)0x0)) { *(undefined1 *)((int)pvVar1 + 0x11f6) = 1; } *(undefined ***)this = IsaacRepentancePlus::GridEntity::vftable; local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); if ((param_2 & 1) != 0) { operator_delete(this,0x158); } ExceptionList = local_10; return this; } //@@ 00712180 GridEntity_Pit::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 2] */ Entity * __thiscall GridEntity_Pit::Update(GridEntity_Pit *this) { code *pcVar1; longlong lVar2; longlong lVar3; longlong lVar4; byte bVar5; char cVar6; RoomDescriptor *roomDesc; Game *pGVar7; LayerState *layer; uint uVar8; uint uVar9; int iVar10; int *piVar11; ColorMod *other; Entity *pEVar12; int unusedArg; int unusedArg_00; void *pvVar13; int unusedArg_01; uint uVar14; PlayerManager *playerManager; bool bVar15; float fVar16; float fVar17; ulonglong uVar18; undefined1 auStack_e4 [4]; int spawnSubType; Game *local_dc; int local_d8 [2]; int *local_d0; Vector spawnPos; uint spawnType; Entity *local_c0; float local_bc; int iStack_b8; uint local_b4; Entity *local_b0 [2]; Game *local_a8; int iStack_a4; uint local_a0; float local_98 [5]; Vector spawnVelocity; int iStack_7c; undefined8 local_78; int local_70; int iStack_6c; Vector local_68; int soundId; GridEntity_Pit *pit; undefined1 local_54 [8]; int local_4c; RNG cardRng [3]; uint local_c; GridEntity_Pit *curPit; Manager *manager; EntityPtr *spawnerSlot; local_c = __security_cookie ^ (uint)auStack_e4; pit = this; if (((this->_desc)._state == 3) && ((roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx), ((uint)roomDesc->Flags >> 1 & 1) != 0 || (bVar5 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar5 != 0)))) { (this->_desc)._state = 2; } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } if (1 < (uint)(this->_sprite)._layerCount) { pGVar7 = (Game *)((this->_desc)._state + -2); local_dc = (Game *)0x0; if (0 < (int)pGVar7) { local_dc = pGVar7; } if (((this->_sprite)._animState._animData != (void *)0x0) && ((1 < *(int *)((int)(this->_sprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 1 < *(int *)((int)(this->_sprite)._animState._animation + 0x80))))) { pvVar13 = (this->_sprite)._animState._animData; iVar10 = *(int *)((int)pvVar13 + 0x3c); if ((pvVar13 == (void *)0x0) || ((iVar10 < 0 || (*(int *)((int)pvVar13 + 0x1c) <= iVar10)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_sprite)._animState._layerFrames + iVar10 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,iVar10,(float)(int)local_dc); } iVar10 = (this->_desc)._state; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_visible = 1 < iVar10; } if ((this->_desc)._state == 3) { GridEntity::hurt_surroundings((GridEntity *)this,11.0,11.0,8.0,2,0x10000080,0); } iVar10 = (this->_desc)._varData; if (iVar10 != 0) { if (iVar10 == 10) { (this->_desc)._varData = 1; uVar8 = Random(); iVar10 = *(int *)((int)g_game->_room + 0xc); local_68.x = (float)(this->_gridIndex % iVar10) * 40.0 + 40.0; local_68.y = (float)(this->_gridIndex / iVar10) * 40.0 + 120.0; Game::SpawnEx(g_game,1000,0xf,&local_68,&g_vectorZero,(Entity *)0x0,0,uVar8,0); manager = g_manager; soundId = 0x89; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); this = pit; iVar10 = (pit->_desc)._state; if ((iVar10 == 1) || (iVar10 == 0)) { (pit->_desc)._state = 2; UpdateCollision(pit); } } else if (10 < iVar10) { (this->_desc)._varData = iVar10 + -1; } if ((1 < (this->_desc)._state) && ((this->_desc)._varData != 2)) { iVar10 = this->_gridIndex; (this->_desc)._varData = 2; grid_mark_neighbors_dirty(iVar10); } } pvVar13 = g_game->_room; iVar10 = *(int *)((int)pvVar13 + 0x1d18); if (iVar10 != 0x20) { if ((((iVar10 != 0x3a) && (iVar10 != 0x3b)) || ((g_game->_levelStateFlags & 0x400000U) == 0)) || (((this->_desc)._state != 0 || (uVar8 = Random(), uVar8 % 0x28 != 0)))) goto LAB_00713310; spawnVelocity.x = 0.0; uVar8 = Random(); iVar10 = *(int *)((int)g_game->_room + 0xc); fVar16 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_98[2] = -1.0 - (fVar16 + fVar16); spawnPos.x = (float)(this->_gridIndex % iVar10) * 40.0 + 40.0; spawnPos.y = (float)(this->_gridIndex / iVar10) * 40.0 + 120.0; spawnVelocity.y = local_98[2]; local_98[0] = (float)Random(); local_a8 = g_game; spawnSubType = 2; local_d0 = (int *)&DAT_0000003b; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&local_d0,&spawnPos,&spawnVelocity,(Entity *)0x0, &spawnSubType,(uint *)local_98); piVar11 = local_d0; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00712ebb: local_d8[0] = spawnSubType; } else { pGVar7 = (g_game->_deathmatchManager)._type; local_dc = pGVar7; uVar8 = Random(); iVar10 = spawnSubType; local_78 = 0x900000005; local_c0 = (Entity *)&DAT_00000007; local_70 = 7; if (spawnType != 5) goto LAB_00712ebb; if (piVar11 < (int *)0x12d) { if (piVar11 == (int *)0x12c) { while ((local_d8[0] = spawnSubType, spawnSubType == 0 || (cVar6 = (**(code **)(pGVar7->_stage + 0x24))(spawnSubType), cVar6 != '\0'))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pEVar12 = (Entity *)(*pcVar1)(); return pEVar12; } uVar8 = uVar8 >> ((byte)local_78 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)local_78 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_c0 & 0x1f) ^ uVar8; iVar10 = ItemPool::GetCardEx(uVar8,0x19,10,10,1); cardRng[0]._shift1 = 5; cardRng[0]._shift2 = 9; cardRng[0]._shift3 = 7; cardRng[0]._seed = uVar8; spawnSubType = lua_callback_run_get_card(cardRng,iVar10,1,1,0); } } else { if (piVar11 == (int *)0x46) { local_bc = (float)((uint)spawnSubType >> 0xb); do { local_d8[0] = spawnSubType; if (spawnSubType != 0) { pcVar1 = *(code **)(pGVar7->_stage + 0x28); iVar10 = ItemPool::GetPillEffect (&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0); cVar6 = (*pcVar1)(iVar10); if (cVar6 == '\0') goto LAB_00712ec3; pGVar7 = local_dc; } if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pEVar12 = (Entity *)(*pcVar1)(); return pEVar12; } uVar8 = uVar8 >> ((byte)local_78 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)local_78 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_c0 & 0x1f) ^ uVar8; uVar9 = ItemPool::GetPill(uVar8); spawnSubType = uVar9 | ((uint)local_bc & 1) << 0xb; } while( true ); } if (piVar11 != (int *)0x64) goto LAB_00712ebb; local_d8[0] = spawnSubType; if (spawnSubType == 0x19) { LAB_00712d17: bVar15 = false; } else { local_bc = (float)spawnSubType; std::set::find_node(local_54,&local_bc); if (((*(char *)(local_4c + 0xd) == '\0') && (*(int *)(local_4c + 0x10) <= iVar10)) && (local_4c != pGVar7->_roomList[0].Dimension)) goto LAB_00712d17; bVar15 = true; } if ((iVar10 == 0) || (bVar15)) { spawnSubType = (**(code **)(pGVar7->_stage + 0x84))(0); local_d8[0] = spawnSubType; } } } else { if (piVar11 != (int *)0x15e) goto LAB_00712ebb; while ((local_d8[0] = spawnSubType, spawnSubType == 0 || (cVar6 = (**(code **)(pGVar7->_stage + 0x2c))(spawnSubType), cVar6 != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_00712ec3: local_c0 = EntityFactory::Create(local_a8->_entityFactory,spawnType,0); if (local_c0 != (Entity *)0x0) { uVar18 = GetTimeNs(); pEVar12 = local_c0; uVar8 = (uint)(uVar18 >> 0x20); lVar2 = (uVar18 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar8 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); local_b0[0] = (Entity *)(lVar3 + lVar2); lVar2 = (ulonglong)uVar8 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar2) >> 0x20)); local_a0 = (uint)((ulonglong)lVar2 >> 0x20); spawnerSlot = &local_c0->_spawnerEntity; local_b4 = (uint)lVar2 >> 0x12 | local_a0 * 0x4000; local_a0 = local_a0 >> 0x12; local_c0->_spawnerType = 0; local_c0->_spawnerVariant = 0; if (*spawnerSlot != (EntityPtr)0x0) { local_b0[0] = (Entity *)spawnerSlot; std::multiset::erase(local_b0); } iVar10 = *(int *)pEVar12; *spawnerSlot = (EntityPtr)0x0; (pEVar12->_pos).x = spawnPos.x; (pEVar12->_pos).y = spawnPos.y; (pEVar12->_velocity).x = 0.0; (pEVar12->_velocity).y = local_98[2]; (**(code **)(iVar10 + 4))(spawnType,local_d0,local_d8[0],local_98[0]); pGVar7 = local_a8; pvVar13 = local_a8->_room; iVar10 = *(int *)((int)pvVar13 + 0x1214); *(int *)((int)pvVar13 + 0x1214) = iVar10 + 1; pEVar12->_index = iVar10; EntityList::AddEntity((EntityList *)((int)pvVar13 + 0x1218),pEVar12); bVar5 = Game::ShouldEraseEnemy(pEVar12); if (bVar5 != 0) { Entity::RemoveWithPoof(pEVar12,unusedArg_00); } if ((pEVar12->_exists != 0) && ((pGVar7->_proceduralItemManager)._proceduralItems._begin != (pGVar7->_proceduralItemManager)._proceduralItems._end)) { iStack_a4 = pEVar12->_variant; local_a8 = (Game *)pEVar12->_type; std::map::find(&local_dc,&local_a8); pGVar7 = (pGVar7->_proceduralItemManager)._spawnTriggerTargets._head; if (local_dc == pGVar7) { local_d8[0] = pEVar12->_type; local_d8[1] = 0xffffffff; piVar11 = (int *)std::map::find(local_98 + 2,local_d8); local_dc = (Game *)*piVar11; if (local_dc == pGVar7) goto LAB_00713111; } uVar8 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar13 = (playerManager->_playerList)._end; if ((int)pvVar13 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar13 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (uVar8 < (uint)((int)pvVar13 - (int)piVar11 >> 2)) { piVar11 = piVar11 + uVar8; } trigger_set_dispatch((void *)(*piVar11 + 0x1fc8),6,pEVar12,&spawnPos,&spawnVelocity); uVar8 = uVar8 + 1; playerManager = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00713111: uVar18 = GetTimeNs(); uVar8 = (uint)(uVar18 >> 0x20); lVar2 = (uVar18 & 0xffffffff) * 0x431bde82; local_b0[0] = (Entity *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0x431bde82; local_bc = (float)lVar3; lVar4 = (ulonglong)uVar8 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); local_68.x = (float)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)(&(local_b0[0]->_sprite)._filename + -3) + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar14 = (uint)((ulonglong)lVar3 >> 0x20); uVar8 = (uint)lVar3 >> 0x12 | uVar14 * 0x4000; uVar9 = uVar8 - local_b4; bVar15 = CARRY4((uint)g_entitySpawnTimeMs,uVar9); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar9; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar14 >> 0x12) - local_a0) - (uint)(uVar8 < local_b4)) + (uint)bVar15; } pEVar12 = local_c0; uVar8 = Random(); other = (ColorMod *) Color::Color((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.1); layer = ANM2::GetLayer(&pEVar12->_sprite,(byte *)0x0); Color::operator_assign((Color *)&layer->_color,other); BlendMode::SetMode(&iStack_7c,2,unusedArg_01); layer = ANM2::GetLayer(&pEVar12->_sprite,(byte *)0x0); layer->_blendMode[0] = iStack_7c; layer->_blendMode[1] = (int)local_78; layer->_blendMode[2] = local_78._4_4_; layer->_blendMode[3] = local_70; layer->_blendMode[4] = iStack_6c; uVar8 = Random(); *(float *)(pEVar12[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0; uVar8 = Random(); iVar10 = uVar8 % 0x1e + 0x14; *(int *)(pEVar12[1]._sprite._filename._buf + 8) = iVar10; *(int *)(pEVar12[1]._sprite._filename._buf + 0xc) = iVar10; uVar8 = Random(); iVar10 = *(int *)pEVar12; fVar17 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8; fVar16 = fVar17 * g_vectorOne.x; (pEVar12->_sprite)._scale.y = fVar17 * g_vectorOne.y; (pEVar12->_sprite)._scale.x = fVar16; (**(code **)(iVar10 + 0xc))(); goto LAB_00713310; } if (((((*(uint *)(*(int *)((int)pvVar13 + 4) + 0x44) >> 5 & 1) == 0) || (*(float *)((int)pvVar13 + 0x7740) <= 0.5)) || ((this->_desc)._state != 0)) || (uVar8 = Random(), uVar8 % 0x14 != 0)) goto LAB_00713310; uVar8 = Random(); local_98[0] = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * -1.2800001; uVar8 = Random(); iVar10 = *(int *)((int)g_game->_room + 0xc); local_bc = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 0.4; spawnVelocity.y = local_98[0]; spawnPos.x = (float)(this->_gridIndex % iVar10) * 40.0 + 40.0; spawnPos.y = (float)(this->_gridIndex / iVar10) * 40.0 + 120.0; spawnVelocity.x = local_bc; uVar8 = Random(); spawnPos.x = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 18.0 + spawnPos.x; uVar8 = Random(); spawnPos.y = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 18.0 + spawnPos.y; local_c0 = (Entity *)Random(); local_dc = g_game; spawnSubType = 0; local_b4 = 0x42; spawnType = 1000; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&local_b4,&spawnPos,&spawnVelocity,(Entity *)0x0,&spawnSubType ,(uint *)&local_c0); uVar8 = local_b4; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00712858: local_d8[0] = spawnSubType; } else { piVar11 = (g_game->_deathmatchManager)._type; local_d0 = piVar11; uVar9 = Random(); iVar10 = spawnSubType; local_78 = 0x900000005; local_a8 = (Game *)&DAT_00000007; local_70 = 7; if (spawnType != 5) goto LAB_00712858; if (uVar8 < 0x12d) { if (uVar8 == 300) { while ((local_d8[0] = spawnSubType, spawnSubType == 0 || (cVar6 = (**(code **)(*piVar11 + 0x24))(spawnSubType), cVar6 != '\0'))) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pEVar12 = (Entity *)(*pcVar1)(); return pEVar12; } uVar9 = uVar9 >> ((byte)local_78 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)((ulonglong)local_78 >> 0x20) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)local_a8 & 0x1f) ^ uVar9; iVar10 = ItemPool::GetCardEx(uVar9,0x19,10,10,1); cardRng[0]._shift1 = 5; cardRng[0]._shift2 = 9; cardRng[0]._shift3 = 7; cardRng[0]._seed = uVar9; spawnSubType = lua_callback_run_get_card(cardRng,iVar10,1,1,0); } } else { if (uVar8 == 0x46) { local_98[2] = (float)((uint)spawnSubType >> 0xb); do { local_d8[0] = spawnSubType; if (spawnSubType != 0) { pcVar1 = *(code **)(*piVar11 + 0x28); iVar10 = ItemPool::GetPillEffect(&g_game->_itemPool,spawnSubType,(Entity_Player *)0x0) ; cVar6 = (*pcVar1)(iVar10); if (cVar6 == '\0') goto LAB_00712860; piVar11 = local_d0; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pEVar12 = (Entity *)(*pcVar1)(); return pEVar12; } uVar9 = uVar9 >> ((byte)local_78 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)((ulonglong)local_78 >> 0x20) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)local_a8 & 0x1f) ^ uVar9; uVar8 = ItemPool::GetPill(uVar9); spawnSubType = uVar8 | ((uint)local_98[2] & 1) << 0xb; } while( true ); } if (uVar8 != 100) goto LAB_00712858; local_d8[0] = spawnSubType; if (spawnSubType == 0x19) { LAB_007126b4: bVar15 = false; } else { local_a8 = (Game *)spawnSubType; std::set::find_node(local_54,&local_a8); if (((*(char *)(local_4c + 0xd) == '\0') && (*(int *)(local_4c + 0x10) <= iVar10)) && (local_4c != piVar11[8])) goto LAB_007126b4; bVar15 = true; } if ((iVar10 == 0) || (bVar15)) { spawnSubType = (**(code **)(*piVar11 + 0x84))(0); local_d8[0] = spawnSubType; } } } else { if (uVar8 != 0x15e) goto LAB_00712858; while ((local_d8[0] = spawnSubType, spawnSubType == 0 || (cVar6 = (**(code **)(*piVar11 + 0x2c))(spawnSubType), cVar6 != '\0'))) { spawnSubType = ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_00712860: local_b0[0] = EntityFactory::Create(local_dc->_entityFactory,spawnType,0); if (local_b0[0] == (Entity *)0x0) goto LAB_00713310; uVar18 = GetTimeNs(); pEVar12 = local_b0[0]; uVar8 = (uint)(uVar18 >> 0x20); lVar2 = (uVar18 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar8 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); local_98[2] = (float)(lVar3 + lVar2); lVar2 = (ulonglong)uVar8 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar2) >> 0x20)); local_a0 = (uint)((ulonglong)lVar2 >> 0x20); spawnerSlot = &local_b0[0]->_spawnerEntity; local_d0 = (int *)((uint)lVar2 >> 0x12 | local_a0 * 0x4000); local_a0 = local_a0 >> 0x12; local_b0[0]->_spawnerType = 0; local_b0[0]->_spawnerVariant = 0; if (*spawnerSlot != (EntityPtr)0x0) { local_b0[0] = (Entity *)spawnerSlot; std::multiset::erase(local_b0); } iVar10 = *(int *)pEVar12; *spawnerSlot = (EntityPtr)0x0; (pEVar12->_pos).x = spawnPos.x; (pEVar12->_pos).y = spawnPos.y; (pEVar12->_velocity).x = local_bc; (pEVar12->_velocity).y = local_98[0]; (**(code **)(iVar10 + 4))(spawnType,local_b4,local_d8[0],local_c0); pGVar7 = local_dc; pvVar13 = local_dc->_room; iVar10 = *(int *)((int)pvVar13 + 0x1214); *(int *)((int)pvVar13 + 0x1214) = iVar10 + 1; pEVar12->_index = iVar10; EntityList::AddEntity((EntityList *)((int)pvVar13 + 0x1218),pEVar12); bVar5 = Game::ShouldEraseEnemy(pEVar12); if (bVar5 != 0) { Entity::RemoveWithPoof(pEVar12,unusedArg); } if ((pEVar12->_exists != 0) && ((pGVar7->_proceduralItemManager)._proceduralItems._begin != (pGVar7->_proceduralItemManager)._proceduralItems._end)) { iStack_b8 = pEVar12->_variant; local_bc = (float)pEVar12->_type; std::map::find(&local_dc,&local_bc); pGVar7 = (pGVar7->_proceduralItemManager)._spawnTriggerTargets._head; if (local_dc == pGVar7) { local_98[0] = (float)pEVar12->_type; local_98[1] = -NAN; piVar11 = (int *)std::map::find(local_98 + 2,local_98); local_dc = (Game *)*piVar11; if (local_dc == pGVar7) goto LAB_00712ab1; } uVar8 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar13 = (playerManager->_playerList)._end; if ((int)pvVar13 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar13 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (uVar8 < (uint)((int)pvVar13 - (int)piVar11 >> 2)) { piVar11 = piVar11 + uVar8; } trigger_set_dispatch((void *)(*piVar11 + 0x1fc8),6,pEVar12,&spawnPos,&spawnVelocity); uVar8 = uVar8 + 1; playerManager = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_00712ab1: uVar18 = GetTimeNs(); uVar8 = (uint)(uVar18 >> 0x20); lVar2 = (uVar18 & 0xffffffff) * 0x431bde82; local_b0[0] = (Entity *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0x431bde82; local_bc = (float)lVar3; lVar4 = (ulonglong)uVar8 * 0xd7b634db + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20); local_68.x = (float)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)(&(local_b0[0]->_sprite)._filename + -3) + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); piVar11 = (int *)((uint)lVar3 >> 0x12 | uVar9 * 0x4000); uVar8 = (int)piVar11 - (int)local_d0; bVar15 = CARRY4((uint)g_entitySpawnTimeMs,uVar8); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar8; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar9 >> 0x12) - local_a0) - (uint)(piVar11 < local_d0)) + (uint)bVar15; LAB_00713310: curPit = pit; pEVar12 = (Entity *)(g_game->_frameCount / 10); if (g_game->_frameCount % 10 == 0) { pEVar12 = (Entity *)(*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 5); if (((((uint)pEVar12 & 1) != 0) && (*(int *)((int)g_game->_room + 0x1d18) == 9)) && ((pit->_desc)._state == 0)) { uVar8 = Random(); pEVar12 = (Entity *)(uVar8 / 6); if (uVar8 % 6 == 0) { GridEntity::Position((GridEntity *)curPit,&spawnPos); uVar8 = Random(); spawnPos.x = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 15.0 + spawnPos.x; uVar8 = Random(); spawnPos.y = ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 15.0 + spawnPos.y; uVar8 = Random(); pEVar12 = Game::SpawnEx(g_game,1000,0x7c,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar8,0); } } } return pEVar12; } //@@ 00713440 GridEntity_Pit::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity_Pit::Render(GridEntity_Pit *this,float *param_2) { ColorMod *pCVar1; byte bVar2; void *pvVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; Vector *pVVar13; LayerState *pLVar14; AnimationState *pAVar15; Vector local_44; Vector local_3c; undefined4 local_34 [12]; pVVar13 = GridEntity::get_render_position((GridEntity *)this,&local_3c); local_44.x = pVVar13->x + *param_2; local_44.y = pVVar13->y + param_2[1]; pvVar3 = g_game->_room; fVar5 = *(float *)((int)pvVar3 + 0x72a4); fVar6 = *(float *)((int)pvVar3 + 0x72a8); fVar7 = *(float *)((int)pvVar3 + 0x72ac); fVar8 = *(float *)((int)pvVar3 + 0x72b0); fVar4 = *(float *)((int)pvVar3 + 0x72cc); fVar9 = *(float *)((int)pvVar3 + 0x72b4); fVar10 = *(float *)((int)pvVar3 + 0x72b8); fVar11 = *(float *)((int)pvVar3 + 0x72bc); fVar12 = *(float *)((int)pvVar3 + 0x72c0); pCVar1 = &(this->_sprite)._color; if (pCVar1 != (ColorMod *)local_34) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar3 + 0x72c4); pCVar1->_tint[0] = fVar5; (this->_sprite)._color._tint[1] = fVar6; (this->_sprite)._color._tint[2] = fVar7; (this->_sprite)._color._tint[3] = fVar8; (this->_sprite)._color._offset[2] = fVar4; (this->_sprite)._color._colorize[0] = fVar9; (this->_sprite)._color._colorize[1] = fVar10; (this->_sprite)._color._colorize[2] = fVar11; (this->_sprite)._color._colorize[3] = fVar12; } if ((uint)(this->_sprite)._layerCount < 2) { if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_44,&g_vectorZero,&g_vectorZero); pAVar15 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_44,&g_vectorZero,&g_vectorZero); pAVar15 = &(this->_sprite)._animState; } AnimationState::Render(pAVar15,&local_44,&g_vectorZero,&g_vectorZero); } } else { pLVar14 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); bVar2 = pLVar14->_visible; pLVar14 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar14->_visible = 0; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_44,&g_vectorZero,&g_vectorZero); pAVar15 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_44,&g_vectorZero,&g_vectorZero); pAVar15 = &(this->_sprite)._animState; } AnimationState::Render(pAVar15,&local_44,&g_vectorZero,&g_vectorZero); } pLVar14 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar14->_visible = bVar2; if (bVar2 != 0) { Sprite::RenderLayer((Sprite *)&this->_sprite,1,&local_44,&g_vectorZero,&g_vectorZero); return; } } return; } //@@ 007135d0 FUN_007135d0 void FUN_007135d0(undefined4 param_1,undefined1 param_2,int *param_3) { uint uVar1; int iVar2; int iVar3; char cVar4; LayerState *pLVar5; int in_ECX; void *pvVar6; void *pvVar7; undefined1 auStack_36 [2]; Vector local_28; undefined1 local_20 [4]; int *local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afc9e5; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = *(uint *)((int)g_game->_room + 0xc); local_28.x = (float)(int)(*(uint *)(in_ECX + 0x24) % uVar1) * 26.0 + 39.0 + g_vectorZero.x; local_28.y = (float)(int)(*(uint *)(in_ECX + 0x24) / uVar1) * 26.0 + 39.0 + g_vectorZero.y; pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x40),(byte *)0x0); LayerState::GetTexture(pLVar5,local_20); pvVar7 = (void *)0x0; local_8 = CONCAT31(local_8._1_3_,1); pvVar6 = (void *)0x713682; pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x40),(byte *)0x0); KAGE::SmartPointer::operator_assign(auStack_36 + -10,¶m_2); LayerState::SetTexture(pLVar5,pvVar6,pvVar7); iVar2 = *(int *)(in_ECX + 0x74); if (((iVar2 != 0) && (0 < (*(ANM2 **)(in_ECX + 0x70))->_layerCount)) && (iVar3 = *(int *)(iVar2 + 0x38), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar2 + 0x18)),&local_28, *(int *)(*(int *)(in_ECX + 0x78) + iVar3 * 4),&g_vectorZero,&g_vectorZero, *(ANM2 **)(in_ECX + 0x70)); } pvVar7 = (void *)0x0; pvVar6 = (void *)0x7136df; pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x40),(byte *)0x0); KAGE::SmartPointer::operator_assign(auStack_36 + -10,local_20); LayerState::SetTexture(pLVar5,pvVar6,pvVar7); local_8 = CONCAT31(local_8._1_3_,2); if (local_1c != (int *)0x0) { cVar4 = (**(code **)(*local_1c + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_8 = 3; if (param_3 != (int *)0x0) { cVar4 = (**(code **)(*param_3 + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00713760 GridEntity_Pit::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Pit::BeginBatches(GridEntity_Pit *this) { code *pcVar1; byte bVar2; uint uVar3; uint *randomBackdrop; byte *pbVar4; void *pvVar5; byte extraout_CL; byte extraout_CL_00; char *pcVar6; Game *game; uint startFrame; uint seed; byte *pbVar7; Game *game; bool isLess; undefined8 local_6c; undefined1 *local_64; undefined1 *local_60; undefined4 local_5c; uint local_58; undefined8 local_50; undefined4 local_48; std_string spritesheetPath; std_string anm2Path; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afca3d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&anm2Path)[1]._size; ExceptionList = &local_10; uVar3 = (this->_desc)._variant; if ((char)uVar3 < '\0') { uVar3 = uVar3 & 0xffffff7f; (this->_desc)._varData = 1; (this->_desc)._variant = uVar3; } if ((uVar3 & 0xff00) != 0) { *(char *)(this->_gridIndex + 0x746c + (int)g_game->_room) = (char)(uVar3 >> 8); } game = g_game; this->_hasLadder = 0; local_58 = *(uint *)((int)game->_room + 0x1d18); if (game->_challenge == 0x2d) { seed = game->_dungeonPlacementSeed; uVar3 = (this->_desc)._spawnSeed; local_6c = 0xf00000002; local_5c = 0x19; local_64 = (undefined1 *)0x19; local_50 = 0xf00000002; local_48 = 0x19; if (uVar3 == 0) { local_60 = (undefined1 *)seed; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 2 ^ uVar3; uVar3 = uVar3 << 0xf ^ uVar3; uVar3 = uVar3 >> 0x19 ^ uVar3; if (uVar3 == (uVar3 / 10) * 10) { seed = (this->_desc)._spawnSeed; local_6c = 0x900000005; local_5c = 7; local_64 = &DAT_00000007; } local_60 = g_game->_room; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = seed >> (sbyte)local_6c ^ seed; uVar3 = uVar3 << (sbyte)((ulonglong)local_6c >> 0x20) ^ uVar3; randomBackdrop = (uint *)(local_60 + ((uVar3 >> (sbyte)local_5c ^ uVar3) % 0x3e + 1) * 0x13c + 0x1d1c); game = g_game; if ((randomBackdrop != (uint *)0x0) && (randomBackdrop[0x2e] != 0)) { local_58 = *randomBackdrop; } } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; if ((*(uint *)(*(int *)((int)game->_room + 4) + 0x44) >> 5 & 1) == 0) { anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x16; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/grid_pit.anm2",0x17); local_8 = 2; ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pcVar6 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pcVar6 = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; Sprite::ReplaceSpritesheet ((Sprite *)&this->_sprite,0, (std_string *) ((int)g_game->_room + *(int *)((int)g_game->_room + 0x1d18) * 0x13c + 0x1dc4)); } else { anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1c; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/grid_pit_water.anm2",0x1d); local_8 = 0; ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pcVar6 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pcVar6 = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar3); } pbVar7 = (this->_sprite)._overlayAnimState._animData; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; if (pbVar7 == (byte *)0x0) { LAB_00713a2c: bVar2 = ANM2::SetOverlayAnimation(&this->_sprite,(byte *)"highlights",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._overlayAnimState); (this->_sprite)._overlayAnimState._isPlaying = 1; } } else { pbVar4 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar4 = *(byte **)pbVar7; } pcVar6 = "highlights"; do { bVar2 = *pbVar4; isLess = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_00713a11: uVar3 = -(uint)isLess | 1; goto LAB_00713a16; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; isLess = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_00713a11; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00713a16: if ((uVar3 != 0) || ((pbVar7[0x34] != 0 && ((this->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_00713a2c; } pvVar5 = ANM2::GetAnimationData(&this->_sprite,(byte *)"highlights"); uVar3 = *(uint *)((int)pvVar5 + 0x30); if (uVar3 == 0) { startFrame = 0; } else { startFrame = Random(); startFrame = startFrame % uVar3; } if ((this->_sprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)(int)startFrame); } pvVar5 = g_game->_room; pbVar7 = (byte *)((int)pvVar5 + *(int *)((int)pvVar5 + 0x1d18) * 0x13c + 0x1ddc); if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } if ((local_58 == 10) || (pbVar4 = pbVar7, local_58 == 0xb)) { local_5c = 0x13; if (*(int *)((int)pvVar5 + 4) == 0) { local_58 = 0; LAB_00713aee: KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_58 = *(uint *)(*(int *)((int)pvVar5 + 4) + 0x58); if (local_58 == 0) goto LAB_00713aee; uVar3 = local_58 >> 1 ^ local_58; uVar3 = uVar3 << 5 ^ uVar3; pbVar4 = (byte *)"gfx/grid/grid_pit_acid_womb.png"; if (((uVar3 >> 0x13 ^ uVar3) & 1) == 0) { pbVar4 = pbVar7; } } spritesheetPath._size = 0; spritesheetPath._capacity = 0xf; spritesheetPath._buf._0_4_ = (char *)0x0; pbVar7 = pbVar4; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); std::string::assign(spritesheetPath._buf,pbVar4,(int)pbVar7 - (int)(pbVar4 + 1)); local_8 = 1; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&spritesheetPath); local_8 = 0xffffffff; if (0xf < spritesheetPath._capacity) { uVar3 = spritesheetPath._capacity + 1; pcVar6 = (char *)spritesheetPath._buf._0_4_; if (0xfff < uVar3) { pcVar6 = *(char **)(spritesheetPath._buf._0_4_ + -4); uVar3 = spritesheetPath._capacity + 0x24; if ((char *)0x1f < (char *)(spritesheetPath._buf._0_4_ + (-4 - (int)pcVar6))) goto LAB_00713e5d; } operator_delete(pcVar6,uVar3); } } game = g_game; if (g_game->_challenge == 0x2c) { uVar3 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); LAB_00713caf: game = g_game; uVar3 = RoomConfig::GetStageID(game->_stage,uVar3,-1); if (uVar3 == 6) { local_60 = &DAT_0000004f; std::set::find_node(&local_6c,&local_60); if ((((local_64[0xd] == '\0') && (*(int *)(local_64 + 0x10) < 0x50)) && (local_64 != (game->_seedEffects)._seedEffects)) && (0.5 < *(float *)((int)game->_room + 0x7240))) { spritesheetPath._buf._0_4_ = std::_Allocate(0x40); spritesheetPath._size = 0x39; spritesheetPath._capacity = 0x3f; builtin_strncpy((char *)spritesheetPath._buf._0_4_, "gfx/promo/gfuel/grid/grid_pit_floodedcaves_verycursed.png",0x3a); local_8 = 3; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&spritesheetPath); local_8 = 0xffffffff; if (0xf < spritesheetPath._capacity) { uVar3 = spritesheetPath._capacity + 1; pcVar6 = (char *)spritesheetPath._buf._0_4_; if (0xfff < uVar3) { pcVar6 = *(char **)(spritesheetPath._buf._0_4_ + -4); uVar3 = spritesheetPath._capacity + 0x24; if ((char *)0x1f < (char *)(spritesheetPath._buf._0_4_ + (-4 - (int)pcVar6))) goto LAB_00713e5d; } operator_delete(pcVar6,uVar3); } game = g_game; } } } else { game = g_game; if (g_game->_currentDimensionIdx != 2) { uVar3 = g_game->_stageType; goto LAB_00713caf; } } pbVar7 = (byte *)((int)game->_room + *(int *)((int)game->_room + 0x1d18) * 0x13c + 0x1dac); if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } spritesheetPath._size = 0; spritesheetPath._capacity = 0xf; spritesheetPath._buf._0_4_ = (char *)0x0; pbVar4 = pbVar7; do { bVar2 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar2 != 0); std::string::assign(spritesheetPath._buf,pbVar7,(int)pbVar4 - (int)(pbVar7 + 1)); local_8 = 4; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,1,&spritesheetPath); local_8 = 0xffffffff; bVar2 = extraout_CL; if (0xf < spritesheetPath._capacity) { uVar3 = spritesheetPath._capacity + 1; pcVar6 = (char *)spritesheetPath._buf._0_4_; if (0xfff < uVar3) { pcVar6 = *(char **)(spritesheetPath._buf._0_4_ + -4); uVar3 = spritesheetPath._capacity + 0x24; if ((char *)0x1f < (char *)(spritesheetPath._buf._0_4_ + (-4 - (int)pcVar6))) { LAB_00713e5d: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar3); bVar2 = extraout_CL_00; } ANM2::LoadGraphics(&this->_sprite,bVar2); bVar2 = ANM2::SetAnimation(&this->_sprite,&DAT_00b68fb8,1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } (this->_sprite)._offset.x = 2.0; (this->_sprite)._offset.y = 2.0; ExceptionList = local_10; return; } //@@ 00713ee0 GridEntity_Pit::update_sprite_edges /* DB: ? called from GridEntity_Pit::PostInit; checks 8 neighbors via FUN_00813420(x,y) to pick edge animation/layer frames ("LayerId out of bounds") */ void __thiscall GridEntity_Pit::update_sprite_edges(GridEntity_Pit *this) { void *pvVar1; byte isAnimSet; uint gridY; int iVar2; uint gridY; int iVar4; LayerState *pLVar5; uint gridX; int iVar6; int iVar7; int iVar8; uint edgeFrame; int cornerMask; int bottomCornerCount; AnimationState *animState; pvVar1 = g_game->_room; edgeFrame = 0; gridY = *(uint *)((int)pvVar1 + 0xc); gridY = (uint)this->_gridIndex / gridY; gridX = (uint)this->_gridIndex % gridY; iVar6 = gridX - 1; if ((((((-1 < iVar6) && (iVar6 < (int)gridY)) && (-1 < (int)gridY)) && (((int)gridY < *(int *)((int)pvVar1 + 0x10) && (iVar8 = gridY * gridY + iVar6, -1 < iVar8)))) && (iVar8 = *(int *)((int)pvVar1 + iVar8 * 4 + 0x24), iVar8 != 0)) && (*(int *)(iVar8 + 4) == 7)) { edgeFrame = 1; } iVar8 = gridY - 1; if ((((-1 < (int)gridX) && ((int)gridX < *(int *)((int)pvVar1 + 0xc))) && ((-1 < iVar8 && (((iVar8 < *(int *)((int)pvVar1 + 0x10) && (iVar2 = *(int *)((int)pvVar1 + 0xc) * iVar8 + gridX, -1 < iVar2)) && (iVar2 = *(int *)((int)pvVar1 + iVar2 * 4 + 0x24), iVar2 != 0)))))) && (*(int *)(iVar2 + 4) == 7)) { edgeFrame = edgeFrame + 2; } iVar2 = gridX + 1; if ((((-1 < iVar2) && (iVar2 < *(int *)((int)pvVar1 + 0xc))) && ((-1 < (int)gridY && (((int)gridY < *(int *)((int)pvVar1 + 0x10) && (iVar7 = *(int *)((int)pvVar1 + 0xc) * gridY + iVar2, -1 < iVar7)))))) && ((iVar7 = *(int *)((int)pvVar1 + iVar7 * 4 + 0x24), iVar7 != 0 && (*(int *)(iVar7 + 4) == 7)))) { edgeFrame = edgeFrame + 4; } iVar7 = gridY + 1; if ((((-1 < (int)gridX) && ((int)gridX < *(int *)((int)pvVar1 + 0xc))) && (-1 < iVar7)) && (((iVar7 < *(int *)((int)pvVar1 + 0x10) && (iVar4 = gridX + *(int *)((int)pvVar1 + 0xc) * iVar7, -1 < iVar4)) && ((iVar4 = *(int *)((int)pvVar1 + iVar4 * 4 + 0x24), iVar4 != 0 && (*(int *)(iVar4 + 4) == 7))) ))) { edgeFrame = edgeFrame + 8; } if (edgeFrame == 0) { gridY = Random(); edgeFrame = (gridY & 1) << 4; } switch(edgeFrame) { case 3: iVar6 = FUN_00813420(iVar6,iVar8); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { edgeFrame = edgeFrame + 0xe; } break; case 6: iVar6 = FUN_00813420(iVar2,iVar8); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { edgeFrame = edgeFrame + 0xc; } break; case 7: iVar7 = 0; iVar2 = FUN_00813420(iVar2,iVar8); if ((iVar2 == 0) || (*(int *)(iVar2 + 4) != 7)) { iVar7 = 1; } iVar6 = FUN_00813420(iVar6,iVar8); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { iVar7 = iVar7 + 2; } if (iVar7 == 0) { edgeFrame = 7; } else { edgeFrame = iVar7 + 0x1a; } break; case 9: iVar6 = FUN_00813420(iVar6,iVar7); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { edgeFrame = edgeFrame + 10; } break; case 0xb: iVar6 = FUN_00813420(iVar6,iVar8); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { edgeFrame = edgeFrame + 0xf; } break; case 0xc: iVar6 = FUN_00813420(iVar2,iVar7); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { edgeFrame = edgeFrame + 8; } break; case 0xd: iVar4 = 0; iVar8 = FUN_00813420(iVar2,iVar7); if ((iVar8 == 0) || (*(int *)(iVar8 + 4) != 7)) { iVar4 = 1; } iVar6 = FUN_00813420(iVar6,iVar7); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { iVar4 = iVar4 + 2; } if (iVar4 == 0) { edgeFrame = 0xd; } else { edgeFrame = iVar4 + 0x1d; } break; case 0xe: iVar6 = FUN_00813420(iVar2,iVar8); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { edgeFrame = edgeFrame + 0xb; } break; case 0xf: cornerMask = 0; iVar4 = FUN_00813420(iVar6,iVar8); if ((iVar4 == 0) || (*(int *)(iVar4 + 4) != 7)) { cornerMask = 1; } iVar8 = FUN_00813420(iVar2,iVar8); if ((iVar8 == 0) || (*(int *)(iVar8 + 4) != 7)) { cornerMask = cornerMask + 2; } if (cornerMask == 0) { bottomCornerCount = 0; iVar6 = FUN_00813420(iVar6,iVar7); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { bottomCornerCount = 1; } iVar6 = FUN_00813420(iVar2,iVar7); if ((iVar6 == 0) || (*(int *)(iVar6 + 4) != 7)) { bottomCornerCount = bottomCornerCount + 1; } edgeFrame = 0x18; if (bottomCornerCount != 2) { edgeFrame = 0xf; } } else { edgeFrame = cornerMask + 0x14; } } isAnimSet = ANM2::SetAnimation(&this->_sprite,&DAT_00b68fb8,1); if (((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)edgeFrame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } if (1 < (uint)(this->_sprite)._layerCount) { iVar8 = (this->_desc)._state + -2; iVar6 = 0; if (0 < iVar8) { iVar6 = iVar8; } if (((this->_sprite)._animState._animData != (void *)0x0) && ((animState = &(this->_sprite)._animState, 1 < *(int *)((int)(this->_sprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 1 < *(int *)((int)animState->_animation + 0x80))))) { pvVar1 = (this->_sprite)._animState._animData; iVar8 = *(int *)((int)pvVar1 + 0x3c); if ((pvVar1 == (void *)0x0) || ((iVar8 < 0 || (*(int *)((int)pvVar1 + 0x1c) <= iVar8)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_sprite)._animState._layerFrames + iVar8 * 4) = 0; AnimationState::AdvanceLayerPosition(animState,iVar8,(float)iVar6); } iVar6 = (this->_desc)._state; pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar5->_visible = 1 < iVar6; } (this->_desc)._variant = (this->_desc)._variant & 0xffffff00U | edgeFrame; return; } //@@ 00714320 GridEntity_Pit::PostInit /* ZHL [vtable slot 1] */ void __thiscall GridEntity_Pit::PostInit(GridEntity_Pit *this) { char *pcVar1; uint uVar2; Entity_Player *this_00; byte bVar3; int iVar4; void *pvVar5; int iVar6; uint uVar7; uint uVar8; int iVar9; undefined4 *puVar10; Game *pGVar11; float fVar12; int local_1c; int local_18; pGVar11 = g_game; pcVar1 = g_game->_room; pcVar1[0x11f6] = '\x01'; if ((*pcVar1 == '\0') || (pGVar11->_frameCount - *(int *)(pcVar1 + 0x11f0) < 2)) { update_sprite_edges(); } else { uVar8 = this->_gridIndex; uVar2 = *(uint *)(pcVar1 + 0xc); uVar7 = uVar8 % uVar2; local_1c = -1; do { iVar6 = local_1c + uVar7; local_18 = 3; iVar9 = uVar8 / uVar2 - 1; do { if (((((-1 < iVar6) && (iVar6 < *(int *)(pcVar1 + 0xc))) && (-1 < iVar9)) && ((iVar9 < *(int *)(pcVar1 + 0x10) && (iVar4 = iVar9 * *(int *)(pcVar1 + 0xc) + local_1c + uVar7, -1 < iVar4)))) && ((iVar4 < 0x1c0 && ((*(int *)(pcVar1 + iVar4 * 4 + 0x24) != 0 && (*(int *)(*(int *)(pcVar1 + iVar4 * 4 + 0x24) + 4) == 7)))))) { update_sprite_edges(); } iVar9 = iVar9 + 1; local_18 = local_18 + -1; } while (local_18 != 0); local_1c = local_1c + 1; } while (local_1c < 2); uVar8 = 0; pGVar11 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar5 = (pGVar11->_playerManager)._playerList._end; puVar10 = (pGVar11->_playerManager)._playerList._begin; if ((int)pvVar5 - (int)puVar10 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (pGVar11->_playerManager)._playerList._end; puVar10 = (pGVar11->_playerManager)._playerList._begin; pGVar11 = g_game; } if (uVar8 < (uint)((int)pvVar5 - (int)puVar10 >> 2)) { puVar10 = puVar10 + uVar8; } this_00 = (Entity_Player *)*puVar10; iVar6 = this_00->_entityGridCollisionClass; if ((((iVar6 != 0) && (iVar6 != 3)) && (iVar6 != 1)) && ((iVar6 != 2 && (this_00->_pitfallState == 0)))) { fVar12 = ((this_00->_pos).x - 40.0) / 40.0 + 0.5; iVar9 = (int)fVar12; iVar6 = (int)(((this_00->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar9 < 0) || ((iVar4 = *(int *)((int)pGVar11->_room + 0xc), iVar4 <= iVar9 || (iVar6 < 0)))) || (*(int *)((int)pGVar11->_room + 0x10) <= iVar6)) { iVar6 = -1; } else { iVar6 = iVar4 * iVar6 + (int)fVar12; } iVar9 = this->_gridIndex; if (iVar6 == iVar9) { iVar6 = *(int *)((int)pGVar11->_room + 0xc); (this_00->_pos).x = (float)(iVar9 % iVar6) * 40.0 + 40.0; (this_00->_pos).y = (float)(iVar9 / iVar6) * 40.0 + 120.0; bVar3 = TemporaryEffects::HasCollectibleEffect(&this_00->_temporaryeffects,0x271); if (bVar3 == 0) { Entity_Player::PlayExtraAnimation(this_00,(byte *)"FallIn"); pGVar11 = g_game; this_00->_isControlsEnabled = 0; this_00->_entityCollisionClass = 0; this_00->_pitfallState = 1; this_00->_pitfallTimer = 0; } } } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(pGVar11->_playerManager)._playerList._end - (int)(pGVar11->_playerManager)._playerList._begin >> 2)); UpdateCollision(this); return; } } UpdateCollision(this); return; } //@@ 00714610 GridEntity_Pit::UpdateCollision /* ZHL [lua] Lua binding GridEntityPit:UpdateCollision prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall GridEntity_Pit::UpdateCollision(GridEntity_Pit *this) { void *pvVar1; uint uVar2; undefined4 uVar3; pvVar1 = g_game->_room; if (((*(int *)((int)pvVar1 + 0x1d18) != 0x20) || ((*(uint *)(*(int *)((int)pvVar1 + 4) + 0x44) >> 5 & 1) == 0)) || (0.2 < *(float *)((int)pvVar1 + 0x7740) || *(float *)((int)pvVar1 + 0x7740) == 0.2)) { uVar2 = this->_gridIndex; if ((this->_desc)._state < 2) { if (this->_hasLadder == 0) { if (uVar2 < 0x1c0) { *(undefined4 *)((int)pvVar1 + uVar2 * 4 + 0x76c) = 3000; } this->_collisionClass = 1; return; } if (uVar2 < 0x1c0) { *(undefined4 *)((int)pvVar1 + uVar2 * 4 + 0x76c) = 3000; } this->_collisionClass = 5; return; } if (uVar2 < 0x1c0) { uVar3 = 0; if ((this->_desc)._state == 3) { uVar3 = 999; } *(undefined4 *)((int)pvVar1 + uVar2 * 4 + 0x76c) = uVar3; } } else if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)pvVar1 + this->_gridIndex * 4 + 0x76c) = 0; this->_collisionClass = 0; return; } this->_collisionClass = 0; return; } //@@ 007146e0 GridEntity_Pit::SetLadder /* ZHL [lua] Lua binding GridEntityPit:SetLadder */ void __thiscall GridEntity_Pit::SetLadder(GridEntity_Pit *this,byte param_2) { this->_hasLadder = param_2; UpdateCollision(this); return; } //@@ 00714700 GridEntity_Pit::MakeBridge /* ZHL [lua] Lua binding GridEntityPit:MakeBridge */ void GridEntity_Pit::MakeBridge(int param_1,int param_2) { int iVar1; GridEntity_Pit *in_ECX; if ((in_ECX->_desc)._state == 0) { if (param_2 != 0) { (in_ECX->_desc)._varData = param_2; (in_ECX->_desc)._state = 1; return; } if (((param_1 == 0) || (*(int *)(param_1 + 4) != 0x19)) || (iVar1 = 3, *(int *)(param_1 + 0x194) != 1)) { iVar1 = 2; } (in_ECX->_desc)._state = iVar1; UpdateCollision(in_ECX); } return; } //@@ 00714750 GridEntity_Web::GetWaterClipInfo /* ZHL [exact] WaterClipInfo* GetWaterClipInfo(WaterClipInfo* out); */ void GridEntity_Web::GetWaterClipInfo(undefined4 *param_1) { *param_1 = 0x26; param_1[1] = 0; return; } //@@ 00714770 GridEntity_Poop::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 2] */ void __thiscall GridEntity_Poop::Update(GridEntity_Poop *this) { qword qVar1; byte bVar2; uint uVar3; GridEntity_Poop *gigaPart; RoomDescriptor *roomDesc; void *pvVar4; byte *animNameCursor; byte *pbVar5; char *expectedName; undefined4 *playerSlot; qword *allocCounter; float *playerIt; int iVar6; PlayerManager *playerManager; bool isLess; float fVar7; float fVar8; float fVar9; float pulseColor [8]; undefined4 local_9c; undefined4 uStack_98; undefined4 local_94; void *local_90; void *pvStack_8c; void *pvStack_88; undefined4 uStack_84; Vector spawnPos; Vector local_74; void *footprintR; void *pvStack_68; void *pvStack_64; int iStack_60; uint local_5c; void *local_58; void *local_54; GridEntity_Poop *local_50; void *local_4c; byte local_45; byte animName [32]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Entity_Player *player; int prevHolyAura; ColorMod *spriteColor; puStack_20 = animName + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00afca70; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(animName + 0x34); ExceptionList = &local_1c; local_50 = this; local_24 = uVar3; if ((this->_desc)._variant - 7U < 4) { iVar6 = 7; puStack_20 = animName + 0x40; do { if ((iVar6 != (this->_desc)._variant) && (gigaPart = get_giga_part(this,iVar6,0), gigaPart == (GridEntity_Poop *)0x0)) { iVar6 = *(int *)this; (this->_desc)._variant = 0; (**(code **)(iVar6 + 0x20))(uVar3); break; } iVar6 = iVar6 + 1; } while (iVar6 < 0xb); } if (((this->_desc)._variant == 1) && (roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx), ((uint)roomDesc->Flags >> 1 & 1) != 0)) { local_45 = (this->_sprite)._flipX; iVar6 = *(int *)this; this->_reviveTimer = 0; (this->_desc)._variant = 0; (**(code **)(iVar6 + 0x20))(); iVar6 = (this->_desc)._state; if (iVar6 != 1000) { local_54 = (void *)0x3; local_4c = (void *)0x0; local_58 = (void *)(iVar6 / 0xfa); } sprintf_s(animName,0x1f,(byte *)"State%d"); pvVar4 = ANM2::GetAnimationData(&this->_sprite,animName); local_58 = *(void **)((int)pvVar4 + 0x30); bVar2 = ANM2::SetAnimation(&this->_sprite,animName,1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)local_58), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } (this->_sprite)._flipX = local_45; uVar3 = Random(); iVar6 = *(int *)((int)g_game->_room + 0xc); spawnPos.x = (float)(local_50->_gridIndex % iVar6) * 40.0 + 40.0; spawnPos.y = (float)(local_50->_gridIndex / iVar6) * 40.0 + 120.0; Game::SpawnEx(g_game,1000,0xf,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar3,0); this = local_50; } if ((0 < this->_reviveTimer) && (iVar6 = this->_reviveTimer + -1, this->_reviveTimer = iVar6, iVar6 < 1)) { pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_007149d5: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"Appear",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { animNameCursor = *(byte **)pbVar5; } expectedName = "Appear"; do { bVar2 = *animNameCursor; isLess = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_007149b7: uVar3 = -(uint)isLess | 1; goto LAB_007149bc; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; isLess = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_007149b7; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_007149bc: if ((uVar3 != 0) || ((pbVar5[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_007149d5; } game = g_game; (this->_desc)._state = 0; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)game->_room + this->_gridIndex * 4 + 0x76c) = 0x5dc; } } if ((this->_desc)._state == 1000) { this->_collisionClass = 0; } else { iVar6 = (this->_desc)._variant; this->_collisionClass = 3; if (iVar6 == 1) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar9 = 16.0; } else { fVar9 = 4.0; } GridEntity::hurt_surroundings((GridEntity *)this,22.5,18.5,fVar9,1,0x200,1); fVar9 = sin((float)g_game->_frameCount * 0.25); spriteColor = &(this->_sprite)._color; local_9c = 0; uStack_98 = 0; local_94 = 0; pulseColor[0] = 1.0 - fVar9 * 0.1; pulseColor[1] = 1.0; pulseColor[2] = 1.0; pulseColor[3] = 1.0; if (spriteColor != (ColorMod *)pulseColor) { (this->_sprite)._color._colorize[0] = 0.0; (this->_sprite)._color._colorize[1] = 0.0; (this->_sprite)._color._colorize[2] = 0.0; (this->_sprite)._color._colorize[3] = 0.0; spriteColor->_tint[0] = pulseColor[0]; (this->_sprite)._color._tint[1] = 1.0; (this->_sprite)._color._tint[2] = 1.0; (this->_sprite)._color._tint[3] = 1.0; (this->_sprite)._color._offset[0] = 0.0; (this->_sprite)._color._offset[1] = 0.0; (this->_sprite)._color._offset[2] = 0.0; } } } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying != 0)) goto LAB_00714c16; pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { pbVar5 = &s_empty; } else if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } expectedName = "Appear"; do { bVar2 = *pbVar5; isLess = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_00714b81: uVar3 = -(uint)isLess | 1; goto LAB_00714b86; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; isLess = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_00714b81; pbVar5 = pbVar5 + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00714b86: if (uVar3 != 0) goto LAB_00714c16; pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_00714be2: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"State1",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { animNameCursor = *(byte **)pbVar5; } expectedName = "State1"; do { bVar2 = *animNameCursor; isLess = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_00714bc4: uVar3 = -(uint)isLess | 1; goto LAB_00714bc9; } if (bVar2 == 0) break; bVar2 = animNameCursor[1]; isLess = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_00714bc4; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00714bc9: if ((uVar3 != 0) || ((pbVar5[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00714be2; } if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } LAB_00714c16: playerManager = &g_game->_playerManager; local_45 = '\0'; local_50 = (GridEntity_Poop *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar4 = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; if ((int)pvVar4 - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; } if (local_50 < (uint)((int)pvVar4 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_50; } player = (Entity_Player *)*playerSlot; if (((((player->_variant == 0) && (iVar6 = player->_entityGridCollisionClass, iVar6 != 0)) && (iVar6 != 3)) && ((iVar6 != 1 && (iVar6 != 2)))) && (iVar6 = *(int *)((int)g_game->_room + 0xc), fVar9 = ((float)(this->_gridIndex / iVar6) * 40.0 + 120.0) - (player->_pos).y, fVar7 = ((float)(this->_gridIndex % iVar6) * 40.0 + 40.0) - (player->_pos).x, local_74.y = sqrtf(fVar9 * fVar9 + fVar7 * fVar7), local_74.y < 21.0)) { footprintR = (void *)0x3e1c9c9d; pvStack_68 = (void *)0x3dc8c8c9; pvStack_64 = (void *)0x3db0b0b1; switch((this->_desc)._variant) { case 1: footprintR = (void *)0x3f139394; pvStack_68 = (void *)0x3d909091; pvStack_64 = (void *)0x3de0e0e1; break; default: goto switchD_00714d3f_caseD_2; case 3: footprintR = (void *)0x3f58d8d9; pvStack_68 = (void *)0x3f018182; pvStack_64 = (void *)0x0; break; case 4: local_58 = (void *)0x0; local_4c = (void *)0x0; local_54 = (void *)0x0; uVar3 = Random(); pvStack_64 = local_58; pvStack_68 = local_4c; switch(uVar3 % 6) { case 0: footprintR = (void *)0x3f800000; pvStack_68 = local_58; local_54 = footprintR; break; case 1: pvStack_68 = (void *)0x3f800000; footprintR = (void *)0x3f800000; break; case 2: pvStack_68 = (void *)0x3f800000; footprintR = local_58; local_4c = pvStack_68; break; case 3: pvStack_68 = (void *)0x3f800000; footprintR = local_54; pvStack_64 = (void *)0x3f800000; break; case 4: footprintR = local_4c; pvStack_64 = (void *)0x3f800000; break; case 5: footprintR = (void *)0x3f800000; pvStack_64 = (void *)0x3f800000; break; default: footprintR = (void *)0x3f800000; pvStack_64 = (void *)0x3f800000; pvStack_68 = (void *)0x3f800000; } uStack_84 = 0x3f800000; local_90 = footprintR; pvStack_8c = pvStack_68; pvStack_88 = pvStack_64; break; case 5: footprintR = (void *)0x3da0a0a1; pvStack_68 = (void *)0x3da0a0a1; pvStack_64 = (void *)0x3da0a0a1; break; case 6: footprintR = (void *)0x3ee2e2e3; pvStack_68 = (void *)0x3f3ebebf; pvStack_64 = (void *)0x3f52d2d3; } iStack_60 = 0x3f800000; local_5c = 0; switchD_00714d3f_caseD_2: bVar2 = Entity_Player::is_footstep_triggered(player,-1); if ((bVar2 != 0) && (player->_canFly == 0)) { bVar2 = Entity_Player::is_footstep_triggered(player,0); if (bVar2 == 0) { (player->_footprintColor1)._offset[0] = (float)footprintR; (player->_footprintColor1)._offset[1] = (float)pvStack_68; (player->_footprintColor1)._offset[2] = (float)pvStack_64; } else { (player->_footprintColor2)._offset[0] = (float)footprintR; (player->_footprintColor2)._offset[1] = (float)pvStack_68; (player->_footprintColor2)._offset[2] = (float)pvStack_64; } } if ((this->_isUnderPlayer != 0) && (local_74.y < 20.0)) { this->_collisionClass = 0; local_45 = '\x01'; } } playerManager = &g_game->_playerManager; local_50 = (GridEntity_Poop *)((int)local_50 + 1); } while (local_50 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } if (this->field_0x171 != '\0') { iVar6 = *(int *)((int)g_game->_room + 0xc); local_74.x = (float)(this->_gridIndex % iVar6) * 40.0 + 40.0; local_74.y = (float)(this->_gridIndex / iVar6) * 40.0 + 120.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&pvStack_68,&local_74, 16.0,0xffffffff); uVar3 = 0; if (local_5c != 0) { do { iVar6 = *(int *)((int)pvStack_64 + uVar3 * 4); if (((iVar6 != 0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)(iVar6 + 0x28) == 1)) || (*(int *)(iVar6 + 0x28) - 10U < 0x3de)))) && (3 < *(int *)(iVar6 + 0x184))) { this->_collisionClass = 0; goto LAB_00714fce; } uVar3 = uVar3 + 1; } while (uVar3 < local_5c); } this->field_0x171 = 0; LAB_00714fce: if ((char)pvStack_68 == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (pvStack_64 != (void *)0x0) { uVar3 = *(uint *)((int)pvStack_64 + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)pvStack_64 + -4)); } local_14 = 0xffffffff; } } if (local_45 == '\0') { this->_isUnderPlayer = 0; } if (((this->_desc)._variant == 6) && ((this->_desc)._state != 1000)) { playerManager = &g_game->_playerManager; local_50 = (GridEntity_Poop *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar4 = (playerManager->_playerList)._end; playerIt = (playerManager->_playerList)._begin; if ((int)pvVar4 - (int)playerIt >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; playerIt = (playerManager->_playerList)._begin; } if (local_50 < (uint)((int)pvVar4 - (int)playerIt >> 2)) { playerIt = playerIt + (int)local_50; } fVar9 = *playerIt; iVar6 = *(int *)((int)g_game->_room + 0xc); fVar7 = ((float)(this->_gridIndex / iVar6) * 40.0 + 120.0) - *(float *)((int)fVar9 + 0x340); fVar8 = ((float)(this->_gridIndex % iVar6) * 40.0 + 40.0) - *(float *)((int)fVar9 + 0x33c); local_74.y = fVar9; fVar7 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (fVar7 < *(float *)((int)fVar9 + 0x370) + 70.0) { prevHolyAura = *(int *)((int)fVar9 + 0x1d90); iVar6 = prevHolyAura + 4; if (4 < iVar6) { iVar6 = 4; } *(int *)((int)fVar9 + 0x1d90) = iVar6; if (0 < prevHolyAura != 0 < iVar6) { *(uint *)((int)fVar9 + 0x1574) = *(uint *)((int)fVar9 + 0x1574) | 99; Entity_Player::EvaluateItems(); } } playerManager = &g_game->_playerManager; local_50 = (GridEntity_Poop *)((int)local_50 + 1); } while (local_50 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } ExceptionList = local_1c; return; } //@@ 007151e0 GridEntity_Poop::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity_Poop::Render(GridEntity_Poop *this,float *param_2) { ColorMod *pCVar1; void *pvVar2; float fVar3; int iVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; Vector *pVVar13; AnimationState *this_00; Vector local_44; Vector local_3c; undefined4 local_34 [12]; pvVar2 = g_game->_room; fVar5 = *(float *)((int)pvVar2 + 0x72a4); fVar6 = *(float *)((int)pvVar2 + 0x72a8); fVar7 = *(float *)((int)pvVar2 + 0x72ac); fVar8 = *(float *)((int)pvVar2 + 0x72b0); fVar3 = *(float *)((int)pvVar2 + 0x72cc); fVar9 = *(float *)((int)pvVar2 + 0x72b4); fVar10 = *(float *)((int)pvVar2 + 0x72b8); fVar11 = *(float *)((int)pvVar2 + 0x72bc); fVar12 = *(float *)((int)pvVar2 + 0x72c0); pCVar1 = &(this->_sprite)._color; if (pCVar1 != (ColorMod *)local_34) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar2 + 0x72c4); pCVar1->_tint[0] = fVar5; (this->_sprite)._color._tint[1] = fVar6; (this->_sprite)._color._tint[2] = fVar7; (this->_sprite)._color._tint[3] = fVar8; (this->_sprite)._color._offset[2] = fVar3; (this->_sprite)._color._colorize[0] = fVar9; (this->_sprite)._color._colorize[1] = fVar10; (this->_sprite)._color._colorize[2] = fVar11; (this->_sprite)._color._colorize[3] = fVar12; } iVar4 = (this->_desc)._variant; if (iVar4 - 7U < 4) { if (iVar4 == 9) { pVVar13 = GridEntity::get_render_position((GridEntity *)this,&local_3c); local_44.x = *param_2 + pVVar13->x + 13.0; local_44.y = (pVVar13->y + param_2[1]) - 13.0; ANM2::Render(&this->_sprite,&local_44,&g_vectorZero,&g_vectorZero); return; } } else { pVVar13 = GridEntity::get_render_position((GridEntity *)this,&local_3c); local_44.x = *param_2 + pVVar13->x; local_44.y = pVVar13->y + param_2[1]; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._animState; } AnimationState::Render(this_00,&local_44,&g_vectorZero,&g_vectorZero); } } return; } //@@ 00715330 GridEntity_Poop::Hurt /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 4] */ undefined4 __thiscall GridEntity_Poop::Hurt(GridEntity_Poop *this,int param_2,EntityRef *param_3) { uint *puVar1; int iVar2; char isHurt; byte bVar3; GridEntity_Poop *gigaPart; uint uVar4; std_string *curAnimName; Vector *position; Entity_Player *player; void *ptr; byte *cmpName; int iVar5; int stateDamage; int iVar6; byte *cmpName; int *gigaPartSlot; bool isLess; undefined1 auStack_6c [7]; char isGigaSameAnim; int local_64 [2]; GridEntity_Poop *poop; GridEntity_Poop *local_58; float gibPosY; EntityRef *source; Vector gridPos; void *curAnimNameBuf [5]; uint curAnimNameCapacity; byte stateAnimName [32]; uint local_c; local_c = __security_cookie ^ (uint)auStack_6c; local_58 = (GridEntity_Poop *)0x0; source = param_3; iVar6 = (this->_desc)._variant; poop = this; if ((iVar6 - 7U < 4) && (iVar6 != 9)) { gigaPart = get_giga_part(this,9,0); if (gigaPart == (GridEntity_Poop *)0x0) { return 0; } isHurt = (**(code **)(*(int *)gigaPart + 0x10))(param_2,param_3); if (isHurt == '\0') { return 0; } return 1; } if ((this->_desc)._state == 1000) { return 0; } uVar4 = Random(); iVar6 = param_2 + 1; if (uVar4 % 3 != 0) { iVar6 = param_2; } if (((this->_desc)._variant == 0) && (uVar4 = Random(), uVar4 % 3 == 0)) { iVar6 = iVar6 + 1; } iVar2 = (this->_desc)._variant; if (iVar2 == 3) { uVar4 = Random(); stateDamage = uVar4 % 0x4b + 0x32; } else if (iVar2 == 6) { stateDamage = 0x7d; } else { stateDamage = 0xfa; if (iVar2 == 9) { stateDamage = 0x14; } } stateDamage = stateDamage * iVar6; if (stateDamage < 1) { return 0; } local_64[0] = (this->_desc)._state; if (local_64[0] == 1000) { return 0; } iVar6 = (this->_desc)._variant; iVar2 = this->_gridIndex; iVar5 = *(int *)((int)g_game->_room + 0xc); if (iVar6 - 7U < 4) { gridPos.x = (float)(iVar2 % iVar5) * 40.0 + 40.0 + *(float *)(&DAT_00c5d004 + iVar6 * 8); gridPos.y = (float)(iVar2 / iVar5) * 40.0 + 120.0 + *(float *)(&DAT_00c5d008 + iVar6 * 8); } else { gridPos.x = (float)(iVar2 % iVar5) * 40.0 + 40.0; gridPos.y = (float)(this->_gridIndex / iVar5) * 40.0 + 120.0; } (this->_desc)._state = local_64[0] + stateDamage; if (1000 < local_64[0] + stateDamage) { (this->_desc)._state = 1000; } sprintf_s(stateAnimName,0x1f,(byte *)"State%d"); if ((this->_desc)._variant == 9) { curAnimName = ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState, (std_string *)curAnimNameBuf); cmpName = stateAnimName; local_58 = (GridEntity_Poop *)0x1; do { bVar3 = *cmpName; cmpName = cmpName + 1; } while (bVar3 != 0); puVar1 = &curAnimName->_size; if (0xf < curAnimName->_capacity) { curAnimName = *(std_string **)curAnimName->_buf; } bVar3 = str_eq((byte *)curAnimName,*puVar1,stateAnimName,(int)cmpName - (int)(stateAnimName + 1)) ; if ((bVar3 == 0) || (((this->_sprite)._animState._animData != (void *)0x0 && ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071558c; isGigaSameAnim = '\x01'; } else { LAB_0071558c: isGigaSameAnim = '\0'; } if ((((uint)local_58 & 1) != 0) && (0xf < curAnimNameCapacity)) { uVar4 = curAnimNameCapacity + 1; ptr = curAnimNameBuf[0]; if (0xfff < uVar4) { ptr = *(void **)((int)curAnimNameBuf[0] + -4); uVar4 = curAnimNameCapacity + 0x24; if (0x1f < (uint)((int)curAnimNameBuf[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } if (isGigaSameAnim == '\0') { cmpName = (this->_sprite)._animState._animData; if (cmpName != (byte *)0x0) { if (0xf < *(uint *)(cmpName + 0x14)) { cmpName = *(byte **)cmpName; } cmpName = stateAnimName; do { bVar3 = *cmpName; isLess = bVar3 < *cmpName; if (bVar3 != *cmpName) { LAB_00715650: uVar4 = -(uint)isLess | 1; goto LAB_00715655; } if (bVar3 == 0) break; bVar3 = cmpName[1]; isLess = bVar3 < cmpName[1]; if (bVar3 != cmpName[1]) goto LAB_00715650; cmpName = cmpName + 2; cmpName = cmpName + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00715655: if ((uVar4 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071568d; } bVar3 = ANM2::SetAnimation(&this->_sprite,stateAnimName,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { bVar3 = ANM2::SetAnimation(&this->_sprite,stateAnimName,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,2.0); } } LAB_0071568d: iVar6 = (this->_desc)._variant; iVar2 = (this->_desc)._state; if (iVar6 == 9) { iVar2 = iVar2 / 10; iVar5 = local_64[0] / 10; } else { iVar2 = iVar2 / 0xfa; iVar5 = local_64[0] / 0xfa; } iVar5 = iVar5 + (local_64[0] >> 0x1f); spawn_poop_rewards((this->_desc)._spawnSeed,local_64[0],stateDamage,(this->_desc)._varData == 1, iVar6,source); iVar6 = (this->_desc)._state; if (iVar6 != 1000) { uVar4 = Random(); if (((uVar4 & 1) != 0) || (iVar2 - (iVar5 - (iVar5 >> 0x1f)) < 1)) goto LAB_007157fa; iVar6 = (this->_desc)._state; } uVar4 = (this->_desc)._variant; if ((uVar4 < 7) || (10 < uVar4)) { iVar2 = *(int *)((int)g_game->_room + 0xc); local_58 = (GridEntity_Poop *)((float)(this->_gridIndex % iVar2) * 40.0 + 40.0); gibPosY = (float)(this->_gridIndex / iVar2) * 40.0 + 120.0; } else { iVar2 = *(int *)((int)g_game->_room + 0xc); local_58 = (GridEntity_Poop *) ((float)(this->_gridIndex % iVar2) * 40.0 + 40.0 + *(float *)(&DAT_00c5d004 + uVar4 * 8)); gibPosY = (float)(this->_gridIndex / iVar2) * 40.0 + 120.0 + *(float *)(&DAT_00c5d008 + uVar4 * 8); } spawn_hit_gibs(iVar6 / 0xfa); LAB_007157fa: local_58 = this + 1; EntityRef::operator_((EntityRef *)local_58,source); if ((this->_desc)._state == 1000) { if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 900; } iVar6 = (this->_desc)._variant; this->_collisionClass = 0; if (iVar6 == 1) { this->_reviveTimer = 0x78; } FUN_00718d20(local_64); destroy_effects(); iVar6 = (this->_desc)._varData; uVar4 = (this->_desc)._spawnSeed; iVar2 = (this->_desc)._variant; position = (Vector *)FUN_00718d20(local_64); spawn_drops(position,iVar2,uVar4,iVar6 == 1,0,(EntityRef *)local_58); if ((source->_entity != (Entity *)0x0) && (player = (Entity_Player *)Entity::GetPlayerAncestor(source->_entity), player != (Entity_Player *)0x0)) { Player_stats_add(&g_game->_onlinePlayerStats,0xe,player,1.0); } this = poop; } if ((this->_desc)._variant == 9) { gigaPartSlot = &DAT_00b690e4; do { gigaPart = get_giga_part(this,*gigaPartSlot,0); if (((gigaPart != (GridEntity_Poop *)0x0) && (iVar6 = (this->_desc)._state, (gigaPart->_desc)._state = iVar6, iVar6 == 1000)) && ((uint)gigaPart->_gridIndex < 0x1c0)) { *(undefined4 *)((int)g_game->_room + gigaPart->_gridIndex * 4 + 0x76c) = 900; } gigaPartSlot = gigaPartSlot + 1; } while ((int)gigaPartSlot < 0xb690f0); } return 1; } //@@ 00715940 GridEntity_Poop::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Poop::BeginBatches(GridEntity_Poop *this) { code *pcVar1; byte bVar2; byte bVar3; int *playerSlot; int iVar4; uint uVar5; Entity *pEVar6; EntityConfig_Entity *configEntry; byte *******pppppppbVar7; byte *pbVar8; void *pvVar9; LayerState *spawnLayer; byte *pbVar10; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; std_vector *extraout_ECX; std_vector *psVar11; char *pcVar12; byte *idleAnimName; int iVar13; PlayerManager *playerManager; Manager *manager; EntityConfig *entityConfig; byte *******pppppppbVar14; bool bVar15; float offsetX; float offsetY; undefined4 uVar16; TypeDescriptor *pTVar17; TypeDescriptor *pTVar18; undefined4 uVar19; undefined1 local_1f4 [8]; void *local_1ec; undefined1 local_1e8 [8]; void *local_1e0; undefined1 local_1dc [8]; void *local_1d4; undefined1 local_1d0 [8]; void *local_1c8; Vector effectSpawnPos; Vector flySpawnPos; undefined *local_1b4; GridEntity_Poop *local_1b0; Entity *local_1ac; Game *local_1a8; EntityConfig *local_1a4; byte isUnderPlayer; std_string anm2Path; std_string giantAnm2Path; byte *******spritesheetPathString [4]; uint spritesheetPathSize; uint spritesheetPathCapacity; byte spritesheetPath [256]; byte stateAnimName [32]; byte playStateAnimName [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_1a8 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afcac6; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(playStateAnimName + 0x30); ExceptionList = &local_10; (this->_desc)._varData = 0; *(undefined2 *)&this->_isUnderPlayer = 0; isUnderPlayer = 0; local_1b0 = this; if (*(char *)local_1a8->_room != '\0') { playerManager = &local_1a8->_playerManager; local_1a4 = (EntityConfig *)0x0; isUnderPlayer = 0; if ((int)(local_1a8->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar9 = (playerManager->_playerList)._end; if ((int)pvVar9 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar9 = (playerManager->_playerList)._end; local_1a8 = g_game; } playerSlot = (playerManager->_playerList)._begin; if (local_1a4 < (EntityConfig *)((int)pvVar9 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_1a4; } iVar4 = *playerSlot; if (((((*(int *)(iVar4 + 0x2c) == 0) && (iVar13 = *(int *)(iVar4 + 0x184), iVar13 != 0)) && (iVar13 != 3)) && ((iVar13 != 1 && (iVar13 != 2)))) && (iVar13 = *(int *)((int)local_1a8->_room + 0xc), offsetY = *(float *)(iVar4 + 0x340) - ((float)(this->_gridIndex / iVar13) * 40.0 + 120.0) , offsetX = *(float *)(iVar4 + 0x33c) - ((float)(this->_gridIndex % iVar13) * 40.0 + 40.0), offsetY * offsetY + offsetX * offsetX < 400.0)) { this->_isUnderPlayer = 1; isUnderPlayer = 1; goto LAB_00715af4; } local_1a4 = (EntityConfig *)((int)&(local_1a4->_entities)._head + 1); playerManager = &local_1a8->_playerManager; } while (local_1a4 < (EntityConfig *) ((int)(local_1a8->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); isUnderPlayer = this->_isUnderPlayer; } } LAB_00715af4: iVar4 = 0; if (isUnderPlayer == 0) { iVar4 = 3; } this->_collisionClass = iVar4; iVar4 = (this->_desc)._variant; if (iVar4 == 2) { if ((this->_desc)._state != 1000) { uVar5 = Random(); uVar19 = 0; pTVar18 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; iVar4 = *(int *)((int)g_game->_room + 0xc); pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar16 = 0; flySpawnPos.x = (float)(local_1b0->_gridIndex % iVar4) * 40.0 + 40.0; flySpawnPos.y = (float)(local_1b0->_gridIndex / iVar4) * 40.0 + 120.0; pEVar6 = Game::Spawn(g_game,0x60,0,&flySpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar5); iVar4 = __RTDynamicCast(pEVar6,uVar16,pTVar17,pTVar18,uVar19); local_1a8 = g_game; *(undefined4 *)(iVar4 + 0xb64) = 0; iVar4 = (local_1b0->_desc)._variant; this = local_1b0; goto LAB_00715bc8; } } else { LAB_00715bc8: if ((iVar4 == 1) && ((this->_desc)._state == 1000)) { (this->_desc)._state = 0; } } uVar16 = 0; this->_reviveTimer = 0; if ((this->_desc)._state != 1000) { uVar16 = 0x5dc; } if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)local_1a8->_room + this->_gridIndex * 4 + 0x76c) = uVar16; } manager = g_manager; local_1a4 = (EntityConfig *)0x3e802b00; local_1a8 = (Game *)&g_manager->_entityConfig; _Find_lower_bound<>(local_1d0,&local_1a4); entityConfig = &manager->_entityConfig; if (((*(char *)((int)local_1c8 + 0xd) == '\0') && (*(uint *)((int)local_1c8 + 0x10) < 0x3e802b01)) && (local_1c8 != (entityConfig->_entities)._head)) { configEntry = (EntityConfig_Entity *)((int)local_1c8 + 0x18); } else { configEntry = EntityConfig::GetEntity(entityConfig,1000,0,0); } if (configEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources((EntityConfig *)local_1a8,configEntry); manager = g_manager; } local_1a8 = (Game *)0x3e803a00; local_1a4 = &manager->_entityConfig; _Find_lower_bound<>(local_1dc,&local_1a8); if (((*(char *)((int)local_1d4 + 0xd) == '\0') && (*(uint *)((int)local_1d4 + 0x10) < 0x3e803a01)) && (local_1d4 != (manager->_entityConfig)._entities._head)) { configEntry = (EntityConfig_Entity *)((int)local_1d4 + 0x18); } else { configEntry = EntityConfig::GetEntity(&manager->_entityConfig,1000,0,0); } if (configEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(local_1a4,configEntry); manager = g_manager; } local_1b4 = &DAT_00500a00; local_1a4 = &manager->_entityConfig; _Find_lower_bound<>(local_1e8,&local_1b4); if (((*(char *)((int)local_1e0 + 0xd) == '\0') && (*(undefined **)((int)local_1e0 + 0x10) <= &DAT_00500a00)) && (local_1e0 != (manager->_entityConfig)._entities._head)) { configEntry = (EntityConfig_Entity *)((int)local_1e0 + 0x18); } else { configEntry = EntityConfig::GetEntity(&manager->_entityConfig,5,0,0); } if (configEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(local_1a4,configEntry); manager = g_manager; } local_1ac = (Entity *)&DAT_00501400; entityConfig = &manager->_entityConfig; _Find_lower_bound<>(local_1f4,&local_1ac); if (((*(char *)((int)local_1ec + 0xd) == '\0') && (*(undefined **)((int)local_1ec + 0x10) <= &DAT_00501400)) && (local_1ec != (entityConfig->_entities)._head)) { configEntry = (EntityConfig_Entity *)((int)local_1ec + 0x18); } else { configEntry = EntityConfig::GetEntity(entityConfig,5,0,0); } if (configEntry != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(entityConfig,configEntry); } (this->_rng)._seed = (this->_desc)._spawnSeed; (this->_rng)._shift1 = 5; (this->_rng)._shift2 = 9; (this->_rng)._shift3 = 7; if ((this->_desc)._variant - 7U < 4) { giantAnm2Path._size = 0; giantAnm2Path._capacity = 0xf; giantAnm2Path._buf[0] = '\0'; giantAnm2Path._buf[1] = '\0'; giantAnm2Path._buf[2] = '\0'; giantAnm2Path._buf[3] = '\0'; giantAnm2Path._buf._0_4_ = std::_Allocate(0x20); giantAnm2Path._size = 0x1d; giantAnm2Path._capacity = 0x1f; builtin_strncpy((char *)giantAnm2Path._buf._0_4_,"gfx/grid/grid_poop_giant.anm2",0x1e); local_8 = 0; ANM2::Load(&this->_sprite,&giantAnm2Path,1); local_8 = 0xffffffff; if (0xf < giantAnm2Path._capacity) { uVar5 = giantAnm2Path._capacity + 1; pcVar12 = (char *)giantAnm2Path._buf._0_4_; if (0xfff < uVar5) { pcVar12 = *(char **)(giantAnm2Path._buf._0_4_ + -4); uVar5 = giantAnm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(giantAnm2Path._buf._0_4_ + (-4 - (int)pcVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar5); } giantAnm2Path._size = 0; giantAnm2Path._capacity = 0xf; giantAnm2Path._buf._0_4_ = giantAnm2Path._buf._0_4_ & 0xffffff00; goto LAB_007162ed; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x17; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/grid_poop.anm2",0x18); local_8 = 1; ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar5 = anm2Path._capacity + 1; pcVar12 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar5) { pcVar12 = *(char **)(anm2Path._buf._0_4_ + -4); uVar5 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar5); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; switch((this->_desc)._variant) { case 0: uVar5 = (this->_rng)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_rng)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar5; (this->_rng)._seed = uVar5 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar5; pcVar12 = "gfx/grid/grid_poop_%u.png"; goto LAB_00716065; case 1: uVar5 = (this->_rng)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_rng)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar5; (this->_rng)._seed = uVar5 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar5; pcVar12 = "gfx/grid/grid_poop_red_%u.png"; goto LAB_00716065; case 2: strncpy((char *)spritesheetPath,"gfx/grid/grid_poop_corn.png",0xff); break; case 3: strncpy((char *)spritesheetPath,"gfx/grid/grid_poop_gold.png",0xff); break; case 4: strncpy((char *)spritesheetPath,"gfx/grid/grid_poop_rainbow.png",0xff); break; case 5: strncpy((char *)spritesheetPath,"gfx/grid/grid_poop_black.png",0xff); break; case 6: uVar5 = (this->_rng)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_rng)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar5; (this->_rng)._seed = uVar5 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar5; pcVar12 = "gfx/grid/grid_poop_white_%u.png"; LAB_00716065: sprintf_s(spritesheetPath,0xff,(byte *)pcVar12); break; default: KAGE_LogMessage(0x10,(byte *)"Unknown poop variant: %d"); break; case 0xb: strncpy((char *)spritesheetPath,"gfx/grid/grid_poop_charming.png",0xff); } pbVar8 = spritesheetPath; spritesheetPathSize = 0; spritesheetPathCapacity = 0xf; spritesheetPathString[0] = (byte *******)0x0; do { bVar3 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar3 != 0); std::string::assign((char *)spritesheetPathString,spritesheetPath, (int)pbVar8 - (int)(spritesheetPath + 1)); pppppppbVar14 = spritesheetPathString[0]; local_8 = 2; if ((this->_sprite)._layerCount < 1) { bVar3 = extraout_CL; } else { local_1ac = (this->_sprite)._layerState; psVar11 = &local_1ac->_damageEvents; if (0xf < *(uint *)((int)&local_1ac->_pendingDamageFlags + 4)) { psVar11 = (local_1ac->_damageEvents)._begin; } pppppppbVar7 = (byte *******)spritesheetPathString; if (0xf < spritesheetPathCapacity) { pppppppbVar7 = spritesheetPathString[0]; } bVar2 = str_eq((byte *)pppppppbVar7,spritesheetPathSize,(byte *)psVar11, (uint)local_1ac->_pendingDamageFlags); bVar3 = extraout_CL_00; if (bVar2 == 0) { psVar11 = &local_1ac->_damageEvents; pEVar6 = local_1ac; if (psVar11 != (std_vector *)spritesheetPathString) { pppppppbVar7 = (byte *******)spritesheetPathString; if (0xf < spritesheetPathCapacity) { pppppppbVar7 = pppppppbVar14; } std::string::assign((char *)psVar11,(byte *)pppppppbVar7,spritesheetPathSize); pEVar6 = (this->_sprite)._layerState; psVar11 = extraout_ECX; pppppppbVar14 = spritesheetPathString[0]; } bVar3 = (byte)psVar11; *(undefined1 *)&pEVar6->_subtype = 0; } } local_8 = 0xffffffff; if (0xf < spritesheetPathCapacity) { uVar5 = spritesheetPathCapacity + 1; pppppppbVar7 = pppppppbVar14; if (0xfff < uVar5) { pppppppbVar7 = (byte *******)pppppppbVar14[-1]; uVar5 = spritesheetPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbVar14 + (-4 - (int)pppppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar7,uVar5); bVar3 = extraout_CL_01; } spritesheetPathSize = 0; spritesheetPathCapacity = 0xf; spritesheetPathString[0] = (byte *******)((uint)spritesheetPathString[0] & 0xffffff00); ANM2::LoadGraphics(&this->_sprite,bVar3); LAB_007162ed: iVar4 = (this->_desc)._state; if (iVar4 == 1000) { iVar4 = 4; } else { iVar4 = iVar4 / 0xfa; iVar13 = 3; if (iVar4 < 3) { iVar13 = iVar4; } iVar4 = 0; if (0 < iVar13) { iVar4 = iVar13; } } if (*(char *)g_game->_room == '\0') { sprintf_s(stateAnimName,0x1f,(byte *)"State%d"); pvVar9 = ANM2::GetAnimationData(&this->_sprite,stateAnimName); local_1ac = *(Entity **)((int)pvVar9 + 0x30); bVar3 = ANM2::SetAnimation(&this->_sprite,stateAnimName,1); if (((bVar3 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)local_1ac), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } } else { if (iVar4 == 0) { pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar12 = "Appear"; do { bVar3 = *pbVar8; bVar15 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_00716370: uVar5 = -(uint)bVar15 | 1; goto LAB_00716375; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar15 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_00716370; pbVar8 = pbVar8 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00716375: if ((uVar5 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00716493; } pcVar12 = "Appear"; } else { sprintf_s(playStateAnimName,0x1f,(byte *)"State%d"); pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pbVar10 = playStateAnimName; do { bVar3 = *pbVar8; bVar15 = bVar3 < *pbVar10; if (bVar3 != *pbVar10) { LAB_007163e7: uVar5 = -(uint)bVar15 | 1; goto LAB_007163ec; } if (bVar3 == 0) break; bVar3 = pbVar8[1]; bVar15 = bVar3 < pbVar10[1]; if (bVar3 != pbVar10[1]) goto LAB_007163e7; pbVar8 = pbVar8 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_007163ec: if ((uVar5 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00716493; } pcVar12 = (char *)playStateAnimName; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)pcVar12,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_00716493: uVar5 = (this->_rng)._seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (this->_rng)._seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = uVar5 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar5; (this->_rng)._seed = uVar5; (this->_sprite)._flipX = ~(byte)uVar5 & 1; if ((this->_desc)._variant != 6) { ExceptionList = local_10; return; } spawnLayer = ANM2::GetLayer(&this->_sprite,s_Spawn); if (spawnLayer != (LayerState *)0x0) { (spawnLayer->_color)._colorize[0] = 1.9; (spawnLayer->_color)._colorize[1] = 2.0; (spawnLayer->_color)._colorize[2] = 2.0; (spawnLayer->_color)._colorize[3] = 1.0; (spawnLayer->_color)._offset[0] = 0.1; (spawnLayer->_color)._offset[1] = 0.3; (spawnLayer->_color)._offset[2] = 0.4; } if ((this->_desc)._state == 1000) { ExceptionList = local_10; return; } uVar5 = Random(); iVar4 = *(int *)((int)g_game->_room + 0xc); effectSpawnPos.x = (float)(local_1b0->_gridIndex % iVar4) * 40.0 + 40.0; effectSpawnPos.y = (float)(local_1b0->_gridIndex / iVar4) * 40.0 + 120.0; pEVar6 = Game::Spawn(g_game,1000,0x70,&effectSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar5); local_1ac = pEVar6; if (*(char *)g_game->_room == '\0') { pbVar8 = (pEVar6->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { pbVar10 = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar10 = *(byte **)pbVar8; } idleAnimName = s_Idle; do { bVar3 = *pbVar10; bVar15 = bVar3 < *idleAnimName; if (bVar3 != *idleAnimName) { LAB_00716606: uVar5 = -(uint)bVar15 | 1; goto LAB_0071660b; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar15 = bVar3 < idleAnimName[1]; if (bVar3 != idleAnimName[1]) goto LAB_00716606; pbVar10 = pbVar10 + 2; idleAnimName = idleAnimName + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0071660b: if ((uVar5 == 0) && ((pbVar8[0x34] == 0 || ((pEVar6->_sprite)._animState._isPlaying != 0)))) goto LAB_00716637; } bVar3 = ANM2::SetAnimation(&pEVar6->_sprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(pEVar6->_sprite)._animState); (pEVar6->_sprite)._animState._isPlaying = 1; } } LAB_00716637: (local_1ac->_posOffset).x = 0.0; (local_1ac->_posOffset).y = -4.0; local_1ac->_renderZOffset = 10000; ExceptionList = local_10; return; } //@@ 007166b0 GridEntity_Poop::GetWaterClipInfo /* ZHL [exact] WaterClipInfo* GetWaterClipInfo(WaterClipInfo* out); */ void GridEntity_Poop::GetWaterClipInfo(undefined4 *param_1) { int in_ECX; undefined4 uVar1; uVar1 = 0x26; if (*(int *)(in_ECX + 0xc) != 1000) { uVar1 = 0x39; } *param_1 = uVar1; param_1[1] = 0; return; } //@@ 007166f0 GridEntity_Poop::RespawnRedPoop /* ZHL [lua] Lua binding GridEntityPoop:RespawnRedPoop */ void __thiscall GridEntity_Poop::RespawnRedPoop(GridEntity_Poop *this) { int iVar1; byte bVar2; void *pvVar3; if ((this->_desc)._variant == 1) { (this->_desc)._state = 1000; this->_reviveTimer = 0x78; this->_collisionClass = 0; pvVar3 = ANM2::GetAnimationData(&this->_sprite,(byte *)"State5"); iVar1 = *(int *)((int)pvVar3 + 0x30); bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"State5",1); if ((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar1); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } } return; } //@@ 00716760 GridEntity_Poop::spawn_hit_gibs /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: poop gib particles 1000.58 by variant on a damage stage (room-features) */ void GridEntity_Poop::spawn_hit_gibs(uint param_1) { uint rngResult; uint rngRoll; Entity *pEVar1; ColorMod *extraout_EAX; ColorMod *extraout_EAX_00; Vector *in_ECX; void *seedNode; int in_EDX; void *seedSetHead; int count; float fVar2; double speedRoll; int variant; ColorMod *color; undefined1 findResult [4]; Vector local_74; float local_6c; void **local_68; Color defaultColor; ColorMod gibColor; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if ((int)param_1 < 1) { rngResult = 0; } else { rngResult = Random(); rngResult = rngResult % param_1; } local_68 = &(g_game->_seedEffects)._seedEffects; local_6c = 3.22299e-44; std::set::find_node(findResult,&local_6c); if ((*(char *)((int)local_74.y + 0xd) == '\0') && (*(int *)((int)local_74.y + 0x10) < 0x18)) { seedNode = (void *)local_74.y; seedSetHead = *local_68; } else { seedNode = *local_68; seedSetHead = seedNode; } gibColor._offset[0] = 0.0; gibColor._offset[1] = 0.0; gibColor._offset[2] = 0.0; gibColor._tint[0] = 1.0; gibColor._tint[1] = 1.0; gibColor._tint[2] = 1.0; gibColor._tint[3] = 1.0; count = rngResult + 1; if (seedNode != seedSetHead) { count = (rngResult + 1) * 3; } gibColor._colorize[0] = 0.0; gibColor._colorize[1] = 0.0; gibColor._colorize[2] = 0.0; gibColor._colorize[3] = 0.0; if (in_EDX == 3) { gibColor._tint[0] = 0.5; gibColor._tint[1] = 0.5; gibColor._tint[2] = 0.5; gibColor._offset[0] = 0.55; gibColor._offset[1] = 0.45; LAB_00716828: rngResult = Random(); speedRoll = (double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]; color = &gibColor; } else { if (in_EDX == 1) { gibColor._colorize[0] = 1.0; gibColor._colorize[3] = 0.9; goto LAB_00716828; } if (in_EDX == 4) { if (count < 1) { return; } do { rngResult = Random(); switch(rngResult % 5) { case 0: gibColor._colorize[0] = 1.0; gibColor._colorize[1] = 0.0; gibColor._colorize[2] = 0.0; break; case 1: gibColor._colorize[0] = 0.0; gibColor._colorize[1] = 1.0; gibColor._colorize[2] = 0.0; break; case 2: gibColor._colorize[0] = 0.5; gibColor._colorize[1] = 0.5; gibColor._colorize[2] = 1.0; break; case 3: gibColor._colorize[0] = 1.0; gibColor._colorize[1] = 0.0; gibColor._colorize[2] = 1.0; break; case 4: gibColor._colorize[0] = 1.0; gibColor._colorize[1] = 1.0; gibColor._colorize[2] = 0.0; break; default: goto switchD_0071688e_default; } gibColor._colorize[3] = 1.0; switchD_0071688e_default: rngResult = Random(); rngRoll = Random(); fVar2 = (float)((double)(int)rngRoll + __uint_to_double_fixup[-((int)rngRoll >> 0x1f)]) * 2.3283064e-10 * 3.14; local_68 = (void **)(fVar2 + fVar2); rngRoll = Random(); local_6c = (float)((double)(int)rngRoll + __uint_to_double_fixup[-((int)rngRoll >> 0x1f)]) * 2.3283064e-10 + 2.0; local_74.x = cos((float)local_68); local_74.x = local_74.x * local_6c; fVar2 = sin((float)local_68); local_74.y = fVar2 * 0.5 * local_6c; pEVar1 = Game::Spawn(g_game,1000,0x3a,in_ECX,&local_74,(Entity *)0x0,0,rngResult); (**(code **)(*(int *)pEVar1 + 0x3c))(&gibColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar1 + 0xc))(); count = count + -1; if (count == 0) { return; } } while( true ); } if (in_EDX == 5) { gibColor._colorize[0] = 0.3; gibColor._colorize[1] = 0.3; gibColor._colorize[2] = 0.3; gibColor._colorize[3] = 1.0; goto LAB_00716828; } if (in_EDX == 6) { gibColor._colorize[0] = 1.9; gibColor._colorize[1] = 2.0; gibColor._colorize[2] = 2.0; gibColor._colorize[3] = 1.0; gibColor._offset[0] = 0.1; gibColor._offset[1] = 0.3; gibColor._offset[2] = 0.4; goto LAB_00716828; } if (in_EDX == 0xc) { Color::Color(&defaultColor); rngResult = Random(); speedRoll = (double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]; variant = 0x23; color = extraout_EAX; goto LAB_00716adb; } if (in_EDX == 0xd) { gibColor._colorize[0] = 1.0; gibColor._colorize[1] = 0.2; gibColor._colorize[3] = 0.9; goto LAB_00716828; } if (in_EDX == 0xe) { gibColor._colorize[0] = 0.3; gibColor._colorize[1] = 1.0; gibColor._colorize[2] = 0.2; gibColor._colorize[3] = 0.9; goto LAB_00716828; } Color::Color(&defaultColor); rngResult = Random(); speedRoll = (double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]; color = extraout_EAX_00; } variant = 0x3a; LAB_00716adb: Game::SpawnParticles (g_game,in_ECX,variant,count,(float)speedRoll * 2.3283064e-10 + 2.0,color,100000.0,0); return; } //@@ 00716b10 GridEntity_Poop::destroy_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: break sound 0xed (giga: half pitch), 1000.43 splat, tinted by variant (room-features) */ void GridEntity_Poop::destroy_effects(void) { Manager *pMVar1; ColorMod *color; uint seed; Vector *in_ECX; int in_EDX; int *extraout_EDX; float fVar2; int local_68; float local_64; Color local_60; Color local_34; float local_8; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,5,1); pMVar1 = g_manager; if (in_EDX == 0xc) { local_64 = 1.91978e-43; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_64,1.0,2,0,1.0,0.0); Color::Color(&local_60); Game::SpawnParticles(g_game,in_ECX,4,3,4.0,color,100000.0,0x30001); return; } local_64 = 1.0; if (in_EDX - 7U < 4) { local_64 = 0.5; } local_68 = 0xed; seed_fart_sound_override(&local_68); SoundEffects::Play(&pMVar1->_sfxManager,local_68,0.9,2,0,local_64,0.0); seed = Random(); Game::Spawn(g_game,1000,0x2b,in_ECX,&g_vectorZero,(Entity *)0x0,0,seed); Color::Color(&local_34); if (in_EDX == 6) { local_34._colorize[0] = 1.9; local_34._colorize[1] = 2.0; local_34._colorize[2] = 2.0; local_34._colorize[3] = 1.0; local_34._offset[0] = 0.1; local_34._offset[1] = 0.3; local_34._offset[2] = 0.4; } else if (in_EDX == 1) { local_34._colorize[0] = 1.0; local_34._colorize[1] = 0.0; local_34._colorize[2] = 0.0; local_34._colorize[3] = 0.9; } else if (in_EDX == 3) { local_34._tint[0] = 0.5; local_34._tint[1] = 0.5; local_34._tint[2] = 0.5; local_34._tint[3] = 1.0; local_34._offset[0] = 0.55; local_34._offset[1] = 0.45; local_34._offset[2] = 0.0; } else { if (in_EDX == 5) { local_34._colorize[0] = 0.3; local_34._colorize[1] = 0.3; local_34._colorize[2] = 0.3; local_34._colorize[3] = 1.0; (**(code **)(*extraout_EDX + 0x3c))(&local_34,0xffffffff,0xff,0,1); return; } if (in_EDX == 0xd) { local_34._colorize[0] = 1.0; local_34._colorize[1] = 0.2; local_34._colorize[2] = 0.0; local_34._colorize[3] = 1.0; (**(code **)(*extraout_EDX + 0x3c))(&local_34,0xffffffff,0xff,0,1); return; } if (in_EDX != 0xe) { if (in_EDX - 7U < 4) { fVar2 = g_vectorOne.y * 2.0; extraout_EDX[0x39] = (int)(g_vectorOne.x * 2.0); extraout_EDX[0x3a] = (int)fVar2; } return; } local_34._colorize[0] = 0.3; local_34._colorize[1] = 1.0; local_34._colorize[2] = 0.2; local_34._colorize[3] = 1.0; } (**(code **)(*extraout_EDX + 0x3c))(&local_34,0xffffffff,0xff,0,1); return; } //@@ 00716db0 spawn_poop_rewards /* DB: (seed, x, variant, ...): Dirty Mind 576 owner spawns dips (spawn_dip_at), trinkets 2/22/24 owners roll 5.10 heart / 5.20 coin / 5.350 trinket; called by ENTITY_POOP, Entity::DestroyRockGridAt, GridEntity_Poop::Hurt */ void spawn_poop_rewards(uint param_1,int param_2,int param_3,char param_4,undefined4 param_5, int param_6) { int *piVar1; float fVar2; void *pvVar3; code *pcVar4; bool bVar5; RNG *pRVar6; RNG *pRVar7; byte bVar8; uint uVar9; Entity_Player *pEVar10; Game *pGVar11; uint uVar12; Vector *in_ECX; uint in_EDX; int iVar13; undefined4 *puVar14; Vector *position; Entity *pEVar15; float fVar16; Vector local_48; uint local_40; int local_3c; RNG *local_38; RNG *local_34; uint local_30; Entity_Player *local_2c; undefined4 local_28; int local_24; RNG *local_20; int local_1c; Game *local_18; undefined4 local_14; float local_10; Vector *local_c; char local_5; local_30 = in_EDX; local_c = in_ECX; local_2c = PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0x240,param_1,(RNG **)0x0); if ((local_2c != (Entity_Player *)0x0) || (((6 < in_EDX && (in_EDX < 0xb)) || (in_EDX == 0xb)))) { local_28 = 0x11; local_1c = param_3 + param_2; if (999 < local_1c) { local_1c = 1000; } if (in_EDX - 7 < 4) { param_2 = param_2 / 0x14; iVar13 = local_1c / 0x14; } else { param_2 = param_2 / 0xfa; iVar13 = local_1c / 0xfa; } iVar13 = iVar13 + (local_1c >> 0x1f); local_24 = (iVar13 - (iVar13 >> 0x1f)) - param_2; if (0 < local_24) { if (0 < param_2) { do { if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } param_1 = param_1 >> 5 ^ param_1; param_1 = param_1 << 0xf ^ param_1; param_1 = param_1 >> 0x11 ^ param_1; param_2 = param_2 + -1; } while (param_2 != 0); } local_3c = 0; do { pGVar11 = g_game; if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } param_1 = param_1 >> 5 ^ param_1; param_1 = param_1 << 0xf ^ param_1; param_1 = param_1 >> ((byte)local_28 & 0x1f) ^ param_1; if (local_2c != (Entity_Player *)0x0) { local_20 = (RNG *)0x19; if ((local_3c != local_24 + -1) || (local_1c != 1000)) { pvVar3 = (g_manager->_itemConfig)._trinkets._begin; if (((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar3 & 0xfffffffcU) < 9 ) || ((iVar13 = *(int *)((int)pvVar3 + 8), iVar13 == 0 || ((*(uint *)(iVar13 + 0xb8) & 0x80000000) == 0)))) { local_5 = '\0'; } else { local_5 = '\x01'; } puVar14 = (g_game->_playerManager)._playerList._begin; if (puVar14 != (g_game->_playerManager)._playerList._end) { do { pEVar10 = (Entity_Player *)*puVar14; if (pEVar10->_variant == 0) { bVar8 = Entity_Player::HasTrinket(pEVar10,2,0); if (bVar8 == 0) { if (((local_5 == '\0') || (pEVar10->_backupPlayer == (Entity_Player *)0x0)) || (bVar8 = Entity_Player::HasTrinket(pEVar10->_backupPlayer,2,0), bVar8 == 0)) goto LAB_00716fab; pEVar10 = pEVar10->_backupPlayer; } if (pEVar10 != (Entity_Player *)0x0) goto LAB_00717043; break; } LAB_00716fab: puVar14 = puVar14 + 1; } while (puVar14 != (pGVar11->_playerManager)._playerList._end); } if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = param_1 >> 7 ^ param_1; uVar9 = uVar9 << 0xd ^ uVar9; if (((uVar9 >> ((byte)local_20 & 0x1f) ^ uVar9) & 1) != 0) { in_ECX = local_c; goto LAB_00716ffd; } } LAB_00717043: in_ECX = local_c; spawn_dip_at(local_30,local_c,(Entity *)local_2c,&g_vectorZero); } LAB_00716ffd: if (local_30 == 0xb) { if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(Entity **)(param_6 + 0x24) != (Entity *)0x0)) && (pEVar10 = (Entity_Player *)Entity::GetPlayerAncestor(*(Entity **)(param_6 + 0x24)), pEVar10 != (Entity_Player *)0x0)) || (pEVar10 = Game::GetNearestPlayerEx(in_ECX,1,0,0), pEVar10 != (Entity_Player *)0x0)) { spawn_dip_at(0xb,in_ECX,(Entity *)pEVar10,&g_vectorZero); } } else if ((6 < local_30) && (local_30 < 0xb)) { local_14 = 0x15; if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = param_1 >> 7 ^ param_1; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> 0x15 ^ uVar9; if ((uVar9 & 1) == 0) { local_20 = (RNG *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> 0x15 ^ uVar9; PlayerManager::RandomTrinketOwner(&g_game->_playerManager,0x16,uVar9,&local_20); local_34 = (RNG *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> 0x15 ^ uVar9; PlayerManager::RandomTrinketOwner(&g_game->_playerManager,0x18,uVar9,&local_34); local_38 = (RNG *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; local_40 = uVar9 >> 0x15 ^ uVar9; PlayerManager::RandomCollectibleOwner(&g_game->_playerManager,0xec,local_40,&local_38); local_10 = 0.25; pvVar3 = (g_manager->_itemConfig)._trinkets._begin; local_18 = g_game; if ((((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar3 & 0xfffffffcU) < 0x61) || (iVar13 = *(int *)((int)pvVar3 + 0x60), iVar13 == 0)) || ((*(uint *)(iVar13 + 0xb8) & 0x80000000) == 0)) { bVar5 = false; } else { bVar5 = true; } puVar14 = (g_game->_playerManager)._playerList._begin; if (puVar14 != (g_game->_playerManager)._playerList._end) { pGVar11 = g_game; do { pEVar10 = (Entity_Player *)*puVar14; if (pEVar10->_variant == 0) { bVar8 = Entity_Player::HasTrinket(pEVar10,0x18,0); if (bVar8 == 0) { if (((!bVar5) || (pEVar10->_backupPlayer == (Entity_Player *)0x0)) || (bVar8 = Entity_Player::HasTrinket(pEVar10->_backupPlayer,0x18,0), bVar8 == 0 )) { pGVar11 = local_18; goto LAB_00717259; } pEVar10 = pEVar10->_backupPlayer; } if (pEVar10 != (Entity_Player *)0x0) { iVar13 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x18); local_10 = (float)iVar13 * 0.1 + 0.2; if (local_10 <= 0.25) { local_10 = 0.25; } } break; } LAB_00717259: puVar14 = puVar14 + 1; } while (puVar14 != (pGVar11->_playerManager)._playerList._end); } pGVar11 = g_game; pvVar3 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar3 & 0xfffffffcU) < 9) || (iVar13 = *(int *)((int)pvVar3 + 8), iVar13 == 0)) || ((*(uint *)(iVar13 + 0xb8) & 0x80000000) == 0)) { local_5 = '\0'; } else { local_5 = '\x01'; } puVar14 = (g_game->_playerManager)._playerList._begin; if (puVar14 != (g_game->_playerManager)._playerList._end) { do { pEVar10 = (Entity_Player *)*puVar14; if (pEVar10->_variant == 0) { bVar8 = Entity_Player::HasTrinket(pEVar10,2,0); if (bVar8 == 0) { if (((local_5 == '\0') || (pEVar10->_backupPlayer == (Entity_Player *)0x0)) || (bVar8 = Entity_Player::HasTrinket(pEVar10->_backupPlayer,2,0), bVar8 == 0)) goto LAB_00717333; pEVar10 = pEVar10->_backupPlayer; } if (pEVar10 != (Entity_Player *)0x0) { iVar13 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,2); fVar16 = (float)iVar13 * 0.1 + 0.4; if (fVar16 <= local_10) { fVar16 = local_10; } local_10 = fVar16; goto LAB_00717343; } break; } LAB_00717333: puVar14 = puVar14 + 1; } while (puVar14 != (pGVar11->_playerManager)._playerList._end); } LAB_00717343: pRVar7 = local_20; pRVar6 = local_38; pGVar11 = g_game; if (param_4 != '\0') { local_10 = 0.01; } pEVar15 = (Entity *)0x0; if (local_40 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = local_40 >> 7 ^ local_40; uVar9 = uVar9 << 0x11 ^ uVar9; bVar8 = (byte)local_14; uVar9 = uVar9 >> (bVar8 & 0x1f) ^ uVar9; if (local_10 <= (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10) { if (local_38 != (RNG *)0x0) { uVar12 = local_38->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = pRVar6->_seed; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } pRVar7 = local_20; uVar12 = uVar12 >> ((byte)pRVar6->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)pRVar6->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)pRVar6->_shift3 & 0x1f) ^ uVar12; pRVar6->_seed = uVar12; if ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283062e-10 < local_10) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> ((byte)local_14 & 0x1f) ^ uVar9; if (((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 < 0.01) || (param_4 == '\0')) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> ((byte)local_14 & 0x1f) ^ uVar9; if ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 < 0.25) { if (local_20 != (RNG *)0x0) { uVar12 = local_20->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = pRVar7->_seed; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar12 = uVar12 >> ((byte)pRVar7->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)pRVar7->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)pRVar7->_shift3 & 0x1f) ^ uVar12; pRVar7->_seed = uVar12; if (uVar12 % 5 != 0) goto LAB_00717845; } position = local_c; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; pEVar15 = Game::Spawn(g_game,5,10,local_c,&g_vectorZero,(Entity *)0x0,0, uVar9 >> ((byte)local_14 & 0x1f) ^ uVar9); goto LAB_00717848; } } } } LAB_00717845: position = local_c; } else { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> (bVar8 & 0x1f) ^ uVar9; if (((uVar9 == (uVar9 / 0x14) * 0x14) && (pvVar3 = (g_game->_itemPool)._trinketPoolItems._begin, 0x10 < (int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar3 & 0xfffffff8U))) && ((*(char *)((int)pvVar3 + 0x14) != '\0' && (*(char *)((int)pvVar3 + 0x15) != '\0')) )) { *(undefined1 *)((int)pvVar3 + 0x14) = 0; piVar1 = &(pGVar11->_itemPool)._numAvailableTrinkets; *piVar1 = *piVar1 + -1; uVar9 = Random(); position = local_c; pEVar15 = Game::Spawn(g_game,5,0x15e,local_c,&g_vectorZero,(Entity *)0x0,2,uVar9); } else { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; uVar9 = uVar9 >> (bVar8 & 0x1f) ^ uVar9; if ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 < 0.25) { if (local_20 != (RNG *)0x0) { uVar12 = local_20->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = pRVar7->_seed; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar12 = uVar12 >> ((byte)pRVar7->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)pRVar7->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)pRVar7->_shift3 & 0x1f) ^ uVar12; pRVar7->_seed = uVar12; if (uVar12 % 5 != 0) goto LAB_0071760e; } pRVar6 = local_34; if (local_34 != (RNG *)0x0) { uVar12 = local_34->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = pRVar6->_seed; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar12 = uVar12 >> ((byte)pRVar6->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)pRVar6->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)pRVar6->_shift3 & 0x1f) ^ uVar12; pRVar6->_seed = uVar12; if (uVar12 % 3 != 0) goto LAB_0071760e; } position = local_c; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; pEVar15 = Game::Spawn(g_game,5,10,local_c,&g_vectorZero,(Entity *)0x0,0, uVar9 >> (bVar8 & 0x1f) ^ uVar9); } else { LAB_0071760e: position = local_c; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar9 = uVar9 >> 7 ^ uVar9; uVar9 = uVar9 << 0x11 ^ uVar9; pEVar15 = Game::Spawn(g_game,5,0x14,local_c,&g_vectorZero,(Entity *)0x0,0, uVar9 >> (bVar8 & 0x1f) ^ uVar9); } } } LAB_00717848: Isaac::GetRandomPickupVelocity(&local_48,position,0,(RNG *)0x0); if (pEVar15 != (Entity *)0x0) { fVar16 = (pEVar15->_pos).x; fVar2 = (pEVar15->_pos).y; (pEVar15->_velocity).x = local_48.x; (pEVar15->_velocity).y = local_48.y; (pEVar15->_pos).x = local_48.x + fVar16; (pEVar15->_pos).y = local_48.y + fVar2; } } } local_3c = local_3c + 1; in_ECX = local_c; } while (local_3c < local_24); } } return; } //@@ 007178c0 GridEntity_Poop::spawn_drops /* DB: the poop drop table by variant (0/2/3/6 roll), not MenuManager::Render (room-features) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl GridEntity_Poop::spawn_drops (Vector *position,int variant,uint seed,byte isLowDropChance,byte isNoWisp, EntityRef *source) { code *pcVar1; byte bVar2; Entity_Player *trinketOwner; uint uVar3; void *pvVar4; int *piVar5; byte bVar6; byte bVar7; uint uVar8; undefined4 *playerIt; int iVar9; Game *pGVar10; undefined4 rngShift2; PlayerManager *pPVar11; Entity_Player *pEVar12; float randomAngle; undefined1 auVar13 [12]; Entity *pEVar14; ColorMod cloudColor; EntityRef sourceRef; Vector coinVelocity; Vector lineEnd; int soundId; BitSet128 local_70; RNG *daemonsTailRng; PlayerManager *local_58; Vector dropVelocity; RNG *eColiRng [2]; undefined8 rngShift12; undefined4 local_3c; undefined4 rngShift3; byte isBrownCapActive; Vector *dropPos; Entity *local_2c; int rollsLeft; Game *local_24; int poopVariant; Entity *local_1c; Entity_Player *local_18; byte local_11; Entity *enemy; Manager *manager; int *playerListEnd; Vector *posPtr; RNG *tailRng; rngShift3 = 0x10; local_3c = 0x10; local_1c = (Entity *)&DAT_00000007; rngShift12 = 0x500000001; local_58 = &g_game->_playerManager; local_18 = (Entity_Player *)seed; local_70._4_8_ = 0x700000002; local_70._h._4_4_ = 7; daemonsTailRng = (RNG *)0x0; dropPos = position; poopVariant = variant; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = seed >> 2 ^ seed; uVar8 = uVar8 << 7 ^ uVar8; uVar8 = uVar8 >> 7 ^ uVar8; PlayerManager::RandomTrinketOwner(local_58,0x16,uVar8,&daemonsTailRng); local_24 = (Game *)&g_game->_playerManager; local_58 = (PlayerManager *)0x0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> (local_70._l._4_1_ & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)local_70._h & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_1c & 0x1f) ^ uVar8; PlayerManager::RandomTrinketOwner((PlayerManager *)local_24,0x18,uVar8,(RNG **)&local_58); local_24 = (Game *)&g_game->_playerManager; eColiRng[0] = (RNG *)0x0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> (local_70._l._4_1_ & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)local_70._h & 0x1f) ^ uVar8; PlayerManager::RandomCollectibleOwner ((PlayerManager *)local_24,0xec,uVar8 >> ((byte)local_1c & 0x1f) ^ uVar8,eColiRng); rollsLeft = 1; if (DAT_00c7ac6c != (Entity_Player *)0x0) { bVar2 = Entity_Player::HasCollectible(DAT_00c7ac6c,0x3b,0); rollsLeft = 1; if (bVar2 != 0) { rollsLeft = 3; } } dropVelocity.x = g_vectorZero.x; dropVelocity.y = g_vectorZero.y; iVar9 = poopVariant; rngShift2 = rngShift12._4_4_; pEVar12 = (Entity_Player *)seed; do { pGVar10 = g_game; if (((iVar9 == 0) || (iVar9 == 2)) || (iVar9 == 6)) { local_1c = (Entity *)0x3dcccccd; pvVar4 = (g_manager->_itemConfig)._trinkets._begin; local_24 = g_game; if ((((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 & 0xfffffffcU) < 0x61) || (iVar9 = *(int *)((int)pvVar4 + 0x60), iVar9 == 0)) || ((*(uint *)(iVar9 + 0xb8) & 0x80000000) == 0)) { local_11 = '\0'; } else { local_11 = '\x01'; } playerIt = (g_game->_playerManager)._playerList._begin; if (playerIt != (g_game->_playerManager)._playerList._end) { do { local_18 = (Entity_Player *)*playerIt; if (local_18->_variant == 0) { bVar2 = Entity_Player::HasTrinket(local_18,0x18,0); if (bVar2 == 0) { if (((local_11 == '\0') || (local_18->_backupPlayer == (Entity_Player *)0x0)) || (bVar2 = Entity_Player::HasTrinket(local_18->_backupPlayer,0x18,0), bVar2 == 0)) goto LAB_0071813f; trinketOwner = local_18->_backupPlayer; } else { trinketOwner = local_18; } if (trinketOwner != (Entity_Player *)0x0) { iVar9 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x18); local_1c = (Entity *)((float)iVar9 * 0.1 + 0.2); if ((float)local_1c <= 0.1) { local_1c = (Entity *)0x3dcccccd; } } break; } LAB_0071813f: playerIt = playerIt + 1; } while (playerIt != (local_24->_playerManager)._playerList._end); } local_24 = g_game; pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 & 0xfffffffcU) < 9) || (iVar9 = *(int *)((int)pvVar4 + 8), iVar9 == 0)) || ((*(uint *)(iVar9 + 0xb8) & 0x80000000) == 0)) { local_11 = 0; } else { local_11 = 1; } playerIt = (g_game->_playerManager)._playerList._begin; if (playerIt != (g_game->_playerManager)._playerList._end) { do { local_18 = (Entity_Player *)*playerIt; if (local_18->_variant == 0) { bVar2 = Entity_Player::HasTrinket(local_18,2,0); if (bVar2 == 0) { if (((local_11 == 0) || (local_18->_backupPlayer == (Entity_Player *)0x0)) || (bVar2 = Entity_Player::HasTrinket(local_18->_backupPlayer,2,0), bVar2 == 0)) goto LAB_00718229; trinketOwner = local_18->_backupPlayer; } else { trinketOwner = local_18; } if (trinketOwner != (Entity_Player *)0x0) { iVar9 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,2); pEVar14 = (Entity *)((float)iVar9 * 0.1 + 0.4); if ((float)pEVar14 <= (float)local_1c) { pEVar14 = local_1c; } local_1c = pEVar14; goto LAB_0071823c; } break; } LAB_00718229: playerIt = playerIt + 1; } while (playerIt != (local_24->_playerManager)._playerList._end); } LAB_0071823c: tailRng = daemonsTailRng; pGVar10 = g_game; if (1 < rollsLeft) { auVar13 = ZEXT812(0x3e4ccccd); if (auVar13._0_4_ <= (float)local_1c) { auVar13._4_8_ = auVar13._4_8_; auVar13._0_4_ = local_1c; } local_1c = auVar13._0_4_; } if (isLowDropChance != 0) { local_1c = (Entity *)0x3c23d70a; } if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } bVar2 = (byte)rngShift12; uVar8 = (uint)pEVar12 >> (bVar2 & 0x1f) ^ (uint)pEVar12; bVar6 = (byte)((ulonglong)rngShift12 >> 0x20); uVar8 = uVar8 << (bVar6 & 0x1f) ^ uVar8; bVar7 = (byte)rngShift3; pEVar12 = (Entity_Player *)(uVar8 >> (bVar7 & 0x1f) ^ uVar8); local_18 = pEVar12; if ((float)local_1c <= (float)((double)(int)pEVar12 + __uint_to_double_fixup[-((int)pEVar12 >> 0x1f)]) * 2.3283062e-10) { if (eColiRng[0] != (RNG *)0x0) { uVar8 = eColiRng[0]->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = eColiRng[0]->_seed; if (uVar8 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } tailRng = daemonsTailRng; uVar8 = uVar8 >> ((byte)eColiRng[0]->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)eColiRng[0]->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)eColiRng[0]->_shift3 & 0x1f) ^ uVar8; eColiRng[0]->_seed = uVar8; if ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10 < (float)local_1c) { if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)pEVar12 >> ((byte)rngShift12 & 0x1f) ^ (uint)pEVar12; bVar2 = (byte)((ulonglong)rngShift12 >> 0x20); uVar8 = uVar8 << (bVar2 & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> (bVar7 & 0x1f) ^ uVar8); local_18 = pEVar12; if (((float)((double)(int)pEVar12 + __uint_to_double_fixup[-((int)pEVar12 >> 0x1f)]) * 2.3283062e-10 < 0.01) || (isLowDropChance == 0)) { if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)pEVar12 >> ((byte)rngShift12 & 0x1f) ^ (uint)pEVar12; uVar8 = uVar8 << (bVar2 & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> (bVar7 & 0x1f) ^ uVar8); local_18 = pEVar12; if ((float)((double)(int)pEVar12 + __uint_to_double_fixup[-((int)pEVar12 >> 0x1f)]) * 2.3283062e-10 < 0.25) { if (daemonsTailRng != (RNG *)0x0) { uVar8 = daemonsTailRng->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = tailRng->_seed; if (uVar8 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar8 = uVar8 >> ((byte)tailRng->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)tailRng->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)tailRng->_shift3 & 0x1f) ^ uVar8; tailRng->_seed = uVar8; if (uVar8 % 5 != 0) goto LAB_00717ca8; } if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)pEVar12 >> ((byte)rngShift12 & 0x1f) ^ (uint)pEVar12; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8); uVar8 = 0; goto LAB_0071801d; } } } } LAB_00717ca8: rngShift2 = rngShift12._4_4_; } else { if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)pEVar12 >> (bVar2 & 0x1f) ^ (uint)pEVar12; uVar8 = uVar8 << (bVar6 & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> (bVar7 & 0x1f) ^ uVar8); local_18 = pEVar12; if ((((pEVar12 == (Entity_Player *)(((uint)pEVar12 / 0x14) * 0x14)) && (pvVar4 = (g_game->_itemPool)._trinketPoolItems._begin, 0x10 < (int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar4 & 0xfffffff8U))) && (*(char *)((int)pvVar4 + 0x14) != '\0')) && (*(char *)((int)pvVar4 + 0x15) != '\0')) { *(undefined1 *)((int)pvVar4 + 0x14) = 0; piVar5 = &(pGVar10->_itemPool)._numAvailableTrinkets; *piVar5 = *piVar5 + -1; uVar8 = Random(); Game::Spawn(g_game,5,0x15e,dropPos,&g_vectorZero,(Entity *)0x0,2,uVar8); goto LAB_00717ca8; } if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)pEVar12 >> (bVar2 & 0x1f) ^ (uint)pEVar12; uVar8 = uVar8 << (bVar6 & 0x1f) ^ uVar8; uVar8 = uVar8 >> (bVar7 & 0x1f) ^ uVar8; if (0.25 <= (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10) { LAB_007184fb: if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)rngShift12 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8); uVar8 = 0; uVar3 = 0x14; rngShift2 = rngShift12._4_4_; } else { if (daemonsTailRng != (RNG *)0x0) { uVar3 = daemonsTailRng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = tailRng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)tailRng->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)tailRng->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)tailRng->_shift3 & 0x1f) ^ uVar3; tailRng->_seed = uVar3; if (uVar3 % 5 != 0) goto LAB_007184fb; } pPVar11 = local_58; if (local_58 != (PlayerManager *)0x0) { pvVar4 = (local_58->_playerList)._begin; if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pvVar4 = (pPVar11->_playerList)._begin; if (pvVar4 == (void *)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = (uint)pvVar4 >> ((byte)(pPVar11->_playerList)._end & 0x1f) ^ (uint)pvVar4; uVar3 = uVar3 << ((byte)(pPVar11->_playerList)._capacity & 0x1f) ^ uVar3; pvVar4 = (void *)(uVar3 >> ((byte)pPVar11->_coopSlots[0]._controllerIndex & 0x1f) ^ uVar3); (pPVar11->_playerList)._begin = pvVar4; if ((uint)pvVar4 % 3 != 0) goto LAB_007184fb; } if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)rngShift12 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8); uVar8 = 0; LAB_0071801d: uVar3 = 10; rngShift2 = rngShift12._4_4_; } local_18 = pEVar12; Game::Spawn(g_game,5,uVar3,dropPos,&dropVelocity,(Entity *)0x0,uVar8,(uint)pEVar12); uVar8 = Random(); randomAngle = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_2c = (Entity *)(randomAngle + randomAngle); local_24 = (Game *)cos((float)local_2c); dropVelocity.y = sin((float)local_2c); dropVelocity.y = dropVelocity.y + dropVelocity.y; dropVelocity.x = (float)local_24 + (float)local_24; } iVar9 = poopVariant; } else { if (iVar9 == 3) { if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } bVar2 = (byte)rngShift12; uVar8 = (uint)pEVar12 >> (bVar2 & 0x1f) ^ (uint)pEVar12; uVar8 = uVar8 << ((byte)rngShift2 & 0x1f) ^ uVar8; bVar6 = (byte)rngShift3; uVar8 = uVar8 >> (bVar6 & 0x1f) ^ uVar8; bVar7 = (byte)((ulonglong)rngShift12 >> 0x20); if (((uVar8 != (uVar8 / 3) * 3) || (pvVar4 = (g_game->_itemPool)._trinketPoolItems._begin, (int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar4 & 0xfffffff8U) < 0x1a1)) || ((*(char *)((int)pvVar4 + 0x1a4) == '\0' || (*(char *)((int)pvVar4 + 0x1a5) == '\0')))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> (bVar2 & 0x1f) ^ uVar8; uVar8 = uVar8 << (bVar7 & 0x1f) ^ uVar8; local_18 = (Entity_Player *)(uVar8 >> (bVar6 & 0x1f) ^ uVar8); local_1c = (Entity *)((uint)local_18 % 3 + 5); posPtr = dropPos; pEVar12 = local_18; if (1 < rollsLeft) { if (local_18 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)local_18 >> (bVar2 & 0x1f) ^ (uint)local_18; uVar8 = uVar8 << (bVar7 & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> (bVar6 & 0x1f) ^ uVar8); local_1c = (Entity *)(((uint)pEVar12 & 1) + 2); local_18 = pEVar12; } while( true ) { dropPos = posPtr; if (local_1c == (Entity *)0x0) break; iVar9 = 0; do { uVar8 = Random(); randomAngle = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_24 = (Game *)(randomAngle + randomAngle); randomAngle = cos((float)local_24); local_2c = (Entity *)(randomAngle * 5.0); coinVelocity.y = sin((float)local_24); coinVelocity.y = coinVelocity.y * 5.0; coinVelocity.x = (float)local_2c; lineEnd.x = (float)local_2c * 7.0 + posPtr->x; lineEnd.y = coinVelocity.y * 7.0 + posPtr->y; bVar2 = Room::CheckLine(g_game->_room,posPtr,&lineEnd,1,0,0,0,(Vector *)0x0); if (bVar2 != 0) break; iVar9 = iVar9 + 1; } while (iVar9 < 10); if (local_18 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)local_18 >> ((byte)rngShift12 & 0x1f) ^ (uint)local_18; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8); local_18 = pEVar12; Game::Spawn(g_game,5,0x14,dropPos,&coinVelocity,(Entity *)0x0,0,(uint)pEVar12); local_1c = (Entity *)((int)&local_1c[-1]._luaBridgeRef + 3); posPtr = dropPos; } goto LAB_00717ca8; } *(undefined1 *)((int)pvVar4 + 0x1a4) = 0; piVar5 = &(pGVar10->_itemPool)._numAvailableTrinkets; *piVar5 = *piVar5 + -1; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> (bVar2 & 0x1f) ^ uVar8; uVar8 = uVar8 << (bVar7 & 0x1f) ^ uVar8; Game::Spawn(g_game,5,0x15e,dropPos,&g_vectorZero,(Entity *)0x0,0x34, uVar8 >> (bVar6 & 0x1f) ^ uVar8); break; } if (iVar9 == 4) { if (rollsLeft == 1) { ItemOverlay::Show(&g_game->_itemOverlay,0x1d,0,(Entity_Player *)0x0); manager = g_manager; soundId = 0x10e; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc2,1); uVar8 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00717d8c: pEVar12 = Game::GetPlayer(g_game,uVar8); if (pEVar12->_dead == 0) { pEVar12 = Game::GetPlayer(g_game,uVar8); Entity_Player::SetFullHearts(pEVar12); } } else { local_2c = source->_entity; if (local_2c != (Entity *)0x0) { pEVar12 = Game::GetPlayer(g_game,uVar8); bVar2 = Entity::IsDescendantOf(local_2c,(Entity *)pEVar12); if (bVar2 != 0) goto LAB_00717d8c; } } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); pEVar12 = local_18; } goto LAB_00717ca8; } } else if (iVar9 == 5) { if (rollsLeft == 1) { sourceRef._position.y = g_vectorZero.y; sourceRef._velocity.y = g_vectorZero.y; sourceRef._position.x = g_vectorZero.x; sourceRef._velocity.x = g_vectorZero.x; sourceRef._type = 0; pGVar10 = g_game->_room; sourceRef._variant = 0; sourceRef._spawnerVariant = 0; sourceRef._flags = 0; sourceRef._entity = (void *)0x0; sourceRef._spawnerType = rollsLeft; local_24 = pGVar10; if (source->_entity == (Entity *)0x0) { local_1c = (Entity *)0x0; } else { local_1c = Entity::GetPlayerAncestor(source->_entity); } local_2c = (Entity *)0x0; if (pGVar10->_roomList[0x19].DecorationSeed != 0) { uVar8 = 0; pEVar14 = local_1c; do { enemy = *(Entity **)(*(int *)&pGVar10->_roomList[0x19].PoopCount + uVar8 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (enemy != pEVar14)) { bVar2 = Entity::IsVulnerableEnemy(enemy,(Entity *)0x0); if (bVar2 != 0) { (**(code **)(*(int *)enemy + 0x20))(0x41200000,0,0,&sourceRef,0x1e); Entity::AddConfusion(enemy,&sourceRef,0x3c,0); } pEVar14 = local_1c; } uVar8 = uVar8 + 1; pGVar10 = local_24; } while (uVar8 < (uint)local_24->_roomList[0x19].DecorationSeed); pEVar12 = local_18; } cloudColor._colorize[0] = 0.0; cloudColor._colorize[1] = 0.0; cloudColor._colorize[2] = 0.0; cloudColor._colorize[3] = 1.0; cloudColor._offset[0] = 0.0; cloudColor._offset[1] = 0.0; cloudColor._offset[2] = 0.0; cloudColor._tint[0] = 0.01; cloudColor._tint[1] = 0.01; cloudColor._tint[2] = 0.01; cloudColor._tint[3] = 1.0; Game::start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),&cloudColor); } trinketOwner = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x5b); if (1 < *(int *)&g_game->_deathmatchManager) { if (source->_entity == (Entity *)0x0) goto LAB_00717ca8; trinketOwner = (Entity_Player *)Entity::GetPlayerAncestor(source->_entity); } if (trinketOwner != (Entity_Player *)0x0) { uVar8 = 5; iVar9 = Entity_Player::GetTrinketMultiplier(trinketOwner,0x5b); if (iVar9 == 2) { uVar8 = 7; } else if (iVar9 == 3) { uVar8 = 10; } if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = (uint)pEVar12 >> ((byte)rngShift12 & 0x1f) ^ (uint)pEVar12; bVar2 = (byte)((ulonglong)rngShift12 >> 0x20); uVar3 = uVar3 << (bVar2 & 0x1f) ^ uVar3; pEVar12 = (Entity_Player *)(uVar3 >> ((byte)rngShift3 & 0x1f) ^ uVar3); local_18 = pEVar12; if ((uint)pEVar12 % 100 < uVar8) { if (pEVar12 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)pEVar12 >> ((byte)rngShift12 & 0x1f) ^ (uint)pEVar12; uVar8 = uVar8 << (bVar2 & 0x1f) ^ uVar8; pEVar12 = (Entity_Player *)(uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8); uVar8 = 6; goto LAB_0071801d; } } goto LAB_00717ca8; } } rollsLeft = rollsLeft + -1; } while (0 < rollsLeft); if ((((poopVariant == 0) || (poopVariant == 2)) || (poopVariant == 3)) || (poopVariant == 6)) { pPVar11 = &g_game->_playerManager; playerListEnd = (g_game->_playerManager)._playerList._end; for (piVar5 = (pPVar11->_playerList)._begin; piVar5 != playerListEnd; piVar5 = piVar5 + 1) { iVar9 = *piVar5; if (((*(int *)(iVar9 + 0x2c) == 0) && (*(char *)(iVar9 + 0x202c) == '\0')) && ((*(char *)(iVar9 + 0x20a9) == '\0' && (2 < *(int *)(iVar9 + 0x1800))))) { uVar8 = 0; if ((int)playerListEnd - (int)(pPVar11->_playerList)._begin >> 2 != 0) { do { pvVar4 = (pPVar11->_playerList)._end; if ((int)pvVar4 - (int)(pPVar11->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (pPVar11->_playerList)._end; } pGVar10 = g_game; piVar5 = (pPVar11->_playerList)._begin; if (uVar8 < (uint)((int)pvVar4 - (int)piVar5 >> 2)) { piVar5 = piVar5 + uVar8; } iVar9 = *piVar5; if (((*(char *)(iVar9 + 0x202c) == '\0') && (*(char *)(iVar9 + 0x20a9) == '\0')) && (2 < *(int *)(iVar9 + 0x1800))) { pvVar4 = (g_game->_playerManager)._playerList._end; playerIt = (g_game->_playerManager)._playerList._begin; if ((int)pvVar4 - (int)playerIt >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar4 = (pGVar10->_playerManager)._playerList._end; playerIt = (pGVar10->_playerManager)._playerList._begin; } if (uVar8 < (uint)((int)pvVar4 - (int)playerIt >> 2)) { playerIt = playerIt + uVar8; } Entity_Player::AddHearts((Entity_Player *)*playerIt,1,0,0); } uVar8 = uVar8 + 1; pPVar11 = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar11->_playerList)._begin >> 2)); } break; } } } iVar9 = poopVariant; if (poopVariant == 1) goto LAB_00718a12; local_11 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x56); isBrownCapActive = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x5a); if (1 < *(int *)&g_game->_deathmatchManager) { if ((local_11 == 0) && (isBrownCapActive == 0)) goto LAB_00718a12; if (source->_entity == (Entity *)0x0) goto LAB_00718a12; pEVar12 = (Entity_Player *)Entity::GetPlayerAncestor(source->_entity); if (pEVar12 == (Entity_Player *)0x0) goto LAB_00718a12; local_11 = Entity_Player::HasTrinket(pEVar12,0x56,0); isBrownCapActive = Entity_Player::HasTrinket(pEVar12,0x5a,0); } posPtr = dropPos; if (local_11 != 0) { pEVar12 = Game::GetNearestPlayer(g_game,dropPos); iVar9 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x56); Entity_Player::AddBlueFlies(pEVar12,iVar9,posPtr,(Entity *)0x0); } if (isBrownCapActive != 0) { uVar8 = Random(); Game::Spawn(g_game,1000,1,posPtr,&g_vectorZero,(Entity *)0x0,0,uVar8); Game::spawn_bomb_crater(g_game,posPtr,(Entity *)0x0,1.0); local_70 = g_tearFlagsNone; iVar9 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x5a); Game::BombDamage(g_game,posPtr,(float)iVar9 * 100.0,50.0,0,(Entity *)0x0,local_70,0x204,0); } iVar9 = poopVariant; LAB_00718a12: pEVar12 = DAT_00c7ac6c; if (isNoWisp == 0) { local_70._4_8_ = 0x1100000007; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = seed >> 7 ^ seed; uVar8 = uVar8 << 0x11 ^ uVar8; if (((((uVar8 >> 0x15 ^ uVar8) & 1) == 0) && (DAT_00c7ac6c != (Entity_Player *)0x0)) && (bVar2 = Entity_Player::HasCollectible(DAT_00c7ac6c,0x248,0), bVar2 != 0)) { if (iVar9 == 3) { Entity_Player::AddWisp(pEVar12,0x10002,dropPos,0,0); return; } Entity_Player::AddWisp(pEVar12,0x24,dropPos,0,0); } } return; } //@@ 00718ac0 GridEntity_Poop::get_giga_part /* DB: (variant 7-10, create): the giga poop part of that variant by tile table 0xb690f0 (room-features) prototype: db/protos.zhl, confirmed by RET 8 */ GridEntity_Poop * __thiscall GridEntity_Poop::get_giga_part(GridEntity_Poop *this,int variant,byte isCreate) { Room *this_00; GridEntity *pGVar1; ANM2 *pAVar2; uint uVar3; GridEntity_Poop *pGVar4; GridEntity *this_01; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afcb07; local_10 = ExceptionList; ExceptionList = &local_10; uVar3 = (this->_desc)._variant - 7; uVar5 = variant - 7; if ((uVar3 < 4) && (uVar5 < 4)) { this_00 = g_game->_room; uVar3 = Room::GetGridIndexByTile (this_00,(*(int *)(&DAT_00b690f0 + uVar5 * 8) - *(int *)(&DAT_00b690f0 + uVar3 * 8)) + (uint)this->_gridIndex % (uint)this_00->_gridWidth, (*(int *)(&DAT_00b690f4 + uVar5 * 8) - *(int *)(&DAT_00b690f4 + uVar3 * 8)) + (uint)this->_gridIndex / (uint)this_00->_gridWidth); if (uVar3 < 0x1c0) { pGVar4 = this_00->_gridEntities[uVar3]; if (((pGVar4 != (GridEntity_Poop *)0x0) && ((pGVar4->_desc)._type == 0xe)) && ((pGVar4->_desc)._variant == variant)) { ExceptionList = local_10; return pGVar4; } } else { pGVar4 = (GridEntity_Poop *)0x0; } if (isCreate != 0) { if ((pGVar4 != (GridEntity_Poop *)0x0) && ((pGVar4->_desc)._type == 0xe)) { Room::RemoveGridEntity(this_00,uVar3,0,1); } uVar5 = Random(); if (((int)uVar3 < 0) || (0x1bf < (int)uVar3)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((uVar3 < 0x1c0) && (this_00->_gridPaths[uVar3] < 0x385)) { this_01 = operator_new(0x19c); local_8 = 7; if (this_01 == (GridEntity *)0x0) { this_01 = (GridEntity *)0x0; } else { GridEntity::GridEntity(this_01); *(undefined ***)this_01 = IsaacRepentancePlus::GridEntity_Poop::vftable; this_01[1]._desc._type = 0; this_01[1]._desc._spawnSeed = 0; this_01[1]._desc._varData = 0xf; *(undefined1 *)&this_01[1]._desc._type = 0; this_01[1]._desc._variableSeed = 0; this_01[1]._gridIndex = 0; this_01[1]._spawnFrame = 0; this_01[1]._rng._seed = 0; this_01[1]._rng._shift1 = (int)g_vectorZero.x; this_01[1]._rng._shift2 = (int)g_vectorZero.y; this_01[1]._rng._shift3 = (int)g_vectorZero.x; this_01[1]._collisionClass = (int)g_vectorZero.y; pGVar1 = this_01 + 1; (pGVar1->_sprite)._filename._buf[0] = '\0'; (pGVar1->_sprite)._filename._buf[1] = '\0'; (pGVar1->_sprite)._filename._buf[2] = '\0'; (pGVar1->_sprite)._filename._buf[3] = '\0'; pAVar2 = &this_01[1]._sprite; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; } local_8 = 0xffffffff; if (this_01 != (GridEntity *)0x0) { this_01->_gridIndex = uVar3; (this_01->_desc)._type = 0xe; if (this_00->_gridEntities[uVar3] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this_00->_gridEntities[uVar3])(1); } this_00->_gridEntities[uVar3] = this_01; (this_01->_desc)._variant = variant; (this_01->_desc)._varData = 0; GridEntity::Init(this_01,uVar5); pGVar4 = this_00->_gridEntities[uVar3]; if (((pGVar4 != (GridEntity_Poop *)0x0) && ((pGVar4->_desc)._type == 0xe)) && ((pGVar4->_desc)._variant == variant)) { ExceptionList = local_10; return pGVar4; } } } } } ExceptionList = local_10; return (GridEntity_Poop *)0x0; } //@@ 00718d20 FUN_00718d20 void FUN_00718d20(float *param_1) { int iVar1; int iVar2; int iVar3; int in_ECX; iVar1 = *(int *)(in_ECX + 0x24); if (*(int *)(in_ECX + 8) - 7U < 4) { iVar2 = *(int *)((int)g_game->_room + 0xc); iVar3 = *(int *)(in_ECX + 8); *param_1 = (float)(iVar1 % iVar2) * 40.0 + 40.0 + *(float *)(&DAT_00c5d004 + iVar3 * 8); param_1[1] = (float)(iVar1 / iVar2) * 40.0 + 120.0 + *(float *)(&DAT_00c5d008 + iVar3 * 8); return; } iVar2 = *(int *)((int)g_game->_room + 0xc); *param_1 = (float)(iVar1 % iVar2) * 40.0 + 40.0; param_1[1] = (float)(iVar1 / iVar2) * 40.0 + 120.0; return; } //@@ 00718dd0 GridEntity_Poop::PostInit /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] */ void __thiscall GridEntity_Poop::PostInit(GridEntity_Poop *this) { int iVar1; GridEntity_Poop *pGVar2; GridEntity_Poop *pGVar3; uint uVar4; GridEntity_Poop *local_14 [3]; GridEntity_Poop *local_8; local_8 = (GridEntity_Poop *)(__security_cookie ^ (uint)(local_14 + 4)); if ((this->_desc)._variant == 7) { pGVar2 = get_giga_part(this,8,1); local_14[0] = pGVar2; pGVar3 = get_giga_part(this,9,1); local_14[1] = pGVar3; local_14[2] = get_giga_part(this,10,1); if (((pGVar2 != (GridEntity_Poop *)0x0) && (pGVar3 != (GridEntity_Poop *)0x0)) && (local_14[2] != (GridEntity_Poop *)0x0)) { (pGVar2->_desc)._state = (this->_desc)._state; (pGVar3->_desc)._state = (this->_desc)._state; (local_14[2]->_desc)._state = (this->_desc)._state; return; } iVar1 = *(int *)this; (this->_desc)._variant = 0; (**(code **)(iVar1 + 0x20))(); uVar4 = 0; do { pGVar2 = local_14[uVar4]; if (pGVar2 != (GridEntity_Poop *)0x0) { (pGVar2->_desc)._variant = 0; (pGVar2->_desc)._state = (this->_desc)._state; (**(code **)(*(int *)pGVar2 + 0x20))(); } uVar4 = uVar4 + 1; } while (uVar4 < 3); } return; } //@@ 00718ea0 ItemPool::IdentifyPill /* ZHL [exact] __thiscall void ItemPool::IdentifyPill(uint32_t pillColor); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ItemPool::IdentifyPill(ItemPool *this,uint pillColor) { uint uVar1; uint uVar2; uVar2 = -(uint)((pillColor & 0x7ff) != 0) & pillColor & 0x7ff; uVar1 = 0xe; if (uVar2 < 0xe) { uVar1 = uVar2; } *(undefined1 *)((int)&this[1]._pools[1]._poolList._begin + uVar1) = 1; return; } //@@ 00718ed0 FUN_00718ed0 void FUN_00718ed0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x18) = param_1; return; } //@@ 00718ee0 FUN_00718ee0 undefined4 FUN_00718ee0(void) { int in_ECX; if (in_ECX == 0) { in_ECX = *(int *)((int)g_game->_room + 0x1d18); } switch(in_ECX) { case 4: case 5: case 6: case 0x17: case 0x20: case 0x25: case 0x2e: case 0x3a: case 0x3b: return 2; case 7: case 8: case 9: case 0xe: case 0x10: case 0x1e: case 0x21: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2f: return 3; case 10: case 0xb: case 0xc: case 0xd: case 0x22: case 0x2b: case 0x2c: case 0x30: return 4; default: return 1; case 0x1f: case 0x24: case 0x2d: return 5; } } //@@ 00718f80 GridEntity_Rock::update_collision /* ZHL [exact] __thiscall void GridEntity_Rock::update_collision(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GridEntity_Rock::update_collision(GridEntity_Rock *this) { Game *pGVar1; int iVar2; pGVar1 = g_game; iVar2 = (this->_desc)._state; if ((iVar2 == 1) || (iVar2 == 4)) { this->_collisionClass = 3; iVar2 = this->_collisionClass; if (*(int *)((int)pGVar1->_room + 8) == 0x10) { iVar2 = 4; } if ((this->_desc)._type == 0x18) { iVar2 = 4; } this->_collisionClass = iVar2; } else { if (iVar2 == 2) { this->_collisionClass = 0; return; } if (iVar2 == 3) { this->_collisionClass = 3; return; } } return; } //@@ 00718fe0 GridEntity_Rock::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 2] */ void __thiscall GridEntity_Rock::Update(GridEntity_Rock *this) { Entity *ent; byte bVar1; uint uVar2; Entity_Player *pEVar3; int iVar4; void *collectibleEffect; Entity_Player **ppEVar5; ColorMod *extraout_EAX; ColorMod *color; EntityRef *sourceRef; RoomDescriptor *roomDesc; float *collisionPoint; int iVar6; Entity_Player **ppEVar7; code *extraout_EDX; code *extraout_EDX_00; uint uVar8; Game *game; float fVar9; float fVar10; undefined1 local_90 [8]; float fStack_88; float fStack_84; float local_80; float fStack_7c; float fStack_78; float fStack_74; float local_70; float local_6c; float local_68; Vector rockPos; Vector spawnPos; Entity_Player *local_50 [4]; Color local_40; uint stackCookie; void *local_10; undefined1 *puStack_c; float local_8; Manager *manager; Room *room; local_8 = -NAN; puStack_c = &LAB_00afcb3d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(&local_40)[1]._colorize; ExceptionList = &local_10; iVar4 = (this->_desc)._type; game = g_game; stackCookie = uVar2; if ((iVar4 == 4) || (iVar4 == 0x16)) { LAB_0071905d: if ((this->_desc)._state != 2) { local_50[2] = (Entity_Player *)0x0; local_50[3] = (Entity_Player *)0x0; bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x3e); if (bVar1 != 0) { if (1 < *(int *)&g_game->_deathmatchManager) { pEVar3 = (Entity_Player *)FUN_0090b0e0(uVar2); local_50[3] = (Entity_Player *)0x0; bVar1 = Entity_Player::HasTrinket(pEVar3,0x3e,0); if (bVar1 == 0) goto LAB_007191ab; } iVar6 = 300; iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x3e); manager = g_manager; if (2 < iVar4) { iVar6 = 0x96; } if (*(char *)g_game->_room == '\0') { iVar4 = -1; } else { iVar4 = g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0); } local_50[1] = (Entity_Player *)(iVar4 % iVar6); local_50[3] = (Entity_Player *)0x0; if ((int)local_50[1] < 0xb) { if (local_50[1] == (Entity_Player *)0x0) { local_50[3] = (Entity_Player *)0x3f6; seed_fart_sound_override((int *)(local_50 + 3)); SoundEffects::Play(&manager->_sfxManager,(int)local_50[3],1.0,2,0,1.0,0.0); } uVar2 = (int)((int)local_50[1] - 5U) >> 0x1f; local_50[2] = (Entity_Player *) (1.0 - (float)(int)(((int)local_50[1] - 5U ^ uVar2) - uVar2) / 5.0); local_50[3] = local_50[2]; } } LAB_007191ab: game = g_game; collectibleEffect = TemporaryEffects::GetCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x11f); if (collectibleEffect == (void *)0x0) { pEVar3 = local_50[3]; } else { local_50[0] = (Entity_Player *)0x3f800000; local_50[1] = (Entity_Player *)((float)*(int *)((int)collectibleEffect + 8) / 30.0); ppEVar7 = local_50 + 1; if (1.0 <= (float)local_50[1]) { ppEVar7 = local_50; } ppEVar5 = local_50 + 2; if ((float)local_50[3] < (float)*ppEVar7) { ppEVar5 = ppEVar7; } pEVar3 = *ppEVar5; } if ((float)pEVar3 <= 0.0) { if ((this->_sprite)._color._offset[0] == 0.0) goto LAB_0071926c; Color::Color(&local_40); color = extraout_EAX; } else { local_70 = (float)pEVar3 * 0.3; color = (ColorMod *)local_90; local_80 = 0.0; fStack_7c = 0.0; fStack_78 = 0.0; fStack_74 = 0.0; local_90._0_4_ = 1.0; local_90._4_4_ = 1.0; fStack_88 = 1.0; fStack_84 = 1.0; local_6c = local_70; local_68 = local_70; } Sprite::SetColor((Sprite *)&this->_sprite,color); } } else { if ((g_game->_levelStateFlags & 0x2000U) == 0) { iVar6 = *(int *)((int)g_game->_room + 0x768); } else { iVar6 = -1; } if (((iVar6 == this->_gridIndex) && (iVar4 != 3)) && (iVar4 != 0x18)) goto LAB_0071905d; } LAB_0071926c: if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); game = g_game; } iVar4 = (this->_desc)._state; if ((iVar4 == 1) || (iVar4 == 4)) { iVar4 = (this->_desc)._varData; if (iVar4 != 0) { if (iVar4 == 10) { (this->_desc)._varData = 1; uVar2 = Random(); iVar4 = *(int *)((int)g_game->_room + 0xc); spawnPos.x = (float)(this->_gridIndex % iVar4) * 40.0 + 40.0; spawnPos.y = (float)(this->_gridIndex / iVar4) * 40.0 + 120.0; Game::Spawn(g_game,1000,0xf,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar2); sourceRef = EntityRef::EntityRef((EntityRef *)(local_90 + 4)); (*extraout_EDX_00)(1,sourceRef); game = g_game; } else if (10 < iVar4) { (this->_desc)._varData = iVar4 + -1; } } if (game->_frameCount % 0xf != 0) goto LAB_00719576; uVar2 = Random(); game = g_game; if (uVar2 % 100 == 0) { iVar6 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar4 = 0; if (0 < iVar6) { iVar4 = iVar6; } if (iVar4 < 1) goto LAB_00719576; uVar2 = Random(); local_50[3] = PlayerManager::RandomCollectibleOwner (&game->_playerManager,0x2cd,uVar2,(RNG **)0x0); if (local_50[3] != (Entity_Player *)0x0) { GridEntity::Position((GridEntity *)this,&rockPos); game = g_game; uVar2 = 0; local_40._tint[3] = -26.0; local_40._colorize[0] = 0.0; local_40._colorize[1] = 26.0; local_40._colorize[2] = 0.0; local_40._colorize[3] = 0.0; local_40._offset[0] = -26.0; local_40._offset[1] = 0.0; local_40._offset[2] = 26.0; spawnPos.x = g_vectorZero.x; spawnPos.y = g_vectorZero.y; local_50[2] = (Entity_Player *)0x49742400; do { local_50[0] = (Entity_Player *)(rockPos.x + local_40._tint[uVar2 * 2 + 3]); local_50[1] = (Entity_Player *)(rockPos.y + local_40._colorize[uVar2 * 2]); room = game->_room; iVar6 = (int)(((float)local_50[0] - 40.0) / 40.0 + 0.5); iVar4 = (int)(((float)local_50[1] - 120.0) / 40.0 + 0.5); if (((iVar6 < 0) || (room->_gridWidth <= iVar6)) || ((iVar4 < 0 || (room->_gridHeight <= iVar4)))) { iVar6 = -1; } else { iVar6 = iVar4 * room->_gridWidth + iVar6; } uVar8 = Room::GetGridCollision(room,iVar6); if ((uVar8 == 0) && (fVar9 = (local_50[3]->_pos).x - (float)local_50[0], fVar10 = (local_50[3]->_pos).y - (float)local_50[1], pEVar3 = (Entity_Player *)(fVar10 * fVar10 + fVar9 * fVar9), (float)pEVar3 < (float)local_50[2])) { local_50[2] = pEVar3; spawnPos.x = (float)local_50[0]; spawnPos.y = (float)local_50[1]; } uVar2 = uVar2 + 1; } while (uVar2 < 4); if ((spawnPos.x == g_vectorZero.x) && (spawnPos.y == g_vectorZero.y)) goto LAB_00719576; Entity_Player::AddBlueSpider(local_50[3],&spawnPos); } } } else { if (iVar4 != 3) goto LAB_00719576; iVar4 = this->_frameCnt; this->_frameCnt = iVar4 + -1; if (0 < iVar4) goto LAB_00719576; sourceRef = EntityRef::EntityRef((EntityRef *)(local_90 + 4)); (*extraout_EDX)(0,sourceRef); } game = g_game; LAB_00719576: update_collision(this); if (((this->_desc)._state == 1) && ((this->_desc)._type == 0x19)) { roomDesc = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx,game->_currentDimensionIdx); if ((((uint)roomDesc->Flags >> 1 & 1) == 0) && (bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar1 == 0)) { iVar4 = *(int *)((int)g_game->_room + 0xc); rockPos.x = (float)(this->_gridIndex % iVar4) * 40.0 + 40.0; rockPos.y = (float)(this->_gridIndex / iVar4) * 40.0 + 120.0; local_50[0] = (Entity_Player *)rockPos.x; local_50[1] = (Entity_Player *)rockPos.y; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218), (EntityList_EL *)(local_40._colorize + 3),&rockPos,80.0,0xffffffff); local_8 = 0.0; local_50[2] = (Entity_Player *)0x0; if (local_40._offset[2] != 0.0) { do { ent = *(Entity **)((int)local_40._offset[0] + (int)local_50[2] * 4); if (ent->_entityCollisionClass != 0) { if ((ent->_type == 1) || (ent->_type == 3)) { fVar9 = 21.0; } else { fVar9 = 25.0; } uVar2 = 0; collisionPoint = (ent->_collisionPoints)._begin; uVar8 = (int)(ent->_collisionPoints)._end - (int)collisionPoint >> 3; if (uVar8 != 0) { do { if ((ABS(((ent->_pos).x + *collisionPoint) - (float)local_50[0]) <= fVar9) && (ABS(((ent->_pos).y + collisionPoint[1]) - (float)local_50[1]) <= fVar9)) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar9 = 16.0; } else { fVar9 = 4.0; } GridEntity::hurt_func((GridEntity *)this,ent,fVar9,1,0,1); break; } uVar2 = uVar2 + 1; collisionPoint = collisionPoint + 2; } while (uVar2 < uVar8); } } local_50[2] = (Entity_Player *)((int)local_50[2] + 1); } while (local_50[2] < (uint)local_40._offset[2]); } if (local_40._colorize[3]._0_1_ == '\0') { local_8 = 1.4013e-45; tracked_alloc(1,(void *)local_40._offset[0],0); } } else { (this->_desc)._state = 4; std::string::assign((this->_anim)._buf,(byte *)"spiked_retracted",0x10); std::string::assign((this->_rubbleAnim)._buf,(byte *)"rubble",6); UpdateAnimFrame(this); } } *(int *)(this + 1) = (this->_desc)._state; ExceptionList = local_10; return; } //@@ 007197d0 GridEntity_Rock::Destroy /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] bool Destroy(bool Immediate, EntityRef* Source); */ undefined4 GridEntity_Rock::Destroy(char param_1) { int iVar1; int iVar2; Game *this; uint uVar3; ColorMod *color; GridEntity_Rock *in_ECX; Vector local_3c; Color local_34; float local_8; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); iVar1 = *(int *)((int)g_game->_room + 0xc); local_3c.x = (float)(in_ECX->_gridIndex % iVar1) * 40.0 + 40.0; local_3c.y = (float)(in_ECX->_gridIndex / iVar1) * 40.0 + 120.0; if ((in_ECX->_desc)._state == 1) { RegisterRockDestroyed((in_ECX->_desc)._type); TrySpawnWorms(in_ECX); } this = g_game; iVar1 = (in_ECX->_desc)._type; if (iVar1 == 5) { if (param_1 == '\0') { iVar1 = (in_ECX->_desc)._state; if (iVar1 == 2) { return 0; } if ((iVar1 == 1) || (0 < in_ECX->_frameCnt)) { (in_ECX->_desc)._state = 3; return 1; } if (iVar1 != 3) { return 1; } uVar3 = in_ECX->_gridIndex; (in_ECX->_desc)._state = 2; in_ECX->_collisionClass = 0; if (uVar3 < 0x1c0) { *(undefined4 *)((int)this->_room + uVar3 * 4 + 0x76c) = 900; } Game::BombDamage(this,&local_3c,40.0,62.0,1,(Entity *)0x0,g_tearFlagsNone,4,0); Game::spawn_bomb_crater(g_game,&local_3c,(Entity *)0x0,1.0); uVar3 = Random(); Game::Spawn(g_game,1000,1,&local_3c,&g_vectorZero,(Entity *)0x0,0,uVar3); return 1; } } else if (iVar1 == 0x16) { if ((in_ECX->_desc)._state == 1) { (in_ECX->_desc)._state = 4; std::string::assign((in_ECX->_anim)._buf,(byte *)"ss_broken",9); UpdateAnimFrame(); return 0; } } else { if (iVar1 == 3) { return 0; } if (iVar1 == 0x18) { return 0; } } iVar2 = (in_ECX->_desc)._state; if ((iVar2 != 1) && (iVar2 != 4)) { return 0; } PlayBreakSound(iVar1,0); uVar3 = in_ECX->_gridIndex; (in_ECX->_desc)._state = 2; in_ECX->_collisionClass = 0; if (uVar3 < 0x1c0) { *(undefined4 *)((int)g_game->_room + uVar3 * 4 + 0x76c) = 900; } Color::Color(&local_34); uVar3 = Random(); Game::SpawnParticles(g_game,&local_3c,4,(uVar3 & 1) + 2,5.0,color,100000.0,0); UpdateNeighbors(in_ECX); SpawnDrops(); TrySpawnLadder(in_ECX); grid_mark_neighbors_dirty(in_ECX->_gridIndex); return 1; } //@@ 00719ad0 GridEntity_Rock::Render /* ZHL [vtable slot 3] */ void __thiscall GridEntity_Rock::Render(GridEntity_Rock *this,float *param_2) { byte isAnimSet; Vector *gridRenderPos; std_string *rubbleAnimName; LayerState *layer; AnimationState *secondAnimState; float *rubbleOffset; Vector renderPos; int rubbleFrame; Vector local_c8; float savedOffsetXY [2]; Color roomColor; ColorMod savedColor; float local_58; float fStack_54; float fStack_50; float fStack_4c; float local_48; float fStack_44; float fStack_40; float fStack_3c; ColorMod local_34; int gridState; void *room; float savedOffsetZ; ColorMod *spriteColor; gridRenderPos = GridEntity::get_render_position((GridEntity *)this,&local_c8); spriteColor = &(this->_sprite)._color; savedOffsetZ = (this->_sprite)._color._offset[2]; renderPos.x = gridRenderPos->x + *param_2; renderPos.y = gridRenderPos->y + param_2[1]; room = g_game->_room; savedColor._tint[0] = spriteColor->_tint[0]; savedColor._tint[1] = (this->_sprite)._color._tint[1]; savedColor._tint[2] = (this->_sprite)._color._tint[2]; savedColor._tint[3] = (this->_sprite)._color._tint[3]; savedColor._colorize[0] = (this->_sprite)._color._colorize[0]; savedColor._colorize[1] = (this->_sprite)._color._colorize[1]; savedColor._colorize[2] = (this->_sprite)._color._colorize[2]; savedColor._colorize[3] = (this->_sprite)._color._colorize[3]; savedOffsetXY = *(float (*) [2])(this->_sprite)._color._offset; roomColor._tint[0] = *(float *)((int)room + 0x72a4); roomColor._tint[1] = *(float *)((int)room + 0x72a8); roomColor._tint[2] = *(float *)((int)room + 0x72ac); roomColor._tint[3] = *(float *)((int)room + 0x72b0); roomColor._colorize[0] = *(float *)((int)room + 0x72b4); roomColor._colorize[1] = *(float *)((int)room + 0x72b8); roomColor._colorize[2] = *(float *)((int)room + 0x72bc); roomColor._colorize[3] = *(float *)((int)room + 0x72c0); roomColor._offset[0] = *(float *)((int)room + 0x72c4); roomColor._offset[1] = *(float *)((int)room + 0x72c8); roomColor._offset[2] = *(float *)((int)room + 0x72cc); savedColor._offset._0_8_ = savedOffsetXY; savedColor._offset[2] = savedOffsetZ; local_58 = savedColor._tint[0]; fStack_54 = savedColor._tint[1]; fStack_50 = savedColor._tint[2]; fStack_4c = savedColor._tint[3]; local_48 = savedColor._colorize[0]; fStack_44 = savedColor._colorize[1]; fStack_40 = savedColor._colorize[2]; fStack_3c = savedColor._colorize[3]; Color::__mul(&roomColor,&savedColor); if (spriteColor != &local_34) { spriteColor->_tint[0] = roomColor._tint[0]; (this->_sprite)._color._tint[1] = roomColor._tint[1]; (this->_sprite)._color._tint[2] = roomColor._tint[2]; (this->_sprite)._color._tint[3] = roomColor._tint[3]; (this->_sprite)._color._colorize[0] = roomColor._colorize[0]; (this->_sprite)._color._colorize[1] = roomColor._colorize[1]; (this->_sprite)._color._colorize[2] = roomColor._colorize[2]; (this->_sprite)._color._colorize[3] = roomColor._colorize[3]; (this->_sprite)._color._offset[0] = roomColor._offset[0]; (this->_sprite)._color._offset[1] = roomColor._offset[1]; (this->_sprite)._color._offset[2] = roomColor._offset[2]; } gridState = (this->_desc)._state; if ((gridState == 1) || (gridState == 4)) { if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_sprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } } else if (gridState == 2) { rubbleAnimName = &this->_rubbleAnim; if (0xf < (this->_rubbleAnim)._capacity) { rubbleAnimName = *(std_string **)rubbleAnimName->_buf; } local_c8.x = (float)ANM2::GetAnimationData(&this->_sprite,(byte *)rubbleAnimName); if ((void *)local_c8.x == (void *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] GridEntity_Rock: RubbleAnim %s is NULL\n"); return; } rubbleOffset = (this->_rubbleOffsets)._begin; rubbleFrame = (this->_desc)._variant; if (rubbleOffset != (this->_rubbleOffsets)._end) { do { rubbleFrame = (rubbleFrame + 1) % *(int *)((int)local_c8.x + 0x30); rubbleAnimName = &this->_rubbleAnim; if (0xf < (this->_rubbleAnim)._capacity) { rubbleAnimName = *(std_string **)(this->_rubbleAnim)._buf; } isAnimSet = ANM2::SetAnimation(&this->_sprite,(byte *)rubbleAnimName,1); if (((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)rubbleFrame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); (layer->_pos).x = *rubbleOffset; (layer->_pos).y = rubbleOffset[1]; if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_sprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_sprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } } rubbleOffset = rubbleOffset + 2; } while (rubbleOffset != (this->_rubbleOffsets)._end); } } if (spriteColor != &savedColor) { spriteColor->_tint[0] = local_58; (this->_sprite)._color._tint[1] = fStack_54; (this->_sprite)._color._tint[2] = fStack_50; (this->_sprite)._color._tint[3] = fStack_4c; (this->_sprite)._color._colorize[0] = local_48; (this->_sprite)._color._colorize[1] = fStack_44; (this->_sprite)._color._colorize[2] = fStack_40; (this->_sprite)._color._colorize[3] = fStack_3c; *(float (*) [2])(this->_sprite)._color._offset = savedOffsetXY; (this->_sprite)._color._offset[2] = savedOffsetZ; } return; } //@@ 00719dd0 GridEntity_Rock::RenderTop /* ZHL [exact] __thiscall void GridEntity_Rock::RenderTop(const Vector& pos); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall GridEntity_Rock::RenderTop(GridEntity_Rock *this,Vector *pos) { ColorMod *pCVar1; float fVar2; void *pvVar3; ANM2 *animation; int iVar4; Vector *pVVar5; LayerState *pLVar6; Vector local_d0; float local_c8 [2]; Color local_c0; ColorMod local_8c; Vector local_60; float local_58; float fStack_54; float fStack_50; float fStack_4c; float local_48; float fStack_44; float fStack_40; float fStack_3c; ColorMod local_34; if ((this->_desc)._state != 2) { pVVar5 = GridEntity::get_render_position((GridEntity *)this,&local_60); local_d0.x = pVVar5->x + pos->x; local_d0.y = pVVar5->y + pos->y; if ((this->_desc)._type == 0x18) { local_8c._tint[0] = (this->_sprite)._color._tint[0]; local_8c._tint[1] = (this->_sprite)._color._tint[1]; local_8c._tint[2] = (this->_sprite)._color._tint[2]; local_8c._tint[3] = (this->_sprite)._color._tint[3]; fVar2 = (this->_sprite)._color._offset[2]; pCVar1 = &(this->_sprite)._color; pvVar3 = g_game->_room; local_8c._colorize[0] = (this->_sprite)._color._colorize[0]; local_8c._colorize[1] = (this->_sprite)._color._colorize[1]; local_8c._colorize[2] = (this->_sprite)._color._colorize[2]; local_8c._colorize[3] = (this->_sprite)._color._colorize[3]; local_c8 = *(float (*) [2])(this->_sprite)._color._offset; local_c0._tint[0] = *(float *)((int)pvVar3 + 0x72a4); local_c0._tint[1] = *(float *)((int)pvVar3 + 0x72a8); local_c0._tint[2] = *(float *)((int)pvVar3 + 0x72ac); local_c0._tint[3] = *(float *)((int)pvVar3 + 0x72b0); local_c0._colorize[0] = *(float *)((int)pvVar3 + 0x72b4); local_c0._colorize[1] = *(float *)((int)pvVar3 + 0x72b8); local_c0._colorize[2] = *(float *)((int)pvVar3 + 0x72bc); local_c0._colorize[3] = *(float *)((int)pvVar3 + 0x72c0); local_c0._offset._0_8_ = *(undefined8 *)((int)pvVar3 + 0x72c4); local_c0._offset[2] = *(float *)((int)pvVar3 + 0x72cc); local_8c._offset._0_8_ = local_c8; local_8c._offset[2] = fVar2; local_58 = local_8c._tint[0]; fStack_54 = local_8c._tint[1]; fStack_50 = local_8c._tint[2]; fStack_4c = local_8c._tint[3]; local_48 = local_8c._colorize[0]; fStack_44 = local_8c._colorize[1]; fStack_40 = local_8c._colorize[2]; fStack_3c = local_8c._colorize[3]; Color::__mul(&local_c0,&local_8c); if (pCVar1 != &local_34) { pCVar1->_tint[0] = local_c0._tint[0]; (this->_sprite)._color._tint[1] = local_c0._tint[1]; (this->_sprite)._color._tint[2] = local_c0._tint[2]; (this->_sprite)._color._tint[3] = local_c0._tint[3]; (this->_sprite)._color._colorize[0] = local_c0._colorize[0]; (this->_sprite)._color._colorize[1] = local_c0._colorize[1]; (this->_sprite)._color._colorize[2] = local_c0._colorize[2]; (this->_sprite)._color._colorize[3] = local_c0._colorize[3]; *(undefined8 *)(this->_sprite)._color._offset = local_c0._offset._0_8_; (this->_sprite)._color._offset[2] = local_c0._offset[2]; } pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar6->_visible = 1; pvVar3 = (this->_sprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (animation = (this->_sprite)._animState._animation, 1 < animation->_layerCount)) && (iVar4 = *(int *)((int)pvVar3 + 0x3c), -1 < iVar4)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar4 * 0x10 + *(int *)((int)pvVar3 + 0x18)),&local_d0, *(int *)((int)(this->_sprite)._animState._layerFrames + iVar4 * 4),&g_vectorZero, &g_vectorZero,animation); } pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x1); pLVar6->_visible = 0; if (pCVar1 != &local_8c) { pCVar1->_tint[0] = local_58; (this->_sprite)._color._tint[1] = fStack_54; (this->_sprite)._color._tint[2] = fStack_50; (this->_sprite)._color._tint[3] = fStack_4c; (this->_sprite)._color._colorize[0] = local_48; (this->_sprite)._color._colorize[1] = fStack_44; (this->_sprite)._color._colorize[2] = fStack_40; (this->_sprite)._color._colorize[3] = fStack_3c; *(float (*) [2])(this->_sprite)._color._offset = local_c8; (this->_sprite)._color._offset[2] = fVar2; } } } return; } //@@ 00719f80 GridEntity_Rock::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Rock::BeginBatches(GridEntity_Rock *this) { code *pcVar1; bool bVar2; byte bVar3; int iVar4; uint uVar5; char *pcVar6; LayerState *layer; std_string *animName; void *pvVar7; byte extraout_CL; int iVar8; undefined4 gridPathValue; uint uVar9; uint uVar10; float fVar11; double dVar12; undefined8 rngShift12; Vector rubbleOffset; uint local_4c; int local_48; std_string anm2Path; uint stackCookie; void *local_10; undefined1 *puStack_c; uint local_8; Game *game; float *rubbleOffsetSlot; void **rubbleOffsetsEnd; local_8 = 0xffffffff; puStack_c = &LAB_00afcb7d; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)&(&anm2Path)[1]._size; ExceptionList = &local_10; std::string::assign((this->_anim)._buf,(byte *)"normal",6); std::string::assign((this->_rubbleAnim)._buf,(byte *)"rubble",6); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x17; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/grid_rock.anm2",0x18); local_8 = 0; ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar9 = anm2Path._capacity + 1; pcVar6 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar9) { pcVar6 = *(char **)(anm2Path._buf._0_4_ + -4); uVar9 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar9); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; iVar8 = (int)g_game->_room + 0x1bc8; iVar4 = *(int *)((int)g_game->_room + 0x1d18) * 0x13c + 0x154 + iVar8; if (g_game->_challenge == 0x2d) { uVar9 = g_game->_dungeonPlacementSeed; uVar10 = (this->_desc)._spawnSeed; rngShift12 = 0x700000002; local_48._0_1_ = 0x19; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar10 >> 2 ^ uVar10; uVar5 = uVar5 << 7 ^ uVar5; if ((uVar5 >> 0x19 ^ uVar5) % 10 == 0) { rngShift12 = 0x900000005; local_48._0_1_ = 7; uVar9 = uVar10; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> (sbyte)rngShift12 ^ uVar9; uVar9 = uVar9 << (sbyte)((ulonglong)rngShift12 >> 0x20) ^ uVar9; iVar8 = (int)g_game->_room + ((uVar9 >> (sbyte)local_48 ^ uVar9) % 0x3e) * 0x13c + 0x1e58; if ((iVar8 != 0) && (*(int *)(iVar8 + 0xa0) != 0)) { iVar4 = iVar8; } } bVar3 = (byte)iVar8; if ((this->_sprite)._layerCount != 0) { uVar9 = 0; do { Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar9,(std_string *)(iVar4 + 0x90)); uVar9 = uVar9 + 1; bVar3 = extraout_CL; } while (uVar9 < (uint)(this->_sprite)._layerCount); } animName = &this->_anim; ANM2::LoadGraphics(&this->_sprite,bVar3); local_48 = (this->_desc)._state; bVar2 = false; if (local_48 == 0) { (this->_desc)._state = 1; if ((this->_desc)._variant == 10000) { (this->_desc)._varData = 1; (this->_desc)._variant = 0; } bVar2 = true; local_48 = 1; } iVar4 = this->_gridIndex; if ((-1 < iVar4) && (iVar4 < 0x1c0)) { gridPathValue = 0; if (local_48 == 1) { gridPathValue = 1000; } *(undefined4 *)((int)g_game->_room + iVar4 * 4 + 0x76c) = gridPathValue; local_48 = (this->_desc)._state; } switch((this->_desc)._type) { case 3: pcVar6 = "black"; uVar9 = 5; break; case 4: pcVar6 = "tinted"; uVar9 = 6; break; case 5: std::string::assign(animName->_buf,(byte *)"bombrock",8); this->_frameCnt = (uint)((this->_desc)._state == 1) * 4 + -1; goto LAB_0071a3d7; case 6: std::string::assign(animName->_buf,&DAT_00b66e44,3); pcVar6 = "rubble_alt"; uVar9 = 10; animName = &this->_rubbleAnim; break; default: uVar9 = (this->_desc)._variant; if ((uVar9 < 1000) || ((int)(uVar9 - 1000) < 0)) goto LAB_0071a3d7; pcVar6 = &DAT_00b69228; uVar9 = 3; break; case 0x16: uVar9 = 9; if (local_48 != 4) { uVar9 = 0xc; } pcVar6 = "superspecial"; if (local_48 == 4) { pcVar6 = "ss_broken"; } break; case 0x18: std::string::assign(animName->_buf,(byte *)"pillar",6); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_visible = 0; goto LAB_0071a3d7; case 0x19: uVar10 = 0x10; uVar9 = 6; if (local_48 != 4) { uVar10 = 6; } pcVar6 = "spiked"; if (local_48 == 4) { pcVar6 = "spiked_retracted"; } std::string::assign((this->_anim)._buf,(byte *)pcVar6,uVar10); if (local_48 != 4) { uVar9 = 0xd; } pcVar6 = "rubble_spiked"; if (local_48 == 4) { pcVar6 = "rubble"; } animName = &this->_rubbleAnim; break; case 0x1a: std::string::assign(animName->_buf,&DAT_00b69144,4); pcVar6 = "rubble_alt"; uVar9 = 10; animName = &this->_rubbleAnim; break; case 0x1b: pcVar6 = "foolsgold"; uVar9 = 9; } std::string::assign(animName->_buf,(byte *)pcVar6,uVar9); LAB_0071a3d7: animName = &this->_anim; if (bVar2) { if (0xf < (this->_anim)._capacity) { animName = *(std_string **)animName->_buf; } pvVar7 = ANM2::GetAnimationData(&this->_sprite,(byte *)animName); if (pvVar7 == (void *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] GridEntityRock animation %s is NULL\n"); (this->_desc)._variant = 0; } else { iVar4 = *(int *)((int)g_game->_room + 4); if (iVar4 == 0) { iVar4 = 0; } else { iVar4 = *(int *)(iVar4 + 0x58); } uVar9 = this->_gridIndex + iVar4; uVar9 = uVar9 >> 5 ^ (uVar9 | 1); uVar9 = uVar9 << 9 ^ uVar9; uVar10 = 0; if (*(uint *)((int)pvVar7 + 0x30) != 0) { uVar10 = (uVar9 >> 7 ^ uVar9) % *(uint *)((int)pvVar7 + 0x30); } (this->_desc)._variant = uVar10; } } uVar9 = (this->_desc)._spawnSeed; if ((this->_desc)._state == 2) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> 5 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 7 ^ uVar9; local_4c = (uVar9 & 1) + 1; if (local_4c != 0) { do { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> 5 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 7 ^ uVar9; dVar12 = floor((double)((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 * 16.0)); fVar11 = 8.0 - (float)dVar12; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar9 = uVar9 >> 5 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 7 ^ uVar9; dVar12 = floor((double)((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 * 16.0)); rubbleOffsetSlot = (this->_rubbleOffsets)._end; rubbleOffset.x = 8.0 - (float)dVar12; rubbleOffset.y = fVar11; if (rubbleOffsetSlot == (this->_rubbleOffsets)._capacity) { std::vector::_Emplace_reallocate(rubbleOffsetSlot,&rubbleOffset); } else { *rubbleOffsetSlot = rubbleOffset.x; rubbleOffsetSlot[1] = fVar11; rubbleOffsetsEnd = &(this->_rubbleOffsets)._end; *rubbleOffsetsEnd = (void *)((int)*rubbleOffsetsEnd + 8); } local_4c = local_4c + -1; } while (local_4c != 0); } } animName = &this->_anim; uVar9 = (this->_desc)._variant; if ((uVar9 < 1000) || (local_4c = uVar9 - 1000, (int)(uVar9 - 1000) < 0)) { local_4c = uVar9; } if (0xf < (this->_anim)._capacity) { animName = *(std_string **)animName->_buf; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (((bVar3 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)local_4c), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } game = g_game; iVar4 = (this->_desc)._state; if ((iVar4 == 1) || (iVar4 == 4)) { this->_collisionClass = 3; iVar8 = this->_collisionClass; if (*(int *)((int)game->_room + 8) == 0x10) { iVar8 = 4; } if ((this->_desc)._type == 0x18) { iVar8 = 4; } this->_collisionClass = iVar8; } else if (iVar4 == 2) { this->_collisionClass = 0; } else if (iVar4 == 3) { this->_collisionClass = 3; } *(int *)(this + 1) = iVar4; ExceptionList = local_10; return; } //@@ 0071a760 GridEntity_Rock::PostInit /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] */ void __thiscall GridEntity_Rock::PostInit(GridEntity_Rock *this) { int GridRow; uint uVar1; Room *pRVar2; uint uVar3; void *pvVar4; GridEntity_Rock *pGVar5; uint uVar6; int GridColumn; undefined4 uVar7; RNG local_38; Room *local_28; GridEntity_Rock *local_24; uint local_20 [3]; GridEntity_Rock *local_14 [3]; GridEntity_Rock *local_8; local_8 = (GridEntity_Rock *)(__security_cookie ^ (uint)(local_14 + 4)); local_38._shift1 = 5; local_38._shift2 = 9; local_38._seed = (this->_desc)._spawnSeed; local_38._shift3 = 7; if ((((((this->_desc)._type == 2) && ((this->_desc)._state == 1)) && ((this->_desc)._spawnCount == 1)) && ((uVar3 = (this->_desc)._variant, uVar3 < 1000 || ((int)(uVar3 - 1000) < 0)))) && (local_24 = this, uVar3 = RNG::RandomInt(&local_38,4), uVar3 != 0)) { local_28 = g_game->_room; uVar3 = (uint)this->_gridIndex / (uint)local_28->_gridWidth; uVar6 = (uint)this->_gridIndex % (uint)local_28->_gridWidth; GridRow = uVar6 + 1; local_20[0] = Room::GetGridIndexByTile(local_28,GridRow,uVar3); GridColumn = uVar3 + 1; local_20[1] = Room::GetGridIndexByTile(local_28,uVar6,GridColumn); pRVar2 = local_28; local_20[2] = Room::GetGridIndexByTile(local_28,GridRow,GridColumn); uVar3 = 0; local_14[0] = (GridEntity_Rock *)0x0; uVar6 = 0; local_14[1] = (GridEntity_Rock *)0x0; local_14[2] = (GridEntity_Rock *)0x0; do { uVar1 = local_20[uVar6]; if (-1 < (int)uVar1) { if (uVar1 < 0x1c0) { pvVar4 = pRVar2->_gridEntities[uVar1]; } else { pvVar4 = (void *)0x0; } pGVar5 = (GridEntity_Rock *) __RTDynamicCast(pvVar4,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (((pGVar5 != (GridEntity_Rock *)0x0) && ((pGVar5->_desc)._type == 2)) && ((uVar1 = (pGVar5->_desc)._variant, uVar1 < 1000 || ((int)(uVar1 - 1000) < 0)))) { uVar3 = uVar3 | 1 << (uVar6 & 0x1f); local_14[uVar6] = pGVar5; } } uVar6 = uVar6 + 1; } while (uVar6 < 3); if ((uVar3 == 7) && (uVar6 = RNG::RandomInt(&local_38,4), uVar6 != 0)) { uVar3 = RNG::RandomInt(&local_38,7); uVar3 = 7 - uVar3; } switch(uVar3) { case 1: case 5: SetBigRockFrame(local_24,0); uVar7 = 1; pGVar5 = local_14[0]; break; case 2: case 3: case 6: SetBigRockFrame(local_24,2); uVar7 = 3; pGVar5 = local_14[1]; break; default: goto LAB_0071a909; case 7: SetBigRockFrame(local_24,4); SetBigRockFrame(local_14[0],5); SetBigRockFrame(local_14[1],6); uVar7 = 7; pGVar5 = local_14[2]; } SetBigRockFrame(pGVar5,uVar7); } LAB_0071a909: return; } //@@ 0071a940 GridEntity_Rock::SetBigRockFrame /* ZHL [lua] Lua binding GridEntityRock:SetBigRockFrame */ void __thiscall GridEntity_Rock::SetBigRockFrame(GridEntity_Rock *this,uint param_2) { byte bVar1; uint uVar2; std_string *name; void *pvVar3; int iVar4; uint uVar5; std_string *anim; RNG local_18; anim = &this->_anim; if ((int)param_2 < 0) { std::string::assign(anim->_buf,(byte *)"normal",6); name = anim; if (0xf < (this->_anim)._capacity) { name = *(std_string **)anim->_buf; } pvVar3 = ANM2::GetAnimationData(&this->_sprite,(byte *)name); if (pvVar3 != (void *)0x0) { iVar4 = *(int *)((int)g_game->_room + 4); if (iVar4 == 0) { iVar4 = 0; } else { iVar4 = *(int *)(iVar4 + 0x58); } local_18._seed = this->_gridIndex + iVar4 | 1; local_18._shift1 = 5; local_18._shift2 = 9; local_18._shift3 = 7; uVar2 = RNG::RandomInt(&local_18,*(uint *)((int)pvVar3 + 0x30)); goto LAB_0071a9e9; } KAGE_LogMessage(1,(byte *)"[warn] GridEntityRock animation %s is NULL\n"); uVar2 = 0; (this->_desc)._variant = 0; } else { std::string::assign(anim->_buf,&DAT_00b69228,3); if ((int)param_2 < 1) { param_2 = 0; } uVar2 = 7; if (param_2 < 7) { uVar2 = param_2; } uVar2 = uVar2 + 1000; LAB_0071a9e9: (this->_desc)._variant = uVar2; if ((999 < uVar2) && (uVar5 = uVar2 - 1000, -1 < (int)(uVar2 - 1000))) goto LAB_0071aa1f; } uVar5 = uVar2; LAB_0071aa1f: if (0xf < (this->_anim)._capacity) { anim = *(std_string **)anim->_buf; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)uVar5), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } return; } //@@ 0071aa70 GridEntity_Rock::GetBigRockFrame /* ZHL [lua] Lua binding GridEntityRock:GetBigRockFrame */ int GridEntity_Rock::GetBigRockFrame(void) { int in_ECX; if (*(uint *)(in_ECX + 8) < 1000) { return -1; } return *(uint *)(in_ECX + 8) - 1000; } //@@ 0071aa90 GridEntity_Rock::UpdateAnimFrame /* ZHL [lua] Lua binding GridEntityRock:UpdateAnimFrame */ void __thiscall GridEntity_Rock::UpdateAnimFrame(GridEntity_Rock *this) { uint uVar1; byte bVar2; std_string *anim; uint uVar3; uVar1 = (this->_desc)._variant; if ((uVar1 < 1000) || (uVar3 = uVar1 - 1000, (int)(uVar1 - 1000) < 0)) { uVar3 = uVar1; } anim = &this->_anim; if (0xf < (this->_anim)._capacity) { anim = *(std_string **)anim->_buf; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if ((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)uVar3); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } return; } //@@ 0071aaf0 GridEntity_Rock::UpdateNeighbors /* ZHL [exact] __thiscall void GridEntity_Rock::UpdateNeighbors(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GridEntity_Rock::UpdateNeighbors(GridEntity_Rock *this) { int bigRockPart; uint row; GridEntity_Rock *neighborRock; undefined4 neighborGrid; uint uVar1; uint uVar2; uint rightIndex; uint upIndex; int downRowCheck; uint upRightIndex; int downRow; uint leftIndex; uint upLeftIndex; uint downLeftIndex; int leftColumn; int rightColumn; void *room; int upRow; uVar1 = (this->_desc)._variant; if (uVar1 < 1000) { return; } bigRockPart = uVar1 - 1000; if (bigRockPart < 0) { return; } room = g_game->_room; uVar1 = *(uint *)((int)room + 0xc); row = (uint)this->_gridIndex / uVar1; uVar2 = (uint)this->_gridIndex % uVar1; leftColumn = uVar2 - 1; if ((((leftColumn < 0) || ((int)uVar1 <= leftColumn)) || ((int)row < 0)) || (*(int *)((int)room + 0x10) <= (int)row)) { leftIndex = 0xffffffff; } else { leftIndex = leftColumn + uVar1 * row; } rightColumn = uVar2 + 1; if (((rightColumn < 0) || ((int)uVar1 <= rightColumn)) || (((int)row < 0 || (*(int *)((int)room + 0x10) <= (int)row)))) { rightIndex = 0xffffffff; } else { rightIndex = uVar1 * row + rightColumn; } upRow = row - 1; if ((((int)uVar2 < 0) || ((int)uVar1 <= (int)uVar2)) || ((upRow < 0 || (*(int *)((int)room + 0x10) <= upRow)))) { upIndex = 0xffffffff; if ((-1 < (int)uVar2) && (upIndex = 0xffffffff, (int)uVar2 < (int)uVar1)) goto LAB_0071abe5; LAB_0071abf9: uVar2 = 0xffffffff; } else { upIndex = uVar1 * upRow + uVar2; LAB_0071abe5: downRowCheck = row + 1; if ((downRowCheck < 0) || (*(int *)((int)room + 0x10) <= downRowCheck)) goto LAB_0071abf9; uVar2 = uVar1 * downRowCheck + uVar2; } downRow = row + 1; if ((((leftColumn < 0) || ((int)uVar1 <= leftColumn)) || (upRow < 0)) || (*(int *)((int)room + 0x10) <= upRow)) { upLeftIndex = 0xffffffff; } else { upLeftIndex = uVar1 * upRow + leftColumn; } if (((rightColumn < 0) || ((int)uVar1 <= rightColumn)) || ((upRow < 0 || (*(int *)((int)room + 0x10) <= upRow)))) { upRightIndex = 0xffffffff; } else { upRightIndex = uVar1 * upRow + rightColumn; } if (((leftColumn < 0) || ((int)uVar1 <= leftColumn)) || ((downRow < 0 || (*(int *)((int)room + 0x10) <= downRow)))) { downLeftIndex = 0xffffffff; } else { downLeftIndex = uVar1 * downRow + leftColumn; } if ((((rightColumn < 0) || ((int)uVar1 <= rightColumn)) || (downRow < 0)) || (*(int *)((int)room + 0x10) <= downRow)) { uVar1 = 0xffffffff; } else { uVar1 = uVar1 * downRow + rightColumn; } switch(bigRockPart) { case 0: if (rightIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + rightIndex * 4 + 0x24); break; } goto LAB_0071aec2; case 2: if (0x1bf < uVar2) goto LAB_0071aec2; neighborGrid = *(undefined4 *)((int)room + uVar2 * 4 + 0x24); break; case 3: goto switchD_0071accd_caseD_3; case 4: if (uVar1 < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + uVar1 * 4 + 0x24); } else { neighborGrid = 0; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,1); } if (uVar2 < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + uVar2 * 4 + 0x24); } else { neighborGrid = 0; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,0); } if (0x1bf < rightIndex) goto LAB_0071aec2; neighborGrid = *(undefined4 *)((int)room + rightIndex * 4 + 0x24); break; case 5: if (uVar2 < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + uVar2 * 4 + 0x24); } else { neighborGrid = 0; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,1); } if (downLeftIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + downLeftIndex * 4 + 0x24); } else { neighborGrid = 0; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,0); } case 1: if (leftIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + leftIndex * 4 + 0x24); } else { LAB_0071aec2: neighborGrid = 0; } break; case 6: if (rightIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + rightIndex * 4 + 0x24); } else { neighborGrid = 0; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,3); } if (upRightIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + upRightIndex * 4 + 0x24); } else { LAB_0071ae8e: neighborGrid = 0; } goto LAB_0071ae90; case 7: if (leftIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + leftIndex * 4 + 0x24); } else { neighborGrid = 0; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,3); } if (0x1bf < upLeftIndex) goto LAB_0071ae8e; neighborGrid = *(undefined4 *)((int)room + upLeftIndex * 4 + 0x24); LAB_0071ae90: neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,2); } switchD_0071accd_caseD_3: if (upIndex < 0x1c0) { neighborGrid = *(undefined4 *)((int)room + upIndex * 4 + 0x24); break; } goto LAB_0071aec2; default: goto switchD_0071accd_default; } neighborRock = (GridEntity_Rock *) __RTDynamicCast(neighborGrid,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (neighborRock != (GridEntity_Rock *)0x0) { SetBigRockFrame(neighborRock,0xffffffff); } switchD_0071accd_default: return; } //@@ 0071af10 GridEntity_Rock::RegisterRockDestroyed /* ZHL [exact] static cleanup void GridEntity_Rock::RegisterRockDestroyed(int GridEntityType); prototype: REPENTOGON */ void __cdecl GridEntity_Rock::RegisterRockDestroyed(int GridEntityType) { if (GridEntityType != 3) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,2,1); if (GridEntityType == 4) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,3,1); return; } if (GridEntityType == 0x16) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,4,1); } } return; } //@@ 0071af60 GridEntity_Rock::TrySpawnWorms /* ZHL [exact] __thiscall void GridEntity_Rock::TrySpawnWorms(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GridEntity_Rock::TrySpawnWorms(GridEntity_Rock *this) { int iVar1; code *pcVar2; uint uVar3; uint seed; uint uVar4; Entity *pEVar5; float fVar6; undefined1 local_20 [12]; float local_14; float local_10; float local_c; float local_8; local_20._4_4_ = 2; local_20._8_4_ = 7; local_20._0_4_ = (this->_desc)._spawnSeed; iVar1 = *(int *)((int)g_game->_room + 0xc); local_14 = 1.26117e-44; local_8 = (float)(this->_gridIndex % iVar1) * 40.0 + 40.0; local_10 = (float)(this->_gridIndex / iVar1) * 40.0 + 120.0; if (local_20._0_4_ == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } local_20._0_4_ = (uint)local_20._0_4_ >> 2 ^ local_20._0_4_; local_20._0_4_ = local_20._0_4_ << 7 ^ local_20._0_4_; local_20._0_4_ = (uint)local_20._0_4_ >> 9 ^ local_20._0_4_; if ((((local_20._0_4_ == ((uint)local_20._0_4_ / 0x32) * 0x32) && (iVar1 = (this->_desc)._type, iVar1 != 3)) && (iVar1 != 0x18)) && ((iVar1 != 6 && (iVar1 != 0x1a)))) { uVar3 = RNG::RandomInt((RNG *)local_20,5); uVar3 = RNG::RandomInt((RNG *)local_20,uVar3 + 1); if (0 < (int)uVar3) { do { seed = Random(); uVar4 = Random(); local_c = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c = local_c + local_c; fVar6 = cos(local_c); local_20._8_4_ = fVar6 * 20.0 + local_8; fVar6 = sin(local_c); local_14 = fVar6 * 20.0 + local_10; pEVar5 = Game::Spawn(g_game,1000,0x3f,(Vector *)(local_20 + 8),&g_vectorZero,(Entity *)0x0,0 ,seed); (**(code **)(*(int *)pEVar5 + 0xc))(); uVar3 = uVar3 - 1; } while (uVar3 != 0); } } return; } //@@ 0071b100 GridEntity_Rock::PlayBreakSound /* ZHL [exact] static cleanup void GridEntity_Rock::PlayBreakSound(int GridEntityType, int BackdropType); prototype: REPENTOGON */ void __cdecl GridEntity_Rock::PlayBreakSound(int GridEntityType,int BackdropType) { Manager *pMVar1; int iVar2; int local_8; if ((GridEntityType == 6) || (GridEntityType == 0x1a)) { local_8 = GridEntityType; iVar2 = FUN_00718ee0(); local_8 = *(int *)(&DAT_00b1f3b8 + iVar2 * 4); } else { iVar2 = *(int *)((int)g_game->_room + 0x1d18); if (((((iVar2 == 10) || (iVar2 == 0xb)) || (iVar2 == 0xc)) || ((iVar2 == 0xd || (iVar2 == 0x22)))) || ((iVar2 == 0x2b || ((iVar2 == 0x2c || (iVar2 == 0x30)))))) { local_8 = 0x4d; } else { local_8 = 0x89; } } pMVar1 = g_manager; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.0,2,0,1.0,0.0); return; } //@@ 0071b1c0 GridEntity_Rock::TrySpawnLadder /* ZHL [exact] __thiscall bool GridEntity_Rock::TrySpawnLadder(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall GridEntity_Rock::TrySpawnLadder(GridEntity_Rock *this) { Entity_Player *this_00; void *pvVar1; Game *pGVar2; byte bVar3; int iVar4; uint uVar5; uint Seed; uint uVar6; GridEntity *this_01; void *pvVar7; undefined4 *puVar8; RNG *this_02; Room *this_03; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar2 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afcbc7; local_10 = ExceptionList; ExceptionList = &local_10; if ((this->_desc)._type != 3) { puVar8 = (g_game->_playerManager)._playerList._begin; if (puVar8 != (g_game->_playerManager)._playerList._end) { do { this_00 = (Entity_Player *)*puVar8; if ((this_00->_variant == 0) && (bVar3 = Entity_Player::HasTrinket(this_00,0x4a,0), bVar3 != 0)) { pvVar7 = (this_00->_trinketRNGs)._end; if ((int)pvVar7 - (int)(this_00->_trinketRNGs)._begin >> 4 < 0x4b) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar7 = (this_00->_trinketRNGs)._end; } pvVar1 = (this_00->_trinketRNGs)._begin; uVar5 = ((int)pvVar7 - (int)pvVar1 >> 4) - 1; if (0x4a < uVar5) { uVar5 = 0x4a; } this_02 = (RNG *)(uVar5 * 0x10 + (int)pvVar1); goto LAB_0071b23a; } puVar8 = puVar8 + 1; } while (puVar8 != (pGVar2->_playerManager)._playerList._end); } this_02 = (RNG *)0x0; LAB_0071b23a: if (-1 < g_game->_currentRoomIdx) { if ((g_game->_levelStateFlags & 0x2000U) == 0) { iVar4 = *(int *)((int)g_game->_room + 0x768); } else { iVar4 = -1; } if (iVar4 == this->_gridIndex) goto LAB_0071b300; } if (((g_game->_levelStateFlags & 0x2000U) == 0) && (this_02 != (RNG *)0x0)) { iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x4a); uVar5 = RNG::RandomInt(this_02,(uint)(200 / (longlong)iVar4)); if (uVar5 == 0) { LAB_0071b300: pGVar2 = g_game; this_03 = g_game->_room; if ((((uint)this->_gridIndex < 0x1c0) && (pvVar7 = this_03->_gridEntities[this->_gridIndex], pvVar7 != (void *)0x0)) && (0 < *(int *)((int)pvVar7 + 0x3c))) { *(undefined4 *)((int)pvVar7 + 0x3c) = 0; this_03 = pGVar2->_room; } Seed = Random(); uVar5 = this->_gridIndex; if (((int)uVar5 < 0) || (0x1bf < (int)uVar5)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((uVar5 < 0x1c0) && (uVar6 = Room::GetGridCollision(this_03,uVar5), (int)uVar6 < 1)) { this_01 = operator_new(0x154); local_8 = 0x11; if (this_01 == (GridEntity *)0x0) { this_01 = (GridEntity *)0x0; } else { GridEntity::GridEntity(this_01); *(undefined ***)this_01 = IsaacRepentancePlus::GridEntity_Stairs::vftable; } local_8 = 0xffffffff; if (this_01 != (GridEntity *)0x0) { (this_01->_desc)._type = 0x12; this_01->_gridIndex = uVar5; if (this_03->_gridEntities[uVar5] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this_03->_gridEntities[uVar5])(1); } this_03->_gridEntities[uVar5] = this_01; (this_01->_desc)._variant = 0; (this_01->_desc)._varData = 0; GridEntity::Init(this_01,Seed); } } g_game->_levelStateFlags = g_game->_levelStateFlags | 0x2000; ExceptionList = local_10; return 1; } } } ExceptionList = local_10; return 0; } //@@ 0071b410 GridEntity_Rock::SpawnDrops /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: zhl SpawnDrops(pos,type,variant,seed,unk,backdrop); "Unknown alt rock type"; called from GridEntity_Rock::Destroy and Entity::DestroyRockGridAt */ void GridEntity_Rock::SpawnDrops (int param_1,Entity_Player *param_2,char param_3,int param_4,EntityPtr param_5) { int iVar1; code *pcVar2; EntityRef source; Vector targetPos; Vector targetPos_00; float fVar3; byte bVar4; uint uVar5; Entity *spawned; Entity_Player *pEVar6; uint uVar7; ColorMod *color; int *piVar8; Vector *throwVec; Entity_Player *pEVar9; byte bVar10; byte bVar11; char cVar12; Vector *in_ECX; EntityPtr ancestor; ColorMod *rng; ColorMod *extraout_ECX; ColorMod *extraout_ECX_00; PlayerManager *playerManager; void *pvVar13; int in_EDX; uint uVar14; undefined4 *puVar15; float fVar16; float fVar17; undefined4 uVar18; int iVar19; TypeDescriptor *pTVar20; TypeDescriptor *pTVar21; undefined4 uVar22; Vector striderTarget; Vector leechTarget; EntityRef fartSource; Vector coinVelocity2; Vector coinVelocity; Vector coinVelocity3; Vector projPos; Vector projVelocity; Vector spiderTarget2; Vector pickupPos; Vector ringProjVelocity; Vector maggotVelocity; Vector spiderTarget; Vector coinPos; RNG wispRng; Vector pickupVelocity; undefined8 local_11c; undefined4 local_114; RNG velocityRng; Vector dropVelocity; Vector dropVelocity2; EntityPtr sourceEntity; uint initialSeed; Vector spawnVelocity; int altRockType; Vector *positionCopy; Entity_Player *local_d8; Entity_Player *local_d4; int local_d0; char isMinesStage; ItemPool *itemPool; int rollCount; Game *local_c0; Entity_Player *local_bc; int gridType; RNG *local_b4; PlayerManager *local_b0; RNG dropRng; char isSpecialBackdrop; Game *local_98; int rngShift3; Entity_Player *local_90; Entity_Player *local_8c; Entity_Player *local_88; char local_81; Color fartColor; ColorMod effectColor; undefined1 local_28 [16]; undefined4 local_18; undefined4 local_14; Game *game; local_14 = __security_cookie ^ (uint)(local_28 + 0x18); sourceEntity = param_5; rngShift3 = 7; dropRng._shift3 = 7; dropRng._shift1 = 5; dropRng._shift2 = 9; local_d0 = 7; local_114 = 7; local_11c = 0x700000002; velocityRng._shift3 = 0x1d; initialSeed = (uint)param_2; local_88 = param_2; dropRng._seed = (int)param_2; local_d8 = param_2; velocityRng._seed = (int)param_2; velocityRng._shift1 = 1; velocityRng._shift2 = 9; if (param_4 == 0) { param_4 = *(int *)((int)g_game->_room + 0x1d18); } positionCopy = in_ECX; gridType = in_EDX; altRockType = FUN_00718ee0(); local_98 = g_game; if (g_game->_challenge == 0x2c) { uVar5 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); LAB_0071b52f: uVar5 = RoomConfig::GetStageID(local_98->_stage,uVar5,-1); if ((uVar5 == 0x1d) || (uVar5 == 0x1e)) { isMinesStage = '\x01'; goto LAB_0071b555; } } else if (g_game->_currentDimensionIdx != 2) { uVar5 = g_game->_stageType; goto LAB_0071b52f; } isMinesStage = '\0'; LAB_0071b555: if ((((param_4 == 0x22) || (param_4 == 0x2b)) || (param_4 == 0x2c)) || (isSpecialBackdrop = '\0', param_4 == 0x30)) { isSpecialBackdrop = '\x01'; } itemPool = &g_game->_itemPool; rollCount = 1; local_d4 = DAT_00c7ac6c; if (DAT_00c7ac6c != (Entity_Player *)0x0) { bVar4 = Entity_Player::HasCollectible(DAT_00c7ac6c,0x3b,0); rollCount = 1; if (bVar4 != 0) { rollCount = 3; } } spawnVelocity.x = g_vectorZero.x; spawnVelocity.y = g_vectorZero.y; do { local_bc = (Entity_Player *)rollCount; if (gridType == 0x1b) { if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; local_90 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); local_98 = (Game *)((uint)local_90 & 1); if (local_90 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)local_90 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)local_90; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); local_90 = (Entity_Player *) ((int)local_98->_roomList[0]._doors + (((uint)param_2 & 1) - 0x2e)); dropRng._seed = (int)param_2; local_88 = param_2; if (local_90 != (Entity_Player *)0x0) { do { if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); dropRng._seed = (int)param_2; Isaac::GetRandomPickupVelocity(&coinVelocity,in_ECX,0,&velocityRng); spawned = Game::Spawn(g_game,5,0x14,in_ECX,&coinVelocity,(Entity *)0x0,1,(uint)param_2); (**(code **)(*(int *)spawned + 0xc))(); local_90 = (Entity_Player *)((int)&local_90[-1]._replacedPlayer + 3); } while (local_90 != (Entity_Player *)0x0); local_90 = (Entity_Player *)0x0; local_88 = param_2; } } pEVar6 = (Entity_Player *)PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0xf); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0071b771: rng = (ColorMod *)0x10; if (0x10 < (int)pEVar6) { pEVar6 = (Entity_Player *)0x10; } local_90 = pEVar6; if (0 < (int)pEVar6) { do { if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); rng = (ColorMod *)((uint)param_2 % 3); dropRng._seed = (int)param_2; if (rng == (ColorMod *)0x0) { if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); dropRng._seed = (int)param_2; Isaac::GetRandomPickupVelocity(&coinVelocity2,in_ECX,0,&velocityRng); spawned = Game::Spawn(g_game,5,0x14,in_ECX,&coinVelocity2,(Entity *)0x0,1,(uint)param_2) ; (**(code **)(*(int *)spawned + 0xc))(); rng = extraout_ECX; } local_90 = (Entity_Player *)((int)&local_90[-1]._replacedPlayer + 3); } while (0 < (int)local_90); local_88 = param_2; } } else { rng = (ColorMod *)0x0; ancestor = sourceEntity; if (sourceEntity != (EntityPtr)0x0) { do { if (*(int *)((int)ancestor + 0x28) == 1) { pEVar6 = (Entity_Player *) Entity_Player::GetTrinketMultiplier((Entity_Player *)ancestor,0xf); goto LAB_0071b771; } ancestor = *(EntityPtr *)((int)ancestor + 0x3c8); } while (ancestor != (EntityPtr)0x0); rng = (ColorMod *)0x0; } } if ((gridType == 4) || (gridType == 0x16)) { if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; if ((uVar5 % 10 == 0) && (bVar4 = ItemPool::RemoveCollectible(itemPool,0x5a,1,0), bVar4 != 0)) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)dropRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; pEVar6 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); uVar5 = 0x5a; dropRng._seed = (int)pEVar6; goto LAB_0071daa3; } local_bc = (Entity_Player *)((uint)(gridType == 0x16) * 2 + 2); if (1 < rollCount) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)dropRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; local_bc = (Entity_Player *)(uVar5 & 1); } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)dropRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; dropRng._seed = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; local_88 = (Entity_Player *)dropRng._seed; if ((Entity_Player *)dropRng._seed != (Entity_Player *)(((uint)dropRng._seed / 3) * 3)) { local_c0 = g_game; pvVar13 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar13 & 0xfffffffcU) < 0xa9) || (iVar19 = *(int *)((int)pvVar13 + 0xa8), iVar19 == 0)) || ((*(uint *)(iVar19 + 0xb8) & 0x80000000) == 0)) { local_81 = '\0'; } else { local_81 = '\x01'; } puVar15 = (g_game->_playerManager)._playerList._begin; if (puVar15 != (g_game->_playerManager)._playerList._end) { do { local_90 = (Entity_Player *)*puVar15; if (local_90->_variant == 0) { bVar4 = Entity_Player::HasTrinket(local_90,0x2a,0); if (bVar4 == 0) { if (((local_81 == '\0') || (local_90->_backupPlayer == (Entity_Player *)0x0)) || (bVar4 = Entity_Player::HasTrinket(local_90->_backupPlayer,0x2a,0), bVar4 == 0)) goto LAB_0071d111; pEVar6 = local_90->_backupPlayer; } else { pEVar6 = local_90; } if (pEVar6 != (Entity_Player *)0x0) { local_bc = (Entity_Player *)&local_bc->field_0x1; } break; } LAB_0071d111: puVar15 = puVar15 + 1; } while (puVar15 != (local_c0->_playerManager)._playerList._end); } } param_2 = local_88; local_28 = _DAT_00bab690; local_18 = 0x24; local_8c = (Entity_Player *)0x0; do { local_b4 = *(RNG **)(local_28 + (int)local_8c * 4); local_b0 = &g_game->_playerManager; if (local_d8 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)local_d8 >> ((byte)local_11c & 0x1f) ^ (uint)local_d8; uVar5 = uVar5 << ((byte)((ulonglong)local_11c >> 0x20) & 0x1f) ^ uVar5; local_d8 = (Entity_Player *)(uVar5 >> ((byte)local_d0 & 0x1f) ^ uVar5); local_c0 = (Game *)PlayerManager::RandomTrinketOwner (local_b0,*(int *)(local_28 + (int)local_8c * 4),(uint)local_d8 ,(RNG **)0x0); if (((local_c0 != (Game *)0x0) && (bVar4 = Entity_Player::HasTrinket ((Entity_Player *)local_c0,*(uint *)(local_28 + (int)local_8c * 4),0) , bVar4 != 0)) && ((*(int *)(local_28 + (int)local_8c * 4) != 0x22 || ((bVar4 = Entity_Player::HasTrinket((Entity_Player *)local_c0,0x16,0), bVar4 == 0 || (uVar5 = Random(), uVar5 % 5 == 0)))))) { iVar19 = PlayerManager::GetTrinketMultiplier (&g_game->_playerManager,*(int *)(local_28 + (int)local_8c * 4)); local_98 = (Game *)0x21; if (iVar19 == 2) { local_98 = (Game *)0x42; } else if (2 < iVar19) { local_98 = (Game *)0x64; } if (((int)local_b4 < 0) || ((int)local_c0->_roomList[0x20].SavedGridEntities._end - (int)local_c0->_roomList[0x20].SavedGridEntities._begin >> 4 <= (int)local_b4)) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); } in_ECX = positionCopy; pvVar13 = local_c0->_roomList[0x20].SavedGridEntities._begin; uVar7 = ((int)local_c0->_roomList[0x20].SavedGridEntities._end - (int)pvVar13 >> 4) - 1; uVar5 = -(uint)(*(int *)(local_28 + (int)local_8c * 4) != 0) & *(uint *)(local_28 + (int)local_8c * 4); if (uVar7 <= uVar5) { uVar5 = uVar7; } local_90 = (Entity_Player *)(uVar5 * 0x10 + (int)pvVar13); uVar5 = *(uint *)local_90; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = *(uint *)local_90; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)*(undefined4 *)&local_90->field_0x4 & 0x1f) ^ *(uint *)local_90; uVar5 = uVar5 << ((byte)(local_90->_damageEvents)._begin & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(local_90->_damageEvents)._end & 0x1f) ^ uVar5; *(uint *)local_90 = uVar5; if (local_98 <= (Game *)(uVar5 % 100)) goto LAB_0071d33a; switch(local_b4) { case (RNG *)0x22: local_8c = (Entity_Player *)0xa; break; default: Isaac::GetRandomPickupVelocity(&dropVelocity2,in_ECX,1,&velocityRng); local_8c = (Entity_Player *)0xa; if (-1 < (int)local_b4) goto LAB_0071d3da; local_8c = (Entity_Player *)0xa; goto LAB_0071d402; case (RNG *)0x24: local_8c = (Entity_Player *)0x1e; break; case (RNG *)0x29: local_8c = (Entity_Player *)0x28; break; case (RNG *)0x2c: local_8c = (Entity_Player *)0x46; break; case (RNG *)0x2d: local_8c = (Entity_Player *)0x12c; } Isaac::GetRandomPickupVelocity(&dropVelocity2,in_ECX,1,&velocityRng); LAB_0071d3da: if ((int)local_c0->_roomList[0x20].SavedGridEntities._end - (int)local_c0->_roomList[0x20].SavedGridEntities._begin >> 4 <= (int)local_b4) { LAB_0071d402: KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); } in_ECX = positionCopy; pvVar13 = local_c0->_roomList[0x20].SavedGridEntities._begin; uVar7 = ((int)local_c0->_roomList[0x20].SavedGridEntities._end - (int)pvVar13 >> 4) - 1; uVar5 = -(uint)(local_b4 != (RNG *)0x0) & (uint)local_b4; if (uVar7 <= uVar5) { uVar5 = uVar7; } local_b4 = (RNG *)(uVar5 * 0x10 + (int)pvVar13); uVar5 = local_b4->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = local_b4->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)local_b4->_shift1 & 0x1f) ^ local_b4->_seed; uVar5 = uVar5 << ((byte)local_b4->_shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)local_b4->_shift3 & 0x1f) ^ uVar5; local_b4->_seed = uVar5; spawned = Game::Spawn(g_game,5,(uint)local_8c,in_ECX,&dropVelocity2,(Entity *)0x0,0,uVar5) ; (**(code **)(*(int *)spawned + 0xc))(); break; } LAB_0071d33a: local_8c = (Entity_Player *)((int)local_8c + 1); } while (local_8c < &DAT_00000005); local_b0 = &g_game->_playerManager; local_b4 = (RNG *)0x0; if (local_d8 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)local_d8 >> ((byte)local_11c & 0x1f) ^ (uint)local_d8; uVar5 = uVar5 << ((byte)((ulonglong)local_11c >> 0x20) & 0x1f) ^ uVar5; local_d8 = (Entity_Player *)(uVar5 >> ((byte)local_d0 & 0x1f) ^ uVar5); PlayerManager::RandomTrinketOwner(local_b0,0x16,(uint)local_d8,&local_b4); local_90 = (Entity_Player *)0x0; if (local_bc != (Entity_Player *)0x0) { do { if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; local_98 = (Game *)((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10) ; dropRng._seed = uVar5; Isaac::GetRandomPickupVelocity(&dropVelocity,in_ECX,0,&velocityRng); if (0.6 <= (float)local_98) { LAB_0071d74b: bVar4 = (byte)rngShift3; bVar10 = (byte)dropRng._shift1; bVar11 = (byte)dropRng._shift2; if (0.7 <= (float)local_98) { if ((0.71 <= (float)local_98) || (local_90 != (Entity_Player *)0x0)) { if ((0.9 <= (float)local_98) || (local_90 != (Entity_Player *)0x0)) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> (bVar10 & 0x1f) ^ uVar5; uVar5 = uVar5 << (bVar11 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> (bVar4 & 0x1f) ^ uVar5); uVar5 = 0x28; goto LAB_0071d815; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> (bVar10 & 0x1f) ^ uVar5; uVar5 = uVar5 << (bVar11 & 0x1f) ^ uVar5; local_88 = (Entity_Player *)(uVar5 >> (bVar4 & 0x1f) ^ uVar5); uVar5 = 0x3c; } else { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> (bVar10 & 0x1f) ^ uVar5; uVar5 = uVar5 << (bVar11 & 0x1f) ^ uVar5; local_88 = (Entity_Player *)(uVar5 >> (bVar4 & 0x1f) ^ uVar5); uVar5 = 0x32; } param_2 = local_88; dropRng._seed = (int)local_88; spawned = Game::Spawn(g_game,5,uVar5,in_ECX,&dropVelocity,(Entity *)0x0,0, (uint)local_88); (**(code **)(*(int *)spawned + 0xc))(); break; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> (bVar10 & 0x1f) ^ uVar5; uVar5 = uVar5 << (bVar11 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> (bVar4 & 0x1f) ^ uVar5); uVar5 = 0x1e; LAB_0071d815: dropRng._seed = (int)param_2; local_88 = param_2; spawned = Game::Spawn(g_game,5,uVar5,in_ECX,&dropVelocity,(Entity *)0x0,0,(uint)param_2) ; (**(code **)(*(int *)spawned + 0xc))(); } else { if (local_b4 != (RNG *)0x0) { uVar7 = local_b4->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = local_b4->_seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar7 = uVar7 >> ((byte)local_b4->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)local_b4->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)local_b4->_shift3 & 0x1f) ^ uVar7; local_b4->_seed = uVar7; if (uVar7 % 5 != 0) goto LAB_0071d74b; } if ((isMinesStage == '\0') || ((dropRng._seed & 1U) != 0)) { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)dropRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; spawned = Game::Spawn(g_game,5,10,in_ECX,&dropVelocity,(Entity *)0x0,3,uVar5); (**(code **)(*(int *)spawned + 0xc))(); } else { Entity_NPC::ThrowRockSpider(in_ECX,&dropVelocity,(Entity *)0x0,1,-10.0); } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)dropRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); pEVar6 = (Entity_Player *)((int)&local_bc[-1]._replacedPlayer + 3); if (((uint)param_2 & 1) != 0) { pEVar6 = local_bc; } local_bc = pEVar6; dropRng._seed = (int)param_2; local_88 = param_2; } local_90 = (Entity_Player *)&local_90->field_0x1; } while ((int)local_90 < (int)local_bc); } pEVar6 = (Entity_Player *)rollCount; goto LAB_0071d8b1; } if ((gridType == 6) || (gridType == 0x1a)) { local_81 = '\0'; if ((altRockType == 5) && ((param_1 == 1 && (rollCount == 1)))) { local_8c = (Entity_Player *)&DAT_00000006; local_b0 = (PlayerManager *)((param_4 != 0x2d) + 3); do { uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_98 = (Game *)(fVar16 + fVar16); local_c0 = (Game *)sin((float)local_98); local_90 = (Entity_Player *)cos((float)local_98); uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10; projVelocity.y = fVar16 * (float)local_c0 * 6.0; projVelocity.x = fVar16 * (float)local_90 * 6.0; uVar5 = Random(); uVar7 = Random(); fVar16 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; projPos.y = fVar16 * (float)local_c0 * 8.0 + in_ECX->y; projPos.x = fVar16 * (float)local_90 * 8.0 + in_ECX->x; spawned = Game::Spawn(g_game,9,(uint)local_b0,&projPos,&projVelocity,(Entity *)0x0,0,uVar5 ); spawned->_spawnerType = 0; spawned->_spawnerVariant = 0x2712; uVar5 = Random(); uVar7 = Random(); spawned[1]._pendingDamage = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.05 + ((float)(uVar5 & 1) + 0.0) * 0.4 + 0.9; *(undefined4 *)&spawned[1].field_0x4 = 0xc2000000; spawned[1]._damageEvents._end = (void *)0x3f666666; uVar5 = Random(); in_ECX = positionCopy; local_8c = (Entity_Player *)((int)&local_8c[-1]._replacedPlayer + 3); spawned[1]._damageEvents._begin = (void *)(-5.0 - (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 24.0); } while (local_8c != (Entity_Player *)0x0); if (param_4 == 0x2d) { effectColor._tint[0] = 1.0; effectColor._tint[1] = 1.0; effectColor._tint[2] = 1.0; effectColor._tint[3] = 1.0; effectColor._offset[0] = 0.0; effectColor._offset[1] = 0.0; effectColor._colorize[0] = 0.0; effectColor._colorize[1] = 0.0; effectColor._colorize[2] = 0.0; effectColor._colorize[3] = 0.0; effectColor._offset[2] = 0.0; uVar5 = Random(); local_b0 = (PlayerManager *) ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 4.0); uVar5 = Random(); Game::SpawnParticles (g_game,in_ECX,0x3a,uVar5 % 5 + 4,(float)local_b0,&effectColor,100000.0,0); uVar5 = Random(); Game::Spawn(g_game,1000,0x2b,in_ECX,&g_vectorZero,(Entity *)0x0,0,uVar5); rng = extraout_ECX_00; } else { uVar5 = Random(); spawned = Game::Spawn(g_game,1000,2,in_ECX,&g_vectorZero,(Entity *)0x0,2,uVar5); fVar3 = fRam00c5d068; fVar17 = fRam00c5d064; fVar16 = fRam00c5d060; rng = &(spawned->_sprite)._color; if (rng != (ColorMod *)&DAT_00c5d05c) { rng->_tint[0] = _DAT_00c5d05c; (spawned->_sprite)._color._tint[1] = fVar16; (spawned->_sprite)._color._tint[2] = fVar17; (spawned->_sprite)._color._tint[3] = fVar3; fVar3 = fRam00c5d078; fVar17 = fRam00c5d074; fVar16 = fRam00c5d070; (spawned->_sprite)._color._colorize[0] = _DAT_00c5d06c; (spawned->_sprite)._color._colorize[1] = fVar16; (spawned->_sprite)._color._colorize[2] = fVar17; (spawned->_sprite)._color._colorize[3] = fVar3; *(undefined8 *)(spawned->_sprite)._color._offset = DAT_00c5d07c; (spawned->_sprite)._color._offset[2] = DAT_00c5d084; } } } if ((gridType == 0x1a) && (rollCount == 1)) { pEVar6 = PlayerManager::FirstCollectibleOwner(&g_game->_playerManager,0xfb,(RNG **)rng,1); pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xfc,(RNG **)&g_game->_playerManager,1); if ((pEVar9 == (Entity_Player *)0x0) || (pEVar6 != (Entity_Player *)0x0)) { uVar7 = Random(); uVar5 = 1; uVar14 = 300; } else { uVar5 = ItemPool::ForceAddPillEffect(&g_game->_itemPool,0x13); uVar14 = -(uint)((uVar5 & 0x7ff) != 0) & uVar5 & 0x7ff; uVar7 = 0xe; if (uVar14 < 0xe) { uVar7 = uVar14; } *(undefined1 *)((int)(&g_game->_itemPool + 1) + uVar7 + 0x3c) = 1; uVar7 = Random(); uVar14 = 0x46; in_ECX = positionCopy; } spawned = Game::Spawn(g_game,5,uVar14,in_ECX,&g_vectorZero,(Entity *)0x0,uVar5,uVar7); spawned->_spawnerType = 5; spawned->_spawnerVariant = 0x45; (**(code **)(*(int *)spawned + 0xc))(); break; } if (local_88 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } bVar4 = (byte)dropRng._shift1; uVar5 = (uint)local_88 >> (bVar4 & 0x1f) ^ (uint)local_88; bVar10 = (byte)dropRng._shift2; uVar5 = uVar5 << (bVar10 & 0x1f) ^ uVar5; bVar11 = (byte)rngShift3; dropRng._seed = uVar5 >> (bVar11 & 0x1f) ^ uVar5; local_8c = (Entity_Player *)dropRng._seed; local_88 = (Entity_Player *)dropRng._seed; if ((Entity_Player *)dropRng._seed == (Entity_Player *)(((uint)dropRng._seed / 200) * 200)) { switch(altRockType) { case 1: bVar4 = ItemPool::RemoveCollectible(itemPool,0x4a,0,0); if (bVar4 == 0) goto LAB_0071bcbe; pEVar6 = (Entity_Player *)Random(); uVar5 = 0x4a; break; case 2: if (*(int *)((int)g_game->_room + 8) == 7) { if ((Entity_Player *)dropRng._seed == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)dropRng._seed >> (bVar4 & 0x1f) ^ dropRng._seed; uVar5 = uVar5 << (bVar10 & 0x1f) ^ uVar5; pEVar6 = (Entity_Player *)(uVar5 >> (bVar11 & 0x1f) ^ uVar5); local_90 = pEVar6; if ((uint)pEVar6 % 100 == 0) { dropRng._seed = (int)pEVar6; local_88 = local_8c; bVar4 = ItemPool::RemoveCollectible(itemPool,0x246,0,0); if (bVar4 != 0) { pEVar6 = (Entity_Player *)Random(); uVar5 = 0x246; break; } } else { dropRng._seed = (int)pEVar6; } } else { pEVar6 = (Entity_Player *)dropRng._seed; } if (pEVar6 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)pEVar6 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)pEVar6; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; dropRng._seed = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; local_8c = (Entity_Player *)dropRng._seed; local_88 = (Entity_Player *)dropRng._seed; if (((dropRng._seed & 1U) == 0) && (bVar4 = ItemPool::RemoveCollectible(itemPool,0x47,0,0), bVar4 != 0)) { pEVar6 = (Entity_Player *)Random(); uVar5 = 0x47; } else { bVar4 = ItemPool::RemoveCollectible(itemPool,0xc,0,0); if (bVar4 == 0) goto LAB_0071bcbe; pEVar6 = (Entity_Player *)Random(); uVar5 = 0xc; } break; case 3: if ((Entity_Player *)dropRng._seed == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)dropRng._seed >> (bVar4 & 0x1f) ^ dropRng._seed; uVar5 = uVar5 << (bVar10 & 0x1f) ^ uVar5; dropRng._seed = uVar5 >> (bVar11 & 0x1f) ^ uVar5; local_8c = (Entity_Player *)dropRng._seed; local_88 = (Entity_Player *)dropRng._seed; if (((dropRng._seed & 1U) == 0) && (bVar4 = ItemPool::RemoveCollectible(itemPool,0x109,0,0), bVar4 != 0)) { pEVar6 = (Entity_Player *)Random(); uVar5 = 0x109; } else { bVar4 = ItemPool::RemoveCollectible(itemPool,0xa3,0,0); if (bVar4 == 0) goto LAB_0071bcbe; pEVar6 = (Entity_Player *)Random(); uVar5 = 0xa3; } break; case 4: if (isSpecialBackdrop == '\0') { if ((Entity_Player *)dropRng._seed == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)dropRng._seed >> (bVar4 & 0x1f) ^ dropRng._seed; uVar5 = uVar5 << (bVar10 & 0x1f) ^ uVar5; dropRng._seed = uVar5 >> (bVar11 & 0x1f) ^ uVar5; local_8c = (Entity_Player *)dropRng._seed; local_88 = (Entity_Player *)dropRng._seed; if (((dropRng._seed & 1U) == 0) && (bVar4 = ItemPool::RemoveCollectible(itemPool,0xda,0,0), bVar4 != 0)) { pEVar6 = (Entity_Player *)Random(); uVar5 = 0xda; } else { bVar4 = ItemPool::RemoveCollectible(&g_game->_itemPool,0xfe,0,0); if (bVar4 == 0) goto LAB_0071bcbe; pEVar6 = (Entity_Player *)Random(); uVar5 = 0xfe; } } else { if ((Entity_Player *)dropRng._seed == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)dropRng._seed >> (bVar4 & 0x1f) ^ dropRng._seed; uVar5 = uVar5 << (bVar10 & 0x1f) ^ uVar5; dropRng._seed = uVar5 >> (bVar11 & 0x1f) ^ uVar5; local_8c = (Entity_Player *)dropRng._seed; local_88 = (Entity_Player *)dropRng._seed; if (((dropRng._seed & 1U) == 0) && (bVar4 = ItemPool::RemoveCollectible(itemPool,0x1a,0,0), bVar4 != 0)) { pEVar6 = (Entity_Player *)Random(); uVar5 = 0x1a; } else { bVar4 = ItemPool::RemoveCollectible(&g_game->_itemPool,0x10c,0,0); if (bVar4 == 0) goto LAB_0071bcbe; pEVar6 = (Entity_Player *)Random(); uVar5 = 0x10c; } } break; case 5: if ((param_4 == 0x2d) && (bVar4 = ItemPool::RemoveCollectible(itemPool,0x24,0,0), bVar4 != 0)) { pEVar6 = (Entity_Player *)Random(); uVar5 = 0x24; } else { local_8c = local_88; bVar4 = ItemPool::RemoveCollectible(itemPool,0x10e,0,0); if (bVar4 == 0) goto LAB_0071bcbe; pEVar6 = (Entity_Player *)Random(); uVar5 = 0x10e; } break; default: KAGE_LogMessage(1,(byte *)"Unknown alt rock type %d\n"); pEVar6 = local_88; goto LAB_0071bcc4; } LAB_0071daa3: uVar7 = 100; LAB_0071daad: spawned = Game::Spawn(g_game,5,uVar7,in_ECX,&g_vectorZero,(Entity *)0x0,uVar5,(uint)pEVar6); (**(code **)(*(int *)spawned + 0xc))(); break; } LAB_0071bcbe: pEVar6 = local_8c; LAB_0071bcc4: game = g_game; if (pEVar6 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)local_88 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)local_88; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); dropRng._seed = (int)param_2; local_88 = param_2; if ((uint)param_2 % 0x28 == 0) { switch(altRockType) { case 1: case 5: if ((((param_4 == 0x2d) && (pvVar13 = (itemPool->_trinketPoolItems)._begin, 0xc0 < (int)((int)(itemPool->_trinketPoolItems)._end - (int)pvVar13 & 0xfffffff8U))) && (*(char *)((int)pvVar13 + 0xc4) != '\0')) && (*(char *)((int)pvVar13 + 0xc5) != '\0')) { *(undefined1 *)((int)pvVar13 + 0xc4) = 0; itemPool->_numAvailableTrinkets = itemPool->_numAvailableTrinkets + -1; uVar5 = Random(); spawned = Game::Spawn(g_game,5,0x15e,in_ECX,&g_vectorZero,(Entity *)0x0,0x18,uVar5); (**(code **)(*(int *)spawned + 0xc))(); pEVar6 = (Entity_Player *)0x0; goto LAB_0071d8b1; } pvVar13 = (itemPool->_trinketPoolItems)._begin; if (8 < (int)((int)(itemPool->_trinketPoolItems)._end - (int)pvVar13 & 0xfffffff8U)) { if ((*(char *)((int)pvVar13 + 0xc) != '\0') && (*(char *)((int)pvVar13 + 0xd) != '\0')) { *(undefined1 *)((int)pvVar13 + 0xc) = 0; itemPool->_numAvailableTrinkets = itemPool->_numAvailableTrinkets + -1; uVar5 = Random(); uVar7 = 1; goto LAB_0071c15a; } goto LAB_0071c2a2; } local_8c = local_bc; pEVar9 = local_8c; break; case 2: pvVar13 = (itemPool->_trinketPoolItems)._begin; if (0x100 < (int)((int)(itemPool->_trinketPoolItems)._end - (int)pvVar13 & 0xfffffff8U)) { if ((*(char *)((int)pvVar13 + 0x104) != '\0') && (*(char *)((int)pvVar13 + 0x105) != '\0')) { *(undefined1 *)((int)pvVar13 + 0x104) = 0; itemPool->_numAvailableTrinkets = itemPool->_numAvailableTrinkets + -1; uVar5 = Random(); uVar7 = 0x20; goto LAB_0071c15a; } goto LAB_0071c2a2; } local_8c = local_bc; pEVar9 = local_8c; break; case 3: pEVar6 = (Entity_Player *)Random(); uVar5 = 6; uVar7 = 10; goto LAB_0071daad; case 4: pvVar13 = (g_game->_itemPool)._trinketPoolItems._begin; uVar5 = (int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar13 & 0xfffffff8; if (isSpecialBackdrop == '\0') { if (0x108 < (int)uVar5) { if ((*(char *)((int)pvVar13 + 0x10c) != '\0') && (*(char *)((int)pvVar13 + 0x10d) != '\0')) { *(undefined1 *)((int)pvVar13 + 0x10c) = 0; piVar8 = &(game->_itemPool)._numAvailableTrinkets; *piVar8 = *piVar8 + -1; uVar5 = Random(); uVar7 = 0x21; goto LAB_0071c15a; } goto LAB_0071c2a2; } local_8c = local_bc; pEVar9 = local_8c; } else { if (0x2b0 < (int)uVar5) { if ((*(char *)((int)pvVar13 + 0x2b4) == '\0') || (*(char *)((int)pvVar13 + 0x2b5) == '\0')) goto LAB_0071c2a2; *(undefined1 *)((int)pvVar13 + 0x2b4) = 0; piVar8 = &(game->_itemPool)._numAvailableTrinkets; *piVar8 = *piVar8 + -1; uVar5 = Random(); uVar7 = 0x56; LAB_0071c15a: spawned = Game::Spawn(g_game,5,0x15e,in_ECX,&g_vectorZero,(Entity *)0x0,uVar7,uVar5); (**(code **)(*(int *)spawned + 0xc))(); cVar12 = '\x01'; goto LAB_0071c2a5; } local_8c = local_bc; pEVar9 = local_8c; } break; default: KAGE_LogMessage(1,(byte *)"Unknown alt rock type %d\n"); local_8c = local_bc; pEVar9 = local_8c; } } else { LAB_0071c2a2: cVar12 = local_81; LAB_0071c2a5: local_8c = (Entity_Player *)0x0; pEVar6 = local_8c; pEVar9 = (Entity_Player *)rollCount; if (cVar12 != '\0') goto LAB_0071d8b1; } local_8c = pEVar9; pEVar6 = local_8c; uVar5 = 10; if (1 < (int)local_8c) { uVar5 = 5; } uVar5 = RNG::RandomInt(&dropRng,uVar5); if (uVar5 == 1) { LAB_0071c784: pEVar6 = local_8c; if ((int)local_8c < 2) { switch(altRockType) { case 1: uVar5 = RNG::RandomInt(&dropRng,2); iVar19 = uVar5 + 1; if (iVar19 < 1) goto LAB_0071cf2a; do { Room::FindFreePickupSpawnPosition(g_game->_room,&spiderTarget,in_ECX,70.0,0,0,0); targetPos.y = spiderTarget.y; targetPos.x = spiderTarget.x; Entity_NPC::ThrowSpider(in_ECX,(Entity *)0x0,targetPos,0,-30.0); iVar19 = iVar19 + -1; } while (iVar19 != 0); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; break; case 2: EntityRef::EntityRef(&fartSource); fartSource._type = 0; fartSource._variant = 10000; Color::Color(&fartColor); Game::Fart(g_game,in_ECX,85.0,(Entity *)0x0,1.0,0,color); Game::ButterBeanFart(g_game,in_ECX,120.0,(Entity *)0x0,0,0); uVar5 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) goto LAB_0071cf2a; do { pEVar6 = PlayerManager::GetPlayer(playerManager,uVar5); bVar4 = Entity_Player::HasPoisonImmunity(pEVar6); if (bVar4 == 0) { pEVar6 = Game::GetPlayer(g_game,uVar5); source._variant = fartSource._variant; source._type = fartSource._type; source._spawnerType = fartSource._spawnerType; source._spawnerVariant = fartSource._spawnerVariant; source._position.x = fartSource._position.x; source._position.y = fartSource._position.y; source._velocity.x = fartSource._velocity.x; source._velocity.y = fartSource._velocity.y; source._flags = fartSource._flags; source._entity = fartSource._entity; bVar4 = Entity_Player::is_evil_charm_immune(pEVar6,source); if ((bVar4 == 0) && (pEVar6 = Game::GetPlayer(g_game,uVar5), fVar17 = in_ECX->x - (pEVar6->_pos).x, fVar16 = in_ECX->y - (pEVar6->_pos).y, fVar16 * fVar16 + fVar17 * fVar17 < 10000.0)) { pEVar6 = Game::GetPlayer(g_game,uVar5); (**(code **)(*(int *)pEVar6 + 0x20))(0x3f800000,0,0,&fartSource,0x1e); } } uVar5 = uVar5 + 1; playerManager = &g_game->_playerManager; } while (uVar5 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; break; case 3: uVar5 = Random(); spawned = Game::Spawn(g_game,0x1b,0,in_ECX,&g_vectorZero,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)spawned + 0xc))(); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; break; case 4: uVar5 = Random(); if (isSpecialBackdrop == '\0') { spawned = Game::Spawn(g_game,1000,0x16,in_ECX,&g_vectorZero,(Entity *)0x0,0,uVar5); spawned->_spawnerType = 0; spawned->_spawnerVariant = 0x2711; (**(code **)(*(int *)spawned + 0xc))(); iVar19 = 0; do { local_b0 = (PlayerManager *)((float)iVar19 * 60.0 * 0.017453292); ringProjVelocity.x = cos((float)local_b0); ringProjVelocity.x = ringProjVelocity.x * 10.0; ringProjVelocity.y = sin((float)local_b0); ringProjVelocity.y = ringProjVelocity.y * 10.0; uVar5 = Random(); uVar22 = 0; pTVar21 = &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor; pTVar20 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; spawned = Game::Spawn(g_game,9,0,in_ECX,&ringProjVelocity,(Entity *)0x0,0,uVar5); piVar8 = (int *)__RTDynamicCast(spawned,uVar18,pTVar20,pTVar21,uVar22); piVar8[0x105] = -0x3fc00000; piVar8[0x106] = 0x3dcccccd; piVar8[0xd] = 0; piVar8[0xe] = 0x2711; (**(code **)(*piVar8 + 0xc))(); iVar19 = iVar19 + 1; } while (iVar19 < 6); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } else { spawned = Game::Spawn(g_game,1000,0x17,in_ECX,&g_vectorZero,(Entity *)0x0,0,uVar5); spawned->_spawnerType = 0; spawned->_spawnerVariant = 0x2711; (**(code **)(*(int *)spawned + 0xc))(); iVar19 = 0; do { uVar5 = Random(); local_90 = (Entity_Player *) (((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 40.0 + ((float)iVar19 * 60.0 - 20.0)) * 0.017453292); uVar5 = Random(); local_c0 = (Game *)((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 9.0 + 2.0); maggotVelocity.x = cos((float)local_90); maggotVelocity.x = maggotVelocity.x * (float)local_c0; maggotVelocity.y = sin((float)local_90); maggotVelocity.y = maggotVelocity.y * (float)local_c0; throwVec = &maggotVelocity; fVar16 = -8.0; uVar5 = Random(); spawn_small_maggot(in_ECX,(float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 15.0 - 30.0,throwVec,fVar16); iVar19 = iVar19 + 1; } while (iVar19 < 6); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } break; case 5: uVar5 = RNG::RandomInt(&dropRng,2); iVar19 = uVar5 + 1; if (*(float *)((int)g_game->_room + 0x7240) <= 0.0) { if (iVar19 < 1) goto LAB_0071cf2a; do { Room::FindFreePickupSpawnPosition(g_game->_room,&spiderTarget2,in_ECX,70.0,0,0,0); targetPos_00.y = spiderTarget2.y; targetPos_00.x = spiderTarget2.x; Entity_NPC::ThrowSpider(in_ECX,(Entity *)0x0,targetPos_00,0,-30.0); iVar19 = iVar19 + -1; } while (iVar19 != 0); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } else { uVar5 = RNG::RandomInt(&dropRng,2); if (uVar5 == 0) { if (param_4 == 0x2d) { if (iVar19 < 1) goto LAB_0071cf2a; do { Isaac::GetRandomPickupVelocity(&pickupVelocity,in_ECX,0,(RNG *)0x0); uVar5 = Random(); local_b0 = (PlayerManager *)pickupVelocity.x; pickupPos.x = pickupVelocity.x + in_ECX->x; local_98 = (Game *)pickupVelocity.y; pickupPos.y = pickupVelocity.y + in_ECX->y; spawned = Game::Spawn(g_game,0x366,0,&pickupPos,&pickupVelocity,(Entity *)0x0,0, uVar5); fVar16 = spawned->_friction; if (fVar16 != 0.0) { fVar17 = spawned->_speedMultiplier; (spawned->_velocity).x = ((float)local_b0 * fVar17) / fVar16 + (spawned->_velocity).x; (spawned->_velocity).y = ((float)local_98 * fVar17) / fVar16 + (spawned->_velocity).y; } uVar18 = *(undefined4 *)((int)&spawned->_flags + 4); *(uint *)&spawned->_flags = (uint)spawned->_flags & 0xfffffffb; *(undefined4 *)((int)&spawned->_flags + 4) = uVar18; iVar1 = *(int *)spawned; spawned[2]._posOffset.x = 5.60519e-45; (**(code **)(iVar1 + 0xc))(); iVar19 = iVar19 + -1; } while (iVar19 != 0); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } else { if (iVar19 < 1) goto LAB_0071cf2a; do { throwVec = Room::FindFreePickupSpawnPosition (g_game->_room,&striderTarget,in_ECX,70.0,0,0,0); Entity_NPC::ThrowStrider(in_ECX,(Entity *)0x0,throwVec); iVar19 = iVar19 + -1; } while (iVar19 != 0); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } } else { if (iVar19 < 1) goto LAB_0071cf2a; do { bVar4 = 0; throwVec = Room::FindFreePickupSpawnPosition (g_game->_room,&leechTarget,in_ECX,70.0,0,0,0); Entity_NPC::ThrowLeech(in_ECX,(Entity *)0x0,-30.0,throwVec,bVar4); iVar19 = iVar19 + -1; } while (iVar19 != 0); rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } } break; default: KAGE_LogMessage(1,(byte *)"Unknown alt rock type %d\n"); LAB_0071cf2a: rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; pEVar6 = local_8c; param_2 = (Entity_Player *)dropRng._seed; } } else { LAB_0071c2f2: rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; param_2 = (Entity_Player *)dropRng._seed; } } else { if (uVar5 != 2) { if (uVar5 == 3) goto LAB_0071c784; goto LAB_0071c2f2; } if (altRockType == 2) { uVar5 = RNG::Next(&dropRng); spawned = Game::Spawn(g_game,5,0x46,in_ECX,&spawnVelocity,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)spawned + 0xc))(); uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_b0 = (PlayerManager *)(fVar16 + fVar16); local_98 = (Game *)cos((float)local_b0); spawnVelocity.y = sin((float)local_b0); spawnVelocity.y = spawnVelocity.y + spawnVelocity.y; spawnVelocity.x = (float)local_98 + (float)local_98; rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; param_2 = (Entity_Player *)dropRng._seed; } else if (altRockType == 3) { uVar5 = RNG::Next(&dropRng); spawned = Game::Spawn(g_game,5,300,in_ECX,&spawnVelocity,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)spawned + 0xc))(); uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_b0 = (PlayerManager *)(fVar16 + fVar16); local_98 = (Game *)cos((float)local_b0); spawnVelocity.y = sin((float)local_b0); spawnVelocity.y = spawnVelocity.y + spawnVelocity.y; spawnVelocity.x = (float)local_98 + (float)local_98; rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; param_2 = (Entity_Player *)dropRng._seed; } else if (altRockType == 4) { if (isSpecialBackdrop == '\0') { uVar5 = RNG::Next(&dropRng); uVar7 = 0; LAB_0071c558: spawned = Game::Spawn(g_game,5,10,in_ECX,&spawnVelocity,(Entity *)0x0,uVar7,uVar5); (**(code **)(*(int *)spawned + 0xc))(); } else if (((g_manager->_persistentGameData)._achievements[0x19b] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { uVar5 = RNG::Next(&dropRng); uVar7 = 0xc; goto LAB_0071c558; } uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_b0 = (PlayerManager *)(fVar16 + fVar16); local_98 = (Game *)cos((float)local_b0); spawnVelocity.y = sin((float)local_b0); spawnVelocity.y = spawnVelocity.y + spawnVelocity.y; spawnVelocity.x = (float)local_98 + (float)local_98; rngShift3 = dropRng._shift3; local_88 = (Entity_Player *)dropRng._seed; param_2 = (Entity_Player *)dropRng._seed; } else { uVar5 = RNG::RandomInt(&dropRng,2); local_bc = (Entity_Player *)(uVar5 + 1); if ((int)local_bc < 1) goto LAB_0071c2f2; rngShift3 = dropRng._shift3; param_2 = (Entity_Player *)dropRng._seed; do { uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_b0 = (PlayerManager *)(fVar16 + fVar16); local_98 = (Game *)cos((float)local_b0); coinVelocity3.y = sin((float)local_b0); coinVelocity3.y = coinVelocity3.y + coinVelocity3.y; coinVelocity3.x = (float)local_98 + (float)local_98; if (param_2 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)param_2 >> ((byte)dropRng._shift1 & 0x1f) ^ (uint)param_2; uVar5 = uVar5 << ((byte)dropRng._shift2 & 0x1f) ^ uVar5; param_2 = (Entity_Player *)(uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5); dropRng._seed = (int)param_2; uVar5 = Random(); fVar16 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_90 = (Entity_Player *)(fVar16 + fVar16); uVar5 = Random(); local_c0 = (Game *)((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 5.0); fVar16 = cos((float)local_90); coinPos.x = fVar16 * (float)local_c0 + in_ECX->x; fVar16 = sin((float)local_90); coinPos.y = fVar16 * (float)local_c0 + in_ECX->y; spawned = Game::Spawn(g_game,5,0x14,&coinPos,&coinVelocity3,(Entity *)0x0,0, (uint)param_2); (**(code **)(*(int *)spawned + 0xc))(); local_bc = (Entity_Player *)((int)&local_bc[-1]._replacedPlayer + 3); } while (local_bc != (Entity_Player *)0x0); local_bc = (Entity_Player *)0x0; pEVar6 = local_8c; local_88 = param_2; } } LAB_0071d8b1: rollCount = (int)pEVar6; } rollCount = (int)&((Entity_Player *)(rollCount + -0x26cc))->_replacedPlayer + 3; } while (0 < rollCount); if ((param_3 == '\0') && (local_d4 != (Entity_Player *)0x0)) { bVar4 = Entity_Player::HasCollectible(local_d4,0x248,0); uVar5 = initialSeed; if (bVar4 != 0) { wispRng._shift1 = 7; wispRng._shift2 = 0x11; wispRng._shift3 = 0x15; bVar4 = Entity_Player::HasCollectible(local_d4,0x3b,0); local_d0 = 1; if (bVar4 != 0) { local_d0 = 3; } do { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> ((byte)wispRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)wispRng._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)wispRng._shift3 & 0x1f) ^ uVar5; wispRng._seed = uVar5; if (uVar5 == (uVar5 / 5) * 5) { if (gridType == 0x1b) { LAB_0071dc29: iVar19 = 0x10002; } else { RNG::Next(&wispRng); fVar16 = (float)((double)wispRng._seed + __uint_to_double_fixup[-(wispRng._seed >> 0x1f)]) * 2.3283062e-10; if (fVar16 < 0.01) { iVar19 = 0x10003; } else { if (fVar16 < 0.04) goto LAB_0071dc29; if (fVar16 < 0.08) { iVar19 = 0x10004; } else if (0.33 <= fVar16) { iVar19 = 0x10000; } else { iVar19 = 0x10001; } } } uVar5 = wispRng._seed; Entity_Player::AddWisp(local_d4,iVar19,in_ECX,0,0); } local_d0 = local_d0 + -1; } while (local_d0 != 0); } } local_98 = (Game *)PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0x2cd,initialSeed,(RNG **)0x0); if (local_98 == (Game *)0x0) { return; } if (1 < *(int *)&g_game->_deathmatchManager) { if (sourceEntity == (EntityPtr)0x0) { return; } playerManager = &g_game->_playerManager; local_90 = (Entity_Player *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) { return; } while( true ) { pvVar13 = (playerManager->_playerList)._end; if ((int)pvVar13 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar13 = (playerManager->_playerList)._end; } puVar15 = (playerManager->_playerList)._begin; if (local_90 < (Entity_Player *)((int)pvVar13 - (int)puVar15 >> 2)) { puVar15 = puVar15 + (int)local_90; } pEVar6 = (Entity_Player *)*puVar15; local_98 = (Game *)pEVar6; bVar4 = Entity_Player::HasCollectible(pEVar6,0x2cd,0); if ((bVar4 != 0) && (bVar4 = Entity::IsDescendantOf((Entity *)sourceEntity,(Entity *)pEVar6), bVar4 != 0)) break; playerManager = &g_game->_playerManager; local_90 = (Entity_Player *)&local_90->field_0x1; if ((undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2) <= local_90) { return; } } if (pEVar6 == (Entity_Player *)0x0) { return; } } local_11c = 0x1900000007; local_d0 = 0xc; if (initialSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = initialSeed >> 7 ^ initialSeed; uVar5 = uVar5 << 0x19 ^ uVar5; uVar5 = uVar5 >> 0xc ^ uVar5; local_b0 = (PlayerManager *)(uVar5 % 3); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> 7 ^ uVar5; for (iVar19 = ((uVar5 >> 0xc ^ uVar5) & 1) + (int)local_b0; iVar19 != 0; iVar19 = iVar19 + -1) { ((Entity_Player *)local_98)->_numBlueSpiders = ((Entity_Player *)local_98)->_numBlueSpiders + 1; spawn_blue_spider(in_ECX,(Entity *)local_98,&g_vectorZero); } /* WARNING: Read-only address (ram,0x00bab690) is written */ return; } //@@ 0071deb0 GridEntity_Rock::GetWaterClipInfo /* ZHL [exact] WaterClipInfo* GetWaterClipInfo(WaterClipInfo* out); */ void GridEntity_Rock::GetWaterClipInfo(undefined4 *param_1) { int in_ECX; undefined4 uVar1; uVar1 = 0x26; if (*(int *)(in_ECX + 0xc) != 2) { uVar1 = 0x39; } *param_1 = uVar1; param_1[1] = 0; return; } //@@ 0071dee0 grid_mark_neighbors_dirty /* DB: ? fastcall grid index in ECX (used as idx % room _gridWidth); for each neighbour offset in table DAT_00b69110, a ROCK(2) with state 1 or PIT(7) with state 0 and _varData(+0x18)==1 gets _varData=13; called after GridEntity_Rock::Destroy (after TrySpawnLadder), GridEntity_Pit::Update, Room::spawn_grid_from_desc prototype: db/protos.zhl */ void __fastcall grid_mark_neighbors_dirty(int gridIndex) { void *pvVar1; int iVar2; int iVar3; int iVar4; int *piVar5; bool bVar6; pvVar1 = g_game->_room; piVar5 = &DAT_00b69114; iVar2 = *(int *)((int)pvVar1 + 0xc); do { iVar3 = piVar5[-1] + gridIndex % iVar2; if (((((-1 < iVar3) && (iVar3 < *(int *)((int)pvVar1 + 0xc))) && (iVar4 = *piVar5 + gridIndex / iVar2, -1 < iVar4)) && ((iVar4 < *(int *)((int)pvVar1 + 0x10) && (iVar3 = *(int *)((int)pvVar1 + 0xc) * iVar4 + iVar3, -1 < iVar3)))) && (iVar3 = *(int *)((int)pvVar1 + iVar3 * 4 + 0x24), iVar3 != 0)) { if (*(int *)(iVar3 + 4) == 2) { if (*(int *)(iVar3 + 0x18) == 1) { bVar6 = *(int *)(iVar3 + 0xc) == 1; LAB_0071df4e: if (bVar6) { *(undefined4 *)(iVar3 + 0x18) = 0xd; } } } else if ((*(int *)(iVar3 + 4) == 7) && (*(int *)(iVar3 + 0x18) == 1)) { bVar6 = *(int *)(iVar3 + 0xc) == 0; goto LAB_0071df4e; } } piVar5 = piVar5 + 2; if (0xb69133 < (int)piVar5) { return; } } while( true ); } //@@ 0071df70 FUN_0071df70 void FUN_0071df70(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x538) = param_1; return; } //@@ 0071df80 FUN_0071df80 int FUN_0071df80(void) { int iVar1; uint3 uVar2; iVar1 = *(int *)((int)g_game->_room + 0x1d18); uVar2 = (uint3)((uint)iVar1 >> 8); if (((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || ((iVar1 == 0xd || (iVar1 == 0x22)))) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 0071dfc0 GridEntity_Spikes::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Spikes::BeginBatches(GridEntity_Spikes *this) { int iVar1; code *pcVar2; byte bVar3; char isDisabled; byte *curAnim; std_string *psVar4; Entity *bloodSplat; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte *expectedAnim; char *pcVar5; uint uVar6; bool bVar7; float splatScaleY; Vector local_34; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; void *animData; Game *game; int gridType; ANM2 *sprite; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afcc05; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; this->_collisionClass = 0; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)game->_room + this->_gridIndex * 4 + 0x76c) = 999; } sprite = &this->_sprite; local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x19; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/grid/grid_spikes.anm2",0x1a); local_8 = 0; ANM2::Load(sprite,&local_2c,0); local_8 = 0xffffffff; bVar3 = extraout_CL; if (0xf < local_2c._capacity) { uVar6 = local_2c._capacity + 1; pcVar5 = (char *)local_2c._buf._0_4_; if (0xfff < uVar6) { pcVar5 = *(char **)(local_2c._buf._0_4_ + -4); uVar6 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar6); bVar3 = extraout_CL_00; } local_2c._12_8_ = local_2c._12_8_ & 0xffffffff; local_2c._capacity = 0xf; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; local_34.y = 0.0; if ((this->_sprite)._layerCount != 0) { do { Sprite::ReplaceSpritesheet ((Sprite *)sprite,(int)local_34.y, (std_string *) ((int)g_game->_room + *(int *)((int)g_game->_room + 0x1d18) * 0x13c + 0x1e3c)); local_34.y = (float)((int)local_34.y + 1); bVar3 = extraout_CL_01; } while ((uint)local_34.y < (byte *)(this->_sprite)._layerCount); } ANM2::LoadGraphics(sprite,bVar3); if (((this->_desc)._type == 8) && ((uint)(this->_desc)._variant % 100 == 0)) { uVar6 = (this->_desc)._spawnSeed; local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_34.y = (float)&DAT_00000007; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 5 ^ uVar6; uVar6 = uVar6 << 9 ^ uVar6; uVar6 = uVar6 >> 7 ^ uVar6; (this->_desc)._variant = (uVar6 & 3) + (this->_desc)._variant + 1; if ((this->_desc)._initialized == 0) { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 5 ^ uVar6; uVar6 = uVar6 << 9 ^ uVar6; (this->_desc)._variableSeed = uVar6 >> 7 ^ uVar6; } } iVar1 = (this->_desc)._state; (this->_rng)._seed = (this->_desc)._variableSeed; (this->_rng)._shift1 = 5; (this->_rng)._shift2 = 9; (this->_rng)._shift3 = 7; gridType = (this->_desc)._type; this->_timeout = 0x1e; (this->_desc)._state = 0; if (gridType != 9) { if (gridType == 0x1c) { if (iVar1 == 1) { curAnim = (this->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0071e528: bVar3 = ANM2::SetAnimation(sprite,(byte *)"UnsummonPayment",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } pcVar5 = "UnsummonPayment"; do { bVar3 = *curAnim; bVar7 = bVar3 < (byte)*pcVar5; if (bVar3 != *pcVar5) { LAB_0071e510: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e515; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < (byte)pcVar5[1]; if (bVar3 != pcVar5[1]) goto LAB_0071e510; curAnim = curAnim + 2; pcVar5 = pcVar5 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e515: if ((uVar6 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0071e528; } animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { local_2c._capacity = 0xf; local_2c._12_8_ = local_2c._12_8_ & 0xffffffff; local_2c._buf._0_4_ = (std_string *)0x0; } else { std::string::string(local_2c._buf,animData); } local_8 = 1; psVar4 = &local_2c; if (0xf < local_2c._capacity) { psVar4 = (std_string *)local_2c._buf._0_4_; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)psVar4,1); if ((bVar3 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar6 = local_2c._capacity + 1; psVar4 = (std_string *)local_2c._buf._0_4_; if (0xfff < uVar6) { psVar4 = (std_string *)((std_string *)(local_2c._buf._0_4_ + -0x18))->_capacity; uVar6 = local_2c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_2c._buf._0_4_ + (-4 - (int)psVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar4,uVar6); } local_2c._12_8_ = local_2c._12_8_ & 0xffffffff; local_2c._capacity = 0xf; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } (this->_desc)._state = 1; goto LAB_0071e7e6; } if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 1)) { curAnim = (this->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } pcVar5 = "PaymentSpike"; do { bVar3 = *curAnim; bVar7 = bVar3 < (byte)*pcVar5; if (bVar3 != *pcVar5) { LAB_0071e6e2: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e6e7; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < (byte)pcVar5[1]; if (bVar3 != pcVar5[1]) goto LAB_0071e6e2; curAnim = curAnim + 2; pcVar5 = pcVar5 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e6e7: if ((uVar6 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } pcVar5 = "PaymentSpike"; } else { curAnim = (this->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } pcVar5 = "SummonPayment"; do { bVar3 = *curAnim; bVar7 = bVar3 < (byte)*pcVar5; if (bVar3 != *pcVar5) { LAB_0071e680: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e685; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < (byte)pcVar5[1]; if (bVar3 != pcVar5[1]) goto LAB_0071e680; curAnim = curAnim + 2; pcVar5 = pcVar5 + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e685: if ((uVar6 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } pcVar5 = "SummonPayment"; } } else { iVar1 = *(int *)((int)g_game->_room + 0x1d18); if (((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || ((iVar1 == 0xd || (iVar1 == 0x22)))) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))) { bVar7 = true; } else { bVar7 = false; } pcVar5 = "Spikes%02u"; if (bVar7) { pcVar5 = "WombSpikes%02u"; } sprintf_s(&DAT_00c80fa8,0x20,(byte *)pcVar5); curAnim = (this->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } expectedAnim = &DAT_00c80fa8; do { bVar3 = *curAnim; bVar7 = bVar3 < *expectedAnim; if (bVar3 != *expectedAnim) { LAB_0071e7b0: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e7b5; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < expectedAnim[1]; if (bVar3 != expectedAnim[1]) goto LAB_0071e7b0; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e7b5: if ((uVar6 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } pcVar5 = &DAT_00c80fa8; } bVar3 = ANM2::SetAnimation(sprite,(byte *)pcVar5,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0071e7e6; } uVar6 = (this->_desc)._variant; if (uVar6 == 0) { iVar1 = *(int *)((int)g_game->_room + 0x1d18); if ((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || (((iVar1 == 0xd || (iVar1 == 0x22)) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))))) { bVar7 = true; } else { bVar7 = false; } local_34.y = 1.6766631e-38; if (!bVar7) { local_34.y = (float)&DAT_00b69280; } curAnim = (this->_sprite)._animState._animData; if (curAnim != (byte *)0x0) { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } expectedAnim = (byte *)local_34.y; do { bVar3 = *curAnim; bVar7 = bVar3 < *expectedAnim; if (bVar3 != *expectedAnim) { LAB_0071e477: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e47c; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < expectedAnim[1]; if (bVar3 != expectedAnim[1]) goto LAB_0071e477; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e47c: if ((uVar6 == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)local_34.y,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0071e7e6; } if (5 < uVar6) { iVar1 = *(int *)((int)g_game->_room + 0x1d18); if ((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || (((iVar1 == 0xd || (iVar1 == 0x22)) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))))) { bVar7 = true; } else { bVar7 = false; } local_34.y = 1.6766631e-38; if (!bVar7) { local_34.y = (float)&DAT_00b69280; } curAnim = (this->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0071e3bb: bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)local_34.y,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } expectedAnim = (byte *)local_34.y; do { bVar3 = *curAnim; bVar7 = bVar3 < *expectedAnim; if (bVar3 != *expectedAnim) { LAB_0071e3a0: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e3a5; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < expectedAnim[1]; if (bVar3 != expectedAnim[1]) goto LAB_0071e3a0; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e3a5: if ((uVar6 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0071e3bb; } this->_timeout = ((this->_desc)._variant + -5) * 0xc; goto LAB_0071e7e6; } (this->_desc)._state = 1; this->_timeout = uVar6 * 0xc; iVar1 = *(int *)((int)g_game->_room + 0x1d18); if (((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || ((iVar1 == 0xd || (iVar1 == 0x22)))) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))) { bVar7 = true; } else { bVar7 = false; } local_34.y = 1.6734441e-38; if (!bVar7) { local_34.y = 1.6766497e-38; } curAnim = (this->_sprite)._animState._animData; if (curAnim == (byte *)0x0) { LAB_0071e2db: bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)local_34.y,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(curAnim + 0x14)) { curAnim = *(byte **)curAnim; } expectedAnim = (byte *)local_34.y; do { bVar3 = *curAnim; bVar7 = bVar3 < *expectedAnim; if (bVar3 != *expectedAnim) { LAB_0071e2c0: uVar6 = -(uint)bVar7 | 1; goto LAB_0071e2c5; } if (bVar3 == 0) break; bVar3 = curAnim[1]; bVar7 = bVar3 < expectedAnim[1]; if (bVar3 != expectedAnim[1]) goto LAB_0071e2c0; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0071e2c5: if ((uVar6 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0071e2db; } if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } LAB_0071e7e6: isDisabled = is_disabled(); if (isDisabled != '\0') { unsummon(this,1); } if (((this->_desc)._type == 8) && (99 < (uint)(this->_desc)._variant)) { uVar6 = (this->_desc)._spawnSeed; local_2c._buf[0xc] = '\x02'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 7; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> 2 ^ uVar6; uVar6 = uVar6 << 7 ^ uVar6; iVar1 = *(int *)((int)g_game->_room + 0xc); local_34.x = (float)(this->_gridIndex % iVar1) * 40.0 + 40.0; local_34.y = (float)(this->_gridIndex / iVar1) * 40.0 + 120.0; bloodSplat = Game::Spawn(g_game,1000,7,&local_34,&g_vectorZero,(Entity *)0x0,0, uVar6 >> 9 ^ uVar6); splatScaleY = g_vectorOne.y * 1.8; iVar1 = *(int *)bloodSplat; (bloodSplat->_sprite)._scale.x = g_vectorOne.x * 1.8; (bloodSplat->_sprite)._scale.y = splatScaleY; (**(code **)(iVar1 + 0xc))(); } ExceptionList = local_10; return; } //@@ 0071e920 GridEntity_Spikes::is_disabled /* DB: ECX spikes grid: returns 1 if the current room descriptor has flag bit 1, or anyone holds TRINKET_FLAT_FILE 151, or (variant <= 99, room type 14 and someone owns COLLECTIBLE_SANGUINE_BOND 692); returns 0 for grid type 28 or when the delirium-distance field > 1; BeginBatches calls GridEntity_Spikes::unsummon when true, Update skips the hurt cycle */ undefined4 GridEntity_Spikes::is_disabled(void) { byte bVar1; RoomDescriptor *pRVar2; Entity_Player *pEVar3; int in_ECX; if ((1 < *(int *)&g_game->_deathmatchManager) || (*(int *)(in_ECX + 4) == 0x1c)) { return 0; } pRVar2 = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,g_game->_currentDimensionIdx) ; if ((((uint)pRVar2->Flags >> 1 & 1) != 0) || (bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x97), bVar1 != 0)) { return 1; } if (99 < *(uint *)(in_ECX + 8)) { return 0; } if (*(int *)((int)g_game->_room + 8) != 0xe) { return 0; } pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b4,(RNG **)&g_game->_playerManager,1); if (pEVar3 == (Entity_Player *)0x0) { return 0; } return 1; } //@@ 0071e9b0 GridEntity_Spikes::Update /* ZHL [exact] void Update(); */ void __thiscall GridEntity_Spikes::Update(GridEntity_Spikes *this) { byte isIgnoreGridCollisionClass; char cVar1; int iVar2; char *anim; uint uVar3; ANM2 *this_00; int extraout_EDX; char *pcVar4; if ((this->_desc)._state != 0) { if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 500; } goto LAB_0071ea6f; } uVar3 = 0x80; iVar2 = *(int *)((int)g_game->_room + 8); if ((((iVar2 == 0xd) || (99 < (uint)(this->_desc)._variant)) || ((this->_desc)._type == 0x1c)) && (uVar3 = 0x10000080, iVar2 == 0xd)) { LAB_0071ea00: isIgnoreGridCollisionClass = 1; } else { iVar2 = (this->_desc)._type; if (iVar2 != 8) { if (iVar2 != 0x1c) goto LAB_0071ea4a; goto LAB_0071ea00; } if (99 < (uint)(this->_desc)._variant) goto LAB_0071ea00; LAB_0071ea4a: isIgnoreGridCollisionClass = 0; } GridEntity::hurt_surroundings ((GridEntity *)this,11.0,11.0,8.0,2,(ulonglong)uVar3,isIgnoreGridCollisionClass); if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 999; } LAB_0071ea6f: cVar1 = is_disabled(); if (cVar1 == '\0') { if (((this->_desc)._type == 9) && (0 < this->_timeout)) { iVar2 = this->_timeout + -1; this->_timeout = iVar2; if (iVar2 < 1) { this->_timeout = 0x3c; (this->_desc)._state = (uint)((this->_desc)._state == 0); } else if (iVar2 == 5) { cVar1 = FUN_0071df80(); if (cVar1 == '\0') { anim = "Unsummon"; pcVar4 = "Summon"; } else { anim = "UnsummonWomb"; pcVar4 = "SummonWomb"; } if (extraout_EDX != 0) { anim = pcVar4; } ANM2::Play(this_00,(byte *)anim,0); } } } else if (((this->_desc)._state == 0) || (((this->_sprite)._animState._animData != (void *)0x0 && ((this->_sprite)._animState._isPlaying != 0)))) { unsummon(this,0); } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } //@@ 0071eb30 GridEntity_Spikes::unsummon /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: sets _desc._state (+0xc)=1, +0x154=-1; plays "UnsummonPayment" / "UnsummonWomb" / "Unsummon" on sprite +0x40 unless already playing; called from GridEntity_Spikes::Update/BeginBatches, GridEntity::hurt_func prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall GridEntity_Spikes::unsummon(GridEntity_Spikes *this,byte isInstant) { void *other; char isWomb; byte bVar1; byte *curAnimChar; uint uVar2; byte *****curAnimNameData; char *animName; bool isLess; byte *****curAnimName [4]; undefined4 curAnimNameSize; uint curAnimNameCapacity; uint securityCookie; void *local_10; undefined1 *puStack_c; byte ****local_8; byte *animData; int gridType; local_8 = (byte ****)0xffffffff; puStack_c = &LAB_00af18ad; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(curAnimName + 0xb); ExceptionList = &local_10; gridType = (this->_desc)._type; (this->_desc)._state = 1; this->_timeout = -1; if (gridType == 0x1c) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } animName = "UnsummonPayment"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_0071ebb0: uVar2 = -(uint)isLess | 1; goto LAB_0071ebb5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_0071ebb0; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0071ebb5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071ecaa; } animName = "UnsummonPayment"; } else { isWomb = FUN_0071df80(securityCookie); animData = (this->_sprite)._animState._animData; if (isWomb == '\0') { if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } animName = "Unsummon"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_0071ec72: uVar2 = -(uint)isLess | 1; goto LAB_0071ec77; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_0071ec72; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0071ec77: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071ecaa; } animName = "Unsummon"; } else { if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } animName = "UnsummonWomb"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_0071ec20: uVar2 = -(uint)isLess | 1; goto LAB_0071ec25; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_0071ec20; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0071ec25: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071ecaa; } animName = "UnsummonWomb"; } } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0071ecaa: if (isInstant != 0) { other = (this->_sprite)._animState._animData; if (other == (void *)0x0) { curAnimNameCapacity = 0xf; curAnimNameSize = 0; curAnimName[0] = (byte *****)0x0; } else { std::string::string((char *)curAnimName,other); } local_8 = (byte ****)0x0; curAnimNameData = (byte *****)curAnimName; if (0xf < curAnimNameCapacity) { curAnimNameData = curAnimName[0]; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)curAnimNameData,1); if ((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } local_8 = (byte ****)0xffffffff; if (0xf < curAnimNameCapacity) { uVar2 = curAnimNameCapacity + 1; curAnimNameData = curAnimName[0]; if (0xfff < uVar2) { curAnimNameData = (byte *****)curAnimName[0][-1]; uVar2 = curAnimNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)curAnimName[0] + (-4 - (int)curAnimNameData))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(curAnimNameData,uVar2); } curAnimNameSize = 0; curAnimNameCapacity = 0xf; curAnimName[0] = (byte *****)((uint)curAnimName[0] & 0xffffff00); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } } ExceptionList = local_10; return; } //@@ 0071edb0 GridEntity::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity::Render(GridEntity *this,float *param_2) { ColorMod *pCVar1; void *pvVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; Vector *pVVar12; AnimationState *this_00; Vector local_44; Vector local_3c; undefined4 local_34 [12]; pvVar2 = g_game->_room; fVar4 = *(float *)((int)pvVar2 + 0x72a4); fVar5 = *(float *)((int)pvVar2 + 0x72a8); fVar6 = *(float *)((int)pvVar2 + 0x72ac); fVar7 = *(float *)((int)pvVar2 + 0x72b0); fVar3 = *(float *)((int)pvVar2 + 0x72cc); fVar8 = *(float *)((int)pvVar2 + 0x72b4); fVar9 = *(float *)((int)pvVar2 + 0x72b8); fVar10 = *(float *)((int)pvVar2 + 0x72bc); fVar11 = *(float *)((int)pvVar2 + 0x72c0); pCVar1 = &(this->_sprite)._color; if (pCVar1 != (ColorMod *)local_34) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar2 + 0x72c4); pCVar1->_tint[0] = fVar4; (this->_sprite)._color._tint[1] = fVar5; (this->_sprite)._color._tint[2] = fVar6; (this->_sprite)._color._tint[3] = fVar7; (this->_sprite)._color._offset[2] = fVar3; (this->_sprite)._color._colorize[0] = fVar8; (this->_sprite)._color._colorize[1] = fVar9; (this->_sprite)._color._colorize[2] = fVar10; (this->_sprite)._color._colorize[3] = fVar11; } pVVar12 = get_render_position(this,&local_3c); local_44.x = pVVar12->x + *param_2; local_44.y = pVVar12->y + param_2[1]; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._animState; } AnimationState::Render(this_00,&local_44,&g_vectorZero,&g_vectorZero); } return; } //@@ 0071ee90 GridEntity_TNT::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_TNT::BeginBatches(GridEntity_TNT *this) { byte *pbVar1; byte bVar2; EntityConfig_Entity *entity; byte *pbVar3; char *ptr; byte *pbVar4; uint uVar5; EntityConfig *this_00; bool bVar6; undefined1 local_40 [8]; void *local_38; GridEntity_TNT *local_34; undefined4 local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 1000; } local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_34 = this; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x16; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/grid/grid_tnt.anm2",0x17); local_8 = 0; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar5 = local_2c._capacity + 1; ptr = (char *)local_2c._buf._0_4_; if (0xfff < uVar5) { ptr = *(char **)(local_2c._buf._0_4_ + -4); uVar5 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } local_2c._size = 0; this_00 = &g_manager->_entityConfig; local_2c._capacity = 0xf; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; local_30 = 0x3e801b00; _Find_lower_bound<>(local_40,&local_30); if (((*(char *)((int)local_38 + 0xd) == '\0') && (*(uint *)((int)local_38 + 0x10) < 0x3e801b01)) && (local_38 != (this_00->_entities)._head)) { entity = (EntityConfig_Entity *)((int)local_38 + 0x18); } else { entity = EntityConfig::GetEntity(this_00,1000,0,0); } if (entity != (EntityConfig_Entity *)0x0) { EntityConfig::PreloadResources(this_00,entity); } pbVar1 = (this->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar4 = s_Idle; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar4; if (bVar2 != *pbVar4) { LAB_0071f028: uVar5 = -(uint)bVar6 | 1; goto LAB_0071f02d; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar4[1]; if (bVar2 != pbVar4[1]) goto LAB_0071f028; pbVar3 = pbVar3 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0071f02d: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071f059; } bVar2 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0071f059: local_34->_frameCnt = (uint)((local_34->_desc)._state < 4) * 4 + -1; ExceptionList = local_10; return; } //@@ 0071f090 GridEntity_TNT::Update /* ZHL [vtable slot 2] */ void __thiscall GridEntity_TNT::Update(GridEntity_TNT *this) { int iVar1; byte bVar2; int iVar3; uint seed; Vector *pVVar4; undefined4 extraout_ECX; Vector VStack_10; iVar3 = 2; iVar1 = (this->_desc)._state; if (3 < iVar1) { iVar3 = 0; } this->_collisionClass = iVar3; switch(iVar1) { case 0: case 1: ANM2::Play(&this->_sprite,s_Idle,0); return; case 2: ANM2::Play(&this->_sprite,(byte *)"IdleMedium",0); return; case 3: goto LAB_0071f222; case 4: bVar2 = ANM2::IsPlaying(&this->_sprite,(byte *)"Blown"); if (bVar2 == 0) { this->_frameCnt = this->_frameCnt + -1; if (this->_frameCnt < 1) { ANM2::Play(&this->_sprite,(byte *)"Blown",0); if (this->_frameCnt != 0) { return; } seed = Random(); pVVar4 = GridEntity::Position((GridEntity *)this,&VStack_10); Game::SpawnEx(g_game,1000,1,pVVar4,&g_vectorZero,(Entity *)0x0,0,seed,0); pVVar4 = GridEntity::Position((GridEntity *)this,&VStack_10); Game::spawn_bomb_crater(g_game,pVVar4,(Entity *)0x0,1.0); pVVar4 = GridEntity::Position((GridEntity *)this,&VStack_10); Game::BombDamage(g_game,pVVar4,100.0,75.0,0,(Entity *)0x0,g_tearFlagsNone,0x1004,0); GridEntity::Position((GridEntity *)this,&VStack_10); spawn_rock_particles(); GridEntity::Position((GridEntity *)this,&VStack_10); FUN_0071f4b0((this->_desc)._spawnSeed,extraout_ECX); if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 900; return; } return; } } else if (this->_frameCnt < 1) { return; } LAB_0071f222: ANM2::Play(&this->_sprite,(byte *)"ReadyToExplode",0); return; default: return; } } //@@ 0071f250 GridEntity_TNT::Hurt /* ZHL [exact] bool Hurt(int damage, EntityRef* source); */ uint GridEntity_TNT::Hurt(uint param_1) { uint uVar1; uint uVar2; int iVar3; int in_ECX; int iVar4; uVar1 = Random(); uVar2 = uVar1 / 3; if (uVar1 % 3 == 0) { uVar2 = param_1 + 1; param_1 = 4; if ((int)uVar2 < 4) { param_1 = uVar2; } } else { } if (((int)param_1 < 1) || (uVar2 = *(uint *)(in_ECX + 0xc), 3 < (int)uVar2)) { return uVar2 & 0xffffff00; } iVar3 = uVar2 + param_1; iVar4 = 4; if (iVar3 < 4) { iVar4 = iVar3; } *(int *)(in_ECX + 0xc) = iVar4; return CONCAT31((int3)((uint)iVar3 >> 8),1); } //@@ 0071f2b0 GridEntity_TNT::Destroy /* ZHL [exact] bool Destroy(bool Immediate, EntityRef* Source); */ undefined4 GridEntity_TNT::Destroy(char param_1) { undefined4 uVar1; int *in_ECX; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; if (param_1 == '\0') { local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; uVar1 = (**(code **)(*in_ECX + 0x10))(4,&local_30); return uVar1; } if (3 < in_ECX[3]) { return 0; } in_ECX[0xf] = 0; ANM2::Play((ANM2 *)(in_ECX + 0x10),(byte *)"Blown",0); spawn_rock_particles(); if ((uint)in_ECX[9] < 0x1c0) { *(undefined4 *)((int)g_game->_room + in_ECX[9] * 4 + 0x76c) = 900; } in_ECX[3] = 4; in_ECX[0x55] = -1; return 1; } //@@ 0071f3f0 spawn_rock_particles /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX = position (Vector*): Game::SpawnParticles(pos, effect 27, 2..4 count, speed 2..6, white Color, ...); called when a rock grid is blown (Entity::DestroyRockGridAt type 12 after BombExplosionEffects, GridEntity_TNT::Destroy "Blown") */ void spawn_rock_particles(void) { double dVar1; uint uVar2; uint uVar3; Vector *in_ECX; ColorMod local_34; float local_8; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); local_34._tint[0] = 1.0; local_34._tint[1] = 1.0; local_34._tint[2] = 1.0; local_34._tint[3] = 1.0; local_34._offset[0] = 0.0; local_34._offset[1] = 0.0; local_34._offset[2] = 0.0; local_34._colorize[0] = 0.0; local_34._colorize[1] = 0.0; local_34._colorize[2] = 0.0; local_34._colorize[3] = 0.0; uVar2 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]; uVar3 = Random(); Game::SpawnParticles (g_game,in_ECX,0x1b,uVar3 % 3 + 2, (float)((double)(int)uVar2 + dVar1) * 2.3283064e-10 * 4.0 + 2.0,&local_34,100000.0,0); return; } //@@ 0071f4b0 FUN_0071f4b0 void FUN_0071f4b0(uint param_1) { int *piVar1; void *pvVar2; code *pcVar3; Game *pGVar4; uint seed; Vector *in_ECX; uint subType; Vector local_c; if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } param_1 = param_1 >> 1 ^ param_1; param_1 = param_1 << 5 ^ param_1; param_1 = param_1 >> 0x10 ^ param_1; if (param_1 % 100 == 0) { Isaac::GetRandomPickupVelocity(&local_c,in_ECX,1,(RNG *)0x0); pGVar4 = g_game; if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } param_1 = param_1 >> 1 ^ param_1; param_1 = param_1 << 5 ^ param_1; if ((((((param_1 >> 0x10 ^ param_1) & 1) == 0) && (pvVar2 = (g_game->_itemPool)._trinketPoolItems._begin, 400 < (int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar2 & 0xfffffff8U))) && (*(char *)((int)pvVar2 + 0x194) != '\0')) && (*(char *)((int)pvVar2 + 0x195) != '\0')) { *(undefined1 *)((int)pvVar2 + 0x194) = 0; piVar1 = &(pGVar4->_itemPool)._numAvailableTrinkets; *piVar1 = *piVar1 + -1; seed = Random(); subType = 0x32; } else { pvVar2 = (g_game->_itemPool)._trinketPoolItems._begin; if ((int)((int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar2 & 0xfffffff8U) < 0x149 ) { return; } if (*(char *)((int)pvVar2 + 0x14c) == '\0') { return; } if (*(char *)((int)pvVar2 + 0x14d) == '\0') { return; } *(undefined1 *)((int)pvVar2 + 0x14c) = 0; piVar1 = &(pGVar4->_itemPool)._numAvailableTrinkets; *piVar1 = *piVar1 + -1; seed = Random(); subType = 0x29; } Game::Spawn(g_game,5,0x15e,in_ECX,&local_c,(Entity *)0x0,subType,seed); } return; } //@@ 0071f600 Level::filter_curses /* DB: ~prevented & (forced|game|level curses) & mask prototype: db/protos.zhl, confirmed by RET 4 */ uint __thiscall Level::filter_curses(Level *this,uint mask) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uVar1 = g_game->_debugCurses; uVar2 = this->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); return ~uVar4 & (uVar3 | uVar1 | uVar2) & mask; } //@@ 0071f630 GridEntity_TrapDoor::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_TrapDoor::BeginBatches(void) { byte bVar1; uint forcedCurses; uint preventedCurses; LayerState *layer; Vector *position; Entity *effect; char *pcVar2; ChallengeParam *challengeParams; byte extraout_CL; byte extraout_CL_00; byte unk; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; char *freeBlock; uint uVar3; int iVar4; Vector local_54; int local_4c; char isHardMode; char *tmpPath [4]; uint tmpPathSize; uint tmpPathCapacity; std_string anm2Path; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; uint curses; void *room; int *roomData; ANM2 *sprite; local_8 = 0xffffffff; puStack_c = &LAB_00afcc85; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&anm2Path)[1]._size; ExceptionList = &local_10; local_4c = g_game->_stage; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { isHardMode = '\x01'; } else { isHardMode = '\0'; } uVar3 = g_game->_debugCurses; curses = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); iVar4 = local_4c; if (((~preventedCurses & (forcedCurses | uVar3 | curses) & 2) != 0) && (isHardMode == '\0')) { iVar4 = local_4c + 1; } local_4c = g_game->_currentRoomIdx; if (((iVar4 == 9) && (local_4c == -9)) || (((GridEntityDesc *)((int)local_54.y + 4))->_varData == 1)) { anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1a; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/VoidTrapdoor.anm2",0x1b); local_8 = 0; ANM2::Load((ANM2 *)((int)local_54.y + 0x40),&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } ((GridEntityDesc *)((int)local_54.y + 4))->_variant = 1; goto LAB_0071feb0; } room = g_game->_room; if (*(int *)((int)room + 8) == 0x1b) { sprite = (ANM2 *)((int)local_54.y + 0x40); iVar4 = *(int *)(*(int *)((int)room + 4) + 0x10); if (iVar4 != 0) { iVar4 = *(int *)(iVar4 + 0x10); if (iVar4 == 1) { anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1f; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/trapdoor_downpour.anm2",0x20); local_8 = 1; ANM2::Load(sprite,&anm2Path,1); local_8 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0071feb0; uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto LAB_0071fb7a; } if (iVar4 == 2) { anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1c; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/trapdoor_mines.anm2",0x1d); local_8 = 2; ANM2::Load(sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } if (1 < (uint)((ANM2 *)((int)local_54.y + 0x40))->_layerCount) { layer = ANM2::GetLayer((ANM2 *)((int)local_54.y + 0x40),(byte *)0x1); layer->_visible = 0; } ANM2::Play(sprite,(byte *)"Closed",0); uVar3 = Random(); position = GridEntity::Position((GridEntity *)local_54.y,&local_54); effect = Game::Spawn(g_game,1000,0x8b,position,&g_vectorZero,(Entity *)0x0,0,uVar3); iVar4 = *(int *)effect; *(int *)&effect[1].field_0x44 = *(int *)((int)local_54.y + 0x24); (**(code **)(iVar4 + 0xc))(); goto LAB_0071feb0; } anm2Path._size = iVar4 - 3; if (anm2Path._size == 0) { anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(iVar4 + 0x2d); anm2Path._size = 0x20; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/trapdoor_mausoleum.anm2",0x21); local_8 = 3; goto LAB_0071f766; } } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1e; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/Door_11_TrapDoor.anm2",0x1f); local_8 = 4; ANM2::Load(sprite,&anm2Path,1); local_8 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0071feb0; uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { uVar3 = anm2Path._capacity + 0x24; freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)*(char **)(anm2Path._buf._0_4_ + -4)))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { if (((*(int *)((int)room + 8) != 5) || (roomData = *(int **)(*(int *)((int)room + 4) + 0x10), *roomData != 0)) || (roomData[4] != 0x58)) { if (((1 < iVar4 - 6U) || (isHardMode != '\0')) && (((iVar4 != 3 || (isHardMode == '\0')) && (local_4c != -8)))) { tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = (char *)0x0; std::string::assign((char *)tmpPath,(byte *)"gfx/grid/Door_11_TrapDoor.anm2",0x1e); local_8 = 9; ANM2::Load((ANM2 *)((int)local_54.y + 0x40),(std_string *)tmpPath,1); local_8 = 0xffffffff; if (0xf < tmpPathCapacity) { uVar3 = tmpPathCapacity + 1; freeBlock = tmpPath[0]; if (0xfff < uVar3) { freeBlock = *(char **)(tmpPath[0] + -4); uVar3 = tmpPathCapacity + 0x24; if ((char *)0x1f < tmpPath[0] + (-4 - (int)freeBlock)) goto LAB_0071f7a4; } operator_delete(freeBlock,uVar3); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = (char *)((uint)tmpPath[0] & 0xffffff00); goto LAB_0071feb0; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1e; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/Door_11_Wombhole.anm2",0x1f); local_8 = 6; ANM2::Load((ANM2 *)((int)local_54.y + 0x40),&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_0071f7a4; } operator_delete(freeBlock,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; if (local_4c == -8) { tmpPath[0] = std::_Allocate(0x30); tmpPathSize = 0x22; tmpPathCapacity = 0x2f; builtin_strncpy(tmpPath[0],"gfx/grid/door_11_wombhole_blue.png",0x23); local_8 = 7; Sprite::ReplaceSpritesheet((Sprite *)((int)local_54.y + 0x40),0,(std_string *)tmpPath); local_8 = 0xffffffff; bVar1 = extraout_CL; if (0xf < tmpPathCapacity) { uVar3 = tmpPathCapacity + 1; freeBlock = tmpPath[0]; if (0xfff < uVar3) { freeBlock = *(char **)(tmpPath[0] + -4); pcVar2 = tmpPath[0] + (-4 - (int)freeBlock); joined_r0x0071fe08: uVar3 = tmpPathCapacity + 0x24; if ((char *)0x1f < pcVar2) { LAB_0071f7a4: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_0071fe0e: local_8 = 0xffffffff; operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_04; } } else { bVar1 = Level::IsMausoleumHeartStage((Level *)g_game); if (bVar1 == 0) { if (iVar4 == 7) { bVar1 = Level::IsAltPath((Level *)g_game); if (bVar1 == 0) { ANM2::LoadGraphics((ANM2 *)((int)local_54.y + 0x40),unk); goto LAB_0071feb0; } } else if (((iVar4 != 6) && ((bVar1 = extraout_CL_00, iVar4 != 5 || (uVar3 = Level::filter_curses((Level *)g_game,2), bVar1 = extraout_CL_01, uVar3 == 0)))) || (challengeParams = Game::GetChallengeParams(g_game), bVar1 = extraout_CL_02, challengeParams->_pathType != 2)) goto LAB_0071fe18; } tmpPath[0] = std::_Allocate(0x20); tmpPathSize = 0x1f; tmpPathCapacity = 0x1f; builtin_strncpy(tmpPath[0],"gfx/grid/door_11_corpsehole.png",0x20); local_8 = 8; Sprite::ReplaceSpritesheet((Sprite *)((int)local_54.y + 0x40),0,(std_string *)tmpPath); local_8 = 0xffffffff; bVar1 = extraout_CL_03; if (0xf < tmpPathCapacity) { uVar3 = tmpPathCapacity + 1; freeBlock = tmpPath[0]; if (0xfff < uVar3) { freeBlock = *(char **)(tmpPath[0] + -4); pcVar2 = tmpPath[0] + (-4 - (int)freeBlock); goto joined_r0x0071fe08; } goto LAB_0071fe0e; } } LAB_0071fe18: ANM2::LoadGraphics((ANM2 *)((int)local_54.y + 0x40),bVar1); goto LAB_0071feb0; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x21; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/grid/trapdoor_corpse_big.anm2",0x22); local_8 = 5; LAB_0071f766: anm2Path._capacity = 0x2f; ANM2::Load((ANM2 *)((int)local_54.y + 0x40),&anm2Path,1); local_8 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0071feb0; uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { uVar3 = anm2Path._capacity + 0x24; freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)*(char **)(anm2Path._buf._0_4_ + -4)))) goto LAB_0071f7a4; } } LAB_0071fb7a: local_8 = 0xffffffff; operator_delete(freeBlock,uVar3); LAB_0071feb0: ((GridEntityDesc *)((int)local_54.y + 4))->_state = 0; ANM2::Play((ANM2 *)((int)local_54.y + 0x40),(byte *)"Closed",0); ExceptionList = local_10; return; } //@@ 0071fef0 GridEntity_TrapDoor::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 2] */ void __thiscall GridEntity_TrapDoor::Update(GridEntity_TrapDoor *this) { uint *puVar1; char *pcVar2; qword qVar3; undefined3 uVar4; byte bVar5; Entity_Player *pEVar6; uint forcedCurses; uint preventedCurses; int iVar7; byte *animNameCursor; byte *pbVar8; char *******pppppppcVar9; undefined4 *playerSlot; ChallengeParam *challengeParams; uint preventedCurses; uint uVar11; int *piVar12; char *pcVar13; void *pvVar14; Level *this_00; Game *this_01; undefined3 extraout_var; undefined4 extraout_EDX; int extraout_EDX_00; int extraout_EDX_01; qword *allocatedBytes; Game *game; GridEntity_TrapDoor *trapDoor; PlayerManager *playerManager; int iVar15; undefined4 uVar16; bool bVar17; float deltaY; float deltaX; double dVar18; EntityList_EL nearbyEntities; float local_58; uint local_54; GridEntity_TrapDoor *savedTrapDoor; Vector local_4c; Entity_Player *local_44; float local_40; int *local_3c; char local_35; int *local_34; char local_2d; char *******spritePath [4]; undefined4 spritePathSize; uint spritePathCapacity; uint local_14; void *local_10; undefined1 *puStack_c; char ******local_8; Manager *manager; RoomDescriptor *roomDesc; game = g_game; local_8 = (char ******)0xffffffff; puStack_c = &LAB_00afccc9; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(spritePath + 10); ExceptionList = &local_10; local_54 = 0; *(int *)(this + 1) = *(int *)(this + 1) + 1; iVar15 = *(int *)((int)game->_room + 0xc); local_4c.x = (float)(this->_gridIndex % iVar15) * 40.0 + 40.0; local_4c.y = (float)(this->_gridIndex / iVar15) * 40.0 + 120.0; savedTrapDoor = this; local_44 = Game::GetNearestPlayerEx(&local_4c,1,0,0); local_34._0_1_ = false; local_40 = 1e+09; local_58 = 21.0; pvVar14 = g_game->_room; if ((((*(int *)((int)pvVar14 + 8) == 5) && (piVar12 = *(int **)(*(int *)((int)pvVar14 + 4) + 0x10), *piVar12 == 0)) && (piVar12[4] == 0x58)) && ((this->_desc)._varData != 1)) { local_35 = '\x01'; local_58 = 34.0; } else { local_35 = '\0'; } iVar15 = this->_gridIndex; if (local_44 == (Entity_Player *)0x0) { local_3c = *(int **)((int)pvVar14 + 0xc); local_34._1_3_ = extraout_var; } else { local_3c = *(int **)((int)pvVar14 + 0xc); deltaY = ((float)(iVar15 / (int)local_3c) * 40.0 + 120.0) - (local_44->_pos).y; deltaX = ((float)(iVar15 % (int)local_3c) * 40.0 + 40.0) - (local_44->_pos).x; local_40 = sqrtf(deltaY * deltaY + deltaX * deltaX); local_34._0_1_ = local_40 < 50.0; local_34._1_3_ = (undefined3)((uint)extraout_EDX >> 8); } if (((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2))) && (((this->_desc)._spawnCount < 2 && ((*(int *)((int)pvVar14 + 8) == 5 && (local_35 == '\0'))) ))) { local_34._1_3_ = (undefined3)((uint)this >> 8); if (((bool)(char)local_34 == false) && (0x95 < *(uint *)(this + 1))) { local_34._0_1_ = false; } else { local_34._0_1_ = true; } } uVar4 = local_34._1_3_; bVar17 = (bool)(char)local_34; local_4c.x = (float)(iVar15 % (int)local_3c) * 40.0 + 40.0; local_4c.y = (float)(iVar15 / (int)local_3c) * 40.0 + 120.0; EntityList::QueryRadius((EntityList *)((int)pvVar14 + 0x1218),&nearbyEntities,&local_4c,20.0,1); preventedCurses = 0; local_8 = (char ******)0x0; if (nearbyEntities._size != 0) { do { local_34._1_3_ = uVar4; local_34._0_1_ = bVar17; if ((bool)(char)local_34 != false) break; iVar15 = *(int *)((int)nearbyEntities._data + preventedCurses * 4); if (*(int *)(iVar15 + 0x28) == 3) { local_34._0_1_ = false; local_34._1_3_ = 0; if (*(int *)(iVar15 + 0x2c) == 900) { local_34._0_1_ = true; local_34._1_3_ = 0; } } preventedCurses = preventedCurses + 1; bVar17 = (bool)(char)local_34; uVar4 = local_34._1_3_; } while (preventedCurses < (uint)nearbyEntities._size); } if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && (pEVar6 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x226,(RNG **)&g_game->_playerManager,1), pEVar6 != (Entity_Player *)0x0)) && (*(int *)((int)g_game->_room + 8) != 3)) { iVar15 = g_game->_stage; preventedCurses = g_game->_debugCurses; uVar11 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); game = g_game; iVar7 = iVar15 + 1; if ((~preventedCurses & (forcedCurses | preventedCurses | uVar11) & 2) == 0) { iVar7 = iVar15; } if (iVar7 == 6) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (char ******)((uint)local_8._1_3_ << 8); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)game->_currentDimensionIdx < 3) { roomDesc = game->_roomList + 0x1ff; } if (((uint)roomDesc->Flags >> 3 & 1) == 0) { local_34._0_1_ = '\x01'; } local_34._1_3_ = 0; } } game = g_game; local_4c.y = *(float *)((int)g_game->_room + 8); if (((Entity_Player *)local_4c.y == (Entity_Player *)0x1b) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { local_34._0_1_ = '\x01'; } local_3c = (int *)g_game->_stage; if (((0 < (int)local_3c) && ((int)local_3c < 7)) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { local_34._0_1_ = '\x01'; } if ((g_game->_dailyChallenge)._id == 0) { pvVar14 = (g_manager->_challengeParams)._begin; uVar11 = ((int)(g_manager->_challengeParams)._end - (int)pvVar14) / 0xa4 - 1; preventedCurses = -(uint)(g_game->_challenge != 0) & g_game->_challenge; if (uVar11 <= preventedCurses) { preventedCurses = uVar11; } challengeParams = (ChallengeParam *)(preventedCurses * 0xa4 + (int)pvVar14); } else { challengeParams = &(g_game->_dailyChallenge)._params; } if (challengeParams->_pathType == 2) { preventedCurses = g_game->_curses; uVar11 = g_game->_debugCurses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); piVar12 = (int *)((int)local_3c + 1); if ((~preventedCurses & (forcedCurses | preventedCurses | uVar11) & 2) == 0) { piVar12 = local_3c; } local_3c = piVar12; if (*(int *)((int)game->_room + 8) == 0x1b) { preventedCurses = game->_curses; uVar11 = game->_debugCurses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); preventedCurses = (~preventedCurses & (forcedCurses | preventedCurses | uVar11)) >> 1; if ((local_3c == (int *)0x2) || (((preventedCurses & 1) != 0 && (local_3c == (int *)0x1)))) { bVar17 = true; } else { bVar17 = false; } if ((local_3c == (int *)&DAT_00000004) || (((preventedCurses & 1) != 0 && (local_3c == (int *)0x3)))) { local_2d = '\x01'; } else { local_2d = '\0'; } if ((bVar17) && ((game->_stageType == 4 || (game->_stageType == 5)))) { pEVar6 = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x272,(RNG **)&game->_playerManager,1); if (pEVar6 == (Entity_Player *)0x0) goto LAB_0072040a; game = g_game; } if ((local_2d == '\0') || (((game->_stageType != 4 && (game->_stageType != 5)) || (pEVar6 = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x273,(RNG **)&game->_playerManager,1), pEVar6 != (Entity_Player *)0x0)))) goto LAB_00720400; } else { if (piVar12 != (int *)&DAT_00000006) { preventedCurses = game->_curses; uVar11 = game->_debugCurses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if (((~preventedCurses & (forcedCurses | preventedCurses | uVar11) & 2) == 0) || (local_3c != (int *)&DAT_00000005)) goto LAB_00720400; } if (((game->_stageType != 4) && (game->_stageType != 5)) || (((bVar5 = Level::IsMausoleumHeartStage((Level *)game), bVar5 != 0 || ((Entity_Player *)local_4c.y == (Entity_Player *)0x12)) || ((Entity_Player *)local_4c.y == (Entity_Player *)0x3)))) goto LAB_00720400; } LAB_0072040a: trapDoor = savedTrapDoor; piVar12 = &(savedTrapDoor->_desc)._state; if ((savedTrapDoor->_desc)._state != 0) goto LAB_00720515; pbVar8 = (savedTrapDoor->_sprite)._animState._animData; local_34 = piVar12; if (pbVar8 == (byte *)0x0) { LAB_00720469: bVar5 = ANM2::SetAnimation(&savedTrapDoor->_sprite,(byte *)"Closed",1); if (bVar5 != 0) { AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { animNameCursor = *(byte **)pbVar8; } pcVar13 = "Closed"; do { bVar5 = *animNameCursor; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_00720453: preventedCurses = -(uint)bVar17 | 1; goto LAB_00720458; } if (bVar5 == 0) break; bVar5 = animNameCursor[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_00720453; animNameCursor = animNameCursor + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; LAB_00720458: if ((preventedCurses != 0) || ((pbVar8[0x34] != 0 && ((savedTrapDoor->_sprite)._animState._isPlaying == 0)))) goto LAB_00720469; } piVar12 = &(trapDoor->_desc)._state; LAB_0072048e: game = g_game; } else { LAB_00720400: if ((char)local_34 != '\0') goto LAB_0072040a; piVar12 = &(savedTrapDoor->_desc)._state; LAB_00720515: trapDoor = savedTrapDoor; local_3c = piVar12; local_34 = piVar12; if (*piVar12 == 1) goto LAB_0072048e; game = g_game; if (g_game->_challenge != 0x1f) { if ((savedTrapDoor->_sprite)._animState._animData == (void *)0x0) { LAB_007205c9: pbVar8 = (savedTrapDoor->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { animNameCursor = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { animNameCursor = *(byte **)pbVar8; } pcVar13 = "Open Animation"; do { bVar5 = *animNameCursor; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_00720600: preventedCurses = -(uint)bVar17 | 1; goto LAB_00720605; } if (bVar5 == 0) break; bVar5 = animNameCursor[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_00720600; animNameCursor = animNameCursor + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; LAB_00720605: if ((preventedCurses == 0) && ((pbVar8[0x34] == 0 || ((savedTrapDoor->_sprite)._animState._isPlaying != 0)))) goto LAB_00720642; } bVar5 = ANM2::SetAnimation(&savedTrapDoor->_sprite,(byte *)"Open Animation",1); if (bVar5 != 0) { AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } } else { pbVar8 = (savedTrapDoor->_sprite)._animState._animData; if ((savedTrapDoor->_sprite)._animState._isPlaying == 0) { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar13 = "Open Animation"; do { bVar5 = *pbVar8; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_007205c0: preventedCurses = -(uint)bVar17 | 1; goto joined_r0x007205c7; } if (bVar5 == 0) break; bVar5 = pbVar8[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_007205c0; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; } else { if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar13 = "Open Animation"; do { bVar5 = *pbVar8; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_00720580: preventedCurses = -(uint)bVar17 | 1; goto joined_r0x007205c7; } if (bVar5 == 0) break; bVar5 = pbVar8[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_00720580; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; } joined_r0x007205c7: if (preventedCurses != 0) goto LAB_007205c9; } LAB_00720642: game = g_game; if (((trapDoor->_sprite)._animState._animData == (void *)0x0) || ((trapDoor->_sprite)._animState._isPlaying == 0)) { LAB_00720701: local_2d = '\0'; } else { pbVar8 = (trapDoor->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pcVar13 = "Open Animation"; do { bVar5 = *pbVar8; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_00720690: preventedCurses = -(uint)bVar17 | 1; goto LAB_00720695; } if (bVar5 == 0) break; bVar5 = pbVar8[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_00720690; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; LAB_00720695: if (preventedCurses != 0) goto LAB_00720701; local_4c.y = (trapDoor->_sprite)._animState._animFrame; dVar18 = floor((double)local_4c.y); local_4c.y = (float)dVar18; if ((int)dVar18 != 1) goto LAB_00720701; std::string::string((char *)spritePath,&trapDoor->_sprite); local_54 = 3; pppppppcVar9 = (char *******)spritePath; if (0xf < spritePathCapacity) { pppppppcVar9 = spritePath[0]; } iVar15 = _strnicmp((char *)pppppppcVar9,"gfx/grid/Door_11_TrapDoor",0x19); local_2d = '\x01'; game = g_game; if (iVar15 != 0) goto LAB_00720701; } if ((local_54 & 1) != 0) { if (0xf < spritePathCapacity) { preventedCurses = spritePathCapacity + 1; pppppppcVar9 = spritePath[0]; if (0xfff < preventedCurses) { pppppppcVar9 = (char *******)spritePath[0][-1]; preventedCurses = spritePathCapacity + 0x24; if ((char *)0x1f < (char *)((int)spritePath[0] + (-4 - (int)pppppppcVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppcVar9,preventedCurses); game = g_game; } spritePathSize = 0; spritePathCapacity = 0xf; spritePath[0] = (char *******)((uint)spritePath[0] & 0xffffff00); } manager = g_manager; if (local_2d != '\0') { local_54 = 0x395; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,local_54,1.0,2,0,1.0,0.0); game = g_game; } piVar12 = local_3c; if (((trapDoor->_sprite)._animState._animData == (void *)0x0) || ((trapDoor->_sprite)._animState._isPlaying == 0)) { local_34 = local_3c; *local_3c = 1; } else { local_34 = local_3c; } } } if ((game->_difficulty == 2) || (game->_difficulty == 3)) { if (((*(byte *)(*(int *)((int)game->_room + 4) + 0x44) & 1) == 0) && (trapDoor->_spawnFrame <= *(int *)((int)game->_room + 0x11f0))) { pbVar8 = (trapDoor->_sprite)._animState._animData; if (pbVar8 == (byte *)0x0) { LAB_007207ef: bVar5 = ANM2::SetAnimation(&trapDoor->_sprite,(byte *)"Closed",1); if (bVar5 != 0) { AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } game = g_game; } else { animNameCursor = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { animNameCursor = *(byte **)pbVar8; } pcVar13 = "Closed"; do { bVar5 = *animNameCursor; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_007207d1: preventedCurses = -(uint)bVar17 | 1; goto LAB_007207d6; } if (bVar5 == 0) break; bVar5 = animNameCursor[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_007207d1; animNameCursor = animNameCursor + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; LAB_007207d6: if ((preventedCurses != 0) || ((pbVar8[0x34] != 0 && ((trapDoor->_sprite)._animState._isPlaying == 0)))) goto LAB_007207ef; } *local_34 = 0; piVar12 = local_34; } } if (*piVar12 == 1) { bVar5 = Level::IsMausoleumHeartStage((Level *)game); if ((bVar5 == 0) || ((trapDoor->_desc)._varData != 0)) { pbVar8 = (trapDoor->_sprite)._animState._animData; if (pbVar8 != (byte *)0x0) { animNameCursor = pbVar8; if (0xf < *(uint *)(pbVar8 + 0x14)) { animNameCursor = *(byte **)pbVar8; } pcVar13 = "Opened"; do { bVar5 = *animNameCursor; bVar17 = bVar5 < (byte)*pcVar13; if (bVar5 != *pcVar13) { LAB_007208b0: preventedCurses = -(uint)bVar17 | 1; goto LAB_007208b5; } if (bVar5 == 0) break; bVar5 = animNameCursor[1]; bVar17 = bVar5 < (byte)pcVar13[1]; if (bVar5 != pcVar13[1]) goto LAB_007208b0; animNameCursor = animNameCursor + 2; pcVar13 = pcVar13 + 2; } while (bVar5 != 0); preventedCurses = 0; LAB_007208b5: if ((preventedCurses == 0) && ((pbVar8[0x34] == 0 || ((trapDoor->_sprite)._animState._isPlaying != 0)))) goto LAB_007208e8; } bVar5 = ANM2::SetAnimation(&trapDoor->_sprite,(byte *)"Opened",1); if (bVar5 != 0) { AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } } else { bVar5 = ANM2::SetAnimation(&trapDoor->_sprite,(byte *)"Opened",1); if (((bVar5 != 0) && ((trapDoor->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(trapDoor->_sprite)._animState,0.0), (trapDoor->_sprite)._animState._animData != (void *)0x0)) { (trapDoor->_sprite)._animState._isPlaying = 0; } } LAB_007208e8: piVar12 = local_34; game = g_game; } pEVar6 = local_44; manager = g_manager; if (((local_44 == (Entity_Player *)0x0) || (local_58 <= local_40)) || (*piVar12 != 1)) goto LAB_00720a92; if ((local_44->_isPlayingExtraAnimation != 0) || (local_44->_isPlayingItemAnimation != 0)) { if (((EntityPtr)local_44->_heldEntity == (EntityPtr)0x0) || ((EntityPtr)local_44->_heldEntity != local_44->_twinPlayer)) goto LAB_00720a92; } if (local_35 != '\0') { local_40 = 1.47417e-42; seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,2,0,1.0,0.0); game = g_game; g_game->_leaveDoor = -1; Game::StartRoomTransition(game,-10,-1,0x16,local_44,-1); preventedCurses = 0; playerManager = &g_game->_playerManager; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar14 = (playerManager->_playerList)._end; if ((int)pvVar14 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar14 = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (preventedCurses < (uint)((int)pvVar14 - (int)playerSlot >> 2)) { playerSlot = playerSlot + preventedCurses; } pEVar6 = (Entity_Player *)*playerSlot; if (pEVar6->_variant == 0) { Entity_Player::PlayExtraAnimation(pEVar6,(byte *)"Trapdoor"); game = g_game; iVar15 = savedTrapDoor->_gridIndex; iVar7 = *(int *)((int)g_game->_room + 0xc); (pEVar6->_moveToTarget).x = (float)(iVar15 % iVar7) * 40.0 + 40.0; (pEVar6->_moveToTarget).y = (float)(iVar15 / iVar7) * 40.0 + 120.0; } playerManager = &game->_playerManager; preventedCurses = preventedCurses + 1; } while (preventedCurses < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } goto LAB_00720a92; } if (game->_currentRoomIdx == -0x14) { Game::StartRoomTransition(game,-2,-1,2,local_44,-1); } else { local_40 = 1.47417e-42; seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,2,0,1.0,0.0); if ((*(int *)((int)g_game->_room + 8) == 0x1b) || (bVar5 = Level::IsMausoleumHeartStage((Level *)g_game), bVar5 != 0)) { game = g_game; qVar3 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x1000; *(int *)&game->_gameStateFlags = (int)qVar3; bVar5 = Level::HasPhotoDoor((Level *)game); game = g_game; if (bVar5 == 0) goto LAB_00720c10; qVar3 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x8000; *(int *)&game->_gameStateFlags = (int)qVar3; } else { LAB_00720c10: game = g_game; } bVar5 = Game::IsInTimedSet(game,0x10); if (bVar5 == 0) { if (10 < game->_stage) { iVar15 = _get_index_plus_one_if_kind_4_5(); Seeds::ForgetStageSeed(&game->_seedEffects,iVar15); game = g_game; } if ((trapDoor->_desc)._varData == 1) { Game::StartStageTransition(game,0,3); pEVar6 = local_44; } else { preventedCurses = Level::filter_curses((Level *)game,2); game = g_game; local_2d = preventedCurses != 0; bVar5 = Level::IsAltPath((Level *)g_game); if ((bVar5 == 0) || ((extraout_EDX_00 != 2 && ((extraout_EDX_00 != 1 || (local_2d == '\0')))))) { local_35 = '\0'; } else { local_35 = '\x01'; } bVar5 = Level::IsAltPath(this_00); if ((bVar5 == 0) || ((extraout_EDX_01 != 4 && ((extraout_EDX_01 != 3 || (local_2d == '\0')))))) { local_2d = '\0'; } else { local_2d = '\x01'; } challengeParams = Game::GetChallengeParams(this_01); if ((challengeParams->_pathType == 2) && (game->_challenge != 0x2c)) { if (local_35 == '\0') { LAB_00720d10: if (local_2d != '\0') { pEVar6 = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x273,(RNG **)&game->_playerManager,1); if (pEVar6 == (Entity_Player *)0x0) goto LAB_00720d35; game = g_game; } goto LAB_00720e0b; } pEVar6 = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x272,(RNG **)&game->_playerManager,1); if (pEVar6 != (Entity_Player *)0x0) { game = g_game; goto LAB_00720d10; } LAB_00720d35: Game::StartRoomTransition(g_game,g_game->_startingRoomIdx,-1,0x16,local_44,0); preventedCurses = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { local_4c.y = (float)Game::GetPlayer(game,preventedCurses); if (((Entity_Player *)local_4c.y)->_variant == 0) { Entity_Player::PlayExtraAnimation((Entity_Player *)local_4c.y,(byte *)"Trapdoor"); game = g_game; iVar15 = trapDoor->_gridIndex; iVar7 = *(int *)((int)g_game->_room + 0xc); ((Vector *)((int)local_4c.y + 0x1b1c))->x = (float)(iVar15 % iVar7) * 40.0 + 40.0; ((Vector *)((int)local_4c.y + 0x1b1c))->y = (float)(iVar15 / iVar7) * 40.0 + 120.0; } else { game = g_game; } preventedCurses = preventedCurses + 1; } while (preventedCurses < (uint)((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2)); pEVar6 = local_44; goto LAB_00720b0f; } } else { LAB_00720e0b: Game::StartStageTransition(game,0,0); } pEVar6 = local_44; } } else { Game::StartStageTransition(game,1,0); pEVar6 = local_44; } } LAB_00720b0f: Entity_Player::PlayExtraAnimation(pEVar6,(byte *)"Trapdoor"); game = g_game; iVar15 = trapDoor->_gridIndex; iVar7 = *(int *)((int)g_game->_room + 0xc); (pEVar6->_moveToTarget).x = (float)(iVar15 % iVar7) * 40.0 + 40.0; (pEVar6->_moveToTarget).y = (float)(iVar15 / iVar7) * 40.0 + 120.0; LAB_00720a92: trapDoor = savedTrapDoor; pcVar13 = game->_room; local_4c.y = (float)pcVar13; if (((*pcVar13 != '\0') && (iVar15 = game->_frameCount - *(int *)(pcVar13 + 0x11f0), iVar15 == (iVar15 / 0xf) * 0xf)) && (((game->_stage == 9 && (game->_currentRoomIdx == -9)) || ((savedTrapDoor->_desc)._varData == 1)))) { bVar17 = game->_currentRoomIdx != -7; if (bVar17) { local_44 = (Entity_Player *)0x3d4ccccd; } else { local_44 = (Entity_Player *)0x3cf5c28f; } uVar16 = 6; if (bVar17) { uVar16 = 0xd; } if (*local_34 != 1) { local_44 = (Entity_Player *)((float)local_44 * 0.2); } iVar15 = savedTrapDoor->_gridIndex; *(int *)(pcVar13 + 0x70fc) = *(int *)(pcVar13 + 0x70fc) + 1; local_4c.y = (float)(iVar15 % *(int *)(pcVar13 + 0xc)) * 40.0 + 40.0; local_40 = (float)(iVar15 / *(int *)(pcVar13 + 0xc)) * 40.0 + 120.0; local_58 = (float)(*(uint *)(pcVar13 + 0x70fc) & 0x80000001); if ((int)local_58 < 0) { local_58 = (float)(((int)local_58 - 1U | 0xfffffffe) + 1); } if (1 < (uint)local_58) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } iVar15 = (int)local_58 + 0x407; *(float *)(pcVar13 + iVar15 * 0x1c) = local_4c.y; *(float *)(pcVar13 + iVar15 * 0x1c + 4) = local_40; pcVar2 = pcVar13 + iVar15 * 0x1c + 8; pcVar2[0] = '\0'; pcVar2[1] = '\0'; pcVar2[2] = '\0'; pcVar2[3] = '\0'; *(Entity_Player **)(pcVar13 + iVar15 * 0x1c + 0xc) = local_44; pcVar2 = pcVar13 + iVar15 * 0x1c + 0x10; pcVar2[0] = -0xc; pcVar2[1] = -3; pcVar2[2] = 'T'; pcVar2[3] = '<'; pcVar2 = pcVar13 + iVar15 * 0x1c + 0x14; pcVar2[0] = '\0'; pcVar2[1] = '\0'; pcVar2[2] = '\0'; pcVar2[3] = '\0'; *(undefined4 *)(pcVar13 + iVar15 * 0x1c + 0x18) = uVar16; } if ((trapDoor->_sprite)._loaded != 0) { AnimationState::Update(&(trapDoor->_sprite)._animState); AnimationState::Update(&(trapDoor->_sprite)._overlayAnimState); } if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { preventedCurses = *(uint *)((int)nearbyEntities._data + -4); qVar3 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - preventedCurses; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar3 < preventedCurses); free((void *)((int)nearbyEntities._data + -4)); } } ExceptionList = local_10; return; } //@@ 00720fe0 GridEntity_Wall::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity_Wall::Render(GridEntity_Wall *this,float *param_2) { ColorMod *pCVar1; void *pvVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; Vector *pVVar12; AnimationState *this_00; Vector local_44; Vector local_3c; undefined4 local_34 [12]; pvVar2 = g_game->_room; if (*(int *)((int)pvVar2 + 8) == 0x10) { fVar4 = *(float *)((int)pvVar2 + 0x72a4); fVar5 = *(float *)((int)pvVar2 + 0x72a8); fVar6 = *(float *)((int)pvVar2 + 0x72ac); fVar7 = *(float *)((int)pvVar2 + 0x72b0); fVar3 = *(float *)((int)pvVar2 + 0x72cc); fVar8 = *(float *)((int)pvVar2 + 0x72b4); fVar9 = *(float *)((int)pvVar2 + 0x72b8); fVar10 = *(float *)((int)pvVar2 + 0x72bc); fVar11 = *(float *)((int)pvVar2 + 0x72c0); pCVar1 = &(this->_sprite)._color; if (pCVar1 != (ColorMod *)local_34) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar2 + 0x72c4); pCVar1->_tint[0] = fVar4; (this->_sprite)._color._tint[1] = fVar5; (this->_sprite)._color._tint[2] = fVar6; (this->_sprite)._color._tint[3] = fVar7; (this->_sprite)._color._offset[2] = fVar3; (this->_sprite)._color._colorize[0] = fVar8; (this->_sprite)._color._colorize[1] = fVar9; (this->_sprite)._color._colorize[2] = fVar10; (this->_sprite)._color._colorize[3] = fVar11; } } pVVar12 = GridEntity::get_render_position((GridEntity *)this,&local_3c); local_44.x = *param_2 + pVVar12->x; local_44.y = pVVar12->y + param_2[1]; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_44,&g_vectorZero,&g_vectorZero); this_00 = &(this->_sprite)._animState; } AnimationState::Render(this_00,&local_44,&g_vectorZero,&g_vectorZero); } return; } //@@ 007210d0 GridEntity_Wall::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Wall::BeginBatches(GridEntity_Wall *this) { uint uVar1; Game *pGVar2; void *pvVar3; void *pvVar4; char *pcVar5; char *ptr; uint size; std_string local_44; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; pvVar3 = ExceptionList; pGVar2 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afcd0d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; this->_collisionClass = 4; pvVar4 = pGVar2->_room; if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)pvVar4 + this->_gridIndex * 4 + 0x76c) = 1000; pvVar4 = pGVar2->_room; } if (*(int *)((int)pvVar4 + 8) != 0x10) { ExceptionList = pvVar3; return; } if (*(int *)((int)pvVar4 + 0x1d18) == 0x37) { local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x30); local_2c._size = 0x26; local_2c._capacity = 0x2f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/grid/Tiles_Itemdungeon_Gideon.anm2",0x27); local_8 = 0; } else { if (*(int *)((int)pvVar4 + 0x1d18) != 0x38) { local_44._size = 0; local_44._capacity = 0xf; local_44._buf[0] = '\0'; local_44._buf[1] = '\0'; local_44._buf[2] = '\0'; local_44._buf[3] = '\0'; local_44._buf._0_4_ = std::_Allocate(0x20); local_44._size = 0x1f; local_44._capacity = 0x1f; builtin_strncpy((char *)local_44._buf._0_4_,"gfx/grid/Tiles_Itemdungeon.anm2",0x20); local_8 = 2; ANM2::Load(&this->_sprite,&local_44,1); if (local_44._capacity < 0x10) { ExceptionList = local_10; return; } pcVar5 = (char *)local_44._buf._0_4_; uVar1 = local_44._capacity; goto LAB_007211c8; } local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x1a; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 1; } ANM2::Load(&this->_sprite,&local_2c,1); if (local_2c._capacity < 0x10) { ExceptionList = local_10; return; } pcVar5 = (char *)local_2c._buf._0_4_; uVar1 = local_2c._capacity; LAB_007211c8: size = uVar1 + 1; ptr = pcVar5; if (0xfff < size) { ptr = *(char **)(pcVar5 + -4); size = uVar1 + 0x24; if ((char *)0x1f < pcVar5 + (-4 - (int)ptr)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); ExceptionList = local_10; return; } //@@ 00721310 GridEntity_Wall::PostInit /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GridEntity_Wall vtable slot 1; Brick/LowBrick/Decoration anims; ZHL prefix29/30 said Entity_Player::TryRemoveTrinket */ void __thiscall GridEntity_Wall::PostInit(GridEntity_Wall *this) { Room *this_00; uint uVar1; byte bVar2; uint uVar3; void *pvVar4; uint uVar5; int iVar6; void *pvVar7; char *anim; Vector local_34; byte local_2c [32]; uint local_c; local_c = __security_cookie ^ (uint)&local_34; this_00 = g_game->_room; if (this_00->_roomType != 0x10) { return; } if (this_00->_backdropType != 0x38) { iVar6 = (this->_desc)._variant; if (iVar6 == 1) { anim = "Decoration1"; } else if (iVar6 == 2) { anim = "Decoration2"; } else { local_34.x = (float)(this->_gridIndex % this_00->_gridWidth) * 40.0 + 40.0 + 0.0; local_34.y = ((float)(this->_gridIndex / this_00->_gridWidth) * 40.0 + 120.0) - 40.0; Room::GetGridEntityFromPos(this_00,&local_34); Random(); sprintf_s(local_2c,0x1f,&DAT_00b69520); anim = (char *)local_2c; } ANM2::Play(&this->_sprite,(byte *)anim,0); return; } uVar1 = this_00->_gridWidth; uVar3 = (uint)this->_gridIndex / uVar1; uVar5 = (uint)this->_gridIndex % uVar1; iVar6 = uVar3 - 1; if (((((int)uVar5 < 0) || ((int)uVar1 <= (int)uVar5)) || (iVar6 < 0)) || (this_00->_gridHeight <= iVar6)) { pvVar7 = (void *)0x0; if ((-1 < (int)uVar5) && ((int)uVar5 < (int)uVar1)) goto LAB_00721391; } else { iVar6 = uVar1 * iVar6 + uVar5; if (iVar6 < 0) { pvVar7 = (void *)0x0; } else { pvVar7 = this_00->_gridEntities[iVar6]; } LAB_00721391: iVar6 = uVar3 + 1; if (((-1 < iVar6) && (iVar6 < this_00->_gridHeight)) && (iVar6 = uVar1 * iVar6 + uVar5, -1 < iVar6)) { pvVar4 = this_00->_gridEntities[iVar6]; goto LAB_007213a9; } } pvVar4 = (void *)0x0; LAB_007213a9: local_34.x = 1.676745e-38; if (((pvVar7 == (void *)0x0) || (*(int *)((int)pvVar7 + 4) == 1)) || (*(int *)((int)pvVar7 + 4) == 0x13)) { local_34.x = 1.6767439e-38; } else if (((pvVar4 == (void *)0x0) || (*(int *)((int)pvVar4 + 4) == 1)) || (*(int *)((int)pvVar4 + 4) == 0x13)) { local_34.x = 1.676754e-38; } pvVar7 = ANM2::GetAnimationData(&this->_sprite,(byte *)local_34.x); if (pvVar7 != (void *)0x0) { iVar6 = *(int *)((int)pvVar7 + 0x30); bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)local_34.x,1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)((int)uVar5 % iVar6)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; return; } } return; } //@@ 00721540 GridEntity_Web::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Web::BeginBatches(GridEntity_Web *this) { byte bVar1; byte *curAnimName; uint startFrame; void *animData; char *pcVar2; uint startFrame; bool bVar4; std_string anmPath; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc99d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&anmPath)[1]._size; ExceptionList = &local_10; this->_collisionClass = 0; anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x20); anmPath._size = 0x16; anmPath._capacity = 0x1f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/grid/grid_web.anm2",0x17); local_8 = 0; ANM2::Load(&this->_sprite,&anmPath,1); local_8 = 0xffffffff; if (0xf < anmPath._capacity) { startFrame = anmPath._capacity + 1; pcVar2 = (char *)anmPath._buf._0_4_; if (0xfff < startFrame) { pcVar2 = *(char **)(anmPath._buf._0_4_ + -4); startFrame = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,startFrame); } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = anmPath._buf._0_4_ & 0xffffff00; if ((this->_desc)._state != 0) { bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Bombed",1); if (bVar1 == 0) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_10; return; } AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_10; return; } (this->_sprite)._animState._isPlaying = 0; ExceptionList = local_10; return; } curAnimName = (this->_sprite)._animState._animData; if (curAnimName != (byte *)0x0) { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } pcVar2 = "Swaying"; do { bVar1 = *curAnimName; bVar4 = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_00721670: startFrame = -(uint)bVar4 | 1; goto LAB_00721675; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar4 = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_00721670; curAnimName = curAnimName + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); startFrame = 0; LAB_00721675: if ((startFrame == 0) && ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_007216ad; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Swaying",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_007216ad: animData = (this->_sprite)._animState._animData; if ((animData == (void *)0x0) || (startFrame = *(uint *)((int)animData + 0x30), startFrame == 0)) { startFrame = 0; } else { startFrame = Random(); startFrame = startFrame % startFrame; animData = (this->_sprite)._animState._animData; } if ((animData != (void *)0x0) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)startFrame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } startFrame = Random(); (this->_sprite)._flipX = ~(byte)startFrame & 1; startFrame = Random(); (this->_sprite)._rotation = ((float)(startFrame & 3) + 0.0) * 90.0; ExceptionList = local_10; return; } //@@ 00721780 GridEntity_Web::Update /* ZHL [exact] void Update(); */ void __thiscall GridEntity_Web::Update(GridEntity_Web *this) { Entity_Player *this_00; int iVar1; ColorMod color; undefined1 auVar2 [32]; byte bVar3; uint uVar4; float *pfVar5; void *pvVar6; undefined4 *puVar7; PlayerManager *pPVar8; bool bVar9; float local_38; float local_34; EntityRef local_30; if ((this->_desc)._state == 0) { uVar4 = g_game->_frameCount & 0x80000003; bVar9 = uVar4 == 0; if ((int)uVar4 < 0) { bVar9 = (uVar4 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar9) { pPVar8 = &g_game->_playerManager; uVar4 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar8->_playerList)._begin >> 2 != 0) { do { pvVar6 = (pPVar8->_playerList)._end; puVar7 = (pPVar8->_playerList)._begin; if ((int)pvVar6 - (int)puVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (pPVar8->_playerList)._end; puVar7 = (pPVar8->_playerList)._begin; } if (uVar4 < (uint)((int)pvVar6 - (int)puVar7 >> 2)) { puVar7 = puVar7 + uVar4; } this_00 = (Entity_Player *)*puVar7; iVar1 = this_00->_entityGridCollisionClass; if ((((iVar1 != 0) && (iVar1 != 3)) && (iVar1 != 1)) && (iVar1 != 2)) { bVar3 = Entity_Player::HasCollectible(this_00,0x278,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(&this_00->_temporaryeffects,0x278), bVar3 != 0)) { if ((this->_desc)._type == 10) goto LAB_007219cb; *(bool *)&this_00[1]._damageEvents._begin = *(char *)&this_00[1]._damageEvents._begin != '\0'; } iVar1 = *(int *)((int)g_game->_room + 0xc); local_38 = ABS((this_00->_pos).y - ((float)(this->_gridIndex / iVar1) * 40.0 + 120.0)); local_34 = ABS((this_00->_pos).x - ((float)(this->_gridIndex % iVar1) * 40.0 + 40.0)); pfVar5 = &local_38; if (local_38 <= local_34) { pfVar5 = &local_34; } if (*pfVar5 <= 21.0 && *pfVar5 != 21.0) { local_30._type = 0; local_30._variant = 0; local_30._spawnerType = 0; local_30._spawnerVariant = 0; local_30._position.x = g_vectorZero.x; local_30._position.y = g_vectorZero.y; local_30._velocity.x = g_vectorZero.x; local_30._velocity.y = g_vectorZero.y; local_30._flags = 0; local_30._entity = (void *)0x0; auVar2 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3fa66666,0x3f8000003f800000))); color._offset[0] = 0.15686275; color._tint[0] = (float)auVar2._0_4_; color._tint[1] = (float)auVar2._4_4_; color._tint[2] = (float)auVar2._8_4_; color._tint[3] = (float)auVar2._12_4_; color._colorize[0] = (float)auVar2._16_4_; color._colorize[1] = (float)auVar2._20_4_; color._colorize[2] = (float)auVar2._24_4_; color._colorize[3] = (float)auVar2._28_4_; color._offset[1] = 0.15686275; color._offset[2] = 0.15686275; Entity::AddSlowing((Entity *)this_00,&local_30,4,0.75,color,0); } } LAB_007219cb: uVar4 = uVar4 + 1; pPVar8 = &g_game->_playerManager; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar8->_playerList)._begin >> 2)); } } } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } //@@ 00721a10 GridEntity_Web::Destroy /* ZHL [vtable slot 5] */ uint __thiscall GridEntity_Web::Destroy(GridEntity_Web *this) { byte bVar1; uint in_EAX; undefined3 extraout_var; void *pvVar2; if ((this->_desc)._state != 0) { return in_EAX & 0xffffff00; } (this->_desc)._state = 1; bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Bombed",1); pvVar2 = (void *)CONCAT31(extraout_var,bVar1); if ((bVar1 != 0) && (pvVar2 = (void *)0x0, (this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); pvVar2 = (this->_sprite)._animState._animData; if (pvVar2 != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } return CONCAT31((int3)((uint)pvVar2 >> 8),1); } //@@ 00721a70 History::AddHistoryItem /* ZHL [exact] __thiscall void History::AddHistoryItem(History_HistoryItem* historyItem); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall History::AddHistoryItem(History *this,void *historyItem) { void **ppvVar1; int *piVar2; int *piVar3; int iVar4; int iVar5; int *piVar6; int iVar7; if (this->_isLocked != 0) { return; } piVar2 = (this->_historyItems)._begin; piVar3 = (this->_historyItems)._end; piVar6 = piVar2; if (piVar2 != piVar3) { do { piVar6 = piVar6 + 7; } while (piVar6 != piVar3); piVar6 = piVar2; if (*(int *)historyItem < piVar3[-7]) { do { if (*(int *)historyItem < *piVar6) { FUN_00722250(&historyItem,piVar6,historyItem); iVar7 = ((int)piVar6 - (int)piVar2) / 0x1c + ((int)piVar6 - (int)piVar2 >> 0x1f); iVar5 = iVar7; goto LAB_00721b3f; } piVar6 = piVar6 + 7; } while (piVar6 != piVar3); goto LAB_00721b4c; } } if (piVar3 == (this->_historyItems)._capacity) { std::vector<28byte>::_Emplace_reallocate(piVar3,historyItem); } else { iVar5 = *(int *)((int)historyItem + 4); iVar7 = *(int *)((int)historyItem + 8); iVar4 = *(int *)((int)historyItem + 0xc); *piVar3 = *(int *)historyItem; piVar3[1] = iVar5; piVar3[2] = iVar7; piVar3[3] = iVar4; *(undefined8 *)(piVar3 + 4) = *(undefined8 *)((int)historyItem + 0x10); piVar3[6] = *(int *)((int)historyItem + 0x18); ppvVar1 = &(this->_historyItems)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x1c); } iVar5 = (int)(this->_historyItems)._end - (int)(this->_historyItems)._begin; iVar7 = iVar5 / 0x1c + (iVar5 >> 0x1f); iVar5 = iVar7 + -1; LAB_00721b3f: FUN_00722020(iVar5 - (iVar7 >> 0x1f)); LAB_00721b4c: HUD::mark_all_slots_dirty(&g_game->_hud,0,0); return; } //@@ 00721b70 FUN_00721b70 uint FUN_00721b70(int param_1) { void *pvVar1; void *pvVar2; int *piVar3; History *in_ECX; uint uVar4; if (in_ECX->_isLocked != 0) { return 0; } pvVar2 = (in_ECX->_historyItems)._begin; uVar4 = 0; pvVar1 = (in_ECX->_historyItems)._end; if (pvVar2 != pvVar1) { uVar4 = 0; do { if ((*(char *)(param_1 + 4) == *(char *)((int)pvVar2 + 4)) && (*(int *)(param_1 + 8) == *(int *)((int)pvVar2 + 8))) { piVar3 = (int *)std::vector::erase(¶m_1,pvVar2); History::remove_index_refs(in_ECX,(*piVar3 - (int)(in_ECX->_historyItems)._begin) / 0x1c); uVar4 = 0x100; break; } pvVar2 = (void *)((int)pvVar2 + 0x1c); } while (pvVar2 != pvVar1); } HUD::mark_all_slots_dirty(&g_game->_hud,0,0); return uVar4 >> 8; } //@@ 00721c00 History::RemoveHistoryItemByIndex /* ZHL [exact] __thiscall bool History::RemoveHistoryItemByIndex(int index); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall History::RemoveHistoryItemByIndex(History *this,int index) { void *pvVar1; int index_00; index_00 = index; if (this->_isLocked == 0) { pvVar1 = (this->_historyItems)._begin; if (index < ((int)(this->_historyItems)._end - (int)pvVar1) / 0x1c) { std::vector::erase(&index,(void *)((int)pvVar1 + index * 0x1c)); remove_index_refs(this,index_00); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); return 1; } } return 0; } //@@ 00721c80 History::merge /* DB: ? ECX = History (Entity_Player+0x1dec, _isLocked +0xc checked first), param = other player's History; merges both sorted vector<28byte> HistoryItem lists by first int into this, then mark_all_slots_dirty; only caller Entity_Player::remove_twin */ void History::merge(undefined4 *param_1) { int iVar1; int iVar2; int iVar3; int **in_ECX; uint size; int *piVar4; int *piVar5; int *local_40; int *local_3c; int *local_38; int *local_34; int *local_30; int **local_2c; int *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00afcd4d; local_1c = ExceptionList; ExceptionList = &local_1c; if (*(char *)(in_ECX + 3) == '\0') { local_40 = (int *)0x0; local_30 = (int *)0x0; local_14 = 0; local_28 = (int *)0x0; if (&local_40 != in_ECX) { local_40 = *in_ECX; local_30 = in_ECX[2]; *in_ECX = (int *)0x0; local_28 = in_ECX[1]; in_ECX[1] = (int *)0x0; in_ECX[2] = (int *)0x0; } piVar4 = (int *)*param_1; local_24 = (int *)param_1[1]; piVar5 = local_40; local_3c = local_28; local_38 = local_30; local_2c = in_ECX; while( true ) { while (piVar5 != local_28) { if ((piVar4 != local_24) && (*piVar4 < *piVar5)) goto LAB_00721d9e; local_34 = in_ECX[1]; if (local_34 == in_ECX[2]) { std::vector<28byte>::_Emplace_reallocate(local_34,piVar5); piVar5 = piVar5 + 7; in_ECX = local_2c; } else { iVar1 = piVar5[1]; iVar2 = piVar5[2]; iVar3 = piVar5[3]; *local_34 = *piVar5; local_34[1] = iVar1; local_34[2] = iVar2; local_34[3] = iVar3; iVar1 = piVar5[5]; local_34[4] = piVar5[4]; local_34[5] = iVar1; local_34[6] = piVar5[6]; in_ECX[1] = in_ECX[1] + 7; piVar5 = piVar5 + 7; } } if (piVar4 == local_24) break; LAB_00721d9e: local_34 = in_ECX[1]; if (local_34 == in_ECX[2]) { std::vector<28byte>::_Emplace_reallocate(local_34,piVar4); piVar4 = piVar4 + 7; in_ECX = local_2c; } else { iVar1 = piVar4[1]; iVar2 = piVar4[2]; iVar3 = piVar4[3]; *local_34 = *piVar4; local_34[1] = iVar1; local_34[2] = iVar2; local_34[3] = iVar3; iVar1 = piVar4[5]; local_34[4] = piVar4[4]; local_34[5] = iVar1; local_34[6] = piVar4[6]; in_ECX[1] = in_ECX[1] + 7; piVar4 = piVar4 + 7; } } HUD::mark_all_slots_dirty(&g_game->_hud,0,0); if (local_40 != (int *)0x0) { size = (((int)local_30 - (int)local_40) / 0x1c) * 0x1c; piVar4 = local_40; if (0xfff < size) { piVar4 = (int *)local_40[-1]; size = size + 0x23; if (0x1f < (uint)((int)local_40 + (-4 - (int)piVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar4,size); } } ExceptionList = local_1c; return; } //@@ 00721e60 FUN_00721e60 void FUN_00721e60(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6) { int *in_ECX; in_ECX[2] = param_1; in_ECX[3] = param_2; in_ECX[4] = param_3; in_ECX[5] = param_4; *(undefined1 *)(in_ECX + 1) = 1; *in_ECX = param_6; in_ECX[6] = param_5; if (param_6 < 0) { *in_ECX = g_game->_frameCount; } return; } //@@ 00721eb0 FUN_00721eb0 void FUN_00721eb0(void) { uint uVar1; void *pvVar2; byte bVar3; int *in_ECX; int *piVar4; int iVar5; int iVar6; int *piVar7; int local_18; int local_14; piVar7 = in_ECX + 5; *piVar7 = -1; in_ECX[6] = -1; in_ECX[7] = -1; in_ECX[8] = -1; in_ECX[9] = -1; in_ECX[10] = -1; in_ECX[0xb] = -1; in_ECX[0xc] = -1; in_ECX[0xd] = -1; in_ECX[0xe] = -1; in_ECX[0xf] = -1; in_ECX[0x10] = -1; in_ECX[0x11] = -1; in_ECX[0x12] = -1; in_ECX[0x13] = -1; in_ECX[0x14] = -1; bVar3 = Entity_Player::HasCollectible((Entity_Player *)in_ECX[4],0x26b,0); iVar6 = *in_ECX; iVar5 = 0; local_18 = 0; if (0 < (in_ECX[1] - iVar6) / 0x1c) { local_14 = 0; do { if ((int)((uint)(bVar3 != 0) * 4 + 8) <= iVar5) { return; } if (*(char *)(local_14 + 4 + iVar6) == '\0') { uVar1 = *(uint *)(local_14 + 8 + iVar6); if (g_game == (Game *)0x0) { if (-1 < (int)uVar1) goto LAB_00721f83; } else { if ((int)uVar1 < 0) { if (((int)uVar1 < 0) && (pvVar2 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar1 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2)) { piVar4 = (int *)**(undefined4 **)((int)pvVar2 + ~uVar1 * 4); } else { piVar4 = (int *)0x0; } } else { LAB_00721f83: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)uVar1) goto LAB_00721fd8; piVar4 = *(int **)((int)pvVar2 + uVar1 * 4); } if ((((piVar4 != (int *)0x0) && (*piVar4 != 3)) && (uVar1 != 0x290)) && ((uVar1 != 0x26b && ((piVar4[0x2e] & 0x8000U) == 0)))) { *piVar7 = local_18; iVar5 = iVar5 + 1; piVar7 = piVar7 + 1; } } } LAB_00721fd8: local_18 = local_18 + 1; local_14 = local_14 + 0x1c; iVar6 = *in_ECX; } while (local_18 < (in_ECX[1] - iVar6) / 0x1c); } return; } //@@ 00722020 FUN_00722020 void FUN_00722020(int param_1) { int iVar1; byte bVar2; int *in_ECX; uint uVar3; int *piVar4; uint uVar5; uVar5 = 0xffffffff; uVar3 = 0; piVar4 = in_ECX + 5; do { iVar1 = *piVar4; if ((iVar1 < 0) && ((int)uVar5 < 0)) { uVar5 = uVar3; } else if (param_1 <= iVar1) { *piVar4 = iVar1 + 1; } uVar3 = uVar3 + 1; piVar4 = piVar4 + 1; } while (uVar3 < 0x10); if (-1 < (int)uVar5) { if (*(char *)(*in_ECX + 4 + param_1 * 0x1c) == '\0') { bVar2 = Entity_Player::CanAddCollectibleToInventory ((Entity_Player *)(param_1 * 7),*(int *)(*in_ECX + 8 + param_1 * 0x1c)); if (bVar2 != 0) { in_ECX[uVar5 + 5] = param_1; } } } return; } //@@ 007220a0 History::remove_index_refs /* DB: ? thiscall History: for the 16 stored indices at +0x14 sets the removed index param to -1 and decrements larger ones, then recompacts; callers History::RemoveHistoryItemByIndex, Entity_Player::ChangePlayerType prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall History::remove_index_refs(History *this,int index) { void *pvVar1; History *pHVar2; History *pHVar3; int iVar4; int iVar5; int iVar6; int iVar7; pHVar3 = this + 1; pHVar2 = pHVar3; iVar6 = 0x10; do { iVar4 = iVar6; pvVar1 = (pHVar2->_historyItems)._begin; if (pvVar1 == (void *)index) { (pHVar2->_historyItems)._begin = (void *)0xffffffff; } else if (index < (int)pvVar1) { (pHVar2->_historyItems)._begin = (void *)((int)pvVar1 + -1); } pHVar2 = (History *)&(pHVar2->_historyItems)._end; iVar6 = iVar4 + -1; } while (iVar6 != 0); iVar7 = -1; iVar6 = 0; iVar4 = iVar4 + -5; do { pvVar1 = (pHVar3->_historyItems)._begin; iVar5 = iVar4; if ((int)pvVar1 < 0) { if (iVar7 < 0) { iVar5 = (-0x14 - (int)this) + (int)pHVar3; iVar7 = iVar6; } } else if (-1 < iVar7) { iVar7 = iVar7 + 1; iVar5 = iVar4 + 4; (pHVar3->_historyItems)._begin = *(void **)((int)&this[1]._historyItems._begin + iVar4); *(void **)((int)&this[1]._historyItems._begin + iVar4) = pvVar1; } iVar6 = iVar6 + 1; pHVar3 = (History *)&(pHVar3->_historyItems)._end; iVar4 = iVar5; } while (iVar6 < 0x10); return; } //@@ 00722140 std::vector::erase /* DB: 28-byte elem erase; History::RemoveHistoryItemByIndex */ void std::vector::erase(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; int in_ECX; undefined4 *puVar6; undefined4 *puVar7; puVar5 = param_2 + 7; puVar7 = *(undefined4 **)(in_ECX + 4); puVar6 = param_2; if (puVar5 != puVar7) { do { uVar2 = puVar5[1]; uVar3 = puVar5[2]; uVar4 = puVar5[3]; *puVar6 = *puVar5; puVar6[1] = uVar2; puVar6[2] = uVar3; puVar6[3] = uVar4; *(undefined8 *)(puVar6 + 4) = *(undefined8 *)(puVar5 + 4); puVar1 = puVar5 + 6; puVar5 = puVar5 + 7; puVar6[6] = *puVar1; puVar6 = puVar6 + 7; } while (puVar5 != puVar7); puVar7 = *(undefined4 **)(in_ECX + 4); } *(undefined4 **)(in_ECX + 4) = puVar7 + -7; *param_1 = param_2; return; } //@@ 007221a0 FUN_007221a0 void FUN_007221a0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<28byte>::_Emplace_reallocate(puVar1,param_1); return; } uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; *puVar1 = *param_1; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_1 + 4); puVar1[6] = param_1[6]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x1c; return; } //@@ 007221e0 std::vector<28byte>::_Tidy /* DB: frees a vector of trivially destructible 0x1c-byte elements; called twice from GameStatePlayer::~GameStatePlayer (00754d90); 00722330 std::vector<28byte>::_Emplace_reallocate std::vector<28byte>::_Emplace_reallocate */ void std::vector<28byte>::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x1c) * 0x1c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00722250 FUN_00722250 undefined4 * FUN_00722250(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined8 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 *puVar10; undefined4 uVar11; int in_ECX; puVar2 = *(undefined4 **)(in_ECX + 4); if (puVar2 == *(undefined4 **)(in_ECX + 8)) { uVar11 = std::vector<28byte>::_Emplace_reallocate(param_2,param_3); *param_1 = uVar11; return param_1; } if (param_2 == puVar2) { uVar11 = param_3[1]; uVar3 = param_3[2]; uVar4 = param_3[3]; *puVar2 = *param_3; puVar2[1] = uVar11; puVar2[2] = uVar3; puVar2[3] = uVar4; *(undefined8 *)(puVar2 + 4) = *(undefined8 *)(param_3 + 4); puVar2[6] = param_3[6]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x1c; *param_1 = param_2; return param_1; } uVar11 = param_3[6]; uVar3 = *param_3; uVar4 = param_3[1]; uVar5 = param_3[2]; uVar6 = param_3[3]; uVar1 = *(undefined8 *)(param_3 + 4); *puVar2 = puVar2[-7]; puVar2[1] = puVar2[-6]; puVar2[2] = puVar2[-5]; puVar2[3] = puVar2[-4]; *(undefined8 *)(puVar2 + 4) = *(undefined8 *)(puVar2 + -3); puVar2[6] = puVar2[-1]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x1c; puVar10 = puVar2; while (puVar2 = puVar2 + -7, puVar2 != param_2) { uVar7 = puVar2[-6]; uVar8 = puVar2[-5]; uVar9 = puVar2[-4]; puVar10[-7] = puVar2[-7]; puVar10[-6] = uVar7; puVar10[-5] = uVar8; puVar10[-4] = uVar9; *(undefined8 *)(puVar10 + -3) = *(undefined8 *)(puVar2 + -3); puVar10[-1] = puVar2[-1]; puVar10 = puVar10 + -7; } *param_2 = uVar3; param_2[1] = uVar4; param_2[2] = uVar5; param_2[3] = uVar6; *(undefined8 *)(param_2 + 4) = uVar1; param_2[6] = uVar11; *param_1 = param_2; return param_1; } //@@ 00722330 std::vector<28byte>::_Emplace_reallocate /* DB: element size 0x1c, max 0x9249249, grows x1.5, copies 7 dwords; History::AddHistoryItem and GameStatePlayer::read_part3 push history items */ undefined4 * std::vector<28byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { undefined4 *puVar1; uint uVar2; int iVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; void *pvVar8; int *in_ECX; uint uVar9; iVar3 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x1c; if (iVar4 == 0x9249249) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = (in_ECX[2] - *in_ECX) / 0x1c; if (0x9249249 - (uVar2 >> 1) < uVar2) { uVar9 = 0x9249249; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar9 = iVar4 + 1U; if (iVar4 + 1U <= uVar2) { uVar9 = uVar2; } if (0x9249249 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar8 = _Allocate(uVar9 * 0x1c); puVar1 = (undefined4 *)((int)pvVar8 + ((param_1 - iVar3) / 0x1c) * 0x1c); uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_2 + 4); puVar1[6] = param_2[6]; if (param_1 == in_ECX[1]) { FUN_007224f0(*in_ECX,in_ECX[1],pvVar8); } else { FUN_00722530(*in_ECX,param_1,pvVar8); FUN_00722530(param_1,in_ECX[1],puVar1 + 7); } FUN_00722460(pvVar8,iVar4 + 1,uVar9); return puVar1; } //@@ 00722460 FUN_00722460 void FUN_00722460(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x1c) * 0x1c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x1c; in_ECX[2] = param_1 + param_3 * 0x1c; return; } //@@ 007224f0 FUN_007224f0 void FUN_007224f0(undefined4 *param_1,undefined4 *param_2,int param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; if (param_1 != param_2) { param_3 = param_3 - (int)param_1; do { uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; puVar1 = (undefined4 *)(param_3 + (int)param_1); *puVar1 = *param_1; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; *(undefined8 *)(param_3 + 0x10 + (int)param_1) = *(undefined8 *)(param_1 + 4); *(undefined4 *)(param_3 + 0x18 + (int)param_1) = param_1[6]; param_1 = param_1 + 7; } while (param_1 != param_2); } return; } //@@ 00722530 FUN_00722530 void FUN_00722530(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; for (; param_1 != param_2; param_1 = param_1 + 7) { uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *param_3 = *param_1; param_3[1] = uVar1; param_3[2] = uVar2; param_3[3] = uVar3; *(undefined8 *)(param_3 + 4) = *(undefined8 *)(param_1 + 4); param_3[6] = param_1[6]; param_3 = param_3 + 7; } return; } //@@ 00722570 std::vector::assign /* DB: ECX vector, args [first,last) of 0x1c-byte elements (trivially copied 7 dwords, max 0x9249249): overwrite/grow-reallocate; Entity_Player::StoreGameState/RestoreGameState call it on player+0x1dec = History::_historyItems (db/fields.tsv stride 0x1c) */ void std::vector::assign(undefined4 *param_1,undefined4 *param_2) { uint uVar1; uint uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 *puVar6; int *in_ECX; uint uVar7; undefined4 *puVar8; int iVar9; undefined4 *puVar10; puVar6 = (undefined4 *)*in_ECX; puVar10 = (undefined4 *)in_ECX[1]; uVar1 = ((int)param_2 - (int)param_1) / 0x1c; uVar7 = ((int)puVar10 - (int)puVar6) / 0x1c; if (uVar1 <= uVar7) { puVar10 = puVar6; for (; param_1 != param_2; param_1 = param_1 + 7) { uVar3 = param_1[1]; uVar4 = param_1[2]; uVar5 = param_1[3]; *puVar10 = *param_1; puVar10[1] = uVar3; puVar10[2] = uVar4; puVar10[3] = uVar5; *(undefined8 *)(puVar10 + 4) = *(undefined8 *)(param_1 + 4); puVar10[6] = param_1[6]; puVar10 = puVar10 + 7; } in_ECX[1] = (int)(puVar6 + uVar1 * 7); return; } uVar2 = (in_ECX[2] - (int)puVar6) / 0x1c; if (uVar2 < uVar1) { if (0x9249249 < uVar1) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x9249249 - (uVar2 >> 1) < uVar2) { uVar7 = 0x9249249; } else { uVar7 = (uVar2 >> 1) + uVar2; if (uVar7 < uVar1) { uVar7 = uVar1; } } if (puVar6 != (undefined4 *)0x0) { FUN_0069dd40(puVar6,uVar2); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x9249249 < uVar7) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } puVar6 = _Allocate(uVar7 * 0x1c); *in_ECX = (int)puVar6; in_ECX[1] = (int)puVar6; in_ECX[2] = (int)(puVar6 + uVar7 * 7); uVar7 = 0; puVar10 = puVar6; } puVar8 = param_1 + uVar7 * 7; if (param_1 != puVar8) { iVar9 = (int)puVar6 - (int)param_1; do { uVar3 = param_1[1]; uVar4 = param_1[2]; uVar5 = param_1[3]; puVar6 = (undefined4 *)(iVar9 + (int)param_1); *puVar6 = *param_1; puVar6[1] = uVar3; puVar6[2] = uVar4; puVar6[3] = uVar5; *(undefined8 *)(iVar9 + 0x10 + (int)param_1) = *(undefined8 *)(param_1 + 4); *(undefined4 *)(iVar9 + 0x18 + (int)param_1) = param_1[6]; param_1 = param_1 + 7; } while (param_1 != puVar8); puVar10 = (undefined4 *)in_ECX[1]; } for (; puVar8 != param_2; puVar8 = puVar8 + 7) { uVar3 = puVar8[1]; uVar4 = puVar8[2]; uVar5 = puVar8[3]; *puVar10 = *puVar8; puVar10[1] = uVar3; puVar10[2] = uVar4; puVar10[3] = uVar5; *(undefined8 *)(puVar10 + 4) = *(undefined8 *)(puVar8 + 4); puVar10[6] = puVar8[6]; puVar10 = puVar10 + 7; } in_ECX[1] = (int)puVar10; return; } //@@ 00722740 FUN_00722740 void FUN_00722740(void) { undefined4 *in_ECX; *in_ECX = 0x3e800000; in_ECX[1] = 0x3f800000; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0xf; in_ECX[0xe] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0xf; in_ECX[0x14] = 0; in_ECX[0x18] = 0; in_ECX[0x19] = 0xf; return; } //@@ 007227d0 WispEntry::constructor /* DB: ? sets the wisp-config defaults (+0=2.0, +4=3.0, +8=0.1, +0xc=1.0, +0x10=30.0, +0x14 bool 1) and empty sub-records from +0x18; used by ItemConfig::load_wisps_xml for a new entry */ void WispEntry::constructor(void) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *puVar2; int iVar3; puVar2 = in_ECX + 6; *in_ECX = 0x40000000; in_ECX[1] = 0x40400000; iVar3 = 2; in_ECX[2] = 0x3dcccccd; in_ECX[3] = 0x3f800000; in_ECX[4] = 0x41f00000; *(undefined1 *)(in_ECX + 5) = 1; puVar1 = in_ECX + 0xb; do { *puVar2 = 0x3f800000; puVar2 = puVar2 + 0x12; puVar1[-4] = 0x3f333333; puVar1[-3] = 0; puVar1[-2] = 0x3f800000; puVar1[-1] = 0x3f800000; *puVar1 = 0x3f800000; puVar1[1] = 0x3f800000; puVar1[2] = 0; puVar1[3] = 0; puVar1[4] = 0; puVar1[5] = 0; puVar1[6] = 0; puVar1[7] = 0; puVar1[8] = 0; puVar1[9] = 0; puVar1[10] = 0; puVar1[0xb] = 0; puVar1[0xc] = 0; iVar3 = iVar3 + -1; puVar1 = puVar1 + 0x12; } while (iVar3 != 0); in_ECX[0x2a] = 0x3dcccccd; in_ECX[0x2b] = 0x3f800000; in_ECX[0x2c] = 0x3f800000; in_ECX[0x2d] = 0x3f800000; in_ECX[0x2e] = 0x3f800000; in_ECX[0x2f] = 0; in_ECX[0x30] = 0; in_ECX[0x31] = 0; in_ECX[0x32] = 0; in_ECX[0x33] = 0; in_ECX[0x34] = 0; in_ECX[0x35] = 0; in_ECX[0x36] = 0x3f800000; in_ECX[0x37] = 0x3f800000; in_ECX[0x38] = 0x3f800000; in_ECX[0x39] = 0x3f800000; in_ECX[0x3a] = 0; in_ECX[0x3b] = 0; in_ECX[0x3c] = 0; in_ECX[0x3d] = 0; in_ECX[0x3e] = 0; in_ECX[0x3f] = 0; in_ECX[0x40] = 0; in_ECX[0x41] = 0x3f800000; in_ECX[0x42] = 0x3f800000; in_ECX[0x43] = 0x3f800000; in_ECX[0x44] = 0x3f800000; in_ECX[0x45] = 0; in_ECX[0x46] = 0; in_ECX[0x47] = 0; in_ECX[0x48] = 0; in_ECX[0x49] = 0; in_ECX[0x4a] = 0; in_ECX[0x4b] = 0; in_ECX[0x4c] = 0x3f800000; in_ECX[0x4d] = 0x3f800000; in_ECX[0x4e] = 0x3f800000; in_ECX[0x4f] = 0x3f800000; in_ECX[0x50] = 0; in_ECX[0x51] = 0; in_ECX[0x52] = 0; in_ECX[0x53] = 0; in_ECX[0x54] = 0; in_ECX[0x55] = 0; in_ECX[0x56] = 0; in_ECX[0x57] = 0; in_ECX[0x5b] = 0; in_ECX[0x5c] = 0xf; *(undefined1 *)(in_ECX + 0x57) = 0; in_ECX[0x5d] = 0; in_ECX[0x61] = 0; in_ECX[0x62] = 0xf; *(undefined1 *)(in_ECX + 0x5d) = 0; in_ECX[99] = 1; *(undefined2 *)(in_ECX + 100) = 1; in_ECX[0x4f] = &DAT_bf800000; in_ECX[0x44] = &DAT_bf800000; in_ECX[0x18] = &DAT_bf800000; in_ECX[0x19] = &DAT_bf800000; in_ECX[0x1a] = 0xffffffff; in_ECX[0x1e] = &DAT_bf800000; return; } //@@ 00722a80 ItemConfig_Item::ItemConfig_Item /* DB: zero/empty-string init of the item record (std::strings at +0xc/+0x24/+0x3c/+0x88 with cap 0xf, +0x7c 0xf0001, -1 sentinels at +0xa4/+0xc8/+0xdc); ItemConfig::Load and ItemPool::CreateGlitchedCollectible call it right after new and then fill the gfx path ("gfx/promo/gfuel/items/collectibles/...") prototype: db/protos.zhl */ ItemConfig_Item * __thiscall ItemConfig_Item::ItemConfig_Item(ItemConfig_Item *this) { ItemConfig_Item *pIVar1; this->type = 0; this->id = 0; (this->name)._buf[0] = '\0'; (this->name)._buf[1] = '\0'; (this->name)._buf[2] = '\0'; (this->name)._buf[3] = '\0'; (this->name)._size = 0; (this->name)._capacity = 0xf; (this->desc)._buf[0] = '\0'; (this->desc)._buf[1] = '\0'; (this->desc)._buf[2] = '\0'; (this->desc)._buf[3] = '\0'; (this->desc)._size = 0; (this->desc)._capacity = 0xf; (this->gfxFilename)._buf[0] = '\0'; (this->gfxFilename)._buf[1] = '\0'; (this->gfxFilename)._buf[2] = '\0'; (this->gfxFilename)._buf[3] = '\0'; (this->gfxFilename)._size = 0; (this->gfxFilename)._capacity = 0xf; this->achievementId = 0; this->cacheFlags = 0; this->addMaxhearts = 0; this->addHearts = 0; this->addSoulHearts = 0; this->addBlackHearts = 0; this->addBombs = 0; this->addKeys = 0; this->addCoins = 0; this->maxCharges = 0; this->maxCooldown = 0; this->devilprice = 1; this->shopPrice = 0xf; (this->costume).id = 0; (this->costume).anm2Path._buf[0] = '\0'; (this->costume).anm2Path._buf[1] = '\0'; (this->costume).anm2Path._buf[2] = '\0'; (this->costume).anm2Path._buf[3] = '\0'; (this->costume).anm2Path._size = 0; (this->costume).anm2Path._capacity = 0xf; (this->costume).priority = 0; (this->costume).hasOverlay = 0; (this->costume).isFlying = 0; (this->costume).hasSkinAlt = 0; (this->costume).skinColor = -1; *(undefined2 *)&(this->costume).overwriteColor = 0; (this->costume).field_0x2a = 0; this->chargeType = 0; this->special = 0; this->passiveCache = 0; this->addCostumeOnPickup = 1; this->hidden = 0; this->persistentEffect = 0; this->clearEffectsOnRemove = 1; *(undefined4 *)&this->tags = 0; *(undefined4 *)((int)&this->tags + 4) = 0; this->quality = 0; this->craftingQuality = 0; this->_initCharge = -1; this[1].type = 0; this[1].id = 0; this[1].name._buf[0] = '\0'; this[1].name._buf[1] = '\0'; this[1].name._buf[2] = '\0'; this[1].name._buf[3] = '\0'; pIVar1 = this + 1; (pIVar1->name)._buf[4] = '\0'; (pIVar1->name)._buf[5] = '\0'; (pIVar1->name)._buf[6] = '\0'; (pIVar1->name)._buf[7] = '\0'; pIVar1 = this + 1; (pIVar1->name)._buf[8] = -1; (pIVar1->name)._buf[9] = -1; (pIVar1->name)._buf[10] = -1; (pIVar1->name)._buf[0xb] = -1; pIVar1 = this + 1; (pIVar1->name)._buf[0xc] = '\0'; (pIVar1->name)._buf[0xd] = '\0'; (pIVar1->name)._buf[0xe] = '\0'; (pIVar1->name)._buf[0xf] = '\0'; return this; } //@@ 00722c10 ItemConfig_Item::~ItemConfig_Item /* DB: ItemConfig::Load frees each 0xe8-byte ItemConfig_Item with FUN_00722c10 + operator_delete(0xe8); destroys 4 strings, a vector of 0xb8-byte entries (FUN_00731160) and the owned 0x198-byte costume at +0xcc; also called by init_procedural_item_surfaces prototype: db/protos.zhl */ void __thiscall ItemConfig_Item::~ItemConfig_Item(ItemConfig_Item *this) { void *ptr; ptr = (void *)this[1].type; if (ptr != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)ptr + 0x174)); std::string::_Tidy_deallocate((char *)((int)ptr + 0x15c)); operator_delete(ptr,0x198); this[1].type = 0; } FUN_00731160(); std::string::_Tidy_deallocate((this->costume).anm2Path._buf); std::string::_Tidy_deallocate((this->gfxFilename)._buf); std::string::_Tidy_deallocate((this->desc)._buf); std::string::_Tidy_deallocate((this->name)._buf); return; } //@@ 00722c80 Item::IsNull /* ZHL [lua] Lua binding Item:IsNull */ bool Item::IsNull(void) { int *in_ECX; return *in_ECX == 0; } //@@ 00722c90 FUN_00722c90 void FUN_00722c90(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x50)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); return; } //@@ 00722cb0 ItemConfig::parse_tags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 'invalid tag: %s' with tag names angel/devil/battery/quest/offensive/nolostbr... prototype: db/protos.zhl */ ulonglong __fastcall ItemConfig::parse_tags(void *tagString) { int iVar1; char isFound; undefined4 *tagMask; undefined *puVar2; uint uVar3; undefined1 *puVar4; undefined1 *tagNode; int tokensBegin; int tokensEnd; uint tokenIdx; uint tagsHigh; int tokenOffset; uint tagsLow; undefined *tagName; uint local_28; undefined1 local_24; undefined1 local_20 [4]; undefined4 local_1c; undefined1 *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afce91; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80fc8) && (_Init_thread_header(&DAT_00c80fc8,local_14), DAT_00c80fc8 == -1)) { local_8 = 0; DAT_00c80fcc = operator_new(0x30); *(undefined1 **)DAT_00c80fcc = DAT_00c80fcc; *(undefined1 **)(DAT_00c80fcc + 4) = DAT_00c80fcc; *(undefined1 **)(DAT_00c80fcc + 8) = DAT_00c80fcc; *(undefined2 *)(DAT_00c80fcc + 0xc) = 0x101; _atexit(FUN_00b159d0); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c80fc8); } if (DAT_00c80fd0 == 0) { local_18 = (undefined1 *)0xf; local_1c = 4; tagName = (undefined *)0x64616564; local_28 = local_28 & 0xffffff00; local_8 = 1; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 1; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } tagName = (undefined *)0x69727973; local_18 = (undefined1 *)0xf; local_1c = 7; local_28 = 0x65676e; local_8 = 2; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 2; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_18 = (undefined1 *)0xf; local_1c = 3; tagName = (undefined *)0x6d6f6d; local_8 = 3; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 4; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_18 = (undefined1 *)0xf; local_1c = 4; tagName = (undefined *)0x68636574; local_28 = local_28 & 0xffffff00; local_8 = 4; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 8; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } tagName = (undefined *)0x74746162; local_18 = (undefined1 *)0xf; local_1c = 7; local_28 = 0x797265; local_8 = 5; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x10; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } tagName = (undefined *)0x70707567; local_18 = (undefined1 *)0xf; local_1c = 5; local_28 = CONCAT22(local_28._2_2_,0x79); local_8 = 6; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x20; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_18 = (undefined1 *)0xf; local_1c = 3; tagName = (undefined *)0x796c66; local_8 = 7; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x40; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_18 = (undefined1 *)0xf; local_1c = 3; tagName = &DAT_00626f62; local_8 = 8; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x80; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_18 = (undefined1 *)0xf; local_1c = 8; tagName = (undefined *)0x6873756d; local_28._0_1_ = 'r'; local_28._1_1_ = 'o'; local_28._2_1_ = 'o'; local_28._3_1_ = 'm'; local_24 = 0; local_8 = 9; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x100; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,&DAT_00b67088,4); local_8 = 10; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x200; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"angel",5); local_8 = 0xb; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x400; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"devil",5); local_8 = 0xc; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x800; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,&DAT_00b66afc,4); local_8 = 0xd; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x1000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,&DAT_00b69674,4); local_8 = 0xe; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x2000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"spider",6); local_8 = 0xf; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x4000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"quest",5); local_8 = 0x10; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x8000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"monstermanual",0xd); local_8 = 0x11; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x10000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"nogreed",7); local_8 = 0x12; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x20000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,&DAT_00b69650,4); local_8 = 0x13; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x40000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"tearsup",7); local_8 = 0x14; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x80000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"offensive",9); local_8 = 0x15; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x100000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"nokeeper",8); local_8 = 0x16; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x200000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"nolostbr",8); local_8 = 0x17; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x400000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"stars",5); local_8 = 0x18; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x800000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"summonable",10); local_8 = 0x19; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x1000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"nocantrip",9); local_8 = 0x1a; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x2000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"uniquefamiliar",0xe); local_8 = 0x1b; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x8000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"nochallenge",0xb); local_8 = 0x1c; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x10000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"nodaily",7); local_8 = 0x1d; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x20000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"lazarusshared",0xd); local_8 = 0x1e; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x40000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"lazarussharedglobal",0x13); local_8 = 0x1f; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0x80000000; tagMask[1] = 0; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = (undefined1 *)0xf; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"noeden",6); local_8 = 0x20; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0; tagMask[1] = 1; if (0xf < local_18) { uVar3 = (int)local_18 + 1; puVar2 = tagName; if (0xfff < uVar3) { puVar2 = *(undefined **)(tagName + -4); uVar3 = (int)local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } local_1c = 0; local_18 = &DAT_0000000f; tagName = (undefined *)0x0; std::string::assign((char *)&tagName,(byte *)"devilsacrifice",0xe); local_8 = 0x21; tagMask = (undefined4 *)FUN_00730eb0(&tagName); local_8 = 0xffffffff; *tagMask = 0; tagMask[1] = 2; if (&DAT_0000000f < local_18) { puVar4 = local_18 + 1; puVar2 = tagName; if ((undefined1 *)0xfff < puVar4) { puVar2 = *(undefined **)(tagName + -4); puVar4 = local_18 + 0x24; if ((undefined *)0x1f < tagName + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,(uint)puVar4); } } string_split(0x20); tagsLow = 0; tagsHigh = tagsLow; local_8 = 0x22; tokenIdx = 0; iVar1 = tokensEnd - tokensBegin >> 0x1f; tagsLow = 0; if ((tokensEnd - tokensBegin) / 0x18 + iVar1 != iVar1) { tokenOffset = 0; tagsHigh = 0; puVar4 = DAT_00c80fcc; do { FUN_00731e00(local_20,tokensBegin + tokenOffset); tagNode = local_18; isFound = FUN_006a0100(local_18,tokensBegin + tokenOffset); if (isFound == '\0') { tagNode = puVar4; LAB_00723e2a: KAGE_LogMessage(0x10,(byte *)"invalid tag: %s\n"); puVar4 = DAT_00c80fcc; if (tagNode != DAT_00c80fcc) goto LAB_00723e4c; } else { if (tagNode == puVar4) goto LAB_00723e2a; LAB_00723e4c: tagsLow = tagsLow | *(uint *)(tagNode + 0x28); tagsHigh = tagsHigh | *(uint *)(tagNode + 0x2c); } tokenOffset = tokenOffset + 0x18; tokenIdx = tokenIdx + 1; } while (tokenIdx < (uint)((tokensEnd - tokensBegin) / 0x18)); } std::vector::_Tidy(); ExceptionList = local_10; return CONCAT44(tagsHigh,tagsLow); } //@@ 00723f20 ItemConfig::parse_cache_flags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: static string->CacheFlag table (color/damage/familiars/firedelay/flying/pickupvision/range/shotspeed/speed/tearcolor/tearflag/weapon, _Init_thread_header); called from ItemConfig::Load right after reading the "cache" attribute prototype: db/protos.zhl */ uint __fastcall ItemConfig::parse_cache_flags(std_string *text) { char isFound; undefined4 *flagSlot; int iVar1; void *allocBlock; std_string *a; uint uVar2; undefined1 *puVar3; int token; int tokensEnd; uint cacheFlags; ulonglong key; undefined1 local_24; undefined1 local_23; undefined1 lowerBound [4]; undefined4 keySize; undefined1 *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afcf41; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(lowerBound + 0x1c); ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c80fd4) { _Init_thread_header(&DAT_00c80fd4,local_14); if (DAT_00c80fd4 == -1) { local_8 = 0; DAT_00c80fd8 = operator_new(0x2c); *(undefined1 **)DAT_00c80fd8 = DAT_00c80fd8; *(undefined1 **)(DAT_00c80fd8 + 4) = DAT_00c80fd8; *(undefined1 **)(DAT_00c80fd8 + 8) = DAT_00c80fd8; *(undefined2 *)(DAT_00c80fd8 + 0xc) = 0x101; _atexit(FUN_00b15a00); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c80fd4); } } if (DAT_00c80fdc == 0) { local_18 = (undefined1 *)0xf; keySize = 6; key = CONCAT17(key._7_1_,0x6567616d6164); local_8 = 1; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 1; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } local_18 = (undefined1 *)0xf; keySize = 9; key = 0x616c656465726966; local_24 = 0x79; local_23 = 0; local_8 = 2; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 2; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } local_18 = (undefined1 *)0xf; keySize = 9; key = 0x65657073746f6873; local_24 = 100; local_23 = 0; local_8 = 3; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 4; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"range",5); local_8 = 4; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 8; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"speed",5); local_8 = 5; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x10; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"tearflag",8); local_8 = 6; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x20; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"tearcolor",9); local_8 = 7; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x40; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"flying",6); local_8 = 8; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x80; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"weapon",6); local_8 = 9; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x100; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"familiars",9); local_8 = 10; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x200; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,&DAT_00b69778,4); local_8 = 0xb; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x400; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,&DAT_00b69770,4); local_8 = 0xc; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x800; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = (undefined1 *)0xf; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"color",5); local_8 = 0xd; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x1000; if (0xf < local_18) { uVar2 = (int)local_18 + 1; allocBlock = (void *)key; if (0xfff < uVar2) { allocBlock = *(void **)((int)(void *)key + -4); uVar2 = (int)local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar2); } keySize = 0; local_18 = &DAT_0000000f; key = key & 0xffffffff00000000; std::string::assign((char *)&key,(byte *)"pickupvision",0xc); local_8 = 0xe; flagSlot = (undefined4 *)FUN_0069d630(&key); local_8 = 0xffffffff; *flagSlot = 0x2000; if (&DAT_0000000f < local_18) { puVar3 = local_18 + 1; allocBlock = (void *)key; if ((undefined1 *)0xfff < puVar3) { allocBlock = *(void **)((int)(void *)key + -4); puVar3 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)key + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,(uint)puVar3); } } a = text; if (0xf < text->_capacity) { a = *(std_string **)text->_buf; } iVar1 = string_compare((byte *)a,text->_size,&DAT_00b697d0,3); if (iVar1 == 0) { uVar2 = 0xffff; } else { cacheFlags = 0; string_split(0x20); iVar1 = (tokensEnd - token) / 0x18; uVar2 = 0; if (iVar1 != 0) { do { std::map::_Find_lower_bound(lowerBound,token); puVar3 = local_18; isFound = FUN_006a0100(local_18,token); if ((isFound != '\0') && (puVar3 != DAT_00c80fd8)) { cacheFlags = cacheFlags | *(uint *)(puVar3 + 0x28); } token = token + 0x18; iVar1 = iVar1 + -1; } while (iVar1 != 0); uVar2 = cacheFlags; } std::vector::_Tidy(); } ExceptionList = local_10; return uVar2; } //@@ 00724790 color_preset_lookup /* DB: ? looks a name up in a std::map (FUN_00685bc0 lower_bound, string_compare) and returns the 11-float KColor (tint 4, colorize 4, offset 3) of the match, else a default white color; callers anm2_apply_gfx_overrides, ItemConfig::load_wisp_node */ float * color_preset_lookup(int *param_1) { float fVar1; void *pvVar2; float fVar3; float fVar4; float fVar5; byte *b; int iVar6; void *ptr; byte *a; uint size; uint uVar7; byte *in_EDX; int *piVar8; double dVar9; float local_50; float fStack_4c; float fStack_48; float fStack_44; float local_30; float fStack_2c; float local_28; undefined1 local_24 [8]; int local_1c; int *local_18; int *local_14; int local_10; float *local_c; if ((param_1 != (int *)0x0) && (std::map::_Find_lower_bound(local_24,in_EDX), *(char *)(local_1c + 0xd) == '\0')) { b = (byte *)(local_1c + 0x10); if (0xf < *(uint *)(local_1c + 0x24)) { b = *(byte **)b; } a = in_EDX; if (0xf < *(uint *)(in_EDX + 0x14)) { a = *(byte **)in_EDX; } iVar6 = string_compare(a,*(uint *)(in_EDX + 0x10),b,*(uint *)(local_1c + 0x20)); if ((-1 < iVar6) && (local_1c != *param_1)) { fVar3 = *(float *)(local_1c + 0x2c); fVar4 = *(float *)(local_1c + 0x30); fVar5 = *(float *)(local_1c + 0x34); fVar1 = *(float *)(local_1c + 0x50); *local_c = *(float *)(local_1c + 0x28); local_c[1] = fVar3; local_c[2] = fVar4; local_c[3] = fVar5; fVar3 = *(float *)(local_1c + 0x3c); fVar4 = *(float *)(local_1c + 0x40); fVar5 = *(float *)(local_1c + 0x44); local_c[4] = *(float *)(local_1c + 0x38); local_c[5] = fVar3; local_c[6] = fVar4; local_c[7] = fVar5; *(undefined8 *)(local_c + 8) = *(undefined8 *)(local_1c + 0x48); local_c[10] = fVar1; return local_c; } } string_split(0x20); local_50 = 1.0; fStack_4c = 1.0; fStack_48 = 1.0; fStack_44 = 1.0; local_30 = 0.0; iVar6 = (int)local_14 - (int)local_18 >> 0x1f; fStack_2c = 0.0; local_28 = 0.0; if (((int)local_14 - (int)local_18) / 0x18 + iVar6 != iVar6) { piVar8 = local_18; if (0xf < (uint)local_18[5]) { piVar8 = (int *)*local_18; } dVar9 = atof((char *)piVar8); local_50 = (float)dVar9 / 255.0; } if (1 < (uint)(((int)local_14 - (int)local_18) / 0x18)) { piVar8 = local_18 + 6; if (0xf < (uint)local_18[0xb]) { piVar8 = (int *)*piVar8; } dVar9 = atof((char *)piVar8); fStack_4c = (float)dVar9 / 255.0; } if (2 < (uint)(((int)local_14 - (int)local_18) / 0x18)) { piVar8 = local_18 + 0xc; if (0xf < (uint)local_18[0x11]) { piVar8 = (int *)*piVar8; } dVar9 = atof((char *)piVar8); fStack_48 = (float)dVar9 / 255.0; } if (3 < (uint)(((int)local_14 - (int)local_18) / 0x18)) { piVar8 = local_18 + 0x12; if (0xf < (uint)local_18[0x17]) { piVar8 = (int *)*piVar8; } dVar9 = atof((char *)piVar8); fStack_44 = (float)dVar9 / 255.0; } if (4 < (uint)(((int)local_14 - (int)local_18) / 0x18)) { piVar8 = local_18 + 0x18; if (0xf < (uint)local_18[0x1d]) { piVar8 = (int *)*piVar8; } dVar9 = atof((char *)piVar8); local_30 = (float)dVar9 / 255.0; } if (5 < (uint)(((int)local_14 - (int)local_18) / 0x18)) { piVar8 = local_18 + 0x1e; if (0xf < (uint)local_18[0x23]) { piVar8 = (int *)*piVar8; } dVar9 = atof((char *)piVar8); fStack_2c = (float)dVar9 / 255.0; } if (6 < (uint)(((int)local_14 - (int)local_18) / 0x18)) { piVar8 = local_18 + 0x24; if (0xf < (uint)local_18[0x29]) { piVar8 = (int *)*piVar8; } dVar9 = atof((char *)piVar8); local_28 = (float)dVar9 / 255.0; } *local_c = local_50; local_c[1] = fStack_4c; local_c[2] = fStack_48; local_c[3] = fStack_44; local_c[4] = 0.0; local_c[5] = 0.0; local_c[6] = 0.0; local_c[7] = 0.0; *(ulonglong *)(local_c + 8) = CONCAT44(fStack_2c,local_30); local_c[10] = local_28; if (local_18 != (int *)0x0) { piVar8 = local_18; if (local_18 != local_14) { do { uVar7 = piVar8[5]; if (0xf < uVar7) { pvVar2 = (void *)*piVar8; size = uVar7 + 1; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) goto LAB_00724ad0; } operator_delete(ptr,size); } piVar8[4] = 0; piVar8[5] = 0xf; *(undefined1 *)piVar8 = 0; piVar8 = piVar8 + 6; } while (piVar8 != local_14); } uVar7 = ((local_10 - (int)local_18) / 0x18) * 0x18; piVar8 = local_18; if (0xfff < uVar7) { piVar8 = (int *)local_18[-1]; uVar7 = uVar7 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_18 + (-4 - (int)piVar8))) { LAB_00724ad0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar8,uVar7); } return local_c; } //@@ 00724af0 PocketItemConfig::GetName /* DB: translates '#' names in "PocketItems" table prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall PocketItemConfig::GetName(void *this,std_string *outName,int language) { StringTable *this_00; byte bVar1; byte *text; byte *pbVar2; int language_00; if (*(int *)((int)this + 0x18) == 0) { outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; outName->_size = 0; outName->_buf[0] = '\0'; return outName; } text = (byte *)((int)this + 8); if (0xf < *(uint *)((int)this + 0x1c)) { text = *(byte **)text; } language_00 = language; if (language == 0x14) { language_00 = *(int *)&g_manager->_stringTable; } this_00 = &g_manager->_stringTable; if (*text == 0x23) { language = language & 0xffffff; StringTable::get_string (this_00,(byte *)"PocketItems",language_00,text + 1,(byte *)((int)&language + 3)); if (language._3_1_ == '\0') { language = language & 0xffffff; text = StringTable::get_string (this_00,(byte *)"PocketItems",language_00,text + 1, (byte *)((int)&language + 3)); } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; pbVar2 = text; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(outName->_buf,text,(int)pbVar2 - (int)(text + 1)); return outName; } //@@ 00724bd0 ItemConfig_Card::get_display_desc /* DB: ECX ItemConfig_Card: returns a std::string copy of desc (+0x20, empty when length +0x30 is 0), resolving "#KEY" through StringTable category "PocketItems"; used by Entity_Pickup::HandleCollision (pickup streak text after GetName) and PlayerHUD::RenderPocketItems */ char * __thiscall ItemConfig_Card::get_display_desc(ItemConfig_Card *this,char *param_2) { int language; char *pcVar1; Manager *pMVar2; std_string *text; std_string *psVar3; byte local_5; pMVar2 = g_manager; if ((this->desc)._size == 0) { param_2[0] = '\0'; param_2[1] = '\0'; param_2[2] = '\0'; param_2[3] = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; param_2[0x14] = '\x0f'; param_2[0x15] = '\0'; param_2[0x16] = '\0'; param_2[0x17] = '\0'; *param_2 = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; *param_2 = '\0'; return param_2; } text = &this->desc; if (0xf < (this->desc)._capacity) { text = *(std_string **)text->_buf; } language = *(int *)&g_manager->_stringTable; if (text->_buf[0] == '#') { local_5 = 0; StringTable::get_string (&g_manager->_stringTable,(byte *)"PocketItems",language,(byte *)(text->_buf + 1), &local_5); if (local_5 == 0) { local_5 = 0; text = (std_string *) StringTable::get_string (&pMVar2->_stringTable,(byte *)"PocketItems",language, (byte *)(text->_buf + 1),&local_5); } } param_2[0] = '\0'; param_2[1] = '\0'; param_2[2] = '\0'; param_2[3] = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; param_2[0x14] = '\x0f'; param_2[0x15] = '\0'; param_2[0x16] = '\0'; param_2[0x17] = '\0'; *param_2 = '\0'; psVar3 = text; do { pcVar1 = psVar3->_buf; psVar3 = (std_string *)(psVar3->_buf + 1); } while (*pcVar1 != '\0'); std::string::assign(param_2,(byte *)text,(int)psVar3 - (int)(text->_buf + 1)); return param_2; } //@@ 00724cb0 ItemConfig::constructor /* DB: ECX=Manager's ItemConfig: zeroes the vector headers, allocates std::list/map heads (0x2c node), then ItemConfig::reset (00724f00); from Manager::constructor right after OptionsConfig::reset_defaults */ void ItemConfig::constructor(void) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afd00d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; local_8 = 4; in_ECX[0xf] = 0; in_ECX[0x10] = 0; pvVar1 = operator_new(0x2c); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0xf] = pvVar1; in_ECX[0x11] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x18] = 0; in_ECX[0x19] = 0xf; *(undefined1 *)(in_ECX + 0x14) = 0; local_8._0_1_ = 7; in_ECX[0x1f] = 0; in_ECX[0x20] = 0; pvVar1 = operator_new(0x54); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0x1f] = pvVar1; in_ECX[0x41] = 0; in_ECX[0x42] = 0; in_ECX[0x43] = 0; local_8._0_1_ = 9; in_ECX[0x44] = 0; in_ECX[0x45] = 0; pvVar1 = operator_new(0x20); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0x44] = pvVar1; in_ECX[0x46] = 0; in_ECX[0x47] = 0; in_ECX[0x48] = 0; local_8._0_1_ = 0xb; in_ECX[0x49] = 0; in_ECX[0x4a] = 0; pvVar1 = operator_new(0x20); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0x49] = pvVar1; local_8 = CONCAT31(local_8._1_3_,0xc); reset(); ExceptionList = local_10; return; } //@@ 00724ea0 FUN_00724ea0 void FUN_00724ea0(void) { int *in_ECX; FUN_00731820(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x54); return; } //@@ 00724ec0 FUN_00724ec0 void FUN_00724ec0(void) { int *in_ECX; FUN_007317d0(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x20); return; } //@@ 00724ee0 FUN_00724ee0 void FUN_00724ee0(void) { int *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x20); return; } //@@ 00724f00 ItemConfig::reset /* DB: ECX=ItemConfig: resizes and zeroes its per-id vectors to 0x2dd collectibles, 0xbe trinkets, 0x85 nulls, 98 cards, 50 pill effects and frees the entries; callers Manager::unload_configs (right after the Manager ANM2 resets) and the ItemConfig ctor 00724cb0 ItemConfig::constructor void __thiscall ItemConfig::reset(ItemConfig *this) { size_t _Size; void *_Dst; qword qVar1; undefined4 *allocBlock; void *pvVar2; int remaining; ItemConfig_Item *nullItem; uint oldSize; int byteOffset; void **tailVectorBegin; qword *heapCounter; int *oomHandler; ItemConfig *collectibleSlot; uint nullId; undefined4 mapRoot; std_map *nameMap; std::vector<4byte>::resize(0x2dd); collectibleSlot = (this->_collectibles)._begin; byteOffset = 0; if ((this < collectibleSlot) || (&collectibleSlot[10].field_0xd0 < this)) { byteOffset = 0x2dc; for (remaining = 0x2dc; remaining != 0; remaining = remaining + -1) { (collectibleSlot->_collectibles)._begin = (void *)0x0; collectibleSlot = (ItemConfig *)&(collectibleSlot->_collectibles)._end; } } byteOffset = byteOffset * 4; do { *(undefined4 *)(byteOffset + (int)(this->_collectibles)._begin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 0xb74); std::vector<4byte>::resize(0xbe); byteOffset = 0; do { *(undefined4 *)(byteOffset + (int)(this->_trinkets)._begin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 0x2f8); std::vector<4byte>::resize(0x85); byteOffset = 0; do { *(undefined4 *)(byteOffset + (int)(this->_nullItems)._begin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 0x214); FUN_00731070(byteOffset); byteOffset = 0; do { *(undefined4 *)(byteOffset + (int)(this->_cards)._begin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 0x188); FUN_00731000(byteOffset); byteOffset = 0; do { *(undefined4 *)(byteOffset + (int)(this->_pillEffects)._begin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 200); FUN_00730f90(byteOffset); byteOffset = 0; do { *(undefined4 *)(byteOffset + (int)(this->_playerForms)._begin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 0x40); nullId = 0; if ((int)(this->_nullItems)._end - (int)(this->_nullItems)._begin >> 2 != 0) { do { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } allocBlock = malloc(0xec); if (allocBlock == (undefined4 *)0x0) { oomHandler = *(int **)g_memoryManager_oomHandlers; if (oomHandler != g_memoryManager_oomHandlers) { do { (*(code *)oomHandler[2])(0x7fcb9dd6,oomHandler[3]); oomHandler = (int *)*oomHandler; } while (oomHandler != g_memoryManager_oomHandlers); } LAB_0072506f: nullItem = (ItemConfig_Item *)0x0; } else { *allocBlock = 0xec; qVar1 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter + 0xec; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) + (uint)(0xffffff13 < (uint)qVar1); if ((ItemConfig_Item *)(allocBlock + 1) == (ItemConfig_Item *)0x0) goto LAB_0072506f; nullItem = ItemConfig_Item::ItemConfig_Item((ItemConfig_Item *)(allocBlock + 1)); } *(ItemConfig_Item **)((int)(this->_nullItems)._begin + nullId * 4) = nullItem; *(uint *)(*(int *)((int)(this->_nullItems)._begin + nullId * 4) + 4) = nullId; nullId = nullId + 1; } while (nullId < (uint)((int)(this->_nullItems)._end - (int)(this->_nullItems)._begin >> 2)); } nameMap = &this->_collectibleNameMap; *(undefined4 *)&this->field_0x84 = 0; *(undefined4 *)&this->field_0x88 = 0; *(undefined4 *)&this->field_0x8c = 0; *(undefined4 *)&this->field_0x90 = 0; *(undefined4 *)&this->field_0x94 = 0; *(undefined4 *)&this->field_0x98 = 0; *(undefined4 *)&this->field_0x9c = 0; *(undefined4 *)&this->field_0xa0 = 0; *(undefined4 *)&this->field_0xa4 = 0; *(undefined4 *)&this->field_0xa8 = 0; *(undefined4 *)&this->field_0xac = 0; *(undefined4 *)&this->field_0xb0 = 0; *(undefined4 *)&this->field_0xb4 = 0; *(undefined4 *)&this->field_0xb8 = 0; *(undefined4 *)&this->field_0xbc = 0; *(undefined4 *)&this->field_0xc0 = 0; *(undefined4 *)&this->field_0xc4 = 0; *(undefined4 *)&this->field_0xc8 = 0; *(undefined4 *)&this->field_0xcc = 0; *(undefined4 *)&this->field_0xd0 = 0; *(undefined4 *)&this->field_0xd4 = 0; *(undefined4 *)&this->field_0xd8 = 0; *(undefined4 *)&this->field_0xdc = 0; *(undefined4 *)&this->field_0xe0 = 0; *(undefined4 *)&this->field_0xe4 = 0; *(undefined4 *)&this->field_0xe8 = 0; *(undefined4 *)&this->field_0xec = 0; *(undefined4 *)&this->field_0xf0 = 0; *(undefined4 *)&this->field_0xf4 = 0; *(undefined4 *)&this->field_0xf8 = 0; *(undefined4 *)&this->field_0xfc = 0; *(undefined4 *)&this->field_0x100 = 0; pvVar2 = nameMap->_head; mapRoot = *(undefined4 *)((int)pvVar2 + 4); FUN_004235c0(nameMap,mapRoot); tailVectorBegin = &this[1]._collectibles._capacity; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (this->_collectibleNameMap)._size = 0; _Dst = this[1]._trinkets._begin; pvVar2 = *tailVectorBegin; oldSize = (int)_Dst - (int)pvVar2 >> 2; if (oldSize < 0x14) { if (0x12 < oldSize) goto LAB_0072516e; if ((uint)((int)this[1]._trinkets._end - (int)pvVar2 >> 2) < 0x13) { FUN_00731f40(nameMap,mapRoot); goto LAB_0072516e; } _Size = (0x13 - oldSize) * 4; memset(_Dst,0,_Size); pvVar2 = (void *)(_Size + (int)_Dst); } else { pvVar2 = (void *)((int)pvVar2 + 0x4c); } this[1]._trinkets._begin = pvVar2; LAB_0072516e: byteOffset = 0; do { *(undefined4 *)(byteOffset + (int)*tailVectorBegin) = 0; byteOffset = byteOffset + 4; } while (byteOffset < 0x4c); return; } //@@ 00725190 ItemConfig::destructor /* DB: ECX layout = ItemConfig: five vectors at +0/+0xc/+0x18/+0x24/+0x30 (collectibles/trinkets/null items... as read through g_manager+0x2a404/+0x2a410/+0x2a41c), then maps/strings to +0x124; called from Manager::destructor (ItemConfig lives inside Manager) and its unwind funclet */ void __thiscall ItemConfig::destructor(ItemConfig *this) { void **this_00; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0a50; local_10 = ExceptionList; ExceptionList = &local_10; clear(__security_cookie ^ (int)register0x00000010 - 4U); this_00 = &this[1]._trinkets._capacity; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)this[1]._trinkets._capacity + 4)); operator_delete(*this_00,0x20); FID_conflict__Tidy(&this[1]._collectibles._capacity); FUN_007317d0(this + 1,*(undefined4 *)((int)this[1]._collectibles._begin + 4)); operator_delete(this[1]._collectibles._begin,0x20); FID_conflict__Tidy(&this->_availabilityFilters); FUN_00731820(&this->_locustConfigs,*(undefined4 *)((int)(this->_locustConfigs)._head + 4)); operator_delete((this->_locustConfigs)._head,0x54); std::string::_Tidy_deallocate((this->_wispGfxRoot)._buf); FID_conflict__Tidy(&this->_playerForms); FUN_004235c0(&this->_collectibleNameMap, *(undefined4 *)((int)(this->_collectibleNameMap)._head + 4)); operator_delete((this->_collectibleNameMap)._head,0x2c); FID_conflict__Tidy(&this->_pillEffects); FID_conflict__Tidy(&this->_cards); FID_conflict__Tidy(&this->_nullItems); FID_conflict__Tidy(&this->_trinkets); FID_conflict__Tidy(this); ExceptionList = local_10; return; } //@@ 007252a0 ItemConfig::clear /* DB: deletes every ItemConfig_Item (0xe8, ~ItemConfig_Item) in the item vectors at +0, +0xc, +0x18 ... and nulls the slots; ItemConfig::destructor, Manager::unload_configs */ void ItemConfig::clear(void) { ItemConfig_Item *pIVar1; int *in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; int vectorBegin; uint i; int *slot; int slotsLeft; void *entry; i = 0; vectorBegin = *in_ECX; if (in_ECX[1] - vectorBegin >> 2 != 0) { do { pIVar1 = *(ItemConfig_Item **)(vectorBegin + i * 4); if (pIVar1 != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(pIVar1); operator_delete(pIVar1,0xe8); } *(undefined4 *)(*in_ECX + i * 4) = 0; i = i + 1; vectorBegin = *in_ECX; } while (i < (uint)(in_ECX[1] - vectorBegin >> 2)); } vectorBegin = in_ECX[3]; i = 0; if (in_ECX[4] - vectorBegin >> 2 != 0) { do { pIVar1 = *(ItemConfig_Item **)(vectorBegin + i * 4); if (pIVar1 != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(pIVar1); operator_delete(pIVar1,0xe8); } *(undefined4 *)(in_ECX[3] + i * 4) = 0; i = i + 1; vectorBegin = in_ECX[3]; } while (i < (uint)(in_ECX[4] - vectorBegin >> 2)); } vectorBegin = in_ECX[6]; i = 0; if (in_ECX[7] - vectorBegin >> 2 != 0) { do { pIVar1 = *(ItemConfig_Item **)(vectorBegin + i * 4); if (pIVar1 != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(pIVar1); operator_delete(pIVar1,0xe8); } *(undefined4 *)(in_ECX[6] + i * 4) = 0; i = i + 1; vectorBegin = in_ECX[6]; } while (i < (uint)(in_ECX[7] - vectorBegin >> 2)); } vectorBegin = in_ECX[9]; i = 0; if (in_ECX[10] - vectorBegin >> 2 != 0) { do { entry = *(void **)(vectorBegin + i * 4); if (entry != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)entry + 0x38)); std::string::_Tidy_deallocate((char *)((int)entry + 0x20)); std::string::_Tidy_deallocate((char *)((int)entry + 8)); operator_delete(entry,0x70); } *(undefined4 *)(in_ECX[9] + i * 4) = 0; i = i + 1; vectorBegin = in_ECX[9]; } while (i < (uint)(in_ECX[10] - vectorBegin >> 2)); } vectorBegin = in_ECX[0xc]; i = 0; if (in_ECX[0xd] - vectorBegin >> 2 != 0) { do { entry = *(void **)(vectorBegin + i * 4); if (entry != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)entry + 0x20)); std::string::_Tidy_deallocate((char *)((int)entry + 8)); operator_delete(entry,0x54); } *(undefined4 *)(in_ECX[0xc] + i * 4) = 0; i = i + 1; vectorBegin = in_ECX[0xc]; } while (i < (uint)(in_ECX[0xd] - vectorBegin >> 2)); } vectorBegin = in_ECX[0x11]; i = 0; if (in_ECX[0x12] - vectorBegin >> 2 != 0) { do { entry = *(void **)(vectorBegin + i * 4); if (entry != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)entry + 0x10)); operator_delete(entry,0x30); } *(undefined4 *)(in_ECX[0x11] + i * 4) = 0; i = i + 1; vectorBegin = in_ECX[0x11]; } while (i < (uint)(in_ECX[0x12] - vectorBegin >> 2)); } std::vector<4byte>::resize(0x2dd); std::vector<4byte>::resize(0xbe); std::vector<4byte>::resize(0x85); FUN_00731070(extraout_ECX); FUN_00731000(extraout_ECX_00); FUN_00730f90(extraout_ECX_01); slot = in_ECX + 0x21; slotsLeft = 0x20; do { entry = (void *)*slot; if (entry != (void *)0x0) { FID_conflict__Tidy(entry); operator_delete(entry,0xc); *slot = 0; } slot = slot + 1; slotsLeft = slotsLeft + -1; } while (slotsLeft != 0); i = 0; vectorBegin = in_ECX[0x46]; if (in_ECX[0x47] - vectorBegin >> 2 != 0) { do { entry = *(void **)(vectorBegin + i * 4); if (entry != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)entry + 0x174)); std::string::_Tidy_deallocate((char *)((int)entry + 0x15c)); operator_delete(entry,0x198); } *(undefined4 *)(in_ECX[0x46] + i * 4) = 0; i = i + 1; vectorBegin = in_ECX[0x46]; } while (i < (uint)(in_ECX[0x47] - vectorBegin >> 2)); } return; } //@@ 00725570 ItemConfig::Load /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: zhl Load(xmlpath, modentry); parses items.xml root "items", "ItemConfig: unknown item type"; this=ItemConfig vectors */ undefined4 ItemConfig::Load(byte *param_1,int param_2) { undefined8 uVar1; byte bVar2; uint uVar3; byte bVar4; uint uVar5; int *piVar6; undefined4 isLoaded; int iVar7; byte *text; void *pvVar8; void *pvVar9; byte *pbVar10; ItemConfig_Item *tmpItem; int *piVar11; std_string *psVar12; int *in_ECX; uint tag; byte *pbVar13; byte *pbVar14; int *idRef; size_t sVar15; uint uVar16; int newTrinketId; bool bVar17; ulonglong uVar18; char *pcVar19; int slotsLeft; ItemConfig_Item *pIStack_10104; undefined1 xmlDoc [48]; undefined1 xmlPool [65560]; void *local_b8; int iStack_b4; uint uStack_b0; uint uStack_ac; undefined8 local_a8; void *local_a0; int iStack_9c; uint uStack_98; uint uStack_94; uint local_90; uint uStack_8c; std_string scratchString; std_string gfxRoot; std_string xmlString; std_string attrValue; void *local_1c; undefined1 *puStack_18; void *local_14; undefined4 *attr; local_14 = (void *)0xffffffff; puStack_18 = &LAB_00afd080; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)((int)&scratchString + 0x78U); ExceptionList = &local_1c; tag = -(uint)(param_2 != 0) & param_2 + 0xecU; if (tag == 0) { uVar16 = 0; iVar7 = *in_ECX; if (in_ECX[1] - iVar7 >> 2 != 0) { do { tmpItem = *(ItemConfig_Item **)(uVar16 * 4 + iVar7); if (tmpItem != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(tmpItem); operator_delete(tmpItem,0xe8); } iVar7 = uVar16 * 4; uVar16 = uVar16 + 1; *(undefined4 *)(*in_ECX + iVar7) = 0; iVar7 = *in_ECX; } while (uVar16 < (uint)(in_ECX[1] - iVar7 >> 2)); } piVar6 = in_ECX + 3; iVar7 = *piVar6; uVar16 = 0; if (in_ECX[4] - iVar7 >> 2 != 0) { do { tmpItem = *(ItemConfig_Item **)(uVar16 * 4 + iVar7); if (tmpItem != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(tmpItem); operator_delete(tmpItem,0xe8); } iVar7 = uVar16 * 4; uVar16 = uVar16 + 1; *(undefined4 *)(*piVar6 + iVar7) = 0; iVar7 = *piVar6; } while (uVar16 < (uint)(in_ECX[4] - iVar7 >> 2)); } iVar7 = in_ECX[0xf]; FUN_004235c0(in_ECX + 0xf,*(undefined4 *)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; in_ECX[0x10] = 0; std::vector<4byte>::resize(0x2dd); std::vector<4byte>::resize(0xbe); uVar16 = 0; iVar7 = in_ECX[0x46]; if (in_ECX[0x47] - iVar7 >> 2 != 0) { do { pvVar8 = *(void **)(uVar16 * 4 + iVar7); if (pvVar8 != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)pvVar8 + 0x174)); std::string::_Tidy_deallocate((char *)((int)pvVar8 + 0x15c)); operator_delete(pvVar8,0x198); } iVar7 = uVar16 * 4; uVar16 = uVar16 + 1; *(undefined4 *)(in_ECX[0x46] + iVar7) = 0; iVar7 = in_ECX[0x46]; } while (uVar16 < (uint)(in_ECX[0x47] - iVar7 >> 2)); } iVar7 = in_ECX[0x49]; FID_conflict__Erase_tree_>_> (in_ECX + 0x49, (fuzzer_allocator_> *)(in_ECX + 0x49), *(_Tree_node **)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; in_ECX[0x4a] = 0; } piVar6 = in_ECX + 0x21; slotsLeft = 0x20; do { pvVar8 = (void *)*piVar6; if (pvVar8 != (void *)0x0) { FID_conflict__Tidy(pvVar8); operator_delete(pvVar8,0xc); *piVar6 = 0; } piVar6 = piVar6 + 1; slotsLeft = slotsLeft + -1; } while (slotsLeft != 0); piVar6 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar6 == (int *)0x0) { isLoaded = 0; } else { iVar7 = (**(code **)(*piVar6 + 4))(uVar5); text = operator_new_tracked(iVar7 + 1); (**(code **)(*piVar6 + 0x14))(text,1,iVar7); text[iVar7] = 0; (**(code **)*piVar6)(1); FUN_00413b90(); local_14 = (void *)0x0; pcVar19 = (char *)0x72585e; pbVar14 = text; rapidxml::xml_document::parse(xmlDoc,text); bVar4 = (byte)pbVar14; pvVar8 = xml_node::first_node(xmlDoc,&DAT_00b66fc8,(int)pcVar19,bVar4); if (pvVar8 == (void *)0x0) { pcVar19 = "Could not find root node \'items\' in %s\n"; pbVar14 = param_1; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'items\' in %s\n"); bVar4 = (byte)pbVar14; } pvVar9 = xml_node::first_attribute(pvVar8,(byte *)"version",(uint)pcVar19,bVar4); pbVar13 = &DAT_00b63104; pbVar14 = &g_xmlNullStr; if (*(byte **)((int)pvVar9 + 4) != (byte *)0x0) { pbVar14 = *(byte **)((int)pvVar9 + 4); } pbVar10 = pbVar14; do { bVar2 = *pbVar10; bVar17 = bVar2 < *pbVar13; if (bVar2 != *pbVar13) { LAB_007258d0: uVar5 = -(uint)bVar17 | 1; goto LAB_007258d5; } if (bVar2 == 0) break; bVar2 = pbVar10[1]; bVar17 = bVar2 < pbVar13[1]; if (bVar2 != pbVar13[1]) goto LAB_007258d0; pbVar10 = pbVar10 + 2; pbVar13 = pbVar13 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_007258d5: if (uVar5 != 0) { KAGE_LogMessage(0x10,(byte *)"Invalid version %s for %s\n"); bVar4 = (byte)param_1; pcVar19 = (char *)pbVar14; } pvVar9 = xml_node::first_attribute(pvVar8,&DAT_00b6987c,(uint)pcVar19,bVar4); gfxRoot._size = 0; gfxRoot._capacity = 0xf; gfxRoot._buf[0] = '\0'; gfxRoot._buf[1] = '\0'; gfxRoot._buf[2] = '\0'; gfxRoot._buf[3] = '\0'; pbVar14 = &g_xmlNullStr; if (*(byte **)((int)pvVar9 + 4) != (byte *)0x0) { pbVar14 = *(byte **)((int)pvVar9 + 4); } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); uVar5 = (int)pbVar13 - (int)(pbVar14 + 1); std::string::assign(gfxRoot._buf,pbVar14,uVar5); local_14._0_1_ = 1; if ((param_2 != 0) && (pvVar9 = xml_node::first_attribute(pvVar8,(byte *)"deathanm2",(uint)pbVar14,(byte)uVar5), pvVar9 != (void *)0x0)) { xmlString._size = 0; pbVar14 = &g_xmlNullStr; if (*(byte **)((int)pvVar9 + 4) != (byte *)0x0) { pbVar14 = *(byte **)((int)pvVar9 + 4); } xmlString._capacity = 0xf; xmlString._buf[0] = '\0'; xmlString._buf[1] = '\0'; xmlString._buf[2] = '\0'; xmlString._buf[3] = '\0'; pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(xmlString._buf,pbVar14,(int)pbVar13 - (int)(pbVar14 + 1)); local_14._0_1_ = 2; Mod::load_content_anm2(0xb,&xmlString); local_14._0_1_ = 1; if (0xf < xmlString._capacity) { uVar5 = xmlString._capacity + 1; pvVar9 = (void *)xmlString._buf._0_4_; if (0xfff < uVar5) { pvVar9 = *(void **)(xmlString._buf._0_4_ + -4); uVar5 = xmlString._capacity + 0x24; if (0x1f < (xmlString._buf._0_4_ - (int)pvVar9) - 4U) goto LAB_007273ca; } operator_delete(pvVar9,uVar5); } } for (piVar6 = *(int **)((int)pvVar8 + 0x18); piVar6 != (int *)0x0; piVar6 = (int *)piVar6[0xb]) { tmpItem = operator_new(0xe8); if (tmpItem == (ItemConfig_Item *)0x0) { pIStack_10104 = (ItemConfig_Item *)0x0; } else { pIStack_10104 = ItemConfig_Item::ItemConfig_Item(tmpItem); } xmlString._size = 0; pbVar14 = &g_xmlNullStr; if ((byte *)*piVar6 != (byte *)0x0) { pbVar14 = (byte *)*piVar6; } xmlString._capacity = 0xf; xmlString._buf[0] = '\0'; xmlString._buf[1] = '\0'; xmlString._buf[2] = '\0'; xmlString._buf[3] = '\0'; pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(xmlString._buf,pbVar14,(int)pbVar13 - (int)(pbVar14 + 1)); local_14._0_1_ = 3; pcVar19 = "passive"; psVar12 = &xmlString; if (0xf < xmlString._capacity) { psVar12 = (std_string *)xmlString._buf._0_4_; } uVar5 = xmlString._size; uVar16 = xmlString._size; if (7 < xmlString._size) { uVar5 = 7; uVar16 = uVar5; } while (uVar3 = uVar5 - 4, 3 < uVar5) { if (*(int *)psVar12->_buf != *(int *)pcVar19) goto LAB_00725ac6; psVar12 = (std_string *)(psVar12->_buf + 4); pcVar19 = pcVar19 + 4; uVar5 = uVar3; } if (uVar3 == 0xfffffffc) { LAB_00725afa: uVar5 = 0; } else { LAB_00725ac6: bVar17 = (byte)psVar12->_buf[0] < (byte)*pcVar19; if ((psVar12->_buf[0] == *pcVar19) && ((uVar3 == 0xfffffffd || ((bVar17 = (byte)psVar12->_buf[1] < (byte)pcVar19[1], psVar12->_buf[1] == pcVar19[1] && ((uVar3 == 0xfffffffe || ((bVar17 = (byte)psVar12->_buf[2] < (byte)pcVar19[2], psVar12->_buf[2] == pcVar19[2] && ((uVar3 == 0xffffffff || (bVar17 = (byte)psVar12->_buf[3] < (byte)pcVar19[3], psVar12->_buf[3] == pcVar19[3])))))))))))) goto LAB_00725afa; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (6 < xmlString._size)) && (xmlString._size < 8)) { pIStack_10104->type = 1; } else { pcVar19 = "trinket"; psVar12 = &xmlString; if (0xf < xmlString._capacity) { psVar12 = (std_string *)xmlString._buf._0_4_; } while (uVar5 = uVar16 - 4, 3 < uVar16) { if (*(int *)psVar12->_buf != *(int *)pcVar19) goto LAB_00725b46; pcVar19 = pcVar19 + 4; psVar12 = (std_string *)(psVar12->_buf + 4); uVar16 = uVar5; } if (uVar5 == 0xfffffffc) { LAB_00725b7a: uVar5 = 0; } else { LAB_00725b46: bVar17 = (byte)psVar12->_buf[0] < (byte)*pcVar19; if ((psVar12->_buf[0] == *pcVar19) && ((uVar5 == 0xfffffffd || ((bVar17 = (byte)psVar12->_buf[1] < (byte)pcVar19[1], psVar12->_buf[1] == pcVar19[1] && ((uVar5 == 0xfffffffe || ((bVar17 = (byte)psVar12->_buf[2] < (byte)pcVar19[2], psVar12->_buf[2] == pcVar19[2] && ((uVar5 == 0xffffffff || (bVar17 = (byte)psVar12->_buf[3] < (byte)pcVar19[3], psVar12->_buf[3] == pcVar19[3])))))))))))) goto LAB_00725b7a; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (6 < xmlString._size)) && (xmlString._size < 8)) { pIStack_10104->type = 2; } else { psVar12 = &xmlString; if (0xf < xmlString._capacity) { psVar12 = (std_string *)xmlString._buf._0_4_; } pcVar19 = "active"; uVar5 = xmlString._size; if (6 < xmlString._size) { uVar5 = 6; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*(int *)psVar12->_buf != *(int *)pcVar19) goto LAB_00725bd6; psVar12 = (std_string *)(psVar12->_buf + 4); pcVar19 = pcVar19 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_00725c0a: uVar5 = 0; } else { LAB_00725bd6: bVar17 = (byte)psVar12->_buf[0] < (byte)*pcVar19; if ((psVar12->_buf[0] == *pcVar19) && ((uVar16 == 0xfffffffd || ((bVar17 = (byte)psVar12->_buf[1] < (byte)pcVar19[1], psVar12->_buf[1] == pcVar19[1] && ((uVar16 == 0xfffffffe || ((bVar17 = (byte)psVar12->_buf[2] < (byte)pcVar19[2], psVar12->_buf[2] == pcVar19[2] && ((uVar16 == 0xffffffff || (bVar17 = (byte)psVar12->_buf[3] < (byte)pcVar19[3], psVar12->_buf[3] == pcVar19[3])))))))))))) goto LAB_00725c0a; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (5 < xmlString._size)) && (xmlString._size < 7)) { pIStack_10104->type = 3; pIStack_10104->addCostumeOnPickup = 0; pIStack_10104->clearEffectsOnRemove = 0; } else { psVar12 = &xmlString; if (0xf < xmlString._capacity) { psVar12 = (std_string *)xmlString._buf._0_4_; } pcVar19 = "familiar"; uVar5 = xmlString._size; if (8 < xmlString._size) { uVar5 = 8; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*(int *)psVar12->_buf != *(int *)pcVar19) goto LAB_00725c6c; psVar12 = (std_string *)(psVar12->_buf + 4); pcVar19 = pcVar19 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_00725ca0: uVar5 = 0; } else { LAB_00725c6c: bVar17 = (byte)psVar12->_buf[0] < (byte)*pcVar19; if ((psVar12->_buf[0] == *pcVar19) && ((uVar16 == 0xfffffffd || ((bVar17 = (byte)psVar12->_buf[1] < (byte)pcVar19[1], psVar12->_buf[1] == pcVar19[1] && ((uVar16 == 0xfffffffe || ((bVar17 = (byte)psVar12->_buf[2] < (byte)pcVar19[2], psVar12->_buf[2] == pcVar19[2] && ((uVar16 == 0xffffffff || (bVar17 = (byte)psVar12->_buf[3] < (byte)pcVar19[3], psVar12->_buf[3] == pcVar19[3])))))))))))) goto LAB_00725ca0; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (7 < xmlString._size)) && (xmlString._size < 9)) { pIStack_10104->cacheFlags = pIStack_10104->cacheFlags | 0x200; pIStack_10104->type = 4; } else { psVar12 = &xmlString; if (0xf < xmlString._capacity) { psVar12 = (std_string *)xmlString._buf._0_4_; } pbVar14 = (byte *)&DAT_00b6982c; uVar5 = xmlString._size; if (4 < xmlString._size) { uVar5 = 4; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*(int *)psVar12->_buf != *(int *)pbVar14) goto LAB_00725cfc; psVar12 = (std_string *)(psVar12->_buf + 4); pbVar14 = pbVar14 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_00725d30: uVar5 = 0; } else { LAB_00725cfc: bVar17 = (byte)psVar12->_buf[0] < *pbVar14; if ((psVar12->_buf[0] == *pbVar14) && ((uVar16 == 0xfffffffd || ((bVar17 = (byte)psVar12->_buf[1] < pbVar14[1], psVar12->_buf[1] == pbVar14[1] && ((uVar16 == 0xfffffffe || ((bVar17 = (byte)psVar12->_buf[2] < pbVar14[2], psVar12->_buf[2] == pbVar14[2] && ((uVar16 == 0xffffffff || (bVar17 = (byte)psVar12->_buf[3] < pbVar14[3], psVar12->_buf[3] == pbVar14[3])))))))))))) goto LAB_00725d30; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (3 < xmlString._size)) && (xmlString._size < 5)) { pIStack_10104->type = 0; } else { KAGE_LogMessage(0x10,(byte *)"ItemConfig: unknown item type: %s\n"); } } } } } pIStack_10104->achievementId = -1; for (attr = (undefined4 *)piVar6[8]; attr != (undefined4 *)0x0; attr = (undefined4 *)attr[6]) { pbVar14 = (byte *)*attr; pbVar10 = s_id; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00725db7: uVar5 = -(uint)bVar17 | 1; goto LAB_00725dbc; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00725db7; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00725dbc: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->id = iVar7; } else { pbVar10 = s_name; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00725e14: uVar5 = -(uint)bVar17 | 1; goto LAB_00725e19; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00725e14; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00725e19: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign((pIStack_10104->name)._buf,pbVar14,(int)pbVar13 - (int)(pbVar14 + 1) ); } else { pcVar19 = "description"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00725e80: uVar5 = -(uint)bVar17 | 1; goto LAB_00725e85; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00725e80; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00725e85: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign((pIStack_10104->desc)._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); } else { pbVar10 = &DAT_00b66fec; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00725ee8: uVar5 = -(uint)bVar17 | 1; goto LAB_00725eed; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00725ee8; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00725eed: if (uVar5 == 0) { pbVar14 = (byte *)attr[1]; if (pIStack_10104->type == 2) { pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } if (0x7fffffff - gfxRoot._size < 9) goto LAB_00727429; psVar12 = &gfxRoot; if (0xf < gfxRoot._capacity) { psVar12 = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(scratchString._buf,tag,(std_string *)gfxRoot._size, (byte *)psVar12,gfxRoot._size,(byte *)"trinkets/",9); local_14._0_1_ = 4; pbVar14 = pbVar13; do { bVar4 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar4 != 0); piVar11 = std::string::append(scratchString._buf,pbVar13, (int)pbVar14 - (int)(pbVar13 + 1)); psVar12 = &pIStack_10104->gfxFilename; local_a0 = (void *)*piVar11; iStack_9c = piVar11[1]; uStack_98 = piVar11[2]; uStack_94 = piVar11[3]; uVar5 = piVar11[4]; uVar16 = piVar11[5]; piVar11[4] = 0; piVar11[5] = 0xf; *(undefined1 *)piVar11 = 0; local_90 = uVar5; uStack_8c = uVar16; attrValue._buf._8_4_ = local_a0; attrValue._buf._12_4_ = iStack_9c; attrValue._size = uStack_98; attrValue._capacity = uStack_94; if (psVar12 == (std_string *)&local_a0) { if (0xf < uVar16) { uVar5 = uVar16 + 1; pvVar8 = local_a0; if (0xfff < uVar5) { pvVar8 = *(void **)((int)local_a0 + -4); uVar5 = uVar16 + 0x24; if (0x1f < (uint)((int)local_a0 + (-4 - (int)pvVar8))) goto LAB_007273ca; } operator_delete(pvVar8,uVar5); } } else { std::string::_Tidy_deallocate(psVar12->_buf); *(undefined4 *)psVar12->_buf = attrValue._buf._8_4_; *(undefined4 *)((pIStack_10104->gfxFilename)._buf + 4) = attrValue._buf._12_4_; *(uint *)((pIStack_10104->gfxFilename)._buf + 8) = attrValue._size; *(uint *)((pIStack_10104->gfxFilename)._buf + 0xc) = attrValue._capacity; (pIStack_10104->gfxFilename)._size = uVar5; (pIStack_10104->gfxFilename)._capacity = uVar16; } local_14._0_1_ = 3; if (0xf < scratchString._capacity) { uVar5 = scratchString._capacity + 1; pvVar8 = (void *)scratchString._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(scratchString._buf._0_4_ + -4); uVar5 = scratchString._capacity + 0x24; if (0x1f < (uint)(scratchString._buf._0_4_ + (-4 - (int)pvVar8))) goto LAB_007273ca; } operator_delete(pvVar8,uVar5); } } else { pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } if (0x7fffffff - gfxRoot._size < 0xd) { LAB_00727429: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } psVar12 = &gfxRoot; if (0xf < gfxRoot._capacity) { psVar12 = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(scratchString._buf,tag,(std_string *)gfxRoot._size, (byte *)psVar12,gfxRoot._size,(byte *)"collectibles/",0xd); local_14._0_1_ = 5; pbVar14 = pbVar13; do { bVar4 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar4 != 0); piVar11 = std::string::append(scratchString._buf,pbVar13, (int)pbVar14 - (int)(pbVar13 + 1)); psVar12 = &pIStack_10104->gfxFilename; local_b8 = (void *)*piVar11; iStack_b4 = piVar11[1]; uStack_b0 = piVar11[2]; uStack_ac = piVar11[3]; uVar1 = *(undefined8 *)(piVar11 + 4); piVar11[4] = 0; piVar11[5] = 0xf; *(undefined1 *)piVar11 = 0; local_a8 = uVar1; attrValue._buf._8_4_ = local_b8; attrValue._buf._12_4_ = iStack_b4; attrValue._size = uStack_b0; attrValue._capacity = uStack_ac; if (psVar12 == (std_string *)&local_b8) { local_a8._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); if (0xf < local_a8._4_4_) { uVar5 = local_a8._4_4_ + 1; pvVar8 = local_b8; if (0xfff < uVar5) { pvVar8 = *(void **)((int)local_b8 + -4); uVar5 = local_a8._4_4_ + 0x24; if (0x1f < (uint)((int)local_b8 + (-4 - (int)pvVar8))) goto LAB_007273ca; } operator_delete(pvVar8,uVar5); uVar1 = local_a8; } } else { uVar5 = (pIStack_10104->gfxFilename)._capacity; if (0xf < uVar5) { pvVar8 = *(void **)psVar12->_buf; uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_007273ca; } operator_delete(pvVar9,uVar16); } (pIStack_10104->gfxFilename)._size = 0; (pIStack_10104->gfxFilename)._capacity = 0xf; *(undefined4 *)psVar12->_buf = attrValue._buf._8_4_; *(undefined4 *)((pIStack_10104->gfxFilename)._buf + 4) = attrValue._buf._12_4_; *(uint *)((pIStack_10104->gfxFilename)._buf + 8) = attrValue._size; *(uint *)((pIStack_10104->gfxFilename)._buf + 0xc) = attrValue._capacity; (pIStack_10104->gfxFilename)._size = (int)uVar1; (pIStack_10104->gfxFilename)._capacity = (int)((ulonglong)uVar1 >> 0x20); uVar1 = local_a8; } local_a8 = uVar1; local_14._0_1_ = 3; if (0xf < scratchString._capacity) { uVar5 = scratchString._capacity + 1; pvVar8 = (void *)scratchString._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(scratchString._buf._0_4_ + -4); uVar5 = scratchString._capacity + 0x24; if (0x1f < (uint)(scratchString._buf._0_4_ + (-4 - (int)pvVar8))) goto LAB_007273ca; } operator_delete(pvVar8,uVar5); } } } else { pcVar19 = "achievement"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_007261f0: uVar5 = -(uint)bVar17 | 1; goto LAB_007261f5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_007261f0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007261f5: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->achievementId = iVar7; } else { pcVar19 = "cache"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726250: uVar5 = -(uint)bVar17 | 1; goto LAB_00726255; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726250; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726255: if (uVar5 == 0) { attrValue._size = 0; attrValue._capacity = 0xf; attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14,(int)pbVar13 - (int)(pbVar14 + 1)); local_14._0_1_ = 6; uVar5 = parse_cache_flags(&attrValue); pIStack_10104->cacheFlags = pIStack_10104->cacheFlags | uVar5; local_14._0_1_ = 3; if (0xf < attrValue._capacity) { uVar5 = attrValue._capacity + 1; pvVar8 = (void *)attrValue._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(attrValue._buf._0_4_ + -4); uVar5 = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)pvVar8) - 4U) goto LAB_007273ca; } operator_delete(pvVar8,uVar5); } } else { pcVar19 = "maxhearts"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726322: uVar5 = -(uint)bVar17 | 1; goto LAB_00726327; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726322; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726327: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addMaxhearts = iVar7; } else { pcVar19 = "hearts"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726380: uVar5 = -(uint)bVar17 | 1; goto LAB_00726385; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726380; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726385: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addHearts = iVar7; } else { pcVar19 = "soulhearts"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_007263e0: uVar5 = -(uint)bVar17 | 1; goto LAB_007263e5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_007263e0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007263e5: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addSoulHearts = iVar7; } else { pcVar19 = "blackhearts"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726440: uVar5 = -(uint)bVar17 | 1; goto LAB_00726445; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726440; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726445: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addBlackHearts = iVar7; } else { pbVar10 = &DAT_00b66f50; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_007264a0: uVar5 = -(uint)bVar17 | 1; goto LAB_007264a5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_007264a0; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007264a5: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addBombs = iVar7; } else { pbVar10 = &DAT_00b66f58; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00726500: uVar5 = -(uint)bVar17 | 1; goto LAB_00726505; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00726500; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726505: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addKeys = iVar7; } else { pcVar19 = "coins"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726560: uVar5 = -(uint)bVar17 | 1; goto LAB_00726565; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726560; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726565: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->addCoins = iVar7; } else { pcVar19 = "maxcharges"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_007265c0: uVar5 = -(uint)bVar17 | 1; goto LAB_007265c5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_007265c0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007265c5: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->maxCharges = iVar7; } else { pcVar19 = "cooldown"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726620: uVar5 = -(uint)bVar17 | 1; goto LAB_00726625; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726620; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726625: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->maxCooldown = iVar7; } else { pcVar19 = "special"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726680: uVar5 = -(uint)bVar17 | 1; goto LAB_00726685; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726680; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726685: if (uVar5 == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); uVar5 = attrValue._capacity; pvVar8 = (void *)attrValue._buf._0_4_; if (attrValue._size == 0) { LAB_00726748: bVar4 = 0; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } else { psVar12 = &attrValue; if (0xf < attrValue._capacity) { psVar12 = (std_string *)attrValue._buf._0_4_; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64fe8,4); if (iVar7 != 0) goto LAB_00726707; } else { LAB_00726707: psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64ff0,4); if (iVar7 == 0) goto LAB_00726744; } psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } iVar7 = atoi(psVar12->_buf); if (iVar7 == 0) goto LAB_00726748; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } LAB_00726744: bVar4 = 1; } pIStack_10104->special = bVar4; LAB_0072675c: if (0xf < uVar5) { uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_007273ca; } operator_delete(pvVar9,uVar16); } } else { pcVar19 = "devilprice"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_007268a0: uVar5 = -(uint)bVar17 | 1; goto LAB_007268a5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_007268a0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007268a5: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->devilprice = (short)iVar7; } else { pcVar19 = "shopprice"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726900: uVar5 = -(uint)bVar17 | 1; goto LAB_00726905; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726900; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726905: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->shopPrice = (short)iVar7; } else { pcVar19 = "initcharge"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726960: uVar5 = -(uint)bVar17 | 1; goto LAB_00726965; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726960; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726965: if (uVar5 != 0) { pcVar19 = "chargetype"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_007269c0: uVar5 = -(uint)bVar17 | 1; goto LAB_007269c5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_007269c0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007269c5: if (uVar5 == 0) { pcVar19 = "normal"; pbVar14 = (byte *)attr[1]; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726a05: uVar5 = -(uint)bVar17 | 1; goto LAB_00726a0a; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726a05; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726a0a: if (uVar5 == 0) { pIStack_10104->chargeType = 0; } else { pcVar19 = "timed"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726a48: uVar5 = -(uint)bVar17 | 1; goto LAB_00726a4d; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726a48; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726a4d: if (uVar5 == 0) { pIStack_10104->chargeType = 1; } else { pcVar19 = "special"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726a90: uVar5 = -(uint)bVar17 | 1; goto LAB_00726a95; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726a90; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726a95: if (uVar5 == 0) { pIStack_10104->chargeType = 2; } else { KAGE_LogMessage(0x10,(byte *) "invalid charge type: %s\n"); } } } goto LAB_00726790; } pcVar19 = "passivecache"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726af6: uVar5 = -(uint)bVar17 | 1; goto LAB_00726afb; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726af6; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726afb: if (uVar5 == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); uVar5 = attrValue._capacity; pvVar8 = (void *)attrValue._buf._0_4_; if (attrValue._size == 0) { LAB_00726bc7: pIStack_10104->passiveCache = 0; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } else { psVar12 = &attrValue; if (0xf < attrValue._capacity) { psVar12 = (std_string *)attrValue._buf._0_4_; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64fe8,4); if (iVar7 != 0) goto LAB_00726b77; } else { LAB_00726b77: psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64ff0,4); if (iVar7 == 0) goto LAB_00726bb4; } psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } iVar7 = atoi(psVar12->_buf); if (iVar7 == 0) goto LAB_00726bc7; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } LAB_00726bb4: pIStack_10104->passiveCache = 1; } } else { pcVar19 = "addcostumeonpickup"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726c10: uVar5 = -(uint)bVar17 | 1; goto LAB_00726c15; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726c10; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726c15: if (uVar5 == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); uVar5 = attrValue._capacity; pvVar8 = (void *)attrValue._buf._0_4_; if (attrValue._size == 0) { LAB_00726ce7: pIStack_10104->addCostumeOnPickup = 0; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } else { psVar12 = &attrValue; if (0xf < attrValue._capacity) { psVar12 = (std_string *)attrValue._buf._0_4_; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64fe8,4); if (iVar7 != 0) goto LAB_00726c97; } else { LAB_00726c97: psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64ff0,4); if (iVar7 == 0) goto LAB_00726cd4; } psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } iVar7 = atoi(psVar12->_buf); if (iVar7 == 0) goto LAB_00726ce7; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } LAB_00726cd4: pIStack_10104->addCostumeOnPickup = 1; } } else { pcVar19 = "cleareffectsonremove"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726d30: uVar5 = -(uint)bVar17 | 1; goto LAB_00726d35; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726d30; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726d35: if (uVar5 == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); uVar5 = attrValue._capacity; pvVar8 = (void *)attrValue._buf._0_4_; if (attrValue._size == 0) { LAB_00726e07: pIStack_10104->clearEffectsOnRemove = 0; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } else { psVar12 = &attrValue; if (0xf < attrValue._capacity) { psVar12 = (std_string *)attrValue._buf._0_4_ ; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64fe8,4); if (iVar7 != 0) goto LAB_00726db7; } else { LAB_00726db7: psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64ff0,4) ; if (iVar7 == 0) goto LAB_00726df4; } psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } iVar7 = atoi(psVar12->_buf); if (iVar7 == 0) goto LAB_00726e07; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } LAB_00726df4: pIStack_10104->clearEffectsOnRemove = 1; } } else { pcVar19 = "hidden"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726e50: uVar5 = -(uint)bVar17 | 1; goto LAB_00726e55; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726e50; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726e55: if (uVar5 == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); uVar5 = attrValue._capacity; pvVar8 = (void *)attrValue._buf._0_4_; if (attrValue._size == 0) { LAB_00726f27: pIStack_10104->hidden = 0; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } else { psVar12 = &attrValue; if (0xf < attrValue._capacity) { psVar12 = (std_string *) attrValue._buf._0_4_; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64fe8,4) ; if (iVar7 != 0) goto LAB_00726ed7; } else { LAB_00726ed7: psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64ff0, 4); if (iVar7 == 0) goto LAB_00726f14; } psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } iVar7 = atoi(psVar12->_buf); if (iVar7 == 0) goto LAB_00726f27; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } LAB_00726f14: pIStack_10104->hidden = 1; } } else { pcVar19 = "persistent"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00726f70: uVar5 = -(uint)bVar17 | 1; goto LAB_00726f75; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00726f70; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00726f75: if (uVar5 != 0) { pcVar19 = "quality"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_00727090: uVar5 = -(uint)bVar17 | 1; goto LAB_00727095; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_00727090; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00727095: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->quality = iVar7; } else { pcVar19 = "craftquality"; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < (byte)*pcVar19; if (bVar4 != *pcVar19) { LAB_007270f0: uVar5 = -(uint)bVar17 | 1; goto LAB_007270f5; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < (byte)pcVar19[1]; if (bVar4 != pcVar19[1]) goto LAB_007270f0; pbVar13 = pbVar13 + 2; pcVar19 = pcVar19 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007270f5: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->craftingQuality = iVar7; } else { pbVar10 = &DAT_00b66d44; pbVar13 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar13 = pbVar14; } do { bVar4 = *pbVar13; bVar17 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00727150: uVar5 = -(uint)bVar17 | 1; goto LAB_00727155; } if (bVar4 == 0) break; bVar4 = pbVar13[1]; bVar17 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00727150; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_00727155: if (uVar5 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } std::string::string_from_cstr (scratchString._buf,pbVar14) ; local_14._0_1_ = 7; uVar18 = parse_tags(&scratchString); pIStack_10104->tags = uVar18; local_14._0_1_ = 3; std::string::_Tidy_deallocate (scratchString._buf); } } } goto LAB_00726790; } attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } pbVar13 = pbVar14; do { bVar4 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar4 != 0); std::string::assign(attrValue._buf,pbVar14, (int)pbVar13 - (int)(pbVar14 + 1)); uVar5 = attrValue._capacity; pvVar8 = (void *)attrValue._buf._0_4_; if (attrValue._size == 0) { LAB_00727047: pIStack_10104->persistentEffect = 0; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } else { psVar12 = &attrValue; if (0xf < attrValue._capacity) { psVar12 = (std_string *) attrValue._buf._0_4_; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64fe8,4) ; if (iVar7 != 0) goto LAB_00726ff7; } else { LAB_00726ff7: psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } if (attrValue._size == 4) { iVar7 = memcmp_eq(psVar12,&DAT_00b64ff0, 4); if (iVar7 == 0) goto LAB_00727034; } psVar12 = &attrValue; if (0xf < uVar5) { psVar12 = pvVar8; } iVar7 = atoi(psVar12->_buf); if (iVar7 == 0) goto LAB_00727047; pvVar8 = (void *)attrValue._buf._0_4_; uVar5 = attrValue._capacity; } LAB_00727034: pIStack_10104->persistentEffect = 1; } } } } } goto LAB_0072675c; } pbVar14 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar14 = (byte *)attr[1]; } iVar7 = atoi((char *)pbVar14); pIStack_10104->_initCharge = iVar7; } } } } } } } } } } } } } } } } } } LAB_00726790: if (attr[4] == 0) break; } iVar7 = pIStack_10104->craftingQuality; (pIStack_10104->costume).id = -1; if (iVar7 == -0x70000001) { pIStack_10104->craftingQuality = pIStack_10104->quality; } iVar7 = pIStack_10104->type; if (((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) { if (tag != 0) { idRef = &pIStack_10104->id; iVar7 = in_ECX[1] - *in_ECX >> 2; piVar11 = (int *)std::map::operator_index(idRef); *piVar11 = iVar7; *(int *)(pIStack_10104[1].name._buf + 8) = *idRef; *(int *)(pIStack_10104[1].name._buf + 0xc) = param_2; *idRef = iVar7; uVar5 = iVar7 + 1; pvVar8 = (void *)in_ECX[1]; iVar7 = *in_ECX; uVar16 = (int)pvVar8 - iVar7 >> 2; if (uVar5 < uVar16) { pvVar8 = (void *)(iVar7 + uVar5 * 4); LAB_00727307: in_ECX[1] = (int)pvVar8; } else if (uVar16 < uVar5) { if (uVar5 <= (uint)(in_ECX[2] - iVar7 >> 2)) { sVar15 = (uVar5 - uVar16) * 4; memset(pvVar8,0,sVar15); pvVar8 = (void *)((int)pvVar8 + sVar15); goto LAB_00727307; } std::vector<4byte>::_Resize_reallocate(uVar5,uVar16); } } *(ItemConfig_Item **)(*in_ECX + pIStack_10104->id * 4) = pIStack_10104; iVar7 = pIStack_10104->id; psVar12 = ItemConfig_Item::GetLocalizedName(pIStack_10104,&scratchString,0x14); local_14._0_1_ = 8; piVar11 = (int *)FUN_0069d630(psVar12); *piVar11 = iVar7; std::string::_Tidy_deallocate(scratchString._buf); } else if (iVar7 == 2) { if (tag != 0) { idRef = &pIStack_10104->id; newTrinketId = in_ECX[4] - in_ECX[3] >> 2; piVar11 = (int *)std::map::operator_index(idRef); *piVar11 = newTrinketId; iVar7 = *idRef; *idRef = newTrinketId; uVar5 = newTrinketId + 1; *(int *)(pIStack_10104[1].name._buf + 8) = iVar7; *(int *)(pIStack_10104[1].name._buf + 0xc) = param_2; pvVar8 = (void *)in_ECX[4]; iVar7 = in_ECX[3]; uVar16 = (int)pvVar8 - iVar7 >> 2; if (uVar5 < uVar16) { pvVar8 = (void *)(iVar7 + uVar5 * 4); } else { if (uVar5 <= uVar16) goto LAB_007271fb; if ((uint)(in_ECX[5] - iVar7 >> 2) < uVar5) { std::vector<4byte>::_Resize_reallocate(uVar5,uVar16); *(ItemConfig_Item **)(in_ECX[3] + pIStack_10104->id * 4) = pIStack_10104; goto LAB_00727355; } sVar15 = (uVar5 - uVar16) * 4; memset(pvVar8,0,sVar15); pvVar8 = (void *)((int)pvVar8 + sVar15); } in_ECX[4] = (int)pvVar8; } LAB_007271fb: *(ItemConfig_Item **)(in_ECX[3] + pIStack_10104->id * 4) = pIStack_10104; } else if (iVar7 == 0) { iVar7 = pIStack_10104->id; tmpItem = *(ItemConfig_Item **)(in_ECX[6] + iVar7 * 4); if (tmpItem != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(tmpItem); operator_delete(tmpItem,0xe8); iVar7 = pIStack_10104->id; } *(ItemConfig_Item **)(in_ECX[6] + iVar7 * 4) = pIStack_10104; } else { ItemConfig_Item::~ItemConfig_Item(pIStack_10104); operator_delete(pIStack_10104,0xe8); } LAB_00727355: local_14._0_1_ = 1; if (0xf < xmlString._capacity) { uVar5 = xmlString._capacity + 1; pvVar8 = (void *)xmlString._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(xmlString._buf._0_4_ + -4); uVar5 = xmlString._capacity + 0x24; if (0x1f < (xmlString._buf._0_4_ - (int)pvVar8) - 4U) goto LAB_007273ca; } operator_delete(pvVar8,uVar5); } } local_14._0_1_ = 0; if (0xf < gfxRoot._capacity) { uVar5 = gfxRoot._capacity + 1; pvVar8 = (void *)gfxRoot._buf._0_4_; if (0xfff < uVar5) { pvVar8 = *(void **)(gfxRoot._buf._0_4_ + -4); uVar5 = gfxRoot._capacity + 0x24; if (0x1f < (uint)(gfxRoot._buf._0_4_ + (-4 - (int)pvVar8))) { LAB_007273ca: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar5); } local_14 = (void *)0x9; xml_memory_pool::clear(xmlPool); local_14 = (void *)0xa; tracked_alloc(1,text,0); isLoaded = 1; } ExceptionList = local_1c; return isLoaded; } //@@ 00727430 ItemConfig::load_costumes_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: costumes2.xml: "Could not find root node costumes", anm2root/fxroot/priority/hasOverlay/isFlying/forceBodyColor/skinColor attributes prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemConfig::load_costumes_xml(ItemConfig *rootNode,byte *path,void *mod) { void **ppvVar1; uint uVar2; ItemConfig *pIVar3; byte bVar4; uint local_EAX_52; int iVar5; void *rootNode; void *anm2RootAttr; byte ******ppppppbVar6; int iVar7; byte *******pppppppbVar8; int *piVar9; byte *strEnd; byte *pbVar10; std_string *valueLength; byte ******ppppppbVar11; uint uVar12; bool bVar13; char *pcVar14; ItemConfig_Item *newItem; uint modIdMap; byte *xmlText; ItemConfig *itemConfig; byte *******pppppppbStack_100e8; int costumeId; byte *******anm2Path; undefined4 uStack_100dc; undefined4 uStack_100d8; undefined4 uStack_100d4; uint anm2PathSize; uint anm2PathCapacity; int iStack_100c8; undefined2 uStack_100c4; undefined1 isSkinAlt; int iStack_100c0; undefined2 uStack_100bc; undefined1 isForceBodyColor; undefined1 xmlDoc [48]; undefined1 xmlPool [65564]; byte *******anm2Root [4]; uint anm2RootSize; uint anm2RootCapacity; byte *******typeText [4]; uint typeTextSize; uint typeTextCapacity; byte *******attrValue; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; uint attrValueSize; uint attrValueCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; undefined4 *vectorEnd; puStack_20 = (undefined1 *)(typeText + 0x14); local_14 = (byte ******)0xffffffff; puStack_18 = &LAB_00afd0db; local_1c = ExceptionList; local_EAX_52 = __security_cookie ^ (uint)(typeText + 0x11); ExceptionList = &local_1c; modIdMap = -(uint)(mod != (void *)0x0) & (int)mod + 0xecU; itemConfig = rootNode; local_24 = local_EAX_52; pppppppbStack_100e8 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (pppppppbStack_100e8 == (byte *******)0x0) { KAGE_LogMessage(1,(byte *)"[warn] could not open %s.\n"); bVar4 = 0; } else { iVar5 = (*(code *)(*pppppppbStack_100e8)[1])(local_EAX_52); xmlText = operator_new_tracked(iVar5 + 1); (*(code *)(*pppppppbStack_100e8)[5])(xmlText,1,iVar5); xmlText[iVar5] = 0; (*(code *)**pppppppbStack_100e8)(1); FUN_00413b90(); local_14._0_1_ = 0; local_14._1_3_ = 0; pcVar14 = (char *)0x727539; pbVar10 = xmlText; rapidxml::xml_document::parse(xmlDoc,xmlText); bVar4 = (byte)pbVar10; rootNode = xml_node::first_node(xmlDoc,(byte *)"costumes",(int)pcVar14,bVar4); if (rootNode == (void *)0x0) { pcVar14 = "Could not find root node \'costumes\' in %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'costumes\' in %s\n"); bVar4 = (byte)path; } anm2RootAttr = xml_node::first_attribute(rootNode,(byte *)"anm2root",(uint)pcVar14,bVar4); anm2RootSize = 0; anm2RootCapacity = 0xf; anm2Root[0] = (byte *******)0x0; pbVar10 = &g_xmlNullStr; if (*(byte **)((int)anm2RootAttr + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)anm2RootAttr + 4); } strEnd = pbVar10; do { bVar4 = *strEnd; strEnd = strEnd + 1; } while (bVar4 != 0); std::string::assign((char *)anm2Root,pbVar10,(int)strEnd - (int)(pbVar10 + 1)); for (iVar5 = *(int *)((int)rootNode + 0x18); iVar5 != 0; iVar5 = *(int *)(iVar5 + 0x2c)) { costumeId = 0; anm2PathSize = 0; anm2PathCapacity = 0xf; anm2Path = (byte *******)0x0; iStack_100c8 = 0; uStack_100c4 = 0; isSkinAlt = 0; iStack_100c0 = -1; uStack_100bc = 0; isForceBodyColor = 0; typeTextSize = 0; typeTextCapacity = 0xf; typeText[0] = (byte *******)0x0; local_14._0_1_ = 3; pppppppbStack_100e8 = *(byte ********)(iVar5 + 0x20); if (pppppppbStack_100e8 != (byte *******)0x0) { do { ppppppbVar11 = *pppppppbStack_100e8; pbVar10 = s_id; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00727685: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_0072768a; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00727685; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pbVar10 = pbVar10 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_0072768a: if (local_EAX_52 == 0) { ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } costumeId = atoi((char *)ppppppbVar11); } else { pbVar10 = &DAT_00b69a0c; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_007276e5: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_007276ea; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_007276e5; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pbVar10 = pbVar10 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_007276ea: if (local_EAX_52 == 0) { ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)typeText,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); } else { pbVar10 = &DAT_00b66cc8; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_00727750: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727755; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_00727750; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pbVar10 = pbVar10 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727755: if (local_EAX_52 == 0) { ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); valueLength = (std_string *)((int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < valueLength) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar8 = (byte *******)anm2Root; if (0xf < anm2RootCapacity) { pppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&attrValue,(int)newItem,valueLength,(byte *)pppppppbVar8 ,anm2RootSize,(byte *)ppppppbVar11,(uint)valueLength); if (0xf < anm2PathCapacity) { local_EAX_52 = anm2PathCapacity + 1; pppppppbVar8 = anm2Path; if (0xfff < local_EAX_52) { pppppppbVar8 = (byte *******)anm2Path[-1]; local_EAX_52 = anm2PathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Path + (-4 - (int)pppppppbVar8))) goto LAB_007286ab; } operator_delete(pppppppbVar8,local_EAX_52); } anm2Path = attrValue; uStack_100dc = uStack_38; uStack_100d8 = uStack_34; uStack_100d4 = uStack_30; anm2PathSize = attrValueSize; anm2PathCapacity = attrValueCapacity; } else { pcVar14 = "priority"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_00727840: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727845; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_00727840; pcVar14 = pcVar14 + 2; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727845: if (local_EAX_52 == 0) { ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } iStack_100c8 = atoi((char *)ppppppbVar11); } else { pcVar14 = "hasOverlay"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_007278a0: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_007278a5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_007278a0; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_007278a5: if (local_EAX_52 == 0) { attrValue = (byte *******)0x0; attrValueSize = 0; attrValueCapacity = 0xf; ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)&attrValue,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if (attrValueSize == 0) { LAB_007279b4: uStack_100c4 = uStack_100c4 & 0xff00; } else { pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757274) || ((((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x74, bVar4 == 0x74 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 != 0) goto LAB_00727949; } else { LAB_00727949: pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757254) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x54, bVar4 == 0x54 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 == 0) goto LAB_007279a8; } pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } iVar7 = atoi((char *)pppppppbVar8); if (iVar7 == 0) goto LAB_007279b4; } LAB_007279a8: uStack_100c4 = CONCAT11(uStack_100c4._1_1_,1); } } else { pcVar14 = "hasSkinAlt"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_007279f0: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_007279f5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_007279f0; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_007279f5: if (local_EAX_52 == 0) { attrValue = (byte *******)0x0; attrValueSize = 0; attrValueCapacity = 0xf; ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)&attrValue,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if (attrValueSize == 0) { LAB_00727b04: isSkinAlt = 0; } else { pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757274) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x74, bVar4 == 0x74 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 != 0) goto LAB_00727a99; } else { LAB_00727a99: pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757254) || ((((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x54, bVar4 == 0x54 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 == 0) goto LAB_00727af8; } pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } iVar7 = atoi((char *)pppppppbVar8); if (iVar7 == 0) goto LAB_00727b04; } LAB_00727af8: isSkinAlt = 1; } } else { pcVar14 = "skinColor"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_00727b40: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727b45; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_00727b40; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727b45: if (local_EAX_52 == 0) { ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } iStack_100c0 = atoi((char *)ppppppbVar11); goto LAB_007280de; } pcVar14 = "isFlying"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_00727ba0: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727ba5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_00727ba0; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727ba5: if (local_EAX_52 == 0) { attrValue = (byte *******)0x0; attrValueSize = 0; attrValueCapacity = 0xf; ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)&attrValue,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if (attrValueSize == 0) { LAB_00727cb4: uStack_100c4 = uStack_100c4 & 0xff; } else { pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757274) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x74, bVar4 == 0x74 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 != 0) goto LAB_00727c49; } else { LAB_00727c49: pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757254) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x54, bVar4 == 0x54 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 == 0) goto LAB_00727ca8; } pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } iVar7 = atoi((char *)pppppppbVar8); if (iVar7 == 0) goto LAB_00727cb4; } LAB_00727ca8: uStack_100c4 = CONCAT11(1,(undefined1)uStack_100c4); } } else { pcVar14 = "overwriteColor"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_00727cf0: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727cf5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_00727cf0; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727cf5: if (local_EAX_52 == 0) { attrValue = (byte *******)0x0; attrValueSize = 0; attrValueCapacity = 0xf; ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)&attrValue,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if (attrValueSize == 0) { LAB_00727e04: uStack_100bc = uStack_100bc & 0xff00; } else { pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757274) || ((((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x74, bVar4 == 0x74 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 != 0) goto LAB_00727d99; } else { LAB_00727d99: pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757254) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x54, bVar4 == 0x54 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 == 0) goto LAB_00727df8; } pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } iVar7 = atoi((char *)pppppppbVar8); if (iVar7 == 0) goto LAB_00727e04; } LAB_00727df8: uStack_100bc = CONCAT11(uStack_100bc._1_1_,1); } } else { pcVar14 = "forceHeadColor"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_00727e40: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727e45; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_00727e40; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727e45: if (local_EAX_52 == 0) { attrValue = (byte *******)0x0; attrValueSize = 0; attrValueCapacity = 0xf; ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)&attrValue,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if (attrValueSize == 0) { LAB_00727f54: uStack_100bc = uStack_100bc & 0xff; } else { pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757274) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x74, bVar4 == 0x74 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 != 0) goto LAB_00727ee9; } else { LAB_00727ee9: pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757254) || ((((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x54, bVar4 == 0x54 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75)) && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 == 0) goto LAB_00727f48; } pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } iVar7 = atoi((char *)pppppppbVar8); if (iVar7 == 0) goto LAB_00727f54; } LAB_00727f48: uStack_100bc = CONCAT11(1,(undefined1)uStack_100bc); } } else { pcVar14 = "forceBodyColor"; ppppppbVar6 = (byte ******)&g_xmlNullStr; if (ppppppbVar11 != (byte ******)0x0) { ppppppbVar6 = ppppppbVar11; } do { bVar4 = *(byte *)ppppppbVar6; bVar13 = bVar4 < (byte)*pcVar14; if (bVar4 != *pcVar14) { LAB_00727f90: local_EAX_52 = -(uint)bVar13 | 1; goto LAB_00727f95; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)ppppppbVar6 + 1); bVar13 = bVar4 < (byte)pcVar14[1]; if (bVar4 != pcVar14[1]) goto LAB_00727f90; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 2); pcVar14 = pcVar14 + 2; } while (bVar4 != 0); local_EAX_52 = 0; LAB_00727f95: if (local_EAX_52 != 0) goto LAB_007280de; attrValue = (byte *******)0x0; attrValueSize = 0; attrValueCapacity = 0xf; ppppppbVar11 = (byte ******)&g_xmlNullStr; if (pppppppbStack_100e8[1] != (byte ******)0x0) { ppppppbVar11 = pppppppbStack_100e8[1]; } ppppppbVar6 = ppppppbVar11; do { bVar4 = *(byte *)ppppppbVar6; ppppppbVar6 = (byte ******)((int)ppppppbVar6 + 1); } while (bVar4 != 0); std::string::assign((char *)&attrValue,(byte *)ppppppbVar11, (int)ppppppbVar6 - (int)((int)ppppppbVar11 + 1)); if (attrValueSize == 0) { LAB_007280a1: isForceBodyColor = 0; } else { pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757274) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x74, bVar4 == 0x74 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 != 0) goto LAB_00728039; } else { LAB_00728039: pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } if (attrValueSize == 4) { if ((*pppppppbVar8 == (byte ******)0x65757254) || (((bVar4 = (byte)*pppppppbVar8, bVar13 = bVar4 < 0x54, bVar4 == 0x54 && (bVar13 = *(byte *)((int)pppppppbVar8 + 1) < 0x72, *(byte *)((int)pppppppbVar8 + 1) == 0x72)) && ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < 0x75, *(byte *)((int)pppppppbVar8 + 2) == 0x75 && (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < 0x65, *(byte *)((int)pppppppbVar8 + 3) == 0x65)))))) { local_EAX_52 = 0; } else { local_EAX_52 = -(uint)bVar13 | 1; } if (local_EAX_52 == 0) goto LAB_00728098; } pppppppbVar8 = (byte *******)&attrValue; if (0xf < attrValueCapacity) { pppppppbVar8 = attrValue; } iVar7 = atoi((char *)pppppppbVar8); if (iVar7 == 0) goto LAB_007280a1; } LAB_00728098: isForceBodyColor = 1; } } } } } } if (0xf < attrValueCapacity) { local_EAX_52 = attrValueCapacity + 1; pppppppbVar8 = attrValue; if (0xfff < local_EAX_52) { pppppppbVar8 = (byte *******)attrValue[-1]; local_EAX_52 = attrValueCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)attrValue + (-4 - (int)pppppppbVar8))) goto LAB_007286ab; } operator_delete(pppppppbVar8,local_EAX_52); } } } } } LAB_007280de: } while ((pppppppbStack_100e8[4] != (byte ******)0x0) && (pppppppbStack_100e8 = (byte *******)pppppppbStack_100e8[6], pppppppbStack_100e8 != (byte *******)0x0)); } pIVar3 = itemConfig; pppppppbVar8 = (byte *******)typeText; if (0xf < typeTextCapacity) { pppppppbVar8 = typeText[0]; } pppppppbStack_100e8 = typeText[0]; pbVar10 = (byte *)&DAT_00b671d0; local_EAX_52 = typeTextSize; if (4 < typeTextSize) { local_EAX_52 = 4; } while (uVar12 = local_EAX_52 - 4, 3 < local_EAX_52) { if (*pppppppbVar8 != *(byte *******)pbVar10) goto LAB_00728146; pppppppbVar8 = pppppppbVar8 + 1; pbVar10 = pbVar10 + 4; local_EAX_52 = uVar12; } if (uVar12 == 0xfffffffc) { LAB_0072817a: local_EAX_52 = 0; } else { LAB_00728146: bVar13 = *(byte *)pppppppbVar8 < *pbVar10; if ((*(byte *)pppppppbVar8 == *pbVar10) && ((uVar12 == 0xfffffffd || ((bVar13 = *(byte *)((int)pppppppbVar8 + 1) < pbVar10[1], *(byte *)((int)pppppppbVar8 + 1) == pbVar10[1] && ((uVar12 == 0xfffffffe || ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < pbVar10[2], *(byte *)((int)pppppppbVar8 + 2) == pbVar10[2] && ((uVar12 == 0xffffffff || (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < pbVar10[3], *(byte *)((int)pppppppbVar8 + 3) == pbVar10[3])))))))))))) goto LAB_0072817a; local_EAX_52 = -(uint)bVar13 | 1; } if (((local_EAX_52 == 0) && (3 < typeTextSize)) && (typeTextSize < 5)) { if (modIdMap != 0) { costumeId = (int)(itemConfig->_nullItems)._end - (int)(itemConfig->_nullItems)._begin >> 2 ; newItem = operator_new(0xe8); if (newItem == (ItemConfig_Item *)0x0) { newItem = (ItemConfig_Item *)0x0; } else { newItem = ItemConfig_Item::ItemConfig_Item(newItem); } vectorEnd = (pIVar3->_nullItems)._end; if (vectorEnd == (pIVar3->_nullItems)._capacity) { std::vector::_Emplace_reallocate(vectorEnd,&newItem); } else { *vectorEnd = newItem; ppvVar1 = &(pIVar3->_nullItems)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } *(int *)(*(int *)((int)(pIVar3->_nullItems)._end + -4) + 4) = costumeId; } iVar7 = *(int *)((int)(pIVar3->_nullItems)._begin + costumeId * 4); *(int *)(iVar7 + 0x80) = costumeId; if ((byte ********)(iVar7 + 0x84) != &anm2Path) { pppppppbVar8 = (byte *******)&anm2Path; if (0xf < anm2PathCapacity) { pppppppbVar8 = anm2Path; } std::string::assign((char *)(iVar7 + 0x84),(byte *)pppppppbVar8,anm2PathSize); } *(int *)(iVar7 + 0x9c) = iStack_100c8; *(undefined1 *)(iVar7 + 0xa0) = (undefined1)uStack_100c4; *(undefined1 *)(iVar7 + 0xa1) = uStack_100c4._1_1_; *(undefined1 *)(iVar7 + 0xa2) = isSkinAlt; *(int *)(iVar7 + 0xa4) = iStack_100c0; *(undefined1 *)(iVar7 + 0xa8) = (undefined1)uStack_100bc; *(undefined1 *)(iVar7 + 0xa9) = uStack_100bc._1_1_; *(undefined1 *)(iVar7 + 0xaa) = isForceBodyColor; } else { pcVar14 = "passive"; pppppppbVar8 = (byte *******)typeText; if (0xf < typeTextCapacity) { pppppppbVar8 = typeText[0]; } local_EAX_52 = typeTextSize; uVar12 = typeTextSize; if (7 < typeTextSize) { local_EAX_52 = 7; uVar12 = local_EAX_52; } while (uVar2 = local_EAX_52 - 4, 3 < local_EAX_52) { if (*pppppppbVar8 != *(byte *******)pcVar14) goto LAB_007282ce; pppppppbVar8 = pppppppbVar8 + 1; pcVar14 = pcVar14 + 4; local_EAX_52 = uVar2; } if (uVar2 == 0xfffffffc) { LAB_00728302: local_EAX_52 = 0; } else { LAB_007282ce: bVar13 = *(byte *)pppppppbVar8 < (byte)*pcVar14; if ((*(byte *)pppppppbVar8 == *pcVar14) && ((uVar2 == 0xfffffffd || ((bVar13 = *(byte *)((int)pppppppbVar8 + 1) < (byte)pcVar14[1], *(byte *)((int)pppppppbVar8 + 1) == pcVar14[1] && ((uVar2 == 0xfffffffe || ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < (byte)pcVar14[2], *(byte *)((int)pppppppbVar8 + 2) == pcVar14[2] && ((uVar2 == 0xffffffff || (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < (byte)pcVar14[3], *(byte *)((int)pppppppbVar8 + 3) == pcVar14[3])))))))))))) goto LAB_00728302; local_EAX_52 = -(uint)bVar13 | 1; } if (((local_EAX_52 != 0) || (typeTextSize < 7)) || (7 < typeTextSize)) { pcVar14 = "active"; pppppppbVar8 = (byte *******)typeText; if (0xf < typeTextCapacity) { pppppppbVar8 = typeText[0]; } local_EAX_52 = typeTextSize; if (6 < typeTextSize) { local_EAX_52 = 6; } while (uVar2 = local_EAX_52 - 4, 3 < local_EAX_52) { if (*pppppppbVar8 != *(byte *******)pcVar14) goto LAB_00728356; pppppppbVar8 = pppppppbVar8 + 1; pcVar14 = pcVar14 + 4; local_EAX_52 = uVar2; } if (uVar2 == 0xfffffffc) { LAB_0072838a: local_EAX_52 = 0; } else { LAB_00728356: bVar13 = *(byte *)pppppppbVar8 < (byte)*pcVar14; if ((*(byte *)pppppppbVar8 == *pcVar14) && ((uVar2 == 0xfffffffd || ((bVar13 = *(byte *)((int)pppppppbVar8 + 1) < (byte)pcVar14[1], *(byte *)((int)pppppppbVar8 + 1) == pcVar14[1] && ((uVar2 == 0xfffffffe || ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < (byte)pcVar14[2], *(byte *)((int)pppppppbVar8 + 2) == pcVar14[2] && ((uVar2 == 0xffffffff || (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < (byte)pcVar14[3], *(byte *)((int)pppppppbVar8 + 3) == pcVar14[3])))))))))))) goto LAB_0072838a; local_EAX_52 = -(uint)bVar13 | 1; } if (((local_EAX_52 != 0) || (typeTextSize < 6)) || (6 < typeTextSize)) { pcVar14 = "familiar"; pppppppbVar8 = (byte *******)typeText; if (0xf < typeTextCapacity) { pppppppbVar8 = typeText[0]; } local_EAX_52 = typeTextSize; if (8 < typeTextSize) { local_EAX_52 = 8; } while (uVar2 = local_EAX_52 - 4, 3 < local_EAX_52) { if (*pppppppbVar8 != *(byte *******)pcVar14) goto LAB_007283d9; pppppppbVar8 = pppppppbVar8 + 1; pcVar14 = pcVar14 + 4; local_EAX_52 = uVar2; } if (uVar2 == 0xfffffffc) { LAB_0072840d: local_EAX_52 = 0; } else { LAB_007283d9: bVar13 = *(byte *)pppppppbVar8 < (byte)*pcVar14; if ((*(byte *)pppppppbVar8 == *pcVar14) && ((uVar2 == 0xfffffffd || ((bVar13 = *(byte *)((int)pppppppbVar8 + 1) < (byte)pcVar14[1], *(byte *)((int)pppppppbVar8 + 1) == pcVar14[1] && ((uVar2 == 0xfffffffe || ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < (byte)pcVar14[2], *(byte *)((int)pppppppbVar8 + 2) == pcVar14[2] && ((uVar2 == 0xffffffff || (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < (byte)pcVar14[3], *(byte *)((int)pppppppbVar8 + 3) == pcVar14[3])))))))))))) goto LAB_0072840d; local_EAX_52 = -(uint)bVar13 | 1; } if (((local_EAX_52 != 0) || (typeTextSize < 8)) || (8 < typeTextSize)) { pcVar14 = "trinket"; pppppppbVar8 = (byte *******)typeText; if (0xf < typeTextCapacity) { pppppppbVar8 = typeText[0]; } while (local_EAX_52 = uVar12 - 4, 3 < uVar12) { if (*pppppppbVar8 != *(byte *******)pcVar14) goto LAB_0072854c; pcVar14 = pcVar14 + 4; pppppppbVar8 = pppppppbVar8 + 1; uVar12 = local_EAX_52; } if (local_EAX_52 == 0xfffffffc) { LAB_00728580: local_EAX_52 = 0; } else { LAB_0072854c: bVar13 = *(byte *)pppppppbVar8 < (byte)*pcVar14; if ((*(byte *)pppppppbVar8 == *pcVar14) && ((local_EAX_52 == 0xfffffffd || ((bVar13 = *(byte *)((int)pppppppbVar8 + 1) < (byte)pcVar14[1], *(byte *)((int)pppppppbVar8 + 1) == pcVar14[1] && ((local_EAX_52 == 0xfffffffe || ((bVar13 = *(byte *)((int)pppppppbVar8 + 2) < (byte)pcVar14[2], *(byte *)((int)pppppppbVar8 + 2) == pcVar14[2] && ((local_EAX_52 == 0xffffffff || (bVar13 = *(byte *)((int)pppppppbVar8 + 3) < (byte)pcVar14[3], *(byte *)((int)pppppppbVar8 + 3) == pcVar14[3])))))))))))) goto LAB_00728580; local_EAX_52 = -(uint)bVar13 | 1; } if (((local_EAX_52 == 0) && (6 < typeTextSize)) && (typeTextSize < 8)) { if (modIdMap != 0) { piVar9 = (int *)std::map::operator_index(&costumeId); costumeId = *piVar9; } pIVar3 = itemConfig; if ((int)(itemConfig->_trinkets)._end - (int)(itemConfig->_trinkets)._begin >> 2 <= costumeId) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds.\n"); } if (*(int *)((int)(pIVar3->_trinkets)._begin + costumeId * 4) != 0) { ItemConfig_Costume::operator_assign(&costumeId); } } goto LAB_007285f3; } } } if (modIdMap != 0) { piVar9 = (int *)std::map::operator_index(&costumeId); costumeId = *piVar9; } pIVar3 = itemConfig; rootNode = (itemConfig->_collectibles)._begin; if ((int)(itemConfig->_collectibles)._end - (int)rootNode >> 2 <= costumeId) { KAGE_LogMessage(0x10,(byte *)"Costume ID out of bounds.\n"); rootNode = (pIVar3->_collectibles)._begin; } iVar7 = *(int *)((int)rootNode + costumeId * 4); if (iVar7 != 0) { *(int *)(iVar7 + 0x80) = costumeId; if ((byte ********)(iVar7 + 0x84) != &anm2Path) { pppppppbVar8 = (byte *******)&anm2Path; if (0xf < anm2PathCapacity) { pppppppbVar8 = anm2Path; } std::string::assign((char *)(iVar7 + 0x84),(byte *)pppppppbVar8,anm2PathSize); } *(int *)(iVar7 + 0x9c) = iStack_100c8; *(undefined1 *)(iVar7 + 0xa0) = (undefined1)uStack_100c4; *(undefined1 *)(iVar7 + 0xa1) = uStack_100c4._1_1_; *(undefined1 *)(iVar7 + 0xa2) = isSkinAlt; *(int *)(iVar7 + 0xa4) = iStack_100c0; *(undefined1 *)(iVar7 + 0xa8) = (undefined1)uStack_100bc; *(undefined1 *)(iVar7 + 0xa9) = uStack_100bc._1_1_; *(undefined1 *)(iVar7 + 0xaa) = isForceBodyColor; } } LAB_007285f3: local_14._0_1_ = 2; if (0xf < typeTextCapacity) { local_EAX_52 = typeTextCapacity + 1; pppppppbVar8 = pppppppbStack_100e8; if (0xfff < local_EAX_52) { pppppppbVar8 = (byte *******)pppppppbStack_100e8[-1]; local_EAX_52 = typeTextCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbStack_100e8 + (-4 - (int)pppppppbVar8))) goto LAB_007286ab; } operator_delete(pppppppbVar8,local_EAX_52); } local_14._0_1_ = 1; if (0xf < anm2PathCapacity) { local_EAX_52 = anm2PathCapacity + 1; pppppppbVar8 = anm2Path; if (0xfff < local_EAX_52) { pppppppbVar8 = (byte *******)anm2Path[-1]; local_EAX_52 = anm2PathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Path + (-4 - (int)pppppppbVar8))) goto LAB_007286ab; } operator_delete(pppppppbVar8,local_EAX_52); } } local_14._0_1_ = 0; if (0xf < anm2RootCapacity) { local_EAX_52 = anm2RootCapacity + 1; pppppppbVar8 = anm2Root[0]; if (0xfff < local_EAX_52) { pppppppbVar8 = (byte *******)anm2Root[0][-1]; local_EAX_52 = anm2RootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Root[0] + (-4 - (int)pppppppbVar8))) { LAB_007286ab: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar8,local_EAX_52); } local_14 = (byte ******)0x4; xml_memory_pool::clear(xmlPool); local_14 = (byte ******)0x5; tracked_alloc(1,xmlText,0); bVar4 = 1; } ExceptionList = local_1c; return bVar4; } //@@ 00728710 ItemConfig_Costume::operator_assign /* DB: copy-assign of the 0x2c-byte ItemConfig_Costume: id +0, anm2Path string +4 (string::assign), priority +0x1c, hasOverlay/isFlying/hasSkinAlt +0x20..0x22, skinColor +0x24, overwriteColor..+0x2a; used by ItemConfig::load_costumes_xml (trinket costume) and ItemPool::CreateGlitchedCollectible */ void ItemConfig_Costume::operator_assign(undefined4 *param_1) { byte *text; undefined4 *in_ECX; *in_ECX = *param_1; text = (byte *)(param_1 + 1); if ((byte *)(in_ECX + 1) != text) { if (0xf < (uint)param_1[6]) { text = *(byte **)text; } std::string::assign((char *)(in_ECX + 1),text,param_1[5]); } in_ECX[7] = param_1[7]; *(undefined1 *)(in_ECX + 8) = *(undefined1 *)(param_1 + 8); *(undefined1 *)((int)in_ECX + 0x21) = *(undefined1 *)((int)param_1 + 0x21); *(undefined1 *)((int)in_ECX + 0x22) = *(undefined1 *)((int)param_1 + 0x22); in_ECX[9] = param_1[9]; *(undefined1 *)(in_ECX + 10) = *(undefined1 *)(param_1 + 10); *(undefined1 *)((int)in_ECX + 0x29) = *(undefined1 *)((int)param_1 + 0x29); *(undefined1 *)((int)in_ECX + 0x2a) = *(undefined1 *)((int)param_1 + 0x2a); return; } //@@ 00728780 ItemConfig::load_metadata_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strings "Could not find root node 'items' in %s", "quality", "craftquality", "trinket", "Collectible ID out of bounds.", "Trinket ID out of bounds."; parses items_metadata-style XML setting item quality/craft quality; Manager::load_configs, ModManager::LoadModContent prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemConfig::load_metadata_xml(ItemConfig *this,byte *path,void *modEntry) { uint uVar1; int *piVar2; byte *text; void *pvVar3; byte *cursor; char *expectedChar; uint idMap; byte *expectedByte; byte *pbVar4; qword *allocCounter; int iVar5; undefined4 *cacheSlot; undefined4 *attr; bool bVar6; ulonglong tags; undefined4 tagsHigh; undefined4 uStack_10088; int craftQuality; int iStack_10080; int itemId; undefined1 doc [48]; undefined1 auStack_10044 [65560]; void *tagsText [4]; undefined4 tagsTextSize; uint tagsTextCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; qword allocatedBytes; byte curChar; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afd128; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(tagsText + 10); ExceptionList = &local_10; idMap = -(uint)(modEntry != (void *)0x0) & (int)modEntry + 0xecU; local_14 = uVar1; piVar2 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (piVar2 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] could not open %s.\n"); curChar = 0; } else { cacheSlot = (undefined4 *)&this->field_0x84; iVar5 = 0x20; do { pvVar3 = (void *)*cacheSlot; if (pvVar3 != (void *)0x0) { FID_conflict__Tidy(pvVar3); operator_delete(pvVar3,0xc); *cacheSlot = 0; } cacheSlot = cacheSlot + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); iVar5 = (**(code **)(*piVar2 + 4))(uVar1); text = operator_new_tracked(iVar5 + 1); (**(code **)(*piVar2 + 0x14))(text,1,iVar5); text[iVar5] = 0; (**(code **)*piVar2)(1); FUN_00413b90(); local_8 = (void *)0x0; iVar5 = 0x72888f; pbVar4 = text; rapidxml::xml_document::parse(doc,text); pvVar3 = xml_node::first_node(doc,&DAT_00b66fc8,iVar5,(byte)pbVar4); if (pvVar3 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Could not find root node \'items\' in %s\n"); } for (cacheSlot = *(undefined4 **)((int)pvVar3 + 0x18); cacheSlot != (undefined4 *)0x0; cacheSlot = (undefined4 *)cacheSlot[0xb]) { attr = (undefined4 *)cacheSlot[8]; uStack_10088 = 0; itemId = 0; iStack_10080 = 0; craftQuality = -0x70000001; if (attr == (undefined4 *)0x0) { tags = 0; tagsHigh = uStack_10088; } else { tags = 0; do { pbVar4 = (byte *)*attr; expectedByte = s_id; cursor = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { cursor = pbVar4; } do { curChar = *cursor; bVar6 = curChar < *expectedByte; if (curChar != *expectedByte) { LAB_00728961: uVar1 = -(uint)bVar6 | 1; goto LAB_00728966; } if (curChar == 0) break; curChar = cursor[1]; bVar6 = curChar < expectedByte[1]; if (curChar != expectedByte[1]) goto LAB_00728961; cursor = cursor + 2; expectedByte = expectedByte + 2; } while (curChar != 0); uVar1 = 0; LAB_00728966: if (uVar1 == 0) { pbVar4 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar4 = (byte *)attr[1]; } itemId = atoi((char *)pbVar4); } else { expectedChar = "quality"; cursor = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { cursor = pbVar4; } do { curChar = *cursor; bVar6 = curChar < (byte)*expectedChar; if (curChar != *expectedChar) { LAB_007289b7: uVar1 = -(uint)bVar6 | 1; goto LAB_007289bc; } if (curChar == 0) break; curChar = cursor[1]; bVar6 = curChar < (byte)expectedChar[1]; if (curChar != expectedChar[1]) goto LAB_007289b7; cursor = cursor + 2; expectedChar = expectedChar + 2; } while (curChar != 0); uVar1 = 0; LAB_007289bc: if (uVar1 == 0) { pbVar4 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar4 = (byte *)attr[1]; } iStack_10080 = atoi((char *)pbVar4); } else { expectedChar = "craftquality"; cursor = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { cursor = pbVar4; } do { curChar = *cursor; bVar6 = curChar < (byte)*expectedChar; if (curChar != *expectedChar) { LAB_00728a10: uVar1 = -(uint)bVar6 | 1; goto LAB_00728a15; } if (curChar == 0) break; curChar = cursor[1]; bVar6 = curChar < (byte)expectedChar[1]; if (curChar != expectedChar[1]) goto LAB_00728a10; cursor = cursor + 2; expectedChar = expectedChar + 2; } while (curChar != 0); uVar1 = 0; LAB_00728a15: if (uVar1 == 0) { pbVar4 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar4 = (byte *)attr[1]; } craftQuality = atoi((char *)pbVar4); } else { expectedByte = &DAT_00b66d44; cursor = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { cursor = pbVar4; } do { curChar = *cursor; bVar6 = curChar < *expectedByte; if (curChar != *expectedByte) { LAB_00728a66: uVar1 = -(uint)bVar6 | 1; goto LAB_00728a6b; } if (curChar == 0) break; curChar = cursor[1]; bVar6 = curChar < expectedByte[1]; if (curChar != expectedByte[1]) goto LAB_00728a66; cursor = cursor + 2; expectedByte = expectedByte + 2; } while (curChar != 0); uVar1 = 0; LAB_00728a6b: if (uVar1 == 0) { tagsTextSize = 0; pbVar4 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar4 = (byte *)attr[1]; } tagsTextCapacity = 0xf; tagsText[0] = (void *)0x0; cursor = pbVar4; do { curChar = *cursor; cursor = cursor + 1; } while (curChar != 0); std::string::assign((char *)tagsText,pbVar4,(int)cursor - (int)(pbVar4 + 1)); local_8._0_1_ = 1; tags = parse_tags(tagsText); local_8 = (void *)((uint)local_8._1_3_ << 8); if (0xf < tagsTextCapacity) { uVar1 = tagsTextCapacity + 1; pvVar3 = tagsText[0]; if (0xfff < uVar1) { pvVar3 = *(void **)((int)tagsText[0] + -4); uVar1 = tagsTextCapacity + 0x24; if (0x1f < (uint)((int)tagsText[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar1); } } } } } tagsHigh = (undefined4)(tags >> 0x20); } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); } pbVar4 = &g_xmlNullStr; if ((byte *)*cacheSlot != (byte *)0x0) { pbVar4 = (byte *)*cacheSlot; } expectedChar = "trinket"; do { curChar = *pbVar4; bVar6 = curChar < (byte)*expectedChar; if (curChar != *expectedChar) { LAB_00728b5f: uVar1 = -(uint)bVar6 | 1; goto LAB_00728b64; } if (curChar == 0) break; curChar = pbVar4[1]; bVar6 = curChar < (byte)expectedChar[1]; if (curChar != expectedChar[1]) goto LAB_00728b5f; pbVar4 = pbVar4 + 2; expectedChar = expectedChar + 2; } while (curChar != 0); uVar1 = 0; LAB_00728b64: if (uVar1 == 0) { if (idMap != 0) { piVar2 = (int *)std::map::operator_index(&itemId); itemId = *piVar2; } if ((int)(this->_trinkets)._end - (int)(this->_trinkets)._begin >> 2 <= itemId) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds.\n"); } pvVar3 = (this->_trinkets)._begin; } else { if (idMap != 0) { piVar2 = (int *)std::map::operator_index(&itemId); itemId = *piVar2; } pvVar3 = (this->_collectibles)._begin; if ((int)(this->_collectibles)._end - (int)pvVar3 >> 2 <= itemId) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds.\n"); pvVar3 = (this->_collectibles)._begin; } } iVar5 = *(int *)((int)pvVar3 + itemId * 4); if (iVar5 != 0) { if (craftQuality == -0x70000001) { craftQuality = iStack_10080; } *(int *)(iVar5 + 0xb8) = (int)tags; *(undefined4 *)(iVar5 + 0xbc) = tagsHigh; *(int *)(iVar5 + 0xc0) = iStack_10080; *(int *)(iVar5 + 0xc4) = craftQuality; } } local_8 = (void *)0x2; xml_memory_pool::clear(auStack_10044); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar1 = *(uint *)(text + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar1; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar1); free(text + -4); } curChar = 1; } ExceptionList = local_10; return curChar; } //@@ 00728cc0 ItemConfig::load_wisp_node /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? wisps.xml entry attrs coreColor/flameColor/tearColor/procChance/damageMultiplier; caller 0072a1b0 ItemConfig::load_wisps_xml likely LoadWispConfig */ void __cdecl ItemConfig::load_wisp_node(void) { float fVar1; float fVar2; void **ppvVar3; byte bVar4; undefined1 isCanShoot; uint uVar5; byte *pbVar6; uint uVar7; int ****ppppiVar8; int parsedInt; uint uVar9; int *piVar10; void *freeBlock; float fVar11; float *colorPreset; byte *in_ECX; byte *shortKeyName; char *keyName; uint flagMaskHigh; std_string *nameLength; byte *pbVar12; int in_EDX; int *piVar13; int ***pppiVar14; int *piVar15; bool isLess; double dVar16; float *in_stack_00000004; undefined4 in_stack_00000008; int *tearFlags2Tokens; int *tearFlags2TokensEnd; int tearFlags2TokensCapacity; int *tearFlagTokens; int *tearFlagTokensEnd; int tearFlagTokensCapacity; byte *gfxRoot; int *local_54; int *local_50; undefined4 colorPresets; int *parsedMask; float *wispEntry; undefined4 *attr; int ****attrText; int ***pppiStack_38; int ***pppiStack_34; int ***pppiStack_30; int ***attrTextSize; int ***attrTextCapacity; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *tokenBuffer; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afd1d7; uVar5 = __security_cookie ^ (int)register0x00000010 - 0x10U; parsedMask = (int *)0x0; local_50 = (int *)0x0; stackCookie = uVar5; ppvVar3 = &local_1c; gfxRoot = in_ECX; local_1c = ExceptionList; colorPresets = in_stack_00000008; wispEntry = in_stack_00000004; for (attr = *(undefined4 **)(in_EDX + 0x20); ExceptionList = ppvVar3, attr != (undefined4 *)0x0; attr = (undefined4 *)attr[6]) { pbVar12 = (byte *)*attr; shortKeyName = &DAT_00b66f08; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < *shortKeyName; if (bVar4 != *shortKeyName) { LAB_00728d57: uVar7 = -(uint)isLess | 1; goto LAB_00728d5c; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < shortKeyName[1]; if (bVar4 != shortKeyName[1]) goto LAB_00728d57; pbVar6 = pbVar6 + 2; shortKeyName = shortKeyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728d5c: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); *in_stack_00000004 = (float)dVar16; } else { keyName = "damage"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00728db0: uVar7 = -(uint)isLess | 1; goto LAB_00728db5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00728db0; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728db5: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[1] = (float)dVar16; } else { keyName = "stageDamage"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00728e10: uVar7 = -(uint)isLess | 1; goto LAB_00728e15; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00728e10; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728e15: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[2] = (float)dVar16; } else { keyName = "shotSpeed"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00728e70: uVar7 = -(uint)isLess | 1; goto LAB_00728e75; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00728e70; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728e75: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[3] = (float)dVar16; } else { keyName = "fireDelay"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00728ed0: uVar7 = -(uint)isLess | 1; goto LAB_00728ed5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00728ed0; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728ed5: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[4] = (float)dVar16; } else { keyName = "procChance"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00728f30: uVar7 = -(uint)isLess | 1; goto LAB_00728f35; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00728f30; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728f35: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[0x2a] = (float)dVar16; } else { keyName = "canShoot"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00728f90: uVar7 = -(uint)isLess | 1; goto LAB_00728f95; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00728f90; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00728f95: if (uVar7 == 0) { attrText = (int ****)0x0; attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12,(int)pbVar6 - (int)(pbVar12 + 1)); if (attrTextSize == (int ***)0x0) { LAB_00729093: isCanShoot = 0; } else { ppppiVar8 = (int ****)&attrText; if ((int ***)0xf < attrTextCapacity) { ppppiVar8 = attrText; } if (attrTextSize == (int ***)0x4) { if ((*ppppiVar8 == (int ***)0x65757274) || ((((bVar4 = (byte)*ppppiVar8, isLess = bVar4 < 0x74, bVar4 == 0x74 && (isLess = *(byte *)((int)ppppiVar8 + 1) < 0x72, *(byte *)((int)ppppiVar8 + 1) == 0x72)) && (isLess = *(byte *)((int)ppppiVar8 + 2) < 0x75, *(byte *)((int)ppppiVar8 + 2) == 0x75)) && (isLess = *(byte *)((int)ppppiVar8 + 3) < 0x65, *(byte *)((int)ppppiVar8 + 3) == 0x65)))) { uVar7 = 0; } else { uVar7 = -(uint)isLess | 1; } if (uVar7 != 0) goto LAB_00729030; } else { LAB_00729030: ppppiVar8 = (int ****)&attrText; if ((int ***)0xf < attrTextCapacity) { ppppiVar8 = attrText; } if (attrTextSize == (int ***)0x4) { if ((*ppppiVar8 == (int ***)0x65757254) || (((bVar4 = (byte)*ppppiVar8, isLess = bVar4 < 0x54, bVar4 == 0x54 && (isLess = *(byte *)((int)ppppiVar8 + 1) < 0x72, *(byte *)((int)ppppiVar8 + 1) == 0x72)) && ((isLess = *(byte *)((int)ppppiVar8 + 2) < 0x75, *(byte *)((int)ppppiVar8 + 2) == 0x75 && (isLess = *(byte *)((int)ppppiVar8 + 3) < 0x65, *(byte *)((int)ppppiVar8 + 3) == 0x65)))))) { uVar7 = 0; } else { uVar7 = -(uint)isLess | 1; } if (uVar7 == 0) goto LAB_0072908f; } ppppiVar8 = (int ****)&attrText; if ((int ***)0xf < attrTextCapacity) { ppppiVar8 = attrText; } parsedInt = atoi((char *)ppppiVar8); if (parsedInt == 0) goto LAB_00729093; } LAB_0072908f: isCanShoot = 1; } *(undefined1 *)(wispEntry + 5) = isCanShoot; if (attrTextCapacity < (int ***)0x10) { in_stack_00000004 = wispEntry; } else { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) { LAB_0072a19f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppiVar8,(uint)pppiVar14); in_stack_00000004 = wispEntry; } } else { keyName = "tearFlags"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729110: uVar7 = -(uint)isLess | 1; goto LAB_00729115; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729110; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729115: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12,(int)pbVar6 - (int)(pbVar12 + 1)); local_14 = 1; local_50 = (int *)((uint)parsedMask | 1); tearFlagTokens = (int *)0x0; tearFlagTokensEnd = (int *)0x0; tearFlagTokensCapacity = 0; parsedMask = local_50; string_split(&tearFlagTokens); local_14 = CONCAT31(local_14._1_3_,2); if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } piVar15 = (int *)0x0; local_54 = tearFlagTokens; local_50 = (int *)(((int)tearFlagTokensEnd - (int)tearFlagTokens) / 0x18); piVar13 = tearFlagTokens; if (local_50 != (int *)0x0) { do { piVar10 = piVar13; if (0xf < (uint)piVar13[5]) { piVar10 = (int *)*piVar13; } uVar7 = atoi((char *)piVar10); if (uVar7 < 0x40) { uVar9 = 1 << (uVar7 & 0x1f); flagMaskHigh = 0; if (0x1f < uVar7) { flagMaskHigh = uVar9; } uVar9 = uVar9 ^ flagMaskHigh; if (0x3f < uVar7) { flagMaskHigh = uVar9; } wispEntry[0x14] = (float)((uint)wispEntry[0x14] | uVar9); wispEntry[0x15] = (float)((uint)wispEntry[0x15] | flagMaskHigh); } else { uVar7 = uVar7 - 0x40; uVar9 = 1 << (uVar7 & 0x1f); flagMaskHigh = 0; if (0x1f < uVar7) { flagMaskHigh = uVar9; } uVar9 = uVar9 ^ flagMaskHigh; if (0x3f < uVar7) { flagMaskHigh = uVar9; } wispEntry[0x16] = (float)((uint)wispEntry[0x16] | uVar9); wispEntry[0x17] = (float)((uint)wispEntry[0x17] | flagMaskHigh); } piVar15 = (int *)((int)piVar15 + 1); piVar13 = piVar13 + 6; } while (piVar15 < local_50); } piVar13 = local_54; parsedMask = (int *)((uint)parsedMask & 0xfffffffe); local_14 = 0xffffffff; if (local_54 == (int *)0x0) goto LAB_0072956a; piVar15 = tearFlagTokensEnd; piVar10 = local_54; if (local_54 != tearFlagTokensEnd) { do { uVar7 = piVar10[5]; if (0xf < uVar7) { tokenBuffer = (void *)*piVar10; uVar9 = uVar7 + 1; freeBlock = tokenBuffer; if (0xfff < uVar9) { freeBlock = *(void **)((int)tokenBuffer + -4); uVar9 = uVar7 + 0x24; if (0x1f < (uint)((int)tokenBuffer + (-4 - (int)freeBlock))) goto LAB_0072a19f; } operator_delete(freeBlock,uVar9); piVar15 = tearFlagTokensEnd; } piVar10[4] = 0; piVar10[5] = 0xf; *(undefined1 *)piVar10 = 0; piVar10 = piVar10 + 6; } while (piVar10 != piVar15); } uVar7 = ((tearFlagTokensCapacity - (int)piVar13) / 0x18) * 0x18; piVar15 = piVar13; if (0xfff < uVar7) { piVar15 = (int *)piVar13[-1]; uVar7 = uVar7 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar13 + (-4 - (int)piVar15))) goto LAB_0072a19f; } operator_delete(piVar15,uVar7); tearFlagTokens = (int *)0x0; tearFlagTokensEnd = (int *)0x0; tearFlagTokensCapacity = 0; in_stack_00000004 = wispEntry; } else { keyName = "tearFlags2"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729355: uVar7 = -(uint)isLess | 1; goto LAB_0072935a; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729355; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_0072935a: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12,(int)pbVar6 - (int)(pbVar12 + 1) ); local_14 = 4; local_50 = (int *)((uint)parsedMask | 2); tearFlags2Tokens = (int *)0x0; tearFlags2TokensEnd = (int *)0x0; tearFlags2TokensCapacity = 0; parsedMask = local_50; string_split(&tearFlags2Tokens); local_14 = CONCAT31(local_14._1_3_,5); if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } piVar15 = (int *)0x0; local_50 = tearFlags2Tokens; local_54 = (int *)(((int)tearFlags2TokensEnd - (int)tearFlags2Tokens) / 0x18); piVar13 = tearFlags2Tokens; if (local_54 != (int *)0x0) { do { piVar10 = piVar13; if (0xf < (uint)piVar13[5]) { piVar10 = (int *)*piVar13; } uVar7 = atoi((char *)piVar10); if (uVar7 < 0x40) { uVar9 = 1 << (uVar7 & 0x1f); flagMaskHigh = 0; if (0x1f < uVar7) { flagMaskHigh = uVar9; } uVar9 = uVar9 ^ flagMaskHigh; if (0x3f < uVar7) { flagMaskHigh = uVar9; } wispEntry[0x26] = (float)((uint)wispEntry[0x26] | uVar9); wispEntry[0x27] = (float)((uint)wispEntry[0x27] | flagMaskHigh); } else { uVar7 = uVar7 - 0x40; uVar9 = 1 << (uVar7 & 0x1f); flagMaskHigh = 0; if (0x1f < uVar7) { flagMaskHigh = uVar9; } uVar9 = uVar9 ^ flagMaskHigh; if (0x3f < uVar7) { flagMaskHigh = uVar9; } wispEntry[0x28] = (float)((uint)wispEntry[0x28] | uVar9); wispEntry[0x29] = (float)((uint)wispEntry[0x29] | flagMaskHigh); } piVar15 = (int *)((int)piVar15 + 1); piVar13 = piVar13 + 6; } while (piVar15 < local_54); } piVar13 = local_50; parsedMask = (int *)((uint)parsedMask & 0xfffffffd); local_14 = 0xffffffff; if (local_50 != (int *)0x0) { piVar15 = tearFlags2TokensEnd; piVar10 = local_50; if (local_50 != tearFlags2TokensEnd) { do { uVar7 = piVar10[5]; if (0xf < uVar7) { tokenBuffer = (void *)*piVar10; uVar9 = uVar7 + 1; freeBlock = tokenBuffer; if (0xfff < uVar9) { freeBlock = *(void **)((int)tokenBuffer + -4); uVar9 = uVar7 + 0x24; if (0x1f < (uint)((int)tokenBuffer + (-4 - (int)freeBlock))) goto LAB_0072a19f; } operator_delete(freeBlock,uVar9); piVar15 = tearFlags2TokensEnd; } piVar10[4] = 0; piVar10[5] = 0xf; *(undefined1 *)piVar10 = 0; piVar10 = piVar10 + 6; } while (piVar10 != piVar15); } uVar7 = ((tearFlags2TokensCapacity - (int)piVar13) / 0x18) * 0x18; piVar15 = piVar13; if (0xfff < uVar7) { piVar15 = (int *)piVar13[-1]; uVar7 = uVar7 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar13 + (-4 - (int)piVar15))) goto LAB_0072a19f; } operator_delete(piVar15,uVar7); tearFlags2Tokens = (int *)0x0; tearFlags2TokensEnd = (int *)0x0; tearFlags2TokensCapacity = 0; } LAB_0072956a: in_stack_00000004 = wispEntry; } else { keyName = "tearVariant"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_007295a1: uVar7 = -(uint)isLess | 1; goto LAB_007295a6; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_007295a1; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_007295a6: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } fVar11 = (float)atoi((char *)pbVar12); in_stack_00000004[8] = fVar11; } else { keyName = "tearVariant2"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729600: uVar7 = -(uint)isLess | 1; goto LAB_00729605; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729600; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729605: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } fVar11 = (float)atoi((char *)pbVar12); in_stack_00000004[0x1a] = fVar11; } else { keyName = "tearScale"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729660: uVar7 = -(uint)isLess | 1; goto LAB_00729665; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729660; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729665: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[7] = (float)dVar16; } else { keyName = "tearScale2"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_007296c0: uVar7 = -(uint)isLess | 1; goto LAB_007296c5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_007296c0; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_007296c5: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[0x19] = (float)dVar16; } else { keyName = "damageMultiplier"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729720: uVar7 = -(uint)isLess | 1; goto LAB_00729725; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729720; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729725: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[6] = (float)dVar16; } else { keyName = "damageMultiplier2"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729780: uVar7 = -(uint)isLess | 1; goto LAB_00729785; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729780; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729785: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } dVar16 = atof((char *)pbVar12); in_stack_00000004[0x18] = (float)dVar16; } else { keyName = "tearColor"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_007297e0: uVar7 = -(uint)isLess | 1; goto LAB_007297e5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_007297e0; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_007297e5: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12, (int)pbVar6 - (int)(pbVar12 + 1)); local_14 = 6; colorPreset = (float *)color_preset_lookup(colorPresets); if (in_stack_00000004 + 9 != colorPreset) { fVar11 = colorPreset[1]; fVar1 = colorPreset[2]; fVar2 = colorPreset[3]; in_stack_00000004[9] = *colorPreset; in_stack_00000004[10] = fVar11; in_stack_00000004[0xb] = fVar1; in_stack_00000004[0xc] = fVar2; fVar11 = colorPreset[5]; fVar1 = colorPreset[6]; fVar2 = colorPreset[7]; in_stack_00000004[0xd] = colorPreset[4]; in_stack_00000004[0xe] = fVar11; in_stack_00000004[0xf] = fVar1; in_stack_00000004[0x10] = fVar2; fVar11 = colorPreset[9]; in_stack_00000004[0x11] = colorPreset[8]; in_stack_00000004[0x12] = fVar11; in_stack_00000004[0x13] = colorPreset[10]; } local_14 = 0xffffffff; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { keyName = "tearColor2"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_007298e6: uVar7 = -(uint)isLess | 1; goto LAB_007298eb; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_007298e6; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_007298eb: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12, (int)pbVar6 - (int)(pbVar12 + 1)); local_14 = 7; colorPreset = (float *)color_preset_lookup(colorPresets); if (in_stack_00000004 + 0x1b != colorPreset) { fVar11 = colorPreset[1]; fVar1 = colorPreset[2]; fVar2 = colorPreset[3]; in_stack_00000004[0x1b] = *colorPreset; in_stack_00000004[0x1c] = fVar11; in_stack_00000004[0x1d] = fVar1; in_stack_00000004[0x1e] = fVar2; fVar11 = colorPreset[5]; fVar1 = colorPreset[6]; fVar2 = colorPreset[7]; in_stack_00000004[0x1f] = colorPreset[4]; in_stack_00000004[0x20] = fVar11; in_stack_00000004[0x21] = fVar1; in_stack_00000004[0x22] = fVar2; fVar11 = colorPreset[9]; in_stack_00000004[0x23] = colorPreset[8]; in_stack_00000004[0x24] = fVar11; in_stack_00000004[0x25] = colorPreset[10]; } local_14 = 0xffffffff; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { keyName = "flameColor"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_007299e7: uVar7 = -(uint)isLess | 1; goto LAB_007299ec; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_007299e7; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_007299ec: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12, (int)pbVar6 - (int)(pbVar12 + 1)); local_14 = 8; colorPreset = (float *)color_preset_lookup(colorPresets); if (in_stack_00000004 + 0x2b != colorPreset) { fVar11 = colorPreset[1]; fVar1 = colorPreset[2]; fVar2 = colorPreset[3]; in_stack_00000004[0x2b] = *colorPreset; in_stack_00000004[0x2c] = fVar11; in_stack_00000004[0x2d] = fVar1; in_stack_00000004[0x2e] = fVar2; fVar11 = colorPreset[5]; fVar1 = colorPreset[6]; fVar2 = colorPreset[7]; in_stack_00000004[0x2f] = colorPreset[4]; in_stack_00000004[0x30] = fVar11; in_stack_00000004[0x31] = fVar1; in_stack_00000004[0x32] = fVar2; fVar11 = colorPreset[9]; in_stack_00000004[0x33] = colorPreset[8]; in_stack_00000004[0x34] = fVar11; in_stack_00000004[0x35] = colorPreset[10]; } local_14 = 0xffffffff; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8)) ) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { keyName = "coreColor"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729af0: uVar7 = -(uint)isLess | 1; goto LAB_00729af5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729af0; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729af5: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12, (int)pbVar6 - (int)(pbVar12 + 1)); local_14 = 9; colorPreset = (float *)color_preset_lookup(colorPresets); if (in_stack_00000004 + 0x36 != colorPreset) { fVar11 = colorPreset[1]; fVar1 = colorPreset[2]; fVar2 = colorPreset[3]; in_stack_00000004[0x36] = *colorPreset; in_stack_00000004[0x37] = fVar11; in_stack_00000004[0x38] = fVar1; in_stack_00000004[0x39] = fVar2; fVar11 = colorPreset[5]; fVar1 = colorPreset[6]; fVar2 = colorPreset[7]; in_stack_00000004[0x3a] = colorPreset[4]; in_stack_00000004[0x3b] = fVar11; in_stack_00000004[0x3c] = fVar1; in_stack_00000004[0x3d] = fVar2; fVar11 = colorPreset[9]; in_stack_00000004[0x3e] = colorPreset[8]; in_stack_00000004[0x3f] = fVar11; in_stack_00000004[0x40] = colorPreset[10]; } local_14 = 0xffffffff; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { shortKeyName = &DAT_00b69b6c; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < *shortKeyName; if (bVar4 != *shortKeyName) { LAB_00729c00: uVar7 = -(uint)isLess | 1; goto LAB_00729c05; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < shortKeyName[1]; if (bVar4 != shortKeyName[1]) goto LAB_00729c00; pbVar6 = pbVar6 + 2; shortKeyName = shortKeyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729c05: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); nameLength = (std_string *) (pbVar6 + -(int)(pbVar12 + 1)); if ((std_string *) (0x7fffffff - *(uint *)(gfxRoot + 0x10)) < nameLength) { LAB_0072a1a5: /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar5); } pbVar6 = gfxRoot; if (0xf < *(uint *)(gfxRoot + 0x14)) { pbVar6 = *(byte **)gfxRoot; } std::string::concat((char *)&attrText,(int)local_54, nameLength,pbVar6, *(uint *)(gfxRoot + 0x10),pbVar12, (uint)nameLength); in_stack_00000004 = wispEntry; parsedMask = (int *)((uint)parsedMask | 4); ppppiVar8 = (int ****)(wispEntry + 0x57); if ((int *****)ppppiVar8 == &attrText) { if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { LAB_00729c71: in_stack_00000004 = wispEntry; std::string::_Tidy_deallocate((char *)ppppiVar8); *ppppiVar8 = (int ***)attrText; ppppiVar8[1] = pppiStack_38; ppppiVar8[2] = pppiStack_34; ppppiVar8[3] = pppiStack_30; ppppiVar8[4] = attrTextSize; ppppiVar8[5] = attrTextCapacity; } } else { shortKeyName = &DAT_00b69b64; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < *shortKeyName; if (bVar4 != *shortKeyName) { LAB_00729d00: uVar7 = -(uint)isLess | 1; goto LAB_00729d05; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < shortKeyName[1]; if (bVar4 != shortKeyName[1]) goto LAB_00729d00; shortKeyName = shortKeyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729d05: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); nameLength = (std_string *) (pbVar6 + -(int)(pbVar12 + 1)); if ((std_string *) (0x7fffffff - *(uint *)(gfxRoot + 0x10)) < nameLength) goto LAB_0072a1a5; pbVar6 = gfxRoot; if (0xf < *(uint *)(gfxRoot + 0x14)) { pbVar6 = *(byte **)gfxRoot; } std::string::concat((char *)&attrText,(int)local_54, nameLength,pbVar6, *(uint *)(gfxRoot + 0x10),pbVar12, (uint)nameLength); in_stack_00000004 = wispEntry; parsedMask = (int *)((uint)parsedMask | 8); ppppiVar8 = (int ****)(wispEntry + 0x5d); if ((int *****)ppppiVar8 != &attrText) goto LAB_00729c71; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { keyName = "bloodColor"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729de1: uVar7 = -(uint)isLess | 1; goto LAB_00729de6; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729de1; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729de6: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12, (int)pbVar6 - (int)(pbVar12 + 1) ); local_14 = 10; colorPreset = (float *)color_preset_lookup( colorPresets); if (in_stack_00000004 + 0x4c != colorPreset) { fVar11 = colorPreset[1]; fVar1 = colorPreset[2]; fVar2 = colorPreset[3]; in_stack_00000004[0x4c] = *colorPreset; in_stack_00000004[0x4d] = fVar11; in_stack_00000004[0x4e] = fVar1; in_stack_00000004[0x4f] = fVar2; fVar11 = colorPreset[5]; fVar1 = colorPreset[6]; fVar2 = colorPreset[7]; in_stack_00000004[0x50] = colorPreset[4]; in_stack_00000004[0x51] = fVar11; in_stack_00000004[0x52] = fVar1; in_stack_00000004[0x53] = fVar2; fVar11 = colorPreset[9]; in_stack_00000004[0x54] = colorPreset[8]; in_stack_00000004[0x55] = fVar11; in_stack_00000004[0x56] = colorPreset[10]; } local_14 = 0xffffffff; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1); ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { keyName = "poofColor"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_00729ef0: uVar7 = -(uint)isLess | 1; goto LAB_00729ef5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_00729ef0; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00729ef5: if (uVar7 == 0) { attrTextSize = (int ***)0x0; attrTextCapacity = (int ***)0xf; attrText = (int ****)0x0; pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } pbVar6 = pbVar12; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)&attrText,pbVar12, (int)pbVar6 - (int)(pbVar12 + 1)); local_14 = 0xb; colorPreset = (float *)color_preset_lookup( colorPresets); if (in_stack_00000004 + 0x41 != colorPreset) { fVar11 = colorPreset[1]; fVar1 = colorPreset[2]; fVar2 = colorPreset[3]; in_stack_00000004[0x41] = *colorPreset; in_stack_00000004[0x42] = fVar11; in_stack_00000004[0x43] = fVar1; in_stack_00000004[0x44] = fVar2; fVar11 = colorPreset[5]; fVar1 = colorPreset[6]; fVar2 = colorPreset[7]; in_stack_00000004[0x45] = colorPreset[4]; in_stack_00000004[0x46] = fVar11; in_stack_00000004[0x47] = fVar1; in_stack_00000004[0x48] = fVar2; fVar11 = colorPreset[9]; in_stack_00000004[0x49] = colorPreset[8]; in_stack_00000004[0x4a] = fVar11; in_stack_00000004[0x4b] = colorPreset[10]; } local_14 = 0xffffffff; if ((int ***)0xf < attrTextCapacity) { pppiVar14 = (int ***)((int)attrTextCapacity + 1) ; ppppiVar8 = attrText; if ((int ***)0xfff < pppiVar14) { ppppiVar8 = (int ****)attrText[-1]; pppiVar14 = attrTextCapacity + 9; if (0x1f < (uint)((int)attrText + (-4 - (int)ppppiVar8))) goto LAB_0072a19f; } operator_delete(ppppiVar8,(uint)pppiVar14); } } else { keyName = "layer"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_0072a000: uVar7 = -(uint)isLess | 1; goto LAB_0072a005; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_0072a000; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_0072a005: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } parsedInt = atoi((char *)pbVar12); *(short *)(in_stack_00000004 + 99) = (short)parsedInt; } else { keyName = "priority"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_0072a060: uVar7 = -(uint)isLess | 1; goto LAB_0072a065; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_0072a060; pbVar6 = pbVar6 + 2; keyName = keyName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_0072a065: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } parsedInt = atoi((char *)pbVar12); *(short *)((int)in_stack_00000004 + 0x18e) = (short)parsedInt; } else { keyName = "count"; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar4 = *pbVar6; isLess = bVar4 < (byte)*keyName; if (bVar4 != *keyName) { LAB_0072a0c0: uVar7 = -(uint)isLess | 1; goto LAB_0072a0c5; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; isLess = bVar4 < (byte)keyName[1]; if (bVar4 != keyName[1]) goto LAB_0072a0c0; keyName = keyName + 2; pbVar6 = pbVar6 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_0072a0c5: if (uVar7 == 0) { pbVar12 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar12 = (byte *)attr[1]; } parsedInt = atoi((char *)pbVar12); *(short *)(in_stack_00000004 + 100) = (short)parsedInt; } } } } } } } } } } } } } } } } } } } } } } } } } } if (attr[4] == 0) break; ppvVar3 = ExceptionList; } if (in_stack_00000004[0x18] <= 0.0 && in_stack_00000004[0x18] != 0.0) { in_stack_00000004[0x18] = in_stack_00000004[6]; } if (in_stack_00000004[0x19] <= 0.0 && in_stack_00000004[0x19] != 0.0) { in_stack_00000004[0x19] = in_stack_00000004[7]; } if ((int)in_stack_00000004[0x1a] < 0) { in_stack_00000004[0x1a] = in_stack_00000004[8]; } if (in_stack_00000004[0x1e] <= 0.0 && in_stack_00000004[0x1e] != 0.0) { if (in_stack_00000004 + 0x1b != in_stack_00000004 + 9) { in_stack_00000004[0x1b] = in_stack_00000004[9]; in_stack_00000004[0x1c] = in_stack_00000004[10]; in_stack_00000004[0x1d] = in_stack_00000004[0xb]; in_stack_00000004[0x1e] = in_stack_00000004[0xc]; in_stack_00000004[0x1f] = in_stack_00000004[0xd]; in_stack_00000004[0x20] = in_stack_00000004[0xe]; in_stack_00000004[0x21] = in_stack_00000004[0xf]; in_stack_00000004[0x22] = in_stack_00000004[0x10]; *(undefined8 *)(in_stack_00000004 + 0x23) = *(undefined8 *)(in_stack_00000004 + 0x11); in_stack_00000004[0x25] = in_stack_00000004[0x13]; } } if ((in_stack_00000004[0x26] == 0.0 && in_stack_00000004[0x27] == 0.0) && (in_stack_00000004[0x28] == 0.0 && in_stack_00000004[0x29] == 0.0)) { in_stack_00000004[0x26] = in_stack_00000004[0x14]; in_stack_00000004[0x27] = in_stack_00000004[0x15]; in_stack_00000004[0x28] = in_stack_00000004[0x16]; in_stack_00000004[0x29] = in_stack_00000004[0x17]; } ExceptionList = local_1c; return; } //@@ 0072a1b0 ItemConfig::load_wisps_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: wisps.xml: "Could not find root node wisps", color attribute, "Collectible ID out of bounds"; same loader group as costumes2/pocketitems prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemConfig::load_wisps_xml(ItemConfig *this,byte *path,void *modEntry) { byte bVar1; uint uVar2; int iVar3; void *pvVar4; void *gfxRootAttr; byte *attrNameChar; int *wispSlot; byte *pbVar5; char *colorTagChar; byte *expectedAttrChar; qword *allocatedBytes; undefined4 *attr; code *atoiFn; bool bVar6; double dVar7; char *pcVar8; byte *attrNameChar; byte abStack_10160 [8]; float fStack_10158; float fStack_10154; float fStack_10150; float fStack_1014c; float fStack_10148; float fStack_10144; float fStack_10140; float fStack_1013c; void *wispAlloc; uint modIdMap; ItemConfig *savedThis; void *colorMapHead; undefined4 colorMapSize; byte *fileBuffer; void *collectibleId; int *piStack_10118; int *piStack_10114; undefined1 xmlDoc [48]; undefined1 auStack_100e0 [65560]; char colorNameCopy [24]; ColorMod colorCopy; byte *colorName [4]; int colorNameSize; uint colorNameCapacity; float local_68; float fStack_64; float fStack_60; float fStack_5c; float local_58; float fStack_54; float fStack_50; float fStack_4c; float local_48; float fStack_44; float local_40; void *gfxRoot [4]; undefined4 gfxRootSize; uint gfxRootCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; void **idText; void **idValue; ItemConfig *itemConfig; qword prevAllocatedBytes; puStack_20 = (undefined1 *)(gfxRoot + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00afd25b; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(gfxRoot + 0xb); ExceptionList = &local_1c; modIdMap = -(uint)(modEntry != (void *)0x0) & (int)modEntry + 0xecU; savedThis = this; local_24 = uVar2; piStack_10118 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (piStack_10118 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] could not open %s.\n"); bVar1 = 0; } else { iVar3 = (**(code **)(*piStack_10118 + 4))(uVar2); fileBuffer = operator_new_tracked(iVar3 + 1); (**(code **)(*piStack_10118 + 0x14))(fileBuffer,1,iVar3); fileBuffer[iVar3] = 0; (**(code **)*piStack_10118)(1); FUN_00413b90(); local_14 = (void *)0x0; pcVar8 = (char *)0x72a2af; attrNameChar = fileBuffer; rapidxml::xml_document::parse(xmlDoc,fileBuffer); bVar1 = (byte)attrNameChar; pvVar4 = xml_node::first_node(xmlDoc,(byte *)"wisps",(int)pcVar8,bVar1); if (pvVar4 == (void *)0x0) { pcVar8 = "Could not find root node \'wisps\' in %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'wisps\' in %s\n"); bVar1 = (byte)path; } gfxRootAttr = xml_node::first_attribute(pvVar4,&DAT_00b6987c,(uint)pcVar8,bVar1); attrNameChar = &g_xmlNullStr; if (*(byte **)((int)gfxRootAttr + 4) != (byte *)0x0) { attrNameChar = *(byte **)((int)gfxRootAttr + 4); } gfxRootSize = 0; gfxRootCapacity = 0xf; gfxRoot[0] = (void *)0x0; pbVar5 = attrNameChar; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)gfxRoot,attrNameChar,(int)pbVar5 - (int)(attrNameChar + 1)); local_14._0_1_ = 1; pcVar8 = (char *)0x54; colorMapHead = (void *)0x0; colorMapSize = 0; attrNameChar = (byte *)0x72a344; colorMapHead = operator_new(0x54); *(void **)colorMapHead = colorMapHead; *(void **)((int)colorMapHead + 4) = colorMapHead; *(void **)((int)colorMapHead + 8) = colorMapHead; *(undefined2 *)((int)colorMapHead + 0xc) = 0x101; local_14._0_1_ = 2; piStack_10118 = *(int **)((int)pvVar4 + 0x18); if (piStack_10118 != (undefined4 *)0x0) { atoiFn = atoi_exref; do { pbVar5 = (byte *)*piStack_10118; colorTagChar = "color"; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < (byte)*colorTagChar; if (bVar1 != *colorTagChar) { LAB_0072a3a7: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a3ac; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < (byte)colorTagChar[1]; if (bVar1 != colorTagChar[1]) goto LAB_0072a3a7; attrNameChar = attrNameChar + 2; colorTagChar = colorTagChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a3ac: if (uVar2 == 0) { fStack_10148 = 1.0; fStack_10144 = 1.0; fStack_10140 = 1.0; fStack_1013c = 1.0; colorNameSize = 0; local_68 = 1.0; fStack_64 = 1.0; fStack_60 = 1.0; fStack_5c = 1.0; colorNameCapacity = 0xf; fStack_10158 = 0.0; fStack_10154 = 0.0; fStack_10150 = 0.0; fStack_1014c = 0.0; colorName[0] = (byte *)0x0; local_58 = 0.0; fStack_54 = 0.0; fStack_50 = 0.0; fStack_4c = 0.0; local_14._0_1_ = 3; attr = (undefined4 *)piStack_10118[8]; local_48 = 0.0; fStack_44 = local_48; local_40 = local_48; if (attr != (undefined4 *)0x0) { do { pbVar5 = (byte *)*attr; expectedAttrChar = s_name; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a436: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a43b; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a436; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a43b: if (uVar2 == 0) { attrNameChar = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { attrNameChar = (byte *)attr[1]; } pbVar5 = attrNameChar; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); pcVar8 = (char *)(pbVar5 + -(int)(attrNameChar + 1)); std::string::assign((char *)colorName,attrNameChar,(uint)pcVar8); } else { expectedAttrChar = &DAT_00b6617c; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a498: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a49d; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a498; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a49d: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a4b5; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; local_68 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b66178; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a500: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a505; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a500; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a505: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a51d; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_64 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69bc4; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a566: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a56b; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a566; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a56b: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a583; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_60 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b656e8; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a5d0: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a5d5; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a5d0; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a5d5: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a5ed; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_5c = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69bc0; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a636: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a63b; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a636; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a63b: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a653; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; local_58 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69bcc; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a6a0: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a6a5; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a6a0; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a6a5: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a6bd; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_54 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69bc8; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a706: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a70b; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a706; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a70b: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a723; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_50 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69c40; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a770: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a775; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a770; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a775: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a78d; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_4c = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69c3c; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a7d6: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a7db; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a7d6; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a7db: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a7f3; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; local_48 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69c48; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a840: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a845; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a840; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a845: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a85d; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; fStack_44 = (float)piStack_10114 / 255.0; } else { expectedAttrChar = &DAT_00b69c44; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a8a3: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a8a8; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a8a3; attrNameChar = attrNameChar + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a8a8: if (uVar2 == 0) { pcVar8 = (char *)&g_xmlNullStr; if ((void **)attr[1] != (void **)0x0) { pcVar8 = (char *)attr[1]; } attrNameChar = (byte *)0x72a8c0; dVar7 = atof(pcVar8); piStack_10114 = (int *)(float)dVar7; local_40 = (float)piStack_10114 / 255.0; } } } } } } } } } } } } } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); } fStack_10158 = local_58; fStack_10154 = fStack_54; fStack_10150 = fStack_50; fStack_1014c = fStack_4c; fStack_10148 = local_68; fStack_10144 = fStack_64; fStack_10140 = fStack_60; fStack_1013c = fStack_5c; if (colorNameSize != 0) { std::string::string(colorNameCopy,colorName); colorCopy._offset[2] = local_40; colorCopy._tint[0] = fStack_10148; colorCopy._tint[1] = fStack_10144; colorCopy._tint[2] = fStack_10140; colorCopy._tint[3] = fStack_1013c; colorCopy._colorize[0] = fStack_10158; colorCopy._colorize[1] = fStack_10154; colorCopy._colorize[2] = fStack_10150; colorCopy._colorize[3] = fStack_1014c; colorCopy._offset[0] = local_48; colorCopy._offset[1] = fStack_44; local_14._0_1_ = 4; attrNameChar = abStack_10160; FUN_00731d70(attrNameChar,colorNameCopy); pcVar8 = (char *)0x72a96c; std::string::_Tidy_deallocate(colorNameCopy); } local_14._0_1_ = 2; if (0xf < colorNameCapacity) { pcVar8 = (char *)(colorNameCapacity + 1); attrNameChar = colorName[0]; if ((void **)0xfff < pcVar8) { attrNameChar = *(byte **)(colorName[0] + -4); pcVar8 = (char *)(colorNameCapacity + 0x24); if ((byte *)0x1f < colorName[0] + (-4 - (int)attrNameChar)) goto LAB_0072ac13; } operator_delete(attrNameChar,(uint)pcVar8); } LAB_0072aba5: atoiFn = atoi_exref; } else { expectedAttrChar = &DAT_00b69c1c; attrNameChar = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { attrNameChar = pbVar5; } do { bVar1 = *attrNameChar; bVar6 = bVar1 < *expectedAttrChar; if (bVar1 != *expectedAttrChar) { LAB_0072a9e0: uVar2 = -(uint)bVar6 | 1; goto LAB_0072a9e5; } if (bVar1 == 0) break; bVar1 = attrNameChar[1]; bVar6 = bVar1 < expectedAttrChar[1]; if (bVar1 != expectedAttrChar[1]) goto LAB_0072a9e0; expectedAttrChar = expectedAttrChar + 2; attrNameChar = attrNameChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072a9e5: if ((uVar2 == 0) && (pvVar4 = xml_node::first_attribute(piStack_10118,s_id,(uint)attrNameChar,(byte)pcVar8), pvVar4 != (void *)0x0)) { idValue = *(void ***)((int)pvVar4 + 4); idText = (void **)&g_xmlNullStr; if (idValue != (void **)0x0) { idText = idValue; } if (*(byte *)idText == 0x73) { idText = (void **)&g_xmlNullStr; if (idValue != (void **)0x0) { idText = idValue; } collectibleId = (void *)(*atoiFn)((byte *)((int)idText + 1)); itemConfig = savedThis; pvVar4 = *(void **)((int)savedThis[1]._collectibles._capacity + (int)collectibleId * 4 ); if (pvVar4 != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)pvVar4 + 0x174)); std::string::_Tidy_deallocate((char *)((int)pvVar4 + 0x15c)); operator_delete(pvVar4,0x198); *(undefined4 *)((int)itemConfig[1]._collectibles._capacity + (int)collectibleId * 4) = 0; } wispSlot = (int *)((int)itemConfig[1]._collectibles._capacity + (int)collectibleId * 4 ); } else { pcVar8 = (char *)&g_xmlNullStr; if (idValue != (void **)0x0) { pcVar8 = (char *)idValue; } attrNameChar = (byte *)0x72aa99; collectibleId = (void *)(*atoiFn)(); if (modIdMap != 0) { pcVar8 = (char *)&collectibleId; attrNameChar = (byte *)0x72aabc; wispSlot = (int *)std::map::operator_index(pcVar8); collectibleId = (void *)*wispSlot; } itemConfig = savedThis; pvVar4 = (savedThis->_collectibles)._begin; if ((int)(savedThis->_collectibles)._end - (int)pvVar4 >> 2 <= (int)collectibleId) { pcVar8 = "Collectible ID out of bounds.\n"; attrNameChar = (byte *)0x10; KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds.\n"); pvVar4 = (itemConfig->_collectibles)._begin; } iVar3 = *(int *)((int)pvVar4 + (int)collectibleId * 4); if (iVar3 == 0) goto LAB_0072aba5; pvVar4 = *(void **)(iVar3 + 0xcc); piStack_10114 = (int *)(iVar3 + 0xcc); if (pvVar4 != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)pvVar4 + 0x174)); std::string::_Tidy_deallocate((char *)((int)pvVar4 + 0x15c)); operator_delete(pvVar4,0x198); *piStack_10114 = 0; } *(uint *)(iVar3 + 0xb8) = *(uint *)(iVar3 + 0xb8) | 0x4000000; *(undefined4 *)(iVar3 + 0xbc) = *(undefined4 *)(iVar3 + 0xbc); wispSlot = piStack_10114; } wispAlloc = operator_new(0x198); local_14._0_1_ = 5; if (wispAlloc == (void *)0x0) { pbVar5 = (byte *)0x0; } else { pbVar5 = (byte *)WispEntry::constructor(); } pcVar8 = (char *)&colorMapHead; local_14._0_1_ = 2; attrNameChar = pbVar5; load_wisp_node(); *wispSlot = (int)pbVar5; goto LAB_0072aba5; } } piStack_10118 = (int *)piStack_10118[0xb]; } while (piStack_10118 != (undefined4 *)0x0); } FUN_00731820(&colorMapHead,*(undefined4 *)((int)colorMapHead + 4)); operator_delete(colorMapHead,0x54); local_14._0_1_ = 0; if (0xf < gfxRootCapacity) { uVar2 = gfxRootCapacity + 1; pvVar4 = gfxRoot[0]; if (0xfff < uVar2) { pvVar4 = *(void **)((int)gfxRoot[0] + -4); uVar2 = gfxRootCapacity + 0x24; if (0x1f < (uint)((int)gfxRoot[0] + (-4 - (int)pvVar4))) { LAB_0072ac13: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } gfxRootSize = 0; gfxRootCapacity = 0xf; gfxRoot[0] = (void *)((uint)gfxRoot[0] & 0xffffff00); local_14 = (void *)0x6; xml_memory_pool::clear(auStack_100e0); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (fileBuffer != (byte *)0x0) { uVar2 = *(uint *)(fileBuffer + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar2; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar2); free(fileBuffer + -4); } bVar1 = 1; } ExceptionList = local_1c; return bVar1; } //@@ 0072aca0 FUN_0072aca0 int FUN_0072aca0(int param_1,int param_2) { char *pcVar1; uint uVar2; char cVar3; int iVar4; uint uVar5; byte *pbVar6; byte *pbVar7; int iVar8; int *piVar9; undefined4 uVar10; int *in_ECX; int iVar11; char *in_EDX; byte *pbVar12; uint uVar13; pbVar12 = &g_xmlNullStr; if ((byte *)*in_ECX != (byte *)0x0) { pbVar12 = (byte *)*in_ECX; } pbVar6 = (byte *)strstr((char *)pbVar12,in_EDX); pbVar12 = (byte *)*in_ECX; pbVar7 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar7 = pbVar12; } if (pbVar6 != pbVar7) { return 0; } pcVar1 = in_EDX + 1; do { cVar3 = *in_EDX; in_EDX = in_EDX + 1; } while (cVar3 != '\0'); pbVar7 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar7 = pbVar12; } iVar8 = atoi((char *)(pbVar7 + ((int)in_EDX - (int)pcVar1))); if ((iVar8 == 0) && (iVar8 = param_2, param_2 == 0)) { return param_1; } uVar13 = iVar8 - 2; piVar9 = (int *)(param_1 + 0x68); iVar4 = *(int *)(param_1 + 0x6c); iVar11 = *piVar9; uVar5 = (iVar4 - iVar11) / 0x68; if (uVar5 <= uVar13) { uVar2 = iVar8 - 1; if (uVar2 < uVar5) { FUN_00731bf0(iVar4 - iVar11); *(uint *)(param_1 + 0x6c) = uVar2 * 0x68 + iVar11; return uVar13 * 0x68 + *piVar9; } if (uVar5 < uVar2) { iVar11 = *(int *)(param_1 + 0x70) - iVar11; if ((uint)(iVar11 / 0x68) < uVar2) { FUN_007322f0(uVar2,iVar11); return uVar13 * 0x68 + *piVar9; } uVar10 = FUN_00731d10(iVar4,uVar2 - uVar5,iVar4); *(undefined4 *)(param_1 + 0x6c) = uVar10; } } return uVar13 * 0x68 + *piVar9; } //@@ 0072add0 locust_attr_parse_tear_flags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from ItemConfig::load_locust ("tearFlags"): ECX=xml attribute (+4 value), splits by ' ' and ORs each atoi bit index into a 128-bit BitSet at param_1 offset (indices >= 64 go to the upper half) */ undefined4 locust_attr_parse_tear_flags(int param_1,undefined4 param_2) { uint *puVar1; byte bVar2; int iVar3; undefined4 uVar4; char *_Str; uint uVar5; void *ptr; int in_ECX; byte *pbVar6; void *pvVar7; uint uVar8; byte *text; uint uVar9; int iVar10; int *piVar11; int *local_44; int *local_40; int local_3c; uint local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afd29d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; iVar3 = FUN_0072aca0(param_2,0,local_14); if (iVar3 == 0) { uVar4 = 0; } else { local_1c = 0; text = &g_xmlNullStr; if (*(byte **)(in_ECX + 4) != (byte *)0x0) { text = *(byte **)(in_ECX + 4); } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar6 = text; do { bVar2 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar2 != 0); std::string::assign((char *)local_2c,text,(int)pbVar6 - (int)(text + 1)); local_8 = (void *)0x0; string_split(0x20); if (0xf < local_18) { uVar9 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar9) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar9 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_0072aff0; } operator_delete(pvVar7,uVar9); } local_30 = 0; if (((int)local_40 - (int)local_44) / 0x18 != 0) { iVar10 = 0; do { _Str = (char *)(iVar10 + (int)local_44); if (0xf < *(uint *)(iVar10 + 0x14 + (int)local_44)) { _Str = *(char **)_Str; } uVar9 = atoi(_Str); if (uVar9 < 0x40) { uVar5 = 1 << (uVar9 & 0x1f); uVar8 = 0; if (0x1f < uVar9) { uVar8 = uVar5; } uVar5 = uVar5 ^ uVar8; if (0x3f < uVar9) { uVar8 = uVar5; } *(uint *)(param_1 + iVar3) = *(uint *)(param_1 + iVar3) | uVar5; puVar1 = (uint *)(param_1 + 4 + iVar3); *puVar1 = *puVar1 | uVar8; } else { uVar9 = uVar9 - 0x40; uVar5 = 1 << (uVar9 & 0x1f); uVar8 = 0; if (0x1f < uVar9) { uVar8 = uVar5; } uVar5 = uVar5 ^ uVar8; if (0x3f < uVar9) { uVar8 = uVar5; } puVar1 = (uint *)(param_1 + 8 + iVar3); *puVar1 = *puVar1 | uVar5; puVar1 = (uint *)(param_1 + 0xc + iVar3); *puVar1 = *puVar1 | uVar8; } local_30 = local_30 + 1; iVar10 = iVar10 + 0x18; } while (local_30 < (uint)(((int)local_40 - (int)local_44) / 0x18)); } piVar11 = local_44; if (local_44 != (int *)0x0) { for (; piVar11 != local_40; piVar11 = piVar11 + 6) { uVar9 = piVar11[5]; if (0xf < uVar9) { pvVar7 = (void *)*piVar11; uVar5 = uVar9 + 1; ptr = pvVar7; if (0xfff < uVar5) { ptr = *(void **)((int)pvVar7 + -4); uVar5 = uVar9 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)ptr))) goto LAB_0072aff0; } operator_delete(ptr,uVar5); } piVar11[4] = 0; piVar11[5] = 0xf; *(undefined1 *)piVar11 = 0; } uVar9 = ((local_3c - (int)local_44) / 0x18) * 0x18; piVar11 = local_44; if (0xfff < uVar9) { piVar11 = (int *)local_44[-1]; uVar9 = uVar9 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_44 + (-4 - (int)piVar11))) { LAB_0072aff0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar11,uVar9); } uVar4 = 1; } ExceptionList = local_10; return uVar4; } //@@ 0072b020 locust_attr_parse_flags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? sibling of 0072add0 locust_attr_parse_tear_flags ItemConfig::load_locust (offsets 0x18/0x1c): splits the attribute value by ' ' and ORs 1<> 2; iVar3 = iVar3 + 0x68; } while (iVar3 != *(int *)((int)locustEntry + 0x6c)); } return; } //@@ 0072ba80 ItemConfig::LoadLocustConfig /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: locusts.xml parse ("Could not find root node locusts", locust/id/color/scale/quality), params (char* xmlpath, int mod) match zhl ItemConfig::LoadLocustConfig(char*,ModEntry*); this=ItemConfig; callers Console::RunCommand reload, mod content load prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ItemConfig::LoadLocustConfig(ItemConfig *this,byte *xmlpath,ModEntry *modentry) { uint *puVar1; qword qVar2; uint *puVar3; uint uVar4; int iVar5; byte *pbVar6; void *pvVar7; undefined4 *puVar8; void *pvVar9; byte *pbVar10; undefined4 extraout_ECX; uint uVar11; byte *pbVar12; qword *heapAllocatedBytes; uint *puVar13; bool bVar14; double dVar15; char *pcVar16; byte bVar17; undefined1 auStack_10200 [8]; float fStack_101f8; float fStack_101f4; float fStack_101f0; float fStack_101ec; float fStack_101e8; float fStack_101e4; float fStack_101e0; float fStack_101dc; uint modIdMap; std_map *locustConfigs; uint cleanupFlags; ItemConfig *itemConfig; uint uStack_101c4; byte *xmlBuffer; int *piStack_101bc; undefined4 *puStack_101b8; byte *pbStack_101b4; undefined1 xmlDoc [48]; undefined1 xmlPool [65560]; char colorNameCopy [24]; float local_150; float fStack_14c; float fStack_148; float fStack_144; float local_140; float fStack_13c; float fStack_138; float fStack_134; float local_130; float fStack_12c; float local_128; undefined4 local_120; char local_100 [24]; char local_e8 [24]; char local_d0 [24]; uint *local_b8; uint *local_b4; int local_b0; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; void *local_9c; undefined4 local_8c; uint local_88; void *local_84; undefined4 local_74; uint local_70; void *colorName [4]; int colorNameSize; uint colorNameCapacity; float tintR; float tintG; float tintB; float tintA; float colorizeR; float colorizeG; float colorizeB; float colorizeA; float offsetR; float offsetG; float offsetB; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; ItemConfig *config; puStack_20 = (undefined1 *)(colorName + 0x19); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00afd2fe; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(colorName + 0x16); ExceptionList = &local_1c; cleanupFlags = 0; modIdMap = -(uint)(modentry != (ModEntry *)0x0) & (uint)&modentry->field_0xec; itemConfig = this; local_24 = uVar4; std::string::assign((this->_wispGfxRoot)._buf,&s_empty,0); *(undefined4 *)&this->field_0x68 = 0x3f800000; *(undefined4 *)&this->field_0x6c = 0x3f800000; *(undefined4 *)&this->field_0x70 = 0x3f800000; *(undefined4 *)&this->field_0x74 = 0x3f800000; *(undefined4 *)&this->field_0x78 = 0x3f800000; piStack_101bc = FileSystem::Open(&PTR_vftable_00c37a10,xmlpath,(int *)0x0); if (piStack_101bc == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] could not open %s.\n"); } else { iVar5 = (**(code **)(*piStack_101bc + 4))(uVar4); xmlBuffer = operator_new_tracked(iVar5 + 1); (**(code **)(*piStack_101bc + 0x14))(xmlBuffer,1,iVar5); xmlBuffer[iVar5] = 0; (**(code **)*piStack_101bc)(1); FUN_00413b90(); local_14 = (void *)0x0; pcVar16 = (char *)0x72bbbd; pbVar6 = xmlBuffer; rapidxml::xml_document::parse(xmlDoc,xmlBuffer); bVar17 = (byte)pbVar6; pbVar6 = xml_node::first_node(xmlDoc,(byte *)"locusts",(int)pcVar16,bVar17); pbStack_101b4 = pbVar6; if (pbVar6 == (byte *)0x0) { pcVar16 = "Could not find root node \'locusts\' in %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'locusts\' in %s\n"); bVar17 = (byte)xmlpath; } pvVar7 = xml_node::first_attribute(pbVar6,&DAT_00b6987c,(uint)pcVar16,bVar17); config = itemConfig; pbVar6 = &g_xmlNullStr; if (*(byte **)((int)pvVar7 + 4) != (byte *)0x0) { pbVar6 = *(byte **)((int)pvVar7 + 4); } pbVar12 = pbVar6; do { bVar17 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar17 != 0); std::string::assign((itemConfig->_wispGfxRoot)._buf,pbVar6,(int)pbVar12 - (int)(pbVar6 + 1)); locustConfigs = &config->_locustConfigs; pvVar7 = locustConfigs->_head; FUN_00731820(locustConfigs,*(undefined4 *)((int)pvVar7 + 4)); *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; (config->_locustConfigs)._size = 0; puStack_101b8 = *(undefined4 **)(pbStack_101b4 + 0x18); if (puStack_101b8 != (undefined4 *)0x0) { LAB_0072bc65: pbVar6 = (byte *)*puStack_101b8; pcVar16 = "color"; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < (byte)*pcVar16; if (bVar17 != *pcVar16) { LAB_0072bc96: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bc9b; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < (byte)pcVar16[1]; if (bVar17 != pcVar16[1]) goto LAB_0072bc96; pbVar12 = pbVar12 + 2; pcVar16 = pcVar16 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bc9b: if (uVar4 == 0) { fStack_101e8 = 1.0; fStack_101e4 = 1.0; fStack_101e0 = 1.0; fStack_101dc = 1.0; colorNameSize = 0; tintR = 1.0; tintG = 1.0; tintB = 1.0; tintA = 1.0; colorNameCapacity = 0xf; fStack_101f8 = 0.0; fStack_101f4 = 0.0; fStack_101f0 = 0.0; fStack_101ec = 0.0; colorName[0] = (void *)0x0; colorizeR = 0.0; colorizeG = 0.0; colorizeB = 0.0; colorizeA = 0.0; local_14._0_1_ = 1; puVar8 = (undefined4 *)puStack_101b8[8]; offsetR = 0.0; offsetG = offsetR; offsetB = offsetR; if (puVar8 != (undefined4 *)0x0) { do { pbVar6 = (byte *)*puVar8; pbVar10 = s_name; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bd25: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bd2a; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bd25; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bd2a: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } pbVar12 = pbVar6; do { bVar17 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar17 != 0); std::string::assign((char *)colorName,pbVar6,(int)pbVar12 - (int)(pbVar6 + 1)); } else { pbVar10 = &DAT_00b6617c; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bd87: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bd8c; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bd87; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bd8c: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; tintR = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b66178; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bdf0: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bdf5; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bdf0; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bdf5: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; tintG = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69bc4; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072be56: uVar4 = -(uint)bVar14 | 1; goto LAB_0072be5b; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072be56; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072be5b: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; tintB = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b656e8; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bec0: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bec5; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bec0; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bec5: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; tintA = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69bc0; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bf26: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bf2b; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bf26; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bf2b: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; colorizeR = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69bcc; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bf90: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bf95; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bf90; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bf95: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; colorizeG = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69bc8; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072bff6: uVar4 = -(uint)bVar14 | 1; goto LAB_0072bffb; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072bff6; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072bffb: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; colorizeB = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69c40; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072c060: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c065; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072c060; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c065: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; colorizeA = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69c3c; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072c0c6: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c0cb; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072c0c6; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c0cb: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; offsetR = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69c48; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072c130: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c135; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072c130; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c135: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; offsetG = (float)pbStack_101b4 / 255.0; } else { pbVar10 = &DAT_00b69c44; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < *pbVar10; if (bVar17 != *pbVar10) { LAB_0072c193: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c198; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < pbVar10[1]; if (bVar17 != pbVar10[1]) goto LAB_0072c193; pbVar12 = pbVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c198: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbStack_101b4 = (byte *)(float)dVar15; offsetB = (float)pbStack_101b4 / 255.0; } } } } } } } } } } } } } while ((puVar8[4] != 0) && (puVar8 = (undefined4 *)puVar8[6], puVar8 != (undefined4 *)0x0)); } fStack_101f8 = colorizeR; fStack_101f4 = colorizeG; fStack_101f0 = colorizeB; fStack_101ec = colorizeA; fStack_101e8 = tintR; fStack_101e4 = tintG; fStack_101e0 = tintB; fStack_101dc = tintA; if (colorNameSize != 0) { std::string::string(colorNameCopy,colorName); cleanupFlags = cleanupFlags | 1; local_150 = fStack_101e8; fStack_14c = fStack_101e4; fStack_148 = fStack_101e0; fStack_144 = fStack_101dc; local_128 = offsetB; local_140 = fStack_101f8; fStack_13c = fStack_101f4; fStack_138 = fStack_101f0; fStack_134 = fStack_101ec; local_130 = offsetR; fStack_12c = offsetG; local_14._0_1_ = 2; FUN_00731d70(auStack_10200,colorNameCopy); std::string::_Tidy_deallocate(colorNameCopy); } local_14 = (void *)((uint)local_14._1_3_ << 8); if (0xf < colorNameCapacity) { uVar4 = colorNameCapacity + 1; pvVar7 = colorName[0]; if (0xfff < uVar4) { pvVar7 = *(void **)((int)colorName[0] + -4); uVar4 = colorNameCapacity + 0x24; if (0x1f < (uint)((int)colorName[0] + (-4 - (int)pvVar7))) goto LAB_0072c899; } operator_delete(pvVar7,uVar4); } } else { pcVar16 = "scale"; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < (byte)*pcVar16; if (bVar17 != *pcVar16) { LAB_0072c2e0: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c2e5; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < (byte)pcVar16[1]; if (bVar17 != pcVar16[1]) goto LAB_0072c2e0; pbVar12 = pbVar12 + 2; pcVar16 = pcVar16 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c2e5: if (uVar4 == 0) { pbVar6 = (byte *)0x3f800000; puVar8 = (undefined4 *)puStack_101b8[8]; uStack_101c4 = 0xffffffff; pbStack_101b4 = (byte *)0x3f800000; if (puVar8 != (undefined4 *)0x0) { do { pbVar12 = (byte *)*puVar8; pcVar16 = "quality"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar17 = *pbVar10; bVar14 = bVar17 < (byte)*pcVar16; if (bVar17 != *pcVar16) { LAB_0072c343: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c348; } if (bVar17 == 0) break; bVar17 = pbVar10[1]; bVar14 = bVar17 < (byte)pcVar16[1]; if (bVar17 != pcVar16[1]) goto LAB_0072c343; pbVar10 = pbVar10 + 2; pcVar16 = pcVar16 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c348: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } uStack_101c4 = atoi((char *)pbVar6); pbVar6 = pbStack_101b4; } else { pcVar16 = "scale"; pbVar10 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar10 = pbVar12; } do { bVar17 = *pbVar10; bVar14 = bVar17 < (byte)*pcVar16; if (bVar17 != *pcVar16) { LAB_0072c3a7: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c3ac; } if (bVar17 == 0) break; bVar17 = pbVar10[1]; bVar14 = bVar17 < (byte)pcVar16[1]; if (bVar17 != pcVar16[1]) goto LAB_0072c3a7; pbVar10 = pbVar10 + 2; pcVar16 = pcVar16 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c3ac: if (uVar4 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } dVar15 = atof((char *)pbVar6); pbVar6 = (byte *)(float)dVar15; pbStack_101b4 = pbVar6; } } } while ((puVar8[4] != 0) && (puVar8 = (undefined4 *)puVar8[6], puVar8 != (undefined4 *)0x0)); if (uStack_101c4 < 5) { *(byte **)((int)(&itemConfig->_wispGfxRoot + 1) + uStack_101c4 * 4) = pbVar6; } } } else { pcVar16 = "locust"; pbVar12 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar12 = pbVar6; } do { bVar17 = *pbVar12; bVar14 = bVar17 < (byte)*pcVar16; if (bVar17 != *pcVar16) { LAB_0072c443: uVar4 = -(uint)bVar14 | 1; goto LAB_0072c448; } if (bVar17 == 0) break; bVar17 = pbVar12[1]; bVar14 = bVar17 < (byte)pcVar16[1]; if (bVar17 != pcVar16[1]) goto LAB_0072c443; pbVar12 = pbVar12 + 2; pcVar16 = pcVar16 + 2; } while (bVar17 != 0); uVar4 = 0; LAB_0072c448: if (uVar4 == 0) { pbVar6 = s_id; do { pbStack_101b4 = pbVar6; pbVar6 = pbStack_101b4 + 1; } while (*pbVar6 != 0); pbStack_101b4 = pbStack_101b4 + -0xb1bfef; for (puVar8 = (undefined4 *)puStack_101b8[8]; puVar8 != (undefined4 *)0x0; puVar8 = (undefined4 *)puVar8[6]) { pbVar6 = (byte *)*puVar8; if (pbVar6 == (byte *)0x0) { pbVar12 = (byte *)0x0; pbVar6 = &g_xmlNullStr; } else { pbVar12 = (byte *)puVar8[2]; } if (pbVar12 == pbStack_101b4) { pbVar12 = pbVar12 + (int)pbVar6; if (pbVar12 <= pbVar6) { LAB_0072c4b0: pbVar6 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar6 = (byte *)puVar8[1]; } piStack_101bc = (int *)atoi((char *)pbVar6); if (modIdMap != 0) { puVar8 = (undefined4 *)std::map::operator_index(&piStack_101bc); piStack_101bc = (int *)*puVar8; } config = itemConfig; pvVar7 = (itemConfig->_collectibles)._begin; if ((int)(itemConfig->_collectibles)._end - (int)pvVar7 >> 2 <= (int)piStack_101bc ) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds.\n"); pvVar7 = (config->_collectibles)._begin; } iVar5 = *(int *)((int)pvVar7 + (int)piStack_101bc * 4); if (iVar5 != 0) { pbStack_101b4 = (byte *)(iVar5 + 0xd0); FUN_00722740(); local_b8 = (uint *)0x0; local_b4 = (uint *)0x0; local_b0 = 0; local_ac = 0x3f800000; local_a8 = 0x3f800000; local_a4 = 7; local_a0 = 1; local_8c = 0; local_88 = 0xf; local_9c = (void *)0x0; local_74 = 0; local_70 = 0xf; local_84 = (void *)0x0; local_120 = 0x3f800000; local_14 = (void *)CONCAT31(local_14._1_3_,3); if (*(int *)(iVar5 + 0xd4) == *(int *)(iVar5 + 0xd8)) { std::vector<184byte>::_Emplace_reallocate(*(int *)(iVar5 + 0xd4),extraout_ECX) ; } else { FUN_00731870(); *(int *)(iVar5 + 0xd4) = *(int *)(iVar5 + 0xd4) + 0xb8; } local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_70) { uVar4 = local_70 + 1; pvVar7 = local_84; if (0xfff < uVar4) { pvVar7 = *(void **)((int)local_84 + -4); uVar4 = local_70 + 0x24; if (0x1f < (uint)((int)local_84 + (-4 - (int)pvVar7))) goto LAB_0072c899; } operator_delete(pvVar7,uVar4); } local_74 = 0; local_70 = 0xf; local_84 = (void *)((uint)local_84 & 0xffffff00); if (0xf < local_88) { uVar4 = local_88 + 1; pvVar7 = local_9c; if (0xfff < uVar4) { pvVar7 = *(void **)((int)local_9c + -4); uVar4 = local_88 + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar7))) goto LAB_0072c899; } operator_delete(pvVar7,uVar4); } puVar3 = local_b8; local_8c = 0; local_88 = 0xf; local_9c = (void *)((uint)local_9c & 0xffffff00); if (local_b8 == (uint *)0x0) goto LAB_0072c804; if (local_b8 == local_b4) goto LAB_0072c7a2; puVar13 = local_b8 + 0x19; goto LAB_0072c6c0; } break; } iVar5 = (int)s_id - (int)pbVar6; while (*pbVar6 == pbVar6[iVar5]) { pbVar6 = pbVar6 + 1; if (pbVar12 <= pbVar6) goto LAB_0072c4b0; } } } } } } goto LAB_0072c867; } LAB_0072c878: local_14 = (void *)0x4; xml_memory_pool::clear(xmlPool); if (g_mainHeap == (void *)0x0) { heapAllocatedBytes = &g_allocatedBytesNoHeap; } else { heapAllocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (xmlBuffer != (byte *)0x0) { uVar4 = *(uint *)(xmlBuffer + -4); qVar2 = *heapAllocatedBytes; *(uint *)heapAllocatedBytes = (uint)*heapAllocatedBytes - uVar4; *(uint *)((int)heapAllocatedBytes + 4) = *(uint *)((int)heapAllocatedBytes + 4) - (uint)((uint)qVar2 < uVar4); free(xmlBuffer + -4); } } ExceptionList = local_1c; return; while( true ) { puVar13[-1] = 0; *puVar13 = 0xf; *(undefined1 *)(puVar13 + -5) = 0; uVar4 = puVar13[-6]; if (0xf < uVar4) { pvVar7 = (void *)puVar13[-0xb]; uVar11 = uVar4 + 1; pvVar9 = pvVar7; if (0xfff < uVar11) { pvVar9 = *(void **)((int)pvVar7 - 4); uVar11 = uVar4 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar9))) goto LAB_0072c899; } operator_delete(pvVar9,uVar11); } puVar13[-7] = 0; puVar13[-6] = 0xf; *(undefined1 *)(puVar13 + -0xb) = 0; uVar4 = puVar13[-0xc]; if (0xf < uVar4) { pvVar7 = (void *)puVar13[-0x11]; uVar11 = uVar4 + 1; pvVar9 = pvVar7; if (0xfff < uVar11) { pvVar9 = *(void **)((int)pvVar7 - 4); uVar11 = uVar4 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar9))) goto LAB_0072c899; } operator_delete(pvVar9,uVar11); } puVar13[-0xd] = 0; puVar13[-0xc] = 0xf; *(undefined1 *)(puVar13 + -0x11) = 0; puVar1 = puVar13 + 1; puVar13 = puVar13 + 0x1a; if (puVar1 == local_b4) break; LAB_0072c6c0: uVar4 = *puVar13; if (0xf < uVar4) { pvVar7 = (void *)puVar13[-5]; uVar11 = uVar4 + 1; pvVar9 = pvVar7; if (0xfff < uVar11) { pvVar9 = *(void **)((int)pvVar7 - 4); uVar11 = uVar4 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar9))) goto LAB_0072c899; } operator_delete(pvVar9,uVar11); } } LAB_0072c7a2: uVar4 = ((local_b0 - (int)puVar3) / 0x68) * 0x68; puVar13 = puVar3; if (0xfff < uVar4) { puVar13 = (uint *)puVar3[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)puVar3 + (-4 - (int)puVar13))) { LAB_0072c899: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar13,uVar4); local_b8 = (uint *)0x0; local_b4 = (uint *)0x0; local_b0 = 0; LAB_0072c804: std::string::_Tidy_deallocate(local_d0); std::string::_Tidy_deallocate(local_e8); std::string::_Tidy_deallocate(local_100); load_locust(puStack_101b8, (void *)(((*(int *)(pbStack_101b4 + 4) - *(int *)pbStack_101b4) / 0xb8) * 0xb8 + -0xb8 + *(int *)pbStack_101b4)); LAB_0072c867: puStack_101b8 = (undefined4 *)puStack_101b8[0xb]; if (puStack_101b8 == (undefined4 *)0x0) goto LAB_0072c878; goto LAB_0072bc65; } //@@ 0072c8f0 FUN_0072c8f0 void FUN_0072c8f0(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x9c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x84)); FUN_007311e0(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x50)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); return; } //@@ 0072c930 FUN_0072c930 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined8 FUN_0072c930(byte *param_1) { uint uVar1; uint uVar2; undefined8 uVar3; undefined1 auStack_68 [7]; byte local_61; uint local_60; uint local_5c; int local_58; int local_54; undefined8 local_50; int local_44; byte local_40 [44]; uint local_14; local_14 = __security_cookie ^ (uint)auStack_68; local_40[0] = 0; local_40[1] = 0; local_40[2] = 0; local_40[3] = 0; local_40[4] = 0; local_40[5] = 0; local_40[6] = 0; local_40[7] = 0; local_40[8] = 0; local_40[9] = 0; local_40[10] = 0; local_40[0xb] = 0; local_40[0xc] = 0; local_40[0xd] = 0; local_40[0xe] = 0; local_40[0xf] = 0; local_40[0x10] = 0; local_40[0x11] = 0; local_40[0x12] = 0; local_40[0x13] = 0; local_40[0x14] = 0; local_40[0x15] = 0; local_40[0x16] = 0; local_40[0x17] = 0; local_40[0x18] = 0; local_40[0x19] = 0; local_40[0x1a] = 0; local_40[0x1b] = 0; local_40[0x1c] = 0; local_40[0x1d] = 0; local_40[0x1e] = 0; local_40[*param_1] = local_40[*param_1] + 1; local_50 = 0; local_40[param_1[1]] = local_40[param_1[1]] + 1; local_54 = 0x1f; local_40[param_1[2]] = local_40[param_1[2]] + 1; local_40[param_1[3]] = local_40[param_1[3]] + 1; local_40[param_1[4]] = local_40[param_1[4]] + 1; local_40[param_1[5]] = local_40[param_1[5]] + 1; local_40[param_1[6]] = local_40[param_1[6]] + 1; local_50._4_4_ = 0; local_5c = 0; local_40[param_1[7]] = local_40[param_1[7]] + 1; local_58 = 0; local_60 = 0; uVar1 = local_50._4_4_; do { local_61 = local_40[local_58]; if (local_61 != 0) { uVar2 = (uint)local_61; local_50 = CONCAT44(local_50._4_4_,local_58 >> 0x1f); local_44 = local_58; do { uVar3 = __allshl(); local_60 = local_60 | (uint)uVar3; uVar1 = local_5c | (uint)((ulonglong)uVar3 >> 0x20); uVar2 = uVar2 - 1; local_5c = uVar1; } while (uVar2 != 0); } local_58 = local_58 + 1; local_54 = local_54 + -1; } while (local_54 != 0); return CONCAT44(uVar1,local_60); } //@@ 0072ca50 ItemConfig::load_recipes_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? static (no ECX use): opens arg1 path, rapidxml root "recipes", per "recipe" reads "input" (8-char crafting string decoded through a 31-symbol table), "output"/"outputName" (outputName resolved through a name->id map only when arg2 ModEntry* is set) and "pool"; called by Manager::load_configs (arg2 0) and ModManager::LoadModContent; neighbour of ItemConfig::load_pocketitems_xml 0072cff0 prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemConfig::load_recipes_xml(ItemConfig *this,byte *path,void *modEntry) { byte bVar1; uint uVar2; int *piVar3; int iVar4; char *pcVar5; int cmpResult; uint symbolIndex; byte *pbVar6; byte *pbVar7; byte ****ppppbVar8; undefined1 *inputCursor; qword *allocCounter; void *mapNode; code *atoiFn; undefined4 uVar9; bool isLess; undefined8 inputKey; undefined1 auStack_100b8 [8]; undefined1 auStack_100b0 [8]; void *pvStack_100a8; undefined8 recipeEntry; int iStack_1009c; undefined4 uStack_10098; byte *fileBuffer; undefined4 *recipeNode; undefined4 *outputAttr; undefined4 *outputNameAttr; ItemConfig *pIStack_10084; undefined4 *poolAttr; undefined1 xmlDoc [48]; undefined1 auStack_1004c [65560]; byte ****local_34 [4]; uint outputNameSize; uint outputNameCapacity; undefined8 local_1c; uint stackCookie; void *local_10; undefined1 *puStack_c; byte ***local_8; qword allocatedBytes; char *attrNameEnd; undefined4 *inputAttr; char inputChar; byte ****outputNameBuf; local_8 = (byte ***)0xffffffff; puStack_c = &LAB_00afd340; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_34 + 0xc); ExceptionList = &local_10; if (DAT_00c7f080 == 0) { symbolIndex = 0; do { (&DAT_00c7f080)[(byte)(&DAT_00b69600)[symbolIndex]] = symbolIndex; symbolIndex = symbolIndex + 1; } while (symbolIndex < 0x1f); DAT_00c7f080 = 0xff; } pIStack_10084 = this; stackCookie = uVar2; piVar3 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (piVar3 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] could not open %s.\n"); bVar1 = 0; } else { iVar4 = (**(code **)(*piVar3 + 4))(uVar2); fileBuffer = operator_new_tracked(iVar4 + 1); (**(code **)(*piVar3 + 0x14))(fileBuffer,1,iVar4); fileBuffer[iVar4] = 0; (**(code **)*piVar3)(1); FUN_00413b90(); pbVar6 = fileBuffer; local_8 = (byte ***)0x0; iVar4 = 0x72cb54; pbVar7 = fileBuffer; rapidxml::xml_document::parse(xmlDoc,fileBuffer); mapNode = xml_node::first_node(xmlDoc,(byte *)"recipes",iVar4,(byte)pbVar7); if (mapNode == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Could not find root node \'recipes\' in %s\n"); } recipeNode = *(undefined4 **)((int)mapNode + 0x18); if (recipeNode != (undefined4 *)0x0) { do { atoiFn = atoi_exref; pbVar6 = &g_xmlNullStr; if ((byte *)*recipeNode != (byte *)0x0) { pbVar6 = (byte *)*recipeNode; } pcVar5 = "recipe"; do { bVar1 = *pbVar6; isLess = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_0072cbc1: uVar2 = -(uint)isLess | 1; goto LAB_0072cbc6; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; isLess = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_0072cbc1; pbVar6 = pbVar6 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072cbc6: if (uVar2 == 0) { pcVar5 = "input"; do { attrNameEnd = pcVar5; pcVar5 = attrNameEnd + 1; } while (*pcVar5 != '\0'); poolAttr = (undefined4 *)recipeNode[8]; local_1c = CONCAT44(poolAttr,(undefined4)local_1c); inputAttr = poolAttr; while (inputAttr != (undefined4 *)0x0) { pbVar6 = (byte *)*inputAttr; if (pbVar6 == (byte *)0x0) { pcVar5 = (char *)0x0; pbVar6 = &g_xmlNullStr; } else { pcVar5 = (char *)inputAttr[2]; } if (pcVar5 == attrNameEnd + -0xb69d73) { pbVar7 = pbVar6 + (int)pcVar5; if (pbVar7 <= pbVar6) goto LAB_0072cc4b; iVar4 = (int)"input" - (int)pbVar6; while (*pbVar6 == pbVar6[iVar4]) { pbVar6 = pbVar6 + 1; if (pbVar7 <= pbVar6) goto LAB_0072cc4b; } } inputAttr = (undefined4 *)inputAttr[6]; local_1c = CONCAT44(inputAttr,(undefined4)local_1c); } local_1c = local_1c & 0xffffffff; LAB_0072cc4b: pcVar5 = "output"; do { attrNameEnd = pcVar5; pcVar5 = attrNameEnd + 1; } while (*pcVar5 != '\0'); for (outputAttr = poolAttr; outputAttr != (undefined4 *)0x0; outputAttr = (undefined4 *)outputAttr[6]) { pbVar6 = (byte *)*outputAttr; if (pbVar6 == (byte *)0x0) { pcVar5 = (char *)0x0; pbVar6 = &g_xmlNullStr; } else { pcVar5 = (char *)outputAttr[2]; } if (pcVar5 == attrNameEnd + -0xb69d23) { pbVar7 = (byte *)(pcVar5 + (int)pbVar6); if (pbVar7 <= pbVar6) goto LAB_0072ccc1; iVar4 = (int)"output" - (int)pbVar6; while (*pbVar6 == pbVar6[iVar4]) { pbVar6 = pbVar6 + 1; if (pbVar7 <= pbVar6) goto LAB_0072ccc1; } } } outputAttr = (undefined4 *)0x0; LAB_0072ccc1: pcVar5 = "outputName"; do { attrNameEnd = pcVar5; pcVar5 = attrNameEnd + 1; } while (*pcVar5 != '\0'); for (outputNameAttr = poolAttr; outputNameAttr != (undefined4 *)0x0; outputNameAttr = (undefined4 *)outputNameAttr[6]) { pbVar6 = (byte *)*outputNameAttr; if (pbVar6 == (byte *)0x0) { pcVar5 = (char *)0x0; pbVar6 = &g_xmlNullStr; } else { pcVar5 = (char *)outputNameAttr[2]; } if (pcVar5 == attrNameEnd + -0xb69d17) { pbVar7 = (byte *)(pcVar5 + (int)pbVar6); if (pbVar7 <= pbVar6) goto LAB_0072cd35; iVar4 = (int)"outputName" - (int)pbVar6; while (*pbVar6 == pbVar6[iVar4]) { pbVar6 = pbVar6 + 1; if (pbVar7 <= pbVar6) goto LAB_0072cd35; } } } outputNameAttr = (undefined4 *)0x0; LAB_0072cd35: pcVar5 = "pool"; do { attrNameEnd = pcVar5; pcVar5 = attrNameEnd + 1; } while (*pcVar5 != '\0'); for (; poolAttr != (undefined4 *)0x0; poolAttr = (undefined4 *)poolAttr[6]) { pbVar6 = (byte *)*poolAttr; if (pbVar6 == (byte *)0x0) { pcVar5 = (char *)0x0; pbVar6 = &g_xmlNullStr; } else { pcVar5 = (char *)poolAttr[2]; } if (pcVar5 == attrNameEnd + -0xb69d37) { pbVar7 = (byte *)(pcVar5 + (int)pbVar6); if (pbVar7 <= pbVar6) goto LAB_0072cd9f; iVar4 = (int)&DAT_00b69d38 - (int)pbVar6; while (*pbVar6 == pbVar6[iVar4]) { pbVar6 = pbVar6 + 1; if (pbVar7 <= pbVar6) goto LAB_0072cd9f; } } } poolAttr = (undefined4 *)0x0; LAB_0072cd9f: if (local_1c._4_4_ != 0) { piVar3 = (int *)(local_1c._4_4_ + 4); local_1c = 0; pbVar6 = &g_xmlNullStr; if ((byte *)*piVar3 != (byte *)0x0) { pbVar6 = (byte *)*piVar3; } uVar2 = 0; do { inputCursor = (undefined1 *)((int)&local_1c + uVar2); inputChar = inputCursor[(int)pbVar6 - (int)&local_1c]; if (inputChar == '\0') break; uVar2 = uVar2 + 1; *inputCursor = (char)(&DAT_00c7f080)[inputChar]; } while (uVar2 < 8); iVar4 = 0; if ((outputNameAttr == (undefined4 *)0x0) || ((-(uint)(modEntry != (void *)0x0) & (int)modEntry + 0xecU) == 0)) { if (outputAttr == (undefined4 *)0x0) goto LAB_0072cecc; pbVar6 = &g_xmlNullStr; if ((byte *)outputAttr[1] != (byte *)0x0) { pbVar6 = (byte *)outputAttr[1]; } iVar4 = atoi((char *)pbVar6); } else { local_34[0] = (byte ****)0x0; pbVar6 = &g_xmlNullStr; if ((byte *)outputNameAttr[1] != (byte *)0x0) { pbVar6 = (byte *)outputNameAttr[1]; } outputNameSize = 0; outputNameCapacity = 0xf; pbVar7 = pbVar6; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)local_34,pbVar6,(int)pbVar7 - (int)(pbVar6 + 1)); std::map::_Find_lower_bound(auStack_100b0,local_34); outputNameBuf = local_34[0]; mapNode = pvStack_100a8; if (*(char *)((int)pvStack_100a8 + 0xd) == '\0') { pbVar6 = (byte *)((int)pvStack_100a8 + 0x10); if (0xf < *(uint *)((int)pvStack_100a8 + 0x24)) { pbVar6 = *(byte **)pbVar6; } ppppbVar8 = (byte ****)local_34; if (0xf < outputNameCapacity) { ppppbVar8 = local_34[0]; } cmpResult = string_compare((byte *)ppppbVar8,outputNameSize,pbVar6, *(uint *)((int)pvStack_100a8 + 0x20)); if (cmpResult < 0) goto LAB_0072ce82; } else { LAB_0072ce82: mapNode = (pIStack_10084->_collectibleNameMap)._head; } if (0xf < outputNameCapacity) { uVar2 = outputNameCapacity + 1; ppppbVar8 = outputNameBuf; if (0xfff < uVar2) { ppppbVar8 = (byte ****)outputNameBuf[-1]; uVar2 = outputNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)outputNameBuf + (-4 - (int)ppppbVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar8,uVar2); } if (mapNode != (pIStack_10084->_collectibleNameMap)._head) { iVar4 = *(int *)((int)mapNode + 0x28); } LAB_0072cecc: atoiFn = atoi_exref; } uVar9 = 0; if (poolAttr != (undefined4 *)0x0) { pbVar6 = &g_xmlNullStr; if ((byte *)poolAttr[1] != (byte *)0x0) { pbVar6 = (byte *)poolAttr[1]; } uVar9 = (*atoiFn)(pbVar6); } if (iVar4 != 0) { inputKey = FUN_0072c930(&local_1c); iStack_1009c = iVar4; uStack_10098 = uVar9; recipeEntry = inputKey; FUN_00731da0(auStack_100b8,&recipeEntry); } } } recipeNode = (undefined4 *)recipeNode[0xb]; } while (recipeNode != (undefined4 *)0x0); recipeNode = (undefined4 *)0x0; pbVar6 = fileBuffer; } local_8 = (byte ***)0x1; xml_memory_pool::clear(auStack_1004c); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (pbVar6 != (byte *)0x0) { uVar2 = *(uint *)(pbVar6 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free(pbVar6 + -4); } bVar1 = 1; } ExceptionList = local_10; return bVar1; } //@@ 0072cff0 ItemConfig::load_pocketitems_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: pocketitems.xml: root pocketitems, nodes tarot/tarot_reverse/pilleffect, "Card ID %d out of range", mimiccharge/announcer attributes prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemConfig::load_pocketitems_xml(ItemConfig *this,byte *path,void *modEntry) { void **ppvVar1; uint uVar2; byte ******ppppppbVar3; byte bVar4; uint uVar5; int *piVar6; int iVar7; byte *text; void *pvVar8; byte *****pppppbVar9; byte ******ppppppbVar10; byte *****ptr; undefined4 extraout_ECX; byte *strEnd; byte *pbVar11; byte *****pppppbVar12; byte ******ppppppbVar13; byte *****pppppbVar14; byte ******ppppppbVar15; uint uVar16; code *atoiFn; byte ****newCapacity; bool bVar17; char *pcVar18; byte *****announcerDelay; byte *****mimicCharge; byte *****pickupSubtype; undefined1 classModifier; byte *****pppppbStack_100fc; ItemConfig *itemConfig; byte *****entryId; byte ******ppppppbStack_100f0; byte ******ppppppbStack_100ec; byte ******ppppppbStack_100e8; byte *****cardType; byte ******ppppppbStack_100e0; byte *****pppppbStack_100dc; byte classLevel; byte isGreedMode; undefined1 document [48]; undefined1 auStack_100a4 [65560]; byte ******hudText [4]; byte *****hudSize; uint hudCapacity; byte ******nodeName [4]; uint nodeNameSize; uint nodeNameCapacity; byte ******descriptionText [4]; byte *****descriptionSize; uint descriptionCapacity; byte ******nameText [4]; byte ******nameSize; uint nameCapacity; byte ******attrText [4]; uint attrSize; uint attrCapacity; uint local_14; void *local_10; undefined1 *puStack_c; byte *****local_8; byte ****grownCapacity; undefined4 *vectorEnd; local_8 = (byte *****)0xffffffff; puStack_c = &LAB_00afd3ab; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(attrText + 10); ExceptionList = &local_10; itemConfig = this; local_14 = uVar5; if (modEntry == (void *)0x0) { uVar16 = 0; pvVar8 = (this->_cards)._begin; if ((int)(this->_cards)._end - (int)pvVar8 >> 2 != 0) { do { pvVar8 = *(void **)(uVar16 * 4 + (int)pvVar8); if (pvVar8 != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)pvVar8 + 0x38)); std::string::_Tidy_deallocate((char *)((int)pvVar8 + 0x20)); std::string::_Tidy_deallocate((char *)((int)pvVar8 + 8)); operator_delete(pvVar8,0x70); } iVar7 = uVar16 * 4; uVar16 = uVar16 + 1; *(undefined4 *)((int)(this->_cards)._begin + iVar7) = 0; pvVar8 = (this->_cards)._begin; } while (uVar16 < (uint)((int)(this->_cards)._end - (int)pvVar8 >> 2)); } uVar16 = 0; pvVar8 = (this->_pillEffects)._begin; if ((int)(this->_pillEffects)._end - (int)pvVar8 >> 2 != 0) { do { pvVar8 = *(void **)(uVar16 * 4 + (int)pvVar8); if (pvVar8 != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)pvVar8 + 0x20)); std::string::_Tidy_deallocate((char *)((int)pvVar8 + 8)); operator_delete(pvVar8,0x54); } iVar7 = uVar16 * 4; uVar16 = uVar16 + 1; *(undefined4 *)((int)(this->_pillEffects)._begin + iVar7) = 0; pvVar8 = (this->_pillEffects)._begin; } while (uVar16 < (uint)((int)(this->_pillEffects)._end - (int)pvVar8 >> 2)); } FUN_00731070(pvVar8); FUN_00731000(extraout_ECX); } piVar6 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (piVar6 == (int *)0x0) { bVar4 = 0; } else { iVar7 = (**(code **)(*piVar6 + 4))(uVar5); text = operator_new_tracked(iVar7 + 1); (**(code **)(*piVar6 + 0x14))(text,1,iVar7); text[iVar7] = 0; (**(code **)*piVar6)(1); FUN_00413b90(); local_8._0_1_ = 0; local_8._1_3_ = 0; iVar7 = 0x72d19c; pbVar11 = text; rapidxml::xml_document::parse(document,text); pvVar8 = xml_node::first_node(document,(byte *)"pocketitems",iVar7,(byte)pbVar11); if (pvVar8 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Could not find root node \'pocketitems\' in %s\n"); } piVar6 = *(int **)((int)pvVar8 + 0x18); LAB_0072d1c8: atoiFn = atoi_exref; if (piVar6 != (int *)0x0) { pbVar11 = &g_xmlNullStr; if ((byte *)*piVar6 != (byte *)0x0) { pbVar11 = (byte *)*piVar6; } nodeNameSize = 0; nodeNameCapacity = 0xf; nodeName[0] = (byte ******)0x0; strEnd = pbVar11; do { bVar4 = *strEnd; strEnd = strEnd + 1; } while (bVar4 != 0); std::string::assign((char *)nodeName,pbVar11,(int)strEnd - (int)(pbVar11 + 1)); pppppbStack_100dc = (byte *****)0xffffffff; entryId = (byte *****)0x0; nameSize = (byte ******)0x0; nameCapacity = 0xf; nameText[0] = (byte ******)0x0; descriptionSize = (byte *****)0x0; descriptionCapacity = 0xf; descriptionText[0] = (byte ******)0x0; hudSize = (byte *****)0x0; hudCapacity = 0xf; hudText[0] = (byte ******)0x0; local_8._0_1_ = 4; ppppppbVar15 = (byte ******)piVar6[8]; isGreedMode = 1; cardType = (byte *****)0x3; pppppbStack_100fc = (byte *****)0x2; pickupSubtype = (byte *****)0x0; ppppppbStack_100ec = (byte ******)0x0; mimicCharge = (byte *****)0x0; announcerDelay = (byte *****)0x4; classLevel = 0; classModifier = 0; joined_r0x0072d2b3: ppppppbStack_100e0 = ppppppbVar15; if (ppppppbVar15 == (byte ******)0x0) goto LAB_0072d642; pppppbVar14 = *ppppppbVar15; pbVar11 = s_id; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < *pbVar11; if (bVar4 != *pbVar11) { LAB_0072d2f1: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d2f6; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < pbVar11[1]; if (bVar4 != pbVar11[1]) goto LAB_0072d2f1; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pbVar11 = pbVar11 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072d2f6: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } entryId = (byte *****)(*atoiFn)(pppppbVar14); goto LAB_0072d62b; } pcVar18 = "achievement"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072d347: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d34c; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072d347; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072d34c: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } pppppbStack_100dc = (byte *****)(*atoiFn)(pppppbVar14); goto LAB_0072d62b; } pbVar11 = s_name; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < *pbVar11; if (bVar4 != *pbVar11) { LAB_0072d3a0: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d3a5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < pbVar11[1]; if (bVar4 != pbVar11[1]) goto LAB_0072d3a0; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pbVar11 = pbVar11 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072d3a5: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } pppppbVar9 = pppppbVar14; do { bVar4 = *(byte *)pppppbVar9; pppppbVar9 = (byte *****)((int)pppppbVar9 + 1); } while (bVar4 != 0); std::string::assign((char *)nameText,(byte *)pppppbVar14, (int)pppppbVar9 - (int)((int)pppppbVar14 + 1)); goto LAB_0072d62b; } pcVar18 = "description"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072d407: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d40c; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072d407; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072d40c: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } pppppbVar9 = pppppbVar14; do { bVar4 = *(byte *)pppppbVar9; pppppbVar9 = (byte *****)((int)pppppbVar9 + 1); } while (bVar4 != 0); std::string::assign((char *)descriptionText,(byte *)pppppbVar14, (int)pppppbVar9 - (int)((int)pppppbVar14 + 1)); goto LAB_0072d62b; } pbVar11 = &DAT_00b666a4; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < *pbVar11; if (bVar4 != *pbVar11) { LAB_0072d470: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d475; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < pbVar11[1]; if (bVar4 != pbVar11[1]) goto LAB_0072d470; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pbVar11 = pbVar11 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072d475: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } pppppbVar9 = pppppbVar14; do { bVar4 = *(byte *)pppppbVar9; pppppbVar9 = (byte *****)((int)pppppbVar9 + 1); } while (bVar4 != 0); std::string::assign((char *)hudText,(byte *)pppppbVar14, (int)pppppbVar9 - (int)((int)pppppbVar14 + 1)); goto LAB_0072d62b; } pcVar18 = "greedmode"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072d4e0: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d4e5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072d4e0; pcVar18 = pcVar18 + 2; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); } while (bVar4 != 0); uVar5 = 0; LAB_0072d4e5: if (uVar5 == 0) { attrText[0] = (byte ******)0x0; attrSize = 0; pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } attrCapacity = 0xf; pppppbVar9 = pppppbVar14; do { bVar4 = *(byte *)pppppbVar9; pppppbVar9 = (byte *****)((int)pppppbVar9 + 1); } while (bVar4 != 0); std::string::assign((char *)attrText,(byte *)pppppbVar14, (int)pppppbVar9 - (int)((int)pppppbVar14 + 1)); if (attrSize == 0) { LAB_0072d5e2: isGreedMode = 0; } else { ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } if (attrSize == 4) { if ((*ppppppbVar15 == (byte *****)0x65757274) || ((((bVar4 = (byte)*ppppppbVar15, bVar17 = bVar4 < 0x74, bVar4 == 0x74 && (bVar17 = *(byte *)((int)ppppppbVar15 + 1) < 0x72, *(byte *)((int)ppppppbVar15 + 1) == 0x72)) && (bVar17 = *(byte *)((int)ppppppbVar15 + 2) < 0x75, *(byte *)((int)ppppppbVar15 + 2) == 0x75)) && (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < 0x65, *(byte *)((int)ppppppbVar15 + 3) == 0x65)))) { uVar5 = 0; } else { uVar5 = -(uint)bVar17 | 1; } if (uVar5 != 0) goto LAB_0072d57a; } else { LAB_0072d57a: ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } if (attrSize == 4) { if ((*ppppppbVar15 == (byte *****)0x65757254) || (((bVar4 = (byte)*ppppppbVar15, bVar17 = bVar4 < 0x54, bVar4 == 0x54 && (bVar17 = *(byte *)((int)ppppppbVar15 + 1) < 0x72, *(byte *)((int)ppppppbVar15 + 1) == 0x72)) && ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < 0x75, *(byte *)((int)ppppppbVar15 + 2) == 0x75 && (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < 0x65, *(byte *)((int)ppppppbVar15 + 3) == 0x65)))))) { uVar5 = 0; } else { uVar5 = -(uint)bVar17 | 1; } if (uVar5 == 0) goto LAB_0072d5d9; } ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } iVar7 = atoi((char *)ppppppbVar15); if (iVar7 == 0) goto LAB_0072d5e2; } LAB_0072d5d9: isGreedMode = 1; } if (0xf < attrCapacity) { uVar5 = attrCapacity + 1; ppppppbVar15 = attrText[0]; if (uVar5 < 0x1000) goto LAB_0072d617; ppppppbVar15 = (byte ******)attrText[0][-1]; uVar5 = attrCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)attrText[0] + (-4 - (int)ppppppbVar15))) goto LAB_0072e5e7; goto LAB_0072d617; } } else { pbVar11 = &DAT_00b69a0c; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < *pbVar11; if (bVar4 != *pbVar11) { LAB_0072d6f8: uVar5 = -(uint)bVar17 | 1; goto LAB_0072d6fd; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < pbVar11[1]; if (bVar4 != pbVar11[1]) goto LAB_0072d6f8; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pbVar11 = pbVar11 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072d6fd: if (uVar5 != 0) { pcVar18 = "pickup"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072db08: uVar5 = -(uint)bVar17 | 1; goto LAB_0072db0d; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072db08; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072db0d: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } pppppbStack_100fc = (byte *****)(*atoiFn)(pppppbVar14); } else { pcVar18 = "announcer"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072db60: uVar5 = -(uint)bVar17 | 1; goto LAB_0072db65; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072db60; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072db65: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } pickupSubtype = (byte *****)(*atoiFn)(pppppbVar14); } else { pcVar18 = "announcer2"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072dbb6: uVar5 = -(uint)bVar17 | 1; goto LAB_0072dbbb; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072dbb6; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072dbbb: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } ppppppbStack_100ec = (byte ******)(*atoiFn)(pppppbVar14); } else { pcVar18 = "announcerdelay"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072dc10: uVar5 = -(uint)bVar17 | 1; goto LAB_0072dc15; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072dc10; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072dc15: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } mimicCharge = (byte *****)(*atoiFn)(pppppbVar14); } else { pcVar18 = "mimiccharge"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072dc66: uVar5 = -(uint)bVar17 | 1; goto LAB_0072dc6b; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072dc66; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072dc6b: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } announcerDelay = (byte *****)(*atoiFn)(pppppbVar14); } else { pcVar18 = "class"; pppppbVar9 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar9 = pppppbVar14; } do { bVar4 = *(byte *)pppppbVar9; bVar17 = bVar4 < (byte)*pcVar18; if (bVar4 != *pcVar18) { LAB_0072dcc0: uVar5 = -(uint)bVar17 | 1; goto LAB_0072dcc5; } if (bVar4 == 0) break; bVar4 = *(byte *)((int)pppppbVar9 + 1); bVar17 = bVar4 < (byte)pcVar18[1]; if (bVar4 != pcVar18[1]) goto LAB_0072dcc0; pppppbVar9 = (byte *****)((int)pppppbVar9 + 2); pcVar18 = pcVar18 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_0072dcc5: if (uVar5 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } bVar4 = *(byte *)pppppbVar14 - 0x30; if (bVar4 < 10) { classLevel = bVar4; if (*(byte *)((int)pppppbVar14 + 1) == 0x2b) { classModifier = 1; } else if (*(byte *)((int)pppppbVar14 + 1) == 0x2d) { classModifier = 2; } } } } } } } } goto LAB_0072d62b; } attrSize = 0; pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar15[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar15[1]; } attrCapacity = 0xf; attrText[0] = (byte ******)0x0; pppppbVar9 = pppppbVar14; do { bVar4 = *(byte *)pppppbVar9; pppppbVar9 = (byte *****)((int)pppppbVar9 + 1); } while (bVar4 != 0); std::string::assign((char *)attrText,(byte *)pppppbVar14, (int)pppppbVar9 - (int)((int)pppppbVar14 + 1)); local_8._0_1_ = 5; pcVar18 = "tarot"; ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } ppppppbStack_100e8 = attrText[0]; uVar5 = attrSize; if (5 < attrSize) { uVar5 = 5; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pcVar18) goto LAB_0072d78a; ppppppbVar15 = ppppppbVar15 + 1; pcVar18 = pcVar18 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_0072d7be: uVar5 = 0; } else { LAB_0072d78a: bVar17 = *(byte *)ppppppbVar15 < (byte)*pcVar18; if ((*(byte *)ppppppbVar15 == *pcVar18) && ((uVar16 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < (byte)pcVar18[1], *(byte *)((int)ppppppbVar15 + 1) == pcVar18[1] && ((uVar16 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < (byte)pcVar18[2], *(byte *)((int)ppppppbVar15 + 2) == pcVar18[2] && ((uVar16 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < (byte)pcVar18[3], *(byte *)((int)ppppppbVar15 + 3) == pcVar18[3])))))))))))) goto LAB_0072d7be; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (4 < attrSize)) && (attrSize < 6)) { cardType = (byte *****)0x0; } else { pbVar11 = (byte *)&DAT_00b697e4; ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } uVar5 = attrSize; uVar16 = attrSize; if (4 < attrSize) { uVar5 = 4; uVar16 = uVar5; } while (uVar2 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pbVar11) goto LAB_0072d80e; ppppppbVar15 = ppppppbVar15 + 1; pbVar11 = pbVar11 + 4; uVar5 = uVar2; } if (uVar2 == 0xfffffffc) { LAB_0072d842: uVar5 = 0; } else { LAB_0072d80e: bVar17 = *(byte *)ppppppbVar15 < *pbVar11; if ((*(byte *)ppppppbVar15 == *pbVar11) && ((uVar2 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < pbVar11[1], *(byte *)((int)ppppppbVar15 + 1) == pbVar11[1] && ((uVar2 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < pbVar11[2], *(byte *)((int)ppppppbVar15 + 2) == pbVar11[2] && ((uVar2 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < pbVar11[3], *(byte *)((int)ppppppbVar15 + 3) == pbVar11[3])))))))))))) goto LAB_0072d842; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (3 < attrSize)) && (attrSize < 5)) { cardType = (byte *****)0x1; } else { pbVar11 = (byte *)&DAT_00b697b0; ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } while (uVar5 = uVar16 - 4, 3 < uVar16) { if (*ppppppbVar15 != *(byte ******)pbVar11) goto LAB_0072d896; pbVar11 = pbVar11 + 4; ppppppbVar15 = ppppppbVar15 + 1; uVar16 = uVar5; } if (uVar5 == 0xfffffffc) { LAB_0072d8ca: uVar5 = 0; } else { LAB_0072d896: bVar17 = *(byte *)ppppppbVar15 < *pbVar11; if ((*(byte *)ppppppbVar15 == *pbVar11) && ((uVar5 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < pbVar11[1], *(byte *)((int)ppppppbVar15 + 1) == pbVar11[1] && ((uVar5 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < pbVar11[2], *(byte *)((int)ppppppbVar15 + 2) == pbVar11[2] && ((uVar5 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < pbVar11[3], *(byte *)((int)ppppppbVar15 + 3) == pbVar11[3])))))))))))) goto LAB_0072d8ca; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (3 < attrSize)) && (attrSize < 5)) { cardType = (byte *****)0x2; } else { pcVar18 = "special"; ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } uVar5 = attrSize; if (7 < attrSize) { uVar5 = 7; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pcVar18) goto LAB_0072d928; ppppppbVar15 = ppppppbVar15 + 1; pcVar18 = pcVar18 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_0072d95c: uVar5 = 0; } else { LAB_0072d928: bVar17 = *(byte *)ppppppbVar15 < (byte)*pcVar18; if ((*(byte *)ppppppbVar15 == *pcVar18) && ((uVar16 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < (byte)pcVar18[1], *(byte *)((int)ppppppbVar15 + 1) == pcVar18[1] && ((uVar16 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < (byte)pcVar18[2], *(byte *)((int)ppppppbVar15 + 2) == pcVar18[2] && ((uVar16 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < (byte)pcVar18[3], *(byte *)((int)ppppppbVar15 + 3) == pcVar18[3])))))))))))) goto LAB_0072d95c; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 != 0) || (attrSize < 7)) || (7 < attrSize)) { ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } pcVar18 = "object"; uVar5 = attrSize; if (6 < attrSize) { uVar5 = 6; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pcVar18) goto LAB_0072d9a6; ppppppbVar15 = ppppppbVar15 + 1; pcVar18 = pcVar18 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_0072d9da: uVar5 = 0; } else { LAB_0072d9a6: bVar17 = *(byte *)ppppppbVar15 < (byte)*pcVar18; if ((*(byte *)ppppppbVar15 == *pcVar18) && ((uVar16 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < (byte)pcVar18[1], *(byte *)((int)ppppppbVar15 + 1) == pcVar18[1] && ((uVar16 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < (byte)pcVar18[2], *(byte *)((int)ppppppbVar15 + 2) == pcVar18[2] && ((uVar16 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < (byte)pcVar18[3], *(byte *)((int)ppppppbVar15 + 3) == pcVar18[3])))))))))))) goto LAB_0072d9da; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (5 < attrSize)) && (attrSize < 7)) { cardType = (byte *****)0x4; goto LAB_0072daa1; } ppppppbVar15 = (byte ******)attrText; if (0xf < attrCapacity) { ppppppbVar15 = attrText[0]; } pcVar18 = "tarot_reverse"; uVar5 = attrSize; if (0xd < attrSize) { uVar5 = 0xd; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pcVar18) goto LAB_0072da2d; ppppppbVar15 = ppppppbVar15 + 1; pcVar18 = pcVar18 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_0072da61: uVar5 = 0; } else { LAB_0072da2d: bVar17 = *(byte *)ppppppbVar15 < (byte)*pcVar18; if ((*(byte *)ppppppbVar15 == *pcVar18) && ((uVar16 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < (byte)pcVar18[1], *(byte *)((int)ppppppbVar15 + 1) == pcVar18[1] && ((uVar16 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < (byte)pcVar18[2], *(byte *)((int)ppppppbVar15 + 2) == pcVar18[2] && ((uVar16 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < (byte)pcVar18[3], *(byte *)((int)ppppppbVar15 + 3) == pcVar18[3])))))))))))) goto LAB_0072da61; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (0xc < attrSize)) && (attrSize < 0xe)) { cardType = (byte *****)0x5; goto LAB_0072daa1; } KAGE_LogMessage(0x10,(byte *)"invalid card type: %s\n"); } cardType = (byte *****)0x3; } } } LAB_0072daa1: local_8._0_1_ = 4; if (0xf < attrCapacity) { uVar5 = attrCapacity + 1; ppppppbVar15 = attrText[0]; if (0xfff < uVar5) { ppppppbVar15 = (byte ******)attrText[0][-1]; uVar5 = attrCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)attrText[0] + (-4 - (int)ppppppbVar15))) goto LAB_0072e5e7; } LAB_0072d617: operator_delete(ppppppbVar15,uVar5); } } ppppppbVar15 = ppppppbStack_100e0; atoiFn = atoi_exref; LAB_0072d62b: if (ppppppbVar15[4] == (byte *****)0x0) goto LAB_0072d642; ppppppbVar15 = (byte ******)ppppppbVar15[6]; goto joined_r0x0072d2b3; } local_8 = (byte *****)0x6; xml_memory_pool::clear(auStack_100a4); local_8 = (byte *****)0x7; tracked_alloc(1,text,0); bVar4 = 1; } ExceptionList = local_10; return bVar4; LAB_0072d642: ppppppbVar3 = hudText[0]; pppppbVar14 = entryId; ppppppbVar15 = (byte ******)nodeName; if (0xf < nodeNameCapacity) { ppppppbVar15 = nodeName[0]; } pbVar11 = (byte *)&DAT_00b66f60; uVar5 = nodeNameSize; uVar16 = nodeNameSize; if (4 < nodeNameSize) { uVar5 = 4; uVar16 = uVar5; } while (uVar2 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pbVar11) goto LAB_0072d682; ppppppbVar15 = ppppppbVar15 + 1; pbVar11 = pbVar11 + 4; uVar5 = uVar2; } if (uVar2 == 0xfffffffc) { LAB_0072dd1d: uVar5 = 0; } else { LAB_0072d682: bVar17 = *(byte *)ppppppbVar15 < *pbVar11; if ((*(byte *)ppppppbVar15 == *pbVar11) && ((uVar2 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < pbVar11[1], *(byte *)((int)ppppppbVar15 + 1) == pbVar11[1] && ((uVar2 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < pbVar11[2], *(byte *)((int)ppppppbVar15 + 2) == pbVar11[2] && ((uVar2 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < pbVar11[3], *(byte *)((int)ppppppbVar15 + 3) == pbVar11[3])))))))))))) goto LAB_0072dd1d; uVar5 = -(uint)bVar17 | 1; } ppppppbStack_100e8 = nameText[0]; if (((uVar5 == 0) && (3 < nodeNameSize)) && (nodeNameSize < 5)) { LAB_0072ddb9: if ((int)entryId < 0) { pcVar18 = "[warn] %s: Card ID %d out of range!\n"; LAB_0072e4eb: KAGE_LogMessage(1,(byte *)pcVar18); } else { ppppppbStack_100f0 = operator_new(0x70); if (ppppppbStack_100f0 == (byte ******)0x0) { ppppppbVar15 = (byte ******)0x0; } else { ppppppbStack_100f0[2] = (byte *****)0x0; ppppppbStack_100f0[6] = (byte *****)0x0; ppppppbStack_100f0[7] = (byte *****)0xf; *(byte *)(ppppppbStack_100f0 + 2) = 0; ppppppbStack_100f0[8] = (byte *****)0x0; ppppppbStack_100f0[0xc] = (byte *****)0x0; ppppppbStack_100f0[0xd] = (byte *****)0xf; *(byte *)(ppppppbStack_100f0 + 8) = 0; ppppppbStack_100f0[0xe] = (byte *****)0x0; ppppppbStack_100f0[0x12] = (byte *****)0x0; ppppppbStack_100f0[0x13] = (byte *****)0xf; *(byte *)(ppppppbStack_100f0 + 0xe) = 0; ppppppbStack_100f0[0x1b] = (byte *****)0x0; ppppppbVar15 = ppppppbStack_100f0; } *ppppppbVar15 = pppppbVar14; ppppppbVar13 = ppppppbVar15 + 2; ppppppbVar15[1] = pppppbStack_100dc; ppppppbStack_100e0 = ppppppbVar15; if ((byte *******)ppppppbVar13 != nameText) { ppppppbStack_100f0 = (byte ******)ppppppbVar15[7]; ppppppbStack_100ec = (byte ******)nameText; if (0xf < nameCapacity) { ppppppbStack_100ec = ppppppbStack_100e8; } if (ppppppbStack_100f0 < nameSize) { if ((byte ******)0x7fffffff < nameSize) goto LAB_0072e63a; pppppbVar14 = (byte *****)((uint)nameSize | 0xf); if (pppppbVar14 < (byte *****)0x80000000) { if ((byte ******)(0x7fffffff - ((uint)ppppppbStack_100f0 >> 1)) < ppppppbStack_100f0) { pppppbVar14 = (byte *****)0x7fffffff; } else { pppppbVar9 = (byte *****)((int)ppppppbStack_100f0 + ((uint)ppppppbStack_100f0 >> 1)); if (pppppbVar14 < pppppbVar9) { pppppbVar14 = pppppbVar9; } } } else { pppppbVar14 = (byte *****)0x7fffffff; } pppppbVar9 = std::_Allocate((uint)((int)pppppbVar14 + 1)); ppppppbVar15[7] = pppppbVar14; ppppppbVar15[6] = (byte *****)nameSize; pppppbStack_100dc = pppppbVar9; memcpy(pppppbVar9,ppppppbStack_100ec,(size_t)nameSize); *(byte *)((int)pppppbVar9 + (int)nameSize) = 0; if (&DAT_0000000f < ppppppbStack_100f0) { pppppbVar14 = *ppppppbVar13; ppppppbVar10 = (byte ******)((int)ppppppbStack_100f0 + 1); pppppbVar12 = pppppbVar14; if ((byte ******)0xfff < ppppppbVar10) { pppppbVar12 = (byte *****)pppppbVar14[-1]; ppppppbVar10 = ppppppbStack_100f0 + 9; if (0x1f < (uint)((int)pppppbVar14 + (-4 - (int)pppppbVar12))) goto LAB_0072e5e7; } operator_delete(pppppbVar12,(uint)ppppppbVar10); } *ppppppbVar13 = pppppbVar9; } else { if (&DAT_0000000f < ppppppbStack_100f0) { ppppppbVar13 = (byte ******)*ppppppbVar13; } ppppppbVar15[6] = (byte *****)nameSize; memmove(ppppppbVar13,ppppppbStack_100ec,(size_t)nameSize); *(byte *)((int)ppppppbVar13 + (int)nameSize) = 0; } } ppppppbVar13 = ppppppbVar15 + 8; if ((byte *******)ppppppbVar13 != descriptionText) { pppppbStack_100dc = ppppppbVar15[0xd]; ppppppbStack_100f0 = (byte ******)descriptionText; if (0xf < descriptionCapacity) { ppppppbStack_100f0 = descriptionText[0]; } if (pppppbStack_100dc < descriptionSize) { if ((byte *****)0x7fffffff < descriptionSize) goto LAB_0072e63a; pppppbVar14 = (byte *****)((uint)descriptionSize | 0xf); if (pppppbVar14 < (byte *****)0x80000000) { if ((byte *****)(0x7fffffff - ((uint)pppppbStack_100dc >> 1)) < pppppbStack_100dc) { pppppbVar14 = (byte *****)0x7fffffff; } else { pppppbVar9 = (byte *****)((int)pppppbStack_100dc + ((uint)pppppbStack_100dc >> 1)); if (pppppbVar14 < pppppbVar9) { pppppbVar14 = pppppbVar9; } } } else { pppppbVar14 = (byte *****)0x7fffffff; } ppppppbVar10 = std::_Allocate((uint)((int)pppppbVar14 + 1)); ppppppbVar15[0xd] = pppppbVar14; ppppppbVar15[0xc] = descriptionSize; ppppppbStack_100ec = ppppppbVar10; memcpy(ppppppbVar10,ppppppbStack_100f0,(size_t)descriptionSize); *(byte *)((int)ppppppbVar10 + (int)descriptionSize) = 0; if (&DAT_0000000f < pppppbStack_100dc) { pppppbVar14 = *ppppppbVar13; pppppbVar12 = (byte *****)((int)pppppbStack_100dc + 1); pppppbVar9 = pppppbVar14; if ((byte *****)0xfff < pppppbVar12) { pppppbVar9 = (byte *****)pppppbVar14[-1]; pppppbVar12 = pppppbStack_100dc + 9; if (0x1f < (uint)((int)pppppbVar14 + (-4 - (int)pppppbVar9))) goto LAB_0072e5e7; } operator_delete(pppppbVar9,(uint)pppppbVar12); } *ppppppbVar13 = (byte *****)ppppppbVar10; } else { if (&DAT_0000000f < pppppbStack_100dc) { ppppppbVar13 = (byte ******)*ppppppbVar13; } ppppppbVar15[0xc] = descriptionSize; memmove(ppppppbVar13,ppppppbStack_100f0,(size_t)descriptionSize); *(byte *)((int)ppppppbVar13 + (int)descriptionSize) = 0; } } ppppppbVar13 = ppppppbVar15 + 0xe; if ((byte *******)ppppppbVar13 != hudText) { pppppbStack_100dc = ppppppbVar15[0x13]; ppppppbStack_100f0 = (byte ******)hudText; if (0xf < hudCapacity) { ppppppbStack_100f0 = ppppppbVar3; } if (pppppbStack_100dc < hudSize) { if ((byte *****)0x7fffffff < hudSize) { LAB_0072e63a: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppbVar14 = (byte *****)((uint)hudSize | 0xf); if (pppppbVar14 < (byte *****)0x80000000) { if ((byte *****)(0x7fffffff - ((uint)pppppbStack_100dc >> 1)) < pppppbStack_100dc) { pppppbVar14 = (byte *****)0x7fffffff; } else { pppppbVar9 = (byte *****)((int)pppppbStack_100dc + ((uint)pppppbStack_100dc >> 1)); if (pppppbVar14 < pppppbVar9) { pppppbVar14 = pppppbVar9; } } } else { pppppbVar14 = (byte *****)0x7fffffff; } ppppppbVar10 = std::_Allocate((uint)((int)pppppbVar14 + 1)); ppppppbVar15[0x13] = pppppbVar14; ppppppbVar15[0x12] = hudSize; ppppppbStack_100ec = ppppppbVar10; memcpy(ppppppbVar10,ppppppbStack_100f0,(size_t)hudSize); *(byte *)((int)ppppppbVar10 + (int)hudSize) = 0; if (&DAT_0000000f < pppppbStack_100dc) { pppppbVar14 = *ppppppbVar13; pppppbVar12 = (byte *****)((int)pppppbStack_100dc + 1); pppppbVar9 = pppppbVar14; if ((byte *****)0xfff < pppppbVar12) { pppppbVar9 = (byte *****)pppppbVar14[-1]; pppppbVar12 = pppppbStack_100dc + 9; if (0x1f < (uint)((int)pppppbVar14 + (-4 - (int)pppppbVar9))) goto LAB_0072e5e7; } operator_delete(pppppbVar9,(uint)pppppbVar12); } *ppppppbVar13 = (byte *****)ppppppbVar10; } else { ppppppbVar10 = ppppppbVar13; if (&DAT_0000000f < pppppbStack_100dc) { ppppppbVar10 = (byte ******)*ppppppbVar13; } ppppppbVar15[0x12] = hudSize; memmove(ppppppbVar10,ppppppbStack_100f0,(size_t)hudSize); *(byte *)((int)ppppppbVar10 + (int)hudSize) = 0; } } *(byte *)(ppppppbVar15 + 0x14) = isGreedMode; ppppppbVar15[0x16] = cardType; ppppppbVar15[0x15] = pppppbStack_100fc; ppppppbVar15[0x17] = pickupSubtype; ppppppbVar15[0x18] = mimicCharge; ppppppbVar15[0x19] = announcerDelay; ppppppbVar15[0x1a] = modEntry; if (modEntry == (void *)0x0) { *(byte *******)((int)(itemConfig->_cards)._begin + (int)entryId * 4) = ppppppbVar15; } else { *ppppppbVar15 = (byte *****)((int)(itemConfig->_cards)._end - (int)(itemConfig->_cards)._begin >> 2); if (*(char *)((int)modEntry + 0xaa9) != '\0') { if ((byte *****)0xf < ppppppbVar15[0x13]) { ppppppbVar13 = (byte ******)*ppppppbVar13; } pvVar8 = ANM2::GetAnimationData((ANM2 *)((int)modEntry + 0x9a0),(byte *)ppppppbVar13); if (pvVar8 != (void *)0x0) { ppppppbVar15[0x1b] = (byte *****)((int)modEntry + 0x9a0); } } vectorEnd = (itemConfig->_cards)._end; if (vectorEnd == (itemConfig->_cards)._capacity) { std::vector::_Emplace_reallocate(vectorEnd,&ppppppbStack_100e0); ppppppbVar15 = ppppppbStack_100e0; } else { *vectorEnd = ppppppbVar15; ppvVar1 = &(itemConfig->_cards)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } FUN_0084f380(ppppppbVar15,1); } } } else { pbVar11 = (byte *)&DAT_00b697b0; ppppppbVar15 = (byte ******)nodeName; if (0xf < nodeNameCapacity) { ppppppbVar15 = nodeName[0]; } while (uVar5 = uVar16 - 4, 3 < uVar16) { if (*ppppppbVar15 != *(byte ******)pbVar11) goto LAB_0072dd6c; pbVar11 = pbVar11 + 4; ppppppbVar15 = ppppppbVar15 + 1; uVar16 = uVar5; } if (uVar5 == 0xfffffffc) { LAB_0072dda0: uVar5 = 0; } else { LAB_0072dd6c: bVar17 = *(byte *)ppppppbVar15 < *pbVar11; if ((*(byte *)ppppppbVar15 == *pbVar11) && ((uVar5 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < pbVar11[1], *(byte *)((int)ppppppbVar15 + 1) == pbVar11[1] && ((uVar5 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < pbVar11[2], *(byte *)((int)ppppppbVar15 + 2) == pbVar11[2] && ((uVar5 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < pbVar11[3], *(byte *)((int)ppppppbVar15 + 3) == pbVar11[3])))))))))))) goto LAB_0072dda0; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 == 0) && (3 < nodeNameSize)) && (nodeNameSize < 5)) goto LAB_0072ddb9; pcVar18 = "pilleffect"; ppppppbVar15 = (byte ******)nodeName; if (0xf < nodeNameCapacity) { ppppppbVar15 = nodeName[0]; } uVar5 = nodeNameSize; if (10 < nodeNameSize) { uVar5 = 10; } while (uVar16 = uVar5 - 4, 3 < uVar5) { if (*ppppppbVar15 != *(byte ******)pcVar18) goto LAB_0072e258; ppppppbVar15 = ppppppbVar15 + 1; pcVar18 = pcVar18 + 4; uVar5 = uVar16; } if (uVar16 == 0xfffffffc) { LAB_0072e28c: uVar5 = 0; } else { LAB_0072e258: bVar17 = *(byte *)ppppppbVar15 < (byte)*pcVar18; if ((*(byte *)ppppppbVar15 == *pcVar18) && ((uVar16 == 0xfffffffd || ((bVar17 = *(byte *)((int)ppppppbVar15 + 1) < (byte)pcVar18[1], *(byte *)((int)ppppppbVar15 + 1) == pcVar18[1] && ((uVar16 == 0xfffffffe || ((bVar17 = *(byte *)((int)ppppppbVar15 + 2) < (byte)pcVar18[2], *(byte *)((int)ppppppbVar15 + 2) == pcVar18[2] && ((uVar16 == 0xffffffff || (bVar17 = *(byte *)((int)ppppppbVar15 + 3) < (byte)pcVar18[3], *(byte *)((int)ppppppbVar15 + 3) == pcVar18[3])))))))))))) goto LAB_0072e28c; uVar5 = -(uint)bVar17 | 1; } if (((uVar5 != 0) || (nodeNameSize < 10)) || (10 < nodeNameSize)) { pcVar18 = "[warn] %s: Unknown item tag %s\n"; goto LAB_0072e4eb; } if ((int)entryId < 0) { pcVar18 = "[warn] %s: Pill Effect ID %d out of range!\n"; goto LAB_0072e4eb; } pppppbVar9 = operator_new(0x54); if (pppppbVar9 == (byte *****)0x0) { pppppbVar9 = (byte *****)0x0; } else { pppppbVar9[2] = (byte ****)0x0; pppppbVar9[6] = (byte ****)0x0; pppppbVar9[7] = (byte ****)0xf; pppppbVar9[8] = (byte ****)0x0; pppppbVar9[0xc] = (byte ****)0x0; pppppbVar9[0xd] = (byte ****)0xf; } ppppppbVar15 = (byte ******)(pppppbVar9 + 2); *pppppbVar9 = (byte ****)pppppbVar14; pppppbVar9[1] = (byte ****)pppppbStack_100dc; pppppbStack_100fc = pppppbVar9; if ((byte *******)ppppppbVar15 != nameText) { ppppppbStack_100e0 = (byte ******)pppppbVar9[7]; ppppppbStack_100f0 = (byte ******)nameText; if (0xf < nameCapacity) { ppppppbStack_100f0 = ppppppbStack_100e8; } if (ppppppbStack_100e0 < nameSize) { if ((byte ******)0x7fffffff < nameSize) goto LAB_0072e63a; newCapacity = (byte ****)((uint)nameSize | 0xf); if (newCapacity < (byte ****)0x80000000) { if ((byte ******)(0x7fffffff - ((uint)ppppppbStack_100e0 >> 1)) < ppppppbStack_100e0) { newCapacity = (byte ****)0x7fffffff; } else { grownCapacity = (byte ****)((int)ppppppbStack_100e0 + ((uint)ppppppbStack_100e0 >> 1)); if (newCapacity < grownCapacity) { newCapacity = grownCapacity; } } } else { newCapacity = (byte ****)0x7fffffff; } pppppbVar14 = std::_Allocate((uint)((int)newCapacity + 1)); pppppbVar9[7] = newCapacity; pppppbVar9[6] = (byte ****)nameSize; pppppbStack_100dc = pppppbVar14; memcpy(pppppbVar14,ppppppbStack_100f0,(size_t)nameSize); *(byte *)((int)pppppbVar14 + (int)nameSize) = 0; if (&DAT_0000000f < ppppppbStack_100e0) { pppppbVar12 = *ppppppbVar15; ppppppbVar13 = (byte ******)((int)ppppppbStack_100e0 + 1); ptr = pppppbVar12; if ((byte ******)0xfff < ppppppbVar13) { ptr = (byte *****)pppppbVar12[-1]; ppppppbVar13 = ppppppbStack_100e0 + 9; if (0x1f < (uint)((int)pppppbVar12 + (-4 - (int)ptr))) goto LAB_0072e5e7; } operator_delete(ptr,(uint)ppppppbVar13); } *ppppppbVar15 = pppppbVar14; } else { if (&DAT_0000000f < ppppppbStack_100e0) { ppppppbVar15 = (byte ******)*ppppppbVar15; } pppppbVar9[6] = (byte ****)nameSize; memmove(ppppppbVar15,ppppppbStack_100f0,(size_t)nameSize); *(byte *)((int)ppppppbVar15 + (int)nameSize) = 0; } pppppbVar14 = entryId; } if ((byte *******)(pppppbVar9 + 8) != descriptionText) { ppppppbVar15 = (byte ******)descriptionText; if (0xf < descriptionCapacity) { ppppppbVar15 = descriptionText[0]; } std::string::assign((char *)(pppppbVar9 + 8),(byte *)ppppppbVar15,(uint)descriptionSize); } *(byte *)(pppppbVar9 + 0xe) = isGreedMode; pppppbVar9[0xf] = (byte ****)pickupSubtype; pppppbVar9[0x10] = (byte ****)ppppppbStack_100ec; pppppbVar9[0x11] = (byte ****)mimicCharge; *(byte *)(pppppbVar9 + 0x13) = classLevel; *(undefined1 *)((int)pppppbVar9 + 0x4d) = classModifier; pppppbVar9[0x12] = (byte ****)announcerDelay; pppppbVar9[0x14] = modEntry; if (modEntry == (void *)0x0) { *(byte ******)((int)(itemConfig->_pillEffects)._begin + (int)pppppbVar14 * 4) = pppppbVar9; } else { *pppppbVar9 = (byte ****) ((int)(itemConfig->_pillEffects)._end - (int)(itemConfig->_pillEffects)._begin >> 2); vectorEnd = (itemConfig->_pillEffects)._end; if (vectorEnd == (itemConfig->_pillEffects)._capacity) { std::vector::_Emplace_reallocate(vectorEnd,&pppppbStack_100fc); pppppbVar9 = pppppbStack_100fc; } else { *vectorEnd = pppppbVar9; ppvVar1 = &(itemConfig->_pillEffects)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } FUN_0084f4e0(pppppbVar9,1); } } local_8._0_1_ = 3; if (0xf < hudCapacity) { uVar5 = hudCapacity + 1; ppppppbVar15 = ppppppbVar3; if (0xfff < uVar5) { ppppppbVar15 = (byte ******)ppppppbVar3[-1]; uVar5 = hudCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbVar3 + (-4 - (int)ppppppbVar15))) goto LAB_0072e5e7; } operator_delete(ppppppbVar15,uVar5); } local_8._0_1_ = 2; if (0xf < descriptionCapacity) { uVar5 = descriptionCapacity + 1; ppppppbVar15 = descriptionText[0]; if (0xfff < uVar5) { ppppppbVar15 = (byte ******)descriptionText[0][-1]; uVar5 = descriptionCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)descriptionText[0] + (-4 - (int)ppppppbVar15))) goto LAB_0072e5e7; } operator_delete(ppppppbVar15,uVar5); } local_8._0_1_ = 1; if (0xf < nameCapacity) { uVar5 = nameCapacity + 1; ppppppbVar15 = ppppppbStack_100e8; if (0xfff < uVar5) { ppppppbVar15 = (byte ******)ppppppbStack_100e8[-1]; uVar5 = nameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_100e8 + (-4 - (int)ppppppbVar15))) goto LAB_0072e5e7; } operator_delete(ppppppbVar15,uVar5); } local_8._0_1_ = 0; if (0xf < nodeNameCapacity) { uVar5 = nodeNameCapacity + 1; ppppppbVar15 = nodeName[0]; if (0xfff < uVar5) { ppppppbVar15 = (byte ******)nodeName[0][-1]; uVar5 = nodeNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)nodeName[0] + (-4 - (int)ppppppbVar15))) { LAB_0072e5e7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar15,uVar5); } piVar6 = (int *)piVar6[0xb]; goto LAB_0072d1c8; } //@@ 0072e640 playerforms_xml_load /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: parses playerforms.xml ("Could not find root node playerforms", "Player Form ID %d out of range", attrs cache/costume) via FileSystem::Open; called from content loader 00952df0 Manager::load_configs undefined4 playerforms_xml_load(byte *param_1) { byte bVar1; uint uVar2; int ***pppiVar3; ulonglong uVar4; qword qVar5; uint uVar6; int *piVar7; undefined4 uVar8; int iVar9; byte *text; void *pvVar10; byte *pbVar11; uint uVar12; int ***_Dst; int ***ptr; int in_ECX; byte *pbVar13; char *pcVar14; byte *pbVar15; int ****ppppiVar16; uint uVar17; int ****ppppiVar18; qword *pqVar19; undefined4 *puVar20; bool bVar21; ulonglong uVar22; int iStack_100b4; uint uStack_100b0; int iStack_10098; int ****ppppiStack_10094; undefined1 auStack_10090 [48]; undefined1 auStack_10060 [65560]; int ****local_48 [4]; uint local_38; uint local_34; void *local_30 [4]; uint local_20; uint local_1c; uint local_18; undefined4 uStack_14; void *local_10; undefined1 *puStack_c; int ***local_8; local_8 = (int ***)0xffffffff; puStack_c = &LAB_00afd408; local_10 = ExceptionList; uStack_14 = 0x72e65b; uVar6 = __security_cookie ^ (uint)(local_48 + 0x11); ExceptionList = &local_10; local_18 = uVar6; piVar7 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar7 == (int *)0x0) { uVar8 = 0; } else { iVar9 = (**(code **)(*piVar7 + 4))(uVar6); text = operator_new_tracked(iVar9 + 1); (**(code **)(*piVar7 + 0x14))(text,1,iVar9); text[iVar9] = 0; (**(code **)*piVar7)(1); FUN_00413b90(); local_8._0_1_ = 0; local_8._1_3_ = 0; iVar9 = 0x72e6f7; pbVar15 = text; rapidxml::xml_document::parse(auStack_10090,text); pvVar10 = xml_node::first_node(auStack_10090,(byte *)"playerforms",iVar9,(byte)pbVar15); if (pvVar10 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Could not find root node \'playerforms\' in %s\n"); } for (iVar9 = *(int *)((int)pvVar10 + 0x18); iVar9 != 0; iVar9 = *(int *)(iVar9 + 0x2c)) { local_34 = 0xf; iStack_10098 = 0; local_38 = 0; local_48[0] = (int ****)0x0; local_8._0_1_ = 1; puVar20 = *(undefined4 **)(iVar9 + 0x20); uStack_100b0 = 0; iStack_100b4 = -1; uVar22 = 0; uVar4 = 0; if (puVar20 == (undefined4 *)0x0) { LAB_0072ea5a: uVar6 = local_38; if (*(int *)(in_ECX + 0x48) - *(int *)(in_ECX + 0x44) >> 2 <= iStack_10098) goto LAB_0072ec02; piVar7 = operator_new(0x30); ppppiVar18 = local_48[0]; if (piVar7 == (int *)0x0) { piVar7 = (int *)0x0; } else { piVar7[4] = 0; piVar7[8] = 0; piVar7[9] = 0xf; } *piVar7 = iStack_10098; *(ulonglong *)(piVar7 + 2) = uVar4; ppppiStack_10094 = (int ****)(piVar7 + 4); if ((int *****)ppppiStack_10094 != local_48) { ppppiVar16 = (int ****)local_48; if (0xf < local_34) { ppppiVar16 = local_48[0]; } uVar2 = piVar7[9]; if (uVar2 < uVar6) { if (0x7fffffff < uVar6) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar17 = uVar6 | 0xf; if (uVar17 < 0x80000000) { if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar17 = 0x7fffffff; } else { uVar12 = (uVar2 >> 1) + uVar2; if (uVar17 < uVar12) { uVar17 = uVar12; } } } else { uVar17 = 0x7fffffff; } _Dst = std::_Allocate(uVar17 + 1); piVar7[8] = uVar6; piVar7[9] = uVar17; memcpy(_Dst,ppppiVar16,uVar6); *(undefined1 *)(uVar6 + (int)_Dst) = 0; if (0xf < uVar2) { pppiVar3 = *ppppiStack_10094; uVar6 = uVar2 + 1; ptr = pppiVar3; if (0xfff < uVar6) { ptr = (int ***)pppiVar3[-1]; uVar6 = uVar2 + 0x24; if (0x1f < (uint)((int)pppiVar3 + (-4 - (int)ptr))) goto LAB_0072ec8c; } operator_delete(ptr,uVar6); } *ppppiStack_10094 = _Dst; } else { if (0xf < uVar2) { ppppiStack_10094 = (int ****)*ppppiStack_10094; } piVar7[8] = uVar6; memmove(ppppiStack_10094,ppppiVar16,uVar6); *(undefined1 *)(uVar6 + (int)ppppiStack_10094) = 0; } } piVar7[0xb] = uStack_100b0; piVar7[10] = iStack_100b4; *(int **)(*(int *)(in_ECX + 0x44) + iStack_10098 * 4) = piVar7; } else { do { pbVar15 = (byte *)*puVar20; pbVar13 = s_id; pbVar11 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar11 = pbVar15; } do { bVar1 = *pbVar11; bVar21 = bVar1 < *pbVar13; if (bVar1 != *pbVar13) { LAB_0072e7b8: uVar6 = -(uint)bVar21 | 1; goto LAB_0072e7bd; } if (bVar1 == 0) break; bVar1 = pbVar11[1]; bVar21 = bVar1 < pbVar13[1]; if (bVar1 != pbVar13[1]) goto LAB_0072e7b8; pbVar11 = pbVar11 + 2; pbVar13 = pbVar13 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0072e7bd: if (uVar6 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar20[1] != (byte *)0x0) { pbVar15 = (byte *)puVar20[1]; } iStack_10098 = atoi((char *)pbVar15); } else { pbVar13 = s_name; pbVar11 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar11 = pbVar15; } do { bVar1 = *pbVar11; bVar21 = bVar1 < *pbVar13; if (bVar1 != *pbVar13) { LAB_0072e814: uVar6 = -(uint)bVar21 | 1; goto LAB_0072e819; } if (bVar1 == 0) break; bVar1 = pbVar11[1]; bVar21 = bVar1 < pbVar13[1]; if (bVar1 != pbVar13[1]) goto LAB_0072e814; pbVar11 = pbVar11 + 2; pbVar13 = pbVar13 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0072e819: if (uVar6 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar20[1] != (byte *)0x0) { pbVar15 = (byte *)puVar20[1]; } pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_48,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); } else { pbVar13 = &DAT_00b66d44; pbVar11 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar11 = pbVar15; } do { bVar1 = *pbVar11; bVar21 = bVar1 < *pbVar13; if (bVar1 != *pbVar13) { LAB_0072e877: uVar6 = -(uint)bVar21 | 1; goto LAB_0072e87c; } if (bVar1 == 0) break; bVar1 = pbVar11[1]; bVar21 = bVar1 < pbVar13[1]; if (bVar1 != pbVar13[1]) goto LAB_0072e877; pbVar11 = pbVar11 + 2; pbVar13 = pbVar13 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0072e87c: if (uVar6 == 0) { local_20 = 0; pbVar15 = &g_xmlNullStr; if ((byte *)puVar20[1] != (byte *)0x0) { pbVar15 = (byte *)puVar20[1]; } local_1c = 0xf; local_30[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_30,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 2; uVar22 = ItemConfig::parse_tags((std_string *)local_30); local_8._0_1_ = 1; if (0xf < local_1c) { uVar6 = local_1c + 1; pvVar10 = local_30[0]; if (0xfff < uVar6) { pvVar10 = *(void **)((int)local_30[0] + -4); uVar6 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar10))) goto LAB_0072ec8c; } operator_delete(pvVar10,uVar6); } } else { pcVar14 = "cache"; pbVar11 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar11 = pbVar15; } do { bVar1 = *pbVar11; bVar21 = bVar1 < (byte)*pcVar14; if (bVar1 != *pcVar14) { LAB_0072e947: uVar6 = -(uint)bVar21 | 1; goto LAB_0072e94c; } if (bVar1 == 0) break; bVar1 = pbVar11[1]; bVar21 = bVar1 < (byte)pcVar14[1]; if (bVar1 != pcVar14[1]) goto LAB_0072e947; pbVar11 = pbVar11 + 2; pcVar14 = pcVar14 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0072e94c: if (uVar6 == 0) { local_20 = 0; pbVar15 = &g_xmlNullStr; if ((byte *)puVar20[1] != (byte *)0x0) { pbVar15 = (byte *)puVar20[1]; } local_1c = 0xf; local_30[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_30,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 3; uStack_100b0 = ItemConfig::parse_cache_flags((std_string *)local_30); local_8._0_1_ = 1; if (0xf < local_1c) { uVar6 = local_1c + 1; pvVar10 = local_30[0]; if (0xfff < uVar6) { pvVar10 = *(void **)((int)local_30[0] + -4); uVar6 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar10))) goto LAB_0072ec8c; } operator_delete(pvVar10,uVar6); } } else { pcVar14 = "costume"; pbVar11 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar11 = pbVar15; } do { bVar1 = *pbVar11; bVar21 = bVar1 < (byte)*pcVar14; if (bVar1 != *pcVar14) { LAB_0072ea12: uVar6 = -(uint)bVar21 | 1; goto LAB_0072ea17; } if (bVar1 == 0) break; bVar1 = pbVar11[1]; bVar21 = bVar1 < (byte)pcVar14[1]; if (bVar1 != pcVar14[1]) goto LAB_0072ea12; pbVar11 = pbVar11 + 2; pcVar14 = pcVar14 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_0072ea17: if (uVar6 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar20[1] != (byte *)0x0) { pbVar15 = (byte *)puVar20[1]; } iStack_100b4 = atoi((char *)pbVar15); } } } } } } while ((puVar20[4] != 0) && (puVar20 = (undefined4 *)puVar20[6], puVar20 != (undefined4 *)0x0)); if (-1 < iStack_10098) { uVar4 = uVar22; goto LAB_0072ea5a; } LAB_0072ec02: KAGE_LogMessage(1,(byte *)"[warn] %s: Player Form ID %d out of range!\n"); ppppiVar18 = local_48[0]; } local_8._0_1_ = 0; if (0xf < local_34) { uVar6 = local_34 + 1; ppppiVar16 = ppppiVar18; if (0xfff < uVar6) { ppppiVar16 = (int ****)ppppiVar18[-1]; uVar6 = local_34 + 0x24; if (0x1f < (uint)((int)ppppiVar18 + (-4 - (int)ppppiVar16))) { LAB_0072ec8c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppiVar16,uVar6); } } local_8 = (int ***)0x4; xml_memory_pool::clear(auStack_10060); if (g_mainHeap == (void *)0x0) { pqVar19 = &g_allocatedBytesNoHeap; } else { pqVar19 = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar6 = *(uint *)(text + -4); qVar5 = *pqVar19; *(uint *)pqVar19 = (uint)*pqVar19 - uVar6; *(uint *)((int)pqVar19 + 4) = *(uint *)((int)pqVar19 + 4) - (uint)((uint)qVar5 < uVar6); free(text + -4); } uVar8 = 1; } ExceptionList = local_10; return uVar8; } //@@ 0072ece0 ItemConfig::LoadBombCostumes /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: parses bombcostumes.xml (bombcostumes/anm2root/rule/includeFlags/excludeFlags/front/front2/overlay/suffix); ECX=Manager+0x2a404 (ItemConfig in this exe), stores at this+0x110; caller loads all config xmls prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemConfig::LoadBombCostumes(ItemConfig *this,byte *path,byte isAppend) { byte bVar1; uint uVar2; int *piVar3; int iVar4; void *pvVar5; void *pvVar6; uint uVar7; int *token; byte ******ppppppbVar8; byte *pbVar9; byte *pbVar10; uint uVar11; byte *attrNameCursor; uint valueLength; std_string *psVar12; char *pcVar13; undefined4 *puVar14; int *piVar15; bool isLess; char *pcVar16; int insertResult [2]; int iStack_101cc; int iStack_101c8; undefined4 uStack_101c4; undefined4 uStack_101c0; ItemConfig *pIStack_101bc; int *excludeFlagTokens; int *excludeFlagTokensEnd; int excludeFlagTokensCapacity; int *includeFlagTokens; int *includeFlagTokensEnd; int includeFlagTokensCapacity; int *piStack_101a0; byte *fileBuffer; undefined4 *ruleAttribute; byte *pbStack_10194; int costumeRules; int *piStack_1018c; undefined4 *ruleNode; int *cleanupFlags; undefined1 xmlDoc [48]; undefined1 auStack_10150 [65560]; undefined8 includeFlagsLow; undefined8 includeFlagsHigh; undefined8 excludeFlagsLow; undefined8 excludeFlagsHigh; void *bodyPath; undefined4 uStack_114; undefined4 uStack_110; undefined4 uStack_10c; undefined4 bodyPathSize; uint bodyPathCapacity; void *backPath; undefined4 uStack_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 local_f0; uint uStack_ec; void *body2Path; undefined4 uStack_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 local_d8; uint uStack_d4; void *frontPath; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 local_c0; uint uStack_bc; void *front2Path; undefined4 uStack_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined4 local_a8; uint uStack_a4; void *overlayPath; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 local_90; uint uStack_8c; char local_88 [24]; char local_70 [28]; byte ******anm2Root [4]; uint anm2RootSize; uint anm2RootCapacity; void *tmpString; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 tmpStringSize; uint tmpStringCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte *****local_14; puStack_20 = (undefined1 *)(anm2Root + 0x14); local_14 = (byte *****)0xffffffff; puStack_18 = &LAB_00afd4ee; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(anm2Root + 0x11); ExceptionList = &local_1c; pbStack_10194 = path; cleanupFlags = (int *)0x0; piStack_1018c = (int *)0x0; pIStack_101bc = this; local_24 = uVar2; ppppppbVar8 = (byte ******)(anm2Root + 0x14); if (isAppend == 0) { pvVar5 = this[1]._collectibles._begin; FUN_007317d0(this + 1,*(undefined4 *)((int)pvVar5 + 4)); *(void **)((int)pvVar5 + 4) = pvVar5; *(void **)pvVar5 = pvVar5; *(void **)((int)pvVar5 + 8) = pvVar5; this[1]._collectibles._end = (void *)0x0; ppppppbVar8 = (byte ******)puStack_20; } puStack_20 = (undefined1 *)ppppppbVar8; piVar3 = FileSystem::Open(&PTR_vftable_00c37a10,pbStack_10194,(int *)0x0); if (piVar3 == (int *)0x0) { bVar1 = 0; } else { iVar4 = (**(code **)(*piVar3 + 4))(uVar2); fileBuffer = operator_new_tracked(iVar4 + 1); (**(code **)(*piVar3 + 0x14))(fileBuffer,1,iVar4); fileBuffer[iVar4] = 0; (**(code **)*piVar3)(1); FUN_00413b90(); local_14._0_1_ = 0; local_14._1_3_ = 0; pcVar16 = (char *)0x72edea; pbVar10 = fileBuffer; rapidxml::xml_document::parse(xmlDoc,fileBuffer); bVar1 = (byte)pbVar10; pvVar5 = xml_node::first_node(xmlDoc,(byte *)"bombcostumes",(int)pcVar16,bVar1); if (pvVar5 == (void *)0x0) { pcVar16 = "Could not find root node \'bombcostumes\' in %s\n"; pbVar10 = pbStack_10194; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'bombcostumes\' in %s\n"); bVar1 = (byte)pbVar10; } pvVar6 = xml_node::first_attribute(pvVar5,(byte *)"anm2root",(uint)pcVar16,bVar1); anm2RootSize = 0; anm2RootCapacity = 0xf; anm2Root[0] = (byte ******)0x0; pbVar10 = &g_xmlNullStr; if (*(byte **)((int)pvVar6 + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)pvVar6 + 4); } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); uVar2 = (int)pbVar9 - (int)(pbVar10 + 1); std::string::assign((char *)anm2Root,pbVar10,uVar2); for (pbStack_10194 = xml_node::first_node(pvVar5,&DAT_00b69f24,(int)pbVar10,(byte)uVar2); pbStack_10194 != (void *)0x0; pbStack_10194 = *(byte **)((int)pbStack_10194 + 0x2c)) { pcVar16 = "variant"; do { pcVar13 = pcVar16; pcVar16 = pcVar13 + 1; } while (*pcVar16 != '\0'); puVar14 = *(undefined4 **)((int)pbStack_10194 + 0x20); piStack_1018c = (int *)(pcVar13 + -0xb66beb); if (puVar14 != (undefined4 *)0x0) { LAB_0072eeb0: pbVar10 = (byte *)*puVar14; if (pbVar10 == (byte *)0x0) { piVar3 = (int *)0x0; pbVar10 = &g_xmlNullStr; } else { piVar3 = (int *)puVar14[2]; } if (piVar3 != piStack_1018c) goto LAB_0072efc1; pbVar9 = (byte *)((int)piVar3 + (int)pbVar10); if (pbVar10 < pbVar9) { iVar4 = (int)"variant" - (int)pbVar10; while (*pbVar10 == pbVar10[iVar4]) { pbVar10 = pbVar10 + 1; if (pbVar9 <= pbVar10) goto LAB_0072eef0; } goto LAB_0072efc1; } LAB_0072eef0: pbVar10 = &g_xmlNullStr; if ((byte *)puVar14[1] != (byte *)0x0) { pbVar10 = (byte *)puVar14[1]; } iStack_101cc = atoi((char *)pbVar10); iStack_101c8 = 0; uStack_101c4 = 0; uStack_101c0 = 0; local_14._0_1_ = 3; FUN_00731dd0(insertResult,&iStack_101cc); vector_BombCostume_tidy(&iStack_101c8); local_14._0_1_ = 1; costumeRules = insertResult[0] + 0x14; pcVar16 = "rule"; do { pcVar13 = pcVar16; pcVar16 = pcVar13 + 1; } while (*pcVar16 != '\0'); for (ruleNode = *(undefined4 **)((int)pbStack_10194 + 0x18); ruleNode != (undefined4 *)0x0; ruleNode = (undefined4 *)ruleNode[0xb]) { pbVar10 = (byte *)*ruleNode; if (pbVar10 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar10 = &g_xmlNullStr; } else { pcVar16 = (char *)ruleNode[2]; } if (pcVar16 == pcVar13 + -0xb69f6b) { pbVar9 = (byte *)(pcVar16 + (int)pbVar10); if (pbVar9 <= pbVar10) goto LAB_0072f01f; iVar4 = (int)&DAT_00b69f6c - (int)pbVar10; while (*pbVar10 == pbVar10[iVar4]) { pbVar10 = pbVar10 + 1; if (pbVar9 <= pbVar10) goto LAB_0072f01f; } } } ruleNode = (undefined4 *)0x0; LAB_0072f01f: if (ruleNode == (undefined4 *)0x0) goto LAB_0072fbe8; LAB_0072f030: puVar14 = ruleNode; includeFlagsLow = 0; includeFlagsHigh = 0; excludeFlagsLow = 0; excludeFlagsHigh = 0; bodyPathSize = 0; bodyPathCapacity = 0xf; bodyPath = (void *)0x0; local_14._0_1_ = 5; _eh_vector_constructor_iterator_ (&backPath,0x18,5,FUN_0040c380,std::string::_Tidy_deallocate); local_14._0_1_ = 6; _eh_vector_constructor_iterator_(local_88,0x18,2,FUN_0040c380,std::string::_Tidy_deallocate) ; local_14._0_1_ = 7; ruleAttribute = (undefined4 *)puVar14[8]; if (ruleAttribute != (undefined4 *)0x0) { LAB_0072f0c6: puVar14 = ruleAttribute; pbVar10 = (byte *)*ruleAttribute; pcVar16 = "includeFlags"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072f0f7: uVar2 = -(uint)isLess | 1; goto LAB_0072f0fc; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072f0f7; pbVar9 = pbVar9 + 2; pcVar16 = pcVar16 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f0fc: if (uVar2 == 0) { tmpStringSize = 0; pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } tmpStringCapacity = 0xf; tmpString = (void *)0x0; pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); std::string::assign((char *)&tmpString,pbVar10,(int)pbVar9 - (int)(pbVar10 + 1)); local_14._0_1_ = 9; piStack_1018c = (int *)((uint)cleanupFlags | 1); includeFlagTokens = (int *)0x0; includeFlagTokensEnd = (int *)0x0; includeFlagTokensCapacity = 0; cleanupFlags = piStack_1018c; string_split(&includeFlagTokens); local_14._0_1_ = 10; if (0xf < tmpStringCapacity) { uVar2 = tmpStringCapacity + 1; pvVar5 = tmpString; if (0xfff < uVar2) { pvVar5 = *(void **)((int)tmpString + -4); uVar2 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar5))) goto LAB_0072fc29; } operator_delete(pvVar5,uVar2); } piVar15 = (int *)0x0; piStack_101a0 = includeFlagTokens; piStack_1018c = (int *)(((int)includeFlagTokensEnd - (int)includeFlagTokens) / 0x18); piVar3 = includeFlagTokens; if (piStack_1018c != (int *)0x0) { do { token = piVar3; if (0xf < (uint)piVar3[5]) { token = (int *)*piVar3; } uVar2 = atoi((char *)token); if (uVar2 < 0x40) { uVar7 = 1 << (uVar2 & 0x1f); uVar11 = 0; if (0x1f < uVar2) { uVar11 = uVar7; } uVar7 = uVar7 ^ uVar11; if (0x3f < uVar2) { uVar11 = uVar7; } includeFlagsLow = CONCAT44(includeFlagsLow._4_4_ | uVar11,(uint)includeFlagsLow | uVar7); } else { uVar2 = uVar2 - 0x40; uVar7 = 1 << (uVar2 & 0x1f); uVar11 = 0; if (0x1f < uVar2) { uVar11 = uVar7; } uVar7 = uVar7 ^ uVar11; if (0x3f < uVar2) { uVar11 = uVar7; } includeFlagsHigh = CONCAT44(includeFlagsHigh._4_4_ | uVar11,(uint)includeFlagsHigh | uVar7); } piVar15 = (int *)((int)piVar15 + 1); piVar3 = piVar3 + 6; } while (piVar15 < piStack_1018c); } piVar3 = piStack_101a0; cleanupFlags = (int *)((uint)cleanupFlags & 0xfffffffe); local_14._0_1_ = 7; if (piStack_101a0 != (int *)0x0) { piVar15 = includeFlagTokensEnd; token = piStack_101a0; if (piStack_101a0 != includeFlagTokensEnd) { do { uVar2 = token[5]; if (0xf < uVar2) { pvVar5 = (void *)*token; uVar7 = uVar2 + 1; pvVar6 = pvVar5; if (0xfff < uVar7) { pvVar6 = *(void **)((int)pvVar5 + -4); uVar7 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)pvVar6))) goto LAB_0072fc29; } operator_delete(pvVar6,uVar7); piVar15 = includeFlagTokensEnd; } token[4] = 0; token[5] = 0xf; *(undefined1 *)token = 0; token = token + 6; } while (token != piVar15); } uVar2 = ((includeFlagTokensCapacity - (int)piVar3) / 0x18) * 0x18; piVar15 = piVar3; if (0xfff < uVar2) { piVar15 = (int *)piVar3[-1]; uVar2 = uVar2 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar3 + (-4 - (int)piVar15))) goto LAB_0072fc29; } operator_delete(piVar15,uVar2); includeFlagTokens = (int *)0x0; includeFlagTokensEnd = (int *)0x0; includeFlagTokensCapacity = 0; } } else { pcVar16 = "excludeFlags"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072f3c0: uVar2 = -(uint)isLess | 1; goto LAB_0072f3c5; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072f3c0; pcVar16 = pcVar16 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f3c5: if (uVar2 != 0) { attrNameCursor = &DAT_00b69efc; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < *attrNameCursor; if (bVar1 != *attrNameCursor) { LAB_0072f640: uVar2 = -(uint)isLess | 1; goto LAB_0072f645; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < attrNameCursor[1]; if (bVar1 != attrNameCursor[1]) goto LAB_0072f640; attrNameCursor = attrNameCursor + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f645: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); valueLength = (int)pbVar9 - (int)(pbVar10 + 1); if (0x7fffffff - anm2RootSize < valueLength) { LAB_0072fc88: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppppbVar8 = (byte ******)anm2Root; if (0xf < anm2RootCapacity) { ppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&tmpString,costumeRules,(std_string *)valueLength, (byte *)ppppppbVar8,anm2RootSize,pbVar10,valueLength); cleanupFlags = (int *)((uint)cleanupFlags | 4); if (0xf < bodyPathCapacity) { uVar2 = bodyPathCapacity + 1; pvVar5 = bodyPath; if (0xfff < uVar2) { pvVar5 = *(void **)((int)bodyPath + -4); uVar2 = bodyPathCapacity + 0x24; if (0x1f < (uint)((int)bodyPath + (-4 - (int)pvVar5))) goto LAB_0072fc29; } operator_delete(pvVar5,uVar2); } bodyPath = tmpString; uStack_114 = uStack_38; uStack_110 = uStack_34; uStack_10c = uStack_30; bodyPathSize = tmpStringSize; bodyPathCapacity = tmpStringCapacity; } else { attrNameCursor = &DAT_00b69f1c; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < *attrNameCursor; if (bVar1 != *attrNameCursor) { LAB_0072f726: uVar2 = -(uint)isLess | 1; goto LAB_0072f72b; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < attrNameCursor[1]; if (bVar1 != attrNameCursor[1]) goto LAB_0072f726; pbVar9 = pbVar9 + 2; attrNameCursor = attrNameCursor + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f72b: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); psVar12 = (std_string *)(pbVar9 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < psVar12) goto LAB_0072fc88; ppppppbVar8 = (byte ******)anm2Root; if (0xf < anm2RootCapacity) { ppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&tmpString,costumeRules,psVar12,(byte *)ppppppbVar8, anm2RootSize,pbVar10,(uint)psVar12); cleanupFlags = (int *)((uint)cleanupFlags | 8); std::string::_Tidy_deallocate((char *)&backPath); backPath = tmpString; uStack_fc = uStack_38; uStack_f8 = uStack_34; uStack_f4 = uStack_30; local_f0 = tmpStringSize; uStack_ec = tmpStringCapacity; } else { attrNameCursor = &DAT_00b69f14; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < *attrNameCursor; if (bVar1 != *attrNameCursor) { LAB_0072f7d8: uVar2 = -(uint)isLess | 1; goto LAB_0072f7dd; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < attrNameCursor[1]; if (bVar1 != attrNameCursor[1]) goto LAB_0072f7d8; pbVar9 = pbVar9 + 2; attrNameCursor = attrNameCursor + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f7dd: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); psVar12 = (std_string *)(pbVar9 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < psVar12) goto LAB_0072fc88; ppppppbVar8 = (byte ******)anm2Root; if (0xf < anm2RootCapacity) { ppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&tmpString,costumeRules,psVar12,(byte *)ppppppbVar8, anm2RootSize,pbVar10,(uint)psVar12); cleanupFlags = (int *)((uint)cleanupFlags | 0x10); std::string::_Tidy_deallocate((char *)&body2Path); body2Path = tmpString; uStack_e4 = uStack_38; uStack_e0 = uStack_34; uStack_dc = uStack_30; local_d8 = tmpStringSize; uStack_d4 = tmpStringCapacity; } else { pcVar16 = "front"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072f890: uVar2 = -(uint)isLess | 1; goto LAB_0072f895; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072f890; pcVar16 = pcVar16 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f895: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); psVar12 = (std_string *)(pbVar9 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < psVar12) goto LAB_0072fc88; ppppppbVar8 = (byte ******)anm2Root; if (0xf < anm2RootCapacity) { ppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&tmpString,costumeRules,psVar12, (byte *)ppppppbVar8,anm2RootSize,pbVar10,(uint)psVar12); cleanupFlags = (int *)((uint)cleanupFlags | 0x20); std::string::_Tidy_deallocate((char *)&frontPath); frontPath = tmpString; uStack_cc = uStack_38; uStack_c8 = uStack_34; uStack_c4 = uStack_30; local_c0 = tmpStringSize; uStack_bc = tmpStringCapacity; } else { pcVar16 = "front2"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072f947: uVar2 = -(uint)isLess | 1; goto LAB_0072f94c; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072f947; pbVar9 = pbVar9 + 2; pcVar16 = pcVar16 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072f94c: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); psVar12 = (std_string *)(pbVar9 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < psVar12) goto LAB_0072fc88; ppppppbVar8 = (byte ******)anm2Root; if (0xf < anm2RootCapacity) { ppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&tmpString,costumeRules,psVar12, (byte *)ppppppbVar8,anm2RootSize,pbVar10,(uint)psVar12); cleanupFlags = (int *)((uint)cleanupFlags | 0x40); std::string::_Tidy_deallocate((char *)&front2Path); front2Path = tmpString; uStack_b4 = uStack_38; uStack_b0 = uStack_34; uStack_ac = uStack_30; local_a8 = tmpStringSize; uStack_a4 = tmpStringCapacity; } else { pcVar16 = "overlay"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072fa00: uVar2 = -(uint)isLess | 1; goto LAB_0072fa05; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072fa00; pbVar9 = pbVar9 + 2; pcVar16 = pcVar16 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072fa05: if (uVar2 != 0) { pcVar16 = "suffix"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072fad1: uVar2 = -(uint)isLess | 1; goto LAB_0072fad6; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072fad1; pbVar9 = pbVar9 + 2; pcVar16 = pcVar16 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072fad6: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); std::string::assign(local_88,pbVar10,(int)pbVar9 - (int)(pbVar10 + 1)); } else { pcVar16 = "suffix2"; pbVar9 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; } do { bVar1 = *pbVar9; isLess = bVar1 < (byte)*pcVar16; if (bVar1 != *pcVar16) { LAB_0072fb37: uVar2 = -(uint)isLess | 1; goto LAB_0072fb3c; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; isLess = bVar1 < (byte)pcVar16[1]; if (bVar1 != pcVar16[1]) goto LAB_0072fb37; pbVar9 = pbVar9 + 2; pcVar16 = pcVar16 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0072fb3c: if (uVar2 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); std::string::assign(local_70,pbVar10,(int)pbVar9 - (int)(pbVar10 + 1)) ; } } goto LAB_0072f340; } pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); psVar12 = (std_string *)(pbVar9 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - anm2RootSize) < psVar12) goto LAB_0072fc88; ppppppbVar8 = (byte ******)anm2Root; if (0xf < anm2RootCapacity) { ppppppbVar8 = anm2Root[0]; } std::string::concat((char *)&tmpString,costumeRules,psVar12, (byte *)ppppppbVar8,anm2RootSize,pbVar10,(uint)psVar12); cleanupFlags = (int *)((uint)cleanupFlags | 0x80); std::string::_Tidy_deallocate((char *)&overlayPath); overlayPath = tmpString; uStack_9c = uStack_38; uStack_98 = uStack_34; uStack_94 = uStack_30; local_90 = tmpStringSize; uStack_8c = tmpStringCapacity; } } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString = (void *)((uint)tmpString & 0xffffff00); std::string::_Tidy_deallocate((char *)&tmpString); } } } goto LAB_0072f340; } tmpStringSize = 0; pbVar10 = &g_xmlNullStr; if ((byte *)ruleAttribute[1] != (byte *)0x0) { pbVar10 = (byte *)ruleAttribute[1]; } tmpStringCapacity = 0xf; tmpString = (void *)0x0; pbVar9 = pbVar10; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); std::string::assign((char *)&tmpString,pbVar10,(int)pbVar9 - (int)(pbVar10 + 1)); local_14._0_1_ = 0xc; piStack_1018c = (int *)((uint)cleanupFlags | 2); excludeFlagTokens = (int *)0x0; excludeFlagTokensEnd = (int *)0x0; excludeFlagTokensCapacity = 0; cleanupFlags = piStack_1018c; string_split(&excludeFlagTokens); local_14._0_1_ = 0xd; if (0xf < tmpStringCapacity) { uVar2 = tmpStringCapacity + 1; pvVar5 = tmpString; if (0xfff < uVar2) { pvVar5 = *(void **)((int)tmpString + -4); uVar2 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar5))) goto LAB_0072fc29; } operator_delete(pvVar5,uVar2); } piVar15 = (int *)0x0; piStack_1018c = excludeFlagTokens; piStack_101a0 = (int *)(((int)excludeFlagTokensEnd - (int)excludeFlagTokens) / 0x18); piVar3 = excludeFlagTokens; if (piStack_101a0 != (int *)0x0) { do { token = piVar3; if (0xf < (uint)piVar3[5]) { token = (int *)*piVar3; } uVar2 = atoi((char *)token); if (uVar2 < 0x40) { uVar7 = 1 << (uVar2 & 0x1f); uVar11 = 0; if (0x1f < uVar2) { uVar11 = uVar7; } uVar7 = uVar7 ^ uVar11; if (0x3f < uVar2) { uVar11 = uVar7; } excludeFlagsLow = CONCAT44(excludeFlagsLow._4_4_ | uVar11,(uint)excludeFlagsLow | uVar7); } else { uVar2 = uVar2 - 0x40; uVar7 = 1 << (uVar2 & 0x1f); uVar11 = 0; if (0x1f < uVar2) { uVar11 = uVar7; } uVar7 = uVar7 ^ uVar11; if (0x3f < uVar2) { uVar11 = uVar7; } excludeFlagsHigh = CONCAT44(excludeFlagsHigh._4_4_ | uVar11,(uint)excludeFlagsHigh | uVar7); } piVar15 = (int *)((int)piVar15 + 1); piVar3 = piVar3 + 6; } while (piVar15 < piStack_101a0); } piVar3 = piStack_1018c; cleanupFlags = (int *)((uint)cleanupFlags & 0xfffffffd); local_14._0_1_ = 7; if (piStack_1018c != (int *)0x0) { piVar15 = excludeFlagTokensEnd; token = piStack_1018c; if (piStack_1018c != excludeFlagTokensEnd) { do { uVar2 = token[5]; if (0xf < uVar2) { pvVar5 = (void *)*token; uVar7 = uVar2 + 1; pvVar6 = pvVar5; if (0xfff < uVar7) { pvVar6 = *(void **)((int)pvVar5 + -4); uVar7 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)pvVar6))) goto LAB_0072fc29; } operator_delete(pvVar6,uVar7); piVar15 = excludeFlagTokensEnd; } token[4] = 0; token[5] = 0xf; *(char *)token = '\0'; token = token + 6; } while (token != piVar15); } uVar2 = ((excludeFlagTokensCapacity - (int)piVar3) / 0x18) * 0x18; piVar15 = piVar3; if (0xfff < uVar2) { piVar15 = (int *)piVar3[-1]; uVar2 = uVar2 + 0x23; if ((char *)0x1f < (char *)((int)piVar3 + (-4 - (int)piVar15))) goto LAB_0072fc29; } operator_delete(piVar15,uVar2); excludeFlagTokens = (int *)0x0; excludeFlagTokensEnd = (int *)0x0; excludeFlagTokensCapacity = 0; } } puVar14 = ruleAttribute; LAB_0072f340: if ((puVar14[4] == 0) || (ruleAttribute = (undefined4 *)puVar14[6], ruleAttribute == (undefined4 *)0x0)) goto LAB_0072f357; goto LAB_0072f0c6; } goto LAB_0072f35d; } LAB_0072fbe8: } local_14._0_1_ = 0; if (0xf < anm2RootCapacity) { uVar2 = anm2RootCapacity + 1; ppppppbVar8 = anm2Root[0]; if (0xfff < uVar2) { ppppppbVar8 = (byte ******)anm2Root[0][-1]; uVar2 = anm2RootCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)anm2Root[0] + (-4 - (int)ppppppbVar8))) { LAB_0072fc29: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar8,uVar2); } local_14 = (byte *****)0xf; xml_memory_pool::clear(auStack_10150); local_14 = (byte *****)0x10; tracked_alloc(1,fileBuffer,0); bVar1 = 1; } ExceptionList = local_1c; return bVar1; LAB_0072efc1: puVar14 = (undefined4 *)puVar14[6]; if (puVar14 == (undefined4 *)0x0) goto LAB_0072fbe8; goto LAB_0072eeb0; LAB_0072f357: puVar14 = ruleNode; LAB_0072f35d: iVar4 = costumeRules; if (*(int *)(costumeRules + 4) == *(int *)(costumeRules + 8)) { std::vector<224byte>::_Emplace_reallocate(*(int *)(costumeRules + 4),&includeFlagsLow); } else { FUN_007312c0(); *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 0xe0; } local_14._0_1_ = 0xe; _eh_vector_destructor_iterator_(local_88,0x18,2,std::string::_Tidy_deallocate); _eh_vector_destructor_iterator_(&backPath,0x18,5,std::string::_Tidy_deallocate); if (0xf < bodyPathCapacity) { uVar2 = bodyPathCapacity + 1; pvVar5 = bodyPath; if (0xfff < uVar2) { pvVar5 = *(void **)((int)bodyPath + -4); uVar2 = bodyPathCapacity + 0x24; if (0x1f < (uint)((int)bodyPath + (-4 - (int)pvVar5))) goto LAB_0072fc29; } operator_delete(pvVar5,uVar2); } ruleNode = (undefined4 *)puVar14[0xb]; if (ruleNode == (undefined4 *)0x0) goto LAB_0072fbe8; goto LAB_0072f030; } //@@ 0072fc90 FUN_0072fc90 void FUN_0072fc90(void) { int in_ECX; vector_BombCostume_tidy((void *)(in_ECX + 4)); return; } //@@ 0072fca0 FUN_0072fca0 void FUN_0072fca0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_((void *)(in_ECX + 0xb0),0x18,2,std::string::_Tidy_deallocate); _eh_vector_destructor_iterator_((void *)(in_ECX + 0x38),0x18,5,std::string::_Tidy_deallocate); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); ExceptionList = local_10; return; } //@@ 0072fd10 ItemConfig::GetCollectible /* ZHL [exact] __thiscall ItemConfig_Item* ItemConfig::GetCollectible(int id); prototype: REPENTOGON, confirmed by RET 4 */ ItemConfig_Item * __thiscall ItemConfig::GetCollectible(ItemConfig *this,int id) { void *pvVar1; if (g_game == (Game *)0x0) { if (id < 0) { return (ItemConfig_Item *)0x0; } } else if (id < 0) { pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin; if (~id < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2) { return (ItemConfig_Item *)**(undefined4 **)((int)pvVar1 + ~id * 4); } return (ItemConfig_Item *)0x0; } pvVar1 = (this->_collectibles)._begin; if (id < (int)(this->_collectibles)._end - (int)pvVar1 >> 2) { return *(ItemConfig_Item **)((int)pvVar1 + id * 4); } return (ItemConfig_Item *)0x0; } //@@ 0072fd70 ItemConfig::GetTrinket /* ZHL [exact] __thiscall ItemConfig_Item* ItemConfig::GetTrinket(unsigned int TrinketType); prototype: REPENTOGON, confirmed by RET 4 */ ItemConfig_Item * __thiscall ItemConfig::GetTrinket(ItemConfig *this,uint TrinketType) { void *pvVar1; pvVar1 = (this->_trinkets)._begin; if ((int)(TrinketType & 0x7fff) < (int)(this->_trinkets)._end - (int)pvVar1 >> 2) { return *(ItemConfig_Item **)((int)pvVar1 + (TrinketType & 0x7fff) * 4); } return (ItemConfig_Item *)0x0; } //@@ 0072fda0 Config::GetNullItem /* ZHL [lua] Lua binding Config:GetNullItem prototype: db/protos.zhl, confirmed by RET 4 */ ItemConfig_Item * __thiscall Config::GetNullItem(void *this,int id) { if ((id < 0) || (*(int *)((int)this + 0x1c) - *(int *)((int)this + 0x18) >> 2 <= id)) { return (ItemConfig_Item *)0x0; } return *(ItemConfig_Item **)(*(int *)((int)this + 0x18) + id * 4); } //@@ 0072fdd0 Config::GetPillEffect /* ZHL [lua] Lua binding Config:GetPillEffect */ undefined4 Config::GetPillEffect(int param_1) { int in_ECX; if ((param_1 < 0) || (*(int *)(in_ECX + 0x34) - *(int *)(in_ECX + 0x30) >> 2 <= param_1)) { return 0; } return *(undefined4 *)(*(int *)(in_ECX + 0x30) + param_1 * 4); } //@@ 0072fe00 ItemConfig::GetCard /* ZHL [exact] __thiscall ItemConfig_Card* ItemConfig::GetCard(int id); prototype: REPENTOGON, confirmed by RET 4 */ ItemConfig_Card * __thiscall ItemConfig::GetCard(ItemConfig *this,int id) { void *pvVar1; if ((id < 0) || (pvVar1 = (this->_cards)._begin, (int)(this->_cards)._end - (int)pvVar1 >> 2 <= id)) { return (ItemConfig_Card *)0x0; } return *(ItemConfig_Card **)((int)pvVar1 + id * 4); } //@@ 0072fe30 ItemConfig::IsValidCollectible /* ZHL [exact] static cleanup bool ItemConfig::IsValidCollectible(int CollectibleType); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte __cdecl ItemConfig::IsValidCollectible(int collectibleType) { ItemConfig_Item *pIVar1; if ((((collectibleType != 0) && (collectibleType < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2)) && (collectibleType != 0xeb)) && ((collectibleType != 0x2b && (collectibleType != 0x3d)))) { pIVar1 = GetCollectible(&g_manager->_itemConfig,collectibleType); if (pIVar1 != (ItemConfig_Item *)0x0) { return 1; } } return 0; } //@@ 0072fe80 FUN_0072fe80 uint FUN_0072fe80(uint param_1,uint param_2) { ItemConfig_Item *pIVar1; uint uVar2; int in_ECX; pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,in_ECX); uVar2 = 0; if ((pIVar1 == (ItemConfig_Item *)0x0) || (uVar2 = *(uint *)((int)&pIVar1->tags + 4) & param_2, (param_1 & (uint)pIVar1->tags) == 0 && uVar2 == 0)) { return uVar2 & 0xffffff00; } return CONCAT31((int3)(uVar2 >> 8),1); } //@@ 0072fec0 FUN_0072fec0 uint FUN_0072fec0(uint param_1,uint param_2) { void *pvVar1; int iVar2; uint uVar3; uint in_ECX; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; uVar3 = (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2; if ((((int)(in_ECX & 0x7fff) < (int)uVar3) && (iVar2 = *(int *)((int)pvVar1 + (in_ECX & 0x7fff) * 4), uVar3 = 0, iVar2 != 0)) && (uVar3 = *(uint *)(iVar2 + 0xbc) & param_2, (param_1 & *(uint *)(iVar2 + 0xb8)) != 0 || uVar3 != 0)) { return CONCAT31((int3)(uVar3 >> 8),1); } return uVar3 & 0xffffff00; } //@@ 0072ff10 ItemConfig_Item::GetLocalizedName /* DB: "#" prefixed name looked up in "Items" string table for language (0x14 = current); used by AddCostume/console prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall ItemConfig_Item::GetLocalizedName(ItemConfig_Item *this,std_string *outName,int language) { StringTable *this_00; char *pcVar1; std_string *text; std_string *psVar2; int language_00; if ((this->name)._size == 0) { outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; outName->_size = 0; outName->_buf[0] = '\0'; return outName; } language_00 = language; if (language == 0x14) { language_00 = *(int *)&g_manager->_stringTable; } text = &this->name; if (0xf < (this->name)._capacity) { text = *(std_string **)text->_buf; } this_00 = &g_manager->_stringTable; if (text->_buf[0] == '#') { language = language & 0xffffff; StringTable::get_string (this_00,(byte *)"Items",language_00,(byte *)(text->_buf + 1), (byte *)((int)&language + 3)); if (language._3_1_ == '\0') { language = language & 0xffffff; text = (std_string *) StringTable::get_string (this_00,(byte *)"Items",language_00,(byte *)(text->_buf + 1), (byte *)((int)&language + 3)); } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; psVar2 = text; do { pcVar1 = psVar2->_buf; psVar2 = (std_string *)(psVar2->_buf + 1); } while (*pcVar1 != '\0'); std::string::assign(outName->_buf,(byte *)text,(int)psVar2 - (int)(text->_buf + 1)); return outName; } //@@ 0072fff0 ItemConfig_Item::get_localized_description /* DB: returns std::string from ECX+0x20 (ItemConfig_Item desc, Lua Item.Description field+0x20); if it starts with '#' resolves via StringTable::get_string("Items", language, key); empty if size(+0x30)==0; HUD::ShowItemText, PlayerHUD::RenderPocketItems prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall ItemConfig_Item::get_localized_description (ItemConfig_Item *this,std_string *outDescription,int unused) { int language; char *pcVar1; Manager *pMVar2; std_string *text; std_string *psVar3; byte local_5; pMVar2 = g_manager; if ((this->desc)._size == 0) { outDescription->_buf[0] = '\0'; outDescription->_buf[1] = '\0'; outDescription->_buf[2] = '\0'; outDescription->_buf[3] = '\0'; outDescription->_size = 0; outDescription->_capacity = 0xf; outDescription->_buf[0] = '\0'; outDescription->_size = 0; outDescription->_buf[0] = '\0'; return outDescription; } text = &this->desc; language = *(int *)&g_manager->_stringTable; if (0xf < (this->desc)._capacity) { text = *(std_string **)text->_buf; } if (text->_buf[0] == '#') { local_5 = 0; StringTable::get_string (&g_manager->_stringTable,(byte *)"Items",language,(byte *)(text->_buf + 1),&local_5); if (local_5 == 0) { local_5 = 0; text = (std_string *) StringTable::get_string (&pMVar2->_stringTable,(byte *)"Items",language,(byte *)(text->_buf + 1), &local_5); } } outDescription->_buf[0] = '\0'; outDescription->_buf[1] = '\0'; outDescription->_buf[2] = '\0'; outDescription->_buf[3] = '\0'; outDescription->_size = 0; outDescription->_capacity = 0xf; outDescription->_buf[0] = '\0'; psVar3 = text; do { pcVar1 = psVar3->_buf; psVar3 = (std_string *)(psVar3->_buf + 1); } while (*pcVar1 != '\0'); std::string::assign(outDescription->_buf,(byte *)text,(int)psVar3 - (int)(text->_buf + 1)); return outDescription; } //@@ 007300d0 Item::IsAvailable /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ItemConfig item `this`; flags 1 tag/mode filters, 2 achievement unlocked, 4 character filters (Tainted Lost offensive/quality), 8 mod callbacks (characters-8) prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Item::IsAvailable(void *this,uint flags) { undefined4 *puVar1; uint *puVar2; uint *puVar3; Manager *pMVar4; char cVar5; byte bVar6; Entity_Player *pEVar7; int iVar8; uint uVar9; int iVar10; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; void *pvVar11; Game *pGVar12; PlayerManager *this_00; RNG local_1c; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (*(char *)((int)this + 0xb3) != '\0') { return 0; } if ((g_game != (Game *)0x0) && (1 < *(int *)&g_game->_deathmatchManager)) { iVar8 = *(int *)this; if (((iVar8 == 1) || ((iVar8 == 3 || (iVar8 == 4)))) && (cVar5 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x30)) (*(undefined4 *)((int)this + 4)), cVar5 != '\0')) { return 0; } if ((*(int *)this == 2) && (cVar5 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x2c)) (*(undefined4 *)((int)this + 4)), cVar5 != '\0')) { return 0; } } pMVar4 = g_manager; if (((flags & 8) != 0) && (pvVar11 = (g_manager->_itemConfig)._availabilityFilters._end, (g_manager->_itemConfig)._availabilityFilters._begin != pvVar11)) { do { puVar1 = (undefined4 *)((int)pvVar11 + -4); pvVar11 = (void *)((int)pvVar11 + -4); cVar5 = (*(code *)*puVar1)(this); if (cVar5 == '\0') { return 0; } } while (pvVar11 != (pMVar4->_itemConfig)._availabilityFilters._begin); } if (g_game == (Game *)0x0) goto LAB_00730653; pGVar12 = g_game; if ((flags & 1) != 0) { iVar8 = *(int *)this; if (((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) { if (g_game->_challenge == 0x1d) { iVar8 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar8 + 0xc) < DAT_00c80fe0) && (_Init_thread_header(&DAT_00c80fe0), iVar8 = extraout_ECX, DAT_00c80fe0 == -1)) { DAT_00c80fe4 = 0; _DAT_00c80fe8 = 0; _DAT_00c80fec = 0; DAT_00c80ff0 = 0; _atexit((_func_4879 *)&LAB_00b15ab0); _Init_thread_footer(&DAT_00c80fe0); iVar8 = extraout_ECX_00; } if (DAT_00c80ff0 == 0) { vector_bool_resize(&DAT_00c80fe4,0x2dd,(byte)iVar8); uVar9 = 0; do { puVar2 = (uint *)((int)&DAT_00b69580 + uVar9); uVar9 = uVar9 + 4; puVar3 = (uint *)(DAT_00c80fe4 + (*puVar2 >> 5) * 4); *puVar3 = *puVar3 | 1 << ((byte)*puVar2 & 0x1f); } while (uVar9 < 0x3c); } uVar9 = *(uint *)((int)this + 4); if (((-1 < (int)uVar9) && ((int)uVar9 < DAT_00c80ff0)) && ((*(uint *)(DAT_00c80fe4 + (uVar9 >> 5) * 4) & 1 << ((byte)uVar9 & 0x1f)) != 0)) { return 0; } } pGVar12 = g_game; bVar6 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (bVar6 != 0) { iVar8 = *(int *)ThreadLocalStoragePointer; if (*(int *)(iVar8 + 0xc) < DAT_00c80ff4) { _Init_thread_header(&DAT_00c80ff4); iVar8 = extraout_ECX_01; if (DAT_00c80ff4 == -1) { DAT_00c80ff8 = 0; _DAT_00c80ffc = 0; _DAT_00c81000 = 0; DAT_00c81004 = 0; _atexit((_func_4879 *)&LAB_00b15aa0); _Init_thread_footer(&DAT_00c80ff4); iVar8 = extraout_ECX_02; } pGVar12 = g_game; } if (DAT_00c81004 == 0) { vector_bool_resize(&DAT_00c80ff8,0x2dd,(byte)iVar8); uVar9 = 0; do { puVar2 = (uint *)((int)&DAT_00b69580 + uVar9); uVar9 = uVar9 + 4; puVar3 = (uint *)(DAT_00c80ff8 + (*puVar2 >> 5) * 4); *puVar3 = *puVar3 | 1 << ((byte)*puVar2 & 0x1f); } while (uVar9 < 0x3c); pGVar12 = g_game; } uVar9 = *(uint *)((int)this + 4); if (((-1 < (int)uVar9) && ((int)uVar9 < DAT_00c81004)) && ((*(uint *)(DAT_00c80ff8 + (uVar9 >> 5) * 4) & 1 << ((byte)uVar9 & 0x1f)) != 0)) { return 0; } } if ((pGVar12->_dailyChallenge)._specialDailyId == 0x34) { iVar8 = *(int *)ThreadLocalStoragePointer; if (*(int *)(iVar8 + 0xc) < DAT_00c81008) { _Init_thread_header(&DAT_00c81008); iVar8 = extraout_ECX_03; if (DAT_00c81008 == -1) { DAT_00c8100c = 0; _DAT_00c81010 = 0; _DAT_00c81014 = 0; DAT_00c81018 = 0; _atexit((_func_4879 *)&LAB_00b15a90); _Init_thread_footer(&DAT_00c81008); iVar8 = extraout_ECX_04; } pGVar12 = g_game; } if (DAT_00c81018 == 0) { vector_bool_resize(&DAT_00c8100c,0x2dd,(byte)iVar8); uVar9 = 0; do { puVar2 = (uint *)((int)&DAT_00b695c0 + uVar9); uVar9 = uVar9 + 4; puVar3 = (uint *)(DAT_00c8100c + (*puVar2 >> 5) * 4); *puVar3 = *puVar3 | 1 << (*puVar2 & 0x1f); } while (uVar9 < 0x40); pGVar12 = g_game; } uVar9 = *(uint *)((int)this + 4); if (((-1 < (int)uVar9) && ((int)uVar9 < DAT_00c81018)) && ((*(uint *)(DAT_00c8100c + (uVar9 >> 5) * 4) & 1 << ((byte)uVar9 & 0x1f)) != 0)) { return 0; } } LAB_007303fd: if (pGVar12->_challenge != 0) goto LAB_00730406; } else { if ((iVar8 != 2) || (g_game->_challenge != 0x29)) goto LAB_007303fd; if (*(int *)((int)this + 4) == 0x7a) { return 0; } LAB_00730406: if ((*(uint *)((int)this + 0xb8) & 0x10000000) != 0) { return 0; } } if (((pGVar12->_dailyChallenge)._id != 0) && ((*(uint *)((int)this + 0xb8) & 0x20000000) != 0)) { return 0; } if (((pGVar12->_difficulty == 2) || (pGVar12->_difficulty == 3)) && ((*(uint *)((int)this + 0xb8) & 0x20000) != 0)) { return 0; } } if ((flags & 4) != 0) { iVar8 = *(int *)this; if (((((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) && ((pGVar12->_difficulty != 2 && (pGVar12->_difficulty != 3)))) && ((6 < pGVar12->_stage && (*(int *)((int)this + 4) == 0x2b9)))) { return 0; } this_00 = &pGVar12->_playerManager; pEVar7 = PlayerManager::FirstPlayerByType(this_00,0xe); if (((pEVar7 != (Entity_Player *)0x0) || (pEVar7 = PlayerManager::FirstPlayerByType(this_00,0x21), pEVar7 != (Entity_Player *)0x0)) && ((*(uint *)((int)this + 0xb8) & 0x200000) != 0)) { return 0; } pEVar7 = PlayerManager::FirstBirthrightOwner(this_00,10); pGVar12 = g_game; if ((pEVar7 != (Entity_Player *)0x0) && ((*(uint *)((int)this + 0xb8) & 0x400000) != 0)) { return 0; } iVar8 = *(int *)this; if (((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) { pEVar7 = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x1f); if (pEVar7 != (Entity_Player *)0x0) { if ((*(uint *)((int)this + 0xb8) & 0x100000) == 0) { return 0; } if (*(int *)((int)this + 0xc0) < 2) { iVar8 = Seeds::GetStartSeed(); cVar5 = IsCollectible(); local_1c._shift1 = 3; local_1c._shift2 = 1; iVar10 = 1000; if (cVar5 != '\0') { iVar10 = 0; } local_1c._shift3 = 0xe; local_1c._seed = 1; if (iVar10 + iVar8 + *(int *)((int)this + 4) != 0) { local_1c._seed = iVar10 + iVar8; } local_1c._seed = local_1c._seed + *(int *)((int)this + 4); uVar9 = RNG::RandomInt(&local_1c,5); if (uVar9 == 0) { return 0; } pGVar12 = g_game; } } pEVar7 = PlayerManager::FirstCollectibleOwner (&pGVar12->_playerManager,0x2b3,(RNG **)&pGVar12->_playerManager,1); if (pEVar7 != (Entity_Player *)0x0) { if (*(int *)((int)this + 0xc0) < 2) { return 0; } if (*(int *)((int)this + 0xc0) == 2) { iVar8 = Seeds::GetStartSeed(); cVar5 = IsCollectible(); iVar10 = 1000; local_1c._shift1 = 3; local_1c._shift2 = 3; if (cVar5 != '\0') { iVar10 = 0; } local_1c._shift3 = 0x1a; local_1c._seed = 1; if (iVar8 + iVar10 + *(int *)((int)this + 4) != 0) { local_1c._seed = iVar8 + iVar10; } local_1c._seed = local_1c._seed + *(int *)((int)this + 4); uVar9 = RNG::RandomInt(&local_1c,3); if (uVar9 == 0) { return 0; } } } iVar8 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x58); if ((1 < iVar8) && (*(int *)((int)this + 0xc0) == 0)) { return 0; } } } LAB_00730653: if ((((flags & 2) == 0) || (*(int *)((int)this + 0x50) < 0)) || (bVar6 = PersistentGameData::Unlocked (&g_manager->_persistentGameData,*(int *)((int)this + 0x50)), bVar6 != 0)) { return 1; } return 0; } //@@ 007307b0 ItemConfig_Item::is_mom_item /* DB: ids 29,30,31,55,110,114,199,200,217,228,355,508,732 */ uint ItemConfig_Item::is_mom_item(void) { uint uVar1; uint uVar2; uint *in_ECX; uVar2 = *in_ECX; if (((uVar2 != 1) && (uVar2 != 3)) && (uVar2 != 4)) { switchD_007307de_caseD_20: return uVar2 & 0xffffff00; } uVar1 = in_ECX[1]; uVar2 = uVar1; if ((int)uVar1 < 0x164) { if (uVar1 != 0x163) { uVar2 = 0; switch(uVar1) { case 0x1d: case 0x1e: case 0x1f: case 0x37: case 0x6e: case 0x72: case 199: case 200: case 0xd9: case 0xe4: break; default: goto switchD_007307de_caseD_20; } } } else if ((uVar1 != 0x1fc) && (uVar1 != 0x2dc)) goto switchD_007307de_caseD_20; return CONCAT31((int3)(uVar2 >> 8),1); } //@@ 007308d0 FUN_007308d0 undefined4 FUN_007308d0(void) { int *in_ECX; if ((*in_ECX == 3) && ((in_ECX[1] == 0x28f || (in_ECX[1] == 0x146)))) { return 2; } if ((in_ECX[0x2b] == 1) || ((in_ECX[0x2b] == 2 && (0xc < in_ECX[0x1d])))) { return 1; } return 0; } //@@ 00730910 FUN_00730910 uint FUN_00730910(void) { int iVar1; ItemConfig_Item *pIVar2; ItemConfig_Item *pIVar3; ItemConfig_Item *pIVar4; int in_ECX; pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,in_ECX); if ((pIVar3 == (ItemConfig_Item *)0x0) || (((iVar1 = pIVar3->type, iVar1 != 1 && (iVar1 != 3)) && (iVar1 != 4)))) { switchD_0073095b_caseD_2b: return (uint)pIVar3 & 0xffffff00; } pIVar2 = (ItemConfig_Item *)pIVar3->id; if (0x200 < (int)pIVar2) { pIVar3 = (ItemConfig_Item *)0x0; pIVar4 = pIVar3; switch(pIVar2) { case (ItemConfig_Item *)0x25c: case (ItemConfig_Item *)0x26f: case (ItemConfig_Item *)0x27e: case (ItemConfig_Item *)0x2c5: case (ItemConfig_Item *)0x2c6: case (ItemConfig_Item *)0x2d8: case (ItemConfig_Item *)0x2d9: goto switchD_0073095b_caseD_2a; default: goto switchD_0073095b_caseD_2b; } } pIVar4 = pIVar2; if (pIVar2 != (ItemConfig_Item *)0x200) { if ((int)pIVar2 < 0x122) { if (pIVar2 != (ItemConfig_Item *)0x121) { pIVar3 = (ItemConfig_Item *)0x0; pIVar4 = pIVar3; switch(pIVar2) { case (ItemConfig_Item *)0x2a: case (ItemConfig_Item *)0x2f: case (ItemConfig_Item *)0x31: case (ItemConfig_Item *)0xa4: break; default: goto switchD_0073095b_caseD_2b; } } } else { pIVar4 = (ItemConfig_Item *)0x0; if ((pIVar2 != (ItemConfig_Item *)0x152) && (pIVar4 = (ItemConfig_Item *)0x0, pIVar2 != (ItemConfig_Item *)0x160)) { pIVar3 = (ItemConfig_Item *)((int)&pIVar2[-2].name._size + 2); pIVar4 = (ItemConfig_Item *)0x0; if (pIVar3 != (ItemConfig_Item *)0x0) goto switchD_0073095b_caseD_2b; } } } switchD_0073095b_caseD_2a: return CONCAT31((int3)((uint)pIVar4 >> 8),1); } //@@ 00730aa0 Card::IsAvailable /* ZHL [lua] Lua binding Card:IsAvailable */ uint Card::IsAvailable(void) { Game *pGVar1; byte bVar2; Entity_Player *achievementID; undefined3 extraout_var; int *in_ECX; pGVar1 = g_game; if (g_game != (Game *)0x0) { if (((char)in_ECX[0x14] == '\0') && ((achievementID = (Entity_Player *)g_game->_difficulty, achievementID == (Entity_Player *)0x2 || (achievementID == (Entity_Player *)0x3)))) goto LAB_00730af6; if (*in_ECX == 0x2e) { achievementID = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x13); if (achievementID != (Entity_Player *)0x0) goto LAB_00730af6; } if (1 < *(int *)&pGVar1->_deathmatchManager) { achievementID = (Entity_Player *) (**(code **)(*(int *)(pGVar1->_deathmatchManager)._type + 0x24))(*in_ECX); if ((char)achievementID != '\0') goto LAB_00730af6; } } achievementID = (Entity_Player *)in_ECX[1]; if (-1 < (int)achievementID) { bVar2 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,(int)achievementID); achievementID = (Entity_Player *)CONCAT31(extraout_var,bVar2); if (bVar2 == 0) { LAB_00730af6: return (uint)achievementID & 0xffffff00; } } return CONCAT31((int3)((uint)achievementID >> 8),1); } //@@ 00730b20 PillEffect::IsAvailable /* ZHL [lua] Lua binding PillEffect:IsAvailable */ uint PillEffect::IsAvailable(void) { byte bVar1; uint achievementID; undefined3 extraout_var; undefined4 *in_ECX; if (g_game != (Game *)0x0) { if ((*(char *)(in_ECX + 0xe) == '\0') && ((achievementID = g_game->_difficulty, achievementID == 2 || (achievementID == 3)))) goto LAB_00730b5f; if (1 < *(int *)&g_game->_deathmatchManager) { achievementID = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x28))(*in_ECX); if ((char)achievementID != '\0') goto LAB_00730b5f; } } achievementID = in_ECX[1]; if (-1 < (int)achievementID) { bVar1 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,achievementID); achievementID = CONCAT31(extraout_var,bVar1); if (bVar1 == 0) { LAB_00730b5f: return achievementID & 0xffffff00; } } return CONCAT31((int3)(achievementID >> 8),1); } //@@ 00730b80 ItemConfig::GetTaggedItems /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall vector_ItemPtr& ItemConfig::GetTaggedItems(unsigned long long tags); prototype: REPENTOGON, confirmed by RET 8 */ void * __thiscall ItemConfig::GetTaggedItems(ItemConfig *this,ulonglong tags) { int *piVar1; undefined4 *allocBlock; uint lowMask; void *pvVar2; uint highMask; int iVar3; uint uVar4; qword *allocatedBytes; undefined4 *result; qword oldAllocatedBytes; int *resultEnd; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c8101c) && (_Init_thread_header(&DAT_00c8101c), DAT_00c8101c == -1)) { _atexit((_func_4879 *)&LAB_00b15ac0); _Init_thread_footer(&DAT_00c8101c); } _DAT_00c81024 = DAT_00c81020; if (tags == 0) { return &DAT_00c81020; } iVar3 = 1; uVar4 = (uint)tags; if ((uint)tags == 0) { iVar3 = 0x21; uVar4 = tags._4_4_; } if ((uVar4 & 0xffff) == 0) { uVar4 = uVar4 >> 0x10; iVar3 = iVar3 + 0x10; } if ((uVar4 & 0xff) == 0) { uVar4 = uVar4 >> 8; iVar3 = iVar3 + 8; } if ((uVar4 & 0xf) == 0) { uVar4 = uVar4 >> 4; iVar3 = iVar3 + 4; } if ((uVar4 & 3) == 0) { iVar3 = iVar3 + 2; uVar4 = uVar4 >> 2; } uVar4 = iVar3 - (uVar4 & 1); if ((int)uVar4 < 0x20) { lowMask = 1 << (uVar4 & 0x1f); highMask = 0; if (0x1f < uVar4) { highMask = lowMask; } lowMask = lowMask ^ highMask; if (0x3f < uVar4) { highMask = lowMask; } if (tags == CONCAT44(highMask,lowMask)) { pvVar2 = *(void **)((int)this + uVar4 * 4 + 0x84); if (pvVar2 != (void *)0x0) { _DAT_00c81024 = DAT_00c81020; return pvVar2; } if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } allocBlock = malloc(0x10); if (allocBlock == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { oldAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes + 0x10; *allocBlock = 0x10; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) + (uint)(0xffffffef < (uint)oldAllocatedBytes); result = allocBlock + 1; if (result != (undefined4 *)0x0) { *result = 0; allocBlock[2] = 0; allocBlock[3] = 0; *(undefined4 **)((int)this + uVar4 * 4 + 0x84) = result; goto LAB_00730cd6; } } result = (undefined4 *)0x0; *(undefined4 *)((int)this + uVar4 * 4 + 0x84) = 0; goto LAB_00730cd6; } } result = &DAT_00c81020; LAB_00730cd6: uVar4 = 0; pvVar2 = (this->_collectibles)._begin; if ((int)(this->_collectibles)._end - (int)pvVar2 >> 2 != 0) { do { iVar3 = *(int *)((int)pvVar2 + uVar4 * 4); if ((iVar3 != 0) && (((uint)tags & *(uint *)(iVar3 + 0xb8)) != 0 || (*(uint *)(iVar3 + 0xbc) & tags._4_4_) != 0 )) { piVar1 = (int *)result[1]; if (piVar1 == (int *)result[2]) { std::vector::_Emplace_reallocate(piVar1,(void *)((int)pvVar2 + uVar4 * 4)); } else { *piVar1 = iVar3; result[1] = result[1] + 4; } } uVar4 = uVar4 + 1; pvVar2 = (this->_collectibles)._begin; } while (uVar4 < (uint)((int)(this->_collectibles)._end - (int)pvVar2 >> 2)); } uVar4 = 0; pvVar2 = (this->_trinkets)._begin; if ((int)(this->_trinkets)._end - (int)pvVar2 >> 2 != 0) { do { piVar1 = (int *)((int)pvVar2 + uVar4 * 4); iVar3 = *piVar1; if ((iVar3 != 0) && (((uint)tags & *(uint *)(iVar3 + 0xb8)) != 0 || (*(uint *)(iVar3 + 0xbc) & tags._4_4_) != 0 )) { resultEnd = (int *)result[1]; if (resultEnd == (int *)result[2]) { std::vector::_Emplace_reallocate(resultEnd,piVar1); } else { *resultEnd = iVar3; result[1] = result[1] + 4; } } uVar4 = uVar4 + 1; pvVar2 = (this->_trinkets)._begin; } while (uVar4 < (uint)((int)(this->_trinkets)._end - (int)pvVar2 >> 2)); } return result; } //@@ 00730de0 FUN_00730de0 void FUN_00730de0(undefined4 param_1) { undefined4 *puVar1; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 0x108); if (puVar1 == *(undefined4 **)(in_ECX + 0x10c)) { std::vector<4byte>::_Emplace_reallocate(puVar1,¶m_1); return; } *puVar1 = param_1; *(int *)(in_ECX + 0x108) = *(int *)(in_ECX + 0x108) + 4; return; } //@@ 00730e20 FUN_00730e20 void FUN_00730e20(void) { int in_ECX; *(int *)(in_ECX + 0x108) = *(int *)(in_ECX + 0x108) + -4; return; } //@@ 00730e30 vector_BombCostume_tidy /* DB: ? std::vector _Tidy for 0xe0-byte elements (destroy range FUN_00731b00, deallocate, zero begin/end/cap); used by ItemConfig::LoadBombCostumes on its per-entry rule vector; same pattern as vector_LevelGenerator_Room_tidy 007527b0 prototype: db/protos.zhl */ void __thiscall vector_BombCostume_tidy(void *this) { void *pvVar1; uint size; void *ptr; if (*(int *)this != 0) { FUN_00731b00(*(int *)this); pvVar1 = *(void **)this; size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0xe0) * 0xe0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } return; } //@@ 00730eb0 FUN_00730eb0 int FUN_00730eb0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x28; } //@@ 00730ed0 std::map::operator_index /* DB: std::set::find_node then, if absent, allocates 0x18 node (key +0x10, value +0x14 = 0) and inserts (FUN_00415bd0); returns &node->value; "map/set too long" check 0xaaaaaaa */ int std::map::operator_index(int *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; set::find_node(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(int *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x18); newNode[4] = *param_1; newNode[5] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = _Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 00730f90 FUN_00730f90 void FUN_00730f90(void) { size_t _Size; void *_Dst; int iVar1; int *in_ECX; uint uVar2; undefined4 in_stack_fffffff0; undefined4 in_stack_fffffff4; _Dst = (void *)in_ECX[1]; iVar1 = *in_ECX; uVar2 = (int)_Dst - iVar1 >> 2; if (0x10 < uVar2) { in_ECX[1] = iVar1 + 0x40; return; } if (uVar2 < 0x10) { if ((uint)(in_ECX[2] - iVar1 >> 2) < 0x10) { FUN_00732020(in_stack_fffffff0,in_stack_fffffff4); return; } _Size = (0x10 - uVar2) * 4; memset(_Dst,0,_Size); in_ECX[1] = (int)(_Size + (int)_Dst); } return; } //@@ 00731000 FUN_00731000 void FUN_00731000(void) { size_t _Size; void *_Dst; int iVar1; int *in_ECX; uint uVar2; undefined4 in_stack_fffffff0; undefined4 in_stack_fffffff4; _Dst = (void *)in_ECX[1]; iVar1 = *in_ECX; uVar2 = (int)_Dst - iVar1 >> 2; if (0x32 < uVar2) { in_ECX[1] = iVar1 + 200; return; } if (uVar2 < 0x32) { if ((uint)(in_ECX[2] - iVar1 >> 2) < 0x32) { FUN_00732100(in_stack_fffffff0,in_stack_fffffff4); return; } _Size = (0x32 - uVar2) * 4; memset(_Dst,0,_Size); in_ECX[1] = (int)(_Size + (int)_Dst); } return; } //@@ 00731070 FUN_00731070 void FUN_00731070(void) { size_t _Size; void *_Dst; int iVar1; int *in_ECX; uint uVar2; undefined4 in_stack_fffffff0; undefined4 in_stack_fffffff4; _Dst = (void *)in_ECX[1]; iVar1 = *in_ECX; uVar2 = (int)_Dst - iVar1 >> 2; if (0x62 < uVar2) { in_ECX[1] = iVar1 + 0x188; return; } if (uVar2 < 0x62) { if ((uint)(in_ECX[2] - iVar1 >> 2) < 0x62) { FUN_007321a0(in_stack_fffffff0,in_stack_fffffff4); return; } _Size = (0x62 - uVar2) * 4; memset(_Dst,0,_Size); in_ECX[1] = (int)(_Size + (int)_Dst); } return; } //@@ 007310e0 std::vector<4byte>::resize /* DB: shrink sets end; grow within capacity memsets zeros, else FUN_00732240 reallocates; Game::store_game_state, Entity_Player::StoreGameState, ItemConfig::Load */ void std::vector<4byte>::resize(uint param_1) { void *_Dst; int iVar1; int *in_ECX; uint uVar2; size_t _Size; _Dst = (void *)in_ECX[1]; iVar1 = *in_ECX; uVar2 = (int)_Dst - iVar1 >> 2; if (param_1 < uVar2) { in_ECX[1] = iVar1 + param_1 * 4; return; } if (uVar2 < param_1) { if ((uint)(in_ECX[2] - iVar1 >> 2) < param_1) { _Resize_reallocate(param_1,uVar2); return; } _Size = (param_1 - uVar2) * 4; memset(_Dst,0,_Size); in_ECX[1] = (int)(_Size + (int)_Dst); } return; } //@@ 00731160 FUN_00731160 void FUN_00731160(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00731b90(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0xb8) * 0xb8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007311e0 FUN_007311e0 void FUN_007311e0(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00731bf0(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x68) * 0x68; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00731260 FUN_00731260 void FUN_00731260(void) { FUN_00731b00(); return; } //@@ 00731280 FUN_00731280 void FUN_00731280(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0xe0; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 007312c0 FUN_007312c0 void FUN_007312c0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd530; local_10 = ExceptionList; ExceptionList = &local_10; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_EDX = *param_1; in_EDX[1] = uVar1; in_EDX[2] = uVar2; in_EDX[3] = uVar3; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; in_EDX[4] = param_1[4]; in_EDX[5] = uVar1; in_EDX[6] = uVar2; in_EDX[7] = uVar3; std::string::string((char *)(in_EDX + 8),param_1 + 8); local_8 = 0; _eh_vector_copy_constructor_iterator_ (in_EDX + 0xe,param_1 + 0xe,0x18,5,std::string::string,std::string::_Tidy_deallocate); _eh_vector_copy_constructor_iterator_ (in_EDX + 0x2c,param_1 + 0x2c,0x18,2,std::string::string,std::string::_Tidy_deallocate); ExceptionList = local_10; return; } //@@ 00731360 std::vector<224byte>::_Emplace_reallocate /* DB: growth/max 0x1249249 by /0xe0; caller ItemConfig::LoadBombCostumes */ void * std::vector<224byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { uint uVar1; int iVar2; void *pvVar3; void *pvVar4; int *in_ECX; uint uVar5; uint uVar6; void *ptr; void *pvVar7; int iVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd550; local_10 = ExceptionList; ExceptionList = &local_10; iVar8 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0xe0; if (iVar2 == 0x1249249) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar2 + 1; uVar6 = (in_ECX[2] - *in_ECX) / 0xe0; if (0x1249249 - (uVar6 >> 1) < uVar6) { uVar5 = 0x1249249; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar5 = uVar1; if (uVar1 <= uVar6) { uVar5 = uVar6; } if (0x1249249 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = _Allocate(uVar5 * 0xe0); local_8 = 0; pvVar4 = (void *)(((param_1 - iVar8) / 0xe0) * 0xe0 + (int)pvVar3); FUN_007312c0(param_2); iVar8 = *in_ECX; pvVar7 = pvVar3; if (param_1 != in_ECX[1]) { FUN_00732450(pvVar3,iVar8); pvVar7 = (void *)((int)pvVar4 + 0xe0); } FUN_00732450(pvVar7,iVar8); if (*in_ECX != 0) { FUN_00731b00(*in_ECX); pvVar7 = (void *)*in_ECX; uVar6 = ((in_ECX[2] - (int)pvVar7) / 0xe0) * 0xe0; ptr = pvVar7; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar7 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } *in_ECX = (int)pvVar3; in_ECX[1] = (int)(uVar1 * 0xe0 + (int)pvVar3); in_ECX[2] = (int)(uVar5 * 0xe0 + (int)pvVar3); ExceptionList = local_10; return pvVar4; } //@@ 00731506 Catch_All@00731506 void Catch_All_00731506(void) { int unaff_EBP; FUN_00731260(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); FUN_00731280(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00731540 std::map::try_emplace /* DB: MSVC _Tree: lower bound (FUN_00731e00) + string_compare, else new 0x30-byte node (16 header + moved std::string + zeroed 8-byte value), max_size 0x5555555; on the global map 00c80fcc; wrapper FUN_00730eb0 (operator[] returning node+0x28) used by ItemConfig::parse_tags */ void std::map::try_emplace(undefined4 *param_1,byte *param_2) { char cVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int *piVar6; uint uVar7; byte *b; int iVar8; undefined4 *puVar9; byte *a; undefined4 *puVar10; undefined4 *puVar11; int *local_34; int local_30; undefined4 *local_2c; undefined4 *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00afd57d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; FUN_00731e00(&local_34,param_2); if (*(char *)((int)local_2c + 0xd) == '\0') { b = (byte *)(local_2c + 4); if (0xf < (uint)local_2c[9]) { b = *(byte **)b; } a = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { a = *(byte **)param_2; } iVar8 = string_compare(a,*(uint *)(param_2 + 0x10),b,local_2c[8]); if (-1 < iVar8) { *(undefined1 *)(param_1 + 1) = 0; puVar9 = local_2c; goto LAB_0073176a; } } piVar6 = DAT_00c80fcc; if (DAT_00c80fd0 == 0x5555555) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar7); } local_28 = &DAT_00c80fcc; local_14 = 0; local_24 = (int *)0x0; puVar9 = operator_new(0x30); puVar9[4] = 0; puVar9[8] = 0; puVar9[9] = 0; uVar3 = *(undefined4 *)(param_2 + 4); uVar4 = *(undefined4 *)(param_2 + 8); uVar5 = *(undefined4 *)(param_2 + 0xc); puVar9[4] = *(undefined4 *)param_2; puVar9[5] = uVar3; puVar9[6] = uVar4; puVar9[7] = uVar5; *(undefined8 *)(puVar9 + 8) = *(undefined8 *)(param_2 + 0x10); param_2[0x10] = 0; param_2[0x11] = 0; param_2[0x12] = 0; param_2[0x13] = 0; param_2[0x14] = 0xf; param_2[0x15] = 0; param_2[0x16] = 0; param_2[0x17] = 0; *param_2 = 0; puVar9[10] = 0; puVar9[0xb] = 0; *puVar9 = piVar6; puVar9[1] = piVar6; puVar9[2] = piVar6; *(undefined2 *)(puVar9 + 3) = 0; local_24 = DAT_00c80fcc; DAT_00c80fd0 = DAT_00c80fd0 + 1; puVar9[1] = local_34; if (local_34 == local_24) { *local_24 = (int)puVar9; local_24[1] = (int)puVar9; local_24[2] = (int)puVar9; *(undefined1 *)(puVar9 + 3) = 1; } else { if (local_30 == 0) { local_34[2] = (int)puVar9; if (local_34 == (int *)local_24[2]) { local_24[2] = (int)puVar9; } } else { *local_34 = (int)puVar9; if (local_34 == (int *)*local_24) { *local_24 = (int)puVar9; } } cVar1 = *(char *)(puVar9[1] + 0xc); puVar11 = puVar9; while (cVar1 == '\0') { puVar2 = (undefined4 *)puVar11[1]; puVar10 = *(undefined4 **)puVar2[1]; if (puVar2 == puVar10) { puVar10 = (undefined4 *)((undefined4 *)puVar2[1])[2]; if (*(char *)(puVar10 + 3) == '\0') { LAB_00731700: *(undefined1 *)(puVar2 + 3) = 1; *(undefined1 *)(puVar10 + 3) = 1; *(undefined1 *)(*(int *)(puVar11[1] + 4) + 0xc) = 0; puVar11 = *(undefined4 **)(puVar11[1] + 4); } else { if (puVar11 == (undefined4 *)puVar2[2]) { FUN_00415fe0(puVar2); puVar11 = puVar2; } *(undefined1 *)(puVar11[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar11[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar11[1] + 4)); } } else { if (*(char *)(puVar10 + 3) == '\0') goto LAB_00731700; if (puVar11 == (undefined4 *)*puVar2) { FUN_00415f80(puVar2); puVar11 = puVar2; } *(undefined1 *)(puVar11[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar11[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar11[1] + 4)); } cVar1 = *(char *)(puVar11[1] + 0xc); } *(undefined1 *)(local_24[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; LAB_0073176a: *param_1 = puVar9; ExceptionList = local_1c; return; } //@@ 00731790 FID_conflict:_Erase_tree_>_> /* Library Function - Multiple Matches With Different Base Names public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree_and_orphan > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Erase_tree_>_> (void *this,fuzzer_allocator_> *param_1, _Tree_node *param_2) { _Tree_node _Var1; _Tree_node *p_Var2; _Var1 = param_2[0xd]; while (_Var1 == (_Tree_node)0x0) { FID_conflict__Erase_tree_>_> (this,param_1,*(_Tree_node **)(param_2 + 8)); p_Var2 = *(_Tree_node **)param_2; operator_delete(param_2,0x20); param_2 = p_Var2; _Var1 = p_Var2[0xd]; } return; } //@@ 007317d0 FUN_007317d0 void FUN_007317d0(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_007317d0(param_1,param_2[2]); piVar2 = (int *)*param_2; vector_BombCostume_tidy(param_2 + 5); operator_delete(param_2,0x20); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00731820 FUN_00731820 void FUN_00731820(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00731820(param_1,param_2[2]); piVar2 = (int *)*param_2; std::string::_Tidy_deallocate((char *)(param_2 + 4)); operator_delete(param_2,0x54); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00731870 FUN_00731870 void FUN_00731870(int param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_EDX; FUN_00731c30(param_1); uVar1 = *(undefined4 *)(param_1 + 0x68); uVar2 = *(undefined4 *)(param_1 + 0x70); uVar3 = *(undefined4 *)(param_1 + 0x6c); *(undefined4 *)(param_1 + 0x70) = 0; *(undefined4 *)(param_1 + 0x6c) = 0; *(undefined4 *)(param_1 + 0x68) = 0; *(undefined4 *)(in_EDX + 0x68) = uVar1; *(undefined4 *)(in_EDX + 0x6c) = uVar3; *(undefined4 *)(in_EDX + 0x70) = uVar2; *(undefined4 *)(in_EDX + 0x74) = *(undefined4 *)(param_1 + 0x74); *(undefined4 *)(in_EDX + 0x78) = *(undefined4 *)(param_1 + 0x78); *(undefined4 *)(in_EDX + 0x7c) = *(undefined4 *)(param_1 + 0x7c); *(undefined4 *)(in_EDX + 0x80) = *(undefined4 *)(param_1 + 0x80); *(undefined4 *)(in_EDX + 0x84) = 0; *(undefined4 *)(in_EDX + 0x94) = 0; *(undefined4 *)(in_EDX + 0x98) = 0; uVar1 = *(undefined4 *)(param_1 + 0x88); uVar2 = *(undefined4 *)(param_1 + 0x8c); uVar3 = *(undefined4 *)(param_1 + 0x90); *(undefined4 *)(in_EDX + 0x84) = *(undefined4 *)(param_1 + 0x84); *(undefined4 *)(in_EDX + 0x88) = uVar1; *(undefined4 *)(in_EDX + 0x8c) = uVar2; *(undefined4 *)(in_EDX + 0x90) = uVar3; *(undefined8 *)(in_EDX + 0x94) = *(undefined8 *)(param_1 + 0x94); *(undefined4 *)(param_1 + 0x94) = 0; *(undefined4 *)(param_1 + 0x98) = 0xf; *(undefined1 *)(param_1 + 0x84) = 0; *(undefined4 *)(in_EDX + 0x9c) = 0; *(undefined4 *)(in_EDX + 0xac) = 0; *(undefined4 *)(in_EDX + 0xb0) = 0; uVar1 = *(undefined4 *)(param_1 + 0xa0); uVar2 = *(undefined4 *)(param_1 + 0xa4); uVar3 = *(undefined4 *)(param_1 + 0xa8); *(undefined4 *)(in_EDX + 0x9c) = *(undefined4 *)(param_1 + 0x9c); *(undefined4 *)(in_EDX + 0xa0) = uVar1; *(undefined4 *)(in_EDX + 0xa4) = uVar2; *(undefined4 *)(in_EDX + 0xa8) = uVar3; *(undefined8 *)(in_EDX + 0xac) = *(undefined8 *)(param_1 + 0xac); *(undefined4 *)(param_1 + 0xac) = 0; *(undefined4 *)(param_1 + 0xb0) = 0xf; *(undefined1 *)(param_1 + 0x9c) = 0; return; } //@@ 00731980 std::vector<184byte>::_Emplace_reallocate /* DB: growth/max 0x1642c85 by /0xb8, element via FUN_00731870; caller ItemConfig::LoadLocustConfig */ void * std::vector<184byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { int iVar1; void *pvVar2; int *in_ECX; uint uVar3; uint uVar4; void *pvVar5; void *ptr; void *pvVar6; int iVar7; iVar7 = *in_ECX; iVar1 = (in_ECX[1] - *in_ECX) / 0xb8; if (iVar1 == 0x1642c85) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar4 = (in_ECX[2] - *in_ECX) / 0xb8; if (0x1642c85 - (uVar4 >> 1) < uVar4) { uVar3 = 0x1642c85; } else { uVar4 = (uVar4 >> 1) + uVar4; uVar3 = iVar1 + 1U; if (iVar1 + 1U <= uVar4) { uVar3 = uVar4; } if (0x1642c85 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar2 = _Allocate(uVar3 * 0xb8); pvVar5 = (void *)(((param_1 - iVar7) / 0xb8) * 0xb8 + (int)pvVar2); FUN_00731870(param_2); iVar7 = *in_ECX; pvVar6 = pvVar2; if (param_1 != in_ECX[1]) { FUN_00732580(pvVar2,iVar7); pvVar6 = (void *)((int)pvVar5 + 0xb8); } FUN_00732580(pvVar6,iVar7); if (*in_ECX != 0) { FUN_00731b90(*in_ECX); pvVar6 = (void *)*in_ECX; uVar4 = ((in_ECX[2] - (int)pvVar6) / 0xb8) * 0xb8; ptr = pvVar6; if (0xfff < uVar4) { ptr = *(void **)((int)pvVar6 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } *in_ECX = (int)pvVar2; in_ECX[1] = (int)((iVar1 + 1) * 0xb8 + (int)pvVar2); in_ECX[2] = (int)(uVar3 * 0xb8 + (int)pvVar2); return pvVar5; } //@@ 00731b00 FUN_00731b00 void FUN_00731b00(void) { int iVar1; int in_ECX; int in_EDX; void *pvVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if (in_ECX != in_EDX) { pvVar2 = (void *)(in_ECX + 0x38); do { local_8 = 0; _eh_vector_destructor_iterator_ ((void *)((int)pvVar2 + 0x78),0x18,2,std::string::_Tidy_deallocate); _eh_vector_destructor_iterator_(pvVar2,0x18,5,std::string::_Tidy_deallocate); std::string::_Tidy_deallocate((char *)((int)pvVar2 + -0x18)); iVar1 = (int)pvVar2 + 0xa8; pvVar2 = (void *)((int)pvVar2 + 0xe0); } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00731b90 FUN_00731b90 void FUN_00731b90(void) { char *pcVar1; char *in_ECX; char *in_EDX; char *this; if (in_ECX != in_EDX) { this = in_ECX + 0x84; do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); FUN_007311e0(); std::string::_Tidy_deallocate(this + -0x34); std::string::_Tidy_deallocate(this + -0x4c); std::string::_Tidy_deallocate(this + -100); pcVar1 = this + 0x34; this = this + 0xb8; } while (pcVar1 != in_EDX); } return; } //@@ 00731bf0 FUN_00731bf0 void FUN_00731bf0(void) { char *pcVar1; char *in_ECX; char *in_EDX; char *this; if (in_ECX != in_EDX) { this = in_ECX + 0x38; do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); std::string::_Tidy_deallocate(this + -0x18); pcVar1 = this + 0x30; this = this + 0x68; } while (pcVar1 != in_EDX); } return; } //@@ 00731c30 FUN_00731c30 void FUN_00731c30(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[1] = param_1[1]; uVar1 = param_1[3]; uVar2 = param_1[4]; uVar3 = param_1[5]; in_ECX[2] = param_1[2]; in_ECX[3] = uVar1; in_ECX[4] = uVar2; in_ECX[5] = uVar3; in_ECX[6] = param_1[6]; in_ECX[7] = param_1[7]; in_ECX[8] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; uVar1 = param_1[9]; uVar2 = param_1[10]; uVar3 = param_1[0xb]; in_ECX[8] = param_1[8]; in_ECX[9] = uVar1; in_ECX[10] = uVar2; in_ECX[0xb] = uVar3; *(undefined8 *)(in_ECX + 0xc) = *(undefined8 *)(param_1 + 0xc); param_1[0xc] = 0; param_1[0xd] = 0xf; *(undefined1 *)(param_1 + 8) = 0; in_ECX[0xe] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; uVar1 = param_1[0xf]; uVar2 = param_1[0x10]; uVar3 = param_1[0x11]; in_ECX[0xe] = param_1[0xe]; in_ECX[0xf] = uVar1; in_ECX[0x10] = uVar2; in_ECX[0x11] = uVar3; *(undefined8 *)(in_ECX + 0x12) = *(undefined8 *)(param_1 + 0x12); param_1[0x12] = 0; param_1[0x13] = 0xf; *(undefined1 *)(param_1 + 0xe) = 0; in_ECX[0x14] = 0; in_ECX[0x18] = 0; in_ECX[0x19] = 0; uVar1 = param_1[0x15]; uVar2 = param_1[0x16]; uVar3 = param_1[0x17]; in_ECX[0x14] = param_1[0x14]; in_ECX[0x15] = uVar1; in_ECX[0x16] = uVar2; in_ECX[0x17] = uVar3; *(undefined8 *)(in_ECX + 0x18) = *(undefined8 *)(param_1 + 0x18); param_1[0x18] = 0; param_1[0x19] = 0xf; *(undefined1 *)(param_1 + 0x14) = 0; return; } //@@ 00731d10 FUN_00731d10 int FUN_00731d10(int param_1,int param_2) { undefined4 in_ECX; undefined4 extraout_ECX; int extraout_EDX; if (param_2 != 0) { do { FUN_00722740(); param_1 = param_1 + 0x68; in_ECX = extraout_ECX; } while (extraout_EDX != 1); } FUN_00731bf0(in_ECX); return param_1; } //@@ 00731d50 FUN_00731d50 void FUN_00731d50(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x30); } return; } //@@ 00731d70 FUN_00731d70 void FUN_00731d70(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::map::try_emplace(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00731da0 FUN_00731da0 void FUN_00731da0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_00732830(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00731dd0 FUN_00731dd0 void FUN_00731dd0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::set::_Emplace(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00731e00 FUN_00731e00 int * FUN_00731e00(int *param_1,byte *param_2) { char cVar1; uint uVar2; uint lengthB; byte *b; int iVar3; byte *a; undefined4 *puVar4; iVar3 = DAT_00c80fcc; puVar4 = *(undefined4 **)(DAT_00c80fcc + 4); *param_1 = (int)puVar4; cVar1 = *(char *)((int)puVar4 + 0xd); param_1[1] = 0; param_1[2] = iVar3; if (cVar1 == '\0') { uVar2 = *(uint *)(param_2 + 0x14); lengthB = *(uint *)(param_2 + 0x10); do { *param_1 = (int)puVar4; a = (byte *)(puVar4 + 4); b = param_2; if (0xf < uVar2) { b = *(byte **)param_2; } if (0xf < (uint)puVar4[9]) { a = *(byte **)a; } iVar3 = string_compare(a,puVar4[8],b,lengthB); if (-1 < iVar3) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(-1 < iVar3); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 00731e90 FUN_00731e90 void FUN_00731e90(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00731e90(param_1,param_2[2]); piVar2 = (int *)*param_2; std::string::_Tidy_deallocate((char *)(param_2 + 4)); operator_delete(param_2,0x30); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00731ee0 FUN_00731ee0 int * FUN_00731ee0(int *param_1,uint *param_2) { uint uVar1; uint uVar2; undefined4 *puVar3; int *in_ECX; int iVar4; iVar4 = *in_ECX; puVar3 = *(undefined4 **)(iVar4 + 4); *param_1 = (int)puVar3; param_1[1] = 0; param_1[2] = iVar4; if (*(char *)((int)puVar3 + 0xd) == '\0') { uVar1 = *param_2; uVar2 = param_2[1]; do { *param_1 = (int)puVar3; if ((uVar2 < (uint)puVar3[5]) || ((uVar2 <= (uint)puVar3[5] && (uVar1 <= (uint)puVar3[4])))) { param_1[2] = (int)puVar3; iVar4 = 1; puVar3 = (undefined4 *)*puVar3; } else { puVar3 = (undefined4 *)puVar3[2]; iVar4 = 0; } param_1[1] = iVar4; } while (*(char *)((int)puVar3 + 0xd) == '\0'); } return param_1; } //@@ 00731f40 FUN_00731f40 void FUN_00731f40(void) { void *pvVar1; void *_Dst; void *ptr; int *in_ECX; uint uVar2; uint size; int iVar3; uVar2 = in_ECX[2] - *in_ECX >> 2; iVar3 = in_ECX[1] - *in_ECX >> 2; if (0x3fffffff - (uVar2 >> 1) < uVar2) { uVar2 = 0x3fffffff; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < 0x13) { uVar2 = 0x13; } else if (0x3fffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar2 * 4); memset((void *)((int)_Dst + iVar3 * 4),0,(0x13 - iVar3) * 4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)_Dst; in_ECX[1] = (int)_Dst + 0x4c; in_ECX[2] = (int)(uVar2 * 4 + (int)_Dst); return; } //@@ 00732020 FUN_00732020 void FUN_00732020(void) { void *pvVar1; void *_Dst; void *ptr; int *in_ECX; uint uVar2; uint size; int iVar3; uVar2 = in_ECX[2] - *in_ECX >> 2; iVar3 = in_ECX[1] - *in_ECX >> 2; if (0x3fffffff - (uVar2 >> 1) < uVar2) { uVar2 = 0x3fffffff; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < 0x10) { uVar2 = 0x10; } else if (0x3fffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar2 * 4); memset((void *)((int)_Dst + iVar3 * 4),0,(0x10 - iVar3) * 4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)_Dst; in_ECX[1] = (int)_Dst + 0x40; in_ECX[2] = (int)(uVar2 * 4 + (int)_Dst); return; } //@@ 00732100 FUN_00732100 void FUN_00732100(void) { uint *_Dst; int *in_ECX; uint uVar1; int iVar2; uVar1 = in_ECX[2] - *in_ECX >> 2; iVar2 = in_ECX[1] - *in_ECX >> 2; if (0x3fffffff - (uVar1 >> 1) < uVar1) { uVar1 = 0x3fffffff; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < 0x32) { uVar1 = 0x32; } else if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar1 * 4); memset(_Dst + iVar2,0,(0x32 - iVar2) * 4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,0x32,uVar1); return; } //@@ 007321a0 FUN_007321a0 void FUN_007321a0(void) { uint *_Dst; int *in_ECX; uint uVar1; int iVar2; uVar1 = in_ECX[2] - *in_ECX >> 2; iVar2 = in_ECX[1] - *in_ECX >> 2; if (0x3fffffff - (uVar1 >> 1) < uVar1) { uVar1 = 0x3fffffff; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < 0x62) { uVar1 = 0x62; } else if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar1 * 4); memset(_Dst + iVar2,0,(0x62 - iVar2) * 4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,0x62,uVar1); return; } //@@ 00732240 std::vector<4byte>::_Resize_reallocate /* DB: grows a 4-byte vector to arg (1.5x capacity rule, _Xlen at 0x3fffffff), zero-fills new tail, memmove old data, _Change_array; called by std::vector<4byte>::resize and ItemConfig::Load */ void std::vector<4byte>::_Resize_reallocate(uint param_1) { uint *_Dst; int *in_ECX; uint uVar1; int iVar2; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar2 = in_ECX[1] - *in_ECX >> 2; uVar1 = in_ECX[2] - *in_ECX >> 2; if (0x3fffffff - (uVar1 >> 1) < uVar1) { uVar1 = 0x3fffffff; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } else if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar1 * 4); memset(_Dst + iVar2,0,(param_1 - iVar2) * 4); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,param_1,uVar1); return; } //@@ 007322f0 FUN_007322f0 void FUN_007322f0(uint param_1) { int iVar1; uint uVar2; void *pvVar3; int *in_ECX; void *pvVar4; int extraout_ECX; int extraout_ECX_00; uint uVar5; int extraout_EDX; int iVar6; void *ptr; if (0x2762762 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar5 = (in_ECX[1] - *in_ECX) / 0x68; uVar2 = (in_ECX[2] - *in_ECX) / 0x68; if (0x2762762 - (uVar2 >> 1) < uVar2) { uVar2 = 0x2762762; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < param_1) { uVar2 = param_1; } else if (0x2762762 < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = std::_Allocate(uVar2 * 0x68); pvVar4 = (void *)(uVar5 * 0x68 + (int)pvVar3); if (param_1 != uVar5) { do { FUN_00722740(); pvVar4 = (void *)(extraout_ECX + 0x68); } while (extraout_EDX != 1); } FUN_00731bf0(pvVar4); iVar1 = in_ECX[1]; pvVar4 = pvVar3; for (iVar6 = *in_ECX; iVar6 != iVar1; iVar6 = iVar6 + 0x68) { FUN_00731c30(iVar6); pvVar4 = (void *)(extraout_ECX_00 + 0x68); } FUN_00731bf0(pvVar4); if (*in_ECX != 0) { FUN_00731bf0(*in_ECX); pvVar4 = (void *)*in_ECX; uVar5 = ((in_ECX[2] - (int)pvVar4) / 0x68) * 0x68; ptr = pvVar4; if (0xfff < uVar5) { ptr = *(void **)((int)pvVar4 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } *in_ECX = (int)pvVar3; in_ECX[1] = (int)(param_1 * 0x68 + (int)pvVar3); in_ECX[2] = (int)(uVar2 * 0x68 + (int)pvVar3); return; } //@@ 00732450 FUN_00732450 undefined4 * FUN_00732450(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; uint uVar5; undefined4 *in_ECX; undefined4 *in_EDX; int iVar6; undefined4 *puVar7; undefined4 *puVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { puVar8 = param_1 + 8; iVar6 = (int)param_1 - (int)in_ECX; puVar7 = in_ECX + 0xd; do { local_8 = 0; uVar2 = puVar7[-0xc]; uVar3 = puVar7[-0xb]; uVar4 = puVar7[-10]; *param_1 = puVar7[-0xd]; param_1[1] = uVar2; param_1[2] = uVar3; param_1[3] = uVar4; uVar2 = puVar7[-8]; uVar3 = puVar7[-7]; uVar4 = puVar7[-6]; puVar8[-4] = puVar7[-9]; puVar8[-3] = uVar2; puVar8[-2] = uVar3; puVar8[-1] = uVar4; *puVar8 = 0; puVar8[4] = 0; *(undefined4 *)(iVar6 + (int)puVar7) = 0; uVar2 = puVar7[-4]; uVar3 = puVar7[-3]; uVar4 = puVar7[-2]; *puVar8 = puVar7[-5]; puVar8[1] = uVar2; puVar8[2] = uVar3; puVar8[3] = uVar4; *(undefined8 *)(puVar8 + 4) = *(undefined8 *)(puVar7 + -1); puVar7[-1] = 0; *puVar7 = 0xf; *(undefined1 *)(puVar7 + -5) = 0; _eh_vector_copy_constructor_iterator_ (puVar8 + 6,puVar7 + 1,0x18,5,FUN_00417100,std::string::_Tidy_deallocate); _eh_vector_copy_constructor_iterator_ (puVar8 + 0x24,puVar7 + 0x1f,0x18,2,FUN_00417100,std::string::_Tidy_deallocate); puVar1 = puVar7 + 0x2b; param_1 = param_1 + 0x38; puVar8 = puVar8 + 0x38; puVar7 = puVar7 + 0x38; } while (puVar1 != in_EDX); } local_8 = 0xffffffff; FUN_00731b00(param_1,uVar5); ExceptionList = local_10; return param_1; } //@@ 00732580 FUN_00732580 int FUN_00732580(int param_1) { int iVar1; int in_ECX; int extraout_ECX; int in_EDX; iVar1 = in_ECX; for (; in_ECX != in_EDX; in_ECX = in_ECX + 0xb8) { FUN_00731870(in_ECX); param_1 = param_1 + 0xb8; iVar1 = extraout_ECX; } FUN_00731b90(iVar1); return param_1; } //@@ 007325c0 FUN_007325c0 void FUN_007325c0(void) { FUN_00731bf0(); return; } //@@ 007325d0 FUN_007325d0 void FUN_007325d0(void) { FUN_00731b90(); return; } //@@ 007325e0 std::map::try_emplace /* DB: ? MSVC _Tree emplace keyed by std::string: std::map::_Find_lower_bound + string_compare, returns {iterator,false} when present, else operator_new(0x54) node (string key + 0x2c value), max_size 0x30c30c3 check; caller 00731d70 (next to ItemPool) */ void std::map::try_emplace(undefined4 *param_1,byte *param_2) { int *piVar1; int iVar2; int iVar3; int iVar4; uint uVar5; undefined8 *puVar6; byte *b; int iVar7; int *in_ECX; byte *a; int *piVar8; int *piVar9; undefined1 local_44 [12]; undefined8 local_38; int *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_44 + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00afd5ad; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_44 + 0x34); ExceptionList = &local_1c; puVar6 = (undefined8 *)_Find_lower_bound(local_44,param_2); local_38 = *puVar6; local_24 = *(int **)(puVar6 + 1); if (*(char *)((int)local_24 + 0xd) == '\0') { b = (byte *)(local_24 + 4); if (0xf < (uint)local_24[9]) { b = *(byte **)b; } a = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { a = *(byte **)param_2; } iVar7 = string_compare(a,*(uint *)(param_2 + 0x10),b,local_24[8]); if (-1 < iVar7) { *(undefined1 *)(param_1 + 1) = 0; goto LAB_00732811; } } if (in_ECX[1] == 0x30c30c3) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar7 = *in_ECX; local_14 = 0; local_28 = (int *)0x0; local_24 = operator_new(0x54); local_24[4] = 0; local_24[8] = 0; local_24[9] = 0; iVar2 = *(int *)(param_2 + 4); iVar3 = *(int *)(param_2 + 8); iVar4 = *(int *)(param_2 + 0xc); local_24[4] = *(int *)param_2; local_24[5] = iVar2; local_24[6] = iVar3; local_24[7] = iVar4; *(undefined8 *)(local_24 + 8) = *(undefined8 *)(param_2 + 0x10); param_2[0x10] = 0; param_2[0x11] = 0; param_2[0x12] = 0; param_2[0x13] = 0; param_2[0x14] = 0xf; param_2[0x15] = 0; param_2[0x16] = 0; param_2[0x17] = 0; *param_2 = 0; iVar2 = *(int *)(param_2 + 0x1c); iVar3 = *(int *)(param_2 + 0x20); iVar4 = *(int *)(param_2 + 0x24); local_24[10] = *(int *)(param_2 + 0x18); local_24[0xb] = iVar2; local_24[0xc] = iVar3; local_24[0xd] = iVar4; iVar2 = *(int *)(param_2 + 0x2c); iVar3 = *(int *)(param_2 + 0x30); iVar4 = *(int *)(param_2 + 0x34); local_24[0xe] = *(int *)(param_2 + 0x28); local_24[0xf] = iVar2; local_24[0x10] = iVar3; local_24[0x11] = iVar4; *(undefined8 *)(local_24 + 0x12) = *(undefined8 *)(param_2 + 0x38); local_24[0x14] = *(int *)(param_2 + 0x40); *local_24 = iVar7; local_24[1] = iVar7; local_24[2] = iVar7; *(undefined2 *)(local_24 + 3) = 0; local_28 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; local_24[1] = (int)(int *)local_38; if ((int *)local_38 == local_28) { *local_28 = (int)local_24; local_28[1] = (int)local_24; local_28[2] = (int)local_24; *(undefined1 *)(local_24 + 3) = 1; } else { if (local_38._4_4_ == 0) { ((int *)local_38)[2] = (int)local_24; if ((int *)local_38 == (int *)local_28[2]) { local_28[2] = (int)local_24; } } else { *(int *)local_38 = (int)local_24; if ((int *)local_38 == (int *)*local_28) { *local_28 = (int)local_24; } } piVar9 = local_24; if (*(char *)(local_24[1] + 0xc) == '\0') { do { piVar1 = (int *)piVar9[1]; piVar8 = *(int **)piVar1[1]; if (piVar1 == piVar8) { piVar8 = (int *)((undefined4 *)piVar1[1])[2]; if ((char)piVar8[3] == '\0') goto LAB_007327aa; if (piVar9 == (int *)piVar1[2]) { FUN_00415fe0(piVar1); piVar9 = piVar1; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar9[1] + 4)); } else if ((char)piVar8[3] == '\0') { LAB_007327aa: *(undefined1 *)(piVar1 + 3) = 1; *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; piVar9 = *(int **)(piVar9[1] + 4); } else { if (piVar9 == (int *)*piVar1) { FUN_00415f80(piVar1); piVar9 = piVar1; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar9[1] + 4)); } } while (*(char *)(piVar9[1] + 0xc) == '\0'); } *(undefined1 *)(local_28[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; LAB_00732811: *param_1 = local_24; ExceptionList = local_1c; return; } //@@ 00732830 FUN_00732830 void FUN_00732830(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd5dd; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)FUN_00731ee0(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if (*(char *)(iVar3 + 0xd) == '\0') { if ((*(uint *)(iVar3 + 0x14) <= param_2[1]) && ((*(uint *)(iVar3 + 0x14) < param_2[1] || (*(uint *)(iVar3 + 0x10) <= *param_2)))) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x20); uVar6 = param_2[1]; piVar8[4] = *param_2; piVar8[5] = uVar6; uVar6 = param_2[3]; piVar8[6] = param_2[2]; local_28 = (int *)uVar1; piVar8[7] = uVar6; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_00732992: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_00732992; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00732a20 std::set::_Emplace /* DB: std::set::find_node lower bound, insert when missing (max_size 0x7ffffff, operator_new node); via FUN_00731dd0 */ void std::set::_Emplace(int *param_1,int *param_2) { undefined8 uVar1; char cVar2; int iVar3; int iVar4; int iVar5; int iVar6; int *piVar7; int *piVar8; uint uVar9; undefined8 *puVar10; int *piVar11; int *in_ECX; int *piVar12; int *piVar13; int *local_2c; int iStack_28; undefined1 local_20 [8]; undefined4 local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd60d; local_10 = ExceptionList; uVar9 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; local_14 = in_ECX; puVar10 = (undefined8 *)find_node(local_20,param_2); iVar3 = *(int *)(puVar10 + 1); uVar1 = *puVar10; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(int *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar9); } iVar3 = *in_ECX; local_8 = 0; local_18 = 0; piVar11 = operator_new(0x20); piVar11[4] = *param_2; iVar4 = param_2[2]; iVar5 = param_2[3]; param_2[3] = 0; param_2[2] = 0; iVar6 = param_2[1]; param_2[1] = 0; piVar11[6] = iVar4; local_2c = (int *)uVar1; piVar11[5] = iVar6; piVar11[7] = iVar5; *piVar11 = iVar3; piVar11[1] = iVar3; piVar11[2] = iVar3; *(undefined2 *)(piVar11 + 3) = 0; piVar7 = (int *)*local_14; local_14[1] = local_14[1] + 1; piVar11[1] = (int)local_2c; if (local_2c == piVar7) { *piVar7 = (int)piVar11; piVar7[1] = (int)piVar11; piVar7[2] = (int)piVar11; *(undefined1 *)(piVar11 + 3) = 1; } else { iStack_28 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_28 == 0) { local_2c[2] = (int)piVar11; if (local_2c == (int *)piVar7[2]) { piVar7[2] = (int)piVar11; } } else { *local_2c = (int)piVar11; if (local_2c == (int *)*piVar7) { *piVar7 = (int)piVar11; } } cVar2 = *(char *)(piVar11[1] + 0xc); piVar13 = piVar11; while (cVar2 == '\0') { piVar8 = (int *)piVar13[1]; piVar12 = *(int **)piVar8[1]; if (piVar8 == piVar12) { piVar12 = (int *)((undefined4 *)piVar8[1])[2]; if ((char)piVar12[3] == '\0') { LAB_00732b9a: *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(piVar12 + 3) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; piVar13 = *(int **)(piVar13[1] + 4); } else { if (piVar13 == (int *)piVar8[2]) { FUN_00415fe0(piVar8); piVar13 = piVar8; } *(undefined1 *)(piVar13[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar13[1] + 4)); } } else { if ((char)piVar12[3] == '\0') goto LAB_00732b9a; if (piVar13 == (int *)*piVar8) { FUN_00415f80(piVar8); piVar13 = piVar8; } *(undefined1 *)(piVar13[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar13[1] + 4)); } cVar2 = *(char *)(piVar13[1] + 0xc); } *(undefined1 *)(piVar7[1] + 0xc) = 1; } *param_1 = (int)piVar11; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00732c70 ItemPool::GetPool /* ZHL [exact] __thiscall ItemPool_Item* ItemPool::GetPool(int itemPoolType); prototype: REPENTOGON, confirmed by RET 4 */ ItemPool_Item * __thiscall ItemPool::GetPool(ItemPool *this,int itemPoolType) { return this->_pools + itemPoolType; } //@@ 00732c90 FUN_00732c90 void FUN_00732c90(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; std::vector::_Tidy(__security_cookie ^ (int)register0x00000010 - 4U); FID_conflict__Tidy((void *)(in_ECX + 0x68c)); FID_conflict__Tidy((void *)(in_ECX + 0x67c)); _eh_vector_destructor_iterator_ ((void *)(in_ECX + 4),0x34,0x1f,(_func_void_void_ptr *)&LAB_00732c80); ExceptionList = local_10; return; } //@@ 00732d00 ItemPool::is_collectible_available /* DB: bitsets 0x67c/0x68c removed/blocked, trinket No! (88) blocks actives prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall ItemPool::is_collectible_available(ItemPool *this,int collectibleId,byte isFullCheck) { byte bVar1; ItemConfig_Item *this_00; uint uVar2; int iVar3; this_00 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); iVar3 = ((uint)collectibleId >> 5) * 4; uVar2 = 1 << ((byte)collectibleId & 0x1f); if (((*(uint *)((int)(this->_removedCollectibles)._begin + iVar3) & uVar2) == 0) && ((*(uint *)((int)(this->_roomBlacklistedCollectibles)._begin + iVar3) & uVar2) == 0)) { bVar1 = Item::IsAvailable(this_00,(isFullCheck ^ 1) * 2 - 3); if (bVar1 != 0) { bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x58); if (((bVar1 == 0) || (this_00 == (ItemConfig_Item *)0x0)) || (this_00->type != 3)) { return 1; } } } return 0; } //@@ 00732dc0 ItemPool::GetPoolForRoom /* ZHL [lua] Lua binding ItemPool:GetPoolForRoom prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall ItemPool::GetPoolForRoom(ItemPool *this,uint RoomType,uint Seed) { code *pcVar1; bool bVar2; int iVar3; uint uVar4; if (((int)RoomType < 0) || (0x1e < (int)RoomType)) { KAGE_LogMessage(0x10,(byte *)"RoomType out of bounds\n"); } if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { bVar2 = true; } else { bVar2 = false; } iVar3 = 0x718; if (!bVar2) { iVar3 = 0x69c; } if (RoomType != 3) { return *(int *)((int)this->_pools + RoomType * 4 + iVar3 + -4); } if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } uVar4 = Seed >> 1 ^ Seed; uVar4 = uVar4 << 0x15 ^ uVar4; return *(int *)((int)&this->_pools[0]._totalWeight + ((uVar4 >> 0x14 ^ uVar4) % 0x1e) * 4 + iVar3) ; } //@@ 00732e90 ItemPool::GetItemPoolsForCollectible /* ZHL [exact] __thiscall void ItemPool::GetItemPoolsForCollectible(int collectible, std_vector_uint* result); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ItemPool::GetItemPoolsForCollectible(ItemPool *this,int collectible,void *result) { uint *puVar1; void *pvVar2; int *piVar3; void *pvVar4; void **ppvVar5; pvVar2 = result; pvVar4 = (void *)0x0; ppvVar5 = &this->_pools[0]._poolList._end; do { for (piVar3 = ((std_vector *)(ppvVar5 + -1))->_begin; piVar3 != *ppvVar5; piVar3 = piVar3 + 6) { if (*piVar3 == collectible) { puVar1 = *(uint **)((int)pvVar2 + 4); if (puVar1 == *(uint **)((int)pvVar2 + 8)) { result = pvVar4; std::vector<4byte>::_Emplace_reallocate(puVar1,&result); } else { *puVar1 = (uint)pvVar4; *(int *)((int)pvVar2 + 4) = *(int *)((int)pvVar2 + 4) + 4; } break; } } pvVar4 = (void *)((int)pvVar4 + 1); ppvVar5 = ppvVar5 + 0xd; if ((void *)0x1e < pvVar4) { return; } } while( true ); } //@@ 00732ef0 ItemPool::GetFirstItemPoolForCollectible /* ZHL [exact] __thiscall int ItemPool::GetFirstItemPoolForCollectible(int collectible); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall ItemPool::GetFirstItemPoolForCollectible(ItemPool *this,int collectible) { uint size; int *ptr; int iVar1; int *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afd63d; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = (int *)0x0; local_18 = 0; local_14 = 0; local_8 = 0; GetItemPoolsForCollectible(this,collectible,&local_1c); if ((local_18 - (int)local_1c & 0xfffffffcU) == 0) { iVar1 = 0; } else { iVar1 = *local_1c; } if (local_1c != (int *)0x0) { size = local_14 - (int)local_1c & 0xfffffffc; ptr = local_1c; if (0xfff < size) { ptr = (int *)local_1c[-1]; size = size + 0x23; if (0x1f < (uint)((int)local_1c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return iVar1; } //@@ 00732fa0 ItemPool::pick_weighted /* DB: GetCollectible's draw: cumulative base weights (+4), keeps a pick with chance running/base (+8), then running -= DecreaseBy (+0xc), under RemoveOn (+0x10) removed (characters_9.md) prototype: db/protos.zhl, confirmed by RET 8 */ uint * __thiscall ItemPool::pick_weighted(ItemPool *this,float *poolList,uint flags,float roll) { float fVar1; void *pvVar2; uint *puVar3; byte bVar4; uint uVar5; int iVar6; int iVar7; uint uVar8; uint bitMask; int *fallbackConfig; uint *puVar9; uint *puVar10; float fVar11; float pickFraction; uint *entry; int repicksLeft; int *itemConfig; bool isAllowed; fVar11 = 0.0; uVar5 = flags >> 1; iVar7 = 0x14; if ((uVar5 & 1) == 0) { iVar7 = 10; } entry = (uint *)poolList[1]; iVar6 = iVar7 + 6; if ((flags & 0x10) == 0) { iVar6 = iVar7; } iVar7 = iVar6 + 5; if ((flags & 0x20) == 0) { iVar7 = iVar6; } iVar6 = iVar7 + 4; if ((flags & 0x40) == 0) { iVar6 = iVar7; } iVar7 = iVar6 + 3; if ((flags & 0x80) == 0) { iVar7 = iVar6; } puVar3 = entry; if (entry != (uint *)poolList[2]) { repicksLeft = iVar7 + 2; if ((flags & 0x100) == 0) { repicksLeft = iVar7; } puVar10 = (uint *)poolList[2]; do { puVar9 = puVar10; fVar1 = (float)entry[1]; fVar11 = fVar11 + fVar1; if (fVar11 <= roll) { entry = entry + 6; puVar10 = puVar9; } else { uVar8 = *entry; pickFraction = (fVar11 - roll) / fVar1; fVar11 = (float)entry[2]; if (g_game == (Game *)0x0) { if (-1 < (int)uVar8) goto LAB_007330cc; LAB_00733143: itemConfig = (int *)0x0; LAB_0073314b: isAllowed = false; } else { if ((int)uVar8 < 0) { if (((int)uVar8 < 0) && (pvVar2 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar8 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2)) { itemConfig = (int *)**(undefined4 **)((int)pvVar2 + ~uVar8 * 4); } else { itemConfig = (int *)0x0; } } else { LAB_007330cc: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)uVar8) goto LAB_00733143; itemConfig = *(int **)((int)pvVar2 + uVar8 * 4); } if ((((itemConfig == (int *)0x0) || (bVar4 = Item::IsAvailable(itemConfig,0xffffffff), bVar4 == 0)) || (((uVar5 & 1) != 0 && (*itemConfig == 3)))) || (((((flags >> 3 & 1) != 0 && (*itemConfig != 3)) || ((flags & 0x10 << ((byte)itemConfig[0x30] & 0x1f)) != 0)) || (((flags & 0x200) != 0 && ((itemConfig[0x2f] & 2U) != 0)))))) goto LAB_0073314b; isAllowed = true; } if (1.0 - pickFraction < fVar11 / fVar1) { uVar8 = *entry >> 5; bitMask = 1 << ((byte)*entry & 0x1f); if ((((*(uint *)((int)(this->_removedCollectibles)._begin + uVar8 * 4) & bitMask) == 0) && ((*(uint *)((int)(this->_roomBlacklistedCollectibles)._begin + uVar8 * 4) & bitMask) == 0)) && (isAllowed)) goto LAB_007331eb; } if (repicksLeft < 1) { KAGE_LogMessage(1,(byte *)"[warn] item pool ran out of repicks\n"); puVar10 = entry + 6; if (puVar10 == (uint *)poolList[2]) { puVar10 = (uint *)poolList[1]; } goto joined_r0x0073322c; } fVar11 = 0.0; fVar1 = *poolList; roll = fVar1 * pickFraction; if (roll == fVar1) { roll = fVar1 / 3.37317; } entry = (uint *)poolList[1]; repicksLeft = repicksLeft + -1; puVar10 = (uint *)poolList[2]; } puVar3 = puVar9; } while (entry != puVar10); } goto LAB_007331e7; joined_r0x0073322c: puVar3 = puVar9; if (puVar10 != entry) { if (0.0 < (float)puVar10[2]) { uVar8 = *puVar10; iVar7 = (uVar8 >> 5) * 4; bitMask = 1 << ((byte)uVar8 & 0x1f); if (((*(uint *)((int)(this->_removedCollectibles)._begin + iVar7) & bitMask) == 0) && ((*(uint *)((int)(this->_roomBlacklistedCollectibles)._begin + iVar7) & bitMask) == 0)) { if (g_game == (Game *)0x0) { if (-1 < (int)uVar8) goto LAB_007332e6; } else { if ((int)uVar8 < 0) { iVar7 = -1 - uVar8; if ((iVar7 < 0) || (pvVar2 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2 <= iVar7)) { fallbackConfig = (int *)0x0; } else { fallbackConfig = (int *)**(undefined4 **)((int)pvVar2 + iVar7 * 4); } } else { LAB_007332e6: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)uVar8) goto LAB_00733347; fallbackConfig = *(int **)((int)pvVar2 + uVar8 * 4); } if ((((fallbackConfig != (int *)0x0) && (bVar4 = Item::IsAvailable(fallbackConfig,0xffffffff), bVar4 != 0)) && (((uVar5 & 1) == 0 || (*fallbackConfig != 3)))) && ((((flags >> 3 & 1) == 0 || (*fallbackConfig == 3)) && (puVar3 = puVar10, (flags & 0x10 << ((byte)itemConfig[0x30] & 0x1f)) == 0)))) goto LAB_007331e7; } } } LAB_00733347: puVar10 = puVar10 + 6; if (puVar10 == (uint *)poolList[2]) { puVar10 = (uint *)poolList[1]; } goto joined_r0x0073322c; } LAB_007331e7: entry = puVar3; LAB_007331eb: if (entry == (uint *)poolList[2]) { return (uint *)0x0; } if (((0.0 < (float)entry[2]) && ((~(byte)flags & 1) != 0)) && (fVar11 = (float)entry[2] - (float)entry[3], entry[2] = (uint)fVar11, fVar11 < (float)entry[4]) ) { entry[2] = 0; uVar5 = *entry; if ((-1 < (int)uVar5) && (g_game->_challenge != 0x2b)) { if (uVar5 == 0x1e4) { RemoveCollectible(this,0x126,0,0); } if (uVar5 < (this->_removedCollectibles)._size) { pvVar2 = (this->_removedCollectibles)._begin; *(uint *)((int)pvVar2 + (uVar5 >> 5) * 4) = *(uint *)((int)pvVar2 + (uVar5 >> 5) * 4) | 1 << (uVar5 & 0x1f); } } } return entry; } //@@ 007333f0 ItemPool::should_force_magic_skin /* DB: ? from ItemPool::GetCollectible (result true -> collectible 0x282 COLLECTIBLE_MAGIC_SKIN): needs Game+0x67748 > 0 and nobody owning Magic Skin, RNG roll < count*1%, and no Magic Skin pedestal (5.100.642) in the room or in any room's spawn list */ uint ItemPool::should_force_magic_skin(void) { code *pcVar1; Entity_Player *in_EAX; uint uVar2; uint uVar3; uint in_ECX; uint *puVar4; uint uVar5; void **ppvVar6; int *piVar7; uint uVar8; int local_8; if ((g_game->_magicSkinUses < 1) || (in_EAX = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x282,(RNG **)&g_game->_playerManager,1), in_EAX != (Entity_Player *)0x0)) { return (uint)in_EAX & 0xffffff00; } if (in_ECX == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } uVar2 = in_ECX >> 7 ^ in_ECX; uVar2 = uVar2 << 0x11 ^ uVar2; uVar2 = uVar2 >> 0x15 ^ uVar2; if ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283062e-10 < (float)g_game->_magicSkinUses * 0.01) { return CONCAT31((int3)((uint)-((int)uVar2 >> 0x1f) >> 8),1); } uVar5 = 0; uVar8 = *(uint *)((int)g_game->_room + 0x1264); if (uVar8 != 0) { puVar4 = *(uint **)((int)g_game->_room + 0x125c); do { uVar3 = *puVar4; if ((((uVar3 != 0) && (*(int *)(uVar3 + 0x28) == 5)) && (*(int *)(uVar3 + 0x2c) == 100)) && ((*(int *)(uVar3 + 0x30) == 0x282 && (*(int *)(uVar3 + 0x534) == 0)))) { LAB_007335dc: return uVar3 & 0xffffff00; } uVar5 = uVar5 + 1; puVar4 = puVar4 + 1; } while (uVar5 < uVar8); } ppvVar6 = &g_game->_roomList[0].Data; local_8 = 0; do { if ((*ppvVar6 != (void *)0x0) && (ppvVar6[0xc] != (void *)0x0)) { piVar7 = ((std_vector *)(ppvVar6 + 0x19))->_begin; uVar8 = 0; uVar3 = ((int)ppvVar6[0x1a] - (int)piVar7) / 0x78; if (uVar3 != 0) { do { if ((((*piVar7 == 5) && (piVar7[1] == 100)) && (piVar7[5] == 0)) && (piVar7[2] == 0x282)) goto LAB_007335dc; uVar8 = uVar8 + 1; piVar7 = piVar7 + 0x1e; } while (uVar8 < uVar3); } } local_8 = local_8 + 1; ppvVar6 = ppvVar6 + 0x2e; if (0x20e < local_8) { uVar5 = 4 - g_game->_magicSkinUses; uVar8 = 1; if (1 < (int)uVar5) { uVar8 = uVar5; } if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } uVar2 = uVar2 >> 7 ^ uVar2; uVar5 = uVar2 << 0x11 ^ uVar2; if (uVar8 == 0) { return CONCAT31((int3)(uVar2 >> 8),1); } uVar5 = uVar5 >> 0x15 ^ uVar5; return CONCAT31((int3)(uVar5 / uVar8 >> 8),uVar5 % uVar8 == 0); } } while( true ); } //@@ 00733610 ItemPool::GetCollectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall int ItemPool::GetCollectible(int itemPoolType, uint32_t seed, uint32_t flags, int defaultItem); prototype: db/protos.zhl, confirmed by RET 20 */ int __thiscall ItemPool::GetCollectible (ItemPool *this,int itemPoolType,uint seed,uint flags,int defaultItem,int fallbackPoolType ) { code *pcVar1; byte bVar2; char isForceMagicSkin; uint uVar3; Entity_Player *itemOwner; int iVar4; uint uVar5; int *list; ItemPool_Item *pIVar6; int triesLeft; void *pvVar7; float fVar8; uint length; byte isExcludeActives; uint *puVar9; RNG pickRng; uint isRemoveFromPool; uint rerollSeed; uint *local_90; uint poolFlags; char isChaos; ItemPool_Item *local_84; RNG poolRng; int dailyItemList [27]; dailyItemList[0x1a] = __security_cookie ^ (uint)(dailyItemList + 0x1b); poolFlags = flags; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"ItemPool::GetCollectible Seed is 0\n"); } if (((itemPoolType == -1) || (0x1e < (uint)itemPoolType)) || (seed == 0)) { return 0; } if ((defaultItem < 0) || (0x2dc < defaultItem)) { defaultItem = 0; } isRemoveFromPool = CONCAT31(isRemoveFromPool._1_3_,~(byte)poolFlags) & 0xffffff01; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x58); if (bVar2 != 0) { poolFlags = poolFlags | 2; } uVar3 = poolFlags >> 1; local_90 = (uint *)(CONCAT31(local_90._1_3_,(char)uVar3) & 0xffffff01); itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2d1,(RNG **)&g_game->_playerManager,1); if (itemOwner != (Entity_Player *)0x0) { iVar4 = CreateGlitchedCollectible(seed,0); return iVar4; } itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x192,(RNG **)&g_game->_playerManager,1); if ((itemOwner == (Entity_Player *)0x0) && (bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x192), bVar2 == 0)) { poolRng._shift3 = 0x14; poolRng._seed = seed; poolRng._shift1 = 3; poolRng._shift2 = 5; isChaos = '\0'; local_84 = (ItemPool_Item *)itemPoolType; } else { poolRng._shift3 = 0x14; poolRng._seed = seed; poolRng._shift1 = 3; poolRng._shift2 = 5; local_84 = (ItemPool_Item *)get_chaos_pool(this,&poolRng); isChaos = '\x01'; } this->_lastPool = (int)local_84; iVar4 = FUN_00865dc0(itemPoolType,isRemoveFromPool,seed); if (iVar4 != 0) { return iVar4; } iVar4 = (g_game->_dailyChallenge)._specialDailyId; if (iVar4 == 0x2c) { if (itemPoolType == 2) { return 0x1bb; } } else if (iVar4 == 0x2e) { if (itemPoolType == 0) { poolRng._shift3 = 0x13; poolRng._seed = seed; poolRng._shift1 = 1; poolRng._shift2 = 5; uVar3 = RNG::RandomInt(&poolRng,(uVar3 & 1 ^ 1) * 2 + 0x14); return *(int *)(&DAT_00b6a2c8 + uVar3 * 4); } } else if ((iVar4 == 0x32) && (itemPoolType == 0)) { poolRng._seed = seed; poolRng._shift1 = 1; poolRng._shift2 = 5; poolRng._shift3 = 0x13; uVar3 = RNG::RandomInt(&poolRng,4); return *(int *)(&DAT_00b6a2b8 + uVar3 * 4); } pickRng._shift3 = 6; pickRng._seed = seed; pickRng._shift1 = 1; pickRng._shift2 = 0xb; if (iVar4 == 1) { if (local_84 == (ItemPool_Item *)0x0) { dailyItemList[0] = 0x25; dailyItemList[1] = 0x7d; dailyItemList[2] = 0x6a; dailyItemList[3] = 0x13; bVar2 = 1; dailyItemList[4] = 0xbe; dailyItemList[5] = 0x8c; dailyItemList[6] = 0xdc; dailyItemList[7] = 0x41; dailyItemList[8] = 0x2a; dailyItemList[9] = 0x89; dailyItemList[10] = 0xfa; dailyItemList[0xb] = 0x83; dailyItemList[0x18] = 0x266; dailyItemList[0xc] = 0xd1; dailyItemList[0xd] = 0x34; dailyItemList[0xe] = 0x100; dailyItemList[0xf] = 0x158; dailyItemList[0x19] = 0x2d7; dailyItemList[0x10] = 0xdf; dailyItemList[0x11] = 0x161; dailyItemList[0x12] = 0x173; dailyItemList[0x13] = 0x1b0; dailyItemList[0x14] = 0x16e; dailyItemList[0x15] = 0x16f; dailyItemList[0x16] = 0x233; dailyItemList[0x17] = 0x247; pIVar6 = local_84; puVar9 = local_90; uVar5 = RNG::Next(&pickRng); isExcludeActives = (byte)puVar9; length = 0x1a; list = dailyItemList; LAB_007339a2: iVar4 = GetCollectibleFromList(this,list,length,uVar5,(uint)pIVar6,bVar2,isExcludeActives); if (iVar4 != 0) { return iVar4; } } } else if (iVar4 == 0x10) { if (local_84 == (ItemPool_Item *)0x2) { return 0x1a; } } else { pIVar6 = (ItemPool_Item *)(iVar4 - 0x12); if ((pIVar6 == (ItemPool_Item *)0x0) && (local_84 == (ItemPool_Item *)0x0)) { dailyItemList[9] = 0x11a; dailyItemList[10] = 0x17e; dailyItemList[0xb] = 0xd2; dailyItemList[0xc] = 0x3c; bVar2 = 1; dailyItemList[0xd] = 0x152; dailyItemList[0xe] = 0xc; dailyItemList[0xf] = 0x79; dailyItemList[0x10] = 0x78; dailyItemList[0x11] = 0x47; dailyItemList[0x12] = 0xf3; dailyItemList[0x13] = 0x36; dailyItemList[0x14] = 0x19f; dailyItemList[0x19] = 0x25c; dailyItemList[0x15] = 0x15; dailyItemList[0x16] = 0xa4; dailyItemList[0x17] = 0x121; dailyItemList[0x18] = 0x243; puVar9 = local_90; uVar5 = RNG::Next(&pickRng); isExcludeActives = (byte)puVar9; length = 0x11; list = dailyItemList + 9; goto LAB_007339a2; } } local_84 = this->_pools + (int)local_84; fVar8 = RNG::RandomFloat(&pickRng); local_90 = (uint *)(fVar8 * local_84->_totalWeight); local_90 = pick_weighted(this,&local_84->_totalWeight,poolFlags,(float)local_90); if (local_90 != (uint *)0x0) { rerollSeed = pickRng._seed; iVar4 = 0x14; do { triesLeft = iVar4; if (((char)local_90[5] != '\0') || (triesLeft = iVar4 + -1, iVar4 < 1)) { if (triesLeft != 0) { if ((char)isRemoveFromPool != '\0') { pvVar7 = (this->_roomBlacklistedCollectibles)._begin; uVar5 = *local_90 >> 5; *(uint *)((int)pvVar7 + uVar5 * 4) = *(uint *)((int)pvVar7 + uVar5 * 4) | 1 << (*local_90 & 0x1f); } if ((((*(byte *)((int)(this->_removedCollectibles)._begin + 4) & 2) == 0) && ((*(byte *)((int)(this->_roomBlacklistedCollectibles)._begin + 4) & 2) == 0)) && ((uVar3 & 1) == 0)) { pvVar7 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar7 & 0xfffffffcU) < 0x85) { pvVar7 = (void *)0x0; } else { pvVar7 = *(void **)((int)pvVar7 + 0x84); } bVar2 = Item::IsAvailable(pvVar7,0xffffffff); pIVar6 = local_84; if (bVar2 != 0) { uVar3 = __ftoui3(); uVar3 = RNG::RandomInt(&pickRng,uVar3); if ((int)uVar3 < pIVar6->_bibleUpgrade) { if ((char)isRemoveFromPool != '\0') { pvVar7 = (this->_roomBlacklistedCollectibles)._begin; *(uint *)((int)pvVar7 + 4) = *(uint *)((int)pvVar7 + 4) | 2; } defaultItem = 0x21; goto LAB_00733beb; } } } defaultItem = *local_90; goto LAB_00733beb; } break; } if (isChaos != '\0') { iVar4 = get_chaos_pool(this,&poolRng); this->_lastPool = iVar4; local_84 = this->_pools + iVar4; } if (rerollSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar4 = (*pcVar1)(); return iVar4; } rerollSeed = rerollSeed >> ((byte)pickRng._shift1 & 0x1f) ^ rerollSeed; rerollSeed = rerollSeed << ((byte)pickRng._shift2 & 0x1f) ^ rerollSeed; pickRng._seed = rerollSeed >> ((byte)pickRng._shift3 & 0x1f) ^ rerollSeed; rerollSeed = pickRng._seed; local_90 = pick_weighted(this,&local_84->_totalWeight,poolFlags, (float)((double)pickRng._seed + __uint_to_double_fixup[-(pickRng._seed >> 0x1f)]) * 2.3283062e-10 * local_84->_totalWeight); iVar4 = triesLeft; } while (local_90 != (uint *)0x0); } if (defaultItem == 0) { if (fallbackPoolType == -1) { defaultItem = 0x19; } else { defaultItem = GetCollectible(this,fallbackPoolType,seed,poolFlags,0,-1); } } LAB_00733beb: if ((poolFlags & 4) == 0) { isForceMagicSkin = should_force_magic_skin(); if (isForceMagicSkin != '\0') { defaultItem = 0x282; } iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,7); if (1 < iVar4) { uVar3 = __ftoui3(); uVar3 = RNG::RandomInt(&pickRng,uVar3); if ((int)uVar3 < iVar4 * 2) { defaultItem = 0x48; goto LAB_00733c61; } } if ((defaultItem == 0xdf) && ((g_game->_dailyChallenge)._specialDailyId == 0x34)) { defaultItem = 0x177; } } LAB_00733c61: iVar4 = FUN_00865f10(defaultItem,itemPoolType,isRemoveFromPool,seed); if (iVar4 == 0) { return defaultItem; } return iVar4; } //@@ 00733ca0 ItemPool::GetTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall uint32_t ItemPool::GetTrinket(bool DontAdvanceRNG); prototype: REPENTOGON, confirmed by RET 4 */ uint __thiscall ItemPool::GetTrinket(ItemPool *this,byte DontAdvanceRNG) { code *pcVar1; byte isAvailable; uint uVar2; uint uVar3; void *pvVar4; RNG *rng; void *poolBegin; uint trinketId; uint scanCount; uint triesLeft; RNG rngCopy; RNG retryRng; uint securityCookie; undefined1 auStack_8 [4]; bool isGolden; int prevSeed; securityCookie = __security_cookie ^ (uint)(auStack_8 + 4); if (this->_numAvailableTrinkets < 1) { ResetTrinkets(); } rngCopy._seed = (this->_trinketPoolRNG)._seed; rngCopy._shift1 = (this->_trinketPoolRNG)._shift1; rngCopy._shift2 = (this->_trinketPoolRNG)._shift2; rngCopy._shift3 = (this->_trinketPoolRNG)._shift3; rng = &rngCopy; if (DontAdvanceRNG == 0) { rng = &this->_trinketPoolRNG; } trinketId = 0; uVar2 = RNG::RandomInt(rng,(int)(this->_trinketPoolItems)._end - (int)(this->_trinketPoolItems)._begin >> 3); retryRng._seed = rng->_seed; triesLeft = (uint)((int)(this->_trinketPoolItems)._end - (int)(this->_trinketPoolItems)._begin >> 3) >> 1; retryRng._shift1 = 5; retryRng._shift2 = 9; retryRng._shift3 = 7; do { prevSeed = retryRng._seed; pvVar4 = (this->_trinketPoolItems)._begin; if ((*(char *)((int)pvVar4 + uVar2 * 8 + 4) != '\0') && (*(char *)((int)pvVar4 + uVar2 * 8 + 5) != '\0')) { uVar3 = *(uint *)((int)pvVar4 + uVar2 * 8) & 0x7fff; pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if ((int)uVar3 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 >> 2) { pvVar4 = *(void **)((int)pvVar4 + uVar3 * 4); } else { pvVar4 = (void *)0x0; } isAvailable = Item::IsAvailable(pvVar4,0xffffffff); if (isAvailable != 0) { if (-1 < (int)uVar2) { if (DontAdvanceRNG == 0) { *(undefined1 *)((int)(this->_trinketPoolItems)._begin + uVar2 * 8 + 4) = 0; this->_numAvailableTrinkets = this->_numAvailableTrinkets + -1; } trinketId = *(uint *)((int)(this->_trinketPoolItems)._begin + uVar2 * 8); goto LAB_00733ee0; } break; } } uVar3 = (int)(this->_trinketPoolItems)._end - (int)(this->_trinketPoolItems)._begin >> 3; if (prevSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } retryRng._seed = (uint)prevSeed >> ((byte)retryRng._shift1 & 0x1f) ^ prevSeed; retryRng._seed = retryRng._seed << ((byte)retryRng._shift2 & 0x1f) ^ retryRng._seed; retryRng._seed = (uint)retryRng._seed >> 7 ^ retryRng._seed; uVar2 = 0; if (uVar3 != 0) { uVar2 = (uint)retryRng._seed % uVar3; } triesLeft = triesLeft - 1; } while (0 < (int)triesLeft); KAGE_LogMessage(1,(byte *)"GetTrinket: no tries left\n"); uVar2 = RNG::RandomInt(&retryRng, (int)(this->_trinketPoolItems)._end - (int)(this->_trinketPoolItems)._begin >> 3); pvVar4 = (this->_trinketPoolItems)._end; poolBegin = (this->_trinketPoolItems)._begin; scanCount = 0; if ((int)pvVar4 - (int)poolBegin >> 3 != 0) { do { uVar2 = (uVar2 + 1) % (uint)((int)pvVar4 - (int)poolBegin >> 3); if ((*(char *)((int)poolBegin + uVar2 * 8 + 4) != '\0') && (*(char *)((int)poolBegin + uVar2 * 8 + 5) != '\0')) { uVar3 = *(uint *)((int)poolBegin + uVar2 * 8) & 0x7fff; pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if ((int)uVar3 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 >> 2) { pvVar4 = *(void **)((int)pvVar4 + uVar3 * 4); } else { pvVar4 = (void *)0x0; } isAvailable = Item::IsAvailable(pvVar4,0xffffffff); if (isAvailable != 0) { if (DontAdvanceRNG == 0) { *(undefined1 *)((int)(this->_trinketPoolItems)._begin + uVar2 * 8 + 4) = 0; this->_numAvailableTrinkets = this->_numAvailableTrinkets + -1; } trinketId = *(uint *)((int)(this->_trinketPoolItems)._begin + uVar2 * 8); break; } } pvVar4 = (this->_trinketPoolItems)._end; scanCount = scanCount + 1; poolBegin = (this->_trinketPoolItems)._begin; } while (scanCount < (uint)((int)pvVar4 - (int)poolBegin >> 3)); } LAB_00733ee0: uVar2 = FUN_008658c0(trinketId,&this->_trinketPoolRNG); if (uVar2 != 0) { return uVar2; } if (((g_manager->_persistentGameData)._achievements[0x269] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { retryRng._shift1 = 3; retryRng._shift2 = 3; uVar2 = rng->_seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } uVar2 = uVar2 >> 3 ^ uVar2; uVar2 = uVar2 << 3 ^ uVar2; uVar2 = uVar2 >> 0x1a ^ uVar2; if ((uVar2 == (uVar2 / 0x32) * 0x32) || (((uint)g_game->_debugFlags >> 3 & 1) != 0)) { isGolden = true; goto LAB_00733fc4; } } isGolden = false; LAB_00733fc4: uVar2 = trinketId | 0x8000; if (!isGolden) { uVar2 = trinketId; } return uVar2; } //@@ 00733ff0 ItemPool::RemoveCollectible /* ZHL [lua] Lua binding ItemPool:RemoveCollectible prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall ItemPool::RemoveCollectible (ItemPool *this,int collectibleId,byte isRequireAvailable,byte isQueryOnly) { void *pvVar1; uint uVar2; byte bVar3; ItemConfig_Item *this_00; bool bVar4; if (collectibleId < 0) { return 1; } if (isRequireAvailable != 0) { this_00 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if (this_00 == (ItemConfig_Item *)0x0) { return 0; } bVar3 = Item::IsAvailable(this_00,0xffffffff); if (bVar3 == 0) { return 0; } } if (g_game->_challenge == 0x2b) { return 0; } if ((collectibleId == 0x1e4) && (isQueryOnly == 0)) { RemoveCollectible(this,0x126,0,0); } bVar4 = true; if ((uint)collectibleId < (this->_removedCollectibles)._size) { pvVar1 = (this->_removedCollectibles)._begin; uVar2 = *(uint *)((int)pvVar1 + ((uint)collectibleId >> 5) * 4); bVar4 = (uVar2 & 1 << (sbyte)(collectibleId & 0x1fU)) == 0; if (isQueryOnly == 0) { *(uint *)((int)pvVar1 + ((uint)collectibleId >> 5) * 4) = uVar2 | 1 << (collectibleId & 0x1fU) ; } } return bVar4; } //@@ 007340b0 ItemPool::ResetCollectible /* ZHL [exact] __thiscall void ItemPool::ResetCollectible(int Collectible); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ItemPool::ResetCollectible(ItemPool *this,int Collectible) { void *pvVar1; int *piVar2; void **ppvVar3; uint uVar4; int iVar5; if (-1 < Collectible) { pvVar1 = (this->_removedCollectibles)._begin; uVar4 = (uint)Collectible >> 5; *(uint *)((int)pvVar1 + uVar4 * 4) = *(uint *)((int)pvVar1 + uVar4 * 4) & ~(1 << (Collectible & 0x1fU)); pvVar1 = (this->_roomBlacklistedCollectibles)._begin; *(uint *)((int)pvVar1 + uVar4 * 4) = *(uint *)((int)pvVar1 + uVar4 * 4) & ~(1 << (Collectible & 0x1fU)); ppvVar3 = &this->_pools[0]._poolList._end; iVar5 = 0x1f; do { piVar2 = ((std_vector *)(ppvVar3 + -1))->_begin; if (piVar2 != *ppvVar3) { do { if (*piVar2 == Collectible) { piVar2[2] = piVar2[1]; } piVar2 = piVar2 + 6; } while (piVar2 != *ppvVar3); } ppvVar3 = ppvVar3 + 0xd; iVar5 = iVar5 + -1; } while (iVar5 != 0); } return; } //@@ 00734130 ItemPool::RemoveTrinket /* ZHL [lua] Lua binding ItemPool:RemoveTrinket */ uint __thiscall ItemPool::RemoveTrinket(ItemPool *this,int param_2) { void *pvVar1; uint in_EAX; int iVar2; if (0 < param_2) { pvVar1 = (this->_trinketPoolItems)._begin; iVar2 = (int)(this->_trinketPoolItems)._end - (int)pvVar1; in_EAX = iVar2 >> 3; if (((param_2 < (int)in_EAX) && (*(char *)((int)pvVar1 + param_2 * 8 + 4) != '\0')) && (*(char *)((int)pvVar1 + param_2 * 8 + 5) != '\0')) { *(undefined1 *)((int)pvVar1 + param_2 * 8 + 4) = 0; this->_numAvailableTrinkets = this->_numAvailableTrinkets + -1; return CONCAT31((int3)(iVar2 >> 0xb),1); } } return in_EAX & 0xffffff00; } //@@ 00734180 ItemPool::GetCardEx /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 5 args seed/special/rune/suit/allowNonCards; "No unlocked cards/runes" prototype: REPENTOGON, confirmed by RET 20 */ int ItemPool::GetCardEx(int Seed,int SpecialChance,int RuneChance,int SuitChance,byte AllowNonCards) { code *pcVar1; char cVar2; uint *cardPoolEnd; int iVar3; int *playerIt; byte rngShift1; uint uVar4; uint uVar5; uint local_28; int rngShift3; uint local_20; RNG rng; uint local_c; undefined1 auStack_8 [4]; void *cardsBegin; local_c = __security_cookie ^ (uint)(auStack_8 + 4); iVar3 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar3 + 0xc) < DAT_00c8102c) && (_Init_thread_header(&DAT_00c8102c), DAT_00c8102c == -1)) { _atexit((_func_4879 *)&LAB_00b15b00); _Init_thread_footer(&DAT_00c8102c); } if ((*(int *)(iVar3 + 0xc) < DAT_00c8103c) && (_Init_thread_header(&DAT_00c8103c), DAT_00c8103c == -1)) { _atexit((_func_4879 *)&LAB_00b15af0); _Init_thread_footer(&DAT_00c8103c); } if ((*(int *)(iVar3 + 0xc) < DAT_00c8104c) && (_Init_thread_header(&DAT_00c8104c), DAT_00c8104c == -1)) { _atexit((_func_4879 *)&LAB_00b15ae0); _Init_thread_footer(&DAT_00c8104c); } if ((*(int *)(iVar3 + 0xc) < DAT_00c8105c) && (_Init_thread_header(&DAT_00c8105c), DAT_00c8105c == -1)) { _atexit((_func_4879 *)&LAB_00b15ad0); _Init_thread_footer(&DAT_00c8105c); } uVar5 = 1; rngShift3 = 0x1d; rng._shift3 = 0x1d; DAT_00c81034 = DAT_00c81030; DAT_00c81044 = DAT_00c81040; DAT_00c81054 = DAT_00c81050; DAT_00c81064 = DAT_00c81060; rng._shift1 = 3; rng._shift2 = 3; local_28 = (int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2; if (1 < local_28) { do { if (((int)uVar5 < 0) || (cardsBegin = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)cardsBegin >> 2 <= (int)uVar5)) { iVar3 = 0; } else { iVar3 = *(int *)((int)cardsBegin + uVar5 * 4); } cVar2 = Card::IsAvailable(); if ((cVar2 != '\0') && (uVar5 != 0x37)) { if (1 < *(int *)&g_game->_deathmatchManager) { cVar2 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x24))(uVar5); if (cVar2 != '\0') goto switchD_007342be_default; } switch(*(undefined4 *)(iVar3 + 0x58)) { case 0: cardPoolEnd = DAT_00c81064; if (DAT_00c81064 == DAT_00c81068) { LAB_0073437e: local_20 = uVar5; std::vector<4byte>::_Emplace_reallocate(cardPoolEnd,&local_20); } else { *DAT_00c81064 = uVar5; DAT_00c81064 = DAT_00c81064 + 1; local_20 = uVar5; } break; case 1: if (SuitChance != 0) { cardPoolEnd = DAT_00c81054; if (DAT_00c81054 == DAT_00c81058) goto LAB_0073437e; *DAT_00c81054 = uVar5; DAT_00c81054 = DAT_00c81054 + 1; local_20 = uVar5; } break; case 2: if (RuneChance != 0) { cardPoolEnd = DAT_00c81044; if (DAT_00c81044 == DAT_00c81048) goto LAB_0073437e; *DAT_00c81044 = uVar5; DAT_00c81044 = DAT_00c81044 + 1; local_20 = uVar5; } break; case 3: switchD_007342be_caseD_3: if (SpecialChance != 0) { cardPoolEnd = DAT_00c81034; if (DAT_00c81034 == DAT_00c81038) goto LAB_0073437e; *DAT_00c81034 = uVar5; DAT_00c81034 = DAT_00c81034 + 1; local_20 = uVar5; } break; case 4: if (AllowNonCards != 0) goto switchD_007342be_caseD_3; } } switchD_007342be_default: uVar5 = uVar5 + 1; } while (uVar5 < local_28); } uVar5 = (int)DAT_00c81044 - (int)DAT_00c81040 >> 2; if ((uVar5 != 0) || (RuneChance == -1)) { while (uVar5 < 6) { local_28 = 0; if (DAT_00c81044 == DAT_00c81048) { std::vector<4byte>::_Emplace_reallocate(DAT_00c81044,&local_28); } else { *DAT_00c81044 = 0; DAT_00c81044 = DAT_00c81044 + 1; } uVar5 = (int)DAT_00c81044 - (int)DAT_00c81040 >> 2; } } local_20 = 1; if (RuneChance != -1) { local_20 = RuneChance; } uVar5 = 0; if (SpecialChance == 0) { LAB_00734485: rngShift1 = (byte)rng._shift1; LAB_00734488: if (local_20 != 0) { if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } rng._seed = (uint)Seed >> (rngShift1 & 0x1f) ^ Seed; rng._seed = rng._seed << ((byte)rng._shift2 & 0x1f) ^ rng._seed; rng._seed = (uint)rng._seed >> ((byte)rngShift3 & 0x1f) ^ rng._seed; Seed = rng._seed; if (((uint)rng._seed % local_20 == 0) && (uVar4 = (int)DAT_00c81044 - (int)DAT_00c81040 >> 2, uVar4 != 0)) { uVar5 = RNG::RandomInt(&rng,uVar4); uVar5 = DAT_00c81040[uVar5]; if (uVar5 != 0) goto LAB_0073467f; if ((local_20 == 1) || (uVar4 = RNG::RandomInt(&rng,5), uVar4 == 0)) { uVar5 = 0x37; Seed = rng._seed; goto LAB_007346b0; } rngShift1 = (byte)rng._shift1; rngShift3 = rng._shift3; Seed = rng._seed; } } if (SuitChance != 0) { if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } rng._seed = (uint)Seed >> (rngShift1 & 0x1f) ^ Seed; rng._seed = rng._seed << ((byte)rng._shift2 & 0x1f) ^ rng._seed; rng._seed = (uint)rng._seed >> ((byte)rngShift3 & 0x1f) ^ rng._seed; Seed = rng._seed; if (((uint)rng._seed % (uint)SuitChance == 0) && (uVar4 = (int)DAT_00c81054 - (int)DAT_00c81050 >> 2, uVar4 != 0)) { uVar5 = RNG::RandomInt(&rng,uVar4); uVar5 = DAT_00c81050[uVar5]; if (uVar5 != 0) goto LAB_0073467f; rngShift1 = (byte)rng._shift1; rngShift3 = rng._shift3; Seed = rng._seed; } } local_28 = (int)DAT_00c81064 - (int)DAT_00c81060 >> 2; if (local_28 != 0) { if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } uVar5 = (uint)Seed >> (rngShift1 & 0x1f) ^ Seed; uVar5 = uVar5 << ((byte)rng._shift2 & 0x1f) ^ uVar5; Seed = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; uVar5 = DAT_00c81060[(uint)Seed % local_28]; goto LAB_007345f2; } } else { if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } rngShift1 = (byte)rng._shift1; uVar4 = (uint)Seed >> (rngShift1 & 0x1f) ^ Seed; uVar4 = uVar4 << ((byte)rng._shift2 & 0x1f) ^ uVar4; Seed = uVar4 >> ((byte)rngShift3 & 0x1f) ^ uVar4; rng._seed = Seed; if (((uint)Seed % (uint)SpecialChance != 0) || (uVar4 = (int)DAT_00c81034 - (int)DAT_00c81030 >> 2, uVar4 == 0)) goto LAB_00734488; uVar5 = RNG::RandomInt(&rng,uVar4); uVar5 = DAT_00c81030[uVar5]; if (uVar5 == 0) { rngShift3 = rng._shift3; Seed = rng._seed; goto LAB_00734485; } LAB_0073467f: rngShift1 = (byte)rng._shift1; rngShift3 = rng._shift3; Seed = rng._seed; LAB_007345f2: uVar4 = uVar5; if (0 < (int)uVar5) { if (0x16 < (int)uVar5) goto LAB_007346b0; if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } uVar4 = (uint)Seed >> (rngShift1 & 0x1f) ^ Seed; uVar4 = uVar4 << ((byte)rng._shift2 & 0x1f) ^ uVar4; Seed = uVar4 >> ((byte)rngShift3 & 0x1f) ^ uVar4; if (Seed != ((uint)Seed / 7) * 7) goto LAB_007346b0; uVar4 = uVar5 + 0x37; cVar2 = Card::IsAvailable(); if (cVar2 == '\0') goto LAB_007346b0; } uVar5 = uVar4; if (uVar4 != 0) goto LAB_007346b0; } KAGE_LogMessage(0x10,(byte *)"No unlocked cards/runes to pick from!\n"); LAB_007346b0: if (SpecialChance != 0) { for (playerIt = (g_game->_playerManager)._playerList._begin; playerIt != (g_game->_playerManager)._playerList._end; playerIt = playerIt + 1) { iVar3 = *playerIt; if (((*(int *)(iVar3 + 0x2c) == 0) && (*(char *)(iVar3 + 0x20a9) == '\0')) && (*(int *)(iVar3 + 0x13c0) == 0x1f)) { rng._shift1 = 6; rng._shift2 = 3; local_28 = 0x11; if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } uVar4 = (uint)Seed >> 6 ^ Seed; uVar4 = uVar4 << 3 ^ uVar4; uVar4 = uVar4 >> 0x11 ^ uVar4; if (uVar4 == (uVar4 / 10) * 10) { return 0x33; } return uVar5; } } } return uVar5; } //@@ 00734870 ItemPool::GetCard /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding ItemPool:GetCard */ void ItemPool::GetCard(int param_1,byte param_2,byte param_3,byte param_4) { int RuneChance; int SpecialChance; int iVar1; RNG local_18; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = 0; if (param_2 != 0) { iVar1 = 10; } if (param_4 == 0) { RuneChance = 0; if (param_3 != 0) { RuneChance = 10; } } else { RuneChance = 1; } SpecialChance = 0x19; if (param_4 != 0) { SpecialChance = 0; } iVar1 = GetCardEx(param_1,SpecialChance,RuneChance,iVar1,1); local_18._seed = param_1; local_18._shift1 = 5; local_18._shift2 = 9; local_18._shift3 = 7; lua_callback_run_get_card(&local_18,iVar1,param_2,param_3,param_4); return; } //@@ 00734900 ItemPool::GetPill /* ZHL [lua] Lua binding ItemPool:GetPill prototype: db/protos.zhl, confirmed by RET 4 */ int ItemPool::GetPill(uint seed) { code *pcVar1; int iVar2; uint uVar3; uint uVar4; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar3 = seed >> 2 ^ seed; uVar3 = uVar3 << 7 ^ uVar3; uVar3 = uVar3 >> 9 ^ uVar3; uVar4 = uVar3 % 0xd + 1; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar3 = uVar3 >> 2 ^ uVar3; uVar3 = uVar3 << 7 ^ uVar3; uVar3 = uVar3 >> 9 ^ uVar3; if (uVar3 % 0x8c == 0) { if (((g_manager->_persistentGameData)._achievements[0x25b] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { uVar4 = 0xe; } } if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar3 = uVar3 >> 2 ^ uVar3; uVar3 = uVar3 << 7 ^ uVar3; if (((uVar3 >> 9 ^ uVar3) % 0x46 == 0) && (((g_manager->_persistentGameData)._achievements[0x25e] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { uVar4 = uVar4 | 0x800; } uVar3 = FUN_00865c80(9,seed); if (uVar3 != 0) { uVar4 = uVar3; } return uVar4; } //@@ 00734a80 ItemPool::GetPillEffect /* ZHL [exact] __thiscall int ItemPool::GetPillEffect(unsigned int pillColor, Entity_Player* player); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall ItemPool::GetPillEffect(ItemPool *this,uint pillColor,Entity_Player *player) { byte bVar1; byte isUsable; int iVar2; uint pairIdx; int pillEffect; if ((g_game->_dailyChallenge)._specialDailyId == 0x29) { return 4; } pillEffect = *(int *)((int)this[1]._pools + (pillColor & 0x7ff) * 4 + -4); if (player != (Entity_Player *)0x0) { bVar1 = Entity_Player::HasCollectible(player,0x4b,0); if ((((bVar1 == 0) && (bVar1 = Entity_Player::HasCollectible(player,0x12f,0), bVar1 == 0)) && (bVar1 = Entity_Player::HasCollectible(player,0x2e,0), bVar1 == 0)) && (iVar2 = Entity_Player::GetZodiacEffect(player), iVar2 != 0x12f)) { bVar1 = Entity_Player::HasCollectible(player,0x28e,0); if (bVar1 != 0) { switch(pillEffect) { case 0: case 7: case 0x26: pillEffect = 6; break; case 2: case 5: case 0x15: pillEffect = 1; break; case 3: case 0x10: case 0x22: pillEffect = 0xf; break; case 4: case 0xc: case 0x20: pillEffect = 0xb; break; case 10: case 0x12: case 0x23: pillEffect = 0x11; break; case 0xe: case 0x14: case 0x21: pillEffect = 0xd; break; case 0x13: pillEffect = 0x1f; break; case 0x17: case 0x1a: pillEffect = 0x19; break; case 0x18: pillEffect = 0x16; break; case 0x1c: pillEffect = 0x1d; break; case 0x24: pillEffect = 0x1b; break; case 0x28: pillEffect = 0x27; break; case 0x29: pillEffect = 0x2a; break; case 0x2b: case 0x2e: pillEffect = 0x2c; break; case 0x2d: pillEffect = 0x25; break; case 0x30: pillEffect = 0x2f; } } } else { bVar1 = Entity_Player::HasCollectible(player,0x28e,0); if (bVar1 == 0) { pairIdx = 0; do { bVar1 = 0; if ((&DAT_00b6a240)[pairIdx] == pillEffect) { pillEffect = *(int *)(&UNK_00b6a27c + pairIdx * 4); break; } pairIdx = pairIdx + 1; } while (pairIdx < 0xf); } else { bVar1 = 0; } } isUsable = Entity_Player::CanUsePill(player,pillEffect); if (isUsable == 0) { if (pillEffect == 1) { pillEffect = 5; if (bVar1 != 0) { pillEffect = 8; } } else if (pillEffect == 6) { pillEffect = bVar1 + 7; } } } iVar2 = LuaEngine::GetPillEffect(pillEffect,pillColor & 0x7ff); if (iVar2 != -1) { pillEffect = iVar2; } return pillEffect; } //@@ 00734cc0 ItemPool::remove_deathmatch_pill_effects /* DB: ? when g_game->_deathmatchManager type > 1: collects available pill effects (PillEffect::IsAvailable) not disallowed by the deathmatch manager (vfunc +0x28), then re-rolls disallowed entries of the 15 pill-colour slots (+0x7a4) with the pool RNG (+0x654); from FUN_0042a4d0 */ void ItemPool::remove_deathmatch_pill_effects(void) { int *piVar1; code *pcVar2; char cVar3; uint uVar4; int *piVar5; int in_ECX; std_vector *pillEffects; uint pickIndex; int iVar6; int *piVar7; uint candidateCount; int *piVar8; int *candidatesEnd; uint local_24; int *local_1c; int self; char isInPool; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afd66d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (1 < *(int *)&g_game->_deathmatchManager) { piVar8 = (int *)0x0; candidatesEnd = (int *)0x0; local_8 = 0; pillEffects = &(g_manager->_itemConfig)._pillEffects; local_24 = 0; self = in_ECX; if ((int)(g_manager->_itemConfig)._pillEffects._end - (int)pillEffects->_begin >> 2 != 0) { do { if (((int)local_24 < 0) || ((int)pillEffects->_end - (int)pillEffects->_begin >> 2 <= (int)local_24)) { local_1c = (int *)0x0; } else { local_1c = *(int **)((int)pillEffects->_begin + local_24 * 4); } cVar3 = PillEffect::IsAvailable(uVar4); if (cVar3 != '\0') { isInPool = '\0'; piVar7 = (int *)(self + 0x7a4); iVar6 = 0xf; piVar5 = local_1c; do { if (*piVar7 == *piVar5) { isInPool = '\x01'; cVar3 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x28))(*piVar7); piVar5 = local_1c; if (cVar3 != '\0') { *piVar7 = -1; } } piVar1 = local_1c; piVar7 = piVar7 + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); if ((isInPool == '\0') && (cVar3 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x28))(*local_1c), cVar3 == '\0')) { local_1c = (int *)*piVar1; if (piVar8 == (int *)0x0) { std::vector<4byte>::_Emplace_reallocate(0,&local_1c); piVar8 = candidatesEnd; } else { *piVar8 = (int)local_1c; candidatesEnd = piVar8 + 1; piVar8 = candidatesEnd; } } } pillEffects = &(g_manager->_itemConfig)._pillEffects; local_24 = local_24 + 1; } while (local_24 < (uint)((int)(g_manager->_itemConfig)._pillEffects._end - (int)pillEffects->_begin >> 2)); } local_1c = (int *)0x0; piVar7 = (int *)0x0; local_24 = 0xe; piVar5 = (int *)(self + 0x7a8); iVar6 = self; do { if (*piVar5 == -1) { uVar4 = *(uint *)(iVar6 + 0x654); candidateCount = (int)piVar8 - (int)local_1c >> 2; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *(uint *)(self + 0x654); iVar6 = self; if (uVar4 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } piVar7 = local_1c; uVar4 = uVar4 >> ((byte)*(undefined4 *)(iVar6 + 0x658) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)(self + 0x65c) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)(self + 0x660) & 0x1f) ^ uVar4; pickIndex = 0; *(uint *)(self + 0x654) = uVar4; if (candidateCount != 0) { pickIndex = uVar4 % candidateCount; } piVar1 = local_1c + pickIndex; *piVar5 = local_1c[pickIndex]; memmove(piVar1,piVar1 + 1,(int)piVar8 - (int)(piVar1 + 1)); piVar8 = piVar8 + -1; iVar6 = self; } piVar5 = piVar5 + 1; local_24 = local_24 + -1; } while (local_24 != 0); if (piVar7 != (int *)0x0) { uVar4 = -(int)piVar7 & 0xfffffffc; piVar8 = piVar7; if (0xfff < uVar4) { piVar8 = (int *)piVar7[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)piVar7 + (-4 - (int)piVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar8,uVar4); } } ExceptionList = local_10; return; } //@@ 00734f30 ItemPool::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0073588d) */ /* WARNING: Removing unreachable block (ram,0x00735857) */ /* WARNING: Removing unreachable block (ram,0x00735869) */ /* WARNING: Removing unreachable block (ram,0x00735879) */ /* WARNING: Removing unreachable block (ram,0x0073589f) */ /* WARNING: Removing unreachable block (ram,0x007358af) */ /* WARNING: Removing unreachable block (ram,0x007358db) */ /* DB: zhl Init(seed, filename); this=ItemPool, stores seed at +0 and +0x654, RNG shift consts, calls shuffle_pools/ResetTrinkets; caller 0x6f8140 is the run start ("RNG Start Seed", "itempools.xml") prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ItemPool::Init(ItemPool *this,uint seed,byte *filename) { char *pcVar1; char isExcluded; uint uVar2; SoundEffect *pSVar3; void *pvVar4; int iVar5; SoundEffect SVar6; Manager *manager; uint uVar7; Game *game; SoundEffect *pillColorsEnd; SoundEffect pillEffectsEnd; uint cardId; uint local_70; SoundEffect local_6c; uint local_68; SoundEffect local_64; int bannedItems [11]; char pillClassByColor [16]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *bitWord; code *debugBreak; undefined1 *loadedSoundCount; SoundEffect nextEntry; SoundEffect pillEffectId; undefined4 swapTmp; std_vector *trinketPoolItems; puStack_20 = pillClassByColor + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00afd6a8; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(pillClassByColor + 0x24); ExceptionList = &local_1c; this->_seed = seed; (this->_itemPoolRNG)._shift1 = 1; (this->_itemPoolRNG)._shift2 = 9; (this->_itemPoolRNG)._seed = seed; (this->_itemPoolRNG)._shift3 = 0x1d; pcVar1 = pillClassByColor + 0x30; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = (this->_itemPoolRNG)._seed; pcVar1 = puStack_20; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } puStack_20 = pcVar1; uVar2 = seed >> ((byte)(this->_itemPoolRNG)._shift1 & 0x1f) ^ seed; uVar2 = uVar2 << ((byte)(this->_itemPoolRNG)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_itemPoolRNG)._shift3 & 0x1f) ^ uVar2; (this->_itemPoolRNG)._seed = uVar2; (this->_trinketPoolRNG)._seed = uVar2; (this->_trinketPoolRNG)._shift1 = 1; (this->_trinketPoolRNG)._shift2 = 5; (this->_trinketPoolRNG)._shift3 = 0x13; manager = g_manager; this->_lastPool = 0; uVar2 = (int)(manager->_itemConfig)._collectibles._end - (int)(manager->_itemConfig)._collectibles._begin >> 2; vector_bool_resize(&this->_removedCollectibles,uVar2,(byte)uVar2); uVar2 = (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2; vector_bool_resize(&this->_roomBlacklistedCollectibles,uVar2,(byte)uVar2); trinketPoolItems = &this->_trinketPoolItems; pvVar4 = (this->_trinketPoolItems)._end; local_64 = (SoundEffect)((int)pvVar4 - (int)trinketPoolItems->_begin >> 3); SVar6 = (SoundEffect) ((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2); if ((uint)SVar6 < (uint)local_64) { (this->_trinketPoolItems)._end = (void *)((int)trinketPoolItems->_begin + (int)SVar6 * 8); } else if ((uint)local_64 < (uint)SVar6) { if ((uint)((int)(this->_trinketPoolItems)._capacity - (int)trinketPoolItems->_begin >> 3) < (uint)SVar6) { std::vector<8byte>::_Resize_reallocate(SVar6,pvVar4); } else { iVar5 = (int)SVar6 - (int)local_64; if (iVar5 != 0) { memset(pvVar4,0,iVar5 * 8); pvVar4 = (void *)((int)pvVar4 + iVar5 * 8); } (this->_trinketPoolItems)._end = pvVar4; } } local_6c = (SoundEffect)0x0; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2 != 0) { do { uVar7 = (uint)local_6c >> 5; uVar2 = ~(1 << (local_6c._0_1_ & 0x1f)); local_6c = (SoundEffect)((int)local_6c + 1); bitWord = (uint *)((int)(this->_removedCollectibles)._begin + uVar7 * 4); *bitWord = *bitWord & uVar2; manager = g_manager; bitWord = (uint *)((int)(this->_roomBlacklistedCollectibles)._begin + uVar7 * 4); *bitWord = *bitWord & uVar2; } while ((uint)local_6c < (uint)((int)(manager->_itemConfig)._collectibles._end - (int)(manager->_itemConfig)._collectibles._begin >> 2)); } this->_unkFloat674 = 1.0; this->_unkFloat678 = 1.0; load_pools(this,filename,0); ModManager::LoadModItemPools(); shuffle_pools(this); if (g_game->_challenge == 0x1d) { uVar2 = 0; bannedItems[0] = 0x44; bannedItems[1] = 0x76; bannedItems[2] = 0x149; bannedItems[3] = 0x34; bannedItems[8] = 0x37; bannedItems[4] = 0xa8; bannedItems[5] = 0x72; bannedItems[6] = 0x18b; bannedItems[7] = 0x18a; bannedItems[9] = 0x57; bannedItems[10] = 0xe5; do { RemoveCollectible(this,bannedItems[uVar2],0,0); uVar2 = uVar2 + 1; } while (uVar2 < 0xb); } ResetTrinkets(this); builtin_strncpy(pillClassByColor,"\x03\x03\x03\x03",4); this[1]._pools[1]._poolList._begin = (void *)0x0; this[1]._pools[1]._poolList._end = (void *)0x0; this[1]._pools[1]._poolList._capacity = (void *)0x0; *(undefined2 *)&this[1]._pools[1]._rng1._seed = 0; *(undefined1 *)((int)&this[1]._pools[1]._rng1._seed + 2) = 0; pillClassByColor[4] = '\x02'; pillClassByColor[5] = '\x01'; pillClassByColor[6] = '\0'; pillClassByColor[7] = -1; pillClassByColor[8] = -1; pillClassByColor[9] = '\x03'; pillClassByColor[10] = '\x02'; pillClassByColor[0xb] = '\x01'; pillClassByColor[0xc] = -1; pillClassByColor[0xd] = -1; pillColorsEnd = (SoundEffect *)0x0; local_14 = 0; local_6c = (SoundEffect)0x1; do { if (pillColorsEnd == (SoundEffect *)0x0) { local_64 = local_6c; std::vector<4byte>::_Emplace_reallocate(0,&local_64); } else { *pillColorsEnd = local_6c; pillColorsEnd = pillColorsEnd + 1; } local_6c = (SoundEffect)((int)local_6c + 1); } while ((uint)local_6c < 0xe); local_68 = (int)pillColorsEnd >> 2; SVar6 = (SoundEffect)(local_68 - 1); if (0 < (int)SVar6) { local_64 = SVar6; do { uVar2 = (this->_itemPoolRNG)._seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_itemPoolRNG)._seed; if (uVar2 == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } uVar2 = uVar2 >> ((byte)(this->_itemPoolRNG)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_itemPoolRNG)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_itemPoolRNG)._shift3 & 0x1f) ^ uVar2; (this->_itemPoolRNG)._seed = uVar2; if (local_68 == 0) { local_6c = (SoundEffect)0x0; } else { local_6c = (SoundEffect)(uVar2 % local_68); } local_68 = local_68 - 1; swapTmp = *(undefined4 *)((int)SVar6 * 4); *(undefined4 *)((int)SVar6 * 4) = *(undefined4 *)((int)local_6c * 4); SVar6 = (SoundEffect)((int)SVar6 + -1); *(undefined4 *)((int)local_6c * 4) = swapTmp; } while (0 < (int)SVar6); } local_64 = (SoundEffect)0xe; if (pillColorsEnd == (SoundEffect *)0x0) { std::vector<4byte>::_Emplace_reallocate(0,&local_64); } else { *pillColorsEnd = (SoundEffect)0xe; pillColorsEnd = pillColorsEnd + 1; } pillEffectsEnd = (SoundEffect)0x0; local_14 = CONCAT31(local_14._1_3_,1); local_70 = 0; manager = g_manager; if ((int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2 != 0) { game = g_game; do { if (((int)local_70 < 0) || ((int)(manager->_itemConfig)._pillEffects._end - (int)(manager->_itemConfig)._pillEffects._begin >> 2 <= (int)local_70)) { pSVar3 = (SoundEffect *)0x0; } else { pSVar3 = *(SoundEffect **)((int)(manager->_itemConfig)._pillEffects._begin + local_70 * 4); } if (game == (Game *)0x0) { LAB_00735425: SVar6 = pSVar3[1]; if (((int)SVar6 < 0) || (((uint)SVar6 < 0x282 && (((SVar6 == (SoundEffect)0x0 || ((manager->_persistentGameData)._achievements[(int)SVar6] != 0)) || (((manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))))) { local_64 = *pSVar3; if (pillEffectsEnd == (SoundEffect)0x0) { std::vector<4byte>::_Emplace_reallocate(0,&local_64); manager = g_manager; game = g_game; } else { *(SoundEffect *)pillEffectsEnd = local_64; pillEffectsEnd = (SoundEffect)((int)pillEffectsEnd + 4); } local_64 = pSVar3[0xf]; if ((-1 < (int)local_64) && ((int)local_64 < ((int)(manager->_sfxManager)._sounds._end - (int)(manager->_sfxManager)._sounds._begin ) / 0x1b8)) { pSVar3 = (SoundEffect *) ((int)local_64 * 0x1b8 + (int)(manager->_sfxManager)._sounds._begin); if (*(char *)(pSVar3 + 0x66) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load(pSVar3); loadedSoundCount = &(manager->_sfxManager).field_0xc; *(int *)loadedSoundCount = *(int *)loadedSoundCount + 1; manager = g_manager; game = g_game; } pSVar3[0x66].field_0x1 = 0; } } } else { if (*(char *)(pSVar3 + 0xe) != '\0') { LAB_007353f3: if (1 < *(int *)&game->_deathmatchManager) { isExcluded = (**(code **)(*(int *)(game->_deathmatchManager)._type + 0x28))(*pSVar3); manager = g_manager; game = g_game; if (isExcluded != '\0') goto LAB_0073551e; } goto LAB_00735425; } if (game->_difficulty != 2) { if (game->_difficulty != 3) goto LAB_007353f3; } } LAB_0073551e: local_70 = local_70 + 1; } while (local_70 < (uint)((int)(manager->_itemConfig)._pillEffects._end - (int)(manager->_itemConfig)._pillEffects._begin >> 2)); } local_70 = (int)pillEffectsEnd >> 2; SVar6 = (SoundEffect)(local_70 - 1); if (0 < (int)SVar6) { local_64 = SVar6; do { local_68 = (this->_itemPoolRNG)._seed; if (local_68 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_68 = (this->_itemPoolRNG)._seed; if (local_68 == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } local_68 = local_68 >> ((byte)(this->_itemPoolRNG)._shift1 & 0x1f) ^ local_68; local_68 = local_68 << ((byte)(this->_itemPoolRNG)._shift2 & 0x1f) ^ local_68; local_68 = local_68 >> ((byte)(this->_itemPoolRNG)._shift3 & 0x1f) ^ local_68; (this->_itemPoolRNG)._seed = local_68; if (local_70 == 0) { local_68 = 0; } else { local_68 = local_68 % local_70; } local_70 = local_70 - 1; swapTmp = *(undefined4 *)((int)SVar6 * 4); *(undefined4 *)((int)SVar6 * 4) = *(undefined4 *)(local_68 * 4); SVar6 = (SoundEffect)((int)SVar6 + -1); *(undefined4 *)(local_68 * 4) = swapTmp; } while (0 < (int)SVar6); manager = g_manager; } local_68 = 0; if ((int)pillColorsEnd >> 2 != 0) { do { if (((local_68 < 0xe) && (-1 < pillClassByColor[local_68])) && (SVar6 = (SoundEffect)0x0, pillEffectsEnd != (SoundEffect)0x0)) { do { pillEffectId = *(SoundEffect *)SVar6; if (((int)pillEffectId < 0) || (pvVar4 = (manager->_itemConfig)._pillEffects._begin, (int)(manager->_itemConfig)._pillEffects._end - (int)pvVar4 >> 2 <= (int)pillEffectId)) { iVar5 = 0; } else { iVar5 = *(int *)((int)pvVar4 + (int)pillEffectId * 4); } nextEntry = (SoundEffect)((int)SVar6 + 4); if (*(char *)(iVar5 + 0x4c) == pillClassByColor[local_68]) { *(SoundEffect *)((int)this[1]._pools + *(int *)(local_68 * 4) * 4 + -4) = pillEffectId; local_64 = nextEntry; goto LAB_0073570b; } SVar6 = nextEntry; } while (nextEntry != pillEffectsEnd); } uVar2 = (this->_itemPoolRNG)._seed; local_64 = (SoundEffect)((int)pillEffectsEnd >> 2); if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_itemPoolRNG)._seed; manager = g_manager; if (uVar2 == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } uVar2 = uVar2 >> ((byte)(this->_itemPoolRNG)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_itemPoolRNG)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_itemPoolRNG)._shift3 & 0x1f) ^ uVar2; uVar7 = 0; (this->_itemPoolRNG)._seed = uVar2; if (local_64 != (SoundEffect)0x0) { uVar7 = uVar2 % (uint)local_64; } SVar6 = (SoundEffect)(uVar7 * 4); *(SoundEffect *)((int)this[1]._pools + *(int *)(local_68 * 4) * 4 + -4) = *(SoundEffect *)SVar6; nextEntry = (SoundEffect)((int)SVar6 + 4); LAB_0073570b: memmove((void *)SVar6,(void *)nextEntry,(int)pillEffectsEnd - (int)nextEntry); local_68 = local_68 + 1; pillEffectsEnd = (SoundEffect)((int)pillEffectsEnd + -4); } while (local_68 < (uint)((int)pillColorsEnd >> 2)); } this[1]._seed = -1; cardId = 0; if ((int)(manager->_itemConfig)._cards._end - (int)(manager->_itemConfig)._cards._begin >> 2 != 0) { do { if (((-1 < (int)cardId) && (pvVar4 = (manager->_itemConfig)._cards._begin, (int)cardId < (int)(manager->_itemConfig)._cards._end - (int)pvVar4 >> 2)) && ((iVar5 = *(int *)((int)pvVar4 + cardId * 4), iVar5 != 0 && ((-1 < *(int *)(iVar5 + 0x5c) && (*(int *)(iVar5 + 0x5c) < ((int)(manager->_sfxManager)._sounds._end - (int)(manager->_sfxManager)._sounds._begin) / 0x1b8)))))) { local_64 = (SoundEffect) (*(int *)(iVar5 + 0x5c) * 0x1b8 + (int)(manager->_sfxManager)._sounds._begin); if (*(char *)((int)local_64 + 0x198) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)local_64); loadedSoundCount = &(manager->_sfxManager).field_0xc; *(int *)loadedSoundCount = *(int *)loadedSoundCount + 1; manager = g_manager; } ((SoundEffect *)((int)local_64 + 0x198))->field_0x1 = 0; } cardId = cardId + 1; } while (cardId < (uint)((int)(manager->_itemConfig)._cards._end - (int)(manager->_itemConfig)._cards._begin >> 2)); } this[1]._pools[1]._rng1._shift1 = 0; this[1]._pools[1]._rng1._shift2 = 0; this[1]._pools[1]._rng1._shift3 = 0; this[1]._pools[1]._rng2._seed = 0; this[1]._pools[1]._rng2._shift1 = 0; this[1]._pools[1]._rng2._shift2 = 0; this[1]._pools[1]._rng2._shift3 = 0; this[1]._pools[1]._bibleUpgrade = 0; this[1]._pools[2]._totalWeight = 0.0; this[1]._pools[2]._poolList._begin = (void *)0x0; this[1]._pools[2]._poolList._end = (void *)0x0; this[1]._pools[2]._poolList._capacity = (void *)0x0; this[1]._pools[2]._rng1._seed = 0; this[1]._pools[2]._rng1._shift1 = 0; this[1]._pools[2]._rng1._shift2 = 0; *(undefined2 *)&this[1]._pools[2]._rng1._shift3 = 0; ExceptionList = local_1c; return; } //@@ 00735910 ItemPool::shuffle_pools /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void ItemPool::shuffle_pools(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall ItemPool::shuffle_pools(ItemPool *this) { undefined4 *puVar1; undefined4 *puVar2; undefined8 uVar3; void *pvVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; ItemPool_Item *pIVar12; uint uVar13; uint uVar14; uint uVar15; uint uVar16; undefined1 auStack_9e8 [4]; int local_9e4; std_vector *local_9e0; int local_9dc; MTRNG local_9d8 [624]; undefined4 local_18; uint local_c; local_c = __security_cookie ^ (uint)auStack_9e8; local_18 = 0x271; MTRNG::Init(local_9d8,(this->_itemPoolRNG)._seed); pIVar12 = this->_pools; local_9dc = 0x1f; do { local_9e0 = &pIVar12->_poolList; uVar15 = ((int)local_9e0->_end - (int)local_9e0->_begin) / 0x18; if ((1 < uVar15) && (uVar16 = uVar15 - 1, uVar16 != 0)) { local_9e4 = uVar16 * 0x18; do { uVar13 = MTRNG::Next(local_9d8); uVar14 = 0; if ((uVar15 == 0) || (uVar14 = uVar13 % uVar15, uVar16 != uVar14)) { pvVar4 = local_9e0->_begin; puVar1 = (undefined4 *)((int)pvVar4 + uVar14 * 0x18); uVar5 = puVar1[1]; uVar6 = puVar1[2]; uVar7 = puVar1[3]; puVar2 = (undefined4 *)((int)pvVar4 + local_9e4); uVar8 = *puVar2; uVar9 = puVar2[1]; uVar10 = puVar2[2]; uVar11 = puVar2[3]; uVar3 = *(undefined8 *)((int)pvVar4 + local_9e4 + 0x10); puVar2 = (undefined4 *)((int)pvVar4 + local_9e4); *puVar2 = *puVar1; puVar2[1] = uVar5; puVar2[2] = uVar6; puVar2[3] = uVar7; puVar1 = (undefined4 *)((int)pvVar4 + uVar14 * 0x18 + 0x10); uVar5 = puVar1[1]; puVar2 = (undefined4 *)((int)pvVar4 + local_9e4 + 0x10); *puVar2 = *puVar1; puVar2[1] = uVar5; puVar1 = (undefined4 *)((int)pvVar4 + uVar14 * 0x18); *puVar1 = uVar8; puVar1[1] = uVar9; puVar1[2] = uVar10; puVar1[3] = uVar11; *(undefined8 *)((int)pvVar4 + uVar14 * 0x18 + 0x10) = uVar3; } local_9e4 = local_9e4 + -0x18; uVar15 = uVar15 - 1; uVar16 = uVar16 - 1; } while (uVar16 != 0); } pIVar12 = (ItemPool_Item *)(local_9e0 + 4); local_9dc = local_9dc + -1; } while (local_9dc != 0); return; } //@@ 00735a30 ItemPool::load_pools /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ZHL ItemPool::load_pools(xmlpath, ismod): 'Could not find root node ItemPools', 'Pool %s not found', Item/Weight/DecreaseBy/RemoveOn prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ItemPool::load_pools(ItemPool *this,byte *xmlpath,byte ismod) { void *pvVar1; code *pcVar2; int iVar3; int *piVar4; byte bVar5; uint uVar6; uint uVar7; int *piVar8; uint *puVar9; byte ******ppppppbVar10; byte *****pppppbVar11; byte *pbVar12; byte *pbVar13; byte *****pppppbVar14; char *pcVar16; char *pcVar15; int extraout_EDX; undefined4 *poolAttr; int iVar17; bool isLess; double dVar18; byte ******ppppppbVar19; undefined1 auStack_10100 [8]; int *piStack_100f8; undefined1 auStack_100f4 [8]; void *poolNameNode; int **ppiStack_100e8; int **ppiStack_100e4; int poolOffset; uint itemId; float weight; float initialWeight; float decreaseBy; float removeOn; undefined1 isUnlocked; undefined1 uStack_100c7; undefined2 uStack_100c6; byte *xmlText; void *poolNameMap; undefined4 uStack_100bc; byte *pbStack_100b8; undefined4 *itemNode; int *piStack_100b0; int *piStack_100ac; byte ******ppppppbStack_100a8; ItemPool *itemPool; undefined1 xmlDoc [48]; undefined1 auStack_10070 [65564]; byte ******poolName [4]; uint poolNameSize; uint poolNameCapacity; byte ******tmpName [4]; uint tmpNameSize; uint tmpNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte *****local_14; char isNil; Manager *manager; ItemPool *poolOwner; puStack_20 = (undefined1 *)(tmpName + 0xe); local_14 = (byte *****)0xffffffff; puStack_18 = &LAB_00afd721; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(tmpName + 0xb); ExceptionList = &local_1c; pbStack_100b8 = xmlpath; itemPool = this; local_24 = uVar6; ppppppbVar10 = (byte ******)(tmpName + 0xe); if (ismod == 0) { piVar8 = &this->_pools[0]._rng1._shift1; iVar17 = 0x1f; do { piVar8[-3] = piVar8[-4]; piVar8[-5] = 0; uVar7 = (itemPool->_itemPoolRNG)._seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (itemPool->_itemPoolRNG)._seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar7 = uVar7 >> ((byte)(itemPool->_itemPoolRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(itemPool->_itemPoolRNG)._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(itemPool->_itemPoolRNG)._shift3 & 0x1f) ^ uVar7; (itemPool->_itemPoolRNG)._seed = uVar7; ((RNG *)(piVar8 + -1))->_seed = uVar7; *(undefined8 *)piVar8 = 0x900000005; piVar8[2] = 7; uVar7 = (itemPool->_itemPoolRNG)._seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = (itemPool->_itemPoolRNG)._seed; if (uVar7 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar7 = uVar7 >> ((byte)(itemPool->_itemPoolRNG)._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)(itemPool->_itemPoolRNG)._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(itemPool->_itemPoolRNG)._shift3 & 0x1f) ^ uVar7; (itemPool->_itemPoolRNG)._seed = uVar7; piVar8[3] = uVar7; *(undefined8 *)(piVar8 + 4) = 0x900000005; piVar8[6] = 7; piVar8[7] = 0; piVar8 = piVar8 + 0xd; iVar17 = iVar17 + -1; } while (iVar17 != 0); ppppppbVar10 = (byte ******)puStack_20; } puStack_20 = (undefined1 *)ppppppbVar10; piVar8 = FileSystem::Open(&PTR_vftable_00c37a10,pbStack_100b8,(int *)0x0); if (piVar8 != (int *)0x0) { iVar17 = (**(code **)(*piVar8 + 4))(uVar6); xmlText = operator_new_tracked(iVar17 + 1); (**(code **)(*piVar8 + 0x14))(xmlText,1,iVar17); xmlText[iVar17] = 0; (**(code **)*piVar8)(1); FUN_00413b90(); local_14 = (byte *****)0x0; iVar17 = 0x735c38; pbVar13 = xmlText; rapidxml::xml_document::parse(xmlDoc,xmlText); ppppppbStack_100a8 = xml_node::first_node(xmlDoc,(byte *)"ItemPools",iVar17,(byte)pbVar13); if (ppppppbStack_100a8 == (byte ******)0x0) { KAGE_LogMessage(0x10,(byte *)"Could not find root node \'ItemPools\' in %s\n"); } poolNameMap = (void *)0x0; uStack_100bc = 0; poolNameMap = operator_new(0x2c); *(void **)poolNameMap = poolNameMap; *(void **)((int)poolNameMap + 4) = poolNameMap; *(void **)((int)poolNameMap + 8) = poolNameMap; *(undefined2 *)((int)poolNameMap + 0xc) = 0x101; local_14._0_1_ = 1; uVar6 = 0; do { pbVar13 = (&PTR_s_treasure_00b1f3d0)[uVar6]; tmpNameSize = 0; tmpNameCapacity = 0xf; tmpName[0] = (byte ******)0x0; pbVar12 = pbVar13; do { bVar5 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar5 != 0); std::string::assign((char *)tmpName,pbVar13,(int)pbVar12 - (int)(pbVar13 + 1)); ppppppbVar10 = (byte ******)tmpName; local_14._0_1_ = 2; ppppppbVar19 = (byte ******)0x735cfb; puVar9 = (uint *)FUN_0069d630(ppppppbVar10); bVar5 = (byte)ppppppbVar10; local_14._0_1_ = 1; *puVar9 = uVar6; if (0xf < tmpNameCapacity) { uVar7 = tmpNameCapacity + 1; ppppppbVar19 = tmpName[0]; if (0xfff < uVar7) { ppppppbVar19 = (byte ******)tmpName[0][-1]; uVar7 = tmpNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)tmpName[0] + (-4 - (int)ppppppbVar19))) goto LAB_00735d8b; } operator_delete(ppppppbVar19,uVar7); bVar5 = (byte)uVar7; } uVar6 = uVar6 + 1; } while (uVar6 < 0x1f); for (pbStack_100b8 = xml_node::first_node(ppppppbStack_100a8,&DAT_00b6a1dc,(int)ppppppbVar19,bVar5); pbStack_100b8 != (byte *)0x0; pbStack_100b8 = *(byte **)(pbStack_100b8 + 0x2c)) { pcVar15 = "Name"; do { pcVar16 = pcVar15; pcVar15 = pcVar16 + 1; } while (*pcVar15 != '\0'); ppppppbStack_100a8 = (byte ******)(pcVar16 + -0xb1b34f); for (poolAttr = *(undefined4 **)(pbStack_100b8 + 0x20); poolAttr != (undefined4 *)0x0; poolAttr = (undefined4 *)poolAttr[6]) { pbVar13 = (byte *)*poolAttr; if (pbVar13 == (byte *)0x0) { ppppppbVar10 = (byte ******)0x0; pbVar13 = &g_xmlNullStr; } else { ppppppbVar10 = (byte ******)poolAttr[2]; } if (ppppppbVar10 == ppppppbStack_100a8) { pbVar12 = (byte *)((int)ppppppbVar10 + (int)pbVar13); if (pbVar12 <= pbVar13) goto LAB_00735dcd; iVar17 = (int)&DAT_00b1b350 - (int)pbVar13; while (*pbVar13 == pbVar13[iVar17]) { pbVar13 = pbVar13 + 1; if (pbVar12 <= pbVar13) goto LAB_00735dcd; } } } poolAttr = (undefined4 *)0x0; LAB_00735dcd: if (poolAttr != (undefined4 *)0x0) { poolNameSize = 0; pbVar13 = &g_xmlNullStr; if ((byte *)poolAttr[1] != (byte *)0x0) { pbVar13 = (byte *)poolAttr[1]; } poolNameCapacity = 0xf; poolName[0] = (byte ******)0x0; pbVar12 = pbVar13; do { bVar5 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar5 != 0); std::string::assign((char *)poolName,pbVar13,(int)pbVar12 - (int)(pbVar13 + 1)); local_14 = (byte *****)CONCAT31(local_14._1_3_,3); std::map::_Find_lower_bound(auStack_100f4,poolName); pvVar1 = poolNameNode; ppppppbStack_100a8 = poolName[0]; if (*(char *)((int)poolNameNode + 0xd) == '\0') { pbVar13 = (byte *)((int)poolNameNode + 0x10); if (0xf < *(uint *)((int)poolNameNode + 0x24)) { pbVar13 = *(byte **)pbVar13; } ppppppbVar10 = (byte ******)poolName; if (0xf < poolNameCapacity) { ppppppbVar10 = poolName[0]; } iVar17 = string_compare((byte *)ppppppbVar10,poolNameSize,pbVar13, *(uint *)((int)poolNameNode + 0x20)); if ((iVar17 < 0) || (pvVar1 == poolNameMap)) goto LAB_0073644b; poolOffset = *(int *)((int)pvVar1 + 0x28) * 0x34; pcVar15 = "Item"; do { pcVar16 = pcVar15; pcVar15 = pcVar16 + 1; } while (*pcVar15 != '\0'); for (itemNode = *(undefined4 **)(pbStack_100b8 + 0x18); itemNode != (undefined4 *)0x0; itemNode = (undefined4 *)itemNode[0xb]) { pbVar13 = (byte *)*itemNode; if (pbVar13 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar13 = &g_xmlNullStr; } else { pcVar15 = (char *)itemNode[2]; } if (pcVar15 == pcVar16 + -0xb677ff) { pbVar12 = (byte *)(pcVar15 + (int)pbVar13); if (pbVar12 <= pbVar13) goto LAB_00735f03; iVar17 = (int)&DAT_00b67800 - (int)pbVar13; while (*pbVar13 == pbVar13[iVar17]) { pbVar13 = pbVar13 + 1; if (pbVar12 <= pbVar13) goto LAB_00735f03; } } } itemNode = (undefined4 *)0x0; LAB_00735f03: if (itemNode == (undefined4 *)0x0) { ppppppbVar19 = ppppppbStack_100a8; } else { do { ppppppbVar10 = (byte ******)itemNode[8]; itemId = 0; isUnlocked = 0; weight = 1.0; initialWeight = 1.0; decreaseBy = 0.5; removeOn = 0.1; manager = g_manager; piVar8 = piStack_100b0; while( true ) { g_manager = manager; piStack_100b0 = piVar8; ppppppbStack_100a8 = ppppppbVar10; if (ppppppbVar10 == (byte ******)0x0) break; pppppbVar14 = *ppppppbVar10; pbVar13 = &DAT_00b1b324; pppppbVar11 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar11 = pppppbVar14; } do { bVar5 = *(byte *)pppppbVar11; isLess = bVar5 < *pbVar13; if (bVar5 != *pbVar13) { LAB_00735f71: uVar6 = -(uint)isLess | 1; goto LAB_00735f76; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)pppppbVar11 + 1); isLess = bVar5 < pbVar13[1]; if (bVar5 != pbVar13[1]) goto LAB_00735f71; pppppbVar11 = (byte *****)((int)pppppbVar11 + 2); pbVar13 = pbVar13 + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00735f76: if (uVar6 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar10[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar10[1]; } itemId = atoi((char *)pppppbVar14); } else { pcVar15 = "Weight"; pppppbVar11 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar11 = pppppbVar14; } do { bVar5 = *(byte *)pppppbVar11; isLess = bVar5 < (byte)*pcVar15; if (bVar5 != *pcVar15) { LAB_00735fd0: uVar6 = -(uint)isLess | 1; goto LAB_00735fd5; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)pppppbVar11 + 1); isLess = bVar5 < (byte)pcVar15[1]; if (bVar5 != pcVar15[1]) goto LAB_00735fd0; pppppbVar11 = (byte *****)((int)pppppbVar11 + 2); pcVar15 = pcVar15 + 2; } while (bVar5 != 0); uVar6 = 0; LAB_00735fd5: if (uVar6 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar10[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar10[1]; } dVar18 = atof((char *)pppppbVar14); weight = (float)dVar18; initialWeight = weight; piVar8 = piStack_100b0; } else { pcVar15 = "DecreaseBy"; pppppbVar11 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar11 = pppppbVar14; } do { bVar5 = *(byte *)pppppbVar11; isLess = bVar5 < (byte)*pcVar15; if (bVar5 != *pcVar15) { LAB_00736040: uVar6 = -(uint)isLess | 1; goto LAB_00736045; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)pppppbVar11 + 1); isLess = bVar5 < (byte)pcVar15[1]; if (bVar5 != pcVar15[1]) goto LAB_00736040; pcVar15 = pcVar15 + 2; pppppbVar11 = (byte *****)((int)pppppbVar11 + 2); } while (bVar5 != 0); uVar6 = 0; LAB_00736045: if (uVar6 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar10[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar10[1]; } dVar18 = atof((char *)pppppbVar14); decreaseBy = (float)dVar18; piVar8 = piStack_100b0; } else { pcVar15 = "RemoveOn"; pppppbVar11 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar11 = pppppbVar14; } do { bVar5 = *(byte *)pppppbVar11; isLess = bVar5 < (byte)*pcVar15; if (bVar5 != *pcVar15) { LAB_007360a0: uVar6 = -(uint)isLess | 1; goto LAB_007360a5; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)pppppbVar11 + 1); isLess = bVar5 < (byte)pcVar15[1]; if (bVar5 != pcVar15[1]) goto LAB_007360a0; pcVar15 = pcVar15 + 2; pppppbVar11 = (byte *****)((int)pppppbVar11 + 2); } while (bVar5 != 0); uVar6 = 0; LAB_007360a5: if (uVar6 == 0) { pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar10[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar10[1]; } dVar18 = atof((char *)pppppbVar14); removeOn = (float)dVar18; piVar8 = piStack_100b0; } else { pbVar13 = &DAT_00b1b350; pppppbVar11 = (byte *****)&g_xmlNullStr; if (pppppbVar14 != (byte *****)0x0) { pppppbVar11 = pppppbVar14; } do { bVar5 = *(byte *)pppppbVar11; isLess = bVar5 < *pbVar13; if (bVar5 != *pbVar13) { LAB_00736100: piStack_100b0 = (int *)(-(uint)isLess | 1); goto LAB_00736105; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)pppppbVar11 + 1); isLess = bVar5 < pbVar13[1]; if (bVar5 != pbVar13[1]) goto LAB_00736100; pbVar13 = pbVar13 + 2; pppppbVar11 = (byte *****)((int)pppppbVar11 + 2); } while (bVar5 != 0); piStack_100b0 = (int *)0x0; LAB_00736105: if (piStack_100b0 == (int *)0x0) { ppiStack_100e8 = &piStack_100b0; ppiStack_100e4 = ppiStack_100e8; piStack_100ac = piStack_100b0; piStack_100b0 = operator_new(0x2c); *piStack_100b0 = (int)piStack_100b0; piStack_100b0[1] = (int)piStack_100b0; piStack_100b0[2] = (int)piStack_100b0; *(undefined2 *)(piStack_100b0 + 3) = 0x101; local_14._0_1_ = 4; iVar17 = FUN_00738040(*(undefined4 *) ((int)(manager->_itemConfig)._collectibleNameMap. _head + 4),piStack_100b0,poolOffset); piStack_100b0[1] = iVar17; piStack_100ac = (int *)(manager->_itemConfig)._collectibleNameMap._size; piVar8 = (int *)piStack_100b0[1]; if (*(char *)((int)piVar8 + 0xd) == '\0') { isNil = *(char *)(*piVar8 + 0xd); piVar4 = (int *)*piVar8; while (isNil == '\0') { isNil = *(char *)(*piVar4 + 0xd); piVar8 = piVar4; piVar4 = (int *)*piVar4; } *piStack_100b0 = (int)piVar8; iVar17 = *(int *)(piStack_100b0[1] + 8); isNil = *(char *)(iVar17 + 0xd); iVar3 = piStack_100b0[1]; while (isNil == '\0') { isNil = *(char *)(*(int *)(iVar17 + 8) + 0xd); iVar3 = iVar17; iVar17 = *(int *)(iVar17 + 8); } piStack_100b0[2] = iVar3; } else { *piStack_100b0 = (int)piStack_100b0; piStack_100b0[2] = (int)piStack_100b0; } ppiStack_100e4 = (int **)0x0; local_14._0_1_ = 5; tmpName[0] = (byte ******)0x0; pppppbVar14 = (byte *****)&g_xmlNullStr; if (ppppppbVar10[1] != (byte *****)0x0) { pppppbVar14 = ppppppbVar10[1]; } tmpNameSize = 0; tmpNameCapacity = 0xf; pppppbVar11 = pppppbVar14; do { bVar5 = *(byte *)pppppbVar11; pppppbVar11 = (byte *****)((int)pppppbVar11 + 1); } while (bVar5 != 0); std::string::assign((char *)tmpName,(byte *)pppppbVar14, (int)pppppbVar11 - (int)((int)pppppbVar14 + 1)); std::map::_Find_lower_bound(auStack_10100,tmpName); ppppppbVar10 = tmpName[0]; piVar8 = piStack_100f8; if (*(char *)((int)piStack_100f8 + 0xd) == '\0') { pbVar13 = (byte *)(piStack_100f8 + 4); if (0xf < (uint)piStack_100f8[9]) { pbVar13 = *(byte **)pbVar13; } ppppppbVar19 = (byte ******)tmpName; if (0xf < tmpNameCapacity) { ppppppbVar19 = tmpName[0]; } iVar17 = string_compare((byte *)ppppppbVar19,tmpNameSize,pbVar13, piStack_100f8[8]); if ((-1 < iVar17) && (piVar8 != piStack_100b0)) { itemId = piVar8[10]; } } if (0xf < tmpNameCapacity) { uVar6 = tmpNameCapacity + 1; ppppppbVar19 = ppppppbVar10; if (0xfff < uVar6) { ppppppbVar19 = (byte ******)ppppppbVar10[-1]; uVar6 = tmpNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbVar10 + (-4 - (int)ppppppbVar19))) goto LAB_00735d8b; } operator_delete(ppppppbVar19,uVar6); } local_14 = (byte *****)CONCAT31(local_14._1_3_,3); FUN_004235c0(&piStack_100b0,piStack_100b0[1]); operator_delete(piStack_100b0,0x2c); ppppppbVar10 = ppppppbStack_100a8; piVar8 = piStack_100b0; } } } } piStack_100b0 = piVar8; } if (ppppppbVar10[4] == (byte *****)0x0) break; ppppppbVar10 = (byte ******)ppppppbVar10[6]; manager = g_manager; piVar8 = piStack_100b0; } if (g_game == (Game *)0x0) { if (-1 < (int)itemId) goto LAB_00736343; LAB_00736382: iVar17 = 0; LAB_00736384: if (iVar17 == 0) goto LAB_00736398; LAB_00736388: uStack_100c7 = 1; if (*(char *)(iVar17 + 0xb0) == '\0') goto LAB_00736398; } else { if ((int)itemId < 0) { if (((int)itemId < 0) && (pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~itemId < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2) ) { iVar17 = **(int **)((int)pvVar1 + ~itemId * 4); } else { iVar17 = 0; } } else { LAB_00736343: pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 >> 2 <= (int)itemId) goto LAB_00736382; iVar17 = *(int *)((int)pvVar1 + itemId * 4); } if (iVar17 != 0) { if (-1 < *(int *)(iVar17 + 0x50)) { bVar5 = PersistentGameData::Unlocked (&g_manager->_persistentGameData,*(int *)(iVar17 + 0x50)); iVar17 = extraout_EDX; if (bVar5 == 0) goto LAB_00736384; } isUnlocked = 1; goto LAB_00736388; } LAB_00736398: uStack_100c7 = 0; } poolOwner = itemPool; iVar17 = poolOffset; puVar9 = *(uint **)((int)&itemPool->_pools[0]._poolList._end + poolOffset); if (puVar9 == *(uint **)((int)&itemPool->_pools[0]._poolList._capacity + poolOffset)) { std::vector<24byte>::_Emplace_reallocate(puVar9,&itemId); } else { *puVar9 = itemId; puVar9[1] = (uint)weight; puVar9[2] = (uint)initialWeight; puVar9[3] = (uint)decreaseBy; *(ulonglong *)(puVar9 + 4) = CONCAT26(uStack_100c6,CONCAT15(uStack_100c7,CONCAT14(isUnlocked,removeOn))); piVar8 = (int *)((int)&itemPool->_pools[0]._poolList._end + poolOffset); *piVar8 = *piVar8 + 0x18; } itemNode = (undefined4 *)itemNode[0xb]; *(float *)((int)&poolOwner->_pools[0]._totalWeight + iVar17) = initialWeight + *(float *)((int)&poolOwner->_pools[0]._totalWeight + iVar17); } while (itemNode != (undefined4 *)0x0); ppppppbVar19 = poolName[0]; } local_14._0_1_ = 1; if (poolNameCapacity < 0x10) goto LAB_0073649d; uVar6 = poolNameCapacity + 1; ppppppbVar10 = ppppppbVar19; if (0xfff < uVar6) { ppppppbVar10 = (byte ******)ppppppbVar19[-1]; uVar6 = poolNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbVar19 + (-4 - (int)ppppppbVar10))) { LAB_00735d8b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { LAB_0073644b: KAGE_LogMessage(1,(byte *)"Pool %s not found, please recheck config or item pool list"); local_14._0_1_ = 1; if (poolNameCapacity < 0x10) goto LAB_0073649d; uVar6 = poolNameCapacity + 1; ppppppbVar10 = poolName[0]; if (0xfff < uVar6) { ppppppbVar10 = (byte ******)poolName[0][-1]; uVar6 = poolNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)poolName[0] + (-4 - (int)ppppppbVar10))) goto LAB_00735d8b; } } local_14._0_1_ = 1; operator_delete(ppppppbVar10,uVar6); } LAB_0073649d: } FUN_004235c0(&poolNameMap,*(undefined4 *)((int)poolNameMap + 4)); operator_delete(poolNameMap,0x2c); local_14 = (byte *****)0x6; xml_memory_pool::clear(auStack_10070); local_14 = (byte *****)0x7; tracked_alloc(1,xmlText,0); } ExceptionList = local_1c; return; } //@@ 00736530 ItemPool::RestoreGameState /* DB: ? sits between ItemPool::load_pools and ItemPool::StoreGameState (007367d0); copies 0x1f pools of 0x18-byte entries from GameState+0x1e3cc (param_1+0x78f3) back into ItemPool; called from Game::restore_game_state prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ItemPool::RestoreGameState(ItemPool *this,GameStateItemPool *itemPoolState) { void *pvVar1; uint uVar2; int iVar3; uint bitIndex; short *genesisSrc; int iVar4; ItemPool *pillEffectDst; std_vector *poolList; int *piVar5; uint bitIndex; GameStateItemPool *poolWeightsSrc; uint wordIndex; void *poolListBegin; int *bibleUpgradeSrc; uint local_14; ItemPool_Item *pool; short remainingGenesis; bibleUpgradeSrc = itemPoolState->_bibleUpgrades; local_14 = 0x1f; pool = this->_pools; poolWeightsSrc = itemPoolState; do { poolList = &pool->_poolList; poolListBegin = poolList->_begin; bitIndex = 0; iVar3 = (int)poolList->_end - (int)poolListBegin; iVar4 = iVar3 >> 0x1f; if (iVar3 / 0x18 + iVar4 != iVar4) { iVar4 = 0; do { pvVar1 = poolWeightsSrc->_poolsItemWeights[0]._begin; if ((uint)((int)poolWeightsSrc->_poolsItemWeights[0]._end - (int)pvVar1 >> 2) <= bitIndex) break; iVar3 = bitIndex * 4; bitIndex = bitIndex + 1; *(undefined4 *)((int)poolListBegin + iVar4 + 8) = *(undefined4 *)((int)pvVar1 + iVar3); iVar4 = iVar4 + 0x18; poolListBegin = poolList->_begin; } while (bitIndex < (uint)(((int)poolList->_end - (int)poolListBegin) / 0x18)); } poolWeightsSrc = (GameStateItemPool *)(poolWeightsSrc->_poolsItemWeights + 1); iVar4 = *bibleUpgradeSrc; bibleUpgradeSrc = bibleUpgradeSrc + 1; *(int *)((int)(poolList + 3) + 8) = iVar4; pool = (ItemPool_Item *)(poolList + 4); local_14 = local_14 + -1; if (local_14 == 0) { this->_seed = itemPoolState->_seed; this->_lastPool = itemPoolState->_lastPool; (this->_itemPoolRNG)._seed = itemPoolState->_itemPoolRNGseed; (this->_itemPoolRNG)._shift1 = 1; (this->_itemPoolRNG)._shift2 = 9; (this->_itemPoolRNG)._shift3 = 0x1d; (this->_trinketPoolRNG)._seed = itemPoolState->_trinketPoolRNGseed; (this->_trinketPoolRNG)._shift1 = 1; (this->_trinketPoolRNG)._shift2 = 5; (this->_trinketPoolRNG)._shift3 = 0x13; this->_unkFloat674 = itemPoolState->_unkFloat674; this->_unkFloat678 = itemPoolState->_unkFloat678; bitIndex = (this->_removedCollectibles)._size; uVar2 = (itemPoolState->_removedCollectibles)._size; if (bitIndex < uVar2) { uVar2 = bitIndex; } local_14 = 0; if (uVar2 != 0) { do { wordIndex = local_14 >> 5; bitIndex = local_14 & 0x1f; bitIndex = *(uint *)((int)(this->_removedCollectibles)._begin + wordIndex * 4); if ((*(uint *)((int)(itemPoolState->_removedCollectibles)._begin + wordIndex * 4) & 1 << (sbyte)bitIndex) == 0) { bitIndex = bitIndex & ~(1 << bitIndex); } else { bitIndex = bitIndex | 1 << bitIndex; } *(uint *)((int)(this->_removedCollectibles)._begin + wordIndex * 4) = bitIndex; local_14 = local_14 + 1; } while (local_14 < uVar2); } bitIndex = (itemPoolState->_trinketPoolItems)._size; uVar2 = (int)(this->_trinketPoolItems)._end - (int)(this->_trinketPoolItems)._begin >> 3; if (uVar2 < bitIndex) { bitIndex = uVar2; } uVar2 = 0; if (bitIndex != 0) { do { *(bool *)((int)(this->_trinketPoolItems)._begin + uVar2 * 8 + 4) = (*(uint *)((int)(itemPoolState->_trinketPoolItems)._begin + (uVar2 >> 5) * 4) & 1 << ((byte)uVar2 & 0x1f)) != 0; uVar2 = uVar2 + 1; } while (uVar2 < bitIndex); } this->_numAvailableTrinkets = 0; bitIndex = 0; pvVar1 = (this->_trinketPoolItems)._begin; if ((int)(this->_trinketPoolItems)._end - (int)pvVar1 >> 3 != 0) { do { if ((*(char *)((int)pvVar1 + bitIndex * 8 + 4) != '\0') && (*(char *)((int)pvVar1 + bitIndex * 8 + 5) != '\0')) { this->_numAvailableTrinkets = this->_numAvailableTrinkets + 1; } bitIndex = bitIndex + 1; } while (bitIndex < (uint)((int)(this->_trinketPoolItems)._end - (int)pvVar1 >> 3)); } bitIndex = 0; pillEffectDst = this + 1; piVar5 = itemPoolState->_pillEffects; do { iVar4 = *piVar5; piVar5 = piVar5 + 1; pillEffectDst->_seed = iVar4; pillEffectDst = (ItemPool *)pillEffectDst->_pools; *(byte *)((int)&this[1]._pools[1]._poolList._begin + bitIndex) = itemPoolState->_identifiedPillEffects[bitIndex]; bitIndex = bitIndex + 1; } while (bitIndex < 0xf); piVar5 = &this[1]._pools[1]._rng1._shift1; genesisSrc = itemPoolState->_remainingGenesisItems; iVar4 = 0x1f; do { remainingGenesis = *genesisSrc; genesisSrc = genesisSrc + 1; *(short *)piVar5 = remainingGenesis; piVar5 = (int *)((int)piVar5 + 2); iVar4 = iVar4 + -1; } while (iVar4 != 0); return; } } while( true ); } //@@ 007367d0 ItemPool::StoreGameState /* ZHL [exact] __thiscall void ItemPool::StoreGameState(GameStateItemPool* itemPoolState); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ItemPool::StoreGameState(ItemPool *this,GameStateItemPool *itemPoolState) { void *_Dst; void *pvVar1; uint uVar2; int iVar3; std_vector_bool *trinketBits; short *genesisItemOut; int *piVar4; int iVar5; undefined4 *weightOut; size_t _Size; uint uVar6; ItemPool *pillCursor; std_vector *poolList; uint wordIdx; uint itemIdx; void **weightsEnd; int *bibleUpgradeOut; uint local_18; int *pillEffectSrc; ItemPool_Item *pool; local_18 = 0x1f; pool = this->_pools; bibleUpgradeOut = itemPoolState->_bibleUpgrades; weightsEnd = &itemPoolState->_poolsItemWeights[0]._end; do { poolList = &pool->_poolList; _Dst = *weightsEnd; uVar6 = ((int)poolList->_end - (int)poolList->_begin) / 0x18; pvVar1 = ((std_vector *)(weightsEnd + -1))->_begin; uVar2 = (int)_Dst - (int)pvVar1 >> 2; if (uVar6 < uVar2) { pvVar1 = (void *)((int)pvVar1 + uVar6 * 4); LAB_0073686a: *weightsEnd = pvVar1; } else if (uVar2 < uVar6) { if (uVar6 <= (uint)((int)weightsEnd[1] - (int)pvVar1 >> 2)) { _Size = (uVar6 - uVar2) * 4; memset(_Dst,0,_Size); pvVar1 = (void *)((int)_Dst + _Size); goto LAB_0073686a; } std::vector<4byte>::_Resize_reallocate(uVar6,uVar2); } pvVar1 = poolList->_begin; itemIdx = 0; iVar3 = (int)poolList->_end - (int)pvVar1; iVar5 = iVar3 >> 0x1f; if (iVar3 / 0x18 + iVar5 != iVar5) { weightOut = ((std_vector *)(weightsEnd + -1))->_begin; iVar5 = 0; do { itemIdx = itemIdx + 1; *weightOut = *(undefined4 *)((int)pvVar1 + iVar5 + 8); weightOut = weightOut + 1; iVar5 = iVar5 + 0x18; } while (itemIdx < (uint)(((int)poolList->_end - (int)poolList->_begin) / 0x18)); } weightsEnd = weightsEnd + 3; pool = (ItemPool_Item *)(poolList + 4); *bibleUpgradeOut = *(int *)((int)(poolList + 3) + 8); bibleUpgradeOut = bibleUpgradeOut + 1; local_18 = local_18 + -1; if (local_18 == 0) { itemPoolState->_seed = this->_seed; itemPoolState->_lastPool = this->_lastPool; itemPoolState->_itemPoolRNGseed = (this->_itemPoolRNG)._seed; itemPoolState->_trinketPoolRNGseed = (this->_trinketPoolRNG)._seed; itemPoolState->_unkFloat674 = this->_unkFloat674; itemPoolState->_unkFloat678 = this->_unkFloat678; vector_bool_resize(&itemPoolState->_removedCollectibles,(this->_removedCollectibles)._size, (byte)itemPoolState); local_18 = 0; if ((this->_removedCollectibles)._size != 0) { do { pvVar1 = (itemPoolState->_removedCollectibles)._begin; wordIdx = local_18 >> 5; uVar2 = local_18 & 0x1f; uVar6 = *(uint *)((int)pvVar1 + wordIdx * 4); if ((*(uint *)((int)(this->_removedCollectibles)._begin + wordIdx * 4) & 1 << (sbyte)uVar2 ) == 0) { uVar6 = uVar6 & ~(1 << uVar2); } else { uVar6 = uVar6 | 1 << uVar2; } *(uint *)((int)pvVar1 + wordIdx * 4) = uVar6; local_18 = local_18 + 1; } while (local_18 < (this->_removedCollectibles)._size); } trinketBits = &itemPoolState->_trinketPoolItems; vector_bool_resize(trinketBits, (int)(this->_trinketPoolItems)._end - (int)(this->_trinketPoolItems)._begin >> 3,(byte)trinketBits); uVar6 = 0; pvVar1 = (this->_trinketPoolItems)._begin; if ((int)(this->_trinketPoolItems)._end - (int)pvVar1 >> 3 != 0) { do { wordIdx = uVar6 >> 5; uVar2 = *(uint *)((int)trinketBits->_begin + wordIdx * 4); if (*(char *)((int)pvVar1 + uVar6 * 8 + 4) == '\0') { uVar2 = uVar2 & ~(1 << (uVar6 & 0x1f)); } else { uVar2 = uVar2 | 1 << (uVar6 & 0x1f); } uVar6 = uVar6 + 1; *(uint *)((int)trinketBits->_begin + wordIdx * 4) = uVar2; pvVar1 = (this->_trinketPoolItems)._begin; } while (uVar6 < (uint)((int)(this->_trinketPoolItems)._end - (int)pvVar1 >> 3)); } pillCursor = this + 1; uVar6 = 0; piVar4 = itemPoolState->_pillEffects; do { pillEffectSrc = &pillCursor->_seed; pillCursor = (ItemPool *)pillCursor->_pools; *piVar4 = *pillEffectSrc; piVar4 = piVar4 + 1; itemPoolState->_identifiedPillEffects[uVar6] = *(byte *)((int)&this[1]._pools[1]._poolList._begin + uVar6); uVar6 = uVar6 + 1; } while (uVar6 < 0xf); genesisItemOut = itemPoolState->_remainingGenesisItems; piVar4 = &this[1]._pools[1]._rng1._shift1; iVar5 = 0x1f; do { iVar3 = *piVar4; piVar4 = (int *)((int)piVar4 + 2); *genesisItemOut = (short)iVar3; genesisItemOut = genesisItemOut + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); return; } } while( true ); } //@@ 00736a90 ItemPool::ResetTrinkets /* ZHL [lua] Lua binding ItemPool:ResetTrinkets */ void __thiscall ItemPool::ResetTrinkets(ItemPool *this) { byte bVar1; void *pvVar2; uint uVar3; uVar3 = 0; pvVar2 = (this->_trinketPoolItems)._begin; if ((int)(this->_trinketPoolItems)._end - (int)pvVar2 >> 3 != 0) { do { *(undefined1 *)((int)pvVar2 + uVar3 * 8 + 4) = 0; *(undefined1 *)((int)(this->_trinketPoolItems)._begin + uVar3 * 8 + 5) = 0; *(uint *)((int)(this->_trinketPoolItems)._begin + uVar3 * 8) = uVar3; pvVar2 = (g_manager->_itemConfig)._trinkets._begin; if (((((int)(uVar3 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar2 >> 2 ) && (pvVar2 = *(void **)((int)pvVar2 + (uVar3 & 0x7fff) * 4), pvVar2 != (void *)0x0)) && (*(int *)((int)pvVar2 + 4) != 0x91)) && ((*(int *)((int)pvVar2 + 4) != 0x7a || (g_game->_challenge != 0x29)))) { *(undefined1 *)((int)(this->_trinketPoolItems)._begin + uVar3 * 8 + 4) = 1; bVar1 = Item::IsAvailable(pvVar2,0xffffffff); *(byte *)((int)(this->_trinketPoolItems)._begin + uVar3 * 8 + 5) = bVar1; } uVar3 = uVar3 + 1; pvVar2 = (this->_trinketPoolItems)._begin; } while (uVar3 < (uint)((int)(this->_trinketPoolItems)._end - (int)pvVar2 >> 3)); } this->_numAvailableTrinkets = 0; uVar3 = 0; if ((int)(this->_trinketPoolItems)._end - (int)pvVar2 >> 3 != 0) { do { if ((*(char *)((int)pvVar2 + uVar3 * 8 + 4) != '\0') && (*(char *)((int)pvVar2 + uVar3 * 8 + 5) != '\0')) { this->_numAvailableTrinkets = this->_numAvailableTrinkets + 1; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(this->_trinketPoolItems)._end - (int)pvVar2 >> 3)); if (0 < this->_numAvailableTrinkets) { return; } } KAGE_LogMessage(0x10,(byte *)"[warn] trinket pool is empty from the start\n"); return; } //@@ 00736ba0 ItemPool::ForceAddPillEffect /* ZHL [lua] Lua binding ItemPool:ForceAddPillEffect prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall ItemPool::ForceAddPillEffect(ItemPool *this,int ID) { code *pcVar1; int iVar2; uint uVar3; ItemPool *pIVar4; iVar2 = 1; pIVar4 = this + 1; do { pIVar4 = (ItemPool *)pIVar4->_pools; if (((ItemPool_Item *)pIVar4)->_totalWeight == (float)ID) { return iVar2; } iVar2 = iVar2 + 1; } while (iVar2 < 0xe); uVar3 = (this->_itemPoolRNG)._seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = (this->_itemPoolRNG)._seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } } uVar3 = uVar3 >> ((byte)(this->_itemPoolRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(this->_itemPoolRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(this->_itemPoolRNG)._shift3 & 0x1f) ^ uVar3; (this->_itemPoolRNG)._seed = uVar3; uVar3 = uVar3 % 0xd; (&this[1]._pools[0]._totalWeight)[uVar3] = (float)ID; return uVar3 + 1; } //@@ 00736c30 ItemPool::on_pill_used /* WARNING: Removing unreachable block (ram,0x00736f16) */ /* WARNING: Removing unreachable block (ram,0x00736f25) */ /* WARNING: Removing unreachable block (ram,0x00736f35) */ /* DB: the gold pill (colour 14) after a use: clears its identified byte (ItemPool+0x7e0+colour) and gives effects[colour] (ItemPool+0x7a4+colour*4) a random available pill effect none of colours 1-14 holds (rif/rebirth-pills) */ undefined4 ItemPool::on_pill_used(uint param_1,uint param_2) { code *pcVar1; char isExcluded; uint uVar2; undefined4 newEffect; int in_ECX; std_vector *pillEffects; void *ptr; uint uVar3; uint *puVar4; Game *game; int iVar5; uint *puVar6; void *usedEffectBits; void *usedEffectBitsEnd; uint *candidatesEnd; uint candidateEffect; int itemPool; uint local_1c; uint *candidatesCapacity; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd76d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined1 *)((param_1 & 0x7ff) + 0x7e0 + in_ECX) = 0; local_1c = 0; usedEffectBits = (void *)0x0; iVar5 = (int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2; usedEffectBitsEnd = (void *)0x0; uVar3 = iVar5 + 0x1fU >> 5; itemPool = in_ECX; if (uVar3 != 0) { usedEffectBits = std::_Allocate(uVar3 * 4); usedEffectBitsEnd = (void *)(uVar3 * 4 + (int)usedEffectBits); FUN_0041d1b0(usedEffectBits,uVar3,&local_1c); } local_8 = 0; std::vector::_Trim(iVar5); iVar5 = 0xe; puVar6 = (uint *)(itemPool + 0x7a8); do { uVar3 = *puVar6; puVar6 = puVar6 + 1; puVar4 = (uint *)((int)usedEffectBits + (uVar3 >> 5) * 4); *puVar4 = *puVar4 | 1 << ((byte)uVar3 & 0x1f); iVar5 = iVar5 + -1; } while (iVar5 != 0); puVar6 = (uint *)0x0; candidatesEnd = (uint *)0x0; candidatesCapacity = (uint *)0x0; local_8 = 2; pillEffects = &(g_manager->_itemConfig)._pillEffects; local_1c = 0; if ((int)(g_manager->_itemConfig)._pillEffects._end - (int)pillEffects->_begin >> 2 != 0) { game = g_game; do { if (((int)local_1c < 0) || ((int)pillEffects->_end - (int)pillEffects->_begin >> 2 <= (int)local_1c)) { puVar4 = (uint *)0x0; } else { puVar4 = *(uint **)((int)pillEffects->_begin + local_1c * 4); } if (game == (Game *)0x0) goto LAB_00736dd7; if (((char)puVar4[0xe] != '\0') || ((game->_difficulty != 2 && (game->_difficulty != 3)))) { if (*(int *)&game->_deathmatchManager < 2) { LAB_00736dd7: uVar3 = puVar4[1]; if ((((int)uVar3 < 0) || ((uVar3 < 0x282 && (((uVar3 == 0 || ((g_manager->_persistentGameData)._achievements[uVar3] != 0)) || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))))) && ((*(uint *)((int)usedEffectBits + (*puVar4 >> 5) * 4) & 1 << ((byte)*puVar4 & 0x1f)) == 0)) { if (1 < *(int *)&game->_deathmatchManager) { isExcluded = (**(code **)(*(int *)(game->_deathmatchManager)._type + 0x28))(*puVar4); if (isExcluded != '\0') goto LAB_00736e6c; game = g_game; } candidateEffect = *puVar4; if (puVar6 == candidatesCapacity) { std::vector<4byte>::_Emplace_reallocate(puVar6,&candidateEffect); candidatesCapacity = (uint *)0x0; game = g_game; puVar6 = candidatesEnd; } else { *puVar6 = candidateEffect; candidatesEnd = puVar6 + 1; puVar6 = candidatesEnd; } } } else { isExcluded = (**(code **)(*(int *)(game->_deathmatchManager)._type + 0x28))(*puVar4,uVar2) ; if (isExcluded == '\0') { game = g_game; goto LAB_00736dd7; } LAB_00736e6c: game = g_game; } } local_1c = local_1c + 1; pillEffects = &(g_manager->_itemConfig)._pillEffects; } while (local_1c < (uint)((int)(g_manager->_itemConfig)._pillEffects._end - (int)pillEffects->_begin >> 2) ); } if (param_2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); newEffect = (*pcVar1)(); return newEffect; } param_2 = param_2 >> 1 ^ param_2; param_2 = param_2 << 9 ^ param_2; if ((int)puVar6 >> 2 == 0) { uVar2 = 0; } else { uVar2 = (param_2 >> 0x1d ^ param_2) % (uint)((int)puVar6 >> 2); } newEffect = *(undefined4 *)(uVar2 * 4); *(undefined4 *)(itemPool + 0x7a4 + (param_1 & 0x7ff) * 4) = newEffect; if (usedEffectBits != (void *)0x0) { uVar2 = (int)usedEffectBitsEnd - (int)usedEffectBits & 0xfffffffc; ptr = usedEffectBits; if (0xfff < uVar2) { ptr = *(void **)((int)usedEffectBits + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)usedEffectBits + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } ExceptionList = local_10; return newEffect; } //@@ 00736f90 ItemPool::ResetRoomBlacklist /* ZHL [lua] Lua binding ItemPool:ResetRoomBlacklist */ void ItemPool::ResetRoomBlacklist(void) { uint *puVar1; uint uVar2; int in_ECX; uint uVar3; uVar2 = 0; if (*(int *)(in_ECX + 0x698) != 0) { do { puVar1 = (uint *)(*(int *)(in_ECX + 0x68c) + (uVar2 >> 5) * 4); uVar3 = uVar2 & 0x1f; uVar2 = uVar2 + 1; *puVar1 = *puVar1 & ~(1 << uVar3); } while (uVar2 < *(uint *)(in_ECX + 0x698)); } return; } //@@ 00736fd0 ItemPool::AddBibleUpgrade /* ZHL [exact] __thiscall void ItemPool::AddBibleUpgrade(int Add, int PoolType); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ItemPool::AddBibleUpgrade(ItemPool *this,int Add,int PoolType) { int *piVar1; int iVar2; if (PoolType < 1) { PoolType = 0; } if (PoolType < 0x1f) { if ((uint)PoolType < 0x1f) { piVar1 = &this->_pools[PoolType]._bibleUpgrade; *piVar1 = *piVar1 + Add; return; } } else { iVar2 = 0x1f; do { this = (ItemPool *)&this->_pools[0]._bibleUpgrade; *(int *)this = *(int *)this + Add; iVar2 = iVar2 + -1; } while (iVar2 != 0); } return; } //@@ 00737010 ItemPool::get_chaos_pool /* ZHL [exact] __thiscall int ItemPool::get_chaos_pool(RNG * rng); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall ItemPool::get_chaos_pool(ItemPool *this,RNG *rng) { code *pcVar1; RNG rng_00; RNG rng_01; uint uVar2; int iVar3; WeightedOutcomePicker WVar4; uint *outcomesEnd; uint uVar5; uint uVar6; uint uVar7; WeightedOutcomePicker picker; uint *pickerEnd; uint *pickerCapacity; uint newOutcomeId; uint newOutcomeWeight; ItemPool *itemPool; ItemPool_Item *pool; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *outcomeWeight; puStack_c = &LAB_00afd7a5; local_10 = ExceptionList; ExceptionList = &local_10; itemPool = this; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { WVar4 = (WeightedOutcomePicker)0x0; outcomesEnd = (uint *)0x0; picker = (WeightedOutcomePicker)0x0; pickerEnd = (uint *)0x0; pickerCapacity = (uint *)0x0; pool = this->_pools + 0x10; local_8 = 0; uVar6 = 0x10; do { uVar5 = (int)outcomesEnd - (int)WVar4 >> 3; uVar2 = 0; uVar7 = (uint)(pool->_totalWeight * 100.0); if (uVar5 != 0) { do { if (*(uint *)((int)WVar4 + uVar2 * 8) == uVar6) { outcomeWeight = (int *)((int)WVar4 + 4 + uVar2 * 8); *outcomeWeight = *outcomeWeight + uVar7; if (*outcomeWeight < 0) { *(undefined4 *)((int)WVar4 + 4 + uVar2 * 8) = 0; } goto LAB_007372c9; } uVar2 = uVar2 + 1; } while (uVar2 < uVar5); } if (0 < (int)uVar7) { newOutcomeId = uVar6; newOutcomeWeight = uVar7; if (outcomesEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcomeId); WVar4 = picker; outcomesEnd = pickerEnd; } else { *outcomesEnd = uVar6; outcomesEnd[1] = uVar7; pickerEnd = outcomesEnd + 2; outcomesEnd = pickerEnd; } } LAB_007372c9: uVar6 = uVar6 + 1; pool = pool + 1; } while (uVar6 < 0x17); uVar6 = rng->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = rng->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar6 = uVar6 >> ((byte)rng->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)rng->_shift2 & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = uVar6; rng_01._shift1 = 5; rng_01._seed = uVar6; rng_01._shift2 = 9; rng_01._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&picker,rng_01); if (picker == (WeightedOutcomePicker)0x0) { ExceptionList = local_10; return uVar6; } uVar2 = (int)pickerCapacity - (int)picker & 0xfffffff8; WVar4 = picker; if (uVar2 < 0x1000) goto LAB_0073721f; WVar4 = *(WeightedOutcomePicker *)((int)picker + -4); iVar3 = (int)picker - (int)WVar4; } else { WVar4 = (WeightedOutcomePicker)0x0; outcomesEnd = (uint *)0x0; picker = (WeightedOutcomePicker)0x0; pickerEnd = (uint *)0x0; pickerCapacity = (uint *)0x0; pool = this->_pools; local_8 = 1; uVar6 = 0; do { uVar7 = (int)outcomesEnd - (int)WVar4 >> 3; uVar2 = 0; uVar5 = (uint)(pool->_totalWeight * 100.0); if (uVar7 != 0) { do { if (*(uint *)((int)WVar4 + uVar2 * 8) == uVar6) { outcomeWeight = (int *)((int)WVar4 + 4 + uVar2 * 8); *outcomeWeight = *outcomeWeight + uVar5; if (*outcomeWeight < 0) { *(undefined4 *)((int)WVar4 + 4 + uVar2 * 8) = 0; } goto LAB_007370f1; } uVar2 = uVar2 + 1; } while (uVar2 < uVar7); } if (0 < (int)uVar5) { newOutcomeId = uVar6; newOutcomeWeight = uVar5; if (outcomesEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcomeId); WVar4 = picker; outcomesEnd = pickerEnd; } else { *outcomesEnd = uVar6; outcomesEnd[1] = uVar5; pickerEnd = outcomesEnd + 2; outcomesEnd = pickerEnd; } } LAB_007370f1: uVar6 = uVar6 + 1; pool = pool + 1; } while (uVar6 < 0x10); uVar6 = 0x17; pool = itemPool->_pools + 0x17; do { uVar7 = (int)outcomesEnd - (int)WVar4 >> 3; uVar2 = 0; uVar5 = (uint)(pool->_totalWeight * 100.0); if (uVar7 != 0) { do { if (*(uint *)((int)WVar4 + uVar2 * 8) == uVar6) { outcomeWeight = (int *)((int)WVar4 + 4 + uVar2 * 8); *outcomeWeight = *outcomeWeight + uVar5; if (*outcomeWeight < 0) { *(undefined4 *)((int)WVar4 + 4 + uVar2 * 8) = 0; } goto LAB_00737181; } uVar2 = uVar2 + 1; } while (uVar2 < uVar7); } if (0 < (int)uVar5) { newOutcomeId = uVar6; newOutcomeWeight = uVar5; if (outcomesEnd == pickerCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcomeId); WVar4 = picker; outcomesEnd = pickerEnd; } else { *outcomesEnd = uVar6; outcomesEnd[1] = uVar5; pickerEnd = outcomesEnd + 2; outcomesEnd = pickerEnd; } } LAB_00737181: uVar6 = uVar6 + 1; pool = pool + 1; } while (uVar6 < 0x1f); uVar6 = rng->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = rng->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar6 = uVar6 >> ((byte)rng->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 ^ uVar6 << ((byte)rng->_shift2 & 0x1f); uVar6 = uVar6 ^ uVar6 >> ((byte)rng->_shift3 & 0x1f); rng->_seed = uVar6; rng_00._shift1 = 5; rng_00._seed = uVar6; rng_00._shift2 = 9; rng_00._shift3 = 7; uVar6 = WeightedOutcomePicker::PickOutcome(&picker,rng_00); if (picker == (WeightedOutcomePicker)0x0) { ExceptionList = local_10; return uVar6; } uVar2 = (int)pickerCapacity - (int)picker & 0xfffffff8; WVar4 = picker; if (uVar2 < 0x1000) goto LAB_0073721f; WVar4 = *(WeightedOutcomePicker *)((int)picker + -4); iVar3 = (int)picker - (int)WVar4; } uVar2 = uVar2 + 0x23; if (0x1f < iVar3 - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_0073721f: operator_delete((void *)WVar4,uVar2); ExceptionList = local_10; return uVar6; } //@@ 00737380 ItemPool::GetCollectibleFromList /* DB: REPENTOGON GetCollectibleFromList: same 6 arguments, returns one item id; the last bool skips active items (ItemConfig type 3) prototype: db/protos.zhl, confirmed by RET 24 */ int __thiscall ItemPool::GetCollectibleFromList (ItemPool *this,int *list,uint length,uint seed,uint defaultItem,byte isAddToBlacklist, byte isExcludeActives) { code *pcVar1; byte isAvailable; int iVar2; uint uVar3; uint uVar4; uint candidateIndex; int *this_00; uint candidateCount; uint uVar5; undefined4 fillValue; ItemPool *itemPool; uint *blacklistWord; void *itemTable; iVar2 = *(int *)ThreadLocalStoragePointer; itemPool = this; if ((*(int *)(iVar2 + 0xc) < DAT_00c8106c) && (_Init_thread_header(&DAT_00c8106c), DAT_00c8106c == -1)) { _atexit((_func_4879 *)&LAB_00b15b20); _Init_thread_footer(&DAT_00c8106c); } if ((*(int *)(iVar2 + 0xc) < DAT_00c8107c) && (_Init_thread_header(&DAT_00c8107c), DAT_00c8107c == -1)) { _atexit((_func_4879 *)&LAB_00b15b10); _Init_thread_footer(&DAT_00c8107c); } DAT_00c81074 = DAT_00c81070; uVar3 = DAT_00c81084 - DAT_00c81080 >> 2; fillValue = 0; if (length < uVar3) { DAT_00c81084 = DAT_00c81080 + length * 4; } else if (uVar3 < length) { if ((uint)(DAT_00c81088 - DAT_00c81080 >> 2) < length) { FUN_00737e80(length,&fillValue); } else { DAT_00c81084 = FUN_0041d1b0(DAT_00c81084,length - uVar3,&fillValue); } } uVar3 = 0; if (length != 0) { do { uVar4 = *list; if (g_game == (Game *)0x0) { if (-1 < (int)uVar4) goto LAB_00737461; LAB_00737519: *(undefined4 *)(DAT_00c81080 + uVar3 * 4) = 0; } else { if ((int)uVar4 < 0) { if (((int)uVar4 < 0) && (itemTable = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar4 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)itemTable >> 2)) { this_00 = (int *)**(undefined4 **)((int)itemTable + ~uVar4 * 4); } else { this_00 = (int *)0x0; } } else { LAB_00737461: itemTable = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)itemTable >> 2 <= (int)uVar4) goto LAB_00737519; this_00 = *(int **)((int)itemTable + uVar4 * 4); } if (this_00 == (int *)0x0) goto LAB_00737519; uVar5 = 1 << ((byte)uVar4 & 0x1f); if (((((*(uint *)((int)(itemPool->_removedCollectibles)._begin + (uVar4 >> 5) * 4) & uVar5) != 0) || ((*(uint *)((int)(itemPool->_roomBlacklistedCollectibles)._begin + (uVar4 >> 5) * 4) & uVar5) != 0)) || (isAvailable = Item::IsAvailable(this_00,0xffffffff), isAvailable == 0)) || ((isExcludeActives != 0 && (*this_00 == 3)))) goto LAB_00737519; if (DAT_00c81074 == DAT_00c81078) { std::vector::_Emplace_reallocate(DAT_00c81074,list); *(int *)(DAT_00c81080 + uVar3 * 4) = *list; } else { *DAT_00c81074 = *list; DAT_00c81074 = DAT_00c81074 + 1; *(int *)(DAT_00c81080 + uVar3 * 4) = *list; } } uVar3 = uVar3 + 1; list = list + 1; } while (uVar3 < length); } if (DAT_00c81070 != DAT_00c81074) { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar4 = seed >> 2 ^ seed; uVar5 = 0; uVar4 = uVar4 << 0x15 ^ uVar4; uVar4 = uVar4 >> 9 ^ uVar4; uVar3 = uVar5; if ((length != 0) && (uVar3 = uVar4 % length, length != 0)) { do { if (*(int *)(DAT_00c81080 + uVar5 * 4) == 0) { candidateCount = (int)DAT_00c81074 - (int)DAT_00c81070 >> 2; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar4 = uVar4 >> 2 ^ uVar4; uVar4 = uVar4 << 0x15 ^ uVar4; uVar4 = uVar4 >> 9 ^ uVar4; candidateIndex = 0; if (candidateCount != 0) { candidateIndex = uVar4 % candidateCount; } *(uint *)(DAT_00c81080 + uVar5 * 4) = DAT_00c81070[candidateIndex]; } uVar5 = uVar5 + 1; } while (uVar5 < length); } defaultItem = *(uint *)(DAT_00c81080 + uVar3 * 4); } if ((isAddToBlacklist != 0) && (defaultItem != 0)) { blacklistWord = (uint *)((int)(itemPool->_roomBlacklistedCollectibles)._begin + (defaultItem >> 5) * 4); *blacklistWord = *blacklistWord | 1 << (defaultItem & 0x1f); } return defaultItem; } //@@ 007376c0 ItemPool::GetCardImpl /* DB: ? RNG; Pickup::Init and AddItemCard */ int ItemPool::GetCardImpl(code *param_1) { code *pcVar1; RNG rng; int iVar2; uint uVar3; WeightedOutcomePicker ptr; uint outcomeCount; WeightedOutcomePicker poolPicker; undefined4 *outcomesEnd; undefined4 *outcomesCapacity; undefined4 newOutcome; uint local_1c; undefined4 seedShift; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 *filterSlot; void **filtersEnd; Manager *manager; int *weight; puStack_c = &LAB_00afd7dd; local_10 = ExceptionList; ExceptionList = &local_10; seedShift = 0xf; poolPicker = (WeightedOutcomePicker)0x0; outcomesEnd = (undefined4 *)0x0; outcomesCapacity = (undefined4 *)0x0; local_8 = 0; local_1c = 100; iVar2 = *(int *)((int)g_game->_room + 8); if (iVar2 == 0xe) { newOutcome = 3; } else if (iVar2 == 0xf) { newOutcome = 4; } else { newOutcome = 0; std::vector<8byte>::_Emplace_reallocate(0,&newOutcome); uVar3 = 0; outcomeCount = (int)outcomesEnd - (int)poolPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)poolPicker + uVar3 * 8) == 1) { weight = (int *)((int)poolPicker + 4 + uVar3 * 8); *weight = *weight + 0x1e; if (*weight < 0) { *(undefined4 *)((int)poolPicker + 4 + uVar3 * 8) = 0; } goto LAB_007377d7; } uVar3 = uVar3 + 1; } while (uVar3 < outcomeCount); } newOutcome = 1; local_1c = 0x1e; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcome); } else { *outcomesEnd = 1; outcomesEnd[1] = 0x1e; outcomesEnd = outcomesEnd + 2; } LAB_007377d7: uVar3 = 0; outcomeCount = (int)outcomesEnd - (int)poolPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)poolPicker + uVar3 * 8) == 2) { weight = (int *)((int)poolPicker + 4 + uVar3 * 8); *weight = *weight + 0x1e; if (*weight < 0) { *(undefined4 *)((int)poolPicker + 4 + uVar3 * 8) = 0; } goto LAB_0073783b; } uVar3 = uVar3 + 1; } while (uVar3 < outcomeCount); } newOutcome = 2; local_1c = 0x1e; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcome); } else { *outcomesEnd = 2; outcomesEnd[1] = 0x1e; outcomesEnd = outcomesEnd + 2; } LAB_0073783b: uVar3 = 0; outcomeCount = (int)outcomesEnd - (int)poolPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)poolPicker + uVar3 * 8) == 3) { weight = (int *)((int)poolPicker + 4 + uVar3 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)poolPicker + 4 + uVar3 * 8) = 0; } goto LAB_0073789f; } uVar3 = uVar3 + 1; } while (uVar3 < outcomeCount); } newOutcome = 3; local_1c = 10; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcome); } else { *outcomesEnd = 3; outcomesEnd[1] = 10; outcomesEnd = outcomesEnd + 2; } LAB_0073789f: uVar3 = 0; outcomeCount = (int)outcomesEnd - (int)poolPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)poolPicker + uVar3 * 8) == 4) { weight = (int *)((int)poolPicker + 4 + uVar3 * 8); *weight = *weight + 10; if (*weight < 0) { *(undefined4 *)((int)poolPicker + 4 + uVar3 * 8) = 0; } goto LAB_00737907; } uVar3 = uVar3 + 1; } while (uVar3 < outcomeCount); } newOutcome = 4; local_1c = 10; if (outcomesEnd == outcomesCapacity) { std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcome); } else { *outcomesEnd = 4; outcomesEnd[1] = 10; outcomesEnd = outcomesEnd + 2; } LAB_00737907: uVar3 = 0; outcomeCount = (int)outcomesEnd - (int)poolPicker >> 3; if (outcomeCount != 0) { do { if (*(int *)((int)poolPicker + uVar3 * 8) == 5) { weight = (int *)((int)poolPicker + 4 + uVar3 * 8); *weight = *weight + 2; if (*weight < 0) { *(undefined4 *)((int)poolPicker + 4 + uVar3 * 8) = 0; } goto LAB_00737965; } uVar3 = uVar3 + 1; } while (uVar3 < outcomeCount); } newOutcome = 5; local_1c = 2; if (outcomesEnd != outcomesCapacity) { *outcomesEnd = 5; outcomesEnd[1] = 2; outcomesEnd = outcomesEnd + 2; goto LAB_00737965; } } std::vector<8byte>::_Emplace_reallocate(outcomesEnd,&newOutcome); LAB_00737965: if (param_1 == (code *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar3 = (uint)param_1 >> 4 ^ (uint)param_1; uVar3 = uVar3 << 5 ^ uVar3; uVar3 = uVar3 >> 0xf ^ uVar3; rng._shift1 = 5; rng._seed = uVar3; rng._shift2 = 9; rng._shift3 = 7; local_1c = WeightedOutcomePicker::PickOutcome(&poolPicker,rng); manager = g_manager; param_1 = FUN_00737af0; filterSlot = (g_manager->_itemConfig)._availabilityFilters._end; if (filterSlot == (g_manager->_itemConfig)._availabilityFilters._capacity) { std::vector<4byte>::_Emplace_reallocate(filterSlot,¶m_1); } else { *filterSlot = FUN_00737af0; filtersEnd = &(manager->_itemConfig)._availabilityFilters._end; *filtersEnd = (void *)((int)*filtersEnd + 4); } if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar3 = uVar3 >> 4 ^ uVar3; uVar3 = uVar3 << 5 ^ uVar3; uVar3 = uVar3 >> ((byte)seedShift & 0x1f) ^ uVar3; iVar2 = GetCollectible(&g_game->_itemPool,local_1c,uVar3,9,0,0); if (iVar2 == 0) { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } uVar3 = uVar3 >> 4 ^ uVar3; uVar3 = uVar3 << 5 ^ uVar3; iVar2 = GetCollectible(&g_game->_itemPool,0,uVar3 >> ((byte)seedShift & 0x1f) ^ uVar3,9,0x26,0); } filtersEnd = &(g_manager->_itemConfig)._availabilityFilters._end; *filtersEnd = (void *)((int)*filtersEnd + -4); if (poolPicker != (WeightedOutcomePicker)0x0) { uVar3 = (int)outcomesCapacity - (int)poolPicker & 0xfffffff8; ptr = poolPicker; if (0xfff < uVar3) { ptr = *(WeightedOutcomePicker *)((int)poolPicker + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)poolPicker - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar3); } ExceptionList = local_10; return iVar2; } //@@ 00737af0 FUN_00737af0 uint FUN_00737af0(int *param_1) { int iVar1; iVar1 = *param_1; if ((((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) && (iVar1 = 0, (param_1[0x2e] & 0x2000000U) != 0)) { return param_1[0x2e] & 0x2000000U; } return CONCAT31((int3)((uint)iVar1 >> 8),1); } //@@ 00737b30 FUN_00737b30 void FUN_00737b30(int *param_1) { char cVar1; int *piVar2; int *piVar3; int iVar4; int iVar5; int *piVar6; void *pvVar7; undefined4 uVar8; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd80d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; pvVar7 = operator_new(0x2c); *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; *(undefined2 *)((int)pvVar7 + 0xc) = 0x101; *in_ECX = (int)pvVar7; local_8 = 0; uVar8 = FUN_00738040(*(undefined4 *)(*param_1 + 4),pvVar7,param_1); *(undefined4 *)(*in_ECX + 4) = uVar8; piVar2 = (int *)*in_ECX; in_ECX[1] = param_1[1]; piVar3 = (int *)piVar2[1]; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar6 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar6 + 0xd); piVar3 = piVar6; piVar6 = (int *)*piVar6; } *piVar2 = (int)piVar3; iVar4 = *(int *)(*in_ECX + 4); iVar5 = *(int *)(iVar4 + 8); cVar1 = *(char *)(iVar5 + 0xd); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar5 + 8) + 0xd); iVar4 = iVar5; iVar5 = *(int *)(iVar5 + 8); } *(int *)(*in_ECX + 8) = iVar4; } else { *piVar2 = (int)piVar2; *(int *)(*in_ECX + 8) = *in_ECX; } ExceptionList = local_10; return; } //@@ 00737c10 FUN_00737c10 void FUN_00737c10(int param_1,char *param_2) { char cVar1; void *pvVar2; undefined4 uVar3; undefined4 *in_ECX; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd83d; local_10 = ExceptionList; ExceptionList = &local_10; cVar1 = *param_2; *in_ECX = 0; in_ECX[1] = 0; param_2 = (char *)-(uint)(cVar1 != '\0'); in_ECX[2] = 0; uVar4 = param_1 + 0x1fU >> 5; if (uVar4 != 0) { pvVar2 = std::_Allocate(uVar4 * 4); *in_ECX = pvVar2; in_ECX[1] = pvVar2; in_ECX[2] = (void *)((int)pvVar2 + uVar4 * 4); uVar3 = FUN_0041d1b0(*in_ECX,uVar4,¶m_2); in_ECX[1] = uVar3; } in_ECX[3] = 0; local_8 = 0; std::vector::_Trim(param_1); ExceptionList = local_10; return; } //@@ 00737cc0 std::vector<24byte>::_Emplace_reallocate /* DB: growth/max 0xaaaaaaa by /0x18, 24-byte POD element; caller ItemPool::load_pools */ undefined4 * std::vector<24byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; void *pvVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 *puVar9; undefined4 *puVar10; undefined4 *puVar11; int *in_ECX; uint uVar12; uint uVar13; void *ptr; iVar2 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0x18; if (iVar5 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar13 = (in_ECX[2] - *in_ECX) / 0x18; if (0xaaaaaaa - (uVar13 >> 1) < uVar13) { uVar12 = 0xaaaaaaa; } else { uVar13 = (uVar13 >> 1) + uVar13; uVar12 = iVar5 + 1U; if (iVar5 + 1U <= uVar13) { uVar12 = uVar13; } if (0xaaaaaaa < uVar12) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar10 = _Allocate(uVar12 * 0x18); puVar1 = puVar10 + (((int)param_1 - iVar2) / 0x18) * 6; uVar6 = param_2[1]; uVar7 = param_2[2]; uVar8 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar6; puVar1[2] = uVar7; puVar1[3] = uVar8; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_2 + 4); puVar3 = (undefined4 *)in_ECX[1]; puVar11 = (undefined4 *)*in_ECX; puVar9 = puVar10; if (param_1 == puVar3) { for (; puVar11 != puVar3; puVar11 = puVar11 + 6) { uVar6 = puVar11[1]; uVar7 = puVar11[2]; uVar8 = puVar11[3]; *puVar9 = *puVar11; puVar9[1] = uVar6; puVar9[2] = uVar7; puVar9[3] = uVar8; *(undefined8 *)(puVar9 + 4) = *(undefined8 *)(puVar11 + 4); puVar9 = puVar9 + 6; } } else { FUN_005cc6e0(puVar11,param_1,puVar10); FUN_005cc6e0(param_1,in_ECX[1],puVar1 + 6); } pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { uVar13 = ((in_ECX[2] - (int)pvVar4) / 0x18) * 0x18; ptr = pvVar4; if (0xfff < uVar13) { ptr = *(void **)((int)pvVar4 + -4); uVar13 = uVar13 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar13); } *in_ECX = (int)puVar10; in_ECX[1] = (int)(puVar10 + (iVar5 * 3 + 3) * 2); in_ECX[2] = (int)(puVar10 + uVar12 * 6); return puVar1; } //@@ 00737e50 FUN_00737e50 void FUN_00737e50(void) { int *piVar1; undefined4 *in_ECX; piVar1 = (int *)in_ECX[1]; if (piVar1 != (int *)0x0) { FUN_004235c0(*in_ECX,*(undefined4 *)(*piVar1 + 4)); operator_delete((void *)*piVar1,0x2c); } return; } //@@ 00737e80 FUN_00737e80 void FUN_00737e80(uint param_1,undefined4 param_2) { uint *_Dst; int iVar1; uint uVar2; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar1 = DAT_00c81084 - (int)DAT_00c81080 >> 2; uVar2 = DAT_00c81088 - (int)DAT_00c81080 >> 2; if (0x3fffffff - (uVar2 >> 1) < uVar2) { uVar2 = 0x3fffffff; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < param_1) { uVar2 = param_1; } else if (0x3fffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar2 * 4); FUN_0041d1b0(_Dst + iVar1,param_1 - iVar1,param_2); memmove(_Dst,DAT_00c81080,DAT_00c81084 - (int)DAT_00c81080); FID_conflict__Change_array(&DAT_00c81080,_Dst,param_1,uVar2); return; } //@@ 00737f40 std::vector<8byte>::_Resize_reallocate /* DB: new size param (max 0x1fffffff), grows x1.5, zero-fills the tail, memmove old data; ItemPool::Init, std::vector<8byte>::resize */ void std::vector<8byte>::_Resize_reallocate(uint param_1) { void *pvVar1; void *_Dst; void *ptr; int *in_ECX; int iVar2; uint uVar3; int iVar4; uint size; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar2 = in_ECX[1] - *in_ECX >> 3; uVar3 = in_ECX[2] - *in_ECX >> 3; if (0x1fffffff - (uVar3 >> 1) < uVar3) { uVar3 = 0x1fffffff; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < param_1) { uVar3 = param_1; } else if (0x1fffffff < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar3 * 8); iVar4 = param_1 - iVar2; if (iVar4 != 0) { memset((void *)((int)_Dst + iVar2 * 8),0,iVar4 * 8); } memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + param_1 * 8); in_ECX[2] = (int)(uVar3 * 8 + (int)_Dst); return; } //@@ 00738040 FUN_00738040 int * FUN_00738040(undefined4 *param_1,int param_2,undefined4 param_3) { int *piVar1; int iVar2; undefined4 *in_ECX; int *piVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afd86d; local_10 = ExceptionList; ExceptionList = &local_10; piVar3 = (int *)*in_ECX; if (*(char *)((int)param_1 + 0xd) == '\0') { local_8 = 0; piVar1 = operator_new(0x2c); std::string::string((char *)(piVar1 + 4),param_1 + 4); piVar1[10] = param_1[10]; *piVar1 = (int)piVar3; piVar1[2] = (int)piVar3; *(undefined2 *)(piVar1 + 3) = 0; piVar1[1] = param_2; *(undefined1 *)(piVar1 + 3) = *(undefined1 *)(param_1 + 3); local_8 = 1; if (*(char *)((int)piVar3 + 0xd) != '\0') { piVar3 = piVar1; } iVar2 = FUN_00738040(*param_1,piVar1,param_3); *piVar1 = iVar2; iVar2 = FUN_00738040(param_1[2],piVar1,param_3); piVar1[2] = iVar2; } ExceptionList = local_10; return piVar3; } //@@ 0073811e Catch_All@0073811e void Catch_All_0073811e(void) { undefined4 uVar1; int unaff_EBP; undefined4 uVar2; uVar2 = *(undefined4 *)(unaff_EBP + 0xc); uVar1 = Config::GetCollectibles(uVar2); FUN_004235c0(uVar1,uVar2); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00738140 GridEntity::SetVariant /* ZHL [lua] Lua binding GridEntity:SetVariant */ void GridEntity::SetVariant(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 8) = param_1; return; } //@@ 00738150 FUN_00738150 void FUN_00738150(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x394) = param_1; return; } //@@ 00738160 FUN_00738160 void FUN_00738160(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x158) = param_1; return; } //@@ 00738170 GridEntity_Door::IsBusted /* ZHL [lua] Lua binding GridEntityDoor:IsBusted */ byte __thiscall GridEntity_Door::IsBusted(GridEntity_Door *this) { return this->_isBusted; } //@@ 00738180 RoomDescriptor::SurpriseMiniboss /* ZHL [lua] Lua binding RoomDescriptor:SurpriseMiniboss */ uint __thiscall RoomDescriptor::SurpriseMiniboss(RoomDescriptor *this) { return CONCAT31((uint3)((uint)this->Flags >> 0xc),(char)((uint)this->Flags >> 4)) & 0xffffff01; } //@@ 00738190 FUN_00738190 void FUN_00738190(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 0x10; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xffffffef; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 007381b0 LevelGenerator_Room::constructor /* ZHL [exact] __thiscall LevelGenerator_Room* LevelGenerator_Room::constructor(uint32_t column, uint32_t line, uint32_t shape); prototype: REPENTOGON, confirmed by RET 12 */ LevelGenerator_Room * __thiscall LevelGenerator_Room::constructor(LevelGenerator_Room *this,uint column,uint line,uint shape) { LevelGenerator_Room LVar1; *(undefined1 *)this = 1; this[2] = (LevelGenerator_Room)column; this[3] = (LevelGenerator_Room)line; this[4] = (LevelGenerator_Room)0x0; this[5] = (LevelGenerator_Room)0x0; this[6] = (LevelGenerator_Room)shape; this[7] = (LevelGenerator_Room)0x0; this[8] = (LevelGenerator_Room)0xffffffff; this[9] = (LevelGenerator_Room)0xffffffff; this[10] = (LevelGenerator_Room)g_levelGenInvalidPos[0]; this[0xb] = (LevelGenerator_Room)g_levelGenInvalidPos[1]; this[0xc] = (LevelGenerator_Room)0x0; this[0xd] = (LevelGenerator_Room)0x0; LVar1 = (LevelGenerator_Room)operator_new(0x14); *(LevelGenerator_Room *)LVar1 = LVar1; *(LevelGenerator_Room *)((int)LVar1 + 4) = LVar1; *(LevelGenerator_Room *)((int)LVar1 + 8) = LVar1; *(undefined2 *)((int)LVar1 + 0xc) = 0x101; this[0xc] = LVar1; *(undefined1 *)(this + 0xf) = 0; this[0x10] = (LevelGenerator_Room)0x0; *(undefined1 *)(this + 0x11) = 0; LVar1 = *(LevelGenerator_Room *)(&DAT_00c5d37c + shape * 8); this[4] = *(LevelGenerator_Room *)(&DAT_00c5d378 + shape * 8); this[5] = LVar1; return this; } //@@ 00738260 FUN_00738260 void FUN_00738260(void) { undefined4 *this; int in_ECX; this = (undefined4 *)(in_ECX + 0x30); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 0x30) + 4)); operator_delete((void *)*this,0x14); return; } //@@ 00738280 Seeds::GetStageSeed /* ZHL [lua] Lua binding Seeds:GetStageSeed */ int __thiscall Seeds::GetStageSeed(Seeds *this,uint param_2) { uint uVar1; if (this->_gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } param_2 = -(uint)(param_2 != 0) & param_2; uVar1 = 0xd; if (param_2 < 0xd) { uVar1 = param_2; } return this->_stageSeeds[uVar1]; } //@@ 007382c0 FUN_007382c0 void FUN_007382c0(void) { undefined4 uVar1; int in_ECX; uVar1 = *(undefined4 *)(in_ECX + 0x8bc); FUN_0041c910(*(undefined4 *)(in_ECX + 0x8c8)); FUN_0041cb90(uVar1,0,uVar1,0); return; } //@@ 00738310 Game::ClearDonationModGreed /* ZHL [lua] Lua binding Game:ClearDonationModGreed */ void __thiscall Game::ClearDonationModGreed(Game *this) { this->_donationModGreed = 0; return; } //@@ 00738320 Game::ClearDonationModAngel /* ZHL [lua] Lua binding Game:ClearDonationModAngel */ void __thiscall Game::ClearDonationModAngel(Game *this) { this->_donationModAngel = 0; return; } //@@ 00738330 FUN_00738330 undefined4 FUN_00738330(void) { return CONCAT31((int3)((uint)g_game >> 8),g_game->_isRestoringGlowingHourglassState); } //@@ 00738340 Game::get_backwards_stage /* DB: returns stage * 800 + Game + 0x6746c (BackwardsStageDesc, depth 1..7, "Invalid backwards path stage ID"); called by Level::SetNextStage; notes/systems/ascent.md */ int * Game::get_backwards_stage(int param_1) { Game *pGVar1; pGVar1 = g_game; if ((param_1 < 1) || (7 < param_1)) { KAGE_LogMessage(0x10,(byte *)"Invalid backwards path stage ID"); } return pGVar1->_glowingHourglassStates[1]._eventCounters + param_1 * 200 + 0x17b; } //@@ 00738380 FUN_00738380 Minimap * FUN_00738380(void) { return &g_game->_minimap; } //@@ 00738390 FUN_00738390 void FUN_00738390(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x26500) = param_1; return; } //@@ 007383a0 Game::GetTreasureRoomVisitCount /* ZHL [lua] Lua binding Game:GetTreasureRoomVisitCount */ int __thiscall Game::GetTreasureRoomVisitCount(Game *this) { return this->_treasureRoomsVisited; } //@@ 007383b0 FUN_007383b0 void FUN_007383b0(void) { Room *this; char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = *(Room **)(in_ECX + 0x18300); if (this != (Room *)0x0) { Room::~Room(this); operator_delete(this,0x7898); *(undefined4 *)(in_ECX + 0x18300) = 0; } std::vector::_Tidy(uVar2); local_8 = 0; if (*(int **)(in_ECX + 0x182fc) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x182fc) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x182f8); } } local_8 = 0xffffffff; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x14),0xb8,0x20f,RoomDescriptor::destructor); ExceptionList = local_10; return; } //@@ 00738470 Game::GetStageID /* ZHL [exact] __thiscall unsigned int Game::GetStageID(bool unused); prototype: REPENTOGON, confirmed by RET 4 */ uint __thiscall Game::GetStageID(Game *this,byte unused) { uint uVar1; if (g_game->_challenge == 0x2c) { uVar1 = Level::GetRoomStageType((Level *)this,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; } //@@ 007384d0 FUN_007384d0 void FUN_007384d0(void) { Room *pRVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd8a7; local_10 = ExceptionList; ExceptionList = &local_10; pRVar1 = (Room *)in_ECX[0x60c0]; if (pRVar1 != (Room *)0x0) { Room::~Room(pRVar1); operator_delete(pRVar1,0x7898); in_ECX[0x60c0] = 0; } pRVar1 = operator_new(0x7898); local_8 = 0; if (pRVar1 == (Room *)0x0) { pRVar1 = (Room *)0x0; } else { pRVar1 = Room::constructor(pRVar1); } in_ECX[0x60c0] = pRVar1; in_ECX[0x60b4] = 0xffffffff; in_ECX[0x60b3] = 0; *in_ECX = 0; in_ECX[1] = 0; in_ECX[3] = 0; in_ECX[0x60cd] = 0; memset(in_ECX + 0x60ce,0,0x30); in_ECX[0x60da] = 0; in_ECX[0x60db] = 0; *(undefined1 *)(in_ECX + 0x623e) = 0; ExceptionList = local_10; return; } //@@ 007385c0 Level::CanStageHaveCurseOfLabyrinth /* ZHL [lua] Lua binding Level:CanStageHaveCurseOfLabyrinth */ uint Level::CanStageHaveCurseOfLabyrinth(void) { uint in_EAX; uint *in_ECX; if (g_game->_challenge != 0x2c) { in_EAX = *in_ECX & 0x80000001; if ((int)in_EAX < 0) { in_EAX = (in_EAX - 1 | 0xfffffffe) + 1; } if ((((in_EAX == 1) && ((int)*in_ECX < 8)) && (in_EAX = g_game->_difficulty, in_EAX != 2)) && (in_EAX != 3)) { return CONCAT31((int3)(in_EAX >> 8),1); } } return in_EAX & 0xffffff00; } //@@ 00738610 Level::Update /* ZHL [exact] __thiscall void Level::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Level::Update(Level *this) { Room::Update(this); return; } //@@ 00738620 FUN_00738620 int FUN_00738620(uint param_1,uint param_2) { if ((param_1 < 0xd) && (param_2 < 0xd)) { return param_2 * 0xd + param_1; } return -1; } //@@ 00738650 Level::reset_room_list /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Level::reset_room_list(bool resetLilPortalRoom); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Level::reset_room_list(Level *this,byte resetLilPortalRoom) { void *pvVar1; int iVar2; uint uVar3; RoomDescriptor *other; uint uVar4; RoomDescriptor *pRVar5; RoomDescriptor local_cc; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afd8e1; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pRVar5 = this->_roomList; uVar4 = 0; local_14 = uVar3; do { if ((resetLilPortalRoom != 0) || (uVar4 != 0x20e)) { other = (RoomDescriptor *)RoomDescriptor::constructor(&local_cc); RoomDescriptor::operator_assign(pRVar5,other); std::vector::_Tidy(); FID_conflict__Erase_tree_>_> (&local_cc.RestrictedGridIndexes, (fuzzer_allocator_> *) &local_cc.RestrictedGridIndexes, *(_Tree_node **)((int)local_cc.RestrictedGridIndexes._head + 4) ); operator_delete(local_cc.RestrictedGridIndexes._head,0x14); std::vector::_Tidy(); FUN_00708f90(); pRVar5->ListIndex = uVar4; if (0x1fa < uVar4) { pRVar5->SafeGridIndex = 0x1fa - uVar4; pRVar5->GridIndex = 0x1fa - uVar4; } } uVar4 = uVar4 + 1; pRVar5 = pRVar5 + 1; } while (uVar4 < 0x20f); if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard,uVar3); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } if ((uint)this->_currentDimensionIdx < 3) { pRVar5 = this->_roomList + 0x20e; } else { pRVar5 = &g_roomDescriptorDummy; } uVar3 = 0; do { pvVar1 = (pRVar5->SavedGridEntities)._begin; iVar2 = *(int *)((int)pvVar1 + uVar3); if ((iVar2 == 0x12) || (iVar2 == 0x11)) { *(undefined4 *)((int)pvVar1 + uVar3) = 0; } uVar3 = uVar3 + 0x20; } while (uVar3 < 0x3800); ExceptionList = local_10; return; } //@@ 007387d0 RoomDescriptor::operator_assign /* DB: copies 0x2e dwords (RoomDescriptor size 0xb8) from param to this; called from Level::reset_room_list prototype: db/protos.zhl, confirmed by RET 4 */ RoomDescriptor * __thiscall RoomDescriptor::operator_assign(RoomDescriptor *this,RoomDescriptor *other) { std_vector *psVar1; std_set *this_00; void *pvVar2; uint uVar3; psVar1 = &other->SavedGridEntities; this->GridIndex = other->GridIndex; this->SafeGridIndex = other->SafeGridIndex; this->ListIndex = other->ListIndex; this->Dimension = other->Dimension; this->Data = other->Data; this->OverrideData = other->OverrideData; this->AllowedDoors = other->AllowedDoors; this->_doors[0] = other->_doors[0]; this->_doors[1] = other->_doors[1]; this->_doors[2] = other->_doors[2]; this->_doors[3] = other->_doors[3]; this->_doors[4] = other->_doors[4]; this->_doors[5] = other->_doors[5]; this->_doors[6] = other->_doors[6]; this->_doors[7] = other->_doors[7]; this->DisplayFlags = other->DisplayFlags; this->VisitedCount = other->VisitedCount; this->Flags = other->Flags; this->TotalMoneySpent = other->TotalMoneySpent; this->ClearCount = other->ClearCount; this->GreedSubType = other->GreedSubType; this->PoopCount = other->PoopCount; this->TKeeperCoinSpawns = other->TKeeperCoinSpawns; this->PitsCount = other->PitsCount; this->DecorationSeed = other->DecorationSeed; this->SpawnSeed = other->SpawnSeed; this->AwardSeed = other->AwardSeed; this->BossDeathSeed = other->BossDeathSeed; if (&this->SavedGridEntities != psVar1) { FUN_00708f90(); (this->SavedGridEntities)._begin = psVar1->_begin; (this->SavedGridEntities)._end = (other->SavedGridEntities)._end; (this->SavedGridEntities)._capacity = (other->SavedGridEntities)._capacity; psVar1->_begin = (void *)0x0; (other->SavedGridEntities)._end = (void *)0x0; (other->SavedGridEntities)._capacity = (void *)0x0; } psVar1 = &other->SavedEntities; if (&this->SavedEntities != psVar1) { std::vector::_Tidy(); (this->SavedEntities)._begin = psVar1->_begin; (this->SavedEntities)._end = (other->SavedEntities)._end; (this->SavedEntities)._capacity = (other->SavedEntities)._capacity; psVar1->_begin = (void *)0x0; (other->SavedEntities)._end = (void *)0x0; (other->SavedEntities)._capacity = (void *)0x0; } this_00 = &this->RestrictedGridIndexes; if (this_00 != &other->RestrictedGridIndexes) { pvVar2 = this_00->_head; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (this->RestrictedGridIndexes)._size = 0; pvVar2 = (this->RestrictedGridIndexes)._head; (this->RestrictedGridIndexes)._head = (other->RestrictedGridIndexes)._head; (other->RestrictedGridIndexes)._head = pvVar2; uVar3 = (this->RestrictedGridIndexes)._size; (this->RestrictedGridIndexes)._size = (other->RestrictedGridIndexes)._size; (other->RestrictedGridIndexes)._size = uVar3; } psVar1 = &other->SavedEffects; if (&this->SavedEffects != psVar1) { std::vector::_Tidy(); (this->SavedEffects)._begin = psVar1->_begin; (this->SavedEffects)._end = (other->SavedEffects)._end; (this->SavedEffects)._capacity = (other->SavedEffects)._capacity; psVar1->_begin = (void *)0x0; (other->SavedEffects)._end = (void *)0x0; (other->SavedEffects)._capacity = (void *)0x0; } *(undefined2 *)&this->field_0x94 = *(undefined2 *)&other->field_0x94; *(undefined2 *)&this->field_0x96 = *(undefined2 *)&other->field_0x96; *(undefined2 *)&this->field_0x98 = *(undefined2 *)&other->field_0x98; *(undefined2 *)&this->field_0x9a = *(undefined2 *)&other->field_0x9a; *(undefined2 *)&this->field_0x9c = *(undefined2 *)&other->field_0x9c; *(undefined2 *)&this->field_0x9e = *(undefined2 *)&other->field_0x9e; *(undefined2 *)&this->field_0xa0 = *(undefined2 *)&other->field_0xa0; *(undefined2 *)&this->field_0xa2 = *(undefined2 *)&other->field_0xa2; this->field_0xa4 = other->field_0xa4; this->field_0xa5 = other->field_0xa5; this->field_0xa6 = other->field_0xa6; this->field_0xa7 = other->field_0xa7; this->field_0xa8 = other->field_0xa8; this->field_0xa9 = other->field_0xa9; this->field_0xaa = other->field_0xaa; this->field_0xab = other->field_0xab; this->ShopItemIdx = other->ShopItemIdx; this->ShopItemDiscountIdx = other->ShopItemDiscountIdx; this->DeliriumDistance = other->DeliriumDistance; this->Group = other->Group; return this; } //@@ 00738ab0 Level::place_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: own log strings "Level::place_room data is NULL!", "[Level] place_room: invalid room pos/size", "Could not place room, limit of %d exceeded!"; args (RoomConfig_Room*, LevelGenerator_Room*, seed, ...); LevelGenerator::get_room_placement_offsets, GetRoomDescriptorsOffsetsArrayForDimension; 5 callers in level generation prototype: db/protos.zhl, confirmed by RET 20 */ byte __thiscall Level::place_room(Level *this,void *slot,void *data,uint seed,void *unused,RoomDescriptor **outDesc) { int dimension; code *pcVar1; byte isHasPit; char cVar3; uint uVar4; int **placementOffsets; int *piVar5; int iVar6; uint uVar7; RoomDescriptor *desc; int iVar8; undefined4 *spawnEntry; RNG rng; uint securityCookie; undefined1 auStack_8 [4]; Game *game; bool isHasPit; bool isPitFound; securityCookie = __security_cookie ^ (uint)(auStack_8 + 4); dimension = this->_currentDimensionIdx; if (data == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Level::place_room data is NULL!\n"); } if (0x1fa < this->_roomCount) { KAGE_LogMessage(1,(byte *)"[warn] Could not place room, limit of %d exceeded!\n"); return 0; } rng._shift1 = 2; rng._shift2 = 7; desc = this->_roomList + this->_roomCount; rng._seed = seed; rng._shift3 = 9; Seeds::Init3((Seeds *)desc,&rng); desc->Data = data; if ((*(uint *)((int)slot + 8) < 0xd) && (*(uint *)((int)slot + 0xc) < 0xd)) { iVar6 = *(uint *)((int)slot + 0xc) * 0xd + *(uint *)((int)slot + 8); } else { iVar6 = -1; } desc->GridIndex = iVar6; iVar8 = iVar6 + 1; if (*(int *)((int)data + 0x48) != 9) { iVar8 = iVar6; } desc->OverrideData = (void *)0x0; game = g_game; desc->SafeGridIndex = iVar8; desc->Dimension = dimension; desc->AllowedDoors = *(int *)((int)slot + 0x1c); isHasPit = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x92); if ((isHasPit != 0) && (cVar3 = FUN_0074d8d0(desc), cVar3 != '\0')) { desc->Flags = desc->Flags | 0x800; } if (*(int *)((int)desc->Data + 8) == 1) { uVar4 = GetRoomStageType(this,desc->GridIndex); uVar4 = RoomConfig::GetStageID(this->_stage,uVar4,-1); if (uVar4 == 0x21) { uVar4 = desc->DecorationSeed; rng._shift1 = 1; rng._shift2 = 0x15; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); isHasPit = (*pcVar1)(); return isHasPit; } uVar4 = uVar4 >> 1 ^ uVar4; uVar4 = uVar4 << 0x15 ^ uVar4; uVar4 = uVar4 >> 0x14 ^ uVar4; if (uVar4 == (uVar4 / 5) * 5) { isHasPit = false; isPitFound = false; uVar4 = (uint)*(ushort *)((int)desc->Data + 0x44); if (uVar4 != 0) { spawnEntry = (undefined4 *)(*(int *)((int)desc->Data + 0x40) + 4); do { uVar7 = 0; if (*(byte *)(spawnEntry + 1) != 0) { piVar5 = (int *)*spawnEntry; do { if ((2999 < *piVar5) && (*piVar5 < 0xbc2)) { isPitFound = true; isHasPit = true; break; } uVar7 = uVar7 + 1; piVar5 = piVar5 + 3; isHasPit = isPitFound; } while (uVar7 < *(byte *)(spawnEntry + 1)); } spawnEntry = spawnEntry + 4; uVar4 = uVar4 - 1; } while (uVar4 != 0); if (isHasPit) goto LAB_00738cb6; } desc->Flags = desc->Flags | 0x1000; } } } LAB_00738cb6: placementOffsets = LevelGenerator::get_room_placement_offsets(*(int *)((int)desc->Data + 0x48)); iVar6 = 0; do { piVar5 = *placementOffsets; if ((*(int *)((int)piVar5 + iVar6) == g_levelGenInvalidPos[0]) && (*(int *)((int)piVar5 + iVar6 + 4) == g_levelGenInvalidPos[1])) { this->_roomCount = this->_roomCount + 1; if (outDesc != (RoomDescriptor **)0x0) { *outDesc = desc; } return 1; } uVar4 = *(int *)((int)slot + 8) + *(int *)((int)piVar5 + iVar6); uVar7 = *(int *)((int)piVar5 + iVar6 + 4) + *(int *)((int)slot + 0xc); if ((uVar4 < 0xd) && (uVar7 < 0xd)) { iVar8 = uVar7 * 0xd + uVar4; if (iVar8 < 0) goto LAB_00738d12; } else { iVar8 = -1; LAB_00738d12: KAGE_LogMessage(0x10,(byte *)"[Level] place_room: invalid room pos/size\n"); } piVar5 = Game::GetRoomDescriptorsOffsetsArrayForDimension((Game *)this,dimension); iVar6 = iVar6 + 8; piVar5[iVar8] = ((RNG *)&desc->ListIndex)->_seed; } while( true ); } //@@ 00738d70 Console::Print /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix44/45] __thiscall void Console::Print(const std_string &text, unsigned int color, unsigned int fadeTime); */ undefined4 * __thiscall Console::Print(Console *this,undefined4 *param_2) { int iVar1; void *setHead; uint belowRow; Console *pCVar2; uint roomCol; uint uVar3; uint *neighborIdx; uint uVar4; uint belowRow; undefined1 local_68 [4]; uint roomHeight; uint roomWidth; undefined4 constructedFlags; undefined4 *outSet; Console *roomDesc; Console *savedThis; uint local_4c [15]; void *local_10; undefined1 *puStack_c; uint local_8; Console gridIndex; Console roomData; puStack_c = &LAB_00afd92e; local_10 = ExceptionList; local_4c[0xd] = __security_cookie ^ (uint)(local_4c + 0x12); ExceptionList = &local_10; local_8 = 0; constructedFlags = 0; outSet = param_2; *param_2 = 0; param_2[1] = 0; savedThis = this; setHead = operator_new(0x14); *(void **)setHead = setHead; *(void **)((int)setHead + 4) = setHead; *(void **)((int)setHead + 8) = setHead; *(undefined2 *)((int)setHead + 0xc) = 0x101; *param_2 = setHead; local_8 = 0; constructedFlags = 1; if (*this == (Console)0xb) { uVar4 = 0; local_4c[1] = 1; local_4c[2] = 0xffffffff; local_4c[3] = 0xd; local_4c[4] = 0xfffffff3; do { local_4c[0] = (int)this[0x60b4] + local_4c[uVar4 + 1]; if ((-1 < (int)local_4c[0]) && (local_4c[0] < 0xa9)) { std::set::insert(local_68,local_4c); } uVar4 = uVar4 + 1; } while (uVar4 < 4); } local_4c[0] = 0; if ((int)this[0x60b3] < 1) { outSet = param_2; } else { roomDesc = this + 9; pCVar2 = savedThis; do { roomData = *roomDesc; if (roomData != (Console)0x0) { gridIndex = roomDesc[-4]; if (-1 < (int)gridIndex) { roomCol = (int)gridIndex % 0xd; belowRow = (int)gridIndex / 0xd; roomWidth = *(byte *)((int)roomData + 0x46) / 0xd; uVar3 = *(byte *)((int)roomData + 0x47) / 7; uVar4 = roomCol - 1; roomHeight = (*(byte *)((int)roomData + 0x47) - uVar3 >> 1) + uVar3 >> 2; if ((uVar4 < 0xd) && (belowRow < 0xd)) { local_4c[5] = uVar4 + belowRow * 0xd; } else { local_4c[5] = -1; } if ((roomCol < 0xd) && (belowRow - 1 < 0xd)) { local_4c[6] = belowRow * 0xd + -0xd + roomCol; } else { local_4c[6] = -1; } uVar3 = roomWidth + roomCol; if ((uVar3 < 0xd) && (belowRow < 0xd)) { local_4c[7] = belowRow * 0xd + uVar3; } else { local_4c[7] = -1; } belowRow = roomHeight + belowRow; if ((roomCol < 0xd) && (belowRow < 0xd)) { local_4c[8] = belowRow * 0xd + roomCol; } else { local_4c[8] = -1; } if ((uVar4 < 0xd) && (belowRow + 1 < 0xd)) { local_4c[9] = belowRow * 0xd + 0xc + roomCol; } else { local_4c[9] = -1; } uVar4 = roomCol + 1; if ((uVar4 < 0xd) && (belowRow - 1 < 0xd)) { local_4c[10] = belowRow * 0xd + -0xc + roomCol; } else { local_4c[10] = -1; } if ((uVar3 < 0xd) && (belowRow + 1 < 0xd)) { local_4c[0xb] = (belowRow + 1) * 0xd + uVar3; } else { local_4c[0xb] = -1; } if ((uVar4 < 0xd) && (belowRow < 0xd)) { local_4c[0xc] = belowRow * 0xd + uVar4; } else { local_4c[0xc] = -1; } uVar4 = 0; neighborIdx = local_4c + 5; belowRow = 1; do { roomData = *roomDesc; iVar1 = *(int *)((int)roomData + 0x48); if (iVar1 == 1) { if ((((uVar4 != 4) && (uVar4 != 5)) && (uVar4 != 6)) && (uVar4 != 7)) goto LAB_00738ff3; } else if (iVar1 == 4) { if (uVar4 != 5) { if (uVar4 != 7) goto LAB_00738ff3; break; } } else if ((iVar1 != 6) || ((uVar4 != 4 && (uVar4 != 6)))) { LAB_00738ff3: if ((((*(uint *)((int)roomData + 0x38 + (uVar4 >> 5) * 4) & belowRow) == 0) || (((iVar1 = *(int *)((int)roomData + 8), iVar1 == 5 || (iVar1 == 8)) || (iVar1 == 7)))) && (-1 < (int)*neighborIdx)) { std::set::insert(local_4c + 3,neighborIdx); } } uVar4 = uVar4 + 1; belowRow = belowRow << 1 | (uint)((int)belowRow < 0); neighborIdx = neighborIdx + 1; } while ((int)uVar4 < 8); } pCVar2 = savedThis; } local_4c[0] = local_4c[0] + 1; roomDesc = roomDesc + 0x2e; } while ((int)local_4c[0] < (int)pCVar2[0x60b3]); } ExceptionList = local_10; return outSet; } //@@ 00739080 Level::pick_boss_room_config /* DB: ? ECX = boss id (0x59 Mausoleum Mom with game state flag -> GetRandomRoomWithFallbackStage), RoomConfig::GetRandomRoom retry loop (50 tries) filtering room subtypes; callers include Level::TryInitializeExtraBossRoom prototype: db/protos.zhl */ void * __fastcall Level::pick_boss_room_config(int bossId,uint seed) { code *pcVar1; void *pvVar2; uint uVar3; int mode; uint uVar4; int iVar5; RoomConfig_Room *pRVar6; uint in_stack_ffffffb0; int in_stack_ffffffb4; RNG local_24; uint local_14 [3]; RoomConfig *local_8; local_24._shift1 = 5; local_24._shift2 = 0xf; local_8 = &g_game->_roomConfig; uVar3 = 0; if (bossId < 0) { uVar3 = -bossId; } pRVar6 = (RoomConfig_Room *)0x0; local_14[1] = 0x11; local_24._shift3 = 0x11; local_24._seed = seed; if (uVar3 == 0) { if ((bossId == 0x59) && ((g_game->_gameStateFlags & 0x800000000000) != 0)) { local_14[0] = 0; uVar3 = Game::GetStageID(g_game,(byte)g_game); uVar4 = RNG::Next(&local_24); pvVar2 = RoomConfig::GetRandomRoomWithFallbackStage (local_8,uVar4,1,uVar3,0x1f,5,0xd,in_stack_ffffffb0,in_stack_ffffffb4,1,10, local_14,0x59,mode); return pvVar2; } iVar5 = 0x32; local_14[0] = bossId; do { local_14[2] = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pvVar2 = (void *)(*pcVar1)(); return pvVar2; } uVar3 = seed >> ((byte)local_24._shift1 & 0x1f) ^ seed; uVar3 = uVar3 << ((byte)local_24._shift2 & 0x1f) ^ uVar3; seed = uVar3 >> ((byte)local_14[1] & 0x1f) ^ uVar3; pRVar6 = RoomConfig::GetRandomRoom (local_8,seed,1,0,5,0xd,0,-1,1,10,local_14 + 2,local_14[0],-1); } while ((((0 < iVar5) && (pRVar6 != (RoomConfig_Room *)0x0)) && (pRVar6->Type == 5)) && (iVar5 = iVar5 + -1, pRVar6->Variant - 0xe74U < 0x96)); } else { local_14[2] = 0x32; while ((((pRVar6 == (RoomConfig_Room *)0x0 || (((g_manager->_persistentGameData)._achievements[0x10] == 0 && ((((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) && (pRVar6->Subtype == 0x14)))))) || (((((g_manager->_persistentGameData)._achievements[0x11] == 0 && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) && (pRVar6->Subtype == 0x15)) || (((((g_manager->_persistentGameData)._achievements[0x12] == 0 && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) && (pRVar6->Subtype == 0x13)) || (((g_manager->_persistentGameData)._achievements[0x44] == 0 && ((((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) && (pRVar6->Subtype == 0x2a)))))))))) || (((((g_manager->_persistentGameData)._achievements[0x15a] == 0 && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) && ((0x38 < (uint)pRVar6->Subtype && ((uint)pRVar6->Subtype < 0x43)))) || (((g_manager->_persistentGameData)._achievements[0x15b] == 0 && ((((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) && (pRVar6->Subtype - 0x43U < 6))))))))) { local_14[0] = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pvVar2 = (void *)(*pcVar1)(); return pvVar2; } uVar4 = seed >> ((byte)local_24._shift1 & 0x1f) ^ seed; uVar4 = uVar4 << ((byte)local_24._shift2 & 0x1f) ^ uVar4; seed = uVar4 >> ((byte)local_14[1] & 0x1f) ^ uVar4; pRVar6 = RoomConfig::GetRandomRoom (local_8,seed,1,0,5,0xd,uVar3,uVar3 + 0x31,1,10,local_14,0xffffffff,-1); if ((int)local_14[2] < 1) { return pRVar6; } local_14[2] = local_14[2] + -1; if (pRVar6 == (RoomConfig_Room *)0x0) { return (void *)0x0; } } } return pRVar6; } //@@ 00739370 Level::place_special_rooms /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: the level's special rooms: boss, shops, treasure, mirror/mineshaft/photo door rooms (alt_path.md) */ undefined4 Level::place_special_rooms(LevelGenerator *param_1,Entity_Player *param_2,int param_3) { uint *puVar1; undefined4 *puVar2; LevelGenerator LVar3; code *pcVar4; qword qVar5; byte bVar6; char isFullHealth; uint uVar7; ChallengeParam *challengeParams; undefined4 uVar8; uint uVar9; Entity_Player *pEVar10; LevelGenerator_Room *newRoom; void *pvVar11; Entity_Player *pEVar12; int *piVar13; RoomDescriptor *roomDesc; uint preventedCurses; undefined1 uVar14; Game *in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; void *unused; int mode; void *unused_00; void *extraout_ECX_02; void *extraout_ECX_03; void *extraout_ECX_04; void *pvVar15; void *extraout_ECX_05; Entity_Player *extraout_ECX_06; Entity_Player *extraout_ECX_07; Game *game; void *unused_01; RoomConfig *roomConfigRef; void *extraout_ECX_08; void *extraout_ECX_09; void *unused_02; void *unused_03; int extraout_ECX_10; void *unused_04; void *unused_05; void *extraout_ECX_11; void *extraout_ECX_12; int mode_00; Entity_Player *extraout_ECX_13; Entity_Player *extraout_ECX_14; undefined4 extraout_EDX; undefined4 *puVar16; uint extraout_EDX_00; PlayerManager *playerManager; int extraout_EDX_01; Entity_Player *pEVar17; LevelGenerator *levelGenRef; undefined1 *puVar18; Game *levelRef; int *piVar19; RoomConfig_Room *pRVar20; int iVar21; RNG *genRng; void **ppvVar22; bool bVar23; int iVar24; uint in_stack_fffffe84; uint uVar25; int in_stack_fffffe88; RoomDescriptor **outDesc; int secretRoomIdx; int *allRoomsBegin; int *allRoomsEnd; int local_13c; Entity_Player *local_138; uint local_134; uint local_130; int stageId; RNG *savedGenRng; undefined1 local_124 [4]; Entity_Player *local_120; undefined8 local_118; int *local_110; undefined8 local_108; Entity_Player *local_100; Entity_Player *local_fc; Entity_Player *local_f8; int local_f4; RoomConfig_Room *local_f0; uint local_ec; Entity_Player *local_e8; LevelGenerator *levelGen; RoomConfig *roomConfig; Entity_Player *local_dc; Game *local_d8; Entity_Player *local_d4; RoomConfig_Room *local_d0; char local_c9; char local_c8 [8]; RNG tmpRng; int excludedBossIds [37]; undefined1 local_1c [4]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afd9e0; local_10 = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; local_138 = (Entity_Player *)0x0; uVar9 = in_ECX->_stageType; uVar25 = in_ECX->_stage; levelGen = param_1; local_13c = param_3; roomConfig = &g_game->_roomConfig; local_d8 = in_ECX; local_18 = uVar7; stageId = RoomConfig::GetStageID(uVar25,uVar9,-1); local_134 = CONCAT31((int3)((uint)extraout_EDX >> 8),1); local_130 = 0xffffffff; secretRoomIdx = -1; challengeParams = Game::GetChallengeParams(game); local_120 = (Entity_Player *)&challengeParams->_roomset; if ((challengeParams->_isMegaSatan == 0) || (uVar25 != 0xb)) { iVar21 = BossPool::GetBossId(&game->_bossPool,uVar25,uVar9,(RNG *)&game->_bossPool); game = local_d8; genRng = &local_d8->_generationRNG; uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(game->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(game->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(game->_generationRNG)._shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; pvVar11 = pick_boss_room_config(iVar21,uVar9); if (pvVar11 == (void *)0x0) { LAB_007394ce: KAGE_LogMessage(1,(byte *) "[warn] could not find matching boss room (boss id: %d) for the current stage\n" ); ExceptionList = local_10; return 0; } local_f0 = (RoomConfig_Room *) LevelGenerator::place_boss_room (*(undefined4 *)((int)pvVar11 + 0x48),(int)pvVar11 + 0x38,0); if (local_f0 == (RoomConfig_Room *)0x0) { ExceptionList = local_10; return 0; } uVar9 = genRng->_seed; local_d8->_lastBossRoomListIdx = local_d8->_nbRooms; *(int *)&local_d8->field_0x18330 = local_d8->_nbRooms; in_stack_fffffe88 = 0x73952d; place_room((Level *)local_d8,local_f0,pvVar11,uVar9,local_f0,(RoomDescriptor **)0x0); if (local_d8->_stage == 0xc) { uVar9 = RNG::RandomInt(genRng,4); local_fc = (Entity_Player *)(uVar9 + 5); local_108 = 0; local_100 = (Entity_Player *)0x0; local_8 = 1; FUN_00752980(extraout_ECX); pEVar17 = (Entity_Player *)0x0; excludedBossIds[0] = 0x3c; excludedBossIds[1] = 0x2b; excludedBossIds[2] = 0x32; excludedBossIds[3] = 0x17; excludedBossIds[0x24] = 0x1a; excludedBossIds[4] = 0x43; excludedBossIds[5] = 0x45; excludedBossIds[6] = 0x3d; excludedBossIds[7] = 0x39; excludedBossIds[8] = 0x2c; excludedBossIds[9] = 0x40; excludedBossIds[10] = 0x38; excludedBossIds[0xb] = 0x41; excludedBossIds[0xc] = 0x2f; excludedBossIds[0xd] = 0x2d; excludedBossIds[0xe] = 0x2b; excludedBossIds[0xf] = 0x32; excludedBossIds[0x10] = 0x34; excludedBossIds[0x11] = 9; excludedBossIds[0x12] = 10; excludedBossIds[0x13] = 0x12; excludedBossIds[0x14] = 0x20; excludedBossIds[0x15] = 0x24; excludedBossIds[0x16] = 0x1b; excludedBossIds[0x17] = 0xd; excludedBossIds[0x18] = 0xe; excludedBossIds[0x19] = 0x14; excludedBossIds[0x1a] = 0x11; excludedBossIds[0x1b] = 0x1c; excludedBossIds[0x1c] = 2; excludedBossIds[0x1d] = 1; excludedBossIds[0x1e] = 0x15; excludedBossIds[0x1f] = 3; excludedBossIds[0x20] = 4; excludedBossIds[0x21] = 0x22; excludedBossIds[0x22] = 0x25; excludedBossIds[0x23] = 0x1d; pEVar10 = local_100; puVar16 = (undefined4 *)local_108._4_4_; do { if (pEVar17 != (Entity_Player *)&DAT_00000037) { if (pEVar17 != (Entity_Player *)&DAT_0000003f) { if (pEVar17 != (Entity_Player *)&DAT_00000006) { if (pEVar17 != (Entity_Player *)0x3e) { pEVar12 = (Entity_Player *)excludedBossIds; if (pEVar12 != (Entity_Player *)local_1c) { do { if (*(Entity_Player **)&pEVar12->field_0x0 == pEVar17) break; pEVar12 = (Entity_Player *)&pEVar12->field_0x4; } while (pEVar12 != (Entity_Player *)local_1c); } local_d4 = (Entity_Player *)local_1c; if (pEVar12 == (Entity_Player *)local_1c) { local_d4 = pEVar17; if ((Entity_Player *)puVar16 == pEVar10) { std::vector::_Emplace_reallocate(puVar16,&local_d4); pEVar10 = local_100; puVar16 = (undefined4 *)local_108._4_4_; } else { *puVar16 = pEVar17; local_108 = CONCAT44(puVar16 + 1,(void *)local_108); puVar16 = puVar16 + 1; } } } } } } pEVar17 = (Entity_Player *)((int)&pEVar17->field_0x0 + 1); } while ((int)pEVar17 < 0x46); pvVar11 = (void *)local_108; local_e8 = (Entity_Player *)((int)puVar16 - (int)(void *)local_108 >> 2); puVar18 = (undefined1 *)((int)&local_e8[-1]._replacedPlayer + 3); if (0 < (int)puVar18) { do { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(game->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(game->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(game->_generationRNG)._shift3 & 0x1f) ^ uVar9; uVar25 = 0; genRng->_seed = uVar9; if (local_e8 != (Entity_Player *)0x0) { uVar25 = uVar9 % (uint)local_e8; } uVar8 = *(undefined4 *)((int)pvVar11 + (int)puVar18 * 4); local_e8 = (Entity_Player *)((int)&local_e8[-1]._replacedPlayer + 3); *(undefined4 *)((int)pvVar11 + (int)puVar18 * 4) = *(undefined4 *)((int)pvVar11 + uVar25 * 4); puVar18 = puVar18 + -1; *(undefined4 *)((int)pvVar11 + uVar25 * 4) = uVar8; } while (0 < (int)puVar18); } local_e8 = (Entity_Player *)0x0; if (0 < (int)local_fc) { do { uVar9 = genRng->_seed; local_d4 = *(Entity_Player **)((int)pvVar11 + (int)local_e8 * 4); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(game->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(game->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(game->_generationRNG)._shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; pvVar15 = pick_boss_room_config((int)local_d4,uVar9); if (pvVar15 == (void *)0x0) { KAGE_LogMessage(1,(byte *) "[warn] could not find matching boss room (boss id: %d) for the current stage\n" ); if (pvVar11 == (void *)0x0) { ExceptionList = local_10; return 0; } uVar9 = (int)local_100 - (int)pvVar11 & 0xfffffffc; pvVar15 = pvVar11; if (0xfff < uVar9) { pvVar15 = *(void **)((int)pvVar11 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar11 + (-4 - (int)pvVar15))) goto LAB_00739809; } operator_delete(pvVar15,uVar9); ExceptionList = local_10; return 0; } local_f0 = (RoomConfig_Room *) LevelGenerator::place_boss_room (*(undefined4 *)((int)pvVar15 + 0x48),(int)pvVar15 + 0x38,1); if (local_f0 == (RoomConfig_Room *)0x0) { if ((int)local_e8 < 5) { if (pvVar11 == (void *)0x0) { ExceptionList = local_10; return 0; } uVar9 = (int)local_100 - (int)pvVar11 & 0xfffffffc; pvVar15 = pvVar11; if (0xfff < uVar9) { pvVar15 = *(void **)((int)pvVar11 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar11 + (-4 - (int)pvVar15))) goto LAB_00739809; } operator_delete(pvVar15,uVar9); ExceptionList = local_10; return 0; } break; } uVar9 = genRng->_seed; local_d8->_lastBossRoomListIdx = local_d8->_nbRooms; in_stack_fffffe88 = 0x7397ad; place_room((Level *)local_d8,local_f0,pvVar15,uVar9,local_f0,(RoomDescriptor **)0x0); local_e8 = (Entity_Player *)&local_e8->field_0x1; } while ((int)local_e8 < (int)local_fc); } local_8 = 0xffffffff; if (pvVar11 != (void *)0x0) { uVar9 = ((int)local_100 - (int)pvVar11 >> 2) * 4; pvVar15 = pvVar11; if (0xfff < uVar9) { pvVar15 = *(void **)((int)pvVar11 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar11 + (-4 - (int)pvVar15))) { LAB_00739809: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar15,uVar9); local_108 = 0; local_100 = (Entity_Player *)0x0; } } game = g_game; uVar9 = g_game->_debugCurses; uVar25 = local_d8->_curses; uVar7 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); levelRef = local_d8; if ((~preventedCurses & (uVar7 | uVar9 | uVar25) & 2) == 0) { uVar8 = extraout_ECX_00; if (local_f0 == (RoomConfig_Room *)0x0) goto LAB_00739a1e; } else { local_fc = (Entity_Player *)(local_d8->_generationRNG)._seed; iVar21 = BossPool::GetBossId(&game->_bossPool,local_d8->_stage + 1,local_d8->_stageType, (RNG *)&game->_bossPool); uVar9 = (levelRef->_generationRNG)._seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = (levelRef->_generationRNG)._seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(levelRef->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift3 & 0x1f) ^ uVar9; (levelRef->_generationRNG)._seed = uVar9; pvVar11 = pick_boss_room_config(iVar21,uVar9); if (pvVar11 == (void *)0x0) goto LAB_007394ce; local_f0 = (RoomConfig_Room *) LevelGenerator::place_boss_room (*(undefined4 *)((int)pvVar11 + 0x48),(int)pvVar11 + 0x38,0); levelRef->_lastBossRoomListIdx = levelRef->_nbRooms; if (local_f0 == (RoomConfig_Room *)0x0) { ExceptionList = local_10; return 0; } in_stack_fffffe88 = 0x7399cc; place_room((Level *)levelRef,local_f0,pvVar11,(levelRef->_generationRNG)._seed, (void *)levelRef->_nbRooms,(RoomDescriptor **)0x0); (levelRef->_generationRNG)._seed = (int)local_fc; (levelRef->_generationRNG)._shift1 = 5; (levelRef->_generationRNG)._shift2 = 9; (levelRef->_generationRNG)._shift3 = 7; uVar8 = extraout_ECX_01; } LevelGenerator::block_room_area(local_f0,uVar8); game = g_game; } else { if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard,uVar7); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } game = g_game; } roomDesc = &g_roomDescriptorDummy; if ((uint)local_d8->_currentDimensionIdx < 3) { roomDesc = local_d8->_roomList + 0x201; } local_d8->_lastBossRoomListIdx = roomDesc->ListIndex; } LAB_00739a1e: levelRef = local_d8; pEVar10 = local_120; local_fc = (Entity_Player *)0x8; std::set::find_node(&local_108,&local_fc); if (((*(char *)((int)local_100 + 0xd) != '\0') || (8 < *(int *)((int)local_100 + 0x10))) || (local_100 == (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) { uVar9 = (levelRef->_generationRNG)._seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = (levelRef->_generationRNG)._seed; game = g_game; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift1 & 0x1f) ^ uVar9; tmpRng._shift1 = 2; tmpRng._shift2 = 5; uVar9 = uVar9 << ((byte)(levelRef->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift3 & 0x1f) ^ uVar9; local_fc = (Entity_Player *)0xf; (levelRef->_generationRNG)._seed = uVar9; pRVar20 = (RoomConfig_Room *)0x1; pEVar10 = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x24d,(RNG **)&game->_playerManager,1); if (pEVar10 != (Entity_Player *)0x0) { pRVar20 = (RoomConfig_Room *)0x2; } iVar21 = 0; local_f0 = pRVar20; do { local_d4 = (Entity_Player *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> ((byte)tmpRng._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)tmpRng._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)local_fc & 0x1f) ^ uVar9; in_stack_fffffe88 = -1; in_stack_fffffe84 = 0; pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,8,0xd,0,-1,1,10,(uint *)&local_d4,0xffffffff,-1); newRoom = LevelGenerator::GetNewEndRoom(levelGen,pRVar20->Shape,(uint *)&pRVar20->Doors); if (newRoom == (LevelGenerator_Room *)0x0) { if (iVar21 == 0) { ExceptionList = local_10; return 0; } break; } in_stack_fffffe88 = 0x739b92; place_room((Level *)local_d8,newRoom,pRVar20,uVar9,unused,(RoomDescriptor **)0x0); iVar21 = iVar21 + 1; } while (iVar21 < (int)local_f0); game = g_game; } levelRef = local_d8; uVar9 = (local_d8->_generationRNG)._seed; genRng = &local_d8->_generationRNG; savedGenRng = genRng; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; game = g_game; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(levelRef->_generationRNG)._shift2 & 0x1f) ^ uVar9; local_fc = (Entity_Player *)(uVar9 >> ((byte)(levelRef->_generationRNG)._shift3 & 0x1f) ^ uVar9); genRng->_seed = (int)local_fc; if (levelRef->_stage < 7) { LAB_00739c87: local_d4 = (Entity_Player *)0x2; std::set::find_node(&local_108,&local_d4); if ((((*(char *)((int)local_100 + 0xd) != '\0') || (2 < *(int *)((int)local_100 + 0x10))) || (local_100 == (Entity_Player *)*(undefined4 **)&local_120->field_0x0)) && (game->_victoryLap < 3)) { if (((g_manager->_persistentGameData)._achievements[0x97] == 0) && ((g_manager->_state != 2 || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0))))) ) { local_dc = (Entity_Player *)0x1; } else { local_dc = (Entity_Player *)0x2; } if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && ((g_manager->_state != 2 || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0))))) ) { local_e8 = (Entity_Player *)0x1; } else { local_e8 = (Entity_Player *)0x2; } if (((g_manager->_persistentGameData)._achievements[0x99] != 0) || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0))))) ) { local_dc = (Entity_Player *)&local_dc->field_0x1; } if (((g_manager->_persistentGameData)._achievements[0x9a] != 0) || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0))))) ) { local_e8 = (Entity_Player *)&local_e8->field_0x1; } uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; game = g_game; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift1 & 0x1f) ^ uVar9; local_108 = 0x300000003; uVar9 = uVar9 << ((byte)(levelRef->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift3 & 0x1f) ^ uVar9; local_f0 = (RoomConfig_Room *)0x1a; genRng->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> 3 ^ uVar9; uVar9 = uVar9 << 3 ^ uVar9; uVar9 = uVar9 >> 0x1a ^ uVar9; local_130 = uVar9 % (uint)local_dc; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> 3 ^ uVar9; uVar9 = uVar9 << 3 ^ uVar9; local_d4 = (Entity_Player *)(uVar9 >> 0x1a ^ uVar9); puVar18 = (undefined1 *)(local_130 + (uint)local_d4 % (uint)local_e8); if (local_d4 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } local_130 = (uint)local_d4 >> 3 ^ (uint)local_d4; local_130 = local_130 << 3 ^ local_130; local_130 = local_130 >> 0x1a ^ local_130; if (((local_130 & 1) == 0) || ((game->_difficulty != 1 && (game->_difficulty != 3)))) { puVar18 = (undefined1 *)((int)&local_dc[-1]._replacedPlayer + 2) + (int)local_e8; } pEVar10 = PlayerManager::FirstTrinketOwner(&game->_playerManager,0x53); if (pEVar10 == (Entity_Player *)0x0) { local_e8 = (Entity_Player *)0x0; } else { local_e8 = (Entity_Player *)Entity_Player::GetTrinketMultiplier(pEVar10,0x53); } pEVar10 = local_e8; if (local_130 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = local_130 >> ((byte)local_108 & 0x1f) ^ local_130; uVar9 = uVar9 << ((byte)((ulonglong)local_108 >> 0x20) & 0x1f) ^ uVar9; local_d4 = (Entity_Player *)(uVar9 >> ((byte)local_f0 & 0x1f) ^ uVar9); if ((char)local_d4 != '\0') { if ((((uint)local_d4 & 0xff) != 1) || (puVar18 < (undefined1 *)0x2)) goto LAB_0073a000; local_e8 = (Entity_Player *)0x0; local_dc = (Entity_Player *)0x0; goto LAB_00739faa; } if ((int)local_e8 < 2) { puVar18 = (undefined1 *)0xb; LAB_0073a036: local_dc = (Entity_Player *)0x0; local_e8 = (Entity_Player *)0x0; if (g_game->_stage == 10) { local_e8 = (Entity_Player *)0x0; if ((g_game->_stageType == 0) && (local_e8 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xa1), local_e8 != (Entity_Player *)0x0)) { local_dc = (Entity_Player *)0x0; iVar21 = Entity_Player::GetTrinketMultiplier(local_e8,0xa1); if (1 < iVar21) goto LAB_0073a139; } local_dc = (Entity_Player *)0x0; if ((((g_game->_stage == 10) && (local_dc = (Entity_Player *)0x0, g_game->_stageType == 1) ) && (local_dc = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x9b), local_dc != (Entity_Player *)0x0)) && (iVar21 = Entity_Player::GetTrinketMultiplier(local_dc,0x9b), 1 < iVar21)) goto LAB_0073a139; } if (((g_game->_stage == 7) || (g_game->_stage == 8)) && ((pEVar10 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x6e), pEVar10 != (Entity_Player *)0x0 && (iVar21 = Entity_Player::GetTrinketMultiplier(pEVar10,0x6e), 1 < iVar21)))) { LAB_0073a139: if (puVar18 != (undefined1 *)0x4) { if (local_d4 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = (uint)local_d4 >> ((byte)local_108 & 0x1f) ^ (uint)local_d4; uVar9 = uVar9 << ((byte)((ulonglong)local_108 >> 0x20) & 0x1f) ^ uVar9; if (((uVar9 >> ((byte)local_f0 & 0x1f) ^ uVar9) & 3) != 0) { if (puVar18 == (undefined1 *)0xb) { puVar18 = (undefined1 *)0x0; } else if (puVar18 < (undefined1 *)0x4) { puVar18 = puVar18 + 1; } goto LAB_00739fb5; } } LAB_00739faa: puVar18 = (undefined1 *)0xa; } } else { LAB_0073a000: local_e8 = (Entity_Player *)0x0; local_dc = (Entity_Player *)0x0; if (puVar18 != (undefined1 *)0xa) { local_dc = (Entity_Player *)0x0; local_e8 = (Entity_Player *)0x0; if ((int)pEVar10 < 3) goto LAB_0073a036; goto LAB_0073a139; } } LAB_00739fb5: for (piVar19 = (g_game->_playerManager)._playerList._begin; piVar19 != (g_game->_playerManager)._playerList._end; piVar19 = piVar19 + 1) { iVar21 = *piVar19; if (((*(int *)(iVar21 + 0x2c) == 0) && (*(char *)(iVar21 + 0x20a9) == '\0')) && (*(int *)(iVar21 + 0x13c0) == 0x21)) { puVar18 = puVar18 + 100; break; } } uVar9 = genRng->_seed; local_130 = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(levelRef->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(levelRef->_generationRNG)._shift3 & 0x1f) ^ uVar9; in_stack_fffffe84 = 0; genRng->_seed = uVar9; pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,2,0xd,0,-1,1,10,&local_130,(uint)puVar18,-1); newRoom = LevelGenerator::GetNewEndRoom(levelGen,pRVar20->Shape,(uint *)&pRVar20->Doors); levelRef = local_d8; if (newRoom == (LevelGenerator_Room *)0x0) { ExceptionList = local_10; return 0; } local_d4 = (Entity_Player *)0x0; local_130 = local_d8->_nbRooms; in_stack_fffffe88 = 0x73a25b; place_room((Level *)local_d8,newRoom,pRVar20,genRng->_seed,&local_d4, (RoomDescriptor **)&local_d4); game = g_game; if (g_game->_stage == 10) { if (((g_game->_stageType != 0) || (local_e8 == (Entity_Player *)0x0)) || (iVar21 = Entity_Player::GetTrinketMultiplier(local_e8,0xa1), iVar21 < 3)) { game = g_game; if (((g_game->_stage != 10) || (g_game->_stageType != 1)) || (local_dc == (Entity_Player *)0x0)) goto LAB_0073a2c3; iVar21 = Entity_Player::GetTrinketMultiplier(local_dc,0x9b); if (iVar21 < 3) goto LAB_0073a2bd; } *(uint *)&local_d4->field_0x3c = *(uint *)&local_d4->field_0x3c | 4; goto LAB_0073a2bd; } } } else { if (levelRef->_stage < 9) { bVar6 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x6e); if (bVar6 == 0) { game = g_game; goto LAB_00739c2d; } LAB_00739c81: game = g_game; goto LAB_00739c87; } LAB_00739c2d: if (levelRef->_stage != 10) goto LAB_0073a2c3; if (levelRef->_stageType == 0) { bVar6 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0xa1); if (bVar6 != 0) goto LAB_00739c81; game = g_game; } if ((levelRef->_stage != 10) || (levelRef->_stageType != 1)) goto LAB_0073a2c3; bVar6 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x9b); if (bVar6 != 0) goto LAB_00739c81; LAB_0073a2bd: game = g_game; } LAB_0073a2c3: if (levelRef->_stage < 7) { LAB_0073a338: local_d4 = (Entity_Player *)&DAT_00000004; std::set::find_node(&local_108,&local_d4); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 5)) && (local_100 != (Entity_Player *)*(undefined4 **)&local_120->field_0x0)) goto LAB_0073a383; local_f0 = (RoomConfig_Room *)0x0; do { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; game = g_game; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if (uVar9 % 100 == 0) { LAB_0073a685: pvVar11 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar11 >> 2 < 0x71) || (iVar21 = *(int *)((int)pvVar11 + 0x1c0), iVar21 == 0)) || (local_c9 = '\x01', (*(uint *)(iVar21 + 0xb8) & 0x80000000) == 0)) { local_c9 = '\0'; } puVar16 = (game->_playerManager)._playerList._begin; if (puVar16 != (game->_playerManager)._playerList._end) { do { local_d4 = (Entity_Player *)*puVar16; if (local_d4->_variant == 0) { bVar6 = Entity_Player::HasTrinket(local_d4,0x70,0); if (bVar6 != 0) goto LAB_0073a737; if (((local_c9 != '\0') && (local_d4->_backupPlayer != (Entity_Player *)0x0)) && (bVar6 = Entity_Player::HasTrinket(local_d4->_backupPlayer,0x70,0), bVar6 != 0)) { local_d4 = local_d4->_backupPlayer; goto LAB_0073a737; } } puVar16 = puVar16 + 1; } while (puVar16 != (game->_playerManager)._playerList._end); } local_d4 = (Entity_Player *)0x0; LAB_0073a737: uVar9 = (uint)(local_d4 != (Entity_Player *)0x0) * 2 + 1; } else { iVar24 = PlayerManager::GetTrinketMultiplier(&game->_playerManager,0x52); iVar21 = 1; if (1 < iVar24) { iVar21 = iVar24; } uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; game = g_game; if (((int)(100 / (longlong)iVar21) == 0) || ((uint)((ulonglong)uVar9 % (100 / (longlong)iVar21 & 0xffffffffU)) < 0xf)) { pvVar11 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar11 >> 2 < 0x53) || ((iVar21 = *(int *)((int)pvVar11 + 0x148), iVar21 == 0 || (local_c9 = '\x01', (*(uint *)(iVar21 + 0xb8) & 0x80000000) == 0)))) { local_c9 = '\0'; } puVar16 = (g_game->_playerManager)._playerList._begin; if (puVar16 != (g_game->_playerManager)._playerList._end) { do { local_d4 = (Entity_Player *)*puVar16; if (local_d4->_variant == 0) { bVar6 = Entity_Player::HasTrinket(local_d4,0x52,0); if (bVar6 == 0) { if (((local_c9 == '\0') || (local_d4->_backupPlayer == (Entity_Player *)0x0)) || (bVar6 = Entity_Player::HasTrinket(local_d4->_backupPlayer,0x52,0), bVar6 == 0) ) goto LAB_0073a58a; local_d4 = local_d4->_backupPlayer; } if (local_d4 != (Entity_Player *)0x0) { game = g_game; goto LAB_0073a685; } break; } LAB_0073a58a: puVar16 = puVar16 + 1; } while (puVar16 != (game->_playerManager)._playerList._end); } } game = g_game; if ((g_game->_dailyChallenge)._specialDailyId == 0x13) goto LAB_0073a685; pvVar11 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar11 >> 2 < 0x71) || (iVar21 = *(int *)((int)pvVar11 + 0x1c0), iVar21 == 0)) || (local_c9 = '\x01', (*(uint *)(iVar21 + 0xb8) & 0x80000000) == 0)) { local_c9 = '\0'; } puVar16 = (g_game->_playerManager)._playerList._begin; if (puVar16 != (g_game->_playerManager)._playerList._end) { do { local_d4 = (Entity_Player *)*puVar16; if (local_d4->_variant == 0) { bVar6 = Entity_Player::HasTrinket(local_d4,0x70,0); if (bVar6 != 0) { uVar9 = -(uint)(local_d4 != (Entity_Player *)0x0) & 2; goto LAB_0073a745; } if (((local_c9 != '\0') && (local_d4->_backupPlayer != (Entity_Player *)0x0)) && (bVar6 = Entity_Player::HasTrinket(local_d4->_backupPlayer,0x70,0), bVar6 != 0)) { uVar9 = -(uint)(local_d4->_backupPlayer != (void *)0x0) & 2; goto LAB_0073a745; } } puVar16 = puVar16 + 1; } while (puVar16 != (game->_playerManager)._playerList._end); } uVar9 = 0; } LAB_0073a745: uVar25 = genRng->_seed; local_d4 = (Entity_Player *)0x0; if (uVar25 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar25 = genRng->_seed; if (uVar25 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar25 = uVar25 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar25; uVar25 = uVar25 << ((byte)genRng->_shift2 & 0x1f) ^ uVar25; uVar25 = uVar25 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar25; genRng->_seed = uVar25; pvVar11 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar25,1,stageId,0,4,0xd,in_stack_fffffe84,in_stack_fffffe88,1 ,10,(uint *)&local_d4,uVar9,genRng->_shift3); newRoom = LevelGenerator::GetNewEndRoom (levelGen,*(int *)((int)pvVar11 + 0x48),(uint *)((int)pvVar11 + 0x38)); if (newRoom == (LevelGenerator_Room *)0x0) { ExceptionList = local_10; return 0; } local_d4 = (Entity_Player *)0x0; in_stack_fffffe88 = 0x73a7ef; place_room((Level *)local_d8,newRoom,pvVar11,genRng->_seed,&local_d4, (RoomDescriptor **)&local_d4); pEVar10 = local_d4; if (((local_d4 != (Entity_Player *)0x0) && (g_game->_stage == 10)) && (((g_game->_stageType == 0 && ((pEVar17 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xa1), pEVar17 != (Entity_Player *)0x0 && (iVar21 = Entity_Player::GetTrinketMultiplier(pEVar17,0xa1), 2 < iVar21)))) || ((g_game->_stage == 10 && (((g_game->_stageType == 1 && (pEVar17 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x9b), pEVar17 != (Entity_Player *)0x0)) && (iVar21 = Entity_Player::GetTrinketMultiplier(pEVar17,0x9b), 2 < iVar21)))))))) { *(uint *)&pEVar10->field_0x3c = *(uint *)&pEVar10->field_0x3c | 4; } game = g_game; if (local_f0 == (RoomConfig_Room *)0x0) { local_e8 = (Entity_Player *)genRng->_seed; } uVar9 = g_game->_debugCurses; uVar25 = local_d8->_curses; uVar7 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); genRng = savedGenRng; } while (((~preventedCurses & (uVar7 | uVar9 | uVar25) & 2) != 0) && (local_f0 = (RoomConfig_Room *)((int)&local_f0->StageId + 1), local_f0 < (RoomConfig_Room *)0x2)); savedGenRng->_seed = (int)local_e8; savedGenRng->_shift1 = 5; savedGenRng->_shift2 = 9; savedGenRng->_shift3 = 7; levelRef = local_d8; LAB_0073a8ef: roomConfigRef = roomConfig; } else { if (levelRef->_stage < 9) { bVar6 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x6f); if (bVar6 == 0) { game = g_game; goto LAB_0073a2e6; } LAB_0073a332: game = g_game; goto LAB_0073a338; } LAB_0073a2e6: if (levelRef->_stage == 10) { if (levelRef->_stageType == 0) { bVar6 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0xa1); if (bVar6 != 0) goto LAB_0073a332; game = g_game; } if ((levelRef->_stage == 10) && (levelRef->_stageType == 1)) { bVar6 = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x9b); if (bVar6 != 0) goto LAB_0073a332; game = g_game; } } LAB_0073a383: challengeParams = Game::GetChallengeParams(game); if (challengeParams->_pathType != 2) goto LAB_0073a8ef; bVar6 = HasMirrorDimension((Level *)levelRef); if (bVar6 == 0) goto LAB_0073a8ef; local_d4 = (Entity_Player *)0x0; uVar9 = RNG::Next(genRng); roomConfigRef = roomConfig; pvVar11 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar9,1,stageId,0,4,0xd,in_stack_fffffe84,in_stack_fffffe88,1,10 ,(uint *)&local_d4,0,mode); newRoom = LevelGenerator::GetNewEndRoom (levelGen,*(int *)((int)pvVar11 + 0x48),(uint *)((int)pvVar11 + 0x38)); levelRef = local_d8; if (newRoom == (LevelGenerator_Room *)0x0) { ExceptionList = local_10; return 0; } place_room((Level *)local_d8,newRoom,pvVar11,genRng->_seed,unused_00,(RoomDescriptor **)0x0); } local_f0 = (RoomConfig_Room *)Game::GetPlanetariumChance(levelRef); uVar9 = genRng->_seed; local_d4 = (Entity_Player *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; iVar21 = -1; uVar25 = 0; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; local_e8 = (Entity_Player *) RoomConfig::GetRandomRoom (roomConfigRef,uVar9,1,0,0x18,0xd,0,-1,1,10,(uint *)&local_d4,0xffffffff,-1); local_dc = (Entity_Player *) LevelGenerator::GetNewEndRoom (levelGen,*(int *)(local_e8->_sprite)._filename._buf, (uint *)&local_e8->_spawnerVariant); pEVar10 = local_120; local_d4 = (Entity_Player *)0x18; std::set::find_node(&local_108,&local_d4); if ((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0x19)) { puVar16 = *(undefined4 **)&pEVar10->field_0x0; if (local_100 == (Entity_Player *)puVar16) goto LAB_0073aa0d; LAB_0073aa42: if (local_dc != (Entity_Player *)0x0) { LAB_0073ab1d: LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,&local_dc->field_0x4); } else { *(undefined4 *)LVar3 = *(undefined4 *)&local_dc->field_0x4; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } } else { puVar16 = *(undefined4 **)&pEVar10->field_0x0; LAB_0073aa0d: local_d4 = (Entity_Player *)&DAT_00000004; std::set::find_node(&local_108,&local_d4); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 5)) && (local_100 != (Entity_Player *)puVar16)) goto LAB_0073aa42; if (local_dc != (Entity_Player *)0x0) { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if (((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 < (float)local_f0) && (((g_manager->_persistentGameData)._achievements[0x196] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { iVar21 = 0x73ab15; place_room((Level *)local_d8,local_dc,local_e8,uVar9,(void *)genRng->_shift3, (RoomDescriptor **)0x0); goto LAB_0073ab45; } goto LAB_0073ab1d; } } LAB_0073ab45: if (local_d8->_stage < 0xb) { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if (uVar9 == (uVar9 / 0x32) * 0x32) { LAB_0073ac24: pEVar10 = local_120; local_d4 = (Entity_Player *)0x15; std::set::find_node(&local_108,&local_d4); if ((*(char *)((int)local_100 + 0xd) == '\0') && ((*(int *)((int)local_100 + 0x10) < 0x16 && (local_100 != (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)))) goto LAB_0073adeb; uVar9 = genRng->_seed; local_d4 = (Entity_Player *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; local_d4 = (Entity_Player *) RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,0x15,0xd,0,-1,1,10,(uint *)&local_d4,0xffffffff,-1) ; } else { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(local_d8->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(local_d8->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(local_d8->_generationRNG)._shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if ((uVar9 % 5 == 0) && (pEVar10 = Game::GetPlayer(g_game,0), 1 < pEVar10->_numKeys)) goto LAB_0073ac24; pEVar10 = local_120; LAB_0073adeb: uVar9 = genRng->_seed; local_d4 = (Entity_Player *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; local_d4 = (Entity_Player *) RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,0xd,0xd,0,-1,1,10,(uint *)&local_d4,0xffffffff,-1); } local_f0 = (RoomConfig_Room *) LevelGenerator::GetNewEndRoom (levelGen,*(int *)(local_d4->_sprite)._filename._buf, (uint *)&local_d4->_spawnerVariant); local_e8 = (Entity_Player *)&DAT_0000000d; std::set::find_node(&local_108,&local_e8); if ((*(char *)((int)local_100 + 0xd) != '\0') || (pEVar17 = local_100, 0xd < *(int *)((int)local_100 + 0x10))) { pEVar17 = ((std_set *)pEVar10)->_head; } if (pEVar17 == ((std_set *)pEVar10)->_head) { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; pvVar11 = (void *)(uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9); genRng->_seed = (int)pvVar11; pvVar15 = (void *)(((uint)pvVar11 / 7) * 7); if (pvVar11 == pvVar15) { game = g_game; } else { RNG::Next(genRng); game = g_game; pvVar11 = (void *)genRng->_seed; if (((uint)pvVar11 & 3) != 0) goto LAB_0073aec2; isFullHealth = PlayerManager::check_full_health(0); pvVar15 = extraout_ECX_02; if (isFullHealth == '\0') { pEVar10 = PlayerManager::FirstPlayerByType(&game->_playerManager,8); pvVar15 = extraout_ECX_03; if (pEVar10 == (Entity_Player *)0x0) { pEVar10 = PlayerManager::FirstPlayerByType(&game->_playerManager,0xb); pvVar15 = extraout_ECX_04; if (pEVar10 == (Entity_Player *)0x0) goto LAB_0073aec8; } } } if (local_f0 != (RoomConfig_Room *)0x0) { place_room((Level *)local_d8,local_f0,local_d4,(uint)pvVar11,pvVar15,(RoomDescriptor **)0x0) ; game = g_game; } LAB_0073ae8e: levelGenRef = levelGen; } else { LAB_0073aec2: game = g_game; LAB_0073aec8: levelGenRef = levelGen; if (local_f0 == (RoomConfig_Room *)0x0) goto LAB_0073ae8e; LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,&local_f0->Mode); game = g_game; } else { *(int *)LVar3 = local_f0->Mode; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } if (((g_manager->_persistentGameData)._achievements[0x97] == 0) && (((g_manager->_state != 2 || (game == (Game *)0x0)) || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { iVar21 = 0; } else { iVar21 = 1; } if (((g_manager->_persistentGameData)._achievements[0x98] != 0) || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { iVar21 = 2; } if (((g_manager->_persistentGameData)._achievements[0x99] != 0) || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { iVar21 = 3; } if (((g_manager->_persistentGameData)._achievements[0x9a] != 0) || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { iVar21 = 4; } uVar25 = RNG::RandomInt(genRng,iVar21 + 1); uVar9 = genRng->_seed; local_d4 = (Entity_Player *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; local_f0 = RoomConfig::GetRandomRoom (roomConfig,uVar9,0,0,0xc,0xd,0,-1,1,10,(uint *)&local_d4,uVar25,-1); newRoom = LevelGenerator::GetNewEndRoom(levelGenRef,local_f0->Shape,(uint *)&local_f0->Doors); pEVar10 = local_120; local_d4 = (Entity_Player *)0xc; std::set::find_node(&local_108,&local_d4); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0xd)) && (local_100 != (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) { LAB_0073b0c5: if (newRoom != (LevelGenerator_Room *)0x0) { LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,newRoom + 1); } else { *(LevelGenerator_Room *)LVar3 = newRoom[1]; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } } else { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; pvVar11 = (void *)(uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9); genRng->_seed = (int)pvVar11; pvVar15 = (void *)(((uint)pvVar11 / 0x14) * 0x14); if (pvVar11 != pvVar15) { RNG::Next(genRng); pvVar11 = (void *)genRng->_seed; if (((uint)pvVar11 & 3) == 0) { bVar6 = Game::GetGameStateFlag((Game *)&g_game->_gameStateFlags,8); pvVar15 = extraout_ECX_05; if (bVar6 != 0) goto LAB_0073b0f3; } goto LAB_0073b0c5; } LAB_0073b0f3: if (newRoom != (LevelGenerator_Room *)0x0) { place_room((Level *)local_d8,newRoom,local_f0,(uint)pvVar11,pvVar15,(RoomDescriptor **)0x0); } } uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } pEVar17 = (Entity_Player *)0x1; uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; local_118 = 0x70000000b; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; playerManager = &g_game->_playerManager; genRng->_seed = uVar9; pEVar10 = PlayerManager::FirstCollectibleOwner(playerManager,599,(RNG **)playerManager,1); local_c9 = pEVar10 != (Entity_Player *)0x0; if (pEVar10 != (Entity_Player *)0x0) { pEVar17 = (Entity_Player *)0x2; } local_d4 = pEVar17; do { bVar6 = (byte)local_118._4_4_; if (local_c9 == '\0') { LAB_0073b211: local_f0 = (RoomConfig_Room *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> ((byte)local_118 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar6 & 0x1f) ^ uVar9; uVar9 = uVar9 >> 0xc ^ uVar9; local_f0 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,10,0xd,0,-1,1,10,(uint *)&local_f0,0,-1); } else { local_f0 = (RoomConfig_Room *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> ((byte)local_118 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar6 & 0x1f) ^ uVar9; uVar9 = uVar9 >> 0xc ^ uVar9; local_f0 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,10,0xd,0,-1,1,10,(uint *)&local_f0,1,-1); if (local_f0 == (RoomConfig_Room *)0x0) goto LAB_0073b211; } pEVar10 = (Entity_Player *) LevelGenerator::GetNewEndRoom(levelGen,local_f0->Shape,(uint *)&local_f0->Doors); local_dc = (Entity_Player *)0xa; local_e8 = pEVar10; std::set::find_node(&local_108,&local_dc); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0xb)) && (local_100 != (Entity_Player *)*(undefined4 **)&local_120->field_0x0)) { if (pEVar10 != (Entity_Player *)0x0) { LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,&pEVar10->field_0x4); } else { *(int *)LVar3 = *(int *)&pEVar10->field_0x4; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } } else { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> ((byte)local_118 & 0x1f) ^ uVar9; bVar6 = (byte)((ulonglong)local_118 >> 0x20); uVar9 = uVar9 << (bVar6 & 0x1f) ^ uVar9; uVar9 = uVar9 >> 0xc ^ uVar9; if ((uVar9 & 1) != 0) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> ((byte)local_118 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar6 & 0x1f) ^ uVar9; uVar9 = uVar9 >> 0xc ^ uVar9; } if (pEVar10 != (Entity_Player *)0x0) { place_room((Level *)local_d8,pEVar10,local_f0,uVar9,(void *)0xc,(RoomDescriptor **)0x0); } } genRng = savedGenRng; local_d4 = (Entity_Player *)((int)&local_d4[-1]._replacedPlayer + 3); } while (local_d4 != (Entity_Player *)0x0); uVar9 = 0xffffffff; local_d0 = (RoomConfig_Room *)0xa; local_dc = (Entity_Player *)0x0; if (local_d8->_stage < 7) { local_d0 = (RoomConfig_Room *)0x1; } local_f8 = (Entity_Player *)g_game->_stageType; if ((local_f8 == (Entity_Player *)0x4) || (local_f8 == (Entity_Player *)0x5)) { local_d4 = (Entity_Player *)g_game->_stage; pEVar10 = (Entity_Player *)(&local_d4->field_0x0 + 1); } else { pEVar10 = (Entity_Player *)g_game->_stage; local_d4 = pEVar10; } if (2 < (int)pEVar10) { if (((g_manager->_persistentGameData)._achievements[4] == 0) && ((g_manager->_state != 2 || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { bVar23 = false; } else { bVar23 = true; } local_dc = (Entity_Player *)0x1e; if (!bVar23) { local_dc = (Entity_Player *)&DAT_00000050; } if (((g_manager->_persistentGameData)._achievements[0x21] != 0) || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_dc = (Entity_Player *)0xa; } pEVar10 = (Entity_Player *)(g_manager->_persistentGameData)._eventCounters[0x19]; if ((int)(&(pEVar10->_sprite)._filename + -3) + (g_manager->_persistentGameData)._eventCounters[0x18] != 0) { local_dc = (Entity_Player *)&DAT_00000005; } } if ((local_f8 == (Entity_Player *)0x4) || (local_f8 == (Entity_Player *)0x5)) { pEVar17 = (Entity_Player *)(&local_d4->field_0x0 + 1); } else { pEVar17 = local_d4; } if ((int)pEVar17 < 3) { LAB_0073b56e: if (local_dc == (Entity_Player *)0x0) { LAB_0073b58b: local_c9 = '\0'; } else { uVar25 = RNG::RandomInt(genRng,(uint)local_dc); local_c9 = '\x01'; pEVar10 = extraout_ECX_07; if (uVar25 != 0) goto LAB_0073b58b; } local_118 = 0; local_110 = (int *)0x0; local_8 = 2; FUN_00752a80(pEVar10); bVar6 = Game::GetGameStateFlag((Game *)&g_game->_gameStateFlags,9); piVar19 = local_118._4_4_; if (bVar6 == 0) { local_f8 = (Entity_Player *)0x2; if (local_c9 != '\0') { local_f8 = (Entity_Player *)0x9; } if (local_118._4_4_ == local_110) { std::vector::_Emplace_reallocate(local_118._4_4_,&local_f8); piVar19 = local_118._4_4_; } else { *local_118._4_4_ = (int)local_f8; piVar19 = local_118._4_4_ + 1; local_118 = CONCAT44(piVar19,(void *)local_118); } } bVar6 = Game::GetStateFlag(g_game,10); if (bVar6 == 0) { local_f8 = (Entity_Player *)0x3; if (local_c9 != '\0') { local_f8 = (Entity_Player *)0xa; } if (piVar19 == local_110) { std::vector::_Emplace_reallocate(piVar19,&local_f8); piVar19 = local_118._4_4_; } else { *piVar19 = (int)local_f8; local_118 = CONCAT44(piVar19 + 1,(void *)local_118); piVar19 = piVar19 + 1; } } bVar6 = Game::GetStateFlag(g_game,0xb); if (bVar6 == 0) { local_f8 = (Entity_Player *)0x1; if (local_c9 != '\0') { local_f8 = (Entity_Player *)0x8; } if (piVar19 == local_110) { std::vector::_Emplace_reallocate(piVar19,&local_f8); piVar19 = local_118._4_4_; } else { *piVar19 = (int)local_f8; local_118 = CONCAT44(piVar19 + 1,(void *)local_118); piVar19 = piVar19 + 1; } } bVar6 = Game::GetStateFlag(g_game,0xc); if (bVar6 == 0) { local_f8 = (Entity_Player *)0x0; if (local_c9 != '\0') { local_f8 = (Entity_Player *)0x7; } if (piVar19 == local_110) { std::vector::_Emplace_reallocate(piVar19,&local_f8); piVar19 = local_118._4_4_; } else { *piVar19 = (int)local_f8; local_118 = CONCAT44(piVar19 + 1,(void *)local_118); piVar19 = piVar19 + 1; } } bVar6 = Game::GetStateFlag(g_game,0xd); if (bVar6 == 0) { local_f8 = (Entity_Player *)0x5; if (local_c9 != '\0') { local_f8 = (Entity_Player *)0xc; } if (piVar19 == local_110) { std::vector::_Emplace_reallocate(piVar19,&local_f8); piVar19 = local_118._4_4_; } else { *piVar19 = (int)local_f8; local_118 = CONCAT44(piVar19 + 1,(void *)local_118); piVar19 = piVar19 + 1; } } bVar6 = Game::GetStateFlag(g_game,0xe); if (bVar6 == 0) { local_f8 = (Entity_Player *)0x6; if (local_c9 != '\0') { local_f8 = (Entity_Player *)0xd; } if (piVar19 == local_110) { std::vector::_Emplace_reallocate(piVar19,&local_f8); piVar19 = local_118._4_4_; } else { *piVar19 = (int)local_f8; local_118 = CONCAT44(piVar19 + 1,(void *)local_118); piVar19 = piVar19 + 1; } } uVar25 = (int)piVar19 - (int)(void *)local_118 >> 2; if (uVar25 != 0) { uVar9 = RNG::RandomInt(genRng,uVar25); uVar9 = *(uint *)((int)(void *)local_118 + uVar9 * 4); } local_8 = 0xffffffff; if ((void *)local_118 != (void *)0x0) { deallocate((void *)local_118,(int)local_110 - (int)(void *)local_118 >> 2); local_118 = 0; local_110 = (int *)0x0; } if (-1 < (int)uVar9) goto LAB_0073b843; } else { uVar25 = savedGenRng->_seed; if (uVar25 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar25 = genRng->_seed; if (uVar25 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar25 = uVar25 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar25; uVar25 = uVar25 << ((byte)genRng->_shift2 & 0x1f) ^ uVar25; pEVar17 = (Entity_Player *)(uVar25 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar25); genRng->_seed = (int)pEVar17; pEVar10 = (Entity_Player *)(((uint)pEVar17 / 10) * 10); if (pEVar17 != pEVar10) goto LAB_0073b56e; bVar6 = Game::GetGameStateFlag((Game *)&g_game->_gameStateFlags,0x20); pEVar10 = extraout_ECX_06; if (bVar6 != 0) goto LAB_0073b56e; if (pEVar17 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pEVar17 = (Entity_Player *)genRng->_seed; if (pEVar17 == (Entity_Player *)0x0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar25 = (uint)pEVar17 >> ((byte)(local_d8->_generationRNG)._shift1 & 0x1f) ^ (uint)pEVar17; uVar25 = uVar25 << ((byte)(local_d8->_generationRNG)._shift2 & 0x1f) ^ uVar25; uVar9 = 0xe; genRng->_seed = uVar25 >> ((byte)(local_d8->_generationRNG)._shift3 & 0x1f) ^ uVar25; LAB_0073b843: uVar25 = genRng->_seed; local_f8 = (Entity_Player *)0x0; if (uVar25 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar25 = genRng->_seed; if (uVar25 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } roomConfigRef = roomConfig; uVar25 = uVar25 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar25; uVar25 = uVar25 << ((byte)genRng->_shift2 & 0x1f) ^ uVar25; uVar25 = uVar25 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar25; genRng->_seed = uVar25; local_f0 = RoomConfig::GetRandomRoom (roomConfig,uVar25,1,0,6,0xd,0,-1,(int)local_d0,(int)local_d0, (uint *)&local_f8,uVar9,-1); if (local_f0 == (RoomConfig_Room *)0x0) { uVar25 = genRng->_seed; local_d0 = local_f0; if (uVar25 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar25 = genRng->_seed; if (uVar25 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar25 = uVar25 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar25; uVar25 = uVar25 << ((byte)genRng->_shift2 & 0x1f) ^ uVar25; uVar25 = uVar25 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar25; genRng->_seed = uVar25; local_f0 = RoomConfig::GetRandomRoom (roomConfigRef,uVar25,1,0,6,0xd,0,-1,1,10,(uint *)&local_d0,uVar9,-1); if (local_f0 == (RoomConfig_Room *)0x0) { local_e8 = (Entity_Player *)0x0; goto LAB_0073b94b; } } local_e8 = (Entity_Player *) LevelGenerator::GetNewEndRoom(levelGen,local_f0->Shape,(uint *)&local_f0->Doors); } LAB_0073b94b: pEVar10 = local_120; local_d0 = (RoomConfig_Room *)0x6; std::set::find_node(&local_108,&local_d0); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 7)) && (local_100 != (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) { LAB_0073ba56: levelGenRef = levelGen; if (local_e8 != (Entity_Player *)0x0) { LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,&local_e8->field_0x4); } else { *(int *)LVar3 = *(int *)&local_e8->field_0x4; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } } else { uVar25 = genRng->_seed; if (uVar25 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar25 = genRng->_seed; if (uVar25 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar25 = uVar25 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar25; uVar25 = uVar25 << ((byte)genRng->_shift2 & 0x1f) ^ uVar25; uVar25 = uVar25 >> ((byte)(Game *)genRng->_shift3 & 0x1f) ^ uVar25; genRng->_seed = uVar25; game = (Game *)genRng->_shift3; if ((uVar25 & 3) != 0) { if (uVar25 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar25 = genRng->_seed; if (uVar25 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar25 = uVar25 >> ((byte)(local_d8->_generationRNG)._shift1 & 0x1f) ^ uVar25; uVar25 = uVar25 << ((byte)(local_d8->_generationRNG)._shift2 & 0x1f) ^ uVar25; uVar25 = uVar25 >> ((byte)(local_d8->_generationRNG)._shift3 & 0x1f) ^ uVar25; genRng->_seed = uVar25; if (uVar25 == (uVar25 / 3) * 3) { if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar21 = g_game->_stage + 1; } else { iVar21 = g_game->_stage; } game = g_game; if (iVar21 == 1) goto LAB_0073ba97; } goto LAB_0073ba56; } LAB_0073ba97: if (local_e8 == (Entity_Player *)0x0) { levelGenRef = levelGen; } else { place_room((Level *)local_d8,local_e8,local_f0,uVar25,game,(RoomDescriptor **)0x0); game = g_game; local_134 = extraout_EDX_00 & 0xffffff00; if ((uVar9 == 2) || (uVar9 == 9)) { uVar8 = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x200; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar8; } if ((uVar9 == 3) || (uVar9 == 10)) { uVar8 = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags | 0x400; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar8; } if ((uVar9 == 1) || (uVar9 == 8)) { uVar8 = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags | 0x800; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar8; } if ((uVar9 == 0) || (uVar9 == 7)) { uVar8 = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags | 0x1000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar8; } if ((uVar9 == 5) || (uVar9 == 0xc)) { uVar8 = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags | 0x2000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar8; } if ((uVar9 == 6) || (uVar9 == 0xd)) { uVar8 = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags | 0x4000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar8; } levelGenRef = levelGen; if (uVar9 == 0xe) { qVar5 = game->_gameStateFlags; puVar1 = (uint *)((int)&game->_gameStateFlags + 4); *puVar1 = *puVar1 | 1; *(int *)&game->_gameStateFlags = (int)qVar5; } } } uVar9 = genRng->_seed; local_d0 = (RoomConfig_Room *)0x0; bVar6 = local_d8->_bossChallenge; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; local_f8 = (Entity_Player *) RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,0xb,0xd,0,-1,1,10,(uint *)&local_d0, (uint)(bVar6 != 0),-1); local_d4 = (Entity_Player *) LevelGenerator::GetNewEndRoom (levelGenRef,*(int *)(local_f8->_sprite)._filename._buf, (uint *)&local_f8->_spawnerVariant); pEVar10 = local_120; local_d0 = (RoomConfig_Room *)0xb; std::set::find_node(&local_108,&local_d0); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0xc)) && (local_100 != (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) { game = g_game; LAB_0073bc80: if (local_d4 != (Entity_Player *)0x0) { LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,&local_d4->field_0x4); LAB_0073bd74: game = g_game; } else { *(undefined4 *)LVar3 = *(undefined4 *)&local_d4->field_0x4; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } } else { uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } game = g_game; uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if ((uVar9 & 1) != 0) { if ((game->_stageType == 4) || (game->_stageType == 5)) { iVar21 = game->_stage + 1; } else { iVar21 = game->_stage; } if (iVar21 < 3) goto LAB_0073bc80; } isFullHealth = PlayerManager::check_full_health(0); if (isFullHealth == '\0') goto LAB_0073bc80; if ((game->_stageType == 4) || (game->_stageType == 5)) { iVar21 = game->_stage + 1; } else { iVar21 = game->_stage; } if (iVar21 < 2) goto LAB_0073bc80; if (local_d4 != (Entity_Player *)0x0) { place_room((Level *)local_d8,local_d4,local_f8,uVar9,unused_01,(RoomDescriptor **)0x0); goto LAB_0073bd74; } } pEVar10 = PlayerManager::FirstBirthrightOwner(&game->_playerManager,2); uVar9 = genRng->_seed; bVar23 = pEVar10 != (Entity_Player *)0x0; local_c9 = bVar23; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if (uVar9 == (uVar9 / 10) * 10) { LAB_0073be57: pEVar10 = local_120; local_d0 = (RoomConfig_Room *)0x14; std::set::find_node(&local_108,&local_d0); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0x15)) && (local_100 != (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) goto LAB_0073be9e; if (bVar23) goto LAB_0073beac; local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); uVar7 = 0xffffffff; iVar24 = 0x14; roomConfigRef = roomConfig; LAB_0073bfba: iVar21 = -1; uVar25 = 0; pRVar20 = RoomConfig::GetRandomRoom (roomConfigRef,uVar9,1,0,iVar24,0xd,0,-1,1,10,(uint *)&local_d0,uVar7,-1); } else { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)(local_d8->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(local_d8->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(local_d8->_generationRNG)._shift3 & 0x1f) ^ uVar9; savedGenRng->_seed = uVar9; if ((uVar9 % 3 == 0) && (pEVar10 = Game::GetPlayer(g_game,0), 1 < pEVar10->_numKeys)) { genRng = savedGenRng; goto LAB_0073be57; } LAB_0073be9e: genRng = savedGenRng; if (!bVar23) { roomConfigRef = roomConfig; LAB_0073bf5e: uVar9 = genRng->_seed; local_d0 = (RoomConfig_Room *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar7 = 0; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; iVar24 = 9; goto LAB_0073bfba; } LAB_0073beac: uVar9 = genRng->_seed; local_d0 = (RoomConfig_Room *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } roomConfigRef = roomConfig; uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; iVar21 = -1; uVar25 = 0; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,9,0xd,0,-1,1,10,(uint *)&local_d0,1,-1); if (pRVar20 == (RoomConfig_Room *)0x0) goto LAB_0073bf5e; } local_d4 = (Entity_Player *) LevelGenerator::GetNewEndRoom(levelGen,pRVar20->Shape,(uint *)&pRVar20->Doors); if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar24 = g_game->_stage + 1; } else { iVar24 = g_game->_stage; } std::set::find_node(&local_108,&pRVar20->Type); if (((*(char *)((int)local_100 + 0xd) != '\0') || (pRVar20->Type < *(int *)((int)local_100 + 0x10))) || (local_100 == (Entity_Player *)*(undefined4 **)&local_120->field_0x0)) { if (pRVar20->Type == 9) { pEVar10 = Game::GetPlayer(g_game,0); pvVar11 = extraout_ECX_08; if ((pEVar10->_numCoins < 5) && (local_c9 == '\0')) goto LAB_0073c05b; LAB_0073c07d: if (((((iVar24 == 2) || (iVar24 == 4)) || (iVar24 == 6)) || (iVar24 == 8)) || ((local_c9 != '\0' && (iVar24 < 0xb)))) { if (local_d4 != (Entity_Player *)0x0) { iVar21 = 0x73c0b6; place_room((Level *)local_d8,local_d4,pRVar20,genRng->_seed,pvVar11, (RoomDescriptor **)0x0); } goto LAB_0073c0f0; } } else { LAB_0073c05b: if (pRVar20->Type == 0x14) { pEVar10 = Game::GetPlayer(g_game,0); pvVar11 = extraout_ECX_09; if (1 < pEVar10->_numKeys) goto LAB_0073c07d; } } } if (local_d4 != (Entity_Player *)0x0) { LVar3 = levelGen[0xdd]; if (LVar3 == levelGen[0xde]) { std::vector::_Emplace_reallocate(LVar3,&local_d4->field_0x4); } else { *(int *)LVar3 = *(int *)&local_d4->field_0x4; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); } } } LAB_0073c0f0: pEVar10 = local_120; if (local_d8->_stage < 7) { local_d0 = (RoomConfig_Room *)0x12; std::set::find_node(&local_108,&local_d0); if ((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0x13)) { puVar16 = *(undefined4 **)&pEVar10->field_0x0; pEVar10 = local_100; } else { puVar16 = *(undefined4 **)&pEVar10->field_0x0; pEVar10 = (Entity_Player *)puVar16; } local_d0 = (RoomConfig_Room *)0x13; std::set::find_node(&local_108,&local_d0); if (((*(char *)((int)local_100 + 0xd) == '\0') && (*(int *)((int)local_100 + 0x10) < 0x14)) && (local_100 != (Entity_Player *)puVar16)) { LAB_0073c187: local_c9 = '\0'; } else { bVar6 = CanSpawnTrapDoor((Level *)g_game); local_c9 = '\x01'; if (bVar6 == 0) goto LAB_0073c187; } uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if ((((uVar9 & 1) == 0) || (local_c9 == '\0')) && (pEVar10 == (Entity_Player *)puVar16)) { local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); iVar24 = 0x12; } else { local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); iVar24 = 0x13; } iVar21 = -1; uVar25 = 0; local_f0 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,iVar24,0xd,0,-1,1,10,(uint *)&local_d0,0xffffffff,-1) ; local_d4 = (Entity_Player *) LevelGenerator::GetNewEndRoom(levelGen,local_f0->Shape,(uint *)&local_f0->Doors); uVar9 = 0; playerManager = &g_game->_playerManager; local_c9 = '\0'; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pEVar10 = PlayerManager::GetPlayer(playerManager,uVar9); if (pEVar10->_variant == 0) { iVar24 = Entity_Player::GetHealthType(pEVar10); if ((iVar24 == 1) || (iVar24 == 2)) { iVar24 = *(int *)(extraout_EDX_01 + 0x1340); } else { iVar24 = *(int *)(extraout_EDX_01 + 0x1340) + *(int *)(extraout_EDX_01 + 0x1d88) * 2; } if (((*(int *)(extraout_EDX_01 + 0x1344) < 2) && (*(int *)(extraout_EDX_01 + 0x134c) < 1)) || ((iVar24 < 1 && (*(int *)(extraout_EDX_01 + 0x134c) < 3)))) { local_c9 = '\x01'; break; } } uVar9 = uVar9 + 1; playerManager = &g_game->_playerManager; } while (uVar9 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } uVar9 = genRng->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if (uVar9 % 0x32 == 0) { LAB_0073c3ea: if (local_d4 != (Entity_Player *)0x0) { iVar21 = 0x73c40a; place_room((Level *)local_d8,local_d4,local_f0,uVar9,(void *)0x0,(RoomDescriptor **)0x0); } goto LAB_0073c410; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } levelGenRef = levelGen; uVar9 = uVar9 >> ((byte)(local_d8->_generationRNG)._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)(local_d8->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(local_d8->_generationRNG)._shift3 & 0x1f) ^ uVar9; genRng->_seed = uVar9; if ((uVar9 % 5 == 0) && (local_c9 != '\0')) goto LAB_0073c3ea; if (local_d4 == (Entity_Player *)0x0) { LAB_0073c3d3: } else { LVar3 = levelGen[0xdd]; if (LVar3 != levelGen[0xde]) { *(int *)LVar3 = *(int *)&local_d4->field_0x4; levelGen[0xdd] = (LevelGenerator)((int)levelGen[0xdd] + 4); goto LAB_0073c3d3; } std::vector::_Emplace_reallocate(LVar3,&local_d4->field_0x4); } } else { LAB_0073c410: levelGenRef = levelGen; } local_dc = (Entity_Player *)0x0; bVar6 = HasMirrorDimension((Level *)local_d8); if (bVar6 == 0) { bVar6 = HasAbandonedMineshaft((Level *)local_d8); if (bVar6 == 0) { bVar6 = HasPhotoDoor((Level *)local_d8); if ((bVar6 != 0) && (((g_manager->_persistentGameData)._achievements[0x27b] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { local_dc = (Entity_Player *)0x1; } } else { pEVar10 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x272,(RNG **)&g_game->_playerManager,1); if (pEVar10 != (Entity_Player *)0x0) { uVar9 = genRng->_seed; tmpRng._shift1 = 5; tmpRng._shift2 = 7; local_d0 = (RoomConfig_Room *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 >> 5 ^ uVar9; uVar9 = uVar9 << 7 ^ uVar9; uVar9 = uVar9 >> 0x16 ^ uVar9; pvVar11 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar9,1,stageId,0x1d,1,0xd,uVar25,iVar21,0,0, (uint *)&local_d0,10,0x16); newRoom = LevelGenerator::GetNewEndRoom (levelGen,*(int *)((int)pvVar11 + 0x48),(uint *)((int)pvVar11 + 0x38)); if (newRoom == (LevelGenerator_Room *)0x0) { ExceptionList = local_10; return 0; } iVar21 = 0x73c636; place_room((Level *)local_d8,newRoom,pvVar11,uVar9,unused_03,(RoomDescriptor **)0x0); local_dc = (Entity_Player *)0x2; } } } else { uVar9 = genRng->_seed; local_d0 = (RoomConfig_Room *)0x0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = genRng->_seed; if (uVar9 == 0) { pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } } uVar9 = uVar9 >> ((byte)genRng->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)genRng->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)genRng->_shift3 & 0x1f) ^ uVar9; uVar25 = 0; genRng->_seed = uVar9; pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,stageId,1,0xd,0,-1,0,0,(uint *)&local_d0,0x22,-1); newRoom = LevelGenerator::GetNewEndRoom(levelGenRef,pRVar20->Shape,(uint *)&pRVar20->Doors); if (newRoom == (LevelGenerator_Room *)0x0) { ExceptionList = local_10; return 0; } iVar21 = 0x73c4c7; place_room((Level *)local_d8,newRoom,pRVar20,genRng->_seed,unused_02,(RoomDescriptor **)0x0); local_dc = (Entity_Player *)0x1; } pEVar10 = local_120; game = g_game; local_d0 = (RoomConfig_Room *)0x7; std::set::find_node(&local_108,&local_d0); pEVar17 = local_fc; if (((*(char *)((int)local_100 + 0xd) != '\0') || (7 < *(int *)((int)local_100 + 0x10))) || (local_100 == (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) { local_f0 = (RoomConfig_Room *)0x1; pEVar10 = PlayerManager::FirstTrinketOwner(&game->_playerManager,0x66); if (pEVar10 == (Entity_Player *)0x0) { local_d4 = (Entity_Player *)0x0; iVar24 = 1; } else { local_d4 = (Entity_Player *)Entity_Player::GetTrinketMultiplier(pEVar10,0x66); iVar24 = 2; local_f0 = (RoomConfig_Room *)0x2; } pEVar12 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x24d,(RNG **)&g_game->_playerManager,1); pEVar10 = local_d4; if (pEVar12 != (Entity_Player *)0x0) { local_f0 = (RoomConfig_Room *)(iVar24 + 1); } uVar9 = 0; iVar24 = extraout_ECX_10; if (0 < (int)local_f0) { do { local_d0 = (RoomConfig_Room *)0x0; local_f8 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,(uint)pEVar17,1,stageId,0,7,0xd,uVar25,iVar21,1,10, (uint *)&local_d0,0xffffffff,iVar24); pvVar11 = (void *)Console::Print((Console *)local_d8,(int)&local_118 + 4); local_8 = 3; local_d0 = LevelGenerator::place_secret_room(levelGen,pvVar11); local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> ((void *)((int)&local_118 + 4),(void *)((int)&local_118 + 4), *(_Tree_node **)((int)local_118._4_4_ + 4)); operator_delete(local_118._4_4_,0x14); if (local_d0 != (RoomConfig_Room *)0x0) { local_d4 = (Entity_Player *)0x0; secretRoomIdx = local_d8->_nbRooms; iVar21 = 0x73c7b5; place_room((Level *)local_d8,local_d0,local_f8,(uint)pEVar17,local_d8, (RoomDescriptor **)&local_d4); if (local_d4 != (Entity_Player *)0x0) { if (pEVar10 == (Entity_Player *)0x2) { if (uVar9 == 0) goto LAB_0073c7d1; } else if ((2 < (int)pEVar10) && (uVar9 < 2)) { LAB_0073c7d1: *(uint *)&local_d4->field_0x3c = *(uint *)&local_d4->field_0x3c | 4; } } } tmpRng._shift1 = 1; tmpRng._shift2 = 5; local_d0 = (RoomConfig_Room *)0x10; if (pEVar17 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = uVar9 + 1; uVar7 = (uint)pEVar17 >> 1 ^ (uint)pEVar17; iVar24 = 0x10; uVar7 = uVar7 << 5 ^ uVar7; pEVar17 = (Entity_Player *)(uVar7 >> 0x10 ^ uVar7); } while ((int)uVar9 < (int)local_f0); genRng = savedGenRng; } } game = local_d8; if ((local_d8->_stage == 0xb) && (local_d8->_stageType == 0)) { uVar9 = RNG::Next(genRng); if (((g_manager->_persistentGameData)._achievements[0x186] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { pRVar20 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0,1,3,-1); } else { uVar25 = 3; local_d0 = (RoomConfig_Room *)0x0; pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,1,0xd,3,9,1,10,(uint *)&local_d0,0xffffffff,-1); } newRoom = LevelGenerator::GetNewEndRoom(levelGen,pRVar20->Shape,(uint *)&pRVar20->Doors); game = local_d8; if (newRoom == (LevelGenerator_Room *)0x0) { ExceptionList = local_10; return 0; } iVar21 = 0x73c902; place_room((Level *)local_d8,newRoom,pRVar20,uVar9,unused_04,(RoomDescriptor **)0x0); } pEVar10 = local_120; local_d0 = (RoomConfig_Room *)&DAT_0000001d; std::set::find_node(&local_108,&local_d0); if (((*(char *)((int)local_100 + 0xd) != '\0') || (0x1d < *(int *)((int)local_100 + 0x10))) || (local_100 == (Entity_Player *)*(undefined4 **)&pEVar10->field_0x0)) { tmpRng._shift1 = 0xd; tmpRng._shift2 = 3; if (local_fc == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); uVar8 = (*pcVar4)(); return uVar8; } uVar9 = (uint)local_fc >> 0xd ^ (uint)local_fc; local_d0 = (RoomConfig_Room *)0x0; uVar9 = uVar9 << 3 ^ uVar9; local_d4 = (Entity_Player *)(uVar9 >> 0x11 ^ uVar9); pEVar10 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,(uint)local_d4,1,stageId,0,0x1d,0xd,uVar25,iVar21,1,10, (uint *)&local_d0,0xffffffff,0x11); local_f8 = pEVar10; if (pEVar10 != (Entity_Player *)0x0) { local_8 = 4; FUN_005cbe20(); local_138 = (Entity_Player *)((uint)local_138 | 1); local_fc = (Entity_Player *)0x0; if (0 < game->_nbRooms) { ppvVar22 = &game->_roomList[0].Data; do { if (*ppvVar22 != (void *)0x0) { iVar24 = ((RoomDescriptor *)(ppvVar22 + -4))->GridIndex; if (-1 < iVar24) { local_f0 = (RoomConfig_Room *)(iVar24 / 0xd); local_f4 = iVar24 % 0xd; uVar7 = 0; uVar9 = 1; do { pvVar11 = *ppvVar22; if (((((*(uint *)((int)pvVar11 + (uVar7 >> 5) * 4 + 0x38) & uVar9) == 0) || (iVar24 = *(int *)((int)pvVar11 + 8), iVar24 == 5)) || ((iVar24 == 8 || ((iVar24 == 7 || (iVar24 == 10)))))) && ((LevelGenerator::get_door_target_position ((int *)&local_ec,&local_f4,*(int *)((int)pvVar11 + 0x48),uVar7,1), local_ec < 0xd && ((local_e8 < (Entity_Player *)&DAT_0000000d && (local_d0 = (RoomConfig_Room *)((int)local_e8 * 0xd + local_ec), -1 < (int)local_d0)))))) { std::set::insert(local_124,&local_d0); } uVar7 = uVar7 + 1; uVar9 = uVar9 << 1 | (uint)((int)uVar9 < 0); } while ((int)uVar7 < 8); game = local_d8; } } local_fc = (Entity_Player *)((int)&local_fc->field_0x0 + 1); ppvVar22 = ppvVar22 + 0x2e; } while ((int)local_fc < game->_nbRooms); pEVar10 = local_f8; genRng = savedGenRng; } pvVar11 = LevelGenerator::try_place_room(levelGen,(void *)((int)&local_118 + 4)); if (pvVar11 != (void *)0x0) { iVar21 = 0x73cb20; bVar6 = place_room((Level *)game,pvVar11,pEVar10,(uint)local_d4,unused_05, (RoomDescriptor **)0x0); if (bVar6 != 0) { game->_roomList[game->_nbRooms + -1].Group = 99; } } FID_conflict__Erase_tree_>_> ((void *)((int)&local_118 + 4),(void *)((int)&local_118 + 4), *(_Tree_node **)((int)local_118._4_4_ + 4)); operator_delete(local_118._4_4_,0x14); } } local_e8 = (Entity_Player *)0x0; local_108 = 0; local_120 = (Entity_Player *)0x0; local_100 = (Entity_Player *)0x0; local_8 = 5; LevelGenerator::get_all_rooms(levelGen,&allRoomsBegin); local_8 = CONCAT31(local_8._1_3_,6); uVar9 = (int)allRoomsEnd - (int)allRoomsBegin >> 2; pEVar10 = (Entity_Player *)0x0; if (uVar9 != 0) { if (0x1fffffff < uVar9) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector<8byte>::_Reallocate_exactly(uVar9); local_120 = local_100; local_e8 = local_108._4_4_; pEVar10 = local_108._4_4_; } piVar19 = allRoomsBegin; if (allRoomsBegin != allRoomsEnd) { do { local_fc = param_2; if ((1 < (int)param_2) && ((genRng->_seed & 7) == 0)) { local_fc = (Entity_Player *)0x1; } iVar21 = *piVar19; if ((*(uint *)(iVar21 + 8) < 0xd) && (*(uint *)(iVar21 + 0xc) < 0xd)) { iVar24 = *(uint *)(iVar21 + 0xc) * 0xd + *(uint *)(iVar21 + 8); } else { iVar24 = -1; } if ((iVar24 == local_d8->_startingRoomIdx) && (*(int *)(iVar21 + 0x40) == 0)) { if (local_d8->_stage == 0xb) { if (local_d8->_stageType == 1) { uVar9 = 0x11; uVar7 = 0; } else { if (local_d8->_stageType != 0) goto LAB_0073cc71; uVar9 = 0x10; uVar7 = 0; } } else { LAB_0073cc71: uVar9 = 0; uVar7 = 2; } uVar8 = 0xffffffff; pRVar20 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,uVar9,1,uVar7,-1); pvVar11 = extraout_ECX_11; } else { local_d0 = *(RoomConfig_Room **)(iVar21 + 0x18); iVar24 = local_d8->_stage; uVar9 = RNG::Next(savedGenRng); uVar8 = 0xffffffff; uVar7 = 0; uVar25 = (uint)(iVar24 == 0xb); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,stageId,1,(int)local_d0,uVar25,-1,(int)local_fc, local_13c,(uint *)(iVar21 + 0x1c),0,-1); pvVar11 = extraout_ECX_12; } game = local_d8; genRng = savedGenRng; if (pRVar20 == (RoomConfig_Room *)0x0) { std::bitset<8>::to_string(local_c8,uVar7,uVar8); local_8 = CONCAT31(local_8._1_3_,7); KAGE_LogMessage(1,(byte *) "[warn] LevelGenerator could not find a required room (type=ROOM_DEFAULT, shape=%d, difficulty=%d-%d, doors=%s.\n" ); std::string::_Tidy_deallocate(local_c8); FID_conflict__Tidy(&allRoomsBegin); if ((void *)local_108 == (void *)0x0) { ExceptionList = local_10; return 0; } iVar21 = (int)local_120 - (int)(void *)local_108; pvVar11 = (void *)local_108; goto LAB_0073cf01; } iVar21 = 0x73cd0c; place_room((Level *)local_d8,(void *)*piVar19,pRVar20,savedGenRng->_seed,pvVar11, (RoomDescriptor **)0x0); local_110 = (int *)*piVar19; piVar13 = &game->_roomList[game->_nbRooms + -1].GridIndex; local_118 = CONCAT44(piVar13,(void *)local_118); if (local_e8 == local_120) { std::vector<8byte>::_Emplace_reallocate(local_e8,(int)&local_118 + 4); local_120 = local_100; pEVar10 = local_108._4_4_; } else { *(int **)&local_e8->field_0x0 = piVar13; *(int **)&local_e8->field_0x4 = local_110; local_108 = CONCAT44(&local_e8->_damageEvents,(void *)local_108); pEVar10 = (Entity_Player *)&local_e8->_damageEvents; } piVar19 = piVar19 + 1; local_e8 = pEVar10; } while (piVar19 != allRoomsEnd); } local_d0 = (RoomConfig_Room *)(((int)levelGen[0xda] - (int)levelGen[0xd9]) / 0x48); iVar24 = (int)local_d0 - ((int)allRoomsEnd - (int)allRoomsBegin >> 2); if (0 < iVar24) { do { RNG::Next(genRng); iVar24 = iVar24 + -1; } while (iVar24 != 0); } if (local_dc != (Entity_Player *)0x0) { pvVar11 = (void *)local_108; tmpRng._seed = genRng->_seed; local_e8 = (Entity_Player *)((int)pEVar10 - (int)(void *)local_108 >> 3); tmpRng._shift3 = 0xc; puVar18 = (undefined1 *)((int)&local_e8[-1]._replacedPlayer + 3); tmpRng._shift1 = 5; tmpRng._shift2 = 0x15; local_d0 = (RoomConfig_Room *)puVar18; if (0 < (int)puVar18) { puVar16 = (undefined4 *)((int)(void *)local_108 + (int)puVar18 * 8); do { uVar9 = RNG::RandomInt(&tmpRng,(int)puVar18 + 1); puVar2 = (undefined4 *)((int)pvVar11 + uVar9 * 8); if (puVar16 != puVar2) { uVar8 = *puVar16; *puVar16 = *puVar2; *puVar2 = uVar8; uVar8 = puVar16[1]; puVar16[1] = puVar2[1]; puVar2[1] = uVar8; } puVar18 = puVar18 + -1; puVar16 = puVar16 + -2; } while (0 < (int)puVar18); pvVar11 = (void *)local_108; genRng = savedGenRng; } pEVar10 = local_e8; local_f0 = (RoomConfig_Room *)stageId; if (stageId == 0x1c) { local_f0 = (RoomConfig_Room *)0x1b; } else if (stageId == 0x1e) { local_f0 = (RoomConfig_Room *)&DAT_0000001d; } else if ((stageId == 8) || (stageId == 9)) { local_f0 = (RoomConfig_Room *)&DAT_00000007; } get_door_neighbor_indices((Level *)local_d8,(int)&local_118 + 4); local_8 = CONCAT31(local_8._1_3_,8); local_d4 = (Entity_Player *)0x0; pEVar17 = (Entity_Player *) ((int)(pEVar10->_sprite)._filename._buf + (int)&local_dc[-1].field_0x2684); local_f8 = pEVar17; if (pEVar17 != (Entity_Player *)0x0) { do { if ((int)local_dc < 1) goto LAB_0073d125; local_fc = (Entity_Player *)0x0; if (local_d4 < pEVar10) { local_fc = *(Entity_Player **)((int)pvVar11 + (int)local_d4 * 8); pEVar17 = *(Entity_Player **)((int)pvVar11 + (int)local_d4 * 8 + 4); local_e8 = pEVar17; if (*(int *)&local_fc->field_0x0 != local_d8->_startingRoomIdx) goto LAB_0073cfe0; } else { local_e8 = (Entity_Player *)LevelGenerator::try_add_dead_end(pEVar17,(int)&local_118 + 4); if (local_e8 == (Entity_Player *)0x0) goto LAB_0073d184; LAB_0073cfe0: local_138 = param_2; if ((1 < (int)param_2) && ((tmpRng._seed & 7U) == 0)) { local_138 = (Entity_Player *)0x1; } qVar5 = local_e8->_pendingDamageFlags; uVar9 = RNG::Next(&tmpRng); local_d0 = (RoomConfig_Room *)((int)&local_e8->_pendingDamageFlags + 4); pvVar11 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar9,1,stageId,(int)local_f0,1,(int)qVar5,uVar25,iVar21, (int)local_138,local_13c,(uint *)local_d0,1,(int)local_d0); if (pvVar11 == (void *)0x0) { qVar5 = local_e8->_pendingDamageFlags; uVar9 = RNG::Next(&tmpRng); pvVar11 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar9,1,stageId,(int)local_f0,1,(int)qVar5,uVar25,iVar21 ,1,10,(uint *)local_d0,1,mode_00); if (pvVar11 == (void *)0x0) { pEVar17 = extraout_ECX_13; pvVar11 = (void *)local_108; goto LAB_0073d108; } } local_dc = (Entity_Player *)((int)&local_dc[-1]._replacedPlayer + 3); if (local_fc == (Entity_Player *)0x0) { outDesc = (RoomDescriptor **)0x0; pEVar17 = local_fc; uVar9 = RNG::Next(&tmpRng); iVar21 = 0x73d0e8; place_room((Level *)local_d8,local_e8,pvVar11,uVar9,pEVar17,outDesc); pEVar17 = extraout_ECX_14; pvVar11 = (void *)local_108; } else { (local_fc->_damageEvents)._capacity = pvVar11; *(undefined4 *)&local_fc->_pendingDamageFlags = *(undefined4 *)((int)pvVar11 + 0x38); pEVar17 = local_fc; pvVar11 = (void *)local_108; } } LAB_0073d108: local_d4 = (Entity_Player *)((int)&local_d4->field_0x0 + 1); } while (local_d4 < local_f8); } if (0 < (int)local_dc) { LAB_0073d184: FID_conflict__Erase_tree_>_> ((void *)((int)&local_118 + 4),(void *)((int)&local_118 + 4), *(_Tree_node **)((int)local_118._4_4_ + 4)); operator_delete(local_118._4_4_,0x14); FID_conflict__Tidy(&allRoomsBegin); if (pvVar11 != (void *)0x0) { iVar21 = (int)local_120 - (int)pvVar11; LAB_0073cf01: deallocate(pvVar11,iVar21 >> 3); } ExceptionList = local_10; return 0; } LAB_0073d125: local_8 = CONCAT31(local_8._1_3_,6); FID_conflict__Erase_tree_>_> ((void *)((int)&local_118 + 4),(void *)((int)&local_118 + 4), *(_Tree_node **)((int)local_118._4_4_ + 4)); operator_delete(local_118._4_4_,0x14); } game = g_game; bVar6 = Game::GetStateFlag(g_game,0xf); if (bVar6 != 0) { bVar6 = Game::GetStateFlag(game,0x10); local_134 = local_134 & 0xff; if (bVar6 != 0) { local_134 = 0; } } uVar9 = local_134; local_dc = (Entity_Player *)0x3f800000; pEVar10 = Game::GetPlayer(game,0); game = g_game; if (0x13 < pEVar10->_numCoins) { local_dc = (Entity_Player *)0x3f866666; } bVar6 = Game::GetStateFlag(g_game,0x1e); if (bVar6 != 0) { FUN_004d72b0(0x1e,0); local_dc = (Entity_Player *)((float)local_dc + 0.1); } bVar6 = Game::GetStateFlag(game,0x1f); if (bVar6 != 0) { FUN_004d72b0(0x1f,0); local_dc = (Entity_Player *)((float)local_dc + 0.02); } iVar21 = game->_donationModGreed; game->_donationModGreed = 0; iVar24 = 5; if (iVar21 < 5) { iVar24 = iVar21; } local_dc = (Entity_Player *)(((float)local_dc - (float)iVar24 * 0.05) * 0.33333334); RNG::Next(genRng); game = local_d8; uVar25 = genRng->_seed; if (((((float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283062e-10 < (float)local_dc) && ((char)uVar9 != '\0')) && (-1 < secretRoomIdx)) && (4 < local_d8->_stage)) { tmpRng._shift1 = 2; tmpRng._shift2 = 7; tmpRng._shift3 = 9; tmpRng._seed = uVar25; uVar9 = RNG::RandomInt(&tmpRng,1000); uVar14 = (undefined1)local_134; if (uVar9 != 0) { uVar14 = 0; } local_134 = CONCAT31(local_134._1_3_,uVar14); piVar19 = &game->_roomList[secretRoomIdx].Flags; *piVar19 = *piVar19 | 0x10; } RNG::Next(genRng); uVar25 = local_130; uVar9 = genRng->_seed; if ((((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 < (float)local_dc) && ((char)local_134 != '\0')) && ((-1 < (int)local_130 && (3 < game->_stage)))) { tmpRng._shift1 = 2; tmpRng._shift2 = 7; tmpRng._shift3 = 9; tmpRng._seed = uVar9; RNG::RandomInt(&tmpRng,1000); piVar19 = &game->_roomList[uVar25].Flags; *piVar19 = *piVar19 | 0x10; } roomDesc = GetRoomByIdx((Level *)game,-2,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)&local_d0,0xffffffff,-1); roomDesc = GetRoomByIdx((Level *)game,-2,-1); roomDesc->Data = pRVar20; roomDesc = GetRoomByIdx((Level *)game,-6,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)&local_d0,0xffffffff,-1); roomDesc = GetRoomByIdx((Level *)game,-6,-1); roomDesc->Data = pRVar20; roomDesc = GetRoomByIdx((Level *)game,-4,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)&local_d0,0xffffffff,-1); roomDesc = GetRoomByIdx((Level *)game,-4,-1); roomDesc->Data = pRVar20; roomDesc = GetRoomByIdx((Level *)game,-5,-1); Seeds::Init3((Seeds *)roomDesc,genRng); pEVar10 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x226,(RNG **)&g_game->_playerManager,1); if (pEVar10 == (Entity_Player *)0x0) { local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,0x11,0xd,0,-1,1,10,(uint *)&local_d0,0xffffffff,-1); } else { RNG::Next(genRng); pRVar20 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0,0x11,0,-1); } roomDesc = GetRoomByIdx((Level *)game,-5,-1); roomDesc->Data = pRVar20; roomDesc = GetRoomByIdx((Level *)game,-7,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0,5,0xd,0,-1,1,10,(uint *)&local_d0,0x37,-1); roomDesc = GetRoomByIdx((Level *)game,-7,-1); roomDesc->Data = pRVar20; if (stageId == 0xd) { roomDesc = GetRoomByIdx((Level *)game,-9,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0xd,1,0xd,0,-1,0,0,(uint *)&local_d0,1,-1); iVar21 = -9; } else { roomDesc = GetRoomByIdx((Level *)game,-8,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,0xd,1,0xd,0,-1,0,0,(uint *)&local_d0,1,-1); iVar21 = -8; } roomDesc = GetRoomByIdx((Level *)game,iVar21,-1); manager = g_manager; roomDesc->Data = pRVar20; if (((manager->_persistentGameData)._achievements[0x98] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { uVar9 = 1; } else { uVar9 = 2; } if (((manager->_persistentGameData)._achievements[0x99] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { uVar25 = 1; } else { uVar25 = 2; } if (((manager->_persistentGameData)._achievements[0x9a] != 0) || (((manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { uVar9 = uVar9 + 1; } tmpRng._seed = RNG::Next(genRng); tmpRng._shift1 = 3; tmpRng._shift2 = 3; tmpRng._shift3 = 0x1a; uVar25 = RNG::RandomInt(&tmpRng,uVar25); uVar9 = RNG::RandomInt(&tmpRng,uVar9); roomDesc = GetRoomByIdx((Level *)local_d8,-0xd,-1); Seeds::Init3((Seeds *)roomDesc,&tmpRng); local_d0 = (RoomConfig_Room *)0x0; uVar7 = RNG::Next(&tmpRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar7,1,0,2,0xd,0,-1,1,10,(uint *)&local_d0,uVar25 + uVar9,-1); game = local_d8; roomDesc = GetRoomByIdx((Level *)local_d8,-0xd,-1); genRng = savedGenRng; roomDesc->Data = pRVar20; tmpRng._seed = RNG::Next(savedGenRng); tmpRng._shift1 = 3; tmpRng._shift2 = 3; tmpRng._shift3 = 0x1c; roomDesc = GetRoomByIdx((Level *)game,-0x12,-1); Seeds::Init3((Seeds *)roomDesc,&tmpRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(&tmpRng); pRVar20 = RoomConfig::GetRandomRoom(roomConfig,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)&local_d0,1,-1) ; roomDesc = GetRoomByIdx((Level *)game,-0x12,-1); roomDesc->Data = pRVar20; if ((game->_stageType != 4) && (game->_stageType != 5)) goto LAB_0073d925; if (game->_stage != 8) { if (game->_stage != 7) goto LAB_0073d925; uVar9 = g_game->_debugCurses; uVar25 = game->_curses; uVar7 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (uVar7 | uVar9 | uVar25) & 2) == 0) goto LAB_0073d925; game = local_d8; } RNG::Next(genRng); roomDesc = GetRoomByIdx((Level *)game,-10,-1); Seeds::Init3((Seeds *)roomDesc,genRng); local_d0 = (RoomConfig_Room *)0x0; uVar9 = RNG::Next(genRng); pRVar20 = RoomConfig::GetRandomRoom (roomConfig,uVar9,1,stageId,5,0xd,0,-1,1,10,(uint *)&local_d0,0x58,-1); roomDesc = GetRoomByIdx((Level *)game,-10,-1); roomDesc->Data = pRVar20; LAB_0073d925: FID_conflict__Tidy(&allRoomsBegin); if ((void *)local_108 != (void *)0x0) { deallocate((void *)local_108,(int)local_120 - (int)(void *)local_108 >> 3); } ExceptionList = local_10; return 1; } //@@ 0073d9b0 FUN_0073d9b0 uint FUN_0073d9b0(int param_1,uint param_2,char param_3,int param_4) { RoomDescriptor *pRVar1; Level *in_ECX; uint uVar2; pRVar1 = Level::GetRoomByIdx(in_ECX,param_1,param_4); if (param_1 < 0) { param_1 = 0; } else { param_1 = param_1 - pRVar1->GridIndex; } if ((((param_2 == 1) || (param_2 == 3)) && (0 < param_1 % 0xd)) || (((param_2 == 0 || (param_2 == 2)) && (0 < param_1 / 0xd)))) { param_2 = param_2 + 4; } if (param_3 != '\0') { uVar2 = 1 << ((byte)param_2 & 0x1f); if (((*(uint *)((int)pRVar1->Data + (param_2 >> 5) * 4 + 0x38) & uVar2) == 0) && ((*(uint *)((int)pRVar1->Data + (param_2 >> 5) * 4 + 0x3c) & uVar2) == 0)) { param_2 = 0xffffffff; } } return param_2; } //@@ 0073da40 Level::GetTargetSlot /* DB: log "Level::get_target_slot" */ uint Level::GetTargetSlot(int param_1,int param_2) { void *pvVar1; uint uVar2; RoomDescriptor *pRVar3; uint uVar4; Level *in_ECX; uint uVar5; uVar2 = FUN_0073d9b0(param_1,param_2,1,0xffffffff); if (uVar2 == 0xffffffff) { pRVar3 = GetRoomByIdx(in_ECX,param_1,-1); uVar2 = param_2 + 4; uVar5 = 0; pvVar1 = pRVar3->Data; do { uVar4 = 1 << ((byte)uVar2 & 0x1f); if (((*(uint *)((int)pvVar1 + (uVar2 >> 5) * 4 + 0x38) & uVar4) != 0) || ((*(uint *)((int)pvVar1 + (uVar2 >> 5) * 4 + 0x3c) & uVar4) != 0)) break; uVar2 = uVar2 + 1 & 0x80000007; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffff8) + 1; } uVar5 = uVar5 + 1; } while (uVar5 < 8); if ((-1 < param_1) && ((*(uint *)((int)pvVar1 + (uVar2 >> 5) * 4 + 0x38) & 1 << ((byte)uVar2 & 0x1f)) == 0)) { KAGE_LogMessage(0x10,(byte *) "Level::get_target_slot: Could not find a valid door slot for room idx %d\n" ); } } return uVar2; } //@@ 0073dae0 Level::update_room_doors /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX = Level; arg RoomDescriptor (+0x10 RoomConfig_Room: +0x46/+0x47 width/height, +0x48 shape, +0x38 door mask): computes the 8 neighbour grid indices (13x13 grid) per shape (shapes 9..0xc via FUN_00738620), drops doors not in the config mask, stores them at descriptor+0x1c; FUN_0073e040 runs it on every room and the 0x14 off-grid ones; also Level::GenerateHome prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Level::update_room_doors(Level *this,RoomDescriptor *roomDesc) { uint nextX; undefined4 uVar2; int *roomMap; RoomDescriptor *neighborBase; uint uVar3; uint uVar4; uint uVar5; RoomDescriptor *neighborRoom; int iVar6; int *doorIndexOut; uint *puStack_38; uint local_34; uint neighbors [11]; uint nextX; neighbors[9] = __security_cookie ^ (uint)(neighbors + 0xb); iVar6 = roomDesc->GridIndex; if (iVar6 < 0) { if (roomDesc->Data != (void *)0x0) { roomDesc->AllowedDoors = *(int *)((int)roomDesc->Data + 0x38); } return; } local_34 = iVar6 % 0xd; uVar5 = iVar6 / 0xd; uVar3 = (uint)*(byte *)((int)roomDesc->Data + 0x47); uVar4 = uVar3 / 7; uVar3 = (uVar3 - uVar4 >> 1) + uVar4 >> 2; if ((local_34 - 1 < 0xd) && (uVar5 < 0xd)) { neighbors[1] = (local_34 - 1) + uVar5 * 0xd; } else { neighbors[1] = -1; } if ((local_34 < 0xd) && (uVar5 - 1 < 0xd)) { neighbors[2] = uVar5 * 0xd + -0xd + local_34; } else { neighbors[2] = -1; } uVar4 = *(byte *)((int)roomDesc->Data + 0x46) / 0xd + local_34; if ((uVar4 < 0xd) && (uVar5 < 0xd)) { neighbors[3] = uVar4 + uVar5 * 0xd; } else { neighbors[3] = -1; } nextX = uVar3 + uVar5; if ((local_34 < 0xd) && (nextX < 0xd)) { neighbors[4] = nextX * 0xd + local_34; } else { neighbors[4] = -1; } nextX = uVar5 + 1; if ((local_34 - 1 < 0xd) && (nextX < 0xd)) { neighbors[5] = uVar5 * 0xd + 0xc + local_34; } else { neighbors[5] = -1; } nextX = local_34 + 1; if ((nextX < 0xd) && (uVar5 - 1 < 0xd)) { neighbors[6] = uVar5 * 0xd + -0xc + local_34; } else { neighbors[6] = -1; } if ((uVar4 < 0xd) && (uVar5 + 1 < 0xd)) { neighbors[7] = (uVar5 + 1) * 0xd + uVar4; } else { neighbors[7] = -1; } if ((nextX < 0xd) && (uVar3 = uVar3 + uVar5, uVar3 < 0xd)) { neighbors[8] = uVar3 * 0xd + nextX; } else { neighbors[8] = -1; } neighbors[0] = 0; switch(*(undefined4 *)((int)roomDesc->Data + 0x48)) { case 1: puStack_38 = neighbors; local_34 = 7; neighbors[0] = 0x80; uVar2 = FUN_00752640(&puStack_38); goto LAB_0073dcc1; case 2: case 7: local_34 = 3; neighbors[0] = 8; goto LAB_0073dcf7; case 3: case 5: local_34 = 2; neighbors[0] = 4; LAB_0073dcf7: puStack_38 = neighbors; uVar2 = FUN_00752640(&puStack_38); uVar2 = FUN_00752640(uVar2); uVar2 = FUN_00752640(uVar2); LAB_0073dcc1: uVar2 = FUN_00752640(uVar2); puStack_38 = neighbors; local_34 = 4; FUN_00752640(uVar2); break; case 4: puStack_38 = neighbors; local_34 = 7; neighbors[0] = 0x80; FUN_00752640(&puStack_38); break; case 6: puStack_38 = neighbors; local_34 = 6; neighbors[0] = 0x40; FUN_00752640(&puStack_38); break; case 9: neighbors[1] = FUN_00738620(local_34,uVar5,uVar5); neighbors[2] = neighbors[1]; break; case 10: neighbors[3] = FUN_00738620(nextX,uVar5,uVar5); neighbors[6] = neighbors[3]; break; case 0xb: neighbors[5] = FUN_00738620(local_34,nextX,uVar5); neighbors[4] = neighbors[5]; break; case 0xc: neighbors[7] = FUN_00738620(nextX,nextX,uVar5); neighbors[8] = neighbors[7]; } uVar5 = 0; uVar3 = 1; do { if (((neighbors[uVar5 >> 5] & 1 << ((byte)uVar5 & 0x1f)) != 0) && ((*(uint *)((int)roomDesc->Data + (uVar5 >> 5) * 4 + 0x38) & uVar3) == 0)) { neighbors[uVar5 + 1] = 0xffffffff; } uVar5 = uVar5 + 1; uVar3 = uVar3 << 1 | (uint)((int)uVar3 < 0); } while (uVar5 < 8); uVar5 = 0; doorIndexOut = roomDesc->_doors; do { uVar3 = neighbors[uVar5 + 1]; *doorIndexOut = uVar3; if (-1 < (int)uVar3) { uVar4 = uVar5 & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } uVar4 = uVar4 + 2 & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } local_34 = roomDesc->Dimension; if ((int)local_34 < 0) { roomMap = this->_currentRoomMap; } else { roomMap = this->_roomMap + local_34 * 0xa9; } nextX = 0xffffffff; if (roomMap[uVar3] < 0) { neighborRoom = (RoomDescriptor *)0x0; } else { neighborRoom = this->_roomList + roomMap[uVar3]; neighborBase = GetRoomByIdx(this,uVar3,local_34); iVar6 = uVar3 - neighborBase->GridIndex; if ((((uVar4 == 1) || (uVar4 == 3)) && (0 < iVar6 % 0xd)) || (((uVar4 == 0 || (uVar4 == 2)) && (0 < iVar6 / 0xd)))) { uVar4 = uVar4 + 4; } nextX = uVar4; if ((neighborRoom != (RoomDescriptor *)0x0) && (uVar4 != 0xffffffff)) { uVar3 = 1 << ((byte)uVar5 & 0x1f); if ((*(uint *)((int)roomDesc->Data + (uVar5 >> 5) * 4 + 0x38) & uVar3) != 0) { local_34 = 1 << ((byte)uVar4 & 0x1f); if ((*(uint *)((int)neighborRoom->Data + (uVar4 >> 5) * 4 + 0x38) & local_34) != 0) { if ((7 < uVar5) || (roomDesc->_doors[(uVar5 >> 5) - 1] = roomDesc->_doors[(uVar5 >> 5) - 1] | uVar3, 7 < uVar4)) goto LAB_0073e00a; neighborRoom->_doors[(uVar4 >> 5) - 1] = neighborRoom->_doors[(uVar4 >> 5) - 1] | local_34; goto LAB_0073dfd8; } } } } if (7 < uVar5) { LAB_0073e00a: /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } roomDesc->_doors[(uVar5 >> 5) - 1] = roomDesc->_doors[(uVar5 >> 5) - 1] & ~(1 << ((byte)uVar5 & 0x1f)); if ((neighborRoom != (RoomDescriptor *)0x0) && (nextX != 0xffffffff)) { if (7 < nextX) goto LAB_0073e00a; neighborRoom->_doors[(nextX >> 5) - 1] = neighborRoom->_doors[(nextX >> 5) - 1] & ~(1 << ((byte)nextX & 0x1f)); } } LAB_0073dfd8: doorIndexOut = doorIndexOut + 1; uVar5 = uVar5 + 1; if (7 < (int)uVar5) { return; } } while( true ); } //@@ 0073e040 FUN_0073e040 void FUN_0073e040(void) { Level *in_ECX; RoomDescriptor *pRVar1; int iVar2; iVar2 = 0; if (0 < in_ECX->_roomCount) { pRVar1 = in_ECX->_roomList; do { Level::update_room_doors(in_ECX,pRVar1); iVar2 = iVar2 + 1; pRVar1 = pRVar1 + 1; } while (iVar2 < in_ECX->_roomCount); } pRVar1 = in_ECX->_roomList + 0x1fb; iVar2 = 0x14; do { Level::update_room_doors(in_ECX,pRVar1); pRVar1 = pRVar1 + 1; iVar2 = iVar2 + -1; } while (iVar2 != 0); return; } //@@ 0073e0a0 Level::load_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "Level::load_room: could not choose a door..."; called from Level::ChangeRoom and RestoreGameState (was Level::generate_greed) prototype: db/protos.zhl */ void __thiscall Level::load_room(Level *pit) { HUD *hud; GridEntity_Door *pGVar1; code *pcVar2; undefined4 *puVar3; byte bVar4; RoomDescriptor *tmpDesc; int iVar5; RoomConfig_Room *pRVar6; Entity_Player *trinketOwner; void *pvVar7; RoomDescriptor *lastRoomDesc; int *piVar8; uint forcedCurses; uint preventedCurses; Game *pGVar9; Vector *dirResult; undefined4 *playerSlot; uint uVar10; uint uVar11; int extraout_ECX; int extraout_ECX_00; int iVar12; undefined4 roomShape; ChallengeParam *challengeParams; Game *pGVar13; short *spawnEntry; float fVar14; int effectIdx; undefined1 *playerCount; float effectScale; uint in_stack_fffffed0; int in_stack_fffffed4; Vector doorDir; undefined8 local_fc; undefined4 local_f4; undefined8 local_ec; undefined4 local_e4; undefined8 rngShift12; undefined4 local_d4; Vector spawnPos; float rowX; float perpY; float perpX; float baseY; float baseX; RoomConfig_Room *playersBegin; undefined4 *playersEnd; undefined4 *playersCapacityEnd; Entity *local_a8; Game *level; float local_a0; char isTrinketOverride; RoomConfig *local_98; RoomConfig *local_94; int *local_90; RoomDescriptor *local_8c; RoomConfig_Room *local_88; Game *local_84; undefined4 tintColor; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 local_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 local_60; undefined4 uStack_5c; undefined4 local_58; RNG trinketRng; int neighborOffsets [9]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; ColorMod *effectColor; GridEntity_Pit *pit; RoomConfig *roomData; void *trinketRngsBegin; puStack_20 = (undefined1 *)(neighborOffsets + 0x10); local_14 = 0xffffffff; puStack_18 = &LAB_00afda20; local_1c = ExceptionList; neighborOffsets[8] = __security_cookie ^ (uint)(neighborOffsets + 0xd); ExceptionList = &local_1c; level = (Game *)pit; tmpDesc = GetRoomByIdx(pit,pit->_currentRoomIndex,-1); local_8c = tmpDesc; bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x54); if ((bVar4 != 0) && (*(int *)((int)tmpDesc->Data + 8) != 0xe)) { tmpDesc->Flags = tmpDesc->Flags & 0xffffffef; } pGVar13 = g_game; if (((*(int *)&g_game->_roomTransition != 0) && (((uint)(g_game->_roomTransition)._flags >> 1 & 1) != 0)) && (*(int *)((int)tmpDesc->Data + 8) == 2)) { tmpDesc->Flags = tmpDesc->Flags & 0xffffffef; } if ((tmpDesc->VisitedCount == 0) && (((uint)tmpDesc->Flags >> 0xb & 1) != 0)) { local_84 = (Game *)PlayerManager::FirstTrinketOwner(&pGVar13->_playerManager,0x92); if (local_84 != (Game *)0x0) { iVar5 = Entity_Player::GetTrinketMultiplier((Entity_Player *)local_84,0x92); if (iVar5 == 2) { pvVar7 = ((std_vector *)((int)local_84 + 0x177c))->_end; if ((int)pvVar7 - (int)((std_vector *)((int)local_84 + 0x177c))->_begin >> 4 < 0x93) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar7 = ((std_vector *)((int)local_84 + 0x177c))->_end; } trinketRngsBegin = ((std_vector *)((int)local_84 + 0x177c))->_begin; uVar11 = ((int)pvVar7 - (int)trinketRngsBegin >> 4) - 1; if (0x92 < uVar11) { uVar11 = 0x92; } uVar11 = RNG::RandomInt((RNG *)(uVar11 * 0x10 + (int)trinketRngsBegin),4); } else { if (iVar5 < 3) goto LAB_0073e316; pvVar7 = ((std_vector *)((int)local_84 + 0x177c))->_end; if ((int)pvVar7 - (int)((std_vector *)((int)local_84 + 0x177c))->_begin >> 4 < 0x93) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar7 = ((std_vector *)((int)local_84 + 0x177c))->_end; } trinketRngsBegin = ((std_vector *)((int)local_84 + 0x177c))->_begin; uVar11 = ((int)pvVar7 - (int)trinketRngsBegin >> 4) - 1; if (0x92 < uVar11) { uVar11 = 0x92; } uVar11 = RNG::RandomInt((RNG *)(uVar11 * 0x10 + (int)trinketRngsBegin),3); } if (uVar11 == 0) { local_98 = &g_game->_roomConfig; local_94 = (RoomConfig *)0xa; do { if ((int)local_94 < 1) { tmpDesc = local_8c; goto LAB_0073e316; } uVar11 = (pit->_devilAngelRoomRNG)._seed; if (uVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar11 = (pit->_devilAngelRoomRNG)._seed; if (uVar11 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar11 = uVar11 >> ((byte)(pit->_devilAngelRoomRNG)._shift1 & 0x1f) ^ uVar11; uVar11 = uVar11 << ((byte)(pit->_devilAngelRoomRNG)._shift2 & 0x1f) ^ uVar11; uVar11 = uVar11 >> ((byte)(pit->_devilAngelRoomRNG)._shift3 & 0x1f) ^ uVar11; in_stack_fffffed4 = 99; in_stack_fffffed0 = 0; (pit->_devilAngelRoomRNG)._seed = uVar11; pRVar6 = RoomConfig::GetRandomRoom (local_98,uVar11,1,0,0xe,0xd,0,99,1,10,(uint *)&local_8c->AllowedDoors, 1,-1); local_94 = (RoomConfig *)((int)(local_94 + -1) + 0x1c5f); } while (pRVar6 == (RoomConfig_Room *)0x0); local_8c->Flags = local_8c->Flags | 0x800; local_8c->Data = pRVar6; tmpDesc = local_8c; } } LAB_0073e316: pGVar13 = g_game; } isTrinketOverride = '\0'; if ((*(int *)((int)tmpDesc->Data + 8) == 4) && (tmpDesc->VisitedCount == 0)) { if (pGVar13->_stage == 10) { if (pGVar13->_stageType != 0) { LAB_0073e370: if ((pGVar13->_stage == 10) && (pGVar13->_stageType == 1)) { trinketOwner = PlayerManager::FirstTrinketOwner(&pGVar13->_playerManager,0x9b); if ((trinketOwner != (Entity_Player *)0x0) && (iVar5 = Entity_Player::GetTrinketMultiplier(trinketOwner,0x9b), 1 < iVar5)) goto LAB_0073e3d1; pGVar13 = g_game; } goto LAB_0073e3a6; } trinketOwner = PlayerManager::FirstTrinketOwner(&pGVar13->_playerManager,0xa1); if ((trinketOwner == (Entity_Player *)0x0) || (iVar5 = Entity_Player::GetTrinketMultiplier(trinketOwner,0xa1), iVar5 < 2)) { pGVar13 = g_game; goto LAB_0073e370; } LAB_0073e3d1: isTrinketOverride = '\x01'; } else { LAB_0073e3a6: if ((pGVar13->_stage != 7) && (pGVar13->_stage != 8)) goto LAB_0073e3de; trinketOwner = PlayerManager::FirstTrinketOwner(&pGVar13->_playerManager,0x6f); if ((trinketOwner != (Entity_Player *)0x0) && (iVar5 = Entity_Player::GetTrinketMultiplier(trinketOwner,0x6f), 1 < iVar5)) goto LAB_0073e3d1; } pGVar13 = g_game; } LAB_0073e3de: trinketOwner = PlayerManager::FirstCollectibleOwner (&pGVar13->_playerManager,0x19e,(RNG **)&pGVar13->_playerManager,1); if ((trinketOwner == (Entity_Player *)0x0) && (isTrinketOverride == '\0')) { bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xbb); if (bVar4 != 0) { if ((pit->_stageType != 4) && (pit->_stageType != 5)) { trinketRng._seed = tmpDesc->SpawnSeed; trinketRng._shift1 = 9; trinketRng._shift2 = 5; trinketRng._shift3 = 0x19; iVar5 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0xbb); uVar11 = RNG::RandomInt(&trinketRng,2); tmpDesc = local_8c; if ((int)uVar11 < iVar5) goto LAB_0073e556; } } local_84 = g_game; if (*(int *)&g_game->_roomTransition != 0) { if (((g_game->_roomTransition)._flags & 1) != 0) goto LAB_0073e556; } } else { LAB_0073e556: roomData = tmpDesc->Data; local_94 = roomData; local_84 = g_game; if ((*(int *)&roomData->field_0x8 == 4) && (tmpDesc->VisitedCount == 0)) { local_98 = (RoomConfig *)tmpDesc->SpawnSeed; local_ec = 0x500000001; local_90 = (int *)0x10; local_e4 = 0x10; if (local_98 == (RoomConfig *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar11 = (uint)local_98 >> 1 ^ (uint)local_98; uVar11 = uVar11 << 5 ^ uVar11; local_90 = (int *)(uVar11 >> 0x10 ^ uVar11); if (*(int *)&roomData->field_0x10 == 0) { iVar5 = *(int *)&roomData->field_0x48; uVar11 = Game::GetStageID(level,(byte)roomData); uVar10 = 1; iVar12 = extraout_ECX; } else { if (*(int *)&roomData->field_0x10 != 2) goto LAB_0073e495; iVar5 = *(int *)&roomData->field_0x48; uVar11 = Game::GetStageID(level,(byte)roomData); uVar10 = 3; iVar12 = extraout_ECX_00; } pvVar7 = RoomConfig::GetRandomRoomWithFallbackStage (&local_84->_roomConfig,(uint)local_90,1,uVar11,0,4,iVar5,in_stack_fffffed0 ,in_stack_fffffed4,1,10,(uint *)&roomData->field_0x38,uVar10,iVar12); local_84 = g_game; pit = (Level *)level; if (pvVar7 == (void *)0x0) { } else { local_8c->Data = pvVar7; } } } LAB_0073e495: tmpDesc = local_8c; if (((uint)local_8c->Flags >> 4 & 1) == 0) { local_88 = local_8c->Data; } else { local_88 = local_8c->OverrideData; if (((local_88 == (RoomConfig_Room *)0x0) || (local_88->StageId != 0)) || (local_88->Type != 6)) { local_98 = (RoomConfig *)local_8c->SpawnSeed; local_fc = 0x500000001; local_94 = (RoomConfig *)0x10; local_f4 = 0x10; if (local_98 == (RoomConfig *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar11 = (uint)local_98 >> 1 ^ (uint)local_98; uVar11 = uVar11 << 5 ^ uVar11; pvVar7 = local_8c->Data; local_90 = (int *)(uVar11 >> 0x10 ^ uVar11); if (*(int *)((int)pvVar7 + 8) == 0xe) { uVar11 = 0xf; } else { local_98 = (RoomConfig *)&DAT_0000000b; uVar11 = 4; if ((local_84->_gameStateFlags & 0x8000) != 0) { uVar11 = 0xb; } if (local_8c->GreedSubType == 0) { local_8c->GreedSubType = uVar11; } else { uVar11 = local_8c->GreedSubType; } if (uVar11 == 4) { *(uint *)&local_84->_gameStateFlags = (uint)local_84->_gameStateFlags | 0x8000; LAB_0073e6d7: *(undefined4 *)((int)&local_84->_gameStateFlags + 4) = *(undefined4 *)((int)&local_84->_gameStateFlags + 4); } else if (uVar11 == 0xb) { *(uint *)&local_84->_gameStateFlags = (uint)local_84->_gameStateFlags | 0x10000; goto LAB_0073e6d7; } pvVar7 = local_8c->Data; } local_94 = &local_84->_roomConfig; local_88 = RoomConfig::GetRandomRoom (local_94,(uint)local_90,1,0,6,*(int *)((int)pvVar7 + 0x48),0,-1,1,1, (uint *)((int)pvVar7 + 0x38),uVar11,0); if (local_88 == (RoomConfig_Room *)0x0) { local_88 = tmpDesc->Data; tmpDesc->Flags = tmpDesc->Flags & 0xffffffef; } tmpDesc->OverrideData = local_88; } } lastRoomDesc = GetRoomByIdx(pit,((Game *)pit)->_lastRoomIdx, ((Game *)pit)->_lastRoomDimensionIdx); iVar5 = *(int *)((int)lastRoomDesc->Data + 8); local_94 = *(RoomConfig **)((int)tmpDesc->Data + 8); if ((((0x1fa < tmpDesc->ListIndex) && (tmpDesc->GridIndex != -0x10)) && ((tmpDesc->AllowedDoors = 0, local_94 != (RoomConfig *)0x3 && ((local_94 != (RoomConfig *)0x10 && (iVar12 = ((Game *)pit)->_currentRoomIdx, iVar12 != -7)) )))) && ((iVar12 != -0xc && ((iVar12 != -0xd && ((local_94 != (RoomConfig *)0x16 || (iVar5 == 0x10)))))))) { pGVar13 = (Game *)((Game *)pit)->_enterDoor; local_84 = pGVar13; if ((int)pGVar13 < 0) { LAB_0073e7e8: uVar11 = Random(); local_a0 = (float)(uVar11 & 7); local_98 = (RoomConfig *)((int)tmpDesc->Data + 0x38); local_90 = (int *)0x0; do { local_84 = (Game *)((uint)((int)local_90 + (int)local_a0) & 0x80000007); if ((int)local_84 < 0) { local_84 = (Game *)(((uint)&local_84[-1]._console.field_0x3 | 0xfffffff8) + 1); } if ((*(uint *)(&local_98->field_0x0 + ((uint)local_84 >> 5) * 4) & 1 << ((byte)local_84 & 0x1f)) != 0) { ((Game *)pit)->_enterDoor = (int)local_84; pGVar13 = local_84; goto LAB_0073e863; } local_90 = (int *)((int)local_90 + 1); } while ((int)local_90 < 8); pGVar13 = (Game *)((Game *)pit)->_enterDoor; } else if ((*(uint *)((int)tmpDesc->Data + ((uint)pGVar13 >> 5) * 4 + 0x38) & 1 << ((byte)pGVar13 & 0x1f)) == 0) { ((Game *)pit)->_enterDoor = -1; goto LAB_0073e7e8; } LAB_0073e863: if ((int)pGVar13 < 0) { KAGE_LogMessage(0x10,(byte *) "Level::load_room: could not choose a door from where to enter off grid room" ); pGVar13 = (Game *)((Game *)pit)->_enterDoor; } if ((Game *)&DAT_00000007 < pGVar13) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } tmpDesc->_doors[((uint)pGVar13 >> 5) - 1] = tmpDesc->_doors[((uint)pGVar13 >> 5) - 1] | 1 << ((byte)pGVar13 & 0x1f); } Room::Init(local_88,tmpDesc); pvVar7 = ((Game *)pit)->_room; if (*(int *)((int)pvVar7 + 8) == 0x1d) { uVar11 = 0; do { if (*(int *)((int)pvVar7 + uVar11 * 4 + 0x724) != 0) goto LAB_0073ea3c; uVar11 = uVar11 + 1; } while (uVar11 < 8); local_90 = *(int **)(*(int *)((int)pvVar7 + 4) + 4); if (-1 < (int)local_90) { local_84 = (Game *)0x0; do { iVar5 = GetNeighborRoomIdx(pit,(int)local_90,(int)local_84); if (-1 < iVar5) { neighborOffsets[0] = -1; neighborOffsets[1] = 0; neighborOffsets[2] = 0; neighborOffsets[3] = 0xffffffff; neighborOffsets[4] = 1; neighborOffsets[5] = 0; neighborOffsets[6] = 0; neighborOffsets[7] = 1; pRVar6 = (RoomConfig_Room *)(iVar5 / 0xd); local_a0 = (float)(iVar5 % 0xd); uVar11 = 0; local_88 = pRVar6; do { iVar5 = (int)&pRVar6->StageId + neighborOffsets[uVar11 * 2 + 1]; iVar12 = neighborOffsets[uVar11 * 2] + (int)local_a0; if ((((-1 < iVar12) && (-1 < iVar5)) && (iVar12 < 0xd)) && (iVar5 < 0xd)) { piVar8 = (int *)(iVar5 * 0xd + iVar12); if (piVar8 != local_90) { tmpDesc = GetRoomByIdx(pit,(int)piVar8,-1); pGVar13 = local_84; if (((tmpDesc->Data != (void *)0x0) && (tmpDesc->Group == -1)) && (*(int *)((int)tmpDesc->Data + 8) != 10)) { bVar4 = MakeRedRoomDoor(pit,(int)local_90,(int)local_84); if (bVar4 != 0) { if ((((undefined1 *)((int)&pGVar13->_stage + 1) < &DAT_00000009) && (pGVar1 = *(GridEntity_Door **) ((int)((Game *)pit)->_room + (int)pGVar13 * 4 + 0x724), pGVar1 != (GridEntity_Door *)0x0)) && ((GridEntity_Door::TryBlowOpen(pGVar1,0,(Entity *)0x0), (local_8c->Flags & 1) == 0 && ((pGVar1->_desc)._state != 1)))) { (pGVar1->_desc)._state = 1; GridEntity_Door::UpdateAnimation(pGVar1); iVar5 = pGVar1->_currentRoomType; if (((((iVar5 == 7) || (iVar12 = pGVar1->_targetRoomType, iVar12 == 7)) || (iVar5 == 8)) || ((iVar12 == 8 || (iVar5 == 0x1d)))) || (iVar12 == 0x1d)) { std::string::assign((pGVar1->_openAnimation)._buf,s_Open,4); } } goto LAB_0073ea3c; } break; } pRVar6 = local_88; } } uVar11 = uVar11 + 1; } while (uVar11 < 4); } local_84 = (Game *)((int)&local_84->_stage + 1); } while (local_84 <= (Game *)&DAT_00000007); } } LAB_0073ea3c: if ((((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || ((iVar5 = ((Game *)pit)->_stage, iVar5 - 1U < 6 && ((g_game->_gameStateFlags & 0x1000000000000) != 0)))) || ((((Game *)pit)->_stageType != 4 && (((Game *)pit)->_stageType != 5)))) { LAB_0073ebbd: tmpDesc = local_8c; } else { if (iVar5 != 4) { if (iVar5 == 3) { uVar11 = g_game->_debugCurses; uVar10 = ((Game *)pit)->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (forcedCurses | uVar11 | uVar10) & 2) != 0) { pit = (Level *)level; goto LAB_0073eac8; } } goto LAB_0073ebbd; } LAB_0073eac8: pvVar7 = local_8c->Data; tmpDesc = local_8c; if ((((*(int *)((int)pvVar7 + 8) == 1) && (*(int *)((int)pvVar7 + 0x10) == 10)) && (((uint)local_8c->Flags >> 2 & 1) != 0)) && (local_88 = (RoomConfig_Room *)0x0, *(short *)((int)pvVar7 + 0x44) != 0)) { local_90 = (int *)0x0; do { spawnEntry = (short *)(*(int *)((int)pvVar7 + 0x40) + (int)local_90); if (((char)spawnEntry[4] != '\0') && (**(int **)(spawnEntry + 2) == 0xbba)) { local_a0 = (float)((*(byte *)((int)pvVar7 + 0x46) + 2) * (spawnEntry[1] + 1) + (int)*spawnEntry); if ((((int)local_a0 + 1U < 0x1c0) && ((pit = *(GridEntity_Pit **)((int)((Game *)pit)->_room + (int)local_a0 * 4 + 0x28), pit != (GridEntity_Pit *)0x0 && ((pit->_desc)._type == 7)))) && (pit->_collisionClass == 1)) { if ((pit->_desc)._state == 0) { (pit->_desc)._state = 2; GridEntity_Pit::UpdateCollision(pit); tmpDesc = local_8c; } (pit->_desc)._variant = (pit->_desc)._variant & 0xffff01ffU | 0x100; *(undefined1 *)((int)g_game->_room + (int)local_a0 + 0x746dU) = 1; } } pvVar7 = tmpDesc->Data; local_90 = local_90 + 4; local_88 = (RoomConfig_Room *)((int)&local_88->StageId + 1); } while (local_88 < (RoomConfig_Room *)(uint)*(ushort *)((int)pvVar7 + 0x44)); } } pGVar13 = level; iVar5 = level->_currentRoomIdx; fVar14 = (float)((int)level->_room + 0x724); local_84 = (Game *)fVar14; if ((((((iVar5 == -1) || (iVar5 == -6)) || (iVar5 == -3)) || ((iVar5 == -5 || (iVar5 == -8)))) || ((iVar5 == -9 || ((iVar5 == -10 || (iVar5 == -0x11)))))) || (iVar5 == -0x12)) { iVar5 = level->_enterDoor; if ((-1 < iVar5) && (iVar12 = *(int *)((int)fVar14 + iVar5 * 4), iVar12 != 0)) { *(int *)(iVar12 + 0x158) = iVar5; GridEntity_Door::SetRoomTypes (*(GridEntity_Door **)((int)fVar14 + level->_enterDoor * 4),(int)local_94,1); *(int *)(*(int *)((int)fVar14 + pGVar13->_enterDoor * 4) + 0x394) = pGVar13->_lastRoomIdx; } } else { local_90 = tmpDesc->_doors; local_88 = (RoomConfig_Room *)0x0; do { pGVar1 = *(GridEntity_Door **)((int)local_84 + (int)local_88 * 4); local_a0 = (float)*local_90; if (pGVar1 != (GridEntity_Door *)0x0) { if (local_a0 == -NAN) { pGVar1->_slot = (int)local_88; pGVar1->_targetRoomIdx = -2; iVar5 = 1; } else { if (((int)local_a0 < 0) || (*(int *)((int)pGVar13->_currentRoomMap + (int)local_a0 * 4) < 0)) goto LAB_0073ecaa; tmpDesc = GetRoomByIdx((Level *)pGVar13,(int)local_a0,-1); iVar5 = *(int *)((int)tmpDesc->Data + 8); pGVar1->_slot = (int)local_88; pGVar1->_targetRoomIdx = (int)local_a0; } GridEntity_Door::SetRoomTypes(pGVar1,(int)local_94,iVar5); } LAB_0073ecaa: local_88 = (RoomConfig_Room *)((int)&local_88->StageId + 1); local_90 = local_90 + 1; } while ((int)local_88 < 8); } tmpDesc = GetRoomByIdx((Level *)pGVar13,pGVar13->_currentRoomIdx,-1); if ((tmpDesc->Flags & 1) != 0) { if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { Room::TrySpawnSecretExit(pGVar13->_room,0,0); Room::TrySpawnDevilRoomDoor(pGVar13->_room,0,0); Room::TrySpawnBossRushDoor(pGVar13->_room,0,0); Room::TrySpawnTheVoidDoor(0); } Room::TrySpawnBlueWombDoor(0,0,0); } iVar5 = 0; pGVar9 = local_84; do { if (*(int *)((int)pGVar9 + iVar5 * 4) == 0) { iVar12 = *(int *)((int)pGVar13->_room + 4); if ((iVar12 == 0) || (iVar12 = *(int *)(iVar12 + 0x10), iVar12 == 0)) { roomShape = 1; } else { roomShape = *(undefined4 *)(iVar12 + 0x48); } iVar12 = room_shape_get_door_grid_index(*(undefined4 *)((int)pGVar13->_room + 0x10),roomShape) ; if ((((-1 < iVar12) && (iVar12 < 0x1c0)) && (iVar12 = *(int *)((int)pGVar13->_room + iVar12 * 4 + 0x24), iVar12 != 0)) && ((*(int *)(iVar12 + 4) == 0x10 && (*(int *)(iVar12 + 0x164) == -1)))) { *(int *)((int)local_84 + iVar5 * 4) = iVar12; Room::RemoveDoor(pGVar13->_room,iVar5); } pGVar9 = local_84; } iVar5 = iVar5 + 1; } while (iVar5 < 8); Room::TrySpawnSecretShop(0); if (g_game->_challenge == 0x2c) { uVar11 = GetRoomStageType((Level *)pGVar13,pGVar13->_currentRoomIdx); LAB_0073ee35: uVar11 = RoomConfig::GetStageID(pGVar13->_stage,uVar11,-1); if ((uVar11 == 0x21) && (*(int *)((int)pGVar13->_room + 0x1d18) != 0x2c)) { local_90 = (int *)0x0; local_88 = (RoomConfig_Room *)0x724; do { local_90 = (int *)((int)local_90 + 1); if (((local_90 < &DAT_00000009) && (iVar5 = *(int *)((int)local_88 + (int)pGVar13->_room), iVar5 != 0)) && ((iVar12 = *(int *)(iVar5 + 0x160), iVar12 == 1 || (((iVar12 == 4 || (iVar12 == 6)) || (iVar12 == 5)))))) { tmpDesc = GetRoomByIdx((Level *)pGVar13,*(int *)(iVar5 + 0x394),-1); if ((tmpDesc->Flags & 0x1000U) != 0) { uVar11 = tmpDesc->DecorationSeed; rngShift12 = 0xf00000002; local_98 = (RoomConfig *)&DAT_00000011; local_d4 = 0x11; dirResult = Isaac::GetAxisAlignedUnitVectorFromDir(&doorDir,*(int *)(iVar5 + 0x164)); local_84 = (Game *)-dirResult->x; local_8c = (RoomDescriptor *)-dirResult->y; effectIdx = 0; iVar12 = *(int *)((int)g_game->_room + 0xc); baseY = (float)local_8c * 20.0 + (float)(*(int *)(iVar5 + 0x24) / iVar12) * 40.0 + 120.0 ; baseX = (float)local_84 * 20.0 + (float)(*(int *)(iVar5 + 0x24) % iVar12) * 40.0 + 40.0; local_a0 = cos(1.5707964); fVar14 = sin(1.5707964); perpX = (float)local_84 * local_a0 - (float)local_8c * fVar14; perpY = (float)local_84 * fVar14 + (float)local_8c * local_a0; do { local_94 = (RoomConfig *)((float)effectIdx * 0.125); local_a8 = (Entity *)Random(); local_a0 = baseY + (float)local_8c * (float)local_94 * 128.0; rowX = baseX + (float)local_94 * 128.0 * (float)local_84; if (uVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar11 = uVar11 >> ((byte)rngShift12 & 0x1f) ^ uVar11; uVar11 = uVar11 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar11; uVar11 = uVar11 >> ((byte)local_98 & 0x1f) ^ uVar11; fVar14 = ((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)] ) * 2.3283062e-10 - 0.5) * (float)local_94 * 40.0; spawnPos.x = perpX * fVar14 + rowX; spawnPos.y = local_a0 + fVar14 * perpY; local_a8 = Game::Spawn(g_game,1000,7,&spawnPos,&g_vectorZero,(Entity *)0x0,0, (uint)local_a8); if (uVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar11 = uVar11 >> ((byte)rngShift12 & 0x1f) ^ uVar11; local_60 = 0; uVar11 = uVar11 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar11; uStack_5c = 0; uVar11 = uVar11 >> ((byte)local_98 & 0x1f) ^ uVar11; local_58 = 0; effectColor = &(local_a8->_sprite)._color; effectScale = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283062e-10 * (1.0 - (float)local_94) * 5.0 + 0.5; fVar14 = effectScale * g_vectorOne.x; (local_a8->_sprite)._scale.y = effectScale * g_vectorOne.y; (local_a8->_sprite)._scale.x = fVar14; local_70 = 0; uStack_6c = 0; uStack_68 = 0; uStack_64 = 0; tintColor = 0x3f4ccccd; uStack_7c = 0x3f4ccccd; uStack_78 = 0x3f4ccccd; uStack_74 = 0x3f800000; if (effectColor != (ColorMod *)&tintColor) { (local_a8->_sprite)._color._colorize[0] = 0.0; (local_a8->_sprite)._color._colorize[1] = 0.0; (local_a8->_sprite)._color._colorize[2] = 0.0; (local_a8->_sprite)._color._colorize[3] = 0.0; (local_a8->_sprite)._color._offset[0] = 0.0; (local_a8->_sprite)._color._offset[1] = 0.0; effectColor->_tint[0] = 0.8; (local_a8->_sprite)._color._tint[1] = 0.8; (local_a8->_sprite)._color._tint[2] = 0.8; (local_a8->_sprite)._color._tint[3] = 1.0; (local_a8->_sprite)._color._offset[2] = 0.0; } (**(code **)(*(int *)local_a8 + 0xc))(); effectIdx = effectIdx + 1; } while (effectIdx < 9); pGVar13 = level; } } local_88 = (RoomConfig_Room *)((int)local_88 + 4); } while (local_88 < 0x744); } } else if (pGVar13->_currentDimensionIdx != 2) { uVar11 = pGVar13->_stageType; goto LAB_0073ee35; } if ((pGVar13->_currentRoomIdx == -0xc) && (*(int *)(*(int *)((int)pGVar13->_room + 4) + 0x40) == 1)) { RemoveCurses((Level *)pGVar13,0xffffffff); pGVar9 = g_game; local_98 = (RoomConfig *)&g_game->_playerManager; local_88 = (RoomConfig_Room *)0x0; playersBegin = (RoomConfig_Room *)0x0; playersEnd = (undefined4 *)0x0; (g_game->_playerManager).field_0x5c = 0; local_94 = (RoomConfig *)0x0; playersCapacityEnd = (undefined4 *)0x0; local_14 = 0; if ((int)(pGVar9->_playerManager)._playerList._end - (int)(((PlayerManager *)local_98)->_playerList)._begin >> 2 != 0) { uVar11 = 0; do { puVar3 = playersEnd; pvVar7 = ((std_vector *)&local_98->field_0x0)->_end; if ((int)pvVar7 - (int)((std_vector *)&local_98->field_0x0)->_begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = ((std_vector *)&local_98->field_0x0)->_end; } playerSlot = ((std_vector *)&local_98->field_0x0)->_begin; if (uVar11 < (uint)((int)pvVar7 - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar11; } local_a8 = (Entity *)*playerSlot; if ((RoomConfig *)puVar3 == local_94) { std::vector::_Emplace_reallocate(puVar3,&local_a8); local_94 = (RoomConfig *)playersCapacityEnd; } else { *puVar3 = local_a8; playersEnd = puVar3 + 1; } uVar11 = uVar11 + 1; local_98 = (RoomConfig *)&g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(((PlayerManager *)local_98)->_playerList)._begin >> 2)); local_88 = playersBegin; pGVar13 = level; } playerCount = (undefined1 *)((int)playersEnd - (int)local_88 >> 2); local_98 = (RoomConfig *)0x0; playersBegin = local_88; if (playerCount != (undefined1 *)0x0) { do { FUN_007dad80(); pGVar13 = level; local_98 = (RoomConfig *)&local_98->field_0x1; } while (local_98 < playerCount); local_98 = (RoomConfig *)0x0; do { Game::reset_players_for_greed(); local_98 = (RoomConfig *)((int)local_98 + 1); } while (local_98 < playerCount); } hud = &g_game->_hud; (g_game->_playerManager).field_0x5c = 1; HUD::mark_all_slots_dirty(hud,0,0); local_14 = 0xffffffff; if (local_88 != (RoomConfig_Room *)0x0) { uVar11 = (int)local_94 - (int)local_88 & 0xfffffffc; pRVar6 = local_88; if (0xfff < uVar11) { pRVar6 = (RoomConfig_Room *)local_88[-1].originalVariant; uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)local_88 + (-4 - (int)pRVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pRVar6,uVar11); } } if (*(int *)&g_game->_deathmatchManager < 2) { PlayerManager::enter_level(&g_game->_playerManager); } Camera::Update((Camera *)((int)g_game->_room + 0x1618),1); Room::UpdateRedKey(pGVar13->_room); if ((g_game->_dailyChallenge)._id == 0) { pvVar7 = (g_manager->_challengeParams)._begin; uVar11 = ((int)(g_manager->_challengeParams)._end - (int)pvVar7) / 0xa4 - 1; uVar10 = -(uint)(g_game->_challenge != 0) & g_game->_challenge; if (uVar10 < uVar11) { uVar11 = uVar10; } challengeParams = (ChallengeParam *)(uVar11 * 0xa4 + (int)pvVar7); } else { challengeParams = &(g_game->_dailyChallenge)._params; } if (challengeParams->_pathType != 3) goto LAB_0073f55d; if (g_game->_stage != 6) { if (g_game->_stage != 5) goto LAB_0073f55d; uVar11 = g_game->_debugCurses; uVar10 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (forcedCurses | uVar11 | uVar10) & 2) == 0) goto LAB_0073f55d; } tmpDesc = GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); pGVar13 = level; if ((tmpDesc->ListIndex == g_game->_lastBossRoomListIdx) && ((*(byte *)(*(int *)((int)level->_room + 4) + 0x44) & 1) != 0)) { Room::update_door_targets(); Room::TrySpawnBossRushDoor(pGVar13->_room,0,0); } LAB_0073f55d: pvVar7 = g_game->_room; uVar11 = 0; pGVar13 = g_game; if (*(int *)((int)pvVar7 + 0x1264) != 0) { do { piVar8 = *(int **)(*(int *)((int)pvVar7 + 0x125c) + uVar11 * 4); if ((((1 < *(int *)&pGVar13->_deathmatchManager) && (piVar8[10] == 1)) || (piVar8[10] - 10U < 0x3de)) && (pGVar13->_frameCount == piVar8[0xca])) { (**(code **)(*piVar8 + 0xc))(); pGVar13 = g_game; } uVar11 = uVar11 + 1; } while (uVar11 < *(uint *)((int)pvVar7 + 0x1264)); } FUN_00865180(); if (1 < *(int *)&g_game->_deathmatchManager) { (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 8))(); pGVar13 = g_game; g_game->_dizzyTargetIntensity = 0.0; pGVar13->_dizzyIntensity = 0.0; } ExceptionList = local_1c; return; } //@@ 0073f620 Level::reveal_room_visibility /* DB: ? recursive over room descriptors from Game::UpdateVisibility: FirstCollectibleOwner(0x4c X-Ray Vision) reveals secret doors, spawns 1000.36, Level::GetNeighborRoomIdx, HasMirrorDimension */ undefined4 Level::reveal_room_visibility(int param_1,int param_2,uint param_3) { void *pvVar1; byte isMirror; uint uVar2; Vector *position; Entity *doorEffect; Entity_Player *owner; RoomDescriptor *otherRoom; int idx; Level *in_ECX; int iVar3; int currentRoom; float local_14; Vector doorPos; float effectRotation; bool isSecret; Manager *manager; iVar3 = *(int *)(*(int *)(param_1 + 0x10) + 8); if ((iVar3 == 7) || (iVar3 == 8)) { isSecret = true; } else { isSecret = false; } if (param_2 == 0) { pvVar1 = in_ECX->_room; currentRoom = *(int *)((int)pvVar1 + 4); if (isSecret) goto LAB_0073f6bb; } else if (((isSecret) || (iVar3 = *(int *)(*(int *)(param_2 + 0x10) + 8), iVar3 == 7)) || (iVar3 == 8)) { pvVar1 = in_ECX->_room; isSecret = true; currentRoom = *(int *)((int)pvVar1 + 4); LAB_0073f6bb: if ((param_2 == currentRoom) && (param_3 != 0xffffffff)) { owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x4c,(RNG **)&g_game->_playerManager,1); if (((owner != (Entity_Player *)0x0) || (in_ECX->_isCanSeeEverything != 0)) && (*(int *)(*(int *)((int)pvVar1 + param_3 * 4 + 0x724) + 8) == 7)) { uVar2 = Random(); position = GridEntity::Position (*(GridEntity **)((int)pvVar1 + param_3 * 4 + 0x724),&doorPos); doorEffect = Game::SpawnEx(g_game,1000,0x24,position,&g_vectorZero,(Entity *)0x0,0,uVar2,0); uVar2 = param_3 & 0x80000003; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffc) + 1; } local_14 = (float)(int)(uVar2 - 1) * 90.0; iVar3 = __RTDynamicCast(doorEffect,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); effectRotation = local_14; local_14 = 4.62428e-44; *(float *)(iVar3 + 0xec) = effectRotation; manager = g_manager; *(undefined4 *)(*(int *)((int)pvVar1 + param_3 * 4 + 0x724) + 8) = 0; seed_fart_sound_override((int *)&local_14); SoundEffects::Play(&manager->_sfxManager,(int)local_14,0.75,10,0,1.0,0.0); } if (*(char *)(*(int *)((int)pvVar1 + param_3 * 4 + 0x724) + 0x391) != '\0') goto LAB_0073f830; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x4c,(RNG **)&g_game->_playerManager,1); if (((owner == (Entity_Player *)0x0) && (in_ECX->_isCanSeeEverything == 0)) && (owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x5b,(RNG **)&g_game->_playerManager,1), owner == (Entity_Player *)0x0)) goto LAB_0073f91f; } else { currentRoom = *(int *)((int)in_ECX->_room + 4); } LAB_0073f830: owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x5b,(RNG **)&g_game->_playerManager,1); if ((owner == (Entity_Player *)0x0) && ((((iVar3 = *(int *)(*(int *)(param_1 + 0x10) + 8), iVar3 == 6 || (iVar3 == 0x12)) || (iVar3 == 0x13)) || (isSecret)))) { *(uint *)(param_1 + 0x3c) = *(uint *)(param_1 + 0x3c) | 3; if ((-1 < *(int *)(param_1 + 4)) && (isMirror = HasMirrorDimension(in_ECX), isMirror != 0)) { otherRoom = GetRoomByIdx(in_ECX,*(int *)(param_1 + 4),1 - in_ECX->_currentDimensionIdx); otherRoom->DisplayFlags = otherRoom->DisplayFlags | 3; } } else { *(uint *)(param_1 + 0x3c) = *(uint *)(param_1 + 0x3c) | 5; if ((-1 < *(int *)(param_1 + 4)) && (isMirror = HasMirrorDimension(in_ECX), isMirror != 0)) { otherRoom = GetRoomByIdx(in_ECX,*(int *)(param_1 + 4),1 - in_ECX->_currentDimensionIdx); otherRoom->DisplayFlags = otherRoom->DisplayFlags | 5; } } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x5b,(RNG **)&g_game->_playerManager,1); if (((owner != (Entity_Player *)0x0) && (param_2 == currentRoom)) && (param_2 != param_1)) { iVar3 = 0; do { idx = GetNeighborRoomIdx(in_ECX,*(int *)(param_1 + 4),iVar3); if ((-1 < idx) && (otherRoom = GetRoomByIdx(in_ECX,idx,-1), otherRoom->Data != (void *)0x0)) { reveal_room_visibility(otherRoom,param_1,iVar3); } iVar3 = iVar3 + 1; } while (iVar3 < 8); } LAB_0073f91f: if ((*(uint *)(param_1 + 0x44) >> 10 & 1) != 0) { *(uint *)(param_1 + 0x3c) = *(uint *)(param_1 + 0x3c) | 5; } return CONCAT31((uint3)(*(uint *)(param_1 + 0x44) >> 0x12),1); } //@@ 0073f940 Game::UpdateVisibility /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall void Game::UpdateVisibility(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Game::UpdateVisibility(Game *this) { void *pvVar1; int iVar2; Game *pGVar3; byte bVar4; RoomDescriptor *pRVar5; RoomDescriptor *pRVar6; int iVar7; pvVar1 = this->_room; pRVar5 = Level::GetRoomByIdx((Level *)this,this->_currentRoomIdx,-1); pRVar5->DisplayFlags = pRVar5->DisplayFlags | 5; if (-1 < this->_currentRoomIdx) { bVar4 = Level::HasMirrorDimension((Level *)this); if (bVar4 != 0) { pRVar6 = Level::GetRoomByIdx((Level *)this,this->_currentRoomIdx, 1 - this->_currentDimensionIdx); pRVar6->DisplayFlags = pRVar6->DisplayFlags | 5; } } iVar7 = 0; do { iVar2 = *(int *)((int)pvVar1 + iVar7 * 4 + 0x724); if ((iVar2 != 0) && (iVar2 = *(int *)(iVar2 + 0x394), -1 < iVar2)) { pRVar6 = Level::GetRoomByIdx((Level *)this,iVar2,-1); Level::reveal_room_visibility(pRVar6,pRVar5,iVar7); } pGVar3 = g_game; iVar7 = iVar7 + 1; } while (iVar7 < 8); Minimap::refresh_room_icons((Minimap *)(g_game->_minimap)._config); Minimap::refresh_room_icons ((Minimap *)((pGVar3->_minimap)._config[1]._mapSprite._filename._buf + 4)); pGVar3 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar3->_hud)._hudRefreshCountdown = 2; } return; } //@@ 0073fa20 Level::DEBUG_goto_room /* ZHL [exact] __thiscall void Level::DEBUG_goto_room(RoomConfig_Room* roomConfig); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Level::DEBUG_goto_room(Level *this,RoomConfig_Room *roomConfig) { void *pvVar1; RoomDescriptor *pRVar2; RoomDescriptor *pRVar3; RoomDescriptor *pRVar4; RoomDescriptor *pRVar5; RoomDescriptor *pRVar6; RoomDescriptor *pRVar7; RoomDescriptor *pRVar8; RoomDescriptor *pRVar9; RoomDescriptor *debugRoom; RoomDescriptor *pRVar11; RoomDescriptor *pRVar12; RoomDescriptor *pRVar13; RoomDescriptor *pRVar14; std_vector *savedEffects; uint uVar15; std_vector *savedEntities; void *entry; short *shopItemIdx; short *shopItemDiscountIdx; int *bossDeathSeed; int *awardSeed; int *decorationSeed; int *spawnSeed; void **roomData; int *allowedDoors; std_set *restrictedGridIndexes; void *local_10; undefined1 *puStack_c; undefined4 local_8; RoomDescriptor *debugRoom; local_8 = 0xffffffff; puStack_c = &LAB_00afda61; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } if ((uint)this->_currentDimensionIdx < 3) { pRVar3 = this->_roomList + 0x1fd; pRVar4 = this->_roomList + 0x1fd; pRVar2 = this->_roomList + 0x1fd; debugRoom = this->_roomList + 0x1fd; pRVar7 = this->_roomList + 0x1fd; debugRoom = this->_roomList + 0x1fd; pRVar6 = this->_roomList + 0x1fd; pRVar8 = this->_roomList + 0x1fd; pRVar9 = this->_roomList + 0x1fd; pRVar14 = this->_roomList + 0x1fd; pRVar13 = this->_roomList + 0x1fd; pRVar11 = this->_roomList + 0x1fd; pRVar12 = this->_roomList + 0x1fd; pRVar5 = this->_roomList + 0x1fd; } else { pRVar3 = &g_roomDescriptorDummy; pRVar11 = &g_roomDescriptorDummy; pRVar4 = &g_roomDescriptorDummy; pRVar2 = &g_roomDescriptorDummy; pRVar12 = &g_roomDescriptorDummy; pRVar7 = &g_roomDescriptorDummy; debugRoom = &g_roomDescriptorDummy; pRVar6 = &g_roomDescriptorDummy; debugRoom = &g_roomDescriptorDummy; pRVar8 = &g_roomDescriptorDummy; pRVar5 = &g_roomDescriptorDummy; pRVar9 = &g_roomDescriptorDummy; pRVar14 = &g_roomDescriptorDummy; pRVar13 = &g_roomDescriptorDummy; } restrictedGridIndexes = &pRVar11->RestrictedGridIndexes; allowedDoors = &pRVar3->AllowedDoors; roomData = &pRVar2->Data; spawnSeed = &pRVar7->SpawnSeed; decorationSeed = &pRVar6->DecorationSeed; awardSeed = &pRVar8->AwardSeed; bossDeathSeed = &pRVar9->BossDeathSeed; shopItemDiscountIdx = &pRVar14->ShopItemDiscountIdx; shopItemIdx = &pRVar13->ShopItemIdx; savedEntities = &debugRoom->SavedEntities; savedEffects = &pRVar12->SavedEffects; uVar15 = 0; do { *(undefined4 *)(uVar15 + (int)(debugRoom->SavedGridEntities)._begin) = 0; uVar15 = uVar15 + 0x20; } while (uVar15 < 0x3800); pRVar5->Flags = pRVar5->Flags & 0xfffffffe; pRVar4->VisitedCount = 0; pvVar1 = savedEntities->_end; entry = savedEntities->_begin; if (entry != pvVar1) { do { invoke_pending_callbacks(entry); entry = (void *)((int)entry + 0x78); } while (entry != pvVar1); entry = savedEntities->_begin; } savedEntities->_end = entry; pvVar1 = restrictedGridIndexes->_head; FID_conflict__Erase_tree_>_> (restrictedGridIndexes, (fuzzer_allocator_> *)restrictedGridIndexes, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; restrictedGridIndexes->_size = 0; pvVar1 = savedEffects->_end; entry = savedEffects->_begin; if (entry != pvVar1) { do { invoke_pending_callbacks(entry); entry = (void *)((int)entry + 0x78); } while (entry != pvVar1); entry = savedEffects->_begin; } savedEffects->_end = entry; *allowedDoors = roomConfig->Doors; *roomData = roomConfig; uVar15 = Random(); *spawnSeed = uVar15; uVar15 = Random(); *decorationSeed = uVar15; uVar15 = Random(); *awardSeed = uVar15; uVar15 = Random(); *bossDeathSeed = uVar15; *shopItemDiscountIdx = -1; *shopItemIdx = -1; Game::StartRoomTransition(g_game,-3,-1,0,(Entity_Player *)0x0,-1); ExceptionList = local_10; return; } //@@ 0073fc80 Level::ChangeRoom /* WARNING: Removing unreachable block (ram,0x0074030c) */ /* WARNING: Removing unreachable block (ram,0x0074031e) */ /* WARNING: Removing unreachable block (ram,0x0074032e) */ /* WARNING: Removing unreachable block (ram,0x00740334) */ /* ZHL [exact] __thiscall void Level::ChangeRoom(int targetRoomIDX, int dimension); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Level::ChangeRoom(Level *this,int targetRoomIDX,int dimension) { bool bVar1; qword qVar2; byte bVar3; uint uVar4; int *piVar5; int iVar6; RoomDescriptor *pRVar7; uint uVar8; uint preventedCurses; RoomDescriptor *treeNode; uint uVar9; int iVar10; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar11; undefined4 *ptr; GridEntity_Door *this_00; PersistentGameData *persistentData; int iVar12; char *format; undefined4 *nearbyRooms; undefined4 *nearbyRoomsCapacityEnd; RoomDescriptor *local_28; RoomDescriptor *local_24; RoomDescriptor *local_20; uint local_1c; undefined4 *local_18; int newRoomIdx; void *local_10; undefined1 *puStack_c; undefined4 local_8; uint *flagsPtr; Game *game; bool isDoorConnected; char isNil; Manager *manager; int oldRoomIdx; RoomDescriptor *treeNext; RoomDescriptor *treeParent; local_8 = 0xffffffff; puStack_c = &LAB_00afda9d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_1c = 0; if (targetRoomIDX < -0x13) { targetRoomIDX = -0x14; } newRoomIdx = 0xa8; if (targetRoomIDX < 0xa8) { newRoomIdx = targetRoomIDX; } if (0x7fffffff < (uint)dimension) { dimension = -1; } iVar12 = 2; if (dimension < 2) { iVar12 = dimension; } Room::on_leave(this->_room); manager = g_manager; game = g_game; persistentData = &g_manager->_persistentGameData; uVar11 = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x10; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar11; if ((*(char *)persistentData != '\0') && ((manager->_persistentGameData)._isFileLoaded != 0)) { *(undefined1 *)persistentData = 0; Manager::BackupSaveFile((Manager *)persistentData); manager = g_manager; piVar5 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar4); if ((*piVar5 == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(persistentData); } else { PersistentGameData::SaveToSteamCloud(persistentData); } } iVar10 = newRoomIdx; if (iVar12 < 0) { iVar12 = this->_currentDimensionIdx; } if ((this->_currentDimensionIdx == 2) && (iVar12 != 2)) { this->_currentRoomIndex = this[1]._roomList[7].Flags; this->_previousRoomIndex = this[1]._roomList[7].GreedSubType; iVar6 = (int)(char)this[1]._roomList[7].TotalMoneySpent; this->_currentDimensionIdx = iVar6; this->_currentRoomMap = this->_roomMap + iVar6 * 0xa9; this->_lastRoomDimensionIdx = (int)(char)this[1]._roomList[7].PoopCount; this->_leaveDoor = this[1]._roomList[7].VisitedCount; } pRVar7 = GetRoomByIdx(this,newRoomIdx,iVar12); iVar6 = this->_currentDimensionIdx; if ((iVar6 != iVar12) || (((piVar5 = pRVar7->Data, piVar5 != (int *)0x0 && (piVar5[2] == 0x10)) && (*piVar5 == 0x23)))) { this->_ventricleRazorPortals[0xc] = 0x61; this->_ventricleRazorPortals[0xd] = 0x79; this->_ventricleRazorPortals[0xe] = 0xfe; this->_ventricleRazorPortals[0xf] = 0xff; this->_ventricleRazorPortals[0] = 0x61; this->_ventricleRazorPortals[1] = 0x79; this->_ventricleRazorPortals[2] = 0xfe; this->_ventricleRazorPortals[3] = 0xff; } oldRoomIdx = this->_currentRoomIndex; this->_lastRoomDimensionIdx = iVar6; if ((iVar10 == oldRoomIdx) && (iVar12 == iVar6)) { KAGE_LogMessage(1,(byte *)"[warn] ChangeRoom() called with current room index\n"); } else { iVar6 = this->_previousRoomIndex; if (iVar10 < 0) { LAB_0073fe36: if (((-1 < oldRoomIdx) || (oldRoomIdx == -4)) || (oldRoomIdx == -3)) goto LAB_0073fe4e; LAB_0073fe44: if ((oldRoomIdx == -0xb) || (oldRoomIdx == -0xd)) goto LAB_0073fe4e; } else { if (oldRoomIdx == -0xe) goto LAB_0073fe44; if (oldRoomIdx == -0xf) goto LAB_0073fe36; LAB_0073fe4e: this->_previousRoomIndex = oldRoomIdx; } if (iVar10 == -0xe) { this->_previousRoomIndex = iVar6; } this->_currentDimensionIdx = iVar12; this->_currentRoomIndex = iVar10; this->_currentRoomMap = this->_roomMap + iVar12 * 0xa9; } bVar1 = false; dimension = -1; uVar4 = g_game->_debugCurses; uVar9 = this->_curses; uVar8 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((((((~preventedCurses & (uVar8 | uVar4 | uVar9) & 0x20) != 0) && (-1 < this->_currentRoomIndex)) && (-1 < this->_previousRoomIndex)) && (this->_currentDimensionIdx == this->_lastRoomDimensionIdx)) && ((this->_currentDimensionIdx != 1 || (bVar3 = HasAbandonedMineshaft(this), bVar3 == 0)))) { uVar4 = Random(); if (uVar4 % 10 == 0) { get_rooms_within_two_doors(&local_28,newRoomIdx); local_8 = 0; uVar4 = 0; nearbyRooms = (undefined4 *)0x0; nearbyRoomsCapacityEnd = (undefined4 *)0x0; local_20 = local_28; pRVar7 = (RoomDescriptor *)local_28->GridIndex; local_18 = (undefined4 *)0x0; treeNode = pRVar7; if (pRVar7 != local_28) { do { treeNext = (RoomDescriptor *)treeNode->ListIndex; uVar4 = uVar4 + 1; if (*(char *)((int)&treeNext->Dimension + 1) == '\0') { isNil = *(char *)((int)&((RoomDescriptor *)treeNext->GridIndex)->Dimension + 1); treeNode = treeNext; treeNext = (RoomDescriptor *)treeNext->GridIndex; while (isNil == '\0') { isNil = *(char *)((int)&((RoomDescriptor *)treeNext->GridIndex)->Dimension + 1); treeNode = treeNext; treeNext = (RoomDescriptor *)treeNext->GridIndex; } } else { isNil = *(char *)((int)&((RoomDescriptor *)treeNode->SafeGridIndex)->Dimension + 1); treeParent = (RoomDescriptor *)treeNode->SafeGridIndex; treeNext = treeNode; while ((treeNode = treeParent, isNil == '\0' && (treeNext == (RoomDescriptor *)treeNode->ListIndex))) { isNil = *(char *)((int)&((RoomDescriptor *)treeNode->SafeGridIndex)->Dimension + 1); treeParent = (RoomDescriptor *)treeNode->SafeGridIndex; treeNext = treeNode; } } } while (treeNode != local_28); if (uVar4 != 0) { if (0x3fffffff < uVar4) { /* WARNING: Subroutine does not return */ std::_Xlen(); } nearbyRooms = std::_Allocate(uVar4 * 4); nearbyRoomsCapacityEnd = nearbyRooms + uVar4; local_18 = nearbyRooms; do { *local_18 = pRVar7->Data; local_18 = local_18 + 1; treeNode = (RoomDescriptor *)pRVar7->ListIndex; if (*(char *)((int)&treeNode->Dimension + 1) == '\0') { isNil = *(char *)((int)&((RoomDescriptor *)treeNode->GridIndex)->Dimension + 1); pRVar7 = treeNode; treeNode = (RoomDescriptor *)treeNode->GridIndex; while (isNil == '\0') { isNil = *(char *)((int)&((RoomDescriptor *)treeNode->GridIndex)->Dimension + 1); pRVar7 = treeNode; treeNode = (RoomDescriptor *)treeNode->GridIndex; } } else { isNil = *(char *)((int)&((RoomDescriptor *)pRVar7->SafeGridIndex)->Dimension + 1); treeNext = (RoomDescriptor *)pRVar7->SafeGridIndex; treeNode = pRVar7; while ((pRVar7 = treeNext, isNil == '\0' && (treeNode == (RoomDescriptor *)pRVar7->ListIndex))) { isNil = *(char *)((int)&((RoomDescriptor *)pRVar7->SafeGridIndex)->Dimension + 1); treeNext = (RoomDescriptor *)pRVar7->SafeGridIndex; treeNode = pRVar7; } } } while (pRVar7 != local_20); } } local_8 = CONCAT31(local_8._1_3_,1); FUN_00752de0(nearbyRooms,local_18); uVar4 = 0; local_18 = (undefined4 *)((int)local_18 - (int)nearbyRooms >> 2); if (local_18 != (undefined4 *)0x0) { do { local_20 = GetRoomByIdx(this,nearbyRooms[uVar4],-1); iVar12 = *(int *)((int)local_20->Data + 8); if ((((iVar12 != 7) && (iVar12 != 8)) && (iVar12 != 10)) && (-1 < local_20->GridIndex)) { if (this->_leaveDoor < 0) { newRoomIdx = nearbyRooms[uVar4]; this->_currentRoomIndex = newRoomIdx; format = "Found a candidate without leave door\n"; LAB_00740146: bVar1 = true; KAGE_LogMessage(1,(byte *)format); break; } dimension = this->_leaveDoor + 2U & 0x80000003; if (dimension < 0) { dimension = (dimension - 1U | 0xfffffffc) + 1; } uVar9 = GetTargetSlot(nearbyRooms[uVar4],dimension,iVar12); uVar8 = uVar9 & 0x80000003; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffc) + 1; } if ((uVar8 == dimension) && (local_1c = local_1c | 1, (local_20->_doors[(uVar9 >> 5) - 1] & 1 << ((byte)uVar9 & 0x1f)) != 0)) { isDoorConnected = true; } else { isDoorConnected = false; } if ((local_1c & 1) != 0) { local_1c = local_1c & 0xfffffffe; } if (isDoorConnected) { pRVar7 = GetRoomByIdx(this,local_20->_doors[uVar9],-1); iVar12 = *(int *)((int)pRVar7->Data + 8); if ((iVar12 != 8) && (iVar12 != 7)) { format = "Found a candidate\n"; newRoomIdx = nearbyRooms[uVar4]; this->_currentRoomIndex = newRoomIdx; this->_previousRoomIndex = local_20->_doors[uVar9]; goto LAB_00740146; } } } uVar4 = uVar4 + 1; } while (uVar4 < local_18); } local_8 = local_8 & 0xffffff00; if (nearbyRooms != (undefined4 *)0x0) { uVar4 = ((int)nearbyRoomsCapacityEnd - (int)nearbyRooms >> 2) * 4; ptr = nearbyRooms; if (0xfff < uVar4) { ptr = (undefined4 *)nearbyRooms[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)nearbyRooms + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&local_28,(fuzzer_allocator_> *)&local_28, (_Tree_node *)local_28->SafeGridIndex); operator_delete(local_28,0x14); manager = g_manager; game = g_game; if ((bVar1) && ((g_game->_roomTransition)._animation == 0)) { (g_game->_roomTransition)._animation = 4; (game->_minimap)._shakeDuration = 0x1e; local_20 = (RoomDescriptor *)0x16; seed_fart_sound_override((int *)&local_20); SoundEffects::Play(&manager->_sfxManager,(int)local_20,0.5,2,0,1.0,0.0); } } uVar4 = Random(); pRVar7 = (RoomDescriptor *)(uVar4 % 5); if (pRVar7 == (RoomDescriptor *)0x0) { local_8 = 2; local_28 = pRVar7; local_24 = pRVar7; FUN_0042c820(this->_roomCount); local_20 = (RoomDescriptor *)0x0; if (0 < this->_roomCount) { do { if (local_28 == local_24) { std::vector::_Emplace_reallocate(local_28,&local_20); } else { local_28->GridIndex = (int)local_20; local_28 = (RoomDescriptor *)&local_28->SafeGridIndex; } local_20 = (RoomDescriptor *)((int)&local_20->GridIndex + 1); } while ((int)local_20 < this->_roomCount); } FUN_00752de0(0,local_28); iVar12 = 0; if (0 < this->_roomCount) { piVar5 = (int *)0x0; uVar11 = extraout_ECX; do { if (this->_roomList[*piVar5].VisitedCount != 0) { iVar10 = find_matching_room_idx(this->_roomList[*piVar5].SafeGridIndex,uVar11); uVar11 = extraout_ECX_00; if (iVar10 != -1) { maze_swap_rooms(this,this->_roomList[*piVar5].SafeGridIndex,iVar10); break; } } iVar12 = iVar12 + 1; piVar5 = piVar5 + 1; } while (iVar12 < this->_roomCount); } local_8 = 0xffffffff; } } iVar12 = this->_previousRoomIndex; iVar10 = this->_currentRoomIndex; if ((this->_leaveDoor < 0) || ((iVar10 == iVar12 && (this->_currentDimensionIdx == this->_lastRoomDimensionIdx)))) { if (newRoomIdx < 0) { uVar4 = Random(); dimension = uVar4 & 3; goto LAB_007404a6; } uVar4 = iVar10 % 0xd - iVar12 % 0xd; uVar9 = iVar10 / 0xd - iVar12 / 0xd; iVar12 = newRoomIdx; if ((int)((uVar9 ^ (int)uVar9 >> 0x1f) - ((int)uVar9 >> 0x1f)) < (int)((uVar4 ^ (int)uVar4 >> 0x1f) - ((int)uVar4 >> 0x1f))) { dimension = 2; if (0 < (int)uVar4) { dimension = 0; } } else { dimension = (uint)((int)uVar9 < 1) * 2 + 1; } } else { if (dimension == -1) { uVar4 = this->_leaveDoor & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } dimension = uVar4 + 2 & 0x80000003; if (dimension < 0) { dimension = (dimension - 1U | 0xfffffffc) + 1; } if (iVar12 < 0) goto LAB_007404a6; local_20 = GetRoomByIdx(this,iVar12,this->_lastRoomDimensionIdx); uVar4 = this->_leaveDoor; uVar9 = 1 << ((byte)uVar4 & 0x1f); if ((((*(uint *)((int)local_20->Data + (uVar4 >> 5) * 4 + 0x38) & uVar9) == 0) || (iVar12 = local_20->_doors[uVar4], iVar12 < 0)) || (this->_currentDimensionIdx != this->_lastRoomDimensionIdx)) goto LAB_007404a6; switch(dimension) { case 0: iVar10 = iVar12 + -1; break; case 1: iVar10 = iVar12 + -0xd; break; case 2: iVar10 = iVar12 + 1; break; case 3: iVar10 = iVar12 + 0xd; break; default: goto switchD_007403fd_default; } this->_previousRoomIndex = iVar10; switchD_007403fd_default: if ((-1 < this->_currentRoomIndex) && ((local_20->_doors[(uVar4 >> 5) - 1] & uVar9) != 0)) { this->_currentRoomIndex = iVar12; goto LAB_007404a9; } } LAB_007404a6: iVar12 = newRoomIdx; } LAB_007404a9: iVar12 = GetTargetSlot(iVar12,dimension,iVar12); this->_enterDoor = iVar12; if (((this->_currentRoomIndex == this->_previousRoomIndex) && (this->_currentDimensionIdx != this->_lastRoomDimensionIdx)) && (bVar3 = HasMirrorDimension(this), bVar3 != 0)) { this->_enterDoor = this->_leaveDoor; } pRVar7 = GetRoomByIdx(this,this->_previousRoomIndex,this->_lastRoomDimensionIdx); uVar9 = 0; uVar4 = 0x724; local_1c = *(int *)((int)pRVar7->Data + 8); do { uVar9 = uVar9 + 1; if ((uVar9 < 9) && (iVar12 = *(int *)(uVar4 + (int)this->_room), iVar12 != 0)) { pRVar7 = GetRoomByIdx(this,*(int *)(iVar12 + 0x394),-1); pRVar7->Flags = pRVar7->Flags & 0xfffbffff; } uVar4 = uVar4 + 4; } while (uVar4 < 0x744); if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && (((iVar12 = this->_stage, 5 < iVar12 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0) ) && ((this->_stageType == 4 || (this->_stageType == 5)))))) { if (iVar12 == 4) { LAB_007405b4: if ((this->_lastRoomDimensionIdx == 0) && (this->_currentDimensionIdx == 1)) { iVar12 = *(int *)((int)this->_room + 4); iVar10 = *(int *)(iVar12 + 0x10); if ((iVar10 != 0) && ((*(int *)((int)this->_room + 8) == 1 && (*(int *)(iVar10 + 0x10) == 10)))) { flagsPtr = (uint *)(iVar12 + 0x44); *flagsPtr = *flagsPtr | 4; } } } else if (iVar12 == 3) { uVar4 = g_game->_debugCurses; uVar9 = this->_curses; uVar8 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (uVar8 | uVar4 | uVar9) & 2) != 0) goto LAB_007405b4; } } load_room(this); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); if ((this->_currentRoomIndex < 0) || (bVar1)) goto LAB_0074080d; if (this->_enterDoor + 1U < 9) { this_00 = *(GridEntity_Door **)((int)this->_room + this->_enterDoor * 4 + 0x724); } else { this_00 = (GridEntity_Door *)0x0; } iVar12 = *(int *)((int)this->_room + 8); if ((iVar12 == 7) || (iVar12 == 8)) { bVar1 = true; if ((this_00 == (GridEntity_Door *)0x0) || ((pRVar7 = GetRoomByIdx((Level *)g_game,this_00->_targetRoomIdx,-1), pRVar7 != (RoomDescriptor *)0x0 && (((uint)pRVar7->Flags >> 10 & 1) != 0)))) goto LAB_00740680; } else { bVar1 = false; if (this_00 == (GridEntity_Door *)0x0) { LAB_00740680: dimension = 0; uVar4 = Random(); local_20 = (RoomDescriptor *)(uVar4 & 7); iVar12 = 0; do { uVar4 = (int)local_20->_doors + iVar12 + -0x1c & 0x80000007; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffff8) + 1; } this->_enterDoor = uVar4; if (uVar4 + 1 < 9) { this_00 = *(GridEntity_Door **)((int)this->_room + uVar4 * 4 + 0x724); } else { this_00 = (GridEntity_Door *)0x0; } if (bVar1) { if (this_00 != (GridEntity_Door *)0x0) { pRVar7 = GetRoomByIdx((Level *)g_game,this_00->_targetRoomIdx,-1); if ((pRVar7 == (RoomDescriptor *)0x0) || (((uint)pRVar7->Flags >> 10 & 1) == 0)) goto LAB_00740830; this_00 = (GridEntity_Door *)0x0; } LAB_00740708: } else { if (this_00 == (GridEntity_Door *)0x0) goto LAB_00740708; LAB_00740830: if (this_00->_targetRoomType == 1) goto LAB_00740722; dimension = (int)this_00; } iVar12 = iVar12 + 1; } while (iVar12 < 8); if ((this_00 == (GridEntity_Door *)0x0) && (this_00 = (GridEntity_Door *)dimension, dimension == 0)) goto LAB_0074080d; } } LAB_00740722: pRVar7 = GetRoomByIdx(this,this->_currentRoomIndex,-1); iVar12 = *(int *)((int)this->_room + 8); if ((((iVar12 == 7) || (iVar12 == 8)) || ((this_00->_targetRoomIdx == this->_previousRoomIndex && ((local_1c == 7 || (local_1c == 8)))) )) && ((GridEntity_Door::TryBlowOpen(this_00,0,(Entity *)0x0), (pRVar7->Flags & 1) == 0 && ((this_00->_desc)._state != 1)))) { (this_00->_desc)._state = 1; GridEntity_Door::UpdateAnimation(this_00); iVar12 = this_00->_currentRoomType; if (((((iVar12 == 7) || (iVar10 = this_00->_targetRoomType, iVar10 == 7)) || (iVar12 == 8)) || ((iVar10 == 8 || (iVar12 == 0x1d)))) || (iVar10 == 0x1d)) { std::string::assign((this_00->_openAnimation)._buf,s_Open,4); } } game = g_game; if (((pRVar7->VisitedCount != 0) && (this_00->_targetRoomIdx == this->_previousRoomIndex)) && (iVar12 = (this_00->_desc)._variant, iVar12 != 4)) { if (iVar12 == 5) { qVar2 = g_game->_gameStateFlags; flagsPtr = (uint *)((int)&g_game->_gameStateFlags + 4); *flagsPtr = *flagsPtr | 0x20000; *(int *)&game->_gameStateFlags = (int)qVar2; } (this_00->_desc)._variant = 8; GridEntity_Door::UpdateAnimation(this_00); } LAB_0074080d: Game::UpdateVisibility((Game *)this); ExceptionList = local_10; return; } //@@ 00740860 Level::GetRandomRoomIndex /* WARNING: Removing unreachable block (ram,0x00740a0f) */ /* WARNING: Removing unreachable block (ram,0x00740933) */ /* WARNING: Removing unreachable block (ram,0x00740a21) */ /* WARNING: Removing unreachable block (ram,0x00740a31) */ /* WARNING: Removing unreachable block (ram,0x00740a37) */ /* ZHL [exact] __thiscall int Level::GetRandomRoomIndex(bool IAmErrorRoom, unsigned int Seed); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall Level::GetRandomRoomIndex(Level *this,byte IAmErrorRoom,uint Seed) { int iVar1; code *pcVar2; byte bVar3; int iVar4; uint uVar5; int *piVar6; uint *puVar7; undefined3 in_stack_00000005; uint *local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afdacd; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = (uint *)0x0; local_8 = 0; if ((IAmErrorRoom != 0) && (bVar3 = IsNextStageAvailable(this), bVar3 != 0)) { _IAmErrorRoom = 0xfffffffe; std::vector::_Emplace_reallocate(0,&IAmErrorRoom); if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); iVar4 = (*pcVar2)(); return iVar4; } uVar5 = Seed >> 2 ^ Seed; uVar5 = uVar5 << 0xf ^ uVar5; Seed = uVar5 >> 0x19 ^ uVar5; if (Seed == (Seed / 0x32) * 0x32) { _IAmErrorRoom = 0xfffffffa; std::vector::_Emplace_reallocate(0,&IAmErrorRoom); } } uVar5 = 0; puVar7 = local_1c; do { piVar6 = Game::GetRoomDescriptorsOffsetsArrayForDimension((Game *)this,-1); iVar4 = piVar6[uVar5]; if ((((-1 < iVar4) && (iVar1 = *(int *)((int)this->_room + 4), iVar4 != *(int *)(iVar1 + 8))) && (this->_roomList[iVar4].Dimension == this->_currentDimensionIdx)) && ((iVar4 = this->_roomList[iVar4].Group, iVar4 == -1 || (iVar4 == *(int *)(iVar1 + 0xb4))))) { _IAmErrorRoom = uVar5; if (puVar7 == (uint *)0x0) { std::vector::_Emplace_reallocate(0,&IAmErrorRoom); puVar7 = local_1c; } else { *puVar7 = uVar5; local_1c = puVar7 + 1; puVar7 = local_1c; } } uVar5 = uVar5 + 1; } while (uVar5 < 0xa9); if (Seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); iVar4 = (*pcVar2)(); return iVar4; } uVar5 = Seed >> 2 ^ Seed; uVar5 = uVar5 << 0xf ^ uVar5; if ((int)puVar7 >> 2 == 0) { uVar5 = 0; } else { uVar5 = (uVar5 >> 0x19 ^ uVar5) % (uint)((int)puVar7 >> 2); } ExceptionList = local_10; return *(int *)(uVar5 * 4); } //@@ 00740a60 Level::GetNonCompleteRoomIndex /* WARNING: Removing unreachable block (ram,0x00740b6e) */ /* WARNING: Removing unreachable block (ram,0x00740b7d) */ /* WARNING: Removing unreachable block (ram,0x00740b8d) */ /* WARNING: Removing unreachable block (ram,0x00740b93) */ /* ZHL [lua] Lua binding Level:GetNonCompleteRoomIndex */ int Level::GetNonCompleteRoomIndex(void) { byte bVar1; Level *in_ECX; int *piVar2; int iVar3; int *local_20; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afdafd; local_10 = ExceptionList; ExceptionList = &local_10; piVar2 = (int *)0x0; local_20 = (int *)0x0; local_8 = 0; local_14 = 0; if (0 < in_ECX->_roomCount) { do { if ((((in_ECX->_roomList[local_14].Flags & 1) == 0) && (in_ECX->_roomList[local_14].Dimension == in_ECX->_currentDimensionIdx)) && ((in_ECX->_roomList[local_14].Group == -1 || (in_ECX->_roomList[local_14].Group == *(int *)(*(int *)((int)in_ECX->_room + 4) + 0xb4)))) ) { if (*(int *)((int)in_ECX->_roomList[local_14].Data + 8) == 1) { ExceptionList = local_10; return in_ECX->_roomList[local_14].SafeGridIndex; } if (piVar2 == (int *)0x0) { std::vector::_Emplace_reallocate(0,&local_14); piVar2 = local_20; } else { *piVar2 = local_14; local_20 = piVar2 + 1; piVar2 = local_20; } } local_14 = local_14 + 1; } while (local_14 < in_ECX->_roomCount); } if ((int)piVar2 >> 2 == 0) { if (((in_ECX->_roomList[0x1fb].Flags & 1) == 0) || (bVar1 = IsNextStageAvailable(in_ECX), bVar1 == 0)) { iVar3 = -1; } else { iVar3 = -2; } } else { iVar3 = in_ECX->_roomList[iRam00000000].SafeGridIndex; } ExceptionList = local_10; return iVar3; } //@@ 00740bc0 Level::GetRoomByIdx /* ZHL [exact] __thiscall RoomDescriptor* Level::GetRoomByIdx(int32_t idx, int32_t dimension); prototype: REPENTOGON, confirmed by RET 8 */ RoomDescriptor * __thiscall Level::GetRoomByIdx(Level *this,int idx,int dimension) { RoomDescriptor *pRVar1; void **ppvVar2; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afdb31; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } if (dimension < 0) { dimension = this->_currentDimensionIdx; } if ((uint)dimension < 3) { if (idx == -100) { if (-1 < this->_currentRoomIndex) { pRVar1 = GetRoomByIdx(this,this->_currentRoomIndex,(uint)(dimension == 0)); ExceptionList = local_10; return pRVar1; } } else if (idx == -0x65) { if (-1 < this->_currentRoomIndex) { if (dimension == 0) { pRVar1 = GetRoomByIdx(this,0xa2,1); ExceptionList = local_10; return pRVar1; } iVar3 = 0; if (0 < this->_roomCount) { ppvVar2 = &this->_roomList[0].Data; do { if (((ppvVar2[-1] == (void *)0x0) && (*(int *)((int)*ppvVar2 + 8) == 1)) && (*(int *)((int)*ppvVar2 + 0x10) == 10)) { ExceptionList = local_10; return (RoomDescriptor *)(ppvVar2 + -4); } iVar3 = iVar3 + 1; ppvVar2 = ppvVar2 + 0x2e; } while (iVar3 < this->_roomCount); } } } else if (idx + 0x14U < 0xbd) { if (idx < 0) { ExceptionList = local_10; return (RoomDescriptor *)((int)this + idx * -0xb8 + 0x16bc4); } if ((uint)this->_roomMap[dimension * 0xa9 + idx] < 0x20f) { ExceptionList = local_10; return this->_roomList + this->_roomMap[dimension * 0xa9 + idx]; } } } ExceptionList = local_10; return &g_roomDescriptorDummy; } //@@ 00740da0 Level::GetRoomByIdx /* ZHL [lua] Lua binding Level:GetRoomByIdx prototype: REPENTOGON, confirmed by RET 8 */ RoomDescriptor * __thiscall Level::GetRoomByIdx(Level *this,int idx,int dimension) { RoomDescriptor *pRVar1; pRVar1 = GetRoomByIdx(this,idx,dimension); return pRVar1; } //@@ 00740db0 Game::GetCurrentRoomDesc /* ZHL [exact] __thiscall RoomDescriptor* Game::GetCurrentRoomDesc(); prototype: REPENTOGON, confirmed by RET 0 */ RoomDescriptor * __thiscall Game::GetCurrentRoomDesc(Game *this) { RoomDescriptor *pRVar1; pRVar1 = Level::GetRoomByIdx((Level *)this,this->_currentRoomIdx,this->_currentDimensionIdx); return pRVar1; } //@@ 00740dd0 Level::GetLastRoomDesc /* ZHL [lua] Lua binding Level:GetLastRoomDesc */ void Level::GetLastRoomDesc(void) { Level *in_ECX; GetRoomByIdx(in_ECX,in_ECX->_previousRoomIndex,in_ECX->_lastRoomDimensionIdx); return; } //@@ 00740df0 Level::GetRooms /* ZHL [lua] Lua binding Level:GetRooms */ void __thiscall Level::GetRooms(Level *this,int *param_2) { *param_2 = this->_roomCount; param_2[1] = (int)this->_roomList; return; } //@@ 00740e10 Level::generate_dungeon /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void Level::generate_dungeon(RNG * RNG); */ void __thiscall Level::generate_dungeon(Level *this,uint *param_2) { code *pcVar1; Level *pLVar2; byte bVar3; char isPlaced; uint uVar4; int iVar5; uint uVar6; uint uVar7; uint uVar8; Entity_Player *collectibleOwner; void *pvVar9; int **collectedRooms; int *roomIt; ChallengeParam *challengeParams; uint preventedCurses; uint extraout_ECX; uint extraout_ECX_00; int iVar10; int *piVar11; Level *curLevel; int *unaff_FS_OFFSET; bool bVar12; double roomCountDouble; undefined1 collectedTmp2 [12]; undefined1 collectedTmp [12]; void *stageRoomsBegin; undefined4 stageRoomsEnd; int stageRoomsCap; void *stageRooms2Begin; undefined4 local_444; int local_440; int *roomsBegin; int *roomsEnd; int roomsCap; uint *local_430; int *local_42c; uint local_428; int maxRoomDifficulty; uint local_420; int local_41c; char isStandardPath; int targetRoomCount; Level *self; uint local_40c; RoomDescriptor generator [3]; undefined1 auStack_150 [172]; undefined1 auStack_a4 [12]; int iStack_98; int iStack_94; undefined1 auStack_8c [23]; char cStack_75; LevelGenerator_Room aLStack_70 [2]; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; int local_5c [7]; void *pvStack_40; undefined4 local_3c; undefined4 uStack_38; uint uStack_34; undefined4 uStack_30; uint local_2c; uint local_24; undefined1 *puStack_20; int local_1c; undefined *puStack_18; int local_14; uint *rngPtr; puStack_20 = (undefined1 *)(local_5c + 0x16); local_14 = 0xffffffff; puStack_18 = &DAT_00afdb9f; local_1c = *unaff_FS_OFFSET; local_24 = __security_cookie ^ (uint)(local_5c + 0x13); *unaff_FS_OFFSET = (int)&local_1c; uVar4 = (this->_generationRNG)._seed; local_430 = param_2; local_428 = this->_stage; self = this; piVar11 = local_5c + 0x16; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (this->_generationRNG)._seed; piVar11 = (int *)puStack_20; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } puStack_20 = (undefined1 *)piVar11; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; (this->_generationRNG)._seed = uVar4; iVar5 = (int)(local_428 * 10) / 3 + 5 + (uVar4 & 1); iVar10 = 0x14; if (iVar5 < 0x14) { iVar10 = iVar5; } targetRoomCount = iVar10; if (((this->_stageType == 4) || (this->_stageType == 5)) && ((bVar3 = HasAbandonedMineshaft(this), bVar3 != 0 || (bVar3 = HasMirrorDimension(this), bVar3 != 0)))) { targetRoomCount = iVar10 + -3; } uVar4 = this->_curses; uVar8 = g_game->_debugCurses; uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); if ((~uVar7 & (uVar6 | uVar4 | uVar8) & 2) == 0) { uVar4 = self->_curses; uVar8 = g_game->_debugCurses; uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); if ((~uVar7 & (uVar6 | uVar4 | uVar8) & 4) != 0) { targetRoomCount = targetRoomCount + 4; } } else { roomCountDouble = (double)targetRoomCount; targetRoomCount = 0x2d; if ((int)(roomCountDouble * 1.8) < 0x2d) { targetRoomCount = (int)(roomCountDouble * 1.8); } } curLevel = self; if (g_game->_challenge == 0x15) { uVar4 = (self->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (curLevel->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(curLevel->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(curLevel->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(curLevel->_generationRNG)._shift3 & 0x1f) ^ uVar4; (curLevel->_generationRNG)._seed = uVar4; targetRoomCount = uVar4 % 5 + 0x28; } else { uVar4 = (self->_generationRNG)._seed; } if (curLevel->_stage == 0xc) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (curLevel->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(curLevel->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(curLevel->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(curLevel->_generationRNG)._shift3 & 0x1f) ^ uVar4; (curLevel->_generationRNG)._seed = uVar4; targetRoomCount = uVar4 % 5 + 0x32; } rngPtr = local_430; uVar4 = *local_430; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *rngPtr; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)rngPtr[1] & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rngPtr[2] & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_430[3] & 0x1f) ^ uVar4; *local_430 = uVar4; if (g_game->_difficulty == 1) { targetRoomCount = targetRoomCount + 2 + (uVar4 & 1); } iVar10 = curLevel->_curses; iVar5 = g_game->_debugCurses; uVar4 = Seeds::GetForcedCurses(); uVar8 = Seeds::GetPreventedCurses(); if ((char)(~(byte)uVar8 & ((byte)uVar4 | (byte)iVar10 | (byte)iVar5)) < '\0') { iVar10 = (targetRoomCount * 3) / 5; targetRoomCount = 4; if (4 < iVar10) { targetRoomCount = iVar10; } } local_430 = (uint *)0x0; uVar4 = self->_curses; local_40c = (local_428 != 1) + 5; uVar8 = g_game->_debugCurses; uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); curLevel = self; if ((~uVar7 & (uVar6 | uVar4 | uVar8) & 2) == 0) { uVar4 = local_40c; } else { uVar4 = (local_428 != 1) + 6; } uVar8 = uVar4 + 2; if (self->_stage != 0xc) { uVar8 = uVar4; } local_428 = uVar8; collectibleOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,599,(RNG **)&g_game->_playerManager,1); if (collectibleOwner != (Entity_Player *)0x0) { uVar8 = uVar8 + 1; local_428 = uVar8; } bVar3 = HasAbandonedMineshaft(curLevel); if ((bVar3 != 0) || (bVar3 = HasMirrorDimension(curLevel), bVar3 != 0)) { local_428 = uVar8 + 1; } uVar4 = (curLevel->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (curLevel->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(curLevel->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(curLevel->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(curLevel->_generationRNG)._shift3 & 0x1f) ^ uVar4; (curLevel->_generationRNG)._seed = uVar4; RoomDescriptor::Init(generator,uVar4); local_14 = 0; uVar4 = g_game->_debugCurses; local_41c = g_game->_difficulty; uVar8 = curLevel->_curses; uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); curLevel = self; if (((~uVar7 & (uVar6 | uVar4 | uVar8) & 2) == 0) && (local_40c = self->_stage, (int)local_40c < 9)) { if (local_41c == 1) { if ((local_40c & 1) == 0) { maxRoomDifficulty = 0xf; local_41c = 10; } else { maxRoomDifficulty = 10; local_41c = 5; } } else if ((local_40c & 1) == 0) { maxRoomDifficulty = 10; local_41c = 5; } else { maxRoomDifficulty = 5; local_41c = 1; } } else { local_40c = self->_stage; bVar12 = local_41c == 1; local_41c = (uint)bVar12 * 4 + 1; maxRoomDifficulty = 10; if (bVar12) { maxRoomDifficulty = 0xf; } } piVar11 = (int *)0x0; roomsBegin = (int *)0x0; roomsEnd = (int *)0x0; roomsCap = 0; local_14._0_1_ = 1; local_42c = (int *)RoomConfig::GetStageID(local_40c,self->_stageType,-1); if (local_40c == 0xc) { local_41c = 5; maxRoomDifficulty = 0xf; local_40c = 1; do { if (local_40c != 0xd) { local_420 = 0; RoomConfig::CollectRooms (&g_game->_roomConfig,&stageRooms2Begin,local_40c,1,0xd,0,0xffffffff,5,0xf, &local_420,-1,-1); local_14._0_1_ = 2; std::vector<4byte>::insert_range(piVar11,stageRooms2Begin,local_444,local_42c); local_14._0_1_ = 1; if (stageRooms2Begin != (void *)0x0) { uVar4 = (local_440 - (int)stageRooms2Begin >> 2) * 4; pvVar9 = stageRooms2Begin; if (0xfff < uVar4) { pvVar9 = *(void **)((int)stageRooms2Begin + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)stageRooms2Begin + (-4 - (int)pvVar9))) goto LAB_00741c6c; } operator_delete(pvVar9,uVar4); stageRooms2Begin = (void *)0x0; local_444 = 0; local_440 = 0; } piVar11 = roomsEnd; } local_40c = local_40c + 1; } while (local_40c < 0x12); } else { local_420 = 0; pvVar9 = RoomConfig::CollectRooms (&g_game->_roomConfig,collectedTmp,(uint)local_42c,1,0xd,0,0xffffffff, local_41c,maxRoomDifficulty,&local_420,-1,-1); local_14._0_1_ = 3; std::vector::assign(pvVar9); local_14._0_1_ = 1; FID_conflict__Tidy(collectedTmp); piVar11 = roomsEnd; } if ((uint)((int)piVar11 - (int)roomsBegin >> 2) < 0x14) { local_41c = 1; maxRoomDifficulty = 0xf; if (curLevel->_stage == 0xc) { uVar4 = 1; piVar11 = roomsBegin; do { if (uVar4 != 0xd) { local_420 = 0; roomsEnd = piVar11; RoomConfig::CollectRooms (&g_game->_roomConfig,&stageRoomsBegin,uVar4,1,0xd,0,0xffffffff,1,0xf,&local_420 ,-1,-1); local_14._0_1_ = 4; std::vector<4byte>::insert_range(roomsBegin,stageRoomsBegin,stageRoomsEnd,local_42c); local_14._0_1_ = 1; if (stageRoomsBegin != (void *)0x0) { uVar8 = (stageRoomsCap - (int)stageRoomsBegin >> 2) * 4; pvVar9 = stageRoomsBegin; if (0xfff < uVar8) { pvVar9 = *(void **)((int)stageRoomsBegin + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)stageRoomsBegin + (-4 - (int)pvVar9))) goto LAB_00741c6c; } operator_delete(pvVar9,uVar8); stageRoomsBegin = (void *)0x0; stageRoomsEnd = 0; stageRoomsCap = 0; } piVar11 = roomsBegin; } uVar4 = uVar4 + 1; } while (uVar4 < 0x12); piVar11 = roomsEnd; } else { local_420 = 0; collectedRooms = RoomConfig::CollectRooms (&g_game->_roomConfig,collectedTmp2,(uint)local_42c,1,0xd,0,0xffffffff,1,0xf, &local_420,-1,-1); local_14._0_1_ = 5; if (&roomsBegin != collectedRooms) { local_42c = *collectedRooms; local_40c = (int)collectedRooms[1] - (int)local_42c; if ((uint)(roomsCap - (int)roomsBegin >> 2) < (uint)((int)local_40c >> 2)) { std::vector::reserve_clear((int)local_40c >> 2); } piVar11 = roomsBegin; memmove(roomsBegin,local_42c,local_40c); piVar11 = (int *)((int)piVar11 + local_40c); roomsEnd = piVar11; } local_14._0_1_ = 1; FID_conflict__Tidy(collectedTmp2); } } local_2c = 0; local_5c[0] = 0; local_5c[1] = 0; local_5c[2] = 0; local_5c[3] = 0; local_5c[4] = 0; local_5c[5] = 0; local_5c[6] = 0; pvStack_40 = (void *)0x0; local_3c = 0; uStack_38 = 0; uStack_34 = 0; uStack_30 = 0; for (roomIt = roomsBegin; roomIt != piVar11; roomIt = roomIt + 1) { local_5c[*(int *)(*roomIt + 0x48)] = local_5c[*(int *)(*roomIt + 0x48)] + 1; } local_40c = 0; uVar4 = 0; do { if (0 < local_5c[uVar4]) { if (0xc < uVar4) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } generator[0]._doors[(uVar4 >> 5) - 8] = generator[0]._doors[(uVar4 >> 5) - 8] | 1 << ((byte)uVar4 & 0x1f); } uVar4 = uVar4 + 1; } while (uVar4 < 0xd); iVar10 = g_game->_debugCurses; iVar5 = curLevel->_curses; uVar4 = Seeds::GetForcedCurses(); uVar8 = Seeds::GetPreventedCurses(); if ((char)(~(byte)uVar8 & ((byte)uVar4 | (byte)iVar10 | (byte)iVar5)) < '\0') { local_40c = local_40c & 0xfffffff1; } curLevel = self; LAB_00741760: FUN_007382c0(); uVar4 = (int)local_430 + 1; bVar12 = 99 < local_430; local_430 = (uint *)uVar4; if (bVar12) { KAGE_LogMessage(0x10,(byte *)"failed to generate level too often, giving up\n"); } KAGE_LogMessage(1,(byte *)"generate...\n"); memset(auStack_150,0,0xa9); local_42c = (int *)g_game->_challenge; uVar4 = extraout_ECX; if ((local_42c == (int *)0x0) && ((g_game->_dailyChallenge)._id == 0)) { LAB_0074183e: isStandardPath = '\x01'; } else { if ((g_game->_dailyChallenge)._id == 0) { pvVar9 = (g_manager->_challengeParams)._begin; uVar4 = ((int)(g_manager->_challengeParams)._end - (int)pvVar9) / 0xa4 - 1; uVar8 = -(uint)(local_42c != (int *)0x0) & (uint)local_42c; if (uVar4 <= uVar8) { uVar8 = uVar4; } challengeParams = (ChallengeParam *)(uVar8 * 0xa4 + (int)pvVar9); } else { challengeParams = &(g_game->_dailyChallenge)._params; } isStandardPath = '\0'; if (challengeParams->_pathType == 3) goto LAB_0074183e; } if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { iVar10 = curLevel->_stage; if (iVar10 - 1U < 6) { uVar4 = 0; if ((g_game->_gameStateFlags & 0x1000000000000) != 0) goto LAB_00741921; } if ((curLevel->_stageType != 4) && (curLevel->_stageType != 5)) { if (iVar10 == 6) { LAB_007418cb: if ((isStandardPath != '\0') && (((g_manager->_persistentGameData)._achievements[0x27b] != 0 || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { local_444 = 6; local_440 = 5; FUN_009b1910(&local_444,uVar4); } } else if (iVar10 == 5) { uVar8 = g_game->_debugCurses; uVar6 = curLevel->_curses; uVar7 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); uVar4 = extraout_ECX_00; curLevel = self; if ((~preventedCurses & (uVar7 | uVar8 | uVar6) & 2) != 0) goto LAB_007418cb; } } } LAB_00741921: local_5c[5] = g_levelGenInvalidPos[0]; aLStack_70[0]._0_1_ = 1; uStack_68 = 6; uStack_64 = 6; uStack_60 = 0; local_5c[0] = 0; local_5c[1] = 1; local_5c[2] = 0; local_5c[3] = 0xffffffff; local_5c[4] = 0xffffffff; local_5c[6] = g_levelGenInvalidPos[1]; pvStack_40 = (void *)0x0; local_3c = 0; pvStack_40 = operator_new(0x14); *(void **)pvStack_40 = pvStack_40; *(void **)((int)pvStack_40 + 4) = pvStack_40; *(void **)((int)pvStack_40 + 8) = pvStack_40; *(undefined2 *)((int)pvStack_40 + 0xc) = 0x101; uStack_34 = uStack_34 & 0xffffff00; uStack_30 = 0; local_2c = local_2c & 0xffffff00; uStack_60 = _DAT_00c5d380; local_5c[0] = _DAT_00c5d384; local_14._0_1_ = 6; uVar4 = g_game->_debugCurses; uVar8 = curLevel->_curses; local_420 = CONCAT31(local_420._1_3_,curLevel->_stage == 0xc); uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); pLVar2 = self; iVar10 = targetRoomCount; if (((~uVar7 & (uVar6 | uVar4 | uVar8) & 2) == 0) && (g_game->_challenge != 0x15)) { bVar3 = 0; } else { bVar3 = 1; } LevelGenerator::Generate ((LevelGenerator *)generator,targetRoomCount,self->_stage == 0xb,bVar3,(byte)local_420, &local_40c,local_428,aLStack_70); local_14._0_1_ = 1; FID_conflict__Erase_tree_>_> (&pvStack_40,(fuzzer_allocator_> *)&pvStack_40, *(_Tree_node **)((int)pvStack_40 + 4)); operator_delete(pvStack_40,0x14); curLevel = pLVar2; if (cStack_75 == '\0') { KAGE_LogMessage(1,(byte *)"generated level is not usable\n"); goto LAB_00741760; } if (iStack_94 - iStack_98 >> 2 < (int)local_428) { KAGE_LogMessage(1,(byte *)"not enough dead ends (%d/%d)\n"); if (((9 < local_430) && (local_430 == (uint *)(((uint)local_430 / 5) * 5))) && (iVar10 < 0x40)) { targetRoomCount = iVar10 + 1; } goto LAB_00741760; } KAGE_LogMessage(1,(byte *)"placing rooms...\n"); curLevel = self; piVar11 = pLVar2->_roomMap; for (iVar10 = 0x1fb; iVar10 != 0; iVar10 = iVar10 + -1) { *piVar11 = -1; piVar11 = piVar11 + 1; } self->_roomCount = 0; isPlaced = place_special_rooms(generator,local_41c,maxRoomDifficulty); if (isPlaced == '\0') { reset_room_list(curLevel,0); goto LAB_00741760; } if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((iVar10 = curLevel->_stage, 5 < iVar10 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) && ((curLevel->_stageType == 4 || (curLevel->_stageType == 5)))) { if (iVar10 == 2) { LAB_00741b8d: generate_mirror_world(curLevel); goto LAB_00741c0b; } if (iVar10 == 1) { uVar4 = g_game->_debugCurses; uVar8 = curLevel->_curses; uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); curLevel = self; if ((~uVar7 & (uVar6 | uVar4 | uVar8) & 2) != 0) goto LAB_00741b8d; } } if ((((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || ((iVar10 = curLevel->_stage, iVar10 - 1U < 6 && ((g_game->_gameStateFlags & 0x1000000000000) != 0)))) || ((curLevel->_stageType != 4 && (curLevel->_stageType != 5)))) goto LAB_00741c0b; if (iVar10 != 4) { if (iVar10 != 3) goto LAB_00741c0b; uVar4 = g_game->_debugCurses; uVar8 = curLevel->_curses; uVar6 = Seeds::GetForcedCurses(); uVar7 = Seeds::GetPreventedCurses(); if ((~uVar7 & (uVar6 | uVar4 | uVar8) & 2) == 0) goto LAB_00741c0b; curLevel = self; } generate_mineshaft(curLevel); LAB_00741c0b: FUN_00745b70(); FUN_00421b50(); KAGE_LogMessage(1,(byte *)"Map Generated in %d Loops\n"); if (roomsBegin != (int *)0x0) { uVar4 = roomsCap - (int)roomsBegin & 0xfffffffc; piVar11 = roomsBegin; if (0xfff < uVar4) { piVar11 = (int *)roomsBegin[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)roomsBegin + (-4 - (int)piVar11))) { LAB_00741c6c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar11,uVar4); } FID_conflict__Tidy(auStack_8c); FID_conflict__Tidy(&iStack_98); vector_LevelGenerator_Room_tidy(auStack_a4); *unaff_FS_OFFSET = local_1c; return; } //@@ 00741cc0 FUN_00741cc0 void FUN_00741cc0(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 0x37c)); FID_conflict__Tidy((void *)(in_ECX + 0x370)); vector_LevelGenerator_Room_tidy((void *)(in_ECX + 0x364)); return; } //@@ 00741cf0 FUN_00741cf0 void FUN_00741cf0(void) { undefined4 *puVar1; Game *pGVar2; int in_ECX; int iVar3; int iVar4; uint uVar5; uint local_3c; int local_38; uint uStack_18; uVar5 = 0; iVar4 = *(int *)(in_ECX + 0x68); if (*(int *)(in_ECX + 0x6c) - iVar4 >> 5 != 0) { iVar3 = 0; do { if ((*(int *)(iVar3 + iVar4) == 0x10) || ((*(int *)(iVar3 + iVar4) == 0x12 && (*(int *)(iVar3 + 4 + iVar4) == 1)))) { puVar1 = (undefined4 *)(iVar3 + iVar4); *puVar1 = 0; puVar1[1] = 0; puVar1[2] = 0; puVar1[3] = 0; uStack_18 = uStack_18 & 0xffffff00; puVar1 = (undefined4 *)(iVar3 + 0x10 + iVar4); *puVar1 = 0x16a9de81; puVar1[1] = 0; puVar1[2] = uStack_18; puVar1[3] = 0x16a9de81; } uVar5 = uVar5 + 1; iVar4 = *(int *)(in_ECX + 0x68); iVar3 = iVar3 + 0x20; } while (uVar5 < (uint)(*(int *)(in_ECX + 0x6c) - iVar4 >> 5)); } pGVar2 = g_game; local_38 = *(int *)(in_ECX + 0x74); local_3c = 0; iVar3 = *(int *)(in_ECX + 0x78) - local_38; iVar4 = iVar3 >> 0x1f; if (iVar3 / 0x78 + iVar4 != iVar4) { iVar4 = 0; do { if (*(int *)(iVar4 + local_38) == 5) { iVar3 = *(int *)(iVar4 + 4 + local_38); if (iVar3 == 0x15e) { if (((g_manager->_persistentGameData)._achievements[0x19f] != 0) || (((g_manager->_state == 2 && (pGVar2 != (Game *)0x0)) && (((pGVar2->_dailyChallenge)._id != 0 || (pGVar2->_isDebug != 0)))))) { *(undefined4 *)(iVar4 + 4 + local_38) = 300; *(undefined4 *)(iVar4 + 8 + local_38) = 0x4e; } } else if (iVar3 == 100) { *(undefined1 *)(iVar4 + 0x23 + local_38) = 0; } } local_38 = *(int *)(in_ECX + 0x74); iVar4 = iVar4 + 0x78; local_3c = local_3c + 1; } while (local_3c < (uint)((*(int *)(in_ECX + 0x78) - local_38) / 0x78)); } return; } //@@ 00741e60 Level::place_rooms_backwards /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON Level.zhl signature (LevelGenerator*, BackwardsStageDesc*, stage, minDifficulty, maxDifficulty); reads desc +0x310 boss count, +0x314 treasure count; only caller Level::generate_backwards 0x7434b3 (was Level::generate_boss_room: with no saved boss it draws one); notes/systems/ascent.md prototype: REPENTOGON, confirmed by RET 20 */ byte __thiscall Level::place_rooms_backwards (Level *this,LevelGenerator *levelGen,BackwardsStageDesc *backwardsStage,uint stage, uint minDifficulty,uint maxDifficulty) { std_set *restrictedIndexes; RNG *rng; code *pcVar2; byte bVar3; uint uVar4; uint roomSeed; void *pvVar5; int iVar6; LevelGenerator_Room *pLVar7; undefined3 extraout_var; RoomConfig_Room *roomData; void *extraout_ECX; void *extraout_ECX_00; void *extraout_ECX_01; RoomDescriptor *roomDesc; LevelGenerator_Room wantedShape; void **savedRoomCursor; RoomConfig *roomConfig; LevelGenerator_Room *room; int *piVar8; void *pvVar9; RoomDescriptor **outDesc; int *allRooms; int *allRoomsEnd; uint reserveCount; void *bossRoomConfig; void **savedBossRoom; uint local_64; LevelGenerator *local_60; size_t local_5c; void *local_58; void **local_54; void **local_50; BackwardsStageDesc *local_4c; RoomDescriptor *local_48; LevelGenerator_Room local_44; LevelGenerator_Room local_40; LevelGenerator_Room *local_3c; RoomConfig *local_38; RoomConfig_Room *local_34; void *stageName [3]; undefined8 local_24; uint stageNameCapacity; uint stackCookie; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afdc65; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(stageName + 0xb); ExceptionList = &local_10; local_64 = stage; local_34 = (RoomConfig_Room *)maxDifficulty; iVar6 = backwardsStage->_bossRoomsCount; local_60 = levelGen; local_4c = backwardsStage; stackCookie = uVar4; if (iVar6 == 0) { local_40 = (LevelGenerator_Room) BossPool::GetBossId(&g_game->_bossPool,this->_stage,this->_stageType, (RNG *)&g_game->_bossPool); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ roomSeed; (this->_generationRNG)._seed = roomSeed; pvVar5 = pick_boss_room_config((int)local_40,roomSeed); if (pvVar5 == (void *)0x0) { KAGE_LogMessage(1,(byte *) "[warn] could not find matching boss room (boss id: %d) for the current stage\n" ); } else { local_50 = (void **)LevelGenerator::place_boss_room (*(undefined4 *)((int)pvVar5 + 0x48),(int)pvVar5 + 0x38,0); if (local_50 != (void **)0x0) { outDesc = (RoomDescriptor **)0x0; pvVar9 = extraout_ECX; roomSeed = RNG::Next(&this->_generationRNG); place_room(this,local_50,pvVar5,roomSeed,pvVar9,outDesc); iVar6 = this->_roomCount; this->_roomList[iVar6 + -1].Flags = 1; this->_roomList[iVar6 + -1].VisitedCount = 1; this->_lastBossRoomListIndex = this->_roomCount + -1; goto LAB_00742289; } } LAB_00741f41: bVar3 = 0; } else { local_5c = iVar6 - 1; if (-1 < (int)local_5c) { local_50 = (void **)(backwardsStage->_bossRooms[1]._doors + iVar6 * 3 + 0x24); savedBossRoom = &backwardsStage->_bossRooms[iVar6 + -1].SavedEntities._end; pLVar7 = (LevelGenerator_Room *)0xffffffff; do { bossRoomConfig = get_room_config_from_saved_id(this,(uint *)local_50,(void *)0x0); local_40 = *(LevelGenerator_Room *)((int)bossRoomConfig + 0x48); if ((int)pLVar7 < 0) { pvVar5 = (void *)LevelGenerator::place_boss_room(local_40,(int)bossRoomConfig + 0x38,0); local_40 = (LevelGenerator_Room)pvVar5; } else { LevelGenerator::get_neighbor_candidates (levelGen,&local_24,*(uint *)((int)levelGen[0xd9] + 4 + (int)pLVar7 * 0x48),1); local_8 = (void *)0x0; if ((LevelGenerator_Room *)local_24 != local_24._4_4_) { pLVar7 = local_24._4_4_; wantedShape = local_40; room = (LevelGenerator_Room *)local_24; do { if (room[6] == wantedShape) { bVar3 = LevelGenerator::can_place_room(levelGen,(int *)(room + 2),(int)room[6]); if ((bVar3 != 0) && (iVar6 = LevelGenerator::count_neighbor_rooms(levelGen,(int *)(room + 10)), iVar6 < 2)) { LevelGenerator::update_room_neighbors(levelGen,room); local_44 = (LevelGenerator_Room) ((uint)room[7] & *(uint *)((int)bossRoomConfig + 0x38)); if (local_44 == room[7]) { bVar3 = LevelGenerator::place_room(levelGen,room); pvVar5 = (void *)CONCAT31(extraout_var,bVar3); local_8 = (void *)0xffffffff; local_40 = (LevelGenerator_Room)pvVar5; vector_LevelGenerator_Room_tidy(&local_24); goto LAB_007420be; } } pLVar7 = local_24._4_4_; wantedShape = local_40; } room = room + 0x12; } while (room != pLVar7); } pvVar5 = (void *)0x0; local_8 = (void *)0xffffffff; local_40 = (LevelGenerator_Room)0x0; vector_LevelGenerator_Room_tidy(&local_24); } LAB_007420be: if (pvVar5 == (void *)0x0) goto LAB_00741f41; roomSeed = (this->_generationRNG)._seed; local_3c = *(LevelGenerator_Room **)((int)pvVar5 + 4); if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; pvVar9 = (void *)(this->_generationRNG)._shift3; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)pvVar9 & 0x1f) ^ roomSeed; (this->_generationRNG)._seed = roomSeed; place_room(this,pvVar5,bossRoomConfig,roomSeed,pvVar9,(RoomDescriptor **)0x0); savedRoomCursor = savedBossRoom; local_44 = (LevelGenerator_Room)0x1; local_38 = (RoomConfig *)(this->_roomList + this->_roomCount + -1); *(uint *)&local_38->field_0x44 = (uint)savedBossRoom[-0xd] | 1; pLVar7 = &local_44; if (*(LevelGenerator_Room *)(savedBossRoom + -0xe) != (LevelGenerator_Room)0x0) { pLVar7 = (LevelGenerator_Room *)(savedBossRoom + -0xe); } local_44 = (LevelGenerator_Room)&local_38->field_0x68; *(LevelGenerator_Room *)&local_38->field_0x40 = *pLVar7; if (local_44 != (LevelGenerator_Room)(savedBossRoom + -4)) { local_48 = savedBossRoom[-4]; local_54 = (void **)((int)savedBossRoom[-3] - (int)local_48); local_58 = ((std_vector *)local_44)->_begin; reserveCount = (int)local_54 >> 5; if ((uint)((int)*(void **)&local_38->field_0x70 - (int)local_58 >> 5) < reserveCount) { std::vector<32byte>::_Clear_and_reserve_geometric(reserveCount); local_58 = *(void **)local_44; } memmove(local_58,local_48,(size_t)local_54); *(void **)((int)local_44 + 4) = (void *)((int)local_54 + (int)local_58); } if ((std_vector *)&local_38->field_0x74 != (std_vector *)(savedRoomCursor + -1)) { std::vector::assign (((std_vector *)(savedRoomCursor + -1))->_begin,*savedRoomCursor,local_34); } local_48 = (RoomDescriptor *)(savedRoomCursor + 2); restrictedIndexes = (std_set *)&local_38->field_0x80; if ((RoomDescriptor *)restrictedIndexes != local_48) { pvVar5 = restrictedIndexes->_head; FID_conflict__Erase_tree_>_> (restrictedIndexes,(fuzzer_allocator_> *)restrictedIndexes, *(_Tree_node **)((int)pvVar5 + 4)); *(void **)((int)pvVar5 + 4) = pvVar5; *(void **)pvVar5 = pvVar5; *(void **)((int)pvVar5 + 8) = pvVar5; *(uint *)&local_38->field_0x84 = 0; std_set_uint_copy((std_set *)&local_38->field_0x80,local_48,(int)local_34); savedRoomCursor = savedBossRoom; } if ((std_vector *)&local_38->field_0x88 != (std_vector *)(savedRoomCursor + 4)) { std::vector::assign(savedRoomCursor[4],savedRoomCursor[5],local_34); } piVar8 = (int *)((int)bossRoomConfig + 0x38); *(int *)&local_38->field_0x18 = *piVar8; FUN_00741cf0(); LevelGenerator::block_unused_door_cells(local_40,piVar8); local_5c = local_5c - 1; local_50 = local_50 + -3; savedBossRoom = savedBossRoom + -0x2e; this->_lastBossRoomListIndex = this->_roomCount + -1; pLVar7 = local_3c; } while (-1 < (int)local_5c); LAB_00742289: } iVar6 = local_4c->_treasureRoomsCount; local_58 = (void *)(iVar6 + -1); if (-1 < (int)local_58) { local_54 = (void **)(local_4c->_treasureRooms[1]._doors + iVar6 * 3 + 0x24); savedRoomCursor = &local_4c->_bossRooms[iVar6 + 1].SavedEffects._capacity; do { pvVar5 = get_room_config_from_saved_id(this,(uint *)local_54,(void *)0x0); local_3c = LevelGenerator::GetNewEndRoom (local_60,*(int *)((int)pvVar5 + 0x48),(uint *)((int)pvVar5 + 0x38)); if (local_3c == (LevelGenerator_Room *)0x0) goto LAB_00741f41; roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; pvVar9 = (void *)(this->_generationRNG)._shift3; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)pvVar9 & 0x1f) ^ roomSeed; (this->_generationRNG)._seed = roomSeed; place_room(this,local_3c,pvVar5,roomSeed,pvVar9,(RoomDescriptor **)0x0); roomDesc = this->_roomList + this->_roomCount + -1; roomDesc->Flags = (int)savedRoomCursor[-0xd]; roomDesc->VisitedCount = (int)savedRoomCursor[-0xe]; local_48 = roomDesc; if (&roomDesc->SavedGridEntities != (std_vector *)(savedRoomCursor + -4)) { local_3c = savedRoomCursor[-4]; local_5c = (int)savedRoomCursor[-3] - (int)local_3c; local_44 = (LevelGenerator_Room)(roomDesc->SavedGridEntities)._begin; local_50 = (void **)((int)local_5c >> 5); if ((undefined1 *)((int)(roomDesc->SavedGridEntities)._capacity - (int)local_44 >> 5) < local_50) { std::vector<32byte>::_Clear_and_reserve_geometric(local_50); local_44 = (LevelGenerator_Room)(roomDesc->SavedGridEntities)._begin; } memmove((void *)local_44,local_3c,local_5c); (roomDesc->SavedGridEntities)._end = (void *)(local_5c + (int)local_44); } if (&roomDesc->SavedEntities != (std_vector *)(savedRoomCursor + -1)) { std::vector::assign(savedRoomCursor[-1],*savedRoomCursor,local_34); } restrictedIndexes = &roomDesc->RestrictedGridIndexes; if (restrictedIndexes != (std_set *)(savedRoomCursor + 2)) { pvVar5 = restrictedIndexes->_head; FID_conflict__Erase_tree_>_> (restrictedIndexes,(fuzzer_allocator_> *)restrictedIndexes, *(_Tree_node **)((int)pvVar5 + 4)); roomDesc = local_48; *(void **)((int)pvVar5 + 4) = pvVar5; *(void **)pvVar5 = pvVar5; *(void **)((int)pvVar5 + 8) = pvVar5; (local_48->RestrictedGridIndexes)._size = 0; std_set_uint_copy(&local_48->RestrictedGridIndexes,savedRoomCursor + 2,(int)local_34); } if (&roomDesc->SavedEffects != (std_vector *)(savedRoomCursor + 4)) { std::vector::assign(savedRoomCursor[4],savedRoomCursor[5],local_34); } FUN_00741cf0(); savedRoomCursor = savedRoomCursor + -0x2e; local_58 = (void *)((int)local_58 + -1); local_54 = local_54 + -3; } while (-1 < (int)local_58); levelGen = local_60; } LevelGenerator::get_all_rooms(levelGen,&allRooms); local_8 = (void *)0x1; piVar8 = allRooms; if (allRooms != allRoomsEnd) { do { iVar6 = *piVar8; if (((*(int *)(iVar6 + 8) == DAT_00c5d088) && (*(int *)(iVar6 + 0xc) == DAT_00c5d08c)) && (*(int *)(iVar6 + 0x40) == 0)) { local_3c = (LevelGenerator_Room *)(iVar6 + 0x1c); roomSeed = (this->_generationRNG)._seed; roomConfig = &g_game->_roomConfig; local_48 = *(RoomDescriptor **)(iVar6 + 0x18); if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ roomSeed; (this->_generationRNG)._seed = roomSeed; roomData = RoomConfig::GetRandomRoom (roomConfig,roomSeed,1,0x24,1,(int)local_48,0,-1,0,0,(uint *)local_3c ,0,-1); pvVar5 = extraout_ECX_00; if (roomData == (RoomConfig_Room *)0x0) { LAB_007428f6: bVar3 = 0; goto LAB_00742bdc; } } else { local_3c = (LevelGenerator_Room *)(iVar6 + 0x1c); roomSeed = (this->_generationRNG)._seed; roomConfig = &g_game->_roomConfig; local_48 = *(RoomDescriptor **)(iVar6 + 0x18); if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ roomSeed; (this->_generationRNG)._seed = roomSeed; roomData = RoomConfig::GetRandomRoom (roomConfig,roomSeed,1,0x24,1,(int)local_48,0,-1,1,(int)local_34, (uint *)local_3c,local_64,-1); pvVar5 = extraout_ECX_01; if (roomData == (RoomConfig_Room *)0x0) { FUN_008295c0(); RoomConfigStage::GetDisplayName ((RoomConfig_Stage *)&(g_game->_roomConfig).field_0x1b90, (std_string *)stageName,0x14); local_8 = (void *)CONCAT31(local_8._1_3_,2); KAGE_LogMessage(1,(byte *)"failed to get room %s %s %d\n"); if (0xf < stageNameCapacity) { uVar4 = stageNameCapacity + 1; pvVar5 = stageName[0]; if (0xfff < uVar4) { pvVar5 = *(void **)((int)stageName[0] + -4); uVar4 = stageNameCapacity + 0x24; if (0x1f < (uint)((int)stageName[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar4); } goto LAB_007428f6; } } place_room(this,(void *)*piVar8,roomData,(this->_generationRNG)._seed,pvVar5, (RoomDescriptor **)0x0); piVar8 = piVar8 + 1; } while (piVar8 != allRoomsEnd); } pvVar5 = ThreadLocalStoragePointer; local_38 = &g_game->_roomConfig; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard,uVar4), g_invalidRoomDescriptorGuard == -1 )) { local_8._0_1_ = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x1fc; } rng = &this->_generationRNG; Seeds::Init3((Seeds *)roomDesc,rng); uVar4 = rng->_seed; local_34 = (RoomConfig_Room *)0x0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; local_34 = RoomConfig::GetRandomRoom (local_38,uVar4,1,0,3,0xd,0,-1,1,10,(uint *)&local_34,0xffffffff,-1); iVar6 = *(int *)pvVar5; if (*(int *)(iVar6 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { local_8._0_1_ = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } iVar6 = *(int *)pvVar5; } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x1fc; } roomDesc->Data = local_34; if ((*(int *)(iVar6 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x200; } Seeds::Init3((Seeds *)roomDesc,rng); uVar4 = rng->_seed; local_34 = (RoomConfig_Room *)0x0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; local_34 = RoomConfig::GetRandomRoom (local_38,uVar4,1,0,0x16,0xd,0,-1,1,10,(uint *)&local_34,0xffffffff,0); iVar6 = *(int *)pvVar5; if (*(int *)(iVar6 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { local_8._0_1_ = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } iVar6 = *(int *)pvVar5; } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x200; } roomDesc->Data = local_34; if ((*(int *)(iVar6 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x1fe; } Seeds::Init3((Seeds *)roomDesc,rng); uVar4 = rng->_seed; local_34 = (RoomConfig_Room *)0x0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; local_34 = RoomConfig::GetRandomRoom (local_38,uVar4,1,0,0x10,0xd,0,-1,1,10,(uint *)&local_34,0xffffffff,0); if ((*(int *)(*(int *)pvVar5 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x1fe; } roomDesc->Data = local_34; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_4c = (BackwardsStageDesc *)0x1; } else { local_4c = (BackwardsStageDesc *)0x2; } if (((g_manager->_persistentGameData)._achievements[0x99] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_60 = (LevelGenerator *)0x1; } else { local_60 = (LevelGenerator *)0x2; } if (((g_manager->_persistentGameData)._achievements[0x9a] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_4c = (BackwardsStageDesc *)((int)&local_4c->_bossRooms[0].GridIndex + 1); } uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; local_24._0_1_ = '\x03'; local_24._1_1_ = '\0'; local_24._2_1_ = '\0'; local_24._3_1_ = '\0'; local_24._4_4_ = (LevelGenerator_Room *)0x3; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; local_64 = 0x1a; rng->_seed = uVar4; pvVar5 = ThreadLocalStoragePointer; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar4 = uVar4 >> 3 ^ uVar4; uVar4 = uVar4 << 3 ^ uVar4; uVar4 = uVar4 >> 0x1a ^ uVar4; local_34 = (RoomConfig_Room *)(uVar4 % (uint)local_4c); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar4 = uVar4 >> 3 ^ uVar4; uVar4 = uVar4 << 3 ^ uVar4; local_34 = (RoomConfig_Room *) ((int)&local_34->StageId + (uVar4 >> 0x1a ^ uVar4) % (uint)local_60); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x207; } Seeds::Init3((Seeds *)roomDesc,rng); uVar4 = rng->_seed; local_3c = (LevelGenerator_Room *)0x0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; local_34 = RoomConfig::GetRandomRoom (local_38,uVar4,1,0,2,0xd,0,-1,1,10,(uint *)&local_3c,(uint)local_34,-1); if ((*(int *)(*(int *)pvVar5 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x207; } roomDesc->Data = local_34; uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; iVar6 = *(int *)pvVar5; rng->_seed = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; if ((*(int *)(iVar6 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (void *)CONCAT31(local_8._1_3_,1); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x20c; } Seeds::Init3((Seeds *)roomDesc,rng); uVar4 = rng->_seed; local_34 = (RoomConfig_Room *)0x0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; roomData = RoomConfig::GetRandomRoom (local_38,uVar4,1,0,0xf,0xd,0,-1,1,10,(uint *)&local_34,1,-1); if ((*(int *)(*(int *)pvVar5 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8 = (void *)CONCAT31(local_8._1_3_,0xc); RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } if ((uint)this->_currentDimensionIdx < 3) { roomDesc = this->_roomList + 0x20c; } else { roomDesc = &g_roomDescriptorDummy; } roomDesc->Data = roomData; bVar3 = 1; LAB_00742bdc: FID_conflict__Tidy(&allRooms); } ExceptionList = local_10; return bVar3; } //@@ 00742ef0 Level::generate_backwards /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Level::Init 0x7453ad on stages 1-6 with game state flag 0x30 (the Ascent); 14/12 - depth rooms from stb 0x24, place_rooms_backwards; notes/systems/ascent.md */ void Level::generate_backwards(void) { code *pcVar1; Level *this; uint uVar2; int **collectedRooms; void *fallbackRooms; Level *in_ECX; int *piVar3; int iVar4; int iVar5; int *unaff_FS_OFFSET; undefined1 local_450 [12]; undefined1 local_444 [16]; Level *local_434; int *candidateRooms; int *candidateRoomsEnd; int candidateRoomsCapacity; BackwardsStageDesc *backwardsStage; Game *local_420; int *candidateRoomsBegin; int targetRoomCount; int *local_414; uint local_410; byte isPlaced; RoomDescriptor generator [3]; undefined1 auStack_150 [172]; undefined1 auStack_a4 [12]; int deadEndsBegin; int deadEndsEnd; undefined1 auStack_8c [23]; char isLevelUsable; LevelGenerator_Room startRoom [2]; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; int local_5c [7]; void *pvStack_40; undefined4 local_3c; undefined4 uStack_38; uint uStack_34; undefined4 uStack_30; uint local_2c; uint local_24; undefined1 *puStack_20; int local_1c; undefined *puStack_18; int local_14; bool isAltPath; puStack_20 = (undefined1 *)(local_5c + 0x16); local_14 = 0xffffffff; puStack_18 = &DAT_00afdcc9; local_1c = *unaff_FS_OFFSET; local_24 = __security_cookie ^ (uint)(local_5c + 0x13); *unaff_FS_OFFSET = (int)&local_1c; if ((in_ECX->_stageType == 4) || (in_ECX->_stageType == 5)) { isAltPath = true; } else { isAltPath = false; } local_420 = g_game; iVar4 = in_ECX->_stage + 1; if (!isAltPath) { iVar4 = in_ECX->_stage; } local_434 = in_ECX; if ((iVar4 < 1) || (piVar3 = local_5c + 0x16, 7 < iVar4)) { KAGE_LogMessage(0x10,(byte *)"Invalid backwards path stage ID"); piVar3 = (int *)puStack_20; } puStack_20 = (undefined1 *)piVar3; backwardsStage = (BackwardsStageDesc *) (local_420->_glowingHourglassStates[1]._eventCounters + iVar4 * 200 + 0x17b); targetRoomCount = -iVar4 + 0xe; if (g_game->_difficulty != 1) { targetRoomCount = -iVar4 + 0xc; } if (backwardsStage->_isXL != 0) { in_ECX->_curses = in_ECX->_curses | 2; targetRoomCount = targetRoomCount + 6; } uVar2 = (in_ECX->_generationRNG)._seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (in_ECX->_generationRNG)._seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar2; (in_ECX->_generationRNG)._seed = uVar2; RoomDescriptor::Init(generator,uVar2); local_420 = (Game *)0xa; if (g_game->_difficulty == 1) { local_420 = (Game *)0xf; } candidateRoomsBegin = (int *)0x0; candidateRooms = (int *)0x0; candidateRoomsEnd = (int *)0x0; candidateRoomsCapacity = 0; local_14 = 1; local_414 = (int *)0x0; collectedRooms = RoomConfig::CollectRooms (&g_game->_roomConfig,local_444,0x24,1,0xd,0,0xffffffff,1,(int)local_420, (uint *)&local_414,-1,-1); local_14._0_1_ = 2; if (&candidateRooms != collectedRooms) { local_414 = *collectedRooms; local_410 = (int)collectedRooms[1] - (int)local_414; piVar3 = (int *)0x0; if ((int)local_410 >> 2 != 0) { std::vector::reserve_clear((int)local_410 >> 2); candidateRoomsBegin = candidateRooms; piVar3 = candidateRooms; } memmove(piVar3,local_414,local_410); candidateRoomsEnd = (int *)(local_410 + (int)piVar3); } local_14._0_1_ = 1; FID_conflict__Tidy(local_444); local_410 = 0; if ((backwardsStage->_stageType == 4) || (backwardsStage->_stageType == 5)) { switch(in_ECX->_stage) { case 1: case 2: local_410 = 0x1b; break; case 3: case 4: local_410 = 0x1d; break; case 5: case 6: local_410 = 0x1f; break; default: goto switchD_0074313d_default; } } else { switch(in_ECX->_stage) { case 1: case 2: local_410 = 1; break; case 3: case 4: local_410 = 4; break; case 5: case 6: local_410 = 7; break; default: goto switchD_0074313d_default; } } switchD_0074313d_default: uVar2 = local_410; if ((uint)((int)candidateRoomsEnd - (int)candidateRoomsBegin >> 2) < 0x14) { local_420 = (Game *)0xf; local_414 = (int *)0x0; fallbackRooms = RoomConfig::CollectRooms (&g_game->_roomConfig,local_450,0x24,1,0xd,0,0xffffffff,1,0xf,(uint *)&local_414, -1,-1); local_14._0_1_ = 3; std::vector::assign(fallbackRooms); local_14._0_1_ = 1; FID_conflict__Tidy(local_450); candidateRoomsBegin = candidateRooms; } local_414 = (int *)0x0; local_2c = 0; local_5c[0] = 0; local_5c[1] = 0; local_5c[2] = 0; local_5c[3] = 0; local_5c[4] = 0; local_5c[5] = 0; local_5c[6] = 0; pvStack_40 = (void *)0x0; local_3c = 0; uStack_38 = 0; uStack_34 = 0; uStack_30 = 0; for (piVar3 = candidateRoomsBegin; piVar3 != candidateRoomsEnd; piVar3 = piVar3 + 1) { if (*(uint *)(*piVar3 + 0x10) == uVar2) { local_5c[*(int *)(*piVar3 + 0x48)] = local_5c[*(int *)(*piVar3 + 0x48)] + 1; } } uVar2 = 0; do { if (0 < local_5c[uVar2]) { if (0xc < uVar2) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } generator[0]._doors[(uVar2 >> 5) - 10] = generator[0]._doors[(uVar2 >> 5) - 10] | 1 << ((byte)uVar2 & 0x1f); } uVar2 = uVar2 + 1; } while (uVar2 < 0xd); in_ECX->_startingRoomIndex = 0x54; isPlaced = 1; iVar4 = 0; LAB_00743295: do { iVar5 = iVar4 + 1; if (99 < iVar4) { KAGE_LogMessage(0x10,(byte *)"failed to generate level too often, giving up\n"); } KAGE_LogMessage(1,(byte *)"generate...\n"); memset(auStack_150,0,0xa9); local_5c[5] = g_levelGenInvalidPos[0]; startRoom[0]._0_1_ = 1; uStack_68 = 6; uStack_64 = 6; uStack_60 = 0; local_5c[0] = 0; local_5c[1] = 1; local_5c[2] = 0; local_5c[3] = 0xffffffff; local_5c[4] = 0xffffffff; local_5c[6] = g_levelGenInvalidPos[1]; pvStack_40 = (void *)0x0; local_3c = 0; pvStack_40 = operator_new(0x14); *(void **)pvStack_40 = pvStack_40; *(void **)((int)pvStack_40 + 4) = pvStack_40; *(void **)((int)pvStack_40 + 8) = pvStack_40; *(undefined2 *)((int)pvStack_40 + 0xc) = 0x101; uStack_34 = uStack_34 & 0xffffff00; uStack_30 = 0; local_2c = local_2c & 0xffffff00; uStack_60 = _DAT_00c5d380; local_5c[0] = _DAT_00c5d384; local_14._0_1_ = 4; LevelGenerator::Generate ((LevelGenerator *)generator,targetRoomCount,0,0,0,(uint *)&local_414,2,startRoom); local_14._0_1_ = 1; FID_conflict__Erase_tree_>_> (&pvStack_40,(fuzzer_allocator_> *)&pvStack_40, *(_Tree_node **)((int)pvStack_40 + 4)); operator_delete(pvStack_40,0x14); iVar4 = iVar5; if (isLevelUsable == '\0') { KAGE_LogMessage(1,(byte *)"generated level is not usable\n"); } else { if (1 < deadEndsEnd - deadEndsBegin >> 2) { KAGE_LogMessage(1,(byte *)"placing rooms...\n"); this = local_434; piVar3 = in_ECX->_roomMap; for (iVar5 = 0x1fb; iVar5 != 0; iVar5 = iVar5 + -1) { *piVar3 = -1; piVar3 = piVar3 + 1; } local_434->_roomCount = 0; isPlaced = place_rooms_backwards (local_434,(LevelGenerator *)generator,backwardsStage,local_410,1, (uint)local_420); if (isPlaced != 0) goto LAB_0074341a; reset_room_list(this,0); in_ECX = this; goto LAB_00743295; } KAGE_LogMessage(1,(byte *)"not enough dead ends (%d/%d)\n"); if (((9 < iVar5) && (iVar5 == (iVar5 / 5) * 5)) && (targetRoomCount < 0x40)) { targetRoomCount = targetRoomCount + 1; } } if (isPlaced != 0) { LAB_0074341a: KAGE_LogMessage(1,(byte *)"Map Generated in %d Loops\n"); if (candidateRoomsBegin != (int *)0x0) { uVar2 = candidateRoomsCapacity - (int)candidateRoomsBegin & 0xfffffffc; piVar3 = candidateRoomsBegin; if (0xfff < uVar2) { piVar3 = (int *)candidateRoomsBegin[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)candidateRoomsBegin + (-4 - (int)piVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar3,uVar2); } FID_conflict__Tidy(auStack_8c); FID_conflict__Tidy(&deadEndsBegin); vector_LevelGenerator_Room_tidy(auStack_a4); *unaff_FS_OFFSET = local_1c; return; } } while( true ); } //@@ 00743550 Level::generate_greed /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? the greed generator per the round 7 agent that renamed 0073e0a0 Level::load_room Level::load_room */ void Level::generate_greed(void) { void *unused; code *pcVar1; byte bVar2; uint uVar3; void *pvVar4; void *pvVar5; void *slot; RoomConfig_Room *pRVar6; RoomConfig_Room *pRVar7; int iVar8; uint rngResult; uint *puVar9; Level *in_ECX; undefined4 extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int extraout_ECX_05; int iVar10; RoomDescriptor *roomDesc; RoomConfig *roomConfig; int *piVar11; int *unaff_FS_OFFSET; RoomConfig_Room *roomDesc; int iVar13; int iVar14; uint minVariant; int iVar15; int iVar16; int iVar17; void *treasureRoomB; void *treasureRoomA; void *treasureSlotA; RoomConfig_Room *pRStack_3c8; RoomConfig_Room *local_3c4; RoomConfig_Room *pRStack_3c0; void *pvStack_3bc; void *pvStack_3b8; RoomConfig *roomConfigLocal; RoomConfig_Room *pRStack_3b0; RoomDescriptor aRStack_3ac [4]; int aiStack_48 [2]; int iStack_40; undefined1 auStack_3c [12]; undefined1 auStack_30 [28]; uint local_14; int local_10; undefined *puStack_c; undefined4 uStack_8; RNG *rng; uStack_8 = 0xffffffff; puStack_c = &DAT_00afdd93; local_10 = *unaff_FS_OFFSET; local_14 = __security_cookie ^ (uint)(auStack_30 + 0x2c); *unaff_FS_OFFSET = (int)&local_10; rng = &in_ECX->_generationRNG; roomConfig = &g_game->_roomConfig; roomConfigLocal = roomConfig; if (in_ECX->_stage < 7) { local_3c4 = (RoomConfig_Room *)RoomConfig::GetStageID(in_ECX->_stage,in_ECX->_stageType,-1); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; RoomDescriptor::Init(aRStack_3ac,uVar3); uStack_8 = 0; if ((uint)((iStack_40 - aiStack_48[0]) / 0x48) < 7) { vector_LevelGenerator_Room_reserve(aiStack_48,7); } pvVar4 = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,6,6,4,-1,-1,-1); in_ECX->_lastBossRoomListIndex = *(int *)((int)pvVar4 + 4); pvVar5 = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,5,5,6,6,5,1); treasureSlotA = (void *)0x0; pvStack_3bc = (void *)0x0; if (in_ECX->_stage != 6) { treasureSlotA = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,7,7,1,7,7,2); pvStack_3bc = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,7,6,1,7,6,2); } slot = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,5,6,1,5,6,0); pRStack_3c0 = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,6,8,1,6,8,3); pvStack_3b8 = (void *)LevelGenerator::try_add_dead_end(extraout_ECX,0); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRVar6 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,(int)local_3c4,1,4,0,-1,1,10, (uint *)((int)pvVar4 + 0x1c),0xffffffff,-1); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; iVar15 = -1; minVariant = 0; rng->_seed = uVar3; pRVar7 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,2,6,0,-1,1,10,(uint *)((int)pvVar5 + 0x1c), 0xffffffff,-1); treasureRoomA = (void *)0x0; treasureRoomB = (void *)0x0; if (in_ECX->_stage != 6) { uVar3 = 0; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); if (bVar2 != 0) { uVar3 = 2; } iVar8 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar10 = 1; if (1 < iVar8) { iVar10 = iVar8; } rngResult = RNG::RandomInt(rng,(uint)(100 / (longlong)iVar10)); iVar10 = extraout_ECX_00; if ((rngResult < 0xf) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar10 = extraout_ECX_01, bVar2 != 0)) { uVar3 = 1; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar10 = extraout_ECX_02; if (bVar2 != 0) { uVar3 = 3; } } puVar9 = (uint *)((int)treasureSlotA + 0x1c); iVar17 = 10; iVar16 = 1; iVar14 = 1; iVar13 = 4; iVar8 = 0; bVar2 = 1; roomDesc = local_3c4; rngResult = RNG::Next(rng); treasureRoomA = RoomConfig::GetRandomRoomWithFallbackStage (roomConfigLocal,rngResult,bVar2,(int)roomDesc,iVar8,iVar13,iVar14,minVariant, iVar15,iVar16,iVar17,puVar9,uVar3,iVar10); uVar3 = 0; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); if (bVar2 != 0) { uVar3 = 2; } iVar8 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar10 = 1; if (1 < iVar8) { iVar10 = iVar8; } rngResult = RNG::RandomInt(rng,(uint)(100 / (longlong)iVar10)); iVar10 = extraout_ECX_03; if ((rngResult < 0xf) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar10 = extraout_ECX_04, bVar2 != 0)) { uVar3 = 1; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar10 = extraout_ECX_05; if (bVar2 != 0) { uVar3 = 3; } } puVar9 = (uint *)((int)pvStack_3bc + 0x1c); iVar17 = 10; iVar16 = 1; iVar14 = 1; iVar13 = 4; iVar8 = 0; bVar2 = 1; roomDesc = local_3c4; rngResult = RNG::Next(rng); treasureRoomB = RoomConfig::GetRandomRoomWithFallbackStage (roomConfigLocal,rngResult,bVar2,(int)roomDesc,iVar8,iVar13,iVar14,minVariant, iVar15,iVar16,iVar17,puVar9,uVar3,iVar10); } uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; local_3c4 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,10,1,0,-1,1,10,(uint *)((int)slot + 0x1c), 0xffffffff,-1); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRStack_3c8 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,0x17,1,0,-1,1,10, (uint *)&pRStack_3c0->field_0x1c,0xffffffff,-1); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRStack_3b0 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,8,1,0,-1,1,10, (uint *)((int)pvStack_3b8 + 0x1c),0xffffffff,-1); piVar11 = in_ECX->_roomMap; for (iVar15 = 0x1fb; iVar15 != 0; iVar15 = iVar15 + -1) { *piVar11 = -1; piVar11 = piVar11 + 1; } in_ECX->_roomCount = 0; *(undefined4 *)&in_ECX->field_0x18370 = 0x55; uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; unused = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)unused & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pvVar4,pRVar6,uVar3,unused,(RoomDescriptor **)0x0); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar4 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar4 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pvVar5,pRVar7,uVar3,pvVar4,(RoomDescriptor **)0x0); if (treasureSlotA != (void *)0x0) { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar4 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar4 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,treasureSlotA,treasureRoomA,uVar3,pvVar4,(RoomDescriptor **)0x0); } pvVar4 = pvStack_3bc; if (pvStack_3bc != (void *)0x0) { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar5 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar5 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pvVar4,treasureRoomB,uVar3,pvVar5,(RoomDescriptor **)0x0); } uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar4 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar4 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,slot,local_3c4,uVar3,pvVar4,(RoomDescriptor **)0x0); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar4 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar4 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pRStack_3c0,pRStack_3c8,uVar3,pvVar4,(RoomDescriptor **)0x0); pvVar4 = pvStack_3b8; if (pvStack_3b8 != (void *)0x0) { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar5 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar5 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pvVar4,pRStack_3b0,uVar3,pvVar5,(RoomDescriptor **)0x0); } puVar9 = (uint *)&in_ECX->field_0x18338; pvStack_3b8 = (void *)0xc; do { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; *puVar9 = uVar3; puVar9 = puVar9 + 1; pvStack_3b8 = (void *)((int)pvStack_3b8 + -1); } while (pvStack_3b8 != (void *)0x0); pvStack_3b8 = (void *)0x0; } else { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; RoomDescriptor::Init(aRStack_3ac,uVar3); uStack_8 = 1; if ((uint)((iStack_40 - aiStack_48[0]) / 0x48) < 3) { vector_LevelGenerator_Room_reserve(aiStack_48,3); } pvVar4 = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,6,6,1,-1,-1,-1); pvStack_3b8 = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,6,5,1,6,5,1); pRStack_3b0 = LevelGenerator::CreateRoom((LevelGenerator *)aRStack_3ac,6,3,4,6,4,1); pRStack_3c8 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0x19,1,0,-1); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRVar7 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0x19,5,1,0,999,1,10, (uint *)((int)pvStack_3b8 + 0x1c),0xffffffff,-1); pRStack_3c0 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfigLocal,0x19,5,1000,-1); pRVar6 = pRStack_3b0; piVar11 = in_ECX->_roomMap; for (iVar15 = 0x1fb; iVar15 != 0; iVar15 = iVar15 + -1) { *piVar11 = -1; piVar11 = piVar11 + 1; } in_ECX->_roomCount = 0; in_ECX->_lastBossRoomListIndex = pRStack_3b0->Mode; uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar5 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar5 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pvVar4,pRStack_3c8,uVar3,pvVar5,(RoomDescriptor **)0x0); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar4 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar4 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pvStack_3b8,pRVar7,uVar3,pvVar4,(RoomDescriptor **)0x0); uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; pvVar4 = (void *)(in_ECX->_generationRNG)._shift3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)pvVar4 & 0x1f) ^ uVar3; rng->_seed = uVar3; place_room(in_ECX,pRVar6,pRStack_3c0,uVar3,pvVar4,(RoomDescriptor **)0x0); } uStack_8 = 0xffffffff; FID_conflict__Tidy(auStack_30); FID_conflict__Tidy(auStack_3c); vector_LevelGenerator_Room_tidy(aiStack_48); piVar11 = (int *)unaff_FS_OFFSET[0xb]; if ((*(int *)(*piVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)roomDesc,rng); uVar3 = rng->_seed; pRStack_3b0 = (RoomConfig_Room *)0x0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRStack_3b0 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,3,0xd,0,-1,1,10,(uint *)&pRStack_3b0,0xffffffff ,0); iVar15 = *piVar11; if (*(int *)(iVar15 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { uStack_8 = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } iVar15 = *piVar11; } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x1fc; } roomDesc->Data = pRStack_3b0; if ((*(int *)(iVar15 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x200; } Seeds::Init3((Seeds *)roomDesc,rng); uVar3 = rng->_seed; pRStack_3b0 = (RoomConfig_Room *)0x0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRStack_3b0 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,0x16,0xd,0,-1,1,10,(uint *)&pRStack_3b0, 0xffffffff,0); iVar15 = *piVar11; if (*(int *)(iVar15 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { uStack_8 = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } iVar15 = *piVar11; } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x200; } roomDesc->Data = pRStack_3b0; if ((*(int *)(iVar15 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)roomDesc,rng); uVar3 = rng->_seed; pRStack_3b0 = (RoomConfig_Room *)0x0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRStack_3b0 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,0x10,0xd,0,-1,1,10,(uint *)&pRStack_3b0, 0xffffffff,0); if ((*(int *)(*piVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x1fe; } roomDesc->Data = pRStack_3b0; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { pvStack_3bc = (void *)0x1; } else { pvStack_3bc = (void *)0x2; } if (((g_manager->_persistentGameData)._achievements[0x99] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { pRStack_3c0 = (RoomConfig_Room *)0x1; } else { pRStack_3c0 = (RoomConfig_Room *)0x2; } if (((g_manager->_persistentGameData)._achievements[0x9a] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { pvStack_3bc = (void *)((int)pvStack_3bc + 1); } uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; pvStack_3b8 = (void *)0x1a; rng->_seed = uVar3; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 3 ^ uVar3; uVar3 = uVar3 << 3 ^ uVar3; uVar3 = uVar3 >> 0x1a ^ uVar3; pRStack_3b0 = (RoomConfig_Room *)(uVar3 % (uint)pvStack_3bc); if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 3 ^ uVar3; piVar11 = (int *)unaff_FS_OFFSET[0xb]; uVar3 = uVar3 << 3 ^ uVar3; pRStack_3b0 = (RoomConfig_Room *) ((int)&pRStack_3b0->StageId + (uVar3 >> 0x1a ^ uVar3) % (uint)pRStack_3c0); if ((*(int *)(*piVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x207; } Seeds::Init3((Seeds *)roomDesc,rng); uVar3 = rng->_seed; pRStack_3c8 = (RoomConfig_Room *)0x0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRStack_3b0 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,2,0xd,0,-1,1,10,(uint *)&pRStack_3c8, (uint)pRStack_3b0,0); if ((*(int *)(*piVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x207; } roomDesc->Data = pRStack_3b0; uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; iVar15 = *piVar11; rng->_seed = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; if ((*(int *)(iVar15 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)in_ECX->_currentDimensionIdx < 3) { roomDesc = in_ECX->_roomList + 0x20c; } Seeds::Init3((Seeds *)roomDesc,rng); uVar3 = rng->_seed; pRStack_3b0 = (RoomConfig_Room *)0x0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; pRVar6 = RoomConfig::GetRandomRoom (roomConfigLocal,uVar3,1,0,0xf,0xd,0,-1,1,10,(uint *)&pRStack_3b0,1,0); if ((*(int *)(*piVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } if ((uint)in_ECX->_currentDimensionIdx < 3) { in_ECX->_roomList[0x20c].Data = pRVar6; } else { g_roomDescriptorDummy.Data = pRVar6; } *unaff_FS_OFFSET = local_10; return; } //@@ 007435c8 FUN_007435c8 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_007435c8(void) { RoomConfig *pRVar1; void *pvVar2; code *pcVar3; Game *pGVar4; Manager *pMVar5; byte bVar6; uint uVar7; void *pvVar8; undefined4 uVar9; RoomConfig_Room *pRVar10; int iVar11; uint uVar12; uint *puVar13; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; PlayerManager *this; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int iVar14; RoomDescriptor *pRVar15; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar16; int iVar17; int iVar18; int iVar19; uint uVar20; int iVar21; int iVar22; int iVar23; uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; RoomDescriptor::Init((RoomDescriptor *)(unaff_EBP + -0x3a8),uVar7); *(undefined4 *)(unaff_EBP + -4) = 0; if ((uint)((*(int *)(unaff_EBP + -0x3c) - *(int *)(unaff_EBP + -0x44)) / 0x48) < 7) { vector_LevelGenerator_Room_reserve((void *)(unaff_EBP + -0x44),7); } pvVar8 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),6,6,4,-1,-1,-1); unaff_EBX->_lastBossRoomListIndex = *(int *)((int)pvVar8 + 4); *(void **)(unaff_EBP + -0x3d4) = pvVar8; pvVar8 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),5,5,6,6,5,1); iVar14 = unaff_EBX->_stage; *(void **)(unaff_EBP + -0x3d8) = pvVar8; *(undefined4 *)(unaff_EBP + -0x3c8) = 0; *(undefined4 *)(unaff_EBP + -0x3b8) = 0; if (iVar14 != 6) { pvVar8 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),7,7,1,7,7,2); *(void **)(unaff_EBP + -0x3c8) = pvVar8; pvVar8 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),7,6,1,7,6,2); *(void **)(unaff_EBP + -0x3b8) = pvVar8; } pvVar8 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),5,6,1,5,6,0); *(void **)(unaff_EBP + -0x3e4) = pvVar8; pvVar8 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),6,8,1,6,8,3); *(void **)(unaff_EBP + -0x3bc) = pvVar8; uVar9 = LevelGenerator::try_add_dead_end(); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3b4) = uVar9; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar14 = *(int *)(unaff_EBP + -0x3d4); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; iVar21 = *(int *)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,iVar21,1,4,0,-1,1,10,(uint *)(iVar14 + 0x1c),0xffffffff,-1); uVar7 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3cc) = pRVar10; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar14 = *(int *)(unaff_EBP + -0x3d8); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; iVar21 = -1; uVar20 = 0; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,2,6,0,-1,1,10,(uint *)(iVar14 + 0x1c),0xffffffff,-1); iVar14 = unaff_EBX->_stage; *(RoomConfig_Room **)(unaff_EBP + -0x3d0) = pRVar10; *(undefined4 *)(unaff_EBP + -0x3dc) = 0; *(undefined4 *)(unaff_EBP + -0x3e0) = 0; if (iVar14 != 6) { uVar7 = 0; bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); if (bVar6 != 0) { uVar7 = 2; } iVar11 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar14 = 1; if (1 < iVar11) { iVar14 = iVar11; } uVar12 = RNG::RandomInt(unaff_ESI,(uint)(100 / (longlong)iVar14)); iVar14 = extraout_ECX; if ((uVar12 < 0xf) && (bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar14 = extraout_ECX_00, bVar6 != 0)) { uVar7 = 1; bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar14 = extraout_ECX_01; if (bVar6 != 0) { uVar7 = 3; } } puVar13 = (uint *)(*(int *)(unaff_EBP + -0x3c8) + 0x1c); iVar23 = 10; iVar22 = 1; iVar19 = 1; iVar18 = 4; iVar17 = 0; iVar11 = *(int *)(unaff_EBP + -0x3c0); bVar6 = 1; uVar12 = RNG::Next(unaff_ESI); pvVar8 = RoomConfig::GetRandomRoomWithFallbackStage (*(RoomConfig **)(unaff_EBP + -0x3b0),uVar12,bVar6,iVar11,iVar17,iVar18, iVar19,uVar20,iVar21,iVar22,iVar23,puVar13,uVar7,iVar14); uVar7 = 0; this = &g_game->_playerManager; *(void **)(unaff_EBP + -0x3dc) = pvVar8; bVar6 = PlayerManager::AnyoneHasTrinket(this,0x70); if (bVar6 != 0) { uVar7 = 2; } iVar11 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar14 = 1; if (1 < iVar11) { iVar14 = iVar11; } uVar12 = RNG::RandomInt(unaff_ESI,(uint)(100 / (longlong)iVar14)); iVar14 = extraout_ECX_02; if ((uVar12 < 0xf) && (bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar14 = extraout_ECX_03, bVar6 != 0)) { uVar7 = 1; bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar14 = extraout_ECX_04; if (bVar6 != 0) { uVar7 = 3; } } puVar13 = (uint *)(*(int *)(unaff_EBP + -0x3b8) + 0x1c); iVar23 = 10; iVar22 = 1; iVar19 = 1; iVar18 = 4; iVar17 = 0; iVar11 = *(int *)(unaff_EBP + -0x3c0); bVar6 = 1; uVar12 = RNG::Next(unaff_ESI); pvVar8 = RoomConfig::GetRandomRoomWithFallbackStage (*(RoomConfig **)(unaff_EBP + -0x3b0),uVar12,bVar6,iVar11,iVar17,iVar18, iVar19,uVar20,iVar21,iVar22,iVar23,puVar13,uVar7,iVar14); *(void **)(unaff_EBP + -0x3e0) = pvVar8; } uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar14 = *(int *)(unaff_EBP + -0x3e4); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,10,1,0,-1,1,10,(uint *)(iVar14 + 0x1c),0xffffffff,-1); uVar7 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c0) = pRVar10; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar14 = *(int *)(unaff_EBP + -0x3bc); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0x17,1,0,-1,1,10,(uint *)(iVar14 + 0x1c),0xffffffff,-1); uVar7 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c4) = pRVar10; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar14 = *(int *)(unaff_EBP + -0x3b4); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,8,1,0,-1,1,10,(uint *)(iVar14 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; piVar16 = unaff_EBX->_roomMap; for (iVar14 = 0x1fb; iVar14 != 0; iVar14 = iVar14 + -1) { *piVar16 = -1; piVar16 = piVar16 + 1; } unaff_EBX->_roomCount = 0; *(undefined4 *)&unaff_EBX->field_0x18370 = 0x55; uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar8 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar8,uVar7,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar8 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar8,uVar7,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar8 = *(void **)(unaff_EBP + -0x3c8); if (pvVar8 != (void *)0x0) { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar2 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,pvVar8,pvVar2,uVar7,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar8 = *(void **)(unaff_EBP + -0x3b8); if (pvVar8 != (void *)0x0) { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar2 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,pvVar8,pvVar2,uVar7,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar8 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar8,uVar7,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar8 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar8,uVar7,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar8 = *(void **)(unaff_EBP + -0x3b4); if (pvVar8 != (void *)0x0) { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar2 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,pvVar8,pvVar2,uVar7,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar13 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; *puVar13 = uVar7; puVar13 = puVar13 + 1; piVar16 = (int *)(unaff_EBP + -0x3b4); *piVar16 = *piVar16 + -1; } while (*piVar16 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar8 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar15,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar21 = g_invalidRoomDescriptorGuard; iVar14 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar14 + 0xc) < iVar21) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar14 = *(int *)pvVar8; } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x1fc; } pRVar15->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar14 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar15,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar21 = g_invalidRoomDescriptorGuard; iVar14 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar14 + 0xc) < iVar21) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar14 = *(int *)pvVar8; } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x200; } pRVar15->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar14 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar15,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar21 = g_invalidRoomDescriptorGuard; iVar14 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar14 + 0xc) < iVar21) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x1fe; } pRVar15->Data = *(void **)(unaff_EBP + -0x3ac); pMVar5 = g_manager; pGVar4 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar14 = 1; } else { iVar14 = 2; } bVar6 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar14; if ((bVar6 == 0) && (((pMVar5->_state != 2 || (pGVar4 == (Game *)0x0)) || (((pGVar4->_dailyChallenge)._id == 0 && (pGVar4->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar5->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar5->_state == 2 && (pGVar4 != (Game *)0x0)) && (((pGVar4->_dailyChallenge)._id != 0 || (pGVar4->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar14 + 1; } uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } iVar14 = unaff_ESI->_shift2; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar7 = uVar7 << ((byte)iVar14 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar7; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar7; *(uint *)(unaff_EBP + -0x3ac) = uVar7 % *(uint *)(unaff_EBP + -0x3b8); pvVar8 = ThreadLocalStoragePointer; iVar14 = g_invalidRoomDescriptorGuard; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar7; iVar21 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar7) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar21 + 0xc) < iVar14) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar15,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar20 = *(uint *)(unaff_EBP + -0x3ac); uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),uVar20,0); iVar21 = g_invalidRoomDescriptorGuard; iVar14 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar14 + 0xc) < iVar21) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x207; } pRVar15->Data = *(void **)(unaff_EBP + -0x3ac); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar14 = *(int *)pvVar8; unaff_ESI->_seed = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; if ((*(int *)(iVar14 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar15 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar15 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar15,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar10 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar8 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 0074371e FUN_0074371e /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0074371e(void) { RoomConfig *pRVar1; void *pvVar2; code *pcVar3; Game *pGVar4; Manager *pMVar5; byte bVar6; uint uVar7; RoomConfig_Room *pRVar8; int iVar9; uint uVar10; uint *puVar11; void *pvVar12; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; PlayerManager *this; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int iVar13; RoomDescriptor *pRVar14; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar15; int iVar16; int iVar17; int iVar18; uint uVar19; int iVar20; int iVar21; int iVar22; uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar13 = *(int *)(unaff_EBP + -0x3d4); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; iVar20 = *(int *)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,iVar20,1,4,0,-1,1,10,(uint *)(iVar13 + 0x1c),0xffffffff,-1); uVar7 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3cc) = pRVar8; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar13 = *(int *)(unaff_EBP + -0x3d8); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; iVar20 = -1; uVar19 = 0; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,2,6,0,-1,1,10,(uint *)(iVar13 + 0x1c),0xffffffff,-1); iVar13 = unaff_EBX->_stage; *(RoomConfig_Room **)(unaff_EBP + -0x3d0) = pRVar8; *(undefined4 *)(unaff_EBP + -0x3dc) = 0; *(undefined4 *)(unaff_EBP + -0x3e0) = 0; if (iVar13 != 6) { uVar7 = 0; bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); if (bVar6 != 0) { uVar7 = 2; } iVar9 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar13 = 1; if (1 < iVar9) { iVar13 = iVar9; } uVar10 = RNG::RandomInt(unaff_ESI,(uint)(100 / (longlong)iVar13)); iVar13 = extraout_ECX; if ((uVar10 < 0xf) && (bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar13 = extraout_ECX_00, bVar6 != 0)) { uVar7 = 1; bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar13 = extraout_ECX_01; if (bVar6 != 0) { uVar7 = 3; } } puVar11 = (uint *)(*(int *)(unaff_EBP + -0x3c8) + 0x1c); iVar22 = 10; iVar21 = 1; iVar18 = 1; iVar17 = 4; iVar16 = 0; iVar9 = *(int *)(unaff_EBP + -0x3c0); bVar6 = 1; uVar10 = RNG::Next(unaff_ESI); pvVar12 = RoomConfig::GetRandomRoomWithFallbackStage (*(RoomConfig **)(unaff_EBP + -0x3b0),uVar10,bVar6,iVar9,iVar16,iVar17, iVar18,uVar19,iVar20,iVar21,iVar22,puVar11,uVar7,iVar13); uVar7 = 0; this = &g_game->_playerManager; *(void **)(unaff_EBP + -0x3dc) = pvVar12; bVar6 = PlayerManager::AnyoneHasTrinket(this,0x70); if (bVar6 != 0) { uVar7 = 2; } iVar9 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar13 = 1; if (1 < iVar9) { iVar13 = iVar9; } uVar10 = RNG::RandomInt(unaff_ESI,(uint)(100 / (longlong)iVar13)); iVar13 = extraout_ECX_02; if ((uVar10 < 0xf) && (bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar13 = extraout_ECX_03, bVar6 != 0)) { uVar7 = 1; bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar13 = extraout_ECX_04; if (bVar6 != 0) { uVar7 = 3; } } puVar11 = (uint *)(*(int *)(unaff_EBP + -0x3b8) + 0x1c); iVar22 = 10; iVar21 = 1; iVar18 = 1; iVar17 = 4; iVar16 = 0; iVar9 = *(int *)(unaff_EBP + -0x3c0); bVar6 = 1; uVar10 = RNG::Next(unaff_ESI); pvVar12 = RoomConfig::GetRandomRoomWithFallbackStage (*(RoomConfig **)(unaff_EBP + -0x3b0),uVar10,bVar6,iVar9,iVar16,iVar17, iVar18,uVar19,iVar20,iVar21,iVar22,puVar11,uVar7,iVar13); *(void **)(unaff_EBP + -0x3e0) = pvVar12; } uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar13 = *(int *)(unaff_EBP + -0x3e4); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,10,1,0,-1,1,10,(uint *)(iVar13 + 0x1c),0xffffffff,-1); uVar7 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c0) = pRVar8; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar13 = *(int *)(unaff_EBP + -0x3bc); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0x17,1,0,-1,1,10,(uint *)(iVar13 + 0x1c),0xffffffff,-1); uVar7 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c4) = pRVar8; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar13 = *(int *)(unaff_EBP + -0x3b4); pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,8,1,0,-1,1,10,(uint *)(iVar13 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar8; piVar15 = unaff_EBX->_roomMap; for (iVar13 = 0x1fb; iVar13 != 0; iVar13 = iVar13 + -1) { *piVar15 = -1; piVar15 = piVar15 + 1; } unaff_EBX->_roomCount = 0; *(undefined4 *)&unaff_EBX->field_0x18370 = 0x55; uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar12 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar12,uVar7, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar12 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar12,uVar7, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar12 = *(void **)(unaff_EBP + -0x3c8); if (pvVar12 != (void *)0x0) { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar2 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,pvVar12,pvVar2,uVar7,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar12 = *(void **)(unaff_EBP + -0x3b8); if (pvVar12 != (void *)0x0) { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar2 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,pvVar12,pvVar2,uVar7,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar12 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar12,uVar7, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar12 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar12,uVar7, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar12 = *(void **)(unaff_EBP + -0x3b4); if (pvVar12 != (void *)0x0) { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar7; pvVar2 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar7; Level::place_room(unaff_EBX,pvVar12,pvVar2,uVar7,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar11 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; *puVar11 = uVar7; puVar11 = puVar11 + 1; piVar15 = (int *)(unaff_EBP + -0x3b4); *piVar15 = *piVar15 + -1; } while (*piVar15 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar12 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar14,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar20 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar12; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar8; if (*(int *)(iVar13 + 0xc) < iVar20) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar12; } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x1fc; } pRVar14->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar14,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar20 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar12; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar8; if (*(int *)(iVar13 + 0xc) < iVar20) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar12; } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x200; } pRVar14->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar14,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar20 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar12; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar8; if ((*(int *)(iVar13 + 0xc) < iVar20) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x1fe; } pRVar14->Data = *(void **)(unaff_EBP + -0x3ac); pMVar5 = g_manager; pGVar4 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar13 = 1; } else { iVar13 = 2; } bVar6 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar13; if ((bVar6 == 0) && (((pMVar5->_state != 2 || (pGVar4 == (Game *)0x0)) || (((pGVar4->_dailyChallenge)._id == 0 && (pGVar4->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar5->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar5->_state == 2 && (pGVar4 != (Game *)0x0)) && (((pGVar4->_dailyChallenge)._id != 0 || (pGVar4->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar13 + 1; } uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } iVar13 = unaff_ESI->_shift2; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar7 = uVar7 << ((byte)iVar13 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar7; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar7; *(uint *)(unaff_EBP + -0x3ac) = uVar7 % *(uint *)(unaff_EBP + -0x3b8); pvVar12 = ThreadLocalStoragePointer; iVar13 = g_invalidRoomDescriptorGuard; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar7; iVar20 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar7 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar7) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar20 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar14,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar19 = *(uint *)(unaff_EBP + -0x3ac); uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),uVar19,0); iVar20 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar12; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar8; if ((*(int *)(iVar13 + 0xc) < iVar20) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x207; } pRVar14->Data = *(void **)(unaff_EBP + -0x3ac); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; iVar13 = *(int *)pvVar12; unaff_ESI->_seed = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar14 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar14 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar14,unaff_ESI); uVar7 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = unaff_ESI->_seed; if (uVar7 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar7 = uVar7 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar7; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar7 = uVar7 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar7; unaff_ESI->_seed = uVar7; pRVar8 = RoomConfig::GetRandomRoom (pRVar1,uVar7,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar8; } else { g_roomDescriptorDummy.Data = pRVar8; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 0074378b Level::generate_greed_chunk_rooms /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? not a real function: a Ghidra-split piece of FUN_00743550 (greed floor generator called from Level::Init when Game _difficulty is 2/3; unaligned start, unaff_EBP/ESI frame -0x3d8/-0x3b0, no refs): RNG steps, PlayerManager::AnyoneHasTrinket/GetTrinketMultiplier, RoomConfig::GetRandomRoom / GetRandomRoomWithFallbackStage */ void Level::generate_greed_chunk_rooms(void) { code *pcVar1; byte bVar2; uint uVar3; RoomConfig_Room *roomData; int iVar4; uint rngResult; uint *puVar5; void *pvVar6; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; PlayerManager *playerManager; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int iVar7; RoomDescriptor *roomDesc; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar8; int iVar9; int iVar10; int iVar11; uint uVar12; int iVar13; int iVar14; int iVar15; Game *game; Manager *manager; void *placedRoomData; RoomConfig *roomConfig; uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; iVar7 = *(int *)(unaff_EBP + -0x3d8); roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; iVar13 = -1; uVar12 = 0; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,2,6,0,-1,1,10,(uint *)(iVar7 + 0x1c),0xffffffff,-1); iVar7 = unaff_EBX->_stage; *(RoomConfig_Room **)(unaff_EBP + -0x3d0) = roomData; *(undefined4 *)(unaff_EBP + -0x3dc) = 0; *(undefined4 *)(unaff_EBP + -0x3e0) = 0; if (iVar7 != 6) { uVar3 = 0; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); if (bVar2 != 0) { uVar3 = 2; } iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar7 = 1; if (1 < iVar4) { iVar7 = iVar4; } rngResult = RNG::RandomInt(unaff_ESI,(uint)(100 / (longlong)iVar7)); iVar7 = extraout_ECX; if ((rngResult < 0xf) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar7 = extraout_ECX_00, bVar2 != 0)) { uVar3 = 1; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar7 = extraout_ECX_01; if (bVar2 != 0) { uVar3 = 3; } } puVar5 = (uint *)(*(int *)(unaff_EBP + -0x3c8) + 0x1c); iVar15 = 10; iVar14 = 1; iVar11 = 1; iVar10 = 4; iVar9 = 0; iVar4 = *(int *)(unaff_EBP + -0x3c0); bVar2 = 1; rngResult = RNG::Next(unaff_ESI); pvVar6 = RoomConfig::GetRandomRoomWithFallbackStage (*(RoomConfig **)(unaff_EBP + -0x3b0),rngResult,bVar2,iVar4,iVar9,iVar10, iVar11,uVar12,iVar13,iVar14,iVar15,puVar5,uVar3,iVar7); uVar3 = 0; playerManager = &g_game->_playerManager; *(void **)(unaff_EBP + -0x3dc) = pvVar6; bVar2 = PlayerManager::AnyoneHasTrinket(playerManager,0x70); if (bVar2 != 0) { uVar3 = 2; } iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x52); iVar7 = 1; if (1 < iVar4) { iVar7 = iVar4; } rngResult = RNG::RandomInt(unaff_ESI,(uint)(100 / (longlong)iVar7)); iVar7 = extraout_ECX_02; if ((rngResult < 0xf) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x52), iVar7 = extraout_ECX_03, bVar2 != 0)) { uVar3 = 1; bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x70); iVar7 = extraout_ECX_04; if (bVar2 != 0) { uVar3 = 3; } } puVar5 = (uint *)(*(int *)(unaff_EBP + -0x3b8) + 0x1c); iVar15 = 10; iVar14 = 1; iVar11 = 1; iVar10 = 4; iVar9 = 0; iVar4 = *(int *)(unaff_EBP + -0x3c0); bVar2 = 1; rngResult = RNG::Next(unaff_ESI); pvVar6 = RoomConfig::GetRandomRoomWithFallbackStage (*(RoomConfig **)(unaff_EBP + -0x3b0),rngResult,bVar2,iVar4,iVar9,iVar10, iVar11,uVar12,iVar13,iVar14,iVar15,puVar5,uVar3,iVar7); *(void **)(unaff_EBP + -0x3e0) = pvVar6; } uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; iVar7 = *(int *)(unaff_EBP + -0x3e4); roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,10,1,0,-1,1,10,(uint *)(iVar7 + 0x1c),0xffffffff,-1); uVar3 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c0) = roomData; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; iVar7 = *(int *)(unaff_EBP + -0x3bc); roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,0x17,1,0,-1,1,10,(uint *)(iVar7 + 0x1c),0xffffffff,-1); uVar3 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c4) = roomData; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; iVar7 = *(int *)(unaff_EBP + -0x3b4); roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,8,1,0,-1,1,10,(uint *)(iVar7 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = roomData; piVar8 = unaff_EBX->_roomMap; for (iVar7 = 0x1fb; iVar7 != 0; iVar7 = iVar7 + -1) { *piVar8 = -1; piVar8 = piVar8 + 1; } unaff_EBX->_roomCount = 0; *(undefined4 *)&unaff_EBX->field_0x18370 = 0x55; uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; pvVar6 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar6,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; pvVar6 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar6,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); pvVar6 = *(void **)(unaff_EBP + -0x3c8); if (pvVar6 != (void *)0x0) { uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; placedRoomData = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,pvVar6,placedRoomData,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar6 = *(void **)(unaff_EBP + -0x3b8); if (pvVar6 != (void *)0x0) { uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; placedRoomData = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,pvVar6,placedRoomData,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; pvVar6 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar6,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; pvVar6 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar6,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); pvVar6 = *(void **)(unaff_EBP + -0x3b4); if (pvVar6 != (void *)0x0) { uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar3; placedRoomData = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar3; place_room(unaff_EBX,pvVar6,placedRoomData,uVar3,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar5 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; *puVar5 = uVar3; puVar5 = puVar5 + 1; piVar8 = (int *)(unaff_EBP + -0x3b4); *piVar8 = *piVar8 + -1; } while (*piVar8 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar6 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); uVar3 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff ,0); iVar13 = g_invalidRoomDescriptorGuard; iVar7 = *(int *)pvVar6; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = roomData; if (*(int *)(iVar7 + 0xc) < iVar13) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar7 = *(int *)pvVar6; } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fc; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar7 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); uVar3 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar13 = g_invalidRoomDescriptorGuard; iVar7 = *(int *)pvVar6; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = roomData; if (*(int *)(iVar7 + 0xc) < iVar13) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar7 = *(int *)pvVar6; } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x200; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar7 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); uVar3 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar13 = g_invalidRoomDescriptorGuard; iVar7 = *(int *)pvVar6; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = roomData; if ((*(int *)(iVar7 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fe; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); manager = g_manager; game = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar7 = 1; } else { iVar7 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar7; if ((bVar2 == 0) && (((manager->_state != 2 || (game == (Game *)0x0)) || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((manager->_persistentGameData)._achievements[0x9a] != 0) || (((manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar7 + 1; } uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } iVar7 = unaff_ESI->_shift2; uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar3 = uVar3 << ((byte)iVar7 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar3; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar3; *(uint *)(unaff_EBP + -0x3ac) = uVar3 % *(uint *)(unaff_EBP + -0x3b8); pvVar6 = ThreadLocalStoragePointer; iVar7 = g_invalidRoomDescriptorGuard; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar3; iVar13 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar3 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar3) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar13 + 0xc) < iVar7) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); uVar3 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar12 = *(uint *)(unaff_EBP + -0x3ac); uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),uVar12,0); iVar13 = g_invalidRoomDescriptorGuard; iVar7 = *(int *)pvVar6; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = roomData; if ((*(int *)(iVar7 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x207; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; iVar7 = *(int *)pvVar6; unaff_ESI->_seed = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; if ((*(int *)(iVar7 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); uVar3 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; roomData = RoomConfig::GetRandomRoom (roomConfig,uVar3,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar6 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = roomData; } else { g_roomDescriptorDummy.Data = roomData; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 0074399a FUN_0074399a /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0074399a(void) { byte bVar1; RoomConfig *pRVar2; void *pvVar3; void *pvVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; int iVar11; RoomDescriptor *pRVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar13; uint *puVar14; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3e4); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,10,1,0,-1,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); uVar9 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c0) = pRVar10; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3bc); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x17,1,0,-1,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); uVar9 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c4) = pRVar10; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3b4); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,8,1,0,-1,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; piVar13 = unaff_EBX->_roomMap; for (iVar11 = 0x1fb; iVar11 != 0; iVar11 = iVar11 + -1) { *piVar13 = -1; piVar13 = piVar13 + 1; } unaff_EBX->_roomCount = 0; *(undefined4 *)&unaff_EBX->field_0x18370 = 0x55; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3c8); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar3 = *(void **)(unaff_EBP + -0x3b8); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar14 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar14 = uVar9; puVar14 = puVar14 + 1; piVar13 = (int *)(unaff_EBP + -0x3b4); *piVar13 = *piVar13 + -1; } while (*piVar13 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar11 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar11 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743a03 FUN_00743a03 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743a03(void) { byte bVar1; RoomConfig *pRVar2; void *pvVar3; void *pvVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; int iVar11; RoomDescriptor *pRVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar13; uint *puVar14; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3bc); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x17,1,0,-1,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); uVar9 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c4) = pRVar10; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3b4); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,8,1,0,-1,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; piVar13 = unaff_EBX->_roomMap; for (iVar11 = 0x1fb; iVar11 != 0; iVar11 = iVar11 + -1) { *piVar13 = -1; piVar13 = piVar13 + 1; } unaff_EBX->_roomCount = 0; *(undefined4 *)&unaff_EBX->field_0x18370 = 0x55; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3c8); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar3 = *(void **)(unaff_EBP + -0x3b8); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar14 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar14 = uVar9; puVar14 = puVar14 + 1; piVar13 = (int *)(unaff_EBP + -0x3b4); *piVar13 = *piVar13 + -1; } while (*piVar13 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar11 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar11 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743a6c FUN_00743a6c /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743a6c(void) { byte bVar1; RoomConfig *pRVar2; void *pvVar3; void *pvVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; int iVar11; RoomDescriptor *pRVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar13; uint *puVar14; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3b4); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,8,1,0,-1,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; piVar13 = unaff_EBX->_roomMap; for (iVar11 = 0x1fb; iVar11 != 0; iVar11 = iVar11 + -1) { *piVar13 = -1; piVar13 = piVar13 + 1; } unaff_EBX->_roomCount = 0; *(undefined4 *)&unaff_EBX->field_0x18370 = 0x55; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3c8); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar3 = *(void **)(unaff_EBP + -0x3b8); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar14 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar14 = uVar9; puVar14 = puVar14 + 1; piVar13 = (int *)(unaff_EBP + -0x3b4); *piVar13 = *piVar13 + -1; } while (*piVar13 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar11 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar11 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743af9 FUN_00743af9 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743af9(void) { int *piVar1; byte bVar2; void *pvVar3; void *pvVar4; RoomConfig *pRVar5; int iVar6; uint roomSubtype; code *pcVar7; Game *pGVar8; Manager *pMVar9; uint uVar10; RoomConfig_Room *pRVar11; RoomDescriptor *pRVar12; int iVar13; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; uint *puVar14; uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d4),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3c8); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar3 = *(void **)(unaff_EBP + -0x3b8); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar14 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; *puVar14 = uVar10; puVar14 = puVar14 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if (*(int *)(iVar13 + 0xc) < iVar6) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff, 0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if (*(int *)(iVar13 + 0xc) < iVar6) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff, 0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if ((*(int *)(iVar13 + 0xc) < iVar6) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar9 = g_manager; pGVar8 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar13 = 1; } else { iVar13 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar13; if ((bVar2 == 0) && (((pMVar9->_state != 2 || (pGVar8 == (Game *)0x0)) || (((pGVar8->_dailyChallenge)._id == 0 && (pGVar8->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar9->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar9->_state == 2 && (pGVar8 != (Game *)0x0)) && (((pGVar8->_dailyChallenge)._id != 0 || (pGVar8->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar13 + 1; } uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } iVar13 = unaff_ESI->_shift2; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar10 = uVar10 << ((byte)iVar13 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar10; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar10; *(uint *)(unaff_EBP + -0x3ac) = uVar10 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar13 = g_invalidRoomDescriptorGuard; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar10; iVar6 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar10) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar6 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0) ; iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if ((*(int *)(iVar13 + 0xc) < iVar6) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; iVar13 = *(int *)pvVar3; unaff_ESI->_seed = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar11; } else { g_roomDescriptorDummy.Data = pRVar11; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743b49 FUN_00743b49 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743b49(void) { int *piVar1; byte bVar2; void *pvVar3; void *pvVar4; RoomConfig *pRVar5; int iVar6; uint roomSubtype; code *pcVar7; Game *pGVar8; Manager *pMVar9; uint uVar10; RoomConfig_Room *pRVar11; RoomDescriptor *pRVar12; int iVar13; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; uint *puVar14; uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3d0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d8),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3c8); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } pvVar3 = *(void **)(unaff_EBP + -0x3b8); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar14 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; *puVar14 = uVar10; puVar14 = puVar14 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if (*(int *)(iVar13 + 0xc) < iVar6) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff, 0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if (*(int *)(iVar13 + 0xc) < iVar6) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff, 0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if ((*(int *)(iVar13 + 0xc) < iVar6) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar9 = g_manager; pGVar8 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar13 = 1; } else { iVar13 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar13; if ((bVar2 == 0) && (((pMVar9->_state != 2 || (pGVar8 == (Game *)0x0)) || (((pGVar8->_dailyChallenge)._id == 0 && (pGVar8->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar9->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar9->_state == 2 && (pGVar8 != (Game *)0x0)) && (((pGVar8->_dailyChallenge)._id != 0 || (pGVar8->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar13 + 1; } uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } iVar13 = unaff_ESI->_shift2; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar10 = uVar10 << ((byte)iVar13 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar10; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar10; *(uint *)(unaff_EBP + -0x3ac) = uVar10 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar13 = g_invalidRoomDescriptorGuard; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar10; iVar6 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar10) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar6 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0) ; iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if ((*(int *)(iVar13 + 0xc) < iVar6) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; iVar13 = *(int *)pvVar3; unaff_ESI->_seed = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar11; } else { g_roomDescriptorDummy.Data = pRVar11; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743ba3 FUN_00743ba3 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743ba3(void) { int *piVar1; byte bVar2; void *pvVar3; void *pvVar4; RoomConfig *pRVar5; int iVar6; uint roomSubtype; code *pcVar7; Game *pGVar8; Manager *pMVar9; uint uVar10; RoomConfig_Room *pRVar11; RoomDescriptor *pRVar12; int iVar13; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; void *unaff_EDI; uint *puVar14; uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3dc); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,unaff_EDI,pvVar3,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b8); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar10, (void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar10; pvVar4 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar10; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar10,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); } puVar14 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; *puVar14 = uVar10; puVar14 = puVar14 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if (*(int *)(iVar13 + 0xc) < iVar6) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff, 0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if (*(int *)(iVar13 + 0xc) < iVar6) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff, 0); iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if ((*(int *)(iVar13 + 0xc) < iVar6) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar9 = g_manager; pGVar8 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar13 = 1; } else { iVar13 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar13; if ((bVar2 == 0) && (((pMVar9->_state != 2 || (pGVar8 == (Game *)0x0)) || (((pGVar8->_dailyChallenge)._id == 0 && (pGVar8->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar9->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar9->_state == 2 && (pGVar8 != (Game *)0x0)) && (((pGVar8->_dailyChallenge)._id != 0 || (pGVar8->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar13 + 1; } uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } iVar13 = unaff_ESI->_shift2; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar10 = uVar10 << ((byte)iVar13 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar10; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar10; *(uint *)(unaff_EBP + -0x3ac) = uVar10 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar13 = g_invalidRoomDescriptorGuard; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar7 = (code *)swi(3); (*pcVar7)(); return; } uVar10 = uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar10; iVar6 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar10 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar10) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar6 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0) ; iVar6 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar11; if ((*(int *)(iVar13 + 0xc) < iVar6) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; iVar13 = *(int *)pvVar3; unaff_ESI->_seed = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar10 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = unaff_ESI->_seed; if (uVar10 == 0) { pcVar7 = (code *)swi(3); (*pcVar7)(); return; } } uVar10 = uVar10 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar10; pRVar5 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar10 = uVar10 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar10; unaff_ESI->_seed = uVar10; pRVar11 = RoomConfig::GetRandomRoom (pRVar5,uVar10,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar11; } else { g_roomDescriptorDummy.Data = pRVar11; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743bf8 FUN_00743bf8 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743bf8(void) { int *piVar1; byte bVar2; void *pvVar3; void *data; RoomConfig *pRVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; RoomDescriptor *pRVar11; int iVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; void *unaff_EDI; uint *puVar13; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3e0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,unaff_EDI,pvVar3,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; data = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,data,uVar9,(void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0) ; } puVar13 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar13 = uVar9; puVar13 = puVar13 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar2 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar12 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar12 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar12) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar12 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743c43 FUN_00743c43 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743c43(void) { int *piVar1; byte bVar2; void *pvVar3; void *data; RoomConfig *pRVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; RoomDescriptor *pRVar11; int iVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; uint *puVar13; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c0); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3e4),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; data = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,data,uVar9,(void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0) ; } puVar13 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar13 = uVar9; puVar13 = puVar13 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar2 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar12 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar12 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar12) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar12 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743c93 FUN_00743c93 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743c93(void) { int *piVar1; byte bVar2; void *pvVar3; void *data; RoomConfig *pRVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; RoomDescriptor *pRVar11; int iVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; uint *puVar13; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3bc),pvVar3,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); pvVar3 = *(void **)(unaff_EBP + -0x3b4); if (pvVar3 != (void *)0x0) { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; data = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,data,uVar9,(void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0) ; } puVar13 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar13 = uVar9; puVar13 = puVar13 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar2 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar12 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar12 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar12) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar12 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743ced FUN_00743ced /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743ced(void) { int *piVar1; byte bVar2; void *pvVar3; RoomConfig *pRVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; RoomDescriptor *pRVar11; int iVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; void *unaff_EDI; uint *puVar13; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar3 = *(void **)(unaff_EBP + -0x3ac); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,unaff_EDI,pvVar3,uVar9,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); puVar13 = (uint *)&unaff_EBX->field_0x18338; *(undefined4 *)(unaff_EBP + -0x3b4) = 0xc; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *puVar13 = uVar9; puVar13 = puVar13 + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fc; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar12 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *(int *)pvVar3; } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x200; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x1fe; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar2 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar12 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar12 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar12) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar12 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x207; } pRVar11->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar12 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar11 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar4 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar4,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743d48 FUN_00743d48 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743d48(void) { int *piVar1; byte bVar2; RoomConfig *pRVar3; int iVar4; uint roomSubtype; code *pcVar5; Game *pGVar6; Manager *pMVar7; void *pvVar8; uint uVar9; RoomConfig_Room *pRVar10; void **ppvVar11; RoomDescriptor *pRVar12; int iVar13; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; uint *unaff_EDI; do { uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } do { uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; *unaff_EDI = uVar9; unaff_EDI = unaff_EDI + 1; piVar1 = (int *)(unaff_EBP + -0x3b4); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar8 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar12 = (RoomDescriptor *)(unaff_EBX + 0x16d34); } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar3,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar4 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar13 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar8; } ppvVar11 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar11 = (void **)(unaff_EBX + 0x16d44); } *ppvVar11 = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar12 = (RoomDescriptor *)(unaff_EBX + 0x17014); } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar3,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar4 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar13 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar13 = *(int *)pvVar8; } ppvVar11 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar11 = (void **)(unaff_EBX + 0x17024); } *ppvVar11 = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar12 = (RoomDescriptor *)(unaff_EBX + 0x16ea4); } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar3,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar4 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar13 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } ppvVar11 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar11 = (void **)(unaff_EBX + 0x16eb4); } *ppvVar11 = *(void **)(unaff_EBP + -0x3ac); pMVar7 = g_manager; pGVar6 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar13 = 1; } else { iVar13 = 2; } bVar2 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar13; if ((bVar2 == 0) && (((pMVar7->_state != 2 || (pGVar6 == (Game *)0x0)) || (((pGVar6->_dailyChallenge)._id == 0 && (pGVar6->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar7->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar7->_state == 2 && (pGVar6 != (Game *)0x0)) && (((pGVar6->_dailyChallenge)._id != 0 || (pGVar6->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar13 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } iVar13 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar13 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar8 = ThreadLocalStoragePointer; iVar13 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar4 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar4 + 0xc) < iVar13) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar12 = (RoomDescriptor *)(unaff_EBX + 0x1751c); } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar3,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4), roomSubtype,0); iVar4 = g_invalidRoomDescriptorGuard; iVar13 = *(int *)pvVar8; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar13 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } ppvVar11 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar11 = (void **)(unaff_EBX + 0x1752c); } *ppvVar11 = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar13 = *(int *)pvVar8; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar13 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar12 = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar3,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar8 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } uVar9 = unaff_ESI->_seed; } while (uVar9 != 0); KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); } while( true ); } //@@ 00743d94 FUN_00743d94 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743d94(void) { byte bVar1; RoomConfig *pRVar2; void *pvVar3; int iVar4; uint roomSubtype; code *pcVar5; Game *pGVar6; Manager *pMVar7; uint uVar8; void *pvVar9; RoomConfig_Room *pRVar10; int iVar11; RoomDescriptor *pRVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; RoomConfig *unaff_EDI; int *piVar13; uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; RoomDescriptor::Init((RoomDescriptor *)(unaff_EBP + -0x3a8),uVar8); *(undefined4 *)(unaff_EBP + -4) = 1; if ((uint)((*(int *)(unaff_EBP + -0x3c) - *(int *)(unaff_EBP + -0x44)) / 0x48) < 3) { vector_LevelGenerator_Room_reserve((void *)(unaff_EBP + -0x44),3); } pvVar9 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),6,6,1,-1,-1,-1); *(void **)(unaff_EBP + -0x3d0) = pvVar9; pvVar9 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),6,5,1,6,5,1); *(void **)(unaff_EBP + -0x3b4) = pvVar9; pvVar9 = LevelGenerator::CreateRoom((LevelGenerator *)(unaff_EBP + -0x3a8),6,3,4,6,4,1); *(void **)(unaff_EBP + -0x3ac) = pvVar9; pRVar10 = RoomConfig::GetRoomByStageTypeAndVariant(unaff_EDI,0x19,1,0,-1); uVar8 = unaff_ESI->_seed; *(RoomConfig_Room **)(unaff_EBP + -0x3c4) = pRVar10; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar11 = *(int *)(unaff_EBP + -0x3b4); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0x19,5,1,0,999,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3cc) = pRVar10; pRVar10 = RoomConfig::GetRoomByStageTypeAndVariant (*(RoomConfig **)(unaff_EBP + -0x3b0),0x19,5,1000,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3bc) = pRVar10; piVar13 = unaff_EBX->_roomMap; for (iVar11 = 0x1fb; iVar11 != 0; iVar11 = iVar11 + -1) { *piVar13 = -1; piVar13 = piVar13 + 1; } pvVar9 = *(void **)(unaff_EBP + -0x3ac); unaff_EBX->_roomCount = 0; unaff_EBX->_lastBossRoomListIndex = *(int *)((int)pvVar9 + 4); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar3 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d0),pvVar3,uVar8,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar3 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3b4),pvVar3,uVar8,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar3 = *(void **)(unaff_EBP + -0x3bc); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,pvVar9,pvVar3,uVar8,(void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0) ; *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar9 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar9; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar9; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar9; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar9; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar9; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar7 = g_manager; pGVar6 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar7->_state != 2 || (pGVar6 == (Game *)0x0)) || (((pGVar6->_dailyChallenge)._id == 0 && (pGVar6->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar7->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar7->_state == 2 && (pGVar6 != (Game *)0x0)) && (((pGVar6->_dailyChallenge)._id != 0 || (pGVar6->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } iVar11 = unaff_ESI->_shift2; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar8 = uVar8 << ((byte)iVar11 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar8; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8; *(uint *)(unaff_EBP + -0x3ac) = uVar8 % *(uint *)(unaff_EBP + -0x3b8); pvVar9 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; iVar4 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar4 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar9; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar11 = *(int *)pvVar9; unaff_ESI->_seed = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar9 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743e72 FUN_00743e72 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743e72(void) { byte bVar1; RoomConfig *pRVar2; void *pvVar3; void *pvVar4; int iVar5; uint roomSubtype; code *pcVar6; Game *pGVar7; Manager *pMVar8; uint uVar9; RoomConfig_Room *pRVar10; int iVar11; RoomDescriptor *pRVar12; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *piVar13; uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)(unaff_EBP + -0x3b4); pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0x19,5,1,0,999,1,10,(uint *)(iVar11 + 0x1c),0xffffffff,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3cc) = pRVar10; pRVar10 = RoomConfig::GetRoomByStageTypeAndVariant (*(RoomConfig **)(unaff_EBP + -0x3b0),0x19,5,1000,-1); *(RoomConfig_Room **)(unaff_EBP + -0x3bc) = pRVar10; piVar13 = unaff_EBX->_roomMap; for (iVar11 = 0x1fb; iVar11 != 0; iVar11 = iVar11 + -1) { *piVar13 = -1; piVar13 = piVar13 + 1; } pvVar3 = *(void **)(unaff_EBP + -0x3ac); unaff_EBX->_roomCount = 0; unaff_EBX->_lastBossRoomListIndex = *(int *)((int)pvVar3 + 4); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d0),pvVar4,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3b4),pvVar4,uVar9,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar9; pvVar4 = *(void **)(unaff_EBP + -0x3bc); unaff_ESI->_seed = uVar9; Level::place_room(unaff_EBX,pvVar3,pvVar4,uVar9,(void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0) ; *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar3 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fc; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if (*(int *)(iVar11 + 0xc) < iVar5) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar3; } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x200; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0 ); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x1fe; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); pMVar8 = g_manager; pGVar7 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar8->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar8->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar8->_state == 2 && (pGVar7 != (Game *)0x0)) && (((pGVar7->_dailyChallenge)._id != 0 || (pGVar7->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } iVar11 = unaff_ESI->_shift2; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar9 = uVar9 << ((byte)iVar11 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar9; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9; *(uint *)(unaff_EBP + -0x3ac) = uVar9 % *(uint *)(unaff_EBP + -0x3b8); pvVar3 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } uVar9 = uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar9; iVar5 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar9 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar9) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar5 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar5 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar3; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar10; if ((*(int *)(iVar11 + 0xc) < iVar5) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x207; } pRVar12->Data = *(void **)(unaff_EBP + -0x3ac); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; iVar11 = *(int *)pvVar3; unaff_ESI->_seed = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar12 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar12 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar12,unaff_ESI); uVar9 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = unaff_ESI->_seed; if (uVar9 == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar9 = uVar9 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar9; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar9 = uVar9 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar9; unaff_ESI->_seed = uVar9; pRVar10 = RoomConfig::GetRandomRoom (pRVar2,uVar9,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar10; } else { g_roomDescriptorDummy.Data = pRVar10; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743f23 FUN_00743f23 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743f23(void) { byte bVar1; void *pvVar2; RoomConfig *pRVar3; int iVar4; uint roomSubtype; code *pcVar5; Game *pGVar6; Manager *pMVar7; uint uVar8; RoomConfig_Room *pRVar9; RoomDescriptor *pRVar10; int iVar11; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; void *unaff_EDI; uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar2 = *(void **)(unaff_EBP + -0x3c4); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3d0),pvVar2,uVar8,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar2 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3b4),pvVar2,uVar8,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar2 = *(void **)(unaff_EBP + -0x3bc); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,unaff_EDI,pvVar2,uVar8,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar2 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar11 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar2; } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fc; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar11 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar2; } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x200; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar11 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fe; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); pMVar7 = g_manager; pGVar6 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar7->_state != 2 || (pGVar6 == (Game *)0x0)) || (((pGVar6->_dailyChallenge)._id == 0 && (pGVar6->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar7->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar7->_state == 2 && (pGVar6 != (Game *)0x0)) && (((pGVar6->_dailyChallenge)._id != 0 || (pGVar6->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } iVar11 = unaff_ESI->_shift2; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar8 = uVar8 << ((byte)iVar11 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar8; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8; *(uint *)(unaff_EBP + -0x3ac) = uVar8 % *(uint *)(unaff_EBP + -0x3b8); pvVar2 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; iVar4 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar4 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar11 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x207; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar11 = *(int *)pvVar2; unaff_ESI->_seed = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar2 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar9; } else { g_roomDescriptorDummy.Data = pRVar9; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743f73 FUN_00743f73 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00743f73(void) { byte bVar1; void *pvVar2; RoomConfig *pRVar3; int iVar4; uint roomSubtype; code *pcVar5; Game *pGVar6; Manager *pMVar7; uint uVar8; RoomConfig_Room *pRVar9; RoomDescriptor *pRVar10; int iVar11; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; void *unaff_EDI; uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar2 = *(void **)(unaff_EBP + -0x3cc); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,*(void **)(unaff_EBP + -0x3b4),pvVar2,uVar8,(void *)unaff_ESI->_shift3 ,(RoomDescriptor **)0x0); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ uVar8; pvVar2 = *(void **)(unaff_EBP + -0x3bc); unaff_ESI->_seed = uVar8; Level::place_room(unaff_EBX,unaff_EDI,pvVar2,uVar8,(void *)unaff_ESI->_shift3, (RoomDescriptor **)0x0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar2 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar11 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar2; } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fc; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar11 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar11 = *(int *)pvVar2; } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x200; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar11 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x1fe; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); pMVar7 = g_manager; pGVar6 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar11 = 1; } else { iVar11 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar11; if ((bVar1 == 0) && (((pMVar7->_state != 2 || (pGVar6 == (Game *)0x0)) || (((pGVar6->_dailyChallenge)._id == 0 && (pGVar6->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar7->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar7->_state == 2 && (pGVar6 != (Game *)0x0)) && (((pGVar6->_dailyChallenge)._id != 0 || (pGVar6->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar11 + 1; } uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } iVar11 = unaff_ESI->_shift2; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar8 = uVar8 << ((byte)iVar11 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar8; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8; *(uint *)(unaff_EBP + -0x3ac) = uVar8 % *(uint *)(unaff_EBP + -0x3b8); pvVar2 = ThreadLocalStoragePointer; iVar11 = g_invalidRoomDescriptorGuard; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; iVar4 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar4 + 0xc) < iVar11) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar4 = g_invalidRoomDescriptorGuard; iVar11 = *(int *)pvVar2; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar11 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x207; } pRVar10->Data = *(void **)(unaff_EBP + -0x3ac); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar11 = *(int *)pvVar2; unaff_ESI->_seed = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; if ((*(int *)(iVar11 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar10 = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { pRVar10 = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)pRVar10,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar3,uVar8,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar2 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = pRVar9; } else { g_roomDescriptorDummy.Data = pRVar9; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00743fc3 Level::generate_greed_chunk_place /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? not a real function: a Ghidra-split piece of FUN_00743550 (unaligned start, unaff_EBP/ESI/EDI frame -0x3bc, no refs; 743550 is the greed floor generator, Level::Init calls it when Game _difficulty 0x269c8 is 2/3): RNG step then Level::place_room, frees LevelGenerator vectors, Seeds::Init3, RoomDescriptor::constructor */ void Level::generate_greed_chunk_place(void) { void *pvVar1; int iVar2; uint roomSubtype; code *pcVar3; uint seed; RoomConfig_Room *randomRoom; RoomDescriptor *roomDesc; int iVar4; Level *unaff_EBX; int unaff_EBP; RNG *unaff_ESI; void *unaff_EDI; Game *game; byte isAchievementUnlocked; Manager *manager; RoomConfig *roomConfig; seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(void *)unaff_ESI->_shift3 & 0x1f) ^ seed; pvVar1 = *(void **)(unaff_EBP + -0x3bc); unaff_ESI->_seed = seed; place_room(unaff_EBX,unaff_EDI,pvVar1,seed,(void *)unaff_ESI->_shift3,(RoomDescriptor **)0x0); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x44)); pvVar1 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fc; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); seed = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; unaff_ESI->_seed = seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar2 = g_invalidRoomDescriptorGuard; iVar4 = *(int *)pvVar1; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = randomRoom; if (*(int *)(iVar4 + 0xc) < iVar2) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar4 = *(int *)pvVar1; } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fc; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x200; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); seed = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; unaff_ESI->_seed = seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar2 = g_invalidRoomDescriptorGuard; iVar4 = *(int *)pvVar1; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = randomRoom; if (*(int *)(iVar4 + 0xc) < iVar2) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar4 = *(int *)pvVar1; } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x200; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fe; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); seed = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; unaff_ESI->_seed = seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac), 0xffffffff,0); iVar2 = g_invalidRoomDescriptorGuard; iVar4 = *(int *)pvVar1; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = randomRoom; if ((*(int *)(iVar4 + 0xc) < iVar2) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1) ) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x1fe; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); manager = g_manager; game = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar4 = 1; } else { iVar4 = 2; } isAchievementUnlocked = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar4; if ((isAchievementUnlocked == 0) && (((manager->_state != 2 || (game == (Game *)0x0)) || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((manager->_persistentGameData)._achievements[0x9a] != 0) || (((manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar4 + 1; } seed = unaff_ESI->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } iVar4 = unaff_ESI->_shift2; seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; seed = seed << ((byte)iVar4 & 0x1f) ^ seed; seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } seed = seed >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ seed; seed = seed << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ seed; seed = seed >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ seed; *(uint *)(unaff_EBP + -0x3ac) = seed % *(uint *)(unaff_EBP + -0x3b8); pvVar1 = ThreadLocalStoragePointer; iVar4 = g_invalidRoomDescriptorGuard; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } seed = seed >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ seed; seed = seed << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ seed; iVar2 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (seed >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ seed) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar2 + 0xc) < iVar4) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1) ) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x207; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); seed = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; unaff_ESI->_seed = seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4), roomSubtype,0); iVar2 = g_invalidRoomDescriptorGuard; iVar4 = *(int *)pvVar1; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = randomRoom; if ((*(int *)(iVar4 + 0xc) < iVar2) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1) ) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x207; } roomDesc->Data = *(void **)(unaff_EBP + -0x3ac); seed = unaff_ESI->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; iVar4 = *(int *)pvVar1; unaff_ESI->_seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } roomDesc = &g_roomDescriptorDummy; if ((uint)unaff_EBX->_currentDimensionIdx < 3) { roomDesc = unaff_EBX->_roomList + 0x20c; } Seeds::Init3((Seeds *)roomDesc,unaff_ESI); seed = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = unaff_ESI->_seed; if (seed == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } seed = seed >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ seed; seed = seed << ((byte)unaff_ESI->_shift2 & 0x1f) ^ seed; roomConfig = *(RoomConfig **)(unaff_EBP + -0x3b0); seed = seed >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ seed; unaff_ESI->_seed = seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar1 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if ((uint)unaff_EBX->_currentDimensionIdx < 3) { unaff_EBX->_roomList[0x20c].Data = randomRoom; } else { g_roomDescriptorDummy.Data = randomRoom; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 0074406b FUN_0074406b /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0074406b(void) { byte bVar1; RoomConfig *pRVar2; int iVar3; uint roomSubtype; code *pcVar4; Game *pGVar5; Manager *pMVar6; void *pvVar7; uint uVar8; RoomConfig_Room *pRVar9; void **ppvVar10; RoomDescriptor *pRVar11; int iVar12; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *unaff_EDI; uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,3,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0); iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar12 + 0xc) < iVar3) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *unaff_EDI; } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x16d44); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x17014); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar12 + 0xc) < iVar3) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *unaff_EDI; } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x17024); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x16ea4); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar12 + 0xc) < iVar3) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x16eb4); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); pMVar6 = g_manager; pGVar5 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar1 == 0) && (((pMVar6->_state != 2 || (pGVar5 == (Game *)0x0)) || (((pGVar5->_dailyChallenge)._id == 0 && (pGVar5->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar6->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar6->_state == 2 && (pGVar5 != (Game *)0x0)) && (((pGVar5->_dailyChallenge)._id != 0 || (pGVar5->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } iVar12 = unaff_ESI->_shift2; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar8 = uVar8 << ((byte)iVar12 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar8; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8; *(uint *)(unaff_EBP + -0x3ac) = uVar8 % *(uint *)(unaff_EBP + -0x3b8); pvVar7 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; iVar3 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar3 + 0xc) < iVar12) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x1751c); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar7; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar12 + 0xc) < iVar3) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x1752c); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar12 = *(int *)pvVar7; unaff_ESI->_seed = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar7 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar9; } else { g_roomDescriptorDummy.Data = pRVar9; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 0074413a FUN_0074413a /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0074413a(void) { byte bVar1; RoomConfig *pRVar2; int iVar3; uint roomSubtype; code *pcVar4; Game *pGVar5; Manager *pMVar6; void *pvVar7; uint uVar8; RoomConfig_Room *pRVar9; void **ppvVar10; RoomDescriptor *pRVar11; int iVar12; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *unaff_EDI; uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x16,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar12 + 0xc) < iVar3) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } iVar12 = *unaff_EDI; } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x17024); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x16ea4); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar12 + 0xc) < iVar3) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x16eb4); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); pMVar6 = g_manager; pGVar5 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar1 == 0) && (((pMVar6->_state != 2 || (pGVar5 == (Game *)0x0)) || (((pGVar5->_dailyChallenge)._id == 0 && (pGVar5->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar6->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar6->_state == 2 && (pGVar5 != (Game *)0x0)) && (((pGVar5->_dailyChallenge)._id != 0 || (pGVar5->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } iVar12 = unaff_ESI->_shift2; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar8 = uVar8 << ((byte)iVar12 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar8; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8; *(uint *)(unaff_EBP + -0x3ac) = uVar8 % *(uint *)(unaff_EBP + -0x3b8); pvVar7 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; iVar3 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8) % *(uint *)(unaff_EBP + -0x3bc); if ((*(int *)(iVar3 + 0xc) < iVar12) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x1751c); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar7; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if ((*(int *)(iVar12 + 0xc) < iVar3) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x1752c); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar12 = *(int *)pvVar7; unaff_ESI->_seed = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; if ((*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if ((*(int *)(*(int *)pvVar7 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar9; } else { g_roomDescriptorDummy.Data = pRVar9; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00744209 FUN_00744209 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00744209(void) { byte bVar1; RoomConfig *pRVar2; int iVar3; uint roomSubtype; code *pcVar4; Game *pGVar5; Manager *pMVar6; void *pvVar7; uint uVar8; RoomConfig_Room *pRVar9; void **ppvVar10; RoomDescriptor *pRVar11; int iVar12; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *unaff_EDI; uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0x10,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),0xffffffff,0) ; iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar12 + 0xc) < iVar3) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x16eb4); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); pMVar6 = g_manager; pGVar5 = g_game; if (((g_manager->_persistentGameData)._achievements[0x98] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { iVar12 = 1; } else { iVar12 = 2; } bVar1 = (g_manager->_persistentGameData)._achievements[0x99]; *(int *)(unaff_EBP + -0x3b8) = iVar12; if ((bVar1 == 0) && (((pMVar6->_state != 2 || (pGVar5 == (Game *)0x0)) || (((pGVar5->_dailyChallenge)._id == 0 && (pGVar5->_isDebug == 0)))))) { *(undefined4 *)(unaff_EBP + -0x3bc) = 1; } else { *(undefined4 *)(unaff_EBP + -0x3bc) = 2; } if (((pMVar6->_persistentGameData)._achievements[0x9a] != 0) || (((pMVar6->_state == 2 && (pGVar5 != (Game *)0x0)) && (((pGVar5->_dailyChallenge)._id != 0 || (pGVar5->_isDebug != 0)))))) { *(int *)(unaff_EBP + -0x3b8) = iVar12 + 1; } uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } iVar12 = unaff_ESI->_shift2; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar8 = uVar8 << ((byte)iVar12 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar8; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8; *(uint *)(unaff_EBP + -0x3ac) = uVar8 % *(uint *)(unaff_EBP + -0x3b8); pvVar7 = ThreadLocalStoragePointer; iVar12 = g_invalidRoomDescriptorGuard; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar8 = uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar8; iVar3 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar8 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar8) % *(uint *)(unaff_EBP + -0x3bc); if (*(int *)(iVar3 + 0xc) < iVar12) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x1751c); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar3 = g_invalidRoomDescriptorGuard; iVar12 = *(int *)pvVar7; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar9; if (*(int *)(iVar12 + 0xc) < iVar3) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } ppvVar10 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar10 = (void **)(unaff_EBX + 0x1752c); } *ppvVar10 = *(void **)(unaff_EBP + -0x3ac); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; iVar12 = *(int *)pvVar7; unaff_ESI->_seed = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; if (*(int *)(iVar12 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } pRVar11 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar11 = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)pRVar11,unaff_ESI); uVar8 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = unaff_ESI->_seed; if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar8; pRVar2 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar8 = uVar8 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar8; unaff_ESI->_seed = uVar8; pRVar9 = RoomConfig::GetRandomRoom (pRVar2,uVar8,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if (*(int *)(*(int *)pvVar7 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar9; } else { g_roomDescriptorDummy.Data = pRVar9; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00744348 FUN_00744348 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00744348(void) { int iVar1; int iVar2; uint roomSubtype; RoomConfig *pRVar3; code *pcVar4; void *pvVar5; uint uVar6; RoomConfig_Room *pRVar7; void **ppvVar8; RoomDescriptor *pRVar9; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; uVar6 = unaff_ESI->_seed; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } iVar1 = unaff_ESI->_shift2; uVar6 = uVar6 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar6; *(undefined8 *)(unaff_EBP + -0x3f0) = 0x300000003; uVar6 = uVar6 << ((byte)iVar1 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar6; *(undefined4 *)(unaff_EBP + -0x3b4) = 0x1a; unaff_ESI->_seed = uVar6; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar6 = uVar6 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar6; *(uint *)(unaff_EBP + -0x3ac) = uVar6 % *(uint *)(unaff_EBP + -0x3b8); pvVar5 = ThreadLocalStoragePointer; iVar1 = g_invalidRoomDescriptorGuard; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar6 = uVar6 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3f0) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)*(undefined4 *)(unaff_EBP + -0x3ec) & 0x1f) ^ uVar6; iVar2 = *(int *)ThreadLocalStoragePointer; *(int *)(unaff_EBP + -0x3ac) = *(int *)(unaff_EBP + -0x3ac) + (uVar6 >> ((byte)*(undefined4 *)(unaff_EBP + -0x3b4) & 0x1f) ^ uVar6) % *(uint *)(unaff_EBP + -0x3bc); if (*(int *)(iVar2 + 0xc) < iVar1) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } pRVar9 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar9 = (RoomDescriptor *)(unaff_EBX + 0x1751c); } Seeds::Init3((Seeds *)pRVar9,unaff_ESI); uVar6 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3c4) = 0; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = unaff_ESI->_seed; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar6 = uVar6 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar6; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar6 = uVar6 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar6; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar6 = uVar6 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar6; unaff_ESI->_seed = uVar6; pRVar7 = RoomConfig::GetRandomRoom (pRVar3,uVar6,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar2 = g_invalidRoomDescriptorGuard; iVar1 = *(int *)pvVar5; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar7; if (*(int *)(iVar1 + 0xc) < iVar2) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } ppvVar8 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar8 = (void **)(unaff_EBX + 0x1752c); } *ppvVar8 = *(void **)(unaff_EBP + -0x3ac); uVar6 = unaff_ESI->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = unaff_ESI->_seed; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar6 = uVar6 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar6; iVar1 = *(int *)pvVar5; unaff_ESI->_seed = uVar6 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar6; if (*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } pRVar9 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { pRVar9 = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)pRVar9,unaff_ESI); uVar6 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = unaff_ESI->_seed; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar6 = uVar6 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar6; pRVar3 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar6 = uVar6 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar6; unaff_ESI->_seed = uVar6; pRVar7 = RoomConfig::GetRandomRoom (pRVar3,uVar6,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if (*(int *)(*(int *)pvVar5 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar7; } else { g_roomDescriptorDummy.Data = pRVar7; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00744466 FUN_00744466 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00744466(void) { uint roomSubtype; RoomConfig *pRVar1; int iVar2; code *pcVar3; int iVar4; uint uVar5; RoomConfig_Room *pRVar6; void **ppvVar7; RoomDescriptor *this; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *unaff_EDI; uVar5 = unaff_ESI->_seed; if (uVar5 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar5 = uVar5 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar5; roomSubtype = *(uint *)(unaff_EBP + -0x3ac); uVar5 = uVar5 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar5; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar5 = uVar5 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar5; unaff_ESI->_seed = uVar5; pRVar6 = RoomConfig::GetRandomRoom (pRVar1,uVar5,1,0,2,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3c4),roomSubtype,0); iVar4 = g_invalidRoomDescriptorGuard; iVar2 = *unaff_EDI; *(RoomConfig_Room **)(unaff_EBP + -0x3ac) = pRVar6; if (*(int *)(iVar2 + 0xc) < iVar4) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } ppvVar7 = &g_roomDescriptorDummy.Data; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { ppvVar7 = (void **)(unaff_EBX + 0x1752c); } *ppvVar7 = *(void **)(unaff_EBP + -0x3ac); uVar5 = unaff_ESI->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = unaff_ESI->_seed; if (uVar5 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar5 = uVar5 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar5; iVar2 = *unaff_EDI; unaff_ESI->_seed = uVar5 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar5; if (*(int *)(iVar2 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } this = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { this = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)this,unaff_ESI); uVar5 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = unaff_ESI->_seed; if (uVar5 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar5 = uVar5 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar5; pRVar1 = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar5 = uVar5 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar5; unaff_ESI->_seed = uVar5; pRVar6 = RoomConfig::GetRandomRoom (pRVar1,uVar5,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if (*(int *)(*unaff_EDI + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar6; } else { g_roomDescriptorDummy.Data = pRVar6; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00744500 FUN_00744500 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00744500(void) { int iVar1; RoomConfig *this; code *pcVar2; uint uVar3; RoomConfig_Room *pRVar4; RoomDescriptor *this_00; int unaff_EBX; int unaff_EBP; RNG *unaff_ESI; int *unaff_EDI; uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; iVar1 = *unaff_EDI; unaff_ESI->_seed = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; if (*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; _Init_thread_footer(); } } this_00 = &g_roomDescriptorDummy; if (*(uint *)(unaff_EBX + 0x1830c) < 3) { this_00 = (RoomDescriptor *)(unaff_EBX + 0x178b4); } Seeds::Init3((Seeds *)this_00,unaff_ESI); uVar3 = unaff_ESI->_seed; *(undefined4 *)(unaff_EBP + -0x3ac) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = unaff_ESI->_seed; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar3 = uVar3 >> ((byte)unaff_ESI->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)unaff_ESI->_shift2 & 0x1f) ^ uVar3; this = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar3 = uVar3 >> ((byte)unaff_ESI->_shift3 & 0x1f) ^ uVar3; unaff_ESI->_seed = uVar3; pRVar4 = RoomConfig::GetRandomRoom (this,uVar3,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if (*(int *)(*unaff_EDI + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar4; } else { g_roomDescriptorDummy.Data = pRVar4; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00744570 FUN_00744570 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00744570(void) { RoomConfig *this; code *pcVar1; uint uVar2; RoomConfig_Room *pRVar3; int unaff_EBX; int unaff_EBP; uint *unaff_ESI; int *unaff_EDI; uVar2 = *unaff_ESI; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar2 = uVar2 >> ((byte)unaff_ESI[1] & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)unaff_ESI[2] & 0x1f) ^ uVar2; this = *(RoomConfig **)(unaff_EBP + -0x3b0); uVar2 = uVar2 >> ((byte)unaff_ESI[3] & 0x1f) ^ uVar2; *unaff_ESI = uVar2; pRVar3 = RoomConfig::GetRandomRoom (this,uVar2,1,0,0xf,0xd,0,-1,1,10,(uint *)(unaff_EBP + -0x3ac),1,0); if (*(int *)(*unaff_EDI + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(); if (g_invalidRoomDescriptorGuard == -1) { *(undefined4 *)(unaff_EBP + -4) = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(); } } if (*(uint *)(unaff_EBX + 0x1830c) < 3) { *(RoomConfig_Room **)(unaff_EBX + 0x178c4) = pRVar3; } else { g_roomDescriptorDummy.Data = pRVar3; } ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00744940 Level::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (Level::Init) */ void Level::Init(byte param_1) { code *pcVar1; byte bVar2; char isLabyrinthAllowed; RoomDescriptor *pRVar3; uint uVar4; Entity_Player *player; int iVar5; RoomConfig *lastChallengeIdx; uint uVar6; uint uVar7; uint uVar8; RoomDescriptor *neighborRoom; int *piVar9; ChallengeParam *challengeParams; uint preventedCurses; Entity_Effect *voiceoverTimer; Game *in_ECX; int extraout_ECX; RoomConfig *pRVar10; Game *game; void *pvVar11; Game *currentLevel; uint uStack_80; uint uStack_78; void *neighborSet [2]; uint local_6c; int *queueProxy; int queueMap; uint queueMapSize; uint queueOffset; int queueSize; RoomDescriptor *nearbyRooms; undefined4 uStack_50; Game *level; RoomDescriptor *pRStack_48; RoomConfig *pRStack_44; byte local_3d; RoomConfig *local_3c; RoomDescriptor *local_38; RNG curseRng; uint local_24; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; void *pvStack_14; char *curseMessage; uint *gameStateFlagsHigh; bool isAltPath; void *myosotisEnd; void **myosotisEndRef; EntitySaveState *newSaveState; qword oldGameStateFlags; int stageRooms; game = g_game; ppvStack_20 = neighborSet + 0x1c; pvStack_14 = (void *)0xffffffff; puStack_18 = &LAB_00afddd5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(neighborSet + 0x19); ExceptionList = &local_1c; oldGameStateFlags = g_game->_gameStateFlags; gameStateFlagsHigh = (uint *)((int)&g_game->_gameStateFlags + 4); *gameStateFlagsHigh = *gameStateFlagsHigh & 0xffffefff; *(int *)&game->_gameStateFlags = (int)oldGameStateFlags; in_ECX->field_0x188f8 = 0; in_ECX->_levelStateFlags = in_ECX->_levelStateFlags & 0xfcffffff; level = in_ECX; local_3d = PlayerManager::AnyoneHasTrinket(&game->_playerManager,0x89); pvVar11 = (in_ECX->_myosotisPickups)._begin; myosotisEnd = (in_ECX->_myosotisPickups)._end; if (pvVar11 != myosotisEnd) { do { invoke_pending_callbacks(pvVar11); pvVar11 = (void *)((int)pvVar11 + 0x78); } while (pvVar11 != myosotisEnd); pvVar11 = (level->_myosotisPickups)._begin; in_ECX = level; } (in_ECX->_myosotisPickups)._end = pvVar11; if (local_3d != 0) { local_38 = (RoomDescriptor *)&in_ECX->_roomList[0].SavedEntities._end; local_6c = 0x1fb; do { if ((*(int *)((int)local_38 + -0x68) != 0) && (*(int *)((int)local_38 + -0x38) != 0)) { piVar9 = ((std_vector *)((int)local_38 + -4))->_begin; pRVar3 = local_38; if (piVar9 != *(int **)local_38) { do { if ((*piVar9 == 5) && (piVar9[5] == 0)) { bVar2 = Entity_Pickup::IsChest(piVar9[1]); if (((bVar2 == 0) && (((((extraout_ECX != 0x17c && (extraout_ECX != 0x172)) && (extraout_ECX != 0x154)) && ((extraout_ECX != 0x29 && (extraout_ECX != 0x186)))) && (extraout_ECX != 100) ))) && (extraout_ECX != 0x96)) { newSaveState = (in_ECX->_myosotisPickups)._end; if (newSaveState == (in_ECX->_myosotisPickups)._capacity) { std::vector::_Emplace_reallocate(newSaveState,piVar9); } else { EntitySaveState::copy(newSaveState,piVar9); myosotisEndRef = &(in_ECX->_myosotisPickups)._end; *myosotisEndRef = (void *)((int)*myosotisEndRef + 0x78); } } pRVar3 = local_38; } piVar9 = piVar9 + 0x1e; } while (piVar9 != *(int **)pRVar3); } } local_38 = (RoomDescriptor *)((int)local_38 + 0xb8); local_6c = local_6c + -1; } while (local_6c != 0); } game = g_game; in_ECX->_currentRoomMap = in_ECX->_roomMap; in_ECX->_isLevelGenerating = 1; in_ECX->_currentDimensionIdx = 0; in_ECX->_lastRoomDimensionIdx = 0; in_ECX->_levelStateFlags = 0; in_ECX->_ventricleRazorPortals[0xc] = 0x61; in_ECX->_ventricleRazorPortals[0xd] = 0x79; in_ECX->_ventricleRazorPortals[0xe] = 0xfe; in_ECX->_ventricleRazorPortals[0xf] = 0xff; in_ECX->_ventricleRazorPortals[0] = 0x61; in_ECX->_ventricleRazorPortals[1] = 0x79; in_ECX->_ventricleRazorPortals[2] = 0xfe; in_ECX->_ventricleRazorPortals[3] = 0xff; in_ECX->_greedWavesClearedWithoutRedHeartDamage = 0; *(undefined2 *)&in_ECX->field_0x10 = 0; in_ECX->_devilRoomDisabled = 0; in_ECX->_bombPickupsSpawned = 0; game->_donationModAngel = 0; if ((in_ECX->_stageType == 4) || (in_ECX->_stageType == 5)) { isAltPath = true; } else { isAltPath = false; } local_3c = (RoomConfig *)&game->_seedEffects; local_6c = in_ECX->_stage + 1; if (!isAltPath) { local_6c = in_ECX->_stage; } if ((game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); game = g_game; } if (local_6c == 0) { uVar4 = 0; } else { uVar4 = local_6c; if (0xc < local_6c) { uVar4 = 0xd; } } local_3c = (RoomConfig *)((Seeds *)local_3c)->_stageSeeds[uVar4]; (in_ECX->_generationRNG)._shift1 = 5; (in_ECX->_generationRNG)._shift2 = 9; (in_ECX->_generationRNG)._shift3 = 7; (in_ECX->_generationRNG)._seed = (int)local_3c; (in_ECX->_devilAngelRoomRNG)._shift1 = 1; (in_ECX->_devilAngelRoomRNG)._shift2 = 5; (in_ECX->_devilAngelRoomRNG)._seed = (int)local_3c; (in_ECX->_devilAngelRoomRNG)._shift3 = 0x13; uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; game = g_game; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; (in_ECX->_generationRNG)._seed = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; if (game->_challenge == 0x2c) { InitStageSeeds(); } reset_room_list((Level *)in_ECX,param_1); if (param_1 != 0) { FUN_00745b70(); } KAGE_LogMessage(1,(byte *)"Level::Init m_Stage %d, m_StageType %d Seed %u\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; (in_ECX->_generationRNG)._seed = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; iVar5 = in_ECX->_stage; if ((((iVar5 == 2) || (iVar5 == 4)) || (iVar5 == 6)) || (iVar5 == 8)) { bVar2 = 1; } else { bVar2 = 0; } in_ECX->_bossChallenge = bVar2; game = g_game; local_38 = (RoomDescriptor *)0x50; in_ECX->_enterDoor = -1; in_ECX->_leaveDoor = -1; in_ECX->_startingRoomIdx = 0x54; *(undefined4 *)&in_ECX->field_0x18330 = 0xffffffff; in_ECX->_dungeonReturnRoomIndex = 0x54; uStack_80 = uStack_80 & 0xffffff00; (in_ECX->_dungeonReturnPosition).x = 320.0; (in_ECX->_dungeonReturnPosition).y = 280.0; *(undefined4 *)&in_ECX->field_0x188fc = 0xffffffff; *(undefined4 *)&in_ECX->field_0x18900 = 0; *(uint *)&in_ECX->field_0x18904 = uStack_80; *(undefined4 *)&in_ECX->field_0x18908 = 0; uStack_78 = uStack_78 & 0xffffff00; *(uint *)&in_ECX->field_0x1890c = uStack_78; in_ECX->_greedModeWave = 0; in_ECX->_greedLastBeatenWave = 0; in_ECX->_greedLastPaidWave = 0; in_ECX->_greedModeTreasureRoomIdx = -1; in_ECX->_angelRoomChance = 0.0; if (game->_difficulty == 1) { local_38 = (RoomDescriptor *)0x28; } if (((g_manager->_persistentGameData)._achievements[4] != 0) || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { local_3c = (RoomConfig *)0x14; local_38 = (RoomDescriptor *)0x1e; if (game->_difficulty == 1) { local_38 = (RoomDescriptor *)0x14; } } local_3d = (g_manager->_persistentGameData)._achievements[0x21]; if ((local_3d != 0) || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { local_38 = (RoomDescriptor *)((uint)(game->_difficulty != 1) * 4 + 6); } if (((g_manager->_persistentGameData)._eventCounters[0xb] != 0) || ((game->_dailyChallenge)._id != 0)) { local_38 = (RoomDescriptor *)((uint)(game->_difficulty != 1) * 2 + 3); } iVar5 = in_ECX->_stage; if (iVar5 == 1) { if ((local_3d == 0) && ((g_manager->_state != 2 || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { local_38 = (RoomDescriptor *)0x0; } LAB_00744e92: if ((game->_gameStateFlags & 0x1000000000000) == 0) goto LAB_00744ea8; LAB_00745018: curseRng._seed = (in_ECX->_generationRNG)._seed; curseRng._shift1 = 5; curseRng._shift2 = 9; curseRng._shift3 = 7; in_ECX->_curses = 0; goto LAB_0074503d; } if (iVar5 == 0xd) goto LAB_00745018; if (iVar5 - 1U < 6) goto LAB_00744e92; LAB_00744ea8: curseRng._seed = (in_ECX->_generationRNG)._seed; curseRng._shift1 = 5; curseRng._shift2 = 9; curseRng._shift3 = 7; in_ECX->_curses = 0; if (local_38 == (RoomDescriptor *)0x0) goto LAB_0074503d; player = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x104,(RNG **)&game->_playerManager,1); game = g_game; if ((player != (Entity_Player *)0x0) || ((g_game->_dailyChallenge)._specialDailyId == 0x12)) goto LAB_0074503d; uVar4 = RNG::RandomInt(&curseRng,(uint)local_38); if (uVar4 != 0) goto LAB_00745005; if ((curseRng._seed == 0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), curseRng._seed == 0)) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } game = g_game; curseRng._seed = (uint)curseRng._seed >> ((byte)curseRng._shift1 & 0x1f) ^ curseRng._seed; curseRng._seed = curseRng._seed << ((byte)curseRng._shift2 & 0x1f) ^ curseRng._seed; curseRng._seed = (uint)curseRng._seed >> ((byte)curseRng._shift3 & 0x1f) ^ curseRng._seed; switch((uint)curseRng._seed % 6) { case 0: isLabyrinthAllowed = CanStageHaveCurseOfLabyrinth(in_ECX->_stage); if (isLabyrinthAllowed != '\0') { in_ECX->_curses = in_ECX->_curses | 2; curseMessage = "Curse of the Labyrinth!\n"; goto LAB_00744ffb; } break; case 1: bVar2 = Game::IsGreedMode(g_game); if ((bVar2 == 0) && (game->_challenge != 0x2c)) { in_ECX->_curses = in_ECX->_curses | 4; curseMessage = "Curse of the Lost!\n"; goto LAB_00744ffb; } break; case 2: in_ECX->_curses = in_ECX->_curses | 1; curseMessage = "Curse of Darkness!\n"; goto LAB_00744ffb; case 3: in_ECX->_curses = in_ECX->_curses | 8; curseMessage = "Curse of the Unknown\n"; LAB_00744ffb: KAGE_LogMessage(1,(byte *)curseMessage); break; case 4: bVar2 = Game::IsGreedMode(g_game); if (bVar2 == 0) { in_ECX->_curses = in_ECX->_curses | 0x20; curseMessage = "Curse of Maze\n"; goto LAB_00744ffb; } break; case 5: if ((g_game->_dailyChallenge)._id == 0) { in_ECX->_curses = in_ECX->_curses | 0x40; curseMessage = "Curse of Blind\n"; goto LAB_00744ffb; } } LAB_00745005: iVar5 = FUN_00864ae0(in_ECX->_curses); game = g_game; in_ECX->_curses = iVar5; LAB_0074503d: if ((game->_dailyChallenge)._specialDailyId == 0x25) { in_ECX->_curses = in_ECX->_curses | 0x4c; } local_3c = (RoomConfig *)game->_challenge; if (local_3c != (RoomConfig *)0x0) { pvVar11 = (g_manager->_challengeParams)._begin; lastChallengeIdx = (RoomConfig *)(((int)(g_manager->_challengeParams)._end - (int)pvVar11) / 0xa4 + -1); pRVar10 = local_3c; if (lastChallengeIdx <= local_3c) { pRVar10 = lastChallengeIdx; } in_ECX->_curses = in_ECX->_curses | *(uint *)((int)pRVar10 * 0xa4 + 0x84 + (int)pvVar11); game = g_game; uVar4 = ~*(uint *)((int)pRVar10 * 0xa4 + 0x88 + (int)pvVar11) & in_ECX->_curses; in_ECX->_curses = uVar4; if (game->_challenge != 0x2c) { uVar6 = in_ECX->_stage & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } if ((((uVar6 == 1) && (in_ECX->_stage < 8)) && (game->_difficulty != 2)) && (game->_difficulty != 3)) goto LAB_007450e7; } in_ECX->_curses = uVar4 & 0xfffffffd; } LAB_007450e7: if ((in_ECX->_stage == 9) || (2 < game->_victoryLap)) { in_ECX->_curses = in_ECX->_curses & 0xfffffffe; } HUD::InvalidateCraftingItem(&game->_hud,(Entity_Player *)0x0); RoomConfig::ClearGeneratedRooms(); game = g_game; if (in_ECX->_stage == 0xc) { pRStack_48 = (RoomDescriptor *)0x1; local_38 = (RoomDescriptor *)0xc4; do { pRVar3 = local_38; if (pRStack_48 != (RoomDescriptor *)&DAT_0000000d) { local_3c = &g_game->_roomConfig; if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { uVar4 = 0; } else { uVar4 = 1; } iVar5 = uVar4 * 0x2c; if ((&local_3c->field_0x0)[(int)local_38 + iVar5 + 0x8c] == '\0') { RoomConfig::LoadStageBinary(local_3c,(uint)pRStack_48,uVar4); } else { uVar4 = 0; if (*(int *)(&local_3c->field_0x0 + (int)local_38 + iVar5 + 0x80) != 0) { pRStack_44 = (RoomConfig *)0x0; do { uVar4 = uVar4 + 1; *(undefined4 *) ((int)pRStack_44 + 0x34 + *(int *)(&local_3c->field_0x0 + (int)local_38 + iVar5 + 0x7c)) = *(undefined4 *) ((int)pRStack_44 + 0x30 + *(int *)(&local_3c->field_0x0 + (int)local_38 + iVar5 + 0x7c)); pRStack_44 = (RoomConfig *)((int)pRStack_44 + 0x5c); } while (uVar4 < *(uint *)(&local_3c->field_0x64 + iVar5 + (int)local_38 + 0x1c)); } } } local_38 = (RoomDescriptor *)((int)pRVar3 + 0xc4); pRStack_48 = (RoomDescriptor *)((int)&pRStack_48->GridIndex + 1); } while (local_38 < 0xd05); LAB_0074526e: in_ECX = level; LAB_00745271: game = g_game; } else { local_3c = &g_game->_roomConfig; pRStack_44 = (RoomConfig *)RoomConfig::GetStageID(in_ECX->_stage,in_ECX->_stageType,-1); local_38 = (RoomDescriptor *)(game->_ventricleRazorPortals + (int)pRStack_44 * 0xc4 + 0x598); if ((game == (Game *)0x0) || ((game->_difficulty != 2 && (game->_difficulty != 3)))) { uVar4 = 0; } else { uVar4 = 1; } pRStack_48 = (RoomDescriptor *)(uVar4 * 0x2c); if (*(byte *)((int)&(pRStack_48->SavedEffects)._end + (int)local_38) == 0) { RoomConfig::LoadStageBinary(local_3c,(uint)pRStack_44,uVar4); goto LAB_00745271; } if (*(int *)((int)local_38->_doors + (int)&pRStack_48->BossDeathSeed) != 0) { uVar4 = 0; iVar5 = 0; do { stageRooms = *(int *)((int)&(pRStack_48->SavedEntities)._capacity + (int)local_38); uVar4 = uVar4 + 1; *(undefined4 *)(iVar5 + 0x34 + stageRooms) = *(undefined4 *)(iVar5 + 0x30 + stageRooms); iVar5 = iVar5 + 0x5c; } while (uVar4 < *(uint *)((int)local_38->_doors + (int)&pRStack_48->BossDeathSeed)); goto LAB_0074526e; } } if ((((game->_difficulty != 2) && (game->_difficulty != 3)) && ((iVar5 = in_ECX->_stage, 5 < iVar5 - 1U || ((game->_gameStateFlags & 0x1000000000000) == 0))) ) && ((in_ECX->_stageType == 4 || (in_ECX->_stageType == 5)))) { if (iVar5 == 4) { LAB_007452f7: pRStack_44 = &game->_roomConfig; if ((game->_difficulty == 2) || (game->_difficulty == 3)) { uVar4 = 1; } else { uVar4 = 0; } local_3c = (RoomConfig *)(uVar4 * 0x2c); if ((&local_3c->field_0x16c0)[(int)pRStack_44] == '\0') { RoomConfig::LoadStageBinary(pRStack_44,0x1d,uVar4); } else { uVar4 = 0; if (*(int *)(&local_3c->field_0x16b4 + (int)pRStack_44) == 0) goto LAB_0074536a; iVar5 = 0; do { uVar4 = uVar4 + 1; *(undefined4 *)(iVar5 + 0x34 + *(int *)(&local_3c->field_0x16b0 + (int)pRStack_44)) = *(undefined4 *)(iVar5 + 0x30 + *(int *)(&local_3c->field_0x16b0 + (int)pRStack_44)); iVar5 = iVar5 + 0x5c; } while (uVar4 < *(uint *)(&local_3c->field_0x16b4 + (int)pRStack_44)); } game = g_game; } else if (iVar5 == 3) { uVar4 = game->_debugCurses; uVar6 = in_ECX->_curses; uVar7 = Seeds::GetForcedCurses(); uVar8 = Seeds::GetPreventedCurses(); game = g_game; if ((~uVar8 & (uVar7 | uVar4 | uVar6) & 2) != 0) goto LAB_007452f7; } } LAB_0074536a: currentLevel = level; iVar5 = game->_difficulty; if ((iVar5 == 2) || (iVar5 == 3)) { pRVar10 = &game->_roomConfig; if ((iVar5 == 2) || (iVar5 == 3)) { uVar4 = 1; } else { uVar4 = 0; } pRStack_44 = (RoomConfig *)(uVar4 * 0x2c); if ((&pRStack_44->field_0x8c)[(int)pRVar10] == '\0') { RoomConfig::LoadStageBinary(pRVar10,0,uVar4); } else { uVar4 = 0; if (*(int *)(&pRStack_44->field_0x80 + (int)pRVar10) != 0) { iVar5 = 0; do { iVar5 = iVar5 + 0x5c; uVar4 = uVar4 + 1; *(undefined4 *)(*(int *)(&pRStack_44->field_0x7c + (int)pRVar10) + -0x28 + iVar5) = *(undefined4 *)(*(int *)(&pRStack_44->field_0x7c + (int)pRVar10) + -0x2c + iVar5); } while (uVar4 < *(uint *)(&pRStack_44->field_0x80 + (int)pRVar10)); } } currentLevel = level; generate_greed(); } else { iVar5 = level->_stage; if (iVar5 == 0xd) { Game::generate_home_level(level); } else if ((iVar5 < 7) && ((game->_gameStateFlags & 0x1000000000000) != 0)) { generate_backwards(); } else if (game->_challenge == 0x2c) { generate_random_layout((Level *)level); } else if (iVar5 == 9) { generate_home((Level *)level); } else { RoomConfig::ResetStageWeights(0,0xffffffff); generate_dungeon((Level *)currentLevel,&curseRng); } } FUN_0073e040(); uVar4 = (currentLevel->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (currentLevel->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar4 = uVar4 >> ((byte)(currentLevel->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(currentLevel->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(currentLevel->_generationRNG)._shift3 & 0x1f) ^ uVar4; (currentLevel->_generationRNG)._seed = uVar4; currentLevel->_dungeonPlacementSeed = uVar4; if (((game->_difficulty != 2) && (game->_difficulty != 3)) && (currentLevel->_stage == 0xc)) { if (-1 < *(int *)¤tLevel->field_0x18330) { get_rooms_within_two_doors (&nearbyRooms, currentLevel->_roomList[*(int *)¤tLevel->field_0x18330].GridIndex); pvStack_14 = (void *)0x0; queueProxy = (int *)0x0; queueMap = 0; queueMapSize = 0; queueOffset = 0; queueSize = 0; queueProxy = operator_new(8); queueProxy[1] = 0; *queueProxy = (int)&queueProxy; pvStack_14 = (void *)CONCAT31(pvStack_14._1_3_,1); pRStack_48 = (RoomDescriptor *)nearbyRooms->GridIndex; if (pRStack_48 != nearbyRooms) { do { pRVar3 = pRStack_48; neighborRoom = GetRoomByIdx((Level *)currentLevel,(int)pRStack_48->Data,-1); neighborRoom->DeliriumDistance = 1; if (((queueSize + queueOffset & 3) == 0) && (queueMapSize <= queueSize + 4U >> 2)) { std::deque<4byte>::_Growmap(queueOffset); } queueOffset = queueOffset & queueMapSize * 4 - 1; pRStack_44 = (RoomConfig *)(queueSize + queueOffset); local_3c = (RoomConfig *)((uint)pRStack_44 >> 2 & queueMapSize - 1); if (*(int *)(queueMap + (int)local_3c * 4) == 0) { pvVar11 = operator_new(0x10); *(void **)(queueMap + (int)local_3c * 4) = pvVar11; } *(void **)(*(int *)(queueMap + (int)local_3c * 4) + ((uint)pRStack_44 & 3) * 4) = pRVar3->Data; queueSize = queueSize + 1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&pRStack_48); } while (pRStack_48 != nearbyRooms); } while (queueSize != 0) { piVar9 = (int *)FUN_00684fc0(); iVar5 = *piVar9; queueSize = queueSize + -1; if (queueSize == 0) { queueOffset = 0; } pRStack_48 = GetRoomByIdx((Level *)currentLevel,iVar5,-1); pRStack_44 = (RoomConfig *)get_rooms_within_two_doors(neighborSet,iVar5); pRVar3 = nearbyRooms; if ((RoomConfig *)&nearbyRooms != pRStack_44) { FID_conflict__Erase_tree_>_> (&nearbyRooms, (fuzzer_allocator_> *)&nearbyRooms, (_Tree_node *)nearbyRooms->SafeGridIndex); pRVar3->SafeGridIndex = (int)pRVar3; pRVar3->GridIndex = (int)pRVar3; pRVar3->ListIndex = (int)pRVar3; pRVar3 = *(RoomDescriptor **)pRStack_44; uStack_50 = *(undefined4 *)&pRStack_44->field_0x4; *(RoomDescriptor **)pRStack_44 = nearbyRooms; *(undefined4 *)&pRStack_44->field_0x4 = 0; nearbyRooms = pRVar3; } FID_conflict__Erase_tree_>_> (neighborSet,(fuzzer_allocator_> *)neighborSet ,*(_Tree_node **)((int)neighborSet[0] + 4)); operator_delete(neighborSet[0],0x14); local_38 = (RoomDescriptor *)nearbyRooms->GridIndex; if (local_38 != nearbyRooms) { do { pRVar3 = local_38; neighborRoom = GetRoomByIdx((Level *)currentLevel,(int)local_38->Data,-1); if (neighborRoom->DeliriumDistance < 1) { neighborRoom->DeliriumDistance = pRStack_48->DeliriumDistance + 1; if (((queueSize + queueOffset & 3) == 0) && (queueMapSize <= queueSize + 4U >> 2)) { std::deque<4byte>::_Growmap(queueOffset); } queueOffset = queueOffset & queueMapSize * 4 - 1; pRStack_44 = (RoomConfig *)(queueSize + queueOffset); local_3c = (RoomConfig *)(queueMapSize - 1 & (uint)pRStack_44 >> 2); if (*(int *)(queueMap + (int)local_3c * 4) == 0) { pvVar11 = operator_new(0x10); *(void **)(queueMap + (int)local_3c * 4) = pvVar11; } *(void **)(*(int *)(queueMap + (int)local_3c * 4) + ((uint)pRStack_44 & 3) * 4) = pRVar3->Data; queueSize = queueSize + 1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_38); } while (local_38 != nearbyRooms); } } std::deque<4byte>::~deque(); pvStack_14 = (void *)0xffffffff; FID_conflict__Erase_tree_>_> (&nearbyRooms,(fuzzer_allocator_> *)&nearbyRooms ,(_Tree_node *)nearbyRooms->SafeGridIndex); operator_delete(nearbyRooms,0x14); game = g_game; } } iVar5 = currentLevel->_startingRoomIdx; currentLevel->_currentRoomIdx = iVar5; currentLevel->_lastRoomIdx = iVar5; if ((currentLevel->_stage - 1U < 6) && (bVar2 = Game::GetGameStateFlag((Game *)&game->_gameStateFlags,0x30), bVar2 != 0)) { iVar5 = currentLevel->_roomList[currentLevel->_lastBossRoomListIdx].SafeGridIndex; currentLevel->_dungeonReturnRoomIndex = iVar5; currentLevel->_currentRoomIdx = iVar5; currentLevel->_lastRoomIdx = iVar5; } GetRoomByIdx((Level *)currentLevel,iVar5,-1); KAGE_LogMessage(1,(byte *)"CURRENT ROOM INDEX %d %08x\n"); if ((g_game->_challenge == 0x1f) && (currentLevel->_stage == 0xb)) { currentLevel->_lastRoomIdx = -7; currentLevel->_currentRoomIdx = -7; load_room((Level *)currentLevel); Room::Update(); } else { load_room((Level *)currentLevel); } Room::PlayMusic(g_game->_room); if ((g_game->_challenge != 0x1f) || (currentLevel->_stage == 0xb)) { Game::UpdateVisibility(currentLevel); } game = g_game; if (g_game->_stage == 0xb) { challengeParams = Game::GetChallengeParams(g_game); if ((challengeParams->_isMegaSatan != 0) && (game->_challenge != 0x1f)) { player = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0xee,(RNG **)&game->_playerManager,1); if (player == (Entity_Player *)0x0) { player = Game::GetPlayer(g_game,0); Entity_Player::AddCollectible(player,0xee,0,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,0xee,0,0); } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xef,(RNG **)&g_game->_playerManager,1); if (player == (Entity_Player *)0x0) { player = Game::GetPlayer(g_game,0); Entity_Player::AddCollectible(player,0xef,0,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,0xef,0,0); } game = g_game; } } if (5 < currentLevel->_stage - 1U) goto LAB_00745a11; bVar2 = Game::GetGameStateFlag((Game *)&game->_gameStateFlags,0x30); if (bVar2 == 0) goto LAB_00745a11; uVar4 = game->_debugCurses; uVar6 = currentLevel->_curses; uVar8 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); uVar7 = local_6c; if (((~preventedCurses & (uVar8 | uVar4 | uVar6) & 2) != 0) && ((local_6c == 2 || (local_6c == 4)))) { uVar7 = local_6c + 1; } if ((g_manager->_optionsConfig)._ascentVoiceover != 0) { switch(uVar7) { case 1: iVar5 = 0x259; break; default: goto LAB_00745a0e; case 3: iVar5 = 600; break; case 5: iVar5 = 599; break; case 7: iVar5 = 0x256; } voiceoverTimer = Entity_Effect::CreateTimer(FUN_00745ad0,0x3c,0,0); voiceoverTimer->_state = iVar5; (**(code **)(*(int *)voiceoverTimer + 0xc))(); } LAB_00745a0e: currentLevel = level; LAB_00745a11: PlayerManager::trigger_level_start(); (g_game->_itemPool)._unkFloat674 = (g_game->_itemPool)._unkFloat678; FUN_00943830(); Camera::DoUpdate(*(Camera **)((int)g_game->_room + 0x11f8),0); TextureCache::Purge(); FUN_00865260(); currentLevel->_isLevelGenerating = 0; ExceptionList = local_1c; return; } //@@ 00745ad0 FUN_00745ad0 void FUN_00745ad0(int param_1) { SFXManager::Stop(&g_manager->_sfxManager,0x256); SFXManager::Stop(&g_manager->_sfxManager,599); SFXManager::Stop(&g_manager->_sfxManager,600); SFXManager::Stop(&g_manager->_sfxManager,0x259); SoundEffects::Play(&g_manager->_sfxManager,*(int *)(param_1 + 0x450),1.0,0,0,1.0,0.0); return; } //@@ 00745b70 FUN_00745b70 void FUN_00745b70(void) { Game *pGVar1; RoomConfig_Room *pRVar2; int in_ECX; RoomDescriptor *this; RNG local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afde11; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } pGVar1 = g_game; if (*(uint *)(in_ECX + 0x1830c) < 3) { this = (RoomDescriptor *)(in_ECX + 0x17a24); } else { this = &g_roomDescriptorDummy; } if (this->Data == (void *)0x0) { local_20._seed = (g_game->_seedEffects)._gameStartSeed; if (local_20._seed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); local_20._seed = (pGVar1->_seedEffects)._gameStartSeed; } local_20._shift3 = 0x1d; local_20._shift1 = 3; local_20._shift2 = 7; Seeds::Init3((Seeds *)this,&local_20); pRVar2 = RoomConfig::GetRoomByStageTypeAndVariant(&g_game->_roomConfig,0,1,2,0); this->Data = pRVar2; } ExceptionList = local_10; return; } //@@ 00745ca0 Level::get_stage_display_name /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? string out; RoomConfig::GetStageID + RoomConfigStage::GetDisplayName, appends "!"/"!!"/"!!!"/"!V"/" Spikes"/"... Please stop." suffixes, string_scramble_seeded; called by Level::GetName and menus prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ std_string * __cdecl Level::get_stage_display_name (std_string *outName,int stage,int stageType,uint curses,int numeral,byte isScrambled, int mode) { byte *text; uint uVar1; byte *textEnd; std_string *scrambleResult; void *ptr; int *romanEntry; int remaining; char acStackY_130 [128]; void *in_stack_ffffff54; int in_stack_ffffff58; int in_stack_ffffff5c; int iVar2; char *outName_00; uint uVar3; uint resultSize; uint resultCapacity; std_string scrambledName; std_string tmpString; std_string stageName; uint local_24; char *pcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte ch; Game *game; game = g_game; pcStack_20 = (char *)((int)register0x00000010 + 0xfffffffc); local_14 = 0xffffffff; puStack_18 = &LAB_00afde56; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((int)register0x00000010 + 0xfffffff0U); if (stage == 0) { outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; outName->_size = 0; outName->_buf[0] = '\0'; return outName; } if (mode == -1) { if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { mode = 0; } else { mode = 1; } } ExceptionList = &local_1c; uVar1 = RoomConfig::GetStageID(stage,stageType,mode); outName_00 = stageName._buf; uVar3 = 0x14; iVar2 = 0x745d67; RoomConfigStage::GetDisplayName ((RoomConfig_Stage *)(game->_ventricleRazorPortals + uVar1 * 0xc4 + 0x598), (std_string *)outName_00,0x14); local_14 = 0; if (0 < numeral) { std::string::append(stageName._buf,&DAT_00b656ec,1); local_14 = CONCAT31(local_14._1_3_,1); romanEntry = &DAT_00b6a950; iVar2 = 1000; tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (std_string *)0x0; remaining = numeral; do { if (iVar2 <= remaining) { do { text = (byte *)romanEntry[1]; textEnd = text; do { ch = *textEnd; textEnd = textEnd + 1; } while (ch != 0); std::string::append(tmpString._buf,text,(int)textEnd - (int)(text + 1)); remaining = remaining - *romanEntry; } while (*romanEntry <= remaining); } iVar2 = romanEntry[2]; romanEntry = romanEntry + 2; } while (0 < iVar2); outName_00 = tmpString._buf; if (0xf < tmpString._capacity) { outName_00 = (char *)tmpString._buf._0_4_; } iVar2 = 0x745e0b; uVar3 = tmpString._size; std::string::append(stageName._buf,(byte *)outName_00,tmpString._size); local_14 = local_14 & 0xffffff00; if (0xf < tmpString._capacity) { uVar3 = tmpString._capacity + 1; outName_00 = (char *)tmpString._buf._0_4_; if (0xfff < uVar3) { outName_00 = (char *)((std_string *)(tmpString._buf._0_4_ + -0x18))->_capacity; uVar3 = tmpString._capacity + 0x24; if ((undefined *)0x1f < (undefined *)(tmpString._buf._0_4_ + (-4 - (int)outName_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } iVar2 = 0x745e42; operator_delete(outName_00,uVar3); } if (g_game->_stageNameNumeral == 3) { uVar3 = 1; outName_00 = &DAT_00b6a730; iVar2 = 0x745e62; std::string::append(stageName._buf,&DAT_00b6a730,1); } if (g_game->_stageNameNumeral == 4) { uVar3 = 2; outName_00 = &DAT_00b6a740; iVar2 = 0x745e7f; std::string::append(stageName._buf,&DAT_00b6a740,2); } if (g_game->_stageNameNumeral == 5) { uVar3 = 3; outName_00 = &DAT_00b1cec0; iVar2 = 0x745e9c; std::string::append(stageName._buf,&DAT_00b1cec0,3); } if (g_game->_stageNameNumeral == 0x3e9) { uVar3 = 7; outName_00 = " Spikes"; iVar2 = 0x745ebc; std::string::append(stageName._buf,(byte *)" Spikes",7); } uVar1 = g_game->_stageNameNumeral; if (uVar1 % 1000 == 0) { uVar3 = 0x10; outName_00 = "... Please stop."; } else if (uVar1 % 500 == 0) { uVar3 = 2; outName_00 = &DAT_00b6a764; } else if (uVar1 % 100 == 0) { uVar3 = 3; outName_00 = &DAT_00b6a780; } else if (uVar1 % 0x32 == 0) { uVar3 = 2; outName_00 = &DAT_00b6a77c; } else { if (uVar1 % 10 != 0) goto LAB_00745f4b; uVar3 = 1; outName_00 = &DAT_00b6a758; } iVar2 = 0x745f45; std::string::append(stageName._buf,(byte *)outName_00,uVar3); } LAB_00745f4b: if ((mode != 1) && (g_game->_challenge != 0x2c)) { if ((curses & 2) == 0) { if (numeral != 0) goto LAB_00745fb5; if ((((stage == 1) || (stage == 3)) || (stage == 5)) || (stage == 7)) { uVar3 = 2; outName_00 = &DAT_00b6a760; } else { if (((stage != 2) && (stage != 4)) && ((stage != 6 && (stage != 8)))) goto LAB_00745fb5; uVar3 = 3; outName_00 = &DAT_00b6a75c; } } else { uVar3 = 3; outName_00 = &DAT_00b6a754; } iVar2 = 0x745fb5; std::string::append(stageName._buf,(byte *)outName_00,uVar3); } LAB_00745fb5: if (isScrambled == 0) { resultSize = stageName._size; resultCapacity = stageName._capacity; tmpString._buf._8_4_ = stageName._buf._0_4_; tmpString._buf._12_4_ = stageName._buf._4_4_; tmpString._size = stageName._buf._8_4_; tmpString._capacity = stageName._buf._12_4_; } else { std::string::string(acStackY_130 + 0x84,&stageName); scrambleResult = string_scramble_seeded (&scrambledName,in_stack_ffffff54,in_stack_ffffff58,in_stack_ffffff5c,iVar2, (uint)outName_00,uVar3); if (&stageName == scrambleResult) { resultSize = stageName._size; resultCapacity = stageName._capacity; } else { std::string::_Tidy_deallocate(stageName._buf); resultSize = scrambleResult->_size; resultCapacity = scrambleResult->_capacity; stageName._buf._0_4_ = *(undefined4 *)scrambleResult->_buf; stageName._buf._4_4_ = *(undefined4 *)(scrambleResult->_buf + 4); stageName._buf._8_4_ = *(undefined4 *)(scrambleResult->_buf + 8); stageName._buf._12_4_ = *(undefined4 *)(scrambleResult->_buf + 0xc); scrambleResult->_size = 0; scrambleResult->_capacity = 0xf; scrambleResult->_buf[0] = '\0'; } tmpString._buf._8_4_ = stageName._buf._0_4_; tmpString._buf._12_4_ = stageName._buf._4_4_; tmpString._size = stageName._buf._8_4_; tmpString._capacity = stageName._buf._12_4_; if (0xf < scrambledName._capacity) { uVar3 = scrambledName._capacity + 1; ptr = (void *)scrambledName._buf._0_4_; if (0xfff < uVar3) { ptr = *(void **)(scrambledName._buf._0_4_ + -4); uVar3 = scrambledName._capacity + 0x24; if (0x1f < (scrambledName._buf._0_4_ - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0; *(undefined4 *)outName->_buf = tmpString._buf._8_4_; *(undefined4 *)(outName->_buf + 4) = tmpString._buf._12_4_; *(uint *)(outName->_buf + 8) = tmpString._size; *(uint *)(outName->_buf + 0xc) = tmpString._capacity; outName->_size = resultSize; outName->_capacity = resultCapacity; ExceptionList = local_1c; return outName; } //@@ 007460b0 Level::GetName /* ZHL [lua] Lua binding Level:GetName */ std_string * __thiscall Level::GetName(Level *this,std_string *param_2) { uint uVar1; Game *pGVar2; uint uVar3; uint uVar4; int stageType; void *pvVar5; int stage; Level *numeral; uint uVar6; void *pvVar7; undefined4 uVar8; Level *local_20; undefined4 local_1c; undefined4 local_18; undefined1 local_14 [8]; void *local_c; pGVar2 = g_game; if (g_game->_challenge == 0x2c) { local_20 = (Level *)0x9; std::set::find_node(local_14,&local_20); if ((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 10)) { pvVar5 = local_c; pvVar7 = (pGVar2->_seedEffects)._seedEffects; } else { pvVar5 = (pGVar2->_seedEffects)._seedEffects; pvVar7 = pvVar5; } local_20 = (Level *)0x10; local_1c = CONCAT31(local_1c._1_3_,pvVar5 != pvVar7); std::set::find_node(local_14,&local_20); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x11)) && (local_c != pvVar7)) { local_20 = (Level *)pGVar2->_stageNameNumeral; } else { local_20 = (Level *)0x0; } uVar6 = pGVar2->_debugCurses; uVar1 = this->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); uVar6 = ~uVar4 & (uVar3 | uVar6 | uVar1); stageType = GetRoomStageType(this,this->_currentRoomIndex); stage = this->_stage; numeral = local_20; uVar8 = local_1c; } else { local_1c = 9; local_20 = this; std::set::find_node(local_14,&local_1c); if ((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 10)) { pvVar5 = local_c; pvVar7 = (pGVar2->_seedEffects)._seedEffects; } else { pvVar5 = (pGVar2->_seedEffects)._seedEffects; pvVar7 = pvVar5; } local_1c = 0x10; local_18 = CONCAT31(local_18._1_3_,pvVar5 != pvVar7); std::set::find_node(local_14,&local_1c); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x11)) && (local_c != pvVar7)) { numeral = (Level *)pGVar2->_stageNameNumeral; } else { numeral = (Level *)0x0; } uVar6 = pGVar2->_debugCurses; uVar1 = local_20->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); uVar6 = ~uVar4 & (uVar3 | uVar6 | uVar1); stageType = local_20->_stageType; stage = local_20->_stage; uVar8 = local_18; } get_stage_display_name(param_2,stage,stageType,uVar6,(int)numeral,(byte)uVar8,-1); return param_2; } //@@ 00746260 Level::GetCurseName /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Level:GetCurseName */ int * Level::GetCurseName(int *param_1) { int iVar1; int iVar2; void **ppvVar3; uint forcedCurses; uint preventedCurses; int *piVar4; void *freeBlock; int in_ECX; uint forcedCurses; void *pvVar6; uint uVar7; char acStackY_108 [128]; void *in_stack_ffffff7c; int in_stack_ffffff80; int in_stack_ffffff84; int iVar8; undefined1 *textSize; undefined1 findResult [8]; void *seedNode; int *local_50; undefined4 local_4c; int *outName; int local_44; int curseIdx; void *tmpString [4]; undefined4 tmpStringSize; uint tmpStringCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; Game *game; puStack_20 = (undefined1 *)(tmpString + 0xe); puStack_18 = &LAB_00afde9e; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(tmpString + 0xb); ExceptionList = &local_1c; local_50 = param_1; outName = param_1; *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; local_14 = (void *)0x0; local_4c = 1; curseIdx = 0; local_44 = in_ECX; ppvVar3 = tmpString + 0xe; if (0 < ((int)(g_game->_roomConfig)._curses._end - (int)(g_game->_roomConfig)._curses._begin) / 0x1c) { do { puStack_20 = (undefined1 *)ppvVar3; uVar7 = *(uint *)(local_44 + 0xc); forcedCurses = g_game->_debugCurses; forcedCurses = Seeds::GetForcedCurses(); iVar8 = curseIdx; curseIdx = curseIdx + 1; preventedCurses = Seeds::GetPreventedCurses(); if (((forcedCurses | uVar7 | forcedCurses) & ~preventedCurses & 1 << ((byte)iVar8 & 0x1f)) != 0) { piVar4 = (int *)GetCurseNameByIdx(); param_1 = outName; if (outName != piVar4) { uVar7 = outName[5]; if (0xf < uVar7) { pvVar6 = (void *)*outName; forcedCurses = uVar7 + 1; freeBlock = pvVar6; if (0xfff < forcedCurses) { freeBlock = *(void **)((int)pvVar6 + -4); forcedCurses = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)freeBlock))) goto LAB_00746425; } operator_delete(freeBlock,forcedCurses); } param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; iVar8 = piVar4[1]; iVar1 = piVar4[2]; iVar2 = piVar4[3]; *param_1 = *piVar4; param_1[1] = iVar8; param_1[2] = iVar1; param_1[3] = iVar2; *(undefined8 *)(param_1 + 4) = *(undefined8 *)(piVar4 + 4); piVar4[4] = 0; piVar4[5] = 0xf; *(undefined1 *)piVar4 = 0; } if (0xf < tmpStringCapacity) { uVar7 = tmpStringCapacity + 1; pvVar6 = tmpString[0]; if (0xfff < uVar7) { pvVar6 = *(void **)((int)tmpString[0] + -4); uVar7 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar6))) { LAB_00746425: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar7); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (void *)((uint)tmpString[0] & 0xffffff00); goto LAB_0074644d; } ppvVar3 = (void **)puStack_20; } while (curseIdx < ((int)(g_game->_roomConfig)._curses._end - (int)(g_game->_roomConfig)._curses._begin) / 0x1c); param_1 = outName; } LAB_0074644d: game = g_game; piVar4 = &local_44; local_44 = 9; textSize = findResult; iVar8 = 0x746467; std::set::find_node(); if (((*(char *)((int)seedNode + 0xd) == '\0') && (*(int *)((int)seedNode + 0x10) < 10)) && (seedNode != (game->_seedEffects)._seedEffects)) { std::string::string(acStackY_108 + 0x84,param_1); piVar4 = string_scramble_seeded (tmpString,in_stack_ffffff7c,in_stack_ffffff80,in_stack_ffffff84,iVar8, (uint)textSize,(uint)piVar4); if (param_1 != piVar4) { uVar7 = param_1[5]; if (0xf < uVar7) { pvVar6 = (void *)*param_1; forcedCurses = uVar7 + 1; freeBlock = pvVar6; if (0xfff < forcedCurses) { freeBlock = *(void **)((int)pvVar6 + -4); forcedCurses = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)freeBlock))) goto LAB_0074652d; } operator_delete(freeBlock,forcedCurses); } param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; iVar8 = piVar4[1]; iVar1 = piVar4[2]; iVar2 = piVar4[3]; *param_1 = *piVar4; param_1[1] = iVar8; param_1[2] = iVar1; param_1[3] = iVar2; *(undefined8 *)(param_1 + 4) = *(undefined8 *)(piVar4 + 4); piVar4[4] = 0; piVar4[5] = 0xf; *(undefined1 *)piVar4 = 0; } if (0xf < tmpStringCapacity) { uVar7 = tmpStringCapacity + 1; pvVar6 = tmpString[0]; if (0xfff < uVar7) { pvVar6 = *(void **)((int)tmpString[0] + -4); uVar7 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar6))) { LAB_0074652d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar7); } } ExceptionList = local_1c; return param_1; } //@@ 00746560 Level::ShowName /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Level:ShowName prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Level::ShowName(Level *this,byte isSticky) { byte bVar1; byte *text; byte ****title; byte ****ppppbVar2; byte *pbVar3; uint uVar4; byte ****local_48 [5]; uint local_34; byte ****local_30 [4]; int local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; byte ***local_8; local_8 = (byte ***)0xffffffff; puStack_c = &LAB_00afdee5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; GetName(this,local_48); local_8 = (byte ***)0x0; GetCurseName(local_30); local_8 = (byte ***)CONCAT31(local_8._1_3_,1); if (1 < *(int *)&g_game->_deathmatchManager) { text = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/DEATHMATCH_NAME"); pbVar3 = text; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign((char *)local_48,text,(int)pbVar3 - (int)(text + 1)); std::string::assign((char *)local_30,&s_empty,0); } ppppbVar2 = (byte ****)local_30; if (0xf < local_1c) { ppppbVar2 = local_30[0]; } title = (byte ****)local_48; if (0xf < local_34) { title = local_48[0]; } HUD_Message::Show(&(g_game->_hud)._messageMain,(byte *)title,(byte *)ppppbVar2,isSticky ^ 1, local_20 != 0); if (0xf < local_1c) { uVar4 = local_1c + 1; ppppbVar2 = local_30[0]; if (0xfff < uVar4) { ppppbVar2 = (byte ****)local_30[0][-1]; uVar4 = local_1c + 0x24; if ((byte *)0x1f < (byte *)((int)local_30[0] + (-4 - (int)ppppbVar2))) goto LAB_0074669a; } operator_delete(ppppbVar2,uVar4); } local_20 = 0; local_1c = 0xf; local_30[0] = (byte ****)((uint)local_30[0] & 0xffffff00); if (0xf < local_34) { uVar4 = local_34 + 1; ppppbVar2 = local_48[0]; if (0xfff < uVar4) { ppppbVar2 = (byte ****)local_48[0][-1]; uVar4 = local_34 + 0x24; if ((byte *)0x1f < (byte *)((int)local_48[0] + (-4 - (int)ppppbVar2))) { LAB_0074669a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar2,uVar4); } ExceptionList = local_10; return; } //@@ 007466d0 Level::SetStage /* ZHL [exact] __thiscall void Level::SetStage(int stageid,int alt); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Level::SetStage(Level *this,int stageid,int alt) { int iVar1; bool bVar2; Game *pGVar3; int stage; int iVar4; int iVar5; if (stageid < 1) { stageid = 0; } iVar5 = 0xd; if (stageid < 0xd) { iVar5 = stageid; } if (alt < 1) { alt = 0; } iVar4 = 5; if (alt < 5) { iVar4 = alt; } iVar1 = this->_stage; if ((0 < iVar1) && ((6 < iVar1 || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { if ((this->_stageType == 4) || (this->_stageType == 5)) { bVar2 = true; } else { bVar2 = false; } stage = iVar1 + 1; if (!bVar2) { stage = iVar1; } if (stage < 8) { Game::SaveBackwardsStage(stage); } } pGVar3 = g_game; this->_stage = iVar5; this->_stageType = iVar4; NightmareScene::record_stage(iVar5,iVar4); if ((((pGVar3->_difficulty == 2) || (pGVar3->_difficulty == 3)) || (6 < this->_stage)) || ((this->_stageType != 4 && (this->_stageType != 5)))) { pGVar3->_bossRushParTime = 36000; return; } pGVar3->_bossRushParTime = 45000; return; } //@@ 007467c0 Level::SetNextStage /* ZHL [lua] Lua binding Level:SetNextStage prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Level::SetNextStage(Level *this) { byte bVar1; int backwardsStage; uint forcedCurses; uint preventedCurses; ChallengeParam *challengeParams; Entity_Player *knifePieceOwner; int iVar2; Level *extraout_EDX; Level *pLVar3; uint flagsHigh; int iVar5; uint nextStage; Game *game; bool isChapter2End; int nextStageType; char *currentRoom; uint debugCurses; undefined4 flagsHigh; bool isAltExitOpen; bool isAltPath; bool isChapter1End; bool isChapter1Or2End; bool isChapter2End; bool isChapter3End; uint levelCurses; Manager *manager; game = g_game; flagsHigh = 0; nextStageType = this->_stageType; if (((0 < g_game->_stage) && (g_game->_stage < 7)) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { iVar2 = this->_stage; if ((nextStageType == 4) || (nextStageType == 5)) { iVar2 = iVar2 + 1; } if (iVar2 == 1) { SetStage(this,0xd,nextStageType); return; } nextStage = flagsHigh; if (iVar2 < 8) { iVar5 = iVar2 + -1; if (1 < iVar5) { backwardsStage = Game::get_backwards_stage(iVar2 + -2); if (*(char *)(backwardsStage + 0x31c) != '\0') { iVar5 = iVar2 + -2; } } iVar2 = Game::get_backwards_stage(iVar5); if ((*(int *)(iVar2 + 0x318) == 4) || (*(int *)(iVar2 + 0x318) == 5)) { SetStage(this,iVar5 + -1,4); return; } SetStage(this,iVar5,0); return; } goto LAB_0074706a; } if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { nextStageType = 0; switch(this->_stage) { case 0: flagsHigh = 1; break; case 1: flagsHigh = 2; break; case 2: flagsHigh = 3; break; case 3: flagsHigh = 4; break; case 4: flagsHigh = 5; break; case 5: flagsHigh = 6; break; case 6: case 7: flagsHigh = 7; break; default: KAGE_LogMessage(0x10,(byte *)"Wrong Stage (Greed Mode)"); game = g_game; } } else { pLVar3 = this; switch(this->_stage) { case 0: flagsHigh = 1; break; case 1: flagsHigh = 2; break; case 2: flagsHigh = 3; break; case 3: flagsHigh = 4; break; case 4: flagsHigh = 5; break; case 5: flagsHigh = 6; break; case 6: flagsHigh = 7; break; case 7: flagsHigh = 8; break; case 8: bVar1 = IsAltPath(this); flagsHigh = (bVar1 ^ 1) * 2 + 8; pLVar3 = extraout_EDX; break; case 9: flagsHigh = 0xd; if (nextStageType == 4) { nextStageType = 0; } else { flagsHigh = 10; } break; case 10: case 0xb: flagsHigh = 0xb; break; case 0xc: flagsHigh = 0xc; break; case 0xd: flagsHigh = 0xd; break; default: KAGE_LogMessage(0x10,(byte *)"Wrong Stage"); game = g_game; } if (game->_challenge == 0x1f) { switch(pLVar3->_stage) { case 0: flagsHigh = 0xb; break; case 1: case 2: flagsHigh = 1; break; case 3: flagsHigh = 2; break; case 4: flagsHigh = 3; break; case 5: flagsHigh = 4; break; case 6: flagsHigh = 5; break; case 7: flagsHigh = 6; break; case 8: flagsHigh = 7; break; default: KAGE_LogMessage(0x10,(byte *)"Wrong Stage"); game = g_game; break; case 10: flagsHigh = 8; break; case 0xb: flagsHigh = 10; } } } debugCurses = game->_debugCurses; levelCurses = this->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); manager = g_manager; game = g_game; nextStage = flagsHigh; if (((((~preventedCurses & (forcedCurses | debugCurses | levelCurses) & 2) != 0) || (g_game->_challenge == 0x2c)) && ((iVar2 = this->_stage, iVar2 == 1 || (((iVar2 == 3 || (iVar2 == 5)) || (iVar2 == 7)))))) && (nextStage = flagsHigh + 1, iVar2 == 7)) { nextStage = flagsHigh + 2; } if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { if (nextStage == 0xd) goto LAB_0074706a; if ((((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) || (challengeParams = Game::GetChallengeParams(g_game), challengeParams->_pathType != 2)) || (isChapter2End = true, game->_challenge == 0x2c)) { isChapter2End = false; } if ((game->_stageType == 4) || (isAltPath = false, game->_stageType == 5)) { isAltPath = true; } if ((this->_stage == 2) || ((this->_stage == 1 && (flagsHigh = filter_curses(this,2), flagsHigh != 0)))) { isChapter1End = true; } else { isChapter1End = false; } if ((this->_stage == 4) || ((this->_stage == 3 && (flagsHigh = filter_curses(this,2), flagsHigh != 0)))) { isChapter2End = true; } else { isChapter2End = false; } if ((isChapter1End) || (isChapter1Or2End = false, isChapter2End)) { isChapter1Or2End = true; } if ((this->_stage == 6) || ((this->_stage == 5 && (flagsHigh = filter_curses(this,2), flagsHigh != 0)))) { isChapter3End = true; } else { isChapter3End = false; } if ((((!isChapter1Or2End) && (!isChapter3End)) || (bVar1 = IsMausoleumHeartStage(this), bVar1 != 0)) || (((isChapter1End && (knifePieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x272,(RNG **)&g_game->_playerManager,1), knifePieceOwner != (Entity_Player *)0x0)) || ((isChapter2End && ((knifePieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x272,(RNG **)&g_game->_playerManager,1), knifePieceOwner != (Entity_Player *)0x0 && (knifePieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x273,(RNG **)&g_game->_playerManager,1), knifePieceOwner != (Entity_Player *)0x0)))))))) { isAltExitOpen = true; } else { isAltExitOpen = false; } currentRoom = this->_room; if ((currentRoom == (char *)0x0) || (*currentRoom == '\0')) { iVar2 = 0; } else { iVar2 = *(int *)(currentRoom + 4); } if ((g_game->_gameStateFlags & 0x100000000000) == 0) { if ((((currentRoom != (char *)0x0) && (*currentRoom != '\0')) && (isAltPath)) && (((isAltExitOpen && (((iVar5 = *(int *)(currentRoom + 8), iVar5 == 0x16 || (iVar5 == 0x1b)) || ((iVar5 == 3 || ((iVar2 != 0 && (*(int *)(iVar2 + 8) == -0xc)))))))) || (bVar1 = IsMausoleumHeartStage(this), bVar1 != 0)))) goto LAB_00746fe3; game = g_game; if ((isChapter2End) && (1 < nextStage)) goto LAB_00746eff; if ((isAltPath) && ((!isChapter1Or2End && (!isChapter3End)))) goto LAB_00746fe3; if (((g_game->_stageType == 4) || (g_game->_stageType == 5)) && (bVar1 = IsAscent((Level *)g_game), bVar1 == 0)) { nextStage = nextStage + 1; } flagsHigh = Seeds::GetStageSeed(&game->_seedEffects,nextStage); game = g_game; if (((flagsHigh & 1) == 0) && ((((nextStage == 1 || (nextStage == 2)) && (((manager->_persistentGameData)._achievements[0x56] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) || ((((nextStage == 3 || (nextStage == 4)) && (((manager->_persistentGameData)._achievements[0x57] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) || ((((nextStage == 5 || (nextStage == 6)) && (((manager->_persistentGameData)._achievements[0x58] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) || ((nextStage == 7 || (nextStage == 8)))))))))) { nextStageType = 1; } else { nextStageType = 0; } if (((flagsHigh == (flagsHigh / 3) * 3) && (nextStage < 10)) && ((((((nextStage == 1 || (nextStage == 2)) && (((manager->_persistentGameData)._achievements[0x156] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) || (((nextStage == 3 || (nextStage == 4)) && (((manager->_persistentGameData)._achievements[0x157] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))) || (((nextStage == 5 || (nextStage == 6)) && (((manager->_persistentGameData)._achievements[0x158] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))) || (((nextStage == 7 || (nextStage == 8)) && (((manager->_persistentGameData)._achievements[0x159] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))))) { nextStageType = 2; } bVar1 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if ((bVar1 != 0) && ((nextStage == 3 || (nextStage == 4)))) { nextStageType = 2; } } else { LAB_00746eff: if (isAltPath) { LAB_00746fe3: if ((isChapter2End) && (((isChapter1End && (knifePieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x272,(RNG **)&g_game->_playerManager,1), knifePieceOwner == (Entity_Player *)0x0)) || ((isChapter2End && (knifePieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x273,(RNG **)&g_game->_playerManager,1), knifePieceOwner == (Entity_Player *)0x0)))))) goto LAB_00746f09; } else { LAB_00746f09: nextStage = nextStage - 1; if ((int)nextStage < 1) { nextStage = 1; } } flagsHigh = Seeds::GetStageSeed(&g_game->_seedEffects,nextStage + 1); game = g_game; if (((flagsHigh & 2) == 0) && (((((nextStage == 1 || (nextStage == 2)) && (((manager->_persistentGameData)._achievements[0x19c] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) || (((nextStage == 3 || (nextStage == 4)) && (((manager->_persistentGameData)._achievements[0x19d] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))) || (((nextStage == 5 || (nextStage == 6)) && (((manager->_persistentGameData)._achievements[0x19e] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))))) { nextStageType = 5; } else { nextStageType = 4; } } if ((int)nextStage < 10) { flagsHigh = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags & 0xfff7ffff; *(undefined4 *)((int)&game->_gameStateFlags + 4) = flagsHigh; } else { if (nextStage == 10) { if (this->_currentRoomIndex == -8) { SetStage(this,9,0); return; } if (this->_currentRoomIndex == -9) { SetStage(this,0xc,0); return; } bVar1 = Game::GetStateFlag(game,0x13); flagsHigh = 0; if (game->_challenge != 0x1f) { flagsHigh = (uint)bVar1; } SetStage(this,10,flagsHigh); return; } if (nextStage == 0xb) { SetStage(this,0xb,this->_stageType); return; } } goto LAB_0074706a; } if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } if (nextStage == 0) { flagsHigh = 0; } else { flagsHigh = nextStage; if (0xc < nextStage) { flagsHigh = 0xd; } } flagsHigh = (game->_seedEffects)._stageSeeds[flagsHigh]; if ((flagsHigh & 1) == 0) { if (nextStage == 1) { isChapter2End = (manager->_persistentGameData)._achievements[0x56] == 0; LAB_00747181: if ((isChapter2End) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) goto LAB_007471ab; } else { if (nextStage == 2) { isChapter2End = (manager->_persistentGameData)._achievements[0x57] == 0; goto LAB_00747181; } if (nextStage == 3) { isChapter2End = (manager->_persistentGameData)._achievements[0x58] == 0; goto LAB_00747181; } if (nextStage != 4) goto LAB_007471ab; } nextStageType = 1; } else { LAB_007471ab: nextStageType = 0; } if ((flagsHigh % 3 != 0) || (9 < nextStage)) { LAB_0074706a: SetStage(this,nextStage,nextStageType); return; } if (nextStage == 1) { isChapter2End = (manager->_persistentGameData)._achievements[0x156] == 0; } else if (nextStage == 2) { isChapter2End = (manager->_persistentGameData)._achievements[0x157] == 0; } else { if (nextStage != 3) { if ((nextStage != 4) || (((manager->_persistentGameData)._achievements[0x159] == 0 && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))))) goto LAB_0074706a; goto LAB_007472ba; } isChapter2End = (manager->_persistentGameData)._achievements[0x158] == 0; } if (isChapter2End) { if ((g_manager->_state != 2) || (g_game == (Game *)0x0)) goto LAB_0074706a; if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) { SetStage(this,nextStage,nextStageType); return; } } LAB_007472ba: SetStage(this,nextStage,2); return; } //@@ 00747360 Level::write_room_config /* ZHL [exact] static void Level::write_room_config(RoomConfig_Room* roomConfig, GameStateRoomConfig* gameStateRoom, std_deque_RoomConfigRoom* deque); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Level::write_room_config(Level *this,void *roomConfig,void *gameStateRoom,void *deque) { int iVar1; undefined8 *puVar2; void *pvVar3; int iVar4; uint uVar5; uint uVar6; undefined2 *puVar7; undefined4 *local_1c; int local_18; if ((*(byte *)((int)roomConfig + 0x4c) & 0x10) == 0) { uVar5 = (uint)*(byte *)((int)roomConfig + 4) << 0x10 | *(uint *)roomConfig; *(uint *)gameStateRoom = uVar5; uVar6 = *(uint *)((int)roomConfig + 0x4c); if ((uVar6 & 0x20) != 0) { uVar5 = uVar5 | 0x40000000; *(uint *)gameStateRoom = uVar5; uVar6 = *(uint *)((int)roomConfig + 0x4c); } if ((uVar6 & 0x40) != 0) { *(uint *)gameStateRoom = uVar5 | 0x20000000; } *(undefined4 *)((int)gameStateRoom + 4) = *(undefined4 *)((int)roomConfig + 8); *(undefined4 *)((int)gameStateRoom + 8) = *(undefined4 *)((int)roomConfig + 0xc); } else if (deque != (void *)0x0) { *(undefined4 *)gameStateRoom = 0x80000000; puVar7 = (undefined2 *)((int)gameStateRoom + 8); local_1c = (undefined4 *)((int)roomConfig + 0x50); *(undefined4 *)((int)gameStateRoom + 4) = *(undefined4 *)((int)roomConfig + 0x48); local_18 = 2; do { *puVar7 = *(undefined2 *)((int)deque + 0x10); uVar6 = *(uint *)((int)deque + 0x10); uVar5 = *(uint *)((int)deque + 8); if (uVar5 <= uVar6 + 1) { std_deque_growmap(deque,uVar6); uVar5 = *(uint *)((int)deque + 8); uVar6 = *(uint *)((int)deque + 0x10); } *(uint *)((int)deque + 0xc) = *(uint *)((int)deque + 0xc) & uVar5 - 1; uVar6 = uVar6 + *(int *)((int)deque + 0xc) & uVar5 - 1; iVar4 = *(int *)((int)deque + 4); iVar1 = uVar6 * 4; if (*(int *)(iVar4 + uVar6 * 4) == 0) { pvVar3 = operator_new(0xc); *(void **)(iVar1 + *(int *)((int)deque + 4)) = pvVar3; iVar4 = *(int *)((int)deque + 4); } puVar2 = *(undefined8 **)(iVar1 + iVar4); *puVar2 = 0; *(undefined4 *)(puVar2 + 1) = 0; *(int *)((int)deque + 0x10) = *(int *)((int)deque + 0x10) + 1; write_room_config(this,(void *)*local_1c, *(void **)(*(int *)((int)deque + 4) + (*(int *)((int)deque + 8) - 1U & (*(int *)((int)deque + 0xc) + *(int *)((int)deque + 0x10)) - 1U) * 4),deque); local_1c = local_1c + 1; puVar7 = puVar7 + 1; local_18 = local_18 + -1; } while (local_18 != 0); return; } return; } //@@ 007474a0 Level::get_room_config_from_saved_id /* DB: ? decodes a packed room id (type/mode bits >>16); 0x80000000 marks a merged generated room and recurses on its two halves through the hash table param_2, then RoomConfig::MergeRoomsIntoGenerated; otherwise looks the room up by type/variant; Level::generate_boss_room, Level::RestoreGameState prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall Level::get_room_config_from_saved_id(Level *this,uint *savedId,void *mergeTable) { uint uVar1; uint type; Game *pGVar2; uint mode; RoomConfig_Room *pRVar3; RoomConfig_Room *roomA; void *pvVar4; pGVar2 = g_game; uVar1 = *savedId; mode = uVar1 >> 0x10 & 0xff; if (uVar1 == 0x80000000) { if (mergeTable != (void *)0x0) { uVar1 = savedId[1]; pRVar3 = get_room_config_from_saved_id (this,*(uint **)(*(int *)((int)mergeTable + 4) + ((uint)*(ushort *)((int)savedId + 10) + *(int *)((int)mergeTable + 0xc) & *(int *)((int)mergeTable + 8) - 1U) * 4),mergeTable); roomA = get_room_config_from_saved_id (this,*(uint **)(*(int *)((int)mergeTable + 4) + ((uint)(ushort)savedId[2] + *(int *)((int)mergeTable + 0xc) & *(int *)((int)mergeTable + 8) - 1U) * 4),mergeTable); pRVar3 = RoomConfig::MergeRoomsIntoGenerated(&pGVar2->_roomConfig,roomA,pRVar3,uVar1); return pRVar3; } } else { type = savedId[1]; if (type != 0) { if ((uVar1 & 0x40000000) == 0) { pRVar3 = RoomConfig::GetRoomByStageTypeAndVariant (&g_game->_roomConfig,uVar1 & 0xffff,type,savedId[2],mode); return pRVar3; } pRVar3 = RoomConfig::GetRoomByStageTypeAndVariant (&g_game->_roomConfig,uVar1 & 0xffff,type,savedId[2],mode); pvVar4 = (void *)RoomConfig::make_generated_room(pRVar3); return pvVar4; } } return (void *)0x0; } //@@ 007475b0 Level::RestoreGameState /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall void Level::RestoreGameState(GameState* gameState); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Level::RestoreGameState(Level *this,GameState *gameState) { byte bVar1; uint uVar2; int iVar3; code *pcVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined2 portalWord; undefined2 uVar9; undefined1 uVar10; undefined1 uVar11; undefined1 uVar12; undefined1 uVar13; undefined1 uVar14; undefined1 uVar15; undefined1 uVar16; ushort portalBit; void *pvVar17; RoomDescriptor *roomDesc; int *piVar18; uint forcedCurses; uint preventedCurses; Entity *mothersShadow; int iVar19; uint uVar20; Game *game; uint *savedId; PlayerManager *playerManager; int *roomMapDest; void **roomDataSlot; bool isNewLevel; float timeScale; RoomDescriptor *savedRoomDesc; uint uStack_18; Vector VStack_10; Camera *camera; Manager *manager; ushort portalWord; Room *room; isNewLevel = false; if (this->_stage != *(int *)&gameState->field_0xe4) { isNewLevel = g_game->_isRestoringGlowingHourglassState == 0; this->_stage = *(int *)&gameState->field_0xe4; } this->_stageType = *(int *)&gameState->field_0xe8; this->_startingRoomIndex = *(int *)&gameState->field_0xec; this->_lastBossRoomListIndex = *(int *)&gameState->field_0xf0; this->_curses = *(int *)&gameState->field_0xf4; this->_dungeonPlacementSeed = *(int *)&gameState->field_0xf8; (this->_devilAngelRoomRNG)._seed = *(int *)&gameState->field_0xfc; (this->_devilAngelRoomRNG)._shift1 = 1; (this->_devilAngelRoomRNG)._shift2 = 5; (this->_devilAngelRoomRNG)._shift3 = 0x13; this->_angelRoomChance = *(float *)&gameState->field_0x100; *(undefined4 *)&this->field_0x18390 = *(undefined4 *)&gameState->field_0x19d6c; this->_isHeartPicked = gameState->field_0x104; this->field_0x9 = gameState->field_0x105; this->_isCanSeeEverything = gameState->field_0x106; this->field_0x8 = gameState->field_0x107; portalBit = 0; if (*(short *)&gameState->field_0x108 != 0) { do { portalWord = portalBit >> 5; uVar20 = 1 << ((byte)portalBit & 0x1f); if ((&gameState->field_0x10a)[portalBit] == '\0') { uVar20 = *(uint *)(this->_ventricleRazorPortals + (uint)portalWord * 4 + 0x24) & ~uVar20; } else { uVar20 = *(uint *)(this->_ventricleRazorPortals + (uint)portalWord * 4 + 0x24) | uVar20; } portalBit = portalBit + 1; *(uint *)(this->_ventricleRazorPortals + (uint)portalWord * 4 + 0x24) = uVar20; } while (portalBit < *(ushort *)&gameState->field_0x108); } uVar20 = *(uint *)&gameState->field_0x124; this->_greedModeWave = uVar20; uVar5 = *(undefined4 *)&gameState->field_0x12c; uVar6 = *(undefined4 *)&gameState->field_0x130; uVar7 = *(undefined4 *)&gameState->field_0x134; *(undefined4 *)&this->field_0x18338 = *(undefined4 *)&gameState->field_0x128; *(undefined4 *)&this->field_0x1833c = uVar5; *(undefined4 *)&this->field_0x18340 = uVar6; *(undefined4 *)&this->field_0x18344 = uVar7; uVar5 = *(undefined4 *)&gameState->field_0x13c; uVar6 = *(undefined4 *)&gameState->field_0x140; uVar7 = *(undefined4 *)&gameState->field_0x144; *(undefined4 *)&this->field_0x18348 = *(undefined4 *)&gameState->field_0x138; *(undefined4 *)&this->field_0x1834c = uVar5; *(undefined4 *)&this->field_0x18350 = uVar6; *(undefined4 *)&this->field_0x18354 = uVar7; uVar5 = *(undefined4 *)&gameState->field_0x14c; uVar6 = *(undefined4 *)&gameState->field_0x150; uVar7 = *(undefined4 *)&gameState->field_0x154; *(undefined4 *)&this->field_0x18358 = *(undefined4 *)&gameState->field_0x148; *(undefined4 *)&this->field_0x1835c = uVar5; *(undefined4 *)&this->field_0x18360 = uVar6; *(undefined4 *)&this->field_0x18364 = uVar7; *(undefined4 *)&this->field_0x18370 = *(undefined4 *)&gameState->field_0x158; uVar2 = *(uint *)&gameState->field_0x15c; *(uint *)&this->field_0x18368 = uVar2; if (uVar2 < uVar20) { uVar20 = uVar2; } this->_greedModeWave = uVar20; *(undefined4 *)&this->field_0x1836c = *(undefined4 *)&gameState->field_0x160; if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } uVar20 = (this->_generationRNG)._seed; if (uVar20 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar20 = (this->_generationRNG)._seed; if (uVar20 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar20 = uVar20 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar20; uVar20 = uVar20 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar20; (this->_generationRNG)._seed = uVar20 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar20; if (g_game->_challenge == 0x2c) { InitStageSeeds(); } reset_room_list(this,0); piVar18 = (int *)&gameState->field_0x19530; roomMapDest = this->_roomMap; for (iVar19 = 0x1fb; iVar19 != 0; iVar19 = iVar19 + -1) { *roomMapDest = *piVar18; piVar18 = piVar18 + 1; roomMapDest = roomMapDest + 1; } RoomConfig::ClearGeneratedRooms(); roomDataSlot = &this->_roomList[0].Data; uStack_18 = 0x20f; this->_roomCount = *(int *)&gameState->field_0x19c; VStack_10.x = (float)&gameState->field_0x1951c; savedId = (uint *)&gameState->field_0x17c68; savedRoomDesc = (RoomDescriptor *)&gameState->field_0x1a0; do { GameState::copy_room_list((RoomDescriptor *)(roomDataSlot + -4),savedRoomDesc); pvVar17 = get_room_config_from_saved_id(this,savedId,(void *)VStack_10.x); *roomDataSlot = pvVar17; roomDataSlot = roomDataSlot + 0x2e; savedId = savedId + 3; savedRoomDesc = savedRoomDesc + 1; uStack_18 = uStack_18 + -1; } while (uStack_18 != 0); this->_currentRoomIndex = *(int *)&gameState->field_0x19d1c; bVar1 = gameState->field_0x19d2c; this->_currentDimensionIdx = (uint)bVar1; this->_currentRoomMap = this->_roomMap + (uint)bVar1 * 0xa9; this->_lastRoomDimensionIdx = (uint)(byte)gameState->field_0x19d2d; this->_previousRoomIndex = *(int *)&gameState->field_0x19d20; (this->_dungeonReturnPosition).x = *(float *)&gameState->field_0x19d30; (this->_dungeonReturnPosition).y = *(float *)&gameState->field_0x19d34; this->_dungeonReturnRoomIndex = *(int *)&gameState->field_0x19d38; iVar19 = *(int *)&gameState->field_0x19d40; portalWord = *(undefined2 *)&gameState->field_0x19d44; uVar9 = *(undefined2 *)&gameState->field_0x19d46; iVar3 = *(int *)&gameState->field_0x19d48; this[1]._roomList[7].VisitedCount = *(int *)&gameState->field_0x19d3c; this[1]._roomList[7].Flags = iVar19; this[1]._roomList[7].TotalMoneySpent = portalWord; this[1]._roomList[7].ClearCount = uVar9; this[1]._roomList[7].GreedSubType = iVar3; portalWord = *(undefined2 *)&gameState->field_0x19d4e; this[1]._roomList[7].PoopCount = *(undefined2 *)&gameState->field_0x19d4c; this[1]._roomList[7].TKeeperCoinSpawns = portalWord; this->_enterDoor = *(int *)&gameState->field_0x19d50; uVar10 = gameState->field_0x19d55; uVar11 = gameState->field_0x19d56; uVar12 = gameState->field_0x19d57; uVar13 = gameState->field_0x19d58; uVar14 = gameState->field_0x19d59; uVar15 = gameState->field_0x19d5a; uVar16 = gameState->field_0x19d5b; this->_ventricleRazorPortals[0] = gameState->field_0x19d54; this->_ventricleRazorPortals[1] = uVar10; this->_ventricleRazorPortals[2] = uVar11; this->_ventricleRazorPortals[3] = uVar12; this->_ventricleRazorPortals[4] = uVar13; this->_ventricleRazorPortals[5] = uVar14; this->_ventricleRazorPortals[6] = uVar15; this->_ventricleRazorPortals[7] = uVar16; uVar10 = gameState->field_0x19d5d; uVar11 = gameState->field_0x19d5e; uVar12 = gameState->field_0x19d5f; this->_ventricleRazorPortals[8] = gameState->field_0x19d5c; this->_ventricleRazorPortals[9] = uVar10; this->_ventricleRazorPortals[10] = uVar11; this->_ventricleRazorPortals[0xb] = uVar12; uVar10 = gameState->field_0x19d61; uVar11 = gameState->field_0x19d62; uVar12 = gameState->field_0x19d63; uVar13 = gameState->field_0x19d64; uVar14 = gameState->field_0x19d65; uVar15 = gameState->field_0x19d66; uVar16 = gameState->field_0x19d67; this->_ventricleRazorPortals[0xc] = gameState->field_0x19d60; this->_ventricleRazorPortals[0xd] = uVar10; this->_ventricleRazorPortals[0xe] = uVar11; this->_ventricleRazorPortals[0xf] = uVar12; this->_ventricleRazorPortals[0x10] = uVar13; this->_ventricleRazorPortals[0x11] = uVar14; this->_ventricleRazorPortals[0x12] = uVar15; this->_ventricleRazorPortals[0x13] = uVar16; uVar10 = gameState->field_0x19d69; uVar11 = gameState->field_0x19d6a; uVar12 = gameState->field_0x19d6b; this->_ventricleRazorPortals[0x14] = gameState->field_0x19d68; this->_ventricleRazorPortals[0x15] = uVar10; this->_ventricleRazorPortals[0x16] = uVar11; this->_ventricleRazorPortals[0x17] = uVar12; Seeds::GetForcedCurses(); Seeds::GetPreventedCurses(); VStack_10.x = (float)g_game->_roomList[g_game->_lastBossRoomListIdx].GridIndex; if ((((g_game->_challenge == 0x1f) && (g_game->_stage != 0xb)) && ((float)this->_currentRoomIndex == VStack_10.x)) && (roomDesc = GetRoomByIdx(this,this->_currentRoomIndex,-1), (roomDesc->Flags & 1) == 0)) { uVar20 = 0; playerManager = &g_game->_playerManager; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar17 = (playerManager->_playerList)._end; if ((int)pvVar17 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar17 = (playerManager->_playerList)._end; game = g_game; } piVar18 = (playerManager->_playerList)._begin; if (uVar20 < (uint)((int)pvVar17 - (int)piVar18 >> 2)) { piVar18 = piVar18 + uVar20; } iVar19 = *piVar18; playerManager = &game->_playerManager; uVar20 = uVar20 + 1; *(undefined1 *)(iVar19 + 0x1398) = 0; *(undefined1 *)(iVar19 + 0x139a) = 0; } while (uVar20 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } iVar19 = game->_startingRoomIdx; this->_previousRoomIndex = iVar19; this->_currentRoomIndex = iVar19; this->_leaveDoor = -1; load_room(this); RoomTransition::start(&g_game->_roomTransition,VStack_10.x,0xffffffff,0xf,0,0xffffffff); RoomTransition::Update(&g_game->_roomTransition); roomDesc = GetRoomByIdx((Level *)g_game,g_game->_startingRoomIdx,-1); game = g_game; roomDesc->Flags = roomDesc->Flags & 0xfffffffe; Game::UpdateVisibility(game); } else { load_room(this); Room::PlayMusic(g_game->_room); game = g_game; Minimap::refresh_room_icons((Minimap *)(g_game->_minimap)._config); Minimap::refresh_room_icons ((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; } } if (isNewLevel) { PlayerManager::trigger_level_start(); } if ((((this->_currentDimensionIdx != 1) || (g_game->_difficulty == 2)) || ((g_game->_difficulty == 3 || ((iVar19 = this->_stage, iVar19 - 1U < 6 && ((g_game->_gameStateFlags & 0x1000000000000) != 0)))))) || ((this->_stageType != 4 && (this->_stageType != 5)))) goto LAB_00747d60; if (iVar19 != 4) { if (iVar19 != 3) goto LAB_00747d60; uVar20 = g_game->_debugCurses; uVar2 = this->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); if ((~preventedCurses & (forcedCurses | uVar20 | uVar2) & 2) == 0) goto LAB_00747d60; } if ((this->_levelStateFlag & 0x400000U) != 0) { GetEnterPosition(this,&VStack_10); if ((VStack_10.x == g_vectorZero.x) && (VStack_10.y == g_vectorZero.y)) { uVar20 = this->_enterDoor; if (uVar20 == 0xffffffff) { uVar20 = Random(); uVar20 = uVar20 & 7; uStack_18 = 0; do { if ((uVar20 < 8) && ((*(uint *)(*(int *)(*(int *)((int)this->_room + 4) + 0x10) + 0x38 + (uVar20 >> 5) * 4) & 1 << ((byte)uVar20 & 0x1f)) != 0)) break; uVar20 = uVar20 + 1 & 0x80000007; if ((int)uVar20 < 0) { uVar20 = (uVar20 - 1 | 0xfffffff8) + 1; } uStack_18 = uStack_18 + 1; } while (uStack_18 < 8); } VStack_10.y = g_vectorZero.y; VStack_10.x = g_vectorZero.x; if (uVar20 < 8) { iVar19 = *(int *)((int)this->_room + uVar20 * 4 + 0x744); iVar3 = *(int *)((int)this->_room + 0xc); VStack_10.x = (float)(iVar19 % iVar3) * 40.0 + 40.0; VStack_10.y = (float)(iVar19 / iVar3) * 40.0 + 120.0; } uVar20 = uVar20 & 0x80000003; if ((int)uVar20 < 0) { uVar20 = (uVar20 - 1 | 0xfffffffc) + 1; } switch(uVar20) { case 0: VStack_10.x = VStack_10.x - 100.0; VStack_10.y = VStack_10.y - 0.0; break; case 1: VStack_10.x = VStack_10.x - 0.0; VStack_10.y = VStack_10.y - 100.0; break; case 2: VStack_10.x = VStack_10.x + 100.0; VStack_10.y = VStack_10.y + 0.0; break; case 3: VStack_10.x = VStack_10.x + 0.0; VStack_10.y = VStack_10.y + 100.0; } } else { VStack_10.x = VStack_10.x - 0.0; VStack_10.y = VStack_10.y - 100.0; } uVar20 = Random(); mothersShadow = Game::SpawnEx(g_game,0x363,0,&VStack_10,&g_vectorZero,(Entity *)0x0,0,uVar20,0); (**(code **)(*(int *)mothersShadow + 0xc))(); } LAB_00747d60: camera = *(Camera **)((int)g_game->_room + 0x11f8); iVar19 = (g_manager->_optionsConfig)._cameraStyle; if ((iVar19 == 1) || (iVar19 != 2)) { Camera::update_focus_position(camera,0); camera->_shouldOverride = 0; } else { Camera::update_follow(camera); } manager = g_manager; room = this->_room; room->_brokenWatchState = (int)(char)gameState->field_0x19d24; timeScale = Room::time_scale_update(room); (manager->_musicManager)._targetPitch = timeScale; iVar19 = *(int *)((int)this->_room + 0x722c); if (iVar19 < *(int *)&gameState->field_0x19d28) { iVar19 = *(int *)&gameState->field_0x19d28; } *(int *)((int)this->_room + 0x722c) = iVar19; TextureCache::Purge(); return; } //@@ 00747e10 Level::store_game_state /* DB: ? ECX=Level(==Game): copies stage (+0), stage type (+4), +0x182d0, curses etc. into GameState+0xe4.., room bitset into bools at +0x10a, Level::write_room_config, GameState::copy_room_list; called from Game::store_game_state right before PlayerManager::store_game_state */ void Level::store_game_state(int param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; undefined1 uVar5; ushort roomBit; Level *in_ECX; int iVar6; void *dequeMap; void *blockToFree; undefined4 *savedRoomEntry; int *piVar7; uint size; int *roomMapDest; RoomDescriptor *source; void *savedRoomConfig; int roomsLeft; int *tmpDequeProxy; void *tmpDequeMap; int tmpDequeMapSize; undefined4 tmpDequeOffset; int tmpDequeSize; *(int *)(param_1 + 0xe4) = in_ECX->_stage; *(int *)(param_1 + 0xe8) = in_ECX->_stageType; *(int *)(param_1 + 0xec) = in_ECX->_startingRoomIndex; *(int *)(param_1 + 0xf0) = in_ECX->_lastBossRoomListIndex; *(int *)(param_1 + 0xf4) = in_ECX->_curses; *(undefined1 *)(param_1 + 0x107) = in_ECX->field_0x8; *(undefined2 *)(param_1 + 0x108) = 0x1a; roomBit = 0; do { *(bool *)(roomBit + 0x10a + param_1) = (*(uint *)(in_ECX->_ventricleRazorPortals + (uint)(roomBit >> 5) * 4 + 0x24) & 1 << ((byte)roomBit & 0x1f)) != 0; roomBit = roomBit + 1; } while (roomBit < *(ushort *)(param_1 + 0x108)); *(int *)(param_1 + 0x124) = in_ECX->_greedModeWave; uVar1 = *(undefined4 *)&in_ECX->field_0x1833c; uVar2 = *(undefined4 *)&in_ECX->field_0x18340; uVar3 = *(undefined4 *)&in_ECX->field_0x18344; tmpDequeMap = (void *)0x0; *(undefined4 *)(param_1 + 0x128) = *(undefined4 *)&in_ECX->field_0x18338; *(undefined4 *)(param_1 + 300) = uVar1; *(undefined4 *)(param_1 + 0x130) = uVar2; *(undefined4 *)(param_1 + 0x134) = uVar3; tmpDequeMapSize = 0; uVar1 = *(undefined4 *)&in_ECX->field_0x1834c; uVar2 = *(undefined4 *)&in_ECX->field_0x18350; uVar3 = *(undefined4 *)&in_ECX->field_0x18354; tmpDequeOffset = 0; tmpDequeSize = 0; *(undefined4 *)(param_1 + 0x138) = *(undefined4 *)&in_ECX->field_0x18348; *(undefined4 *)(param_1 + 0x13c) = uVar1; *(undefined4 *)(param_1 + 0x140) = uVar2; *(undefined4 *)(param_1 + 0x144) = uVar3; uVar1 = *(undefined4 *)&in_ECX->field_0x1835c; uVar2 = *(undefined4 *)&in_ECX->field_0x18360; uVar3 = *(undefined4 *)&in_ECX->field_0x18364; *(undefined4 *)(param_1 + 0x148) = *(undefined4 *)&in_ECX->field_0x18358; *(undefined4 *)(param_1 + 0x14c) = uVar1; *(undefined4 *)(param_1 + 0x150) = uVar2; *(undefined4 *)(param_1 + 0x154) = uVar3; *(undefined4 *)(param_1 + 0x158) = *(undefined4 *)&in_ECX->field_0x18370; *(undefined4 *)(param_1 + 0x15c) = *(undefined4 *)&in_ECX->field_0x18368; *(undefined4 *)(param_1 + 0x160) = *(undefined4 *)&in_ECX->field_0x1836c; *(byte *)(param_1 + 0x104) = in_ECX->_isHeartPicked; *(undefined1 *)(param_1 + 0x105) = in_ECX->field_0x9; *(byte *)(param_1 + 0x106) = in_ECX->_isCanSeeEverything; *(int *)(param_1 + 0xf8) = in_ECX->_dungeonPlacementSeed; *(int *)(param_1 + 0xfc) = (in_ECX->_devilAngelRoomRNG)._seed; *(float *)(param_1 + 0x100) = in_ECX->_angelRoomChance; *(undefined4 *)(param_1 + 0x19d6c) = *(undefined4 *)&in_ECX->field_0x18390; piVar7 = in_ECX->_roomMap; roomMapDest = (int *)(param_1 + 0x19530); for (iVar6 = 0x1fb; iVar6 != 0; iVar6 = iVar6 + -1) { *roomMapDest = *piVar7; piVar7 = piVar7 + 1; roomMapDest = roomMapDest + 1; } tmpDequeProxy = operator_new(8); tmpDequeProxy[1] = 0; *tmpDequeProxy = (int)&tmpDequeProxy; FUN_007526b0((void *)(param_1 + 0x1951c)); if (tmpDequeSize != 0) { do { tmpDequeSize = tmpDequeSize + -1; } while (tmpDequeSize != 0); tmpDequeOffset = 0; tmpDequeSize = 0; } dequeMap = tmpDequeMap; iVar6 = tmpDequeMapSize; if (tmpDequeMapSize != 0) { do { blockToFree = *(void **)((int)dequeMap + iVar6 * 4 + -4); iVar6 = iVar6 + -1; if (blockToFree != (void *)0x0) { operator_delete(blockToFree,0xc); dequeMap = tmpDequeMap; } } while (iVar6 != 0); } if (dequeMap != (void *)0x0) { size = tmpDequeMapSize * 4; blockToFree = dequeMap; if (0xfff < size) { blockToFree = *(void **)((int)dequeMap + -4); size = size + 0x23; if (0x1f < (uint)((int)dequeMap + (-4 - (int)blockToFree))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(blockToFree,size); } piVar7 = tmpDequeProxy; tmpDequeMapSize = 0; tmpDequeMap = (void *)0x0; tmpDequeProxy = (int *)0x0; operator_delete(piVar7,8); roomsLeft = 0x20f; source = in_ECX->_roomList; *(int *)(param_1 + 0x19c) = in_ECX->_roomCount; savedRoomEntry = (undefined4 *)(param_1 + 0x1b0); savedRoomConfig = (void *)(param_1 + 0x17c68); do { if (source->Data != (void *)0x0) { write_room_config(in_ECX,source->Data,savedRoomConfig,(void *)(param_1 + 0x1951c)); } GameState::copy_room_list((RoomDescriptor *)(savedRoomEntry + -4),source); source = source + 1; *savedRoomEntry = 0; savedRoomConfig = (void *)((int)savedRoomConfig + 0xc); savedRoomEntry = savedRoomEntry + 0x2e; roomsLeft = roomsLeft + -1; } while (roomsLeft != 0); *(int *)(param_1 + 0x19d1c) = in_ECX->_currentRoomIndex; *(int *)(param_1 + 0x19d20) = in_ECX->_previousRoomIndex; if (g_game->_challenge == 0x16) { uVar5 = 2; } else { uVar5 = (undefined1)*(undefined4 *)((int)in_ECX->_room + 0x1210); } *(undefined1 *)(param_1 + 0x19d24) = uVar5; *(undefined4 *)(param_1 + 0x19d28) = *(undefined4 *)((int)in_ECX->_room + 0x722c); *(char *)(param_1 + 0x19d2c) = (char)in_ECX->_currentDimensionIdx; *(char *)(param_1 + 0x19d2d) = (char)in_ECX->_lastRoomDimensionIdx; *(float *)(param_1 + 0x19d30) = (in_ECX->_dungeonReturnPosition).x; *(float *)(param_1 + 0x19d34) = (in_ECX->_dungeonReturnPosition).y; *(int *)(param_1 + 0x19d38) = in_ECX->_dungeonReturnRoomIndex; iVar6 = in_ECX[1]._roomList[7].Flags; uVar1 = *(undefined4 *)&in_ECX[1]._roomList[7].TotalMoneySpent; iVar4 = in_ECX[1]._roomList[7].GreedSubType; *(int *)(param_1 + 0x19d3c) = in_ECX[1]._roomList[7].VisitedCount; *(int *)(param_1 + 0x19d40) = iVar6; *(undefined4 *)(param_1 + 0x19d44) = uVar1; *(int *)(param_1 + 0x19d48) = iVar4; *(undefined4 *)(param_1 + 0x19d4c) = *(undefined4 *)&in_ECX[1]._roomList[7].PoopCount; *(int *)(param_1 + 0x19d50) = in_ECX->_enterDoor; *(undefined8 *)(param_1 + 0x19d54) = *(undefined8 *)in_ECX->_ventricleRazorPortals; *(undefined4 *)(param_1 + 0x19d5c) = *(undefined4 *)(in_ECX->_ventricleRazorPortals + 8); *(undefined8 *)(param_1 + 0x19d60) = *(undefined8 *)(in_ECX->_ventricleRazorPortals + 0xc); *(undefined4 *)(param_1 + 0x19d68) = *(undefined4 *)(in_ECX->_ventricleRazorPortals + 0x14); return; } //@@ 007481d0 Level::ForceHorsemanBoss /* ZHL [lua] Lua binding Level:ForceHorsemanBoss */ undefined4 Level::ForceHorsemanBoss(uint param_1) { code *pcVar1; int roomConfig; undefined4 uVar3; uint levelRngValue; RoomConfig_Room *newRoom; int *in_ECX; int roomIdx; Game *game; int horsemanRoomIdx; uint horsemanBossId; int *roomConfigSlot; uint *removedBossBits; int roomConfig; int stage; if (((in_ECX[1] != 4) && (in_ECX[1] != 5)) && ((5 < *in_ECX - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { roomIdx = 0; roomConfig = -1; horsemanRoomIdx = -1; horsemanBossId = 0; if (0 < in_ECX[0x60b3]) { roomConfigSlot = in_ECX + 9; game = g_game; do { roomConfig = *roomConfigSlot; if (*(int *)(roomConfig + 8) == 5) { if (roomConfig < 0) { stage = *in_ECX; roomConfig = roomIdx; if (((stage == 1) || (stage == 2)) && ((*(uint *)(game->_bossPool)._removedBosses._begin & 0x200) == 0)) { horsemanBossId = 9; horsemanRoomIdx = roomIdx; } else if (((stage == 3) || (stage == 4)) && ((*(uint *)(game->_bossPool)._removedBosses._begin & 0x400) == 0)) { horsemanBossId = 10; horsemanRoomIdx = roomIdx; } else { if (stage == 5) { if ((*(uint *)(game->_bossPool)._removedBosses._begin & 0x800) == 0) { horsemanBossId = 0xb; horsemanRoomIdx = roomIdx; goto LAB_0074839d; } } else if (((stage == 7) && (*(int *)(roomConfig + 0x10) != 0x58)) && ((*(uint *)(game->_bossPool)._removedBosses._begin & 0x1000) == 0)) { levelRngValue = in_ECX[0x60b5]; if (levelRngValue == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); levelRngValue = in_ECX[0x60b5]; game = g_game; if (levelRngValue == 0) { pcVar1 = (code *)swi(3); uVar3 = (*pcVar1)(); return uVar3; } } levelRngValue = levelRngValue >> ((byte)in_ECX[0x60b6] & 0x1f) ^ levelRngValue; levelRngValue = levelRngValue << ((byte)in_ECX[0x60b7] & 0x1f) ^ levelRngValue; levelRngValue = levelRngValue >> ((byte)in_ECX[0x60b8] & 0x1f) ^ levelRngValue; in_ECX[0x60b5] = levelRngValue; if (((levelRngValue & 1) == 0) && (((g_manager->_persistentGameData)._achievements[0x42] != 0 || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))) { horsemanBossId = 0x26; horsemanRoomIdx = roomIdx; } else { horsemanBossId = 0xc; horsemanRoomIdx = roomIdx; } } LAB_00748399: roomConfig = horsemanRoomIdx; } } else { roomConfig = *(int *)(roomConfig + 0x10); if ((((roomConfig != 9) && (roomConfig != 10)) && (roomConfig != 0xb)) && ((roomConfig != 0x26 && (roomConfig != 0xc)))) goto LAB_00748399; roomConfig = -1; horsemanRoomIdx = -1; } } LAB_0074839d: roomIdx = roomIdx + 1; roomConfigSlot = roomConfigSlot + 0x2e; } while (roomIdx < in_ECX[0x60b3]); if (-1 < roomConfig) { if (in_ECX[roomConfig * 0x2e + 0x15] == 0) { newRoom = RoomConfig::GetRandomRoom (&game->_roomConfig,param_1,1,0,5, *(int *)(in_ECX[roomConfig * 0x2e + 9] + 0x48),0,-1,1,10, (uint *)(in_ECX[roomConfig * 0x2e + 9] + 0x38),horsemanBossId,-1); game = g_game; if (newRoom != (RoomConfig_Room *)0x0) { in_ECX[roomConfig * 0x2e + 9] = (int)newRoom; removedBossBits = (uint *)((int)(game->_bossPool)._removedBosses._begin + (horsemanBossId >> 5) * 4); *removedBossBits = *removedBossBits | 1 << (horsemanBossId & 0x1f); if (horsemanBossId == 0x26) { removedBossBits = (game->_bossPool)._removedBosses._begin; *removedBossBits = *removedBossBits | 0x1000; } } return 1; } } } } return 0; } //@@ 00748490 Level::GetCurses /* ZHL [lua] Lua binding Level:GetCurses prototype: db/protos.zhl, confirmed by RET 0 */ uint __thiscall Level::GetCurses(Level *this) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uVar1 = g_game->_debugCurses; uVar2 = this->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); return ~uVar4 & (uVar3 | uVar1 | uVar2); } //@@ 007484c0 Level::QueryRoomTypeIndex /* WARNING: Removing unreachable block (ram,0x007486ee) */ /* WARNING: Removing unreachable block (ram,0x00748700) */ /* WARNING: Removing unreachable block (ram,0x00748710) */ /* WARNING: Removing unreachable block (ram,0x00748716) */ /* ZHL [lua] Lua binding Level:QueryRoomTypeIndex */ int Level::QueryRoomTypeIndex(int param_1,uint param_2,RNG *param_3,char param_4) { Level *in_ECX; uint uVar1; int *end; int iVar2; int *local_20; int local_18 [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afdafd; local_10 = ExceptionList; if ((param_1 == 0xf) || (param_1 == 0xe)) { ExceptionList = &local_10; InitializeDevilAngelRoom(in_ECX,0,0); ExceptionList = local_10; return -1; } if (param_1 == 3) { return -2; } if (param_1 == 0x16) { return -6; } end = (int *)0x0; local_20 = (int *)0x0; local_8 = 0; iVar2 = in_ECX->_roomCount; local_18[0] = 0; ExceptionList = &local_10; if (0 < iVar2) { do { local_18[1] = 0; if (((*(int *)((int)in_ECX->_roomList[local_18[0]].Data + 8) == param_1) && (in_ECX->_roomList[local_18[0]].Dimension == in_ECX->_currentDimensionIdx)) && ((param_4 != '\0' || ((iVar2 = in_ECX->_roomList[local_18[0]].Group, iVar2 == -1 || (iVar2 == *(int *)(*(int *)((int)in_ECX->_room + 4) + 0xb4))))))) { if (end == (int *)0x0) { std::vector::_Emplace_reallocate(0,local_18); end = local_20; } else { *end = local_18[0]; local_20 = end + 1; end = local_20; } } iVar2 = in_ECX->_roomCount; local_18[0] = local_18[0] + 1; } while (local_18[0] < iVar2); } local_18[1] = 0; if ((int)end >> 2 == 0) { param_2 = 0; if (0 < iVar2) { do { if (((*(int *)((int)in_ECX->_roomList[param_2].Data + 8) == 1) && (in_ECX->_roomList[param_2].Dimension == in_ECX->_currentDimensionIdx)) && ((param_4 != '\0' || ((iVar2 = in_ECX->_roomList[param_2].Group, iVar2 == -1 || (iVar2 == *(int *)(*(int *)((int)in_ECX->_room + 4) + 0xb4))))))) { if (end == (int *)0x0) { std::vector::_Emplace_reallocate(0,¶m_2); end = local_20; } else { *end = param_2; local_20 = end + 1; end = local_20; } } param_2 = param_2 + 1; } while ((int)param_2 < in_ECX->_roomCount); } local_18[1] = 0; RNG::Shuffle(param_3,(int *)0x0,end); if ((int)end >> 2 == 0) { iVar2 = -1; } else { iVar2 = in_ECX->_roomList[iRam00000000].SafeGridIndex; } } else { RNG::Shuffle(param_3,(int *)0x0,end); uVar1 = 0; do { if ((uint)(in_ECX->_roomList[*(int *)(uVar1 * 4)].VisitedCount != 0) == (param_2 & 0xff)) { ExceptionList = local_10; return in_ECX->_roomList[*(int *)(uVar1 * 4)].SafeGridIndex; } uVar1 = uVar1 + 1; } while (uVar1 < (uint)((int)end >> 2)); iVar2 = in_ECX->_roomList[iRam00000000].SafeGridIndex; } ExceptionList = local_10; return iVar2; } //@@ 00748760 Level::CanOpenChallengeRoom /* ZHL [lua] Lua binding Level:CanOpenChallengeRoom */ undefined4 Level::CanOpenChallengeRoom(int param_1) { bool bVar1; char cVar2; RoomDescriptor *pRVar3; Entity_Player *pEVar4; Level *in_ECX; uint Index; pRVar3 = GetRoomByIdx(in_ECX,param_1,-1); if (pRVar3->Data == (void *)0x0) { return 0; } if (((uint)pRVar3->Flags >> 3 & 1) == 0) { if (*(int *)((int)pRVar3->Data + 0x10) == 1) { Index = 0; bVar1 = true; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { return 1; } do { if (!bVar1) goto LAB_00748822; pEVar4 = Game::GetPlayer(g_game,Index); if ((pEVar4->_variant == 0) && (2 < pEVar4->_soulHearts + pEVar4->_redHearts)) { bVar1 = false; } Index = Index + 1; } while (Index < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); if (bVar1) { return 1; } } else { cVar2 = PlayerManager::check_full_health(1); if (cVar2 != '\0') { return 1; } } LAB_00748822: if (((*(uint *)(*(int *)((int)in_ECX->_room + 4) + 0x44) >> 10 & 1) == 0) && (((uint)pRVar3->Flags >> 10 & 1) == 0)) { return 0; } } return 1; } //@@ 00748860 Level::ApplyMapEffect /* ZHL [lua] Lua binding Level:ApplyMapEffect prototype: db/protos.zhl */ void __thiscall Level::ApplyMapEffect(Level *this) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar4 = 0; if (0 < this->_roomCount) { piVar3 = &this->_roomList[0].DisplayFlags; do { pvVar2 = (void *)piVar3[-0xb]; if (pvVar2 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"[error] Room %d is not initialized\n"); pvVar2 = (void *)piVar3[-0xb]; } iVar1 = *(int *)((int)pvVar2 + 8); if (((iVar1 != 7) && (iVar1 != 8)) && (iVar1 != 0x1d)) { *piVar3 = *piVar3 | 1; } iVar4 = iVar4 + 1; piVar3 = piVar3 + 0x2e; } while (iVar4 < this->_roomCount); } Minimap::Refresh(&g_game->_minimap); this->_levelStateFlag = this->_levelStateFlag | 0x100; return; } //@@ 007488d0 Level::ApplyBlueMapEffect /* ZHL [lua] Lua binding Level:ApplyBlueMapEffect prototype: db/protos.zhl */ void __thiscall Level::ApplyBlueMapEffect(Level *this) { void *pvVar1; int *piVar2; int iVar3; iVar3 = 0; if (0 < this->_roomCount) { piVar2 = &this->_roomList[0].DisplayFlags; do { pvVar1 = (void *)piVar2[-0xb]; if (pvVar1 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"[error] Room %d is not initialized\n"); pvVar1 = (void *)piVar2[-0xb]; } if ((*(int *)((int)pvVar1 + 8) == 7) || (*(int *)((int)pvVar1 + 8) == 8)) { *piVar2 = *piVar2 | 4; } iVar3 = iVar3 + 1; piVar2 = piVar2 + 0x2e; } while (iVar3 < this->_roomCount); } Minimap::Refresh(&g_game->_minimap); this->_levelStateFlag = this->_levelStateFlag | 0x200; return; } //@@ 00748940 Level::ApplyCompassEffect /* ZHL [lua] Lua binding Level:ApplyCompassEffect prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Level::ApplyCompassEffect(Level *this,byte isPersistent) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar4 = 0; if (0 < this->_roomCount) { piVar3 = &this->_roomList[0].DisplayFlags; do { pvVar2 = (void *)piVar3[-0xb]; if (pvVar2 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"[error] Room %d is not initialized\n"); pvVar2 = (void *)piVar3[-0xb]; } iVar1 = *(int *)((int)pvVar2 + 8); if ((((iVar1 != 7) && (iVar1 != 8)) && (iVar1 != 1)) && (iVar1 != 0x1d)) { *piVar3 = *piVar3 | 4; } iVar4 = iVar4 + 1; piVar3 = piVar3 + 0x2e; } while (iVar4 < this->_roomCount); } Minimap::Refresh(&g_game->_minimap); if (isPersistent != 0) { this->_levelStateFlag = this->_levelStateFlag | 0x80; } return; } //@@ 007489c0 Level::ShowMap /* ZHL [lua] Lua binding Level:ShowMap */ void __thiscall Level::ShowMap(Level *this) { void *pvVar1; int *piVar2; int iVar3; iVar3 = 0; if (0 < this->_roomCount) { piVar2 = &this->_roomList[0].DisplayFlags; do { pvVar1 = (void *)piVar2[-0xb]; if (pvVar1 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"[error] Room %d is not initialized\n"); pvVar1 = (void *)piVar2[-0xb]; } if ((*(int *)((int)pvVar1 + 8) != 8) && (*(int *)((int)pvVar1 + 8) != 0x1d)) { *piVar2 = *piVar2 | 5; } iVar3 = iVar3 + 1; piVar2 = piVar2 + 0x2e; } while (iVar3 < this->_roomCount); } Minimap::Refresh(&g_game->_minimap); this->_levelStateFlag = this->_levelStateFlag | 0x400; return; } //@@ 00748a30 FUN_00748a30 void FUN_00748a30(void) { uint *puVar1; int in_ECX; if (-1 < *(int *)(in_ECX + 0x18314)) { puVar1 = (uint *)(*(int *)(in_ECX + 0x18314) * 0xb8 + 0x50 + in_ECX); *puVar1 = *puVar1 | 4; } Minimap::Refresh(&g_game->_minimap); *(uint *)(in_ECX + 0x1839c) = *(uint *)(in_ECX + 0x1839c) | 0x40000; return; } //@@ 00748a70 Level::reveal_secret_room /* DB: ECX Level (room count +0x182cc, room list stride 0xb8): first room whose RoomConfig type is 7 (secret) gets display flag 4, Minimap::Refresh, _levelStateFlag |= 0x100000; level_start calls it for collectible 589 Luna and RemoveCompassEffect re-applies it when that flag is set */ void __thiscall Level::reveal_secret_room(Level *this) { int *piVar1; void *pvVar2; int iVar3; void **ppvVar4; iVar3 = 0; if (0 < this->_roomCount) { ppvVar4 = &this->_roomList[0].Data; do { pvVar2 = *ppvVar4; if (pvVar2 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"[error] Room %d is not initialized\n"); pvVar2 = *ppvVar4; } if (*(int *)((int)pvVar2 + 8) == 7) { piVar1 = &this->_roomList[iVar3].DisplayFlags; *piVar1 = *piVar1 | 4; break; } iVar3 = iVar3 + 1; ppvVar4 = ppvVar4 + 0x2e; } while (iVar3 < this->_roomCount); } Minimap::Refresh(&g_game->_minimap); this->_levelStateFlag = this->_levelStateFlag | 0x100000; return; } //@@ 00748ae0 Level::RemoveCompassEffect /* ZHL [lua] Lua binding Level:RemoveCompassEffect */ void __thiscall Level::RemoveCompassEffect(Level *this) { int *piVar1; uint uVar2; int iVar3; iVar3 = 0; if (0 < this->_roomCount) { piVar1 = &this->_roomList[0].DisplayFlags; do { if (*piVar1 == 4) { *piVar1 = 0; } iVar3 = iVar3 + 1; piVar1 = piVar1 + 0x2e; } while (iVar3 < this->_roomCount); } uVar2 = this->_levelStateFlag; if ((uVar2 & 0x100) != 0) { ApplyMapEffect(this); uVar2 = this->_levelStateFlag; } if ((uVar2 & 0x200) != 0) { ApplyBlueMapEffect(this); uVar2 = this->_levelStateFlag; } if ((char)uVar2 < '\0') { ApplyCompassEffect(this,1); uVar2 = this->_levelStateFlag; } if ((uVar2 & 0x400) != 0) { ShowMap(this); uVar2 = this->_levelStateFlag; } if ((uVar2 & 0x40000) != 0) { if (-1 < this->_lastBossRoomListIndex) { piVar1 = &this->_roomList[this->_lastBossRoomListIndex].DisplayFlags; *piVar1 = *piVar1 | 4; } Minimap::Refresh(&g_game->_minimap); this->_levelStateFlag = this->_levelStateFlag | 0x40000; uVar2 = this->_levelStateFlag; } if ((uVar2 & 0x100000) != 0) { reveal_secret_room(this); } Minimap::Refresh(&g_game->_minimap); return; } //@@ 00748bc0 Level::RemoveCurses /* ZHL [lua] Lua binding Level:RemoveCurses */ void __thiscall Level::RemoveCurses(Level *this,uint param_2) { void *pvVar1; qword qVar2; Game *pGVar3; uint uVar4; uint uVar5; qword *pqVar6; uint uVar7; uint uVar8; EntityList_EL local_28; Level *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar3 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afdf1d; local_10 = ExceptionList; ExceptionList = &local_10; uVar7 = this->_curses; uVar8 = ~(param_2 & 0xffffff7d) & uVar7; this->_curses = uVar8; uVar4 = pGVar3->_challenge; if (uVar4 != 0) { pvVar1 = (g_manager->_challengeParams)._begin; uVar5 = ((int)(g_manager->_challengeParams)._end - (int)pvVar1) / 0xa4 - 1; if (uVar5 <= uVar4) { uVar4 = uVar5; } uVar8 = *(uint *)(uVar4 * 0xa4 + 0x84 + (int)pvVar1) | uVar8; this->_curses = uVar8; pGVar3 = g_game; uVar8 = ~*(uint *)(uVar4 * 0xa4 + 0x88 + (int)pvVar1) & uVar8; this->_curses = uVar8; } uVar7 = uVar7 & ~uVar8; if ((uVar7 & 1) != 0) { pGVar3->_darknessModifier = 1.0; pGVar3->_darknessStrength = 1.0; pGVar3->_darknessTimeout = 4; } if ((uVar7 & 0x40) != 0) { local_18 = this; EntityList::QuerySublist((EntityList *)((int)this->_room + 0x1218),&local_28,5,100,-1,0,0); local_8 = 0; uVar7 = 0; if (local_28._size != 0) { do { Entity_Pickup::UpdateSprite(*(Entity_Pickup **)((int)local_28._data + uVar7 * 4),0); uVar7 = uVar7 + 1; } while (uVar7 < (uint)local_28._size); } HUD::InvalidateCraftingItem(&g_game->_hud,(Entity_Player *)0x0); if (local_28._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } if (local_28._data != (void *)0x0) { uVar7 = *(uint *)((int)local_28._data + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar7; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar7); free((void *)((int)local_28._data + -4)); } } } ExceptionList = local_10; return; } //@@ 00748d40 Level::find_matching_room_idx /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Heritage AFTER dead removal. Example location: s0xffffff1c : 0x00748f40 */ /* WARNING: Removing unreachable block (ram,0x00748fa5) */ /* WARNING: Removing unreachable block (ram,0x00748fb4) */ /* WARNING: Removing unreachable block (ram,0x00748fc4) */ /* WARNING: Removing unreachable block (ram,0x00748fca) */ /* WARNING: Restarted to delay deadcode elimination for space: stack */ /* DB: ? Level::ChangeRoom loop: GetRoomByIdx(param), compares every room's stage/type/variant/shape fields (stride 0xb8) against it and _startingRoomIndex, returns idx or -1 */ int Level::find_matching_room_idx(int param_1) { uint uVar1; int iVar2; void *pvVar3; uint uVar4; RoomDescriptor *pRVar5; Level *in_ECX; int iVar6; int local_e0; int *local_dc; int *local_d8; int *local_d0; RoomDescriptor local_cc; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afdf5b; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = uVar4; pRVar5 = GetRoomByIdx(in_ECX,param_1,-1); RoomDescriptor::copy_constructor(&local_cc,pRVar5); local_8 = 0; if (((local_cc.Data == (void *)0x0) || ((*(int *)((int)local_cc.Data + 8) == 1 && (*(int *)((int)local_cc.Data + 0x10) != 0)))) || ((local_cc.Dimension == 0 && (local_cc.GridIndex == in_ECX->_startingRoomIndex)))) { iVar6 = -1; } else { local_dc = (int *)0x0; local_d8 = (int *)0x0; local_8 = 1; uVar1 = in_ECX->_roomCount; iVar6 = 0; if (uVar1 != 0) { if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ std::_Xlen(uVar4); } std::vector::_Reallocate(uVar1); iVar6 = in_ECX->_roomCount; } local_d0 = (int *)0x0; if (0 < iVar6) { do { if (local_d8 == (int *)0x0) { std::vector::_Emplace_reallocate(0,&local_d0); } else { *local_d8 = (int)local_d0; local_d8 = local_d8 + 1; } local_d0 = (int *)((int)local_d0 + 1); } while ((int)local_d0 < in_ECX->_roomCount); } FUN_00752de0(0,local_d8); local_e0 = 0; if (0 < in_ECX->_roomCount) { local_d0 = (int *)0x0; do { iVar6 = *local_dc; if ((((((iVar6 != local_cc.ListIndex) && (in_ECX->_roomList[iVar6].VisitedCount != 0)) && (local_cc.VisitedCount != 0)) && (((in_ECX->_roomList[iVar6].Group == local_cc.Group && ((((byte)((uint)in_ECX->_roomList[iVar6].Flags >> 10) ^ (byte)((uint)local_cc.Flags >> 10)) & 1) == 0)) && ((iVar2 = in_ECX->_roomList[iVar6].Dimension, iVar2 == local_cc.Dimension && ((pvVar3 = in_ECX->_roomList[iVar6].Data, *(int *)((int)pvVar3 + 8) != 1 || (*(int *)((int)pvVar3 + 0x10) == 0)))))))) && ((iVar2 != 0 || (in_ECX->_roomList[iVar6].GridIndex != in_ECX->_startingRoomIndex)))) && (((local_cc.AllowedDoors == in_ECX->_roomList[iVar6].AllowedDoors && (*(int *)((int)pvVar3 + 0x48) == *(int *)((int)local_cc.Data + 0x48))) && (*(int *)((int)pvVar3 + 8) == *(int *)((int)local_cc.Data + 8))))) { iVar6 = in_ECX->_roomList[*local_dc].SafeGridIndex; local_d0 = local_dc; goto LAB_00748fd9; } local_dc = local_dc + 1; local_d0 = local_dc; local_e0 = local_e0 + 1; } while (local_e0 < in_ECX->_roomCount); } iVar6 = -1; } LAB_00748fd9: std::vector::_Tidy(); FID_conflict__Erase_tree_>_> (&local_cc.RestrictedGridIndexes, (fuzzer_allocator_> *) &local_cc.RestrictedGridIndexes, *(_Tree_node **)((int)local_cc.RestrictedGridIndexes._head + 4)); operator_delete(local_cc.RestrictedGridIndexes._head,0x14); std::vector::_Tidy(); FUN_00708f90(); ExceptionList = local_10; return iVar6; } //@@ 00749040 RoomDescriptor::copy_constructor /* DB: ? copies a RoomDescriptor field by field (ints, then vectors/strings) from param into ECX; from Level::find_matching_room_idx on the result of GetRoomByIdx (RoomDescriptor::operator_assign is 007387d0) */ RoomDescriptor * __thiscall RoomDescriptor::copy_constructor(RoomDescriptor *this,int *param_2) { undefined4 *puVar1; int iVar2; int iVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; uint uVar8; uint byteCount; void *pvVar9; undefined4 *dstGridEntity; undefined4 *srcGridEntity; void *local_1c; undefined1 *puStack_18; undefined4 local_14; std_set *restrictedGridIndexes; undefined4 *srcGridEnd; local_14 = 0xffffffff; puStack_18 = &LAB_00afdfc1; local_1c = ExceptionList; uVar8 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; this->GridIndex = *param_2; this->SafeGridIndex = param_2[1]; this->ListIndex = param_2[2]; this->Dimension = param_2[3]; this->Data = (void *)param_2[4]; this->OverrideData = (void *)param_2[5]; this->AllowedDoors = param_2[6]; iVar2 = param_2[8]; iVar3 = param_2[9]; iVar4 = param_2[10]; this->_doors[0] = param_2[7]; this->_doors[1] = iVar2; this->_doors[2] = iVar3; this->_doors[3] = iVar4; iVar2 = param_2[0xc]; iVar3 = param_2[0xd]; iVar4 = param_2[0xe]; this->_doors[4] = param_2[0xb]; this->_doors[5] = iVar2; this->_doors[6] = iVar3; this->_doors[7] = iVar4; this->DisplayFlags = param_2[0xf]; this->VisitedCount = param_2[0x10]; this->Flags = param_2[0x11]; this->TotalMoneySpent = (short)param_2[0x12]; this->ClearCount = *(short *)((int)param_2 + 0x4a); this->GreedSubType = param_2[0x13]; this->PoopCount = (short)param_2[0x14]; this->TKeeperCoinSpawns = *(short *)((int)param_2 + 0x52); this->PitsCount = param_2[0x15]; this->DecorationSeed = param_2[0x16]; this->SpawnSeed = param_2[0x17]; this->AwardSeed = param_2[0x18]; this->BossDeathSeed = param_2[0x19]; (this->SavedGridEntities)._begin = (void *)0x0; (this->SavedGridEntities)._end = (void *)0x0; (this->SavedGridEntities)._capacity = (void *)0x0; srcGridEnd = (undefined4 *)param_2[0x1b]; srcGridEntity = (undefined4 *)param_2[0x1a]; if (srcGridEntity != srcGridEnd) { byteCount = (int)srcGridEnd - (int)srcGridEntity >> 5; if (0x7ffffff < byteCount) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar8); } byteCount = byteCount * 0x20; pvVar9 = std::_Allocate(byteCount); (this->SavedGridEntities)._begin = pvVar9; (this->SavedGridEntities)._end = pvVar9; (this->SavedGridEntities)._capacity = (void *)((int)pvVar9 + byteCount); dstGridEntity = (this->SavedGridEntities)._begin; do { uVar5 = srcGridEntity[1]; uVar6 = srcGridEntity[2]; uVar7 = srcGridEntity[3]; *dstGridEntity = *srcGridEntity; dstGridEntity[1] = uVar5; dstGridEntity[2] = uVar6; dstGridEntity[3] = uVar7; puVar1 = srcGridEntity + 4; uVar5 = srcGridEntity[5]; uVar6 = srcGridEntity[6]; uVar7 = srcGridEntity[7]; srcGridEntity = srcGridEntity + 8; dstGridEntity[4] = *puVar1; dstGridEntity[5] = uVar5; dstGridEntity[6] = uVar6; dstGridEntity[7] = uVar7; dstGridEntity = dstGridEntity + 8; } while (srcGridEntity != srcGridEnd); (this->SavedGridEntities)._end = dstGridEntity; } local_14 = 0; FUN_00752830(param_2 + 0x1d); local_14._0_1_ = 1; restrictedGridIndexes = &this->RestrictedGridIndexes; restrictedGridIndexes->_head = (void *)0x0; (this->RestrictedGridIndexes)._size = 0; pvVar9 = operator_new(0x14); *(void **)pvVar9 = pvVar9; *(void **)((int)pvVar9 + 4) = pvVar9; *(void **)((int)pvVar9 + 8) = pvVar9; *(undefined2 *)((int)pvVar9 + 0xc) = 0x101; restrictedGridIndexes->_head = pvVar9; local_14._0_1_ = 2; std_set_uint_copy(restrictedGridIndexes,param_2 + 0x20,(int)this); local_14 = CONCAT31(local_14._1_3_,3); FUN_00752830(param_2 + 0x22); iVar2 = param_2[0x26]; iVar3 = param_2[0x27]; iVar4 = param_2[0x28]; *(int *)&this->field_0x94 = param_2[0x25]; *(int *)&this->field_0x98 = iVar2; *(int *)&this->field_0x9c = iVar3; *(int *)&this->field_0xa0 = iVar4; iVar2 = param_2[0x2a]; *(int *)&this->field_0xa4 = param_2[0x29]; *(int *)&this->field_0xa8 = iVar2; this->ShopItemIdx = (short)param_2[0x2b]; this->ShopItemDiscountIdx = *(short *)((int)param_2 + 0xae); this->DeliriumDistance = param_2[0x2c]; this->Group = param_2[0x2d]; ExceptionList = local_1c; return this; } //@@ 00749270 Level::maze_swap_rooms /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Level::ChangeRoom after Random()%5==0 for a room whose 00748d40 Level::find_matching_room_idx returns a match (Curse of the Maze teleport); this=Level: GetRoomByIdx(param_1) and the target, requires equal RoomConfig shape (+0x46/+0x47), swaps the two RoomDescriptor contents (+0x14 + idx*0xb8) prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Level::maze_swap_rooms(Level *this,int roomIdx,int otherRoomIdx) { uint uVar1; undefined4 *puVar2; uint uVar3; void *pvVar4; void *pvVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; undefined4 uVar13; undefined4 uVar14; undefined4 uVar15; undefined4 uVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int iVar23; int iVar24; int iVar25; int iVar26; RoomDescriptor *roomDesc; RoomDescriptor *otherLookup; uint uVar27; uint uVar28; uint uVar29; undefined4 *puVar30; int *piVar31; int iVar32; uint uVar33; uint roomWidth; uint gridSize; int *piVar34; undefined1 auStack_f0 [4]; RoomDescriptor *local_ec; RoomDescriptor *otherRoom; RoomDescriptor tmpDesc; uint local_c; local_c = __security_cookie ^ (uint)auStack_f0; roomDesc = GetRoomByIdx(this,roomIdx,-1); local_ec = this->_roomList + roomDesc->ListIndex; otherLookup = GetRoomByIdx(this,otherRoomIdx,-1); roomDesc = local_ec; otherLookup = this->_roomList + otherLookup->ListIndex; if ((*(char *)((int)local_ec->Data + 0x46) != *(char *)((int)otherLookup->Data + 0x46)) || (*(char *)((int)local_ec->Data + 0x47) != *(char *)((int)otherLookup->Data + 0x47))) { return 0; } otherRoom = otherLookup; RoomDescriptor::move_constructor(&tmpDesc,local_ec); RoomDescriptor::operator_assign(roomDesc,otherLookup); RoomDescriptor::operator_assign(otherLookup,&tmpDesc); std::vector::_Tidy(); FID_conflict__Erase_tree_>_> (&tmpDesc.RestrictedGridIndexes, (fuzzer_allocator_> *) &tmpDesc.RestrictedGridIndexes, *(_Tree_node **)((int)tmpDesc.RestrictedGridIndexes._head + 4)); operator_delete(tmpDesc.RestrictedGridIndexes._head,0x14); std::vector::_Tidy(); FUN_00708f90(); piVar34 = roomDesc->_doors; if ((roomDesc != otherLookup) && (piVar34 != &roomDesc->DisplayFlags)) { do { iVar32 = *piVar34; *piVar34 = *(int *)(((int)otherLookup - (int)roomDesc) + (int)piVar34); *(int *)(((int)otherLookup - (int)roomDesc) + (int)piVar34) = iVar32; piVar34 = piVar34 + 1; } while (piVar34 != &roomDesc->DisplayFlags); roomDesc = local_ec; otherLookup = otherRoom; } iVar32 = roomDesc->GridIndex; roomDesc->GridIndex = otherLookup->GridIndex; otherLookup->GridIndex = iVar32; iVar32 = roomDesc->SafeGridIndex; roomDesc->SafeGridIndex = otherLookup->SafeGridIndex; otherLookup->SafeGridIndex = iVar32; iVar32 = roomDesc->ListIndex; roomDesc->ListIndex = otherLookup->ListIndex; otherLookup->ListIndex = iVar32; roomWidth = (uint)*(byte *)((int)roomDesc->Data + 0x46); gridSize = (uint)*(byte *)((int)roomDesc->Data + 0x47); iVar32 = (gridSize + 1) * (roomWidth + 2); uVar3 = roomWidth * 4 + 8; uVar27 = roomWidth * 5 + 9; uVar1 = iVar32 + 7; uVar33 = iVar32 + 0x14; uVar28 = (roomWidth + 2) * 0xb; uVar29 = uVar28 + roomWidth + 1; gridSize = (gridSize + 2) * (roomWidth + 2); if (uVar3 < gridSize) { pvVar4 = (local_ec->SavedGridEntities)._begin; iVar32 = uVar3 * 0x20; puVar2 = (undefined4 *)((int)pvVar4 + iVar32); if ((*(int *)((int)pvVar4 + iVar32) == 0x10) || (otherLookup = otherRoom, *(int *)(iVar32 + (int)(otherRoom->SavedGridEntities)._begin) == 0x10)) { puVar30 = (undefined4 *)((int)(otherRoom->SavedGridEntities)._begin + iVar32); uVar6 = puVar30[1]; uVar7 = puVar30[2]; uVar8 = puVar30[3]; uVar9 = *puVar2; uVar10 = puVar2[1]; uVar11 = puVar2[2]; uVar12 = puVar2[3]; uVar13 = puVar2[4]; uVar14 = puVar2[5]; uVar15 = puVar2[6]; uVar16 = puVar2[7]; *puVar2 = *puVar30; puVar2[1] = uVar6; puVar2[2] = uVar7; puVar2[3] = uVar8; uVar6 = puVar30[5]; uVar7 = puVar30[6]; uVar8 = puVar30[7]; puVar2[4] = puVar30[4]; puVar2[5] = uVar6; puVar2[6] = uVar7; puVar2[7] = uVar8; *puVar30 = uVar9; puVar30[1] = uVar10; puVar30[2] = uVar11; puVar30[3] = uVar12; puVar30[4] = uVar13; puVar30[5] = uVar14; puVar30[6] = uVar15; puVar30[7] = uVar16; otherLookup = otherRoom; } } if ((7 < gridSize) && ((pvVar4 = (local_ec->SavedGridEntities)._begin, *(int *)((int)pvVar4 + 0xe0) == 0x10 || (*(int *)((int)(otherLookup->SavedGridEntities)._begin + 0xe0) == 0x10)))) { pvVar5 = (otherLookup->SavedGridEntities)._begin; uVar6 = *(undefined4 *)((int)pvVar4 + 0xe0); uVar7 = *(undefined4 *)((int)pvVar4 + 0xe4); uVar8 = *(undefined4 *)((int)pvVar4 + 0xe8); uVar9 = *(undefined4 *)((int)pvVar4 + 0xec); uVar10 = *(undefined4 *)((int)pvVar4 + 0xf0); uVar11 = *(undefined4 *)((int)pvVar4 + 0xf4); uVar12 = *(undefined4 *)((int)pvVar4 + 0xf8); uVar13 = *(undefined4 *)((int)pvVar4 + 0xfc); uVar14 = *(undefined4 *)((int)pvVar5 + 0xe4); uVar15 = *(undefined4 *)((int)pvVar5 + 0xe8); uVar16 = *(undefined4 *)((int)pvVar5 + 0xec); *(undefined4 *)((int)pvVar4 + 0xe0) = *(undefined4 *)((int)pvVar5 + 0xe0); *(undefined4 *)((int)pvVar4 + 0xe4) = uVar14; *(undefined4 *)((int)pvVar4 + 0xe8) = uVar15; *(undefined4 *)((int)pvVar4 + 0xec) = uVar16; uVar14 = *(undefined4 *)((int)pvVar5 + 0xf4); uVar15 = *(undefined4 *)((int)pvVar5 + 0xf8); uVar16 = *(undefined4 *)((int)pvVar5 + 0xfc); *(undefined4 *)((int)pvVar4 + 0xf0) = *(undefined4 *)((int)pvVar5 + 0xf0); *(undefined4 *)((int)pvVar4 + 0xf4) = uVar14; *(undefined4 *)((int)pvVar4 + 0xf8) = uVar15; *(undefined4 *)((int)pvVar4 + 0xfc) = uVar16; *(undefined4 *)((int)pvVar5 + 0xe0) = uVar6; *(undefined4 *)((int)pvVar5 + 0xe4) = uVar7; *(undefined4 *)((int)pvVar5 + 0xe8) = uVar8; *(undefined4 *)((int)pvVar5 + 0xec) = uVar9; *(undefined4 *)((int)pvVar5 + 0xf0) = uVar10; *(undefined4 *)((int)pvVar5 + 0xf4) = uVar11; *(undefined4 *)((int)pvVar5 + 0xf8) = uVar12; *(undefined4 *)((int)pvVar5 + 0xfc) = uVar13; } if (uVar27 < gridSize) { pvVar4 = (local_ec->SavedGridEntities)._begin; iVar32 = uVar27 * 0x20; puVar2 = (undefined4 *)((int)pvVar4 + iVar32); if ((*(int *)((int)pvVar4 + iVar32) == 0x10) || (*(int *)(iVar32 + (int)(otherLookup->SavedGridEntities)._begin) == 0x10)) { puVar30 = (undefined4 *)((int)(otherLookup->SavedGridEntities)._begin + iVar32); uVar6 = puVar30[1]; uVar7 = puVar30[2]; uVar8 = puVar30[3]; uVar9 = *puVar2; uVar10 = puVar2[1]; uVar11 = puVar2[2]; uVar12 = puVar2[3]; uVar13 = puVar2[4]; uVar14 = puVar2[5]; uVar15 = puVar2[6]; uVar16 = puVar2[7]; *puVar2 = *puVar30; puVar2[1] = uVar6; puVar2[2] = uVar7; puVar2[3] = uVar8; uVar6 = puVar30[5]; uVar7 = puVar30[6]; uVar8 = puVar30[7]; puVar2[4] = puVar30[4]; puVar2[5] = uVar6; puVar2[6] = uVar7; puVar2[7] = uVar8; *puVar30 = uVar9; puVar30[1] = uVar10; puVar30[2] = uVar11; puVar30[3] = uVar12; puVar30[4] = uVar13; puVar30[5] = uVar14; puVar30[6] = uVar15; puVar30[7] = uVar16; } } if (uVar1 < gridSize) { pvVar4 = (local_ec->SavedGridEntities)._begin; iVar32 = uVar1 * 0x20; puVar2 = (undefined4 *)((int)pvVar4 + iVar32); if ((*(int *)((int)pvVar4 + iVar32) == 0x10) || (*(int *)(iVar32 + (int)(otherLookup->SavedGridEntities)._begin) == 0x10)) { puVar30 = (undefined4 *)((int)(otherLookup->SavedGridEntities)._begin + iVar32); uVar6 = puVar30[1]; uVar7 = puVar30[2]; uVar8 = puVar30[3]; uVar9 = *puVar2; uVar10 = puVar2[1]; uVar11 = puVar2[2]; uVar12 = puVar2[3]; uVar13 = puVar2[4]; uVar14 = puVar2[5]; uVar15 = puVar2[6]; uVar16 = puVar2[7]; *puVar2 = *puVar30; puVar2[1] = uVar6; puVar2[2] = uVar7; puVar2[3] = uVar8; uVar6 = puVar30[5]; uVar7 = puVar30[6]; uVar8 = puVar30[7]; puVar2[4] = puVar30[4]; puVar2[5] = uVar6; puVar2[6] = uVar7; puVar2[7] = uVar8; *puVar30 = uVar9; puVar30[1] = uVar10; puVar30[2] = uVar11; puVar30[3] = uVar12; puVar30[4] = uVar13; puVar30[5] = uVar14; puVar30[6] = uVar15; puVar30[7] = uVar16; } } if (uVar28 < gridSize) { pvVar4 = (local_ec->SavedGridEntities)._begin; iVar32 = (roomWidth + 2) * 0x160; puVar2 = (undefined4 *)((int)pvVar4 + iVar32); if ((*(int *)((int)pvVar4 + iVar32) == 0x10) || (*(int *)(iVar32 + (int)(otherLookup->SavedGridEntities)._begin) == 0x10)) { puVar30 = (undefined4 *)((int)(otherLookup->SavedGridEntities)._begin + iVar32); uVar6 = puVar30[1]; uVar7 = puVar30[2]; uVar8 = puVar30[3]; uVar9 = *puVar2; uVar10 = puVar2[1]; uVar11 = puVar2[2]; uVar12 = puVar2[3]; uVar13 = puVar2[4]; uVar14 = puVar2[5]; uVar15 = puVar2[6]; uVar16 = puVar2[7]; *puVar2 = *puVar30; puVar2[1] = uVar6; puVar2[2] = uVar7; puVar2[3] = uVar8; uVar6 = puVar30[5]; uVar7 = puVar30[6]; uVar8 = puVar30[7]; puVar2[4] = puVar30[4]; puVar2[5] = uVar6; puVar2[6] = uVar7; puVar2[7] = uVar8; *puVar30 = uVar9; puVar30[1] = uVar10; puVar30[2] = uVar11; puVar30[3] = uVar12; puVar30[4] = uVar13; puVar30[5] = uVar14; puVar30[6] = uVar15; puVar30[7] = uVar16; } } if ((0x14 < gridSize) && ((pvVar4 = (local_ec->SavedGridEntities)._begin, *(int *)((int)pvVar4 + 0x280) == 0x10 || (*(int *)((int)(otherLookup->SavedGridEntities)._begin + 0x280) == 0x10)))) { pvVar5 = (otherLookup->SavedGridEntities)._begin; uVar6 = *(undefined4 *)((int)pvVar4 + 0x280); uVar7 = *(undefined4 *)((int)pvVar4 + 0x284); uVar8 = *(undefined4 *)((int)pvVar4 + 0x288); uVar9 = *(undefined4 *)((int)pvVar4 + 0x28c); uVar10 = *(undefined4 *)((int)pvVar4 + 0x290); uVar11 = *(undefined4 *)((int)pvVar4 + 0x294); uVar12 = *(undefined4 *)((int)pvVar4 + 0x298); uVar13 = *(undefined4 *)((int)pvVar4 + 0x29c); uVar14 = *(undefined4 *)((int)pvVar5 + 0x284); uVar15 = *(undefined4 *)((int)pvVar5 + 0x288); uVar16 = *(undefined4 *)((int)pvVar5 + 0x28c); *(undefined4 *)((int)pvVar4 + 0x280) = *(undefined4 *)((int)pvVar5 + 0x280); *(undefined4 *)((int)pvVar4 + 0x284) = uVar14; *(undefined4 *)((int)pvVar4 + 0x288) = uVar15; *(undefined4 *)((int)pvVar4 + 0x28c) = uVar16; uVar14 = *(undefined4 *)((int)pvVar5 + 0x294); uVar15 = *(undefined4 *)((int)pvVar5 + 0x298); uVar16 = *(undefined4 *)((int)pvVar5 + 0x29c); *(undefined4 *)((int)pvVar4 + 0x290) = *(undefined4 *)((int)pvVar5 + 0x290); *(undefined4 *)((int)pvVar4 + 0x294) = uVar14; *(undefined4 *)((int)pvVar4 + 0x298) = uVar15; *(undefined4 *)((int)pvVar4 + 0x29c) = uVar16; *(undefined4 *)((int)pvVar5 + 0x280) = uVar6; *(undefined4 *)((int)pvVar5 + 0x284) = uVar7; *(undefined4 *)((int)pvVar5 + 0x288) = uVar8; *(undefined4 *)((int)pvVar5 + 0x28c) = uVar9; *(undefined4 *)((int)pvVar5 + 0x290) = uVar10; *(undefined4 *)((int)pvVar5 + 0x294) = uVar11; *(undefined4 *)((int)pvVar5 + 0x298) = uVar12; *(undefined4 *)((int)pvVar5 + 0x29c) = uVar13; } if (uVar29 < gridSize) { iVar32 = uVar29 * 0x20; piVar34 = (int *)(iVar32 + (int)(local_ec->SavedGridEntities)._begin); if ((*piVar34 == 0x10) || (*(int *)(iVar32 + (int)(otherLookup->SavedGridEntities)._begin) == 0x10)) { piVar31 = (int *)((int)(otherLookup->SavedGridEntities)._begin + iVar32); iVar32 = *piVar34; iVar17 = piVar34[1]; iVar18 = piVar34[2]; iVar19 = piVar34[3]; iVar20 = piVar34[4]; iVar21 = piVar34[5]; iVar22 = piVar34[6]; iVar23 = piVar34[7]; iVar24 = piVar31[1]; iVar25 = piVar31[2]; iVar26 = piVar31[3]; *piVar34 = *piVar31; piVar34[1] = iVar24; piVar34[2] = iVar25; piVar34[3] = iVar26; iVar24 = piVar31[5]; iVar25 = piVar31[6]; iVar26 = piVar31[7]; piVar34[4] = piVar31[4]; piVar34[5] = iVar24; piVar34[6] = iVar25; piVar34[7] = iVar26; *piVar31 = iVar32; piVar31[1] = iVar17; piVar31[2] = iVar18; piVar31[3] = iVar19; piVar31[4] = iVar20; piVar31[5] = iVar21; piVar31[6] = iVar22; piVar31[7] = iVar23; } } if (uVar33 < gridSize) { iVar32 = uVar33 * 0x20; piVar34 = (int *)((int)(local_ec->SavedGridEntities)._begin + iVar32); if ((*piVar34 == 0x10) || (*(int *)(iVar32 + (int)(otherLookup->SavedGridEntities)._begin) == 0x10)) { iVar17 = *piVar34; iVar18 = piVar34[1]; iVar19 = piVar34[2]; iVar20 = piVar34[3]; piVar31 = (int *)((int)(otherLookup->SavedGridEntities)._begin + iVar32); iVar32 = piVar34[4]; iVar21 = piVar34[5]; iVar22 = piVar34[6]; iVar23 = piVar34[7]; iVar24 = piVar31[1]; iVar25 = piVar31[2]; iVar26 = piVar31[3]; *piVar34 = *piVar31; piVar34[1] = iVar24; piVar34[2] = iVar25; piVar34[3] = iVar26; iVar24 = piVar31[5]; iVar25 = piVar31[6]; iVar26 = piVar31[7]; piVar34[4] = piVar31[4]; piVar34[5] = iVar24; piVar34[6] = iVar25; piVar34[7] = iVar26; *piVar31 = iVar17; piVar31[1] = iVar18; piVar31[2] = iVar19; piVar31[3] = iVar20; piVar31[4] = iVar32; piVar31[5] = iVar21; piVar31[6] = iVar22; piVar31[7] = iVar23; } } return 1; } //@@ 007496a0 Level::get_rooms_within_two_doors /* DB: ? (set* out, roomIdx): for each door of the room (AllowedDoors) whose neighbour is a normal room or visited and not flag 1, inserts it and its own neighbours (except the start) into std::set; Level::ChangeRoom on a 1-in-10 roll */ undefined4 * Level::get_rooms_within_two_doors(undefined4 *param_1,int param_2) { int idx; void *pvVar1; RoomDescriptor *pRVar2; int *piVar3; Level *this; uint uVar4; uint uVar5; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined4 local_2c; uint local_28; uint local_24; int *local_20; RoomDescriptor *local_1c; uint local_18; Level *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afdffe; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; local_2c = 0; *param_1 = 0; param_1[1] = 0; pvVar1 = operator_new(0x14); this = local_14; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *param_1 = pvVar1; local_8 = 0; local_2c = 1; pRVar2 = GetRoomByIdx(local_14,param_2,-1); local_24 = 0; local_28 = 1; local_20 = pRVar2->_doors; local_1c = pRVar2; do { uVar5 = local_24; uVar4 = local_28; if ((-1 < *local_20) && ((pRVar2->_doors[(local_24 >> 5) - 1] & local_28) != 0)) { pRVar2 = GetRoomByIdx(this,*local_20,-1); if (((*(int *)((int)pRVar2->Data + 8) == 1) || (pRVar2->VisitedCount != 0)) && ((pRVar2->Flags & 1) == 0)) { std::set::insert(local_34,local_20); piVar3 = pRVar2->_doors; local_18 = 0; uVar4 = 1; do { idx = *piVar3; if (((-1 < idx) && ((pRVar2->_doors[(local_18 >> 5) - 1] & uVar4) != 0)) && (idx != param_2)) { GetRoomByIdx(local_14,idx,-1); if (((*(int *)((int)pRVar2->Data + 8) == 1) || (pRVar2->VisitedCount != 0)) && ((pRVar2->Flags & 1) == 0)) { std::set::insert(local_3c,piVar3); } } piVar3 = piVar3 + 1; local_18 = local_18 + 1; uVar4 = uVar4 << 1 | (uint)((int)uVar4 < 0); } while ((int)local_18 < 8); uVar4 = local_28; uVar5 = local_24; } pRVar2 = local_1c; this = local_14; } local_24 = uVar5 + 1; local_20 = local_20 + 1; local_28 = uVar4 << 1 | (uint)((int)uVar4 < 0); } while ((int)local_24 < 8); ExceptionList = local_10; return param_1; } //@@ 00749830 Level::CanSpawnDevilRoom /* ZHL [lua] Lua binding Level:CanSpawnDevilRoom prototype: db/protos.zhl */ byte __thiscall Level::CanSpawnDevilRoom(Level *this) { uint uVar1; bool bVar2; byte bVar3; uint uVar4; uint uVar5; int iVar6; uint uVar7; int iVar8; if (g_game->_challenge != 0x2c) { uVar1 = g_game->_debugCurses; iVar6 = this->_stage; uVar7 = g_game->_curses; uVar4 = Seeds::GetForcedCurses(); uVar5 = Seeds::GetPreventedCurses(); iVar8 = iVar6 + 1; if ((~uVar5 & (uVar4 | uVar1 | uVar7) & 2) == 0) { iVar8 = iVar6; } if (((((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) || ((g_game->_stageType != 4 && (g_game->_stageType != 5)))) || (iVar8 != 8)) && ((bVar3 = IsPreAscent(this), bVar3 == 0 && ((5 < this->_stage - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))))) { if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { bVar2 = true; } else { bVar2 = false; } iVar6 = iVar8 + 1; if (!bVar2) { iVar6 = iVar8; } if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { if (iVar6 == 1) { if ((g_game->_dailyChallenge)._specialDailyId != 0x11) { return 0; } } else { if (8 < iVar6) { return 0; } if ((iVar6 == 6) && ((g_manager->_persistentGameData)._achievements[4] == 0)) { if (g_manager->_state != 2) { return 0; } if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) { return 0; } } } } uVar1 = *(uint *)((int)this->_roomList[this->_lastBossRoomListIndex].Data + 0x38); uVar7 = uVar1 & 1; if ((uVar1 & 2) != 0) { uVar7 = uVar7 + 1; } uVar4 = uVar7 + 1; if ((uVar1 & 4) == 0) { uVar4 = uVar7; } uVar7 = uVar4 + 1; if ((uVar1 & 8) == 0) { uVar7 = uVar4; } uVar4 = uVar7 + 1; if ((uVar1 & 0x10) == 0) { uVar4 = uVar7; } uVar7 = uVar4 + 1; if ((uVar1 & 0x20) == 0) { uVar7 = uVar4; } uVar4 = uVar7 + 1; if ((uVar1 & 0x40) == 0) { uVar4 = uVar7; } uVar7 = uVar4 + 1; if ((uVar1 & 0x80) == 0) { uVar7 = uVar4; } if (1 < uVar7) { return 1; } } } return 0; } //@@ 007499a0 Level::InitializeDevilAngelRoom /* ZHL [exact] __thiscall void Level::InitializeDevilAngelRoom(bool ForceAngel, bool ForceDevil); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Level::InitializeDevilAngelRoom(Level *this,byte ForceAngel,byte ForceDevil) { RNG *rng; code *pcVar1; sbyte sVar2; byte bVar3; RoomConfig *roomConfig; uint uVar4; uint forcedCurses; uint preventedCurses; int effectiveStage; RoomConfig_Room *pickedRoom; int iVar5; RoomDescriptor *devilRoomDesc; uint uVar6; float angelChance; undefined3 in_stack_00000005; undefined3 in_stack_00000009; int maxVariant; uint minVariant; uint roomSubtype; int roomType; void *local_10; undefined1 *puStack_c; undefined4 local_8; sbyte baseDoorSlot; void *bossRoomData; undefined4 flagsHigh; Game *game; bool isAngelRoll; local_8 = 0xffffffff; puStack_c = &LAB_00afe03d; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U), g_invalidRoomDescriptorGuard == -1)) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } devilRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { devilRoomDesc = this->_roomList + 0x1fb; } if (devilRoomDesc->Data != (void *)0x0) { ExceptionList = local_10; return; } roomConfig = &g_game->_roomConfig; roomType = 0xe; minVariant = 0; maxVariant = 99; roomSubtype = 0; angelChance = get_angel_room_chance(); uVar4 = (this->_devilAngelRoomRNG)._seed; rng = &this->_devilAngelRoomRNG; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (this->_devilAngelRoomRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(this->_devilAngelRoomRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_devilAngelRoomRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_devilAngelRoomRNG)._shift3 & 0x1f) ^ uVar4; (this->_devilAngelRoomRNG)._seed = uVar4; uVar6 = g_game->_debugCurses; iVar5 = g_game->_stage; isAngelRoll = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 < angelChance; uVar4 = this->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); effectiveStage = iVar5 + 1; if ((~preventedCurses & (forcedCurses | uVar6 | uVar4) & 2) == 0) { effectiveStage = iVar5; } if ((((effectiveStage == 8) && (bVar3 = IsStageWithinEnd(10,isAngelRoll), bVar3 != 0)) && ((g_manager->_persistentGameData)._achievements[0x22] == 0)) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { maxVariant = 100; minVariant = 100; } if ((isAngelRoll) || (ForceAngel != 0)) { iVar5 = 0xf; roomType = 0xf; } else { iVar5 = 0xe; } if (ForceDevil == 0) { if (iVar5 != 0xe) goto LAB_00749b89; } else { roomType = 0xe; } bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xae); roomSubtype = (uint)(bVar3 != 0); LAB_00749b89: if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8 = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } devilRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { devilRoomDesc = this->_roomList + 0x1fb; } Seeds::Init3((Seeds *)devilRoomDesc,rng); iVar5 = 10; do { if (iVar5 < 1) break; uVar4 = rng->_seed; _ForceAngel = 0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)(this->_devilAngelRoomRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(this->_devilAngelRoomRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(this->_devilAngelRoomRNG)._shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; pickedRoom = RoomConfig::GetRandomRoom (roomConfig,uVar4,0,0,roomType,0xd,minVariant,maxVariant,1,10, (uint *)&ForceAngel,roomSubtype,-1); devilRoomDesc->Data = pickedRoom; bVar3 = CanSpawnDevilRoom(this); if (bVar3 == 0) break; uVar6 = 0; uVar4 = Random(); bossRoomData = this->_roomList[this->_lastBossRoomListIndex].Data; baseDoorSlot = (sbyte)(uVar4 & 7); if (((*(uint *)((int)bossRoomData + 0x38) & 1 << baseDoorSlot) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (baseDoorSlot - 2U & 3)) != 0)) { uVar6 = 1; } bVar3 = baseDoorSlot + 1U & 7; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << bVar3) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (bVar3 - 2 & 3)) != 0)) { uVar6 = uVar6 + 1; } bVar3 = baseDoorSlot + 2U & 7; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << bVar3) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (bVar3 - 2 & 3)) != 0)) { uVar6 = uVar6 + 1; } bVar3 = baseDoorSlot + 3U & 7; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << bVar3) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (bVar3 - 2 & 3)) != 0)) { uVar6 = uVar6 + 1; } bVar3 = baseDoorSlot - 4U & 7; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << bVar3) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (bVar3 - 2 & 3)) != 0)) { uVar6 = uVar6 + 1; } bVar3 = baseDoorSlot - 3U & 7; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << bVar3) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (bVar3 - 2 & 3)) != 0)) { uVar6 = uVar6 + 1; } uVar4 = (uVar4 & 7) - 2 & 7; _ForceDevil = uVar4 - 2 & 3; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << (sbyte)uVar4) != 0) && (sVar2 = (sbyte)_ForceDevil, _ForceDevil = 0, (*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << sVar2) != 0)) { uVar6 = uVar6 + 1; } bVar3 = baseDoorSlot - 1U & 7; if (((*(uint *)((int)bossRoomData + 0x38) & 1 << bVar3) != 0) && ((*(uint *)((int)devilRoomDesc->Data + 0x38) & 1 << (bVar3 - 2 & 3)) != 0)) { uVar6 = uVar6 + 1; } iVar5 = iVar5 + -1; } while (uVar6 < 2); if ((roomType == 0xe) && ((((g_manager->_persistentGameData)._achievements[0x8e] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) && (((g_game->_gameStateFlags & 0x20000000) == 0 && (roomSubtype == 0)))))) { uVar4 = 0; if (((g_game->_gameStateFlags & 0x20000040) != 0) && (uVar4 = 1, 0 < g_game->_devilRoomDeals)) { uVar4 = 3; } uVar6 = rng->_seed; _ForceAngel = uVar4 + 10; if ((g_game->_dailyChallenge)._specialDailyId != 0x11) { _ForceAngel = uVar4; } if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = rng->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar6 = uVar6 >> ((byte)(this->_devilAngelRoomRNG)._shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)(this->_devilAngelRoomRNG)._shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)(this->_devilAngelRoomRNG)._shift3 & 0x1f) ^ uVar6; rng->_seed = uVar6; if (((uVar6 % 0x14 < _ForceAngel) && (minVariant < 100)) && (devilRoomDesc->Flags = devilRoomDesc->Flags | 0x10, (game->_dailyChallenge)._specialDailyId != 0x11)) { flagsHigh = *(undefined4 *)((int)&game->_gameStateFlags + 4); *(uint *)&game->_gameStateFlags = (uint)game->_gameStateFlags | 0x20000000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = flagsHigh; } } ExceptionList = local_10; return; } //@@ 0074a090 Level::GetEnterPosition /* ZHL [lua] Lua binding Level:GetEnterPosition prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Level::GetEnterPosition(Level *this,Vector *outPosition) { int iVar1; float fVar2; RoomDescriptor *pRVar3; iVar1 = this->_currentRoomIndex; if ((iVar1 == -4) || (iVar1 == -0xb)) { iVar1 = this->_previousRoomIndex; if (-1 < iVar1) { outPosition->x = 120.0; outPosition->y = 160.0; return outPosition; } outPosition->y = 280.0; if (iVar1 == -6) { outPosition->x = 560.0; return outPosition; } outPosition->x = 480.0; return outPosition; } if (iVar1 == -0xd) { outPosition->x = 440.0; outPosition->y = 168.0; return outPosition; } if (iVar1 == -0xe) { outPosition->x = 320.0; outPosition->y = 160.0; return outPosition; } if (iVar1 == -0xf) { outPosition->x = 80.0; outPosition->y = 400.0; return outPosition; } if ((-1 < iVar1) && (iVar1 == this->_dungeonReturnRoomIndex)) { pRVar3 = GetRoomByIdx(this,this->_previousRoomIndex,-1); if (((pRVar3->Data != (void *)0x0) && (*(int *)((int)pRVar3->Data + 8) == 0x10)) || ((this->_previousRoomIndex == -0xd || (this->_previousRoomIndex == -0x12)))) { fVar2 = (this->_dungeonReturnPosition).y; outPosition->x = (this->_dungeonReturnPosition).x; outPosition->y = fVar2; return outPosition; } } fVar2 = g_vectorZero.y; outPosition->x = g_vectorZero.x; outPosition->y = fVar2; return outPosition; } //@@ 0074a1b0 Level::UncoverHiddenDoor /* ZHL [lua] Lua binding Level:UncoverHiddenDoor */ void Level::UncoverHiddenDoor(int param_1,int param_2) { RoomDescriptor *pRVar1; int iVar2; int *piVar3; Level *in_ECX; undefined4 extraout_ECX; uint uVar4; int iVar5; if (param_1 < -0x13) { param_1 = -0x14; } iVar2 = 0xa8; if (param_1 < 0xa8) { iVar2 = param_1; } if (param_2 < 1) { param_2 = 0; } iVar5 = 7; if (param_2 < 7) { iVar5 = param_2; } pRVar1 = GetRoomByIdx(in_ECX,iVar2,-1); iVar2 = pRVar1->_doors[iVar5]; pRVar1 = GetRoomByIdx(in_ECX,iVar2,-1); if (pRVar1->Data != (void *)0x0) { uVar4 = iVar5 + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } GetTargetSlot(iVar2,uVar4,extraout_ECX); iVar2 = room_shape_get_door_grid_index (*(byte *)((int)pRVar1->Data + 0x47) + 2, *(undefined4 *)((int)pRVar1->Data + 0x48)); piVar3 = (int *)(iVar2 * 0x20 + (int)(pRVar1->SavedGridEntities)._begin); if (*piVar3 == 0) { *piVar3 = 0x10; piVar3[1] = 8; return; } if ((*piVar3 == 0x10) && (piVar3[1] == 7)) { piVar3[1] = 8; } } return; } //@@ 0074a280 FUN_0074a280 void FUN_0074a280(int param_1,undefined4 param_2,undefined1 param_3) { int iVar1; int in_ECX; if (1 < param_1) { KAGE_LogMessage(0x10,(byte *)"PortalIdx is bigger than 2!"); } *(undefined4 *)(in_ECX + 0x18378 + param_1 * 0xc) = *(undefined4 *)(in_ECX + 0x18304); iVar1 = in_ECX + param_1 * 0xc; *(undefined4 *)(iVar1 + 0x1837c) = param_2; *(undefined1 *)(iVar1 + 0x18380) = param_3; return; } //@@ 0074a2d0 Level::AddCurse /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Level:AddCurse */ void __thiscall Level::AddCurse(Level *this,uint param_2,char param_3) { undefined4 *****pppppuVar1; uint uVar2; uint uVar3; undefined4 *****in_stack_ffffff94; uint in_stack_ffffff98; undefined4 *****tmpCurseName [4]; undefined4 tmpCurseNameSize; uint tmpCurseNameCapacity; undefined4 *****curseName; undefined4 ****ppppuStack_38; undefined4 ****ppppuStack_34; undefined4 ****ppppuStack_30; undefined8 curseNameSizeCapacity; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 ****local_14; void *challengeParams; int curseCount; Game *game; puStack_20 = (undefined1 *)(tmpCurseName + 0x14); local_14 = (undefined4 ****)0xffffffff; puStack_18 = &LAB_00afe06d; local_1c = ExceptionList; securityCookie = __security_cookie ^ (uint)(tmpCurseName + 0x11); ExceptionList = &local_1c; this->_curses = this->_curses | param_2; pppppuVar1 = tmpCurseName + 0x14; if (param_3 != '\0') { curseNameSizeCapacity = 0xf00000000; curseName = (undefined4 *****)0x0; local_14 = (undefined4 ****)0x0; curseCount = ((int)(g_game->_roomConfig)._curses._end - (int)(g_game->_roomConfig)._curses._begin) / 0x1c; uVar2 = 0; pppppuVar1 = tmpCurseName + 0x14; if (0 < curseCount) { do { uVar3 = uVar2 + 1; if ((param_2 & 1 << ((byte)uVar2 & 0x1f)) != 0) { in_stack_ffffff94 = tmpCurseName; pppppuVar1 = (undefined4 *****)GetCurseNameByIdx(in_stack_ffffff94,uVar3); if (&curseName != (undefined4 ******)pppppuVar1) { curseName = (undefined4 *****)*pppppuVar1; ppppuStack_38 = pppppuVar1[1]; ppppuStack_34 = pppppuVar1[2]; ppppuStack_30 = pppppuVar1[3]; curseNameSizeCapacity = *(undefined8 *)(pppppuVar1 + 4); pppppuVar1[4] = (undefined4 ****)0x0; pppppuVar1[5] = (undefined4 ****)0xf; *(undefined1 *)pppppuVar1 = 0; } if (0xf < tmpCurseNameCapacity) { uVar3 = tmpCurseNameCapacity + 1; in_stack_ffffff94 = tmpCurseName[0]; if (0xfff < uVar3) { in_stack_ffffff94 = (undefined4 *****)tmpCurseName[0][-1]; uVar3 = tmpCurseNameCapacity + 0x24; if (0x1f < (uint)((int)tmpCurseName[0] + (-4 - (int)in_stack_ffffff94))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(in_stack_ffffff94,uVar3); } tmpCurseNameSize = 0; tmpCurseNameCapacity = 0xf; tmpCurseName[0] = (undefined4 *****)((uint)tmpCurseName[0] & 0xffffff00); in_stack_ffffff98 = uVar3; pppppuVar1 = (undefined4 *****)puStack_20; break; } uVar2 = uVar3; pppppuVar1 = tmpCurseName + 0x14; } while ((int)uVar3 < curseCount); } puStack_20 = (undefined1 *)pppppuVar1; pppppuVar1 = &curseName; if (0xf < curseNameSizeCapacity._4_4_) { pppppuVar1 = curseName; } HUD::show_fortune_line(pppppuVar1,in_stack_ffffff94,in_stack_ffffff98); pppppuVar1 = (undefined4 *****)puStack_20; if (0xf < curseNameSizeCapacity._4_4_) { uVar2 = curseNameSizeCapacity._4_4_ + 1; pppppuVar1 = curseName; if (0xfff < uVar2) { pppppuVar1 = (undefined4 *****)curseName[-1]; uVar2 = curseNameSizeCapacity._4_4_ + 0x24; if (0x1f < (uint)((int)curseName + (-4 - (int)pppppuVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppuVar1,uVar2); pppppuVar1 = (undefined4 *****)puStack_20; } } puStack_20 = (undefined1 *)pppppuVar1; game = g_game; if (g_game->_challenge != 0) { challengeParams = (g_manager->_challengeParams)._begin; uVar3 = ((int)(g_manager->_challengeParams)._end - (int)challengeParams) / 0xa4 - 1; uVar2 = g_game->_challenge; if (uVar3 <= (uint)g_game->_challenge) { uVar2 = uVar3; } this->_curses = this->_curses | *(uint *)(uVar2 * 0xa4 + 0x84 + (int)challengeParams); this->_curses = this->_curses & ~*(uint *)(uVar2 * 0xa4 + 0x88 + (int)challengeParams); } HUD::InvalidateCraftingItem(&game->_hud,(Entity_Player *)0x0); ExceptionList = local_1c; return; } //@@ 0074a500 Level::generate_home /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: roomConfig=Game (_generationRNG 0x182d4, _nbRooms 0x182cc, 0x18314): fixed rooms at (6,6) start shape 4, (6,8),(7,7),(5,7),(6,4) from stage type 0xd (Home) via GetRoomByStageTypeAndVariant/GetRandomRoom; Tainted Keeper (0x21) check prototype: db/protos.zhl */ void __thiscall Level::generate_home(Level *roomConfig) { RNG *rng; void *unused; code *pcVar1; uint seed; void *pvVar2; void *slot; void *slot_00; void *slot_01; RoomConfig *roomConfig; RoomConfig_Room *roomData; Entity_Player *taintedKeeper; RoomConfig_Room *data; RoomConfig_Room *data_00; RoomConfig_Room *data_01; uint nextSeed; int iVar3; RoomDescriptor *specialRoom; int *piVar4; uint local_3c0; uint local_3bc; RoomConfig_Room *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; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00afe158; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; seed = (roomConfig->_generationRNG)._seed; rng = &roomConfig->_generationRNG; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; RoomDescriptor::Init(generator,seed); local_8 = 0; if ((uint)((local_40 - local_48[0]) / 0x48) < 5) { vector_LevelGenerator_Room_reserve(local_48,5); } pvVar2 = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,6,4,-1,-1,-1); roomConfig->_lastBossRoomListIndex = *(int *)((int)pvVar2 + 4); slot = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,8,1,6,8,3); slot_00 = LevelGenerator::CreateRoom((LevelGenerator *)generator,7,7,1,7,7,2); slot_01 = LevelGenerator::CreateRoom((LevelGenerator *)generator,5,7,1,5,7,0); local_3b0 = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,4,8,6,5,1); roomConfig = &g_game->_roomConfig; roomData = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0xd,1,0,-1); taintedKeeper = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x21); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; data = RoomConfig::GetRandomRoom (roomConfig,seed,1,0xd,2,1,0,-1,1,10,(uint *)((int)slot + 0x1c), -(uint)(taintedKeeper != (Entity_Player *)0x0) & 100,-1); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; data_00 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0xd,4,1,0,-1,1,10,(uint *)((int)slot_00 + 0x1c),0xffffffff, -1); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; data_01 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0xd,4,1,0,-1,1,10,(uint *)((int)slot_01 + 0x1c),0xffffffff, -1); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; local_3b4 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0xd,5,8,0,-1,1,10,(uint *)((int)local_3b0 + 0x1c), 0xffffffff,-1); piVar4 = roomConfig->_roomMap; for (iVar3 = 0x1fb; iVar3 != 0; iVar3 = iVar3 + -1) { *piVar4 = -1; piVar4 = piVar4 + 1; } roomConfig->_roomCount = 0; seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; unused = (void *)(roomConfig->_generationRNG)._shift3; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)unused & 0x1f) ^ seed; rng->_seed = seed; place_room(roomConfig,pvVar2,roomData,seed,unused,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; pvVar2 = (void *)(roomConfig->_generationRNG)._shift3; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed; rng->_seed = seed; place_room(roomConfig,slot,data,seed,pvVar2,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; pvVar2 = (void *)(roomConfig->_generationRNG)._shift3; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed; rng->_seed = seed; place_room(roomConfig,slot_00,data_00,seed,pvVar2,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; pvVar2 = (void *)(roomConfig->_generationRNG)._shift3; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed; rng->_seed = seed; place_room(roomConfig,slot_01,data_01,seed,pvVar2,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } roomData = local_3b0; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; pvVar2 = (void *)(roomConfig->_generationRNG)._shift3; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed; rng->_seed = seed; place_room(roomConfig,local_3b0,local_3b4,seed,pvVar2,(RoomDescriptor **)0x0); pvVar2 = ThreadLocalStoragePointer; roomConfig->_lastBossRoomListIndex = *(int *)((int)roomData + 4); if ((*(int *)(*(int *)pvVar2 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x1fc; } Seeds::Init3((Seeds *)specialRoom,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; local_3b0 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,3,0xd,0,-1,1,10,(uint *)&local_3b4,0xffffffff,-1); iVar3 = *(int *)pvVar2; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x1fc; } specialRoom->Data = local_3b0; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x200; } Seeds::Init3((Seeds *)specialRoom,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; local_3b0 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0x16,0xd,0,-1,1,10,(uint *)&local_3b4,0xffffffff,-1); iVar3 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x200; } specialRoom->Data = local_3b0; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x1fe; } Seeds::Init3((Seeds *)specialRoom,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; local_3b0 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0x10,0xd,0,-1,1,10,(uint *)&local_3b4,0xffffffff,-1); iVar3 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x1fe; } specialRoom->Data = local_3b0; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x201; } Seeds::Init3((Seeds *)specialRoom,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; local_3b0 = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,5,0xd,0,-1,1,10,(uint *)&local_3b4,0x37,-1); iVar3 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x201; } specialRoom->Data = local_3b0; if ((*(int *)(iVar3 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x203; } Seeds::Init3((Seeds *)specialRoom,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; roomData = RoomConfig::GetRandomRoom(roomConfig,seed,1,0xd,1,0xd,0,-1,0,0,(uint *)&local_3b4,1,-1) ; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } manager = g_manager; specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x203; } specialRoom->Data = roomData; if (((manager->_persistentGameData)._achievements[0x98] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_3bc = 1; } else { local_3bc = 2; } if (((manager->_persistentGameData)._achievements[0x99] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_3c0 = 1; } else { local_3c0 = 2; } if (((manager->_persistentGameData)._achievements[0x9a] != 0) || (((manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_3bc = local_3bc + 1; } seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; local_3b0 = (RoomConfig_Room *)0x1a; rng->_seed = seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } seed = seed >> 3 ^ seed; seed = seed << 3 ^ seed; seed = seed >> 0x1a ^ seed; local_3b4 = (RoomConfig_Room *)(seed % local_3bc); if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } seed = seed >> 3 ^ seed; seed = seed << 3 ^ seed; piVar4 = &local_3b4->StageId; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x207; } Seeds::Init3((Seeds *)specialRoom,rng); nextSeed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (nextSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); nextSeed = rng->_seed; if (nextSeed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } nextSeed = nextSeed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ nextSeed; nextSeed = nextSeed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ nextSeed; nextSeed = nextSeed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ nextSeed; rng->_seed = nextSeed; roomData = RoomConfig::GetRandomRoom (roomConfig,nextSeed,1,0,2,0xd,0,-1,1,10,(uint *)&local_3b4, (int)piVar4 + (seed >> 0x1a ^ seed) % local_3c0,-1); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 0xc; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x207; } specialRoom->Data = roomData; seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; rng->_seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 0xd; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoom = &g_roomDescriptorDummy; if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x20c; } Seeds::Init3((Seeds *)specialRoom,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } seed = seed >> ((byte)(roomConfig->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(roomConfig->_generationRNG)._shift2 & 0x1f) ^ seed; seed = seed >> ((byte)(roomConfig->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = seed; roomData = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0xf,0xd,0,-1,1,10,(uint *)&local_3b4,1,-1); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8 = CONCAT31(local_8._1_3_,0xe); RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } if ((uint)roomConfig->_currentDimensionIdx < 3) { specialRoom = roomConfig->_roomList + 0x20c; } else { specialRoom = &g_roomDescriptorDummy; } specialRoom->Data = roomData; FID_conflict__Tidy(local_30); FID_conflict__Tidy(local_3c); vector_LevelGenerator_Room_tidy(local_48); ExceptionList = local_10; return; } //@@ 0074b5b0 Level::SetRedHeartDamage /* ZHL [lua] Lua binding Level:SetRedHeartDamage */ void __thiscall Level::SetRedHeartDamage(Level *this) { this->_levelStateFlag = this->_levelStateFlag | 4; this->_greedwavesclearedwithoutredheartdamage = 0; return; } //@@ 0074b5d0 Level::CanSpawnTrapDoor /* DB: Level this: considers Labyrinth curse (bit 2 forced/prevented), mirror dimension, Ascent, challenge path, difficulty, IsNextStageAvailable/IsStageWithinEnd; callers then Room::SpawnGridEntity(..,0x11 GRID_TRAPDOOR) (GridEntity_PressurePlate::Reward, Game::BombDamage) prototype: db/protos.zhl */ byte __thiscall Level::CanSpawnTrapDoor(Level *this) { uint uVar1; int iVar2; uint uVar3; void *pvVar4; Game *pGVar5; byte bVar6; uint uVar7; uint uVar8; ChallengeParam *pCVar9; int iVar10; uVar1 = g_game->_debugCurses; iVar2 = g_game->_stage; uVar3 = this->_curses; uVar7 = Seeds::GetForcedCurses(); uVar8 = Seeds::GetPreventedCurses(); iVar10 = iVar2 + 1; if ((~uVar8 & (uVar7 | uVar1 | uVar3) & 2) == 0) { iVar10 = iVar2; } bVar6 = HasMirrorDimension(this); if ((bVar6 == 0) || (this->_currentDimensionIdx != 1)) { if (((char)this[1]._stage == '\0') && ((((pvVar4 = this->_room, pvVar4 != (void *)0x0 && (*(int *)((int)pvVar4 + 8) == 5)) && (*(int *)(*(int *)(*(int *)((int)pvVar4 + 4) + 0x10) + 0x10) == 0x59)) && (bVar6 = IsPreAscent((Level *)g_game), bVar6 != 0)))) { return 0; } pGVar5 = g_game; if (((5 < this->_stage - 1U) || ((g_game->_gameStateFlags & 0x1000000000000) == 0)) && ((pCVar9 = Game::GetChallengeParams(g_game), pCVar9->_pathType != 2 || ((((this->_stageType == 4 || (this->_stageType == 5)) && ((iVar10 == 1 || (((iVar10 == 3 || (iVar10 == 5)) || (iVar10 == 7)))))) || ((this->_currentRoomIndex == -10 || (pGVar5->_challenge == 0x2c)))))))) { iVar10 = pGVar5->_difficulty; if ((iVar10 == 2) || (iVar10 == 3)) { bVar6 = IsNextStageAvailable(this); return bVar6; } bVar6 = IsNextStageAvailable(this); if (bVar6 != 0) { if (iVar2 < 8) { return 1; } if ((iVar2 == 8) && (bVar6 = IsStageWithinEnd(10,0), bVar6 != 0)) { return 1; } } } } return 0; } //@@ 0074b710 Level::IsNextStageAvailable /* ZHL [lua] Lua binding Level:IsNextStageAvailable prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Level::IsNextStageAvailable(Level *this) { byte bVar1; char cVar2; uint uVar3; ChallengeParam *pCVar4; uint levelStage; uint uVar5; Game *pGVar6; pGVar6 = g_game; uVar5 = g_game->_stage; if (g_game->_challenge == 0x2c) { uVar3 = GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); levelStage = pGVar6->_stage; } else { if (g_game->_currentDimensionIdx == 2) goto LAB_0074b760; uVar3 = g_game->_stageType; levelStage = uVar5; } pGVar6 = g_game; uVar3 = RoomConfig::GetStageID(levelStage,uVar3,-1); if (uVar3 == 0x24) { return 0; } LAB_0074b760: bVar1 = IsPreAscent((Level *)pGVar6); pGVar6 = g_game; if (bVar1 != 0) { return 0; } if (uVar5 == 0xb) { return 0; } if (uVar5 == 0xc) { return 0; } if (uVar5 == 0xd) { return 0; } bVar1 = Game::IsGreedMode(g_game); if ((bVar1 != 0) && (uVar5 == 7)) { return 0; } if (((this->_curses & 2) != 0) && ((((uVar5 == 1 || (uVar5 == 3)) || (uVar5 == 5)) || (uVar5 == 7)))) { uVar5 = uVar5 + 1; } if ((uVar5 == 8) && (bVar1 = IsAltPath(this), bVar1 != 0)) { return 0; } pCVar4 = Game::GetChallengeParams(pGVar6); if ((((uVar5 == 6) || ((uVar5 == 5 && (uVar3 = filter_curses((Level *)pGVar6,2), pGVar6 = g_game, uVar3 != 0)))) && (pCVar4->_pathType == 3)) && (bVar1 = Game::GetStateFlag(pGVar6,0x30), bVar1 == 0)) { return 0; } cVar2 = Game::IsChallengeOrDaily(pGVar6); if ((cVar2 == '\0') || ((int)uVar5 < pCVar4->_endStage)) { return 1; } return 0; } //@@ 0074b830 Level::IsStageWithinEnd /* DB: ? stage < 8 in greed, challenge EndStage 0x40, shovel 550/552 checks prototype: db/protos.zhl, confirmed by RET 8 */ byte Level::IsStageWithinEnd(int stage,byte isAltPath) { Game *pGVar1; int iVar2; ChallengeParam *pCVar3; Entity_Player *pEVar4; undefined3 in_stack_00000009; iVar2 = stage; pGVar1 = g_game; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { return stage < 8; } pCVar3 = Game::GetChallengeParams(g_game); stage = 0xc; if ((pCVar3->_endStage != 0xc) && (((pGVar1->_challenge != 0 || ((pGVar1->_dailyChallenge)._id != 0)) || (((g_manager->_persistentGameData)._achievements[0x140] == 0 && ((g_manager->_state != 2 || (pGVar1->_isDebug == 0)))))))) { stage = 0xb; } if ((((iVar2 == 10) || (iVar2 == 0xb)) && (_isAltPath == 1)) && ((pEVar4 = PlayerManager::FirstCollectibleOwner (&pGVar1->_playerManager,0x226,(RNG **)&pGVar1->_playerManager,1), pEVar4 != (Entity_Player *)0x0 || (pEVar4 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x228,(RNG **)&g_game->_playerManager,1), pEVar4 != (Entity_Player *)0x0)))) { if (pCVar3->_isPathTypeSet == 0) { return 0; } if (pCVar3->_pathType != 1) { return 0; } } else if (pCVar3->_isPathTypeSet == 0) goto LAB_0074b943; if (((iVar2 != 10) && (iVar2 != 0xb)) || (_isAltPath == (pCVar3->_pathType == 1))) { if (pCVar3->_endStage != 0) { stage = pCVar3->_endStage; } if (pCVar3->_pathType != 3) { LAB_0074b943: return iVar2 <= stage; } } return 0; } //@@ 0074b960 Level::GetAbsoluteStage /* ZHL [lua] Lua binding Level:GetAbsoluteStage */ int Level::GetAbsoluteStage(void) { int iVar1; int iVar2; int *in_ECX; iVar1 = *in_ECX; if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { return iVar1; } if (iVar1 < 5) { return iVar1 * 2 + -1; } iVar2 = 0; if (iVar1 == 5) { iVar2 = 10; } return iVar2; } //@@ 0074b9a0 FUN_0074b9a0 void FUN_0074b9a0(void) { int *in_ECX; float in_XMM2_Da; if (in_XMM2_Da <= 0.001) { return; } if (*in_ECX < 5) { return; } return; } //@@ 0074ba00 Level::StartMamaMega /* ZHL [exact] __thiscall void Level::StartMamaMega(Vector * Position, Entity_Player* player); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Level::StartMamaMega(Level *this,Vector *Position,Entity_Player *player) { float fVar1; int idx; RoomDescriptor *pRVar2; Vector *pVVar3; float fVar4; float fVar5; Vector local_10; idx = this->_currentRoomIndex; if (idx < 0) { pRVar2 = GetRoomByIdx(this,idx,-1); pVVar3 = RandomVector(&local_10,pRVar2->DecorationSeed); fVar4 = pVVar3->x * 5000.0 + 4200.0; fVar5 = pVVar3->y * 5000.0 + 2520.0; } else { fVar4 = (float)((idx % 0xd) * 600); fVar5 = (float)((idx / 0xd) * 0x168); } fVar1 = Position->y; *(float *)&this->field_0x18394 = fVar4 + Position->x; *(float *)&this->field_0x18398 = fVar5 + fVar1; this->_levelStateFlag = this->_levelStateFlag | 0x4000; Room::MamaMegaExplosion(this->_room,Position,player); return; } //@@ 0074bac0 Level::IsAltPath /* ZHL [exact] __thiscall bool Level::IsAltPath(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Level::IsAltPath(Level *this) { if ((this->_stageType == 4) || (this->_stageType == 5)) { return 1; } return 0; } //@@ 0074bae0 Level::get_secret_exit_kind /* DB: the floor's secret exit door kind (1 Downpour, 2 Mines, 3 Mausoleum, 4 Mom's Heart) by depth and path; read 2026-10-24 (alt_path.md) prototype: db/protos.zhl */ int __thiscall Level::get_secret_exit_kind(Level *this) { bool bVar1; int iVar2; uint uVar3; uint uVar4; if (g_game->_difficulty == 2) { return 0; } if (g_game->_difficulty == 3) { return 0; } uVar3 = this->_stage; if ((uVar3 & 1) != 0) { if ((this->_stageType != 4) && (this->_stageType != 5)) { uVar4 = uVar3 + 1; if ((this->_curses & 2) == 0) { uVar4 = uVar3; } iVar2 = this->_stageType; bVar1 = false; goto LAB_0074bb45; } if ((this->_curses & 2) == 0) { return 0; } } uVar4 = uVar3 + 1; if ((this->_curses & 2) == 0) { uVar4 = uVar3; } iVar2 = this->_stageType; if ((iVar2 == 4) || (iVar2 == 5)) { bVar1 = true; } else { bVar1 = false; } LAB_0074bb45: uVar3 = uVar4 + 1; if (!bVar1) { uVar3 = uVar4; } if (uVar3 == 7) { if ((iVar2 == 4) || (iVar2 == 5)) { return 4; } } else { switch(uVar3) { case 1: case 2: return 1; case 3: case 4: return 2; case 5: return 3; } } return 0; } //@@ 0074bba0 Level::get_secret_exit_room /* DB: makes room -10 lazily: kind 4 a boss room of subtype 90, else a ROOM_SECRET_EXIT of that subtype (alt_path.md) */ RoomDescriptor * __thiscall Level::get_secret_exit_room(Level *this,Level *param_2) { RNG *rng; Game *pGVar1; uint seed; RoomConfig_Room *pRVar2; RoomDescriptor *this_00; int roomType; Level **requiredDoors; Level *roomSubtype; Level *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe1a1; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = this; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } this_00 = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { this_00 = this->_roomList + 0x204; } if (this_00->Data == (void *)0x0) { rng = &this->_devilAngelRoomRNG; Seeds::Init3((Seeds *)this_00,rng); pGVar1 = g_game; if (param_2 == (Level *)0x4) { param_2 = (Level *)0x0; seed = RNG::Next(rng); requiredDoors = ¶m_2; roomType = 5; roomSubtype = (Level *)0x5a; } else { local_14 = (Level *)0x0; seed = RNG::Next(rng); requiredDoors = &local_14; roomType = 0x1b; roomSubtype = param_2; } pRVar2 = RoomConfig::GetRandomRoom (&pGVar1->_roomConfig,seed,0,0,roomType,0xd,0,-1,1,10,(uint *)requiredDoors, (uint)roomSubtype,-1); this_00->Data = pRVar2; } ExceptionList = local_10; return this_00; } //@@ 0074bce0 FUN_0074bce0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ RoomDescriptor * FUN_0074bce0(void) { code *pcVar1; RoomDescriptor *other; uint uVar2; RoomConfig_Room *pRVar3; int in_ECX; RoomDescriptor *pRVar4; RNG local_e0; uint local_d0; RoomDescriptor local_cc; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe1d1; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard,local_14); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } pRVar4 = &g_roomDescriptorDummy; if (*(uint *)(in_ECX + 0x1830c) < 3) { pRVar4 = (RoomDescriptor *)(in_ECX + 0x17464); } other = (RoomDescriptor *)RoomDescriptor::constructor(&local_cc); RoomDescriptor::operator_assign(pRVar4,other); std::vector::_Tidy(); FID_conflict__Erase_tree_>_> (&local_cc.RestrictedGridIndexes, (fuzzer_allocator_> *) &local_cc.RestrictedGridIndexes, *(_Tree_node **)((int)local_cc.RestrictedGridIndexes._head + 4)); operator_delete(local_cc.RestrictedGridIndexes._head,0x14); std::vector::_Tidy(); FUN_00708f90(); pRVar4->ListIndex = -0xc; if (pRVar4->Data == (void *)0x0) { local_e0._seed = *(uint *)(in_ECX + 0x182e4); local_e0._shift3 = 0x1a; local_e0._shift1 = 3; local_e0._shift2 = 3; Seeds::Init3((Seeds *)pRVar4,&local_e0); local_d0 = 0; if (local_e0._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pRVar4 = (RoomDescriptor *)(*pcVar1)(); return pRVar4; } uVar2 = (uint)local_e0._seed >> ((byte)local_e0._shift1 & 0x1f) ^ local_e0._seed; uVar2 = uVar2 << ((byte)local_e0._shift2 & 0x1f) ^ uVar2; pRVar3 = RoomConfig::GetRandomRoom (&g_game->_roomConfig,uVar2 >> ((byte)local_e0._shift3 & 0x1f) ^ uVar2,0,0, 0x12,0xd,0,-1,0,0,&local_d0,99,-1); pRVar4->Data = pRVar3; } ExceptionList = local_10; return pRVar4; } //@@ 0074beb0 Level::init_rotgut_dungeon_room /* DB: ? this=Level (stage type +4 is 4/5, RNG +0x182d4..): RoomConfig::GetRandomRoom into the RoomDescriptor at level+0x175d4 (+0x5d75*4) guarded by +0x1830c<3, Seeds::Init3; called once from NpcAI::ENTITY_ROTGUT_face (ROOM_ROTGUT_DUNGEON) */ void Level::init_rotgut_dungeon_room(void) { uint uVar1; RoomConfig_Room *roomConfig; uint *in_ECX; uint uVar2; RoomDescriptor *roomDesc; RNG secondRoomRng; RNG firstRoomRng; RoomConfig *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; code *debugBreak; Game *game; bool isAltStage; void *tls; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afe03d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((in_ECX[1] == 4) || (in_ECX[1] == 5)) { isAltStage = true; } else { isAltStage = false; } uVar2 = *in_ECX + 1; if (!isAltStage) { uVar2 = *in_ECX; } if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } tls = ThreadLocalStoragePointer; if (uVar2 == 0) { uVar2 = 0; } else if (0xc < uVar2) { uVar2 = 0xd; } secondRoomRng._seed = (game->_seedEffects)._stageSeeds[uVar2]; firstRoomRng._shift3 = 8; firstRoomRng._shift1 = 5; firstRoomRng._shift2 = 0x1b; secondRoomRng._shift3 = 0x15; secondRoomRng._shift1 = 5; secondRoomRng._shift2 = 0x1b; firstRoomRng._seed = secondRoomRng._seed; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard,uVar1); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } roomDesc = &g_roomDescriptorDummy; if (in_ECX[0x60c3] < 3) { roomDesc = (RoomDescriptor *)(in_ECX + 0x5d75); } if (roomDesc->Data == (void *)0x0) { Seeds::Init3((Seeds *)roomDesc,&firstRoomRng); local_18 = &g_game->_roomConfig; local_14 = 0; if (firstRoomRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } uVar2 = (uint)firstRoomRng._seed >> ((byte)firstRoomRng._shift1 & 0x1f) ^ firstRoomRng._seed; uVar2 = uVar2 << ((byte)firstRoomRng._shift2 & 0x1f) ^ uVar2; roomConfig = RoomConfig::GetRandomRoom (local_18,uVar2 >> ((byte)firstRoomRng._shift3 & 0x1f) ^ uVar2,0,0,0x10, 0xd,0,-1,0,0,&local_14,2,-1); roomDesc->Data = roomConfig; } if (*(int *)(*(int *)tls + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard,uVar1); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } if (in_ECX[0x60c3] < 3) { roomDesc = (RoomDescriptor *)(in_ECX + 0x5da3); } else { roomDesc = &g_roomDescriptorDummy; } if (roomDesc->Data == (void *)0x0) { Seeds::Init3((Seeds *)roomDesc,&secondRoomRng); local_18 = (RoomConfig *)0x0; if (secondRoomRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } uVar1 = (uint)secondRoomRng._seed >> ((byte)secondRoomRng._shift1 & 0x1f) ^ secondRoomRng._seed; uVar1 = uVar1 << ((byte)secondRoomRng._shift2 & 0x1f) ^ uVar1; roomConfig = RoomConfig::GetRandomRoom (&g_game->_roomConfig, uVar1 >> ((byte)secondRoomRng._shift3 & 0x1f) ^ uVar1,0,0,0x10,0xd,0,-1, 0,0,(uint *)&local_18,3,-1); roomDesc->Data = roomConfig; } ExceptionList = local_10; return; } //@@ 0074c160 Level::get_door_neighbor_pos /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (shape, doorSlot) with EDX=room grid pos: per RoomShape (1..12, 2-wide for 6..12) computes the neighbour cell of a door slot via FUN_00752640 mask helper; result compared to g_levelGenInvalidPos in Level::try_place_random_room */ int * Level::get_door_neighbor_pos(int param_1,uint param_2) { undefined4 uVar1; int *neighborPos; int *in_ECX; int *in_EDX; int roomWidth; undefined1 auStack_84 [4]; uint local_80; uint *local_7c; undefined4 local_78; uint *local_74; undefined4 local_70; uint *local_6c; undefined4 local_68; uint *local_64; undefined4 local_60; uint *local_5c; undefined4 local_58; int *outPos; uint *leftX; int roomY; uint *upX; int upY; int rightX; int rightY; uint *downX; int downY; uint *left1X; int left1Y; int up1X; int up1Y; int right1X; int right1Y; int down1X; int down1Y; uint local_c; local_c = __security_cookie ^ (uint)auStack_84; local_74 = (uint *)*in_EDX; roomY = in_EDX[1]; if (((((param_1 == 9) || (param_1 == 10)) || (param_1 == 0xb)) || ((param_1 == 0xc || (param_1 == 8)))) || ((param_1 == 6 || (param_1 == 7)))) { roomWidth = 2; if ((((param_1 != 9) && (param_1 != 10)) && (param_1 != 0xb)) && ((param_1 != 0xc && (param_1 != 8)))) goto LAB_0074c1cf; } else { roomWidth = 1; LAB_0074c1cf: if ((param_1 != 4) && (local_80 = 1, param_1 != 5)) goto LAB_0074c1e9; } local_80 = 2; LAB_0074c1e9: upX = local_74; leftX = (uint *)((int)local_74 + -1); left1X = (uint *)((int)local_74 + -1); downX = local_74; left1Y = roomY + 1; upY = roomY + -1; rightX = roomWidth + (int)local_74; up1Y = roomY + -1; right1Y = roomY + 1; right1X = roomWidth + (int)local_74; up1X = (int)local_74 + 1; down1X = (int)local_74 + 1; rightY = roomY; downY = local_80 + roomY; down1Y = local_80 + roomY; local_80 = 0; outPos = in_ECX; switch(param_1) { case 1: local_74 = &local_80; local_70 = 7; local_80 = 0x80; local_58 = 6; local_5c = local_74; uVar1 = FUN_00752640(&local_74); local_6c = &local_80; local_68 = 5; uVar1 = FUN_00752640(uVar1); local_74 = &local_80; local_70 = 4; FUN_00752640(uVar1); break; case 2: case 7: local_6c = &local_80; local_68 = 3; local_80 = 8; local_58 = 1; local_5c = local_6c; uVar1 = FUN_00752640(&local_6c); local_74 = &local_80; local_70 = 7; uVar1 = FUN_00752640(uVar1); local_64 = &local_80; local_60 = 6; uVar1 = FUN_00752640(uVar1); local_7c = &local_80; local_78 = 5; uVar1 = FUN_00752640(uVar1); local_6c = &local_80; local_68 = 4; FUN_00752640(uVar1); break; case 3: case 5: local_7c = &local_80; local_78 = 2; local_80 = 4; local_60 = 0; local_64 = local_7c; uVar1 = FUN_00752640(&local_7c); local_6c = &local_80; local_68 = 7; uVar1 = FUN_00752640(uVar1); local_5c = &local_80; local_58 = 6; uVar1 = FUN_00752640(uVar1); local_74 = &local_80; local_70 = 5; uVar1 = FUN_00752640(uVar1); local_7c = &local_80; local_78 = 4; FUN_00752640(uVar1); break; case 4: local_7c = &local_80; local_78 = 7; local_80 = 0x80; local_60 = 5; local_64 = local_7c; FUN_00752640(&local_7c); break; case 6: local_7c = &local_80; local_78 = 6; local_80 = 0x40; local_60 = 4; local_64 = local_7c; FUN_00752640(&local_7c); break; case 9: leftX = local_74; upY = roomY; break; case 10: rightX = down1X; up1X = down1X; up1Y = roomY; break; case 0xb: left1X = local_74; left1Y = right1Y; downY = right1Y; break; case 0xc: right1X = down1X; down1Y = right1Y; } if ((*(uint *)(auStack_84 + (param_2 >> 5) * 4 + 4) & 1 << ((byte)param_2 & 0x1f)) == 0) { neighborPos = (int *)(&leftX + param_2 * 2); } else { neighborPos = g_levelGenInvalidPos; } *outPos = (int)*neighborPos; outPos[1] = (int)neighborPos[1]; return outPos; } //@@ 0074c540 Level::GetNeighborRoomIdx /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? computes neighbour room index for door slot, -1 if door not allowed; generate_greed prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Level::GetNeighborRoomIdx(Level *this,int roomIdx,int doorSlot) { undefined4 uVar1; uint uVar2; uint uVar3; uint local_84; uint *local_80; undefined4 local_7c; uint *local_78; undefined4 local_74; uint *local_6c; undefined4 local_68; uint *local_64; undefined4 local_60; uint *local_5c; undefined4 local_58; RoomDescriptor *roomDesc; uint neighborPos [17]; uint local_c; void *roomData; local_c = __security_cookie ^ (uint)&local_84; roomDesc = (RoomDescriptor *)0x0; roomDesc = GetRoomByIdx(this,roomIdx,-1); local_6c = (uint *)0x1; local_64 = roomDesc->Data; if (local_64 == (void *)0x0) { local_80 = (uint *)0x1; local_84 = 1; local_5c = (uint *)(roomIdx % 0xd); } else { roomData = roomDesc->Data; if ((*(uint *)((int)roomData + ((uint)doorSlot >> 5) * 4 + 0x38) & 1 << ((byte)doorSlot & 0x1f)) == 0) { return -1; } local_6c = (uint *)*(undefined4 *)((int)roomData + 0x48); roomIdx = roomDesc->GridIndex; local_5c = (uint *)(roomIdx % 0xd); local_80 = (uint *)(*(byte *)((int)roomData + 0x46) / 0xd); uVar2 = *(byte *)((int)local_64 + 0x47) / 7; local_84 = (*(byte *)((int)local_64 + 0x47) - uVar2 >> 1) + uVar2 >> 2; } neighborPos[1] = roomIdx / 0xd; neighborPos[0] = (int)local_5c - 1U; neighborPos[8] = (int)local_5c - 1U; neighborPos[2] = (uint)local_5c; neighborPos[6] = (uint)local_5c; neighborPos[9] = neighborPos[1] + 1; neighborPos[3] = neighborPos[1] + -1; neighborPos[7] = local_84 + neighborPos[1]; neighborPos[0xf] = local_84 + neighborPos[1]; neighborPos[10] = (int)local_5c + 1; neighborPos[4] = (int)local_80 + (int)local_5c; neighborPos[0xb] = neighborPos[1] + -1; neighborPos[0xd] = neighborPos[1] + 1; neighborPos[0xc] = (int)local_80 + (int)local_5c; neighborPos[0xe] = (int)local_5c + 1; neighborPos[5] = neighborPos[1]; local_84 = 0; switch(local_6c) { case (uint *)0x1: local_80 = &local_84; local_7c = 7; local_84 = 0x80; local_60 = 6; local_64 = local_80; uVar1 = FUN_00752640(&local_80); local_6c = &local_84; local_68 = 5; uVar1 = FUN_00752640(uVar1); local_80 = &local_84; local_7c = 4; FUN_00752640(uVar1); break; case (uint *)0x2: case (uint *)0x7: local_80 = &local_84; local_7c = 3; local_84 = 8; local_60 = 1; local_64 = local_80; uVar1 = FUN_00752640(&local_80); local_6c = &local_84; local_68 = 7; uVar1 = FUN_00752640(uVar1); local_5c = &local_84; local_58 = 6; uVar1 = FUN_00752640(uVar1); local_78 = &local_84; local_74 = 5; uVar1 = FUN_00752640(uVar1); local_80 = &local_84; local_7c = 4; FUN_00752640(uVar1); break; case (uint *)0x3: case (uint *)0x5: local_80 = &local_84; local_74 = 2; local_84 = 4; local_7c = 0; local_78 = local_80; uVar1 = FUN_00752640(&local_78); local_64 = &local_84; local_60 = 7; uVar1 = FUN_00752640(uVar1); local_6c = &local_84; local_68 = 6; uVar1 = FUN_00752640(uVar1); local_5c = &local_84; local_58 = 5; uVar1 = FUN_00752640(uVar1); local_78 = &local_84; local_74 = 4; FUN_00752640(uVar1); break; case (uint *)0x4: local_80 = &local_84; local_74 = 7; local_84 = 0x80; local_7c = 5; local_78 = local_80; FUN_00752640(&local_78); break; case (uint *)0x6: local_80 = &local_84; local_74 = 6; local_84 = 0x40; local_7c = 4; local_78 = local_80; FUN_00752640(&local_78); break; case (uint *)0x9: neighborPos[0] = (uint)local_5c; neighborPos[3] = neighborPos[1]; break; case (uint *)0xa: neighborPos[4] = neighborPos[0xe]; neighborPos[10] = neighborPos[0xe]; neighborPos[0xb] = neighborPos[1]; break; case (uint *)0xb: neighborPos[8] = (uint)local_5c; neighborPos[9] = neighborPos[0xd]; neighborPos[7] = neighborPos[0xd]; break; case (uint *)0xc: neighborPos[0xc] = neighborPos[0xe]; neighborPos[0xf] = neighborPos[0xd]; } uVar2 = 0; uVar3 = 1; do { if (((neighborPos[(uVar2 >> 5) - 0xd] & 1 << ((byte)uVar2 & 0x1f)) != 0) && ((roomDesc->Data == (void *)0x0 || ((*(uint *)((int)roomDesc->Data + (uVar2 >> 5) * 4 + 0x38) & uVar3) == 0)))) { neighborPos[uVar2 * 2] = g_levelGenInvalidPos[0]; neighborPos[uVar2 * 2 + 1] = g_levelGenInvalidPos[1]; } uVar2 = uVar2 + 1; uVar3 = uVar3 << 1 | (uint)((int)uVar3 < 0); } while (uVar2 < 8); uVar2 = neighborPos[doorSlot * 2]; uVar3 = neighborPos[doorSlot * 2 + 1]; if (((((int)uVar2 < 0) || (0xc < (int)uVar2)) || ((int)uVar3 < 0)) || (0xc < (int)uVar3)) { return -2; } if ((uVar2 < 0xd) && (uVar3 < 0xd)) { return uVar3 * 0xd + uVar2; } return -1; } //@@ 0074c9e0 FUN_0074c9e0 undefined4 FUN_0074c9e0(int param_1,int param_2,int *param_3,uint *param_4) { byte bVar1; int idx; RoomDescriptor *pRVar2; Level *in_ECX; int iVar3; uint uVar4; idx = Level::GetNeighborRoomIdx(in_ECX,param_1,param_2); iVar3 = idx % 0xd; if ((((iVar3 < 0) || (0xc < iVar3)) || (0xc < (uint)(idx / 0xd))) || (pRVar2 = Level::GetRoomByIdx(in_ECX,idx,-1), pRVar2->Data == (void *)0x0)) { if (param_3 != (int *)0x0) { *param_3 = -1; } if (param_4 != (uint *)0x0) { *param_4 = 0xffffffff; } return 1; } uVar4 = param_2 + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } if ((((uVar4 == 3) || (uVar4 == 1)) && (pRVar2->GridIndex % 0xd < iVar3)) || (((uVar4 == 0 || (uVar4 == 2)) && (pRVar2->GridIndex / 0xd < idx / 0xd)))) { uVar4 = uVar4 + 4; } if (param_3 != (int *)0x0) { *param_3 = param_2; } if (((((*(uint *)((int)pRVar2->Data + (uVar4 >> 5) * 4 + 0x38) & 1 << ((byte)uVar4 & 0x1f)) != 0) && (pRVar2->ListIndex != in_ECX->_lastBossRoomListIndex)) && (((in_ECX->_stage != 0xb || ((param_2 != 3 || (pRVar2->GridIndex != in_ECX->_startingRoomIndex)))) && ((bVar1 = Level::HasPhotoDoor(in_ECX), bVar1 == 0 || ((param_2 != 3 || (pRVar2->GridIndex != in_ECX->_startingRoomIndex)))))))) || (g_game->_challenge == 0x2c)) { if (param_4 == (uint *)0x0) { return 1; } *param_4 = uVar4; return 1; } if (param_4 != (uint *)0x0) { *param_4 = 0xffffffff; } return 0; } //@@ 0074cb50 Level::get_door_neighbor_room /* DB: ? neighbor room by door; CanSpawnDoorOutline/MakeRedRoomDoor */ LevelGenerator_Room * Level::get_door_neighbor_room(LevelGenerator_Room *param_1,int param_2,int param_3) { bool bVar1; bool bVar2; bool bVar3; byte bVar4; int idx; RoomDescriptor *pRVar5; int idx_00; Level *in_ECX; uint uVar6; uint uVar7; idx = GetNeighborRoomIdx(in_ECX,param_2,param_3); if (idx == -2) { if ((g_game->_challenge != 0x2c) && (bVar4 = IsNextStageAvailable((Level *)g_game), bVar4 != 0)) { uVar7 = 1; goto LAB_0074cd43; } } else { pRVar5 = GetRoomByIdx(in_ECX,idx,-1); if (pRVar5->Data == (void *)0x0) { uVar7 = 0; bVar2 = true; do { if (!bVar2) goto LAB_0074cd41; idx_00 = GetNeighborRoomIdx(in_ECX,idx,uVar7); if (((uint)(idx_00 % 0xd) < 0xd) && ((uint)(idx_00 / 0xd) < 0xd)) { pRVar5 = GetRoomByIdx(in_ECX,idx_00,-1); if (pRVar5->Data == (void *)0x0) goto LAB_0074cce1; uVar6 = uVar7 + 2 & 0x80000003; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffc) + 1; } if (((uVar6 == 3) || (uVar6 == 1)) && (pRVar5->GridIndex % 0xd < idx_00 % 0xd)) { uVar6 = uVar6 + 4; } else if (((uVar6 == 0) || (uVar6 == 2)) && (pRVar5->GridIndex / 0xd < idx_00 / 0xd)) { uVar6 = uVar6 + 4; } if ((((((*(uint *)((int)pRVar5->Data + (uVar6 >> 5) * 4 + 0x38) & 1 << ((byte)uVar6 & 0x1f)) != 0) && (pRVar5->ListIndex != in_ECX->_lastBossRoomListIndex)) && ((in_ECX->_stage != 0xb || ((uVar7 != 3 || (pRVar5->GridIndex != in_ECX->_startingRoomIndex)))))) && ((bVar4 = HasPhotoDoor(in_ECX), bVar4 == 0 || ((uVar7 != 3 || (pRVar5->GridIndex != in_ECX->_startingRoomIndex)))))) || (g_game->_challenge == 0x2c)) goto LAB_0074cce1; bVar1 = false; } else { LAB_0074cce1: bVar1 = true; } uVar7 = uVar7 + 1; bVar3 = false; if (bVar1) { bVar3 = bVar2; } bVar2 = bVar3; } while (uVar7 < 4); if (bVar2) { LevelGenerator_Room::constructor(param_1,idx % 0xd,idx / 0xd,1); return param_1; } } } LAB_0074cd41: uVar7 = 0; LAB_0074cd43: LevelGenerator_Room::constructor(param_1,g_levelGenInvalidPos[0],g_levelGenInvalidPos[1],uVar7); return param_1; } //@@ 0074cd70 Level::CanSpawnDoorOutline /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool Level::CanSpawnDoorOutline(int roomIDX, unsigned int doorSlot); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Level::CanSpawnDoorOutline(Level *this,int roomIDX,uint doorSlot) { RoomDescriptor *pRVar1; int local_5c; undefined1 local_58 [8]; int local_50; int local_4c; int local_48; uint local_c; local_c = __security_cookie ^ (uint)&local_5c; local_5c = roomIDX; pRVar1 = GetRoomByIdx(this,roomIDX,-1); if (((((*(int *)((int)pRVar1->Data + 8) != 5) || (pRVar1->ListIndex != g_game->_lastBossRoomListIdx)) && (-1 < pRVar1->GridIndex)) && ((*(uint *)((int)pRVar1->Data + (doorSlot >> 5) * 4 + 0x38) & 1 << ((byte)doorSlot & 0x1f)) != 0)) && ((8 < doorSlot + 1 || (*(int *)((int)g_game->_room + doorSlot * 4 + 0x724) == 0)))) { get_door_neighbor_room(local_58,local_5c,doorSlot); if ((this->_stage == 0xd) && ((local_50 != 3 || (local_4c != 7)))) { FUN_00738260(); return 0; } if ((0 < local_48) && ((-1 < local_50 || (((uint)pRVar1->Flags >> 10 & 1) != 0)))) { FUN_00738260(); return 1; } FUN_00738260(); } return 0; } //@@ 0074cea0 FUN_0074cea0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ int FUN_0074cea0(void) { code *pcVar1; int iVar2; uint uVar3; uint *in_ECX; uint uVar4; int local_90 [33]; uint local_c; local_c = __security_cookie ^ (uint)local_90; uVar3 = *in_ECX; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *in_ECX; if (uVar3 == 0) { pcVar1 = (code *)swi(3); iVar2 = (*pcVar1)(); return iVar2; } } local_90[0] = 2; local_90[1] = 0xe; local_90[2] = 2; local_90[3] = 0xf; uVar3 = uVar3 >> ((byte)in_ECX[1] & 0x1f) ^ uVar3; local_90[4] = 3; local_90[5] = 7; local_90[6] = 3; local_90[7] = 8; uVar3 = uVar3 << ((byte)in_ECX[2] & 0x1f) ^ uVar3; local_90[8] = 6; local_90[9] = 2; local_90[10] = 4; local_90[0xb] = 4; uVar3 = uVar3 >> ((byte)in_ECX[3] & 0x1f) ^ uVar3; local_90[0xc] = 2; local_90[0xd] = 0x18; local_90[0xe] = 9; local_90[0xf] = 10; *in_ECX = uVar3; uVar3 = uVar3 & 0x1ff; uVar4 = 0; local_90[0x10] = 8; local_90[0x11] = 0xd; local_90[0x12] = 5; local_90[0x13] = 9; local_90[0x14] = 2; local_90[0x15] = 0x14; local_90[0x16] = 2; local_90[0x17] = 0x15; local_90[0x18] = 4; local_90[0x19] = 0xc; local_90[0x1a] = 2; local_90[0x1b] = 0x12; local_90[0x1c] = 2; local_90[0x1d] = 0x13; local_90[0x1e] = 7; local_90[0x1f] = 6; while (iVar2 = uVar4 * 2, local_90[iVar2] <= (int)uVar3) { uVar4 = uVar4 + 1; uVar3 = uVar3 - local_90[iVar2]; if (0xf < uVar4) { return 1; } } iVar2 = local_90[uVar4 * 2 + 1]; if (iVar2 == 0x18) { if (((g_manager->_persistentGameData)._achievements[0x196] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { return 4; } } else if ((iVar2 == 0xf) && (0 < g_game->_devilRoomDeals)) { iVar2 = 0xe; } return iVar2; } //@@ 0074d010 Level::MakeRedRoomDoor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Level:MakeRedRoomDoor prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Level::MakeRedRoomDoor(Level *this,int roomIndex,int doorSlot) { byte bVar1; uint neighborSlot; RoomConfig_Room *data; byte unused; void *extraout_ECX; void *extraout_ECX_00; void *extraout_ECX_01; void *unused_00; RoomDescriptor *pRVar3; Game *game; uint slot; int iVar4; int maxDifficulty; RoomDescriptor **requiredDoors; RoomDescriptor *roomSubtype; RNG rng; RoomDescriptor *sourceRoom; Game *level; int minDifficultyFilter; int maxDifficultyFilter; uint local_6c; RoomDescriptor *subtypeFilter; RoomDescriptor *local_64; RoomDescriptor *local_60; undefined1 neighbor [8]; int neighborX; int neighborY; int isNeighborValid; void *local_2c [6]; uint stackCookie; void *local_10; undefined1 *puStack_c; void *local_8; uint neighborSlot; int *newRoomFlags; RoomConfig *roomConfig; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afe20d; local_10 = ExceptionList; neighborSlot = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; if (roomIndex < -0x13) { roomIndex = -0x14; } iVar4 = 0xa8; if (roomIndex < 0xa8) { iVar4 = roomIndex; } if (0x7fffffff < (uint)doorSlot) { doorSlot = 0xffffffff; } slot = 7; if (doorSlot < 7) { slot = doorSlot; } level = (Game *)this; stackCookie = neighborSlot; sourceRoom = GetRoomByIdx(this,iVar4,-1); get_door_neighbor_room(neighbor,iVar4,slot); game = g_game; local_8 = (void *)0x0; if (isNeighborValid == 0) goto LAB_0074d2ca; pRVar3 = (RoomDescriptor *)0x0; if (neighborX < 0) { bVar1 = IsNextStageAvailable((Level *)g_game); if (bVar1 == 0) goto LAB_0074d2ca; if (7 < slot) { LAB_0074d48f: /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } sourceRoom->_doors[(slot >> 5) - 1] = sourceRoom->_doors[(slot >> 5) - 1] | 1 << ((byte)slot & 0x1f); sourceRoom->_doors[slot] = -2; goto LAB_0074d412; } rng._shift1 = 4; rng._shift2 = 3; rng._seed = (this->_dungeonPlacementSeed + neighborY * 0x3a1) * (neighborX + 1); rng._shift3 = 0x1b; if (this->_stage == 0xd) { local_60 = (RoomDescriptor *)0x0; neighborSlot = RNG::Next(&rng); requiredDoors = &local_60; maxDifficulty = 10; iVar4 = 0xd; pRVar3 = (RoomDescriptor *)&DAT_00000023; roomSubtype = (RoomDescriptor *)&DAT_0000000b; LAB_0074d2a9: data = RoomConfig::GetRandomRoom (&game->_roomConfig,neighborSlot,0,(int)pRVar3,1,iVar4,0,-1,1,maxDifficulty, (uint *)requiredDoors,(uint)roomSubtype,-1); unused_00 = extraout_ECX_01; if (data == (RoomConfig_Room *)0x0) { LAB_0074d2bb: KAGE_LogMessage(1,(byte *)"failed to generate room with red key!\n"); goto LAB_0074d2ca; } } else { iVar4 = FUN_0074cea0(neighborSlot); local_60 = (RoomDescriptor *)Game::GetStageID((Game *)this,unused); if (g_game->_challenge == 0x2c) { neighborSlot = GetRoomStageType(this,neighborY * 0xd + neighborX); local_60 = (RoomDescriptor *)RoomConfig::GetStageID(this->_stage,neighborSlot,-1); } minDifficultyFilter = 1; maxDifficultyFilter = 0xf; local_6c = 0xffffffff; subtypeFilter = (RoomDescriptor *)0xffffffff; if ((iVar4 == 0xf) || (iVar4 == 0xe)) { pRVar3 = (RoomDescriptor *)0x0; local_6c = 99; subtypeFilter = (RoomDescriptor *)0x0; if (iVar4 == 0xe) { bVar1 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xae); if (bVar1 != 0) { pRVar3 = (RoomDescriptor *)0x1; } goto LAB_0074d1e2; } } else if (iVar4 == 0xb) { LAB_0074d1e2: subtypeFilter = pRVar3; } else if (iVar4 == 6) { minDifficultyFilter = 1; maxDifficultyFilter = 1; if (6 < this->_stage) { maxDifficultyFilter = 10; minDifficultyFilter = 10; } } roomConfig = &g_game->_roomConfig; local_64 = (RoomDescriptor *)0xf; neighborSlot = RNG::Next(&rng); data = RoomConfig::GetRandomRoom (roomConfig,neighborSlot,0,(int)local_60,iVar4,1,0,local_6c,minDifficultyFilter, maxDifficultyFilter,(uint *)&local_64,(uint)subtypeFilter,-1); game = g_game; unused_00 = extraout_ECX; if (data == (RoomConfig_Room *)0x0) { if (iVar4 == 1) goto LAB_0074d2bb; local_64 = (RoomDescriptor *)0xf; neighborSlot = RNG::Next(&rng); data = RoomConfig::GetRandomRoom (&game->_roomConfig,neighborSlot,0,0,iVar4,1,0,local_6c,minDifficultyFilter, maxDifficultyFilter,(uint *)&local_64,(uint)subtypeFilter,-1); game = g_game; unused_00 = extraout_ECX_00; if (data == (RoomConfig_Room *)0x0) { local_64 = (RoomDescriptor *)0xf; neighborSlot = RNG::Next(&rng); requiredDoors = &local_64; maxDifficulty = 0xf; iVar4 = 1; pRVar3 = local_60; roomSubtype = subtypeFilter; goto LAB_0074d2a9; } } } bVar1 = place_room(this,neighbor,data,rng._seed,unused_00,(RoomDescriptor **)0x0); if (bVar1 != 0) { iVar4 = this->_roomCount; newRoomFlags = &this->_roomList[iVar4 + -1].Flags; *newRoomFlags = *newRoomFlags | 0x400; pRVar3 = this->_roomList + iVar4 + -1; neighborSlot = 0; do { local_60 = (RoomDescriptor *)GetNeighborRoomIdx(this,pRVar3->GridIndex,neighborSlot); FUN_0074c9e0(pRVar3->GridIndex,neighborSlot,&local_64,&local_6c); neighborSlot = local_6c; if (-1 < (int)local_64) { if ((RoomDescriptor *)0x7 < local_64) goto LAB_0074d48f; pRVar3->_doors[((uint)local_64 >> 5) - 1] = pRVar3->_doors[((uint)local_64 >> 5) - 1] | 1 << ((byte)local_64 & 0x1f); pRVar3->AllowedDoors = pRVar3->AllowedDoors & *(uint *)((int)pRVar3->Data + 0x38); pRVar3->_doors[(int)local_64] = (int)local_60; } if ((-1 < (int)local_6c) && (local_60 = GetRoomByIdx((Level *)level,(int)local_60,-1), local_60->Data != (void *)0x0)) { if (7 < neighborSlot) goto LAB_0074d48f; local_60->_doors[(neighborSlot >> 5) - 1] = local_60->_doors[(neighborSlot >> 5) - 1] | 1 << ((byte)neighborSlot & 0x1f); local_60->AllowedDoors = local_60->AllowedDoors & *(uint *)((int)local_60->Data + 0x38); local_60->_doors[neighborSlot] = pRVar3->GridIndex; } neighborSlot = neighborSlot + 1; this = (Level *)level; } while (neighborSlot < 4); LAB_0074d412: if (sourceRoom == *(RoomDescriptor **)((int)((Game *)this)->_room + 4)) { Room::open_red_room_doors(slot,pRVar3); } Game::UpdateVisibility((Game *)this); FID_conflict__Erase_tree_>_> (local_2c,(fuzzer_allocator_> *)local_2c, *(_Tree_node **)((int)local_2c[0] + 4)); operator_delete(local_2c[0],0x14); ExceptionList = local_10; return 1; } KAGE_LogMessage(1,(byte *)"failed to place room at (%d, %d)\n"); LAB_0074d2ca: FID_conflict__Erase_tree_>_> (local_2c,(fuzzer_allocator_> *)local_2c, *(_Tree_node **)((int)local_2c[0] + 4)); operator_delete(local_2c[0],0x14); ExceptionList = local_10; return 0; } //@@ 0074d4a0 Level::prepare_blue_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? StartRoomTransition: when target room flag 0x40000, builds RoomDescriptor g_roomDescriptorDummy via RoomConfig::GetRandomRoom type 0x1c (ROOM_BLUE), caller sets room idx -0x10 */ undefined4 Level::prepare_blue_room(int param_1,int param_2,int param_3) { code *pcVar1; uint uVar2; RoomDescriptor *pRVar3; undefined4 isPrepared; RoomConfig_Room *roomConfig; Level *in_ECX; int iVar4; RoomDescriptor *blueRoom; RNG rng; uint allowedDoors; int targetRoomIdx; RoomDescriptor freshDesc; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00afe251; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; targetRoomIdx = param_2; if (((param_3 == -1) || (param_1 < 0)) || (local_18 = uVar2, pRVar3 = GetRoomByIdx(in_ECX,param_2,-1), (pRVar3->Flags & 0x40000U) == 0)) { LAB_0074d6f3: isPrepared = 0; } else { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard,uVar2), g_invalidRoomDescriptorGuard == -1 )) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } if ((uint)in_ECX->_currentDimensionIdx < 3) { blueRoom = in_ECX->_roomList + 0x20a; } else { blueRoom = &g_roomDescriptorDummy; } rng._seed = pRVar3->DecorationSeed; iVar4 = blueRoom->ListIndex; rng._shift1 = 5; rng._shift2 = 0x1b; rng._shift3 = 0x1c; pRVar3 = (RoomDescriptor *)RoomDescriptor::constructor(&freshDesc); RoomDescriptor::operator_assign(blueRoom,pRVar3); RoomDescriptor::destructor(&freshDesc); blueRoom->ListIndex = iVar4; blueRoom->GridIndex = -0x10; Seeds::Init3((Seeds *)blueRoom,&rng); if ((param_3 == 0) || (param_3 == 2)) { if (rng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); isPrepared = (*pcVar1)(); return isPrepared; } rng._seed = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; rng._seed = rng._seed << ((byte)rng._shift2 & 0x1f) ^ rng._seed; rng._seed = (uint)rng._seed >> ((byte)rng._shift3 & 0x1f) ^ rng._seed; iVar4 = 7 - (uint)((rng._seed & 3U) != 0); allowedDoors = 5; } else { uVar2 = RNG::RandomInt(&rng,4); allowedDoors = 10; iVar4 = 5 - (uint)(uVar2 != 0); } game = g_game; uVar2 = RNG::Next(&rng); roomConfig = RoomConfig::GetRandomRoom (&game->_roomConfig,uVar2,0,0,0x1c,iVar4,0,-1,1,10,&allowedDoors, 0xffffffff,-1); blueRoom->Data = roomConfig; game = g_game; if (roomConfig == (RoomConfig_Room *)0x0) { uVar2 = RNG::Next(&rng); roomConfig = RoomConfig::GetRandomRoom (&game->_roomConfig,uVar2,0,0,0x1c,0xd,0,-1,1,10,&allowedDoors, 0xffffffff,-1); blueRoom->Data = roomConfig; if (roomConfig == (RoomConfig_Room *)0x0) goto LAB_0074d6f3; } blueRoom->AllowedDoors = allowedDoors; switch(param_3) { case 0: blueRoom->_doors[0] = targetRoomIdx; blueRoom->_doors[2] = param_1; isPrepared = 1; break; case 1: blueRoom->_doors[1] = targetRoomIdx; blueRoom->_doors[3] = param_1; isPrepared = 1; break; case 2: blueRoom->_doors[2] = targetRoomIdx; blueRoom->_doors[0] = param_1; isPrepared = 1; break; case 3: blueRoom->_doors[3] = targetRoomIdx; blueRoom->_doors[1] = param_1; default: isPrepared = 1; } } ExceptionList = local_10; return isPrepared; } //@@ 0074d780 Level::TryInitializeExtraBossRoom /* ZHL [exact] __thiscall bool Level::TryInitializeExtraBossRoom(unsigned int seed); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Level::TryInitializeExtraBossRoom(Level *this,uint seed) { byte bVar1; int bossId; uint seed_00; void *pvVar2; RoomDescriptor *this_00; RNG local_28; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe291; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard, __security_cookie ^ (int)register0x00000010 - 4U); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } this_00 = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { this_00 = this->_roomList + 0x20b; } if (this_00->Data == (void *)0x0) { local_18 = this->_stage; local_14 = this->_stageType; bVar1 = boss_count_adjust(&local_18,&local_14); if (bVar1 != 0) { local_28._seed = seed; local_28._shift3 = 6; local_28._shift1 = 1; local_28._shift2 = 0xb; Seeds::Init3((Seeds *)this_00,&local_28); bossId = BossPool::GetBossId(&g_game->_bossPool,local_18,local_14,(RNG *)&g_game->_bossPool); seed_00 = RNG::Next(&local_28); pvVar2 = pick_boss_room_config(bossId,seed_00); this_00->Data = pvVar2; ExceptionList = local_10; return pvVar2 != (void *)0x0; } } ExceptionList = local_10; return 0; } //@@ 0074d8d0 FUN_0074d8d0 uint FUN_0074d8d0(uint *param_1) { uint uVar1; int in_ECX; uVar1 = param_1[4]; if ((((*(int *)(uVar1 + 8) == 4) && (*(int *)(uVar1 + 0x10) != 0x22)) && (((uVar1 = g_game->_difficulty, uVar1 != 2 && (uVar1 != 3)) || (uVar1 = *param_1, uVar1 == *(uint *)(in_ECX + 0x18370))))) && (param_1[0x10] == 0)) { return CONCAT31((int3)(uVar1 >> 8),1); } return uVar1 & 0xffffff00; } //@@ 0074d920 Level::update_treasure_room_doors_for_trinket /* DB: ? trinket 146 check over treasure rooms, door LoadSprite, from trinket add/remove */ void Level::update_treasure_room_doors_for_trinket(void) { void *pvVar1; GridEntity_Door *pGVar2; uint uVar3; Game *in_ECX; uint uVar4; int iVar5; undefined1 local_44 [8]; void *local_3c; Vector local_38; void *local_30; undefined4 local_2c; Game *local_28; GridEntity_Door *local_24; int *local_20; int local_1c; uint local_18; char local_12; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe2bd; local_10 = ExceptionList; ExceptionList = &local_10; local_28 = in_ECX; local_11 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x92); local_12 = '\0'; local_30 = (void *)0x0; local_2c = 0; local_30 = operator_new(0x14); *(void **)local_30 = local_30; *(void **)((int)local_30 + 4) = local_30; *(void **)((int)local_30 + 8) = local_30; *(undefined2 *)((int)local_30 + 0xc) = 0x101; local_8 = 0; local_18 = 0; if (0 < in_ECX->_nbRooms) { do { pvVar1 = in_ECX->_roomList[local_18].Data; if ((((*(int *)((int)pvVar1 + 8) == 4) && (*(int *)((int)pvVar1 + 0x10) != 0x22)) && (((g_game->_difficulty != 2 && (g_game->_difficulty != 3)) || (in_ECX->_roomList[local_18].GridIndex == in_ECX->_greedModeTreasureRoomIdx)))) && ((in_ECX->_roomList[local_18].VisitedCount == 0 && (uVar3 = in_ECX->_roomList[local_18].Flags, local_11 != ((byte)(uVar3 >> 0xb) & 1))))) { local_12 = '\x01'; uVar4 = uVar3 & 0xfffff7ff; if (local_11 != 0) { uVar4 = uVar3 | 0x800; } in_ECX->_roomList[local_18].Flags = uVar4; std::set::insert(&local_38,&local_18); } local_18 = local_18 + 1; } while ((int)local_18 < in_ECX->_nbRooms); if (local_12 != '\0') { iVar5 = *(int *)((int)in_ECX->_room + 8); if (((iVar5 != 7) && (iVar5 != 8)) && (iVar5 != 0x1d)) { local_18 = 0; local_1c = 0x724; do { iVar5 = local_1c; local_18 = local_18 + 1; if (local_18 < 9) { pGVar2 = *(GridEntity_Door **)(local_1c + (int)in_ECX->_room); local_24 = pGVar2; if (pGVar2 != (GridEntity_Door *)0x0) { if (pGVar2->_targetRoomType == 4) { uVar3 = pGVar2->_targetRoomIdx; if (-1 < (int)uVar3) { if (uVar3 < 0x1fb) { local_20 = in_ECX->_roomMap + uVar3; std::set::find_node(local_44,local_20); if (*(char *)((int)local_3c + 0xd) == '\0') { if (*(int *)((int)local_3c + 0x10) <= *local_20) { if (local_3c != local_30) { uVar3 = Random(); iVar5 = *(int *)((int)g_game->_room + 0xc); local_38.x = (float)(pGVar2->_gridIndex % iVar5) * 40.0 + 40.0; local_38.y = (float)(pGVar2->_gridIndex / iVar5) * 40.0 + 120.0; Game::Spawn(g_game,1000,0xf,&local_38,&g_vectorZero,(Entity *)0x0,0,uVar3) ; GridEntity_Door::LoadSprite(local_24); GridEntity_Door::UpdateAnimation(local_24); in_ECX = local_28; iVar5 = local_1c; } } } } } } } } local_1c = iVar5 + 4; } while (local_1c < 0x744); } Game::UpdateVisibility(in_ECX); } } FID_conflict__Erase_tree_>_> (&local_30,(fuzzer_allocator_> *)&local_30, *(_Tree_node **)((int)local_30 + 4)); operator_delete(local_30,0x14); ExceptionList = local_10; return; } //@@ 0074dbd0 Game::GetPlanetariumChance /* ZHL [exact] __thiscall float Game::GetPlanetariumChance(); prototype: REPENTOGON, confirmed by RET 0 */ float __thiscall Game::GetPlanetariumChance(Game *this) { 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 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x98); if (owner == (Entity_Player *)0x0) { LAB_0074dc38: bVar1 = false; isTelescopeLens = false; if (owner != (Entity_Player *)0x0) goto LAB_0074dc3e; LAB_0074dc52: isGoldenLens = '\0'; if (owner != (Entity_Player *)0x0) goto LAB_0074dc58; LAB_0074dc6e: isMomsBox = '\0'; } else { isHeld = Entity_Player::HasTrinket(owner,0x98,0); if (isHeld == 0) goto LAB_0074dc38; isTelescopeLens = true; LAB_0074dc3e: bVar1 = isTelescopeLens; isHeld = Entity_Player::HasGoldenTrinket(owner,0x98); if (isHeld == 0) goto LAB_0074dc52; isGoldenLens = '\x01'; LAB_0074dc58: isHeld = Entity_Player::HasCollectible(owner,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::find_node(local_20,&treasureRoomType); if (((*(char *)((int)roomsetNode + 0xd) != '\0') || (4 < *(int *)((int)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,(RNG **)&game->_playerManager,1); game = g_game; if (owner != (Entity_Player *)0x0) { chance = chance + 1.0; } } } owner = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0xc2,(RNG **)&game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = chance + 0.15; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x9e,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = chance + 0.15; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x29d,(RNG **)&g_game->_playerManager,1); if (owner != (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 Game::generate_home_level /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: this=Game (_generationRNG 0x182d4); fixed 6-room layout via LevelGenerator::CreateRoom then RoomConfig::GetRandomRoom(stage 0x23=Home, types 1/5/4/5/1/2) and GetRoomByStageTypeAndVariant(0x23,0x10,0x29a) */ void __thiscall Game::generate_home_level(Game *this) { 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 ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; seed = (this->_generationRNG)._seed; rng = &this->_generationRNG; if (seed == 0) { KAGE_LogMessage(0x10,(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; RoomDescriptor::Init(generator,seed); local_8 = 0; if ((uint)((local_40 - local_48[0]) / 0x48) < 6) { vector_LevelGenerator_Room_reserve(local_48,6); } pvVar2 = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,6,1,-1,-1,-1); bossSlotA = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,7,4,6,7,3); treasureSlot = LevelGenerator::CreateRoom((LevelGenerator *)generator,5,8,4,5,8,0); bossSlotB = LevelGenerator::CreateRoom((LevelGenerator *)generator,4,7,4,4,8,0); defaultSlot = LevelGenerator::CreateRoom((LevelGenerator *)generator,4,6,1,4,6,1); local_3b4 = LevelGenerator::CreateRoom((LevelGenerator *)generator,7,7,2,7,7,2); seed = rng->_seed; roomConfig = &g_game->_roomConfig; local_3b0 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b0,0,-1); seed = rng->_seed; local_3b0 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b0,1,-1); seed = rng->_seed; local_3b0 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b0,3,-1); seed = rng->_seed; local_3b0 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b0,1,-1); seed = rng->_seed; local_3b0 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b0,2,-1); seed = rng->_seed; local_3b0 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(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,(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; Level::place_room((Level *)this,pvVar2,pRVar3,seed,unused,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(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; Level::place_room((Level *)this,bossSlotA,bossRoomA,seed,pvVar2,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(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; Level::place_room((Level *)this,treasureSlot,treasureRoom,seed,pvVar2,(RoomDescriptor **)0x0); this->_lastBossRoomListIdx = this->_nbRooms + -1; seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(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; Level::place_room((Level *)this,bossSlotB,bossRoomB,seed,pvVar2,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(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; Level::place_room((Level *)this,defaultSlot,defaultRoom,seed,pvVar2,(RoomDescriptor **)0x0); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(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; Level::place_room((Level *)this,local_3b4,local_3b0,seed,pvVar2,(RoomDescriptor **)0x0); pvVar2 = ThreadLocalStoragePointer; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x1fc; } Seeds::Init3((Seeds *)specialRoomDesc,rng); seed = rng->_seed; local_3b4 = (void *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b4,0xffffffff,-1); iVar4 = *(int *)pvVar2; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x1fc; } specialRoomDesc->Data = local_3b0; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x200; } Seeds::Init3((Seeds *)specialRoomDesc,rng); seed = rng->_seed; local_3b4 = (void *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b4,0xffffffff,-1); iVar4 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x200; } specialRoomDesc->Data = local_3b0; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x1fe; } Seeds::Init3((Seeds *)specialRoomDesc,rng); seed = rng->_seed; local_3b4 = (void *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(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,(uint *)&local_3b4,0xffffffff,-1); iVar4 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x1fe; } specialRoomDesc->Data = local_3b0; if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } specialRoomDesc = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { specialRoomDesc = this->_roomList + 0x204; } Seeds::Init3((Seeds *)specialRoomDesc,rng); pRVar3 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0x23,0x10,0x29a,-1); if ((*(int *)(iVar4 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8 = CONCAT31(local_8._1_3_,8); RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } if ((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; } //@@ 0074e9b0 Level::IsMausoleumHeartStage /* DB: ? effective stage 6 (labyrinth adj) alt path + GameStateFlag 0x2e prototype: db/protos.zhl */ byte __thiscall Level::IsMausoleumHeartStage(Level *this) { int iVar1; uint uVar2; uint uVar3; Game *this_00; byte bVar4; uint uVar5; uint uVar6; int iVar7; this_00 = g_game; if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((iVar1 = this->_stage, 5 < iVar1 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { uVar2 = g_game->_debugCurses; uVar3 = this->_curses; uVar5 = Seeds::GetForcedCurses(); uVar6 = Seeds::GetPreventedCurses(); iVar7 = iVar1 + 1; if ((~uVar6 & (uVar5 | uVar2 | uVar3) & 2) == 0) { iVar7 = iVar1; } if ((iVar7 == 6) && ((this->_stageType == 4 || (this->_stageType == 5)))) { bVar4 = Game::GetStateFlag(this_00,0x2e); if (bVar4 != 0) { return 1; } } } return 0; } //@@ 0074ea50 Level::IsPreAscent /* ZHL [lua] Lua binding Level:IsPreAscent prototype: db/protos.zhl, confirmed by RET 0 */ byte __thiscall Level::IsPreAscent(Level *this) { int iVar1; uint uVar2; uint uVar3; Game *this_00; byte bVar4; uint uVar5; uint uVar6; int iVar7; this_00 = g_game; if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((iVar1 = this->_stage, 5 < iVar1 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { uVar2 = g_game->_debugCurses; uVar3 = this->_curses; uVar5 = Seeds::GetForcedCurses(); uVar6 = Seeds::GetPreventedCurses(); iVar7 = iVar1 + 1; if ((~uVar6 & (uVar5 | uVar2 | uVar3) & 2) == 0) { iVar7 = iVar1; } if ((iVar7 == 6) && ((this->_stageType == 4 || (this->_stageType == 5)))) { bVar4 = Game::GetStateFlag(this_00,0x2f); if (bVar4 != 0) { return 1; } } } return 0; } //@@ 0074eaf0 Level::raise_mineshaft_rail /* WARNING: Removing unreachable block (ram,0x0074ef29) */ /* WARNING: Removing unreachable block (ram,0x0074ef3b) */ /* WARNING: Removing unreachable block (ram,0x0074ef4b) */ /* WARNING: Removing unreachable block (ram,0x0074ef51) */ /* DB: rail plate (PressurePlate::Reward variant 3): raises the mineshaft entrance's next button rail, HasAbandonedMineshaft only (room-features) prototype: db/protos.zhl */ void __thiscall Level::raise_mineshaft_rail(Level *railPit) { byte bVar1; RoomDescriptor *currentRoom; uint uVar2; void *pvVar3; short *spawnEntry; int iVar4; void **roomEntry; undefined4 *savedGridEntity; int *piVar5; float fVar6; int *local_48; undefined1 local_40 [12]; Level *local_34; uint local_30; int railGridIdx; int *local_28; int roomOrdinal; int raisedRailCount; int currentRoomOrdinal; int roomIdx; RoomDescriptor *mineshaftRoom; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; GridEntity_Pit *railPit; local_8 = 0xffffffff; puStack_c = &LAB_00afe38d; local_10 = ExceptionList; ExceptionList = &local_10; local_34 = railPit; bVar1 = HasAbandonedMineshaft(railPit); if (bVar1 != 0) { roomOrdinal = 0; piVar5 = (int *)0x0; currentRoomOrdinal = -1; local_48 = (int *)0x0; local_28 = (int *)0x0; local_8 = 0; mineshaftRoom = (RoomDescriptor *)0x0; raisedRailCount = 0; roomIdx = 0; if (0 < railPit->_roomCount) { roomEntry = &railPit->_roomList[0].Data; do { if ((roomEntry[-1] == (void *)0x0) && (*(int *)((int)*roomEntry + 8) == 1)) { currentRoom = GetRoomByIdx(railPit,railPit->_currentRoomIndex,railPit->_currentDimensionIdx); pvVar3 = *roomEntry; if ((RoomDescriptor *)(roomEntry + -4) == currentRoom) { currentRoomOrdinal = roomOrdinal; } if (*(int *)((int)pvVar3 + 0x10) == 10) { roomOrdinal = roomOrdinal + 1; if (mineshaftRoom == (RoomDescriptor *)0x0) { local_30 = 0; mineshaftRoom = (RoomDescriptor *)(roomEntry + -4); if (*(short *)((int)pvVar3 + 0x44) != 0) { iVar4 = 0; do { spawnEntry = (short *)(*(int *)((int)pvVar3 + 0x40) + iVar4); if (((char)spawnEntry[4] != '\0') && (**(int **)(spawnEntry + 2) == 0xbba)) { railGridIdx = *spawnEntry + 1 + (*(byte *)((int)pvVar3 + 0x46) + 2) * (spawnEntry[1] + 1); if (piVar5 == local_28) { std::vector::_Emplace_reallocate(piVar5,&railGridIdx); local_28 = (int *)0x0; } else { *piVar5 = railGridIdx; local_48 = piVar5 + 1; } piVar5 = local_48; if ((*(int *)((int)((std_vector *)(roomEntry + 0x16))->_begin + railGridIdx * 0x20) == 7) && (*(int *)((int)((std_vector *)(roomEntry + 0x16))->_begin + railGridIdx * 0x20 + 8) != 0)) { raisedRailCount = raisedRailCount + 1; } } pvVar3 = *roomEntry; iVar4 = iVar4 + 0x10; local_30 = local_30 + 1; } while (local_30 < *(ushort *)((int)pvVar3 + 0x44)); railPit = local_34; } } } else if (*(int *)((int)pvVar3 + 0x10) == 1) { roomOrdinal = roomOrdinal + 1; } } roomIdx = roomIdx + 1; roomEntry = roomEntry + 0x2e; } while (roomIdx < railPit->_roomCount); if (((mineshaftRoom != (RoomDescriptor *)0x0) && (-1 < currentRoomOrdinal)) && (currentRoomOrdinal < (int)piVar5 >> 2)) { fVar6 = *(float *)(currentRoomOrdinal * 4); local_34 = (Level *)fVar6; currentRoom = GetRoomByIdx(railPit,railPit->_currentRoomIndex,railPit->_currentDimensionIdx); if (mineshaftRoom == currentRoom) { if (0x1bf < (uint)fVar6) { ExceptionList = local_10; return; } railPit = *(GridEntity_Pit **)((int)railPit->_room + (int)fVar6 * 4 + 0x24); if (railPit == (GridEntity_Pit *)0x0) { ExceptionList = local_10; return; } if ((railPit->_desc)._type != 7) { ExceptionList = local_10; return; } if ((railPit->_desc)._state == 0) { (railPit->_desc)._state = 2; GridEntity_Pit::UpdateCollision(railPit); } game = g_game; (railPit->_desc)._variant = (railPit->_desc)._variant & 0xffff01ffU | 0x100; *(undefined1 *)((int)game->_room + (int)local_34 + 0x746cU) = 1; Game::ShakeScreen(game,0x14); manager = g_manager; local_30 = 0x254; seed_fart_sound_override((int *)&local_30); fVar6 = 0.0; uVar2 = local_30; } else { if ((int)fVar6 < 0) { ExceptionList = local_10; return; } pvVar3 = (mineshaftRoom->SavedGridEntities)._begin; if ((int)(mineshaftRoom->SavedGridEntities)._end - (int)pvVar3 >> 5 <= (int)fVar6) { ExceptionList = local_10; return; } savedGridEntity = (undefined4 *)((int)fVar6 * 0x20 + (int)pvVar3); *savedGridEntity = 7; savedGridEntity[2] = 2; savedGridEntity[1] = 0x100; *(undefined1 *)(savedGridEntity + 6) = 0; savedGridEntity[3] = 0; currentRoom = GetRoomByIdx(railPit,railPit->_currentRoomIndex,railPit->_currentDimensionIdx); local_40._4_4_ = 2; local_40._8_4_ = 0xf; local_40._0_4_ = currentRoom->SpawnSeed; local_34 = (Level *)0x19; uVar2 = RNG::Next((RNG *)local_40); savedGridEntity[4] = uVar2; currentRoom = GetRoomByIdx(railPit,railPit->_currentRoomIndex,railPit->_currentDimensionIdx); local_40._4_4_ = 2; local_40._8_4_ = 0x15; local_40._0_4_ = currentRoom->SpawnSeed; local_34 = (Level *)0x9; uVar2 = RNG::Next((RNG *)local_40); game = g_game; savedGridEntity[7] = uVar2; savedGridEntity[5] = 0; Game::ShakeScreen(game,0x14); iVar4 = g_game->_currentRoomIdx; local_34 = (Level *)mineshaftRoom->GridIndex; fVar6 = 0.0; if (-1 < iVar4) { local_40._8_4_ = (float)(((iVar4 / 0xd - (int)local_34 / 0xd) * 0xd - iVar4) + (int)local_34); local_34 = (Level *)(float)((int)local_34 / 0xd - iVar4 / 0xd); Vector::Normalize((Vector *)(local_40 + 8)); fVar6 = (float)local_40._8_4_; } uVar2 = 0x255; manager = g_manager; } iVar4 = 0x3f800000; SoundEffects::Play(&manager->_sfxManager,uVar2,1.5,2,0,1.0,fVar6); if (raisedRailCount + 1 == (int)piVar5 >> 2) { Music::PlayJingle((Music *)&g_manager->_musicManager,0x55,iVar4,SUB41(fVar6,0)); } } } } ExceptionList = local_10; return; } //@@ 0074ef70 Level::HasMirrorDimension /* ZHL [exact] __thiscall bool Level::HasMirrorDimension(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Level::HasMirrorDimension(Level *this) { int iVar1; uint uVar2; if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((iVar1 = this->_stage, 5 < iVar1 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0))) ) && ((this->_stageType == 4 || (this->_stageType == 5)))) { if (iVar1 == 2) { return 1; } if ((iVar1 == 1) && (uVar2 = GetCurses(this), (uVar2 & 2) != 0)) { return 1; } } return 0; } //@@ 0074efd0 Level::HasAbandonedMineshaft /* ZHL [exact] __thiscall bool Level::HasAbandonedMineshaft(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Level::HasAbandonedMineshaft(Level *this) { int iVar1; uint uVar2; if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((iVar1 = this->_stage, 5 < iVar1 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0))) ) && ((this->_stageType == 4 || (this->_stageType == 5)))) { if (iVar1 == 4) { return 1; } if ((iVar1 == 3) && (uVar2 = GetCurses(this), (uVar2 & 2) != 0)) { return 1; } } return 0; } //@@ 0074f030 Level::HasPhotoDoor /* ZHL [exact] __thiscall bool Level::HasPhotoDoor(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Level::HasPhotoDoor(Level *this) { int iVar1; uint uVar2; if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((iVar1 = this->_stage, 5 < iVar1 - 1U || ((g_game->_gameStateFlags & 0x1000000000000) == 0))) ) && ((this->_stageType != 4 && (this->_stageType != 5)))) { if (iVar1 == 6) { return 1; } if ((iVar1 == 5) && (uVar2 = GetCurses(this), (uVar2 & 2) != 0)) { return 1; } } return 0; } //@@ 0074f090 Level::IsAscent /* ZHL [lua] Lua binding Level:IsAscent prototype: db/protos.zhl */ byte __thiscall Level::IsAscent(Level *this) { if ((this->_stage - 1U < 6) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { return 1; } return 0; } //@@ 0074f0c0 Level::generate_mirror_world /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: copies dimension 0's rooms into dimension 1, the treasure room as subtype 34 (alt_path.md) */ void __thiscall Level::generate_mirror_world(Level *this) { code *pcVar1; uint uVar2; int *srcDecorationSeed; uint in_stack_ffffff48; int in_stack_ffffff4c; int roomsLeft; void *local_64; undefined1 slot [8]; int gridX; int gridY; undefined4 local_4c; void *local_48; int local_44; uint local_40; undefined4 local_3c; undefined4 local_38; int local_34; int local_30; void *local_2c; undefined4 local_28; undefined1 local_20; undefined4 local_1c; undefined1 local_18; uint securityCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isTreasureReplaced; RoomConfig *roomConfig; int roomShape; void *srcRoomData; local_8 = 0xffffffff; puStack_c = &LAB_00afe3bd; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(slot + 0x58); ExceptionList = &local_10; this->_currentDimensionIdx = 1; this->_currentRoomMap = this->_roomMap + 0xa9; roomsLeft = this->_roomCount; isTreasureReplaced = false; if (roomsLeft != 0) { srcDecorationSeed = &this->_roomList[0].DecorationSeed; do { srcRoomData = (void *)srcDecorationSeed[-0x12]; local_64 = srcRoomData; if ((*(int *)((int)srcRoomData + 8) == 4) && (!isTreasureReplaced)) { roomConfig = &g_game->_roomConfig; roomShape = *(int *)((int)srcRoomData + 0x48); if (g_game->_challenge == 0x2c) { uVar2 = GetRoomStageType(this,this->_currentRoomIndex); LAB_0074f17b: local_64 = (void *)RoomConfig::GetStageID(this->_stage,uVar2,-1); } else { if (this->_currentDimensionIdx != 2) { uVar2 = this->_stageType; goto LAB_0074f17b; } local_64 = (void *)0x23; } uVar2 = srcDecorationSeed[1]; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar2 = uVar2 >> 2 ^ uVar2; uVar2 = uVar2 << 7 ^ uVar2; local_64 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar2 >> 7 ^ uVar2,0,(int)local_64,0x1b,4,roomShape, in_stack_ffffff48,in_stack_ffffff4c,1,10, (uint *)((int)srcRoomData + 0x38),0x22,7); isTreasureReplaced = true; } gridY = ((RoomDescriptor *)(srcDecorationSeed + -0x16))->GridIndex / 0xd; gridX = ((RoomDescriptor *)(srcDecorationSeed + -0x16))->GridIndex % 0xd; roomShape = *(int *)((int)local_64 + 0x48); local_34 = g_levelGenInvalidPos[0]; slot[0] = 1; local_4c = 0; local_48 = (void *)0x0; local_40 = 0; local_3c = 0xffffffff; local_38 = 0xffffffff; local_30 = g_levelGenInvalidPos[1]; local_2c = (void *)0x0; local_28 = 0; local_44 = roomShape; local_2c = operator_new(0x14); *(void **)local_2c = local_2c; *(void **)((int)local_2c + 4) = local_2c; *(void **)((int)local_2c + 8) = local_2c; *(undefined2 *)((int)local_2c + 0xc) = 0x101; local_48 = *(void **)(&DAT_00c5d37c + roomShape * 8); local_4c = *(undefined4 *)(&DAT_00c5d378 + roomShape * 8); local_20 = 0; local_1c = 0; local_18 = 0; local_8 = 0; local_40 = srcDecorationSeed[-0x10]; in_stack_ffffff4c = 0x74f2bf; place_room(this,slot,local_64,*srcDecorationSeed,local_48,(RoomDescriptor **)0x0); this->_roomList[this->_roomCount + -1].DecorationSeed = *srcDecorationSeed; if ((*(int *)((int)local_64 + 8) == 1) && (*(int *)((int)local_64 + 0x10) == 0x22)) { this->_roomList[this->_roomCount + -1].SpawnSeed = srcDecorationSeed[1]; } local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (&local_2c,(fuzzer_allocator_> *)&local_2c, *(_Tree_node **)((int)local_2c + 4)); operator_delete(local_2c,0x14); srcDecorationSeed = srcDecorationSeed + 0x2e; roomsLeft = roomsLeft + -1; } while (roomsLeft != 0); } this->_currentDimensionIdx = 0; this->_currentRoomMap = this->_roomMap; ExceptionList = local_10; return; } //@@ 0074f360 Level::generate_mineshaft /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dimension 1's eight fixed mineshaft rooms (subtypes 11, 30, 20) (alt_path.md) */ void __thiscall Level::generate_mineshaft(Level *this) { int roomShape; int mode; void *unused; void *slot; uint stage; uint uVar1; RoomConfig *roomConfig; uint roomSeed; void *pvVar2; uint roomSeed; uint minVariant; int maxVariant; RoomDescriptor generator [4]; int local_68 [2]; int local_60; undefined1 local_5c [12]; undefined1 local_50 [28]; void *genRooms [8]; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; code *breakTrap; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afe400; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(genRooms + 0xc); ExceptionList = &local_10; this->_currentDimensionIdx = 1; this->_currentRoomMap = this->_roomMap + 0xa9; stage = RoomConfig::GetStageID(this->_stage,this->_stageType,-1); uVar1 = (this->_generationRNG)._seed; if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar1 = (this->_generationRNG)._seed; if (uVar1 == 0) { breakTrap = (code *)swi(3); (*breakTrap)(); return; } } uVar1 = uVar1 >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ uVar1; uVar1 = uVar1 << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ uVar1; uVar1 = uVar1 >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ uVar1; (this->_generationRNG)._seed = uVar1; RoomDescriptor::Init(generator,uVar1); local_8 = (void *)0x0; if ((uint)((local_60 - local_68[0]) / 0x48) < 8) { vector_LevelGenerator_Room_reserve(local_68,8); } roomConfig = &g_game->_roomConfig; genRooms[0] = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,0xc,1,-1,-1,-1); genRooms[1] = LevelGenerator::CreateRoom((LevelGenerator *)generator,6,10,5,-1,-1,-1); genRooms[2] = LevelGenerator::CreateRoom((LevelGenerator *)generator,5,8,8,-1,-1,-1); genRooms[3] = LevelGenerator::CreateRoom((LevelGenerator *)generator,5,7,1,-1,-1,-1); genRooms[4] = LevelGenerator::CreateRoom((LevelGenerator *)generator,5,5,8,-1,-1,-1); genRooms[5] = LevelGenerator::CreateRoom((LevelGenerator *)generator,7,5,7,-1,-1,-1); genRooms[6] = LevelGenerator::CreateRoom((LevelGenerator *)generator,9,5,1,-1,-1,-1); maxVariant = 9; minVariant = 0x74f51f; genRooms[7] = LevelGenerator::CreateRoom((LevelGenerator *)generator,9,4,1,-1,-1,-1); uVar1 = 0; do { if (uVar1 == 0) { roomSeed = 0xb; } else { roomSeed = 0x1e; if (uVar1 == 7) { roomSeed = 0x14; } } pvVar2 = genRooms[uVar1]; roomSeed = (this->_generationRNG)._seed; roomShape = *(int *)((int)pvVar2 + 0x18); if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { breakTrap = (code *)swi(3); (*breakTrap)(); return; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; mode = (this->_generationRNG)._shift3; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)mode & 0x1f) ^ roomSeed; (this->_generationRNG)._seed = roomSeed; pvVar2 = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,roomSeed,1,stage,0x1d,1,roomShape,minVariant,maxVariant,0,0, (uint *)((int)pvVar2 + 0x1c),roomSeed,mode); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); roomSeed = (this->_generationRNG)._seed; if (roomSeed == 0) { breakTrap = (code *)swi(3); (*breakTrap)(); return; } } roomSeed = roomSeed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ roomSeed; unused = (void *)(this->_generationRNG)._shift3; roomSeed = roomSeed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ roomSeed; roomSeed = roomSeed >> ((byte)unused & 0x1f) ^ roomSeed; slot = genRooms[uVar1]; (this->_generationRNG)._seed = roomSeed; maxVariant = 0x74f62c; place_room(this,slot,pvVar2,roomSeed,unused,(RoomDescriptor **)0x0); uVar1 = uVar1 + 1; } while (uVar1 < 8); this->_currentDimensionIdx = 0; this->_currentRoomMap = this->_roomMap; FID_conflict__Tidy(local_50); FID_conflict__Tidy(local_5c); vector_LevelGenerator_Room_tidy(local_68); ExceptionList = local_10; return; } //@@ 0074f690 Level::GetRoomStageType /* DB: ? per-room stage type lookup tables; returns _stageType by default; challenge 0x2c path prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall Level::GetRoomStageType(Level *this,int roomIdx) { int iVar1; RoomDescriptor *pRVar2; int iVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; float fVar8; float fVar9; if (g_game->_challenge == 0x2c) { if (roomIdx == -10) { if (this->_stage == 7) { return 4; } } else if (-1 < roomIdx) { if (((char)this[1]._stage == '\0') && (pRVar2 = GetRoomByIdx(this,roomIdx,-1), pRVar2->Data != (void *)0x0)) { iVar3 = pRVar2->GridIndex; if (iVar3 < 1) { iVar3 = 0; } roomIdx = 0xa8; if (iVar3 < 0xa8) { roomIdx = iVar3; } } iVar3 = this->_stage; if (iVar3 < 7) { fVar8 = (float)this[1]._roomList[0]._doors[roomIdx + -8] * 5.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (4.999 <= fVar8) { fVar8 = 4.999; } fVar9 = (float)this[1]._roomMap[roomIdx + -0x5e0a] * 5.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (4.999 <= fVar9) { fVar9 = 4.999; } return *(int *)(&DAT_00b6a878 + ((int)fVar8 * 5 + (int)fVar9) * 4); } if ((iVar3 == 7) || (iVar3 == 8)) { iVar3 = this->_roomList[this->_lastBossRoomListIndex].GridIndex; iVar1 = iVar3 / 0xd; uVar7 = iVar1 - roomIdx / 0xd; uVar4 = ((roomIdx / 0xd - iVar1) * 0xd - roomIdx) + iVar3; uVar5 = (int)uVar4 >> 0x1f; uVar6 = (int)uVar7 >> 0x1f; if ((int)(((uVar4 ^ uVar5) - uVar5) + ((uVar7 ^ uVar6) - uVar6)) < 4) { return 4; } fVar8 = (float)this[1]._roomList[0]._doors[roomIdx + -8] * 5.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (4.999 <= fVar8) { fVar8 = 4.999; } fVar9 = (float)this[1]._roomMap[roomIdx + -0x5e0a] * 5.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (4.999 <= fVar9) { fVar9 = 4.999; } return *(int *)(&DAT_00b6a8e0 + ((int)fVar8 * 5 + (int)fVar9) * 4); } } } return this->_stageType; } //@@ 0074f820 Level::InitStageSeeds /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? requires Game Start Seed; stage seed table 0x1bb9c; Init/RestoreGameState */ void Level::InitStageSeeds(void) { uint *in_ECX; uint row2Base; uint row4Base; int iVar1; uint uVar2; int iVar3; uint uVar4; uint col2Base; float fVar5; float fVar6; float octave2; uint *noiseMaps [2]; uint local_2d8; undefined4 local_2d4; uint mapIndex; int gridToMapOffset; float *cellDst; undefined4 local_2c4; float *columnDst; uint row; uint col4Base; float noiseGrid [171]; float local_8; code *breakTrap; Game *game; bool isAltPath; float noiseNorm; game = g_game; local_8 = (float)(__security_cookie ^ (uint)(noiseGrid + 0xac)); if ((in_ECX[1] == 4) || (in_ECX[1] == 5)) { isAltPath = true; } else { isAltPath = false; } uVar4 = *in_ECX + 1; if (!isAltPath) { uVar4 = *in_ECX; } if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } if (uVar4 == 0) { uVar4 = 0; } else if (0xc < uVar4) { uVar4 = 0xd; } uVar4 = (game->_seedEffects)._stageSeeds[uVar4]; local_2d4 = 0xf; if (DAT_00c7f47c == 0.0) { DAT_00c7f47c = 1.0 / (DAT_00c7f47c + 1.0 + 2.0 + 4.0); } noiseMaps[0] = in_ECX + 0x60ec; noiseMaps[1] = in_ECX + 0x6195; mapIndex = 0; local_2c4 = 0xd; do { noiseNorm = DAT_00c7f47c; columnDst = (float *)noiseMaps[mapIndex]; uVar2 = 0; do { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar4 = uVar4 >> 2 ^ uVar4; uVar4 = uVar4 << 5 ^ uVar4; uVar4 = uVar4 >> 0xf ^ uVar4; noiseGrid[uVar2] = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10; uVar2 = uVar2 + 1; } while (uVar2 < 0xa9); uVar2 = 0; gridToMapOffset = (int)noiseGrid - (int)columnDst; do { col2Base = uVar2 & 0xfffffffe; row = 0; col4Base = uVar2 & 0xfffffffc; cellDst = columnDst; do { row2Base = row & 0xfffffffe; fVar6 = (float)(int)(uVar2 - col2Base) * 0.5; iVar3 = ((int)(row2Base + 2) % 0xd) * 0xd; iVar1 = (int)(col2Base + 2) % 0xd; fVar5 = (float)(int)(row - row2Base) * 0.5; row4Base = row & 0xfffffffc; octave2 = (fVar6 * noiseGrid[iVar1 + row2Base * 0xd] + (1.0 - fVar6) * noiseGrid[row2Base * 0xd + col2Base]) * (1.0 - fVar5) + (fVar6 * noiseGrid[iVar1 + iVar3] + (1.0 - fVar6) * noiseGrid[iVar3 + col2Base]) * fVar5; iVar3 = ((int)(row4Base + 4) % 0xd) * 0xd; iVar1 = (int)(col4Base + 4) % 0xd; fVar6 = (float)(int)(uVar2 - col4Base) * 0.25; fVar5 = (float)(int)(row - row4Base) * 0.25; row = row + 1; *cellDst = noiseNorm * (((fVar6 * noiseGrid[iVar1 + row4Base * 0xd] + (1.0 - fVar6) * noiseGrid[col4Base + row4Base * 0xd]) * (1.0 - fVar5) + ((1.0 - fVar6) * noiseGrid[col4Base + iVar3] + fVar6 * noiseGrid[iVar1 + iVar3]) * fVar5) * 4.0 + octave2 + octave2 + *(float *)((int)cellDst + gridToMapOffset) + 0.0); cellDst = cellDst + 0xd; } while ((int)row < 0xd); uVar2 = uVar2 + 1; columnDst = columnDst + 1; } while ((int)uVar2 < 0xd); mapIndex = mapIndex + 1; local_2d8 = uVar4; } while (mapIndex < 2); return; } //@@ 0074fbe0 Level::try_place_random_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? bool; only caller 007508c0 Level::generate_random_layout it until true: picks shape/type (skips types 2/7/3/5), bitset<13> checks, BossPool::GetBossId for boss rooms, uses the mod manager room list (manager+0x2a410) size >= 0x70 */ undefined4 Level::try_place_random_room(int param_1) { int roomShape; code *pcVar1; Game *pGVar2; byte bVar3; uint uVar4; undefined4 uVar5; uint stageId; LevelGenerator_Room *room; undefined3 extraout_var; Game *pGVar6; RoomConfig_Room *data; Level *in_ECX; int iVar7; RNG *rng; void *pvVar8; undefined4 extraout_ECX; undefined4 extraout_ECX_00; void *unused; undefined4 extraout_ECX_01; uint uVar9; undefined4 *puVar10; int *piVar11; Entity_Player *player; undefined4 *copyDst; void *pvVar12; uint in_stack_fffffb44; int in_stack_fffffb48; int neighborX; int neighborY; int local_47c; undefined4 *local_478; void *allRooms; int *allRoomsEnd; int allRoomsCapacity; uint gridCol; Game *gridRow; uint local_460; Level *self; RoomConfig *roomConfig; uint local_454; int step; void *local_44c; Game *local_448; char isCheckBackupPlayer; RoomDescriptor generator [3]; undefined4 local_188 [43]; undefined1 local_dc [12]; undefined1 local_d0 [12]; undefined1 local_c4 [23]; char local_ad; LevelGenerator_Room generatorRoom [12]; void *local_78 [6]; LevelGenerator_Room generateParams; int local_5c; undefined4 local_58; int local_54; undefined4 local_50; int local_4c; int local_48; int local_44; int local_40; void *local_3c; void *local_38; int local_34; void *doorSet; undefined4 local_2c; int local_28; undefined1 local_24; int local_20; undefined1 local_1c; uint stackCookie; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afe469; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_78 + 0x1d); ExceptionList = &local_10; roomConfig = &g_game->_roomConfig; local_47c = param_1; piVar11 = in_ECX->_roomMap; for (iVar7 = 0x1fb; iVar7 != 0; iVar7 = iVar7 + -1) { *piVar11 = -1; piVar11 = piVar11 + 1; } local_478 = (undefined4 *)(param_1 + 0x2b8); in_ECX->_roomCount = 0; self = in_ECX; stackCookie = uVar4; memset(local_478,0,0xa9); local_460 = 0; uVar9 = 0; do { if ((((uVar9 != 2) && (uVar9 != 7)) && (uVar9 != 3)) && (uVar9 != 5)) { if (0xc < uVar9) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(uVar4); } generator[0]._doors[(uVar9 >> 5) - 0xf] = generator[0]._doors[(uVar9 >> 5) - 0xf] | 1 << ((byte)uVar9 & 0x1f); } uVar9 = uVar9 + 1; } while (uVar9 < 0xd); in_ECX->_lastBossRoomListIndex = 0; step = 0; do { if (in_ECX->_stage == 7) { if (step != 1) { if ((step == 2) || (step == 3)) { local_448 = g_game; pvVar8 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar8 >> 2 < 0x70) || ((iVar7 = *(int *)((int)pvVar8 + 0x1bc), iVar7 == 0 || (isCheckBackupPlayer = '\x01', (*(uint *)(iVar7 + 0xb8) & 0x80000000) == 0)))) { isCheckBackupPlayer = '\0'; } puVar10 = (g_game->_playerManager)._playerList._begin; if (puVar10 != (g_game->_playerManager)._playerList._end) { pGVar6 = g_game; do { player = (Entity_Player *)*puVar10; if (player->_variant == 0) { bVar3 = Entity_Player::HasTrinket(player,0x6f,0); if (bVar3 == 0) { if (((isCheckBackupPlayer == '\0') || (player->_backupPlayer == (Entity_Player *)0x0)) || (bVar3 = Entity_Player::HasTrinket(player->_backupPlayer,0x6f,0), bVar3 == 0)) { pGVar6 = local_448; goto LAB_0074fd81; } player = player->_backupPlayer; } if (player != (Entity_Player *)0x0) goto LAB_0074fda5; break; } LAB_0074fd81: puVar10 = puVar10 + 1; } while (puVar10 != (pGVar6->_playerManager)._playerList._end); } } else { LAB_0074fda5: if (step != 4) goto LAB_0074fe6b; local_448 = g_game; pvVar8 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar8 >> 2 < 0x6f) || (iVar7 = *(int *)((int)pvVar8 + 0x1b8), iVar7 == 0)) || (isCheckBackupPlayer = '\x01', (*(uint *)(iVar7 + 0xb8) & 0x80000000) == 0)) { isCheckBackupPlayer = '\0'; } puVar10 = (g_game->_playerManager)._playerList._begin; if (puVar10 != (g_game->_playerManager)._playerList._end) { pGVar6 = g_game; do { player = (Entity_Player *)*puVar10; if (player->_variant == 0) { bVar3 = Entity_Player::HasTrinket(player,0x6e,0); if (bVar3 == 0) { if (((isCheckBackupPlayer == '\0') || (player->_backupPlayer == (Entity_Player *)0x0)) || (bVar3 = Entity_Player::HasTrinket(player->_backupPlayer,0x6e,0), bVar3 == 0)) { pGVar6 = local_448; goto LAB_0074fe4d; } player = player->_backupPlayer; } if (player != (Entity_Player *)0x0) goto LAB_0074fe6b; break; } LAB_0074fe4d: puVar10 = puVar10 + 1; } while (puVar10 != (pGVar6->_playerManager)._playerList._end); } } } } else { LAB_0074fe6b: uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; (in_ECX->_generationRNG)._seed = uVar4; RoomDescriptor::Init(generator,uVar4); local_8 = (void *)0x0; puVar10 = local_478; copyDst = local_188; for (iVar7 = 0x2a; iVar7 != 0; iVar7 = iVar7 + -1) { *copyDst = *puVar10; puVar10 = puVar10 + 1; copyDst = copyDst + 1; } *(undefined1 *)copyDst = *(undefined1 *)puVar10; iVar7 = 0; do { uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; (in_ECX->_generationRNG)._seed = uVar4; local_448 = (Game *)(uVar4 % 0xb + 1); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; (in_ECX->_generationRNG)._seed = uVar4; gridRow = local_448; uVar4 = uVar4 % 0xb + 1; gridCol = uVar4; bVar3 = LevelGenerator::can_place_room((LevelGenerator *)generator,(int *)&gridCol,1); pGVar6 = g_game; } while ((bVar3 == 0) && (iVar7 = iVar7 + 1, iVar7 < 0x50)); if (step < 2) { if ((step == 0) && (in_ECX->_stage == 7)) { uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } iVar7 = 0x58; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; } else { iVar7 = GetRoomStageType(in_ECX,(int)local_448 * 0xd + gridCol); iVar7 = BossPool::GetBossId(&pGVar6->_bossPool,in_ECX->_stage,iVar7,rng); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; } (in_ECX->_generationRNG)._seed = uVar4; local_44c = pick_boss_room_config(iVar7,uVar4); local_448 = gridRow; uVar4 = gridCol; } else { iVar7 = (int)local_448 * 0xd + uVar4; if (step < 4) { local_44c = (void *)0x0; uVar9 = GetRoomStageType(in_ECX,iVar7); stageId = RoomConfig::GetStageID(in_ECX->_stage,uVar9,-1); uVar9 = (in_ECX->_generationRNG)._seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = (in_ECX->_generationRNG)._seed; if (uVar9 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar9 = uVar9 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar9; iVar7 = (in_ECX->_generationRNG)._shift3; uVar9 = uVar9 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)iVar7 & 0x1f) ^ uVar9; (in_ECX->_generationRNG)._seed = uVar9; local_44c = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar9,1,stageId,0,4,0xd,in_stack_fffffb44, in_stack_fffffb48,1,10,(uint *)&local_44c,0xffffffff,iVar7); } else { local_454 = 0; uVar9 = GetRoomStageType(in_ECX,iVar7); stageId = RoomConfig::GetStageID(in_ECX->_stage,uVar9,-1); uVar9 = (in_ECX->_generationRNG)._seed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = (in_ECX->_generationRNG)._seed; if (uVar9 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar9 = uVar9 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar9; iVar7 = (in_ECX->_generationRNG)._shift3; uVar9 = uVar9 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar9; uVar9 = uVar9 >> ((byte)iVar7 & 0x1f) ^ uVar9; (in_ECX->_generationRNG)._seed = uVar9; local_44c = RoomConfig::GetRandomRoomWithFallbackStage (roomConfig,uVar9,1,stageId,0,2,0xd,in_stack_fffffb44, in_stack_fffffb48,1,10,&local_454,0xffffffff,iVar7); } } pvVar8 = local_44c; room = LevelGenerator_Room::constructor (generatorRoom,uVar4,(uint)local_448,*(uint *)((int)local_44c + 0x48)); local_8._0_1_ = 1; bVar3 = LevelGenerator::place_room((LevelGenerator *)generator,room); pGVar6 = (Game *)CONCAT31(extraout_var,bVar3); local_8 = (void *)((uint)local_8._1_3_ << 8); local_448 = pGVar6; FID_conflict__Erase_tree_>_> (local_78,(fuzzer_allocator_> *)local_78, *(_Tree_node **)((int)local_78[0] + 4)); operator_delete(local_78[0],0x14); pGVar6->_roomList[0].Dimension = -1; pGVar6->_roomList[0].OverrideData = (void *)0xffffffff; pGVar6->_roomList[0].AllowedDoors = -1; LevelGenerator::update_dead_end_lists((LevelGenerator *)generator); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; pvVar12 = (void *)(in_ECX->_generationRNG)._shift3; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)pvVar12 & 0x1f) ^ uVar4; (in_ECX->_generationRNG)._seed = uVar4; place_room(in_ECX,pGVar6,pvVar8,uVar4,pvVar12,(RoomDescriptor **)0x0); pGVar6 = local_448; if (step < 2) { in_ECX->_lastBossRoomListIndex = in_ECX->_roomCount + -1; } uVar4 = 0; pvVar8 = (void *)((int)local_44c + 0x38); uVar9 = 1; local_44c = pvVar8; do { if ((*(uint *)((int)pvVar8 + (uVar4 >> 5) * 4) & uVar9) == 0) { get_door_neighbor_pos(pGVar6->_roomList[0].SafeGridIndex,uVar4); if ((neighborX != g_levelGenInvalidPos[0]) || (neighborY != g_levelGenInvalidPos[1])) { FUN_009b1910(&neighborX,extraout_ECX); } pvVar8 = local_44c; } pGVar2 = local_448; in_ECX = self; uVar4 = uVar4 + 1; uVar9 = uVar9 << 1 | (uint)((int)uVar9 < 0); } while ((int)uVar4 < 8); generateParams._0_1_ = *(undefined1 *)&local_448->_stage; local_5c = local_448->_stageType; local_58._0_1_ = local_448->_bossChallenge; local_58._1_1_ = local_448->_devilRoomDisabled; local_58._2_2_ = *(undefined2 *)&local_448->field_0xa; local_54 = local_448->_curses; local_50 = *(undefined4 *)&local_448->field_0x10; local_4c = local_448->_roomList[0].GridIndex; local_48 = local_448->_roomList[0].SafeGridIndex; local_44 = local_448->_roomList[0].ListIndex; local_40 = local_448->_roomList[0].Dimension; local_3c = local_448->_roomList[0].Data; local_38 = local_448->_roomList[0].OverrideData; local_34 = local_448->_roomList[0].AllowedDoors; doorSet = (void *)0x0; local_2c = 0; doorSet = operator_new(0x14); *(void **)doorSet = doorSet; *(void **)((int)doorSet + 4) = doorSet; *(void **)((int)doorSet + 8) = doorSet; *(undefined2 *)((int)doorSet + 0xc) = 0x101; local_8._0_1_ = 2; std_set_uint_copy(&doorSet,pGVar2->_roomList[0]._doors,(int)self); local_28 = pGVar2->_roomList[0]._doors[2]; local_24 = (undefined1)pGVar2->_roomList[0]._doors[3]; local_20 = pGVar2->_roomList[0]._doors[4]; local_1c = (undefined1)pGVar2->_roomList[0]._doors[5]; local_8 = (void *)CONCAT31(local_8._1_3_,3); uVar4 = (in_ECX->_generationRNG)._seed; if (step < 2) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; in_stack_fffffb44 = (uVar4 & 3) + 3; } else { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; in_stack_fffffb44 = uVar4 % 3 + 1; } (in_ECX->_generationRNG)._seed = uVar4; in_stack_fffffb48 = 0; LevelGenerator::Generate ((LevelGenerator *)generator,in_stack_fffffb44,0,0,0,&local_460,0,&generateParams); if (local_ad == '\0') { FID_conflict__Erase_tree_>_> (&doorSet,(fuzzer_allocator_> *)&doorSet, *(_Tree_node **)((int)doorSet + 4)); operator_delete(doorSet,0x14); FID_conflict__Tidy(local_c4); FID_conflict__Tidy(local_d0); vector_LevelGenerator_Room_tidy(local_dc); ExceptionList = local_10; return 0; } LevelGenerator::get_all_rooms((LevelGenerator *)generator,&allRooms); local_8._0_1_ = 4; piVar11 = (int *)((int)allRooms + 4); uVar5 = extraout_ECX_00; if (piVar11 != allRoomsEnd) { do { iVar7 = *piVar11; local_448 = (Game *)&DAT_0000000f; roomShape = *(int *)(iVar7 + 0x18); switch(roomShape) { case 4: local_448 = (Game *)0x5f; break; case 6: local_448 = (Game *)0xaf; break; case 8: case 9: case 10: case 0xb: case 0xc: local_448 = (Game *)0xff; } uVar4 = GetRoomStageType(in_ECX,*(int *)(iVar7 + 0xc) * 0xd + *(int *)(iVar7 + 8)); local_454 = RoomConfig::GetStageID(in_ECX->_stage,uVar4,-1); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (in_ECX->_generationRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } } uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(in_ECX->_generationRNG)._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)(in_ECX->_generationRNG)._shift3 & 0x1f) ^ uVar4; in_stack_fffffb44 = 0; (in_ECX->_generationRNG)._seed = uVar4; data = RoomConfig::GetRandomRoom (roomConfig,uVar4,1,local_454,1,roomShape,0,-1,1,0xf,(uint *)&local_448,0 ,-1); in_stack_fffffb48 = 0x750655; place_room(in_ECX,(void *)*piVar11,data,(in_ECX->_generationRNG)._seed,unused, (RoomDescriptor **)0x0); piVar11 = piVar11 + 1; } while (piVar11 != allRoomsEnd); uVar5 = extraout_ECX_01; } pvVar8 = allRooms; LevelGenerator::block_cells_near_rooms(generator,uVar5); local_8 = (void *)CONCAT31(local_8._1_3_,3); if (pvVar8 != (void *)0x0) { uVar4 = (allRoomsCapacity - (int)pvVar8 >> 2) * 4; pvVar12 = pvVar8; if (0xfff < uVar4) { pvVar12 = *(void **)((int)pvVar8 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar4); allRooms = (void *)0x0; allRoomsEnd = (int *)0x0; allRoomsCapacity = 0; } FID_conflict__Erase_tree_>_> (&doorSet,(fuzzer_allocator_> *)&doorSet, *(_Tree_node **)((int)doorSet + 4)); operator_delete(doorSet,0x14); local_8 = (void *)0xffffffff; FID_conflict__Tidy(local_c4); FID_conflict__Tidy(local_d0); vector_LevelGenerator_Room_tidy(local_dc); } step = step + 1; if (4 < step) { ExceptionList = local_10; return 1; } } while( true ); } //@@ 007507d0 LevelGenerator_Room::LevelGenerator_Room /* DB: copy constructor of the 0x48-byte LevelGenerator_Room: copies 0x00..0x2c, deep-copies the std::set at +0x30, copies 0x38..0x44; used by LevelGenerator::place_room (vector push_back) and the vector move helper FUN_00752b70 prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall LevelGenerator_Room::LevelGenerator_Room(LevelGenerator_Room *this,void *other) { LevelGenerator_Room *this_00; LevelGenerator_Room LVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe4ad; local_10 = ExceptionList; ExceptionList = &local_10; this_00 = this + 0xc; *(undefined1 *)this = *(undefined1 *)other; this[1] = *(LevelGenerator_Room *)((int)other + 4); this[2] = *(LevelGenerator_Room *)((int)other + 8); this[3] = *(LevelGenerator_Room *)((int)other + 0xc); this[4] = *(LevelGenerator_Room *)((int)other + 0x10); this[5] = *(LevelGenerator_Room *)((int)other + 0x14); this[6] = *(LevelGenerator_Room *)((int)other + 0x18); this[7] = *(LevelGenerator_Room *)((int)other + 0x1c); this[8] = *(LevelGenerator_Room *)((int)other + 0x20); this[9] = *(LevelGenerator_Room *)((int)other + 0x24); this[10] = *(LevelGenerator_Room *)((int)other + 0x28); this[0xb] = *(LevelGenerator_Room *)((int)other + 0x2c); *this_00 = (LevelGenerator_Room)0x0; this[0xd] = (LevelGenerator_Room)0x0; LVar1 = (LevelGenerator_Room)operator_new(0x14); *(LevelGenerator_Room *)LVar1 = LVar1; *(LevelGenerator_Room *)((int)LVar1 + 4) = LVar1; *(LevelGenerator_Room *)((int)LVar1 + 8) = LVar1; *(undefined2 *)((int)LVar1 + 0xc) = 0x101; *this_00 = LVar1; local_8 = 0; std_set_uint_copy(this_00,(void *)((int)other + 0x30),(int)other); this[0xe] = *(LevelGenerator_Room *)((int)other + 0x38); *(undefined1 *)(this + 0xf) = *(undefined1 *)((int)other + 0x3c); this[0x10] = *(LevelGenerator_Room *)((int)other + 0x40); *(undefined1 *)(this + 0x11) = *(undefined1 *)((int)other + 0x44); ExceptionList = local_10; return this; } //@@ 007508c0 Level::generate_random_layout /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? no callers; this=Level (RNG +0x182d4, start index +0x182d0 = y*13+x): RoomDescriptor::Init, GetRoomByStageTypeAndVariant(cfg,0,1,2) start room, loops FUN_0074fbe0 until a room is placed, random shape 1..11 pairs validated by FUN_009b0180, LevelGenerator::CreateRoom, then GetRandomRoom type 3 Error and 0x16 Black Market into the off-grid descriptors +0x16d44/+0x17024 (+0x5b51/+0x5c09 *4), Seeds::Init3 prototype: db/protos.zhl */ void __thiscall Level::generate_random_layout(Level *this) { int iVar1; RNG *rng; void *pvVar2; char isPlaced; byte isPlaceable; uint seed; RoomConfig_Room *randomRoom; RoomDescriptor *descriptor; undefined4 uVar3; RNG localRng; void *local_3c0; RoomConfig *roomConfig; int startX; RoomConfig_Room *local_3b4; RoomConfig_Room *local_3b0; RoomDescriptor generator [4]; undefined1 local_48 [12]; undefined1 local_3c [12]; undefined1 local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; code *debugBreak; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00afe570; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; seed = (this->_generationRNG)._seed; rng = &this->_generationRNG; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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; uVar3 = 0x75093f; RoomDescriptor::Init(generator,seed); local_8 = 0; roomConfig = &g_game->_roomConfig; do { isPlaced = try_place_random_room(generator,uVar3,seed); } while (isPlaced == '\0'); do { seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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_Room *)(seed % 0xb + 1); if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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_3b4 = local_3b0; iVar1 = seed % 0xb + 1; startX = iVar1; isPlaceable = LevelGenerator::can_place_room((LevelGenerator *)generator,&startX,1); } while (isPlaceable == 0); local_3c0 = LevelGenerator::CreateRoom ((LevelGenerator *)generator,iVar1,(int)local_3b0,1,-1,-1,-1); local_3b4 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0,1,2,-1); seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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; place_room(this,local_3c0,local_3b4,seed,pvVar2,(RoomDescriptor **)0x0); pvVar2 = ThreadLocalStoragePointer; this->_startingRoomIndex = (int)local_3b0 * 0xd + iVar1; if ((*(int *)(*(int *)pvVar2 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 1; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x1fc; } Seeds::Init3((Seeds *)descriptor,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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,(uint *)&local_3b4,0xffffffff,-1); iVar1 = *(int *)pvVar2; if ((*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x1fc; } descriptor->Data = local_3b0; if ((*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 3; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x200; } Seeds::Init3((Seeds *)descriptor,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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,(uint *)&local_3b4,0xffffffff,-1); iVar1 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 4; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x200; } descriptor->Data = local_3b0; if ((*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 5; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x1fe; } Seeds::Init3((Seeds *)descriptor,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0,0x10,0xd,0,-1,1,10,(uint *)&local_3b4,0xffffffff,-1); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 6; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } manager = g_manager; descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x1fe; } descriptor->Data = randomRoom; if (((manager->_persistentGameData)._achievements[0x98] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_3b0 = (RoomConfig_Room *)0x1; } else { local_3b0 = (RoomConfig_Room *)0x2; } if (((manager->_persistentGameData)._achievements[0x99] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_3b4 = (RoomConfig_Room *)0x1; } else { local_3b4 = (RoomConfig_Room *)0x2; } if (((manager->_persistentGameData)._achievements[0x9a] != 0) || (((manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_3b0 = (RoomConfig_Room *)((int)local_3b0 + 1); } localRng._seed = rng->_seed; if (localRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); localRng._seed = rng->_seed; if (localRng._seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } localRng._seed = (uint)localRng._seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ localRng._seed; localRng._shift1 = 3; localRng._shift2 = 3; localRng._seed = localRng._seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ localRng._seed; localRng._seed = (uint)localRng._seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ localRng._seed; local_3c0 = (void *)0x1a; rng->_seed = localRng._seed; localRng._shift3 = 0x1a; if (localRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } localRng._seed = (uint)localRng._seed >> 3 ^ localRng._seed; localRng._seed = localRng._seed << 3 ^ localRng._seed; localRng._seed = (uint)localRng._seed >> 0x1a ^ localRng._seed; local_3b0 = (RoomConfig_Room *)((uint)localRng._seed % (uint)local_3b0); if (localRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } localRng._seed = (uint)localRng._seed >> 3 ^ localRng._seed; localRng._seed = localRng._seed << 3 ^ localRng._seed; localRng._seed = (uint)localRng._seed >> 0x1a ^ localRng._seed; local_3b4 = (RoomConfig_Room *)((int)local_3b0 + (uint)localRng._seed % (uint)local_3b4); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 7; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x207; } Seeds::Init3((Seeds *)descriptor,&localRng); local_3c0 = (void *)0x0; if (localRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } seed = (uint)localRng._seed >> ((byte)localRng._shift1 & 0x1f) ^ localRng._seed; seed = seed << ((byte)localRng._shift2 & 0x1f) ^ seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed >> ((byte)localRng._shift3 & 0x1f) ^ seed,1,0,2,0xd,0,-1,1 ,10,(uint *)&local_3c0,(uint)local_3b4,-1); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 8; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x207; } descriptor->Data = randomRoom; seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed; localRng._shift1 = 3; localRng._shift2 = 3; localRng._seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed; rng->_seed = localRng._seed; localRng._shift3 = 0x1c; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 9; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x20c; } Seeds::Init3((Seeds *)descriptor,&localRng); local_3b4 = (RoomConfig_Room *)0x0; if (localRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); debugBreak = (code *)swi(3); (*debugBreak)(); return; } seed = (uint)localRng._seed >> ((byte)localRng._shift1 & 0x1f) ^ localRng._seed; seed = seed << ((byte)localRng._shift2 & 0x1f) ^ seed; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed >> ((byte)localRng._shift3 & 0x1f) ^ seed,1,0,0xf,0xd,0,-1 ,1,10,(uint *)&local_3b4,1,-1); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 10; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x20c; } descriptor->Data = randomRoom; if (this->_stage == 7) { seed = rng->_seed; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); return; } } pvVar2 = ThreadLocalStoragePointer; seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed; seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed; iVar1 = *(int *)ThreadLocalStoragePointer; rng->_seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed; if ((*(int *)(iVar1 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8._0_1_ = 0xb; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = (uint)local_8._1_3_ << 8; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } descriptor = &g_roomDescriptorDummy; if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x204; } Seeds::Init3((Seeds *)descriptor,rng); seed = rng->_seed; local_3b4 = (RoomConfig_Room *)0x0; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = rng->_seed; if (seed == 0) { debugBreak = (code *)swi(3); (*debugBreak)(); 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; randomRoom = RoomConfig::GetRandomRoom (roomConfig,seed,1,0x21,5,0xd,0,-1,1,10,(uint *)&local_3b4,0x58,-1); if ((*(int *)(*(int *)pvVar2 + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_8 = CONCAT31(local_8._1_3_,0xc); RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); _Init_thread_footer(&g_invalidRoomDescriptorGuard); } if ((uint)this->_currentDimensionIdx < 3) { descriptor = this->_roomList + 0x204; } else { descriptor = &g_roomDescriptorDummy; } descriptor->Data = randomRoom; } FID_conflict__Tidy(local_30); FID_conflict__Tidy(local_3c); vector_LevelGenerator_Room_tidy(local_48); ExceptionList = local_10; return; } //@@ 007515c0 FUN_007515c0 void FUN_007515c0(void) { Game *this; RoomDescriptor *pRVar1; Level *in_ECX; if (in_ECX->_currentDimensionIdx != 2) { pRVar1 = Level::GetRoomByIdx(in_ECX,0x50,2); if (pRVar1->Data == (void *)0x0) { Level::GenerateHome(); } this = g_game; in_ECX[1]._roomList[7].Flags = in_ECX->_currentRoomIndex; in_ECX[1]._roomList[7].GreedSubType = in_ECX->_previousRoomIndex; *(char *)&in_ECX[1]._roomList[7].TotalMoneySpent = (char)in_ECX->_currentDimensionIdx; *(char *)&in_ECX[1]._roomList[7].PoopCount = (char)in_ECX->_lastRoomDimensionIdx; in_ECX[1]._roomList[7].VisitedCount = in_ECX->_leaveDoor; this->_leaveDoor = -1; Game::StartRoomTransition(this,0x50,-1,0x14,(Entity_Player *)0x0,2); } return; } //@@ 00751650 Level::GenerateHome /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/rooms decompile labels (Level::GenerateHome?) */ void Level::GenerateHome(void) { int iVar1; code *pcVar2; byte isRepentanceStage; char cVar4; uint uVar5; NetplayManager *collectedRooms; NetplayManager roomIt; int *piVar6; Level *in_ECX; void *collectiblesBegin; undefined4 extraout_ECX; undefined4 extraout_ECX_00; int iVar7; short *spawnEntry; uint uVar8; void *pvVar9; RoomDescriptor *roomDesc; NetplayManager roomIt; size_t _Size; int *roomMapIt; Level *pLVar11; undefined1 auStack_4b4 [8]; int savedDimension; NetplayManager tmpRoomsBegin; NetplayManager tmpRoomsEnd; int tmpRoomsCap; NetplayManager local_49c; NetplayManager local_498; int local_494; undefined8 rngShift12; int roomsCap; int gridWidth; void *local_478; int *availableItemsEnd; int *local_470; RoomConfig *pRStack_46c; NetplayManager roomsBegin; int *availableItemsCap; int firstNewRoom; uint nextItemIdx; void *availableItemsBegin; void *rngShift3; RoomConfig_Room *local_450; undefined4 uStack_44c; NetplayManager local_448; void *local_444; uint local_440; Level *self; RoomDescriptor generator [3]; undefined1 auStack_180 [172]; undefined1 auStack_d4 [12]; undefined1 auStack_c8 [12]; undefined1 auStack_bc [23]; char cStack_a5; undefined4 uStack_a0; undefined4 uStack_9c; int iStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; float fStack_78; float fStack_74; LevelGenerator_Room LStack_70; uint uStack_6c; uint uStack_68; undefined4 uStack_64; undefined4 uStack_60; int local_5c [7]; void *pvStack_40; undefined4 local_3c; int *piStack_38; uint uStack_34; int *piStack_30; uint local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; Game *game; bool isRepentanceStage; char *logText; Manager *manager; EntitySaveState *saveStateEnd; game = g_game; puStack_20 = (undefined1 *)(local_5c + 0x16); local_14 = 0xffffffff; puStack_18 = &LAB_00afe5ef; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_5c + 0x13); ExceptionList = &local_1c; savedDimension = in_ECX->_currentDimensionIdx; local_450 = (RoomConfig_Room *)(in_ECX->_roomMap + 0x152); in_ECX->_currentDimensionIdx = 2; in_ECX->_currentRoomMap = local_450; self = in_ECX; if ((game->_roomConfig).field_0x1b58 == '\0') { RoomConfig::LoadStageBinary(&game->_roomConfig,0x23,0); } else { uVar8 = 0; puStack_20 = (undefined1 *)(local_5c + 0x16); if (*(int *)&(game->_roomConfig).field_0x1b4c != 0) { iVar7 = 0; do { iVar1 = *(int *)&(game->_roomConfig).field_0x1b48; uVar8 = uVar8 + 1; *(undefined4 *)(iVar1 + 0x34 + iVar7) = *(undefined4 *)(iVar1 + 0x30 + iVar7); iVar7 = iVar7 + 0x5c; puStack_20 = (undefined1 *)(local_5c + 0x16); } while (uVar8 < *(uint *)&(game->_roomConfig).field_0x1b4c); } } game = g_game; if ((self->_stageType == 4) || (self->_stageType == 5)) { isRepentanceStage = true; } else { isRepentanceStage = false; } uVar8 = self->_stage + 1; if (!isRepentanceStage) { uVar8 = self->_stage; } if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } if (uVar8 == 0) { uVar8 = 0; } else if (0xc < uVar8) { uVar8 = 0xd; } uVar5 = (self->_generationRNG)._seed; uVar8 = (game->_seedEffects)._stageSeeds[uVar8]; rngShift12 = 0x700000005; rngShift3 = (void *)0x16; local_440 = uVar8; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = (self->_generationRNG)._seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)(self->_generationRNG)._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)(self->_generationRNG)._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)(self->_generationRNG)._shift3 & 0x1f) ^ uVar5; (self->_generationRNG)._seed = uVar5; RoomDescriptor::Init(generator,uVar5); roomIt = (NetplayManager)0x0; roomsBegin = (NetplayManager)0x0; local_49c = (NetplayManager)0x0; local_498 = (NetplayManager)0x0; roomsCap = 0; local_494 = 0; local_14 = 1; local_448 = (NetplayManager)0x0; collectedRooms = RoomConfig::CollectRooms (&g_game->_roomConfig,&tmpRoomsBegin,0x23,1,0xd,0,0xffffffff,1,0xf, (uint *)&local_448,0x22,0); local_14._0_1_ = 2; if (&local_49c != collectedRooms) { local_448 = *collectedRooms; _Size = (int)collectedRooms[1] - (int)local_448; if ((int)_Size >> 2 == 0) { roomIt = (NetplayManager)0x0; } else { std::vector::reserve_clear((int)_Size >> 2); roomsCap = local_494; roomsBegin = local_49c; roomIt = local_49c; } memmove((void *)roomIt,(void *)local_448,_Size); roomIt = (NetplayManager)(_Size + (int)roomsBegin); local_498 = roomIt; } local_14 = CONCAT31(local_14._1_3_,1); FID_conflict__Tidy(&tmpRoomsBegin); manager = g_manager; local_444 = (void *)0x0; local_2c = 0; local_5c[0] = 0; local_5c[1] = 0; local_5c[2] = 0; local_5c[3] = 0; local_5c[4] = 0; local_5c[5] = 0; local_5c[6] = 0; pvStack_40 = (void *)0x0; local_3c = 0; piStack_38 = (int *)0x0; uStack_34 = 0; piStack_30 = (int *)0x0; for (roomIt = roomsBegin; roomIt != roomIt; roomIt = (NetplayManager)((int)roomIt + 4)) { local_5c[*(int *)(*(int *)roomIt + 0x48)] = local_5c[*(int *)(*(int *)roomIt + 0x48)] + 1; } uVar5 = 0; do { if (0 < local_5c[uVar5]) { if (0xc < uVar5) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } generator[0]._doors[(uVar5 >> 5) - 10] = generator[0]._doors[(uVar5 >> 5) - 10] | 1 << ((byte)uVar5 & 0x1f); } uVar5 = uVar5 + 1; } while (uVar5 < 0xd); availableItemsBegin = (void *)0x0; local_478 = (void *)0x0; availableItemsEnd = (int *)0x0; availableItemsCap = (int *)0x0; local_470 = (int *)0x0; local_14 = CONCAT31(local_14._1_3_,3); local_448 = (NetplayManager)g_manager; pvVar9 = (g_manager->_itemConfig)._collectibles._end; collectiblesBegin = (g_manager->_itemConfig)._collectibles._begin; uVar5 = (int)pvVar9 - (int)collectiblesBegin >> 2; if (uVar5 != 0) { if (0x3fffffff < uVar5) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(uVar5); pvVar9 = (manager->_itemConfig)._collectibles._end; collectiblesBegin = (manager->_itemConfig)._collectibles._begin; availableItemsCap = local_470; availableItemsBegin = local_478; } roomIt = local_448; uVar5 = 0; local_478 = availableItemsBegin; local_470 = availableItemsCap; if ((int)pvVar9 - (int)collectiblesBegin >> 2 != 0) { do { pvVar9 = *(void **)(uVar5 * 4 + (int)collectiblesBegin); if ((pvVar9 != (void *)0x0) && (isRepentanceStage = Item::IsAvailable(pvVar9,3), isRepentanceStage != 0)) { iVar7 = *(int *)((int)(((ItemConfig *)((int)roomIt + 0x2a404))->_collectibles)._begin + uVar5 * 4); iVar1 = *(int *)(iVar7 + 4); if ((iVar1 != 0x29c) && (iVar1 != 0x274)) { if (availableItemsEnd == availableItemsCap) { std::vector::_Emplace_reallocate(availableItemsEnd,iVar7 + 4); availableItemsCap = local_470; } else { *availableItemsEnd = iVar1; availableItemsEnd = availableItemsEnd + 1; } } } uVar5 = uVar5 + 1; collectiblesBegin = (((ItemConfig *)((int)roomIt + 0x2a404))->_collectibles)._begin; } while (uVar5 < (uint)((int)*(void **)((int)roomIt + 0x2a408) - (int)collectiblesBegin >> 2)); availableItemsBegin = local_478; uVar8 = local_440; } pLVar11 = self; logText = "generate...\n"; nextItemIdx = 0; firstNewRoom = self->_roomCount; local_478 = availableItemsBegin; KAGE_LogMessage(1,(byte *)"generate...\n"); memset(auStack_180,0,0xa9); uStack_44c = 1; local_448 = (NetplayManager)0x6; FUN_009b1910(&uStack_44c,logText); uStack_44c = 2; local_448 = (NetplayManager)0x5; FUN_009b1910(&uStack_44c,extraout_ECX); uStack_44c = 2; local_448 = (NetplayManager)&DAT_00000007; FUN_009b1910(&uStack_44c,extraout_ECX_00); local_5c[5] = g_levelGenInvalidPos[0]; LStack_70._0_1_ = 1; uStack_68 = 2; uStack_64 = 6; uStack_60 = 0; local_5c[0] = 0; local_5c[1] = 2; local_5c[2] = 0; local_5c[3] = -1; local_5c[4] = 0xffffffff; local_5c[6] = g_levelGenInvalidPos[1]; pvStack_40 = (void *)0x0; local_3c = 0; pvStack_40 = operator_new(0x14); *(void **)pvStack_40 = pvStack_40; *(void **)((int)pvStack_40 + 4) = pvStack_40; *(void **)((int)pvStack_40 + 8) = pvStack_40; *(undefined2 *)((int)pvStack_40 + 0xc) = 0x101; uStack_34 = uStack_34 & 0xffffff00; piStack_30 = (int *)0x0; local_2c = local_2c & 0xffffff00; uStack_60 = _DAT_00c5d388; local_5c[0] = _DAT_00c5d38c; local_14._0_1_ = 4; LevelGenerator::Generate((LevelGenerator *)generator,0x32,0,0,0,(uint *)&local_444,0,&LStack_70); local_14._0_1_ = 3; FID_conflict__Erase_tree_>_> (&pvStack_40,(fuzzer_allocator_> *)&pvStack_40, *(_Tree_node **)((int)pvStack_40 + 4)); operator_delete(pvStack_40,0x14); if (cStack_a5 == '\0') { KAGE_LogMessage(1,(byte *)"generated level is not usable\n"); } else { KAGE_LogMessage(1,(byte *)"placing rooms...\n"); pLVar11 = self; iVar7 = 0xa9; roomMapIt = &local_450->StageId; for (; iVar7 != 0; iVar7 = iVar7 + -1) { *roomMapIt = -1; roomMapIt = roomMapIt + 1; } firstNewRoom = self->_roomCount; LevelGenerator::get_all_rooms((LevelGenerator *)generator,&tmpRoomsBegin); local_14._0_1_ = 5; local_448 = tmpRoomsBegin; if (tmpRoomsBegin != tmpRoomsEnd) { do { game = g_game; local_444 = *(void **)local_448; local_450 = *(RoomConfig_Room **)((int)local_444 + 0x18); if (((local_450 == (RoomConfig_Room *)0x2) && (*(int *)((int)local_444 + 8) == 2)) && (*(int *)((int)local_444 + 0xc) == 6)) { if ((g_game->_roomConfig).field_0x1b58 == '\0') { RoomConfig::LoadStageBinary(&g_game->_roomConfig,0x23,0); } uVar8 = *(uint *)&(game->_roomConfig).field_0x1b4c; uVar5 = 0; if (uVar8 != 0) { pvVar9 = *(void **)&(game->_roomConfig).field_0x1b48; do { if ((*(int *)((int)pvVar9 + 8) == 1) && (*(int *)((int)pvVar9 + 0xc) == 100)) goto LAB_00751ceb; uVar5 = uVar5 + 1; pvVar9 = (void *)((int)pvVar9 + 0x5c); } while (uVar5 < uVar8); } KAGE_LogMessage(1,(byte *)"[warn] StageID %d Room type %d, variant %d not found!\n"); pvVar9 = (void *)0x0; LAB_00751ceb: pLVar11 = self; if (local_440 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } local_440 = local_440 >> ((byte)rngShift12 & 0x1f) ^ local_440; local_440 = local_440 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ local_440; local_440 = local_440 >> ((byte)rngShift3 & 0x1f) ^ local_440; place_room(self,local_444,pvVar9,local_440,rngShift3,(RoomDescriptor **)0x0); } else { pRStack_46c = &g_game->_roomConfig; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)rngShift12 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8; local_450 = RoomConfig::GetRandomRoom (pRStack_46c,uVar8,1,0x23,1,(int)local_450,0,-1,1,10, (uint *)((int)local_444 + 0x1c),0x22,0); pLVar11 = self; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)rngShift12 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8; local_440 = uVar8; place_room(self,local_444,local_450,uVar8,rngShift3,(RoomDescriptor **)0x0); local_444 = (void *)(pLVar11->_roomCount * 0xb8); local_450 = (RoomConfig_Room *)0x0; iVar7 = *(int *)((int)local_444 + (int)(pLVar11->_roomList + -1) + 0x10); gridWidth = *(byte *)(iVar7 + 0x46) + 2; if (*(short *)(iVar7 + 0x44) != 0) { local_440 = 0; do { uVar5 = local_440; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)rngShift12 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8; spawnEntry = (short *)(*(int *)(iVar7 + 0x40) + local_440); pRStack_46c = (RoomConfig *)(*spawnEntry + 1 + (spawnEntry[1] + 1) * gridWidth); if ((((char)spawnEntry[4] != '\0') && (piVar6 = Spawn::PickEntry(spawnEntry, (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10), *piVar6 == 5)) && ((short)piVar6[1] == 100)) { if (nextItemIdx < (uint)((int)availableItemsEnd - (int)availableItemsBegin >> 2)) { uVar5 = *(uint *)((int)availableItemsBegin + nextItemIdx * 4); if (g_game == (Game *)0x0) { if (-1 < (int)uVar5) goto LAB_00751f76; LAB_00751f90: iVar7 = 0; } else if ((int)uVar5 < 0) { if ((-1 < (int)uVar5) || (pvVar9 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar9 >> 2 <= (int)~uVar5)) goto LAB_00751f90; iVar7 = **(int **)((int)pvVar9 + ~uVar5 * 4); } else { LAB_00751f76: pvVar9 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar9 >> 2 <= (int)uVar5) goto LAB_00751f90; iVar7 = *(int *)((int)pvVar9 + uVar5 * 4); } uStack_8c = 0; uStack_88 = 0xffffffff; uStack_84 = 0xffffffff; uStack_94 = 0; uStack_80 = 0; uStack_7c = 0; LStack_70 = (LevelGenerator_Room)0x0; uStack_6c = 0; uStack_68 = 0; uStack_64 = 0; uStack_60 = 0; local_5c[1] = 0xffffffff; local_5c[2] = 0xffffffff; local_5c[3] = 0x42700000; local_5c[4] = 0x3f800000; local_5c[5] = 0x3f800000; local_5c[6] = 0; pvStack_40 = (void *)CONCAT31(pvStack_40._1_3_,1); local_3c = 0; piStack_38 = (int *)0x0; uStack_34 = 0; piStack_30 = (int *)0x0; local_14 = CONCAT31(local_14._1_3_,6); uStack_a0 = 5; uStack_9c = 100; iStack_98 = *(int *)((int)availableItemsBegin + nextItemIdx * 4); nextItemIdx = nextItemIdx + 1; if (iVar7 == 0) { uStack_90 = 0; } else { uStack_90 = *(undefined4 *)(iVar7 + 200); } fStack_74 = (float)((int)pRStack_46c / gridWidth) * 40.0 + 120.0; fStack_78 = (float)((int)pRStack_46c % gridWidth) * 40.0 + 40.0; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uVar8 >> ((byte)rngShift12 & 0x1f) ^ uVar8; isRepentanceStage = (byte)((ulonglong)rngShift12 >> 0x20); uVar8 = uVar8 << (isRepentanceStage & 0x1f) ^ uVar8; uStack_68 = uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8; if (uStack_68 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar8 = uStack_68 >> ((byte)rngShift12 & 0x1f) ^ uStack_68; LStack_70 = (LevelGenerator_Room)0x1; uVar8 = uVar8 << (isRepentanceStage & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)rngShift3 & 0x1f) ^ uVar8; uStack_6c = uVar8; local_5c[3] = ItemPool::GetFirstItemPoolForCollectible (&g_game->_itemPool,iStack_98); saveStateEnd = *(EntitySaveState **) ((int)local_444 + (int)(self->_roomList + -1) + 0x78); iVar7 = (int)local_444 + (int)self; if (saveStateEnd == *(EntitySaveState **)((int)local_444 + (int)(self->_roomList + -1) + 0x7c)) { std::vector::_Emplace_reallocate(saveStateEnd,&uStack_a0); } else { EntitySaveState::copy(saveStateEnd,&uStack_a0); piVar6 = (int *)(iVar7 + -0x2c); *piVar6 = *piVar6 + 0x78; } local_14._0_1_ = 7; if (((piStack_30 != (int *)0x0) && (cVar4 = (**(code **)(*piStack_30 + 0xc))(), cVar4 != '\0')) && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(&uStack_34); } local_14._0_1_ = 8; if (((piStack_38 != (int *)0x0) && (cVar4 = (**(code **)(*piStack_38 + 0xc))(), cVar4 != '\0')) && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(&local_3c); } local_14._0_1_ = 5; uVar5 = local_440; } std::set::insert(auStack_4b4,&pRStack_46c); } local_440 = uVar5 + 0x10; local_450 = (RoomConfig_Room *)((int)local_450 + 1); iVar7 = *(int *)((int)local_444 + (int)(self->_roomList + -1) + 0x10); } while (local_450 < (int *)(uint)*(ushort *)(iVar7 + 0x44)); local_440 = uVar8; } pLVar11 = self; } if ((uint)((int)availableItemsEnd - (int)availableItemsBegin >> 2) <= nextItemIdx) break; local_448 = (NetplayManager)((int)local_448 + 4); uVar8 = local_440; } while (local_448 != tmpRoomsEnd); } local_14._0_1_ = 3; if (tmpRoomsBegin != (NetplayManager)0x0) { uVar8 = tmpRoomsCap - (int)tmpRoomsBegin & 0xfffffffc; roomIt = tmpRoomsBegin; if (0xfff < uVar8) { roomIt = *(NetplayManager *)((int)tmpRoomsBegin + -4); uVar8 = uVar8 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)tmpRoomsBegin + (-4 - (int)roomIt))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)roomIt,uVar8); } } KAGE_LogMessage(1,(byte *)"Dark Closet Generated in %d Loops\n"); if (firstNewRoom < pLVar11->_roomCount) { roomDesc = pLVar11->_roomList + firstNewRoom; do { update_room_doors(pLVar11,roomDesc); roomDesc = roomDesc + 1; firstNewRoom = firstNewRoom + 1; } while (firstNewRoom < pLVar11->_roomCount); } pLVar11->_currentDimensionIdx = savedDimension; pLVar11->_currentRoomMap = pLVar11->_roomMap + savedDimension * 0xa9; if (availableItemsBegin != (void *)0x0) { uVar8 = (int)availableItemsCap - (int)availableItemsBegin & 0xfffffffc; pvVar9 = availableItemsBegin; if (0xfff < uVar8) { pvVar9 = *(void **)((int)availableItemsBegin + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)availableItemsBegin + (-4 - (int)pvVar9))) goto LAB_0075237a; } operator_delete(pvVar9,uVar8); } if (roomsBegin != (NetplayManager)0x0) { uVar8 = roomsCap - (int)roomsBegin & 0xfffffffc; roomIt = roomsBegin; if (0xfff < uVar8) { roomIt = *(NetplayManager *)((int)roomsBegin + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)roomsBegin + (-4 - (int)roomIt))) { LAB_0075237a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)roomIt,uVar8); } FID_conflict__Tidy(auStack_bc); FID_conflict__Tidy(auStack_c8); vector_LevelGenerator_Room_tidy(auStack_d4); ExceptionList = local_1c; return; } //@@ 007523e0 Level::boss_count_adjust /* DB: ? stage-type based counters; extra boss room prototype: db/protos.zhl, confirmed by RET 8 */ byte Level::boss_count_adjust(int *stage,int *stageType) { int iVar1; bool bVar2; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { iVar1 = *stage; if (5 < iVar1) { return 0; } if (3 < iVar1) goto LAB_00752443; *stage = iVar1 + 1; bVar2 = SBORROW4(iVar1 + 1,4); iVar1 = iVar1 + -3; } else { iVar1 = *stage; if (9 < iVar1) { return 0; } if (iVar1 < 7) { iVar1 = iVar1 + 2; *stage = iVar1; } if (iVar1 == 6) { *stage = 5; return 1; } if (7 < iVar1) { *stage = 7; goto LAB_00752443; } bVar2 = SBORROW4(iVar1,7); iVar1 = iVar1 + -7; } if (bVar2 != iVar1 < 0) { return 1; } LAB_00752443: if (*stageType == 5) { *stageType = 4; } return 1; } //@@ 00752460 Level::get_door_neighbor_indices /* DB: ? (set* out): for each placed room (count +0x182cc, stride 0xb8) and each of 8 doors not usable to a normal unvisited room, LevelGenerator::get_door_target_position and inserts the 13x13 grid index (or -1); Level::place_special_rooms */ undefined4 * __thiscall Level::get_door_neighbor_indices(Level *this,undefined4 *param_2) { void *pvVar1; Level *pLVar2; void **ppvVar3; uint uVar4; uint doorSlot; undefined1 local_3c [8]; uint local_34; uint local_30; int local_2c; int local_28; int local_24 [3]; Level *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afe63e; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; local_24[1] = 0; *param_2 = 0; param_2[1] = 0; local_18 = this; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *param_2 = pvVar1; local_8 = 0; local_24[1] = 1; local_24[2] = 0; if (this->_roomCount < 1) { ExceptionList = local_10; return param_2; } ppvVar3 = &this->_roomList[0].Data; pLVar2 = local_18; do { if (*ppvVar3 != (void *)0x0) { local_2c = ((RoomDescriptor *)(ppvVar3 + -4))->GridIndex; if (-1 < local_2c) { local_28 = local_2c / 0xd; local_2c = local_2c % 0xd; doorSlot = 0; uVar4 = 1; do { pvVar1 = *ppvVar3; if (((((*(uint *)((int)pvVar1 + (doorSlot >> 5) * 4 + 0x38) & uVar4) == 0) || (*(int *)((int)pvVar1 + 8) != 1)) || (*(int *)((int)pvVar1 + 0x10) != 0)) && ((LevelGenerator::get_door_target_position ((int *)&local_34,&local_2c,*(int *)((int)pvVar1 + 0x48),doorSlot,1), local_34 != g_levelGenInvalidPos[0] || (local_30 != g_levelGenInvalidPos[1])))) { if ((local_34 < 0xd) && (local_30 < 0xd)) { local_24[0] = local_30 * 0xd + local_34; } else { local_24[0] = -1; } std::set::insert(local_3c,local_24); } doorSlot = doorSlot + 1; uVar4 = uVar4 << 1 | (uint)((int)uVar4 < 0); } while ((int)doorSlot < 8); } pLVar2 = local_18; } local_24[2] = local_24[2] + 1; ppvVar3 = ppvVar3 + 0x2e; } while (local_24[2] < pLVar2->_roomCount); ExceptionList = local_10; return param_2; } //@@ 007525e0 std::vector::assign /* DB: memmove copy-assign 4-byte vector */ void std::vector::assign(int *param_1) { void *_Src; int *in_ECX; size_t _Size; void *_Dst; if (in_ECX != param_1) { _Src = (void *)*param_1; _Size = param_1[1] - (int)_Src; _Dst = (void *)*in_ECX; if ((uint)(in_ECX[2] - (int)_Dst >> 2) < (uint)((int)_Size >> 2)) { reserve_clear((int)_Size >> 2); _Dst = (void *)*in_ECX; } memmove(_Dst,_Src,_Size); in_ECX[1] = (int)_Dst + _Size; } return; } //@@ 00752640 FUN_00752640 int * FUN_00752640(int *param_1) { uint *puVar1; int *in_ECX; uint uVar2; puVar1 = (uint *)(*in_ECX + ((uint)in_ECX[1] >> 5) * 4); uVar2 = 1 << ((byte)in_ECX[1] & 0x1f); if ((*(uint *)(*param_1 + ((uint)param_1[1] >> 5) * 4) & 1 << ((byte)param_1[1] & 0x1f)) == 0) { *puVar1 = ~uVar2 & *puVar1; return in_ECX; } *puVar1 = *puVar1 | uVar2; return in_ECX; } //@@ 007526b0 FUN_007526b0 void FUN_007526b0(undefined4 *param_1) { undefined4 uVar1; undefined4 *in_ECX; undefined4 *puVar2; if (in_ECX != param_1) { puVar2 = (undefined4 *)*in_ECX; *in_ECX = *param_1; *param_1 = puVar2; if ((undefined4 *)*in_ECX != (undefined4 *)0x0) { *(undefined4 *)*in_ECX = in_ECX; puVar2 = (undefined4 *)*param_1; } if (puVar2 != (undefined4 *)0x0) { *puVar2 = param_1; } uVar1 = in_ECX[1]; in_ECX[1] = param_1[1]; param_1[1] = uVar1; uVar1 = in_ECX[2]; in_ECX[2] = param_1[2]; param_1[2] = uVar1; uVar1 = in_ECX[3]; in_ECX[3] = param_1[3]; param_1[3] = uVar1; uVar1 = in_ECX[4]; in_ECX[4] = param_1[4]; param_1[4] = uVar1; } return; } //@@ 00752710 std::deque<12byte>::~deque /* DB: pops all (size +0x10), deletes each 0xc-byte block of the map (+4, mapsize +8), frees the map, then deletes the 8-byte container proxy at +0; GameState::~GameState, NetplayManager::~NetplayManager */ void std::deque<12byte>::~deque(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; uint size; int iVar2; iVar2 = in_ECX[4]; if (iVar2 != 0) { do { iVar2 = iVar2 + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; } iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0xc); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 007527b0 vector_LevelGenerator_Room_tidy /* DB: std::vector _Tidy for 0x48-byte elements (destroy range FUN_00752e40, deallocate, zero begin/end/cap); called at the end of Level::generate_* layout passes; LevelGenerator::place_boss_room 009aef10 LevelGenerator::place_boss_room it on a vector it walks with LevelGenerator_Room* stride 0x48 prototype: db/protos.zhl */ void __fastcall vector_LevelGenerator_Room_tidy(void *vec) { void *pvVar1; uint size; void *ptr; if (*(int *)vec != 0) { FUN_00752e40(*(int *)vec); pvVar1 = *(void **)vec; size = ((*(int *)((int)vec + 8) - (int)pvVar1) / 0x48) * 0x48; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *(undefined4 *)vec = 0; *(undefined4 *)((int)vec + 4) = 0; *(undefined4 *)((int)vec + 8) = 0; } return; } //@@ 00752830 FUN_00752830 void FUN_00752830(int *param_1) { int iVar1; int iVar2; uint uVar3; void *pvVar4; undefined4 uVar5; undefined4 *in_ECX; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe66d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; iVar1 = *param_1; iVar2 = param_1[1]; if (iVar1 != iVar2) { uVar6 = (iVar2 - iVar1) / 0x78; if (0x2222222 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar3); } uVar6 = uVar6 * 0x78; pvVar4 = std::_Allocate(uVar6); *in_ECX = pvVar4; in_ECX[1] = pvVar4; in_ECX[2] = (void *)(uVar6 + (int)pvVar4); local_8 = 0; uVar5 = std::_Uninitialized_copy(iVar1,iVar2,pvVar4); in_ECX[1] = uVar5; } ExceptionList = local_10; return; } //@@ 007528f0 FUN_007528f0 void FUN_007528f0(void) { int *piVar1; uint size; undefined4 *in_ECX; void *owner; void *pvVar2; piVar1 = (int *)*in_ECX; if (piVar1 == (int *)0x0) { return; } owner = (void *)*piVar1; if (owner != (void *)0x0) { pvVar2 = (void *)piVar1[1]; if (owner != pvVar2) { do { invoke_pending_callbacks(owner); owner = (void *)((int)owner + 0x78); } while (owner != pvVar2); owner = (void *)*piVar1; } size = ((piVar1[2] - (int)owner) / 0x78) * 0x78; pvVar2 = owner; if (0xfff < size) { pvVar2 = *(void **)((int)owner + -4); size = size + 0x23; if (0x1f < (uint)((int)owner + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *piVar1 = 0; piVar1[1] = 0; piVar1[2] = 0; } return; } //@@ 00752900 std::vector<8byte>::_Reallocate_exactly /* DB: max 0x1fffffff, _Allocate, copies 8-byte elements, _Change_array(old count, new cap); called by std::vector<8byte>::reserve */ void std::vector<8byte>::_Reallocate_exactly(uint param_1) { int iVar1; int iVar2; uint *puVar3; uint uVar4; uint *puVar5; uint *puVar6; int *in_ECX; uint *puVar7; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } puVar6 = _Allocate(param_1 * 8); puVar3 = (uint *)in_ECX[1]; puVar5 = puVar6; for (puVar7 = (uint *)*in_ECX; puVar7 != puVar3; puVar7 = puVar7 + 2) { uVar4 = puVar7[1]; *puVar5 = *puVar7; puVar5[1] = uVar4; puVar5 = puVar5 + 2; } FID_conflict__Change_array(in_ECX,puVar6,iVar1 - iVar2 >> 3,param_1); return; } //@@ 00752980 FUN_00752980 void FUN_00752980(void) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(0x1a0); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,0x68); return; } //@@ 007529c0 vector_LevelGenerator_Room_reserve /* DB: std::vector<0x48-byte element>::reserve (max 0x38e38e3): allocate, move range (FUN_00752b70), adopt (FUN_00752ac0); companion of vector_LevelGenRoom_tidy 007527b0, called by Level::generate_home/mineshaft prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall vector_LevelGenerator_Room_reserve(void *this,uint count) { int iVar1; int iVar2; void *pvVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afe690; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *(int *)((int)this + 4); iVar2 = *(int *)this; if (0x38e38e3 < count) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar3 = std::_Allocate(count * 0x48); local_8 = 0; std::_Uninitialized_move (*(undefined4 *)this,*(undefined4 *)((int)this + 4),pvVar3); std::vector::_Change_array(pvVar3,(iVar1 - iVar2) / 0x48,count); ExceptionList = local_10; return; } //@@ 00752a55 Catch_All@00752a55 void Catch_All_00752a55(void) { int unaff_EBP; deallocate(*(void **)(unaff_EBP + -0x18),*(uint *)(unaff_EBP + 8)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00752a80 FUN_00752a80 void FUN_00752a80(void) { int iVar1; int iVar2; uint *_Dst; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(0x18); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,iVar1 - iVar2 >> 2,6); return; } //@@ 00752ac0 std::vector::_Change_array /* DB: destroys old 0x48-byte rooms (FUN_00752e40), frees, installs new buffer; vector_LevelGenerator_Room_reserve, _Emplace_reallocate */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00752e40(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x48) * 0x48; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x48; in_ECX[2] = param_1 + param_3 * 0x48; return; } //@@ 00752b50 FUN_00752b50 void FUN_00752b50(void) { FUN_00752e40(); return; } //@@ 00752b70 std::_Uninitialized_move /* DB: LevelGenerator_Room copy ctor over the range then destroy source (FUN_00752e40); vector_LevelGenerator_Room_reserve, _Emplace_reallocate */ void std::_Uninitialized_move (void *param_1,void *param_2,LevelGenerator_Room *param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afe6bd; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = (void *)((int)param_1 + 0x48)) { LevelGenerator_Room::LevelGenerator_Room(param_3,param_1); param_3 = param_3 + 0x12; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_00752e40(in_ECX,uVar2); ExceptionList = local_10; return; } //@@ 00752bf0 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x48; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 00752c30 std::bitset<8>::to_string /* DB: src/rooms decompile labels (std::bitset<8>::to_string(out)) */ undefined4 * std::bitset<8>::to_string(undefined4 *param_1) { uint uVar1; char *pcVar2; uint uVar3; void *_Src; uint uVar4; uint uVar5; undefined4 *puVar6; void *_Dst; int in_ECX; uint uVar7; char cVar8; uint uVar9; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afe6fe; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; local_8 = 0; FUN_00753230(8); uVar5 = 8; do { uVar5 = uVar5 - 1; uVar3 = param_1[5]; uVar7 = param_1[4]; cVar8 = ((*(uint *)(in_ECX + (uVar5 >> 5) * 4) & 1 << ((byte)uVar5 & 0x1f)) != 0) + '0'; if (uVar7 < uVar3) { param_1[4] = uVar7 + 1; puVar6 = param_1; if (0xf < uVar3) { puVar6 = (undefined4 *)*param_1; } *(char *)((int)puVar6 + uVar7) = cVar8; *(undefined1 *)((int)puVar6 + uVar7 + 1) = 0; } else { if (uVar7 == 0x7fffffff) { /* WARNING: Subroutine does not return */ string::_Xlen(uVar4); } uVar9 = uVar7 + 1 | 0xf; if (uVar9 < 0x80000000) { if (0x7fffffff - (uVar3 >> 1) < uVar3) { uVar9 = 0x7fffffff; } else { uVar1 = (uVar3 >> 1) + uVar3; if (uVar9 < uVar1) { uVar9 = uVar1; } } } else { uVar9 = 0x7fffffff; } _Dst = _Allocate(uVar9 + 1); param_1[5] = uVar9; pcVar2 = (char *)((int)_Dst + uVar7); param_1[4] = uVar7 + 1; if (uVar3 < 0x10) { memcpy(_Dst,param_1,uVar7); *pcVar2 = cVar8; pcVar2[1] = '\0'; } else { _Src = (void *)*param_1; memcpy(_Dst,_Src,uVar7); *pcVar2 = cVar8; uVar7 = uVar3 + 1; pcVar2[1] = '\0'; ptr = _Src; if (0xfff < uVar7) { ptr = *(void **)((int)_Src + -4); uVar7 = uVar3 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *param_1 = _Dst; } } while (uVar5 != 0); ExceptionList = local_10; return param_1; } //@@ 00752de0 FUN_00752de0 void FUN_00752de0(int param_1,int param_2) { undefined4 uVar1; uint uVar2; uint uVar3; int iVar4; uVar3 = param_2 - param_1 >> 2; iVar4 = uVar3 - 1; if (0 < iVar4) { do { if (uVar3 == 0) { uVar2 = 0; } else { uVar2 = Random(); uVar2 = uVar2 % uVar3; } uVar1 = *(undefined4 *)(param_1 + iVar4 * 4); uVar3 = uVar3 - 1; *(undefined4 *)(param_1 + iVar4 * 4) = *(undefined4 *)(param_1 + uVar2 * 4); iVar4 = iVar4 + -1; *(undefined4 *)(param_1 + uVar2 * 4) = uVar1; } while (0 < iVar4); } return; } //@@ 00752e40 FUN_00752e40 void FUN_00752e40(void) { int *piVar1; int *in_ECX; int *in_EDX; int *this; if (in_ECX != in_EDX) { this = in_ECX + 0xc; do { FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x14); piVar1 = this + 6; this = this + 0x12; } while (piVar1 != in_EDX); } return; } //@@ 00752e80 RoomDescriptor::move_constructor /* DB: ? field copy of a RoomDescriptor from param into ECX that steals the vectors at +0x68/+0x74/+0x88 (zeroes the source) and swaps a fresh std::list head at +0x80; from Level::maze_swap_rooms before two RoomDescriptor::operator_assign (copy ctor is 00749040) */ RoomDescriptor * __thiscall RoomDescriptor::move_constructor(RoomDescriptor *this,int *param_2) { void *pvVar1; void *pvVar2; uint uVar3; int iVar4; int iVar5; int iVar6; void *pvVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afe73b; local_10 = ExceptionList; ExceptionList = &local_10; this->GridIndex = *param_2; this->SafeGridIndex = param_2[1]; this->ListIndex = param_2[2]; this->Dimension = param_2[3]; this->Data = (void *)param_2[4]; this->OverrideData = (void *)param_2[5]; this->AllowedDoors = param_2[6]; iVar4 = param_2[8]; iVar5 = param_2[9]; iVar6 = param_2[10]; this->_doors[0] = param_2[7]; this->_doors[1] = iVar4; this->_doors[2] = iVar5; this->_doors[3] = iVar6; iVar4 = param_2[0xc]; iVar5 = param_2[0xd]; iVar6 = param_2[0xe]; this->_doors[4] = param_2[0xb]; this->_doors[5] = iVar4; this->_doors[6] = iVar5; this->_doors[7] = iVar6; this->DisplayFlags = param_2[0xf]; this->VisitedCount = param_2[0x10]; this->Flags = param_2[0x11]; this->TotalMoneySpent = (short)param_2[0x12]; this->ClearCount = *(short *)((int)param_2 + 0x4a); this->GreedSubType = param_2[0x13]; this->PoopCount = (short)param_2[0x14]; this->TKeeperCoinSpawns = *(short *)((int)param_2 + 0x52); this->PitsCount = param_2[0x15]; this->DecorationSeed = param_2[0x16]; this->SpawnSeed = param_2[0x17]; this->AwardSeed = param_2[0x18]; this->BossDeathSeed = param_2[0x19]; pvVar7 = (void *)param_2[0x1c]; pvVar1 = (void *)param_2[0x1b]; pvVar2 = (void *)param_2[0x1a]; param_2[0x1c] = 0; param_2[0x1b] = 0; param_2[0x1a] = 0; (this->SavedGridEntities)._begin = pvVar2; (this->SavedGridEntities)._end = pvVar1; (this->SavedGridEntities)._capacity = pvVar7; pvVar7 = (void *)param_2[0x1f]; pvVar1 = (void *)param_2[0x1e]; pvVar2 = (void *)param_2[0x1d]; param_2[0x1f] = 0; param_2[0x1e] = 0; param_2[0x1d] = 0; (this->SavedEntities)._begin = pvVar2; (this->SavedEntities)._end = pvVar1; (this->SavedEntities)._capacity = pvVar7; local_8 = 1; (this->RestrictedGridIndexes)._head = (void *)0x0; (this->RestrictedGridIndexes)._size = 0; pvVar7 = operator_new(0x14); *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; *(undefined2 *)((int)pvVar7 + 0xc) = 0x101; (this->RestrictedGridIndexes)._head = pvVar7; (this->RestrictedGridIndexes)._head = (void *)param_2[0x20]; param_2[0x20] = (int)pvVar7; uVar3 = (this->RestrictedGridIndexes)._size; (this->RestrictedGridIndexes)._size = param_2[0x21]; param_2[0x21] = uVar3; pvVar7 = (void *)param_2[0x23]; pvVar1 = (void *)param_2[0x22]; pvVar2 = (void *)param_2[0x24]; param_2[0x24] = 0; param_2[0x23] = 0; param_2[0x22] = 0; (this->SavedEffects)._begin = pvVar1; (this->SavedEffects)._end = pvVar7; (this->SavedEffects)._capacity = pvVar2; iVar4 = param_2[0x26]; iVar5 = param_2[0x27]; iVar6 = param_2[0x28]; *(int *)&this->field_0x94 = param_2[0x25]; *(int *)&this->field_0x98 = iVar4; *(int *)&this->field_0x9c = iVar5; *(int *)&this->field_0xa0 = iVar6; iVar4 = param_2[0x2a]; *(int *)&this->field_0xa4 = param_2[0x29]; *(int *)&this->field_0xa8 = iVar4; this->ShopItemIdx = (short)param_2[0x2b]; this->ShopItemDiscountIdx = *(short *)((int)param_2 + 0xae); this->DeliriumDistance = param_2[0x2c]; this->Group = param_2[0x2d]; ExceptionList = local_10; return this; } //@@ 007530b0 FUN_007530b0 void FUN_007530b0(void) { FUN_00752e40(); return; } //@@ 007530c0 FUN_007530c0 void FUN_007530c0(void) { int *this; undefined4 *in_ECX; this = (int *)in_ECX[1]; if (this != (int *)0x0) { FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)*in_ECX, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x14); } return; } //@@ 007530f0 std_deque_growmap /* DB: std::deque::_Growmap: doubles the map size (min 8, max 0x15555555 -> 12-byte element deque) and moves the block pointers, adjusting the offset (+0xc); Level::write_room_config, PlayerManager::unlock_completion_mark prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall std_deque_growmap(void *this,uint count) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)((int)this + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0x15555555 - uVar3 < uVar3) { FUN_0040cad0(); LAB_00753226: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)((int)this + 0xc); if (uVar3 < 0x40000000) { _Dst = std::_Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)((int)this + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)((int)this + 8) * 4 - (int)pvVar1) + *(int *)((int)this + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)((int)this + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)((int)this + 4)); _Size = (*(int *)((int)this + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)((int)this + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)((int)this + 4) != (void *)0x0) { deallocate(*(void **)((int)this + 4),*(uint *)((int)this + 8)); } *(int *)((int)this + 8) = *(int *)((int)this + 8) + uVar4; *(void **)((int)this + 4) = _Dst; return; } goto LAB_00753226; } //@@ 00753230 FUN_00753230 void FUN_00753230(uint param_1) { uint uVar1; uint uVar2; void *pvVar3; undefined4 *in_ECX; uint uVar4; uint uVar5; void *ptr; void *pvVar6; uVar5 = in_ECX[4]; if (uVar5 <= param_1) { uVar2 = in_ECX[5]; if (uVar2 != param_1) { if (uVar2 < param_1) { if (0x7fffffff - uVar5 < param_1 - uVar5) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar4 = param_1 | 0xf; if (uVar4 < 0x80000000) { if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar4 = 0x7fffffff; } else { uVar1 = (uVar2 >> 1) + uVar2; if (uVar4 < uVar1) { uVar4 = uVar1; } } } else { uVar4 = 0x7fffffff; } pvVar3 = std::_Allocate(uVar4 + 1); in_ECX[5] = uVar4; in_ECX[4] = param_1; if (uVar2 < 0x10) { memcpy(pvVar3,in_ECX,uVar5 + 1); *in_ECX = pvVar3; in_ECX[4] = uVar5; return; } pvVar6 = (void *)*in_ECX; memcpy(pvVar3,pvVar6,uVar5 + 1); uVar4 = uVar2 + 1; ptr = pvVar6; if (0xfff < uVar4) { ptr = *(void **)((int)pvVar6 + -4); uVar4 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)ptr))) { LAB_0075337a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); *in_ECX = pvVar3; in_ECX[4] = uVar5; return; } if ((param_1 < 0x10) && (0xf < uVar2)) { pvVar3 = (void *)*in_ECX; memcpy(in_ECX,pvVar3,uVar5 + 1); uVar5 = in_ECX[5] + 1; pvVar6 = pvVar3; if (0xfff < uVar5) { pvVar6 = *(void **)((int)pvVar3 + -4); uVar5 = in_ECX[5] + 0x24; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar6))) goto LAB_0075337a; } operator_delete(pvVar6,uVar5); in_ECX[5] = 0xf; } } } return; } //@@ 00753390 std::vector<4byte>::insert_range /* DB: (where, first, last): grows x1.5 (max 0x3fffffff, _Xlen) and memmoves the [first,last) 4-byte range in at where; Level::generate_dungeon, RoomConfig::GetRandomRoom */ void std::vector<4byte>::insert_range(void *param_1,void *param_2,int param_3) { size_t _Size; void *_Dst; int iVar1; uint uVar2; uint *_Dst_00; undefined4 *in_ECX; size_t _Size_00; uint uVar3; uint uVar4; void *pvVar5; size_t _Size_01; uint local_14; _Size_00 = param_3 - (int)param_2; pvVar5 = (void *)*in_ECX; uVar4 = (int)_Size_00 >> 2; _Dst = (void *)in_ECX[1]; if (uVar4 != 0) { if ((uint)(in_ECX[2] - (int)_Dst >> 2) < uVar4) { iVar1 = (int)_Dst - (int)pvVar5 >> 2; if (0x3fffffffU - iVar1 < uVar4) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = iVar1 + uVar4; uVar3 = in_ECX[2] - (int)pvVar5 >> 2; if (0x3fffffff - (uVar3 >> 1) < uVar3) { local_14 = 0x3fffffff; } else { uVar3 = (uVar3 >> 1) + uVar3; local_14 = uVar2; if (uVar2 <= uVar3) { local_14 = uVar3; } if (0x3fffffff < local_14) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst_00 = _Allocate(local_14 << 2); iVar1 = (int)param_1 - (int)pvVar5 >> 2; memmove(_Dst_00 + iVar1,param_2,_Size_00); if ((uVar4 == 1) && (param_1 == _Dst)) { memmove(_Dst_00,pvVar5,(int)_Dst - (int)pvVar5); } else { memmove(_Dst_00,pvVar5,(int)param_1 - (int)pvVar5); memmove(_Dst_00 + iVar1 + uVar4,param_1,(int)_Dst - (int)param_1); } FID_conflict__Change_array(in_ECX,_Dst_00,uVar2,local_14); return; } _Size = uVar4 * 4; uVar3 = (int)_Dst - (int)param_1 >> 2; if (uVar4 < uVar3) { pvVar5 = (void *)((int)_Dst + uVar4 * -4); memmove(_Dst,pvVar5,_Size); _Size_01 = (int)pvVar5 - (int)param_1; in_ECX[1] = (void *)(_Size + (int)_Dst); memmove((void *)((int)_Dst - _Size_01),param_1,_Size_01); memmove(param_1,param_2,_Size_00); return; } memmove((void *)((int)param_1 + _Size),param_1,(int)_Dst - (int)param_1); in_ECX[1] = (void *)((int)((int)param_1 + _Size) + uVar3 * 4); memmove(param_1,param_2,_Size_00); } return; } //@@ 00753550 FUN_00753550 void FUN_00753550(void) { libm_sse2_asin_precise(); return; } //@@ 00753560 FUN_00753560 undefined1 FUN_00753560(void) { float *in_ECX; float *in_EDX; if ((((((*in_ECX == *in_EDX) && (in_ECX[1] == in_EDX[1])) && (in_ECX[2] == in_EDX[2])) && ((in_ECX[3] == in_EDX[3] && (in_ECX[4] == in_EDX[4])))) && ((in_ECX[5] == in_EDX[5] && ((in_ECX[6] == in_EDX[6] && (in_ECX[7] == in_EDX[7])))))) && ((in_ECX[8] == in_EDX[8] && ((in_ECX[9] == in_EDX[9] && (in_ECX[10] == in_EDX[10])))))) { return 1; } return 0; } //@@ 00753620 FUN_00753620 void FUN_00753620(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 1; return; } //@@ 00753630 FUN_00753630 bool FUN_00753630(void) { int in_ECX; return *(int *)(in_ECX + 4) == 1; } //@@ 00753640 FUN_00753640 bool FUN_00753640(void) { int in_ECX; return *(int *)(in_ECX + 4) == 2; } //@@ 00753650 FUN_00753650 void FUN_00753650(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x650) = 2; return; } //@@ 00753660 FUN_00753660 void FUN_00753660(undefined4 *param_1,undefined4 param_2) { undefined4 uVar1; uint uVar2; int in_ECX; uint uVar3; undefined8 local_1c; undefined1 local_14 [8]; int local_c; local_1c = FUN_0072c930(param_2); uVar3 = (uint)((ulonglong)local_1c >> 0x20); uVar2 = (uint)local_1c; FUN_00731ee0(local_14,&local_1c); if ((((*(char *)(local_c + 0xd) == '\0') && (*(uint *)(local_c + 0x14) <= uVar3)) && ((*(uint *)(local_c + 0x14) < uVar3 || (*(uint *)(local_c + 0x10) <= uVar2)))) && (local_c != *(int *)(in_ECX + 0x124))) { uVar1 = *(undefined4 *)(local_c + 0x1c); *param_1 = *(undefined4 *)(local_c + 0x18); param_1[1] = uVar1; return; } *param_1 = 0; param_1[1] = 0xffffffff; return; } //@@ 007536f0 Entity::RenderZOffset /* ZHL [lua] Lua binding Entity:RenderZOffset */ int __thiscall Entity::RenderZOffset(Entity *this) { return this->_renderZOffset; } //@@ 00753700 FUN_00753700 undefined4 FUN_00753700(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x224); } //@@ 00753710 FUN_00753710 undefined4 FUN_00753710(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x220); } //@@ 00753720 FUN_00753720 void FUN_00753720(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x7ea) = 1; return; } //@@ 00753730 FUN_00753730 void FUN_00753730(void) { int in_ECX; undefined4 in_XMM1_Da; *(undefined4 *)(in_ECX + 0x838) = in_XMM1_Da; return; } //@@ 00753740 FUN_00753740 void FUN_00753740(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x83c) = param_1; return; } //@@ 00753750 FUN_00753750 void FUN_00753750(undefined4 *param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x410) = *param_1; *(undefined4 *)(in_ECX + 0x414) = param_1[1]; return; } //@@ 00753770 FUN_00753770 void FUN_00753770(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x466) = param_1; return; } //@@ 00753780 Level::GetHeartPicked /* ZHL [lua] Lua binding Level:GetHeartPicked */ byte __thiscall Level::GetHeartPicked(Level *this) { return this->_isHeartPicked; } //@@ 00753790 FUN_00753790 void FUN_00753790(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x10) = 0; return; } //@@ 007537a0 TemporaryEffects::GetEffectsList /* ZHL [lua] Lua binding TemporaryEffects:GetEffectsList */ int TemporaryEffects::GetEffectsList(void) { int in_ECX; return in_ECX + 4; } //@@ 007537b0 FUN_007537b0 void FUN_007537b0(void) { return; } //@@ 007537c0 Room::SetRedHeartDamage /* ZHL [lua] Lua binding Room:SetRedHeartDamage */ void __thiscall Room::SetRedHeartDamage(Room *this) { this->_redHeartDamage = 1; return; } //@@ 007537d0 Room::SetCardAgainstHumanity /* ZHL [lua] Lua binding Room:SetCardAgainstHumanity */ void Room::SetCardAgainstHumanity(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x11f4) = 1; return; } //@@ 007537e0 Room::GetDeliriumDistance /* ZHL [lua] Lua binding Room:GetDeliriumDistance */ undefined4 Room::GetDeliriumDistance(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return 0; } return *(undefined4 *)(*(int *)(in_ECX + 4) + 0xb0); } //@@ 007537f0 Level::GetDevilAngelRoomRNG /* ZHL [lua] Lua binding Level:GetDevilAngelRoomRNG */ RNG * __thiscall Level::GetDevilAngelRoomRNG(Level *this) { return &this->_devilAngelRoomRNG; } //@@ 00753800 FUN_00753800 void FUN_00753800(uint param_1) { uint uVar1; int in_ECX; param_1 = -(uint)(param_1 != 0) & param_1; uVar1 = 0xc; if (param_1 < 0xc) { uVar1 = param_1; } *(uint *)(in_ECX + 0x18334) = uVar1; return; } //@@ 00753830 FUN_00753830 void FUN_00753830(undefined4 *param_1,undefined4 *param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { undefined4 uVar1; undefined4 *in_ECX; uVar1 = *param_1; in_ECX[1] = param_1[1]; *in_ECX = uVar1; uVar1 = *param_2; in_ECX[3] = param_2[1]; in_ECX[4] = param_3; in_ECX[5] = param_4; in_ECX[6] = param_5; in_ECX[7] = param_6; in_ECX[2] = uVar1; return; } //@@ 00753870 FUN_00753870 void FUN_00753870(void) { return; } //@@ 00753880 FUN_00753880 void FUN_00753880(void) { return; } //@@ 00753890 FUN_00753890 void FUN_00753890(void) { return; } //@@ 007538a0 FUN_007538a0 void FUN_007538a0(void) { return; } //@@ 007538b0 FUN_007538b0 void FUN_007538b0(void) { return; } //@@ 007538c0 FUN_007538c0 void FUN_007538c0(void) { return; } //@@ 007538d0 FUN_007538d0 undefined1 FUN_007538d0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x6a); } //@@ 007538e0 FUN_007538e0 undefined4 FUN_007538e0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x98); } //@@ 007538f0 QueueItemData::Touched /* ZHL [lua] Lua binding QueueItemData:Touched */ byte QueueItemData::Touched(void) { int in_ECX; return *(byte *)(in_ECX + 8) & 1; } //@@ 00753900 Entity_Player::GetPocketItem /* ZHL [exact] __thiscall PocketItem* Entity_Player::GetPocketItem(int SlotID); prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall Entity_Player::GetPocketItem(Entity_Player *this,int SlotID) { int iVar1; if (SlotID < 1) { SlotID = 0; } iVar1 = 3; if (SlotID < 3) { iVar1 = SlotID; } return this->_pocketSlots + iVar1 * 2; } //@@ 00753930 Entity_Player::TearsOffset /* ZHL [lua] Lua binding EntityPlayer:TearsOffset */ Vector * __thiscall Entity_Player::TearsOffset(Entity_Player *this) { return &this->_tearsOffset; } //@@ 00753940 FUN_00753940 int FUN_00753940(void) { int in_ECX; if (*(int *)(in_ECX + 0x1678) == 0) { return in_ECX + 0x163c; } return *(int *)(*(int *)(in_ECX + 0x166c) + (*(int *)(in_ECX + 0x1670) - 1U & *(uint *)(in_ECX + 0x1674) >> 1) * 4) + (*(uint *)(in_ECX + 0x1674) & 1) * 8; } //@@ 00753980 Entity_Player::EnableWeaponType /* ZHL [exact] __thiscall void Entity_Player::EnableWeaponType(WeaponType weaponType, bool Set); */ void __thiscall Entity_Player::EnableWeaponType(Entity_Player *this,int param_2,undefined1 param_3) { *(undefined1 *)((int)this->_weapons + param_2 + 0x14) = param_3; return; } //@@ 007539a0 FUN_007539a0 void FUN_007539a0(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x13f0) = 0; *(undefined4 *)(in_ECX + 0x13f4) = 0; *(undefined4 *)(in_ECX + 0x13f8) = 0; *(undefined4 *)(in_ECX + 0x13fc) = 0; *(undefined1 *)(in_ECX + 0x1400) = 0; return; } //@@ 007539c0 Entity_Player::QueueExtraAnimation /* ZHL [lua] Lua binding EntityPlayer:QueueExtraAnimation */ void __thiscall Entity_Player::QueueExtraAnimation(Entity_Player *this,byte *param_2) { byte bVar1; byte *pbVar2; pbVar2 = param_2; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign((this->_queuedExtraAnimation)._buf,param_2,(int)pbVar2 - (int)(param_2 + 1)); return; } //@@ 007539f0 Entity_Player::CanShoot /* ZHL [lua] Lua binding EntityPlayer:CanShoot */ byte __thiscall Entity_Player::CanShoot(Entity_Player *this) { return this->_canShoot; } //@@ 00753a00 Entity_Player::GetPillRNG /* ZHL [lua] Lua binding EntityPlayer:GetPillRNG */ int Entity_Player::GetPillRNG(uint param_1) { uint uVar1; int in_ECX; if (((int)param_1 < 0) || (*(int *)(in_ECX + 0x178c) - *(int *)(in_ECX + 0x1788) >> 4 <= (int)param_1)) { KAGE_LogMessage(0x10,(byte *)"Pill ID out of bounds!\n"); } uVar1 = (*(int *)(in_ECX + 0x178c) - *(int *)(in_ECX + 0x1788) >> 4) - 1; param_1 = -(uint)(param_1 != 0) & param_1; if (param_1 < uVar1) { uVar1 = param_1; } return uVar1 * 0x10 + *(int *)(in_ECX + 0x1788); } //@@ 00753a60 Entity_Player::GetCardRNG /* ZHL [lua] Lua binding EntityPlayer:GetCardRNG */ int Entity_Player::GetCardRNG(uint param_1) { uint uVar1; int in_ECX; if (((int)param_1 < 0) || (*(int *)(in_ECX + 0x1798) - *(int *)(in_ECX + 0x1794) >> 4 <= (int)param_1)) { KAGE_LogMessage(0x10,(byte *)"Card ID out of bounds!\n"); } uVar1 = (*(int *)(in_ECX + 0x1798) - *(int *)(in_ECX + 0x1794) >> 4) - 1; param_1 = -(uint)(param_1 != 0) & param_1; if (param_1 < uVar1) { uVar1 = param_1; } return uVar1 * 0x10 + *(int *)(in_ECX + 0x1794); } //@@ 00753ac0 Entity_Player::IsSubPlayer /* ZHL [lua] Lua binding EntityPlayer:IsSubPlayer */ uint __thiscall Entity_Player::IsSubPlayer(Entity_Player *this) { return (uint)this->_playerIndex >> 0x1f; } //@@ 00753bf0 FUN_00753bf0 int FUN_00753bf0(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x1e68); uVar2 = (uint3)((uint)iVar1 >> 8); if ((iVar1 == 0) || (((*(int *)(iVar1 + 0x161c) != -1 && (*(int *)(iVar1 + 0x161c) < *(int *)(in_ECX + 0x161c))) && (iVar1 != in_ECX)))) { return (uint)uVar2 << 8; } return CONCAT31(uVar2,1); } //@@ 00753c20 Entity_Player::GetPoopMana /* ZHL [lua] Lua binding EntityPlayer:GetPoopMana */ int __thiscall Entity_Player::GetPoopMana(Entity_Player *this) { return this->_poopMana; } //@@ 00753c30 Entity_Player::HasCurseMistEffect /* ZHL [lua] Lua binding EntityPlayer:HasCurseMistEffect */ byte __thiscall Entity_Player::HasCurseMistEffect(Entity_Player *this) { return this->_hasCurseMistEffect; } //@@ 00753c40 FUN_00753c40 void FUN_00753c40(uint param_1) { int in_ECX; *(uint *)(in_ECX + 0x24) = *(uint *)(in_ECX + 0x24) | param_1; return; } //@@ 00753c50 Game::SetLastLevelWithDamage /* ZHL [lua] Lua binding Game:SetLastLevelWithDamage */ void __thiscall Game::SetLastLevelWithDamage(Game *this,int param_2) { int iVar1; if (param_2 < 1) { param_2 = 0; } iVar1 = 0xd; if (param_2 < 0xd) { iVar1 = param_2; } this->_lastLevelWithDamage = iVar1; return; } //@@ 00753c80 Game::SetLastLevelWithoutHalfHp /* ZHL [lua] Lua binding Game:SetLastLevelWithoutHalfHp */ void __thiscall Game::SetLastLevelWithoutHalfHp(Game *this,int param_2) { int iVar1; if (param_2 < 1) { param_2 = 0; } iVar1 = 0xd; if (param_2 < 0xd) { iVar1 = param_2; } this->_lastLevelWithoutHalfHp = iVar1; return; } //@@ 00753cb0 Game::GetLastLevelWithoutHalfHp /* ZHL [lua] Lua binding Game:GetLastLevelWithoutHalfHp */ int __thiscall Game::GetLastLevelWithoutHalfHp(Game *this) { return this->_lastLevelWithoutHalfHp; } //@@ 00753cc0 Game::AddPixelation /* ZHL [lua] Lua binding Game:AddPixelation */ void __thiscall Game::AddPixelation(Game *this,int param_2) { int iVar1; int *piVar2; piVar2 = ¶m_2; if (param_2 <= this->_pixelationTimer) { piVar2 = &this->_pixelationTimer; } iVar1 = *piVar2; this->_pixelationTimer = iVar1; this->_pixelationDuration = iVar1; return; } //@@ 00753d00 Game::ShowRule /* ZHL [lua] Lua binding Game:ShowRule */ void __thiscall Game::ShowRule(Game *this) { ShowFortuneText(&this->_fortuneRNG,(byte *)"Fortune_Rules"); return; } //@@ 00753d20 FUN_00753d20 byte FUN_00753d20(void) { byte extraout_var; FUN_0060d780(); return extraout_var >> 7 ^ 1; } //@@ 00753d30 FUN_00753d30 undefined4 FUN_00753d30(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0xd4c); } //@@ 00753d40 FUN_00753d40 void FUN_00753d40(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd4c) = param_1; return; } //@@ 00753d50 FUN_00753d50 undefined4 FUN_00753d50(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x3d0); } //@@ 00753d60 FUN_00753d60 uint FUN_00753d60(uint *param_1) { uint uVar1; uVar1 = *param_1; if ((((uVar1 == 1) || (uVar1 == 3)) || (uVar1 == 4)) && ((uVar1 = param_1[0x2e] & 0x1000000, uVar1 == 0 || ((int)param_1[0x30] < 3)))) { return uVar1; } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 00753da0 Entity_Player::constructor /* DB: sets Entity_Player vftable prototype: REPENTOGON */ void __thiscall Entity_Player::constructor(Entity_Player *this) { undefined1 *puVar1; ActiveItemDesc *activeDesc; int *containerProxy; undefined4 *puVar2; void *sentinelNode; int remaining; void *local_1c; undefined1 *puStack_18; undefined4 local_14; std_deque *deque; std_set *proceduralItemIds; local_14 = 0xffffffff; puStack_18 = &LAB_00afe9e2; local_1c = ExceptionList; ExceptionList = &local_1c; Entity::constructor((Entity *)this); local_14 = 0; *(undefined ***)this = IsaacRepentancePlus::Entity_Player::vftable; ANM2::constructor(&this->_bodySprite); local_14._0_1_ = 1; ANM2::constructor(&this->_crownOfLightSprite); local_14._0_1_ = 2; ANM2::constructor(&this->_darkPrincesCrownSprite); local_14._0_1_ = 3; _eh_vector_constructor_iterator_(this->_chargeBarSprites,0x114,7,ANM2::constructor,ANM2::~ANM2); local_14._0_1_ = 4; ANM2::constructor(&this->_bloodGushSprite); local_14._0_1_ = 5; ANM2::constructor(&this->_heldSprite); local_14._0_1_ = 6; ANM2::constructor(&this->_statusEffectSprite); (this->_costumeSpriteDescs)._begin = (void *)0x0; (this->_costumeSpriteDescs)._end = (void *)0x0; (this->_costumeSpriteDescs)._capacity = (void *)0x0; (this->_headAnim)._buf[0] = '\0'; (this->_headAnim)._buf[1] = '\0'; (this->_headAnim)._buf[2] = '\0'; (this->_headAnim)._buf[3] = '\0'; (this->_headAnim)._size = 0; (this->_headAnim)._capacity = 0xf; (this->_headAnim)._buf[0] = '\0'; (this->_queuedExtraAnimation)._buf[0] = '\0'; (this->_queuedExtraAnimation)._buf[1] = '\0'; (this->_queuedExtraAnimation)._buf[2] = '\0'; (this->_queuedExtraAnimation)._buf[3] = '\0'; (this->_queuedExtraAnimation)._size = 0; (this->_queuedExtraAnimation)._capacity = 0xf; (this->_queuedExtraAnimation)._buf[0] = '\0'; (this->_name)._buf[0] = '\0'; (this->_name)._buf[1] = '\0'; (this->_name)._buf[2] = '\0'; (this->_name)._buf[3] = '\0'; (this->_name)._size = 0; (this->_name)._capacity = 0xf; (this->_name)._buf[0] = '\0'; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; (this->_tearColor)._tint[0] = 1.0; (this->_tearColor)._tint[1] = 1.0; (this->_tearColor)._tint[2] = 1.0; (this->_tearColor)._tint[3] = 1.0; (this->_tearColor)._colorize[0] = 0.0; (this->_tearColor)._colorize[1] = 0.0; (this->_tearColor)._colorize[2] = 0.0; (this->_tearColor)._colorize[3] = 0.0; (this->_tearColor)._offset[0] = 0.0; (this->_tearColor)._offset[1] = 0.0; (this->_tearColor)._offset[2] = 0.0; (this->_laserColor)._tint[0] = 1.0; (this->_laserColor)._tint[1] = 1.0; (this->_laserColor)._tint[2] = 1.0; (this->_laserColor)._tint[3] = 1.0; (this->_laserColor)._colorize[0] = 0.0; (this->_laserColor)._colorize[1] = 0.0; (this->_laserColor)._colorize[2] = 0.0; (this->_laserColor)._colorize[3] = 0.0; (this->_laserColor)._offset[0] = 0.0; (this->_laserColor)._offset[1] = 0.0; (this->_laserColor)._offset[2] = 0.0; (this->_playerSpriteScale).y = 0.0; (this->_playerSpriteScale).x = 0.0; (this->_bodyScale).y = 0.0; (this->_bodyScale).x = 0.0; (this->_headScale).y = 0.0; (this->_headScale).x = 0.0; (this->_temporaryeffects)._effects._begin = (void *)0x0; (this->_temporaryeffects)._effects._end = (void *)0x0; (this->_temporaryeffects)._effects._capacity = (void *)0x0; (this->_temporaryeffects)._cacheFlags = 0; (this->_temporaryeffects)._shouldEvaluateCache = 0; (this->_temporaryeffects)._disabled = 0; (this->_temporaryeffects)._player = this; local_14._0_1_ = 0xc; remaining = 4; activeDesc = this->_activeDesc; do { activeDesc->_item = 0; activeDesc->_unk = 0; activeDesc->_charge = 0; activeDesc->_batteryCharge = 0; activeDesc->_subCharge = 0; activeDesc->_timeRechargeCooldown = 0; activeDesc->_partialCharge = 0; activeDesc->_varData = 0; remaining = remaining + -1; activeDesc = activeDesc + 1; } while (remaining != 0); this->_controllerIndex = -1; puVar1 = &this->field_0x1668; this->_playerIndex = -1; this->_glowingHourglassIndex = -1; (this->_aimDirection).y = 0.0; (this->_aimDirection).x = 0.0; (this->_lastDirection).y = 0.0; (this->_lastDirection).x = 0.0; (this->_movementVector).y = 0.0; (this->_movementVector).x = 0.0; (this->_tearsOffset).y = 0.0; (this->_tearsOffset).x = 0.0; (this->_recentMovementVector).y = 0.0; (this->_recentMovementVector).x = 0.0; (this->_lastVelocity).y = 0.0; (this->_lastVelocity).x = 0.0; *(undefined4 *)puVar1 = 0; *(undefined4 *)&this->field_0x166c = 0; *(undefined4 *)&this->field_0x1670 = 0; *(undefined4 *)&this->field_0x1674 = 0; *(undefined4 *)&this->field_0x1678 = 0; containerProxy = operator_new(8); containerProxy[1] = 0; *(int **)puVar1 = containerProxy; *containerProxy = (int)puVar1; (this->_lastDamageSource)._type = 0; (this->_lastDamageSource)._variant = 0; (this->_lastDamageSource)._spawnerType = 0; (this->_lastDamageSource)._spawnerVariant = 0; (this->_lastDamageSource)._position.x = g_vectorZero.x; (this->_lastDamageSource)._position.y = g_vectorZero.y; (this->_lastDamageSource)._velocity.x = g_vectorZero.x; (this->_lastDamageSource)._velocity.y = g_vectorZero.y; (this->_lastDamageSource)._flags = 0; (this->_lastDamageSource)._entity = (void *)0x0; (this->_collectibleCounts)._begin = (void *)0x0; (this->_collectibleCounts)._end = (void *)0x0; (this->_collectibleCounts)._capacity = (void *)0x0; (this->_pillEffectUses)._begin = (void *)0x0; (this->_pillEffectUses)._end = (void *)0x0; (this->_pillEffectUses)._capacity = (void *)0x0; *(undefined4 *)&this->field_0x16e0 = 0x3f800000; *(undefined4 *)&this->field_0x16e4 = 0x3f800000; *(undefined4 *)&this->field_0x16e8 = 0x3f800000; *(undefined4 *)&this->field_0x16ec = 0x3f800000; *(undefined4 *)&this->field_0x16f0 = 0; *(undefined4 *)&this->field_0x16f4 = 0; *(undefined4 *)&this->field_0x16f8 = 0; *(undefined4 *)&this->field_0x16fc = 0; *(undefined4 *)&this->field_0x1700 = 0; *(undefined4 *)&this->field_0x1704 = 0; *(undefined4 *)&this->field_0x1708 = 0; *(undefined4 *)&this->field_0x170c = 0x3f800000; *(undefined4 *)&this->field_0x1710 = 0x3f800000; *(undefined4 *)&this->field_0x1714 = 0x3f800000; *(undefined4 *)&this->field_0x1718 = 0x3f800000; *(undefined4 *)&this->field_0x171c = 0; *(undefined4 *)&this->field_0x1720 = 0; *(undefined4 *)&this->field_0x1724 = 0; *(undefined4 *)&this->field_0x1728 = 0; *(undefined4 *)&this->field_0x172c = 0; *(undefined4 *)&this->field_0x1730 = 0; *(undefined4 *)&this->field_0x1734 = 0; (this->_levelEffectItems)._begin = (void *)0x0; (this->_levelEffectItems)._end = (void *)0x0; (this->_levelEffectItems)._capacity = (void *)0x0; (this->_smeltedTrinkets)._begin = (void *)0x0; (this->_smeltedTrinkets)._end = (void *)0x0; (this->_smeltedTrinkets)._capacity = (void *)0x0; (this->_voidedCollectibles)._begin = (void *)0x0; (this->_voidedCollectibles)._end = (void *)0x0; (this->_voidedCollectibles)._capacity = (void *)0x0; (this->_voidedPassives)._begin = (void *)0x0; (this->_voidedPassives)._end = (void *)0x0; (this->_voidedPassives)._capacity = (void *)0x0; (this->_collectibleRNGs)._begin = (void *)0x0; (this->_collectibleRNGs)._end = (void *)0x0; (this->_collectibleRNGs)._capacity = (void *)0x0; (this->_trinketRNGs)._begin = (void *)0x0; (this->_trinketRNGs)._end = (void *)0x0; (this->_trinketRNGs)._capacity = (void *)0x0; (this->_pillRNGs)._begin = (void *)0x0; (this->_pillRNGs)._end = (void *)0x0; (this->_pillRNGs)._capacity = (void *)0x0; (this->_cardRNGs)._begin = (void *)0x0; (this->_cardRNGs)._end = (void *)0x0; (this->_cardRNGs)._capacity = (void *)0x0; local_14._0_1_ = 0x17; this->_playerFormsRewarded = 0; remaining = 4; (this->_footprintColor1)._tint[0] = 1.0; (this->_footprintColor1)._tint[1] = 1.0; (this->_footprintColor1)._tint[2] = 1.0; (this->_footprintColor1)._tint[3] = 1.0; (this->_footprintColor1)._colorize[0] = 0.0; (this->_footprintColor1)._colorize[1] = 0.0; (this->_footprintColor1)._colorize[2] = 0.0; (this->_footprintColor1)._colorize[3] = 0.0; (this->_footprintColor1)._offset[0] = 0.0; (this->_footprintColor1)._offset[1] = 0.0; (this->_footprintColor1)._offset[2] = 0.0; (this->_footprintColor2)._tint[0] = 1.0; (this->_footprintColor2)._tint[1] = 1.0; (this->_footprintColor2)._tint[2] = 1.0; (this->_footprintColor2)._tint[3] = 1.0; (this->_footprintColor2)._colorize[0] = 0.0; (this->_footprintColor2)._colorize[1] = 0.0; (this->_footprintColor2)._colorize[2] = 0.0; (this->_footprintColor2)._colorize[3] = 0.0; (this->_footprintColor2)._offset[0] = 0.0; (this->_footprintColor2)._offset[1] = 0.0; (this->_footprintColor2)._offset[2] = 0.0; (this->_friendBallEnemy)._type = 0; (this->_friendBallEnemy)._variant = 0; (this->_friendBallEnemy)._subtype = 0; (this->_friendBallEnemy)._championId = -1; (this->_friendBallEnemy)._health = 0.0; (this->_friendBallEnemy)._maxHealth = 0.0; (this->_friendBallEnemy)._playerControlled = 0; puVar2 = (undefined4 *)&this->field_0x1af0; do { puVar2[1] = 0; *puVar2 = 0; remaining = remaining + -1; puVar2 = puVar2 + 2; } while (remaining != 0); (this->_moveToTarget).y = 0.0; (this->_moveToTarget).x = 0.0; FUN_008391a0(); local_14._0_1_ = 0x18; FUN_008391a0(); (this->_movingBoxContents)._begin = (void *)0x0; (this->_movingBoxContents)._end = (void *)0x0; (this->_movingBoxContents)._capacity = (void *)0x0; this->_subPlayer = 0; (this->_pendingWisps)._begin = (void *)0x0; (this->_pendingWisps)._end = (void *)0x0; (this->_pendingWisps)._capacity = (void *)0x0; (this->_history)._historyItems._begin = (void *)0x0; (this->_history)._historyItems._capacity = (void *)0x0; (this->_history)._isLocked = 0; (this->_history)._player = this; (this->_history)._historyItems._end = (void *)0x0; this->_inventory[0] = -1; this->_inventory[1] = -1; this->_inventory[2] = -1; this->_inventory[3] = -1; this->_inventory[4] = -1; this->_inventory[5] = -1; this->_inventory[6] = -1; this->_inventory[7] = -1; this->_inventory[8] = -1; this->_inventory[9] = -1; this->_inventory[10] = -1; this->_inventory[0xb] = -1; this->_inventory[0xc] = -1; this->_inventory[0xd] = -1; this->_inventory[0xe] = -1; this->_inventory[0xf] = -1; (this->_contactHitList)._begin = (void *)0x0; (this->_contactHitList)._end = (void *)0x0; (this->_contactHitList)._capacity = (void *)0x0; *(undefined4 *)&this->field_0x1e50 = 0; this->_userProfile = KAGE::System::UserProfile::vftable; local_14._0_1_ = 0x1e; deque = &this->_afterImageFrames; deque->_proxy = (void *)0x0; (this->_afterImageFrames)._map = (void *)0x0; (this->_afterImageFrames)._mapSize = 0; (this->_afterImageFrames)._offset = 0; (this->_afterImageFrames)._size = 0; containerProxy = operator_new(8); containerProxy[1] = 0; deque->_proxy = containerProxy; *containerProxy = (int)deque; this->_twinPlayer = (EntityPtr)0x0; this->_backupPlayer = (void *)0x0; *(undefined4 *)&this->field_0x1e84 = 0; local_14._0_1_ = 0x21; deque = &this->_echoChamberItems; this->_marsUnk1 = 0x5a; this->_marsCooldown = 0; this->_marsUnk2 = -1; this->_marsUnkBool = 1; (this->_forgottenBodyPos).y = 0.0; (this->_forgottenBodyPos).x = 0.0; deque->_proxy = (void *)0x0; (this->_echoChamberItems)._map = (void *)0x0; (this->_echoChamberItems)._mapSize = 0; (this->_echoChamberItems)._offset = 0; (this->_echoChamberItems)._size = 0; containerProxy = operator_new(8); containerProxy[1] = 0; deque->_proxy = containerProxy; *containerProxy = (int)deque; local_14._0_1_ = 0x22; (this->_suplexTargetPos).y = 0.0; (this->_suplexTargetPos).x = 0.0; (this->_suplexLandPos).y = 0.0; (this->_suplexLandPos).x = 0.0; this->_bagOfCraftingOutput = 0; *(undefined4 *)&this->field_0x1f50 = 0xffffffff; (this->_itemWispsList)._head = (void *)0x0; (this->_itemWispsList)._size = 0; sentinelNode = operator_new(0x18); *(void **)sentinelNode = sentinelNode; *(void **)((int)sentinelNode + 4) = sentinelNode; *(void **)((int)sentinelNode + 8) = sentinelNode; *(undefined2 *)((int)sentinelNode + 0xc) = 0x101; (this->_itemWispsList)._head = sentinelNode; (this->_itemCards)._begin = (void *)0x0; (this->_itemCards)._end = (void *)0x0; (this->_itemCards)._capacity = (void *)0x0; local_14._0_1_ = 0x24; (this->_roomTemporaryCollectibles)._head = (void *)0x0; (this->_roomTemporaryCollectibles)._size = 0; sentinelNode = operator_new(0x18); *(void **)sentinelNode = sentinelNode; *(void **)((int)sentinelNode + 4) = sentinelNode; *(void **)((int)sentinelNode + 8) = sentinelNode; *(undefined2 *)((int)sentinelNode + 0xc) = 0x101; (this->_roomTemporaryCollectibles)._head = sentinelNode; local_14._0_1_ = 0x25; proceduralItemIds = &(this->_proceduralItems)._itemIds; proceduralItemIds->_head = (void *)0x0; (this->_proceduralItems)._itemIds._size = 0; sentinelNode = operator_new(0x18); *(void **)sentinelNode = sentinelNode; *(void **)((int)sentinelNode + 4) = sentinelNode; *(void **)((int)sentinelNode + 8) = sentinelNode; *(undefined2 *)((int)sentinelNode + 0xc) = 0x101; proceduralItemIds->_head = sentinelNode; (this->_extraCollectibleCounts)._begin = (void *)0x0; (this->_extraCollectibleCounts)._end = (void *)0x0; (this->_extraCollectibleCounts)._capacity = (void *)0x0; (this->_extraTrinketCounts)._begin = (void *)0x0; (this->_extraTrinketCounts)._end = (void *)0x0; (this->_extraTrinketCounts)._capacity = (void *)0x0; (this->_proceduralItems)._player = (void *)0x0; (this->_darkArtsHitList)._begin = (void *)0x0; (this->_darkArtsHitList)._end = (void *)0x0; (this->_darkArtsHitList)._capacity = (void *)0x0; this->_shadowImage[0] = 0; this->_shadowImage[1] = 0; this->_shadowImage[2] = 0; this->_shadowImage[3] = 0; this->_shadowImage[4] = 0; this->_shadowImage[5] = 0; this->_shadowImage[6] = 0; this->_shadowImage[7] = 0; (this->_consumablesBackup).coins = 0; (this->_consumablesBackup).keys = 0; (this->_consumablesBackup).bombs = 0; (this->_consumablesBackup).goldkey = 0; (this->_consumablesBackup).goldbomb = 0; (this->_consumablesBackup).soulcharges = 0; (this->_consumablesBackup).gigabombs = 0; (this->_consumablesBackup).poopmana = 0; (this->_consumablesBackup).bloodcharges = 0; (this->_curseMistFamiliars)._begin = (void *)0x0; (this->_curseMistFamiliars)._end = (void *)0x0; (this->_curseMistFamiliars)._capacity = (void *)0x0; (this->_minecartOffset).y = 0.0; (this->_minecartOffset).x = 0.0; *(undefined2 *)&this->field_0x20a8 = 1; this->_playerHUD = (void *)0x0; *(undefined4 *)&this->field_0x20d8 = 0; (this->_greedResetCollectibles)._begin = (void *)0x0; (this->_greedResetCollectibles)._end = (void *)0x0; (this->_greedResetCollectibles)._capacity = (void *)0x0; local_14._0_1_ = 0x2b; input_state_reset(&this->_unlistedRestoreState); local_14 = CONCAT31(local_14._1_3_,0x2c); this->_replacedPlayer = (void *)0x0; OnlineEmotes::constructor(); this[1]._chargeBarSprites[0]._color._colorize[2] = 0.0; this[1]._chargeBarSprites[0]._color._colorize[3] = 0.0; this[1]._chargeBarSprites[0]._color._offset[0] = 0.0; *(undefined1 *)(this[1]._chargeBarSprites[0]._color._offset + 1) = 1; this[1]._chargeBarSprites[0]._color._offset[2] = 0.0; this[1]._chargeBarSprites[0]._championColor._tint[0] = 0.0; ExceptionList = local_1c; return; } //@@ 00754980 input_state_reset /* DB: ? zeroes a controller/input state block: 4 x 0x18 entries at +0x8c (id -1), fields 0xec-0x1ac; called from Entity_Player::constructor, 00906100 and 0090c7e0 NetplayManager::restore_player_state to find input device for UserId") prototype: db/protos.zhl */ void __thiscall input_state_reset(void *this) { undefined4 *puVar1; undefined4 *puVar2; void *pvVar3; int iVar4; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined3 uStack_7; puStack_c = &LAB_00afeb39; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = 4; puVar1 = (undefined4 *)((int)this + 0x8c); do { *puVar1 = 0; puVar1[1] = 0xffffffff; puVar1[2] = 0; puVar1[3] = 0; puVar1[4] = 0; puVar1[5] = 0; iVar4 = iVar4 + -1; puVar1 = puVar1 + 6; } while (iVar4 != 0); *(undefined4 *)((int)this + 0xf0) = 0; *(undefined4 *)((int)this + 0xec) = 0; *(undefined4 *)((int)this + 0xf8) = 0; *(undefined4 *)((int)this + 0xf4) = 0; *(undefined4 *)((int)this + 0x100) = 0; *(undefined4 *)((int)this + 0xfc) = 0; *(undefined4 *)((int)this + 0x164) = 0; *(undefined4 *)((int)this + 0x168) = 0; *(undefined4 *)((int)this + 0x16c) = 0; *(undefined4 *)((int)this + 0x170) = 0; *(undefined4 *)((int)this + 0x174) = 0; *(undefined4 *)((int)this + 0x178) = 0; *(undefined4 *)((int)this + 0x17c) = 0; *(undefined4 *)((int)this + 0x180) = 0; *(undefined4 *)((int)this + 0x184) = 0; *(undefined4 *)((int)this + 0x188) = 0; *(undefined4 *)((int)this + 0x194) = 0; *(undefined4 *)((int)this + 0x198) = 0; *(undefined4 *)((int)this + 0x19c) = 0; *(undefined4 *)((int)this + 0x1a0) = 0; *(undefined4 *)((int)this + 0x1a4) = 0; *(undefined4 *)((int)this + 0x1a8) = 0; *(undefined4 *)((int)this + 0x1ac) = 0; *(undefined4 *)((int)this + 0x1b0) = 0; *(undefined4 *)((int)this + 0x1b4) = 0; *(undefined4 *)((int)this + 0x1b8) = 0; *(undefined4 *)((int)this + 0x1bc) = 0; *(undefined4 *)((int)this + 0x1c0) = 0; *(undefined4 *)((int)this + 0x1c4) = 0; *(undefined4 *)((int)this + 0x1c8) = 0; *(undefined4 *)((int)this + 0x1cc) = 0; *(undefined4 *)((int)this + 0x1d4) = 0; *(undefined4 *)((int)this + 0x1d8) = 0; *(undefined4 *)((int)this + 0x1dc) = 0; *(undefined4 *)((int)this + 0x1e0) = 0; *(undefined4 *)((int)this + 0x1e4) = 0; *(undefined4 *)((int)this + 0x1e8) = 0; *(undefined4 *)((int)this + 0x210) = 0; *(undefined4 *)((int)this + 0x214) = 0; *(undefined4 *)((int)this + 0x218) = 0; *(undefined4 *)((int)this + 0x220) = 0; *(undefined4 *)((int)this + 0x224) = 0; *(undefined1 *)((int)this + 0x228) = 0; iVar4 = 10; *(undefined4 *)((int)this + 0x21c) = 0xffffffff; puVar1 = (undefined4 *)((int)this + 0x230); do { *puVar1 = 0; puVar1[1] = 0; puVar1[2] = 0; puVar1[3] = 0xffffffff; puVar1[4] = 0; puVar1[5] = 0; *(undefined1 *)(puVar1 + 6) = 0; iVar4 = iVar4 + -1; puVar1 = puVar1 + 7; } while (iVar4 != 0); *(undefined4 *)((int)this + 0x380) = 0; *(undefined4 *)((int)this + 900) = 0; *(undefined4 *)((int)this + 0x388) = 0; *(undefined4 *)((int)this + 0x38c) = 0; *(undefined4 *)((int)this + 0x390) = 0; *(undefined4 *)((int)this + 0x394) = 0; *(undefined4 *)((int)this + 0x39c) = 0; *(undefined4 *)((int)this + 0x3a0) = 0; *(undefined4 *)((int)this + 0x3a4) = 0; *(undefined4 *)((int)this + 0x3a8) = 0; *(undefined4 *)((int)this + 0x3ac) = 0; *(undefined4 *)((int)this + 0x3b0) = 0; *(undefined4 *)((int)this + 0x3b4) = 0; *(undefined4 *)((int)this + 0x3bc) = 0; *(undefined4 *)((int)this + 0x3c0) = 0; *(undefined4 *)((int)this + 0x3c4) = 0; *(undefined4 *)((int)this + 0x414) = 0; *(undefined4 *)((int)this + 0x418) = 0; *(undefined4 *)((int)this + 0x41c) = 0; *(undefined4 *)((int)this + 0x424) = 0; *(undefined4 *)((int)this + 0x428) = 0; *(undefined4 *)((int)this + 0x42c) = 0; uStack_7 = 0; local_8 = 0xe; puVar1 = (undefined4 *)((int)this + 0x4b0); *(undefined4 *)((int)this + 0x4a4) = 0; *(undefined4 *)((int)this + 0x4a0) = 0; *puVar1 = 0; *(undefined4 *)((int)this + 0x4b4) = 0; *(undefined4 *)((int)this + 0x4b8) = 0; *(undefined4 *)((int)this + 0x4bc) = 0; *(undefined4 *)((int)this + 0x4c0) = 0; puVar2 = operator_new(8); puVar2[1] = 0; *puVar1 = puVar2; *puVar2 = puVar1; *(undefined4 *)((int)this + 0x4c4) = 0; *(undefined4 *)((int)this + 0x4c8) = 0; *(undefined4 *)((int)this + 0x4cc) = 0; *(undefined4 *)((int)this + 0x4d0) = 0; *(undefined4 *)((int)this + 0x4d4) = 0xffffffff; *(undefined4 *)((int)this + 0x4dc) = 0; *(undefined4 *)((int)this + 0x4e0) = 0; *(undefined4 *)((int)this + 0x4e4) = 0; *(undefined4 *)((int)this + 0x4e8) = 0; *(undefined4 *)((int)this + 0x4ec) = 0; *(undefined4 *)((int)this + 0x4f0) = 0; *(undefined4 *)((int)this + 0x500) = 0; *(undefined4 *)((int)this + 0x504) = 0; *(undefined4 *)((int)this + 0x508) = 0; *(undefined4 *)((int)this + 0x518) = 0; *(undefined4 *)((int)this + 0x51c) = 0; *(undefined4 *)((int)this + 0x520) = 0; *(undefined4 *)((int)this + 0x538) = 0; *(undefined4 *)((int)this + 0x53c) = 0; *(undefined4 *)((int)this + 0x540) = 0; *(undefined2 *)((int)this + 0x544) = 0; *(undefined4 *)((int)this + 0x548) = 0; *(undefined4 *)((int)this + 0x54c) = 0; *(undefined4 *)((int)this + 0x550) = 0; *(undefined4 *)((int)this + 0x554) = 0; *(undefined4 *)((int)this + 0x558) = 0; *(undefined4 *)((int)this + 0x55c) = 0; *(undefined4 *)((int)this + 0x560) = 0; _local_8 = CONCAT31(uStack_7,0x15); *(undefined4 *)((int)this + 0x5d4) = 0; *(undefined4 *)((int)this + 0x5d8) = 0; pvVar3 = operator_new(0x18); *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; *(undefined2 *)((int)pvVar3 + 0xc) = 0x101; *(undefined4 *)((int)this + 0x5d4) = pvVar3; ExceptionList = local_10; return; } //@@ 00754d60 Entity_Player::Free /* DB: vtable slot 0 of Entity_Player; slot name from Entity */ Entity_Player * __thiscall Entity_Player::Free(Entity_Player *this,byte param_2) { ~Entity_Player(this); if ((param_2 & 1) != 0) { operator_delete(this,0x2f00); } return this; } //@@ 00754d90 GameStatePlayer::~GameStatePlayer /* DB: member dtor chain (trees, deques, vectors up to +0x5d4); called from Entity_Player::~Entity_Player (00754ed0) and from 00906100 / 0090c7e0 NetplayManager::restore_player_state a local GameStatePlayer after GameStatePlayer::Init + Entity_Player::StoreGameState prototype: db/protos.zhl */ void __thiscall GameStatePlayer::~GameStatePlayer(GameStatePlayer *this) { GameStatePlayer *this_00; GameStatePlayer ptr; this_00 = this + 0x175; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)this[0x175] + 4)); operator_delete((void *)*this_00,0x18); std::vector<52byte>::_Tidy(); FUN_004b3950(); FID_conflict__Tidy(this + 0x140); FUN_007dcd30(); FUN_007dcd30(); FUN_007dcd30(); std::deque::_Tidy(); ptr = this[300]; this[300] = (GameStatePlayer)0x0; operator_delete((void *)ptr,8); FID_conflict__Tidy(this + 0x109); FUN_004b3950(); std::vector<28byte>::_Tidy(); std::vector<28byte>::_Tidy(); std::vector<52byte>::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); FID_conflict__Tidy(this + 0x71); FID_conflict__Tidy(this + 0x6e); FID_conflict__Tidy(this + 0x6b); FID_conflict__Tidy(this + 0x68); FID_conflict__Tidy(this + 0x65); std::vector::_Tidy(); FID_conflict__Tidy(this + 0x5d); FID_conflict__Tidy(this + 0x5a); return; } //@@ 00754ed0 Entity_Player::~Entity_Player /* DB: destructor body: vtable IsaacRepentancePlus::Entity_Player, 16 AnimationState dtors, 8 ANM2::Reset, GameStatePlayer::~GameStatePlayer, OnlineEmotes::destructor, deques, ends with Entity::destructor; only caller Entity_Player::Free prototype: db/protos.zhl */ void __thiscall Entity_Player::~Entity_Player(Entity_Player *this) { EntityPtr *pEVar1; std_set *this_00; std_map *psVar2; undefined1 *puVar3; int *piVar4; char isLastRef; uint uVar5; Entity_Player *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; void *oldBlock; local_8 = 0xffffffff; puStack_c = &LAB_00afeb60; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pEVar1 = &this->_twinPlayer; *(undefined ***)this = IsaacRepentancePlus::Entity_Player::vftable; local_14 = this; if (this->_twinPlayer != (EntityPtr)0x0) { (**(code **)(*(int *)this->_twinPlayer + 0x44))(uVar5); if (*pEVar1 != (EntityPtr)0x0) { local_14 = (Entity_Player *)pEVar1; std::multiset::erase(&local_14); *pEVar1 = (EntityPtr)0x0; } } piVar4 = (int *)this->_subPlayer; if ((piVar4 != (int *)0x0) && ((char)piVar4[0x5c] == '\0')) { (**(code **)(*piVar4 + 0x44))(); if ((undefined4 *)this->_subPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_subPlayer)(1); } this->_subPlayer = 0; } game = g_game; if (g_game != (Game *)0x0) { if ((g_game->_playerManager)._stageTransitionPlayer == this) { (g_game->_playerManager)._stageTransitionPlayer = (void *)0x0; } if ((game->_playerManager)._roomTransitionPlayer == this) { (game->_playerManager)._roomTransitionPlayer = (void *)0x0; } } FID_conflict__Tidy(this[1]._chargeBarSprites[0]._color._colorize + 2); OnlineEmotes::destructor(&this[1]._damageEvents._end); GameStatePlayer::~GameStatePlayer(&this->_unlistedRestoreState); FID_conflict__Tidy(&this->_greedResetCollectibles); local_8 = 0; if (*(int **)&this->field_0x20d8 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this->field_0x20d8 + 0xc))(); if ((isLastRef != '\0') && (DAT_00c7f480 != (code *)0x0)) { (*DAT_00c7f480)(&this->_playerHUD); } } std::vector<52byte>::_Tidy(); local_8 = 1; if (*(int **)(this->_shadowImage + 4) != (int *)0x0) { isLastRef = (**(code **)(**(int **)(this->_shadowImage + 4) + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(this->_shadowImage); } } FID_conflict__Tidy(&this->_darkArtsHitList); FUN_007dcd30(); FUN_007dcd30(); this_00 = &(this->_proceduralItems)._itemIds; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)(this->_proceduralItems)._itemIds._head + 4)) ; operator_delete(this_00->_head,0x18); psVar2 = &this->_roomTemporaryCollectibles; FID_conflict__Erase_tree_>_> (psVar2,(fuzzer_allocator_> *)psVar2, *(_Tree_node **)((int)(this->_roomTemporaryCollectibles)._head + 4) ); operator_delete(psVar2->_head,0x18); FID_conflict__Tidy(&this->_itemCards); psVar2 = &this->_itemWispsList; FID_conflict__Erase_tree_>_> (psVar2,(fuzzer_allocator_> *)psVar2, *(_Tree_node **)((int)(this->_itemWispsList)._head + 4)); operator_delete(psVar2->_head,0x18); std::deque::_Tidy(); oldBlock = (this->_echoChamberItems)._proxy; (this->_echoChamberItems)._proxy = (void *)0x0; operator_delete(oldBlock,8); puVar3 = &this->field_0x1e84; if (*(int *)puVar3 != 0) { local_14 = (Entity_Player *)puVar3; std::multiset::erase(&local_14); *(undefined4 *)puVar3 = 0; } if (*pEVar1 != (EntityPtr)0x0) { local_14 = (Entity_Player *)pEVar1; std::multiset::erase(&local_14); *pEVar1 = (EntityPtr)0x0; } std::deque<12byte>::_Tidy(); oldBlock = (this->_afterImageFrames)._proxy; (this->_afterImageFrames)._proxy = (void *)0x0; operator_delete(oldBlock,8); this->_userProfile = KAGE::System::UserProfileBase::vftable; FID_conflict__Tidy(&this->_contactHitList); std::vector<28byte>::_Tidy(); FID_conflict__Tidy(&this->_pendingWisps); std::vector::_Tidy(); local_8 = 4; ANM2::Reset((ANM2 *)&this->field_0x1c64); AnimationState::~AnimationState((AnimationState *)&this->field_0x1cb4); AnimationState::~AnimationState((AnimationState *)&this->field_0x1c94); std::string::_Tidy_deallocate(&this->field_0x1c7c); std::string::_Tidy_deallocate(&this->field_0x1c64); FUN_00839960(); local_8 = 5; ANM2::Reset((ANM2 *)&this->field_0x1b40); AnimationState::~AnimationState((AnimationState *)&this->field_0x1b90); AnimationState::~AnimationState((AnimationState *)&this->field_0x1b70); std::string::_Tidy_deallocate(&this->field_0x1b58); std::string::_Tidy_deallocate(&this->field_0x1b40); FUN_00839960(); FUN_004b3950(); FUN_004b3950(); FUN_004b3950(); FUN_004b3950(); std::vector::_Tidy(); FID_conflict__Tidy(&this->_voidedCollectibles); FID_conflict__Tidy(&this->_smeltedTrinkets); FID_conflict__Tidy(&this->_levelEffectItems); FID_conflict__Tidy(&this->_pillEffectUses); FID_conflict__Tidy(&this->_collectibleCounts); std::deque::_Tidy(); oldBlock = *(void **)&this->field_0x1668; *(undefined4 *)&this->field_0x1668 = 0; operator_delete(oldBlock,8); FUN_004b3950(); std::string::_Tidy_deallocate((this->_name)._buf); std::string::_Tidy_deallocate((this->_queuedExtraAnimation)._buf); std::string::_Tidy_deallocate((this->_headAnim)._buf); FUN_007dc7c0(); local_8 = 6; ANM2::Reset(&this->_statusEffectSprite); AnimationState::~AnimationState(&(this->_statusEffectSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_statusEffectSprite)._animState); std::string::_Tidy_deallocate((this->_statusEffectSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_statusEffectSprite); local_8 = 7; ANM2::Reset(&this->_heldSprite); AnimationState::~AnimationState(&(this->_heldSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_heldSprite)._animState); std::string::_Tidy_deallocate((this->_heldSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_heldSprite); local_8 = 8; ANM2::Reset(&this->_bloodGushSprite); AnimationState::~AnimationState(&(this->_bloodGushSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_bloodGushSprite)._animState); std::string::_Tidy_deallocate((this->_bloodGushSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_bloodGushSprite); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(this->_chargeBarSprites,0x114,7,ANM2::~ANM2); local_8 = 9; ANM2::Reset(&this->_darkPrincesCrownSprite); AnimationState::~AnimationState(&(this->_darkPrincesCrownSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_darkPrincesCrownSprite)._animState); std::string::_Tidy_deallocate((this->_darkPrincesCrownSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_darkPrincesCrownSprite); local_8 = 10; ANM2::Reset(&this->_crownOfLightSprite); AnimationState::~AnimationState(&(this->_crownOfLightSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_crownOfLightSprite)._animState); std::string::_Tidy_deallocate((this->_crownOfLightSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_crownOfLightSprite); local_8 = 0xb; ANM2::Reset(&this->_bodySprite); AnimationState::~AnimationState(&(this->_bodySprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_bodySprite)._animState); std::string::_Tidy_deallocate((this->_bodySprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_bodySprite); Entity::destructor((Entity *)this); ExceptionList = local_10; return; } //@@ 00755470 Entity_Player::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: 'Got non existing player type %d in Player::Init!', '[Frame: %d] Initialized player with Variant %d and Subtype %d', Entity::Init, GetGlitchBabySubType; vtable (no direct callers) */ void __thiscall Entity_Player::Init(Entity_Player *this,int param_2,int param_3,undefined1 *param_4,uint param_5) { void **ppvVar1; code *pcVar2; byte bVar3; char cVar4; undefined1 *babySkin; int *weapon; byte *pbVar5; LayerState *crownLayer; Entity_Player *pEVar6; Entity_Player *mainTwin; uint uVar7; Entity *spawned; void *pvVar8; byte bVar9; undefined4 *puVar10; byte *pbVar11; int iVar12; char *pcVar13; uint uVar14; Entity_Familiar *pEVar15; undefined1 *puVar16; byte *pbVar17; PlayerManager *movingBoxEntry; Entity_Player *pEVar18; std_set *proceduralItemIds; bool bVar19; float fVar20; undefined4 uVar21; TypeDescriptor *pTVar22; TypeDescriptor *pTVar23; undefined4 uVar24; undefined4 auStack_1a0 [8]; undefined4 uStack_180; undefined4 uStack_17c; undefined4 uStack_178; undefined4 auStack_174 [8]; undefined4 uStack_154; undefined4 uStack_150; undefined4 uStack_14c; undefined8 cardRngShifts; undefined8 pillRngShifts; undefined8 trinketRngShifts; undefined8 collectibleRngShifts; undefined1 shadowImage [4]; int *piStack_104; Vector familiarSpawnPos3; Vector familiarSpawnPos2; Vector familiarSpawnPos; undefined8 initRngShifts; undefined4 local_dc; Entity_Player *self; undefined4 initRngShift3; PlayerManager *pPStack_d0; PlayerManager *local_cc; undefined1 *local_c8; Entity_Familiar *local_c4; Entity_Familiar *local_c0; uint local_bc [5]; undefined8 uStack_a8; undefined4 uStack_a0; uint newTrinketRng [4]; Entity_Familiar *newCollectibleRng; undefined8 uStack_88; undefined4 uStack_80; std_string darkPrincesCrownPath; std_string crownOfLightPath; std_string bloodGushPath; std_string chargeBarPath; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; std_vector *countVec; Manager *manager; PlayerManager *movingBoxEnd; uint *rngVecEnd; uStack_8 = 0xffffffff; puStack_c = &LAB_00afebb0; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&chargeBarPath + 0x28U; ExceptionList = &local_10; initRngShifts = 0xb00000001; initRngShift3 = 0x10; local_dc = 0x10; self = this; if (param_5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } param_5 = param_5 >> 1 ^ param_5; param_5 = param_5 << 0xb ^ param_5; collectibleRngShifts = 0x1300000001; pEVar15 = (Entity_Familiar *)(param_5 >> 0x10 ^ param_5); local_c4 = (Entity_Familiar *)0x0; local_c8 = (undefined1 *)0x3; local_c0 = pEVar15; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2 != 0) { do { if (pEVar15 == (Entity_Familiar *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)pEVar15 >> ((byte)collectibleRngShifts & 0x1f) ^ (uint)pEVar15; uStack_88 = 0x900000005; uVar14 = uVar14 << ((byte)((ulonglong)collectibleRngShifts >> 0x20) & 0x1f) ^ uVar14; pEVar15 = (Entity_Familiar *)(uVar14 >> ((byte)local_c8 & 0x1f) ^ uVar14); uStack_80 = 7; puVar10 = (this->_collectibleRNGs)._end; newCollectibleRng = pEVar15; if (puVar10 == (this->_collectibleRNGs)._capacity) { std::vector::_Emplace_reallocate(puVar10,&newCollectibleRng); } else { *puVar10 = pEVar15; puVar10[1] = 5; puVar10[2] = 9; puVar10[3] = 7; ppvVar1 = &(this->_collectibleRNGs)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } local_c4 = (Entity_Familiar *)&local_c4->field_0x1; } while (local_c4 < (undefined1 *) ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2)); } pEVar18 = self; if (local_c0 == (Entity_Familiar *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)local_c0 >> ((byte)initRngShifts & 0x1f) ^ (uint)local_c0; trinketRngShifts = 0x1500000001; uVar14 = uVar14 << ((byte)((ulonglong)initRngShifts >> 0x20) & 0x1f) ^ uVar14; local_cc = (PlayerManager *)0x14; uVar14 = uVar14 >> ((byte)initRngShift3 & 0x1f) ^ uVar14; local_c4 = (Entity_Familiar *)0x0; local_c8 = (undefined1 *)uVar14; if ((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 != 0) { local_c0 = (Entity_Familiar *)&self->_trinketRNGs; do { if (uVar14 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = uVar14 >> ((byte)trinketRngShifts & 0x1f) ^ uVar14; newTrinketRng[1] = 5; newTrinketRng[2] = 9; uVar14 = uVar14 << ((byte)((ulonglong)trinketRngShifts >> 0x20) & 0x1f) ^ uVar14; uVar14 = uVar14 >> ((byte)local_cc & 0x1f) ^ uVar14; newTrinketRng[3] = 7; rngVecEnd = (pEVar18->_trinketRNGs)._end; newTrinketRng[0] = uVar14; if (rngVecEnd == (pEVar18->_trinketRNGs)._capacity) { std::vector::_Emplace_reallocate(rngVecEnd,newTrinketRng); } else { *rngVecEnd = uVar14; rngVecEnd[1] = 5; rngVecEnd[2] = 9; rngVecEnd[3] = 7; ppvVar1 = &(pEVar18->_trinketRNGs)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } local_c4 = (Entity_Familiar *)&local_c4->field_0x1; } while (local_c4 < (undefined1 *) ((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2)); } pEVar18 = self; if (local_c8 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)local_c8 >> ((byte)initRngShifts & 0x1f) ^ (uint)local_c8; pillRngShifts = 0x1b00000001; uVar14 = uVar14 << ((byte)((ulonglong)initRngShifts >> 0x20) & 0x1f) ^ uVar14; local_cc = (PlayerManager *)0x1b; uVar14 = uVar14 >> ((byte)initRngShift3 & 0x1f) ^ uVar14; local_c4 = (Entity_Familiar *)0x0; local_c8 = (undefined1 *)uVar14; if ((int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2 != 0) { local_c0 = (Entity_Familiar *)&self->_pillRNGs; do { if (uVar14 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = uVar14 >> ((byte)pillRngShifts & 0x1f) ^ uVar14; uStack_a8 = 0x900000005; uVar14 = uVar14 << ((byte)((ulonglong)pillRngShifts >> 0x20) & 0x1f) ^ uVar14; uVar14 = uVar14 >> ((byte)local_cc & 0x1f) ^ uVar14; uStack_a0 = 7; rngVecEnd = (pEVar18->_pillRNGs)._end; local_bc[4] = uVar14; if (rngVecEnd == (pEVar18->_pillRNGs)._capacity) { std::vector::_Emplace_reallocate(rngVecEnd,local_bc + 4); } else { *rngVecEnd = uVar14; rngVecEnd[1] = 5; rngVecEnd[2] = 9; rngVecEnd[3] = 7; ppvVar1 = &(pEVar18->_pillRNGs)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } local_c4 = (Entity_Familiar *)&local_c4->field_0x1; } while (local_c4 < (undefined1 *) ((int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2)); } pEVar18 = self; if (local_c8 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)local_c8 >> ((byte)initRngShifts & 0x1f) ^ (uint)local_c8; cardRngShifts = 0x500000002; uVar14 = uVar14 << ((byte)((ulonglong)initRngShifts >> 0x20) & 0x1f) ^ uVar14; local_cc = (PlayerManager *)&DAT_0000000f; puVar16 = (undefined1 *)(uVar14 >> ((byte)initRngShift3 & 0x1f) ^ uVar14); local_c4 = (Entity_Familiar *)0x0; if ((int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2 != 0) { local_c0 = (Entity_Familiar *)&self->_cardRNGs; local_c8 = puVar16; do { if (puVar16 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)puVar16 >> ((byte)cardRngShifts & 0x1f) ^ (uint)puVar16; local_bc[1] = 5; local_bc[2] = 9; uVar14 = uVar14 << ((byte)((ulonglong)cardRngShifts >> 0x20) & 0x1f) ^ uVar14; puVar16 = (undefined1 *)(uVar14 >> ((byte)local_cc & 0x1f) ^ uVar14); local_bc[3] = 7; rngVecEnd = (pEVar18->_cardRNGs)._end; local_bc[0] = (uint)puVar16; if (rngVecEnd == (pEVar18->_cardRNGs)._capacity) { std::vector::_Emplace_reallocate(rngVecEnd,local_bc); } else { *rngVecEnd = (uint)puVar16; rngVecEnd[1] = 5; rngVecEnd[2] = 9; rngVecEnd[3] = 7; ppvVar1 = &(pEVar18->_cardRNGs)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } local_c4 = (Entity_Familiar *)&local_c4->field_0x1; } while (local_c4 < (undefined1 *) ((int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2)); puVar16 = local_c8; } pEVar18 = self; if ((self->_history)._isLocked == 0) { (self->_history)._historyItems._end = (self->_history)._historyItems._begin; self->_inventory[0] = -1; self->_inventory[1] = -1; self->_inventory[2] = -1; self->_inventory[3] = -1; self->_inventory[4] = -1; self->_inventory[5] = -1; self->_inventory[6] = -1; self->_inventory[7] = -1; self->_inventory[8] = -1; self->_inventory[9] = -1; self->_inventory[10] = -1; self->_inventory[0xb] = -1; self->_inventory[0xc] = -1; self->_inventory[0xd] = -1; self->_inventory[0xe] = -1; self->_inventory[0xf] = -1; } manager = g_manager; if (param_3 == 1) { self->_playerType = 0; local_c8 = param_4; if (param_4 == (undefined1 *)0x19) { self->_isGlitchBaby = 1; local_c8 = (undefined1 *)GetGlitchBabySubType((Entity_Player *)0x19); } else { self->_isGlitchBaby = 0; } babySkin = local_c8; if ((undefined1 *)0x46 < local_c8) { babySkin = (undefined1 *)0x47; } pEVar18->_babySkin = (int)babySkin; initRngShift3 = local_dc; } else { self->_babySkin = -1; local_c8 = param_4; if ((undefined1 *) (((int)(manager->_entityConfig)._players._end - (int)(manager->_entityConfig)._players._begin) / 0x148) <= param_4) { KAGE_LogMessage(0x10,(byte *)"Got non existing player type %d in Player::Init!"); } pEVar18->_playerType = (int)local_c8; } std::string::assign((pEVar18->_name)._buf,&s_empty,0); if (puVar16 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)puVar16 >> ((byte)initRngShifts & 0x1f) ^ (uint)puVar16; uVar14 = uVar14 << ((byte)((ulonglong)initRngShifts >> 0x20) & 0x1f) ^ uVar14; local_c4 = (Entity_Familiar *)(uVar14 >> ((byte)initRngShift3 & 0x1f) ^ uVar14); Entity::Init((Entity *)pEVar18,param_2,param_3,(int)local_c8,(uint)local_c4); pEVar18->_renderZOffset = 5; KAGE_LogMessage(1,(byte *)"[Frame: %d] Initialized player with Variant %d and Subtype %d\n"); TemporaryEffects::ClearEffects(&pEVar18->_temporaryeffects,1); puVar10 = _DAT_00c73634; pEVar18->_subPlayer = 0; pEVar18->field_0x131c = 0; pEVar18->_isCoopGhost = 0; pEVar18->_hasGoldenKey = 0; pEVar18->_hasGoldenBomb = 0; pEVar18->_goldenHearts = 0; pEVar18->_health = 1.0; pEVar18->_maxHitPoints = 1.0; pEVar18->_boneHeartsMask = 0; pEVar18->_boneHearts = 0; pEVar18->_eternalHearts = 0; pEVar18->_blackHearts = 0; pEVar18->_numKeys = 0; pEVar18->_numCoins = 0; pEVar18->_numBombs = 0; pEVar18->_soulHearts = 0; pEVar18->_maxHearts = 0; pEVar18->_redHearts = 0; pEVar18->_edenLuck = 0.0; pEVar18->_edenShotSpeed = 0.0; pEVar18->_edenTearRange = 0.0; pEVar18->_edenFireDelay = 0.0; pEVar18->_edenSpeed = 0.0; pEVar18->_edenDamage = 0.0; pEVar18->_jarHearts = 0; pEVar18->_jarFlies = 0; pEVar18->_gnawedLeafTimer = 0; pEVar18->_lastActionTriggers = 0; pEVar18->_bloodLustCounter = 0; pEVar18->_deadCatLives = 0; pEVar18->_damageCooldown = 0; *(undefined4 *)&pEVar18->field_0x13f0 = 0; *(undefined4 *)&pEVar18->field_0x13f4 = 0; *(undefined4 *)&pEVar18->field_0x13f8 = 0; *(undefined4 *)&pEVar18->field_0x13fc = 0; pEVar18->field_0x1400 = 0; pEVar18->field_0x13f1 = 1; pEVar18->_weapons[1] = (void *)0x0; pEVar18->_weapons[2] = (void *)0x0; pEVar18->_weapons[3] = (void *)0x0; pEVar18->_weapons[4] = (void *)0x0; pEVar18->_weapons[0] = (void *)0x0; if (puVar10 == (undefined4 *)0x0) { weapon = (int *)0x0; } else { weapon = (int *)(**(code **)*puVar10)(); (**(code **)(*weapon + 4))(1,pEVar18); } pEVar18->_weapons[1] = weapon; pEVar18->_markedTarget = (void *)0x0; pEVar18->_heldEntity = (void *)0x0; *(undefined4 *)&pEVar18->field_0x1420 = 0; *(undefined4 *)&pEVar18->field_0x1424 = 0; *(undefined4 *)&pEVar18->field_0x1428 = 0; *(undefined4 *)&pEVar18->field_0x142c = 0; pEVar18->_tractorBeam = 0; *(undefined4 *)&pEVar18->field_0x1434 = 0; *(undefined4 *)&pEVar18->field_0x1438 = 0; *(undefined4 *)&pEVar18->field_0x1448 = 0; *(undefined4 *)&pEVar18->field_0x144c = 0; *(undefined4 *)&pEVar18->field_0x1450 = 0; *(undefined4 *)&pEVar18->field_0x1454 = 0; pEVar18->_megaBlastLaser = (void *)0x0; *(undefined4 *)&pEVar18->field_0x143c = 0; *(undefined4 *)&pEVar18->field_0x1440 = 0; pEVar18->_breathOfLifeEffect = (EntityPtr)0x0; pEVar18->_itemState = 0; pEVar18->_numBlueFlies = 0; pEVar18->_numBlueSpiders = 0; *(undefined4 *)&pEVar18->field_0x1404 = 0; *(undefined4 *)&pEVar18->field_0x1408 = 0; pEVar18->_itemHoldCooldown = 0; pEVar18->_purityState = 0; pEVar18->_immaculateConceptionState = 0; pEVar18->_cambionConceptionState = 0; pEVar18->_conceptionFamiliarFlags = 0; pEVar18->_speedModifier = 0; pEVar18->_fireDelayModifier = 0; pEVar18->_damageModifier = 0; pEVar18->_tearRangeModifier = 0; pEVar18->_shotSpeedModifier = 0; pEVar18->_luckModifier = 0; pEVar18->_donateLuck = 0; *(undefined4 *)&pEVar18->field_0x1ae0 = 0; pEVar18->_coopBabyBuffTimers[0] = 0; pEVar18->_coopBabyBuffTimers[1] = 0; pEVar18->_coopBabyBuffTimers[2] = 0; pEVar18->_coopBabyBuffTimers[3] = 0; pEVar18->_coopBabyBuffTimers[4] = 0; pEVar18->_coopBabyBuffTimers[5] = 0; pEVar18->_coopBabyBuffTimers[6] = 0; pEVar18->_coopBabyBuffTimers[7] = 0; *(undefined4 *)&pEVar18->field_0x18e0 = 0; *(undefined4 *)&pEVar18->field_0x18e4 = 0; pEVar18->_imExcitedSpeedupCountdown = 0; *(undefined4 *)&pEVar18->field_0x18ec = 0; pEVar18->_potatoPeelerCounter = 0; pEVar18->_potatoPeelerBandageCounter = 0; pEVar18->_greedsGulletHearts = 0; pEVar18->_greedsGulletOverflow = 0; pEVar18->_greedsGulletRedHearts = 0; pEVar18->_isUpdatingGreedsGullet = 0; pEVar18->_megaBlastDuration = 0; (pEVar18->_recentMovementVector).x = g_vectorZero.x; (pEVar18->_recentMovementVector).y = g_vectorZero.y; pEVar18->_slipperyTimer = 0; pEVar18->_deadEyeCharges = 0; pEVar18->_deadEyeMisses = 0; pEVar18->_epiphoraCharge = 0; *(undefined4 *)&pEVar18->field_0x18a8 = 0; *(undefined4 *)&pEVar18->field_0x18ac = 0xffffffff; pEVar18->_peeBurstCooldown = 0; pEVar18->_maxPeeBurstCooldown = 0x1e; pEVar18->_bladderCharge = 0; pEVar18->_maxBladderCharge = 0; pEVar18->_isUrethraBlocked = 0; pEVar18->_nextUrethraBlockFrame = 0; *(undefined4 *)&pEVar18->field_0x18b8 = 0; pEVar18->_mawOfTheVoidChargeTimer = 0; pEVar18->_taurusSpeedBonus = 0.0; pEVar18->_monkeyPawCounter = 3; pEVar18->_rUaWizardTimer = 0; *(undefined2 *)&pEVar18->_holyMantleState = 0; pEVar18->_isBrokenRemotePending = 0; pEVar18->_cursedPennyPending = 0; *(undefined4 *)&pEVar18->field_0x18f0 = 0; pEVar18->_vampireCharmKills = 0; *(undefined4 *)&pEVar18->field_0x160c = 0; pEVar18->_isPlayingExtraAnimation = 0; pEVar18->_isHurtPending = 0; pEVar18->_isPlayingItemAnimation = 0; *(undefined4 *)&pEVar18->field_0x1820 = 0; pEVar18->_strengthMaxHearts = 0; *(undefined4 *)&pEVar18->field_0x1950 = 0; (pEVar18->_friendBallEnemy)._type = 0; pEVar18->_d8DamageModifier = 1.0; pEVar18->_d8FireDelayModifier = 1.0; pEVar18->_d8RangeModifier = 1.0; pEVar18->_d8SpeedModifier = 1.0; pvVar8 = (pEVar18->_trinketRNGs)._begin; pEVar15 = (Entity_Familiar *)((int)pvVar8 + 0x610); uVar14 = *(uint *)pEVar15; local_c0 = pEVar15; if (uVar14 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar14 = *(uint *)pEVar15; if (uVar14 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar14 = uVar14 >> ((byte)*(undefined4 *)((int)pvVar8 + 0x614) & 0x1f) ^ uVar14; uVar14 = uVar14 << ((byte)*(undefined4 *)((int)pvVar8 + 0x618) & 0x1f) ^ uVar14; uVar14 = uVar14 >> ((byte)(local_c0->_damageEvents)._end & 0x1f) ^ uVar14; *(uint *)local_c0 = uVar14; pEVar18->_tonsilCounter = (short)(uVar14 % 7) + 6; pEVar18->_tonsilCount = 0; pEVar18->_numLeprosy = 0; UpdateCanShoot(pEVar18); pEVar18->_ponyCharge = 0; pEVar18->_flashCountdown = 0; pEVar18->_planCKillCountdown = 0; pEVar18->_metronomeCollectibleID = 0; pEVar18->_brittleBonesUpgrades = 0; pEVar18->_bleedOutHealth = 0; pEVar18->_holyMantleStacks = 0; pEVar18->_ductTapeMode = 0; pEVar18->_threeDollarBillItem = 0; *(undefined4 *)&pEVar18->field_0x1738 = 0; (pEVar18->_lastVelocity).x = (pEVar18->_velocity).x; (pEVar18->_lastVelocity).y = (pEVar18->_velocity).y; pEVar18->_postLevelInitFinished = 0; if (pEVar18->_variant == 1) { pEVar18->_postLevelInitFinished = 1; } countVec = &pEVar18->_collectibleCounts; std::vector<4byte>::resize ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2); uVar14 = 0; if ((int)(pEVar18->_collectibleCounts)._end - (int)countVec->_begin >> 2 != 0) { do { *(undefined4 *)((int)countVec->_begin + uVar14 * 4) = 0; uVar14 = uVar14 + 1; } while (uVar14 < (uint)((int)(pEVar18->_collectibleCounts)._end - (int)countVec->_begin >> 2)); } manager = g_manager; countVec = &pEVar18->_smeltedTrinkets; pEVar18->_playerForms[0] = 0; pEVar18->_playerForms[1] = 0; pEVar18->_playerForms[2] = 0; pEVar18->_playerForms[3] = 0; pEVar18->_playerForms[4] = 0; pEVar18->_playerForms[5] = 0; pEVar18->_playerForms[6] = 0; pEVar18->_playerForms[7] = 0; pEVar18->_playerForms[8] = 0; pEVar18->_playerForms[9] = 0; pEVar18->_playerForms[10] = 0; pEVar18->_playerForms[0xb] = 0; pEVar18->_playerForms[0xc] = 0; pEVar18->_playerForms[0xd] = 0; pEVar18->_playerForms[0xe] = 0; pEVar18->_playerForms[0xf] = 0; pEVar18->_playerFormsRewarded = 0; pEVar18->_trinketsID[0] = 0; pEVar18->_trinketsID[1] = 0; puVar10 = (pEVar18->_smeltedTrinkets)._end; local_c0 = (Entity_Familiar *)((int)puVar10 - (int)countVec->_begin >> 2); pEVar15 = (Entity_Familiar *) ((int)(manager->_itemConfig)._trinkets._end - (int)(manager->_itemConfig)._trinkets._begin >> 2); if (pEVar15 < local_c0) { puVar10 = (undefined4 *)((int)countVec->_begin + (int)pEVar15 * 4); LAB_007561bc: (pEVar18->_smeltedTrinkets)._end = puVar10; } else if (local_c0 < pEVar15) { if (pEVar15 <= (Entity_Familiar *)((int)(pEVar18->_smeltedTrinkets)._capacity - (int)countVec->_begin >> 2) ) { for (iVar12 = (int)pEVar15 - (int)local_c0; iVar12 != 0; iVar12 = iVar12 + -1) { *puVar10 = 0; puVar10 = puVar10 + 1; } goto LAB_007561bc; } FUN_007de9f0(pEVar15,puVar10); puVar10 = (pEVar18->_smeltedTrinkets)._end; } uVar14 = 0; if ((int)puVar10 - (int)countVec->_begin >> 2 != 0) { do { *(undefined4 *)((int)countVec->_begin + uVar14 * 4) = 0; uVar14 = uVar14 + 1; } while (uVar14 < (uint)((int)(pEVar18->_smeltedTrinkets)._end - (int)countVec->_begin >> 2)); } countVec = &pEVar18->_pillEffectUses; std::vector<4byte>::resize ((int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2); uVar14 = 0; if ((int)(pEVar18->_pillEffectUses)._end - (int)countVec->_begin >> 2 != 0) { do { *(undefined4 *)((int)countVec->_begin + uVar14 * 4) = 0; uVar14 = uVar14 + 1; } while (uVar14 < (uint)((int)(pEVar18->_pillEffectUses)._end - (int)countVec->_begin >> 2)); } *(undefined4 *)&pEVar18->field_0x16e0 = 0x3f800000; *(undefined4 *)&pEVar18->field_0x16e4 = 0x3f800000; *(undefined4 *)&pEVar18->field_0x16e8 = 0x3f800000; *(undefined4 *)&pEVar18->field_0x16ec = 0x3f800000; *(undefined4 *)&pEVar18->field_0x16f0 = 0; *(undefined4 *)&pEVar18->field_0x16f4 = 0; *(undefined4 *)&pEVar18->field_0x16f8 = 0; *(undefined4 *)&pEVar18->field_0x16fc = 0; *(undefined4 *)&pEVar18->field_0x1700 = 0; *(undefined4 *)&pEVar18->field_0x1704 = 0; *(undefined4 *)&pEVar18->field_0x1708 = 0; pEVar18->_pocketSlots[0] = 0; pEVar18->_pocketSlots[2] = 0; pEVar18->_pocketSlots[1] = 1; pEVar18->_pocketSlots[3] = 1; pEVar18->_pocketSlots[4] = 0; pEVar18->_pocketSlots[5] = 1; pEVar18->_pocketSlots[6] = 0; pEVar18->_pocketSlots[7] = 1; (pEVar18->_queuedItem)._charge = 0; (pEVar18->_queuedItem)._item = (void *)0x0; pEVar18->_isHeldItemVisible = 0; *(undefined4 *)&pEVar18->field_0x1468 = 0; pEVar18->_maxfiredelay = 10.0; pEVar18->_shotspeed = 1.0; pEVar18->_damage = 3.5; pEVar18->_tearheight = -23.75; pEVar18->_tearfallspeed = 0.2; pEVar18->_tearfallaccel = 0.0; pEVar18->_tearFlags = g_tearFlagsNone; pEVar18->_luck = 0.0; pEVar18->_movespeed = 1.0; pEVar18->_cacheFlags = 0; pEVar18->_canFly = 0; pEVar18->_firedTearCount = 0; pEVar18->_meleeDamage = 3.5; pEVar18->_tearrange = 260.0; pEVar18->_itemStateCooldown = 0; pEVar18->_activeDesc[0]._item = 0; pEVar18->_activeDesc[0]._unk = 0; pEVar18->_activeDesc[0]._charge = 0; pEVar18->_activeDesc[0]._batteryCharge = 0; pEVar18->_activeDesc[0]._subCharge = 0; pEVar18->_activeDesc[0]._timeRechargeCooldown = 0; pEVar18->_activeDesc[0]._partialCharge = 0; pEVar18->_activeDesc[0]._varData = 0; pEVar18->_activeDesc[1]._item = 0; pEVar18->_activeDesc[1]._unk = 0; pEVar18->_activeDesc[1]._charge = 0; pEVar18->_activeDesc[1]._batteryCharge = 0; pEVar18->_activeDesc[1]._subCharge = 0; pEVar18->_activeDesc[1]._timeRechargeCooldown = 0; pEVar18->_activeDesc[1]._partialCharge = 0; pEVar18->_activeDesc[1]._varData = 0; pEVar18->_activeDesc[2]._item = 0; pEVar18->_activeDesc[2]._unk = 0; pEVar18->_activeDesc[2]._charge = 0; pEVar18->_activeDesc[2]._batteryCharge = 0; chargeBarPath._buf[8] = '\0'; chargeBarPath._buf[9] = '\0'; chargeBarPath._buf[10] = '\0'; chargeBarPath._buf[0xb] = '\0'; chargeBarPath._buf[0xc] = '\0'; chargeBarPath._buf[0xd] = '\0'; chargeBarPath._buf[0xe] = '\0'; chargeBarPath._buf[0xf] = '\0'; pEVar18->_activeDesc[2]._subCharge = 0; pEVar18->_activeDesc[2]._timeRechargeCooldown = 0; pEVar18->_activeDesc[2]._partialCharge = 0; pEVar18->_activeDesc[2]._varData = 0; chargeBarPath._size = 0; chargeBarPath._capacity = 0; pEVar18->_activeDesc[3]._item = 0; pEVar18->_activeDesc[3]._unk = 0; pEVar18->_activeDesc[3]._charge = 0; pEVar18->_activeDesc[3]._batteryCharge = 0; pEVar18->_activeDesc[3]._subCharge = 0; pEVar18->_activeDesc[3]._timeRechargeCooldown = 0; pEVar18->_activeDesc[3]._partialCharge = 0; pEVar18->_activeDesc[3]._varData = 0; pEVar18->_tearDisplacement = 1; pEVar18->_bombPlaceDelay = 0; pEVar18->_forgottenSwapFormCooldown = 0; std::string::assign((pEVar18->_headAnim)._buf,(byte *)"HeadDown",8); pEVar18->_blinkTime = 0; pEVar18->_headDirectionTime = 0; pEVar18->_moveDirection = -1; pEVar18->_headDirection = 3; pEVar18->_fireDirection = -1; (pEVar18->_aimDirection).x = g_vectorZero.x; (pEVar18->_aimDirection).y = g_vectorZero.y; pEVar18->_areOpposingShootDirectionsPressed = 0; (pEVar18->_lastDirection).x = g_vectorZero.x; (pEVar18->_lastDirection).y = g_vectorZero.y; (pEVar18->_movementVector).x = g_vectorZero.x; (pEVar18->_movementVector).y = g_vectorZero.y; pEVar18->_bodyAngle = 0.0; (pEVar18->_tearsOffset).x = g_vectorZero.x; (pEVar18->_tearsOffset).y = g_vectorZero.y; *(undefined4 *)&pEVar18->_lastDamageFlags = 0; *(undefined4 *)((int)&pEVar18->_lastDamageFlags + 4) = 0; pEVar18->_roomDamageTaken = 0; pEVar18->_totalDamageTaken = 0; *(undefined4 *)&pEVar18->field_0x16b8 = 0; *(undefined4 *)&pEVar18->field_0x16bc = 0; if ((pEVar18->_bloodGushSprite)._loaded == 0) { bloodGushPath._size = 0; bloodGushPath._capacity = 0xf; bloodGushPath._buf[0] = '\0'; bloodGushPath._buf[1] = '\0'; bloodGushPath._buf[2] = '\0'; bloodGushPath._buf[3] = '\0'; bloodGushPath._buf._0_4_ = std::_Allocate(0x20); bloodGushPath._size = 0x1e; bloodGushPath._capacity = 0x1f; builtin_strncpy((char *)bloodGushPath._buf._0_4_,"gfx/characters/blood gush.anm2",0x1f); uStack_8 = 0; ANM2::Load(&pEVar18->_bloodGushSprite,&bloodGushPath,1); uStack_8 = 0xffffffff; if (0xf < bloodGushPath._capacity) { uVar14 = bloodGushPath._capacity + 1; pcVar13 = (char *)bloodGushPath._buf._0_4_; if (0xfff < uVar14) { pcVar13 = *(char **)(bloodGushPath._buf._0_4_ + -4); uVar14 = bloodGushPath._capacity + 0x24; if ((char *)0x1f < (char *)(bloodGushPath._buf._0_4_ + (-4 - (int)pcVar13))) { LAB_0075664b: uStack_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar13,uVar14); } pbVar17 = (pEVar18->_bloodGushSprite)._animState._animData; bloodGushPath._size = 0; bloodGushPath._capacity = 0xf; bloodGushPath._buf._0_4_ = bloodGushPath._buf._0_4_ & 0xffffff00; if (pbVar17 != (byte *)0x0) { pbVar5 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar5 = *(byte **)pbVar17; } pbVar11 = s_Idle; do { bVar3 = *pbVar5; bVar19 = bVar3 < *pbVar11; if (bVar3 != *pbVar11) { LAB_007566a6: uVar14 = -(uint)bVar19 | 1; goto LAB_007566ab; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar19 = bVar3 < pbVar11[1]; if (bVar3 != pbVar11[1]) goto LAB_007566a6; pbVar5 = pbVar5 + 2; pbVar11 = pbVar11 + 2; } while (bVar3 != 0); uVar14 = 0; LAB_007566ab: if ((uVar14 == 0) && ((pbVar17[0x34] == 0 || ((pEVar18->_bloodGushSprite)._animState._isPlaying != 0)))) goto LAB_007566e8; } bVar3 = ANM2::SetAnimation(&pEVar18->_bloodGushSprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(pEVar18->_bloodGushSprite)._animState); (pEVar18->_bloodGushSprite)._animState._isPlaying = 1; } } LAB_007566e8: if ((pEVar18->_crownOfLightSprite)._loaded == 0) { crownOfLightPath._size = 0; crownOfLightPath._capacity = 0xf; crownOfLightPath._buf[0] = '\0'; crownOfLightPath._buf[1] = '\0'; crownOfLightPath._buf[2] = '\0'; crownOfLightPath._buf[3] = '\0'; crownOfLightPath._buf._0_4_ = std::_Allocate(0x20); crownOfLightPath._size = 0x15; crownOfLightPath._capacity = 0x1f; builtin_strncpy((char *)crownOfLightPath._buf._0_4_,"gfx/CrownOfLight.anm2",0x16); uStack_8 = 1; ANM2::Load(&pEVar18->_crownOfLightSprite,&crownOfLightPath,1); uStack_8 = 0xffffffff; if (0xf < crownOfLightPath._capacity) { uVar14 = crownOfLightPath._capacity + 1; pcVar13 = (char *)crownOfLightPath._buf._0_4_; if (0xfff < uVar14) { pcVar13 = *(char **)(crownOfLightPath._buf._0_4_ + -4); uVar14 = crownOfLightPath._capacity + 0x24; if ((char *)0x1f < (char *)(crownOfLightPath._buf._0_4_ + (-4 - (int)pcVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar13,uVar14); } uVar14 = g_graphicsManager_flags; crownOfLightPath._size = 0; crownOfLightPath._capacity = 0xf; crownOfLightPath._buf._0_4_ = crownOfLightPath._buf._0_4_ & 0xffffff00; crownLayer = ANM2::GetLayer(&pEVar18->_crownOfLightSprite,(byte *)0x1); iVar12 = 1; if ((uVar14 & 4) == 0) { iVar12 = 6; } crownLayer->_blendMode[0] = 0; crownLayer->_blendMode[1] = iVar12; crownLayer->_blendMode[2] = 1; crownLayer->_blendMode[3] = 1; crownLayer->_blendMode[4] = 1; (pEVar18->_crownOfLightSprite)._scale.x = g_vectorOne.x; (pEVar18->_crownOfLightSprite)._scale.y = g_vectorOne.y; } if ((pEVar18->_darkPrincesCrownSprite)._loaded == 0) { darkPrincesCrownPath._size = 0; darkPrincesCrownPath._capacity = 0xf; darkPrincesCrownPath._buf[0] = '\0'; darkPrincesCrownPath._buf[1] = '\0'; darkPrincesCrownPath._buf[2] = '\0'; darkPrincesCrownPath._buf[3] = '\0'; darkPrincesCrownPath._buf._0_4_ = std::_Allocate(0x20); darkPrincesCrownPath._size = 0x19; darkPrincesCrownPath._capacity = 0x1f; builtin_strncpy((char *)darkPrincesCrownPath._buf._0_4_,"gfx/DarkPrincesCrown.anm2",0x1a); uStack_8 = 2; ANM2::Load(&pEVar18->_darkPrincesCrownSprite,&darkPrincesCrownPath,1); uStack_8 = 0xffffffff; if (0xf < darkPrincesCrownPath._capacity) { uVar14 = darkPrincesCrownPath._capacity + 1; pcVar13 = (char *)darkPrincesCrownPath._buf._0_4_; if (0xfff < uVar14) { pcVar13 = *(char **)(darkPrincesCrownPath._buf._0_4_ + -4); uVar14 = darkPrincesCrownPath._capacity + 0x24; if ((char *)0x1f < (char *)(darkPrincesCrownPath._buf._0_4_ + (-4 - (int)pcVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar13,uVar14); } uVar14 = g_graphicsManager_flags; darkPrincesCrownPath._size = 0; darkPrincesCrownPath._capacity = 0xf; darkPrincesCrownPath._buf._0_4_ = darkPrincesCrownPath._buf._0_4_ & 0xffffff00; crownLayer = ANM2::GetLayer(&pEVar18->_darkPrincesCrownSprite,(byte *)0x1); iVar12 = 1; if ((uVar14 & 4) == 0) { iVar12 = 6; } crownLayer->_blendMode[0] = 0; crownLayer->_blendMode[1] = iVar12; crownLayer->_blendMode[2] = 1; crownLayer->_blendMode[3] = 1; crownLayer->_blendMode[4] = 1; (pEVar18->_darkPrincesCrownSprite)._scale.x = g_vectorOne.x; (pEVar18->_darkPrincesCrownSprite)._scale.y = g_vectorOne.y; } pbVar17 = &pEVar18->_chargeBarSprites[0]._loaded; local_cc = (PlayerManager *)0x0; do { if (*pbVar17 == 0) { pbVar5 = (byte *)local_cc[0xd4a4]._rng._shift2; chargeBarPath._size = 0; chargeBarPath._capacity = 0xf; local_c0 = (Entity_Familiar *)(pbVar5 + 1); chargeBarPath._buf._0_4_ = (void *)0x0; pbVar11 = pbVar5; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); std::string::assign(chargeBarPath._buf,pbVar5,(int)pbVar11 - (int)local_c0); uStack_8 = 3; ANM2::Load((ANM2 *)(pbVar17 + -0x109),&chargeBarPath,1); uStack_8 = 0xffffffff; if (0xf < chargeBarPath._capacity) { uVar14 = chargeBarPath._capacity + 1; pvVar8 = (void *)chargeBarPath._buf._0_4_; if (0xfff < uVar14) { pvVar8 = *(void **)(chargeBarPath._buf._0_4_ + -4); uVar14 = chargeBarPath._capacity + 0x24; if (0x1f < (uint)(chargeBarPath._buf._0_4_ + (-4 - (int)pvVar8))) goto LAB_0075664b; } operator_delete(pvVar8,uVar14); } ((Vector *)(pbVar17 + -0x6d))->x = g_vectorOne.x; chargeBarPath._size = 0; chargeBarPath._capacity = 0xf; chargeBarPath._buf._0_4_ = chargeBarPath._buf._0_4_ & 0xffffff00; *(float *)(pbVar17 + -0x69) = g_vectorOne.y; } local_cc = (PlayerManager *)&(local_cc->_playerList)._end; pbVar17 = pbVar17 + 0x114; } while (local_cc < &DAT_0000001c); pEVar18->_delayedSfxId = 0; pEVar18->_delayedSfxDelay = 0; if (((pEVar18->_variant == 0) && (local_c8 != &DAT_00000014)) && (local_c8 != (undefined1 *)0x28)) { iVar12 = g_manager->_activeControllerIndex; } else { iVar12 = -1; } SetControllerIndex(pEVar18,iVar12,0); if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pPStack_d0 = (g_manager->_lobbyMembers)._begin; local_c8 = (undefined1 *)0x0; local_c0 = (Entity_Familiar *)(((int)(g_manager->_lobbyMembers)._end - (int)pPStack_d0) / 0x14); if (local_c0 != (Entity_Familiar *)0x0) { local_cc = &g_game->_playerManager; do { pEVar6 = PlayerManager::get_main_player(local_cc,(int)local_c8); mainTwin = GetMainTwin(pEVar18); if (pEVar6 == mainTwin) { *(float *)&pEVar18->field_0x1e50 = pPStack_d0->_coopSlots[(int)(local_c8 + -1)]._menuPosition; break; } local_c8 = local_c8 + 1; } while (local_c8 < local_c0); } } pvVar8 = pEVar18->_config; if (pvVar8 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Player Config invalid!\n"); pvVar8 = pEVar18->_config; } ANM2::Load(&pEVar18->_sprite,(std_string *)((int)pvVar8 + 0x74),0); if (pEVar18->_variant == 0) { bVar3 = ANM2::SetAnimation(&pEVar18->_sprite,(byte *)"WalkDown",1); if (((bVar3 != 0) && ((pEVar18->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(pEVar18->_sprite)._animState,0.0), (pEVar18->_sprite)._animState._animData != (void *)0x0)) { (pEVar18->_sprite)._animState._isPlaying = 0; } bVar3 = ANM2::SetOverlayAnimation(&pEVar18->_sprite,(byte *)"HeadDown",1); if ((bVar3 != 0) && ((pEVar18->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pEVar18->_sprite)._overlayAnimState,0.0); } } pEVar18->_isControlsEnabled = 1; pEVar18->_controlsCooldown = 0; pEVar18->_fireBlockCooldown = 0; iVar12 = (int)(pEVar18->_costumeSpriteDescs)._capacity - (int)(pEVar18->_costumeSpriteDescs)._begin; if ((uint)(iVar12 / 0x130) < 0x20) { FUN_007dcff0(iVar12); } ClearCostumes(pEVar18); (pEVar18->_playerSpriteScale).x = g_vectorOne.x; (pEVar18->_playerSpriteScale).y = g_vectorOne.y; (pEVar18->_bodyScale).x = g_vectorOne.x; (pEVar18->_bodyScale).y = g_vectorOne.y; (pEVar18->_headScale).x = g_vectorOne.x; (pEVar18->_headScale).y = g_vectorOne.y; if (pEVar18->_variant == 0) { update_player_skin(pEVar18); } else if (pEVar18->_variant == 1) { if (pEVar18->_isGlitchBaby == 0) { InitBabySkin(pEVar18); } else { iVar12 = pEVar18->_babySkin; pEVar18->_babySkin = 0x19; InitBabySkin(pEVar18); pEVar18->_babySkin = iVar12; } } pEVar18->_cacheFlags = 0xffff; pEVar18->field_0x1826 = 0; uStack_154 = 0; uStack_150 = 0; uStack_14c = 0; if (&pEVar18->_footprintColor2 != (ColorMod *)auStack_174) { (pEVar18->_footprintColor2)._colorize[0] = 0.0; (pEVar18->_footprintColor2)._colorize[1] = 0.0; (pEVar18->_footprintColor2)._colorize[2] = 0.0; (pEVar18->_footprintColor2)._colorize[3] = 0.0; (pEVar18->_footprintColor2)._offset[0] = 0.0; (pEVar18->_footprintColor2)._offset[1] = 0.0; (pEVar18->_footprintColor2)._tint[0] = 0.0; (pEVar18->_footprintColor2)._tint[1] = 0.0; (pEVar18->_footprintColor2)._tint[2] = 0.0; (pEVar18->_footprintColor2)._tint[3] = 0.0; (pEVar18->_footprintColor2)._offset[2] = 0.0; } uStack_180 = 0; uStack_17c = 0; uStack_178 = 0; if (&pEVar18->_footprintColor1 != (ColorMod *)auStack_1a0) { (pEVar18->_footprintColor1)._colorize[0] = 0.0; (pEVar18->_footprintColor1)._colorize[1] = 0.0; (pEVar18->_footprintColor1)._colorize[2] = 0.0; (pEVar18->_footprintColor1)._colorize[3] = 0.0; (pEVar18->_footprintColor1)._offset[0] = 0.0; (pEVar18->_footprintColor1)._offset[1] = 0.0; (pEVar18->_footprintColor1)._tint[0] = 0.0; (pEVar18->_footprintColor1)._tint[1] = 0.0; (pEVar18->_footprintColor1)._tint[2] = 0.0; (pEVar18->_footprintColor1)._tint[3] = 0.0; (pEVar18->_footprintColor1)._offset[2] = 0.0; } *(undefined4 *)&pEVar18->field_0x1880 = 0; puVar16 = &pEVar18->field_0x1b14; *(undefined4 *)&pEVar18->field_0x189c = 0; pEVar18->_pitfallState = 0; pEVar18->_pitfallTimer = 0; *(undefined4 *)puVar16 = 0; if (pEVar18->_variant == 1) { iVar12 = pEVar18->_babySkin; if (iVar12 == 7) { *(undefined1 **)&pEVar18->field_0x1af8 = &DAT_bf800000; *(undefined4 *)&pEVar18->field_0x1af0 = 0x3f800000; *(undefined4 *)&pEVar18->field_0x1af4 = 0; *(undefined4 *)&pEVar18->field_0x1afc = 0; *(undefined4 *)&pEVar18->field_0x1b00 = 0; *(undefined4 *)&pEVar18->field_0x1b04 = 0x3f800000; *(undefined4 *)&pEVar18->field_0x1b08 = 0; *(undefined1 **)&pEVar18->field_0x1b0c = &DAT_bf800000; FUN_007dd310(&pEVar18->field_0x1af0); } else { bVar3 = (byte)initRngShift3; bVar9 = (byte)((ulonglong)initRngShifts >> 0x20); if (iVar12 == 2) { if (local_c4 == (Entity_Familiar *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)local_c4 >> ((byte)initRngShifts & 0x1f) ^ (uint)local_c4; uVar14 = uVar14 << (bVar9 & 0x1f) ^ uVar14; uVar7 = Random(); fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; pPStack_d0 = (PlayerManager *)(fVar20 + fVar20); local_c0 = (Entity_Familiar *)sin((float)pPStack_d0); fVar20 = cos((float)pPStack_d0); uVar24 = 0; familiarSpawnPos.x = fVar20 * 20.0 + (pEVar18->_pos).x; pTVar23 = &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor; familiarSpawnPos.y = (float)local_c0 * 20.0 + (pEVar18->_pos).y; pTVar22 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar21 = 0; spawned = Game::Spawn(g_game,3,0x21,&familiarSpawnPos,&g_vectorZero,(Entity *)pEVar18,0, uVar14 >> (bVar3 & 0x1f) ^ uVar14); pEVar15 = (Entity_Familiar *)__RTDynamicCast(spawned,uVar21,pTVar22,pTVar23,uVar24); local_c0 = pEVar15; Entity_Familiar::set_player(pEVar15,pEVar18); (**(code **)(*(int *)pEVar15 + 0xc))(); puVar16 = &pEVar18->field_0x1b14; if (*(int *)&pEVar18->field_0x1b14 != 0) { pPStack_d0 = (PlayerManager *)puVar16; std::multiset::erase(&pPStack_d0); } *(Entity_Familiar **)puVar16 = local_c0; std::multiset::insert(puVar16); } else if (iVar12 == 0x38) { if (local_c4 == (Entity_Familiar *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)local_c4 >> ((byte)initRngShifts & 0x1f) ^ (uint)local_c4; uVar14 = uVar14 << (bVar9 & 0x1f) ^ uVar14; local_cc = (PlayerManager *)(uVar14 >> (bVar3 & 0x1f) ^ uVar14); uVar14 = Random(); fVar20 = (float)((double)(int)uVar14 + __uint_to_double_fixup[-((int)uVar14 >> 0x1f)]) * 2.3283064e-10 * 3.14; pPStack_d0 = (PlayerManager *)(fVar20 + fVar20); local_c0 = (Entity_Familiar *)sin((float)pPStack_d0); fVar20 = cos((float)pPStack_d0); uVar24 = 0; familiarSpawnPos2.x = fVar20 * 20.0 + (pEVar18->_pos).x; pTVar23 = &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor; familiarSpawnPos2.y = (float)local_c0 * 20.0 + (pEVar18->_pos).y; pTVar22 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar21 = 0; spawned = Game::Spawn(g_game,3,0x21,&familiarSpawnPos2,&g_vectorZero,(Entity *)pEVar18,0, (uint)local_cc); local_c4 = (Entity_Familiar *)__RTDynamicCast(spawned,uVar21,pTVar22,pTVar23,uVar24); Entity_Familiar::set_player(local_c4,pEVar18); (**(code **)(*(int *)local_c4 + 0xc))(); if (*(int *)puVar16 != 0) { local_c0 = (Entity_Familiar *)puVar16; std::multiset::erase(&local_c0); } *(Entity_Familiar **)puVar16 = local_c4; std::multiset::insert(puVar16); if (local_cc == (PlayerManager *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar14 = (uint)local_cc >> ((byte)initRngShifts & 0x1f) ^ (uint)local_cc; uVar14 = uVar14 << ((byte)((ulonglong)initRngShifts >> 0x20) & 0x1f) ^ uVar14; bVar3 = (byte)initRngShift3; uVar7 = Random(); fVar20 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; pPStack_d0 = (PlayerManager *)(fVar20 + fVar20); local_c0 = (Entity_Familiar *)sin((float)pPStack_d0); fVar20 = cos((float)pPStack_d0); uVar24 = 0; familiarSpawnPos3.x = fVar20 * 20.0 + (pEVar18->_pos).x; pTVar23 = &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor; familiarSpawnPos3.y = (float)local_c0 * 20.0 + (pEVar18->_pos).y; pTVar22 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar21 = 0; spawned = Game::Spawn(g_game,3,0x21,&familiarSpawnPos3,&g_vectorZero,(Entity *)pEVar18,0, uVar14 >> (bVar3 & 0x1f) ^ uVar14); pEVar15 = (Entity_Familiar *)__RTDynamicCast(spawned,uVar21,pTVar22,pTVar23,uVar24); Entity_Familiar::set_player(pEVar15,pEVar18); pPStack_d0 = (PlayerManager *)&local_c4->_child; if (*(int *)&((EntityPtr *)pPStack_d0)->field_0x0 != 0) { local_cc = pPStack_d0; std::multiset::erase(&local_cc); } (pPStack_d0->_playerList)._begin = pEVar15; if (pEVar15 != (Entity_Familiar *)0x0) { std::multiset::insert(pPStack_d0); } (**(code **)(*(int *)pEVar15 + 0xc))(); } } pEVar18->_hasBabyRoomShield = 1; } (pEVar18->_moveToTarget).x = g_vectorZero.x; (pEVar18->_moveToTarget).y = g_vectorZero.y; *(undefined4 *)&pEVar18->field_0x1ad4 = 0; *(undefined4 *)&pEVar18->field_0x1ad8 = 0; *(undefined4 *)&pEVar18->field_0x1adc = 0; (pEVar18->_voidedCollectibles)._end = (pEVar18->_voidedCollectibles)._begin; (pEVar18->_voidedPassives)._end = (pEVar18->_voidedPassives)._begin; movingBoxEnd = (pEVar18->_movingBoxContents)._end; movingBoxEntry = (pEVar18->_movingBoxContents)._begin; pPStack_d0 = movingBoxEnd; if (movingBoxEntry != movingBoxEnd) { do { invoke_pending_callbacks(movingBoxEntry); movingBoxEntry = (PlayerManager *)&(movingBoxEntry->_coopPlayerTypes)._capacity; } while (movingBoxEntry != movingBoxEnd); movingBoxEntry = (self->_movingBoxContents)._begin; pEVar18 = self; } (pEVar18->_movingBoxContents)._end = movingBoxEntry; pEVar18->_extensionCordIndex = -1; pEVar18->_hallowedGroundCountdown = 0; pEVar18->_damageMultiplierStacks = 0; pEVar18->_lastDamageMultiplierStacks = 0; pEVar18->_forgottenBody = (void *)0x0; FUN_007dd800(0); pEVar18->_heightVelocity = 0.0; pEVar18->_redStewBonusDuration = 0; *(undefined4 *)&pEVar18->field_0x1e78 = 0; *(undefined4 *)&pEVar18->field_0x1e7c = 0; pEVar18->_salvationEffect = (EntityPtr)0x0; *(undefined4 *)&pEVar18->field_0x1e88 = 0; pEVar18->_astralProjectionBody = (EntityPtr)0x0; pEVar18->_brokenHearts = 0; pEVar18->_rottenHearts = 0; pEVar18->_effectiveSoulCharge = 0; *(undefined4 *)&pEVar18->field_0x1db0 = 0; *(undefined4 *)&pEVar18->field_0x1db4 = 0; *(undefined4 *)&pEVar18->field_0x1db8 = 0; *(undefined4 *)&pEVar18->field_0x1dbc = 0; *(undefined8 *)&pEVar18->field_0x1dc0 = 0; *(undefined4 *)&pEVar18->field_0x1dc8 = 0; pEVar18->_marsCooldown = 0; pEVar18->_marsUnkBool = 1; pEVar18->_marsUnk2 = -1; pEVar18->_marsLastTapDirection = 0; pEVar18->_marsTapFrames = 0; *(undefined4 *)&pEVar18->field_0x1ea4 = 0; pEVar18->_poisonDamageFrames = 0; pEVar18->_urnSouls = 0; pEVar18->_numGigaBombs = 0; pEVar18->field_0x1dd8 = 0; pEVar18->_rockBottomMoveSpeed = 0.0; pEVar18->_rockBottomMaxFireDelay = 0.0; pEVar18->_rockBottomDamage = 0.0; pEVar18->_rockBottomTearRange = 0.0; pEVar18->_rockBottomShotSpeed = 0.0; pEVar18->_rockBottomLuck = -9999.0; pEVar18->_reverseEmpressMaxHearts = 0; pEVar18->_reverseChariotMoveCooldown = 0; pEVar18->_reverseSunBoneHearts = 0; *(undefined4 *)&pEVar18->field_0x1ed8 = 0xffffffff; *(undefined4 *)&pEVar18->field_0x1ec8 = 0; pEVar18->_revelationChargeTimer = 0; pEVar18->_montezumaChargeTimer = 0; pEVar18->_jupiterCharge = 0.0; pEVar18->_maggyHealthDrainCooldown = 0; pEVar18->_maggySwingCooldown = 0; pEVar18->_jellyBellyBounceTimer = 0.0; *(undefined4 *)&pEVar18->field_0x1f00 = 0; pEVar18->_montezumaLaser = (void *)0x0; *(undefined4 *)&pEVar18->field_0x1f04 = 0; pEVar18->_forgottenBodyRoomIdx = -99999; *(undefined4 *)&pEVar18->field_0x1f14 = 0xffffffff; pEVar18->_backupPlayer = (void *)0x0; std::deque::_Tidy(); pEVar18->_suplexState = 0; pEVar18->_suplexAimCountdown = 0; (pEVar18->_suplexTargetPos).x = g_vectorZero.x; (pEVar18->_suplexTargetPos).y = g_vectorZero.y; (pEVar18->_suplexLandPos).x = g_vectorZero.x; (pEVar18->_suplexLandPos).y = g_vectorZero.y; pEVar18->_bagOfCraftingContent[0] = 0; pEVar18->_bagOfCraftingContent[1] = 0; pEVar18->_bagOfCraftingContent[2] = 0; pEVar18->_bagOfCraftingContent[3] = 0; pEVar18->_bagOfCraftingContent[4] = 0; pEVar18->_bagOfCraftingContent[5] = 0; pEVar18->_bagOfCraftingContent[6] = 0; pEVar18->_bagOfCraftingContent[7] = 0; pEVar18->_bagOfCraftingOutput = 0; *(undefined4 *)&pEVar18->field_0x1f50 = 0xffffffff; pEVar18->_bagOfCraftingHoldFrames = 0; pEVar18->_poopSpellQueue[0] = 0; pEVar18->_poopSpellQueue[1] = 0; pEVar18->_poopSpellQueue[2] = 0; pEVar18->_poopSpellQueue[3] = 0; pEVar18->_poopSpellQueue[4] = 0; pEVar18->_poopSpellQueue[5] = 0; *(undefined4 *)&pEVar18->field_0x1f5e = 0; *(undefined4 *)&pEVar18->field_0x1f62 = 0; *(undefined4 *)&pEVar18->field_0x1f66 = 0; *(undefined4 *)&pEVar18->field_0x1f6a = 0; *(undefined4 *)&pEVar18->field_0x1f6e = 0; pEVar18->field_0x1f72 = 0; pEVar18->_poopMana = 0; *(undefined4 *)&pEVar18->field_0x1f74 = 0; pEVar18->_eveSumptoriumCharge = 0; pEVar18->_effectiveBloodCharge = 0; pEVar18->_forgottenBHeight = 0.0; pEVar18->_forgottenBHeightVelocity = 0.0; *(undefined4 *)&pEVar18->field_0x1f90 = 0; *(undefined4 *)&pEVar18->field_0x1f94 = 0; *(undefined4 *)&pEVar18->field_0x1f98 = 0; *(undefined4 *)&pEVar18->field_0x1f9c = 0; *(undefined4 *)&pEVar18->field_0x1fa0 = 0; pEVar18->_darkArtsLastSnare = (void *)0x0; pEVar18->_darkArtsBlastPending = 0; pEVar18->_modelingClayEffect = 0; pEVar18->_keepersSackBonus = 0; pEVar18->_darkEsau = (EntityPtr)0x0; pEVar18->_isLevelStartPending = 0; pvVar8 = (pEVar18->_proceduralItems)._itemIds._head; (pEVar18->_proceduralItems)._player = pEVar18; proceduralItemIds = &(pEVar18->_proceduralItems)._itemIds; FID_conflict__Erase_tree_>_> (proceduralItemIds, (fuzzer_allocator_> *)proceduralItemIds, *(_Tree_node **)((int)pvVar8 + 4)); pEVar6 = self; manager = g_manager; *(void **)((int)pvVar8 + 4) = pvVar8; *(void **)pvVar8 = pvVar8; *(void **)((int)pvVar8 + 8) = pvVar8; (pEVar18->_proceduralItems)._itemIds._size = 0; countVec = &self->_extraCollectibleCounts; FUN_007dccd0((int)(manager->_itemConfig)._collectibles._end - (int)(manager->_itemConfig)._collectibles._begin >> 2); uVar14 = 0; if ((pEVar6->_extraCollectibleCounts)._end != countVec->_begin) { do { *(undefined1 *)((int)countVec->_begin + uVar14) = 0; uVar14 = uVar14 + 1; } while (uVar14 < (uint)((int)(pEVar6->_extraCollectibleCounts)._end - (int)countVec->_begin)); } countVec = &pEVar6->_extraTrinketCounts; FUN_007dccd0((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2); uVar14 = 0; if ((pEVar6->_extraTrinketCounts)._end != countVec->_begin) { do { *(undefined1 *)((int)countVec->_begin + uVar14) = 0; uVar14 = uVar14 + 1; } while (uVar14 < (uint)((int)(pEVar6->_extraTrinketCounts)._end - (int)countVec->_begin)); } *(undefined4 *)&pEVar6->field_0x1fec = 0; *(undefined4 *)&pEVar6->field_0x1ff0 = 0; *(undefined4 *)&pEVar6->field_0x1ff4 = 0; *(undefined4 *)&pEVar6->field_0x1ff8 = 0; *(undefined4 *)&pEVar6->field_0x1ffc = 0; *(undefined4 *)&pEVar6->field_0x2000 = 0; pEVar6->_grantedCollectibleCountdown = 0; pEVar6->_grantedCollectibleFlags = 0; pEVar6->_hasCurseMistEffect = 0; pEVar6->_curseMistPocketSlots[0] = 0; pEVar6->_curseMistPocketSlots[2] = 0; pEVar6->_curseMistPocketSlots[1] = 1; pEVar6->_curseMistPocketSlots[3] = 1; pEVar6->_curseMistPocketSlots[4] = 0; pEVar6->_curseMistPocketSlots[5] = 1; pEVar6->_curseMistPocketSlots[6] = 0; pEVar6->_curseMistPocketSlots[7] = 1; pEVar6->_curseMistTrinkets[0] = 0; pEVar6->_curseMistTrinkets[1] = 0; pEVar6->_ghostPocketSlots[0] = 0; pEVar6->_ghostPocketSlots[2] = 0; pEVar6->_ghostPocketSlots[1] = 1; pEVar6->_ghostPocketSlots[3] = 1; pEVar6->_ghostPocketSlots[4] = 0; pEVar6->_ghostPocketSlots[5] = 1; pEVar6->_ghostPocketSlots[6] = 0; pEVar6->_ghostPocketSlots[7] = 1; pEVar6->_ghostTrinkets[0] = 0; pEVar6->_ghostTrinkets[1] = 0; pEVar6->_wildCardItemType = 0xff; pEVar6->_wildCardItem = 0; pEVar6->_wildCardVarData = 0; pEVar6->_samsonBerserkCharge = 0; pEVar6->_ibsCharge = 0.0; *(undefined4 *)&pEVar6->field_0x20a4 = 0; pEVar6->field_0x20a8 = 1; pEVar6->_hasUnlistedRestoreState = 0; *(undefined1 *)(pEVar6 + 1) = 0; if (pEVar6->_variant == 0) { Init(); } *(undefined4 *)&pEVar6[1].field_0x4 = 0; *(undefined1 *)&pEVar6[1]._damageEvents._begin = 0; pvVar8 = Manager::LoadImage(shadowImage,(byte *)"gfx/shadow.png"); uStack_8 = 4; KAGE::SmartPointer::operator_assign(pEVar6->_shadowImage,pvVar8); uStack_8 = 5; if (((piStack_104 != (int *)0x0) && (cVar4 = (**(code **)(*piStack_104 + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(shadowImage); } uStack_8 = 0xffffffff; OnlineEmotes::load_anm2(); pEVar6[1]._chargeBarSprites[0]._layerState = (void *)0x0; puVar16 = &pEVar6->field_0x1e84; pEVar6[1]._chargeBarSprites[0]._layerCount = 0; pEVar6[1]._chargeBarSprites[0]._nullLayerNames = (void *)0x0; pEVar6[1]._chargeBarSprites[0]._numNullLayers = 0; pEVar6[1]._chargeBarSprites[0]._eventNames = (void *)0x0; pEVar6[1]._chargeBarSprites[0]._numEvents = 0; pEVar6[1]._chargeBarSprites[0]._offset.x = 0.0; pEVar6[1]._chargeBarSprites[0]._offset.y = 0.0; pEVar6[1]._chargeBarSprites[0]._scale.x = 0.0; pEVar6[1]._chargeBarSprites[0]._scale.y = 0.0; pEVar6[1]._chargeBarSprites[0]._rotation = 0.0; pEVar6[1]._chargeBarSprites[0]._color._tint[0] = 0.0; *(undefined1 *)(pEVar6[1]._chargeBarSprites[0]._color._tint + 1) = 0; *(undefined2 *)((int)pEVar6[1]._chargeBarSprites[0]._color._tint + 6) = 0; pEVar6[1]._chargeBarSprites[0]._color._tint[2] = 15.0; *(undefined1 *)(pEVar6[1]._chargeBarSprites[0]._color._tint + 3) = 0; pEVar6[1]._chargeBarSprites[0]._color._colorize[0] = 0.0; pEVar6[1]._chargeBarSprites[0]._color._colorize[1] = 0.0; if ((*(int **)puVar16 != (int *)0x0) && ((**(code **)(**(int **)puVar16 + 0x28))(), *(int *)puVar16 != 0)) { local_c4 = (Entity_Familiar *)puVar16; std::multiset::erase(&local_c4); *(undefined4 *)puVar16 = 0; } if (((pEVar6->_playerType == 0x12) && (g_game->_challenge != 0x25)) && (g_game->_challenge != 0x26)) { EvaluateItems(); AddActiveCharge(pEVar6,4,0,0,0,0); } LuaEngine::PostPlayerInit(pEVar6); ExceptionList = local_10; return; } //@@ 00757980 FUN_00757980 void FUN_00757980(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; uVar1 = *(undefined4 *)(in_ECX + 0x1bc); uVar2 = *(undefined4 *)(in_ECX + 0x1c0); uVar3 = *(undefined4 *)(in_ECX + 0x1c4); *param_1 = *(undefined4 *)(in_ECX + 0x1b8); param_1[1] = uVar1; param_1[2] = uVar2; param_1[3] = uVar3; uVar1 = *(undefined4 *)(in_ECX + 0x1cc); uVar2 = *(undefined4 *)(in_ECX + 0x1d0); uVar3 = *(undefined4 *)(in_ECX + 0x1d4); param_1[4] = *(undefined4 *)(in_ECX + 0x1c8); param_1[5] = uVar1; param_1[6] = uVar2; param_1[7] = uVar3; uVar1 = *(undefined4 *)(in_ECX + 0x1e0); *(undefined8 *)(param_1 + 8) = *(undefined8 *)(in_ECX + 0x1d8); param_1[10] = uVar1; return; } //@@ 007579c0 Entity_Player::ResetColor /* ZHL [exact] void ResetColor(); */ void __thiscall Entity_Player::ResetColor(Entity_Player *this) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; ColorMod *pCVar10; undefined4 local_30 [11]; fVar2 = (this->_color)._tint[0]; fVar3 = (this->_color)._tint[1]; fVar4 = (this->_color)._tint[2]; fVar5 = (this->_color)._tint[3]; fVar1 = (this->_color)._offset[2]; fVar6 = (this->_color)._colorize[0]; fVar7 = (this->_color)._colorize[1]; fVar8 = (this->_color)._colorize[2]; fVar9 = (this->_color)._colorize[3]; pCVar10 = &(this->_sprite)._color; if (pCVar10 != (ColorMod *)local_30) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)(this->_color)._offset; pCVar10->_tint[0] = fVar2; (this->_sprite)._color._tint[1] = fVar3; (this->_sprite)._color._tint[2] = fVar4; (this->_sprite)._color._tint[3] = fVar5; (this->_sprite)._color._offset[2] = fVar1; (this->_sprite)._color._colorize[0] = fVar6; (this->_sprite)._color._colorize[1] = fVar7; (this->_sprite)._color._colorize[2] = fVar8; (this->_sprite)._color._colorize[3] = fVar9; } return; } //@@ 00757a10 FUN_00757a10 void FUN_00757a10(void) { Vector *in_ECX; Room::GetTimeScale(g_game->_room,in_ECX,(Entity *)in_ECX); return; } //@@ 00757a40 Entity_Player::ClearReferences /* DB: vtable slot 17 of Entity_Player; slot name from Entity */ void __thiscall Entity_Player::ClearReferences(Entity_Player *this) { Entity::ClearReferences((Entity *)this); release_weapons_and_effects(this,0); return; } //@@ 00757a60 Entity_Player::IsEntityValidTarget /* ZHL [exact] __thiscall bool Entity_Player::IsEntityValidTarget(Entity * entity); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::IsEntityValidTarget(Entity_Player *this,Entity *entity) { byte bVar1; if ((Entity_Player *)entity != this) { bVar1 = Entity::is_same_segmented_body((Entity *)this,entity); if (((bVar1 == 0) && (((this->_type != 0xde || (entity->_type != 0xde)) && (entity->_type != 0x362)))) && (entity->_type != 0x322)) { return 1; } } return 0; } //@@ 00757ab0 Entity_Player::CanShutDoors /* DB: vtable slot 18 of Entity_Player; slot name from Entity */ undefined4 __thiscall Entity_Player::CanShutDoors(void) { return CONCAT31((int3)((uint)g_game >> 8),1 < *(int *)&g_game->_deathmatchManager); } //@@ 00757ac0 Entity_Player::release_weapons_and_effects /* DB: ? destroys 5 Weapon objects at +0x13dc..+0x13ec (vtable+0x14 then deleting dtor; GetWeapon slots 1-5) and nulls entity refs +0x1420..+0x142c (Remove via vtable+0x28 when arg true); callers PlayerManager::RemoveCoPlayer(1), greed reset 007db3b0, 009bee80, dtor thunk 00757a40 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::release_weapons_and_effects(Entity_Player *this,byte isRemoveEntities) { undefined1 *puVar1; Entity_Player *player; undefined4 *playerSlot; EntityPtr EVar2; void *playerListEnd; EntityPtr *playerListBegin; int weaponsLeft; Game *game; void **weaponSlot; PlayerManager *playerManager; EntityPtr *pEStack_14; Vector throwVelocity; int *ownedPlayer; weaponsLeft = 4; weaponSlot = this->_weapons; do { weaponSlot = weaponSlot + 1; if (*weaponSlot != (int *)0x0) { (**(code **)(*(int *)*weaponSlot + 0x14))(); if (*weaponSlot != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*weaponSlot)(1); } *weaponSlot = (void *)0x0; } weaponsLeft = weaponsLeft + -1; } while (weaponsLeft != 0); if (this->_weapons[0] != (int *)0x0) { (**(code **)(*(int *)this->_weapons[0] + 0x14))(); if (this->_weapons[0] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_weapons[0])(1); } this->_weapons[0] = (void *)0x0; } if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1424 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1424 + 0x28))(); } if (*(int *)&this->field_0x1424 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1424; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1424 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1420 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1420 + 0x28))(); } if (*(int *)&this->field_0x1420 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1420; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1420 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1428 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1428 + 0x28))(); } if (*(int *)&this->field_0x1428 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1428; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1428 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x142c != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x142c + 0x28))(); } if (*(int *)&this->field_0x142c != 0) { pEStack_14 = (EntityPtr *)&this->field_0x142c; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x142c = 0; if ((isRemoveEntities != 0) && ((int *)this->_tractorBeam != (int *)0x0)) { (**(code **)(*(int *)this->_tractorBeam + 0x28))(); } if (this->_tractorBeam != 0) { pEStack_14 = (EntityPtr *)&this->_tractorBeam; std::multiset::erase(&pEStack_14); } this->_tractorBeam = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1434 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1434 + 0x28))(); } if (*(int *)&this->field_0x1434 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1434; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1434 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1b14 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1b14 + 0x28))(); } if (*(int *)&this->field_0x1b14 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1b14; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1b14 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1438 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1438 + 0x28))(); } if (*(int *)&this->field_0x1438 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1438; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1438 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x143c != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x143c + 0x28))(); } if (*(int *)&this->field_0x143c != 0) { pEStack_14 = (EntityPtr *)&this->field_0x143c; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x143c = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1440 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1440 + 0x28))(); } if (*(int *)&this->field_0x1440 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1440; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1440 = 0; if ((isRemoveEntities != 0) && (this->_breathOfLifeEffect != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_breathOfLifeEffect + 0x28))(); } if (this->_breathOfLifeEffect != (EntityPtr)0x0) { pEStack_14 = &this->_breathOfLifeEffect; std::multiset::erase(&pEStack_14); } this->_breathOfLifeEffect = (EntityPtr)0x0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1448 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1448 + 0x28))(); } if (*(int *)&this->field_0x1448 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1448; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1448 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x144c != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x144c + 0x28))(); } if (*(int *)&this->field_0x144c != 0) { pEStack_14 = (EntityPtr *)&this->field_0x144c; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x144c = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1450 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1450 + 0x28))(); } if (*(int *)&this->field_0x1450 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1450; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1450 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1454 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1454 + 0x28))(); } if (*(int *)&this->field_0x1454 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1454; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1454 = 0; if ((isRemoveEntities != 0) && (this->_megaBlastLaser != (int *)0x0)) { (**(code **)(*(int *)this->_megaBlastLaser + 0x28))(); } if (this->_megaBlastLaser != (void *)0x0) { pEStack_14 = (EntityPtr *)&this->_megaBlastLaser; std::multiset::erase(&pEStack_14); } this->_megaBlastLaser = (void *)0x0; if ((isRemoveEntities != 0) && (this->_markedTarget != (int *)0x0)) { (**(code **)(*(int *)this->_markedTarget + 0x28))(); } if (this->_markedTarget != (void *)0x0) { pEStack_14 = (EntityPtr *)&this->_markedTarget; std::multiset::erase(&pEStack_14); } this->_markedTarget = (void *)0x0; if ((isRemoveEntities != 0) && (this->_forgottenBody != (int *)0x0)) { (**(code **)(*(int *)this->_forgottenBody + 0x28))(); } if (this->_forgottenBody != (void *)0x0) { pEStack_14 = (EntityPtr *)&this->_forgottenBody; std::multiset::erase(&pEStack_14); } this->_forgottenBody = (void *)0x0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1e78 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1e78 + 0x28))(); } if (*(int *)&this->field_0x1e78 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1e78; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1e78 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1e7c != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1e7c + 0x28))(); } if (*(int *)&this->field_0x1e7c != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1e7c; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1e7c = 0; if ((isRemoveEntities != 0) && (this->_salvationEffect != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_salvationEffect + 0x28))(); } if (this->_salvationEffect != (EntityPtr)0x0) { pEStack_14 = &this->_salvationEffect; std::multiset::erase(&pEStack_14); } this->_salvationEffect = (EntityPtr)0x0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1e88 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1e88 + 0x28))(); } if (*(int *)&this->field_0x1e88 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1e88; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1e88 = 0; if ((isRemoveEntities != 0) && (this->_astralProjectionBody != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_astralProjectionBody + 0x28))(); } if (this->_astralProjectionBody != (EntityPtr)0x0) { pEStack_14 = &this->_astralProjectionBody; std::multiset::erase(&pEStack_14); } this->_astralProjectionBody = (EntityPtr)0x0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1f00 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1f00 + 0x28))(); } if (*(int *)&this->field_0x1f00 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1f00; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1f00 = 0; if ((isRemoveEntities != 0) && (this->_montezumaLaser != (int *)0x0)) { (**(code **)(*(int *)this->_montezumaLaser + 0x28))(); } if (this->_montezumaLaser != (void *)0x0) { pEStack_14 = (EntityPtr *)&this->_montezumaLaser; std::multiset::erase(&pEStack_14); } this->_montezumaLaser = (void *)0x0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1f04 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1f04 + 0x28))(); } if (*(int *)&this->field_0x1f04 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1f04; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1f04 = 0; if ((isRemoveEntities != 0) && (*(int **)&this->field_0x1fa0 != (int *)0x0)) { (**(code **)(**(int **)&this->field_0x1fa0 + 0x28))(); } if (*(int *)&this->field_0x1fa0 != 0) { pEStack_14 = (EntityPtr *)&this->field_0x1fa0; std::multiset::erase(&pEStack_14); } *(undefined4 *)&this->field_0x1fa0 = 0; if ((isRemoveEntities != 0) && (this->_darkArtsLastSnare != (int *)0x0)) { (**(code **)(*(int *)this->_darkArtsLastSnare + 0x28))(); } if (this->_darkArtsLastSnare != (void *)0x0) { pEStack_14 = (EntityPtr *)&this->_darkArtsLastSnare; std::multiset::erase(&pEStack_14); } this->_darkArtsLastSnare = (void *)0x0; if ((isRemoveEntities != 0) && (this->_darkEsau != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_darkEsau + 0x28))(); } if (this->_darkEsau != (EntityPtr)0x0) { pEStack_14 = &this->_darkEsau; std::multiset::erase(&pEStack_14); } this->_darkEsau = (EntityPtr)0x0; puVar1 = &this->field_0x1e84; if (*(int *)puVar1 != 0) { pEStack_14 = (EntityPtr *)puVar1; std::multiset::erase(&pEStack_14); *(undefined4 *)puVar1 = 0; } (this->_moveToTarget).x = g_vectorZero.x; (this->_moveToTarget).y = g_vectorZero.y; if (isRemoveEntities != 0) { throwVelocity.x = (this->_velocity).x * 0.1; throwVelocity.y = (this->_velocity).y * 0.1; ThrowHeldEntity(this,&throwVelocity); } if (this->_heldEntity != (void *)0x0) { pEStack_14 = (EntityPtr *)&this->_heldEntity; std::multiset::erase(&pEStack_14); } this->_heldEntity = (void *)0x0; if (this->_replacedPlayer == (void *)0x0) { if (((this->_valid != 0) && (ownedPlayer = (int *)this->_subPlayer, ownedPlayer != (int *)0x0)) && ((char)ownedPlayer[0x5c] == '\0')) { (**(code **)(*ownedPlayer + 0x44))(); if ((undefined4 *)this->_subPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_subPlayer)(1); } this->_subPlayer = 0; } ownedPlayer = this->_backupPlayer; if ((ownedPlayer != (int *)0x0) && ((char)ownedPlayer[0x5c] == '\0')) { (**(code **)(*ownedPlayer + 0x44))(); if (this->_backupPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_backupPlayer)(1); } this->_backupPlayer = (void *)0x0; } if (((isRemoveEntities != 0) && (EVar2 = this->_twinPlayer, EVar2 != (EntityPtr)0x0)) && ((*(int *)((int)EVar2 + 0x161c) == -1 || ((this->_playerIndex <= *(int *)((int)EVar2 + 0x161c) || (EVar2 == (EntityPtr)this)))))) { PlayerManager::RemoveCoPlayer(&g_game->_playerManager,(Entity_Player *)EVar2,0); } if (this->_twinPlayer != (EntityPtr)0x0) { pEStack_14 = &this->_twinPlayer; std::multiset::erase(&pEStack_14); this->_twinPlayer = (EntityPtr)0x0; } if (isRemoveEntities != 0) { playerManager = &g_game->_playerManager; pEStack_14 = (EntityPtr *)0x0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (pEStack_14 < (EntityPtr *)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)pEStack_14; } player = (Entity_Player *)*playerSlot; EVar2 = player->_parent; if ((EVar2 == (EntityPtr)0x0) || (*(int *)((int)EVar2 + 0x28) != 1)) { if (player->_variant == 1) { playerListBegin = (game->_playerManager)._playerList._begin; if ((int)(game->_playerManager)._playerList._end - (int)playerListBegin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); playerListBegin = (game->_playerManager)._playerList._begin; game = g_game; } EVar2 = *playerListBegin; } else { EVar2 = (EntityPtr)0x0; } } if ((EVar2 == (EntityPtr)this) && (player->_parent != (EntityPtr)0x0)) { PlayerManager::RemoveCoPlayer(&game->_playerManager,player,0); game = g_game; } playerManager = &game->_playerManager; pEStack_14 = (EntityPtr *)&pEStack_14->field_0x1; } while (pEStack_14 < (undefined1 *) ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } } return; } //@@ 007584b0 Entity_Player::InvalidateCoPlayerItems /* ZHL [exact] __thiscall uint32_t Entity_Player::InvalidateCoPlayerItems(); prototype: REPENTOGON, confirmed by RET 0 */ uint __thiscall Entity_Player::InvalidateCoPlayerItems(Entity_Player *this) { int iVar1; int *piVar2; Entity_Player *pEVar3; uint uVar4; void *pvVar5; uint uVar6; PlayerManager *pPVar7; Game *pGVar8; uVar6 = 0; pPVar7 = &g_game->_playerManager; uVar4 = 0; pGVar8 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar7->_playerList)._begin >> 2 != 0) { do { pvVar5 = (pPVar7->_playerList)._end; if ((int)pvVar5 - (int)(pPVar7->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (pPVar7->_playerList)._end; pGVar8 = g_game; } piVar2 = (pPVar7->_playerList)._begin; if (uVar6 < (uint)((int)pvVar5 - (int)piVar2 >> 2)) { piVar2 = piVar2 + uVar6; } iVar1 = *piVar2; pEVar3 = *(Entity_Player **)(iVar1 + 0x3bc); if ((pEVar3 == (Entity_Player *)0x0) || (pEVar3->_type != 1)) { if (*(int *)(iVar1 + 0x2c) == 1) { piVar2 = (pGVar8->_playerManager)._playerList._begin; if ((int)(pGVar8->_playerManager)._playerList._end - (int)piVar2 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar2 = (pGVar8->_playerManager)._playerList._begin; pGVar8 = g_game; } pEVar3 = (Entity_Player *)*piVar2; } else { pEVar3 = (Entity_Player *)0x0; } } if (pEVar3 == this) { *(undefined1 *)(iVar1 + 0x131c) = 1; } pPVar7 = &pGVar8->_playerManager; uVar6 = uVar6 + 1; uVar4 = (int)(pGVar8->_playerManager)._playerList._end - (int)(pPVar7->_playerList)._begin >> 2; } while (uVar6 < uVar4); } return uVar4; } //@@ 00758590 FUN_00758590 undefined4 FUN_00758590(void) { return CONCAT31((int3)((uint)g_game->_room >> 8),*(undefined1 *)((int)g_game->_room + 0x72a1)); } //@@ 007585b0 Entity_Player::cycle_spectate_target /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=player: on input_is_action_triggered(0xd ACTION_MAP) walks the room entity list (Room+0x125c/+0x1264) for the next valid player (type 1 when >1 players, FUN_006d8990), stores it in the EntityPtr-like +0x3c4 (multiset ref insert/erase), snaps pos/velocity to it when none was set, sfx 0xc3 for local players; called per player from PlayerManager::handle_coop_join */ void __thiscall Entity_Player::cycle_spectate_target(Entity_Player *this) { byte bVar1; char isValidTarget; EntityPtr nextTarget; EntityPtr extraout_ECX; EntityPtr extraout_ECX_00; EntityPtr extraout_ECX_01; EntityPtr unused; EntityPtr extraout_ECX_02; EntityPtr EVar2; EntityPtr candidate; uint uVar3; float fVar4; EntityPtr local_48; Entity_Player *local_44; EntityPtr local_40; char isPastCurrent; int actionOrder [13]; Manager *manager; actionOrder[0xc] = __security_cookie ^ (uint)(actionOrder + 0xd); local_44 = this; bVar1 = input_is_action_triggered(g_manager,0xd,this->_controllerIndex,(Entity *)0x0,0); unused = extraout_ECX; if (bVar1 != 0) { unused = (EntityPtr)&this->_target; isPastCurrent = *(EntityPtr *)unused == (EntityPtr)0x0; local_48 = (EntityPtr)g_game->_room; uVar3 = 0; EVar2 = (EntityPtr)0x0; local_40 = unused; if (*(int *)((int)local_48 + 0x1264) != 0) { do { candidate = *(EntityPtr *)(*(int *)((int)local_48 + 0x125c) + uVar3 * 4); if ((candidate == (EntityPtr)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)candidate + 0x28) != 1)) && (0x3dd < *(int *)((int)candidate + 0x28) - 10U)))) { candidate = (EntityPtr)0x0; } nextTarget = EVar2; if (candidate == *(EntityPtr *)unused) { isPastCurrent = '\x01'; } else if (candidate != (EntityPtr)0x0) { isValidTarget = Entity::is_valid_target(); if (isValidTarget != '\0') { nextTarget = candidate; if (EVar2 != (EntityPtr)0x0) { nextTarget = EVar2; } if (isPastCurrent != '\0') goto LAB_00758685; } unused = local_40; } uVar3 = uVar3 + 1; EVar2 = nextTarget; } while (uVar3 < *(uint *)((int)local_48 + 0x1264)); candidate = nextTarget; if (nextTarget != (EntityPtr)0x0) { LAB_00758685: EVar2 = local_40; this = local_44; unused = *(EntityPtr *)local_40; if (candidate != unused) { fVar4 = 0.0; if (unused == (EntityPtr)0x0) { fVar4 = *(float *)((int)candidate + 0x340); (local_44->_pos).x = *(float *)((int)candidate + 0x33c); (local_44->_pos).y = fVar4; (local_44->_velocity).x = g_vectorZero.x; (local_44->_velocity).y = g_vectorZero.y; fVar4 = 1.0; } else if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)((int)unused + 0x28) == 1) ) || (*(int *)((int)unused + 0x28) - 10U < 0x3de)) { *(int *)((int)unused + 0xf1c) = -1; } (local_44->_targetPosition).x = fVar4; if (*(int *)local_40 != 0) { local_48 = local_40; std::multiset::erase(&local_48); } *(EntityPtr *)EVar2 = candidate; std::multiset::insert(EVar2); if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,this->_controllerIndex), unused = extraout_ECX_00, bVar1 != 0)) { manager = g_manager; local_40 = (EntityPtr)0xc3; seed_fart_sound_override((int *)&local_40); SoundEffects::Play(&manager->_sfxManager,(int)local_40,1.0,2,0,1.0,0.0); unused = extraout_ECX_01; } goto LAB_007587aa; } } } this = local_44; } LAB_007587aa: EVar2 = this->_target; if (((EVar2 != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar2 + 0x28) == 1)) || (*(int *)((int)EVar2 + 0x28) - 10U < 0x3de)))) && (*(int *)((int)EVar2 + 0xf1c) == -1)) { uVar3 = 0; actionOrder[0] = 0; actionOrder[1] = 2; actionOrder[2] = 1; actionOrder[3] = 3; actionOrder[4] = 4; actionOrder[5] = 6; actionOrder[6] = 5; actionOrder[7] = 7; actionOrder[8] = 9; actionOrder[9] = 10; actionOrder[10] = 8; actionOrder[0xb] = 0xb; while (bVar1 = input_is_action_pressed (actionOrder[uVar3],this->_controllerIndex,(Entity *)0x0,(int)unused), bVar1 == 0) { uVar3 = uVar3 + 1; unused = extraout_ECX_02; if (0xb < uVar3) { return; } } *(int *)((int)EVar2 + 0xf1c) = this->_controllerIndex; } return; } //@@ 00758850 Entity_Player::trigger_max_hearts_removed /* ZHL [exact] __thiscall void Entity_Player::trigger_max_hearts_removed(int removed); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::trigger_max_hearts_removed(Entity_Player *this,int removed) { int *piVar1; int iVar2; int *piVar3; int iVar4; int iVar5; iVar2 = this->_reverseEmpressMaxHearts; iVar5 = removed / 2; iVar4 = iVar2; if (iVar5 < iVar2) { iVar4 = iVar5; } this->_reverseEmpressMaxHearts = iVar2 - iVar4; piVar1 = &this->_strengthMaxHearts; removed = iVar5 - iVar4; piVar3 = &removed; if (*piVar1 <= iVar5 - iVar4) { piVar3 = piVar1; } *piVar1 = *piVar1 - *piVar3; return; } //@@ 007588a0 Entity_Player::AddMaxHearts /* ZHL [exact] __thiscall void Entity_Player::AddMaxHearts(int amount, bool ignoreKeeper); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddMaxHearts(Entity_Player *this,int amount,byte ignoreKeeper) { EntityPtr EVar1; byte bVar2; int iVar3; int iVar4; Entity_Player *this_00; Entity_Player *this_01; int iVar5; int iVar6; iVar3 = this->_playerType; while ((iVar3 == 0x28 && (EVar1 = *(EntityPtr *)((int)this + 0x1e68), EVar1 != (EntityPtr)0x0))) { iVar3 = *(int *)((int)EVar1 + 0x13c0); this = (Entity_Player *)EVar1; } iVar3 = GetHealthType(this); if (iVar3 != 2) { iVar3 = GetHealthType(this_00); if (iVar3 == 1) { bVar2 = HasCollectible(this_01,0x26b,0); if (((bVar2 != 0) && (*(int *)((int)this + 0x13c0) == 4)) && (0 < amount)) { AddSoulHearts(this,amount * 2,0); return; } if ((*(int *)((int)this + 0x13c0) == 0xc) || (*(int *)((int)this + 0x13c0) == 0x18)) { AddBlackHearts(this,amount); return; } AddSoulHearts(this,amount,0); return; } iVar3 = GetHealthType(this_01); if (iVar3 == 4) { AddBoneHearts(this,amount / 2); return; } iVar3 = GetHeartLimit(this,ignoreKeeper); if (amount < 0) { trigger_max_hearts_removed(this,-amount); } if (ignoreKeeper == 0) { amount = scale_for_hard_difficulty(amount); } iVar4 = *(int *)((int)this + 0x1340); if (iVar3 < iVar4 + amount) { trigger_max_hearts_removed(this,(iVar4 - iVar3) + amount); iVar4 = *(int *)((int)this + 0x1340); } iVar6 = amount + iVar4; if (iVar3 < amount + iVar4) { iVar6 = iVar3; } *(int *)((int)this + 0x1340) = iVar6; if (iVar6 < 0) { *(undefined4 *)((int)this + 0x1340) = 0; AddBoneHearts(this,iVar6 / 2); iVar6 = *(int *)((int)this + 0x1340); } iVar4 = GetEffectiveMaxHearts(this); if (iVar3 < *(int *)((int)this + 0x134c) + iVar4) { iVar5 = 0; if (0 < iVar3 - iVar4) { iVar5 = iVar3 - iVar4; } *(int *)((int)this + 0x134c) = iVar5; } if (iVar4 < *(int *)((int)this + 0x1344)) { *(int *)((int)this + 0x1344) = iVar4; } if (0xd < iVar6) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,1); } UpdateBlackHeartMask(this); update_greeds_gullet(this); UpdateHeartDependentEffects(this); ClampGoldenHearts(this,0); update_bone_hearts(this); ClampHeartsToLimit(this,1,0); } return; } //@@ 00758a70 Entity_Player::AddHearts /* ZHL [exact] __thiscall void Entity_Player::AddHearts(int hearts, bool unk, bool unk2); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity_Player::AddHearts(Entity_Player *this,int hearts,byte unk,byte unk2) { int iVar1; int iVar2; Entity_Player *this_00; Entity_Player *this_01; while( true ) { while( true ) { if ((0 < hearts) && (1 < *(int *)&g_game->_deathmatchManager)) { hearts = hearts << 3; } iVar2 = *(int *)((int)this + 0x13c0); if ((iVar2 != 0x28) || (*(EntityPtr *)((int)this + 0x1e68) == (EntityPtr)0x0)) break; unk2 = 0; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } if ((0 < hearts) && ((unk == 0 && (g_game->_challenge == 0x19)))) { return; } if (iVar2 != 0x11) break; if (*(EntityPtr *)((int)this + 0x1d98) == (EntityPtr)0x0) goto LAB_00758b08; unk2 = 0; unk = 0; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1d98); } if (iVar2 == 0x24) { AddBloodCharge(this,hearts); return; } if (((iVar2 == 0x16) && (unk == 0)) && (0 < hearts)) { hearts = hearts * 2; } LAB_00758b08: iVar2 = GetHealthType(this); if ((iVar2 != 1) && (iVar2 = GetHealthType(this_00), iVar2 != 2)) { iVar2 = GetHealthType(this_01); if (iVar2 == 3) { iVar2 = hearts + 1; if (hearts < 1) { iVar2 = hearts - 1; } hearts = iVar2 - (iVar2 >> 0x1f) & 0xfffffffe; } iVar1 = *(int *)((int)this + 0x1344); iVar2 = *(int *)((int)this + 0x1340) + *(int *)((int)this + 0x1d88) * 2; if (iVar1 + hearts < iVar2) { iVar2 = iVar1 + hearts; } if (iVar2 < 0) { iVar2 = 0; } *(int *)((int)this + 0x1344) = iVar2; if (0 < hearts) { *(uint *)((int)this + 0x16c) = *(uint *)((int)this + 0x16c) & 0xfffffffb; *(undefined4 *)((int)this + 0x168) = *(undefined4 *)((int)this + 0x168); *(undefined4 *)((int)this + 0x138c) = 0; } if (iVar2 != iVar1) { UpdateHeartDependentEffects(this); } ClampGoldenHearts(this,unk2); update_bone_hearts(this); if ((0 < hearts) && (iVar1 < *(int *)((int)this + 0x1344))) { _player_hud_set_heart_anim_state(this); } } return; } //@@ 00758bd0 FUN_00758bd0 void FUN_00758bd0(void) { int iVar1; Entity_Player *in_ECX; int extraout_ECX; int extraout_EDX; int eOverlayID; iVar1 = Entity_Player::GetHealthType(in_ECX); eOverlayID = extraout_EDX; if ((iVar1 == 1) && ((*(int *)(extraout_ECX + 0x13c0) == 0xc || (eOverlayID = 6, *(int *)(extraout_ECX + 0x13c0) == 0x18)))) { eOverlayID = 0x2e; } ItemOverlay::Show(&g_game->_itemOverlay,eOverlayID,1,(Entity_Player *)0x0); return; } //@@ 00758c20 Entity_Player::AddEternalHearts /* ZHL [exact] __thiscall void Entity_Player::AddEternalHearts(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddEternalHearts(Entity_Player *this,int amount) { int iVar1; int iVar2; uint uVar3; Entity_Player *this_00; Entity_Player *this_01; if (this->_isCoopGhost != 0) { RevivePlayerGhost(this); return; } iVar1 = GetHealthType(this); if (iVar1 != 3) { iVar1 = GetHealthType(this_00); if (iVar1 != 2) { if (1 < *(int *)&g_game->_deathmatchManager) { AddMaxHearts(this_01,amount,0); AddHearts(this,amount,0,0); return; } iVar2 = amount + this->_eternalHearts; iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } this->_eternalHearts = iVar1; if (1 < iVar1) { FUN_00758bd0(); AddMaxHearts(this,this->_eternalHearts - (this->_eternalHearts >> 0x1f) & 0xfffffffe,0); AddHearts(this,this->_eternalHearts - (this->_eternalHearts >> 0x1f) & 0xfffffffe,0,0); uVar3 = this->_eternalHearts & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } this->_eternalHearts = uVar3; } } } return; } //@@ 00758d00 Entity_Player::AddSoulHearts /* ZHL [lua] Lua binding EntityPlayer:AddSoulHearts prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddSoulHearts(Entity_Player *this,int amount,byte unk) { byte bVar1; int iVar2; int iVar3; int heartLimit; EntityPtr *hudPlayerSlot; Entity_Player *this_00; uint uVar4; int extraout_EDX; int count; int extraout_EDX_00; int iVar5; int *activeCharge; Game *game; game = g_game; do { while ((*(int *)((int)this + 0x13c0) == 0x28 && (*(EntityPtr *)((int)this + 0x1e68) != (EntityPtr)0x0))) { unk = 0; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } if ((((*(char *)((int)this + 0x154a) == '\0') && (game->_isStartingFromState == 0)) && (game->_isRestoringGlowingHourglassState == 0)) && (0 < amount)) { bVar1 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)this + 0x1508),0x66); if (bVar1 == 0) { LAB_00758d9a: uVar4 = 0; activeCharge = (int *)((int)this + 0x1588); do { if (activeCharge[-2] == 0x249) { iVar3 = GetActiveMaxCharge(this,uVar4); iVar2 = *activeCharge; if (iVar2 + amount < iVar3) { iVar3 = iVar2 + amount; } iVar5 = 0; if (0 < iVar3) { iVar5 = iVar3; } if (iVar5 != iVar2) { SetActiveCharge(this,iVar5,uVar4); amount = amount + (iVar2 - iVar5); } } uVar4 = uVar4 + 1; activeCharge = activeCharge + 8; } while (uVar4 < 4); } else { TemporaryEffects::RemoveNullEffect((TemporaryEffects *)((int)this + 0x1508),0x66,-1); iVar2 = amount + -2; amount = 0; if (0 < iVar2) { amount = iVar2; } if (0 < amount) goto LAB_00758d9a; } game = g_game; } iVar2 = GetHealthType(this); if (iVar2 == 2) { if (extraout_EDX < 1) { return; } *(undefined4 *)((int)this + 0x134c) = 1; return; } iVar2 = GetHealthType(this_00); if (iVar2 == 3) { if (count < 1) { return; } AddBlueFlies(this,(count * 3 + 1) / 2,(Vector *)((int)this + 0x33c),(Entity *)0x0); return; } if (*(int *)((int)this + 0x13c0) != 0x10) { if (*(int *)((int)this + 0x13c0) == 0x12) { AddSoulCharge(this,count); return; } iVar2 = GetHealthType(this); if ((iVar2 == 1) && (extraout_EDX_00 < 0)) { trigger_max_hearts_removed(this,-extraout_EDX_00); } if (1 < *(int *)&game->_deathmatchManager) { ClampHeartsToLimit(this,3,amount); return; } iVar3 = *(int *)((int)this + 0x134c); iVar2 = iVar3 + amount; iVar5 = 0; if (0 < iVar2) { iVar5 = iVar2; } *(int *)((int)this + 0x134c) = iVar5; heartLimit = GetHeartLimit(this,0); iVar2 = *(int *)((int)this + 0x1340) + *(int *)((int)this + 0x1d88) * 2; iVar5 = *(int *)((int)this + 0x134c); if (heartLimit < iVar2 + iVar5) { iVar5 = heartLimit - iVar2; *(int *)((int)this + 0x134c) = iVar5; } if (7 < iVar5) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x50); } UpdateBlackHeartMask(this); ClampGoldenHearts(this,unk); update_bone_hearts(this); if ((amount < 1) || (*(int *)((int)this + 0x134c) < iVar3)) { return; } hudPlayerSlot = (EntityPtr *)&g_game->_hud; uVar4 = 0; do { if (*hudPlayerSlot == (EntityPtr)this) { hudPlayerSlot[3].field_0x1 = 4; return; } uVar4 = uVar4 + 1; hudPlayerSlot = hudPlayerSlot + 0x1b7; } while (uVar4 < 8); return; } this = *(Entity_Player **)((int)this + 0x1d98); if ((EntityPtr)this == (EntityPtr)0x0) { return; } unk = 0; } while( true ); } //@@ 00758f90 Entity_Player::AddBlackHearts /* ZHL [exact] __thiscall void Entity_Player::AddBlackHearts(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddBlackHearts(Entity_Player *this,int amount) { int iVar1; int iVar2; uint uVar3; Entity_Player *this_00; int extraout_EDX; uint uVar4; int iVar5; uint uVar6; uint local_10; int local_c; while( true ) { for (; (*(int *)((int)this + 0x13c0) == 0x28 && (*(EntityPtr *)((int)this + 0x1e68) != (EntityPtr)0x0)); this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68)) { } iVar1 = GetHealthType(this); if (iVar1 == 2) { return; } if (extraout_EDX != 0x10) break; this = *(Entity_Player **)((int)this + 0x1d98); if ((EntityPtr)this == (EntityPtr)0x0) { return; } } iVar1 = GetHealthType(this); if (iVar1 == 3) { AddBlueFlies(this_00,(amount * 4 + 1) / 2,(Vector *)((int)this + 0x33c),(Entity *)0x0); return; } if (1 < *(int *)&g_game->_deathmatchManager) { ClampHeartsToLimit(this,6,amount); return; } uVar6 = *(uint *)((int)this + 0x134c); local_c = 0; uVar4 = uVar6 + 1; if ((uVar6 & 1) == 0) { uVar4 = uVar6; } local_10 = amount & 1; if (((uVar6 & 1) != 0) && (local_10 != 0)) { local_c = -1; local_10 = 0; } iVar1 = *(int *)((int)this + 0x1d88); iVar5 = *(int *)((int)this + 0x1340); iVar2 = GetHeartLimit(this,0); if ((int)(uVar4 + iVar5 + iVar1 * 2) < iVar2 + -1) { iVar1 = (int)(local_10 + uVar4 + amount) / 2; uVar6 = (int)(local_c + uVar4) / 2; if ((int)uVar6 < iVar1) { uVar4 = *(uint *)((int)this + 0x1350); do { uVar4 = uVar4 | 1 << (uVar6 & 0x1f); uVar6 = uVar6 + 1; } while ((int)uVar6 < iVar1); *(uint *)((int)this + 0x1350) = uVar4; } } else { uVar6 = uVar4 - 1; local_10 = 0; while ((0 < (int)uVar6 && (uVar4 = uVar4 - 2, (int)local_10 < amount))) { if ((*(int *)((int)this + 0x134c) < (int)uVar6) || ((int)uVar6 < 1)) { LAB_007590f3: local_10 = local_10 + 2; *(uint *)((int)this + 0x1350) = *(uint *)((int)this + 0x1350) | 1 << ((int)uVar6 / 2 & 0x1fU); } else { uVar3 = uVar6 & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } if ((uVar3 != 1) || ((*(uint *)((int)this + 0x1350) & 1 << ((byte)((int)uVar4 / 2) & 0x1f)) == 0)) goto LAB_007590f3; } uVar6 = uVar6 - 2; } } AddSoulHearts(this,amount,0); if (((*(int *)&g_game->_deathmatchManager < 2) && (*(char *)((int)this + 0x173) == '\0')) && (iVar1 = *(int *)((int)this + 0x194c), 0 < iVar1)) { iVar5 = *(int *)((int)this + 0x1344); if (*(int *)((int)this + 0x1340) < *(int *)((int)this + 0x1344)) { iVar5 = *(int *)((int)this + 0x1340); } iVar5 = (iVar5 + 1) / 2 + (*(int *)((int)this + 0x134c) + 1) / 2 + *(int *)((int)this + 0x1d88); if (iVar5 < iVar1) { BreakGoldenHearts(this,iVar1 - iVar5); *(int *)((int)this + 0x194c) = iVar5; } } update_bone_hearts(this); return; } //@@ 007591e0 Entity_Player::RemoveBlackHeart /* ZHL [lua] Lua binding EntityPlayer:RemoveBlackHeart */ void Entity_Player::RemoveBlackHeart(uint param_1) { Entity_Player *in_ECX; if (((int)param_1 <= in_ECX->_soulHearts) && (-1 < (int)param_1)) { in_ECX->_blackHearts = in_ECX->_blackHearts & ~(1 << (param_1 >> 1 & 0x1f)); ClampGoldenHearts(in_ECX,0); update_bone_hearts(in_ECX); } return; } //@@ 00759220 Entity_Player::IsBlackHeart /* ZHL [lua] Lua binding EntityPlayer:IsBlackHeart */ uint __thiscall Entity_Player::IsBlackHeart(Entity_Player *this,uint param_2) { if ((((this->_soulHearts < (int)param_2) || ((int)param_2 < 1)) || ((param_2 & 1) == 0)) || (param_2 = (int)(param_2 - 1) / 2, (this->_blackHearts & 1 << ((byte)param_2 & 0x1f)) == 0)) { return param_2 & 0xffffff00; } return CONCAT31((int3)(param_2 >> 8),1); } //@@ 00759260 FUN_00759260 int FUN_00759260(void) { int in_ECX; uint uVar1; int iVar2; int iVar3; int iVar4; iVar2 = (*(int *)(in_ECX + 0x134c) + 1) / 2; iVar3 = 0; if (0 < iVar2) { uVar1 = 1; iVar4 = iVar3; do { iVar3 = iVar4 + 1; if ((uVar1 & *(uint *)(in_ECX + 0x1350)) == 0) { iVar3 = iVar4; } uVar1 = uVar1 << 1 | (uint)((int)uVar1 < 0); iVar2 = iVar2 + -1; iVar4 = iVar3; } while (iVar2 != 0); } return iVar3; } //@@ 007592a0 Entity_Player::UpdateBlackHeartMask /* DB: repacks _blackHearts bitmask 0x1350 against _soulHearts 0x134c prototype: db/protos.zhl */ void __thiscall Entity_Player::UpdateBlackHeartMask(Entity_Player *this) { byte bVar1; uint uVar2; int iVar3; uint uVar4; uint local_8; if (*(int *)&g_game->_deathmatchManager < 2) { uVar2 = this->_soulHearts; if (uVar2 == 0) { this->_blackHearts = 0; return; } iVar3 = 0; local_8 = (int)(uVar2 + 1) / 2; uVar4 = 0; if (local_8 < 0x20) { bVar1 = (byte)local_8 & 0x1f; uVar2 = 1 << bVar1 | 1U >> 0x20 - bVar1; do { if ((this->_blackHearts & uVar2) != 0) { uVar4 = uVar4 | 1 << (local_8 & 0x1f); iVar3 = iVar3 + 1; } uVar2 = uVar2 << 1 | (uint)((int)uVar2 < 0); local_8 = local_8 + 1; } while (local_8 < 0x20); uVar2 = this->_soulHearts; } this->_blackHearts = this->_blackHearts & ~uVar4; uVar4 = uVar2; local_8 = uVar2; while ((0 < (int)uVar2 && (local_8 = local_8 - 1, 0 < iVar3))) { if ((uVar2 & 1) != 0) { if ((((int)uVar4 < (int)uVar2) || (uVar2 == 0)) || ((this->_blackHearts & 1 << ((byte)((int)local_8 / 2) & 0x1f)) == 0)) { iVar3 = iVar3 + -1; this->_blackHearts = this->_blackHearts | 1 << (uVar2 >> 1 & 0x1f); } uVar4 = this->_soulHearts; } uVar2 = uVar2 - 1; } } return; } //@@ 00759390 Entity_Player::AddJarHearts /* ZHL [exact] __thiscall void Entity_Player::AddJarHearts(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddJarHearts(Entity_Player *this,int amount) { EntityPtr EVar1; Game *pGVar2; int iVar3; int iVar4; iVar3 = this->_playerType; while ((iVar3 == 0x28 && (EVar1 = *(EntityPtr *)((int)this + 0x1e68), EVar1 != (EntityPtr)0x0))) { iVar3 = *(int *)((int)EVar1 + 0x13c0); this = (Entity_Player *)EVar1; } iVar4 = *(int *)((int)this + 0x1354) + amount; iVar3 = 8; if (iVar4 < 8) { iVar3 = iVar4; } *(int *)((int)this + 0x1354) = iVar3; pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } return; } //@@ 00759400 Entity_Player::AddCoins /* ZHL [lua] Lua binding EntityPlayer:AddCoins prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddCoins(Entity_Player *this,int amount) { Game *pGVar1; int iVar2; Entity_Player *pEVar3; int *piVar4; Entity_Player *this_00; int iVar5; int *piVar6; int extraout_EDX; int iVar7; int local_14 [4]; iVar7 = amount; if (0 < amount) { iVar2 = GetHealthType(this); iVar7 = extraout_EDX; if (iVar2 == 3) { iVar2 = this->_redHearts; AddHearts(this_00,extraout_EDX * 2,0,0); iVar5 = amount - (this->_redHearts - iVar2) / 2; iVar7 = 0; if (0 < iVar5) { iVar7 = iVar5; } if (iVar2 < this->_redHearts) { AddImmaculateConceptionCounter(1); } } } iVar7 = this->_numCoins + iVar7; local_14[0] = iVar7; pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1a0,(RNG **)&g_game->_playerManager,1); local_14[2] = 0; local_14[1] = (-(uint)(pEVar3 != (Entity_Player *)0x0) & 900) + 99; piVar6 = local_14; if (local_14[1] <= iVar7) { piVar6 = local_14 + 1; } piVar4 = local_14 + 2; if (0 < *piVar6) { piVar4 = piVar6; } this->_numCoins = *piVar4; ConsumableCountChanged(this,1); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 00759500 Entity_Player::AddBombs /* ZHL [lua] Lua binding EntityPlayer:AddBombs prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddBombs(Entity_Player *this,int amount) { Game *pGVar1; int *piVar2; int *piVar3; int local_14 [4]; if ((this->_playerType == 0x19) && (0 < amount)) { if (0x18 < amount) { amount = 0x18; } if (amount != 0) { AddBlueFlies(this,amount,&this->_pos,(Entity *)0x0); return; } } else { local_14[0] = this->_numBombs + amount; local_14[1] = 99; local_14[2] = 0; piVar3 = local_14; if (0x62 < local_14[0]) { piVar3 = local_14 + 1; } piVar2 = local_14 + 2; if (0 < *piVar3) { piVar2 = piVar3; } this->_numBombs = *piVar2; ConsumableCountChanged(this,4); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } } return; } //@@ 007595b0 Entity_Player::AddKeys /* ZHL [exact] __thiscall void Entity_Player::AddKeys(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddKeys(Entity_Player *this,int amount) { Game *pGVar1; int *piVar2; int *piVar3; int local_c [2]; amount = amount + this->_numKeys; local_c[1] = 99; piVar3 = &amount; if (0x62 < amount) { piVar3 = local_c + 1; } local_c[0] = 0; piVar2 = local_c; if (0 < *piVar3) { piVar2 = piVar3; } this->_numKeys = *piVar2; ConsumableCountChanged(this,2); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 00759620 Entity_Player::AddGoldenKey /* ZHL [lua] Lua binding EntityPlayer:AddGoldenKey */ void Entity_Player::AddGoldenKey(void) { Game *pGVar1; Entity_Player *in_ECX; in_ECX->_hasGoldenKey = 1; ConsumableCountChanged(in_ECX,8); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 00759660 Entity_Player::RemoveGoldenKey /* ZHL [lua] Lua binding EntityPlayer:RemoveGoldenKey */ void Entity_Player::RemoveGoldenKey(void) { Game *pGVar1; Entity_Player *in_ECX; in_ECX->_hasGoldenKey = 0; ConsumableCountChanged(in_ECX,8); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007596a0 Entity_Player::SyncConsumables /* DB: copies coins/keys/bombs/golden key/bomb/soul charge from shared source by mask bits prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::SyncConsumables(Entity_Player *this,Entity_Player *target,uint mask) { byte bVar1; int iVar2; if (((mask & 1) != 0) && (target->_numCoins = this->_numCoins, target->_valid != 0)) { bVar1 = HasCollectible(target,0x6d,0); if (bVar1 != 0) { target->_cacheFlags = target->_cacheFlags | 1; EvaluateItems(); } update_greeds_gullet(target); } if ((mask & 2) != 0) { target->_numKeys = this->_numKeys; } if ((mask & 4) != 0) { target->_numBombs = this->_numBombs; iVar2 = target->_numGigaBombs; if (this->_numBombs < target->_numGigaBombs) { iVar2 = this->_numBombs; } target->_numGigaBombs = iVar2; } if ((mask & 8) != 0) { target->_hasGoldenKey = this->_hasGoldenKey; } if ((mask & 0x10) != 0) { target->_hasGoldenBomb = this->_hasGoldenBomb; } if ((mask & 0x40) != 0) { iVar2 = this->_numGigaBombs; if (this->_numBombs < this->_numGigaBombs) { iVar2 = this->_numBombs; } target->_numGigaBombs = iVar2; } if ((mask & 0x20) != 0) { iVar2 = target->_effectiveSoulCharge; target->_effectiveSoulCharge = this->_effectiveSoulCharge; if (target->_valid != 0) { apply_soul_charge_to_actives(iVar2); } } if ((mask & 0x100) != 0) { iVar2 = target->_effectiveBloodCharge; target->_effectiveBloodCharge = this->_effectiveBloodCharge; if (target->_valid != 0) { blood_charge_changed(iVar2); } } if ((char)mask < '\0') { target->_poopMana = this->_poopMana; } return; } //@@ 007597e0 Entity_Player::ConsumableCountChanged /* ZHL [exact] __thiscall void Entity_Player::ConsumableCountChanged(int bitflags); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::ConsumableCountChanged(Entity_Player *this,int bitflags) { uint *puVar1; qword qVar2; Game *pGVar3; undefined4 *puVar4; void *pvVar5; int iVar6; uint uVar7; if (-1 < this->_playerIndex) { if (*(int *)&g_game->_deathmatchManager < 2) { uVar7 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pGVar3 = g_game; pvVar5 = (g_game->_playerManager)._playerList._end; if ((int)pvVar5 - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (pGVar3->_playerManager)._playerList._end; } puVar4 = (pGVar3->_playerManager)._playerList._begin; if (uVar7 < (uint)((int)pvVar5 - (int)puVar4 >> 2)) { puVar4 = puVar4 + uVar7; } SyncConsumables(this,(Entity_Player *)*puVar4,bitflags); uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } if ((bitflags & 1U) != 0) { iVar6 = this->_numCoins; if (0x36 < iVar6) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,2); iVar6 = this->_numCoins; } pGVar3 = g_game; if (0x62 < iVar6) { qVar2 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x800; *(int *)&pGVar3->_gameStateFlags = (int)qVar2; iVar6 = this->_numCoins; } if ((((iVar6 < 1) && ((pGVar3->_gameStateFlags & 0x80000000000) != 0)) && (pGVar3->_isRestoringGlowingHourglassState == 0)) && ((pGVar3->_isStartingFromState == 0 && (this->_hasCurseMistEffect == 0)))) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x247); return; } } } else { SyncConsumables(this,this,bitflags); } } return; } //@@ 00759950 Entity_Player::restore_curse_mist_backup /* DB: restores consumables; Add/RemoveCurseMistEffect */ void Entity_Player::restore_curse_mist_backup(int *param_1) { Entity_Player *in_ECX; in_ECX->_numCoins = *param_1; in_ECX->_numKeys = param_1[1]; in_ECX->_numBombs = param_1[2]; in_ECX->_hasGoldenKey = *(byte *)(param_1 + 3); in_ECX->_hasGoldenBomb = *(byte *)((int)param_1 + 0xd); in_ECX->_numGigaBombs = param_1[5]; in_ECX->_effectiveSoulCharge = param_1[4]; in_ECX->_effectiveBloodCharge = param_1[7]; in_ECX->_poopMana = param_1[6]; if (in_ECX->_valid == 0) { return; } ConsumableCountChanged(in_ECX,-1); return; } //@@ 007599d0 Entity_Player::AddBlueFlies /* ZHL [lua] Lua binding EntityPlayer:AddBlueFlies prototype: db/protos.zhl, confirmed by RET 12 */ Entity * __thiscall Entity_Player::AddBlueFlies(Entity_Player *this,int amount,Vector *pos,Entity *target) { PersistentGameData *this_00; EntityPtr *pEVar1; float fVar2; Manager *unusedArg; byte bVar3; int iVar4; int iVar5; uint uVar6; Entity *pEVar7; bool bVar8; bool bVar9; EntityPtr *local_10; Entity_Player *local_c; fVar2 = this[1]._chargeBarSprites[0]._championColor._tint[0]; local_c = this; if ((fVar2 == 0.0) || (fVar2 != 1.31722e-43)) { iVar5 = GetTrinketMultiplier(this,0x5e); bVar9 = false; bVar8 = iVar5 == 0; LAB_00759a0e: if (bVar8 || bVar9 != iVar5 < 0) goto LAB_00759a6a; } else if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar4 = GetTrinketMultiplier(this,0x5e); bVar9 = SBORROW4(iVar4,1); iVar5 = iVar4 + -1; bVar8 = iVar4 == 1; goto LAB_00759a0e; } iVar4 = 2; iVar5 = GetTrinketMultiplier(this,0x5e); if (iVar5 == 2) { uVar6 = Random(); if (uVar6 % 5 == 0) { iVar4 = 3; } } else if ((iVar5 == 3) && (uVar6 = Random(), uVar6 % 5 == 0)) { amount = amount * 4; goto LAB_00759a6a; } amount = iVar4 * amount; LAB_00759a6a: this->_numBlueFlies = this->_numBlueFlies + amount; pEVar7 = (Entity *)0x0; iVar5 = this->_numBlueFlies; if (0 < amount) { do { uVar6 = Random(); pEVar7 = Game::SpawnEx(g_game,3,0x2b,pos,&g_vectorZero,(Entity *)this,0,uVar6,0); if ((target != (Entity *)0x0) && (target->_dead == 0)) { pEVar1 = &pEVar7->_target; if (pEVar7->_target != (EntityPtr)0x0) { local_10 = pEVar1; std::multiset::erase(&local_10); } *pEVar1 = (EntityPtr)target; std::multiset::insert(pEVar1); this = local_c; } *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar7->_flags + 4) = *(undefined4 *)((int)&pEVar7->_flags + 4); amount = amount + -1; } while (amount != 0); iVar5 = this->_numBlueFlies; } unusedArg = g_manager; if (iVar5 < 0x14) { return pEVar7; } this_00 = &g_manager->_persistentGameData; if ((g_manager->_persistentGameData)._isReadOnly != 0) { return pEVar7; } if ((g_manager->_persistentGameData)._achievements[0x184] != 0) { return pEVar7; } (g_manager->_persistentGameData)._achievements[0x184] = 1; if (((unusedArg->_netplayManager == *(NetplayManager *)(unusedArg + 1)) || (bVar3 = Manager::IsGameplayInputActive((int)unusedArg), bVar3 == 0)) && ((unusedArg->_persistentGameData)._isSteamAchievementsEnabled != 0)) { PersistentGameData::UnlockSteamAchievement(this_00,0x184); Manager::queue_achievement_popup(0x184); } *(undefined1 *)this_00 = 1; PersistentGameData::check_challenge_unlocks(this_00); PersistentGameData::check_collection_unlocks(this_00); return pEVar7; } //@@ 00759b80 Entity_Player::RemoveBlueFly /* ZHL [lua] Lua binding EntityPlayer:RemoveBlueFly */ void __thiscall Entity_Player::RemoveBlueFly(Entity_Player *this) { this->_numBlueFlies = this->_numBlueFlies + -1; return; } //@@ 00759b90 Entity_Player::AddLeprosy /* ZHL [exact] __thiscall void Entity_Player::AddLeprosy(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::AddLeprosy(Entity_Player *this) { if (this->_numLeprosy < 3) { this->_cacheFlags = this->_cacheFlags | 0x200; this->_numLeprosy = this->_numLeprosy + 1; EvaluateItems(); return; } return; } //@@ 00759bc0 Entity_Player::AddBoneOrbital /* ZHL [exact] __thiscall Entity* Entity_Player::AddBoneOrbital(Vector* Position); prototype: REPENTOGON, confirmed by RET 4 */ Entity * __thiscall Entity_Player::AddBoneOrbital(Entity_Player *this,Vector *Position) { uint seed; Entity *pEVar1; seed = Random(); pEVar1 = Game::Spawn(g_game,3,0x80,Position,&g_vectorZero,(Entity *)this,0,seed); return pEVar1; } //@@ 00759bf0 Entity_Player::AddSwarmFlyOrbital /* ZHL [lua] Lua binding EntityPlayer:AddSwarmFlyOrbital */ Entity * Entity_Player::AddSwarmFlyOrbital(Vector *param_1) { float fVar1; code *pcVar2; uint uVar3; Entity *swarmFly; Entity *in_ECX; void *pvVar4; void *pvVar5; uint entityIndex; uint *rngSeed; int blockIndex; int *flyDeque; void *flyDequeMap; int flyDequeMapSize; uint flyDequeOffset; uint flyDequeSize; int familiar; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *flyDequeProxy; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00afebed; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; flyDeque = (int *)0x0; flyDequeMap = (void *)0x0; flyDequeMapSize = 0; flyDequeOffset = 0; flyDequeSize = 0; flyDeque = operator_new(8); flyDeque[1] = 0; *flyDeque = (int)&flyDeque; local_8 = 0; entityIndex = 0; pvVar4 = g_game->_room; if (*(int *)((int)pvVar4 + 0x1264) != 0) { do { familiar = *(int *)(*(int *)((int)pvVar4 + 0x125c) + entityIndex * 4); if ((familiar == 0) || (*(int *)(familiar + 0x28) != 3)) { familiar = 0; } else if ((*(int *)(familiar + 0x2c) == 0xe5) && (*(Entity **)(familiar + 0x410) == in_ECX)) { std::deque::push_front(&familiar); } entityIndex = entityIndex + 1; } while (entityIndex < *(uint *)((int)pvVar4 + 0x1264)); } if (0xf < flyDequeSize) { do { (**(code **)(**(int **)(*(int *)((int)flyDequeMap + (flyDequeOffset >> 2 & flyDequeMapSize - 1U) * 4) + (flyDequeOffset & 3) * 4) + 0x28))(uVar3); flyDequeSize = flyDequeSize - 1; if (flyDequeSize == 0) { flyDequeOffset = 0; } else { flyDequeOffset = flyDequeOffset + 1; } } while (0xf < flyDequeSize); } fVar1 = in_ECX[5]._targetPosition.x; rngSeed = (uint *)((int)fVar1 + 0x2b50); uVar3 = *rngSeed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *rngSeed; if (uVar3 == 0) { pcVar2 = (code *)swi(3); swarmFly = (Entity *)(*pcVar2)(); return swarmFly; } } game = g_game; uVar3 = uVar3 >> ((byte)*(undefined4 *)((int)fVar1 + 0x2b54) & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)*(undefined4 *)((int)fVar1 + 0x2b58) & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)*(undefined4 *)((int)fVar1 + 0x2b5c) & 0x1f) ^ uVar3; *rngSeed = uVar3; swarmFly = Game::Spawn(game,3,0xe5,param_1,&g_vectorZero,in_ECX,0,uVar3); (**(code **)(*(int *)swarmFly + 0xc))(); if (flyDequeSize != 0) { do { flyDequeSize = flyDequeSize - 1; } while (flyDequeSize != 0); flyDequeOffset = 0; flyDequeSize = 0; } pvVar4 = flyDequeMap; blockIndex = flyDequeMapSize; if (flyDequeMapSize != 0) { do { pvVar5 = *(void **)((int)pvVar4 + blockIndex * 4 + -4); blockIndex = blockIndex + -1; if (pvVar5 != (void *)0x0) { operator_delete(pvVar5,0x10); pvVar4 = flyDequeMap; } } while (blockIndex != 0); } if (pvVar4 != (void *)0x0) { uVar3 = flyDequeMapSize * 4; pvVar5 = pvVar4; if (0xfff < uVar3) { pvVar5 = *(void **)((int)pvVar4 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar3); } flyDequeProxy = flyDeque; flyDequeMapSize = 0; flyDequeMap = (void *)0x0; flyDeque = (int *)0x0; operator_delete(flyDequeProxy,8); ExceptionList = local_10; return swarmFly; } //@@ 00759e20 Entity_Player::TryUseKey /* ZHL [lua] Lua binding EntityPlayer:TryUseKey prototype: db/protos.zhl */ byte __thiscall Entity_Player::TryUseKey(Entity_Player *this) { Game *pGVar1; Manager *pMVar2; byte bVar3; int hearts; uint seed; Entity *pEVar4; byte unk2; int local_c [2]; if (this->_hasGoldenKey == 0) { if (this->_numKeys < 1) { return 0; } this->_numKeys = this->_numKeys + -1; pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } ConsumableCountChanged(this,2); bVar3 = HasTrinket(this,0x57,0); if (bVar3 != 0) { unk2 = 0; bVar3 = 0; hearts = GetTrinketMultiplier(this,0x57); AddHearts(this,hearts,bVar3,unk2); pMVar2 = g_manager; local_c[0] = 0x9d; if (this->_playerType == 0x16) { local_c[0] = 0x266; } seed_fart_sound_override(local_c); SoundEffects::Play(&pMVar2->_sfxManager,local_c[0],1.0,2,0,1.0,0.0); seed = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,0,seed,0); __RTDynamicCast(pEVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); } } return 1; } //@@ 00759f50 Entity_Player::PlayCollectibleAnim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_Player::PlayCollectibleAnim(CollectibleType collectible, bool checkBodyAnim, std_string &animName, int frameNum, bool unused); prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Entity_Player::PlayCollectibleAnim (Entity_Player *this,int collectibleType,byte isCheckBodyAnim,void *animName,int frameNum, byte isUnused) { std_string *animNameSize; byte bVar1; uint uVar2; ItemConfig_Item *tag; byte *curAnimChar; byte *****pppppbVar3; byte *curAnimChar; byte *cmpAnimChar; byte *****cmpOverlayChar; uint uVar5; ANM2 *costumeSprite; bool bVar6; uint layerIndex; PlayerCostumeMap *costumeMapEntry; byte *****overlayNameFrame [5]; uint overlayNameFrameCapacity; byte *****overlayName [4]; undefined4 local_1c; uint overlayNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; byte ****local_8; byte *curAnimData; local_8 = (byte ****)0xffffffff; puStack_c = &LAB_00afec25; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(overlayName + 10); ExceptionList = &local_10; local_14 = uVar2; tag = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleType); costumeMapEntry = this->_playerCostumeMap; layerIndex = 0; do { if (((-1 < costumeMapEntry->_index) && (costumeMapEntry->_isBodyLayer == isCheckBodyAnim)) && (costumeSprite = (ANM2 *)(costumeMapEntry->_index * 0x130 + (int)(this->_costumeSpriteDescs)._begin), *(ItemConfig_Item **)costumeSprite[1]._filename._buf == tag)) { costumeSprite[1]._filename._buf[8] = '\x01'; if (frameNum < 0) { curAnimChar = animName; if (0xf < *(uint *)((int)animName + 0x14)) { curAnimChar = *(byte **)animName; } if ((costumeSprite->_animState)._animData != (void *)0x0) { curAnimData = (costumeSprite->_animState)._animData; curAnimChar = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimChar = *(byte **)curAnimData; } cmpAnimChar = curAnimChar; do { bVar1 = *curAnimChar; bVar6 = bVar1 < *cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_0075a076: uVar5 = -(uint)bVar6 | 1; goto LAB_0075a07b; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar6 = bVar1 < cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_0075a076; curAnimChar = curAnimChar + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar5 = 0; LAB_0075a07b: if ((uVar5 == 0) && ((curAnimData[0x34] == 0 || ((costumeSprite->_animState)._isPlaying != 0)))) goto LAB_0075a0a6; } bVar1 = ANM2::SetAnimation(costumeSprite,curAnimChar,1); if (bVar1 != 0) { AnimationState::Rewind(&costumeSprite->_animState); (costumeSprite->_animState)._isPlaying = 1; } } else { curAnimChar = animName; if (0xf < *(uint *)((int)animName + 0x14)) { curAnimChar = *(byte **)animName; } bVar1 = ANM2::SetAnimation(costumeSprite,curAnimChar,1); if (((bVar1 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&costumeSprite->_animState,(float)frameNum), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } } LAB_0075a0a6: if (costumeSprite[1]._filename._buf[10] != '\0') { animNameSize = *(std_string **)((int)animName + 0x10); if (frameNum < 0) { if (0x7fffffffU - (int)animNameSize < 8) goto LAB_0075a2a4; curAnimChar = animName; if (0xf < *(uint *)((int)animName + 0x14)) { curAnimChar = *(byte **)animName; } std::string::concat((char *)overlayName,(int)tag,animNameSize,curAnimChar,(uint)animNameSize, (byte *)"_Overlay",8); local_8 = (byte ****)0x2; pppppbVar3 = (byte *****)overlayName; if (0xf < overlayNameCapacity) { pppppbVar3 = overlayName[0]; } if ((costumeSprite->_overlayAnimState)._animData == (void *)0x0) { LAB_0075a1fb: bVar1 = ANM2::SetOverlayAnimation(costumeSprite,(byte *)pppppbVar3,1); if (bVar1 != 0) { AnimationState::Rewind(&costumeSprite->_overlayAnimState); (costumeSprite->_overlayAnimState)._isPlaying = 1; } } else { curAnimChar = (costumeSprite->_overlayAnimState)._animData; if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } cmpOverlayChar = pppppbVar3; do { bVar1 = *curAnimChar; bVar6 = bVar1 < *(byte *)cmpOverlayChar; if (bVar1 != *(byte *)cmpOverlayChar) { LAB_0075a1e0: uVar5 = -(uint)bVar6 | 1; goto LAB_0075a1e5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar6 = bVar1 < *(byte *)((int)cmpOverlayChar + 1); if (bVar1 != *(byte *)((int)cmpOverlayChar + 1)) goto LAB_0075a1e0; curAnimChar = curAnimChar + 2; cmpOverlayChar = (byte *****)((int)cmpOverlayChar + 2); } while (bVar1 != 0); uVar5 = 0; LAB_0075a1e5: if ((uVar5 != 0) || ((*(char *)((int)(costumeSprite->_overlayAnimState)._animData + 0x34) != '\0' && ((costumeSprite->_overlayAnimState)._isPlaying == 0)))) goto LAB_0075a1fb; } local_8 = (byte ****)0xffffffff; if (0xf < overlayNameCapacity) { uVar5 = overlayNameCapacity + 1; pppppbVar3 = overlayName[0]; if (0xfff < uVar5) { pppppbVar3 = (byte *****)overlayName[0][-1]; uVar5 = overlayNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)overlayName[0] + (-4 - (int)pppppbVar3))) { LAB_0075a280: local_8 = (byte ****)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar3,uVar5); } local_1c = 0; overlayNameCapacity = 0xf; overlayName[0] = (byte *****)((uint)overlayName[0] & 0xffffff00); } else { if (0x7fffffffU - (int)animNameSize < 8) { LAB_0075a2a4: /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar2); } curAnimChar = animName; if (0xf < *(uint *)((int)animName + 0x14)) { curAnimChar = *(byte **)animName; } std::string::concat((char *)overlayNameFrame,(int)tag,animNameSize,curAnimChar,(uint)animNameSize ,(byte *)"_Overlay",8); local_8 = (byte ****)0x0; pppppbVar3 = (byte *****)overlayNameFrame; if (0xf < overlayNameFrameCapacity) { pppppbVar3 = overlayNameFrame[0]; } bVar1 = ANM2::SetOverlayAnimation(costumeSprite,(byte *)pppppbVar3,1); if ((bVar1 != 0) && ((costumeSprite->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&costumeSprite->_overlayAnimState,(float)frameNum); } local_8 = (byte ****)0xffffffff; if (0xf < overlayNameFrameCapacity) { uVar5 = overlayNameFrameCapacity + 1; pppppbVar3 = overlayNameFrame[0]; if (0xfff < uVar5) { pppppbVar3 = (byte *****)overlayNameFrame[0][-1]; uVar5 = overlayNameFrameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)overlayNameFrame[0] + (-4 - (int)pppppbVar3))) goto LAB_0075a280; } operator_delete(pppppbVar3,uVar5); } } } } layerIndex = layerIndex + 1; costumeMapEntry = costumeMapEntry + 1; if (0xe < layerIndex) { ExceptionList = local_10; return; } } while( true ); } //@@ 0075a2b0 Weapon::is_held_item /* DB: ? compares held item 0x114 vs Brimstone 118 / trinket 162 cases prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte __cdecl Weapon::is_held_item(ANM2 *sprite,std_string *animName,void *itemDesc) { int iVar1; int *piVar2; char cVar3; void *pvVar4; if (itemDesc == (void *)0x0) { if (animName->_size != 0) { if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } pvVar4 = ANM2::GetAnimationData(sprite,(byte *)animName); if (pvVar4 != (void *)0x0) { return 1; } } return 0; } iVar1 = *(int *)itemDesc; if ((((iVar1 != 1) && (iVar1 != 3)) && (iVar1 != 4)) || (*(int *)((int)itemDesc + 4) != 0x76)) { return *(void **)sprite[1]._filename._buf == itemDesc; } piVar2 = *(int **)sprite[1]._filename._buf; if (piVar2 != (int *)0x0) { if (*piVar2 == 0) { switch(piVar2[1]) { case 0xb: case 0x2d: case 0x56: case 99: return 1; } } else { cVar3 = Item::IsCollectible(); if (cVar3 != '\0') { return piVar2[1] == 0x76; } if (*piVar2 == 2) { return piVar2[1] == 0xa2; } } } return 0; } //@@ 0075a3e0 Entity_Player::play_null_costume_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX player; arg1 null item id (ItemConfig null list g_manager+0x2a41c), arg3 std::string animation, arg4 frame: for every costume layer of that item sets the animation (and "_Overlay" overlay when the layer has one); update_shooting passes "HeadLeftShoot"-style direction strings prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Entity_Player::play_null_costume_anim (Entity_Player *this,int nullItemId,int unused,std_string *animName,int frame,int unused2) { byte bVar1; uint uVar2; std_string *psVar3; byte *curAnimChar; byte *****pppppbVar4; std_string *expectedName; byte *****expectedOverlayChar; int nullItem; uint uVar5; ANM2 *costumeSprite; bool isLess; uint layerIdx; PlayerCostumeMap *costumeMapEntry; byte *****overlayName [5]; uint overlayNameCapacity; byte *****overlayNameRestart [4]; undefined4 overlayNameRestartSize; uint overlayNameRestartCapacity; uint stackCookie; void *local_10; undefined1 *puStack_c; byte ****local_8; byte *animData; void *nullItems; local_8 = (byte ****)0xffffffff; puStack_c = &LAB_00afec65; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(overlayNameRestart + 10); ExceptionList = &local_10; if ((nullItemId < 0) || (nullItems = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)nullItems >> 2 <= nullItemId)) { nullItem = 0; } else { nullItem = *(int *)((int)nullItems + nullItemId * 4); } costumeMapEntry = this->_playerCostumeMap; layerIdx = 0; stackCookie = uVar2; do { if (((-1 < costumeMapEntry->_index) && (costumeMapEntry->_isBodyLayer == 0)) && (costumeSprite = (ANM2 *)(costumeMapEntry->_index * 0x130 + (int)(this->_costumeSpriteDescs)._begin), *(int *)costumeSprite[1]._filename._buf == nullItem)) { costumeSprite[1]._filename._buf[8] = '\x01'; if (frame < -1) { psVar3 = animName; if (0xf < animName->_capacity) { psVar3 = *(std_string **)animName->_buf; } ANM2::SetAnimation(costumeSprite,(byte *)psVar3,0); } else { psVar3 = animName; if (0xf < animName->_capacity) { psVar3 = *(std_string **)animName->_buf; } if ((costumeSprite->_animState)._animData != (void *)0x0) { animData = (costumeSprite->_animState)._animData; curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } expectedName = psVar3; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)expectedName->_buf[0]; if (bVar1 != expectedName->_buf[0]) { LAB_0075a4e4: uVar5 = -(uint)isLess | 1; goto LAB_0075a4e9; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)expectedName->_buf[1]; if (bVar1 != expectedName->_buf[1]) goto LAB_0075a4e4; curAnimChar = curAnimChar + 2; expectedName = (std_string *)(expectedName->_buf + 2); } while (bVar1 != 0); uVar5 = 0; LAB_0075a4e9: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((costumeSprite->_animState)._isPlaying != 0)))) goto LAB_0075a514; } bVar1 = ANM2::SetAnimation(costumeSprite,(byte *)psVar3,1); if (bVar1 != 0) { AnimationState::Rewind(&costumeSprite->_animState); (costumeSprite->_animState)._isPlaying = 1; } } LAB_0075a514: if (costumeSprite[1]._filename._buf[10] != '\0') { psVar3 = (std_string *)animName->_size; if (frame < -1) { if (0x7fffffffU - (int)psVar3 < 8) goto LAB_0075a6fa; expectedName = animName; if (0xf < animName->_capacity) { expectedName = *(std_string **)animName->_buf; } std::string::concat((char *)overlayName,nullItem,psVar3,(byte *)expectedName,(uint)psVar3, (byte *)"_Overlay",8); local_8 = (byte ****)0x1; pppppbVar4 = (byte *****)overlayName; if (0xf < overlayNameCapacity) { pppppbVar4 = overlayName[0]; } ANM2::SetOverlayAnimation(costumeSprite,(byte *)pppppbVar4,0); local_8 = (byte ****)0xffffffff; if (0xf < overlayNameCapacity) { uVar5 = overlayNameCapacity + 1; pppppbVar4 = overlayName[0]; if (0xfff < uVar5) { pppppbVar4 = (byte *****)overlayName[0][-1]; uVar5 = overlayNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)overlayName[0] + (-4 - (int)pppppbVar4))) goto LAB_0075a6d6; } operator_delete(pppppbVar4,uVar5); } } else { if (0x7fffffffU - (int)psVar3 < 8) { LAB_0075a6fa: /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar2); } expectedName = animName; if (0xf < animName->_capacity) { expectedName = *(std_string **)animName->_buf; } std::string::concat((char *)overlayNameRestart,nullItem,psVar3,(byte *)expectedName, (uint)psVar3,(byte *)"_Overlay",8); local_8 = (byte ****)0x2; pppppbVar4 = (byte *****)overlayNameRestart; if (0xf < overlayNameRestartCapacity) { pppppbVar4 = overlayNameRestart[0]; } if ((costumeSprite->_overlayAnimState)._animData == (void *)0x0) { LAB_0075a64e: bVar1 = ANM2::SetOverlayAnimation(costumeSprite,(byte *)pppppbVar4,1); if (bVar1 != 0) { AnimationState::Rewind(&costumeSprite->_overlayAnimState); (costumeSprite->_overlayAnimState)._isPlaying = 1; } } else { animData = (costumeSprite->_overlayAnimState)._animData; if (0xf < *(uint *)(animData + 0x14)) { animData = *(byte **)animData; } expectedOverlayChar = pppppbVar4; do { bVar1 = *animData; isLess = bVar1 < *(byte *)expectedOverlayChar; if (bVar1 != *(byte *)expectedOverlayChar) { LAB_0075a633: uVar5 = -(uint)isLess | 1; goto LAB_0075a638; } if (bVar1 == 0) break; bVar1 = animData[1]; isLess = bVar1 < *(byte *)((int)expectedOverlayChar + 1); if (bVar1 != *(byte *)((int)expectedOverlayChar + 1)) goto LAB_0075a633; animData = animData + 2; expectedOverlayChar = (byte *****)((int)expectedOverlayChar + 2); } while (bVar1 != 0); uVar5 = 0; LAB_0075a638: if ((uVar5 != 0) || ((*(char *)((int)(costumeSprite->_overlayAnimState)._animData + 0x34) != '\0' && ((costumeSprite->_overlayAnimState)._isPlaying == 0)))) goto LAB_0075a64e; } local_8 = (byte ****)0xffffffff; if (0xf < overlayNameRestartCapacity) { uVar5 = overlayNameRestartCapacity + 1; pppppbVar4 = overlayNameRestart[0]; if (0xfff < uVar5) { pppppbVar4 = (byte *****)overlayNameRestart[0][-1]; uVar5 = overlayNameRestartCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)overlayNameRestart[0] + (-4 - (int)pppppbVar4))) { LAB_0075a6d6: local_8 = (byte ****)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,uVar5); } overlayNameRestartSize = 0; overlayNameRestartCapacity = 0xf; overlayNameRestart[0] = (byte *****)((uint)overlayNameRestart[0] & 0xffffff00); } } } layerIdx = layerIdx + 1; costumeMapEntry = costumeMapEntry + 1; if (0xe < layerIdx) { ExceptionList = local_10; return; } } while( true ); } //@@ 0075a700 Entity_Player::update_item_anims /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Entity_Player (+0x1220 item-anim array of 0x130 entries, count +0x122c); Weapon::is_held_item, "_Overlay" ANM2::SetOverlayAnimation; called from Weapon::UpdateHeadChargeAnimation prototype: db/protos.zhl, confirmed by RET 24 */ void __thiscall Entity_Player::update_item_anims (Entity_Player *this,int unused1,ItemConfig_Item *item,int unused2,std_string *animName, int frame,int unused3) { byte bVar1; uint uVar2; uint uVar3; byte *******pppppppbVar4; std_string *animCStr; byte *pbVar5; byte *currentAnimCursor; byte *******pppppppbVar6; std_string *psVar7; ANM2 *sprite; bool bVar8; uint costumeIndex; PlayerCostumeMap *costumeEntry; std_string *animNameCStr; byte *******overlayAnimRestart [4]; undefined4 local_34; uint local_30; byte *******overlayAnim [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; byte ******local_8; local_8 = (byte ******)0xffffffff; puStack_c = &LAB_00afecad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(overlayAnim + 10); ExceptionList = &local_10; costumeEntry = this->_playerCostumeMap; costumeIndex = 0; local_14 = uVar2; do { if ((-1 < costumeEntry->_index) && (costumeEntry->_isBodyLayer == 0)) { sprite = (ANM2 *)(costumeEntry->_index * 0x130 + (int)(this->_costumeSpriteDescs)._begin); bVar1 = Weapon::is_held_item(sprite,animName,item); if (bVar1 != 0) { sprite[1]._filename._buf[8] = '\x01'; uVar3 = animName->_capacity; if (frame < 0) { if (frame < -1) { psVar7 = animName; if (0xf < uVar3) { psVar7 = *(std_string **)animName->_buf; } ANM2::SetAnimation(sprite,(byte *)psVar7,0); } else { animNameCStr = animName; if (0xf < uVar3) { animNameCStr = *(std_string **)animName->_buf; } pbVar5 = (sprite->_animState)._animData; if (pbVar5 != (byte *)0x0) { currentAnimCursor = pbVar5; psVar7 = animNameCStr; if (0xf < *(uint *)(pbVar5 + 0x14)) { currentAnimCursor = *(byte **)pbVar5; } do { bVar1 = *currentAnimCursor; bVar8 = bVar1 < (byte)psVar7->_buf[0]; if (bVar1 != psVar7->_buf[0]) { LAB_0075a831: uVar3 = -(uint)bVar8 | 1; goto LAB_0075a836; } if (bVar1 == 0) break; bVar1 = currentAnimCursor[1]; bVar8 = bVar1 < (byte)psVar7->_buf[1]; if (bVar1 != psVar7->_buf[1]) goto LAB_0075a831; currentAnimCursor = currentAnimCursor + 2; psVar7 = (std_string *)(psVar7->_buf + 2); } while (bVar1 != 0); uVar3 = 0; LAB_0075a836: if ((uVar3 == 0) && ((pbVar5[0x34] == 0 || ((sprite->_animState)._isPlaying != 0)))) goto LAB_0075a863; } bVar1 = ANM2::SetAnimation(sprite,(byte *)animNameCStr,1); if (bVar1 != 0) { AnimationState::Rewind(&sprite->_animState); (sprite->_animState)._isPlaying = 1; } } } else { psVar7 = animName; if (0xf < uVar3) { psVar7 = *(std_string **)animName->_buf; } bVar1 = ANM2::SetAnimation(sprite,(byte *)psVar7,1); if (((bVar1 != 0) && ((sprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&sprite->_animState,(float)frame), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } } LAB_0075a863: if (sprite[1]._filename._buf[10] != '\0') { psVar7 = (std_string *)animName->_size; uVar3 = 0x7fffffff - (int)psVar7; if (frame < 0) { if (frame < -1) { if (uVar3 < 8) { LAB_0075abd1: /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar2); } animCStr = animName; if (0xf < animName->_capacity) { animCStr = *(std_string **)animName->_buf; } std::string::concat((char *)overlayAnim,(int)item,psVar7,(byte *)animCStr,(uint)psVar7 ,(byte *)"_Overlay",8); local_8 = (byte ******)0x1; pppppppbVar4 = (byte *******)overlayAnim; if (0xf < local_18) { pppppppbVar4 = overlayAnim[0]; } ANM2::SetOverlayAnimation(sprite,(byte *)pppppppbVar4,0); local_8 = (byte ******)0xffffffff; if (0xf < local_18) { uVar3 = local_18 + 1; pppppppbVar4 = overlayAnim[0]; if (0xfff < uVar3) { pppppppbVar4 = (byte *******)overlayAnim[0][-1]; uVar3 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)overlayAnim[0] + (-4 - (int)pppppppbVar4))) goto LAB_0075ab2b; } operator_delete(pppppppbVar4,uVar3); } } else { if (uVar3 < 8) goto LAB_0075abd1; animCStr = animName; if (0xf < animName->_capacity) { animCStr = *(std_string **)animName->_buf; } std::string::concat((char *)overlayAnimRestart,(int)item,psVar7,(byte *)animCStr, (uint)psVar7,(byte *)"_Overlay",8); local_8 = (byte ******)0x2; pppppppbVar4 = (byte *******)overlayAnimRestart; if (0xf < local_30) { pppppppbVar4 = overlayAnimRestart[0]; } pbVar5 = (sprite->_overlayAnimState)._animData; if (pbVar5 == (byte *)0x0) { LAB_0075aa3f: bVar1 = ANM2::SetOverlayAnimation(sprite,(byte *)pppppppbVar4,1); if (bVar1 != 0) { AnimationState::Rewind(&sprite->_overlayAnimState); (sprite->_overlayAnimState)._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pppppppbVar6 = pppppppbVar4; do { bVar1 = *pbVar5; bVar8 = bVar1 < *(byte *)pppppppbVar6; if (bVar1 != *(byte *)pppppppbVar6) { LAB_0075aa27: uVar3 = -(uint)bVar8 | 1; goto LAB_0075aa2c; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar8 = bVar1 < *(byte *)((int)pppppppbVar6 + 1); if (bVar1 != *(byte *)((int)pppppppbVar6 + 1)) goto LAB_0075aa27; pbVar5 = pbVar5 + 2; pppppppbVar6 = (byte *******)((int)pppppppbVar6 + 2); } while (bVar1 != 0); uVar3 = 0; LAB_0075aa2c: if ((uVar3 != 0) || ((*(char *)((int)(sprite->_overlayAnimState)._animData + 0x34) != '\0' && ((sprite->_overlayAnimState)._isPlaying == 0)))) goto LAB_0075aa3f; } local_8 = (byte ******)0xffffffff; if (0xf < local_30) { uVar3 = local_30 + 1; pppppppbVar4 = overlayAnimRestart[0]; if (0xfff < uVar3) { pppppppbVar4 = (byte *******)overlayAnimRestart[0][-1]; uVar3 = local_30 + 0x24; if ((byte *)0x1f < (byte *)((int)overlayAnimRestart[0] + (-4 - (int)pppppppbVar4)) ) { LAB_0075ab2b: local_8 = (byte ******)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar4,uVar3); } local_34 = 0; local_30 = 0xf; overlayAnimRestart[0] = (byte *******)((uint)overlayAnimRestart[0] & 0xffffff00); } } else { if (uVar3 < 8) goto LAB_0075abd1; animCStr = animName; if (0xf < animName->_capacity) { animCStr = *(std_string **)animName->_buf; } std::string::concat((char *)overlayAnim,(int)item,psVar7,(byte *)animCStr,(uint)psVar7, (byte *)"_Overlay",8); local_8 = (byte ******)0x0; pppppppbVar4 = (byte *******)overlayAnim; if (0xf < local_18) { pppppppbVar4 = overlayAnim[0]; } bVar1 = ANM2::SetOverlayAnimation(sprite,(byte *)pppppppbVar4,1); if ((bVar1 != 0) && ((sprite->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&sprite->_overlayAnimState,(float)frame); } local_8 = (byte ******)0xffffffff; if (0xf < local_18) { uVar3 = local_18 + 1; pppppppbVar4 = overlayAnim[0]; if (0xfff < uVar3) { pppppppbVar4 = (byte *******)overlayAnim[0][-1]; uVar3 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)overlayAnim[0] + (-4 - (int)pppppppbVar4))) goto LAB_0075ab2b; } operator_delete(pppppppbVar4,uVar3); } } } } } costumeIndex = costumeIndex + 1; costumeEntry = costumeEntry + 1; } while (costumeIndex < 0xf); if ((this->_variant != 0) || (this->_isCoopGhost != 0)) { sprite = &this->_sprite; if (frame < 0) { if (frame < -1) { if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } ANM2::SetAnimation(sprite,(byte *)animName,0); } else { if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { currentAnimCursor = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { currentAnimCursor = *(byte **)pbVar5; } psVar7 = animName; do { bVar1 = *currentAnimCursor; bVar8 = bVar1 < (byte)psVar7->_buf[0]; if (bVar1 != psVar7->_buf[0]) { LAB_0075ab86: uVar2 = -(uint)bVar8 | 1; goto LAB_0075ab8b; } if (bVar1 == 0) break; bVar1 = currentAnimCursor[1]; bVar8 = bVar1 < (byte)psVar7->_buf[1]; if (bVar1 != psVar7->_buf[1]) goto LAB_0075ab86; currentAnimCursor = currentAnimCursor + 2; psVar7 = (std_string *)(psVar7->_buf + 2); } while (bVar1 != 0); uVar2 = 0; LAB_0075ab8b: if (uVar2 == 0) { if (pbVar5[0x34] == 0) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._isPlaying != 0) { ExceptionList = local_10; return; } } } bVar1 = ANM2::SetAnimation(sprite,(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } else { if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar1 = ANM2::SetAnimation(sprite,(byte *)animName,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)frame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } } } ExceptionList = local_10; return; } //@@ 0075abe0 Entity_Player::get_costume_anim_frame /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX player; scans the 15 costume layer slots (+0x122c index into +0x1220 array stride 0x130) for one whose item (+0x114) matches arg2 via Weapon::is_held_item, returns floor(anim frame +0x40) or -1/0; Weapon_Brimstone::Fire passes collectible 118 and acts when frame > 15 */ int __thiscall Entity_Player::get_costume_anim_frame(Entity_Player *this,undefined4 param_2,void *param_3) { bool bVar1; byte bVar2; void *ptr; uint size; ANM2 *sprite; PlayerCostumeMap *pPVar3; double dVar4; uint local_38; void *local_2c [4]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; puStack_c = &LAB_00afecfe; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; pPVar3 = this->_playerCostumeMap; local_38 = 0; do { if ((-1 < pPVar3->_index) && (pPVar3->_isBodyLayer == 0)) { local_18 = 0xf; local_1c = 0; local_2c[0] = (void *)0x0; sprite = (ANM2 *)(pPVar3->_index * 0x130 + (int)(this->_costumeSpriteDescs)._begin); local_8 = (void *)0x0; bVar2 = Weapon::is_held_item(sprite,(std_string *)local_2c,param_3); if ((bVar2 == 0) || (((sprite->_animState)._animData == (void *)0x0 || (bVar1 = true, (sprite->_animState)._isPlaying == 0)))) { bVar1 = false; } local_8 = (void *)0xffffffff; if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } if (bVar1) { if ((sprite->_animState)._animData == (void *)0x0) { ExceptionList = local_10; return -1; } dVar4 = floor((double)(sprite->_animState)._animFrame); ExceptionList = local_10; return (int)dVar4; } } local_38 = local_38 + 1; pPVar3 = pPVar3 + 1; if (0xe < local_38) { ExceptionList = local_10; return 0; } } while( true ); } //@@ 0075ad50 Entity_Player::play_item_costume_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (.., ItemConfig_Item*, .., std::string anim): for each costume map entry (+0x122c, sprites +0x1220 stride 0x130) where Weapon::is_held_item matches the item, plays anim (and the "_Overlay" variant); Weapon::play_brimstone_costume_shoot (Brimstone 0x76), Entity_Player::update_effects */ void __thiscall Entity_Player::play_item_costume_anim (Entity_Player *this,undefined4 param_2,void *param_3,undefined4 param_4, std_string *param_5,int param_6) { byte bVar1; char cVar2; std_string *psVar3; std_string *left; undefined4 *****pppppuVar4; uint uVar5; undefined4 *****pppppuVar6; ANM2 *sprite; undefined1 auStack_3c [3]; char local_39; uint local_38; PlayerCostumeMap *local_34; uint local_30; Entity_Player *local_2c; void *local_28; undefined4 *****local_24 [5]; uint local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_3c; uVar5 = 0; local_28 = param_3; local_30 = 0; local_34 = this->_playerCostumeMap; local_38 = 0; local_2c = this; do { if ((-1 < local_34->_index) && (local_34->_isBodyLayer == 0)) { sprite = (ANM2 *)(local_34->_index * 0x130 + (int)(local_2c->_costumeSpriteDescs)._begin); bVar1 = Weapon::is_held_item(sprite,param_5,local_28); if (bVar1 != 0) { psVar3 = param_5; if (0xf < param_5->_capacity) { psVar3 = *(std_string **)param_5->_buf; } bVar1 = ANM2::IsPlaying(sprite,(byte *)psVar3); if ((bVar1 != 0) && ((sprite->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&sprite->_animState,(float)param_6); } if (sprite[1]._filename._buf[10] == '\0') { pppppuVar6 = local_24[0]; LAB_0075ae61: local_39 = '\0'; } else { psVar3 = (std_string *)param_5->_size; if (0x7fffffffU - (int)psVar3 < 8) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } left = param_5; if (0xf < param_5->_capacity) { left = *(std_string **)param_5->_buf; } std::string::concat((char *)local_24,(int)local_28,psVar3,(byte *)left,(uint)psVar3, (byte *)"_Overlay",8); pppppuVar6 = local_24[0]; local_38 = uVar5 | 3; pppppuVar4 = local_24; if (0xf < local_10) { pppppuVar4 = local_24[0]; } cVar2 = FUN_0040a9f0(pppppuVar4); if (cVar2 == '\0') goto LAB_0075ae61; local_39 = '\x01'; } if (((local_38 & 1) != 0) && (local_38 = local_38 & 0xfffffffe, 0xf < local_10)) { uVar5 = local_10 + 1; pppppuVar4 = pppppuVar6; if (0xfff < uVar5) { pppppuVar4 = (undefined4 *****)pppppuVar6[-1]; uVar5 = local_10 + 0x24; if (0x1f < (uint)((int)pppppuVar6 + (-4 - (int)pppppuVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppuVar4,uVar5); } if ((local_39 != '\0') && ((sprite->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&sprite->_overlayAnimState,(float)param_6); } uVar5 = local_38; } } local_30 = local_30 + 1; local_34 = local_34 + 1; if (0xe < local_30) { return; } } while( true ); } //@@ 0075af10 Entity_Player::GetCostumeNullPos /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [lua] Lua binding EntityPlayer:GetCostumeNullPos prototype: db/protos.zhl, confirmed by RET 16 */ Vector * __thiscall Entity_Player::GetCostumeNullPos (Entity_Player *this,Vector *outPosition,std_string *nullFrameName,byte isHeadScale, Vector *direction) { float *nullFrame; byte *******pppppppbVar1; float *costumeNullFrame; std_string *nullName; LayerState *headLayer; void *pvVar2; uint freeSize; undefined4 *******pppppppuVar3; undefined4 *******ptr; float posX; float posY; float fVar4; float fVar5; int costumesLeft; std_string *local_a8; PlayerCostumeMap *local_a4; undefined8 headRightName; undefined1 local_94; undefined1 local_93; undefined4 headRightSize; uint headRightCapacity; void *headUpName; undefined2 local_80; undefined1 local_7e; undefined4 headUpSize; uint headUpCapacity; void *headLeftName; char local_68 [12]; undefined4 headLeftSize; uint headLeftCapacity; undefined4 *******local_54; char local_50 [12]; undefined4 local_44; uint local_40; byte *******dirAnimName [4]; std_string *dirAnimNameSize; uint dirAnimNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; int costumeIndex; puStack_20 = (undefined1 *)(dirAnimName + 0xe); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00afed68; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(dirAnimName + 0xb); ExceptionList = &local_1c; if ((direction->x != g_vectorZero.x) || (pppppppbVar1 = (byte *******)(dirAnimName + 0xe), direction->y != g_vectorZero.y)) { pppppppuVar3 = (undefined4 *******)0x64616548; local_40 = 0xf; local_44 = 8; local_54 = (undefined4 *******)0x64616548; builtin_strncpy(local_50,"Down",5); headRightCapacity = 0xf; headRightSize = 9; headRightName = 0x6867695264616548; local_94 = 0x74; local_93 = 0; local_a8 = (std_string *)0x64616548; headUpName = (void *)0x64616548; headUpCapacity = 0xf; headUpSize = 6; local_80 = 0x7055; local_7e = 0; headLeftCapacity = 0xf; headLeftSize = 8; local_a4 = (PlayerCostumeMap *)0x64616548; headLeftName = (void *)0x64616548; builtin_strncpy(local_68,"Left",5); local_14 = (byte ******)0x3; if (ABS(direction->x) <= ABS(direction->y)) { if (0.0 <= direction->y) { std::string::string((char *)dirAnimName,&local_54); pppppppuVar3 = local_54; } else { puStack_20 = (undefined1 *)(dirAnimName + 0xe); std::string::string((char *)dirAnimName,&headUpName); local_a8 = headUpName; } LAB_0075b0b1: } else { if (0.0 <= direction->x) { puStack_20 = (undefined1 *)(dirAnimName + 0xe); std::string::string((char *)dirAnimName,&headRightName); goto LAB_0075b0b1; } puStack_20 = (undefined1 *)(dirAnimName + 0xe); std::string::string((char *)dirAnimName,&headLeftName); local_a4 = headLeftName; } local_14._0_1_ = 5; if (0xf < headLeftCapacity) { freeSize = headLeftCapacity + 1; pvVar2 = local_a4; if (0xfff < freeSize) { pvVar2 = *(void **)((int)local_a4 + -4); freeSize = headLeftCapacity + 0x24; if (0x1f < (uint)((int)local_a4 + (-4 - (int)pvVar2))) goto LAB_0075b329; } operator_delete(pvVar2,freeSize); } local_14._0_1_ = 6; if (0xf < headUpCapacity) { freeSize = headUpCapacity + 1; nullName = local_a8; if (0xfff < freeSize) { nullName = *(std_string **)((int)local_a8 + -4); freeSize = headUpCapacity + 0x24; if (0x1f < (uint)((int)local_a8 + (-4 - (int)nullName))) goto LAB_0075b329; } operator_delete(nullName,freeSize); } local_14._0_1_ = 7; if (0xf < headRightCapacity) { freeSize = headRightCapacity + 1; pvVar2 = (void *)headRightName; if (0xfff < freeSize) { pvVar2 = *(void **)((int)(void *)headRightName + -4); freeSize = headRightCapacity + 0x24; if (0x1f < (uint)((int)(void *)headRightName + (-4 - (int)pvVar2))) goto LAB_0075b329; } operator_delete(pvVar2,freeSize); } local_14._0_1_ = 8; if (0xf < local_40) { freeSize = local_40 + 1; ptr = pppppppuVar3; if (0xfff < freeSize) { ptr = (undefined4 *******)pppppppuVar3[-1]; freeSize = local_40 + 0x24; if (0x1f < (uint)((int)pppppppuVar3 + (-4 - (int)ptr))) goto LAB_0075b329; } operator_delete(ptr,freeSize); } nullName = nullFrameName; if (0xf < nullFrameName->_capacity) { nullName = *(std_string **)nullFrameName->_buf; } pppppppbVar1 = (byte *******)dirAnimName; if (0xf < dirAnimNameCapacity) { pppppppbVar1 = dirAnimName[0]; } nullFrame = (float *)ANM2::GetNullFrame(&this->_sprite,pppppppbVar1,nullName,1); if ((nullFrame == (float *)0x0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { if (0x7fffffffU - (int)dirAnimNameSize < 8) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar1 = (byte *******)dirAnimName; if (0xf < dirAnimNameCapacity) { pppppppbVar1 = dirAnimName[0]; } std::string::concat((char *)&local_54,(int)outPosition,dirAnimNameSize,(byte *)pppppppbVar1, (uint)dirAnimNameSize,(byte *)"_Overlay",8); local_14._0_1_ = 9; nullName = nullFrameName; if (0xf < nullFrameName->_capacity) { nullName = *(std_string **)nullFrameName->_buf; } pppppppuVar3 = &local_54; if (0xf < local_40) { pppppppuVar3 = local_54; } nullFrame = (float *)ANM2::GetNullFrame(&this->_sprite,pppppppuVar3,nullName,1); local_14._0_1_ = 8; if (0xf < local_40) { freeSize = local_40 + 1; pppppppuVar3 = local_54; if (0xfff < freeSize) { pppppppuVar3 = (undefined4 *******)local_54[-1]; freeSize = local_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pppppppuVar3))) goto LAB_0075b329; } operator_delete(pppppppuVar3,freeSize); } } if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { local_a8 = (std_string *)this->_playerCostumeMap; local_a4 = (PlayerCostumeMap *)0xf; do { if (-1 < *(int *)local_a8->_buf) { nullName = nullFrameName; if (0xf < nullFrameName->_capacity) { nullName = *(std_string **)nullFrameName->_buf; } pppppppbVar1 = (byte *******)dirAnimName; if (0xf < dirAnimNameCapacity) { pppppppbVar1 = dirAnimName[0]; } costumeNullFrame = (float *)ANM2::GetNullFrame((ANM2 *)(*(int *)local_a8->_buf * 0x130 + (int)(this->_costumeSpriteDescs)._begin), pppppppbVar1,nullName,1); if (costumeNullFrame != (float *)0x0) { nullFrame = costumeNullFrame; } } local_a8 = (std_string *)((int)local_a8 + 0x10); local_a4 = (PlayerCostumeMap *)((int)local_a4 + -1); } while (local_a4 != (PlayerCostumeMap *)0x0); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < dirAnimNameCapacity) { freeSize = dirAnimNameCapacity + 1; pppppppbVar1 = dirAnimName[0]; if (0xfff < freeSize) { pppppppbVar1 = (byte *******)dirAnimName[0][-1]; freeSize = dirAnimNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)dirAnimName[0] + (-4 - (int)pppppppbVar1))) { LAB_0075b329: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar1,freeSize); } pppppppbVar1 = (byte *******)puStack_20; if (nullFrame != (float *)0x0) goto LAB_0075b451; } puStack_20 = (undefined1 *)pppppppbVar1; nullName = nullFrameName; if (0xf < nullFrameName->_capacity) { nullName = *(std_string **)nullFrameName->_buf; } if ((this->_sprite)._animState._animData == (void *)0x0) { nullFrame = (float *)0x0; LAB_0075b370: if ((this->_sprite)._overlayAnimState._animData != (void *)0x0) { nullName = nullFrameName; if (0xf < nullFrameName->_capacity) { nullName = *(std_string **)nullFrameName->_buf; } nullFrame = AnimationState::GetNullFrame(&(this->_sprite)._overlayAnimState,(byte *)nullName); } } else { nullFrame = AnimationState::GetNullFrame(&(this->_sprite)._animState,(byte *)nullName); if (nullFrame == (float *)0x0) goto LAB_0075b370; } if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { local_a4 = this->_playerCostumeMap; costumesLeft = 0xf; do { costumeIndex = local_a4->_index; if (-1 < costumeIndex) { local_a8 = nullFrameName; pvVar2 = (this->_costumeSpriteDescs)._begin; if (0xf < nullFrameName->_capacity) { local_a8 = *(std_string **)nullFrameName->_buf; } if (*(int *)((int)pvVar2 + costumeIndex * 0x130 + 0x34) != 0) { costumeNullFrame = AnimationState::GetNullFrame ((AnimationState *)((int)pvVar2 + costumeIndex * 0x130 + 0x30), (byte *)local_a8); if (costumeNullFrame != (float *)0x0) { nullFrame = costumeNullFrame; } } } local_a4 = local_a4 + 1; costumesLeft = costumesLeft + -1; } while (costumesLeft != 0); } if (nullFrame == (float *)0x0) { outPosition->x = g_vectorZero.x; outPosition->y = g_vectorZero.y; ExceptionList = local_1c; return outPosition; } LAB_0075b451: fVar4 = (this->_sprite)._scale.x; fVar5 = (this->_sprite)._scale.y; posX = fVar4 * *nullFrame; posY = fVar5 * nullFrame[1]; if (isHeadScale != 0) { fVar4 = fVar4 * 0.0; fVar5 = fVar5 * -5.0; posX = posX - fVar4; posY = posY - fVar5; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { headLayer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); posX = posX * (headLayer->_size).x; posY = posY * (headLayer->_size).y; } posX = posX + fVar4; posY = posY + fVar5; } outPosition->x = posX; outPosition->y = posY; ExceptionList = local_1c; return outPosition; } //@@ 0075b540 costume_path_apply_skin_color /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: free fn (out,path,-1,playerType,..): finds "costumes" in path and appends _black/_blue/_green/_grey/_white skin suffix, ModManager::TryRedirectPath; callers UpdateCostumes/update_player_skin prototype: db/protos.zhl, confirmed by RET 24 */ void * costume_path_apply_skin_color (void *outPath,void *path,int skinColor,int playerType,byte *outIsPlayerPathFound, byte *outIsSkinPathFound) { bool bVar1; bool bVar2; byte bVar3; void *pvVar4; void **other; uint uVar5; int iVar6; char *pcVar7; undefined4 *puVar8; void *left; undefined4 extraout_EAX; std_string *psVar9; std_string *psVar10; char *extraout_EAX_00; byte *pbVar11; undefined4 uVar12; uint uVar13; byte local_ee; byte local_ed; void *local_e4 [4]; int local_d4; uint local_d0; void *local_cc [4]; undefined4 local_bc; uint local_b8; std_string local_b4; std_string local_9c; void *local_84 [4]; undefined4 local_74; uint local_70; std_string local_6c; void *local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined8 local_44; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_84 + 0x20); puStack_18 = &LAB_00afee77; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_84 + 0x1d); ExceptionList = &local_1c; local_14 = (void *)0x0; std::string::string(outPath,path); local_14 = (void *)0x0; local_ee = 0; local_ed = 0; if (playerType != -1) { if (((playerType < 0) || (pvVar4 = (g_manager->_entityConfig)._players._begin, ((int)(g_manager->_entityConfig)._players._end - (int)pvVar4) / 0x148 <= playerType)) || (pvVar4 = (void *)(playerType * 0x148 + (int)pvVar4), pvVar4 == (void *)0x0)) { local_44 = 0xf00000000; local_54 = (void *)0x0; other = &local_54; local_14 = (void *)0x2; bVar2 = false; bVar1 = true; } else { other = std::string::string(local_b4._buf,(void *)((int)pvVar4 + 0x94)); local_14 = (void *)0x1; bVar2 = true; bVar1 = false; } std::string::string((char *)local_e4,other); local_14._0_1_ = 4; local_14._1_3_ = 0; if ((bVar1) && (0xf < local_44._4_4_)) { uVar13 = local_44._4_4_ + 1; pvVar4 = local_54; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_54 + -4); uVar13 = local_44._4_4_ + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar4))) goto LAB_0075b713; } operator_delete(pvVar4,uVar13); } local_14._0_1_ = 5; if (bVar2) { if (0xf < local_b4._capacity) { uVar13 = local_b4._capacity + 1; pvVar4 = (void *)local_b4._buf._0_4_; if (0xfff < uVar13) { pvVar4 = *(void **)(local_b4._buf._0_4_ + -4); uVar13 = local_b4._capacity + 0x24; if (0x1f < (uint)(local_b4._buf._0_4_ + (-4 - (int)pvVar4))) { LAB_0075b713: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar13); } local_b4._size = 0; local_b4._capacity = 0xf; local_b4._buf._0_4_ = local_b4._buf._0_4_ & 0xffffff00; } if (local_d4 != 0) { uVar13 = 0xffffffff; do { pbVar11 = path; if (0xf < *(uint *)((int)path + 0x14)) { pbVar11 = *(byte **)path; } uVar5 = std::string::find_last_of (pbVar11,*(uint *)((int)path + 0x10),uVar13,&DAT_00b6ac04,2); if ((uVar5 == 0xffffffff) || (uVar5 < 8)) goto LAB_0075ba8b; uVar13 = uVar5 - 1; pvVar4 = path; if (0xf < *(uint *)((int)path + 0x14)) { pvVar4 = *(void **)path; } iVar6 = strncmp((char *)((int)pvVar4 + (uVar5 - 8)),"costumes",8); } while (iVar6 != 0); if (uVar13 != 0xffffffff) { pvVar4 = (void *)FUN_00651a90(local_84,uVar5,0xffffffff); local_14._0_1_ = 6; pcVar7 = (char *)FUN_00651a90(&local_9c,0,uVar5); local_14._0_1_ = 7; puVar8 = std::string::append(pcVar7,&DAT_00b6ac00,1); local_54 = (void *)*puVar8; uStack_50 = puVar8[1]; uStack_4c = puVar8[2]; uStack_48 = puVar8[3]; local_44 = *(undefined8 *)(puVar8 + 4); puVar8[4] = 0; puVar8[5] = 0xf; *(undefined1 *)puVar8 = 0; local_14._0_1_ = 8; left = (void *)FUN_00651d50(local_e4); local_14._0_1_ = 9; std::string::concat_move(local_3c._buf,(int)outPath,left,pvVar4); local_14._0_1_ = 0xb; if (0xf < local_b8) { uVar13 = local_b8 + 1; pvVar4 = local_cc[0]; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_cc[0] + -4); uVar13 = local_b8 + 0x24; if (0x1f < (uint)((int)local_cc[0] + (-4 - (int)pvVar4))) goto LAB_0075b994; } operator_delete(pvVar4,uVar13); } local_bc = 0; local_b8 = 0xf; local_cc[0] = (void *)((uint)local_cc[0] & 0xffffff00); local_14._0_1_ = 0xc; if (0xf < local_44._4_4_) { uVar13 = local_44._4_4_ + 1; pvVar4 = local_54; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_54 + -4); uVar13 = local_44._4_4_ + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar4))) goto LAB_0075b994; } operator_delete(pvVar4,uVar13); } local_44 = 0xf00000000; local_54 = (void *)((uint)local_54 & 0xffffff00); local_14._0_1_ = 0xd; if (0xf < local_9c._capacity) { uVar13 = local_9c._capacity + 1; pvVar4 = (void *)local_9c._buf._0_4_; if (0xfff < uVar13) { pvVar4 = *(void **)(local_9c._buf._0_4_ + -4); uVar13 = local_9c._capacity + 0x24; if (0x1f < (uint)(local_9c._buf._0_4_ + (-4 - (int)pvVar4))) goto LAB_0075b994; } operator_delete(pvVar4,uVar13); } local_9c._size = 0; local_9c._capacity = 0xf; local_9c._buf._0_4_ = local_9c._buf._0_4_ & 0xffffff00; local_14._0_1_ = 0xe; if (0xf < local_70) { uVar13 = local_70 + 1; pvVar4 = local_84[0]; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_84[0] + -4); uVar13 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar4))) { LAB_0075b994: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar13); } local_74 = 0; local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); ModManager::TryRedirectPath(&g_manager->_modManager,&local_b4,&local_3c); FUN_004215a0(extraout_EAX); if (0xf < local_b4._capacity) { uVar13 = local_b4._capacity + 1; pvVar4 = (void *)local_b4._buf._0_4_; if (0xfff < uVar13) { pvVar4 = *(void **)(local_b4._buf._0_4_ + -4); uVar13 = local_b4._capacity + 0x24; if (0x1f < (uint)(local_b4._buf._0_4_ + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar13); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } bVar3 = file_exists((byte *)psVar9); if (bVar3 != 0) { if (outPath != &local_3c) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } std::string::assign(outPath,(byte *)psVar9,local_3c._size); } local_ee = 1; } local_14._0_1_ = 5; if (0xf < local_3c._capacity) { uVar13 = local_3c._capacity + 1; psVar9 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar13) { psVar9 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar13 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar9,uVar13); } } } LAB_0075ba8b: local_14._0_1_ = 0; if (0xf < local_d0) { uVar13 = local_d0 + 1; pvVar4 = local_e4[0]; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_e4[0] + -4); uVar13 = local_d0 + 0x24; if (0x1f < (uint)((int)local_e4[0] + (-4 - (int)pvVar4))) goto LAB_0075be98; } operator_delete(pvVar4,uVar13); } } if (skinColor == -1) goto LAB_0075bea8; local_3c._capacity = 0xf; local_3c._size = 6; builtin_strncpy(local_3c._buf,"_white",7); local_14._0_1_ = 0x10; local_14._1_3_ = 0; if (skinColor == 1) { local_3c._size = 6; memmove(&local_3c,"_black",6); local_3c._buf[6] = '\0'; } else if (skinColor == 2) { pcVar7 = "_blue"; LAB_0075bb7a: local_3c._size = 5; memmove(&local_3c,pcVar7,5); local_3c._buf[5] = '\0'; } else if (skinColor == 3) { local_3c._size = 4; local_3c._buf._0_4_ = (std_string *)0x6465725f; local_3c._buf[4] = '\0'; local_3c._buf[5] = 'e'; } else if (skinColor == 4) { local_3c._size = 6; memmove(&local_3c,"_green",6); local_3c._buf[6] = '\0'; } else if (skinColor == 5) { pcVar7 = "_grey"; goto LAB_0075bb7a; } uVar13 = local_3c._capacity; psVar9 = (std_string *)local_3c._buf._0_4_; pbVar11 = outPath; if (0xf < *(uint *)((int)outPath + 0x14)) { pbVar11 = *(byte **)outPath; } iVar6 = std::string::find_last_of (pbVar11,*(uint *)((int)outPath + 0x10),0xffffffff,&DAT_00b1cebc,1); if (iVar6 != -1) { FUN_00651a90(local_e4,iVar6,0xffffffff); local_14._0_1_ = 0x11; FUN_00651a90(local_cc,0,iVar6); local_14._0_1_ = 0x12; pcVar7 = (char *)FUN_00651a90(local_84,0,iVar6); local_14._0_1_ = 0x13; psVar10 = &local_3c; if (0xf < uVar13) { psVar10 = psVar9; } puVar8 = std::string::append(pcVar7,(byte *)psVar10,local_3c._size); local_54 = (void *)*puVar8; uStack_50 = puVar8[1]; uStack_4c = puVar8[2]; uStack_48 = puVar8[3]; local_44 = *(undefined8 *)(puVar8 + 4); puVar8[4] = 0; puVar8[5] = 0xf; *(undefined1 *)puVar8 = 0; local_14._0_1_ = 0x14; FUN_00651d50(local_e4); local_14._0_1_ = 0x16; if (0xf < local_44._4_4_) { uVar13 = local_44._4_4_ + 1; pvVar4 = local_54; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_54 + -4); uVar13 = local_44._4_4_ + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar4))) goto LAB_0075bcfd; } operator_delete(pvVar4,uVar13); } local_44 = 0xf00000000; local_54 = (void *)((uint)local_54 & 0xffffff00); local_14._0_1_ = 0x17; if (0xf < local_70) { uVar13 = local_70 + 1; pvVar4 = local_84[0]; if (0xfff < uVar13) { pvVar4 = *(void **)((int)local_84[0] + -4); uVar13 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar4))) { LAB_0075bcfd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar13); } local_74 = 0; local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); ModManager::TryRedirectPath(&g_manager->_modManager,&local_9c,&local_6c); if (&local_6c != (std_string *)extraout_EAX_00) { std::string::_Tidy_deallocate(local_6c._buf); local_6c._buf._0_4_ = *(undefined4 *)extraout_EAX_00; local_6c._buf._4_4_ = *(undefined4 *)(extraout_EAX_00 + 4); local_6c._buf._8_4_ = *(undefined4 *)(extraout_EAX_00 + 8); local_6c._buf._12_4_ = *(undefined4 *)(extraout_EAX_00 + 0xc); local_6c._16_8_ = *(undefined8 *)(extraout_EAX_00 + 0x10); extraout_EAX_00[0x10] = '\0'; extraout_EAX_00[0x11] = '\0'; extraout_EAX_00[0x12] = '\0'; extraout_EAX_00[0x13] = '\0'; extraout_EAX_00[0x14] = '\x0f'; extraout_EAX_00[0x15] = '\0'; extraout_EAX_00[0x16] = '\0'; extraout_EAX_00[0x17] = '\0'; *extraout_EAX_00 = '\0'; } if (0xf < local_9c._capacity) { uVar13 = local_9c._capacity + 1; pvVar4 = (void *)local_9c._buf._0_4_; if (0xfff < uVar13) { pvVar4 = *(void **)(local_9c._buf._0_4_ + -4); uVar13 = local_9c._capacity + 0x24; if (0x1f < (uint)(local_9c._buf._0_4_ + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar13); } pbVar11 = (byte *)&local_6c; if (0xf < local_6c._capacity) { pbVar11 = (byte *)local_6c._buf._0_4_; } bVar3 = file_exists(pbVar11); if (bVar3 == 0) { uVar12 = FUN_00694120(local_e4); FUN_004215a0(uVar12); std::string::_Tidy_deallocate(local_9c._buf); } else { if (outPath != &local_6c) { pbVar11 = (byte *)&local_6c; if (0xf < local_6c._capacity) { pbVar11 = (byte *)local_6c._buf._0_4_; } std::string::assign(outPath,pbVar11,local_6c._size); } local_ed = 1; } if (0xf < local_6c._capacity) { uVar13 = local_6c._capacity + 1; pbVar11 = (byte *)local_6c._buf._0_4_; if (0xfff < uVar13) { pbVar11 = *(byte **)(local_6c._buf._0_4_ + 0xfffffffc); uVar13 = local_6c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_6c._buf._0_4_ + (-4 - (int)pbVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar11,uVar13); } local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; std::string::_Tidy_deallocate((char *)local_cc); std::string::_Tidy_deallocate((char *)local_e4); uVar13 = local_3c._capacity; psVar9 = (std_string *)local_3c._buf._0_4_; } if (0xf < uVar13) { uVar5 = uVar13 + 1; psVar10 = psVar9; if (0xfff < uVar5) { psVar10 = (std_string *)psVar9[-1]._capacity; uVar5 = uVar13 + 0x24; if ((byte *)0x1f < (byte *)((int)psVar9 + (-4 - (int)psVar10))) { LAB_0075be98: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar10,uVar5); } LAB_0075bea8: if (outIsPlayerPathFound != (byte *)0x0) { *outIsPlayerPathFound = local_ed; } if (outIsSkinPathFound != (byte *)0x0) { *outIsSkinPathFound = local_ee; } ExceptionList = local_1c; return outPath; } //@@ 0075bf00 Entity_Player::UpdateCostumes /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: rebuilds costume sprites; called by AddCostume/RemoveCostume/EvaluateItems, costume skin alt strings prototype: db/protos.zhl */ void __thiscall Entity_Player::UpdateCostumes(Entity_Player *this) { int iVar1; float fVar2; float fVar3; byte bVar4; void *costumeIter; int *piVar5; ItemConfig_Item *nullItem; uint uVar6; LayerState *layer; byte *pbVar7; float fVar8; undefined4 *headSkinPath; undefined4 *puVar9; std_string *pngFilename; void *pvVar10; char cVar11; byte extraout_CL; byte extraout_CL_00; undefined4 layerId; byte *expectedAnimName; ColorMod *layerColor; undefined4 *extraout_ECX; undefined4 *extraout_ECX_00; undefined4 *puVar12; undefined4 *extraout_ECX_01; undefined4 *extraout_ECX_02; undefined4 *extraout_ECX_03; int iVar13; uint size; ANM2 *costumeSprite; byte *pbVar14; Entity_Player *playerAlias; bool isNameLess; char *pcVar15; undefined1 eraseResult [4]; LayerState *local_e4; int matchedLayers; ANM2 *local_dc; byte *bodyIndex; void *playerConfig; undefined4 *headColor; ANM2 *local_cc; int local_c8; undefined4 *bodyColor; uint local_c0; byte *local_bc; std_vector *costumeDescs; byte local_b1; Entity_Player *local_b0; char local_aa; char local_a9; undefined4 *local_a8; byte local_a2; byte local_a1; undefined4 local_a0 [5]; char bodySkinPathTmp [12]; undefined4 local_80; undefined4 uStack_7c; float local_78; std_string headSheetPath; std_string bodySheetPath; std_string skinPath; std_string tmpPath; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *effectsEnd; local_8 = 0xffffffff; puStack_c = &LAB_00afeef5; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&tmpPath + 0x28U; local_c0 = 0; if (this->_variant == 1) { return; } if (DAT_00c81148 != '\0') { return; } pvVar10 = (this->_costumeSpriteDescs)._end; local_a9 = '\0'; iVar13 = -1; local_a1 = 0; local_aa = '\0'; local_a2 = 0; costumeDescs = &this->_costumeSpriteDescs; costumeIter = costumeDescs->_begin; DAT_00c81148 = '\x01'; local_c8 = -1; local_a8 = (undefined4 *)0x4b; if (costumeIter == pvVar10) { LAB_0075c0c6: local_a8 = (undefined4 *)0xffffffff; } else { local_b1 = this->_canFly; do { piVar5 = *(int **)((int)costumeIter + 0x114); if (piVar5 != (int *)0x0) { iVar1 = *piVar5; if (((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) { iVar1 = piVar5[1]; if (iVar1 < 0x253) { if (iVar1 == 0x252) { local_a9 = '\x01'; } else if (iVar1 == 0x82) { local_a8 = (undefined4 *)0x4d; } else if (iVar1 == 0xb5) { local_a8 = (undefined4 *)0x4e; } } else if (iVar1 == 0x271) { local_a2 = 1; } else if (iVar1 == 0x2c0) { local_a1 = 1; } } else if (*piVar5 == 0) { iVar1 = piVar5[1]; iVar13 = iVar1; if (3 < iVar1 - 0x4bU) { iVar13 = local_c8; } local_c8 = iVar13; if (iVar1 == 0x67) { local_aa = '\x01'; } } } if ((((local_b1 != 0) && (*(char *)((int)costumeIter + 0x11d) != '\0')) && ((piVar5 == (int *)0x0 || (3 < piVar5[1] - 0x4bU)))) && (local_a8 == (undefined4 *)0x4b)) { local_a8 = (undefined4 *)0x4c; } costumeIter = (void *)((int)costumeIter + 0x130); pvVar10 = (this->_costumeSpriteDescs)._end; } while (costumeIter != pvVar10); if (local_a9 == '\0') goto LAB_0075c0c6; } ExceptionList = &local_10; local_b0 = this; if (local_a8 != (undefined4 *)iVar13) { costumeIter = (this->_costumeSpriteDescs)._begin; if (costumeIter != pvVar10) { do { piVar5 = *(int **)((int)costumeIter + 0x114); if (((piVar5 == (int *)0x0) || (*piVar5 != 0)) || (3 < piVar5[1] - 0x4bU)) { costumeIter = (void *)((int)costumeIter + 0x130); } else { piVar5 = (int *)std::vector::erase(eraseResult,costumeIter); costumeIter = (void *)*piVar5; } } while (costumeIter != (this->_costumeSpriteDescs)._end); } if (local_a8 != (undefined4 *)0xffffffff) { if (((int)local_a8 < 0) || (pvVar10 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar10 >> 2 <= (int)local_a8)) { nullItem = (ItemConfig_Item *)0x0; } else { nullItem = *(ItemConfig_Item **)((int)pvVar10 + (int)local_a8 * 4); } AddCostume(this,nullItem,0); } } if ((local_a1 == 0) || (this->_playerType != 0x1b)) { cVar11 = '\0'; } else { cVar11 = '\x01'; } if (cVar11 != local_aa) { pvVar10 = (g_manager->_itemConfig)._nullItems._begin; iVar13 = (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar10 >> 2; if (local_aa == '\0') { if (iVar13 < 0x68) { nullItem = (ItemConfig_Item *)0x0; } else { nullItem = *(ItemConfig_Item **)((int)pvVar10 + 0x19c); } AddCostume(this,nullItem,0); } else if (iVar13 < 0x68) { RemoveCostume(this,(ItemConfig_Item *)0x0); } else { RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar10 + 0x19c)); } } iVar13 = this->_playerType; if ((iVar13 < 0) || (playerConfig = (g_manager->_entityConfig)._players._begin, ((int)(g_manager->_entityConfig)._players._end - (int)playerConfig) / 0x148 <= iVar13)) { playerConfig = (void *)0x0; LAB_0075c224: KAGE_LogMessage(0x10,(byte *)"Could not load config for player type %d\n"); } else { playerConfig = (void *)(iVar13 * 0x148 + (int)playerConfig); if (playerConfig == (void *)0x0) goto LAB_0075c224; } headColor = *(undefined4 **)((int)playerConfig + 0xe4); uVar6 = 0; piVar5 = &local_b0->_playerCostumeMap[0]._layerID; do { ((PlayerCostumeMap *)(piVar5 + -1))->_index = -1; *piVar5 = -1; piVar5[1] = -1; if (((uVar6 == 0) || (3 < uVar6)) && (uVar6 != 0xb)) { bVar4 = 0; } else { bVar4 = 1; } *(byte *)(piVar5 + 2) = bVar4; uVar6 = uVar6 + 1; piVar5 = piVar5 + 4; } while (uVar6 < 0xf); local_c8 = -1; local_a8 = (undefined4 *)0xffffffff; local_bc = (byte *)0x0; pvVar10 = costumeDescs->_begin; bodyColor = headColor; if (0 < ((int)costumeDescs->_end - (int)pvVar10) / 0x130) { do { costumeSprite = (ANM2 *)((int)pvVar10 + (int)local_bc * 0x130); pbVar14 = local_bc; bodyIndex = local_bc; if ((local_b0->_hasCurseMistEffect == 0) || (((piVar5 = *(int **)costumeSprite[1]._filename._buf, piVar5 != (int *)0x0 && (*piVar5 == 0)) && (piVar5[1] == *(int *)((int)playerConfig + 0xac))))) { LAB_0075c397: if (((local_b0->_isCoopGhost == 0) && ((local_a2 == 0 || (((piVar5 = *(int **)costumeSprite[1]._filename._buf, piVar5 != (int *)0x0 && (*piVar5 == 3)) && (piVar5[1] == 0x271)))))) && ((piVar5 = *(int **)costumeSprite[1]._filename._buf, piVar5 == (int *)0x0 || ((((iVar13 = *piVar5, iVar13 != 1 && (iVar13 != 3)) && (iVar13 != 4)) || ((piVar5[1] != 0xd6 || ((local_b0->_playerType != 8 && (local_b0->_playerType != 0xb))) ))))))) { local_dc = &local_b0->_sprite; local_a1 = 0; matchedLayers = 0; pbVar14 = (byte *)0x0; local_cc = costumeSprite; do { layer = ANM2::GetLayer(local_dc,pbVar14); pvVar10 = layer->_layerData; if (pvVar10 == (void *)0x0) { pbVar7 = &s_empty; } else { pbVar7 = (byte *)((int)pvVar10 + 8); if (0xf < *(uint *)((int)pvVar10 + 0x1c)) { pbVar7 = *(byte **)pbVar7; } } local_e4 = ANM2::GetLayer(costumeSprite,pbVar7); if (local_e4 == (LayerState *)0x0) { LAB_0075c5f9: } else { if ((*(int *)(costumeSprite[1]._filename._buf + 4) < local_b0->_playerCostumeMap[(int)pbVar14]._priority) || (((local_b0->_canFly != 0 && (costumeSprite[1]._filename._buf[9] == '\0')) && (local_b0->_playerCostumeMap[(int)pbVar14]._isBodyLayer != 0)))) { if (pbVar14 == &DAT_00000004) { LAB_0075c594: if ((char)costumeSprite[1]._filename._capacity != '\0') goto LAB_0075c59d; } else if (pbVar14 == (byte *)0x1) { LAB_0075c5ca: if ((char)costumeSprite[1]._filename._capacity != '\0') goto LAB_0075c5d3; } goto LAB_0075c5f9; } if (((matchedLayers != 0) && (bodyIndex == local_bc)) && ((pbVar14 != (byte *)0x0 && (bVar4 = local_b0->_playerCostumeMap[(int)pbVar14]._isBodyLayer, local_a1 != bVar4 )))) { if (bVar4 == 0) { local_bc = local_bc + 1; } else { bodyIndex = bodyIndex + 1; } } local_a1 = local_b0->_playerCostumeMap[(int)pbVar14]._isBodyLayer; pbVar7 = local_bc; if (local_a1 != 0) { pbVar7 = bodyIndex; } local_b0->_playerCostumeMap[(int)pbVar14]._index = (int)pbVar7; if (local_e4->_layerData == (undefined4 *)0x0) { layerId = 0xffffffff; } else { layerId = *(undefined4 *)local_e4->_layerData; } matchedLayers = matchedLayers + 1; *(undefined4 *) ((int)(&(local_b0->_sprite)._filename + -3) + (int)(pbVar14 + 0x123) * 0x10) = layerId; local_b0->_playerCostumeMap[(int)pbVar14]._priority = *(int *)(local_cc[1]._filename._buf + 4); cVar11 = (char)local_cc[1]._filename._capacity; costumeSprite = local_cc; if (pbVar14 == &DAT_00000004) { if (cVar11 == '\0') goto LAB_0075c594; headColor = *(undefined4 **)(local_cc[1]._filename._buf + 0xc); LAB_0075c59d: iVar13 = *(int *)(costumeSprite[1]._filename._buf + 4); if (local_c8 <= iVar13) { headColor = *(undefined4 **)(costumeSprite[1]._filename._buf + 0xc); local_c8 = iVar13; } } else { if (pbVar14 != (byte *)0x1) goto LAB_0075c5f9; if (cVar11 == '\0') goto LAB_0075c5ca; bodyColor = *(undefined4 **)(local_cc[1]._filename._buf + 0xc); LAB_0075c5d3: puVar9 = *(undefined4 **)(costumeSprite[1]._filename._buf + 4); if ((int)local_a8 <= (int)puVar9) { bodyColor = *(undefined4 **)(costumeSprite[1]._filename._buf + 0xc); local_a8 = puVar9; } } } pbVar14 = pbVar14 + 1; } while (pbVar14 < &DAT_0000000f); if ((char)costumeSprite[1]._filename._capacity != '\0') { iVar13 = *(int *)costumeSprite[1]._filename._buf; if (iVar13 != 0) { if (*(char *)(iVar13 + 0xa9) != '\0') { iVar1 = *(int *)(costumeSprite[1]._filename._buf + 4); if (local_c8 <= iVar1) { headColor = *(undefined4 **)(costumeSprite[1]._filename._buf + 0xc); local_c8 = iVar1; } } if (*(char *)(iVar13 + 0xaa) != '\0') { puVar9 = *(undefined4 **)(costumeSprite[1]._filename._buf + 4); if ((int)local_a8 <= (int)puVar9) { bodyColor = *(undefined4 **)(costumeSprite[1]._filename._buf + 0xc); local_a8 = puVar9; } } } } pbVar14 = bodyIndex; if ((int)bodyIndex < (int)local_bc) { pbVar14 = local_bc; } } } else { iVar13 = *piVar5; if ((((iVar13 == 1) || (iVar13 == 3)) || (iVar13 == 4)) && ((piVar5[1] == 0x14 && ((local_b0->_temporaryeffects)._disabled == 0)))) { piVar5 = (local_b0->_temporaryeffects)._effects._begin; effectsEnd = (local_b0->_temporaryeffects)._effects._end; if (piVar5 != effectsEnd) { do { iVar13 = *(int *)*piVar5; if ((((iVar13 == 1) || (iVar13 == 3)) || (iVar13 == 4)) && (((int *)*piVar5)[1] == 0x14)) goto LAB_0075c397; piVar5 = piVar5 + 4; } while (piVar5 != effectsEnd); } } } local_bc = pbVar14 + 1; pvVar10 = costumeDescs->_begin; } while ((int)local_bc < ((int)costumeDescs->_end - (int)pvVar10) / 0x130); } if ((local_b0->_playerType == 0xc) || (local_a9 = '\0', local_b0->_playerType == 0x18)) { local_a9 = '\x01'; } local_cc = (ANM2 *)0x0; playerAlias = local_b0; LAB_0075c6e0: iVar13 = playerAlias->_playerCostumeMap[(int)local_cc]._index; if (iVar13 < 0) goto LAB_0075cdb5; pvVar10 = (playerAlias->_costumeSpriteDescs)._begin; iVar13 = iVar13 * 0x130; local_a2 = *(byte *)((int)pvVar10 + iVar13 + 0x11f); if (((local_a2 == 0) || (((puVar9 = *(undefined4 **)((int)pvVar10 + iVar13 + 0x124), puVar9 == headColor || (playerAlias->_playerCostumeMap[(int)local_cc]._isBodyLayer != 0)) && ((playerAlias = local_b0, puVar9 == bodyColor || (local_b0->_playerCostumeMap[(int)local_cc]._isBodyLayer == 0)))))) && (*(int *)((int)pvVar10 + iVar13 + 300) == playerAlias->_playerType)) goto LAB_0075cdb5; local_bc = *(byte **)((int)pvVar10 + iVar13 + 0x34); if (local_bc == (byte *)0x0) { local_bc = &s_empty; LAB_0075c790: local_b1 = 0; } else { if (0xf < *(uint *)(local_bc + 0x14)) { local_bc = *(byte **)local_bc; } if (*(char *)((int)pvVar10 + iVar13 + 0x44) == '\0') goto LAB_0075c790; local_b1 = 1; } local_e4 = (LayerState *)(int)*(float *)((int)pvVar10 + iVar13 + 0x40); local_a8 = headColor; if ((*(undefined4 **)((int)pvVar10 + iVar13 + 0x124) != bodyColor) && (local_b0->_playerCostumeMap[(int)local_cc]._isBodyLayer != 0)) { local_a8 = bodyColor; } piVar5 = *(int **)((int)pvVar10 + iVar13 + 0x114); if ((*piVar5 == 0) && ((iVar1 = piVar5[1], iVar1 == 0xc || (iVar1 == 0x58)))) { LAB_0075cd71: puVar9 = local_a8; LAB_0075cac5: } else { if ((local_a2 != 0) && (*(undefined4 **)((int)pvVar10 + iVar13 + 0x120) != local_a8)) { pbVar14 = (byte *)0x0; local_aa = '\0'; if (*(int *)((int)pvVar10 + iVar13 + 0x80) != 0) { do { local_a2 = 0; local_a1 = 0; local_dc = (ANM2 *)local_b0->_playerType; layer = ANM2::GetLayer((ANM2 *)((int)pvVar10 + iVar13),pbVar14); if (layer->_layerData == (void *)0x0) { tmpPath._capacity = 0xf; tmpPath._size = 0; tmpPath._buf._0_4_ = (char *)0x0; } else { std::string::string(tmpPath._buf,(void *)((int)layer->_layerData + 0x20)); } local_c0 = local_c0 | 2; local_8 = 3; costume_path_apply_skin_color (&skinPath,&tmpPath,(int)local_a8,(int)local_dc,&local_a2,&local_a1); local_8 = CONCAT31(local_8._1_3_,5); if (0xf < tmpPath._capacity) { uVar6 = tmpPath._capacity + 1; pcVar15 = (char *)tmpPath._buf._0_4_; if (0xfff < uVar6) { pcVar15 = *(char **)(tmpPath._buf._0_4_ + -4); uVar6 = tmpPath._capacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._buf._0_4_ + (-4 - (int)pcVar15))) goto LAB_0075cfcd; } operator_delete(pcVar15,uVar6); } tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; Sprite::ReplaceSpritesheet ((Sprite *)((int)costumeDescs->_begin + iVar13),(int)pbVar14,&skinPath); if ((local_a1 == 0) && (local_a9 != '\0')) { layer = ANM2::GetLayer((ANM2 *)((int)costumeDescs->_begin + iVar13),pbVar14); fVar3 = fRam00c5d09c; fVar2 = fRam00c5d098; fVar8 = fRam00c5d094; layerColor = &layer->_color; if (layerColor != (ColorMod *)&DAT_00c5d090) { layerColor->_tint[0] = _DAT_00c5d090; (layer->_color)._tint[1] = fVar8; (layer->_color)._tint[2] = fVar2; (layer->_color)._tint[3] = fVar3; fVar3 = fRam00c5d0ac; fVar2 = fRam00c5d0a8; fVar8 = fRam00c5d0a4; (layer->_color)._colorize[0] = _DAT_00c5d0a0; (layer->_color)._colorize[1] = fVar8; (layer->_color)._colorize[2] = fVar2; (layer->_color)._colorize[3] = fVar3; *(undefined8 *)(layer->_color)._offset = DAT_00c5d0b0; fVar8 = DAT_00c5d0b8; goto LAB_0075c9d3; } } else { local_80 = 0; uStack_7c = 0; local_78 = 0.0; layer = ANM2::GetLayer((ANM2 *)((int)costumeDescs->_begin + iVar13),pbVar14); layerColor = &layer->_color; if (layerColor != (ColorMod *)local_a0) { layerColor->_tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_7c,local_80); fVar8 = local_78; LAB_0075c9d3: layerColor->_offset[2] = fVar8; } } if ((local_a2 != 0) || (local_a1 != 0)) { local_aa = '\x01'; } local_8 = 0xffffffff; if (0xf < skinPath._capacity) { uVar6 = skinPath._capacity + 1; pvVar10 = (void *)skinPath._buf._0_4_; if (0xfff < uVar6) { pvVar10 = *(void **)(skinPath._buf._0_4_ + -4); uVar6 = skinPath._capacity + 0x24; if (0x1f < (uint)(skinPath._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_0075cfcd; } operator_delete(pvVar10,uVar6); } pbVar14 = pbVar14 + 1; pvVar10 = costumeDescs->_begin; } while (pbVar14 < *(byte **)((int)pvVar10 + iVar13 + 0x80)); } if (local_aa != '\0') goto LAB_0075cd71; std::string::string(tmpPath._buf,(void *)((int)pvVar10 + iVar13)); puVar9 = local_a8; local_c0 = local_c0 | 4; local_8 = 6; KAGE_LogMessage(1,(byte *) "Costume %s supports skin color alts but no alt spritesheet could be found! (skin color %d)\n" ); local_8 = 0xffffffff; if (0xf < tmpPath._capacity) { uVar6 = tmpPath._capacity + 1; pcVar15 = (char *)tmpPath._buf._0_4_; if (0xfff < uVar6) { pcVar15 = *(char **)(tmpPath._buf._0_4_ + -4); uVar6 = tmpPath._capacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._buf._0_4_ + (-4 - (int)pcVar15))) goto LAB_0075cfcd; } operator_delete(pcVar15,uVar6); } goto LAB_0075cac5; } pbVar14 = (byte *)0x0; if (*(int *)((int)pvVar10 + iVar13 + 0x80) == 0) goto LAB_0075cd71; do { local_a2 = 0; local_dc = (ANM2 *)local_b0->_playerType; layer = ANM2::GetLayer((ANM2 *)((int)pvVar10 + iVar13),pbVar14); if (layer->_layerData == (void *)0x0) { tmpPath._capacity = 0xf; tmpPath._size = 0; tmpPath._buf._0_4_ = (char *)0x0; } else { std::string::string(tmpPath._buf,(void *)((int)layer->_layerData + 0x20)); } local_c0 = local_c0 | 1; local_8 = 0; costume_path_apply_skin_color(&skinPath,&tmpPath,-1,(int)local_dc,(byte *)0x0,&local_a2); local_8 = CONCAT31(local_8._1_3_,2); if (0xf < tmpPath._capacity) { uVar6 = tmpPath._capacity + 1; pcVar15 = (char *)tmpPath._buf._0_4_; if (0xfff < uVar6) { pcVar15 = *(char **)(tmpPath._buf._0_4_ + -4); uVar6 = tmpPath._capacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._buf._0_4_ + (-4 - (int)pcVar15))) goto LAB_0075cfcd; } operator_delete(pcVar15,uVar6); } tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; Sprite::ReplaceSpritesheet ((Sprite *)((int)costumeDescs->_begin + iVar13),(int)pbVar14,&skinPath); if ((local_a2 == 0) && (local_a9 != '\0')) { layer = ANM2::GetLayer((ANM2 *)((int)costumeDescs->_begin + iVar13),pbVar14); fVar3 = fRam00c5d09c; fVar2 = fRam00c5d098; fVar8 = fRam00c5d094; layerColor = &layer->_color; if (layerColor != (ColorMod *)&DAT_00c5d090) { layerColor->_tint[0] = _DAT_00c5d090; (layer->_color)._tint[1] = fVar8; (layer->_color)._tint[2] = fVar2; (layer->_color)._tint[3] = fVar3; fVar3 = fRam00c5d0ac; fVar2 = fRam00c5d0a8; fVar8 = fRam00c5d0a4; (layer->_color)._colorize[0] = _DAT_00c5d0a0; (layer->_color)._colorize[1] = fVar8; (layer->_color)._colorize[2] = fVar2; (layer->_color)._colorize[3] = fVar3; *(undefined8 *)(layer->_color)._offset = DAT_00c5d0b0; fVar8 = DAT_00c5d0b8; goto LAB_0075cd12; } } else { local_80 = 0; uStack_7c = 0; local_78 = 0.0; layer = ANM2::GetLayer((ANM2 *)((int)costumeDescs->_begin + iVar13),pbVar14); layerColor = &layer->_color; if (layerColor != (ColorMod *)local_a0) { layerColor->_tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(uStack_7c,local_80); fVar8 = local_78; LAB_0075cd12: layerColor->_offset[2] = fVar8; } } local_8 = 0xffffffff; if (0xf < skinPath._capacity) { uVar6 = skinPath._capacity + 1; pvVar10 = (void *)skinPath._buf._0_4_; if (0xfff < uVar6) { pvVar10 = *(void **)(skinPath._buf._0_4_ + -4); uVar6 = skinPath._capacity + 0x24; if (0x1f < (uint)(skinPath._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_0075cfcd; } operator_delete(pvVar10,uVar6); } pbVar14 = pbVar14 + 1; pvVar10 = costumeDescs->_begin; } while (pbVar14 < *(byte **)((int)pvVar10 + iVar13 + 0x80)); puVar9 = local_a8; } playerAlias = local_b0; *(undefined4 **)((int)costumeDescs->_begin + iVar13 + 0x124) = puVar9; *(int *)((int)(local_b0->_costumeSpriteDescs)._begin + iVar13 + 300) = local_b0->_playerType; costumeSprite = (ANM2 *)((int)(local_b0->_costumeSpriteDescs)._begin + iVar13); ANM2::LoadGraphics(costumeSprite,(byte)costumeSprite); if ((local_bc != (byte *)0x0) && (*local_bc != 0)) { pvVar10 = (playerAlias->_costumeSpriteDescs)._begin; if (local_b1 == 0) { costumeSprite = (ANM2 *)(iVar13 + (int)pvVar10); bVar4 = ANM2::SetAnimation(costumeSprite,local_bc,1); if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&costumeSprite->_animState,(float)(int)local_e4), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } } else { costumeSprite = (ANM2 *)((int)pvVar10 + iVar13); pbVar14 = (costumeSprite->_animState)._animData; if (pbVar14 == (byte *)0x0) { LAB_0075cd95: bVar4 = ANM2::SetAnimation(costumeSprite,local_bc,1); if (bVar4 != 0) { AnimationState::Rewind(&costumeSprite->_animState); (costumeSprite->_animState)._isPlaying = 1; } } else { pbVar7 = pbVar14; expectedAnimName = local_bc; if (0xf < *(uint *)(pbVar14 + 0x14)) { pbVar7 = *(byte **)pbVar14; } do { bVar4 = *pbVar7; isNameLess = bVar4 < *expectedAnimName; if (bVar4 != *expectedAnimName) { LAB_0075cd7c: uVar6 = -(uint)isNameLess | 1; goto LAB_0075cd81; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; isNameLess = bVar4 < expectedAnimName[1]; if (bVar4 != expectedAnimName[1]) goto LAB_0075cd7c; pbVar7 = pbVar7 + 2; expectedAnimName = expectedAnimName + 2; } while (bVar4 != 0); uVar6 = 0; LAB_0075cd81: if ((uVar6 != 0) || ((pbVar14[0x34] != 0 && ((costumeSprite->_animState)._isPlaying == 0)))) goto LAB_0075cd95; } playerAlias = local_b0; } } LAB_0075cdb5: puVar9 = bodyColor; local_cc = (ANM2 *)((int)local_cc + 1); if (0xe < local_cc) goto code_r0x0075cdcb; goto LAB_0075c6e0; code_r0x0075cdcb: puVar12 = (undefined4 *)playerAlias->_headColor; if ((puVar12 != headColor) || ((undefined4 *)playerAlias->_bodyColor != bodyColor)) { if ((g_game->_challenge == 0x2a) && (playerAlias->_playerType == 0x23)) { uVar6 = 0; do { tmpPath._buf._0_4_ = std::_Allocate(0x40); tmpPath._size = 0x3c; tmpPath._capacity = 0x3f; builtin_strncpy((char *)tmpPath._buf._0_4_, "gfx/characters/costumes/character_016b_theforgotten_bomb.png",0x3d); local_8 = 7; Sprite::ReplaceSpritesheet((Sprite *)&playerAlias->_sprite,uVar6,&tmpPath); local_8 = 0xffffffff; bVar4 = extraout_CL; if (0xf < tmpPath._capacity) { size = tmpPath._capacity + 1; pcVar15 = (char *)tmpPath._buf._0_4_; if (0xfff < size) { pcVar15 = *(char **)(tmpPath._buf._0_4_ + -4); size = tmpPath._capacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._buf._0_4_ + (-4 - (int)pcVar15))) goto LAB_0075d0d4; } operator_delete(pcVar15,size); bVar4 = extraout_CL_00; } uVar6 = uVar6 + 1; } while (uVar6 < 0xf); ANM2::LoadGraphics(&playerAlias->_sprite,bVar4); playerAlias = local_b0; } else { if (*(int *)((int)playerConfig + 0x2c) != 0) { headSheetPath._size = 0; headSheetPath._capacity = 0xf; headSheetPath._buf._0_4_ = (void *)0x0; bodySheetPath._size = 0; bodySheetPath._capacity = 0xf; bodySheetPath._buf._0_4_ = (void *)0x0; local_8 = 9; if (puVar12 != headColor) { headSkinPath = costume_path_apply_skin_color (&skinPath,(void *)((int)playerConfig + 0x1c),(int)headColor,-1, (byte *)0x0,(byte *)0x0); puVar12 = (undefined4 *)&headSheetPath; if (puVar12 != headSkinPath) { headSheetPath._buf._0_4_ = *headSkinPath; headSheetPath._buf._4_4_ = headSkinPath[1]; headSheetPath._buf._8_4_ = headSkinPath[2]; headSheetPath._buf._12_4_ = headSkinPath[3]; headSheetPath._16_8_ = *(undefined8 *)(headSkinPath + 4); headSkinPath[4] = 0; headSkinPath[5] = 0xf; *(undefined1 *)headSkinPath = 0; } if (0xf < skinPath._capacity) { uVar6 = skinPath._capacity + 1; pvVar10 = (void *)skinPath._buf._0_4_; if (0xfff < uVar6) { pvVar10 = *(void **)(skinPath._buf._0_4_ + -4); uVar6 = skinPath._capacity + 0x24; if (0x1f < (uint)(skinPath._buf._0_4_ + (-4 - (int)pvVar10))) { LAB_0075cfcd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar6); puVar12 = extraout_ECX; } } if ((undefined4 *)playerAlias->_bodyColor != puVar9) { puVar9 = costume_path_apply_skin_color (bodySkinPathTmp,(void *)((int)playerConfig + 0x1c),(int)puVar9,-1, (byte *)0x0,(byte *)0x0); if (&bodySheetPath != (std_string *)puVar9) { bodySheetPath._buf._0_4_ = *puVar9; bodySheetPath._buf._4_4_ = puVar9[1]; bodySheetPath._buf._8_4_ = puVar9[2]; bodySheetPath._buf._12_4_ = puVar9[3]; bodySheetPath._16_8_ = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; } std::string::_Tidy_deallocate(bodySkinPathTmp); puVar12 = extraout_ECX_00; } uVar6 = 0; do { if (uVar6 != 0xd) { if (((uVar6 == 0) || (3 < uVar6)) && (uVar6 != 0xb)) { puVar12 = (undefined4 *)0x0; } else { puVar12 = (undefined4 *)0x1; } pngFilename = &bodySheetPath; if ((char)puVar12 == '\0') { pngFilename = &headSheetPath; } if (pngFilename->_size != 0) { Sprite::ReplaceSpritesheet((Sprite *)&playerAlias->_sprite,uVar6,pngFilename); puVar12 = extraout_ECX_01; } } uVar6 = uVar6 + 1; } while (uVar6 < 0xf); local_8 = CONCAT31(local_8._1_3_,8); if (0xf < bodySheetPath._capacity) { uVar6 = bodySheetPath._capacity + 1; pvVar10 = (void *)bodySheetPath._buf._0_4_; if (0xfff < uVar6) { pvVar10 = *(void **)(bodySheetPath._buf._0_4_ + -4); uVar6 = bodySheetPath._capacity + 0x24; if (0x1f < (uint)(bodySheetPath._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_0075d0d4; } operator_delete(pvVar10,uVar6); puVar12 = extraout_ECX_02; } local_8 = 0xffffffff; if (0xf < headSheetPath._capacity) { uVar6 = headSheetPath._capacity + 1; pvVar10 = (void *)headSheetPath._buf._0_4_; if (0xfff < uVar6) { pvVar10 = *(void **)(headSheetPath._buf._0_4_ + -4); uVar6 = headSheetPath._capacity + 0x24; if (0x1f < (uint)(headSheetPath._buf._0_4_ + (-4 - (int)pvVar10))) { LAB_0075d0d4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar6); puVar12 = extraout_ECX_03; } } ANM2::LoadGraphics(&playerAlias->_sprite,(byte)puVar12); } playerAlias->_headColor = (int)headColor; playerAlias->_bodyColor = (int)bodyColor; } pbVar14 = &playerAlias->_playerCostumeMap[0]._isBodyLayer; local_cc = (ANM2 *)0xf; do { if (-1 < ((PlayerCostumeMap *)(pbVar14 + -0xc))->_index) { costumeSprite = (ANM2 *)(((PlayerCostumeMap *)(pbVar14 + -0xc))->_index * 0x130 + (int)costumeDescs->_begin); if (*pbVar14 == 0) { pcVar15 = "HeadDown"; } else { pcVar15 = "WalkDown"; } bVar4 = ANM2::SetAnimation(costumeSprite,(byte *)pcVar15,1); if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&costumeSprite->_animState,0.0), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } pvVar10 = ANM2::GetAnimationData(costumeSprite,(byte *)"SubAnim"); if (pvVar10 != (void *)0x0) { ANM2::PlayOverlay(costumeSprite,(byte *)"SubAnim",0); } } pbVar14 = pbVar14 + 0x10; local_cc = (ANM2 *)((int)local_cc + -1); } while (local_cc != (ANM2 *)0x0); if (local_b0->_isCoopGhost != 0) { reset_body_sprite(local_b0); } DAT_00c81148 = '\0'; ExceptionList = local_10; return; } //@@ 0075d1d0 Entity_Player::AddCostume /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_Player::AddCostume(ItemConfig_Item* collectibleID, bool itemStateOnly); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddCostume(Entity_Player *this,ItemConfig_Item *collectibleID,byte itemStateOnly) { void **ppvVar1; byte bVar2; char cVar3; uint uVar4; int iVar5; int *piVar6; void *pvVar7; LayerState *layer; byte *layerName; byte extraout_CL; byte extraout_CL_00; byte *costumeMapEntry; byte *layerId; uint local_184; ANM2 *local_180; ItemConfig_Item *costumeItem; char isHasHeadLayer; char isHasBodyLayer; ANM2 newCostume; ItemConfig_Item *local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined2 local_4c; undefined4 local_48; void *duplicateItemName [5]; uint uStack_30; void *itemName [4]; uint uStack_1c; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; ANM2 *costumeSprite; void *edenHairBegin; bool isDuplicate; Manager *manager; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afef40; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(itemName + 10); ExceptionList = &local_10; costumeItem = collectibleID; if (((this->_variant != 1) && (collectibleID != (ItemConfig_Item *)0x0)) && (this->_isCoopGhost == 0)) { local_14 = uVar4; if (collectibleID->type == 1) { if ((collectibleID->id == 0x76) && (iVar5 = GetCollectibleNum(this,0x76,0), 1 < iVar5)) { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 >> 2 < 0x2e) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar7 + 0xb4); } costumeItem = collectibleID; } if (collectibleID->type == 1) { if ((collectibleID->id == 0x299) && (iVar5 = GetCollectibleNum(this,0x299,0), 1 < iVar5)) { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 >> 2 < 0x7e) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar7 + 500); } costumeItem = collectibleID; } if (((collectibleID->type == 1) && (collectibleID->id == 0x2da)) && (iVar5 = GetCollectibleNum(this,0x2da,0), 1 < iVar5)) { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 >> 2 < 0x7f) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar7 + 0x1f8); } costumeItem = collectibleID; } } } if (((collectibleID->type == 0) && (collectibleID->id == 0x37)) && (bVar2 = HasCollectible(this,0x14,0), bVar2 != 0)) { TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x84,1,1); } if ((collectibleID->costume).anm2Path._size != 0) { if (((this->_valid != 0) && (bVar2 = Item::HasTags(collectibleID,0x40000000), bVar2 != 0)) && (this->_backupPlayer != (Entity_Player *)0x0)) { AddCostume(this->_backupPlayer,collectibleID,itemStateOnly); } if ((g_game->_challenge != 0x1e) || ((cVar3 = Item::IsCollectible(uVar4), cVar3 != '\0' && (collectibleID->id == 0xb8)))) { pvVar7 = (this->_costumeSpriteDescs)._begin; isDuplicate = false; if (pvVar7 != (this->_costumeSpriteDescs)._end) { do { if (*(ItemConfig_Item **)((int)pvVar7 + 0x114) == collectibleID) { piVar6 = (int *)std::vector::erase(&local_184,pvVar7); isDuplicate = true; pvVar7 = (void *)*piVar6; } else { pvVar7 = (void *)((int)pvVar7 + 0x130); } } while (pvVar7 != (this->_costumeSpriteDescs)._end); if (isDuplicate) { ItemConfig_Item::GetLocalizedName(collectibleID,(std_string *)duplicateItemName,0); local_8 = (void *)0x0; KAGE_LogMessage(1,(byte *) "Adding costume for %d (%s) which was added before and never removed.\n" ); local_8 = (void *)0xffffffff; if (0xf < uStack_30) { uVar4 = uStack_30 + 1; pvVar7 = duplicateItemName[0]; if (0xfff < uVar4) { pvVar7 = *(void **)((int)duplicateItemName[0] + -4); uVar4 = uStack_30 + 0x24; if (0x1f < (uint)((int)duplicateItemName[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar4); } } } ANM2::constructor(&newCostume); local_5c = 0; local_58 = 0; local_54 = 0; local_50 = 0; local_4c = 0; local_48 = 0xffffffff; local_8 = (void *)0x1; pvVar7 = (this->_costumeSpriteDescs)._end; local_60 = collectibleID; if (pvVar7 == (this->_costumeSpriteDescs)._capacity) { FUN_007dd940(pvVar7,&newCostume); } else { FUN_007dd8a0(); ppvVar1 = &(this->_costumeSpriteDescs)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x130); } local_8 = (void *)0x2; ANM2::Reset(&newCostume); AnimationState::~AnimationState(&newCostume._overlayAnimState); AnimationState::~AnimationState(&newCostume._animState); std::string::_Tidy_deallocate(newCostume._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&newCostume); local_8 = (void *)0xffffffff; *(int *)((int)(this->_costumeSpriteDescs)._end + -0x18) = (collectibleID->costume).priority; *(byte *)((int)(this->_costumeSpriteDescs)._end + -0x13) = (collectibleID->costume).isFlying ; *(byte *)((int)(this->_costumeSpriteDescs)._end + -0x12) = (collectibleID->costume).hasOverlay; *(int *)((int)(this->_costumeSpriteDescs)._end + -0x10) = (collectibleID->costume).skinColor ; *(int *)((int)(this->_costumeSpriteDescs)._end + -0xc) = (collectibleID->costume).skinColor; *(byte *)((int)(this->_costumeSpriteDescs)._end + -0x11) = (collectibleID->costume).hasSkinAlt; *(byte *)((int)(this->_costumeSpriteDescs)._end + -8) = (collectibleID->costume).overwriteColor; *(byte *)((int)(this->_costumeSpriteDescs)._end + -7) = itemStateOnly; if (((g_game->_dailyChallenge)._specialDailyId == 0xd) && ((((iVar5 = collectibleID->type, iVar5 == 1 || (iVar5 == 3)) || (iVar5 == 4)) && (collectibleID->id == 0x1a8)))) { piVar6 = (int *)((int)(this->_costumeSpriteDescs)._end + -0x18); *piVar6 = *piVar6 + 3; } local_180 = (ANM2 *)((int)(this->_costumeSpriteDescs)._end + -0x130); ANM2::Load(local_180,&(collectibleID->costume).anm2Path,0); manager = g_manager; bVar2 = extraout_CL; if ((collectibleID->type == 0) && ((collectibleID->id == 0xc || (collectibleID->id == 0x58)))) { local_184 = this->_initSeed; pvVar7 = (g_manager->_entityConfig)._edenHair._end; if ((g_manager->_entityConfig)._edenHair._begin == pvVar7) { KAGE_LogMessage(0x10,(byte *)"Eden has no hair!\n"); pvVar7 = (manager->_entityConfig)._edenHair._end; } edenHairBegin = (manager->_entityConfig)._edenHair._begin; Sprite::ReplaceSpritesheet ((Sprite *)local_180,0, (std_string *) ((int)edenHairBegin + (local_184 % (uint)(((int)pvVar7 - (int)edenHairBegin) / 0x18)) * 0x18)); bVar2 = extraout_CL_00; } costumeSprite = local_180; ANM2::LoadGraphics(local_180,bVar2); local_180 = &this->_sprite; isHasHeadLayer = '\0'; costumeMapEntry = &this->_playerCostumeMap[0]._isBodyLayer; isHasBodyLayer = '\0'; layerId = (byte *)0x0; do { layer = ANM2::GetLayer(local_180,layerId); pvVar7 = layer->_layerData; if (pvVar7 == (void *)0x0) { layerName = &s_empty; } else { layerName = (byte *)((int)pvVar7 + 8); if (0xf < *(uint *)((int)pvVar7 + 0x1c)) { layerName = *(byte **)layerName; } } layer = ANM2::GetLayer(costumeSprite,layerName); if (layer != (LayerState *)0x0) { if (*costumeMapEntry == 0) { isHasHeadLayer = '\x01'; } else { isHasBodyLayer = '\x01'; } } layerId = layerId + 1; costumeMapEntry = costumeMapEntry + 0x10; } while (layerId < &DAT_0000000f); if (isHasHeadLayer == '\0') { if (isHasBodyLayer == '\0') { ItemConfig_Item::GetLocalizedName(costumeItem,(std_string *)itemName,0); local_8 = (void *)0x3; KAGE_LogMessage(1,(byte *)"[warn] Costume for item %d (%s) has no layers!\n"); local_8 = (void *)0xffffffff; if (0xf < uStack_18) { uVar4 = uStack_18 + 1; pvVar7 = itemName[0]; if (0xfff < uVar4) { pvVar7 = *(void **)((int)itemName[0] + -4); uVar4 = uStack_18 + 0x24; if (0x1f < (uint)((int)itemName[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar4); } uStack_1c = 0; uStack_18 = 0xf; itemName[0] = (void *)((uint)itemName[0] & 0xffffff00); } } else if (isHasBodyLayer != '\0') { pvVar7 = (this->_costumeSpriteDescs)._end; if (pvVar7 == (this->_costumeSpriteDescs)._capacity) { FUN_007ddac0(pvVar7,(int)pvVar7 + -0x130); } else { FUN_007de0e0((int)pvVar7 + -0x130); ppvVar1 = &(this->_costumeSpriteDescs)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x130); } } UpdateCostumes(this); } } } ExceptionList = local_10; return; } //@@ 0075d800 Entity_Player::AddNullCostume /* ZHL [exact] __thiscall void Entity_Player::AddNullCostume(int costumeid); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddNullCostume(Entity_Player *this,int costumeid) { void *pvVar1; if ((costumeid < 0) || (pvVar1 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 >> 2 <= costumeid)) { AddCostume(this,(ItemConfig_Item *)0x0,0); return; } AddCostume(this,*(ItemConfig_Item **)((int)pvVar1 + costumeid * 4),0); return; } //@@ 0075d850 Entity_Player::RemoveCostume /* ZHL [exact] __thiscall void Entity_Player::RemoveCostume(ItemConfig_Item * Item); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::RemoveCostume(Entity_Player *this,ItemConfig_Item *Item) { bool bVar1; byte bVar2; int *piVar3; void *pvVar4; Entity_Player *local_c [2]; if (((Item != (ItemConfig_Item *)0x0) && (this->_variant != 1)) && ((Item->costume).anm2Path._size != 0)) { local_c[0] = this; if (this->_valid != 0) { bVar2 = ::Item::HasTags(Item,0x40000000); if ((bVar2 != 0) && (this->_backupPlayer != (Entity_Player *)0x0)) { RemoveCostume(this->_backupPlayer,Item); } } pvVar4 = (this->_costumeSpriteDescs)._begin; bVar1 = false; if (pvVar4 != (this->_costumeSpriteDescs)._end) { do { if (*(ItemConfig_Item **)((int)pvVar4 + 0x114) == Item) { piVar3 = (int *)std::vector::erase(local_c,pvVar4); bVar1 = true; pvVar4 = (void *)*piVar3; } else { pvVar4 = (void *)((int)pvVar4 + 0x130); } } while (pvVar4 != (this->_costumeSpriteDescs)._end); if (bVar1) { UpdateCostumes(this); } } } return; } //@@ 0075d900 Entity_Player::IsItemCostumeVisible /* ZHL [exact] __thiscall bool Entity_Player::IsItemCostumeVisible(ItemConfig_Item* item, int playerSpriteLayerID); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Player::IsItemCostumeVisible (Entity_Player *this,ItemConfig_Item *item,int playerSpriteLayerID) { PlayerCostumeMap *pPVar1; uint uVar2; uVar2 = 0xf; if (-1 < playerSpriteLayerID) { uVar2 = playerSpriteLayerID + 1; } if (playerSpriteLayerID < 0) { playerSpriteLayerID = 0; } if ((uint)playerSpriteLayerID < uVar2) { pPVar1 = this->_playerCostumeMap + playerSpriteLayerID; do { if ((-1 < pPVar1->_index) && (*(ItemConfig_Item **) (pPVar1->_index * 0x130 + 0x114 + (int)(this->_costumeSpriteDescs)._begin) == item)) { return 1; } playerSpriteLayerID = playerSpriteLayerID + 1; pPVar1 = pPVar1 + 1; } while ((uint)playerSpriteLayerID < uVar2); } return 0; } //@@ 0075d980 Entity_Player::IsNullItemCostumeVisible /* ZHL [exact] __thiscall bool Entity_Player::IsNullItemCostumeVisible(int nullItemID, int playerSpriteLayerID); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Player::IsNullItemCostumeVisible(Entity_Player *this,int nullItemID,int playerSpriteLayerID) { void *pvVar1; byte bVar2; if ((nullItemID < 0) || (pvVar1 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 >> 2 <= nullItemID)) { bVar2 = IsItemCostumeVisible(this,(ItemConfig_Item *)0x0,playerSpriteLayerID); return bVar2; } bVar2 = IsItemCostumeVisible (this,*(ItemConfig_Item **)((int)pvVar1 + nullItemID * 4),playerSpriteLayerID); return bVar2; } //@@ 0075d9c0 Entity_Player::IsCollectibleCostumeVisible /* ZHL [exact] __thiscall bool Entity_Player::IsCollectibleCostumeVisible(CollectibleType collectible, int playerSpriteLayerID); */ void __thiscall Entity_Player::IsCollectibleCostumeVisible(Entity_Player *this,int param_2,int param_3) { ItemConfig_Item *item; item = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_2); IsItemCostumeVisible(this,item,param_3); return; } //@@ 0075d9f0 FUN_0075d9f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0075d9f0(uint param_1) { char cVar1; undefined1 uVar2; int iVar3; int iVar4; undefined4 uVar5; code *pcVar6; uint uVar7; bool bVar8; uint uVar9; Entity_Player *in_ECX; void *pvVar10; uint uVar11; uint uVar12; int extraout_EDX; int extraout_EDX_00; int iVar13; int iVar14; ANM2 *pAVar15; bool bVar16; uint uStack_4c; uint uStack_48; int iStack_40; int iStack_3c; int iStack_38; void *apvStack_30 [5]; uint uStack_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *pvStack_8; pvStack_8 = (void *)0xffffffff; puStack_c = &LAB_00afef7d; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(apvStack_30 + 0xb); ExceptionList = &local_10; uVar7 = ((int)(in_ECX->_costumeSpriteDescs)._end - (int)(in_ECX->_costumeSpriteDescs)._begin) / 0x130; KAGE_LogMessage(1,(byte *)"costume map:\n"); iVar13 = 0; if (0 < (int)uVar7) { iStack_40 = 0; do { std::string::string((char *)apvStack_30, (void *)((int)(in_ECX->_costumeSpriteDescs)._begin + iStack_40)); pvStack_8 = (void *)0x0; KAGE_LogMessage(1,(byte *)"%d: %s\n"); pvStack_8 = (void *)0xffffffff; if (0xf < uStack_1c) { uVar11 = uStack_1c + 1; pvVar10 = apvStack_30[0]; if (0xfff < uVar11) { pvVar10 = *(void **)((int)apvStack_30[0] + -4); uVar11 = uStack_1c + 0x24; if (0x1f < (uint)((int)apvStack_30[0] + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar11); } iVar13 = iVar13 + 1; iStack_40 = iStack_40 + 0x130; } while (iVar13 < (int)uVar7); } iVar13 = 0; uVar11 = uVar7 - 1; if (0 < (int)uVar11) { iStack_3c = 1; iStack_38 = 0; uStack_4c = uVar7; uStack_48 = uVar11; do { pvVar10 = (in_ECX->_costumeSpriteDescs)._begin; iVar3 = *(int *)(iStack_38 + 0x114 + (int)pvVar10); iVar4 = *(int *)(iStack_38 + 0x244 + (int)pvVar10); bVar16 = iVar3 == iVar4; uVar9 = uStack_48; if (!bVar16) { uVar9 = uStack_4c; } if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar6 = (code *)swi(3); (*pcVar6)(); return; } param_1 = param_1 >> 3 ^ param_1; param_1 = param_1 << 3 ^ param_1; param_1 = param_1 >> 0x1a ^ param_1; uVar12 = 0; if (uVar9 != 0) { uVar12 = param_1 % uVar9; } iVar14 = uVar12 + iVar13; if ((iVar13 < iVar14) && (pvVar10 = (in_ECX->_costumeSpriteDescs)._begin, *(int *)((int)pvVar10 + iVar14 * 0x130 + -0x1c) == *(int *)((int)pvVar10 + iVar14 * 0x130 + 0x114))) { iVar14 = iVar14 + -1; } else if (((iVar3 == iVar4) && (iVar14 < (int)(uVar7 - 2))) && (pvVar10 = (in_ECX->_costumeSpriteDescs)._begin, *(int *)((int)pvVar10 + iVar14 * 0x130 + 0x244) == *(int *)((int)pvVar10 + iVar14 * 0x130 + 0x374))) { iVar14 = iVar14 + 1; } if ((iVar14 < (int)uVar11) && (pvVar10 = (in_ECX->_costumeSpriteDescs)._begin, *(int *)((int)pvVar10 + iVar14 * 0x130 + 0x114) == *(int *)((int)pvVar10 + iVar14 * 0x130 + 0x244))) { bVar8 = true; } else { bVar8 = false; } if (iVar14 == iVar13) { LAB_0075df4d: if ((bVar16) || (bVar8)) { LAB_0075df59: iVar13 = iVar13 + 1; uStack_4c = uStack_4c - 1; uStack_48 = uStack_48 - 1; iStack_3c = iStack_3c + 1; iStack_38 = iStack_38 + 0x130; } } else { if (((bVar8) && (iVar3 != iVar4)) && ((iVar13 < (int)(uVar7 - 2) && (pvVar10 = (in_ECX->_costumeSpriteDescs)._begin, *(int *)((int)pvVar10 + iStack_38 + 0x244) == *(int *)((int)pvVar10 + iStack_38 + 0x374) )))) { KAGE_LogMessage(1,(byte *)"swap (src body) %d %d\n"); KAGE_LogMessage(1,(byte *)"swap (src body) %d %d\n"); func_0x00753ad0(); func_0x00753ad0(); bVar16 = true; if (iVar14 != iStack_3c) goto LAB_0075dcb8; goto LAB_0075df59; } LAB_0075dcb8: KAGE_LogMessage(1,(byte *)"swap %d %d\n"); pvVar10 = (in_ECX->_costumeSpriteDescs)._begin; pAVar15 = (ANM2 *)(iStack_38 + (int)pvVar10); Isaac::SwapANM2(pAVar15,(ANM2 *)(iVar14 * 0x130 + (int)pvVar10)); uVar5 = *(undefined4 *)pAVar15[1]._filename._buf; *(undefined4 *)pAVar15[1]._filename._buf = *(undefined4 *)(extraout_EDX + 0x114); *(undefined4 *)(extraout_EDX + 0x114) = uVar5; uVar5 = *(undefined4 *)(pAVar15[1]._filename._buf + 4); *(undefined4 *)(pAVar15[1]._filename._buf + 4) = *(undefined4 *)(extraout_EDX + 0x118); *(undefined4 *)(extraout_EDX + 0x118) = uVar5; cVar1 = pAVar15[1]._filename._buf[8]; pAVar15[1]._filename._buf[8] = *(char *)(extraout_EDX + 0x11c); *(char *)(extraout_EDX + 0x11c) = cVar1; cVar1 = pAVar15[1]._filename._buf[9]; pAVar15[1]._filename._buf[9] = *(char *)(extraout_EDX + 0x11d); *(char *)(extraout_EDX + 0x11d) = cVar1; cVar1 = pAVar15[1]._filename._buf[10]; pAVar15[1]._filename._buf[10] = *(char *)(extraout_EDX + 0x11e); *(char *)(extraout_EDX + 0x11e) = cVar1; cVar1 = pAVar15[1]._filename._buf[0xb]; pAVar15[1]._filename._buf[0xb] = *(char *)(extraout_EDX + 0x11f); *(char *)(extraout_EDX + 0x11f) = cVar1; uVar5 = *(undefined4 *)(pAVar15[1]._filename._buf + 0xc); *(undefined4 *)(pAVar15[1]._filename._buf + 0xc) = *(undefined4 *)(extraout_EDX + 0x120); *(undefined4 *)(extraout_EDX + 0x120) = uVar5; uVar9 = pAVar15[1]._filename._size; pAVar15[1]._filename._size = *(uint *)(extraout_EDX + 0x124); *(uint *)(extraout_EDX + 0x124) = uVar9; uVar9 = pAVar15[1]._filename._capacity; *(undefined1 *)&pAVar15[1]._filename._capacity = *(undefined1 *)(extraout_EDX + 0x128); *(char *)(extraout_EDX + 0x128) = (char)uVar9; uVar2 = *(undefined1 *)((int)&pAVar15[1]._filename._capacity + 1); *(undefined1 *)((int)&pAVar15[1]._filename._capacity + 1) = *(undefined1 *)(extraout_EDX + 0x129); *(undefined1 *)(extraout_EDX + 0x129) = uVar2; uVar5 = *(undefined4 *)pAVar15[1]._animDefaultName._buf; *(undefined4 *)pAVar15[1]._animDefaultName._buf = *(undefined4 *)(extraout_EDX + 300); *(undefined4 *)(extraout_EDX + 300) = uVar5; if ((bVar16) || (bVar8)) { KAGE_LogMessage(1,(byte *)"swap (body) %d %d\n"); pvVar10 = (in_ECX->_costumeSpriteDescs)._begin; pAVar15 = (ANM2 *)(iStack_38 + 0x130 + (int)pvVar10); Isaac::SwapANM2(pAVar15,(ANM2 *)(iVar14 * 0x130 + 0x130 + (int)pvVar10)); uVar5 = *(undefined4 *)pAVar15[1]._filename._buf; *(undefined4 *)pAVar15[1]._filename._buf = *(undefined4 *)(extraout_EDX_00 + 0x114); *(undefined4 *)(extraout_EDX_00 + 0x114) = uVar5; uVar5 = *(undefined4 *)(pAVar15[1]._filename._buf + 4); *(undefined4 *)(pAVar15[1]._filename._buf + 4) = *(undefined4 *)(extraout_EDX_00 + 0x118); *(undefined4 *)(extraout_EDX_00 + 0x118) = uVar5; cVar1 = pAVar15[1]._filename._buf[8]; pAVar15[1]._filename._buf[8] = *(char *)(extraout_EDX_00 + 0x11c); *(char *)(extraout_EDX_00 + 0x11c) = cVar1; cVar1 = pAVar15[1]._filename._buf[9]; pAVar15[1]._filename._buf[9] = *(char *)(extraout_EDX_00 + 0x11d); *(char *)(extraout_EDX_00 + 0x11d) = cVar1; cVar1 = pAVar15[1]._filename._buf[10]; pAVar15[1]._filename._buf[10] = *(char *)(extraout_EDX_00 + 0x11e); *(char *)(extraout_EDX_00 + 0x11e) = cVar1; cVar1 = pAVar15[1]._filename._buf[0xb]; pAVar15[1]._filename._buf[0xb] = *(char *)(extraout_EDX_00 + 0x11f); *(char *)(extraout_EDX_00 + 0x11f) = cVar1; uVar5 = *(undefined4 *)(pAVar15[1]._filename._buf + 0xc); *(undefined4 *)(pAVar15[1]._filename._buf + 0xc) = *(undefined4 *)(extraout_EDX_00 + 0x120); *(undefined4 *)(extraout_EDX_00 + 0x120) = uVar5; uVar9 = pAVar15[1]._filename._size; pAVar15[1]._filename._size = *(uint *)(extraout_EDX_00 + 0x124); *(uint *)(extraout_EDX_00 + 0x124) = uVar9; uVar9 = pAVar15[1]._filename._capacity; *(undefined1 *)&pAVar15[1]._filename._capacity = *(undefined1 *)(extraout_EDX_00 + 0x128); *(char *)(extraout_EDX_00 + 0x128) = (char)uVar9; uVar2 = *(undefined1 *)((int)&pAVar15[1]._filename._capacity + 1); *(undefined1 *)((int)&pAVar15[1]._filename._capacity + 1) = *(undefined1 *)(extraout_EDX_00 + 0x129); *(undefined1 *)(extraout_EDX_00 + 0x129) = uVar2; uVar5 = *(undefined4 *)pAVar15[1]._animDefaultName._buf; *(undefined4 *)pAVar15[1]._animDefaultName._buf = *(undefined4 *)(extraout_EDX_00 + 300); *(undefined4 *)(extraout_EDX_00 + 300) = uVar5; goto LAB_0075df4d; } } iStack_3c = iStack_3c + 1; uStack_48 = uStack_48 - 1; iVar13 = iVar13 + 1; uStack_4c = uStack_4c - 1; iStack_38 = iStack_38 + 0x130; } while (iVar13 < (int)uVar11); } Entity_Player::UpdateCostumes(in_ECX); ExceptionList = local_10; return; } //@@ 0075dfe0 Entity_Player::ClearCostumes /* ZHL [lua] Lua binding EntityPlayer:ClearCostumes prototype: db/protos.zhl */ void __thiscall Entity_Player::ClearCostumes(Entity_Player *this) { uint uVar1; byte bVar2; int *piVar3; FUN_007ddf80(this); (this->_costumeSpriteDescs)._end = (this->_costumeSpriteDescs)._begin; uVar1 = 0; piVar3 = &this->_playerCostumeMap[0]._layerID; do { ((PlayerCostumeMap *)(piVar3 + -1))->_index = -1; *piVar3 = -1; piVar3[1] = 0; if (((uVar1 == 0) || (3 < uVar1)) && (uVar1 != 0xb)) { bVar2 = 0; } else { bVar2 = 1; } *(byte *)(piVar3 + 2) = bVar2; uVar1 = uVar1 + 1; piVar3 = piVar3 + 4; } while (uVar1 < 0xf); return; } //@@ 0075e050 Entity_Player::SetQueuedItem /* DB: FlushQueueItem then writes QueuedItem fields 0x17c4..0x17d4 prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Entity_Player::SetQueuedItem (Entity_Player *this,ItemConfig_Item *item,int charge,byte flags,int varData, int itemPoolType) { byte bVar1; int iVar2; FlushQueueItem(this); (this->_queuedItem)._charge = charge; (this->_queuedItem)._flags = flags; *(int *)&this->field_0x17d0 = varData; (this->_queuedItem)._item = item; *(int *)&this->field_0x17d4 = itemPoolType; if ((((item != (ItemConfig_Item *)0x0) && (item->id == -1)) && (item->type == 1)) && (bVar1 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f), bVar1 != 0)) { iVar2 = PlayerManager::GetGFuelCount(); switch(iVar2) { case 0: case 1: PlayDelayedSFX(this,0x332,0x3c,0xf,1.5); return; case 2: case 3: PlayDelayedSFX(this,0x333,0x3c,0xf,1.7); return; case 4: case 5: PlayDelayedSFX(this,0x334,0x3c,0xf,2.0); return; default: PlayDelayedSFX(this,0x335,0x3c,0x14,2.4); } } return; } //@@ 0075e160 Entity_Player::QueueItem /* ZHL [lua] Lua binding EntityPlayer:QueueItem */ void Entity_Player::QueueItem(ItemConfig_Item *param_1,int param_2,byte param_3,int param_4) { Entity_Player *in_ECX; SetQueuedItem(in_ECX,param_1,param_2,param_3,param_4,(g_game->_itemPool)._lastPool); return; } //@@ 0075e190 Entity_Player::ClearQueueItem /* ZHL [exact] __thiscall void Entity_Player::ClearQueueItem(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::ClearQueueItem(Entity_Player *this) { byte bVar1; bVar1 = IsHoldingItem(this); if (bVar1 != 0) { ANM2::Reset(&this->_heldSprite); } (this->_queuedItem)._item = (void *)0x0; (this->_queuedItem)._charge = 0; (this->_queuedItem)._flags = 0; *(undefined4 *)&this->field_0x17d0 = 0; return; } //@@ 0075e1d0 Entity_Player::FlushQueueItem /* ZHL [lua] Lua binding EntityPlayer:FlushQueueItem prototype: db/protos.zhl, confirmed by RET 0 */ byte __thiscall Entity_Player::FlushQueueItem(Entity_Player *this) { int unk; void *pvVar1; int *piVar2; int charge; int vardata; uint uVar3; uint uVar4; int iVar5; uint type; byte bStack_20; RNG RStack_14; if ((this->_queuedItem)._item == (void *)0x0) { try_trigger_astral_projection(this); return 0; } KAGE_LogMessage(1,(byte *)"item queue flush\n"); piVar2 = (this->_queuedItem)._item; charge = (this->_queuedItem)._charge; uVar4 = *(uint *)&(this->_queuedItem)._flags; vardata = *(int *)&this->field_0x17d0; unk = *(int *)&this->field_0x17d4; (this->_queuedItem)._item = (void *)0x0; (this->_queuedItem)._charge = 0; *(undefined4 *)&this->field_0x17d0 = 0; iVar5 = *piVar2; bStack_20 = (byte)uVar4; if (((iVar5 == 1) || (iVar5 == 3)) || (iVar5 == 4)) { iVar5 = piVar2[1]; if ((g_game->_dailyChallenge)._specialDailyId == 7) { pvVar1 = g_game->_room; RStack_14._shift1 = 1; RStack_14._shift2 = 5; RStack_14._shift3 = 0x10; RStack_14._seed = iVar5; uVar4 = RNG::Next(&RStack_14); iVar5 = ItemPool::GetSeededCollectible(uVar4,0,*(RoomDescriptor **)((int)pvVar1 + 4)); } AddCollectible(this,iVar5,charge,~bStack_20 & 1,0,vardata,unk); } else if (iVar5 == 2) { uVar3 = piVar2[1]; if ((g_game->_dailyChallenge)._specialDailyId == 7) { uVar3 = ItemPool::GetTrinket(&g_game->_itemPool,0); } type = uVar3 | 0x8000; if ((uVar4 & 2) == 0) { type = uVar3; } AddTrinket(this,type,bStack_20 & 1 ^ 1); try_trigger_astral_projection(this); return 1; } try_trigger_astral_projection(this); return 1; } //@@ 0075e320 Entity_Player::IncrementPlayerFormCounter /* DB: ZHL sig shape; +0x17dc[16] form counts, form costumes, TryUnlock prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::IncrementPlayerFormCounter(Entity_Player *this,int ePlayerForm,int num) { byte bVar1; Vector *position; int iVar2; int charge; ItemConfig_Item *Item; char isFormActive; int iVar3; byte *formName; uint uVar4; Manager *manager; int *activeVarData; HUD *messageSlot; bool bVar5; uint slot; byte bVar6; byte bVar7; char isFormActiveBefore; Manager *sfxOwner; Vector local_18; Vector local_10; bool isPrevFound; void *playerFormConfigs; if ((((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && ((uint)ePlayerForm < 0x10) ) && (2 < this->_playerForms[ePlayerForm])) { isFormActiveBefore = '\x01'; } else { isFormActiveBefore = '\0'; } iVar3 = this->_playerForms[ePlayerForm] + num; iVar2 = 0; if (0 < iVar3) { iVar2 = iVar3; } this->_playerForms[ePlayerForm] = iVar2; if (ePlayerForm == 0xf) { this->_playerForms[0xf] = 0; bVar1 = HasCollectible(this,0x23,0); if (bVar1 != 0) { this->_playerForms[0xf] = this->_playerForms[0xf] + 1; } bVar1 = HasCollectible(this,0x106,0); if (bVar1 != 0) { this->_playerForms[0xf] = this->_playerForms[0xf] + 1; } bVar1 = HasTrinket(this,0x30,0); if (bVar1 != 0) { this->_playerForms[0xf] = this->_playerForms[0xf] + 1; } } if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && (((uint)ePlayerForm < 0x10 && (2 < this->_playerForms[ePlayerForm])))) { isFormActive = '\x01'; } else { isFormActive = '\0'; } if (isFormActiveBefore == isFormActive) { return; } if (isFormActive != '\0') { Player_stats_add(&g_game->_onlinePlayerStats,10,this,1.0); } manager = g_manager; sfxOwner = g_manager; if ((ePlayerForm < 0) || (playerFormConfigs = (g_manager->_itemConfig)._playerForms._begin, (int)(g_manager->_itemConfig)._playerForms._end - (int)playerFormConfigs >> 2 <= ePlayerForm)) { local_10.x = 0.0; } else { local_10.x = *(float *)((int)playerFormConfigs + ePlayerForm * 4); if (local_10.x != 0.0) { this->_cacheFlags = this->_cacheFlags | *(uint *)((int)local_10.x + 0x2c); } } switch(ePlayerForm) { case 0: if (isFormActive == '\0') break; PersistentGameData::TryUnlock(&manager->_persistentGameData,0x41); goto LAB_0075e806; case 1: if (isFormActive != '\0') { PersistentGameData::TryUnlock(&manager->_persistentGameData,0xb2); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x160); goto LAB_0075e806; } break; case 2: if (isFormActive == '\0') break; bVar5 = (this->_playerFormsRewarded & 4) == 0; goto LAB_0075e541; case 3: if (isFormActive != '\0') { if ((this->_playerFormsRewarded & 8) == 0) { AddSoulHearts(this,6,0); } goto LAB_0075e806; } break; default: goto switchD_0075e474_caseD_4; case 5: if (isFormActive != '\0') { if ((this->_playerFormsRewarded & 0x20) == 0) { uVar4 = RNG::Next((RNG *)((int)(this->_collectibleRNGs)._begin + 0xd0)); position = Room::FindFreePickupSpawnPosition(g_game->_room,&local_18,&this->_pos,40.0,0,0,0) ; Game::SpawnEx(g_game,5,0x46,position,&g_vectorZero,(Entity *)this,0,uVar4,0); } goto LAB_0075e806; } break; case 8: if (isFormActive != '\0') { if ((this->_playerFormsRewarded & 0x100U) == 0) { AddBlackHearts(this,4); } goto LAB_0075e806; } break; case 0xb: if (isFormActive == '\0') break; bVar5 = (this->_playerFormsRewarded & 0x800U) == 0; LAB_0075e541: if (bVar5) { AddMaxHearts(this,2,0); AddHearts(this,2,0,0); } LAB_0075e806: AddPlayerFormCostume(ePlayerForm); if (local_10.x != 0.0) { formName = (byte *)((int)local_10.x + 0x10); messageSlot = &g_game->_hud; if (0xf < *(uint *)((int)local_10.x + 0x24)) { formName = *(byte **)formName; } formName = string_table_translate(&g_manager->_stringTable,formName); uVar4 = 0; do { if (*(char *)(messageSlot->_messageStack + 2) == '\0') { HUD_Message::Show(messageSlot->_messageStack,formName,&s_empty,1,0); break; } uVar4 = uVar4 + 1; messageSlot = (HUD *)(messageSlot->_playerHUD + 500); } while (uVar4 < 6); } manager = g_manager; local_10.x = 1.84971e-43; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,(int)local_10.x,1.0,2,0,1.0,0.0); uVar4 = Random(); local_10.x = (this->_pos).x + 0.0; local_10.y = (this->_pos).y + 5.0; Game::SpawnEx(g_game,1000,0xf,&local_10,&g_vectorZero,(Entity *)this,2,uVar4,0); this->_playerForms[((uint)ePlayerForm >> 5) + 0x10] = this->_playerForms[((uint)ePlayerForm >> 5) + 0x10] | 1 << ((byte)ePlayerForm & 0x1f); return; case 0xf: bVar5 = false; activeVarData = &this->_activeDesc[0]._varData; isPrevFound = false; uVar4 = 0; do { if (((ActiveItemDesc *)(activeVarData + -7))->_item == 0x23) { if (bVar5) { *activeVarData = 0; bVar5 = isPrevFound; } else { bVar5 = isPrevFound; if (*activeVarData == 1) { if ((this->_playerFormsRewarded & 0x8000U) == 0) { bVar7 = 1; bVar6 = 0; bVar1 = 0; slot = uVar4; iVar2 = GetActiveMaxCharge(this,uVar4); AddActiveCharge(this,iVar2,slot,bVar1,bVar6,bVar7); sfxOwner = g_manager; } if (isFormActive != '\0') { local_18.x = 1.46996e-42; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&sfxOwner->_sfxManager,(int)local_18.x,1.0,2,0,1.0,0.0); ItemOverlay::Show(&g_game->_itemOverlay,0x2f,3,(Entity_Player *)0x0); sfxOwner = g_manager; } bVar5 = true; } } local_18.x = 1.46996e-42; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&sfxOwner->_sfxManager,(int)local_18.x,1.0,2,0,1.0,0.0); HUD::InvalidateActiveItem(&g_game->_hud,this,uVar4); sfxOwner = g_manager; manager = g_manager; isPrevFound = bVar5; } uVar4 = uVar4 + 1; activeVarData = activeVarData + 8; } while (uVar4 < 4); if (!bVar5) { if (isFormActive != '\0') { iVar2 = GetActiveItemSlot(this,0x23); if (-1 < iVar2) { if (((this->_playerFormsRewarded & 0x8000U) == 0) || ((this->_activeDesc[iVar2]._varData == 1 && (iVar3 = GetActiveItem(this,iVar2), 0 < iVar3)))) { iVar3 = 1; } else { iVar3 = 0; } this->_activeDesc[iVar2]._varData = iVar3; if ((this->_playerFormsRewarded & 0x8000U) == 0) { bVar7 = 1; bVar6 = 0; bVar1 = 0; iVar3 = iVar2; charge = GetActiveMaxCharge(this,iVar2); AddActiveCharge(this,charge,iVar3,bVar1,bVar6,bVar7); sfxOwner = g_manager; } HUD::InvalidateActiveItem(&g_game->_hud,this,iVar2); local_18.x = 1.46996e-42; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&sfxOwner->_sfxManager,(int)local_18.x,1.0,2,0,1.0,0.0); ItemOverlay::Show(&g_game->_itemOverlay,0x2f,3,(Entity_Player *)0x0); } goto LAB_0075e806; } break; } switchD_0075e474_caseD_4: if (isFormActive == '\0') break; goto LAB_0075e806; } if ((((-1 < ePlayerForm) && (playerFormConfigs = (manager->_itemConfig)._playerForms._begin, ePlayerForm < (int)(manager->_itemConfig)._playerForms._end - (int)playerFormConfigs >> 2)) && (iVar2 = *(int *)((int)playerFormConfigs + ePlayerForm * 4), iVar2 != 0)) && (iVar2 = *(int *)(iVar2 + 0x28), iVar2 != -1)) { Item = Config::GetNullItem(&manager->_itemConfig,iVar2); RemoveCostume(this,Item); } return; } //@@ 0075e9a0 Entity_Player::AddPlayerFormCostume /* ZHL [lua] Lua binding EntityPlayer:AddPlayerFormCostume */ void Entity_Player::AddPlayerFormCostume(int param_1) { void *pvVar1; int iVar2; Entity_Player *in_ECX; if (-1 < param_1) { pvVar1 = (g_manager->_itemConfig)._playerForms._begin; if (((param_1 < (int)(g_manager->_itemConfig)._playerForms._end - (int)pvVar1 >> 2) && (iVar2 = *(int *)((int)pvVar1 + param_1 * 4), iVar2 != 0)) && (iVar2 = *(int *)(iVar2 + 0x28), iVar2 != -1)) { if ((-1 < iVar2) && (pvVar1 = (g_manager->_itemConfig)._nullItems._begin, iVar2 < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 >> 2)) { AddCostume(in_ECX,*(ItemConfig_Item **)((int)pvVar1 + iVar2 * 4),0); return; } AddCostume(in_ECX,(ItemConfig_Item *)0x0,0); } } return; } //@@ 0075ea20 Entity_Player::SetItemState /* ZHL [exact] __thiscall void Entity_Player::SetItemState(CollectibleType collectible); */ void __thiscall Entity_Player::SetItemState(Entity_Player *this,int param_2) { FlushQueueItem(this); this->_itemState = param_2; return; } //@@ 0075ea40 Entity_Player::render_charge_bars /* DB: ? returns if OptionsConfig _enableChargeBars==0 or not a local netplay player; ANM2 at player+0x758 etc, percent from charge counters (e.g. item 0x2c6 with +0x1f78), AnimationState::Render; from Entity_Player::Render prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::render_charge_bars(Entity_Player *this,Vector *renderPos) { code *pcVar1; byte bVar2; int bar; void *effect; ANM2 *chargeBar; AnimationState *secondLayer; void **weaponSlot2; uint uVar4; void **weaponSlot; float10 fVar5; float fVar6; int visibleBars [6]; int visibleBarCount; float barOffsetY; float barOffsetX; undefined1 local_14 [8]; float local_c; float local_8; int bar; void *collectibles; Manager *manager; EntityPtr twin; if ((g_manager->_optionsConfig)._enableChargeBars == 0) { return; } if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar2 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerIndex), bVar2 == 0)) { return; } manager = g_manager; barOffsetY = (this->_playerSpriteScale).y; visibleBarCount = 0; barOffsetX = barOffsetY * 12.0; barOffsetY = barOffsetY * -35.0; if ((this->_itemState == 0x2c6) && (5 < this->_bagOfCraftingHoldFrames)) { bar = (int)((((float)this->_bagOfCraftingHoldFrames - 5.0) / 25.0) * 100.0); chargeBar = this->_chargeBarSprites; } else { if (this->_playerType == 0x1b) { effect = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x2c0); collectibles = (manager->_itemConfig)._collectibles._begin; if ((int)((int)(manager->_itemConfig)._collectibles._end - (int)collectibles & 0xfffffffcU) < 0xb01) { bar = 0; } else { bar = *(int *)((int)collectibles + 0xb00); } if (effect == (void *)0x0) { fVar6 = 0.0; } else { fVar6 = ((float)*(int *)((int)effect + 8) * 100.0) / (float)*(int *)(bar + 0x78); } FUN_0075ef20(this->_chargeBarSprites + 5,(int)fVar6); } bVar2 = HasCollectible(this,0x2c9,0); if ((bVar2 != 0) && (this->_playerType == 0x1a)) { FUN_0075ef20(this->_chargeBarSprites + 6, (int)(((float)this->_eveSumptoriumCharge / 60.0) * 100.0)); } weaponSlot2 = this->_weapons + 1; local_8 = 0.0; weaponSlot = weaponSlot2; do { if (*weaponSlot != (int *)0x0) { fVar5 = (float10)(**(code **)(*(int *)*weaponSlot + 0x1c))(); local_c = (float)fVar5; if (0.0 < local_c) { bar = (int)(local_c * 100.0); goto LAB_0075ebfa; } } local_8 = (float)((int)local_8 + 1); weaponSlot = weaponSlot + 1; } while ((uint)local_8 < 4); bar = 0; LAB_0075ebfa: FUN_0075ef20(this->_chargeBarSprites,bar); uVar4 = 0; do { if (*weaponSlot2 != (int *)0x0) { fVar5 = (float10)(**(code **)(*(int *)*weaponSlot2 + 0x20))(); local_c = (float)fVar5; if (0.0 < local_c) { bar = (int)(local_c * 100.0); goto LAB_0075ec3c; } } uVar4 = uVar4 + 1; weaponSlot2 = weaponSlot2 + 1; } while (uVar4 < 4); bar = 0; LAB_0075ec3c: FUN_0075ef20(this->_chargeBarSprites + 1,bar); bVar2 = HasCollectible(this,399,0); if (bVar2 != 0) { fVar6 = ((float)this->_mawOfTheVoidChargeTimer * 100.0) / 150.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (100.0 <= fVar6) { fVar6 = 100.0; } bar = 0; if (5 < (int)fVar6) { bar = (int)fVar6; } FUN_0075ef20(this->_chargeBarSprites + 2,bar); } bVar2 = HasCollectible(this,0x283,0); if (bVar2 != 0) { fVar6 = ((float)this->_revelationChargeTimer * 100.0) / 150.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (100.0 <= fVar6) { fVar6 = 100.0; } bar = 0; if (5 < (int)fVar6) { bar = (int)fVar6; } FUN_0075ef20(this->_chargeBarSprites + 3,bar); } bVar2 = HasCollectible(this,0x2a8,0); if (bVar2 == 0) goto LAB_0075ed54; fVar6 = ((float)this->_montezumaChargeTimer * 100.0) / 150.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (100.0 <= fVar6) { fVar6 = 100.0; } bar = 0; if (5 < (int)fVar6) { bar = (int)fVar6; } chargeBar = this->_chargeBarSprites + 4; } FUN_0075ef20(chargeBar,bar); LAB_0075ed54: local_8 = 1.0; bar = visibleBarCount; if (((this->_exists != 0) && (((this->_playerType == 0x1d || (this->_playerType == 0x26)) && (twin = this->_twinPlayer, twin != (EntityPtr)0x0)))) && (((*(int *)((int)twin + 0x161c) != -1 && (*(int *)((int)twin + 0x161c) < this->_playerIndex)) && (twin != (EntityPtr)this)))) { local_14 = (undefined1 [8])0x500000002; uVar4 = g_game->_frameCount + 1; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = uVar4 >> 2 ^ uVar4; uVar4 = uVar4 << 5 ^ uVar4; uVar4 = uVar4 >> 0x15 ^ uVar4; local_8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * 0.15 + 0.05; } while (bar = bar + -1, -1 < bar) { bar = visibleBars[bar]; *(float *)(bar + 0xb4) = local_8; local_14._4_4_ = barOffsetX + renderPos->x + *(float *)(&DAT_00c5d0bc + bar * 8); local_c = barOffsetY + renderPos->y + *(float *)(&DAT_00c5d0c0 + bar * 8); if (*(char *)(bar + 0x109) != '\0') { if (*(char *)(bar + 0x70) == '\0') { AnimationState::Render ((AnimationState *)(bar + 0x30),(Vector *)(local_14 + 4),&g_vectorZero, &g_vectorZero); secondLayer = (AnimationState *)(bar + 0x50); } else { AnimationState::Render ((AnimationState *)(bar + 0x50),(Vector *)(local_14 + 4),&g_vectorZero, &g_vectorZero); secondLayer = (AnimationState *)(bar + 0x30); } AnimationState::Render(secondLayer,(Vector *)(local_14 + 4),&g_vectorZero,&g_vectorZero); } *(undefined4 *)(bar + 0xb4) = 0x3f800000; } return; } //@@ 0075ef20 FUN_0075ef20 uint FUN_0075ef20(ANM2 *param_1,int param_2) { int iVar1; byte bVar2; void *in_EAX; void *extraout_EAX; undefined3 extraout_var; void *extraout_EAX_00; int in_ECX; char *anim; if (param_2 == 0) { if ((param_1->_animState)._animData != (void *)0x0) { anim = "Disappear"; LAB_0075efaf: ANM2::Play(param_1,(byte *)anim,0); in_EAX = extraout_EAX_00; goto LAB_0075efb6; } } else { if (param_2 < 100) { bVar2 = ANM2::SetAnimation(param_1,(byte *)"Charging",1); in_EAX = (void *)CONCAT31(extraout_var,bVar2); if ((bVar2 != 0) && (in_EAX = (void *)0x0, (param_1->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(¶m_1->_animState,(float)param_2); in_EAX = (param_1->_animState)._animData; if (in_EAX != (void *)0x0) { (param_1->_animState)._isPlaying = 0; } } } else { in_EAX = (param_1->_animState)._animData; if ((in_EAX == (void *)0x0) || ((*(char *)((int)in_EAX + 0x34) == '\0' && ((param_1->_animState)._isPlaying == 0)))) { ANM2::Play(param_1,(byte *)"StartCharged",0); if (((param_1->_animState)._animData == (void *)0x0) || (in_EAX = extraout_EAX, (param_1->_animState)._isPlaying == 0)) { anim = "Charged"; goto LAB_0075efaf; } } } LAB_0075efb6: if (((param_1->_animState)._animData != (void *)0x0) && ((param_1->_animState)._isPlaying != 0)) goto LAB_0075efcf; } if (param_2 < 1) { return (uint)in_EAX & 0xffffff00; } LAB_0075efcf: iVar1 = *(int *)(in_ECX + 0x18); *(ANM2 **)(in_ECX + iVar1 * 4) = param_1; *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + 1; return CONCAT31((int3)((uint)iVar1 >> 8),1); } //@@ 0075eff0 Entity_Player::GetCollectibleCount /* ZHL [exact] __thiscall int Entity_Player::GetCollectibleCount(); */ int __thiscall Entity_Player::GetCollectibleCount(Entity_Player *this) { int *piVar1; int iVar2; int iVar3; piVar1 = (this->_collectibleCounts)._begin; iVar2 = 0; for (iVar3 = (int)(this->_collectibleCounts)._end - (int)piVar1 >> 2; iVar3 != 0; iVar3 = iVar3 + -1) { iVar2 = iVar2 + *piVar1; piVar1 = piVar1 + 1; } return iVar2; } //@@ 0075f020 FUN_0075f020 int FUN_0075f020(undefined4 param_1,undefined4 param_2) { int *piVar1; int *piVar2; int in_ECX; int iVar3; uint uVar4; uint uVar5; int iVar6; iVar6 = 0; piVar2 = ItemConfig::GetTaggedItems(&g_manager->_itemConfig,CONCAT44(param_2,param_1)); uVar4 = 0; uVar5 = piVar2[1] - *piVar2 >> 2; if (uVar5 != 0) { do { piVar1 = *(int **)(*piVar2 + uVar4 * 4); iVar3 = *piVar1; if (((iVar3 == 1) || (iVar3 == 3)) || (iVar3 == 4)) { iVar3 = *(int *)(*(int *)(in_ECX + 0x16c8) + piVar1[1] * 4); if (1 < iVar3) { iVar3 = 1; } iVar6 = iVar6 + iVar3; } else if (iVar3 == 2) { iVar3 = iVar6 + 1; if (*(int *)(in_ECX + 0x16c0) != piVar1[1]) { iVar3 = iVar6; } iVar6 = iVar3 + 1; if (*(int *)(in_ECX + 0x16c4) != piVar1[1]) { iVar6 = iVar3; } } uVar4 = uVar4 + 1; } while (uVar4 < uVar5); } return iVar6; } //@@ 0075f0e0 Entity_Player::AddCollectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:AddCollectible prototype: REPENTOGON, confirmed by RET 24 */ void __thiscall Entity_Player::AddCollectible (Entity_Player *this,int type,int charge,byte firsttime,int slot,int vardata,int unk) { float *pfVar1; float *pfVar2; byte *pbVar3; short *psVar4; code *pcVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; undefined8 uVar13; char cVar14; byte bVar15; undefined1 *puVar16; ItemConfig_Item *itemConfig; float *pfVar17; Entity *entity; int *piVar18; undefined3 extraout_var; Vector *spawnPos; uint uVar19; PersistentGameData *persistentData; undefined3 extraout_var_00; uint *puVar20; void *pvVar21; byte isUnused; short livesToAdd; Entity_Player *this_00; EntityPtr EVar22; Entity_Player *this_01; Entity_Player *this_02; Entity_Player *this_03; Entity_Player *this_04; ColorMod *color; PlayerManager *playerManager; Entity_Player *playerManager; std_vector *playerForms; int iVar23; uint uVar24; int iVar25; RNG *rng; ActiveItemDesc *activeDesc; bool bVar26; float fVar27; float statScore; undefined3 in_stack_0000000d; uint uVar28; undefined4 uVar29; int iVar30; uint *puVar31; undefined4 uVar32; EntityRef freezeSource; EntityRef burnSource; EntityRef confusionSource; EntityRef poisonSource; Color poisonCloudColor; Vector keepersSackCoinPos; Vector littleBaggyPillPos; Vector consolationPrizePos; Vector latchKeyKeyPos; Vector matchBookBombPos; Vector starterDeckCardPos; Vector starterDeckChallengeCardPos; Vector caffeinePillPillPos; int trinketHistoryTime; undefined1 uStack_31c; uint trinketHistoryId; undefined4 uStack_314; undefined4 uStack_310; undefined4 uStack_30c; undefined4 uStack_308; Vector polydactylyPickupPos; Vector batteryPackBatteryPos; Vector lipstickHeartPos; Vector purseTrinketPos; Vector tarotClothCardPos; Vector marblesTrinketPos; Vector marrowHeartPos; Vector divorcePapersTrinketPos; Vector falsePhdPillPos; Vector boosterPackCardPos; Vector VStack_2b4; Vector lilSpewerPillPos; Vector momsRingRunePos; Vector edenBirthrightItemPos; Vector soulLocketHeartPos; Vector candyHeartPos; Vector lostCoinPos; Vector sackHeadSackPos; Vector chaosPickupPos; Vector mrDollyHeartPos; Vector crackJacksTrinketPos; Vector clearRuneRunePos; Vector boxPickupPos; Vector squeezySoulHeartPos; Vector coinPursePillPos; Vector magic8BallCardPos; int historyTime; undefined1 isHistoryTrinket; int historyItemId; int historyStage; int historyStageType; undefined4 historyRoomType; uint *historyPoolType; undefined8 uStack_218; EntityList_EL roomEntities; Vector keepersSackPos; void *pennyTrinkets; uint *pennyTrinketsEnd; uint *pennyTrinketsCapacity; Vector VStack_1ec; ItemConfig_Item *collectibleConfig; int collectibleId; EntityPtr local_1dc; EntityPtr EStack_1d8; RNG *local_1d4; uint *local_1d0; undefined4 local_1cc; EntityPtr local_1c8; undefined4 isFirstTime; EntityPtr local_1c0; ItemConfig_Item pickupConfig; int iStack_f0; undefined4 uStack_e0; undefined4 uStack_dc; void *localizedName [4]; uint localizedNameSize; uint localizedNameCapacity; RNG RStack_bc; RNG RStack_ac; void *animName; undefined2 uStack_98; undefined1 uStack_96; undefined1 uStack_95; undefined4 animNameSize; uint animNameCapacity; uint auStack_84 [16]; float statScores [4]; undefined8 twinItemIds; undefined4 uStack_2c; float pickupScores [5]; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Game *game; Manager *manager; local_8 = -NAN; puStack_c = &LAB_00aff018; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(pickupScores + 9); ExceptionList = &local_10; collectibleId = type; local_1cc = (uint *)unk; local_1dc = (EntityPtr)this; collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,type); if (collectibleConfig == (ItemConfig_Item *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] no config for collectible %d.\n"); ExceptionList = local_10; return; } if (slot < 1) { slot = 0; } iVar30 = *(int *)&g_game->_stageTransition; local_1d0 = (uint *)0x3; if (slot < 3) { local_1d0 = (uint *)slot; } if ((((iVar30 != 0) && (*(int *)&g_game->field_0x1ba88 == 1)) && (iVar30 != 3)) && (iVar30 != 4)) { ExceptionList = local_10; return; } if (((this->_playerType == 0x28) && (this->_twinPlayer != (EntityPtr)0x0)) && (collectibleConfig->type != 3)) { AddCollectible((Entity_Player *)this->_twinPlayer,collectibleId,charge,firsttime,(int)local_1d0, vardata,0); ExceptionList = local_10; return; } local_1c8 = (EntityPtr)charge; if ((charge < 0) && (local_1c8 = (EntityPtr)collectibleConfig->_initCharge, (int)local_1c8 < 0)) { local_1c8 = (EntityPtr) GetCollectibleMaxCharge(this,collectibleId,vardata,(int)collectibleConfig); } if (((int)local_1cc < 0) || ((uint *)0x1e < local_1cc)) { local_1d4 = (RNG *)&s_empty; } else { local_1d4 = (RNG *)(&PTR_s_treasure_00b1f3d0)[(int)local_1cc]; } local_1c0 = (EntityPtr)this->_playerIndex; ItemConfig_Item::GetLocalizedName(collectibleConfig,(std_string *)localizedName,0); local_8 = 0.0; KAGE_LogMessage(1,(byte *)"Adding collectible %d (%s) to player %d (%s) from pool %s\n"); local_8 = -NAN; if (0xf < localizedNameCapacity) { uVar24 = localizedNameCapacity + 1; pvVar21 = localizedName[0]; if (0xfff < uVar24) { pvVar21 = *(void **)((int)localizedName[0] + -4); uVar24 = localizedNameCapacity + 0x24; if (0x1f < (uint)((int)localizedName[0] + (-4 - (int)pvVar21))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar21,uVar24); } localizedNameSize = 0; localizedNameCapacity = 0xf; localizedName[0] = (void *)((uint)localizedName[0] & 0xffffff00); EStack_1d8 = (EntityPtr)collectibleId; if (((*(int *)&g_game->_deathmatchManager < 2) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) && (cVar14 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x30))(collectibleId), cVar14 == '\0')) { puVar16 = (undefined1 *)FUN_00429f30(&EStack_1d8); *puVar16 = 1; } isFirstTime = _firsttime; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { InvalidateCoPlayerItems(this); game = g_game; if (((char)isFirstTime != '\0') && (itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId), itemConfig != (ItemConfig_Item *)0x0)) { fVar27 = (game->_itemPool)._unkFloat674; pfVar1 = &(game->_itemPool)._unkFloat674; pfVar2 = &(game->_itemPool)._unkFloat678; pfVar17 = pfVar1; if (*pfVar2 <= fVar27 && fVar27 != *pfVar2) { pfVar17 = &(game->_itemPool)._unkFloat678; } *pfVar1 = *pfVar17; } } iVar30 = collectibleId; PersistentGameData::AddToCollection(&g_manager->_persistentGameData,collectibleId); if (iVar30 < 0) { FUN_009e03d0(iVar30); if (iVar30 == -1) { bVar15 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); manager = g_manager; if (bVar15 != 0) { fVar27 = Room::time_scale_update(g_game->_room); (manager->_musicManager)._targetPitch = fVar27; iVar30 = collectibleId; } } } else { piVar18 = (int *)((int)(this->_collectibleCounts)._begin + iVar30 * 4); *piVar18 = *piVar18 + 1; } if (this->_variant == 0) { if (this->_isCoopGhost == 0) { uVar32 = 0; uVar29 = 1; cVar14 = FUN_0072fe80(1,0); if ((cVar14 != '\0') && (uVar24 = FUN_0075f020(1,0,uVar29,uVar32), 1 < uVar24)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x1f); } uVar32 = 0; uVar29 = 2; cVar14 = FUN_0072fe80(2,0); if ((cVar14 != '\0') && (uVar24 = FUN_0075f020(2,0,uVar29,uVar32), 1 < uVar24)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x92); } uVar32 = 0; uVar29 = 4; cVar14 = FUN_0072fe80(4,0); if ((cVar14 != '\0') && (uVar24 = FUN_0075f020(4,0,uVar29,uVar32), 2 < uVar24)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x23); } uVar32 = 0; uVar29 = 8; cVar14 = FUN_0072fe80(8,0); if ((cVar14 != '\0') && (uVar24 = FUN_0075f020(8,0,uVar29,uVar32), 1 < uVar24)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x171); } uVar32 = 0; uVar29 = 0x10; cVar14 = FUN_0072fe80(0x10,0); if ((cVar14 != '\0') && (uVar24 = FUN_0075f020(0x10,0,uVar29,uVar32), 1 < uVar24)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x16f); } if (iVar30 == 0xfe) { iVar30 = 200; LAB_0075f57d: PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,iVar30,1); } else if (iVar30 == 0xdd) { iVar30 = 0xc9; goto LAB_0075f57d; } FUN_00763290(); uVar32 = 0; uVar29 = 0x800000; cVar14 = FUN_0072fe80(0x800000,0); if ((cVar14 != '\0') && (uVar24 = FUN_0075f020(0x800000,0,uVar29,uVar32), 2 < uVar24)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x196); } } EVar22 = local_1dc; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { historyItemId = collectibleId; historyStageType = g_game->_stageType; historyRoomType = *(undefined4 *)((int)g_game->_room + 8); historyStage = g_game->_stage; historyPoolType = local_1cc; historyTime = g_game->_frameCount; if (*(char *)((int)local_1dc + 0x1824) == '\0') { historyTime = 0; } isHistoryTrinket = 0; History::AddHistoryItem((History *)((int)local_1dc + 0x1dec),&historyTime); stop_costume_item_anims((Entity_Player *)EVar22); this = (Entity_Player *)EVar22; } } itemConfig = collectibleConfig; if ((((char)isFirstTime != '\0') && (*(int *)((int)this + 0x2c) == 0)) && (*(byte *)((int)this + 0x20a9) == 0)) { pickupConfig.type = collectibleConfig->type; pickupConfig.id = collectibleConfig->id; std::string::string(pickupConfig.name._buf,&collectibleConfig->name); local_8 = 1.4013e-45; std::string::string(pickupConfig.desc._buf,&itemConfig->desc); local_8._0_1_ = 2; std::string::string(pickupConfig.gfxFilename._buf,&itemConfig->gfxFilename); local_8._0_1_ = 3; pickupConfig.achievementId = itemConfig->achievementId; pickupConfig.cacheFlags = itemConfig->cacheFlags; pickupConfig.addMaxhearts = itemConfig->addMaxhearts; pickupConfig.addHearts = itemConfig->addHearts; pickupConfig.addSoulHearts = itemConfig->addSoulHearts; pickupConfig.addBlackHearts = itemConfig->addBlackHearts; pickupConfig.addBombs = itemConfig->addBombs; pickupConfig.addKeys = itemConfig->addKeys; pickupConfig.addCoins = itemConfig->addCoins; pickupConfig.maxCharges = itemConfig->maxCharges; pickupConfig.maxCooldown = itemConfig->maxCooldown; pickupConfig.devilprice = itemConfig->devilprice; pickupConfig.shopPrice = itemConfig->shopPrice; pickupConfig.costume.id = (itemConfig->costume).id; std::string::string(pickupConfig.costume.anm2Path._buf,&(itemConfig->costume).anm2Path); pickupConfig.costume.priority = (itemConfig->costume).priority; pickupConfig.costume.hasOverlay = (itemConfig->costume).hasOverlay; pickupConfig.costume.isFlying = (itemConfig->costume).isFlying; pickupConfig.costume.hasSkinAlt = (itemConfig->costume).hasSkinAlt; pickupConfig.costume.skinColor = (itemConfig->costume).skinColor; pickupConfig.costume.overwriteColor = (itemConfig->costume).overwriteColor; pickupConfig.costume._41_1_ = (itemConfig->costume).field_0x29; pickupConfig.costume._42_1_ = (itemConfig->costume).field_0x2a; local_8 = (float)CONCAT31(local_8._1_3_,4); pickupConfig.chargeType = itemConfig->chargeType; pickupConfig.special = itemConfig->special; pickupConfig.passiveCache = itemConfig->passiveCache; pickupConfig.addCostumeOnPickup = itemConfig->addCostumeOnPickup; pickupConfig.hidden = itemConfig->hidden; pickupConfig.tags._4_4_ = *(undefined4 *)((int)&itemConfig->tags + 4); pickupConfig.persistentEffect = itemConfig->persistentEffect; pickupConfig.clearEffectsOnRemove = itemConfig->clearEffectsOnRemove; pickupConfig.tags._0_4_ = (undefined4)itemConfig->tags; pickupConfig.quality = itemConfig->quality; pickupConfig.craftingQuality = itemConfig->craftingQuality; pickupConfig._initCharge = itemConfig->_initCharge; iStack_f0 = itemConfig[1].type; FUN_007dcad0(&itemConfig[1].id); uStack_e0 = *(undefined4 *)(itemConfig[1].name._buf + 8); uStack_dc = *(undefined4 *)(itemConfig[1].name._buf + 0xc); local_8 = 7.00649e-45; if (1 < *(int *)&g_game->_deathmatchManager) { (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x40))(&pickupConfig); } iVar30 = pickupConfig.addHearts; if ((*(int *)((int)this + 0x13c0) == 0x24) && (iVar30 = 0xc, pickupConfig.addHearts < 0xc)) { iVar30 = pickupConfig.addHearts; } EStack_1d8 = *(EntityPtr *)((int)this + 0x1340); AddBombs(this,pickupConfig.addBombs); AddKeys(this,pickupConfig.addKeys); AddCoins(this,pickupConfig.addCoins); AddMaxHearts(this,pickupConfig.addMaxhearts,0); AddHearts(this,iVar30,0,0); AddSoulHearts(this,pickupConfig.addSoulHearts,0); AddBlackHearts(this,pickupConfig.addBlackHearts); iVar30 = GetHealthType(this); if (((iVar30 == 3) || (iVar30 = GetHealthType(this_00), iVar30 == 0)) && (iVar30 = (pickupConfig.addMaxhearts - *(int *)((int)this + 0x1340)) + (int)EStack_1d8, 0 < iVar30)) { *(int *)((int)this + 0x1950) = *(int *)((int)this + 0x1950) + iVar30; } iStack_f0 = 0; local_8 = -NAN; ItemConfig_Item::~ItemConfig_Item(&pickupConfig); } puVar31 = local_1d0; if (collectibleConfig->type == 3) { local_1d4 = (RNG *)((int)(local_1d0 + 0x2b) * 0x20); iVar30 = *(int *)((int)&local_1d4->_seed + (int)this); if ((iVar30 == 0x248) || (iVar30 == 0x3b)) { pbVar3 = (byte *)((int)&local_1d4->_seed + (int)this); pbVar3[0] = 0; pbVar3[1] = 0; pbVar3[2] = 0; pbVar3[3] = 0; } if (((local_1d0 == (uint *)0x0) && (bVar15 = HasCollectible(this,0x216,0), bVar15 != 0)) && (((ActiveItemDesc *)((int)this + 0x15a0))->_item == 0)) { uVar29 = *(undefined4 *)((int)this + 0x15a4); uVar32 = *(undefined4 *)((int)this + 0x15a8); uVar6 = *(undefined4 *)((int)this + 0x15ac); iVar30 = ((ActiveItemDesc *)((int)this + 0x1580))->_item; uVar7 = *(undefined4 *)((int)this + 0x1584); uVar8 = *(undefined4 *)((int)this + 0x1588); uVar9 = *(undefined4 *)((int)this + 0x158c); iVar23 = *(int *)((int)this + 0x1590); uVar10 = *(undefined4 *)((int)this + 0x1594); uVar11 = *(undefined4 *)((int)this + 0x1598); uVar12 = *(undefined4 *)((int)this + 0x159c); ((ActiveItemDesc *)((int)this + 0x1580))->_item = ((ActiveItemDesc *)((int)this + 0x15a0))->_item; *(undefined4 *)((int)this + 0x1584) = uVar29; *(undefined4 *)((int)this + 0x1588) = uVar32; *(undefined4 *)((int)this + 0x158c) = uVar6; *(int *)((int)this + 0x1590) = *(int *)((int)this + 0x15b0); *(undefined4 *)((int)this + 0x1594) = *(undefined4 *)((int)this + 0x15b4); *(undefined4 *)((int)this + 0x1598) = *(undefined4 *)((int)this + 0x15b8); *(undefined4 *)((int)this + 0x159c) = *(undefined4 *)((int)this + 0x15bc); ((ActiveItemDesc *)((int)this + 0x15a0))->_item = iVar30; *(undefined4 *)((int)this + 0x15a4) = uVar7; *(undefined4 *)((int)this + 0x15a8) = uVar8; *(undefined4 *)((int)this + 0x15ac) = uVar9; *(int *)((int)this + 0x15b0) = iVar23; *(undefined4 *)((int)this + 0x15b4) = uVar10; *(undefined4 *)((int)this + 0x15b8) = uVar11; *(undefined4 *)((int)this + 0x15bc) = uVar12; } local_1c0 = *(EntityPtr *)((int)&local_1d4->_seed + (int)this); if ((int)local_1c0 < 0) { FUN_009e0450(local_1c0); } else if (0 < (int)local_1c0) { pvVar21 = ((std_vector *)((int)this + 0x16c8))->_begin; iVar23 = *(int *)((int)pvVar21 + (int)local_1c0 * 4) + -1; iVar30 = 0; if (0 < iVar23) { iVar30 = iVar23; } *(int *)((int)pvVar21 + (int)local_1c0 * 4) = iVar30; } iVar30 = (int)puVar31 * 0x20; *(int *)((int)&local_1d4->_seed + (int)this) = collectibleId; *(uint **)(iVar30 + 0x1584 + (int)this) = local_1cc; *(undefined4 *)(iVar30 + 0x158c + (int)this) = 0; *(int *)(iVar30 + 0x159c + (int)this) = vardata; SetActiveCharge(this,(int)local_1c8,(int)local_1d0); *(undefined4 *)(iVar30 + 0x1590 + (int)this) = 0; *(undefined4 *)(iVar30 + 0x1598 + (int)this) = 0; if (*(int *)((int)this + 0x1600) == 0) { ResetItemState(this); *(undefined1 *)((int)this + 0x1826) = 0; *(int *)((int)this + 0x1884) = 0x1e; } itemConfig = collectibleConfig; if (collectibleConfig->passiveCache != 0) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | collectibleConfig->cacheFlags; } bVar15 = HasTrinket(this,0x65,0); if (bVar15 == 0) { bVar15 = HasTrinket(this,100,0); if (bVar15 == 0) goto LAB_0075fb33; } *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 0x41f; EvaluateItems(); } else { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | collectibleConfig->cacheFlags; itemConfig = collectibleConfig; } LAB_0075fb33: bVar15 = HasCollectible(this,0x298,0); if ((bVar15 != 0) && ((itemConfig->tags & 0x40000) != 0)) { pvVar21 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar21 >> 2 < 0x299) { iVar30 = 0; } else { iVar30 = *(int *)((int)pvVar21 + 0xa60); } *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | *(uint *)(iVar30 + 0x54); } manager = g_manager; if (collectibleId < 0) goto switchD_00762884_caseD_f1; rng = (RNG *)(collectibleId * 0x10 + (int)((std_vector *)((int)this + 6000))->_begin); local_1d4 = rng; if (*(int *)((int)this + 0x2c) != 0) goto LAB_00762861; EVar22 = (EntityPtr)this; if (collectibleId < 0x12f) { if (collectibleId == 0x12e) { LAB_007608d5: IncrementPlayerFormCounter(this,0xd,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } else { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); switch(collectibleId) { case 0xc: goto LAB_007608d5; case 0x15: Level::ApplyCompassEffect((Level *)g_game,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x1d: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { entity = (Entity *)0x0; spawnPos = (Vector *)((int)this + 0x33c); uVar24 = RNG::RandomInt(rng,4); AddBlueFlies(this,uVar24 + 3,spawnPos,entity); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x1f: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&lipstickHeartPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); Game::Spawn(g_game,5,10,&lipstickHeartPos,&g_vectorZero,(Entity *)this,0,uVar24); manager = g_manager; local_1d0 = (uint *)0xdb; seed_fart_sound_override((int *)&local_1d0); SoundEffects::Play(&manager->_sfxManager,(int)local_1d0,1.0,2,0,1.0,0.0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x23: case 0x106: IncrementPlayerFormCounter(this,0xf,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x36: Level::ApplyMapEffect((Level *)g_game); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x48: iVar30 = 0x1f; piVar18 = &(g_game->_itemPool)._pools[0]._bibleUpgrade; do { *piVar18 = *piVar18 + 5; piVar18 = piVar18 + 0xd; iVar30 = iVar30 + -1; uVar13 = uStack_218; } while (iVar30 != 0); break; case 0x4b: goto LAB_00761720; case 0x4c: case 0x5b: Game::UpdateVisibility(g_game); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x51: livesToAdd = 9; if (0 < (int)local_1c8) { livesToAdd = local_1c8._0_2_; } *(short *)((int)this + 0x137e) = *(short *)((int)this + 0x137e) + livesToAdd; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = GetHealthType(this); if (iVar30 == 2) { LAB_007603ee: AddHearts(this,2,1,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } else { iVar30 = GetHealthType(this_01); if (iVar30 == 1) { *(undefined4 *)((int)this + 0x134c) = 2; UpdateBlackHeartMask(this_02); AddHearts(this,2,1,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } else { iVar30 = GetHealthType(this_02); if (iVar30 != 4) { *(undefined4 *)((int)this + 0x1340) = 0; AddMaxHearts(this,2,0); goto LAB_007603ee; } *(undefined4 *)((int)this + 0x1d88) = 0; AddBoneHearts(this,1); AddHearts(this,2,1,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } } break; case 0x74: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { uVar24 = 0; do { bVar15 = FullCharge(this,uVar24,0,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (CONCAT31(extraout_var,bVar15) != 0) break; uVar24 = uVar24 + 1; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } while (uVar24 < 4); } break; case 0x7a: switchD_00761f55_caseD_5: UpdateHeartDependentEffects(this); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x8b: LAB_00761020: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&purseTrinketPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 0; spawnPos = &purseTrinketPos; uVar28 = 0x15e; goto LAB_007627f9; } break; case 0x8d: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { EVar22 = (EntityPtr)0x0; auStack_84[1] = 0x31; auStack_84[2] = 0x32; auStack_84[3] = 0x33; auStack_84[4] = 0x34; auStack_84[0] = 0x18; auStack_84[5] = 0x7e; auStack_84[6] = 0x83; auStack_84[7] = 0x93; auStack_84[8] = 0xac; pennyTrinkets = (void *)0x0; local_1c8 = (EntityPtr)0x0; pennyTrinketsEnd = (uint *)0x0; local_1cc = (uint *)0x0; pennyTrinketsCapacity = (uint *)0x0; local_8 = 9.80909e-45; puVar31 = auStack_84; local_1c0 = (EntityPtr)0x9; do { puVar20 = local_1cc; EStack_1d8 = (EntityPtr)(g_manager->_itemConfig)._trinkets._begin; if ((int)(*puVar31 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)EStack_1d8 >> 2) { pvVar21 = *(void **)((int)EStack_1d8 + (*puVar31 & 0x7fff) * 4); if (pvVar21 != (void *)0x0) { bVar15 = Item::IsAvailable(pvVar21,0xffffffff); EVar22 = local_1c8; if (bVar15 != 0) { if (local_1c8 == (EntityPtr)puVar20) { std::vector::_Emplace_reallocate(local_1c8,puVar31); local_1cc = pennyTrinketsCapacity; } else { *(uint *)local_1c8 = *puVar31; pennyTrinketsEnd = (uint *)((int)local_1c8 + 4); } EVar22 = (EntityPtr)pennyTrinketsEnd; local_1c8 = (EntityPtr)pennyTrinketsEnd; } } } rng = local_1d4; this = (Entity_Player *)local_1dc; puVar31 = puVar31 + 1; local_1c0 = (EntityPtr)((int)local_1c0 + -1); } while (local_1c0 != (EntityPtr)0x0); local_1d0 = (uint *)0x0; if (3 < (uint)((int)EVar22 - (int)pennyTrinkets)) { uVar24 = RNG::RandomInt(local_1d4,(int)EVar22 - (int)pennyTrinkets >> 2); local_1d0 = *(uint **)((int)pennyTrinkets + uVar24 * 4); } EStack_1d8 = (EntityPtr)((local_1d0 != (uint *)0x0) + 7); if (local_1d0 == (uint *)0x0) { local_1c0 = (EntityPtr)0xffffffff; } else { local_1c0 = (EntityPtr)RNG::RandomInt(rng,(uint)EStack_1d8); } local_1c8 = (EntityPtr)0x0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&VStack_1ec,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = rng->_seed; if (local_1c8 == local_1c0) { if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; uVar19 = 0x15e; puVar31 = local_1d0; } else { if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; puVar31 = (uint *)0x0; rng->_seed = uVar24; uVar19 = 0x14; } entity = Game::Spawn(g_game,5,uVar19,&VStack_1ec,&g_vectorZero,(Entity *)this, (uint)puVar31,uVar24); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c8; local_1c8 = (EntityPtr)((int)local_1c8 + 1); } while ((int)local_1c8 < (int)EStack_1d8); local_8 = -NAN; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (pennyTrinkets != (void *)0x0) { uVar24 = (int)local_1cc - (int)pennyTrinkets & 0xfffffffc; pvVar21 = pennyTrinkets; if (0xfff < uVar24) { pvVar21 = *(void **)((int)pennyTrinkets + -4); uVar24 = uVar24 + 0x23; if (0x1f < (uint)((int)pennyTrinkets + (-4 - (int)pvVar21))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar21,uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0x8e: TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x8e,1,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x9b: local_1c0 = (EntityPtr)0xed; seed_fart_sound_override((int *)&local_1c0); SoundEffects::Play(&manager->_sfxManager,(int)local_1c0,1.0,2,0,1.0,0.0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0xb3: goto LAB_00760333; case 0xc2: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&magic8BallCardPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = RNG::Next(rng); iVar30 = ItemPool::GetCardEx(uVar24,0x19,0,10,1); RStack_bc._shift1 = 5; RStack_bc._shift2 = 9; RStack_bc._shift3 = 7; RStack_bc._seed = uVar24; uVar24 = lua_callback_run_get_card(&RStack_bc,iVar30,1,0,0); spawnPos = &magic8BallCardPos; this = (Entity_Player *)local_1dc; LAB_007627ed: EVar22 = (EntityPtr)this; LAB_007627ee: uVar28 = 300; goto LAB_007627f9; } break; case 0xc3: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&coinPursePillPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = rng->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } game = g_game; uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; entity = Game::Spawn(game,5,0x46,&coinPursePillPos,&g_vectorZero,(Entity *)this,0,uVar24 ); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } while ((int)local_1c0 < 4); } break; case 0xc4: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&squeezySoulHeartPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = rng->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } game = g_game; uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; entity = Game::Spawn(game,5,10,&squeezySoulHeartPos,&g_vectorZero,(Entity *)this,3, uVar24); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } while ((int)local_1c0 < 2); } break; case 0xc6: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c8 = (EntityPtr)0x0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&boxPickupPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = rng->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } game = g_game; uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; entity = Game::Spawn(game,5,*(uint *)(&DAT_00b67400 + (int)local_1c8 * 4),&boxPickupPos, &g_vectorZero,(Entity *)this,0,uVar24); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c8; local_1c8 = (EntityPtr)((int)local_1c8 + 1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } while ((int)local_1c8 < 7); } break; case 0xc9: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = GetActiveItemSlot(this,0x93); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (-1 < iVar30) { FullCharge(this,iVar30,1,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0xe6: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = *(int *)((int)this + 0x1d98); if (iVar30 == 0) { iVar23 = 0; } else { iVar23 = *(int *)(iVar30 + 0x1340); } local_1c8 = (EntityPtr)(iVar23 + 4 + *(int *)((int)this + 0x1340)); if (*(int *)&g_game->_deathmatchManager < 2) { *(undefined4 *)((int)this + 0x1344) = 0; iVar23 = 0; } else { local_1c8 = (EntityPtr)((uint)local_1c8 >> 4); iVar23 = *(int *)((int)this + 0x1340) / 2; } *(int *)((int)this + 0x1340) = iVar23; if (iVar30 != 0) { *(undefined4 *)(iVar30 + 0x1344) = 0; *(undefined4 *)(*(int *)((int)this + 0x1d98) + 0x1340) = 0; } UpdateHeartDependentEffects(this); AddBlackHearts(this,(int)local_1c8); TryPreventDeath(this); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0xe8: fVar27 = Room::time_scale_update(g_game->_room); (manager->_musicManager)._targetPitch = fVar27; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0xf6: LAB_007609eb: Level::ApplyBlueMapEffect((Level *)g_game); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0xfb: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { if (g_game->_challenge == 0x2b) { local_1c0 = (EntityPtr)0x3; do { rng = local_1d4; uVar24 = local_1d4->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)local_1d4->_shift3 & 0x1f) ^ uVar24; local_1d4->_seed = uVar24; spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&starterDeckChallengeCardPos, (Vector *)((int)this + 0x33c),40.0,0,0,0); Game::Spawn(g_game,5,300,spawnPos,&g_vectorZero,(Entity *)this,1,uVar24); local_1c0 = (EntityPtr)((int)local_1c0 + -1); } while (local_1c0 != (EntityPtr)0x0); local_1c0 = (EntityPtr)0x0; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } else { uVar24 = RNG::Next(rng); spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&starterDeckCardPos,(Vector *)((int)this + 0x33c), 40.0,0,0,0); Game::Spawn(g_game,5,300,spawnPos,&g_vectorZero,(Entity *)this,0,uVar24); rng = local_1d4; local_1c8 = (EntityPtr)((int)this + 0x17a0); local_1c0 = (EntityPtr)0x4; do { if ((*(int *)local_1c8 != 0) && (*(float *)((int)local_1c8 + 4) == 0.0)) { *(float *)((int)local_1c8 + 4) = 1.4013e-45; uVar24 = rng->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; iVar30 = ItemPool::GetCardEx(uVar24,0x19,0,10,1); RStack_ac._shift1 = 5; RStack_ac._shift2 = 9; RStack_ac._shift3 = 7; RStack_ac._seed = uVar24; iVar30 = lua_callback_run_get_card(&RStack_ac,iVar30,1,0,0); *(int *)local_1c8 = iVar30; } local_1c8 = (EntityPtr)((int)local_1c8 + 8); local_1c0 = (EntityPtr)((int)local_1c0 + -1); } while (local_1c0 != (EntityPtr)0x0); local_1c0 = (EntityPtr)0x0; this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0xfc: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { uVar24 = RNG::Next(rng); spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&littleBaggyPillPos,(Vector *)((int)this + 0x33c),40.0 ,0,0,0); Game::Spawn(g_game,5,0x46,spawnPos,&g_vectorZero,(Entity *)this,0,uVar24); rng = local_1d4; piVar18 = (int *)((int)this + 0x17a0); local_1c0 = (EntityPtr)0x4; do { game = g_game; if ((*piVar18 != 0) && (piVar18[1] == 1)) { piVar18[1] = 0; EStack_1d8 = (EntityPtr)&game->_itemPool; uVar24 = rng->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; iVar30 = ItemPool::GetPill(uVar24); *piVar18 = iVar30; } piVar18 = piVar18 + 2; local_1c0 = (EntityPtr)((int)local_1c0 + -1); } while (local_1c0 != (EntityPtr)0x0); local_1c0 = (EntityPtr)0x0; this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x104: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Level::RemoveCurses((Level *)g_game,0xffffffff); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x107: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { uVar24 = RNG::Next(rng); uVar24 = ItemPool::GetCardEx(uVar24,0,-1,0,1); Room::FindFreePickupSpawnPosition (g_game->_room,&clearRuneRunePos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(local_1d4); spawnPos = &clearRuneRunePos; EVar22 = (EntityPtr)0x0; goto LAB_007627ee; } } } goto switchD_00761f55_caseD_2; } if (collectibleId < 0x245) { if (collectibleId == 0x244) { Room::UpdateRedKey(g_game->_room); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } else { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); switch(collectibleId) { case 0x139: TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x139,1,1); animName = (void *)0x6d696853; uStack_98 = 0x656d; animNameCapacity = 0xf; animNameSize = 7; uStack_96 = 0x72; uStack_95 = 0; local_8 = 8.40779e-45; PlayCollectibleAnim(this,0x139,1,&animName,-1,isUnused); local_8 = -NAN; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (0xf < animNameCapacity) { uVar24 = animNameCapacity + 1; pvVar21 = animName; if (0xfff < uVar24) { pvVar21 = *(void **)((int)animName + -4); uVar24 = animNameCapacity + 0x24; if (0x1f < (uint)((int)animName + (-4 - (int)pvVar21))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar21,uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x14d: Level::ApplyMapEffect((Level *)g_game); Level::ApplyCompassEffect((Level *)g_game,1); goto LAB_007609eb; case 0x157: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x0; do { rng = local_1d4; uVar24 = local_1d4->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)local_1d4->_shift3 & 0x1f) ^ uVar24; local_1d4->_seed = uVar24; spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&latchKeyKeyPos,(Vector *)((int)this + 0x33c),40.0,0 ,0,0); entity = Game::Spawn(g_game,5,0x1e,spawnPos,&g_vectorZero,(Entity *)this,0,uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); } while ((int)local_1c0 < 2); } break; case 0x158: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x0; do { rng = local_1d4; uVar24 = local_1d4->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)local_1d4->_shift3 & 0x1f) ^ uVar24; local_1d4->_seed = uVar24; spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&matchBookBombPos,(Vector *)((int)this + 0x33c),40.0 ,0,0,0); entity = Game::Spawn(g_game,5,0x28,spawnPos,&g_vectorZero,(Entity *)this,0,uVar24); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); } while ((int)local_1c0 < 3); cVar14 = ItemPool::RemoveTrinket(&g_game->_itemPool,0x29); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (cVar14 != '\0') { uVar24 = RNG::Next(local_1d4); spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&VStack_2b4,(Vector *)((int)this + 0x33c),40.0,0,0,0 ); entity = Game::Spawn(g_game,5,0x15e,spawnPos,&g_vectorZero,(Entity *)this,0x29,uVar24); entity[1]._sprite._flipX = 3; entity[1]._sprite._flipY = 0; *(undefined2 *)&entity[1]._sprite.field_0x102 = 0; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0x15e: EVar22 = (EntityPtr)g_game->_room; EStack_1d8 = EVar22; iVar30 = FUN_00456540(); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (0 < iVar30) { cVar14 = '\0'; local_1cc = (uint *)((uint)local_1cc & 0xffffff); local_1c0 = (EntityPtr)0x0; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (*(float *)((int)EVar22 + 0x1264) != 0.0) { do { entity = *(Entity **) (((PlayerCostumeMap *)((int)EVar22 + 0x125c))->_index + (int)local_1c0 * 4); if (((1 < *(int *)&g_game->_deathmatchManager) && (entity->_type == 1)) || (entity->_type - 10U < 0x3de)) { VStack_2b4.y = *(float *)((int)&entity->_flags + 4); if (((entity->_flags & 0x11) == 0) && ((entity->_flags & 0x20000011) == 0)) { EntityRef::constructor(&poisonSource,(Entity *)this); Entity::AddPoison(entity,&poisonSource,0x5a,0.0,0); local_1cc = (uint *)CONCAT13(1,(undefined3)local_1cc); cVar14 = '\x01'; } else { cVar14 = local_1cc._3_1_; } } local_1c0 = (EntityPtr)((int)local_1c0 + 1); EVar22 = EStack_1d8; } while ((uint)local_1c0 < (uint)*(EntityPtr *)((int)EStack_1d8 + 0x1264)); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (cVar14 != '\0') { Color::Color(&poisonCloudColor); poisonCloudColor._colorize[0] = 0.0; poisonCloudColor._colorize[1] = 1.0; poisonCloudColor._colorize[2] = 0.0; poisonCloudColor._colorize[3] = 1.0; Game::start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),color); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } } break; case 0x162: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&crackJacksTrinketPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 0; spawnPos = &crackJacksTrinketPos; uVar28 = 0x15e; goto LAB_007627f9; } break; case 0x172: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x0; do { uVar24 = rng->_seed; if (uVar24 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar24 = rng->_seed; if (uVar24 == 0) { pcVar5 = (code *)swi(3); (*pcVar5)(); return; } } uVar24 = uVar24 >> ((byte)rng->_shift1 & 0x1f) ^ uVar24; local_1c8 = (EntityPtr)0x0; uVar24 = uVar24 << ((byte)rng->_shift2 & 0x1f) ^ uVar24; uVar24 = uVar24 >> ((byte)rng->_shift3 & 0x1f) ^ uVar24; rng->_seed = uVar24; uVar24 = uVar24 % 3; if (uVar24 == 0) { local_1c8 = (EntityPtr)0x1; } else if (uVar24 == 1) { local_1c8 = (EntityPtr)0x3; } else if (uVar24 == 2) { local_1c8 = (EntityPtr)0x6; } Room::FindFreePickupSpawnPosition (g_game->_room,&mrDollyHeartPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); entity = Game::Spawn(g_game,5,10,&mrDollyHeartPos,&g_vectorZero,(Entity *)this, (uint)local_1c8,uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); } while ((int)local_1c0 < 3); } break; case 0x17d: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { cVar14 = Game::IsChallengeOrDaily(g_game); uVar13 = uStack_218; if (cVar14 == '\0') { persistentData = &g_manager->_persistentGameData; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { uStack_218 = FUN_00a23920(); persistentData = (PersistentGameData *)FUN_0090c300(&uStack_218); } EStack_1d8 = (EntityPtr)0x1; iVar30 = 0x10000; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { iVar30 = 1; } persistentData->_eventCounters[0x72] = persistentData->_eventCounters[0x72] + iVar30; uVar13 = uStack_218; } } break; case 0x192: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { uVar24 = RNG::RandomInt(rng,6); EStack_1d8 = (EntityPtr)(uVar24 + 1); local_1c0 = (EntityPtr)0x0; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (0 < (int)EStack_1d8) { do { Room::FindFreePickupSpawnPosition (g_game->_room,&chaosPickupPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); RNG::Next(rng); uVar24 = *(uint *)(&DAT_00b6bd90 + (rng->_seed & 7U) * 4); uVar19 = RNG::Next(local_1d4); entity = Game::Spawn(g_game,5,uVar24,&chaosPickupPos,&g_vectorZero,(Entity *)this,0, uVar19); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); rng = local_1d4; } while ((int)local_1c0 < (int)EStack_1d8); } } break; case 0x19c: *(undefined4 *)((int)this + 0x1934) = 0; trigger_immaculate_conception(1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x19d: *(undefined4 *)((int)this + 0x1930) = 0; trigger_immaculate_conception(0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x1a8: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&sackHeadSackPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 0; spawnPos = &sackHeadSackPos; uVar28 = 0x45; goto LAB_007627f9; } break; case 0x1a9: Level::RemoveCurses((Level *)g_game,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x1b7: bVar15 = HasTrinket(this,0x79,0); if ((bVar15 != 0) && (bVar15 = HasGoldenTrinket(this,0x79), bVar15 == 0)) { FUN_007db0a0(); } iVar30 = GetTrinketMultiplier(this,0x6d); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (1 < iVar30) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (*(int *)((int)this + 0x1ef0) == 0) { *(undefined4 *)((int)this + 0x1ef0) = 1; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0x1c3: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&tarotClothCardPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); uVar24 = ItemPool::GetCardEx(uVar24,0,0,0,0); uVar19 = RNG::Next(local_1d4); EVar22 = (EntityPtr)0x0; spawnPos = &tarotClothCardPos; goto LAB_007627ee; } break; case 0x1c6: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&polydactylyPickupPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar28 = RNG::RandomInt(local_1d4,2); spawnPos = &polydactylyPickupPos; uVar24 = 0; uVar28 = (-(uint)(uVar28 != 0) & 0xffffff1a) + 300; goto LAB_007627f9; } break; case 0x1c7: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&lostCoinPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 5; spawnPos = &lostCoinPos; uVar28 = 0x14; goto LAB_007627f9; } break; case 0x1ca: goto LAB_00761020; case 0x1f1: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (1 < *(int *)&g_game->_deathmatchManager) { TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x1f1,1,1) ; uVar24 = 0; playerManager = &g_game->_playerManager; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { EStack_1d8 = (EntityPtr)PlayerManager::GetPlayer(playerManager,uVar24); if ((EStack_1d8 != (EntityPtr)this) && (EStack_1d8 != *(EntityPtr *)((int)this + 0x1e68))) { EntityRef::constructor(&confusionSource,(Entity *)this); Entity::AddConfusion((Entity *)EStack_1d8,&confusionSource,0x5a,0); } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); uVar24 = uVar24 + 1; playerManager = &g_game->_playerManager; } while (uVar24 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } break; case 0x1f5: update_greeds_gullet(this); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x219: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&lilSpewerPillPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 0; spawnPos = &lilSpewerPillPos; uVar28 = 0x46; goto LAB_007627f9; } break; case 0x21a: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&marblesTrinketPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); entity = Game::Spawn(g_game,5,0x15e,&marblesTrinketPos,&g_vectorZero,(Entity *)this,0, uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); } while ((int)local_1c0 < 3); } break; case 0x21d: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { AddBoneHearts(this,1); local_1c0 = (EntityPtr)0x0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&marrowHeartPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); entity = Game::Spawn(g_game,5,10,&marrowHeartPos,&g_vectorZero,(Entity *)this,1,uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); *(EntityPtr *)&entity[1]._sprite._flipX = local_1c0; local_1c0 = (EntityPtr)((int)local_1c0 + 1); } while ((int)local_1c0 < 3); } break; case 0x223: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { AddBoneHearts(this,1); if ((g_manager->_persistentGameData)._achievements[0x7b] != 0) goto LAB_007612c8; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (g_manager->_state == 2) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (g_game != (Game *)0x0) { if ((g_game->_dailyChallenge)._id == 0) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (g_game->_isDebug == 0) break; } LAB_007612c8: cVar14 = ItemPool::RemoveTrinket(&g_game->_itemPool,0x15); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (cVar14 != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&divorcePapersTrinketPos,(Vector *)((int)this + 0x33c),40.0 ,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 0x15; spawnPos = &divorcePapersTrinketPos; uVar28 = 0x15e; goto LAB_007627f9; } } } } break; case 0x225: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = GetHealthType(this); if ((iVar30 == 3) || (iVar30 = GetHealthType(this_03), iVar30 == 2)) { *(short *)((int)this + 0x1890) = *(short *)((int)this + 0x1890) + 1; *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 2; } else { *(int *)((int)this + 0x1344) = 0; *(int *)((int)this + 0x1340) = 0; if (*(int *)((int)this + 0x1d98) != 0) { *(undefined4 *)(*(int *)((int)this + 0x1d98) + 0x1344) = 0; *(undefined4 *)(*(int *)((int)this + 0x1d98) + 0x1340) = 0; AddBoneHearts(this_04,6); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; } } AddBoneHearts(this,6); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x227: activeDesc = (ActiveItemDesc *)((int)this + 0x1580); local_1cc = (uint *)0x0; if (((ActiveItemDesc *)((int)this + 0x1580))->_item == 0x226) { local_1cc = (uint *)(*(int *)((int)this + 0x158c) + *(int *)((int)this + 0x1588)); } if (((ActiveItemDesc *)((int)this + 0x15a0))->_item == 0x226) { local_1cc = (uint *)(*(int *)((int)this + 0x15ac) + *(int *)((int)this + 0x15a8)); } if (((ActiveItemDesc *)((int)this + 0x15c0))->_item == 0x226) { local_1cc = (uint *)(*(int *)((int)this + 0x15cc) + *(int *)((int)this + 0x15c8)); } if (((ActiveItemDesc *)((int)this + 0x15e0))->_item == 0x226) { local_1cc = (uint *)(*(int *)((int)this + 0x15ec) + *(int *)((int)this + 0x15e8)); } bVar15 = HasCollectible(this,0x226,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (bVar15 != 0) { RemoveCollectible(this,0x226,0,0,1); RemoveCollectible(this,0x227,0,0,1); AddCollectible(this,0x228,0,0,0,0,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); uVar24 = 0; do { if (activeDesc->_item == 0x228) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (-1 < (int)uVar24) { SetActiveCharge(this,(int)local_1cc,uVar24); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; } uVar24 = uVar24 + 1; activeDesc = activeDesc + 1; } while (uVar24 < 4); } } } goto switchD_00761f55_caseD_2; } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); switch(collectibleId) { case 0x24c: FUN_00748a30(); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x24d: Level::reveal_secret_room((Level *)g_game); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x251: *(byte *)((int)this + 0x1e98) = 1; *(int *)((int)this + 0x1e90) = 0; *(int *)((int)this + 0x1e94) = -1; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x252: *(float *)((int)this + 0x1ee8) = 1.0; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x253: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { fire_saturnus_tears(this); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x259: LAB_00760333: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { AddEternalHearts(this,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x25a: Room::TrySpawnSecretShop(0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x25b: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { uVar24 = 0; do { bVar15 = FullCharge(this,uVar24,0,0); rng = local_1d4; if (CONCAT31(extraout_var_00,bVar15) != 0) break; uVar24 = uVar24 + 1; } while (uVar24 < 4); EStack_1d8 = (EntityPtr)((int)this + 0x33c); uVar24 = 0; do { Room::FindFreePickupSpawnPosition (g_game->_room,&batteryPackBatteryPos,(Vector *)EStack_1d8,40.0,0,0,0); uVar19 = RNG::Next(rng); entity = Game::Spawn(g_game,5,0x5a,&batteryPackBatteryPos,&g_vectorZero,(Entity *)0x0, (uint)(uVar24 == 0),uVar19); entity[1]._sprite._flipX = (char)uVar24; entity[1]._sprite._flipY = (char)(uVar24 >> 8); *(short *)&entity[1]._sprite.field_0x102 = (short)(uVar24 >> 0x10); uVar24 = uVar24 + 1; } while (uVar24 < 3); this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x26b: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); switch(*(int *)((int)this + 0x13c0)) { case 1: case 0xe: case 0x16: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { AddMaxHearts(this,2,0); AddHearts(this,2,0,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 3: case 0xc: activeDesc = (ActiveItemDesc *)((int)this + 0x15a0); local_1d0 = (uint *)0x1; do { if (activeDesc->_item == 0x22) { RStack_ac._seed = activeDesc->_item; RStack_ac._shift1 = activeDesc->_unk; RStack_ac._shift2 = activeDesc->_charge; RStack_ac._shift3 = activeDesc->_batteryCharge; RStack_bc._seed = activeDesc->_subCharge; RStack_bc._shift1 = activeDesc->_timeRechargeCooldown; RStack_bc._shift2 = activeDesc->_partialCharge; RStack_bc._shift3 = activeDesc->_varData; RemoveCollectible(this,0x22,1,(uint)local_1d0,0); if (activeDesc->_item == 0x3b) { activeDesc->_item = RStack_ac._seed; activeDesc->_unk = RStack_ac._shift1; activeDesc->_charge = RStack_ac._shift2; activeDesc->_batteryCharge = RStack_ac._shift3; activeDesc->_subCharge = RStack_bc._seed; activeDesc->_timeRechargeCooldown = RStack_bc._shift1; activeDesc->_partialCharge = RStack_bc._shift2; activeDesc->_varData = RStack_bc._shift3; activeDesc->_item = 0x3b; } } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); local_1d0 = (uint *)((int)local_1d0 + -1); activeDesc = activeDesc + -1; } while (-1 < (int)local_1d0); break; case 5: goto switchD_00761f55_caseD_5; case 9: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { VStack_1ec.y = (float)((int)this + 0x33c); local_1cc = (uint *)0x3; iVar30 = -1; do { Room::FindFreePickupSpawnPosition (g_game->_room,&edenBirthrightItemPos,(Vector *)VStack_1ec.y,40.0,0,0,0); local_1d0 = (uint *)0x0; do { uVar24 = RNG::RandomInt(rng,((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) - 1); local_1c8 = (EntityPtr)(uVar24 + 1); local_1c0 = (EntityPtr) ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_1c8); bVar15 = ItemConfig::IsValidCollectible((int)local_1c8); if (((bVar15 != 0) && (((uint)*(void **)((int)local_1c0 + 0xbc) & 1) == 0)) && ((bVar15 = Item::IsAvailable((void *)local_1c0,0xffffffff), bVar15 != 0 && (*(int *)local_1c0 != 3)))) { if (local_1c8 != (EntityPtr)0x0) goto LAB_007620a4; break; } local_1d0 = (uint *)((int)local_1d0 + 1); } while ((int)local_1d0 < 100); local_1c8 = (EntityPtr) ItemPool::GetSeededCollectible (rng->_seed,0,*(RoomDescriptor **)((int)g_game->_room + 4)); if (local_1c8 != (EntityPtr)0x0) { LAB_007620a4: ItemPool::RemoveCollectible(&g_game->_itemPool,(int)local_1c8,0,0); } uVar24 = RNG::Next(rng); EStack_1d8 = (EntityPtr) Game::Spawn(g_game,5,100,&edenBirthrightItemPos,&g_vectorZero,(Entity *)0x0, (uint)local_1c8,uVar24); iVar23 = ItemPool::GetFirstItemPoolForCollectible(&g_game->_itemPool,(int)local_1c8); *(int *)(((ANM2 *)((int)EStack_1d8 + 0x530))->_filename)._buf = iVar23; if (iVar30 < 0) { iVar30 = Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)EStack_1d8); } else { *(int *)((int)EStack_1d8 + 0x528) = iVar30; } local_1cc = (uint *)((int)local_1cc + -1); } while (local_1cc != (uint *)0x0); local_1cc = (uint *)0x0; this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0xb: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { *(int *)((int)this + 0x1e74) = 0x708; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x13: case 0x14: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (*(EntityPtr *)((int)this + 0x1e68) != (EntityPtr)0x0) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (*(EntityPtr *)((int)this + 0x3bc) == (EntityPtr)0x0) { local_1cc = (uint *)0x0; twinItemIds = 0; uStack_2c = 0; iVar30 = FUN_0042c7f0(); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (0 < iVar30) { local_1c0 = (EntityPtr)(iVar30 + -1); local_1d0 = (uint *)0x0; if (-1 < (int)local_1c0) { local_1d0 = (uint *)((int)local_1c0 * 0x1c); puVar31 = (uint *)0x0; do { if (2 < (int)puVar31) break; iVar30 = *(int *)((int)*(EntityPtr *)((int)this + 0x1e68) + 0x1dec); iVar23 = *(int *)((int)local_1d0 + iVar30 + 8); if (*(char *)((int)local_1d0 + iVar30 + 4) == '\0') { bVar15 = CanRerollCollectible(this,iVar23,0); if (((bVar15 != 0) && (itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar23), itemConfig->type != 3)) && (0 < *(int *)(*(int *)((int)*(EntityPtr *)((int)this + 0x1e68) + 0x16c8) + iVar23 * 4))) { *(int *)((int)&twinItemIds + (int)local_1cc * 4) = iVar23; local_1cc = (uint *)((int)local_1cc + 1); } } else { *(int *)((int)&twinItemIds + (int)puVar31 * 4) = -iVar23; local_1cc = (uint *)((int)puVar31 + 1); } local_1c0 = (EntityPtr)((int)local_1c0 + -1); local_1d0 = local_1d0 + -7; puVar31 = local_1cc; } while (-1 < (int)local_1c0); local_1d0 = local_1cc; } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); while( true ) { local_1d0 = (uint *)((int)local_1d0 + -1); if ((int)local_1d0 < 0) break; iVar30 = *(int *)((int)&twinItemIds + (int)local_1d0 * 4); if (iVar30 < 0) { uVar24 = -iVar30; uStack_31c = 1; local_1c0 = (EntityPtr)(uVar24 & 0x7fff); uStack_314 = 1; uStack_310 = 0; uStack_30c = 1; uStack_308 = 0; trinketHistoryTime = g_game->_frameCount; trinketHistoryId = uVar24; History::AddHistoryItem((History *)((int)this + 0x1dec),&trinketHistoryTime); pvVar21 = ((std_vector *)((int)this + 0x1748))->_begin; if ((uVar24 & 0x8000) == 0) { psVar4 = (short *)((int)pvVar21 + (int)local_1c0 * 4); *psVar4 = *psVar4 + 1; } else { psVar4 = (short *)((int)pvVar21 + (int)local_1c0 * 4 + 2); *psVar4 = *psVar4 + 1; } } else if (0 < iVar30) { AddCollectible(this,iVar30,0,0,0,0,0); } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } } } } break; case 0x1e: *(int *)((int)this + 0x1f14) = g_game->_frameCount + 1; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x23: SetPocketActiveItem(this,0x2ca,2,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x24: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { TemporaryEffects::AddNullEffect((TemporaryEffects *)((int)this + 0x1508),0x7a,0,4); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0x26d: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = 0x1518; if (1 < *(int *)&g_game->_deathmatchManager) { iVar30 = 600; } *(int *)((int)this + 0x1e74) = iVar30; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x270: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1d0 = (uint *)0x0; EStack_1d8 = (EntityPtr)((int)this + 0x33c); do { if (local_1d0 == (uint *)0x0) { uVar24 = RNG::Next(rng); iVar23 = 1; iVar30 = 0xf; } else { uVar24 = RNG::Next(rng); iVar23 = 5; iVar30 = 0x19; } local_1c0 = (EntityPtr)ItemPool::GetCardEx(uVar24,iVar30,0,iVar23,0); Room::FindFreePickupSpawnPosition (g_game->_room,&boosterPackCardPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); entity = Game::Spawn(g_game,5,300,&boosterPackCardPos,&g_vectorZero,(Entity *)0x0, (uint)local_1c0,uVar24); *(uint **)&entity[1]._sprite._flipX = local_1d0; local_1d0 = (uint *)((int)local_1d0 + 1); } while (local_1d0 < (uint *)0x5); this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x279: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = GetHeartLimit(this,0); if (0xc < iVar30) { iVar30 = 0xc; } iVar30 = (iVar30 - *(int *)((int)this + 0x134c)) - *(int *)((int)this + 0x1344); if (0 < iVar30) { AddHearts(this,iVar30,1,0); iVar30 = GetHeartLimit(this,0); if (0xc < iVar30) { iVar30 = 0xc; } iVar30 = (iVar30 - *(int *)((int)this + 0x134c)) - *(int *)((int)this + 0x1344); if (0 < iVar30) { AddSoulHearts(this,iVar30,0); } } TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x139,1,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x284: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime == '\0') break; statScores[0] = *(float *)((int)this + 0x1568) * 4.5 - 2.0; fVar27 = *(float *)((int)this + 0x1460); FUN_009bfc40(); statScores[1] = fVar27; fVar27 = pow(*(float *)((int)this + 0x1470),0.56); local_1d0 = (uint *)0xffffffff; statScores[2] = fVar27 * 2.231179 - 2.0; puVar31 = (uint *)0x0; statScores[3] = (*(float *)((int)this + 0x1480) - 230.0) / 60.0 + 2.0; local_1cc = (uint *)0x501502f9; local_1c0 = (EntityPtr)0x501502f9; do { EStack_1d8 = local_1c0; RNG::Next(rng); EVar22 = local_1dc; statScore = (statScores[(int)puVar31] - 0.01) + (float)((double)rng->_seed + __uint_to_double_fixup[-(rng->_seed >> 0x1f)]) * 2.3283062e-10 * 0.02; if (statScore < (float)local_1c0) { local_1c0 = (EntityPtr)statScore; } puVar20 = puVar31; if ((float)EStack_1d8 <= statScore) { puVar20 = local_1d0; } puVar31 = (uint *)((int)puVar31 + 1); local_1d0 = puVar20; } while ((int)puVar31 < 4); switch(puVar20) { case (uint *)0x0: *(int *)((int)local_1dc + 0x1520) = *(int *)((int)local_1dc + 0x1520) + 1; *(int *)((int)local_1dc + 0x1574) = *(int *)((int)local_1dc + 0x1574) | 0x10; break; case (uint *)0x1: *(int *)((int)local_1dc + 0x1524) = *(int *)((int)local_1dc + 0x1524) + 1; *(int *)((int)local_1dc + 0x1574) = *(int *)((int)local_1dc + 0x1574) | 2; break; case (uint *)0x2: *(int *)((int)local_1dc + 0x1528) = *(int *)((int)local_1dc + 0x1528) + 1; *(int *)((int)local_1dc + 0x1574) = *(int *)((int)local_1dc + 0x1574) | 1; break; case (uint *)0x3: *(int *)((int)local_1dc + 0x152c) = *(int *)((int)local_1dc + 0x152c) + 1; *(int *)((int)local_1dc + 0x1574) = *(int *)((int)local_1dc + 0x1574) | 8; } EvaluateItems(); iVar30 = *(int *)((int)EVar22 + 0x13c0); pickupScores[0] = (float)*(int *)((int)EVar22 + 0x1368); pickupScores[1] = (float)*(int *)((int)EVar22 + 0x135c) * 3.0; if (iVar30 == 0x19) { pickupScores[3] = 1e+10; pickupScores[2] = (float)*(int *)((int)EVar22 + 0x1f54) * 3.0; LAB_00761b7c: pickupScores[4] = 1e+10; } else { pickupScores[2] = (float)*(int *)((int)EVar22 + 0x1364) * 3.0; if (iVar30 == 0x12) { pickupScores[3] = ((float)*(int *)((int)EVar22 + 0x1da8) + (float)*(int *)((int)EVar22 + 0x1da8)) - 1.0; goto LAB_00761b7c; } pickupScores[3] = 1e+10; if (iVar30 != 0x24) goto LAB_00761b7c; pickupScores[4] = ((float)*(int *)((int)EVar22 + 0x1dac) + (float)*(int *)((int)EVar22 + 0x1dac)) - 1.0; } EVar22 = (EntityPtr)0x0; local_1c8 = (EntityPtr)0xffffffff; do { RNG::Next(rng); puVar31 = (uint *)pickupScores[(int)EVar22]; if (((float)puVar31 < (float)local_1cc) || (((float)puVar31 == (float)local_1cc && ((rng->_seed & 1) != 0)))) { local_1cc = puVar31; local_1c8 = EVar22; } EVar22 = (EntityPtr)((int)EVar22 + 1); } while ((uint)EVar22 < 5); local_1d0 = (uint *)0x0; this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); switch(local_1c8) { case (EntityPtr)0x0: local_1cc = (uint *)&DAT_00000014; local_1c8 = (EntityPtr)0x3; break; case (EntityPtr)0x1: local_1cc = (uint *)0x1e; local_1c8 = (EntityPtr)0x1; break; case (EntityPtr)0x2: local_1cc = (uint *)0x28; local_1c8 = (EntityPtr)0x1; break; case (EntityPtr)0x3: local_1d0 = (uint *)0x3; local_1c8 = (EntityPtr)0x1; goto LAB_00761cd5; case (EntityPtr)0x4: local_1d0 = (uint *)0x1; local_1c8 = (EntityPtr)0x2; LAB_00761cd5: local_1cc = (uint *)0xa; break; default: goto switchD_00761f55_caseD_2; } EStack_1d8 = (EntityPtr)((int)local_1dc + 0x33c); iVar30 = 0; do { uVar24 = RNG::Next(rng); spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&consolationPrizePos,(Vector *)EStack_1d8,48.0,0,0,0); entity = Game::Spawn(g_game,5,(uint)local_1cc,spawnPos,&g_vectorZero,(Entity *)0x0, (uint)local_1d0,uVar24); entity[1]._sprite._flipX = (char)iVar30; entity[1]._sprite._flipY = (char)((uint)iVar30 >> 8); *(short *)&entity[1]._sprite.field_0x102 = (short)((uint)iVar30 >> 0x10); iVar30 = iVar30 + 1; rng = local_1d4; } while (iVar30 < (int)local_1c8); this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x28e: LAB_00761720: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&falsePhdPillPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar24 = RNG::Next(rng); Game::Spawn(g_game,5,0x46,&falsePhdPillPos,&g_vectorZero,(Entity *)this,0,uVar24); game = g_game; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); uVar24 = 1; do { uVar28 = -(uint)((uVar24 & 0x7ff) != 0) & uVar24 & 0x7ff; uVar19 = 0xe; if (uVar28 < 0xe) { uVar19 = uVar28; } uVar24 = uVar24 + 1; *(undefined1 *)((int)(&game->_itemPool + 1) + uVar19 + 0x3c) = 1; } while (uVar24 < 0xf); } break; case 0x29c: cVar14 = Room::is_pre_ascent_mom_room(); game = g_game; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (cVar14 != '\0') { bVar15 = Level::IsAscent((Level *)g_game); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (bVar15 == 0) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (game->_ascentTimer < 1) { game->_ascentTimer = 1; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } } break; case 0x29f: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&candyHeartPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 1; EVar22 = (EntityPtr)0x0; spawnPos = &candyHeartPos; uVar28 = 10; LAB_007627f9: Game::Spawn(g_game,5,uVar28,spawnPos,&g_vectorZero,(Entity *)EVar22,uVar24,uVar19); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x2ad: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (-1 < (int)local_1d0) { uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (*(int *)((int)local_1d0 * 0x20 + 0x159c + (int)this) < 2) { *(undefined4 *)((int)local_1d0 * 0x20 + 0x159c + (int)this) = 2; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } } break; case 0x2ae: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Room::FindFreePickupSpawnPosition (g_game->_room,&soulLocketHeartPos,(Vector *)((int)this + 0x33c),40.0,0,0,0); uVar19 = RNG::Next(rng); uVar24 = 3; EVar22 = (EntityPtr)0x0; spawnPos = &soulLocketHeartPos; uVar28 = 10; goto LAB_007627f9; } break; case 0x2b4: Room::spawn_sanguine_bond_spikes(g_game->_room,0); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); break; case 0x2b5: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { iVar30 = 8; do { AddSwarmFlyOrbital((int)this + 0x33c); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); iVar30 = iVar30 + -1; } while (iVar30 != 0); } break; case 0x2b6: iVar30 = GetHealthType(this); if (iVar30 == 3) { iVar30 = GetHeartLimit(playerManager,0); iVar23 = 1; iVar25 = (iVar30 + -2) / 2; bVar26 = SBORROW4(iVar25,1); iVar30 = iVar25 + -1; } else { iVar30 = GetHeartLimit(playerManager,1); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (iVar30 < 9) break; iVar30 = GetHeartLimit(this,0); iVar23 = 3; iVar25 = (iVar30 + -2) / 2; bVar26 = SBORROW4(iVar25,3); iVar30 = iVar25 + -3; } if (bVar26 != iVar30 < 0) { iVar23 = iVar25; } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (0 < iVar23) { AddBrokenHearts(this,iVar23); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x2cc: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { VStack_1ec.y = (float)((int)this + 0x33c); Room::FindFreePickupSpawnPosition (g_game->_room,&keepersSackPos,(Vector *)VStack_1ec.y,40.0,0,0,0); uVar24 = RNG::Next(rng); Game::Spawn(g_game,5,0x1e,&keepersSackPos,&g_vectorZero,(Entity *)0x0,0,uVar24); iVar30 = 3; do { spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&keepersSackCoinPos,(Vector *)VStack_1ec.y,40.0,0,0,0); keepersSackPos.x = spawnPos->x; keepersSackPos.y = spawnPos->y; uVar24 = RNG::Next(rng); Game::Spawn(g_game,5,0x14,&keepersSackPos,&g_vectorZero,(Entity *)0x0,0,uVar24); iVar30 = iVar30 + -1; } while (iVar30 != 0); this = (Entity_Player *)local_1dc; uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x2d1: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { Music::Fadeout((Music *)&g_manager->_musicManager,0.01); EntityList_EL::constructor(&roomEntities,(EntityList_EL *)((int)g_game->_room + 0x1258)); local_8 = 1.12104e-44; local_1d0 = (uint *)0x0; if ((uint *)roomEntities._size != (uint *)0x0) { do { puVar31 = local_1d0; entity = *(Entity **)((int)roomEntities._data + (int)local_1d0 * 4); if (((((1 < *(int *)&g_game->_deathmatchManager) && (iVar30 = 1, entity->_type == 1)) || (iVar30 = entity->_type, iVar30 - 10U < 0x3de)) && ((entity->_dead == 0 && (iVar30 != 0x21)))) && (iVar30 != 0x11)) { entity->_bossStatusEffectCooldown = 0; Entity::CopyStatusEffects(entity); entity = *(Entity **)((int)roomEntities._data + (int)puVar31 * 4); EntityRef::constructor(&burnSource,(Entity *)this); Entity::AddBurn(entity,&burnSource,6000,0.0,0); entity = *(Entity **)((int)roomEntities._data + (int)local_1d0 * 4); EntityRef::constructor(&freezeSource,(Entity *)this); Entity::AddFreeze(entity,&freezeSource,6000,0); } local_1d0 = (uint *)((int)local_1d0 + 1); } while (local_1d0 < (uint)roomEntities._size); } local_8 = -NAN; EntityList_Query::~EntityList_Query(&roomEntities); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); } break; case 0x2dc: uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if ((char)isFirstTime != '\0') { local_1c0 = (EntityPtr)0x1; VStack_1ec.y = (float)((int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2); uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); if (1 < (uint)VStack_1ec.y) { do { if (((int)local_1c0 < 0) || (pvVar21 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar21 >> 2 <= (int)local_1c0)) { iVar30 = 0; } else { iVar30 = *(int *)((int)pvVar21 + (int)local_1c0 * 4); } if ((((local_1c0 != (EntityPtr)0x37) && (iVar30 != 0)) && (*(int *)(iVar30 + 0x58) == 2)) && (cVar14 = Card::IsAvailable(), cVar14 != '\0')) { uVar24 = RNG::Next(rng); uVar24 = ItemPool::GetCardEx(uVar24,0,-1,0,1); Room::FindFreePickupSpawnPosition (g_game->_room,&momsRingRunePos,(Vector *)((int)this + 0x33c),0.0,0,0,0); uVar19 = RNG::Next(local_1d4); spawnPos = &momsRingRunePos; goto LAB_007627ed; } uVar13 = CONCAT44(uStack_218._4_4_,(undefined4)uStack_218); local_1c0 = (EntityPtr)((int)local_1c0 + 1); } while ((uint)local_1c0 < (uint)VStack_1ec.y); } } } switchD_00761f55_caseD_2: uStack_218 = uVar13; bVar15 = HasCollectible(this,0x298,0); if (bVar15 == 0) { LAB_00762861: cVar14 = (char)isFirstTime; } else { bVar15 = Item::HasTags(collectibleConfig,0x40000); cVar14 = (char)isFirstTime; if ((bVar15 != 0) && (cVar14 != '\0')) { iVar30 = *(int *)((int)this + 0x1e74); if (iVar30 < 900) { iVar30 = 900; } *(int *)((int)this + 0x1e74) = iVar30; AddHearts(this,2,0,0); goto LAB_00762861; } } rng = local_1d4; switch(collectibleId) { case 0xf0: if (cVar14 != '\0') { iVar30 = 6; auStack_84[9] = 0; auStack_84[10] = 1; auStack_84[0xb] = 2; auStack_84[0xc] = 3; auStack_84[0xd] = 4; auStack_84[0xe] = 5; auStack_84[0xf] = 6; do { uVar19 = RNG::RandomInt(rng,iVar30 + 1); this = (Entity_Player *)local_1dc; uVar24 = auStack_84[iVar30 + 9]; auStack_84[iVar30 + 9] = auStack_84[uVar19 + 9]; iVar30 = iVar30 + -1; auStack_84[uVar19 + 9] = uVar24; } while (0 < iVar30); uVar24 = 0; do { iVar30 = (-(uint)(uVar24 < 4) & 2) - 1; switch(auStack_84[uVar24 + 9]) { case 0: if ((*(int *)((int)this + 0x2c) == 0) && ((2 < *(int *)((int)this + 0x134c) + *(int *)((int)this + 0x1d88) * 2 + *(int *)((int)this + 0x1340) || (uVar24 < 4)))) { AddMaxHearts(this,iVar30 * 2,0); } break; case 1: *(int *)((int)this + 0x1520) = *(int *)((int)this + 0x1520) + iVar30; break; case 2: *(int *)((int)this + 0x1524) = *(int *)((int)this + 0x1524) + iVar30; break; case 3: *(int *)((int)this + 0x1528) = *(int *)((int)this + 0x1528) + iVar30; break; case 4: *(int *)((int)this + 0x152c) = *(int *)((int)this + 0x152c) + iVar30; break; case 5: *(int *)((int)this + 0x1530) = *(int *)((int)this + 0x1530) + iVar30; break; case 6: *(int *)((int)this + 0x1534) = *(int *)((int)this + 0x1534) + iVar30; } uVar24 = uVar24 + 1; } while ((int)uVar24 < 6); } break; case 0x102: if (cVar14 != '\0') { if ((*(int *)((int)this + 0x2c) == 0) && (*(char *)((int)this + 0x20a9) == '\0')) { UseActiveItem(this,(short *)((int)&local_1cc + 2),0x11c,1,-1,0); if ((*(int *)((int)this + 0x2c) == 0) && (*(char *)((int)this + 0x20a9) == '\0')) { std::string::assign((char *)((int)this + 0x139c),(byte *)"Glitch",6); } } uVar24 = RNG::RandomInt(rng,3); *(int *)((int)this + 0x1520) = *(int *)((int)this + 0x1520) + (uVar24 - 1); uVar24 = RNG::RandomInt(rng,3); *(int *)((int)this + 0x1524) = *(int *)((int)this + 0x1524) + (uVar24 - 1); uVar24 = RNG::RandomInt(rng,3); *(int *)((int)this + 0x1528) = *(int *)((int)this + 0x1528) + (uVar24 - 1); uVar24 = RNG::RandomInt(rng,3); *(int *)((int)this + 0x152c) = *(int *)((int)this + 0x152c) + (uVar24 - 1); uVar24 = RNG::RandomInt(rng,3); *(int *)((int)this + 0x1530) = *(int *)((int)this + 0x1530) + (uVar24 - 1); uVar24 = RNG::RandomInt(rng,3); *(undefined4 *)((int)this + 0x1574) = 0xffff; *(int *)((int)this + 0x1534) = *(int *)((int)this + 0x1534) + (uVar24 - 1); } break; case 0x154: if (cVar14 != '\0') { if (*(int *)((int)this + 0x2c) != 0) goto LAB_00762c3c; uVar24 = RNG::Next(local_1d4); spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&caffeinePillPillPos,(Vector *)((int)this + 0x33c),40.0,0, 0,0); Game::Spawn(g_game,5,0x46,spawnPos,&g_vectorZero,(Entity *)this,0,uVar24); } break; case 0x188: iVar30 = GetZodiacEffect(this); itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar30); if (itemConfig != (ItemConfig_Item *)0x0) { *(uint *)((int)this + 0x1574) = *(uint *)((int)this + 0x1574) | itemConfig->cacheFlags; } break; case 0x197: rng = GetCollectibleRNG(this,0x197); uVar24 = RNG::RandomInt(rng,4); *(uint *)((int)this + 0x192c) = uVar24; TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x197,1,1); pvVar21 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar21 & 0xfffffffcU) < 0x45) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar21 + 0x44); } AddCostume(this,itemConfig,0); update_purity_glow(this); *(undefined2 *)((int)this + 0x2ec8) = 0; break; case 0x19f: bVar15 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x19f); if (bVar15 == 0) { TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x19f,1,1); ANM2::Play((ANM2 *)((int)this + 0x530),(byte *)"FloatGlow",0); } break; case 0x1b8: *(int *)((int)this + 0x190c) = g_game->_frameCount; break; case 0x1ba: bVar15 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x1ba); if (bVar15 == 0) { ANM2::Play((ANM2 *)((int)this + 0x644),(byte *)"FloatNoGlow",0); } } switchD_00762884_caseD_f1: if ((*(int *)((int)this + 0x2c) == 0) && ((char)isFirstTime != '\0')) { uVar24 = 0; playerForms = &(g_manager->_itemConfig)._playerForms; if ((int)(g_manager->_itemConfig)._playerForms._end - (int)playerForms->_begin >> 2 != 0) { do { if (((-1 < (int)uVar24) && ((int)uVar24 < (int)playerForms->_end - (int)playerForms->_begin >> 2)) && (iVar30 = *(int *)((int)playerForms->_begin + uVar24 * 4), iVar30 != 0)) { if (*(int *)(iVar30 + 8) != 0 || *(int *)(iVar30 + 0xc) != 0) { cVar14 = FUN_0072fe80(*(int *)(iVar30 + 8),*(int *)(iVar30 + 0xc)); if (cVar14 != '\0') { IncrementPlayerFormCounter(this,uVar24,1); } } } uVar24 = uVar24 + 1; playerForms = &(g_manager->_itemConfig)._playerForms; } while (uVar24 < (uint)((int)(g_manager->_itemConfig)._playerForms._end - (int)playerForms->_begin >> 2)); } } LAB_00762c3c: EvaluateItems(); iVar30 = collectibleId; if ((collectibleId < 0) && (((collectibleConfig->addMaxhearts < 0 || (collectibleConfig->addHearts < 0)) || ((collectibleConfig->addSoulHearts < 0 || (collectibleConfig->addBlackHearts < 0)))))) { TryPreventDeath(this); } if (collectibleConfig->addCostumeOnPickup == 0) { if ((collectibleConfig->type == 3) && (*(int *)((int)this + 0x1600) != 0)) { TryRemoveCollectibleCostume(this,3,0); } } else { AddCostume(this,collectibleConfig,0); } iVar25 = 0; piVar18 = *(int **)((int)this + 0x16c8); iVar23 = *(int *)((int)this + 0x16cc) - (int)piVar18 >> 2; if (iVar23 != 0) { do { iVar25 = iVar25 + *piVar18; piVar18 = piVar18 + 1; iVar23 = iVar23 + -1; } while (iVar23 != 0); if (0x32 < iVar25) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x14a); } } UpdateBookOfVirtues(this,iVar30 == 0x248); if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pvVar21 = InputManager::GetDeviceByPlayerEntity(&g_manager->_netplayManager,this); if (pvVar21 != (void *)0x0) { Player_stats_add(&g_game->_onlinePlayerStats,2,this,1.0); } } ExceptionList = local_10; return; } //@@ 00763290 FUN_00763290 void FUN_00763290(void) { PersistentGameData *this; int *piVar1; int iVar2; Manager *unusedArg; byte bVar3; int *piVar4; int in_ECX; uint uVar5; int iVar6; uint uVar7; iVar6 = *(int *)(*(int *)(in_ECX + 0x16d4) + 0x40); piVar4 = ItemConfig::GetTaggedItems(&g_manager->_itemConfig,0x80000); unusedArg = g_manager; uVar5 = 0; uVar7 = piVar4[1] - *piVar4 >> 2; if (uVar7 != 0) { do { piVar1 = *(int **)(*piVar4 + uVar5 * 4); iVar2 = *piVar1; if (((iVar2 == 1) || (iVar2 == 3)) || (iVar2 == 4)) { iVar6 = iVar6 + *(int *)(*(int *)(in_ECX + 0x16c8) + piVar1[1] * 4); } uVar5 = uVar5 + 1; } while (uVar5 < uVar7); } if (iVar6 < 10) { return; } this = &g_manager->_persistentGameData; if ((g_manager->_persistentGameData)._isReadOnly != 0) { return; } if ((g_manager->_persistentGameData)._achievements[0x17a] != 0) { return; } (g_manager->_persistentGameData)._achievements[0x17a] = 1; if (((unusedArg->_netplayManager == *(NetplayManager *)(unusedArg + 1)) || (bVar3 = Manager::IsGameplayInputActive((int)unusedArg), bVar3 == 0)) && ((unusedArg->_persistentGameData)._isSteamAchievementsEnabled != 0)) { PersistentGameData::UnlockSteamAchievement(this,0x17a); Manager::queue_achievement_popup(0x17a); } *(undefined1 *)this = 1; PersistentGameData::check_challenge_unlocks(this); PersistentGameData::check_collection_unlocks(this); return; } //@@ 00763370 Entity_Player::CheckFamiliar /* ZHL [lua] Lua binding EntityPlayer:CheckFamiliar prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall Entity_Player::CheckFamiliar (Entity_Player *this,uint FamiliarVariant,uint TargetCount,RNG *rng,ItemConfig_Item *Item, int FamiliarSubType) { code *pcVar1; qword qVar2; uint uVar3; int *familiar; Vector *playerPos; Entity_Familiar *spawnedFamiliar; Vector *followPos; uint uVar4; qword *heapUsage; int familiarCount; uint i; EntityList_EL familiars; Vector followTarget; Entity_Player *player; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00aff05d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar4 = 0; if (0 < (int)TargetCount) { uVar4 = TargetCount; } familiarCount = 0; player = this; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,FamiliarVariant,-1,0,0); i = 0; local_8 = 0; if (familiars._size != 0) { do { familiar = (int *)__RTDynamicCast(*(undefined4 *)((int)familiars._data + i * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor, 0,uVar3); if ((((((char)familiar[0x372] == '\0') && (*(char *)((int)familiar + 0xd76) == '\0')) && (*(char *)((int)familiar + 0x172) != '\0')) && ((FamiliarSubType < 0 || (familiar[0xc] == FamiliarSubType)))) && (((Entity_Player *)familiar[0x104] == player || (((Entity_Player *)familiar[0x105] != (Entity_Player *)0x0 && ((Entity_Player *)familiar[0x105] == player)))))) { if (familiarCount < (int)uVar4) { familiarCount = familiarCount + 1; familiar[0x3ba] = (int)Item; } else { (**(code **)(*familiar + 0x28))(); } } i = i + 1; } while (i < (uint)familiars._size); } if (familiarCount < (int)uVar4) { if (FamiliarSubType < 0) { FamiliarSubType = 0; } playerPos = &player->_pos; do { uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } game = g_game; uVar3 = uVar3 >> ((byte)rng->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)rng->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)rng->_shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; spawnedFamiliar = (Entity_Familiar *) Game::Spawn(game,3,FamiliarVariant,playerPos,&g_vectorZero,(Entity *)player, FamiliarSubType,uVar3); followPos = Entity_Familiar::GetFollowTargetPosition(spawnedFamiliar,&followTarget,1); (spawnedFamiliar->_pos).x = followPos->x; (spawnedFamiliar->_pos).y = followPos->y; spawnedFamiliar->_item = Item; (**(code **)(*(int *)spawnedFamiliar + 0xc))(); familiarCount = familiarCount + 1; } while (familiarCount < (int)uVar4); } if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { heapUsage = &g_allocatedBytesNoHeap; } else { heapUsage = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar4 = *(uint *)((int)familiars._data + -4); qVar2 = *heapUsage; *(uint *)heapUsage = (uint)*heapUsage - uVar4; *(uint *)((int)heapUsage + 4) = *(uint *)((int)heapUsage + 4) - (uint)((uint)qVar2 < uVar4); free((uint *)((int)familiars._data + -4)); } } ExceptionList = local_10; return; } //@@ 00763570 Entity_Player::EvaluateItems /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding EntityPlayer:EvaluateItems */ void Entity_Player::EvaluateItems(void) { undefined4 uVar1; undefined1 auVar2 [16]; byte bVar3; char cVar4; byte isProptosisEffect; int iVar5; int iVar6; Vector *pVVar7; Weapon *weapon; int iVar8; int iVar9; int iVar10; int iVar11; float *pfVar12; void *pvVar13; Entity *entity; ChallengeParam *challengeParams; float *pfVar14; int *piVar15; undefined4 *puVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int numOddMushroomLarge; int numMark; int numGrowthHormones; int numPentagram; int numSteven; int numSynthoilEffects; int numDarkMatterEffects; int numGuillotineEffects; int numOddMushroomEffects; int numGrowthHormonesEffects; int iVar22; ItemConfig *itemConfig; ItemConfig_Item *pIVar23; Entity_Player *pEVar24; ColorMod *other; ColorMod *other_00; Entity_Familiar *pEVar25; ColorMod *other_01; ColorMod *color; RNG *pRVar26; uint *puVar27; ItemConfig_Item *collectibleItem; PersistentGameData *persistentGameData; char *pcVar28; char *pcVar29; RNG *rng; ItemOverlay *this; EntityList *entityList; Room *room; PlayerManager *playerManager; TemporaryEffects *temporaryEffects; Entity_Player *parentPlayer; Entity_Player *in_ECX; uint uVar30; int *piVar31; uint uVar32; undefined1 *puVar33; char *pcVar34; bool bVar35; float10 fVar36; undefined1 auVar37 [16]; float fVar38; TemporaryEffects *pTVar39; float fVar40; Entity_Player *pEVar41; Color aCStackY_1d2c [128]; float fVar42; BitSet128 local_6c8; BitSet128 local_6b8; BitSet128 local_6a8; BitSet128 local_698; BitSet128 local_688; BitSet128 local_678; BitSet128 local_668; BitSet128 local_658; Vector local_648; Vector local_640; Vector local_638; Vector local_630; Vector local_628; Vector local_620; Vector local_618; Vector local_610; Vector local_608; Vector local_600; Vector local_5f8 [4]; EntityList_EL fortuneCookieWisps; EntityList_EL familiarList; int local_5b8; undefined4 local_5b4; int local_5b0; undefined4 local_5ac; undefined4 local_5a8; int local_5a4; undefined4 local_5a0; int local_59c; undefined4 local_598; int local_594; int local_590; undefined4 local_58c; int local_588; float local_584; int local_580; undefined4 local_57c; undefined4 local_578; int local_574; undefined4 local_570; int local_56c; undefined4 local_568; float local_564; undefined4 local_560; float local_55c; float local_558; undefined4 local_554; int local_550; int local_54c; float local_548; float local_544; float local_540; undefined4 local_53c; int local_538; undefined4 local_534; int local_530; undefined4 local_52c; int local_528; float local_524; undefined4 local_520; int local_51c; undefined4 local_518; float local_514; float local_510; undefined4 local_50c; undefined4 local_508; undefined4 local_504; undefined4 local_500; int local_4fc; undefined4 local_4f8; int local_4f4; undefined4 local_4f0; float local_4ec; undefined4 local_4e8; float local_4e4; undefined4 local_4e0; float local_4dc; undefined4 local_4d8; float local_4d4; undefined4 local_4d0; int local_4cc; undefined4 local_4c8; float local_4c4; undefined4 local_4c0; undefined4 local_4bc; float local_4b8; undefined1 local_4b4 [12]; undefined1 local_4a8 [12]; float fireRate; Entity_Player *coPlayer; Entity_Player *coopBaby; ItemConfig_Item *local_490; Entity_Player *otherPlayer; RNG *local_488; RNG *local_484; Entity_Player *local_480; byte isEffectsDisabled; byte local_47b; bool isActiveFullyCharged; bool isActiveEmpty; float local_478; char isMistOrGhost; ItemConfig_Item *local_470; Entity_Player *local_46c; TemporaryEffects *local_468; TemporaryEffects *local_464; ItemConfig_Item *local_460; Entity_Player *player; ColorMod local_42c; Color local_400 [2]; Color local_3a8; Color local_37c [7]; Color local_248; RNG local_21c; Color spriteColor; RNG local_1e0; RNG statShuffleRng; char local_1c0 [2]; byte abStack_1be [2]; undefined1 local_1bc; undefined1 auStack_1bb [379]; undefined1 local_40 [8]; float fStack_38; undefined1 *puStack_34; undefined1 *local_30; undefined1 *local_2c; undefined1 local_28 [16]; undefined1 local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; float tintAlpha; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff0d2; local_10 = ExceptionList; local_14 = (float)(__security_cookie ^ (uint)(local_28 + 0x24)); ExceptionList = &local_10; isEffectsDisabled = (in_ECX->_temporaryeffects)._disabled; if ((in_ECX->_hasCurseMistEffect != 0) || (isMistOrGhost = '\0', in_ECX->_isCoopGhost != 0)) { isMistOrGhost = '\x01'; } temporaryEffects = &in_ECX->_temporaryeffects; local_30 = (undefined1 *)0x0; _local_40 = ZEXT816(0); local_2c = (undefined1 *)0x0; local_468 = temporaryEffects; player = in_ECX; bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xf0); if (bVar3 != 0) { fStack_38 = 1.0; local_40 = (undefined1 [8])0x3f80000000000000; local_40._0_4_ = 0x3f800000; local_2c = &DAT_bf800000; local_30 = &DAT_bf800000; puStack_34 = &DAT_bf800000; iVar5 = *(int *)((int)g_game->_room + 4); statShuffleRng._seed = 0; if (iVar5 != 0) { statShuffleRng._seed = *(uint *)(iVar5 + 0x5c); } statShuffleRng._shift1 = 3; statShuffleRng._shift2 = 3; statShuffleRng._shift3 = 0x1a; local_8 = (void *)0x0; uVar32 = 0; do { local_460 = (ItemConfig_Item *)(6 - uVar32); RNG::Next(&statShuffleRng); uVar30 = 0; if (local_460 != (ItemConfig_Item *)0x0) { uVar30 = (uint)statShuffleRng._seed % (uint)local_460; } uVar1 = *(undefined4 *)(local_40 + uVar32 * 4); iVar5 = uVar30 + uVar32; *(undefined4 *)(local_40 + uVar32 * 4) = *(undefined4 *)(local_40 + iVar5 * 4); uVar32 = uVar32 + 1; *(undefined4 *)(local_40 + iVar5 * 4) = uVar1; } while (uVar32 < 5); local_8 = (void *)0xffffffff; } iVar5 = GetTrinketMultiplier(player,0x5c); local_484 = (RNG *)((float)iVar5 * 0.2 + 1.0); if (player->_playerType == 0x24) { local_484 = (RNG *)((float)local_484 * 0.75); } bVar3 = HasCollectible(player,0x298,0); if (bVar3 != 0) { iVar5 = GetCollectibleNum(player,0x16,0); auVar37 = _local_40; fVar38 = (float)iVar5; local_40._4_4_ = (void *)(fVar38 + (float)local_40._4_4_); fStack_38 = auVar37._8_4_; puStack_34 = auVar37._12_4_; fStack_38 = fVar38 + fStack_38; local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x17,0); auVar37 = _local_40; fVar38 = (float)iVar5; local_40._4_4_ = (void *)(fVar38 + (float)local_40._4_4_); auVar2 = _local_40; puStack_34 = auVar37._12_4_; _local_40 = auVar2._0_12_; puStack_34 = (undefined1 *)(fVar38 + (float)puStack_34); local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x18,0); auVar37 = _local_40; fVar38 = (float)iVar5; local_40._0_4_ = fVar38 + (float)local_40._0_4_; auVar2 = _local_40; puStack_34 = auVar37._12_4_; _local_40 = auVar2._0_12_; puStack_34 = (undefined1 *)(fVar38 + (float)puStack_34); local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x19,0); fVar38 = (float)iVar5; fStack_38 = fVar38 + fStack_38; puStack_34 = (undefined1 *)(fVar38 + (float)puStack_34); local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x1a,0); auVar37 = _local_40; fVar38 = (float)iVar5; local_40._0_4_ = fVar38 + (float)local_40._0_4_; auVar2 = _local_40; fStack_38 = auVar37._8_4_; puStack_34 = auVar37._12_4_; local_40 = auVar2._0_8_; fStack_38 = fVar38 + fStack_38; local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x15a,0); fVar38 = (float)iVar5; local_2c = (undefined1 *)(fVar38 + (float)local_2c); puStack_34 = (undefined1 *)(fVar38 + (float)puStack_34); local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x1c8,0); fVar38 = (float)iVar5; local_40._0_4_ = fVar38 + (float)local_40._0_4_; local_2c = (undefined1 *)(fVar38 + (float)local_2c); local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); iVar5 = GetCollectibleNum(player,0x2c3,0); fVar38 = (float)iVar5; local_40._4_4_ = (void *)(fVar38 + (float)local_40._4_4_); local_2c = (undefined1 *)(fVar38 + (float)local_2c); local_30 = (undefined1 *)((float)local_30 - fVar38 * 0.15); } bVar3 = HasCollectible(player,0x29f,0); auVar37 = _local_40; if (bVar3 != 0) { local_40._4_4_ = (void *)((float)*(ushort *)&player->field_0x1db2 * 0.1 + (float)local_40._4_4_) ; local_40._0_4_ = (void *)((float)*(ushort *)&player->field_0x1db0 * 0.1 + (float)local_40._0_4_) ; fStack_38 = auVar37._8_4_; puStack_34 = auVar37._12_4_; fStack_38 = (float)*(ushort *)&player->field_0x1db4 * 0.1 + fStack_38; puStack_34 = (undefined1 *)((float)*(ushort *)&player->field_0x1db6 * 0.1 + (float)puStack_34); local_30 = (undefined1 *)((float)*(ushort *)&player->field_0x1db8 * 0.1 + (float)local_30); local_2c = (undefined1 *)((float)*(ushort *)&player->field_0x1dba * 0.1 + (float)local_2c); } bVar3 = HasCollectible(player,0x2ae,0); auVar37 = _local_40; if (bVar3 != 0) { local_40._4_4_ = (void *)((float)*(ushort *)&player->field_0x1dbe * 0.2 + (float)local_40._4_4_) ; local_40._0_4_ = (void *)((float)*(ushort *)&player->field_0x1dbc * 0.2 + (float)local_40._0_4_) ; fStack_38 = auVar37._8_4_; puStack_34 = auVar37._12_4_; fStack_38 = (float)*(ushort *)&player->field_0x1dc0 * 0.2 + fStack_38; puStack_34 = (undefined1 *)((float)*(ushort *)&player->field_0x1dc2 * 0.2 + (float)puStack_34); local_30 = (undefined1 *)((float)*(ushort *)&player->field_0x1dc4 * 0.2 + (float)local_30); local_2c = (undefined1 *)((float)*(ushort *)&player->field_0x1dc6 * 0.2 + (float)local_2c); } iVar5 = GetActiveMaxCharge(player,0); if (iVar5 < 1) { isActiveEmpty = false; isActiveFullyCharged = false; } else { iVar6 = GetTotalActiveCharge(player,0); isActiveFullyCharged = iVar5 <= iVar6; isActiveEmpty = player->_activeDesc[0]._charge == 0; } if ((player->_cacheFlags & 0x100U) != 0) { local_28 = *(undefined1 (*) [16])&player->field_0x13f0; local_18 = player->field_0x1400; FUN_007539a0(); if ((player->_playerType == 0x10) || (((((player->_variant == 1 && (player->_babySkin == 0x39)) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2c0), bVar3 != 0)) || ((player->_playerType == 0x23 || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x271), bVar3 != 0)))) || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x6e), bVar3 != 0)))) { LAB_00763e51: EnableWeaponType(player); } else { bVar3 = HasCollectible(player,0x243,0); if (bVar3 != 0) { HasCollectible(player,0x2a6,0); goto LAB_00763e51; } bVar3 = HasCollectible(player,0xa8,0); if (((bVar3 != 0) || (bVar3 = HasCollectible(player,0x2a6,0), bVar3 != 0)) || (bVar3 = HasCollectible(player,0x72,0), bVar3 != 0)) goto LAB_00763e51; bVar3 = HasCollectible(player,0x213,0); if (bVar3 == 0) { bVar3 = HasCollectible(player,0x34,0); if (bVar3 == 0) { bVar3 = HasCollectible(player,0x76,0); if ((((bVar3 == 0) || (bVar3 = HasCollectible(player,0x18b,0), bVar3 != 0)) && (((player->_playerType != 7 && ((bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2), bVar3 == 0 && (player->_playerType != 0x1c)))) || (bVar3 = HasCollectible(player,0x18b,0), bVar3 != 0)))) && (((bVar3 = HasCollectible(player,0x18b,0), bVar3 == 0 && (bVar3 = HasCollectible(player,0x44,0), bVar3 == 0)) && (bVar3 = HasCollectible(player,0x149,0), bVar3 == 0)))) { HasCollectible(player,0xe5,0); } } else { HasCollectible(player,0xe5,0); } goto LAB_00763e51; } HasCollectible(player,0xe5,0); EnableWeaponType(player); bVar3 = HasCollectible(player,0x72,0); if (bVar3 != 0) goto LAB_00763e51; } bVar3 = HasWeaponType(player,2); if ((bVar3 != 0) && (bVar3 = HasWeaponType(player,4), bVar3 != 0)) { EnableWeaponType(player); } bVar3 = HasWeaponType(player,0xe); if ((bVar3 != 0) && (((bVar3 = HasCollectible(player,0x76,0), bVar3 != 0 && (bVar3 = HasCollectible(player,0x18b,0), bVar3 == 0)) || (((player->_playerType == 7 || ((bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2), bVar3 != 0 || (player->_playerType == 0x1c)))) && (bVar3 = HasCollectible(player,0x18b,0), bVar3 == 0)) )))) { EnableWeaponType(player); EnableWeaponType(player); } bVar3 = HasWeaponType(player,7); pEVar41 = player; if ((bVar3 != 0) && (bVar3 = HasWeaponType(player,5), bVar3 != 0)) { EnableWeaponType(pEVar41); } bVar3 = HasWeaponType(pEVar41,2); if ((bVar3 != 0) && (bVar3 = HasWeaponType(pEVar41,3), bVar3 != 0)) { EnableWeaponType(pEVar41); } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x100); piVar31 = (int *)&pEVar41->field_0x13f0; uVar32 = 0xd; piVar15 = (int *)local_28; do { if (*piVar15 != *piVar31) goto LAB_00763fb3; piVar15 = piVar15 + 1; piVar31 = piVar31 + 1; bVar35 = 3 < uVar32; uVar32 = uVar32 - 4; } while (bVar35); if ((char)*piVar15 == (char)*piVar31) { bVar35 = false; } else { LAB_00763fb3: bVar35 = true; } if (bVar35) { pEVar41 = player; if (((player->_heldEntity != (Entity *)0x0) && (player->_itemState != 0x25c)) && (player->_itemState != 0x2c5)) { bVar3 = Entity::IsEnemy(player->_heldEntity); pEVar41 = player; if (bVar3 == 0) { (**(code **)(*(int *)player->_heldEntity + 0x28))(); } else { local_584 = 0.1; pVVar7 = Vector::__mul(&player->_velocity,&local_638,&local_584); ThrowHeldEntity(pEVar41,pVVar7); } } uVar32 = 0; do { Isaac::DestoryWeapon((Weapon **)((int)pEVar41->_weapons + uVar32 + 4)); uVar32 = uVar32 + 4; pEVar41 = player; } while (uVar32 < 0x10); local_470 = (ItemConfig_Item *)(player->_weapons + 1); uVar32 = 0; iVar5 = 0; do { if (3 < iVar5) break; if (*(char *)((int)pEVar41->_weapons + uVar32 + 0x14) != '\0') { weapon = Isaac::CreateWeapon(uVar32,(Entity *)pEVar41); iVar5 = iVar5 + 1; local_470->type = (int)weapon; local_470 = (ItemConfig_Item *)&local_470->id; pEVar41 = player; } uVar32 = uVar32 + 1; } while (uVar32 < 0x11); pEVar41->_cacheFlags = pEVar41->_cacheFlags | 1; temporaryEffects = local_468; } } if ((player->_cacheFlags & 4U) != 0) { player->_cacheFlags = player->_cacheFlags | 8; } bVar3 = HasCollectible(player,0x130,0); if (((bVar3 != 0) || (iVar5 = GetZodiacEffect(player), iVar5 == 0x130)) && ((player->_cacheFlags & 0x1bU) != 0)) { player->_cacheFlags = player->_cacheFlags | 0x1b; } pEVar41 = player; if ((player->_cacheFlags & 2) != 0) { if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); local_470 = (ItemConfig_Item *)((float)iVar5 * 0.5 - (float)*piVar15 * 0.4); } else { local_470 = (ItemConfig_Item *)0x0; } iVar5 = GetCollectibleNum(player,0x20,0); pEVar41 = player; local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_470); iVar5 = GetCollectibleNum(player,0x50,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x17d,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,1,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,1); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x172,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x155,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x156,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x156); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0xb7,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x18a,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x223,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x259,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x256,0); local_460 = (ItemConfig_Item *)(((float)iVar5 + (float)local_460) * 0.7); iVar5 = GetCollectibleNum(pEVar41,6,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,6); local_460 = (ItemConfig_Item *)((float)(iVar5 + iVar6) * 1.5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x29d,0); iVar6 = GetCollectibleNum(pEVar41,0x234,0); iVar8 = GetCollectibleNum(pEVar41,0xff,0); iVar9 = GetCollectibleNum(pEVar41,0x73,0); iVar10 = GetCollectibleNum(pEVar41,0x48,0); local_460 = (ItemConfig_Item *) ((float)(iVar10 + iVar5 + iVar6 + iVar8 + iVar9) * 0.5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0xc4,0); iVar6 = GetCollectibleNum(pEVar41,0xb6,0); iVar8 = GetTrinketMultiplier(pEVar41,0x60); iVar9 = GetTrinketMultiplier(pEVar41,0x1a); iVar10 = GetTrinketMultiplier(pEVar41,0xb); iVar11 = GetTrinketMultiplier(pEVar41,10); local_460 = (ItemConfig_Item *) ((float)(iVar11 + (iVar5 - iVar6) + iVar8 + iVar9 + iVar10) * 0.4 + (float)local_460 ); iVar5 = GetCollectibleNum(pEVar41,0xbd,0); iVar6 = GetCollectibleNum(pEVar41,0x65,0); iVar8 = GetCollectibleNum(pEVar41,0x5a,0); local_46c = (Entity_Player *)((float)(iVar8 + iVar5 + iVar6) * 0.2 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x14b,0); iVar6 = GetCollectibleNum(pEVar41,0xed,0); iVar8 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xed); local_46c = (Entity_Player *)((float)local_46c - (float)(iVar8 + iVar5 + iVar6) * 0.3); iVar5 = GetCollectibleNum(pEVar41,0x1b6,0); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.75 + (float)local_46c); iVar5 = GetCollectibleNum(pEVar41,0x1bb,0); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.3 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x1d1,0); local_478 = (float)iVar5 * 0.35 + (float)local_460; bVar3 = HasTrinket(pEVar41,0x65,0); if ((bVar3 != 0) && (isActiveEmpty != false)) { iVar5 = GetTrinketMultiplier(pEVar41,0x65); local_478 = local_478 + (float)iVar5 * 0.5; } bVar3 = HasTrinket(pEVar41,100,0); if ((bVar3 != 0) && (isActiveFullyCharged != false)) { iVar5 = GetTrinketMultiplier(pEVar41,100); local_478 = local_478 + (float)iVar5 * 0.2; } iVar5 = pEVar41->_playerType; if ((iVar5 == 6) || (iVar5 == 0x1b)) { local_478 = local_478 - 0.1; LAB_0076474b: fVar38 = (float)local_40._4_4_ * 0.5; if ((iVar5 == 9) || (iVar5 == 0x1e)) { fVar38 = fVar38 + pEVar41->_edenFireDelay; } } else { if (iVar5 != 0x19) { if ((iVar5 == 0x22) || (iVar5 == 0x1a)) { local_478 = local_478 - 0.5; } else { if (iVar5 != 7) { bVar3 = TemporaryEffects::HasTrinketEffect(local_468,0xa2); if (bVar3 == 0) { iVar5 = pEVar41->_playerType; if (((iVar5 == 0x13) || (iVar5 == 0x25)) || (iVar5 == 0x27)) { local_478 = local_478 + 0.27777; } else if ((iVar5 == 0x14) || (iVar5 == 0x26)) { local_478 = local_478 - 0.099649; } goto LAB_0076474b; } iVar5 = pEVar41->_playerType; } local_478 = local_478 + 0.5; } goto LAB_0076474b; } local_478 = local_478 - 0.35; fVar38 = (float)local_40._4_4_ * 0.5; } if (fVar38 < 0.0) { fVar38 = fVar38 * 0.686655; } local_478 = fVar38 + local_478; if ((iVar5 == 0xe) && (bVar3 = HasCollectible(pEVar41,0xf5,0), bVar3 == 0)) { local_478 = local_478 - 1.9; } if ((pEVar41->_playerType == 0x21) && (bVar3 = HasCollectible(pEVar41,0xf5,0), bVar3 == 0)) { local_478 = local_478 - 2.2; } temporaryEffects = local_468; bVar3 = TemporaryEffects::HasCollectibleEffect(local_468,0x271); if (bVar3 != 0) { local_478 = local_478 - 1.9; } bVar3 = HasPlayerForm(player,7); if (bVar3 != 0) { local_478 = local_478 - 0.3; } if (0 < player->_coopBabyBuffTimers[1]) { local_478 = local_478 + 1.0; } local_4bc = 0; local_4b8 = local_478 * 1.3 + 1.0; pfVar12 = (float *)std::max(); fVar38 = *pfVar12; FUN_00431260(); local_4c0 = 0; local_460 = (ItemConfig_Item *)fVar38; pfVar12 = (float *)std::min(); local_4c8 = 0x40a00000; local_4c4 = (16.0 - (float)local_460 * 6.0) - *pfVar12 * 6.0; pfVar12 = (float *)std::max(); pEVar41 = player; local_478 = *pfVar12; local_480 = (Entity_Player *)(30.0 / (local_478 + 1.0)); bVar3 = HasCollectible(player,600,0); if (bVar3 != 0) { local_480 = (Entity_Player *)((float)local_480 * 1.2); } if (((float)local_484 != 1.0) && (2.7272727 < (float)local_480)) { local_480 = (Entity_Player *) ((float)local_480 + ((float)local_480 - 2.7272727) * ((float)local_484 - 1.0)); } bVar3 = HasCollectible(pEVar41,0x197,0); if (((bVar3 == 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x197), bVar3 == 0)) || (pEVar41->_purityState != 1)) { local_464 = (TemporaryEffects *)0x0; } else { local_464 = (TemporaryEffects *)0x40000000; } iVar5 = GetZodiacEffect(pEVar41); if (iVar5 == 0x133) { local_470 = (ItemConfig_Item *)0x3f800000; } else { local_470 = (ItemConfig_Item *)0x0; } iVar5 = GetZodiacEffect(pEVar41); if (iVar5 == 0x135) { local_488 = (RNG *)0x3f800000; } else { local_488 = (RNG *)0x0; } if ((pEVar41->_hasCurseMistEffect == 0) && (pEVar41->_isCoopGhost == 0)) { local_46c = (Entity_Player *)pEVar41->_fireDelayModifier; } else { local_46c = (Entity_Player *)0x0; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x1ba); pEVar41 = player; if (bVar3 == 0) { local_460 = (ItemConfig_Item *)0x0; } else { local_460 = (ItemConfig_Item *)0x40000000; } iVar5 = GetCollectibleNum(player,0x133,0); iVar6 = GetCollectibleNum(pEVar41,0xe4,0); iVar8 = GetCollectibleNum(pEVar41,0xe0,0); iVar9 = GetCollectibleNum(pEVar41,0xce,0); iVar10 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xce); local_470 = (ItemConfig_Item *) ((float)(iVar10 + iVar5 + iVar6 + iVar8 + iVar9) + (float)local_470); iVar5 = GetCollectibleNum(pEVar41,0x135,0); local_470 = (ItemConfig_Item *) (((float)iVar5 + (float)local_470 + (float)local_488 + (float)(int)local_46c) * 0.5) ; iVar5 = GetTrinketMultiplier(pEVar41,0x27); local_460 = (ItemConfig_Item *) ((float)(int)pEVar41->_brittleBonesUpgrades * 0.4 + (float)iVar5 + (float)local_464 + (float)local_470 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x18d,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x18d); local_460 = (ItemConfig_Item *)((float)(iVar5 + iVar6) + (float)local_460); iVar5 = TemporaryEffects::GetNullEffectNum(&pEVar41->_temporaryeffects,0x3e); local_460 = (ItemConfig_Item *)((float)iVar5 * 1.5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x246); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.75 + (float)local_460); iVar5 = TemporaryEffects::GetNullEffectNum(&pEVar41->_temporaryeffects,0x47); local_480 = (Entity_Player *)((float)iVar5 * 0.3 + (float)local_460 + (float)local_480); bVar3 = HasCollectible(pEVar41,0x78,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar41->_temporaryeffects,0x78), bVar3 == 0 )) { temporaryEffects = local_468; } else { iVar5 = GetCollectibleNum(pEVar41,0x78,0); temporaryEffects = local_468; iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_468,0x78); local_480 = (Entity_Player *)((float)(iVar5 + iVar6) * 0.7 + 1.0 + (float)local_480); } if ((((player[1]._chargeBarSprites[0]._championColor._tint[0] != 1.44334e-43) || (*(char *)(player[1]._chargeBarSprites[0]._color._offset + 1) != '\x01')) || (player->_numKeys != player->_numBombs)) || (local_47b = 1, player->_numBombs != player->_numCoins)) { local_47b = 0; } bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0x67); pEVar41 = player; if ((bVar3 != 0) || (local_47b != 0)) { iVar5 = GetTrinketMultiplier(player,0x67); local_480 = (Entity_Player *)((float)iVar5 + (float)iVar5 + (float)local_480); } iVar5 = GetCollectibleNum(pEVar41,0x22a,0); local_46c = (Entity_Player *)((float)iVar5 * 0.5 + (float)local_480); bVar3 = HasWeaponType(player,2); if (bVar3 == 0) { iVar5 = GetCollectibleNum(player,0xde,0); local_46c = (Entity_Player *)((float)iVar5 + (float)local_46c); } iVar5 = is_achievement_79_unlocked(player); fVar38 = (float)iVar5 * 0.5 + (float)local_46c; local_464 = (TemporaryEffects *)fVar38; iVar5 = get_seeded_variant(player); if (iVar5 == 3) { LAB_00764de6: fVar38 = (float)local_464 * 0.4; LAB_00764df6: local_464 = (TemporaryEffects *)fVar38; } else { if (iVar5 == 4) { fVar38 = (float)local_464 * 5.5; goto LAB_00764df6; } if (iVar5 == 5) goto LAB_00764de6; } pvVar13 = TemporaryEffects::GetCollectibleEffect(temporaryEffects,0x1b4); if (pvVar13 != (void *)0x0) { fVar38 = (float)*(int *)((int)pvVar13 + 4) + (float)local_464; local_464 = (TemporaryEffects *)fVar38; } iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x39); if (0 < iVar5) { fVar38 = (float)iVar5 * 0.4 + 0.8 + (float)local_464; local_464 = (TemporaryEffects *)fVar38; } iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x237); if (0 < iVar5) { fVar38 = (float)iVar5 * 0.4 + (float)local_464; local_464 = (TemporaryEffects *)fVar38; } iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x4a); if (0 < iVar5) { fVar38 = (float)iVar5 * 0.5 + 0.5 + (float)local_464; local_464 = (TemporaryEffects *)fVar38; } FUN_00753880(); local_464 = (TemporaryEffects *)(fVar38 + (float)local_464); if (0 < player->_grantedCollectibleCountdown) { local_464 = (TemporaryEffects *)((float)local_464 + 1.5); } pvVar13 = TemporaryEffects::GetNullEffect(temporaryEffects,0x30); if (pvVar13 != (void *)0x0) { local_464 = (TemporaryEffects *)((float)local_464 + (float)*(int *)((int)pvVar13 + 4) * 0.25); } bVar3 = HasCollectible(player,0xf5,0); if (bVar3 == 0) { bVar3 = HasCollectible(player,0x99,0); if ((bVar3 == 0) && ((bVar3 = HasCollectible(player,0xa9,0), bVar3 == 0 || (bVar3 = HasWeaponType(player,0xe), bVar3 != 0)))) { bVar3 = HasCollectible(player,2,0); if ((bVar3 != 0) || ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,2), bVar3 != 0 || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x41), bVar3 != 0)))) { local_464 = (TemporaryEffects *)((float)local_464 * 0.51); } } else { local_464 = (TemporaryEffects *)((float)local_464 * 0.42); } } bVar3 = HasCollectible(player,0x95,0); if ((bVar3 != 0) && (((bVar3 = HasWeaponType(player,1), bVar3 != 0 || (bVar3 = HasWeaponType(player,7), bVar3 != 0)) || (bVar3 = HasWeaponType(player,3), bVar3 != 0)))) { local_464 = (TemporaryEffects *)((float)local_464 / 3.0); } bVar3 = HasCollectible(player,0x213,0); if (bVar3 != 0) { bVar3 = HasCollectible(player,0x95,0); if ((bVar3 == 0) && (bVar3 = HasWeaponType(player,1), bVar3 != 0)) { local_464 = (TemporaryEffects *)((float)local_464 * 0.5); } local_460 = (ItemConfig_Item *)(30.0 / (float)local_464); bVar3 = HasWeaponType(player,0xe); if (bVar3 == 0) { fVar38 = (float)local_464 * 10.0; fVar40 = (float)local_460 + 10.0; } else { fVar38 = (float)local_464 * 4.0; fVar40 = (float)local_460 + 4.0; } local_464 = (TemporaryEffects *)((float)local_464 - fVar38 / fVar40); local_46c = (Entity_Player *)0x0; bVar3 = HasCollectible(player,0x76,0); if (bVar3 == 0) { bVar3 = HasCollectible(player,0x34,0); if (bVar3 != 0) { local_46c = (Entity_Player *)0x41200000; } } else { local_46c = (Entity_Player *)0x41a00000; } bVar3 = HasWeaponType(player,7); pEVar41 = local_46c; if (bVar3 != 0) { pEVar41 = (Entity_Player *)((float)local_46c * 0.5); } local_464 = (TemporaryEffects *) ((float)local_464 - ((float)pEVar41 * (float)local_464) / (30.0 / (float)local_464 + (float)pEVar41)); } bVar3 = HasWeaponType(player,2); if (bVar3 == 0) { bVar3 = HasWeaponType(player,5); if (bVar3 == 0) { bVar3 = HasWeaponType(player,10); if (bVar3 != 0) { local_464 = (TemporaryEffects *)((float)local_464 * 0.5); } } else { local_464 = (TemporaryEffects *)((float)local_464 / 2.5); } } else { local_464 = (TemporaryEffects *)((float)local_464 / 3.0); if (((player->_playerType == 7) || (bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2), bVar3 != 0)) && (bVar3 = HasCollectible(player,0x76,0), bVar3 == 0)) { local_464 = (TemporaryEffects *)((float)local_464 / 1.25); } } bVar3 = HasCollectible(player,0x98,0); if (bVar3 != 0) { local_464 = (TemporaryEffects *)((float)local_464 / 1.5); } if (player->_playerType == 0x1a) { local_464 = (TemporaryEffects *)((float)local_464 * 0.66); } bVar3 = HasCollectible(player,0x136,0); if (bVar3 != 0) { local_464 = (TemporaryEffects *)((float)local_464 * 0.66); } bVar3 = HasWeaponType(player,7); if (bVar3 == 0) { bVar3 = HasWeaponType(player,9); if ((bVar3 != 0) && (bVar3 = HasCollectible(player,0xe5,0), bVar3 != 0)) { local_464 = (TemporaryEffects *)((float)local_464 / 3.1); } } else { local_464 = (TemporaryEffects *)((float)local_464 / 4.3); } bVar3 = HasCollectible(player,0x231,0); if (bVar3 == 0) { bVar3 = HasCollectible(player,0x14a,0); if (bVar3 != 0) { local_464 = (TemporaryEffects *)((float)local_464 * 5.5); } } else { local_464 = (TemporaryEffects *)((float)local_464 * 4.0); } if (player->_hallowedGroundCountdown != 0) { local_464 = (TemporaryEffects *)((float)local_464 * 2.5); } bVar3 = HasCollectible(player,0x170,0); if ((bVar3 != 0) && (0 < player->_epiphoraCharge)) { local_464 = (TemporaryEffects *) ((float)local_464 * ((float)player->_epiphoraCharge / 180.0 + 1.0)); } if (0 < player->_peeBurstCooldown) { local_464 = (TemporaryEffects *) ((((float)player->_peeBurstCooldown * 5.0) / (float)player->_maxPeeBurstCooldown + 1.0) * (float)local_464); } bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x3f); if (bVar3 == 0) { bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2d9); if ((((bVar3 != 0) && (bVar3 = HasCollectible(player,0x3b,0), bVar3 != 0)) && (entity = (Entity *)FUN_0042d040(), entity != (Entity *)0x0)) && (((iVar5 = Entity::SubType(entity), iVar5 != 8 && (iVar5 = Entity::SubType(entity), iVar5 != 4)) && ((iVar5 = Entity::SubType(entity), iVar5 != 0xf && (uVar32 = Entity::SpawnerType(entity), (uVar32 & 0x10) == 0)))))) { local_464 = (TemporaryEffects *)((float)local_464 * 3.0); } } else { local_464 = (TemporaryEffects *)((float)local_464 * 4.0); } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2c0); if (bVar3 != 0) { local_464 = (TemporaryEffects *)((float)local_464 + 2.0); } bVar3 = HasCollectible(player,0x2b7,0); if ((bVar3 != 0) && (isEffectsDisabled == 0)) { fVar38 = Math::clamp(0.0,6.0,(float)(int)player->_bloodLustCounter); local_464 = (TemporaryEffects *)(fVar38 * 0.05 * fVar38 + fVar38 * 0.2 + (float)local_464); } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xba); if ((bVar3 != 0) && (isEffectsDisabled == 0)) { fVar38 = Math::clamp(0.0,999.0,(float)(int)player->_bloodLustCounter); local_464 = (TemporaryEffects *)(fVar38 * 0.15 + 0.33 + (float)local_464); } iVar5 = get_seeded_variant(player); pTVar39 = local_464; if (iVar5 == 2) { pTVar39 = (TemporaryEffects *)((float)local_464 * 0.75); } local_478 = 30.0 / ((float)pTVar39 * player->_d8FireDelayModifier) - 1.0; if (player->_variant == 1) { pEVar41 = GetMainPlayer(player); cVar4 = CanShoot(pEVar41); if (cVar4 == '\0') { local_478 = 10.0; } } if ((player->_variant == 0) && (iVar5 = Game::Challenge(g_game), iVar5 != 0)) { iVar5 = Game::Challenge(g_game); challengeParams = Manager::GetChallengeParams(g_manager,iVar5); if (0.0 < challengeParams->_minFireRate) { iVar5 = Game::Challenge(g_game); Manager::GetChallengeParams(g_manager,iVar5); pfVar12 = (float *)std::max(); local_478 = *pfVar12; } } pvVar13 = g_luaEngine; pfVar12 = &player->_maxfiredelay; *pfVar12 = local_478; LuaEngine::EvaluateItems(pvVar13,player,2); pfVar14 = (float *)std::max(); game = g_game; *pfVar12 = *pfVar14; Game::GetField26614(game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { pEVar41 = player; } else { Game::GetField26614(g_game); piVar15 = (int *)EntityList::Size(); pEVar41 = player; (**(code **)(*piVar15 + 0x6c))(); } } if ((pEVar41->_cacheFlags & 1) != 0) { pTVar39 = (TemporaryEffects *)&pEVar41->_damage; *(float *)pTVar39 = 0.0; pEVar41->_meleeDamage = 0.0; local_464 = pTVar39; pvVar13 = TemporaryEffects::GetCollectibleEffect(temporaryEffects,0x22); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)(*(int *)((int)pvVar13 + 4) + -1) + 2.0 + *(float *)pTVar39; } bVar3 = HasCollectible(player,7,0); if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 + 1.0; } bVar3 = HasCollectible(player,0x5a,0); if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 + 1.0; } bVar3 = HasCollectible(player,0xd8,0); if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 + 1.0; } bVar3 = HasPlayerForm(player,5); if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 + 2.0; } bVar3 = HasPlayerForm(player,7); if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 - 0.3; } bVar3 = HasCollectible(player,0x6d,0); local_460 = (ItemConfig_Item *)0x3d23d70a; if (bVar3 != 0) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { fVar38 = 0.04; } else { fVar38 = 0.1; } *(float *)pTVar39 = (float)player->_numCoins * fVar38 + *(float *)pTVar39; } bVar3 = HasCollectible(player,0x28e,0); if (bVar3 != 0) { puVar16 = (undefined4 *)FUN_0042c810(); local_46c = (Entity_Player *)*puVar16; puVar16 = (undefined4 *)FUN_0042c810(); local_488 = (RNG *)*puVar16; puVar16 = (undefined4 *)FUN_0042c810(); local_470 = (ItemConfig_Item *)*puVar16; piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); iVar6 = *piVar15; piVar15 = (int *)FUN_0042c810(); *(float *)local_464 = (float)(int)((local_470->name)._buf + iVar5 + iVar6 + (int)((local_46c->_sprite)._filename._buf + (int)&((Vector *)((int)local_488 + -8))[-9].x + *piVar15)) * 0.6 + *(float *)local_464; pTVar39 = local_464; temporaryEffects = local_468; } if ((0 < player->_redStewBonusDuration) && (isEffectsDisabled == 0)) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { local_460 = (ItemConfig_Item *)0x3d656042; } *(float *)local_464 = (float)(player->_redStewBonusDuration / 10) * (float)local_460 + *(float *)local_464; pTVar39 = local_464; } bVar3 = HasCollectible(player,0x2cc,0); if (bVar3 != 0) { *(float *)local_464 = (float)((player->_keepersSackBonus / 3 + 2) / 3) * 0.5 + *(float *)local_464; pTVar39 = local_464; } local_460 = TemporaryEffects::GetNullEffect(temporaryEffects,0x7b); local_470 = TemporaryEffects::GetNullEffect(temporaryEffects,0x7c); local_488 = TemporaryEffects::GetNullEffect(temporaryEffects,0x81); pvVar13 = TemporaryEffects::GetNullEffect(temporaryEffects,0x82); if (local_460 == (void *)0x0) { fVar38 = player->_damage; } else { fVar38 = ((float)*(int *)((int)local_460 + 4) + (float)*(int *)((int)local_460 + 4)) / 3.0 + *(float *)pTVar39; *(float *)pTVar39 = fVar38; } if (local_470 != (void *)0x0) { fVar38 = fVar38 + ((float)*(int *)((int)local_470 + 8) + (float)*(int *)((int)local_470 + 8)) / 90.0; *(float *)pTVar39 = fVar38; } if (local_488 != (RNG *)0x0) { fVar38 = fVar38 + ((float)local_488->_shift1 * 6.0) / 3.0; *(float *)pTVar39 = fVar38; } if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 0.5 + fVar38; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2d9); if (((((bVar3 != 0) && (bVar3 = HasCollectible(player,0x3b,0), bVar3 != 0)) && (local_46c = (Entity_Player *)FUN_0042d040(), local_46c != (Entity_Player *)0x0)) && ((iVar5 = Entity::SubType((Entity *)local_46c), iVar5 != 8 && (iVar5 = Entity::SubType((Entity *)local_46c), iVar5 != 4)))) && ((iVar5 = Entity::SubType((Entity *)local_46c), iVar5 != 0xf && (uVar32 = Entity::SpawnerType((Entity *)local_46c), (uVar32 & 0x10) == 0)))) { *(float *)pTVar39 = *(float *)pTVar39 + 2.0; } bVar3 = HasTrinket(player,0x65,0); if ((bVar3 != 0) && (isActiveEmpty != false)) { iVar5 = GetTrinketMultiplier(player,0x65); *(float *)pTVar39 = (float)iVar5 * 1.5 + *(float *)pTVar39; } bVar3 = HasTrinket(player,100,0); if ((bVar3 != 0) && (isActiveFullyCharged != false)) { iVar5 = GetTrinketMultiplier(player,100); *(float *)pTVar39 = (float)iVar5 * 0.5 + *(float *)pTVar39; } if (player->_variant == 1) { iVar5 = player->_babySkin; if (iVar5 == 0xd) { fVar38 = *(float *)pTVar39 + 2.0; } else if (iVar5 == 0x17) { fVar38 = *(float *)pTVar39 + 1.0; } else { if (iVar5 != 0x36) goto LAB_00765c5f; fVar38 = *(float *)pTVar39 + 1.5; } *(float *)pTVar39 = fVar38; } LAB_00765c5f: pvVar13 = TemporaryEffects::GetCollectibleEffect(temporaryEffects,0x7a); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)(*(int *)((int)pvVar13 + 4) * *(int *)((int)pvVar13 + 4)) * 1.5 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetNullEffect(temporaryEffects,0x6e); if (pvVar13 == (void *)0x0) { fVar38 = player->_damage; } else { fVar38 = (float)(*(int *)((int)pvVar13 + 4) * *(int *)((int)pvVar13 + 4)) * 1.5 + *(float *)pTVar39; *(float *)pTVar39 = fVar38; } if (0 < player->_grantedCollectibleCountdown) { *(float *)pTVar39 = fVar38 + 1.0; } local_4cc = GetCollectibleNum(player,0x76,0); local_4cc = local_4cc + -1; local_4d0 = 0; iVar5 = GetCollectibleNum(player,0x279,0); local_470 = (ItemConfig_Item *)(float)iVar5; iVar6 = GetCollectibleNum(player,0x2c4,0); iVar8 = GetCollectibleNum(player,0x250,0); iVar9 = GetCollectibleNum(player,0x23c,0); iVar10 = GetCollectibleNum(player,0x213,0); iVar11 = GetCollectibleNum(player,0x159,0); iVar17 = GetCollectibleNum(player,0x148,0); iVar18 = GetCollectibleNum(player,0x103,0); iVar19 = GetCollectibleNum(player,0xd0,0); iVar20 = GetCollectibleNum(player,0xce,0); iVar21 = GetCollectibleNum(player,0xa5,0); numOddMushroomLarge = GetCollectibleNum(player,0x79,0); numMark = GetCollectibleNum(player,0x4f,0); numGrowthHormones = GetCollectibleNum(player,0x46,0); numPentagram = GetCollectibleNum(player,0x33,0); numSteven = GetCollectibleNum(player,0x32,0); piVar15 = (int *)std::max(); iVar5 = *piVar15; numSynthoilEffects = TemporaryEffects::GetCollectibleEffectNum(local_468,0x159); temporaryEffects = local_468; numDarkMatterEffects = TemporaryEffects::GetCollectibleEffectNum(local_468,0x103); numGuillotineEffects = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0xce); numOddMushroomEffects = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x79); numGrowthHormonesEffects = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x46); iVar22 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x38); local_460 = (ItemConfig_Item *) ((float)iVar22 * 3.0 + (float)(iVar6 + iVar8 + iVar9 + iVar10 + iVar11 + iVar17 + iVar18 + iVar19 + iVar20 + iVar21 + numOddMushroomLarge + numMark + numGrowthHormones + numPentagram + numSteven + iVar5 + numSynthoilEffects + numDarkMatterEffects + numGuillotineEffects + numOddMushroomEffects + numGrowthHormonesEffects)); iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x42); local_460 = (ItemConfig_Item *) ((float)*(int *)&player->field_0x1dc8 + (float)iVar5 * 1.5 + (float)local_460); iVar5 = GetCollectibleNum(player,0x2dc,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(player,0x2da,0); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.75 + (float)local_460); iVar5 = is_achievement_79_unlocked(player); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.75 + (float)local_460); bVar3 = HasCollectible(player,0x105,0); isProptosisEffect = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x105); iVar5 = GetCollectibleNum(player,0x29d,0); iVar6 = GetCollectibleNum(player,0x14b,0); iVar8 = GetCollectibleNum(player,0x133,0); iVar9 = GetCollectibleNum(player,0xc5,0); iVar10 = GetCollectibleNum(player,0x50,0); iVar11 = GetCollectibleNum(player,4,0); iVar17 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x2b4); local_460 = (ItemConfig_Item *) ((float)(int)(iVar17 + (uint)bVar3 + (uint)isProptosisEffect + iVar5 + iVar6 + iVar8 + iVar9 + iVar10 + iVar11) * 0.5 + (float)local_460); iVar5 = GetCollectibleNum(player,0x1cf,0); iVar6 = GetCollectibleNum(player,0x1bd,0); iVar8 = GetCollectibleNum(player,0xc9,0); iVar9 = GetCollectibleNum(player,0xc1,0); iVar10 = GetCollectibleNum(player,0xbd,0); iVar11 = GetCollectibleNum(player,0x8a,0); iVar17 = GetCollectibleNum(player,0x65,0); iVar18 = GetCollectibleNum(player,0x3e,0); iVar19 = GetCollectibleNum(player,0xc,0); iVar20 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0xc9); iVar21 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0xc); local_460 = (ItemConfig_Item *) ((float)(iVar21 + iVar5 + iVar6 + iVar8 + iVar9 + iVar10 + iVar11 + iVar17 + iVar18 + iVar19 + iVar20) * 0.3 + (float)local_460); iVar5 = GetCollectibleNum(player,0x167,0); iVar6 = GetCollectibleNum(player,0xed,0); iVar8 = GetCollectibleNum(player,0xe6,0); iVar9 = GetCollectibleNum(player,5,0); iVar10 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0xed); pTVar39 = local_464; *(float *)local_464 = (float)(iVar10 + iVar5 + iVar6 + iVar8 + iVar9) * 1.5 + (float)local_460 + (float)local_470 + (float)local_470 + *(float *)local_464; iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x36); if (0 < iVar5) { *(float *)pTVar39 = ((float)iVar5 / 23.0) * ((float)iVar5 / 23.0) * 20.0 + *(float *)pTVar39; } bVar3 = HasCollectible(player,0x2b6,0); if (bVar3 != 0) { *(float *)pTVar39 = (float)player->_brokenHearts * 0.25 + *(float *)pTVar39; } bVar3 = HasCollectible(player,0x3b,0); if (bVar3 != 0) { iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x246); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.2); iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x47); *(float *)pTVar39 = (float)iVar5 * 0.2 + (float)local_460 + *(float *)pTVar39; } iVar5 = Game::Challenge(g_game); if (iVar5 != 0) { iVar5 = Game::Challenge(g_game); challengeParams = Manager::GetChallengeParams(g_manager,iVar5); *(float *)pTVar39 = challengeParams->_addDamage + *(float *)pTVar39; } bVar3 = HasCollectible(player,0x78,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x78), bVar3 != 0)) { *(float *)pTVar39 = *(float *)pTVar39 * 0.9 - 0.4; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x53); if (bVar3 == 0) { fVar38 = player->_damage; } else { iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x53); fVar38 = (float)iVar5 + (float)iVar5 + *(float *)pTVar39; *(float *)pTVar39 = fVar38; } if (0 < player->_coopBabyBuffTimers[0]) { *(float *)pTVar39 = fVar38 + 2.0; } local_460 = TemporaryEffects::GetCollectibleEffect(temporaryEffects,0x19b); if (local_460 != (void *)0x0) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { local_4d8 = 0x40a00000; } else { local_4d8 = 0x42c80000; } local_4d4 = (float)*(int *)((int)local_460 + 4) * 0.5; pfVar12 = (float *)std::min(); *(float *)pTVar39 = *pfVar12 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetTrinketEffect(temporaryEffects,0x3a); if (pvVar13 != (void *)0x0) { local_4e0 = 0x40a00000; local_4dc = (float)*(int *)((int)pvVar13 + 4) * 0.5; pfVar12 = (float *)std::min(); *(float *)pTVar39 = *pfVar12 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetCollectibleEffect(temporaryEffects,0x7e); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 1.2 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetCollectibleEffect(temporaryEffects,0x22b); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 1.2 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetNullEffect(temporaryEffects,0x6f); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 0.25 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetNullEffect(temporaryEffects,0x31); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 0.5 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetNullEffect(temporaryEffects,0x30); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 0.35 + *(float *)pTVar39; } pvVar13 = TemporaryEffects::GetTrinketEffect(temporaryEffects,0x28); if (pvVar13 != (void *)0x0) { *(float *)pTVar39 = (float)*(int *)((int)pvVar13 + 4) * 1.8 + *(float *)pTVar39; } bVar3 = HasTrinket(player,0x50,0); if (bVar3 != 0) { iVar5 = GetCollectibleNum(player,0x28e,0); iVar6 = GetCollectibleNum(player,0x158,0); iVar8 = GetCollectibleNum(player,0x153,0); iVar9 = GetCollectibleNum(player,0x106,0); iVar10 = GetCollectibleNum(player,0x104,0); iVar11 = GetCollectibleNum(player,0xe6,0); iVar17 = GetCollectibleNum(player,0xd8,0); iVar18 = GetCollectibleNum(player,0xd7,0); iVar19 = GetCollectibleNum(player,0x50,0); iVar20 = GetCollectibleNum(player,0x4f,0); iVar21 = GetTrinketMultiplier(player,0x11); local_460 = (ItemConfig_Item *) ((float)iVar21 + (float)(iVar5 + iVar6 + iVar8 + iVar9 + iVar10 + iVar11 + iVar17 + iVar18 + iVar19 + iVar20)); iVar5 = GetTrinketMultiplier(player,0x16); local_460 = (ItemConfig_Item *)(((float)iVar5 + (float)local_460) * 0.5); iVar5 = GetTrinketMultiplier(player,0x50); *(float *)local_464 = (float)iVar5 * (float)local_460 + *(float *)local_464; pTVar39 = local_464; } bVar3 = HasCollectible(player,0x197,0); if (((bVar3 != 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x197), bVar3 != 0)) && (player->_purityState == 0)) { *(float *)pTVar39 = *(float *)pTVar39 + 4.0; } local_460 = (ItemConfig_Item *)0x40600000; Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { Game::GetField26614(g_game); piVar15 = (int *)EntityList::Size(); local_460 = *(ItemConfig_Item **)(*piVar15 + 0x4c); fVar36 = (float10)(*(code *)local_460)(); local_460 = (ItemConfig_Item *)(float)(fVar36 * (float10)3.5); } pTVar39 = local_464; local_4e8 = 0; local_4e4 = *(float *)local_464 * 1.2 + 1.0; pfVar12 = (float *)std::max(); fVar38 = *pfVar12; FUN_00431260(); *(float *)pTVar39 = fVar38 * (float)local_460; bVar3 = HasCollectible(player,0xa9,0); if (bVar3 != 0) { bVar3 = HasCollectible(player,2,0); if (((bVar3 == 0) && (bVar3 = HasCollectible(player,0x99,0), bVar3 == 0)) && ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,2), bVar3 == 0 && ((bVar3 = HasWeaponType(player,0xe), bVar3 == 0 && (bVar3 = HasCollectible(player,0xf5,0), bVar3 == 0)))))) { fVar38 = *(float *)pTVar39 + 4.0 + *(float *)pTVar39 + 4.0; } else { fVar38 = *(float *)pTVar39 + 5.0; } *(float *)pTVar39 = fVar38; } bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2); if (bVar3 == 0) { uVar32 = player->_playerType; if (uVar32 == 5) { bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x7a); if (bVar3 != 0) goto LAB_00766878; uVar32 = player->_playerType; } if (uVar32 == 0x1a) { bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x6e); if (bVar3 != 0) goto LAB_00766878; uVar32 = player->_playerType; } if (uVar32 < 0x29) { *(float *)pTVar39 = (*(float *)(&DAT_00b6bce8 + uVar32 * 4) + 1.0) * *(float *)pTVar39; } } else { *(float *)pTVar39 = *(float *)pTVar39 * 1.5; } LAB_00766878: if ((player->_variant == 1) && (player->_babySkin == 0x39)) { *(float *)pTVar39 = *(float *)pTVar39 * 1.5; } iVar5 = player->_playerType; if ((iVar5 == 9) || (iVar5 == 0x1e)) { fVar38 = player->_edenDamage + *(float *)pTVar39; *(float *)pTVar39 = fVar38; } else { fVar38 = player->_damage; } if (iVar5 == 0x13) { fVar38 = fVar38 - 0.75; LAB_007668df: *(float *)pTVar39 = fVar38; } else if (iVar5 == 0x14) { fVar38 = fVar38 + 0.25; goto LAB_007668df; } bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,100); if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 + 2.0; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x271); pEVar41 = player; if (bVar3 != 0) { *(float *)pTVar39 = *(float *)pTVar39 * 4.0; } if ((player->_playerType == 0x10) && (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x78), bVar3 != 0)) { pEVar41->_damage = (pEVar41->_damage + 2.0) * 3.0; } fVar38 = (float)(pEVar41->_potatoPeelerBandageCounter + pEVar41->_potatoPeelerCounter) * 0.2 + pEVar41->_damage; pEVar41->_damage = fVar38; if ((pEVar41->_hasCurseMistEffect == 0) && (pEVar41->_isCoopGhost == 0)) { iVar5 = pEVar41->_damageModifier; } else { iVar5 = 0; } fVar38 = (float)iVar5 + (float)local_40._0_4_ + fVar38; local_4ec = fVar38; pfVar12 = (float *)std::max(); pEVar41->_damage = *pfVar12; bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2c0); if (bVar3 != 0) { fVar38 = pEVar41->_damage + 3.0; pEVar41->_damage = fVar38; } FUN_00753870(); pEVar41->_damage = fVar38 + pEVar41->_damage; iVar5 = GetTrinketMultiplier(pEVar41,0x23); pEVar41->_damage = (float)iVar5 + (float)iVar5 + pEVar41->_damage; bVar3 = HasCollectible(pEVar41,0x201,0); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage + 0.1; } itemConfig = Isaac::GetItemConfig(); pIVar23 = Config::GetNullItem(itemConfig,0x29); bVar3 = TemporaryEffects::has_item_effect(temporaryEffects,pIVar23); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage + 7.0; } bVar3 = HasWeaponType(pEVar41,10); if ((bVar3 != 0) && (bVar3 = HasCollectible(pEVar41,0x72,0), bVar3 != 0)) { pEVar41->_damage = pEVar41->_damage + 4.0; } bVar3 = HasCollectible(pEVar41,0x19f,0); if ((bVar3 != 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x19f), bVar3 != 0)) { pEVar41->_damage = pEVar41->_damage + pEVar41->_damage; } bVar3 = HasCollectible(pEVar41,0xb6,0); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage * 2.3 + 1.0; } bVar3 = HasCollectible(pEVar41,0x3b,0); if ((bVar3 != 0) && (bVar3 = HasCollectible(pEVar41,0x290,0), bVar3 != 0)) { pEVar41->_damage = pEVar41->_damage * 1.4 + 1.0; } bVar3 = HasCollectible(pEVar41,0x23d,0); if ((bVar3 != 0) || (0 < pEVar41->_hallowedGroundCountdown)) { pEVar41->_damage = pEVar41->_damage * 1.2; } bVar3 = HasCollectible(pEVar41,0x1ed,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x1ed), bVar3 != 0)) { local_460 = (ItemConfig_Item *) (((pEVar41->_boneHearts * 2 - pEVar41->_redHearts) + pEVar41->_maxHearts) / 2); Game::GetField26614(g_game); cVar4 = FUN_00429550(); pIVar23 = local_460; if (cVar4 != '\0') { pIVar23 = (ItemConfig_Item *)((uint)local_460 >> 3); } fVar38 = (float)(int)pIVar23 + (float)(int)pIVar23; pow_wrapper(); pEVar41->_damage = fVar38 * 0.1 + pEVar41->_damage; } bVar3 = HasCollectible(pEVar41,0x9d,0); if ((bVar3 != 0) && (isEffectsDisabled == 0)) { bVar3 = HasCollectible(pEVar41,0x26b,0); if ((bVar3 == 0) || (pEVar41->_playerType != 6)) { fVar38 = 6.0; } else { fVar38 = 10.0; } fVar38 = Math::clamp(0.0,fVar38,(float)(int)pEVar41->_bloodLustCounter); pEVar41->_damage = fVar38 * 0.1 * fVar38 + fVar38 * 0.4 + pEVar41->_damage; } if ((((pEVar41->_playerType == 7) || (pEVar41->_playerType == 0x1c)) || (bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2), bVar3 != 0)) && (bVar3 = HasCollectible(pEVar41,0x76,0), bVar3 == 0)) { bVar3 = HasWeaponType(pEVar41,2); if ((bVar3 == 0) || (bVar3 = HasCollectible(pEVar41,0x149,0), bVar3 == 0)) { bVar3 = HasWeaponType(pEVar41,9); if (bVar3 == 0) goto LAB_00766d4e; fVar38 = pEVar41->_damage * 0.65; } else { fVar38 = pEVar41->_damage * 0.5; } pEVar41->_damage = fVar38; } LAB_00766d4e: bVar3 = HasWeaponType(pEVar41,2); if (bVar3 == 0) { bVar3 = HasWeaponType(pEVar41,9); if ((bVar3 != 0) && (bVar3 = HasCollectible(pEVar41,0x76,0), bVar3 != 0)) goto LAB_00766d97; } else { iVar5 = GetCollectibleNum(pEVar41,0x76,0); if (iVar5 < 2) { LAB_00766d97: bVar3 = HasCollectible(pEVar41,0x44,0); if (bVar3 == 0) goto LAB_00766dbe; fVar38 = pEVar41->_damage * 1.5; } else { fVar38 = pEVar41->_damage * 1.2; } pEVar41->_damage = fVar38; } LAB_00766dbe: bVar3 = HasCollectible(pEVar41,0x213,0); fVar38 = pEVar41->_damage; if (bVar3 != 0) { fVar38 = fVar38 * 1.5; pEVar41->_damage = fVar38; } pEVar41->_meleeDamage = fVar38; bVar3 = HasCollectible(pEVar41,0x95,0); if (bVar3 != 0) { bVar3 = HasWeaponType(pEVar41,1); if (((bVar3 == 0) && (bVar3 = HasWeaponType(pEVar41,7), bVar3 == 0)) && (bVar3 = HasWeaponType(pEVar41,0xe), bVar3 == 0)) { fVar38 = pEVar41->_damage + 2.0; } else { fVar38 = pEVar41->_damage + 40.0; } pEVar41->_damage = fVar38; pEVar41->_meleeDamage = pEVar41->_meleeDamage + 2.0; } bVar3 = HasCollectible(pEVar41,4,0); if ((((bVar3 != 0) || ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x22), bVar3 != 0 && (bVar3 = HasCollectible(pEVar41,7,0), bVar3 != 0)))) || (bVar3 = HasCollectible(pEVar41,0xc,0), bVar3 != 0)) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xc), bVar3 != 0)) { pEVar41->_damage = pEVar41->_damage * 1.5; pEVar41->_meleeDamage = pEVar41->_meleeDamage * 1.5; } bVar3 = HasCollectible(pEVar41,0x136,0); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage + pEVar41->_damage; pEVar41->_meleeDamage = pEVar41->_meleeDamage + pEVar41->_meleeDamage; } bVar3 = HasCollectible(pEVar41,0x231,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x14a,0); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage * 0.2; fVar38 = pEVar41->_meleeDamage * 0.2; goto LAB_00766f9a; } } else { pEVar41->_damage = pEVar41->_damage * 0.3; fVar38 = pEVar41->_meleeDamage * 0.3; LAB_00766f9a: pEVar41->_meleeDamage = fVar38; } bVar3 = HasCollectible(pEVar41,0xf5,0); if ((bVar3 != 0) || (pEVar41->_babySkin == 0x41)) { pEVar41->_damage = pEVar41->_damage * 0.8; pEVar41->_meleeDamage = pEVar41->_meleeDamage * 0.8; } bVar3 = HasCollectible(pEVar41,0x175,0); pfVar12 = &pEVar41->_damage; pfVar14 = &pEVar41->_meleeDamage; if (bVar3 == 0) { pEVar41->_deadEyeMisses = 0; pEVar41->_deadEyeCharges = 0; fVar38 = *pfVar12; fVar40 = *pfVar14; } else { fVar40 = (float)pEVar41->_deadEyeCharges * 0.125 + 1.0; fVar38 = fVar40 * *pfVar12; *pfVar12 = fVar38; fVar40 = fVar40 * *pfVar14; *pfVar14 = fVar40; } if (0 < pEVar41->_damageMultiplierStacks) { fVar40 = pow(1.5,(float)(int)pEVar41->_damageMultiplierStacks); fVar38 = fVar40 * pEVar41->_damage; fVar40 = fVar40 * pEVar41->_meleeDamage; } fVar40 = pEVar41->_d8DamageModifier * fVar40; fVar38 = pEVar41->_d8DamageModifier * fVar38; pEVar41->_damage = fVar38; pEVar41->_meleeDamage = fVar40; if (((float)local_484 != 0.0) && (3.5 < fVar38)) { pEVar41->_damage = (fVar38 - 3.5) * ((float)local_484 - 1.0) + fVar38; pEVar41->_meleeDamage = (fVar40 - 3.5) * ((float)local_484 - 1.0) + fVar40; } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,1); iVar5 = GetTrinketMultiplier(pEVar41,0x42); pEVar41->_damage = (float)iVar5 * 0.5 + pEVar41->_damage; if (pEVar41->_variant == 1) { pEVar24 = GetMainPlayer(pEVar41); cVar4 = CanShoot(pEVar24); if (cVar4 == '\0') { pEVar41->_damage = 3.5; } } if ((pEVar41->_variant == 0) && (iVar5 = Game::Challenge(g_game), iVar5 != 0)) { iVar5 = Game::Challenge(g_game); challengeParams = Manager::GetChallengeParams(g_manager,iVar5); if (challengeParams->_maxDamage != 0) { local_4f0 = 0x42c80000; pfVar12 = (float *)std::max(); pEVar41->_damage = *pfVar12; } } if (pEVar41->_variant == 1) { if ((pEVar41->_babySkin == 0x3b) && (pEVar24 = (Entity_Player *)__RTDynamicCast(), pEVar24 != (Entity_Player *)0x0)) { iVar5 = GetTrinketMultiplier(pEVar24,0xb4); pTVar39 = local_464; if (iVar5 == 2) { *(float *)local_464 = *(float *)local_464 * 0.75; } else { if (iVar5 != 3) goto LAB_00767233; *(float *)local_464 = *(float *)local_464 * 1.0; } } else { LAB_00767233: *(float *)local_464 = *(float *)local_464 * 0.5; pTVar39 = local_464; } } else { pTVar39 = (TemporaryEffects *)&pEVar41->_damage; } if (pEVar41->_isCoopGhost == 0) { bVar3 = IsHologram(pEVar41); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage * 0.25; } } else { *(float *)pTVar39 = *(float *)pTVar39 * 0.25; } bVar3 = Game::GetDebugFlag(g_game,3); if (bVar3 != 0) { pEVar41->_damage = pEVar41->_damage + 40.0; pEVar41->_meleeDamage = pEVar41->_meleeDamage + 40.0; } pfVar12 = (float *)std::max(); pEVar41->_damage = *pfVar12; pfVar12 = (float *)std::max(); game = g_game; pEVar41->_meleeDamage = *pfVar12; Game::GetField26614(game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { Game::GetField26614(g_game); piVar15 = (int *)EntityList::Size(); (**(code **)(*piVar15 + 0x68))(); } } uVar32 = pEVar41->_cacheFlags; if ((uVar32 & 4) != 0) { if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); local_460 = (ItemConfig_Item *)(float)(*piVar15 - iVar5); pEVar41 = player; } else { local_460 = (ItemConfig_Item *)0x0; } local_4f4 = GetCollectibleNum(pEVar41,0x23c,0); local_4f8 = 1; local_4fc = GetCollectibleNum(player,0x136,0); local_500 = 1; piVar15 = (int *)std::min(); iVar5 = *piVar15; iVar6 = GetCollectibleNum(player,0xb7,0); pEVar41 = player; iVar8 = GetCollectibleNum(player,0x156,0); iVar9 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x156); iVar10 = GetCollectibleNum(pEVar41,0x29d,0); pEVar41 = player; iVar11 = GetCollectibleNum(player,0x18d,0); iVar17 = GetCollectibleNum(pEVar41,0x155,0); iVar18 = GetCollectibleNum(pEVar41,0x153,0); iVar19 = GetCollectibleNum(pEVar41,0xc2,0); iVar20 = GetCollectibleNum(pEVar41,0xb0,0); local_488 = (RNG *)((float)(iVar20 + iVar10 + (((iVar6 - iVar5) - iVar8) - iVar9) + iVar11 + iVar17 + iVar18 + iVar19) * 0.16); iVar5 = GetCollectibleNum(pEVar41,0x234,0); iVar6 = GetCollectibleNum(pEVar41,0xff,0); iVar8 = GetCollectibleNum(pEVar41,0x8f,0); iVar9 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x8f); local_470 = (ItemConfig_Item *)((float)(iVar9 + iVar5 + iVar6 + iVar8) * 0.2); iVar5 = GetCollectibleNum(pEVar41,0xa5,0); local_464 = (TemporaryEffects *) ((float)iVar5 * 0.23 + 1.0 + (float)local_470 + (float)local_488 + (float)local_460 * 0.15); iVar5 = GetCollectibleNum(pEVar41,0xb6,0); local_464 = (TemporaryEffects *)((float)local_464 - (float)iVar5 * 0.25); iVar5 = GetCollectibleNum(pEVar41,0xd5,0); local_464 = (TemporaryEffects *)((float)local_464 - (float)iVar5 * 0.15); piVar15 = (int *)std::min(); local_464 = (TemporaryEffects *)((float)local_464 - (float)*piVar15 * 0.5); iVar5 = GetCollectibleNum(pEVar41,0x150,0); local_464 = (TemporaryEffects *)((float)local_464 - (float)iVar5 * 0.4); iVar5 = GetCollectibleNum(pEVar41,0x14b,0); local_464 = (TemporaryEffects *)((float)local_464 - (float)iVar5 * 0.3); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x19f); local_464 = (TemporaryEffects *)((float)local_464 - (float)iVar5 * 0.3); iVar5 = GetCollectibleNum(pEVar41,0x149,0); if ((pEVar41->_hasCurseMistEffect == 0) && (pEVar41->_isCoopGhost == 0)) { iVar6 = pEVar41->_shotSpeedModifier; } else { iVar6 = 0; } fVar38 = ((float)iVar6 + (float)puStack_34) * 0.2 + (float)iVar5 * 0.2 + (float)local_464; pEVar41->_shotspeed = fVar38; bVar3 = HasTrinket(pEVar41,0x65,0); if ((bVar3 != 0) && (isActiveEmpty != false)) { iVar5 = GetTrinketMultiplier(pEVar41,0x65); fVar38 = (float)iVar5 * 0.3 + pEVar41->_shotspeed; pEVar41->_shotspeed = fVar38; } bVar3 = HasTrinket(pEVar41,100,0); if ((bVar3 != 0) && (isActiveFullyCharged != false)) { iVar5 = GetTrinketMultiplier(pEVar41,100); fVar38 = (float)iVar5 * 0.1 + pEVar41->_shotspeed; pEVar41->_shotspeed = fVar38; } iVar5 = pEVar41->_playerType; if (iVar5 == 6) { fVar38 = pEVar41->_shotspeed + 0.31; LAB_007677a7: pEVar41->_shotspeed = fVar38; } else { if ((iVar5 == 9) || (iVar5 == 0x1e)) { fVar38 = pEVar41->_edenShotSpeed + pEVar41->_shotspeed; goto LAB_007677a7; } if (iVar5 == 0x13) { fVar38 = pEVar41->_shotspeed + 0.15; goto LAB_007677a7; } if (iVar5 == 0x14) { fVar38 = pEVar41->_shotspeed - 0.15; goto LAB_007677a7; } } FUN_007538b0(); fVar38 = fVar38 * 0.2 + pEVar41->_shotspeed; pEVar41->_shotspeed = fVar38; if (0 < pEVar41->_coopBabyBuffTimers[3]) { pEVar41->_shotspeed = fVar38 + 0.5; } bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar41->_temporaryeffects,0x1ba); if (bVar3 != 0) { pEVar41->_shotspeed = pEVar41->_shotspeed + 0.2; } itemConfig = Isaac::GetItemConfig(); pIVar23 = Config::GetNullItem(itemConfig,0x2a); bVar3 = TemporaryEffects::has_item_effect(&pEVar41->_temporaryeffects,pIVar23); if (bVar3 != 0) { pEVar41->_shotspeed = pEVar41->_shotspeed - 1.0; } iVar5 = GetTrinketMultiplier(pEVar41,0x1b); pEVar41->_shotspeed = (float)iVar5 * 0.5 + pEVar41->_shotspeed; iVar5 = GetCollectibleNum(pEVar41,0x22a,0); pEVar41->_shotspeed = (float)iVar5 * 0.2 + pEVar41->_shotspeed; bVar3 = HasCollectible(pEVar41,5,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar41->_temporaryeffects,5), bVar3 != 0)) { pEVar41->_shotspeed = pEVar41->_shotspeed * 1.6; } pfVar12 = &pEVar41->_shotspeed; bVar3 = HasCollectible(pEVar41,0x95,0); if (bVar3 == 0) { fVar38 = pEVar41->_shotspeed; } else { fVar38 = *pfVar12 * 0.8; *pfVar12 = fVar38; } if ((pEVar41->_variant == 1) && (pEVar41->_babySkin == 0x15)) { *pfVar12 = fVar38 * 0.5; } iVar5 = GetTrinketMultiplier(pEVar41,0x42); fVar38 = *pfVar12 - (float)iVar5 * 0.5; *pfVar12 = fVar38; if (((float)local_484 != 1.0) && (0.0 < fVar38 - 1.0)) { *pfVar12 = ((float)local_484 - 1.0) * (fVar38 - 1.0) + fVar38; } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,4); if ((pEVar41->_variant == 0) && (iVar5 = Game::Challenge(g_game), iVar5 != 0)) { iVar5 = Game::Challenge(g_game); challengeParams = Manager::GetChallengeParams(g_manager,iVar5); if (challengeParams->_minShotSpeed != 0) { local_504 = 0x3f800000; pfVar14 = (float *)std::min(); *pfVar12 = *pfVar14; } } iVar5 = get_seeded_variant(pEVar41); if (iVar5 != -1) { local_508 = 0x40400000; pfVar14 = (float *)std::max(); *pfVar12 = *pfVar14; } pfVar14 = (float *)std::max(); *pfVar12 = *pfVar14; uVar32 = pEVar41->_cacheFlags; temporaryEffects = local_468; } if ((uVar32 & 8) == 0) { temporaryEffects = local_468; pEVar41 = player; } else { pfVar12 = &pEVar41->_tearrange; *pfVar12 = 260.0; pEVar41->_tearheight = -23.75; pEVar41->_tearfallspeed = 0.0; pEVar41->_tearfallaccel = 0.0; iVar5 = pEVar41->_playerType; if ((((((iVar5 == 2) || (iVar5 == 8)) || (iVar5 == 7)) || ((iVar5 == 0x17 || (iVar5 == 0x18)))) || (iVar5 == 0x1d)) || (bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2), bVar3 != 0)) { fVar38 = *pfVar12 - 80.0; LAB_00767b03: *pfVar12 = fVar38; } else { iVar5 = player->_playerType; if ((iVar5 == 6) || (iVar5 == 0x1b)) { LAB_00767ac2: fVar38 = *pfVar12 - 60.0; goto LAB_00767b03; } if ((iVar5 == 9) || (iVar5 == 0x1e)) { fVar38 = player->_edenTearRange + *pfVar12; goto LAB_00767b03; } if (iVar5 == 0x13) goto LAB_00767ac2; if (iVar5 == 0x14) { fVar38 = *pfVar12 + 60.0; goto LAB_00767b03; } } if ((player->_hasCurseMistEffect == 0) && (player->_isCoopGhost == 0)) { local_460 = (ItemConfig_Item *)player->_tearRangeModifier; } else { local_460 = (ItemConfig_Item *)0x0; } if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); local_470 = (ItemConfig_Item *)((float)iVar5 * 0.5 - (float)*piVar15 * 0.4); } else { local_470 = (ItemConfig_Item *)0x0; } pEVar41 = player; iVar5 = GetCollectibleNum(player,0x47,0); iVar6 = GetCollectibleNum(pEVar41,0xc,0); iVar8 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x47); iVar9 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xc); local_460 = (ItemConfig_Item *) ((float)(iVar9 + (int)local_460 + iVar5 + iVar6 + iVar8) + fStack_38); iVar5 = GetCollectibleNum(pEVar41,0x1e,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x1f,0); local_460 = (ItemConfig_Item *)((float)iVar5 * 1.5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x18d,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x1d,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460 + (float)local_470); iVar5 = GetCollectibleNum(pEVar41,0x153,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x159,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x159); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0xe,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xe); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x172,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0xbd,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x1c7,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x163,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x293,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x29d,0); local_460 = (ItemConfig_Item *)(((float)iVar5 + (float)local_460) * 100.0); iVar5 = GetCollectibleNum(pEVar41,0x1ce,0); iVar6 = GetCollectibleNum(pEVar41,0x1c5,0); iVar8 = GetCollectibleNum(pEVar41,0xc5,0); iVar9 = GetCollectibleNum(pEVar41,0x79,0); iVar10 = GetCollectibleNum(pEVar41,0x6e,0); iVar11 = GetCollectibleNum(pEVar41,0x65,0); iVar17 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x79); local_46c = (Entity_Player *) ((float)(iVar17 + iVar5 + iVar6 + iVar8 + iVar9 + iVar10 + iVar11) * 60.0 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x150,0); local_46c = (Entity_Player *)((float)local_46c - (float)iVar5 * 60.0); iVar5 = GetCollectibleNum(pEVar41,0x171,0); local_460 = (ItemConfig_Item *)((float)iVar5 * 120.0 + (float)local_46c); iVar5 = GetCollectibleNum(pEVar41,0x18a,0); fVar38 = (float)iVar5 * 120.0 + (float)local_460 + pEVar41->_tearrange; pEVar41->_tearrange = fVar38; bVar3 = HasCollectible(pEVar41,0x23c,0); if (bVar3 != 0) { pEVar41->_tearheight = pEVar41->_tearheight - 8.0; fVar38 = pEVar41->_tearrange + 80.0; pEVar41->_tearrange = fVar38; } bVar3 = HasCollectible(pEVar41,0x252,0); if (bVar3 != 0) { fVar38 = pEVar41->_tearheight - 8.0; pEVar41->_tearheight = fVar38; } bVar3 = HasCollectible(pEVar41,0x256,0); temporaryEffects = &pEVar41->_temporaryeffects; if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2b0), bVar3 != 0)) { fVar38 = pEVar41->_tearheight * 0.4; pEVar41->_tearheight = fVar38; } bVar3 = HasCollectible(pEVar41,0x2cc,0); if (bVar3 != 0) { fVar38 = (float)((pEVar41->_keepersSackBonus / 3 + 1) / 3) * 10.0 + pEVar41->_tearrange; pEVar41->_tearrange = fVar38; } FUN_007538a0(); pEVar41->_tearrange = fVar38 * 60.0 + pEVar41->_tearrange; bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x271); pfVar12 = &pEVar41->_tearrange; if (bVar3 == 0) { fVar38 = pEVar41->_tearrange; } else { pEVar41->_tearfallaccel = 0.8; pEVar41->_tearheight = pEVar41->_tearheight - 80.0; fVar38 = *pfVar12 + 80.0; *pfVar12 = fVar38; } if (0 < pEVar41->_coopBabyBuffTimers[3]) { *pfVar12 = fVar38 + 80.0; } bVar3 = HasTrinket(pEVar41,0x65,0); if ((bVar3 != 0) && (isActiveEmpty != false)) { iVar5 = GetTrinketMultiplier(pEVar41,0x65); pEVar41->_tearrange = (float)iVar5 * 60.0 + pEVar41->_tearrange; } bVar3 = HasTrinket(pEVar41,100,0); if ((bVar3 != 0) && (isActiveFullyCharged != false)) { iVar5 = GetTrinketMultiplier(pEVar41,100); pEVar41->_tearrange = (float)iVar5 * 30.0 + pEVar41->_tearrange; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x1ba); if (bVar3 != 0) { pEVar41->_tearrange = pEVar41->_tearrange + 60.0; } itemConfig = Isaac::GetItemConfig(); pIVar23 = Config::GetNullItem(itemConfig,0x29); bVar3 = TemporaryEffects::has_item_effect(temporaryEffects,pIVar23); if (bVar3 != 0) { pEVar41->_tearheight = pEVar41->_tearheight - 30.0; pEVar41->_tearrange = pEVar41->_tearrange + 120.0; } bVar3 = HasCollectible(pEVar41,0x197,0); if (((bVar3 != 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x197), bVar3 != 0)) && (pEVar41->_purityState == 3)) { pEVar41->_tearrange = pEVar41->_tearrange + 120.0; } bVar3 = HasCollectible(pEVar41,0x95,0); if ((bVar3 == 0) && (bVar3 = HasCollectible(pEVar41,0x213,0), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0xe0,0); if (bVar3 != 0) goto LAB_00768248; } else { bVar3 = HasCollectible(pEVar41,0xe5,0); if (bVar3 == 0) { pEVar41->_tearfallaccel = 0.8; LAB_00768248: pEVar41->_tearrange = pEVar41->_tearrange * 0.8; } } bVar3 = HasCollectible(pEVar41,0xe9,0); if (bVar3 != 0) { pEVar41->_tearrange = pEVar41->_tearrange + 260.0; pEVar41->_tearfallaccel = pEVar41->_tearfallaccel * 0.01; } bVar3 = HasCollectible(pEVar41,0x133,0); if ((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x133)) { pEVar41->_tearrange = pEVar41->_tearrange + 30.0; } bVar3 = HasCollectible(pEVar41,0xd6,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xd6), bVar3 != 0)) { pEVar41->_tearrange = pEVar41->_tearrange + 60.0; } bVar3 = HasTrinket(pEVar41,0x1a,0); if ((bVar3 != 0) && (bVar3 = HasWeaponType(pEVar41,1), bVar3 != 0)) { iVar5 = GetTrinketMultiplier(pEVar41,0x1a); pEVar41->_tearrange = (float)iVar5 * 60.0 + pEVar41->_tearrange; } bVar3 = HasTrinket(pEVar41,0x60,0); if (bVar3 != 0) { iVar5 = GetTrinketMultiplier(pEVar41,0x60); pEVar41->_tearrange = (float)iVar5 * 60.0 + pEVar41->_tearrange; } iVar5 = Game::Challenge(g_game); if (iVar5 != 0) { iVar5 = Game::Challenge(g_game); challengeParams = Manager::GetChallengeParams(g_manager,iVar5); if (challengeParams->_bigRange != 0) { pEVar41->_tearrange = pEVar41->_tearrange + 400.0; } } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xc0); if (bVar3 != 0) { pEVar41->_tearheight = pEVar41->_tearheight + pEVar41->_tearheight; pEVar41->_tearfallspeed = pEVar41->_tearfallspeed * 0.5; pEVar41->_tearrange = pEVar41->_tearrange + 120.0; } bVar3 = HasTrinket(pEVar41,0x41,0); if (bVar3 != 0) { iVar5 = GetTrinketMultiplier(pEVar41,0x41); pEVar41->_tearheight = ((float)iVar5 + (float)iVar5) * pEVar41->_tearheight; iVar5 = GetTrinketMultiplier(pEVar41,0x41); pEVar41->_tearfallspeed = (float)iVar5 * 0.5 * pEVar41->_tearfallspeed; iVar5 = GetTrinketMultiplier(pEVar41,0x41); pEVar41->_tearrange = (float)iVar5 * 120.0 + pEVar41->_tearrange; } bVar3 = HasCollectible(pEVar41,6,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,6), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0x1b8,0); if (bVar3 != 0) { pEVar41->_tearheight = pEVar41->_tearheight + 18.0; } } else { pEVar41->_tearheight = pEVar41->_tearheight + 18.0; local_50c = 0x43480000; local_510 = pEVar41->_tearrange - 60.0; pfVar12 = (float *)std::max(); local_514 = *pfVar12 * 0.8; pfVar12 = (float *)std::min(); pEVar41->_tearrange = *pfVar12; } bVar3 = HasCollectible(pEVar41,5,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,5), bVar3 != 0)) { pEVar41->_tearrange = pEVar41->_tearrange + pEVar41->_tearrange + 60.0; } iVar5 = get_seeded_variant(pEVar41); pfVar12 = &pEVar41->_tearrange; if (iVar5 == 5) { fVar38 = *pfVar12 + 200.0; } else { fVar38 = pEVar41->_tearrange; } fVar38 = fVar38 * pEVar41->_d8RangeModifier; *pfVar12 = fVar38; if (((float)local_484 != 1.0) && (260.0 < fVar38)) { *pfVar12 = (fVar38 - 260.0) * ((float)local_484 - 1.0) + fVar38; } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,8); if (pEVar41->_tearrange <= 40.0 && pEVar41->_tearrange != 40.0) { pEVar41->_tearrange = 40.0; } if (0.0 < pEVar41->_tearfallaccel) { pEVar41->_tearfallaccel = pEVar41->_shotspeed * pEVar41->_shotspeed * pEVar41->_tearfallaccel; } } uVar32 = pEVar41->_cacheFlags; if ((uVar32 & 0x10) != 0) { _DAT_00c5c3d4 = pEVar41->_edenSpeed; local_480 = (Entity_Player *)0x0; if ((uint)pEVar41->_playerType < 0x29) { local_480 = *(Entity_Player **)(&DAT_00c5c3b0 + pEVar41->_playerType * 4); } _DAT_00c5c428 = _DAT_00c5c3d4; bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2); if (bVar3 != 0) { local_480 = DAT_00c5c3cc; } if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.5 - (float)*piVar15 * 0.4); temporaryEffects = local_468; pEVar41 = player; } else { local_460 = (ItemConfig_Item *)0x0; } iVar5 = is_achievement_79_unlocked(pEVar41); if (iVar5 < 1) { local_46c = (Entity_Player *)GetCollectibleNum(pEVar41,0x8f,0); iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x8f); local_46c = (Entity_Player *)((int)local_46c + iVar5); } else { local_46c = (Entity_Player *)0x0; } iVar5 = GetCollectibleNum(pEVar41,0xe,0); local_5b8 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xe); local_5b8 = iVar5 + local_5b8; local_5b4 = 1; iVar5 = GetCollectibleNum(pEVar41,0xd,0); local_5b0 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xd); local_5b0 = iVar5 + local_5b0; local_5ac = 1; iVar5 = GetCollectibleNum(pEVar41,0xe8,0); iVar6 = GetCollectibleNum(pEVar41,0x77,0); iVar8 = GetCollectibleNum(pEVar41,0x1c,0); iVar9 = GetCollectibleNum(pEVar41,0x1b,0); iVar10 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x42); local_460 = (ItemConfig_Item *) ((float)(iVar10 + iVar5 + iVar6 + iVar8 + iVar9) + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x154,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0xc,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0xc); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x47,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x47); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x65,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x7a); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x78,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x78); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460 + (float)(int)local_46c); iVar5 = GetCollectibleNum(pEVar41,0x52,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x23b,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetNullEffectNum(&pEVar41->_temporaryeffects,0x6e); local_470 = (ItemConfig_Item *)(((float)iVar5 + (float)local_460) * 0.3); iVar5 = GetCollectibleNum(pEVar41,0x46,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x46); local_460 = (ItemConfig_Item *)((float)(iVar5 + iVar6) * 0.5); iVar5 = GetCollectibleNum(pEVar41,0x24e,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x2c0); local_460 = (ItemConfig_Item *)(((float)iVar5 + (float)local_460) * 0.4); piVar15 = (int *)std::min(); iVar5 = *piVar15; piVar15 = (int *)std::min(); iVar8 = GetCollectibleNum(player,0x5a,0); iVar6 = *piVar15; iVar9 = GetCollectibleNum(player,0x81,0); iVar10 = GetCollectibleNum(player,0x79,0); iVar11 = TemporaryEffects::GetCollectibleEffectNum(local_468,0x79); iVar17 = GetCollectibleNum(player,0x29d,0); iVar18 = GetCollectibleNum(player,0xbd,0); iVar19 = GetCollectibleNum(player,0x4f,0); iVar20 = TemporaryEffects::GetCollectibleEffectNum(local_468,0x2b0); pEVar41 = player; local_460 = (ItemConfig_Item *) ((float)(iVar20 + ((((iVar6 - iVar8) - iVar9) - iVar10) - iVar11) + iVar17 + iVar18 + iVar19) * 0.2 + (float)iVar5 * 0.3 + (float)local_480 + 1.0 + (float)local_460 + (float)local_470); iVar5 = GetCollectibleNum(player,0x1bd,0); if ((pEVar41->_hasCurseMistEffect == 0) && (pEVar41->_isCoopGhost == 0)) { iVar6 = pEVar41->_speedModifier; } else { iVar6 = 0; } pEVar41->_movespeed = ((float)iVar6 + (float)local_30) * 0.2 + (float)iVar5 * 0.1 + (float)local_460; if ((0x28 < (uint)pEVar41->_playerType) || (0.0 <= *(float *)(&DAT_00c5c3b0 + pEVar41->_playerType * 4))) { bVar3 = TemporaryEffects::HasNullEffect(&pEVar41->_temporaryeffects,0x3e); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasNullEffect(&pEVar41->_temporaryeffects,0x41), bVar3 != 0)) { pEVar41->_movespeed = pEVar41->_movespeed - 0.1; } } temporaryEffects = &pEVar41->_temporaryeffects; iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x36); if (0 < iVar5) { pEVar41->_movespeed = (float)iVar5 * 0.05 + pEVar41->_movespeed; } iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x246); local_460 = (ItemConfig_Item *)((float)iVar5 * 0.03); iVar5 = TemporaryEffects::GetNullEffectNum(temporaryEffects,0x47); fVar38 = pEVar41->_movespeed - ((float)iVar5 * 0.06 + (float)local_460); pEVar41->_movespeed = fVar38; bVar3 = HasCollectible(pEVar41,0x252,0); if (bVar3 != 0) { fVar38 = Math::lerp(-0.3,0.2,pEVar41->_jupiterCharge,0); fVar38 = fVar38 + pEVar41->_movespeed; pEVar41->_movespeed = fVar38; } bVar3 = HasCollectible(pEVar41,0x2b7,0); if ((bVar3 != 0) && (isEffectsDisabled == 0)) { fVar40 = Math::clamp(0.0,6.0,(float)(int)pEVar41->_bloodLustCounter); fVar38 = fVar40 * 0.05; pEVar41->_movespeed = fVar40 * 0.02 * fVar40 + fVar38 + pEVar41->_movespeed; } bVar3 = HasCollectible(pEVar41,0x2cc,0); if (bVar3 != 0) { fVar38 = (float)(pEVar41->_keepersSackBonus / 9) * 0.03 + pEVar41->_movespeed; pEVar41->_movespeed = fVar38; } FUN_00753890(); pEVar41->_movespeed = fVar38 * 0.2 + pEVar41->_movespeed; bVar3 = HasTrinket(pEVar41,0x65,0); if ((bVar3 != 0) && (isActiveEmpty != false)) { iVar5 = GetTrinketMultiplier(pEVar41,0x65); pEVar41->_movespeed = (float)iVar5 * 0.5 + pEVar41->_movespeed; } bVar3 = HasTrinket(pEVar41,100,0); if ((bVar3 != 0) && (isActiveFullyCharged != false)) { iVar5 = GetTrinketMultiplier(pEVar41,100); pEVar41->_movespeed = (float)iVar5 * 0.25 + pEVar41->_movespeed; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x4d); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x12a), bVar3 != 0)) { pEVar41->_movespeed = pEVar41->_movespeed + 0.28; } bVar3 = HasTrinket(pEVar41,0x25,0); if (bVar3 == 0) { fVar38 = pEVar41->_movespeed; } else { iVar5 = GetTrinketMultiplier(pEVar41,0x25); fVar38 = (float)iVar5 * 0.15 + pEVar41->_movespeed; pEVar41->_movespeed = fVar38; } if (0 < pEVar41->_coopBabyBuffTimers[2]) { pEVar41->_movespeed = fVar38 + 0.15; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x53); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed - 0.18; } bVar3 = HasCollectible(pEVar41,0xe6,0); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed + 0.2; } bVar3 = HasPlayerForm(pEVar41,5); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed + 0.15; } bVar3 = HasPlayerForm(pEVar41,0xe); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed + 0.2; } bVar3 = HasCollectible(pEVar41,0x82,0); if ((bVar3 != 0) || (bVar3 = HasCollectible(pEVar41,0xb5,0), bVar3 != 0)) { local_5a8 = 0x3fc00000; pfVar12 = (float *)std::max(); pEVar41->_movespeed = *pfVar12; } bVar3 = HasCollectible(pEVar41,299,0); if ((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 299)) { pEVar41->_movespeed = pEVar41->_movespeed - 0.3; bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,299); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_taurusSpeedBonus + pEVar41->_movespeed; } } bVar3 = HasCollectible(pEVar41,300,0); if ((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 300)) { pEVar41->_movespeed = pEVar41->_movespeed + 0.25; } bVar3 = HasCollectible(pEVar41,0x132,0); if ((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x132)) { pEVar41->_movespeed = pEVar41->_movespeed + 0.2; } bVar3 = HasCollectible(pEVar41,0x133,0); if ((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x133)) { pEVar41->_movespeed = pEVar41->_movespeed + 0.1; } bVar3 = HasCollectible(pEVar41,0x13a,0); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed - 0.4; } bVar3 = HasCollectible(pEVar41,0x197,0); if (((bVar3 != 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x197), bVar3 != 0)) && (pEVar41->_purityState == 2)) { pEVar41->_movespeed = pEVar41->_movespeed + 0.5; } itemConfig = Isaac::GetItemConfig(); pIVar23 = Config::GetNullItem(itemConfig,0x2a); bVar3 = TemporaryEffects::has_item_effect(temporaryEffects,pIVar23); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed + 0.5; } bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x32); if (bVar3 != 0) { pEVar41->_movespeed = pEVar41->_movespeed + 0.5; } bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2c1); if (bVar3 == 0) { bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x1f1); if (bVar3 != 0) { fVar38 = pEVar41->_movespeed + 0.5; goto LAB_00769200; } } else { fVar38 = pEVar41->_movespeed + 1.0; LAB_00769200: pEVar41->_movespeed = fVar38; } pfVar12 = &pEVar41->_movespeed; fVar38 = pEVar41->_d8SpeedModifier * *pfVar12; *pfVar12 = fVar38; if (((float)local_484 != 1.0) && (1.0 < fVar38)) { *pfVar12 = (fVar38 - 1.0) * ((float)local_484 - 1.0) + fVar38; } FUN_00421780(); iVar5 = EntityList::Size(); if (iVar5 == 0x2b) { pEVar41->_movespeed = pEVar41->_movespeed - 1.0; } Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { Game::GetField26614(g_game); piVar15 = (int *)EntityList::Size(); (**(code **)(*piVar15 + 100))(); } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x10); uVar32 = pEVar41->_cacheFlags; } if ((uVar32 & 0x20) == 0) { local_464 = &pEVar41->_temporaryeffects; } else { pEVar41->_tearFlags = g_tearFlagsNone; bVar3 = HasCollectible(pEVar41,0x23c,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x23c), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x254,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x254), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x250,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x250), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,0x90,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x23a,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xb6,0); if (((((bVar3 != 0) || (bVar3 = HasCollectible(pEVar41,3,0), bVar3 != 0)) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xc0), bVar3 != 0)) || ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,3), bVar3 != 0 || (bVar3 = HasCollectible(pEVar41,0x14b,0), bVar3 != 0)))) || (((pEVar41->_variant == 1 && (pEVar41->_babySkin == 4)) || (0 < pEVar41->_hallowedGroundCountdown)))) { BitSet128::operator__(); } local_468 = (TemporaryEffects *)&pEVar41->_tearFlags; local_464 = local_468; bVar3 = HasCollectible(pEVar41,0x84,0); if (bVar3 != 0) { BitSet128::operator__(); local_468 = (TemporaryEffects *)&pEVar41->_tearFlags; } bVar3 = HasCollectible(pEVar41,0x20c,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x105,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x105), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xb9,0); if ((((((bVar3 != 0) || (bVar3 = HasCollectible(pEVar41,0x73,0), bVar3 != 0)) || (bVar3 = HasCollectible(pEVar41,0x9f,0), bVar3 != 0)) || (((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x73), bVar3 != 0 || (bVar3 = HasWeaponType(pEVar41,8), bVar3 != 0)) || ((bVar3 = HasCollectible(pEVar41,0x150,0), bVar3 != 0 || ((bVar3 = HasCollectible(pEVar41,0x17b,0), bVar3 != 0 || (bVar3 = HasCollectible(pEVar41,0x166,0), bVar3 != 0)))))))) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x166), bVar3 != 0)) || (((((iVar5 = pEVar41->_playerType, iVar5 == 10 || (iVar5 == 0x1f)) || (iVar5 == 0x27)) || (((pEVar41->_variant == 1 && (pEVar41->_babySkin == 0x3b)) || ((iVar5 == 0x11 || ((pEVar41->_variant == 1 && (pEVar41->_babySkin == 0x3a)))))))) || ((pEVar41->_isCoopGhost != 0 || ((((iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x2a5), iVar5 == 1 || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x42), bVar3 != 0)) || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x65), bVar3 != 0)) || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x70), bVar3 != 0)))))))) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x30,0); if (((((bVar3 != 0) || (bVar3 = HasCollectible(pEVar41,0xed,0), bVar3 != 0)) || ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xed), bVar3 != 0 || ((bVar3 = HasCollectible(pEVar41,0x132,0), bVar3 != 0 || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x132)))))) || (bVar3 = HasWeaponType(pEVar41,8), bVar3 != 0)) || (bVar3 = HasCollectible(pEVar41,0x150,0), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xa9,0); if (bVar3 != 0) { BitSet128::operator__(); local_468 = local_464; } bVar3 = HasCollectible(pEVar41,0x131,0); if ((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x131)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x68,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,5,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,5), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,10,0); if (bVar3 != 0) { BitSet128::operator_or(&local_688,(BitSet128 *)&DAT_00c34870,&g_tearFlagSpectral); BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,0x1a,0); if (bVar3 != 0) { BitSet128::operator_or(&local_698,(BitSet128 *)&DAT_00c348c0,&g_tearFlagSpectral); BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x95,0); if ((bVar3 != 0) && ((bVar3 = HasWeaponType(pEVar41,8), bVar3 == 0 || (bVar3 = HasCollectible(pEVar41,0x21c,0), bVar3 != 0)))) { BitSet128::operator_or(&local_6a8,&g_tearFlagExplosive,&g_tearFlagPoison); BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xe9,0); if (bVar3 != 0) { BitSet128::operator_or(&local_6b8,(BitSet128 *)&DAT_00c34b60,&g_tearFlagSpectral); BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xde,0); if ((((bVar3 != 0) && (bVar3 = HasWeaponType(pEVar41,8), bVar3 == 0)) && (bVar3 = HasWeaponType(pEVar41,7), bVar3 == 0)) && ((bVar3 = HasWeaponType(pEVar41,1), bVar3 == 0 || ((bVar3 = HasCollectible(pEVar41,0x13c,0), bVar3 == 0 && (bVar3 = HasCollectible(pEVar41,0x45,0), bVar3 == 0)))))) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xe0,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xdd,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x13b,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,9,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x135,0); if (((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x135)) || ((bVar3 = HasCollectible(pEVar41,0x167,0), bVar3 != 0 || ((bVar3 = HasTrinket(pEVar41,0x4d,0), bVar3 != 0 || (bVar3 = HasCollectible(pEVar41,0x250,0), bVar3 != 0)))))) { BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,0xb,0); if (bVar3 != 0) { BitSet128::operator_or(&local_6c8,(BitSet128 *)&DAT_00c348a0,&g_tearFlagSpectral); BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,0xc,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasTrinket(pEVar41,0x60,0); if (bVar3 != 0) { BitSet128::operator_or(&local_658,(BitSet128 *)&DAT_00c348e0,&g_tearFlagSpectral); BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x14b,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x171,0); if (bVar3 != 0) { BitSet128::operator_or(&local_668,(BitSet128 *)&DAT_00c348d0,&g_tearFlagSpectral); BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x18d,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x215,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x101,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x101), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x13d,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x13d), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x103,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x103), bVar3 != 0)) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x1c5,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x1ce,0); if (bVar3 != 0) { BitSet128::operator_or(&local_678,(BitSet128 *)&DAT_00c34b50,(BitSet128 *)&DAT_00c34940); BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x1ee,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x214,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x211,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0x21c,0); if (bVar3 != 0) { BitSet128::operator__(); } bVar3 = HasCollectible(pEVar41,0xd5,0); if (bVar3 == 0) { local_464 = temporaryEffects; bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x78); if (bVar3 != 0) goto LAB_00769c23; } else { LAB_00769c23: BitSet128::operator__(); local_464 = &pEVar41->_temporaryeffects; } bVar3 = HasCollectible(pEVar41,0x1fa,0); if (bVar3 != 0) { BitSet128::operator__(); } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x20); uVar32 = pEVar41->_cacheFlags; } cVar4 = (char)uVar32; if ((uVar32 & 0x40) != 0) { Color::Color(local_400); Color::operator_assign((Color *)&pEVar41->_laserColor,other); bVar3 = HasCollectible(pEVar41,0x1ad,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x1ad), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0x95,0); if (bVar3 != 0) { fVar42 = 1.0; fVar40 = 3.0; fVar38 = 1.8; goto LAB_0076a3bd; } bVar3 = HasCollectible(pEVar41,0xb6,0); if ((bVar3 != 0) || (0 < pEVar41->_hallowedGroundCountdown)) { fVar42 = 6.0; fVar40 = 6.0; fVar38 = 5.0; goto LAB_0076a3bd; } bVar3 = HasCollectible(pEVar41,0x254,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x23c,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x23c), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0x101,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x67,0); if ((((bVar3 == 0) && (bVar3 = HasCollectible(pEVar41,0x13d,0), bVar3 == 0)) && (bVar3 = HasCollectible(pEVar41,0x131,0), bVar3 == 0)) && ((iVar5 = GetZodiacEffect(pEVar41), iVar5 != 0x131 && (bVar3 = HasCollectible(pEVar41,0x1cb,0), bVar3 == 0)))) { bVar3 = HasCollectible(pEVar41,0x68,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x59,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x13b,0); if (((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x13b), bVar3 == 0)) && ((bVar3 = HasCollectible(pEVar41,0x191,0), bVar3 == 0 && (bVar3 = HasCollectible(pEVar41,0x269,0), bVar3 == 0)))) { bVar3 = HasCollectible(pEVar41,0x26a,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x229,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x1ee,0); if (bVar3 != 0) { fVar40 = 4.9; fVar38 = 3.8; goto LAB_00769f94; } bVar3 = HasCollectible(pEVar41,6,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,6), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,3,0); if (((bVar3 == 0) && ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,3), bVar3 == 0 && (bVar3 = TemporaryEffects::HasCollectibleEffect (temporaryEffects,0xc0), bVar3 == 0)))) && ((pEVar41->_variant != 1 || (pEVar41->_babySkin != 4)))) { bVar3 = HasCollectible(pEVar41,200,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x18e,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect (temporaryEffects,0x18e), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0x45,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x231,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x14a,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x84,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x103,0); if (bVar3 != 0) { Color::SetTint((Color *)&pEVar41->_laserColor,3.0,3.0,3.0, 1.0); Color::SetOffset((Color *)&pEVar41->_laserColor,-0.5,-0.5, -0.5); goto LAB_0076a232; } if (pEVar41->_playerType != 0x19) goto LAB_0076a3c8; Color::SetTint((Color *)&pEVar41->_laserColor,2.0,2.0,2.0, 1.0); fVar42 = 0.1; fVar40 = 0.3; fVar38 = 0.7; } else { Color::SetTint((Color *)&pEVar41->_laserColor,3.0,3.0,3.0, 1.0); Color::SetOffset((Color *)&pEVar41->_laserColor,-0.5,-0.5, -0.5); fVar42 = 1.2; fVar40 = 1.2; fVar38 = 1.3; } } else { fVar42 = 4.2; fVar40 = 5.0; fVar38 = 5.6; } } else { fVar42 = 3.8; fVar40 = 5.2; fVar38 = 5.6; } } else { fVar42 = 1.7; fVar40 = 1.7; fVar38 = 3.0; } } else { fVar42 = 4.0; fVar40 = 1.2; fVar38 = 1.2; } } else { fVar42 = 3.5; fVar40 = 1.0; fVar38 = 4.0; } } else { fVar42 = 3.5; fVar40 = 1.0; fVar38 = 3.0; } } else { fVar42 = 1.0; fVar40 = 4.9; fVar38 = 5.0; } } else { fVar42 = 4.0; fVar40 = 2.0; fVar38 = 2.0; } } else { fVar42 = 0.0; fVar40 = 1.0; fVar38 = 5.0; } } else { LAB_0076a232: fVar42 = 1.0; fVar40 = 1.0; fVar38 = 1.0; } } else { fVar42 = 5.0; fVar40 = 5.2; fVar38 = 5.2; } } else { fVar42 = 0.4; fVar40 = 1.5; fVar38 = 3.0; } } else { fVar42 = 1.0; fVar40 = 4.0; fVar38 = 1.8; } } else { fVar42 = 1.0; fVar40 = 3.0; fVar38 = 5.0; } } else { fVar42 = 3.0; fVar40 = 0.5; fVar38 = 3.0; } goto LAB_0076a3bd; } fVar40 = 4.4; fVar38 = 4.0; LAB_00769f94: Color::SetColorize((Color *)&pEVar41->_laserColor,fVar38,fVar40,6.0,1.0); Color::SetOffset((Color *)&pEVar41->_laserColor,0.1,0.1,0.1); } else { fVar42 = 1.0; fVar40 = 4.0; fVar38 = 6.0; LAB_0076a3bd: Color::SetColorize((Color *)&pEVar41->_laserColor,fVar38,fVar40,fVar42,1.0); } LAB_0076a3c8: Color::Color(&local_3a8); Color::operator_assign((Color *)&pEVar41->_tearColor,other_00); Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { pEVar25 = (Entity_Familiar *)Game::GetPlayerManager(g_game); Entity_Familiar::GetPlayerSlot(pEVar25); Color::Color(local_37c); Color::operator_assign((Color *)&pEVar41->_tearColor,other_01); } bVar3 = HasCollectible(pEVar41,0x13d,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x13d), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0x101,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x101), bVar3 != 0)) { Color::SetColorize((Color *)&pEVar41->_tearColor,1.8,0.9,0.3,1.0); fVar42 = 0.0; fVar40 = 0.0; fVar38 = 0.3; goto LAB_0076aab9; } bVar3 = HasCollectible(pEVar41,0x103,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x103), bVar3 == 0)) { bVar3 = HasCollectible(pEVar41,0x95,0); if ((bVar3 == 0) || (bVar3 = HasWeaponType(pEVar41,5), bVar3 != 0)) { bVar3 = HasCollectible(pEVar41,0xb6,0); if ((bVar3 == 0) && (pEVar41->_hallowedGroundCountdown < 1)) { bVar3 = HasCollectible(pEVar41,0x23c,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x23c), bVar3 != 0)) { fVar40 = 0.25; fVar38 = 0.0; goto LAB_0076a9c3; } bVar3 = HasCollectible(pEVar41,0x84,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x68,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x45,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,6,0); if ((bVar3 == 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,6), bVar3 == 0 )) { bVar3 = HasCollectible(pEVar41,3,0); if (((bVar3 == 0) && ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,3), bVar3 == 0 && (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0xc0), bVar3 == 0)))) && ((pEVar41->_variant != 1 || (pEVar41->_babySkin != 4)))) { bVar3 = HasCollectible(pEVar41,0x136,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0xdd,0); if (bVar3 != 0) { Color::SetTint((Color *)&pEVar41->_tearColor,1.0,1.0,0.8,1.0); fVar42 = 0.1; fVar40 = 0.1; fVar38 = 0.1; goto LAB_0076aab9; } bVar3 = HasCollectible(pEVar41,0x150,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x231,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar41,0x14a,0); if (bVar3 != 0) goto LAB_0076a9da; bVar3 = HasCollectible(pEVar41,0x18e,0); if (((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect (temporaryEffects,0x18e), bVar3 != 0)) && (bVar3 = HasWeaponType(pEVar41,4), bVar3 != 0)) { fVar40 = 1.0; fVar38 = 0.5; goto LAB_0076a81e; } bVar3 = HasWeaponType(pEVar41,10); if ((bVar3 == 0) || (bVar3 = HasCollectible(pEVar41,0x213,0), bVar3 == 0)) { if ((pEVar41->_playerType == 0x19) && (bVar3 = HasCollectible(pEVar41,0x2a6,0), bVar3 == 0)) { Color::SetTint((Color *)&pEVar41->_tearColor,1.5,1.5,1.5,1.0); Color::SetColorize((Color *)&pEVar41->_tearColor,0.7,0.6,0.5,1.0); fVar42 = -0.4; fVar40 = -0.45; fVar38 = -0.4; goto LAB_0076aab9; } } else { Color::SetTint((Color *)&pEVar41->_tearColor,0.92,0.05,0.03,1.0); } } else { Color::SetTint((Color *)&pEVar41->_tearColor,1.8,1.7,1.0,1.0); } goto LAB_0076aac4; } tintAlpha = 0.9; fVar42 = 0.1; fVar40 = 0.25; fVar38 = 0.5; } else { tintAlpha = 1.0; fVar42 = 0.2; fVar40 = 0.2; fVar38 = 0.2; } Color::SetTint((Color *)&pEVar41->_tearColor,fVar38,fVar40,fVar42,tintAlpha); FUN_00683010(); } else { Color::SetTint((Color *)&pEVar41->_tearColor,0.4,0.15,0.38,1.0); FUN_00683010(); } } else { Color::SetTint((Color *)&pEVar41->_tearColor,1.0,1.0,0.0,1.0); FUN_00683010(); } } else { Color::SetTint((Color *)&pEVar41->_tearColor,0.33,0.18,0.18,1.0); FUN_00683010(); } } else { Color::SetTint((Color *)&pEVar41->_tearColor,0.9,0.3,0.08,1.0); } } else { Color::SetTint((Color *)&pEVar41->_tearColor,0.2,0.09,0.065,1.0); } } else { LAB_0076a9da: Color::SetTint((Color *)&pEVar41->_tearColor,1.5,2.0,2.0,1.0); } } else { fVar40 = 0.4; fVar38 = 0.9; LAB_0076a81e: Color::SetTint((Color *)&pEVar41->_tearColor,0.5,fVar38,fVar40,1.0); } } else { fVar40 = 0.3; fVar38 = 0.3; LAB_0076a9c3: Color::SetColorize((Color *)&pEVar41->_tearColor,0.3,fVar38,fVar40,1.0); } } else { Color::SetColorize((Color *)&pEVar41->_tearColor,0.2,1.0,0.2,1.0); fVar42 = 0.0; fVar40 = 0.2; fVar38 = 0.0; LAB_0076aab9: Color::SetOffset((Color *)&pEVar41->_tearColor,fVar38,fVar40,fVar42); } LAB_0076aac4: bVar3 = HasCollectible(pEVar41,0x73,0); if ((((((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x73), bVar3 != 0)) || ((iVar5 = pEVar41->_playerType, iVar5 == 10 || ((iVar5 == 0x1f || (iVar5 == 0x27)))))) || ((pEVar41->_variant == 1 && (pEVar41->_babySkin == 0x3b)))) || (((((bVar3 = HasCollectible(pEVar41,0x9f,0), bVar3 != 0 || (bVar3 = HasCollectible(pEVar41,0xb9,0), bVar3 != 0)) || (pEVar41->_playerType == 0x11)) || ((pEVar41->_variant == 1 && (pEVar41->_babySkin == 0x3a)))) || (pEVar41->_isCoopGhost != 0)))) || (((iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x2a5), iVar5 == 1 || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x42), bVar3 != 0)) || ((bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x65), bVar3 != 0 || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x70), bVar3 != 0)))))) { color = (ColorMod *)Color::Color(); Color::__mul((Color *)&pEVar41->_tearColor,color); color = (ColorMod *)Color::Color(); Color::__mul((Color *)&pEVar41->_laserColor,color); } bVar3 = IsHologram(pEVar41); if (bVar3 != 0) { Font::SetLineHeightModifier((Font *)&pEVar41->_tearColor,0.2); Font::SetLineHeightModifier((Font *)&pEVar41->_laserColor,0.2); } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x40); cVar4 = (char)pEVar41->_cacheFlags; } if (cVar4 < '\0') { local_47b = pEVar41->_canFly; iVar5 = GetCollectibleNum(pEVar41,0xb9,0); iVar6 = GetCollectibleNum(pEVar41,0xb8,0); iVar8 = GetCollectibleNum(pEVar41,0xb5,0); iVar9 = GetCollectibleNum(pEVar41,0xb3,0); iVar10 = GetCollectibleNum(pEVar41,0x9f,0); iVar11 = GetCollectibleNum(pEVar41,0x82,0); iVar17 = GetCollectibleNum(pEVar41,0x52,0); iVar18 = GetCollectibleNum(pEVar41,0x14,0); iVar19 = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x14); if ((((iVar19 + iVar5 + iVar6 + iVar8 + iVar9 + iVar10 + iVar11 + iVar17 + iVar18 < 1) && (bVar3 = HasPlayerForm(pEVar41,0), bVar3 == 0)) && (bVar3 = HasPlayerForm(pEVar41,1), bVar3 == 0)) && (bVar3 = HasPlayerForm(pEVar41,8), bVar3 == 0)) { bVar3 = HasPlayerForm(pEVar41,3); temporaryEffects = &pEVar41->_temporaryeffects; if (((((((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x21), bVar3 != 0)) || ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x14), bVar3 != 0 || ((pEVar41->_variant == 1 || (iVar5 = pEVar41->_playerType, iVar5 == 10)))))) || (iVar5 == 0x1f)) || (((iVar5 == 0x27 || (iVar5 == 0x28)) || (iVar5 == 7)))) || ((iVar5 == 0x11 || (bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x199), bVar3 != 0)))) || ((((bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0x76), bVar3 != 0 || ((bVar3 = HasPlayerForm(pEVar41,0xe), bVar3 != 0 || (iVar5 = TemporaryEffects::GetCollectibleEffectNum(temporaryEffects,0x2a5), iVar5 == 1)))) || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x42), bVar3 != 0)) || ((((((bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x43), bVar3 != 0 || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,100), bVar3 != 0)) || (bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x65), bVar3 != 0)) || ((bVar3 = TemporaryEffects::HasNullEffect(temporaryEffects,0x70), bVar3 != 0 || (bVar3 = TemporaryEffects::HasTrinketEffect(temporaryEffects,0xa2), bVar3 != 0)))) || ((bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x2ca), bVar3 != 0 && (pEVar41->_playerType == 0x23)))) || ((bVar3 = HasCollectible(pEVar41,0x283,0), bVar3 != 0 || (bVar3 = HasCollectible(pEVar41,0x279,0), bVar3 != 0)))))))) goto LAB_0076ae8d; iVar5 = 5; bVar3 = 0; } else { LAB_0076ae8d: iVar5 = 3; bVar3 = 1; } pEVar41->_canFly = bVar3; pEVar41->_entityGridCollisionClass = iVar5; if (((local_47b != 0) && (bVar3 == 0)) && (cVar4 = FUN_007d1810(), cVar4 != '\0')) { pEVar41->_canFly = 1; pEVar41->_entityGridCollisionClass = 3; bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar41->_temporaryeffects,0x21); if (bVar3 == 0) { TemporaryEffects::AddCollectibleEffect(&pEVar41->_temporaryeffects,0x21,1,1); } } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x80); pEVar41->_entityGridCollisionClass = (uint)(pEVar41->_canFly == 0) * 2 + 3; if (pEVar41->_canFly != local_47b) { UpdateCostumes(pEVar41); } } if ((((pEVar41->_cacheFlags & 0x200U) != 0) && (pEVar41->_variant == 0)) && (cVar4 = FUN_00417390(), cVar4 != '\0')) { itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,8); local_468 = (TemporaryEffects *)&pEVar41->_collectibleRNGs; pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(player,8,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,8); pEVar41 = player; CheckFamiliar(player,1,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x71); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x71,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x71); pEVar41 = player; CheckFamiliar(player,2,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x58); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x58,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x58); pEVar41 = player; CheckFamiliar(player,3,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,99); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,99,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,99); pEVar41 = player; CheckFamiliar(player,4,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,100); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,100,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,100); pEVar41 = player; CheckFamiliar(player,5,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x5f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x5f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x5f); pEVar41 = player; CheckFamiliar(player,6,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x43); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x43,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x43); pEVar41 = player; CheckFamiliar(player,7,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xbc); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xbc,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xbc); pEVar41 = player; CheckFamiliar(player,8,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xa3); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xa3,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xa3); pEVar41 = player; CheckFamiliar(player,9,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xa7); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xa7,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xa7); pEVar41 = player; CheckFamiliar(player,10,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xae); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xae,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xae); pEVar41 = player; CheckFamiliar(player,0xb,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x83); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x83,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x83); pEVar41 = player; CheckFamiliar(player,0x14,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x5e); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x5e,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x5e); pEVar41 = player; CheckFamiliar(player,0x15,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x60); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x60,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x60); pEVar41 = player; CheckFamiliar(player,0x16,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x62); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x62,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x62); pEVar41 = player; CheckFamiliar(player,0x17,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x80); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x80,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x80); pEVar41 = player; CheckFamiliar(player,0x1e,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x39); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x39,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x39); pEVar41 = player; CheckFamiliar(player,0x1f,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x70); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x70,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x70); pEVar41 = player; CheckFamiliar(player,0x20,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x9b); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x9b,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x9b); pEVar41 = player; CheckFamiliar(player,0x11,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xaa); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xaa,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xaa); pEVar41 = player; CheckFamiliar(player,0x10,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xb2); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xb2,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xb2); pEVar41 = player; CheckFamiliar(player,0x19,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xb); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xb,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xb); pEVar41 = player; CheckFamiliar(player,0x29,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xbb); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xbb,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xbb); pEVar41 = player; CheckFamiliar(player,0x2a,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xac); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xac,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xac); pEVar41 = player; CheckFamiliar(player,0x23,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x108); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x108,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x108); pEVar41 = player; CheckFamiliar(player,0x32,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x10b); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x10b,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x10b); pEVar41 = player; CheckFamiliar(player,0x35,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0xce); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0xce,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xce); pEVar41 = player; CheckFamiliar(player,0x44,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x109); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x109,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x109); pEVar41 = player; CheckFamiliar(player,0x33,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x10a); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x10a,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x10a); pEVar41 = player; CheckFamiliar(player,0x34,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x10c); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x10c,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x10c); pEVar41 = player; CheckFamiliar(player,0x36,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x141); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x141,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x141); pEVar41 = player; CheckFamiliar(player,0x4b,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x10f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x10f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x10f); pEVar41 = player; CheckFamiliar(player,0x39,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x10e); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x10e,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x10e); pEVar41 = player; CheckFamiliar(player,0x38,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x13f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x13f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x13f); pEVar41 = player; CheckFamiliar(player,0x4c,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x140); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x140,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x140); pEVar41 = player; CheckFamiliar(player,0x4d,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x117); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x117,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x117); iVar8 = TemporaryEffects::GetNullEffectNum(local_464,0x6b); pEVar41 = player; CheckFamiliar(player,0x41,iVar8 + iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x10d); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x10d,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x10d); pEVar41 = player; CheckFamiliar(player,0x37,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x110); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x110,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x110); pEVar41 = player; CheckFamiliar(player,0x3a,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x111); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x111,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x111); pEVar41 = player; CheckFamiliar(player,0x3b,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x118); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x118,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x118); pEVar41 = player; CheckFamiliar(player,0x42,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x119); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x119,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x119); pEVar41 = player; CheckFamiliar(player,0x43,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x142); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x142,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x142); CheckFamiliar(player,0x4a,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x114); pRVar26 = (RNG *)FUN_005cbd00(); local_5a4 = GetCollectibleNum(player,0x114,0); local_5a0 = 1; puVar27 = (uint *)std::min(); pEVar41 = player; CheckFamiliar(player,0x3e,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x13e); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x13e,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x13e); pEVar41 = player; CheckFamiliar(player,0x4f,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x115); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x115,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x115); pEVar41 = player; CheckFamiliar(player,0x3f,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x113); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x113,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x113); pEVar41 = player; CheckFamiliar(player,0x3d,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x168); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x168,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x168); pEVar41 = player; CheckFamiliar(player,0x50,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x169); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x169,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x169); pEVar41 = player; CheckFamiliar(player,0x51,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x16a); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x16a,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x16a); pEVar41 = player; CheckFamiliar(player,0x52,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x16b); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x16b,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x16b); pEVar41 = player; CheckFamiliar(player,0x53,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x16c); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x16c,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x16c); pEVar41 = player; CheckFamiliar(player,0x54,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x16d); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x16d,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x16d); pEVar41 = player; CheckFamiliar(player,0x55,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x174); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x174,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x174); pEVar41 = player; CheckFamiliar(player,0x56,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x180); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x180,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x180); pEVar41 = player; CheckFamiliar(player,0x57,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x181); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x181,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x181); pEVar41 = player; CheckFamiliar(player,0x58,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x186); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x186,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x186); iVar8 = TemporaryEffects::GetNullEffectNum(local_464,0x43); pEVar41 = player; CheckFamiliar(player,0x5c,iVar8 + iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x183); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x183,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x183); pEVar41 = player; CheckFamiliar(player,0x59,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1a1); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1a1,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1a1); pEVar41 = player; CheckFamiliar(player,0x60,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x185); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x185,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x185); pEVar41 = player; CheckFamiliar(player,0x5b,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x195); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x195,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x195); pEVar41 = player; CheckFamiliar(player,0x5d,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x193); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x193,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x193); pEVar41 = player; CheckFamiliar(player,0x5e,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x194); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x194,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x194); pEVar41 = player; CheckFamiliar(player,0x5f,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1b3); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1b3,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1b3); pEVar41 = player; CheckFamiliar(player,0x61,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1aa); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1aa,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1aa); pEVar41 = player; CheckFamiliar(player,0x62,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1ae); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1ae,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1ae); pEVar41 = player; CheckFamiliar(player,99,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1af); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1af,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1af); pEVar41 = player; CheckFamiliar(player,0x65,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d9); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d9,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d9); pEVar41 = player; CheckFamiliar(player,0x68,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d5); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d5,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d5); pEVar41 = player; CheckFamiliar(player,0x69,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d4); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d4,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d4); pEVar41 = player; CheckFamiliar(player,0x6a,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d6); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d6,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d6); pEVar41 = player; CheckFamiliar(player,0x6b,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d7); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d7,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d7); pEVar41 = player; CheckFamiliar(player,0x6c,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d8); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d8,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d8); pEVar41 = player; CheckFamiliar(player,0x6d,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1d3); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1d3,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1d3); pEVar41 = player; CheckFamiliar(player,0x6e,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1ec); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1ec,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1ec); pEVar41 = player; CheckFamiliar(player,0x6f,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1eb); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1eb,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1eb); pEVar41 = player; CheckFamiliar(player,0x70,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,500); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,500,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,500); pEVar41 = player; CheckFamiliar(player,0x72,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1fd); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1fd,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1fd); CheckFamiliar(player,0x74,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x1fc); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = GetCollectibleNum(player,0x1fc,0); pEVar41 = player; CheckFamiliar(player,0x75,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x1ff); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x1ff,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1ff); pEVar41 = player; CheckFamiliar(player,0x76,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x206); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x206,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x206); pEVar41 = player; CheckFamiliar(player,0x77,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x20e); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x20e,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x20e); pEVar41 = player; CheckFamiliar(player,0x7a,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x210); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x210,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x210); pEVar41 = player; CheckFamiliar(player,0x7b,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x21b); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x21b,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x21b); pEVar41 = player; CheckFamiliar(player,0x7c,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x219); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x219,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x219); pEVar41 = player; CheckFamiliar(player,0x7d,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x21e); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x21e,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x21e); pEVar41 = player; CheckFamiliar(player,0x7e,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x220); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x220,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x220); pEVar41 = player; CheckFamiliar(player,0x7f,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x21f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x21f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x21f); pEVar41 = player; CheckFamiliar(player,0x81,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x224); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x224,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x224); CheckFamiliar(player,0x82,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x1b1); pRVar26 = (RNG *)FUN_005cbd00(); local_59c = GetCollectibleNum(player,0x1b1,0); local_598 = 1; puVar27 = (uint *)std::min(); pEVar41 = player; CheckFamiliar(player,0x83,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x28f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x28f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x28f); pEVar41 = player; CheckFamiliar(player,0xe2,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x289); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x289,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x289); pEVar41 = player; CheckFamiliar(player,0xe1,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x23f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x23f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x23f); pEVar41 = player; CheckFamiliar(player,200,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x25f); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x25f,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x25f); pEVar41 = player; CheckFamiliar(player,0xd0,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x260); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x260,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x260); pEVar41 = player; CheckFamiliar(player,0xd1,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x285); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x285,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x285); pEVar41 = player; CheckFamiliar(player,0xd8,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x275); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x275,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x275); CheckFamiliar(player,0xda,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x239); pRVar26 = (RNG *)FUN_005cbd00(); local_594 = GetCollectibleNum(player,0x239,0); local_578 = 1; puVar27 = (uint *)std::min(); CheckFamiliar(player,0xcb,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x237); pRVar26 = (RNG *)FUN_005cbd00(); local_590 = GetCollectibleNum(player,0x237,0); local_58c = 1; puVar27 = (uint *)std::min(); CheckFamiliar(player,0xdd,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x27b); pRVar26 = (RNG *)FUN_005cbd00(); local_588 = GetCollectibleNum(player,0x27b,0); local_57c = 1; puVar27 = (uint *)std::min(); pEVar41 = player; CheckFamiliar(player,0xde,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x245); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x245,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x245); CheckFamiliar(player,0xcc,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x264); pRVar26 = (RNG *)FUN_005cbd00(); local_574 = GetCollectibleNum(player,0x264,0); local_570 = 1; puVar27 = (uint *)std::min(); pEVar41 = player; CheckFamiliar(player,0xd3,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x267); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x267,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x267); pEVar41 = player; CheckFamiliar(player,0xd4,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x2a7); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x2a7,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x2a7); pEVar41 = player; CheckFamiliar(player,0xe6,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x2a9); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x2a9,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x2a9); pEVar41 = player; CheckFamiliar(player,0xe8,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x2aa); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x2aa,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x2aa); pEVar41 = player; CheckFamiliar(player,0xe9,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x28c); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x28c,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x28c); pEVar41 = player; CheckFamiliar(player,0xef,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x2ba); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x2ba,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x2ba); CheckFamiliar(player,0xeb,(iVar5 + iVar6) * 2,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x28b); pRVar26 = (RNG *)FUN_005cbd00(); local_56c = GetCollectibleNum(player,0x28b,0); local_568 = 1; puVar27 = (uint *)std::min(); pEVar41 = player; CheckFamiliar(player,0xec,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetTrinket(itemConfig,0xba); local_470 = (ItemConfig_Item *)&pEVar41->_trinketRNGs; pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = GetTrinketMultiplier(player,0xba); pEVar41 = player; CheckFamiliar(player,0xe7,uVar32,pRVar26,pIVar23,0); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x235); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x235,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x235); pEVar41 = player; CheckFamiliar(player,0xf1,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x2b9); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x2b9,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x2b9); CheckFamiliar(player,0xf2,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x2bf); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = TemporaryEffects::GetNullEffectNum(local_464,0x83); pEVar41 = player; CheckFamiliar(player,0xf4,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x20d); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(pEVar41,0x79,(int)pEVar41->_numLeprosy,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x1b4); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = GetCollectibleNum(player,0x1b4,0); pEVar41 = player; CheckFamiliar(player,100,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,10); local_488 = (RNG *)FUN_005cbd00(); if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); local_580 = *piVar15; } else { local_580 = 0; } iVar5 = GetCollectibleNum(pEVar41,10,0); local_518 = 10; local_580 = local_580 + iVar5 * 2; iVar5 = TemporaryEffects::GetNullEffectNum(local_464,0x6b); piVar15 = (int *)std::min(); CheckFamiliar(pEVar41,0x21,*piVar15 + iVar5 * -2,local_488,local_460,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x51); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = GetCollectibleNum(player,0x51,0); pEVar41 = player; CheckFamiliar(player,0x28,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x75); local_460 = (ItemConfig_Item *)FUN_005cbd00(); bVar3 = TemporaryEffects::HasCollectibleEffect(local_464,0x75); if ((bVar3 == 0) && (((bVar3 = HasCollectible(pEVar41,0x75,0), bVar3 == 0 || (pEVar41->_playerType != 5)) || (bVar3 = HasCollectible(pEVar41,0x26b,0), bVar3 == 0)))) { uVar32 = 0; } else { uVar32 = 1; } CheckFamiliar(pEVar41,0xe,uVar32,(RNG *)local_460,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x112); pRVar26 = (RNG *)FUN_005cbd00(); bVar3 = TemporaryEffects::HasCollectibleEffect(local_464,0x112); pEVar41 = player; CheckFamiliar(player,0x3c,(uint)(bVar3 != 0),pRVar26,pIVar23,-1); iVar5 = GetCollectibleNum(pEVar41,0x49,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x49); uVar32 = pEVar41->_potatoPeelerCounter + iVar6 + iVar5; local_460 = (ItemConfig_Item *)((int)(uVar32 + ((int)uVar32 >> 0x1f & 3U)) >> 2); uVar32 = uVar32 & 0x80000003; if ((int)uVar32 < 0) { uVar32 = (uVar32 - 1 | 0xfffffffc) + 1; } itemConfig = Isaac::GetItemConfig(); collectibleItem = ItemConfig::GetCollectible(itemConfig,0x49); iVar5 = -1; pIVar23 = collectibleItem; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(player,0x2c,(uint)(uVar32 == 1),pRVar26,pIVar23,iVar5); iVar5 = -1; pIVar23 = collectibleItem; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(player,0x2d,(uint)(uVar32 == 2),pRVar26,pIVar23,iVar5); iVar5 = -1; pIVar23 = collectibleItem; pRVar26 = (RNG *)FUN_005cbd00(); pEVar41 = player; CheckFamiliar(player,0x2e,(uint)(uVar32 == 3),pRVar26,pIVar23,iVar5); iVar5 = -1; pRVar26 = (RNG *)FUN_005cbd00(); pIVar23 = local_460; CheckFamiliar(pEVar41,0x2f,(uint)local_460,pRVar26,collectibleItem,iVar5); if (0 < (int)pIVar23) { persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentGameData,0x90); } iVar5 = GetCollectibleNum(pEVar41,0xcf,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xcf); uVar32 = pEVar41->_potatoPeelerBandageCounter + iVar6 + iVar5; local_460 = (ItemConfig_Item *)((int)(uVar32 + ((int)uVar32 >> 0x1f & 3U)) >> 2); uVar32 = uVar32 & 0x80000003; if ((int)uVar32 < 0) { uVar32 = (uVar32 - 1 | 0xfffffffc) + 1; } itemConfig = Isaac::GetItemConfig(); collectibleItem = ItemConfig::GetCollectible(itemConfig,0xcf); iVar5 = -1; pIVar23 = collectibleItem; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(player,0x45,(uint)(uVar32 == 1),pRVar26,pIVar23,iVar5); iVar5 = -1; pIVar23 = collectibleItem; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(player,0x46,(uint)(uVar32 == 2),pRVar26,pIVar23,iVar5); iVar5 = -1; pIVar23 = collectibleItem; pRVar26 = (RNG *)FUN_005cbd00(); pEVar41 = player; CheckFamiliar(player,0x47,(uint)(uVar32 == 3),pRVar26,pIVar23,iVar5); iVar5 = -1; pRVar26 = (RNG *)FUN_005cbd00(); pIVar23 = local_460; CheckFamiliar(pEVar41,0x48,(uint)local_460,pRVar26,collectibleItem,iVar5); if (0 < (int)pIVar23) { persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentGameData,0x13); } uVar30 = 0x23; uVar32 = EntityPtr::Ref(); RNG::game_constructor(&local_21c,uVar32,uVar30); local_8 = (void *)0x1; itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x6b); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x6b); CheckFamiliar(player,0x30,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x145); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x145); CheckFamiliar(player,0x4e,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x1f8); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x1f8); CheckFamiliar(player,0x73,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x204); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x204); pEVar41 = player; CheckFamiliar(player,0x78,uVar32,pRVar26,pIVar23,-1); local_488 = (RNG *)Game::GetNumPlayers(g_game); local_460 = (ItemConfig_Item *)0x0; if (local_488 != (RNG *)0x0) { puVar33 = auStack_1bb; do { local_46c = Game::GetPlayer(g_game,(uint)local_460); iVar5 = Entity::Variant((Entity *)local_46c); if (iVar5 == 0) { iVar5 = GetCollectibleNum(local_46c,0xee,0); puVar33[-5] = (char)iVar5; iVar5 = GetCollectibleNum(local_46c,0xef,0); puVar33[-4] = (char)iVar5; puVar33[-3] = 0; iVar5 = GetCollectibleNum(local_46c,0x272,0); puVar33[-2] = (char)iVar5; iVar5 = GetCollectibleNum(local_46c,0x273,0); puVar33[-1] = (char)iVar5; *puVar33 = 0; } else { *(undefined2 *)(puVar33 + -4) = 0; puVar33[-5] = 0; *(undefined2 *)(puVar33 + -1) = 0; puVar33[-2] = 0; } puVar33 = puVar33 + 6; local_460 = (ItemConfig_Item *)((int)&local_460->type + 1); } while (local_460 < local_488); pcVar34 = local_1c0; local_484 = local_488; pRVar26 = local_488; do { local_46c = (Entity_Player *)&local_1bc; for (local_460 = (ItemConfig_Item *)0x0; ((pEVar41 = player, *pcVar34 != '\0' || (pcVar34[3] != '\0')) && (local_460 < pRVar26)); local_460 = (ItemConfig_Item *)((int)&local_460->type + 1)) { pcVar29 = (char *)((int)&local_46c[-1]._replacedPlayer + 1); pcVar28 = (char *)FUN_007dd3a0(); cVar4 = *pcVar28; *pcVar34 = *pcVar34 - cVar4; *pcVar29 = *pcVar29 - cVar4; pcVar34[2] = pcVar34[2] + cVar4; pcVar29 = (char *)FUN_007dd3a0(); cVar4 = *pcVar29; pcVar34[3] = pcVar34[3] - cVar4; *(char *)local_46c = *(char *)local_46c - cVar4; pcVar34[5] = pcVar34[5] + cVar4; local_46c = (Entity_Player *)&local_46c->field_0x6; pRVar26 = local_488; } pcVar34 = pcVar34 + 6; local_484 = (RNG *)((int)&local_484[-1]._shift3 + 3); } while (local_484 != (RNG *)0x0); local_484 = (RNG *)abStack_1be; local_460 = (ItemConfig_Item *)0x0; do { pRVar26 = local_484; local_480 = Game::GetPlayer(g_game,(uint)local_460); iVar5 = Entity::Variant((Entity *)local_480); if (iVar5 == 0) { itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0xee); local_46c = (Entity_Player *)&local_480->_collectibleRNGs; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(local_480,0x1a,(uint)*(byte *)((int)local_484 + -2),pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0xef); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(local_480,0x1b,(uint)*(byte *)((int)local_484 + -1),pRVar26,pIVar23,-1); rng = (RNG *)FUN_005cbd00(); pRVar26 = local_484; CheckFamiliar(local_480,0x1c,(uint)*(byte *)local_484,rng,(ItemConfig_Item *)0x0,-1); if (*(byte *)pRVar26 != 0) { persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentGameData,0x3a); persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentGameData,0x172); } itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x272); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(local_480,0xd5,(uint)*(byte *)((int)local_484 + 1),pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x273); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(local_480,0xd6,(uint)*(byte *)((int)local_484 + 2),pRVar26,pIVar23,-1); rng = (RNG *)FUN_005cbd00(); pRVar26 = local_484; CheckFamiliar(local_480,0xdf,(uint)*(byte *)((int)local_484 + 3),rng, (ItemConfig_Item *)0x0,-1); } local_484 = (RNG *)((int)pRVar26 + 6); local_460 = (ItemConfig_Item *)((int)&local_460->type + 1); } while (local_460 < local_488); } bVar3 = HasCollectible(pEVar41,0x184,0); if (((bVar3 == 0) || (bVar3 = HasCollectible(pEVar41,0x116,0), bVar3 == 0)) || (bVar3 = HasCollectible(pEVar41,0x90,0), bVar3 == 0)) { iVar5 = -1; pIVar23 = (ItemConfig_Item *)0x0; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(pEVar41,0x66,0,pRVar26,pIVar23,iVar5); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x184); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(player,0x184,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x184); pEVar41 = player; CheckFamiliar(player,0x5a,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x116); pRVar26 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x116,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x116); pEVar41 = player; CheckFamiliar(player,0x40,iVar5 + iVar6,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x90); local_488 = (RNG *)FUN_005cbd00(); iVar5 = GetCollectibleNum(pEVar41,0x90,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x90); uVar32 = iVar5 + iVar6; pRVar26 = local_488; } else { bVar3 = Game::GetStateFlag(g_game,0x25); if (bVar3 == 0) { Game::SetStateFlag(); this = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(this,0x26,0,(Entity_Player *)0x0); } iVar5 = -1; pIVar23 = (ItemConfig_Item *)0x0; pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(pEVar41,0x66,1,pRVar26,pIVar23,iVar5); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x184); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(pEVar41,0x5a,0,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x116); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(pEVar41,0x40,0,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x90); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = 0; } CheckFamiliar(pEVar41,0x18,uVar32,pRVar26,local_460,-1); itemConfig = Isaac::GetItemConfig(); local_460 = ItemConfig::GetCollectible(itemConfig,0x207); iVar5 = GetCollectibleNum(pEVar41,0x207,0); local_51c = TemporaryEffects::GetCollectibleEffectNum(local_464,0x207); local_51c = iVar5 + local_51c; local_520 = 0; piVar15 = (int *)std::max(); local_488 = (RNG *)0x0; pEVar24 = (Entity_Player *)*piVar15; local_46c = pEVar24; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&familiarList,3,-1,-1,0,0); local_8 = (undefined1 *)CONCAT31(local_8._1_3_,2); iVar5 = EntityList::Size(); if (iVar5 != 0) { uVar32 = 0; do { std::vector::operator_index(); piVar15 = (int *)__RTDynamicCast(); cVar4 = FUN_005b18e0(); if ((cVar4 != '\0') && (cVar4 = FUN_0060d130(), cVar4 == '\0')) { if ((int)local_488 < (int)local_46c) { local_488 = (RNG *)((int)&local_488->_seed + 1); FUN_005b1910(); } else { (**(code **)(*piVar15 + 0x28))(); } } uVar32 = uVar32 + 1; uVar30 = EntityList::Size(); } while (uVar32 < uVar30); pEVar24 = local_46c; pEVar41 = player; } if ((int)local_488 < (int)pEVar24) { local_46c = (Entity_Player *)((int)pEVar24 - (int)local_488); local_488 = (RNG *)&pEVar41->_pos; do { pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = RNG::Next(pRVar26); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar7 = MusicManager::RandomVector(&local_640); local_524 = 20.0; pVVar7 = Vector::__mul(pVVar7,&local_648,&local_524); pVVar7 = Vector::__add((Vector *)local_488,local_5f8,pVVar7); pVVar7 = Room::GetClampedPosition(room,&local_600,pVVar7,20.0); pEVar41 = player; Game::Spawn(g_game,3,0x33,pVVar7,&g_vectorZero,(Entity *)player,0,uVar32); piVar15 = (int *)__RTDynamicCast(); FUN_00638e20(); FUN_005b1910(); (**(code **)(*piVar15 + 0xc))(); local_46c = (Entity_Player *)((int)local_46c + -1); } while (local_46c != (Entity_Player *)0x0); } local_8._0_1_ = 1; EntityList_Query::~EntityList_Query(&familiarList); FUN_007e8f70(); iVar5 = -1; pIVar23 = (ItemConfig_Item *)0x0; pRVar26 = &local_1e0; local_8 = (undefined1 *)CONCAT31(local_8._1_3_,3); bVar3 = HasPlayerForm(pEVar41,0xc); CheckFamiliar(pEVar41,0x71,(uint)(bVar3 != 0),pRVar26,pIVar23,iVar5); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetTrinket(itemConfig,0x36); pRVar26 = (RNG *)FUN_005cbd00(); bVar3 = HasTrinket(player,0x36,0); CheckFamiliar(player,0xc,(uint)(bVar3 != 0),pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetTrinket(itemConfig,0x39); pRVar26 = (RNG *)FUN_005cbd00(); local_528 = GetTrinketMultiplier(player,0x39); local_52c = 3; puVar27 = (uint *)std::min(); CheckFamiliar(player,0xd,*puVar27,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetTrinket(itemConfig,0x3c); pRVar26 = (RNG *)FUN_005cbd00(); bVar3 = TemporaryEffects::HasTrinketEffect(local_464,0x3c); pEVar41 = player; CheckFamiliar(player,0xf,(uint)(bVar3 != 0),pRVar26,pIVar23,-1); pRVar26 = (RNG *)FUN_005cbd00(); CheckFamiliar(pEVar41,0x67,(int)pEVar41->_tonsilCount,pRVar26,(ItemConfig_Item *)0x0,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x262); pRVar26 = (RNG *)FUN_005cbd00(); bVar3 = TemporaryEffects::HasCollectibleEffect(local_464,0x262); CheckFamiliar(player,0xd2,(uint)(bVar3 != 0),pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x25d); pRVar26 = (RNG *)FUN_005cbd00(); uVar32 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x25d); CheckFamiliar(player,0xcf,uVar32,pRVar26,pIVar23,-1); itemConfig = Isaac::GetItemConfig(); pIVar23 = ItemConfig::GetCollectible(itemConfig,0x290); pRVar26 = (RNG *)FUN_005cbd00(); local_530 = GetCollectibleNum(player,0x290,0); local_534 = 1; puVar27 = (uint *)std::min(); pEVar41 = player; CheckFamiliar(player,0xca,*puVar27,pRVar26,pIVar23,-1); if (DAT_00c7ac69 == '\0') { DAT_00c7ac69 = 1; bVar3 = HasTrinket(pEVar41,0xb4,0); if (bVar3 == 0) { local_46c = (Entity_Player *)0x0; } else { local_538 = TemporaryEffects::GetTrinketEffectNum(local_464,0xb4); local_53c = 0; local_538 = 1 - local_538; piVar15 = (int *)std::max(); local_46c = (Entity_Player *)*piVar15; } local_470 = (ItemConfig_Item *)GetCollectibleNum(pEVar41,0x29b,0); _eh_vector_constructor_iterator_(local_4b4,0xc,2,FUN_00424510,FID_conflict__Tidy); local_8 = (undefined1 *)CONCAT31(local_8._1_3_,4); uVar32 = 0; iVar5 = Game::GetNumPlayers(g_game); if (iVar5 != 0) { do { otherPlayer = Game::GetPlayer(g_game,uVar32); pEVar24 = (Entity_Player *)Entity::Parent((Entity *)otherPlayer); if ((pEVar24 == pEVar41) && (cVar4 = Entity::IsDead((Entity *)otherPlayer), cVar4 == '\0') ) { iVar5 = Entity::Variant((Entity *)otherPlayer); if ((iVar5 == 1) && (iVar5 = GetBabySkin(otherPlayer), iVar5 == 0x3b)) { LAB_0076ef58: std::vector::push_back(); } else { iVar5 = Entity::Variant((Entity *)otherPlayer); if (iVar5 == 0) { temporaryEffects = (TemporaryEffects *)GetEffects(otherPlayer); bVar3 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x29b); if (bVar3 != 0) goto LAB_0076ef58; } } } uVar32 = uVar32 + 1; uVar30 = Game::GetNumPlayers(g_game); } while (uVar32 < uVar30); } iVar5 = std::vector::size(local_4b4); pEVar24 = local_46c; if ((int)local_46c < iVar5) { do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); puVar16 = (undefined4 *)FUN_00708a50(); PlayerManager::RemoveCoPlayer(playerManager,(Entity_Player *)*puVar16,0); FUN_007dc650(); iVar5 = std::vector::size(local_4b4); } while ((int)pEVar24 < iVar5); pEVar41 = player; } pEVar24 = local_46c; iVar5 = std::vector::size(local_4b4); while (iVar5 < (int)pEVar24) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); coopBaby = (Entity_Player *)PlayerManager::SpawnCoPlayerBaby(playerManager); SetControllerIndex(coopBaby); Entity::SetParent((Entity *)coopBaby,(Entity *)pEVar41); pVVar7 = Vector::Vector(&local_608,0.0,4.0); pVVar7 = Vector::__add(&pEVar41->_pos,&local_610,pVVar7); Entity::SetPosition((Entity *)coopBaby,pVVar7); apply_coop_baby_spawn_bonus(coopBaby); coopBaby->_cacheFlags = 0xffff; EvaluateItems(); std::vector::push_back(); iVar5 = std::vector::size(local_4b4); } cVar4 = FUN_0060d1e0(); if ((cVar4 == '\0') && (cVar4 = FUN_00738330(), cVar4 == '\0')) { iVar5 = std::vector::size(local_4a8); pIVar23 = local_470; if ((int)local_470 < iVar5) { do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); puVar16 = (undefined4 *)FUN_00708a50(); PlayerManager::RemoveCoPlayer(playerManager,(Entity_Player *)*puVar16,0); FUN_007dc650(); iVar5 = std::vector::size(local_4a8); } while ((int)pIVar23 < iVar5); pEVar41 = player; } pIVar23 = local_470; iVar5 = std::vector::size(local_4a8); while (iVar5 < (int)pIVar23) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); coPlayer = (Entity_Player *)PlayerManager::SpawnCoPlayer2(playerManager); SetControllerIndex(coPlayer); Entity::SetParent((Entity *)coPlayer,(Entity *)pEVar41); pVVar7 = Vector::Vector(&local_618,0.0,4.0); pVVar7 = Vector::__add(&pEVar41->_pos,&local_620,pVVar7); Entity::SetPosition((Entity *)coPlayer,pVVar7); temporaryEffects = (TemporaryEffects *)GetEffects(coPlayer); TemporaryEffects::AddCollectibleEffect(temporaryEffects,0x29b,1,1); InitPostLevelInitStats(coPlayer); std::vector::push_back(); iVar5 = std::vector::size(local_4a8); } } DAT_00c7ac69 = '\0'; local_8 = (undefined1 *)CONCAT31(local_8._1_3_,3); _eh_vector_destructor_iterator_(local_4b4,0xc,2,FID_conflict__Tidy); } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x200); local_46c = (Entity_Player *)0x0; local_460 = (ItemConfig_Item *)0x1; do { pIVar23 = local_460; piVar15 = (int *)FUN_0042c810(); if (*piVar15 != 0) { itemConfig = Isaac::GetItemConfig(); local_470 = ItemConfig::GetCollectible(itemConfig,(int)pIVar23); if ((local_470 != (ItemConfig_Item *)0x0) && (local_470->type == 4)) { iVar5 = GetCollectibleNum(pEVar41,local_470->id,0); iVar6 = TemporaryEffects::GetCollectibleEffectNum(local_464,local_470->id); local_46c = (Entity_Player *)((int)(&(local_46c->_sprite)._filename + -3) + iVar5 + iVar6) ; pIVar23 = local_460; } } local_460 = (ItemConfig_Item *)((int)pIVar23 + 1); } while ((int)local_460 < 0x2dd); if ((Entity_Player *)&DAT_00000004 < local_46c) { persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentGameData,0x163); } guard_check_icall(); local_8 = (void *)0xffffffff; guard_check_icall(); } uVar32 = pEVar41->_cacheFlags; if ((uVar32 & 0x400) != 0) { if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); local_460 = (ItemConfig_Item *)(float)(*piVar15 - iVar5); pEVar41 = player; } else { local_460 = (ItemConfig_Item *)0x0; } if ((pEVar41->_hasCurseMistEffect == 0) && (pEVar41->_isCoopGhost == 0)) { iVar5 = pEVar41->_luckModifier; } else { iVar5 = 0; } iVar6 = GetCollectibleNum(pEVar41,0xfd,0); local_460 = (ItemConfig_Item *) ((float)iVar5 + (float)local_2c + (float)local_460 + (float)pEVar41->_donateLuck + pEVar41->_edenLuck + (float)iVar6); iVar5 = GetCollectibleNum(pEVar41,0x2e,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x157,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x163,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x1b7,0); local_470 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,5,0); local_470 = (ItemConfig_Item *)((float)local_470 - (float)iVar5); iVar5 = GetCollectibleNum(pEVar41,0x29d,0); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_470); iVar5 = TemporaryEffects::GetNullEffectNum(local_464,0x38); local_460 = (ItemConfig_Item *)((float)iVar5 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x278,0); local_460 = (ItemConfig_Item *)((float)(iVar5 * 2) + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x2da,0); pEVar41->_luck = (float)iVar5 + (float)local_460; bVar3 = HasTrinket(pEVar41,0x2a,0); if (bVar3 != 0) { iVar5 = GetTrinketMultiplier(pEVar41,0x2a); pEVar41->_luck = (float)iVar5 + pEVar41->_luck; } bVar3 = HasTrinket(pEVar41,0x91,0); if (bVar3 != 0) { iVar5 = GetTrinketMultiplier(pEVar41,0x91); pEVar41->_luck = (float)iVar5 * 10.0 + pEVar41->_luck; } if ((pEVar41->_playerType == 2) && (bVar3 = HasCollectible(pEVar41,0x26b,0), bVar3 != 0)) { pEVar41->_luck = pEVar41->_luck + 1.0; } iVar5 = pEVar41->_playerType; if (iVar5 == 8) { fVar38 = pEVar41->_luck - 1.0; LAB_0076f615: pEVar41->_luck = fVar38; } else { if ((iVar5 == 0xe) || (iVar5 == 0x21)) { LAB_0076f605: fVar38 = pEVar41->_luck - 2.0; goto LAB_0076f615; } if (iVar5 == 0x13) { fVar38 = pEVar41->_luck + 1.0; goto LAB_0076f615; } if (iVar5 == 0x14) { fVar38 = pEVar41->_luck - 1.0; goto LAB_0076f615; } if (iVar5 == 0x26) goto LAB_0076f605; } local_470 = (ItemConfig_Item *)0x0; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&fortuneCookieWisps,3,0xce,0x22d,0,0); local_8 = &DAT_00000005; uVar32 = 0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar16 = (undefined4 *)std::vector::operator_index(); pEVar24 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)*puVar16); if (pEVar24 == pEVar41) { local_470 = (ItemConfig_Item *)((int)&local_470->type + 1); } uVar32 = uVar32 + 1; uVar30 = EntityList::Size(); } while (uVar32 < uVar30); } fVar38 = (float)((double)(int)local_470 + __uint_to_double_fixup[-((int)local_470 >> 0x1f)]) * 0.2 + pEVar41->_luck; auVar37 = ZEXT416((uint)fVar38); pEVar41->_luck = fVar38; FUN_007538c0(); fVar38 = auVar37._0_4_ + pEVar41->_luck; pEVar41->_luck = fVar38; if (0 < pEVar41->_coopBabyBuffTimers[4]) { pEVar41->_luck = fVar38 + 2.0; } bVar3 = HasTrinket(pEVar41,0x65,0); if ((bVar3 != 0) && (isActiveEmpty != false)) { iVar5 = GetTrinketMultiplier(pEVar41,0x65); pEVar41->_luck = (float)iVar5 + (float)iVar5 + pEVar41->_luck; } bVar3 = HasCollectible(pEVar41,0x1ec,0); if (bVar3 != 0) { pEVar41->_luck = pEVar41->_luck + 1.0; } bVar3 = HasTrinket(pEVar41,100,0); if ((bVar3 != 0) && (isActiveFullyCharged != false)) { iVar5 = GetTrinketMultiplier(pEVar41,100); pEVar41->_luck = (float)iVar5 + pEVar41->_luck; } FUN_00421780(); iVar5 = EntityList::Size(); if (iVar5 == 0x17) { pEVar41->_luck = pEVar41->_luck + 50.0; } bVar3 = Game::GetDebugFlag(g_game,8); if (bVar3 != 0) { pEVar41->_luck = pEVar41->_luck + 50.0; } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x400); local_8 = (void *)0xffffffff; EntityList_Query::~EntityList_Query(&fortuneCookieWisps); uVar32 = pEVar41->_cacheFlags; } if (((uVar32 & 0x800) != 0) && (pEVar41->_variant == 0)) { if (isMistOrGhost == '\0') { piVar15 = (int *)FUN_0042c810(); iVar5 = *piVar15; piVar15 = (int *)FUN_0042c810(); fVar38 = (float)(*piVar15 - iVar5); pEVar41 = player; local_460 = (ItemConfig_Item *)fVar38; } else { fVar38 = 0.0; } iVar5 = GetCollectibleNum(pEVar41,0x47,0); local_460 = (ItemConfig_Item *) ((((uint)(0 < pEVar41->_coopBabyBuffTimers[6]) - (uint)(0 < pEVar41->_coopBabyBuffTimers[5])) + (int)fVar38) - iVar5); iVar5 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x47); iVar5 = (int)local_460 - iVar5; iVar6 = GetCollectibleNum(pEVar41,0x1b6,0); iVar8 = TemporaryEffects::GetCollectibleEffectNum(local_464,0xc); iVar9 = GetCollectibleNum(pEVar41,0xc,0); local_460 = (ItemConfig_Item *)((float)(iVar9 + (iVar5 - iVar6) + iVar8) * 0.322 + 0.0); iVar5 = GetCollectibleNum(pEVar41,0x12e,0); local_470 = (ItemConfig_Item *)((float)iVar5 * 0.263 + (float)local_460); iVar5 = GetCollectibleNum(pEVar41,0x154,0); local_470 = (ItemConfig_Item *)((float)local_470 - (float)iVar5 * 0.152); iVar5 = TemporaryEffects::GetNullEffectNum(local_464,0x29); local_484 = (RNG *)((float)iVar5 * 0.678 + (float)local_470); iVar5 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x2b0); iVar6 = GetCollectibleNum(pEVar41,0x256,0); local_484 = (RNG *)((float)local_484 - (float)(iVar6 + iVar5)); iVar5 = GetCollectibleNum(pEVar41,0x79,0); iVar6 = GetCollectibleNum(pEVar41,0x78,0); iVar8 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x78); iVar9 = TemporaryEffects::GetCollectibleEffectNum(local_464,0x79); local_46c = (Entity_Player *)((float)(iVar9 + ((iVar5 - iVar6) - iVar8)) * 0.152 + 0.0); bVar3 = Game::IsInTimedSet(g_game,0x23); if (bVar3 != 0) { local_46c = (Entity_Player *)((float)local_46c + 1.585); } bVar3 = Game::IsInTimedSet(g_game,0x24); if (bVar3 != 0) { local_46c = (Entity_Player *)((float)local_46c - 1.0); } FUN_00421780(); iVar5 = EntityList::Size(); pRVar26 = local_484; if (iVar5 == 0x2d) { pRVar26 = (RNG *)((float)local_484 + 0.485); } fVar38 = 2.0; if ((float)pRVar26 < 2.0) { pow_wrapper(); } else { fVar38 = ((float)pRVar26 - 2.0) * 2.77259 + 4.0; } local_540 = fVar38; pVVar7 = Vector::__mul(&g_vectorOne,&local_628,&local_540); Vector::operator_assign(&pEVar41->_playerSpriteScale,pVVar7); local_544 = 2.0; if ((float)local_46c < 2.0) { pow_wrapper(); } else { local_544 = ((float)local_46c - 2.0) * 2.77259 + 4.0; } pVVar7 = Vector::__mul(&g_vectorOne,&local_630,&local_544); Vector::operator_assign(&pEVar41->_headScale,pVVar7); Vector::operator_assign(&pEVar41->_bodyScale,&g_vectorOne); LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x800); pfVar12 = (float *)std::min(); if (3.0 <= *pfVar12) { persistentGameData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(persistentGameData,0x169); } } if ((pEVar41->_cacheFlags & 0x1000U) != 0) { Sprite::Color((Sprite *)&pEVar41->_sprite); local_47b = FUN_00753560(); Color::Color(&spriteColor); if (((pEVar41->_playerType == 0x11) || (bVar3 = TemporaryEffects::HasNullEffect(local_464,0x65), bVar3 != 0)) || (pEVar41->_playerType == 0x28)) { color = (ColorMod *)Color::Color(); LAB_0076fc8b: Color::__mul(&spriteColor,color); } else { bVar3 = HasCollectible(pEVar41,0xde,0); if (bVar3 != 0) { color = (ColorMod *)Color::Color(); goto LAB_0076fc8b; } } bVar3 = HasCollectible(pEVar41,0x22a,0); if (bVar3 != 0) { color = (ColorMod *)Color::Color(); Color::__mul(&spriteColor,color); } Color::operator_assign(aCStackY_1d2c + 0x81,(ColorMod *)&spriteColor); color = (ColorMod *)FUN_004072e0(); Color::operator_assign((Color *)&pEVar41->_color,color); bVar3 = HasCollectible(pEVar41,0xd,0); if (bVar3 != 0) { Color::SetColorize((Color *)&pEVar41->_color,1.25,1.25,1.25,0.25); } bVar3 = HasCollectible(pEVar41,0x15e,0); if (bVar3 != 0) { Color::SetColorize((Color *)&pEVar41->_color,0.0,1.0,0.0,0.5); color = (ColorMod *)Color::Color(); Color::__mul((Color *)&pEVar41->_color,color); } local_490 = (ItemConfig_Item *)0x0; pvVar13 = TemporaryEffects::GetCollectibleEffect(&pEVar41->_temporaryeffects,299); if ((pvVar13 != (void *)0x0) && (*(int *)((int)pvVar13 + 8) == 0)) { local_548 = pEVar41->_taurusSpeedBonus * 0.5; puVar16 = (undefined4 *)std::max(); local_490 = (ItemConfig_Item *)*puVar16; } local_54c = TemporaryEffects::GetCollectibleEffectNum(&pEVar41->_temporaryeffects,0x19b); if ((0 < pEVar41->_bloodLustCounter) || (0 < local_54c)) { local_550 = (int)pEVar41->_bloodLustCounter; local_554 = 6; std::max(); piVar15 = (int *)std::min(); local_558 = (float)*piVar15 * 0.125; puVar16 = (undefined4 *)std::max(); local_490 = (ItemConfig_Item *)*puVar16; } local_470 = local_490; if (pEVar41->_playerType == 0x1b) { local_55c = Math::clamp(0.0,1.0,(float)pEVar41->_samsonBerserkCharge / 100000.0); puVar16 = (undefined4 *)std::max(); local_470 = (ItemConfig_Item *)*puVar16; } local_490 = local_470; if (0.0 < (float)local_470) { Color::Color(&local_248); Color::operator_assign(aCStackY_1d2c + 0x81,(ColorMod *)&spriteColor); color = (ColorMod *)FUN_004072e0(); color = Color::Lerp(&local_42c,&pEVar41->_color,color,(float)local_470); Color::operator_assign((Color *)&pEVar41->_color,color); } LuaEngine::EvaluateItems(g_luaEngine,pEVar41,0x1000); if (local_47b != 0) { (**(code **)(*(int *)pEVar41 + 0x60))(); } } bVar3 = HasCollectible(pEVar41,0x130,0); if (((bVar3 != 0) || (iVar5 = GetZodiacEffect(pEVar41), iVar5 == 0x130)) && ((pEVar41->_cacheFlags & 0x1b) != 0)) { fVar38 = (pEVar41->_damage * 30.0) / (pEVar41->_maxfiredelay + 1.0); FUN_00431260(); pow_wrapper(); local_470 = (ItemConfig_Item *)(fVar38 * 2.161616 - 2.0); fVar38 = pEVar41->_movespeed; FUN_009bfc00(); fVar40 = pEVar41->_tearrange; local_460 = (ItemConfig_Item *)fVar38; FUN_009bfd00(); pIVar23 = (ItemConfig_Item *) ((fVar40 + (float)local_460 + (float)local_470 + (float)local_470) * 0.25); local_470 = pIVar23; FUN_009bfc20(); pEVar41->_movespeed = (float)pIVar23; pIVar23 = local_470; FUN_009bfc80(); pEVar41->_maxfiredelay = (float)pIVar23; pIVar23 = local_470; FUN_009bfcd0(); pEVar41->_damage = (float)pIVar23; auVar37 = ZEXT416(local_470); FUN_009bfd20(); pEVar41->_tearrange = auVar37._0_4_; pEVar41->_cacheFlags = pEVar41->_cacheFlags | 0x1b; } bVar3 = HasCollectible(pEVar41,0x232,0); pEVar24 = player; if (((bVar3 != 0) && (isEffectsDisabled == 0)) && ((pEVar41[1]._chargeBarSprites[0]._color._offset[2] == 0.0 && (pEVar41[1]._chargeBarSprites[0]._championColor._tint[0] == 0.0)))) { uVar32 = pEVar41->_cacheFlags; if ((uVar32 & 1) != 0) { pfVar12 = (float *)std::max(); fVar38 = *pfVar12; pEVar24->_rockBottomDamage = fVar38; pEVar41->_damage = fVar38; uVar32 = pEVar24->_cacheFlags; pEVar41 = pEVar24; } if ((uVar32 & 2) != 0) { fireRate = 30.0 / (pEVar41->_maxfiredelay + 1.0); pfVar12 = (float *)std::max(); fireRate = *pfVar12; pEVar41->_rockBottomMaxFireDelay = fireRate; pEVar41->_maxfiredelay = 30.0 / fireRate - 1.0; uVar32 = pEVar41->_cacheFlags; } pEVar24 = player; if ((uVar32 & 8) != 0) { pfVar12 = (float *)std::max(); fVar38 = *pfVar12; pEVar24->_rockBottomTearRange = fVar38; pEVar41->_tearrange = fVar38; uVar32 = pEVar24->_cacheFlags; pEVar41 = pEVar24; } pEVar24 = player; if ((uVar32 & 0x10) != 0) { pfVar12 = (float *)std::max(); fVar38 = *pfVar12; pEVar24->_rockBottomMoveSpeed = fVar38; pEVar41->_movespeed = fVar38; uVar32 = pEVar24->_cacheFlags; pEVar41 = pEVar24; } pEVar24 = player; if ((uVar32 & 0x400) != 0) { pfVar12 = (float *)std::max(); fVar38 = *pfVar12; pEVar24->_rockBottomLuck = fVar38; pEVar41->_luck = fVar38; uVar32 = pEVar24->_cacheFlags; pEVar41 = pEVar24; } if ((uVar32 & 4) != 0) { pfVar12 = (float *)std::max(); fVar38 = *pfVar12; player->_rockBottomShotSpeed = fVar38; pEVar41->_shotspeed = fVar38; pEVar41 = player; } } bVar3 = HasCollectible(pEVar41,0x279,0); if ((bVar3 != 0) && ((pEVar41->_cacheFlags & 0x10) != 0)) { local_560 = 0x3f8ccccd; pfVar12 = (float *)std::max(); pEVar41->_movespeed = *pfVar12; } if ((pEVar41->_cacheFlags & 0x80000010U) != 0x10) goto LAB_00770492; iVar5 = GetOtherTwin(pEVar41); if (iVar5 != 0) { *(uint *)(iVar5 + 0x1574) = *(uint *)(iVar5 + 0x1574) | 0x80000010; EvaluateItems(); if ((pEVar41->_playerType == 0x13) || (pEVar41->_playerType == 0x14)) { local_564 = (pEVar41->_movespeed + *(float *)(iVar5 + 0x1568)) * 0.5; } else { pEVar24 = GetMainTwin(pEVar41); if (pEVar24 != pEVar41) { std::min(); pfVar12 = (float *)std::max(); fVar38 = *pfVar12; *(float *)(iVar5 + 0x1568) = fVar38; pEVar41->_movespeed = fVar38; goto LAB_007703f8; } } std::min(); pfVar12 = (float *)std::max(); fVar38 = *pfVar12; pEVar41->_movespeed = fVar38; *(float *)(iVar5 + 0x1568) = fVar38; } LAB_007703f8: if ((pEVar41->_parent == (EntityPtr)0x0) || (bVar3 = Entity::is_player((Entity *)pEVar41->_parent), bVar3 == 0)) { fVar38 = 0.0; local_460 = (ItemConfig_Item *)0x0; iVar5 = Game::GetNumPlayers(g_game); if (iVar5 != 0) { do { pEVar24 = Game::GetPlayer(g_game,(uint)fVar38); parentPlayer = (Entity_Player *)Entity::Parent((Entity *)pEVar24); if ((parentPlayer == pEVar41) && (cVar4 = Entity::IsDead((Entity *)pEVar24), cVar4 == '\0')) { pEVar24->_cacheFlags = pEVar24->_cacheFlags | 0x10; Level::SetHeartPicked((Level *)&pEVar24->_temporaryeffects); } fVar38 = (float)((int)local_460 + 1); local_460 = (ItemConfig_Item *)fVar38; fVar40 = (float)Game::GetNumPlayers(g_game); } while ((uint)fVar38 < (uint)fVar40); } } else { pEVar41->_movespeed = *(float *)((int)pEVar41->_parent + 0x1568); } LAB_00770492: uVar32 = pEVar41->_cacheFlags; if ((uVar32 & 0x2000) != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::InvalidatePickupVision(room); uVar32 = pEVar41->_cacheFlags; } if ((uVar32 & 0x10) != 0) { std::min(); pfVar12 = (float *)std::max(); pEVar41->_movespeed = *pfVar12; } pfVar12 = (float *)std::max(); pEVar41->_shotspeed = *pfVar12; if (-5.0 < pEVar41->_tearheight) { pEVar41->_tearheight = -5.0; } pfVar12 = (float *)std::max(); pEVar41->_tearrange = *pfVar12; pfVar12 = (float *)std::max(); pEVar41->_damage = *pfVar12; pfVar12 = (float *)std::max(); pEVar41->_maxfiredelay = *pfVar12; uVar32 = pEVar41->_cacheFlags; if ((uVar32 & 0xc) != 0) { fVar38 = pEVar41->_tearheight; FUN_0067da40(); pEVar41->_tearfallspeed = -fVar38; uVar32 = pEVar41->_cacheFlags; } if (((uVar32 & 0x10) != 0) && (iVar5 = is_achievement_79_unlocked(pEVar41), 0 < iVar5)) { iVar5 = is_achievement_79_unlocked(pEVar41); pEVar41->_movespeed = (float)iVar5 * 0.2 + pEVar41->_movespeed; } pEVar41->_cacheFlags = 0; ExceptionList = local_10; return; } //@@ 00770600 Entity_Player::RespawnFamiliars /* ZHL [lua] Lua binding EntityPlayer:RespawnFamiliars */ void __thiscall Entity_Player::RespawnFamiliars(Entity_Player *this) { this->_cacheFlags = this->_cacheFlags | 0x200; EvaluateItems(); return; } //@@ 00770610 Entity_Player::GetNPCTarget /* ZHL [lua] Lua binding EntityPlayer:GetNPCTarget */ void Entity_Player::GetNPCTarget(void) { int in_ECX; if (((*(int *)(in_ECX + 0x1450) == 0) && (*(int *)(in_ECX + 0x144c) == 0)) && (*(Entity **)(in_ECX + 0x200c) != (Entity *)0x0)) { Entity::GetLastParent(*(Entity **)(in_ECX + 0x200c)); return; } return; } //@@ 00770640 FUN_00770640 void FUN_00770640(float *param_1) { float *pfVar1; float fVar2; undefined4 uVar3; int in_ECX; fVar2 = *param_1; pfVar1 = param_1 + 1; if ((fVar2 == g_vectorZero.x) && (*pfVar1 == g_vectorZero.y)) { uVar3 = 0xffffffff; } else if (ABS(fVar2) <= ABS(*pfVar1)) { uVar3 = 1; if (0.0 <= *pfVar1) { uVar3 = 3; } } else if (0.0 <= fVar2) { uVar3 = 2; } else { uVar3 = 0; } *(undefined4 *)(in_ECX + 0x162c) = uVar3; *(undefined4 *)(in_ECX + 0x1628) = uVar3; *(float *)(in_ECX + 0x1630) = *param_1; *(float *)(in_ECX + 0x1634) = *pfVar1; return; } //@@ 007706e0 Entity_Player::HasCollectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:HasCollectible prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Player::HasCollectible(Entity_Player *this,int type,byte ignoreModifiers) { byte bVar1; char cVar2; ItemConfig_Item *collectible; EntityPtr mainPlayer; int iVar3; PersistentGameData *userData; int iVar4; uint rollResult; PersistentGameData *persistentData; int extraout_ECX; int extraout_ECX_00; bool isMatch; undefined8 userId; int typeKey; PersistentGameData *local_24; ItemConfig_Item *savedCollectible; NetplayManager *local_1c; RNG local_18; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; typeKey = type; collectible = ItemConfig::GetCollectible(&g_manager->_itemConfig,type); while( true ) { if (collectible == (ItemConfig_Item *)0x0) { return 0; } savedCollectible = collectible; if ((*(int *)((int)this + 0x2c) != 1) || (((mainPlayer = *(EntityPtr *)((int)this + 0x3bc), mainPlayer == (EntityPtr)0x0 || (*(int *)((int)mainPlayer + 0x28) != 1)) && (mainPlayer = (EntityPtr)Game::GetPlayer(g_game,0), mainPlayer == (EntityPtr)0x0)))) break; collectible = ItemConfig::GetCollectible(&g_manager->_itemConfig,type); this = (Entity_Player *)mainPlayer; } if (((*(char *)((int)this + 0x20a9) != '\0') && (*(int *)&g_game->_deathmatchManager < 2)) && ((collectible->tags & 0x8000) == 0)) { return 0; } if (((*(int *)((int)this + 0x2ef4) != 0) && (type == *(int *)((int)this + 0x2ef4))) && (*(char *)((int)this + 0x2ef0) != '\0')) { return 1; } if (type < 0) { bVar1 = collectible_set_has(type); return bVar1; } if (ignoreModifiers != 0) goto LAB_00770c3e; if (((type == 0x147) || (type == 0x148)) && (bVar1 = HasTrinket(this,0x15,0), bVar1 != 0)) { local_1c = (NetplayManager *)(g_game->_frameCount & 0x80000003); if ((int)local_1c < 0) { local_1c = (NetplayManager *)(((uint)((int)(local_1c + -1) + 3) | 0xfffffffc) + 1); } iVar3 = GetTrinketMultiplier(this,0x15); if (iVar3 < 2) { if (local_1c == (NetplayManager *)0x0) { isMatch = type == 0x147; goto LAB_00770856; } if (local_1c == (NetplayManager *)0x1) goto LAB_00770850; } else if ((local_1c == (NetplayManager *)0x0) || (local_1c == (NetplayManager *)0x1)) { if (type == 0x147) { return 1; } LAB_00770850: isMatch = type == 0x148; LAB_00770856: if (isMatch) { return 1; } } } if (type == 0x139) { if ((*(int *)((int)this + 0x13c0) == 10) || ((bVar1 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)this + 0x1508),0x70), bVar1 != 0 && (*(int *)((int)this + 0x13c0) != 0x1f)))) { local_1c = &g_manager->_netplayManager; local_24 = &g_manager->_persistentGameData; persistentData = local_24; if (*local_1c != *(NetplayManager *)(g_manager + 1)) { userId = FUN_00a23920(); local_18._shift3 = (int)((ulonglong)userId >> 0x20); local_18._shift2 = (int)userId; userData = (PersistentGameData *)FUN_0090c300(&local_18._shift2); persistentData = local_24; if (userData != (PersistentGameData *)0x0) { persistentData = userData; } } if (persistentData->_achievements[0xfa] != 0) { return 1; } if ((g_manager->_state == 2) && (g_game != (Game *)0x0)) { if ((g_game->_dailyChallenge)._id != 0) { return 1; } bVar1 = g_game->_isDebug; LAB_00770a3e: if (bVar1 != 0) { return 1; } } } } else if (type == 9) { bVar1 = HasTrinket(this,0x5d,0); if (bVar1 != 0) { iVar3 = *(int *)((int)g_game->_room + 4); local_18._seed = 0; if (iVar3 != 0) { local_18._seed = *(uint *)(iVar3 + 0x58); } local_18._shift1 = 1; local_18._shift2 = 0xb; local_18._shift3 = 6; rollResult = RNG::RandomInt(&local_18,100); if (rollResult < 0x21) { return 1; } if (1 < *(int *)&g_game->_deathmatchManager) { return 1; } } } else if (type == 0x3b) { cVar2 = FUN_007da770(); if (cVar2 != '\0') { return 1; } } else if (type == 0x131) { if ((*(byte *)((int)this + 0x2028) & 0x10) != 0) { return 1; } } else if (type == 0x101) { if ((*(byte *)((int)this + 0x2028) & 8) != 0) { return 1; } } else if (type == 0xe7) { if ((*(byte *)((int)this + 0x2028) & 0x20) != 0) { return 1; } } else if (type == 0xb6) { bVar1 = *(byte *)((int)this + 0x2028) & 0x40; goto LAB_00770a3e; } iVar3 = get_seeded_variant(this); if (type == 0x14a) { if (iVar3 == 1) { return 1; } } else if ((type == 0x99) && (iVar3 == 2)) { return 1; } iVar4 = is_achievement_79_unlocked(this); iVar3 = extraout_ECX; if (8 < iVar4) { iVar3 = Seeds::GetStartSeed(); iVar4 = is_achievement_79_unlocked(this); local_18._shift1 = 1; local_18._shift2 = 0x1b; local_18._seed = 1; if (1 < (uint)(iVar4 + iVar3)) { local_18._seed = iVar4 + iVar3; } local_18._shift3 = 0x1b; rollResult = RNG::RandomInt(&local_18,6); if (type == *(int *)(&DAT_00b6bcd0 + rollResult * 4)) { return 1; } iVar3 = extraout_ECX_00; collectible = savedCollectible; } bVar1 = IsInnateCollectible(this,type,iVar3); if (((bVar1 == 0) && ((type != 0x76 || (bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),0x76), bVar1 == 0)))) && ((*(char *)((int)this + 0x170) == '\0' || ((((collectible == (ItemConfig_Item *)0x0 || (bVar1 = Item::HasTags(collectible,0x40000000), bVar1 == 0)) || (*(Entity_Player **)((int)this + 0x1e6c) == (Entity_Player *)0x0)) || (bVar1 = HasCollectible(*(Entity_Player **)((int)this + 0x1e6c),type,0), bVar1 == 0)))))) { if (((*(char *)((int)this + 0x202c) != '\0') && (collectible != (ItemConfig_Item *)0x0)) && ((bVar1 = Item::HasTags(collectible,0x8000), bVar1 == 0 && (type != 0x216)))) { return 0; } if ((((((*(int *)((int)this + 0x1f84) == 0) || (std::set::find(&local_24,&typeKey), local_24 == *(PersistentGameData **)((int)this + 0x1f80))) || (*(int *)&local_24->field_0x14 < 1)) && (((((*(int *)((int)this + 0x1fb8) == 0 || (*(int *)((int)this + 0x1fb8) != type)) && (iVar3 = FUN_009e0650(type), iVar3 < 1)) && (((savedCollectible == (ItemConfig_Item *)0x0 || (cVar2 = ItemConfig_Item::is_mom_item(), cVar2 == '\0')) || (bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),type), bVar1 == 0)))) && (iVar3 = GetActiveItemSlot(this,type), iVar3 < 0)))) && (((type == 0xbf || (bVar1 = HasCollectible(this,0xbf,0), bVar1 == 0)) || (type != *(int *)((int)this + 0x1390))))) && ((bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),0x1e8), bVar1 == 0 || (type != *(int *)((int)this + 5000))))) { LAB_00770c3e: if ((*(int *)((int)this + 0x2ef4) == 0) || ((type != *(int *)((int)this + 0x2ef4) || (*(char *)((int)this + 0x2ef0) != '\0')))) { return 0 < *(int *)(*(int *)((int)this + 0x16c8) + type * 4); } return 1 < *(int *)(*(int *)((int)this + 0x16c8) + type * 4); } } return 1; } //@@ 00770ca0 Entity_Player::GetCollectibleNum /* ZHL [exact] __thiscall int Entity_Player::GetCollectibleNum(int collectibleID, bool OnlyCountTrueItems); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall Entity_Player::GetCollectibleNum(Entity_Player *this,int collectibleID,byte OnlyCountTrueItems) { byte bVar1; char isMomItem; Entity_Player *mainPlayer; ItemConfig_Item *collectible; void *pvVar2; uint uVar3; ItemConfig_Item *extraout_ECX; ItemConfig_Item *extraout_ECX_00; ItemConfig_Item *unused; int id; int iVar4; int count; bool isNotGranted; void *wispIter [2]; float pendingItemId; id = collectibleID; if (-1 < collectibleID) { while (id < (int)(this->_collectibleCounts)._end - (int)(this->_collectibleCounts)._begin >> 2) { if ((this->_variant != 1) || (mainPlayer = GetMainPlayer(this), mainPlayer == (Entity_Player *)0x0)) { iVar4 = *(int *)((int)(this->_collectibleCounts)._begin + id * 4); collectible = ItemConfig::GetCollectible(&g_manager->_itemConfig,id); if ((collectible != (ItemConfig_Item *)0x0) && (collectible->type == 3)) { iVar4 = 0; } pendingItemId = this[1]._chargeBarSprites[0]._color._offset[2]; count = iVar4; if ((pendingItemId != 0.0) && (pendingItemId == (float)id)) { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { count = 0; if (0 < iVar4 + -1) { count = iVar4 + -1; } } else { count = iVar4 + 1; } } if ((this->_isCoopGhost != 0) && ((collectible->tags & 0x8000) == 0)) { return 0; } iVar4 = this->_activeDesc[0]._item; if ((iVar4 != 0) && (iVar4 == id)) { count = count + 1; } iVar4 = this->_activeDesc[1]._item; if ((iVar4 != 0) && (iVar4 == id)) { count = count + 1; } iVar4 = this->_activeDesc[2]._item; if ((iVar4 != 0) && (iVar4 == id)) { count = count + 1; } iVar4 = this->_activeDesc[3]._item; if ((iVar4 != 0) && (iVar4 == id)) { count = count + 1; } if (OnlyCountTrueItems != 0) { return count; } if (((this->_hasCurseMistEffect != 0) && ((collectible->tags & 0x8000) == 0)) && (id != 0x216)) { count = 0; } unused = collectible; if (((id != 0x188) && (id != 0x19d)) && (id != 0x19c)) { bVar1 = HasCollectible(this,0x188,0); if ((bVar1 != 0) && (iVar4 = GetZodiacEffect(this), id == iVar4)) { count = count + 1; } bVar1 = HasCollectible(this,0x19d,0); unused = extraout_ECX; if ((bVar1 != 0) || (bVar1 = HasCollectible(this,0x19c,0), unused = extraout_ECX_00, bVar1 != 0)) { if (id < 0x117) { if (id == 0x116) { uVar3 = 2; } else { switch(id) { case 0x62: uVar3 = 0x100; break; default: goto switchD_00770e4b_caseD_63; case 0x70: uVar3 = 0x40; break; case 0x71: uVar3 = 4; break; case 0xb2: uVar3 = 0x80; break; case 0x10e: uVar3 = 1; break; case 0x113: uVar3 = 0x10; } } } else if (id < 0x1a2) { if (id == 0x1a1) { uVar3 = 0x20; } else if (id == 0x168) { uVar3 = 8; } else if (id == 0x16b) { uVar3 = 0x200; } else { if (id != 0x186) goto switchD_00770e4b_caseD_63; uVar3 = 0x400; } } else if (id == 0x2a7) { uVar3 = 0x800; } else { if (id != 0x2ba) goto switchD_00770e4b_caseD_63; uVar3 = 0x1000; } if ((this->_conceptionFamiliarFlags & uVar3) != 0) { count = count + 1; } } } switchD_00770e4b_caseD_63: bVar1 = IsInnateCollectible(this,id,(int)unused); if (bVar1 != 0) { count = count + 1; } if (id == 0x3b) { if ((this->_playerType != 3) && (this->_playerType != 0xc)) goto LAB_00770f59; bVar1 = HasCollectible(this,0x26b,0); isNotGranted = bVar1 == 0; } else if (id == 0x131) { isNotGranted = (this->_grantedCollectibleFlags & 0x10) == 0; } else if (id == 0x101) { isNotGranted = (this->_grantedCollectibleFlags & 8) == 0; } else if (id == 0xe7) { isNotGranted = (this->_grantedCollectibleFlags & 0x20) == 0; } else { if (id != 0x6c) goto LAB_00770f59; isNotGranted = (this->_grantedCollectibleFlags & 0x40) == 0; } if (!isNotGranted) { count = count + 1; } LAB_00770f59: iVar4 = get_seeded_variant(this); if (id == 0x14a) { if (iVar4 == 1) { count = count + 1; } } else if (id == 0x99) { if (iVar4 == 2) { count = count + 3; } } else if (id == 0x76) { if (((this->_temporaryeffects)._disabled == 0) && (pvVar2 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x76), pvVar2 != (void *)0x0)) { iVar4 = *(int *)((int)pvVar2 + 4); } else { iVar4 = 0; } count = count + iVar4; } if ((((this->_valid != 0) && (collectible != (ItemConfig_Item *)0x0)) && ((collectible->tags & 0x40000000) != 0)) && (this->_backupPlayer != (Entity_Player *)0x0)) { iVar4 = GetCollectibleNum(this->_backupPlayer,id,0); count = count + iVar4; } if (this->_hasCurseMistEffect == 0) { if (((this->_itemWispsList)._size != 0) && (std::set::find(wispIter,&collectibleID), id = collectibleID, wispIter[0] != (this->_itemWispsList)._head)) { count = count + *(int *)((int)wispIter[0] + 0x14); } if ((this->_modelingClayEffect != 0) && (this->_modelingClayEffect == id)) { count = count + 1; } pvVar2 = (this->_extraCollectibleCounts)._begin; if (id < (int)(this->_extraCollectibleCounts)._end - (int)pvVar2) { uVar3 = (uint)*(byte *)((int)pvVar2 + id); } else { uVar3 = 0; } count = count + uVar3; if ((collectible != (ItemConfig_Item *)0x0) && (isMomItem = ItemConfig_Item::is_mom_item(), isMomItem != '\0')) { iVar4 = TemporaryEffects::GetCollectibleEffectNum(&this->_temporaryeffects,id); count = count + iVar4; } if ((((id != 0xbf) && (bVar1 = HasCollectible(this,0xbf,0), bVar1 != 0)) && (this->_threeDollarBillItem != 0)) && (id == this->_threeDollarBillItem)) { count = count + 1; } bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1e8); if (((bVar1 != 0) && (this->_metronomeCollectibleID != 0)) && (id == this->_metronomeCollectibleID)) { count = count + 1; } } return count; } this = mainPlayer; } } return 0; } //@@ 007711a0 Entity_Player::VoidHasCollectible /* ZHL [exact] __thiscall bool Entity_Player::VoidHasCollectible(int id); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::VoidHasCollectible(Entity_Player *this,int id) { uint uVar1; int *piVar2; ActiveItemDesc *pAVar3; uint uVar4; uVar1 = 0; pAVar3 = this->_activeDesc; while (pAVar3->_item != 0x1dd) { uVar1 = uVar1 + 1; pAVar3 = pAVar3 + 1; if (3 < uVar1) { return 0; } } if ((int)uVar1 < 0) { return 0; } uVar1 = 0; piVar2 = (this->_voidedCollectibles)._begin; uVar4 = (int)(this->_voidedCollectibles)._end - (int)piVar2 >> 2; if (uVar4 == 0) { return 0; } do { if (*piVar2 == id) { return 1; } uVar1 = uVar1 + 1; piVar2 = piVar2 + 1; } while (uVar1 < uVar4); return 0; } //@@ 00771200 Entity_Player::IsInnateCollectible /* DB: player-type specific item ids; caller HasCollectible prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity_Player::IsInnateCollectible(Entity_Player *this,int collectibleId,int unused) { int iVar1; PersistentGameData *peerData; uint userIdLo; uint userIdHi; Manager *manager; PersistentGameData *persistentData; bool isInnate; uint userIdKey; uint uStack_1c; undefined1 findResult [8]; int foundNode; manager = g_manager; persistentData = &g_manager->_persistentGameData; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar1 = *(int *)&this->field_0x1e50; if (iVar1 == 0) { uStack_1c = 0; userIdKey = 0; userIdLo = userIdKey; userIdHi = uStack_1c; } else { userIdLo = *(uint *)(iVar1 + 8); userIdHi = *(uint *)(iVar1 + 0xc); } _userIdKey = CONCAT44(userIdHi,userIdLo); FUN_00731ee0(findResult,&userIdKey); if ((((*(char *)(foundNode + 0xd) == '\0') && (*(uint *)(foundNode + 0x14) <= userIdHi)) && ((*(uint *)(foundNode + 0x14) < userIdHi || (*(uint *)(foundNode + 0x10) <= userIdLo)))) && ((foundNode != *(int *)&manager[1]._gamestate.field_0xc0 && (peerData = (PersistentGameData *)FUN_00914150(&userIdKey), manager = g_manager, peerData != (PersistentGameData *)0x0)))) { persistentData = peerData; } } iVar1 = this->_playerType; if (iVar1 == 0xd) { if (collectibleId == 0x168) { return 1; } if (collectibleId == 0x19c) { return 1; } } else if (iVar1 == 10) { if (collectibleId == 0x139) { if (persistentData->_achievements[0xfa] == 0) { if (manager->_state != 2) { return 0; } if (g_game == (Game *)0x0) { return 0; } if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) { return 0; } } return 1; } } else { if (iVar1 == 2) { isInnate = collectibleId == 0x2e; } else if (iVar1 == 5) { if (collectibleId == 0x7a) { return 1; } isInnate = collectibleId == 0x75; } else if (iVar1 == 6) { isInnate = collectibleId == 0x9d; } else if ((iVar1 == 8) || (iVar1 == 0xb)) { if (collectibleId != 0xd6) { return 0; } if (persistentData->_achievements[0x14b] == 0) { if (manager->_state != 2) { return 0; } if (g_game == (Game *)0x0) { return 0; } if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) { return 0; } } if (iVar1 == 0xb) { return 1; } isInnate = g_game->_challenge == 0; } else { if (iVar1 != 0x12) { return 0; } if (g_game->_challenge == 0x25) { return 0; } if (g_game->_challenge == 0x26) { return 0; } isInnate = collectibleId == 0x248; } if (isInnate) { return 1; } } return 0; } //@@ 00771410 Entity_Player::apply_innate_collectibles /* DB: ? loops collectible ids 0..0x2dc: innate ones (Entity_Player::IsInnateCollectible) get AddCostume and are marked in the game's seen-item bitset (Wait What 484 removes Butter Bean 294 from pools), non-held ones lose their costume (RemoveCostume); special case for player type 5; Entity_Player::InitPostLevelInitStats, ChangePlayerType */ void __thiscall Entity_Player::apply_innate_collectibles(Entity_Player *this) { uint *puVar1; void *pvVar2; Game *pGVar3; byte bVar4; ItemConfig_Item *pIVar5; int unused; Entity_Player *extraout_ECX; Entity_Player *extraout_ECX_00; Entity_Player *extraout_ECX_01; Entity_Player *extraout_ECX_02; Entity_Player *extraout_ECX_03; Entity_Player *unused_00; uint collectibleId; collectibleId = 0; unused_00 = this; do { bVar4 = IsInnateCollectible(this,collectibleId,(int)unused_00); pGVar3 = g_game; if (bVar4 == 0) { IsInnateCollectible(this,collectibleId,unused); bVar4 = HasCollectible(this,collectibleId,0); unused_00 = extraout_ECX_00; if (bVar4 == 0) { bVar4 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,collectibleId); unused_00 = extraout_ECX_01; if (bVar4 == 0) { pIVar5 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); unused_00 = extraout_ECX_02; if (pIVar5 != (ItemConfig_Item *)0x0) { RemoveCostume(this,pIVar5); unused_00 = extraout_ECX_03; } } } } else { if (g_game->_challenge != 0x2b) { if (collectibleId == 0x1e4) { ItemPool::RemoveCollectible(&g_game->_itemPool,0x126,0,0); } if (collectibleId < (pGVar3->_itemPool)._removedCollectibles._size) { puVar1 = (uint *)((int)(pGVar3->_itemPool)._removedCollectibles._begin + (collectibleId >> 5) * 4); *puVar1 = *puVar1 | 1 << (collectibleId & 0x1f); } } unused_00 = (g_manager->_itemConfig)._collectibles._begin; if (((int)collectibleId < (int)(g_manager->_itemConfig)._collectibles._end - (int)unused_00 >> 2) && (pIVar5 = *(ItemConfig_Item **) ((int)(&(unused_00->_sprite)._filename + -3) + collectibleId * 4), pIVar5 != (ItemConfig_Item *)0x0)) { AddCostume(this,pIVar5,0); unused_00 = extraout_ECX; } } collectibleId = collectibleId + 1; } while ((int)collectibleId < 0x2dd); if (this->_playerType == 5) { pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 & 0xfffffffcU) < 0x1e9) { RemoveCostume(this,(ItemConfig_Item *)0x0); return; } RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar2 + 0x1e8)); } return; } //@@ 00771550 Entity_Player::HasTrinket /* ZHL [lua] Lua binding EntityPlayer:HasTrinket prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Player::HasTrinket(Entity_Player *this,uint type,byte ignoreModifiers) { float fVar1; byte bVar2; int iVar3; uint uVar4; int *piVar5; uint uVar6; fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if (((fVar1 != 0.0) && (fVar1 == (float)type)) && (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) != '\0')) { return 1; } if (ignoreModifiers != 0) { uVar6 = 1; bVar2 = HasCollectible(this,0x8b,0); if ((bVar2 != 0) || (bVar2 = HasCollectible(this,0x1ca,0), bVar2 != 0)) { uVar6 = 2; } uVar4 = 0; piVar5 = this->_trinketsID; do { if ((*piVar5 & 0x7fffU) == type) { return 1; } uVar4 = uVar4 + 1; piVar5 = piVar5 + 1; } while (uVar4 < uVar6); return 0; } if (((fVar1 == 0.0) || (fVar1 != (float)type)) || (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) != '\0')) { iVar3 = GetTrinketMultiplier(this,type); return 0 < iVar3; } iVar3 = GetTrinketMultiplier(this,type); return 1 < iVar3; } //@@ 00771620 Entity_Player::HasGoldenTrinket /* ZHL [exact] __thiscall bool Entity_Player::HasGoldenTrinket(unsigned int TrinketID); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::HasGoldenTrinket(Entity_Player *this,uint TrinketID) { float fVar1; byte bVar2; uint uVar3; int *piVar4; uint uVar5; uVar5 = 1; bVar2 = HasCollectible(this,0x8b,0); if ((bVar2 != 0) || (bVar2 = HasCollectible(this,0x1ca,0), bVar2 != 0)) { uVar5 = 2; } piVar4 = this->_trinketsID; uVar3 = 0; do { if (((*piVar4 & 0x7fffU) == TrinketID) && ((*piVar4 & 0x8000U) != 0)) { return 1; } uVar3 = uVar3 + 1; piVar4 = piVar4 + 1; } while (uVar3 < uVar5); if ((*(short *)((int)(this->_smeltedTrinkets)._begin + TrinketID * 4 + 2) < 1) && ((fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0], ((uint)fVar1 & 0x7fff) != TrinketID || (((uint)fVar1 & 0x8000) == 0)))) { return 0; } return 1; } //@@ 007716c0 is_trinket_unpickable_id /* DB: ? trinket id&0x7fff ==41 or 135 */ int is_trinket_unpickable_id(uint param_1) { uint3 uVar1; param_1 = param_1 & 0x7fff; uVar1 = (uint3)(param_1 >> 8); if ((param_1 == 0x29) || (param_1 == 0x87)) { return CONCAT31(uVar1,1); } return (uint)uVar1 << 8; } //@@ 007716f0 Entity_Player::TryHoldTrinket /* ZHL [lua] Lua binding EntityPlayer:TryHoldTrinket */ undefined4 Entity_Player::TryHoldTrinket(undefined4 param_1) { bool bVar1; byte bVar2; char cVar3; Entity_Player *in_ECX; uint extraout_ECX; int *piVar4; uint uVar5; uint uVar6; bool bVar7; uVar6 = 0; piVar4 = in_ECX->_trinketsID; do { uVar5 = 1; bVar2 = HasCollectible(in_ECX,0x8b,0); if ((bVar2 != 0) || (bVar2 = HasCollectible(in_ECX,0x1ca,0), bVar2 != 0)) { uVar5 = 2; } if (uVar5 <= uVar6) { return 0; } uVar5 = *piVar4; if (((uVar5 & 0x7fff) == 0x35) && (cVar3 = is_trinket_unpickable_id(param_1), uVar5 = extraout_ECX, cVar3 != '\0')) { bVar1 = true; } else { bVar1 = false; } if (uVar5 == 0) { return 1; } if (*(int *)&g_game->_deathmatchManager < 2) { if (uVar5 != 0x35) { if (uVar5 != 0x40) { return 1; } bVar7 = g_game->_challenge == 0x1c; goto LAB_00771793; } } else { cVar3 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x50))(in_ECX); bVar7 = cVar3 == '\0'; LAB_00771793: if (!bVar7) { return 1; } } if (bVar1) { return 1; } uVar6 = uVar6 + 1; piVar4 = piVar4 + 1; } while( true ); } //@@ 007717c0 Entity_Player::GetMaxTrinkets /* ZHL [lua] Lua binding EntityPlayer:GetMaxTrinkets prototype: db/protos.zhl */ int __thiscall Entity_Player::GetMaxTrinkets(Entity_Player *this) { byte bVar1; bVar1 = HasCollectible(this,0x8b,0); if ((bVar1 == 0) && (bVar1 = HasCollectible(this,0x1ca,0), bVar1 == 0)) { return 1; } return 2; } //@@ 00771800 Entity_Player::DropTrinket /* WARNING: Unable to use type for symbol droppedTrinketType */ /* ZHL [lua] Lua binding EntityPlayer:DropTrinket prototype: REPENTOGON, confirmed by RET 8 */ Entity_Pickup * __thiscall Entity_Player::DropTrinket(Entity_Player *this,Vector *DropPos,byte ReplaceTick) { void *pvVar1; Manager *pMVar2; char cVar3; NetplayManager userIter; int gridY; Entity *spawnedEffect; int *effect; Game *game; uint userCount; int iVar4; uint uVar5; Entity_Player *player; int gridWidth; Entity_Pickup *droppedPickup; uint uVar6; int *piVar7; Entity_Pickup *pEStack_2c; Entity_Player *savedThis; float fStack_24; Manager *pMStack_20; float sfxVolume; int *local_18; Vector VStack_10; float droppedTrinketType; savedThis = this; FlushQueueItem(this); uVar6 = 0xffffffff; uVar5 = 0; piVar7 = this->_trinketsID; game = g_game; local_18 = piVar7; do { if (*(int *)&game->_deathmatchManager < 2) { if ((*piVar7 == 0x35) || ((*piVar7 == 0x40 && (game->_challenge == 0x1c)))) goto LAB_0077186b; LAB_0077187d: if (uVar6 != 0xffffffff) goto LAB_0077188b; if (*piVar7 == 0) break; uVar6 = uVar5; } else { cVar3 = (**(code **)(*(int *)(game->_deathmatchManager)._type + 0x50))(savedThis); game = g_game; if (cVar3 != '\0') goto LAB_0077187d; LAB_0077186b: if (((*piVar7 & 0x7fffU) == 0x35) && (ReplaceTick != 0)) goto LAB_0077187d; LAB_0077188b: if (*piVar7 == 0) break; } uVar5 = uVar5 + 1; piVar7 = piVar7 + 1; } while (uVar5 < 2); sfxVolume = 1.0; if (ReplaceTick != 0) { uVar5 = 0; piVar7 = local_18; do { if (*piVar7 == 0x35) { pMStack_20 = g_manager; userIter = g_manager->_netplayManager; if (userIter == *(NetplayManager *)(g_manager + 1)) goto LAB_0077191b; userCount = (int)*(NetplayManager *)(g_manager + 1) - (int)userIter >> 2; local_18 = (int *)savedThis->_controllerIndex; uVar6 = 0; if (userCount == 0) goto LAB_0077191b; goto LAB_00771900; } uVar5 = uVar5 + 1; piVar7 = piVar7 + 1; } while (uVar5 < 2); } goto LAB_0077196b; while( true ) { uVar6 = uVar6 + 1; userIter = (NetplayManager)((int)userIter + 4); if (userCount <= uVar6) break; LAB_00771900: if (*(int **)(*(int *)userIter + 0xc) == local_18) { cVar3 = (**(code **)(*(int *)(*(int *)userIter + 0x370) + 0x14))(); if (cVar3 == '\0') { fStack_24 = (float)(g_manager->_optionsConfig)._onlinePlayerVolume * 0.1; goto LAB_00771923; } break; } } LAB_0077191b: fStack_24 = 1.0; LAB_00771923: pMVar2 = g_manager; pEStack_2c = (Entity_Pickup *)0x38f; seed_fart_sound_override((int *)&pEStack_2c); SoundEffects::Play(&pMVar2->_sfxManager,(int)pEStack_2c,fStack_24,2,0,1.0,0.0); uVar6 = uVar5; LAB_0077196b: player = savedThis; pEStack_2c = (Entity_Pickup *)0x0; droppedPickup = (Entity_Pickup *)0x0; if (uVar6 != 0xffffffff) { pMStack_20 = (Manager *)savedThis->_trinketsID[uVar6]; piVar7 = savedThis->_trinketsID + uVar6; local_18 = (int *)0x0; fStack_24 = (float)((uint)pMStack_20 & 0x7fff); if ((fStack_24 == 2.24208e-44) && (local_18 = (int *)GetTrinketMultiplier(savedThis,0x10), 3 < (int)local_18)) { local_18 = (int *)0x3; } for (; (pMVar2 = pMStack_20, uVar6 == 0 && (*piVar7 != 0)); piVar7 = piVar7 + 1) { uVar6 = 1; *piVar7 = piVar7[1]; } player->_trinketsID[uVar6] = 0; if (pMStack_20 == (Manager *)0x0) { droppedPickup = (Entity_Pickup *)0x0; } else { pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((int)fStack_24 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) { iVar4 = *(int *)((int)pvVar1 + (int)fStack_24 * 4); } else { iVar4 = 0; } player->_cacheFlags = player->_cacheFlags | *(uint *)(iVar4 + 0x54); if (player->_variant == 0) { uVar6 = Random(); pEStack_2c = (Entity_Pickup *) Game::SpawnEx(g_game,5,0x15e,DropPos,&g_vectorZero,(Entity *)player, (uint)pMVar2,uVar6,0); if (pEStack_2c != (Entity_Pickup *)0x0) { pEStack_2c->_collisionCooldown = 4; pEStack_2c->_isTouched = 1; } } TriggerTrinketRemoved(player,(uint)pMVar2); droppedTrinketType = fStack_24; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if (((int)fStack_24 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) && (VStack_10.x = *(float *)((int)pvVar1 + (int)fStack_24 * 4), (ItemConfig_Item *)VStack_10.x != (ItemConfig_Item *)0x0)) { if ((((ItemConfig_Item *)VStack_10.x)->addCostumeOnPickup == 0) && ((player->_temporaryeffects)._disabled == 0)) { for (piVar7 = (player->_temporaryeffects)._effects._begin; piVar7 != (player->_temporaryeffects)._effects._end; piVar7 = piVar7 + 4) { if ((*(int *)*piVar7 == 2) && ((Manager *)((int *)*piVar7)[1] == pMStack_20)) goto LAB_00771b15; } } RemoveCostume(player,(ItemConfig_Item *)VStack_10.x); } LAB_00771b15: if (droppedTrinketType == 1.70958e-43) { userIter = g_manager->_netplayManager; if (userIter != *(NetplayManager *)(g_manager + 1)) { VStack_10.x = (float)player->_controllerIndex; uVar6 = 0; uVar5 = (int)*(NetplayManager *)(g_manager + 1) - (int)userIter >> 2; if (uVar5 != 0) { do { player = savedThis; if (*(ItemConfig_Item **)(*(int *)userIter + 0xc) == (ItemConfig_Item *)VStack_10.x) { cVar3 = (**(code **)(*(int *)(*(int *)userIter + 0x370) + 0x14))(); if (cVar3 == '\0') { sfxVolume = (float)(g_manager->_optionsConfig)._onlinePlayerVolume * 0.1; } break; } uVar6 = uVar6 + 1; userIter = (NetplayManager)((int)userIter + 4); } while (uVar6 < uVar5); } } pMVar2 = g_manager; pMStack_20 = (Manager *)0x385; seed_fart_sound_override((int *)&pMStack_20); SoundEffects::Play(&pMVar2->_sfxManager,(int)pMStack_20,sfxVolume,2,0,1.0,0.0); } else if ((droppedTrinketType == 2.24208e-44) && (pvVar1 = g_game->_room, (*(byte *)(*(int *)((int)pvVar1 + 4) + 0x44) & 1) == 0)) { iVar4 = (int)(((pEStack_2c->_pos).x - 40.0) / 40.0 + 0.5); if ((iVar4 < 0) || (((gridWidth = *(int *)((int)pvVar1 + 0xc), gridWidth <= iVar4 || (gridY = (int)(((pEStack_2c->_pos).y - 120.0) / 40.0 + 0.5), gridY < 0)) || (*(int *)((int)pvVar1 + 0x10) <= gridY)))) { gridWidth = *(int *)((int)pvVar1 + 0xc); iVar4 = -1; } else { iVar4 = gridY * gridWidth + iVar4; } VStack_10.x = (float)(iVar4 % gridWidth) * 40.0 + 40.0; VStack_10.y = (float)(iVar4 / gridWidth) * 40.0 + 120.0; if (0 < (int)local_18) { uVar6 = 0; piVar7 = local_18; do { uVar5 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x1d,&VStack_10,&g_vectorZero,(Entity *)0x0,uVar6,uVar5,0 ); effect = (int *)__RTDynamicCast(spawnedEffect,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect:: RTTI_Type_Descriptor,0); effect[0xcd] = (int)VStack_10.x; effect[0xce] = (int)VStack_10.y; (**(code **)(*effect + 0xc))(); uVar6 = uVar6 + 0x1e; piVar7 = (int *)((int)piVar7 + -1); } while (piVar7 != (int *)0x0); } } droppedPickup = pEStack_2c; } } if (player->_cacheFlags != 0) { EvaluateItems(); } return droppedPickup; } //@@ 00771d30 Entity_Player::AddTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:AddTrinket prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddTrinket(Entity_Player *this,int type,byte firsttime) { ItemConfig_Item *collectibleID; Game *pGVar1; byte bVar2; char cVar3; int *piVar4; uint uVar5; void *pvVar6; uint uVar7; undefined4 uVar8; undefined4 uVar9; void *local_2c [4]; uint uStack_1c; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff10d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; pvVar6 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(type & 0x7fffU) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar6 >> 2) && (collectibleID = *(ItemConfig_Item **)((int)pvVar6 + (type & 0x7fffU) * 4), collectibleID != (ItemConfig_Item *)0x0)) { if (collectibleID->addCostumeOnPickup != 0) { AddCostume(this,collectibleID,0); } uVar7 = 1; bVar2 = HasCollectible(this,0x8b,0); if ((bVar2 != 0) || (bVar2 = HasCollectible(this,0x1ca,0), bVar2 != 0)) { uVar7 = 2; } uVar5 = 0; piVar4 = this->_trinketsID; do { if (*piVar4 == 0) { this->_cacheFlags = this->_cacheFlags | collectibleID->cacheFlags; this->_trinketsID[uVar5] = type; break; } uVar5 = uVar5 + 1; piVar4 = piVar4 + 1; } while (uVar5 < uVar7); ItemConfig_Item::GetLocalizedName(collectibleID,(std_string *)local_2c,0); local_8 = (void *)0x0; KAGE_LogMessage(1,(byte *)"Adding trinket %d (%s) to player %d (%s)\n"); local_8 = (void *)0xffffffff; if (0xf < uStack_18) { uVar7 = uStack_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar7) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar7 = uStack_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar7); } uStack_1c = 0; uStack_18 = 0xf; local_2c[0] = (void *)((uint)local_2c[0] & 0xffffff00); TriggerTrinketAdded(this,type,firsttime); if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { uVar9 = 0; uVar8 = 0x10; cVar3 = FUN_0072fec0(0x10,0); if ((cVar3 != '\0') && (uVar7 = FUN_0075f020(0x10,0,uVar8,uVar9), 2 < uVar7)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x16f); } InvalidateCoPlayerItems(this); } pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } if (this->_parent != (EntityPtr)0x0) { DropTrinket(this,&this->_pos,1); } } ExceptionList = local_10; return; } //@@ 00771f60 Entity_Player::TryRemoveTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:TryRemoveTrinket prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::TryRemoveTrinket(Entity_Player *this,uint id) { byte bVar1; int iVar2; uint uVar3; uint uVar4; void *pvVar5; int *piVar6; int *piVar7; int *local_30; void *trinketName [5]; uint trinketNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; Entity_Player *procItemOwner; ItemConfig_Item *queuedItem; ItemConfig_Item *trinketConfig; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(trinketName + 10); ExceptionList = &local_10; uVar3 = id & 0x7fff; pvVar5 = (g_manager->_itemConfig)._trinkets._begin; if (((int)uVar3 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar5 >> 2) && (trinketConfig = *(ItemConfig_Item **)((int)pvVar5 + uVar3 * 4), trinketConfig != (ItemConfig_Item *)0x0)) { if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { InvalidateCoPlayerItems(this); } queuedItem = (this->_queuedItem)._item; if ((queuedItem != (ItemConfig_Item *)0x0) && (queuedItem == trinketConfig)) { ClearQueueItem(this); ExceptionList = local_10; return 1; } piVar7 = (int *)0x1; local_30 = (int *)0x1; bVar1 = HasCollectible(this,0x8b,0); if ((bVar1 != 0) || (bVar1 = HasCollectible(this,0x1ca,0), bVar1 != 0)) { piVar7 = (int *)0x2; local_30 = (int *)0x2; } uVar4 = 0; piVar6 = this->_trinketsID; do { if ((*piVar6 == id) || ((*piVar6 & 0x7fffU) == id)) { if (uVar4 < (int)piVar7 - 1U) { iVar2 = ((int)piVar7 - 1U) - uVar4; piVar7 = this->_trinketsID + uVar4 + 1; piVar6 = this->_trinketsID + uVar4; for (; iVar2 != 0; iVar2 = iVar2 + -1) { *piVar6 = *piVar7; piVar7 = piVar7 + 1; piVar6 = piVar6 + 1; } piVar7 = local_30; } this->_trinketsID[(int)piVar7 - 1] = 0; ItemConfig_Item::GetLocalizedName(trinketConfig,(std_string *)trinketName,0); local_8 = (void *)0x0; KAGE_LogMessage(1,(byte *)"Removing trinket %d (%s) from player %d (%s)\n"); local_8 = (void *)0xffffffff; if (0xf < trinketNameCapacity) { uVar4 = trinketNameCapacity + 1; pvVar5 = trinketName[0]; if (0xfff < uVar4) { pvVar5 = *(void **)((int)trinketName[0] + -4); uVar4 = trinketNameCapacity + 0x24; if (0x1f < (uint)((int)trinketName[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar4); } TriggerTrinketRemoved(this,id); pvVar5 = (g_manager->_itemConfig)._trinkets._begin; if (((int)uVar3 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar5 >> 2) && (trinketConfig = *(ItemConfig_Item **)((int)pvVar5 + uVar3 * 4), trinketConfig != (ItemConfig_Item *)0x0)) { if ((trinketConfig->addCostumeOnPickup == 0) && ((this->_temporaryeffects)._disabled == 0) ) { for (piVar7 = (this->_temporaryeffects)._effects._begin; piVar7 != (this->_temporaryeffects)._effects._end; piVar7 = piVar7 + 4) { if ((*(int *)*piVar7 == 2) && (((int *)*piVar7)[1] == id)) { ExceptionList = local_10; return 1; } } } RemoveCostume(this,trinketConfig); } ExceptionList = local_10; return 1; } uVar4 = uVar4 + 1; piVar6 = piVar6 + 1; } while (uVar4 < piVar7); if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { bVar1 = TryRemoveSmeltedTrinket(this,id); ExceptionList = local_10; return bVar1; } piVar7 = (this->_proceduralItems)._itemIds._head; local_30 = (int *)*piVar7; if (local_30 != piVar7) { do { uVar3 = ~local_30[4]; if ((local_30[4] < 0) && ((int)uVar3 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)(g_game->_proceduralItemManager)._proceduralItems._begin >> 2)) { piVar7 = (this->_proceduralItems)._itemIds._head; iVar2 = *(int *)((int)(g_game->_proceduralItemManager)._proceduralItems._begin + uVar3 * 4 ); if ((iVar2 != 0) && (((piVar6 = *(int **)(iVar2 + 0x10), piVar6 != (int *)0x0 && (*piVar6 == 2)) && (piVar6[1] == id)))) { if (local_30[4] == 0) { ExceptionList = local_10; return 0; } procItemOwner = (this->_proceduralItems)._player; if (procItemOwner == (Entity_Player *)0x0) { ExceptionList = local_10; return 0; } RemoveCollectible(procItemOwner,local_30[4],0,0,1); ExceptionList = local_10; return 1; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_30); } while (local_30 != piVar7); } } ExceptionList = local_10; return 0; } //@@ 00772260 Entity_Player::TryRemoveSmeltedTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "Removing smelted trinket %d (%s) from player %d (%s)" prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::TryRemoveSmeltedTrinket(Entity_Player *this,uint id) { byte isRemoved; void *pvVar1; uint uVar2; uint trinketID; int historyEntry; void *local_30; uint uStack_2c; char acStack_28 [12]; uint uStack_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; short *smeltedCount; std_vector *smeltedTrinkets; ItemConfig_Item *trinketConfig; local_8 = 0xffffffff; puStack_c = &LAB_00aff155; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(acStack_28 + 0x24); ExceptionList = &local_10; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { InvalidateCoPlayerItems(this); } trinketID = id & 0x7fff; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if (((int)trinketID < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) && (trinketConfig = *(ItemConfig_Item **)((int)pvVar1 + trinketID * 4), trinketConfig != (ItemConfig_Item *)0x0)) { smeltedTrinkets = &this->_smeltedTrinkets; if (((id >> 0xf & 1) == 0) && (0 < *(short *)((int)smeltedTrinkets->_begin + trinketID * 4))) { ItemConfig_Item::GetLocalizedName(trinketConfig,(std_string *)&local_30,0); local_8 = 0; KAGE_LogMessage(1,(byte *)"Removing smelted trinket %d (%s) from player %d (%s)\n"); local_8 = 0xffffffff; if (0xf < uStack_1c) { uVar2 = uStack_1c + 1; pvVar1 = local_30; if (0xfff < uVar2) { pvVar1 = *(void **)((int)local_30 + -4); uVar2 = uStack_1c + 0x24; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,uVar2); } smeltedCount = (short *)(trinketID * 4 + (int)smeltedTrinkets->_begin); *smeltedCount = *smeltedCount + -1; TriggerTrinketRemoved(this,trinketID); local_30 = (void *)CONCAT31(local_30._1_3_,'\x01'); historyEntry = g_game->_frameCount; acStack_28[0] = '\x01'; acStack_28[1] = '\0'; acStack_28[2] = '\0'; acStack_28[3] = '\0'; acStack_28[4] = '\0'; acStack_28[5] = '\0'; acStack_28[6] = '\0'; acStack_28[7] = '\0'; acStack_28[8] = '\x01'; acStack_28[9] = '\0'; acStack_28[10] = '\0'; acStack_28[0xb] = '\0'; uStack_1c = 0; uStack_2c = trinketID; FUN_00721b70(&historyEntry); } else { if (*(short *)((int)smeltedTrinkets->_begin + trinketID * 4 + 2) < 1) goto LAB_00772509; ItemConfig_Item::GetLocalizedName(trinketConfig,(std_string *)&local_30,0); local_8 = 1; KAGE_LogMessage(1,(byte *)"Removing smelted trinket %d (%s) from player %d (%s)\n"); local_8 = 0xffffffff; if (0xf < uStack_1c) { uVar2 = uStack_1c + 1; pvVar1 = local_30; if (0xfff < uVar2) { pvVar1 = *(void **)((int)local_30 + -4); uVar2 = uStack_1c + 0x24; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,uVar2); } smeltedCount = (short *)((int)smeltedTrinkets->_begin + trinketID * 4 + 2); *smeltedCount = *smeltedCount + -1; TriggerTrinketRemoved(this,trinketID | 0x8000); local_30 = (void *)CONCAT31(local_30._1_3_,'\x01'); historyEntry = g_game->_frameCount; acStack_28[0] = '\x01'; acStack_28[1] = '\0'; acStack_28[2] = '\0'; acStack_28[3] = '\0'; acStack_28[4] = '\0'; acStack_28[5] = '\0'; acStack_28[6] = '\0'; acStack_28[7] = '\0'; acStack_28[8] = '\x01'; acStack_28[9] = '\0'; acStack_28[10] = '\0'; acStack_28[0xb] = '\0'; uStack_1c = 0; uStack_2c = trinketID | 0x8000; FUN_00721b70(&historyEntry); } if ((*(short *)((int)smeltedTrinkets->_begin + trinketID * 4) < 1) && (*(short *)((int)smeltedTrinkets->_begin + trinketID * 4 + 2) < 1)) { TryRemoveTrinketCostume(this,trinketID); } isRemoved = 1; } else { KAGE_LogMessage(4,(byte *)"Tried to remove smelted trinket with invalid trinket type (%d) \n"); LAB_00772509: isRemoved = 0; } ExceptionList = local_10; return isRemoved; } //@@ 00772530 Entity_Player::replace_trinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Entity_Player (checks _variant/_isCoopGhost), logs "Replacing (smelted) trinket %d (%s) from player %d (%s) with trinket %d (%s)", TriggerTrinketRemoved/Added, costumes; called from Entity_Pickup::HandleCollision for golden Store Credit (trinket 0xd) with RandomInt(4)==0 prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Entity_Player::replace_trinket(Entity_Player *this,int unused0,int unused1,int unused2) { ItemConfig_Item *pIVar1; byte bVar2; uint index; int *piVar3; void *pvVar4; short *smeltedGoldenCount; uint index; ItemConfig_Item *storeCredit; void *oldName [5]; uint oldNameCapacity; void *newName [4]; uint newNameSize; uint newNameCapacity; void *smeltedOldName [4]; uint smeltedOldNameSize; uint smeltedOldNameCapacity; void *smeltedNewName [4]; uint smeltedNewNameSize; uint smeltedNewNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; short goldenCount; short *smeltedCount; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff1a5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(smeltedNewName + 10); ExceptionList = &local_10; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { InvalidateCoPlayerItems(this); } pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 >> 2 < 0xe) { storeCredit = (ItemConfig_Item *)0x0; } else { storeCredit = *(ItemConfig_Item **)((int)pvVar4 + 0x34); } pIVar1 = (this->_queuedItem)._item; if (((pIVar1 == (ItemConfig_Item *)0x0) || (pIVar1 != storeCredit)) || (bVar2 = (this->_queuedItem)._flags, (bVar2 & 2) == 0)) { index = 1; bVar2 = HasCollectible(this,0x8b,0); if ((bVar2 != 0) || (bVar2 = HasCollectible(this,0x1ca,0), bVar2 != 0)) { index = 2; } index = 0; piVar3 = this->_trinketsID; do { if (*piVar3 == 0x800d) { this->_trinketsID[index] = 0xd; ItemConfig_Item::GetLocalizedName(storeCredit,(std_string *)oldName,0); local_8 = (void *)0x0; ItemConfig_Item::GetLocalizedName(storeCredit,(std_string *)newName,0); local_8._0_1_ = 1; KAGE_LogMessage(1,(byte *) "Replacing trinket %d (%s) from player %d (%s) with trinket %d (%s)\n"); local_8 = (void *)((uint)local_8._1_3_ << 8); if (0xf < newNameCapacity) { index = newNameCapacity + 1; pvVar4 = newName[0]; if (0xfff < index) { pvVar4 = *(void **)((int)newName[0] + -4); index = newNameCapacity + 0x24; if (0x1f < (uint)((int)newName[0] + (-4 - (int)pvVar4))) goto LAB_00772920; } operator_delete(pvVar4,index); } local_8 = (void *)0xffffffff; newNameSize = 0; newNameCapacity = 0xf; newName[0] = (void *)((uint)newName[0] & 0xffffff00); if (0xf < oldNameCapacity) { index = oldNameCapacity + 1; pvVar4 = oldName[0]; if (0xfff < index) { pvVar4 = *(void **)((int)oldName[0] + -4); index = oldNameCapacity + 0x24; if (0x1f < (uint)((int)oldName[0] + (-4 - (int)pvVar4))) { LAB_00772920: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,index); } TriggerTrinketRemoved(this,0x800d); pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if (((0x34 < (int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 & 0xfffffffcU) ) && (pIVar1 = *(ItemConfig_Item **)((int)pvVar4 + 0x34), pIVar1 != (ItemConfig_Item *)0x0)) && ((pIVar1->addCostumeOnPickup != 0 || (bVar2 = TemporaryEffects::HasTrinketEffect(&this->_temporaryeffects,0x800d), bVar2 == 0 )))) { RemoveCostume(this,pIVar1); } TriggerTrinketAdded(this,0xd,0); if (storeCredit->addCostumeOnPickup != 0) { AddCostume(this,storeCredit,0); } goto LAB_007729a1; } index = index + 1; piVar3 = piVar3 + 1; } while (index < index); if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { pvVar4 = (this->_history)._historyItems._begin; index = 0; index = ((int)(this->_history)._historyItems._end - (int)pvVar4) / 0x1c; if (index != 0) { piVar3 = (int *)((int)pvVar4 + 8); do { if (((char)piVar3[-1] != '\0') && (*piVar3 == 0x800d)) { smeltedGoldenCount = (short *)((int)(this->_smeltedTrinkets)._begin + storeCredit->id * 4 + 2); smeltedCount = (short *)((int)(this->_smeltedTrinkets)._begin + storeCredit->id * 4); *(undefined4 *)((int)pvVar4 + index * 0x1c + 8) = 0xd; goldenCount = *smeltedGoldenCount; if (0 < goldenCount) { *smeltedGoldenCount = goldenCount + -1; TriggerTrinketRemoved(this,0x800d); pvVar4 = (this->_smeltedTrinkets)._begin; if ((*(short *)((int)pvVar4 + storeCredit->id * 4) < 1) && (*(short *)((int)pvVar4 + storeCredit->id * 4 + 2) < 1)) { TryRemoveTrinketCostume(this,0x800d); } *smeltedCount = *smeltedCount + 1; TriggerTrinketAdded(this,0xd,0); if (storeCredit->addCostumeOnPickup != 0) { AddCostume(this,storeCredit,0); } } ItemConfig_Item::GetLocalizedName(storeCredit,(std_string *)smeltedOldName,0); local_8 = (void *)0x2; ItemConfig_Item::GetLocalizedName(storeCredit,(std_string *)smeltedNewName,0); local_8._0_1_ = 3; KAGE_LogMessage(1,(byte *) "Replacing smelted trinket %d (%s) from player %d (%s) with trinket %d (%s)\n" ); local_8 = (void *)CONCAT31(local_8._1_3_,2); if (0xf < smeltedNewNameCapacity) { index = smeltedNewNameCapacity + 1; pvVar4 = smeltedNewName[0]; if (0xfff < index) { pvVar4 = *(void **)((int)smeltedNewName[0] + -4); index = smeltedNewNameCapacity + 0x24; if (0x1f < (uint)((int)smeltedNewName[0] + (-4 - (int)pvVar4))) goto LAB_007727f2; } operator_delete(pvVar4,index); } local_8 = (void *)0xffffffff; smeltedNewNameSize = 0; smeltedNewNameCapacity = 0xf; smeltedNewName[0] = (void *)((uint)smeltedNewName[0] & 0xffffff00); if (0xf < smeltedOldNameCapacity) { index = smeltedOldNameCapacity + 1; pvVar4 = smeltedOldName[0]; if (0xfff < index) { pvVar4 = *(void **)((int)smeltedOldName[0] + -4); index = smeltedOldNameCapacity + 0x24; if (0x1f < (uint)((int)smeltedOldName[0] + (-4 - (int)pvVar4))) { LAB_007727f2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,index); } smeltedOldNameSize = 0; smeltedOldNameCapacity = 0xf; smeltedOldName[0] = (void *)((uint)smeltedOldName[0] & 0xffffff00); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); goto LAB_007729a1; } index = index + 1; piVar3 = piVar3 + 7; } while (index < index); } } bVar2 = 0; } else { (this->_queuedItem)._item = storeCredit; (this->_queuedItem)._flags = bVar2 & 0xfd; LAB_007729a1: bVar2 = 1; } ExceptionList = local_10; return bVar2; } //@@ 007729d0 Entity_Player::TakeDamage /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: Entity_Player vtable slot 8 (TakeDamage), 25 KB */ undefined4 __thiscall Entity_Player::TakeDamage (Entity_Player *this,Entity_Player *param_2,uint param_3,float param_4,EntityRef *param_5, int param_6) { void **ppvVar1; char *pcVar2; code *pcVar3; EntityRef source; Vector velocity; RNG rng; void *pvVar4; qword qVar5; EntityRef *pEVar6; byte bVar7; char cVar8; undefined4 uVar9; int iVar10; Entity *spawnedEffect; Entity_Player *pEVar11; Vector *pVVar12; Entity_Bomb *bomb; float *pfVar13; Vector *pVVar14; Entity_Projectile *projectile; RNG *itemRng; Entity_Tear *tear; BitSet128 *pBVar15; Level *pLVar16; ItemConfig *itemConfig; ItemConfig_Item *itemConfigEntry; int *piVar17; Entity_Effect *effect; ColorMod *color; ItemOverlay *itemOverlay; EntityList *spawnedEffect; undefined4 *puVar18; uint uVar19; EntityConfig *entityConfig; EntityConfig_Entity *entityConfigEntry; ANM2 *sprite; Sprite *projectile; Room *room; uint *puVar20; PersistentGameData *pPVar21; Entity_Familiar *pEVar22; undefined1 *puVar23; int *piVar24; TemporaryEffects *pTVar25; ColorModState *color_00; ColorMod *color_01; RNG *this_02; ItemPool *itemPool; PlayerManager *playerManager; uint uVar26; EntityPtr EVar27; float fVar28; EntityRef *pEVar29; undefined1 *puVar30; Entity_Familiar *id; Entity_Player *pEVar31; bool bVar32; float10 fVar33; Entity_Player *in_XMM0_Da; ulonglong timeMs; Vector VVar34; float fVar35; EntityRef aEStackY_15ac [128]; undefined4 in_stack_fffffe7c; undefined4 in_stack_fffffe80; undefined4 in_stack_fffffe84; undefined4 in_stack_fffffe88; undefined4 in_stack_fffffe8c; uint variant; void *in_stack_fffffe90; undefined4 in_stack_fffffe94; int iVar36; undefined4 uVar37; void *pvVar38; BitSet128 *b; Entity *pEVar39; int iVar40; Vector local_150; Vector local_148; Vector VStack_140; Vector local_138; undefined4 local_130; EntityRef *damageSource; byte local_125; uint damageFlags; Vector local_120; Entity_Player *local_118; char isPenalized; Vector VStack_110; char local_107; byte local_106; bool local_105; float local_104; Entity_Player *local_100; RNG local_fc [4]; Entity_Player *local_bc; undefined1 local_b4 [4]; undefined1 local_b0 [12]; float local_a4 [8]; char local_84 [8]; BitSet128 local_7c; undefined1 local_6c [24]; EntityList_EL local_54; char local_44 [8]; undefined1 local_3c [12]; float local_30; char local_2c [8]; undefined1 local_24 [12]; Entity *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; BitSet128 *extraTearFlags; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00aff27a; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; damageFlags = param_3; local_148.y = param_4; damageSource = param_5; local_130 = this; if (((this->_playerType == 0x28) && (this->_twinPlayer != (EntityPtr)0x0)) && (bVar7 = HasCollectible((Entity_Player *)this->_twinPlayer,0x114,0), bVar7 == 0)) { if ((this->_playerType == 0x28) && (*(int *)((int)this->_twinPlayer + 0x1600) == 0x160)) { ANM2::Reset((ANM2 *)((int)this->_twinPlayer + 0x41c)); } uVar9 = (**(code **)(*(int *)this->_twinPlayer + 0x20))(); ExceptionList = local_10; return uVar9; } if (param_5->_type == 0x3c6) { in_stack_fffffe94 = 0; in_stack_fffffe90 = param_5->_entity; in_stack_fffffe8c = 0x772ab8; iVar10 = __RTDynamicCast(); if (iVar10 != 0) { in_stack_fffffe94 = 0; in_stack_fffffe90 = *(void **)(iVar10 + 0x3c4); in_stack_fffffe8c = 0x772ad8; iVar10 = __RTDynamicCast(); if ((iVar10 != 0) && (*(int *)(iVar10 + 0xef0) - 1U < 0x1d)) { ExceptionList = local_10; return 0; } } } if (param_5->_type == 3) { in_stack_fffffe94 = 0; in_stack_fffffe90 = param_5->_entity; in_stack_fffffe8c = 0x772b0a; iVar10 = __RTDynamicCast(); if ((iVar10 != 0) && (*(int *)(iVar10 + 0xef0) - 1U < 0x1d)) { ExceptionList = local_10; return 0; } } cVar8 = FUN_007c7b10(); if (cVar8 != '\0') { ExceptionList = local_10; return 0; } if ((param_5->_type == 0x21) && (param_5->_variant == 4)) { switch(this->_playerType) { case 10: case 0x1f: case 0x28: ExceptionList = local_10; return 0; } bVar7 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x70); if (bVar7 != 0) { ExceptionList = local_10; return 0; } if (this->_playerType == 0x27) { ExceptionList = local_10; return 0; } if ((param_5->_type == 0x21) && (param_5->_variant == 4)) { if (this->_dead != 0) { ExceptionList = local_10; return 0; } spawn_ghost_corpse(); bVar7 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x70); if (bVar7 == 0) { PlayerManager::add_lost_curse(); } manager = g_manager; local_100 = (Entity_Player *)0x2b; seed_fart_sound_override((int *)&local_100); SoundEffects::Play(&manager->_sfxManager,(int)local_100,1.0,2,0,1.0,0.0); if ((g_manager->_optionsConfig)._enableRumble == 0) { ExceptionList = local_10; return 1; } local_120.y = 0.6; local_100 = (Entity_Player *)0x3f99999a; (**(code **)(PTR_vftable_00c57b18 + 0x74))(); ExceptionList = local_10; return 1; } } bVar7 = IsHologram(this); if (bVar7 != 0) { ExceptionList = local_10; return 0; } if (((param_5->_type == 1000) && (param_5->_variant == 0x13)) && (param_5->_spawnerType == 1)) { ExceptionList = local_10; return 0; } uVar26 = param_5->_flags & 2; if (*(int *)&g_game->_deathmatchManager < 2) { if (uVar26 != 0) { ExceptionList = local_10; return 0; } } else if (uVar26 != 0) { local_100 = param_5->_entity; if (local_100 == (Entity_Player *)0x0) { ExceptionList = local_10; return 0; } EntityRef::constructor((EntityRef *)(local_b0 + 4),(Entity *)this); bVar7 = Entity::IsDamageSourceFriendly((Entity *)local_100,(EntityRef *)(local_b0 + 4)); if (bVar7 != 0) { ExceptionList = local_10; return 0; } } if (((uint)param_4 & 4) != 0) { ExceptionList = local_10; return 0; } pEVar11 = param_5->_entity; if (((((pEVar11 != (Entity_Player *)0x0) && (pEVar11->_type == 0x362)) && ((EVar27 = this->_darkEsau, (EntityPtr)pEVar11 != EVar27 && ((pEVar11->_parent != EVar27 || (EVar27 == (EntityPtr)0x0)))))) && ((pEVar11->_child != EVar27 || (EVar27 == (EntityPtr)0x0)))) && ((pEVar11->_spawnerEntity != (EntityPtr)this && (pEVar11->_spawnerEntity != EVar27)))) { ExceptionList = local_10; return 0; } if (this->_dead != 0) { ExceptionList = local_10; return 0; } if ((this->_playerType != 0x28) || (EVar27 = this->_twinPlayer, this->_twinPlayer == (EntityPtr)0x0)) { EVar27 = (EntityPtr)this; } pvVar38 = (void *)0x0; uVar37 = 0x114; uVar9 = 0x772d84; bVar7 = HasCollectible((Entity_Player *)EVar27,0x114,0); if (((bVar7 != 0) || (this->_playerType == 0x23)) && ((damageFlags & 0x2820) == 0)) { ExceptionList = local_10; return 0; } EntityRef::constructor(aEStackY_15ac + 0x81,param_5->_entity); source._variant = in_stack_fffffe80; source._type = in_stack_fffffe7c; source._spawnerType = in_stack_fffffe84; source._spawnerVariant = in_stack_fffffe88; source._position.x = (float)in_stack_fffffe8c; source._position.y = (float)in_stack_fffffe90; source._velocity.x = (float)in_stack_fffffe94; source._velocity.y = (float)uVar9; source._flags = uVar37; source._entity = pvVar38; bVar7 = is_evil_charm_immune(this,source); if (bVar7 != 0) { ExceptionList = local_10; return 0; } if ((this->_variant == 1) || (this->_isCoopGhost != 0)) { bVar7 = ANM2::IsPlaying(&this->_sprite,(byte *)"Appear"); if (bVar7 != 0) { ExceptionList = local_10; return 0; } bVar7 = ANM2::IsPlaying(&this->_sprite,(byte *)"Glitch"); if (bVar7 != 0) { ExceptionList = local_10; return 0; } } if (((param_5->_type == 0x387) && (param_5->_variant == 10)) && (pvVar38 = param_5->_entity, pvVar38 != (void *)0x0)) { for (pvVar4 = *(void **)((int)pvVar38 + 0x3c0); ((pvVar4 != (void *)0x0 && (*(int *)((int)pvVar4 + 0x28) == 0x387)) && (*(int *)((int)pvVar4 + 0x2c) == 10)); pvVar4 = *(void **)((int)pvVar4 + 0x3c0)) { pvVar38 = pvVar4; } if (*(Entity_Player **)((int)pvVar38 + 0x3c4) == this) { ExceptionList = local_10; return 0; } } local_118 = (Entity_Player *)&this->_pos; VStack_110.y = (float)find_nearest_enemy(); if ((Entity *)VStack_110.y != (Entity *)0x0) { pcVar3 = *(code **)(*(uint *)VStack_110.y + 0x20); EntityRef::constructor((EntityRef *)(local_b0 + 4),(Entity *)0x0); (*pcVar3)(); manager = g_manager; local_100 = (Entity_Player *)0x1f5; seed_fart_sound_override((int *)&local_100); SoundEffects::Play(&manager->_sfxManager,(int)local_100,1.0,10,0,1.0,0.0); if (this->_hitEffect != (EntityPtr)0x0) { (**(code **)(*(int *)this->_hitEffect + 0x28))(); } uVar26 = Random(); spawnedEffect = Game::Spawn(g_game,1000,0xa0,&this->_pos,&g_vectorZero,(Entity *)VStack_110.y,0,uVar26); Entity::SetParent(spawnedEffect,(Entity *)VStack_110.y); Entity::SetTarget(spawnedEffect,(Entity *)this); spawnedEffect[1]._sprite._filename._capacity = 0; pEVar39 = spawnedEffect + 1; (pEVar39->_sprite)._animDefaultName._buf[0] = '\0'; (pEVar39->_sprite)._animDefaultName._buf[1] = '\0'; (pEVar39->_sprite)._animDefaultName._buf[2] = -0x40; (pEVar39->_sprite)._animDefaultName._buf[3] = -0x3f; fVar35 = (this->_posOffset).y; (spawnedEffect->_posOffset).x = (this->_posOffset).x + 0.0; (spawnedEffect->_posOffset).y = fVar35 - 24.0; (**(code **)(*(int *)spawnedEffect + 0xc))(); FUN_004cf380(); ExceptionList = local_10; return 0; } bVar7 = HasTrinket(this,0x6c,0); if ((bVar7 != 0) && ((damageFlags & 4) != 0)) { pvVar38 = (this->_trinketRNGs)._begin; RNG::Next((RNG *)((int)pvVar38 + 0x6c0)); if (*(uint *)((int)pvVar38 + 0x6c0) % 100 < 0x21) { pEVar11 = (Entity_Player *)GetTrinketMultiplier(this,0x6c); VStack_110.y = (float)&DAT_00b6bcc0; local_120.y = (float)pEVar11; do { if (0 < (int)pEVar11) { local_100 = pEVar11; do { uVar26 = RNG::Next((RNG *)((int)(this->_trinketRNGs)._begin + 0x6c0)); pVVar12 = Room::FindFreePickupSpawnPosition (g_game->_room,&local_148,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,*(uint *)VStack_110.y,pVVar12,&g_vectorZero,(Entity *)this,0,uVar26 ); local_100 = (Entity_Player *)((int)&local_100[-1]._replacedPlayer + 3); } while (local_100 != (Entity_Player *)0x0); local_100 = (Entity_Player *)0x0; pEVar11 = (Entity_Player *)local_120.y; } VStack_110.y = (float)((int)VStack_110.y + 4); } while ((int)VStack_110.y < 0xb6bcd0); TryRemoveTrinket(this,0x6c); } param_5 = damageSource; } bVar7 = HasCollectible(this,0xdf,0); if (bVar7 != 0) { if ((damageFlags & 2) != 0) { ExceptionList = local_10; return 0; } VStack_110.y = (float)(damageFlags & 4); if (VStack_110.y != 0.0) { iVar10 = GetEffectiveMaxHearts(this); if (this->_redHearts < iVar10) { uVar26 = Random(); Game::Spawn(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar26); iVar10 = __RTDynamicCast(); *(undefined4 *)(iVar10 + 0xdc) = 0; *(undefined4 *)(iVar10 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar10 + 0x358) = 0x3f800000; AddHearts(this,1,0,0); ExceptionList = local_10; return 0; } ExceptionList = local_10; return 0; } } VStack_110.y = (float)(damageFlags & 4); bVar7 = HasCollectible(this,0x177,0); if ((bVar7 != 0) && ((Entity_Player *)VStack_110.y != (Entity_Player *)0x0)) { std::string::string_from_cstr(local_84,(byte *)"GuardDown"); local_8 = 0; std::string::string_from_cstr(local_44,(byte *)"GuardRight"); local_8._0_1_ = 1; std::string::string_from_cstr(local_2c,(byte *)"GuardUp"); local_8._0_1_ = 2; std::string::string_from_cstr(local_6c + 0x10,(byte *)"GuardLeft"); local_8._0_1_ = 3; pVVar12 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_148,this->_headDirection); pvVar38 = string_from_direction (local_a4 + 2,*pVVar12,local_6c + 0x10,local_2c,local_44,local_84); local_8 = CONCAT31(local_8._1_3_,4); goto LAB_0077321a; } bVar7 = HasWeaponType(this,5); if ((((bVar7 != 0) || ((bVar7 = HasWeaponType(this,10), bVar7 != 0 && (bVar7 = HasCollectible(this,0x34,0), bVar7 != 0)))) && (bVar7 = HasCollectible(this,0x95,0), bVar7 != 0)) && (((Entity_Player *)VStack_110.y != (Entity_Player *)0x0 && ((((param_5->_spawnerType == 1 || (param_5->_spawnerType == 3)) && (bomb = (Entity_Bomb *)__RTDynamicCast(), bomb != (Entity_Bomb *)0x0)) && (cVar8 = Entity_Bomb::IsFetus(bomb), cVar8 != '\0')))))) { ExceptionList = local_10; return 0; } bVar7 = HasWeaponType(this,10); if (((bVar7 != 0) && (bVar7 = HasCollectible(this,0x95,0), bVar7 != 0)) && (((Entity_Player *)VStack_110.y != (Entity_Player *)0x0 && (param_5->_type == 8)))) { ExceptionList = local_10; return 0; } bVar7 = HasCollectible(this,0x100,0); if ((bVar7 != 0) && ((damageFlags & 2) != 0)) { ExceptionList = local_10; return 0; } if (((this->_variant == 1) && (this->_babySkin == 0x14)) && ((Entity_Player *)VStack_110.y != (Entity_Player *)0x0)) { ExceptionList = local_10; return 0; } bVar7 = HasCollectible(this,0x2b2,0); if ((bVar7 == 0) || ((damageFlags & 0x2200000) != 0)) { LAB_007737e8: pEVar29 = damageSource; this = this; } else { if ((param_5->_entity == (void *)0x0) || (((iVar10 = param_5->_type, iVar10 < 10 || (999 < iVar10)) && ((iVar10 != 9 && (iVar10 != 1)))))) { local_105 = false; } else { local_105 = true; } Game::GetField26614(g_game); cVar8 = FUN_00429560(); iVar10 = Isaac::Random(2 - (uint)(cVar8 != '\0')); if ((iVar10 != 0) || (local_105 == false)) goto LAB_007737e8; bVar7 = Entity::is_player(param_5->_entity); if (bVar7 == 0) { bVar7 = Entity::IsEnemy(param_5->_entity); if (bVar7 == 0) { bVar7 = Entity::IsProjectile(param_5->_entity); if ((bVar7 == 0) && (bVar7 = Entity::IsTear(param_5->_entity), bVar7 == 0)) goto LAB_007737e8; pVVar12 = Entity::Position(param_5->_entity,(Vector *)(local_24 + 8)); pVVar12 = Vector::__sub(pVVar12,(Vector *)(local_3c + 8),&this->_pos); Vector::Resized(pVVar12,&local_148,10.0); local_100 = (Entity_Player *)__RTDynamicCast(); projectile = (Entity_Projectile *)__RTDynamicCast(); if (local_100 != (Entity_Player *)0x0) { Entity_Projectile::Reflect((Entity_Projectile *)local_100,(Entity *)this,&local_148); } if (projectile != (Entity_Projectile *)0x0) { Entity_Projectile::Deflect(projectile,(Entity *)this,&local_148); } fVar35 = 0.8; fVar28 = 1.25; this->_jellyBellyBounceTimer = 14.0; iVar10 = 3; } else { pVVar12 = Entity::Position(param_5->_entity,(Vector *)(local_24 + 8)); iVar10 = FUN_00417350(); local_100 = (Entity_Player *)(iVar10 + 4); FUN_00417350(); local_138.y = Vector::Distance(pVVar12,(Vector *)local_118); pEVar29 = damageSource; FUN_00417340(); local_120.y = (float)in_XMM0_Da; pfVar13 = (float *)std::max(); this = local_130; if (local_120.y * *pfVar13 + local_130->_size + 10.0 < local_138.y) goto LAB_007737ee; pVVar12 = Entity::Position(pEVar29->_entity,(Vector *)(local_24 + 8)); pVVar12 = Vector::__sub(pVVar12,(Vector *)(local_3c + 8),&this->_pos); Vector::Resized(pVVar12,&local_148,20.0); pEVar39 = pEVar29->_entity; EntityRef::constructor((EntityRef *)(local_b0 + 4),(Entity *)this); Entity::AddKnockback(pEVar39,(EntityRef *)(local_b0 + 4),&local_148,0xf,1); fVar35 = 1.0; fVar28 = 1.0; this->_jellyBellyBounceTimer = 20.0; iVar10 = 0x24c; } play_sound_with_fart_seed(iVar10,fVar35,2,0,fVar28); SetMinDamageCooldown(this); goto LAB_007736fb; } bVar7 = Entity::HasEntityFlags(param_5->_entity,0x800000000000); if (bVar7 != 0) goto LAB_007737e8; pVVar12 = Entity::Position(param_5->_entity,&local_148); iVar10 = FUN_00417350(); local_100 = (Entity_Player *)(iVar10 + 4); FUN_00417350(); local_138.y = Vector::Distance(pVVar12,(Vector *)local_118); pEVar29 = damageSource; FUN_00417340(); local_120.y = (float)in_XMM0_Da; pfVar13 = (float *)std::max(); pEVar6 = damageSource; this = local_130; if (local_138.y <= local_120.y * *pfVar13 + local_130->_size + 10.0) { pVVar12 = &local_130->_velocity; pVVar14 = Entity::Velocity(damageSource->_entity,&local_148); local_100 = (Entity_Player *)Vector::LengthSquared(pVVar14); fVar35 = Vector::LengthSquared(pVVar12); local_100 = (Entity_Player *)(fVar35 + (float)local_100); fVar35 = (float)local_100 / 25.0; FUN_00a15550(); local_120.y = fVar35 * 40.0; fVar35 = Vector::LengthSquared(pVVar12); pEVar39 = pEVar6->_entity; local_138.y = (fVar35 / (float)local_100) * local_120.y; pVVar12 = Entity::Position(pEVar39,&local_148); pVVar12 = Vector::__sub(pVVar12,(Vector *)(local_24 + 8),(Vector *)local_118); pVVar12 = Vector::Normalized(pVVar12,(Vector *)(local_3c + 8)); pVVar12 = Vector::__mul(pVVar12,(Vector *)&local_7c._h,&local_138.y); EntityRef::constructor((EntityRef *)(local_b0 + 4),(Entity *)local_130); Entity::AddKnockback(pEVar39,(EntityRef *)(local_b0 + 4),pVVar12,1,1); pEVar11 = local_130; local_130->_jellyBellyBounceTimer = 20.0; play_sound_with_fart_seed(0x24c,1.0,2,0,1.0); SetMinDamageCooldown(pEVar11); qVar5 = pEVar11->_flags; puVar20 = (uint *)((int)&pEVar11->_flags + 4); *puVar20 = *puVar20 | 0x10; *(int *)&pEVar11->_flags = (int)qVar5; ExceptionList = local_10; return 0; } } LAB_007737ee: Game::GetField26614(g_game); cVar8 = FUN_00429550(); local_100 = (Entity_Player *)((uint)(cVar8 != '\0') * 4 + 5); bVar7 = HasCollectible(this,0x177,0); if ((bVar7 != 0) && (iVar10 = Isaac::Random((int)local_100), iVar10 == 0)) { if (pEVar29->_type != 9) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if ((cVar8 == '\0') || (pEVar29->_type != 2)) goto LAB_00773987; } pVVar12 = Vector::Resized(&pEVar29->_velocity,(Vector *)(local_24 + 8),10.0); Vector::__unm(pVVar12,&local_148); pVVar14 = Vector::Rotated(&local_148,(Vector *)(local_24 + 8),-15.0); pVVar12 = &this->_pos; FireTear(this,pVVar12,*pVVar14,7,(Entity *)0x0,1.0); velocity.y = local_148.y; velocity.x = local_148.x; FireTear(this,pVVar12,velocity,7,(Entity *)0x0,1.0); pVVar14 = Vector::Rotated(&local_148,(Vector *)(local_24 + 8),15.0); FireTear(this,pVVar12,*pVVar14,7,(Entity *)0x0,1.0); std::string::string_from_cstr(local_84,(byte *)"ShootingDown"); local_8 = 5; std::string::string_from_cstr(local_44,(byte *)"ShootingRight"); local_8._0_1_ = 6; std::string::string_from_cstr(local_2c,(byte *)"ShootingUp"); local_8._0_1_ = 7; std::string::string_from_cstr(local_6c + 0x10,(byte *)"ShootingLeft"); local_8._0_1_ = 8; VVar34.y = local_148.y; VVar34.x = local_148.x; pvVar38 = string_from_direction(local_a4 + 2,VVar34,local_6c + 0x10,local_2c,local_44,local_84); local_8 = CONCAT31(local_8._1_3_,9); LAB_0077321a: PlayCollectibleAnim(this,0x177,0,pvVar38,-1,0); std::string::_Tidy_deallocate((char *)(local_a4 + 2)); std::string::_Tidy_deallocate(local_6c + 0x10); std::string::_Tidy_deallocate(local_2c); std::string::_Tidy_deallocate(local_44); std::string::_Tidy_deallocate(local_84); ExceptionList = local_10; return 0; } LAB_00773987: bVar7 = HasCollectible(this,0x1c1,0); if (bVar7 != 0) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,4); if ((uVar26 == 0) && ((pEVar29->_type == 9 || (pEVar29->_type == 2)))) { pVVar12 = Vector::Resized(&pEVar29->_velocity,&local_148,10.0); pVVar12 = Vector::__unm(pVVar12,(Vector *)(local_24 + 8)); tear = FireTear(this,&this->_pos,*pVVar12,7,(Entity *)0x0,1.0); b = (BitSet128 *)&DAT_00c34bf0; extraTearFlags = &g_tearFlagHoming; pBVar15 = Entity_Tear::TearFlags(tear,(BitSet128 *)&local_54); pBVar15 = BitSet128::operator_or((BitSet128 *)local_3c,pBVar15,extraTearFlags); pBVar15 = BitSet128::operator_or(&local_7c,pBVar15,b); Entity_Tear::SetTearFlags(tear,*pBVar15); pcVar3 = *(code **)(*(int *)tear + 0x3c); Color::Color(); (*pcVar3)(); (**(code **)(*(int *)tear + 0xc))(); ExceptionList = local_10; return 0; } } bVar7 = HasCollectible(this,0x1c9,0); if ((bVar7 != 0) && ((damageFlags & 0x2200000) == 0)) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,5); if (uVar26 == 0) { pcVar3 = *(code **)(*(int *)this + 0x3c); Color::Color((Color *)local_b0); (*pcVar3)(); ExceptionList = local_10; return 0; } } if ((damageFlags & 0x100d0400) == 0) { play_hurt_effects(); } bVar7 = Game::IsInTimedSet(g_game,0x49); if ((bVar7 != 0) || ((this->_variant == 1 && (bVar7 = Game::IsInTimedSet(g_game,0x37), bVar7 != 0)))) { LAB_00778ff1: local_18 = (Entity *)0x2; local_148.y = (float)(int)((float)param_2 + 0.5); piVar17 = (int *)std::min(); this->_damageCooldown = *piVar17 * 0x3c; ExceptionList = local_10; return 0; } Game::GetField26614(g_game); cVar8 = FUN_00429550(); if ((cVar8 != '\0') && (cVar8 = Entity::IsInvincible((Entity *)this), cVar8 != '\0')) goto LAB_00778ff1; if ((((float)param_2 <= 0.0) && ((damageFlags & 0x8000) != 0)) && ((bVar7 = HasPoisonImmunity(this), bVar7 == 0 || ((pEVar29->_type == 1000 && (pEVar29->_variant == 0x7b)))))) { DamageInfo::DamageInfo(); local_b4 = (undefined1 [4])damageFlags; local_bc = param_2; local_b0._0_4_ = param_4; EntityRef::operator_((EntityRef *)(local_b0 + 4),pEVar29); FUN_006b7db0(); fVar35 = this->_pendingDamage; *(uint *)&this->_pendingDamageFlags = (uint)this->_pendingDamageFlags | damageFlags; puVar20 = (uint *)((int)&this->_pendingDamageFlags + 4); *puVar20 = *puVar20 | (uint)param_4; this->_pendingDamage = (float)param_2 + fVar35; } pEVar11 = (Entity_Player *)((float)param_2 + 0.5); local_148.y = (float)(int)(float)pEVar11; local_104 = local_148.y; Game::GetField26614(g_game); cVar8 = FUN_00429550(); if ((cVar8 != '\0') && (local_104 == 0.0)) { if (0.0 < (float)param_2) { local_104 = 1.4013e-45; } pEVar11 = param_2; } local_138.y = (float)(damageFlags & 0x2000000); if (local_138.y == 0.0) { bVar7 = Game::IsGreedMode(g_game); if (bVar7 == 0) { Config::GetCollectibles(); iVar10 = EntityPtr::Ref(); if ((iVar10 < 7) && (iVar10 = Game::GetVictoryLap(g_game), iVar10 < 1)) { pLVar16 = (Level *)Config::GetCollectibles(); bVar7 = Level::IsAscent(pLVar16); if (bVar7 == 0) goto LAB_00773d11; } local_100 = (Entity_Player *)0x2; pfVar13 = (float *)std::max(); local_104 = *pfVar13; } else { LAB_00773d11: Game::IsGreedMode(g_game); } bVar7 = HasCollectible(this,0x6c,0); if ((((bVar7 != 0) || (bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x6c), bVar7 != 0) ) || (iVar10 = GetTrinketMultiplier(this,0xe), 2 < iVar10)) || (((pEVar29->_flags & 4) != 0 || ((bVar7 = HasCollectible(this,0x279,0), bVar7 != 0 && (bVar7 = Game::IsHardMode(), bVar7 == 0)))))) { pEVar11 = (Entity_Player *)0x3f000000; local_100 = (Entity_Player *)0x3f000000; Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { pEVar31 = local_100; } else { pEVar31 = (Entity_Player *)0x3f400000; } if (1 < (int)local_104) { local_120.y = 1.4013e-45; pEVar11 = (Entity_Player *)((float)(int)local_104 * (float)pEVar31 + 0.5); local_100 = (Entity_Player *)(int)(float)pEVar11; pfVar13 = (float *)std::max(); local_104 = *pfVar13; } } itemConfig = Isaac::GetItemConfig(); itemConfigEntry = Config::GetNullItem(itemConfig,0x1d); bVar7 = TemporaryEffects::has_item_effect(&this->_temporaryeffects,itemConfigEntry); if (bVar7 != 0) { local_100 = (Entity_Player *)0x3f800000; Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { local_100 = (Entity_Player *)0x3fa00000; } local_120.y = 2.8026e-45; piVar17 = (int *)std::max(); pEVar11 = (Entity_Player *)((float)*piVar17 * (float)local_100); local_104 = (float)(int)(float)pEVar11; } iVar10 = GetHealthType(this); if (iVar10 == 3) { local_104 = 2.8026e-45; } bVar7 = Game::IsInTimedSet(g_game,0x2f); if (bVar7 != 0) { local_100 = (Entity_Player *)0x2; pfVar13 = (float *)std::max(); local_104 = *pfVar13; } bVar7 = Game::IsInTimedSet(g_game,0x30); if (bVar7 != 0) { local_100 = (Entity_Player *)0x18; pfVar13 = (float *)std::max(); local_104 = *pfVar13; } } pEVar29 = damageSource; local_120.y = (float)(damageFlags & 0x200000); if ((ItemConfig_Item *)local_120.y != (ItemConfig_Item *)0x0) { local_104 = 0.0; } if ((damageFlags & 0x4000) != 0) { VStack_110.y = (float)damageSource->_entity; if ((((Entity_Player *)VStack_110.y == (Entity_Player *)0x0) || ((bVar7 = Entity::is_player((Entity *)VStack_110.y), bVar7 == 0 && (VStack_110.y = (float)Entity::SpawnerEntity((Entity *)VStack_110.y), (Entity_Player *)VStack_110.y == (Entity_Player *)0x0)))) || (bVar7 = Entity::is_player((Entity *)VStack_110.y), bVar7 == 0)) { VStack_110.y = (float)Game::GetNearestPlayer(g_game,&this->_pos); } pEVar31 = this; pVVar12 = Entity::Position((Entity *)VStack_110.y,(Vector *)(local_24 + 8)); AddBlueFlies((Entity_Player *)VStack_110.y,1,pVVar12,(Entity *)pEVar31); } bVar7 = HasInvincibility(this,CONCAT44(param_4,damageFlags),pEVar29); local_150.y = (float)(damageFlags & 0x10000020); isPenalized = local_150.y == 0.0; if (((this->_variant == 1) && (this->_babySkin == 0xb)) && (this->_hasBabyRoomShield != 0)) { bVar7 = 1; this->_hasBabyRoomShield = 0; } if (((0 < this->_damageCooldown) && (((uint)param_4 & 8) == 0)) || (pEVar11 = param_2, (float)param_2 <= 0.0)) { LAB_0077403f: if ((ItemConfig_Item *)local_120.y == (ItemConfig_Item *)0x0) { ExceptionList = local_10; return 0; } } else if (bVar7 != 0) goto LAB_0077403f; bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x139); if ((bVar7 != 0) && ((damageFlags & 0x20) == 0)) { play_sound_with_fart_seed(0x115,1.0,2,0,1.0); uVar26 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x10,&this->_pos,&g_vectorZero,(Entity *)this,0xb,uVar26); Entity_Effect::FollowParent(effect,(Entity *)this); Entity::SetPositionOffset((Entity *)effect,&this->_posOffset); pVVar12 = (Vector *)Sprite::Scale((Sprite *)&this->_sprite); Entity::SetSpriteScale((Entity *)effect,pVVar12); set_field_358(effect,16.0); (**(code **)(*(int *)effect + 0xc))(); pTVar25 = &this->_temporaryeffects; TemporaryEffects::RemoveCollectibleEffect(pTVar25,0x139,1); cVar8 = FUN_007db2d0(); if (cVar8 == '\0') { bVar7 = TemporaryEffects::HasCollectibleEffect(pTVar25,0x217); if (bVar7 == 0) { bVar7 = HasCollectible(this,0x139,0); if ((bVar7 == 0) || (this->_holyMantleState != 0)) { bVar7 = TemporaryEffects::HasNullEffect(pTVar25,0x2e); if (bVar7 != 0) { TemporaryEffects::RemoveNullEffect(pTVar25,0x2e,1); } } else { this->_holyMantleState = 1; } } else { TemporaryEffects::RemoveCollectibleEffect(pTVar25,0x217,1); } } iVar10 = TemporaryEffects::GetCollectibleEffectNum(pTVar25,0x139); if (iVar10 < 1) { itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x139); RemoveCostume(this,itemConfigEntry); } iVar10 = Game::damage_cooldown_scale(); this->_damageCooldown = iVar10; bVar7 = HasTrinket(this,0x51,0); if (bVar7 != 0) { GetTrinketMultiplier(this,0x51); iVar10 = Game::damage_cooldown_scale(); this->_damageCooldown = this->_damageCooldown * iVar10; } qVar5 = this->_flags; puVar20 = (uint *)((int)&this->_flags + 4); *puVar20 = *puVar20 & 0xffffffef; *(int *)&this->_flags = (int)qVar5; ExceptionList = local_10; return 0; } if ((0 < this->_hallowedGroundCountdown) && (local_138.y == 0.0)) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,2); if (uVar26 == 0) { pcVar3 = *(code **)(*(int *)this + 0x3c); Color::Color(); (*pcVar3)(); iVar10 = Game::damage_cooldown_scale(); this->_damageCooldown = iVar10; LAB_007736fb: qVar5 = this->_flags; puVar20 = (uint *)((int)&this->_flags + 4); *puVar20 = *puVar20 | 0x10; *(int *)&this->_flags = (int)qVar5; ExceptionList = local_10; return 0; } } bVar7 = LuaEngine::EntityTakeDamage (g_luaEngine,(Entity *)this,(float)(int)local_104,CONCAT44(param_4,damageFlags), pEVar29,param_6); if (bVar7 == 0) { ExceptionList = local_10; return 0; } bVar7 = try_end_astral_projection(this); if (bVar7 != 0) { ExceptionList = local_10; return 0; } if ((this->_playerType == 0x25) && (pEVar29->_type == 0x362)) { spawn_ghost_corpse(); ChangePlayerType(this,0x27,0); SetMinDamageCooldown(this); ExceptionList = local_10; return 0; } if ((pEVar29->_entity != (Entity *)0x0) && (local_100 = (Entity_Player *)Entity::GetPlayerAncestor(pEVar29->_entity), local_100 != (Entity_Player *)0x0)) { pvVar38 = (void *)FUN_0065d090(); Player_stats_add(pvVar38,0x10,local_100,(float)(int)local_104); } pvVar38 = (void *)FUN_0065d090(); Player_stats_add(pvVar38,3,this,(float)(int)local_104); EntityRef::operator_(&this->_lastDamageSource,pEVar29); *(uint *)&this->_lastDamageFlags = damageFlags; *(float *)((int)&this->_lastDamageFlags + 4) = param_4; this->field_0x13b5 = 1; this->_maggyHealthDrainCooldown = 0; this->_damageCooldown = 4; IsLocalPlayer(this); local_138.y = (float)pEVar11; if (isPenalized != '\0') { this->_roomDamageTaken = this->_roomDamageTaken + (int)local_104; if (this->_playerType == 0x16) { local_100 = (Entity_Player *)this->_redHearts; iVar10 = FUN_007d4320(); if ((((int)local_100 <= iVar10) && (this->_soulHearts < 2)) && ((this->_soulHearts != 1 || ((int)(&(local_100->_sprite)._filename + -3) + this->_boneHearts < 1)))) goto LAB_007743f5; } else { LAB_007743f5: this->_totalDamageTaken = this->_totalDamageTaken + (int)local_104; } if (pEVar29->_entity == (Entity *)0x0) { VStack_110.y = 0.0; } else { VStack_110.y = (float)Entity::GetPlayerAncestor(pEVar29->_entity); } bVar7 = Entity::IsEnemy((Entity *)this); if ((bVar7 != 0) && ((Entity_Player *)VStack_110.y != (Entity_Player *)0x0)) { __ftoui3(); FUN_006a8210(); } } if (pEVar29->_type - 10U < 0x3de) { Room::GetTopLeftPos((Room *)g_manager); FUN_0092aaf0(); } local_125 = 1; bVar7 = Game::GetDebugFlag(g_game,6); if (bVar7 != 0) { KColor::SetFromARGB((KColor *)(local_6c + 0x14),0xffff4500); spawn_debug_damage_text(); } if (((damageFlags & 0x202) != 0) && ((damageFlags & 4) == 0)) { play_sound_with_fart_seed(0x2b,1.0,2,0,1.0); } iVar10 = pEVar29->_type; if ((((((((iVar10 == 0x32) || (iVar10 == 0x56)) || (iVar10 == 0x5a)) || ((iVar10 == 0x196 || (iVar36 = pEVar29->_spawnerType, iVar36 == 0x196)))) || ((iVar10 == 0x126 || ((iVar36 == 0x126 || (iVar10 == 299)))))) || ((iVar10 == 9 && (((iVar36 == 0x32 || (iVar36 == 0x56)) || (iVar36 == 0x5a)))))) || (iVar10 = Game::Challenge(g_game), iVar10 == 0x18)) && (0 < this->_numCoins)) { AddCoins(this,-1); iVar10 = Isaac::Random(3); local_100 = (Entity_Player *)(iVar10 + 1); piVar17 = (int *)std::min(); VStack_110.y = (float)*piVar17; if (0 < (int)VStack_110.y) { local_100 = (Entity_Player *)VStack_110.y; do { uVar26 = Random(); pVVar12 = MusicManager::RandomVector((Vector *)(local_24 + 8)); fVar35 = random_float(); local_120.y = fVar35 * 5.0 + 2.0; pVVar12 = Vector::__mul(pVVar12,(Vector *)(local_3c + 8),&local_120.y); this = local_130; Game::Spawn(g_game,5,0x14,&local_130->_pos,pVVar12,(Entity *)local_130,1,uVar26); local_100 = (Entity_Player *)((int)&local_100[-1]._replacedPlayer + 3); } while (local_100 != (Entity_Player *)0x0); local_100 = (Entity_Player *)0x0; pEVar29 = damageSource; } AddCoins(this,-(int)VStack_110.y); } if (this->_variant == 1) { iVar10 = this->_babySkin; if (iVar10 == 0x11) { iVar10 = Isaac::Random(2); if (iVar10 == 0) { Color::Color((Color *)local_b0); Game::Fart(g_game,&this->_pos,85.0,(Entity *)this,1.0,0,color); } Game::ButterBeanFart(g_game,&this->_pos,120.0,(Entity *)this,iVar10 != 0,0); } else if (iVar10 == 0x14) { Game::BombDamage(g_game,&this->_pos,40.0,60.0,1,(Entity *)this,g_tearFlagsNone,4,0); uVar26 = Random(); pEVar39 = Game::Spawn(g_game,1000,1,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)pEVar39 + 0xc))(); } else if (iVar10 == 0x2c) { UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x69,1,-1,0); } } bVar7 = HasCollectible(this,0x21a,0); if ((bVar7 != 0) && ((this->_trinketsID[0] != 0 || (((this->_queuedItem)._item != (void *)0x0 && (cVar8 = Item::IsTrinket(), cVar8 != '\0')))))) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,10); if ((uVar26 == 0) || (iVar10 = Game::Challenge(g_game), iVar10 == 0x29)) { FlushQueueItem(this); UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x1df,1,-1,0); play_sound_with_fart_seed(0x9d,1.0,2,0,1.0); } } bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x53); if (bVar7 == 0) { pEVar11 = (Entity_Player *)get_voice_pitch(this); iVar10 = 0x37; } else { local_100 = (Entity_Player *)get_voice_pitch(this); iVar10 = Isaac::Random(2); iVar10 = (-(uint)(iVar10 != 0) & 0xfffffffe) + 0x6a; pEVar11 = local_100; } play_sound_with_fart_seed(iVar10,local_138.y,2,0,(float)pEVar11); if (pEVar29->_type == 0x2d) { iVar10 = Isaac::Random(0x82); iVar36 = 0x54; LAB_00774872: SoundEffects::PlayWithFartOverride(iVar36,1.0,iVar10 + 0x32,0,1.0); } else if (pEVar29->_type == 0x4e) { iVar10 = Isaac::Random(0x82); iVar36 = 0x56; goto LAB_00774872; } bVar7 = HasTrinket(this,0x28,0); iVar10 = 0x14; if (bVar7 != 0) { local_100 = (Entity_Player *)GetTrinketMultiplier(this,0x28); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { iVar10 = 10; } if (local_100 == (Entity_Player *)0x2) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); iVar10 = 0x21; iVar36 = 0x14; LAB_0077490b: if (cVar8 != '\0') { iVar10 = iVar36; } } else if (2 < (int)local_100) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); iVar10 = 0x32; iVar36 = 0x1e; goto LAB_0077490b; } Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { fVar35 = 5.0; } else { fVar35 = 2.5; } fVar28 = this->_luck; uVar26 = Isaac::Random(100); if (uVar26 < (uint)(iVar10 + (int)(fVar35 * fVar28))) { itemConfig = Isaac::GetItemConfig(); iVar10 = 1; bVar7 = 1; itemConfigEntry = ItemConfig::GetTrinket(itemConfig,0x28); pvVar38 = TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); TemporaryEffects::AddEffect(&this->_temporaryeffects,pvVar38,bVar7,iVar10); } } bVar7 = HasTrinket(this,0x30,0); if (bVar7 != 0) { local_100 = (Entity_Player *)0x2; local_120.y = (float)(0x14 - (int)(this->_luck * 0.3)); piVar17 = (int *)std::max(); iVar10 = Isaac::Random(*piVar17); if (iVar10 == 0) { SoundEffects::PlayWithFartOverride(0x21,1.0,2,0,1.0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x1e,0,(Entity_Player *)0x0); UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x23,1,-1,0); } } bVar7 = HasTrinket(this,0x1d,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if ((cVar8 == '\0') || (iVar10 = Isaac::Random(5), iVar10 == 0)) { pEVar39 = (Entity *)0x0; pVVar12 = &this->_pos; iVar10 = GetTrinketMultiplier(this,0x1d); iVar36 = Isaac::Random(2); AddBlueFlies(this,iVar10 * (iVar36 + 1),pVVar12,pEVar39); } } bVar7 = HasCollectible(this,0x94,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { timeMs = get_time_ms(); ppvVar1 = &this[1]._chargeBarSprites[0]._layerState; local_18 = (Entity *) (((int)(timeMs >> 0x20) - this[1]._chargeBarSprites[0]._layerCount) - (uint)((void *)timeMs < *ppvVar1)); if ((local_18 == (Entity *)0x0) && ((uint)((int)(void *)timeMs - (int)*ppvVar1) < 0x1389)) goto LAB_00774b06; } pEVar39 = (Entity *)0x0; pVVar12 = &this->_pos; iVar10 = Isaac::Random(5); AddBlueFlies(this,iVar10 + 2,pVVar12,pEVar39); timeMs = get_time_ms(); this[1]._chargeBarSprites[0]._layerState = (void *)(int)timeMs; this[1]._chargeBarSprites[0]._layerCount = (int)(timeMs >> 0x20); } LAB_00774b06: bVar7 = HasCollectible(this,0x20d,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if ((cVar8 == '\0') || (pcVar2 = (char *)((int)&this[1]._chargeBarSprites[0]._rotation + 2), *pcVar2 = *pcVar2 + '\x01', (uint)*(byte *)((int)&this[1]._chargeBarSprites[0]._rotation + 2) % 5 == 0)) { AddLeprosy(this); } } bVar7 = HasCollectible(this,0x292,0); if (bVar7 != 0) { local_138.y = 0.0; Level::GetCurrentRoom((Level *)g_game); spawnedEffect = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(spawnedEffect,&local_54,3,0xe4,-1,0,0); local_8 = 10; iVar10 = EntityList::Size(); if (iVar10 != 0) { uVar26 = 0; do { puVar18 = (undefined4 *)std::vector::operator_index(); local_100 = (Entity_Player *)*puVar18; pEVar11 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)local_100); if (pEVar11 == this) { fVar33 = (float10)Entity::MaxHitPoints(); Entity::SetField380((Entity *)local_100,(float)fVar33); local_138.y = (float)((int)local_138.y + 1); } uVar26 = uVar26 + 1; uVar19 = EntityList::Size(); } while (uVar26 < uVar19); } Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { LAB_00774c43: if ((uint)local_138.y < (Entity_Player *)0x10) { AddMinisaac(this); } } else { fVar35 = (float)param_2 + this[1]._chargeBarSprites[0]._color._tint[2]; this[1]._chargeBarSprites[0]._color._tint[2] = fVar35; if (15.0 <= fVar35) { this[1]._chargeBarSprites[0]._color._tint[2] = fVar35 - 15.0; goto LAB_00774c43; } } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_54); } bVar7 = HasCollectible(this,0x2b8,0); pTVar25 = &this->_temporaryeffects; if ((bVar7 != 0) && (iVar10 = TemporaryEffects::GetCollectibleEffectNum(pTVar25,0x2b8), iVar10 < 10)) { TemporaryEffects::AddCollectibleEffect(pTVar25,0x2b8,1,1); } if (isPenalized != '\0') { bVar7 = HasTrinket(this,0x91,0); if (bVar7 != 0) { bVar7 = TryRemoveTrinket(this,0x91); if (bVar7 != 0) { itemConfig = Isaac::GetItemConfig(); local_120.y = (float)ItemConfig::GetTrinket(itemConfig,0x91); if ((ItemConfig_Item *)local_120.y != (ItemConfig_Item *)0x0) { this->_cacheFlags = this->_cacheFlags | ((ItemConfig_Item *)local_120.y)->cacheFlags; Level::SetHeartPicked((Level *)pTVar25); } play_sound_with_fart_seed(0x10b,1.0,2,0,1.0); uVar26 = Random(); pVVar12 = MusicManager::RandomVector((Vector *)(local_24 + 8)); fVar35 = random_float(); local_100 = (Entity_Player *)(fVar35 * 6.0 + 4.0); pVVar12 = Vector::operator_mul((Vector *)(local_3c + 8),(float *)&local_100,pVVar12); pEVar39 = Game::Spawn(g_game,1000,0xf,(Vector *)local_118,pVVar12,(Entity *)0x0,100,uVar26); entityConfig = (EntityConfig *)FUN_00417910(); entityConfigEntry = EntityConfig::GetEntity(entityConfig,5,0x15e,0); sprite = (ANM2 *)Entity::GetSprite(pEVar39); ANM2::Load(sprite,&entityConfigEntry->anm2Path,0); projectile = (Sprite *)Entity::GetSprite(pEVar39); Sprite::ReplaceSpritesheet(projectile,0,(std_string *)((int)local_120.y + 0x38)); Entity::GetSprite(pEVar39); Sprite::LoadGraphics(); sprite = (ANM2 *)Entity::GetSprite(pEVar39); ANM2::Play(sprite,(byte *)"Appear",0); FUN_004cdce0(); FUN_0044bfa0(); (**(code **)(*(int *)pEVar39 + 0xc))(); this = local_130; } } } bVar7 = HasPlayerForm(this,0xd); if ((bVar7 != 0) && (iVar10 = Isaac::Random(5), iVar10 == 0)) { uVar26 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x3d,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar26); Entity::SetParent((Entity *)effect,(Entity *)this); Entity_Effect::SetRadii(effect,this->_size,90.0); Entity_Effect::SetTimeout(effect,10); } bVar7 = HasCollectible(this,0xa2,0); if (bVar7 != 0) { local_100 = (Entity_Player *)0x1; local_120.y = (float)(5 - (int)(this->_luck * 0.15)); piVar17 = (int *)std::max(); iVar10 = Isaac::Random(*piVar17); if (iVar10 == 0) { itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x3a); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0xa2); local_54._capacity = itemConfigEntry->maxCooldown; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,1,1); } } bVar7 = HasCollectible(this,0x75,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { timeMs = get_time_ms(); pVVar12 = &this[1]._chargeBarSprites[0]._offset; local_18 = (Entity *) (((int)(timeMs >> 0x20) - (int)this[1]._chargeBarSprites[0]._offset.y) - (uint)((uint)(float)timeMs < (uint)pVVar12->x)); if ((local_18 == (Entity *)0x0) && ((uint)((int)(float)timeMs - (int)pVVar12->x) < 0x7531)) goto LAB_00775002; } itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x75); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { local_54._capacity = 0x1c2; VVar34 = (Vector)get_time_ms(); this[1]._chargeBarSprites[0]._offset = VVar34; } TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,1,1); itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x75); RemoveCostume(this,itemConfigEntry); } LAB_00775002: bVar7 = HasCollectible(this,0x262,0); if (bVar7 != 0) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x262,1,1); itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x262); RemoveCostume(this,itemConfigEntry); } uVar26 = 0; do { iVar10 = GetBatteryCharge(this,uVar26); if (iVar10 == 0x263) { AddActiveCharge(this,1,uVar26,0,0,0); } uVar26 = uVar26 + 1; } while (uVar26 < 4); if ((this->_playerType == 0x1b) && (((0 < this->_redHearts || (0 < this->_soulHearts)) || (0 < this->_boneHearts)))) { add_samson_berserk_charge(this); } bVar7 = HasCollectible(this,0x112,0); pTVar25 = &this->_temporaryeffects; if (bVar7 != 0) { TemporaryEffects::AddCollectibleEffect(pTVar25,0x112,1,1); } bVar7 = HasCollectible(this,0x9c,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); local_106 = cVar8 == '\0'; Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { LAB_00775125: if (local_106 == '\0') goto LAB_0077513f; } else { bVar7 = *(char *)((int)&this[1]._chargeBarSprites[0]._rotation + 3) + local_104._0_1_; *(byte *)((int)&this[1]._chargeBarSprites[0]._rotation + 3) = bVar7; if (bVar7 < 0x14) goto LAB_00775125; *(byte *)((int)&this[1]._chargeBarSprites[0]._rotation + 3) = bVar7 - 0x14; } AddActiveCharge(this,1,-1,0,0,0); } LAB_0077513f: bVar7 = HasCollectible(this,0xb4,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { timeMs = get_time_ms(); pVVar12 = &this[1]._chargeBarSprites[0]._scale; local_18 = (Entity *) (((int)(timeMs >> 0x20) - (int)this[1]._chargeBarSprites[0]._scale.y) - (uint)((uint)(float)timeMs < (uint)pVVar12->x)); if ((local_18 == (Entity *)0x0) && ((uint)((int)(float)timeMs - (int)pVVar12->x) < 0x1389)) goto LAB_007751a5; } TemporaryEffects::AddCollectibleEffect(pTVar25,0xb4,1,1); VVar34 = (Vector)get_time_ms(); this[1]._chargeBarSprites[0]._scale = VVar34; } LAB_007751a5: bVar7 = HasCollectible(this,0xd6,0); if (bVar7 != 0) { itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0xd6); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { local_54._capacity = 300; } TemporaryEffects::AddEffect(pTVar25,&local_54,1,1); } bVar7 = HasTrinket(this,1,0); if (bVar7 != 0) { pEVar11 = (Entity_Player *)GetTrinketMultiplier(this,1); local_138.y = (float)pEVar11; iVar10 = GetHealthType(this); if (iVar10 == 3) { itemRng = (RNG *)FUN_005cbd00(); pEVar11 = (Entity_Player *)RNG::RandomInt(itemRng,2); local_138.y = (float)pEVar11; } else { itemRng = (RNG *)FUN_005cbd00(); RNG::Next(itemRng); } if (0 < (int)pEVar11) { do { uVar26 = Random(); pVVar12 = MusicManager::RandomVector((Vector *)(local_24 + 8)); fVar35 = random_float(); local_100 = (Entity_Player *)(fVar35 * 5.0 + 2.0); pVVar12 = Vector::__mul(pVVar12,(Vector *)(local_3c + 8),(float *)&local_100); this = local_130; Game::Spawn(g_game,5,0x14,&local_130->_pos,pVVar12,(Entity *)local_130,0,uVar26); local_138.y = (float)((int)&((Entity_Player *)((int)local_138.y + -0x26cc))->_replacedPlayer + 3); } while ((Entity_Player *)local_138.y != (Entity_Player *)0x0); } } bVar7 = HasCollectible(this,0xcc,0); if ((bVar7 != 0) && (iVar10 = Isaac::Random(2), iVar10 != 0)) { VStack_110.y = 0.0; uVar26 = Isaac::Random(4); if (uVar26 == 0) { bVar7 = HasTrinket(this,0x16,0); if ((bVar7 == 0) || (iVar10 = Isaac::Random(5), iVar10 == 0)) goto LAB_00775342; iVar10 = Isaac::Random(3); uVar26 = iVar10 + 1; } if (uVar26 < 4) { LAB_00775342: /* WARNING: Could not recover jumptable at 0x00775342. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar9 = (*(code *)(&PTR_LAB_007791b0)[uVar26])(); return uVar9; } uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,(uint)VStack_110.y,pVVar12,&g_vectorZero,(Entity *)this,0,uVar26); } itemRng = GetCollectibleRNG(this,0xdb); local_120.y = (float)GetTrinketRNG(this,0x16); Game::GetField26614(g_game); cVar8 = FUN_00429550(); fVar35 = 0.2; if (cVar8 != '\0') { fVar35 = 0.1; } local_100 = (Entity_Player *)(fVar35 + this->_luck * 0.01); bVar7 = HasCollectible(this,0xdb,0); if (((bVar7 != 0) && (local_138.y = RNG::RandomFloat(itemRng), local_138.y <= (float)local_100)) && ((bVar7 = HasTrinket(this,0x16,0), bVar7 == 0 || (uVar26 = RNG::RandomInt((RNG *)local_120.y,5), uVar26 == 0)))) { uVar26 = Random(); Game::GetField26614(g_game); cVar8 = FUN_00429550(); local_100 = (Entity_Player *)((cVar8 != '\0') + 1); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,pVVar12,&g_vectorZero,(Entity *)this,(uint)local_100,uVar26); } itemRng = GetCollectibleRNG(this,0xe1); bVar7 = HasCollectible(this,0xe1,0); if (((bVar7 != 0) && (local_100 = (Entity_Player *)RNG::RandomFloat(itemRng), (float)local_100 <= this->_luck * 0.02 + 0.08)) && ((bVar7 = HasTrinket(this,0x16,0), bVar7 == 0 || (uVar26 = RNG::RandomInt((RNG *)local_120.y,5), uVar26 == 0)))) { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,pVVar12,&g_vectorZero,(Entity *)this,3,uVar26); } itemRng = GetCollectibleRNG(this,0xe3); VStack_110.y = (float)itemRng; bVar7 = HasCollectible(this,0xe3,0); if (bVar7 != 0) { iVar10 = GetHealthType(this); if (iVar10 == 3) { LAB_00775601: local_138.y = (float)RNG::RandomInt(itemRng,2); } else { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') goto LAB_00775601; uVar26 = RNG::RandomInt(itemRng,2); local_138.y = (float)(uVar26 + 1); } if (0 < (int)local_138.y) { do { uVar26 = RNG::Next(itemRng); pVVar12 = MusicManager::RandomVector((Vector *)(local_24 + 8)); local_100 = (Entity_Player *)0x40000000; pVVar12 = Vector::__mul(pVVar12,(Vector *)(local_3c + 8),(float *)&local_100); Game::Spawn(g_game,5,0x14,&this->_pos,pVVar12,(Entity *)this,1,uVar26); local_138.y = (float)((int)&((Entity_Player *)((int)local_138.y + -0x26cc))->_replacedPlayer + 3); itemRng = (RNG *)VStack_110.y; } while ((Entity_Player *)local_138.y != (Entity_Player *)0x0); } } itemRng = GetTrinketRNG(this,8); bVar7 = HasTrinket(this,8,0); if (bVar7 != 0) { local_100 = (Entity_Player *)0x1; local_138.y = (float)(0x14 - (int)(this->_luck * 0.5)); puVar20 = (uint *)std::max(); uVar26 = RNG::RandomInt(itemRng,*puVar20); iVar10 = GetTrinketMultiplier(this,8); if (((int)uVar26 < iVar10) && (bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x5d), bVar7 == 0)) { UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x5d,1,-1,0); local_125 = 0; } } bVar7 = HasCollectible(this,0xd3,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { timeMs = get_time_ms(); ppvVar1 = &this[1]._chargeBarSprites[0]._nullLayerNames; local_18 = (Entity *) (((int)(timeMs >> 0x20) - this[1]._chargeBarSprites[0]._numNullLayers) - (uint)((void *)timeMs < *ppvVar1)); if ((local_18 == (Entity *)0x0) && ((uint)((int)(void *)timeMs - (int)*ppvVar1) < 0x5dd)) goto LAB_007757f6; } itemRng = GetCollectibleRNG(this,0xd3); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { uVar26 = RNG::RandomInt(itemRng,4); iVar10 = uVar26 + 2; } else { uVar26 = RNG::RandomInt(itemRng,2); iVar10 = uVar26 + 1; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(room,(Vector *)(local_24 + 8),&this->_pos,0.0,1,0,0); if (0 < iVar10) { do { ThrowBlueSpider(this,(Vector *)(local_24 + 8),&g_vectorZero); iVar10 = iVar10 + -1; } while (iVar10 != 0); } timeMs = get_time_ms(); this[1]._chargeBarSprites[0]._nullLayerNames = (void *)(int)timeMs; this[1]._chargeBarSprites[0]._numNullLayers = (int)(timeMs >> 0x20); } LAB_007757f6: bVar7 = HasCollectible(this,0x106,0); if (((bVar7 != 0) && (iVar10 = scale_for_hard_difficulty(2), (this->_redHearts - (int)local_104) + this->_boneHearts + this->_soulHearts <= iVar10)) && (iVar10 = scale_for_hard_difficulty(2), iVar10 < this->_redHearts + this->_boneHearts + this->_soulHearts)) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if ((cVar8 == '\0') || (*(char *)(this[1]._chargeBarSprites[0]._color._tint + 3) == '\0')) { SoundEffects::PlayWithFartOverride(0x21,1.0,2,0,1.0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x1f,0,(Entity_Player *)0x0); UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x23,1,-1,0); *(undefined1 *)(this[1]._chargeBarSprites[0]._color._tint + 3) = 1; } } bVar7 = HasCollectible(this,0x12d,0); if ((bVar7 != 0) || (iVar10 = GetZodiacEffect(this), iVar10 == 0x12d)) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x6c,1,1); } pEVar11 = (Entity_Player *)GetCollectibleRNG(this,0x12f); local_100 = pEVar11; bVar7 = HasCollectible(this,0x12f,0); if ((bVar7 != 0) || (iVar10 = GetZodiacEffect(this), iVar10 == 0x12f)) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); fVar35 = this->_luck; if (cVar8 == '\0') { local_100 = (Entity_Player *)0x1; local_138.y = (float)(4 - (int)(fVar35 * 0.3)); puVar20 = (uint *)std::max(); uVar26 = RNG::RandomInt((RNG *)pEVar11,*puVar20); bVar32 = uVar26 == 0; } else { uVar26 = 10; if (fVar35 < 10.0) { if (fVar35 < 7.0) { if (4.0 <= fVar35) { uVar26 = 0x14; } uVar19 = RNG::RandomInt((RNG *)local_100,100); bVar32 = uVar19 < uVar26; } else { uVar26 = RNG::RandomInt((RNG *)local_100,100); bVar32 = uVar26 < 0x23; } } else { uVar26 = RNG::RandomInt((RNG *)local_100,100); bVar32 = uVar26 < 0x32; } } if (bVar32) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x3a,1,1); } } bVar7 = HasCollectible(this,0x9d,0); if (((bVar7 != 0) || (bVar7 = HasCollectible(this,0x2b7,0), bVar7 != 0)) || (bVar7 = HasCollectible(this,0xba,0), bVar7 != 0)) { local_100 = (Entity_Player *)CONCAT31(local_100._1_3_,this->_playerType != 6); bVar7 = HasCollectible(this,0x9d,0); if (bVar7 != 0) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x9d,(byte)local_100,1); } bVar7 = HasCollectible(this,0x2b7,0); if (bVar7 != 0) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x2b7,1,1); } this->_bloodLustCounter = this->_bloodLustCounter + 1; } bVar7 = HasCollectible(this,0x173,0); if (((bVar7 != 0) && (damageSource->_type != 4)) && (damageSource->_type != 6)) { itemConfig = Isaac::GetItemConfig(); iVar10 = 1; bVar7 = 1; itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x41); pvVar38 = TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); TemporaryEffects::AddEffect(&this->_temporaryeffects,pvVar38,bVar7,iVar10); } bVar7 = HasTrinket(this,0x43,0); if (bVar7 != 0) { uVar26 = 0x32; iVar10 = GetTrinketMultiplier(this,0x43); if (iVar10 == 2) { uVar26 = 0x4b; } else if (iVar10 == 3) { uVar26 = 100; } itemRng = GetTrinketRNG(this,0x43); uVar19 = RNG::RandomInt(itemRng,100); if (uVar19 < uVar26) { itemRng = GetTrinketRNG(this,0x43); uVar26 = RNG::RandomInt(itemRng,5); switch(uVar26) { case 0: iVar10 = 0x69; break; case 1: iVar10 = 0xa6; break; case 2: iVar10 = 0x182; break; case 3: iVar10 = 0x196; break; case 4: iVar10 = 0x11d; break; default: goto LAB_00775bb8; } UseActiveItem(this,(short *)((int)&VStack_110.y + 2),iVar10,1,-1,0); } } LAB_00775bb8: bVar7 = HasCollectible(this,0x197,0); pTVar25 = &this->_temporaryeffects; if ((bVar7 != 0) && (bVar7 = TemporaryEffects::HasCollectibleEffect(pTVar25,0x197), bVar7 != 0)) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { pfVar13 = &this[1]._chargeBarSprites[0]._rotation; *(short *)pfVar13 = *(short *)pfVar13 + 1; if (*(short *)&this[1]._chargeBarSprites[0]._rotation < 5) goto LAB_00775c66; *(undefined2 *)&this[1]._chargeBarSprites[0]._rotation = 0xff2e; } TemporaryEffects::RemoveCollectibleEffect(pTVar25,0x197,1); itemRng = GetCollectibleRNG(this,0x197); uVar26 = RNG::RandomInt(itemRng,4); this->_purityState = uVar26; itemConfig = Isaac::GetItemConfig(); itemConfigEntry = Config::GetNullItem(itemConfig,0x11); RemoveCostume(this,itemConfigEntry); } LAB_00775c66: if (*(short *)&this[1]._chargeBarSprites[0]._rotation < 0) { *(undefined2 *)&this[1]._chargeBarSprites[0]._rotation = 0xff2e; } Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (((cVar8 == '\0') && (bVar7 = HasCollectible(this,0x19f,0), bVar7 != 0)) && (bVar7 = TemporaryEffects::HasCollectibleEffect(pTVar25,0x19f), bVar7 != 0)) { TemporaryEffects::RemoveCollectibleEffect(pTVar25,0x19f,1); ANM2::Play(&this->_crownOfLightSprite,(byte *)"FloatNoGlow",0); } bVar7 = HasCollectible(this,0x19c,0); if (bVar7 != 0) { iVar10 = FUN_007c9080(); pEVar11 = local_130; VStack_140.y = (float)GetCambionPregnancyLevel(local_130); pEVar11->_cambionConceptionState = pEVar11->_cambionConceptionState + 1; iVar36 = FUN_007c9080(); VStack_110.y = (float)GetCambionPregnancyLevel(local_130); if (iVar10 == iVar36) { this = local_130; } else { uVar26 = 6; local_a4[0] = 1.4013e-45; local_a4[1] = 2.8026e-45; local_a4[2] = 5.60519e-45; local_a4[3] = 1.12104e-44; local_a4[4] = 2.24208e-44; local_a4[5] = 4.48416e-44; local_a4[6] = 0.0; local_a4[7] = 0.0; pPVar21 = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar7 = PersistentGameData::Unlocked(pPVar21,0x1c7); if (bVar7 != 0) { local_a4[6] = 2.86986e-42; uVar26 = 7; } pPVar21 = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar7 = PersistentGameData::Unlocked(pPVar21,0x1f6); this = local_130; if (bVar7 != 0) { local_a4[uVar26] = 5.73972e-42; uVar26 = uVar26 + 1; } itemRng = (RNG *)FUN_005cbd00(); local_100 = (Entity_Player *)RNG::RandomInt(itemRng,uVar26); iVar10 = 0; if (uVar26 != 0) { do { local_138.y = local_a4[((int)(&(local_100->_sprite)._filename + -3) + iVar10) % (int)uVar26]; if ((this->_conceptionFamiliarFlags & (uint)local_138.y) == 0) { SoundEffects::PlayWithFartOverride(0x3f1,1.0,2,0,1.0); this->_conceptionFamiliarFlags = this->_conceptionFamiliarFlags | (uint)local_138.y; this->_cacheFlags = this->_cacheFlags | 0x200; EvaluateItems(); break; } iVar10 = iVar10 + 1; } while (iVar10 < (int)uVar26); } } if (VStack_140.y != VStack_110.y) { trigger_immaculate_conception(); } } bVar7 = Entity::HasEntityFlags((Entity *)this,0x400000000); if (((bVar7 != 0) && ((this->_entityRef2)._entity == this)) && (0 < this->_bleedOutHealth)) { this->_bleedOutHealth = 600; } bVar7 = HasCollectible(this,0x1c0,0); if (bVar7 != 0) { Entity::AddEntityFlags((Entity *)this,0x400000000); EntityRef::constructor((EntityRef *)(local_b0 + 4),(Entity *)this); EntityRef::operator_(&this->_entityRef2,(EntityRef *)(local_b0 + 4)); if (this->_bleedOutHealth < 1) { this->_bleedOutHealth = 600; } itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,4); if (uVar26 == 0) { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,pVVar12,&g_vectorZero,(Entity *)this,1,uVar26); } } bVar7 = HasCollectible(this,0x1c4,0); if ((bVar7 != 0) && (bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1c4), bVar7 == 0)) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { timeMs = get_time_ms(); ppvVar1 = &this[1]._chargeBarSprites[0]._eventNames; local_18 = (Entity *) (((int)(timeMs >> 0x20) - this[1]._chargeBarSprites[0]._numEvents) - (uint)((void *)timeMs < *ppvVar1)); if ((local_18 == (Entity *)0x0) && ((uint)((int)(void *)timeMs - (int)*ppvVar1) < 0xfa1)) goto LAB_0077606b; } TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x1c4,1,1); Game::GetField26614(g_game); cVar8 = FUN_00429550(); UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x26,1,-1,-(uint)(cVar8 != '\0') & 0x20); TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x1c4,1); bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0xd6); if (bVar7 == 0) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,5); if (uVar26 == 0) { itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0xd6); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); local_54._capacity = 0x3c; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,1,1); } } timeMs = get_time_ms(); this[1]._chargeBarSprites[0]._eventNames = (void *)(int)timeMs; this[1]._chargeBarSprites[0]._numEvents = (int)(timeMs >> 0x20); } LAB_0077606b: bVar7 = HasCollectible(this,0x230,0); if (bVar7 != 0) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { bVar7 = *(byte *)(this[1]._chargeBarSprites[0]._color._tint + 1); if (2 < bVar7) goto LAB_00776196; *(byte *)(this[1]._chargeBarSprites[0]._color._tint + 1) = bVar7 + 1; } local_100 = (Entity_Player *)0x0; do { Vector::FromAngle((Vector *)(local_24 + 8),((float)(int)local_100 * 360.0) / 10.0); VStack_140.y = 10.0; Vector::operator_mul_assign((Vector *)(local_24 + 8),&VStack_140.y); uVar26 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,2,1,&this->_pos,(Vector *)(local_24 + 8),(Entity *)this,0,uVar26); Entity_Tear::SetScale(tear,1.33); (**(code **)(*(int *)tear + 0x40))(); extraTearFlags = (BitSet128 *)&DAT_00c346a0; pBVar15 = Entity_Tear::TearFlags(tear,(BitSet128 *)&local_54); pBVar15 = BitSet128::operator_or((BitSet128 *)local_3c,pBVar15,extraTearFlags); Entity_Tear::SetTearFlags(tear,*pBVar15); local_100 = (Entity_Player *)&local_100->field_0x1; } while ((int)local_100 < 10); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x39,1,1); EvaluateItems(); } LAB_00776196: bVar7 = HasCollectible(this,0x2a3,0); if (bVar7 != 0) { trigger_cracked_orb(this,&g_vectorZero); } bVar7 = HasCollectible(this,0x2be,0); if (bVar7 != 0) { local_138.y = 0.0; Level::GetCurrentRoom((Level *)g_game); VStack_110.y = (float)Room::GetEntities(); local_100 = (Entity_Player *)0x0; iVar10 = EntityList::Size(); if (iVar10 != 0) { do { FUN_00417610(); pEVar22 = (Entity_Familiar *)FUN_00435de0(); if ((((pEVar22 != (Entity_Familiar *)0x0) && (iVar10 = Entity::Variant((Entity *)pEVar22), iVar10 == 0xce)) && (pEVar11 = (Entity_Player *)Entity_Familiar::Player(pEVar22), pEVar11 == this)) && (iVar10 = Entity::SubType((Entity *)pEVar22), iVar10 == 0x2be)) { local_138.y = (float)((int)local_138.y + 1); } puVar30 = &local_100->field_0x1; local_100 = (Entity_Player *)puVar30; puVar23 = (undefined1 *)EntityList::Size(); } while (puVar30 < puVar23); if (5 < (int)local_138.y) goto LAB_00776282; } AddWisp(this,0x2be,&this->_pos,0,0); } LAB_00776282: bVar7 = HasTrinket(this,0x9e,0); if (bVar7 != 0) { iVar10 = GetTrinketMultiplier(this,0x9e); local_100 = (Entity_Player *)(iVar10 + 1); if (0 < (int)local_100) { do { FUN_00424510(); local_8 = 0xb; WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&local_54._data,0,this->_numCoins,0); WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&local_54._data,1,this->_numKeys,0); iVar10 = this->_numBombs; iVar36 = 2; uVar9 = 0x7762f8; WeightedOutcomePicker::AddOutcomeWeight((WeightedOutcomePicker *)&local_54._data,2,iVar10,0) ; if (this->_playerType == 0x12) { iVar10 = this->_effectiveSoulCharge; iVar36 = 3; LAB_0077631e: uVar9 = 0x776326; WeightedOutcomePicker::AddOutcomeWeight ((WeightedOutcomePicker *)&local_54._data,iVar36,iVar10,0); } else if (this->_playerType == 0x24) { iVar10 = this->_effectiveBloodCharge; iVar36 = 4; goto LAB_0077631e; } iVar40 = 0x77632e; cVar8 = FUN_004178f0(); if (cVar8 == '\0') goto LAB_00776576; uVar19 = 0x23; itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); RNG::game_constructor((RNG *)&aEStackY_15ac[0x81]._velocity,uVar26,uVar19); rng._shift1 = iVar36; rng._seed = uVar9; rng._shift2 = iVar10; rng._shift3 = iVar40; uVar26 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)&local_54._data,rng); switch(uVar26) { case 0: AddCoins(this,-1); itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_3c + 8),&this->_pos,40.0,0,0,0); uVar19 = 0; variant = 0x14; break; case 1: AddKeys(this,-1); itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)&local_7c._h,&this->_pos,40.0,0,0,0); uVar19 = 0; variant = 0x1e; break; case 2: AddBombs(this,-1); itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition(room,&VStack_140,&this->_pos,40.0,0,0,0); uVar19 = 0; variant = 0x28; break; case 3: AddSoulCharge(this,-1); itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); itemRng = (RNG *)FUN_005cbd00(); uVar19 = RNG::RandomInt(itemRng,10); uVar19 = -(uint)(uVar19 != 0) & 8; room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = &local_138; goto LAB_00776543; case 4: AddBloodCharge(this,-1); itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); itemRng = (RNG *)FUN_005cbd00(); uVar19 = RNG::RandomInt(itemRng,10); uVar19 = -(uint)(uVar19 != 0) & 2; room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = &VStack_110; LAB_00776543: pVVar12 = Room::FindFreePickupSpawnPosition(room,pVVar12,(Vector *)local_118,40.0,0,0,0); variant = 10; this = local_130; break; default: goto LAB_00776576; } Game::Spawn(g_game,5,variant,pVVar12,&g_vectorZero,(Entity *)this,uVar19,uVar26); LAB_00776576: local_8 = 0xffffffff; std::vector::_Tidy(); local_100 = (Entity_Player *)(&local_100[-1].field_0x22c0 + 0x40b); } while (local_100 != (Entity_Player *)0x0); } } bVar7 = HasCollectible(this,0x2d4,0); if ((bVar7 != 0) && ((damageFlags & 0x10040000) == 0)) { bVar7 = HasTrinket(this,0x16,0); if (bVar7 != 0) { uVar26 = RNG::RandomInt((RNG *)local_120.y,5); if (uVar26 != 0) goto LAB_007767bc; } VStack_140.y = 10.0; pVVar12 = Vector::__mul(&this->_aimDirection,(Vector *)(local_3c + 8),&VStack_140.y); pVVar14 = MusicManager::RandomVector((Vector *)&local_7c._h); local_100 = (Entity_Player *)0x40000000; pVVar14 = Vector::operator_mul(&local_120,(float *)&local_100,pVVar14); pVVar12 = Vector::__add(pVVar12,&local_138,pVVar14); Vector::Resized(pVVar12,(Vector *)(local_24 + 8),18.0); uVar26 = 2; if (1.0 < (float)param_2) { uVar26 = 1; } bVar7 = HasTrinket(local_130,0x16,0); if (bVar7 != 0) { uVar26 = 6; } uVar19 = Random(); VStack_140.y = 0.4; pVVar12 = Vector::operator_mul((Vector *)(local_3c + 8),&VStack_140.y,(Vector *)(local_24 + 8)); pVVar12 = Vector::__add((Vector *)local_118,(Vector *)&local_7c._h,pVVar12); pEVar39 = Game::Spawn(g_game,5,10,pVVar12,(Vector *)(local_24 + 8),(Entity *)local_130,uVar26, uVar19); FUN_0060d1f0(); (**(code **)(*(int *)pEVar39 + 0xc))(); uVar19 = Random(); VStack_140.y = 0.4; pVVar12 = Vector::__mul((Vector *)(local_24 + 8),(Vector *)(local_3c + 8),&VStack_140.y); local_100 = (Entity_Player *) Game::Spawn(g_game,1000,2,(Vector *)local_118,pVVar12,(Entity *)local_130,2,uVar19); if (uVar26 == 6) { pcVar3 = *(code **)(*(int *)local_100 + 0x3c); Color::Color(); (*pcVar3)(); } (**(code **)(*(int *)local_100 + 0xc))(); this = local_130; } LAB_007767bc: pVVar12 = Vector::__sub(&this->_pos,(Vector *)(local_24 + 8),&damageSource->_position); pVVar12 = Vector::Normalized(pVVar12,(Vector *)(local_3c + 8)); trigger_set_dispatch(&this->_proceduralItems,4,damageSource->_entity,&this->_pos,pVVar12); bVar7 = HasCollectible(this,0x1f6,0); if (bVar7 != 0) { fVar35 = random_float(); Vector::FromAngle((Vector *)(local_24 + 8),fVar35 * 360.0); DoZitEffect(); } bVar7 = HasTrinket(this,0x61,0); if (bVar7 != 0) { iVar10 = GetTrinketMultiplier(this,0x61); this->_tonsilCounter = this->_tonsilCounter + -1; if (this->_tonsilCounter < 1) { if ((int)this->_tonsilCount < iVar10 + 1) { this->_cacheFlags = this->_cacheFlags | 0x200; this->_tonsilCount = this->_tonsilCount + 1; EvaluateItems(); } FUN_007d9ca0(); } if (iVar10 + 1 <= (int)this->_tonsilCount) { TryRemoveTrinket(this,0x61); } } bVar7 = HasTrinket(this,0x69,0); if (bVar7 != 0) { uVar26 = 0x14; iVar10 = GetTrinketMultiplier(this,0x69); if (iVar10 == 2) { uVar26 = 10; } else if (iVar10 == 3) { uVar26 = 7; } itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,uVar26); if (uVar26 == 0) { iVar10 = Game::Challenge(g_game); if (iVar10 == 0x29) { FUN_005b19d0(); } Game::GetItemPool(g_game); FUN_00753650(); uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,100,pVVar12,&g_vectorZero,(Entity *)this,0x16,uVar26); iVar10 = Game::Challenge(g_game); if (iVar10 == 0x29) { FUN_005b19d0(); } TryRemoveTrinket(this,0x69); } } Game::GetField26614(g_game); cVar8 = FUN_00429550(); pEVar22 = (Entity_Familiar *)(this->_luck * 0.02); if (cVar8 == '\0') { fVar35 = 0.3; } else { fVar35 = 0.1; } VStack_140.y = fVar35 + (float)pEVar22; bVar7 = HasTrinket(this,0x21,0); if (bVar7 != 0) { itemRng = (RNG *)FUN_005cbd00(); local_100 = (Entity_Player *)RNG::RandomFloat(itemRng); pEVar22 = (Entity_Familiar *)VStack_140.y; if ((float)local_100 <= VStack_140.y) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x13e,1,1); } } bVar7 = HasTrinket(this,0x68,0); if (bVar7 != 0) { uVar26 = 0x14; iVar10 = GetTrinketMultiplier(this,0x68); if (iVar10 == 2) { uVar26 = 10; } else if (iVar10 == 3) { uVar26 = 7; } itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,uVar26); if (uVar26 == 0) { iVar10 = Game::Challenge(g_game); if (iVar10 == 0x29) { FUN_005b19d0(); } itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,100,pVVar12,&g_vectorZero,(Entity *)this,0,uVar26); iVar10 = Game::Challenge(g_game); if (iVar10 == 0x29) { FUN_005b19d0(); } TryRemoveTrinket(this,0x68); } } Game::GetField26614(g_game); cVar8 = FUN_00429550(); uVar26 = 0x14; if (cVar8 != '\0') { uVar26 = 0x21; } bVar7 = HasCollectible(this,0x201,0); if (bVar7 != 0) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,uVar26); if (uVar26 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Vector::Normalized(&this->_velocity,(Vector *)(local_24 + 8)); VStack_140.y = 15.0; pVVar12 = Vector::__mul(pVVar12,(Vector *)(local_3c + 8),&VStack_140.y); pVVar12 = Vector::__sub(&this->_pos,(Vector *)&local_7c._h,pVVar12); pEVar11 = (Entity_Player *)Room::GetGridIndex(room,pVVar12); local_100 = pEVar11; room = (Room *)Level::GetCurrentRoom((Level *)g_game); VStack_140.y = (float)Room::GetGridEntity(room,(uint)pEVar11); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar7 = Room::is_type_16(room); if (bVar7 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar26 = Room::GetGridCollision(room,(int)pEVar11); if (uVar26 == 0) { if ((Entity_Familiar *)VStack_140.y != (Entity_Familiar *)0x0) { GridEntity::GetType(); cVar8 = is_grid_type_floor_special(); if (cVar8 != '\0') goto LAB_00776c4d; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); Room::SpawnGridEntity(room,(int)local_100,0xe,4,uVar26,0); } } LAB_00776c4d: play_sound_with_fart_seed(0x25,1.0,2,0,1.0); } } bVar7 = HasTrinket(this,0x7a,0); if (bVar7 != 0) { uVar26 = 0x32; iVar10 = GetTrinketMultiplier(this,0x7a); if (iVar10 == 2) { uVar26 = 0x19; } else if (iVar10 == 3) { uVar26 = 0x10; } itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,uVar26); if (uVar26 == 0) { FUN_00424510(); local_8 = 0xc; std::vector::size(&this->_collectibleCounts); FUN_0042c820(); id = (Entity_Familiar *)0x1; uVar26 = std::vector::size(&this->_collectibleCounts); if (1 < uVar26) { do { piVar17 = (int *)FUN_0042c810(); if (((0 < *piVar17) && (bVar7 = CanRerollCollectible(this,(int)id,0), bVar7 != 0)) && (iVar10 = GetActiveItemSlot(this,(int)id), iVar10 < 0)) { VStack_140.y = (float)id; std::vector::push_back(); } id = (Entity_Familiar *)&id->field_0x1; puVar23 = (undefined1 *)std::vector::size(&this->_collectibleCounts); } while (id < puVar23); } iVar10 = std::vector::size(&local_54._data); if (iVar10 != 0) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = std::vector::size(&local_54._data); RNG::RandomInt(itemRng,uVar26); piVar17 = (int *)FUN_0042c810(); DropCollectible(this,*piVar17,(Entity_Pickup *)0x0,1); IsLocalPlayer(this); SoundEffects::PlayWithFartOverride(0x385,(float)pEVar22,2,0,1.0); } local_8 = 0xffffffff; FID_conflict__Tidy(&local_54._data); } } Level::GetCurrentRoom((Level *)g_game); VStack_110.y = (float)Room::GetEntities(); local_118 = (Entity_Player *)0x0; iVar10 = EntityList::Size(); if (iVar10 != 0) { do { puVar18 = (undefined4 *)std::vector::operator_index(); bVar7 = Entity::IsFamiliar((Entity *)*puVar18); if (bVar7 == 0) { puVar18 = (undefined4 *)std::vector::operator_index(); bVar7 = Entity::IsEnemy((Entity *)*puVar18); if (bVar7 != 0) { puVar18 = (undefined4 *)std::vector::operator_index(); Entity_NPC::on_player_damaged((Entity_NPC *)*puVar18); } } else { puVar18 = (undefined4 *)std::vector::operator_index(); VStack_140.y = (float)*puVar18; pEVar11 = (Entity_Player *)Entity_Familiar::Player((Entity_Familiar *)VStack_140.y); if (pEVar11 == this) { Entity_Familiar::trigger_player_damage((Entity_Familiar *)VStack_140.y); } } local_118 = (Entity_Player *)&local_118->field_0x1; pEVar11 = (Entity_Player *)EntityList::Size(); } while (local_118 < pEVar11); } if ((isPenalized != '\0') && (this->_parent == (EntityPtr)0x0)) { pLVar16 = (Level *)Config::GetCollectibles(); Level::SetStateFlag(pLVar16); Config::GetCollectibles(); EntityPtr::Ref(); Game::SetLastLevelWithDamage(g_game); } bVar7 = Game::GetDebugFlag(g_game,2); local_100 = ThreadLocalStoragePointer; if (bVar7 == 0) { if (0 < (int)local_104) { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { piVar17 = &this->_soulHearts; local_30 = (float)((this->_soulHearts + 1 >> 1) + this->_boneHearts); piVar24 = (int *)std::min(); local_18 = (Entity *)(*piVar24 + 1 >> 1); local_138.y = (float)(damageFlags & 0x20); if (((Entity_Player *)local_138.y == (Entity_Player *)0x0) && (bVar7 = HasTrinket(this,0x6b,0), bVar7 == 0)) { VStack_110.y = (float)this->_redHearts; LAB_00776fab: local_107 = '\0'; } else { VStack_110.y = (float)this->_redHearts; if ((int)VStack_110.y < (int)local_104) goto LAB_00776fab; local_107 = '\x01'; } pEVar31 = local_130; local_118 = (Entity_Player *)*piVar17; local_120.y = (float)*piVar17; pEVar11 = (Entity_Player *)this->_boneHearts; local_105 = false; VStack_140.y = (float)((int)(&(pEVar11->_sprite)._filename + -3) + ((int)&local_118->field_0x1 >> 1)); if (0 < (int)pEVar11) { local_118 = (Entity_Player *)0x0; pEVar22 = (Entity_Familiar *)VStack_140.y; while ((pEVar22 = (Entity_Familiar *)((int)&pEVar22[-1]._wispCollectibleType + 3), -1 < (int)pEVar22 && (cVar8 = IsBoneHeart(pEVar31), cVar8 == '\0'))) { if ((local_118 == (Entity_Player *)0x0) && ((pEVar31->_soulHearts & 1) != 0)) { local_118 = (Entity_Player *)0x1; } else { local_118 = (Entity_Player *)((int)local_118 + 2); } } piVar17 = &pEVar31->_soulHearts; puVar20 = (uint *)std::min(); pEVar11 = (Entity_Player *)pEVar31->_boneHearts; VStack_110.y = (float)pEVar31->_redHearts; local_120.y = (float)*puVar20; local_105 = pEVar31->_maxHearts + (int)pEVar11 * 2 + -1 <= (int)VStack_110.y; local_118 = (Entity_Player *)local_120.y; } if (((int)local_120.y < 1) || (local_107 != '\0')) { if (((int)pEVar11 < 1) || ((local_105 != false || (local_107 != '\0')))) { if ((0 < pEVar31->_rottenHearts) && (pEVar31->_eternalHearts < 1)) { if (local_107 != '\0') { VStack_140.y = 0.0; local_150.y = (float)((pEVar31->_rottenHearts * 2 - (int)VStack_110.y) + (int)local_104); std::max(); } piVar24 = (int *)std::min(); local_104 = (float)((int)local_104 + *piVar24); } iVar10 = pEVar31->_boneHearts; if ((0 < iVar10) && (local_105 != false)) { local_150.y = (float)((~pEVar31->_redHearts & 1U) + 1); pfVar13 = (float *)std::min(); iVar10 = pEVar31->_boneHearts; local_104 = *pfVar13; } iVar36 = pEVar31->_eternalHearts; if (0 < iVar36) { pEVar31 = local_130; if ((Entity_Player *)local_138.y != (Entity_Player *)0x0) { if ((int)local_104 <= (int)((local_130->_redHearts - (uint)(*piVar17 + iVar10 < 1)) - local_130->_rottenHearts)) goto LAB_00777601; iVar36 = local_130->_eternalHearts; } local_104 = (float)((int)local_104 - iVar36); local_130->_eternalHearts = 0; if ((int)local_104 < 0) { local_104 = 0.0; } } LAB_00777601: local_106 = '\x01'; local_150.y = 0.0; iVar10 = pEVar31->_rottenHearts * 2; local_7c._h._4_4_ = (uint)(iVar10 < (int)local_104); if (local_107 == '\0') { VStack_110.y = 0.0; local_130 = (Entity_Player *)(pEVar31->_rottenHearts - (int)((int)local_104 + 1U) / 2) ; piVar17 = (int *)std::max(); } else { local_150.y = (float)((iVar10 - pEVar31->_redHearts) + (int)local_104); VStack_140.y = 0.0; piVar17 = (int *)std::max(); local_138.y = 0.0; local_120.y = (float)(pEVar31->_rottenHearts - (*piVar17 + 1) / 2); piVar17 = (int *)std::max(); } pEVar31->_rottenHearts = *piVar17; AddHearts(pEVar31,-(int)local_104,0,0); if (((((local_7c._h._4_1_ != '\0') && (iVar10 = pEVar31->_playerType, iVar10 != 0xe)) && (iVar10 != 0x21)) && (((pEVar31->_parent == (EntityPtr)0x0 && (isPenalized != '\0')) && ((0 < (int)local_104 && (pEVar31->_redHearts < pEVar31->_maxHearts)))))) && ((iVar10 != 0x16 || (iVar10 = FUN_007d4320(), pEVar31->_redHearts < iVar10)))) { uVar26 = 0; iVar10 = GetTrinketMultiplier(pEVar31,0x6b); if (iVar10 == 2) { uVar26 = 0x19; } else if (2 < iVar10) { uVar26 = 0x32; } itemRng = GetTrinketRNG(pEVar31,0x6b); uVar19 = RNG::RandomInt(itemRng,100); if (uVar26 <= uVar19) { pLVar16 = (Level *)Config::GetCollectibles(); Level::SetRedHeartDamage(pLVar16); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::SetRedHeartDamage(room); } } } else { local_120.y = (float)pEVar11; if ((((0 < pEVar31->_eternalHearts) && ((int)VStack_110.y < 1)) && (*piVar17 < 1)) && ((int)pEVar11 < 2)) { VStack_140.y = (float)((int)local_104 - pEVar31->_eternalHearts); local_120.y = 0.0; pfVar13 = (float *)std::max(); local_104 = *pfVar13; pEVar11 = (Entity_Player *)pEVar31->_boneHearts; pEVar31->_eternalHearts = 0; } if (0 < (int)local_104) { pEVar31->_boneHearts = (int)((int)&pEVar11[-1]._replacedPlayer + 3); UpdateHeartDependentEffects(pEVar31); if (((pEVar31->_playerType == 0x10) && (local_150.y == 0.0)) && (pEVar31->_parent == (EntityPtr)0x0)) { pLVar16 = (Level *)Config::GetCollectibles(); Level::SetRedHeartDamage(pLVar16); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::SetRedHeartDamage(room); } if ((*(int *)(*(int *)local_100 + 0xc) < DAT_00c8114c) && (_Init_thread_header(), DAT_00c8114c == -1)) { local_8 = 0xd; Color::Color(); local_8 = 0xffffffff; _Init_thread_footer(); } local_150.y = (pEVar31->_posOffset).y; fVar35 = random_float(); Game::SpawnParticles (g_game,&pEVar31->_pos,0x23,8,fVar35 * 3.0 + 2.0,(ColorMod *)&DAT_00c81150, local_150.y,0); fVar35 = random_float(); play_sound_with_fart_seed(0x1ce,0.7,2,0,fVar35 * 0.2 + 1.0); bVar7 = HasCollectible(pEVar31,0x225,0); if (bVar7 != 0) { local_150.y = random_float(); local_150.y = local_150.y * 360.0; local_120.y = 0.0; do { uVar26 = Random(); pVVar12 = Vector::FromAngle((Vector *)&local_7c._h, ((float)(int)local_120.y / 10.0 + local_150.y) * 360.0 ); VStack_140.y = 10.0; pVVar12 = Vector::__mul(pVVar12,&local_138,&VStack_140.y); tear = (Entity_Tear *) Game::Spawn(g_game,2,0x1d,&pEVar31->_pos,pVVar12,(Entity *)pEVar31,0,uVar26 ); Isaac::Random(2); GetTearHitParams(); pBVar15 = BitSet128::operator_or ((BitSet128 *)&local_54,(BitSet128 *)local_b4, (BitSet128 *)&DAT_00c348f0); Entity_Tear::SetTearFlags(tear,*pBVar15); Entity_Tear::SetScale(tear,local_a4[1] * 1.355); (**(code **)(*(int *)tear + 0x40))(); Entity_Projectile::SetHeight((Entity_Projectile *)tear,local_a4[2]); Entity::SetParent((Entity *)tear,(Entity *)pEVar31); (**(code **)(*(int *)tear + 0xc))(); local_120.y = (float)((int)local_120.y + 1); } while ((int)local_120.y < 10); pEVar31->_brittleBonesUpgrades = pEVar31->_brittleBonesUpgrades + 1; pEVar31->_cacheFlags = pEVar31->_cacheFlags | 2; EvaluateItems(); } } } } else { pfVar13 = (float *)std::min(); iVar10 = *piVar17; local_104 = *pfVar13; iVar36 = iVar10; if (iVar10 - (int)local_104 < iVar10) { do { cVar8 = IsBlackHeart(pEVar31); if (cVar8 != '\0') { RemoveBlackHeart(); UseActiveItem(pEVar31,(short *)((int)&VStack_110.y + 2),0x23,9,-1,0); play_sound_with_fart_seed(0x50,1.0,2,0,1.0); } iVar10 = pEVar31->_soulHearts; iVar36 = iVar36 + -1; } while (iVar10 - (int)local_104 < iVar36); } if ((((0 < pEVar31->_eternalHearts) && (pEVar31->_redHearts < 1)) && (pEVar31->_boneHearts < 1)) && (iVar10 - (int)local_104 < 1)) { VStack_140.y = (float)((int)local_104 - pEVar31->_eternalHearts); local_120.y = 0.0; pfVar13 = (float *)std::max(); local_104 = *pfVar13; pEVar31->_eternalHearts = 0; } if (0 < (int)local_104) { piVar17 = (int *)std::min(); pEVar31->_soulHearts = pEVar31->_soulHearts - *piVar17; } } update_greeds_gullet(pEVar31); iVar10 = pEVar31->_soulHearts; iVar36 = pEVar31->_boneHearts; piVar17 = (int *)std::min(); local_150.y = (float)pEVar31->_goldenHearts; local_7c._h._4_4_ = *piVar17 + 1 >> 1; fVar35 = local_150.y; fVar28 = local_30; while (((iVar10 + 1 >> 1) + iVar36 < (int)fVar28 && (0 < (int)fVar35))) { fVar28 = (float)((int)fVar28 + -1); fVar35 = (float)((int)fVar35 - 1); pEVar31->_goldenHearts = (int)fVar35; } if ((int)local_7c._h._4_4_ < (int)local_18) { pEVar39 = local_18; do { if ((int)fVar35 < 1) break; pEVar39 = (Entity *)((int)&pEVar39[-1]._luaBridgeRef + 3); fVar35 = (float)((int)fVar35 - 1); pEVar31->_goldenHearts = (int)fVar35; } while ((int)local_7c._h._4_4_ < (int)pEVar39); } this = pEVar31; if ((int)fVar35 < (int)local_150.y) { BreakGoldenHearts(pEVar31,(int)local_150.y - (int)fVar35); } } else { Level::GetCurrentRoom((Level *)g_game); pTVar25 = (TemporaryEffects *)FUN_004360d0(); bVar7 = TemporaryEffects::HasCollectibleEffect(pTVar25,0x1de); pEVar29 = damageSource; if (((bVar7 != 0) && (damageSource->_entity != (Entity *)0x0)) && ((local_18 = Entity::GetPlayerAncestor(damageSource->_entity), local_18 != (Entity *)0x0 && (*(short *)((int)&local_18[0xb]._charmSource._spawnerVariant + 2) != 0)))) { Level::GetCurrentRoom((Level *)g_game); pTVar25 = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::RemoveCollectibleEffect(pTVar25,0x1de,1); Level::GetCurrentRoom((Level *)g_game); FUN_00821940(); *(undefined2 *)((int)&local_18[0xb]._charmSource._spawnerVariant + 2) = 0; } bVar7 = Entity::HasEntityFlags((Entity *)this,0x10000000000000); if (((bVar7 != 0) && (pEVar29->_entity != (Entity *)0x0)) && (bVar7 = Entity::IsDescendantOf(pEVar29->_entity,(this->_entityRef4)._entity), bVar7 == 0 )) { fVar35 = (float)(int)local_104 * 1.2; FUN_005a6fb0(); local_104 = (float)(int)fVar35; } if (0 < (int)local_104) { fVar35 = (float)this->_blackHearts * 0.0625; FUN_004405e0(); local_18 = (Entity *)(int)fVar35; piVar17 = (int *)std::min(); iVar10 = *piVar17; this->_blackHearts = this->_blackHearts - iVar10; local_104 = (float)((int)local_104 - iVar10); fVar35 = (float)this->_blackHearts * 0.0625; FUN_004405e0(); iVar10 = (int)local_18 - (int)fVar35; if (0 < iVar10) { do { UseActiveItem(this,(short *)((int)&VStack_110.y + 2),0x23,9,-1,0); play_sound_with_fart_seed(0x50,1.0,2,0,1.0); iVar10 = iVar10 + -1; } while (iVar10 != 0); } if (0 < (int)local_104) { fVar35 = (float)this->_boneHearts * 0.0625; FUN_004405e0(); local_138.y = (float)(int)fVar35; piVar17 = (int *)std::min(); iVar10 = *piVar17; this->_boneHearts = this->_boneHearts - iVar10; local_104 = (float)((int)local_104 - iVar10); fVar35 = (float)this->_boneHearts * 0.0625; FUN_004405e0(); local_138.y = (float)((int)local_138.y - (int)fVar35); if (0 < (int)local_138.y) { local_118 = (Entity_Player *)local_138.y; do { fVar35 = random_float(); local_18 = (Entity *)(fVar35 * 360.0); local_120.y = 0.0; do { uVar26 = Random(); pVVar12 = Vector::FromAngle((Vector *)&local_7c._h, ((float)(int)local_120.y / 10.0 + (float)local_18) * 360.0); local_30 = 10.0; pVVar12 = Vector::__mul(pVVar12,&local_150,&local_30); tear = (Entity_Tear *) Game::Spawn(g_game,2,0x1d,&this->_pos,pVVar12,(Entity *)this,0,uVar26); Isaac::Random(2); GetTearHitParams(); pBVar15 = BitSet128::operator_or ((BitSet128 *)&local_54,(BitSet128 *)local_b4, (BitSet128 *)&DAT_00c348f0); Entity_Tear::SetTearFlags(tear,*pBVar15); Entity_Tear::SetScale(tear,local_a4[1] * 1.355); (**(code **)(*(int *)tear + 0x40))(); Entity_Projectile::SetHeight((Entity_Projectile *)tear,local_a4[2]); Entity::SetParent((Entity *)tear,(Entity *)this); (**(code **)(*(int *)tear + 0xc))(); local_120.y = (float)((int)local_120.y + 1); } while ((int)local_120.y < 10); local_118 = (Entity_Player *)((int)&local_118[-1]._replacedPlayer + 3); } while (local_118 != (Entity_Player *)0x0); if ((*(int *)(*(int *)local_100 + 0xc) < DAT_00c8117c) && (_Init_thread_header(), DAT_00c8117c == -1)) { local_8 = 0xe; Color::Color(); local_8 = 0xffffffff; _Init_thread_footer(); } local_18 = (Entity *)(this->_posOffset).y; fVar35 = random_float(); Game::SpawnParticles (g_game,&this->_pos,0x23,8,fVar35 * 3.0 + 2.0,(ColorMod *)&DAT_00c81180, (float)local_18,0); fVar35 = random_float(); play_sound_with_fart_seed(0x1ce,0.7,2,0,fVar35 * 0.2 + 1.0); bVar7 = HasCollectible(this,0x225,0); if (bVar7 != 0) { this->_brittleBonesUpgrades = this->_brittleBonesUpgrades + SUB42(local_138.y,0); this->_cacheFlags = this->_cacheFlags | 2; EvaluateItems(); } } if (0 < (int)local_104) { fVar35 = (float)this->_rottenHearts * 0.0625; FUN_004405e0(); local_18 = (Entity *)(int)fVar35; piVar17 = (int *)std::min(); iVar10 = *piVar17; this->_rottenHearts = this->_rottenHearts - iVar10; local_104 = (float)((int)local_104 - iVar10); fVar35 = (float)this->_rottenHearts * 0.0625; FUN_004405e0(); iVar10 = (int)local_18 - (int)fVar35; if (0 < iVar10) { do { pVVar12 = &this->_pos; pEVar39 = (Entity *)0x0; iVar36 = FUN_0067f030(); AddBlueFlies(this,iVar36,pVVar12,pEVar39); iVar10 = iVar10 + -1; } while (iVar10 != 0); } } } } iVar10 = 0; if (0 < (int)local_104) { fVar35 = (float)this->_goldenHearts * 0.0625; FUN_004405e0(); local_18 = (Entity *)(int)fVar35; piVar17 = (int *)std::min(); iVar10 = *piVar17; this->_goldenHearts = this->_goldenHearts - iVar10; local_104 = (float)((int)local_104 - iVar10); fVar35 = (float)this->_goldenHearts * 0.0625; FUN_004405e0(); iVar10 = (int)local_18 - (int)fVar35; } BreakGoldenHearts(this,iVar10); if (0 < (int)local_104) { FUN_004405e0(); piVar17 = (int *)std::min(); iVar10 = *piVar17; this->_soulHearts = this->_soulHearts - iVar10; local_104 = (float)((int)local_104 - iVar10); FUN_004405e0(); } local_106 = 0 < (int)local_104; if (0 < (int)local_104) { FUN_004405e0(); piVar17 = (int *)std::min(); iVar10 = *piVar17; this->_redHearts = this->_redHearts - iVar10; local_104 = (float)((int)local_104 - iVar10); FUN_004405e0(); } if (local_106 != '\0') { UpdateHeartDependentEffects(this); } } } } else { local_104 = 0.0; } bVar7 = HasCollectible(this,0x2a5,0); if (bVar7 == 0) { LAB_00777e98: local_107 = '\0'; } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar7 = Room::IsClear(room); if (((bVar7 != 0) || (bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x2a5), bVar7 != 0) ) || (this->_astralProjectionBody != (EntityPtr)0x0)) goto LAB_00777e98; local_107 = '\x01'; } bVar7 = HasInstantDeathCurse(this); if ((bVar7 == 0) || (local_105 = true, (int)local_104 < 1)) { local_105 = false; } if (local_107 == '\0') { bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x2c0); local_106 = '\0'; if (bVar7 != 0) goto LAB_00777ee1; } else { LAB_00777ee1: local_106 = '\x01'; } if ((((this->_redHearts < 1) && (this->_soulHearts < 1)) && (this->_boneHearts < 1)) || (local_105 != false)) { VStack_110.y = (float)(CONCAT13((undefined1)damageFlags,VStack_110.y._0_3_) & 0x1ffffff); bVar7 = HasCollectible(this,0x2b6,0); if (bVar7 != 0) { iVar10 = GetHealthType(this); if (iVar10 == 3) { iVar10 = 1; } else { iVar10 = 2; } AddBrokenHearts(this,iVar10); UseActiveItem(this,(short *)((int)&local_130 + 2),0x23,9,-1,0); play_sound_with_fart_seed(0x50,1.0,2,0,1.0); iVar10 = GetHeartLimit(this,0); if (iVar10 < 1) goto LAB_00777f89; LAB_00777f92: TryPreventDeath(this); goto LAB_0077816e; } LAB_00777f89: if (VStack_110.y._3_1_ != '\0') goto LAB_00777f92; if (local_105 != false) { this->_redHearts = 0; this->_soulHearts = 0; this->_blackHearts = 0; this->_boneHearts = 0; this->_eternalHearts = 0; this->_rottenHearts = 0; } if (local_106 != '\0') goto LAB_0077816e; if (local_105 != false) { pcVar3 = *(code **)(*(int *)this + 0x24); EntityRef::EntityRef((EntityRef *)(local_b0 + 4)); (*pcVar3)(); } bVar7 = try_trigger_astral_projection(this); pEVar29 = damageSource; VStack_110.y = (float)CONCAT13(bVar7,VStack_110.y._0_3_); EntityRef::operator_(&this->_lastDamageSource,damageSource); if (VStack_110.y._3_1_ != '\0') { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { local_120.y = (float)pEVar29->_entity; while ((Entity_Player *)local_120.y != (Entity_Player *)0x0) { bVar7 = Entity::is_player((Entity *)local_120.y); if (bVar7 != 0) { trigger_npc_death((Entity_Player *)local_120.y,(Entity *)this); break; } local_120.y = (float)Entity::SpawnerEntity(); } } } if (this->_dead != 0) { if (pEVar29->_type - 10U < 0x3de) { Room::GetTopLeftPos((Room *)g_manager); LAB_007780c6: FUN_0092abd0(); } else if (pEVar29->_spawnerType - 10U < 0x3de) { Room::GetTopLeftPos((Room *)g_manager); goto LAB_007780c6; } if ((((damageFlags & 4) != 0) && (pEVar29->_type == 2)) && (tear = (Entity_Tear *)__RTDynamicCast(), tear != (Entity_Tear *)0x0)) { extraTearFlags = &g_tearFlagExplosive; pBVar15 = Entity_Tear::TearFlags(tear,(BitSet128 *)&local_54); pBVar15 = BitSet128::operator_and((BitSet128 *)local_24,pBVar15,extraTearFlags); bVar7 = BitSet128::IsNonZero(pBVar15); if (bVar7 != 0) { extraTearFlags = &g_tearFlagPoison; pBVar15 = Entity_Tear::TearFlags(tear,(BitSet128 *)&local_54); pBVar15 = BitSet128::operator_and((BitSet128 *)local_24,pBVar15,extraTearFlags); bVar7 = BitSet128::IsNonZero(pBVar15); if (bVar7 != 0) { pPVar21 = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(pPVar21,0x180); } } } goto LAB_0077816e; } LAB_00778177: bVar7 = HasCollectible(this,0x13c,0); if (((bVar7 == 0) || (bVar7 = HasCollectible(this,0x104,0), bVar7 != 0)) || ((this->_weapons[1] == (int *)0x0 || (cVar8 = (**(code **)(*(int *)this->_weapons[1] + 0x38))(), cVar8 == '\0')))) goto LAB_007781da; itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); Game::MoveToRandomRoom(g_game,0,uVar26,this); bVar7 = 0; } else { LAB_0077816e: if (this->_dead == 0) goto LAB_00778177; LAB_007781da: bVar7 = local_125; } local_7c._h._4_4_ = 0; if (this->_pitfallState == 0) { local_7c._h._4_4_ = (uint)bVar7; } bVar7 = HasTrinket(this,0x2b,0); if ((bVar7 != 0) && (this->_dead == 0)) { local_30 = (float)GetTrinketMultiplier(this,0x2b); iVar10 = this->_redHearts; local_18 = (Entity *)((2 < (int)local_30) + 1); iVar36 = scale_for_hard_difficulty((int)local_18); if ((iVar10 <= iVar36) && ((this->_soulHearts < 1 || ((iVar10 < 1 && (iVar10 = scale_for_hard_difficulty((int)local_18), this->_soulHearts <= iVar10)))))) { if (local_30 == 1.4013e-45) { itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::Next(itemRng); Game::MoveToRandomRoom(g_game,0,uVar26,this); } else { FUN_00424510(); local_8 = 0xf; local_18 = (Entity *)0x2; FUN_007dc620(); local_18 = (Entity *)0x4; FUN_007dc620(); local_18 = (Entity *)0x6; FUN_007dc620(); local_18 = (Entity *)0x7; FUN_007dc620(); local_18 = (Entity *)0x8; FUN_007dc620(); local_18 = (Entity *)0x9; FUN_007dc620(); local_18 = (Entity *)0xb; FUN_007dc620(); local_18 = (Entity *)0xc; FUN_007dc620(); local_18 = (Entity *)0xd; FUN_007dc620(); local_18 = (Entity *)0x12; FUN_007dc620(); local_18 = (Entity *)0x13; FUN_007dc620(); local_18 = (Entity *)0x14; FUN_007dc620(); local_18 = (Entity *)0x15; FUN_007dc620(); local_18 = (Entity *)0x18; FUN_007dc620(); teleport_to_random_room_of_types(); local_8 = 0xffffffff; FID_conflict__Tidy(local_3c + 4); } } } iVar10 = scale_for_hard_difficulty(1); if (this->_redHearts <= iVar10) { bVar7 = HasCollectible(this,0x147,0); if (bVar7 != 0) { itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x3a); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); local_54._capacity = 0x96; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,1,1); } bVar7 = HasCollectible(this,0x148,0); if (bVar7 != 0) { UseActiveItem(this,(short *)((int)&local_130 + 2),0x23,1,-1,0); } if ((this->_soulHearts < 1) || ((this->_redHearts < 1 && (iVar10 = scale_for_hard_difficulty(1), this->_soulHearts == iVar10)))) { bVar7 = HasCollectible(this,0x8e,0); if ((bVar7 != 0) && (((bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x8e), bVar7 != 0 && (this->_dead == 0)) && ((damageFlags & 0x40020) == 0)))) { AddSoulHearts(this,2,0); TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x8e,1); TryRemoveCollectibleCostume(this,0x8e,0); play_sound_with_fart_seed(0x36,1.0,2,0,1.0); uVar26 = Random(); Game::Spawn(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,4,uVar26); pvVar38 = (void *)__RTDynamicCast(); Vector::Vector((Vector *)(local_24 + 8),0.0,-24.0); FUN_004563c0(); set_field_358(pvVar38,1.0); } bVar7 = HasTrinket(this,0x14,0); if ((bVar7 != 0) && (this->_variant == 0)) { local_120.y = (float)GetTrinketMultiplier(this,0x14); if (0 < (int)local_120.y) { do { uVar26 = Random(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); pVVar12 = Room::FindFreePickupSpawnPosition (room,(Vector *)(local_24 + 8),&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,pVVar12,&g_vectorZero,(Entity *)this,6,uVar26); local_120.y = (float)((int)&((Entity_Player *)((int)local_120.y + -0x26cc))-> _replacedPlayer + 3); } while ((Entity_Player *)local_120.y != (Entity_Player *)0x0); } this->_monkeyPawCounter = this->_monkeyPawCounter + -1; if (this->_monkeyPawCounter < 1) { TryRemoveTrinket(this,0x14); this->_monkeyPawCounter = 3; } } } } local_18 = (Entity *)0x2; std::min(); iVar10 = Game::damage_cooldown_scale(); puVar20 = (uint *)((int)&this->_flags + 4); *puVar20 = *puVar20 & 0xffffffef; this->_damageCooldown = iVar10; *(int *)&this->_flags = (int)this->_flags; if (local_107 != '\0') { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::SetPauseTimer(room,0x3c); spawn_ghost_corpse(); TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x2a5,1,1); itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0x2a5); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); local_54._capacity = 0x96; Level::GetCurrentRoom((Level *)g_game); pTVar25 = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddEffect(pTVar25,&local_54,1,1); Game::SetBloom(g_game,10,1.0); if ((*(int *)(*(int *)local_100 + 0xc) < DAT_00c811ac) && (_Init_thread_header(), DAT_00c811ac == -1)) { local_8 = 0x10; FUN_004aadf0(); local_8 = 0xffffffff; _Init_thread_footer(); } Game::SetColorModifier(g_game,(ColorModState *)&DAT_00c811b0,0,0.015); room = (Room *)Level::GetCurrentRoom((Level *)g_game); color_00 = (ColorModState *)Room::get_color_modifier(room,local_a4 + 2); Game::SetColorModifier(g_game,color_00,1,0.008); Game::MakeShockwave(g_game,&this->_pos,0.05,0.07,0xc); SoundEffects::PlayWithFartOverride(0x141,1.0,2,0,1.0); iVar10 = Game::damage_cooldown_scale(); this->_damageCooldown = this->_damageCooldown + iVar10; } bVar7 = HasTrinket(this,0x51,0); if (bVar7 != 0) { GetTrinketMultiplier(this,0x51); iVar10 = Game::damage_cooldown_scale(); this->_damageCooldown = iVar10 * this->_damageCooldown; } bVar7 = HasTrinket(this,0x80,0); if (bVar7 != 0) { local_100 = (Entity_Player *)0x19; iVar10 = GetTrinketMultiplier(this,0x80); if (iVar10 == 2) { local_100 = (Entity_Player *)0xc; } else if (iVar10 == 3) { local_100 = (Entity_Player *)&DAT_00000008; } itemRng = (RNG *)FUN_005cbd00(); uVar26 = RNG::RandomInt(itemRng,(uint)local_100); if (uVar26 == 0) { AddBoneHearts(this,1); } } if (((isPenalized != '\0') && (bVar7 = HasCollectible(this,0x160,0), bVar7 != 0)) && (local_148.y = (float)GetActiveItemSlot(this,0x160), -1 < (int)local_148.y)) { RemoveCollectible(this,this->_activeDesc[(int)local_148.y]._item,0,(uint)local_148.y,1); AddCollectible(this,0x1da,0,0,(int)local_148.y,0,0); play_sound_with_fart_seed(0x35,1.0,2,0,1.0); uVar26 = Random(); pEVar39 = Game::Spawn(g_game,1000,0x61,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar26); (**(code **)(*(int *)pEVar39 + 0xc))(); local_148.y = (this->_posOffset).y; Color::Color((Color *)local_b0); fVar35 = random_float(); Game::SpawnParticles(g_game,&this->_pos,0x23,8,fVar35 * 3.0 + 2.0,color_01,local_148.y,0); bVar7 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0xd6); if (bVar7 == 0) { itemConfig = Isaac::GetItemConfig(); itemConfigEntry = ItemConfig::GetCollectible(itemConfig,0xd6); TemporaryEffect::TemporaryEffect(&local_54,itemConfigEntry); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { local_54._capacity = 300; } TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,1,1); } bVar7 = HasCollectible(this,0x3b,0); if (bVar7 != 0) { TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x7b,1,4); } ResetDamageCooldown(this); pcVar3 = *(code **)(*(int *)this + 0x20); EntityRef::constructor((EntityRef *)(local_b0 + 4),(Entity *)this); FUN_00665a30(); (*pcVar3)(); ResetDamageCooldown(this); pcVar3 = *(code **)(*(int *)this + 0x20); EntityRef::constructor((EntityRef *)local_6c,(Entity *)this); FUN_00665a30(); (*pcVar3)(); } if (local_7c._h._4_1_ == '\0') goto LAB_00778aed; iVar10 = EntityPtr::Ref(); if (iVar10 == 0) { LAB_00778ac1: iVar10 = Game::Challenge(g_game); if (iVar10 != 0x1e) { pEVar11 = this; goto LAB_00778ad3; } } else { pEVar11 = (Entity_Player *)EntityPtr::Ref(); iVar10 = GetPlayerType(pEVar11); if (iVar10 != 0x28) goto LAB_00778ac1; pEVar11 = (Entity_Player *)EntityPtr::Ref(); LAB_00778ad3: PlayExtraAnimation(pEVar11,&DAT_00b1d3b0); } if (this->_itemState != 0x2f) { ResetItemState(this); } LAB_00778aed: this->_isHurtPending = 1; FUN_00417900(); cVar8 = FUN_006f0010(); if (cVar8 != '\0') { local_30 = 1.0; local_148.y = 0.6; local_18 = (Entity *)((float)(int)local_104 * 0.6); std::max(); puVar18 = (undefined4 *)std::min(); local_100 = (Entity_Player *)*puVar18; VStack_140.y = 2.0; local_7c._h._4_4_ = 0x3ecccccd; local_150.y = (float)(int)local_104 * 0.2; std::max(); std::min(); FUN_00a20b50(); } ClampGoldenHearts(this,0); update_bone_hearts(this); if (((0 < this->_damageCooldown) && (this->_dead == 0)) && ((iVar10 = GetOtherTwin(this), iVar10 != 0 && ((*(int *)(iVar10 + 0x13bc) < this->_damageCooldown && (*(char *)(iVar10 + 0x173) == '\0'))))) ) { *(int *)(iVar10 + 0x13bc) = this->_damageCooldown; } bVar7 = HasTrinket(this,0xb2,0); if ((bVar7 != 0) && ((damageFlags & 0x10000000) == 0)) { itemRng = (RNG *)FUN_005cbd00(); iVar10 = GetTrinketMultiplier(this,0xb2); local_18 = (Entity *)0x1; local_148.y = (float)(3 - iVar10); puVar20 = (uint *)std::max(); uVar26 = RNG::RandomInt(itemRng,*puVar20); if (uVar26 == 0) { UseActiveItem(this,(short *)((int)&local_130 + 2),0x28,0xb,-1,0); } } if ((((this->_dead == 0) && (this->_playerType == 0x1e)) && (isPenalized != '\0')) && ((this->_isPlayingExtraAnimation == 0 || (bVar7 = ANM2::IsPlaying(&this->_sprite,(byte *)"Glitch"), bVar7 == 0)))) { play_sound_with_fart_seed(0x253,1.0,2,0,1.0); itemRng = (RNG *)FUN_005cbd00(); local_120.y = (float)itemRng; fVar35 = RNG::RandomFloat(itemRng); this->_edenDamage = fVar35 * 2.0 - 1.0; fVar35 = RNG::RandomFloat(itemRng); this->_edenSpeed = fVar35 * 0.3 - 0.15; fVar35 = RNG::RandomFloat(itemRng); this->_edenFireDelay = fVar35 * 1.5 - 0.75; fVar35 = RNG::RandomFloat(itemRng); this->_edenTearRange = fVar35 * 120.0 - 60.0; fVar35 = RNG::RandomFloat(itemRng); this->_edenShotSpeed = fVar35 * 0.5 - 0.25; fVar35 = RNG::RandomFloat(itemRng); this->_edenLuck = fVar35 * 2.0 - 1.0; RNG::game_constructor(local_fc,this->_initSeed,0x3e); local_8 = 0x11; uVar26 = RNG::Next(this_02); this->_initSeed = uVar26; local_8 = 0xffffffff; guard_check_icall(); reroll_collectibles_on_damage(this,itemRng,1); local_100 = (Entity_Player *)0x0; iVar10 = GetMaxTrinkets(this); local_138.y = (float)(iVar10 + -1); if (-1 < (int)local_138.y) { piVar17 = this->_trinketsID + iVar10 + -1; do { local_148.y = (float)*piVar17; if (local_148.y != 0.0) { TriggerTrinketRemoved(this,(uint)local_148.y); *piVar17 = 0; TryRemoveTrinketCostume(this,(int)local_148.y); local_100 = (Entity_Player *)&local_100->field_0x1; } local_138.y = (float)((int)local_138.y + -1); piVar17 = piVar17 + -1; } while (-1 < (int)local_138.y); pEVar11 = local_100; if (0 < (int)local_100) { do { itemPool = (ItemPool *)Game::GetItemPool(g_game); bVar7 = 0; uVar26 = ItemPool::GetTrinket(itemPool,0); AddTrinket(this,uVar26,bVar7); pEVar11 = (Entity_Player *)((int)&pEVar11[-1]._replacedPlayer + 3); } while (pEVar11 != (Entity_Player *)0x0); } } local_118 = (Entity_Player *)0x0; uVar26 = GetMaxPocketItems(this); iVar10 = uVar26 - 1; if (-1 < iVar10) { local_100 = (Entity_Player *)(this->_pocketSlots + uVar26 * 2 + -2); do { if ((*(int *)local_100 != 0) && (cVar8 = FUN_00753640(), cVar8 == '\0')) { RemovePocketItem(this,iVar10); local_118 = (Entity_Player *)((int)local_118 + 1); } local_100 = (Entity_Player *)&local_100[-1].field_0x26c4; iVar10 = iVar10 + -1; } while (-1 < iVar10); } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); local_105 = (bool)PlayerManager::AnyoneHasCollectible(playerManager,0xfb); playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); local_106 = PlayerManager::AnyoneHasCollectible(playerManager,0xfc); if ((local_105 != false) && (local_106 != 0)) { local_106 = 0; local_105 = false; } if (0 < (int)local_118) { do { if ((local_105 == false) && ((local_106 != 0 || (uVar26 = RNG::RandomInt((RNG *)local_120.y,2), uVar26 != 0)))) { Game::GetItemPool(g_game); uVar26 = RNG::Next((RNG *)local_120.y); ItemPool::GetPill(uVar26); AddPill(); } else { Game::GetItemPool(g_game); RNG::Next((RNG *)local_120.y); ItemPool::GetCard(); AddCard(); } local_118 = (Entity_Player *)((int)local_118 + -1); } while (local_118 != (Entity_Player *)0x0); } PlayExtraAnimation(this,(byte *)"Glitch"); } ExceptionList = local_10; return 1; } //@@ 007791f0 Entity_Player::SetFullHearts /* ZHL [lua] Lua binding EntityPlayer:SetFullHearts prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity_Player::SetFullHearts(Entity_Player *this) { Entity_Player *pEVar1; int iVar2; HUD *pHVar3; uint uVar4; int extraout_EDX; int iVar5; iVar2 = this->_playerType; while ((iVar2 == 0x11 && (pEVar1 = (Entity_Player *)this->_subPlayer, pEVar1 != (Entity_Player *)0x0))) { iVar2 = pEVar1->_playerType; this = pEVar1; } iVar2 = GetHealthType(this); if ((iVar2 == 1) || (iVar2 == 2)) { iVar2 = this->_maxHearts; } else { iVar2 = this->_maxHearts + this->_boneHearts * 2; } this->_redHearts = iVar2; if (extraout_EDX <= iVar2) { pHVar3 = &g_game->_hud; uVar4 = 0; do { if (*(Entity_Player **)pHVar3->_playerHUD == this) { pHVar3->_playerHUD[0xc] = 4; break; } uVar4 = uVar4 + 1; pHVar3 = (HUD *)(pHVar3->_playerHUD + 0x6dc); } while (uVar4 < 8); } UpdateHeartDependentEffects(this); if (((*(int *)&g_game->_deathmatchManager < 2) && (this->_dead == 0)) && (iVar2 = this->_goldenHearts, 0 < iVar2)) { iVar5 = this->_redHearts; if (this->_maxHearts < this->_redHearts) { iVar5 = this->_maxHearts; } iVar5 = (iVar5 + 1) / 2 + (this->_soulHearts + 1) / 2 + this->_boneHearts; if (iVar5 < iVar2) { BreakGoldenHearts(this,iVar2 - iVar5); this->_goldenHearts = iVar5; } } update_bone_hearts(this); return; } //@@ 007792f0 FUN_007792f0 void FUN_007792f0(undefined4 param_1,undefined4 param_2) { int in_ECX; *(undefined4 *)(in_ECX + 0x164c) = param_1; *(undefined4 *)(in_ECX + 0x1650) = param_2; return; } //@@ 00779320 Entity_Player::GetFocusEntity /* ZHL [exact] __thiscall Entity* Entity_Player::GetFocusEntity(); prototype: REPENTOGON, confirmed by RET 0 */ Entity * __thiscall Entity_Player::GetFocusEntity(Entity_Player *this) { Entity *pEVar1; uint uVar2; void **ppvVar3; pEVar1 = this->_markedTarget; if (pEVar1 == (Entity *)0x0) { uVar2 = 0; ppvVar3 = this->_weapons; do { ppvVar3 = ppvVar3 + 1; if ((*ppvVar3 != (int *)0x0) && (pEVar1 = (Entity *)(**(code **)(*(int *)*ppvVar3 + 0x24))(), pEVar1 != (Entity *)0x0)) { return pEVar1; } uVar2 = uVar2 + 1; } while (uVar2 < 4); pEVar1 = (Entity *)0x0; } return pEVar1; } //@@ 00779360 Entity_Player::GetMovementJoystick /* ZHL [lua] Lua binding EntityPlayer:GetMovementJoystick prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity_Player::GetMovementJoystick(Entity_Player *this,Vector *outJoystick) { byte bVar1; uint curses; EntityPtr extraout_ECX; EntityPtr unused; int unused_00; int unused_01; int unused_02; void *seedEffectsEnd; float fVar2; float rightValue; float cardinalPositive; float resultX; float minusOne; float joystickX; float cardinalY; float joystickY; undefined4 seedKey; undefined1 seedIter [8]; void *seedNode; Game *game; int playerType; EntityPtr twin; playerType = this->_playerType; unused = (EntityPtr)this; if ((((playerType == 0x14) || ((unused = this->_parent, unused != (EntityPtr)0x0 && (*(int *)((int)unused + 0x28) == 1)))) || (((playerType == 0x1d || (playerType == 0x26)) && ((((twin = this->_twinPlayer, twin != (EntityPtr)0x0 && (unused = *(EntityPtr *)((int)twin + 0x161c), unused != (EntityPtr)0xffffffff)) && ((int)unused < this->_playerIndex)) && (twin != (EntityPtr)this)))))) && ((this->_isControlsEnabled != 0 && (this->_controlsCooldown < 1)))) { bVar1 = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)0x0,(int)unused); fVar2 = g_vectorZero.y; unused = extraout_ECX; if (bVar1 != 0) { outJoystick->x = g_vectorZero.x; outJoystick->y = fVar2; return outJoystick; } } fVar2 = InputManager::GetActionValue(0,this->_controllerIndex,(Entity *)this,(int)unused); cardinalY = 0.0; rightValue = InputManager::GetActionValue(1,this->_controllerIndex,(Entity *)this,unused_00); joystickX = rightValue + (0.0 - fVar2); fVar2 = InputManager::GetActionValue(2,this->_controllerIndex,(Entity *)this,unused_01); joystickY = InputManager::GetActionValue(3,this->_controllerIndex,(Entity *)this,unused_02); game = g_game; joystickY = joystickY + (0.0 - fVar2); minusOne = (float)&DAT_bf800000; if ((1 < *(int *)&g_game->_deathmatchManager) && ((this->_flags & 0x200) != 0)) { joystickX = joystickX * -1.0; joystickY = joystickY * -1.0; } seedKey = 0xc; resultX = joystickX; fVar2 = joystickY; std::set::find_node(seedIter,&seedKey); if ((*(char *)((int)seedNode + 0xd) == '\0') && (*(int *)((int)seedNode + 0x10) < 0xd)) { seedEffectsEnd = (game->_seedEffects)._seedEffects; if (seedNode != seedEffectsEnd) { resultX = resultX * minusOne; fVar2 = fVar2 * minusOne; joystickX = resultX; joystickY = fVar2; } } else { seedEffectsEnd = (game->_seedEffects)._seedEffects; } seedKey = 0x4c; std::set::find_node(seedIter,&seedKey); if (((*(char *)((int)seedNode + 0xd) == '\0') && (*(int *)((int)seedNode + 0x10) < 0x4d)) && (seedNode != seedEffectsEnd)) { cardinalPositive = 0.0; if (ABS(resultX) <= ABS(fVar2)) { joystickX = 0.0; if (0.0 <= fVar2) { cardinalPositive = 1.0; goto LAB_00779591; } cardinalY = minusOne; } else if (0.0 <= resultX) { joystickX = 1.0; LAB_00779591: cardinalY = cardinalPositive; } else { joystickX = minusOne; } fVar2 = sqrtf(fVar2 * fVar2 + resultX * resultX); joystickY = cardinalY * fVar2; resultX = joystickX * fVar2; joystickX = resultX; } if ((game->_currentDimensionIdx != 1) || ((game->_stageType != 4 && (game->_stageType != 5)))) goto LAB_00779606; if (game->_stage != 2) { if (game->_stage != 1) goto LAB_00779606; curses = Level::GetCurses((Level *)game); resultX = joystickX; if ((curses & 2) == 0) goto LAB_00779606; } resultX = resultX * -1.0; LAB_00779606: outJoystick->x = resultX; outJoystick->y = joystickY; return outJoystick; } //@@ 00779620 Entity_Player::GetShootingJoystick /* ZHL [lua] Lua binding EntityPlayer:GetShootingJoystick prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Entity_Player::GetShootingJoystick(Entity_Player *this,Vector *outJoystick) { float fVar1; int iVar2; byte bVar3; Vector *pVVar4; uint uVar5; int unused; int unused_00; int unused_01; int unused_02; Game *pGVar6; void *pvVar7; undefined1 *puVar8; float fVar9; undefined1 *puVar10; undefined1 *local_28; undefined4 local_24; Vector local_20; void *local_18; undefined1 local_14 [8]; void *local_c; pGVar6 = g_game; local_28 = (undefined1 *)0x0; outJoystick->y = 0.0; outJoystick->x = 0.0; local_24 = 0x4a; std::set::find_node(&local_20,&local_24); if ((*(char *)((int)local_18 + 0xd) == '\0') && (*(int *)((int)local_18 + 0x10) < 0x4b)) { pvVar7 = (pGVar6->_seedEffects)._seedEffects; if (local_18 == pvVar7) goto LAB_00779739; pVVar4 = GetMovementJoystick(this,&local_20); pGVar6 = g_game; fVar9 = pVVar4->y; outJoystick->x = pVVar4->x; outJoystick->y = fVar9; } else { pvVar7 = (pGVar6->_seedEffects)._seedEffects; LAB_00779739: local_24 = 0x4b; std::set::find_node(&local_20,&local_24); if (((*(char *)((int)local_18 + 0xd) == '\0') && (*(int *)((int)local_18 + 0x10) < 0x4c)) && (local_18 != pvVar7)) { pVVar4 = GetMovementJoystick(this,&local_20); pGVar6 = g_game; fVar9 = pVVar4->y * -1.0; outJoystick->x = pVVar4->x * -1.0; outJoystick->y = fVar9; } else { fVar9 = InputManager::GetActionValue(4,this->_controllerIndex,(Entity *)this,unused); iVar2 = this->_controllerIndex; outJoystick->x = outJoystick->x - fVar9; fVar9 = InputManager::GetActionValue(5,iVar2,(Entity *)this,unused_00); iVar2 = this->_controllerIndex; outJoystick->x = fVar9 + outJoystick->x; fVar9 = InputManager::GetActionValue(6,iVar2,(Entity *)this,unused_01); iVar2 = this->_controllerIndex; outJoystick->y = outJoystick->y - fVar9; fVar9 = InputManager::GetActionValue(7,iVar2,(Entity *)this,unused_02); pGVar6 = g_game; fVar9 = fVar9 + outJoystick->y; outJoystick->y = fVar9; bVar3 = Game::IsInTimedSet(pGVar6,0xc); if (bVar3 != 0) { fVar9 = fVar9 * -1.0; outJoystick->x = outJoystick->x * -1.0; outJoystick->y = fVar9; } } } puVar8 = &DAT_bf800000; local_24 = 0x4c; std::set::find_node(local_14,&local_24); if (((*(char *)((int)local_c + 0xd) != '\0') || (0x4c < *(int *)((int)local_c + 0x10))) || (local_c == (pGVar6->_seedEffects)._seedEffects)) goto LAB_007798af; fVar1 = outJoystick->x; if (ABS(fVar1) <= ABS(fVar9)) { puVar10 = (undefined1 *)0x0; if (0.0 <= fVar9) { puVar8 = (undefined1 *)0x3f800000; } LAB_00779872: local_28 = puVar8; } else { if (0.0 <= fVar1) { puVar10 = (undefined1 *)0x3f800000; puVar8 = (undefined1 *)0x0; goto LAB_00779872; } puVar10 = puVar8; } fVar9 = sqrtf(fVar1 * fVar1 + fVar9 * fVar9); outJoystick->x = (float)puVar10 * fVar9; outJoystick->y = (float)local_28 * fVar9; LAB_007798af: if (((pGVar6->_currentDimensionIdx == 1) && ((pGVar6->_stageType == 4 || (pGVar6->_stageType == 5)))) && ((pGVar6->_stage == 2 || ((pGVar6->_stage == 1 && (uVar5 = Level::GetCurses((Level *)pGVar6), (uVar5 & 2) != 0)))))) { outJoystick->x = outJoystick->x * -1.0; } return outJoystick; } //@@ 00779900 Entity_Player::GetBodyMoveDirection /* ZHL [exact] __thiscall void Entity_Player::GetBodyMoveDirection(Vector * buffer); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::GetBodyMoveDirection(Entity_Player *this,Vector *buffer) { byte bVar1; void *pvVar2; void *pvVar3; float fVar4; float local_10; float local_c; local_10 = (this->_recentMovementVector).x; pvVar3 = this->_weapons[0]; local_c = (this->_recentMovementVector).y; if (pvVar3 == (void *)0x0) { if (this->_weapons[1] != (void *)0x0) { pvVar2 = this->_weapons[1]; goto LAB_00779944; } } else { pvVar2 = pvVar3; LAB_00779944: if ((*(float *)((int)pvVar2 + 0x3c) != g_vectorZero.x) || (*(float *)((int)pvVar2 + 0x40) != g_vectorZero.y)) { if (pvVar3 == (void *)0x0) { pvVar3 = this->_weapons[1]; } fVar4 = *(float *)((int)pvVar3 + 0x40); buffer->x = *(float *)((int)pvVar3 + 0x3c); buffer->y = fVar4; return; } } bVar1 = HasCollectible(this,0x2a8,0); if (bVar1 != 0) { pvVar3 = this->_montezumaLaser; if ((pvVar3 == (void *)0x0) || (*(int *)((int)pvVar3 + 0x28) != 7)) { if (this->_montezumaChargeTimer < 1) goto LAB_007799dd; fVar4 = this->_bodyAngle; } else { fVar4 = *(float *)((int)pvVar3 + 0x41c) + 180.0; } local_10 = cos(fVar4 * 0.017453292); local_c = sin(fVar4 * 0.017453292); } LAB_007799dd: buffer->x = local_10; buffer->y = local_c; return; } //@@ 00779a20 Entity_Player::GetWeaponModifiers /* ZHL [exact] __thiscall int Entity_Player::GetWeaponModifiers(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Player::GetWeaponModifiers(Entity_Player *this) { byte bVar1; uint uVar2; uint uVar3; bVar1 = HasCollectible(this,0x45,0); uVar3 = (uint)(bVar1 != 0); bVar1 = HasCollectible(this,0x13c,0); if (bVar1 != 0) { uVar3 = uVar3 | 2; } bVar1 = HasCollectible(this,0x76,0); if (bVar1 != 0) { uVar3 = uVar3 | 4; } bVar1 = HasCollectible(this,0xe5,0); if (bVar1 != 0) { uVar3 = uVar3 | 8; } bVar1 = HasCollectible(this,0x149,0); if (bVar1 != 0) { uVar3 = uVar3 | 0x10; } bVar1 = HasCollectible(this,0xde,0); if (bVar1 != 0) { uVar3 = uVar3 | 0x20; } bVar1 = HasCollectible(this,0x18d,0); if (bVar1 != 0) { uVar3 = uVar3 | 0x40; } bVar1 = HasCollectible(this,0x255,0); if (bVar1 != 0) { uVar3 = uVar3 | 0x100; } bVar1 = HasCollectible(this,0x14a,0); if ((bVar1 != 0) || (bVar1 = HasCollectible(this,0x231,0), bVar1 != 0)) { uVar3 = uVar3 | 0x80; } uVar2 = uVar3 | 0x200; if (this->_playerType != 0x1c) { uVar2 = uVar3; } bVar1 = HasCollectible(this,0x2a6,0); if (bVar1 != 0) { uVar2 = uVar2 | 0x800; } return uVar2; } //@@ 00779b40 Entity_Player::update_body_animations /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Head*/Walk*/Blink/Shimmer anims, only caller Entity_Player::Update; ZHL called it RoomTransition::Update */ void __thiscall Entity_Player::update_body_animations(Entity_Player *this) { byte bVar1; Vector *vecResult; int nextCooldown; int iVar2; float *pfVar3; char *headAnimName; uint uVar4; void *pvVar5; Entity *spawnedEffect; ColorMod *color; byte extraout_CL; byte isUnused; byte isUnused_00; byte isUnused_01; byte isUnused_02; byte isUnused_03; EntityPtr EVar6; byte *blinkAnimName; uint uVar7; float fVar8; float normalDot; float fVar9; float fVar10; Vector local_70; float local_68; float local_64; float local_60; float moveX; byte *local_58; float local_54; undefined8 animNameString; uint local_34; undefined4 local_30; Vector local_2c; int moveActions [2]; Vector VStack_1c; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; qword flags; float gridVelocityX; bool isSlippery; TemporaryEffects *tempEffects; local_8 = 0xffffffff; puStack_c = &LAB_00aff2ed; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(moveActions + 8); if (this->_heightVelocity <= 0.0 && this->_heightVelocity != 0.0) { return; } pfVar3 = &(this->_posOffset).y; if (*pfVar3 <= 0.0 && *pfVar3 != 0.0) { return; } EVar6 = this->_target; if (EVar6 != (EntityPtr)0x0) { fVar8 = *(float *)((int)EVar6 + 0x340); fVar9 = (this->_pos).y; (this->_velocity).x = *(float *)((int)EVar6 + 0x33c) - (this->_pos).x; (this->_velocity).y = fVar8 - fVar9; return; } ExceptionList = &local_10; (this->_lastVelocity).x = (this->_velocity).x; (this->_lastVelocity).y = (this->_velocity).y; moveX = g_vectorZero.x; local_2c.x = g_vectorZero.x; local_54 = g_vectorZero.y; local_2c.y = g_vectorZero.y; if ((this->_isControlsEnabled != 0) && (this->_controlsCooldown < 1)) { vecResult = GetMovementJoystick(this,&VStack_1c); moveX = vecResult->x; local_54 = vecResult->y; local_2c.x = moveX; local_2c.y = local_54; bVar1 = Entity::HasEntityFlags((Entity *)this,0x8000); if ((bVar1 != 0) && (this->_canFly == 0)) { local_54 = 0.0; local_2c.y = 0.0; } fVar8 = sqrtf(moveX * moveX + local_54 * local_54); if (1.0 < fVar8) { Vector::Normalize(&local_2c); local_54 = local_2c.y; moveX = local_2c.x; } } iVar2 = this->_playerType; if ((((iVar2 == 0x23) && (this->_isCoopGhost == 0)) || (this->_suplexState != 0)) || (this->_darkArtsBlastPending != 0)) { moveX = g_vectorZero.x; local_2c.x = g_vectorZero.x; local_54 = g_vectorZero.y; local_2c.y = g_vectorZero.y; } if (((((iVar2 == 0x13) || (iVar2 == 0x14)) || ((iVar2 == 0x1d || (iVar2 == 0x26)))) && (this->_twinPlayer != (EntityPtr)0x0)) || (iVar2 == 0x1a)) { EVar6 = this->_twinPlayer; if (((EVar6 == (EntityPtr)0x0) || (*(int *)((int)EVar6 + 0x161c) == -1)) || (this->_playerIndex <= *(int *)((int)EVar6 + 0x161c))) { EVar6 = (EntityPtr)this; } vecResult = GetMovementJoystick((Entity_Player *)EVar6,&VStack_1c); if ((vecResult->x != g_vectorZero.x) || (vecResult->y != g_vectorZero.y)) { this->_actionHoldDrop = 0; } } tempEffects = &this->_temporaryeffects; bVar1 = TemporaryEffects::HasNullEffect(tempEffects,0x3f); if (bVar1 == 0) { this->_reverseChariotMoveCooldown = 0; fVar8 = moveX; fVar9 = local_54; } else { fVar8 = sqrtf(moveX * moveX + local_54 * local_54); if (fVar8 <= 0.25) { iVar2 = this->_reverseChariotMoveCooldown + -1; } else if (this->_reverseChariotMoveCooldown < 1) { vecResult = Vector::Normalized(&local_2c,&VStack_1c); fVar8 = this->_speedMultiplier; fVar9 = vecResult->y; (this->_velocity).x = (vecResult->x + vecResult->x) * fVar8 + (this->_velocity).x; (this->_velocity).y = (fVar9 + fVar9) * fVar8 + (this->_velocity).y; iVar2 = 5; } else { nextCooldown = this->_reverseChariotMoveCooldown + -1; iVar2 = 1; if (1 < nextCooldown) { iVar2 = nextCooldown; } } this->_reverseChariotMoveCooldown = iVar2; fVar8 = g_vectorZero.x; fVar9 = g_vectorZero.y; } fVar10 = 0.6; if (0 < this->_ponyCharge) { vecResult = Vector::ToCardinal(&local_2c,&this->_movementVector); fVar8 = fVar8 + (vecResult->x - fVar8) * fVar10; fVar9 = fVar9 + (vecResult->y - fVar9) * fVar10; } (this->_movementVector).x = fVar8; (this->_movementVector).y = fVar9; if ((fVar8 != g_vectorZero.x) || (fVar9 != g_vectorZero.y)) { (this->_recentMovementVector).x = fVar8; (this->_recentMovementVector).y = fVar9; } this->_moveDirection = -1; fVar10 = this->_movespeed * 0.25 + 0.75; fVar8 = fVar8 * fVar10; fVar10 = fVar10 * fVar9; local_68 = fVar10; if (ABS(fVar8) <= ABS(fVar10)) { if (0.0 <= fVar10) { iVar2 = -1; if (0.0 < fVar10) { this->_moveDirection = 3; iVar2 = 3; } } else { this->_moveDirection = 1; iVar2 = 1; } } else { iVar2 = 0; if (0.0 <= fVar8) { iVar2 = 2; } this->_moveDirection = iVar2; } moveX = fVar8; if (this->_suplexState == 1) { iVar2 = Entity::get_velocity_direction((Entity *)this); this->_moveDirection = iVar2; } if (iVar2 != -1) { fVar8 = atan2f(fVar10,fVar8); fVar8 = LerpAngleDeg(this->_bodyAngle,fVar8 * 57.295776,0.3); this->_bodyAngle = fVar8; fVar8 = moveX; fVar10 = local_68; } local_60 = (this->_velocity).x; local_58 = (byte *)(this->_velocity).y; local_54 = ((float)this->_slipperyTimer - 0.0) / 60.0; if ((this->_playerType == 0x23) && (this->_isCoopGhost == 0)) { bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); fVar8 = local_60; if (bVar1 == 0) { local_64 = local_54 * 0.51 + 0.45; } else { local_64 = 0.97; } } else { local_64 = 1.0; fVar8 = local_60; } } else { fVar9 = *(float *)&this->_flags; uVar7 = *(uint *)((int)&this->_flags + 4); if (((uint)fVar9 & 0x80) != 0) { local_54 = 0.0; } if (((fVar8 != 0.0) || (local_2c.x = fVar9, fVar10 != 0.0)) && ((((uint)fVar9 & 0x8000) == 0 || (local_2c.x = fVar9, this->_canFly != 0)))) { local_64 = (this->_velocity).x; local_70.y = (float)local_58 * fVar10 + local_64 * fVar8; local_60 = fVar8 * local_70.y; local_70.y = local_70.y * fVar10; fVar8 = sqrtf(local_54 * 0.19999999 + 0.8); (this->_velocity).x = (local_64 - local_60) * fVar8 + local_60; (this->_velocity).y = ((float)local_58 - local_70.y) * fVar8 + local_70.y; local_2c.x = *(float *)&this->_flags; uVar7 = *(uint *)((int)&this->_flags + 4); fVar8 = moveX; } local_58 = (byte *)(this->_velocity).y; local_60 = (this->_velocity).x; local_64 = 0.0; local_70.y = (local_54 * 0.7 - 0.2) * (local_60 * fVar8 + (float)local_58 * local_68); pfVar3 = &local_70.y; if (local_70.y <= 0.0) { pfVar3 = &local_64; } local_70.y = (*pfVar3 / this->_movespeed + 3.0) * 0.4; if ((uVar7 & 0x4000000) == 0) { bVar1 = TemporaryEffects::HasNullEffect(tempEffects,0x3f); if (((bVar1 == 0) && (this->_suplexState < 2)) && ((this->_playerType != 0x23 || (this->_isCoopGhost != 0)))) { fVar8 = local_54 * 0.185 + 0.775; } else { fVar8 = local_54 * 0.51 + 0.45; } } else { fVar8 = 1.0; } local_64 = sqrtf(fVar8); fVar10 = this->_movespeed * 4.41; fVar9 = (local_70.y * 0.25 - local_70.y) * local_54 + local_70.y; fVar8 = moveX * 0.5 * fVar9 + local_60; local_2c.y = local_68 * 0.5 * fVar9 + (this->_velocity).y; (this->_velocity).y = local_2c.y; isSlippery = 0.0 < local_54; local_54 = fVar8; if ((isSlippery) && (local_70.y = fVar8 * fVar8 + local_2c.y * local_2c.y, fVar10 * fVar10 < local_70.y)) { VStack_1c.y = sqrtf(local_60 * local_60 + (float)local_58 * (float)local_58); fVar9 = sqrtf(local_70.y); fVar8 = local_54; if (0.0 < fVar9) { fVar8 = local_54 * (VStack_1c.y / fVar9); (this->_velocity).x = fVar8; (this->_velocity).y = (VStack_1c.y / fVar9) * local_2c.y; } } } flags = this->_flags; local_2c.y = fVar8 * local_64; (this->_velocity).x = local_2c.y; if (((flags & 0x8000) == 0) || (this->_canFly != 0)) { (this->_velocity).y = local_64 * (this->_velocity).y; } else { (this->_velocity).y = (this->_velocity).y + 0.225; } bVar1 = TemporaryEffects::HasNullEffect(tempEffects,0x32); if (bVar1 != 0) { bVar1 = this->_collidesWithGrid; (this->_velocity).x = local_60 * 0.05 + local_2c.y; (this->_velocity).y = (float)local_58 * 0.05 + (this->_velocity).y; if (bVar1 != 0) { fVar8 = (this->_gridCollisionNormal).y; fVar9 = (this->_gridCollisionNormal).x; fVar10 = (this->_gridCollisionVelocity).y; gridVelocityX = (this->_gridCollisionVelocity).x; normalDot = fVar9 * gridVelocityX + fVar8 * fVar10; fVar9 = fVar9 * normalDot * 0.8; fVar8 = fVar8 * normalDot * 0.8; (this->_velocity).x = gridVelocityX - (fVar9 + fVar9); (this->_velocity).y = fVar10 - (fVar8 + fVar8); } } if ((this->_flags & 0x4000) != 0) goto LAB_0077ae15; bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x5d); if (bVar1 != 0) { switch(this->_moveDirection) { case 0: case 1: bVar1 = 0x4c; local_2c.x = 1.12104e-44; animNameString = 0x7466654c64616548; local_34 = local_34 & 0xffffff00; local_8 = 1; break; default: local_2c.x = 1.26117e-44; animNameString = 0x6867695264616548; local_34 = CONCAT22(local_34._2_2_,0x74); local_8 = 0; bVar1 = extraout_CL; } local_2c.y = 2.10195e-44; PlayCollectibleAnim(this,0x5d,0,&animNameString,-1,bVar1); local_8 = 0xffffffff; if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar5 = (void *)animNameString; if (0xfff < uVar7) { pvVar5 = *(void **)((int)(void *)animNameString + -4); uVar7 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)(void *)animNameString + (-4 - (int)pvVar5))) goto LAB_0077a500; } operator_delete(pvVar5,uVar7); } } bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x4d); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x12a); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,299); if ((bVar1 == 0) || (pvVar5 = TemporaryEffects::GetCollectibleEffect(tempEffects,299), *(int *)((int)pvVar5 + 8) < 1)) { bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x3a); if (bVar1 != 0) { switch(this->_moveDirection) { case 0: local_58 = (byte *)0xb1da88; break; case 1: local_58 = (byte *)&DAT_00b1e020; break; case 2: local_58 = (byte *)0xb1dac0; break; default: local_58 = (byte *)0xb1e044; } pvVar5 = TemporaryEffects::GetCollectibleEffect(tempEffects,0x3a); blinkAnimName = (byte *)"Blink"; if (0x59 < *(int *)((int)pvVar5 + 8)) { blinkAnimName = local_58; } std::string::string_from_cstr((char *)&animNameString,blinkAnimName); local_8 = 5; PlayCollectibleAnim(this,0x3a,1,&animNameString,-1,isUnused_02); local_8 = 0xffffffff; if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar5 = (void *)animNameString; if (0xfff < uVar7) { pvVar5 = *(void **)((int)(void *)animNameString + -4); uVar4 = (int)(void *)animNameString + (-4 - (int)pvVar5); goto joined_r0x0077a7e1; } goto LAB_0077a7e7; } } } else { switch(this->_moveDirection) { case 0: headAnimName = "HeadLeft"; break; case 1: headAnimName = "HeadUp"; break; case 2: headAnimName = "HeadRight"; break; default: headAnimName = "HeadDown"; } std::string::string_from_cstr((char *)&animNameString,(byte *)headAnimName); local_8 = 4; PlayCollectibleAnim(this,299,0,&animNameString,0,isUnused_01); local_8 = 0xffffffff; if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar5 = (void *)animNameString; if (0xfff < uVar7) { pvVar5 = *(void **)((int)(void *)animNameString + -4); uVar4 = (int)(void *)animNameString + (-4 - (int)pvVar5); goto joined_r0x0077a7e1; } goto LAB_0077a7e7; } } } else { switch(this->_moveDirection) { case 0: headAnimName = "HeadLeft"; break; case 1: headAnimName = "HeadUp"; break; case 2: headAnimName = "HeadRight"; break; default: headAnimName = "HeadDown"; } std::string::string_from_cstr((char *)&animNameString,(byte *)headAnimName); local_8 = 3; PlayCollectibleAnim(this,0x12a,0,&animNameString,-1,isUnused_00); local_8 = 0xffffffff; if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar5 = (void *)animNameString; if (0xfff < uVar7) { pvVar5 = *(void **)((int)(void *)animNameString + -4); uVar4 = (int)(void *)animNameString + (-4 - (int)pvVar5); goto joined_r0x0077a7e1; } goto LAB_0077a7e7; } } } else { switch(this->_moveDirection) { case 0: headAnimName = "HeadLeft"; break; case 1: headAnimName = "HeadUp"; break; case 2: headAnimName = "HeadRight"; break; default: headAnimName = "HeadDown"; } std::string::string_from_cstr((char *)&animNameString,(byte *)headAnimName); local_8 = 2; PlayCollectibleAnim(this,0x4d,0,&animNameString,-1,isUnused); local_8 = 0xffffffff; if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar5 = (void *)animNameString; if (0xfff < uVar7) { pvVar5 = *(void **)((int)(void *)animNameString + -4); uVar4 = (int)(void *)animNameString + (-4 - (int)pvVar5); joined_r0x0077a7e1: uVar7 = (int)local_2c.y + 0x24; if (0x1f < uVar4) goto LAB_0077a500; } LAB_0077a7e7: local_8 = 0xffffffff; operator_delete(pvVar5,uVar7); } } bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x139); if (bVar1 != 0) { local_2c.y = 2.10195e-44; local_2c.x = 9.80909e-45; animNameString = 0x72656d6d696853; local_8 = 6; PlayCollectibleAnim(this,0x139,1,&animNameString,-1,isUnused_03); local_8 = 0xffffffff; if (0xf < (uint)local_2c.y) { uVar7 = (int)local_2c.y + 1; pvVar5 = (void *)animNameString; if (0xfff < uVar7) { pvVar5 = *(void **)((int)(void *)animNameString + -4); uVar7 = (int)local_2c.y + 0x24; if (0x1f < (uint)((int)(void *)animNameString + (-4 - (int)pvVar5))) { LAB_0077a500: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar7); } } bVar1 = HasCollectible(this,0x252,0); if (bVar1 == 0) { this->_jupiterCharge = 0.0; } else { local_54 = this->_jupiterCharge; if ((moveX == g_vectorZero.x) && (local_68 == g_vectorZero.y)) { fVar8 = (this->_velocity).y; fVar9 = (this->_velocity).x; if (fVar9 * fVar9 + fVar8 * fVar8 < 1.0) { fVar8 = this->_speedMultiplier / 60.0 + local_54; if (1.0 <= fVar8) { fVar8 = 1.0; } this->_jupiterCharge = fVar8; } } else { local_2c.y = local_54 - this->_speedMultiplier / 60.0; if (local_2c.y <= 0.0) { local_2c.y = 0.0; } this->_jupiterCharge = local_2c.y; if (0.0 < local_2c.y) { local_60 = 2.0; iVar2 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0); if (iVar2 != 0) { if (0.3 < local_2c.y) { uVar7 = Random(); play_sound_with_fart_seed(0x25,this->_jupiterCharge,(uVar7 & 7) + 5,0,1.0); } fVar8 = (this->_recentMovementVector).y; fVar9 = (this->_recentMovementVector).x; if (fVar9 * fVar9 + fVar8 * fVar8 <= 0.01) { iVar2 = this->_moveDirection; if (iVar2 == -1) { iVar2 = 3; } vecResult = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_1c,iVar2); } else { vecResult = Vector::Normalized(&this->_recentMovementVector,&local_2c); } local_68 = -vecResult->x; local_58 = (byte *)((uint)vecResult->y ^ 0x80000000); uVar7 = Random(); uVar4 = Random(); local_2c.y = ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; VStack_1c.y = cos(local_2c.y); local_2c.y = sin(local_2c.y); uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 20.0 + 6.0; local_70.x = local_68 * 4.0 + (this->_pos).x; local_2c.x = (VStack_1c.y * local_68 - local_2c.y * (float)local_58) * fVar8; local_2c.y = (local_2c.y * local_68 + VStack_1c.y * (float)local_58) * fVar8; local_70.y = (float)local_58 * 4.0 + (this->_pos).y; spawnedEffect = Game::Spawn(g_game,1000,99,&local_70,&local_2c,(Entity *)0x0,1,uVar7); uVar7 = Random(); fVar9 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 1.5 + 1.0; fVar8 = (spawnedEffect->_sprite)._scale.x; (spawnedEffect->_sprite)._scale.y = fVar9 * (spawnedEffect->_sprite)._scale.y; (spawnedEffect->_sprite)._scale.x = fVar9 * fVar8; color = (ColorMod *)Color::Color(0x3f800000); Sprite::SetColor((Sprite *)&spawnedEffect->_sprite,color); (**(code **)(*(int *)spawnedEffect + 0xc))(); uVar7 = Random(); local_2c.y = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292; VStack_1c.y = cos(local_2c.y); local_2c.y = sin(local_2c.y); uVar7 = Random(); fVar8 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 10.0; local_2c.x = (VStack_1c.y * local_68 - local_2c.y * (float)local_58) * fVar8; local_2c.y = (local_2c.y * local_68 + VStack_1c.y * (float)local_58) * fVar8; uVar7 = Random(); uVar4 = Random(); fVar8 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0; VStack_1c.y = fVar8 * (float)local_58 + (this->_pos).y; VStack_1c.x = fVar8 * local_68 + (this->_pos).x; spawnedEffect = Game::Spawn(g_game,1000,0x8d,&VStack_1c,&local_2c,(Entity *)this,0,uVar7); uVar7 = Random(); iVar2 = uVar7 % 0x1e + 0x3c; *(int *)(spawnedEffect[1]._sprite._filename._buf + 8) = iVar2; *(int *)(spawnedEffect[1]._sprite._filename._buf + 0xc) = iVar2; bVar1 = HasTrinket(this,0x86,0); if (bVar1 == 0) { local_60 = 1.0; } uVar7 = Random(); fVar9 = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.6) * local_60; fVar8 = fVar9 * g_vectorOne.x; (spawnedEffect->_sprite)._scale.y = fVar9 * g_vectorOne.y; (spawnedEffect->_sprite)._scale.x = fVar8; (**(code **)(*(int *)spawnedEffect + 0x40))(this->_meleeDamage * 0.5); (**(code **)(*(int *)spawnedEffect + 0xc))(); } } } if (this->_jupiterCharge != local_54) { this->_cacheFlags = this->_cacheFlags | 0x10; (this->_temporaryeffects)._shouldEvaluateCache = 1; } } LAB_0077ae15: bVar1 = HasCollectible(this,0x251,0); if ((bVar1 != 0) && (this->_isControlsEnabled != 0)) { iVar2 = 0; moveActions[0] = 0; moveActions[1] = 1; VStack_1c.x = 2.8026e-45; VStack_1c.y = 4.2039e-45; do { bVar1 = input_is_action_triggered (g_manager,moveActions[iVar2],this->_controllerIndex,(Entity *)this,0); if (bVar1 != 0) { if ((((this->_marsLastTapDirection == iVar2) && (this->_marsTapFrames < 0xb)) && (bVar1 = HasCollectible(this,0x251,0), bVar1 != 0)) && (this->_marsCooldown < 1)) { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x944 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU)) && (uVar7 = *(uint *)((int)pvVar5 + 0x944), uVar7 != 0)) { local_2c.x = *(float *)(uVar7 + 0x78); local_30 = 0; local_2c.y = 0.0; local_34 = uVar7; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_34,0,1); } this->_marsUnk2 = this->_marsLastTapDirection; this->_marsCooldown = this->_marsUnk1; this->_marsUnkBool = 0; } this->_marsLastTapDirection = iVar2; this->_marsTapFrames = 0; } iVar2 = iVar2 + 1; } while (iVar2 < 4); } iVar2 = this->_marsTapFrames + 1; if (10000 < iVar2) { iVar2 = 10000; } this->_marsTapFrames = iVar2; bVar1 = HasTrinket(this,0x6d,0); if ((bVar1 == 0) || (iVar2 = GetTrinketMultiplier(this,0x6d), iVar2 < 2)) { this->_ductTapeMode = 0; } else if ((this->_isControlsEnabled != 0) && (bVar1 = input_is_action_triggered(g_manager,0xb,this->_controllerIndex,(Entity *)this,0), bVar1 != 0)) { uVar7 = this->_ductTapeMode + 1U & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } this->_ductTapeMode = uVar7; if (uVar7 == 0) { this->_ductTapeMode = 1; } } ExceptionList = local_10; return; } //@@ 0077b020 Entity_Player::update_shooting /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from player Update; reads shoot actions 4-7, GetMouseAimTarget/GetShootingJoystick, Head* anims, LiftItem/HideItem per held active (0x2a,0x2f,0x31,0x121,0x160...), 'No Such State %d' */ void Entity_Player::update_shooting(void) { TemporaryEffects *this; code *pcVar1; longlong lVar2; longlong lVar3; Vector direction; Vector velocity; Vector position; Vector position_00; ANM2 *pAVar4; qword qVar5; qword qVar6; byte bVar7; char cVar8; undefined2 uVar9; uint uVar10; undefined2 extraout_var; Vector *pVVar11; void *pvVar12; Entity *tmpEntity; BitSet128 *pBVar13; EntityPtr EVar14; undefined4 extraout_EAX; undefined4 *puVar15; RNG *rng; Vector *pVVar16; char *pcVar17; ItemConfig *itemConfig; ItemConfig_Item *nullItem; EntityPtr *pEVar18; Vector *posOffset; Entity_Laser *laser; Weapon *weapon; int *piVar19; Entity_Effect *effect; ColorMod *entityColor; Room *room; EntityList *this_00; Entity_Familiar *this_01; Entity_Player *tmpPlayer; std_string *animName; Vector *other; Entity_Tear *tear; Vector *posOffset_00; Vector *other_00; Vector *other_01; EntityConfig *this_02; EntityConfig_Entity *entityConfigEntry; Entity_Knife *knife; void *pvVar20; Vector *other_02; Vector *other_03; Vector *vector; Vector *vector_00; Vector *this_03; Vector *vec; ColorMod *color; Sprite *this_04; LayerState *costumeLayer; void **ppvVar21; int iVar22; Entity_Player *in_ECX; uint uVar23; int iVar24; Game *game; uint uVar25; undefined1 *puVar26; bool bVar27; float10 fVar28; float fVar29; EntityPtr EVar30; float fVar31; float fVar32; float fVar33; ulonglong uVar34; BitSet128 *pBVar35; BitSet128 *pBVar36; undefined4 uVar37; TypeDescriptor *pTVar38; TypeDescriptor *pTVar39; undefined4 uVar40; Vector inheritedVelocity; Vector cardinalDirection; EntityPtr local_30c; Vector local_308; Vector local_300; void **local_2f8; Vector local_2f4; Vector local_2ec; Vector local_2e4; uint local_2dc; Vector local_2d8; Vector local_2d0; byte isOpposingDirections; byte isDirectionHeld; Vector local_2c4; Vector local_2bc; EntityPtr local_2b4; Vector local_2b0; EntityPtr local_2a8; Vector shootDirection; Vector local_29c; Entity_Player *local_294; Vector local_290; char isInputAllowed; byte local_286; char local_285; EntityPtr local_284; byte isShooting; TearParams local_27c; TearParams local_214; Color local_1ac; undefined1 local_180 [56]; BitSet128 local_148; float local_138; float local_130; char local_118 [24]; char local_100 [24]; char local_e8 [24]; char local_d0 [24]; char local_b8 [8]; BitSet128 local_b0; char local_a0 [24]; char local_88 [8]; EntityList_EL local_80; undefined1 local_70 [52]; undefined1 local_3c [4]; float fStack_38; Vector VStack_34; char local_2c [4]; int enemyType; undefined1 auStack_24 [8]; float fStack_1c; int iStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00aff3d7; local_10 = ExceptionList; uVar10 = __security_cookie ^ (uint)(auStack_24 + 0x20); ExceptionList = &local_10; local_29c.y = 0.0; local_30c = (EntityPtr)0x0; shootDirection.x = g_vectorZero.x; shootDirection.y = g_vectorZero.y; isShooting = 0; isOpposingDirections = 0; if (((in_ECX->_isControlsEnabled == 0) || (0 < in_ECX->_controlsCooldown)) || (isInputAllowed = '\x01', (in_ECX->_flags & 0x800) != 0)) { isInputAllowed = '\0'; } local_294 = in_ECX; local_14 = uVar10; if ((in_ECX->_target != (EntityPtr)0x0) && (*(char *)((int)in_ECX->_target + 0x173) != '\0')) { in_ECX->_entityCollisionClass = 4; Entity::SetTarget((Entity *)in_ECX,(Entity *)0x0); } lVar3 = CONCAT44(local_2c4.y,local_290.y); if ((in_ECX->_playerType == 0x28) && (in_ECX->_itemState == 0)) { isInputAllowed = '\0'; lVar3 = CONCAT44(local_2c4.y,local_290.y); } else if (isInputAllowed != '\0') { if ((((in_ECX->_isPlayingExtraAnimation == 0) && (in_ECX->_isPlayingItemAnimation == 0)) || (bVar7 = ANM2::IsFinishedImpl(&in_ECX->_bodySprite,(byte *)"LiftItem"), bVar7 != 0)) && ((((in_ECX->_entityCollisionClass != 0 || (in_ECX->_suplexState == 2)) || ((in_ECX->_isCoopGhost != 0 || (((in_ECX->_flags & 0x200000000000000) != 0 || (bVar7 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x11a), bVar7 != 0)))))) || (bVar7 = IsHologram(in_ECX), bVar7 != 0)))) { local_286 = '\0'; local_285 = '\0'; bVar7 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4a); if ((bVar7 == 0) && (bVar7 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4b), bVar7 == 0)) { bVar7 = input_is_action_pressed(4,in_ECX->_controllerIndex,(Entity *)in_ECX,0); if (bVar7 != 0) { isShooting = 1; } local_284._1_3_ = 0; local_284._0_1_ = isShooting; bVar7 = input_is_action_pressed(5,in_ECX->_controllerIndex,(Entity *)in_ECX,0); if (bVar7 != 0) { local_285 = '\x01'; local_284._0_1_ = 1; } bVar7 = input_is_action_pressed(6,in_ECX->_controllerIndex,(Entity *)in_ECX,0); if (bVar7 != 0) { local_286 = '\x01'; local_284._0_1_ = 1; } iVar24 = in_ECX->_controllerIndex; iVar22 = 7; } else { bVar7 = input_is_action_pressed(0,in_ECX->_controllerIndex,(Entity *)in_ECX,0); uVar9 = CONCAT11(isShooting,bVar7); if (bVar7 != 0) { isShooting = 1; } local_284._1_3_ = SUB43(CONCAT22(extraout_var,uVar9) >> 8,0); local_284._0_1_ = isShooting; bVar7 = input_is_action_pressed(1,in_ECX->_controllerIndex,(Entity *)in_ECX,0); if (bVar7 != 0) { local_285 = '\x01'; local_284._0_1_ = 1; } bVar7 = input_is_action_pressed(2,in_ECX->_controllerIndex,(Entity *)in_ECX,0); if (bVar7 != 0) { local_286 = '\x01'; local_284._0_1_ = 1; } iVar24 = in_ECX->_controllerIndex; iVar22 = 3; } bVar7 = input_is_action_pressed(iVar22,iVar24,(Entity *)in_ECX,0); if (((bVar7 != 0) && (local_284._0_1_ = 1, local_286 != '\0')) || ((isShooting != 0 && (local_285 != '\0')))) { isOpposingDirections = 1; } bVar7 = GetMouseAimTarget(in_ECX,&shootDirection,0); if ((bVar7 == 0) && (local_284._0_1_ == 0)) { isShooting = 0; LAB_0077b373: pVVar11 = GetShootingJoystick(in_ECX,&local_29c); shootDirection.x = shootDirection.x + pVVar11->x; shootDirection.y = shootDirection.y + pVVar11->y; } else { isShooting = 1; if (bVar7 == 0) goto LAB_0077b373; } lVar3 = CONCAT44(local_2c4.y,local_290.y); if ((1 < *(int *)&g_game->_deathmatchManager) && ((in_ECX->_flags & 0x200) != 0)) { shootDirection.x = shootDirection.x * -1.0; shootDirection.y = shootDirection.y * -1.0; } if (0.001 < shootDirection.y * shootDirection.y + shootDirection.x * shootDirection.x) { uVar34 = GetTimeNs(); local_2bc.y = (float)(uVar34 >> 0x20); lVar2 = (uVar34 & 0xffffffff) * 0x431bde82; local_2a8 = SUB84((ulonglong)lVar2 >> 0x20,0); local_2f8 = (void **)((ulonglong)(uint)local_2bc.y * 0xd7b634db >> 0x20); lVar3 = (ulonglong)(uint)local_2bc.y * 0x431bde82; uVar34 = (ulonglong)(uint)local_2bc.y * 0xd7b634db + ((uVar34 & 0xffffffff) * 0xd7b634db >> 0x20); uVar25 = (uint)(uVar34 >> 0x20); lVar2 = lVar2 + (uVar34 & 0xffffffff); local_29c.x = (float)lVar2; uVar23 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar25,uVar23),uVar25 + uVar23); *(uint *)&local_294->field_0x1f90 = (uint)lVar2 >> 0x12 | (int)((ulonglong)lVar2 >> 0x20) * 0x4000; in_ECX = local_294; } local_2c4.y = (float)((ulonglong)lVar3 >> 0x20); local_290.y = (float)lVar3; piVar19 = in_ECX->_weapons[0]; if ((piVar19 == (int *)0x0) && (piVar19 = in_ECX->_weapons[1], piVar19 == (int *)0x0)) goto LAB_0077b57e; fVar28 = (float10)(**(code **)(*piVar19 + 0x18))(); local_2f8 = (void **)(float)fVar28; if ((0.0 < (float)local_2f8) && ((0.0 < (float)piVar19[5] && (isOpposingDirections == 0)))) { fVar29 = sqrtf(shootDirection.y * shootDirection.y + shootDirection.x * shootDirection.x); lVar3 = CONCAT44(local_2c4.y,local_290.y); if (fVar29 < 0.5) { shootDirection.x = g_vectorZero.x; shootDirection.y = g_vectorZero.y; isShooting = 0; goto LAB_0077b57e; } } } lVar3 = CONCAT44(local_2c4.y,local_290.y); } LAB_0077b57e: local_2c4.y = (float)((ulonglong)lVar3 >> 0x20); local_290.y = (float)lVar3; if ((in_ECX->_variant == 1) && (in_ECX->_babySkin == 7)) { if (shootDirection.x < 0.0) { fVar32 = -shootDirection.x * *(float *)&in_ECX->field_0x1af8; fVar29 = -shootDirection.x * *(float *)&in_ECX->field_0x1afc; } else { fVar32 = shootDirection.x * *(float *)&in_ECX->field_0x1af0; fVar29 = shootDirection.x * *(float *)&in_ECX->field_0x1af4; } if (shootDirection.y < 0.0) { fVar33 = -shootDirection.y * *(float *)&in_ECX->field_0x1b08; fVar31 = -shootDirection.y * *(float *)&in_ECX->field_0x1b0c; } else { fVar33 = shootDirection.y * *(float *)&in_ECX->field_0x1b00; fVar31 = shootDirection.y * *(float *)&in_ECX->field_0x1b04; } shootDirection.x = fVar32 + 0.0 + fVar33; shootDirection.y = fVar29 + 0.0 + fVar31; } local_2ec.y = shootDirection.y; local_284 = (EntityPtr)shootDirection.x; local_286 = 0; if (0 < in_ECX->_peeBurstCooldown) { if (in_ECX->_peeBurstCooldown < in_ECX->_maxPeeBurstCooldown + -5) { isShooting = 1; local_286 = 1; if ((shootDirection.x == g_vectorZero.x) && (shootDirection.y == g_vectorZero.y)) { shootDirection.x = (in_ECX->_lastDirection).x; shootDirection.y = (in_ECX->_lastDirection).y; } if ((shootDirection.x == g_vectorZero.x) && (shootDirection.y == g_vectorZero.y)) { pVVar11 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_29c,in_ECX->_headDirection); lVar3 = CONCAT44(local_2c4.y,local_290.y); shootDirection.x = pVVar11->x; shootDirection.y = pVVar11->y; } } local_2c4.y = (float)((ulonglong)lVar3 >> 0x20); local_290.y = (float)lVar3; if ((in_ECX->_flags & 0x4000) == 0) { in_ECX->_peeBurstCooldown = in_ECX->_peeBurstCooldown + -1; in_ECX->_cacheFlags = in_ECX->_cacheFlags | 2; EvaluateItems(uVar10); lVar3 = CONCAT44(local_2c4.y,local_290.y); } in_ECX->_blinkTime = 8; } local_2c4.y = (float)((ulonglong)lVar3 >> 0x20); local_290.y = (float)lVar3; if ((((in_ECX->_isPlayingExtraAnimation != 0) || (in_ECX->_isPlayingItemAnimation != 0)) && (in_ECX->_heldEntity != (void *)0x0)) && ((in_ECX->_itemState != 0x25c && (in_ECX->_itemState != 0x2c5)))) { local_29c.x = (in_ECX->_velocity).x * 0.1; local_29c.y = (in_ECX->_velocity).y * 0.1; ThrowHeldEntity(in_ECX,&local_29c); lVar3 = CONCAT44(local_2c4.y,local_290.y); } local_2c4.y = (float)((ulonglong)lVar3 >> 0x20); local_290.y = (float)lVar3; this = &in_ECX->_temporaryeffects; local_2e4.y = (float)this; bVar7 = TemporaryEffects::HasCollectibleEffect(this,0x5d); if (((bVar7 != 0) || (bVar7 = TemporaryEffects::HasCollectibleEffect(this,0x4d), bVar7 != 0)) || ((bVar7 = TemporaryEffects::HasCollectibleEffect(this,0x12a), bVar7 != 0 || (((bVar7 = TemporaryEffects::HasCollectibleEffect(this,299), bVar7 != 0 && (pvVar12 = TemporaryEffects::GetCollectibleEffect(this,299), *(int *)((int)pvVar12 + 8) != 0 )) || (0 < in_ECX->_fireBlockCooldown)))))) { shootDirection.x = g_vectorZero.x; shootDirection.y = g_vectorZero.y; isShooting = 0; local_286 = 0; } iVar24 = in_ECX->_itemStateCooldown; if (iVar24 < 1) { LAB_0077b892: if (iVar24 != 0) goto LAB_0077b894; } else { if ((in_ECX->_flags & 0x4000) == 0) { iVar24 = iVar24 + -1; in_ECX->_itemStateCooldown = iVar24; if (iVar24 < 1) { cVar8 = FUN_00730910(); if (cVar8 != '\0') { TemporaryEffects::RemoveCollectibleEffect(this,in_ECX->_itemState,1); TryRemoveCollectibleCostume(in_ECX,in_ECX->_itemState,0); } ResetItemState(in_ECX); iVar24 = in_ECX->_itemStateCooldown; goto LAB_0077b892; } } LAB_0077b894: shootDirection.x = g_vectorZero.x; shootDirection.y = g_vectorZero.y; } local_2dc = 0; if (iVar24 == 0) { local_2dc = (uint)local_286; } local_2bc.y = (float)(Entity *)0x0; if (iVar24 == 0) { local_2bc.y = (float)(uint)isShooting; } if ((shootDirection.x == 0.0) && (shootDirection.y == 0.0)) { isDirectionHeld = 0; if (SUB41(local_2bc.y,0) != '\0') { shootDirection.x = (float)((uint)(in_ECX->_lastDirection).x ^ 0x80000000); shootDirection.y = (float)((uint)(in_ECX->_lastDirection).y ^ 0x80000000); } } else { isDirectionHeld = 1; } if ((shootDirection.x != 0.0) || (local_286 = '\0', shootDirection.y != 0.0)) { local_286 = '\x01'; } if ((in_ECX->_isCoopGhost == 0) && (in_ECX->_canShoot == 0)) { isShooting = 0; } else { isShooting = 1; } EVar14 = (EntityPtr)in_ECX->_suplexState; local_2f8 = in_ECX->_weapons + 1; local_2d0.y = 0.0; local_308.x = shootDirection.x; local_308.y = shootDirection.y; local_2b4 = EVar14; if (*local_2f8 != (int *)0x0) { local_2d0.y = (float)(**(code **)(*(int *)*local_2f8 + 0x30))(); } piVar19 = in_ECX->_markedTarget; if (EVar14 == (EntityPtr)0x2) { local_2d0.y = 4.2039e-44; LAB_0077b9dc: if (((piVar19 != (int *)0x0) && (bVar7 = input_is_action_triggered (g_manager,0xb,in_ECX->_controllerIndex,(Entity *)in_ECX,0), bVar7 != 0)) && (local_2b4 != (EntityPtr)0x2)) { ppvVar21 = &in_ECX->_markedTarget; (**(code **)(*(int *)in_ECX->_markedTarget + 0x28))(); if (*ppvVar21 != (void *)0x0) { local_2a8 = (EntityPtr)ppvVar21; std::multiset::erase(&local_2a8); } *ppvVar21 = (void *)0x0; } if ((in_ECX->_flags & 0x4000) == 0) { piVar19 = in_ECX->_markedTarget; ppvVar21 = &in_ECX->_markedTarget; if (piVar19 != (int *)0x0) { if ((Entity *)piVar19[0xb] == (Entity *)local_2d0.y) goto LAB_0077bba3; (**(code **)(*piVar19 + 0x28))(); if (*ppvVar21 != (void *)0x0) { local_2a8 = (EntityPtr)ppvVar21; std::multiset::erase(&local_2a8); } *ppvVar21 = (void *)0x0; } if ((((float)local_284 != g_vectorZero.x) || (local_2ec.y != g_vectorZero.y)) || (local_2b4 == (EntityPtr)0x2)) { uVar10 = Random(); local_29c.x = (float)local_284 * 5.0 + (in_ECX->_pos).x; local_29c.y = local_2ec.y * 5.0 + (in_ECX->_pos).y; local_2d0.y = (float)Game::Spawn(g_game,1000,(uint)local_2d0.y,&local_29c,&g_vectorZero, (Entity *)in_ECX,0,uVar10); if (((Entity *)local_2d0.y == (Entity *)0x0) || (((Entity *)local_2d0.y)->_type != 1000)) { local_2d0.y = 0.0; } pAVar4 = &((Entity *)((int)local_2d0.y + 0x40c))->_sprite; (pAVar4->_filename)._buf[8] = '\0'; (pAVar4->_filename)._buf[9] = '\0'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &((Entity *)((int)local_2d0.y + 0x40c))->_sprite; (pAVar4->_filename)._buf[0xc] = '\0'; (pAVar4->_filename)._buf[0xd] = '\0'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; if (*ppvVar21 != (void *)0x0) { local_2a8 = (EntityPtr)ppvVar21; std::multiset::erase(&local_2a8); } *ppvVar21 = (void *)local_2d0.y; std::multiset::insert(ppvVar21); } } LAB_0077bba3: EVar30 = local_284; EVar14 = local_2b4; cVar8 = SUB41(local_2bc.y,0); pvVar12 = in_ECX->_markedTarget; local_284._0_1_ = cVar8; local_285 = (char)local_2dc; if (pvVar12 != (void *)0x0) { if (in_ECX->_itemState != 0) { if (local_2b4 != (EntityPtr)0x2) goto LAB_0077be15; } if (cVar8 != '\0') { local_29c.x = (float)EVar30; local_29c.y = local_2ec.y; if (1.0 < local_2ec.y * local_2ec.y + (float)EVar30 * (float)EVar30) { Vector::Normalize(&local_29c); pvVar12 = in_ECX->_markedTarget; } *(float *)((int)pvVar12 + 0x360) = local_29c.x * 8.0 + *(float *)((int)pvVar12 + 0x360); *(float *)((int)pvVar12 + 0x364) = *(float *)((int)pvVar12 + 0x364) + local_29c.y * 8.0; } if (EVar14 == (EntityPtr)0x2) { local_290.y = (in_ECX->_pos).y - *(float *)((int)in_ECX->_markedTarget + 0x340); local_2a8 = (EntityPtr)((in_ECX->_pos).x - *(float *)((int)in_ECX->_markedTarget + 0x33c)); fVar29 = sqrtf(local_290.y * local_290.y + (float)local_2a8 * (float)local_2a8); if (60.0 < fVar29) { pvVar12 = in_ECX->_markedTarget; *(float *)((int)pvVar12 + 0x360) = *(float *)((int)pvVar12 + 0x360) + ((float)local_2a8 / fVar29) * (fVar29 - 60.0) * 0.1; *(float *)((int)pvVar12 + 0x364) = (fVar29 - 60.0) * (local_290.y / fVar29) * 0.1 + *(float *)((int)pvVar12 + 0x364); } } bVar7 = HasCollectible(in_ECX,0xd2,0); if (bVar7 != 0) { local_284._0_1_ = local_2bc.y._0_1_; local_285 = (char)local_2dc; if (in_ECX->_mass == 1000.0) goto LAB_0077be15; } local_285 = '\x01'; local_284._0_1_ = 1; } } else { if ((Entity *)local_2d0.y != (Entity *)0x0) goto LAB_0077b9dc; local_284._0_1_ = SUB41(local_2bc.y,0); local_285 = (char)local_2dc; if (piVar19 != (int *)0x0) { if ((in_ECX->_flags & 0x4000) == 0) { (**(code **)(*piVar19 + 0x28))(); if (in_ECX->_markedTarget != (void *)0x0) { local_2a8 = (EntityPtr)&in_ECX->_markedTarget; std::multiset::erase(&local_2a8); } local_284._0_1_ = local_2bc.y._0_1_; local_285 = (char)local_2dc; in_ECX->_markedTarget = (void *)0x0; } else { } } } LAB_0077be15: bVar7 = HasCollectible(in_ECX,0x17a,0); game = g_game; if ((((bVar7 != 0) && (*(int *)&g_game->_stageTransition == 0)) && (isInputAllowed != '\0')) && (in_ECX->_fireBlockCooldown < 1)) { if (local_284._0_1_ == '\0') { *(undefined4 *)&in_ECX->field_0x18b8 = 0; } else { iVar24 = *(int *)&in_ECX->field_0x18b8 + 1; *(int *)&in_ECX->field_0x18b8 = iVar24; if (iVar24 == 0x96) { GetBombFlags(in_ECX,(BitSet128 *)local_3c,0); uVar10 = Random(); local_29c.x = (in_ECX->_velocity).x * 0.1; local_29c.y = (in_ECX->_velocity).y * 0.1; uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,4,9,&in_ECX->_pos,&local_29c,(Entity *)local_294,0,uVar10); iVar24 = __RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); pBVar13 = BitSet128::operator_or ((BitSet128 *)auStack_24,(BitSet128 *)local_3c, (BitSet128 *)&DAT_00c34560); local_2bc.y = 5.1848e-44; qVar5 = pBVar13->_l; uVar37 = *(undefined4 *)((int)&pBVar13->_l + 4); qVar6 = pBVar13->_h; uVar40 = *(undefined4 *)((int)&pBVar13->_h + 4); *(undefined1 *)(iVar24 + 0x463) = 1; *(int *)(iVar24 + 0x438) = (int)qVar5; *(undefined4 *)(iVar24 + 0x43c) = uVar37; *(int *)(iVar24 + 0x440) = (int)qVar6; *(undefined4 *)(iVar24 + 0x444) = uVar40; manager = g_manager; seed_fart_sound_override((int *)&local_2bc.y); SoundEffects::Play(&manager->_sfxManager,(int)local_2bc.y,1.0,2,0,1.0,0.0); uVar10 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x22,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10) ; pcVar1 = *(code **)(*(int *)tmpEntity + 0x3c); Color::Reset((Color *)local_70); Color::SetTint((Color *)local_70,1.8,0.7,1.5,1.0); (*pcVar1)(local_70,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); in_ECX = local_294; ShootCandle(local_294,&g_vectorZero); game = g_game; } } } if ((game->_dailyChallenge)._specialDailyId == 0x29) { if (*(int *)&game->_stageTransition == 0) { if ((isInputAllowed != '\0') && (local_284._0_1_ != '\0')) { bVar7 = Entity::IsFrame((Entity *)in_ECX,0x1e,0); if ((bVar7 != 0) && (uVar10 = Random(), (uVar10 & 3) == 0)) { Game::ButterBeanFart(g_game,&in_ECX->_pos,120.0,(Entity *)in_ECX,1,0); } game = g_game; } goto LAB_0077c05c; } } else { LAB_0077c05c: if (((*(int *)&game->_stageTransition == 0) && (isInputAllowed != '\0')) && (in_ECX->_fireBlockCooldown < 1)) { if (local_284._0_1_ == '\0') { *(undefined4 *)&in_ECX->field_0x18f0 = 0; } else { *(int *)&in_ECX->field_0x18f0 = *(int *)&in_ECX->field_0x18f0 + 1; } } } tmpPlayer = local_294; if ((0 < in_ECX->_megaBlastDuration) || (*(int *)&in_ECX->field_0x1f00 != 0)) { isShooting = 0; } iVar24 = in_ECX->_fireBlockCooldown; EVar14._1_3_ = 0; EVar14._0_1_ = isShooting; local_2b4 = (EntityPtr)0xf; local_2a8 = (EntityPtr)0x0; if (iVar24 < 1) { local_2a8 = EVar14; } isShooting = local_2a8._0_1_; if (((in_ECX->_isUrethraBlocked != 0) && (iVar24 < 1)) && (isInputAllowed != '\0')) { if ((local_284._0_1_ == '\0') || ((local_285 != '\0' && (in_ECX->_maxBladderCharge <= in_ECX->_bladderCharge)))) { if ((*(char *)game->_room != '\0') && (5 < game->_frameCount - *(int *)((int)game->_room + 0x11f0))) { if (in_ECX->_maxBladderCharge <= in_ECX->_bladderCharge) { TryForgottenThrow(local_294,&in_ECX->_lastDirection); game = g_game; tmpPlayer->_isUrethraBlocked = 0; tmpPlayer->_blinkTime = 10; iVar24 = game->_frameCount; uVar10 = Random(); local_294->_maxPeeBurstCooldown = 0xb4; local_294->_peeBurstCooldown = 0xb4; local_294->_nextUrethraBlockFrame = iVar24 + (uVar10 % (uint)local_2b4 + 0xf) * 0x1e; local_29c.y = (in_ECX->_lastDirection).y * 15.0 * local_294->_shotspeed; local_29c.x = (in_ECX->_lastDirection).x * 15.0 * local_294->_shotspeed; velocity.y = local_29c.y; velocity.x = local_29c.x; tear = FireTear(local_294,&local_294->_pos,velocity,0x45,(Entity *)0x0,1.0); Entity_Tear::ChangeVariant(tear,0x16); (**(code **)(*(int *)tear + 0x40))(tear->_collisionDamage * 10.0); local_2a8 = (EntityPtr)tear->_fScale; uVar10 = Random(); local_290.y = 0.01; local_2a8 = (EntityPtr) (((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)] ) * 2.3283064e-10 * 0.3 + 1.2) * (float)local_2a8); pEVar18 = &local_2a8; if ((float)local_2a8 <= 0.01) { pEVar18 = (EntityPtr *)&local_290.y; } EVar14 = *pEVar18; tear->_baseScale = (float)EVar14; tear->_fScale = (float)EVar14; Entity_Tear::ResetSpriteScale(tear); local_3c = *(undefined1 (*) [4])&(tear->_tearFlags)._l; fStack_38 = *(float *)((int)&(tear->_tearFlags)._l + 4); VStack_34.x = *(float *)&(tear->_tearFlags)._h; VStack_34.y = *(float *)((int)&(tear->_tearFlags)._h + 4); pBVar35 = &g_tearFlagSpectral; pBVar13 = BitSet128::operator_or ((BitSet128 *)auStack_24,(BitSet128 *)local_3c, (BitSet128 *)&DAT_00c34b50); pBVar13 = BitSet128::operator_or((BitSet128 *)&local_80,pBVar13,pBVar35); Entity_Tear::SetTearFlags(tear,*pBVar13); Entity_Projectile::set_falling_accel((Entity_Projectile *)tear,0.0); FUN_00444c70(0xc0400000); Entity_Projectile::SetHeight((Entity_Projectile *)tear,-10.0); pcVar1 = *(code **)(*(int *)tear + 0x3c); Color::Color((Color *)local_70); (*pcVar1)(extraout_EAX,0xffffffff,0xff,0,1); (**(code **)(*(int *)tear + 0xc))(); in_ECX = local_294; } in_ECX->_bladderCharge = 0; } } else if (in_ECX->_bladderCharge < in_ECX->_maxBladderCharge) { in_ECX->_bladderCharge = in_ECX->_bladderCharge + 1; } iVar24 = in_ECX->_fireBlockCooldown; isShooting = '\0'; } if (in_ECX->_ibsCharge < 1.0) { in_ECX->field_0x20a8 = 1; LAB_0077c4aa: *(undefined4 *)&in_ECX->field_0x20a4 = 0; } else if (((iVar24 < 1) && (isInputAllowed != '\0')) && (in_ECX->_itemState == 0)) { if (local_284._0_1_ == '\0') { rng = (RNG *)FUN_005cbd00(0x2d5); uVar10 = RNG::RandomInt(rng,0xb); UsePoopSpell(in_ECX,uVar10 + 1); in_ECX->_ibsCharge = (float)&DAT_bf800000; goto LAB_0077c4aa; } local_2a8 = (EntityPtr)(*(float *)&in_ECX->field_0x20a4 + 0.033333335); local_290.y = 1.0; puVar15 = (undefined4 *)std::min(); *(undefined4 *)&in_ECX->field_0x20a4 = *puVar15; if (in_ECX->field_0x20a8 != '\0') { in_ECX->field_0x20a8 = 0; SoundEffects::PlayWithFartOverride(0x360,1.0,2,0,1.0); } } if (in_ECX->_headDirectionTime < 0) { tmpEntity = GetFocusEntity(in_ECX); local_2bc.y = (float)tmpEntity; if (tmpEntity != (Entity *)0x0) { FUN_004172b0(&local_29c); bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 != 0) { pVVar11 = Entity::Position(tmpEntity,&local_2b0); pVVar16 = (Vector *)FUN_004172b0(&local_290); pVVar11 = Vector::__add(pVVar11,&local_2c4,pVVar16); local_2a8 = (EntityPtr)0x3f000000; pVVar11 = Vector::__mul(pVVar11,&local_2d0,(float *)&local_2a8); Vector::operator_assign(&local_29c,pVVar11); tmpEntity = (Entity *)local_2bc.y; } pVVar11 = Vector::__sub(&local_29c,&local_2b0,&in_ECX->_pos); Vector::operator_assign(&local_308,pVVar11); if ((tmpEntity == in_ECX->_markedTarget) && (in_ECX->_itemState == 0)) { Vector::operator_assign(&shootDirection,&local_308); isDirectionHeld = Vector::operator_ne(&shootDirection,&g_vectorZero); } } if ((local_308.x != 0.0) || (local_308.y != 0.0)) { EVar14 = (EntityPtr)local_308.x; FUN_0041d510(); EVar30 = (EntityPtr)local_308.y; local_2a8 = EVar14; FUN_0041d510(); if ((float)local_2a8 <= (float)EVar30) { if (0.0 <= local_308.y) { SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,"HeadDown"); in_ECX->_headDirection = 3; } else { SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,"HeadUp"); in_ECX->_headDirection = 1; } } else { if (0.0 <= local_308.x) { local_2bc.y = 2.8026e-45; pcVar17 = "HeadRight"; } else { local_2bc.y = 0.0; pcVar17 = "HeadLeft"; } SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,pcVar17); in_ECX->_headDirection = (int)local_2bc.y; } } } if (in_ECX->_fireBlockCooldown < 1) { in_ECX->_fireDirection = -1; EVar30 = (EntityPtr)shootDirection.y; FUN_0041d510(); EVar14 = (EntityPtr)shootDirection.x; local_2a8 = EVar30; FUN_0041d510(); if (0.01 < (float)local_2a8 + (float)EVar14) { iVar24 = vector_to_direction(&shootDirection); in_ECX->_fireDirection = iVar24; } } bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { FUN_00428b50(); cVar8 = FUN_0082ee30(); if ((cVar8 == '\0') && (isInputAllowed != '\0')) { bVar7 = HasCollectible(in_ECX,399,0); if (bVar7 != 0) { if ((local_284._0_1_ == '\0') || ((local_285 != '\0' && (0x96 < in_ECX->_mawOfTheVoidChargeTimer)))) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar24 = Room::GetFrameCount(room); if (5 < iVar24) { if (0x96 < in_ECX->_mawOfTheVoidChargeTimer) { laser = SpawnMawOfVoid(in_ECX,0x3c); (**(code **)(*(int *)laser + 0xc))(); if (local_285 == '\0') { piVar19 = (int *)std::max(); in_ECX->_fireBlockCooldown = *piVar19; } itemConfig = Isaac::GetItemConfig(); nullItem = Config::GetNullItem(itemConfig,0x13); RemoveCostume(in_ECX,nullItem); std::string::string_from_cstr(local_b8,(byte *)"HeadDownShoot"); local_8 = 0; std::string::string_from_cstr(local_88,(byte *)"HeadRightShoot"); local_8._0_1_ = 1; std::string::string_from_cstr(local_70 + 0x2c,(byte *)"HeadUpShoot"); local_8._0_1_ = 2; std::string::string_from_cstr(local_2c,(byte *)"HeadLeftShoot"); local_8._0_1_ = 3; pVVar11 = Vector::ToCardinal(&local_29c,&in_ECX->_lastDirection); pvVar12 = string_from_direction (local_a0,*pVVar11,local_2c,local_70 + 0x2c,local_88,local_b8); local_8 = CONCAT31(local_8._1_3_,4); PlayCollectibleAnim(in_ECX,399,0,pvVar12,-1,0); std::string::_Tidy_deallocate(local_a0); std::string::_Tidy_deallocate(local_2c); std::string::_Tidy_deallocate(local_70 + 0x2c); std::string::_Tidy_deallocate(local_88); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_b8); in_ECX->_fireDirection = -1; } in_ECX->_mawOfTheVoidChargeTimer = 0; } } else { in_ECX->_mawOfTheVoidChargeTimer = in_ECX->_mawOfTheVoidChargeTimer + 1; if (in_ECX->_mawOfTheVoidChargeTimer == 0x96) { itemConfig = Isaac::GetItemConfig(); bVar7 = 0; nullItem = Config::GetNullItem(itemConfig,0x13); AddCostume(in_ECX,nullItem,bVar7); } } } bVar7 = HasCollectible(in_ECX,0x283,0); if (bVar7 != 0) { if ((local_284._0_1_ == '\0') || ((local_285 != '\0' && (0x96 < in_ECX->_revelationChargeTimer)))) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar24 = Room::GetFrameCount(room); if (5 < iVar24) { if (0x96 < in_ECX->_revelationChargeTimer) { pEVar18 = (EntityPtr *)FUN_00753940(); local_29c.x = *(float *)pEVar18; local_29c.y = *(float *)(pEVar18 + 1); GetLaserOffset(in_ECX,&local_2b0,4,&local_29c); local_2a8 = (EntityPtr)Vector::GetAngleDegrees(&local_29c); laser = Entity_Laser::ShootAngle (5,&in_ECX->_pos,(float)local_2a8,0x1e,posOffset,(Entity *)in_ECX,0) ; (**(code **)(*(int *)laser + 0x40))(in_ECX->_meleeDamage); FUN_00456830((int)(in_ECX->_tearFlags)._l, *(undefined4 *)((int)&(in_ECX->_tearFlags)._l + 4), (int)(in_ECX->_tearFlags)._h, *(undefined4 *)((int)&(in_ECX->_tearFlags)._h + 4)); if (local_308.y <= -0.5) { fVar29 = -10.0; } else { fVar29 = 3000.0; } set_field_358(laser,fVar29); if (local_285 == '\0') { piVar19 = (int *)std::max(); in_ECX->_fireBlockCooldown = *piVar19; } in_ECX->_fireDirection = -1; } in_ECX->_revelationChargeTimer = 0; } } else { in_ECX->_revelationChargeTimer = in_ECX->_revelationChargeTimer + 1; } } bVar7 = HasCollectible(in_ECX,0x2a8,0); if (bVar7 != 0) { if ((local_284._0_1_ == '\0') || ((local_285 != '\0' && (0x96 < in_ECX->_montezumaChargeTimer)))) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar24 = Room::GetFrameCount(room); if (5 < iVar24) { if (0x96 < in_ECX->_montezumaChargeTimer) { Vector::FromAngle(&local_2b0,in_ECX->_bodyAngle + 180.0); GetLaserOffset(in_ECX,&local_29c,-1,&local_2b0); local_29c.y = local_29c.y - (in_ECX->_bodyScale).y * 4.0; laser = Entity_Laser::ShootAngle (0xc,&in_ECX->_pos,in_ECX->_bodyAngle + 180.0,0x1e,&local_29c, (Entity *)in_ECX,0); (**(code **)(*(int *)laser + 0x40))(in_ECX->_meleeDamage); pBVar13 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,(BitSet128 *)auStack_24); pBVar13 = BitSet128::operator_and((BitSet128 *)local_3c,&in_ECX->_tearFlags,pBVar13); FUN_00456830((int)pBVar13->_l,*(undefined4 *)((int)&pBVar13->_l + 4),(int)pBVar13->_h, *(undefined4 *)((int)&pBVar13->_h + 4)); Entity_Laser::SetMaxDistance(laser,120.0); EntityPtr::SetReference((EntityPtr *)&in_ECX->_montezumaLaser,(Entity *)laser); if (local_2b0.y <= -0.5) { fVar29 = -10.0; } else { fVar29 = 3000.0; } set_field_358(laser,fVar29); if (local_285 == '\0') { piVar19 = (int *)std::max(); in_ECX->_fireBlockCooldown = *piVar19; } in_ECX->_fireDirection = -1; } in_ECX->_montezumaChargeTimer = 0; } } else { in_ECX->_montezumaChargeTimer = in_ECX->_montezumaChargeTimer + 1; } } if ((in_ECX->_playerType == 0x1a) && (bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000), bVar7 == 0)) { if ((local_284._0_1_ == '\0') || (cVar8 = FUN_007dac30(), cVar8 == '\0')) { in_ECX->_eveSumptoriumCharge = 0; } else { in_ECX->_eveSumptoriumCharge = in_ECX->_eveSumptoriumCharge + 1; if (0x3b < in_ECX->_eveSumptoriumCharge) { in_ECX->_eveSumptoriumCharge = 0; SpawnClot(in_ECX,&in_ECX->_pos,0); } } } } } local_2d0.y = (float)GetWeaponModifiers(in_ECX); if (in_ECX->_itemState == 0x2f) { if (in_ECX->_weapons[0] != (Entity *)0x0) { iVar24 = Entity::SubType(in_ECX->_weapons[0]); if (iVar24 == 6) goto LAB_0077cde3; if (in_ECX->_weapons[0] != (void *)0x0) { Isaac::DestoryWeapon(in_ECX->_weapons); } } weapon = Isaac::CreateWeapon(6,(Entity *)in_ECX); in_ECX->_weapons[0] = weapon; } else { bVar7 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x93); if (bVar7 == 0) { bVar7 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x280); pvVar12 = in_ECX->_weapons[0]; if (bVar7 == 0) { if (in_ECX->_playerType != 0x20) { if (pvVar12 != (void *)0x0) { Isaac::DestoryWeapon(in_ECX->_weapons); } goto LAB_0077cde3; } if (pvVar12 == (void *)0x0) { LAB_0077cdbc: weapon = Isaac::CreateWeapon((int)local_2b4,(Entity *)in_ECX); in_ECX->_weapons[0] = weapon; } else { iVar24 = Entity::SubType(); if (iVar24 != 0xf) { if (in_ECX->_weapons[0] != (void *)0x0) { Isaac::DestoryWeapon(in_ECX->_weapons); } goto LAB_0077cdbc; } } isShooting = '\x01'; } else { if (pvVar12 != (void *)0x0) { iVar24 = Entity::SubType(); if (iVar24 == 0xc) goto LAB_0077cd7e; if (in_ECX->_weapons[0] != (void *)0x0) { Isaac::DestoryWeapon(in_ECX->_weapons); } } weapon = Isaac::CreateWeapon(0xc,(Entity *)in_ECX); in_ECX->_weapons[0] = weapon; LAB_0077cd7e: isShooting = '\x01'; } } else { if (in_ECX->_weapons[0] != (Entity *)0x0) { iVar24 = Entity::SubType(in_ECX->_weapons[0]); if (iVar24 == 0xb) goto LAB_0077cd7e; if (in_ECX->_weapons[0] != (void *)0x0) { Isaac::DestoryWeapon(in_ECX->_weapons); } } weapon = Isaac::CreateWeapon(0xb,(Entity *)in_ECX); in_ECX->_weapons[0] = weapon; isShooting = '\x01'; } } LAB_0077cde3: local_2bc.y = (float)(in_ECX->_weapons + 1); local_2b4 = (EntityPtr)&DAT_00000004; do { if (*(void **)local_2bc.y != (void *)0x0) { FUN_004316c0(); FUN_004316b0(local_2d0.y); } local_2bc.y = (float)((int)local_2bc.y + 4); local_2b4 = (EntityPtr) ((int)&(((Entity_Effect *)((int)local_2b4 + -0x4b4))->_hitList)._capacity + 3); } while (local_2b4 != (EntityPtr)0x0); if (in_ECX->_weapons[0] == (void *)0x0) { local_2bc.y = (float)(in_ECX->_weapons + 1); local_2b4 = (EntityPtr)&DAT_00000004; do { local_2a8 = *(EntityPtr *)local_2bc.y; if (local_2a8 != (EntityPtr)0x0) { pcVar1 = *(code **)(*(int *)local_2a8 + 8); bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); (*pcVar1)(bVar7); } local_2bc.y = (float)((int)local_2bc.y + 4); local_2b4 = (EntityPtr) ((int)&(((Entity_Effect *)((int)local_2b4 + -0x4b4))->_hitList)._capacity + 3); } while (local_2b4 != (EntityPtr)0x0); } else { FUN_004316c0(); FUN_004316b0((uint)local_2d0.y | 0x80000000); pcVar1 = *(code **)(*(int *)in_ECX->_weapons[0] + 8); bVar7 = Entity::HasEntityFlags((Entity *)local_294,0x4000); (*pcVar1)(bVar7); in_ECX = local_294; } if ((in_ECX->_itemState == 0x31) && (local_286 != '\0')) { in_ECX->_blinkTime = 10; } local_2a8 = (EntityPtr)in_ECX->_blinkTime; local_2dc = 2; if ((int)local_2a8 < 9) { local_2dc = 0; } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 == 0) { if (-1 < in_ECX->_blinkTime) { in_ECX->_blinkTime = in_ECX->_blinkTime + -1; } if (-1 < in_ECX->_headDirectionTime) { in_ECX->_headDirectionTime = in_ECX->_headDirectionTime + -1; } } local_290.y = Vector::LengthSquared(&shootDirection); if (1.0 < local_290.y) { Vector::Normalize(&shootDirection); } Vector::ToCardinal(&cardinalDirection,&shootDirection); bVar7 = HasCollectible(in_ECX,0x220,0); if ((bVar7 != 0) || ((in_ECX->_playerType == 0xd && (bVar7 = HasCollectible(in_ECX,0x26b,0), bVar7 != 0)))) { local_290.y = 9.80909e-45; piVar19 = (int *)std::max(); in_ECX->_blinkTime = *piVar19; } bVar7 = HasCollectible(in_ECX,0xf3,0); piVar19 = *(int **)&in_ECX->field_0x1428; puVar26 = &in_ECX->field_0x1428; local_290.y = (float)puVar26; if (bVar7 == 0) { if (piVar19 != (int *)0x0) { (**(code **)(*piVar19 + 0x28))(); EntityPtr::SetReference((EntityPtr *)puVar26,(Entity *)0x0); } } else { if (piVar19 == (int *)0x0) { uVar10 = Random(); uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,1000,0x2f,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); effect = (Entity_Effect *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); EntityPtr::SetReference((EntityPtr *)local_290.y,(Entity *)effect); Entity::SetParent((Entity *)effect,(Entity *)local_294); Entity_Effect::set_rotation(effect,*(float *)&local_294->field_0x1404); FUN_0043eea0(*(undefined4 *)&local_294->field_0x1404); pVVar11 = Vector::FromAngle(&local_29c,*(float *)&local_294->field_0x1404 + 90.0); local_290.y = 30.0; pVVar11 = Vector::__mul(pVVar11,&local_2b0,&local_290.y); pVVar11 = Vector::__add(&in_ECX->_pos,&local_2c4,pVVar11); Entity::SetPosition((Entity *)effect,pVVar11); in_ECX = local_294; (**(code **)(*(int *)effect + 0x3c))(&local_294->_tearColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)effect + 0xc))(); } else { EVar14 = (EntityPtr) __RTDynamicCast(piVar19,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); local_2b4 = EVar14; if (local_284._0_1_ == '\0') { local_2bc.y = 0.8; } else { local_29c.x = shootDirection.x; local_29c.y = shootDirection.y; if ((shootDirection.y == 0.0) && (shootDirection.x == 0.0)) { switch(in_ECX->_headDirection) { case 0: local_29c.x = (float)&DAT_bf800000; break; case 1: local_29c.y = (float)&DAT_bf800000; break; case 2: local_29c.x = 1.0; break; case 3: local_29c.y = 1.0; } } fVar29 = Vector::GetAngleDegrees(&local_29c); local_290.y = fVar29 - 90.0; local_290.y = normalize_angle_degrees(local_290.y); Entity_Effect::set_rotation((Entity_Effect *)EVar14,local_290.y); *(float *)&in_ECX->field_0x1404 = local_290.y; local_2bc.y = 0.5; } fVar28 = (float10)Entity_Effect::Rotation((Entity_Effect *)EVar14); local_290.y = (float)fVar28; fVar28 = (float10)Entity::SpriteRotation((Entity *)EVar14); local_2c4.y = (float)fVar28; local_290.y = LerpAngleDeg(local_2c4.y,local_290.y,local_2bc.y); FUN_0043eea0(local_290.y); pVVar11 = Vector::FromAngle(&local_29c,local_290.y + 90.0); local_290.y = 30.0; pVVar11 = Vector::__mul(pVVar11,&local_2b0,&local_290.y); pVVar11 = Vector::__add(&in_ECX->_pos,&local_2c4,pVVar11); EVar14 = local_2b4; Entity::SetPosition((Entity *)local_2b4,pVVar11); (**(code **)(*(int *)EVar14 + 0x3c))(&in_ECX->_tearColor,0xffffffff,0xff,0,1); local_290.y = (float)&DAT_00000007; piVar19 = (int *)std::max(); in_ECX->_blinkTime = *piVar19; } cVar8 = FUN_00423960(); if (cVar8 != '\0') { pVVar11 = (Vector *)0x3f800000; local_2bc.y = 1.0; bVar7 = IsLocalPlayer(in_ECX); if (bVar7 == 0) { FUN_00417900(); FUN_00925df0(); local_2bc.y = (float)pVVar11; } entityColor = (ColorMod *)Entity::GetColor(*(Entity **)&in_ECX->field_0x1428); Color::operator_assign((Color *)local_70,entityColor); Font::SetLineHeightModifier((Font *)local_70,local_2bc.y); (**(code **)(**(int **)&in_ECX->field_0x1428 + 0x3c))(local_70,0xffffffff,0xff,0,1); } } bVar7 = HasCollectible(in_ECX,0x195,0); if (((((bVar7 != 0) || (bVar7 = HasCollectible(in_ECX,0x238,0), bVar7 != 0)) || (bVar7 = HasCollectible(in_ECX,0x2d6,0), bVar7 != 0)) || (bVar7 = HasCollectible(in_ECX,0x2a9,0), bVar7 != 0)) && (in_ECX->_isControlsEnabled != 0)) { auStack_24._0_4_ = 4; auStack_24._4_4_ = 6; fStack_1c = 7.00649e-45; iStack_18 = 7; local_2bc.y = 0.0; do { pVVar11 = (Vector *)local_2bc.y; bVar7 = input_is_action_triggered (g_manager,*(int *)(auStack_24 + (int)local_2bc.y * 4), in_ECX->_controllerIndex,(Entity *)in_ECX,0); if (bVar7 != 0) { if ((*(Vector **)&in_ECX->field_0x1f94 == pVVar11) && (*(int *)&in_ECX->field_0x1f98 < 0xb)) { Isaac::GetAxisAlignedUnitVectorFromDir(&local_29c,(int)pVVar11); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar7 = Room::IsMirrorWorld(room); if (bVar7 != 0) { local_29c.x = local_29c.x * -1.0; } local_290.y = 3.25101e-43; local_2c4.y = 9.54284e-43; pVVar11 = (Vector *)FUN_005cbfa0(&local_290.y); Vector::operator_assign((Vector *)local_3c,pVVar11); local_290.y = 1.30321e-43; local_2c4.y = 5.67526e-43; pVVar11 = (Vector *)FUN_005cbfa0(&local_290.y); Vector::operator_assign(&VStack_34,pVVar11); local_2b4 = (EntityPtr)0x0; local_290.y = 0.0; do { puVar26 = (undefined1 *)local_290.y; bVar7 = HasCollectible(in_ECX,*(int *)(local_3c + (int)local_290.y * 8),0); if (bVar7 != 0) { Level::GetCurrentRoom((Level *)g_game); this_00 = (EntityList *)FUN_00428a60(); EntityList::QuerySublist (this_00,&local_80,3,*(int *)(local_3c + (int)puVar26 * 8 + 4),-1,0,0); local_8 = 5; fVar29 = 0.0; local_2c4.y = 0.0; iVar24 = EntityList::Size(); if (iVar24 != 0) { local_2d0.y = (float)((int)local_2b4 * 0xc); do { std::vector::operator_index(fVar29); this_01 = (Entity_Familiar *)FUN_00435de0(); if (((this_01 != (Entity_Familiar *)0x0) && (tmpPlayer = (Entity_Player *)Entity_Familiar::Player(this_01), tmpPlayer == in_ECX)) && ((iVar24 = FUN_00753d30(), -1 < iVar24 && (iVar24 = FUN_00753d30(), iVar24 <= (int)local_2d0.y)))) { FUN_00753d40(local_2d0.y); position.y = local_29c.y; position.x = local_29c.x; Entity::SetTargetPosition((Entity *)this_01,position); local_2b4 = (EntityPtr)((int)local_2b4 + 1); local_2d0.y = (float)((int)local_2d0.y + 0xc); } fVar29 = (float)((int)local_2c4.y + 1); local_2c4.y = fVar29; fVar32 = (float)EntityList::Size(); } while ((uint)fVar29 < (uint)fVar32); } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_80); puVar26 = (undefined1 *)local_290.y; } local_290.y = (float)(puVar26 + 1); } while (puVar26 + 1 < (undefined1 *)0x2); bVar7 = HasCollectible(in_ECX,0x238,0); if ((bVar7 != 0) && (*(int *)&in_ECX->field_0x1f9c < 1)) { *(undefined4 *)&in_ECX->field_0x1f9c = 0x5a; play_sound_with_fart_seed(0x238,1.0,2,0,1.0); puVar26 = &in_ECX->field_0x1fa0; local_290.y = (float)puVar26; if (*(int **)&in_ECX->field_0x1fa0 != (int *)0x0) { (**(code **)(**(int **)&in_ECX->field_0x1fa0 + 0x28))(); EntityPtr::SetReference((EntityPtr *)puVar26,(Entity *)0x0); } uVar10 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xbc,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10 ); EntityPtr::SetReference((EntityPtr *)local_290.y,(Entity *)effect); Entity::SetParent((Entity *)effect,(Entity *)local_294); fVar29 = Vector::GetAngleDegrees(&local_29c); Entity_Effect::set_rotation(effect,fVar29); fVar28 = (float10)Entity_Effect::Rotation(effect); Vector::FromAngle(&local_2b0,(float)fVar28); local_290.y = 10.0; pVVar11 = Vector::__mul(&local_2b0,&local_300,&local_290.y); pVVar11 = Vector::__sub(&in_ECX->_pos,&local_2f4,pVVar11); Entity::SetPosition((Entity *)effect,pVVar11); local_290.y = 10.0; pVVar11 = Vector::__mul(&local_2b0,&local_2d8,&local_290.y); Entity::SetVelocity((Entity *)effect,pVVar11); Entity_Effect::SetTimeout(effect,0x1e); (**(code **)(*(int *)effect + 0xc))(); in_ECX = local_294; pcVar1 = *(code **)(*(int *)local_294 + 0x3c); uVar37 = Color::Color(0x3f800000,0,0,0,0,0x3f99999a,0x3f99999a,0x3f800000); (*pcVar1)(uVar37,8,2,1,1); } bVar7 = HasCollectible(in_ECX,0x2d6,0); if ((bVar7 != 0) && (bVar7 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x2d6), bVar7 == 0)) { local_2ec.y = (float)Isaac::CreateWeapon(2,(Entity *)in_ECX); FUN_004316c0(); uVar10 = GetWeaponModifiers(in_ECX); FUN_004316b0(uVar10 | 0x200); Weapon_Brimstone::fire((Weapon_Brimstone *)local_2ec.y,(float)&local_29c,0); Isaac::DestoryWeapon((Weapon **)&local_2ec.y); TemporaryEffects::AddCollectibleEffect(&in_ECX->_temporaryeffects,0x2d6,1,1); TemporaryEffects::AddNullEffect(&in_ECX->_temporaryeffects,0x75,1,1); std::string::string_from_cstr(local_a0,(byte *)"HeadDownShoot"); local_8 = 6; std::string::string_from_cstr(local_d0,(byte *)"HeadRightShoot"); local_8._0_1_ = 7; std::string::string_from_cstr(local_e8,(byte *)"HeadUpShoot"); local_8._0_1_ = 8; std::string::string_from_cstr(local_100,(byte *)"HeadLeftShoot"); local_8._0_1_ = 9; direction.y = local_29c.y; direction.x = local_29c.x; animName = string_from_direction (local_70 + 0x14,direction,local_100,local_e8,local_d0,local_a0); local_8 = CONCAT31(local_8._1_3_,10); play_null_costume_anim(in_ECX,0x75,0,animName,-1,0); std::string::_Tidy_deallocate(local_70 + 0x14); std::string::_Tidy_deallocate(local_100); std::string::_Tidy_deallocate(local_e8); std::string::_Tidy_deallocate(local_d0); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_a0); } pVVar11 = (Vector *)local_2bc.y; } *(Vector **)&in_ECX->field_0x1f94 = pVVar11; *(undefined4 *)&in_ECX->field_0x1f98 = 0; } local_2bc.y = (float)((int)&pVVar11->x + 1); } while ((int)local_2bc.y < 4); } *(int *)&in_ECX->field_0x1f98 = *(int *)&in_ECX->field_0x1f98 + 1; bVar7 = HasCollectible(in_ECX,400,0); piVar19 = *(int **)&in_ECX->field_0x142c; puVar26 = &in_ECX->field_0x142c; local_290.y = (float)puVar26; if (bVar7 == 0) { if (piVar19 != (int *)0x0) { (**(code **)(*piVar19 + 0x28))(); EntityPtr::SetReference((EntityPtr *)puVar26,(Entity *)0x0); } } else if (piVar19 == (int *)0x0) { uVar10 = Random(); uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,1000,0x53,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,0,uVar10); effect = (Entity_Effect *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); EntityPtr::SetReference((EntityPtr *)local_290.y,(Entity *)effect); Entity::SetParent((Entity *)effect,(Entity *)local_294); Entity_Effect::set_rotation(effect,*(float *)&local_294->field_0x1408); FUN_0043eea0(*(undefined4 *)&local_294->field_0x1408); Vector::FromAngle(&local_29c,*(float *)&local_294->field_0x1408 + 90.0); local_290.y = 45.0; pVVar11 = Vector::__mul(&local_29c,&local_2d8,&local_290.y); pVVar11 = Vector::__add(&in_ECX->_pos,&local_2f4,pVVar11); pVVar16 = Vector::Rotated(&local_29c,&local_300,90.0); local_2c4.y = 10.0; pVVar16 = Vector::__mul(pVVar16,&inheritedVelocity,&local_2c4.y); pVVar11 = Vector::__add(pVVar11,(Vector *)&local_b0._h,pVVar16); Entity::SetPosition((Entity *)effect,pVVar11); pVVar11 = Vector::Vector(&local_2d8,0.0,-15.0); Entity::SetPositionOffset((Entity *)effect,pVVar11); (**(code **)(*(int *)effect + 0x3c))(&local_294->_tearColor,0xffffffff,0xff,0,1); (**(code **)(*(int *)effect + 0xc))(); in_ECX = local_294; } else { EVar14 = (EntityPtr) __RTDynamicCast(piVar19,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); local_2b4 = EVar14; if (local_284._0_1_ == '\0') { local_290.y = 0.8; } else { local_29c.x = shootDirection.x; local_29c.y = shootDirection.y; if ((shootDirection.y == 0.0) && (shootDirection.x == 0.0)) { switch(in_ECX->_headDirection) { case 0: local_29c.x = (float)&DAT_bf800000; break; case 1: local_29c.y = (float)&DAT_bf800000; break; case 2: local_29c.x = 1.0; break; case 3: local_29c.y = 1.0; } } fVar29 = Vector::GetAngleDegrees(&local_29c); local_290.y = fVar29 - 90.0; local_290.y = normalize_angle_degrees(local_290.y); Entity_Effect::set_rotation((Entity_Effect *)EVar14,local_290.y); *(float *)&in_ECX->field_0x1408 = local_290.y; local_290.y = 0.5; } fVar28 = (float10)Entity_Effect::Rotation((Entity_Effect *)EVar14); local_2c4.y = (float)fVar28; fVar28 = (float10)Entity::SpriteRotation((Entity *)EVar14); local_2bc.y = (float)fVar28; local_290.y = LerpAngleDeg(local_2bc.y,local_2c4.y,local_290.y); FUN_0043eea0(local_290.y); Vector::FromAngle(&local_2b0,local_290.y + 90.0); local_290.y = 45.0; pVVar11 = Vector::__mul(&local_2b0,&local_2d8,&local_290.y); pVVar11 = Vector::__add(&in_ECX->_pos,&local_2f4,pVVar11); pVVar16 = Vector::Rotated(&local_2b0,&local_300,90.0); local_2c4.y = 10.0; pVVar16 = Vector::__mul(pVVar16,&inheritedVelocity,&local_2c4.y); pVVar11 = Vector::__add(pVVar11,(Vector *)&local_b0._h,pVVar16); EVar14 = local_2b4; Entity::SetPosition((Entity *)local_2b4,pVVar11); (**(code **)(*(int *)EVar14 + 0x3c))(&in_ECX->_tearColor,0xffffffff,0xff,0,1); local_290.y = (float)&DAT_00000007; piVar19 = (int *)std::max(); in_ECX->_blinkTime = *piVar19; } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (((((bVar7 == 0) && (bVar7 = Entity::IsFrame((Entity *)in_ECX,2,0), bVar7 != 0)) && ((bVar7 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x145), bVar7 != 0 || ((bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x400000000), bVar7 != 0 && ((in_ECX->_entityRef2)._entity == in_ECX)))))) && (bVar7 = IsFullSpriteRendering(in_ECX), bVar7 == 0)) && (iVar24 = Isaac::Random(2), iVar24 == 0)) { EntityPtr::clear((EntityPtr *)&local_29c); fVar29 = in_ECX->_meleeDamage * 0.75; local_2c4.y = fVar29; FUN_00431260(); local_2d0.y = (fVar29 * 0.15 + local_2c4.y * 0.04 + 0.6) * 0.9; iVar24 = Isaac::Random(2); local_290.y = (float)((double)iVar24 + __uint_to_double_fixup[-(iVar24 >> 0x1f)]) * 0.4 + 0.9; fVar29 = random_float(); local_290.y = fVar29 * 0.05 + local_290.y; Vector::Normalized(&local_308,&local_2b0); if (local_286 != '\0') { local_2bc.y = 8.0; pVVar11 = Vector::__mul(&local_2b0,&local_2d8,&local_2bc.y); Vector::operator_add_assign(&local_29c,pVVar11); } pVVar11 = MusicManager::RandomVector(&local_2d8); local_2bc.y = random_float(); pVVar11 = Vector::__mul(pVVar11,&local_2f4,&local_2bc.y); local_2b4 = (EntityPtr)0x40000000; pVVar11 = Vector::__mul(pVVar11,&local_300,(float *)&local_2b4); Vector::operator_add_assign(&local_29c,pVVar11); GetTearMovementInheritance(in_ECX,&inheritedVelocity,&local_2b0,1); Vector::operator_add_assign(&local_29c,other); uVar10 = Random(); tear = (Entity_Tear *)Game::Spawn(g_game,2,1,&in_ECX->_pos,&local_29c,(Entity *)in_ECX,0,uVar10) ; Entity_Tear::SetScale(tear,local_290.y * local_2d0.y); Entity_Projectile::SetHeight((Entity_Projectile *)tear,-12.0); fVar28 = (float10)Entity_Tear::FallingAcceleration(tear); Entity_Projectile::set_falling_accel((Entity_Projectile *)tear,(float)(fVar28 + (float10)0.5)); fVar28 = (float10)Entity_Tear::FallingSpeed(tear); local_2bc.y = (float)fVar28; fVar29 = random_float(); FUN_00444c70((local_2bc.y - fVar29 * 10.0) - 4.0); (**(code **)(*(int *)tear + 0x40))(local_290.y * local_2c4.y); (**(code **)(*(int *)tear + 0xc))(); } EVar14 = (EntityPtr)in_ECX->_luck; local_2b4 = EVar14; local_29c.y = (float)EVar14; bVar7 = HasTrinket(in_ECX,0x8b,0); if (bVar7 != 0) { iVar24 = GetTrinketMultiplier(in_ECX,0x8b); EVar14 = (EntityPtr)((float)iVar24 + (float)iVar24 + 2.0 + (float)local_2b4); in_ECX->_luck = (float)EVar14; local_2b4 = EVar14; } iVar24 = in_ECX->_itemState; if (iVar24 < 0x1e2) { if (iVar24 == 0x1e1) { bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); cVar8 = local_284._0_1_; if ((bVar7 != 0) || (local_284._0_1_ == '\0')) goto LAB_0077fc4f; TearParams::constructor(&local_214); uVar10 = Random(); pVVar11 = Entity::Position((Entity *)in_ECX,&local_2d8); knife = (Entity_Knife *) Game::Spawn(g_game,8,8,pVVar11,&g_vectorZero,(Entity *)in_ECX,0,uVar10); Entity::SetParent((Entity *)knife,(Entity *)in_ECX); pVVar11 = Vector::Vector(&local_2f4,6.0,0.0); Entity::SetTargetPosition((Entity *)knife,*pVVar11); fVar29 = Vector::GetAngleDegrees(&shootDirection); FUN_005b15d0(fVar29); pVVar11 = Vector::Vector(&local_300,0.0,-14.0); Entity::SetPositionOffset((Entity *)knife,pVVar11); pVVar11 = (Vector *)Entity::SpriteScale((Entity *)in_ECX); Entity::SetSpriteScale((Entity *)knife,pVVar11); Entity_Knife::SetAttackAnimation(knife); FUN_00665bc0(1); FUN_00753770(0); (**(code **)(*(int *)knife + 0x40))(0x42da0000); (**(code **)(*(int *)knife + 0xc))(); in_ECX->_itemStateCooldown = 5; uVar10 = GetActiveItemSlot(in_ECX,0x1e1); if (-1 < (int)uVar10) { DischargeActiveItem(in_ECX,uVar10,0); } in_ECX->_blinkTime = 1; PlayExtraAnimation(in_ECX,(byte *)"HideItem"); fVar29 = random_float(); play_sound_with_fart_seed(0xfc,1.0,2,0,fVar29 * 0.2 + 0.9); } else if (iVar24 < 0xa5) { if (iVar24 == 0xa4) { switchD_0077e14f_caseD_2a: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } cVar8 = '\0'; if (local_284._0_1_ == '\0') goto LAB_0077fc4f; bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 != 0) goto switchD_0077f19d_caseD_2c5; local_2bc.y = (float)&in_ECX->_lastVelocity; if (in_ECX->_itemState == 0xa4) { bVar7 = HasCollectible(in_ECX,0x164,0); local_2e4.x = 14.0; local_2e4.y = 7.0; local_290.y = (float)&local_2e4; local_2c4.y = (float)((bVar7 != 0) + 1); do { fVar29 = local_290.y; uVar10 = Random(); pVVar11 = Vector::__mul(&cardinalDirection,&local_2d8,(float *)fVar29); local_2d0.y = 0.5; pVVar16 = Vector::__mul((Vector *)local_2bc.y,&local_2f4,&local_2d0.y); local_2ec.y = 2.0; pVVar16 = Vector::__mul(pVVar16,&local_300,&local_2ec.y); pVVar11 = Vector::__add(pVVar11,&inheritedVelocity,pVVar16); in_ECX = local_294; uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,1000,10,&local_294->_pos,pVVar11,(Entity *)local_294,0, uVar10); effect = (Entity_Effect *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); Entity_Effect::SetTimeout(effect,0x3c); (**(code **)(*(int *)effect + 0x40))(0x41b80000); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { Game::GetField26614(g_game); piVar19 = (int *)EntityList::Size(); (**(code **)(*piVar19 + 0x44))(effect); } bVar7 = IsLocalPlayer(in_ECX); if (bVar7 == 0) { entityColor = (ColorMod *)Entity::GetColor((Entity *)effect); Color::operator_assign((Color *)local_70,entityColor); FUN_00417900(); FUN_00925df0(); local_2b0.y = (float)EVar14; fVar28 = (float10)Color::A(); EVar14 = (EntityPtr)local_2b0.y; Font::SetLineHeightModifier((Font *)local_70,(float)(fVar28 * (float10)local_2b0.y)); (**(code **)(*(int *)effect + 0x3c))(local_70,0xffffffff,0xff,0,1); } (**(code **)(*(int *)effect + 0xc))(); local_290.y = (float)((int)local_290.y + 4); local_2c4.y = (float)((int)local_2c4.y + -1); } while (local_2c4.y != 0.0); LAB_0077e64e: iVar24 = 0x1d7; } else { if (in_ECX->_itemState == 0x121) { bVar7 = HasCollectible(in_ECX,0x164,0); local_2e4.x = 14.0; local_2e4.y = 7.0; local_290.y = (float)&local_2e4; local_2c4.y = (float)((bVar7 != 0) + 1); do { fVar29 = local_290.y; uVar10 = Random(); pVVar11 = Vector::__mul(&cardinalDirection,&local_2d8,(float *)fVar29); local_2b0.y = 0.5; pVVar16 = Vector::__mul((Vector *)local_2bc.y,&local_2f4,&local_2b0.y); local_2d0.y = 2.0; pVVar16 = Vector::__mul(pVVar16,&local_300,&local_2d0.y); pVVar11 = Vector::__add(pVVar11,&inheritedVelocity,pVVar16); in_ECX = local_294; uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,1000,0x34,&local_294->_pos,pVVar11,(Entity *)local_294, 0,uVar10); tmpEntity = (Entity *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); (**(code **)(*(int *)tmpEntity + 0x40))(0x41b80000); Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 != '\0') { Game::GetField26614(g_game); piVar19 = (int *)EntityList::Size(); (**(code **)(*piVar19 + 0x44))(tmpEntity); } bVar7 = IsLocalPlayer(in_ECX); if (bVar7 == 0) { entityColor = (ColorMod *)Entity::GetColor(tmpEntity); Color::operator_assign((Color *)local_70,entityColor); FUN_00417900(); FUN_00925df0(); local_2ec.y = (float)EVar14; fVar28 = (float10)Color::A(); EVar14 = (EntityPtr)local_2ec.y; Font::SetLineHeightModifier((Font *)local_70,(float)(fVar28 * (float10)local_2ec.y)) ; (**(code **)(*(int *)tmpEntity + 0x3c))(local_70,0xffffffff,0xff,0,1); } (**(code **)(*(int *)tmpEntity + 0xc))(); local_290.y = (float)((int)local_290.y + 4); local_2c4.y = (float)((int)local_2c4.y + -1); } while (local_2c4.y != 0.0); local_2c4.y = 0.0; goto LAB_0077e64e; } uVar10 = Random(); local_2b0.y = 14.0; pVVar11 = Vector::__mul(&cardinalDirection,&local_2d8,&local_2b0.y); local_290.y = 0.5; pVVar16 = Vector::__mul((Vector *)local_2bc.y,&local_2f4,&local_290.y); local_2c4.y = 2.0; pVVar16 = Vector::__mul(pVVar16,&local_300,&local_2c4.y); pVVar11 = Vector::__add(pVVar11,&inheritedVelocity,pVVar16); in_ECX = local_294; uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,2,4,&local_294->_pos,pVVar11,(Entity *)local_294,0,uVar10); tear = (Entity_Tear *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); uVar37 = 0; iVar24 = Isaac::Random(2); GetTearHitParams(local_180,5,0x3f800000,iVar24 * 2 + -1,uVar37); pBVar36 = &g_tearFlagPoison; pBVar35 = &g_tearFlagExplosive; pBVar13 = GetBombFlags(in_ECX,(BitSet128 *)auStack_24,0); pBVar13 = BitSet128::operator_or((BitSet128 *)local_3c,&local_148,pBVar13); pBVar13 = BitSet128::operator_or((BitSet128 *)&local_80,pBVar13,pBVar35); pBVar13 = BitSet128::operator_or(&local_b0,pBVar13,pBVar36); Entity_Tear::SetTearFlags(tear,*pBVar13); (**(code **)(*(int *)tear + 0x40))(in_ECX->_damage + 185.0); fVar29 = random_float(); FUN_00444c70(fVar29 * 0.2 + 1.2); Entity_Projectile::SetHeight((Entity_Projectile *)tear,-33.0); Entity::SetParent((Entity *)tear,(Entity *)in_ECX); (**(code **)(*(int *)tear + 0xc))(); iVar24 = 0xfc; } play_sound_with_fart_seed(iVar24,1.0,2,0,1.0); goto LAB_0077e9ef; } switch(iVar24) { case 0: Vector::ToCardinal(&local_2b0,&local_308); bVar7 = HasCollectible(in_ECX,0x1d1,0); if ((bVar7 != 0) || (in_ECX->_markedTarget != (void *)0x0)) { Vector::operator_assign(&local_2b0,&local_308); } if (((isShooting != '\0') || (in_ECX->_playerType == 0xd)) || (in_ECX->_playerType == 0x20)) { bVar7 = HasCollectible(in_ECX,0xf4,0); if (bVar7 != 0) { if (*(int *)&in_ECX->field_0x1468 < 1) { *(undefined4 *)&in_ECX->field_0x1468 = 0xf; if (((local_286 != '\0') || (in_ECX->_markedTarget != (void *)0x0)) && (iVar24 = Isaac::Random(3), iVar24 != 0)) { laser = FireTechLaser(in_ECX,&in_ECX->_pos,2,&local_2b0,0,1,(Entity *)0x0,1.0); Entity_Laser::set_scale(); (**(code **)(*(int *)laser + 0xc))(); in_ECX->_blinkTime = 5; } } else { *(int *)&in_ECX->field_0x1468 = *(int *)&in_ECX->field_0x1468 + -1; } } if ((isShooting != '\0') && (bVar7 = IsExtraAnimationFinished(in_ECX), bVar7 != 0)) { FUN_00428b50(); cVar8 = FUN_0082ee30(); if ((cVar8 == '\0') && (isInputAllowed != '\0')) { trigger_fire_item_effects(in_ECX,&shootDirection,local_284); } } } break; default: goto switchD_0077e14f_caseD_1; case 0x2a: goto switchD_0077e14f_caseD_2a; case 0x2f: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } trigger_fire_item_effects(in_ECX,&shootDirection,1); if (in_ECX->_itemState == 0) { PlayExtraAnimation(in_ECX,(byte *)"HideItem"); } break; case 0x31: if ((local_286 == '\0') || (bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000), bVar7 != 0)) break; in_ECX->_itemStateCooldown = 0x1e; play_sound_with_fart_seed(5,1.0,2,0,1.0); GetLaserOffset(in_ECX,&local_2d8,3,&cardinalDirection); fVar29 = cardinalDirection.y; FUN_00456230(); laser = Entity_Laser::ShootAngle (3,&in_ECX->_pos,fVar29 * 57.295776,0xf,posOffset_00,(Entity *)in_ECX,0); (**(code **)(*(int *)laser + 0x40))(in_ECX->_damage + in_ECX->_damage); if (cardinalDirection.y <= -0.5) { fVar29 = -50.0; } else { fVar29 = 3000.0; } set_field_358(laser,fVar29); (**(code **)(*(int *)laser + 0xc))(); DischargeActiveItem(in_ECX,0,0); piVar19 = &in_ECX->_blinkTime; *piVar19 = 0x1e; cVar8 = local_284._0_1_; goto LAB_0077fc55; } } else { switch(iVar24) { case 0x121: goto switchD_0077e14f_caseD_2a; default: switchD_0077e14f_caseD_1: KAGE_LogMessage(1,(byte *)"No Such State %d\n"); break; case 0x152: if ((local_286 != '\0') && (bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000), bVar7 == 0)) { in_ECX->_itemStateCooldown = 0xf; local_2b0.y = 15.0; pVVar11 = Vector::__mul(&cardinalDirection,&local_2d8,&local_2b0.y); local_290.y = 0.5; pVVar16 = Vector::__mul(&in_ECX->_lastVelocity,&local_2f4,&local_290.y); local_2c4.y = 2.0; pVVar16 = Vector::__mul(pVVar16,&local_300,&local_2c4.y); Vector::__add(pVVar11,&local_2ec,pVVar16); uVar10 = Random(); uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,1000,0x3c,&in_ECX->_pos,&local_2ec,(Entity *)in_ECX,0, uVar10); effect = (Entity_Effect *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); Entity_Effect::SetTimeout(effect,(int)(-in_ECX->_tearheight * 0.75)); (**(code **)(*(int *)effect + 0x40))(in_ECX->_damage + in_ECX->_damage); Entity::SetParent((Entity *)effect,(Entity *)in_ECX); (**(code **)(*(int *)effect + 0xc))(); SoundEffects::PlayWithFartOverride(0x344,1.0,2,0,1.0); in_ECX->_blinkTime = 0xf; DischargeActiveItem(in_ECX,0,0); ANM2::Reset(&in_ECX->_heldSprite); itemConfig = Isaac::GetItemConfig(); nullItem = Config::GetNullItem(itemConfig,0x1e); RemoveCostume(in_ECX,nullItem); } break; case 0x160: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } cVar8 = '\0'; if (local_284._0_1_ == '\0') goto LAB_0077fc4f; bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 == 0) { local_2b0.y = 10.0; Vector::__mul(&shootDirection,&local_2e4,&local_2b0.y); GetTearMovementInheritance(in_ECX,&local_2d8,&shootDirection,0); Vector::operator_add_assign(&local_2e4,other_00); pVVar11 = Vector::__mul(&local_2e4,&local_2f4,&in_ECX->_shotspeed); tear = FireTear(in_ECX,&in_ECX->_pos,*pVVar11,1,(Entity *)0x0,1.0); fVar28 = (float10)Entity_Tear::Scale(tear); Entity_Tear::SetScale(tear,(float)(fVar28 * (float10)5.0)); pcVar1 = *(code **)(*(int *)tear + 0x40); fVar28 = (float10)Entity::CollisionDamage((Entity *)tear); local_2b0.y = (float)((float10)10.0 + fVar28 * (float10)10.0); (*pcVar1)(local_2b0.y); pBVar36 = &g_tearFlagSpectral; pBVar35 = (BitSet128 *)&DAT_00c34b50; pBVar13 = Entity_Tear::TearFlags(tear,(BitSet128 *)auStack_24); pBVar13 = BitSet128::operator_or((BitSet128 *)local_3c,pBVar13,pBVar35); pBVar13 = BitSet128::operator_or((BitSet128 *)&local_80,pBVar13,pBVar36); Entity_Tear::SetTearFlags(tear,*pBVar13); in_ECX = local_294; play_sound_with_fart_seed(0x1e2,1.0,2,0,1.0); pVVar11 = Vector::__unm(&local_2e4,&local_300); bVar7 = 0; local_2b0.y = 0.5; pVVar11 = Vector::__mul(pVVar11,&local_2d8,&local_2b0.y); Entity::AddVelocity_divided((Entity *)in_ECX,pVVar11,bVar7); goto LAB_0077ed69; } break; case 0x17e: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); SoundEffects::PlayWithFartOverride(0x3fe,1.0,2,0,1.0); } cVar8 = '\0'; if (local_284._0_1_ == '\0') goto LAB_0077fc4f; bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 == 0) { local_2b0.y = 15.0; Vector::__mul(&shootDirection,&local_2c4,&local_2b0.y); GetTearMovementInheritance(in_ECX,&local_2d8,&shootDirection,0); Vector::operator_add_assign(&local_2c4,other_01); iVar24 = Game::Challenge(g_game); if (iVar24 == 0x21) { rng = (RNG *)FUN_005cbd00(0x17e); uVar10 = RNG::RandomInt(rng,2); if (uVar10 == 0) { FUN_00417910(); local_290.y = (float)FUN_006ef3f0(); } else { FUN_00417910(); local_290.y = (float)FUN_005cd4e0(); } iVar24 = FUN_0060c6e0(); if (iVar24 != 0) { rng = (RNG *)FUN_005cbd00(0x17e); uVar10 = FUN_0060c6e0(); uVar10 = RNG::RandomInt(rng,uVar10); piVar19 = (int *)FUN_0060c6c0(uVar10); enemyType = *piVar19; auStack_24._0_4_ = piVar19[1]; auStack_24._4_4_ = piVar19[2]; fStack_1c = (float)piVar19[3]; iStack_18 = piVar19[4]; bVar7 = Entity_NPC::Redirect(&enemyType,(int *)auStack_24); if (bVar7 != 0) { this_02 = (EntityConfig *)FUN_00417910(); entityConfigEntry = EntityConfig::GetEntity(this_02,enemyType,auStack_24._0_4_,0); if (entityConfigEntry != (EntityConfig_Entity *)0x0) { piVar19 = (int *)FUN_005cd4b0(entityConfigEntry->id,entityConfigEntry->variant, entityConfigEntry->subtype,entityConfigEntry->baseHP ,0); enemyType = *piVar19; auStack_24._0_4_ = piVar19[1]; auStack_24._4_4_ = piVar19[2]; fStack_1c = (float)piVar19[3]; } } (in_ECX->_friendBallEnemy)._maxHealth = fStack_1c; (in_ECX->_friendBallEnemy)._type = enemyType; (in_ECX->_friendBallEnemy)._variant = auStack_24._0_4_; (in_ECX->_friendBallEnemy)._health = fStack_1c * 0.5; (in_ECX->_friendBallEnemy)._subtype = auStack_24._4_4_; } uVar10 = Random(); uVar23 = 1; } else { iVar24 = (in_ECX->_friendBallEnemy)._type; uVar10 = Random(); uVar23 = (uint)(iVar24 != 0); } tmpEntity = Game::Spawn(g_game,1000,0x51,&in_ECX->_pos,&local_2c4,(Entity *)in_ECX,uVar23, uVar10); Entity::SetParent(tmpEntity,(Entity *)in_ECX); (**(code **)(*(int *)tmpEntity + 0xc))(); SoundEffects::PlayWithFartOverride(0x400,1.0,2,0,1.0); goto LAB_0077ed69; } } } goto switchD_0077f19d_caseD_2c5; } switch(iVar24) { case 0x200: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } cVar8 = '\0'; if (local_284._0_1_ == '\0') break; bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 != 0) goto switchD_0077f19d_caseD_2c5; uVar10 = Random(); local_2b0.y = 34.0; pVVar11 = Vector::__mul(&cardinalDirection,&local_2d8,&local_2b0.y); local_290.y = 0.5; pVVar16 = Vector::__mul(&local_294->_lastVelocity,&local_2f4,&local_290.y); local_2c4.y = 2.0; pVVar16 = Vector::__mul(pVVar16,&local_300,&local_2c4.y); pVVar11 = Vector::__add(pVVar11,&inheritedVelocity,pVVar16); in_ECX = local_294; uVar40 = 0; pTVar39 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar38 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar37 = 0; tmpEntity = Game::Spawn(g_game,1000,0x6b,&local_294->_pos,pVVar11,(Entity *)local_294,0,uVar10); piVar19 = (int *)__RTDynamicCast(tmpEntity,uVar37,pTVar38,pTVar39,uVar40); (**(code **)(*piVar19 + 0xc))(); SoundEffects::PlayWithFartOverride(0x42c,1.0,2,0,1.0); LAB_0077e9ef: PlayExtraAnimation(in_ECX,(byte *)"HideItem"); in_ECX->_itemStateCooldown = 5; DischargeActiveItem(in_ECX,0,0); piVar19 = &in_ECX->_blinkTime; *piVar19 = 1; cVar8 = local_284._0_1_; goto LAB_0077fc55; default: goto switchD_0077e14f_caseD_1; case 0x25c: FUN_00420ae0(); cVar8 = FUN_0082ee30(); if (cVar8 == '\0') { LAB_0077f304: if (((in_ECX->_isPlayingItemAnimation == 0) && (in_ECX->_isPlayingExtraAnimation == 0)) && (in_ECX->_heldEntity != (void *)0x0)) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); ANM2::Reset(&in_ECX->_heldSprite); } } else { FUN_00420ae0(); cVar8 = FUN_0082eb90(); if (cVar8 == '\0') goto LAB_0077f304; } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 != 0) goto switchD_0077f19d_caseD_2c5; if ((in_ECX->_playerType == 0x28) && (in_ECX->_heldEntity != (void *)0x0)) { pvVar12 = in_ECX->_heldEntity; pvVar20 = (void *)GetOtherTwin(in_ECX); if ((pvVar12 != pvVar20) || ((iVar24 = FUN_0042d040(), iVar24 == 0 || (0 < *(int *)((int)pvVar12 + 0x18f8))))) goto LAB_0077f3b7; piVar19 = (int *)FUN_0042d040(); cVar8 = (**(code **)(*piVar19 + 0x40))(); if (((cVar8 == '\0') && (*(char *)((int)pvVar12 + 0x1908) == '\0')) || (in_ECX->_canShoot == 0)) goto LAB_0077f3b7; cVar8 = local_284._0_1_; LAB_0077f493: if (in_ECX->_heldEntity != (void *)0x0) break; } else { LAB_0077f3b7: cVar8 = local_284._0_1_; if (local_284._0_1_ == '\0') goto LAB_0077f493; if (in_ECX->_heldEntity != (void *)0x0) { local_2b0.y = 10.0; Vector::__mul(&shootDirection,&local_290,&local_2b0.y); GetTearMovementInheritance(in_ECX,&local_2d8,&shootDirection,0); Vector::operator_add_assign(&local_290,other_02); local_2b0.y = 1.2; Vector::operator_mul_assign(&local_290,&local_2b0.y); ThrowHeldEntity(in_ECX,&local_290); ANM2::Reset(&in_ECX->_heldSprite); in_ECX->_blinkTime = 1; in_ECX->_itemStateCooldown = 5; PlayExtraAnimation(in_ECX,(byte *)"HideItem"); if (in_ECX->_activeDesc[0]._item == 0x25c) { DischargeActiveItem(in_ECX,0,0); } goto switchD_0077f19d_caseD_2c5; } } if (in_ECX->_itemStateCooldown == 0) { ANM2::Reset(&in_ECX->_heldSprite); in_ECX->_itemStateCooldown = 5; goto LAB_0077ed7e; } break; case 0x26f: case 0x27e: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (bVar7 == 0) { if (((in_ECX->_itemState == 0x26f) && (in_ECX->_numKeys < 1)) && (in_ECX->_itemStateCooldown == 0)) { in_ECX->_itemStateCooldown = 5; goto LAB_0077ed7e; } cVar8 = '\0'; if (local_284._0_1_ == '\0') break; local_2b0.y = 10.0; Vector::__mul(&shootDirection,&local_2bc,&local_2b0.y); GetTearMovementInheritance(in_ECX,&local_2d8,&shootDirection,0); Vector::operator_add_assign(&local_2bc,other_03); uVar10 = 0x2d; local_290.y = 6.30584e-44; if (in_ECX->_itemState == 0x26f) { local_2b0.y = in_ECX->_shotspeed * 1.5; uVar10 = 0x2c; local_290.y = (float)&DAT_0000002c; Vector::operator_mul_assign(&local_2bc,&local_2b0.y); } GetTearHitParams(local_180,1,0x3f800000,0,in_ECX); uVar23 = Random(); tear = (Entity_Tear *) Game::Spawn(g_game,2,uVar10,&in_ECX->_pos,&local_2bc,(Entity *)in_ECX,1,uVar23); Entity_Projectile::SetHeight((Entity_Projectile *)tear,local_130); if ((Vector *)local_290.y == (Vector *)0x2d) { (**(code **)(*(int *)tear + 0x40))(0x41700000); } else { Game::GetField26614(g_game); cVar8 = FUN_00429550(); if (cVar8 == '\0') { fVar29 = local_138 * 5.0 + 30.0; } else { fVar29 = local_138 * 4.0 + 5.0; } (**(code **)(*(int *)tear + 0x40))(fVar29); pBVar13 = BitSet128::operator_or ((BitSet128 *)auStack_24,&local_148,(BitSet128 *)&DAT_00c34b50); Entity_Tear::SetTearFlags(tear,*pBVar13); } Entity::SetParent((Entity *)tear,(Entity *)in_ECX); (**(code **)(*(int *)tear + 0xc))(); in_ECX->_itemStateCooldown = 5; DischargeActiveItem(in_ECX,0,0); in_ECX->_blinkTime = 1; PlayExtraAnimation(in_ECX,(byte *)"HideItem"); fVar29 = random_float(); play_sound_with_fart_seed(0xfc,1.0,2,0,fVar29 * 0.2 + 0.9); if (in_ECX->_itemState == 0x26f) { AddKeys(in_ECX,-1); } } case 0x2c5: switchD_0077f19d_caseD_2c5: cVar8 = local_284._0_1_; break; case 0x2c6: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); cVar8 = local_284._0_1_; if ((bVar7 == 0) && (local_284._0_1_ != '\0')) { TearParams::constructor(&local_27c); uVar10 = Random(); pVVar11 = Entity::Position((Entity *)in_ECX,&local_2d8); knife = (Entity_Knife *) Game::Spawn(g_game,8,4,pVVar11,&g_vectorZero,(Entity *)in_ECX,0,uVar10); Entity::SetParent((Entity *)knife,(Entity *)in_ECX); pVVar11 = Vector::Vector(&local_2f4,6.0,0.0); Entity::SetTargetPosition((Entity *)knife,*pVVar11); fVar29 = Vector::GetAngleDegrees(&shootDirection); FUN_005b15d0(fVar29); pVVar11 = Vector::Vector(&local_300,0.0,-14.0); Entity::SetPositionOffset((Entity *)knife,pVVar11); pVVar11 = (Vector *)Entity::SpriteScale((Entity *)in_ECX); Entity::SetSpriteScale((Entity *)knife,pVVar11); Entity_Knife::SetAttackAnimation(knife); FUN_00665bc0(1); FUN_00753770(0); (**(code **)(*(int *)knife + 0x40))(0x3f800000); (**(code **)(*(int *)knife + 0xc))(); in_ECX->_itemStateCooldown = 5; uVar10 = GetActiveItemSlot(in_ECX,0x2c6); if (-1 < (int)uVar10) { DischargeActiveItem(in_ECX,uVar10,0); } in_ECX->_blinkTime = 1; PlayExtraAnimation(in_ECX,(byte *)"HideItem"); fVar29 = random_float(); play_sound_with_fart_seed(2,1.0,2,0,fVar29 * 0.2 + 0.9); goto switchD_0077f19d_caseD_2c5; } break; case 0x2d8: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); cVar8 = local_284._0_1_; if ((bVar7 == 0) && (local_284._0_1_ != '\0')) { bVar7 = HasCollectible(in_ECX,0x164,0); local_2d0.x = 0.0; local_2d0.y = 0.0; local_2bc.y = (float)((bVar7 != 0) + 1); if (bVar7 != 0) { local_2d0.x = -10.0; local_2d0.y = 10.0; } local_290.y = 0.0; do { local_2b0.y = 10.0; Vector::__mul(&shootDirection,&local_2e4,&local_2b0.y); GetTearMovementInheritance(in_ECX,&local_2d8,&shootDirection,0); local_2c4.y = 0.4; pVVar11 = Vector::operator_mul(&local_2f4,&local_2c4.y,vector); Vector::operator_add_assign(&local_2e4,pVVar11); Vector::Normalize(&local_2e4); Vector::Rotate(); uVar10 = Random(); tmpEntity = Game::Spawn(g_game,3,0xf0,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,0,uVar10) ; Entity::ClearEntityFlags(tmpEntity,4); position_00.y = local_2e4.y; position_00.x = local_2e4.x; Entity::SetTargetPosition(tmpEntity,position_00); FUN_005b18f0(1); (**(code **)(*(int *)tmpEntity + 0xc))(); local_290.y = (float)((int)(float *)local_290.y + 1); } while ((uint)local_290.y < (uint)local_2bc.y); play_sound_with_fart_seed(0x1ee,1.0,2,0,1.0); LAB_0077ed69: in_ECX->_itemStateCooldown = 5; DischargeActiveItem(in_ECX,0,0); LAB_0077ed7e: in_ECX->_blinkTime = 1; PlayExtraAnimation(in_ECX,(byte *)"HideItem"); goto switchD_0077f19d_caseD_2c5; } break; case 0x2d9: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { PlayExtraAnimation(in_ECX,(byte *)"LiftItem"); Sprite::SetLastFrame((Sprite *)&in_ECX->_bodySprite); } bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); cVar8 = local_284._0_1_; if ((bVar7 == 0) && (local_284._0_1_ != '\0')) { local_2b0.y = 10.0; Vector::__mul(&shootDirection,&local_2d0,&local_2b0.y); GetTearMovementInheritance(in_ECX,&local_2d8,&shootDirection,0); local_2b0.y = 0.4; pVVar11 = Vector::operator_mul(&local_2f4,&local_2b0.y,vector_00); Vector::operator_add_assign(&local_2d0,pVVar11); uVar10 = Random(); tmpEntity = Game::Spawn(g_game,3,0xf3,&in_ECX->_pos,&g_vectorZero,(Entity *)local_294,0,uVar10 ); Entity::ClearEntityFlags(tmpEntity,4); Entity::AddEntityFlags(tmpEntity,0x400000000000000); pVVar11 = Vector::Vector(&local_300,-24.0,-7.0); Entity::SetTargetPosition(tmpEntity,*pVVar11); Entity::SetVelocity(tmpEntity,&local_2d0); FUN_005b18f0(1); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar10 = Random(); local_2b0.y = 0.35; pVVar11 = Vector::__mul(&local_2d0,&local_2d8,&local_2b0.y); tmpEntity = Game::Spawn(g_game,1000,2,&in_ECX->_pos,pVVar11,(Entity *)0x0,2,uVar10); (**(code **)(*(int *)tmpEntity + 0xc))(); TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)local_2e4.y,0x2d9,1,2); in_ECX = local_294; play_sound_with_fart_seed(0x417,1.0,2,0,1.0); goto LAB_0077ed69; } } LAB_0077fc4f: piVar19 = &in_ECX->_blinkTime; LAB_0077fc55: EVar14 = (EntityPtr)in_ECX->_luck; if (in_ECX->_luck == (float)local_2b4) { in_ECX->_luck = local_29c.y; EVar14 = (EntityPtr)local_29c.y; } if (((cVar8 == '\0') && (*piVar19 < 0)) && (in_ECX->_headDirectionTime < 0)) { FUN_00420ae0(); cVar8 = FUN_0082ee30(); if (cVar8 == '\0') { iVar24 = in_ECX->_moveDirection; GetBodyMoveDirection(in_ECX,&local_2d8); bVar7 = Vector::operator_ne(this_03,&g_vectorZero); if (bVar7 != 0) { GetBodyMoveDirection(in_ECX,&local_2d8); iVar24 = vector_to_direction(vec); } switch(iVar24) { case 0: SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,"HeadLeft"); in_ECX->_headDirection = 0; break; case 1: SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,"HeadUp"); in_ECX->_headDirection = 1; break; case 2: SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,"HeadRight"); in_ECX->_headDirection = 2; break; default: SimpleString::operator=((SimpleString *)&in_ECX->_headAnim,"HeadDown"); in_ECX->_headDirection = 3; } } } bVar7 = IsFullSpriteRendering(in_ECX); if (bVar7 == 0) { if ((in_ECX->_variant == 0) && (in_ECX->_isCoopGhost == 0)) { bVar7 = HasCollectible(in_ECX,0x2ab,0); if ((bVar7 != 0) && ((iVar24 = Sprite::GetOverlayFrame((Sprite *)&in_ECX->_sprite), iVar24 == 0 && (8 < (int)local_2a8)))) { local_29c.y = (in_ECX->_posOffset).y; Color::Color(&local_1ac); fVar29 = random_float(); Game::SpawnParticles(g_game,&in_ECX->_pos,0x23,1,fVar29 * 3.0 + 2.0,color,local_29c.y,1); } Sprite::SetOverlayFrame(&in_ECX->_headAnim,local_2dc); local_294 = (Entity_Player *)&in_ECX->_playerCostumeMap[0]._isBodyLayer; local_290.y = 2.10195e-44; do { if ((((-1 < ((PlayerCostumeMap *)((int)local_294 + -0xc))->_index) && (*(byte *)local_294 == 0)) && (this_04 = (Sprite *)FUN_005cbd10(((PlayerCostumeMap *)((int)local_294 + -0xc))->_index) , this_04[1]._filename._buf[8] == '\0')) && (iVar24 = FUN_0040bcb0(&in_ECX->_headAnim), iVar24 != 0)) { if (*(char *)(iVar24 + 0x34) == '\0') { if ((int)local_2a8 < 9) { uVar37 = FUN_00421620("_Idle"); local_8 = 0xb; local_30c = (EntityPtr)((uint)local_30c | 1); local_29c.y = (float)local_30c; iVar24 = FUN_0040bcb0(uVar37); local_286 = '\x01'; if (iVar24 == 0) goto LAB_0077ff13; } else { LAB_0077ff13: local_286 = '\0'; } local_8 = 0xffffffff; if (((uint)local_30c & 1) != 0) { local_30c = (EntityPtr)((uint)local_30c & 0xfffffffe); std::string::_Tidy_deallocate(local_70 + 0x14); } if (local_286 == '\0') { ANM2::SetFrame((ANM2 *)this_04,&in_ECX->_headAnim,local_2dc); } else { uVar37 = FUN_00421620("_Idle"); local_8 = 0xc; Sprite::Play(uVar37,0); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_70 + 0x14); } } else { Sprite::Play(&in_ECX->_headAnim,0); costumeLayer = Sprite::GetLayer(this_04,*(byte **)((int)local_294 + -8)); (costumeLayer->_pos).y = (float)(int)local_2dc * (costumeLayer->_size).y; } if (this_04[1]._filename._buf[10] != '\0') { uVar37 = FUN_00421620("_Overlay"); local_8 = 0xd; local_29c.y = (float)FUN_0040bcb0(uVar37); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_70 + 0x14); if ((EntityPtr)local_29c.y != (EntityPtr)0x0) { if (*(char *)((int)local_29c.y + 0x34) == '\0') { uVar37 = FUN_00421620("_Overlay"); local_8 = 0xf; Sprite::SetOverlayFrame(uVar37,local_2dc); pcVar17 = local_118; } else { uVar37 = FUN_00421620("_Overlay"); local_8 = 0xe; Sprite::PlayOverlay(uVar37,0); pcVar17 = local_a0; } local_8 = 0xffffffff; std::string::_Tidy_deallocate(pcVar17); } } } local_294 = (Entity_Player *)((int)local_294 + 0x10); local_290.y = (float)((int)local_290.y + -1); } while (local_290.y != 0.0); local_290.y = 0.0; } else { uVar10 = 0; ppvVar21 = in_ECX->_weapons + 1; do { if (*ppvVar21 != (void *)0x0) { FUN_004e46b0(); if (0.0 < (float)EVar14) goto LAB_007800b3; ppvVar21 = local_2f8; } uVar10 = uVar10 + 1; ppvVar21 = ppvVar21 + 1; local_2f8 = ppvVar21; } while (uVar10 < 4); ANM2::SetFrame(&in_ECX->_sprite,&in_ECX->_headAnim,local_2dc); } } LAB_007800b3: bVar7 = IsExtraAnimationFinished(in_ECX); if (bVar7 != 0) { FUN_00428b50(); cVar8 = FUN_0082ee30(); if (((cVar8 == '\0') && (isInputAllowed != '\0')) && (bVar7 = HasCollectible(in_ECX,0x170,0), bVar7 != 0)) { if (0 < *(int *)&in_ECX->field_0x18a8) { *(int *)&in_ECX->field_0x18a8 = *(int *)&in_ECX->field_0x18a8 + -1; } bVar7 = HasWeaponType(in_ECX,10); if (bVar7 == 0) { *(undefined4 *)&in_ECX->field_0x18a8 = 0; } else if (((local_284._0_1_ == '\0') || (*(int *)&in_ECX->field_0x18ac == -1)) || (iVar24 = vector_to_direction(&shootDirection), iVar24 == *(int *)&in_ECX->field_0x18ac)) { iVar24 = FUN_00505ca0(); if (0 < iVar24) { *(undefined4 *)&in_ECX->field_0x18a8 = 10; } if (local_284._0_1_ != '\0') { iVar24 = vector_to_direction(&shootDirection); *(int *)&in_ECX->field_0x18ac = iVar24; } } else { *(undefined4 *)&in_ECX->field_0x18a8 = 0xffffffff; iVar24 = vector_to_direction(&shootDirection); *(int *)&in_ECX->field_0x18ac = iVar24; } iVar24 = vector_to_direction(&in_ECX->_aimDirection); iVar22 = vector_to_direction(&shootDirection); if ((iVar22 == iVar24) || (bVar7 = Vector::operator_ne(&in_ECX->_aimDirection,&g_vectorZero), bVar7 == 0)) { bVar27 = false; } else { bVar27 = true; } if ((*(int *)&in_ECX->field_0x18a8 < 0) || ((*(int *)&in_ECX->field_0x18a8 == 0 && ((local_284._0_1_ == '\0' || (bVar27)))))) { iVar24 = in_ECX->_fireBlockCooldown; bVar27 = iVar24 == 0; if (!bVar27) goto LAB_007802cb; in_ECX->_cacheFlags = in_ECX->_cacheFlags | 2; in_ECX->_epiphoraCharge = 0; *(undefined4 *)&in_ECX->field_0x18ac = 0xffffffff; EvaluateItems(); bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if (((bVar7 != 0) && (isShooting != '\0')) && (bVar7 = IsExtraAnimationFinished(in_ECX), bVar7 != 0)) { FUN_00428b50(); cVar8 = FUN_0082ee30(); if (cVar8 == '\0') { Entity::ClearEntityFlags((Entity *)in_ECX,0x4000); trigger_fire_item_effects(in_ECX,&shootDirection,local_284); Entity::AddEntityFlags((Entity *)in_ECX,0x4000); } } } else { bVar7 = Entity::HasEntityFlags((Entity *)in_ECX,0x4000); if ((bVar7 == 0) && (in_ECX->_epiphoraCharge < 0xb4)) { in_ECX->_cacheFlags = in_ECX->_cacheFlags | 2; in_ECX->_epiphoraCharge = in_ECX->_epiphoraCharge + 1; EvaluateItems(); } } } } iVar24 = in_ECX->_fireBlockCooldown; bVar27 = iVar24 == 0; LAB_007802cb: if (bVar27 || iVar24 < 0) { Vector::operator_assign(&in_ECX->_aimDirection,&shootDirection); in_ECX->_areOpposingShootDirectionsPressed = isOpposingDirections; if (isDirectionHeld == 0) { std::deque::_Tidy(); } else { Vector::operator_assign(&in_ECX->_lastDirection,&shootDirection); FUN_007dc7b0(&shootDirection); uVar10 = Room::GetGridHeight((Room *)&in_ECX->field_0x1668); while (3 < uVar10) { FUN_00499560(); uVar10 = Room::GetGridHeight((Room *)&in_ECX->field_0x1668); } } } ExceptionList = local_10; return; } //@@ 00780560 Entity_Player::GetBombFlags /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Lua EntityPlayer:GetBombFlags; ZHL sig said GridEntity_Pit::Update prototype: db/protos.zhl, confirmed by RET 8 */ BitSet128 * __thiscall Entity_Player::GetBombFlags(Entity_Player *this,BitSet128 *outFlags,byte isRollChances) { float fVar1; byte isHasCollectible; uint uVar2; int iVar3; int iVar4; uint uVar5; uint uVar6; bool bVar7; bool bVar8; uint flagsLowHiWord; uint flagsHighHiWord; uint nancyBombFlagTable [4]; uint local_100; uint local_fc; uint local_f8; uint local_f4; uint local_f0; uint local_ec; uint local_e8; uint local_e4; uint local_e0; uint local_dc; uint local_d8; uint local_d4; uint local_d0; uint local_cc; uint local_c8; uint local_c4; uint local_c0; uint local_bc; uint local_b8; uint local_b4; uint local_b0; uint local_ac; uint local_a8; uint local_a4; uint local_a0; uint local_9c; uint local_98; uint local_94; uint local_90; uint local_8c; uint local_88; uint local_84; uint local_80; uint local_7c; uint local_78; uint local_74; uint local_70; uint local_6c; uint local_68; uint local_64; uint local_60; uint local_5c; uint local_58; uint local_54; uint local_50; uint local_4c; uint local_48; uint local_44; uint local_40; uint local_3c; uint local_38; uint local_34; uint local_30; uint local_2c; uint local_28; uint local_24; uint local_20; uint local_1c; uint local_18; uint local_14; uint local_c; qword flagsHigh; uint *flagsWord; local_c = __security_cookie ^ (uint)&flagsLowHiWord; *(undefined4 *)&outFlags->_l = 0; *(undefined4 *)((int)&outFlags->_l + 4) = 0; *(undefined4 *)&outFlags->_h = 0; *(undefined4 *)((int)&outFlags->_h + 4) = 0; isHasCollectible = HasCollectible(this,0x7d,0); if (isHasCollectible != 0) { *(uint *)&outFlags->_l = (uint)outFlags->_l | (uint)g_tearFlagHoming._l; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | g_tearFlagHoming._l._4_4_; *(uint *)&outFlags->_h = (uint)outFlags->_h | (uint)g_tearFlagHoming._h; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | g_tearFlagHoming._h._4_4_; } isHasCollectible = HasCollectible(this,0x8c,0); if (isHasCollectible != 0) { *(uint *)&outFlags->_l = (uint)outFlags->_l | (uint)g_tearFlagPoison._l; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | g_tearFlagPoison._l._4_4_; *(uint *)&outFlags->_h = (uint)outFlags->_h | (uint)g_tearFlagPoison._h; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | g_tearFlagPoison._h._4_4_; } isHasCollectible = HasCollectible(this,0xd1,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 0x12 - (int)(this->_luck * -3.0))))) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34560; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34564; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34568; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3456c; } isHasCollectible = HasCollectible(this,0x100,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 0x19 - (int)(this->_luck * -6.0))))) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34c00; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34c04; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34c08; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c34c0c; } isHasCollectible = HasCollectible(this,0xdc,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 10 - (int)(this->_luck * -3.0))))) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34b90; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34b94; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34b98; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c34b9c; } isHasCollectible = HasCollectible(this,0x16e,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 0x21 - (int)(this->_luck * -8.0))))) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34570; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34574; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34578; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3457c; } isHasCollectible = HasCollectible(this,0x16f,0); if (isHasCollectible != 0) { uVar5 = DAT_00c34930 | DAT_00c34a40; uVar2 = DAT_00c34934 | DAT_00c34a44; uVar6 = DAT_00c3493c | DAT_00c34a4c; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34938 | DAT_00c34a48; *(uint *)&outFlags->_l = (uint)outFlags->_l | uVar5; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | uVar2; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | uVar6; } isHasCollectible = HasCollectible(this,0x1b0,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 10 - (int)(this->_luck * -3.0))))) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34990; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34994; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34998; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3499c; } isHasCollectible = HasCollectible(this,0x13b,0); if (isHasCollectible != 0) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34b20; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34b24; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34b28; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c34b2c; } isHasCollectible = HasCollectible(this,0x161,0); if (isHasCollectible != 0) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34590; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34594; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34598; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3459c; } fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 9.94922e-44)) { iVar4 = GetTrinketMultiplier(this,0x47); bVar8 = false; bVar7 = iVar4 == 0; LAB_007808cb: if (bVar7 || bVar8 != iVar4 < 0) { flagsLowHiWord = *(uint *)((int)&outFlags->_l + 4); goto LAB_00780901; } } else if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x47); bVar8 = SBORROW4(iVar3,1); iVar4 = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007808cb; } *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c345f0; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c345f4; flagsLowHiWord = *(uint *)((int)&outFlags->_l + 4); *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c345f8; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c345fc; LAB_00780901: flagsHighHiWord = *(uint *)((int)&outFlags->_h + 4); flagsHigh = outFlags->_h; if ((this->_hasGoldenBomb != 0) && (isRollChances == 0)) { uVar2 = (uint)outFlags->_l | DAT_00c34830; *(uint *)((int)&outFlags->_l + 4) = DAT_00c34834 | flagsLowHiWord; *(uint *)&outFlags->_l = uVar2; uVar2 = flagsHighHiWord | DAT_00c3483c; *(uint *)&outFlags->_h = (uint)flagsHigh | DAT_00c34838; *(uint *)((int)&outFlags->_h + 4) = uVar2; } isHasCollectible = HasCollectible(this,0x205,0); if ((isHasCollectible != 0) && (isRollChances == 0)) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34840; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34844; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34848; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3484c; } isHasCollectible = HasCollectible(this,0x266,0); if (isHasCollectible != 0) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34610; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34614; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34618; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3461c; } isHasCollectible = HasCollectible(this,0x286,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 10 - (int)(this->_luck * -3.0))))) { *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34620; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | DAT_00c34624; *(uint *)&outFlags->_h = (uint)outFlags->_h | DAT_00c34628; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | DAT_00c3462c; } isHasCollectible = HasCollectible(this,0x2d7,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 0x21 - (int)(this->_luck * -8.0))))) { uVar6 = DAT_00c34648 | (uint)g_tearFlagSpectral._h; uVar2 = DAT_00c34644 | g_tearFlagSpectral._l._4_4_; uVar5 = DAT_00c3464c | g_tearFlagSpectral._h._4_4_; *(uint *)&outFlags->_l = (uint)outFlags->_l | DAT_00c34640 | (uint)g_tearFlagSpectral._l; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | uVar2; *(uint *)&outFlags->_h = (uint)outFlags->_h | uVar6; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | uVar5; } isHasCollectible = HasCollectible(this,0x233,0); if ((isHasCollectible != 0) && ((isRollChances == 0 || (uVar2 = Random(), (int)(uVar2 % 100) <= 0x32 - (int)(this->_luck * -8.0))))) { nancyBombFlagTable[0] = (uint)g_tearFlagHoming._l; nancyBombFlagTable[1] = g_tearFlagHoming._l._4_4_; nancyBombFlagTable[2] = (uint)g_tearFlagHoming._h; nancyBombFlagTable[3] = g_tearFlagHoming._h._4_4_; local_100 = (uint)g_tearFlagPoison._l; local_fc = g_tearFlagPoison._l._4_4_; local_f8 = (uint)g_tearFlagPoison._h; local_f4 = g_tearFlagPoison._h._4_4_; local_f0 = DAT_00c34560; local_ec = DAT_00c34564; local_e8 = DAT_00c34568; local_e4 = DAT_00c3456c; local_e0 = DAT_00c34c00; local_dc = DAT_00c34c04; local_d8 = DAT_00c34c08; local_d4 = DAT_00c34c0c; local_d0 = DAT_00c34b90; local_cc = DAT_00c34b94; local_c8 = DAT_00c34b98; local_c4 = DAT_00c34b9c; local_c0 = DAT_00c34570; local_bc = DAT_00c34574; local_b8 = DAT_00c34578; local_ac = DAT_00c34934 | DAT_00c34a44; local_b4 = DAT_00c3457c; local_b0 = DAT_00c34930 | DAT_00c34a40; local_a8 = DAT_00c34938 | DAT_00c34a48; local_a4 = DAT_00c3493c | DAT_00c34a4c; local_a0 = DAT_00c34990; local_9c = DAT_00c34994; local_98 = DAT_00c34998; local_94 = DAT_00c3499c; local_90 = DAT_00c34b20; local_8c = DAT_00c34b24; local_88 = DAT_00c34b28; local_84 = DAT_00c34b2c; local_80 = DAT_00c34590; local_7c = DAT_00c34594; local_78 = DAT_00c34598; local_74 = DAT_00c3459c; local_70 = DAT_00c345f0; local_6c = DAT_00c345f4; local_68 = DAT_00c345f8; local_64 = DAT_00c345fc; local_60 = DAT_00c34830; local_5c = DAT_00c34834; local_58 = DAT_00c34838; local_54 = DAT_00c3483c; local_50 = DAT_00c34840; local_4c = DAT_00c34844; local_48 = DAT_00c34848; local_44 = DAT_00c3484c; local_40 = DAT_00c34610; local_3c = DAT_00c34614; local_38 = DAT_00c34618; local_34 = DAT_00c3461c; uVar2 = (uint)(15.0 - this->_luck); local_30 = DAT_00c34620; local_2c = DAT_00c34624; local_28 = DAT_00c34628; local_24 = DAT_00c3462c; local_20 = DAT_00c34640; local_1c = DAT_00c34644; local_18 = DAT_00c34648; local_14 = DAT_00c3464c; if (uVar2 == 0) { uVar5 = 0; } else { uVar5 = Random(); uVar5 = uVar5 % uVar2; } iVar4 = ((int)uVar5 < 5) + 2; if (2 < (int)uVar5) { iVar4 = ((int)uVar5 < 5) + 1; } iVar3 = iVar4 + 1; if (uVar5 != 0) { iVar3 = iVar4; } do { uVar2 = Random(); uVar2 = uVar2 & 0xf; *(uint *)&outFlags->_l = (uint)outFlags->_l | nancyBombFlagTable[uVar2 * 4]; flagsWord = (uint *)((int)&outFlags->_l + 4); *flagsWord = *flagsWord | nancyBombFlagTable[uVar2 * 4 + 1]; *(uint *)&outFlags->_h = (uint)outFlags->_h | nancyBombFlagTable[uVar2 * 4 + 2]; flagsWord = (uint *)((int)&outFlags->_h + 4); *flagsWord = *flagsWord | nancyBombFlagTable[uVar2 * 4 + 3]; iVar3 = iVar3 + -1; } while (iVar3 != 0); } uVar2 = (uint)outFlags->_l; uVar5 = *(uint *)((int)&outFlags->_l + 4); if (((uVar2 & DAT_00c34640) != 0 || (uVar5 & DAT_00c34644) != 0) || (((uint)outFlags->_h & DAT_00c34648) != 0 || (*(uint *)((int)&outFlags->_h + 4) & DAT_00c3464c) != 0)) { uVar5 = uVar5 | g_tearFlagSpectral._l._4_4_; flagsHigh = outFlags->_h; uVar6 = *(uint *)((int)&outFlags->_h + 4); *(uint *)&outFlags->_l = uVar2 | (uint)g_tearFlagSpectral._l; *(uint *)((int)&outFlags->_l + 4) = uVar5; uVar6 = uVar6 | g_tearFlagSpectral._h._4_4_; *(uint *)&outFlags->_h = (uint)flagsHigh | (uint)g_tearFlagSpectral._h; *(uint *)((int)&outFlags->_h + 4) = uVar6; } return outFlags; } //@@ 00780eb0 Entity_Player::GetBombVariant /* ZHL [lua] Lua binding EntityPlayer:GetBombVariant */ undefined4 Entity_Player::GetBombVariant(void) { return 0; } //@@ 00780ec0 Entity_Player::check_bomb_tearflags /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? HasCollectible 106 (Mr Mega) / 420 or tearflags mask test prototype: db/protos.zhl, confirmed by RET 16 */ float __thiscall Entity_Player::check_bomb_tearflags(Entity_Player *this,BitSet128 tearFlags) { byte bVar1; bVar1 = HasCollectible(this,0x6a,0); if (bVar1 == 0) { if ((((uint)tearFlags._l & _DAT_00c34910) == 0 && (DAT_00c34914 & tearFlags._l._4_4_) == 0) && (((uint)tearFlags._h & _DAT_00c34918) == 0 && (DAT_00c3491c & tearFlags._h._4_4_) == 0)) { bVar1 = HasCollectible(this,0x1a4,0); if (bVar1 == 0) { return 1.0; } } } return 1.5; } //@@ 00780f40 Entity_Player::update_bomb_input /* DB: ACTION_BOMB (8) input_is_action_triggered -> place bomb (GetBombFlags, check_bomb_tearflags) or Tainted Blue Baby (playertype 0x19) UsePoopSpell/poop_spell_roll/AddPoopMana; called from Entity_Player::Update (vtable slot 3 = 00782af0) */ void __thiscall Entity_Player::update_bomb_input(Entity_Player *this) { BitSet128 tearFlags; byte bVar1; char isDamaged; undefined3 extraout_var; EntityRef *sourceRef; float *extraout_EAX; uint rngResult; Entity *pEVar2; int iVar3; Entity_Player *self; int iVar4; int *piVar5; undefined4 extraout_EDX; undefined4 uVar6; Manager *manager; bool bVar7; bool bVar8; float fVar9; float fVar10; void *pvVar11; undefined4 uVar12; undefined1 auVar13 [16]; float fStack_d0; char isPartnerGigaBomb; char isRocket; byte isFreeBomb; undefined3 uStack_c7; float fStack_c4; Entity *pEStack_c0; float fStack_bc; float fStack_b8; float fStack_b4; int bombIndex; float fStack_ac; float fStack_a8; uint bombVariant; int bombCount; float bombScale; float fStack_90; Vector aimDir; Vector bombVelocity; Vector inheritedVelocity; undefined1 bombFlags [8]; uint uStack_58; uint uStack_54; uint uStack_50; float fStack_4c; uint uStack_48; uint uStack_44; EntityRef damageSource; Game *game; bool isGigaBomb; EntityPtr partnerPlayer; code *takeDamageFn; if (((this->_isCoopGhost == 0) && (bVar1 = IsHologram(this), bVar1 == 0)) && (this->_playerType != 0x28)) { if (this->_playerType == 0x19) { if (((this->_isControlsEnabled != 0) && (this->_controlsCooldown < 1)) && ((bVar1 = Entity::HasEntityFlags((Entity *)self,0x800), bVar1 == 0 && ((bVar1 = input_is_action_triggered(g_manager,8,this->_controllerIndex,(Entity *)this,0), bVar1 != 0 && (this->_lastActionTriggers = this->_lastActionTriggers | 1, 0 < this->_poopMana)))))) { UsePoopSpell(this,this->_poopSpellQueue[0]); this->_poopSpellQueue[0] = this->_poopSpellQueue[1]; this->_poopSpellQueue[1] = this->_poopSpellQueue[2]; this->_poopSpellQueue[2] = this->_poopSpellQueue[3]; this->_poopSpellQueue[3] = this->_poopSpellQueue[4]; this->_poopSpellQueue[4] = this->_poopSpellQueue[5]; this->_poopSpellQueue[5] = 0; poop_spell_roll(this); AddPoopMana(this,-1); return; } } else { iVar4 = this->_bombPlaceDelay; if (iVar4 < 1) { bVar1 = AreControlsEnabled(self); if (((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags((Entity *)this,0x800), bVar1 == 0)) && (bVar1 = input_is_action_triggered(g_manager,8,this->_controllerIndex,(Entity *)this,0), bVar1 != 0)) { this->_lastActionTriggers = this->_lastActionTriggers | 1; isFreeBomb = this->_hasGoldenBomb; partnerPlayer = this->_twinPlayer; isGigaBomb = 0 < this->_numGigaBombs; isPartnerGigaBomb = '\0'; uStack_c7 = extraout_var; if (partnerPlayer != (EntityPtr)0x0) { bVar1 = HasCollectible((Entity_Player *)partnerPlayer,0x205,0); iVar4 = 0x1e; if (bVar1 != 0) { iVar4 = 1; } if ((*(int *)((int)partnerPlayer + 0x1610) == iVar4) && (isFreeBomb = 1, *(char *)((int)partnerPlayer + 0x1dd8) != '\0')) { isGigaBomb = true; isPartnerGigaBomb = '\x01'; } } partnerPlayer = this->_parent; if ((partnerPlayer != (EntityPtr)0x0) && (*(int *)((int)partnerPlayer + 0x28) == 1)) { bVar1 = HasCollectible((Entity_Player *)partnerPlayer,0x205,0); iVar4 = 0x1e; if (bVar1 != 0) { iVar4 = 1; } if (*(int *)((int)partnerPlayer + 0x1610) == iVar4) { isFreeBomb = 1; uStack_c7 = 0; if (*(char *)((int)partnerPlayer + 0x1dd8) != '\0') { isGigaBomb = true; isPartnerGigaBomb = '\x01'; } } } if (((this->_numBombs < 1) && (isFreeBomb == 0)) && (this->_bombPlaceDelay < 1)) { bVar1 = HasCollectible(this,0x266,0); game = g_game; if (bVar1 != 0) { if ((this->_playerType == 0x24) && (0 < this->_effectiveBloodCharge)) { AddBloodCharge(this,-1); isFreeBomb = 1; uStack_c7 = 0; } else { this->_damageCooldown = 0; takeDamageFn = *(code **)(*(int *)this + 0x20); if (*(int *)&game->_deathmatchManager < 2) { sourceRef = EntityRef::EntityRef(&damageSource); uVar12 = 0x3f800000; uVar6 = 0; } else { uVar12 = 0x41000000; sourceRef = EntityRef::EntityRef(&damageSource); uVar6 = extraout_EDX; } isDamaged = (*takeDamageFn)(uVar12,0x42820,uVar6,sourceRef,0x1e); if (isDamaged != '\0') { isFreeBomb = 1; } uStack_c7 = 0; } } } if (((0 < this->_numBombs) || (isFreeBomb != 0)) && (this->_bombPlaceDelay < 1)) { bVar1 = HasCollectible(this,0x205,0); game = g_game; iVar4 = 0x1e; if (bVar1 != 0) { iVar4 = 1; } this->_bombPlaceDelay = iVar4; if ((1 < *(int *)&game->_deathmatchManager) && (iVar4 = (**(code **)(*(int *)(game->_deathmatchManager)._type + 4))(), iVar4 == 3)) { this->_bombPlaceDelay = 0xf; } iVar4 = 1; bombCount = 1; bVar1 = HasTrinket(this,0xa4,0); if (bVar1 != 0) { iVar4 = GetTrinketMultiplier(this,0xa4); iVar4 = iVar4 + 1; bombCount = iVar4; } bombIndex = 0; if (0 < iVar4) { do { GetBombFlags(this,(BitSet128 *)bombFlags,0); uStack_50 = bombFlags._0_4_; fStack_4c = (float)bombFlags._4_4_; uStack_48 = uStack_58; uStack_44 = uStack_54; tearFlags._l._4_4_ = bombFlags._4_4_; tearFlags._l._0_4_ = bombFlags._0_4_; tearFlags._h._0_4_ = uStack_58; tearFlags._h._4_4_ = uStack_54; bombScale = check_bomb_tearflags(this,tearFlags); fStack_b8 = (this->_velocity).x * 0.1; fStack_b4 = (this->_velocity).y * 0.1; bombVelocity.x = fStack_b8; bombVelocity.y = fStack_b4; bVar1 = HasCollectible(this,0x247,0); if (bVar1 == 0) { LAB_00781520: iVar4 = 0; bombVariant = 0; isRocket = '\0'; fStack_d0 = 0.0; if (isGigaBomb) { LAB_00781539: bombScale = 1.0; bombVariant = 0x11; if (iVar4 == 0x13) { bombVariant = 0x14; } } } else { fStack_c4 = 0.0; pEStack_c0 = (Entity *)0x0; if ((this->_fireDirection != -1) && ((pEVar2 = (Entity *)(this->_aimDirection).x, (float)pEVar2 != g_vectorZero.x || ((this->_aimDirection).y != g_vectorZero.y)))) { fStack_c4 = (this->_aimDirection).y; pEStack_c0 = pEVar2; } if (((float)pEStack_c0 == g_vectorZero.x) && (fStack_c4 == g_vectorZero.y)) goto LAB_00781520; aimDir.x = (float)pEStack_c0; aimDir.y = fStack_c4; fVar9 = sqrtf((float)pEStack_c0 * (float)pEStack_c0 + fStack_c4 * fStack_c4); if (0.0 < fVar9) { pEStack_c0 = (Entity *)((float)pEStack_c0 * (1.0 / fVar9)); fStack_c4 = fStack_c4 * (1.0 / fVar9); aimDir.x = (float)pEStack_c0; aimDir.y = fStack_c4; } GetTearMovementInheritance(this,&inheritedVelocity,&aimDir,0); fStack_b8 = (float)pEStack_c0 * 10.0 + *extraout_EAX; fStack_b4 = fStack_c4 * 10.0 + extraout_EAX[1]; bombVelocity.x = fStack_b8; bombVelocity.y = fStack_b4; fStack_d0 = atan2f(fStack_c4,(float)pEStack_c0); iVar4 = 0x13; fStack_d0 = fStack_d0 * 57.295776; bombVariant = 0x13; isRocket = '\x01'; if (isGigaBomb) { (this->_velocity).x = (this->_velocity).x - (float)pEStack_c0 * 5.0; (this->_velocity).y = (this->_velocity).y - fStack_c4 * 5.0; goto LAB_00781539; } } rngResult = Random(); pEVar2 = Game::SpawnEx(g_game,4,bombVariant,&this->_pos,&bombVelocity,(Entity *)this ,0,rngResult,0); pEStack_c0 = pEVar2; if (1 < bombCount) { if (isRocket == '\0') { rngResult = Random(); fStack_bc = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; fStack_bc = fStack_bc + fStack_bc; fVar9 = cos(fStack_bc); fStack_a8 = fVar9 * 8.0 + (this->_pos).x; fVar10 = sin(fStack_bc); fVar9 = (this->_pos).y; (pEVar2->_pos).x = fStack_a8; (pEVar2->_pos).y = fVar10 * 8.0 + fVar9; } else { fVar9 = sqrtf(fStack_b8 * fStack_b8 + fStack_b4 * fStack_b4); if (0.0 < fVar9) { fStack_b8 = fStack_b8 * (1.0 / fVar9); fStack_b4 = fStack_b4 * (1.0 / fVar9); } fStack_a8 = (this->_pos).x - fStack_b8 * 80.0; fStack_c4 = (float)bombCount * 3.0; fStack_bc = (this->_pos).y - fStack_b4 * 80.0; fStack_ac = (float)(bombCount + -1); fStack_90 = -fStack_c4; if (fStack_ac == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar9 = ((float)bombIndex - 0.0) / (fStack_ac - 0.0); auVar13 = ZEXT416((uint)fVar9); if (fVar9 <= 0.0) { auVar13 = ZEXT816(0); } if (1.0 <= auVar13._0_4_) { auVar13._0_4_ = 0x3f800000; } fStack_c4 = ((fStack_c4 - fStack_90) * auVar13._0_4_ + fStack_90) * 0.017453292; fStack_ac = cos(fStack_c4); fVar9 = sin(fStack_c4); (pEVar2->_pos).y = (fStack_b8 * fVar9 + fStack_b4 * fStack_ac) * 80.0 + fStack_bc; (pEVar2->_pos).x = (fStack_b8 * fStack_ac - fStack_b4 * fVar9) * 80.0 + fStack_a8; } } pEVar2[1]._type = (int)bombScale; *(float *)((int)&pEVar2[1]._pendingDamageFlags + 4) = fStack_d0; pEVar2[1]._variant = uStack_50; pEVar2[1]._subtype = (int)fStack_4c; pEVar2[1]._spawnerType = uStack_48; pEVar2[1]._spawnerVariant = uStack_44; pEVar2[1]._sprite._filename._buf[0xf] = '\x01'; manager = g_manager; fStack_ac = (float)uStack_44; fStack_bc = (float)(uStack_44 & DAT_00c3499c); fStack_90 = (float)uStack_50; fStack_c4 = fStack_4c; fStack_a8 = (float)uStack_48; if (((uStack_50 & DAT_00c34990) != 0 || ((uint)fStack_4c & DAT_00c34994) != 0) || ((uStack_48 & DAT_00c34998) != 0 || fStack_bc != 0.0)) { fStack_d0 = 1.21493e-42; seed_fart_sound_override((int *)&fStack_d0); SoundEffects::Play(&manager->_sfxManager,(int)fStack_d0,1.0,2,0,1.0,0.0); pEVar2 = pEStack_c0; } if (1.5 <= bombScale) { pEVar2[1]._damageEvents._end = (void *)((float)pEVar2[1]._damageEvents._end + 85.0); } if (isGigaBomb) { if ((pEVar2->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(pEVar2->_sprite)._animState, *(int *)((int)(pEVar2->_sprite)._animState._animData + 0x30) + -1); } *(undefined4 *)&pEVar2[1].field_0x4 = 0x2d; pEVar2[1]._damageEvents._begin = (void *)0x2d; } if (bombIndex == 0) { if (isPartnerGigaBomb == '\0') { fStack_bc = (float)(this->_numGigaBombs - 1); piVar5 = (int *)&fStack_bc; if (this->_numBombs <= (int)fStack_bc) { piVar5 = &this->_numBombs; } iVar4 = 0; if (0 < *piVar5) { iVar4 = *piVar5; } this->_numGigaBombs = iVar4; ConsumableCountChanged(this,0x40); game = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } } if (isFreeBomb == 0) { iVar3 = this->_numBombs + -1; iVar4 = 99; if (iVar3 < 99) { iVar4 = iVar3; } iVar3 = 0; if (0 < iVar4) { iVar3 = iVar4; } this->_numBombs = iVar3; ConsumableCountChanged(this,4); game = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } } } fVar9 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar9 == 0.0) || (fVar9 != 1.86373e-43)) { iVar4 = GetTrinketMultiplier(this,0x85); bVar8 = false; bVar7 = iVar4 == 0; LAB_007819da: if (!bVar7 && bVar8 == iVar4 < 0) goto LAB_007819e1; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x85); bVar8 = SBORROW4(iVar3,1); iVar4 = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007819da; } LAB_007819e1: *(undefined4 *)&pEVar2[1].field_0x4 = 0x16; pEVar2[1]._damageEvents._begin = (void *)0x16; iVar4 = GetTrinketMultiplier(this,0x85); if (iVar4 == 1) { pvVar11 = (void *)((float)pEVar2[1]._damageEvents._end + 15.000001); } else if (iVar4 == 2) { pvVar11 = (void *)((float)pEVar2[1]._damageEvents._end + 30.000002); } else { if (iVar4 != 3) goto LAB_00781a4c; pvVar11 = (void *)((float)pEVar2[1]._damageEvents._end + 50.0); } pEVar2[1]._damageEvents._end = pvVar11; } LAB_00781a4c: if ((((uint)fStack_90 & DAT_00c34840) != 0 || ((uint)fStack_c4 & DAT_00c34844) != 0) || (((uint)fStack_a8 & DAT_00c34848) != 0 || ((uint)fStack_ac & DAT_00c3484c) != 0)) { uVar6 = *(undefined4 *)((int)&pEStack_c0->_flags + 4); *(uint *)&pEStack_c0->_flags = (uint)pEStack_c0->_flags | 0x4000000; *(undefined4 *)((int)&pEStack_c0->_flags + 4) = uVar6; } manager = g_manager; if (bombIndex == 0) { if (isRocket == '\0') { fStack_d0 = 5.60519e-44; LAB_00781b30: seed_fart_sound_override((int *)&fStack_d0); fVar9 = 1.0; } else { if (bombVariant != 0x14) { fStack_d0 = 7.52497e-43; goto LAB_00781b30; } fStack_d0 = 6.75426e-43; seed_fart_sound_override((int *)&fStack_d0); SoundEffects::Play(&manager->_sfxManager,(int)fStack_d0,1.0,4,0,1.0,0.0); manager = g_manager; fStack_d0 = 7.52497e-43; seed_fart_sound_override((int *)&fStack_d0); fVar9 = 0.8; } SoundEffects::Play(&manager->_sfxManager,(int)fStack_d0,1.0,4,0,fVar9,0.0); } (**(code **)(*(int *)pEStack_c0 + 0xc))(); bombIndex = bombIndex + 1; } while (bombIndex < bombCount); } } } } else { bVar1 = Entity::HasEntityFlags((Entity *)self,0x4000); if (bVar1 == 0) { this->_bombPlaceDelay = iVar4 + -1; return; } } } } return; } //@@ 00781b90 Entity_Player::GetMultiShotParams /* ZHL [exact] Weapon_MultiShotParams* Entity_Player::GetMultiShotParams(Weapon_MultiShotParams* params, int weaponType); prototype: db/protos.zhl, confirmed by RET 8 */ Weapon_MultiShotParams * __thiscall Entity_Player::GetMultiShotParams (Entity_Player *this,Weapon_MultiShotParams *outParams,int weaponType) { byte bVar1; byte isLokisHorns; byte isMonstrosLung; int iVar2; int extraMomsKnives; int iVar3; int iVar4; int extraMomsKnives; int extraTechX; int *effect; uint rngValue; uint rngValue2; short sVar6; bool bVar7; undefined1 auVar8 [12]; float fVar9; int innerEyeCount; outParams->numRandomDirTears = 0; outParams->spreadAngleTears = 0.0; outParams->spreadAngleLaser = 0.0; outParams->speadAngleTechX = 0.0; outParams->multiEyeAngle = 0.0; outParams->spreadAngleKnife = 0.0; outParams->isCrossEyed = 0; outParams->isShootingBackwards = 0; outParams->isShootingSideways = 0; outParams->numTears = 1; outParams->numLanesPerEye = 0; outParams->numEyesActive = 1; iVar2 = GetCollectibleNum(this,0x44,0); iVar2 = iVar2 + -1; extraMomsKnives = GetCollectibleNum(this,0x72,0); extraMomsKnives = extraMomsKnives + -1; iVar3 = GetCollectibleNum(this,0x34,0); iVar3 = iVar3 + -1; iVar4 = GetCollectibleNum(this,0xa8,0); iVar4 = iVar4 + -1; extraMomsKnives = GetCollectibleNum(this,0x149,0); extraMomsKnives = extraMomsKnives + -1; extraTechX = GetCollectibleNum(this,0x18b,0); extraTechX = extraTechX + -1; if (extraTechX < 0) { extraTechX = 0; } if (extraMomsKnives < 0) { extraMomsKnives = 0; } if (iVar4 < 0) { iVar4 = 0; } if (iVar3 < 0) { iVar3 = 0; } if (extraMomsKnives < 0) { extraMomsKnives = 0; } if (iVar2 < 0) { iVar2 = 0; } iVar2 = extraTechX + extraMomsKnives + iVar4 + iVar3 + extraMomsKnives + iVar2; if (iVar2 != 0) { outParams->numTears = outParams->numTears + (short)iVar2; outParams->spreadAngleLaser = (float)iVar2 * 2.333 + outParams->spreadAngleLaser; outParams->spreadAngleTears = (float)iVar2 * 2.167 + outParams->spreadAngleTears; } iVar3 = GetCollectibleNum(this,0xe5,0); iVar3 = iVar3 + -1; if (iVar3 < 0) { iVar3 = 0; } if (iVar3 != 0) { outParams->numTears = outParams->numTears + (short)iVar3 * 5; outParams->spreadAngleLaser = (float)iVar3 * 2.7 + outParams->spreadAngleLaser; outParams->spreadAngleTears = (float)iVar3 * 2.4 + outParams->spreadAngleTears; } iVar3 = GetCollectibleNum(this,0x99,0); iVar3 = iVar3 + (uint)(this->_playerType == 0x21); if ((this->_temporaryeffects)._disabled == 0) { for (effect = (this->_temporaryeffects)._effects._begin; effect != (this->_temporaryeffects)._effects._end; effect = effect + 4) { if ((*(int *)*effect == 0) && (((int *)*effect)[1] == 0x41)) { innerEyeCount = 1; goto LAB_00781d54; } } } innerEyeCount = 0; LAB_00781d54: bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,2); iVar4 = GetCollectibleNum(this,2,0); innerEyeCount = innerEyeCount + (uint)(this->_playerType == 0xe) + iVar4 + (uint)bVar1; bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0xf5); iVar4 = GetCollectibleNum(this,0xf5,0); iVar4 = (uint)bVar1 + iVar4 + (uint)(this->_babySkin == 0x41); if ((iVar3 != 0) || (innerEyeCount != 0)) { extraMomsKnives = iVar3 * 2 + 1 + innerEyeCount; outParams->numTears = outParams->numTears + (short)extraMomsKnives; fVar9 = (float)extraMomsKnives; outParams->spreadAngleLaser = fVar9 * 2.33 + outParams->spreadAngleLaser; outParams->spreadAngleTears = fVar9 * 2.17 + outParams->spreadAngleTears; } if (iVar4 != 0) { sVar6 = outParams->numTears + (short)iVar4; outParams->numTears = sVar6; if ((iVar3 != 0) || (innerEyeCount != 0)) { outParams->numTears = sVar6 + -1; } } if ((((weaponType == 8) || (this->_hasCurseMistEffect != 0)) || (this->_isCoopGhost != 0)) || ((this->_playerForms[10] < 3 || (rngValue = Random(), (rngValue & 3) != 0)))) { if (iVar4 != 0) goto LAB_00781e5c; } else { outParams->numTears = outParams->numTears + 1; LAB_00781e5c: outParams->spreadAngleTears = outParams->spreadAngleTears * 0.4; outParams->spreadAngleLaser = (float)iVar4 + (float)iVar4 + outParams->spreadAngleLaser; } bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x166); iVar3 = GetCollectibleNum(this,0x166,0); iVar3 = (uint)bVar1 + iVar3; if (iVar3 == 0) { sVar6 = outParams->numTears; } else { outParams->numEyesActive = outParams->numEyesActive + iVar3; iVar4 = outParams->numEyesActive; outParams->spreadAngleLaser = (float)iVar3 * 3.0 + outParams->spreadAngleLaser; if (8 < iVar4) { outParams->numEyesActive = 8; iVar4 = 8; } sVar6 = outParams->numTears + (short)iVar3; if ((int)sVar6 % iVar4 != 0) { sVar6 = ((short)iVar4 - (short)((int)sVar6 % iVar4)) + sVar6; } fVar9 = (float)iVar3 * 45.0; auVar8 = ZEXT812(0x425c0000); if (fVar9 <= auVar8._0_4_) { auVar8._4_8_ = auVar8._4_8_; auVar8._0_4_ = fVar9; } outParams->multiEyeAngle = auVar8._0_4_; } if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && (2 < this->_playerForms[7]) ) { bVar7 = iVar3 == 0; sVar6 = sVar6 + 2; } else { bVar7 = false; } outParams->isCrossEyed = bVar7; if (0x10 < sVar6) { sVar6 = 0x10; } fVar9 = outParams->spreadAngleTears * 2.4; sVar6 = (short)((int)sVar6 / outParams->numEyesActive); outParams->numLanesPerEye = sVar6; outParams->spreadAngleKnife = outParams->spreadAngleLaser * 2.14; outParams->numTears = sVar6 * (short)outParams->numEyesActive; outParams->speadAngleTechX = fVar9; if (90.0 < outParams->spreadAngleTears) { outParams->spreadAngleTears = 90.0; } if (90.0 < outParams->spreadAngleLaser) { outParams->spreadAngleLaser = 90.0; } if (90.0 < fVar9) { outParams->speadAngleTechX = 90.0; } bVar1 = HasCollectible(this,0x37,0); isLokisHorns = HasCollectible(this,0x57,0); isMonstrosLung = HasCollectible(this,0xe5,0); if (weaponType == 8) { if ((bVar1 == 0) && (isLokisHorns == 0)) { outParams->isShootingBackwards = 0; } else { outParams->isShootingBackwards = 1; } } else { if (((bVar1 == 0) || (rngValue = Random(), this->_luck * 0.1 + 0.5 <= (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10)) && ((isLokisHorns == 0 || (rngValue = Random(), this->_luck * 0.05 + 0.25 <= (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10)))) goto LAB_007820c8; outParams->isShootingBackwards = 1; } outParams->isShootingSideways = isLokisHorns; LAB_007820c8: bVar1 = HasCollectible(this,0x22e,0); if (bVar1 != 0) { rngValue = Random(); rngValue2 = Random(); iVar3 = ((rngValue & 3) - 3) + (rngValue2 & 3); sVar6 = 0; if (0 < iVar3) { sVar6 = (short)iVar3; } outParams->numRandomDirTears = sVar6; return outParams; } if (isMonstrosLung != 0) { if (weaponType == 6) { rngValue = Random(); outParams->numRandomDirTears = (short)(rngValue % 3) + 2; return outParams; } if ((weaponType == 2) || (weaponType == 9)) { rngValue = Random(); outParams->numRandomDirTears = (short)(rngValue % 3) + 3; } } return outParams; } //@@ 00782160 Entity_Player::GetMultiShotPositionVelocity /* ZHL [exact] static cleanup PosVel Entity_Player::GetMultiShotPositionVelocity(int loopIndex, WeaponType weaponType, Vector shotDirection, float shotSpeed, Weapon_MultiShotParams multiShotParams); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl Entity_Player::GetMultiShotPositionVelocity (void *outPosVel,int loopIndex,int weaponType,Vector shotDirection,float shotSpeed, short numTears,float spreadAngleTears,float spreadAngleLaser,float spreadAngleTechX, float spreadAngleKnife,int numEyesActive,float multiEyeAngle,byte isCrossEyed, short numRandomDirTears) { int laneCount; float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; short in_stack_0000001e; float spreadAngle; float cosAngle; spreadAngle = spreadAngleTears; if ((weaponType == 3) || (weaponType == 2)) { spreadAngleTechX = spreadAngleLaser; } else if (weaponType != 9) { if (weaponType == 4) { spreadAngleTechX = spreadAngleKnife; } else { if (weaponType != 10) goto LAB_007821cb; spreadAngleTechX = spreadAngleKnife * 3.0; } } spreadAngle = spreadAngleTechX; LAB_007821cb: *(undefined4 *)((int)outPosVel + 4) = 0; *(undefined4 *)outPosVel = 0; *(undefined4 *)((int)outPosVel + 0xc) = 0; *(undefined4 *)((int)outPosVel + 8) = 0; if ((isCrossEyed != 0) && (numTears + -2 <= loopIndex)) { if (loopIndex == numTears + -1) { cosAngle = cos(0.7853982); fVar1 = 0.7853982; } else { cosAngle = cos(-0.7853982); fVar1 = -0.7853982; } fVar1 = sin(fVar1); *(float *)((int)outPosVel + 8) = shotSpeed * (shotDirection.x * cosAngle - shotDirection.y * fVar1); *(float *)((int)outPosVel + 0xc) = shotSpeed * (shotDirection.x * fVar1 + shotDirection.y * cosAngle); return outPosVel; } fVar1 = 0.0; if (1 < numEyesActive) { if ((float)numEyesActive - 1.0 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar1 = ((float)(loopIndex % numEyesActive) - 0.0) / (((float)numEyesActive - 1.0) - 0.0); if (fVar1 <= 0.0) { fVar1 = 0.0; } if (1.0 <= fVar1) { fVar1 = 1.0; } fVar1 = (multiEyeAngle - -multiEyeAngle) * fVar1 + -multiEyeAngle; } fVar2 = cos(fVar1 * 0.017453292); fVar1 = sin(fVar1 * 0.017453292); fVar5 = shotDirection.x * fVar2 - shotDirection.y * fVar1; fVar1 = shotDirection.y * fVar2 + shotDirection.x * fVar1; *(float *)((int)outPosVel + 8) = fVar5 * shotSpeed; *(float *)((int)outPosVel + 0xc) = fVar1 * shotSpeed; if (1 < in_stack_0000001e) { if (((weaponType == 1) || (weaponType == 9)) || (weaponType == 5)) { laneCount = (int)in_stack_0000001e; if ((float)laneCount - 1.0 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar2 = ((float)(loopIndex / numEyesActive) - 0.0) / (((float)laneCount - 1.0) - 0.0); if (fVar2 <= 0.0) { fVar2 = 0.0; } if (1.0 <= fVar2) { fVar2 = 1.0; } fVar2 = (fVar2 * 180.0 - 90.0) * 0.017453292; fVar3 = sqrtf(fVar1 * fVar1 + fVar5 * fVar5); fVar4 = cos(fVar2); fVar4 = fVar4 * 1.15 * fVar3; fVar2 = sin(fVar2); fVar3 = fVar2 * 0.8 * fVar3; fVar1 = atan2f(fVar1,fVar5); fVar1 = fVar1 * 57.295776 * 0.017453292; fVar2 = cos(fVar1); fVar1 = sin(fVar1); *(float *)outPosVel = fVar2 * fVar4 - fVar1 * fVar3; *(float *)((int)outPosVel + 4) = fVar2 * fVar3 + fVar1 * fVar4; } if ((float)(int)in_stack_0000001e - 1.0 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar1 = ((float)(loopIndex / numEyesActive) - 0.0) / (((float)(int)in_stack_0000001e - 1.0) - 0.0); if (fVar1 <= 0.0) { fVar1 = 0.0; } if (1.0 <= fVar1) { fVar1 = 1.0; } fVar1 = ((spreadAngle - -spreadAngle) * fVar1 + -spreadAngle) * 0.017453292; fVar2 = cos(fVar1); fVar5 = sin(fVar1); fVar1 = *(float *)((int)outPosVel + 8); *(float *)((int)outPosVel + 8) = fVar1 * fVar2 - *(float *)((int)outPosVel + 0xc) * fVar5; *(float *)((int)outPosVel + 0xc) = *(float *)((int)outPosVel + 0xc) * fVar2 + fVar1 * fVar5; } return outPosVel; } //@@ 00782630 Entity_Player::GetFlyingOffset /* ZHL [lua] Lua binding EntityPlayer:GetFlyingOffset prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::GetFlyingOffset(Entity_Player *this,Vector *outOffset) { float fVar1; fVar1 = g_vectorZero.x; if (*(int *)((int)g_game->_room + 8) == 0x10) { outOffset->y = g_vectorZero.y; outOffset->x = fVar1; return; } if (this->_canFly == 0) { outOffset->y = g_vectorZero.y; outOffset->x = fVar1; return; } outOffset->y = -4.0; outOffset->x = 0.0; return; } //@@ 007826c0 FUN_007826c0 undefined4 FUN_007826c0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x140c); } //@@ 007826d0 Entity_Player::trigger_fire_item_effects /* DB: ? ECX=Entity_Player, three times from Entity_Player::update_shooting when a shot fires: Dead Tooth (446) spawns effect 1000.106 ring kept at +0x1438 (scale 0.8, parent=player), Large Zit (502) every 30 frames calls Entity_Player::DoZitEffect, then iterates more entities; skipped for remote netplay players */ void __thiscall Entity_Player::trigger_fire_item_effects(Entity_Player *this,undefined4 param_2,undefined4 param_3) { undefined1 *puVar1; EntityPtr *pEVar2; code *pcVar3; Game *pGVar4; char cVar5; byte bVar6; uint uVar7; Entity *pEVar8; undefined4 uVar9; int iVar10; void **ppvVar11; float fVar12; Entity_Player *apEStack_c [2]; apEStack_c[0] = this; if ((*(int *)&g_game->_deathmatchManager < 2) || (cVar5 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x48))(this), cVar5 != '\0') ) { bVar6 = HasCollectible(this,0x1be,0); if ((bVar6 != 0) && (((char)param_3 != '\0' && (puVar1 = &this->field_0x1438, *(int *)&this->field_0x1438 == 0))) ) { uVar7 = Random(); pEVar8 = Game::SpawnEx(g_game,1000,0x6a,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar7,0); fVar12 = g_vectorOne.y * 0.8; (pEVar8->_sprite)._scale.x = g_vectorOne.x * 0.8; (pEVar8->_sprite)._scale.y = fVar12; if (*(int *)puVar1 != 0) { apEStack_c[0] = (Entity_Player *)puVar1; std::multiset::erase(apEStack_c); } *(Entity **)puVar1 = pEVar8; if (pEVar8 != (Entity *)0x0) { std::multiset::insert(puVar1); } pEVar2 = &pEVar8->_parent; if (pEVar8->_parent != (EntityPtr)0x0) { apEStack_c[0] = (Entity_Player *)pEVar2; std::multiset::erase(apEStack_c); } *pEVar2 = (EntityPtr)this; std::multiset::insert(pEVar2); (**(code **)(*(int *)pEVar8 + 0xc))(); } bVar6 = HasCollectible(this,0x1f6,0); pGVar4 = g_game; if ((((bVar6 != 0) && ((char)param_3 != '\0')) && ((this->_flags & 0x4000) == 0)) && (((bVar6 = Game::IsPaused(g_game), bVar6 == 0 && (pGVar4->_frameCount % 0x1e == 0)) && (uVar7 = Random(), uVar7 % 3 == 0)))) { DoZitEffect(param_2); } if (this->_weapons[0] != (int *)0x0) { pcVar3 = *(code **)(*(int *)this->_weapons[0] + 0xc); uVar7 = (uint)this->_flags & 0x4000; if (uVar7 == 0) { (*pcVar3)(param_2,param_3,0); return; } (*pcVar3)(param_2,param_3,CONCAT31((int3)(uVar7 >> 8),1)); return; } ppvVar11 = this->_weapons; iVar10 = 4; do { ppvVar11 = ppvVar11 + 1; if (*ppvVar11 != (int *)0x0) { apEStack_c[0] = *(Entity_Player **)(*(int *)*ppvVar11 + 0xc); uVar7 = (uint)this->_flags & 0x4000; if (uVar7 == 0) { uVar9 = 0; } else { uVar9 = CONCAT31((int3)(uVar7 >> 8),1); } (*(code *)apEStack_c[0])(param_2,param_3,uVar9); } iVar10 = iVar10 + -1; } while (iVar10 != 0); } return; } //@@ 007828f0 Entity_Player::GetDeathAnimName /* ZHL [exact] __thiscall char* Entity_Player::GetDeathAnimName(); prototype: REPENTOGON, confirmed by RET 0 */ byte * __thiscall Entity_Player::GetDeathAnimName(Entity_Player *this) { int iVar1; byte bVar2; int iVar3; char *pcVar4; iVar1 = this->_playerType; if ((((iVar1 != 10) && (iVar1 != 0x1f)) && (iVar1 != 0x27)) && ((iVar1 != 0x28 && (iVar1 != 0x11)))) { iVar3 = TemporaryEffects::GetCollectibleEffectNum(&this->_temporaryeffects,0x2a5); if (iVar3 != 1) { iVar3 = TemporaryEffects::GetNullEffectNum(&this->_temporaryeffects,0x65); if (iVar3 != 1) { bVar2 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x70); if (((bVar2 == 0) && ((this->_variant != 1 || (this->_babySkin != 0x3b)))) && (this->_isCoopGhost == 0)) { if (iVar1 == 0x23) { return (byte *)"ForgottenDeath"; } pcVar4 = "HoleDeath"; if (this->_pitfallState == 0) { pcVar4 = "Death"; } return (byte *)pcVar4; } } } } return (byte *)"LostDeath"; } //@@ 007829a0 FUN_007829a0 void FUN_007829a0(void) { Entity_Player *pEVar1; int in_ECX; uint uVar2; *(undefined1 *)(in_ECX + 0x131c) = 0; if (*(int *)(in_ECX + 0x2c) != 1) { return; } pEVar1 = *(Entity_Player **)(in_ECX + 0x3bc); if ((pEVar1 == (Entity_Player *)0x0) || (pEVar1->_type != 1)) { pEVar1 = Game::GetPlayer(g_game,0); } if (*(int *)(in_ECX + 0x13c0) == 0x28) { pEVar1 = *(Entity_Player **)(in_ECX + 0x1e68); } if ((pEVar1 != (Entity_Player *)0x0) && (uVar2 = 0, *(int *)(in_ECX + 0x16d8) - *(int *)(in_ECX + 0x16d4) >> 2 != 0)) { do { *(undefined4 *)(*(int *)(in_ECX + 0x16d4) + uVar2 * 4) = *(undefined4 *)((int)(pEVar1->_pillEffectUses)._begin + uVar2 * 4); uVar2 = uVar2 + 1; } while (uVar2 < (uint)(*(int *)(in_ECX + 0x16d8) - *(int *)(in_ECX + 0x16d4) >> 2)); } *(undefined4 *)(in_ECX + 0x1574) = 0xffff; Entity_Player::EvaluateItems(); return; } //@@ 00782a40 Entity_Player::GetActiveWeaponEntity /* ZHL [lua] Lua binding EntityPlayer:GetActiveWeaponEntity */ undefined4 __thiscall Entity_Player::GetActiveWeaponEntity(Entity_Player *this) { undefined4 uVar1; int *piVar2; piVar2 = this->_weapons[0]; if ((piVar2 == (int *)0x0) && (piVar2 = this->_weapons[1], piVar2 == (int *)0x0)) { return 0; } /* WARNING: Could not recover jumptable at 0x00782a58. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*piVar2 + 0x28))(); return uVar1; } //@@ 00782a60 Entity_Player::CanTurnHead /* ZHL [lua] Lua binding EntityPlayer:CanTurnHead */ uint __thiscall Entity_Player::CanTurnHead(Entity_Player *this) { return (uint)this->_headDirectionTime >> 0x1f; } //@@ 00782a70 Entity_Player::FireDelay /* ZHL [lua] Lua binding EntityPlayer:FireDelay */ float10 __thiscall Entity_Player::FireDelay(Entity_Player *this) { void *pvVar1; pvVar1 = this->_weapons[0]; if ((pvVar1 == (void *)0x0) && (pvVar1 = this->_weapons[1], pvVar1 == (void *)0x0)) { return (float10)0.0; } return (float10)*(float *)((int)pvVar1 + 0xc); } //@@ 00782ab0 FUN_00782ab0 void FUN_00782ab0(undefined4 param_1) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x13dc); if ((iVar1 != 0) || (iVar1 = *(int *)(in_ECX + 0x13e0), iVar1 != 0)) { *(undefined4 *)(iVar1 + 0xc) = param_1; } return; } //@@ 00782af0 Entity_Player::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 34 KB vtable slot 3; "Controller %d has disconnected", status-effect anims; ZHL had put the name on 006d97e0 Entity_NPC::zhl_misfit_006d97e0 void __thiscall Entity_Player::Update(Entity_Player *this) { BitSet128 tearFlags; BitSet128 tearFlags_00; BitSet128 tearFlags_01; byte bVar1; char cVar2; short sVar3; int iVar4; Entity_Player *otherPlayer; Entity *tmpEntity; Vector *vecResult; Room *room; int iVar5; EntityPtr *pEVar6; PlayerManager *playerManager; uint uVar7; Vector *vecResult2; EntityPtr EVar8; float *pfVar9; SoundEffects *sfx; undefined4 *puVar10; Entity_Effect *spawnedEffect; Vector *other; PauseScreen *this_00; uint *puVar11; RNG *rng; ColorMod *color; BitSet128 *pBVar12; Level *pLVar13; int *piVar14; void *pvVar15; byte *pbVar16; void *layerFrame; ColorMod *color_00; TemporaryEffects *tempEffects; EntityPtr EVar17; undefined1 *puVar18; Entity_NPC *this_01; Vector *offset; ItemConfig *itemConfig; ItemConfig_Item *itemCfg; Entity_Projectile *projectile; Sprite *sprite; AnimationState *animState; ColorMod *other_00; ColorMod *other_01; ColorMod *from; LayerState *layer; ANM2 *pAVar19; byte *layerCount; EntityList *entityList; std_string *anim; char *walkAnim; ColorMod *Color; Entity_Player *this_02; MusicManager *musicManager; GridEntity *gridEntity; int iVar20; PersistentGameData *this_03; Color *this_04; ActiveItemDesc *activeDesc; char *pcVar21; PlayerCostumeMap *costumeMap; bool bVar22; float10 fVar23; float in_XMM0_Da; float fVar24; undefined1 auVar25 [16]; undefined1 auVar26 [12]; ulonglong uVar27; Color aCStackY_188c [128]; Vector *in_stack_fffffdbc; uint uVar28; undefined4 uVar29; float fVar30; BitSet128 *pBVar31; undefined4 uVar32; undefined1 **src; EntityRef *other_02; Vector local_228 [3]; Vector local_210 [14]; BitSet128 local_1a0; Vector local_190; float local_188; Vector scratchVec; Vector local_17c; Vector local_174; Vector local_16c; Vector local_164; EntityPtr local_15c; Vector local_158; Vector local_150; std_string *local_148; Vector local_144; Vector local_13c; Entity_Player *player; EntityPtr local_130; byte local_12a; byte local_129; undefined4 local_128; byte local_122; char local_121; EntityPtr local_120; Color local_11c; undefined1 local_f0 [88]; undefined1 local_98 [48]; undefined1 local_68 [20]; undefined1 *puStack_54; float fStack_50; float local_4c; int local_48; void *local_44; char tmpString [8]; undefined1 local_24 [12]; int iStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; longlong elapsedMs; Game *game; ColorMod *tmpColor; code *vfunc; local_8 = 0xffffffff; puStack_c = &LAB_00aff534; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; local_158.y = 0.0; local_15c = (EntityPtr)0x0; player = this; if (((this->_parent != (EntityPtr)0x0) && (this->_variant == 0)) && (this->_playerHUD == (void *)0x0)) { PlayerHUD::make_ref(); local_8 = 0; FUN_007dd3d0(); local_8 = 0xffffffff; FUN_007dc660(); } if (this->_playerHUD != (PlayerHUD *)0x0) { PlayerHUD::Update(this->_playerHUD); } ItemUseAnim::update(); EVar8 = this->_salvationEffect; if (EVar8 != (EntityPtr)0x0) { FUN_007d4340(); *(float *)((int)EVar8 + 0x478) = in_XMM0_Da * 1.2; EVar8 = this->_salvationEffect; *(undefined4 *)((int)EVar8 + 0x34c) = 0; *(undefined4 *)((int)EVar8 + 0x350) = 0xc1700000; if ((this->_flags & 0x4000) == 0) { in_XMM0_Da = 0.0; } else { in_XMM0_Da = 0.5; } in_XMM0_Da = (float)((g_game->_frameCount - this->_spawnFrame) % 0x168) + in_XMM0_Da; *(float *)((int)this->_salvationEffect + 0xec) = in_XMM0_Da; } if ((this->_playerType == 0x1d) || (this->_playerType == 0x26)) { if (((this->_backupPlayer == (void *)0x0) || (*(char *)((int)this->_backupPlayer + 0x170) != '\0')) || ((bVar1 = HasCollectible(this,0x26b,0), bVar1 == 0 && (bVar1 = HasCollectible(this->_backupPlayer,0x26b,0), bVar1 == 0)))) { iVar4 = EntityPtr::Ref(); if ((iVar4 != 0) && (bVar1 = HasCollectible(this,0x26b,0), bVar1 == 0)) { otherPlayer = (Entity_Player *)EntityPtr::Ref(); bVar1 = HasCollectible(otherPlayer,0x26b,0); if ((bVar1 == 0) && (bVar1 = IsHologram(this), bVar1 == 0)) { pvVar15 = (void *)EntityPtr::Ref(); this->_backupPlayer = pvVar15; iVar4 = EntityPtr::Ref(); tmpEntity = (Entity *)0x0; *(Entity_Player **)(iVar4 + 0x1e6c) = this; iVar4 = EntityPtr::Ref(); EntityPtr::Set((EntityPtr *)(iVar4 + 0x1e68),tmpEntity); EntityPtr::Set(&this->_twinPlayer,(Entity *)0x0); room_exit(this->_backupPlayer,0); FUN_004173a0(); game = g_game; *(undefined1 *)((int)this->_backupPlayer + 0x172) = 0; *(undefined4 *)((int)this->_backupPlayer + 0x161c) = 0xffffffff; Level::GetCurrentRoom((Level *)game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,(EntityList_EL *)local_24,3,-1,-1,0,0); local_8 = 1; uVar28 = 0; iVar4 = EntityList::Size(); if (iVar4 != 0) { do { pEVar6 = (EntityPtr *)std::vector::operator_index(); local_120 = *pEVar6; pvVar15 = (void *)Entity_Familiar::Player((Entity_Familiar *)local_120); if (pvVar15 == this->_backupPlayer) { (**(code **)(*(int *)local_120 + 0x28))(); } uVar28 = uVar28 + 1; uVar7 = EntityList::Size(); } while (uVar28 < uVar7); } uVar28 = Random(); vecResult = Entity::Position(this->_backupPlayer,&local_16c); in_stack_fffffdbc = &g_vectorZero; Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar28); Game::GetPlayerManager(g_game); FUN_009b9fc0(); local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(local_24); } } } else { local_150.y = (float)&this->_twinPlayer; EntityPtr::Set((EntityPtr *)local_150.y,this->_backupPlayer); EntityPtr::Set((EntityPtr *)((int)this->_backupPlayer + 0x1e68),(Entity *)this); *(undefined4 *)((int)this->_backupPlayer + 0x1e6c) = 0; local_120 = (EntityPtr)this->_controllerIndex; this->_backupPlayer = (void *)0x0; iVar4 = EntityPtr::Ref(); if (*(char *)(iVar4 + 0x20e8) != '\0') { otherPlayer = (Entity_Player *)EntityPtr::Ref(); iVar4 = EntityPtr::Ref(); RestoreGameState(otherPlayer,(GameStatePlayer *)(iVar4 + 0x20ec)); otherPlayer = (Entity_Player *)EntityPtr::Ref(); iVar4 = EntityPtr::Ref(); spawn_dark_esau(otherPlayer,(void *)(iVar4 + 0x20ec)); iVar4 = EntityPtr::Ref(); *(undefined1 *)(iVar4 + 0x20e8) = 0; } SetControllerIndex(this); iVar4 = EntityPtr::Ref(); if (*(char *)(iVar4 + 0x1824) == '\0') { otherPlayer = (Entity_Player *)EntityPtr::Ref(); InitPostLevelInitStats(otherPlayer); } iVar4 = EntityPtr::Ref(); *(undefined1 *)(iVar4 + 0x172) = 1; tmpEntity = (Entity *)EntityPtr::Ref(); this = player; vecResult = MusicManager::RandomVector(&local_16c); local_120 = (EntityPtr)0x41700000; vecResult = Vector::operator_mul(&scratchVec,(float *)&local_120,vecResult); vecResult = Vector::__add(&this->_pos,&local_17c,vecResult); Entity::SetPosition(tmpEntity,vecResult); tmpEntity = (Entity *)EntityPtr::Ref(); Entity::SetVelocity(tmpEntity,&this->_velocity); Game::GetPlayerManager(g_game); EntityPtr::Ref(); FUN_009b9f60(); uVar28 = 0xffffffff; in_stack_fffffdbc = (Vector *)EntityPtr::Ref(); SyncConsumables(this,(Entity_Player *)in_stack_fffffdbc,uVar28); iVar4 = EntityPtr::Ref(); in_XMM0_Da = 0.0; *(undefined4 *)(iVar4 + 0x13f0) = 0; *(undefined4 *)(iVar4 + 0x13f4) = 0; *(undefined4 *)(iVar4 + 0x13f8) = 0; *(undefined4 *)(iVar4 + 0x13fc) = 0; *(undefined1 *)(iVar4 + 0x1400) = 0; iVar4 = EntityPtr::Ref(); *(undefined4 *)(iVar4 + 0x1574) = 0xffff; EntityPtr::Ref(); EvaluateItems(); iVar4 = EntityPtr::Ref(); *(undefined1 *)(iVar4 + 0x410) = 1; iVar4 = EntityPtr::Ref(); ANM2::Reset((ANM2 *)(iVar4 + 0x41c)); iVar4 = EntityPtr::Ref(); *(undefined1 *)(iVar4 + 0x139a) = 0; iVar4 = EntityPtr::Ref(); Sprite::SetLastFrame((Sprite *)(iVar4 + 0x48)); iVar4 = EntityPtr::Ref(); *(undefined1 *)(iVar4 + 0x1398) = 0; } } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { if (*(short *)((int)this + 0x1d94) != *(short *)((int)this + 0x1d96)) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 1; *(short *)((int)this + 0x1d96) = *(short *)((int)this + 0x1d94); Level::SetHeartPicked((Level *)((int)this + 0x1508)); } cVar2 = FUN_00417390(); if (cVar2 != '\0') { FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); cVar2 = FUN_0082ee30(); if ((cVar2 == '\0') && (*(byte *)((int)this + 0x1fc4) != 0)) { level_start(this,1); } } } } cVar2 = FUN_00417390(); if ((cVar2 == '\0') && (*(int *)((int)this + 0x34) == 0x388)) { cVar2 = Sprite::IsLoaded((Sprite *)((int)this + 0x41c)); if (cVar2 == '\0') { ExceptionList = local_10; return; } ANM2::Update((ANM2 *)((int)this + 0x41c)); ExceptionList = local_10; return; } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar1 = Room::HasCurseMist(room); if (bVar1 != *(byte *)((int)this + 0x202c)) { if (bVar1 == 0) { RemoveCurseMistEffect(this); } else { AddCurseMistEffect(this); } } } } } if ((*(int *)((int)this + 0x2c) == 0) && (cVar2 = Entity::IsDead((Entity *)this), cVar2 == '\0')) { bVar1 = HasTrinket(this,0x67,0); if (bVar1 == 0) { LAB_007831dd: bVar1 = TemporaryEffects::HasTrinketEffect((TemporaryEffects *)((int)this + 0x1508),0x67); if (bVar1 == 0) goto LAB_0078320d; TemporaryEffects::RemoveTrinketEffect((TemporaryEffects *)((int)this + 0x1508),0x67,1); } else { iVar4 = GetNumBombs(this); iVar5 = GetNumCoins(this); if (iVar4 != iVar5) goto LAB_007831dd; iVar4 = GetNumCoins(this); iVar5 = GetNumKeys(this); if (iVar4 != iVar5) goto LAB_007831dd; bVar1 = TemporaryEffects::HasTrinketEffect((TemporaryEffects *)((int)this + 0x1508),0x67); if (bVar1 != 0) goto LAB_0078320d; in_stack_fffffdbc = (Vector *)0x7831db; TemporaryEffects::AddTrinketEffect((TemporaryEffects *)((int)this + 0x1508),0x67,1,1); } AddCacheFlags(this,2); EvaluateItems(); } LAB_0078320d: if (*(int *)((int)this + 0x2c) == 2) { FUN_00417920(); cVar2 = FUN_004178f0(); if (cVar2 == '\0') { LAB_0078328a: Entity::HasEntityFlags((Entity *)this,0x4000); if (*(EntityPtr *)((int)this + 0x3c4) != (EntityPtr)0x0) { local_150.y = ((Vector *)((int)this + 0x334))->x + 0.1; local_120 = (EntityPtr)0x3f800000; pEVar6 = (EntityPtr *)std::min(); EVar8 = *(EntityPtr *)((int)this + 0x3c4); local_120 = *pEVar6; ((Vector *)((int)this + 0x334))->x = (float)local_120; vecResult = Entity::Position((Entity *)EVar8,&local_16c); vecResult = vector_lerp(&scratchVec,(Vector *)((int)this + 0x33c),vecResult,0, (float)local_120); Vector::operator_assign((Vector *)((int)this + 0x33c),vecResult); Vector::operator_assign((Vector *)((int)this + 0x360),&g_vectorZero); ExceptionList = local_10; return; } Level::GetCurrentRoom((Level *)g_game); local_130 = (EntityPtr)Room::GetEntities(); uVar28 = 0; iVar4 = EntityList::Size(); if (iVar4 == 0) { ExceptionList = local_10; return; } do { tmpEntity = (Entity *)FUN_00417610(); local_120 = (EntityPtr)Entity::to_npc_or_coop_player(tmpEntity); if (local_120 != (EntityPtr)0x0) { cVar2 = Entity::is_valid_target(); EVar8 = local_120; if (cVar2 != '\0') { Entity::SetTarget((Entity *)this,(Entity *)local_120); vecResult = Entity::Position((Entity *)EVar8,&local_16c); Vector::operator_assign((Vector *)((int)this + 0x33c),vecResult); Vector::operator_assign((Vector *)((int)this + 0x360),&g_vectorZero); ((Vector *)((int)this + 0x334))->x = 1.0; ExceptionList = local_10; return; } } uVar28 = uVar28 + 1; uVar7 = EntityList::Size(); } while (uVar28 < uVar7); ExceptionList = local_10; return; } InputManager::get_device(&PTR_vftable_00c57b18,&local_17c,*(int *)((int)this + 0x1618)); local_8 = 2; iVar4 = EntityPtr::Ref(); if (iVar4 != 0) { EntityPtr::Ref(); cVar2 = QueueItemData::Touched(); if (cVar2 != '\0') { local_8 = 0xffffffff; FUN_004242b0(); goto LAB_0078328a; } } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); PlayerManager::RemoveCoPlayer(playerManager,this,0); FUN_004242b0(); ExceptionList = local_10; return; } *(undefined1 *)((int)this + 0x1dd8) = 0; bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { if (*(char *)&(((Entity_Player *)((int)this + 0x26cc))->_damageEvents)._begin == '\0') { *(undefined4 *)&((Entity_Player *)((int)this + 0x26cc))->field_0x4 = 0; } else { puVar18 = &((Entity_Player *)((int)this + 0x26cc))->field_0x4; *(int *)puVar18 = *(int *)puVar18 + 1; } *(undefined1 *)&(((Entity_Player *)((int)this + 0x26cc))->_damageEvents)._begin = 0; } if (*(byte *)((int)this + 0x172) == 0) { ExceptionList = local_10; return; } if (*(undefined1 *)((int)this + 0x131c) != '\0') { FUN_007829a0(); } vecResult = (Vector *)((int)this + 0x33c); if (*(Entity **)((int)this + 0x143c) != (Entity *)0x0) { Entity::SetPosition(*(Entity **)((int)this + 0x143c),vecResult); Entity::SetVelocity(*(Entity **)((int)this + 0x143c),&g_vectorZero); } if (*(Entity **)((int)this + 0x1440) != (Entity *)0x0) { Entity::SetPosition(*(Entity **)((int)this + 0x1440),vecResult); Entity::SetVelocity(*(Entity **)((int)this + 0x1440),&g_vectorZero); } local_120 = *(EntityPtr *)((int)this + 0x1444); if (local_120 != (EntityPtr)0x0) { vecResult2 = Vector::Vector(&local_16c,0.0,-15.0); Entity::SetPositionOffset((Entity *)local_120,vecResult2); Entity::SetPosition((Entity *)*(EntityPtr *)((int)this + 0x1444),vecResult); Entity::SetVelocity((Entity *)*(EntityPtr *)((int)this + 0x1444),&g_vectorZero); } if (*(Entity **)((int)this + 0x1e78) != (Entity *)0x0) { Entity::SetPosition(*(Entity **)((int)this + 0x1e78),vecResult); Entity::SetVelocity(*(Entity **)((int)this + 0x1e78),&g_vectorZero); } if (*(Entity **)((int)this + 0x1e7c) != (Entity *)0x0) { Entity::SetPosition(*(Entity **)((int)this + 0x1e7c),vecResult); Entity::SetVelocity(*(Entity **)((int)this + 0x1e7c),&g_vectorZero); } if (*(EntityPtr *)((int)this + 0x1e80) != (EntityPtr)0x0) { Entity::SetPosition((Entity *)*(EntityPtr *)((int)this + 0x1e80),vecResult); Entity::SetVelocity((Entity *)*(EntityPtr *)((int)this + 0x1e80),&g_vectorZero); } iVar4 = EntityPtr::Ref(); if (iVar4 != 0) { tmpEntity = (Entity *)EntityPtr::Ref(); EVar8 = (EntityPtr)Entity::Target(tmpEntity); if (EVar8 == (EntityPtr)this) { tmpEntity = (Entity *)EntityPtr::Ref(); Entity::SetPosition(tmpEntity,vecResult); tmpEntity = (Entity *)EntityPtr::Ref(); Entity::SetVelocity(tmpEntity,(Vector *)((int)this + 0x360)); } } if (*(Entity **)((int)this + 0x1e88) != (Entity *)0x0) { Entity::SetPosition(*(Entity **)((int)this + 0x1e88),vecResult); Entity::SetVelocity(*(Entity **)((int)this + 0x1e88),&g_vectorZero); } FUN_00757a10(); *(float *)((int)this + 0x39c) = in_XMM0_Da; local_12a = IsExtraAnimationFinished(this); bVar1 = Entity::HasEntityFlags((Entity *)this,0x200000000000000); if (bVar1 == 0) { if ((*(float *)((int)this + 0x350) <= 0.0 && *(float *)((int)this + 0x350) != 0.0) || (*(float *)((int)this + 0x1e70) <= 0.0 && *(float *)((int)this + 0x1e70) != 0.0)) { if (((*(byte *)((int)this + 0x1570) == 0) && (*(int *)((int)this + 0x184) == 5)) || (bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000), bVar1 != 0)) { fVar30 = *(float *)((int)this + 0x1f88) - *(float *)((int)this + 0x1e70); *(float *)((int)this + 0x1f88) = fVar30; if (0.0 < fVar30) { *(float *)((int)this + 0x1f8c) = *(float *)((int)this + 0x1f8c) - fVar30 * 0.2; } *(float *)((int)this + 0x350) = *(float *)((int)this + 0x1e70) + *(float *)((int)this + 0x350); bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); if (bVar1 == 0) { *(float *)((int)this + 0x1e70) = *(float *)((int)this + 0x1e70) + 1.1; } else { fVar30 = *(float *)((int)this + 0x1e70) + 0.6; *(float *)((int)this + 0x1e70) = fVar30; if ((fVar30 < 0.0) || (*(float *)((int)this + 0x350) <= -26.0 && *(float *)((int)this + 0x350) != -26.0)) { *(int *)((int)this + 0x184) = 3; } else { *(uint *)((int)this + 0x184) = (uint)(*(byte *)((int)this + 0x1570) == 0) * 2 + 3; } } if (0.0 < *(float *)((int)this + 0x350)) { *(float *)((int)this + 0x350) = 0.0; *(float *)((int)this + 0x1e70) = 0.0; bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); if (bVar1 != 0) { Entity::ClearEntityFlags((Entity *)this,0x400000000000000); FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); cVar2 = FUN_0082ee30(); if ((cVar2 == '\0') && (*(byte *)((int)this + 0x410) = 1, *(int *)((int)this + 0x13c0) == 0x23)) { Game::ShakeScreen(g_game,4); play_sound_with_fart_seed(499,1.0,2,0,1.0); in_stack_fffffdbc = (Vector *)0x1d3; play_sound_with_fart_seed(0x1d3,1.0,2,0,1.0); } } } } } else { *(float *)((int)this + 0x350) = 0.0; *(float *)((int)this + 0x1e70) = 0.0; } } } else { *(float *)((int)this + 0x1e70) = 0.0; } if (*(int *)((int)this + 0x13c0) == 0x23) { fVar30 = *(float *)((int)this + 0x1f8c); fVar24 = fVar30 + *(float *)((int)this + 0x1f88); *(float *)((int)this + 0x1f88) = fVar24; if ((fVar24 < 0.0) || (*(float *)((int)this + 0x1f88) = 0.0, fVar30 <= 0.0)) { fVar30 = fVar30 + 0.6; } else if (2.0 <= fVar30) { fVar30 = fVar30 * -0.45; } else { fVar30 = 0.0; } *(float *)((int)this + 0x1f8c) = fVar30; } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { EntityRef::EntityRef((EntityRef *)local_68); bVar1 = HasCollectible(this,0x278,0); if ((bVar1 == 0) && (bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),0x278), bVar1 == 0)) { local_16c.y = *(float *)((int)this + 0x1c); } else { local_16c.y = *(float *)((int)this + 0x1c); *(uint *)((int)this + 0x18) = *(uint *)((int)this + 0x18) & 0xffff7fff; *(float *)((int)this + 0x1c) = local_16c.y; } if ((*(uint *)((int)this + 0x18) & 0x8000) == 0) { if ((0 < *(int *)((int)this + 0x1ea8)) && (bVar1 = Entity::IsFrame((Entity *)this,3,0), bVar1 != 0)) { *(int *)((int)this + 0x1ea8) = 0; sfx = MusicManager::SFXManager(); SFXManager::Stop(sfx,0x24e); } } else { local_144.y = (float)((uint)local_144.y & 0xffffff00); std::iterator_copy((std_vector *)((int)this + 8),&local_128); FUN_00456190(); cVar2 = FUN_0042c710(); if (cVar2 != '\0') { do { pfVar9 = (float *)EntityPtr::Ref(); if ((*pfVar9 == 0.0) && (iVar4 = EntityPtr::Ref(), (*(uint *)(iVar4 + 8) & 0x8000) != 0)) { iVar4 = EntityPtr::Ref(); if (*(int *)(iVar4 + 0x10) != 0) { iVar4 = EntityPtr::Ref(); EntityRef::operator_((EntityRef *)local_68,(EntityRef *)(iVar4 + 0x10)); } iVar4 = EntityPtr::Ref(); local_144.y = (float)((uint)local_144.y & 0xff); if (*(int *)(iVar4 + 0x18) == 0x3b6) { local_144.y = 1.4013e-45; } pfVar9 = (float *)std::vector::erase(); local_128 = (RNG *)*pfVar9; } else { FUN_004a11b0(); } FUN_00456190(); cVar2 = FUN_0042c710(); } while (cVar2 != '\0'); this = player; } *(uint *)((int)this + 0x18) = *(uint *)((int)this + 0x18) & 0xffff7fff; *(int *)((int)this + 0x1ea8) = *(int *)((int)this + 0x1ea8) + 1; *(undefined4 *)((int)this + 0x1c) = *(undefined4 *)((int)this + 0x1c); if (local_144.y._0_1_ == '\0') { Entity::AddEntityFlags((Entity *)this,0x40); sfx = MusicManager::SFXManager(); bVar1 = SFXManager::IsPlaying(sfx,0x24e); if (bVar1 == 0) { sfx = MusicManager::SFXManager(); in_stack_fffffdbc = (Vector *)0x1; SoundEffects::Play(sfx,0x24e,1.0,1,0,1.0,0.0); } } } if ((0 < *(int *)((int)this + 0x1ea8)) && (*(byte *)((int)this + 0x173) == 0)) { local_150.y = 1.0; local_164.y = (float)*(int *)((int)this + 0x1ea8) / 30.0; puVar10 = (undefined4 *)std::min(); local_148 = (std_string *)*puVar10; bVar1 = Entity::HasEntityFlags((Entity *)this,0x40); vfunc = *(code **)(*(int *)this + 0x3c); if (bVar1 == 0) { local_150.y = Math::lerp((float)local_148,0.0,0.2,0); local_164.y = Math::lerp((float)local_148,0.0,0.5,0); Math::lerp((float)local_148,0.0,0.5,0); ::Color::Color(); in_stack_fffffdbc = (Vector *)0x2; (*vfunc)(); if (0x14 < *(int *)((int)this + 0x1ea8)) { bVar1 = Entity::IsFrame((Entity *)this,2,0); goto joined_r0x00783ce0; } } else { Math::lerp((float)local_148,0.0,0.5,0); ::Color::Color(); in_stack_fffffdbc = (Vector *)0x2; (*vfunc)(); if (0x14 < *(int *)((int)this + 0x1ea8)) { bVar1 = Entity::IsFrame((Entity *)this,2,0); joined_r0x00783ce0: if (bVar1 != 0) { vfunc = *(code **)(*(int *)this + 0x3c); ::Color::Color(); in_stack_fffffdbc = (Vector *)0x3; (*vfunc)(); } } } if (0x1e < *(int *)((int)this + 0x1ea8)) { *(int *)((int)this + 0x13bc) = 0; *(int *)((int)this + 0x1ea8) = *(int *)((int)this + 0x1ea8) + -0x1e; bVar1 = Entity::HasEntityFlags((Entity *)this,0x40); if (bVar1 == 0) { uVar28 = Random(); in_stack_fffffdbc = &g_vectorZero; tmpEntity = Game::Spawn(g_game,1000,0x13,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)0x0,0,uVar28); FUN_004316b0(); FUN_004b7070(); sprite = (Sprite *)Entity::GetSprite(tmpEntity); Sprite::SetFrame_1(sprite,3); (**(code **)(*(int *)tmpEntity + 0xc))(); } else { (**(code **)(*(int *)this + 0x20))(); in_stack_fffffdbc = (Vector *)0x24f; play_sound_with_fart_seed(0x24f,1.0,2,0,1.0); } } } if (0 < *(int *)((int)this + 0x31c)) { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if ((cVar2 != '\0') && (*(short *)((int)((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color._tint + 6) == 0)) { vfunc = *(code **)(*(int *)this + 0x3c); ::Color::Color(); in_stack_fffffdbc = (Vector *)0x3; (*vfunc)(); } } Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (((cVar2 == '\0') && (bVar1 = Entity::HasEntityFlags((Entity *)this,0x40), bVar1 != 0)) && (*(int *)((int)this + 0x1ea8) < 1)) { Entity::ClearEntityFlags((Entity *)this,0x40); } } Entity::Update((Entity *)this); bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { ANM2::Update((ANM2 *)((int)this + 0x41c)); bVar1 = Sprite::IsEventTriggered((Sprite *)((int)this + 0x48),&DAT_00b64ba4); if (bVar1 != 0) { uVar28 = Random(); in_stack_fffffdbc = &g_vectorZero; spawnedEffect = (Entity_Effect *) Game::Spawn(g_game,1000,0xc,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)0x0,10, uVar28); Entity_Effect::FollowParent(spawnedEffect,(Entity *)player); set_field_358(spawnedEffect,-10.0); vecResult = (Vector *)Sprite::Scale((Sprite *)((int)this + 0x48)); Entity::SetSpriteScale((Entity *)spawnedEffect,vecResult); vecResult = (Vector *)Entity::SpriteScale((Entity *)spawnedEffect); vecResult2 = Vector::Vector(&local_16c,0.0,-20.0); vecResult = Vector::Mul(vecResult,&scratchVec,vecResult2); GetFlyingOffset(player,&local_17c); Vector::__add(vecResult,&local_174,other); FUN_004563c0(); Entity::AddEntityFlags((Entity *)spawnedEffect,0x100000000000); (**(code **)(*(int *)spawnedEffect + 0xc))(); Entity_Effect::set_rotation(spawnedEffect,0.0); this = player; } } bVar1 = InputManager::is_device_connected(&PTR_vftable_00c57b18,*(int *)((int)this + 0x1618)); if (bVar1 == 0) { FUN_00428b50(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { KAGE_LogMessage(1,(byte *)"Controller %d has disconnected.\n"); if ((*(int *)((int)this + 0x2c) == 0) || (*(EntityPtr *)((int)this + 0x3bc) != (EntityPtr)0x0) ) { this_00 = (PauseScreen *)func_0x00753cf0(); PauseScreen::Show(this_00); ExceptionList = local_10; return; } playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); PlayerManager::RemoveCoPlayer(playerManager,this,0); uVar28 = Random(); vecResult = Entity::Position((Entity *)player,&local_16c); vecResult2 = Vector::Vector(&scratchVec,0.0,-10.0); vecResult = Vector::__add(vecResult,&local_17c,vecResult2); Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar28); ExceptionList = local_10; return; } } if ((*(byte *)((int)this + 0x1398) != 0) && (bVar1 = ANM2::IsFinishedImpl((ANM2 *)((int)this + 0x48),&s_empty), bVar1 != 0)) { *(byte *)((int)this + 0x1398) = 0; } Game::GetField26614(g_game); cVar2 = FUN_00429550(); if ((cVar2 != '\0') && (bVar1 = ANM2::IsFinishedImpl((ANM2 *)((int)this + 0x48),(byte *)"LightTravel"), bVar1 != 0)) { FUN_0044bf90(); } if ((*(byte *)((int)this + 0x1399) != 0) && (*(byte *)((int)this + 0x1398) == 0)) { *(byte *)((int)this + 0x1399) = 0; bVar1 = HasCollectible(this,0x23f,0); if ((bVar1 != 0) && (bVar1 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)this + 0x1508),0x37), bVar1 == 0)) { local_150.y = 1.4013e-45; local_120 = (EntityPtr)(int)(5.0 - *(float *)((int)this + 0x156c)); puVar11 = (uint *)std::max(); uVar28 = *puVar11; if (*(int *)((int)this + 0x1344) < 2) { uVar28 = 1; } rng = (RNG *)FUN_005cbd00(); uVar28 = RNG::RandomInt(rng,uVar28); if (uVar28 == 0) { play_sound_with_fart_seed(0xb5,1.0,0x14,0,1.0); play_sound_with_fart_seed(0x1e,1.0,2,0,1.0); fVar30 = 1.0; vecResult = &g_vectorZero; ::Color::Color((Color *)(local_f0 + 0x2c)); spawn_gibs((Vector *)((int)this + 0x33c),0xe,40.0,(uint *)&DAT_00b6bc94,(Entity *)this,color ,vecResult,fVar30); iVar4 = Isaac::Random(3); iVar4 = iVar4 + 1; if (0 < iVar4) { do { ThrowBlueSpider(this,(Vector *)((int)this + 0x33c),&g_vectorZero); iVar4 = iVar4 + -1; } while (iVar4 != 0); } in_stack_fffffdbc = (Vector *)0x784279; TemporaryEffects::AddNullEffect((TemporaryEffects *)((int)this + 0x1508),0x37,1,1); EvaluateItems(); } } } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar1 = HasCollectible(this,0x281,0); if (((bVar1 != 0) && (iVar4 = Room::GetAliveEnemiesCount(room), 0 < iVar4)) && (iVar4 = Entity::GetIntervalTicks((Entity *)this,3.0,0.0), iVar4 != 0)) { local_130 = (EntityPtr)Room::GetEntities(); local_144.y = 0.0; uVar28 = 0; iVar4 = EntityList::Size(); if (iVar4 == 0) { EVar8 = (EntityPtr)0x0; LAB_0078438c: iVar4 = Isaac::Random(2); if (iVar4 != 0) goto LAB_0078439a; } else { do { puVar10 = (undefined4 *)std::vector::operator_index(); local_120 = (EntityPtr)Entity::ToTear((Entity *)*puVar10); if (local_120 != (EntityPtr)0x0) { pBVar31 = (BitSet128 *)&DAT_00c34810; pBVar12 = Entity_Tear::TearFlags((Entity_Tear *)local_120,(BitSet128 *)local_24); pBVar12 = BitSet128::operator_and(&local_1a0,pBVar12,pBVar31); bVar1 = BitSet128::IsNonZero(pBVar12); if ((bVar1 != 0) && (EVar8 = (EntityPtr)Entity::Parent((Entity *)local_120), EVar8 == (EntityPtr)this)) { local_144.y = (float)((int)local_144.y + 1); } } uVar28 = uVar28 + 1; uVar7 = EntityList::Size(); } while (uVar28 < uVar7); EVar8 = (EntityPtr)local_144.y; if ((uint)local_144.y < 0xc) goto LAB_0078438c; LAB_0078439a: if ((&DAT_00000013 < (uint)EVar8) || (iVar4 = Isaac::Random(5), iVar4 != 0)) goto LAB_007845eb; } if (*(int *)((int)this + 0x1624) == -1) { vecResult = Vector::Vector(&local_17c,0.0,1.0); } else { vecResult = Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,*(int *)((int)this + 0x1624)) ; } local_16c.x = vecResult->x; local_16c.y = vecResult->y; uVar28 = Random(); this = player; local_120 = (EntityPtr)0x40400000; vecResult = Vector::__mul(&local_16c,&scratchVec,(float *)&local_120); vecResult = Vector::__add(&this->_velocity,&local_17c,vecResult); EVar8 = (EntityPtr)Game::Spawn(g_game,2,1,&this->_pos,vecResult,(Entity *)this,0,uVar28); local_130 = EVar8; FUN_00753720(); fVar30 = this->_poisonTickDamage - 3.5; if (fVar30 < 0.0) { fVar30 = fVar30 * -10.0; FUN_00431260(); fVar30 = -fVar30 / 10.0; } else { fVar30 = fVar30 + fVar30; FUN_00431260(); fVar30 = fVar30 * 0.5; } local_164.y = fVar30 + 3.5; local_150.y = 1.0; std::max(); (**(code **)(*(int *)EVar8 + 0x40))(); pBVar12 = BitSet128::operator_or ((BitSet128 *)local_24,(BitSet128 *)&DAT_00c34810,&g_tearFlagSpectral); Entity_Tear::SetTearFlags((Entity_Tear *)EVar8,*pBVar12); Entity::SetParent((Entity *)EVar8,(Entity *)this); fVar30 = random_float(); Entity_Tear::SetScale((Entity_Tear *)EVar8,fVar30 * 0.2 + 0.9); Entity_Projectile::SetHeight((Entity_Projectile *)EVar8,-6.0); FUN_00444c70(); Entity_Projectile::set_falling_accel((Entity_Projectile *)EVar8,-0.03); vfunc = *(code **)(*(int *)EVar8 + 0x3c); random_float(); ::Color::Color(); in_stack_fffffdbc = (Vector *)0xff; (*vfunc)(); (**(code **)(*(int *)local_130 + 0xc))(); } } LAB_007845eb: if (((*(byte *)((int)this + 0x139a) != 0) && (bVar1 = ANM2::IsFinishedImpl((ANM2 *)((int)this + 0x41c),&s_empty), bVar1 != 0)) && (bVar1 = ANM2::IsFinishedImpl((ANM2 *)((int)this + 0x41c),(byte *)"LiftItem"), bVar1 == 0)) { *(byte *)((int)this + 0x139a) = 0; ANM2::Reset((ANM2 *)((int)this + 0x41c)); ANM2::Reset((ANM2 *)((int)this + 0xff8)); } update_pitfall(this); bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { update_suplex(this); } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { if (*(byte *)((int)this + 0x13b6) == 0) { if (*(int *)((int)this + 0x13b8) != 0) { FUN_00424510(); local_8 = 3; local_128 = (RNG *)FUN_005cbd00(); FUN_00424510(); local_8 = CONCAT31(local_8._1_3_,4); local_129 = 0; iVar4 = 0; local_122 = 0; iVar5 = GetTrinketMultiplier(this,0xac); if (iVar5 == 2) { iVar4 = 0x19; } else if (iVar5 == 3) { iVar4 = 0x32; } iVar5 = *(int *)((int)this + 0x13b8); if (iVar5 == 1) { uVar28 = RNG::RandomInt(local_128,100); local_120 = (EntityPtr)0x1; if (iVar4 + 0x32U <= uVar28) { local_122 = 1; FUN_007dc620(); local_120 = (EntityPtr)0x2; FUN_007dc620(); local_120 = (EntityPtr)0x4; FUN_007dc620(); local_120 = (EntityPtr)0x5; FUN_007dc620(); local_120 = (EntityPtr)0x6; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0x9; FUN_007dc620(); local_120 = (EntityPtr)0xb; FUN_007dc620(); local_120 = (EntityPtr)0xc; FUN_007dc620(); local_120 = (EntityPtr)0xd; FUN_007dc620(); local_120 = (EntityPtr)0x14; FUN_007dc620(); local_120 = (EntityPtr)0x15; FUN_007dc620(); local_120 = (EntityPtr)0x16; FUN_007dc620(); local_120 = (EntityPtr)0x18; FUN_007dc620(); local_120 = (EntityPtr)0x12; } FUN_007dc620(); local_129 = 1; } else if (iVar5 == 2) { local_129 = 1; local_122 = 1; uVar28 = RNG::RandomInt(local_128,100); if (uVar28 < iVar4 + 0x32U) { local_120 = (EntityPtr)0x2; FUN_007dc620(); local_120 = (EntityPtr)0x4; FUN_007dc620(); local_120 = (EntityPtr)0x9; FUN_007dc620(); local_120 = (EntityPtr)0xb; FUN_007dc620(); local_120 = (EntityPtr)0xc; FUN_007dc620(); local_120 = (EntityPtr)0x18; } else { local_120 = (EntityPtr)0x1; FUN_007dc620(); local_120 = (EntityPtr)0x5; FUN_007dc620(); local_120 = (EntityPtr)0x6; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0xd; FUN_007dc620(); local_120 = (EntityPtr)0x14; FUN_007dc620(); local_120 = (EntityPtr)0x15; FUN_007dc620(); local_120 = (EntityPtr)0x16; LAB_00784aac: FUN_007dc620(); local_120 = (EntityPtr)0x12; } LAB_007852a3: FUN_007dc620(); } else { if (iVar5 == 3) { local_129 = 1; local_122 = 1; uVar28 = RNG::RandomInt(local_128,100); if (uVar28 < iVar4 + 0x19U) { uVar28 = RNG::RandomInt(local_128,100); if (uVar28 < 0x32) { pLVar13 = (Level *)Config::GetCollectibles(); Level::InitializeDevilAngelRoom(pLVar13,1,0); local_120 = (EntityPtr)0xffffffff; std::vector::push_back(); } else { pLVar13 = (Level *)Config::GetCollectibles(); Level::InitializeDevilAngelRoom(pLVar13,0,1); local_120 = (EntityPtr)0xffffffff; std::vector::push_back(); } goto LAB_007852b2; } local_120 = (EntityPtr)0x1; FUN_007dc620(); local_120 = (EntityPtr)0x2; FUN_007dc620(); local_120 = (EntityPtr)0x4; FUN_007dc620(); local_120 = (EntityPtr)0x5; FUN_007dc620(); local_120 = (EntityPtr)0x6; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0x9; FUN_007dc620(); local_120 = (EntityPtr)0xa; FUN_007dc620(); local_120 = (EntityPtr)0xb; FUN_007dc620(); local_120 = (EntityPtr)0xc; FUN_007dc620(); local_120 = (EntityPtr)0xd; FUN_007dc620(); local_120 = (EntityPtr)0x14; FUN_007dc620(); local_120 = (EntityPtr)0x15; FUN_007dc620(); local_120 = (EntityPtr)0x18; FUN_007dc620(); local_120 = (EntityPtr)0x12; FUN_007dc620(); local_120 = (EntityPtr)0xfffffffe; std::vector::push_back(); } else { if (iVar5 == 5) { local_129 = 1; local_122 = 1; uVar28 = RNG::RandomInt(local_128,100); if (uVar28 < iVar4 + 0x32U) { local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; goto LAB_007852a3; } local_120 = (EntityPtr)0x1; FUN_007dc620(); local_120 = (EntityPtr)0x2; FUN_007dc620(); local_120 = (EntityPtr)0x4; FUN_007dc620(); local_120 = (EntityPtr)0x5; FUN_007dc620(); local_120 = (EntityPtr)0x6; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0x9; FUN_007dc620(); local_120 = (EntityPtr)0xb; FUN_007dc620(); local_120 = (EntityPtr)0xc; FUN_007dc620(); local_120 = (EntityPtr)0xd; FUN_007dc620(); local_120 = (EntityPtr)0x14; FUN_007dc620(); local_120 = (EntityPtr)0x15; FUN_007dc620(); local_120 = (EntityPtr)0x18; LAB_00785224: FUN_007dc620(); local_120 = (EntityPtr)0x12; } else { if (iVar5 != 4) { if (iVar5 == 7) { local_129 = 1; local_122 = 1; uVar28 = RNG::RandomInt(local_128,100); if (iVar4 + 10U <= uVar28) { local_120 = (EntityPtr)0x1; FUN_007dc620(); local_120 = (EntityPtr)0x2; FUN_007dc620(); local_120 = (EntityPtr)0x4; FUN_007dc620(); local_120 = (EntityPtr)0x5; FUN_007dc620(); local_120 = (EntityPtr)0x6; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0x9; FUN_007dc620(); local_120 = (EntityPtr)0xb; FUN_007dc620(); local_120 = (EntityPtr)0xc; FUN_007dc620(); local_120 = (EntityPtr)0xd; FUN_007dc620(); local_120 = (EntityPtr)0x18; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0x14; FUN_007dc620(); local_120 = (EntityPtr)0x15; goto LAB_00785224; } local_120 = (EntityPtr)0xfffffffe; std::vector::push_back(); } else if (iVar5 == 6) { local_129 = 1; local_122 = 1; uVar28 = RNG::RandomInt(local_128,100); local_120 = (EntityPtr)0xa; if (0x31 < uVar28) { local_120 = (EntityPtr)0x5; } goto LAB_007852a3; } goto LAB_007852b2; } local_129 = 1; local_122 = 1; uVar28 = RNG::RandomInt(local_128,100); if (uVar28 < iVar4 + 0x32U) { local_120 = (EntityPtr)0x14; FUN_007dc620(); local_120 = (EntityPtr)0x15; goto LAB_00784aac; } local_120 = (EntityPtr)0x1; FUN_007dc620(); local_120 = (EntityPtr)0x2; FUN_007dc620(); local_120 = (EntityPtr)0x4; FUN_007dc620(); local_120 = (EntityPtr)0x5; FUN_007dc620(); local_120 = (EntityPtr)0x6; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; FUN_007dc620(); local_120 = (EntityPtr)0x9; FUN_007dc620(); local_120 = (EntityPtr)0xb; FUN_007dc620(); local_120 = (EntityPtr)0xc; FUN_007dc620(); local_120 = (EntityPtr)0xd; FUN_007dc620(); local_120 = (EntityPtr)0x18; FUN_007dc620(); local_120 = (EntityPtr)0x7; FUN_007dc620(); local_120 = (EntityPtr)0x8; } FUN_007dc620(); } local_120 = (EntityPtr)0xfffffffa; std::vector::push_back(); } LAB_007852b2: FUN_005cbe20(); local_8 = CONCAT31(local_8._1_3_,5); local_158.y = 0.0; pLVar13 = (Level *)Config::GetCollectibles(); iVar4 = Level::GetRoomCount(pLVar13); if (0 < iVar4) { iVar4 = 0; do { room = (Room *)Config::GetCollectibles(); iVar5 = Room::GetTopLeftPos(room); EVar8 = (EntityPtr)(iVar4 + iVar5); local_130 = EVar8; if (*(int *)(iVar4 + 0x10 + iVar5) != 0) { Config::GetCollectibles(); pvVar15 = (void *)FUN_004f8930(); if (*(void **)((int)EVar8 + 0xc) == pvVar15) { uVar28 = 0; iVar5 = std::vector::size(local_24 + 4); if (iVar5 != 0) { do { piVar14 = (int *)FUN_0042c810(); if (*(int *)((int)*(void **)((int)local_130 + 0x10) + 8) == *piVar14) { local_144.y = *(float *)local_130; std::set::find(); std::iterator_copy(&local_17c,&local_120); cVar2 = FUN_00557bb0(); if (cVar2 != '\0') { std::set::insert(); EVar8 = local_130; cVar2 = RoomDescriptor::Clear((RoomDescriptor *)local_130); if (((cVar2 != '\0') && (local_122 != 0)) || ((cVar2 = RoomDescriptor::Clear((RoomDescriptor *)EVar8), cVar2 == '\0' && (local_129 != 0)))) { bVar1 = local_122; if (*(int *)((int)EVar8 + 0x40) == 0) { bVar1 = local_129; } if (bVar1 != 0) { std::vector::push_back(); } } } break; } uVar28 = uVar28 + 1; uVar7 = std::vector::size(local_24 + 4); } while (uVar28 < uVar7); } } } iVar4 = iVar4 + 0xb8; puVar18 = (undefined1 *)((int)local_158.y + 1); local_158.y = (float)puVar18; pLVar13 = (Level *)Config::GetCollectibles(); iVar5 = Level::GetRoomCount(pLVar13); } while ((int)puVar18 < iVar5); this = player; } iVar4 = 0; iVar5 = std::vector::size((void *)((int)&local_1a0._l + 4)); if (iVar5 != 0) { uVar28 = std::vector::size((void *)((int)&local_1a0._l + 4)); RNG::RandomInt(local_128,uVar28); piVar14 = (int *)FUN_0042c810(); iVar4 = *piVar14; } if ((*(int *)((int)this + 0x13b8) == 6) && (piVar14 = (int *)FUN_0042c810(), *piVar14 == 10)) { if (iVar4 == 0) { Config::GetCollectibles(); iVar4 = Level::QueryRoomTypeIndex(); goto LAB_007854cf; } LAB_007854d3: Config::GetCollectibles(); FUN_00428ae0(); in_stack_fffffdbc = (Vector *)0xffffffff; Game::StartRoomTransition(g_game,iVar4,-1,3,this,-1); } else { LAB_007854cf: if (iVar4 != 0) goto LAB_007854d3; iVar4 = GetTrinketMultiplier(this,4); if ((float)iVar4 <= 1.0) { in_stack_fffffdbc = (Vector *)&DAT_0000002c; } else { in_stack_fffffdbc = (Vector *)0x1a3; } UseActiveItem(this,(short *)((int)&local_128 + 2),(int)in_stack_fffffdbc,1,-1,0); } FUN_00424420(); FID_conflict__Tidy(local_24 + 4); local_8 = 0xffffffff; FID_conflict__Tidy((void *)((int)&local_1a0._l + 4)); } } else { iVar4 = GetTrinketMultiplier(this,4); if ((float)iVar4 <= 1.0) { in_stack_fffffdbc = (Vector *)&DAT_0000002c; UseActiveItem(this,(short *)((int)&local_128 + 2),0x2c,1,-1,0); } else { in_stack_fffffdbc = (Vector *)0x1a3; UseActiveItem(this,(short *)((int)&local_128 + 2),0x1a3,1,-1,0); } } *(byte *)((int)this + 0x13b6) = 0; *(int *)((int)this + 0x13b8) = 0; } } } activeDesc = (ActiveItemDesc *)((int)this + 0x15a0); local_120 = (EntityPtr)activeDesc; if (((((ActiveItemDesc *)((int)this + 0x15a0))->_item != 0) && (bVar1 = HasCollectible(this,0x216,0), bVar1 == 0)) && (cVar2 = IsCoopGhost(this), cVar2 == '\0')) { FUN_005b19d0(); rng = (RNG *)FUN_005cbd00(); uVar7 = RNG::Next(rng); uVar28 = *(uint *)local_120; room = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(room,&local_16c,&player->_pos,40.0,0,0,0); this = player; Game::Spawn(g_game,5,100,vecResult,&g_vectorZero,(Entity *)player,uVar28,uVar7); __RTDynamicCast(); FUN_005b1990(); FUN_005b1920(); in_stack_fffffdbc = (Vector *)this->_activeDesc[1]._item; activeDesc = this->_activeDesc + 1; RemoveCollectible(this,(uint)in_stack_fffffdbc,0,1,1); FUN_005b19d0(); } bVar1 = HasCollectible(this,0x3b,0); if ((bVar1 != 0) && (cVar2 = FUN_007da770(), cVar2 == '\0')) { local_120 = (EntityPtr)((int)this + 0x16c8); puVar10 = (undefined4 *)FUN_0042c810(); *puVar10 = 0; local_130 = (EntityPtr)0x1; do { if (activeDesc->_item == 0x3b) { activeDesc->_item = 0x22; piVar14 = (int *)FUN_0042c810(); *piVar14 = *piVar14 + 1; } this = player; local_130 = (EntityPtr) ((int)&((Entity_Player *)((int)local_130 + -0x26cc))->_replacedPlayer + 3); activeDesc = activeDesc + -1; } while (-1 < (int)local_130); UpdateBookOfVirtues(player,0); } Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (((cVar2 != '\0') && (*(int *)((int)this + 0x2c) == 0)) && ((bVar1 = HasCollectible(this,0x1f1,0), bVar1 != 0 && (bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),0x1f1), bVar1 == 0)))) { uVar27 = get_time_ms(); elapsedMs = uVar27 - (longlong)*(int *)((int)this + 0x1f90); local_16c.y = (float)((ulonglong)elapsedMs >> 0x20); if ((local_16c.y != 0.0) || (15000 < (uint)elapsedMs)) { in_stack_fffffdbc = (Vector *)0x78577d; TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x1f1,1,1); uVar28 = 0; pvVar15 = (void *)Game::GetPlayerManager(g_game); iVar4 = std::vector::size(pvVar15); if (iVar4 != 0) { do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); local_130 = (EntityPtr)PlayerManager::GetPlayer(playerManager,uVar28); if ((local_130 != (EntityPtr)this) && (EVar8 = (EntityPtr)EntityPtr::Ref(), local_130 != EVar8)) { EntityRef::constructor((EntityRef *)local_68,(Entity *)this); in_stack_fffffdbc = (Vector *)0x7857e1; Entity::AddConfusion((Entity *)local_130,(EntityRef *)local_68,0x5a,0); } uVar28 = uVar28 + 1; pvVar15 = (void *)Game::GetPlayerManager(g_game); uVar7 = std::vector::size(pvVar15); } while (uVar28 < uVar7); } } } bVar1 = Game::IsInTimedSet(g_game,0x34); if (bVar1 != 0) { Entity::AddEntityFlags((Entity *)this,0x8000000); } bVar1 = Entity::HasEntityFlags((Entity *)this,0x8000000); if (bVar1 == 0) { iVar4 = *(int *)((int)this + 0x165c) + -1; if (iVar4 < 0) { iVar4 = 0; } *(int *)((int)this + 0x165c) = iVar4; } else { *(int *)((int)this + 0x165c) = 0x3c; } *(int *)((int)this + 0x1378) = 0; if (*(byte *)((int)this + 0x173) == 0) { if (((*(int *)((int)this + 0x2c) == 1) && (*(byte *)((int)this + 0x1b18) != 0)) && (bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) { pcVar21 = "Appear"; Config::GetPillEffects(); pbVar16 = (byte *)_string_holder_c_str(); do { bVar1 = *pbVar16; bVar22 = bVar1 < (byte)*pcVar21; if (bVar1 != *pcVar21) { LAB_007858c0: uVar28 = -(uint)bVar22 | 1; goto LAB_007858c5; } if (bVar1 == 0) break; bVar1 = pbVar16[1]; bVar22 = bVar1 < (byte)pcVar21[1]; if (bVar1 != pcVar21[1]) goto LAB_007858c0; pbVar16 = pbVar16 + 2; pcVar21 = pcVar21 + 2; } while (bVar1 != 0); uVar28 = 0; LAB_007858c5: if (uVar28 == 0) { PlayExtraAnimation(this,(byte *)"Glitch"); } else { pcVar21 = "Glitch"; Config::GetPillEffects(); pbVar16 = (byte *)_string_holder_c_str(); do { bVar1 = *pbVar16; bVar22 = bVar1 < (byte)*pcVar21; if (bVar1 != *pcVar21) { LAB_00785910: uVar28 = -(uint)bVar22 | 1; goto LAB_00785915; } if (bVar1 == 0) break; bVar1 = pbVar16[1]; bVar22 = bVar1 < (byte)pcVar21[1]; if (bVar1 != pcVar21[1]) goto LAB_00785910; pbVar16 = pbVar16 + 2; pcVar21 = pcVar21 + 2; } while (bVar1 != 0); uVar28 = 0; LAB_00785915: if (uVar28 == 0) { InitBabySkin(this); } } } if (*(void **)((int)this + 0x1410) != (Entity *)0x0) { Entity::SetPosition(*(void **)((int)this + 0x1410),(Vector *)((int)this + 0x33c)); Entity::SetVelocity(*(void **)((int)this + 0x1410),(Vector *)((int)this + 0x360)); bVar1 = Entity::is_player(*(void **)((int)this + 0x1410)); if (bVar1 != 0) { pvVar15 = *(void **)((int)this + 0x1410); layerFrame = ANM2::GetLayerFrame((ANM2 *)((int)this + 0x41c),0); if ((layerFrame != (void *)0x0) || ((1 < *(int *)((int)this + 0x1f2c) && (layerFrame = ANM2::GetLayerFrame((ANM2 *)((int)this + 0x48),0), layerFrame != (void *)0x0)))) { FUN_0067f2e0(); *(float *)((int)pvVar15 + 0x350) = local_16c.y * *(float *)((int)this + 0x14f4); } } } tempEffects = (TemporaryEffects *)((int)this + 0x1508); bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x1f1); if (bVar1 != 0) { in_stack_fffffdbc = (Vector *)0x7859db; cVar2 = FUN_00a20920(); if (cVar2 == '\0') { in_stack_fffffdbc = (Vector *)0x7859f3; cVar2 = FUN_00a20920(); if (cVar2 != '\0') goto LAB_00785a2e; in_stack_fffffdbc = (Vector *)0x785a0b; cVar2 = FUN_00a20920(); if (cVar2 != '\0') goto LAB_00785a2e; in_stack_fffffdbc = (Vector *)0x785a23; cVar2 = FUN_00a20920(); local_121 = '\0'; if (cVar2 != '\0') goto LAB_00785a2e; } else { LAB_00785a2e: local_121 = '\x01'; } FUN_00417900(); cVar2 = FUN_007538d0(); if (cVar2 == '\0') { joined_r0x00785a7e: if (local_121 == '\0') goto LAB_00785b62; } else { EntityPtr::clear((EntityPtr *)&local_16c); bVar1 = GetMouseAimTarget(this,&local_16c,0); if (bVar1 == 0) goto joined_r0x00785a7e; } TemporaryEffects::RemoveCollectibleEffect(tempEffects,0x1f1,1); room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar4 = Room::GetFrameCount(room); if (6 < iVar4) { TemporaryEffects::RemoveNullEffect(tempEffects,0x30,-1); TemporaryEffects::AddNullEffect(tempEffects,0x30,0,0x1e); play_sound_with_fart_seed(0x50,1.0,2,0,1.0); Game::ShakeScreen(g_game,10); ::Color::Color((Color *)(local_f0 + 0x2c)); Entity::MakeGroundPoofAtSelf((Entity *)this,color_00,0.8); in_stack_fffffdbc = (Vector *)g_tearFlagsNone._l; Game::DamageRadius((Vector *)((int)this + 0x33c),(Entity *)this,0,0,0,50.0,g_tearFlagsNone, 15.0,80.0); *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | tempEffects->_cacheFlags; EvaluateItems(); FUN_00753790(); } } LAB_00785b62: Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 == '\0') { LAB_00785bc0: update_body_animations(this); update_bomb_input(this); ControlActiveItem(this,0); pocket_use_input(this); update_shooting(); pockets_rotate(); } else { iVar4 = *(int *)((int)this + 0x218); Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x1de); if (((bVar1 == 0) || (*(short *)((int)((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color. _tint + 6) != 0)) && (iVar4 == 0)) goto LAB_00785bc0; Vector::operator_assign((Vector *)((int)this + 0x360),&g_vectorZero); } EVar8 = (EntityPtr)Entity::ToPlayer((Entity *)*(EntityPtr *)((int)this + 0x3bc)); local_158.y = (float)EVar8; bVar1 = IsHologram(this); if (bVar1 != 0) { EVar8 = (EntityPtr)EntityPtr::Ref(); local_158.y = (float)EVar8; } if (EVar8 != (EntityPtr)0x0) { FUN_00428b50(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { EntityPtr::clear((EntityPtr *)&local_17c); EVar8 = (EntityPtr)0x0; local_144.y = 0.0; iVar4 = Game::GetNumPlayers(g_game); if (iVar4 != 0) { do { local_120 = (EntityPtr)Game::GetPlayer(g_game,(uint)EVar8); if (local_120 != (EntityPtr)this) { if (local_120 != (EntityPtr)local_158.y) { EVar17 = (EntityPtr)Entity::Parent((Entity *)local_120); if (EVar17 != (EntityPtr)local_158.y) goto LAB_00785d5e; } vecResult = Entity::Position((Entity *)local_120,&local_16c); Vector::__sub((Vector *)((int)this + 0x33c),&scratchVec,vecResult); local_130 = (EntityPtr)Vector::LengthSquared(&scratchVec); bVar1 = Vector::operator_ne(&scratchVec,&g_vectorZero); if ((bVar1 != 0) && ((float)local_130 < 144.0)) { local_150.y = 0.5; vecResult = Vector::operator_mul(&local_174,&local_150.y,&scratchVec); vecResult = Vector::__div(vecResult,&local_13c,(float *)&local_130); Vector::operator_add_assign(&local_17c,vecResult); } EVar8 = (EntityPtr)local_144.y; } LAB_00785d5e: EVar8 = (EntityPtr)((int)EVar8 + 1); local_144.y = (float)EVar8; puVar18 = (undefined1 *)Game::GetNumPlayers(g_game); } while ((uint)EVar8 < puVar18); } local_120 = (EntityPtr)Vector::Length(&local_17c); if (2.0 < (float)local_120) { Vector::Resize(&local_17c,2.0); } Entity::AddVelocity((Entity *)this,&local_17c,0); } } } if ((*(int *)((int)this + 0x2c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) { bVar1 = HasCollectible(this,0x18d,0); if ((bVar1 == 0) || ((*(void **)((int)this + 0x13e0) == (int *)0x0 || (cVar2 = (**(code **)(*(int *)*(void **)((int)this + 0x13e0) + 0x34))(), cVar2 == '\0')))) { if (*(int **)((int)this + 0x1430) != (int *)0x0) { (**(code **)(**(int **)((int)this + 0x1430) + 0x28))(); } } else { local_174.x = ((Vector *)((int)this + 0x1630))->x; local_174.y = *(float *)((int)this + 0x1634); iVar4 = FUN_007826c0(); if ((iVar4 == 0) && ((bVar1 = Vector::operator_eq(&local_174,&g_vectorZero), bVar1 != 0 || (bVar1 = HasCollectible(this,0x1d1,0), bVar1 == 0)))) { vecResult = Isaac::GetAxisAlignedUnitVectorFromDir (&local_16c,*(int *)((int)this + 0x1628)); Vector::operator_assign(&local_174,vecResult); } else { Vector::Normalize(&local_174); } this_01 = (Entity_NPC *)__RTDynamicCast(); if (*(int *)((int)this + 0x1430) == 0) { uVar28 = Random(); Game::Spawn(g_game,7,7,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,0,uVar28 ); this_01 = (Entity_NPC *)__RTDynamicCast(); Entity::SetParent((Entity *)this_01,(Entity *)this); (**(code **)(*(int *)this_01 + 0xc))(); EntityPtr::SetReference((EntityPtr *)((int)this + 0x1430),(Entity *)this_01); } local_120 = (EntityPtr)0x41400000; vecResult = Vector::__mul(&local_174,&local_16c,(float *)&local_120); in_stack_fffffdbc = (Vector *)0x785f36; GetLaserOffset(this,&scratchVec,6,vecResult); Entity::SetPositionOffset((Entity *)this_01,offset); local_120 = (EntityPtr)Vector::GetAngleDegrees(&local_174); fVar30 = normalize_angle_degrees((float)local_120); Entity_NPC::SetAimAngle(this_01,fVar30); if (local_174.y <= -0.5) { fVar30 = -10.0; } else { fVar30 = 3000.0; } set_field_358(this_01,fVar30); bVar1 = IsExtraAnimationFinished(this); if (bVar1 != 0) { IsHoldingItem(this); } FUN_0044bf90(); local_120 = (EntityPtr)&DAT_00000005; piVar14 = (int *)std::max(); *(int *)((int)this + 0x1338) = *piVar14; } local_144.y = (float)((uint)local_144.y & 0xffffff00); bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if ((cVar2 != '\0') && (sVar3 = *(short *)((int)((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]. _color._tint + 6), sVar3 != 0)) { sVar3 = sVar3 + -1; *(short *)((int)((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color._tint + 6) = sVar3; local_144.y = (float)((uint)local_144.y & 0xff); if (sVar3 == 0) { local_144.y = 1.4013e-45; } } } Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x1de); if (((bVar1 != 0) && ((*(int *)((int)this + 0x162c) != -1 || ((*(byte *)((int)this + 0x1378) & 4) != 0)))) || (local_144.y._0_1_ != '\0')) { Level::GetCurrentRoom((Level *)g_game); tempEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::RemoveCollectibleEffect(tempEffects,0x1de,1); Level::GetCurrentRoom((Level *)g_game); FUN_00821940(); *(undefined2 *) ((int)((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color._tint + 6) = 0; } } if (*(int *)((int)this + 0x1624) != -1) { *(int *)((int)this + 0x1378) = *(int *)((int)this + 0x1378) | 2; } if (*(int *)((int)this + 0x162c) != -1) { *(int *)((int)this + 0x1378) = *(int *)((int)this + 0x1378) | 4; } bVar1 = HasCollectible(this,0xd2,0); if ((bVar1 == 0) || (*(int *)((int)this + 0x1378) != 0)) { if (*(float *)((int)this + 0x37c) == 1000.0) { itemConfig = Isaac::GetItemConfig(); itemCfg = Config::GetNullItem(itemConfig,4); RemoveCostume(this,itemCfg); *(float *)((int)this + 0x37c) = *(float *)((int)*(void **)((int)this + 0x330) + 0x44); } *(int *)((int)this + 0x1374) = 0; } else { iVar4 = *(int *)((int)this + 0x1374); *(int *)((int)this + 0x1374) = iVar4 + 1; if (0x3c < iVar4) { if (*(float *)((int)this + 0x37c) != 1000.0) { SoundEffects::PlayWithFartOverride(0x35a,1.0,2,0,1.0); itemConfig = Isaac::GetItemConfig(); bVar1 = 0; itemCfg = Config::GetNullItem(itemConfig,4); AddCostume(this,itemCfg,bVar1); *(float *)((int)this + 0x37c) = 1000.0; uVar28 = Random(); in_stack_fffffdbc = (Vector *)0x0; Game::Spawn(g_game,1000,0xf,(Vector *)((int)this + 0x33c),&g_vectorZero,(Entity *)this,2, uVar28); tmpEntity = (Entity *)__RTDynamicCast(); this = player; vecResult = Vector::Vector(&local_16c,0.0,-10.0); vecResult = Vector::__add(&this->_posOffset,&scratchVec,vecResult); Entity::SetPositionOffset(tmpEntity,vecResult); set_field_358(tmpEntity,(this->_posOffset).y + 1.0); (**(code **)(*(int *)tmpEntity + 0xc))(); } if ((*(int *)((int)this + 0x2c) == 1) || (*(byte *)((int)this + 0x20a9) != 0)) { ::Color::Color((Color *)local_98); ::Color::SetColorize((Color *)local_98,1.0,1.0,1.0,1.0); in_stack_fffffdbc = (Vector *)0x2; (**(code **)(*(int *)this + 0x3c))(); } } } if (*(float *)((int)this + 0x37c) != 1000.0) { *(float *)((int)this + 0x37c) = *(float *)((int)*(void **)((int)this + 0x330) + 0x44); } pLVar13 = (Level *)((int)this + 0x1508); bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pLVar13,0x251); if (((bVar1 == 0) && (*(int *)((int)this + 0x1888) < 1)) && (bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pLVar13,0x2ca), bVar1 == 0)) { Entity::ClearEntityFlags((Entity *)this,0x40000000); } else { Entity::AddEntityFlags((Entity *)this,0x40000000); } cVar2 = Level::GetHeartPicked(pLVar13); if (cVar2 != '\0') { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | pLVar13->_stage; EvaluateItems(); } FUN_00753790(); bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { TemporaryEffects::Update((TemporaryEffects *)pLVar13); update_effects(this); } if (*(void **)((int)this + 0x1ee4) != (void *)0x0) { projectile = (Entity_Projectile *)FUN_00435df0(); if (projectile != (Entity_Projectile *)0x0) { fVar23 = (float10)Entity_Projectile::Damage(projectile); Vector::FromAngle(&local_13c,(float)fVar23); local_120 = (EntityPtr)0xc1600000; Vector::operator_mul(&local_16c,(float *)&local_120,&local_13c); FUN_00753750(); in_stack_fffffdbc = (Vector *)0x7863f7; GetLaserOffset(this,&local_174,-1,&local_13c); local_120 = (EntityPtr)0x41500000; vecResult = Vector::operator_mul(&scratchVec,(float *)&local_120,&local_13c); Vector::operator_add_assign(&local_174,vecResult); local_174.y = local_174.y - *(float *)((int)this + 0x14fc) * 4.0; Entity::SetPositionOffset((Entity *)projectile,&local_174); if (local_13c.y <= -0.5) { fVar30 = -40.0; } else { fVar30 = 3000.0; } set_field_358(projectile,fVar30); bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { local_164.y = (float)Random(); fVar30 = random_float(); vecResult = Vector::Rotated(&local_13c,&local_16c,fVar30 * 90.0 - 45.0); fVar30 = random_float(); local_120 = (EntityPtr)(fVar30 * 10.0 + 6.0); in_stack_fffffdbc = Vector::__mul(vecResult,&scratchVec,(float *)&local_120); local_130 = (EntityPtr)&player->_pos; vecResult = Vector::__add((Vector *)local_130,&local_17c,&local_174); local_150.y = 14.0; vecResult2 = Vector::operator_mul(&local_144,&local_150.y,&local_13c); vecResult = Vector::__sub(vecResult,&local_158,vecResult2); tmpEntity = Game::Spawn(g_game,1000,99,vecResult,in_stack_fffffdbc,(Entity *)0x0,1, (uint)local_164.y); vecResult = (Vector *)Entity::SpriteScale(tmpEntity); fVar30 = random_float(); local_164.y = fVar30 * 1.5 + 1.0; vecResult = Vector::__mul(vecResult,&local_190,&local_164.y); Entity::SetSpriteScale(tmpEntity,vecResult); sprite = (Sprite *)Entity::GetSprite(tmpEntity); tmpColor = (ColorMod *)::Color::Color(); Sprite::SetColor(sprite,tmpColor); set_field_358(tmpEntity,20.0); (**(code **)(*(int *)tmpEntity + 0xc))(); iVar4 = Isaac::Random(5); if (iVar4 == 0) { local_164.y = (float)Random(); fVar30 = random_float(); vecResult = Vector::Rotated(&local_13c,&local_16c,fVar30 * 90.0 - 45.0); fVar30 = random_float(); local_120 = (EntityPtr)(fVar30 * 3.0 + 2.0); in_stack_fffffdbc = Vector::__mul(vecResult,&scratchVec,(float *)&local_120); vecResult = Vector::__add((Vector *)local_130,&local_17c,&local_174); local_150.y = 14.0; vecResult2 = Vector::operator_mul(&local_144,&local_150.y,&local_13c); vecResult = Vector::__sub(vecResult,&local_158,vecResult2); tmpEntity = Game::Spawn(g_game,1000,0x3a,vecResult,in_stack_fffffdbc,(Entity *)0x0,0, (uint)local_164.y); (**(code **)(*(int *)tmpEntity + 0xc))(); } iVar4 = Isaac::Random(5); if (iVar4 == 0) { local_164.y = (float)Random(); fVar30 = random_float(); vecResult = Vector::Rotated(&local_13c,&local_16c,fVar30 * 30.0 - 15.0); fVar30 = random_float(); local_120 = (EntityPtr)(fVar30 * 5.0 + 6.0); in_stack_fffffdbc = Vector::__mul(vecResult,&scratchVec,(float *)&local_120); vecResult = Vector::Vector(&local_17c,local_174.x,0.0); vecResult = Vector::__add((Vector *)local_130,&local_144,vecResult); local_150.y = 14.0; vecResult2 = Vector::operator_mul(&local_158,&local_150.y,&local_13c); vecResult = Vector::__sub(vecResult,&local_190,vecResult2); projectile = (Entity_Projectile *) Game::Spawn(g_game,9,5,vecResult,in_stack_fffffdbc,(Entity *)player,0, (uint)local_164.y); Game::GetField26614(g_game); FUN_00429550(); Entity_Projectile::set_projectile_flags(projectile); (**(code **)(*(int *)projectile + 0xc))(); } this = player; } } } } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { ANM2::Update((ANM2 *)((int)this + 0xff8)); ANM2::Update((ANM2 *)((int)this + 0x530)); ANM2::Update((ANM2 *)((int)this + 0x644)); pAVar19 = (ANM2 *)((int)this + 0x758); iVar4 = 7; do { ANM2::Update(pAVar19); this = player; pAVar19 = pAVar19 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); ANM2::Update(&player->_bloodGushSprite); } local_120 = (EntityPtr)((int)this + 0x48); vecResult = (Vector *)Sprite::Scale((Sprite *)local_120); Sprite::SetScale((Sprite *)((int)this + 0x530),vecResult); vecResult = (Vector *)Sprite::Scale((Sprite *)((int)this + 0x48)); Sprite::SetScale((Sprite *)((int)this + 0x644),vecResult); vecResult = (Vector *)Sprite::Scale((Sprite *)((int)this + 0x48)); Sprite::SetScale((Sprite *)((int)this + 0xee4),vecResult); EVar8 = (EntityPtr)0x42700000; local_150.y = 60.0; if ((*(int *)((int)this + 0x2c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) { Sprite::SetScale((Sprite *)((int)this + 0x48),(Vector *)((int)this + 0x14f0)); cVar2 = Sprite::IsLoaded((Sprite *)((int)this + 0x41c)); if ((cVar2 != '\0') && ((bVar1 = ANM2::IsPlaying((ANM2 *)((int)this + 0x41c),&s_empty), bVar1 != 0 && (pvVar15 = Sprite::GetNullFrame((Sprite *)((int)this + 0x41c),(byte *)"ItemWalk"), pvVar15 != (void *)0x0)))) { vecResult = (Vector *)Sprite::Scale((Sprite *)((int)this + 0x48)); vecResult = Vector::Mul(vecResult,&local_13c,(Vector *)((int)pvVar15 + 0x10)); Sprite::SetScale((Sprite *)((int)this + 0x48),vecResult); } local_16c.x = g_vectorOne.x; local_16c.y = g_vectorOne.y; if ((-1 < ((PlayerCostumeMap *)((int)this + 0x126c))->_index) && ((iVar4 = FUN_005cbd10(), *(int *)(iVar4 + 0x114) == 0 || ((iVar4 = FUN_005cbd10(), *(int *)(*(int *)(iVar4 + 0x114) + 4) != 0x256 && (iVar4 = FUN_005cbd10(), *(int *)(*(int *)(iVar4 + 0x114) + 4) != 0x2b0)))))) { FUN_005cbd10(); Config::GetPillEffects(); cVar2 = FUN_004073a0(); if (cVar2 == '\0') { animState = (AnimationState *)Config::GetPillEffects(); pvVar15 = AnimationState::GetLayerFrame(animState,*(int *)((int)this + 0x1270)); if (pvVar15 != (void *)0x0) { EVar8 = *(EntityPtr *)((int)pvVar15 + 0x1c); FUN_0041d510(); fVar30 = *(float *)((int)pvVar15 + 0x18); local_164.y = (float)EVar8; FUN_0041d510(); vecResult = Vector::Vector(&local_13c,fVar30,local_164.y); Vector::operator_assign(&local_16c,vecResult); } } } local_148 = (std_string *)g_vectorOne.x; local_188 = g_vectorOne.x; local_128 = (RNG *)g_vectorOne.y; local_190.y = g_vectorOne.y; local_158.y = 0.0; bVar1 = HasCollectible(this,0x1ed,0); if (((bVar1 != 0) || (bVar1 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),0x1ed), bVar1 != 0)) && (bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) { uVar28 = ((*(int *)((int)this + 0x1d88) * 2 - *(int *)((int)this + 0x1344)) + *(int *)((int)this + 0x1340)) / 2; Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { uVar28 = uVar28 >> 2; } local_164.y = (float)(int)uVar28 / 24.0; local_190.y = 1.0 - (1.0 - local_164.y) * (1.0 - local_164.y); fVar30 = local_164.y * 9.0 * local_164.y + 1.0; local_144.y = ((fVar30 + fVar30) * 3.1415927) / 30.0; iVar4 = Game::GetFrameCount(g_game); local_130 = (EntityPtr)(local_190.y * 0.5); auVar25 = ZEXT416((uint)((float)iVar4 * local_144.y)); FUN_00417150(); fVar30 = (auVar25._0_4_ * 0.5 + 0.5) * 1.2; pow_wrapper(); local_158.y = (fVar30 - 0.2) * (float)local_130 + 1.0; iVar4 = Game::GetFrameCount(g_game); auVar25 = ZEXT416((uint)((float)(iVar4 + -3) * local_144.y)); FUN_00417150(); fVar30 = (auVar25._0_4_ * 0.5 + 0.5) * 1.2; pow_wrapper(); fVar30 = (fVar30 - 0.2) * local_164.y * local_164.y; local_148 = (std_string *)((1.0 / local_158.y - 1.0) * 0.5 + 1.0 + fVar30); local_128 = (RNG *)(fVar30 * 0.5 + local_158.y); iVar4 = Game::GetFrameCount(g_game); auVar25 = ZEXT416((uint)((float)(iVar4 + 10) * local_144.y)); FUN_00417150(); fVar30 = (auVar25._0_4_ * 0.5 + 0.5) * 1.2; pow_wrapper(); local_158.y = (fVar30 - 0.2) * (float)local_130; iVar4 = Game::GetFrameCount(g_game); auVar25 = ZEXT416((uint)((float)(iVar4 + 0x14) * local_144.y)); FUN_00417150(); fVar30 = (auVar25._0_4_ * 0.5 + 0.5) * 1.2; pow_wrapper(); local_190.y = (fVar30 - 0.2) * local_190.y * 0.1 + 1.0; local_188 = 1.0 / local_190.y; } scratchVec.x = g_vectorOne.x; local_174.x = g_vectorZero.x; scratchVec.y = g_vectorOne.y; local_174.y = g_vectorZero.y; if (-1 < ((PlayerCostumeMap *)((int)this + 0x123c))->_index) { sprite = (Sprite *)FUN_005cbd10(); vecResult = Sprite::GetNullFrame(sprite,(byte *)"HeadTransform"); if ((vecResult != (Vector *)0x0) && (*(char *)&vecResult[1].y != '\0')) { Vector::operator_assign(&local_174,vecResult); Vector::operator_assign(&scratchVec,vecResult + 2); if (*(int *)((int)this + 0x13c0) == 0x20) { iVar5 = 0; iVar4 = FUN_0042d040(); if (iVar4 != 0) { FUN_0042d040(); iVar5 = FUN_0067efb0(); } local_174.y = local_174.y - ((float)iVar5 + (float)iVar5); } } } Entity::AddFlagsLow((Entity *)((int)this + 0x48)); ::Color::Color((Color *)local_f0); ::Color::Color((Color *)local_98); bVar1 = HasCollectible(this,0xca,0); if ((bVar1 != 0) && (((bVar1 = HasCollectible(this,0xd2,0), bVar1 != 0 && (*(float *)((int)this + 0x37c) == 1000.0)) || (bVar1 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)this + 0x1508),0x3b), bVar1 != 0)))) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c811c8) && (_Init_thread_header(), DAT_00c811c8 == -1)) { local_8 = 6; in_stack_fffffdbc = (Vector *)0x3f800000; ::Color::Color(); local_8 = 0xffffffff; _Init_thread_footer(); } ::Color::__mul((Color *)local_f0,(ColorMod *)&DAT_00c811cc); ::Color::__mul((Color *)local_98,(ColorMod *)&DAT_00c811cc); } iVar4 = *(int *)((int)this + 0x1900); if (iVar4 < 1) { local_164.y = *(float *)((int)this + 0x20a4); if (0.0 < local_164.y) { if (1.0 <= local_164.y) { iVar4 = Game::GetFrameCount(g_game); sinf_wrapper((float)iVar4 * 0.2); } this_04 = &local_11c; goto LAB_00786ffb; } } else { local_164.y = (float)iVar4 / (float)*(int *)((int)this + 0x1904); if (*(int *)((int)this + 0x1904) <= iVar4) { iVar4 = Game::GetFrameCount(g_game); sinf_wrapper((float)iVar4 * 0.2); } this_04 = (Color *)(local_f0 + 0x2c); LAB_00786ffb: ::Color::Color(this_04); ::Color::__mul((Color *)local_f0,other_00); } if ((0 < *(int *)((int)this + 0x1ae8)) || (iVar4 = TemporaryEffects::GetCollectibleEffectNum ((TemporaryEffects *)((int)this + 0x1508),699), iVar4 == 4)) { iVar4 = Game::GetFrameCount(g_game); sinf_wrapper((float)iVar4 * 0.2); ::Color::Color((Color *)(local_98 + 0x2c)); ::Color::__mul((Color *)local_f0,other_01); } if (0 < *(int *)((int)this + 0x1ef8)) { bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { *(int *)((int)this + 0x1ef8) = *(int *)((int)this + 0x1ef8) + -1; } local_130 = (EntityPtr)&DAT_00000006; local_164.y = (float)(8 - *(int *)((int)this + 0x1ef8)); std::min(); local_144.y = 0.0; piVar14 = (int *)std::max(); fVar30 = *(float *)(&DAT_00b6bc98 + *piVar14 * 4); local_188 = (2.0 - fVar30) * local_188; local_148 = (std_string *)((2.0 - fVar30) * (float)local_148); local_128 = (RNG *)(fVar30 * (float)local_128); local_190.y = fVar30 * local_190.y; local_158.y = (fVar30 - 1.0) * 4.0 + local_158.y; } if (0.0 < *(float *)((int)this + 0x1efc)) { local_164.y = *(float *)((int)this + 0x1efc) - *(float *)((int)this + 0x39c); local_130 = (EntityPtr)0x0; pfVar9 = (float *)std::max(); fVar30 = *pfVar9; *(float *)((int)this + 0x1efc) = fVar30; fVar30 = sinf_wrapper(((fVar30 + fVar30) * 3.1415927) / 10.0); fVar24 = *(float *)((int)this + 0x1efc) + 1.0; local_164.y = 1.0 - (*(float *)((int)this + 0x1efc) / 20.0) * fVar30 * 0.4; fVar30 = sinf_wrapper(((fVar24 + fVar24) * 3.1415927) / 10.0); fVar30 = 1.0 - ((*(float *)((int)this + 0x1efc) + 1.0) / 20.0) * fVar30 * 0.4; local_128 = (RNG *)(local_164.y * (float)local_128); local_148 = (std_string *)((2.0 - local_164.y) * (float)local_148); local_188 = (2.0 - fVar30) * local_188; local_190.y = fVar30 * local_190.y; local_158.y = (fVar30 - 1.0) * 3.0 + local_158.y; } bVar1 = HasCollectible(this,0x251,0); if (((bVar1 != 0) && (*(int *)((int)this + 0x1e90) < 1)) && (iVar4 = Entity::FrameCount((Entity *)this), iVar4 % 0x1e < 2)) { in_stack_fffffdbc = (Vector *)0x3f800000; tmpColor = (ColorMod *)::Color::Color(); ::Color::__mul((Color *)local_f0,tmpColor); } pvVar15 = TemporaryEffects::GetNullEffect((TemporaryEffects *)((int)this + 0x1508),0x3f); if ((pvVar15 != (void *)0x0) && (uVar28 = *(uint *)((int)pvVar15 + 8), (int)uVar28 < 0x5a)) { fVar30 = (float)(uVar28 & 0x8000000f); if ((int)fVar30 < 0) { fVar30 = (float)(((int)fVar30 - 1U | 0xfffffff0) + 1); } local_164.y = (float)(uVar28 & 0x80000007); if ((int)local_164.y < 0) { local_164.y = (float)(((int)local_164.y - 1U | 0xfffffff8) + 1); } if (0x17 < (int)uVar28) { local_164.y = fVar30; } if ((int)local_164.y < 5) { tmpColor = (ColorMod *)::Color::Color(); ::Color::Color(&local_11c); in_stack_fffffdbc = (Vector *)(local_98 + 0x2c); ::Color::Lerp((ColorMod *)in_stack_fffffdbc,from,tmpColor,(float)(int)local_164.y * 0.25); ::Color::__mul((Color *)local_f0,(ColorMod *)(local_98 + 0x2c)); ::Color::__mul((Color *)local_98,(ColorMod *)(local_98 + 0x2c)); } } local_130 = (EntityPtr)0x0; if (1 < *(int *)((int)this + 0x1ed0)) { local_68._12_4_ = (void *)0x0; local_68._16_4_ = (void *)0xbf000000; puStack_54 = &DAT_bf800000; fStack_50 = 0.5; local_4c = 2.0; local_48 = 0x3f800000; local_44 = (void *)0x0; local_164.y = 8.40779e-45; piVar14 = (int *)std::min(); local_130 = *(EntityPtr *)(local_68 + *piVar14 * 4 + 0xc); } EVar8 = local_130; bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x2c0); if (bVar1 != 0) { fVar30 = sinf_wrapper(*(float *)((int)this + 0x3a4) * 1.5707964); local_174.x = fVar30 + local_174.x; fVar30 = sinf_wrapper(*(float *)((int)this + 0x3a4) * 1.2566371); EVar8 = (EntityPtr)((1.0 - (fVar30 * 0.5 + 0.5)) * 0.4); in_stack_fffffdbc = (Vector *)0x0; ::Color::Color(); ::Color::__mul((Color *)local_f0,(ColorMod *)(local_98 + 0x2c)); ::Color::__mul((Color *)local_98,(ColorMod *)(local_98 + 0x2c)); } iVar4 = Game::Challenge(g_game); if (iVar4 == 0x2a) { if (*(int *)((int)this + 0x13c0) == 0x23) { itemConfig = Isaac::GetItemConfig(); local_13c.y = (float)Config::GetNullItem(itemConfig,0x6a); costumeMap = (PlayerCostumeMap *)((int)this + 0x122c); local_164.y = 0.0; do { if (((-1 < costumeMap->_index) && (costumeMap->_isBodyLayer == 0)) && (local_144.y = (float)FUN_005cbd10(), *(EntityPtr *)(((Sprite *)((int)local_144.y + 0x114))->_filename)._buf == (EntityPtr)local_13c.y)) { FUN_0041e470(); cVar2 = FUN_004073a0(); fVar30 = local_144.y; if (cVar2 == '\0') { if ((*(byte *)((int)this + 0x1398) == 0) && (*(byte *)((int)this + 0x139a) == 0)) { cVar2 = FUN_0040aa70(); if (cVar2 != '\0') { ANM2::PlayOverlay((ANM2 *)fVar30,(byte *)"Pulse",1); pBVar12 = (BitSet128 *)local_24; uVar29 = 0x7876a1; pBVar31 = GetBombFlags(this,pBVar12,0); uVar32 = 0; local_24._0_4_ = *(undefined4 *)&pBVar31->_l; local_24._4_4_ = *(undefined4 *)((int)&pBVar31->_l + 4); local_24._8_4_ = SUB84(pBVar31->_h,0); iStack_18 = *(int *)((int)&pBVar31->_h + 4); FUN_00435bc0(); GetBombVariant(); FUN_00435bc0(); tearFlags_01._l._4_4_ = uVar29; tearFlags_01._l._0_4_ = (Entity_Player *)in_stack_fffffdbc; tearFlags_01._h._0_4_ = pBVar12; tearFlags_01._h._4_4_ = uVar32; fVar30 = check_bomb_tearflags(this,tearFlags_01); if (1.5 <= fVar30) { local_150.y = 110.0; } tmpColor = (ColorMod *)Entity::GetColor((Entity *)this); otherPlayer = player; vecResult = MusicManager::RandomVector(&local_13c); vecResult = Vector::__add(&otherPlayer->_pos,&local_164,vecResult); tearFlags._l._4_4_ = local_24._4_4_; tearFlags._l._0_4_ = local_24._0_4_; tearFlags._h._0_4_ = local_24._8_4_; tearFlags._h._4_4_ = iStack_18; Game::BombExplosionEffects (g_game,vecResult,local_150.y,tearFlags,tmpColor,(Entity *)otherPlayer, 1.25,1,4,1); Vector::operator_assign(&otherPlayer->_velocity,&g_vectorZero); vfunc = *(code **)(*(int *)otherPlayer + 0x54); vecResult = MusicManager::RandomVector(&local_150); fVar30 = random_float(); EVar8 = (EntityPtr)(fVar30 * 3.0 + 2.0); local_13c.y = (float)EVar8; Vector::__mul(vecResult,&local_164,&local_13c.y); EntityRef::constructor((EntityRef *)local_68,(Entity *)0x0); (*vfunc)(); this = player; } } else { Sprite::RemoveOverlay((Sprite *)local_144.y); } } else { ANM2::PlayOverlay((ANM2 *)local_144.y,(byte *)"Pulse",0); } FUN_0041e470(); cVar2 = FUN_004073a0(); if (cVar2 == '\0') { animState = (AnimationState *)FUN_0041e470(); vecResult = AnimationState::GetNullFrame(animState,(byte *)"HeadAnim"); if (vecResult != (Vector *)0x0) { FUN_00a10570(); Vector::operator_add_assign(&local_174,vecResult); ::Color::__mul((Color *)local_f0,(ColorMod *)(vecResult + 3)); ::Color::__mul((Color *)local_98,(ColorMod *)(vecResult + 3)); } } break; } local_164.y = (float)((int)local_164.y + 1); costumeMap = costumeMap + 1; } while ((uint)local_164.y < 0xf); goto LAB_0078784d; } } else { LAB_0078784d: if (*(int *)((int)this + 0x13c0) == 0x23) { EVar8 = (EntityPtr)(local_174.y + *(float *)((int)this + 0x1f88)); local_174.y = (float)EVar8; } } bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000); if (((bVar1 != 0) && (*(EntityPtr *)((int)this + 0x28c) == (EntityPtr)this)) && (*(int *)((int)this + 0x138c) < 0x96)) { ::Color::Color(); ::Color::__mul((Color *)local_f0,(ColorMod *)(local_98 + 0x2c)); ::Color::__mul((Color *)local_98,(ColorMod *)(local_98 + 0x2c)); } bVar1 = IsLocalPlayer(this); if (bVar1 == 0) { FUN_00417900(); FUN_00925df0(); local_150.y = (float)EVar8; fVar23 = (float10)::Color::A(); Font::SetLineHeightModifier((Font *)local_f0,(float)(fVar23 * (float10)local_150.y)); fVar23 = (float10)::Color::A(); Font::SetLineHeightModifier((Font *)local_98,(float)(fVar23 * (float10)local_150.y)); } if (*(byte *)((int)this + 0x1398) == 0) { LAB_00787961: local_121 = '\0'; } else { cVar2 = IsCollectibleCostumeVisible(this); local_121 = '\x01'; if (cVar2 != '\0') goto LAB_00787961; } local_164.y = (float)((int)this + 0x48); pbVar16 = (byte *)0x0; local_150.y = (float)((int)this + 0x1238); do { if (*(byte *)local_150.y == 0) { tmpColor = (ColorMod *)local_f0; layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); ::Color::operator_assign((Color *)&layer->_color,tmpColor); vecResult = (Vector *)((int)this + 0x1500); if (local_121 == '\0') { vecResult = Vector::Mul(&local_174,&local_144,(Vector *)((int)this + 0x14f8)); layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); Vector::operator_assign(&layer->_pos,vecResult); vecResult = Vector::Mul(&scratchVec,(Vector *)&local_1a0._h,(Vector *)((int)this + 0x1500) ); vecResult = Vector::Mul(vecResult,(Vector *)(local_24 + 8),&local_16c); layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); Vector::operator_assign(&layer->_size,vecResult); layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); (layer->_size).x = local_188 * (layer->_size).x; layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); (layer->_size).y = local_190.y * (layer->_size).y; local_13c.y = (*(float *)((int)this + 0x1504) - *(float *)((int)this + 0x14fc)) * 2.5 + local_158.y * 8.0; layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); (layer->_pos).y = local_13c.y + (layer->_pos).y; goto LAB_00787b47; } LAB_00787a31: layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); Vector::operator_assign(&layer->_size,vecResult); vecResult = &g_vectorZero; layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); Vector::operator_assign(&layer->_pos,vecResult); } else { tmpColor = (ColorMod *)local_98; layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); ::Color::operator_assign((Color *)&layer->_color,tmpColor); vecResult = (Vector *)((int)this + 0x14f8); layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); Vector::operator_assign(&layer->_size,vecResult); if (local_121 != '\0') { vecResult = &g_vectorOne; goto LAB_00787a31; } layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); (layer->_size).x = (float)local_148 * (layer->_size).x; layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); (layer->_size).y = (float)local_128 * (layer->_size).y; LAB_00787b47: layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),pbVar16); (layer->_pos).x = (float)local_130; EVar8 = local_130; } pbVar16 = pbVar16 + 1; local_150.y = (float)((int)local_150.y + 0x10); } while ((int)pbVar16 < 0xf); FUN_005cbe20(); local_8 = 7; local_158.y = 0.0; do { local_130 = (EntityPtr)((PlayerCostumeMap *)((int)this + 0x122c) + (int)local_158.y); if (-1 < *(int *)local_130) { if (*(char *)((int)local_130 + 0xc) == '\0') { sprite = (Sprite *)FUN_005cbd10(); if ((byte *)0x3 < (uint)local_158.y) { tmpColor = (ColorMod *)Sprite::Color((Sprite *)local_164.y); ::Color::operator_assign(aCStackY_188c + 0x81,tmpColor); goto LAB_00787c20; } tmpColor = (ColorMod *)Sprite::Color((Sprite *)((int)this + 0x48)); Sprite::SetColor(sprite,tmpColor); } else { sprite = (Sprite *)FUN_005cbd10(); tmpColor = (ColorMod *)Sprite::Color((Sprite *)local_120); ::Color::operator_assign(aCStackY_188c + 0x81,tmpColor); LAB_00787c20: tmpColor = (ColorMod *)FUN_004072e0(); Sprite::SetColor(sprite,tmpColor); this = player; } sprite = (Sprite *)FUN_005cbd10(); vecResult = (Vector *)Sprite::Scale((Sprite *)((int)this + 0x48)); Sprite::SetScale(sprite,vecResult); EVar17 = local_130; sprite = (Sprite *)FUN_005cbd10(); local_150.y = (float)Sprite::GetLayer(sprite,*(byte **)((int)EVar17 + 4)); layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),(byte *)local_158.y); Vector::operator_assign((Vector *)((int)local_150.y + 0x34),&layer->_size); layer = Sprite::GetLayer((Sprite *)((int)this + 0x48),(byte *)local_158.y); fVar30 = local_150.y; Vector::operator_assign((Vector *)((int)local_150.y + 0x40),&layer->_pos); EVar17 = local_130; if ((byte *)local_158.y == (byte *)0x0) { *(void **)((int)fVar30 + 0x8c) = (void *)((uint)*(void **)((int)fVar30 + 0x8c) | 1); } std::set::insert(); if (*(char *)((int)EVar17 + 0xc) != '\0') { iVar4 = FUN_005cbd10(); if (*(int *)(iVar4 + 0x114) != 0) { iVar4 = FUN_005cbd10(); if (**(int **)(iVar4 + 0x114) == 0) { iVar4 = FUN_005cbd10(); if (*(int *)(*(int *)(iVar4 + 0x114) + 4) == 0x5a) { local_144.y = 0.0; iVar4 = FUN_0042d040(); if (iVar4 != 0) { FUN_0042d040(); local_144.y = (float)FUN_0067efb0(); } bVar1 = IsHoldingItem(this); if (bVar1 != 0) { local_144.y = 0.0; } sprite = (Sprite *)FUN_005cbd10(); local_13c.y = (float)(int)local_144.y * 96.0; layer = Sprite::GetLayer(sprite,*(byte **)((int)EVar17 + 4)); (layer->_cropOffset).y = local_13c.y; EVar8 = (EntityPtr)local_13c.y; } } } } } local_158.y = (float)((int)local_158.y + 1); } while ((uint)local_158.y < &DAT_0000000f); bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { FUN_0042c770(); std::iterator_copy(&local_17c,&local_150.y); cVar2 = FUN_0042c710(); if (cVar2 != '\0') { local_164.y = (float)((int)this + 0x1220); do { FUN_005cba30(); EVar17 = (EntityPtr)FUN_005cbd10(); local_13c.y = (float)EVar17; Entity::AddFlagsLow((Entity *)EVar17); ANM2::Update((ANM2 *)EVar17); FUN_0041e470(); cVar2 = FUN_004073a0(); if (cVar2 == '\0') { pAVar19 = (ANM2 *)FUN_0041e470(); ANM2::GetAnimation(pAVar19,(std_string *)(local_68 + 0x10)); local_8 = CONCAT31(local_8._1_3_,8); local_15c = (EntityPtr)((uint)local_15c | 1); local_158.y = (float)local_15c; iVar4 = FUN_006da7d0(); local_128 = (RNG *)CONCAT13(1,(undefined3)local_128); if (iVar4 != 0) goto LAB_00787ec4; } else { LAB_00787ec4: local_128 = (RNG *)((uint)local_128 & 0xffffff); } local_8 = 7; if (((uint)local_15c & 1) != 0) { local_15c = (EntityPtr)((uint)local_15c & 0xfffffffe); std::string::_Tidy_deallocate(local_68 + 0x10); } if (local_128._3_1_ != '\0') { FUN_0041e470(); iVar4 = GridEntity::GetType(); fVar30 = local_13c.y; if (iVar4 != 0) { pbVar16 = (byte *)0x0; iVar4 = Sprite::GetLayerCount((Sprite *)local_13c.y); if (iVar4 != 0) { do { animState = (AnimationState *)FUN_0041e470(); EVar17 = (EntityPtr)AnimationState::GetLayerFrame(animState,(int)pbVar16); local_13c.y = (float)EVar17; if (EVar17 != (EntityPtr)0x0) { layer = Sprite::GetLayer((Sprite *)fVar30,pbVar16); Vector::operator_assign(&layer->_cropOffset,(Vector *)EVar17); Sprite::GetLayer((Sprite *)fVar30,pbVar16); FUN_00a10570(); } pbVar16 = pbVar16 + 1; layerCount = (byte *)Sprite::GetLayerCount((Sprite *)fVar30); } while (pbVar16 < layerCount); } } } set_iterator_post_increment(); std::iterator_copy(&local_17c,&local_150.y); cVar2 = FUN_0042c710(); } while (cVar2 != '\0'); this = player; } } local_8 = 0xffffffff; FUN_00424420(); } if (*(byte *)((int)this + 0x173) == 0) { if ((*(int *)((int)this + 0x2c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) { pvVar15 = TemporaryEffects::GetCollectibleEffect ((TemporaryEffects *)((int)this + 0x1508),0x11a); if (pvVar15 != (void *)0x0) { itemConfig = Isaac::GetItemConfig(); itemCfg = ItemConfig::GetCollectible(itemConfig,0x11a); local_164.y = (float)itemCfg->maxCooldown; local_13c.y = 0.0; bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { EVar8 = (EntityPtr)local_13c.y; } else { EVar8 = (EntityPtr)0x3f000000; } EVar8 = (EntityPtr) (1.0 - (((float)*(int *)((int)pvVar15 + 8) - (float)EVar8) - 1.0) / ((float)(int)local_164.y - 2.0)); local_150.y = (float)EVar8; vecResult = Vector::__sub((Vector *)((int)this + 0x334),(Vector *)(local_24 + 8), (Vector *)((int)this + 0x33c)); vecResult = Vector::__mul(vecResult,(Vector *)&local_1a0._h,&local_150.y); vecResult = Vector::__mul(vecResult,&local_16c,&local_150.y); Vector::operator_add_assign((Vector *)((int)this + 0x33c),vecResult); Vector::operator_assign((Vector *)((int)this + 0x360),&g_vectorZero); FUN_00421780(); iVar4 = EntityList::Size(); if ((iVar4 == 0x21) && (*(int *)((int)pvVar15 + 8) == 1)) { uVar28 = Random(); spawnedEffect = (Entity_Effect *) Game::Spawn(g_game,1000,0x3d,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)this,0,uVar28); Entity::SetParent((Entity *)spawnedEffect,(Entity *)this); EVar8 = *(EntityPtr *)((int)this + 0x370); Entity_Effect::SetRadii(spawnedEffect,(float)EVar8,90.0); Entity_Effect::SetTimeout(spawnedEffect,10); } } tempEffects = (TemporaryEffects *)((int)this + 0x1508); bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x146); local_128 = (RNG *)CONCAT13(bVar1,(undefined3)local_128); bVar1 = HasCollectible(this,0x3b,0); if ((bVar1 != 0) && ((bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x11a), bVar1 != 0 || (local_128._3_1_ != '\0')))) { iVar4 = Entity::GetIntervalTicks((Entity *)this,4.0,0.0); if (iVar4 != 0) { vfunc = *(code **)(*(int *)this + 0x3c); ::Color::Color(); (*vfunc)(); } iVar4 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0); if (iVar4 != 0) { Vector::__add((Vector *)((int)this + 0x33c),&local_16c,(Vector *)((int)this + 0x34c)); local_13c.y = (float)ANM2::GetLayer((ANM2 *)((int)this + 0x48),(byte *)"extra"); if ((LayerState *)local_13c.y != (LayerState *)0x0) { animState = (AnimationState *)Config::GetPillEffects(); iVar4 = _ptr_deref_or_minus1(); pvVar15 = AnimationState::GetLayerFrame(animState,iVar4); if (pvVar15 != (void *)0x0) { vecResult = (Vector *)FUN_0067f2e0(); vecResult2 = Vector::Vector((Vector *)&local_1a0._h,0.0,-10.0); vecResult = Vector::__add(vecResult,&scratchVec,vecResult2); vecResult = Vector::Mul(vecResult,&local_17c,(Vector *)((int)this + 0x14f0)); Vector::operator_add_assign(&local_16c,vecResult); } } uVar28 = Random(); local_13c.y = 0.1; vecResult = Vector::__mul(&player->_velocity,(Vector *)(local_24 + 8),&local_13c.y); fVar30 = random_float(); vecResult2 = Vector::Vector((Vector *)&local_1a0._h,0.0,-2.0 - fVar30 * 6.0); vecResult = Vector::__add(vecResult,&scratchVec,vecResult2); this = player; EVar8 = (EntityPtr) Game::Spawn(g_game,1000,0x3b,&local_16c,vecResult,(Entity *)player,0,uVar28); local_164.y = (float)EVar8; BlendMode::SetMode(&puStack_54,2,0); sprite = (Sprite *)Entity::GetSprite((Entity *)EVar8); src = &puStack_54; layer = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,src); local_150.y = (float)::Color::Color(); sprite = (Sprite *)Entity::GetSprite((Entity *)EVar8); tmpColor = (ColorMod *)local_150.y; layer = Sprite::GetLayer(sprite,(byte *)0x0); ::Color::operator_assign((Color *)&layer->_color,tmpColor); fVar30 = random_float(); Entity_Effect::set_rotation((Entity_Effect *)EVar8,fVar30 * 10.0 + 2.0); iVar4 = Isaac::Random(10); Entity_Effect::SetTimeout((Entity_Effect *)EVar8,iVar4 + 10); fVar30 = random_float(); EVar8 = (EntityPtr)(fVar30 * 0.3 + 0.4); local_150.y = (float)EVar8; vecResult = Vector::__mul(&this->_playerSpriteScale,&local_17c,&local_150.y); vecResult = Vector::Mul(vecResult,&local_174,&g_vectorOne); Entity::SetSpriteScale((Entity *)local_164.y,vecResult); FUN_00440e90(); } iVar4 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0); if (iVar4 != 0) { Config::GetCollectibles(); iVar4 = _get_index_plus_one_if_kind_4_5(); local_150.y = (float)iVar4 * 0.2 + 2.0; EVar8 = (EntityPtr)(*(float *)((int)this + 0x370) + 40.0); local_13c.y = (float)EVar8; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius (entityList,(EntityList_EL *)local_24,(Vector *)((int)this + 0x33c),local_13c.y, 10); local_8 = 9; EVar17 = (EntityPtr)0x0; local_130 = (EntityPtr)0x0; iVar4 = EntityList::Size(); if (iVar4 != 0) { do { puVar10 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsVulnerableEnemy((Entity *)*puVar10,(Entity *)0x0); if ((bVar1 == 0) || (pEVar6 = (EntityPtr *)std::vector::operator_index(), *pEVar6 == (EntityPtr)this)) { LAB_0078863e: puVar10 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::IsProjectile((Entity *)*puVar10); if ((bVar1 != 0) && (local_128._3_1_ == '\0')) { puVar10 = (undefined4 *)std::vector::operator_index(); cVar2 = Entity::IsDead((Entity *)*puVar10); if (cVar2 == '\0') { puVar10 = (undefined4 *)std::vector::operator_index(); uVar27 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)*puVar10); if ((uVar27 & 0x80000000) == 0) { std::vector::operator_index(); FUN_00652f80(); } } } } else { puVar10 = (undefined4 *)std::vector::operator_index(); bVar1 = Entity::HasEntityFlags((Entity *)*puVar10,0x20000000); if (bVar1 != 0) goto LAB_0078863e; puVar10 = (undefined4 *)std::vector::operator_index(); vfunc = *(code **)(*(int *)*puVar10 + 0x20); EntityRef::constructor((EntityRef *)local_68,(Entity *)player); EVar8 = (EntityPtr)local_150.y; (*vfunc)(); puVar10 = (undefined4 *)std::vector::operator_index(); this = player; tmpEntity = (Entity *)*puVar10; EntityRef::constructor((EntityRef *)local_68,(Entity *)player); Entity::AddBurn(tmpEntity,(EntityRef *)local_68,0x96,0.0,0); EVar17 = local_130; } EVar17 = (EntityPtr)((int)EVar17 + 1); local_130 = EVar17; pcVar21 = (char *)EntityList::Size(); } while ((uint)EVar17 < pcVar21); } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(local_24); } tempEffects = (TemporaryEffects *)((int)this + 0x1508); } bVar1 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x2c1); if ((bVar1 != 0) && ((((cVar2 = FUN_00a209c0(), cVar2 != '\0' || (cVar2 = FUN_00a209c0(), cVar2 != '\0')) || (cVar2 = FUN_00a209c0(), cVar2 != '\0')) || (cVar2 = FUN_00a209c0(), cVar2 != '\0')))) { TemporaryEffects::RemoveCollectibleEffect(tempEffects,0x2c1,-1); } } update_ladder(this); if (0 < *(int *)((int)this + 0x13bc)) { *(int *)((int)this + 0x13bc) = *(int *)((int)this + 0x13bc) + -1; } if (0 < *(int *)((int)this + 0x414)) { *(int *)((int)this + 0x414) = *(int *)((int)this + 0x414) + -1; } if (0 < *(int *)((int)this + 0x418)) { *(int *)((int)this + 0x418) = *(int *)((int)this + 0x418) + -1; } if (0 < *(int *)((int)this + 0x1884)) { *(int *)((int)this + 0x1884) = *(int *)((int)this + 0x1884) + -1; } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { fVar30 = ((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color._tint[0]; if (fVar30 != 0.0) { ((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color._tint[0] = (float)((int)fVar30 + -1); } sVar3 = *(short *)&((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._rotation; if ((sVar3 < 0) && (sVar3 = sVar3 + 1, *(short *)&((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._rotation = sVar3, sVar3 == 0)) { rng = GetCollectibleRNG(this,0x197); uVar28 = RNG::RandomInt(rng,4); *(uint *)((int)this + 0x192c) = uVar28; TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0x197,1,1); itemConfig = Isaac::GetItemConfig(); bVar1 = 0; itemCfg = Config::GetNullItem(itemConfig,0x11); AddCostume(this,itemCfg,bVar1); update_purity_glow(this); } } if (0 < *(int *)((int)this + 0x1ae8)) { *(int *)((int)this + 0x1ae8) = *(int *)((int)this + 0x1ae8) + -1; } if ((0 < *(int *)((int)this + 0x18c0)) && (iVar4 = *(int *)((int)this + 0x18c0) + -1, *(int *)((int)this + 0x18c0) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 1; EvaluateItems(); } if ((0 < *(int *)((int)this + 0x18c4)) && (iVar4 = *(int *)((int)this + 0x18c4) + -1, *(int *)((int)this + 0x18c4) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 2; EvaluateItems(); } if ((0 < *(int *)((int)this + 0x18c8)) && (iVar4 = *(int *)((int)this + 0x18c8) + -1, *(int *)((int)this + 0x18c8) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 0x10; EvaluateItems(); } if ((0 < *(int *)((int)this + 0x18cc)) && (iVar4 = *(int *)((int)this + 0x18cc) + -1, *(int *)((int)this + 0x18cc) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 0xc; EvaluateItems(); } if ((0 < *(int *)((int)this + 0x18d0)) && (iVar4 = *(int *)((int)this + 0x18d0) + -1, *(int *)((int)this + 0x18d0) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 0x400; EvaluateItems(); } if ((0 < *(int *)((int)this + 0x18d4)) && (iVar4 = *(int *)((int)this + 0x18d4) + -1, *(int *)((int)this + 0x18d4) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 0x800; EvaluateItems(); } if ((0 < *(int *)((int)this + 0x18d8)) && (iVar4 = *(int *)((int)this + 0x18d8) + -1, *(int *)((int)this + 0x18d8) = iVar4, iVar4 == 0) ) { *(int *)((int)this + 0x1574) = *(int *)((int)this + 0x1574) | 0x800; EvaluateItems(); } if (0 < *(int *)((int)this + 0x18dc)) { *(int *)((int)this + 0x18dc) = *(int *)((int)this + 0x18dc) + -1; } if (0 < *(int *)((int)this + 0x18e0)) { *(int *)((int)this + 0x18e0) = *(int *)((int)this + 0x18e0) + -1; } local_122 = 0; bVar1 = IsHoldingItem(this); if (bVar1 == 0) { if (local_12a == 0) { bVar1 = IsExtraAnimationFinished(this); local_129 = 1; if (bVar1 != 0) goto LAB_00788a54; } LAB_00788a4d: local_129 = 0; } else { local_150.y = (float)ANM2::GetLayerFrame((ANM2 *)((int)this + 0x41c),0); if ((EntityPtr)local_150.y != (EntityPtr)0x0) { local_122 = *(byte *)((int)local_150.y + 0xc); pbVar16 = (byte *)0x0; local_13c.y = (float)((int)this + 0xff8); iVar4 = Sprite::GetLayerCount((Sprite *)local_13c.y); fVar30 = local_13c.y; if (iVar4 != 0) { do { vecResult = (Vector *)Sprite::Scale((Sprite *)local_120); vecResult = Vector::Mul((Vector *)local_150.y,(Vector *)(local_24 + 8),vecResult); layer = Sprite::GetLayer((Sprite *)fVar30,pbVar16); Vector::operator_assign(&layer->_pos,vecResult); layer = Sprite::GetLayer((Sprite *)fVar30,pbVar16); pbVar16 = pbVar16 + 1; layer->_visible = local_122; layerCount = (byte *)Sprite::GetLayerCount((Sprite *)fVar30); } while (pbVar16 < layerCount); this = player; } } if ((*(byte *)((int)this + 0x17d8) == 0) || (local_122 != 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar4 = Room::GetFrameCount(room); if (iVar4 != 0) goto LAB_00788a4d; } local_129 = 1; } LAB_00788a54: bVar1 = IsExtraAnimationFinished(this); if (bVar1 == 0) { bVar1 = IsHoldingItem(this); local_128 = (RNG *)((uint)local_128 & 0xffffff); if (bVar1 != 0) goto LAB_00788a71; } else { LAB_00788a71: local_128 = (RNG *)CONCAT13(1,(undefined3)local_128); } local_12a = *(byte *)((int)this + 0x1570); local_121 = '\x01'; cVar2 = IsCollectibleCostumeVisible(this); if (cVar2 != '\0') { local_128 = (RNG *)CONCAT13(1,(undefined3)local_128); local_12a = 0; FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); cVar2 = FUN_0082ee30(); local_121 = '\x01'; if (cVar2 != '\0') goto LAB_00788ade; } else { LAB_00788ade: local_121 = '\0'; } local_122 = 0; *(byte *)((int)this + 0x1398) = 0; } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if ((bVar1 == 0) && (local_128._3_1_ != '\0')) { if (local_129 != 0) { FlushQueueItem(this); } local_148 = (std_string *)0xb1e044; pcVar21 = "PickupWalkDown"; if (local_122 != 0) { local_148 = (std_string *)0xb6b084; } local_158.y = 1.0; GetBodyMoveDirection(this,&local_174); bVar1 = Vector::operator_eq(&local_174,&g_vectorZero); if (bVar1 == 0) { EVar8 = (EntityPtr)local_174.x; FUN_0041d510(); local_13c.y = (float)EVar8; if (local_122 == 0) { EVar8 = (EntityPtr)local_174.y; FUN_0041d510(); if (local_13c.y <= (float)EVar8) { pcVar21 = "WalkDown"; walkAnim = (char *)&DAT_00b1e020; goto LAB_00788e85; } pcVar21 = "WalkRight"; walkAnim = "WalkLeft"; EVar8 = (EntityPtr)local_174.x; } else { EVar8 = (EntityPtr)local_174.y; FUN_0041d510(); if (local_13c.y <= (float)EVar8) { walkAnim = "PickupWalkUp"; LAB_00788e85: EVar8 = (EntityPtr)local_174.y; } else { pcVar21 = "PickupWalkRight"; walkAnim = "PickupWalkLeft"; EVar8 = (EntityPtr)local_174.x; } } local_144.y = (float)pcVar21; if ((float)EVar8 <= 0.0) { local_144.y = (float)walkAnim; } if (((*(int *)((int)this + 0x2c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) && (local_121 != '\0')) { ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)local_144.y,0); } local_148 = (std_string *)((int)this + 0x1238); local_120 = (EntityPtr)&DAT_0000000f; do { if (((-1 < ((PlayerCostumeMap *)((int)local_148 + -0xc))->_index) && (*(byte *)local_148 != 0)) && ((pAVar19 = (ANM2 *)FUN_005cbd10(), *(int *)((int)this + 0x2c) != 1 && (*(byte *)((int)this + 0x20a9) == 0)))) { if (((*(int *)pAVar19[1]._filename._buf != 0) && (cVar2 = Item::IsNull(), cVar2 != '\0') ) && (*(int *)(*(int *)pAVar19[1]._filename._buf + 4) == 0x4c)) { local_158.y = local_158.y + local_158.y; } if ((local_122 == 0) || ((cVar2 = Item::IsNull(), cVar2 != '\0' && (*(int *)(*(int *)pAVar19[1]._filename._buf + 4) == 0x5a)))) { if ((pAVar19[1]._filename._buf[8] == '\0') && (ANM2::Play(pAVar19,(byte *)local_144.y,0), pAVar19[1]._filename._buf[10] != '\0')) { std::string::string_from_cstr(tmpString,(byte *)local_144.y); local_8 = 0x11; FUN_0060c790(); local_8 = CONCAT31(local_8._1_3_,0x12); Sprite::PlayOverlay(); std::string::_Tidy_deallocate(local_68 + 0x10); local_8 = 0xffffffff; std::string::_Tidy_deallocate(tmpString); } } else { Sprite::Stop((Sprite *)pAVar19); } } local_148 = (std_string *)((int)local_148 + 0x10); local_120 = (EntityPtr) ((int)&(((Entity_Effect *)((int)local_120 + -0x4b4))->_hitList)._capacity + 3) ; } while (local_120 != (EntityPtr)0x0); } else { if (((*(int *)((int)this + 0x2c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) && (local_121 != '\0')) { if ((local_12a == 0) || (*(int *)((int)this + 0x13c0) == 0x23)) { ANM2::SetFrame((ANM2 *)((int)this + 0x48),local_148,0); } else { ANM2::Play((ANM2 *)((int)this + 0x48),(byte *)local_148,0); } } local_130 = (EntityPtr)((int)this + 0x1238); local_128 = (RNG *)0xf; do { if (((-1 < ((PlayerCostumeMap *)((int)local_130 + -0xc))->_index) && (*(byte *)local_130 != 0)) && ((pAVar19 = (ANM2 *)FUN_005cbd10(), *(int *)((int)this + 0x2c) != 1 && (*(byte *)((int)this + 0x20a9) == 0)))) { if (((*(int *)pAVar19[1]._filename._buf != 0) && (cVar2 = Item::IsNull(), cVar2 != '\0') ) && (*(int *)(*(int *)pAVar19[1]._filename._buf + 4) == 0x4c)) { local_158.y = local_158.y + local_158.y; } if (pAVar19[1]._filename._buf[8] == '\0') { if ((local_122 == 0) || ((cVar2 = Item::IsNull(), cVar2 != '\0' && (*(int *)(*(int *)pAVar19[1]._filename._buf + 4) == 0x5a)))) { piVar14 = *(int **)pAVar19[1]._filename._buf; if ((*piVar14 == 3) && (piVar14[1] == 0x271)) { ANM2::SetFrame(pAVar19,(std_string *)"WalkIdle",0); } else { if (local_12a == 0) { std::string::string_from_cstr(tmpString,(byte *)local_148); local_8 = 10; FUN_0060c790(); local_8 = CONCAT31(local_8._1_3_,0xc); std::string::_Tidy_deallocate(tmpString); iVar4 = FUN_0040bcb0(); if (iVar4 == 0) { ANM2::SetFrame(pAVar19,local_148,0); } else { Sprite::Play(); } local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_68 + 0x10); } else { ANM2::Play(pAVar19,(byte *)local_148,0); } if (pAVar19[1]._filename._buf[10] != '\0') { std::string::string_from_cstr(tmpString,(byte *)local_148); if (local_12a == 0) { local_8 = 0xf; anim = (std_string *)FUN_0060c790(); local_8 = CONCAT31(local_8._1_3_,0x10); ANM2::SetFrame(pAVar19,anim,0); } else { local_8 = 0xd; FUN_0060c790(); local_8 = CONCAT31(local_8._1_3_,0xe); Sprite::PlayOverlay(); } std::string::_Tidy_deallocate(local_68 + 0x10); local_8 = 0xffffffff; std::string::_Tidy_deallocate(tmpString); } } } else { Sprite::Stop((Sprite *)pAVar19); } } } local_130 = (EntityPtr)((int)local_130 + 0x10); local_128 = (RNG *)((int)local_128 + -1); } while (local_128 != (RNG *)0x0); local_128 = (RNG *)0x0; } EVar8 = (EntityPtr)0x3f800000; local_144.y = 1.0; bVar1 = ANM2::IsPlaying((ANM2 *)((int)this + 0x48),&s_empty); if (bVar1 == 0) { EVar17 = (EntityPtr)local_144.y; } else { local_120 = (EntityPtr)Vector::Length((Vector *)((int)this + 0x360)); if (2.3 <= (float)local_120) { EVar17 = (EntityPtr)local_144.y; } else { EVar17 = (EntityPtr)assert_lerp_range((float)local_120,1.0,2.3,0.5,1.0,1); } EVar8 = local_120; if (6.0 < (float)local_120) { EVar8 = (EntityPtr)assert_lerp_range((float)local_120,6.0,10.0,1.0,2.0,1); EVar17 = EVar8; } if (0 < *(int *)((int)this + 0x165c)) { fVar30 = 1.0; local_13c.y = Vector::Dot((Vector *)((int)this + 0x1654),(Vector *)((int)this + 0x360)); local_13c.y = assert_lerp_range(local_13c.y,-3.0,1.0,3.0,fVar30,1); fVar30 = Vector::Length((Vector *)((int)this + 0x1654)); local_13c.y = fVar30 * local_13c.y; auVar26 = ZEXT812(0x40800000); EVar8 = (EntityPtr)0x3f000000; if (0.5 <= local_13c.y) { EVar8 = (EntityPtr)local_13c.y; } if ((float)EVar8 <= auVar26._0_4_) { auVar26._4_8_ = auVar26._4_8_; auVar26._0_4_ = EVar8; } EVar17 = auVar26._0_4_; } } local_144.y = (float)EVar17 * local_158.y; set_PlaybackSpeed((ANM2 *)((int)this + 0x48),local_144.y); pbVar16 = (byte *)((int)this + 0x1238); local_120 = (EntityPtr)&DAT_0000000f; do { if ((-1 < ((PlayerCostumeMap *)(pbVar16 + -0xc))->_index) && (*pbVar16 != 0)) { pAVar19 = (ANM2 *)FUN_005cbd10(); EVar8 = (EntityPtr)local_144.y; set_PlaybackSpeed(pAVar19,local_144.y); } pbVar16 = pbVar16 + 0x10; local_120 = (EntityPtr) ((int)&(((Entity_Effect *)((int)local_120 + -0x4b4))->_hitList)._capacity + 3); } while (local_120 != (EntityPtr)0x0); } cVar2 = FUN_0040c2d0(); if ((cVar2 == '\0') && (bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) { pbVar16 = std::string::c_str((char *)((int)this + 0x139c)); PlayExtraAnimation(this,pbVar16); FUN_0040c2f0(); } EVar17 = (EntityPtr)((int)this + 0x1508); local_150.y = (float)EVar17; bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)EVar17,0x4d); if ((bVar1 == 0) && (bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)EVar17,0x5d), bVar1 == 0) ) { bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)EVar17,299); if (bVar1 != 0) { pvVar15 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)EVar17,299); if (*(int *)((int)pvVar15 + 8) != 0) goto LAB_00789259; } } else { LAB_00789259: room = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = &player->_pos; vecResult2 = Vector::Normalized(&player->_velocity,(Vector *)(local_24 + 8)); local_13c.y = 40.0; vecResult2 = Vector::__mul(vecResult2,(Vector *)&local_1a0._h,&local_13c.y); vecResult = Vector::__add(vecResult,&local_16c,vecResult2); local_120 = (EntityPtr)Room::GetGridIndex(room,vecResult); if ((int)local_120 < 0) { EVar17 = (EntityPtr)local_150.y; this = player; } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); this = player; EntityRef::constructor((EntityRef *)local_68,(Entity *)player); Room::DamageGridWithSource(room,(int)local_120,1,(EntityRef *)local_68); EVar17 = (EntityPtr)&this->_temporaryeffects; } } if ((*(uint *)((int)this + 0x168) & 0x80) != 0) { fVar30 = *(float *)((int)this + 0x3ac); FUN_00431260(); EVar8 = (EntityPtr)(fVar30 * *(float *)((int)this + 0x36c)); *(EntityPtr *)((int)this + 0x36c) = EVar8; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar4 = Room::GetBossID(room); if ((iVar4 == 0x37) && (EVar8 = (EntityPtr)0x43a00000, *(float *)((int)this + 0x340) <= 320.0 && *(float *)((int)this + 0x340) != 320.0)) { *(float *)((int)this + 0x340) = 320.0; bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)EVar17,0x251); if (bVar1 != 0) { TemporaryEffects::RemoveCollectibleEffect((TemporaryEffects *)EVar17,0x251,-1); *(int *)((int)this + 0x1e94) = -1; dash_impact(this); bVar1 = 0; vecResult = Vector::Vector((Vector *)(local_24 + 8),0.0,-10.0); Entity::AddVelocity((Entity *)this,vecResult,bVar1); } bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)EVar17,0x82); if ((bVar1 != 0) || (bVar1 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)EVar17,0xb5), bVar1 != 0)) { *(int *)((int)this + 0x1888) = 0; TemporaryEffects::RemoveCollectibleEffect((TemporaryEffects *)EVar17,0x82,-1); TemporaryEffects::RemoveCollectibleEffect((TemporaryEffects *)EVar17,0xb5,-1); Game::ShakeScreen(g_game,8); bVar1 = 0; vecResult = Vector::Vector((Vector *)(local_24 + 8),0.0,-10.0); Entity::AddVelocity((Entity *)this,vecResult,bVar1); } } bVar1 = Vector::operator_ne((Vector *)((int)this + 0x1654),&g_vectorZero); if (bVar1 != 0) { local_150.y = 2.0; local_13c.y = Vector::Length((Vector *)((int)this + 0x360)); local_120 = (EntityPtr)0x3f800000; std::max(); pfVar9 = (float *)std::min(); local_164.y = *pfVar9 * 0.5; Vector::operator_mul_assign((Vector *)((int)this + 0x1654),&local_164.y); local_13c.y = Vector::LengthSquared((Vector *)((int)this + 0x1654)); EVar8 = (EntityPtr)0x3c23d70a; if (local_13c.y < 0.01) { Vector::operator_assign((Vector *)((int)this + 0x1654),&g_vectorZero); } } FUN_007b9aa0(); if (*(byte *)((int)this + 0x173) != 0) goto LAB_007894ef; } else { LAB_007894ef: EVar8 = (EntityPtr)GetDeathAnimName(this); local_144.y = (float)EVar8; FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); local_12a = FUN_0082ee30(); if (local_12a != 0) goto LAB_00789743; Config::GetPillEffects(); pbVar16 = (byte *)_string_holder_c_str(); do { bVar1 = *pbVar16; bVar22 = bVar1 < *(byte *)EVar8; if (bVar1 != *(byte *)EVar8) { LAB_00789567: uVar28 = -(uint)bVar22 | 1; goto LAB_0078956c; } if (bVar1 == 0) break; bVar1 = pbVar16[1]; bVar22 = bVar1 < (byte)*(char *)((int)EVar8 + 1); if (bVar1 != *(char *)((int)EVar8 + 1)) goto LAB_00789567; pbVar16 = pbVar16 + 2; EVar8 = (EntityPtr)((int)EVar8 + 2); } while (bVar1 != 0); uVar28 = 0; LAB_0078956c: if (uVar28 != 0) { *(byte *)((int)this + 0x171) = 1; PlayExtraAnimation(this,(byte *)local_144.y); iVar4 = GetTrinketMultiplier(this,0x15); if (iVar4 < 1) { LAB_007895b1: iVar4 = GetTrinketMultiplier(this,0x15); if (1 < iVar4) { uVar28 = Game::GetFrameCount(g_game); uVar28 = uVar28 & 0x80000003; if ((int)uVar28 < 0) { uVar28 = (uVar28 - 1 | 0xfffffffc) + 1; } if (uVar28 == 2) goto LAB_007895db; } } else { uVar28 = Game::GetFrameCount(g_game); uVar28 = uVar28 & 0x80000003; if ((int)uVar28 < 0) { uVar28 = (uVar28 - 1 | 0xfffffffc) + 1; } if (uVar28 != 3) goto LAB_007895b1; LAB_007895db: TemporaryEffects::AddTrinketEffect((TemporaryEffects *)((int)this + 0x1508),0x17,1,1); } ThrowHeldEntity(this,&g_vectorZero); layer = ANM2::GetLayer((ANM2 *)((int)this + 0x48),(byte *)"ghost"); if (layer != (LayerState *)0x0) { layer->_visible = 1; } if ((((*(EntityPtr *)((int)this + 0x3bc) == (EntityPtr)0x0) && (*(int *)((int)this + 0x2c) == 0)) && (*(byte *)((int)this + 0x20a9) == 0)) && (bVar1 = WillPlayerRevive(this), bVar1 == 0)) { pcVar21 = (char *)0x0; local_120 = (EntityPtr)0x0; iVar4 = Game::GetNumPlayers(g_game); if (iVar4 != 0) { do { EVar8 = (EntityPtr)Game::GetPlayer(g_game,(uint)pcVar21); if ((((EVar8 != (EntityPtr)this) && (EVar17 = (EntityPtr)GetOtherTwin(this), EVar8 != EVar17)) && ((iVar4 = Entity::Parent((Entity *)EVar8), iVar4 == 0 && (iVar4 = Entity::Variant((Entity *)EVar8), iVar4 == 0)))) && ((cVar2 = Entity::IsDead((Entity *)EVar8), cVar2 == '\0' || (bVar1 = WillPlayerRevive((Entity_Player *)EVar8), bVar1 != 0)))) goto LAB_007896f1; pcVar21 = (char *)((int)local_120 + 1); local_120 = (EntityPtr)pcVar21; puVar18 = (undefined1 *)Game::GetNumPlayers(g_game); } while (pcVar21 < puVar18); } Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 == '\0') { Game::DeleteSaveState(); persistent_game_data_set_writable(); } } LAB_007896f1: if ((((*(int *)((int)this + 0x2c) == 1) && (iVar4 = GetBabySkin(this), iVar4 == 0x3b)) && (*(EntityPtr *)((int)this + 0x3bc) != (EntityPtr)0x0)) && (bVar1 = Entity::is_player((Entity *)*(EntityPtr *)((int)this + 0x3bc)), bVar1 != 0)) { tempEffects = (TemporaryEffects *) GetEffects((Entity_Player *)*(EntityPtr *)((int)this + 0x3bc)); TemporaryEffects::AddTrinketEffect(tempEffects,0xb4,1,1); } Vector::operator_assign((Vector *)((int)this + 0x360),&g_vectorZero); } } else { LAB_00789743: local_12a = 1; } EVar8 = (EntityPtr)(*(float *)((int)this + 0x36c) * 0.6); *(EntityPtr *)((int)this + 0x36c) = EVar8; if ((*(int *)((int)this + 0x13c0) == 0x13) || (*(int *)((int)this + 0x13c0) == 0x14)) { cVar2 = FUN_006f0040(); local_121 = '\x01'; if (cVar2 == '\0') goto LAB_00789784; } else { LAB_00789784: local_121 = '\0'; } FUN_00417900(); iVar4 = FUN_007538e0(); local_128 = (RNG *)CONCAT13(iVar4 == 0,(undefined3)local_128); cVar2 = FUN_00423960(); if (cVar2 == '\0') { LAB_007897da: cVar2 = local_128._3_1_; } else { pvVar15 = (void *)FUN_00417920(); pvVar15 = InputManager::GetDeviceByPlayerEntity(pvVar15,this); if (pvVar15 == (void *)0x0) goto LAB_007897da; iVar4 = FUN_00753d50(); cVar2 = iVar4 == 0; } if ((local_121 == '\0') || (iVar4 = 10, cVar2 == '\0')) { iVar4 = 9; } if ((((((ActiveItemDesc *)((int)this + 0x1580))->_item == 0x28d) && (bVar1 = ANM2::IsPlaying((ANM2 *)((int)this + 0x48),&s_empty), bVar1 != 0)) && (bVar1 = input_is_action_triggered (g_manager,iVar4,*(int *)((int)this + 0x1618),(Entity *)0x0,0), bVar1 != 0)) && (((local_158.y = (float)ANM2::GetLayer((ANM2 *)((int)this + 0x48),(byte *)"ghost"), (EntityPtr)local_158.y != (EntityPtr)0x0 && (*(int *)local_158.y != 0)) && (*(char *)((int)local_158.y + 0x74) != '\0')))) { EntityPtr::clear((EntityPtr *)&local_16c); animState = (AnimationState *)Config::GetPillEffects(); iVar4 = _ptr_deref_or_minus1(); local_13c.y = (float)AnimationState::GetLayerFrame(animState,iVar4); if (((EntityPtr)local_13c.y != (EntityPtr)0x0) && (*(char *)((int)local_13c.y + 0x2c) != '\0') ) { Config::GetPillEffects(); iVar4 = GridEntity::GetType(); iVar5 = _ptr_deref_or_minus1(); if (-1 < *(int *)(iVar4 + 0x38 + iVar5 * 4)) { Config::GetPillEffects(); GridEntity::GetType(); render_build_sprite_quad (local_228,&g_vectorZero,(void *)local_13c.y,(LayerState *)local_158.y, &g_vectorZero,&g_vectorZero,(ANM2 *)((int)this + 0x48)); vecResult = Vector::__add(local_228,(Vector *)(local_24 + 8),local_210); local_13c.y = 0.5; Vector::__mul(vecResult,(Vector *)&local_1a0._h,&local_13c.y); vecResult = (Vector *)FUN_0067f2e0(); Vector::operator_assign(&local_16c,vecResult); } uVar28 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x90,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)0x0,2,uVar28); Entity::SetPositionOffset(tmpEntity,&local_16c); sprite = (Sprite *)Entity::GetSprite(tmpEntity); fVar30 = random_float(); Sprite::SetRotation(sprite,fVar30 * 360.0); sprite = (Sprite *)Entity::GetSprite(tmpEntity); local_13c.y = 1.5; vecResult = Vector::__mul(&g_vectorOne,(Vector *)(local_24 + 8),&local_13c.y); Sprite::SetScale(sprite,vecResult); (**(code **)(*(int *)tmpEntity + 0x40))(); (**(code **)(*(int *)tmpEntity + 0xc))(); fVar30 = random_float(); this = player; EVar8 = (EntityPtr)(fVar30 * 0.2 + 0.9); play_sound_with_fart_seed(0x1dd,1.25,2,0,(float)EVar8); Game::ShakeScreen(g_game,0xe); *(undefined1 *)((int)local_158.y + 0x74) = 0; } } pAVar19 = (ANM2 *)((int)this + 0x48); local_190.y = (float)pAVar19; if (*(int *)((int)this + 0x13c0) == 0x23) { bVar1 = ANM2::IsPlaying(pAVar19,(byte *)local_144.y); if ((bVar1 != 0) && (iVar4 = ANM2::GetFrame(pAVar19), iVar4 == 0x13)) { FUN_0042a020(); FUN_0069d9d0(); FUN_0069d9d0(); FUN_0069d9d0(); uVar28 = 0; do { Isaac::DestoryWeapon((Weapon **)((int)((int)this + 0x13e0) + uVar28)); uVar28 = uVar28 + 4; } while (uVar28 < 0x10); Isaac::DestoryWeapon((void **)((int)this + 0x13dc)); iVar4 = Game::Challenge(g_game); if (iVar4 == 0x2a) { ::Color::Color((Color *)(local_f0 + 0x2c)); tearFlags_00._l._4_4_ = DAT_00c347d4; tearFlags_00._l._0_4_ = DAT_00c347d0; tearFlags_00._h._0_4_ = DAT_00c347d8; tearFlags_00._h._4_4_ = DAT_00c347dc; EVar8 = DAT_00c347d0; Game::BombExplosionEffects (g_game,(Vector *)((int)this + 0x33c),60.0,tearFlags_00,Color,(Entity *)this,1.0 ,1,4,1); } else { spawn_gibs((Vector *)((int)this + 0x33c),6,40.0,(uint *)&local_158.y,(Entity *)this, (ColorMod *)((int)this + 0x1b8),&g_vectorZero,1.0); play_sound_with_fart_seed(0x1b,1.0,2,0,1.0); } LAB_00789f05: pAVar19 = (ANM2 *)((int)this + 0x48); } } else { bVar1 = ANM2::IsPlaying(pAVar19,(byte *)local_144.y); if ((bVar1 != 0) && (bVar1 = Sprite::IsEventTriggered((Sprite *)pAVar19,"DeathSound"), bVar1 != 0)) { bVar1 = IsHologram(this); if (bVar1 == 0) { EVar8 = (EntityPtr)get_voice_pitch(this); play_sound_with_fart_seed(0xd9,1.0,2,0,(float)EVar8); } if (*(int *)((int)this + 0x13c0) == 0x19) { local_150.y = (float)((int)this + 0x33c); vecResult = Vector::Vector((Vector *)(local_24 + 8),10.0,0.0); vecResult = Vector::__sub((Vector *)((int)this + 0x33c),(Vector *)&local_1a0._h,vecResult) ; Game::ButterBeanFart(g_game,vecResult,120.0,(Entity *)this,1,0); uVar28 = Random(); vecResult = Vector::Vector((Vector *)(local_24 + 8),10.0,0.0); vecResult = Vector::__sub((Vector *)((int)this + 0x33c),(Vector *)&local_1a0._h,vecResult) ; Game::Spawn(g_game,0xf5,0,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar28); local_120 = (EntityPtr)0x6; do { uVar28 = Random(); vecResult = Vector::Vector((Vector *)(local_24 + 8),-1.0,0.0); fVar30 = random_float(); vecResult = Vector::Rotated(vecResult,(Vector *)&local_1a0._h,fVar30 * 40.0 - 20.0); fVar30 = random_float(); local_13c.y = fVar30 * 20.0 + 6.0; vecResult = Vector::__mul(vecResult,&local_16c,&local_13c.y); vecResult2 = Vector::Vector(&scratchVec,4.0,0.0); vecResult2 = Vector::__sub((Vector *)local_150.y,&local_17c,vecResult2); tmpEntity = Game::Spawn(g_game,1000,99,vecResult2,vecResult,(Entity *)0x0,1,uVar28); vecResult = (Vector *)Entity::SpriteScale(tmpEntity); fVar30 = random_float(); EVar8 = (EntityPtr)(fVar30 * 1.5 + 1.0); local_164.y = (float)EVar8; vecResult = Vector::__mul(vecResult,&local_174,&local_164.y); Entity::SetSpriteScale(tmpEntity,vecResult); sprite = (Sprite *)Entity::GetSprite(tmpEntity); tmpColor = (ColorMod *)::Color::Color(); Sprite::SetColor(sprite,tmpColor); (**(code **)(*(int *)tmpEntity + 0xc))(); local_120 = (EntityPtr)((int)local_120 + -1); } while (local_120 != (EntityPtr)0x0); local_130 = (EntityPtr)0x0; local_120 = (EntityPtr)0x0; this = player; if (0 < player->_poopMana) { do { if (0x12 < (int)local_130) break; uVar28 = Random(); vecResult = Vector::Vector((Vector *)(local_24 + 8),-1.0,0.0); fVar30 = random_float(); vecResult = Vector::Rotated(vecResult,(Vector *)&local_1a0._h,fVar30 * 40.0 - 20.0); fVar30 = random_float(); EVar8 = (EntityPtr)(fVar30 * 6.0 + 3.0); local_13c.y = (float)EVar8; vecResult = Vector::__mul(vecResult,&local_16c,&local_13c.y); vecResult2 = Vector::Vector(&scratchVec,4.0,0.0); vecResult2 = Vector::__sub((Vector *)local_150.y,&local_17c,vecResult2); tmpEntity = Game::Spawn(g_game,5,0x2a,vecResult2,vecResult,(Entity *)0x0,0,uVar28); FUN_005b19f0(); (**(code **)(*(int *)tmpEntity + 0xc))(); this = player; AddPoopMana(player,-1); local_130 = (EntityPtr)((int)local_130 + 1); } while ((int)local_130 < this->_poopMana); } goto LAB_00789f05; } } } if ((local_12a == 0) && (((bVar1 = ANM2::IsPlaying(pAVar19,(byte *)local_144.y), bVar1 != 0 && ((iVar4 = ANM2::GetFrame(pAVar19), 7 < iVar4 || (*(int *)((int)this + 0x13c0) == 0x23)))) || (bVar1 = ANM2::IsFinishedImpl(pAVar19,&s_empty), bVar1 != 0)))) { local_158.y = (float)((int)this + 0x1e68); iVar4 = EntityPtr::Ref(); if ((iVar4 != 0) && (iVar4 = EntityPtr::Ref(), *(char *)(iVar4 + 0x173) == '\0')) { iVar4 = EntityPtr::Ref(); otherPlayer = (Entity_Player *)EntityPtr::Ref(); pbVar16 = GetDeathAnimName(otherPlayer); bVar1 = ANM2::IsPlaying((ANM2 *)(iVar4 + 0x48),pbVar16); if (bVar1 == 0) { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); bVar1 = PlayerManager::IsCoopPlay(playerManager); if (bVar1 == 0) { uVar29 = *(undefined4 *)((int)this + 0x16a8); uVar32 = *(undefined4 *)((int)this + 0x16ac); iVar4 = EntityPtr::Ref(); *(undefined4 *)(iVar4 + 0x16a8) = uVar29; *(undefined4 *)(iVar4 + 0x16ac) = uVar32; other_02 = &player->_lastDamageSource; iVar4 = EntityPtr::Ref(); EntityRef::operator_((EntityRef *)(iVar4 + 0x167c),other_02); piVar14 = (int *)EntityPtr::Ref(); vfunc = *(code **)(*piVar14 + 0x24); EntityRef::EntityRef((EntityRef *)local_68); (*vfunc)(); iVar4 = EntityPtr::Ref(); *(undefined1 *)(iVar4 + 0x171) = 1; otherPlayer = (Entity_Player *)EntityPtr::Ref(); this_02 = (Entity_Player *)EntityPtr::Ref(); pbVar16 = GetDeathAnimName(this_02); PlayExtraAnimation(otherPlayer,pbVar16); } else { otherPlayer = (Entity_Player *)EntityPtr::Ref(); cVar2 = IsCoopGhost(otherPlayer); if (cVar2 == '\0') { piVar14 = (int *)EntityPtr::Ref(); vfunc = *(code **)(*piVar14 + 0x24); EntityRef::EntityRef((EntityRef *)local_68); (*vfunc)(); } } } } } bVar1 = ANM2::IsFinishedImpl((ANM2 *)local_190.y,(byte *)local_144.y); this = player; if (bVar1 != 0) { player->_visible = 0; } } if ((*(uint *)((int)this + 0x168) & 0x4000) == 0) { bVar1 = HasCollectible(this,0x177,0); if (bVar1 == 0) { LAB_0078a11e: local_128 = (RNG *)((uint)local_128 & 0xffffff); } else { std::string::string_from_cstr(local_68 + 0x10,&s_empty); local_8 = 0x13; local_15c = (EntityPtr)((uint)local_15c | 2); local_158.y = (float)local_15c; cVar2 = IsCollectibleAnimFinished(this); local_128 = (RNG *)CONCAT13(1,(undefined3)local_128); if (cVar2 == '\0') goto LAB_0078a11e; } local_8 = 0xffffffff; if (((uint)local_15c & 2) != 0) { local_15c = (EntityPtr)((uint)local_15c & 0xfffffffd); std::string::_Tidy_deallocate(local_68 + 0x10); } if (local_128._3_1_ != '\0') { ClearCollectibleAnim(this); } bVar1 = HasCollectible(this,399,0); if (bVar1 == 0) { LAB_0078a1b2: local_128 = (RNG *)((uint)local_128 & 0xffffff); } else { std::string::string_from_cstr(local_68 + 0x10,&s_empty); local_8 = 0x14; local_15c = (EntityPtr)((uint)local_15c | 4); local_158.y = (float)local_15c; cVar2 = IsCollectibleAnimFinished(this); local_128 = (RNG *)CONCAT13(1,(undefined3)local_128); if (cVar2 == '\0') goto LAB_0078a1b2; } local_8 = 0xffffffff; if (((uint)local_15c & 4) != 0) { local_15c = (EntityPtr)((uint)local_15c & 0xfffffffb); std::string::_Tidy_deallocate(local_68 + 0x10); } if (local_128._3_1_ != '\0') { ClearCollectibleAnim(this); } bVar1 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)this + 0x1508),0x75); if (bVar1 == 0) { LAB_0078a242: local_128 = (RNG *)((uint)local_128 & 0xffffff); } else { std::string::string_from_cstr(local_68 + 0x10,&s_empty); local_8 = 0x15; local_15c = (EntityPtr)((uint)local_15c | 8); local_158.y = (float)local_15c; cVar2 = FUN_007ad720(); local_128 = (RNG *)CONCAT13(1,(undefined3)local_128); if (cVar2 == '\0') goto LAB_0078a242; } local_8 = 0xffffffff; if (((uint)local_15c & 8) != 0) { std::string::_Tidy_deallocate(local_68 + 0x10); } if (local_128._3_1_ != '\0') { FUN_007ad610(); itemConfig = Isaac::GetItemConfig(); itemCfg = Config::GetNullItem(itemConfig,0x75); RemoveCostume(this,itemCfg); } } update_footprints(this); if ((*(int *)((int)this + 0x2c) == 1) || (*(byte *)((int)this + 0x20a9) != 0)) { update_baby_skin_effects(this); } if ((0 < *(int *)((int)this + 0x1b2c)) && (iVar4 = *(int *)((int)this + 0x1b2c) + -1, *(int *)((int)this + 0x1b2c) = iVar4, iVar4 == 0)) { SoundEffects::PlayWithFartOverride (*(int *)((int)this + 0x1b24),*(float *)((int)this + 0x1b28),2,0,1.0); *(int *)((int)this + 0x1b24) = 0; } bVar1 = Game::GetDebugFlag(g_game,7); if (bVar1 != 0) { piVar14 = (int *)((int)this + 0x1588); local_120 = (EntityPtr)0x0; do { if (((ActiveItemDesc *)(piVar14 + -2))->_item != 0) { iVar4 = GetActiveMaxCharge(this,(int)local_120); *piVar14 = iVar4; } local_120 = (EntityPtr)((int)local_120 + 1); piVar14 = piVar14 + 8; } while ((uint)local_120 < &DAT_00000004); if (*(int *)((int)this + 0x13c0) == 0x19) { *(int *)((int)this + 0x1f54) = 9; } } bVar1 = Game::IsInTimedSet(g_game,1); if ((bVar1 != 0) && (*(int *)((int)this + 0x2c) == 0)) { musicManager = (MusicManager *)MusicManager::MusicManager(); fVar30 = Vector::Length((Vector *)((int)this + 0x360)); EVar8 = (EntityPtr)(fVar30 * 0.1 + 0.5); local_13c.y = (float)EVar8; MusicManager::PitchSlide(musicManager); } bVar1 = Game::IsInTimedSet(g_game,2); if ((bVar1 != 0) && (*(int *)((int)this + 0x2c) == 0)) { musicManager = (MusicManager *)MusicManager::MusicManager(); EVar8 = (EntityPtr)0x0; FUN_00a155f0(); MusicManager::PitchSlide(musicManager); } bVar1 = Game::IsInTimedSet(g_game,0x25); if (bVar1 != 0) { vfunc = *(code **)(*(int *)this + 0x3c); ::Color::Color(); (*vfunc)(); tmpColor = (ColorMod *)::Color::Color(); Sprite::SetColor((Sprite *)((int)this + 0x48),tmpColor); } bVar1 = Game::IsInTimedSet(g_game,0xe); if (bVar1 != 0) { vfunc = *(code **)(*(int *)this + 0x3c); ::Color::Color(); (*vfunc)(); tmpColor = (ColorMod *)::Color::Color(); Sprite::SetColor((Sprite *)((int)this + 0x48),tmpColor); } bVar1 = Game::IsInTimedSet(g_game,0x35); if (bVar1 != 0) { ::Color::Color((Color *)local_98); ::Color::SetColorize((Color *)local_98,1.0,1.0,1.0,1.0); (**(code **)(*(int *)this + 0x3c))(); Sprite::SetColor((Sprite *)((int)this + 0x48),(ColorMod *)local_98); } bVar1 = Game::IsInTimedSet(g_game,0x18); if (bVar1 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); EVar17 = (EntityPtr)Room::GetGridIndex(room,(Vector *)((int)this + 0x33c)); local_120 = EVar17; room = (Room *)Level::GetCurrentRoom((Level *)g_game); gridEntity = Room::GetGridEntity(room,(uint)EVar17); if (gridEntity == (GridEntity *)0x0) { local_12a = 0; local_128 = (RNG *)((uint)local_128 & 0xffffff); LAB_0078a679: local_121 = '\0'; } else { iVar4 = GridEntity::GetType(); local_12a = iVar4 == 0xe; if ((bool)local_12a) { iVar4 = EntityList::Size(); local_128 = (RNG *)CONCAT13(iVar4 == 1000,(undefined3)local_128); LAB_0078a64a: iVar4 = GridEntity::GetType(); if ((iVar4 != 1) && (iVar4 = GridEntity::GetType(), iVar4 != 10)) goto LAB_0078a679; local_121 = '\x01'; } else { local_121 = '\0'; local_128 = (RNG *)((uint)local_128 & 0xffffff); if (gridEntity != (GridEntity *)0x0) goto LAB_0078a64a; } } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetGridPosition(room,(Vector *)(local_24 + 8),(int)local_120); FUN_00a0ff00(); if ((float)EVar8 < 20.0 - *(float *)((int)this + 0x370) * 0.5) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar1 = Room::is_type_16(room); if ((bVar1 == 0) && (((gridEntity == (GridEntity *)0x0 || (local_128._3_1_ != '\0')) || ((local_121 != '\0' && (local_12a == 0)))))) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); rng = (RNG *)FUN_005cbd00(); uVar28 = RNG::Next(rng); Room::SpawnGridEntity(room,(int)local_120,0xe,0,uVar28,0); play_sound_with_fart_seed(0x25,0.3,2,0,1.0); } } } bVar1 = Game::IsInTimedSet(g_game,0x1a); if ((bVar1 != 0) && (iVar4 = Game::GetFrameCount(g_game), 0x3c < iVar4)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar4 = Room::GetFrameCount(room); if ((10 < iVar4) && (bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) { FUN_00420ae0(); cVar2 = FUN_0082ee30(); if (cVar2 == '\0') { FUN_00428b50(); cVar2 = FUN_0082ee30(); if ((cVar2 == '\0') && (((local_13c.y = Vector::Length((Vector *)((int)this + 0x1660)), local_13c.y < 0.2 && (local_13c.y = Vector::Length((Vector *)((int)this + 0x1654)), local_13c.y < 0.1)) || ((local_13c.y = Vector::Length((Vector *)((int)this + 0x1660)), local_13c.y < 0.2 && (*(byte *)((int)this + 400) != 0)))))) { vfunc = *(code **)(*(int *)this + 0x20); EntityRef::EntityRef((EntityRef *)local_68); (*vfunc)(); } } } } bVar1 = Game::IsInTimedSet(g_game,0x1b); if ((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000), bVar1 == 0)) { iVar4 = Game::GetFrameCount(g_game); iVar4 = 0x545 - iVar4 % 0x546; if (iVar4 == 0) { vfunc = *(code **)(*(int *)this + 0x20); EntityRef::EntityRef((EntityRef *)local_68); (*vfunc)(); fVar30 = 1.0; fVar24 = 8.0; } else { if ((iVar4 == (iVar4 / 0x1e) * 0x1e) && (iVar4 < 0x97)) { fVar30 = 1.0; } else { if ((iVar4 != (iVar4 / 0xf) * 0xf) || (0x96 < iVar4)) goto LAB_0078a970; fVar30 = 0.8; } fVar24 = 4.0; } SoundEffects::PlayWithFartOverride(0x23,fVar30,0,0,fVar24); } LAB_0078a970: bVar1 = Game::IsInTimedSet(g_game,0x1c); if ((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000), bVar1 == 0)) { iVar4 = Game::GetFrameCount(g_game); iVar4 = 53999 - iVar4; if ((iVar4 < 1) && (bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) { vfunc = *(code **)(*(int *)this + 0x20); EntityRef::EntityRef((EntityRef *)local_68); cVar2 = (*vfunc)(); if (cVar2 == '\0') goto LAB_0078aa79; fVar30 = 1.0; fVar24 = 8.0; } else { if ((iVar4 == (iVar4 / 0x1e) * 0x1e) && (iVar4 < 0x385)) { fVar30 = 1.0; } else { if ((iVar4 != (iVar4 / 0xf) * 0xf) || (300 < iVar4)) goto LAB_0078aa79; fVar30 = 0.8; } fVar24 = 4.0; } SoundEffects::PlayWithFartOverride(0x23,fVar30,0,0,fVar24); } LAB_0078aa79: local_16c.y = *(float *)((int)this + 0x16c); uVar28 = *(uint *)((int)this + 0x168); if ((uVar28 & 0x4000) != 0) { Entity::ClearEntityFlags((Entity *)this,0x8000); local_16c.y = *(float *)((int)this + 0x16c); uVar28 = *(uint *)((int)this + 0x168); } if ((uVar28 & 0x4000) == 0) { Entity::ClearEntityFlags((Entity *)this,0x8000000); bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000); if ((bVar1 != 0) && (*(EntityPtr *)((int)this + 0x28c) == (EntityPtr)this)) { iVar4 = *(int *)((int)this + 0x1344) - *(int *)((int)this + 0x1da4); if (0 < iVar4) { if ((*(int *)((int)this + 0x134c) < 1) && (*(int *)((int)this + 0x1d88) < 1)) { iVar5 = GetHealthType(this); iVar5 = scale_for_hard_difficulty(2 - (uint)(iVar5 != 3)); if (iVar4 <= iVar5) goto LAB_0078ac08; } bVar1 = HasInstantDeathCurse(this); if (bVar1 == 0) { iVar4 = Entity::GetHitPointsLost((Entity *)this); uVar28 = *(int *)((int)this + 0x138c) - iVar4; *(uint *)((int)this + 0x138c) = uVar28; if ((int)uVar28 < 1) { *(int *)((int)this + 0x138c) = 600; vfunc = *(code **)(*(int *)this + 0x20); EntityRef::EntityRef((EntityRef *)local_68); FUN_00665a30(); (*vfunc)(); this = player; } else if ((int)uVar28 < 0x1e) { uVar28 = uVar28 & 0x80000003; bVar22 = uVar28 == 0; if ((int)uVar28 < 0) { bVar22 = (uVar28 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar22) { vfunc = *(code **)(*(int *)this + 0x3c); ::Color::Color(); (*vfunc)(); } } goto LAB_0078ac1d; } } LAB_0078ac08: Entity::ClearEntityFlags((Entity *)this,0x400000000); *(int *)((int)this + 0x138c) = 0; } LAB_0078ac1d: if (*(int *)((int)this + 0x13c0) == 0x16) { iVar4 = *(int *)((int)this + 0x1344); iVar5 = FUN_007d4320(); if (((iVar5 < iVar4) || (1 < *(int *)((int)this + 0x134c))) || ((*(int *)((int)this + 0x134c) == 1 && (0 < *(int *)((int)this + 0x1d88) + iVar4)))) { if (*(int *)((int)this + 0x1ef4) == 0) { *(int *)((int)this + 0x1ef4) = 300; } else { iVar4 = *(int *)((int)this + 0x1ef4) + -1; *(int *)((int)this + 0x1ef4) = iVar4; if (iVar4 < 1) { iVar4 = *(int *)((int)this + 0x1344); iVar5 = FUN_007d4320(); if (iVar5 < iVar4) { AddHearts(this,-1,0,0); *(int *)((int)this + 0x1ef4) = 300; } else { if ((1 < *(int *)((int)this + 0x134c)) || ((*(int *)((int)this + 0x134c) == 1 && (0 < *(int *)((int)this + 0x1d88) + iVar4))) ) { AddSoulHearts(this,-1,0); } *(int *)((int)this + 0x1ef4) = 300; } } } goto LAB_0078ace4; } } *(int *)((int)this + 0x1ef4) = 0; } LAB_0078ace4: bVar1 = IsHeldItemVisible(this); vecResult = (Vector *)((int)this + 0x1b1c); *(byte *)((int)this + 0x17d8) = bVar1; bVar1 = Vector::operator_ne(vecResult,&g_vectorZero); if (bVar1 != 0) { vecResult2 = Vector::__sub(vecResult,(Vector *)(local_24 + 8),(Vector *)((int)this + 0x33c)); local_13c.y = Vector::Length(vecResult2); if (1.0 < local_13c.y) { vecResult = Vector::__sub(vecResult,(Vector *)(local_24 + 8),(Vector *)((int)this + 0x33c)); local_13c.y = 0.18; vecResult = Vector::__mul(vecResult,(Vector *)&local_1a0._h,&local_13c.y); vecResult = Vector::__add((Vector *)((int)this + 0x33c),&local_16c,vecResult); } Entity::SetPosition((Entity *)this,vecResult); } bVar1 = Game::IsGreedMode(g_game); if (bVar1 == 0) { if (*(int *)((int)this + 0x134c) + *(int *)((int)this + 0x1344) < 2) { iVar4 = Game::GetLastLevelWithoutHalfHp(g_game); Config::GetCollectibles(); iVar5 = EntityPtr::Ref(); iVar20 = iVar5 - iVar4; if (9 < iVar5) { if (iVar5 < 0xc) { iVar20 = iVar20 + -1; } else { iVar20 = 10 - iVar4; } } if (2 < iVar20) { this_03 = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::TryUnlock(this_03,0x149); } } else { Config::GetCollectibles(); EntityPtr::Ref(); Game::SetLastLevelWithoutHalfHp(g_game); } } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if ((bVar1 != 0) || (cVar2 = Entity::IsDead((Entity *)this), cVar2 != '\0')) goto LAB_0078b0f0; uVar28 = *(uint *)((int)this + 0x168); if ((uVar28 & 0x100) == 0) { if ((uVar28 & 0x200) != 0) { local_15c = (EntityPtr)0xb67610; goto LAB_0078af55; } if ((uVar28 & 0x1000) != 0) { local_15c = (EntityPtr)0xb67618; goto LAB_0078af55; } if ((uVar28 & 0x40) != 0) { local_15c = (EntityPtr)0xb67620; goto LAB_0078af55; } if ((uVar28 & 0x800) != 0) { local_15c = (EntityPtr)&DAT_00b67628; goto LAB_0078af55; } if ((*(uint *)((int)this + 0x16c) & 4) != 0) { local_15c = (EntityPtr)0xb67690; goto LAB_0078af55; } if ((uVar28 & 0x80) != 0) { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { local_15c = (EntityPtr)&DAT_00b6769c; goto LAB_0078af55; } } if (0 < *(int *)((int)this + 0x31c)) { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if ((cVar2 != '\0') && (*(short *)((int)((Entity_Player *)((int)this + 0x26cc))->_chargeBarSprites[0]._color._tint + 6) == 0)) { local_15c = (EntityPtr)0xb6b02c; goto LAB_0078af55; } } Sprite::Stop((Sprite *)((int)this + 0x110c)); } else { local_15c = (EntityPtr)0xb67630; LAB_0078af55: pAVar19 = (ANM2 *)((int)this + 0x110c); cVar2 = Sprite::IsLoaded((Sprite *)pAVar19); if (cVar2 == '\0') { std::string::string_from_cstr(local_68 + 0x10,(byte *)"gfx/StatusEffects.anm2"); local_8 = 0x16; ANM2::Load(pAVar19,(std_string *)(local_68 + 0x10),1); local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_68 + 0x10); } bVar1 = ANM2::IsPlaying(pAVar19,&s_empty); if (bVar1 != 0) { ANM2::Update(pAVar19); } ANM2::Play(pAVar19,(byte *)local_15c,0); } Config::GetPillEffects(); local_13c.y = (float)FUN_0040bc90(); bVar1 = IsExtraAnimationFinished(this); if (bVar1 == 0) { local_120 = (EntityPtr)0xffffffff; } else { FUN_0041e470(); local_120 = (EntityPtr)FUN_0040bc90(); } Sprite::GetOverlayFrame((Sprite *)((int)this + 0x48)); ANM2::GetFrame((ANM2 *)((int)this + 0x48)); FUN_00753830(); FUN_00839840(); cVar2 = Level::IsAltStage(); if (cVar2 != '\0') { Config::GetCollectibles(); iVar4 = EntityPtr::Ref(); if ((iVar4 == 0xc) && (bVar1 = Entity::IsFrame((Entity *)this,0x96,0), bVar1 != 0)) { Level::GetCurrentRoom((Level *)g_game); iVar4 = Room::GetDeliriumDistance(); iVar4 = Isaac::Random(iVar4 * 0x69 + 0x4b); if ((iVar4 == 0) && (cVar2 = Game::HasHallucination(g_game), cVar2 == '\0')) { Game::ShowHallucination(g_game); } } } cVar2 = Level::IsAltStage(); if ((cVar2 != '\0') && (cVar2 = Game::HasHallucination(g_game), cVar2 != '\0')) { FUN_00839830(); } LAB_0078b0f0: bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { cVar2 = Entity::IsDead((Entity *)this); if (cVar2 != '\0') { std::deque<12byte>::_Tidy(); } FUN_0060c560(); _range_to_span(); cVar2 = FUN_0060c450(); while (cVar2 != '\0') { piVar14 = (int *)FUN_0060c420(); *piVar14 = *piVar14 + -1; piVar14 = (int *)FUN_0060c420(); if (*piVar14 < 1) { FUN_00479d50(); FUN_007dc6d0(); FUN_0078b330(); } else { FUN_0060c410(); } _range_to_span(); cVar2 = FUN_0060c450(); } *(short *)((int)this + 0x1d94) = 0; } if (*(byte *)((int)this + 0x20a9) != 0) { Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { *(int *)((int)this + 0x188) = 0; } *(int *)((int)this + 0x184) = 3; } bVar1 = IsHologram(this); if (bVar1 != 0) { *(int *)((int)this + 0x188) = 0; } Game::GetField26614(g_game); cVar2 = FUN_00429550(); if (cVar2 != '\0') { Game::GetField26614(g_game); piVar14 = (int *)EntityList::Size(); (**(code **)(*piVar14 + 0x58))(); } bVar1 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar1 == 0) { *(undefined4 *)((int)this + 0x16b8) = 0; } FUN_00864130(); ExceptionList = local_10; return; } //@@ 0078b330 FUN_0078b330 void FUN_0078b330(undefined4 *param_1) { undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[2] = param_1[2]; return; } //@@ 0078b350 Entity_Player::IsHeadless /* ZHL [exact] __thiscall bool Entity_Player::IsHeadless(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::IsHeadless(Entity_Player *this) { byte bVar1; TemporaryEffects *this_00; bVar1 = HasCollectible(this,0xce,0); if (bVar1 == 0) { this_00 = &this->_temporaryeffects; bVar1 = TemporaryEffects::HasCollectibleEffect(this_00,0x145); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasCollectibleEffect(this_00,0xce); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasNullEffect(this_00,0x37); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasCollectibleEffect(this_00,0x2d9); if (bVar1 == 0) { return 0; } } } } } return 1; } //@@ 0078b3b0 ANM2::copy_animation_to /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? fastcall ECX=source ANM2, EDX=dest ANM2 (both _loaded checked): if the source is playing, SetAnimation(GetAnimation()) + Rewind + _isPlaying=1 on dest, else SetFrame(anim, GetFrame()); twice from Entity_Player::Render to sync the backup player sprites */ void ANM2::copy_animation_to(void) { byte isAnimSet; std_string *animName; int frame; ANM2 *in_ECX; void *allocBlock; ANM2 *in_EDX; uint allocSize; void *overlayNameBuf [5]; uint overlayNameCapacity; void *animNameBuf [5]; uint animNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; float overlayFrame; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff585; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(animNameBuf + 10); ExceptionList = &local_10; if ((in_ECX->_loaded != 0) && (in_EDX->_loaded != 0)) { if (((in_ECX->_animState)._animData == (void *)0x0) || ((in_ECX->_animState)._isPlaying == 0)) { frame = GetFrame(in_ECX); animName = GetAnimation((ANM2 *)&in_ECX->_animState,(std_string *)animNameBuf); local_8 = (void *)0x1; SetFrame(in_EDX,animName,frame); local_8 = (void *)0xffffffff; if (0xf < animNameCapacity) { allocSize = animNameCapacity + 1; allocBlock = animNameBuf[0]; if (0xfff < allocSize) { allocBlock = *(void **)((int)animNameBuf[0] + -4); allocSize = animNameCapacity + 0x24; if (0x1f < (uint)((int)animNameBuf[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,allocSize); } } else { animName = GetAnimation((ANM2 *)&in_ECX->_animState,(std_string *)animNameBuf); local_8 = (void *)0x0; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } isAnimSet = SetAnimation(in_EDX,(byte *)animName,1); if (isAnimSet != 0) { AnimationState::Rewind(&in_EDX->_animState); (in_EDX->_animState)._isPlaying = 1; } local_8 = (void *)0xffffffff; if (0xf < animNameCapacity) { allocSize = animNameCapacity + 1; allocBlock = animNameBuf[0]; if (0xfff < allocSize) { allocBlock = *(void **)((int)animNameBuf[0] + -4); allocSize = animNameCapacity + 0x24; if (0x1f < (uint)((int)animNameBuf[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,allocSize); } frame = GetFrame(in_ECX); if ((in_EDX->_animState)._animData != (void *)0x0) { AnimationState::SetFrameFloat(&in_EDX->_animState,(float)frame); } } if ((in_ECX->_overlayAnimState)._animData == (void *)0x0) { if ((in_EDX->_overlayAnimState)._animData != (void *)0x0) { AnimationState::SetAnimationData(&in_EDX->_overlayAnimState,(void *)0x0); } } else if ((in_ECX->_overlayAnimState)._isPlaying == 0) { overlayFrame = (in_ECX->_overlayAnimState)._animFrame; animName = GetAnimation((ANM2 *)&in_ECX->_overlayAnimState,(std_string *)overlayNameBuf); local_8 = (void *)0x3; Sprite::SetOverlayFrame(animName,(int)overlayFrame); if (0xf < overlayNameCapacity) { allocSize = overlayNameCapacity + 1; allocBlock = overlayNameBuf[0]; if (0xfff < allocSize) { allocBlock = *(void **)((int)overlayNameBuf[0] + -4); allocSize = overlayNameCapacity + 0x24; if (0x1f < (uint)((int)overlayNameBuf[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,allocSize); } } else { animName = GetAnimation((ANM2 *)&in_ECX->_overlayAnimState,(std_string *)animNameBuf); local_8 = (void *)0x2; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } isAnimSet = SetOverlayAnimation(in_EDX,(byte *)animName,1); if (isAnimSet != 0) { AnimationState::Rewind(&in_EDX->_overlayAnimState); (in_EDX->_overlayAnimState)._isPlaying = 1; } local_8 = (void *)0xffffffff; if (0xf < animNameCapacity) { allocSize = animNameCapacity + 1; allocBlock = animNameBuf[0]; if (0xfff < allocSize) { allocBlock = *(void **)((int)animNameBuf[0] + -4); allocSize = animNameCapacity + 0x24; if (0x1f < (uint)((int)animNameBuf[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,allocSize); } if ((in_ECX->_overlayAnimState)._animData == (void *)0x0) { frame = -1; } else { frame = (int)(in_ECX->_overlayAnimState)._animFrame; } if ((in_EDX->_overlayAnimState)._animData != (void *)0x0) { AnimationState::SetFrameFloat(&in_EDX->_overlayAnimState,(float)frame); } } } ExceptionList = local_10; return; } //@@ 0078b640 Entity_Player::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: virtual: Entity::Render then RenderBody/RenderHead/RenderTop/RenderGlow, IsHeadless/IsHologram/IsInvisible/IsFullSpriteRendering, _Overlay layers, IsIdxLocalPlayer prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::Render(Entity_Player *costumeSprite,Vector *offset,byte isMainPass) { float fVar1; float fVar2; code *pcVar3; ANM2 other; ulonglong profileRef; byte bVar4; LayerState *layer; std_string *psVar5; std_string *psVar6; std_string *left; byte *******pppppppbVar7; void *pvVar8; Vector *pVVar9; Entity_Player *localPlayer; byte *pbVar10; KColor *color; uint uVar11; ANM2 *costumeSprite; PlayerCostumeMap *costumeMapEntry; int iVar12; Font *font; float fVar13; double dVar14; ANM2 aAStackY_8cdc [128]; undefined1 in_stack_fffffe38 [248]; float in_stack_ffffff30; float in_stack_ffffff34; undefined4 in_stack_ffffff38; float in_stack_ffffff3c; undefined4 in_stack_ffffff40; int in_stack_ffffff44; int in_stack_ffffff48; Vector local_a4; Vector local_9c; float local_94; byte *local_90; Vector local_8c; Vector *local_84; Vector local_80; Vector *local_78; char local_72; byte local_71; std_string *bodyAnimName [5]; uint bodyAnimNameCapacity; undefined4 local_58; undefined4 local_54; undefined4 local_50; float hologramAlpha; undefined4 local_48; void *pvStack_44; char acStack_40 [16]; uint local_30; byte *******overlayAnimName; KColor local_28; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; NetplayManager netPlayersBegin; local_8 = 0xffffffff; puStack_c = &LAB_00aff5e1; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(acStack_40 + 0x3c); ExceptionList = &local_10; local_80.y = (float)offset; if ((((((*(int *)((int)g_game->_room + 0x12bc) == 5) && (costumeSprite->_variant == 0)) && (costumeSprite->_isCoopGhost == 0)) && ((costumeSprite->_playerType == 0x1d || (costumeSprite->_playerType == 0x26)))) && (pvVar8 = costumeSprite->_backupPlayer, pvVar8 != (void *)0x0)) && (costumeSprite->_valid != 0)) { local_72 = *(undefined1 *)((int)pvVar8 + 0x171); local_71 = *(undefined1 *)((int)pvVar8 + 0x172); *(undefined1 *)((int)pvVar8 + 0x171) = 1; *(undefined1 *)((int)costumeSprite->_backupPlayer + 0x172) = 1; if ((costumeSprite->_bodySprite)._loaded == 0) { if (*(char *)((int)costumeSprite->_backupPlayer + 0x525) != '\0') { ANM2::Reset((ANM2 *)((int)costumeSprite->_backupPlayer + 0x41c)); } } else if (*(char *)((int)costumeSprite->_backupPlayer + 0x525) == '\0') { ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x1c8), (ANM2 *)((int)costumeSprite->_backupPlayer + 0x48)); other._championColor._offset[1] = in_stack_ffffff30; other._filename._buf[0] = in_stack_fffffe38[0]; other._filename._buf[1] = in_stack_fffffe38[1]; other._filename._buf[2] = in_stack_fffffe38[2]; other._filename._buf[3] = in_stack_fffffe38[3]; other._filename._buf[4] = in_stack_fffffe38[4]; other._filename._buf[5] = in_stack_fffffe38[5]; other._filename._buf[6] = in_stack_fffffe38[6]; other._filename._buf[7] = in_stack_fffffe38[7]; other._filename._buf[8] = in_stack_fffffe38[8]; other._filename._buf[9] = in_stack_fffffe38[9]; other._filename._buf[10] = in_stack_fffffe38[10]; other._filename._buf[0xb] = in_stack_fffffe38[0xb]; other._filename._buf[0xc] = in_stack_fffffe38[0xc]; other._filename._buf[0xd] = in_stack_fffffe38[0xd]; other._filename._buf[0xe] = in_stack_fffffe38[0xe]; other._filename._buf[0xf] = in_stack_fffffe38[0xf]; other._filename._size = in_stack_fffffe38._16_4_; other._filename._capacity = in_stack_fffffe38._20_4_; other._animDefaultName._buf[0] = in_stack_fffffe38[0x18]; other._animDefaultName._buf[1] = in_stack_fffffe38[0x19]; other._animDefaultName._buf[2] = in_stack_fffffe38[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffe38[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffe38[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffe38[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffe38[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffe38[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffe38[0x20]; other._animDefaultName._buf[9] = in_stack_fffffe38[0x21]; other._animDefaultName._buf[10] = in_stack_fffffe38[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffe38[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffe38[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffe38[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffe38[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffe38[0x27]; other._animDefaultName._size = in_stack_fffffe38._40_4_; other._animDefaultName._capacity = in_stack_fffffe38._44_4_; other._animState._animation = (void *)in_stack_fffffe38._48_4_; other._animState._animData = (void *)in_stack_fffffe38._52_4_; other._animState._layerFrames = (void *)in_stack_fffffe38._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffe38._60_4_; other._animState._animFrame = (float)in_stack_fffffe38._64_4_; other._animState._isPlaying = in_stack_fffffe38[0x44]; other._animState._21_3_ = in_stack_fffffe38._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffe38._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffe38._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffe38._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffe38._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffe38._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffe38._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffe38._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffe38[100]; other._overlayAnimState._21_3_ = in_stack_fffffe38._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffe38._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffe38._108_4_; other._overlayRenderFirst = in_stack_fffffe38[0x70]; other._113_3_ = in_stack_fffffe38._113_3_; other._animData = (void *)in_stack_fffffe38._116_4_; other._animCount = in_stack_fffffe38._120_4_; other._layerState = (void *)in_stack_fffffe38._124_4_; other._layerCount = in_stack_fffffe38._128_4_; other._nullLayerNames = (void *)in_stack_fffffe38._132_4_; other._numNullLayers = in_stack_fffffe38._136_4_; other._eventNames = (void *)in_stack_fffffe38._140_4_; other._numEvents = in_stack_fffffe38._144_4_; other._offset.x = (float)in_stack_fffffe38._148_4_; other._offset.y = (float)in_stack_fffffe38._152_4_; other._scale.x = (float)in_stack_fffffe38._156_4_; other._scale.y = (float)in_stack_fffffe38._160_4_; other._rotation = (float)in_stack_fffffe38._164_4_; other._color._tint[0] = (float)in_stack_fffffe38._168_4_; other._color._tint[1] = (float)in_stack_fffffe38._172_4_; other._color._tint[2] = (float)in_stack_fffffe38._176_4_; other._color._tint[3] = (float)in_stack_fffffe38._180_4_; other._color._colorize[0] = (float)in_stack_fffffe38._184_4_; other._color._colorize[1] = (float)in_stack_fffffe38._188_4_; other._color._colorize[2] = (float)in_stack_fffffe38._192_4_; other._color._colorize[3] = (float)in_stack_fffffe38._196_4_; other._color._offset[0] = (float)in_stack_fffffe38._200_4_; other._color._offset[1] = (float)in_stack_fffffe38._204_4_; other._color._offset[2] = (float)in_stack_fffffe38._208_4_; other._championColor._tint[0] = (float)in_stack_fffffe38._212_4_; other._championColor._tint[1] = (float)in_stack_fffffe38._216_4_; other._championColor._tint[2] = (float)in_stack_fffffe38._220_4_; other._championColor._tint[3] = (float)in_stack_fffffe38._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffe38._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffe38._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffe38._236_4_; other._championColor._colorize[3] = (float)in_stack_fffffe38._240_4_; other._championColor._offset[0] = (float)in_stack_fffffe38._244_4_; other._championColor._offset[2] = in_stack_ffffff34; other._flipX = (byte)in_stack_ffffff38; other._flipY = SUB41(in_stack_ffffff38,1); other._258_2_ = SUB42(in_stack_ffffff38,2); other._playbackSpeed = in_stack_ffffff3c; other._264_1_ = (char)in_stack_ffffff40; other._loaded = SUB41(in_stack_ffffff40,1); other._266_2_ = SUB42(in_stack_ffffff40,2); other._shadowLayerIndex = in_stack_ffffff44; other._bitflags = in_stack_ffffff48; ANM2::operator_assign((ANM2 *)((int)costumeSprite->_backupPlayer + 0x41c),other); } local_a4.y = (float)ANM2::GetFrame(&costumeSprite->_sprite); if ((costumeSprite->_sprite)._overlayAnimState._animData == (void *)0x0) { local_78 = (Vector *)0xffffffff; } else { local_78 = (Vector *)(int)(costumeSprite->_sprite)._overlayAnimState._animFrame; } ANM2::GetAnimation((ANM2 *)&(costumeSprite->_sprite)._animState,(std_string *)bodyAnimName); local_8 = 0; ANM2::GetAnimation((ANM2 *)&(costumeSprite->_sprite)._overlayAnimState,(std_string *)&pvStack_44); local_8 = CONCAT31(local_8._1_3_,1); ANM2::copy_animation_to(); pvVar8 = costumeSprite->_backupPlayer; fVar13 = (costumeSprite->_sprite)._scale.y; fVar1 = (costumeSprite->_playerSpriteScale).y; *(float *)((int)pvVar8 + 0xe4) = ((costumeSprite->_sprite)._scale.x * *(float *)((int)pvVar8 + 0x14f0)) / (costumeSprite->_playerSpriteScale).x; *(float *)((int)pvVar8 + 0xe8) = (fVar13 * *(float *)((int)pvVar8 + 0x14f4)) / fVar1; *(byte *)((int)costumeSprite->_backupPlayer + 0x1398) = costumeSprite->_isPlayingExtraAnimation; *(byte *)((int)costumeSprite->_backupPlayer + 0x139a) = costumeSprite->_isPlayingItemAnimation; ANM2::copy_animation_to(); bVar4 = IsFullSpriteRendering(costumeSprite); if (bVar4 == 0) { local_90 = (byte *)0x0; local_84 = (Vector *)0x0; do { pVVar9 = local_84; pbVar10 = local_90; if (*(char *)((int)&local_84[0x247].x + (int)costumeSprite->_backupPlayer) == '\0') { layer = ANM2::GetLayer(&costumeSprite->_sprite,local_90); pvVar8 = costumeSprite->_backupPlayer; local_8c.y = ((layer->_pos).x * *(float *)((int)pvVar8 + 0x1500)) / (costumeSprite->_headScale).x; local_9c.y = ((layer->_pos).y * *(float *)((int)pvVar8 + 0x1504)) / (costumeSprite->_headScale).y; layer = ANM2::GetLayer((ANM2 *)((int)pvVar8 + 0x48),pbVar10); (layer->_pos).x = local_8c.y; (layer->_pos).y = local_9c.y; layer = ANM2::GetLayer(&costumeSprite->_sprite,pbVar10); pvVar8 = costumeSprite->_backupPlayer; local_8c.y = ((layer->_size).x * *(float *)((int)pvVar8 + 0x1500)) / (costumeSprite->_headScale).x; local_9c.y = ((layer->_size).y * *(float *)((int)pvVar8 + 0x1504)) / (costumeSprite->_headScale).y; } else { layer = ANM2::GetLayer(&costumeSprite->_sprite,local_90); pvVar8 = costumeSprite->_backupPlayer; local_9c.y = ((layer->_pos).x * *(float *)((int)pvVar8 + 0x14f8)) / (costumeSprite->_bodyScale).x; local_8c.y = ((layer->_pos).y * *(float *)((int)pvVar8 + 0x14fc)) / (costumeSprite->_bodyScale).y; layer = ANM2::GetLayer((ANM2 *)((int)pvVar8 + 0x48),pbVar10); (layer->_pos).x = local_9c.y; (layer->_pos).y = local_8c.y; layer = ANM2::GetLayer(&costumeSprite->_sprite,pbVar10); pvVar8 = costumeSprite->_backupPlayer; local_8c.y = (*(float *)((int)pvVar8 + 0x14f8) * (layer->_size).x) / (costumeSprite->_bodyScale).x; local_9c.y = ((layer->_size).y * *(float *)((int)pvVar8 + 0x14fc)) / (costumeSprite->_bodyScale).y; } layer = ANM2::GetLayer((ANM2 *)((int)pvVar8 + 0x48),pbVar10); (layer->_size).x = local_8c.y; (layer->_size).y = local_9c.y; pvVar8 = costumeSprite->_backupPlayer; iVar12 = *(int *)((int)&pVVar9[0x245].y + (int)pvVar8); if (-1 < iVar12) { costumeSprite = (ANM2 *)(iVar12 * 0x130 + *(int *)((int)pvVar8 + 0x1220)); if (*(char *)((int)&pVVar9[0x247].x + (int)pvVar8) == '\0') { psVar5 = &costumeSprite->_headAnim; psVar6 = psVar5; if (0xf < (costumeSprite->_headAnim)._capacity) { psVar6 = *(std_string **)psVar5->_buf; } bVar4 = ANM2::SetAnimation(costumeSprite,(byte *)psVar6,1); if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&costumeSprite->_animState,(float)(int)local_78), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } layer = ANM2::GetLayer(&costumeSprite->_sprite,local_90); fVar13 = (layer->_pos).y; fVar1 = *(float *)((int)costumeSprite->_backupPlayer + 0x1504); fVar2 = (costumeSprite->_headScale).y; (costumeSprite->_offset).x = ((layer->_pos).x * *(float *)((int)costumeSprite->_backupPlayer + 0x1500)) / (costumeSprite->_headScale).x; (costumeSprite->_offset).y = (fVar13 * fVar1) / fVar2; layer = ANM2::GetLayer(&costumeSprite->_sprite,local_90); fVar13 = (layer->_size).y; fVar1 = *(float *)((int)costumeSprite->_backupPlayer + 0x1504); fVar2 = (costumeSprite->_headScale).y; (costumeSprite->_scale).x = ((layer->_size).x * *(float *)((int)costumeSprite->_backupPlayer + 0x1500)) / (costumeSprite->_headScale).x; (costumeSprite->_scale).y = (fVar13 * fVar1) / fVar2; if (costumeSprite[1]._filename._buf[10] != '\0') { psVar6 = (std_string *)(costumeSprite->_headAnim)._size; if (0x7fffffffU - (int)psVar6 < 8) { LAB_0078c992: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } left = psVar5; if (0xf < (costumeSprite->_headAnim)._capacity) { left = *(std_string **)psVar5->_buf; } std::string::concat((char *)&overlayAnimName,(int)local_80.y,psVar6,(byte *)left, (uint)psVar6,(byte *)"_Overlay",8); pppppppbVar7 = (byte *******)&overlayAnimName; if (0xf < (uint)local_28._unk) { pppppppbVar7 = overlayAnimName; } local_8c.y = (float)overlayAnimName; local_9c.y = (float)ANM2::GetAnimationData(costumeSprite,(byte *)pppppppbVar7); if (0xf < (uint)local_28._unk) { uVar11 = local_28._unk + 1; pppppppbVar7 = (byte *******)local_8c.y; if (0xfff < uVar11) { pppppppbVar7 = *(byte ********)((int)local_8c.y + -4); uVar11 = local_28._unk + 0x24; if ((byte *)0x1f < (byte *)((int)local_8c.y + (-4 - (int)pppppppbVar7))) goto LAB_0078bdd9; } operator_delete(pppppppbVar7,uVar11); } if ((void *)local_9c.y != (void *)0x0) { psVar6 = (std_string *)(costumeSprite->_headAnim)._size; if (0x7fffffffU - (int)psVar6 < 8) goto LAB_0078c992; if (0xf < (costumeSprite->_headAnim)._capacity) { psVar5 = *(std_string **)psVar5->_buf; } std::string::concat((char *)&overlayAnimName,(int)local_80.y,psVar6,(byte *)psVar5, (uint)psVar6,(byte *)"_Overlay",8); local_8 = CONCAT31(local_8._1_3_,2); pppppppbVar7 = (byte *******)&overlayAnimName; if (0xf < (uint)local_28._unk) { pppppppbVar7 = overlayAnimName; } bVar4 = ANM2::SetOverlayAnimation(costumeSprite,(byte *)pppppppbVar7,1); if ((bVar4 != 0) && ((costumeSprite->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat (&costumeSprite->_overlayAnimState,(float)(int)local_78); } local_8 = CONCAT31(local_8._1_3_,1); if (0xf < (uint)local_28._unk) { uVar11 = local_28._unk + 1; pppppppbVar7 = overlayAnimName; if (0xfff < uVar11) { pppppppbVar7 = (byte *******)overlayAnimName[-1]; uVar11 = local_28._unk + 0x24; if ((byte *)0x1f < (byte *)((int)overlayAnimName + (-4 - (int)pppppppbVar7))) goto LAB_0078bdd9; } operator_delete(pppppppbVar7,uVar11); } } } } else { psVar5 = (std_string *)bodyAnimName; if (0xf < bodyAnimNameCapacity) { psVar5 = bodyAnimName[0]; } bVar4 = ANM2::SetAnimation(costumeSprite,(byte *)psVar5,1); if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&costumeSprite->_animState,(float)(int)local_a4.y), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } layer = ANM2::GetLayer(&costumeSprite->_sprite,local_90); fVar13 = *(float *)((int)costumeSprite->_backupPlayer + 0x14f8); fVar1 = (layer->_pos).x; fVar2 = (costumeSprite->_bodyScale).x; (costumeSprite->_offset).y = ((layer->_pos).y * *(float *)((int)costumeSprite->_backupPlayer + 0x14fc)) / (costumeSprite->_bodyScale).y; (costumeSprite->_offset).x = (fVar13 * fVar1) / fVar2; layer = ANM2::GetLayer(&costumeSprite->_sprite,local_90); fVar13 = (layer->_size).y; fVar1 = *(float *)((int)costumeSprite->_backupPlayer + 0x14fc); fVar2 = (costumeSprite->_bodyScale).y; (costumeSprite->_scale).x = ((layer->_size).x * *(float *)((int)costumeSprite->_backupPlayer + 0x14f8)) / (costumeSprite->_bodyScale).x; (costumeSprite->_scale).y = (fVar13 * fVar1) / fVar2; local_84 = pVVar9; } pbVar10 = local_90; pVVar9 = local_84; } local_84 = pVVar9 + 2; local_90 = pbVar10 + 1; } while (local_84 < (Vector *)0xf0); offset = (Vector *)local_80.y; } pvVar8 = costumeSprite->_backupPlayer; *(float *)((int)pvVar8 + 0x33c) = (costumeSprite->_pos).x; *(float *)((int)pvVar8 + 0x340) = (costumeSprite->_pos).y; Render(costumeSprite->_backupPlayer,offset,isMainPass); *(char *)((int)costumeSprite->_backupPlayer + 0x171) = local_72; *(byte *)((int)costumeSprite->_backupPlayer + 0x172) = local_71; if (0xf < local_30) { uVar11 = local_30 + 1; pvVar8 = pvStack_44; if (0xfff < uVar11) { pvVar8 = *(void **)((int)pvStack_44 + -4); uVar11 = local_30 + 0x24; if (0x1f < (uint)((int)pvStack_44 + (-4 - (int)pvVar8))) goto LAB_0078bdd9; } operator_delete(pvVar8,uVar11); } if (bodyAnimNameCapacity < 0x10) { ExceptionList = local_10; return; } uVar11 = bodyAnimNameCapacity + 1; psVar5 = bodyAnimName[0]; if (0xfff < uVar11) { psVar5 = (std_string *)bodyAnimName[0][-1]._capacity; uVar11 = bodyAnimNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)bodyAnimName[0] + (-4 - (int)psVar5))) { LAB_0078bdd9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar5,uVar11); ExceptionList = local_10; return; } if ((costumeSprite->_variant == 1) || (costumeSprite->_isCoopGhost != 0)) { netPlayersBegin = g_manager->_netplayManager; if (((netPlayersBegin != *(NetplayManager *)(g_manager + 1)) && ((1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)netPlayersBegin >> 2) && (isMainPass != 0)))) && ((g_manager[1]._persistentGameData._achievements[2] != 0 && (bVar4 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,costumeSprite->_controllerIndex), bVar4 != 0)))) { get_netplay_player_color(); render_color_stack_push(); uVar11 = 0; do { pVVar9 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_a4,uVar11); local_80.x = offset->x + pVVar9->x; local_80.y = pVVar9->y + offset->y; Entity::Render((Entity *)costumeSprite,&local_80); uVar11 = uVar11 + 1; } while (uVar11 < 4); g_colorStackSize = g_colorStackSize - 1; if (g_colorStackSize == 0) { DAT_00c78dbc = 0; } } local_78 = (Vector *)(costumeSprite->_sprite)._color._tint[3]; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar4 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,costumeSprite->_controllerIndex) , bVar4 == 0)) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { fVar13 = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } else { fVar13 = 1.0; } (costumeSprite->_sprite)._color._tint[3] = (float)local_78 * fVar13; } Entity::Render((Entity *)costumeSprite,offset); (costumeSprite->_sprite)._color._tint[3] = (float)local_78; } else { local_71 = IsHologram(costumeSprite); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c811f8) && (_Init_thread_header(), DAT_00c811f8 == -1)) { DAT_00c811fc = 0x194fc4ad; _DAT_00c81200 = 0x300000004; DAT_00c81208 = 0x1b; _atexit(FUN_00b15b80); local_8 = 0xffffffff; _Init_thread_footer(); } local_78 = (Vector *)0x3f800000; if (local_71 != 0) { if ((DAT_00c811fc == 0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), DAT_00c811fc == 0)) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar11 = DAT_00c811fc >> ((byte)_DAT_00c81200 & 0x1f) ^ DAT_00c811fc; uVar11 = uVar11 << ((byte)((ulonglong)_DAT_00c81200 >> 0x20) & 0x1f) ^ uVar11; DAT_00c811fc = uVar11 >> ((byte)DAT_00c81208 & 0x1f) ^ uVar11; hologramAlpha = (float)((double)(int)DAT_00c811fc + __uint_to_double_fixup[-((int)DAT_00c811fc >> 0x1f)]) * 2.3283062e-10 * 0.15 + 0.05; if (costumeSprite->_updateTime < 30.0) { hologramAlpha = hologramAlpha * (costumeSprite->_updateTime / 30.0); } acStack_40[8] = '\0'; acStack_40[9] = '\0'; acStack_40[10] = '\0'; acStack_40[0xb] = '\0'; acStack_40[0xc] = '\0'; acStack_40[0xd] = '\0'; acStack_40[0xe] = '\0'; acStack_40[0xf] = '\0'; local_48 = 0; pvStack_44 = (void *)0x0; acStack_40[0] = '\0'; acStack_40[1] = '\0'; acStack_40[2] = '\0'; acStack_40[3] = '\0'; acStack_40[4] = '\0'; acStack_40[5] = '\0'; acStack_40[6] = '\0'; acStack_40[7] = '\0'; local_30 = 0; local_58 = 0x3f800000; local_54 = 0x3f800000; local_50 = 0x3f800000; render_color_stack_push(); } bVar4 = IsHoldingItem(costumeSprite); if ((((bVar4 == 0) || ((costumeSprite->_bodySprite)._animState._animData == (void *)0x0)) || (pvVar8 = AnimationState::GetNullFrameById(&(costumeSprite->_bodySprite)._animState,0), pvVar8 == (void *)0x0)) || ((*(char *)((int)pvVar8 + 0xc) == '\0' || (costumeSprite->_playerType != 0x20)))) { bVar4 = IsFullSpriteRendering(costumeSprite); if (bVar4 == 0) { local_78 = (Vector *)(g_displayPixelRatio * g_screenPointScale); local_a4.y = (g_screenHeight - 182.0) * 0.5; local_80.y = (((costumeSprite->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_78 + 0.5; dVar14 = floor((double)local_80.y); local_8c.y = (float)dVar14; local_80.y = (((costumeSprite->_pos).y - 140.0) * 0.65 + local_a4.y) * (float)local_78 + 0.5; dVar14 = floor((double)local_80.y); local_80.y = (float)dVar14; pVVar9 = &costumeSprite->_renderPosition; fVar13 = offset->y; pVVar9->x = local_8c.y / (float)local_78 + offset->x; (costumeSprite->_renderPosition).y = local_80.y / (float)local_78 + fVar13; bVar4 = IsHeadless(costumeSprite); local_72 = bVar4 == 0; if (bVar4 == 0) { RenderGlow(costumeSprite); } netPlayersBegin = g_manager->_netplayManager; if (((netPlayersBegin != *(NetplayManager *)(g_manager + 1)) && (1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)netPlayersBegin >> 2))) && ((isMainPass != 0 && (((local_71 == 0 && (g_manager[1]._persistentGameData._achievements[2] != 0)) && (bVar4 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,costumeSprite->_controllerIndex), bVar4 != 0)))) )) { get_netplay_player_color(); render_color_stack_push(); uVar11 = 0; do { Isaac::GetAxisAlignedUnitVectorFromDir(&local_80,uVar11); local_84 = (Vector *)local_80.y; local_78 = (Vector *)local_80.x; if (local_72 != '\0') { local_a4.x = local_80.x + pVVar9->x; local_a4.y = local_80.y + (costumeSprite->_renderPosition).y; FUN_0078e130(); } local_8c.x = (float)local_78 + pVVar9->x; local_8c.y = (float)local_84 + (costumeSprite->_renderPosition).y; RenderBody(costumeSprite,&local_8c); if (local_72 != '\0') { local_9c.x = (float)local_78 + pVVar9->x; local_9c.y = (float)local_84 + (costumeSprite->_renderPosition).y; RenderHead(costumeSprite,&local_9c); } local_94 = (float)local_78 + pVVar9->x; local_90 = (byte *)((float)local_84 + (costumeSprite->_renderPosition).y); RenderTop(costumeSprite); uVar11 = uVar11 + 1; } while (uVar11 < 4); g_colorStackSize = g_colorStackSize - 1; if (g_colorStackSize == 0) { DAT_00c78dbc = 0; } } if (local_72 == '\0') { RenderBody(costumeSprite,pVVar9); } else { FUN_0078e130(); RenderBody(costumeSprite,pVVar9); RenderHead(costumeSprite,pVVar9); } RenderTop(costumeSprite); } else { local_a4.y = (costumeSprite->_posOffset).x; local_8c.y = (costumeSprite->_posOffset).y; (costumeSprite->_posOffset).x = g_vectorZero.x; pVVar9 = (Vector *)g_vectorZero.y; (costumeSprite->_posOffset).y = g_vectorZero.y; AnimationState::SetAnimationData(&(costumeSprite->_sprite)._overlayAnimState,(void *)0x0); netPlayersBegin = g_manager->_netplayManager; if (((netPlayersBegin == *(NetplayManager *)(g_manager + 1)) || ((uint)((int)*(NetplayManager *)(g_manager + 1) - (int)netPlayersBegin >> 2) < 2)) || (((isMainPass == 0 || ((local_71 != 0 || (g_manager[1]._persistentGameData._achievements[2] == 0)))) || (bVar4 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,costumeSprite->_controllerIndex), bVar4 == 0)))) { LAB_0078c2c7: Entity::Render((Entity *)costumeSprite,offset); if (isMainPass != 0) goto LAB_0078c2d5; } else { get_netplay_player_color(); render_color_stack_push(); uVar11 = 0; do { pVVar9 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_9c,uVar11); local_80.x = offset->x + pVVar9->x; pVVar9 = (Vector *)(pVVar9->y + offset->y); local_80.y = (float)pVVar9; Entity::Render((Entity *)costumeSprite,&local_80); uVar11 = uVar11 + 1; } while (uVar11 < 4); g_colorStackSize = g_colorStackSize - 1; if (g_colorStackSize != 0) goto LAB_0078c2c7; DAT_00c78dbc = 0; Entity::Render((Entity *)costumeSprite,offset); LAB_0078c2d5: bVar4 = IsHoldingItem(costumeSprite); if (bVar4 != 0) { bVar4 = IsLocalPlayer(costumeSprite); if (bVar4 == 0) { FUN_00925df0(); local_78 = pVVar9; } local_80.y = (costumeSprite->_heldSprite)._color._tint[3]; (costumeSprite->_heldSprite)._color._tint[3] = local_80.y * (float)local_78; ANM2::Render(&costumeSprite->_heldSprite,&costumeSprite->_renderPosition,&g_vectorZero,&g_vectorZero); (costumeSprite->_heldSprite)._color._tint[3] = local_80.y; } } (costumeSprite->_posOffset).x = local_a4.y; (costumeSprite->_posOffset).y = local_8c.y; } } else { local_84 = (Vector *)(costumeSprite->_posOffset).x; local_90 = (byte *)(costumeSprite->_posOffset).y; (costumeSprite->_posOffset).x = g_vectorZero.x; (costumeSprite->_posOffset).y = g_vectorZero.y; AnimationState::SetAnimationData(&(costumeSprite->_sprite)._overlayAnimState,(void *)0x0); local_a4.y = (costumeSprite->_pos).y + (costumeSprite->_posOffset).y; local_8c.y = (g_screenHeight - 182.0) * 0.5; local_78 = (Vector *)(g_displayPixelRatio * g_screenPointScale); local_80.y = ((((costumeSprite->_pos).x + (costumeSprite->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_78 + 0.5; dVar14 = floor((double)local_80.y); local_9c.y = (float)dVar14; local_80.y = ((local_a4.y - 140.0) * 0.65 + local_8c.y) * (float)local_78 + 0.5; dVar14 = floor((double)local_80.y); local_80.y = (float)dVar14; fVar13 = offset->y; pVVar9 = &costumeSprite->_renderPosition; pVVar9->x = local_9c.y / (float)local_78 + offset->x; (costumeSprite->_renderPosition).y = local_80.y / (float)local_78 + fVar13; Sprite::RenderLayer((Sprite *)&costumeSprite->_sprite,2,pVVar9,&g_vectorZero,&g_vectorZero); Sprite::RenderLayer((Sprite *)&costumeSprite->_sprite,4,pVVar9,&g_vectorZero,&g_vectorZero); Sprite::RenderLayer((Sprite *)&costumeSprite->_sprite,0xc,pVVar9,&g_vectorZero,&g_vectorZero); costumeMapEntry = costumeSprite->_playerCostumeMap; iVar12 = 3; do { costumeMapEntry = costumeMapEntry + 1; if (-1 < costumeMapEntry->_index) { Sprite::RenderLayer((Sprite *) (costumeMapEntry->_index * 0x130 + (int)(costumeSprite->_costumeSpriteDescs)._begin),costumeMapEntry->_layerID, &costumeSprite->_renderPosition,&g_vectorZero,&g_vectorZero); } iVar12 = iVar12 + -1; } while (iVar12 != 0); if ((isMainPass != 0) && (bVar4 = IsHoldingItem(costumeSprite), bVar4 != 0)) { ANM2::Render(&costumeSprite->_heldSprite,&costumeSprite->_renderPosition,&g_vectorZero,&g_vectorZero); } (costumeSprite->_posOffset).x = (float)local_84; (costumeSprite->_posOffset).y = (float)local_90; } if ((local_71 != 0) && (g_colorStackSize = g_colorStackSize - 1, g_colorStackSize == 0)) { DAT_00c78dbc = 0; } } if (((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (g_manager[1]._persistentGameData._achievements[1] != 0)) && (1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2))) { if (1 < *(int *)&g_game->_deathmatchManager) { iVar12 = FUN_0090b070(); if (iVar12 == 0) { localPlayer = (Entity_Player *)0x0; } else { FUN_0090b070(); localPlayer = (Entity_Player *)FUN_004253d0(); } if ((localPlayer != costumeSprite) && (bVar4 = IsInvisible(costumeSprite), bVar4 != 0)) goto LAB_0078c8fc; } if ((isMainPass != 0) && (iVar12 = FUN_0090b010(), iVar12 != 0)) { local_a4.x = (costumeSprite->_renderPosition).x + 0.0; font = &g_manager->_font1_TeamMeatEx10; local_a4.y = (costumeSprite->_renderPosition).y + 5.0; profileRef = FUN_00a23920(); pbVar10 = user_profile_format_display_name(profileRef,font,0x7d); FUN_00a1a580(); local_8 = 4; KColor::SetFromARGB(&local_28,0xffffffff); local_80.x = 0.5; local_80.y = 0.5; Font::DrawString(font,pbVar10,&local_a4,&local_80,color,&local_48); local_8 = 0xffffffff; } } LAB_0078c8fc: if (((*(char *)&costumeSprite[1]._damageEvents._end == '\0') || (costumeSprite[1]._damageEvents._capacity != (void *)0x15)) || (fVar13 = (costumeSprite->_velocity).y, fVar1 = (costumeSprite->_velocity).x, fVar1 * fVar1 + fVar13 * fVar13 <= 0.1)) { local_80.x = (costumeSprite->_renderPosition).x + 0.0; local_80.y = (costumeSprite->_renderPosition).y - (costumeSprite->_bodyScale).y * 52.0; Game::Update(); } ExceptionList = local_10; return; } //@@ 0078ca00 Entity_Player::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Player vftable slot 5 (Entity::Render); IsInvisible, GetFlyingOffset, Font::DrawString prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::Render(Entity_Player *this,Vector *offset) { byte bVar1; short sVar2; float *extraout_EAX; Entity_Player *localPlayer; float *pfVar3; void *pvVar4; Vector *pVVar5; KColor *color; undefined4 extraout_EDX; undefined4 extraout_EDX_00; undefined4 uVar6; Manager *manager; int iVar7; uint afterImageIdx; float fVar8; float fVar9; float fVar10; float fVar11; float shadowHeight; double dVar12; undefined1 auStack_164 [24]; undefined4 uStack_14c; KColor *imageRefCount; undefined1 auStack_12a [2]; float local_120; float local_11c; float local_118; float local_114; float local_110; float local_10c; float local_108; float local_104; KColor drawColor; Vector local_9c; float local_94; float local_90; Entity_Player *local_8c; Vector *renderOffset; Vector renderPos; float netplayAlpha; float heldScaleX; float heldOffsetY; float heldScaleY; uint isHeldBehind; float local_68; float local_64; char isHolding; float local_5c; float local_58; float local_54; Vector local_50; Vector local_48; ColorMod tmpColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Game *game; int *heldEntity; int shadowImageHeight; local_8 = -NAN; puStack_c = &LAB_00aff61d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&tmpColor)[1]._colorize; renderOffset = offset; local_8c = this; if (this->_variant == 2) { if (this->_target == (EntityPtr)0x0) { return; } } else if (this->_target == (EntityPtr)0x0) { local_64 = offset->x; local_54 = offset->y; if ((this->_flags & 0x200000000000000) == 0) { local_64 = local_64 + (this->_posOffset).x * 0.65; local_54 = local_54 + (this->_posOffset).y * 0.65; } ExceptionList = &local_10; renderPos.x = local_64; renderPos.y = local_54; if (this->_canFly != 0) { GetFlyingOffset(this,&local_9c); renderPos.x = local_64 + *extraout_EAX; renderPos.y = local_54 + extraout_EAX[1]; } fVar9 = 1.0; netplayAlpha = 1.0; manager = g_manager; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar1 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerIndex); manager = g_manager; if (bVar1 == 0) { FUN_00925df0(); netplayAlpha = fVar9; } } if (this->_visible == 0) { ExceptionList = local_10; return; } if ((((0 < this->_damageCooldown) && (this->_damageCooldown % 6 < 3)) && (bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) && ((g_game->_challenge != 0x1e && (bVar1 = Entity::HasEntityFlags((Entity *)this,0x1000000000), bVar1 == 0)))) { ExceptionList = local_10; return; } if (((manager->_netplayManager != *(NetplayManager *)(manager + 1)) && (1 < (uint)((int)*(NetplayManager *)(manager + 1) - (int)manager->_netplayManager >> 2))) && ((bVar1 = IsInvisible(this), bVar1 == 0 || (localPlayer = (Entity_Player *)FUN_0090b0e0(), localPlayer == this)))) { iVar7 = *(int *)(*(int *)this->_shadowImage + 0x10); shadowImageHeight = *(int *)(*(int *)this->_shadowImage + 0x14); local_54 = (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]); local_90 = (float)((double)shadowImageHeight + __uint_to_double_fixup[-(shadowImageHeight >> 0x1f)]); FUN_00682260(); local_5c = this->_shadowSize * (this->_sprite)._scale.x; if (0.001 <= local_5c) { get_netplay_player_color(); bVar1 = IsLocalPlayer(this); if (bVar1 == 0) { tmpColor._tint[3] = netplayAlpha; } local_64 = g_displayPixelRatio * g_screenPointScale; local_50.y = ((((this->_pos).x + (this->_shadowOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_64 + 0.5; dVar12 = floor((double)local_50.y); local_58 = (float)dVar12 / local_64; local_50.y = ((((this->_pos).y + (this->_shadowOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_64 + 0.5; dVar12 = floor((double)local_50.y); game = g_game; local_50.y = (float)dVar12; fVar9 = local_5c * local_54; shadowHeight = local_5c * local_90; fVar11 = local_50.y / local_64; local_48.x = fVar9; local_48.y = shadowHeight; KColor::SetFromARGB(&drawColor,0xffffffff); pVVar5 = &local_48; local_50.x = (local_58 + renderOffset->x + (game->_screenShakeOffset).x) - fVar9 * 0.5; local_50.y = (fVar11 + renderOffset->y + (game->_screenShakeOffset).y) - shadowHeight * 0.5; imageRefCount = color; render_quad_set_rect(&local_120,&local_50,pVVar5,color); KAGE::SmartPointer::operator_assign(auStack_12a + -10,this->_shadowImage); apply_sprite_shader_params(&tmpColor,1,pVVar5,imageRefCount); drawColor._unk = 0; drawColor._red = tmpColor._tint[0]; drawColor._green = tmpColor._tint[1]; drawColor._blue = tmpColor._tint[2]; drawColor._alpha = tmpColor._tint[3]; (**(code **)(**(int **)this->_shadowImage + 0x1c))(); this = local_8c; } } pvVar4 = this->_heldEntity; isHolding = pvVar4 != (void *)0x0; heldOffsetY = 0.0; local_64 = 0.0; heldScaleX = g_vectorOne.x; local_9c.y = *(float *)((int)g_game->_room + 0x12bc); heldScaleY = g_vectorOne.y; local_58 = 0.0; isHeldBehind = isHeldBehind & 0xffffff00; if (pvVar4 == (void *)0x0) goto LAB_0078d290; isHeldBehind = *(uint *)((int)pvVar4 + 0x354) >> 0x1f; if ((this->_itemState == 0x25c) || (1 < this->_suplexState)) { if ((this->_bodySprite)._animState._animData == (void *)0x0) { LAB_0078ced5: if (1 < this->_suplexState) { pfVar3 = ANM2::GetLayerFrame(&this->_sprite,0); uVar6 = extraout_EDX_00; if (pfVar3 != (float *)0x0) goto LAB_0078cef6; } isHolding = '\0'; goto LAB_0078d290; } pfVar3 = AnimationState::GetNullFrameById(&(this->_bodySprite)._animState,0); uVar6 = extraout_EDX; if (pfVar3 == (float *)0x0) goto LAB_0078ced5; LAB_0078cef6: local_64 = *pfVar3; heldOffsetY = pfVar3[1]; if (1 < this->_suplexState) { heldScaleX = pfVar3[4]; heldScaleY = pfVar3[5]; isHeldBehind = CONCAT31((int3)((uint)uVar6 >> 8),this->_suplexState == 4); local_58 = pfVar3[0x11]; local_50.y = *(float *)((int)this->_heldEntity + 0x7c); if (local_50.y != 0.0) { local_90 = INFINITY; local_54 = INFINITY; local_5c = 0.0; if (*(int *)((int)local_50.y + 0x1c) != 0) { iVar7 = 0; do { local_48.y = (float)ANM2::GetLayer((ANM2 *)((int)this->_heldEntity + 0x48), *(byte **)(iVar7 + *(int *)((int)local_50.y + 0x18) )); pvVar4 = AnimationState::GetLayerFrame ((AnimationState *)((int)this->_heldEntity + 0x78), *(int *)(iVar7 + *(int *)((int)local_50.y + 0x18))); if (pvVar4 != (void *)0x0) { uStack_14c = 0x78cfdf; render_build_sprite_quad (&local_120,&g_vectorZero,pvVar4,(LayerState *)local_48.y,&g_vectorZero, &g_vectorZero,(ANM2 *)((int)this->_heldEntity + 0x48)); fVar9 = local_120; if (local_90 <= local_120) { fVar9 = local_90; } fVar11 = local_11c; if (local_54 <= local_11c) { fVar11 = local_54; } if (local_110 < fVar9) { fVar9 = local_110; } else { } if (local_10c < fVar11) { fVar11 = local_10c; } else { } if (local_118 < fVar9) { fVar9 = local_118; } else { } if (local_114 < fVar11) { fVar11 = local_114; } else { } local_90 = local_108; if (fVar9 <= local_108) { local_90 = fVar9; } local_54 = local_104; if (fVar11 <= local_104) { local_54 = fVar11; } } iVar7 = iVar7 + 0x10; local_5c = (float)((int)local_5c + 1); } while ((uint)local_5c < (uint)*(float *)((int)local_50.y + 0x1c)); } sVar2 = fdclass(); if (sVar2 < 1) { fVar9 = heldScaleY * 0.2 * local_54; if (local_58 == 0.0) { heldOffsetY = heldOffsetY - fVar9; } else { heldOffsetY = heldOffsetY + fVar9; } } } } } pvVar4 = this->_heldEntity; if (((pvVar4 != (void *)0x0) && (*(char *)((int)pvVar4 + 0x171) == '\0')) && ((char)isHeldBehind != '\0')) { local_48.y = *(float *)((int)pvVar4 + 0xe4); local_5c = *(float *)((int)pvVar4 + 0xe8); local_50.y = *(float *)((int)pvVar4 + 0xfc); local_54 = *(float *)((int)pvVar4 + 0xec); *(float *)((int)pvVar4 + 0xe4) = heldScaleX * local_48.y; *(float *)((int)pvVar4 + 0xe8) = heldScaleY * local_5c; *(float *)((int)this->_heldEntity + 0xec) = local_54 + local_58; bVar1 = IsLocalPlayer(this); if (bVar1 == 0) { *(float *)((int)this->_heldEntity + 0xfc) = local_50.y * netplayAlpha; } *(undefined1 *)((int)this->_heldEntity + 0x171) = 1; heldEntity = this->_heldEntity; local_94 = ((this->_pos).x - (float)heldEntity[0xcf]) * 0.65 + renderPos.x + local_64; local_90 = ((this->_pos).y - (float)heldEntity[0xd0]) * 0.65 + renderPos.y + heldOffsetY; (**(code **)(*heldEntity + 0x14))(); *(undefined1 *)((int)this->_heldEntity + 0x171) = 0; pvVar4 = this->_heldEntity; *(float *)((int)pvVar4 + 0xe4) = local_48.y; *(float *)((int)pvVar4 + 0xe8) = local_5c; *(float *)((int)this->_heldEntity + 0xec) = local_54; *(float *)((int)this->_heldEntity + 0xfc) = local_50.y; } LAB_0078d290: tmpColor._tint[0] = (this->_sprite)._color._tint[0]; tmpColor._tint[1] = (this->_sprite)._color._tint[1]; tmpColor._tint[2] = (this->_sprite)._color._tint[2]; tmpColor._tint[3] = (this->_sprite)._color._tint[3]; tmpColor._offset[2] = (this->_sprite)._color._offset[2]; afterImageIdx = 0; tmpColor._colorize[0] = (this->_sprite)._color._colorize[0]; tmpColor._colorize[1] = (this->_sprite)._color._colorize[1]; tmpColor._colorize[2] = (this->_sprite)._color._colorize[2]; tmpColor._colorize[3] = (this->_sprite)._color._colorize[3]; tmpColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; if ((this->_afterImageFrames)._size != 0) { do { local_50.y = (float)(this->_afterImageFrames)._offset; fVar9 = (float)**(int **)((int)(this->_afterImageFrames)._map + (afterImageIdx + (int)local_50.y & (this->_afterImageFrames)._mapSize - 1) * 4) / 10.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } tmpColor._tint[3] = fVar9 * (this->_sprite)._color._tint[3] * netplayAlpha; render_color_stack_push(); local_50.y = (float)(this->_afterImageFrames)._offset; iVar7 = *(int *)((int)(this->_afterImageFrames)._map + ((int)local_50.y + afterImageIdx & (this->_afterImageFrames)._mapSize - 1) * 4); local_48.x = (*(float *)(iVar7 + 4) - (this->_pos).x) * 0.65 + renderPos.x; local_48.y = (*(float *)(iVar7 + 8) - (this->_pos).y) * 0.65 + renderPos.y; Render(this,&local_48,0); g_colorStackSize = g_colorStackSize - 1; if (g_colorStackSize == 0) { DAT_00c78dbc = 0; } afterImageIdx = afterImageIdx + 1; } while (afterImageIdx < (this->_afterImageFrames)._size); } Render(this,&renderPos,1); if (((isHolding != '\0') && (pvVar4 = this->_heldEntity, pvVar4 != (void *)0x0)) && ((*(char *)((int)pvVar4 + 0x171) == '\0' && ((char)isHeldBehind == '\0')))) { local_50.y = *(float *)((int)pvVar4 + 0xfc); local_48.y = *(float *)((int)pvVar4 + 0xe4); local_5c = *(float *)((int)pvVar4 + 0xe8); local_54 = *(float *)((int)pvVar4 + 0xec); *(float *)((int)pvVar4 + 0xe4) = heldScaleX * local_48.y; *(float *)((int)pvVar4 + 0xe8) = heldScaleY * local_5c; *(float *)((int)this->_heldEntity + 0xec) = local_54 + local_58; bVar1 = IsLocalPlayer(this); if (bVar1 == 0) { *(float *)((int)this->_heldEntity + 0xfc) = local_50.y * netplayAlpha; } *(undefined1 *)((int)this->_heldEntity + 0x171) = 1; heldEntity = this->_heldEntity; local_68 = ((this->_pos).x - (float)heldEntity[0xcf]) * 0.65 + renderPos.x + local_64; local_64 = ((this->_pos).y - (float)heldEntity[0xd0]) * 0.65 + renderPos.y + heldOffsetY; (**(code **)(*heldEntity + 0x14))(); *(undefined1 *)((int)this->_heldEntity + 0x171) = 0; pvVar4 = this->_heldEntity; *(float *)((int)pvVar4 + 0xe4) = local_48.y; *(float *)((int)pvVar4 + 0xe8) = local_5c; *(float *)((int)this->_heldEntity + 0xec) = local_54; *(float *)((int)this->_heldEntity + 0xfc) = local_50.y; } FUN_00864210(); if ((this->_playerHUD != (void *)0x0) && ((local_9c.y == 1.4013e-45 || (local_9c.y == 4.2039e-45)))) { local_48.x = (this->_renderPosition).x + 0.0; local_48.y = (this->_renderPosition).y - (this->_playerSpriteScale).y * 30.0; FUN_0084a870(); } if ((1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)) && (((local_9c.y == 1.4013e-45 || (local_9c.y == 4.2039e-45)) && (*(int *)&g_game->_roomTransition == 0)))) { iVar7 = PlayerManager::GetPlayerSlotFromController (&g_game->_playerManager,this->_controllerIndex); if (-1 < iVar7) { local_50.y = g_displayPixelRatio * g_screenPointScale; fVar9 = (g_manager->_optionsConfig)._hudOffset; local_54 = fVar9 * 12.0 + 16.0; local_5c = fVar9 * 28.0 + 10.0; local_48.y = ((g_screenWidth - 338.0) * 0.5 + ((this->_pos).x - 60.0) * 0.65) * local_50.y + 0.5; dVar12 = floor((double)local_48.y); local_64 = (float)dVar12 / local_50.y; local_48.y = (((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_50.y + 0.5; dVar12 = floor((double)local_48.y); local_48.y = (float)dVar12; local_64 = local_64 + *(float *)((int)g_game->_room + 0x1204); local_58 = local_48.y / local_50.y + *(float *)((int)g_game->_room + 0x1208); fVar9 = local_64; if (local_64 <= g_vectorZero.x) { fVar9 = g_vectorZero.x; } if (g_screenWidth + 0.0 <= fVar9) { fVar9 = g_screenWidth + 0.0; } fVar11 = local_58; if (local_58 <= g_vectorZero.y) { fVar11 = g_vectorZero.y; } if (g_screenHeight + 10.0 <= fVar11) { fVar11 = g_screenHeight + 10.0; } fVar9 = sqrtf((local_58 - fVar11) * (local_58 - fVar11) + (local_64 - fVar9) * (local_64 - fVar9)); fVar11 = (fVar9 - 30.0) / 250.0; if (fVar11 <= 0.0) { fVar11 = 0.0; } if (1.0 <= fVar11) { fVar11 = 1.0; } fVar8 = local_5c + g_vectorZero.x + 0.0; fVar10 = (fVar9 - 10.0) / 140.0; fVar9 = local_64; if (local_64 <= fVar8) { fVar9 = fVar8; } if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } fVar8 = ((g_screenWidth - local_5c) - 0.0) + 0.0; if (fVar8 <= fVar9) { fVar9 = fVar8; } fVar8 = local_54 + g_vectorZero.y + 10.0; if (local_58 <= fVar8) { local_58 = fVar8; } fVar8 = ((g_screenHeight - local_54) - 10.0) + 35.0; if (fVar8 <= local_58) { local_58 = fVar8; } if (0.0 < fVar10 + 0.0) { iVar7 = this->_playerType; fVar8 = ((2.0 - fVar11) - 2.0) * -1.0; local_50.x = fVar9 - (2.0 - fVar11) * 0.5; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } local_50.y = (-18.0 - (fVar8 + fVar8)) + local_58; get_netplay_player_color(auStack_164,local_8c); HUD::render_player_type_icon(iVar7,&local_50); this = local_8c; } } } if ((this->_dead == 0) && ((local_9c.y == 1.4013e-45 || (local_9c.y == 4.2039e-45)))) { render_charge_bars(this,&this->_renderPosition); if (((this->_statusEffectSprite)._loaded != 0) && (((this->_statusEffectSprite)._animState._animData != (void *)0x0 && ((this->_statusEffectSprite)._animState._isPlaying != 0)))) { local_48.y = (this->_statusEffectSprite)._color._tint[3]; pfVar3 = &(this->_playerSpriteScale).y; fVar9 = *pfVar3; (this->_statusEffectSprite)._color._tint[3] = local_48.y * netplayAlpha; pVVar5 = &this->_playerSpriteScale; if (fVar9 < (this->_playerSpriteScale).x) { pVVar5 = (Vector *)pfVar3; } fVar11 = pVVar5->x * g_vectorOne.x; (this->_statusEffectSprite)._scale.y = pVVar5->x * g_vectorOne.y; (this->_statusEffectSprite)._scale.x = fVar11; local_50.x = fVar9 * 0.0 + (this->_renderPosition).x; local_50.y = fVar9 * -35.0 + (this->_renderPosition).y; ANM2::Render(&this->_statusEffectSprite,&local_50,&g_vectorZero,&g_vectorZero); (this->_statusEffectSprite)._color._tint[3] = local_48.y; } } if ((*(int *)&this->field_0x1c5c != 0) && (0 < g_game->_hallucinationTimer)) { HallucinationOverlay::Render(); } if (*(int *)&g_game->_deathmatchManager < 2) { ExceptionList = local_10; return; } (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x5c))(); ExceptionList = local_10; return; } ExceptionList = &local_10; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar1 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerIndex); if (bVar1 == 0) goto LAB_0078dbfd; } local_50.y = g_displayPixelRatio * g_screenPointScale; local_48.y = (((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_50.y + 0.5; local_5c = ((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; dVar12 = floor((double)local_48.y); local_8c = (Entity_Player *)((float)dVar12 / local_50.y); local_48.y = local_5c * local_50.y + 0.5; dVar12 = floor((double)local_48.y); local_48.y = (float)dVar12; tmpColor._colorize[0] = 1.4013e-45; tmpColor._colorize[1] = 9.18341e-41; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 1.0; tmpColor._offset[0] = -NAN; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; local_8 = 0.0; drawColor._unk = 0; drawColor._red = 1.0; drawColor._green = 0.6; drawColor._blue = 0.6; drawColor._alpha = 1.0; Font::DrawString(); LAB_0078dbfd: ExceptionList = local_10; return; } //@@ 0078dc20 Entity_Player::RenderShadowLayer /* DB: vftable slot 6 */ byte Entity_Player::RenderShadowLayer(Vector *param_1) { byte bVar1; Entity_Player *in_ECX; bVar1 = HasCollectible(in_ECX,0x1b1,0); if (bVar1 == 0) { bVar1 = Entity::RenderShadowLayer((Entity *)in_ECX,param_1); return bVar1; } return 1; } //@@ 0078dc60 Entity_Player::RenderGlow /* ZHL [lua] Lua binding EntityPlayer:RenderGlow */ void __thiscall Entity_Player::RenderGlow(Entity_Player *this,Vector *param_2) { int iVar1; byte bVar2; LayerState *pLVar3; ANM2 *this_00; int extraout_EDX; int extraout_EDX_00; float fVar4; byte *layerName; float local_8; if (this->_visible != 0) { bVar2 = IsFullSpriteRendering(this); if (bVar2 == 0) { iVar1 = this->_playerCostumeMap[0]._index; if (iVar1 < 0) { pLVar3 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); local_8 = (pLVar3->_color)._tint[3]; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { fVar4 = local_8; bVar2 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,this->_controllerIndex); if (bVar2 == 0) { ANM2::GetLayer(&this->_sprite,(byte *)0x0); FUN_00925df0(); *(float *)(extraout_EDX_00 + 0x54) = fVar4 * local_8; } } Sprite::RenderLayer((Sprite *)&this->_sprite,0,param_2,&g_vectorZero,&g_vectorZero); layerName = (byte *)0x0; this_00 = &this->_sprite; } else { pLVar3 = ANM2::GetLayer((ANM2 *)(iVar1 * 0x130 + (int)(this->_costumeSpriteDescs)._begin), (byte *)this->_playerCostumeMap[0]._layerID); local_8 = (pLVar3->_color)._tint[3]; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { fVar4 = local_8; bVar2 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,this->_controllerIndex); if (bVar2 == 0) { ANM2::GetLayer((ANM2 *)(this->_playerCostumeMap[0]._index * 0x130 + (int)(this->_costumeSpriteDescs)._begin), (byte *)this->_playerCostumeMap[0]._layerID); FUN_00925df0(); *(float *)(extraout_EDX + 0x54) = fVar4 * local_8; } } Sprite::RenderLayer((Sprite *) (this->_playerCostumeMap[0]._index * 0x130 + (int)(this->_costumeSpriteDescs)._begin), this->_playerCostumeMap[0]._layerID,param_2,&g_vectorZero,&g_vectorZero) ; layerName = (byte *)this->_playerCostumeMap[0]._layerID; this_00 = (ANM2 *)(this->_playerCostumeMap[0]._index * 0x130 + (int)(this->_costumeSpriteDescs)._begin); } pLVar3 = ANM2::GetLayer(this_00,layerName); (pLVar3->_color)._tint[3] = local_8; } } return; } //@@ 0078dde0 Entity_Player::RenderBody /* ZHL [exact] __thiscall void Entity_Player::RenderBody(Vector *position); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::RenderBody(Entity_Player *this,Vector *position) { int *piVar1; int iVar2; bool bVar3; byte bVar4; int iVar5; void *pvVar6; uint layerId; float fVar7; float local_14; Vector local_10; if ((this->_visible != 0) && (bVar4 = IsFullSpriteRendering(this), bVar4 == 0)) { fVar7 = 0.0; local_14 = 0.0; layerId = 1; bVar3 = false; do { iVar5 = this->_playerCostumeMap[layerId]._index; if (iVar5 < 0) { Sprite::RenderLayer((Sprite *)&this->_sprite,layerId,position,&g_vectorZero,&g_vectorZero); bVar3 = true; fVar7 = local_14; } else { if ((this->_canFly == 0) || (*(char *)(iVar5 * 0x130 + 0x11d + (int)(this->_costumeSpriteDescs)._begin) != '\0')) { if (layerId == 1) { local_10.x = (float)(iVar5 * 0x130); piVar1 = *(int **)((int)local_10.x + 0x114 + (int)(this->_costumeSpriteDescs)._begin); if (piVar1 != (int *)0x0) { iVar2 = *piVar1; if (iVar2 == 0) { if (piVar1[1] - 0x4bU < 4) { local_14 = *(float *)((int)local_10.x + 0xa0 + (int)(this->_costumeSpriteDescs)._begin) * -15.0; goto LAB_0078dedb; } } else if ((((iVar2 == 1) || (iVar2 == 3)) || (iVar2 == 4)) && (piVar1[1] == 0x271)) { local_14 = *(float *)((int)local_10.x + 0xa0 + (int)(this->_costumeSpriteDescs)._begin) * -65.0; LAB_0078dedb: if (fVar7 <= local_14) { local_14 = fVar7; } } } } Sprite::RenderLayer((Sprite *)(iVar5 * 0x130 + (int)(this->_costumeSpriteDescs)._begin), this->_playerCostumeMap[layerId]._layerID,position,&g_vectorZero, &g_vectorZero); iVar5 = this->_playerCostumeMap[layerId]._index * 0x130; pvVar6 = (this->_costumeSpriteDescs)._begin; fVar7 = local_14; if (((*(int *)(iVar5 + 0x34 + (int)pvVar6) != 0) && (pvVar6 = AnimationState::GetLayerFrame ((AnimationState *)((int)pvVar6 + iVar5 + 0x30), this->_playerCostumeMap[layerId]._layerID), pvVar6 != (void *)0x0 )) && (*(char *)((int)pvVar6 + 0x2c) != '\0')) { bVar3 = true; goto LAB_0078df80; } } } LAB_0078df80: layerId = layerId + 1; } while (layerId < 4); if ((bVar3) && (bVar4 = IsHeadless(this), bVar4 != 0)) { local_10.x = position->x + 0.0; local_10.y = local_14 * 0.65 + position->y; Sprite::RenderLayer((Sprite *)&this->_bloodGushSprite,0,&local_10,&g_vectorZero,&g_vectorZero) ; } } return; } //@@ 0078dff0 Entity_Player::RenderHead /* ZHL [exact] __thiscall void Entity_Player::RenderHead(Vector *position); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::RenderHead(Entity_Player *this,Vector *position) { byte bVar1; uint layerId; Sprite *this_00; AnimationState *pAVar2; uint uVar3; int *piVar4; if (this->_visible != 0) { bVar1 = IsFullSpriteRendering(this); if (bVar1 == 0) { uVar3 = 4; piVar4 = &this->_playerCostumeMap[4]._layerID; do { if (((PlayerCostumeMap *)(piVar4 + -1))->_index < 0) { this_00 = (Sprite *)&this->_sprite; layerId = uVar3; } else { this_00 = (Sprite *) (((PlayerCostumeMap *)(piVar4 + -1))->_index * 0x130 + (int)(this->_costumeSpriteDescs)._begin); layerId = *piVar4; } Sprite::RenderLayer(this_00,layerId,position,&g_vectorZero,&g_vectorZero); uVar3 = uVar3 + 1; piVar4 = piVar4 + 4; } while (uVar3 < 0xb); bVar1 = HasCollectible(this,0x1ba,0); if ((bVar1 != 0) && ((this->_darkPrincesCrownSprite)._loaded != 0)) { if ((this->_darkPrincesCrownSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_darkPrincesCrownSprite)._animState,position,&g_vectorZero, &g_vectorZero); pAVar2 = &(this->_darkPrincesCrownSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_darkPrincesCrownSprite)._overlayAnimState,position,&g_vectorZero, &g_vectorZero); pAVar2 = &(this->_darkPrincesCrownSprite)._animState; } AnimationState::Render(pAVar2,position,&g_vectorZero,&g_vectorZero); } bVar1 = HasCollectible(this,0x19f,0); if ((bVar1 != 0) && ((this->_crownOfLightSprite)._loaded != 0)) { if ((this->_crownOfLightSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_crownOfLightSprite)._animState,position,&g_vectorZero,&g_vectorZero); pAVar2 = &(this->_crownOfLightSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_crownOfLightSprite)._overlayAnimState,position,&g_vectorZero, &g_vectorZero); pAVar2 = &(this->_crownOfLightSprite)._animState; } AnimationState::Render(pAVar2,position,&g_vectorZero,&g_vectorZero); } } } return; } //@@ 0078e130 FUN_0078e130 void FUN_0078e130(Vector *param_1) { int iVar1; byte bVar2; Entity_Player *in_ECX; if (in_ECX->_visible != 0) { bVar2 = Entity_Player::IsFullSpriteRendering(in_ECX); if (bVar2 == 0) { iVar1 = in_ECX->_playerCostumeMap[0xe]._index; if (-1 < iVar1) { Sprite::RenderLayer((Sprite *)(iVar1 * 0x130 + (int)(in_ECX->_costumeSpriteDescs)._begin), in_ECX->_playerCostumeMap[0xe]._layerID,param_1,&g_vectorZero, &g_vectorZero); return; } Sprite::RenderLayer((Sprite *)&in_ECX->_sprite,0xe,param_1,&g_vectorZero,&g_vectorZero); } } return; } //@@ 0078e190 Entity_Player::RenderTop /* ZHL [lua] Lua binding EntityPlayer:RenderTop */ void __thiscall Entity_Player::RenderTop(Entity_Player *this,Vector *param_2) { int iVar1; byte bVar2; if (this->_visible != 0) { bVar2 = IsFullSpriteRendering(this); if (bVar2 == 0) { iVar1 = this->_playerCostumeMap[0xb]._index; if (-1 < iVar1) { Sprite::RenderLayer((Sprite *)(iVar1 * 0x130 + (int)(this->_costumeSpriteDescs)._begin), this->_playerCostumeMap[0xb]._layerID,param_2,&g_vectorZero, &g_vectorZero); return; } Sprite::RenderLayer((Sprite *)&this->_sprite,0xb,param_2,&g_vectorZero,&g_vectorZero); } } return; } //@@ 0078e1f0 Entity_Player::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix27/30] __thiscall bool Entity_Player::HandleCollision(Entity* collider, bool low); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Player::HandleCollision(Entity_Player *this,Entity *collider,byte low) { byte bVar1; char cVar2; int iVar3; Vector *pVVar4; uint uVar5; Entity *spawned; EntityPtr *parentSlot; uint uVar6; void *tempEffect; EntityPtr itemOwner; float fVar7; float fVar8; float fVar9; undefined3 in_stack_00000009; Entity_Knife *itemOwner; int *piVar10; undefined4 uVar11; Vector VStack_e4; undefined4 uStack_dc; Vector VStack_d0; byte bStack_c5; Vector VStack_c4; Vector VStack_bc; EntityRef playerRef; Vector VStack_8c; undefined1 hitParams [16]; int iStack_74; int iStack_70; int iStack_6c; int iStack_68; undefined4 uStack_64; uint local_c; int *colliderType; qword flags; uint *flagsHighPtr; Manager *manager; local_c = __security_cookie ^ (uint)&VStack_d0; uStack_dc = _low; VStack_e4.y = (float)collider; VStack_e4.x = (float)this; iVar3 = LuaEngine::PrePlayerCollide(); if (iVar3 == 1) { return 1; } if (iVar3 == -1) { return 0; } colliderType = &collider->_type; if (((((*(int *)&g_game->_deathmatchManager < 2) || (*colliderType != 1)) && (0x3dd < *colliderType - 10U)) || (((collider->_flags & 0x2000000000000) == 0 || (bVar1 = Entity::HasEntityFlags(collider,0x800000000000), bVar1 != 0)))) || (fVar7 = (this->_velocity).y, fVar8 = (this->_velocity).x, fVar8 * fVar8 + fVar7 * fVar7 <= 0.001)) goto LAB_0078e48c; VStack_bc.x = (collider->_pos).x - (this->_pos).x; VStack_bc.y = (collider->_pos).y - (this->_pos).y; Vector::Normalize(&VStack_bc); Vector::Normalized(&this->_velocity,&VStack_d0); VStack_c4.x = VStack_d0.x + VStack_bc.x; VStack_c4.y = VStack_d0.y + VStack_bc.y; pVVar4 = Vector::Normalized(&VStack_c4,&VStack_8c); VStack_bc.x = pVVar4->x * 18.0; VStack_bc.y = pVVar4->y * 18.0; if (this == (Entity_Player *)0x0) { playerRef._type = 0; playerRef._variant = 0; playerRef._spawnerType = 0; playerRef._spawnerVariant = 0; playerRef._position.x = g_vectorZero.x; playerRef._position.y = g_vectorZero.y; playerRef._velocity.x = g_vectorZero.x; playerRef._velocity.y = g_vectorZero.y; LAB_0078e417: playerRef._flags = 0; if (this != (Entity_Player *)0x0) goto LAB_0078e41d; playerRef._flags = 0; LAB_0078e439: VStack_c4.x = 0.0; if (this != (Entity_Player *)0x0) goto LAB_0078e445; LAB_0078e45e: uVar5 = 0; } else { playerRef._type = this->_type; playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; if ((this->_flags & 0x100) == 0) goto LAB_0078e417; playerRef._flags = 1; LAB_0078e41d: if ((this->_flags & 0x20000000) == 0) goto LAB_0078e439; VStack_c4.x = 2.8026e-45; LAB_0078e445: if ((this->_flags & 0x40000000000000) == 0) goto LAB_0078e45e; uVar5 = 4; } playerRef._flags = uVar5 | (uint)VStack_c4.x | playerRef._flags; playerRef._entity = this; Entity::AddKnockback(collider,&playerRef,&VStack_bc,200,1); LAB_0078e48c: if (((this->_playerType == 0x16) && (bVar1 = Entity::IsVulnerableEnemy(collider,(Entity *)0x0), bVar1 != 0)) && ((this->_maggySwingCooldown < 3 && (bVar1 = Entity::HasEntityFlags(collider,0x20000000), bVar1 == 0)))) { VStack_d0.x = this->_meleeDamage; uVar11 = 0; uVar5 = Random(); GetTearHitParams(hitParams,10,(VStack_d0.x + VStack_d0.x) / this->_damage,(uVar5 & 1) * 2 + -1, uVar11); uVar5 = Random(); VStack_d0.x = (this->_pos).x; VStack_d0.y = (this->_pos).y; spawned = Game::SpawnEx(g_game,8,1,&VStack_d0,&g_vectorZero,(Entity *)this,4,uVar5,0); parentSlot = &spawned->_parent; if (spawned->_parent != (EntityPtr)0x0) { VStack_e4.x = (float)parentSlot; std::multiset::erase(&VStack_e4); } *parentSlot = (EntityPtr)this; std::multiset::insert(parentSlot); (spawned->_targetPosition).x = 6.0; (spawned->_targetPosition).y = 0.0; VStack_e4.x = (collider->_pos).x - (this->_pos).x; VStack_e4.y = (collider->_pos).y - (this->_pos).y; pVVar4 = Vector::ToCardinal((Vector *)&playerRef._position.y,&VStack_e4); fVar7 = atan2f(pVVar4->y,pVVar4->x); piVar10 = (int *)0x0; itemOwner = (Entity_Knife *)0xff; (spawned->_posOffset).x = 0.0; (spawned->_posOffset).y = -14.0; iVar3 = *(int *)spawned; spawned[1]._variant = (int)(fVar7 * 57.295776); (**(code **)(iVar3 + 0x3c))(&playerRef._entity,0xffffffff,0xff,0,1); piVar10[0x39] = (int)(this->_sprite)._scale.x; piVar10[0x3a] = (int)(this->_sprite)._scale.y; piVar10[0x104] = iStack_74; piVar10[0x105] = iStack_70; piVar10[0x106] = iStack_6c; piVar10[0x107] = iStack_68; (**(code **)(*piVar10 + 0x40))(uStack_64); flags = itemOwner->_flags; flagsHighPtr = (uint *)((int)&itemOwner->_flags + 4); *flagsHighPtr = *flagsHighPtr | 4; *(int *)&itemOwner->_flags = (int)flags; Entity_Knife::SetAttackAnimation(itemOwner); (**(code **)(*(int *)itemOwner + 0xc))(); this->_maggySwingCooldown = 9; } bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x271); if (bVar1 != 0) { bVar1 = Entity::IsEnemy(collider); if ((bVar1 == 0) || (bVar1 = Entity::HasEntityFlags(collider,0x20000000), bVar1 != 0)) { if (*colliderType == 6) { bVar1 = EntityList::HitListContains((EntityList *)&this->_contactHitList,collider); if (bVar1 == 0) { uVar5 = Entity::GetHitListIndex(collider); sorted_vector_insert_unique(&this->_contactHitList,uVar5); playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; VStack_d0.x = *(float *)(*(int *)collider + 0x20); playerRef._type = this->_type; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_c4.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_c4.x; playerRef._entity = this; (*(code *)VStack_d0.x)(0x42a00000,0x1000004,0,&playerRef,0x1e); } } else if ((*colliderType == 5) && (bVar1 = EntityList::HitListContains((EntityList *)&this->_contactHitList,collider), bVar1 == 0)) { uVar5 = Entity::GetHitListIndex(collider); sorted_vector_insert_unique(&this->_contactHitList,uVar5); playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; VStack_d0.x = *(float *)(*(int *)collider + 0x20); playerRef._type = this->_type; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_c4.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_c4.x; playerRef._entity = this; (*(code *)VStack_d0.x)(0x42a00000,0x1000004,0,&playerRef,0x1e); } } else { bVar1 = EntityList::HitListContains((EntityList *)&this->_contactHitList,collider); if (bVar1 == 0) { uVar5 = Entity::GetHitListIndex(collider); sorted_vector_insert_unique(&this->_contactHitList,uVar5); if (*(int *)&g_game->_deathmatchManager < 2) { uVar11 = 0x42a00000; } else { uVar11 = 0x41200000; } playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; VStack_d0.x = *(float *)(*(int *)collider + 0x20); playerRef._type = this->_type; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_c4.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_c4.x; playerRef._entity = this; (*(code *)VStack_d0.x)(uVar11,0x1000000,0,&playerRef,0x1e); } } } if (((this->_playerType == 0x28) && (*colliderType == 1)) && (collider[4]._prevPosition.y == 4.90454e-44)) { bVar1 = Entity::HasEntityFlags(collider,0x600000000000000); if (bVar1 != 0) { return 1; } if (*(char *)g_game->_room == '\0') { return 1; } if (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 2) { return 1; } TryHoldEntity(this,collider); } if (this->_suplexState < 3) { if (this->_suplexState == 1) { VStack_c4.x = (float)*colliderType; if (VStack_c4.x == 1.26117e-44) { return 1; } bVar1 = Entity::IsEnemy(collider); if ((bVar1 != 0) || (VStack_c4.x == 5.60519e-45)) { if (VStack_c4.x == 4.62428e-44) { playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; VStack_d0.x = *(float *)(*(int *)collider + 0x20); playerRef._type = this->_type; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_c4.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_c4.x; playerRef._entity = this; (*(code *)VStack_d0.x)(0x447a0000,0,0,&playerRef,0x1e); } else { bVar1 = TryHoldEntity(this,collider); manager = g_manager; if (bVar1 != 0) { this->_itemState = 0x2c5; this->_suplexAimCountdown = 0x3c; this->_suplexState = 2; VStack_c4.x = 1.44474e-42; seed_fart_sound_override((int *)&VStack_c4); SoundEffects::Play(&manager->_sfxManager,(int)VStack_c4.x,1.0,2,0,1.0,0.0); uVar5 = Random(); play_sound_with_fart_seed (0xf9,1.0,2,0, (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); return 1; } } } } } else { bVar1 = Entity::IsEnemy(collider); if ((bVar1 != 0) || (*colliderType == 9)) { return 1; } } VStack_c4.x = (float)((uint)VStack_c4.x & 0xffffff00); bVar1 = Entity::IsVulnerableEnemy(collider,(Entity *)0x0); if (bVar1 != 0) { fVar7 = 0.0; bStack_c5 = 0 < this->_ponyCharge; bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x2ca); VStack_c4.x = (float)(uint)bStack_c5; if (bVar1 != 0) { VStack_c4.x = 1.4013e-45; } if ((*colliderType == 1) && (*(int *)&g_game->_deathmatchManager == 4)) { iVar3 = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x54))(this,collider); fVar7 = (float)iVar3; bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x5d); if (bVar1 != 0) { playerRef._type = this->_type; playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_d0.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_d0.x; playerRef._entity = this; Entity::AddFear(collider,&playerRef,-0x3c,0); } } bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x4d); if (((((bVar1 != 0) || (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x5d), bVar1 != 0 )) || (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x53), bVar1 != 0)) || ((bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,299), bVar1 != 0 && (tempEffect = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,299), *(int *)((int)tempEffect + 8) != 0)))) && (this[1]._chargeBarSprites[0]._color._tint[0] == 0.0)) { fVar7 = fVar7 + 20.0; if (collider->_health <= 40.0) { fVar7 = fVar7 + 20.0; } if ((1 < *(int *)&g_game->_deathmatchManager) && (*colliderType == 1)) { fVar7 = 15.0; this[1]._chargeBarSprites[0]._color._tint[0] = 4.2039e-44; } } bVar1 = HasCollectible(this,0x1e,0); if (bVar1 != 0) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar8 = 12.0; } else { fVar8 = 2.0; } fVar7 = fVar8 + fVar7; } bVar1 = HasCollectible(this,0xd,0); if (bVar1 != 0) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar8 = 12.0; } else { fVar8 = 1.0; } fVar7 = fVar8 + fVar7; } bVar1 = HasCollectible(this,0x189,0); if (bVar1 != 0) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar8 = 12.0; } else { fVar8 = 1.0; } fVar7 = fVar8 + fVar7; } if ((this->_playerType != 0x28) || (itemOwner = this->_twinPlayer, this->_twinPlayer == (EntityPtr)0x0)) { itemOwner = (EntityPtr)this; } bVar1 = HasCollectible((Entity_Player *)itemOwner,0x114,0); if (bVar1 != 0) { fVar7 = this->_meleeDamage + this->_meleeDamage + fVar7; } bVar1 = HasCollectible(this,0xca,0); if (bVar1 != 0) { playerRef._position.x = (this->_pos).x; iVar3 = 0x5a; playerRef._position.y = (this->_pos).y; playerRef._type = this->_type; playerRef._velocity.x = (this->_velocity).x; if (1 < *(int *)&g_game->_deathmatchManager) { iVar3 = 0x2d; } playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.y = (this->_velocity).y; VStack_d0.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_d0.x; playerRef._entity = this; Entity::AddMidasFreeze(collider,&playerRef,iVar3,0); fVar7 = (float)this->_numCoins * 0.2 + 3.5 + fVar7; } if ((this->_variant == 1) && (this->_babySkin == 0xc)) { fVar7 = fVar7 + 10.0; } bVar1 = HasCollectible(this,0x1f7,0); if (bVar1 != 0) { fVar7 = fVar7 + 3.5; } bStack_c5 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x146); if (bStack_c5 != 0) { fVar7 = fVar7 + 3.5; } bVar1 = HasCollectible(this,300,0); if (((bVar1 != 0) || (iVar3 = GetZodiacEffect(this), iVar3 == 300)) && (fVar8 = (this->_velocity).y, fVar9 = (this->_velocity).x, fVar8 = sqrtf(fVar9 * fVar9 + fVar8 * fVar8), 4.0 < fVar8)) { iVar3 = this->_damageCooldown; if (iVar3 < 1) { flags = this->_flags; flagsHighPtr = (uint *)((int)&this->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x10; *(int *)&this->_flags = (int)flags; } VStack_d0.x = 2.8026e-45; pVVar4 = &VStack_d0; if (1 < iVar3) { pVVar4 = (Vector *)&this->_damageCooldown; } this->_damageCooldown = (int)pVVar4->x; if (*(int *)&g_game->_deathmatchManager < 2) { fVar8 = 25.0; } else { fVar8 = 10.0; } fVar7 = fVar8 + fVar7; this->_mass = 1000.0; } bVar1 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x3b); if (bVar1 != 0) { if (*(int *)&g_game->_deathmatchManager < 2) { fVar8 = 40.0; } else { fVar8 = 15.0; } fVar7 = fVar8 + fVar7; } bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000); if (bVar1 != 0) { fVar7 = fVar7 * 3.0 + 5.0; } if (0.0 < fVar7) { playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; playerRef._type = this->_type; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_d0.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { playerRef._flags = 0; } else { playerRef._flags = 4; } playerRef._flags = uVar5 | (uint)VStack_d0.x | playerRef._flags; playerRef._entity = this; cVar2 = (**(code **)(*(int *)collider + 0x20))(fVar7,0x40,0,&playerRef,0xf); if ((cVar2 != '\0') && (bStack_c5 != 0)) { iVar3 = _get_index_plus_one_if_kind_4_5(); VStack_d0.y = (collider->_pos).y - (this->_pos).y; VStack_bc.x = (float)iVar3 * 2.1 + 15.0; VStack_d0.x = (collider->_pos).x - (this->_pos).x; pVVar4 = Vector::Resized(&VStack_d0,&VStack_8c,this->_size); VStack_8c.y = (this->_pos).y + pVVar4->y; VStack_8c.x = (this->_pos).x + pVVar4->x; bVar1 = HasCollectible(this,0x3b,0); if (bVar1 == 0) { uVar5 = Random(); spawned = Game::SpawnEx(g_game,1000,0x13,&VStack_8c,&g_vectorZero,(Entity *)this,0,uVar5,0 ); parentSlot = &spawned->_parent; if (spawned->_parent != (EntityPtr)0x0) { VStack_d0.x = (float)parentSlot; std::multiset::erase(&VStack_d0); } *parentSlot = (EntityPtr)this; std::multiset::insert(parentSlot); (**(code **)(*(int *)spawned + 0x40))(VStack_bc.x); VStack_bc.x = -g_vectorOne.x; VStack_bc.y = -g_vectorOne.y; Entity::SetSize(spawned,80.0, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); spawned->_subtype = 1; } iVar3 = this->_damageCooldown; if (iVar3 < 1) { flags = this->_flags; flagsHighPtr = (uint *)((int)&this->_flags + 4); *flagsHighPtr = *flagsHighPtr | 0x10; *(int *)&this->_flags = (int)flags; } VStack_bc.x = 2.10195e-44; pVVar4 = &VStack_bc; if (0xe < iVar3) { pVVar4 = (Vector *)&this->_damageCooldown; } this->_damageCooldown = (int)pVVar4->x; } } } bVar1 = Entity::IsActiveEnemy(collider,0); if ((bVar1 != 0) && ((((bVar1 = HasCollectible(this,0xd,0), bVar1 != 0 || (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0xd), bVar1 != 0)) || (bVar1 = HasCollectible(this,0x189,0), bVar1 != 0)) && ((bVar1 = Entity::HasEntityFlags(collider,1), bVar1 == 0 && (bVar1 = Entity::HasEntityFlags(collider,0x20000000), bVar1 == 0)))))) { bVar1 = HasCollectible(this,0x189,0); if (bVar1 != 0) { uVar11 = *(undefined4 *)((int)&collider->_flags + 4); *(uint *)&collider->_flags = (uint)collider->_flags | 0x800000; *(undefined4 *)((int)&collider->_flags + 4) = uVar11; } fVar7 = (float)this->_redHearts; if (1 < *(int *)&g_game->_deathmatchManager) { fVar8 = (float)this->_redHearts * 0.125 * 0.1; fVar7 = 1.0; if (1.0 <= fVar8) { fVar7 = fVar8; } } collider->_bossStatusEffectCooldown = 0; VStack_bc.x = fVar7 * 0.05 * fVar7 + 2.0; Entity::CopyStatusEffects(collider); playerRef._type = this->_type; playerRef._position.x = (this->_pos).x; playerRef._position.y = (this->_pos).y; playerRef._variant = this->_variant; playerRef._spawnerType = this->_spawnerType; playerRef._spawnerVariant = this->_spawnerVariant; playerRef._velocity.x = (this->_velocity).x; playerRef._velocity.y = (this->_velocity).y; VStack_d0.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar5 = 0; } else { uVar5 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } playerRef._flags = uVar6 | uVar5 | (uint)VStack_d0.x; playerRef._entity = this; Entity::AddPoison(collider,&playerRef,0x3c,VStack_bc.x,0); } if ((((this->_playerType == 0x23) && (VStack_c4.x._0_1_ == '\0')) && (bVar1 = Entity::IsEnemy(collider), bVar1 != 0)) && ((bVar1 = Entity::HasEntityFlags((Entity *)this,0x400000000000000), bVar1 != 0 && (bVar1 = Entity::HasEntityFlags(collider,0x20000000), bVar1 == 0)))) { (this->_velocity).x = (this->_velocity).x * 0.5; (this->_velocity).y = (this->_velocity).y * 0.5; } bVar1 = Entity::IsEnemy(collider); if (((bVar1 != 0) && (bVar1 = Entity::HasEntityFlags(collider,0x100), bVar1 == 0)) && (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x251), bVar1 != 0)) { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x251,-1); VStack_8c.x = (this->_pos).x - (collider->_pos).x; VStack_8c.y = (this->_pos).y - (collider->_pos).y; pVVar4 = Vector::Normalized(&VStack_8c,&VStack_bc); fVar7 = (this->_velocity).y; fVar8 = (this->_velocity).x; fVar9 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7); fVar7 = pVVar4->x; fVar8 = pVVar4->y; this->_marsUnk2 = -1; (this->_velocity).x = fVar9 * fVar7; (this->_velocity).y = fVar9 * fVar8; dash_impact(this); } return VStack_c4.x._0_1_; } //@@ 0078f840 Entity_Player::RemoveCollectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:RemoveCollectible prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Entity_Player::RemoveCollectible (Entity_Player *this,uint CollectibleType,byte IgnoreModifiers,uint ActiveSlot, byte RemoveFromPlayerForm) { byte bVar1; char isFormItem; int iVar2; ActiveItemDesc *activeDesc; ItemConfig_Item *tmpItem; void *pvVar3; uint slot; uint uVar4; uint *_Dst; int *piVar5; int *local_38; ItemConfig_Item *itemConfig; int historyEntry; void *local_2c; uint uStack_28; char acStack_24 [12]; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *proceduralDesc; Entity_Player *proceduralOwner; void **voidedEnd; local_8 = 0xffffffff; puStack_c = &LAB_00aff665; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(acStack_24 + 0x20); if (CollectibleType == 0) { return; } ExceptionList = &local_10; itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,CollectibleType); if (itemConfig == (ItemConfig_Item *)0x0) { ExceptionList = local_10; return; } if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { InvalidateCoPlayerItems(this); } if (IgnoreModifiers == 0) { if ((itemConfig->type == 3) && (((int)ActiveSlot < 0 || (iVar2 = GetBatteryCharge(this,ActiveSlot), iVar2 == 0x1dd)))) { for (_Dst = (this->_voidedCollectibles)._begin; _Dst != (this->_voidedCollectibles)._end; _Dst = _Dst + 1) { if (*_Dst == CollectibleType) { local_38 = (int *)this->_playerIndex; ItemConfig_Item::GetLocalizedName(itemConfig,(std_string *)&local_2c,0); tmpItem = itemConfig; local_8 = 0; KAGE_LogMessage(1,(byte *)"Removing voided collectible %d (%s) from player %d (%s)\n"); local_8 = 0xffffffff; if (0xf < uStack_18) { uVar4 = uStack_18 + 1; pvVar3 = local_2c; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_2c + -4); uVar4 = uStack_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } memmove(_Dst,_Dst + 1,(int)(this->_voidedCollectibles)._end - (int)(_Dst + 1)); voidedEnd = &(this->_voidedCollectibles)._end; *voidedEnd = (void *)((int)*voidedEnd + -4); this->_cacheFlags = this->_cacheFlags | tmpItem->cacheFlags; EvaluateItems(); ExceptionList = local_10; return; } } } if (((this->_valid == 0) || (this->_backupPlayer == (Entity_Player *)0x0)) || (bVar1 = HasCollectible(this->_backupPlayer,CollectibleType,1), bVar1 == 0)) goto LAB_0078fa44; if (itemConfig->type != 3) { RemoveCollectible(this->_backupPlayer,CollectibleType,0,0,1); if (((CollectibleType == 0xee) || (CollectibleType == 0xef)) || ((CollectibleType == 0x272 || (CollectibleType == 0x273)))) { this->_cacheFlags = this->_cacheFlags | itemConfig->cacheFlags; EvaluateItems(); ExceptionList = local_10; return; } ExceptionList = local_10; return; } LAB_0078fa4c: if ((int)ActiveSlot < 0) { ExceptionList = local_10; return; } if (3 < (int)ActiveSlot) { ExceptionList = local_10; return; } } else { LAB_0078fa44: if (itemConfig->type == 3) goto LAB_0078fa4c; } local_38 = (int *)this->_playerIndex; ItemConfig_Item::GetLocalizedName(itemConfig,(std_string *)&local_2c,0); local_8 = 1; KAGE_LogMessage(1,(byte *)"Removing collectible %d (%s) from player %d (%s)\n"); local_8 = 0xffffffff; if (0xf < uStack_18) { uVar4 = uStack_18 + 1; pvVar3 = local_2c; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_2c + -4); uVar4 = uStack_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } acStack_24[8] = '\0'; acStack_24[9] = '\0'; acStack_24[10] = '\0'; acStack_24[0xb] = '\0'; uStack_18 = 0xf; local_2c = (void *)((uint)local_2c & 0xffffff00); if ((int)CollectibleType < 0) { FUN_009e0450(CollectibleType); } else { piVar5 = (int *)((int)(this->_collectibleCounts)._begin + CollectibleType * 4); iVar2 = *piVar5; if (iVar2 < 1) { piVar5 = (this->_proceduralItems)._itemIds._head; local_38 = (int *)*piVar5; if (local_38 != piVar5) { do { uVar4 = ~local_38[4]; if ((local_38[4] < 0) && (piVar5 = (this->_proceduralItems)._itemIds._head, (int)uVar4 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)(g_game->_proceduralItemManager)._proceduralItems._begin >> 2)) { piVar5 = (this->_proceduralItems)._itemIds._head; iVar2 = *(int *)((int)(g_game->_proceduralItemManager)._proceduralItems._begin + uVar4 * 4); if (((iVar2 != 0) && (proceduralDesc = *(int **)(iVar2 + 0x10), proceduralDesc != (int *)0x0)) && ((((iVar2 = *proceduralDesc, iVar2 == 1 || (iVar2 == 3)) || (iVar2 == 4)) && (proceduralDesc[1] == CollectibleType)))) { if ((local_38[4] != 0) && (proceduralOwner = (this->_proceduralItems)._player, proceduralOwner != (Entity_Player *)0x0)) { RemoveCollectible(proceduralOwner,local_38[4],0,0,1); } break; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_38); } while (local_38 != piVar5); } } else { *piVar5 = iVar2 + -1; } } slot = 0; uVar4 = 4; if (((-1 < (int)ActiveSlot) && (ActiveSlot < 4)) && (this->_activeDesc[ActiveSlot]._item == CollectibleType)) { uVar4 = ActiveSlot + 1; slot = ActiveSlot; } if (slot < uVar4) { activeDesc = this->_activeDesc + slot; do { if (activeDesc->_item == CollectibleType) { this->_activeDesc[slot]._batteryCharge = 0; this->_activeDesc[slot]._item = 0; if (slot == 0) { SwapActiveItems(); } break; } slot = slot + 1; activeDesc = activeDesc + 1; } while (slot < uVar4); } TriggerCollectibleRemoved(this,CollectibleType); if (CollectibleType == 0x76) { iVar2 = GetCollectibleNum(this,0x76,0); if (iVar2 < 2) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU) < 0xb5) { RemoveCostume(this,(ItemConfig_Item *)0x0); } else { RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar3 + 0xb4)); } } } else if (CollectibleType == 0x299) { iVar2 = GetCollectibleNum(this,0x299,0); if (iVar2 < 2) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU) < 0x1f5) { RemoveCostume(this,(ItemConfig_Item *)0x0); } else { RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar3 + 500)); } } } else if (CollectibleType == 0x2da) { iVar2 = GetCollectibleNum(this,0x2da,0); if (iVar2 < 2) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU) < 0x1f9) { RemoveCostume(this,(ItemConfig_Item *)0x0); } else { RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar3 + 0x1f8)); } } } else if ((int)CollectibleType < 0) goto LAB_0078fda9; tmpItem = itemConfig; if (*(int *)((int)(this->_collectibleCounts)._begin + CollectibleType * 4) < 1) { if ((itemConfig->addCostumeOnPickup != 0) && (bVar1 = HasCollectible(this,CollectibleType,0), bVar1 == 0)) { RemoveCostume(this,tmpItem); } if (CollectibleType == 0x251) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU) < 0xe9) { tmpItem = (ItemConfig_Item *)0x0; } else { tmpItem = *(ItemConfig_Item **)((int)pvVar3 + 0xe8); } RemoveCostume(this,tmpItem); } } LAB_0078fda9: if (RemoveFromPlayerForm != 0) { uVar4 = 0; do { if (((-1 < (int)uVar4) && (pvVar3 = (g_manager->_itemConfig)._playerForms._begin, (int)uVar4 < (int)(g_manager->_itemConfig)._playerForms._end - (int)pvVar3 >> 2)) && (iVar2 = *(int *)((int)pvVar3 + uVar4 * 4), iVar2 != 0)) { if ((*(int *)(iVar2 + 8) != 0 || *(int *)(iVar2 + 0xc) != 0) && (isFormItem = FUN_0072fe80(*(int *)(iVar2 + 8),*(int *)(iVar2 + 0xc)), isFormItem != '\0' )) { IncrementPlayerFormCounter(this,uVar4,-1); } } uVar4 = uVar4 + 1; } while (uVar4 < 0x10); } local_2c = (void *)((uint)local_2c & 0xffffff00); uStack_28 = CollectibleType; historyEntry = g_game->_frameCount; acStack_24[0] = '\x01'; acStack_24[1] = '\0'; acStack_24[2] = '\0'; acStack_24[3] = '\0'; acStack_24[4] = '\0'; acStack_24[5] = '\0'; acStack_24[6] = '\0'; acStack_24[7] = '\0'; acStack_24[8] = '\x01'; acStack_24[9] = '\0'; acStack_24[10] = '\0'; acStack_24[0xb] = '\0'; uStack_18 = 0; FUN_00721b70(&historyEntry); tmpItem = itemConfig; this->_cacheFlags = this->_cacheFlags | itemConfig->cacheFlags; bVar1 = HasCollectible(this,0x298,0); if ((bVar1 != 0) && ((tmpItem->tags & 0x40000) != 0)) { pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 & 0xfffffffcU) < 0xa61) { iVar2 = 0; } else { iVar2 = *(int *)((int)pvVar3 + 0xa60); } this->_cacheFlags = this->_cacheFlags | *(uint *)(iVar2 + 0x54); } EvaluateItems(); UpdateBookOfVirtues(this,0); ExceptionList = local_10; return; } //@@ 0078fec0 Entity_Player::RemoveCollectibleByHistoryIndex /* ZHL [exact] __thiscall void Entity_Player::RemoveCollectibleByHistoryIndex(int index, bool RemovedBool); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::RemoveCollectibleByHistoryIndex(Entity_Player *this,int index,byte RemovedBool) { byte bVar1; void *pvVar2; int iVar3; char cVar4; if (((-1 < index) && (pvVar2 = (this->_history)._historyItems._begin, index < ((int)(this->_history)._historyItems._end - (int)pvVar2) / 0x1c)) && (*(char *)((int)pvVar2 + index * 0x1c + 4) == '\0')) { iVar3 = *(int *)((int)pvVar2 + index * 0x1c + 8); if (iVar3 < 0) { cVar4 = collectible_set_has(iVar3); if (cVar4 != '\0') goto LAB_0078ff31; } else if (0 < *(int *)((int)(this->_collectibleCounts)._begin + iVar3 * 4)) { LAB_0078ff31: bVar1 = (this->_history)._isLocked; (this->_history)._isLocked = 1; RemoveCollectible(this,*(uint *)((int)pvVar2 + index * 0x1c + 8),1,0,1); (this->_history)._isLocked = bVar1; History::RemoveHistoryItemByIndex(&this->_history,index); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); return; } } return; } //@@ 0078ff90 Entity_Player::TriggerCollectibleRemoved /* DB: REPENTOGON asm hook EntityPlayer_RecomputeWispCollectibles_TriggerCollectibleRemoved: the call followed by "cmp byte [edi+..],0 / je / push 0 / push" is exactly the call site in 0x7d7740; per-item removal side effects (Magic Mushroom 0xc RemoveCostume, Dead Cat 0x51, Heartbreak 0x2b6 AddBrokenHearts, Starter Deck 0xfb GetMaxPocketItems) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::TriggerCollectibleRemoved(Entity_Player *this,int collectibleID) { char isUserTracked; byte bVar1; int iVar2; uint uVar3; Vector *spawnPos; ItemConfig_Item *itemConfig; RNG *itemRng; uint uVar4; uint uVar5; short newCatLives; QueueItemData *srcSlot; int *pocketSlot; longlong netUserId; int *local_1c; int excessPockets; uint slotIndex; Vector freePosOut; Game *game; void *nullItems; game = g_game; if ((*(int *)&g_game->_deathmatchManager < 2) && (this != (Entity_Player *)0x0)) { netUserId = player_get_net_user_id(this); local_1c = (int *)((ulonglong)netUserId >> 0x20); if ((netUserId != -1) && ((*(int *)&g_game->_deathmatchManager < 2 && (game->field_0x1c030 == '\0')))) { isUserTracked = FUN_00425a70(netUserId); if (isUserTracked == '\0') { online_stats_add_user((int)netUserId,local_1c); } iVar2 = FUN_00426560((int)netUserId,local_1c); if (iVar2 != 0) { *(float *)(iVar2 + 0x14) = *(float *)(iVar2 + 0x14) - 1.0; } } } if (collectibleID < 0x12f) { if ((collectibleID == 0x12e) || (collectibleID == 0xc)) { IncrementPlayerFormCounter(this,0xd,-1); } else if (collectibleID == 0x51) { iVar2 = GetCollectibleNum(this,0x51,0); newCatLives = this->_deadCatLives; if (iVar2 * 9 < (int)this->_deadCatLives) { newCatLives = (short)(iVar2 * 9); } this->_deadCatLives = newCatLives; } } else if (collectibleID == 0x2b6) { AddBrokenHearts(this,-3); } iVar2 = GetCollectibleNum(this,collectibleID,0); if (0 < iVar2) { return; } if (collectibleID < 0xfc) { if (collectibleID == 0xfb) { switchD_0079018f_caseD_fc: uVar3 = GetMaxPocketItems(this); uVar4 = (uint)(this->_pocketSlots[0] != 0); uVar5 = uVar4 + 1; if (this->_pocketSlots[2] == 0) { uVar5 = uVar4; } uVar4 = uVar5 + 1; if (this->_pocketSlots[4] == 0) { uVar4 = uVar5; } uVar5 = uVar4 + 1; if (this->_pocketSlots[6] == 0) { uVar5 = uVar4; } iVar2 = uVar5 - uVar3; excessPockets = iVar2; if (iVar2 < 1) goto switchD_0079018f_caseD_fd; slotIndex = 3; local_1c = this->_pocketSlots + 6; do { pocketSlot = local_1c; if (iVar2 < 1) break; if ((*local_1c != 0) && (local_1c[1] != 2)) { uVar3 = Random(); uVar5 = *pocketSlot; spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&freePosOut,&this->_pos,40.0,0,0,0); pocketSlot = local_1c; uVar4 = 0x46; if (local_1c[1] == 1) { uVar4 = 300; } Game::SpawnEx(g_game,5,uVar4,spawnPos,&g_vectorZero,(Entity *)this,uVar5,uVar3,0); if (slotIndex < 3) { srcSlot = (QueueItemData *)(pocketSlot + 2); for (uVar5 = (3 - slotIndex) * 2 & 0x3ffffffe; uVar5 != 0; uVar5 = uVar5 - 1) { *pocketSlot = (int)srcSlot->_item; srcSlot = (QueueItemData *)&srcSlot->_charge; pocketSlot = pocketSlot + 1; } pocketSlot = local_1c; } iVar2 = excessPockets + -1; this->_pocketSlots[6] = 0; this->_pocketSlots[7] = 1; excessPockets = iVar2; } slotIndex = slotIndex - 1; local_1c = pocketSlot + -2; } while (-1 < (int)slotIndex); } else { if (collectibleID == 0x23) { switchD_0079018f_caseD_106: IncrementPlayerFormCounter(this,0xf,-1); goto switchD_0079018f_caseD_fd; } if (collectibleID != 0x8b) goto switchD_0079018f_caseD_fd; switchD_0079025a_caseD_1ca: if (this->_trinketsID[1] == 0) goto switchD_0079018f_caseD_fd; uVar3 = Random(); uVar5 = this->_trinketsID[1]; spawnPos = Room::FindFreePickupSpawnPosition(g_game->_room,&freePosOut,&this->_pos,40.0,0,0,0) ; Game::SpawnEx(g_game,5,0x15e,spawnPos,&g_vectorZero,(Entity *)this,uVar5,uVar3,0); this->_trinketsID[1] = 0; } } else { if (collectibleID < 0x1b8) { if (collectibleID == 0x1b7) { bVar1 = HasTrinket(this,0x79,0); if (bVar1 != 0) { remove_wooden_cross_mantles(); } goto switchD_0079018f_caseD_fd; } switch(collectibleID) { case 0xfc: case 0x1a0: goto switchD_0079018f_caseD_fc; case 0x106: goto switchD_0079018f_caseD_106; case 0x122: UseActiveItem(this,(short *)&local_1c,collectibleID,1,-1,0); break; case 0x197: TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x197,1); itemRng = GetCollectibleRNG(this,0x197); uVar5 = RNG::RandomInt(itemRng,4); this->_purityState = uVar5; nullItems = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)nullItems & 0xfffffffcU) < 0x45) { RemoveCostume(this,(ItemConfig_Item *)0x0); } else { RemoveCostume(this,*(ItemConfig_Item **)((int)nullItems + 0x44)); } } goto switchD_0079018f_caseD_fd; } switch(collectibleID) { case 0x1c6: goto switchD_0079018f_caseD_fc; case 0x1ca: goto switchD_0079025a_caseD_1ca; case 0x1f5: update_greeds_gullet(this); break; case 0x232: if ((this[1]._chargeBarSprites[0]._color._offset[2] == 0.0) && (this[1]._chargeBarSprites[0]._championColor._tint[0] == 0.0)) { FUN_007d3e00(); } break; case 0x244: Room::UpdateRedKey(g_game->_room); } } switchD_0079018f_caseD_fd: itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleID); bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,collectibleID); if (((bVar1 != 0) && (itemConfig != (ItemConfig_Item *)0x0)) && (itemConfig->clearEffectsOnRemove != 0)) { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,collectibleID,1); } return; } //@@ 00790530 Entity_Player::DropCollectible /* ZHL [exact] __thiscall Entity_Pickup* Entity_Player::DropCollectible(int collectible, Entity_Pickup* existingCollectible, bool removeFromPlayerForm); prototype: REPENTOGON, confirmed by RET 12 */ Entity_Pickup * __thiscall Entity_Player::DropCollectible (Entity_Player *this,int collectible,Entity_Pickup *existingCollectible, byte removeFromPlayerForm) { void *pvVar1; code *pcVar2; RNG *pRVar3; Entity_Pickup *pEVar4; uint uVar5; Vector *position; void *pvVar6; int iVar7; ActiveItemDesc *pAVar8; uint uVar9; int local_18; Vector local_10; uVar9 = 0x241; if (collectible != 0x290) { uVar9 = collectible; } g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; if (existingCollectible == (Entity_Pickup *)0x0) { pRVar3 = GetCollectibleRNG(this,collectible); uVar5 = pRVar3->_seed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = pRVar3->_seed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); pEVar4 = (Entity_Pickup *)(*pcVar2)(); return pEVar4; } } uVar5 = uVar5 >> ((byte)pRVar3->_shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)pRVar3->_shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)pRVar3->_shift3 & 0x1f) ^ uVar5; pRVar3->_seed = uVar5; position = Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,&this->_pos,40.0,0,0,0); existingCollectible = (Entity_Pickup *) Game::SpawnEx(g_game,5,100,position,&g_vectorZero,(Entity *)this,uVar9,uVar5,0); } else { Entity_Pickup::Morph (existingCollectible,existingCollectible->_type,existingCollectible->_variant,uVar9,0, 1,1); Entity_Pickup::UpdateSprite(existingCollectible,1); } pvVar1 = (this->_history)._historyItems._end; for (pvVar6 = (this->_history)._historyItems._begin; pvVar6 != pvVar1; pvVar6 = (void *)((int)pvVar6 + 0x1c)) { if ((*(char *)((int)pvVar6 + 4) == '\0') && (*(int *)((int)pvVar6 + 8) == collectible)) { if (pvVar6 != pvVar1) { iVar7 = *(int *)((int)pvVar6 + 0x18); goto LAB_00790639; } break; } } iVar7 = 0; LAB_00790639: g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1; uVar9 = 0; existingCollectible->_itemPoolType = iVar7; pAVar8 = this->_activeDesc; do { if (pAVar8->_item == collectible) { local_18 = (int)this->_deadCatLives; if (-1 < (int)uVar9) { existingCollectible->_charge = this->_activeDesc[uVar9]._batteryCharge + this->_activeDesc[uVar9]._charge; existingCollectible->_varData = this->_activeDesc[uVar9]._varData; } goto LAB_007906a6; } uVar9 = uVar9 + 1; pAVar8 = pAVar8 + 1; } while (uVar9 < 4); local_18 = (int)this->_deadCatLives; LAB_007906a6: existingCollectible->_isTouched = 1; RemoveCollectible(this,collectible,1,0,removeFromPlayerForm); if ((collectible == 0x51) && (this->_deadCatLives <= local_18)) { local_18 = local_18 - this->_deadCatLives; iVar7 = 9; if (local_18 < 9) { iVar7 = local_18; } existingCollectible->_charge = iVar7; } return existingCollectible; } //@@ 007906f0 Entity_Player::DropCollectibleByHistoryIndex /* ZHL [exact] __thiscall Entity_Pickup* Entity_Player::DropCollectibleByHistoryIndex(int index, Entity_Pickup* existingCollectible, bool unusedBool); prototype: REPENTOGON, confirmed by RET 12 */ Entity_Pickup * __thiscall Entity_Player::DropCollectibleByHistoryIndex (Entity_Player *this,int index,Entity_Pickup *existingCollectible,byte unusedBool) { byte bVar1; void *pvVar2; Entity_Pickup *pEVar3; if (-1 < index) { pvVar2 = (this->_history)._historyItems._begin; if (((index < ((int)(this->_history)._historyItems._end - (int)pvVar2) / 0x1c) && (*(char *)((int)pvVar2 + index * 0x1c + 4) == '\0')) && (0 < *(int *)((int)(this->_collectibleCounts)._begin + *(int *)((int)pvVar2 + index * 0x1c + 8) * 4))) { bVar1 = (this->_history)._isLocked; (this->_history)._isLocked = 1; pEVar3 = DropCollectible(this,*(int *)((int)pvVar2 + index * 0x1c + 8),existingCollectible,0); (this->_history)._isLocked = bVar1; History::RemoveHistoryItemByIndex(&this->_history,index); return pEVar3; } } return (Entity_Pickup *)0x0; } //@@ 007907a0 Entity_Player::ClearTemporaryEffects /* ZHL [lua] Lua binding EntityPlayer:ClearTemporaryEffects */ void Entity_Player::ClearTemporaryEffects(void) { void *pvVar1; byte isMirrorDimension; Entity_Player *in_ECX; int iVar2; int *piVar3; int *itemConfig; int *collectibleNode; int trinketEffect [3]; undefined4 local_c; uint collectibleId; if ((int)(in_ECX->_temporaryeffects)._effects._end - (int)(in_ECX->_temporaryeffects)._effects._begin >> 4 != 0) { TemporaryEffects::ClearEffects(&in_ECX->_temporaryeffects,0); } iVar2 = in_ECX->_strengthMaxHearts; if (0 < iVar2) { do { if (2 < in_ECX->_soulHearts + in_ECX->_boneHearts * 2 + in_ECX->_maxHearts) { AddMaxHearts(in_ECX,-2,0); } iVar2 = iVar2 + -1; } while (iVar2 != 0); } in_ECX->_strengthMaxHearts = 0; *(undefined4 *)&in_ECX->field_0x170c = 0x3f800000; *(undefined4 *)&in_ECX->field_0x1710 = 0x3f800000; *(undefined4 *)&in_ECX->field_0x1714 = 0x3f800000; *(undefined4 *)&in_ECX->field_0x1718 = 0x3f800000; *(undefined4 *)&in_ECX->field_0x171c = 0; *(undefined4 *)&in_ECX->field_0x1720 = 0; *(undefined4 *)&in_ECX->field_0x1724 = 0; *(undefined4 *)&in_ECX->field_0x1728 = 0; *(undefined4 *)&in_ECX->field_0x172c = 0; *(undefined4 *)&in_ECX->field_0x1730 = 0; *(undefined4 *)&in_ECX->field_0x1734 = 0; if ((in_ECX->_temporaryeffects)._disabled == 0) { for (piVar3 = (in_ECX->_temporaryeffects)._effects._begin; piVar3 != (in_ECX->_temporaryeffects)._effects._end; piVar3 = piVar3 + 4) { if ((*(int *)*piVar3 == 0) && (((int *)*piVar3)[1] == 0x70)) { if (piVar3[1] == 2) { iVar2 = g_game->_currentDimensionIdx; if (*(int *)&g_game->_roomTransition != 0) { iVar2 = (g_game->_roomTransition)._targetDimension; } isMirrorDimension = Level::HasMirrorDimension((Level *)g_game); if ((isMirrorDimension == 0) || (iVar2 == 0)) { TemporaryEffects::RemoveNullEffect(&in_ECX->_temporaryeffects,0x70,-1); pvVar1 = in_ECX->_backupPlayer; if ((pvVar1 != (void *)0x0) && (*(char *)((int)pvVar1 + 0x1519) == '\0')) { piVar3 = *(int **)((int)pvVar1 + 0x150c); goto joined_r0x00790924; } } } break; } } LAB_00790947: if ((in_ECX->_temporaryeffects)._disabled == 0) { for (piVar3 = (in_ECX->_temporaryeffects)._effects._begin; piVar3 != (in_ECX->_temporaryeffects)._effects._end; piVar3 = piVar3 + 4) { if ((*(int *)*piVar3 == 2) && (((int *)*piVar3)[1] == 0xa2)) { if ((piVar3[1] == 1) && ((pvVar1 = (g_manager->_itemConfig)._trinkets._begin, 0x288 < (int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 & 0xfffffffcU ) && (iVar2 = *(int *)((int)pvVar1 + 0x288), iVar2 != 0)))) { trinketEffect[2] = *(undefined4 *)(iVar2 + 0x78); trinketEffect[1] = 0; local_c = 0; trinketEffect[0] = iVar2; TemporaryEffects::RemoveEffect(&in_ECX->_temporaryeffects,trinketEffect,1); } break; } } } } if ((in_ECX->_roomTemporaryCollectibles)._size != 0) { piVar3 = (in_ECX->_roomTemporaryCollectibles)._head; collectibleNode = (int *)*piVar3; if (collectibleNode != piVar3) { do { piVar3 = collectibleNode; collectibleId = collectibleNode[4]; if (g_game == (Game *)0x0) { if (-1 < (int)collectibleId) goto LAB_00790a4a; LAB_00790a64: itemConfig = (int *)0x0; } else if ((int)collectibleId < 0) { if (((int)collectibleId < 0) && (pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~collectibleId < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2)) { itemConfig = (int *)**(undefined4 **)((int)pvVar1 + ~collectibleId * 4); } else { itemConfig = (int *)0x0; } } else { LAB_00790a4a: pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 >> 2 <= (int)collectibleId) goto LAB_00790a64; itemConfig = *(int **)((int)pvVar1 + collectibleId * 4); } if ((*itemConfig != 3) && (iVar2 = 0, 0 < collectibleNode[5])) { do { RemoveCollectible(in_ECX,itemConfig[1],1,0,1); iVar2 = iVar2 + 1; } while (iVar2 < piVar3[5]); } piVar3[5] = 0; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&collectibleNode); piVar3 = (in_ECX->_roomTemporaryCollectibles)._head; } while (collectibleNode != piVar3); } FID_conflict__Erase_tree_>_> (&in_ECX->_roomTemporaryCollectibles, (fuzzer_allocator_> *) &in_ECX->_roomTemporaryCollectibles,(_Tree_node *)piVar3[1]); piVar3[1] = (int)piVar3; *piVar3 = (int)piVar3; piVar3[2] = (int)piVar3; (in_ECX->_roomTemporaryCollectibles)._size = 0; } SetPocketActiveItem(in_ECX,0,3,0); return; joined_r0x00790924: if (piVar3 == *(int **)((int)pvVar1 + 0x1510)) goto LAB_00790947; if ((*(int *)*piVar3 == 0) && (((int *)*piVar3)[1] == 0x70)) { TemporaryEffects::RemoveNullEffect((TemporaryEffects *)((int)pvVar1 + 0x1508),0x70,-1); goto LAB_00790947; } piVar3 = piVar3 + 4; goto joined_r0x00790924; } //@@ 00790af0 Entity_Player::FireTear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:FireTear prototype: db/protos.zhl, confirmed by RET 24 */ Entity_Tear * __thiscall Entity_Player::FireTear (Entity_Player *this,Vector *position,Vector velocity,uint flags,Entity *source, float damageMultiplier) { int iVar1; BitSet128 flags_00; byte bVar2; uint uVar3; Vector *dir; Entity_Laser *techLaser; Entity_Tear *tear; int *tempEffect; int iVar4; EntityPtr *parentRef; uint uVar5; Entity *pEVar6; float unaff_EDI; float intensity; undefined1 uStack_ad; float fVar7; undefined1 auStack_98 [4]; Vector local_94; float local_8c; undefined1 auStack_88 [4]; Vector *firePosition; Vector cardinalDir [5]; undefined4 uStack_58; uint uStack_54; float fStack_50; float fStack_4c; uint uStack_48; float fStack_44; float fStack_3c; float fStack_30; uint local_c; Game *game; local_c = __security_cookie ^ (uint)auStack_98; firePosition = position; if ((this->_variant == 1) && (this->_babySkin == 0x10)) { uVar3 = Random(); pEVar6 = (Entity *)(uVar3 % 3); if (pEVar6 == (Entity *)0x0) { fVar7 = 1.0; bVar2 = 1; dir = Vector::ToCardinal(cardinalDir,&velocity); techLaser = FireTechLaser(this,&this->_pos,0,dir,1,bVar2,pEVar6,fVar7); (**(code **)(*(int *)techLaser + 0xc))(); } } local_8c = firePosition->x; local_94.x = firePosition->y; if ((source != (Entity *)0x0) && ((Entity_Player *)source == this)) { local_8c = local_8c + (this->_tearsOffset).x; local_94.x = local_94.x + (this->_tearsOffset).y; } fVar7 = (float)(int)(char)this->_tearDisplacement; GetTearHitParams(); bVar2 = HasCollectible(this,0x18a,0); if (bVar2 != 0) { uStack_54 = uStack_54 & ~DAT_00c34b40; fStack_50 = (float)((uint)fStack_50 & ~DAT_00c34b44); fStack_4c = (float)((uint)fStack_4c & ~DAT_00c34b48); uStack_48 = uStack_48 & ~DAT_00c34b4c; } if ((flags & 2) != 0) { uStack_54 = uStack_54 & ~DAT_00c34580; fStack_50 = (float)((uint)fStack_50 & ~DAT_00c34584); fStack_4c = (float)((uint)fStack_4c & ~DAT_00c34588); uStack_48 = uStack_48 & ~DAT_00c3458c; } uVar3 = Random(); local_94.x = velocity.x + unaff_EDI; local_94.y = velocity.y + fVar7; pEVar6 = Game::SpawnEx(g_game,2,(uint)local_8c,&local_94,&velocity,(Entity *)this,0,uVar3,0); tear = (Entity_Tear *)__RTDynamicCast(pEVar6,0); (tear->_velocity).y = (tear->_velocity).y * fStack_30; (tear->_velocity).x = (tear->_velocity).x * fStack_30; tear->_height = fStack_3c; fVar7 = Entity_Tear::get_height_offset_y(tear,fStack_3c); game = g_game; (tear->_posOffset).y = fVar7; if ((*(int *)((int)game->_room + 8) == 0x10) && ((tear->_posOffset).y = -18.0, -5.1 < fStack_3c)) { tear->_height = -5.1; } if (((uStack_54 & DAT_00c345b0) == 0 && ((uint)fStack_50 & DAT_00c345b4) == 0) && (((uint)fStack_4c & DAT_00c345b8) == 0 && (uStack_48 & DAT_00c345bc) == 0)) { uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 - this->_tearfallspeed; } else { fVar7 = -this->_tearfallspeed; } tear->_fallingSpeed = fVar7; (**(code **)(*(int *)tear + 0x40))(); flags_00._l._4_4_ = uStack_54; flags_00._l._0_4_ = uStack_58; flags_00._h._0_4_ = fStack_50; flags_00._h._4_4_ = fStack_4c; Entity_Tear::SetTearFlags(tear,flags_00); fVar7 = fStack_44; if (fStack_44 <= 0.01) { fVar7 = 0.01; } tear->_baseScale = fVar7; tear->_fScale = fVar7; Entity_Tear::ResetSpriteScale(tear); uVar3 = 1; tear->_fallingAccel = this->_tearfallaccel; (**(code **)(*(int *)tear + 0x3c))(auStack_88,0xffffffff,0xff); tear->_tearRange = this->_tearrange; if (tear->_parent != (EntityPtr)0x0) { std::multiset::erase(auStack_98 + -0x28); } tear->_parent = (EntityPtr)this; std::multiset::insert(&tear->_parent); if ((uVar3 & 4) != 0) { tear->_canTriggerStreakEnd = 0; } iVar1 = this->_deadEyeCharges; fVar7 = 0.0; if (0 < iVar1) { iVar4 = 8; if (iVar1 < 8) { iVar4 = iVar1; } fVar7 = (float)iVar4 * 0.125; if ((float)iVar4 * 0.125 <= 0.0) { fVar7 = 0.0; } } intensity = fVar7; if ((this->_temporaryeffects)._disabled == 0) { for (tempEffect = (this->_temporaryeffects)._effects._begin; tempEffect != (this->_temporaryeffects)._effects._end; tempEffect = tempEffect + 4) { if ((*(int *)*tempEffect == 0) && (((int *)*tempEffect)[1] == 0x6f)) { iVar1 = tempEffect[1]; if (0 < iVar1) { iVar4 = 0x10; if (iVar1 < 0x10) { iVar4 = iVar1; } intensity = (float)iVar4 * 0.0625; if ((float)iVar4 * 0.0625 <= fVar7) { intensity = fVar7; } } break; } } } bVar2 = HasCollectible(this,0x2db,0); if ((bVar2 != 0) && (0 < (int)fStack_44)) { tear->_fallingAccel = tear->_fallingAccel * 0.5; tear->_fallingSpeed = tear->_fallingSpeed - 4.0; } if (0.0 < intensity) { Entity_Tear::SetDeadEyeIntensity(tear,intensity); } tear->_mass = fStack_50 * tear->_mass; tear->_knockbackMultiplier = fStack_4c; iVar1 = this->_firedTearCount; this->_firedTearCount = iVar1 + 1; tear->_tearIdx = iVar1; (**(code **)(*(int *)tear + 0xc))(); fVar7 = (tear->_velocity).y; (tear->_pos).x = (tear->_pos).x - (tear->_velocity).x; (tear->_pos).y = (tear->_pos).y - fVar7; lua_callback_run_post_fire_tear(tear); bVar2 = HasCollectible(this,0x19a,0); if ((bVar2 != 0) && ((uVar3 & 1) == 0)) { uVar5 = 0x1e - (int)this->_luck; uVar3 = 10; if (10 < (int)uVar5) { uVar3 = uVar5; } if ((uVar3 == 0) || (uVar5 = Random(), uVar5 % uVar3 == 0)) { uVar3 = Random(); pEVar6 = Game::SpawnEx(g_game,1000,0x54,(Vector *)0x1,(Vector *)(auStack_98 + -0x20), (Entity *)0x0,0,uVar3,0); parentRef = &pEVar6->_parent; if (pEVar6->_parent != (EntityPtr)0x0) { std::multiset::erase(auStack_98 + -0x24); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); (**(code **)(*(int *)tear + 0x28))(); } } return tear; } //@@ 007910f0 Entity_Player::GetTotalActiveCharge /* DB: charge+battery of slot plus Bethany soul/blood charge 0x1da8/0x1dac prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetTotalActiveCharge(Entity_Player *this,int slot) { ItemConfig_Item *pIVar1; int iVar2; int iVar3; int iVar4; iVar3 = this->_activeDesc[slot]._batteryCharge + this->_activeDesc[slot]._charge; if (this->_playerType == 0x12) { iVar4 = this->_effectiveSoulCharge; } else { iVar4 = 0; if (this->_playerType == 0x24) { iVar4 = this->_effectiveBloodCharge; } } pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,this->_activeDesc[slot]._item); if (pIVar1 != (ItemConfig_Item *)0x0) { if ((pIVar1->type == 3) && ((pIVar1->id == 0x28f || (pIVar1->id == 0x146)))) { iVar2 = 2; } else if ((pIVar1->chargeType == 1) || ((pIVar1->chargeType == 2 && (0xc < pIVar1->maxCharges)))) { iVar2 = 1; } else { iVar2 = 0; } if (iVar2 == 1) { if ((0 < iVar4) && (iVar3 < pIVar1->maxCharges)) { iVar3 = pIVar1->maxCharges; } return iVar3; } if (iVar2 == 2) { return iVar3; } } return iVar4 + iVar3; } //@@ 007911c0 Entity_Player::GetActiveItemSlot /* DB: scans 4 active slots at 0x1580 stride 0x20 prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetActiveItemSlot(Entity_Player *this,int id) { uint uVar1; ActiveItemDesc *pAVar2; uVar1 = 0; pAVar2 = this->_activeDesc; do { if (pAVar2->_item == id) { return uVar1; } uVar1 = uVar1 + 1; pAVar2 = pAVar2 + 1; } while (uVar1 < 4); return -1; } //@@ 007911f0 Entity_Player::GetCollectibleMaxCharge /* DB: per-item charge overrides then ItemConfig MaxCharges; caller GetActiveMaxCharge prototype: db/protos.zhl, confirmed by RET 12 */ int __thiscall Entity_Player::GetCollectibleMaxCharge(Entity_Player *this,int collectibleId,int varData,int unused) { byte bVar1; ItemConfig_Item *pIVar2; if (((((collectibleId == 0x11e) || (collectibleId == 0x107)) || (collectibleId == 0x15c)) || (collectibleId == 0x1fe)) && (0 < varData)) { return varData; } if (collectibleId == 0x1e9) { if ((varData & 0xffffU) != 0) { return varData & 0xffffU; } } else if (collectibleId == 0x2c9) { if (this->_playerType == 0x1a) { return 0x1e; } } else if (collectibleId == 0x2d2) { if (((this->_playerType == 0x25) || (this->_playerType == 0x27)) && (bVar1 = HasCollectible(this,0x26b,0), bVar1 != 0)) { return 300; } } else if (collectibleId == 0x2c7) { if ((this->_playerType == 0x1d) || (this->_playerType == 0x26)) { return 4; } } else if (collectibleId == 0x1a6) { if (varData < 3) { return 0; } } else if (((collectibleId == 0x23) && (bVar1 = HasPlayerForm(this,0xf), bVar1 != 0)) && (varData == 1)) { return 10; } pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if (pIVar2 == (ItemConfig_Item *)0x0) { return 0; } return pIVar2->maxCharges; } //@@ 00791320 Entity_Player::GetActiveMaxCharge /* DB: slot->item/varData, slot 3 returns 0; calls per-item max charge 007911f0 prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetActiveMaxCharge(Entity_Player *this,int slot) { int iVar1; if ((slot == 3) || (((slot == 2 && (this->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)))) { return 0; } iVar1 = GetCollectibleMaxCharge (this,this->_activeDesc[slot]._item,this->_activeDesc[slot]._varData,(int)this); return iVar1; } //@@ 00791380 Entity_Player::GetActiveMaxCharge /* DB: slot param: 0 for slot 3 (and slot 2 special case), reads active item id this+(slot+0xac)*0x20 and varData +0x159c; returns 1 for items 0x263/0x2d0/0x93 and 0x23 with player form, else Entity_Player::GetCollectibleMaxCharge(id,varData); ControlActiveItem, DischargeActiveItem, PlayerHUD::RenderActiveItem prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetActiveMaxCharge(Entity_Player *this,int slot) { int collectibleId; byte bVar1; int iVar2; int extraout_ECX; if ((slot == 3) || (((slot == 2 && (this->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)))) { return 0; } iVar2 = this->_activeDesc[slot]._varData; collectibleId = this->_activeDesc[slot]._item; if (((collectibleId == 0x263) || (collectibleId == 0x2d0)) || (collectibleId == 0x93)) { return 1; } if (((collectibleId == 0x23) && (bVar1 = HasPlayerForm(this,0xf), slot = extraout_ECX, bVar1 != 0) ) && (iVar2 == 1)) { return 1; } iVar2 = GetCollectibleMaxCharge(this,collectibleId,iVar2,slot); return iVar2; } //@@ 00791420 Entity_Player::SetActiveCharge /* ZHL [lua] Lua binding EntityPlayer:SetActiveCharge prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::SetActiveCharge(Entity_Player *this,int charge,int slot) { Game *pGVar1; byte bVar2; int iVar3; int iVar4; uint slot_00; int iVar5; if (slot < 0) { slot_00 = 0; do { SetActiveCharge(this,charge,slot_00); slot_00 = slot_00 + 1; } while (slot_00 < 4); return; } if (3 < slot) { return; } iVar3 = GetTotalActiveCharge(this,slot); if (this->_activeDesc[slot]._item != 0) { iVar4 = GetActiveMaxCharge(this,slot); iVar5 = charge; if (iVar4 < charge) { iVar5 = iVar4; } this->_activeDesc[slot]._charge = iVar5; iVar5 = charge - iVar4; if (iVar5 < 0) { iVar5 = 0; } if (iVar5 < iVar4) { iVar4 = iVar5; } this->_activeDesc[slot]._batteryCharge = iVar4; } iVar4 = GetTotalActiveCharge(this,slot); if ((iVar3 != iVar4) && ((bVar2 = HasTrinket(this,0x65,0), bVar2 != 0 || (bVar2 = HasTrinket(this,100,0), bVar2 != 0))) ) { this->_cacheFlags = this->_cacheFlags | 0x41f; EvaluateItems(); } pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 00791510 Entity_Player::SetActiveVarData /* ZHL [exact] __thiscall void Entity_Player::SetActiveVarData(int vardata, int slot); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::SetActiveVarData(Entity_Player *this,int vardata,int slot) { this->_activeDesc[slot]._varData = vardata; return; } //@@ 00791530 Entity_Player::GetActiveMaxCharge /* DB: slot active item ItemConfig +0xac maxcharges, special-case item 35 prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetActiveMaxCharge(Entity_Player *this,int slot) { int id; ItemConfig_Item *pIVar1; id = this->_activeDesc[slot]._item; if (id == 0x23) { if ((((this->_hasCurseMistEffect != 0) || (this->_isCoopGhost != 0)) || (this->_playerForms[0xf] < 3)) || (this->_activeDesc[slot]._varData != 1)) { LAB_0079157c: pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,id); return pIVar1->chargeType; } } else if (id != 0) goto LAB_0079157c; return 2; } //@@ 007915a0 Entity_Player::AddActiveCharge /* ZHL [exact] __thiscall int Entity_Player::AddActiveCharge(int charge, int slot, bool flashHUD, bool overcharge, bool force); prototype: REPENTOGON, confirmed by RET 20 */ int __thiscall Entity_Player::AddActiveCharge (Entity_Player *this,int charge,int slot,byte flashHUD,byte overcharge,byte force) { byte bVar1; int iVar2; Entity *batteryEffect; int *piVar3; int missingCharge; int *piVar4; int iVar5; uint uVar6; int addedCharge; int overflowCharge; int local_20; int local_18; int local_14; int activeDescOffset; int prevTotalCharge; Game *game; Manager *manager; if (slot < 0) { iVar5 = 0; uVar6 = 0; do { iVar2 = AddActiveCharge(this,charge,uVar6,flashHUD,overcharge,force); uVar6 = uVar6 + 1; iVar5 = iVar5 + iVar2; } while (uVar6 < 4); return iVar5; } prevTotalCharge = GetTotalActiveCharge(this,slot); addedCharge = 0; activeDescOffset = slot * 0x20 + 0x1580; if (this->_activeDesc[slot]._item != 0) { local_14 = GetActiveMaxCharge(this,slot); if (((0 < charge) && (force == 0)) && (local_14 != 0)) { if (local_14 != 1) { return 0; } charge = GetActiveMaxCharge(this,slot); } iVar5 = GetActiveMaxCharge(this,slot); if (charge < 1) { if (charge < 0) { local_14 = 0; local_18 = slot * 0x20; piVar4 = &this->_activeDesc[slot]._batteryCharge; piVar3 = &local_14; if (0 < *piVar4) { piVar3 = piVar4; } iVar2 = -charge; if (*piVar3 < -charge) { iVar2 = *piVar3; } *piVar4 = *piVar4 - iVar2; addedCharge = -iVar2; if (charge + iVar2 < 0) { local_14 = 0; piVar4 = &this->_activeDesc[slot]._charge; local_14 = -(charge + iVar2); piVar3 = &local_14; if (0 < *piVar4) { piVar3 = piVar4; } if (*piVar3 < local_14) { local_14 = *piVar3; } addedCharge = addedCharge - local_14; *piVar4 = *piVar4 - local_14; } } else { addedCharge = 0; } } else { local_18 = slot * 0x20; iVar2 = this->_activeDesc[slot]._charge; missingCharge = iVar5 - iVar2; overflowCharge = 0; if (0 < missingCharge) { overflowCharge = missingCharge; } addedCharge = charge; if (overflowCharge < charge) { addedCharge = overflowCharge; } overflowCharge = charge - addedCharge; this->_activeDesc[slot]._charge = iVar2 + addedCharge; bVar1 = HasCollectible(this,0x3f,0); if (((bVar1 == 0) && (overcharge == 0)) || (overflowCharge < 1)) { if ((0 < addedCharge) && ((flashHUD != 0 || ((local_14 != 1 && (iVar5 < 0xd)))))) { HUD::FlashChargeBar(&g_game->_hud,this,slot); manager = g_manager; if (*(int *)((int)&this->_activeDesc[0]._charge + local_18) < iVar5) { local_14 = 0xab; } else { local_14 = 0xda; } seed_fart_sound_override(&local_14); SoundEffects::Play(&manager->_sfxManager,local_14,1.0,2,0,1.0,0.0); } } else { missingCharge = iVar5 - *(int *)((int)&this->_activeDesc[0]._batteryCharge + local_18); iVar2 = 0; if (0 < missingCharge) { iVar2 = missingCharge; } if (iVar2 < overflowCharge) { overflowCharge = iVar2; } if (0 < overflowCharge) { piVar3 = (int *)((int)&this->_activeDesc[0]._batteryCharge + local_18); *piVar3 = *piVar3 + overflowCharge; addedCharge = addedCharge + overflowCharge; if ((flashHUD != 0) || ((local_14 != 1 && (iVar5 < 0xd)))) { HUD::FlashChargeBar(&g_game->_hud,this,slot); manager = g_manager; local_18 = 0xaa; seed_fart_sound_override(&local_18); SoundEffects::Play(&manager->_sfxManager,local_18,1.0,2,0,1.0,0.0); uVar6 = Random(); batteryEffect = Game::SpawnEx(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar6,0); iVar2 = __RTDynamicCast(batteryEffect,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar2 + 0xdc) = 0; *(undefined4 *)(iVar2 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar2 + 0x358) = 0x3f800000; } } } } if ((*(int *)((int)(&(this->_sprite)._filename + -3) + activeDescOffset) == 0x1da) && (iVar5 <= this->_activeDesc[slot]._charge)) { RemoveCollectible(this,0x1da,0,slot,1); AddCollectible(this,0x160,-1,0,slot,0,0); AnimateCollectible(this,0x160,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } } iVar5 = GetTotalActiveCharge(this,0); if ((iVar5 != prevTotalCharge) && ((bVar1 = HasTrinket(this,0x65,0), bVar1 != 0 || (bVar1 = HasTrinket(this,100,0), bVar1 != 0))) ) { this->_cacheFlags = this->_cacheFlags | 0x41f; EvaluateItems(); } game = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } return addedCharge; } //@@ 007919c0 FUN_007919c0 int FUN_007919c0(void) { int iVar1; Entity_Player *in_ECX; uint uVar2; int charge; int iVar3; iVar3 = 0; charge = 1; uVar2 = 0; do { if (charge < 1) { return iVar3; } iVar1 = Entity_Player::AddActiveCharge(in_ECX,charge,uVar2,0,0,0); iVar3 = iVar3 + iVar1; uVar2 = uVar2 + 1; charge = charge - iVar3; } while (uVar2 < 4); if (0 < charge) { uVar2 = 0; do { if (charge < 1) { return iVar3; } iVar1 = Entity_Player::AddActiveCharge(in_ECX,charge,uVar2,0,1,0); iVar3 = iVar3 + iVar1; uVar2 = uVar2 + 1; charge = charge - iVar3; } while (uVar2 < 4); } return iVar3; } //@@ 00791a40 Entity_Player::ControlActiveItem /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON sig shape (cmp _variant,1 early-out), arg slot int; action 9/10 (ITEM/PILLCARD) pressed/triggered, FlushQueueItem, UseActiveItem, AddWisp; called from player update 00782af0 with 0 and from 007a3d30 Entity_Player::pocket_use_input slot prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::ControlActiveItem(Entity_Player *this,int slot) { EntityPtr *pEVar1; Manager *pMVar2; byte bVar3; char cVar4; uint uVar5; void *pvVar6; float *drainAmount; EntityPtr breathEffect; Entity_Familiar *wisp; ItemConfig_Item *pIVar7; ItemConfig_Item *itemConfig; uint seed; Entity *tmpEntity; int iVar8; undefined2 *extraout_EAX; undefined2 *extraout_EAX_00; int *piVar9; NetplayManager *extraout_ECX; NetplayManager *pNVar10; int extraout_ECX_00; int extraout_ECX_01; int unused; int unused_00; int iVar11; int *piVar12; Entity_Player *this_00; undefined1 *puVar13; int extraout_EDX; int iVar14; float in_XMM0_Da; float distSq; float fVar15; undefined4 uVar16; Vector *position; TypeDescriptor *pTVar17; TypeDescriptor *pTVar18; byte isDontUpdate; undefined4 uVar19; EntityRef local_c8; int totalChargeBefore; int *candidateItems; int *candidateItemsEnd; int *candidateItemsCapacity; Vector local_90; EntityList_EL local_88; Vector local_78; undefined4 local_70; Vector local_6c; int slotOffset; int local_60; int savedSlot; undefined2 local_56; Manager *local_54; Manager *local_50; int local_4c; ItemConfig_Item *local_48; byte local_44; char local_43; char isItemPressed; char isItemTriggered; undefined4 local_40; Capsule CStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; int *itemEntry; code *takeDamageFn; local_8 = 0xffffffff; puStack_c = &LAB_00aff6b3; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; savedSlot = slot; if (this->_variant == 1) { return; } if (this->_isCoopGhost != 0) { return; } ExceptionList = &local_10; local_14 = uVar5; bVar3 = IsHologram(this); if (bVar3 != 0) { ExceptionList = local_10; return; } iVar11 = this->_playerType; if (iVar11 == 0x28) { ExceptionList = local_10; return; } iVar14 = 9; if ((iVar11 == 0x13) || (iVar11 == 0x14)) { local_44 = 1; cVar4 = FUN_006f0040(uVar5); isItemTriggered = '\x01'; if (cVar4 == '\0') goto LAB_00791acf; } else { local_44 = 0; LAB_00791acf: isItemTriggered = '\0'; } pNVar10 = &g_manager->_netplayManager; local_43 = (g_manager->_optionsConfig)._jacobEsauControls == 0; if (*pNVar10 != *(NetplayManager *)(g_manager + 1)) { pvVar6 = InputManager::GetDeviceByPlayerEntity(pNVar10,this); pNVar10 = extraout_ECX; if (pvVar6 != (void *)0x0) { local_43 = *(int *)((int)pvVar6 + 0x3d0) == 0; } } if (((isItemTriggered != '\0') && (local_43 != '\0')) || (slot != 0)) { iVar14 = 10; } bVar3 = input_is_action_pressed(iVar14,this->_controllerIndex,(Entity *)this,(int)pNVar10); if (bVar3 == 0) { LAB_00791b40: isItemPressed = '\0'; } else { cVar4 = FUN_00708350(); isItemPressed = '\x01'; if (cVar4 != '\0') goto LAB_00791b40; } bVar3 = input_is_action_triggered(g_manager,iVar14,this->_controllerIndex,(Entity *)this,0); iVar11 = extraout_ECX_00; if (bVar3 == 0) { LAB_00791b6a: isItemTriggered = '\0'; } else { cVar4 = FUN_00708350(); isItemTriggered = '\x01'; iVar11 = extraout_ECX_01; if (cVar4 != '\0') goto LAB_00791b6a; } if (local_44 != 0) { if (local_43 == '\0') { cVar4 = FUN_00753bf0(); if (((cVar4 != '\0') && (bVar3 = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)this,unused), bVar3 != 0)) || ((cVar4 = FUN_006f0040(), cVar4 != '\0' && (bVar3 = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)this,unused_00), bVar3 == 0)))) goto LAB_00791bd4; } else { bVar3 = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)this,iVar11); if ((bVar3 != 0) && (this->_twinPlayer != (EntityPtr)0x0)) { LAB_00791bd4: isItemTriggered = '\0'; isItemPressed = '\0'; } } } bVar3 = Entity::HasEntityFlags((Entity *)this,0x800); if (((bVar3 != 0) || (this->_hasCurseMistEffect != 0)) || (this->_isCoopGhost != 0)) { isItemTriggered = '\0'; isItemPressed = '\0'; } if ((this->_itemStateCooldown != 0) && (this->_itemState != 0)) { ExceptionList = local_10; return; } local_56._1_1_ = *(char *)(this + 1); *(undefined1 *)(this + 1) = 0; if (local_56._1_1_ != '\0') { isItemTriggered = '\x01'; isItemPressed = '\x01'; } totalChargeBefore = GetTotalActiveCharge(this,slot); if ((this->_itemState == 0x2c5) || (this->_suplexState != 0)) { if (this->_suplexState != 2) { ExceptionList = local_10; return; } if (isItemTriggered == '\0') { ExceptionList = local_10; return; } if (this->_suplexAimCountdown < 2) { ExceptionList = local_10; return; } this->_suplexAimCountdown = 1; ExceptionList = local_10; return; } local_70 = local_70 & 0xffffff; if (((((((slot == 0) && (isItemPressed == '\0')) && (bVar3 = Entity::HasEntityFlags((Entity *)this,0x4000), bVar3 == 0)) && ((bVar3 = HasTrinket(this,0x95,0), bVar3 != 0 && (iVar11 = this->_activeDesc[0]._item, iVar11 != 0)))) && ((cVar4 = KAGE_Filesys_FileManager::OpenRead((KAGE_Filesys_FileManager *)this,iVar11,0), cVar4 != '\0' && ((this->_entityCollisionClass != 0 && (this->_itemState == 0)))))) && (this->_damageCooldown < 2)) && (bVar3 = HasInvincibility(this,0,(EntityRef *)0x0), bVar3 == 0)) { in_XMM0_Da = this->_friction * (this->_velocity).x; local_90.y = this->_speedMultiplier * this->_friction * (this->_velocity).y + (this->_pos).y; local_90.x = this->_speedMultiplier * in_XMM0_Da + (this->_pos).x; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&local_88,&local_90,this->_size + 150.0, (uint)(1 < *(int *)&g_game->_deathmatchManager) * 4 + 10); uVar5 = 0; puVar13 = (undefined1 *)local_88._size; if ((undefined1 *)local_88._size != (undefined1 *)0x0) { do { tmpEntity = *(Entity **)((int)local_88._data + uVar5 * 4); if ((tmpEntity->_dead == 0) && (tmpEntity->_entityCollisionClass != 0)) { if ((*(int *)&g_game->_deathmatchManager < 2) || (tmpEntity->_type != 1)) { iVar11 = tmpEntity->_type; if ((((0x3dd < iVar11 - 10U) && (iVar11 != 9)) && (iVar11 != 2)) || ((iVar11 == 0x21 && (tmpEntity->_variant == 4)))) goto LAB_00791f0d; } else { iVar11 = 1; } if ((tmpEntity->_flags & 0x20000000) == 0) { if (iVar11 == 9) { if ((tmpEntity[1]._variant & 0x80000000U) == 0) goto LAB_00791e44; } else { in_XMM0_Da = 0.0; if (0.0 < tmpEntity->_collisionDamage) { LAB_00791e44: local_90.x = this->_speedMultiplier * this->_friction * (this->_velocity).x; local_90.y = this->_speedMultiplier * this->_friction * (this->_velocity).y; Entity::GetCollisionCapsule((Entity *)this,&local_c8,&local_90); local_78.y = tmpEntity->_speedMultiplier * (tmpEntity->_velocity).y * tmpEntity->_friction; in_XMM0_Da = tmpEntity->_speedMultiplier * (tmpEntity->_velocity).x * tmpEntity->_friction; local_78.x._0_1_ = SUB41(in_XMM0_Da,0); local_78.x._1_1_ = (byte)((uint)in_XMM0_Da >> 8); local_78.x._2_2_ = (undefined2)((uint)in_XMM0_Da >> 0x10); Entity::GetCollisionCapsule(tmpEntity,&CStack_3c,&local_78); local_6c.y = 0.0; local_6c.x = 0.0; bVar3 = Capsule::Collide((Capsule *)&local_c8,&CStack_3c,&local_6c); if (bVar3 != 0) { local_70 = CONCAT13(1,(undefined3)local_70); isItemTriggered = '\x01'; isItemPressed = '\x01'; break; } puVar13 = (undefined1 *)local_88._size; } } } } LAB_00791f0d: uVar5 = uVar5 + 1; } while (uVar5 < puVar13); } EntityList_Query::~EntityList_Query(&local_88); slot = savedSlot; } local_50 = (Manager *)((uint)local_50 & 0xffffff00); slotOffset = (int)(slot + 0xac) * 0x20; local_43 = '\0'; local_90.y = *(float *)((int)&(this->_sprite)._filename + slotOffset + -0x48); if (local_90.y == 4.56823e-43) { local_4c = slot * 0x20; bVar3 = AreControlsEnabled(this); if (bVar3 == 0) { iVar11 = this->_activeDesc[slot]._timeRechargeCooldown; LAB_007922ae: if (((9 < iVar11) && (*(int *)&g_game->_roomTransition == 0)) && ((bVar3 = AreControlsEnabled(this), bVar3 == 0 || (isItemPressed == '\0')))) { local_43 = '\x01'; bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x146); pMVar2 = g_manager; if (bVar3 == 0) { local_48 = (ItemConfig_Item *)0x10b; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_48,1.0,2,0,1.0,0.0); DischargeActiveItem(this,slot,0); iVar11 = local_4c; } else { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x146,-1); iVar11 = slot * 0x20; if (this->_activeDesc[slot]._charge == 0) { DischargeActiveItem(this,slot,0); this->_activeDesc[slot]._timeRechargeCooldown = 9; isItemTriggered = '\0'; goto LAB_007926d7; } } *(undefined4 *)((int)&this->_activeDesc[0]._timeRechargeCooldown + iVar11) = 9; } } else { iVar11 = this->_activeDesc[slot]._timeRechargeCooldown; if (*(int *)&g_game->_roomTransition != 0) goto LAB_007922ae; if ((9 < iVar11) && (isItemPressed != '\0')) { LAB_00791ff1: bVar3 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar3 == 0) { iVar11 = GetActiveMaxCharge(this,slot); local_54 = (Manager *)((int)(iVar11 + (iVar11 >> 0x1f & 3U)) >> 2); bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x146); if (bVar3 == 0) { local_48 = (ItemConfig_Item *)this->_activeDesc[slot]._batteryCharge; local_6c.y = (float)&DAT_00000004; if ((int)local_48 < 1) { piVar9 = &this->_activeDesc[slot]._charge; local_48 = (ItemConfig_Item *)*piVar9; drainAmount = &local_6c.y; if ((int)local_48 < 5) { drainAmount = (float *)piVar9; } AddActiveCharge(this,-(int)*drainAmount,slot,0,0,0); iVar11 = this->_activeDesc[slot]._charge; } else { drainAmount = &local_6c.y; if ((int)local_48 < 5) { drainAmount = (float *)&this->_activeDesc[slot]._batteryCharge; } AddActiveCharge(this,-(int)*drainAmount,slot,0,0,0); iVar11 = this->_activeDesc[slot]._batteryCharge; } if (iVar11 < 1) { bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x146); if (bVar3 == 0) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x146,0,2); pMVar2 = g_manager; local_48 = (ItemConfig_Item *)0x1fa; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_48,1.0,2,0,1.0,0.0); pEVar1 = &this->_breathOfLifeEffect; if (this->_breathOfLifeEffect != (EntityPtr)0x0) { (**(code **)(*(int *)this->_breathOfLifeEffect + 0x28))(); if (*pEVar1 != (EntityPtr)0x0) { local_6c.y = (float)pEVar1; std::multiset::erase(&local_6c.y); } *pEVar1 = (EntityPtr)0x0; } uVar5 = Random(); breathEffect = (EntityPtr) Game::Spawn(g_game,1000,0x7b,&this->_pos,&this->_velocity, (Entity *)this,9,uVar5); *pEVar1 = breathEffect; ((Vector *)((int)breathEffect + 0x34c))->x = 0.0; *(float *)((int)breathEffect + 0x350) = -15.0; local_54 = (Manager *)((int)*pEVar1 + 0x3bc); if (*(int *)local_54 != 0) { local_6c.y = (float)local_54; std::multiset::erase(&local_6c.y); } *(Entity_Player **)local_54 = this; std::multiset::insert(local_54); ANM2::Play((ANM2 *)((int)*pEVar1 + 0x48),(byte *)"Appear",0); bVar3 = HasCollectible(this,0x3b,0); if (bVar3 != 0) { local_40 = 0x3f800000; CStack_3c = (Capsule)0x3f800000; uStack_38 = 0x3f800000; uStack_34 = 0x3f800000; in_XMM0_Da = 1.0; local_30 = 0x3f800000; uStack_2c = 0x3d4ccccd; uStack_28 = 0x3d75c28f; uStack_24 = 0x3f800000; local_20 = 0; local_1c = 0xbe4ccccd; local_18 = 0xbe4ccccd; (**(code **)(*(int *)*pEVar1 + 0x3c))(&local_40,0xffffffff,0xff,0,1); } (**(code **)(*(int *)*pEVar1 + 0xc))(); isItemTriggered = '\0'; *(undefined4 *)((int)&this->_activeDesc[0]._timeRechargeCooldown + local_4c) = 0xb; goto LAB_007926d7; } } else { local_6c.y = (float)(iVar11 / (int)local_54); if ((int)local_6c.y < (int)local_48 / (int)local_54) { in_XMM0_Da = (float)(int)local_6c.y * 0.2; fVar15 = 1.6 - in_XMM0_Da; if (fVar15 <= 1.0) { fVar15 = 1.0; } if (1.6 <= fVar15) { fVar15 = 1.6; } play_sound_with_fart_seed(0x1fb,1.0,1,0,fVar15); } } } } LAB_00792293: this->_activeDesc[slot]._timeRechargeCooldown = 0xb; isItemTriggered = '\0'; goto LAB_007926d7; } if (isItemTriggered == '\0') goto LAB_007922ae; if (9 < iVar11) goto LAB_00791ff1; iVar11 = GetActiveMaxCharge(this,slot); if (iVar11 <= this->_activeDesc[slot]._charge) { local_50 = (Manager *)CONCAT31(local_50._1_3_,1); iVar11 = GetActiveMaxCharge(this,slot); if (this->_activeDesc[slot]._batteryCharge < iVar11) { this->_activeDesc[slot]._batteryCharge = 0; this->_activeDesc[slot]._timeRechargeCooldown = 0xb; isItemTriggered = '\0'; goto LAB_007926d7; } goto LAB_00792293; } } isItemTriggered = '\0'; } else if (local_90.y == 9.94922e-43) { if (((int *)slot == (int *)0x2) && (bVar3 = Entity::HasEntityFlags((Entity *)this,0x4000), bVar3 == 0)) { if ((this->_itemState == 0x2c6) && (((bVar3 = AreControlsEnabled(this), bVar3 != 0 && (isItemPressed != '\0')) && (this->_bagOfCraftingOutput != 0)))) { this->_bagOfCraftingHoldFrames = this->_bagOfCraftingHoldFrames + 1; if (0x1d < this->_bagOfCraftingHoldFrames) { ResetItemState(this); iVar11 = this->_bagOfCraftingOutput; local_48 = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar11); if (local_48 != (ItemConfig_Item *)0x0) { AnimateCollectible(this,iVar11,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); if (local_48->type == 3) { FlushQueueItem(this); pMVar2 = (Manager *)this->_activeDesc[0]._item; local_6c.y = (float)pMVar2; bVar3 = ItemConfig::IsValidCollectible((int)pMVar2); if (((bVar3 != 0) && (pMVar2 != (Manager *)0x248)) && ((bVar3 = HasCollectible(this,0x216,0), bVar3 == 0 || ((bVar3 = ItemConfig::IsValidCollectible(this->_activeDesc[1]._item), bVar3 != 0 && (this->_activeDesc[1]._item != 0x248)))))) { RemoveCollectible(this,(uint)pMVar2,0,0,0); Game::IsGreedMode(g_game); RNG::Next((RNG *)((int)local_6c.y * 0x10 + (int)(this->_collectibleRNGs)._begin)); tainted_cain_pedestal_burst(); } } HUD::ShowItemText(&g_game->_hud,this,local_48); iVar11 = ItemPool::GetFirstItemPoolForCollectible (&g_game->_itemPool,this->_bagOfCraftingOutput); SetQueuedItem(this,local_48,local_48->_initCharge,0,0,iVar11); bVar3 = HasCollectible(this,0x248,0); if (bVar3 != 0) { position = &this->_pos; isDontUpdate = 0; bVar3 = 0; iVar11 = Entity_Familiar::GetRandomWisp ((RNG *)((int)(this->_collectibleRNGs)._begin + 0x2c60)); AddWisp(this,iVar11,position,bVar3,isDontUpdate); } } game = g_game; in_XMM0_Da = 0.0; this->_bagOfCraftingHoldFrames = 0; this->_bagOfCraftingOutput = 0; *(undefined4 *)&this->field_0x1f50 = 0xffffffff; this->_bagOfCraftingContent[0] = 0; this->_bagOfCraftingContent[1] = 0; this->_bagOfCraftingContent[2] = 0; this->_bagOfCraftingContent[3] = 0; this->_bagOfCraftingContent[4] = 0; this->_bagOfCraftingContent[5] = 0; this->_bagOfCraftingContent[6] = 0; this->_bagOfCraftingContent[7] = 0; HUD::InvalidateCraftingItem(&game->_hud,this); pMVar2 = g_manager; local_48 = (ItemConfig_Item *)0x84; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_48,1.0,2,0,1.0,0.0); } } else { this->_bagOfCraftingHoldFrames = 0; } } } else if (local_90.y == 9.1785e-43) { local_44 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x32); game = g_game; if (local_44 == 0) { bVar3 = AreControlsEnabled(this); if ((bVar3 != 0) && (local_50 = (Manager *)((uint)local_50 & 0xff), isItemPressed != '\0')) { local_50 = (Manager *)0x1; } } else { this->_activeDesc[slot]._timeRechargeCooldown = 0xf; if (((*(int *)&game->_roomTransition == 0) && ((bVar3 = AreControlsEnabled(this), bVar3 == 0 || (isItemPressed == '\0')))) || (this->_activeDesc[slot]._charge < 1)) { local_43 = '\x01'; } } bVar3 = HasCollectible(this,0x248,0); if ((((bVar3 != 0) && (local_44 != 0)) && (local_43 == '\0')) && ((bVar3 = Entity::IsFrame((Entity *)this,6,0), bVar3 != 0 && (wisp = AddWisp(this,0x28f,&this->_pos,0,1), wisp != (Entity_Familiar *)0x0)))) { uVar16 = *(undefined4 *)((int)&wisp->_flags + 4); iVar11 = *(int *)wisp; *(uint *)&wisp->_flags = (uint)wisp->_flags & 0xfffffffb; *(undefined4 *)((int)&wisp->_flags + 4) = uVar16; wisp->_isNotCountedAsFollower = 1; (**(code **)(iVar11 + 0xc))(); } } LAB_007926d7: bVar3 = Entity::HasEntityFlags((Entity *)this,0x4000); if ((bVar3 == 0) && ((int *)slot == (int *)0x0)) { local_4c = 0; uVar5 = 0; do { iVar11 = *(int *)((int)&this->_activeDesc[0]._timeRechargeCooldown + uVar5); if (0 < iVar11) { *(int *)((int)&this->_activeDesc[0]._timeRechargeCooldown + uVar5) = iVar11 + -1; } if (*(int *)((int)&this->_activeDesc[0]._item + uVar5) != 0) { pIVar7 = (ItemConfig_Item *)GetActiveMaxCharge(this,local_4c); local_48 = pIVar7; local_78.y = (float)GetActiveMaxCharge(this,local_4c); local_54 = (Manager *)GetActiveMaxCharge(this,local_4c); if (*(int *)((int)&this->_activeDesc[0]._timeRechargeCooldown + uVar5) < 1) { local_6c.y = (float)g_manager; itemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig, *(int *)((int)&this->_activeDesc[0]._item + uVar5)); if ((itemConfig != (ItemConfig_Item *)0x0) && (itemConfig->chargeType == 1)) { iVar11 = 1; if (*(int *)((int)&this->_activeDesc[0]._item + uVar5) == 0x246) { if ((this->_temporaryeffects)._disabled == 0) { for (piVar9 = (this->_temporaryeffects)._effects._begin; piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) { if ((*(int *)*piVar9 == 0) && (((int *)*piVar9)[1] == 0x47)) { iVar14 = piVar9[1]; goto LAB_00792a66; } } iVar14 = 0; LAB_00792a66: pvVar6 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x246); if (pvVar6 == (void *)0x0) goto LAB_007927a6; iVar11 = *(int *)((int)pvVar6 + 4); } else { iVar14 = 0; LAB_007927a6: iVar11 = 0; } iVar14 = (10 - iVar11) - iVar14; iVar11 = 0; if (0 < iVar14) { iVar11 = iVar14; } iVar11 = (iVar11 + 1) * iVar11; } iVar14 = *(int *)((int)&this->_activeDesc[0]._charge + uVar5); if (iVar14 < (int)local_48) { iVar14 = (int)local_48 - iVar14; iVar8 = iVar11; if (iVar14 < iVar11) { iVar8 = iVar14; } iVar14 = *(int *)((int)&this->_activeDesc[0]._charge + uVar5) + iVar8; iVar11 = iVar11 - iVar8; *(int *)((int)&this->_activeDesc[0]._charge + uVar5) = iVar14; if ((int)local_48 <= iVar14) { HUD::FlashChargeBar(&g_game->_hud,this,local_4c); local_60 = 0xab; seed_fart_sound_override(&local_60); SoundEffects::Play((SoundEffects *)((int)local_6c.y + 0x2a324),local_60,1.0,2,0,1.0, 0.0); } } bVar3 = HasCollectible(this,0x3f,0); if (((bVar3 != 0) && (iVar14 = *(int *)((int)&this->_activeDesc[0]._batteryCharge + uVar5), iVar14 < (int)local_48)) && (0 < iVar11)) { if ((int)local_48 - iVar14 < iVar11) { iVar11 = (int)local_48 - iVar14; } *(int *)((int)&this->_activeDesc[0]._batteryCharge + uVar5) = iVar11 + iVar14; pIVar7 = local_48; if (iVar11 + iVar14 < (int)local_48) goto LAB_0079293f; HUD::FlashChargeBar(&g_game->_hud,this,local_4c); pMVar2 = g_manager; local_60 = 0xaa; seed_fart_sound_override(&local_60); SoundEffects::Play(&pMVar2->_sfxManager,local_60,1.0,2,0,1.0,0.0); seed = Random(); uVar19 = 0; pTVar18 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar16 = 0; tmpEntity = Game::Spawn(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,1, seed); iVar11 = __RTDynamicCast(tmpEntity,uVar16,pTVar17,pTVar18,uVar19); *(undefined4 *)(iVar11 + 0xdc) = 0; *(undefined4 *)(iVar11 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar11 + 0x358) = 0x3f800000; } pIVar7 = local_48; } LAB_0079293f: bVar3 = HasCollectible(this,0x74,0); if (((bVar3 != 0) && ((ItemConfig_Item *)local_78.y == (ItemConfig_Item *)0x1)) && ((*(int *)((int)&this->_activeDesc[0]._charge + uVar5) == 0 && (local_54 == (Manager *)0x0)))) { iVar11 = *(int *)((int)&this->_activeDesc[0]._subCharge + uVar5); if (iVar11 == 0) { iVar8 = *(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4); iVar14 = 0; if (0 < iVar8) { iVar14 = iVar8; } if (iVar14 < 1) goto LAB_007929af; } iVar11 = iVar11 + 1; *(int *)((int)&this->_activeDesc[0]._subCharge + uVar5) = iVar11; if (iVar11 < 0x1c2) goto LAB_007929ba; *(undefined4 *)((int)&this->_activeDesc[0]._charge + uVar5) = 1; } LAB_007929af: *(undefined4 *)((int)&this->_activeDesc[0]._subCharge + uVar5) = 0; } LAB_007929ba: bVar3 = HasCollectible(this,0x287,0); if (((bVar3 == 0) || (local_54 != (Manager *)0x0)) || (((int)pIVar7 <= *(int *)((int)&this->_activeDesc[0]._charge + uVar5) && ((bVar3 = HasCollectible(this,0x3f,0), bVar3 == 0 || ((int)pIVar7 <= *(int *)((int)&this->_activeDesc[0]._batteryCharge + uVar5))))))) { *(undefined4 *)((int)&this->_activeDesc[0]._partialCharge + uVar5) = 0; } else { in_XMM0_Da = *(float *)((int)&this->_activeDesc[0]._partialCharge + uVar5); if (1.0 <= in_XMM0_Da) { in_XMM0_Da = in_XMM0_Da - 1.0; *(float *)((int)&this->_activeDesc[0]._partialCharge + uVar5) = in_XMM0_Da; AddActiveCharge(this,1,local_4c,0,0,0); } } } local_4c = local_4c + 1; uVar5 = uVar5 + 0x20; } while (uVar5 < 0x80); slot = savedSlot; } bVar3 = AreControlsEnabled(this); if ((bVar3 == 0) || ((isItemTriggered == '\0' && ((char)local_50 == '\0')))) goto LAB_00793653; local_6c.y = (float)this->_itemState; this->_lastActionTriggers = this->_lastActionTriggers | 0x10; iVar11 = *(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset); isItemTriggered = '\x01'; if (iVar11 != 0x93) { if (iVar11 == 0x2d2) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_88,1000,0xc1,0,0,0); iVar11 = 0; fVar15 = 1e+09; uVar5 = 0; if ((undefined1 *)local_88._size != (undefined1 *)0x0) { do { iVar14 = *(int *)((int)local_88._data + uVar5 * 4); if (*(Entity_Player **)(iVar14 + 0x3c8) == this) { distSq = (this->_pos).y - *(float *)(iVar14 + 0x340); in_XMM0_Da = (this->_pos).x - *(float *)(iVar14 + 0x33c); in_XMM0_Da = in_XMM0_Da * in_XMM0_Da; distSq = distSq * distSq + in_XMM0_Da; if (distSq < fVar15) { iVar11 = iVar14; fVar15 = distSq; } } uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_88._size); slot = savedSlot; if (iVar11 != 0) { *(undefined1 *)(iVar11 + 0x173) = 1; isItemTriggered = '\0'; } } } else { if (iVar11 != 0x2d9) goto LAB_00792c68; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_88,3,0xf3,0,0,0); uVar5 = 0; if ((undefined1 *)local_88._size != (undefined1 *)0x0) { do { iVar11 = *(int *)((int)local_88._data + uVar5 * 4); if ((iVar11 == 0) || (*(int *)(iVar11 + 0x28) != 3)) { iVar11 = 0; } if (*(Entity_Player **)(iVar11 + 0x410) == this) { if (*(int *)(iVar11 + 0xd88) == 0) { *(undefined4 *)(iVar11 + 0xd88) = 1; } isItemTriggered = '\0'; } uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_88._size); } } EntityList_Query::~EntityList_Query(&local_88); if (isItemTriggered != '\0') goto LAB_00792c68; goto LAB_007935ed; } bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x93); if (bVar3 != 0) { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x93,-1); AnimateCollectible(this,0x93,(byte *)"HideItem",(byte *)"PlayerPickupSparkle"); goto LAB_007935ed; } LAB_00792c68: iVar11 = *(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset); if (iVar11 == 0) goto LAB_007935ed; local_78.y = (float)ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar11); local_60 = GetActiveMaxCharge(this,slot); iVar11 = *(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset); if (iVar11 == 0x28f) { if ((char)local_50 == '\0') goto LAB_00792df3; if (this->_activeDesc[slot]._charge < 0x10) goto LAB_00792da8; pvVar6 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar6 & 0xfffffffcU) < 0xc9) { local_88._0_4_ = 0; } else { local_88._0_4_ = *(undefined4 *)((int)pvVar6 + 200); } local_88._data = (int *)0x0; local_88._size = 0; local_88._capacity = -1; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_88,0,1); uVar5 = 0; pvVar6 = g_game->_room; if (*(int *)((int)pvVar6 + 0x1264) != 0) { do { iVar11 = *(int *)(*(int *)((int)pvVar6 + 0x125c) + uVar5 * 4); if ((*(int *)(iVar11 + 0x28) == 3) && (*(Entity_Player **)(iVar11 + 0x410) == this)) { *(uint *)(iVar11 + 0x16c) = *(uint *)(iVar11 + 0x16c) | 0x200; *(undefined4 *)(iVar11 + 0x168) = *(undefined4 *)(iVar11 + 0x168); if (-1 < *(int *)(iVar11 + 0xd70)) { *(float *)(iVar11 + 0x370) = *(float *)(*(int *)(iVar11 + 0x330) + 0x38) + 5.0; } } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar6 + 0x1264)); } EvaluateItems(); goto LAB_007935ed; } if ((char)local_50 != '\0') { LAB_00792da8: if (this->_activeDesc[slot]._charge != local_60) goto LAB_00792df3; bVar3 = Entity::HasEntityFlags((Entity *)this,0x4000); if (bVar3 != 0) goto LAB_007935ed; UseActiveItem(this,(short *)((int)&local_70 + 2),iVar11,5,slot,0); AddActiveCharge(this,-1,0,0,0,0); goto LAB_00793273; } LAB_00792df3: cVar4 = KAGE_Filesys_FileManager::OpenRead((KAGE_Filesys_FileManager *)this,iVar11,slot); iVar11 = *(int *)((int)&(this->_sprite)._filename + (int)(slot + 0xac) * 0x20 + -0x48); if (cVar4 == '\0') { local_70 = CONCAT13(1,(undefined3)local_70); if (iVar11 == 0x1ab) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_88,0x124,-1,1,0,0) ; local_8 = 2; if ((undefined1 *)local_88._size != (undefined1 *)0x0) { local_54 = (Manager *)0x0; if ((undefined1 *)local_88._size != (undefined1 *)0x0) { piVar9 = local_88._data; do { iVar11 = piVar9[(int)local_54]; in_XMM0_Da = *(float *)(iVar11 + 0x380); if (1.0 < in_XMM0_Da) { if (1 < g_game->_frameCount - *(int *)(iVar11 + 0x328)) { piVar9 = (int *)__RTDynamicCast(iVar11,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC:: RTTI_Type_Descriptor,0); takeDamageFn = *(code **)(*piVar9 + 0x20); EntityRef::constructor(&local_c8,(Entity *)this); (*takeDamageFn)(0x42c80000,4,0,&local_c8,0x1e); local_70 = local_70 & 0xffffff; } piVar9 = local_88._data; } local_54 = (Manager *)&local_54->field_0x1; } while (local_54 < (uint)local_88._size); slot = savedSlot; } } local_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_88); if (local_70._3_1_ == '\0') goto LAB_007935ed; } bVar3 = HasCollectible(this,0xcd,0); if ((((bVar3 != 0) && (this->_itemState == 0)) && (pIVar7 = ItemConfig::GetCollectible (&g_manager->_itemConfig, *(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset)), pIVar7 != (ItemConfig_Item *)0x0)) && (iVar11 = FUN_007308d0(), iVar11 != 2)) { local_54 = (Manager *)FUN_007308d0(); if (local_54 == (Manager *)0x1) { local_50 = local_54; iVar11 = GetHealthType(this); local_4c = 2 - (uint)(iVar11 != 3); } else { local_50 = (Manager *)GetActiveMaxCharge(this,slot); iVar11 = GetTotalActiveCharge(this,slot); local_50 = (Manager *)((int)local_50 - iVar11); iVar11 = GetHealthType(this); local_4c = 2 - (uint)(iVar11 != 3); if (extraout_EDX < 1) goto LAB_007935ed; } iVar11 = local_4c; if (local_4c < this->_soulHearts + this->_redHearts + this->_boneHearts) { IsLocalPlayer(this); SoundEffects::PlayWithFartOverride(0x38a,in_XMM0_Da,2,0,1.0); iVar14 = 0; if (local_50 != (Manager *)0x0) { local_48 = (ItemConfig_Item *)0x0; do { local_60 = this->_soulHearts; local_70 = this->_redHearts; if ((int)(local_60 + local_70 + this->_boneHearts) <= iVar11) break; this->_damageCooldown = 0; local_78.y = *(float *)(*(int *)this + 0x20); EntityRef::constructor(&local_c8,(Entity *)this); if (*(int *)&g_game->_deathmatchManager < 2) { uVar16 = 0x3f800000; } else { uVar16 = 0x41000000; } cVar4 = (*(code *)local_78.y)(uVar16,0x2042821,0,&local_c8,0x1e); if (cVar4 == '\0') break; if (local_54 == (Manager *)0x1) { FullCharge(this,savedSlot,0,0); break; } if ((this->_playerType == 0x16) && ((this->_soulHearts < local_60 || ((this->_redHearts < (int)local_70 && (bVar3 = HasCollectible(this,0x26b,0), (int)((uint)(bVar3 != 0) * 2 + 4) <= this->_redHearts)))))) { if (local_48 != (ItemConfig_Item *)0x0) { local_48 = (ItemConfig_Item *)0x0; goto LAB_00793587; } local_48 = (ItemConfig_Item *)0x1; iVar14 = iVar14 + -1; } else { LAB_00793587: AddActiveCharge(this,1,savedSlot,0,0,0); iVar8 = GetHealthType(this); if (iVar8 == 3) { iVar14 = iVar14 + 1; iVar11 = GetActiveMaxCharge(this_00,savedSlot); iVar8 = GetTotalActiveCharge(this,savedSlot); if (iVar8 < iVar11) { AddActiveCharge(this,1,savedSlot,0,0,0); } iVar11 = local_4c; } } iVar14 = iVar14 + 1; } while (iVar14 < (int)local_50); } } } goto LAB_007935ed; } pvVar6 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,iVar11); if (((local_60 == 0) && (pvVar6 != (void *)0x0)) && (*(int *)((int)local_78.y + 0x78) != 0)) goto LAB_007935ed; if (0x123 < iVar11) { switch(iVar11) { case 0x124: iVar14 = 3; iVar11 = 0xf; break; default: goto switchD_00792e5b_caseD_24; case 0x182: iVar14 = 3; iVar11 = 0x25; break; case 0x196: iVar14 = 3; iVar11 = 0x24; break; case 0x1a6: if (2 < this->_activeDesc[slot]._varData) goto switchD_00792e5b_caseD_42; goto switchD_00792e5b_caseD_24; } goto LAB_00792f6c; } if (iVar11 == 0x123) { iVar14 = 0; iVar11 = 0x13; goto LAB_00792f6c; } switch(iVar11) { case 0x21: iVar14 = 3; iVar11 = 10; break; case 0x22: case 0x3b: bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x22); if (bVar3 == 0) { iVar14 = 3; iVar11 = 0x22; break; } goto switchD_00792e5b_caseD_24; case 0x23: bVar3 = HasPlayerForm(this,0xf); if ((bVar3 == 0) || (this->_activeDesc[slot]._varData == 0)) { iVar14 = 3; iVar11 = 1; break; } default: goto switchD_00792e5b_caseD_24; case 0x27: iVar14 = 3; iVar11 = 7; break; case 0x29: iVar14 = 3; iVar11 = 8; break; case 0x41: iVar14 = 3; iVar11 = 9; break; case 0x42: switchD_00792e5b_caseD_42: iVar14 = 3; iVar11 = 0xe; break; case 0x4e: iVar14 = 3; iVar11 = 0xb; break; case 0x7b: iVar14 = 3; iVar11 = 2; break; case 0x7c: if (this->_itemState == 0) { iVar14 = 3; iVar11 = 4; break; } goto switchD_00792e5b_caseD_24; case 0xab: iVar14 = 3; iVar11 = 0x20; break; case 0x11b: iVar14 = 3; iVar11 = 0x1c; break; case 0x11c: iVar14 = 3; iVar11 = 0x11; } LAB_00792f6c: ItemOverlay::Show(&g_game->_itemOverlay,iVar11,iVar14,(Entity_Player *)0x0); switchD_00792e5b_caseD_24: if (((int *)slot != (int *)0x0) || (local_44 = 1, this->_activeDesc[1]._item == 0)) { local_44 = 0; } local_50 = (Manager *)this->_activeDesc[slot]._varData; if ((g_game->_challenge == 0x20) && ((int *)slot == (int *)0x0)) { std::vector::copy_constructor(&g_manager->_itemConfig); piVar9 = local_88._data; local_8 = 1; candidateItems = (int *)slot; candidateItemsEnd = (int *)slot; candidateItemsCapacity = (int *)slot; FUN_0042c820(local_88._capacity - (int)local_88._data >> 2); piVar12 = candidateItemsEnd; if (piVar9 != (int *)local_88._capacity) { do { itemEntry = (int *)*piVar9; if (itemEntry != (int *)0x0) { if (*itemEntry == 3) { pIVar7 = (ItemConfig_Item *)itemEntry[1]; if (pIVar7 != (ItemConfig_Item *)0x1db) { if (pIVar7 != (ItemConfig_Item *)0x274) { local_78.y = (float)pIVar7; if (piVar12 == candidateItemsCapacity) { std::vector::_Emplace_reallocate(piVar12,&local_78.y); piVar12 = candidateItemsEnd; } else { *piVar12 = (int)pIVar7; candidateItemsEnd = piVar12 + 1; piVar12 = candidateItemsEnd; } } } } } piVar9 = piVar9 + 1; } while (piVar9 != (int *)local_88._capacity); } piVar9 = candidateItems; iVar11 = Isaac::Random((int)piVar12 - (int)candidateItems >> 2); local_54 = (Manager *)piVar9[iVar11]; if (((Manager *)this->_itemState != (Manager *)0x0) && (local_54 != (Manager *)this->_itemState) ) { ResetItemState(this); } this->_wildCardItem = (int)local_54; this->_wildCardItemType = 2; this->_wildCardVarData = 0; UseActiveItem(this,&local_56,(int)local_54,(local_56._1_1_ != '\0') + 2,-1,0); local_78.x._0_1_ = (char)*extraout_EAX; local_78.x._1_1_ = (byte)((ushort)*extraout_EAX >> 8); pIVar7 = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_54); AddCostume(this,pIVar7,1); if ((this->_itemState != 0) && ((bool)local_44 == (this->_activeDesc[1]._item != 0))) { DischargeActiveItem(this,0,0); } local_8 = local_8 & 0xffffff00; if (piVar9 != (int *)0x0) { uVar5 = ((int)candidateItemsCapacity - (int)piVar9 >> 2) * 4; piVar12 = piVar9; if (0xfff < uVar5) { piVar12 = (int *)piVar9[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)piVar9 + (-4 - (int)piVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar12,uVar5); } local_8 = 0xffffffff; FID_conflict__Tidy(&local_88._data); iVar11 = slotOffset; } else { if ((this->_itemState != 0) && (*(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset) != this->_itemState)) { ResetItemState(this); } iVar11 = slotOffset; this->_wildCardItemType = 2; this->_wildCardItem = *(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset); this->_wildCardVarData = this->_activeDesc[slot]._varData; UseActiveItem(this,&local_56,*(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset), (local_56._1_1_ != '\0') + 4,slot,0); local_78.x._0_1_ = (char)*extraout_EAX_00; local_78.x._1_1_ = (byte)((ushort)*extraout_EAX_00 >> 8); } bVar3 = HasCollectible(this,0x164,0); if ((((((bVar3 != 0) && (this->_itemState == 0)) && ((Manager *)local_6c.y == (Manager *)0x0)) && ((local_78.x._1_1_ == 0 && (iVar14 = *(int *)((int)(&(this->_sprite)._filename + -3) + iVar11), iVar14 != 0)))) && (0 < local_60)) && ((iVar14 != 0x20b && (iVar14 != 0x20f)))) { UseActiveItem(this,&local_56,iVar14,0x621,-1,(int)local_50); } if (local_70._3_1_ == '\0') { LAB_0079324d: if (local_78.x._0_1_ != '\0') { DischargeActiveItem(this,slot,local_78.x._1_1_); } } else if (local_78.x._0_1_ != '\0') { iVar14 = GetTrinketMultiplier(this,0x95); if (iVar14 == 2) { uVar5 = 10; } else { if (iVar14 < 3) goto LAB_0079324d; uVar5 = 5; } uVar5 = RNG::RandomInt((RNG *)((int)(this->_trinketRNGs)._begin + 0x950),uVar5); if (uVar5 != 0) goto LAB_0079324d; } if (local_78.x._1_1_ != 0) { RemoveCollectible(this,*(uint *)((int)(&(this->_sprite)._filename + -3) + iVar11),0,slot,1); } LAB_00793273: bVar3 = HasTrinket(this,4,0); if ((bVar3 != 0) && ((int *)slot == (int *)0x0)) { this->_isBrokenRemotePending = 1; } LAB_007935ed: fVar15 = local_6c.y; pMVar2 = (Manager *)this->_itemState; if ((((Manager *)local_6c.y == pMVar2) && (this->_itemStateCooldown < 1)) && (pMVar2 != (Manager *)0x0)) { if (pMVar2 == (Manager *)0x31) { iVar11 = 0x31; } else { iVar11 = *(int *)((int)(&(this->_sprite)._filename + -3) + slotOffset); } TryRemoveCollectibleCostume(this,iVar11,0); ResetItemState(this); if ((((Manager *)fVar15 != (Manager *)0x0) && ((Manager *)fVar15 != (Manager *)0x82)) && (((Manager *)fVar15 != (Manager *)0xb5 && ((Manager *)fVar15 != (Manager *)0x152)))) { AnimateCollectible(this,(int)fVar15,(byte *)"HideItem",(byte *)"PlayerPickupSparkle"); } } LAB_00793653: fVar15 = local_90.y; if (local_43 != '\0') { if (local_90.y == 9.1785e-43) { TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x32,1); iVar11 = savedSlot; if ((this->_activeDesc[savedSlot]._charge == 0) && (bVar3 = HasTrinket(this,0x8a,0), bVar3 != 0)) { DischargeActiveItem(this,iVar11,0); } } else if ((local_90.y != 4.56823e-43) && (pIVar7 = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_90.y), pIVar7 != (ItemConfig_Item *)0x0)) { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,(int)fVar15,-1); piVar9 = &this->_cacheFlags; *piVar9 = *piVar9 | pIVar7->cacheFlags; if (*piVar9 != 0) { EvaluateItems(); } } } if (((savedSlot == 0) && (iVar11 = GetTotalActiveCharge(this,0), totalChargeBefore != iVar11)) && ((bVar3 = HasTrinket(this,0x65,0), bVar3 != 0 || (bVar3 = HasTrinket(this,100,0), bVar3 != 0))) ) { this->_cacheFlags = this->_cacheFlags | 0x41f; EvaluateItems(); } ExceptionList = local_10; return; } //@@ 00793940 Entity_Player::HasTimedItem /* ZHL [lua] Lua binding EntityPlayer:HasTimedItem */ undefined4 __thiscall Entity_Player::HasTimedItem(Entity_Player *this) { ItemConfig_Item *pIVar1; pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,this->_activeDesc[0]._item); if ((pIVar1 == (ItemConfig_Item *)0x0) || (pIVar1->chargeType != 1)) { return 0; } return 1; } //@@ 00793970 Entity_Player::trigger_collectible_effect_removed /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: switch on the temporary effect's item id; 0x2c1 Dark Arts sets field 0x2004 (end blast pending) (characters-8) prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::trigger_collectible_effect_removed (Entity_Player *this,ItemConfig_Item *item,int count) { code *pcVar1; int *piVar2; ANM2 other; ANM2 *pAVar3; byte bVar4; ColorMod *color; ColorMod *color_00; ColorMod *color_01; uint uVar5; float *bodyLayerFrame; uint uVar6; int iVar7; LayerState *layer; Entity *tmpEntity; uint uVar8; PlayerCostumeMap *costumeEntry; void *extraout_EDX; ItemConfig_Item *costumeConfig; byte *layerName; TemporaryEffects *temporaryEffects; double dVar9; ANM2 aAStackY_8d20 [128]; undefined1 in_stack_fffffdf4 [204]; float in_stack_fffffec0; float in_stack_fffffec4; undefined1 in_stack_fffffec8 [20]; float in_stack_fffffedc; float in_stack_fffffee0; float in_stack_fffffee4; float in_stack_fffffee8; float fVar10; void *pvVar11; undefined4 uVar12; float fVar13; undefined4 uVar14; Vector *pVVar15; int iVar16; Vector trailVelocity; float playerY; float bodyX; undefined1 local_d8 [12]; float local_cc; float local_c8; Vector local_c4; Vector local_bc; Vector local_b4; float local_ac; char isCostumeWorn; void *local_a4; ItemConfig_Item *local_a0; float local_9c [12]; Color defaultColor; Color tmpColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; EntityPtr astralBody; Game *game; Manager *manager; local_8 = -NAN; puStack_c = &LAB_00aff6f0; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&tmpColor)[1]._colorize; iVar7 = item->type; if (((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) { ExceptionList = &local_10; if ((item->id == 0x76) && (iVar7 = GetCollectibleNum(this,0x76,0), iVar7 < 2)) { pvVar11 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar11 & 0xfffffffcU) < 0xb5) { costumeConfig = (ItemConfig_Item *)0x0; } else { costumeConfig = *(ItemConfig_Item **)((int)pvVar11 + 0xb4); } RemoveCostume(this,costumeConfig); } if ((item->id == 0x299) && (iVar7 = GetCollectibleNum(this,0x299,0), iVar7 < 2)) { pvVar11 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar11 & 0xfffffffcU) < 0x1f5) { costumeConfig = (ItemConfig_Item *)0x0; } else { costumeConfig = *(ItemConfig_Item **)((int)pvVar11 + 500); } RemoveCostume(this,costumeConfig); } if ((item->id == 0x2da) && (iVar7 = GetCollectibleNum(this,0x2da,0), iVar7 < 2)) { pvVar11 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar11 & 0xfffffffcU) < 0x1f9) { costumeConfig = (ItemConfig_Item *)0x0; } else { costumeConfig = *(ItemConfig_Item **)((int)pvVar11 + 0x1f8); } RemoveCostume(this,costumeConfig); } manager = g_manager; if (item->id == 0x271) { iVar7 = this->_playerCostumeMap[4]._index; if (-1 < iVar7) { local_b4.y = (float)(iVar7 * 0x130 + (int)(this->_costumeSpriteDescs)._begin); piVar2 = *(int **)(((ANM2 *)((int)local_b4.y + 0x114))->_filename)._buf; if (((piVar2 != (int *)0x0) && (*piVar2 == 3)) && (piVar2[1] == 0x271)) { local_a4 = (void *)0x410; seed_fart_sound_override((int *)&local_a4); iVar16 = 0; iVar7 = 0x3f800000; uVar14._0_1_ = 0; uVar14._1_1_ = 0; uVar14._2_2_ = 0; fVar13 = 2.8026e-45; uVar12._0_1_ = 0; uVar12._1_1_ = 0; uVar12._2_2_ = 0x3f80; fVar10 = 1.1138627e-38; pvVar11 = local_a4; SoundEffects::Play(&manager->_sfxManager,(int)local_a4,1.0,2,0,1.0,0.0); ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x20c),(ANM2 *)local_b4.y); other._color._offset[1] = in_stack_fffffec0; other._filename._buf[0] = in_stack_fffffdf4[0]; other._filename._buf[1] = in_stack_fffffdf4[1]; other._filename._buf[2] = in_stack_fffffdf4[2]; other._filename._buf[3] = in_stack_fffffdf4[3]; other._filename._buf[4] = in_stack_fffffdf4[4]; other._filename._buf[5] = in_stack_fffffdf4[5]; other._filename._buf[6] = in_stack_fffffdf4[6]; other._filename._buf[7] = in_stack_fffffdf4[7]; other._filename._buf[8] = in_stack_fffffdf4[8]; other._filename._buf[9] = in_stack_fffffdf4[9]; other._filename._buf[10] = in_stack_fffffdf4[10]; other._filename._buf[0xb] = in_stack_fffffdf4[0xb]; other._filename._buf[0xc] = in_stack_fffffdf4[0xc]; other._filename._buf[0xd] = in_stack_fffffdf4[0xd]; other._filename._buf[0xe] = in_stack_fffffdf4[0xe]; other._filename._buf[0xf] = in_stack_fffffdf4[0xf]; other._filename._size = in_stack_fffffdf4._16_4_; other._filename._capacity = in_stack_fffffdf4._20_4_; other._animDefaultName._buf[0] = in_stack_fffffdf4[0x18]; other._animDefaultName._buf[1] = in_stack_fffffdf4[0x19]; other._animDefaultName._buf[2] = in_stack_fffffdf4[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffdf4[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffdf4[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffdf4[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffdf4[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffdf4[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffdf4[0x20]; other._animDefaultName._buf[9] = in_stack_fffffdf4[0x21]; other._animDefaultName._buf[10] = in_stack_fffffdf4[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffdf4[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffdf4[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffdf4[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffdf4[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffdf4[0x27]; other._animDefaultName._size = in_stack_fffffdf4._40_4_; other._animDefaultName._capacity = in_stack_fffffdf4._44_4_; other._animState._animation = (void *)in_stack_fffffdf4._48_4_; other._animState._animData = (void *)in_stack_fffffdf4._52_4_; other._animState._layerFrames = (void *)in_stack_fffffdf4._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffdf4._60_4_; other._animState._animFrame = (float)in_stack_fffffdf4._64_4_; other._animState._isPlaying = in_stack_fffffdf4[0x44]; other._animState._21_3_ = in_stack_fffffdf4._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffdf4._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffdf4._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffdf4._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffdf4._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffdf4._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffdf4._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffdf4._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffdf4[100]; other._overlayAnimState._21_3_ = in_stack_fffffdf4._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffdf4._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffdf4._108_4_; other._overlayRenderFirst = in_stack_fffffdf4[0x70]; other._113_3_ = in_stack_fffffdf4._113_3_; other._animData = (void *)in_stack_fffffdf4._116_4_; other._animCount = in_stack_fffffdf4._120_4_; other._layerState = (void *)in_stack_fffffdf4._124_4_; other._layerCount = in_stack_fffffdf4._128_4_; other._nullLayerNames = (void *)in_stack_fffffdf4._132_4_; other._numNullLayers = in_stack_fffffdf4._136_4_; other._eventNames = (void *)in_stack_fffffdf4._140_4_; other._numEvents = in_stack_fffffdf4._144_4_; other._offset.x = (float)in_stack_fffffdf4._148_4_; other._offset.y = (float)in_stack_fffffdf4._152_4_; other._scale.x = (float)in_stack_fffffdf4._156_4_; other._scale.y = (float)in_stack_fffffdf4._160_4_; other._rotation = (float)in_stack_fffffdf4._164_4_; other._color._tint[0] = (float)in_stack_fffffdf4._168_4_; other._color._tint[1] = (float)in_stack_fffffdf4._172_4_; other._color._tint[2] = (float)in_stack_fffffdf4._176_4_; other._color._tint[3] = (float)in_stack_fffffdf4._180_4_; other._color._colorize[0] = (float)in_stack_fffffdf4._184_4_; other._color._colorize[1] = (float)in_stack_fffffdf4._188_4_; other._color._colorize[2] = (float)in_stack_fffffdf4._192_4_; other._color._colorize[3] = (float)in_stack_fffffdf4._196_4_; other._color._offset[0] = (float)in_stack_fffffdf4._200_4_; other._color._offset[2] = in_stack_fffffec4; other._championColor._tint[0] = (float)in_stack_fffffec8._0_4_; other._championColor._tint[1] = (float)in_stack_fffffec8._4_4_; other._championColor._tint[2] = (float)in_stack_fffffec8._8_4_; other._championColor._tint[3] = (float)in_stack_fffffec8._12_4_; other._championColor._colorize[0] = (float)in_stack_fffffec8._16_4_; other._championColor._colorize[1] = in_stack_fffffedc; other._championColor._colorize[2] = in_stack_fffffee0; other._championColor._colorize[3] = in_stack_fffffee4; other._championColor._offset[0] = in_stack_fffffee8; other._championColor._offset[1] = fVar10; other._championColor._offset[2] = (float)pvVar11; other._flipX = (byte)uVar12; other._flipY = SUB41(uVar12,1); other._258_2_ = SUB42(uVar12,2); other._playbackSpeed = fVar13; other._264_1_ = (char)uVar14; other._loaded = SUB41(uVar14,1); other._266_2_ = SUB42(uVar14,2); other._shadowLayerIndex = iVar7; other._bitflags = iVar16; ANM2::operator_assign(&(g_game->_itemOverlay)._megaMushPlayerSprite,other); layerName = (byte *)0x0; if ((g_game->_itemOverlay)._megaMushPlayerSprite._layerCount != 0) { do { layer = ANM2::GetLayer(&(g_game->_itemOverlay)._megaMushPlayerSprite,layerName); layerName = layerName + 1; (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; } while (layerName < (byte *)(g_game->_itemOverlay)._megaMushPlayerSprite._layerCount); } game = g_game; bVar4 = ANM2::SetAnimation(&(g_game->_itemOverlay)._megaMushPlayerSprite, (byte *)"TransformBack",1); if (bVar4 != 0) { AnimationState::Rewind(&(game->_itemOverlay)._megaMushPlayerSprite._animState); (game->_itemOverlay)._megaMushPlayerSprite._animState._isPlaying = 1; } ItemOverlay::Show(&g_game->_itemOverlay,0x2d,0,this); this->_visible = 0; KAGE_LogMessage(1,(byte *)"[Frame %d] Mega Mush Ending, starting Shrink Animation \n"); } } iVar7 = this->_damageCooldown; if (iVar7 < 0x5a) { iVar7 = 0x5a; } this->_damageCooldown = iVar7; } TryRemoveCollectibleCostume(this,item->id,1); manager = g_manager; iVar7 = item->id; if (iVar7 < 300) { if (iVar7 == 299) { switchD_00794b06_caseD_42: fVar10 = Room::time_scale_update(g_game->_room); (manager->_musicManager)._targetPitch = fVar10; manager = g_manager; if (item->id == 0x12a) { (g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]. _targetVolume = (g_manager->_optionsConfig)._musicVolume; (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._fadeRate = 0.08; ExceptionList = local_10; return; } if (item->id == 299) { stop_costume_item_anims(this); this->_cacheFlags = this->_cacheFlags | 0x1000; EvaluateItems(); ExceptionList = local_10; return; } ExceptionList = local_10; return; } switch(iVar7) { case 0x42: case 0x4d: case 0x5d: case 0x12a: goto switchD_00794b06_caseD_42; default: ExceptionList = local_10; return; case 0x75: goto switchD_00794b06_caseD_75; case 0x11a: if (this->_variant != 0) { ExceptionList = local_10; return; } this->_entityCollisionClass = 4; goto LAB_00794b21; } } if (0x262 < iVar7) { if (iVar7 != 0x2c0) { if (iVar7 != 0x2c1) { ExceptionList = local_10; return; } if (((this->_darkArtsLastSnare != (Entity *)0x0) && (tmpEntity = Entity::GetLastParent(this->_darkArtsLastSnare), tmpEntity != (Entity *)0x0 )) && (tmpEntity->_type == 1000)) { pAVar3 = &tmpEntity[1]._sprite; (pAVar3->_filename)._buf[8] = '\x01'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; pAVar3 = &tmpEntity[1]._sprite; (pAVar3->_filename)._buf[0xc] = '\x01'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; } this->_darkArtsBlastPending = 1; ExceptionList = local_10; return; } local_a4 = (void *)0x252; seed_fart_sound_override((int *)&local_a4); SoundEffects::Play(&manager->_sfxManager,(int)local_a4,1.0,2,0,1.0,0.0); try_trigger_astral_projection(this); Level::UpdateBackwardsPathStages(g_game->_room); if (this->_suplexState != 2) { ExceptionList = local_10; return; } if (this->_suplexAimCountdown < 1) { ExceptionList = local_10; return; } this->_suplexState = 5; ExceptionList = local_10; return; } if (iVar7 == 0x262) { switchD_00794b06_caseD_75: AddCostume(this,item,0); ExceptionList = local_10; return; } if (iVar7 == 0x199) { if (this->_variant != 0) { ExceptionList = local_10; return; } LAB_00794b21: this->_cacheFlags = this->_cacheFlags | 0x80; EvaluateItems(); ExceptionList = local_10; return; } if (iVar7 != 0x1f1) { if (iVar7 != 0x246) { ExceptionList = local_10; return; } switchD_00793aab_caseD_47: update_mini_mush_costume(this); ExceptionList = local_10; return; } } else { if (iVar7 != 2) { if (iVar7 != 0) { return; } iVar7 = item->id; if ((iVar7 < 0) || (pvVar11 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar11 >> 2 <= iVar7)) { local_a0 = (ItemConfig_Item *)0x0; } else { local_a0 = *(ItemConfig_Item **)((int)pvVar11 + iVar7 * 4); } isCostumeWorn = '\0'; ExceptionList = &local_10; if (iVar7 == 0x3f) { pvVar11 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar11 >> 2 < 0x45) { costumeConfig = (ItemConfig_Item *)0x0; } else { costumeConfig = *(ItemConfig_Item **)((int)pvVar11 + 0x110); } uVar8 = 0; costumeEntry = this->_playerCostumeMap; do { if ((-1 < costumeEntry->_index) && (*(ItemConfig_Item **) ((int)(this->_costumeSpriteDescs)._begin + costumeEntry->_index * 0x130 + 0x114) == costumeConfig)) { isCostumeWorn = '\x01'; goto LAB_00793a80; } uVar8 = uVar8 + 1; costumeEntry = costumeEntry + 1; } while (uVar8 < 0xf); isCostumeWorn = '\0'; LAB_00793a80: RemoveCostume(this,costumeConfig); } RemoveCostume(this,local_a0); manager = g_manager; iVar7 = item->id; switch(iVar7) { case 0x32: uVar8 = 0; pvVar11 = g_game->_room; if (*(int *)((int)pvVar11 + 0x1264) != 0) { do { iVar7 = *(int *)(*(int *)((int)pvVar11 + 0x125c) + uVar8 * 4); if ((*(int *)(iVar7 + 0x28) == 3) && (*(Entity_Player **)(iVar7 + 0x410) == this)) { *(uint *)(iVar7 + 0x16c) = *(uint *)(iVar7 + 0x16c) & 0xfffffdff; *(undefined4 *)(iVar7 + 0x168) = *(undefined4 *)(iVar7 + 0x168); *(undefined4 *)(iVar7 + 0x370) = *(undefined4 *)(*(int *)(iVar7 + 0x330) + 0x38); } uVar8 = uVar8 + 1; } while (uVar8 < *(uint *)((int)pvVar11 + 0x1264)); } bVar4 = HasCollectible(this,0x248,0); if (bVar4 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_d8,3,0xce, 0x28f,0,0); local_8 = 0.0; fVar13 = 0.0; fVar10 = local_cc; if (local_cc != 0.0) { do { piVar2 = *(int **)(local_d8._4_4_ + (int)fVar13 * 4); if ((Entity_Player *)piVar2[0x104] == this) { tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = g_vectorZero.x; tmpColor._colorize[2] = g_vectorZero.y; tmpColor._colorize[3] = g_vectorZero.x; tmpColor._offset[0] = g_vectorZero.y; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; (**(code **)(*piVar2 + 0x24))(); fVar10 = local_cc; } fVar13 = (float)((int)fVar13 + 1); } while ((uint)fVar13 < (uint)fVar10); } local_8 = -NAN; if (local_d8[0] == '\0') { local_8 = 1.4013e-45; tracked_alloc(1,(void *)local_d8._4_4_,0); local_8 = -NAN; } } EvaluateItems(); ExceptionList = local_10; return; default: ExceptionList = local_10; return; case 0x3e: iVar7 = this->_reverseEmpressMaxHearts; if (0 < iVar7) { do { if (2 < this->_soulHearts + this->_boneHearts * 2 + this->_maxHearts) { AddMaxHearts(this,-2,0); } iVar7 = iVar7 + -1; } while (iVar7 != 0); } this->_reverseEmpressMaxHearts = 0; ExceptionList = local_10; return; case 0x3f: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,iVar7); if (bVar4 != 0) { ExceptionList = local_10; return; } fVar10 = 1.0; pVVar15 = &g_vectorZero; if (isCostumeWorn == '\0') { Color::Color(&defaultColor); spawn_gibs(&this->_pos,4,40.0,(uint *)&DAT_00b6bc90,(Entity *)this,color_00,pVVar15,fVar10 ); } else { Color::Color(&tmpColor); spawn_gibs(&this->_pos,4,40.0,(uint *)&DAT_00b6bc8c,(Entity *)this,color,pVVar15,fVar10); iVar7 = 6; do { uVar8 = Random(); fVar10 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_a0 = (ItemConfig_Item *)(fVar10 + fVar10); uVar8 = Random(); local_9c[0] = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10; fVar10 = cos((float)local_a0); local_c4.x = fVar10 * local_9c[0] * 0.5 * this->_size + (this->_pos).x; fVar10 = sin((float)local_a0); local_c4.y = fVar10 * local_9c[0] * 0.5 * this->_size + (this->_pos).y; uVar8 = Random(); local_9c[0] = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_9c[0] = local_9c[0] + local_9c[0]; uVar8 = Random(); local_a0 = (ItemConfig_Item *) ((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 2.0); local_b4.x = cos(local_9c[0]); local_b4.x = local_b4.x * (float)local_a0; fVar10 = sin(local_9c[0]); local_b4.y = fVar10 * (float)local_a0; uVar8 = Random(); Game::Spawn(g_game,1000,0x23,&local_c4,&local_b4,(Entity *)this,0,uVar8); iVar7 = iVar7 + -1; } while (iVar7 != 0); } manager = g_manager; local_9c[0] = 1.91978e-43; seed_fart_sound_override((int *)local_9c); SoundEffects::Play(&manager->_sfxManager,(int)local_9c[0],1.0,2,0,1.0,0.0); ExceptionList = local_10; return; case 0x42: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,iVar7); if (bVar4 != 0) { ExceptionList = local_10; return; } if (this->_reverseSunBoneHearts < 1) { ExceptionList = local_10; return; } iVar7 = GetHealthType(this); if (iVar7 != 0) { ExceptionList = local_10; return; } local_a4 = (void *)this->_boneHearts; if ((int)extraout_EDX < (int)local_a4) { local_a4 = extraout_EDX; } iVar7 = 0; do { if (this->_boneHearts < 1) break; uVar8 = this->_boneHeartsMask; this->_boneHearts = this->_boneHearts + -1; uVar6 = 0; do { uVar5 = 1 << ((byte)uVar6 & 0x1f); if ((uVar8 & uVar5) != 0) { uVar5 = uVar5 - 1; this->_boneHeartsMask = uVar8 >> 1 & ~uVar5 | uVar5 & uVar8; break; } uVar6 = uVar6 + 1; } while (uVar6 < 0x20); iVar7 = iVar7 + 1; } while (iVar7 < this->_reverseSunBoneHearts); AddMaxHearts(this,(int)local_a4 * 2,0); UpdateHeartDependentEffects(this); this->_reverseSunBoneHearts = 0; ExceptionList = local_10; return; case 0x43: temporaryEffects = &this->_temporaryeffects; bVar4 = TemporaryEffects::HasNullEffect(temporaryEffects,iVar7); if (bVar4 != 0) { ExceptionList = local_10; return; } bVar4 = TemporaryEffects::HasCollectibleEffect(temporaryEffects,0x21); if (bVar4 == 0) { TemporaryEffects::AddCollectibleEffect(temporaryEffects,0x21,1,1); ExceptionList = local_10; return; } ExceptionList = local_10; return; case 0x46: local_9c[0] = 1.12104e-43; seed_fart_sound_override((int *)local_9c); SoundEffects::Play(&manager->_sfxManager,(int)local_9c[0],1.0,2,0,1.0,0.0); Color::Color(&defaultColor); Entity::MakeGroundPoof((Entity *)this,&this->_pos,color_01,1.0); Game::ShakeScreen(g_game,6); uVar8 = RNG::Next((RNG *)((int)(this->_cardRNGs)._begin + 0x490)); uVar6 = 0; local_d8._4_4_ = (void *)0x5; local_d8._8_4_ = 7; local_9c[0] = 3.08286e-44; while( true ) { local_a4 = g_game->_room; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> (local_d8[4] & 0x1f) ^ uVar8; uVar8 = uVar8 << (local_d8[8] & 0x1f) ^ uVar8; uVar8 = uVar8 >> (SUB41(local_9c[0],0) & 0x1f) ^ uVar8; local_a4 = (void *)ItemPool::GetSeededCollectible (uVar8,0,*(RoomDescriptor **)((int)local_a4 + 4)); fVar10 = (this->_pos).x; fVar13 = (this->_pos).y; if (uVar6 == 0) { local_bc.x = fVar10 - 40.0; pVVar15 = &local_bc; local_bc.y = fVar13 - 0.0; } else { local_b4.x = fVar10 + 40.0; pVVar15 = &local_b4; local_b4.y = fVar13 + 0.0; } Room::FindFreePickupSpawnPosition(g_game->_room,&local_c4,pVVar15,40.0,0,0,0); if (uVar8 == 0) break; uVar8 = uVar8 >> (local_d8[4] & 0x1f) ^ uVar8; uVar8 = uVar8 << (local_d8[8] & 0x1f) ^ uVar8; uVar8 = uVar8 >> (SUB41(local_9c[0],0) & 0x1f) ^ uVar8; Game::Spawn(g_game,5,100,&local_c4,&g_vectorZero,(Entity *)0x0,(uint)local_a4,uVar8); uVar5 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&local_c4,&g_vectorZero,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)tmpEntity + 0xc))(); uVar6 = uVar6 + 1; if (1 < uVar6) { bVar4 = ANM2::IsPlaying(&this->_bodySprite,(byte *)"Pickup"); if ((bVar4 == 0) && (bVar4 = ANM2::IsPlaying(&this->_bodySprite,(byte *)"Pickup_Online"), bVar4 == 0)) { ExceptionList = local_10; return; } ANM2::Reset(&this->_heldSprite); bodyLayerFrame = ANM2::GetLayerFrame(&this->_bodySprite,0); if (bodyLayerFrame == (float *)0x0) { ExceptionList = local_10; return; } uVar8 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar8) ; fVar10 = (this->_sprite)._scale.y; fVar13 = bodyLayerFrame[1]; iVar7 = *(int *)tmpEntity; (tmpEntity->_sprite)._offset.x = (this->_sprite)._scale.x * *bodyLayerFrame; (tmpEntity->_sprite)._offset.y = fVar10 * fVar13; (**(code **)(iVar7 + 0xc))(); ExceptionList = local_10; return; } } KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; case 0x47: goto switchD_00793aab_caseD_47; case 0x65: astralBody = this->_astralProjectionBody; if (astralBody == (EntityPtr)0x0) { ExceptionList = local_10; return; } local_a0 = (ItemConfig_Item *)(*(float *)((int)astralBody + 0x340) - (this->_pos).y); local_ac = *(float *)((int)astralBody + 0x33c) - (this->_pos).x; local_bc.y = (float)local_a0 * 0.1; local_bc.x = local_ac * 0.1; local_a4 = (void *)local_bc.x; local_9c[0] = local_bc.y; fVar10 = sqrtf(local_bc.y * local_bc.y + local_bc.x * local_bc.x); if ((4.0 < fVar10) && (0.0 < fVar10)) { local_bc.x = (float)local_a4 * (4.0 / fVar10); local_bc.y = local_9c[0] * (4.0 / fVar10); } local_ac = sqrtf((float)local_a0 * (float)local_a0 + local_ac * local_ac); local_ac = local_ac / 20.0; dVar9 = floor((double)local_ac); local_ac = (float)dVar9; iVar7 = (int)dVar9; if (iVar7 < 4) { iVar7 = 4; } if (0xc < iVar7) { iVar7 = 0xc; } if (0 < iVar7) { local_b4.y = (float)(iVar7 + 1); local_c4.y = 0.0; do { local_c4.y = (float)((int)local_c4.y + 1); local_a0 = (ItemConfig_Item *)((float)(int)local_c4.y / local_b4.y); bodyX = *(float *)((int)this->_astralProjectionBody + 0x33c); local_c8 = *(float *)((int)this->_astralProjectionBody + 0x340); local_ac = (this->_pos).x; playerY = (this->_pos).y; uVar8 = Random(); local_9c[0] = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)] ) * 2.3283064e-10 * 3.14; local_9c[0] = local_9c[0] + local_9c[0]; uVar8 = Random(); local_a4 = (void *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10); fVar10 = cos(local_9c[0]); local_d8._8_4_ = fVar10 * (float)local_a4 * 15.0 + (bodyX - local_ac) * (float)local_a0 + local_ac; fVar10 = sin(local_9c[0]); local_cc = fVar10 * (float)local_a4 * 15.0 + (local_c8 - playerY) * (float)local_a0 + playerY; uVar8 = Random(); uVar6 = Random(); trailVelocity.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; trailVelocity.x = local_bc.x * trailVelocity.y; trailVelocity.y = local_bc.y * trailVelocity.y; tmpEntity = Game::Spawn(g_game,1000,0x6f,(Vector *)(local_d8 + 8),&trailVelocity, (Entity *)0x0,0,uVar8); tmpColor._offset[0] = 1.0; tmpColor._offset[1] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._offset[2] = 1.0; (**(code **)(*(int *)tmpEntity + 0x3c))(); local_c8 = (float)local_a0 * g_vectorOne.x; local_a0 = (ItemConfig_Item *)((float)local_a0 * g_vectorOne.y); uVar8 = Random(); fVar10 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; (tmpEntity->_sprite)._scale.x = local_c8 * fVar10; (tmpEntity->_sprite)._scale.y = (float)local_a0 * fVar10; fVar10 = (this->_posOffset).y; fVar13 = (this->_sprite)._scale.y; (tmpEntity->_posOffset).x = (this->_posOffset).x + 0.0; (tmpEntity->_posOffset).y = fVar10 - fVar13 * 16.0; } while ((int)local_c4.y < iVar7); } uVar8 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x10,&this->_pos,&local_bc,(Entity *)0x0,10,uVar8); tmpColor._offset[0] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._colorize[0] = 1.0; tmpColor._colorize[1] = 1.0; tmpColor._colorize[2] = 1.0; tmpColor._colorize[3] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; (**(code **)(*(int *)tmpEntity + 0x3c))(); (tmpEntity->_posOffset).x = (this->_posOffset).x; (tmpEntity->_posOffset).y = (this->_posOffset).y; (tmpEntity->_sprite)._scale.x = (this->_sprite)._scale.x; (tmpEntity->_sprite)._scale.y = (this->_sprite)._scale.y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; local_cc = *(float *)((int)this->_astralProjectionBody + 0x340); local_d8._8_4_ = *(int *)((int)this->_astralProjectionBody + 0x33c); Teleport(this,(Vector *)(local_d8 + 8),0,0); iVar7 = this->_damageCooldown; if (iVar7 < 0x5a) { iVar7 = 0x5a; } this->_damageCooldown = iVar7; (**(code **)(*(int *)this + 0x60))(); tmpColor._offset[0] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[1] = 1.0; pcVar1 = *(code **)(*(int *)this + 0x3c); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = 1.0; tmpColor._offset[2] = 1.0; Color::operator_assign((Color *)(local_d8 + -0x60),&(this->_sprite)._color); FUN_004072e0(); (*pcVar1)(); (**(code **)(*(int *)this->_astralProjectionBody + 0x28))(); ExceptionList = local_10; return; } } ExceptionList = &local_10; TryRemoveTrinketCostume(this,item->id); if (item->id != 0x45) { ExceptionList = local_10; return; } } (**(code **)(*(int *)this + 0x60))(); ExceptionList = local_10; return; } //@@ 00794e50 Entity_Player::update_effects /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: per-tick player update: Dark Arts snaring (+0x2004/+0x2008/+0x200c), the end blast, Mars, hallowed ground... (characters_9.md) */ void __thiscall Entity_Player::update_effects(Entity_Player *this) { code *pcVar1; EntityPtr EVar2; ColorMod color; ColorMod color_00; Vector direction; Vector direction_00; BitSet128 tearFlags; BitSet128 flags; BitSet128 flags_00; RNG rng; Vector sizeMulti; Vector pos; Vector position; Vector position_00; byte bVar3; char cVar4; undefined3 extraout_var; int iVar5; EntityList_EL *pEVar6; Vector *tmpVec; uint uVar7; Entity *pEVar8; PersistentGameData *persistentData; void *pvVar9; Room *room; BitSet128 *pBVar10; Room *pRVar11; undefined4 *puVar12; undefined1 *puVar13; ItemConfig *itemConfig; ColorMod *color_01; Entity_Effect *effect; Entity_Bomb *bomb; TemporaryEffects *tempEffects; RNG *pRVar14; float fVar15; MusicManager *musicManager; Music *music; Level *level; ColorMod *pCVar16; ItemConfig_Item *configItem; PlayerManager *playerManager; GridEntity *pGVar17; EntityList *entityList; Entity *pEVar18; int *piVar19; SoundEffects *sfx; EntityRef *sourceRef; RNG *music; Vector *pVVar20; float *pfVar21; RNG *playerManager; Sprite *sprite; Entity_Tear *pEVar22; LayerState *layer; ANM2 *anm; ColorMod *color_02; ItemPool *itemPool; HUD *hud; Entity_Familiar *pEVar23; Entity_Laser *laser; std_string *animName; Entity_Pickup *pickup; float fVar24; Entity_NPC *pEVar25; Vector *offset; Vector *offset_00; undefined1 *puVar26; ColorMod *from; byte *pbVar27; EntityConfig *entityConfig; EntityConfig_Entity *entityConfigEntry; int iVar28; int blue; Entity_Player *entityList; uint uVar30; Entity_Player *pEVar31; Entity_Player *pEVar32; ActiveItemDesc *pAVar33; byte *layerName; bool bVar34; float10 fVar35; void *pvVar36; undefined1 auVar38 [12]; undefined1 auVar39 [12]; double dVar37; BitSet128 flags_01; undefined1 extraout_var_00 [12]; undefined1 auVar40 [16]; undefined1 auVar41 [16]; undefined1 auVar42 [16]; BitSet128 BVar43; undefined1 extraout_var_01 [12]; undefined1 extraout_var_02 [12]; undefined1 extraout_var_03 [12]; undefined1 extraout_var_04 [12]; undefined1 extraout_var_05 [12]; BitSet128 BVar44; undefined1 auVar45 [16]; ulonglong uVar46; Color aCStackY_2e04 [128]; undefined4 in_stack_ffffe824; undefined1 *in_stack_ffffe828; uint in_stack_ffffe82c; Vector *in_stack_ffffe830; Vector *in_stack_ffffe834; Entity_Player *in_stack_ffffe838; EntityList_EL *in_stack_ffffe83c; Entity_Player *in_stack_ffffe840; undefined4 uVar47; undefined4 uVar48; TypeDescriptor *outResult; char *pcVar49; Entity_Player *pEVar50; undefined4 uVar51; byte bVar52; BitSet128 *pBVar53; EntityRef local_17a0; EntityRef local_1778; EntityRef local_1750; EntityRef local_1728; EntityRef local_1700; EntityRef local_16d8; EntityRef local_16b0; EntityRef local_1688; EntityRef local_1660; EntityRef local_1638; EntityRef local_1610; EntityRef local_15e8; EntityRef local_15c0; EntityRef local_1598; EntityRef local_1570; EntityRef local_1548; EntityRef local_1520; Capsule local_14f8 [10]; Capsule local_14d0 [10]; EntityRef local_14a8; BitSet128 local_1470; BitSet128 local_1460; BitSet128 local_1450; BitSet128 local_1440; BitSet128 local_1430; BitSet128 local_1420; BitSet128 local_1410; BitSet128 local_1400; BitSet128 local_13f0; BitSet128 local_13e0; BitSet128 local_13d0; BitSet128 local_13c0; BitSet128 local_13b0; BitSet128 local_13a0; BitSet128 local_1390; BitSet128 local_1380; BitSet128 local_1370; BitSet128 local_1360; BitSet128 local_1350; BitSet128 local_1340; BitSet128 local_1330 [2]; BitSet128 local_1310; BitSet128 local_1300 [3]; undefined1 local_12d0 [20]; undefined1 local_12bc [20]; EntityRef local_12a8; Vector local_1280; Vector local_1278; Vector local_1270; Vector local_1268; Vector local_1260; Vector local_1258; Vector local_1250; Vector local_1248; Vector local_1240; Vector local_1238; Vector local_1230; Vector local_1228; Vector local_1220; Vector local_1218; Vector local_1210; Vector local_1208; Vector local_1200; Vector local_11f8; Vector local_11f0; Vector local_11e8; Vector local_11e0; Vector local_11d8; Vector local_11d0; Vector local_11c8; Vector local_11c0; Vector local_11b8; Vector local_11b0; Vector local_11a8; Vector local_11a0; Vector local_1198; Vector local_1190; Vector local_1188; Vector local_1180; Vector local_1178; Vector local_1170; Vector local_1168; Vector local_1160; Vector local_1158; Vector local_1150; Vector local_1148; Vector local_1140; Vector local_1138; Vector local_1130; Vector local_1128; Vector local_1120; Vector local_1118; Vector local_1110; Vector local_1108; Vector local_1100; Vector local_10f8; Vector local_10f0; Vector local_10e8; Vector local_10e0; Vector local_10d8; Vector local_10d0; Vector local_10c8; Vector local_10c0; Vector local_10b8; Vector local_10b0; Vector local_10a8; Vector local_10a0; Vector local_1098; Vector local_1090; Vector local_1088; Vector local_1080; Vector local_1078; Vector local_1070; Vector local_1068; Vector local_1060; Vector local_1058; Vector local_1050; Vector local_1048; Vector local_1040; Vector local_1038; Vector local_1030; Vector local_1028; Vector local_1020; Vector local_1018; Vector local_1010; Vector local_1008; Vector local_1000; Vector local_ff8; Vector local_ff0; Vector local_fe8; Vector local_fe0; Vector local_fd8; Vector local_fd0; Vector local_fc8; Vector local_fc0; Vector local_fb8; Vector local_fb0; Vector local_fa8; Vector local_fa0; Vector local_f98; Vector local_f90; Vector local_f88; Vector local_f80; Vector local_f78; Vector local_f70; Vector local_f68; Vector local_f60; Vector local_f58; Vector local_f50; Vector local_f48; Vector local_f40; Vector local_f38; Vector local_f30; Vector local_f28; Vector local_f20; Vector local_f18; Vector local_f10; Vector local_f08; Vector local_f00; Vector local_ef8; Vector local_ef0 [2]; Vector local_ee0; Vector local_ed8; Vector local_ed0; Vector local_ec8; Vector local_ec0; Vector local_eb8; Vector local_eb0; Vector local_ea8; Vector local_ea0; Vector local_e98; Vector local_e90; Vector local_e88; Vector local_e80; Vector local_e78; Vector local_e70; Vector local_e68; Vector local_e60; Vector local_e58; Vector local_e50; Vector local_e48; Vector local_e40; Vector local_e38; Vector local_e30; Vector local_e28; Vector local_e20; undefined1 local_e18 [32]; float local_df8; undefined1 local_df0 [8]; int local_de8; undefined1 local_de0 [8]; undefined4 local_dd8; undefined1 local_dd0 [8]; undefined4 local_dc8; undefined1 local_dc0 [8]; int local_db8; EntityList_EL local_db0; BitSet128 local_da0; BitSet128 local_d90; Vector local_d7c; Vector local_d74; EntityPtr local_d6c [2]; Vector local_d64; Vector local_d5c; Vector local_d54; Vector local_d4c; Vector local_d44; Vector local_d3c; EntityList_EL local_d34; EntityList_EL local_d24; EntityList_EL local_d14; EntityList_EL local_d04; EntityList_EL local_cf4; EntityList_EL local_ce4; EntityList_EL local_cd4; EntityList_EL local_cc4; EntityList_EL local_cb4; EntityList_EL local_ca4; EntityList_EL local_c94; EntityList_EL local_c84; Vector local_c74; Vector local_c6c; Vector local_c64; Vector local_c5c; Vector local_c54; Vector local_c4c; Vector newVelocity; EntityList_EL local_c3c; float local_c2c; float local_c28; float local_c24; float local_c20; float local_c1c; float local_c18; float local_c14; float local_c10; float local_c0c; Entity_Player *local_c08; Entity *local_c04; float local_c00; float local_bfc; float local_bf8; float local_bf4; float local_bf0; float local_bec; float local_be8; float local_be4; float local_be0; float local_bdc; float local_bd8; undefined4 local_bd4; float local_bd0; undefined4 local_bcc; float local_bc8; void *local_bc4; void *local_bc0; void *local_bbc; float local_bb8; float local_bb4; float local_bb0; float local_bac; float local_ba8; float local_ba4; float local_ba0; float local_b9c; float local_b98; EntityList_EL local_b94; float local_b84; float local_b80; float local_b7c; float local_b78; float local_b74; float local_b70; float local_b6c; float local_b68; float local_b64; float local_b60; float local_b5c; float local_b58; float local_b54; float local_b50; float local_b4c; float local_b48; float local_b44; float local_b40; float local_b3c; float local_b38; Vector dashDir; float local_b2c [2]; float bendFactor; float local_b20 [2]; int local_b18; float local_b14; float local_b10; float local_b0c; float local_b08; float local_b04; float local_b00; undefined1 local_afa [2]; undefined1 targetIndices [12]; Vector pushDir; Vector rageDir; EntityList_EL local_adc; Vector cordStart; Vector megaBlastDir; float local_abc; float local_ab8; Vector spawnPos; void *local_aac; Vector snareOffset; Vector cordEnd; EntityList_EL local_a98; Vector toEnemy; Vector averagePos; Vector rageLaserDir; float pushRadius; float shadowScale; float chargeLeft; float projectileSpeed; Vector toProjectile; WeightedOutcomePicker poolPicker [3]; undefined1 cordEntities [12]; float local_a40; Entity *local_a3c; void *local_a38; Entity_Tear *local_a34; Entity_Player *local_a30; byte local_a29; Entity_Tear *local_a28; Entity_Player *local_a24; float local_a20; Entity_Familiar *local_a1c; Entity_Tear *local_a14; byte local_a0d; Entity_Tear *local_a0c; Entity_Player *local_a08; Entity_NPC *local_a04; Entity_Player *local_a00; Entity_Player *local_9fc; undefined1 local_9f8 [104]; undefined1 local_990 [160]; BitSet128 local_8f0 [6]; BitSet128 local_888 [8]; Color local_7fc [5]; ColorMod local_720; ColorMod local_6f4 [2]; Color local_69c [9]; Color local_510 [8]; undefined1 local_3a0 [8]; undefined1 local_398 [48]; BitSet128 local_368; EntityList_EL *local_358; BitSet128 local_300 [8]; Color local_278; Color local_24c [2]; Color local_1f4; char local_1c8 [24]; undefined1 local_1b0 [44]; Color local_184; RNG local_158; RNG local_148; char local_138 [24]; char local_120 [24]; char local_108 [24]; char local_f0 [24]; char local_d8 [24]; char local_c0 [24]; char local_a8 [24]; char local_90 [24]; undefined1 local_78 [68]; RNG local_34; void *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_78 + 0x74; local_14 = -NAN; puStack_18 = &LAB_00aff8a0; local_1c = ExceptionList; local_24 = (void *)(__security_cookie ^ (uint)(local_78 + 0x68)); if (*(int *)&g_game->_stageTransition != 0) { return; } ExceptionList = &local_1c; local_a24 = this; puVar13 = local_78 + 0x74; if (this->_isPlayingExtraAnimation != 0) { bVar3 = ANM2::IsPlaying(&this->_sprite,(byte *)"Trapdoor"); puVar13 = puStack_20; if (bVar3 != 0) { ExceptionList = local_1c; return; } } puStack_20 = puVar13; UpdateBookOfVirtues(this,0); piVar19 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if (((piVar19 != (int *)0x0) && (piVar19[2] == 0x10)) && (*piVar19 == 0x23)) { piVar19 = &this->_activeDesc[0]._varData; local_a34 = (Entity_Tear *)0x0; do { if ((((ActiveItemDesc *)(piVar19 + -7))->_item == 0x1a6) && (*piVar19 < 3)) { *piVar19 = 3; FullCharge(this,(int)local_a34,0,0); } local_a34 = (Entity_Tear *)((int)local_a34 + 1); piVar19 = piVar19 + 8; } while (local_a34 < &DAT_00000004); } bVar3 = HasTrinket(this,0x78,0); pvVar36 = (void *)0x3f800000; shadowScale = 1.0; if (((bVar3 != 0) && (pcVar49 = g_game->_room, *pcVar49 != '\0')) && ((g_game->_frameCount - *(int *)(pcVar49 + 0x11f0) == 1 && ((*(int *)(pcVar49 + 8) == 5 && (pcVar49[1] != '\0')))))) { local_a34 = (Entity_Tear *)((uint)local_a34 & 0xffffff00); bVar3 = HasGoldenTrinket(this,0x78); if ((bVar3 != 0) || (bVar3 = HasCollectible(this,0x1b7,0), bVar3 != 0)) { local_a34 = (Entity_Tear *)CONCAT31(local_a34._1_3_,1); } uVar30 = 0; do { bVar3 = FullCharge(this,uVar30,0,(byte)local_a34); manager = g_manager; if (CONCAT31(extraout_var,bVar3) != 0) break; uVar30 = uVar30 + 1; } while (uVar30 < 4); local_abc = 2.38221e-43; seed_fart_sound_override((int *)&local_abc); SoundEffects::Play(&manager->_sfxManager,(int)local_abc,1.0,2,0,1.0,0.0); uVar30 = Random(); in_stack_ffffe838 = (Entity_Player *)0x0; in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &this->_pos; in_stack_ffffe82c = 0x31; in_stack_ffffe828 = (undefined1 *)0x3e8; in_stack_ffffe824 = 0x79506a; in_stack_ffffe840 = (Entity_Player *) Game::Spawn(g_game,1000,0x31,in_stack_ffffe830,&g_vectorZero,(Entity *)0x0,1,uVar30); in_stack_ffffe83c = (EntityList_EL *)0x795070; iVar5 = __RTDynamicCast(); *(undefined4 *)(iVar5 + 0xdc) = 0; *(undefined4 *)(iVar5 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar5 + 0x358) = 0x3f800000; } tempEffects = &this->_temporaryeffects; local_a34 = (Entity_Tear *)tempEffects; local_a0d = TemporaryEffects::HasNullEffect(tempEffects,0x3d); bVar3 = HasCollectible(this,0x226,0); if ((((((bVar3 != 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x226), bVar3 == 0)) || (local_a0d != 0)) && ((*(char *)g_game->_room != '\0' && (0x1e < g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0))))) && (bVar3 = Entity::IsFrame((Entity *)this,10,0), bVar3 != 0)) && ((uVar30 = Random(), uVar30 % 5 == 0 && (*(int *)((int)g_game->_room + 0x1bb0) != 6)))) { in_stack_ffffe840 = (Entity_Player *)0x3e8; in_stack_ffffe83c = &local_db0; in_stack_ffffe838 = (Entity_Player *)0x795164; pEVar6 = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),in_stack_ffffe83c,1000,0x1d,-1,0 ,0); uVar30 = pEVar6->_size; if (local_db0._0_1_ == '\0') { local_14 = 0.0; tracked_alloc(1,local_db0._data,0); local_14 = -NAN; } if (uVar30 < 2) { uVar30 = Random(); local_a3c = (Entity *)(this->_pos).x; local_a08 = (Entity_Player *)(this->_pos).y; tmpVec = MusicManager::RandomVector(&local_1000); local_a28 = (Entity_Tear *)(tmpVec->x * 40.0); local_a04 = (Entity_NPC *)(tmpVec->y * 40.0); uVar7 = Random(); pvVar36 = (void *)((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10); Vector::Vector(&local_d3c,(float)local_a3c + (float)local_a28 * (float)pvVar36, (float)local_a04 * (float)pvVar36 + (float)local_a08); in_stack_ffffe840 = (Entity_Player *)&local_d3c; in_stack_ffffe83c = (EntityList_EL *)&DAT_0000001d; in_stack_ffffe838 = (Entity_Player *)0x3e8; in_stack_ffffe834 = (Vector *)0x795279; pEVar8 = Game::Spawn(g_game,1000,0x1d,(Vector *)in_stack_ffffe840,&g_vectorZero,(Entity *)0x0, 0,uVar30); tmpVec = Entity::Position(pEVar8,&local_1008); Entity::SetTargetPosition(pEVar8,*tmpVec); (**(code **)(*(int *)pEVar8 + 0x40))(); (**(code **)(*(int *)pEVar8 + 0xc))(); } } iVar5 = Game::Challenge(g_game); if (iVar5 == 0x16) { iVar5 = Game::GetFrameCount(); if ((0x7080 < iVar5) && (bVar3 = Entity::IsFrame((Entity *)this,300,0), bVar3 != 0)) { pcVar1 = *(code **)(*(int *)this + 0x20); EntityRef::EntityRef(&local_1778); in_stack_ffffe840 = (Entity_Player *)0x3f800000; in_stack_ffffe83c = (EntityList_EL *)0x795311; (*pcVar1)(); } } else { iVar5 = Game::Challenge(g_game); if (((iVar5 == 0x18) && (this->_dead == 0)) && (this->_numCoins < 1)) { pcVar1 = *(code **)(*(int *)this + 0x24); EntityRef::EntityRef(&local_1750); (*pcVar1)(); EntityRef::EntityRef(&local_12a8); local_12a8._type = 0x125; local_12a8._variant = 0; set_last_damage(); } } if (this->_playerType == 0xb) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar3 = PersistentGameData::Unlocked(persistentData,0x14b); if ((bVar3 != 0) && (bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0xd6), bVar3 == 0)) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0xd6,1,1); } } pEVar22 = (Entity_Tear *)&this->_temporaryeffects; pvVar9 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0x41); if ((pvVar9 != (void *)0x0) && (*(int *)((int)pvVar9 + 8) % 5 == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::get_random_pickup_position(room,&local_d44,0,0); uVar30 = Random(); in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &local_d44; in_stack_ffffe82c = 3; in_stack_ffffe828 = &DAT_00000004; in_stack_ffffe824 = 0x79543a; in_stack_ffffe838 = this; in_stack_ffffe840 = (Entity_Player *) Game::Spawn(g_game,4,3,in_stack_ffffe830,&g_vectorZero,(Entity *)this,0,uVar30); in_stack_ffffe83c = (EntityList_EL *)0x795440; local_a28 = (Entity_Tear *)__RTDynamicCast(); if (local_a28 != (Entity_Tear *)0x0) { pBVar10 = GetBombFlags(this,&local_1450,0); pvVar36 = *(void **)&pBVar10->_l; in_stack_ffffe840 = (Entity_Player *)0x795473; FUN_006a6910(); } } pvVar9 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0xa0); if ((pvVar9 != (void *)0x0) && (*(int *)((int)pvVar9 + 8) % 5 == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); tmpVec = Room::GetRandomPosition(pRVar11,&local_1010,20.0); Room::FindFreePickupSpawnPosition(room,&spawnPos,tmpVec,0.0,0,0,0); iVar5 = Isaac::Random(2); if (iVar5 == 0) { Level::GetCurrentRoom((Level *)g_game); local_a0c = (Entity_Tear *)Room::GetEntities(); FUN_00424510(); local_14 = 1.4013e-45; EntityList::Size(); FUN_0042c820(); pEVar31 = (Entity_Player *)0x0; local_9fc = (Entity_Player *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); bVar3 = Entity::IsVulnerableEnemy((Entity *)*puVar12,(Entity *)0x0); if (bVar3 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); puVar12 = (undefined4 *)std::vector::operator_index(); tmpVec = Entity::Position((Entity *)*puVar12,&local_1018); local_a20 = tmpVec->x; pvVar36 = (void *)tmpVec->y; local_a1c = pvVar36; iVar5 = Room::GetGridCollisionAtPos(room,*tmpVec); pEVar31 = local_9fc; if (iVar5 == 0) { std::vector::operator_index(); std::vector::push_back(); } } pEVar31 = (Entity_Player *)&pEVar31->field_0x1; local_9fc = pEVar31; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar31 < puVar13); this = local_a24; } iVar5 = std::vector::size(targetIndices); if (iVar5 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar5 = std::vector::size(targetIndices); Isaac::Random(iVar5); puVar12 = (undefined4 *)FUN_0042c810(); tmpVec = Entity::Position((Entity *)*puVar12,&local_1020); tmpVec = Room::FindFreePickupSpawnPosition(room,&local_1028,tmpVec,0.0,0,0,0); Vector::operator_assign(&spawnPos,tmpVec); } local_14 = -NAN; FID_conflict__Tidy(targetIndices); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); pos.y = spawnPos.y; pos.x = spawnPos.x; iVar5 = Room::GetGridCollisionAtPos(room,pos); if (iVar5 == 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pRVar11 = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar5 = Room::GetGridIndex(pRVar11,&spawnPos); Room::SetGridPath(room,iVar5,900); } uVar30 = Random(); in_stack_ffffe840 = (Entity_Player *)&spawnPos; in_stack_ffffe83c = (EntityList_EL *)&DAT_00000013; in_stack_ffffe838 = (Entity_Player *)0x3e8; in_stack_ffffe834 = (Vector *)0x7956f9; pEVar8 = Game::Spawn(g_game,1000,0x13,(Vector *)in_stack_ffffe840,&g_vectorZero,(Entity *)this,0 ,uVar30); pcVar1 = *(code **)(*(int *)pEVar8 + 0x40); fVar35 = (float10)Entity::CollisionDamage(pEVar8); local_a04 = (Entity_NPC *)(float)fVar35; FUN_0060d040(); local_a28 = (Entity_Tear *)((float)pvVar36 + (float)local_a04); (*pcVar1)(); Entity::SetParent(pEVar8,(Entity *)local_a24); pEVar22 = local_a34; this = local_a24; } itemConfig = Isaac::GetItemConfig(); ItemConfig::GetCollectible(itemConfig,0xb4); iVar5 = FUN_00930a00(); if ((iVar5 != 0) && (*(int *)(iVar5 + 8) % 5 == 0)) { Color::Color(local_69c); in_stack_ffffe840 = (Entity_Player *)&this->_pos; Game::Fart(g_game,(Vector *)in_stack_ffffe840,100.0,(Entity *)this,1.0,0,color_01); Game::ButterBeanFart(g_game,(Vector *)in_stack_ffffe840,120.0,(Entity *)this,0,1); uVar30 = Random(); in_stack_ffffe83c = (EntityList_EL *)0x8d; in_stack_ffffe838 = (Entity_Player *)0x3e8; in_stack_ffffe834 = (Vector *)0x795805; effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x8d,(Vector *)in_stack_ffffe840,&g_vectorZero,(Entity *)this,0 ,uVar30); Entity_Effect::SetTimeout(effect,0x5a); (**(code **)(*(int *)effect + 0xc))(); pEVar22 = (Entity_Tear *)&this->_temporaryeffects; } itemConfig = Isaac::GetItemConfig(); Config::GetNullItem(itemConfig,0); local_a28 = (Entity_Tear *)FUN_00930a00(); if ((local_a28 != (Entity_Tear *)0x0) && ((((GridEntity *)local_a28)->_desc)._variant % 10 == 0)) { iVar5 = this->_playerType; uVar30 = Random(); in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &this->_pos; in_stack_ffffe82c = 9; if (iVar5 != 0x19) { in_stack_ffffe82c = 0; } in_stack_ffffe828 = &DAT_00000004; in_stack_ffffe824 = 0x7958a0; in_stack_ffffe838 = this; in_stack_ffffe840 = (Entity_Player *) Game::Spawn(g_game,4,in_stack_ffffe82c,in_stack_ffffe830,&g_vectorZero,(Entity *)this,0, uVar30); in_stack_ffffe83c = (EntityList_EL *)0x7958a6; bomb = (Entity_Bomb *)__RTDynamicCast(); if (bomb != (Entity_Bomb *)0x0) { GetBombFlags(this,&local_1460,0); in_stack_ffffe840 = (Entity_Player *)0x7958d1; FUN_006a6910(); if (1 < ((GridEntityDesc *)&local_a28->field_0x4)->_type) { pBVar53 = &g_tearFlagHoming; pBVar10 = (BitSet128 *)Entity_Bomb::Flags(bomb); BitSet128::operator_or(&local_1470,pBVar10,pBVar53); in_stack_ffffe840 = (Entity_Player *)0x79590f; FUN_006a6910(); FUN_006a6930(); } } pEVar22 = (Entity_Tear *)&this->_temporaryeffects; } itemConfig = Isaac::GetItemConfig(); Config::GetNullItem(itemConfig,0x1c); iVar5 = FUN_00930a00(); local_a04 = (Entity_NPC *)0x41200000; if ((iVar5 != 0) && ((*(byte *)(iVar5 + 8) & 1) == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_a00 = (Entity_Player *)Room::GetGridIndex(room,&this->_pos); room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_a28 = (Entity_Tear *)Room::GetGridEntity(room,(uint)local_a00); if ((local_a28 == (Entity_Tear *)0x0) || ((iVar5 = GridEntity::GetType(), iVar5 == 1 || (iVar5 = GridEntity::GetType(), iVar5 == 10))) ) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::is_type_16(room); if (bVar3 == 0) { local_a0c = (Entity_Tear *)GetPillRNG(); pEVar31 = (Entity_Player *)0x0; local_9fc = (Entity_Player *)0x0; bVar3 = HasCollectible(this,0x21f,0); if (bVar3 == 0) { tempEffects = (TemporaryEffects *)GetEffects(this); bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x21f); if (bVar3 != 0) goto LAB_00795a1c; } else { LAB_00795a1c: pRVar14 = GetCollectibleRNG(this,0x21f); uVar30 = RNG::RandomInt(pRVar14,100); if (uVar30 < 0x21) { pEVar31 = (Entity_Player *)&DAT_00000006; } local_9fc = pEVar31; } bVar3 = HasTrinket(this,0x5b,0); if (bVar3 != 0) { local_9fc = (Entity_Player *)0x21; iVar5 = GetTrinketMultiplier(this,0x5b); if (iVar5 == 2) { local_9fc = (Entity_Player *)0x42; } else if (iVar5 == 3) { local_9fc = (Entity_Player *)0x64; } pRVar14 = (RNG *)FUN_005cbd00(); fVar15 = (float)RNG::RandomInt(pRVar14,100); if ((uint)fVar15 < local_9fc) { pEVar31 = (Entity_Player *)&DAT_00000005; } local_9fc = pEVar31; } bVar3 = HasCollectible(this,0xca,0); if (bVar3 != 0) { uVar30 = RNG::RandomInt((RNG *)local_a0c,100); if ((int)(uVar30 - (int)(this->_luck * 10.0)) < 0x1a) { pEVar31 = (Entity_Player *)0x3; } local_9fc = pEVar31; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar30 = RNG::Next((RNG *)local_a0c); Room::SpawnGridEntity(room,(int)local_a00,0xe,(uint)local_9fc,uVar30,0); in_stack_ffffe83c = (EntityList_EL *)0x795b43; Game::ButterBeanFart(g_game,&this->_pos,120.0,(Entity *)this,0,0); in_stack_ffffe840 = (Entity_Player *)0x795b60; play_sound_with_fart_seed(0x25,1.0,2,0,1.0); ShootCandle(this,&g_vectorZero); pEVar22 = (Entity_Tear *)&this->_temporaryeffects; } } } bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x4d); if (bVar3 == 0) { bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,299); if ((bVar3 != 0) && (pvVar36 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,299), *(int *)((int)pvVar36 + 8) != 0)) { local_9fc = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,299); musicManager = (MusicManager *)MusicManager::MusicManager(); MusicManager::PitchSlide(musicManager); goto LAB_00795cf2; } bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x5d); if (bVar3 != 0) { local_9fc = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0x5d); musicManager = (MusicManager *)MusicManager::MusicManager(); MusicManager::PitchSlide(musicManager); goto LAB_00795cf2; } bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x12a); if (bVar3 != 0) { local_9fc = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0x12a); bVar3 = Entity::IsFrame((Entity *)this,0x18,0); if ((bVar3 != 0) && (iVar5 = Isaac::Random(2), iVar5 != 0)) { musicManager = (MusicManager *)MusicManager::MusicManager(); random_float(); MusicManager::PitchSlide(musicManager); music = (Music *)MusicManager::MusicManager(); iVar5 = Isaac::Random(3); if (iVar5 == 0) { fVar15 = 0.0; } else { fVar15 = 1.0; } Music::VolumeSlide(music,fVar15,0.08); pEVar22 = (Entity_Tear *)&this->_temporaryeffects; } goto LAB_00795cf2; } } else { local_9fc = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0x4d); musicManager = (MusicManager *)MusicManager::MusicManager(); MusicManager::PitchSlide(musicManager); LAB_00795cf2: if (local_9fc != (Entity_Player *)0x0) { pvVar36 = (local_9fc->_damageEvents)._begin; if ((int)pvVar36 < 0x1f) { local_9fc = *(Entity_Player **)(*(int *)this + 0x3c); if (((uint)pvVar36 & 1) == 0) { in_stack_ffffe840 = (Entity_Player *)Color::Color(); } else { in_stack_ffffe840 = (Entity_Player *)FUN_00757980(); } in_stack_ffffe83c = (EntityList_EL *)0x795e7b; (*(code *)local_9fc)(); } else { uVar30 = (uint)pvVar36 & 0x80000003; bVar34 = uVar30 == 0; if ((int)uVar30 < 0) { bVar34 = (uVar30 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar34) { Color::Color((Color *)(local_1b0 + 0x2c)); iVar5 = Isaac::Random(6); if (iVar5 == 0) { iVar28 = 0; local_a00 = (Entity_Player *)0x32; iVar5 = 0xff; blue = 0; } else { iVar5 = Isaac::Random(5); if (iVar5 == 0) { local_a00 = (Entity_Player *)0x32; iVar28 = 0xff; blue = 0; iVar5 = 0; } else { iVar5 = Isaac::Random(4); if (iVar5 == 0) { local_a00 = (Entity_Player *)0x32; iVar5 = 0; LAB_00795ddd: blue = 0xff; iVar28 = 0; } else { iVar5 = Isaac::Random(3); if (iVar5 == 0) { iVar5 = 0xff; local_a00 = (Entity_Player *)0x46; iVar28 = 0xff; blue = 0; } else { iVar5 = Isaac::Random(2); local_a00 = (Entity_Player *)0x46; if (iVar5 != 0) { iVar5 = 0xff; goto LAB_00795ddd; } iVar28 = 0xff; blue = 0xff; iVar5 = 0; } } } } KColor::FromRGBA255((KColor *)(local_1b0 + 0x2c),iVar5,iVar28,blue,0xff); FUN_00683010(); in_stack_ffffe840 = (Entity_Player *)(local_1b0 + 0x2c); in_stack_ffffe83c = (EntityList_EL *)0x795e1e; (**(code **)(*(int *)this + 0x3c))(); } } } } pvVar36 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0xd6); if ((((pvVar36 != (void *)0x0) || ((bVar3 = Entity::HasEntityFlags((Entity *)this,0x400000000), bVar3 != 0 && ((this->_entityRef2)._entity == this)))) || ((this->_playerType == 0x16 && (0 < this->_maggyHealthDrainCooldown)))) && (iVar5 = Isaac::Random(5), iVar5 == 0)) { uVar30 = Random(); in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &this->_pos; in_stack_ffffe82c = 0x2e; in_stack_ffffe828 = (undefined1 *)0x3e8; in_stack_ffffe824 = 0x795f02; in_stack_ffffe838 = this; in_stack_ffffe840 = (Entity_Player *) Game::Spawn(g_game,1000,0x2e,in_stack_ffffe830,&g_vectorZero,(Entity *)this,0,uVar30); in_stack_ffffe83c = (EntityList_EL *)0x795f08; pEVar8 = (Entity *)__RTDynamicCast(); fVar15 = random_float(); local_b00 = fVar15 * 0.5 + 0.2; tmpVec = Vector::__mul(&g_vectorOne,&local_1030,&local_b00); Entity::SetSpriteScale(pEVar8,tmpVec); (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar22 = (Entity_Tear *)&this->_temporaryeffects; } pvVar36 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0x146); if (pvVar36 == (void *)0x0) { if (this->_breathOfLifeEffect != (EntityPtr)0x0) { Entity::SetParent((Entity *)this->_breathOfLifeEffect,(Entity *)0x0); EntityPtr::SetReference(&this->_breathOfLifeEffect,(Entity *)0x0); } } else if (this->_activeDesc[0]._item == 0x146) { if (*(int *)((int)pvVar36 + 8) == 1) { TemporaryEffects::RemoveCollectibleEffect((TemporaryEffects *)pEVar22,0x146,-1); ResetDamageCooldown(this); pcVar1 = *(code **)(*(int *)this + 0x20); EntityRef::constructor(&local_1570,(Entity *)0x0); in_stack_ffffe840 = (Entity_Player *)0x3f800000; in_stack_ffffe83c = (EntityList_EL *)0x795fc6; (*pcVar1)(); pEVar22 = (Entity_Tear *)&this->_temporaryeffects; TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)pEVar22,0x146,1,1); } } else { TemporaryEffects::RemoveCollectibleEffect((TemporaryEffects *)pEVar22,0x146,-1); } Config::GetCollectibles(); iVar5 = FUN_004f8930(); if (iVar5 != 0) { level = (Level *)Config::GetCollectibles(); bVar3 = Level::HasMirrorDimension(level); if (bVar3 != 0) { level = (Level *)Config::GetCollectibles(); cVar4 = Level::GetStateFlag(level); if (cVar4 != '\0') { local_a28 = TemporaryEffects::GetNullEffect((TemporaryEffects *)pEVar22,0x74); if (local_a28 == (Entity_Tear *)0x0) { LAB_007960af: TemporaryEffects::AddNullEffect((TemporaryEffects *)pEVar22,0x74,1,1); if (local_a28 != (Entity_Tear *)0x0) goto LAB_007960c6; iVar5 = 0; } else { if ((((GridEntity *)local_a28)->_desc)._variant == 1) { if (5 < (((GridEntity *)local_a28)->_desc)._type) { pcVar1 = *(code **)(*(int *)this + 0x20); EntityRef::constructor(&local_1598,(Entity *)0x0); in_stack_ffffe840 = (Entity_Player *)0x3f800000; in_stack_ffffe83c = (EntityList_EL *)0x7960a9; (*pcVar1)(); pEVar22 = (Entity_Tear *)&this->_temporaryeffects; } goto LAB_007960af; } LAB_007960c6: iVar5 = ((GridEntityDesc *)&local_a28->field_0x4)->_type; } local_9fc = (Entity_Player *)Math::clamp(0.0,1.0,1.0 - (float)iVar5 / 6.0); if ((float)local_9fc < 0.99) { FUN_00757980(); Color::Color(&local_1f4); local_a28 = (Entity_Tear *)Math::lerp(0.6,1.0,(float)local_9fc,0); Math::lerp(0.5,1.0,(float)local_9fc,0); Color::Color(aCStackY_2e04 + 0x81); in_stack_ffffe824 = 0x796199; pCVar16 = (ColorMod *)FUN_004072e0(); Color::operator_assign(&local_1f4,pCVar16); in_stack_ffffe840 = (Entity_Player *)&local_1f4; in_stack_ffffe83c = (EntityList_EL *)0x7961c3; (**(code **)(*(int *)this + 0x3c))(); } } } } local_a28 = (Entity_Tear *)GetActiveItemSlot(this,0x146); if (-1 < (int)local_a28) { iVar5 = GetActiveMaxCharge(this,(int)local_a28); local_a28 = (Entity_Tear *)this->_activeDesc[(int)local_a28]._charge; local_9fc = (Entity_Player *)((float)(int)local_a28 / (float)iVar5); if ((float)local_9fc < 0.99) { FUN_00757980(); Color::Color(local_24c); if ((local_a28 == (Entity_Tear *)0x0) && (bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x146), bVar3 != 0)) { iVar5 = Entity::FrameCount((Entity *)this); fVar15 = sinf_wrapper((float)iVar5 * 3.1415927 * 0.5); local_9fc = (Entity_Player *)(fVar15 * 0.5 + 0.5); local_a28 = (Entity_Tear *)Math::lerp(0.6,1.0,(float)local_9fc,0); Math::lerp(0.5,1.0,(float)local_9fc,0); Color::Color(0x3f800000,(float)local_9fc * 0.25,(float)local_9fc * 0.35); } else { local_a28 = (Entity_Tear *)Math::lerp(0.6,1.0,(float)local_9fc,0); Math::lerp(0.5,1.0,(float)local_9fc,0); Color::Color(aCStackY_2e04 + 0x81); } in_stack_ffffe824 = 0x7963b7; pCVar16 = (ColorMod *)FUN_004072e0(); Color::operator_assign(local_24c,pCVar16); in_stack_ffffe840 = (Entity_Player *)local_24c; in_stack_ffffe83c = (EntityList_EL *)0x7963e1; (**(code **)(*(int *)this + 0x3c))(); } } bVar3 = HasCollectible(this,0xbf,0); if (bVar3 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar5 = Room::GetFrameCount(room); if (iVar5 % 0xb4 == 0) { AddDollarBillEffect(this); } } bVar3 = HasCollectible(this,0xda,0); if ((bVar3 != 0) && (bVar3 = HasFullHearts(this), bVar3 == 0)) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { bVar3 = Entity::IsFrame((Entity *)this,0x708,0); if (bVar3 == 0) goto LAB_00796537; iVar5 = Isaac::Random(2); bVar3 = iVar5 != 0; } else { bVar3 = Entity::IsFrame((Entity *)this,900,0); } if (bVar3 != 0) { AddHearts(this,1,0,0); iVar5 = 0x9d; if (this->_playerType == 0x16) { iVar5 = 0x266; } play_sound_with_fart_seed(iVar5,1.0,2,0,1.0); uVar30 = Random(); in_stack_ffffe838 = (Entity_Player *)0x0; in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &this->_pos; in_stack_ffffe82c = 0x31; in_stack_ffffe828 = (undefined1 *)0x3e8; in_stack_ffffe824 = 0x7964ff; in_stack_ffffe840 = (Entity_Player *) Game::Spawn(g_game,1000,0x31,in_stack_ffffe830,&g_vectorZero,(Entity *)0x0,0,uVar30); in_stack_ffffe83c = (EntityList_EL *)0x796505; pvVar36 = (void *)__RTDynamicCast(); Vector::Vector(&local_1038,0.0,-24.0); FUN_004563c0(); set_field_358(pvVar36,1.0); } } LAB_00796537: bVar3 = HasCollectible(this,0xe7,0); if (((bVar3 != 0) && (bVar3 = Entity::IsFrame((Entity *)this,2,0), bVar3 != 0)) && (uVar30 = Isaac::Random(5), 1 < uVar30)) { uVar30 = Random(); in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &this->_pos; in_stack_ffffe82c = 0x2d; in_stack_ffffe828 = (undefined1 *)0x3e8; in_stack_ffffe824 = 0x7965a8; in_stack_ffffe838 = this; in_stack_ffffe840 = (Entity_Player *) Game::Spawn(g_game,1000,0x2d,in_stack_ffffe830,&g_vectorZero,(Entity *)this,0,uVar30); in_stack_ffffe83c = (EntityList_EL *)0x7965ae; pEVar8 = (Entity *)__RTDynamicCast(); fVar15 = random_float(); local_b04 = fVar15 * 0.5 + 0.2; tmpVec = Vector::__mul(&g_vectorOne,&local_1040,&local_b04); Entity::SetSpriteScale(pEVar8,tmpVec); (**(code **)(*(int *)pEVar8 + 0xc))(); } bVar3 = TemporaryEffects::HasTrinketEffect(&this->_temporaryeffects,0x45); if (((bVar3 == 0) && (bVar3 = HasTrinket(this,0x45,0), bVar3 != 0)) && ((bVar3 = Entity::IsFrame((Entity *)this,300,0), bVar3 != 0 && (iVar5 = Isaac::Random(5), iVar5 == 0)))) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetTrinket(itemConfig,0x45); TemporaryEffect::TemporaryEffect(local_dc0,configItem); iVar5 = GetTrinketMultiplier(this,0x45); iVar28 = Isaac::Random(5); local_db8 = iVar5 * (iVar28 + 3) * 0x1e; TemporaryEffects::AddEffect(&this->_temporaryeffects,local_dc0,1,1); Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { pvVar36 = (void *)Game::GetPlayerManager(g_game); iVar5 = std::vector::size(pvVar36); if (iVar5 != 0) { uVar30 = 0; do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); local_9fc = PlayerManager::GetPlayer(playerManager,uVar30); if ((local_9fc != this) && (pEVar31 = (Entity_Player *)EntityPtr::Ref(), local_9fc != pEVar31)) { EntityRef::constructor(&local_15c0,(Entity *)this); Entity::AddConfusion((Entity *)local_9fc,&local_15c0,0x5a,0); } uVar30 = uVar30 + 1; pvVar36 = (void *)Game::GetPlayerManager(g_game); uVar7 = std::vector::size(pvVar36); } while (uVar30 < uVar7); } } } tempEffects = &this->_temporaryeffects; bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,299); flags_01._0_12_ = ZEXT812(0x40000000); flags_01._h._4_4_ = 0; local_a28 = (Entity_Tear *)flags_01._l; if (bVar3 == 0) { bVar3 = HasCollectible(this,299,0); if (((bVar3 != 0) || (iVar5 = GetZodiacEffect(this), iVar5 == 299)) && (flags_01 = (BitSet128)ZEXT416((uint)this->_taurusSpeedBonus), this->_taurusSpeedBonus != 0.0 )) { this->_taurusSpeedBonus = 0.0; this->_cacheFlags = this->_cacheFlags | 0x10; LAB_00796889: EvaluateItems(); } } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar5 = Room::GetAliveEnemiesCount(room); if ((iVar5 != 0) || (flags_01._0_12_ = ZEXT812(0x40000000), flags_01._h._4_4_ = 0, (float)flags_01._l < this->_movespeed || (float)flags_01._l == this->_movespeed)) { flags_01 = (BitSet128)ZEXT416((uint)this->_movespeed); if ((this->_movespeed < 2.0) || (pvVar36 = TemporaryEffects::GetCollectibleEffect(tempEffects,299), *(int *)((int)pvVar36 + 8) != 0)) { fVar15 = this->_taurusSpeedBonus + 0.0022222223; flags_01 = (BitSet128)ZEXT416((uint)fVar15); this->_taurusSpeedBonus = fVar15; this->_cacheFlags = this->_cacheFlags | 0x1010; goto LAB_00796889; } TemporaryEffects::RemoveCollectibleEffect(tempEffects,299,1); itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,299); TemporaryEffect::TemporaryEffect(local_dd0,configItem); local_dc8 = 0xb4; TemporaryEffects::AddEffect(tempEffects,local_dd0,1,1); } else { TemporaryEffects::RemoveCollectibleEffect(tempEffects,299,1); } } bVar3 = HasCollectible(this,0x134,0); if (bVar3 == 0) { iVar5 = GetZodiacEffect(this); if (iVar5 == 0x134) goto LAB_007968b4; } else { LAB_007968b4: bVar3 = Entity::IsFrame((Entity *)this,2,0); if (bVar3 != 0) { iVar5 = Isaac::Random(5); if (iVar5 != 0) { Isaac::Random(2); in_stack_ffffe840 = (Entity_Player *)local_3a0; GetTearHitParams(); uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x36,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar30); fVar15 = random_float(); local_b58 = fVar15 * 0.5 + 0.2; tmpVec = Vector::__mul(&g_vectorOne,&local_1048,&local_b58); Entity::SetSpriteScale(pEVar8,tmpVec); (**(code **)(*(int *)pEVar8 + 0x40))(); FUN_00665b80(); in_stack_ffffe828 = local_398; in_stack_ffffe838 = (Entity_Player *)0x1; in_stack_ffffe834 = (Vector *)0x0; in_stack_ffffe830 = (Vector *)0xff; in_stack_ffffe82c = 0xffffffff; (**(code **)(*(int *)pEVar8 + 0x3c))(); in_stack_ffffe824 = 0x7969d3; (**(code **)(*(int *)pEVar8 + 0xc))(); flags_01 = local_368; in_stack_ffffe83c = local_358; } } } tempEffects = &this->_temporaryeffects; bVar3 = HasCollectible(this,0x199,0); if (bVar3 != 0) { bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x199); if (this->_redHearts < 1) { if (bVar3 != 0) goto LAB_00796a3f; TemporaryEffects::AddCollectibleEffect(tempEffects,0x199,1,1); itemConfig = Isaac::GetItemConfig(); bVar3 = 0; configItem = Config::GetNullItem(itemConfig,0x12); AddCostume(this,configItem,bVar3); } else if (bVar3 != 0) { LAB_00796a3f: bVar3 = Entity::IsFrame((Entity *)this,0x4b0,0); if (bVar3 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::IsClear(room); if (bVar3 != 0) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') goto LAB_00796ab9; } itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x3a); TemporaryEffect::TemporaryEffect(local_de0,configItem); local_dd8 = 300; TemporaryEffects::AddEffect(tempEffects,local_de0,1,1); } } } LAB_00796ab9: bVar3 = HasPlayerForm(this,9); local_a1c = (Entity_Familiar *)&DAT_0000000f; if (((bVar3 != 0) && (bVar3 = Entity::IsFrame((Entity *)this,0x708,0), bVar3 != 0)) && (iVar5 = Isaac::Random(0xf), iVar5 == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::IsClear(room); if (bVar3 == 0) { in_stack_ffffe840 = (Entity_Player *)local_afa; in_stack_ffffe83c = (EntityList_EL *)0x796b1a; UseActiveItem(this,(short *)in_stack_ffffe840,0x24,1,-1,0); } } bVar3 = HasPlayerForm(this,6); if ((bVar3 != 0) && (*(int *)&this->field_0x1434 == 0)) { uVar30 = Random(); in_stack_ffffe828 = &DAT_00000008; in_stack_ffffe824 = 0x796b6a; Game::Spawn(g_game,8,0,&this->_pos,&g_vectorZero,(Entity *)this,3,uVar30); pEVar8 = (Entity *)__RTDynamicCast(); Entity::SetParent(pEVar8,(Entity *)this); tmpVec = Vector::Vector(&local_1050,0.0,-10.0); Entity::SetPositionOffset(pEVar8,tmpVec); Color::operator_assign((Color *)local_1b0,&this->_tearColor); FUN_007cf940(); local_a08 = (Entity_Player *)flags_01._l; fVar35 = (float10)Color::A(); Font::SetLineHeightModifier((Font *)local_1b0,(float)(fVar35 * (float10)(float)local_a08)); in_stack_ffffe840 = (Entity_Player *)local_1b0; (**(code **)(*(int *)pEVar8 + 0x3c))(); in_stack_ffffe82c = 0x796c1d; FUN_005cd5c0(); in_stack_ffffe83c = (EntityList_EL *)this->_damage; flags_01 = (BitSet128)ZEXT416(in_stack_ffffe83c); (**(code **)(*(int *)pEVar8 + 0x40))(); in_stack_ffffe834 = (Vector *)0x200000; in_stack_ffffe830 = (Vector *)0x796c42; Entity::AddEntityFlags(pEVar8,0x200000); EntityPtr::SetReference((EntityPtr *)&this->field_0x1434,pEVar8); in_stack_ffffe838 = (Entity_Player *)0x796c58; (**(code **)(*(int *)pEVar8 + 0xc))(); } bVar3 = HasTrinket(this,0x19,0); if ((bVar3 != 0) && (this->_variant == 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); pEVar31 = (Entity_Player *)Room::GetGridIndex(room,&this->_pos); local_a08 = pEVar31; room = (Room *)Level::GetCurrentRoom((Level *)g_game); pGVar17 = Room::GetGridEntity(room,(uint)pEVar31); GetTrinketMultiplier(this,0x19); HasGoldenTrinket(this,0x19); iVar5 = Game::GetFrameCount(g_game); if (((iVar5 % 900 == 0) && (iVar5 = Isaac::Random(2), iVar5 == 0)) && (((pGVar17 == (GridEntity *)0x0 || (iVar5 = GridEntity::GetType(), iVar5 == 1)) || (iVar5 = GridEntity::GetType(), iVar5 == 10)))) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::is_type_16(room); if (bVar3 == 0) { pEVar31 = (Entity_Player *)0x0; bVar3 = HasGoldenTrinket(this,0x19); if (bVar3 != 0) { pEVar31 = (Entity_Player *)0x3; } local_9fc = pEVar31; bVar3 = HasTrinket(this,0x5b,0); if (bVar3 != 0) { local_9fc = (Entity_Player *)0x21; iVar5 = GetTrinketMultiplier(this,0x5b); if (iVar5 == 2) { local_9fc = (Entity_Player *)0x42; } else if (iVar5 == 3) { local_9fc = (Entity_Player *)0x64; } pRVar14 = (RNG *)FUN_005cbd00(); fVar15 = (float)RNG::RandomInt(pRVar14,100); if ((uint)fVar15 < local_9fc) { pEVar31 = (Entity_Player *)&DAT_00000005; } local_9fc = pEVar31; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); pRVar14 = (RNG *)FUN_005cbd00(); uVar30 = RNG::Next(pRVar14); in_stack_ffffe83c = (EntityList_EL *)0x796de2; in_stack_ffffe840 = local_a08; Room::SpawnGridEntity(room,(int)local_a08,0xe,(uint)local_9fc,uVar30,0); goto LAB_00796de7; } } iVar5 = Game::GetFrameCount(g_game); if ((iVar5 % 0x708 == 0) && (iVar5 = Isaac::Random(2), iVar5 == 0)) { in_stack_ffffe840 = (Entity_Player *)&this->_pos; in_stack_ffffe83c = (EntityList_EL *)0x797184; Game::ButterBeanFart(g_game,(Vector *)in_stack_ffffe840,120.0,(Entity *)this,1,0); } } LAB_00796de7: Level::GetCurrentRoom((Level *)g_game); uVar30 = Room::GetSpawnSeed(); bVar3 = HasTrinket(this,0x46,0); if (bVar3 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::IsClear(room); if ((bVar3 == 0) && (((bVar3 = Entity::IsFrame((Entity *)this,900,uVar30 % 0x708), bVar3 != 0 && (iVar5 = Isaac::Random(2), iVar5 == 0)) || (bVar3 = Entity::IsFrame((Entity *)this,0x708,uVar30 % 0x708), bVar3 != 0)))) { in_stack_ffffe840 = (Entity_Player *)0x796e7c; play_sound_with_fart_seed(0xb5,0.7,2,0,1.0); iVar5 = GetTrinketMultiplier(this,0x46); if (0 < iVar5) { do { ThrowBlueSpider(this,&this->_pos,&g_vectorZero); iVar5 = iVar5 + -1; } while (iVar5 != 0); } } } bVar3 = HasTrinket(this,0x40,0); if ((bVar3 != 0) && (iVar5 = Game::GetFrameCount(g_game), iVar5 % 0x5a == 0)) { this->_cacheFlags = this->_cacheFlags | 0x2e; EvaluateItems(); } bVar3 = HasPlayerForm(this,4); pEVar31 = this; if (bVar3 != 0) { bVar3 = Entity::IsFrame((Entity *)this,5,0); if (bVar3 != 0) { uVar30 = Random(); in_stack_ffffe834 = &g_vectorZero; in_stack_ffffe830 = &this->_pos; in_stack_ffffe82c = 0x2e; in_stack_ffffe828 = (undefined1 *)0x3e8; in_stack_ffffe824 = 0x796f36; Game::Spawn(g_game,1000,0x2e,in_stack_ffffe830,&g_vectorZero,(Entity *)this,0,uVar30); pEVar8 = (Entity *)__RTDynamicCast(); fVar15 = random_float(); flags_01._l._0_4_ = fVar15 * 0.5 + 0.2; flags_01._4_12_ = extraout_var_00; local_b08 = (float)flags_01._l; tmpVec = Vector::__mul(&g_vectorOne,&local_1058,&local_b08); Entity::SetSpriteScale(pEVar8,tmpVec); pcVar1 = *(code **)(*(int *)pEVar8 + 0x3c); in_stack_ffffe840 = (Entity_Player *)Color::Color(); (*pcVar1)(); in_stack_ffffe83c = (EntityList_EL *)0x796fc3; (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar31 = local_a24; in_stack_ffffe838 = this; } } bVar3 = HasCollectible(pEVar31,0x1a9,0); if (bVar3 != 0) { uVar30 = 10; Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { uVar30 = 0xe; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); outResult = (TypeDescriptor *)&local_a98; uVar48 = 0x797030; EntityList::QueryRadius(entityList,(EntityList_EL *)outResult,&pEVar31->_pos,200.0,uVar30); pEVar32 = (Entity_Player *)0x0; local_14 = 2.8026e-45; local_a00 = (Entity_Player *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); bVar3 = Entity::IsVulnerableEnemy((Entity *)*puVar12,(Entity *)0x0); if (bVar3 == 0) { LAB_007971e6: puVar12 = (undefined4 *)std::vector::operator_index(); iVar5 = Entity::Type((Entity *)*puVar12); if (iVar5 == 9) { puVar12 = (undefined4 *)std::vector::operator_index(); outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar48 = 0; in_stack_ffffe840 = (Entity_Player *)*puVar12; in_stack_ffffe83c = (EntityList_EL *)0x797223; local_9fc = (Entity_Player *)__RTDynamicCast(); if (local_9fc != (Entity_Player *)0x0) { Entity::Position((Entity *)local_9fc,&local_1068); cVar4 = IsPosInSpotLight(pEVar31); if ((cVar4 != '\0') && (uVar46 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)local_9fc), (uVar46 & 0x1000000) == 0)) { tmpVec = Entity::Velocity((Entity *)local_9fc,&local_1070); local_b0c = 0.5; tmpVec = Vector::__mul(tmpVec,&local_1078,&local_b0c); Entity::SetVelocity((Entity *)local_9fc,tmpVec); outResult = (TypeDescriptor *)0x7972bb; Entity_Projectile::AddProjectileFlags((Entity_Projectile *)local_9fc); } } } else { puVar12 = (undefined4 *)std::vector::operator_index(); iVar5 = Entity::Type((Entity *)*puVar12); if (iVar5 == 2) { puVar12 = (undefined4 *)std::vector::operator_index(); outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar48 = 0; in_stack_ffffe840 = (Entity_Player *)*puVar12; in_stack_ffffe83c = (EntityList_EL *)0x7972f6; local_a0c = (Entity_Tear *)__RTDynamicCast(); if ((local_a0c != (Entity_Tear *)0x0) && (bVar3 = Entity::IsDescendantOf((Entity *)local_a0c,(Entity *)pEVar31), bVar3 == 0) ) { Entity::Position((Entity *)local_a0c,&local_1080); cVar4 = IsPosInSpotLight(pEVar31); if (cVar4 != '\0') { outResult = (TypeDescriptor *)0x79734b; pBVar10 = (BitSet128 *)FUN_00435bc0(); pBVar53 = Entity_Tear::TearFlags(local_a0c,local_1300); pBVar10 = BitSet128::operator_and(&local_1310,pBVar53,pBVar10); bVar3 = BitSet128::IsZero(pBVar10); if (bVar3 != 0) { tmpVec = Entity::Velocity((Entity *)local_a0c,&local_1088); local_b10 = 0.5; tmpVec = Vector::__mul(tmpVec,&local_1090,&local_b10); Entity::SetVelocity((Entity *)local_a0c,tmpVec); pBVar10 = (BitSet128 *)FUN_00435bc0(); pBVar53 = Entity_Tear::TearFlags(local_a0c,local_1330); pBVar10 = BitSet128::operator_or(&local_1340,pBVar53,pBVar10); flags_01 = *pBVar10; uVar48 = (undefined4)flags_01._l; outResult = flags_01._l._4_4_; in_stack_ffffe840 = (Entity_Player *)0x797406; Entity_Tear::SetTearFlags(local_a0c,flags_01); } goto LAB_00797406; } } } } } else { puVar12 = (undefined4 *)std::vector::operator_index(); Entity::Position((Entity *)*puVar12,&local_1060); cVar4 = IsPosInSpotLight(pEVar31); if (cVar4 == '\0') goto LAB_007971e6; Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity *)*puVar12; fVar15 = 1.115285e-38; EntityRef::constructor(&local_1610,(Entity *)pEVar31); bVar3 = 0; Color::Color(0x3f800000,0x28,0x28,0x28); color_00._tint[1] = (float)in_stack_ffffe828; color_00._tint[0] = (float)in_stack_ffffe824; color_00._tint[2] = (float)in_stack_ffffe82c; color_00._tint[3] = (float)in_stack_ffffe830; color_00._colorize[0] = (float)in_stack_ffffe834; color_00._colorize[1] = (float)in_stack_ffffe838; color_00._colorize[2] = (float)in_stack_ffffe83c; color_00._colorize[3] = (float)in_stack_ffffe840; color_00._offset[0] = (float)uVar48; color_00._offset[1] = (float)outResult; color_00._offset[2] = fVar15; Entity::AddSlowing(pEVar8,&local_1610,2,0.9,color_00,bVar3); } else { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity *)*puVar12; std::vector::operator_index(); iVar5 = FUN_00753710(); fVar15 = 1.1152604e-38; EntityRef::constructor(&local_15e8,(Entity *)local_a24); bVar3 = 1; Color::Color(0x3f800000,0x28,0x28,0x28); color._tint[1] = (float)in_stack_ffffe828; color._tint[0] = (float)in_stack_ffffe824; color._tint[2] = (float)in_stack_ffffe82c; color._tint[3] = (float)in_stack_ffffe830; color._colorize[0] = (float)in_stack_ffffe834; color._colorize[1] = (float)in_stack_ffffe838; color._colorize[2] = (float)in_stack_ffffe83c; color._colorize[3] = (float)in_stack_ffffe840; color._offset[0] = (float)uVar48; color._offset[1] = (float)outResult; color._offset[2] = fVar15; Entity::AddSlowing(pEVar8,&local_15e8,2 - (uint)(iVar5 != 0),0.9,color,bVar3); pEVar31 = local_a24; } LAB_00797406: pEVar32 = local_a00; } pEVar32 = (Entity_Player *)&pEVar32->field_0x1; local_a00 = pEVar32; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar32 < puVar13); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_a98); } bVar3 = HasCollectible(pEVar31,0x1a7,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar31,0x1a7,0); if ((bVar3 == 0) && (*(int **)&pEVar31->field_0x1454 != (int *)0x0)) { (**(code **)(**(int **)&pEVar31->field_0x1454 + 0x28))(); } } else { local_a08 = (Entity_Player *)&pEVar31->field_0x1454; local_a3c = *(Entity **)local_a08; if (local_a3c == (Entity *)0x0) { uVar30 = Random(); Game::Spawn(g_game,7,8,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,3,uVar30); pEVar8 = (Entity *)__RTDynamicCast(); tmpVec = Vector::Vector(&local_1098,0.0,-20.0); Entity::SetPositionOffset(pEVar8,tmpVec); pEVar31 = local_a24; Entity::SetParent(pEVar8,(Entity *)local_a24); Entity::SetSpawnerEntity(pEVar8,(Entity *)pEVar31); set_field_358(pEVar8,3000.0); pcVar1 = *(code **)(*(int *)pEVar8 + 0x40); Isaac::Random(2); in_stack_ffffe840 = (Entity_Player *)local_990; iVar5 = GetTearHitParams(); flags_01 = (BitSet128)ZEXT416(*(uint *)(iVar5 + 0x48)); (*pcVar1)(); (**(code **)(*(int *)pEVar8 + 0xc))(); EntityPtr::SetReference((EntityPtr *)local_a08,pEVar8); pEVar31 = local_a24; } else { pcVar1 = *(code **)(*(int *)local_a3c + 0x40); Isaac::Random(2); in_stack_ffffe840 = (Entity_Player *)local_9f8; iVar5 = GetTearHitParams(); flags_01 = (BitSet128)ZEXT416(*(uint *)(iVar5 + 0x48)); (*pcVar1)(); } } ClampGoldenHearts(pEVar31,0); bVar3 = HasCollectible(pEVar31,0x1a4,0); dVar37 = (double)(ZEXT48(in_stack_ffffe840) << 0x20); if (bVar3 != 0) { if (*(int *)&pEVar31->field_0x1adc < 1) { iVar5 = *(int *)&pEVar31->field_0x1ad4; iVar28 = pEVar31->_coopBabyBuffTimers[iVar5 + 0x25]; while ((iVar28 == 0 && (iVar5 != *(int *)&pEVar31->field_0x1ad8))) { iVar5 = (iVar5 + 1) % 0x60; *(int *)&pEVar31->field_0x1ad4 = iVar5; iVar28 = pEVar31->_coopBabyBuffTimers[iVar5 + 0x25]; } pEVar8 = (Entity *)(*(int *)&pEVar31->field_0x1ad8 - iVar5); local_a3c = (Entity *)&(pEVar8->_sprite)._animDefaultName; if (-1 < (int)pEVar8) { local_a3c = pEVar8; } dVar37 = (double)(ZEXT48(in_stack_ffffe840) << 0x20); if ((int)local_a3c < 0x5f) { if (((0 < (int)local_a3c) && (local_a08 = (Entity_Player *) pEVar31->_coopBabyBuffTimers [(*(int *)&pEVar31->field_0x1ad8 + 0x5f) % 0x60 + 0x25], local_a08 != (Entity_Player *)0x0)) && (cVar4 = Entity::IsDead((Entity *)local_a08), cVar4 == '\0')) { Entity::Position((Entity *)local_a08,&local_10a0); FUN_00a0ff70(); dVar37 = (double)(ZEXT48(in_stack_ffffe840) << 0x20); if ((float)flags_01._l < 100.0) goto LAB_00797b3b; } uVar30 = Random(); pEVar18 = Game::Spawn(g_game,1000,0x5c,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,0, uVar30); effect = (Entity_Effect *)__RTDynamicCast(); Entity_Effect::SetTimeout(effect,0x3c); (**(code **)(*(int *)effect + 0xc))(); pEVar31->_coopBabyBuffTimers[*(int *)&pEVar31->field_0x1ad8 + 0x25] = (int)effect; std::multiset::insert(); pEVar8 = local_a3c; dVar37 = (double)(ZEXT48(pEVar18) << 0x20); *(int *)&pEVar31->field_0x1ad8 = (*(int *)&pEVar31->field_0x1ad8 + 1) % 0x60; if (0xb < (int)local_a3c) { local_a30 = (Entity_Player *)0xffffffff; EntityPtr::clear((EntityPtr *)&averagePos); dVar37 = (double)(ZEXT48(pEVar18) << 0x20); local_a14 = (Entity_Tear *)((int)pEVar8 / 2); if (-1 < (int)local_a14) { pEVar32 = (Entity_Player *)0xffffffff; do { if (-1 < (int)pEVar32) goto LAB_00797a7b; entityList = (Entity_Player *) (((int)(&(local_a14->_sprite)._filename + -3) + *(int *)&pEVar31->field_0x1ad4) % 0x60); local_a3c = (Entity *) pEVar31->_coopBabyBuffTimers[(int)((int)&entityList->_collisionIndex + 1)]; local_a00 = entityList; if (local_a3c == (Entity *)0x0) goto LAB_00797a5e; Entity::GetColor(local_a3c); fVar35 = (float10)Color::A(); auVar40._0_12_ = ZEXT812(0x3f000000); auVar40._12_4_ = 0; local_a08 = (Entity_Player *)(float)fVar35; if ((float)local_a08 < auVar40._0_4_) { LAB_00797a58: pEVar32 = local_a30; } else { Entity::Position(local_a3c,&local_10a8); FUN_00a0ff70(); if (400.0 <= auVar40._0_4_) goto LAB_00797a58; local_a30 = entityList; EntityPtr::clear((EntityPtr *)&local_d4c); pEVar32 = *(Entity_Player **)&pEVar31->field_0x1ad8; auVar40 = ZEXT816(0); fVar15 = 0.0; local_a0c = (Entity_Tear *)0x0; local_a08 = entityList; if (entityList != pEVar32) { do { local_a08 = (Entity_Player *) pEVar31->_coopBabyBuffTimers [(int)((int)&entityList->_collisionIndex + 1)]; if (local_a08 != (Entity_Player *)0x0) { Entity::Position((Entity *)local_a08,&local_10b0); FUN_00a0ff70(); local_a3c = auVar40._0_4_; if ((float)local_a0c < (float)local_a3c) { tmpVec = Entity::Position((Entity *)local_a08,&local_10b8); Vector::operator_assign(&local_d4c,tmpVec); local_a0c = (Entity_Tear *)local_a3c; } auVar40 = ZEXT416(local_a0c); } fVar15 = auVar40._0_4_; entityList = (Entity_Player *)((int)&entityList->field_0x1 % 0x60); pEVar32 = *(Entity_Player **)&pEVar31->field_0x1ad8; } while (entityList != pEVar32); entityList = local_a00; } local_a0c = (Entity_Tear *)(fVar15 * 0.5); if ((float)local_a0c < 2500.0) { local_a30 = (Entity_Player *)0xffffffff; pEVar32 = (Entity_Player *)0xffffffff; } else { pvVar36 = (void *)((int)pEVar32 - (int)entityList); local_a38 = (void *)((int)pvVar36 + 0x60); if (-1 < (int)pvVar36) { local_a38 = pvVar36; } Vector::operator_assign(&averagePos,&g_vectorZero); local_9fc = entityList; if (entityList != *(Entity_Player **)&pEVar31->field_0x1ad8) { do { if ((Entity *) pEVar31->_coopBabyBuffTimers[(int)((int)&local_9fc->_collisionIndex + 1)] != (Entity *)0x0) { tmpVec = Entity::Position((Entity *) pEVar31->_coopBabyBuffTimers [(int)((int)&local_9fc->_collisionIndex + 1)], &local_10c0); Vector::operator_add_assign(&averagePos,tmpVec); } local_9fc = (Entity_Player *)((int)&local_9fc->field_0x1 % 0x60); } while (local_9fc != *(Entity_Player **)&pEVar31->field_0x1ad8); entityList = local_a00; } auVar41._0_4_ = SUB124(ZEXT812(0x3f800000),0) / (float)(int)local_a38; auVar41._4_8_ = SUB128(ZEXT812(0x3f800000),4); auVar41._12_4_ = 0; local_b14 = auVar41._0_4_; Vector::operator_mul_assign(&averagePos,&local_b14); local_9fc = (Entity_Player *)0x0; if (entityList == *(Entity_Player **)&pEVar31->field_0x1ad8) goto LAB_00797a58; do { if ((Entity *) pEVar31->_coopBabyBuffTimers[(int)((int)&entityList->_collisionIndex + 1)] != (Entity *)0x0) { Entity::Position((Entity *) pEVar31->_coopBabyBuffTimers [(int)((int)&entityList->_collisionIndex + 1)],&local_10c8); FUN_00a0ff70(); auVar41._0_4_ = auVar41._0_4_ / (float)local_a0c; if (auVar41._0_4_ < 0.25) { local_9fc = (Entity_Player *)&local_9fc->field_0x1; auVar41 = ZEXT416((uint)((float)(int)local_a38 * 0.25)); if ((float)(int)local_a38 * 0.25 < (float)((double)(int)local_9fc + __uint_to_double_fixup[-((int)local_9fc >> 0x1f)])) { local_a30 = (Entity_Player *)0xffffffff; } } } entityList = (Entity_Player *)((int)&entityList->field_0x1 % 0x60); pEVar32 = local_a30; } while (entityList != *(Entity_Player **)&pEVar31->field_0x1ad8); } } LAB_00797a5e: dVar37 = (double)(ZEXT48(pEVar18) << 0x20); local_a14 = (Entity_Tear *)((int)&local_a14[-1]._tearRange + 3); } while (-1 < (int)local_a14); if (-1 < (int)pEVar32) { LAB_00797a7b: pEVar22 = local_a0c; FUN_00431260(); local_a14 = pEVar22; uVar30 = Random(); Game::Spawn(g_game,1000,0x5d,&averagePos,&g_vectorZero,(Entity *)pEVar31,0,uVar30); piVar19 = (int *)__RTDynamicCast(); FUN_00435ed0(); (**(code **)(*piVar19 + 0xc))(); *(undefined4 *)&pEVar31->field_0x1adc = 0x2d; dVar37 = (double)averagePos.x; KAGE_LogMessage(1,(byte *) "closed black powder circle at %.2f, %.2f with radius %.2f\n"); } } } } } else { *(int *)&pEVar31->field_0x1adc = *(int *)&pEVar31->field_0x1adc + -1; dVar37 = (double)(ZEXT48(in_stack_ffffe840) << 0x20); } } LAB_00797b3b: piVar19 = (int *)FUN_0042d040(); if (((piVar19 == (int *)0x0) || (bVar3 = HasCollectible(pEVar31,0x1b8,0), bVar3 == 0)) || (cVar4 = (**(code **)(*piVar19 + 0x3c))(), cVar4 == '\0')) { if (pEVar31->_isUrethraBlocked != 0) { pEVar31->_isUrethraBlocked = 0; } } else if (((pEVar31->_peeBurstCooldown < 1) && (pEVar31->_isUrethraBlocked == 0)) && (iVar5 = Game::GetFrameCount(g_game), pEVar31->_nextUrethraBlockFrame <= iVar5)) { pEVar31->_isUrethraBlocked = 1; iVar5 = Isaac::Random(3); pEVar31->_maxBladderCharge = (iVar5 + 1) * 0x1e; pEVar31->_bladderCharge = 0; } bVar3 = HasCollectible(pEVar31,0x1ba,0); if (bVar3 != 0) { cVar4 = FUN_007db360(); if (cVar4 == '\0') { bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x1ba); if (bVar3 != 0) { TemporaryEffects::RemoveCollectibleEffect(&pEVar31->_temporaryeffects,0x1ba,1); pcVar49 = "FloatNoGlow"; goto LAB_00797c41; } } else { bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x1ba); if (bVar3 == 0) { TemporaryEffects::AddCollectibleEffect(&pEVar31->_temporaryeffects,0x1ba,1,1); pcVar49 = "FloatGlow"; LAB_00797c41: ANM2::Play(&pEVar31->_darkPrincesCrownSprite,(byte *)pcVar49,0); } } bVar3 = HasCollectible(pEVar31,0x19f,0); if (bVar3 != 0) { Vector::Vector(&local_10d0,0.0,-7.0); } Sprite::set_offset((Sprite *)&pEVar31->_darkPrincesCrownSprite); } bVar3 = HasCollectible(pEVar31,0x201,0); if ((bVar3 != 0) && (bVar3 = Entity::IsFrame((Entity *)pEVar31,5,0), bVar3 != 0)) { Level::GetCurrentRoom((Level *)g_game); pGVar17 = (GridEntity *)FUN_00428a60(); pEVar6 = (EntityList_EL *)GridEntity::GetSprite(pGVar17); EntityList_EL::constructor(&local_b94,pEVar6); pEVar32 = (Entity_Player *)0x0; local_14 = 4.2039e-45; local_9fc = (Entity_Player *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); bVar3 = Entity::IsVulnerableEnemy((Entity *)*puVar12,(Entity *)0x0); if (bVar3 != 0) { puVar12 = (undefined4 *)std::vector::operator_index(); bVar3 = Entity::IsDescendantOf((Entity *)*puVar12,(Entity *)pEVar31); if (bVar3 == 0) { iVar5 = Isaac::Random(700); if (iVar5 == 0) { iVar5 = Isaac::Random(2); if (iVar5 == 0) { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity *)*puVar12; EntityRef::constructor(&local_1638,(Entity *)pEVar31); uVar30 = 0x797d84; Entity::AddCharmed(pEVar8,&local_1638,0xdc,0,0); dVar37 = (double)((ulonglong)uVar30 << 0x20); } else { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity *)*puVar12; EntityRef::constructor(&local_1660,(Entity *)pEVar31); Entity::AddFear(pEVar8,&local_1660,0xdc,0); } pEVar32 = local_9fc; } } } pEVar32 = (Entity_Player *)&pEVar32->field_0x1; local_9fc = pEVar32; puVar13 = (undefined1 *)EntityList::Size(); } while (pEVar32 < puVar13); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_b94); } bVar3 = HasCollectible(pEVar31,0x222,0); if (bVar3 == 0) { if (*(int **)&pEVar31->field_0x143c != (int *)0x0) { (**(code **)(**(int **)&pEVar31->field_0x143c + 0x28))(); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x143c,(Entity *)0x0); } } else { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,&local_d24,&pEVar31->_pos,40.0,8); local_14 = 5.60519e-45; local_a14 = (Entity_Tear *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar32 = (Entity_Player *)*puVar12; local_a08 = pEVar32; bVar3 = Entity::IsVulnerableEnemy((Entity *)pEVar32,(Entity *)0x0); if (bVar3 != 0) { cVar4 = (**(code **)(*(int *)pEVar32 + 0x4c))(); iVar5 = -4; if (cVar4 != '\0') { iVar5 = -0x32; } EntityRef::constructor(&local_1688,(Entity *)pEVar31); Entity::AddFreeze((Entity *)local_a08,&local_1688,iVar5,0); } puVar26 = &local_a14->field_0x1; local_a14 = (Entity_Tear *)puVar26; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar26 < puVar13); } if (*(int *)&pEVar31->field_0x143c == 0) { uVar30 = Random(); tmpVec = &pEVar31->_pos; pEVar8 = Game::Spawn(g_game,1000,0x7b,tmpVec,&g_vectorZero,(Entity *)pEVar31,0,uVar30); Entity::SetParent(pEVar8,(Entity *)pEVar31); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x143c,pEVar8); dVar37 = (double)(ZEXT48(tmpVec) << 0x20); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_d24); } tempEffects = &pEVar31->_temporaryeffects; bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x93); if ((bVar3 != 0) && (bVar3 = HasCollectible(pEVar31,0x93,0), bVar3 == 0)) { TemporaryEffects::RemoveCollectibleEffect(tempEffects,0x93,-1); } pvVar36 = TemporaryEffects::GetNullEffect(tempEffects,0x30); if (pvVar36 != (void *)0x0) { TemporaryEffects::RemoveNullEffect(tempEffects,0x30,1); } if (pEVar31->_playerType == 0x25) { iVar5 = Game::Challenge(g_game); if (iVar5 == 0x2c) { local_a08 = (Entity_Player *)FUN_005b1720(); iVar5 = TemporaryEffects::GetNullEffectNum(tempEffects,0x6d); if (((int)local_a08 <= iVar5) && ((iVar5 - (int)local_a08) % 6 == 0)) { TemporaryEffects::AddNullEffect(tempEffects,0x6d,1,1); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::get_random_pickup_position(room,&local_d54,1,0); uVar30 = Random(); tmpVec = &local_d54; LAB_007980ae: pEVar8 = Game::Spawn(g_game,0x362,0,tmpVec,&g_vectorZero,(Entity *)pEVar31,0,uVar30); EntityPtr::SetReference(&pEVar31->_darkEsau,pEVar8); (**(code **)(*(int *)pEVar8 + 0xc))(); dVar37 = (double)(ZEXT48(tmpVec) << 0x20); } } else { bVar3 = TemporaryEffects::HasNullEffect(tempEffects,0x6d); if ((bVar3 != 0) && (pvVar36 = TemporaryEffects::GetNullEffect(tempEffects,0x6d), *(int *)((int)pvVar36 + 8) < 0xb)) { if (pEVar31->_isControlsEnabled != 0) { TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x6d,-1); if (pEVar31->_darkEsau != (EntityPtr)0x0) { (**(code **)(*(int *)pEVar31->_darkEsau + 0x28))(); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::get_random_pickup_position(room,&local_d5c,1,0); uVar30 = Random(); tmpVec = &local_d5c; goto LAB_007980ae; } pvVar36 = TemporaryEffects::GetNullEffect(&pEVar31->_temporaryeffects,0x6d); if (pvVar36 != (void *)0x0) { *(undefined4 *)((int)pvVar36 + 8) = 10; } } } } tempEffects = &pEVar31->_temporaryeffects; local_a08 = (Entity_Player *)pEVar31->_redStewBonusDuration; if (0 < (int)local_a08) { local_b18 = Entity::GetHitPointsLost((Entity *)pEVar31); local_b18 = pEVar31->_redStewBonusDuration - local_b18; local_b20[1] = 0.0; piVar19 = (int *)std::max(); iVar5 = *piVar19; pEVar31->_redStewBonusDuration = iVar5; if (iVar5 / 10 < (int)local_a08 / 10) { Level::SetHeartPicked((Level *)tempEffects); tempEffects->_cacheFlags = tempEffects->_cacheFlags | 1; } } sfx = MusicManager::SFXManager(); local_a29 = SFXManager::IsPlaying(sfx,0x251); bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x2c0); if ((bVar3 == 0) || (local_a08 = TemporaryEffects::GetCollectibleEffect(tempEffects,0x2c0), local_a08 == (Entity_Player *)0x0)) { bVar3 = local_a29; } else { iVar5 = *(int *)((int)local_a08 + 8); bVar34 = false; if (iVar5 == 0x2d) { sfx = MusicManager::SFXManager(); uVar30 = 0x3f800000; SoundEffects::Play(sfx,0x251,1.0,0x3c,0,1.0,0.0); dVar37 = (double)((ulonglong)uVar30 << 0x20); iVar5 = *(int *)((int)local_a08 + 8); bVar34 = iVar5 == 0x2d; } bVar3 = !bVar34 && 0x2c < iVar5; } if (bVar3 != 0) { sfx = MusicManager::SFXManager(); SFXManager::Stop(sfx,0x251); } bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x280); if ((bVar3 != 0) && (bVar3 = HasCollectible(pEVar31,0x280,0), bVar3 == 0)) { TemporaryEffects::RemoveCollectibleEffect(tempEffects,0x280,-1); } bVar3 = TemporaryEffects::HasNullEffect(tempEffects,0x3c); if (bVar3 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,&local_d34,&pEVar31->_pos,120.0,10); local_14 = 7.00649e-45; local_a38 = (void *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar32 = (Entity_Player *)*puVar12; local_a00 = pEVar32; iVar5 = Entity::FrameCount((Entity *)pEVar32); if (2 < iVar5) { bVar3 = Entity::IsProjectile((Entity *)pEVar32); if ((bVar3 == 0) || (uVar46 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)pEVar32), (uVar46 & 0x80000000) != 0)) { bVar3 = Entity::IsActiveEnemy((Entity *)pEVar32,0); if ((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)pEVar32,0x20000000), bVar3 == 0)) { tmpVec = Entity::Position((Entity *)pEVar32,&local_1138); tmpVec = Vector::__sub(tmpVec,&local_1140,&pEVar31->_pos); Vector::__sub(tmpVec,&toEnemy,&pEVar31->_velocity); local_a08 = (Entity_Player *)Vector::LengthSquared(&toEnemy); if (0.01 <= (float)local_a08) { local_b2c[0] = Vector::LengthSquared(&toEnemy); local_b2c[0] = 60.0 / local_b2c[0]; Vector::operator_mul_assign(&toEnemy,local_b2c); tmpVec = Entity::Velocity((Entity *)pEVar32,&local_1148); pVVar20 = Vector::Normalized(&toEnemy,&local_1150); pVVar20 = Vector::__unm(pVVar20,&local_1158); local_a08 = (Entity_Player *)Vector::Dot(tmpVec,pVVar20); if (0.0 < (float)local_a08) { local_be0 = (float)local_a08 * 0.25 + 1.0; Vector::operator_mul_assign(&toEnemy,&local_be0); } Entity::AddVelocity((Entity *)local_a00,&toEnemy,0); } } } else { uVar7 = 0x47; uVar30 = Entity::InitSeed((Entity *)pEVar32); RNG::game_constructor(&local_34,uVar30,uVar7); local_14._0_1_ = 6; tmpVec = Entity::Position((Entity *)pEVar32,&local_10d8); Vector::__sub(tmpVec,&toProjectile,&pEVar31->_pos); local_a08 = (Entity_Player *)Vector::LengthSquared(&toProjectile); if (0.01 <= (float)local_a08) { local_b20[0] = Vector::LengthSquared(&toProjectile); local_b20[0] = 60.0 / local_b20[0]; Vector::operator_mul_assign(&toProjectile,local_b20); tmpVec = Entity::Velocity((Entity *)pEVar32,&local_10e0); pEVar22 = (Entity_Tear *)Vector::Length(tmpVec); projectileSpeed = (float)pEVar22; if (0.0 < (float)pEVar22) { tmpVec = Entity::Velocity((Entity *)pEVar32,&local_10e8); local_a08 = (Entity_Player *)Vector::Dot(&toProjectile,tmpVec); pEVar22 = (Entity_Tear *)0x0; if ((float)local_a08 < 0.0) { tmpVec = Vector::Normalized(&toProjectile,&local_10f0); pVVar20 = Entity::Velocity((Entity *)local_a00,&local_10f8); pVVar20 = Vector::__div(pVVar20,&local_1100,&projectileSpeed); pVVar20 = Vector::Rotated(pVVar20,&local_1108,90.0); pVVar20 = Vector::__unm(pVVar20,&local_1110); fVar15 = Vector::Dot(tmpVec,pVVar20); local_a08 = (Entity_Player *)(fVar15 - 0.01); fVar15 = RNG::RandomFloat(&local_34); pEVar22 = (Entity_Tear *)(fVar15 * 0.02 + (float)local_a08); local_a14 = pEVar22; FUN_0041d510(); if ((float)pEVar22 < 0.5) { pEVar32 = (Entity_Player *)0x3f000000; FUN_00753550(); pEVar22 = local_a14; if ((float)local_a14 <= 0.0) { local_9fc = (Entity_Player *)((uint)pEVar32 ^ 0x80000000); FUN_00753550(); tmpVec = &local_1120; } else { local_9fc = pEVar32; FUN_00753550(); tmpVec = &local_1118; } tmpVec = Vector::Rotated(&toProjectile,tmpVec, (((float)local_9fc - (float)pEVar22) * 180.0) / 3.1415927); Vector::operator_assign(&toProjectile,tmpVec); } pEVar32 = local_a00; } } tmpVec = Entity::Velocity((Entity *)pEVar32,&local_1128); FUN_004d3050(); bendFactor = (float)pEVar22; pVVar20 = Vector::operator_mul(&local_1130,&bendFactor,&toProjectile); Vector::__add(tmpVec,&newVelocity,pVVar20); local_b2c[1] = 5.0; pfVar21 = (float *)std::max(); if (0.4 < projectileSpeed) { Vector::Resize(&newVelocity,*pfVar21); } Entity::SetVelocity((Entity *)local_a00,&newVelocity); local_14 = (float)CONCAT31(local_14._1_3_,5); guard_check_icall(); } else { local_14 = (float)CONCAT31(local_14._1_3_,5); guard_check_icall(); } } } pvVar9 = (void *)((int)local_a38 + 1); local_a38 = pvVar9; pvVar36 = (void *)EntityList::Size(); } while (pvVar9 < pvVar36); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_d34); } local_a0d = HasCollectible(pEVar31,0x22a,0); local_a29 = HasCollectible(pEVar31,0x24f,0); if ((local_a0d != 0) || (local_a29 != 0)) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { local_a14 = (void *)0x42f00000; } else { local_a14 = (void *)0x42a00000; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); if (local_a29 == 0) { auVar38 = ZEXT812(0x42a00000); } else { auVar38._4_8_ = 0; auVar38._0_4_ = local_a14; } auVar42._12_4_ = 0; auVar42._0_12_ = auVar38; EntityList::QueryRadius(entityList,&local_c94,&pEVar31->_pos,auVar38._0_4_,8); local_14 = 9.80909e-45; local_a14 = (Entity_Tear *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar32 = (Entity_Player *)*puVar12; bVar3 = Entity::IsVulnerableEnemy((Entity *)pEVar32,(Entity *)0x0); if ((bVar3 != 0) && (pEVar32 != pEVar31)) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { LAB_0079886f: local_9fc = (Entity_Player *)((uint)local_9fc & 0xffffff00); } else { bVar3 = Entity::is_player((Entity *)pEVar32); local_9fc = (Entity_Player *)CONCAT31(local_9fc._1_3_,1); if (bVar3 == 0) goto LAB_0079886f; } if (local_a29 != 0) { cVar4 = (**(code **)(*(int *)pEVar32 + 0x4c))(); if (cVar4 == '\0') { iVar5 = FUN_00753700(); local_a08 = (Entity_Player *)(0x3c - iVar5); if ((int)local_a08 < 1) goto LAB_007988e6; EntityRef::constructor(&local_16d8,(Entity *)pEVar31); sourceRef = &local_16d8; entityList = local_a08; pEVar50 = local_9fc; } else { EntityRef::constructor(&local_16b0,(Entity *)pEVar31); sourceRef = &local_16b0; entityList = (Entity_Player *)&DAT_0000003c; pEVar50 = (Entity_Player *)0x0; } uVar30 = 0x7988e6; Entity::AddCharmed((Entity *)pEVar32,sourceRef,(int)entityList,(byte)pEVar50,0); dVar37 = (double)((ulonglong)uVar30 << 0x20); } LAB_007988e6: FUN_00417340(); auVar42._0_4_ = (undefined1 *)(auVar42._0_4_ + 80.0); local_a08 = (Entity_Player *)auVar42._0_4_; if (local_a0d != 0) { if (local_a29 != 0) { tmpVec = Entity::Position((Entity *)pEVar32,&local_1160); local_a3c = (Entity *)Vector::DistanceSquared(tmpVec,&pEVar31->_pos); auVar42 = ZEXT416(local_a08); if ((float)local_a08 < (float)local_a3c) goto LAB_0079898c; } cVar4 = (**(code **)(*(int *)pEVar32 + 0x4c))(); if (cVar4 == '\0') { EntityRef::constructor(&local_1728,(Entity *)pEVar31); sourceRef = &local_1728; iVar5 = -0x14; entityList = local_9fc; } else { EntityRef::constructor(&local_1700,(Entity *)pEVar31); iVar5 = -0x3c; sourceRef = &local_1700; entityList = (Entity_Player *)0x0; } Entity::AddFear((Entity *)pEVar32,sourceRef,iVar5,(byte)entityList); } } LAB_0079898c: puVar26 = &local_a14->field_0x1; local_a14 = (Entity_Tear *)puVar26; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar26 < puVar13); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_c94); } bVar3 = HasCollectible(pEVar31,0x22f,0); if (((bVar3 != 0) && (iVar5 = Entity::GetIntervalTicks((Entity *)pEVar31,6.0,0.0), iVar5 != 0)) && (cVar4 = FUN_00758590(), cVar4 == '\0')) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); pEVar6 = &local_ca4; uVar48 = 0x798a2e; EntityList::QueryRadius(entityList,pEVar6,&pEVar31->_pos,60.0,8); local_14 = 1.12104e-44; uVar30 = 0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); uVar51 = 0x798a64; bVar3 = Entity::IsVulnerableEnemy((Entity *)*puVar12,(Entity *)pEVar31); uVar47 = (undefined4)((ulonglong)dVar37 >> 0x20); if (bVar3 != 0) { local_a08 = (Entity_Player *)(pEVar31->_meleeDamage * 0.75); pEVar32 = pEVar31; FUN_00435bc0(); tearFlags._l._4_4_ = uVar48; tearFlags._l._0_4_ = uVar47; tearFlags._h._0_4_ = pEVar6; tearFlags._h._4_4_ = uVar51; pEVar8 = spawn_chain_lightning (&pEVar31->_pos,tearFlags,(Entity *)pEVar32,(float)local_a08); (**(code **)(*(int *)pEVar8 + 0xc))(); break; } uVar30 = uVar30 + 1; uVar7 = EntityList::Size(); } while (uVar30 < uVar7); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_ca4); } bVar3 = HasCollectible(pEVar31,0x23e,0); local_a3c = (void *)0x41400000; BVar43._0_12_ = ZEXT812(0x40800000); BVar43._h._4_4_ = 0; local_a08 = (Entity_Player *)BVar43._l; if ((bVar3 == 0) || (cVar4 = FUN_00758590(), cVar4 != '\0')) { if (*(int **)&pEVar31->field_0x1e78 != (int *)0x0) { (**(code **)(**(int **)&pEVar31->field_0x1e78 + 0x28))(); pEVar8 = (Entity *)0x0; goto LAB_00798d8c; } } else { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { local_a14 = (Entity_Tear *)0x40800000; } else { local_a14 = (Entity_Tear *)0x41400000; } Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { auVar38 = ZEXT812(0x3f800000); } else { auVar38 = ZEXT812(0x40000000); } BVar43._h._4_4_ = 0; BVar43._0_12_ = auVar38; local_a38 = auVar38._0_4_; iVar5 = Entity::GetIntervalTicks((Entity *)pEVar31,(float)local_a14,0.0); if (iVar5 != 0) { local_c4c.y = (pEVar31->_pos).y; local_c4c.x = (pEVar31->_pos).x; Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,&local_d14,&pEVar31->_pos,90.0,8); local_14 = 1.26117e-44; local_a14 = (Entity_Tear *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar32 = (Entity_Player *)*puVar12; local_a00 = pEVar32; bVar3 = Entity::IsVulnerableEnemy((Entity *)pEVar32,(Entity *)0x0); if ((bVar3 != 0) && (pEVar32 != pEVar31)) { tmpVec = Entity::Position((Entity *)pEVar32,&local_1168); local_a0c = (Entity_Tear *)Vector::Distance(&local_c4c,tmpVec); FUN_00417340(); local_9fc = (Entity_Player *)((float)local_a0c - (float)BVar43._l); fVar15 = 0.4; Config::GetCollectibles(); iVar5 = EntityPtr::Ref(); local_9fc = (Entity_Player *) assert_lerp_range((float)local_9fc,30.0,90.0, (float)iVar5 * 0.32 + (float)local_a38 * 3.6,fVar15,1); pcVar1 = *(code **)(*(int *)pEVar32 + 0x20); EntityRef::constructor(&local_14a8,(Entity *)pEVar31); BVar43 = (BitSet128)ZEXT416(local_9fc); (*pcVar1)(); } puVar26 = &local_a14->field_0x1; local_a14 = (Entity_Tear *)puVar26; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar26 < puVar13); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_d14); } if (*(int *)&pEVar31->field_0x1e78 == 0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x7b,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,2,uVar30) ; Entity::SetParent(pEVar8,(Entity *)pEVar31); LAB_00798d8c: EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1e78,pEVar8); } } iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar31->_temporaryeffects,0x2a1); if (iVar5 == 1) { if (*(int *)&pEVar31->field_0x1f04 == 0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0xb9,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,0,uVar30) ; Entity::SetParent(pEVar8,(Entity *)pEVar31); Entity::AddEntityFlags(pEVar8,0x2000200000); (**(code **)(*(int *)pEVar8 + 0xc))(); goto LAB_00798e34; } } else if ((*(int *)&pEVar31->field_0x1f04 != 0) && ((cVar4 = FUN_004173d0(), cVar4 == '\0' || (iVar5 = Entity_Tear::TearIndex(*(Entity_Tear **)&pEVar31->field_0x1f04), iVar5 == 0)))) { (**(code **)(**(int **)&pEVar31->field_0x1f04 + 0x28))(); pEVar8 = (Entity *)0x0; LAB_00798e34: EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1f04,pEVar8); } bVar3 = HasCollectible(pEVar31,0x253,0); if (bVar3 == 0) { if (*(int **)&pEVar31->field_0x1e7c != (int *)0x0) { (**(code **)(**(int **)&pEVar31->field_0x1e7c + 0x28))(); pEVar8 = (Entity *)0x0; goto LAB_007994c3; } } else { bVar3 = Entity::IsFrame((Entity *)pEVar31,2,0); if (bVar3 != 0) { Config::GetCollectibles(); iVar5 = _get_index_plus_one_if_kind_4_5(); local_a14 = (Entity_Tear *)((float)iVar5 * 0.5 + 3.0); BVar43 = (BitSet128)ZEXT416(local_a14); Level::GetCurrentRoom((Level *)g_game); local_9fc = (Entity_Player *)Room::GetEntities(); local_a38 = (void *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar32 = (Entity_Player *)*puVar12; local_a00 = pEVar32; bVar3 = Entity::IsProjectile((Entity *)pEVar32); if ((((bVar3 == 0) || (cVar4 = Entity::IsDead((Entity *)pEVar32), cVar4 != '\0')) || (iVar5 = Entity::EntityCollisionClass((Entity *)pEVar32), iVar5 == 0)) || (bVar3 = Entity::HasEntityFlags((Entity *)pEVar32,0x80000000), bVar3 != 0)) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (((cVar4 != '\0') && (bVar3 = Entity::IsTear((Entity *)pEVar32), bVar3 != 0)) && ((cVar4 = Entity::IsDead((Entity *)pEVar32), cVar4 == '\0' && (iVar5 = Entity::EntityCollisionClass((Entity *)pEVar32), iVar5 != 0)))) { uVar7 = 0x17; uVar30 = Entity::InitSeed((Entity *)pEVar32); RNG::game_constructor(&local_148,uVar30,uVar7); local_14 = 1.54143e-44; local_a0c = (Entity_Tear *)RNG::RandomFloat(playerManager); local_14 = -NAN; guard_check_icall(); BVar43._l = (double)(float)local_a0c; BVar43._h = 0; if (BVar43._l < 0.15) { tmpVec = Entity::Position((Entity *)pEVar32,&local_1188); local_a0c = (Entity_Tear *)Vector::Distance(tmpVec,&pEVar31->_pos); BVar43 = (BitSet128)ZEXT416(local_a0c); if (((float)local_a0c <= 100.0) && (85.0 <= (float)local_a0c)) { pBVar53 = (BitSet128 *)&DAT_00c346f0; pBVar10 = BitSet128::operator_or (&local_1370,(BitSet128 *)&DAT_00c34600,&g_tearFlagSpectral); BitSet128::operator_or(&local_d90,pBVar10,pBVar53); pBVar53 = &g_tearFlagExplosive; pBVar10 = Entity_Tear::TearFlags((Entity_Tear *)pEVar32,&local_1380); pBVar10 = BitSet128::operator_and(&local_1390,pBVar10,pBVar53); bVar3 = BitSet128::IsNonZero(pBVar10); if (bVar3 != 0) { BitSet128::operator__(); } pBVar53 = (BitSet128 *)&DAT_00c34880; pBVar10 = Entity_Tear::TearFlags((Entity_Tear *)pEVar32,&local_1350); pBVar10 = BitSet128::operator_and(&local_13a0,pBVar10,pBVar53); bVar3 = BitSet128::IsNonZero(pBVar10); if (bVar3 != 0) { BitSet128::operator__(); } flags_00._l._4_4_ = local_d90._l._4_4_; flags_00._l._0_4_ = (undefined4)local_d90._l; flags_00._h._0_4_ = (undefined4)local_d90._h; flags_00._h._4_4_ = local_d90._h._4_4_; Entity_Tear::SetTearFlags((Entity_Tear *)pEVar32,flags_00); pcVar1 = *(code **)(*(int *)pEVar32 + 0x40); fVar35 = (float10)Entity_Tear::Scale((Entity_Tear *)local_a00); local_a0c = (Entity_Tear *)(float)(fVar35 * (float10)(float)local_a14); (*pcVar1)(); pEVar32 = local_a00; Entity_Effect::set_state((Entity_Effect *)local_a00,1); local_bd4 = 0xc1a00000; fVar35 = (float10)Entity_Tear::Height((Entity_Tear *)pEVar32); local_bd0 = (float)fVar35; pfVar21 = (float *)std::max(); BVar43 = (BitSet128)ZEXT416((uint)*pfVar21); Entity_Projectile::SetHeight((Entity_Projectile *)pEVar32,*pfVar21); FUN_00444c70(); Entity_Projectile::set_falling_accel((Entity_Projectile *)pEVar32,-0.09); Entity::SetSpawnerEntity((Entity *)pEVar32,(Entity *)pEVar31); Entity::SetParent((Entity *)pEVar32,(Entity *)pEVar31); } } } } else { uVar7 = 0x17; uVar30 = Entity::InitSeed((Entity *)pEVar32); RNG::game_constructor(&local_158,uVar30,uVar7); local_14 = 1.4013e-44; local_a0c = (Entity_Tear *)RNG::RandomFloat(music); local_14 = -NAN; guard_check_icall(); BVar43._0_12_ = ZEXT812(0x3ecccccd); BVar43._h._4_4_ = 0; if ((float)local_a0c < (float)BVar43._l) { tmpVec = Entity::Position((Entity *)pEVar32,&local_1170); local_a0c = (Entity_Tear *)Vector::Distance(tmpVec,&pEVar31->_pos); BVar43 = (BitSet128)ZEXT416(local_a0c); if (((float)local_a0c <= 100.0) && (85.0 <= (float)local_a0c)) { local_a0c = (Entity_Tear *)0x1; uVar48 = Entity::Variant((Entity *)pEVar32); switch(uVar48) { case 1: local_a0c = (Entity_Tear *)&DAT_0000001d; break; case 4: case 6: local_a0c = (Entity_Tear *)0x0; break; case 7: local_a0c = (Entity_Tear *)&DAT_00000014; break; case 9: local_a0c = (Entity_Tear *)&DAT_0000002a; } uVar30 = Random(); tmpVec = Entity::Velocity((Entity *)pEVar32,&local_1178); pVVar20 = Entity::Position((Entity *)local_a00,&local_1180); pEVar31 = local_a24; local_a30 = (Entity_Player *) Game::Spawn(g_game,2,(uint)local_a0c,pVVar20,tmpVec,(Entity *)local_a24, 0,uVar30); Entity::SetParent((Entity *)local_a30,(Entity *)pEVar31); pBVar53 = (BitSet128 *)&DAT_00c346f0; pBVar10 = BitSet128::operator_or (&local_1360,(BitSet128 *)&DAT_00c34600,&g_tearFlagSpectral); BitSet128::operator_or(&local_da0,pBVar10,pBVar53); pEVar32 = local_a00; uVar46 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)local_a00); if ((uVar46 & 2) != 0) { BitSet128::operator__(); } uVar46 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)pEVar32); if ((uVar46 & 0x10000) != 0) { BitSet128::operator__(); } pEVar32 = local_a30; flags._l._4_4_ = local_da0._l._4_4_; flags._l._0_4_ = (undefined4)local_da0._l; flags._h._0_4_ = (undefined4)local_da0._h; flags._h._4_4_ = local_da0._h._4_4_; Entity_Tear::SetTearFlags((Entity_Tear *)local_a30,flags); pcVar1 = *(code **)(*(int *)pEVar32 + 0x3c); Entity::GetColor((Entity *)local_a00); (*pcVar1)(); pcVar1 = *(code **)(*(int *)local_a30 + 0x40); fVar35 = (float10)Entity_Tear::Scale((Entity_Tear *)local_a00); local_a0c = (Entity_Tear *)(float)(fVar35 * (float10)(float)local_a14); (*pcVar1)(); Entity_Effect::set_state((Entity_Effect *)local_a30,1); pEVar32 = local_a00; local_bdc = -20.0; fVar35 = (float10)Entity_Tear::Height((Entity_Tear *)local_a00); local_bd8 = (float)fVar35; pfVar21 = (float *)std::max(); Entity_Projectile::SetHeight((Entity_Projectile *)local_a30,*pfVar21); FUN_00444c70(); Entity_Projectile::set_falling_accel((Entity_Projectile *)local_a30,-0.09); fVar35 = (float10)Entity_Tear::Scale((Entity_Tear *)pEVar32); local_a0c = (Entity_Tear *)(float)fVar35; BVar43 = (BitSet128)ZEXT416(local_a0c); FUN_00652ae0(); FUN_0067af30(); Entity_Tear::SetScale((Entity_Tear *)local_a30,(float)BVar43._l); (**(code **)(*(int *)pEVar32 + 0x28))(); } } } pvVar9 = (void *)((int)local_a38 + 1); local_a38 = pvVar9; pvVar36 = (void *)EntityList::Size(); } while (pvVar9 < pvVar36); } } if (*(int *)&pEVar31->field_0x1e7c == 0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x7b,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,5,uVar30) ; Entity::SetParent(pEVar8,(Entity *)pEVar31); LAB_007994c3: EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1e7c,pEVar8); } } bVar3 = HasCollectible(pEVar31,0x2b8,0); EVar2 = pEVar31->_salvationEffect; if (bVar3 == 0) { if (EVar2 != (EntityPtr)0x0) { (**(code **)(*(int *)EVar2 + 0x28))(); EntityPtr::SetReference(&pEVar31->_salvationEffect,(Entity *)0x0); } } else { local_a0d = 0; if (EVar2 == (EntityPtr)0x0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x7b,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,6,uVar30) ; Entity::SetParent(pEVar8,(Entity *)pEVar31); EntityPtr::SetReference(&pEVar31->_salvationEffect,pEVar8); local_a0d = 1; if (pEVar31->_salvationEffect != (EntityPtr)0x0) goto LAB_00799548; } else { LAB_00799548: FUN_007d4340(); FUN_00435ed0(); EVar2 = pEVar31->_salvationEffect; tmpVec = Vector::Vector(&local_1190,0.0,-15.0); Entity::SetPositionOffset((Entity *)EVar2,tmpVec); sprite = (Sprite *)Entity::GetSprite((Entity *)pEVar31->_salvationEffect); bVar3 = Entity::HasEntityFlags((Entity *)pEVar31,0x4000); if (bVar3 == 0) { local_a14 = (Entity_Tear *)0x0; } else { local_a14 = (Entity_Tear *)0x3f000000; } iVar5 = Entity::FrameCount((Entity *)pEVar31); fVar15 = (float)(iVar5 % 0x168) + (float)local_a14; BVar43 = (BitSet128)ZEXT416((uint)fVar15); Sprite::SetRotation(sprite,fVar15); } if (local_a0d != 0) { (**(code **)(*(int *)pEVar31->_salvationEffect + 0xc))(); } } local_a29 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x2c1); if (local_a29 == 0) { if (pEVar31->_darkArtsBlastPending != 0) { pEVar22 = (Entity_Tear *)Sprite::Color((Sprite *)&pEVar31->_sprite); BVar43 = (BitSet128)ZEXT816(0); goto LAB_00799685; } } else { if (pEVar31->_darkArtsBlastPending == 0) { local_a14 = (Entity_Tear *)Sprite::Color((Sprite *)&pEVar31->_sprite); fVar15 = random_float(); BVar43._l._0_4_ = fVar15 * 0.1 + 0.1; BVar43._4_12_ = extraout_var_01; pEVar22 = local_a14; } else { pEVar22 = (Entity_Tear *)Sprite::Color((Sprite *)&pEVar31->_sprite); BVar43 = (BitSet128)ZEXT816(0); } LAB_00799685: Font::SetLineHeightModifier((Font *)pEVar22,(float)BVar43._l); FUN_00435d90(); pvVar36 = TemporaryEffects::GetNullEffect(&pEVar31->_temporaryeffects,0x6f); if (pvVar36 != (void *)0x0) { *(int *)((int)pvVar36 + 8) = ((*(int *)((int)pvVar36 + 8) + 0x1d) / 0x1e) * 0x1e + 1; } } if (((pEVar31->_darkArtsBlastPending != 0) && (SetMinDamageCooldown(pEVar31), pEVar31->_darkArtsBlastPending != 0)) && ((pEVar31->_darkArtsLastSnare == (void *)0x0 || (cVar4 = Entity::IsDead(), cVar4 != '\0')))) { pEVar31->_darkArtsBlastPending = 0; EntityPtr::SetReference((EntityPtr *)&pEVar31->_darkArtsLastSnare,(Entity *)0x0); (**(code **)(*(int *)pEVar31 + 0x60))(); play_sound_with_fart_seed(0x50,1.0,2,0,1.0); Game::ShakeScreen(g_game,10); pCVar16 = (ColorMod *)Color::Color(); Entity::MakeGroundPoofAtSelf((Entity *)pEVar31,pCVar16,0.8); Game::DamageRadius(&pEVar31->_pos,(Entity *)pEVar31,0,0,0,50.0,g_tearFlagsNone, pEVar31->_darkArtsDamage,80.0); BVar43 = (BitSet128)ZEXT816(0x3f800000); pcVar1 = *(code **)(*(int *)pEVar31 + 0x3c); Color::Color(); (*pcVar1)(); FUN_00435d90(); SetMinDamageCooldown(pEVar31); Entity::AddEntityFlags((Entity *)pEVar31,0x1000000000); std::vector::clear(&pEVar31->_darkArtsHitList,0); pEVar31->_darkArtsDamage = 0.0; TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x80,-1); } if (local_a29 == 0) { if (*(Entity **)&pEVar31->field_0x1e88 != (Entity *)0x0) { Entity::SetParent(*(Entity **)&pEVar31->field_0x1e88,(Entity *)0x0); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1e88,(Entity *)0x0); } } else { Entity::GetCollisionCapsule((Entity *)pEVar31,local_e18,&g_vectorZero); local_df8 = local_df8 + 10.0; BVar43 = (BitSet128)ZEXT416((uint)local_df8); if ((pEVar31->_playerType == 0x18) && (bVar3 = HasCollectible(pEVar31,0x26b,0), bVar3 != 0)) { local_df8 = local_df8 + 30.0; BVar43 = (BitSet128)ZEXT416((uint)local_df8); local_a0d = 0; if (*(int *)&pEVar31->field_0x1e88 == 0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x7b,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,8, uVar30); Entity::SetParent(pEVar8,(Entity *)pEVar31); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1e88,pEVar8); BVar43 = (BitSet128)ZEXT416((uint)local_df8); local_a0d = 1; if (*(int *)&pEVar31->field_0x1e88 != 0) goto LAB_007999a3; } else { LAB_007999a3: BVar43._l._0_4_ = (float)BVar43._l / 120.0; FUN_00435ed0(); pEVar8 = *(Entity **)&pEVar31->field_0x1e88; tmpVec = Vector::Vector(&local_1198,0.0,-15.0); Entity::SetPositionOffset(pEVar8,tmpVec); } if (local_a0d != 0) { (**(code **)(**(int **)&pEVar31->field_0x1e88 + 0xc))(); } } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::query_player_capsule_hits(entityList,&local_cb4,local_e18,10); local_14 = 1.68156e-44; local_a14 = (Entity_Tear *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar22 = (Entity_Tear *)*puVar12; local_a0c = pEVar22; bVar3 = Entity::IsActiveEnemy((Entity *)pEVar22,0); if ((bVar3 == 0) || (bVar3 = Entity::HasEntityFlags((Entity *)pEVar22,0x20000000), bVar3 != 0)) { bVar3 = Entity::IsProjectile((Entity *)pEVar22); if (bVar3 != 0) { uVar46 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)pEVar22); if ((uVar46 & 0x80000000) == 0) goto LAB_00799a98; } } else { LAB_00799a98: bVar3 = EntityList::HitListContains ((EntityList *)&pEVar31->_darkArtsHitList,(Entity *)pEVar22); if (bVar3 == 0) { tmpVec = Entity::Position((Entity *)pEVar22,&local_11a0); local_a30 = (Entity_Player *)&pEVar31->_pos; Vector::__sub(tmpVec,&snareOffset,(Vector *)local_a30); if (*(int *)&pEVar31->field_0x1e88 == 0) { local_9fc = (Entity_Player *)(pEVar31->_size + 10.0); local_a38 = (void *)Vector::Length(&snareOffset); } else { local_9fc = (Entity_Player *)(pEVar31->_size + 40.0); local_a38 = (void *)Vector::Length(&snareOffset); } if ((float)local_9fc < (float)local_a38) { Vector::Resize(&snareOffset,(float)local_9fc); } Vector::__add(&pEVar31->_pos,&local_c54,&snareOffset); bVar3 = Entity::IsEnemy((Entity *)pEVar22); if (bVar3 != 0) { pEVar8 = Entity::GetStatusEffectTarget((Entity *)pEVar22); uVar30 = Entity::GetHitListIndex(pEVar8); uVar7 = Entity::GetHitListIndex((Entity *)local_a0c); if (uVar30 == uVar7) { local_a0c = (Entity_Tear *)Entity::GetStatusEffectTarget((Entity *)local_a0c); } } FUN_00431620(); Isaac::Random(2); GetTearHitParams(); uVar30 = Random(); pEVar32 = (Entity_Player *) Game::Spawn(g_game,1000,0xc2,&local_c54,&g_vectorZero,(Entity *)pEVar31,0, uVar30); local_a00 = pEVar32; if (pEVar31->_darkArtsLastSnare != (Entity *)0x0) { Entity::SetChild(pEVar31->_darkArtsLastSnare,(Entity *)pEVar32); Entity::SetParent((Entity *)pEVar32,pEVar31->_darkArtsLastSnare); Entity::SubType(pEVar31->_darkArtsLastSnare); FUN_00435cd0(); } pcVar1 = *(code **)(*(int *)pEVar32 + 0x40); Entity::SubType((Entity *)local_a00); (*pcVar1)(); FUN_00665b80(); pEVar22 = local_a0c; Entity::SetTarget((Entity *)local_a00,(Entity *)local_a0c); (**(code **)(*(int *)local_a00 + 0xc))(); EntityPtr::SetReference((EntityPtr *)&pEVar31->_darkArtsLastSnare,(Entity *)local_a00); fVar35 = (float10)Entity::CollisionDamage((Entity *)local_a00); local_a38 = (void *)(float)fVar35; pEVar31->_darkArtsDamage = (float)local_a38 + pEVar31->_darkArtsDamage; iVar5 = Entity::SubType((Entity *)local_a00); fVar15 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * 0.05 + 1.5; BVar43 = (BitSet128)ZEXT416((uint)fVar15); play_sound_with_fart_seed(0x1fb,0.8,1,0,fVar15); if (*(int *)&pEVar31->field_0x1e88 != 0) { tmpVec = Entity::Position((Entity *)pEVar22,&local_11a8); local_a38 = (void *)Vector::Distance(tmpVec,&pEVar31->_pos); FUN_00417340(); BVar43._l._0_4_ = (float)BVar43._l + pEVar31->_size + 10.0; if ((float)BVar43._l < (float)local_a38) { uVar30 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xa6,&local_c54,&g_vectorZero,(Entity *)pEVar31,0, uVar30); Entity::SetParent((Entity *)effect,(Entity *)pEVar22); sprite = (Sprite *)Entity::GetSprite((Entity *)effect); pCVar16 = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,pCVar16); BlendMode::SetMode(local_12d0,1,0); sprite = (Sprite *)Entity::GetSprite((Entity *)effect); puVar13 = local_12d0; layer = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,puVar13); sprite = (Sprite *)Entity::GetSprite((Entity *)effect); local_bc8 = 2.0; tmpVec = Vector::operator_mul(&local_11b0,&local_bc8,&g_vectorOne); Sprite::SetScale(sprite,tmpVec); Entity_Effect::SetRadii(effect,0.32,0.32); (**(code **)(*(int *)effect + 0xc))(); Entity::SetPosition((Entity *)effect,(Vector *)local_a30); sprite = (Sprite *)Entity::GetSprite((Entity *)effect); local_bc4 = (void *)0x3f800000; tmpVec = Vector::operator_mul(&local_11b8,(float *)&local_bc4,&g_vectorOne); Sprite::SetScale(sprite,tmpVec); Entity_Effect::SetRadii(effect,0.16,0.16); (**(code **)(*(int *)effect + 0xc))(); pEVar31 = local_a24; } } } } puVar26 = &local_a14->field_0x1; local_a14 = (Entity_Tear *)puVar26; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar26 < puVar13); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_cb4); } pEVar22 = (Entity_Tear *)&pEVar31->_temporaryeffects; local_a14 = TemporaryEffects::GetNullEffect((TemporaryEffects *)pEVar22,0x6f); if (local_a14 != (Entity_Tear *)0x0) { iVar5 = Entity::GetIntervalTicks((Entity *)pEVar31,2.0,0.0); if (iVar5 != 0) { if (local_a29 == 0) { if (pEVar31->_darkArtsBlastPending == 0) { local_bc0 = (void *)0x10; piVar19 = (int *)std::min(); local_9fc = (Entity_Player *)((float)*piVar19 * 0.0625); BVar43._l._0_4_ = random_float(); BVar43._4_12_ = extraout_var_02; if ((float)BVar43._l < (float)local_9fc + 0.6) { tmpVec = (Vector *)TearsOffset(pEVar31); Vector::__add(&pEVar31->_pos,&local_11c0,tmpVec); tmpVec = Vector::Vector(&local_11c8,1.0,0.8); pVVar20 = MusicManager::RandomVector(&local_11d0); tmpVec = Vector::Mul(tmpVec,&local_11d8,pVVar20); local_bbc = (void *)random_float(); tmpVec = Vector::__mul(tmpVec,&local_11e0,(float *)&local_bbc); local_bb8 = 16.0; Vector::__mul(tmpVec,&local_c5c,&local_bb8); uVar30 = Random(); local_bb4 = 0.3; tmpVec = Vector::__mul(&local_c5c,&local_11e8,&local_bb4); local_bac = 0.5; pVVar20 = Vector::__mul(&local_a24->_velocity,&local_11f0,&local_bac); tmpVec = Vector::__add(tmpVec,&local_11f8,pVVar20); pVVar20 = (Vector *)TearsOffset(local_a24); pVVar20 = Vector::__add(&local_a24->_pos,&local_1200,pVVar20); pEVar8 = Game::Spawn(g_game,1000,0x6f,pVVar20,tmpVec,(Entity *)0x0,0,uVar30); local_ba8 = (float)local_9fc * 1.33 + 0.66; tmpVec = &g_vectorOne; local_b78 = 1.0; pfVar21 = (float *)std::min(); tmpVec = Vector::operator_mul(&local_1208,pfVar21,tmpVec); Entity::SetSpriteScale(pEVar8,tmpVec); tmpVec = Vector::Vector(&local_1210,0.0,-30.0); tmpVec = Vector::__add(tmpVec,&local_1218,&local_c5c); Entity::SetPositionOffset(pEVar8,tmpVec); anm = (ANM2 *)Entity::GetSprite(pEVar8); local_ba4 = 1.0; local_be4 = 1.3 - (float)local_9fc * 0.5; pfVar21 = (float *)std::min(); BVar43 = (BitSet128)ZEXT416((uint)*pfVar21); set_PlaybackSpeed(anm,*pfVar21); Color::Color(); (**(code **)(*(int *)pEVar8 + 0x3c))(); set_field_358(pEVar8,-20.0); (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar22 = local_a34; pEVar31 = local_a24; } } } } if ((int)((Vector *)((int)local_a14 + 8))->x % (int)local_a1c == 0) { TemporaryEffects::RemoveNullEffect ((TemporaryEffects *)pEVar22,0x6f,(int)*(float *)&local_a14->field_0x4 / 0x1e + 1); } } pvVar36 = TemporaryEffects::GetNullEffect((TemporaryEffects *)pEVar22,0x72); if (pvVar36 != (void *)0x0) { iVar5 = Entity::GetIntervalTicks((Entity *)pEVar31,2.0,0.0); if (iVar5 != 0) { BVar43._l._0_4_ = random_float(); BVar43._4_12_ = extraout_var_03; if ((float)BVar43._l < 1.6) { tmpVec = (Vector *)TearsOffset(pEVar31); Vector::__add(&pEVar31->_pos,&local_1220,tmpVec); tmpVec = Vector::Vector(&local_1228,1.0,0.8); pVVar20 = MusicManager::RandomVector(&local_1230); tmpVec = Vector::Mul(tmpVec,&local_1238,pVVar20); local_ba0 = random_float(); tmpVec = Vector::__mul(tmpVec,&local_1240,&local_ba0); local_b9c = 16.0; Vector::__mul(tmpVec,&local_c64,&local_b9c); uVar30 = Random(); local_b98 = 0.3; tmpVec = Vector::__mul(&local_c64,&local_1248,&local_b98); local_b74 = 0.5; pVVar20 = Vector::__mul(&local_a24->_velocity,&local_1250,&local_b74); tmpVec = Vector::__add(tmpVec,&local_1258,pVVar20); pVVar20 = (Vector *)TearsOffset(local_a24); pVVar20 = Vector::__add(&local_a24->_pos,&local_1260,pVVar20); pEVar8 = Game::Spawn(g_game,1000,0x6f,pVVar20,tmpVec,(Entity *)0x0,0,uVar30); local_b70 = 1.99; local_b6c = 1.0; tmpVec = &g_vectorOne; pfVar21 = (float *)std::min(); tmpVec = Vector::operator_mul(&local_1268,pfVar21,tmpVec); Entity::SetSpriteScale(pEVar8,tmpVec); tmpVec = Vector::Vector(&local_1270,0.0,-30.0); tmpVec = Vector::__add(tmpVec,&local_1278,&local_c64); Entity::SetPositionOffset(pEVar8,tmpVec); anm = (ANM2 *)Entity::GetSprite(pEVar8); local_b68 = 0.79999995; local_b64 = 1.0; pfVar21 = (float *)std::min(); BVar43 = (BitSet128)ZEXT416((uint)*pfVar21); set_PlaybackSpeed(anm,*pfVar21); set_field_358(pEVar8,-20.0); (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar22 = local_a34; } } } itemConfig = Isaac::GetItemConfig(); Config::GetNullItem(itemConfig,0x73); iVar5 = FUN_00930a00(); pEVar31 = local_a24; if (iVar5 != 0) { uVar30 = *(uint *)(iVar5 + 8) & 0x80000007; bVar34 = uVar30 == 0; if ((int)uVar30 < 0) { bVar34 = (uVar30 - 1 | 0xfffffff8) == 0xffffffff; } if (bVar34) { if ((int)*(uint *)(iVar5 + 8) < 0x3d) { uVar30 = Random(); pEVar31 = local_a24; local_a1c = (Entity_Familiar *) Game::Spawn(g_game,4,9,&local_a24->_pos,&g_vectorZero,(Entity *)local_a24,0, uVar30); if (local_a1c != (Entity_Familiar *)0x0) { pBVar10 = GetBombFlags(pEVar31,&local_13b0,0); BVar43 = *pBVar10; FUN_006a6910(); } } else { play_sound_with_fart_seed(0x25,1.0,2,0,1.0); Color::Color(local_510); tmpVec = &pEVar31->_pos; Game::Fart(g_game,tmpVec,85.0,(Entity *)pEVar31,1.0,0,color_02); Game::ButterBeanFart(g_game,tmpVec,120.0,(Entity *)pEVar31,0,0); uVar30 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0x8d,tmpVec,&g_vectorZero,(Entity *)pEVar31,1,uVar30); Entity_Effect::SetTimeout(effect,-1); (**(code **)(*(int *)effect + 0xc))(); pEVar22 = (Entity_Tear *)&pEVar31->_temporaryeffects; } } } itemConfig = Isaac::GetItemConfig(); ItemConfig::GetCollectible(itemConfig,0x271); local_a1c = (Entity_Familiar *)FUN_00930a00(); if (local_a1c != (Entity_Familiar *)0x0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c8120c) && (_Init_thread_header(), DAT_00c8120c == -1)) { local_14 = 1.82169e-44; BVar43 = (BitSet128)ZEXT816(0x3f800000); Color::Color(); local_14 = -NAN; _Init_thread_footer(); } iVar5 = *(int *)((std_string *)&local_a1c->_damageEvents)->_buf; if (iVar5 < 0x1f) { iVar5 = iVar5 % 10; } else { if (iVar5 < 0x5b) { iVar28 = 0xf; } else { if (0x96 < iVar5) goto LAB_0079a6f8; iVar28 = 0x1e; } iVar5 = iVar5 % iVar28; } if (iVar5 == 0) { (**(code **)(*(int *)pEVar31 + 0x3c))(); } } LAB_0079a6f8: local_a40 = 15.0; if (pEVar31->_ponyCharge < 1) { if (pEVar31->_suplexState == 1) { if (8 < pEVar31->_suplexAimCountdown) { local_a0c = (Entity_Tear *)(pEVar31->_suplexAimCountdown + -8); local_a00 = (Entity_Player *)0x2c5; local_a40 = 12.0; goto LAB_0079ad8f; } } else { bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x251); if (bVar3 == 0) { bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x2ca); if (((bVar3 != 0) && (pEVar31->_playerType == 0x23)) && (iVar5 = GetOtherTwin(pEVar31), iVar5 != 0)) { local_a00 = (Entity_Player *)0x2ca; itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x2ca); iVar5 = FUN_00930a00(); local_a0c = (Entity_Tear *)(configItem->maxCooldown - *(int *)(iVar5 + 8)); local_a1c = (Entity_Familiar *)Vector::LengthSquared(&pEVar31->_velocity); BVar43._0_12_ = ZEXT812(0x41c80000); BVar43._h._4_4_ = 0; pEVar22 = (Entity_Tear *)&pEVar31->_temporaryeffects; if ((float)local_a1c < (float)BVar43._l) { local_a40 = 0.0; } goto LAB_0079ad8f; } } else if (pEVar31->_marsCooldown == pEVar31->_marsUnk1) { switch(pEVar31->_marsUnk2) { case 0: iVar5 = 0; break; case 1: iVar5 = 2; break; case 2: iVar5 = 1; break; case 3: iVar5 = 3; break; default: iVar5 = -1; } Isaac::GetAxisAlignedUnitVectorFromDir(&dashDir,iVar5); room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::IsMirrorWorld(room); if (bVar3 != 0) { BVar43._l._0_4_ = -dashDir.x; BVar43._l._4_4_ = 0x80000000; BVar43._h._0_4_ = 0x80000000; BVar43._h._4_4_ = 0x80000000; dashDir.x = (float)BVar43._l; } local_b60 = 4.0; bVar3 = 0; tmpVec = Vector::operator_mul(&local_1280,&local_b60,&dashDir); Entity::AddVelocity((Entity *)pEVar31,tmpVec,bVar3); std::vector::clear(&pEVar31->_contactHitList,0); play_sound_with_fart_seed(0x77,1.0,2,0,1.0); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x3a); RemoveCostume(pEVar31,configItem); } else { pvVar36 = TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)pEVar22,0x251); if ((pvVar36 != (void *)0x0) && (local_a0c = *(Entity_Tear **)((int)pvVar36 + 8), 0 < (int)local_a0c)) { local_a00 = (Entity_Player *)0x251; local_a40 = 15.0; itemConfig = Isaac::GetItemConfig(); local_a1c = (Entity_Familiar *)ItemConfig::GetCollectible(itemConfig,0x2c0); local_a14 = (Entity_Tear *)FUN_00930a00(); if ((local_a14 != (Entity_Tear *)0x0) && ((int)((Vector *)((int)local_a14 + 8))->x < 4)) { TemporaryEffect::TemporaryEffect(local_df0,(ItemConfig_Item *)local_a1c); local_de8 = 4 - (int)((Vector *)((int)local_a14 + 8))->x; TemporaryEffects::AddEffect((TemporaryEffects *)pEVar22,local_df0,0,1); } goto LAB_0079ad8f; } } } std::vector::clear(&pEVar31->_contactHitList,0); Entity::ClearEntityFlags((Entity *)pEVar31,0x4000000); } else { local_a00 = (Entity_Player *)0x82; local_a0c = (Entity_Tear *)(0x3c - pEVar31->_ponyCharge); LAB_0079ad8f: bVar3 = Entity::HasEntityFlags((Entity *)pEVar31,0x4000); if (bVar3 == 0) { local_a1c = (Entity_Familiar *)((uint)local_a0c & 0x80000003); if ((int)local_a1c < 0) { local_a1c = (Entity_Familiar *) (((uint)((int)&local_a1c[-1]._wispCollectibleType + 3U) | 0xfffffffc) + 1); } if (local_a1c == (Entity_Familiar *)0x0) { local_a14 = *(Entity_Tear **)(*(int *)pEVar31 + 0x3c); if (local_a00 != (Entity_Player *)0x2ca) { Color::Color(); (*(code *)local_a14)(); goto LAB_0079aeb9; } Color::Color(); (*(code *)local_a14)(); } else { LAB_0079aeb9: if ((local_a00 == (Entity_Player *)0x82) && (((uint)local_a0c & 1) == 0)) { bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0xb5); if (bVar3 != 0) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_a14 = (Entity_Tear *)Vector::Rotated(&pEVar31->_velocity,&local_e20,90.0); if (local_a1c != (Entity_Familiar *)0x0) { local_a3c = (void *)0x40800000; } fVar15 = random_float(); local_b5c = (fVar15 - 0.5) * (float)local_a3c; tmpVec = Vector::__mul((Vector *)local_a14,&local_e28,&local_b5c); tmpVec = Vector::__add(&pEVar31->_pos,&local_e30,tmpVec); Room::GetClampedPosition(room,&local_d64,tmpVec,10.0); uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x13,&local_d64,&g_vectorZero,(Entity *)pEVar31,2, uVar30); pcVar1 = *(code **)(*(int *)pEVar8 + 0x40); fVar35 = (float10)GetTearPoisonDamage(local_a24); local_a1c = (Entity_Familiar *)(float)(fVar35 * (float10)4.0 + (float10)10.0); (*pcVar1)(); tmpVec = Vector::__unm(&g_vectorOne,&local_e38); Entity::SetSize(pEVar8,64.0,*tmpVec,-1); Entity::SetParent(pEVar8,(Entity *)local_a24); (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar31 = local_a24; } } } BVar43 = (BitSet128)ZEXT416((uint)local_a40); if (0.0 < local_a40) { local_a14 = (Entity_Tear *)Level::GetCurrentRoom((Level *)g_game); local_a3c = (Entity *)Vector::Length(&pEVar31->_velocity); local_a1c = (Entity_Familiar *)Vector::GetAngleDegrees(&pEVar31->_velocity); local_ab8 = 15.0; Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { local_a08 = (Entity_Player *)0x40000000; } local_9fc = (Entity_Player *)((pEVar31->_meleeDamage + 2.0) * (float)local_a08); local_a08 = (Entity_Player *)0x41c00000; if (local_a00 == (Entity_Player *)0x82) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { local_a04 = (Entity_NPC *)0x41a00000; } local_9fc = (Entity_Player *)((float)local_9fc + (float)local_a04); } else if ((local_a00 == (Entity_Player *)0x2ca) && (bVar3 = HasCollectible(pEVar31,0x164,0), bVar3 != 0)) { local_9fc = (Entity_Player *)((float)local_9fc + (float)local_9fc); local_a08 = (Entity_Player *)0x42100000; } BVar43 = (BitSet128)ZEXT416(local_a1c); pEVar23 = local_a1c; tmpVec = Vector::Vector(&local_e40,(float)local_a3c / 24.0,1.0); Capsule::constructor(local_14f8,&pEVar31->_pos,tmpVec,(float)pEVar23,(float)local_a08); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius (entityList,&local_cc4,&pEVar31->_pos,(float)local_a3c * 3.0,0xffffffff); local_14 = 1.96182e-44; local_a04 = (Entity_NPC *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); local_a30 = (Entity_Player *)*puVar12; tmpVec = Entity::Position((Entity *)local_a30,&local_e48); pVVar20 = Entity::Position((Entity *)local_a30,&local_e50); bVar3 = Vector::operator_ne(tmpVec,pVVar20); if (bVar3 == 0) { tmpVec = Entity::Position((Entity *)local_a30,&local_e58); pVVar20 = Entity::Position((Entity *)pEVar31,&local_e60); bVar3 = Vector::operator_eq(tmpVec,pVVar20); pEVar32 = local_a30; if ((bVar3 == 0) && (FUN_00417340(), 0.0 < (float)BVar43._l)) { pfVar21 = (float *)FUN_00417350(); BVar43 = (BitSet128)ZEXT816(0); if (0.0 < *pfVar21) { iVar5 = FUN_00417350(); BVar43 = (BitSet128)ZEXT816(0); if ((0.0 < *(float *)(iVar5 + 4)) && (bVar3 = EntityList::HitListContains ((EntityList *)&pEVar31->_contactHitList,(Entity *)pEVar32), bVar3 == 0)) { sprite = (Sprite *)Entity::GetSprite((Entity *)pEVar32); fVar35 = (float10)Sprite::Rotation(sprite); local_a1c = (Entity_Familiar *)(float)fVar35; tmpVec = (Vector *)FUN_00417350(); FUN_00417340(); local_a08 = (Entity_Player *)BVar43._l; pVVar20 = Entity::Position((Entity *)local_a30,&local_e68); BVar43 = (BitSet128)ZEXT416(local_a1c); Capsule::constructor (local_14d0,pVVar20,tmpVec,(float)local_a1c,(float)local_a08); EntityPtr::clear(local_d6c); cVar4 = FUN_00440e80(); pEVar32 = local_a30; if (cVar4 != '\0') { tmpVec = Entity::Position((Entity *)local_a30,&local_e70); tmpVec = Vector::__sub(tmpVec,&local_e78,&pEVar31->_pos); Vector::Normalized(tmpVec,&local_c6c); bVar3 = Entity::IsEnemy((Entity *)pEVar32); if (bVar3 != 0) { bVar3 = Entity::IsType((Entity *)pEVar32,0x21,-1,-1); if (bVar3 == 0) { if (local_a00 == (Entity_Player *)0x2c5) { bVar3 = TryHoldEntity(pEVar31,(Entity *)pEVar32); if (bVar3 != 0) { pEVar31->_itemState = 0x2c5; pEVar31->_suplexAimCountdown = 0x3c; pEVar31->_suplexState = 2; play_sound_with_fart_seed(0x407,1.0,2,0,1.0); fVar15 = random_float(); BVar43._l._0_4_ = fVar15 * 0.2 + 0.9; BVar43._4_12_ = extraout_var_04; play_sound_with_fart_seed(0xf9,1.0,2,0,(float)BVar43._l); break; } } else { cVar4 = (**(code **)(*(int *)pEVar32 + 0x4c))(); if (cVar4 == '\0') { tmpVec = Vector::__mul(&local_c6c,&local_e90,&local_ab8); Entity::get_friction(); bVar3 = 0; local_b50 = (float)BVar43._l; tmpVec = Vector::__div(tmpVec,&local_e98,&local_b50); pEVar32 = local_a30; } else { tmpVec = Vector::__mul(&local_c6c,&local_e80,&local_ab8); bVar3 = 0; local_b54 = 0.6; tmpVec = Vector::__mul(tmpVec,&local_e88,&local_b54); } Entity::AddVelocity((Entity *)pEVar32,tmpVec,bVar3); pcVar1 = *(code **)(*(int *)pEVar32 + 0x20); EntityRef::constructor(&local_1548,(Entity *)pEVar31); BVar43 = (BitSet128)ZEXT416(local_9fc); cVar4 = (*pcVar1)(); pEVar32 = local_a30; if ((cVar4 != '\0') && (bVar3 = Entity::IsVulnerableEnemy((Entity *)local_a30,(Entity *)0x0) , bVar3 != 0)) { play_sound_with_fart_seed(0x4d,1.0,10,0,1.5); effect = Entity_NPC::MakeSplat((Entity_NPC *)pEVar32,1.0); pcVar1 = *(code **)(*(int *)effect + 0x3c); Entity::SplatColor((Entity *)local_a30); (*pcVar1)(); pEVar31 = local_a24; Entity::ForceCollide((Entity *)local_a24,(Entity *)local_a30,0); } } } else { pcVar1 = *(code **)(*(int *)pEVar32 + 0x20); EntityRef::constructor(&local_1520,(Entity *)pEVar31); (*pcVar1)(); } } FUN_00431620(); } } } } } pVVar20 = (Vector *)((int)&local_a04->field_0x0 + 1); local_a04 = (Entity_NPC *)pVVar20; tmpVec = (Vector *)EntityList::Size(); } while (pVVar20 < tmpVec); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_cc4); } } if (local_a00 == (Entity_Player *)0x2ca) { if ((pEVar31->_playerType != 0x23) || (iVar5 = GetOtherTwin(pEVar31), iVar5 == 0)) goto LAB_0079ba07; pEVar8 = (Entity *)GetOtherTwin(pEVar31); Entity::Position(pEVar8,&local_d74); local_a1c = (Entity_Familiar *)assert_lerp_range((float)(int)local_a0c,0.0,15.0,1.0,16.0,1); tmpVec = Vector::__sub(&local_d74,&local_ea0,&pEVar31->_pos); BVar43 = (BitSet128)ZEXT416(local_a1c); bVar3 = 0; tmpVec = Vector::Resized(tmpVec,&local_ea8,(float)local_a1c); Entity::AddVelocity((Entity *)pEVar31,tmpVec,bVar3); iVar5 = Entity::GetIntervalTicks((Entity *)pEVar31,2.0,0.0); if (iVar5 == 0) goto LAB_0079ba07; uVar30 = Random(); local_b4c = 0.5; tmpVec = Vector::__mul(&pEVar31->_velocity,&local_eb0,&local_b4c); pEVar8 = Game::Spawn(g_game,1000,0x6f,&pEVar31->_pos,tmpVec,(Entity *)pEVar31,0,uVar30); BlendMode::SetMode(local_12bc,2,0); sprite = (Sprite *)Entity::GetSprite(pEVar8); puVar13 = local_12bc; layer = Sprite::GetLayer(sprite,(byte *)0x0); copy_20_bytes(layer->_blendMode,puVar13); pEVar31 = local_a24; tmpVec = Vector::Vector(&local_eb8,0.0,-8.0); tmpVec = Vector::__add(&pEVar31->_posOffset,&local_ec0,tmpVec); Entity::SetPositionOffset(pEVar8,tmpVec); fVar15 = random_float(); local_a1c = (Entity_Familiar *)(fVar15 * 0.7 + 0.3); Color::Color(); BVar43 = (BitSet128)ZEXT416((uint)((float)local_a1c * 0.7)); Color::SetOffset(&local_278,(float)local_a1c * 0.4,(float)local_a1c * 0.7,(float)local_a1c); (**(code **)(*(int *)pEVar8 + 0x3c))(); set_field_358(pEVar8,-5.0); (**(code **)(*(int *)pEVar8 + 0xc))(); SetMinDamageCooldown(pEVar31); LAB_0079ba25: Entity::AddEntityFlags((Entity *)pEVar31,0x1000000000); } else { if (pEVar31->_collidesWithGrid == 0) { bVar3 = Vector::operator_ne(&pEVar31->_velocity,&g_vectorZero); if ((bVar3 != 0) && (pEVar31->_dead == 0)) { Vector::Normalize(&pEVar31->_velocity); Vector::operator_mul_assign(&pEVar31->_velocity,&local_a40); } } else { pVVar20 = Vector::Normalized(&pEVar31->_gridCollisionVelocity,&local_ec8); tmpVec = &pEVar31->_gridCollisionNormal; local_a1c = (Entity_Familiar *)Vector::Dot(pVVar20,tmpVec); BVar43._0_12_ = ZEXT812(0x3e4ccccd); BVar43._h._4_4_ = 0; if ((float)BVar43._l <= (float)local_a1c) { if (pEVar31->_suplexState == 1) { local_b44 = 1.12104e-44; piVar19 = (int *)std::min(); pEVar31->_suplexAimCountdown = *piVar19; } bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x251); if (bVar3 != 0) { TemporaryEffects::RemoveCollectibleEffect(&pEVar31->_temporaryeffects,0x251,-1); pEVar31->_marsUnk2 = -1; dash_impact(pEVar31); } pEVar31->_ponyCharge = 0; TemporaryEffects::RemoveCollectibleEffect(&pEVar31->_temporaryeffects,0x82,-1); TemporaryEffects::RemoveCollectibleEffect(&pEVar31->_temporaryeffects,0xb5,-1); Game::ShakeScreen(g_game,8); local_b40 = -10.0; bVar3 = 0; tmpVec = Vector::operator_mul(&local_ee0,&local_b40,&pEVar31->_gridCollisionNormal); Entity::AddVelocity((Entity *)pEVar31,tmpVec,bVar3); } else { local_b48 = Vector::Dot(&pEVar31->_gridCollisionVelocity,tmpVec); local_b48 = local_b48 + local_b48; tmpVec = Vector::operator_mul(&local_ed0,&local_b48,tmpVec); tmpVec = Vector::__sub(&pEVar31->_gridCollisionVelocity,&local_ed8,tmpVec); Vector::operator_assign(&pEVar31->_velocity,tmpVec); } } local_b3c = 1.4013e-44; FUN_007dd490(); FUN_007dc740(); LAB_0079ba07: SetMinDamageCooldown(pEVar31); if ((local_a00 != (Entity_Player *)0x251) || (pEVar31->_marsUnkBool == 0)) goto LAB_0079ba25; } Entity::AddEntityFlags((Entity *)pEVar31,0x4000000); pEVar22 = (Entity_Tear *)&pEVar31->_temporaryeffects; } if (0 < pEVar31->_ponyCharge) { pEVar31->_ponyCharge = pEVar31->_ponyCharge + -1; } bVar3 = HasCollectible(pEVar31,0x251,0); if (((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)pEVar31,0x4000), bVar3 == 0)) && (-1 < pEVar31->_marsCooldown)) { bVar3 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)pEVar22,0x251); if (bVar3 == 0) { if (pEVar31->_marsUnkBool == 0) { pEVar31->_marsUnkBool = 1; Entity::ClearEntityFlags((Entity *)pEVar31,0x1000000000); SetMinDamageCooldown(pEVar31); } pEVar31->_marsUnk2 = -1; } iVar5 = 1; bVar3 = HasCollectible(pEVar31,0x82,0); if ((bVar3 != 0) || (bVar3 = HasCollectible(pEVar31,0xb5,0), bVar3 != 0)) { iVar5 = 2; } local_b38 = -NAN; local_c2c = (float)(pEVar31->_marsCooldown - iVar5); piVar19 = (int *)std::max(); iVar5 = *piVar19; pEVar31->_marsCooldown = iVar5; if (iVar5 == -1) { play_sound_with_fart_seed(0xab,1.0,2,0,0.8); BVar43 = (BitSet128)ZEXT816(0x3f000000); pcVar1 = *(code **)(*(int *)pEVar31 + 0x3c); Color::Color(); (*pcVar1)(); itemConfig = Isaac::GetItemConfig(); bVar3 = 0; configItem = Config::GetNullItem(itemConfig,0x3a); AddCostume(pEVar31,configItem,bVar3); } } bVar3 = HasCollectible(pEVar31,0x238,0); if (((bVar3 != 0) && (bVar3 = Entity::HasEntityFlags((Entity *)pEVar31,0x4000), bVar3 == 0)) && (-1 < *(int *)&pEVar31->field_0x1f9c)) { local_c24 = (float)(*(int *)&pEVar31->field_0x1f9c + -1); local_c28 = -NAN; piVar19 = (int *)std::max(); iVar5 = *piVar19; *(int *)&pEVar31->field_0x1f9c = iVar5; if (iVar5 == -1) { play_sound_with_fart_seed(0xab,1.0,2,0,0.8); BVar43 = (BitSet128)ZEXT816(0x3f000000); pcVar1 = *(code **)(*(int *)pEVar31 + 0x3c); Color::Color(); (*pcVar1)(); } } bVar3 = Entity::HasEntityFlags((Entity *)pEVar31,0x4000); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar31,0x297,0); if (bVar3 == 0) { if (0 < *(int *)&pEVar31->field_0x1ea4) { *(undefined4 *)&pEVar31->field_0x1ea4 = 0; bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x3b); if (bVar3 != 0) { TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x3b,1); auVar39 = ZEXT812(0x3f000000); goto LAB_0079bc57; } } } else { iVar5 = *(int *)&pEVar31->field_0x1ea4 + 1; *(int *)&pEVar31->field_0x1ea4 = iVar5; if (((iVar5 == 0x69) || (iVar5 == 0x78)) || (iVar5 == 0x87)) { local_a1c = (Entity_Familiar *)(9 - iVar5 / 0xf); if (((uint)local_a1c & 1) == 0) { fVar15 = 1.7; } else { fVar15 = 1.4; } SoundEffects::PlayWithFartOverride(0x1d5,0.8 - (float)(int)local_a1c * 0.2,1,0,fVar15); auVar39._4_8_ = SUB128(ZEXT812(0x3f800000),4); auVar39._0_4_ = SUB124(ZEXT812(0x3f800000),0) - (float)(int)local_a1c * 0.3; LAB_0079bc57: BVar43._h._4_4_ = 0; BVar43._0_12_ = auVar39; pcVar1 = *(code **)(*(int *)pEVar31 + 0x3c); Color::Color(); (*pcVar1)(); } else if (iVar5 == 0x96) { bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x3b); if (bVar3 == 0) { TemporaryEffects::AddNullEffect(&pEVar31->_temporaryeffects,0x3b,1,1); BVar43 = (BitSet128)ZEXT816(0x3f000000); pcVar1 = *(code **)(*(int *)pEVar31 + 0x3c); Color::Color(); (*pcVar1)(); play_sound_with_fart_seed(0xcd,1.0,2,0,1.0); } } else if (0xb3 < iVar5) { TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x3b,1); BVar43 = (BitSet128)ZEXT816(0x3f000000); pcVar1 = *(code **)(*(int *)pEVar31 + 0x3c); Color::Color(); (*pcVar1)(); *(undefined4 *)&pEVar31->field_0x1ea4 = 0; } } } pvVar36 = TemporaryEffects::GetNullEffect(&pEVar31->_temporaryeffects,0x3e); if ((pvVar36 != (void *)0x0) && (uVar30 = *(uint *)((int)pvVar36 + 8), (int)uVar30 < 0x5a)) { if ((int)uVar30 < 0x20) { uVar30 = uVar30 & 0x80000007; if ((int)uVar30 < 0) { uVar30 = (uVar30 - 1 | 0xfffffff8) + 1; } } else { uVar30 = uVar30 & 0x8000000f; if ((int)uVar30 < 0) { uVar30 = (uVar30 - 1 | 0xfffffff0) + 1; } uVar30 = (int)uVar30 / 2; } bVar3 = IsNullItemCostumeVisible(pEVar31,0x3e,-1); if ((int)uVar30 < 4) { if (bVar3 != 0) { itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x3e); RemoveCostume(pEVar31,configItem); } } else if (bVar3 == 0) { itemConfig = Isaac::GetItemConfig(); bVar3 = 0; configItem = Config::GetNullItem(itemConfig,0x3e); AddCostume(pEVar31,configItem,bVar3); } } bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x42); if (bVar3 != 0) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { FUN_00417920(); pEVar32 = (Entity_Player *)FUN_0090b0e0(); if (pEVar32 != pEVar31) goto LAB_0079bd65; } Game::Darken(g_game); } LAB_0079bd65: bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x45); if (((bVar3 != 0) && (*(int *)&pEVar31->field_0x1ed8 < 0)) && (bVar3 = CanPickupItem(pEVar31), bVar3 != 0)) { FlushQueueItem(pEVar31); TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x45,1); Game::GetItemPool(g_game); pRVar14 = (RNG *)FUN_005cbd00(); uVar30 = RNG::Next(pRVar14); iVar5 = ItemPool::GetPill(uVar30); *(int *)&pEVar31->field_0x1ed8 = iVar5; AnimatePill(pEVar31,iVar5,(byte *)"UseItem"); play_sound_with_fart_seed(0xfc,1.0,2,0,1.0); } bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x7a); if (((bVar3 != 0) && (bVar3 = CanPickupItem(pEVar31), bVar3 != 0)) && (bVar3 = IsHoldingItem(pEVar31), bVar3 == 0)) { FlushQueueItem(pEVar31); TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x7a,1); pRVar14 = (RNG *)FUN_005cbd00(); local_a1c = (Entity_Familiar *)pRVar14; FUN_00424510(); local_14 = 2.10195e-44; bVar3 = Game::IsGreedMode(g_game); if (bVar3 == 0) { WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0,100,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,1,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,2,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,3,10,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,4,10,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,5,2,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x1a,2,0); iVar5 = 0xc; } else { WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x10,100,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x12,0x32,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x11,0x1e,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x13,10,0); WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x14,10,0); iVar5 = 0x1a; } iVar28 = 0; uVar47 = 2; uVar48 = 0x79bf5d; WeightedOutcomePicker::AddOutcomeWeight(poolPicker,iVar5,2,0); uVar7 = 0x23; uVar30 = RNG::Next(pRVar14); RNG::game_constructor((RNG *)(aCStackY_2e04[0x81]._colorize + 3),uVar30,uVar7); rng._shift1 = iVar5; rng._seed = uVar48; rng._shift2 = uVar47; rng._shift3 = iVar28; uVar30 = WeightedOutcomePicker::PickOutcome(poolPicker,rng); Isaac::GetItemConfig(); FUN_00730de0(); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar7 = RNG::Next((RNG *)local_a1c); local_a1c = (Entity_Familiar *)ItemPool::GetCollectible(itemPool,uVar30,uVar7,0,8,0); Isaac::GetItemConfig(); FUN_00730e20(); pEVar31 = local_a24; pEVar8 = (Entity *)AddItemWisp(); fVar35 = (float10)Entity::HitPoints(pEVar8); Entity::SetField380(pEVar8,(float)(fVar35 * (float10)4.0)); itemConfig = Isaac::GetItemConfig(); pEVar23 = local_a1c; local_a1c = (Entity_Familiar *)ItemConfig::GetCollectible(itemConfig,(int)local_a1c); if (local_a1c != (Entity_Familiar *)0x0) { hud = (HUD *)Game::GetHUD(g_game); HUD::ShowItemText(hud,pEVar31,(ItemConfig_Item *)local_a1c); } AnimateCollectible(pEVar31,(int)pEVar23,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); SoundEffects::PlayWithFartOverride(0x13c,1.0,2,0,1.0); local_14 = -NAN; std::vector::_Tidy(); } if (-1 < *(int *)&pEVar31->field_0x1ed8) { FUN_00420ae0(); cVar4 = FUN_0082ee30(); if (((cVar4 == '\0') && (bVar3 = AreControlsEnabled(pEVar31), bVar3 != 0)) && (bVar3 = ANM2::IsPlaying(&pEVar31->_bodySprite,(byte *)"UseItem"), bVar3 == 0)) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&local_cd4,3,-1,-1,1,0); local_14 = 2.24208e-44; uVar30 = 0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); local_a1c = (Entity_Familiar *)*puVar12; pEVar32 = (Entity_Player *)Entity_Familiar::Player(local_a1c); if (pEVar32 == pEVar31) { Entity_Familiar::farting_baby_fart(local_a1c); } uVar30 = uVar30 + 1; uVar7 = EntityList::Size(); } while (uVar30 < uVar7); } persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::IncreaseEventCounter(persistentData,6,1); persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::AddToCollection(persistentData,0x2b); uVar30 = *(uint *)&pEVar31->field_0x1ed8; itemPool = (ItemPool *)Game::GetItemPool(g_game); ItemPool::GetPillEffect(itemPool,uVar30,pEVar31); UsePill(); if (pEVar31->_cacheFlags != 0) { InvalidateCoPlayerItems(pEVar31); EvaluateItems(); } *(undefined4 *)&pEVar31->field_0x1ed8 = 0xffffffff; local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_cd4); } } bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x46); if ((bVar3 != 0) && (bVar3 = IsExtraAnimationFinished(pEVar31), bVar3 != 0)) { TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x46,1); } bVar3 = HasCollectible(pEVar31,0x287,0); if (bVar3 != 0) { if (*(int *)&pEVar31->field_0x1ec8 < 1) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { Level::GetCurrentRoom((Level *)g_game); FUN_00428a60(); FUN_007537b0(); } else { BVar43 = (BitSet128) ZEXT416((uint)(float)((double)*(int *)&pEVar31->field_0x16b8 + __uint_to_double_fixup [-(*(int *)&pEVar31->field_0x16b8 >> 0x1f)])); } local_a04 = (Entity_NPC *)BVar43._l; if (0.0 < (float)local_a04) { FUN_007d3560(); chargeLeft = (float)BVar43._l * (float)local_a04; pAVar33 = pEVar31->_activeDesc; local_a00 = (Entity_Player *)0x0; do { BVar43 = (BitSet128)ZEXT416((uint)chargeLeft); if (chargeLeft <= 0.0) break; if (pAVar33->_item != 0) { itemConfig = Isaac::GetItemConfig(); ItemConfig::GetCollectible(itemConfig,pAVar33->_item); local_a04 = (Entity_NPC *)GetActiveMaxCharge(pEVar31,(int)local_a00); iVar5 = GetActiveMaxCharge(pEVar31,(int)local_a00); if ((iVar5 == 0) && ((pAVar33->_charge < (int)local_a04 || ((bVar3 = HasCollectible(pEVar31,0x3f,0), bVar3 != 0 && (pAVar33->_batteryCharge < (int)local_a04)))))) { local_b84 = 1.0 - (float)pAVar33->_partialCharge; local_c18 = 0.0; std::max(); pfVar21 = (float *)std::min(); chargeLeft = chargeLeft - *pfVar21; BVar43 = (BitSet128)ZEXT416((uint)chargeLeft); pAVar33->_partialCharge = (int)(*pfVar21 + (float)pAVar33->_partialCharge); } } local_a00 = (Entity_Player *)&local_a00->field_0x1; pAVar33 = pAVar33 + 1; } while (local_a00 < &DAT_00000004); } } else { iVar5 = Entity::GetHitPointsLost((Entity *)pEVar31); local_c20 = (float)(*(int *)&pEVar31->field_0x1ec8 - iVar5); local_c1c = 0.0; puVar12 = (undefined4 *)std::max(); *(undefined4 *)&pEVar31->field_0x1ec8 = *puVar12; } } bVar3 = HasCollectible(pEVar31,0x2c0,0); if (((bVar3 != 0) || (pEVar31->_playerType == 0x1b)) && (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x2c0), bVar3 == 0) ) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { Level::GetCurrentRoom((Level *)g_game); FUN_00428a60(); FUN_007537b0(); } else { BVar43 = (BitSet128) ZEXT416((uint)(float)((double)*(int *)&pEVar31->field_0x16b8 + __uint_to_double_fixup [-(*(int *)&pEVar31->field_0x16b8 >> 0x1f)])); } local_a04 = (Entity_NPC *)BVar43._l; if (0.0 < (float)local_a04) { itemConfig = Isaac::GetItemConfig(); ItemConfig::GetCollectible(itemConfig,0x2c0); FUN_007d3560(); BVar43._l._0_4_ = (float)BVar43._l * (float)local_a04 * 50000.0; iVar5 = (int)(float)BVar43._l; if (pEVar31->_playerType == 0x1b) { add_samson_berserk_charge(pEVar31); } local_a08 = (Entity_Player *)pEVar31->_activeDesc; local_a04 = (Entity_NPC *)0x0; do { if (iVar5 < 1) break; if (*(int *)&local_a08->field_0x0 == 0x2c0) { iVar28 = AddActiveCharge(pEVar31,iVar5,(int)local_a04,0,0,1); iVar5 = iVar5 - iVar28; } local_a04 = (Entity_NPC *)((int)&((Vector *)local_a04)->x + 1); local_a08 = (Entity_Player *)((int)local_a08 + 0x20); } while (local_a04 < (Vector *)&DAT_00000004); } } if (pEVar31->_playerType == 0x19) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { Level::GetCurrentRoom((Level *)g_game); FUN_00428a60(); FUN_007537b0(); } else { BVar43 = (BitSet128) ZEXT416((uint)(float)((double)*(int *)&pEVar31->field_0x16b8 + __uint_to_double_fixup [-(*(int *)&pEVar31->field_0x16b8 >> 0x1f)])); } local_a04 = (Entity_NPC *)BVar43._l; if (0.0 < (float)local_a04) { FUN_007d3560(); fVar15 = (float)BVar43._l * (float)local_a04 * 1.5 + *(float *)&pEVar31->field_0x1f74; *(float *)&pEVar31->field_0x1f74 = fVar15; if (1.0 <= fVar15) { pEVar23 = (Entity_Familiar *)(int)fVar15; *(float *)&pEVar31->field_0x1f74 = fVar15 - (float)(int)pEVar23; local_a1c = pEVar23; if (0 < (int)pEVar23) { local_a04 = (Entity_NPC *)&pEVar31->_pos; do { uVar30 = Random(); tmpVec = (Vector *)FUN_0058e240(); pEVar8 = Game::Spawn(g_game,5,0x2a,(Vector *)local_a04,tmpVec,(Entity *)0x0,0,uVar30); (**(code **)(*(int *)pEVar8 + 0xc))(); pEVar23 = (Entity_Familiar *)((int)&pEVar23[-1]._wispCollectibleType + 3); } while (pEVar23 != (Entity_Familiar *)0x0); pEVar31 = local_a24; } uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x22,&pEVar31->_pos,&g_vectorZero,(Entity *)0x0,10,uVar30); pcVar1 = *(code **)(*(int *)pEVar8 + 0x3c); Color::Color(local_7fc); (*pcVar1)(); local_c14 = 0.5; tmpVec = Vector::__mul(&g_vectorOne,local_ef0,&local_c14); Entity::SetSpriteScale(pEVar8,tmpVec); fVar15 = random_float(); pEVar31 = local_a24; BVar43._l._0_4_ = fVar15 * 0.2 + 1.8; BVar43._4_12_ = extraout_var_05; play_sound_with_fart_seed(0x25,0.8,2,0,(float)BVar43._l); } } } bVar3 = HasCollectible(pEVar31,0x2d5,0); if (bVar3 != 0) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { Level::GetCurrentRoom((Level *)g_game); FUN_00428a60(); FUN_007537b0(); local_a04 = (Entity_NPC *)BVar43._l; } else { local_a04 = (Entity_NPC *) (float)((double)*(int *)&pEVar31->field_0x16b8 + __uint_to_double_fixup[-(*(int *)&pEVar31->field_0x16b8 >> 0x1f)]); } if (0.0 < (float)local_a04) { FUN_007d3560(); FUN_007d9360(); } } fVar15 = pEVar31->_ibsCharge; BVar44 = (BitSet128)ZEXT416((uint)fVar15); if (fVar15 < 0.0) { local_bb0 = fVar15 + 0.016666668; BVar44 = (BitSet128)ZEXT416((uint)local_bb0); local_c10 = 0.0; pfVar21 = (float *)std::min(); pEVar31->_ibsCharge = *pfVar21; } tempEffects = &pEVar31->_temporaryeffects; local_a04 = (Entity_NPC *)TemporaryEffects::GetCollectibleEffectNum(tempEffects,699); room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar5 = Room::GetFrameCount(room); if ((iVar5 == 3) || (local_a04 == (Entity_NPC *)&DAT_00000005)) { bVar3 = HasCollectible(pEVar31,699,0); if (bVar3 == 0) { TemporaryEffects::RemoveCollectibleEffect(tempEffects,699,-1); itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,699); RemoveCostume(pEVar31,configItem); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x60); RemoveCostume(pEVar31,configItem); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x61); RemoveCostume(pEVar31,configItem); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x62); RemoveCostume(pEVar31,configItem); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,99); RemoveCostume(pEVar31,configItem); } else { room = (Room *)Level::GetCurrentRoom((Level *)g_game); local_a0d = Room::IsClear(room); Level::GetCurrentRoom((Level *)g_game); iVar5 = GridEntity::GetVariant(); if (iVar5 == 0xb) { LAB_0079c87f: Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::IsAmbushDone(); } else { Level::GetCurrentRoom((Level *)g_game); iVar5 = GridEntity::GetVariant(); if (iVar5 == 0x11) goto LAB_0079c87f; bVar3 = local_a0d; } if ((bVar3 == 0) && ((local_a04 == (Entity_NPC *)&DAT_00000004 || (local_a04 == (Entity_NPC *)&DAT_00000005)))) { TemporaryEffects::AddCollectibleEffect(tempEffects,699,0,6 - (int)local_a04); Isaac::Random(2); GetTearHitParams(); Isaac::GetAxisAlignedUnitVectorFromDir(&rageDir,pEVar31->_headDirection); bVar3 = Vector::operator_ne(&pEVar31->_aimDirection,&g_vectorZero); if (bVar3 != 0) { Vector::operator_assign(&rageDir,&pEVar31->_aimDirection); } local_a1c = (Entity_Familiar *)Vector::GetAngleDegrees(&rageDir); bVar3 = 0; pEVar32 = pEVar31; tmpVec = Vector::Vector(&local_ef8,0.0,-30.0); laser = Entity_Laser::ShootAngle (0xb,&pEVar31->_pos,(float)local_a1c,0x5a,tmpVec,(Entity *)pEVar32,bVar3); (**(code **)(*(int *)laser + 0x40))(); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1f00,(Entity *)laser); pBVar10 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,&local_13c0); pBVar10 = BitSet128::operator_and(&local_13d0,local_888,pBVar10); BVar44 = *pBVar10; FUN_00456830(); (**(code **)(*(int *)laser + 0x3c))(); (**(code **)(*(int *)laser + 0xc))(); itemConfig = Isaac::GetItemConfig(); bVar3 = 0; configItem = Config::GetNullItem(itemConfig,99); AddCostume(pEVar31,configItem,bVar3); std::string::string_from_cstr(local_d8,(byte *)"HeadDownShoot"); local_14 = 2.38221e-44; std::string::string_from_cstr(local_c0,(byte *)"HeadRightShoot"); local_14._0_1_ = 0x12; std::string::string_from_cstr(local_a8,(byte *)"HeadUpShoot"); local_14._0_1_ = 0x13; std::string::string_from_cstr(local_90,(byte *)"HeadLeftShoot"); local_14._0_1_ = 0x14; direction.y = rageDir.y; direction.x = rageDir.x; animName = string_from_direction(local_1c8,direction,local_90,local_a8,local_c0,local_d8); local_14 = (float)CONCAT31(local_14._1_3_,0x15); play_null_costume_anim(pEVar31,99,0,animName,-1,0); std::string::_Tidy_deallocate(local_1c8); std::string::_Tidy_deallocate(local_90); std::string::_Tidy_deallocate(local_a8); std::string::_Tidy_deallocate(local_c0); local_14 = -NAN; std::string::_Tidy_deallocate(local_d8); } } } bVar3 = HasCollectible(pEVar31,0x26b,0); if (bVar3 != 0) { if (pEVar31->_playerType == 5) { cVar4 = IsCoopGhost(pEVar31); if (((cVar4 == '\0') && (bVar3 = HasCollectible(pEVar31,0x75,0), bVar3 != 0)) && (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x75), bVar3 == 0)) { TemporaryEffects::AddCollectibleEffect(&pEVar31->_temporaryeffects,0x75,1,1); itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x75); RemoveCostume(pEVar31,configItem); } } else if (pEVar31->_playerType == 0x21) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); local_a1c = (Entity_Familiar *)&pEVar31->_pos; EntityList::QueryRadius(entityList,&local_ce4,(Vector *)local_a1c,80.0,0x10); local_14 = 3.08286e-44; iVar5 = EntityList::Size(); if (iVar5 != 0) { uVar30 = 0; do { std::vector::operator_index(); pickup = (Entity_Pickup *)FUN_00435e30(); if (((pickup != (Entity_Pickup *)0x0) && (bVar3 = Entity::IsType((Entity *)pickup,5,0x14,-1), bVar3 != 0)) && ((iVar5 = Entity_Pickup::Timeout(pickup), 0 < iVar5 && (cVar4 = Entity::IsDead((Entity *)pickup), cVar4 == '\0')))) { tmpVec = Entity::Position((Entity *)pickup,&local_f00); Vector::__sub((Vector *)local_a1c,&local_c74,tmpVec); local_a04 = (Entity_NPC *)Vector::LengthSquared(&local_c74); BVar44 = (BitSet128)ZEXT416(local_a04); if (16.0 < (float)local_a04) { tmpVec = Vector::Resized(&local_c74,&local_f08,10.0); Entity::SetVelocity((Entity *)pickup,tmpVec); FUN_0044bfa0(); } } uVar30 = uVar30 + 1; uVar7 = EntityList::Size(); } while (uVar30 < uVar7); pEVar31 = local_a24; } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_ce4); } } bVar3 = HasCollectible(pEVar31,0x75,0); if ((((bVar3 != 0) && ((pEVar31->_playerType == 10 || (pEVar31->_playerType == 0x1f)))) && (cVar4 = IsCoopGhost(pEVar31), cVar4 == '\0')) && (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x75), bVar3 == 0)) { TemporaryEffects::AddCollectibleEffect(&pEVar31->_temporaryeffects,0x75,1,1); } pvVar36 = TemporaryEffects::GetCollectibleEffect(&pEVar31->_temporaryeffects,0x2c9); if (pvVar36 != (void *)0x0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&local_cf4,3,0xee,-1,1,0); local_14 = 3.22299e-44; local_a04 = (Entity_NPC *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar23 = (Entity_Familiar *)*puVar12; pEVar32 = (Entity_Player *)Entity_Familiar::Player(pEVar23); if (((pEVar32 == pEVar31) && (iVar5 = FUN_0060d110(), iVar5 == 0)) && (iVar5 = Entity::SubType((Entity *)pEVar23), iVar5 != 7)) { FUN_00436200(); bVar3 = HasCollectible(pEVar31,0x248,0); if (bVar3 != 0) { AddWisp(pEVar31,0x2c9,&pEVar31->_pos,0,0); } goto LAB_0079ce72; } puVar26 = &local_a04->field_0x1; local_a04 = (Entity_NPC *)puVar26; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar26 < puVar13); } TemporaryEffects::RemoveCollectibleEffect(&pEVar31->_temporaryeffects,0x2c9,-1); LAB_0079ce72: local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_cf4); } bVar3 = HasCollectible(pEVar31,0x27a,0); if ((bVar3 != 0) && (bVar3 = Entity::IsFrame((Entity *)pEVar31,0x1e,0), bVar3 != 0)) { room = (Room *)Level::GetCurrentRoom((Level *)g_game); bVar3 = Room::IsClear(room); if (bVar3 != 0) { Game::GetAmbush(g_game); cVar4 = FUN_005cd630(); if (cVar4 == '\0') goto LAB_0079cfcb; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&local_d04,1000,0xbd,0,0,0); local_14 = 3.36312e-44; uVar30 = 0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar32 = (Entity_Player *)Entity::SpawnerEntity((Entity *)*puVar12); if (pEVar32 == pEVar31) goto LAB_0079cfb9; uVar30 = uVar30 + 1; uVar7 = EntityList::Size(); } while (uVar30 < uVar7); } room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::get_random_pickup_position(room,&local_d7c,1,0); pRVar14 = (RNG *)FUN_005cbd00(); uVar30 = RNG::Next(pRVar14); pEVar8 = Game::Spawn(g_game,1000,0xbd,&local_d7c,&g_vectorZero,(Entity *)pEVar31,0,uVar30); (**(code **)(*(int *)pEVar8 + 0xc))(); LAB_0079cfb9: local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_d04); } LAB_0079cfcb: bVar3 = HasCollectible(pEVar31,0x114,0); if (bVar3 != 0) { Level::GetCurrentRoom((Level *)g_game); pEVar6 = (EntityList_EL *)Room::GetEntities(); EntityList_EL::constructor(&local_c84,pEVar6); local_14 = 3.50325e-44; local_a08 = (Entity_Player *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { std::vector::operator_index(); local_a04 = (Entity_NPC *)FUN_004aad40(); puVar12 = (undefined4 *)std::vector::operator_index(); pEVar8 = (Entity *)Entity::to_npc_or_coop_player((Entity *)*puVar12); pEVar25 = local_a04; if (local_a04 == (Entity_NPC *)0x0) { if (pEVar8 != (Entity *)0x0) { FUN_00417340(); BVar44._l._0_4_ = (float)BVar44._l + pEVar31->_size + 8.0; pushRadius = (float)BVar44._l; iVar5 = Entity::EntityCollisionClass(pEVar8); if (iVar5 != 0) { tmpVec = Entity::Position(pEVar8,&local_f28); BVar44 = (BitSet128)ZEXT416((uint)(tmpVec->x - (pEVar31->_pos).x)); FUN_0041d510(); if ((float)BVar44._l < pushRadius) { tmpVec = Entity::Position(pEVar8,&local_f30); BVar44 = (BitSet128)ZEXT416((uint)(tmpVec->y - (pEVar31->_pos).y)); FUN_0041d510(); if ((float)BVar44._l < pushRadius) { tmpVec = Entity::Position(pEVar8,&local_f38); Vector::__sub(tmpVec,&pushDir,&pEVar31->_pos); local_a1c = (Entity_Familiar *)Vector::Length(&pushDir); BVar44 = (BitSet128)ZEXT416((uint)pushRadius); if (((float)local_a1c < pushRadius) && (0.0 < (float)local_a1c)) { Vector::__div_assign(&pushDir,&pushRadius); tmpVec = Entity::Velocity(pEVar8,&local_f40); local_a1c = (Entity_Familiar *)Vector::Dot(tmpVec,&pushDir); BVar44 = (BitSet128)ZEXT416(local_a1c); if ((float)local_a1c < 0.0) { BVar44._l._0_4_ = -(float)local_a1c; BVar44._l._4_4_ = 0x80000000; BVar44._h._0_4_ = 0x80000000; BVar44._h._4_4_ = 0x80000000; bVar3 = 0; local_c0c = (float)BVar44._l; tmpVec = Vector::operator_mul(&local_f48,&local_c0c,&pushDir); Entity::AddVelocity_divided(pEVar8,tmpVec,bVar3); } } } } } } } else { FUN_00417340(); local_a34 = (Entity_Tear *)((float)BVar44._l + pEVar31->_size + 20.0); fVar35 = (float10)Entity_Tear::Height((Entity_Tear *)pEVar25); local_a1c = (Entity_Familiar *)(float)fVar35; BVar44 = (BitSet128)ZEXT416(local_a1c); if (-90.0 < (float)local_a1c) { tmpVec = Entity::Position((Entity *)pEVar25,&local_f10); BVar44 = (BitSet128)ZEXT416((uint)(tmpVec->x - (pEVar31->_pos).x)); FUN_0041d510(); if ((float)BVar44._l < (float)local_a34) { tmpVec = Entity::Position((Entity *)pEVar25,&local_f18); BVar44 = (BitSet128)ZEXT416((uint)(tmpVec->y - (pEVar31->_pos).y)); FUN_0041d510(); if ((float)BVar44._l < (float)local_a34) { tmpVec = Entity::Position((Entity *)pEVar25,&local_f20); local_a1c = (Entity_Familiar *)Vector::Distance(tmpVec,&pEVar31->_pos); BVar44 = (BitSet128)ZEXT416(local_a34); if ((float)local_a1c < (float)local_a34) { Entity::Die((Entity *)pEVar25); } } } } } pAVar33 = (ActiveItemDesc *)((int)&local_a08->field_0x0 + 1); local_a08 = (Entity_Player *)pAVar33; puVar13 = (undefined1 *)EntityList::Size(); } while (pAVar33 < puVar13); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_c84); } bVar3 = HasTrinket(pEVar31,0x7d,0); if (bVar3 != 0) { Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&local_c3c,3,-1,-1,0,0); local_14 = 3.64338e-44; FUN_00424510(); local_14 = (float)CONCAT31(local_14._1_3_,0x1b); Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { EntityList::Size(); Game::GetNumPlayers(g_game); FUN_0042c820(); fVar15 = 0.0; local_a04 = (Entity_NPC *)0x0; iVar5 = Game::GetNumPlayers(g_game); if (iVar5 != 0) { do { pEVar32 = Game::GetPlayer(g_game,(uint)fVar15); if (((pEVar32 != pEVar31) && (cVar4 = Entity::IsDead((Entity *)pEVar32), cVar4 == '\0')) && (cVar4 = Entity::Visible((Entity *)pEVar32), cVar4 != '\0')) { local_c08 = pEVar32; std::vector::push_back(); } fVar15 = (float)((int)local_a04 + 1); local_a04 = (Entity_NPC *)fVar15; fVar24 = (float)Game::GetNumPlayers(g_game); } while ((uint)fVar15 < (uint)fVar24); } } else { EntityList::Size(); FUN_0042c820(); } local_a04 = (Entity_NPC *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { std::vector::operator_index(); pEVar8 = (Entity *)FUN_00435de0(); if (((pEVar8 != (Entity *)0x0) && (cVar4 = FUN_00753d20(), cVar4 == '\0')) && (cVar4 = Entity::Visible(pEVar8), cVar4 != '\0')) { Game::GetField26614(g_game); cVar4 = FUN_00429550(); if ((cVar4 == '\0') || (bVar3 = Entity::IsDescendantOf(pEVar8,(Entity *)pEVar31), bVar3 != 0)) { local_c04 = pEVar8; std::vector::push_back(); } } puVar26 = &local_a04->field_0x1; local_a04 = (Entity_NPC *)puVar26; puVar13 = (undefined1 *)EntityList::Size(); } while (puVar26 < puVar13); } iVar5 = std::vector::size(cordEntities); if (iVar5 != 0) { iVar5 = 2; iVar28 = std::vector::size(cordEntities); if (iVar28 == 1) { iVar5 = 0x3c; } else { iVar28 = std::vector::size(cordEntities); if (iVar28 == 2) { iVar5 = 10; } else { uVar30 = std::vector::size(cordEntities); if ((2 < uVar30) && (uVar30 = std::vector::size(cordEntities), uVar30 < 9)) { iVar5 = 4; } } } iVar28 = Game::GetFrameCount(g_game); if (iVar28 % iVar5 == 0) { if (pEVar31->_extensionCordIndex == -1) { LAB_0079d585: iVar5 = std::vector::size(cordEntities); iVar5 = iVar5 + -1; pEVar31->_extensionCordIndex = iVar5; } else { iVar5 = pEVar31->_extensionCordIndex; iVar28 = std::vector::size(cordEntities); if (iVar28 <= iVar5) goto LAB_0079d585; } if (-1 < iVar5) { puVar12 = (undefined4 *)FUN_0042c810(); Entity::Position((Entity *)*puVar12,&cordStart); cordEnd.x = (pEVar31->_pos).x; cordEnd.y = (pEVar31->_pos).y; if (0 < pEVar31->_extensionCordIndex) { puVar12 = (undefined4 *)FUN_0042c810(); tmpVec = Entity::Position((Entity *)*puVar12,&local_f50); Vector::operator_assign(&cordEnd,tmpVec); } local_a1c = (Entity_Familiar *)Vector::DistanceSquared(&cordStart,&cordEnd); if (400.0 < (float)local_a1c) { iVar5 = GetTrinketMultiplier(pEVar31,0x7d); local_a04 = (Entity_NPC *)((float)iVar5 * 6.0); puVar12 = (undefined4 *)FUN_0042c810(); pEVar8 = (Entity *)*puVar12; tmpVec = Vector::Vector(&local_f58,0.0,-20.0); pVVar20 = Vector::__sub(&cordEnd,&local_f60,&cordStart); local_a1c = (Entity_Familiar *)Vector::GetAngleDegrees(pVVar20); laser = Entity_Laser::ShootAngle(2,&cordStart,(float)local_a1c,3,tmpVec,pEVar8,0); FUN_00435cd0(); fVar15 = Vector::Distance(&cordStart,&cordEnd); Entity_Laser::SetMaxDistance(laser,fVar15); (**(code **)(*(int *)laser + 0x40))(); set_field_0x37c(); pcVar1 = *(code **)(*(int *)laser + 0x3c); Color::Color(); (*pcVar1)(); Entity_Laser::set_disable_init_sound(laser); (**(code **)(*(int *)laser + 0xc))(); pEVar31 = local_a24; } piVar19 = &pEVar31->_extensionCordIndex; *piVar19 = *piVar19 + -1; if (*piVar19 < 0) { iVar5 = std::vector::size(cordEntities); pEVar31->_extensionCordIndex = iVar5 + -1; } } } } FID_conflict__Tidy(cordEntities); local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_c3c); } if ((0 < pEVar31->_megaBlastDuration) && (bVar3 = AreControlsEnabled(pEVar31), bVar3 != 0)) { pEVar31->_megaBlastDuration = pEVar31->_megaBlastDuration + -1; Isaac::Random(2); GetTearHitParams(); Isaac::GetAxisAlignedUnitVectorFromDir(&megaBlastDir,pEVar31->_headDirection); bVar3 = Vector::operator_ne(&pEVar31->_aimDirection,&g_vectorZero); if (bVar3 != 0) { Vector::operator_assign(&megaBlastDir,&pEVar31->_aimDirection); } local_a04 = (Entity_NPC *)Vector::GetAngleDegrees(&megaBlastDir); local_a1c = (Entity_Familiar *)&pEVar31->_megaBlastLaser; if ((*(void **)local_a1c == (void *)0x0) && (0xf < pEVar31->_megaBlastDuration)) { iVar5 = 6; bVar3 = HasCollectible(local_a24,0x44,0); if (bVar3 != 0) { iVar5 = 0xf; } tmpVec = Vector::Vector(&local_f68,0.0,-30.0); local_c00 = 0.0; local_bfc = (float)(local_a24->_megaBlastDuration + -0xf); piVar19 = (int *)std::max(); laser = Entity_Laser::ShootAngle (iVar5,&local_a24->_pos,(float)local_a04,*piVar19,tmpVec,(Entity *)local_a24 ,0); pcVar1 = *(code **)(*(int *)laser + 0x40); Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 == '\0') { local_a28 = (Entity_Tear *)0x40a00000; } (*pcVar1)(); room = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::GetFrameCount(room); Entity_Laser::set_disable_init_sound(laser); EntityPtr::SetReference((EntityPtr *)local_a1c,(Entity *)laser); pBVar10 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,&local_13e0); BitSet128::operator_and(&local_13f0,local_300,pBVar10); FUN_00456830(); pEVar31 = local_a24; (**(code **)(*(int *)laser + 0x3c))(); (**(code **)(*(int *)laser + 0xc))(); } pEVar25 = (Entity_NPC *)__RTDynamicCast(); if (pEVar25 != (Entity_NPC *)0x0) { fVar35 = (float10)Entity_Projectile::Damage((Entity_Projectile *)pEVar25); local_a1c = (Entity_Familiar *)(float)fVar35; fVar15 = LerpAngleDeg((float)local_a1c,(float)local_a04,0.3); Entity_NPC::SetAimAngle(pEVar25,fVar15); GetLaserOffset(pEVar31,&local_f70,4,&megaBlastDir); Entity::SetPositionOffset((Entity *)pEVar25,offset); pBVar10 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,&local_1440); BitSet128::operator_and(&local_1400,local_300,pBVar10); FUN_00456830(); (**(code **)(*(int *)pEVar25 + 0x3c))(); iVar5 = Entity::Child((Entity *)pEVar25); if (iVar5 != 0) { piVar19 = (int *)Entity::Child((Entity *)pEVar25); (**(code **)(*piVar19 + 0x3c))(); } if (megaBlastDir.y <= -0.5) { fVar15 = -10.0; } else { fVar15 = 3000.0; } set_field_358(pEVar25,fVar15); } tmpVec = Vector::__unm(&megaBlastDir,&local_f78); bVar3 = 0; local_bf8 = 0.85; tmpVec = Vector::__mul(tmpVec,&local_f80,&local_bf8); Entity::AddVelocity_divided((Entity *)pEVar31,tmpVec,bVar3); pEVar31->_blinkTime = 7; if (pEVar31->_megaBlastDuration < 1) { itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x1f); RemoveCostume(pEVar31,configItem); } } if ((*(int *)&pEVar31->field_0x1f00 != 0) && (bVar3 = AreControlsEnabled(pEVar31), bVar3 != 0)) { Isaac::Random(2); GetTearHitParams(); Isaac::GetAxisAlignedUnitVectorFromDir(&rageLaserDir,pEVar31->_headDirection); bVar3 = Vector::operator_ne(&pEVar31->_aimDirection,&g_vectorZero); if (bVar3 != 0) { Vector::operator_assign(&rageLaserDir,&pEVar31->_aimDirection); } local_a1c = (Entity_Familiar *)Vector::GetAngleDegrees(&rageLaserDir); pEVar25 = (Entity_NPC *)FUN_00435df0(); if (pEVar25 != (Entity_NPC *)0x0) { fVar35 = (float10)Entity_Projectile::Damage((Entity_Projectile *)pEVar25); local_a28 = (Entity_Tear *)(float)fVar35; fVar15 = LerpAngleDeg((float)local_a28,(float)local_a1c,0.3); Entity_NPC::SetAimAngle(pEVar25,fVar15); GetLaserOffset(pEVar31,&local_f88,4,&rageLaserDir); Entity::SetPositionOffset((Entity *)pEVar25,offset_00); pBVar10 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,&local_1410); BitSet128::operator_and(&local_1420,local_8f0,pBVar10); FUN_00456830(); (**(code **)(*(int *)pEVar25 + 0x3c))(); iVar5 = Entity::Child((Entity *)pEVar25); if (iVar5 != 0) { piVar19 = (int *)Entity::Child((Entity *)pEVar25); (**(code **)(*piVar19 + 0x3c))(); } if (rageLaserDir.y <= -0.5) { fVar15 = -10.0; } else { fVar15 = 3000.0; } set_field_358(pEVar25,fVar15); } tmpVec = Vector::__unm(&rageLaserDir,&local_f90); bVar3 = 0; local_bf4 = 0.15; tmpVec = Vector::__mul(tmpVec,&local_f98,&local_bf4); Entity::AddVelocity_divided((Entity *)pEVar31,tmpVec,bVar3); std::string::string_from_cstr(local_138,(byte *)"HeadDownShoot"); local_14 = 3.92364e-44; std::string::string_from_cstr(local_120,(byte *)"HeadRightShoot"); local_14._0_1_ = 0x1d; std::string::string_from_cstr(local_108,(byte *)"HeadUpShoot"); local_14._0_1_ = 0x1e; std::string::string_from_cstr(local_f0,(byte *)"HeadLeftShoot"); local_14._0_1_ = 0x1f; direction_00.y = rageLaserDir.y; direction_00.x = rageLaserDir.x; string_from_direction(local_78 + 0x2c,direction_00,local_f0,local_108,local_120,local_138); std::string::_Tidy_deallocate(local_f0); std::string::_Tidy_deallocate(local_108); std::string::_Tidy_deallocate(local_120); local_14 = (float)CONCAT31(local_14._1_3_,0x24); std::string::_Tidy_deallocate(local_138); play_null_costume_anim(pEVar31,99,0,(std_string *)(local_78 + 0x2c),-2,0); itemConfig = Isaac::GetItemConfig(); Config::GetNullItem(itemConfig,99); iVar5 = get_costume_anim_frame(pEVar31); if (0xf < iVar5) { play_item_costume_anim(pEVar31); } pEVar31->_blinkTime = 7; local_14 = -NAN; std::string::_Tidy_deallocate(local_78 + 0x2c); } iVar5 = TemporaryEffects::GetCollectibleEffectNum(&pEVar31->_temporaryeffects,699); if ((5 < iVar5) && (*(int *)&pEVar31->field_0x1f00 == 0)) { TemporaryEffects::RemoveCollectibleEffect(&pEVar31->_temporaryeffects,699,-1); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,99); RemoveCostume(pEVar31,configItem); itemConfig = Isaac::GetItemConfig(); bVar3 = 0; configItem = ItemConfig::GetCollectible(itemConfig,699); AddCostume(pEVar31,configItem,bVar3); } if ((pEVar31->_montezumaLaser != (void *)0x0) && (bVar3 = AreControlsEnabled(pEVar31), bVar3 != 0) ) { local_a28 = (Entity_Tear *)(pEVar31->_bodyAngle + 180.0); local_a04 = (Entity_NPC *)FUN_00435df0(); if (local_a04 != (Entity_NPC *)0x0) { Vector::FromAngle(&local_fa0,(float)local_a28); fVar35 = (float10)Entity_Projectile::Damage((Entity_Projectile *)local_a04); local_a1c = (Entity_Familiar *)(float)fVar35; fVar15 = LerpAngleDeg((float)local_a1c,(float)local_a28,0.3); Entity_NPC::SetAimAngle(local_a04,fVar15); } } if ((0 < pEVar31->_planCKillCountdown) && (iVar5 = pEVar31->_planCKillCountdown + -1, pEVar31->_planCKillCountdown = iVar5, iVar5 == 0)) { if ((pEVar31->_playerType == 3) && ((bVar3 = HasCollectible(pEVar31,0x26b,0), bVar3 != 0 && (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x1db), bVar3 == 0)))) { TemporaryEffects::AddCollectibleEffect(&pEVar31->_temporaryeffects,0x1db,0,1); } pcVar1 = *(code **)(*(int *)pEVar31 + 0x24); EntityRef::EntityRef(&local_17a0); (*pcVar1)(); *(undefined4 *)&pEVar31->_lastDamageFlags = 0; *(undefined4 *)((int)&pEVar31->_lastDamageFlags + 4) = 0; (pEVar31->_lastDamageSource)._type = 0; (pEVar31->_lastDamageSource)._variant = 0; } bVar3 = HasPlayerForm(pEVar31,0xd); if (bVar3 != 0) { local_a1c = (Entity_Familiar *)Vector::LengthSquared(&pEVar31->_velocity); if (1.0 < (float)local_a1c) { bVar3 = Entity::IsFrame((Entity *)pEVar31,5,0); if (bVar3 != 0) { local_a1c = (Entity_Familiar *)Random(); local_bf0 = 0.7; local_a28 = (Entity_Tear *)Vector::__mul(&pEVar31->_velocity,&local_fa8,&local_bf0); tmpVec = Entity::Position((Entity *)pEVar31,&local_fb0); pVVar20 = MusicManager::RandomVector(&local_fb8); local_bec = random_float(); local_bec = local_bec * 20.0; pVVar20 = Vector::__mul(pVVar20,&local_fc0,&local_bec); tmpVec = Vector::__add(tmpVec,&local_fc8,pVVar20); Game::Spawn(g_game,1000,0x3b,tmpVec,(Vector *)local_a28,(Entity *)0x0,0,(uint)local_a1c); effect = (Entity_Effect *)__RTDynamicCast(); iVar5 = Isaac::Random(2); if (iVar5 == 0) { local_a28 = (Entity_Tear *)0x3f800000; } else { local_a28 = (Entity_Tear *)&DAT_bf800000; } fVar15 = random_float(); Entity_Effect::set_rotation(effect,fVar15 * 5.0 * (float)local_a28); iVar5 = Isaac::Random(0xf); Entity_Effect::SetTimeout(effect,iVar5 + 0xf); (**(code **)(*(int *)effect + 0xc))(); pEVar31 = local_a24; } } } bVar3 = HasCollectible(pEVar31,0x1bf,0); if (bVar3 != 0) { FUN_00428b50(); cVar4 = FUN_0082ee30(); if ((((cVar4 == '\0') && (bVar3 = AreControlsEnabled(pEVar31), bVar3 != 0)) && (pEVar31->_fireBlockCooldown < 1)) && ((*(uint *)&pEVar31->field_0x18f0 % 0xf0 < 2 && (1 < *(uint *)&pEVar31->field_0x18f0)))) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x69,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,0,uVar30) ; bVar3 = HasTrinket(pEVar31,0x86,0); if (bVar3 != 0) { tmpVec = (Vector *)Entity::SpriteScale(pEVar8); local_be8 = 2.0; tmpVec = Vector::operator_mul(&local_fd0,&local_be8,tmpVec); Entity::SetSpriteScale(pEVar8,tmpVec); } (**(code **)(*(int *)pEVar8 + 0xc))(); SoundEffects::PlayWithFartOverride(0x35c,1.0,2,0,1.0); } } Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (((cVar4 != '\0') && (bVar3 = HasCollectible(pEVar31,0x2b5,0), bVar3 != 0)) && (bVar3 = Entity::IsFrame((Entity *)pEVar31,300,0), bVar3 != 0)) { AddSwarmFlyOrbital(); } Game::GetField26614(g_game); cVar4 = FUN_00429550(); if ((((cVar4 != '\0') && (pEVar31->_dead == 0)) && (pEVar31->_variant == 0)) && (cVar4 = IsCoopGhost(pEVar31), cVar4 == '\0')) { local_a28 = (Entity_Tear *)0x4e6e6b28; puVar13 = (undefined1 *)0x0; local_9fc = (Entity_Player *)0x0; local_a04 = (Entity_NPC *)0x0; iVar5 = Game::GetNumPlayers(g_game); if (iVar5 != 0) { do { pEVar32 = Game::GetPlayer(g_game,(uint)puVar13); if (pEVar32 != pEVar31) { bVar3 = HasCollectible(pEVar32,0x2b8,0); if (bVar3 != 0) { tmpVec = Entity::Position((Entity *)pEVar32,&local_fd8); local_a34 = (Entity_Tear *)Vector::DistanceSquared(tmpVec,&pEVar31->_pos); auVar40 = ZEXT416(local_a28); if ((float)local_a34 < (float)local_a28) { FUN_007d4340(); auVar45._4_12_ = auVar40._4_12_; auVar45._0_4_ = auVar40._0_4_ * 70.0 + pEVar31->_size; FUN_006daa90(); if ((double)(float)local_a34 < auVar45._0_8_) { local_a28 = local_a34; local_9fc = pEVar32; } } } } puVar13 = &local_a04->field_0x1; local_a04 = (Entity_NPC *)puVar13; puVar26 = (undefined1 *)Game::GetNumPlayers(g_game); pEVar32 = local_9fc; } while (puVar13 < puVar26); if (local_9fc != (Entity_Player *)0x0) { iVar5 = EntityPtr::Ref(); if (iVar5 == 0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x13,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar32,3, uVar30); Entity::SetTarget(pEVar8,(Entity *)pEVar31); Entity::SetParent(pEVar8,(Entity *)local_9fc); (**(code **)(*(int *)pEVar8 + 0x40))(); (**(code **)(*(int *)pEVar8 + 0xc))(); EntityPtr::Set((EntityPtr *)&pEVar31->field_0x1e84,pEVar8); } iVar5 = EntityPtr::Ref(); if (iVar5 != 0) { effect = (Entity_Effect *)EntityPtr::Ref(); Entity_Effect::set_state(effect,1); } } } } FUN_00863be0(); level = (Level *)Config::GetCollectibles(); cVar4 = Level::GetStateFlag(level); if (cVar4 == '\0') { if (0 < pEVar31->_imExcitedSpeedupCountdown) { iVar5 = pEVar31->_imExcitedSpeedupCountdown + -1; pEVar31->_imExcitedSpeedupCountdown = iVar5; if (iVar5 == (iVar5 / 900) * 900) { Level::GetCurrentRoom((Level *)g_game); Room::SetBrokenWatchState(); TemporaryEffects::AddCollectibleEffect(&pEVar31->_temporaryeffects,0x1c,0,1); } } } else { Level::GetCurrentRoom((Level *)g_game); Room::SetBrokenWatchState(); TemporaryEffects::AddCollectibleEffect(&pEVar31->_temporaryeffects,0x1c,0,1); pEVar31->_imExcitedSpeedupCountdown = 0; } tempEffects = &pEVar31->_temporaryeffects; if ((0 < pEVar31->_rUaWizardTimer) && (iVar5 = pEVar31->_rUaWizardTimer + -1, pEVar31->_rUaWizardTimer = iVar5, iVar5 == 0)) { itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,6); RemoveCostume(pEVar31,configItem); } local_9fc = TemporaryEffects::GetCollectibleEffect(tempEffects,0x20a); if (local_9fc == (void *)0x0) { if (*(int **)&pEVar31->field_0x1440 != (int *)0x0) { (**(code **)(**(int **)&pEVar31->field_0x1440 + 0x28))(); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1440,(Entity *)0x0); } } else { uVar30 = 2; Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (cVar4 != '\0') { uVar30 = 6; } Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QueryRadius(entityList,&local_adc,&pEVar31->_pos,50.0,uVar30); local_14 = 5.1848e-44; local_a34 = (Entity_Tear *)0x0; iVar5 = EntityList::Size(); if (iVar5 != 0) { do { puVar12 = (undefined4 *)std::vector::operator_index(); iVar5 = Entity::Type((Entity *)*puVar12); if (iVar5 == 9) { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar22 = (Entity_Tear *)*puVar12; local_a28 = pEVar22; uVar46 = Entity_Projectile::ProjectileFlags((Entity_Projectile *)pEVar22); if ((uVar46 & 0x80000000) == 0) { fVar35 = (float10)Entity_Tear::Height(pEVar22); local_a1c = (Entity_Familiar *)(float)fVar35; if (-50.0 < (float)local_a1c) { bVar3 = HasCollectible(pEVar31,0x248,0); if (bVar3 == 0) { Entity_Projectile::ProjectileFlags((Entity_Projectile *)pEVar22); Entity_Projectile::set_projectile_flags((Entity_Projectile *)local_a28); pEVar22 = local_a28; FUN_004aad90(); Isaac::Random(0xf); FUN_004aadd0(); tmpVec = Entity::Velocity((Entity *)pEVar22,&local_fe8); Vector::Length(tmpVec); FUN_004aadb0(); Entity::SetTarget((Entity *)pEVar22,(Entity *)0x0); pEVar31 = local_a24; Entity::SetParent((Entity *)pEVar22,(Entity *)local_a24); position.y = g_vectorZero.y; position.x = g_vectorZero.x; Entity::SetTargetPosition((Entity *)pEVar22,position); fVar35 = (float10)Entity_Tear::FallingAcceleration(pEVar22); local_a1c = (Entity_Familiar *)(float)fVar35; if (0.0 < (float)local_a1c) { fVar35 = (float10)Entity_Tear::FallingSpeed(pEVar22); local_a1c = (Entity_Familiar *)(float)fVar35; if (0.0 < (float)local_a1c) { fVar35 = (float10)Entity_Tear::FallingSpeed(pEVar22); local_a1c = (Entity_Familiar *)(float)fVar35; FUN_00444c70(); } } } else { bVar52 = 0; bVar3 = 0; tmpVec = Entity::Position((Entity *)pEVar22,&local_fe0); AddWisp(pEVar31,0x20a,tmpVec,bVar3,bVar52); (**(code **)(*(int *)pEVar22 + 0x28))(); } } } } else { puVar12 = (undefined4 *)std::vector::operator_index(); bVar3 = Entity::IsDescendantOf((Entity *)*puVar12,(Entity *)pEVar31); if (bVar3 == 0) { puVar12 = (undefined4 *)std::vector::operator_index(); bVar3 = Entity::IsTear((Entity *)*puVar12); if (bVar3 != 0) { std::vector::operator_index(); iVar5 = __RTDynamicCast(); if (iVar5 != 0) { puVar12 = (undefined4 *)std::vector::operator_index(); pEVar22 = (Entity_Tear *)*puVar12; fVar35 = (float10)Entity_Tear::Height(pEVar22); local_a1c = (Entity_Familiar *)(float)fVar35; if (-50.0 < (float)local_a1c) { bVar3 = HasCollectible(pEVar31,0x248,0); if (bVar3 == 0) { pBVar10 = BitSet128::operator_or (&local_1430,(BitSet128 *)&DAT_00c346d0, (BitSet128 *)&DAT_00c346b0); Entity_Tear::SetTearFlags(pEVar22,*pBVar10); FUN_00665b30(); Isaac::Random(0xf); FUN_00753740(); tmpVec = Entity::Velocity((Entity *)pEVar22,&local_ff8); local_a1c = (Entity_Familiar *)Vector::Length(tmpVec); FUN_00753730(); Entity::SetTarget((Entity *)pEVar22,(Entity *)0x0); Entity::SetParent((Entity *)pEVar22,(Entity *)pEVar31); Entity::SetSpawnerEntity((Entity *)pEVar22,(Entity *)pEVar31); position_00.y = g_vectorZero.y; position_00.x = g_vectorZero.x; Entity::SetTargetPosition((Entity *)pEVar22,position_00); } else { bVar52 = 0; bVar3 = 0; tmpVec = Entity::Position((Entity *)pEVar22,&local_ff0); AddWisp(pEVar31,0x20a,tmpVec,bVar3,bVar52); (**(code **)(*(int *)pEVar22 + 0x28))(); } } } } } } local_a34 = (Entity_Tear *)&local_a34->field_0x1; pEVar22 = (Entity_Tear *)EntityList::Size(); } while (local_a34 < pEVar22); } effect = *(Entity_Effect **)&pEVar31->field_0x1440; if (effect == (Entity_Effect *)0x0) { uVar30 = Random(); pEVar8 = Game::Spawn(g_game,1000,0x7b,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,1,uVar30) ; Entity::SetParent(pEVar8,(Entity *)pEVar31); EntityPtr::SetReference((EntityPtr *)&pEVar31->field_0x1440,pEVar8); effect = *(Entity_Effect **)&pEVar31->field_0x1440; if (effect != (Entity_Effect *)0x0) goto LAB_0079e9c1; } else { LAB_0079e9c1: Entity_Effect::set_state(effect,(uint)(*(int *)((int)local_9fc + 8) < 0x3c)); } local_14 = -NAN; EntityList_Query::~EntityList_Query(&local_adc); tempEffects = &pEVar31->_temporaryeffects; } if ((0 < pEVar31->_hallowedGroundCountdown) && (iVar5 = pEVar31->_hallowedGroundCountdown + -1, pEVar31->_hallowedGroundCountdown = iVar5, iVar5 < 1)) { AddCacheFlags(pEVar31,99); EvaluateItems(); } bVar3 = Entity::IsFrame((Entity *)pEVar31,3,0); if (bVar3 != 0) { bVar3 = IsHologram(pEVar31); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar31,0xbd,0); if (((((bVar3 == 0) && (bVar3 = IsHeadless(pEVar31), bVar3 == 0)) && (bVar3 = TemporaryEffects::HasCollectibleEffect(tempEffects,0xd6), bVar3 == 0)) && ((bVar3 = HasCollectible(pEVar31,0x281,0), bVar3 == 0 && (iVar5 = pEVar31->_playerType, iVar5 != 0x26)))) && (((iVar5 != 0x1d && (iVar5 != 0x1a)) || (iVar5 = Isaac::Random(4), iVar5 != 0)))) { bVar3 = HasCollectible(pEVar31,0x240,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar31,0x26a,0); if (bVar3 == 0) { bVar3 = HasCollectible(pEVar31,0x2a0,0); if (bVar3 != 0) { iVar5 = 6; goto LAB_0079eac8; } bVar3 = HasCollectible(pEVar31,0x255,0); if (bVar3 != 0) { iVar5 = Isaac::Random(2); if (iVar5 == 0) { fVar15 = random_float(); effect = Entity_NPC::MakeSplat((Entity_NPC *)pEVar31,fVar15 * 0.5 + 0.2); pcVar1 = *(code **)(*(int *)effect + 0x3c); Color::Color(); (*pcVar1)(); pEVar31 = local_a24; } } } else { iVar5 = Isaac::Random(8); if (iVar5 == 0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c8126c) && (_Init_thread_header(), DAT_00c8126c == -1)) { local_14 = 5.46506e-44; Color::Color(); local_14 = -NAN; _Init_thread_footer(); } fVar15 = random_float(); effect = Entity_NPC::MakeSplat((Entity_NPC *)pEVar31,fVar15 * 0.5 + 0.2); (**(code **)(*(int *)effect + 0x3c))(); } } } else { iVar5 = Isaac::Random(4); if (iVar5 == 0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c8123c) && (_Init_thread_header(), DAT_00c8123c == -1)) { local_14 = 5.32493e-44; Color::Color(); local_14 = -NAN; _Init_thread_footer(); } fVar15 = random_float(); effect = Entity_NPC::MakeSplat((Entity_NPC *)pEVar31,fVar15 * 0.5 + 0.2); (**(code **)(*(int *)effect + 0x3c))(); } } } else { iVar5 = 2; LAB_0079eac8: iVar5 = Isaac::Random(iVar5); if (iVar5 == 0) { fVar15 = random_float(); Entity_NPC::MakeSplat((Entity_NPC *)pEVar31,fVar15 * 0.5 + 0.2); } } } } Game::GetField26614(g_game); cVar4 = FUN_00429550(); if (((cVar4 != '\0') && (bVar3 = HasCollectible(pEVar31,0x240,0), bVar3 != 0)) && (iVar5 = Entity::GetIntervalTicks((Entity *)pEVar31,210.0,0.0), iVar5 != 0)) { pRVar14 = GetCollectibleRNG(pEVar31,0x240); uVar30 = RNG::RandomInt(pRVar14,100); if (uVar30 < 0x1e) { uVar30 = 0; } else if (uVar30 < 0x2c) { uVar30 = 1; } else if (uVar30 < 0x3a) { uVar30 = 0xd; } else if (uVar30 < 0x48) { uVar30 = 3; } else { uVar30 = (-(uint)(uVar30 < 0x56) & 0xfffffffe) + 6; } uVar7 = Random(); Game::Spawn(g_game,3,0xc9,&pEVar31->_pos,&g_vectorZero,(Entity *)pEVar31,uVar30,uVar7); } bVar3 = TemporaryEffects::HasNullEffect(&pEVar31->_temporaryeffects,0x32); if (bVar3 != 0) { if (pEVar31->_activeDesc[0]._item == 0x28f) { AddActiveCharge(pEVar31,-1,0,0,0,0); } else { TemporaryEffects::RemoveNullEffect(&pEVar31->_temporaryeffects,0x32,1); } } if ((0 < pEVar31->_grantedCollectibleCountdown) && (iVar5 = pEVar31->_grantedCollectibleCountdown + -1, pEVar31->_grantedCollectibleCountdown = iVar5, iVar5 < 1)) { pEVar31->_grantedCollectibleFlags = 0; AddCacheFlags(pEVar31,99); EvaluateItems(); } bVar3 = Game::IsInTimedSet(g_game,3); if (((bVar3 == 0) && (bVar3 = Game::IsInTimedSet(g_game,6), bVar3 == 0)) && (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x1f1), bVar3 == 0) ) { pvVar36 = TemporaryEffects::GetTrinketEffect(&pEVar31->_temporaryeffects,0x45); if (pvVar36 == (void *)0x0) goto LAB_0079ef52; if (0x1d < *(int *)((int)pvVar36 + 8)) goto LAB_0079ee43; local_a34 = (Entity_Tear *)sinf_wrapper((float)*(int *)((int)pvVar36 + 8) * 0.1); if ((float)local_a34 <= 0.0) goto LAB_0079ef52; } else { LAB_0079ee43: local_a34 = (void *)0x3f800000; } room = (Room *)Level::GetCurrentRoom((Level *)g_game); iVar5 = Room::GetFrameCount(room); if (iVar5 < 2) { fVar15 = 1.0; } else { fVar15 = 0.1; } pCVar16 = Color::Lerp(local_6f4,&pEVar31->_footprintColor2,&pEVar31->_footprintColor1,0.5); Color::Lerp((ColorMod *)local_78,(ColorMod *)&pEVar31->field_0x170c,pCVar16,fVar15); Sprite::Color((Sprite *)&pEVar31->_sprite); fVar35 = (float10)Color::A(); Font::SetLineHeightModifier((Font *)local_78,(float)fVar35); Color::SetTint((Color *)local_78,0.01,0.01,0.01,1.0); Color::operator_assign((Color *)&pEVar31->field_0x170c,(ColorMod *)local_78); pCVar16 = (ColorMod *)local_78; pEVar22 = local_a34; from = (ColorMod *)FUN_00757980(); pCVar16 = Color::Lerp(&local_720,from,pCVar16,(float)pEVar22); Color::operator_assign((Color *)local_78,pCVar16); Sprite::SetColor((Sprite *)&pEVar31->_sprite,(ColorMod *)local_78); LAB_0079ef52: local_a34 = (void *)0x3f800000; layerName = (byte *)0x0; iVar5 = Sprite::GetLayerCount((Sprite *)&pEVar31->_sprite); if (iVar5 != 0) { anm = &pEVar31->_sprite; local_a1c = (Entity_Familiar *)anm; do { layer = Sprite::GetLayer((Sprite *)anm,layerName); layerName = layerName + 1; local_a34 = (Entity_Tear *)((float)local_a34 + (layer->_size).x); pbVar27 = (byte *)Sprite::GetLayerCount((Sprite *)anm); } while (layerName < pbVar27); pEVar31 = local_a24; } iVar5 = Sprite::GetLayerCount((Sprite *)&pEVar31->_sprite); local_a00 = (Entity_Player *) Math::clamp(0.3,1.0,((float)local_a34 / (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)])) * (pEVar31->_playerSpriteScale).x); local_aac = *(void **)((int)pEVar31->_config + 0x48); bVar3 = HasCollectible(pEVar31,0x47,0); if (bVar3 != 0) { local_a00 = (Entity_Player *)((float)local_a00 * 0.75); } bVar3 = HasCollectible(pEVar31,0x256,0); if ((bVar3 != 0) || (bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x2b0), bVar3 != 0) ) { local_a00 = (Entity_Player *)((float)local_a00 * 0.5); local_bcc._0_1_ = 0xc; local_bcc._1_1_ = 0; local_bcc._2_1_ = 0; local_bcc._3_1_ = 0; piVar19 = (int *)std::min(); local_aac = (void *)*piVar19; } bVar3 = TemporaryEffects::HasCollectibleEffect(&pEVar31->_temporaryeffects,0x271); if (bVar3 == 0) { fVar15 = 1.0; } else { local_b80 = (float)local_a00 + (float)local_a00; local_b7c = 2.0; pfVar21 = (float *)std::min(); local_a00 = (Entity_Player *)*pfVar21; shadowScale = 3.0; fVar15 = shadowScale; } if (pEVar31->_isCoopGhost != 0) { shadowScale = fVar15 * 0.5; } bVar3 = Game::IsInTimedSet(g_game,0xe); if (bVar3 != 0) { shadowScale = 0.0; } local_a20 = (pEVar31->_sizeMulti).x; local_a1c = (Entity_Familiar *)(pEVar31->_sizeMulti).y; iVar5 = *(int *)((int)pEVar31->_config + 0x48); entityConfig = (EntityConfig *)FUN_00417910(); entityConfigEntry = EntityConfig::GetEntity(entityConfig,pEVar31->_type,pEVar31->_variant,0); sizeMulti.y = (float)local_a1c; sizeMulti.x = local_a20; Entity::SetSize((Entity *)pEVar31,(float)local_a00 * entityConfigEntry->collisionRadius,sizeMulti, iVar5); pEVar31->_shadowSize = shadowScale * *(float *)((int)pEVar31->_config + 0x24); ExceptionList = local_1c; return; } //@@ 0079f3c0 Entity_Player::update_ladder /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called every Entity_Player update: HasCollectible(60 Ladder), player+0x1424 cached effect ptr, spawns 1000.8 (EffectVariant LADDER) via inlined Game::Spawn, GridEntity_Pit::UpdateCollision, trigger_set_dispatch prototype: db/protos.zhl */ void __thiscall Entity_Player::update_ladder(Entity_Player *this) { code *pcVar1; longlong lVar2; longlong lVar3; longlong lVar4; int *piVar5; byte bVar6; char cVar7; uint uVar8; int *piVar9; int iVar10; uint upGridIdx; GridEntity_Pit *pit; uint uVar11; int unusedArg; void *pvVar12; int *piVar13; int iVar14; PlayerManager *playerManager; Game *game; bool bVar15; float fVar16; float fVar17; float fVar18; ulonglong timeNs; undefined1 auStack_b8 [4]; int *local_b4; void *room; int *local_ac; uint local_a8; Game *local_a4; void *local_a0; char isLadderOwner; int *spawnSubType; Entity *local_94; float local_90; uint local_8c; int *piStack_88; float fStack_84; uint spawnType; Entity_Player *local_7c; int *apiStack_78 [3]; uint spawnVariant; int *local_68; EntityPtr *local_64; int *local_60; int *ladderSlot; int local_58 [3]; int triggerKeyType; int triggerKeyVariant; undefined8 local_40; undefined4 local_38; undefined1 auStack_34 [4]; undefined1 local_30 [8]; int local_28; undefined1 auStack_24 [8]; RNG cardRng; uint local_c; Entity *ladder; Manager *manager; Entity_Player *otherPlayer; EntityPtr *spawnerSlot; local_c = __security_cookie ^ (uint)auStack_b8; local_7c = this; bVar6 = HasCollectible(this,0x3c,0); if ((bVar6 == 0) || (local_7c->_variant != 0)) { local_b4 = *(int **)&local_7c->field_0x1424; isLadderOwner = '\0'; if (local_b4 == (int *)0x0) { return; } } else { local_b4 = *(int **)&local_7c->field_0x1424; isLadderOwner = '\x01'; } piVar9 = local_b4; ladderSlot = (int *)&local_7c->field_0x1424; room = g_game->_room; if (local_b4 != (int *)0x0) goto LAB_0079fa87; local_8c = Random(); local_a4 = g_game; spawnVariant = 8; spawnType = 1000; spawnSubType = piVar9; lua_callback_run_pre_entity_spawn ((int *)&spawnType,(int *)&spawnVariant,&g_vectorZero,&g_vectorZero,(Entity *)0x0, (int *)&spawnSubType,&local_8c); uVar11 = spawnVariant; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0079f708: local_b4 = spawnSubType; } else { local_ac = (g_game->_deathmatchManager)._type; uVar8 = Random(); piVar13 = spawnSubType; piVar9 = local_ac; local_40 = 0x900000005; local_94 = (Entity *)0x7; local_38 = 7; local_a8 = uVar8; if (spawnType != 5) goto LAB_0079f708; if (uVar11 < 0x12d) { if (uVar11 == 300) { while ((local_b4 = spawnSubType, spawnSubType == (int *)0x0 || (cVar7 = (**(code **)(*local_ac + 0x24))(spawnSubType), cVar7 != '\0'))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)local_40 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)local_40 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_94 & 0x1f) ^ uVar8; iVar10 = ItemPool::GetCardEx(uVar8,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = uVar8; spawnSubType = (int *)lua_callback_run_get_card(&cardRng,iVar10,1,1,0); } } else { if (uVar11 == 0x46) { local_68 = (int *)((uint)spawnSubType >> 0xb); do { local_b4 = spawnSubType; if (spawnSubType != (int *)0x0) { pcVar1 = *(code **)(*local_ac + 0x28); iVar10 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)spawnSubType,(Entity_Player *)0x0); cVar7 = (*pcVar1)(iVar10); if (cVar7 == '\0') goto LAB_0079f710; uVar8 = local_a8; } if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)local_40 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)local_40 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)local_94 & 0x1f) ^ uVar8; local_a8 = uVar8; uVar11 = ItemPool::GetPill(uVar8); spawnSubType = (int *)(uVar11 | ((uint)local_68 & 1) << 0xb); } while( true ); } if (uVar11 != 100) goto LAB_0079f708; local_b4 = spawnSubType; if (spawnSubType == (int *)0x19) { LAB_0079f54a: bVar15 = false; } else { local_68 = spawnSubType; std::set::find_node(local_30,&local_68); if (((*(char *)(local_28 + 0xd) == '\0') && (*(int *)(local_28 + 0x10) <= (int)piVar13)) && (local_28 != piVar9[8])) goto LAB_0079f54a; bVar15 = true; } if ((piVar13 == (int *)0x0) || (bVar15)) { local_b4 = (int *)(**(code **)(*piVar9 + 0x84))(0); spawnSubType = local_b4; } } } else { if (uVar11 != 0x15e) goto LAB_0079f708; while ((local_b4 = spawnSubType, spawnSubType == (int *)0x0 || (cVar7 = (**(code **)(*local_ac + 0x2c))(spawnSubType), cVar7 != '\0'))) { spawnSubType = (int *)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } LAB_0079f710: local_94 = EntityFactory::Create(local_a4->_entityFactory,spawnType,0); lVar2 = CONCAT44(local_60,local_a8); if (local_94 != (Entity *)0x0) { timeNs = GetTimeNs(); ladder = local_94; local_a8 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_64 = (EntityPtr *)((ulonglong)lVar2 >> 0x20); local_a0 = (void *)((ulonglong)local_a8 * 0xd7b634db >> 0x20); timeNs = (ulonglong)local_a8 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar8 = (uint)(timeNs >> 0x20); lVar2 = lVar2 + (timeNs & 0xffffffff); local_58[0] = (int)lVar2; uVar11 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = (ulonglong)local_a8 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar8,uVar11),uVar8 + uVar11); local_94->_spawnerType = 0; uVar11 = (uint)((ulonglong)lVar2 >> 0x20); local_94->_spawnerVariant = 0; local_ac = (int *)((uint)lVar2 >> 0x12 | uVar11 * 0x4000); local_90 = (float)(uVar11 >> 0x12); spawnerSlot = &local_94->_spawnerEntity; if (*spawnerSlot != (EntityPtr)0x0) { local_64 = spawnerSlot; std::multiset::erase(&local_64); } iVar10 = *(int *)ladder; *spawnerSlot = (EntityPtr)0x0; (ladder->_pos).x = g_vectorZero.x; (ladder->_pos).y = g_vectorZero.y; (ladder->_velocity).x = g_vectorZero.x; (ladder->_velocity).y = g_vectorZero.y; (**(code **)(iVar10 + 4))(spawnType,spawnVariant,local_b4,local_8c); game = local_a4; pvVar12 = local_a4->_room; iVar10 = *(int *)((int)pvVar12 + 0x1214); *(int *)((int)pvVar12 + 0x1214) = iVar10 + 1; ladder->_index = iVar10; EntityList::AddEntity((EntityList *)((int)pvVar12 + 0x1218),ladder); bVar6 = Game::ShouldEraseEnemy(ladder); if (bVar6 != 0) { Entity::RemoveWithPoof(ladder,unusedArg); } if ((ladder->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { triggerKeyVariant = ladder->_variant; triggerKeyType = ladder->_type; std::map::find(&local_a0,&triggerKeyType); if (local_a0 == (game->_proceduralItemManager)._spawnTriggerTargets._head) { local_58[0] = ladder->_type; local_58[1] = 0xffffffff; piVar9 = (int *)std::map::find(auStack_34,local_58); local_a0 = (void *)*piVar9; if (local_a0 == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_0079f990; } playerManager = &g_game->_playerManager; local_a4 = (Game *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar12 = (playerManager->_playerList)._end; if ((int)pvVar12 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar12 = (playerManager->_playerList)._end; } piVar9 = (playerManager->_playerList)._begin; if (local_a4 < (Game *)((int)pvVar12 - (int)piVar9 >> 2)) { piVar9 = piVar9 + (int)local_a4; } trigger_set_dispatch((void *)(*piVar9 + 0x1fc8),6,ladder,&g_vectorZero,&g_vectorZero); playerManager = &g_game->_playerManager; local_a4 = (Game *)((int)&local_a4->_stage + 1); } while (local_a4 < (Game *)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0079f990: timeNs = GetTimeNs(); uVar11 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_b4 = (int *)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar11 * 0xd7b634db; local_a4 = (Game *)((ulonglong)lVar4 >> 0x20); lVar2 = (ulonglong)uVar11 * 0x431bde82; timeNs = lVar4 + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); uVar8 = (uint)(timeNs >> 0x20); lVar3 = lVar3 + (timeNs & 0xffffffff); apiStack_78[0] = (int *)lVar3; uVar11 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar8,uVar11),uVar8 + uVar11); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); piVar9 = (int *)((uint)lVar3 >> 0x12 | uVar8 * 0x4000); uVar11 = (int)piVar9 - (int)local_ac; bVar15 = CARRY4((uint)g_entitySpawnTimeMs,uVar11); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar11; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar8 >> 0x12) - (int)local_90) - (uint)(piVar9 < local_ac)) + (uint)bVar15; } piVar9 = ladderSlot; ladder = local_94; local_a8 = (uint)lVar2; local_94->_visible = 0; *(undefined4 *)&local_94[1].field_0x44 = 0xffffffff; if (*ladderSlot != 0) { local_60 = ladderSlot; std::multiset::erase(&local_60); lVar2 = CONCAT44(local_60,local_a8); } local_60 = (int *)((ulonglong)lVar2 >> 0x20); local_a8 = (uint)lVar2; *piVar9 = (int)ladder; piStack_88 = piVar9; std::set::insert_unique(auStack_24,&piStack_88); local_b4 = *(int **)&local_7c->field_0x1424; LAB_0079fa87: local_90 = (local_7c->_pos).x; local_94 = (Entity *)(local_7c->_pos).y; local_ac = (int *)(local_7c->_velocity).x; local_a4 = (Game *)(local_7c->_velocity).y; local_a8 = *(int *)((int)room + 0xc); piVar9 = local_b4; if (*(char *)((int)local_b4 + 0x171) != '\0') { uVar11 = local_b4[0x114]; uVar8 = 0; fVar18 = (float)((int)uVar11 % (int)local_a8) * 40.0 + 40.0; piVar9 = (int *)((float)((int)uVar11 / (int)local_a8) * 40.0 + 120.0); game = g_game; fStack_84 = fVar18; apiStack_78[0] = piVar9; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar12 = (game->_playerManager)._playerList._end; piVar13 = (game->_playerManager)._playerList._begin; if ((int)pvVar12 - (int)piVar13 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar12 = (game->_playerManager)._playerList._end; piVar13 = (game->_playerManager)._playerList._begin; game = g_game; fVar18 = fStack_84; piVar9 = apiStack_78[0]; } if (uVar8 < (uint)((int)pvVar12 - (int)piVar13 >> 2)) { piVar13 = piVar13 + uVar8; } otherPlayer = (Entity_Player *)*piVar13; if (((otherPlayer == local_7c) || (otherPlayer->_entityGridCollisionClass == 5)) && (fVar16 = (otherPlayer->_pos).x - fVar18, fVar17 = (otherPlayer->_pos).y - (float)piVar9, fVar17 * fVar17 + fVar16 * fVar16 <= 3249.0)) { piVar9 = local_b4; goto LAB_0079fc67; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2)); uVar11 = local_b4[0x114]; } piVar9 = local_b4; if (((-1 < (int)uVar11) && (uVar11 < 0x1c0)) && ((pit = *(GridEntity_Pit **)((int)room + uVar11 * 4 + 0x24), pit != (GridEntity_Pit *)0x0 && ((pit->_desc)._type == 7)))) { pit->_hasLadder = 0; GridEntity_Pit::UpdateCollision(pit); } piVar9[0x114] = -1; *(undefined1 *)((int)piVar9 + 0x171) = 0; } LAB_0079fc67: if (isLadderOwner == '\0') { if (*(char *)((int)piVar9 + 0x171) == '\0') { (**(code **)(*piVar9 + 0x28))(); piVar9 = ladderSlot; if (*ladderSlot != 0) { apiStack_78[0] = ladderSlot; std::multiset::erase(apiStack_78); } *piVar9 = 0; } } else { iVar14 = (int)((local_90 - 40.0) / 40.0 + 0.5); iVar10 = (int)(((float)local_94 - 120.0) / 40.0 + 0.5); if (((-1 < iVar14) && (iVar14 < *(int *)((int)room + 0xc))) && ((-1 < iVar10 && ((iVar10 < *(int *)((int)room + 0x10) && (piStack_88 = (int *)(iVar10 * *(int *)((int)room + 0xc) + iVar14), -1 < (int)piStack_88))) ))) { fStack_84 = (float)local_ac; apiStack_78[0] = &local_a4->_stage; fVar18 = sqrtf((float)local_ac * (float)local_ac + (float)local_a4 * (float)local_a4); piVar13 = local_b4; if (fVar18 <= 0.0) { piVar5 = apiStack_78[0]; } else { fStack_84 = (1.0 / fVar18) * (float)local_ac; piVar5 = (int *)((1.0 / fVar18) * (float)local_a4); } iVar10 = (int)(((fStack_84 * 40.0 + local_90) - 40.0) / 40.0 + 0.5); iVar14 = (int)((((float)piVar5 * 40.0 + (float)local_94) - 120.0) / 40.0 + 0.5); if ((((iVar10 < 0) || (*(int *)((int)room + 0xc) <= iVar10)) || (iVar14 < 0)) || (*(int *)((int)room + 0x10) <= iVar14)) { uVar11 = 0xffffffff; } else { uVar11 = iVar14 * *(int *)((int)room + 0xc) + iVar10; } if (piVar9[0x114] != uVar11) { if ((int)piStack_88 < 0x1c0) { iVar10 = *(int *)((int)room + (int)piStack_88 * 4 + 0x24); } else { iVar10 = 0; } if (uVar11 < 0x1c0) { local_8c = *(uint *)((int)room + uVar11 * 4 + 0x24); } else { local_8c = 0; } if (((((iVar10 == 0) || (*(int *)(iVar10 + 4) != 7)) || (1 < *(uint *)(iVar10 + 0xc))) && ((local_8c != 0 && (*(int *)(local_8c + 4) == 7)))) && (*(int *)(local_8c + 0xc) == 0)) { fStack_84 = (float)(uVar11 + 1); uVar8 = uVar11 - 1; upGridIdx = uVar11 - local_a8; piStack_88 = (int *)(uVar11 + local_a8); if (((((ABS((float)local_ac) <= ABS((float)local_a4)) || ((int)uVar8 < 0)) || ((int)(local_a8 * local_a8) <= (int)uVar8)) || (((uVar8 < 0x1c0 && (apiStack_78[0] = *(int **)((int)room + uVar11 * 4 + 0x20), apiStack_78[0] != (int *)0x0)) && (apiStack_78[0][1] == 7)))) || (((int)(local_a8 * local_a8) <= (int)fStack_84 || (((uVar11 + 1 < 0x1c0 && (*(int *)((int)room + uVar11 * 4 + 0x28) != 0)) && (*(int *)(*(int *)((int)room + uVar11 * 4 + 0x28) + 4) == 7)))))) { if (ABS((float)local_a4) <= ABS((float)local_ac)) { return; } if ((int)upGridIdx < 0) { return; } if ((int)(local_a8 * local_a8) <= (int)upGridIdx) { return; } if (((upGridIdx < 0x1c0) && (iVar10 = *(int *)((int)room + upGridIdx * 4 + 0x24), iVar10 != 0)) && (*(int *)(iVar10 + 4) == 7)) { return; } if ((int)piStack_88 < 0) { return; } if ((int)(local_a8 * local_a8) <= (int)piStack_88) { return; } if (((piStack_88 < (int *)0x1c0) && (iVar10 = *(int *)((int)room + (int)piStack_88 * 4 + 0x24), iVar10 != 0)) && (*(int *)(iVar10 + 4) == 7)) { return; } local_a0 = (void *)0x2; } else { local_a0 = (void *)0x1; } uVar8 = local_b4[0x114]; if (((-1 < (int)uVar8) && (uVar8 < 0x1c0)) && ((pit = *(GridEntity_Pit **)((int)room + uVar8 * 4 + 0x24), pit != (GridEntity_Pit *)0x0 && ((pit->_desc)._type == 7)))) { pit->_hasLadder = 0; GridEntity_Pit::UpdateCollision(pit); } pit = (GridEntity_Pit *) __RTDynamicCast(local_8c,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0); pit->_hasLadder = 1; GridEntity_Pit::UpdateCollision(pit); piVar13[0x114] = uVar11; iVar10 = *(int *)((int)room + 0xc); piVar13[0xcf] = (int)((float)((int)uVar11 % iVar10) * 40.0 + 40.0); piVar13[0xd0] = (int)((float)((int)uVar11 / iVar10) * 40.0 + 120.0); *(undefined1 *)((int)piVar13 + 0x171) = 1; manager = g_manager; if (local_a0 == (void *)0x1) { iVar10 = 0x42b40000; } else { iVar10 = 0; } piVar13[0x3b] = iVar10; local_a0 = (void *)0x43e; seed_fart_sound_override((int *)&local_a0); SoundEffects::Play(&manager->_sfxManager,(int)local_a0,1.0,2,0,1.0,0.0); return; } } } } return; } //@@ 007a0080 Entity_Player::trigger_npc_death /* DB: (Entity* npc): called per player from Entity_NPC::Update on death and take_damage_impl; AddBestiaryKill, award_fly_kill_points, on-kill item/trinket effects (TemporaryEffects, AddHearts, AddActiveCharge, AddCostume) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::trigger_npc_death(Entity_Player *this,Entity *npc) { byte bVar1; int iVar2; uint uVar3; Entity *pEVar4; ItemConfig_Item *collectibleID; Entity_Player *firstPlayer; void *pvVar5; int *effect; int iVar6; bool bVar7; bool bVar8; float distance; Entity *pEVar9; TemporaryEffects *pTVar10; undefined1 local_3c [12]; float local_30; int tmpEffect [2]; Vector local_24; Entity *killedNpc; TemporaryEffects *local_18; void *local_10; undefined1 *puStack_c; int local_8; void *collectibles; Game *game; Manager *manager; pEVar4 = npc; local_8 = 0xffffffff; puStack_c = &LAB_00aff8d0; local_10 = ExceptionList; ExceptionList = &local_10; killedNpc = (Entity *) __RTDynamicCast(npc,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0, __security_cookie ^ (uint)(tmpEffect + 10)); if ((pEVar4->_flags & 0x40000000000) == 0) { pTVar10 = &this->_temporaryeffects; bVar1 = TemporaryEffects::HasCollectibleEffect(pTVar10,0x5d); game = g_game; if ((((bVar1 != 0) && ((this->_flags & 0x4000) == 0)) && (bVar1 = Game::IsPaused(g_game), bVar1 == 0)) && ((~(byte)game->_frameCount & 1) != 0)) { AddHearts(this,1,0,0); } bVar1 = HasCollectible(this,0x19b,0); if (bVar1 != 0) { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x19b < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 >> 2) && (iVar6 = *(int *)((int)pvVar5 + 0x66c), iVar6 != 0)) { local_3c._8_4_ = *(int *)(iVar6 + 0x78); local_3c._4_4_ = (void *)0x0; local_30 = 0.0; local_3c._0_4_ = iVar6; TemporaryEffects::AddEffect(pTVar10,local_3c,0,1); } if ((npc->_type == 1) && (1 < *(int *)&g_game->_deathmatchManager)) { iVar6 = 4; do { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x19b < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 >> 2) && (iVar2 = *(int *)((int)pvVar5 + 0x66c), iVar2 != 0)) { local_3c._8_4_ = *(int *)(iVar2 + 0x78); local_3c._4_4_ = (void *)0x0; local_30 = 0.0; local_3c._0_4_ = iVar2; TemporaryEffects::AddEffect(pTVar10,local_3c,0,1); } iVar6 = iVar6 + -1; } while (iVar6 != 0); } } distance = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((distance == 0.0) || (distance != 8.12753e-44)) { iVar6 = GetTrinketMultiplier(this,0x3a); bVar8 = false; bVar7 = iVar6 == 0; LAB_007a0232: if (!bVar7 && bVar8 == iVar6 < 0) goto LAB_007a023d; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar2 = GetTrinketMultiplier(this,0x3a); bVar8 = SBORROW4(iVar2,1); iVar6 = iVar2 + -1; bVar7 = iVar2 == 1; goto LAB_007a0232; } LAB_007a023d: iVar2 = 0x29a; iVar6 = GetTrinketMultiplier(this,0x3a); if (iVar6 == 2) { iVar2 = 0x514; } else if (2 < iVar6) { iVar2 = 0x9c4; } iVar6 = __ftoui3(); uVar3 = Random(); if (uVar3 % 10000 < (uint)(iVar2 + iVar6)) { pvVar5 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar5 >> 2 < 0x3b) { local_3c._0_4_ = 0; } else { local_3c._0_4_ = *(int *)((int)pvVar5 + 0xe8); } local_3c._8_4_ = *(int *)(local_3c._0_4_ + 0x78); local_3c._4_4_ = (void *)0x0; local_30 = 0.0; TemporaryEffects::AddEffect(pTVar10,local_3c,1,1); } } distance = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((distance == 0.0) || (distance != 8.40779e-44)) { iVar6 = GetTrinketMultiplier(this,0x3c); bVar8 = false; bVar7 = iVar6 == 0; LAB_007a0306: if (!bVar7 && bVar8 == iVar6 < 0) goto LAB_007a030d; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar2 = GetTrinketMultiplier(this,0x3c); bVar8 = SBORROW4(iVar2,1); iVar6 = iVar2 + -1; bVar7 = iVar2 == 1; goto LAB_007a0306; } LAB_007a030d: iVar6 = 0x32; iVar2 = GetTrinketMultiplier(this,0x3c); if (iVar2 == 2) { iVar6 = 100; } else if (2 < iVar2) { iVar6 = 0x96; } iVar2 = __ftoui3(); uVar3 = Random(); if (uVar3 % 1000 < (uint)(iVar6 + iVar2)) { TemporaryEffects::AddTrinketEffect(pTVar10,0x3c,1,1); } } trigger_vampire_charm_kill(); bVar1 = HasCollectible(this,0x208,0); if ((bVar1 != 0) && (*(int *)&this->field_0x160c = *(int *)&this->field_0x160c + 1, 0xe < *(int *)&this->field_0x160c)) { uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar3,0); iVar6 = __RTDynamicCast(pEVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); uVar3 = 0; *(undefined4 *)(iVar6 + 0xdc) = 0; *(undefined4 *)(iVar6 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar6 + 0x358) = 0x3f800000; do { AddActiveCharge(this,1,uVar3,0,0,0); uVar3 = uVar3 + 1; } while (uVar3 < 4); *(int *)&this->field_0x160c = *(int *)&this->field_0x160c + -0xf; } distance = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((distance == 0.0) || (distance != 1.65353e-43)) { iVar6 = GetTrinketMultiplier(this,0x76); bVar8 = false; bVar7 = iVar6 == 0; LAB_007a0440: if (!bVar7 && bVar8 == iVar6 < 0) goto LAB_007a044b; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar2 = GetTrinketMultiplier(this,0x76); bVar8 = SBORROW4(iVar2,1); iVar6 = iVar2 + -1; bVar7 = iVar2 == 1; goto LAB_007a0440; } LAB_007a044b: bVar1 = TemporaryEffects::HasTrinketEffect(pTVar10,0x76); if (bVar1 == 0) { uVar3 = 0x14; iVar6 = GetTrinketMultiplier(this,0x76); if (iVar6 == 2) { uVar3 = 10; } else if (iVar6 == 3) { uVar3 = 7; } uVar3 = RNG::RandomInt((RNG *)((int)(this->_trinketRNGs)._begin + 0x760),uVar3); if (uVar3 == 0) { TemporaryEffects::AddTrinketEffect(pTVar10,0x76,1,1); pvVar5 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 >> 2 < 0x29) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar5 + 0xa0); } AddCostume(this,collectibleID,0); } } } pEVar4 = killedNpc; if ((((*(char *)((int)g_game->_room + 1) != '\0') && (killedNpc != (Entity *)0x0)) && (-1 < killedNpc->_spawnGridIndex)) && (firstPlayer = Game::GetPlayer(g_game,0), this == firstPlayer)) { award_fly_kill_points(&g_game->_scoreSheet,pEVar4); } bVar1 = HasCollectible(this,0x212,0); pEVar4 = npc; if ((bVar1 != 0) && (pvVar5 = g_game->_room, *(char *)((int)pvVar5 + 0x1bbc) == '\0')) { if (*(Entity **)((int)pvVar5 + 0x1bb8) != (Entity *)0x0) { if ((npc != *(Entity **)((int)pvVar5 + 0x1bb8)) && ((npc->_flags & 0x20000000) == 0)) { *(undefined1 *)((int)pvVar5 + 0x1bbc) = 1; } npc = (Entity *)((int)pvVar5 + 0x1bb8); std::multiset::erase(&npc); *(undefined4 *)((int)pvVar5 + 0x1bb8) = 0; if (*(char *)((int)pvVar5 + 0x1bbc) == '\0') { distance = (pEVar4->_pos).y; *(float *)((int)pvVar5 + 0x1bc0) = (pEVar4->_pos).x; *(float *)((int)pvVar5 + 0x1bc4) = distance; } } } } if (0 < this->_redStewBonusDuration) { iVar2 = this->_redStewBonusDuration + 0x1e; (this->_temporaryeffects)._shouldEvaluateCache = 1; iVar6 = 9000; if (iVar2 < 9000) { iVar6 = iVar2; } (this->_temporaryeffects)._cacheFlags = (this->_temporaryeffects)._cacheFlags | 1; this->_redStewBonusDuration = iVar6; } if (((pEVar4->_flags & 0x80000000000000) != 0) && (pvVar5 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x2c0), pvVar5 != (void *)0x0)) { collectibles = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)collectibles >> 2 < 0x2c1) { tmpEffect[0] = 0; } else { tmpEffect[0] = *(int *)((int)collectibles + 0xb00); } distance = (float)(*(int *)(tmpEffect[0] + 0x78) - *(int *)((int)pvVar5 + 8)); tmpEffect[1] = 0; local_24.y = 0.0; if (this->_playerType == 0x1b) { bVar1 = HasCollectible(this,0x26b,0); local_24.x = 1.26117e-43; if (bVar1 == 0) goto LAB_007a0661; } else { LAB_007a0661: local_24.x = 4.2039e-44; } if ((int)distance < (int)local_24.x) { local_24.x = distance; } TemporaryEffects::AddEffect(&this->_temporaryeffects,tmpEffect,0,1); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_3c,&this->_pos, 60.0,2); uVar3 = 0; if (local_30 != 0.0) { do { iVar6 = *(int *)(local_3c._4_4_ + uVar3 * 4); if (((*(int *)(iVar6 + 0x28) == 9) && (*(char *)(iVar6 + 0x173) == '\0')) && ((*(uint *)(iVar6 + 0x438) & 0x80000000) == 0)) { *(undefined1 *)(iVar6 + 0x173) = 1; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)local_30); } if (local_3c[0] == '\0') { local_8 = 0; tracked_alloc(1,(void *)local_3c._4_4_,0); local_8 = 0xffffffff; } } npc = (Entity *)((pEVar4->_pos).y - (this->_pos).y); local_24.x = (pEVar4->_pos).x - (this->_pos).x; local_24.y = (float)npc; local_18 = (TemporaryEffects *)local_24.x; distance = sqrtf((float)npc * (float)npc + local_24.x * local_24.x); pEVar9 = npc; pTVar10 = local_18; if (0.0 < distance) { pEVar9 = (Entity *)((float)npc * (1.0 / distance)); pTVar10 = (TemporaryEffects *)((float)local_18 * (1.0 / distance)); local_24.x = (float)pTVar10; local_24.y = (float)pEVar9; } local_3c._8_4_ = (pEVar4->_pos).x - (float)pTVar10 * pEVar4->_size; local_30 = (pEVar4->_pos).y - (float)pEVar9 * pEVar4->_size; trigger_set_dispatch(&this->_proceduralItems,3,pEVar4,(Vector *)(local_3c + 8),&local_24); distance = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((distance == 0.0) || (distance != 2.64845e-43)) { iVar6 = GetTrinketMultiplier(this,0xbd); bVar8 = false; bVar7 = iVar6 == 0; LAB_007a0809: if (bVar7 || bVar8 != iVar6 < 0) goto LAB_007a0930; } else if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar2 = GetTrinketMultiplier(this,0xbd); bVar8 = SBORROW4(iVar2,1); iVar6 = iVar2 + -1; bVar7 = iVar2 == 1; goto LAB_007a0809; } pTVar10 = (TemporaryEffects *)0x1e; iVar2 = 0x96; iVar6 = GetTrinketMultiplier(this,0xbd); manager = g_manager; if (iVar6 == 2) { pTVar10 = (TemporaryEffects *)0x2d; iVar2 = 0xe1; } else if (iVar6 == 3) { pTVar10 = (TemporaryEffects *)&DAT_0000003c; iVar2 = 300; } local_18 = &this->_temporaryeffects; if ((this->_temporaryeffects)._disabled == 0) { for (effect = (this->_temporaryeffects)._effects._begin; effect != (this->_temporaryeffects)._effects._end; effect = effect + 4) { iVar6 = *(int *)*effect; if ((((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) && (((int *)*effect)[1] == 0x3a)) { if (iVar2 <= effect[2]) goto LAB_007a0930; goto LAB_007a088a; } } } effect = (int *)0x0; LAB_007a088a: pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU) < 0xe9) { tmpEffect[0] = 0; } else { tmpEffect[0] = *(int *)((int)pvVar5 + 0xe8); } tmpEffect[1] = 0; local_24.y = 0.0; local_24.x = (float)pTVar10; if (effect == (int *)0x0) { npc = (Entity *)0x404; seed_fart_sound_override((int *)&npc); SoundEffects::Play(&manager->_sfxManager,(int)npc,1.0,2,0,1.0,0.0); local_24.y = 1.4013e-45; } else if (iVar2 - effect[2] < (int)pTVar10) { local_24.x = (float)(iVar2 - effect[2]); } TemporaryEffects::AddEffect(local_18,tmpEffect,1,1); LAB_007a0930: if (killedNpc != (Entity *)0x0) { PersistentGameData::AddBestiaryKill (&g_manager->_persistentGameData,killedNpc->_type,killedNpc->_variant); } ExceptionList = local_10; return; } //@@ 007a0970 Entity_Player::FireBomb /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:FireBomb prototype: REPENTOGON, confirmed by RET 12 */ Entity_Bomb * __thiscall Entity_Player::FireBomb(Entity_Player *this,Vector *pos,Vector *vel,Entity *source) { BitSet128 tearFlags; qword qVar1; byte bVar2; uint uVar3; uint seed; Entity *spawned; Entity_Bomb *bomb; int iVar4; Entity_Player *refSlot; float unaff_EDI; bool bVar5; bool bVar6; float fVar7; float fVar8; int *piVar9; int iVar10; undefined1 auStack_c2 [6]; Entity_Player *local_bc; float local_a8; float bombScale; undefined4 local_a0; Vector local_9c; Vector local_94; Entity_Player *playerCopy; float spawnX; float local_84 [12]; undefined4 tearFlags0; undefined4 tearFlags1; undefined4 tearFlags2; undefined4 tearFlags3; float tearDamage; float tearScale; uint local_c; undefined4 flagsHigh; int *laser; local_c = __security_cookie ^ (uint)&local_a8; local_a0 = 0x1e; spawnX = pos->x + (this->_tearsOffset).x; local_94.x = (float)vel; local_84[0] = (this->_tearsOffset).y + pos->y; local_9c.x = vel->x; local_a8 = vel->y; local_bc = (Entity_Player *)0x7a09ef; playerCopy = this; bVar2 = HasCollectible(this,0xe9,0); if (bVar2 != 0) { uVar3 = Random(); local_a0 = 0x28; fVar8 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 2.4; local_a8 = fVar8 * local_a8; local_9c.x = fVar8 * local_9c.x; } local_bc = (Entity_Player *)0x7a0a59; bVar2 = HasCollectible(this,0xe0,0); if (bVar2 != 0) { local_9c.x = local_9c.x * 1.2; local_a8 = local_a8 * 1.2; } fVar8 = (float)(int)(char)this->_tearDisplacement; bombScale = 1.0; local_bc = (Entity_Player *)0x3f800000; GetTearHitParams(); uVar3 = 0; bVar2 = HasCollectible(this,0x247,0); if (bVar2 != 0) { uVar3 = 0x13; } tearFlags._l._4_4_ = tearFlags1; tearFlags._l._0_4_ = tearFlags0; tearFlags._h._0_4_ = tearFlags2; tearFlags._h._4_4_ = tearFlags3; bombScale = check_bomb_tearflags(this,tearFlags); if (0.55 < tearScale) { if (tearScale <= 0.75) { fVar8 = 0.8; bombScale = bombScale * 0.6; } else if (2.0 < tearScale) { bombScale = bombScale * 1.2; } } else { bombScale = bombScale * 0.45; fVar8 = 0.65; } fVar7 = tearDamage * 10.0; tearDamage = tearDamage * 5.0 + 30.0; if (fVar7 <= tearDamage) { tearDamage = fVar7; } if (1.5 <= bombScale) { tearDamage = tearDamage + 25.0; } seed = Random(); local_94.y = -this->_tearheight / 23.75; local_94.x = unaff_EDI * local_94.y; local_94.y = (float)local_bc * local_94.y; spawned = Game::SpawnEx(g_game,4,uVar3,&local_9c,&local_94,(Entity *)this,0,seed,0); bomb = (Entity_Bomb *) __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor); *(uint *)&bomb->_flags = (uint)bomb->_flags | 0x4000000; flagsHigh = *(undefined4 *)((int)&bomb->_flags + 4); bomb->_entityGridCollisionClass = 6; *(undefined4 *)((int)&bomb->_flags + 4) = flagsHigh; fVar7 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar7 == 0.0) || (fVar7 != 1.86373e-43)) { iVar4 = GetTrinketMultiplier(this,0x85); bVar6 = false; bVar5 = iVar4 == 0; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) != '\0') { bVar5 = true; goto LAB_007a0c76; } iVar10 = GetTrinketMultiplier(this,0x85); bVar6 = SBORROW4(iVar10,1); iVar4 = iVar10 + -1; bVar5 = iVar10 == 1; } bVar5 = !bVar5 && bVar6 == iVar4 < 0; LAB_007a0c76: iVar4 = *(int *)bomb; *(undefined4 *)&(bomb->_tearFlags)._l = tearFlags0; *(undefined4 *)((int)&(bomb->_tearFlags)._l + 4) = tearFlags1; *(undefined4 *)&(bomb->_tearFlags)._h = tearFlags2; *(undefined4 *)((int)&(bomb->_tearFlags)._h + 4) = tearFlags3; bomb->_loadCostumes = 1; local_bc = (Entity_Player *)&((Entity_Player *)((int)source + -0x26cc))->field_0x26bd; if (!bVar5) { local_bc = (Entity_Player *)source; } bomb->_explosionCountdown1 = (int)local_bc; *(Entity_Player **)&bomb->field_0x414 = local_bc; bomb->_scale = bombScale; iVar10 = 0xff; bomb->_explosionDamage = tearDamage; bomb->_radiusMultiplier = fVar8; bomb->_isFetus = 1; (**(code **)(iVar4 + 0x3c))(local_84,0xffffffff,0xff,0); if (bomb->_parent != (EntityPtr)0x0) { std::multiset::erase(auStack_c2 + -6); } bomb->_parent = (EntityPtr)this; std::multiset::insert(&bomb->_parent); if ((((uint)(bomb->_tearFlags)._l & DAT_00c34b50) != 0 || (*(uint *)((int)&(bomb->_tearFlags)._l + 4) & DAT_00c34b54) != 0) || (((uint)(bomb->_tearFlags)._h & DAT_00c34b58) != 0 || (*(uint *)((int)&(bomb->_tearFlags)._h + 4) & DAT_00c34b5c) != 0)) { (**(code **)(*(int *)bomb + 0x40))(0xc); } if ((bomb->_variant == 0x13) || (bomb->_variant == 0x14)) { fVar8 = atan2f(*(float *)&local_bc->field_0x4,*(float *)local_bc); bomb->_explosionCountdown1 = iVar10 + 0x3c; bomb->_rocketAngle = fVar8 * 57.295776; *(int *)&bomb->field_0x414 = iVar10 + 0x3c; } bVar2 = HasCollectible(this,0x18b,0); if (bVar2 != 0) { uVar3 = Random(); bVar2 = HasCollectible((Entity_Player *)source,0x76,0); spawned = Game::SpawnEx(g_game,7,2 - (bVar2 != 0),(Vector *)(auStack_c2 + 0x12),&g_vectorZero, source,3,uVar3,0); laser = (int *)__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); laser[0xd3] = 0; laser[0xd4] = -0x3f600000; refSlot = (Entity_Player *)(laser + 0xef); if (*(float *)refSlot != 0.0) { local_bc = refSlot; std::multiset::erase(&local_bc); } *(Entity_Bomb **)refSlot = bomb; std::multiset::insert(refSlot); piVar9 = (int *)0x0; laser[0xd6] = 0x453b8000; iVar4 = *(int *)((int)&(((Entity_Player *)source)->_tearFlags)._l + 4); qVar1 = (((Entity_Player *)source)->_tearFlags)._h; iVar10 = *(int *)((int)&(((Entity_Player *)source)->_tearFlags)._h + 4); laser[0x10a] = (int)(((Entity_Player *)source)->_tearFlags)._l; laser[0x10b] = iVar4; laser[0x10c] = (int)qVar1; laser[0x10d] = iVar10; (**(code **)(*laser + 0x3c))(&((Entity_Player *)source)->_laserColor,0xffffffff,0xff,0,1); (**(code **)(*piVar9 + 0x40))(((Entity_Player *)source)->_damage); laser[0x12f] = 0x42480000; refSlot = (Entity_Player *)(laser + 0xf2); if (laser[0xf2] != 0) { local_bc = refSlot; std::multiset::erase(&local_bc); } *(Entity **)refSlot = source; std::multiset::insert(refSlot); } if ((bomb->_variant == 0x13) || (bomb->_variant == 0x14)) { (**(code **)(*(int *)bomb + 0xc))(); } return bomb; } //@@ 007a0f50 Entity_Player::FireBrimstone /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:FireBrimstone */ Entity_Laser * __thiscall Entity_Player::FireBrimstone(Entity_Player *this,Vector *param_2,undefined4 param_3,float param_4) { Entity_Laser *pEVar1; float local_38; float fStack_34; float fStack_30; float fStack_2c; float local_28; float fStack_24; float fStack_20; float fStack_1c; undefined8 local_18; float local_10; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); pEVar1 = Weapon::FireBrimstone((Entity *)this,&this->_pos,param_2,param_4,(float)this,0); local_38 = (this->_laserColor)._tint[0]; fStack_34 = (this->_laserColor)._tint[1]; fStack_30 = (this->_laserColor)._tint[2]; fStack_2c = (this->_laserColor)._tint[3]; local_10 = (this->_laserColor)._offset[2]; local_28 = (this->_laserColor)._colorize[0]; fStack_24 = (this->_laserColor)._colorize[1]; fStack_20 = (this->_laserColor)._colorize[2]; fStack_1c = (this->_laserColor)._colorize[3]; local_18 = *(undefined8 *)(this->_laserColor)._offset; (**(code **)(*(int *)pEVar1 + 0x3c))(&local_38,0xffffffff,0xff,0,1); return pEVar1; } //@@ 007a0fe0 FUN_007a0fe0 Entity_Player * FUN_007a0fe0(void) { byte bVar1; int in_EDX; Entity_Player **ppEVar2; ppEVar2 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { bVar1 = Entity_Player::HasCollectible(*ppEVar2,in_EDX,0); if (bVar1 != 0) { return *ppEVar2; } ppEVar2 = ppEVar2 + 1; } while (ppEVar2 != g_triggerDeathPlayersEnd); } return (Entity_Player *)0x0; } //@@ 007a1020 FUN_007a1020 Entity_Player * FUN_007a1020(void) { Entity_Player *this; float fVar1; int iVar2; int iVar3; float in_EDX; Entity_Player **ppEVar4; bool bVar5; bool bVar6; ppEVar4 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { this = *ppEVar4; fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != in_EDX)) { iVar3 = Entity_Player::GetTrinketMultiplier(this,(uint)in_EDX); bVar6 = false; bVar5 = iVar3 == 0; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) != '\0') goto LAB_007a1086; iVar2 = Entity_Player::GetTrinketMultiplier(this,(uint)in_EDX); bVar6 = SBORROW4(iVar2,1); iVar3 = iVar2 + -1; bVar5 = iVar2 == 1; } if (!bVar5 && bVar6 == iVar3 < 0) { LAB_007a1086: return *ppEVar4; } ppEVar4 = ppEVar4 + 1; } while (ppEVar4 != g_triggerDeathPlayersEnd); } return (Entity_Player *)0x0; } //@@ 007a1090 Entity_Player::TriggerDeath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall bool Entity_Player::TriggerDeath(bool checkOnly); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::TriggerDeath(Entity_Player *this,byte checkOnly) { code *pcVar1; byte bVar2; uint uVar3; Entity_Player *tmpPlayer; ColorMod *color; int *piVar4; int iVar5; RNG *guppysCollarRng; Entity_Player *pEVar6; ColorMod *extraout_EAX; ColorMod *extraout_EAX_00; Entity_Player **ppEVar7; byte extraout_CL; byte extraout_CL_00; short newDeadCatLives; uint slotIndex; Entity_Player *extraout_ECX; Entity_Player *extraout_ECX_00; Entity_Player *extraout_ECX_01; Entity_Player *extraout_ECX_02; Entity_Player *extraout_ECX_03; void *extraout_ECX_04; Entity_Player *extraout_ECX_05; Entity_Player *extraout_ECX_06; Entity_Player *extraout_ECX_07; Entity_Player *extraout_ECX_08; Entity_Player *extraout_ECX_09; Entity_Player *extraout_ECX_10; Entity_Player *extraout_ECX_11; Entity_Player *extraout_ECX_12; Entity_Player *extraout_ECX_13; Entity_Player *extraout_ECX_14; Entity_Player *extraout_ECX_15; Entity_Player *extraout_ECX_16; Entity_Player *extraout_ECX_17; void *pvVar8; undefined4 extraout_ECX_18; Entity_Player *extraout_ECX_19; Entity_Player *extraout_ECX_20; Entity_Player *extraout_ECX_21; undefined4 extraout_ECX_22; Entity_Player *extraout_ECX_23; Entity_Player *extraout_ECX_24; Entity_Player *extraout_ECX_25; Entity_Player *extraout_ECX_26; Entity_Player *extraout_ECX_27; Entity_Player *extraout_ECX_28; Entity_Player *pEVar9; char *pocketCopySrc; Entity_Player **playerIter; uint uVar10; int iVar11; undefined4 *pocketCopyDst; uint *puVar12; ColorMod *color_00; Entity_Player *local_84; EntityPtr local_80; Vector local_7c; int effectKey [3]; undefined4 local_68; Color gibColor; Color boneGibColor; uint stackCookie; Entity_Player *deathPlayer; float forgottenBodyY; Manager *manager; EntityPtr parentPlayer; void *rngArray; stackCookie = __security_cookie ^ (uint)&local_84; local_84 = this; if (this->_variant == 1) { if (checkOnly == 0) { coop_baby_death_effect(this); PlayerManager::trigger_coop_baby_death(this); this->_visible = 0; return 0; } return 0; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c8129c) && (_Init_thread_header(&DAT_00c8129c), DAT_00c8129c == -1)) { _atexit((_func_4879 *)&LAB_00b15b90); _Init_thread_footer(&DAT_00c8129c); } g_triggerDeathPlayersEnd = g_triggerDeathPlayers; local_80 = this->_twinPlayer; if (local_80 == (EntityPtr)0x0) { LAB_007a114f: local_80 = (EntityPtr)this; if (g_triggerDeathPlayersEnd == DAT_00c812a8) { LAB_007a11cc: std::vector::_Emplace_reallocate(g_triggerDeathPlayersEnd,&local_80); } else { *g_triggerDeathPlayersEnd = this; g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1; } } else { if (((*(int *)((int)local_80 + 0x161c) != -1) && (*(int *)((int)local_80 + 0x161c) < this->_playerIndex)) && (local_80 != (EntityPtr)this)) { if (g_triggerDeathPlayers == DAT_00c812a8) { std::vector::_Emplace_reallocate(g_triggerDeathPlayers,&local_80); } else { *g_triggerDeathPlayers = (Entity_Player *)local_80; g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1; } goto LAB_007a114f; } if (g_triggerDeathPlayers == DAT_00c812a8) { local_80 = (EntityPtr)this; std::vector::_Emplace_reallocate(g_triggerDeathPlayers,&local_80); } else { *g_triggerDeathPlayers = this; g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1; } local_80 = this->_twinPlayer; if (g_triggerDeathPlayersEnd == DAT_00c812a8) goto LAB_007a11cc; *g_triggerDeathPlayersEnd = (Entity_Player *)local_80; g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1; } if (((checkOnly == 0) && (bVar2 = HasTrinket(this,0x17,0), bVar2 != 0)) && (*(int *)((int)g_game->_room + 8) == 0xd)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x52); } local_80 = (EntityPtr)(*g_triggerDeathPlayers)->_playerType; for (ppEVar7 = g_triggerDeathPlayers; ppEVar7 != g_triggerDeathPlayersEnd; ppEVar7 = ppEVar7 + 1) { pEVar9 = *ppEVar7; if ((pEVar9->_temporaryeffects)._disabled == 0) { for (piVar4 = (pEVar9->_temporaryeffects)._effects._begin; piVar4 != (pEVar9->_temporaryeffects)._effects._end; piVar4 = piVar4 + 4) { if ((*(int *)*piVar4 == 0) && (((int *)*piVar4)[1] == 0x71)) goto LAB_007a15d3; } } } ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { uVar10 = 0; uVar3 = GetMaxPocketItems(*ppEVar7); if (uVar3 != 0) { do { pEVar9 = *ppEVar7; uVar3 = uVar10; if ((int)uVar10 < 1) { uVar3 = 0; } slotIndex = 3; if ((int)uVar3 < 3) { slotIndex = uVar3; } if ((pEVar9->_pocketSlots[slotIndex * 2 + 1] == 1) && (pEVar9->_pocketSlots[slotIndex * 2] == 0x59)) goto LAB_007a15d3; uVar10 = uVar10 + 1; uVar3 = GetMaxPocketItems(pEVar9); } while (uVar10 < uVar3); } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } LAB_007a12d4: tmpPlayer = (Entity_Player *)FUN_007a0fe0(); pEVar9 = local_84; if (tmpPlayer != (Entity_Player *)0x0) { if (checkOnly != 0) { return 1; } RemoveCollectible(tmpPlayer,0xb,0,0,1); pEVar6 = extraout_ECX; ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { pEVar9 = *ppEVar7; pEVar6 = (Entity_Player *)0x0; if (pEVar9 != (Entity_Player *)0x0) { LuaEngine::RunScript((LuaEngine *)pEVar9,0xb,tmpPlayer == pEVar9); pEVar6 = extraout_ECX_00; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } goto LAB_007a1331; } if (local_84->_playerType == 8) { if (checkOnly != 0) { return 1; } LuaEngine::RunScript((LuaEngine *)*g_triggerDeathPlayers,0x14c,1); pEVar6 = extraout_ECX_09; } else { tmpPlayer = (Entity_Player *)FUN_007a0fe0(); if (tmpPlayer == (Entity_Player *)0x0) { tmpPlayer = (Entity_Player *)FUN_007a0fe0(); if (tmpPlayer == (Entity_Player *)0x0) { tmpPlayer = (Entity_Player *)FUN_007a0fe0(); if ((tmpPlayer == (Entity_Player *)0x0) || (guppysCollarRng = GetCollectibleRNG(tmpPlayer,0xd4), (guppysCollarRng->_seed & 1) == 0)) { tmpPlayer = (Entity_Player *)FUN_007a0fe0(); if (tmpPlayer == (Entity_Player *)0x0) { pEVar6 = (Entity_Player *)FUN_007a0fe0(); if (pEVar6 == (Entity_Player *)0x0) { pEVar6 = (Entity_Player *)FUN_007a1020(); if (pEVar6 != (Entity_Player *)0x0) { iVar11 = GetTrinketMultiplier(pEVar6,0x1c); if (iVar11 == 1) { uVar3 = 0x16; } else { iVar11 = GetTrinketMultiplier(pEVar6,0x1c); uVar3 = 0x32; if (iVar11 == 2) { uVar3 = 0x21; } } pvVar8 = (pEVar6->_trinketRNGs)._end; if ((int)((int)pvVar8 - (int)(pEVar6->_trinketRNGs)._begin & 0xfffffff0U) < 0x1c1) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar8 = (pEVar6->_trinketRNGs)._end; } rngArray = (pEVar6->_trinketRNGs)._begin; uVar10 = ((int)pvVar8 - (int)rngArray >> 4) - 1; if (0x1c < uVar10) { uVar10 = 0x1c; } uVar10 = RNG::RandomInt((RNG *)(uVar10 * 0x10 + (int)rngArray),100); if (uVar10 < uVar3) { if (checkOnly != 0) { return 1; } ReviveFromTrinket(0x1c,extraout_ECX_18); pEVar6 = extraout_ECX_19; goto LAB_007a1335; } } pEVar6 = (Entity_Player *)FUN_007a0fe0(); if (pEVar6 == (Entity_Player *)0x0) { tmpPlayer = (Entity_Player *)FUN_007a1020(); pEVar6 = extraout_ECX_21; if (tmpPlayer == (Entity_Player *)0x0) { if ((pEVar9->_playerType == 0x1f) && (bVar2 = HasCollectible(pEVar9,0x26b,0), pEVar6 = extraout_ECX_24, bVar2 != 0)) { if (checkOnly != 0) { return 1; } RemoveCollectible(pEVar9,0x26b,0,0,1); LuaEngine::RunScript((LuaEngine *)*g_triggerDeathPlayers,0x26b,1); pEVar6 = extraout_ECX_25; } else if (checkOnly != 0) { return 0; } } else if (((g_manager->_persistentGameData)._achievements[0x52] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (checkOnly != 0) { if (*(int *)((int)g_game->_room + 8) == 0xd) { return 1; } return 0; } } else { if (checkOnly != 0) { return 1; } TryRemoveTrinket(tmpPlayer,0x17); TemporaryEffects::RemoveTrinketEffect(&tmpPlayer->_temporaryeffects,0x17,-1); ReviveFromTrinket(0x17,extraout_ECX_22); pEVar6 = extraout_ECX_23; } } else { if (checkOnly != 0) { return 1; } RemoveCollectible(pEVar6,0x137,0,0,1); LuaEngine::RunScript((LuaEngine *)*g_triggerDeathPlayers,0x137,1); pEVar6 = extraout_ECX_20; } } else { if (checkOnly != 0) { return 1; } RemoveCollectible(pEVar6,0xa1,0,0,1); LuaEngine::RunScript((LuaEngine *)*g_triggerDeathPlayers,0xa1,1); pEVar6 = extraout_ECX_17; } } else { if (checkOnly != 0) { return 1; } RemoveCollectible(tmpPlayer,0x14c,0,0,1); pEVar6 = extraout_ECX_15; ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { deathPlayer = *ppEVar7; pEVar6 = (Entity_Player *)0x0; if (deathPlayer != (Entity_Player *)0x0) { LuaEngine::RunScript((LuaEngine *)deathPlayer,0x14c,tmpPlayer == deathPlayer); pEVar6 = extraout_ECX_16; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } } } else { if (checkOnly != 0) { return 1; } pEVar6 = extraout_ECX_13; ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { deathPlayer = *ppEVar7; pEVar6 = (Entity_Player *)0x0; if (deathPlayer != (Entity_Player *)0x0) { LuaEngine::RunScript((LuaEngine *)deathPlayer,0xd4,tmpPlayer == deathPlayer); pEVar6 = extraout_ECX_14; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } } } else { if (checkOnly != 0) { return 1; } RemoveCollectible(tmpPlayer,0x2b0,0,0,1); pEVar6 = extraout_ECX_11; ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { deathPlayer = *ppEVar7; pEVar6 = (Entity_Player *)0x0; if (deathPlayer != (Entity_Player *)0x0) { LuaEngine::RunScript((LuaEngine *)deathPlayer,0x2b0,tmpPlayer == deathPlayer); pEVar6 = extraout_ECX_12; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } } } else { if (checkOnly != 0) { return 1; } iVar11 = tmpPlayer->_deadCatLives + -1; newDeadCatLives = 0; if (0 < iVar11) { newDeadCatLives = (short)iVar11; } tmpPlayer->_deadCatLives = newDeadCatLives; pEVar6 = (Entity_Player *) (*(int *)((int)(tmpPlayer->_collectibleCounts)._begin + 0x144) * 9 + -8); if ((int)newDeadCatLives < (int)pEVar6) { do { RemoveCollectible(tmpPlayer,0x51,0,0,1); pEVar6 = (Entity_Player *) (*(int *)((int)(tmpPlayer->_collectibleCounts)._begin + 0x144) * 9 + -8); } while ((int)tmpPlayer->_deadCatLives < (int)pEVar6); } ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { deathPlayer = *ppEVar7; pEVar6 = (Entity_Player *)0x0; if (deathPlayer != (Entity_Player *)0x0) { LuaEngine::RunScript((LuaEngine *)deathPlayer,0x51,tmpPlayer == deathPlayer); pEVar6 = extraout_ECX_10; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } } } LAB_007a1335: ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { pEVar6 = *ppEVar7; if (pEVar6 != (Entity_Player *)0x0) { pEVar6->_pitfallState = 0; pEVar6->_isControlsEnabled = 1; pEVar6->_entityCollisionClass = 4; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } ppEVar7 = g_triggerDeathPlayers; tmpPlayer = *g_triggerDeathPlayers; if ((tmpPlayer->_dead != 0) && (tmpPlayer->_parent == (EntityPtr)0x0)) { local_7c.x = (float)&g_game->_playerManager; bVar2 = PlayerManager::IsCoopPlay((PlayerManager *)local_7c.x); pEVar6 = extraout_ECX_01; if ((bVar2 != 0) && (((uVar3 = PlayerManager::GetNumAlivePlayers(), pEVar6 = extraout_ECX_02, 1 < uVar3 && (tmpPlayer->_isCoopGhost == 0)) && (ppEVar7 != g_triggerDeathPlayersEnd)))) { do { pEVar6 = (Entity_Player *)0x0; if (*ppEVar7 != (Entity_Player *)0x0) { MorphToCoopGhost(*ppEVar7); pEVar6 = extraout_ECX_03; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } } tmpPlayer = *g_triggerDeathPlayers; if (tmpPlayer->_dead == 0) { if (((local_80 == (EntityPtr)0x3) && (tmpPlayer->_playerType != 0xc)) && (bVar2 = HasCollectible(tmpPlayer,0x26b,0), pEVar6 = extraout_ECX_26, bVar2 != 0)) { tmpPlayer = *g_triggerDeathPlayers; bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0x1db); pEVar6 = extraout_ECX_27; if (bVar2 != 0) { pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((0x76c < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 & 0xfffffffcU)) && (iVar11 = *(int *)((int)pvVar8 + 0x76c), iVar11 != 0)) { effectKey[2] = *(undefined4 *)(iVar11 + 0x78); effectKey[1] = 0; local_68 = 0; effectKey[0] = iVar11; TemporaryEffects::RemoveEffect(&tmpPlayer->_temporaryeffects,effectKey,-1); } (*g_triggerDeathPlayers)->_maxHearts = 0; (*g_triggerDeathPlayers)->_redHearts = 0; (*g_triggerDeathPlayers)->_playerType = 0xc; pEVar9->_cacheFlags = pEVar9->_cacheFlags | 0xffff; update_player_skin(pEVar9); EvaluateItems(); TryPreventDeath(pEVar9); pEVar6 = extraout_ECX_28; } } RemoveCollectible(*g_triggerDeathPlayers,local_80,pEVar6); ppEVar7 = g_triggerDeathPlayersEnd; playerIter = g_triggerDeathPlayers; if (g_triggerDeathPlayers == g_triggerDeathPlayersEnd) { return 1; } do { pEVar9 = *playerIter; if (pEVar9 != (Entity_Player *)0x0) { pvVar8 = (pEVar9->_collectibleRNGs)._end; if ((int)((int)pvVar8 - (int)(pEVar9->_collectibleRNGs)._begin & 0xfffffff0U) < 0xd41) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); pvVar8 = (pEVar9->_collectibleRNGs)._end; } rngArray = (pEVar9->_collectibleRNGs)._begin; uVar3 = ((int)pvVar8 - (int)rngArray >> 4) - 1; uVar10 = 0xd4; if (uVar3 < 0xd4) { uVar10 = uVar3; } puVar12 = (uint *)(uVar10 * 0x10 + (int)rngArray); uVar3 = *puVar12; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *puVar12; if (uVar3 == 0) { pcVar1 = (code *)swi(3); bVar2 = (*pcVar1)(); return bVar2; } } uVar3 = uVar3 >> ((byte)puVar12[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)puVar12[2] & 0x1f) ^ uVar3; *puVar12 = uVar3 >> ((byte)puVar12[3] & 0x1f) ^ uVar3; pvVar8 = (pEVar9->_trinketRNGs)._end; if ((int)((int)pvVar8 - (int)(pEVar9->_trinketRNGs)._begin & 0xfffffff0U) < 0x1c1) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar8 = (pEVar9->_trinketRNGs)._end; } rngArray = (pEVar9->_trinketRNGs)._begin; uVar3 = ((int)pvVar8 - (int)rngArray >> 4) - 1; if (0x1c < uVar3) { uVar3 = 0x1c; } puVar12 = (uint *)(uVar3 * 0x10 + (int)rngArray); uVar3 = *puVar12; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *puVar12; if (uVar3 == 0) { pcVar1 = (code *)swi(3); bVar2 = (*pcVar1)(); return bVar2; } } uVar3 = uVar3 >> ((byte)puVar12[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)puVar12[2] & 0x1f) ^ uVar3; *puVar12 = uVar3 >> ((byte)puVar12[3] & 0x1f) ^ uVar3; init_forgotten_twin(pEVar9); UpdateCanShoot(pEVar9); (**(code **)(*(int *)pEVar9 + 0x60))(); ppEVar7 = g_triggerDeathPlayersEnd; } playerIter = playerIter + 1; } while (playerIter != ppEVar7); return 1; } parentPlayer = tmpPlayer->_parent; if (((parentPlayer == (EntityPtr)0x0) || (tmpPlayer->_variant != 0)) || (*(int *)((int)parentPlayer + 0x28) != 1)) { PlayerManager::trigger_coop_baby_death(pEVar9); pEVar9->_visible = 0; return 1; } local_7c.x = (float)&tmpPlayer->_temporaryeffects; bVar2 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)local_7c.x,0x29b); manager = g_manager; if (bVar2 != 0) { pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((0xa6c < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 & 0xfffffffcU) ) && (iVar11 = *(int *)((int)pvVar8 + 0xa6c), iVar11 != 0)) { effectKey[2] = *(undefined4 *)(iVar11 + 0x78); effectKey[1] = 0; local_68 = 0; effectKey[0] = iVar11; TemporaryEffects::RemoveEffect((TemporaryEffects *)local_7c.x,effectKey,-1); pvVar8 = extraout_ECX_04; } PlayerManager::RemoveCoPlayer(&g_game->_playerManager,*g_triggerDeathPlayers,(byte)pvVar8); RemoveCollectible((Entity_Player *)parentPlayer,0x29b,0,0,1); iVar11 = 5; do { iVar5 = iVar11; local_7c.x = ((*g_triggerDeathPlayers)->_pos).x; local_7c.y = ((*g_triggerDeathPlayers)->_pos).y; *(int *)((int)parentPlayer + 0x1370) = *(int *)((int)parentPlayer + 0x1370) + 1; spawn_blue_spider(&local_7c,(Entity *)parentPlayer,&g_vectorZero); manager = g_manager; iVar11 = iVar5 + -1; } while (iVar11 != 0); iVar11 = (*g_triggerDeathPlayers)->_playerType; if ((iVar11 == 0x10) || (iVar11 == 0x23)) { local_84 = (Entity_Player *)0x1b; seed_fart_sound_override((int *)&local_84); SoundEffects::Play(&manager->_sfxManager,(int)local_84,1.0,2,0,1.0,0.0); gibColor._offset[0] = 0.0; gibColor._tint[0] = 1.0; gibColor._tint[1] = 1.0; gibColor._tint[2] = 1.0; gibColor._tint[3] = 1.0; gibColor._offset[1] = 0.0; gibColor._offset[2] = 0.0; gibColor._colorize[0] = 0.0; gibColor._colorize[1] = 0.0; gibColor._colorize[2] = 0.0; gibColor._colorize[3] = 0.0; local_7c.x = 2.10195e-44; spawn_gibs(&(*g_triggerDeathPlayers)->_pos,0xe,80.0,(uint *)&local_7c,(Entity *)pEVar9, (ColorMod *)&gibColor,&g_vectorZero,1.0); return 1; } if (((iVar11 == 10) || (iVar11 == 0x1f)) || (iVar11 == 0x27)) { local_84 = (Entity_Player *)0x50; seed_fart_sound_override((int *)&local_84); SoundEffects::Play(&manager->_sfxManager,(int)local_84,1.0,2,0,1.0,0.0); uVar3 = Random(); Game::SpawnEx(g_game,1000,0xf,&(*g_triggerDeathPlayers)->_pos,&g_vectorZero,(Entity *)0x0,0, uVar3,0); return 1; } local_84 = (Entity_Player *)0x1e; seed_fart_sound_override((int *)&local_84); SoundEffects::Play(&manager->_sfxManager,(int)local_84,1.0,2,0,1.0,0.0); uVar3 = Random(); Game::SpawnEx(g_game,1000,2,&(*g_triggerDeathPlayers)->_pos,&g_vectorZero,(Entity *)0x0,3,uVar3, 0); Color::Color(&gibColor); local_7c.x = 9.80909e-45; spawn_gibs(&pEVar9->_pos,iVar5 + 7,80.0,(uint *)&local_7c,(Entity *)pEVar9,color,&g_vectorZero, 1.0); return 1; } iVar11 = tmpPlayer->_playerType; if ((iVar11 == 0x10) || (iVar11 == 0x23)) { local_84 = (Entity_Player *)0x1b; seed_fart_sound_override((int *)&local_84); SoundEffects::Play(&manager->_sfxManager,(int)local_84,1.25,2,0,1.0,0.0); Color::Color(&boneGibColor); local_80 = (EntityPtr)0xf; puVar12 = (uint *)&local_80; iVar11 = 0xe; color_00 = extraout_EAX_00; } else { bVar2 = extraout_CL; if (((iVar11 == 10) || (iVar11 == 0x1f)) || (iVar11 == 0x27)) goto LAB_007a1f38; local_84 = (Entity_Player *)0x1e; seed_fart_sound_override((int *)&local_84); SoundEffects::Play(&manager->_sfxManager,(int)local_84,1.0,2,0,1.0,0.0); uVar3 = Random(); Game::SpawnEx(g_game,1000,2,&pEVar9->_pos,&g_vectorZero,(Entity *)0x0,2,uVar3,0); Color::Color(&gibColor); iVar11 = 8; local_7c.x = (float)&DAT_00000007; puVar12 = (uint *)&local_7c; color_00 = extraout_EAX; } spawn_gibs(&pEVar9->_pos,iVar11,80.0,puVar12,(Entity *)pEVar9,color_00,&g_vectorZero,1.0); bVar2 = extraout_CL_00; LAB_007a1f38: PlayerManager::RemoveCoPlayer(&g_game->_playerManager,*g_triggerDeathPlayers,bVar2); return 1; LAB_007a15d3: if (pEVar9 == (Entity_Player *)0x0) goto LAB_007a12d4; if (checkOnly != 0) { return 1; } bVar2 = TemporaryEffects::HasNullEffect(&pEVar9->_temporaryeffects,0x71); if (bVar2 == 0) { pEVar6 = (Entity_Player *)0x0; piVar4 = pEVar9->_pocketSlots; LAB_007a1630: if ((piVar4[1] != 1) || (*piVar4 != 0x59)) goto LAB_007a163b; if (pEVar6 < (Entity_Player *)0x3) { pocketCopySrc = (pEVar9->_sprite)._filename._buf + (int)&pEVar6->_baitedCountdown * 8 + -0x40; pocketCopyDst = (undefined4 *) ((int)(&(pEVar9->_sprite)._filename + -3) + (int)&pEVar6->_baitedCountdown * 8); for (uVar3 = (3 - (int)pEVar6) * 2 & 0x3ffffffe; pEVar6 = (Entity_Player *)0x0, uVar3 != 0; uVar3 = uVar3 - 1) { *pocketCopyDst = *(undefined4 *)pocketCopySrc; pocketCopySrc = pocketCopySrc + 4; pocketCopyDst = pocketCopyDst + 1; } } pEVar9->_pocketSlots[6] = 0; pEVar9->_pocketSlots[7] = 1; goto LAB_007a1683; } pEVar6 = extraout_ECX_05; ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { pEVar6 = (Entity_Player *)0x0; if (*ppEVar7 != (Entity_Player *)0x0) { TemporaryEffects::RemoveNullEffect(&(*ppEVar7)->_temporaryeffects,0x71,1); pEVar6 = extraout_ECX_06; } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } LAB_007a1683: ppEVar7 = g_triggerDeathPlayers; if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) { do { pEVar9 = *ppEVar7; if (pEVar9 != (Entity_Player *)0x0) { if (-1 < pEVar9->_playerIndex) { Revive(pEVar9); } pEVar9->_soulHearts = 0; pEVar9->_blackHearts = 0; pEVar9->_eternalHearts = 0; pEVar9->_boneHeartsMask = 0; pEVar9->_boneHearts = 0; pEVar9->_rottenHearts = 0; if (pEVar9->_maxHearts < 1) { iVar11 = GetHealthType(pEVar9); if (iVar11 == 4) { pEVar9->_redHearts = 0; AddBoneHearts(pEVar9,1); } else { iVar11 = GetHealthType(pEVar9); if (iVar11 == 3) { pEVar9->_redHearts = 2; pEVar9->_maxHearts = 2; } else if (pEVar9->_playerType == 0x12) { pEVar9->_maxHearts = 2; pEVar9->_redHearts = 1; } else { pEVar9->_redHearts = 0; pEVar9->_soulHearts = 1; } } } else { pEVar9->_redHearts = 1; iVar11 = GetHealthType(pEVar9); if (iVar11 == 3) { pEVar9->_redHearts = 2; } } pvVar8 = pEVar9->_forgottenBody; pEVar9->_visible = 1; pEVar9->_damageCooldown = 0x5a; if (pvVar8 != (void *)0x0) { forgottenBodyY = *(float *)((int)pvVar8 + 0x340); (pEVar9->_pos).x = *(float *)((int)pvVar8 + 0x33c); (pEVar9->_pos).y = forgottenBodyY; } UpdateHeartDependentEffects(pEVar9); pEVar6 = extraout_ECX_07; if (((*(int *)&g_game->_deathmatchManager < 2) && (pEVar9->_dead == 0)) && (iVar11 = pEVar9->_goldenHearts, 0 < iVar11)) { iVar5 = pEVar9->_redHearts; if (pEVar9->_maxHearts < pEVar9->_redHearts) { iVar5 = pEVar9->_maxHearts; } pEVar6 = (Entity_Player *) ((iVar5 + 1) / 2 + (pEVar9->_soulHearts + 1) / 2 + pEVar9->_boneHearts); local_7c.x = (float)pEVar6; if ((int)pEVar6 < iVar11) { BreakGoldenHearts(pEVar9,iVar11 - (int)pEVar6); pEVar9->_goldenHearts = (int)local_7c.x; pEVar6 = extraout_ECX_08; } } } ppEVar7 = ppEVar7 + 1; } while (ppEVar7 != g_triggerDeathPlayersEnd); } LAB_007a1331: pEVar9 = local_84; goto LAB_007a1335; LAB_007a163b: pEVar6 = (Entity_Player *)&pEVar6->field_0x1; piVar4 = piVar4 + 2; if ((undefined1 *)0x3 < pEVar6) goto LAB_007a1683; goto LAB_007a1630; } //@@ 007a2220 Entity_Player::Revive /* ZHL [exact] __thiscall void Entity_Player::Revive(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::Revive(Entity_Player *this) { uint *puVar1; EntityPtr EVar2; qword qVar3; int iVar4; Vector *pVVar5; LayerState *pLVar6; int iVar7; Vector local_10; if (this->_dead != 0) { this->_dead = 0; this->_damageCooldown = 1; iVar4 = GetHeartLimit(this,0); if (iVar4 < 1) { iVar7 = this->_brokenHearts + -1; iVar4 = 0; if (0 < iVar7) { iVar4 = iVar7; } this->_brokenHearts = iVar4; } if (this->_maxHearts < 1) { if (this->_boneHearts < 1) { this->_redHearts = 0; this->_soulHearts = 1; } } else { this->_redHearts = 1; this->_soulHearts = 0; } if ((this->_variant == 1) || (this->_isCoopGhost != 0)) { PlayExtraAnimation(this,(byte *)"Appear"); local_10.x = (this->_pos).x; local_10.y = (this->_pos).y; pVVar5 = PlayerManager::find_safe_spawn_position(&local_10,this->_pos); (this->_pos).x = pVVar5->x; (this->_pos).y = pVVar5->y; this->_damageCooldown = 0x96; } if (this->_playerType == 0x23) { EVar2 = this->_twinPlayer; if (EVar2 != (EntityPtr)0x0) { if (*(Entity_Player **)((int)EVar2 + 0x1410) == this) { if (*(Entity_Player **)((int)EVar2 + 0x1410) != (Entity_Player *)0x0) { local_10.x = (float)((int)EVar2 + 0x1410); std::multiset::erase(&local_10); } *(undefined4 *)((int)EVar2 + 0x1410) = 0; qVar3 = this->_flags; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & 0xf9ffffff; *(int *)&this->_flags = (int)qVar3; } } this->_cacheFlags = 0xffff; *(undefined4 *)&this->field_0x13f0 = 0; *(undefined4 *)&this->field_0x13f4 = 0; *(undefined4 *)&this->field_0x13f8 = 0; *(undefined4 *)&this->field_0x13fc = 0; this->field_0x1400 = 0; EvaluateItems(); } pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0xc); pLVar6->_visible = 1; } return; } //@@ 007a23a0 LuaEngine::RunScript /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix73/77] __thiscall void LuaEngine::RunScript(const char *path); */ void __thiscall LuaEngine::RunScript(LuaEngine *this,int param_2,char param_3) { Vector *position; LuaEngine LVar1; int *piVar2; bool bVar3; Game *pGVar4; Manager *pMVar5; byte bVar6; uint uVar7; ItemConfig_Item *pIVar8; ColorMod *color; ColorMod *color_00; ColorMod *color_01; ColorMod *color_02; Entity *pEVar9; LuaEngine *pLVar10; LuaEngine *pLVar11; Entity_Player *this_00; Entity_Player *this_01; void *pvVar12; Entity_Player *this_02; Color *this_03; LuaEngine LVar13; uint uVar14; int iVar15; float fVar16; LuaEngine local_ac; Color local_a8; Color local_7c; undefined1 local_50 [28]; float local_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00aff8fd; local_1c = ExceptionList; puStack_20 = local_50 + 0x4c; uVar7 = __security_cookie ^ (uint)(local_50 + 0x40); local_24 = uVar7; ExceptionList = &local_1c; local_ac = (LuaEngine)this; if (-1 < (int)this[0x587]) { Entity_Player::Revive((Entity_Player *)this); } piVar2 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if (((piVar2 == (int *)0x0) || (piVar2[2] != 0x10)) || (bVar3 = true, *piVar2 != 0x23)) { bVar3 = false; } if (param_2 < 0x138) { if (param_2 == 0x137) { Entity_Player::RemoveSkinCostume((Entity_Player *)this); this[0x4d0] = (LuaEngine)0x0; this[0x4d1] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; if (this[0x4f0] != (LuaEngine)0x18) { this[0x4f0] = (LuaEngine)0xc; } this[0x4d3] = (LuaEngine)0x4; this[0x4d4] = (LuaEngine)0xffffffff; Entity_Player::UpdateBlackHeartMask((Entity_Player *)this); this[0x55d] = (LuaEngine)((uint)this[0x55d] | 0xffff); Entity_Player::EvaluateItems(uVar7); Entity_Player::update_player_skin((Entity_Player *)this); if (param_3 != '\0') { if (this[0xef] == (LuaEngine)0x0) { if (!bVar3) { iVar15 = 9; goto LAB_007a29c3; } } else { this[0x5c].field_0x1 = 1; this[0x4ef] = (LuaEngine)0x78; Entity_Player::AnimateCollectible ((Entity_Player *)this,0x137,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } } } else { switch(param_2) { case 0xb: this[0x4d3] = (LuaEngine)0x0; this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; iVar15 = Entity_Player::GetHealthType((Entity_Player *)this); if (iVar15 == 1) { this[0x4d0] = (LuaEngine)0x0; iVar15 = FUN_0069bd10(); *(LuaEngine *)((int)local_ac + 0x134c) = *(LuaEngine *)(iVar15 + 0xb4); iVar15 = FUN_0069bd10(); this = (LuaEngine *)local_ac; Entity_Player::AddBlackHearts((Entity_Player *)local_ac,*(int *)(iVar15 + 0xb8)); } else if (iVar15 == 4) { this[0x4d1] = (LuaEngine)0x0; iVar15 = FUN_0069bd10(); Entity_Player::AddBoneHearts((Entity_Player *)this,*(int *)(iVar15 + 0xb0) / 2); } else if (this[0x4d0] == (LuaEngine)0x0) { if (iVar15 == 3) { this[0x4d1] = (LuaEngine)0x2; this[0x4d0] = (LuaEngine)0x2; } else if (this[0x4f0] == (LuaEngine)0x12) { this[0x4d0] = (LuaEngine)0x2; this[0x4d1] = (LuaEngine)0x1; } else { this[0x4d1] = (LuaEngine)0x0; this[0x4d3] = (LuaEngine)0x1; } } Entity_Player::SetFullHearts((Entity_Player *)this); if (param_3 != '\0') { if (*(EntityPtr *)((int)this + 0x3bc) == (EntityPtr)0x0) { if (!bVar3) { iVar15 = 7; LAB_007a29c3: pGVar4 = g_game; uVar7 = g_game->_enterDoor; if ((int)uVar7 < 0) { uVar14 = 0xffffffff; } else { uVar14 = uVar7; if (6 < (int)uVar7) { uVar14 = 7; } } g_game->_leaveDoor = uVar14; uVar7 = uVar7 & 0x80000003; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffc) + 1; } Game::StartRoomTransition (pGVar4,pGVar4->_lastRoomIdx,uVar7,iVar15,(Entity_Player *)this,-1); goto LAB_007a32b9; } } else { *(byte *)((int)this + 0x171) = 1; *(int *)((int)this + 0x13bc) = 0x78; Entity_Player::AnimateCollectible ((Entity_Player *)this,0xb,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } } break; default: switchD_007a244f_caseD_c: pIVar8 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_2); ItemConfig_Item::GetLocalizedName(pIVar8,(std_string *)(local_50 + 0x14),0); local_14 = 0; KAGE_LogMessage(4,(byte *)"No revival effect associated with collectible %d (%s)\n"); local_14 = 0xffffffff; if (0xf < (uint)local_28) { uVar7 = (int)local_28 + 1; pvVar12 = (void *)local_50._20_4_; if (0xfff < uVar7) { pvVar12 = *(void **)(local_50._20_4_ + -4); uVar7 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar7); } break; case 0x51: this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; iVar15 = Entity_Player::GetHealthType((Entity_Player *)this); if (iVar15 == 1) { this[0x4d0] = (LuaEngine)0x0; this[0x4d3] = (LuaEngine)0x2; } else { if (iVar15 == 4) { this[0x4d3] = (LuaEngine)0x0; Entity_Player::AddBoneHearts(this_00,1); } else { if (iVar15 == 2) { this[0x4d3] = (LuaEngine)0x1; goto LAB_007a267e; } this[0x4d0] = (LuaEngine)0x2; this[0x4d3] = (LuaEngine)0x0; } this[0x4d1] = (LuaEngine)0x2; } LAB_007a267e: if (this[0x766] != (LuaEngine)0x0) { RunScript(); } if (param_3 != '\0') { if (this[0xef] == (LuaEngine)0x0) { if (!bVar3) { iVar15 = 6; goto LAB_007a29c3; } } else { this[0x5c].field_0x1 = 1; this[0x4ef] = (LuaEngine)0x78; Entity_Player::AnimateCollectible ((Entity_Player *)this,0x51,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } } break; case 0xa1: Entity_Player::RemoveSkinCostume((Entity_Player *)this); this[0x4d3] = (LuaEngine)0x6; this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; this[0x4d0] = (LuaEngine)0x0; this[0x4d1] = (LuaEngine)0x0; if (this[0x4f0] != (LuaEngine)0x19) { this[0x4f0] = (LuaEngine)0x4; } this[0x55d] = (LuaEngine)((uint)this[0x55d] | 0xffff); Entity_Player::EvaluateItems(uVar7); Entity_Player::update_player_skin((Entity_Player *)this); if (param_3 != '\0') { if (this[0xef] == (LuaEngine)0x0) { if (!bVar3) { iVar15 = 5; goto LAB_007a29c3; } } else { this[0x5c].field_0x1 = 1; this[0x4ef] = (LuaEngine)0x78; Entity_Player::AnimateCollectible ((Entity_Player *)this,0xa1,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } } break; case 0xd4: this[0x4d3] = (LuaEngine)0x0; this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; if ((int)this[0x4d0] < 1) { iVar15 = Entity_Player::GetHealthType((Entity_Player *)this); if (iVar15 == 4) { this[0x4d1] = (LuaEngine)0x0; Entity_Player::AddBoneHearts(this_01,1); } else { iVar15 = Entity_Player::GetHealthType(this_01); if (iVar15 == 3) { this[0x4d1] = (LuaEngine)0x2; this[0x4d0] = (LuaEngine)0x2; } else if (this[0x4f0] == (LuaEngine)0x12) { this[0x4d0] = (LuaEngine)0x2; this[0x4d1] = (LuaEngine)0x1; } else { this[0x4d1] = (LuaEngine)0x0; this[0x4d3] = (LuaEngine)0x1; } } } else { this[0x4d1] = (LuaEngine)0x1; iVar15 = Entity_Player::GetHealthType((Entity_Player *)this); if (iVar15 == 3) { this[0x4d1] = (LuaEngine)0x2; } } if (param_3 != '\0') { if (this[0xef] == (LuaEngine)0x0) { if (!bVar3) { iVar15 = 8; goto LAB_007a29c3; } } else { this[0x5c].field_0x1 = 1; this[0x4ef] = (LuaEngine)0x78; Entity_Player::AnimateCollectible ((Entity_Player *)this,0xd4,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } } } } } else if (param_2 == 0x14c) { if (this[0x4f0] != (LuaEngine)0x8) { if (this[0x4f0] != (LuaEngine)0x23) { Entity_Player::RemoveSkinCostume((Entity_Player *)this); } pvVar12 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar12 & 0xfffffffcU) < 0x531) { pIVar8 = (ItemConfig_Item *)0x0; } else { pIVar8 = *(ItemConfig_Item **)((int)pvVar12 + 0x530); } Entity_Player::AddCostume((Entity_Player *)this,pIVar8,0); } this[0x4d3] = (LuaEngine)0x0; this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; LVar13 = (LuaEngine)0x2; if (2 < (int)this[0x4d0] + -2) { LVar13 = (LuaEngine)((int)this[0x4d0] + -2); } this[0x763] = (LuaEngine)0x0; this[0x4d0] = LVar13; this[0x762] = (LuaEngine)0x0; pLVar10 = &local_ac; if ((int)LVar13 < 3) { pLVar10 = this + 0x4d0; } this[0x769] = (LuaEngine)0x0; local_ac = (LuaEngine)0x2; this[0x4d1] = *pLVar10; bVar6 = Entity_Player::HasCollectible((Entity_Player *)this,0x26b,0); if ((bVar6 != 0) && (this[0x4f0] == (LuaEngine)0x8)) { this[0x79d] = (LuaEngine)0x708; } if ((this[0x4f0] != (LuaEngine)0x1d) && (this[0x4f0] != (LuaEngine)0x26)) { this[0x4f0] = (LuaEngine)0xb; } pMVar5 = g_manager; this[0x55d] = (LuaEngine)((uint)this[0x55d] | 0xffff); pvVar12 = (pMVar5->_itemConfig)._nullItems._begin; if ((0xc4 < (int)((int)(pMVar5->_itemConfig)._nullItems._end - (int)pvVar12 & 0xfffffffcU)) && (fVar16 = *(float *)((int)pvVar12 + 0xc4), fVar16 != 0.0)) { local_2c = *(float *)((int)fVar16 + 0x78); local_30 = 0.0; local_28 = 0.0; local_34 = fVar16; TemporaryEffects::AddEffect((TemporaryEffects *)(this + 0x542),&local_34,1,1); } Entity_Player::update_player_skin((Entity_Player *)this); Entity_Player::EvaluateItems(); LVar13 = this[0x767]; this[0x5c].field_0x1 = 1; if (LVar13 != (LuaEngine)0x0) { LVar1 = *(LuaEngine *)((int)LVar13 + 0x340); this[0xcf] = *(LuaEngine *)((int)LVar13 + 0x33c); this[0xd0] = LVar1; } uVar7 = Random(); pEVar9 = Game::Spawn(g_game,1000,0xf,(Vector *)(this + 0xcf),&g_vectorZero,(Entity *)this,3, uVar7); iVar15 = __RTDynamicCast(pEVar9); *(float *)(iVar15 + 0x358) = (float)this[0xd4] + 1.0; } else if (param_2 == 0x26b) { this[0x4d3] = (LuaEngine)0x1; this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; this[0x4d0] = (LuaEngine)0x0; this[0x5c].field_0x1 = 1; this[0x4ef] = (LuaEngine)0x5a; Entity_Player::AnimateCollectible ((Entity_Player *)this,0x26b,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); uVar7 = Random(); pEVar9 = Game::Spawn(g_game,1000,0x90,(Vector *)(this + 0xcf),&g_vectorZero,(Entity *)0x0,2, uVar7); uVar7 = Random(); (pEVar9->_sprite)._rotation = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 360.0; iVar15 = *(int *)pEVar9; fVar16 = g_vectorOne.x * 1.5; (pEVar9->_sprite)._scale.y = g_vectorOne.y * 1.5; (pEVar9->_sprite)._scale.x = fVar16; (**(code **)(iVar15 + 0x40))(); (**(code **)(*(int *)pEVar9 + 0xc))(); pMVar5 = g_manager; local_ac = (LuaEngine)0x50; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.0,2,0,1.0,0.0); pMVar5 = g_manager; local_ac = (LuaEngine)0x10a; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,0xe); } else { if (param_2 != 0x2b0) goto switchD_007a244f_caseD_c; TemporaryEffects::AddCollectibleEffect((TemporaryEffects *)(this + 0x542),0x2b0,1,1); this[0x4d3] = (LuaEngine)0x0; this[0x4d4] = (LuaEngine)0x0; this[0x4d2] = (LuaEngine)0x0; this[0x763] = (LuaEngine)0x0; this[0x762] = (LuaEngine)0x0; this[0x769] = (LuaEngine)0x0; if ((int)this[0x4d0] < 1) { iVar15 = Entity_Player::GetHealthType((Entity_Player *)this); if (iVar15 == 4) { this[0x4d1] = (LuaEngine)0x0; Entity_Player::AddBoneHearts(this_02,1); } else { iVar15 = Entity_Player::GetHealthType(this_02); if (iVar15 == 3) { this[0x4d1] = (LuaEngine)0x2; this[0x4d0] = (LuaEngine)0x2; } else if (this[0x4f0] == (LuaEngine)0x12) { this[0x4d0] = (LuaEngine)0x2; this[0x4d1] = (LuaEngine)0x1; } else { this[0x4d1] = (LuaEngine)0x0; this[0x4d3] = (LuaEngine)0x1; } } } else { this[0x4d1] = (LuaEngine)0x1; iVar15 = Entity_Player::GetHealthType((Entity_Player *)this); if (iVar15 == 3) { this[0x4d1] = (LuaEngine)0x2; } } LVar13 = this[0x767]; this[0x5c].field_0x1 = 1; this[0x4ef] = (LuaEngine)0x5a; if (LVar13 != (LuaEngine)0x0) { LVar1 = *(LuaEngine *)((int)LVar13 + 0x340); this[0xcf] = *(LuaEngine *)((int)LVar13 + 0x33c); this[0xd0] = LVar1; } pMVar5 = g_manager; LVar13 = this[0x4f0]; if ((LVar13 == (LuaEngine)0x10) || (LVar13 == (LuaEngine)0x23)) { local_ac = (LuaEngine)0x1b; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.25,2,0,1.0,0.0); pMVar5 = g_manager; local_ac = (LuaEngine)0x50; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.0,2,0,1.0,0.0); Color::Color(&local_7c); local_ac = (LuaEngine)0xf; iVar15 = 0x7a2e79; spawn_gibs((Vector *)(this + 0xcf),0xe,80.0,(uint *)&local_ac,(Entity *)this,color_01, &g_vectorZero,1.0); this_03 = &local_a8; LAB_007a2e82: Color::Color(this_03); Entity::MakeGroundPoof((Entity *)this,(Vector *)(this + 0xcf),color_02,1.0); } else { if (((LVar13 == (LuaEngine)0xa) || (LVar13 == (LuaEngine)0x1f)) || (LVar13 == (LuaEngine)0x27) ) { local_ac = (LuaEngine)0x50; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.0,2,0,1.0,0.0); uVar7 = Random(); iVar15 = 0xf; Game::Spawn(g_game,1000,0xf,(Vector *)(this + 0xcf),&g_vectorZero,(Entity *)0x0,0,uVar7); this_03 = &local_7c; goto LAB_007a2e82; } local_ac = (LuaEngine)0x1c; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.25,2,0,1.0,0.0); pMVar5 = g_manager; local_ac = (LuaEngine)0x50; seed_fart_sound_override((int *)&local_ac); SoundEffects::Play(&pMVar5->_sfxManager,(int)local_ac,1.0,2,0,1.0,0.0); uVar7 = Random(); position = (Vector *)(this + 0xcf); Game::Spawn(g_game,1000,2,position,&g_vectorZero,(Entity *)0x0,3,uVar7); Color::Color((Color *)local_50); local_ac = (LuaEngine)0x7; iVar15 = 0x7a2d08; spawn_gibs(position,0xe,80.0,(uint *)&local_ac,(Entity *)this,color,&g_vectorZero,1.0); Color::Color((Color *)local_50); Entity::MakeBloodPoof((Entity *)this,position,color_00,1.0); } pGVar4 = g_game; this[0x7bf] = (LuaEngine)0x40c00000; Game::ShakeScreen(pGVar4,6); Game::DamageRadius((Vector *)(this + 0xcf),(Entity *)this,0,0,iVar15,50.0,g_tearFlagsNone,35.0, 60.0); } pLVar10 = (LuaEngine *)((int)this + 0x13bc); *(byte *)((int)this + 0x171) = 1; local_ac = (LuaEngine)0x5a; pLVar11 = &local_ac; if (0x59 < (int)*pLVar10) { pLVar11 = pLVar10; } *pLVar10 = *pLVar11; LAB_007a32b9: Entity_Player::UpdateHeartDependentEffects((Entity_Player *)this); if (((*(int *)&g_game->_deathmatchManager < 2) && (*(byte *)((int)this + 0x173) == 0)) && (0 < *(int *)((int)this + 0x194c))) { iVar15 = *(int *)((int)this + 0x1344); if (*(int *)((int)this + 0x1340) < *(int *)((int)this + 0x1344)) { iVar15 = *(int *)((int)this + 0x1340); } iVar15 = (iVar15 + 1) / 2 + (*(int *)((int)this + 0x134c) + 1) / 2 + *(int *)((int)this + 0x1d88); if (iVar15 < *(int *)((int)this + 0x194c)) { Entity_Player::BreakGoldenHearts((Entity_Player *)this,*(int *)((int)this + 0x194c) - iVar15); *(int *)((int)this + 0x194c) = iVar15; } } ExceptionList = local_1c; return; } //@@ 007a3430 Entity_Player::ReviveFromTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "No revival effect associated with trinket %d"; ZHL had put the name on 00923920 NetplayManager::update_text_popup void Entity_Player::ReviveFromTrinket(uint param_1) { int *piVar1; uint uVar2; int *cooldownSource; Entity_Player *in_ECX; ItemConfig_Item *trinketConfig; void *pvVar3; uint leaveDoor; int heartTotal; int iVar4; int minCooldown; void *trinketName [5]; uint trinketNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; Game *game; bool isBeastRoom; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff10d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(trinketName + 10); ExceptionList = &local_10; local_14 = uVar2; if (-1 < in_ECX->_playerIndex) { Revive(in_ECX); } piVar1 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if (((piVar1 == (int *)0x0) || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) { isBeastRoom = false; } else { isBeastRoom = true; } if (param_1 == 0x17) { RemoveSkinCostume(in_ECX); in_ECX->_maxHearts = 0; in_ECX->_redHearts = 0; in_ECX->_soulHearts = 1; in_ECX->_blackHearts = 0; in_ECX->_boneHeartsMask = 0; in_ECX->_boneHearts = 0; in_ECX->_rottenHearts = 0; in_ECX->_eternalHearts = 0; if (in_ECX->_playerType != 0x1f) { in_ECX->_playerType = 10; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff; EvaluateItems(uVar2); update_player_skin(in_ECX); if (in_ECX->_parent == (EntityPtr)0x0) { if (!isBeastRoom) { iVar4 = 0xe; LAB_007a3769: game = g_game; uVar2 = g_game->_enterDoor; if ((int)uVar2 < 0) { leaveDoor = 0xffffffff; } else { leaveDoor = uVar2; if (6 < (int)uVar2) { leaveDoor = 7; } } g_game->_leaveDoor = leaveDoor; uVar2 = uVar2 & 0x80000003; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffc) + 1; } Game::StartRoomTransition(game,game->_lastRoomIdx,uVar2,iVar4,in_ECX,-1); goto LAB_007a3558; } } else { in_ECX->_visible = 1; in_ECX->_damageCooldown = 0x78; AnimateTrinket(); } } else if (param_1 == 0x1c) { RemoveSkinCostume(in_ECX); in_ECX->_soulHearts = 6; in_ECX->_blackHearts = 0; in_ECX->_boneHeartsMask = 0; in_ECX->_boneHearts = 0; in_ECX->_rottenHearts = 0; in_ECX->_eternalHearts = 0; in_ECX->_maxHearts = 0; in_ECX->_redHearts = 0; if (in_ECX->_playerType != 0x19) { in_ECX->_playerType = 4; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff; EvaluateItems(uVar2); update_player_skin(in_ECX); if (in_ECX->_parent == (EntityPtr)0x0) { if (!isBeastRoom) { iVar4 = 5; goto LAB_007a3769; } } else { in_ECX->_visible = 1; in_ECX->_damageCooldown = 0x78; AnimateCollectible(in_ECX,0xa1,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } } else { pvVar3 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(param_1 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar3 >> 2) { trinketConfig = *(ItemConfig_Item **)((int)pvVar3 + (param_1 & 0x7fff) * 4); } else { trinketConfig = (ItemConfig_Item *)0x0; } ItemConfig_Item::GetLocalizedName(trinketConfig,(std_string *)trinketName,0); local_8 = (void *)0x0; KAGE_LogMessage(4,(byte *)"No revival effect associated with trinket %d (%s)\n"); local_8 = (void *)0xffffffff; if (0xf < trinketNameCapacity) { uVar2 = trinketNameCapacity + 1; pvVar3 = trinketName[0]; if (0xfff < uVar2) { pvVar3 = *(void **)((int)trinketName[0] + -4); uVar2 = trinketNameCapacity + 0x24; if (0x1f < (uint)((int)trinketName[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } } piVar1 = &in_ECX->_damageCooldown; in_ECX->_visible = 1; minCooldown = 0x5a; cooldownSource = &minCooldown; if (0x59 < *piVar1) { cooldownSource = piVar1; } *piVar1 = *cooldownSource; LAB_007a3558: UpdateHeartDependentEffects(in_ECX); if (((*(int *)&g_game->_deathmatchManager < 2) && (in_ECX->_dead == 0)) && (iVar4 = in_ECX->_goldenHearts, 0 < iVar4)) { heartTotal = in_ECX->_redHearts; if (in_ECX->_maxHearts < in_ECX->_redHearts) { heartTotal = in_ECX->_maxHearts; } heartTotal = (heartTotal + 1) / 2 + (in_ECX->_soulHearts + 1) / 2 + in_ECX->_boneHearts; if (heartTotal < iVar4) { BreakGoldenHearts(in_ECX,iVar4 - heartTotal); in_ECX->_goldenHearts = heartTotal; } } ExceptionList = local_10; return; } //@@ 007a37c0 Entity_Player::remove_twin /* DB: ? called from RemoveCollectible when the other twin (Esau for Jacob 0x13, Dead Lazarus 0x1d, The Soul 0x26) must go: TemporaryEffects::ClearEffects, AddCostume, PlayerManager::RemoveCoPlayer */ void Entity_Player::remove_twin(void) { int iVar1; ItemConfig_Item *item; int twinSmeltedTrinkets; byte extraout_CL; byte unusedBool; Entity_Player *in_ECX; void *pvVar2; Game *game; EntityPtr player; uint uVar3; EntityPtr *twinSlot; EntityPtr *local_c [2]; int *countSlot; bool isBackupPlayer; short *smeltedCount; isBackupPlayer = false; player = in_ECX->_twinPlayer; if (player == (EntityPtr)0x0) { player = (EntityPtr)in_ECX->_backupPlayer; if (player == (EntityPtr)0x0) { return; } isBackupPlayer = true; } TemporaryEffects::ClearEffects((TemporaryEffects *)((int)player + 0x1508),1); if (*(int *)((int)player + 0x13c0) != 0x28) { uVar3 = 0; if ((int)(in_ECX->_collectibleCounts)._end - (int)(in_ECX->_collectibleCounts)._begin >> 2 != 0) { game = g_game; do { if (game == (Game *)0x0) { if (-1 < (int)uVar3) goto LAB_007a386d; } else { if ((int)uVar3 < 0) { if (((int)uVar3 < 0) && ((int)~uVar3 < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)(game->_proceduralItemManager)._proceduralItems._begin >> 2)) { item = (ItemConfig_Item *) **(undefined4 **) ((int)(game->_proceduralItemManager)._proceduralItems._begin + ~uVar3 * 4); } else { item = (ItemConfig_Item *)0x0; } } else { LAB_007a386d: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)uVar3) goto LAB_007a38d8; item = *(ItemConfig_Item **)((int)pvVar2 + uVar3 * 4); } if (((item != (ItemConfig_Item *)0x0) && (item->type != 3)) && (local_c[0] = *(EntityPtr **)(*(int *)((int)player + 0x16c8) + uVar3 * 4), 0 < (int)local_c[0])) { countSlot = (int *)((int)(in_ECX->_collectibleCounts)._begin + uVar3 * 4); *countSlot = (int)(&local_c[0]->field_0x0 + *countSlot); game = g_game; *(undefined4 *)(*(int *)((int)player + 0x16c8) + uVar3 * 4) = 0; if (item->addCostumeOnPickup != 0) { AddCostume(in_ECX,item,0); game = g_game; } } } LAB_007a38d8: uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)(in_ECX->_collectibleCounts)._end - (int)(in_ECX->_collectibleCounts)._begin >> 2)); } pvVar2 = (in_ECX->_smeltedTrinkets)._begin; local_c[0] = (EntityPtr *)0x0; if ((int)(in_ECX->_smeltedTrinkets)._end - (int)pvVar2 >> 2 != 0) { do { twinSmeltedTrinkets = *(int *)((int)player + 0x1748); iVar1 = (int)local_c[0] * 4; if (((0 < *(short *)(twinSmeltedTrinkets + iVar1)) || (0 < *(short *)(twinSmeltedTrinkets + 2 + iVar1))) && ((*(short *)((int)pvVar2 + iVar1) < 1 && (*(short *)((int)pvVar2 + iVar1 + 2) < 1)))) { pvVar2 = (g_manager->_itemConfig)._trinkets._begin; if ((int)((uint)local_c[0] & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar2 >> 2) { item = *(ItemConfig_Item **)((int)pvVar2 + ((uint)local_c[0] & 0x7fff) * 4); } else { item = (ItemConfig_Item *)0x0; } AddCostume(in_ECX,item,0); pvVar2 = (in_ECX->_smeltedTrinkets)._begin; twinSmeltedTrinkets = *(int *)((int)player + 0x1748); } local_c[0] = (EntityPtr *)&local_c[0]->field_0x1; *(short *)((int)pvVar2 + iVar1) = *(short *)((int)pvVar2 + iVar1) + *(short *)(twinSmeltedTrinkets + iVar1); smeltedCount = (short *)((int)(in_ECX->_smeltedTrinkets)._begin + iVar1 + 2); *smeltedCount = *smeltedCount + *(short *)(iVar1 + 2 + *(int *)((int)player + 0x1748)); *(undefined4 *)(*(int *)((int)player + 0x1748) + iVar1) = 0; pvVar2 = (in_ECX->_smeltedTrinkets)._begin; } while (local_c[0] < (undefined1 *)((int)(in_ECX->_smeltedTrinkets)._end - (int)pvVar2 >> 2)) ; } uVar3 = 0; pvVar2 = (in_ECX->_pillEffectUses)._begin; if ((int)(in_ECX->_pillEffectUses)._end - (int)pvVar2 >> 2 != 0) { do { iVar1 = *(int *)(*(int *)((int)player + 0x16d4) + uVar3 * 4); if (0 < iVar1) { countSlot = (int *)((int)pvVar2 + uVar3 * 4); *countSlot = *countSlot + iVar1; *(undefined4 *)(*(int *)((int)player + 0x16d4) + uVar3 * 4) = 0; } uVar3 = uVar3 + 1; pvVar2 = (in_ECX->_pillEffectUses)._begin; } while (uVar3 < (uint)((int)(in_ECX->_pillEffectUses)._end - (int)pvVar2 >> 2)); } std::vector<4byte>::insert_range ((in_ECX->_voidedCollectibles)._end,*(undefined4 *)((int)player + 0x1754), *(undefined4 *)((int)player + 0x1758),local_c[0]); std::vector<8byte>::insert_range ((in_ECX->_voidedPassives)._end,*(undefined4 *)((int)player + 0x1760), *(undefined4 *)((int)player + 0x1764),local_c[0]); History::merge((int)player + 0x1dec); in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff; (in_ECX->_temporaryeffects)._shouldEvaluateCache = 1; } twinSlot = &in_ECX->_twinPlayer; if (isBackupPlayer) { (**(code **)(*(int *)in_ECX->_backupPlayer + 0x44))(); if (in_ECX->_backupPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_backupPlayer)(1); in_ECX->_backupPlayer = (void *)0x0; return; } } else { unusedBool = 0; if (*twinSlot != (EntityPtr)0x0) { local_c[0] = twinSlot; std::multiset::erase(local_c); *twinSlot = (EntityPtr)0x0; unusedBool = extraout_CL; } PlayerManager::RemoveCoPlayer(&g_game->_playerManager,(Entity_Player *)player,unusedBool); } return; } //@@ 007a3af0 Entity_Player::AddPocketItem /* ZHL [exact] __thiscall void Entity_Player::AddPocketItem(int id, uint32_t pocketItemType); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddPocketItem(Entity_Player *this,int id,uint pocketItemType) { void *pvVar1; Game *pGVar2; uint uVar3; int *piVar4; uint slot; int iVar5; void **ppvVar6; uint local_8; uVar3 = GetMaxPocketItems(this); if (pocketItemType == 2) { uVar3 = uVar3 + 1; } if (((this->_pocketSlots[0] != 0) && (this->_pocketSlots[uVar3 * 2 + -2] != 0)) && (slot = 0, uVar3 != 0)) { piVar4 = this->_pocketSlots + 1; do { if ((piVar4[-1] != 0) && (*piVar4 != 2)) { DropPocketItem(this,slot,&this->_pos); break; } slot = slot + 1; piVar4 = piVar4 + 2; } while (slot < uVar3); } local_8 = 0; if (this->_pocketSlots[1] == 2) { local_8 = (uint)(0 < this->_pocketSlots[0]); } if ((this->_pocketSlots[uVar3 * 2 + -2] == 0) && ((int)local_8 <= (int)(uVar3 - 2))) { iVar5 = ((uVar3 - 2) - local_8) + 1; ppvVar6 = (void **)(this->_pocketSlots + uVar3 * 2 + -2); do { pvVar1 = ((std_vector *)(ppvVar6 + -1))->_begin; *ppvVar6 = ppvVar6[-2]; ppvVar6[1] = pvVar1; iVar5 = iVar5 + -1; ppvVar6 = ppvVar6 + -2; } while (iVar5 != 0); } this->_pocketSlots[local_8 * 2] = id; this->_pocketSlots[local_8 * 2 + 1] = pocketItemType; Room::UpdateRedKey(g_game->_room); pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } if ((this->_parent != (EntityPtr)0x0) && (pocketItemType != 2)) { DropPocketItem(this,local_8,&this->_pos); } return; } //@@ 007a3c10 Entity_Player::AddCard /* ZHL [lua] Lua binding EntityPlayer:AddCard */ void Entity_Player::AddCard(int param_1) { Entity_Player *in_ECX; AddPocketItem(in_ECX,param_1,1); return; } //@@ 007a3c30 Entity_Player::AddPill /* ZHL [lua] Lua binding EntityPlayer:AddPill */ void Entity_Player::AddPill(int param_1) { Entity_Player *in_ECX; AddPocketItem(in_ECX,param_1,0); return; } //@@ 007a3c50 Entity_Player::GetCard /* ZHL [lua] Lua binding EntityPlayer:GetCard */ int __thiscall Entity_Player::GetCard(Entity_Player *this,uint param_2) { if ((((int)param_2 < 0) || (3 < param_2)) || (this->_pocketSlots[param_2 * 2 + 1] != 1)) { return 0; } return this->_pocketSlots[param_2 * 2]; } //@@ 007a3c80 Entity_Player::GetPill /* ZHL [lua] Lua binding EntityPlayer:GetPill */ int __thiscall Entity_Player::GetPill(Entity_Player *this,uint param_2) { if ((((int)param_2 < 0) || (3 < param_2)) || (this->_pocketSlots[param_2 * 2 + 1] != 0)) { return 0; } return this->_pocketSlots[param_2 * 2]; } //@@ 007a3cb0 Entity_Player::SetCard /* ZHL [exact] __thiscall void Entity_Player::SetCard(int slot, int card); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::SetCard(Entity_Player *this,int slot,int card) { if ((-1 < slot) && ((uint)slot < 4)) { this->_pocketSlots[slot * 2] = card; this->_pocketSlots[slot * 2 + 1] = 1; Room::UpdateRedKey(g_game->_room); } return; } //@@ 007a3cf0 Entity_Player::SetPill /* ZHL [exact] __thiscall void Entity_Player::SetPill(int slot, int pillColor); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::SetPill(Entity_Player *this,int slot,int pillColor) { if ((-1 < slot) && ((uint)slot < 4)) { this->_pocketSlots[slot * 2] = pillColor; this->_pocketSlots[slot * 2 + 1] = 0; Room::UpdateRedKey(g_game->_room); } return; } //@@ 007a3d30 Entity_Player::pocket_use_input /* DB: logs "Action PillCard Triggered" and uses the pocket (decompile stops at that log: read 0x7a4100+ with --asm); Endless Nameless (trinket 0x4f) at 0x7a41a7: 0.25/0.33/0.5 a copy of the used pill (kind 0) or card (kind 1); caller Entity_Player::Update (items-verify) prototype: db/protos.zhl */ void __thiscall Entity_Player::pocket_use_input(Entity_Player *this) { byte bVar1; byte isDropHeld; char cVar2; uint uVar3; void *inputDevice; int iVar4; Vector *copySpawnPos; uint uVar5; int unused; int unused_00; int unused_01; int pocketKind; bool isClassicTwinControls; EntityList_EL familiars; Vector VStack_24; uint pocketId; float fStack_18; char isJacobOrEsau; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; Game *game; bool isUseBombAction; int swapTmp; uStack_8 = 0xffffffff; puStack_c = &LAB_00aff93d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; if (*(int *)&g_game->_stageTransition != 0) { return; } if (*(int *)&g_game->_roomTransition != 0) { return; } ExceptionList = &local_10; bVar1 = IsHologram(this); if (bVar1 != 0) { ExceptionList = local_10; return; } if ((this->_playerType == 0x13) || (this->_playerType == 0x14)) { isJacobOrEsau = '\x01'; cVar2 = FUN_00753bf0(uVar3); if (cVar2 != '\0') { isUseBombAction = true; goto LAB_007a3da4; } } else { isJacobOrEsau = '\0'; } isUseBombAction = false; LAB_007a3da4: isClassicTwinControls = (g_manager->_optionsConfig)._jacobEsauControls == 0; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (inputDevice = InputManager::GetDeviceByPlayerEntity(&g_manager->_netplayManager,this), inputDevice != (void *)0x0)) { isClassicTwinControls = *(int *)((int)inputDevice + 0x3d0) == 0; } iVar4 = 10; if ((isUseBombAction) && (isClassicTwinControls)) { iVar4 = 9; } bVar1 = input_is_action_triggered(g_manager,iVar4,this->_controllerIndex,(Entity *)this,0); if (isJacobOrEsau != '\0') { if (isClassicTwinControls) { if ((this->_twinPlayer != (EntityPtr)0x0) && (isDropHeld = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)this,unused), isDropHeld == 0)) { bVar1 = 0; } } else { cVar2 = FUN_00753bf0(); if ((cVar2 == '\0') || (isDropHeld = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)this,unused_00), isDropHeld == 0)) { cVar2 = FUN_006f0040(); if (cVar2 != '\0') { isDropHeld = input_is_action_pressed(0xb,this->_controllerIndex,(Entity *)this,unused_01); bVar1 = bVar1 & -(isDropHeld != 0); } } else { bVar1 = 0; } } } if (((this->_flags & 0x800) != 0) || (this->_isCoopGhost != 0)) { bVar1 = 0; } if ((this->_pocketSlots[1] == 2) && (0 < this->_pocketSlots[0])) { ControlActiveItem(this,this->_pocketSlots[0] + -1); ExceptionList = local_10; return; } if (this->_isControlsEnabled == 0) { ExceptionList = local_10; return; } if (0 < this->_controlsCooldown) { ExceptionList = local_10; return; } if (bVar1 == 0) { ExceptionList = local_10; return; } bVar1 = ANM2::IsPlaying(&this->_bodySprite,(byte *)"UseItem"); if (bVar1 != 0) { ExceptionList = local_10; return; } Game::save_rewind_state(-1); g_game->_isPocketItemRewindSaved = 1; KAGE_LogMessage(1,(byte *)"Action PillCard Triggered\n"); iVar4 = this->_pocketSlots[0]; if (iVar4 == 0) { ExceptionList = local_10; return; } this->_lastActionTriggers = this->_lastActionTriggers | 8; pocketKind = this->_pocketSlots[1]; pocketId = this->_pocketSlots[0]; fStack_18 = (float)pocketKind; if (pocketKind == 1) { if ((iVar4 == 0x4e) && (cVar2 = KAGE_Filesys_FileManager::OpenRead ((KAGE_Filesys_FileManager *)this,0x244,0xffffffff), cVar2 == '\0')) { ExceptionList = local_10; return; } PersistentGameData::AddToCollection(&g_manager->_persistentGameData,0x3d); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xc4,1); iVar4 = this->_pocketSlots[0]; this->_pocketSlots[1] = this->_pocketSlots[3]; swapTmp = this->_pocketSlots[5]; this->_pocketSlots[0] = this->_pocketSlots[2]; this->_pocketSlots[3] = swapTmp; this->_pocketSlots[2] = this->_pocketSlots[4]; this->_pocketSlots[5] = this->_pocketSlots[7]; this->_pocketSlots[4] = this->_pocketSlots[6]; this->_pocketSlots[6] = 0; TriggerEchoChamber(this,1,pocketId); UseCard(this,iVar4,4); if ((iVar4 != 0x50) && (iVar4 != 0x30)) { this->_wildCardItemType = 1; this->_wildCardItem = iVar4; this->_wildCardVarData = 0; } } else if (pocketKind == 0) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,1,0); uVar5 = 0; uStack_8 = 0; uVar3 = familiars._size; if (familiars._size != 0) { do { if (*(Entity_Player **)(*(int *)((int)familiars._data + uVar5 * 4) + 0x410) == this) { Entity_Familiar::farting_baby_fart(); uVar3 = familiars._size; } uVar5 = uVar5 + 1; } while (uVar5 < uVar3); pocketKind = (int)fStack_18; } PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,6,1); PersistentGameData::AddToCollection(&g_manager->_persistentGameData,0x2b); uVar3 = this->_pocketSlots[0]; fStack_18 = (float)ItemPool::GetPillEffect(&g_game->_itemPool,uVar3,this); if (((uVar3 & 0x7ff) != 0xe) || (uVar5 = RNG::RandomInt((RNG *)((int)(this->_collectibleRNGs)._begin + 0x4b0),100), uVar5 < 5 )) { iVar4 = this->_pocketSlots[3]; this->_pocketSlots[0] = this->_pocketSlots[2]; this->_pocketSlots[1] = iVar4; this->_pocketSlots[2] = this->_pocketSlots[4]; this->_pocketSlots[3] = this->_pocketSlots[5]; this->_pocketSlots[4] = this->_pocketSlots[6]; this->_pocketSlots[5] = this->_pocketSlots[7]; this->_pocketSlots[6] = 0; } TriggerEchoChamber(this,pocketKind,pocketId); UsePill(fStack_18,uVar3,0); this->_wildCardItemType = 0; this->_wildCardItem = (int)fStack_18; this->_wildCardVarData = uVar3; if (this->_cacheFlags != 0) { InvalidateCoPlayerItems(this); EvaluateItems(); } uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&familiars); } else if (pocketKind == 2) { ControlActiveItem(this,iVar4 + -1); } bVar1 = HasTrinket(this,0x4f,0); if ((bVar1 != 0) && ((pocketKind == 1 || (pocketKind == 0)))) { fStack_18 = 0.25; iVar4 = GetTrinketMultiplier(this,0x4f); if (iVar4 == 2) { fStack_18 = 0.33; } else if (iVar4 == 3) { fStack_18 = 0.5; } VStack_24.y = RNG::RandomFloat((RNG *)((int)(this->_trinketRNGs)._begin + 0x4f0)); if (VStack_24.y < fStack_18) { uVar3 = Random(); copySpawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,&VStack_24,&this->_pos,40.0,0,0,0); uVar5 = 0x46; if (pocketKind == 1) { uVar5 = 300; } Game::Spawn(g_game,5,uVar5,copySpawnPos,&g_vectorZero,(Entity *)this,pocketId,uVar3); } } game = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } ExceptionList = local_10; return; } //@@ 007a42b0 Entity_Player::pockets_rotate /* DB: ACTION_DROP (0xb) triggered: rotates the filled pocket slots (0x17a0..) slot 0 to the back, then SwapActiveItems */ void Entity_Player::pockets_rotate(void) { byte bVar1; char isTrinketDroppable; HUD *hud; int iVar2; byte *craftSlot; Game *game; float fVar3; Vector *pos; Entity_Player *in_ECX; int extraout_ECX; uint uVar4; int extraout_ECX_00; int extraout_ECX_01; uint uVar5; int *pocketSlot; int iVar6; Vector local_18; Vector local_10; void *cards; undefined4 *cardsBegin; undefined4 firstCard; bool isAnythingToDrop; Manager *manager; int swapItem; if (in_ECX->_variant != 0) { return; } if (in_ECX->_isCoopGhost != 0) { return; } bVar1 = IsHologram(in_ECX); if (bVar1 != 0) { return; } local_10.x = (float)in_ECX->_controllerIndex; if (0 < in_ECX->_forgottenSwapFormCooldown) { in_ECX->_forgottenSwapFormCooldown = in_ECX->_forgottenSwapFormCooldown + -1; } bVar1 = input_is_action_triggered(g_manager,0xb,(int)local_10.x,(Entity *)in_ECX,0); iVar6 = extraout_ECX; if (bVar1 == 0) goto LAB_007a457c; bVar1 = SwapForgottenForm(in_ECX,0,0); if (bVar1 == 0) { local_18.x = 0.0; pocketSlot = in_ECX->_pocketSlots; do { pocketSlot = pocketSlot + 2; if (*pocketSlot == 0) break; iVar6 = *pocketSlot; iVar2 = pocketSlot[1]; *pocketSlot = pocketSlot[-2]; game = g_game; pocketSlot[1] = pocketSlot[-1]; pocketSlot[-2] = iVar6; pocketSlot[-1] = iVar2; if ((game->_hud)._hudRefreshType != 2) { (game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } local_18.x = (float)((int)local_18.x + 1); } while ((uint)local_18.x < 3); game = g_game; if (in_ECX->_itemState == 0) { if (in_ECX->_activeDesc[0]._item == 0x1e9) { uVar4 = in_ECX->_activeDesc[0]._varData; uVar5 = (((int)uVar4 >> 0x10) + 1U) % 10; in_ECX->_activeDesc[0]._varData = uVar5 << 0x10 | uVar4 & 0xffff; hud = &game->_hud; uVar4 = 0; do { if (*(Entity_Player **)hud->_playerHUD == in_ECX) { hud->_playerHUD[400] = 0; hud->_playerHUD[0x191] = 0; hud->_playerHUD[0x192] = 0; hud->_playerHUD[0x193] = 0; break; } uVar4 = uVar4 + 1; hud = (HUD *)(hud->_playerHUD + 0x6dc); } while (uVar4 < 8); if (uVar5 != 0) goto LAB_007a43f6; } SwapActiveItems(); } } LAB_007a43f6: if (in_ECX->_playerType == 0x15) { bVar1 = HasCollectible(in_ECX,0x26b,0); iVar2 = 0; iVar6 = (uint)(bVar1 != 0) * 4 + 8; do { if (in_ECX->_inventory[iVar2] < 0) { iVar6 = iVar2; break; } iVar2 = iVar2 + 1; } while (iVar2 < iVar6); if (1 < iVar6) { iVar2 = 0; if (0 < iVar6 + -1) { do { swapItem = in_ECX->_inventory[iVar2]; in_ECX->_inventory[iVar2] = in_ECX->_inventory[iVar2 + 1]; in_ECX->_inventory[iVar2 + 1] = swapItem; iVar2 = iVar2 + 1; } while (iVar2 < iVar6 + -1); } HUD::mark_all_slots_dirty(&g_game->_hud,0,0); } } if (in_ECX->_playerType == 0x17) { bVar1 = in_ECX->_bagOfCraftingContent[0]; craftSlot = in_ECX->_bagOfCraftingContent; if ((bVar1 != 0) && (in_ECX->_bagOfCraftingContent[1] != 0)) { uVar4 = 0; do { if (craftSlot[1] == 0) break; *craftSlot = craftSlot[1]; uVar4 = uVar4 + 1; craftSlot = craftSlot + 1; } while (uVar4 < 7); in_ECX->_bagOfCraftingContent[uVar4] = bVar1; } cardsBegin = (in_ECX->_itemCards)._begin; uVar4 = (int)(in_ECX->_itemCards)._end - (int)cardsBegin >> 2; if (1 < uVar4) { firstCard = *cardsBegin; uVar5 = 0; if (uVar4 != 1) { do { cards = (in_ECX->_itemCards)._begin; *(undefined4 *)((int)cards + uVar5 * 4) = *(undefined4 *)((int)cards + uVar5 * 4 + 4); uVar5 = uVar5 + 1; } while (uVar5 < ((int)(in_ECX->_itemCards)._end - (int)(in_ECX->_itemCards)._begin >> 2) - 1U); } hud = &g_game->_hud; *(undefined4 *)((int)(in_ECX->_itemCards)._end + -4) = firstCard; HUD::mark_all_slots_dirty(hud,0,0); } } iVar2 = is_achievement_79_unlocked(in_ECX); manager = g_manager; iVar6 = extraout_ECX_00; if (0 < iVar2) { local_18.x = 1.16028e-42; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,(int)local_18.x,1.2,1,0,1.0,0.0); Game::ShakeScreen(g_game,8); iVar6 = extraout_ECX_01; } LAB_007a457c: bVar1 = input_is_action_pressed(0xb,(int)local_10.x,(Entity *)in_ECX,iVar6); if (bVar1 == 0) { in_ECX->_actionHoldDrop = 0; return; } in_ECX->_actionHoldDrop = in_ECX->_actionHoldDrop + 1; game = g_game; if (((uint)in_ECX->_actionHoldDrop < 0x79) || ((g_game->_dailyChallenge)._specialDailyId == 4)) { *(undefined4 *)&in_ECX->field_0x1880 = 0; } else { uVar4 = 0; in_ECX->_actionHoldDrop = 0; isAnythingToDrop = false; local_18.x = (float)in_ECX->_trinketsID; do { iVar6 = *(int *)local_18.x; if (iVar6 != 0) { if (*(int *)&game->_deathmatchManager < 2) { if ((iVar6 != 0x35) && ((iVar6 != 0x40 || (game->_challenge != 0x1c)))) goto LAB_007a461f; } else { isTrinketDroppable = (**(code **)(*(int *)(game->_deathmatchManager)._type + 0x50))(); game = g_game; if (isTrinketDroppable != '\0') { LAB_007a461f: isAnythingToDrop = true; } } } uVar4 = uVar4 + 1; local_18.x = (float)((int)local_18.x + 4); } while (uVar4 < 2); local_18.x = 0.0; uVar4 = GetMaxPocketItems(in_ECX); if (uVar4 != 0) { pocketSlot = in_ECX->_pocketSlots + 1; do { if ((pocketSlot[-1] != 0) && (*pocketSlot != 2)) { isAnythingToDrop = true; } local_18.x = (float)((int)local_18.x + 1); pocketSlot = pocketSlot + 2; fVar3 = (float)GetMaxPocketItems(in_ECX); } while ((uint)local_18.x < (uint)fVar3); } game = g_game; if (isAnythingToDrop) { if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } in_ECX->_lastActionTriggers = in_ECX->_lastActionTriggers | 0x20; iVar6 = 2; while( true ) { Room::FindFreePickupSpawnPosition(game->_room,&local_10,&in_ECX->_pos,0.0,0,0,0); DropTrinket(in_ECX,&local_10,0); if ((in_ECX->_variant == 0) && (in_ECX->_isCoopGhost == 0)) { InvalidateCoPlayerItems(in_ECX); } iVar6 = iVar6 + -1; if (iVar6 == 0) break; game = g_game; } iVar6 = 4; do { pos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_18,&in_ECX->_pos,0.0,0,0,0); DropPocketItem(in_ECX,-1,pos); iVar6 = iVar6 + -1; } while (iVar6 != 0); return; } } return; } //@@ 007a4760 Entity_Player::SwapActiveItems /* ZHL [lua] Lua binding EntityPlayer:SwapActiveItems */ void Entity_Player::SwapActiveItems(void) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; byte bVar12; HUD *pHVar13; Entity_Player *in_ECX; uint uVar14; if (in_ECX->_activeDesc[1]._item == 0) { return; } ResetItemState(in_ECX); in_ECX->_itemStateCooldown = 0; iVar1 = in_ECX->_activeDesc[1]._unk; iVar2 = in_ECX->_activeDesc[1]._charge; iVar3 = in_ECX->_activeDesc[1]._batteryCharge; iVar4 = in_ECX->_activeDesc[0]._item; iVar5 = in_ECX->_activeDesc[0]._unk; iVar6 = in_ECX->_activeDesc[0]._charge; iVar7 = in_ECX->_activeDesc[0]._batteryCharge; iVar8 = in_ECX->_activeDesc[0]._subCharge; iVar9 = in_ECX->_activeDesc[0]._timeRechargeCooldown; iVar10 = in_ECX->_activeDesc[0]._partialCharge; iVar11 = in_ECX->_activeDesc[0]._varData; in_ECX->_activeDesc[0]._item = in_ECX->_activeDesc[1]._item; in_ECX->_activeDesc[0]._unk = iVar1; in_ECX->_activeDesc[0]._charge = iVar2; in_ECX->_activeDesc[0]._batteryCharge = iVar3; iVar1 = in_ECX->_activeDesc[1]._timeRechargeCooldown; iVar2 = in_ECX->_activeDesc[1]._partialCharge; iVar3 = in_ECX->_activeDesc[1]._varData; in_ECX->_activeDesc[0]._subCharge = in_ECX->_activeDesc[1]._subCharge; in_ECX->_activeDesc[0]._timeRechargeCooldown = iVar1; in_ECX->_activeDesc[0]._partialCharge = iVar2; in_ECX->_activeDesc[0]._varData = iVar3; in_ECX->_activeDesc[1]._item = iVar4; in_ECX->_activeDesc[1]._unk = iVar5; in_ECX->_activeDesc[1]._charge = iVar6; in_ECX->_activeDesc[1]._batteryCharge = iVar7; in_ECX->_activeDesc[1]._subCharge = iVar8; in_ECX->_activeDesc[1]._timeRechargeCooldown = iVar9; in_ECX->_activeDesc[1]._partialCharge = iVar10; in_ECX->_activeDesc[1]._varData = iVar11; in_ECX->_itemHoldCooldown = 0; bVar12 = HasTrinket(in_ECX,0x65,0); if ((bVar12 != 0) || (bVar12 = HasTrinket(in_ECX,100,0), bVar12 != 0)) { in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x41f; EvaluateItems(); } pHVar13 = &g_game->_hud; uVar14 = 0; do { if (*(Entity_Player **)pHVar13->_playerHUD == in_ECX) { pHVar13->_playerHUD[400] = 0; pHVar13->_playerHUD[0x191] = 0; pHVar13->_playerHUD[0x192] = 0; pHVar13->_playerHUD[0x193] = 0; pHVar13->_playerHUD[0x1ac] = 0; pHVar13->_playerHUD[0x1ad] = 0; pHVar13->_playerHUD[0x1ae] = 0; pHVar13->_playerHUD[0x1af] = 0; pHVar13->_playerHUD[0x1c8] = 0; pHVar13->_playerHUD[0x1c9] = 0; pHVar13->_playerHUD[0x1ca] = 0; pHVar13->_playerHUD[0x1cb] = 0; pHVar13->_playerHUD[0x1e4] = 0; pHVar13->_playerHUD[0x1e5] = 0; pHVar13->_playerHUD[0x1e6] = 0; pHVar13->_playerHUD[0x1e7] = 0; return; } uVar14 = uVar14 + 1; pHVar13 = (HUD *)(pHVar13->_playerHUD + 0x6dc); } while (uVar14 < 8); return; } //@@ 007a4850 Entity_Player::RemovePocketItem /* ZHL [exact] __thiscall void Entity_Player::RemovePocketItem(int slot); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::RemovePocketItem(Entity_Player *this,int slot) { Game *pGVar1; uint uVar2; int *piVar3; int *piVar4; if (slot == -1) { slot = 0; piVar3 = this->_pocketSlots + 1; while ((piVar3[-1] == 0 || (*piVar3 == 2))) { slot = slot + 1; piVar3 = piVar3 + 2; if (3 < (uint)slot) { return; } } if (slot == 0xffffffff) { return; } } if ((this->_pocketSlots[slot * 2] != 0) && (this->_pocketSlots[slot * 2 + 1] != 2)) { if ((uint)slot < 3) { piVar3 = this->_pocketSlots + slot * 2 + 2; piVar4 = this->_pocketSlots + slot * 2; for (uVar2 = (3 - slot) * 2 & 0x3ffffffe; uVar2 != 0; uVar2 = uVar2 - 1) { *piVar4 = *piVar3; piVar3 = piVar3 + 1; piVar4 = piVar4 + 1; } } pGVar1 = g_game; this->_pocketSlots[6] = 0; this->_pocketSlots[7] = 1; Room::UpdateRedKey(pGVar1->_room); } return; } //@@ 007a48f0 Entity_Player::DropPocketItem /* ZHL [exact] __thiscall void Entity_Player::DropPocketItem(int slot, Vector* pos); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::DropPocketItem(Entity_Player *this,int slot,Vector *pos) { Game *pGVar1; int *piVar2; uint uVar3; uint variant; Entity *pEVar4; int *piVar5; if (slot == -1) { slot = 0; piVar2 = this->_pocketSlots + 1; while ((piVar2[-1] == 0 || (*piVar2 == 2))) { slot = slot + 1; piVar2 = piVar2 + 2; if (3 < (uint)slot) { return; } } if (slot == 0xffffffff) { return; } } if ((this->_pocketSlots[slot * 2] != 0) && (this->_pocketSlots[slot * 2 + 1] != 2)) { uVar3 = Random(); variant = 0x46; if (this->_pocketSlots[slot * 2 + 1] == 1) { variant = 300; } pEVar4 = Game::Spawn(g_game,5,variant,pos,&g_vectorZero,(Entity *)this, this->_pocketSlots[slot * 2],uVar3); if (pEVar4 != (Entity *)0x0) { pEVar4[1]._sprite._championColor._offset[1] = 5.60519e-45; } if ((uint)slot < 3) { piVar2 = this->_pocketSlots + slot * 2 + 2; piVar5 = this->_pocketSlots + slot * 2; for (uVar3 = (3 - slot) * 2 & 0x3ffffffe; uVar3 != 0; uVar3 = uVar3 - 1) { *piVar5 = *piVar2; piVar2 = piVar2 + 1; piVar5 = piVar5 + 1; } } pGVar1 = g_game; this->_pocketSlots[6] = 0; this->_pocketSlots[7] = 1; Room::UpdateRedKey(pGVar1->_room); } return; } //@@ 007a49e0 Entity_Player::spawn_low_health_blood_splat /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX player; variant 0, bone+soul+red hearts < 2, not playerType 10/16/17/31/35/39/40, not coop ghost: spawns effect 1000.7 with random scale/rotation/flip, tinted unless collectible 440 or Eve (5/26); called from level_start and room_enter */ void Entity_Player::spawn_low_health_blood_splat(void) { int iVar1; byte bVar2; uint uVar3; Entity *pEVar4; ColorMod *pCVar5; Entity_Player *in_ECX; float fVar6; float fVar7; undefined1 local_38 [44]; uint local_c; local_c = __security_cookie ^ (uint)local_38; if (((((in_ECX->_variant == 0) && (in_ECX->_boneHearts + in_ECX->_soulHearts + in_ECX->_redHearts < 2)) && (iVar1 = in_ECX->_playerType, iVar1 != 10)) && ((((iVar1 != 0x10 && (iVar1 != 0x11)) && ((iVar1 != 0x1f && ((iVar1 != 0x23 && (iVar1 != 0x28)))))) && (iVar1 != 0x27)))) && (in_ECX->_isCoopGhost == 0)) { uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,7,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,uVar3,0); uVar3 = Random(); fVar7 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.3; fVar6 = fVar7 * g_vectorOne.x; (pEVar4->_sprite)._scale.y = fVar7 * g_vectorOne.y; (pEVar4->_sprite)._scale.x = fVar6; uVar3 = Random(); (pEVar4->_sprite)._rotation = ((float)(uVar3 & 3) + 0.0) * 90.0; uVar3 = Random(); (pEVar4->_sprite)._flipX = ~(byte)uVar3 & 1; bVar2 = HasCollectible(in_ECX,0x1b8,0); if (((bVar2 == 0) && (in_ECX->_playerType != 5)) && (in_ECX->_playerType != 0x1a)) { pCVar5 = ColorParams::set_from_bytes((ColorParams *)local_38,0,0,0,0xb4,0xf4,0xf4,0); (**(code **)(*(int *)pEVar4 + 0x3c))(pCVar5,0xffffffff,0xff,0,1); } (**(code **)(*(int *)pEVar4 + 0xc))(); } return; } //@@ 007a4ba0 Entity_Player::level_start /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: per-player new-level setup (param: isForced): start position incl. Ascent/Home, glitch baby subtype + "Glitch" anim, Map/Compass/Blue Map effects, UseActiveItem 0x11c; called per player from 009bb960 PlayerManager::trigger_level_start the player update prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::level_start(Entity_Player *this,byte isForced) { float fVar1; Entity_Player *pEVar2; EntityPtr EVar3; code *pcVar4; qword qVar5; byte bVar6; char cVar7; int iVar8; undefined1 *puVar9; float *startPos; uint uVar10; uint uVar11; uint uVar12; int *piVar13; Vector *spawnPos; int iVar14; void *pvVar15; ItemConfig_Item *Item; void *pvVar16; Entity_Player *this_00; Entity_Player *this_01; int extraout_ECX; Game *game; uint extraout_ECX_00; uint extraout_ECX_01; undefined4 extraout_ECX_02; int extraout_EDX; int extraout_EDX_00; qword *allocatedBytes; uint uVar17; Room *room; uint *rngSeed; void **roomData; undefined4 *puVar18; undefined4 local_100 [3]; Vector heartPos2; Vector heartPos; Vector sackPos; undefined1 local_dc [8]; undefined1 local_d4 [8]; undefined1 local_cc [8]; EntityList_EL familiars; int local_b4 [3]; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; int local_9c; undefined4 local_98; int local_94 [3]; undefined4 local_88; int local_84 [3]; undefined4 local_78; EntityList_EL darkEsaus; undefined4 local_64; undefined4 local_60; float local_5c; float local_58; undefined4 local_54; undefined4 local_50; undefined8 local_48; float startX; uint *local_38; undefined4 local_34; Game *local_30; char local_29; undefined8 local_24; uint local_18; void *local_10; undefined1 *puStack_c; uint local_8; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00aff978; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_84 + 0x20); ExceptionList = &local_10; this->_delayedSfxId = 0; this->_delayedSfxDelay = 0; (this->_moveToTarget).x = g_vectorZero.x; (this->_moveToTarget).y = g_vectorZero.y; game = g_game; local_34 = this; if ((this->_variant == 0) && (isForced == 0)) { if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { local_64 = 0x43a00000; puVar18 = &local_64; local_60 = 0x438c0000; puVar9 = local_dc; } else { iVar8 = _get_index_plus_one_if_kind_4_5(local_18); if ((iVar8 != 1) || (bVar6 = Level::IsAscent((Level *)game), bVar6 != 0)) { startPos = (float *)PlayerManager::get_player_start_position (local_d4,this,&g_vectorZero,&game->_playerManager); fVar1 = *startPos; (this->_pos).x = fVar1; (this->_pos).y = startPos[1]; if ((game->_challenge == 0x1f) && (game->_stage == 0xb)) { (this->_pos).x = fVar1 + 0.0; (this->_pos).y = (this->_pos).y + 100.0; } uVar12 = game->_debugCurses; iVar8 = game->_stage; uVar17 = game->_curses; uVar10 = Seeds::GetForcedCurses(); uVar11 = Seeds::GetPreventedCurses(); game = g_game; iVar14 = iVar8 + 1; if ((~uVar11 & (uVar10 | uVar12 | uVar17) & 2) == 0) { iVar14 = iVar8; } bVar6 = Level::IsAscent((Level *)g_game); if ((bVar6 == 0) || ((iVar14 == 6 && (bVar6 = Level::IsAltPath((Level *)game), bVar6 != 0))) ) { this = local_34; } else { room = game->_room; startX = g_vectorZero.x; local_38 = (uint *)g_vectorZero.y; roomData = room->_doors; uVar12 = 0; do { uVar17 = uVar12 + 1; if (8 < uVar17) break; if (*roomData != (void *)0x0) { if (uVar12 != 0xffffffff) goto LAB_007a4df2; break; } roomData = roomData + 1; uVar12 = uVar17; } while (uVar17 < 8); uVar12 = Random(); uVar12 = uVar12 & 7; uVar17 = 0; room = g_game->_room; do { if ((uVar12 < 8) && ((*(uint *)(*(int *)(((Game *)room)->_stageType + 0x10) + 0x38 + (uVar12 >> 5) * 4) & 1 << ((byte)uVar12 & 0x1f)) != 0)) break; uVar12 = uVar12 + 1 & 0x80000007; if ((int)uVar12 < 0) { uVar12 = (uVar12 - 1 | 0xfffffff8) + 1; } uVar17 = uVar17 + 1; } while (uVar17 < 8); game = g_game; local_30 = (Game *)room; LAB_007a4df2: this = local_34; startX = g_vectorZero.x; local_38 = (uint *)g_vectorZero.y; if (uVar12 < 8) { startX = (float)(room->_doorGridPositions[uVar12] % room->_gridWidth) * 40.0 + 40.0; local_38 = (uint *)((float)(room->_doorGridPositions[uVar12] / room->_gridWidth) * 40.0 + 120.0); } uVar12 = uVar12 & 0x80000003; if ((int)uVar12 < 0) { uVar12 = (uVar12 - 1 | 0xfffffffc) + 1; } switch(uVar12) { case 0: startX = startX + 40.0; local_38 = (uint *)((float)local_38 + 0.0); break; case 1: local_38 = (uint *)((float)local_38 + 40.0); startX = startX + 0.0; break; case 2: startX = startX - 40.0; local_38 = (uint *)((float)local_38 - 0.0); break; case 3: local_38 = (uint *)((float)local_38 - 40.0); startX = startX - 0.0; } uVar12 = 0; (local_34->_pos).x = startX; (local_34->_pos).y = (float)local_38; pvVar15 = game->_room; if (0 < *(int *)((int)pvVar15 + 0x10) * *(int *)((int)pvVar15 + 0xc)) { local_30 = (Game *)0x24; do { if (uVar12 < 0x1c0) { local_34 = *(Entity_Player **)((int)pvVar15 + (int)local_30); if ((local_34 != (Entity_Player *)0x0) && (*(int *)&local_34->field_0x4 == 0x11)) { local_5c = (float)(local_34->_collisionIndex % *(int *)((int)pvVar15 + 0xc)) * 40.0 + 40.0; local_58 = (float)(local_34->_collisionIndex / *(int *)((int)pvVar15 + 0xc)) * 40.0 + 120.0; cVar7 = pathfinder_can_reach_pos(pvVar15); if (cVar7 != '\0') { iVar8 = local_34->_collisionIndex; iVar14 = *(int *)((int)g_game->_room + 0xc); (this->_pos).x = (float)(iVar8 % iVar14) * 40.0 + 40.0; (this->_pos).y = (float)(iVar8 / iVar14) * 40.0 + 120.0; break; } game = g_game; } } pvVar15 = game->_room; uVar12 = uVar12 + 1; local_30 = (Game *)&local_30->_stageType; } while ((int)uVar12 < *(int *)((int)pvVar15 + 0x10) * *(int *)((int)pvVar15 + 0xc)); } } goto LAB_007a4fdc; } local_54 = 0x43a00000; puVar18 = &local_54; local_50 = 0x43be0000; puVar9 = local_cc; } startPos = (float *)PlayerManager::get_player_start_position (puVar9,this,puVar18,&game->_playerManager); (this->_pos).x = *startPos; (this->_pos).y = startPos[1]; } LAB_007a4fdc: if (this->_postLevelInitFinished == 0) { ExceptionList = local_10; return; } spawn_low_health_blood_splat(); *(undefined4 *)&this->field_0x1ae0 = 0; if (this->_variant == 1) { if (this->_isGlitchBaby != 0) { this->_babySkin = 0x19; InitBabySkin(this); game = g_game; uVar12 = *(uint *)&(g_game->_playerManager).field_0xa8; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = *(uint *)&(game->_playerManager).field_0xa8; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar12 = uVar12 >> ((byte)*(undefined4 *)&(game->_playerManager).field_0xac & 0x1f) ^ uVar12; pEVar2 = *(Entity_Player **)&(game->_playerManager).field_0xb4; uVar12 = uVar12 << ((byte)*(undefined4 *)&(game->_playerManager).field_0xb0 & 0x1f) ^ uVar12; *(uint *)&(game->_playerManager).field_0xa8 = uVar12 >> ((byte)pEVar2 & 0x1f) ^ uVar12; uVar12 = GetGlitchBabySubType(pEVar2); this->_subtype = uVar12; if (0x46 < uVar12) { uVar12 = 0x47; } this->_babySkin = uVar12; PlayExtraAnimation(this,(byte *)"Glitch"); if (this->_variant != 1) goto LAB_007a50ce; } EVar3 = this->_parent; if (EVar3 != (EntityPtr)0x0) { fVar1 = *(float *)((int)EVar3 + 0x340); (this->_pos).x = *(float *)((int)EVar3 + 0x33c); (this->_pos).y = fVar1; } } LAB_007a50ce: this->_isLevelStartPending = 0; FUN_007daff0(); TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x42,-1); TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x4a,-1); pvVar15 = (g_manager->_itemConfig)._collectibles._begin; if ((0x2b8 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar15 >> 2) && (iVar8 = *(int *)((int)pvVar15 + 0xae0), iVar8 != 0)) { local_84[2] = *(undefined4 *)(iVar8 + 0x78); local_84[1] = 0; local_78 = 0; local_84[0] = iVar8; TemporaryEffects::RemoveEffect(&this->_temporaryeffects,local_84,-1); } pvVar15 = (g_manager->_itemConfig)._trinkets._begin; if ((0xb4 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar15 >> 2) && (iVar8 = *(int *)((int)pvVar15 + 0x2d0), iVar8 != 0)) { local_94[2] = *(undefined4 *)(iVar8 + 0x78); local_94[1] = 0; local_88 = 0; local_94[0] = iVar8; TemporaryEffects::RemoveEffect(&this->_temporaryeffects,local_94,-1); } TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x6d,-1); EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&darkEsaus,0x362,-1,-1,0,0); local_8 = 0; uVar12 = 0; if (darkEsaus._size != 0) { pvVar15 = darkEsaus._data; do { piVar13 = *(int **)((int)pvVar15 + uVar12 * 4); if ((Entity_Player *)piVar13[0xf2] == this) { (**(code **)(*piVar13 + 0x28))(); pvVar15 = darkEsaus._data; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)darkEsaus._size); } TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x81,1); if (this->_playerType == 0x27) { iVar8 = 0x25; LAB_007a5236: ChangePlayerType(this,iVar8,0); } else if (this->_playerType == 0xb) { iVar8 = 8; goto LAB_007a5236; } if ((this->_playerType == 0x25) && (g_game->_challenge != 0x2c)) { pvVar15 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar15 >> 2 < 0x6e) { local_a4 = 0; } else { local_a4 = *(undefined4 *)((int)pvVar15 + 0x1b4); } uVar12 = (g_game->_devilAngelRoomRNG)._seed; local_a0 = 0; local_98 = 0; local_24 = 0x70000000b; local_30 = (Game *)0xc; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar12 = uVar12 >> 0xb ^ uVar12; uVar12 = uVar12 << 7 ^ uVar12; local_9c = ((uVar12 >> 0xc ^ uVar12) % 0x14) * 0x1e + 0x262; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_a4,1,1); } bVar6 = HasCollectible(this,0x2a4,0); if (bVar6 != 0) { iVar8 = GetHealthType(this); if (((iVar8 == 0) && (iVar8 = GetHeartLimit(this_00,0), this->_maxHearts < iVar8)) && (this->_redHearts < 3)) { AddMaxHearts(this,2,0); ItemOverlay::Show(&g_game->_itemOverlay,0x29,0,(Entity_Player *)0x0); } pEVar2 = (Entity_Player *)this->_subPlayer; if (((pEVar2 != (Entity_Player *)0x0) && (iVar8 = GetHealthType(pEVar2), iVar8 == 0)) && ((iVar8 = GetHeartLimit(this_01,0), pEVar2->_maxHearts < iVar8 && (pEVar2->_redHearts < 3)))) { AddMaxHearts(pEVar2,2,0); ItemOverlay::Show(&g_game->_itemOverlay,0x29,0,(Entity_Player *)0x0); } } if ((this->_temporaryeffects)._disabled == 0) { for (piVar13 = (this->_temporaryeffects)._effects._begin; piVar13 != (this->_temporaryeffects)._effects._end; piVar13 = piVar13 + 4) { iVar8 = *(int *)*piVar13; if ((((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) && (((int *)*piVar13)[1] == 0x2a1)) { if (0 < piVar13[1]) { iVar8 = *(int *)&this->field_0x1f04; if (((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 1000)) && (piVar13[1] == 1)) { *(undefined4 *)(iVar8 + 0x450) = 2; } pvVar15 = (g_manager->_itemConfig)._collectibles._begin; if ((0x2a1 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar15 >> 2) && (iVar8 = *(int *)((int)pvVar15 + 0xa84), iVar8 != 0)) { local_b4[2] = *(undefined4 *)(iVar8 + 0x78); local_b4[1] = 0; local_a8 = 0; local_b4[0] = iVar8; TemporaryEffects::RemoveEffect(&this->_temporaryeffects,local_b4,-1); } } break; } } } this->_forgottenBodyRoomIdx = -99999; bVar6 = HasTrinket(this,0xa0,0); if ((bVar6 != 0) && (local_30 = (Game *)GetTrinketMultiplier(this,0xa0), 0 < (int)local_30)) { do { pvVar15 = (this->_trinketRNGs)._begin; rngSeed = (uint *)((int)pvVar15 + 0xa00); uVar12 = *rngSeed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = *rngSeed; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } game = g_game; uVar12 = uVar12 >> ((byte)*(undefined4 *)((int)pvVar15 + 0xa04) & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)*(undefined4 *)((int)pvVar15 + 0xa08) & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)*(undefined4 *)((int)pvVar15 + 0xa0c) & 0x1f) ^ uVar12; *rngSeed = uVar12; spawnPos = Room::FindFreePickupSpawnPosition(game->_room,&sackPos,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x45,spawnPos,&g_vectorZero,(Entity *)this,0,uVar12); local_30 = (Game *)&local_30[-1]._console.field_0x3; } while (local_30 != (Game *)0x0); } if ((isForced == 0) && (this->_backupPlayer != (void *)0x0)) { *(undefined1 *)((int)this->_backupPlayer + 0x1fc4) = 1; if (*(char *)((int)this->_backupPlayer + 0x20e8) != '\0') { *(undefined1 *)((int)this->_backupPlayer + 0x2620) = 1; } } if (0 < this->_eternalHearts) { this->_eternalHearts = 0; iVar14 = GetHealthType(this); iVar8 = extraout_EDX; if ((iVar14 == 1) && ((this->_playerType == 0xc || (iVar8 = 6, this->_playerType == 0x18)))) { iVar8 = 0x2e; } ItemOverlay::Show(&g_game->_itemOverlay,iVar8,1,(Entity_Player *)0x0); AddMaxHearts(this,2,0); AddHearts(this,2,0,0); } iVar8 = this->_subPlayer; if ((iVar8 != 0) && (0 < *(int *)(iVar8 + 0x1348))) { *(undefined4 *)(iVar8 + 0x1348) = 0; iVar14 = GetHealthType((Entity_Player *)this->_subPlayer); iVar8 = extraout_EDX_00; if ((iVar14 == 1) && ((*(int *)(extraout_ECX + 0x13c0) == 0xc || (iVar8 = 6, *(int *)(extraout_ECX + 0x13c0) == 0x18)))) { iVar8 = 0x2e; } ItemOverlay::Show(&g_game->_itemOverlay,iVar8,1,(Entity_Player *)0x0); AddMaxHearts((Entity_Player *)this->_subPlayer,2,0); AddHearts((Entity_Player *)this->_subPlayer,2,0,0); } if (this->_isCoopGhost == 0) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,0xe8,1,0,0); local_8._0_1_ = 1; uVar12 = 0; if (familiars._size != 0) { do { iVar8 = __RTDynamicCast(*(undefined4 *)((int)familiars._data + uVar12 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if ((iVar8 != 0) && (*(Entity_Player **)(iVar8 + 0x410) == this)) { *(undefined4 *)(iVar8 + 0x30) = 0; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)familiars._size); } local_8 = (uint)local_8._1_3_ << 8; if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar12 = *(uint *)((int)familiars._data + -4); qVar5 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar12; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar5 < uVar12); free((void *)((int)familiars._data + -4)); } local_8 = local_8 & 0xffffff00; } } bVar6 = HasCollectible(this,0x36,0); if ((bVar6 != 0) || (bVar6 = HasCollectible(this,0x14d,0), bVar6 != 0)) { Level::ApplyMapEffect((Level *)g_game); } bVar6 = HasCollectible(this,0xf6,0); if ((bVar6 != 0) || (bVar6 = HasCollectible(this,0x14d,0), bVar6 != 0)) { Level::ApplyBlueMapEffect((Level *)g_game); } local_29 = '\0'; bVar6 = HasTrinket(this,0x3b,0); if (bVar6 != 0) { GetTrinketMultiplier(this,0x3b); iVar8 = __ftoui3(); uVar12 = Random(); local_29 = uVar12 % 100 < (uint)(iVar8 * 0x19); } bVar6 = HasCollectible(this,0x15,0); if (((bVar6 != 0) || (bVar6 = HasCollectible(this,0x14d,0), bVar6 != 0)) || (local_29 != '\0')) { Level::ApplyCompassEffect((Level *)g_game,1); } bVar6 = HasTrinket(this,0x37,0); if (bVar6 != 0) { iVar8 = GetTrinketMultiplier(this,0x37); AddEternalHearts(this,iVar8); } bVar6 = HasCollectible(this,0x24c,0); game = g_game; if (bVar6 != 0) { if (-1 < g_game->_lastBossRoomListIdx) { piVar13 = &g_game->_roomList[g_game->_lastBossRoomListIdx].DisplayFlags; *piVar13 = *piVar13 | 4; } Minimap::Refresh(&game->_minimap); piVar13 = &game->_levelStateFlags; *piVar13 = *piVar13 | 0x40000; } bVar6 = HasCollectible(this,0x24d,0); if (bVar6 != 0) { Level::reveal_secret_room((Level *)g_game); } bVar6 = HasTrinket(this,0x17,0); if (bVar6 != 0) { iVar8 = GetTrinketMultiplier(this,0x17); local_30 = (Game *)0x21; if (iVar8 == 2) { local_30 = (Game *)0x42; } else if (2 < iVar8) { local_30 = (Game *)0x64; } pvVar15 = (this->_trinketRNGs)._begin; rngSeed = (uint *)((int)pvVar15 + 0x170); uVar12 = *rngSeed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = *rngSeed; if (uVar12 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar12 = uVar12 >> ((byte)*(undefined4 *)((int)pvVar15 + 0x174) & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)*(undefined4 *)((int)pvVar15 + 0x178) & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)*(undefined4 *)((int)pvVar15 + 0x17c) & 0x1f) ^ uVar12; *rngSeed = uVar12; if ((Game *)(uVar12 % 100) < local_30) { iVar8 = 0; local_30 = g_game; if (0 < g_game->_nbRooms) { roomData = &g_game->_roomList[0].Data; game = g_game; do { pvVar15 = *roomData; if (pvVar15 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"[error] Room %d is not initialized\n"); pvVar15 = *roomData; game = local_30; } if (*(int *)((int)pvVar15 + 8) == 8) { piVar13 = &game->_roomList[iVar8].DisplayFlags; *piVar13 = *piVar13 | 4; break; } iVar8 = iVar8 + 1; roomData = roomData + 0x2e; } while (iVar8 < game->_nbRooms); } Minimap::Refresh(&g_game->_minimap); } } bVar6 = HasCollectible(this,0x236,0); if (bVar6 != 0) { AddSoulHearts(this,1,0); } uVar12 = 0; do { uVar17 = this->_activeDesc[uVar12]._item; if (uVar17 == 0x93) { if (uVar12 == 3) { iVar8 = 0; } else if (((uVar12 == 2) && (this->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)) { iVar8 = 0; } else { iVar8 = GetCollectibleMaxCharge(this,0x93,this->_activeDesc[uVar12]._varData,0x93); } LAB_007a5a54: AddActiveCharge(this,iVar8,uVar12,0,0,1); uVar17 = extraout_ECX_01; } else if (uVar17 == 0x1a6) { this->_activeDesc[uVar12]._varData = 0; SetActiveCharge(this,0,uVar12); uVar17 = extraout_ECX_00; } else if (uVar17 == 0x27e) { iVar8 = 1; goto LAB_007a5a54; } uVar12 = uVar12 + 1; } while (uVar12 < 4); if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && (2 < this->_playerForms[0xf])) { uVar17 = uVar17 & 0xffffff00; uVar12 = 0; local_29 = '\0'; do { if (this->_activeDesc[uVar12]._item == 0x23) { if ((char)uVar17 == '\0') { if (this->_activeDesc[uVar12]._varData == 1) { if (uVar12 == 3) { iVar8 = 0; } else { iVar8 = GetCollectibleMaxCharge(this,0x23,1,uVar17); } AddActiveCharge(this,iVar8,uVar12,0,0,1); ItemOverlay::Show(&g_game->_itemOverlay,0x2f,3,(Entity_Player *)0x0); manager = g_manager; local_30 = (Game *)0x419; seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,2,0,1.0,0.0); local_29 = '\x01'; } } else { this->_activeDesc[uVar12]._varData = 0; } HUD::InvalidateActiveItem(&g_game->_hud,this,uVar12); uVar17 = CONCAT31((int3)((uint)extraout_ECX_02 >> 8),local_29); } uVar12 = uVar12 + 1; } while (uVar12 < 4); if ((char)uVar17 == '\0') { this->_activeDesc[0]._varData = 1; iVar8 = GetCollectibleMaxCharge(this,this->_activeDesc[0]._item,1,uVar17); AddActiveCharge(this,iVar8,0,0,0,1); ItemOverlay::Show(&g_game->_itemOverlay,0x2f,3,(Entity_Player *)0x0); } } bVar6 = HasTrinket(this,0x8e,0); if (bVar6 != 0) { iVar8 = GetTrinketMultiplier(this,0x8e); iVar8 = iVar8 << 2; if (iVar8 != 0) { do { AddWisp(this,0x248,&this->_pos,0,0); iVar8 = iVar8 + -1; } while (iVar8 != 0); } } bVar6 = HasTrinket(this,0xa8,0); if (bVar6 != 0) { iVar8 = GetTrinketMultiplier(this,0xa8); AddBoneHearts(this,iVar8); } bVar6 = HasCollectible(this,0x102,0); if (bVar6 != 0) { UseActiveItem(this,(short *)((int)&local_34 + 2),0x11c,1,-1,0); this->_isPlayingItemAnimation = 0; ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); bVar6 = ANM2::SetAnimation(&this->_sprite,(byte *)"Glitch",1); if (bVar6 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 1; this->_isPlayingItemAnimation = 0; } bVar6 = HasCollectible(this,0x188,0); if (bVar6 != 0) { bVar6 = HasCollectible(this,299,0); if (bVar6 == 0) { if ((this->_temporaryeffects)._disabled == 0) { for (piVar13 = (this->_temporaryeffects)._effects._begin; piVar13 != (this->_temporaryeffects)._effects._end; piVar13 = piVar13 + 4) { iVar8 = *(int *)*piVar13; if ((((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) && (((int *)*piVar13)[1] == 299)) goto LAB_007a5d32; } } pvVar15 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar15 >> 2 < 300) { Item = (ItemConfig_Item *)0x0; } else { Item = *(ItemConfig_Item **)((int)pvVar15 + 0x4ac); } RemoveCostume(this,Item); } LAB_007a5d32: this->_cacheFlags = this->_cacheFlags | 0xffff; } bVar6 = HasTrinket(this,0x77,0); if (bVar6 != 0) { iVar8 = GetTrinketMultiplier(this,0x77); if (iVar8 == 1) { iVar8 = GetHealthType(this); if ((iVar8 == 1) || (iVar8 == 2)) { iVar8 = this->_maxHearts; } else { iVar8 = this->_maxHearts + this->_boneHearts * 2; } iVar8 = (iVar8 - this->_redHearts) / 2; } else { if (iVar8 != 2) { if (iVar8 == 3) { iVar8 = GetHealthType(this); if ((iVar8 == 1) || (iVar8 == 2)) { iVar8 = this->_maxHearts; } else { iVar8 = this->_maxHearts + this->_boneHearts * 2; } iVar8 = iVar8 - this->_redHearts; iVar14 = 1; if (1 < iVar8) { iVar14 = iVar8; } AddHearts(this,iVar14,0,0); uVar12 = Random(); spawnPos = Room::get_random_pickup_position(g_game->_room,&heartPos,0,0); Game::Spawn(g_game,5,10,spawnPos,&g_vectorZero,(Entity *)0x0,1,uVar12); uVar12 = Random(); spawnPos = Room::get_random_pickup_position(g_game->_room,&heartPos2,0,0); Game::Spawn(g_game,5,10,spawnPos,&g_vectorZero,(Entity *)0x0,1,uVar12); } goto LAB_007a5eb3; } iVar8 = GetHealthType(this); if ((iVar8 == 1) || (iVar8 == 2)) { iVar8 = this->_maxHearts - this->_redHearts; } else { iVar8 = (this->_maxHearts + this->_boneHearts * 2) - this->_redHearts; } } iVar14 = 1; if (1 < iVar8) { iVar14 = iVar8; } AddHearts(this,iVar14,0,0); } LAB_007a5eb3: if (g_game->_challenge == 0x1f) { pvVar15 = (this->_history)._historyItems._begin; local_34 = (Entity_Player *)0x0; iVar14 = (int)(this->_history)._historyItems._end - (int)pvVar15; iVar8 = iVar14 >> 0x1f; if (iVar14 / 0x1c + iVar8 != iVar8) { iVar8 = 0; do { if ((*(char *)((int)pvVar15 + iVar8 + 4) == '\0') && (bVar6 = HasCollectible(this,*(int *)((int)pvVar15 + iVar8 + 8),0), bVar6 != 0)) { RemoveCollectible(this,*(uint *)((int)(this->_history)._historyItems._begin + (int)local_34 * 0x1c + 8),0,0,1); break; } pvVar15 = (this->_history)._historyItems._begin; iVar8 = iVar8 + 0x1c; local_34 = (Entity_Player *)((int)local_34 + 1); } while (local_34 < (uint)(((int)(this->_history)._historyItems._end - (int)pvVar15) / 0x1c)); } AddMaxHearts(this,-2,0); if (((this->_redHearts < 1) && (this->_soulHearts < 1)) && (this->_boneHearts < 1)) { AddSoulHearts(this,1,0); } } pvVar15 = (this->_collectibleRNGs)._begin; local_48 = 0x500000001; uVar12 = g_game->_dungeonPlacementSeed; local_34 = (Entity_Player *)0x13; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar12 = uVar12 >> 1 ^ uVar12; uVar12 = uVar12 << 5 ^ uVar12; *(undefined8 *)((int)pvVar15 + 0x2c4) = 0x700000002; local_30 = (Game *)(uVar12 >> 0x13 ^ uVar12); *(undefined4 *)((int)pvVar15 + 0x2cc) = 9; *(Game **)((int)pvVar15 + 0x2c0) = local_30; pvVar15 = (this->_collectibleRNGs)._begin; local_38 = (uint *)((int)pvVar15 + 0x1440); if (local_30 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar12 = (uint)local_30 >> 1 ^ (uint)local_30; uVar12 = uVar12 << 5 ^ uVar12; uVar12 = uVar12 >> 0x13 ^ uVar12; *(undefined8 *)((int)pvVar15 + 0x1444) = 0x700000002; *local_38 = uVar12; *(undefined4 *)((int)pvVar15 + 0x144c) = 9; pvVar15 = (this->_collectibleRNGs)._begin; local_38 = (uint *)((int)pvVar15 + 0x13c0); if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar12 = uVar12 >> 1 ^ uVar12; uVar12 = uVar12 << 5 ^ uVar12; uVar12 = uVar12 >> 0x13 ^ uVar12; *(undefined8 *)((int)pvVar15 + 0x13c4) = 0x700000002; *local_38 = uVar12; *(undefined4 *)((int)pvVar15 + 0x13cc) = 9; pvVar15 = (this->_trinketRNGs)._begin; local_38 = (uint *)((int)pvVar15 + 0x2b0); if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar12 = uVar12 >> 1 ^ uVar12; uVar12 = uVar12 << 5 ^ uVar12; uVar12 = uVar12 >> 0x13 ^ uVar12; *(undefined8 *)((int)pvVar15 + 0x2b4) = 0x700000002; *local_38 = uVar12; *(undefined4 *)((int)pvVar15 + 700) = 9; pvVar15 = (this->_pillRNGs)._begin; local_38 = (uint *)((int)pvVar15 + 0x130); if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar12 = uVar12 >> 1 ^ uVar12; uVar12 = uVar12 << 5 ^ uVar12; *(undefined8 *)((int)pvVar15 + 0x134) = 0x700000002; *local_38 = uVar12 >> 0x13 ^ uVar12; *(undefined4 *)((int)pvVar15 + 0x13c) = 9; if (isForced == 0) { this->_hasGoldenKey = 0; this->_hasGoldenBomb = 0; } pvVar15 = (this->_levelEffectItems)._begin; if ((pvVar15 != (this->_levelEffectItems)._end) && ((std_vector *)local_100 != &this->_levelEffectItems)) { pvVar16 = (this->_levelEffectItems)._capacity; (this->_levelEffectItems)._begin = (void *)0x0; (this->_levelEffectItems)._end = (void *)0x0; (this->_levelEffectItems)._capacity = (void *)0x0; if (pvVar15 != (void *)0x0) { uVar12 = (int)pvVar16 - (int)pvVar15 & 0xfffffffc; pvVar16 = pvVar15; if (0xfff < uVar12) { pvVar16 = *(void **)((int)pvVar15 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)pvVar15 + (-4 - (int)pvVar16))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar12); } } manager = g_manager; this->_bloodLustCounter = 0; pvVar15 = (manager->_itemConfig)._collectibles._begin; if ((int)(manager->_itemConfig)._collectibles._end - (int)pvVar15 >> 2 < 0x9e) { iVar8 = 0; } else { iVar8 = *(int *)((int)pvVar15 + 0x274); } uVar12 = *(uint *)(iVar8 + 0x54) | this->_cacheFlags; this->_cacheFlags = uVar12; pvVar15 = (manager->_itemConfig)._collectibles._begin; if ((int)(manager->_itemConfig)._collectibles._end - (int)pvVar15 >> 2 < 0x2b8) { iVar8 = 0; } else { iVar8 = *(int *)((int)pvVar15 + 0xadc); } this->_cacheFlags = uVar12 | *(uint *)(iVar8 + 0x54); EvaluateItems(); if (isForced != 0) { uVar12 = 0; pvVar15 = g_game->_room; if (*(int *)((int)pvVar15 + 0x1264) != 0) { do { iVar8 = *(int *)(*(int *)((int)pvVar15 + 0x125c) + uVar12 * 4); if (((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 3)) && (*(Entity_Player **)(iVar8 + 0x410) == this)) { Entity_Familiar::level_start(); } uVar12 = uVar12 + 1; } while (uVar12 < *(uint *)((int)pvVar15 + 0x1264)); } } if (darkEsaus._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (darkEsaus._data != (void *)0x0) { uVar12 = *(uint *)((int)darkEsaus._data + -4); qVar5 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar12; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar5 < uVar12); free((uint *)((int)darkEsaus._data + -4)); } } ExceptionList = local_10; return; } //@@ 007a6300 Entity_Player::ShootCandle /* DB: Red Candle 0x268 / Blue Candle 0x1ef, random pick if both prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::ShootCandle(Entity_Player *this,Vector *direction) { byte bVar1; byte bVar2; uint uVar3; Vector local_10; if ((NAN(g_vectorZero.x)) || (NAN(g_vectorZero.y))) { local_10.x = g_vectorZero.x; local_10.y = g_vectorZero.y; } else { local_10.x = (this->_movementVector).x; if ((local_10.x == g_vectorZero.x) && ((this->_movementVector).y == g_vectorZero.y)) { local_10.x = 0.0; local_10.y = (float)&DAT_bf800000; } else { local_10.x = -local_10.x; local_10.y = (float)((uint)(this->_movementVector).y ^ 0x80000000); } } bVar1 = HasCollectible(this,0x268,0); bVar2 = HasCollectible(this,0x1ef,0); if (bVar1 == 0) { if (bVar2 == 0) { return; } } else if ((bVar2 == 0) || (uVar3 = Random(), (uVar3 & 1) == 0)) { ShootRedCandle(this,&local_10); return; } ShootBlueCandle(this,&local_10); return; } //@@ 007a6430 Entity_Player::GetTrinket /* ZHL [lua] Lua binding EntityPlayer:GetTrinket */ int __thiscall Entity_Player::GetTrinket(Entity_Player *this,uint param_2) { if (param_2 < 2) { return this->_trinketsID[param_2]; } return 0; } //@@ 007a6450 Entity_Player::SetControllerIndex /* ZHL [exact] __thiscall void Entity_Player::SetControllerIndex(int index, bool includePlayerOwned); */ void __thiscall Entity_Player::SetControllerIndex(Entity_Player *this,int param_2,char param_3) { int iVar1; uint uVar2; Game *pGVar3; uint uVar4; int *piVar5; void *pvVar6; int iVar7; uint uVar8; PlayerManager *pPVar9; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00aff9bd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *) "Entity_Player::SetControllerId() Setting controller ID to %d, (Prev: %d) \n"); pGVar3 = g_game; if ((param_2 != -1) && (iVar1 = this->_controllerIndex, iVar1 != param_2)) { if (iVar1 == -1) { FUN_009b94e0(param_2); } else if ((g_game->_playerManager).field_0x5c != '\0') { iVar7 = 0; piVar5 = (int *)&(g_game->_playerManager).field_0x60; do { if (*piVar5 == iVar1) { KAGE_LogMessage(1,(byte *)"Reassigning Player Color (%d) Prev(%d) New(%d) \n"); (pGVar3->_seedEffects)._stageSeeds[iVar7 + -0x25] = param_2; goto LAB_007a650d; } iVar7 = iVar7 + 1; piVar5 = piVar5 + 1; } while (iVar7 < 4); KAGE_LogMessage(8,(byte *) "PlayerManager::ReassignPlayerColor(%d, %d) cannot reassign the color, because there is no color assigned to the original controller ID \n" ); } } LAB_007a650d: if (this->_controllerIndex != -1) { iVar1 = *(int *)((int)g_game->_room + 0x125c); uVar2 = *(uint *)((int)g_game->_room + 0x1264); uVar8 = 0; uStack_8 = 0; if (uVar2 != 0) { do { iVar7 = __RTDynamicCast(*(undefined4 *)(iVar1 + uVar8 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4); if ((iVar7 != 0) && (*(int *)(iVar7 + 0xf1c) == this->_controllerIndex)) { *(int *)(iVar7 + 0xf1c) = param_2; } uVar8 = uVar8 + 1; } while (uVar8 < uVar2); } uStack_8 = 0xffffffff; } this->_controllerIndex = param_2; if (param_3 != '\0') { if (this->_subPlayer != 0) { SetControllerIndex((Entity_Player *)this->_subPlayer,param_2,0); } if (this->_backupPlayer != (void *)0x0) { SetControllerIndex(this->_backupPlayer,this->_controllerIndex,0); } if (this->_twinPlayer != (EntityPtr)0x0) { SetControllerIndex((Entity_Player *)this->_twinPlayer,this->_controllerIndex,0); } if (this->_parent == (EntityPtr)0x0) { uVar4 = 0; pPVar9 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar9->_playerList)._begin >> 2 != 0) { do { pvVar6 = (pPVar9->_playerList)._end; if ((int)pvVar6 - (int)(pPVar9->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (pPVar9->_playerList)._end; } piVar5 = (pPVar9->_playerList)._begin; if (uVar4 < (uint)((int)pvVar6 - (int)piVar5 >> 2)) { piVar5 = piVar5 + uVar4; } if (*(Entity_Player **)(*piVar5 + 0x3bc) == this) { SetControllerIndex((Entity_Player *)*piVar5,this->_controllerIndex,1); } uVar4 = uVar4 + 1; pPVar9 = &g_game->_playerManager; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar9->_playerList)._begin >> 2)); } } } ExceptionList = local_10; return; } //@@ 007a6680 Entity_Player::room_exit /* DB: ? (bool): per player from Game::ChangeRoom, the player update, 009bd150, 009bee80; RemoveCompassEffect, ClearTemporaryEffects, FlushQueueItem, ResetItemState, RemoveCoPlayer, TemporaryEffects::RemoveEffect/RemoveNullEffect prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::room_exit(Entity_Player *this,byte isKeepHolyMantle) { void **ppvVar1; byte bVar2; ItemConfig_Item *costumeItem; void *pvVar3; int *piVar4; int *piVar5; int *piVar6; int familiarCount; int iVar7; ItemConfig_Item *activeConfig; int local_44; ActiveItemDesc *activeDesc; int effectDesc [3]; undefined4 uStack_24; int removeDesc [3]; undefined4 uStack_14; uint activeItemId; int roomEntity; TemporaryEffects *tempEffects; FlushQueueItem(this); if (isKeepHolyMantle == 0) { this->_holyMantleState = 0; } tempEffects = &this->_temporaryeffects; *(undefined2 *)&this->field_0x13b5 = 0; this->_cursedPennyPending = 0; this->_roomDamageTaken = 0; *(undefined4 *)&this->field_0x16b8 = 0; bVar2 = TemporaryEffects::HasCollectibleEffect(tempEffects,0x15); if ((bVar2 != 0) && (bVar2 = HasCollectible(this,0x15,0), bVar2 == 0)) { Level::RemoveCompassEffect((Level *)g_game); } local_44 = this->_metronomeCollectibleID; if (local_44 != 0) { pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((0x7a0 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 & 0xfffffffcU) ) && (iVar7 = *(int *)((int)pvVar3 + 0x7a0), iVar7 != 0)) { effectDesc[2] = *(int *)(iVar7 + 0x78); effectDesc[1] = 0; uStack_24 = 0; effectDesc[0] = iVar7; TemporaryEffects::RemoveEffect(tempEffects,effectDesc,1); local_44 = this->_metronomeCollectibleID; } costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,local_44); this->_metronomeCollectibleID = 0; if ((this->_activeDesc[0]._item != local_44) && (bVar2 = HasCollectible(this,local_44,0), bVar2 == 0)) { RemoveCostume(this,costumeItem); } } if ((this->_temporaryeffects)._disabled == 0) { for (piVar5 = (this->_temporaryeffects)._effects._begin; piVar5 != (this->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) { if ((*(int *)*piVar5 == 2) && (((int *)*piVar5)[1] == 0x76)) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU) < 0xa1) { costumeItem = (ItemConfig_Item *)0x0; } else { costumeItem = *(ItemConfig_Item **)((int)pvVar3 + 0xa0); } RemoveCostume(this,costumeItem); break; } } } if ((((this->_temporaryeffects)._disabled == 0) && (pvVar3 = TemporaryEffects::GetCollectibleEffect(tempEffects,0x246), pvVar3 != (void *)0x0)) && (local_44 = *(int *)((int)pvVar3 + 4), 0 < local_44)) { do { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if (0x11c < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU)) { iVar7 = *(int *)((int)pvVar3 + 0x11c); if (iVar7 != 0) { effectDesc[2] = *(int *)(iVar7 + 0x78); effectDesc[1] = 0; uStack_24 = 0; effectDesc[0] = iVar7; if ((this->_temporaryeffects)._disabled == 0) { piVar5 = (this->_temporaryeffects)._effects._end; for (piVar4 = (this->_temporaryeffects)._effects._begin; piVar4 != piVar5; piVar4 = piVar4 + 4) { if (*piVar4 == iVar7) { piVar4[1] = piVar4[1] + 1; piVar4[2] = piVar4[2] + effectDesc[2]; goto LAB_007a68f1; } } if (piVar5 == (this->_temporaryeffects)._effects._capacity) { std::vector::_Emplace_reallocate(piVar5,effectDesc); } else { *piVar5 = iVar7; piVar5[1] = 0; piVar5[2] = effectDesc[2]; piVar5[3] = 0; ppvVar1 = &(this->_temporaryeffects)._effects._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } pvVar3 = (this->_temporaryeffects)._effects._begin; *(undefined4 *) ((((int)(this->_temporaryeffects)._effects._end - (int)pvVar3 & 0xfffffff0U) - 0xc) + (int)pvVar3) = 1; LAB_007a68f1: tempEffects->_cacheFlags = tempEffects->_cacheFlags | *(uint *)(effectDesc[0] + 0x54); (this->_temporaryeffects)._shouldEvaluateCache = 1; } } } pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((0x918 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 & 0xfffffffcU)) && (iVar7 = *(int *)((int)pvVar3 + 0x918), iVar7 != 0)) { removeDesc[2] = *(undefined4 *)(iVar7 + 0x78); removeDesc[1] = 0; uStack_14 = 0; removeDesc[0] = iVar7; TemporaryEffects::RemoveEffect(tempEffects,removeDesc,1); } local_44 = local_44 + -1; } while (local_44 != 0); } if ((this->_temporaryeffects)._disabled == 0) { piVar5 = (this->_temporaryeffects)._effects._begin; piVar4 = (this->_temporaryeffects)._effects._end; if (piVar5 != piVar4) { LAB_007a6984: if ((*(int *)*piVar5 != 0) || (((int *)*piVar5)[1] != 0x6e)) goto LAB_007a6991; if ((this->_playerType != 0x1a) || (this->_boneHearts + this->_goldenHearts + this->_soulHearts + this->_eternalHearts + this->_redHearts != 1)) goto LAB_007a6a2f; familiarCount = 0; iVar7 = *(int *)((int)g_game->_room + 0x1254); if (iVar7 != 0) { piVar5 = *(int **)((int)g_game->_room + 0x124c); do { roomEntity = *piVar5; if (((((roomEntity != 0) && (*(int *)(roomEntity + 0x28) == 3)) && (*(Entity_Player **)(roomEntity + 0x410) == this)) && ((*(int *)(roomEntity + 0x2c) == 0xee && (*(int *)(roomEntity + 0x30) != 7)))) && (*(char *)(roomEntity + 0x173) == '\0')) { familiarCount = familiarCount + 1; } piVar5 = piVar5 + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); if (familiarCount != 0) { LAB_007a6a2f: TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x6e,-1); } } } } LAB_007a6a3a: ClearTemporaryEffects(); activeDesc = this->_activeDesc; local_44 = 4; do { activeItemId = activeDesc->_item; if (activeItemId != 0) { if ((this->_temporaryeffects)._disabled == 0) { for (piVar5 = (this->_temporaryeffects)._effects._begin; piVar5 != (this->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) { iVar7 = *(int *)*piVar5; if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) && (*(uint *)(*piVar5 + 4) == activeItemId)) { if (activeItemId != 0x31) goto LAB_007a6b37; break; } } } if (g_game == (Game *)0x0) { if (-1 < (int)activeItemId) goto LAB_007a6af0; LAB_007a6b0a: activeConfig = (ItemConfig_Item *)0x0; } else if ((int)activeItemId < 0) { if (((int)activeItemId < 0) && (pvVar3 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~activeItemId < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar3 >> 2)) { activeConfig = (ItemConfig_Item *)**(undefined4 **)((int)pvVar3 + ~activeItemId * 4); } else { activeConfig = (ItemConfig_Item *)0x0; } } else { LAB_007a6af0: pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 >> 2 <= (int)activeItemId ) goto LAB_007a6b0a; activeConfig = *(ItemConfig_Item **)((int)pvVar3 + activeItemId * 4); } if ((activeConfig->addCostumeOnPickup == 0) || (bVar2 = HasCollectible(this,activeItemId,0), bVar2 == 0)) { RemoveCostume(this,activeConfig); } } LAB_007a6b37: activeDesc = activeDesc + 1; local_44 = local_44 + -1; } while (local_44 != 0); if ((this->_itemState != 0x25c) || (*(int *)&g_game->_stageTransition != 0)) { ANM2::Reset(&this->_bodySprite); this->_isPlayingItemAnimation = 0; ResetItemState(this); this->_itemStateCooldown = 0; } if (*(float *)&this->field_0x1d78 <= *(float *)&this->field_0x1c54 && *(float *)&this->field_0x1c54 != *(float *)&this->field_0x1d78) { list_anm2_state_assign(&this->field_0x1b34); } if (*(int *)&this->field_0x1c5c != 0) { *(undefined4 *)&this->field_0x1c60 = **(undefined4 **)&this->field_0x1c58; } std::deque<12byte>::_Tidy(); if ((this->_parent != (EntityPtr)0x0) && ((this->_temporaryeffects)._disabled == 0)) { piVar5 = (this->_temporaryeffects)._effects._begin; piVar4 = (this->_temporaryeffects)._effects._end; piVar6 = piVar5; if (piVar5 != piVar4) { do { if ((*(int *)*piVar6 == 0) && (((int *)*piVar6)[1] == 0x78)) goto LAB_007a6c2c; piVar6 = piVar6 + 4; } while (piVar6 != piVar4); while ((piVar6 = (int *)*piVar5, *piVar6 != 0 || (piVar6[1] != 0x79))) { piVar5 = piVar5 + 4; if (piVar5 == piVar4) { return; } } LAB_007a6c2c: PlayerManager::RemoveCoPlayer(&g_game->_playerManager,this,(byte)piVar6); } } return; LAB_007a6991: piVar5 = piVar5 + 4; if (piVar5 == piVar4) goto LAB_007a6a3a; goto LAB_007a6984; } //@@ 007a6c50 Entity_Player::room_enter /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: per-player new room setup: The Twins roll, enter position, greed wave clamp (trinkets-cards) */ void __thiscall Entity_Player::room_enter(Entity_Player *this) { Room *pRVar1; code *pcVar2; ANM2 *pAVar3; byte bVar4; int iVar5; uint uVar6; ItemConfig_Item *collectible; RoomDescriptor *roomDesc; uint uVar7; Entity *spawned; byte *format; void *pvVar8; int *piVar9; ItemConfig *itemConfig; int iVar10; Entity_Player *extraout_ECX; Entity_Player *extraout_ECX_00; Entity_Player *extraout_ECX_01; Entity_Player *extraout_ECX_02; Entity_Player *itemConfig; EntityConfig_Entity *entityConfig; std_string *psVar11; uint *activesCapacity; uint *puVar12; Game *game; undefined1 *wispChance; void *ptr; EntityPtr *pEVar13; EntityPtr followedPlayer; float fVar14; float fVar15; float fVar16; undefined4 uVar17; TypeDescriptor *pTVar18; TypeDescriptor *pTVar19; byte unk2; undefined4 uVar20; EntityRef charmRef; EntityRef sourceRef; ColorMod cloudColor; undefined1 lowerBound [8]; void *configNode; EntityList_EL queryList; float nullEffect; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; int collectibleEffect; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; Vector launchVelocity; Vector enterPos; uint configKey; uint collectibleId; EntityPtr local_90; void *actives; uint *activesEnd; uint *activesCapacityEnd; float *local_80; void *local_7c; EntityPtr *local_78; uint *local_74; undefined1 *local_70; std_string *entityName [5]; uint entityNameCapacity; byte message [64]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; GridEntity_Door *door; Manager *manager; undefined4 *nextNode; undefined4 *node; float *playerPos; float targetX; local_8 = 0xffffffff; puStack_c = &LAB_00affa03; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(message + 0x50); if (this->_postLevelInitFinished == 0) { return; } ExceptionList = &local_10; local_90 = (EntityPtr)this; if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 0xd & 1) != 0) { AddCurseMistEffect(this); } if (((*(int *)((int)g_game->_room + 8) == 0xf) && (*(int *)(*(int *)((int)g_game->_room + 4) + 0x40) == 1)) && (bVar4 = HasTrinket(this,0xb6,0), bVar4 != 0)) { wispChance = (undefined1 *)0x0; local_70 = (undefined1 *)0x0; iVar5 = GetTrinketMultiplier(this,0xb6); if (iVar5 == 2) { wispChance = (undefined1 *)0x32; LAB_007a6d0d: local_70 = wispChance; } else if (iVar5 == 3) { wispChance = (undefined1 *)0x64; goto LAB_007a6d0d; } local_7c = (void *)0x0; do { if (wispChance == (undefined1 *)0x0) { LAB_007a6f9e: AddWisp(this,0x248,(Vector *)((int)this + 0x33c),1,0); } else { iVar5 = *(int *)((int)this + 0x177c); puVar12 = (uint *)(iVar5 + 0xb60); uVar6 = *puVar12; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar12; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)*(undefined4 *)(iVar5 + 0xb64) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)*(undefined4 *)(iVar5 + 0xb68) & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)*(undefined4 *)(iVar5 + 0xb6c) & 0x1f) ^ uVar6; *puVar12 = uVar6; if (wispChance <= (undefined1 *)(uVar6 % 100)) goto LAB_007a6f9e; actives = (void *)0x0; puVar12 = (uint *)0x0; local_74 = (uint *)0x0; activesEnd = (uint *)0x0; activesCapacityEnd = (uint *)0x0; local_8 = 0; uVar6 = 0; itemConfig = &g_manager->_itemConfig; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2 != 0) { activesCapacity = (uint *)0x0; do { collectible = ItemConfig::GetCollectible(itemConfig,uVar6); if (collectible != (ItemConfig_Item *)0x0) { if (collectible->type == 3) { if (collectible[1].type != 0) { if (0 < *(short *)(collectible[1].type + 400)) { collectibleId = uVar6; if (puVar12 == activesCapacity) { std::vector::_Emplace_reallocate(puVar12,&collectibleId); activesCapacity = activesCapacityEnd; puVar12 = activesEnd; } else { *puVar12 = uVar6; activesEnd = puVar12 + 1; puVar12 = activesEnd; } } } } } uVar6 = uVar6 + 1; itemConfig = &g_manager->_itemConfig; } while (uVar6 < (uint)((int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2)); this = (Entity_Player *)local_90; local_74 = activesCapacity; } pvVar8 = actives; uVar6 = RNG::RandomInt((RNG *)(*(int *)((int)this + 0x177c) + 0xb60), (int)puVar12 - (int)actives >> 2); AddWisp(this,*(int *)((int)pvVar8 + uVar6 * 4),(Vector *)((int)this + 0x33c),1,0); local_8 = 0xffffffff; if (pvVar8 != (void *)0x0) { uVar6 = ((int)local_74 - (int)pvVar8 >> 2) * 4; ptr = pvVar8; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar8 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)ptr))) goto LAB_007a7912; } operator_delete(ptr,uVar6); actives = (void *)0x0; activesEnd = (uint *)0x0; activesCapacityEnd = (uint *)0x0; } wispChance = local_70; } manager = g_manager; local_7c = (void *)((int)local_7c + 1); } while ((int)local_7c < 5); local_7c = (void *)0x1d7; seed_fart_sound_override((int *)&local_7c); SoundEffects::Play(&manager->_sfxManager,(int)local_7c,1.0,2,0,1.0,0.0); } piVar9 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if (((piVar9 != (int *)0x0) && (piVar9[2] == 0x10)) && ((*piVar9 == 0x23 && ((*(int *)(*(int *)((int)this + 0x16c8) + 0x9e4) < 1 && (*(int *)((int)this + 0x13c0) != 0x28) ))))) { AddCollectible(this,0x279,0,1,0,0,0); } if ((*(int *)((int)this + 0x13c0) == 0x23) && (g_game->_challenge == 0x2a)) { pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 >> 2 < 0x6b) { iVar5 = 0; } else { iVar5 = *(int *)((int)pvVar8 + 0x1a8); } uVar6 = 0; piVar9 = (int *)((int)this + 0x122c); do { if (((-1 < *piVar9) && ((char)piVar9[3] == '\0')) && (iVar10 = *piVar9 * 0x130 + *(int *)((int)this + 0x1220), *(int *)(iVar10 + 0x114) == iVar5 )) { if (*(int *)(iVar10 + 0x54) != 0) { AnimationState::SetFrameFloat((AnimationState *)(iVar10 + 0x50),0.0); } break; } uVar6 = uVar6 + 1; piVar9 = piVar9 + 4; } while (uVar6 < 0xf); } bVar4 = HasTrinket(this,0xb7,0); if (bVar4 != 0) { iVar5 = *(int *)((int)this + 0x177c); iVar10 = GetTrinketMultiplier(this,0xb7); uVar6 = RNG::RandomInt((RNG *)(iVar5 + 0xb70),iVar10 + 1); twins_duplicate_familiars(this,uVar6); } bVar4 = HasCollectible(this,0x3b,0); itemConfig = extraout_ECX; if (bVar4 != 0) { bVar4 = HasCollectible(this,0x1da,0); itemConfig = extraout_ECX_00; if (bVar4 != 0) { bVar4 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)((int)this + 0x1508),0xd6); if (bVar4 == 0) { pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 < 0xd7) { collectibleEffect = 0; } else { collectibleEffect = *(int *)((int)pvVar8 + 0x358); } local_b0 = *(undefined4 *)(collectibleEffect + 0x78); if (1 < *(int *)&g_game->_deathmatchManager) { local_b0 = 300; } local_b4 = 0; local_ac = 0; TemporaryEffects::AddEffect((TemporaryEffects *)((int)this + 0x1508),&collectibleEffect,1,1) ; } bVar4 = HasCollectible(this,0x3b,0); itemConfig = extraout_ECX_01; if (((bVar4 != 0) && (itemConfig = (g_manager->_itemConfig)._nullItems._begin, 0x7b < (int)(g_manager->_itemConfig)._nullItems._end - (int)itemConfig >> 2)) && (fVar14 = (itemConfig->_splatColor)._tint[2], fVar14 != 0.0)) { local_c0 = *(undefined4 *)((int)fVar14 + 0x78); local_c4 = 0; local_bc = 0; nullEffect = fVar14; TemporaryEffects::AddEffect((TemporaryEffects *)((int)this + 0x1508),&nullEffect,1,4); itemConfig = extraout_ECX_02; } } } *(float *)((int)this + 0x1b1c) = g_vectorZero.x; *(float *)((int)this + 0x1b20) = g_vectorZero.y; GetEnterPosition(itemConfig,&enterPos); game = g_game; if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) && (uVar6 = g_game->_greedLastBeatenWave, uVar6 < (uint)g_game->_greedModeWave)) { uVar6 = -(uint)(uVar6 != 0) & uVar6; uVar7 = 0xc; if (uVar6 < 0xc) { uVar7 = uVar6; } g_game->_greedModeWave = uVar7; } local_80 = (float *)((int)this + 0x33c); *local_80 = enterPos.x; *(float *)((int)this + 0x340) = enterPos.y; *(float *)((int)this + 0x360) = g_vectorZero.x; *(float *)((int)this + 0x364) = g_vectorZero.y; *(undefined4 *)((int)this + 0x18a0) = 0; *(undefined4 *)((int)this + 0x1e70) = 0; *(undefined4 *)((int)this + 0x350) = 0; if ((*(uint *)((int)this + 0x16c) & 0x4000000) != 0) { *(undefined4 *)((int)this + 0x168) = *(undefined4 *)((int)this + 0x168); *(uint *)((int)this + 0x16c) = *(uint *)((int)this + 0x16c) & 0xfbffffff; *(undefined1 *)((int)this + 0x410) = 1; } roomDesc = Level::GetRoomByIdx((Level *)game,game->_lastRoomIdx,game->_lastRoomDimensionIdx); if ((*(int *)((int)roomDesc->Data + 8) == 0x10) && ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) & 0x10000) != 0)) { EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&queryList,0x38f,0,-1,0,0); local_8 = 1; if (queryList._size != 0) { uVar17 = *(undefined4 *)(*(int *)queryList._data + 0x340); *(undefined4 *)((int)this + 0x33c) = *(undefined4 *)(*(int *)queryList._data + 0x33c); *(undefined4 *)((int)this + 0x340) = uVar17; pcVar2 = *(code **)(*(int *)this + 0x54); uVar6 = Random(); local_70 = (undefined1 *) ((((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 70.0 + 90.0) * 0.017453292); local_74 = (uint *)sin((float)local_70); fVar14 = cos((float)local_70); launchVelocity.x = fVar14 * 6.0; launchVelocity.y = (float)local_74 * 6.0; EntityRef::constructor(&sourceRef,(Entity *)0x0); (*pcVar2)(&sourceRef,&launchVelocity,0x41900000); } local_8 = 0xffffffff; if (queryList._0_1_ == '\0') { local_8 = 2; tracked_alloc(1,queryList._data,0); local_8 = 0xffffffff; } } bVar4 = HasCollectible(this,0x253,0); if (bVar4 != 0) { fire_saturnus_tears(this); } if ((*(int *)((int)this + 0x3fc) != 0) && (*(char *)((int)this + 0x173) == '\0')) { *(undefined4 *)((int)this + 0x400) = 0; *(undefined4 *)((int)this + 0x3fc) = 0; *(undefined1 *)((int)this + 0x1398) = 0; *(undefined1 *)((int)this + 0x139a) = 0; *(undefined1 *)((int)this + 0x410) = 1; *(undefined4 *)((int)this + 0x188) = 4; } if (0 < *(int *)((int)this + 0x189c)) { *(undefined1 *)((int)this + 0x410) = 1; *(undefined4 *)((int)this + 0x188) = 4; *(undefined4 *)((int)this + 0x189c) = 0; *(undefined1 *)((int)this + 0x171) = 1; } if ((*(uint *)((int)this + 0x16c) & 0x2000000) == 0) { *(undefined4 *)((int)this + 0x188) = 4; } bVar4 = HasTrinket(this,0x4b,0); if ((bVar4 != 0) || (bVar4 = HasTrinket(this,0xa6,0), bVar4 != 0)) { *(uint *)((int)this + 0x1574) = *(uint *)((int)this + 0x1574) | 0xffff; EvaluateItems(); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); } bVar4 = HasTrinket(this,0x35,0); if (((bVar4 != 0) && (*(int *)((int)g_game->_room + 8) == 5)) && (*(char *)((int)g_game->_room + 1) != '\0')) { unk2 = 0; bVar4 = 0; iVar5 = GetTrinketMultiplier(this,0x35); AddHearts(this,iVar5 * 2,bVar4,unk2); } bVar4 = HasCollectible(this,0x24e,0); if ((bVar4 != 0) && (pvVar8 = g_game->_room, *(int *)((int)pvVar8 + 8) == 1)) { uVar6 = 0; do { door = *(GridEntity_Door **)((int)pvVar8 + uVar6 * 4 + 0x724); if ((door != (GridEntity_Door *)0x0) && (door->_targetRoomType == 1)) { GridEntity_Door::Open(door); } uVar6 = uVar6 + 1; } while (uVar6 < 8); } bVar4 = HasTrinket(this,0x7c,0); if (bVar4 != 0) { uVar6 = g_game->_enterDoor; if (uVar6 == 0xffffffff) { uVar6 = 0; do { iVar5 = *(int *)((int)g_game->_room + uVar6 * 4 + 0x724); if ((iVar5 != 0) && (iVar5 = *(int *)(iVar5 + 0x24), iVar10 = *(int *)((int)g_game->_room + 0xc), fVar15 = *(float *)((int)this + 0x33c) - ((float)(iVar5 % iVar10) * 40.0 + 40.0), fVar14 = *(float *)((int)this + 0x340) - ((float)(iVar5 / iVar10) * 40.0 + 120.0), fVar14 * fVar14 + fVar15 * fVar15 < 10000.0)) goto LAB_007a75ef; uVar6 = uVar6 + 1; } while (uVar6 < 8); } else { LAB_007a75ef: if (-1 < (int)uVar6) { if ((int)uVar6 < 8) { door = *(GridEntity_Door **)((int)g_game->_room + uVar6 * 4 + 0x724); iVar5 = GetTrinketMultiplier(this,0x7c); if ((door == (GridEntity_Door *)0x0) || (GridEntity_Door::Open(door), iVar5 < 3)) goto LAB_007a7642; if (((uint)door->_doorFlags >> 3 & 1) != 0) { GridEntity_Door::TryUnlock(door,this,1); } } else { iVar5 = GetTrinketMultiplier(this,0x7c); LAB_007a7642: if (iVar5 < 2) goto LAB_007a766b; } if (g_game->_lastRoomIdx == -5) { Room::TrySpawnBossRushDoor(g_game->_room,1,1); } } } } LAB_007a766b: if (g_game->_isLevelGenerating == 0) { spawn_low_health_blood_splat(); } bVar4 = HasCollectible(this,0x15e,0); if ((bVar4 != 0) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { cloudColor._tint[0] = 1.0; cloudColor._tint[1] = 1.0; cloudColor._tint[2] = 1.0; cloudColor._tint[3] = 1.0; cloudColor._offset[0] = 0.0; cloudColor._offset[1] = 0.0; cloudColor._offset[2] = 0.0; cloudColor._colorize[0] = _DAT_00bac030; cloudColor._colorize[1] = _UNK_00bac034; cloudColor._colorize[2] = _UNK_00bac038; cloudColor._colorize[3] = _UNK_00bac03c; Game::start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),&cloudColor); } bVar4 = HasCollectible(this,0x1f9,0); if (((bVar4 != 0) && (*(char *)((int)g_game->_room + 1) != '\0')) && ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) { iVar5 = *(int *)((int)this + 6000); puVar12 = (uint *)(iVar5 + 0x1f90); uVar6 = *puVar12; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar12; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)*(undefined4 *)(iVar5 + 0x1f94) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)*(undefined4 *)(iVar5 + 0x1f98) & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)*(undefined4 *)(iVar5 + 0x1f9c) & 0x1f) ^ uVar6; *puVar12 = uVar6; if (uVar6 == (uVar6 / 5) * 5) { iVar5 = *(int *)((int)this + 6000); puVar12 = (uint *)(iVar5 + 0x1f90); uVar6 = *puVar12; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar12; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)*(undefined4 *)(iVar5 + 0x1f94) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)*(undefined4 *)(iVar5 + 0x1f98) & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)*(undefined4 *)(iVar5 + 0x1f9c) & 0x1f) ^ uVar6; *puVar12 = uVar6; uVar6 = *(uint *)(&DAT_00b6bc74 + (uVar6 % 6) * 4); uVar7 = Random(); uVar20 = 0; pTVar19 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar18 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar17 = 0; spawned = Game::Spawn(g_game,uVar6,0,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)this,0,uVar7); spawned = (Entity *)__RTDynamicCast(spawned,uVar17,pTVar18,pTVar19,uVar20); EntityRef::constructor(&charmRef,(Entity *)this); Entity::AddCharmed(spawned,&charmRef,-1,0,0); (**(code **)(*(int *)spawned + 0xc))(); Entity::SetVisibleFlag(spawned,0); manager = g_manager; uVar6 = uVar6 << 0x14; configKey = uVar6; _Find_lower_bound<>(lowerBound,&configKey); if (((*(char *)((int)configNode + 0xd) == '\0') && (*(uint *)((int)configNode + 0x10) <= uVar6)) && (configNode != (manager->_entityConfig)._entities._head)) { entityConfig = (EntityConfig_Entity *)((int)configNode + 0x18); } else { entityConfig = (EntityConfig_Entity *)0x0; } EntityConfig_Entity::GetName(entityConfig,(std_string *)entityName,0x14); local_8 = 3; psVar11 = (std_string *)entityName; if (0xf < entityNameCapacity) { psVar11 = entityName[0]; } format = string_table_translate(&g_manager->_stringTable,(byte *)"#POKE_GO_APPEAR_NOTIFY"); sprintf(message,format); HUD::show_fortune_line(message,format,psVar11); local_8 = 0xffffffff; if (0xf < entityNameCapacity) { uVar6 = entityNameCapacity + 1; psVar11 = entityName[0]; if (0xfff < uVar6) { psVar11 = (std_string *)entityName[0][-1]._capacity; uVar6 = entityNameCapacity + 0x24; if (0x1f < (uint)((int)entityName[0] + (-4 - (int)psVar11))) { LAB_007a7912: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar11,uVar6); } entityName[0] = (std_string *)((uint)entityName[0] & 0xffffff00); } } bVar4 = HasCollectible(this,0x1bd,0); game = g_game; if (bVar4 != 0) { local_70 = (undefined1 *)((int)g_game->_room + 0x724); uVar6 = 0; do { iVar5 = *(int *)(local_70 + uVar6 * 4); if (((iVar5 != 0) && (*(int *)(iVar5 + 0xc) != 2)) && ((*(int *)(iVar5 + 0x160) == 7 || (*(int *)(iVar5 + 0x160) == 8)))) { roomDesc = Level::GetRoomByIdx((Level *)game,*(int *)(iVar5 + 0x394),-1); manager = g_manager; if (roomDesc->VisitedCount == 0) { if ((*(undefined1 **)((int)this + 0x1b24) != (undefined1 *)0x0) && (0 < *(int *)((int)this + 0x1b2c))) { local_74 = *(uint **)((int)this + 0x1b28); iVar5 = *(int *)((int)this + 0x1b30); local_70 = *(undefined1 **)((int)this + 0x1b24); seed_fart_sound_override((int *)&local_70); SoundEffects::Play(&manager->_sfxManager,(int)local_70,(float)local_74,iVar5,0,1.0,0.0); } game = g_game; *(undefined4 *)((int)this + 0x1b24) = 0x1ba; *(undefined4 *)((int)this + 0x1b28) = 0x3f800000; *(undefined4 *)((int)this + 0x1b2c) = 0x1e; *(undefined4 *)((int)this + 0x1b30) = 2; break; } game = g_game; } uVar6 = uVar6 + 1; } while (uVar6 < 8); manager = g_manager; if (((((((game->_levelStateFlags & 0x2000U) == 0) && (iVar5 = *(int *)((int)game->_room + 0x768), -1 < iVar5)) && (iVar5 < 0x1c0)) && (iVar5 = *(int *)((int)game->_room + iVar5 * 4 + 0x24), iVar5 != 0)) && ((iVar10 = *(int *)(iVar5 + 4), iVar10 == 2 || ((iVar10 != 3 && ((((iVar10 == 4 || (iVar10 == 5)) || ((iVar10 == 6 || (iVar10 == 0x16)))) || ((iVar10 != 0x18 && (((iVar10 == 0x19 || (iVar10 == 0x1a)) || (iVar10 == 0x1b)))))))))))) && (*(int *)(iVar5 + 0xc) != 2)) { if ((*(uint **)((int)this + 0x1b24) != (uint *)0x0) && (0 < *(int *)((int)this + 0x1b2c))) { local_78 = *(EntityPtr **)((int)this + 0x1b28); iVar5 = *(int *)((int)this + 0x1b30); local_74 = *(uint **)((int)this + 0x1b24); seed_fart_sound_override((int *)&local_74); SoundEffects::Play(&manager->_sfxManager,(int)local_74,(float)local_78,iVar5,0,1.0,0.0); game = g_game; } *(undefined4 *)((int)this + 0x1b24) = 0x1b9; *(undefined4 *)((int)this + 0x1b28) = 0x3f800000; *(undefined4 *)((int)this + 0x1b2c) = 0x3c; *(undefined4 *)((int)this + 0x1b30) = 2; } } if (((*(byte *)(*(int *)((int)game->_room + 4) + 0x44) & 1) == 0) && (*(char *)((int)game->_room + 1) != '\0')) { spawn_locusts(this); game = g_game; } iVar5 = *(int *)((int)this + 0x2c); if (iVar5 == 1) { *(undefined1 *)((int)this + 0x1b10) = 1; if (*(int *)((int)this + 0x1aec) != 0x3a) goto LAB_007a7cd9; followedPlayer = *(EntityPtr *)((int)this + 0x3bc); if ((followedPlayer == (EntityPtr)0x0) || (*(int *)((int)followedPlayer + 0x28) != 1)) { pEVar13 = (game->_playerManager)._playerList._begin; if ((int)(game->_playerManager)._playerList._end - (int)pEVar13 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pEVar13 = (game->_playerManager)._playerList._begin; } followedPlayer = *pEVar13; } uVar6 = Random(); spawned = Game::Spawn(g_game,1000,0x72,(Vector *)((int)followedPlayer + 0x33c),&g_vectorZero, (Entity *)0x0,0,uVar6); if (spawned->_child != (EntityPtr)0x0) { local_78 = &spawned->_child; std::multiset::erase(&local_78); } spawned->_child = followedPlayer; if (followedPlayer != (EntityPtr)0x0) { std::multiset::insert(&spawned->_child); } pEVar13 = &spawned->_target; if (spawned->_target != (EntityPtr)0x0) { local_78 = pEVar13; std::multiset::erase(&local_78); } *pEVar13 = (EntityPtr)this; std::multiset::insert(pEVar13); iVar5 = *(int *)spawned; pAVar3 = &spawned[1]._sprite; (pAVar3->_animDefaultName)._buf[0xc] = '\0'; (pAVar3->_animDefaultName)._buf[0xd] = '\0'; (pAVar3->_animDefaultName)._buf[0xe] = -0x10; (pAVar3->_animDefaultName)._buf[0xf] = 'B'; (**(code **)(iVar5 + 0xc))(); iVar5 = *(int *)((int)this + 0x2c); game = g_game; } if ((iVar5 == 0) && (*(char *)((int)game->_room + 1) != '\0')) { *(int *)((int)this + 0x1820) = *(int *)((int)this + 0x1820) + 1; bVar4 = HasCollectible(this,0x151,0); if ((bVar4 != 0) && ((*(byte *)((int)this + 0x1820) & 3) == 0)) { pRVar1 = g_game->_room; uVar6 = Random(); manager = g_manager; pRVar1->_brokenWatchState = 2 - (uint)(uVar6 % 10 != 0); fVar14 = Room::time_scale_update(pRVar1); (manager->_musicManager)._targetPitch = fVar14; } game = g_game; } LAB_007a7cd9: if ((((*(int *)((int)this + 0x2c) == 1) && (*(int *)((int)this + 0x3bc) != 0)) && (roomDesc = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx,-1), roomDesc->ListIndex == g_game->_lastBossRoomListIdx)) && (g_game->_stage == 6)) { uVar17 = *(undefined4 *)(*(int *)((int)this + 0x3bc) + 0x340); *(undefined4 *)((int)this + 0x33c) = *(undefined4 *)(*(int *)((int)this + 0x3bc) + 0x33c); *(undefined4 *)((int)this + 0x340) = uVar17; } piVar9 = (int *)((int)this + 0x13e0); iVar5 = 4; do { if ((int *)*piVar9 != (int *)0x0) { (**(code **)(*(int *)*piVar9 + 0x2c))(); } piVar9 = piVar9 + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); if (*(int **)((int)this + 0x13dc) != (int *)0x0) { (**(code **)(**(int **)((int)this + 0x13dc) + 0x2c))(); } pRVar1 = g_game->_room; iVar10 = (int)((*(float *)((int)this + 0x33c) - 40.0) / 40.0 + 0.5); iVar5 = (int)((*(float *)((int)this + 0x340) - 120.0) / 40.0 + 0.5); if (*(char *)((int)this + 0x1570) == '\0') { if (((((-1 < iVar10) && (iVar10 < pRVar1->_gridWidth)) && ((-1 < iVar5 && ((iVar5 < pRVar1->_gridHeight && (uVar6 = pRVar1->_gridWidth * iVar5 + iVar10, uVar6 < 0x1c0)))))) && (pRVar1->_gridEntities[uVar6] != (void *)0x0)) && (*(int *)((int)pRVar1->_gridEntities[uVar6] + 4) == 0xe)) { Room::RemoveGridEntity(pRVar1,pRVar1->_gridWidth * iVar5 + iVar10,900,1); } } else if ((((-1 < iVar10) && (iVar10 < pRVar1->_gridWidth)) && (-1 < iVar5)) && (((iVar5 < pRVar1->_gridHeight && (uVar6 = pRVar1->_gridWidth * iVar5 + iVar10, uVar6 < 0x1c0)) && (((pvVar8 = pRVar1->_gridEntities[uVar6], pvVar8 != (void *)0x0 && ((*(int *)((int)pvVar8 + 4) == 0xe && (*(int *)((int)pvVar8 + 8) == 1)))) && (iVar5 = __RTDynamicCast(pvVar8,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::GridEntity_Poop::RTTI_Type_Descriptor,0) , *(int *)(iVar5 + 8) == 1)))))) { *(undefined4 *)(iVar5 + 0xc) = 1000; *(undefined4 *)(iVar5 + 0x154) = 0x78; *(undefined4 *)(iVar5 + 0x3c) = 0; pvVar8 = ANM2::GetAnimationData((ANM2 *)(iVar5 + 0x40),(byte *)"State5"); iVar10 = *(int *)((int)pvVar8 + 0x30); bVar4 = ANM2::SetAnimation((ANM2 *)(iVar5 + 0x40),(byte *)"State5",1); if (((bVar4 != 0) && (*(int *)(iVar5 + 0x74) != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(iVar5 + 0x70),(float)iVar10), *(int *)(iVar5 + 0x74) != 0)) { *(undefined1 *)(iVar5 + 0x84) = 0; } } pvVar8 = g_game->_room; if (g_game->_enterDoor + 1U < 9) { iVar5 = *(int *)((int)pvVar8 + g_game->_enterDoor * 4 + 0x724); } else { iVar5 = 0; } local_7c = pvVar8; uVar6 = Random(); fVar14 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_78 = (EntityPtr *)(fVar14 + fVar14); local_74 = (uint *)cos((float)local_78); local_70 = (undefined1 *)sin((float)local_78); playerPos = local_80; if (iVar5 != 0) { switch(*(undefined4 *)(iVar5 + 0x164)) { case 0: local_74 = (uint *)0x3f800000; local_70 = (undefined1 *)0x0; break; case 1: local_74 = (uint *)0x0; local_70 = (undefined1 *)0x3f800000; break; case 2: local_74 = (uint *)&DAT_bf800000; local_70 = (undefined1 *)0x0; break; case 3: local_74 = (uint *)0x0; local_70 = &DAT_bf800000; } } uVar6 = 0; if (*(int *)((int)pvVar8 + 0x1254) != 0) { do { if ((g_game->_isRestoringGlowingHourglassState == 0) || (piVar9 = *(int **)(*(int *)((int)pvVar8 + 0x124c) + uVar6 * 4), piVar9[10] != 0x322)) { iVar5 = *(int *)(*(int *)((int)pvVar8 + 0x124c) + uVar6 * 4); if (((*(uint *)(iVar5 + 0x168) & 0x20000000) != 0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)(iVar5 + 0x28) == 1)) || (*(int *)(iVar5 + 0x28) - 10U < 0x3de)))) { piVar9 = (int *)__RTDynamicCast(iVar5,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0) ; uVar7 = Random(); local_80 = (float *)((float)(int)(uVar7 % 0x5a - 0x2d) * 0.017453292); local_78 = (EntityPtr *)cos((float)local_80); fVar14 = sin((float)local_80); local_80 = (float *)((float)local_78 * (float)local_74 - fVar14 * (float)local_70); local_78 = (EntityPtr *)(fVar14 * (float)local_74 + (float)local_78 * (float)local_70); uVar7 = Random(); iVar5 = piVar9[10]; fVar14 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 10.0; if (((iVar5 == 0x24) || (iVar5 == 0x106)) || (iVar5 == 0x107)) { fVar14 = (float)piVar9[0xdc]; } fVar15 = (float)piVar9[0xce]; targetX = (float)piVar9[0xcd]; fVar16 = (float)local_80 * fVar14 + *playerPos; fVar14 = (float)local_78 * fVar14 + playerPos[1]; if (3600.0 < targetX * targetX + fVar15 * fVar15) { piVar9[0xcd] = (int)((targetX - (float)piVar9[0xcf]) + fVar16); piVar9[0xce] = (int)((fVar15 - (float)piVar9[0xd0]) + fVar14); } piVar9[0xcf] = (int)fVar16; piVar9[0xd0] = (int)fVar14; piVar9[0x106] = (int)g_vectorZero.x; piVar9[0x107] = (int)g_vectorZero.y; piVar9[0x108] = (int)g_vectorZero.x; piVar9[0x109] = (int)g_vectorZero.y; if (piVar9[10] == 0x1e) { (**(code **)(*piVar9 + 0xc))(); piVar9[0xcd] = piVar9[0xcf]; piVar9[0xce] = piVar9[0xd0]; } pvVar8 = local_7c; } } else { (**(code **)(*piVar9 + 0x28))(); } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar8 + 0x1254)); this = (Entity_Player *)local_90; } bVar4 = HasTrinket(this,0x5d,0); if (((bVar4 != 0) && (pvVar8 = g_game->_room, (*(byte *)(*(int *)((int)pvVar8 + 4) + 0x44) & 1) == 0)) && (*(char *)((int)pvVar8 + 1) != '\0')) { iVar10 = *(int *)((int)pvVar8 + 0x12c4) + *(int *)((int)pvVar8 + 0x12c0); iVar5 = 0; if (0 < iVar10) { iVar5 = iVar10; } if (((0 < iVar5) && (g_game->_isRestoringGlowingHourglassState == 0)) && (iVar5 = GetTrinketMultiplier(this,0x5d), 0 < iVar5)) { do { AddBlueFlies(this,1,(Vector *)((int)this + 0x33c),(Entity *)0x0); iVar5 = iVar5 + -1; } while (iVar5 != 0); } } bVar4 = HasTrinket(this,0xb0,0); if (bVar4 != 0) { spawn_lil_clot_familiars(); } if (*(int *)((int)this + 0x13c0) == 0x11) { spawn_forgotten_body(this); } preload_item_sounds(this); node = *(undefined4 **)((int)this + 0x1b34); *(undefined4 *)node[1] = 0; node = (undefined4 *)*node; while (node != (undefined4 *)0x0) { /* WARNING: Read-only address (ram,0x00bac030) is written */ nextNode = (undefined4 *)*node; operator_delete(node,0x28); node = nextNode; } /* WARNING: Read-only address (ram,0x00bac030) is written */ *(undefined4 *)*(undefined4 *)((int)this + 0x1b34) = *(undefined4 *)((int)this + 0x1b34); *(int *)(*(int *)((int)this + 0x1b34) + 4) = *(int *)((int)this + 0x1b34); *(undefined4 *)((int)this + 0x1b38) = 0; *(undefined4 *)((int)this + 0x1b3c) = **(undefined4 **)((int)this + 0x1b34); *(undefined4 *)((int)this + 0x1c54) = 0; if (*(int *)((int)this + 0x1c5c) != 0) { *(undefined4 *)((int)this + 0x1c60) = **(undefined4 **)((int)this + 0x1c58); } /* WARNING: Read-only address (ram,0x00bac030) is written */ ExceptionList = local_10; return; } //@@ 007a8350 Entity_Player::TriggerNewRoom_TemporaryEffects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix20/21] __thiscall void Entity_Player::TriggerNewRoom_TemporaryEffects(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::TriggerNewRoom_TemporaryEffects(Entity_Player *this) { code *pcVar1; byte bVar2; char isCrownActive; int iVar3; uint uVar4; ItemConfig_Item *item; RoomDescriptor *roomDesc; void *pvVar5; int trinketMultiplier; int *effectIter; Game *game; uint *trinketSeed; int local_38 [8]; RNG RStack_18; uint local_8; char *crownAnim; uint levelEffectItemId; Manager *manager; local_8 = __security_cookie ^ (uint)(local_38 + 0xd); bVar2 = HasTrinket(this,0x20,0); if (bVar2 != 0) { iVar3 = GetTrinketMultiplier(this,0x20); if (((int)(4 / (longlong)iVar3) == 0) || (uVar4 = Random(), (int)((ulonglong)uVar4 % (4 / (longlong)iVar3 & 0xffffffffU)) == 0)) { pvVar5 = (this->_trinketRNGs)._begin; trinketSeed = (uint *)((int)pvVar5 + 0x200); local_38[6] = 0xc; local_38[7] = 0x47; RStack_18._seed = 0x79; RStack_18._shift1 = 0x78; RStack_18._shift2 = 0x156; RStack_18._shift3 = 0x18e; uVar4 = *trinketSeed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *trinketSeed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } manager = g_manager; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x204) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar5 + 0x208) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x20c) & 0x1f) ^ uVar4; *trinketSeed = uVar4; RStack_18._seed = (int)ItemConfig::GetCollectible(&manager->_itemConfig,local_38[uVar4 % 6 + 6]); RStack_18._4_8_ = (ulonglong)(uint)((ItemConfig_Item *)RStack_18._seed)->maxCooldown << 0x20; RStack_18._shift3 = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } } bVar2 = HasTrinket(this,0x84,0); if (bVar2 != 0) { iVar3 = GetTrinketMultiplier(this,0x84); if (((int)(4 / (longlong)iVar3) == 0) || (uVar4 = Random(), (int)((ulonglong)uVar4 % (4 / (longlong)iVar3 & 0xffffffffU)) == 0)) { add_random_drug_item_effect(this); } } bVar2 = HasTrinket(this,0x99,0); if (bVar2 != 0) { iVar3 = GetTrinketMultiplier(this,0x99); if (((int)(4 / (longlong)iVar3) == 0) || (uVar4 = Random(), (int)((ulonglong)uVar4 % (4 / (longlong)iVar3 & 0xffffffffU)) == 0)) { AddRandomMomItemEffect(this); } } bVar2 = HasCollectible(this,0x2a1,0); if (bVar2 != 0) { iVar3 = *(int *)((int)g_game->_room + 4); if ((((iVar3 != 0) && (*(int *)(iVar3 + 0x40) == 1)) && ((*(int *)((int)g_game->_room + 8) == 0xe || ((*(uint *)(iVar3 + 0x44) >> 0xb & 1) != 0)))) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x2a1), bVar2 == 0)) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x2a1,1,1); } } iVar3 = this->_modelingClayEffect; this->_modelingClayEffect = 0; if (iVar3 != 0) { item = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar3); if (item != (ItemConfig_Item *)0x0) { this->_cacheFlags = this->_cacheFlags | item->cacheFlags; (this->_temporaryeffects)._shouldEvaluateCache = 1; } TryRemoveCollectibleCostume(this,iVar3,0); } bVar2 = HasTrinket(this,0xa6,0); if (bVar2 != 0) { roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); if ((ItemConfig_Item *)roomDesc->SpawnSeed != (ItemConfig_Item *)0x0) { RStack_18._shift1 = 7; RStack_18._shift2 = 0x11; RStack_18._shift3 = 0x15; RStack_18._seed = roomDesc->SpawnSeed; iVar3 = GetTrinketMultiplier(this,0xa6); uVar4 = RNG::RandomInt(&RStack_18,(uint)(2 / (longlong)iVar3)); if (uVar4 == 0) { ModelingClay_roll(&RStack_18); } } } if (this->_holyMantleState == 0) { bVar2 = HasCollectible(this,0x139,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x139), bVar2 == 0)) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x139,1,1); } bVar2 = HasCollectible(this,0x217,0); if ((bVar2 != 0) && (*(int *)((int)g_game->_room + 8) == 5)) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x139,1,1); TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x217,1,1); } } else { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4e4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU) ) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x4e4), item != (ItemConfig_Item *)0x0)) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::RemoveEffect(&this->_temporaryeffects,&RStack_18,1); } manager = g_manager; if ((((this->_temporaryeffects)._disabled != 0) || (pvVar5 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x139), pvVar5 == (void *)0x0)) || (*(int *)((int)pvVar5 + 4) < 1)) { pvVar5 = (manager->_itemConfig)._collectibles._begin; if ((int)((int)(manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU) < 0x4e5) { RemoveCostume(this,(ItemConfig_Item *)0x0); } else { RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar5 + 0x4e4)); } } } bVar2 = HasCollectible(this,299,0); if ((bVar2 != 0) || (iVar3 = GetZodiacEffect(this), iVar3 == 299)) { this->_taurusSpeedBonus = 0.0; local_38[5] = 0; local_38[6] = 0; local_38[7] = 0; RStack_18._seed = 0; RStack_18._shift1 = 0; RStack_18._shift2 = 0; RStack_18._shift3 = 0; local_38[1] = 0x3f800000; local_38[2] = 0x3f800000; local_38[3] = 0x3f800000; local_38[4] = 0x3f800000; (**(code **)(*(int *)this + 0x3c))(local_38 + 1,0xffffffff,0xff,0,1); if ((*(char *)((int)g_game->_room + 1) != '\0') && ((pvVar5 = (g_manager->_itemConfig)._collectibles._begin, 0x4ac < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x4ac), item != (ItemConfig_Item *)0x0)))) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } } bVar2 = HasCollectible(this,0x7a,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x7a), bVar2 == 0)) { TryRemoveCollectibleCostume(this,0x7a,0); if ((this->_redHearts < 2) || ((this->_playerType == 5 && ((this->_redHearts < 3 || (bVar2 = HasCollectible(this,0x26b,0), bVar2 != 0)))))) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x7a,1,1); } } bVar2 = HasTrinket(this,0x21,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,100), bVar2 == 0)) { trinketMultiplier = GetTrinketMultiplier(this,0x21); iVar3 = 1; if (trinketMultiplier == 2) { iVar3 = 2; } else if (2 < trinketMultiplier) { iVar3 = 3; } if (this->_redHearts <= iVar3) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,100,1,1); } } bVar2 = HasCollectible(this,0x199,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x199), bVar2 == 0)) { pvVar5 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 & 0xfffffffcU) < 0x49) { item = (ItemConfig_Item *)0x0; } else { item = *(ItemConfig_Item **)((int)pvVar5 + 0x48); } RemoveCostume(this,item); if (this->_redHearts < 1) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x199,1,1); pvVar5 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 & 0xfffffffcU) < 0x49) { item = (ItemConfig_Item *)0x0; } else { item = *(ItemConfig_Item **)((int)pvVar5 + 0x48); } AddCostume(this,item,0); } } bVar2 = HasCollectible(this,0x8e,0); if (((bVar2 != 0) && (pvVar5 = (g_manager->_itemConfig)._collectibles._begin, 0x238 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU))) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x238), item != (ItemConfig_Item *)0x0)) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } bVar2 = HasCollectible(this,0x197,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x197), bVar2 == 0)) { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x65c < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU) ) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x65c), item != (ItemConfig_Item *)0x0)) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } pvVar5 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 & 0xfffffffcU) < 0x45) { item = (ItemConfig_Item *)0x0; } else { item = *(ItemConfig_Item **)((int)pvVar5 + 0x44); } AddCostume(this,item,0); update_purity_glow(this); } bVar2 = HasCollectible(this,0x19f,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x19f), bVar2 == 0)) { bVar2 = HasFullHearts(this); if (bVar2 == 0) { crownAnim = "FloatNoGlow"; } else { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x19f,1,1); crownAnim = "FloatGlow"; } ANM2::Play(&this->_crownOfLightSprite,(byte *)crownAnim,0); } bVar2 = HasCollectible(this,0x1ba,0); if ((bVar2 != 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1ba), bVar2 == 0)) { isCrownActive = FUN_007db360(); if (isCrownActive == '\0') { crownAnim = "FloatNoGlow"; } else { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x1ba,1,1); crownAnim = "FloatGlow"; } ANM2::Play(&this->_darkPrincesCrownSprite,(byte *)crownAnim,0); } iVar3 = 0; if ((this->_holyMantleStacks & 0xf0) != 0) { do { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4e4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU)) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x4e4), item != (ItemConfig_Item *)0x0)) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } iVar3 = iVar3 + 1; } while (iVar3 < (int)(uint)(this->_holyMantleStacks >> 4)); } if ((this->_temporaryeffects)._disabled == 0) { for (effectIter = (this->_temporaryeffects)._effects._begin; effectIter != (this->_temporaryeffects)._effects._end; effectIter = effectIter + 4) { if ((*(int *)*effectIter == 0) && (((int *)*effectIter)[1] == 0x2e)) { pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4e4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU)) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x4e4), item != (ItemConfig_Item *)0x0)) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } break; } } } if ((((this->_variant == 0) && (bVar2 = HasCollectible(this,0x1f1,0), bVar2 != 0)) && (pvVar5 = (g_manager->_itemConfig)._collectibles._begin, 0x7c4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU))) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0x7c4), item != (ItemConfig_Item *)0x0)) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } bVar2 = HasCollectible(this,0x24c,0); if (bVar2 != 0) { if ((this->_temporaryeffects)._disabled == 0) { for (effectIter = (this->_temporaryeffects)._effects._begin; effectIter != (this->_temporaryeffects)._effects._end; effectIter = effectIter + 4) { if ((*(int *)*effectIter == 0) && (((int *)*effectIter)[1] == 0x38)) goto LAB_007a8d7b; } } pvVar5 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 & 0xfffffffcU) < 0xe1) { item = (ItemConfig_Item *)0x0; } else { item = *(ItemConfig_Item **)((int)pvVar5 + 0xe0); } RemoveCostume(this,item); if (((-1 < g_game->_lastBossRoomListIdx) && ((g_game->_roomList[g_game->_lastBossRoomListIdx].Flags & 1) != 0)) && ((pvVar5 = (g_manager->_itemConfig)._nullItems._begin, 0xe0 < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 & 0xfffffffcU) && (item = *(ItemConfig_Item **)((int)pvVar5 + 0xe0), item != (ItemConfig_Item *)0x0)))) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); } } LAB_007a8d7b: if ((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) { uVar4 = 0; pvVar5 = (this->_levelEffectItems)._begin; game = g_game; if ((int)(this->_levelEffectItems)._end - (int)pvVar5 >> 2 != 0) { do { levelEffectItemId = *(uint *)((int)pvVar5 + uVar4 * 4); if (game == (Game *)0x0) { if (-1 < (int)levelEffectItemId) goto LAB_007a8dea; } else { if ((int)levelEffectItemId < 0) { if (((int)levelEffectItemId < 0) && (pvVar5 = (game->_proceduralItemManager)._proceduralItems._begin, (int)~levelEffectItemId < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar5 >> 2)) { item = (ItemConfig_Item *)**(undefined4 **)((int)pvVar5 + ~levelEffectItemId * 4); } else { item = (ItemConfig_Item *)0x0; } } else { LAB_007a8dea: pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 >> 2 <= (int)levelEffectItemId) goto LAB_007a8e36; item = *(ItemConfig_Item **)((int)pvVar5 + levelEffectItemId * 4); } if (item != (ItemConfig_Item *)0x0) { RStack_18._4_8_ = (ulonglong)(uint)item->maxCooldown << 0x20; RStack_18._shift3 = 0; RStack_18._seed = (int)item; TemporaryEffects::AddEffect(&this->_temporaryeffects,&RStack_18,1,1); game = g_game; } } LAB_007a8e36: uVar4 = uVar4 + 1; pvVar5 = (this->_levelEffectItems)._begin; } while (uVar4 < (uint)((int)(this->_levelEffectItems)._end - (int)pvVar5 >> 2)); } } bVar2 = HasTrinket(this,0x9a,0); if ((bVar2 != 0) && (*(int *)(*(int *)((int)g_game->_room + 4) + 0x40) == 1)) { pvVar5 = (this->_trinketRNGs)._begin; trinketSeed = (uint *)((int)pvVar5 + 0x9a0); uVar4 = *trinketSeed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *trinketSeed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x9a4) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar5 + 0x9a8) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0x9ac) & 0x1f) ^ uVar4; *trinketSeed = uVar4; iVar3 = GetTrinketMultiplier(this,0x9a); if ((int)(uVar4 & 1) < iVar3) { pvVar5 = (this->_trinketRNGs)._begin; trinketSeed = (uint *)((int)pvVar5 + 0xb70); uVar4 = *trinketSeed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *trinketSeed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0xb74) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar5 + 0xb78) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar5 + 0xb7c) & 0x1f) ^ uVar4; *trinketSeed = uVar4; iVar3 = *(int *)(&DAT_00b1f450 + (uVar4 % 10) * 4); SetPocketActiveItem(this,iVar3,3,1); AnimateCollectible(this,iVar3,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); manager = g_manager; local_38[0] = 0xfc; seed_fart_sound_override(local_38); SoundEffects::Play(&manager->_sfxManager,local_38[0],1.0,2,0,1.0,0.0); } } this->_holyMantleState = 1 < this->_holyMantleState; return; } //@@ 007a8fd0 Entity_Player::TriggerRoomClear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [prefix50/55] __thiscall void Entity_Player::TriggerRoomClear(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::TriggerRoomClear(Entity_Player *this) { void **ppvVar1; void *pvVar2; int iVar3; code *pcVar4; int iVar5; RNG rng; qword qVar6; byte bVar7; int iVar8; EntityPtr EVar9; Entity *spawnedEntity; uint uVar10; int *piVar11; ItemConfig_Item *itemConfig; WeightedOutcomePicker WVar12; int *effect; qword *allocatedBytes; uint *puVar13; void *pvVar14; uint uVar15; Game *pGVar16; float fVar17; undefined4 uVar18; TypeDescriptor *pTVar19; Vector *position; TypeDescriptor *pTVar20; byte bVar21; undefined4 uVar22; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; Vector local_80; Entity_Player *player; Vector local_74; undefined4 local_6c; uint *local_68; undefined4 local_64; undefined4 local_60; TemporaryEffects *local_5c; Game *local_58; EntityList_EL local_54; EntityPtr local_44; undefined1 local_40 [8]; float fStack_38; float fStack_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float local_1c; float local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Player *effectsOwner; Entity_Familiar *familiar; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00affa55; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_40 + 0x3c); ExceptionList = &local_10; player = this; bVar7 = HasTrinket(this,0x8f,0); if ((bVar7 == 0) && (bVar7 = HasCollectible(this,0x287,0), bVar7 == 0)) { local_60 = (uint *)0x0; do { puVar13 = local_60; local_5c = (TemporaryEffects *)((int)(local_60 + 0x2b) * 0x20); uVar15 = *(uint *)((int)&local_5c->_cacheFlags + (int)this); if (g_game == (Game *)0x0) { if (-1 < (int)uVar15) goto LAB_007a907b; } else { if ((int)uVar15 < 0) { if (((int)uVar15 < 0) && (pvVar14 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar15 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar14 >> 2)) { iVar8 = **(int **)((int)pvVar14 + ~uVar15 * 4); } else { iVar8 = 0; } } else { LAB_007a907b: pvVar14 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar14 >> 2 <= (int)uVar15) goto LAB_007a9338; iVar8 = *(int *)((int)pvVar14 + uVar15 * 4); } if (iVar8 != 0) { iVar8 = GetActiveMaxCharge(this,(int)local_60); if (iVar8 == 0) { puVar13 = (uint *)0x1; local_68 = (uint *)0x1; if ((((*(int *)((int)g_game->_room + 8) != 0x11) && (iVar8 = *(int *)((int)g_game->_room + 4), iVar8 != 0)) && (iVar8 = *(int *)(iVar8 + 0x10), iVar8 != 0)) && (((iVar8 = *(int *)(iVar8 + 0x48), iVar8 == 8 || (iVar8 == 0xb)) || ((iVar8 == 0xc || ((iVar8 == 9 || (iVar8 == 10)))))))) { puVar13 = (uint *)0x2; local_68 = (uint *)0x2; } EVar9 = (EntityPtr)GetTrinketMultiplier(this,0x48); local_44 = (EntityPtr)0x10; if ((int)EVar9 < 0x10) { local_44 = EVar9; } if (0 < (int)local_44) { do { pvVar14 = (this->_trinketRNGs)._end; if ((int)pvVar14 - (int)(this->_trinketRNGs)._begin >> 4 < 0x49) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); pvVar14 = (this->_trinketRNGs)._end; } pvVar2 = (this->_trinketRNGs)._begin; uVar15 = ((int)pvVar14 - (int)pvVar2 >> 4) - 1; if (0x48 < uVar15) { uVar15 = 0x48; } puVar13 = (uint *)(uVar15 * 0x10 + (int)pvVar2); uVar15 = *puVar13; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar13; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)puVar13[1] & 0x1f) ^ uVar15; uVar15 = uVar15 << ((byte)puVar13[2] & 0x1f) ^ uVar15; uVar15 = uVar15 >> ((byte)puVar13[3] & 0x1f) ^ uVar15; *puVar13 = uVar15; if (uVar15 % 0x14 == 0) { iVar8 = GetTrinketMultiplier(this,0x48); local_68 = (uint *)((int)local_68 + iVar8); } local_44 = (EntityPtr)((int)local_44 + -1); } while (0 < (int)local_44); puVar13 = local_68; } if (local_60 == (uint *)0x3) { local_68 = (uint *)0x0; } else if (((local_60 == (uint *)0x2) && (this->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)) { local_68 = (uint *)0x0; } else { local_68 = (uint *)GetCollectibleMaxCharge (this,*(int *)((int)&local_5c->_cacheFlags + (int)this), this->_activeDesc[(int)local_60]._varData,(int)local_60) ; } EVar9 = (EntityPtr)GetTrinketMultiplier(this,3); local_44 = (EntityPtr)0x3; if ((int)EVar9 < 3) { local_44 = EVar9; } if (((int)local_44 < 1) || (this->_activeDesc[(int)local_60]._charge + (int)puVar13 < (int)local_68 - (int)local_44)) { AddActiveCharge(this,(int)puVar13,(int)local_60,0,0,0); } else { iVar8 = AddActiveCharge(this,(int)local_44 + (int)puVar13,(int)local_60,0,0,0); manager = g_manager; if (iVar8 != 0) { local_44 = (EntityPtr)0xaa; seed_fart_sound_override((int *)&local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44,1.0,2,0,1.0,0.0); uVar15 = Random(); uVar22 = 0; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; spawnedEntity = Game::Spawn(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar15); iVar8 = __RTDynamicCast(spawnedEntity,uVar18,pTVar19,pTVar20,uVar22); *(undefined4 *)(iVar8 + 0xdc) = 0; *(undefined4 *)(iVar8 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar8 + 0x358) = 0x3f800000; puVar13 = local_60; goto LAB_007a9338; } } puVar13 = local_60; } else if (iVar8 == 1) { FullCharge(this,(int)puVar13,0,0); } } } LAB_007a9338: local_60 = (uint *)((int)puVar13 + 1); } while (local_60 < &DAT_00000004); } bVar7 = HasTrinket(this,0x2e,0); if (bVar7 != 0) { uVar15 = 10 - (int)(this->_luck * 0.5); if ((int)uVar15 < 1) { uVar15 = 1; } if ((uVar15 == 0) || (uVar10 = Random(), uVar10 % uVar15 == 0)) { bVar21 = 0; bVar7 = 0; iVar8 = GetTrinketMultiplier(this,0x2e); AddHearts(this,iVar8,bVar7,bVar21); manager = g_manager; local_44 = (EntityPtr)0x9d; if (this->_playerType == 0x16) { local_44 = (EntityPtr)0x266; } seed_fart_sound_override((int *)&local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44,1.0,2,0,1.0,0.0); uVar15 = Random(); uVar22 = 0; pTVar20 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar19 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar18 = 0; spawnedEntity = Game::Spawn(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar15) ; iVar8 = __RTDynamicCast(spawnedEntity,uVar18,pTVar19,pTVar20,uVar22); *(undefined4 *)(iVar8 + 0xdc) = 0; *(undefined4 *)(iVar8 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar8 + 0x358) = 0x3f800000; } } bVar7 = HasTrinket(this,0x46,0); if (bVar7 != 0) { AddBlueSpider(this,&this->_pos); } if (0 < this->_rottenHearts) { iVar8 = 0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_54,3,0x2b,-1,0,0); EVar9 = (EntityPtr)0x0; local_8 = 0; if ((EntityPtr)local_54._size != (EntityPtr)0x0) { do { iVar3 = *(int *)((int)local_54._data + (int)EVar9 * 4); if (((iVar3 != 0) && (*(int *)(iVar3 + 0x28) == 3)) && (*(Entity_Player **)(iVar3 + 0x410) == this)) { iVar8 = iVar8 + 1; } EVar9 = (EntityPtr)((int)EVar9 + 1); } while ((uint)EVar9 < (uint)local_54._size); } iVar8 = this->_rottenHearts * 2 - iVar8; if (0 < iVar8) { AddBlueFlies(this,iVar8,&this->_pos,(Entity *)0x0); } local_8 = 0xffffffff; if (local_54._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if ((WeightedOutcomePicker)local_54._data != (WeightedOutcomePicker)0x0) { uVar15 = *(uint *)((int)local_54._data + -4); qVar6 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar15; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar6 < uVar15); free((uint *)((int)local_54._data + -4)); } local_8 = 0xffffffff; } } try_end_astral_projection(this); if ((this->_temporaryeffects)._disabled == 0) { for (piVar11 = (this->_temporaryeffects)._effects._begin; piVar11 != (this->_temporaryeffects)._effects._end; piVar11 = piVar11 + 4) { if ((*(int *)*piVar11 == 0) && (((int *)*piVar11)[1] == 0x70)) { if (piVar11[1] == 1) { pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((0x70 < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2) && (itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x1c0), itemConfig != (ItemConfig_Item *)0x0)) { local_54._4_8_ = (ulonglong)(uint)itemConfig->maxCooldown << 0x20; local_54._size = 0; local_54._0_4_ = itemConfig; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,1,1); } pvVar14 = this->_backupPlayer; if ((pvVar14 != (void *)0x0) && (local_5c = (TemporaryEffects *)((int)pvVar14 + 0x1508), *(char *)((int)pvVar14 + 0x1519) == '\0')) { piVar11 = *(int **)((int)pvVar14 + 0x150c); goto joined_r0x007a9607; } } break; } } } LAB_007a9679: bVar7 = HasCollectible(this,0x2b5,0); if (bVar7 != 0) { AddSwarmFlyOrbital(&this->_pos); } TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x47,1); bVar7 = HasCollectible(this,699,0); if (bVar7 != 0) { if ((this->_temporaryeffects)._disabled == 0) { for (piVar11 = (this->_temporaryeffects)._effects._begin; piVar11 != (this->_temporaryeffects)._effects._end; piVar11 = piVar11 + 4) { iVar8 = *(int *)*piVar11; if ((((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) && (((int *)*piVar11)[1] == 699)) { iVar8 = piVar11[1]; if (iVar8 < 5) goto LAB_007a96f8; goto LAB_007a9930; } } } iVar8 = 0; LAB_007a96f8: pvVar14 = (g_manager->_itemConfig)._collectibles._begin; if ((699 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar14 >> 2) && (itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0xaec), itemConfig != (ItemConfig_Item *)0x0)) { local_54._4_8_ = (ulonglong)(uint)itemConfig->maxCooldown << 0x20; local_54._size = 0; local_54._0_4_ = itemConfig; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_54,0,1); } pvVar14 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar14 >> 2 < 700) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0xaec); } RemoveCostume(this,itemConfig); pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 0x61) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x180); } RemoveCostume(this,itemConfig); pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 0x62) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x184); } RemoveCostume(this,itemConfig); pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 99) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x188); } RemoveCostume(this,itemConfig); pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 100) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x18c); } RemoveCostume(this,itemConfig); switch(iVar8) { case 0: pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 0x61) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x180); } break; case 1: pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 0x62) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x184); } break; case 2: pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 99) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x188); } break; case 3: case 4: pvVar14 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 < 100) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x18c); } break; default: goto switchD_007a9848_default; } AddCostume(this,itemConfig,0); switchD_007a9848_default: local_20 = 0.0; local_30 = 0.0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; local_1c = 0.0; local_18 = 0.0; local_40._0_4_ = 0.1; local_40._4_4_ = 0.1; fStack_38 = 0.1; fStack_34 = 1.0; (**(code **)(*(int *)this + 0x3c))(local_40,6,0xff,1,1); } LAB_007a9930: bVar7 = HasTrinket(this,0xa3,0); if (bVar7 != 0) { local_5c = (TemporaryEffects *)GetTrinketMultiplier(this,0xa3); local_44 = (EntityPtr)0x0; if (0 < (int)local_5c) { do { local_54._data = (void *)0x0; local_54._capacity = 0; local_54._size = 0; local_8 = 2; local_74.x = 0.0; local_74.y = 2.8026e-44; std::vector<8byte>::_Emplace_reallocate(0,&local_74); uVar15 = 0; uVar10 = local_54._capacity - (int)local_54._data >> 3; WVar12 = (WeightedOutcomePicker)local_54._data; if (uVar10 != 0) { do { if (*(int *)((int)local_54._data + uVar15 * 8) == 1) { piVar11 = (int *)((int)local_54._data + uVar15 * 8 + 4); *piVar11 = *piVar11 + 6; EVar9 = (EntityPtr)local_54._capacity; if (*piVar11 < 0) { *(undefined4 *)((int)local_54._data + uVar15 * 8 + 4) = 0; } goto LAB_007a9a17; } uVar15 = uVar15 + 1; } while (uVar15 < uVar10); } local_6c = 1; local_68 = (uint *)&DAT_00000006; if (local_54._capacity == local_54._size) { std::vector<8byte>::_Emplace_reallocate(local_54._capacity,&local_6c); WVar12 = (WeightedOutcomePicker)local_54._data; EVar9 = (EntityPtr)local_54._capacity; } else { *(undefined4 *)local_54._capacity = 1; *(undefined4 *)(local_54._capacity + 4) = 6; local_54._capacity = local_54._capacity + 8; EVar9 = (EntityPtr)local_54._capacity; } LAB_007a9a17: uVar15 = 0; uVar10 = (int)EVar9 - (int)WVar12 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)WVar12 + uVar15 * 8) == 2) { piVar11 = (int *)((int)WVar12 + uVar15 * 8 + 4); *piVar11 = *piVar11 + 6; if (*piVar11 < 0) { *(undefined4 *)((int)WVar12 + uVar15 * 8 + 4) = 0; } goto LAB_007a9a7b; } uVar15 = uVar15 + 1; } while (uVar15 < uVar10); } local_64 = 2; local_60 = (uint *)&DAT_00000006; if (EVar9 == (EntityPtr)local_54._size) { std::vector<8byte>::_Emplace_reallocate(EVar9,&local_64); WVar12 = (WeightedOutcomePicker)local_54._data; EVar9 = (EntityPtr)local_54._capacity; } else { *(undefined4 *)EVar9 = 2; *(undefined4 *)((int)EVar9 + 4) = 6; local_54._capacity = (int)EVar9 + 8; EVar9 = (EntityPtr)((int)EVar9 + 8); } LAB_007a9a7b: uVar15 = 0; uVar10 = (int)EVar9 - (int)WVar12 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)WVar12 + uVar15 * 8) == 3) { piVar11 = (int *)((int)WVar12 + uVar15 * 8 + 4); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)WVar12 + uVar15 * 8 + 4) = 0; } goto LAB_007a9ae5; } uVar15 = uVar15 + 1; } while (uVar15 < uVar10); } local_88 = 3; local_84 = 1; if (EVar9 == (EntityPtr)local_54._size) { std::vector<8byte>::_Emplace_reallocate(EVar9,&local_88); WVar12 = (WeightedOutcomePicker)local_54._data; EVar9 = (EntityPtr)local_54._capacity; } else { *(undefined4 *)EVar9 = 3; *(undefined4 *)((int)EVar9 + 4) = 1; local_54._capacity = (int)EVar9 + 8; EVar9 = (EntityPtr)((int)EVar9 + 8); } LAB_007a9ae5: uVar15 = 0; uVar10 = (int)EVar9 - (int)WVar12 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)WVar12 + uVar15 * 8) == 4) { piVar11 = (int *)((int)WVar12 + uVar15 * 8 + 4); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)WVar12 + uVar15 * 8 + 4) = 0; } goto LAB_007a9b52; } uVar15 = uVar15 + 1; } while (uVar15 < uVar10); } local_90 = 4; local_8c = 1; if (EVar9 == (EntityPtr)local_54._size) { std::vector<8byte>::_Emplace_reallocate(EVar9,&local_90); WVar12 = (WeightedOutcomePicker)local_54._data; EVar9 = (EntityPtr)local_54._capacity; } else { *(undefined4 *)EVar9 = 4; *(undefined4 *)((int)EVar9 + 4) = 1; local_54._capacity = (int)EVar9 + 8; EVar9 = (EntityPtr)((int)EVar9 + 8); } LAB_007a9b52: uVar15 = 0; uVar10 = (int)EVar9 - (int)WVar12 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)WVar12 + uVar15 * 8) == 5) { piVar11 = (int *)((int)WVar12 + uVar15 * 8 + 4); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)WVar12 + uVar15 * 8 + 4) = 0; } goto LAB_007a9bc0; } uVar15 = uVar15 + 1; } while (uVar15 < uVar10); } local_98 = 5; local_94 = 1; if (EVar9 == (EntityPtr)local_54._size) { std::vector<8byte>::_Emplace_reallocate(EVar9,&local_98); WVar12 = (WeightedOutcomePicker)local_54._data; EVar9 = (EntityPtr)local_54._capacity; } else { *(undefined4 *)EVar9 = 5; *(undefined4 *)((int)EVar9 + 4) = 1; local_54._capacity = (int)EVar9 + 8; EVar9 = (EntityPtr)((int)EVar9 + 8); } LAB_007a9bc0: uVar15 = 0; uVar10 = (int)EVar9 - (int)WVar12 >> 3; if (uVar10 != 0) { do { if (*(int *)((int)WVar12 + uVar15 * 8) == 6) { piVar11 = (int *)((int)WVar12 + uVar15 * 8 + 4); *piVar11 = *piVar11 + 1; if (*piVar11 < 0) { *(undefined4 *)((int)WVar12 + uVar15 * 8 + 4) = 0; } goto LAB_007a9c21; } uVar15 = uVar15 + 1; } while (uVar15 < uVar10); } local_80.x = 8.40779e-45; local_80.y = 1.4013e-45; if (EVar9 == (EntityPtr)local_54._size) { std::vector<8byte>::_Emplace_reallocate(EVar9,&local_80); } else { *(undefined4 *)EVar9 = 6; *(undefined4 *)((int)EVar9 + 4) = 1; local_54._capacity = (int)((int)EVar9 + 8); } LAB_007a9c21: pvVar14 = (this->_trinketRNGs)._begin; puVar13 = (uint *)((int)pvVar14 + 0xa30); uVar15 = *puVar13; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar13; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xa34) & 0x1f) ^ uVar15; uVar15 = uVar15 << ((byte)*(undefined4 *)((int)pvVar14 + 0xa38) & 0x1f) ^ uVar15; uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xa3c) & 0x1f) ^ uVar15; *puVar13 = uVar15; rng._shift1 = 5; rng._seed = uVar15; rng._shift2 = 9; rng._shift3 = 7; uVar15 = WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)&local_54._data,rng); Entity_Familiar::ThrowDip(uVar15,&this->_pos,(Entity *)this); local_8 = 0xffffffff; if ((WeightedOutcomePicker)local_54._data != (WeightedOutcomePicker)0x0) { uVar15 = (local_54._size - (int)local_54._data >> 3) * 8; WVar12 = (WeightedOutcomePicker)local_54._data; if (0xfff < uVar15) { WVar12 = *(WeightedOutcomePicker *)((int)local_54._data + -4); uVar15 = uVar15 + 0x23; if (0x1f < (uint)((int)local_54._data + (-4 - (int)WVar12))) goto LAB_007aa32a; } operator_delete((void *)WVar12,uVar15); local_54._data = (void *)0x0; local_54._capacity = 0; local_54._size = 0; } local_44 = (EntityPtr)((int)local_44 + 1); } while ((int)local_44 < (int)local_5c); } } bVar7 = HasTrinket(this,0xa7,0); if (bVar7 != 0) { local_60 = (uint *)((int)(this->_trinketRNGs)._begin + 0xa70); iVar8 = GetTrinketMultiplier(this,0xa7); local_5c = (TemporaryEffects *)(5 - iVar8); uVar15 = *local_60; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *local_60; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)local_60[1] & 0x1f) ^ uVar15; uVar15 = uVar15 ^ uVar15 << ((byte)local_60[2] & 0x1f); uVar15 = uVar15 ^ uVar15 >> ((byte)local_60[3] & 0x1f); *local_60 = uVar15; if ((local_5c == (TemporaryEffects *)0x0) || (uVar15 % (uint)local_5c == 0)) { pvVar14 = (this->_trinketRNGs)._begin; puVar13 = (uint *)((int)pvVar14 + 0xa70); uVar15 = *puVar13; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar13; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xa74) & 0x1f) ^ uVar15; local_54._data = (void *)0x1; local_54._capacity = 0xb; uVar15 = uVar15 << ((byte)*(undefined4 *)((int)pvVar14 + 0xa78) & 0x1f) ^ uVar15; local_5c = (TemporaryEffects *) (uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xa7c) & 0x1f) ^ uVar15); *puVar13 = (uint)local_5c; local_60 = (uint *)&DAT_00000006; if (local_5c == (TemporaryEffects *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar15 = (uint)local_5c >> 1 ^ (uint)local_5c; uVar15 = uVar15 << 0xb ^ uVar15; local_68 = (uint *)(uVar15 >> 6 ^ uVar15); local_58 = (Game *)0x115; if (((uint)local_68 & 3) != 0) { local_58 = (Game *)0xe3; } uVar15 = Random(); fVar17 = (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_5c = (TemporaryEffects *)(fVar17 + fVar17); local_44 = (EntityPtr)sin((float)local_5c); fVar17 = cos((float)local_5c); local_74.x = fVar17 * 10.0 + (this->_pos).x; local_74.y = (float)local_44 * 10.0 + (this->_pos).y; if (local_68 == (uint *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar15 = (uint)local_68 >> ((byte)local_54._data & 0x1f) ^ (uint)local_68; uVar15 = uVar15 << ((byte)local_54._capacity & 0x1f) ^ uVar15; spawnedEntity = Game::Spawn(g_game,(uint)local_58,0,&local_74,&g_vectorZero,(Entity *)this,0, uVar15 >> ((byte)local_60 & 0x1f) ^ uVar15); if ((spawnedEntity == (Entity *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (spawnedEntity->_type != 1)) && (0x3dd < spawnedEntity->_type - 10U)))) { spawnedEntity = (Entity *)0x0; } fStack_28 = g_vectorZero.y; local_20 = g_vectorZero.y; fStack_2c = g_vectorZero.x; fStack_24 = g_vectorZero.x; local_40._4_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_30 = 0.0; local_1c = 0.0; local_18 = 0.0; Entity::AddCharmed(spawnedEntity,(EntityRef *)(local_40 + 4),-1,0,0); (**(code **)(*(int *)spawnedEntity + 0xc))(); Entity::SetVisibleFlag(spawnedEntity,0); fVar17 = spawnedEntity->_maxHitPoints + spawnedEntity->_maxHitPoints; local_20 = 0.0; local_1c = 0.0; local_18 = 0.0; spawnedEntity->_maxHitPoints = fVar17; spawnedEntity->_health = fVar17; local_40._0_4_ = 1.0; local_40._4_4_ = 1.0; fStack_38 = 1.0; fStack_34 = 1.0; local_30 = 0.0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; uVar15 = Random(); Game::SpawnParticles (g_game,&local_74,0x23,4, (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0,(ColorMod *)local_40,100000.0,0); uVar15 = Random(); local_44 = (EntityPtr) ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0); uVar15 = Random(); iVar8 = (uVar15 & 1) + 2; do { uVar15 = Random(); uVar10 = Random(); fVar17 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_58 = (Game *)(fVar17 + fVar17); local_5c = (TemporaryEffects *)sin((float)local_58); local_80.x = cos((float)local_58); local_80.x = local_80.x * (float)local_44; local_80.y = (float)local_5c * 0.5 * (float)local_44; spawnedEntity = Game::Spawn(g_game,1000,5,&local_74,&local_80,(Entity *)0x0,1,uVar15); uVar18 = *(undefined4 *)((int)&spawnedEntity->_flags + 4); iVar3 = *(int *)spawnedEntity; *(uint *)&spawnedEntity->_flags = (uint)spawnedEntity->_flags | 0x10000; *(undefined4 *)((int)&spawnedEntity->_flags + 4) = uVar18; (**(code **)(iVar3 + 0xc))(); iVar8 = iVar8 + -1; } while (iVar8 != 0); this = player; } } bVar7 = HasTrinket(this,0xaa,0); if (bVar7 != 0) { if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 10 & 1) == 0) { iVar8 = GetTrinketMultiplier(this,0xaa); pGVar16 = (Game *)(4 - iVar8); } else { iVar8 = GetTrinketMultiplier(this,0xaa); pGVar16 = (Game *)((5 - iVar8) * 2); } local_58 = (Game *)0x1; if (1 < (int)pGVar16) { local_58 = pGVar16; } pvVar14 = (this->_trinketRNGs)._begin; puVar13 = (uint *)((int)pvVar14 + 0xaa0); uVar15 = *puVar13; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar13; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xaa4) & 0x1f) ^ uVar15; uVar15 = uVar15 ^ uVar15 << ((byte)*(undefined4 *)((int)pvVar14 + 0xaa8) & 0x1f); uVar15 = uVar15 ^ uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xaac) & 0x1f); *puVar13 = uVar15; if ((local_58 == (Game *)0x0) || (uVar15 % (uint)local_58 == 0)) { EVar9 = (EntityPtr)0x0; local_44 = (EntityPtr)0x0; local_54._data = (void *)0x0; local_54._capacity = 0; local_54._size = 0; local_8 = 3; pGVar16 = (Game *)0x0; do { bVar7 = Level::CanSpawnDoorOutline((Level *)g_game,g_game->_currentRoomIdx,(uint)pGVar16); if (bVar7 != 0) { local_58 = pGVar16; if (EVar9 == local_44) { std::vector<4byte>::_Emplace_reallocate(EVar9,&local_58); local_44 = (EntityPtr)local_54._size; EVar9 = (EntityPtr)local_54._capacity; } else { *(Game **)EVar9 = pGVar16; local_54._capacity = (int)EVar9 + 4; EVar9 = (EntityPtr)((int)EVar9 + 4); } } this = player; pGVar16 = (Game *)((int)&pGVar16->_stage + 1); } while (pGVar16 < (Game *)&DAT_00000008); if ((EntityPtr)local_54._data != EVar9) { local_58 = g_game; local_68 = (uint *)((int)(player->_trinketRNGs)._begin + 0xaa0); uVar15 = (int)EVar9 - (int)local_54._data >> 2; local_60 = (uint *)*local_68; if (local_60 == (uint *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); local_60 = (uint *)*local_68; if (local_60 == (uint *)0x0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar10 = (uint)local_60 >> ((byte)local_68[1] & 0x1f) ^ (uint)local_60; uVar10 = uVar10 ^ uVar10 << ((byte)local_68[2] & 0x1f); uVar10 = uVar10 ^ uVar10 >> ((byte)local_68[3] & 0x1f); *local_68 = uVar10; if (uVar15 == 0) { uVar10 = 0; } else { uVar10 = uVar10 % uVar15; } Level::MakeRedRoomDoor ((Level *)local_58,g_game->_currentRoomIdx, *(int *)((int)local_54._data + uVar10 * 4)); } local_8 = 0xffffffff; if ((EntityPtr)local_54._data != (EntityPtr)0x0) { uVar15 = ((int)local_44 - (int)local_54._data >> 2) * 4; EVar9 = (EntityPtr)local_54._data; if (0xfff < uVar15) { EVar9 = *(EntityPtr *)((int)local_54._data + -4); uVar15 = uVar15 + 0x23; if (0x1f < ((int)local_54._data - (int)EVar9) - 4U) { LAB_007aa32a: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar9,uVar15); local_54._data = (void *)0x0; local_54._capacity = 0; local_54._size = 0; } } } if ((this->_variant == 1) && (this->_babySkin == 0x40)) { uVar15 = (this->_dropRNG)._seed; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = (this->_dropRNG)._seed; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar15; uVar15 = uVar15 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar15; uVar15 = uVar15 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar15; (this->_dropRNG)._seed = uVar15; uVar15 = uVar15 % 10; bVar7 = (byte)uVar15; if (uVar15 == 0) { position = &this->_pos; bVar21 = bVar7; iVar8 = Entity_Familiar::GetRandomWisp(&this->_dropRNG); AddWisp(this,iVar8,position,bVar7,bVar21); } } if ((((this->_playerType != 0x1d) && (this->_playerType != 0x26)) || ((EVar9 = (EntityPtr)this->_backupPlayer, EVar9 == (EntityPtr)0x0 && (this->_twinPlayer == (EntityPtr)0x0)))) || ((0 < this->_controlsCooldown || (this->_hasCurseMistEffect != 0)))) goto LAB_007aa526; local_44 = this->_twinPlayer; if (local_44 == (EntityPtr)0x0) { local_44 = EVar9; LAB_007aa43d: EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_54,3,-1,-1,1,0); EVar9 = (EntityPtr)0x0; local_8 = 4; if ((EntityPtr)local_54._size != (EntityPtr)0x0) { WVar12 = (WeightedOutcomePicker)local_54._data; do { familiar = *(Entity_Familiar **)((int)WVar12 + (int)EVar9 * 4); if (familiar->_player == this) { Entity_Familiar::TriggerRoomClear(familiar); WVar12 = (WeightedOutcomePicker)local_54._data; } EVar9 = (EntityPtr)((int)EVar9 + 1); } while ((uint)EVar9 < (uint)local_54._size); } local_8 = 0xffffffff; if (local_54._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if ((WeightedOutcomePicker)local_54._data != (WeightedOutcomePicker)0x0) { uVar15 = *(uint *)((int)local_54._data + -4); qVar6 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar15; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar6 < uVar15); free((uint *)((int)local_54._data + -4)); } } local_8 = 0xffffffff; } else if (local_44 == EVar9) goto LAB_007aa43d; EVar9 = local_44; UseActiveItem(this,(short *)((int)&local_60 + 2),0x2c7,0,-1,0); if ((EVar9 == (EntityPtr)this->_backupPlayer) && (this->_isCoopGhost == 0)) { *(undefined4 *)((int)EVar9 + 0x15c0) = 0; TriggerRoomClear((Entity_Player *)EVar9); } iVar8 = this->_activeDesc[2]._unk; iVar3 = this->_activeDesc[2]._charge; iVar5 = this->_activeDesc[2]._batteryCharge; *(int *)((int)EVar9 + 0x15c0) = this->_activeDesc[2]._item; *(int *)((int)EVar9 + 0x15c4) = iVar8; *(int *)((int)EVar9 + 0x15c8) = iVar3; *(int *)((int)EVar9 + 0x15cc) = iVar5; iVar8 = this->_activeDesc[2]._timeRechargeCooldown; iVar3 = this->_activeDesc[2]._partialCharge; iVar5 = this->_activeDesc[2]._varData; *(int *)((int)EVar9 + 0x15d0) = this->_activeDesc[2]._subCharge; *(int *)((int)EVar9 + 0x15d4) = iVar8; *(int *)((int)EVar9 + 0x15d8) = iVar3; *(int *)((int)EVar9 + 0x15dc) = iVar5; LAB_007aa526: if ((this->_temporaryeffects)._disabled == 0) { for (piVar11 = (this->_temporaryeffects)._effects._begin; piVar11 != (this->_temporaryeffects)._effects._end; piVar11 = piVar11 + 4) { if ((*(int *)*piVar11 == 2) && (((int *)*piVar11)[1] == 0xa2)) { pvVar14 = (g_manager->_itemConfig)._trinkets._begin; if ((0x288 < (int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar14 & 0xfffffffcU )) && (itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x288), itemConfig != (ItemConfig_Item *)0x0)) { local_54._4_8_ = (ulonglong)(uint)itemConfig->maxCooldown << 0x20; local_54._size = 0; local_54._0_4_ = itemConfig; TemporaryEffects::RemoveEffect(&this->_temporaryeffects,&local_54,1); } goto LAB_007aa725; } } } bVar7 = HasTrinket(this,0xa2,0); if (bVar7 != 0) { pvVar14 = (this->_trinketRNGs)._begin; puVar13 = (uint *)((int)pvVar14 + 0xa20); iVar8 = GetTrinketMultiplier(this,0xa2); uVar15 = *puVar13; local_58 = (Game *)0x1; if (1 < 4 - iVar8) { local_58 = (Game *)(4 - iVar8); } if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar13; if (uVar15 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xa24) & 0x1f) ^ uVar15; uVar15 = uVar15 ^ uVar15 << ((byte)*(undefined4 *)((int)pvVar14 + 0xa28) & 0x1f); uVar15 = uVar15 ^ uVar15 >> ((byte)*(undefined4 *)((int)pvVar14 + 0xa2c) & 0x1f); *puVar13 = uVar15; if ((((local_58 == (Game *)0x0) || (uVar15 % (uint)local_58 == 0)) && (pvVar14 = (g_manager->_itemConfig)._trinkets._begin, 0x288 < (int)((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar14 & 0xfffffffcU))) && (itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x288), itemConfig != (ItemConfig_Item *)0x0)) { local_58 = (Game *)itemConfig->maxCooldown; local_54._4_8_ = ZEXT48(local_58) << 0x20; local_54._size = 0; local_54._0_4_ = itemConfig; if ((this->_temporaryeffects)._disabled == 0) { piVar11 = (this->_temporaryeffects)._effects._end; for (effect = (this->_temporaryeffects)._effects._begin; effect != piVar11; effect = effect + 4) { if ((ItemConfig_Item *)*effect == itemConfig) { if (effect != piVar11) { effect[1] = effect[1] + 2; effect[2] = (int)local_58->_roomList[0]._doors + effect[2] + -0x30; goto LAB_007aa715; } break; } } piVar11 = (this->_temporaryeffects)._effects._end; if (piVar11 == (this->_temporaryeffects)._effects._capacity) { std::vector::_Emplace_reallocate(piVar11,&local_54); } else { *piVar11 = (int)itemConfig; piVar11[1] = 0; piVar11[2] = (int)local_58; piVar11[3] = 0; ppvVar1 = &(this->_temporaryeffects)._effects._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } itemConfig = (ItemConfig_Item *)local_54._0_4_; pvVar14 = (this->_temporaryeffects)._effects._begin; *(undefined4 *) ((((int)(this->_temporaryeffects)._effects._end - (int)pvVar14 & 0xfffffff0U) - 0xc) + (int)pvVar14) = 2; effectsOwner = (this->_temporaryeffects)._player; if (effectsOwner != (Entity_Player *)0x0) { AddCostume(effectsOwner,(ItemConfig_Item *)local_54._0_4_,0); } LAB_007aa715: (this->_temporaryeffects)._cacheFlags = (this->_temporaryeffects)._cacheFlags | itemConfig->cacheFlags; (this->_temporaryeffects)._shouldEvaluateCache = 1; } } } LAB_007aa725: trigger_set_dispatch(&this->_proceduralItems,5,(Entity *)0x0,&this->_pos,&g_vectorZero); if ((int)(this->_pendingWisps)._end - (int)(this->_pendingWisps)._begin >> 2 != 0) { uVar15 = 0; do { AddWisp(this,*(int *)((int)(this->_pendingWisps)._begin + uVar15 * 4),&this->_pos,0,0); uVar15 = uVar15 + 1; pvVar14 = (this->_pendingWisps)._begin; } while (uVar15 < (uint)((int)(this->_pendingWisps)._end - (int)pvVar14 >> 2)); (this->_pendingWisps)._end = pvVar14; } ExceptionList = local_10; return; joined_r0x007a9607: if (piVar11 == *(int **)((int)pvVar14 + 0x1510)) goto LAB_007a9679; if ((*(int *)*piVar11 == 0) && (((int *)*piVar11)[1] == 0x70)) { if ((piVar11[1] == 1) && ((pvVar14 = (g_manager->_itemConfig)._nullItems._begin, 0x70 < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar14 >> 2 && (itemConfig = *(ItemConfig_Item **)((int)pvVar14 + 0x1c0), itemConfig != (ItemConfig_Item *)0x0)))) { local_54._4_8_ = (ulonglong)(uint)itemConfig->maxCooldown << 0x20; local_54._size = 0; local_54._0_4_ = itemConfig; TemporaryEffects::AddEffect(local_5c,&local_54,1,1); } goto LAB_007a9679; } piVar11 = piVar11 + 4; goto joined_r0x007a9607; } //@@ 007aa7c0 Entity_Player::HasPlayerForm /* ZHL [lua] Lua binding EntityPlayer:HasPlayerForm prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Player::HasPlayerForm(Entity_Player *this,int playerForm) { if ((((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && ((uint)playerForm < 0x10)) && (2 < this->_playerForms[playerForm])) { return 1; } return 0; } //@@ 007aa800 Entity_Player::CanAddCollectible /* ZHL [lua] Lua binding EntityPlayer:CanAddCollectible */ bool __thiscall Entity_Player::CanAddCollectible(Entity_Player *this,int param_2) { ItemConfig_Item *pIVar1; if (param_2 != 0) { pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_2); if (((pIVar1 != (ItemConfig_Item *)0x0) && (pIVar1->type == 3)) && (this->_parent != (EntityPtr)0x0)) { return false; } } return this->_itemHoldCooldown == 0; } //@@ 007aa850 Entity_Player::GetLaserOffset /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_Player::GetLaserOffset(Vector* buffer, int laserOffsetID, Vector* direction); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity_Player::GetLaserOffset (Entity_Player *this,Vector *buffer,int laserOffsetID,Vector *direction) { float fVar1; void **ppvVar2; undefined1 *puVar3; undefined1 *puVar4; byte isHasCollectible; Vector *costumeNullPos; float *extraout_EAX; void *ptr; uint size; Vector scratchVec; Vector local_48; float offsetX; void *nullName; undefined4 local_38; char local_34; uint nullNameSize; uint nullNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; fVar1 = g_vectorZero.y; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00affab5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; local_48.y = 0.0; offsetX = 0.0; ppvVar2 = &local_1c; puVar3 = (undefined1 *)((int)register0x00000010 + -4); puVar4 = (undefined1 *)((int)register0x00000010 + -4); switch(laserOffsetID) { case 0: nullName = (void *)0x7466654c; nullNameSize = 7; local_38._0_1_ = 'E'; local_38._1_1_ = 'y'; local_38._2_1_ = 'e'; local_38._3_1_ = '\0'; local_14 = 0; goto LAB_007aa900; case 1: nullNameSize = 8; nullName = (void *)0x68676952; local_38._0_1_ = 't'; local_38._1_1_ = 'E'; local_38._2_1_ = 'y'; local_38._3_1_ = 'e'; local_34 = '\0'; local_14 = 1; goto LAB_007aa900; case 2: nullNameSize = 8; nullName = (void *)0x65726f46; local_38._0_1_ = 'h'; local_38._1_1_ = 'e'; local_38._2_1_ = 'a'; local_38._3_1_ = 'd'; local_34 = '\0'; local_14 = 2; LAB_007aa900: ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); break; case 3: goto switchD_007aa8b0_caseD_3; case 4: ExceptionList = &local_1c; isHasCollectible = HasCollectible(this,0x2a6,0); ppvVar2 = ExceptionList; puVar4 = puStack_20; if (isHasCollectible != 0) { local_48.y = (this->_sprite)._scale.y * -6.0; buffer->x = 0.0; goto LAB_007aab1b; } goto switchD_007aa8b0_caseD_3; case 5: nullNameSize = 7; local_48.x = -direction->x; local_48.y = -direction->y; nullName = (void *)0x736d6f4d; local_38._0_1_ = 'E'; local_38._1_1_ = 'y'; local_38._2_1_ = 'e'; local_38._3_1_ = '\0'; direction = &local_48; local_14 = 3; ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); break; case 6: nullName = (void *)0x63617254; nullNameSize = 7; local_38._0_1_ = 't'; local_38._1_1_ = 'o'; local_38._2_1_ = 'r'; local_38._3_1_ = '\0'; local_14 = 5; direction = &g_vectorZero; ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); break; case -1: buffer->x = g_vectorZero.x; buffer->y = fVar1; return; default: goto switchD_007aa8b0_default; } LAB_007aa903: nullNameCapacity = 0xf; costumeNullPos = GetCostumeNullPos(this,&scratchVec,(std_string *)&nullName,1,direction); offsetX = costumeNullPos->x / 0.65; local_48.y = costumeNullPos->y / 0.65; ppvVar2 = ExceptionList; puVar3 = puStack_20; if (0xf < nullNameCapacity) { size = nullNameCapacity + 1; ptr = nullName; if (0xfff < size) { ptr = *(void **)((int)nullName + -4); size = nullNameCapacity + 0x24; if (0x1f < (uint)((int)nullName + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); ppvVar2 = ExceptionList; puVar3 = puStack_20; } switchD_007aa8b0_default: puStack_20 = puVar3; ExceptionList = ppvVar2; if (this->_canFly != 0) { GetFlyingOffset(this,&scratchVec); offsetX = offsetX + *extraout_EAX / 0.65; local_48.y = extraout_EAX[1] / 0.65 + local_48.y; } buffer->x = offsetX; LAB_007aab1b: buffer->y = local_48.y; ExceptionList = local_1c; return; switchD_007aa8b0_caseD_3: puStack_20 = puVar4; ExceptionList = ppvVar2; nullName = (void *)0x74756f4d; nullNameSize = 5; local_38._0_1_ = 'h'; local_38._1_1_ = '\0'; local_14 = 4; direction = &g_vectorZero; goto LAB_007aa903; } //@@ 007aab70 Entity_Player::FireTechLaser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity_Laser* Entity_Player::FireTechLaser(const Vector& pos, unsigned int offsetID, const Vector& dir, bool leftEye, bool oneHit, Entity * source, float damageScale); prototype: REPENTOGON, confirmed by RET 28 */ Entity_Laser * __thiscall Entity_Player::FireTechLaser (Entity_Player *this,Vector *pos,uint offsetID,Vector *dir,byte leftEye,byte oneHit, Entity *source,float damageScale) { int iVar1; uint uVar2; qword qVar3; Entity_Player *pEVar4; Entity_Laser *laser; uint uVar5; float fVar6; float fVar7; undefined4 flagsHighLo; undefined4 flagsHighHi; undefined4 uVar8; float *pfVar9; Entity_Player *player; Entity_Player *savedSource; float angle; Vector *savedDir; Vector laserOffset; Vector local_a0; undefined8 uStack_98; Vector local_88 [5]; uint uStack_60; uint uStack_5c; uint uStack_58; uint uStack_54; float fStack_4c; float fStack_44; uint local_14; float posY; float tearsOffsetY; local_14 = __security_cookie ^ (uint)&player; savedDir = dir; savedSource = (Entity_Player *)source; player = this; angle = atan2f(dir->y,dir->x); GetLaserOffset(this,&laserOffset,offsetID,dir); local_a0.y = laserOffset.y; if (savedSource != (Entity_Player *)0x0) { this = savedSource; } local_88[0].x = laserOffset.x + pos->x; local_a0.x = 0.0; local_88[0].y = pos->y + 0.0; laser = Entity_Laser::ShootAngle(2,local_88,angle * 57.295776,3,&local_a0,(Entity *)this,0); (laser->_parentOffset).x = laserOffset.x; (laser->_parentOffset).y = 0.0; fVar6 = (player->_tearsOffset).x; fVar7 = pos->x; tearsOffsetY = (player->_tearsOffset).y; posY = pos->y; laser->_oneHit = oneHit; laser->_disableFollowParent = 1; (laser->_pos).x = fVar6 + fVar7 + laserOffset.x; (laser->_pos).y = tearsOffsetY + posY + 0.0; if (offsetID == 2) { uVar5 = Random(); if (4 < uVar5 % 100) goto LAB_007aacef; uVar5 = Random(); uVar5 = uVar5 % 0x54; uStack_98 = 0; fVar6 = (float)(1 << (uVar5 & 0x1f)); fVar7 = 0.0; if (0x1f < uVar5) { fVar7 = fVar6; } fVar6 = (float)((uint)fVar6 ^ (uint)fVar7); if (0x3f < uVar5) { fVar7 = fVar6; } uStack_98._0_4_ = 0; uStack_98._4_4_ = 0; flagsHighLo = (undefined4)uStack_98; flagsHighHi = uStack_98._4_4_; local_a0.x = fVar6; local_a0.y = fVar7; } else { LAB_007aacef: fVar6 = *(float *)&(player->_tearFlags)._l; fVar7 = *(float *)((int)&(player->_tearFlags)._l + 4); flagsHighLo = (undefined4)(player->_tearFlags)._h; flagsHighHi = *(undefined4 *)((int)&(player->_tearFlags)._h + 4); } pEVar4 = player; iVar1 = *(int *)laser; pfVar9 = (float *)0x1; uVar8 = 0; *(float *)&(laser->_tearFlags)._l = fVar6; *(float *)((int)&(laser->_tearFlags)._l + 4) = fVar7; *(undefined4 *)&(laser->_tearFlags)._h = flagsHighLo; *(undefined4 *)((int)&(laser->_tearFlags)._h + 4) = flagsHighHi; (**(code **)(iVar1 + 0x3c))(&player->_laserColor,0xffffffff,0xff,0); if (offsetID == 1) { (**(code **)(*(int *)laser + 0x40))(pEVar4->_damage); } else { uVar5 = Random(); GetTearHitParams((int)&uStack_98 + 4,3,damageScale,(uVar5 & 1) * 2 + -1,uVar8); (**(code **)(*(int *)laser + 0x40))(uStack_60); uVar5 = *(uint *)((int)&(laser->_tearFlags)._l + 4); qVar3 = (laser->_tearFlags)._h; uVar2 = *(uint *)((int)&(laser->_tearFlags)._h + 4); *(uint *)&(laser->_tearFlags)._l = (uint)(laser->_tearFlags)._l | uStack_60; *(uint *)((int)&(laser->_tearFlags)._l + 4) = uVar5 | uStack_5c; *(uint *)&(laser->_tearFlags)._h = (uint)qVar3 | uStack_58; *(uint *)((int)&(laser->_tearFlags)._h + 4) = uVar2 | uStack_54; laser->_damageMultiplier = damageScale; laser->_scale = fStack_4c; Entity_Laser::ResetSpriteScale(laser); laser->_mass = fStack_44 * laser->_mass; } laser->_entityGridCollisionClass = 6; if (leftEye == 0) { if ((pfVar9[1] <= -0.5) || (*pfVar9 <= -0.5)) goto LAB_007aae68; } else if ((pfVar9[1] < -0.5) || (0.5 < *pfVar9)) { LAB_007aae68: fVar6 = -10.0; goto LAB_007aae70; } fVar6 = 3000.0; LAB_007aae70: laser->_renderDepthOffset = fVar6; laser->field_0x517 = 1; return laser; } //@@ 007aaea0 Entity_Player::GetTearMovementInheritance /* ZHL [exact] __thiscall void Entity_Player::GetTearMovementInheritance(Vector* out, Vector* direction, bool unkFlag); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity_Player::GetTearMovementInheritance (Entity_Player *this,Vector *out,Vector *direction,byte unkFlag) { byte bVar1; float fVar2; float fVar3; float fVar4; float fVar5; float local_20; float local_1c; float local_18; if ((unkFlag == 0) && (((bVar1 = HasCollectible(this,0x18a,0), bVar1 != 0 && (this->_markedTarget != (void *)0x0)) || ((((this->_tearsOffset).x != g_vectorZero.x || ((this->_tearsOffset).y != g_vectorZero.y)) && ((bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x145), bVar1 != 0 || (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x2d9), bVar1 != 0)))))))) { out->x = g_vectorZero.x; out->y = g_vectorZero.y; return; } fVar4 = (this->_lastVelocity).x * 0.6; fVar5 = (this->_lastVelocity).y * 0.6; fVar4 = fVar4 + fVar4; fVar5 = fVar5 + fVar5; if ((direction->x != g_vectorZero.x) || (direction->y != g_vectorZero.y)) { local_1c = direction->x; local_18 = direction->y; fVar2 = sqrtf(local_1c * local_1c + local_18 * local_18); if (0.0 < fVar2) { local_1c = direction->x * (1.0 / fVar2); local_18 = direction->y * (1.0 / fVar2); } fVar2 = direction->x; local_20 = direction->y; fVar3 = sqrtf(fVar2 * fVar2 + local_20 * local_20); if (0.0 < fVar3) { local_20 = direction->y * (1.0 / fVar3); fVar2 = direction->x * (1.0 / fVar3); } fVar2 = fVar4 * fVar2 + fVar5 * local_20; local_1c = local_1c * fVar2; local_18 = local_18 * fVar2; if (local_18 * direction->y + local_1c * direction->x < 0.0) { fVar4 = fVar4 - local_1c; fVar5 = fVar5 - local_18; } } out->x = fVar4; out->y = fVar5; return; } //@@ 007ab0e0 FUN_007ab0e0 undefined4 FUN_007ab0e0(void) { int in_ECX; if (((*(char *)(in_ECX + 0x1398) == '\0') && (*(char *)(in_ECX + 0x139a) == '\0')) || ((*(int *)(in_ECX + 0x1410) != 0 && (*(int *)(in_ECX + 0x1410) == *(int *)(in_ECX + 0x1e68))))) { return 1; } return 0; } //@@ 007ab110 Entity_Player::IsExtraAnimationFinished /* ZHL [lua] Lua binding EntityPlayer:IsExtraAnimationFinished prototype: db/protos.zhl */ byte __thiscall Entity_Player::IsExtraAnimationFinished(Entity_Player *this) { if ((this->_isPlayingExtraAnimation == 0) && (this->_isPlayingItemAnimation == 0)) { return 1; } return 0; } //@@ 007ab130 Entity_Player::AnimatePickup /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:AnimatePickup prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity_Player::AnimatePickup(Entity_Player *this,ANM2 *param_2,byte param_3,byte *param_4) { byte bVar1; Entity_Player *pEVar2; uint uVar3; byte *animName; LayerState *shadowLayer; char *pickupName; byte *****pppppbVar4; ANM2 *this_00; bool isLess; ANM2 spriteCopy; undefined4 local_7c [11]; Entity_Player *player; byte *savedAnimName; ANM2 *savedSprite; uint cleanupFlags; char isOnlineCollectible; byte *****spritePath [4]; uint spritePathSize; uint spritePathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(spritePath + 0xe); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00affae0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(spritePath + 0xb); ExceptionList = &local_1c; savedAnimName = param_4; savedSprite = param_2; cleanupFlags = 0; player = this; if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || ((uint)((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2) < 2)) { LAB_007ab226: puStack_20 = (undefined1 *)(spritePath + 0xe); } else { pickupName = "Pickup"; do { bVar1 = *param_4; isLess = bVar1 < (byte)*pickupName; if (bVar1 != *pickupName) { LAB_007ab1d1: uVar3 = -(uint)isLess | 1; goto LAB_007ab1d6; } if (bVar1 == 0) break; bVar1 = param_4[1]; isLess = bVar1 < (byte)pickupName[1]; if (bVar1 != pickupName[1]) goto LAB_007ab1d1; param_4 = param_4 + 2; pickupName = pickupName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_007ab1d6: if (uVar3 != 0) goto LAB_007ab226; std::string::string((char *)spritePath,param_2); pppppbVar4 = (byte *****)spritePath; if (0xf < spritePathCapacity) { pppppbVar4 = spritePath[0]; } cleanupFlags = 3; uVar3 = std::string::find((byte *)pppppbVar4,spritePathSize,0,(byte *)"Collectible",0xb); if ((uVar3 != 0xffffffff) && (*(int *)&g_game->_deathmatchManager < 2)) { isOnlineCollectible = '\x01'; goto LAB_007ab230; } } isOnlineCollectible = '\0'; LAB_007ab230: if (((cleanupFlags & 1) != 0) && (0xf < spritePathCapacity)) { uVar3 = spritePathCapacity + 1; pppppbVar4 = spritePath[0]; if (0xfff < uVar3) { pppppbVar4 = (byte *****)spritePath[0][-1]; uVar3 = spritePathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)spritePath[0] + (-4 - (int)pppppbVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,uVar3); } pEVar2 = player; animName = (byte *)"Pickup_Online"; if (isOnlineCollectible == '\0') { animName = savedAnimName; } PlayExtraAnimation(player,animName); ANM2::ANM2(&spriteCopy,savedSprite); Isaac::SwapANM2(&pEVar2->_heldSprite,&spriteCopy); local_14 = (byte ****)0x0; ANM2::Reset(this_00); AnimationState::~AnimationState(&spriteCopy._overlayAnimState); AnimationState::~AnimationState(&spriteCopy._animState); std::string::_Tidy_deallocate(spriteCopy._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&spriteCopy); (pEVar2->_heldSprite)._bitflags = savedSprite->_bitflags; if (param_3 != 0) { shadowLayer = ANM2::GetLayer(&pEVar2->_heldSprite,(byte *)"shadow"); if (shadowLayer != (LayerState *)0x0) { if (&shadowLayer->_color != (ColorMod *)local_7c) { (shadowLayer->_color)._colorize[0] = 0.0; (shadowLayer->_color)._colorize[1] = 0.0; (shadowLayer->_color)._colorize[2] = 0.0; (shadowLayer->_color)._colorize[3] = 0.0; (shadowLayer->_color)._offset[0] = 0.0; (shadowLayer->_color)._offset[1] = 0.0; (shadowLayer->_color)._tint[0] = 0.0; (shadowLayer->_color)._tint[1] = 0.0; (shadowLayer->_color)._tint[2] = 0.0; (shadowLayer->_color)._tint[3] = 0.0; (shadowLayer->_color)._offset[2] = 0.0; } } } (pEVar2->_heldSprite)._offset.x = 0.0; (pEVar2->_heldSprite)._offset.y = -4.0; ExceptionList = local_1c; return; } //@@ 007ab380 Entity_Player::AnimateCollectible /* DB: Lua EntityPlayer:AnimateCollectible; ZHL sig said HasCollectible (real one 007706e0) prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_Player::AnimateCollectible (Entity_Player *this,int collectibleId,byte *animName,byte *spriteAnimName) { byte *pbVar1; Manager *pMVar2; byte bVar3; ItemConfig_Item *pIVar4; EntityConfig_Entity *pEVar5; LayerState *pLVar6; byte *pbVar7; uint uVar8; byte extraout_CL; byte extraout_CL_00; byte *pbVar9; ANM2 *this_00; bool bVar10; undefined1 auStackY_bc [128]; void *texture; void *textureRefCount; void *local_c; pIVar4 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if (pIVar4 == (ItemConfig_Item *)0x0) { return; } this_00 = &this->_heldSprite; ANM2::Reset(this_00); pMVar2 = g_manager; _Find_lower_bound<>(); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) < 0x506401)) && (local_c != (pMVar2->_entityConfig)._entities._head)) { pEVar5 = (EntityConfig_Entity *)((int)local_c + 0x18); } else { pEVar5 = EntityConfig::GetEntity(&pMVar2->_entityConfig,5,0,0); } ANM2::Load(this_00,&pEVar5->anm2Path,0); if (collectibleId < 0) { textureRefCount = (void *)0x1; texture = (void *)0x7ab42e; pLVar6 = ANM2::GetLayer(this_00,(byte *)0x1); KAGE::SmartPointer::operator_assign (auStackY_bc + 0x84,&(g_game->_proceduralItemManager)._renderTarget); LayerState::SetTexture(pLVar6,texture,textureRefCount); pLVar6 = ANM2::GetLayer(this_00,(byte *)0x1); (pLVar6->_cropOffset).x = (float)(~collectibleId & 0x1f) * 32.0; (pLVar6->_cropOffset).y = (float)((uint)~collectibleId >> 5) * 32.0; pLVar6 = ANM2::GetLayer(this_00,(byte *)0x1); pLVar6->_spriteSheetLoaded = 1; bVar3 = extraout_CL; } else { Sprite::ReplaceSpritesheet((Sprite *)this_00,1,&pIVar4->gfxFilename); bVar3 = extraout_CL_00; } ANM2::LoadGraphics(this_00,bVar3); pbVar1 = (this->_heldSprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar7 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar7 = *(byte **)pbVar1; } pbVar9 = spriteAnimName; do { bVar3 = *pbVar7; bVar10 = bVar3 < *pbVar9; if (bVar3 != *pbVar9) { LAB_007ab4f1: uVar8 = -(uint)bVar10 | 1; goto LAB_007ab4f6; } if (bVar3 == 0) break; bVar3 = pbVar7[1]; bVar10 = bVar3 < pbVar9[1]; if (bVar3 != pbVar9[1]) goto LAB_007ab4f1; pbVar7 = pbVar7 + 2; pbVar9 = pbVar9 + 2; } while (bVar3 != 0); uVar8 = 0; LAB_007ab4f6: if ((uVar8 == 0) && ((pbVar1[0x34] == 0 || ((this->_heldSprite)._animState._isPlaying != 0)))) goto LAB_007ab51e; } bVar3 = ANM2::SetAnimation(this_00,spriteAnimName,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } LAB_007ab51e: (this->_heldSprite)._offset.x = 0.0; (this->_heldSprite)._offset.y = -4.0; PlayExtraAnimation(this,animName); return; } //@@ 007ab550 Entity_Player::AnimateTrinket /* ZHL [lua] Lua binding EntityPlayer:AnimateTrinket */ void __thiscall Entity_Player::AnimateTrinket(Entity_Player *this,uint param_2,byte *param_3,byte *param_4) { ANM2 *this_00; void *pvVar1; int iVar2; byte *pbVar3; Manager *pMVar4; byte bVar5; EntityConfig_Entity *pEVar6; byte *pbVar7; uint uVar8; byte unk; byte *pbVar9; bool bVar10; undefined4 local_1c; Entity_Player *local_18; undefined1 local_14 [8]; void *local_c; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2 <= (int)(param_2 & 0x7fff)) { return; } iVar2 = *(int *)((int)pvVar1 + (param_2 & 0x7fff) * 4); if (iVar2 == 0) { return; } this_00 = &this->_heldSprite; local_18 = this; ANM2::Reset(this_00); pMVar4 = g_manager; local_1c = 0x506400; _Find_lower_bound<>(local_14,&local_1c); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) < 0x506401)) && (local_c != (pMVar4->_entityConfig)._entities._head)) { pEVar6 = (EntityConfig_Entity *)((int)local_c + 0x18); } else { pEVar6 = EntityConfig::GetEntity(&pMVar4->_entityConfig,5,0,0); } ANM2::Load(this_00,&pEVar6->anm2Path,0); Sprite::ReplaceSpritesheet((Sprite *)this_00,1,(std_string *)(iVar2 + 0x38)); ANM2::LoadGraphics(this_00,unk); pbVar3 = (this->_heldSprite)._animState._animData; if (pbVar3 != (byte *)0x0) { pbVar7 = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar7 = *(byte **)pbVar3; } pbVar9 = param_4; do { bVar5 = *pbVar7; bVar10 = bVar5 < *pbVar9; if (bVar5 != *pbVar9) { LAB_007ab650: uVar8 = -(uint)bVar10 | 1; goto LAB_007ab655; } if (bVar5 == 0) break; bVar5 = pbVar7[1]; bVar10 = bVar5 < pbVar9[1]; if (bVar5 != pbVar9[1]) goto LAB_007ab650; pbVar7 = pbVar7 + 2; pbVar9 = pbVar9 + 2; } while (bVar5 != 0); uVar8 = 0; LAB_007ab655: if ((uVar8 == 0) && ((pbVar3[0x34] == 0 || ((this->_heldSprite)._animState._isPlaying != 0)))) goto LAB_007ab67d; } bVar5 = ANM2::SetAnimation(this_00,param_4,1); if (bVar5 != 0) { AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } LAB_007ab67d: (local_18->_heldSprite)._offset.x = 0.0; (local_18->_heldSprite)._offset.y = -4.0; PlayExtraAnimation(local_18,param_3); return; } //@@ 007ab6b0 Entity_Player::AnimateCard /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [lua] Lua binding EntityPlayer:AnimateCard prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::AnimateCard(Entity_Player *this,int cardId,byte *animName) { byte bVar1; byte *curAnimChar; void *pvVar2; EntityConfig_Entity *entityConfig; byte *expectedName; char *pcVar3; uint uVar4; ANM2 *heldSprite; bool isLess; byte *cardAnimName; std_string cardAnm2Path; std_string local_3c; uint stackCookie; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; int cardConfig; ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); local_14 = 0xffffffff; puStack_18 = &LAB_00affb25; local_1c = ExceptionList; stackCookie = __security_cookie ^ (int)&cardAnm2Path + 0x44U; ExceptionList = &local_1c; heldSprite = &this->_heldSprite; if (0x61 < cardId) { pvVar2 = (g_manager->_itemConfig)._cards._begin; ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); if (((cardId < (int)(g_manager->_itemConfig)._cards._end - (int)pvVar2 >> 2) && (cardConfig = *(int *)((int)pvVar2 + cardId * 4), ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50), cardConfig != 0)) && (ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50), *(int *)(cardConfig + 0x6c) != 0)) { ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); ANM2::Reset(heldSprite); std::string::string(cardAnm2Path._buf,*(void **)(cardConfig + 0x6c)); local_14 = 0; ANM2::Load(heldSprite,&cardAnm2Path,1); local_14 = 0xffffffff; if (0xf < cardAnm2Path._capacity) { uVar4 = cardAnm2Path._capacity + 1; pvVar2 = (void *)cardAnm2Path._buf._0_4_; if (0xfff < uVar4) { pvVar2 = *(void **)(cardAnm2Path._buf._0_4_ + -4); uVar4 = cardAnm2Path._capacity + 0x24; if (0x1f < (uint)(cardAnm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } ANM2::Play(heldSprite,(byte *)"Sparkle",0); cardAnimName = (byte *)(cardConfig + 0x38); if (0xf < *(uint *)(cardConfig + 0x4c)) { cardAnimName = *(byte **)cardAnimName; } animData = (this->_heldSprite)._overlayAnimState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; expectedName = cardAnimName; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar1 = *curAnimChar; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_007ab7f4: uVar4 = -(uint)isLess | 1; goto LAB_007ab7f9; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_007ab7f4; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar4 = 0; LAB_007ab7f9: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((this->_heldSprite)._overlayAnimState._isPlaying != 0)))) goto LAB_007abab4; } bVar1 = ANM2::SetOverlayAnimation(heldSprite,cardAnimName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_heldSprite)._overlayAnimState); (this->_heldSprite)._overlayAnimState._isPlaying = 1; } } goto LAB_007abab4; } ANM2::Reset(heldSprite); local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x19; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/ui_cardspills.anm2",0x1a); local_14 = 1; ANM2::Load(heldSprite,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar4 = local_3c._capacity + 1; pcVar3 = (char *)local_3c._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(local_3c._buf._0_4_ + -4); uVar4 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } animData = (this->_heldSprite)._animState._animData; heldSprite = &this->_heldSprite; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (animData == (byte *)0x0) { LAB_007ab949: bVar1 = ANM2::SetAnimation(heldSprite,(byte *)"Sparkle",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } pcVar3 = "Sparkle"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_007ab936: uVar4 = -(uint)isLess | 1; goto LAB_007ab93b; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_007ab936; curAnimChar = curAnimChar + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_007ab93b: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0)))) goto LAB_007ab949; } bVar1 = ANM2::SetOverlayAnimation(heldSprite,(byte *)"CardFronts",1); if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_heldSprite)._overlayAnimState,(float)cardId); } uVar4 = 0; if ((this->_heldSprite)._layerCount != 0) { do { pvVar2 = AnimationState::GetLayerFrame(&(this->_heldSprite)._overlayAnimState,uVar4); if ((pvVar2 != (void *)0x0) && (*(char *)((int)pvVar2 + 0x2c) != '\0')) goto LAB_007abab4; uVar4 = uVar4 + 1; } while (uVar4 < (uint)(this->_heldSprite)._layerCount); } if ((((cardId < 0) || (pvVar2 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar2 >> 2 <= cardId)) || (cardConfig = *(int *)((int)pvVar2 + cardId * 4), cardConfig == 0)) || (entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,5,300,*(int *)(cardConfig + 0x54)), entityConfig == (EntityConfig_Entity *)0x0)) goto LAB_007abab4; ANM2::Load(heldSprite,&entityConfig->anm2Path,1); animData = (this->_heldSprite)._animState._animData; if (animData == (byte *)0x0) { LAB_007aba73: bVar1 = ANM2::SetAnimation(heldSprite,(byte *)"Sparkle",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } pcVar3 = "Sparkle"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_007aba60: uVar4 = -(uint)isLess | 1; goto LAB_007aba65; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_007aba60; curAnimChar = curAnimChar + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_007aba65: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0)))) goto LAB_007aba73; } bVar1 = ANM2::SetOverlayAnimation(heldSprite,&DAT_00b6b338,1); if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_heldSprite)._overlayAnimState,0.0); } LAB_007abab4: (this->_heldSprite)._offset.x = 0.0; (this->_heldSprite)._offset.y = -12.0; PlayExtraAnimation(this,animName); ExceptionList = local_1c; return; } //@@ 007abb00 Entity_Player::AnimatePill /* ZHL [lua] Lua binding EntityPlayer:AnimatePill prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::AnimatePill(Entity_Player *this,int pillColor,byte *animName) { ANM2 *this_00; byte *pbVar1; byte bVar2; EntityConfig_Entity *pEVar3; byte *pbVar4; uint uVar5; char *pcVar6; bool bVar7; this_00 = &this->_heldSprite; ANM2::Reset(this_00); pEVar3 = EntityConfig::GetEntity(&g_manager->_entityConfig,5,0x46,pillColor); if (pEVar3 == (EntityConfig_Entity *)0x0) goto LAB_007abbd4; ANM2::Load(this_00,&pEVar3->anm2Path,1); pbVar1 = (this->_heldSprite)._animState._animData; if (pbVar1 == (byte *)0x0) { LAB_007abb93: bVar2 = ANM2::SetAnimation(this_00,(byte *)"Sparkle",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } } else { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pcVar6 = "Sparkle"; do { bVar2 = *pbVar4; bVar7 = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_007abb80: uVar5 = -(uint)bVar7 | 1; goto LAB_007abb85; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar7 = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_007abb80; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_007abb85: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0)))) goto LAB_007abb93; } bVar2 = ANM2::SetOverlayAnimation(this_00,&DAT_00b6b338,1); if ((bVar2 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_heldSprite)._overlayAnimState,0.0); } LAB_007abbd4: (this->_heldSprite)._offset.x = 0.0; (this->_heldSprite)._offset.y = -12.0; PlayExtraAnimation(this,animName); return; } //@@ 007abc00 Entity_Player::AnimateTrapdoor /* ZHL [lua] Lua binding EntityPlayer:AnimateTrapdoor */ void Entity_Player::AnimateTrapdoor(void) { Entity_Player *in_ECX; PlayExtraAnimation(in_ECX,(byte *)"Trapdoor"); return; } //@@ 007abc10 Entity_Player::AnimateLightTravel /* ZHL [lua] Lua binding EntityPlayer:AnimateLightTravel */ void Entity_Player::AnimateLightTravel(void) { Entity_Player *in_ECX; PlayExtraAnimation(in_ECX,(byte *)"LightTravel"); return; } //@@ 007abc20 Entity_Player::AnimatePitfallIn /* ZHL [lua] Lua binding EntityPlayer:AnimatePitfallIn */ void __thiscall Entity_Player::AnimatePitfallIn(Entity_Player *this,char param_2) { byte bVar1; int iVar2; if ((param_2 == '\0') && (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x271), bVar1 != 0)) { return; } PlayExtraAnimation(this,(byte *)"FallIn"); this->_isControlsEnabled = 0; iVar2 = 1; this->_entityCollisionClass = 0; this->_pitfallTimer = 0; if (param_2 != '\0') { iVar2 = 4; } this->_pitfallState = iVar2; return; } //@@ 007abc90 Entity_Player::AnimatePitfallOut /* ZHL [lua] Lua binding EntityPlayer:AnimatePitfallOut */ void __thiscall Entity_Player::AnimatePitfallOut(Entity_Player *this) { this->_pitfallState = 3; PlayExtraAnimation(this,(byte *)"JumpOut"); return; } //@@ 007abcb0 Entity_Player::AnimateAppear /* ZHL [lua] Lua binding EntityPlayer:AnimateAppear */ void Entity_Player::AnimateAppear(void) { Entity_Player *in_ECX; PlayExtraAnimation(in_ECX,(byte *)"Appear"); return; } //@@ 007abcc0 Entity_Player::AnimateTeleport /* ZHL [lua] Lua binding EntityPlayer:AnimateTeleport */ void Entity_Player::AnimateTeleport(int param_1) { Manager *pMVar1; char cVar2; char *animName; Entity_Player *in_ECX; cVar2 = (char)param_1; animName = "TeleportUp"; if ((char)param_1 == '\0') { animName = "TeleportDown"; } PlayExtraAnimation(in_ECX,(byte *)animName); pMVar1 = g_manager; if (cVar2 != '\0') { param_1 = 0xd7; seed_fart_sound_override(¶m_1); SoundEffects::Play(&pMVar1->_sfxManager,param_1,1.0,2,0,1.0,0.0); } return; } //@@ 007abd30 Entity_Player::AnimateHappy /* ZHL [lua] Lua binding EntityPlayer:AnimateHappy prototype: db/protos.zhl */ void __thiscall Entity_Player::AnimateHappy(Entity_Player *this) { Manager *pMVar1; int local_8; pMVar1 = g_manager; local_8 = 0x10c; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.0,2,0,1.0,0.0); PlayExtraAnimation(this,(byte *)"Happy"); return; } //@@ 007abd90 Entity_Player::AnimateSad /* ZHL [lua] Lua binding EntityPlayer:AnimateSad prototype: db/protos.zhl */ void __thiscall Entity_Player::AnimateSad(Entity_Player *this) { Manager *pMVar1; int local_8; pMVar1 = g_manager; local_8 = 0x10b; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.0,2,0,1.0,0.0); PlayExtraAnimation(this,&DAT_00b1cdf8); return; } //@@ 007abdf0 Entity_Player::AddPrettyFly /* ZHL [exact] __thiscall void Entity_Player::AddPrettyFly(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::AddPrettyFly(Entity_Player *this) { int *piVar1; piVar1 = (int *)((int)(this->_pillEffectUses)._begin + 0x28); *piVar1 = *piVar1 + 1; this->_cacheFlags = this->_cacheFlags | 0x200; EvaluateItems(); AnimateHappy(this); return; } //@@ 007abe20 Entity_Player::PlayExtraAnimation /* ZHL [lua] Lua binding EntityPlayer:PlayExtraAnimation prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::PlayExtraAnimation(Entity_Player *this,byte *animName) { byte bVar1; this->_isPlayingItemAnimation = 0; ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); bVar1 = ANM2::SetAnimation(&this->_sprite,animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingItemAnimation = 0; this->_isPlayingExtraAnimation = 1; return; } //@@ 007abe90 Entity_Player::PlayExtraAnimation /* DB: swaps player anm2, SetAnimation, sets 0x1398=0 0x139a=1; used by AnimatePickup/Collectible prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::PlayExtraAnimation(Entity_Player *this,byte *animName) { byte bVar1; ANM2 *this_00; ANM2 local_12c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00affb50; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::ANM2(&local_12c,&this->_sprite); Isaac::SwapANM2(&this->_bodySprite,&local_12c); local_8 = 0; ANM2::Reset(this_00); AnimationState::~AnimationState(&local_12c._overlayAnimState); AnimationState::~AnimationState(&local_12c._animState); std::string::_Tidy_deallocate(local_12c._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_12c); local_8 = 0xffffffff; (this->_bodySprite)._playbackSpeed = 1.0; bVar1 = ANM2::SetAnimation(&this->_bodySprite,animName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_bodySprite)._animState); (this->_bodySprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 0; this->_isPlayingItemAnimation = 1; ExceptionList = local_10; return; } //@@ 007abf80 Entity_Player::active_used_post /* DB: after UseActiveItem: Book of Virtues, M trinket active reroll (quality weights 0xb6bc60), Butter!/drop (trinkets-cards) prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_Player::active_used_post(Entity_Player *this,int slot,byte unk,int chargeBeforeUse) { int *piVar1; int iVar2; code *pcVar3; RNG rng; RNG rng_00; RNG rng_01; byte bVar4; char isDeathmatchBanned; uint uVar5; ItemConfig_Item *collectibleConfig; int iVar6; int unused; void *pvVar7; uint uVar8; WeightedOutcomePicker WVar9; WeightedOutcomePicker freeBlock; uint *rngSeed; bool isExcludedItem; float in_XMM0_Da; short sStack0000000a; WeightedOutcomePicker expansionPicker; int *expansionPickerEnd; int *expansionPickerCapacity; WeightedOutcomePicker activePicker; int *activePickerEnd; int *activePickerCapacity; int newOutcomeId; int newOutcomeWeight; int expansionOutcomeId; Manager *local_1c; int qualityWeight; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00affb8d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (this->_activeDesc[slot]._item == 0x1da) { RemoveCollectible(this,0x1da,0,slot,1); AddCollectible(this,0x160,-1,0,slot,0,0); AnimateCollectible(this,0x160,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); } iVar6 = chargeBeforeUse; if (slot == 0) { TriggerBookOfVirtues(this->_activeDesc[0]._item,chargeBeforeUse,uVar5); trigger_book_of_belial_passive(this,this->_activeDesc[0]._item,iVar6); } bVar4 = HasTrinket(this,0x8a,0); if (((bVar4 != 0) && (slot == 0)) && (bVar4 = ItemConfig::IsValidCollectible(this->_activeDesc[0]._item), bVar4 != 0)) { bVar4 = HasCollectible(this,0x2d1,0); if (bVar4 == 0) { WVar9 = (WeightedOutcomePicker)0x0; local_1c = g_manager; activePicker = (WeightedOutcomePicker)0x0; activePickerEnd = (int *)0x0; activePickerCapacity = (int *)0x0; local_8 = 0; pvVar7 = (g_manager->_itemConfig)._collectibles._begin; chargeBeforeUse = 0; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar7 >> 2 != 0) { do { if ((((chargeBeforeUse != this->_activeDesc[0]._item) && (piVar1 = *(int **)((int)pvVar7 + chargeBeforeUse * 4), piVar1 != (int *)0x0)) && ((*piVar1 == 3 && (((piVar1[0x2f] & 1U) == 0 && (piVar1[0x12] != 0)))))) && (bVar4 = Item::IsAvailable(piVar1,0xffffffff), bVar4 != 0)) { iVar6 = piVar1[1]; uVar8 = (int)activePickerEnd - (int)WVar9 >> 3; qualityWeight = *(int *)(&DAT_00b6bc60 + piVar1[0x30] * 4); uVar5 = 0; if (uVar8 != 0) { do { if (*(int *)((int)WVar9 + uVar5 * 8) == iVar6) { piVar1 = (int *)((int)WVar9 + 4 + uVar5 * 8); *piVar1 = *piVar1 + qualityWeight; if (*piVar1 < 0) { *(undefined4 *)((int)WVar9 + 4 + uVar5 * 8) = 0; } goto LAB_007ac194; } uVar5 = uVar5 + 1; } while (uVar5 < uVar8); } if (0 < qualityWeight) { newOutcomeId = iVar6; newOutcomeWeight = qualityWeight; if (activePickerEnd == activePickerCapacity) { std::vector<8byte>::_Emplace_reallocate(activePickerEnd,&newOutcomeId); WVar9 = activePicker; } else { *activePickerEnd = iVar6; activePickerEnd[1] = qualityWeight; activePickerEnd = activePickerEnd + 2; } } } LAB_007ac194: chargeBeforeUse = chargeBeforeUse + 1; pvVar7 = (local_1c->_itemConfig)._collectibles._begin; } while ((uint)chargeBeforeUse < (uint)((int)(local_1c->_itemConfig)._collectibles._end - (int)pvVar7 >> 2)); } uVar5 = RNG::Next((RNG *)((int)(this->_trinketRNGs)._begin + 0x8a0)); in_XMM0_Da = 7.00649e-45; rng._shift1 = 5; rng._seed = uVar5; rng._shift2 = 9; rng._shift3 = 7; uVar5 = WeightedOutcomePicker::PickOutcome(&activePicker,rng); local_8 = 0xffffffff; if (activePicker != (WeightedOutcomePicker)0x0) { uVar8 = ((int)activePickerCapacity - (int)activePicker >> 3) * 8; WVar9 = activePicker; if (0xfff < uVar8) { WVar9 = *(WeightedOutcomePicker *)((int)activePicker + -4); uVar8 = uVar8 + 0x23; if (0x1f < ((int)activePicker - (int)WVar9) - 4U) goto LAB_007ac7ad; } operator_delete((void *)WVar9,uVar8); activePicker = (WeightedOutcomePicker)0x0; activePickerEnd = (int *)0x0; activePickerCapacity = (int *)0x0; } } else { uVar5 = RNG::Next((RNG *)((int)(this->_trinketRNGs)._begin + 0x8a0)); uVar5 = ItemPool::CreateGlitchedCollectible(uVar5,8); collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,uVar5); if (collectibleConfig->type != 3) goto LAB_007ac2d2; } if (uVar5 != 0) { iVar6 = GetTrinketMultiplier(this,0x8a); RemoveCollectible(this,this->_activeDesc[0]._item,0,0,1); AddCollectible(this,uVar5,0,0,0,0,0); if (1 < iVar6) { uVar5 = 0x14; if (iVar6 == 2) { uVar5 = 10; } uVar8 = RNG::RandomInt((RNG *)((int)(this->_trinketRNGs)._begin + 0x8a0),100); if (uVar8 < uVar5) { iVar6 = GetCollectibleMaxCharge (this,this->_activeDesc[0]._item,this->_activeDesc[0]._varData,unused); AddActiveCharge(this,iVar6,0,0,0,0); } } } } LAB_007ac2d2: bVar4 = HasTrinket(this,0x7a,0); if ((bVar4 != 0) && (slot == 0)) { iVar6 = this->_activeDesc[0]._item; bVar4 = ItemConfig::IsValidCollectible(iVar6); if ((bVar4 != 0) && (((unk == 0 && (collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar6), collectibleConfig != (ItemConfig_Item *)0x0)) && (collectibleConfig->type == 3)))) { IsLocalPlayer(this); SoundEffects::PlayWithFartOverride(0x385,in_XMM0_Da,2,0,1.0); DropCollectible(this,this->_activeDesc[0]._item,(Entity_Pickup *)0x0,0); } } bVar4 = HasTrinket(this,0xb5,0); if ((bVar4 != 0) && (slot == 0)) { iVar6 = this->_activeDesc[0]._item; bVar4 = ItemConfig::IsValidCollectible(iVar6); if (bVar4 == 0) { ExceptionList = local_10; return; } collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar6); iVar6 = GetActiveMaxCharge(this,0); if (collectibleConfig == (ItemConfig_Item *)0x0) { ExceptionList = local_10; return; } if (((iVar6 != 0) || (collectibleConfig->maxCharges < 1)) && ((bVar4 = TemporaryEffects::HasTrinketEffect(&this->_temporaryeffects,0xb5), bVar4 != 0 && (*(int *)&g_game->_deathmatchManager < 2)))) { ExceptionList = local_10; return; } TemporaryEffects::AddTrinketEffect(&this->_temporaryeffects,0xb5,1,1); manager = g_manager; expansionPicker = (WeightedOutcomePicker)0x0; expansionPickerEnd = (int *)0x0; expansionPickerCapacity = (int *)0x0; WVar9 = (WeightedOutcomePicker)0x0; activePicker = (WeightedOutcomePicker)0x0; activePickerEnd = (int *)0x0; activePickerCapacity = (int *)0x0; local_8 = 2; pvVar7 = (g_manager->_itemConfig)._collectibles._begin; _unk = 0; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar7 >> 2 != 0) { do { if (((((_unk != this->_activeDesc[0]._item) && (piVar1 = *(int **)((int)pvVar7 + _unk * 4), piVar1 != (int *)0x0)) && (*piVar1 == 3)) && (((piVar1[0x2f] & 1U) == 0 && (piVar1[0x12] != 0)))) && ((bVar4 = Item::IsAvailable(piVar1,0xffffffff), bVar4 != 0 && ((*(int *)&g_game->_deathmatchManager < 2 || (isDeathmatchBanned = (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x30))(piVar1[1]), isDeathmatchBanned == '\0')))))) { iVar6 = piVar1[1]; if (iVar6 < 0x1ea) { if ((iVar6 == 0x1e9) || (iVar6 == 0x1a6)) goto LAB_007ac5c0; isExcludedItem = iVar6 == 0x1e8; } else { isExcludedItem = iVar6 == 0x2bf; } if (!isExcludedItem) { iVar2 = piVar1[0x1d]; if ((iVar2 == 1) || (iVar2 == 2)) { uVar5 = 0; uVar8 = (int)expansionPickerEnd - (int)expansionPicker >> 3; if (uVar8 != 0) { do { if (*(int *)((int)expansionPicker + uVar5 * 8) == iVar6) { piVar1 = (int *)((int)expansionPicker + 4 + uVar5 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)((int)expansionPicker + 4 + uVar5 * 8) = 0; } goto LAB_007ac5c0; } uVar5 = uVar5 + 1; } while (uVar5 < uVar8); } local_1c = (Manager *)0x1; expansionOutcomeId = iVar6; if (expansionPickerEnd == expansionPickerCapacity) { std::vector<8byte>::_Emplace_reallocate(expansionPickerEnd,&expansionOutcomeId); } else { *expansionPickerEnd = iVar6; expansionPickerEnd[1] = 1; expansionPickerEnd = expansionPickerEnd + 2; } } else if (iVar2 == 3) { uVar5 = 0; uVar8 = (int)activePickerEnd - (int)WVar9 >> 3; if (uVar8 != 0) { do { if (*(int *)((int)WVar9 + uVar5 * 8) == iVar6) { piVar1 = (int *)((int)WVar9 + 4 + uVar5 * 8); *piVar1 = *piVar1 + 1; if (*piVar1 < 0) { *(undefined4 *)((int)WVar9 + 4 + uVar5 * 8) = 0; } goto LAB_007ac5c0; } uVar5 = uVar5 + 1; } while (uVar5 < uVar8); } newOutcomeWeight = 1; newOutcomeId = iVar6; if (activePickerEnd == activePickerCapacity) { std::vector<8byte>::_Emplace_reallocate(activePickerEnd,&newOutcomeId); WVar9 = activePicker; } else { *activePickerEnd = iVar6; activePickerEnd[1] = 1; activePickerEnd = activePickerEnd + 2; } } } } LAB_007ac5c0: _unk = _unk + 1; pvVar7 = (manager->_itemConfig)._collectibles._begin; } while (_unk < (uint)((int)(manager->_itemConfig)._collectibles._end - (int)pvVar7 >> 2)); } slot = 1; iVar6 = GetTrinketMultiplier(this,0xb5); if (iVar6 == 2) { slot = 2; } else if (iVar6 == 3) { slot = 2; uVar5 = RNG::Next((RNG *)((int)(this->_trinketRNGs)._begin + 0xb50)); rng_00._shift1 = 5; rng_00._seed = uVar5; rng_00._shift2 = 9; rng_00._shift3 = 7; uVar5 = WeightedOutcomePicker::PickOutcome(&activePicker,rng_00); if (uVar5 == 0) { WVar9 = activePicker; } else { iVar6 = this->_itemState; this->_itemState = 0; UseActiveItem(this,&sStack0000000a,uVar5,5,0,0); WVar9 = activePicker; if (this->_itemState == 0) { this->_itemState = iVar6; } else { this->_itemStateCooldown = 0; } } } do { pvVar7 = (this->_trinketRNGs)._begin; rngSeed = (uint *)((int)pvVar7 + 0xb50); uVar5 = *rngSeed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = *rngSeed; if (uVar5 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar5 = uVar5 >> ((byte)*(undefined4 *)((int)pvVar7 + 0xb54) & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)*(undefined4 *)((int)pvVar7 + 0xb58) & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)*(undefined4 *)((int)pvVar7 + 0xb5c) & 0x1f) ^ uVar5; *rngSeed = uVar5; rng_01._shift1 = 5; rng_01._seed = uVar5; rng_01._shift2 = 9; rng_01._shift3 = 7; uVar5 = WeightedOutcomePicker::PickOutcome(&expansionPicker,rng_01); if (uVar5 != 0) { iVar6 = this->_itemState; this->_itemState = 0; UseActiveItem(this,&sStack0000000a,uVar5,5,0,0); if (this->_itemState == 0) { this->_itemState = iVar6; } else { this->_itemStateCooldown = 0; } } slot = slot + -1; } while (slot != 0); if (WVar9 != (WeightedOutcomePicker)0x0) { uVar5 = (int)activePickerCapacity - (int)WVar9 & 0xfffffff8; freeBlock = WVar9; if (0xfff < uVar5) { freeBlock = *(WeightedOutcomePicker *)((int)WVar9 + -4); uVar5 = uVar5 + 0x23; if (0x1f < ((int)WVar9 - (int)freeBlock) - 4U) goto LAB_007ac7ad; } operator_delete((void *)freeBlock,uVar5); } if (expansionPicker != (WeightedOutcomePicker)0x0) { uVar5 = (int)expansionPickerCapacity - (int)expansionPicker & 0xfffffff8; WVar9 = expansionPicker; if (0xfff < uVar5) { WVar9 = *(WeightedOutcomePicker *)((int)expansionPicker + -4); uVar5 = uVar5 + 0x23; if (0x1f < ((int)expansionPicker - (int)WVar9) - 4U) { LAB_007ac7ad: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)WVar9,uVar5); } } ExceptionList = local_10; return; } //@@ 007ac7e0 Entity_Player::DischargeActiveItem /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:DischargeActiveItem prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::DischargeActiveItem(Entity_Player *this,uint slot,byte unk) { PlayerManager *this_00; code *pcVar1; undefined4 uVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; float fVar8; byte bVar9; uint uVar10; ItemConfig_Item *itemConfig; int iVar11; Entity *effect; int *playerSlot; undefined4 extraout_EAX; ColorMod *color; undefined4 *puVar12; char isCacheDirty; Entity_Player *pEVar13; int iVar14; float *historyItem; void *pvVar15; Vector *position; uint *rngSeed; undefined4 uVar16; TypeDescriptor *pTVar17; TypeDescriptor *pTVar18; undefined4 uVar19; float local_88; float fStack_84; Entity_Player *pEStack_80; Entity_Player *pEStack_7c; uint activeSlot; int local_74; int descOffset; float *local_6c; Entity_Player *local_68; EntityPtr local_64; EntityPtr local_60; Game *local_5c; Entity_Player *local_58; char isItemMoved; Color local_50; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; undefined4 *dstDescHead; char *dstDescTail; float *historyEnd; Manager *manager; EntityPtr otherPlayer; char *srcDescTail; puStack_20 = (undefined1 *)(&local_50)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00affbc7; local_1c = ExceptionList; uVar10 = __security_cookie ^ (uint)((&local_50)[1]._colorize + 1); local_68 = (Entity_Player *)CONCAT31(local_68._1_3_,unk); activeSlot = slot; if (3 < slot) { return; } descOffset = slot * 0x20 + 0x1580; if (this->_activeDesc[slot]._item == 0) { return; } local_6c = (float *)(slot * 0x20); local_64 = *(EntityPtr *)((int)(local_6c + 0x563) + (int)this); ExceptionList = &local_1c; local_58 = this; local_24 = uVar10; local_74 = GetActiveMaxCharge(this,slot); local_5c = (Game *)GetActiveMaxCharge(this,slot); if (*(int *)((int)(local_6c + 0x562) + (int)this) < local_74) { iVar14 = *(int *)((int)(local_6c + 0x562) + (int)this) - local_74; itemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig, *(int *)((int)(&(this->_sprite)._filename + -3) + descOffset)); if ((itemConfig != (ItemConfig_Item *)0x0) && (iVar11 = FUN_007308d0(uVar10), iVar11 != 2)) { iVar11 = FUN_007308d0(uVar10); if (iVar11 == 1) { iVar14 = -1; } iVar11 = GetEffectiveSoulCharge(this); if ((iVar11 < 1) || (((this->_playerType == 0x12 && (bVar9 = HasCollectible(this,0x26b,0), bVar9 != 0)) && (uVar10 = RNG::RandomInt((RNG *)((int)(this->_collectibleRNGs)._begin + 0x26b0),2), uVar10 == 0)))) { iVar11 = GetEffectiveBloodCharge(this); if (0 < iVar11) { AddBloodCharge(this,iVar14); } } else { AddSoulCharge(this,iVar14); } } } bVar9 = HasCollectible(this,0x74,0); if ((bVar9 != 0) && (local_60 = (EntityPtr)((int)local_64 + 1), (int)local_60 < (int)local_5c)) { local_5c = (Game *)g_manager; itemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig, *(int *)((int)(&(this->_sprite)._filename + -3) + descOffset)); iVar14 = GetActiveMaxCharge(this,activeSlot); if (itemConfig != (ItemConfig_Item *)0x0) { if (iVar14 == 1) { local_64 = local_60; if ((int)local_60 < local_74 / 2) { local_64 = (EntityPtr)(local_74 / 2); } } else if (iVar14 == 0) { local_64 = local_60; local_60 = (EntityPtr)0xab; seed_fart_sound_override((int *)&local_60); SoundEffects::Play((SoundEffects *) &local_5c->_glowingHourglassStates[0]._gameState.field_0x3934, (int)local_60,1.0,2,0,1.0,0.0); } } uVar10 = Random(); uVar19 = 0; pTVar18 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar16 = 0; effect = Game::Spawn(g_game,1000,0x31,&this->_pos,&g_vectorZero,(Entity *)0x0,1,uVar10); iVar14 = __RTDynamicCast(effect,uVar16,pTVar17,pTVar18,uVar19); *(undefined4 *)(iVar14 + 0xdc) = 0; *(undefined4 *)(iVar14 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar14 + 0x358) = 0x3f800000; } uVar10 = activeSlot; local_74 = *(int *)((int)(local_6c + 0x562) + (int)this); SetActiveCharge(this,(int)local_64,activeSlot); this->field_0x1826 = 0; iVar14 = *(int *)((int)(&(this->_sprite)._filename + -3) + descOffset); if (iVar14 != 0x2bf) { if ((iVar14 == 0x2c7) && (uVar10 == 2)) { otherPlayer = this->_twinPlayer; if (otherPlayer != (EntityPtr)0x0) { iVar14 = this->_activeDesc[2]._unk; iVar11 = this->_activeDesc[2]._charge; iVar3 = this->_activeDesc[2]._batteryCharge; iVar4 = this->_activeDesc[2]._subCharge; iVar5 = this->_activeDesc[2]._timeRechargeCooldown; iVar6 = this->_activeDesc[2]._partialCharge; iVar7 = this->_activeDesc[2]._varData; *(int *)((int)otherPlayer + 0x15c0) = this->_activeDesc[2]._item; *(int *)((int)otherPlayer + 0x15c4) = iVar14; *(int *)((int)otherPlayer + 0x15c8) = iVar11; *(int *)((int)otherPlayer + 0x15cc) = iVar3; *(int *)((int)otherPlayer + 0x15d0) = iVar4; *(int *)((int)otherPlayer + 0x15d4) = iVar5; *(int *)((int)otherPlayer + 0x15d8) = iVar6; *(int *)((int)otherPlayer + 0x15dc) = iVar7; active_used_post(this,2,(byte)local_68,local_74); ExceptionList = local_1c; return; } pvVar15 = this->_backupPlayer; if (pvVar15 != (void *)0x0) { iVar14 = this->_activeDesc[2]._unk; iVar11 = this->_activeDesc[2]._charge; iVar3 = this->_activeDesc[2]._batteryCharge; *(int *)((int)pvVar15 + 0x15c0) = this->_activeDesc[2]._item; *(int *)((int)pvVar15 + 0x15c4) = iVar14; *(int *)((int)pvVar15 + 0x15c8) = iVar11; *(int *)((int)pvVar15 + 0x15cc) = iVar3; iVar14 = this->_activeDesc[2]._timeRechargeCooldown; iVar11 = this->_activeDesc[2]._partialCharge; iVar3 = this->_activeDesc[2]._varData; *(int *)((int)pvVar15 + 0x15d0) = this->_activeDesc[2]._subCharge; *(int *)((int)pvVar15 + 0x15d4) = iVar14; *(int *)((int)pvVar15 + 0x15d8) = iVar11; *(int *)((int)pvVar15 + 0x15dc) = iVar3; active_used_post(this,2,(byte)local_68,local_74); ExceptionList = local_1c; return; } } goto LAB_007ad261; } if (*(int *)((int)(local_6c + 0x567) + (int)this) == 0) { iVar14 = 0; local_5c = g_game; playerSlot = (int *)&(g_game->_playerManager).field_0x80; LAB_007aca80: if (*playerSlot != 0) goto code_r0x007aca85; local_68 = operator_new(0x2f00); local_14 = 0.0; if (local_68 == (Entity_Player *)0x0) { uVar16 = 0; } else { constructor(local_68); uVar16 = extraout_EAX; } local_14 = -NAN; *(undefined4 *)((int)(&local_5c->_seedEffects + -1) + iVar14 * 4) = uVar16; if (-1 < iVar14) { otherPlayer = *(EntityPtr *)((int)(&g_game->_seedEffects + -1) + iVar14 * 4); *(int *)((int)(local_6c + 0x567) + (int)this) = iVar14 + 1; local_64 = otherPlayer; (**(code **)(*(int *)otherPlayer + 4))(this->_type,this->_variant,0,this->_initSeed); ((Vector *)((int)otherPlayer + 0x33c))->x = (this->_pos).x; *(float *)((int)otherPlayer + 0x340) = (this->_pos).y; ((Vector *)((int)otherPlayer + 0x360))->x = (this->_velocity).x; *(float *)((int)otherPlayer + 0x364) = (this->_velocity).y; TemporaryEffects::AddNullEffect((TemporaryEffects *)((int)otherPlayer + 0x1508),100,1,1); *(int *)((int)otherPlayer + 0x1340) = 0; *(int *)((int)otherPlayer + 0x1344) = 0; *(int *)((int)otherPlayer + 0x1348) = 0; this->_boneHeartsMask = 0; *(int *)((int)otherPlayer + 0x1d88) = 0; *(int *)((int)otherPlayer + 0x1da4) = 0; *(int *)((int)otherPlayer + 0x134c) = 6; *(int *)((int)otherPlayer + 0x1350) = -1; UpdateBlackHeartMask((Entity_Player *)otherPlayer); *(float *)((int)otherPlayer + 0x154c) = this->_edenSpeed; *(float *)((int)otherPlayer + 0x1550) = this->_edenFireDelay; *(float *)((int)otherPlayer + 0x1554) = this->_edenDamage; *(float *)((int)otherPlayer + 0x1558) = this->_edenTearRange; *(float *)((int)otherPlayer + 0x155c) = this->_edenShotSpeed; *(float *)((int)otherPlayer + 0x1560) = this->_edenLuck; *(int *)((int)otherPlayer + 0x16b4) = this->_totalDamageTaken; SyncConsumables(this,(Entity_Player *)otherPlayer,0xffffffff); pvVar15 = (this->_collectibleRNGs)._begin; rngSeed = (uint *)((int)pvVar15 + 0x2bf0); *(byte *)((int)otherPlayer + 0x1df8) = 1; historyItem = (local_58->_history)._historyItems._begin; pEVar13 = local_58; if (historyItem != (local_58->_history)._historyItems._end) { do { if (*(char *)(historyItem + 1) == '\0') { if (0 < *(int *)((int)(pEVar13->_collectibleCounts)._begin + (int)historyItem[2] * 4)) { itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)historyItem[2]); pEVar13 = local_58; if (itemConfig->type != 3) { bVar9 = CanRerollCollectible(local_58,(int)historyItem[2],0); if ((bVar9 != 0) && (0 < (int)*historyItem)) { local_50._colorize[0] = *historyItem; local_50._colorize[1] = historyItem[1]; local_50._colorize[3] = historyItem[3]; local_68 = (Entity_Player *)historyItem[6]; fVar8 = historyItem[4]; pEStack_7c = (Entity_Player *)historyItem[5]; local_50._colorize[2] = 0.0; local_60 = (EntityPtr)0x0; local_50._offset[0] = fVar8; local_50._offset[1] = (float)pEStack_7c; local_50._offset[2] = (float)local_68; do { if (local_50._colorize[2] != 0.0) goto LAB_007ace88; uVar10 = *rngSeed; local_5c = (Game *)&g_game->_itemPool; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = *rngSeed; if (uVar10 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar10 = uVar10 >> ((byte)*(undefined4 *)((int)pvVar15 + 0x2bf4) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)((int)pvVar15 + 0x2bf8) & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)*(undefined4 *)((int)pvVar15 + 0x2bfc) & 0x1f) ^ uVar10; *rngSeed = uVar10; local_50._colorize[2] = (float)ItemPool::GetCollectible ((ItemPool *)local_5c,(int)historyItem[6],uVar10,6,0,0); local_60 = (EntityPtr)((int)local_60 + 1); } while ((int)local_60 < 10); if (local_50._colorize[2] == 0.0) { local_50._colorize[2] = 3.50325e-44; } LAB_007ace88: AddCollectible((Entity_Player *)local_64,(int)local_50._colorize[2],0,0,0,0,0); historyEnd = *(void **)((int)local_64 + 0x1df0); if (historyEnd == *(void **)((int)local_64 + 0x1df4)) { std::vector<28byte>::_Emplace_reallocate(historyEnd,local_50._colorize); } else { *historyEnd = local_50._colorize[0]; historyEnd[1] = local_50._colorize[1]; historyEnd[2] = local_50._colorize[2]; historyEnd[3] = local_50._colorize[3]; historyEnd[4] = fVar8; historyEnd[5] = (float)pEStack_7c; historyEnd[6] = (float)local_68; *(void **)((int)local_64 + 0x1df0) = (void *)((int)*(void **)((int)local_64 + 0x1df0) + 0x1c); } } pEVar13 = local_58; } } } historyItem = historyItem + 7; } while (historyItem != (pEVar13->_history)._historyItems._end); } *(byte *)((int)local_64 + 0x1df8) = 0; this = local_58; goto LAB_007acefb; } goto LAB_007acacf; } LAB_007acefb: local_68 = *(Entity_Player **)((int)(local_6c + 0x567) + (int)this); if (0 < (int)local_68) { pEVar13 = (Entity_Player *)(g_game->_seedEffects)._stageSeeds[(int)&local_68[-1].field_0x26ae]; local_58 = pEVar13; if (pEVar13 != (Entity_Player *)0x0) { pEVar13->_isControlsEnabled = 0; local_64 = *(EntityPtr *)&(this->_darkEsau).field_0x0; if (local_64 != (EntityPtr)0x0) { local_5c = (Game *)&this->_darkEsau; std::multiset::erase(&local_5c); this->_darkEsau = (EntityPtr)0x0; } local_6c = TemporaryEffects::GetNullEffect(&this->_temporaryeffects,0x6d); if (local_6c == (float *)0x0) { pvVar15 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar15 & 0xfffffffcU) < 0x1b5) { local_88 = 0.0; } else { local_88 = *(float *)((int)pvVar15 + 0x1b4); } pEStack_80 = *(Entity_Player **)((int)local_88 + 0x78); fStack_84 = 0.0; pEStack_7c = (Entity_Player *)0x0; } else { local_88 = *local_6c; fStack_84 = local_6c[1]; pEStack_80 = (Entity_Player *)local_6c[2]; pEStack_7c = (Entity_Player *)local_6c[3]; } this_00 = &g_game->_playerManager; pEVar13->_totalDamageTaken = this->_totalDamageTaken; local_50._colorize[3] = local_88; local_50._offset[0] = fStack_84; local_50._offset[1] = (float)pEStack_80; local_50._offset[2] = (float)pEStack_7c; PlayerManager::replace_player(this_00,this,pEVar13); manager = g_manager; local_60 = (EntityPtr)0x418; (g_game->_seedEffects)._stageSeeds[(int)&local_68[-1].field_0x26ae] = (int)this; seed_fart_sound_override((int *)&local_60); SoundEffects::Play(&manager->_sfxManager,(int)local_60,1.0,2,0,1.0,0.0); pEVar13 = local_58; if (local_58->_playerType != this->_playerType) { ChangePlayerType(local_58,this->_playerType,1); } if (local_64 != (EntityPtr)0x0) { if (pEVar13->_darkEsau != (EntityPtr)0x0) { local_5c = (Game *)&pEVar13->_darkEsau; std::multiset::erase(&local_5c); } pEVar13->_darkEsau = local_64; std::multiset::insert(&pEVar13->_darkEsau); } TemporaryEffects::RemoveNullEffect(&pEVar13->_temporaryeffects,0x6d,-1); if (local_6c != (float *)0x0) { TemporaryEffects::AddEffect(&pEVar13->_temporaryeffects,local_50._colorize + 3,1,1); } pvVar15 = (this->_history)._historyItems._begin; isCacheDirty = '\0'; isItemMoved = '\0'; if (pvVar15 != (this->_history)._historyItems._end) { do { if (*(char *)((int)pvVar15 + 4) == '\0') { local_68 = (Entity_Player *) ItemConfig::GetCollectible (&g_manager->_itemConfig,*(int *)((int)pvVar15 + 8)); if (((local_68 == (Entity_Player *)0x0) || (*(int *)local_68 == 3)) || ((*(uint *)&(local_68->_sprite)._overlayRenderFirst & 0x8000) == 0)) { isCacheDirty = isItemMoved; goto LAB_007ad16e; } *(undefined4 *) ((int)(local_58->_collectibleCounts)._begin + *(int *)((int)pvVar15 + 8) * 4) = *(undefined4 *) ((int)(this->_collectibleCounts)._begin + *(int *)((int)pvVar15 + 8) * 4); *(undefined4 *)((int)(this->_collectibleCounts)._begin + *(int *)((int)pvVar15 + 8) * 4) = 0; History::AddHistoryItem(&local_58->_history,pvVar15); puVar12 = (undefined4 *)std::vector::erase(&pEStack_7c,pvVar15); pvVar15 = (void *)*puVar12; local_58->_cacheFlags = local_58->_cacheFlags | *(uint *)((local_68->_sprite)._filename._buf + 0xc); isCacheDirty = '\x01'; isItemMoved = '\x01'; } else { LAB_007ad16e: pvVar15 = (void *)((int)pvVar15 + 0x1c); } } while (pvVar15 != (this->_history)._historyItems._end); if (isCacheDirty != '\0') { (local_58->_temporaryeffects)._shouldEvaluateCache = 1; } } pEVar13 = local_58; uVar10 = Random(); effect = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); (**(code **)(*(int *)effect + 0xc))(); uVar10 = *(uint *)((int)(&(pEVar13->_sprite)._filename + -3) + descOffset); if ((uVar10 != *(uint *)((int)(&(this->_sprite)._filename + -3) + descOffset)) && (uVar10 != 0)) { RemoveCollectible(pEVar13,uVar10,1,0,1); } puVar12 = (undefined4 *)((int)(&(this->_sprite)._filename + -3) + descOffset); uVar16 = puVar12[1]; uVar19 = puVar12[2]; uVar2 = puVar12[3]; dstDescHead = (undefined4 *)((int)(&(pEVar13->_sprite)._filename + -3) + descOffset); *dstDescHead = *puVar12; dstDescHead[1] = uVar16; dstDescHead[2] = uVar19; dstDescHead[3] = uVar2; srcDescTail = (this->_sprite)._filename._buf + descOffset + -0x38; uVar16 = *(undefined4 *)(srcDescTail + 4); uVar19 = *(undefined4 *)(srcDescTail + 8); uVar2 = *(undefined4 *)(srcDescTail + 0xc); dstDescTail = (pEVar13->_sprite)._filename._buf + descOffset + -0x38; *(undefined4 *)dstDescTail = *(undefined4 *)srcDescTail; *(undefined4 *)(dstDescTail + 4) = uVar16; *(undefined4 *)(dstDescTail + 8) = uVar19; *(undefined4 *)(dstDescTail + 0xc) = uVar2; AnimateCollectible(pEVar13,0x2bf,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); SyncConsumables(this,pEVar13,0xffffffff); pEVar13->_isControlsEnabled = 1; pEVar13->_controlsCooldown = 1; bVar9 = HasCollectible(this,0x248,0); if ((bVar9 != 0) || (bVar9 = HasCollectible(pEVar13,0x248,0), bVar9 != 0)) { AddWisp(pEVar13,0x2bf,&this->_pos,0,0); } TriggerNewRoom_TemporaryEffects(pEVar13); } } LAB_007ad261: uVar10 = activeSlot; active_used_post(this,activeSlot,unk,local_74); if (uVar10 == 3) { SetPocketActiveItem(this,0,3,0); } ExceptionList = local_1c; return; code_r0x007aca85: iVar14 = iVar14 + 1; playerSlot = playerSlot + 1; if (3 < iVar14) goto LAB_007acacf; goto LAB_007aca80; LAB_007acacf: manager = g_manager; local_60 = (EntityPtr)0x35; seed_fart_sound_override((int *)&local_60); SoundEffects::Play(&manager->_sfxManager,(int)local_60,1.0,2,0,1.0,0.0); uVar10 = Random(); position = &this->_pos; effect = Game::Spawn(g_game,1000,0x61,position,&g_vectorZero,(Entity *)0x0,0,uVar10); (**(code **)(*(int *)effect + 0xc))(); local_5c = (Game *)(local_58->_posOffset).y; Color::Color(&local_50); uVar10 = Random(); Game::SpawnParticles (g_game,position,0x23,8, (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0,color,(float)local_5c,0); uVar10 = Random(); effect = Game::Spawn(g_game,1000,2,position,&g_vectorZero,(Entity *)0x0,2,uVar10); (**(code **)(*(int *)effect + 0xc))(); this = local_58; TemporaryEffects::AddNullEffect(&local_58->_temporaryeffects,0x83,1,1); EvaluateItems(); AnimateCollectible(this,0x2bf,(byte *)"UseItem",(byte *)"PlayerPickupSparkle"); if (unk == 0) { RemoveCollectible(this,*(uint *)((int)(&(this->_sprite)._filename + -3) + descOffset),0, activeSlot,1); ExceptionList = local_1c; return; } goto LAB_007acefb; } //@@ 007ad330 Entity_Player::TryRemoveCollectibleCostume /* ZHL [lua] Lua binding EntityPlayer:TryRemoveCollectibleCostume prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::TryRemoveCollectibleCostume (Entity_Player *this,int collectibleId,byte isKeepPersistent) { byte bVar1; ItemConfig_Item *Item; if ((collectibleId != 0) && ((bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,collectibleId), bVar1 == 0 || (collectibleId == 0x31)))) { Item = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if ((Item->addCostumeOnPickup != 0) && (bVar1 = HasCollectible(this,collectibleId,0), bVar1 != 0)) { return; } RemoveCostume(this,Item); } return; } //@@ 007ad3a0 Entity_Player::TryRemoveTrinketCostume /* ZHL [lua] Lua binding EntityPlayer:TryRemoveTrinketCostume prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::TryRemoveTrinketCostume(Entity_Player *this,int trinketId) { void *pvVar1; ItemConfig_Item *Item; byte bVar2; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(trinketId & 0x7fffU) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) && (Item = *(ItemConfig_Item **)((int)pvVar1 + (trinketId & 0x7fffU) * 4), Item != (ItemConfig_Item *)0x0)) { if ((Item->addCostumeOnPickup == 0) && (bVar2 = TemporaryEffects::HasTrinketEffect(&this->_temporaryeffects,trinketId), bVar2 != 0)) { return; } RemoveCostume(this,Item); } return; } //@@ 007ad400 Entity_Player::TryRemoveNullCostume /* ZHL [lua] Lua binding EntityPlayer:TryRemoveNullCostume */ void Entity_Player::TryRemoveNullCostume(int param_1) { void *pvVar1; Entity_Player *in_ECX; if ((param_1 < 0) || (pvVar1 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 >> 2 <= param_1)) { RemoveCostume(in_ECX,(ItemConfig_Item *)0x0); return; } RemoveCostume(in_ECX,*(ItemConfig_Item **)((int)pvVar1 + param_1 * 4)); return; } //@@ 007ad440 Entity_Player::GetMaxPocketItems /* ZHL [exact] __thiscall unsigned int Entity_Player::GetMaxPocketItems(); prototype: REPENTOGON, confirmed by RET 0 */ uint __thiscall Entity_Player::GetMaxPocketItems(Entity_Player *this) { byte bVar1; uint uVar2; uint uVar3; uVar3 = 1; bVar1 = HasCollectible(this,0xfb,0); if (bVar1 == 0) { bVar1 = HasCollectible(this,0xfc,0); if (bVar1 == 0) { bVar1 = HasCollectible(this,0x1c6,0); if (bVar1 == 0) goto LAB_007ad488; } } uVar3 = 2; LAB_007ad488: if ((this->_pocketSlots[1] == 2) && (0 < this->_pocketSlots[0])) { uVar3 = uVar3 + 1; } if ((this->_pocketSlots[3] == 2) && (0 < this->_pocketSlots[2])) { uVar3 = uVar3 + 1; } if ((this->_pocketSlots[5] == 2) && (0 < this->_pocketSlots[4])) { uVar3 = uVar3 + 1; } if ((this->_pocketSlots[7] != 2) || (uVar2 = uVar3 + 1, this->_pocketSlots[6] < 1)) { uVar2 = uVar3; } return uVar2; } //@@ 007ad4e0 Entity_Player::stop_costume_item_anims /* DB: ? if !_isCoopGhost(0x20a9) walks the 15 _playerCostumeMap entries (0x122c stride 0x10) and clears _costumeSpriteDescs[idx]+0x11c (_itemAnimPlay per REPENTOGON); called on Taurus(299) removal in trigger_collectible_effect_removed and from Weapon_*::Fire prototype: db/protos.zhl */ void __thiscall Entity_Player::stop_costume_item_anims(Entity_Player *this) { PlayerCostumeMap *pPVar1; int iVar2; if (this->_isCoopGhost == 0) { pPVar1 = this->_playerCostumeMap + 1; iVar2 = 3; do { if (-1 < pPVar1[-1]._index) { *(undefined1 *)(pPVar1[-1]._index * 0x130 + 0x11c + (int)(this->_costumeSpriteDescs)._begin) = 0; } if (-1 < pPVar1->_index) { *(undefined1 *)(pPVar1->_index * 0x130 + 0x11c + (int)(this->_costumeSpriteDescs)._begin) = 0; } if (-1 < pPVar1[1]._index) { *(undefined1 *)(pPVar1[1]._index * 0x130 + 0x11c + (int)(this->_costumeSpriteDescs)._begin) = 0; } if (-1 < pPVar1[2]._index) { *(undefined1 *)(pPVar1[2]._index * 0x130 + 0x11c + (int)(this->_costumeSpriteDescs)._begin) = 0; } if (-1 < pPVar1[3]._index) { *(undefined1 *)(pPVar1[3]._index * 0x130 + 0x11c + (int)(this->_costumeSpriteDescs)._begin) = 0; } pPVar1 = pPVar1 + 5; iVar2 = iVar2 + -1; } while (iVar2 != 0); } return; } //@@ 007ad5a0 Entity_Player::ClearCollectibleAnim /* ZHL [exact] __thiscall void Entity_Player::ClearCollectibleAnim(CollectibleType collectible); */ void __thiscall Entity_Player::ClearCollectibleAnim(Entity_Player *this,int param_2) { int iVar1; void *pvVar2; ItemConfig_Item *pIVar3; PlayerCostumeMap *pPVar4; int iVar5; if (this->_isCoopGhost == 0) { pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_2); pPVar4 = this->_playerCostumeMap; iVar5 = 0xf; do { iVar1 = pPVar4->_index; if ((-1 < iVar1) && (pvVar2 = (this->_costumeSpriteDescs)._begin, *(ItemConfig_Item **)((int)pvVar2 + iVar1 * 0x130 + 0x114) == pIVar3)) { *(undefined1 *)((int)pvVar2 + iVar1 * 0x130 + 0x11c) = 0; } pPVar4 = pPVar4 + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); } return; } //@@ 007ad610 FUN_007ad610 void FUN_007ad610(void) { void *pvVar1; int iVar2; int in_ECX; int *piVar3; int iVar4; int iVar5; if (*(char *)(in_ECX + 0x20a9) == '\0') { pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU) < 0x1d5) { iVar5 = 0; } else { iVar5 = *(int *)((int)pvVar1 + 0x1d4); } piVar3 = (int *)(in_ECX + 0x122c); iVar4 = 0xf; do { if ((-1 < *piVar3) && (iVar2 = *piVar3 * 0x130 + *(int *)(in_ECX + 0x1220), *(int *)(iVar2 + 0x114) == iVar5)) { *(undefined1 *)(iVar2 + 0x11c) = 0; } piVar3 = piVar3 + 4; iVar4 = iVar4 + -1; } while (iVar4 != 0); } return; } //@@ 007ad680 Entity_Player::IsCollectibleAnimFinished /* ZHL [exact] __thiscall bool Entity_Player::IsCollectibleAnimFinished(CollectibleType collectible, std_string &animName); */ undefined1 __thiscall Entity_Player::IsCollectibleAnimFinished(Entity_Player *this,int param_2,byte *param_3) { void *pvVar1; byte bVar2; ItemConfig_Item *pIVar3; byte *animName; undefined1 uVar4; PlayerCostumeMap *pPVar5; ANM2 *this_00; uint uVar6; pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_2); uVar6 = 0; uVar4 = 1; pPVar5 = this->_playerCostumeMap; do { if (-1 < pPVar5->_index) { this_00 = (ANM2 *)(pPVar5->_index * 0x130 + (int)(this->_costumeSpriteDescs)._begin); if ((this_00[1]._filename._buf[8] != '\0') && (*(ItemConfig_Item **)this_00[1]._filename._buf == pIVar3)) { animName = param_3; if (0xf < *(uint *)(param_3 + 0x14)) { animName = *(byte **)param_3; } bVar2 = ANM2::IsFinishedImpl(this_00,animName); if ((bVar2 != 0) && ((pvVar1 = (this_00->_animState)._animData, pvVar1 == (void *)0x0 || (*(char *)((int)pvVar1 + 0x34) == '\0')))) { return 1; } uVar4 = 0; } } uVar6 = uVar6 + 1; pPVar5 = pPVar5 + 1; if (0xe < uVar6) { return uVar4; } } while( true ); } //@@ 007ad720 FUN_007ad720 uint FUN_007ad720(undefined4 param_1,byte *param_2) { byte bVar1; byte *animName; undefined3 extraout_var; void *pvVar2; int in_ECX; int iVar3; uint *puVar4; ANM2 *this; uint uVar5; pvVar2 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar2 & 0xfffffffcU) < 0x1d5) { iVar3 = 0; } else { iVar3 = *(int *)((int)pvVar2 + 0x1d4); } puVar4 = (uint *)(in_ECX + 0x122c); uVar5 = 0; do { pvVar2 = (void *)*puVar4; if (((-1 < (int)pvVar2) && (this = (ANM2 *)((int)pvVar2 * 0x130 + *(int *)(in_ECX + 0x1220)), this[1]._filename._buf[8] != '\0')) && (*(int *)this[1]._filename._buf == iVar3)) { animName = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { animName = *(byte **)param_2; } bVar1 = ANM2::IsFinishedImpl(this,animName); pvVar2 = (void *)CONCAT31(extraout_var,bVar1); if ((bVar1 != 0) && ((pvVar2 = (this->_animState)._animData, pvVar2 == (void *)0x0 || (*(char *)((int)pvVar2 + 0x34) == '\0')))) { return CONCAT31((int3)((uint)pvVar2 >> 8),1); } } uVar5 = uVar5 + 1; puVar4 = puVar4 + 4; if (0xe < uVar5) { return (uint)pvVar2 & 0xffffff00; } } while( true ); } //@@ 007ad7e0 string_from_direction /* DB: returns into param_1 a copy of one of four strings by the dominant axis of (x,y): left/right (x<0 / x>=0) when |x|>|y|, else up/down; Entity_Player::update_shooting passes Vector::ToCardinal() and "HeadLeftShoot"-style anim names prototype: db/protos.zhl, confirmed by RET 28 */ void * string_from_direction (void *outString,Vector direction,void *leftString,void *upString,void *rightString ,void *downString) { if (ABS(direction.x) <= ABS(direction.y)) { if (direction.y < 0.0) { std::string::string(outString,upString); return outString; } std::string::string(outString,downString); return outString; } if (direction.x < 0.0) { std::string::string(outString,leftString); return outString; } std::string::string(outString,rightString); return outString; } //@@ 007ad860 Entity_Player::TriggerTrinketAdded /* ZHL [exact] __thiscall void Entity_Player::TriggerTrinketAdded(unsigned int trinketID, bool firstTimePickingUp); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::TriggerTrinketAdded(Entity_Player *this,uint trinketID,byte firstTimePickingUp) { int *piVar1; void *pvVar2; Game *pGVar3; byte bVar4; uint uVar5; int iVar6; uint uVar7; pGVar3 = g_game; if (this->_variant != 0) { return; } uVar7 = trinketID & 0x8000; uVar5 = trinketID & 0x7fff; switch(uVar5) { case 7: piVar1 = &(g_game->_itemPool)._pools[6]._bibleUpgrade; *piVar1 = *piVar1 + 5; piVar1 = &(pGVar3->_itemPool)._pools[1]._bibleUpgrade; *piVar1 = *piVar1 + 5; break; case 0x30: IncrementPlayerFormCounter(this,0xf,1); break; case 0x47: IncrementPlayerFormCounter(this,4,1); break; case 0x6d: iVar6 = GetTrinketMultiplier(this,0x6d); if ((1 < iVar6) && (this->_ductTapeMode == 0)) { this->_ductTapeMode = 1; } break; case 0x79: FUN_007db0a0(); if ((uVar7 != 0) || (bVar4 = HasCollectible(this,0x1b7,0), bVar4 != 0)) { FUN_007db0a0(); } break; case 0x84: if (1 < *(int *)&g_game->_deathmatchManager) { add_random_drug_item_effect(); } break; case 0x92: Level::update_treasure_room_doors_for_trinket(); break; case 0x99: if (1 < *(int *)&g_game->_deathmatchManager) { AddRandomMomItemEffect(); } break; case 0x9c: update_greeds_gullet(this); if (firstTimePickingUp == 0) goto LAB_007ad9f7; AddHearts(this,(uint)(uVar7 != 0) * 2 + 2,0,0); goto LAB_007ad9e6; case 0xa6: if (1 < *(int *)&g_game->_deathmatchManager) { ModelingClay_roll((int)(this->_trinketRNGs)._begin + 0xa60); } break; case 0xa9: IncrementPlayerFormCounter(this,0,(uVar7 != 0) + 1); break; case 0xb0: spawn_lil_clot_familiars(); break; case 0xb7: if (1 < *(int *)&g_game->_deathmatchManager) { twins_duplicate_familiars(this,1); } } if (firstTimePickingUp != 0) { LAB_007ad9e6: if (trinketID == 0x9f) { AddKeys(this,1); } } LAB_007ad9f7: pvVar2 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)uVar5 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar2 >> 2) && (iVar6 = *(int *)((int)pvVar2 + uVar5 * 4), iVar6 != 0)) && (uVar5 = *(uint *)(iVar6 + 0x54), uVar5 != 0)) { this->_cacheFlags = this->_cacheFlags | uVar5; (this->_temporaryeffects)._shouldEvaluateCache = 1; } return; } //@@ 007adb30 Entity_Player::TriggerTrinketRemoved /* ZHL [exact] __thiscall void Entity_Player::TriggerTrinketRemoved(unsigned int trinketID); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::TriggerTrinketRemoved(Entity_Player *this,uint trinketID) { byte isHeld; ItemConfig_Item *item; int iVar1; float fVar2; uint uVar3; uint i; ItemConfig_Item *effectItem; undefined4 local_14; int effectCooldown; undefined4 local_c; int *bibleUpgrade; Game *game; int playerForm; void *trinkets; game = g_game; if (this->_variant != 0) { return; } uVar3 = trinketID & 0x7fff; switch(uVar3) { case 7: bibleUpgrade = &(g_game->_itemPool)._pools[6]._bibleUpgrade; *bibleUpgrade = *bibleUpgrade + -5; bibleUpgrade = &(game->_itemPool)._pools[1]._bibleUpgrade; *bibleUpgrade = *bibleUpgrade + -5; break; case 0x30: iVar1 = -1; playerForm = 0xf; goto LAB_007adda7; case 0x47: iVar1 = -1; playerForm = 4; goto LAB_007adda7; case 0x79: isHeld = HasTrinket(this,0x79,0); if (isHeld == 0) { remove_wooden_cross_mantles(); isHeld = HasCollectible(this,0x1b7,0); if (isHeld != 0) { remove_wooden_cross_mantles(); } } break; case 0x84: if (((1 < *(int *)&g_game->_deathmatchManager) && (isHeld = HasTrinket(this,trinketID,0), isHeld == 0)) && (fVar2 = this[1]._chargeBarSprites[0]._color._colorize[0], fVar2 != 0.0)) { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,(int)fVar2,1); this[1]._chargeBarSprites[0]._color._colorize[0] = 0.0; } break; case 0x92: Level::update_treasure_room_doors_for_trinket(); break; case 0x99: if (((1 < *(int *)&g_game->_deathmatchManager) && (isHeld = HasTrinket(this,trinketID,0), isHeld == 0)) && (fVar2 = this[1]._chargeBarSprites[0]._color._colorize[1], fVar2 != 0.0)) { TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,(int)fVar2,1); this[1]._chargeBarSprites[0]._color._colorize[1] = 0.0; } break; case 0x9c: update_greeds_gullet(this); break; case 0xa6: isHeld = HasTrinket(this,trinketID,0); if (isHeld == 0) { iVar1 = this->_modelingClayEffect; this->_modelingClayEffect = 0; if (iVar1 != 0) { item = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar1); if (item != (ItemConfig_Item *)0x0) { this->_cacheFlags = this->_cacheFlags | item->cacheFlags; (this->_temporaryeffects)._shouldEvaluateCache = 1; } TryRemoveCollectibleCostume(this,iVar1,0); } } break; case 0xa9: iVar1 = -1 - (uint)((trinketID & 0x8000) != 0); playerForm = 0; LAB_007adda7: IncrementPlayerFormCounter(this,playerForm,iVar1); break; case 0xb7: if ((1 < *(int *)&g_game->_deathmatchManager) && (isHeld = HasTrinket(this,trinketID,0), isHeld == 0)) { i = 0; fVar2 = this[1]._chargeBarSprites[0]._color._colorize[2]; if ((int)this[1]._chargeBarSprites[0]._color._colorize[3] - (int)fVar2 >> 2 != 0) { do { item = ItemConfig::GetCollectible(&g_manager->_itemConfig,*(int *)((int)fVar2 + i * 4)); if (item != (ItemConfig_Item *)0x0) { effectCooldown = item->maxCooldown; local_14 = 0; local_c = 0; effectItem = item; TemporaryEffects::RemoveEffect(&this->_temporaryeffects,&effectItem,1); } i = i + 1; fVar2 = this[1]._chargeBarSprites[0]._color._colorize[2]; } while (i < (uint)((int)this[1]._chargeBarSprites[0]._color._colorize[3] - (int)fVar2 >> 2) ); } this[1]._chargeBarSprites[0]._color._colorize[3] = fVar2; } } trinkets = (g_manager->_itemConfig)._trinkets._begin; if ((((int)uVar3 < (int)(g_manager->_itemConfig)._trinkets._end - (int)trinkets >> 2) && (iVar1 = *(int *)((int)trinkets + uVar3 * 4), iVar1 != 0)) && (uVar3 = *(uint *)(iVar1 + 0x54), uVar3 != 0)) { this->_cacheFlags = this->_cacheFlags | uVar3; (this->_temporaryeffects)._shouldEvaluateCache = 1; } return; } //@@ 007aded0 Entity_Player::FireKnife /* ZHL [exact] __thiscall Entity_Knife* Entity_Player::FireKnife(Entity * parent, unsigned int variant, float rotationOffset, bool cantOverwrite, unsigned int subType); prototype: REPENTOGON, confirmed by RET 20 */ Entity_Knife * __thiscall Entity_Player::FireKnife (Entity_Player *this,Entity *parent,uint variant,float rotationOffset,byte cantOverwrite, uint subType) { EntityPtr *pEVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; qword qVar5; Entity_Player *pEVar6; uint seed; Entity *pEVar7; Entity_Knife *pEVar8; EntityPtr *pEStack_10; Entity_Player *local_c; local_c = this; seed = Random(); pEVar7 = Game::SpawnEx(g_game,8,variant,&this->_pos,&g_vectorZero,(Entity *)this,subType,seed,0); pEVar8 = (Entity_Knife *) __RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0); pEVar1 = &pEVar8->_parent; if (pEVar8->_parent != (EntityPtr)0x0) { pEStack_10 = pEVar1; std::multiset::erase(&pEStack_10); } *pEVar1 = (EntityPtr)parent; if (parent != (Entity *)0x0) { std::multiset::insert(pEVar1); } pEVar6 = local_c; (pEVar8->_posOffset).x = 0.0; (pEVar8->_posOffset).y = -10.0; (**(code **)(*(int *)pEVar8 + 0x3c))(&local_c->_tearColor,0xffffffff,0xff,0,1); uVar3 = *(undefined4 *)((int)&(pEVar6->_tearFlags)._l + 4); qVar5 = (pEVar6->_tearFlags)._h; uVar4 = *(undefined4 *)((int)&(pEVar6->_tearFlags)._h + 4); iVar2 = *(int *)pEVar8; *(int *)&(pEVar8->_tearFlags)._l = (int)(pEVar6->_tearFlags)._l; *(undefined4 *)((int)&(pEVar8->_tearFlags)._l + 4) = uVar3; *(int *)&(pEVar8->_tearFlags)._h = (int)qVar5; *(undefined4 *)((int)&(pEVar8->_tearFlags)._h + 4) = uVar4; (**(code **)(iVar2 + 0x40))(pEVar6->_damage); if (360.0 < ABS(rotationOffset)) { rotationOffset = fmodf(rotationOffset,360.0); } if (rotationOffset <= 180.0) { if (rotationOffset < -180.0) { rotationOffset = rotationOffset + 360.0; } } else { rotationOffset = rotationOffset - 360.0; } pEVar8->_rotationOffset = rotationOffset; if (cantOverwrite != 0) { uVar3 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags | 0x200000; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar3; } return pEVar8; } //@@ 007ae030 Entity_Player::FireBoneClub /* ZHL [exact] __thiscall Entity_Knife* Entity_Player::FireBoneClub(Entity* parent, unsigned int variant, bool unk, Weapon* weapon, float unk2); prototype: REPENTOGON, confirmed by RET 16 */ Entity_Knife * __thiscall Entity_Player::FireBoneClub (Entity_Player *this,Entity *parent,uint variant,byte unk,Weapon *weapon,float unk2) { EntityPtr *pEVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; qword qVar5; float fVar6; uint seed; Entity *pEVar7; Entity_Knife *pEVar8; float *extraout_EAX; float fVar9; float fVar10; float x; EntityPtr *pEStack_18; Vector local_14; float local_c; local_14.x = (float)this; local_c = unk2; seed = Random(); pEVar7 = Game::SpawnEx(g_game,8,variant,&this->_pos,&g_vectorZero,(Entity *)this,0,seed,0); pEVar8 = (Entity_Knife *) __RTDynamicCast(pEVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0); pEVar1 = &pEVar8->_parent; if (pEVar8->_parent != (EntityPtr)0x0) { pEStack_18 = pEVar1; std::multiset::erase(&pEStack_18); } *pEVar1 = (EntityPtr)parent; if (parent != (Entity *)0x0) { std::multiset::insert(pEVar1); } fVar6 = local_14.x; fVar10 = 0.0; fVar9 = -10.0; if (*(byte *)((int)local_14.x + 0x1570) != 0) { GetFlyingOffset((Entity_Player *)local_14.x,&local_14); fVar10 = *extraout_EAX / 0.65 + 0.0; fVar9 = extraout_EAX[1] / 0.65 - 10.0; } x = 1.4013e-45; (pEVar8->_posOffset).x = fVar10; (pEVar8->_posOffset).y = fVar9; (**(code **)(*(int *)pEVar8 + 0x3c))((ColorMod *)((int)fVar6 + 0x1498),0xffffffff,0xff,0); uVar3 = *(undefined4 *)((int)&((BitSet128 *)((int)fVar6 + 0x1488))->_l + 4); qVar5 = ((BitSet128 *)((int)fVar6 + 0x1488))->_h; uVar4 = *(undefined4 *)((int)&((BitSet128 *)((int)fVar6 + 0x1488))->_h + 4); iVar2 = *(int *)pEVar8; *(int *)&(pEVar8->_tearFlags)._l = (int)((BitSet128 *)((int)fVar6 + 0x1488))->_l; *(undefined4 *)((int)&(pEVar8->_tearFlags)._l + 4) = uVar3; *(int *)&(pEVar8->_tearFlags)._h = (int)qVar5; *(undefined4 *)((int)&(pEVar8->_tearFlags)._h + 4) = uVar4; (**(code **)(iVar2 + 0x40))(*(float *)((int)fVar6 + 0x1470)); if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } pEVar8->_rotationOffset = x; if (unk != 0) { uVar3 = *(undefined4 *)((int)&pEVar8->_flags + 4); *(uint *)&pEVar8->_flags = (uint)pEVar8->_flags | 0x200000; *(undefined4 *)((int)&pEVar8->_flags + 4) = uVar3; } return pEVar8; } //@@ 007ae1d0 Entity_Player::FireBrimstoneBall /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity_Effect* Entity_Player::FireBrimstoneBall(const Vector& pos, const Vector& vel, const Vector& offset, unsigned int unk1, unsigned int unk2, Entity* unk3); prototype: REPENTOGON, confirmed by RET 24 */ Entity_Effect * __thiscall Entity_Player::FireBrimstoneBall (Entity_Player *this,Vector *pos,Vector *vel,Vector *offset,uint unk1,uint unk2, Entity *unk3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; int iVar5; int iVar6; EntityPtr this_00; byte bVar7; uint uVar8; Entity_Effect *pEVar9; Entity *pEVar10; int *piVar11; int *piVar12; EntityPtr *pEVar13; int *piVar14; Vector VStack_ac; undefined4 local_a4; EntityPtr EStack_a0; EntityPtr *pEStack_9c; undefined1 auStack_90 [4]; Entity_Player *local_8c; undefined1 local_78 [8]; undefined4 uStack_70; uint local_c; local_c = __security_cookie ^ (uint)auStack_90; pEStack_9c = (EntityPtr *)0x0; EStack_a0 = (EntityPtr)0x1; local_a4 = 0x3f800000; VStack_ac.x = (float)local_78; VStack_ac.y = 2.8026e-45; local_8c = this; GetTearHitParams(); uVar8 = Random(); pEVar9 = (Entity_Effect *)Game::SpawnEx(g_game,1000,0x71,pos,vel,(Entity *)EStack_a0,0,uVar8,0); if (pEVar9->_parent != (EntityPtr)0x0) { pEStack_9c = &pEVar9->_parent; std::multiset::erase(); } this_00 = EStack_a0; pEVar9->_parent = EStack_a0; if (EStack_a0 != (EntityPtr)0x0) { std::multiset::insert(); } (**(code **)(*(int *)pEVar9 + 0x3c))(); (**(code **)(*(int *)pEVar9 + 0x40))(); uVar1 = *(undefined4 *)((int)this_00 + 0x148c); uVar2 = *(undefined4 *)((int)this_00 + 0x1490); uVar3 = *(undefined4 *)((int)this_00 + 0x1494); *(undefined4 *)&(pEVar9->_varData)._l = *(undefined4 *)((int)this_00 + 0x1488); *(undefined4 *)((int)&(pEVar9->_varData)._l + 4) = uVar1; *(undefined4 *)&(pEVar9->_varData)._h = uVar2; *(undefined4 *)((int)&(pEVar9->_varData)._h + 4) = uVar3; (pEVar9->_posOffset).x = offset->x; (pEVar9->_posOffset).y = offset->y; pEVar9->_timeout = 0x24; pEVar9->_lifespan = 0x24; pEVar9->_renderDepthOffset = 3000.0; bVar7 = HasCollectible((Entity_Player *)this_00,0x18b,0); if (bVar7 != 0) { uVar8 = Random(); VStack_ac.x = (pEVar9->_pos).x; VStack_ac.y = (pEVar9->_pos).y; pEVar10 = Game::SpawnEx(g_game,7,2,&VStack_ac,&g_vectorZero,(Entity *)this_00,3,uVar8,0); piVar11 = (int *)__RTDynamicCast(pEVar10,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor); piVar14 = (int *)0x0; (**(code **)(*piVar11 + 0x3c))((int)this_00 + 0x14c4,0xffffffff,0xff); piVar14[0xd3] = (int)offset->x; piVar14[0xd4] = (int)offset->y; piVar12 = piVar14 + 0xef; if (*piVar12 != 0) { std::multiset::erase(auStack_90 + -0x38); } *piVar12 = (int)pEVar9; std::multiset::insert(piVar12); piVar14[0xd6] = 0x453b8000; iVar4 = *(int *)((int)this_00 + 0x148c); iVar5 = *(int *)((int)this_00 + 0x1490); iVar6 = *(int *)((int)this_00 + 0x1494); piVar14[0x10a] = *(int *)((int)this_00 + 0x1488); piVar14[0x10b] = iVar4; piVar14[0x10c] = iVar5; piVar14[0x10d] = iVar6; (**(code **)(*piVar14 + 0x40))(uStack_70); pEVar13 = (EntityPtr *)(piVar11 + 0xf2); piVar11[0x12f] = 0x42a00000; if (*pEVar13 != (EntityPtr)0x0) { std::multiset::erase(); } *pEVar13 = this_00; std::multiset::insert(); } return pEVar9; } //@@ 007ae430 FUN_007ae430 void FUN_007ae430(short *param_1) { int in_ECX; if (*(int *)(in_ECX + 0x161c) < 0) { *(int *)(in_ECX + 0x13c0) = (int)*param_1; } *(int *)(in_ECX + 0x1344) = (int)param_1[1]; *(int *)(in_ECX + 0x1340) = (int)param_1[2]; *(int *)(in_ECX + 0x134c) = (int)param_1[3]; *(undefined4 *)(in_ECX + 0x1350) = *(undefined4 *)(param_1 + 10); *(int *)(in_ECX + 0x1348) = (int)param_1[4]; *(int *)(in_ECX + 0x194c) = (int)param_1[5]; *(int *)(in_ECX + 0x1da0) = (int)param_1[9]; *(int *)(in_ECX + 0x1da4) = (int)param_1[8]; *(int *)(in_ECX + 0x1d88) = (int)param_1[7]; *(undefined4 *)(in_ECX + 0x1d8c) = *(undefined4 *)(param_1 + 0xc); return; } //@@ 007ae4b0 Entity_Player::RestoreGameState /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GameStatePlayer* param: SetControllerIndex from state[0x149], playerType, "Could not load config for player type"; caller passes player+0x20ec (_unlistedRestoreState 0x20c0 + 0x2c drift); zhl sig missed prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::RestoreGameState(Entity_Player *this,GameStatePlayer *saveState) { undefined4 friendBallHealth; undefined4 uVar2; undefined4 uVar3; GameStatePlayer GVar4; GameStatePlayer GVar5; EntityConfig_Player *pEVar6; char cVar7; undefined4 *puVar8; GameStatePlayer *pGVar9; Entity_Player *mainPlayer; void *pvVar10; GameStatePlayer GVar11; void *extraout_ECX; uint uVar12; int iVar13; GameStatePlayer *playerFormDst; int *piVar14; Entity_Player *player; uint uVar15; undefined4 *movingBoxEntry; GameStatePlayer *playerFormSrc; short *psVar16; int *piVar17; Entity_Player *self; int *piVar18; undefined1 local_60 [4]; GameStatePlayer local_5c; GameStatePlayer *local_58; GameStatePlayer local_54; Entity_Player *selfSaved; undefined4 *local_4c; GameStatePlayer local_48; EntityConfig_Player *local_44; GameStatePlayer local_40; void *local_3c [3]; void *local_30; GameStatePlayer *local_2c; GameStatePlayer *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; undefined8 friendBallHealth; Game *game; Manager *manager; void *smeltedCounts; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00affbfd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0xb); local_58 = saveState; if (this->_replacedPlayer != (void *)0x0) { return; } ExceptionList = &local_1c; selfSaved = this; SetControllerIndex(this,saveState[0x149],1,local_24); GVar11 = (GameStatePlayer)this->_playerType; if (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= (int)GVar11) { this->_playerType = 0; GVar11 = (GameStatePlayer)0x0; } if (g_game->_isRestoringGlowingHourglassState != 0) { if (GVar11 != *saveState) { RemoveSkinCostume(this); stop_costume_item_anims(this); this->_playerType = (int)*saveState; update_player_skin(this); (**(code **)(*(int *)this + 0x60))(); } if (((g_game->_isRestoringGlowingHourglassState != 0) && (this->_isCoopGhost != 0)) && (*(char *)(saveState + 0x164) == '\0')) { RevivePlayerGhost(this); } } if ((this->_playerType < 0) || (pvVar10 = (void *)this->_playerType, ((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= (int)pvVar10)) { local_44 = (EntityConfig_Player *)0x0; } else { local_44 = (EntityConfig_Player *) ((int)pvVar10 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); if (local_44 != (EntityConfig_Player *)0x0) goto LAB_007ae611; } KAGE_LogMessage(0x10,(byte *)"Could not load config for player type %d\n"); pvVar10 = extraout_ECX; LAB_007ae611: local_44 = (EntityConfig_Player *) EntityConfig_Player::GetDisplayName(local_44,(std_string *)local_3c,pvVar10); if ((EntityConfig_Player *)&this->_name != local_44) { std::string::_Tidy_deallocate((this->_name)._buf); friendBallHealth = *(undefined4 *)((int)&local_44->_id + 4); uVar2 = *(undefined4 *)((int)&local_44->_id + 8); uVar3 = *(undefined4 *)((int)&local_44->_id + 0xc); *(int *)(this->_name)._buf = local_44->_id; *(undefined4 *)((this->_name)._buf + 4) = friendBallHealth; *(undefined4 *)((this->_name)._buf + 8) = uVar2; *(undefined4 *)((this->_name)._buf + 0xc) = uVar3; *(undefined8 *)&(this->_name)._size = *(undefined8 *)((int)local_44 + 0x10); *(uint *)((int)local_44 + 0x10) = 0; *(uint *)((int)local_44 + 0x14) = 0xf; *(char *)&local_44->_id = '\0'; } if (0xf < local_28) { uVar15 = (int)local_28 + 1; pvVar10 = local_3c[0]; if (0xfff < uVar15) { pvVar10 = *(void **)((int)local_3c[0] + -4); uVar15 = (int)local_28 + 0x24; if (0x1f < (uint)((int)local_3c[0] + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar15); } pGVar9 = local_58; local_2c = (GameStatePlayer *)0x0; local_28 = (GameStatePlayer *)0xf; local_3c[0] = (void *)((uint)local_3c[0] & 0xffffff00); uVar12 = (int)saveState[0x5b] - (int)saveState[0x5a] >> 2; uVar15 = (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2; if (uVar12 < uVar15) { uVar15 = uVar12; } local_44 = (EntityConfig_Player *)0x0; if (uVar15 != 0) { do { *(undefined4 *)((int)(this->_collectibleCounts)._begin + (int)local_44 * 4) = *(undefined4 *)((int)saveState[0x5a] + (int)local_44 * 4); local_44 = (EntityConfig_Player *)((int)local_44 + 1); } while (local_44 < uVar15); } piVar14 = this->_trinketsID; *piVar14 = (int)saveState[99]; local_44 = (EntityConfig_Player *)0x0; *(GameStatePlayer *)(this->_trinketsID + 1) = saveState[100]; do { if ((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 <= (int)(*piVar14 & 0x7fffU)) { if (local_44 == (EntityConfig_Player *)0x0) { piVar18 = piVar14; piVar17 = piVar14; for (iVar13 = 1; piVar17 = piVar17 + 1, iVar13 != 0; iVar13 = iVar13 + -1) { *piVar18 = *piVar17; piVar18 = piVar18 + 1; } this = selfSaved; } this->_trinketsID[1] = 0; } local_44 = (EntityConfig_Player *)((int)local_44 + 1); piVar14 = piVar14 + 1; } while (local_44 < 2); local_40 = (GameStatePlayer)&this->_voidedCollectibles; (this->_voidedCollectibles)._end = ((std_vector *)local_40)->_begin; local_44 = (EntityConfig_Player *)((int)local_58[0x5e] - (int)local_58[0x5d] >> 2); if ((uint)((int)(this->_voidedCollectibles)._capacity - (int)((std_vector *)local_40)->_begin >> 2 ) < local_44) { if (0x3fffffff < local_44) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(local_44); } GVar11 = local_40; local_40 = pGVar9[0x5d]; local_44 = (EntityConfig_Player *)0x0; if ((int)pGVar9[0x5e] - (int)local_40 >> 2 != 0) { do { local_40 = (GameStatePlayer)((int)local_40 + (int)local_44 * 4); if (*(int *)local_40 < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) { piVar14 = *(void **)((int)GVar11 + 4); if (piVar14 == *(void **)((int)GVar11 + 8)) { std::vector::_Emplace_reallocate(piVar14,local_40); } else { *piVar14 = *(int *)local_40; *(void **)((int)GVar11 + 4) = (void *)((int)*(void **)((int)GVar11 + 4) + 4); } } local_40 = pGVar9[0x5d]; local_44 = (EntityConfig_Player *)((int)local_44 + 1); } while (local_44 < (uint)((int)pGVar9[0x5e] - (int)local_40 >> 2)); this = selfSaved; } pvVar10 = (this->_voidedPassives)._begin; local_40 = (GameStatePlayer)&this->_voidedPassives; (this->_voidedPassives)._end = pvVar10; local_44 = (EntityConfig_Player *)((int)pGVar9[0x61] - (int)pGVar9[0x60] >> 3); if ((uint)((int)(this->_voidedPassives)._capacity - (int)pvVar10 >> 3) < local_44) { if (0x1fffffff < local_44) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector<8byte>::_Reallocate_exactly(local_44); } GVar11 = local_40; local_54 = pGVar9[0x60]; local_48 = (GameStatePlayer)0x0; if ((int)pGVar9[0x61] - (int)local_54 >> 3 != 0) { do { pGVar9 = local_58; piVar14 = (int *)((int)local_54 + (int)local_48 * 8); if (*piVar14 < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) { piVar17 = *(void **)((int)GVar11 + 4); if (piVar17 == *(void **)((int)GVar11 + 8)) { std::vector<8byte>::_Emplace_reallocate(piVar17,piVar14); } else { iVar13 = *(int *)((int)local_54 + 4 + (int)local_48 * 8); *piVar17 = *piVar14; piVar17[1] = iVar13; *(void **)((int)GVar11 + 4) = (void *)((int)*(void **)((int)GVar11 + 4) + 8); } } local_54 = pGVar9[0x60]; local_48 = (GameStatePlayer)((int)local_48 + 1); } while ((uint)local_48 < (uint)((int)pGVar9[0x61] - (int)local_54 >> 3)); this = selfSaved; } local_40 = (GameStatePlayer)&this->_movingBoxContents; std::vector::resize(((int)pGVar9[0x79] - (int)pGVar9[0x78]) / 0x78); local_54 = pGVar9[0x78]; local_48 = (GameStatePlayer)0x0; iVar13 = (int)pGVar9[0x79] - (int)local_54 >> 0x1f; if (((int)pGVar9[0x79] - (int)local_54) / 0x78 + iVar13 != iVar13) { local_44 = (EntityConfig_Player *)0x0; do { movingBoxEntry = (undefined4 *)(*(int *)local_40 + (int)local_44); *movingBoxEntry = *(undefined4 *)((int)local_44 + (int)local_54); movingBoxEntry[1] = *(undefined4 *)((int)local_44 + 4U + (int)local_54); movingBoxEntry[2] = *(undefined4 *)((int)local_44 + 8U + (int)local_54); movingBoxEntry[3] = *(undefined4 *)((int)local_44 + 0xcU + (int)local_54); movingBoxEntry[4] = *(undefined4 *)((int)local_44 + 0x10U + (int)local_54); movingBoxEntry[5] = *(undefined4 *)((int)local_44 + 0x14U + (int)local_54); movingBoxEntry[6] = *(undefined4 *)((int)local_44 + 0x18U + (int)local_54); *(undefined1 *)((int)movingBoxEntry + 0x22) = *(undefined1 *)((int)local_44 + 0x22U + (int)local_54); movingBoxEntry[9] = *(undefined4 *)((int)local_44 + 0x24U + (int)local_54); movingBoxEntry[7] = *(undefined4 *)((int)local_44 + 0x1cU + (int)local_54); *(undefined2 *)(movingBoxEntry + 8) = *(undefined2 *)((int)local_44 + 0x20U + (int)local_54); movingBoxEntry[10] = *(undefined4 *)((int)local_44 + 0x28U + (int)local_54); movingBoxEntry[0xb] = *(undefined4 *)((int)local_44 + 0x2cU + (int)local_54); movingBoxEntry[0xc] = *(undefined4 *)((int)local_44 + 0x30U + (int)local_54); movingBoxEntry[0xd] = *(undefined4 *)((int)local_44 + 0x34U + (int)local_54); movingBoxEntry[0xe] = *(undefined4 *)((int)local_44 + 0x38U + (int)local_54); movingBoxEntry[0xf] = *(undefined4 *)((int)local_44 + 0x3cU + (int)local_54); movingBoxEntry[0x10] = *(undefined4 *)((int)local_44 + 0x40U + (int)local_54); iVar13 = *(int *)((int)local_44 + 0x3cU + (int)local_54); movingBoxEntry[0x12] = iVar13; movingBoxEntry[0x13] = iVar13 >> 0x1f; *(undefined1 *)((int)movingBoxEntry + 0x23) = *(undefined1 *)((int)local_44 + 0x23U + (int)local_54); movingBoxEntry[0x14] = *(undefined4 *)((int)local_44 + 0x50U + (int)local_54); movingBoxEntry[0x15] = *(undefined4 *)((int)local_44 + 0x54U + (int)local_54); *(undefined1 *)(movingBoxEntry + 0x18) = *(undefined1 *)((int)local_44 + 0x60U + (int)local_54); movingBoxEntry[0x16] = *(undefined4 *)((int)local_44 + 0x58U + (int)local_54); movingBoxEntry[0x17] = *(undefined4 *)((int)local_44 + 0x5cU + (int)local_54); local_4c = movingBoxEntry; puVar8 = (undefined4 *)FUN_004d7250((int)local_54 + 100 + (int)local_44); pGVar9 = local_58; friendBallHealth = puVar8[1]; puVar8[1] = movingBoxEntry[0x1a]; movingBoxEntry[0x1a] = friendBallHealth; friendBallHealth = *puVar8; *puVar8 = movingBoxEntry[0x19]; movingBoxEntry[0x19] = friendBallHealth; local_14 = (void *)0x0; if (((local_5c != (GameStatePlayer)0x0) && (cVar7 = (**(code **)(*(int *)local_5c + 0xc))(), cVar7 != '\0')) && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(local_60); } pEVar6 = local_44; local_14 = (void *)0xffffffff; SharedPtr::assign(local_4c + 0x1b,(void *)((int)local_54 + 0x6c + (int)local_44)); local_54 = pGVar9[0x78]; local_44 = (EntityConfig_Player *)((int)pEVar6 + 0x78); local_48 = (GameStatePlayer)((int)local_48 + 1); } while ((uint)local_48 < (uint)(((int)pGVar9[0x79] - (int)local_54) / 0x78)); this = selfSaved; } self = selfSaved; playerFormDst = (GameStatePlayer *)this->_playerForms; iVar13 = 0x10; playerFormSrc = pGVar9 + 0x49; do { GVar11 = *playerFormSrc; playerFormSrc = playerFormSrc + 1; *playerFormDst = GVar11; playerFormDst = playerFormDst + 1; iVar13 = iVar13 + -1; } while (iVar13 != 0); selfSaved->_playerFormsRewarded = (int)pGVar9[0x59]; ClearCostumes(selfSaved); local_48 = (GameStatePlayer)0x0; if (pGVar9[0x74] != (GameStatePlayer)0x0) { do { local_4c = *(undefined4 **)((int)pGVar9[0x75] + 4 + (int)local_48 * 8); if ((local_4c < (undefined4 *) ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2)) && (*(uint *)((int)pGVar9[0x75] + (int)local_48 * 8) < 5)) { /* WARNING: Could not recover jumptable at 0x007aeb80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)(&PTR_DAT_007afc04)[*(int *)((int)pGVar9[0x75] + (int)local_48 * 8)])(); return; } local_48 = (GameStatePlayer)((int)local_48 + 1); self = selfSaved; pGVar9 = local_58; } while ((uint)local_48 < (uint)local_58[0x74]); } uVar12 = (int)pGVar9[0x72] - (int)pGVar9[0x71] >> 2; uVar15 = (int)(self->_pillEffectUses)._end - (int)(self->_pillEffectUses)._begin >> 2; if (uVar12 < uVar15) { uVar15 = uVar12; } local_44 = (EntityConfig_Player *)0x0; if (uVar15 != 0) { do { *(undefined4 *)((int)(self->_pillEffectUses)._begin + (int)local_44 * 4) = *(undefined4 *)((int)pGVar9[0x71] + (int)local_44 * 4); local_44 = (EntityConfig_Player *)((int)local_44 + 1); } while (local_44 < uVar15); } uVar12 = (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2; uVar15 = (int)pGVar9[0x66] - (int)pGVar9[0x65] >> 2; if (uVar12 < uVar15) { uVar15 = uVar12; } if (uVar15 != 0) { uVar12 = 0; local_44 = (EntityConfig_Player *)0x0; do { puVar8 = (undefined4 *)((int)(self->_collectibleRNGs)._begin + (int)local_44); iVar13 = uVar12 * 4; uVar12 = uVar12 + 1; *puVar8 = *(undefined4 *)((int)pGVar9[0x65] + iVar13); *(undefined8 *)(puVar8 + 1) = 0x900000005; puVar8[3] = 7; local_44 = (EntityConfig_Player *)((int)local_44 + 0x10); } while (uVar12 < uVar15); } uVar12 = (int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2; uVar15 = (int)pGVar9[0x69] - (int)pGVar9[0x68] >> 2; if (uVar12 < uVar15) { uVar15 = uVar12; } if (uVar15 != 0) { uVar12 = 0; local_44 = (EntityConfig_Player *)0x0; do { puVar8 = (undefined4 *)((int)(self->_trinketRNGs)._begin + (int)local_44); iVar13 = uVar12 * 4; uVar12 = uVar12 + 1; *puVar8 = *(undefined4 *)((int)pGVar9[0x68] + iVar13); *(undefined8 *)(puVar8 + 1) = 0x900000005; puVar8[3] = 7; local_44 = (EntityConfig_Player *)((int)local_44 + 0x10); } while (uVar12 < uVar15); } uVar12 = (int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2; uVar15 = (int)pGVar9[0x6c] - (int)pGVar9[0x6b] >> 2; if (uVar12 < uVar15) { uVar15 = uVar12; } if (uVar15 != 0) { uVar12 = 0; local_44 = (EntityConfig_Player *)0x0; do { puVar8 = (undefined4 *)((int)(self->_pillRNGs)._begin + (int)local_44); iVar13 = uVar12 * 4; uVar12 = uVar12 + 1; *puVar8 = *(undefined4 *)((int)pGVar9[0x6b] + iVar13); *(undefined8 *)(puVar8 + 1) = 0x900000005; puVar8[3] = 7; local_44 = (EntityConfig_Player *)((int)local_44 + 0x10); } while (uVar12 < uVar15); } GVar11 = (GameStatePlayer) ((int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2); local_40 = (GameStatePlayer)((int)pGVar9[0x6f] - (int)pGVar9[0x6e] >> 2); if ((uint)GVar11 < (uint)local_40) { local_40 = GVar11; } GVar11 = (GameStatePlayer)0x0; if (local_40 != (GameStatePlayer)0x0) { local_44 = (EntityConfig_Player *)0x0; do { puVar8 = (undefined4 *)((int)(self->_cardRNGs)._begin + (int)local_44); iVar13 = (int)GVar11 * 4; GVar11 = (GameStatePlayer)((int)GVar11 + 1); *puVar8 = *(undefined4 *)((int)pGVar9[0x6e] + iVar13); *(undefined8 *)(puVar8 + 1) = 0x900000005; puVar8[3] = 7; local_44 = (EntityConfig_Player *)((int)local_44 + 0x10); } while ((uint)GVar11 < (uint)local_40); } self->_goldenHearts = 0; self->_eternalHearts = 0; self->_boneHearts = 0; self->_blackHearts = 0; self->_soulHearts = 0; self->_maxHearts = 0; self->_redHearts = 0; self->_brokenHearts = 0; self->_rottenHearts = 0; AddMaxHearts(self,(int)pGVar9[2],1); self->_blackHearts = (int)pGVar9[4]; AddSoulHearts(self,(int)pGVar9[3],0); self->_eternalHearts = (int)pGVar9[5]; self->_boneHearts = (int)pGVar9[0xdd]; self->_boneHeartsMask = (int)pGVar9[0xde]; AddHearts(self,(int)pGVar9[1],1,0); if ((*(char *)(pGVar9 + 0xe6) != '\0') && (self->_subPlayer != 0)) { FUN_007ae430(pGVar9 + 0xe7); } local_54 = (GameStatePlayer)0x0; local_30 = (void *)0x0; local_48 = (GameStatePlayer)0x0; local_2c = (GameStatePlayer *)0x0; local_44 = (EntityConfig_Player *)0x0; local_28 = (GameStatePlayer *)0x0; local_14 = (void *)0x1; local_40 = (GameStatePlayer)&g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(((PlayerManager *)local_40)->_playerList)._begin >> 2 != 0) { uVar15 = 0; do { pvVar10 = *(void **)((int)local_40 + 4); if ((int)pvVar10 - *(int *)local_40 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = *(void **)((int)local_40 + 4); } pGVar9 = *(GameStatePlayer **)local_40; if (uVar15 < (uint)((int)pvVar10 - (int)pGVar9 >> 2)) { pGVar9 = pGVar9 + uVar15; } local_54 = *pGVar9; if (*(int *)((int)local_54 + 0x2c) == 1) { mainPlayer = *(Entity_Player **)((int)local_54 + 0x3bc); if ((mainPlayer == (Entity_Player *)0x0) || (mainPlayer->_type != 1)) { local_40 = (GameStatePlayer)g_game; piVar14 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar14 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar14 = (((PlayerManager *)((int)local_40 + 0x1baa8))->_playerList)._begin; } mainPlayer = (Entity_Player *)*piVar14; } if (mainPlayer == self) { if (local_48 == (GameStatePlayer)local_44) { local_40 = local_54; std::vector::_Emplace_reallocate(local_48,&local_40); local_44 = (EntityConfig_Player *)local_28; local_48 = (GameStatePlayer)local_2c; } else { *(GameStatePlayer *)local_48 = local_54; local_48 = (GameStatePlayer)((int)local_48 + 4); local_2c = (GameStatePlayer *)local_48; } } } uVar15 = uVar15 + 1; local_40 = (GameStatePlayer)&g_game->_playerManager; } while (uVar15 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(((PlayerManager *)local_40)->_playerList)._begin >> 2)); pGVar9 = local_58; } local_40 = pGVar9[0xe3]; local_4c = (void *)0x0; iVar13 = (int)pGVar9[0xe4] - (int)local_40 >> 0x1f; local_54 = (GameStatePlayer)local_30; if (((int)pGVar9[0xe4] - (int)local_40) / 0x1c + iVar13 != iVar13) { iVar13 = (int)local_48 - (int)local_30; local_48 = (GameStatePlayer)0x0; do { psVar16 = (short *)((int)(int *)local_48 + (int)local_40); if (local_4c < (void *)(iVar13 >> 2)) { if (*(int *)(*(int *)((int)local_54 + (int)local_4c * 4) + 0x1aec) == (int)*psVar16) { FUN_007ae430(psVar16); } } else { PlayerManager::SpawnCoPlayerBaby(&g_game->_playerManager,(int)*psVar16); FUN_007ae430((int)(int *)local_48 + (int)local_40); PlayerManager::RemoveCoPlayer(&g_game->_playerManager,player,(byte)player); pGVar9 = local_58; } local_40 = pGVar9[0xe3]; local_4c = (undefined4 *)((int)local_4c + 1); local_48 = (GameStatePlayer)((int)local_48 + 0x1c); } while (local_4c < (void *)(((int)pGVar9[0xe4] - (int)local_40) / 0x1c)); self = selfSaved; } if (&self->_history != (History *)(pGVar9 + 0xef)) { std::vector::assign(pGVar9[0xef],pGVar9[0xf0],local_5c); } game = g_game; GVar11 = pGVar9[0xf3]; GVar4 = pGVar9[0xf4]; GVar5 = pGVar9[0xf5]; self->_inventory[0] = (int)pGVar9[0xf2]; *(GameStatePlayer *)(self->_inventory + 1) = GVar11; *(GameStatePlayer *)(self->_inventory + 2) = GVar4; *(GameStatePlayer *)(self->_inventory + 3) = GVar5; GVar11 = pGVar9[0xf7]; GVar4 = pGVar9[0xf8]; GVar5 = pGVar9[0xf9]; *(GameStatePlayer *)(self->_inventory + 4) = pGVar9[0xf6]; *(GameStatePlayer *)(self->_inventory + 5) = GVar11; *(GameStatePlayer *)(self->_inventory + 6) = GVar4; *(GameStatePlayer *)(self->_inventory + 7) = GVar5; GVar11 = pGVar9[0xfb]; GVar4 = pGVar9[0xfc]; GVar5 = pGVar9[0xfd]; *(GameStatePlayer *)(self->_inventory + 8) = pGVar9[0xfa]; *(GameStatePlayer *)(self->_inventory + 9) = GVar11; *(GameStatePlayer *)(self->_inventory + 10) = GVar4; *(GameStatePlayer *)(self->_inventory + 0xb) = GVar5; GVar11 = pGVar9[0xff]; GVar4 = pGVar9[0x100]; GVar5 = pGVar9[0x101]; *(GameStatePlayer *)(self->_inventory + 0xc) = pGVar9[0xfe]; *(GameStatePlayer *)(self->_inventory + 0xd) = GVar11; *(GameStatePlayer *)(self->_inventory + 0xe) = GVar4; *(GameStatePlayer *)(self->_inventory + 0xf) = GVar5; HUD::mark_all_slots_dirty(&game->_hud,0,0); uVar15 = 0; if ((int)(self->_smeltedTrinkets)._end - (int)(self->_smeltedTrinkets)._begin >> 2 != 0) { do { *(undefined4 *)((int)(self->_smeltedTrinkets)._begin + uVar15 * 4) = 0; uVar15 = uVar15 + 1; } while (uVar15 < (uint)((int)(self->_smeltedTrinkets)._end - (int)(self->_smeltedTrinkets)._begin >> 2)); } pvVar10 = (self->_history)._historyItems._begin; if (pvVar10 != (self->_history)._historyItems._end) { do { if (*(char *)((int)pvVar10 + 4) != '\0') { uVar15 = *(uint *)((int)pvVar10 + 8) & 0x7fff; smeltedCounts = (self->_smeltedTrinkets)._begin; if ((*(uint *)((int)pvVar10 + 8) >> 0xf & 1) == 0) { psVar16 = (short *)((int)smeltedCounts + uVar15 * 4); *psVar16 = *psVar16 + 1; } else { psVar16 = (short *)((int)smeltedCounts + uVar15 * 4 + 2); *psVar16 = *psVar16 + 1; } } pvVar10 = (void *)((int)pvVar10 + 0x1c); } while (pvVar10 != (self->_history)._historyItems._end); pGVar9 = local_58; } self->_jarHearts = (int)pGVar9[6]; self->_jarFlies = (int)pGVar9[7]; self->_numCoins = (int)pGVar9[8]; self->_numKeys = (int)pGVar9[9]; self->_numBombs = (int)pGVar9[10]; self->_hasGoldenKey = *(byte *)(pGVar9 + 0xb); self->_hasGoldenBomb = pGVar9[0xb].field_0x1; self->_monkeyPawCounter = (uint)*(ushort *)&pGVar9[0xb].field_0x2; self->_totalDamageTaken = (uint)*(ushort *)(pGVar9 + 0xc); self->_holyMantleState = -(pGVar9[0xc].field_0x2 != '\0') & 2; self->_tonsilCounter = *(short *)(pGVar9 + 0xd); self->_tonsilCount = *(short *)&pGVar9[0xd].field_0x2; self->_numLeprosy = *(short *)(pGVar9 + 0xe); self->_speedModifier = (int)pGVar9[0x12]; self->_fireDelayModifier = (int)pGVar9[0x13]; self->_damageModifier = (int)pGVar9[0x14]; self->_tearRangeModifier = (int)pGVar9[0x15]; self->_shotSpeedModifier = (int)pGVar9[0x16]; self->_luckModifier = (int)pGVar9[0x17]; self->_donateLuck = (int)pGVar9[0x18]; self->_potatoPeelerCounter = (int)pGVar9[0x19]; self->_potatoPeelerBandageCounter = (int)pGVar9[0x1a]; self->_brittleBonesUpgrades = *(short *)(pGVar9 + 0xee); self->_redStewBonusDuration = (int)pGVar9[0x10f]; self->_brokenHearts = (int)pGVar9[0x110]; self->_rottenHearts = (int)pGVar9[0x111]; self->_effectiveSoulCharge = (int)pGVar9[0x112]; *(GameStatePlayer *)&self->field_0x1dcc = pGVar9[0x113]; self->_urnSouls = (int)pGVar9[0x114]; self->_numGigaBombs = (int)pGVar9[0x115]; *(undefined8 *)&self->field_0x1db0 = *(undefined8 *)(pGVar9 + 0x116); *(GameStatePlayer *)&self->field_0x1db8 = pGVar9[0x118]; *(undefined8 *)&self->field_0x1dbc = *(undefined8 *)(pGVar9 + 0x119); *(GameStatePlayer *)&self->field_0x1dc4 = pGVar9[0x11b]; *(GameStatePlayer *)&self->field_0x1dc8 = pGVar9[0x11c]; self->_rockBottomDamage = (float)pGVar9[0x11f]; self->_rockBottomMaxFireDelay = (float)pGVar9[0x11e]; self->_rockBottomLuck = (float)pGVar9[0x122]; self->_rockBottomTearRange = (float)pGVar9[0x120]; self->_rockBottomMoveSpeed = (float)pGVar9[0x11d]; self->_rockBottomShotSpeed = (float)pGVar9[0x121]; self->_reverseEmpressMaxHearts = (int)pGVar9[0x123]; self->_reverseSunBoneHearts = (int)pGVar9[0x124]; *(GameStatePlayer *)&self->field_0x1ed8 = pGVar9[0x125]; *(GameStatePlayer *)&self->field_0x1ec8 = pGVar9[0x126]; self->_forgottenBodyRoomIdx = (int)pGVar9[0x127]; (self->_forgottenBodyPos).x = (float)pGVar9[0x128]; (self->_forgottenBodyPos).y = (float)pGVar9[0x129]; *(GameStatePlayer *)&self->field_0x1f14 = pGVar9[0x12a]; self->_maggyHealthDrainCooldown = (int)pGVar9[299]; if (&self->_echoChamberItems != (std_deque *)(pGVar9 + 300)) { local_40 = (GameStatePlayer)((uint)local_40 & 0xffffff00); std::deque::operator_assign(pGVar9 + 300,local_40); } uVar15 = 8; if ((uint)((int)pGVar9[0x132] - (int)pGVar9[0x131]) < 8) { uVar15 = (int)pGVar9[0x132] - (int)pGVar9[0x131]; } uVar12 = 0; if (uVar15 != 0) { do { self->_bagOfCraftingContent[uVar12] = *(byte *)(uVar12 + (int)pGVar9[0x131]); uVar12 = uVar12 + 1; } while (uVar12 < uVar15); } GVar11 = pGVar9[0x134]; *(GameStatePlayer *)&self->field_0x1f50 = pGVar9[0x135]; self->_bagOfCraftingOutput = GVar11; uVar15 = 6; if ((uint)((int)pGVar9[0x138] - (int)pGVar9[0x137]) < 6) { uVar15 = (int)pGVar9[0x138] - (int)pGVar9[0x137]; } uVar12 = 0; if (uVar15 != 0) { do { self->_poopSpellQueue[uVar12] = *(byte *)(uVar12 + (int)pGVar9[0x137]); uVar12 = uVar12 + 1; } while (uVar12 < uVar15); } uVar15 = 0x14; if ((uint)((int)pGVar9[0x13b] - (int)pGVar9[0x13a]) < 0x14) { uVar15 = (int)pGVar9[0x13b] - (int)pGVar9[0x13a]; } uVar12 = 0; if (uVar15 != 0) { do { self->_poopSpellQueue[uVar12 + 6] = *(byte *)(uVar12 + (int)pGVar9[0x13a]); uVar12 = uVar12 + 1; } while (uVar12 < uVar15); } self->field_0x1f72 = *(undefined1 *)(pGVar9 + 0x13d); self->_poopMana = (int)pGVar9[0x136]; *(GameStatePlayer *)&self->field_0x1f74 = pGVar9[0x13e]; self->_effectiveBloodCharge = (int)pGVar9[0x13f]; if (&self->_itemCards != (std_vector *)(pGVar9 + 0x140)) { local_5c = pGVar9[0x140]; local_48 = (GameStatePlayer)((int)pGVar9[0x141] - (int)local_5c); local_40 = (GameStatePlayer)((int)local_48 >> 2); local_4c = (self->_itemCards)._begin; if ((uint)((int)(self->_itemCards)._capacity - (int)local_4c >> 2) < (uint)local_40) { std::vector::reserve_clear(local_40); local_4c = (self->_itemCards)._begin; } memmove(local_4c,(void *)local_5c,(size_t)local_48); (self->_itemCards)._end = (void *)((int)(int *)local_48 + (int)local_4c); } self->_modelingClayEffect = (int)pGVar9[0x143]; self->_keepersSackBonus = (int)pGVar9[0x144]; self->_isLevelStartPending = *(byte *)(pGVar9 + 0x14d); self->_hasCurseMistEffect = pGVar9[0x14d].field_0x1; GVar11 = pGVar9[0x14f]; GVar4 = pGVar9[0x150]; GVar5 = pGVar9[0x151]; (self->_consumablesBackup).coins = (int)pGVar9[0x14e]; (self->_consumablesBackup).keys = (int)GVar11; (self->_consumablesBackup).bombs = (int)GVar4; *(GameStatePlayer *)&(self->_consumablesBackup).goldkey = GVar5; GVar11 = pGVar9[0x153]; GVar4 = pGVar9[0x154]; GVar5 = pGVar9[0x155]; (self->_consumablesBackup).soulcharges = (int)pGVar9[0x152]; (self->_consumablesBackup).gigabombs = (int)GVar11; (self->_consumablesBackup).poopmana = (int)GVar4; (self->_consumablesBackup).bloodcharges = (int)GVar5; if (&self->_curseMistFamiliars != (std_vector *)(pGVar9 + 0x156)) { std::vector<52byte>::assign(pGVar9[0x156],pGVar9[0x157],local_5c); } self->_curseMistRedHearts = (int)pGVar9[0x159]; GVar11 = pGVar9[0x15b]; self->_curseMistPocketSlots[0] = (int)pGVar9[0x15a]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 1) = GVar11; GVar11 = pGVar9[0x15d]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 2) = pGVar9[0x15c]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 3) = GVar11; GVar11 = pGVar9[0x15f]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 4) = pGVar9[0x15e]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 5) = GVar11; GVar11 = pGVar9[0x161]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 6) = pGVar9[0x160]; *(GameStatePlayer *)(self->_curseMistPocketSlots + 7) = GVar11; self->_curseMistTrinkets[0] = (int)pGVar9[0x162]; *(GameStatePlayer *)(self->_curseMistTrinkets + 1) = pGVar9[0x163]; self->_isCoopGhost = *(byte *)(pGVar9 + 0x164); GVar11 = pGVar9[0x166]; self->_ghostPocketSlots[0] = (int)pGVar9[0x165]; *(GameStatePlayer *)(self->_ghostPocketSlots + 1) = GVar11; GVar11 = pGVar9[0x168]; *(GameStatePlayer *)(self->_ghostPocketSlots + 2) = pGVar9[0x167]; *(GameStatePlayer *)(self->_ghostPocketSlots + 3) = GVar11; GVar11 = pGVar9[0x16a]; *(GameStatePlayer *)(self->_ghostPocketSlots + 4) = pGVar9[0x169]; *(GameStatePlayer *)(self->_ghostPocketSlots + 5) = GVar11; GVar11 = pGVar9[0x16c]; *(GameStatePlayer *)(self->_ghostPocketSlots + 6) = pGVar9[0x16b]; *(GameStatePlayer *)(self->_ghostPocketSlots + 7) = GVar11; self->_ghostTrinkets[0] = (int)pGVar9[0x16d]; *(GameStatePlayer *)(self->_ghostTrinkets + 1) = pGVar9[0x16e]; self->_wildCardItemType = *(byte *)(pGVar9 + 0x16f); self->_wildCardItem = (int)pGVar9[0x170]; self->_wildCardVarData = (int)pGVar9[0x171]; self->_samsonBerserkCharge = (int)pGVar9[0x172]; self->_ibsCharge = (float)pGVar9[0x173]; std_map_copy_assign(&(self->_proceduralItems)._itemIds,pGVar9 + 0x175); GlitchedItemSet::recalculate(&self->_proceduralItems); manager = g_manager; selfSaved->_edenSpeed = (float)pGVar9[0x1b]; selfSaved->_edenFireDelay = (float)pGVar9[0x1c]; selfSaved->_edenDamage = (float)pGVar9[0x1d]; selfSaved->_edenTearRange = (float)pGVar9[0x1e]; selfSaved->_edenShotSpeed = (float)pGVar9[0x1f]; selfSaved->_edenLuck = (float)pGVar9[0x20]; selfSaved->_vampireCharmKills = (int)pGVar9[0x21]; *(GameStatePlayer *)&selfSaved->field_0x160c = pGVar9[0x22]; pvVar10 = (manager->_itemConfig)._collectibles._end; if ((int)pGVar9[0x23] < (int)pvVar10 - (int)(manager->_itemConfig)._collectibles._begin >> 2) { selfSaved->_activeDesc[0]._item = (int)pGVar9[0x23]; selfSaved->_activeDesc[0]._unk = (int)pGVar9[0x24]; selfSaved->_activeDesc[0]._charge = (int)pGVar9[0x25]; selfSaved->_activeDesc[0]._batteryCharge = (int)pGVar9[0x26]; selfSaved->_activeDesc[0]._partialCharge = (int)pGVar9[0x27]; selfSaved->_activeDesc[0]._varData = (int)pGVar9[0x28]; pvVar10 = (manager->_itemConfig)._collectibles._end; } if ((int)pGVar9[0x29] < (int)pvVar10 - (int)(manager->_itemConfig)._collectibles._begin >> 2) { *(GameStatePlayer *)(selfSaved->_activeDesc + 1) = pGVar9[0x29]; selfSaved->_activeDesc[1]._unk = (int)pGVar9[0x2a]; selfSaved->_activeDesc[1]._charge = (int)pGVar9[0x2b]; selfSaved->_activeDesc[1]._batteryCharge = (int)pGVar9[0x2c]; selfSaved->_activeDesc[1]._partialCharge = (int)pGVar9[0x2d]; selfSaved->_activeDesc[1]._varData = (int)pGVar9[0x2e]; pvVar10 = (manager->_itemConfig)._collectibles._end; } if ((int)pGVar9[0x2f] < (int)pvVar10 - (int)(manager->_itemConfig)._collectibles._begin >> 2) { *(GameStatePlayer *)(selfSaved->_activeDesc + 2) = pGVar9[0x2f]; selfSaved->_activeDesc[2]._unk = (int)pGVar9[0x30]; selfSaved->_activeDesc[2]._charge = (int)pGVar9[0x31]; selfSaved->_activeDesc[2]._batteryCharge = (int)pGVar9[0x32]; selfSaved->_activeDesc[2]._partialCharge = (int)pGVar9[0x33]; selfSaved->_activeDesc[2]._varData = (int)pGVar9[0x34]; pvVar10 = (manager->_itemConfig)._collectibles._end; } if ((int)pGVar9[0x35] < (int)pvVar10 - (int)(manager->_itemConfig)._collectibles._begin >> 2) { *(GameStatePlayer *)(selfSaved->_activeDesc + 3) = pGVar9[0x35]; selfSaved->_activeDesc[3]._unk = (int)pGVar9[0x36]; selfSaved->_activeDesc[3]._charge = (int)pGVar9[0x37]; selfSaved->_activeDesc[3]._batteryCharge = (int)pGVar9[0x38]; selfSaved->_activeDesc[3]._partialCharge = (int)pGVar9[0x39]; selfSaved->_activeDesc[3]._varData = (int)pGVar9[0x3a]; } iVar13 = selfSaved->_variant; *(GameStatePlayer *)&selfSaved->field_0x1738 = pGVar9[0x11]; (selfSaved->_playerSpriteScale).x = (float)pGVar9[0x3b]; (selfSaved->_playerSpriteScale).y = (float)pGVar9[0x3c]; if ((iVar13 == 0) && (selfSaved->_isCoopGhost == 0)) { (selfSaved->_headScale).x = (float)pGVar9[0x3d]; (selfSaved->_headScale).y = (float)pGVar9[0x3e]; (selfSaved->_bodyScale).x = (float)pGVar9[0x3f]; (selfSaved->_bodyScale).y = (float)pGVar9[0x40]; } local_40 = (GameStatePlayer)selfSaved->_pocketSlots; GVar11 = pGVar9[0x42]; *(GameStatePlayer *)local_40 = pGVar9[0x41]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 1) = GVar11; GVar11 = pGVar9[0x44]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 2) = pGVar9[0x43]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 3) = GVar11; GVar11 = pGVar9[0x46]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 4) = pGVar9[0x45]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 5) = GVar11; GVar11 = pGVar9[0x48]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 6) = pGVar9[0x47]; *(GameStatePlayer *)(selfSaved->_pocketSlots + 7) = GVar11; local_48 = (GameStatePlayer)0x0; do { if (((*(int *)((int)local_40 + 4) == 1) && (*(int *)local_40 != 0)) && ((int)(g_manager->_itemConfig)._cards._end - (int)(g_manager->_itemConfig)._cards._begin >> 2 <= *(int *)local_40)) { if ((uint)local_48 < 3) { piVar14 = (int *)((int)local_40 + 8); GVar11 = local_40; for (uVar15 = (3 - (int)local_48) * 2 & 0x3ffffffe; uVar15 != 0; uVar15 = uVar15 - 1) { *(int *)GVar11 = *piVar14; piVar14 = piVar14 + 1; GVar11 = (GameStatePlayer)((int)GVar11 + 4); } } selfSaved->_pocketSlots[6] = 0; } local_48 = (GameStatePlayer)((int)local_48 + 1); local_40 = (GameStatePlayer)((int)local_40 + 8); } while ((uint)local_48 < 4); selfSaved->_rUaWizardTimer = (int)local_58[0x82]; selfSaved->_bloodLustCounter = *(short *)(local_58 + 0x83); selfSaved->_deadCatLives = *(short *)&local_58[0x83].field_0x2; GVar11 = local_58[0x85]; GVar4 = local_58[0x86]; GVar5 = local_58[0x87]; (selfSaved->_friendBallEnemy)._type = (int)local_58[0x84]; (selfSaved->_friendBallEnemy)._variant = (int)GVar11; (selfSaved->_friendBallEnemy)._subtype = (int)GVar4; (selfSaved->_friendBallEnemy)._championId = (int)GVar5; friendBallHealth = *(undefined8 *)(local_58 + 0x88); (selfSaved->_friendBallEnemy)._health = (float)(int)friendBallHealth; (selfSaved->_friendBallEnemy)._maxHealth = (float)(int)((ulonglong)friendBallHealth >> 0x20); *(GameStatePlayer *)&(selfSaved->_friendBallEnemy)._playerControlled = local_58[0x8a]; selfSaved->_purityState = (int)local_58[0xd2]; selfSaved->_immaculateConceptionState = (int)local_58[0xd3]; selfSaved->_cambionConceptionState = (int)local_58[0xd4]; selfSaved->_conceptionFamiliarFlags = (int)local_58[0xd5]; selfSaved->_d8DamageModifier = (float)local_58[0xd6]; selfSaved->_d8SpeedModifier = (float)local_58[0xd7]; selfSaved->_d8RangeModifier = (float)local_58[0xd8]; selfSaved->_d8FireDelayModifier = (float)local_58[0xd9]; selfSaved->_goldenHearts = (int)local_58[0xda]; selfSaved->_planCKillCountdown = (int)local_58[0xf]; selfSaved->_imExcitedSpeedupCountdown = (int)local_58[0x10]; selfSaved->_holyMantleStacks = *(byte *)(local_58 + 0x174); selfSaved->_ductTapeMode = (uint)(byte)local_58[0x174].field_0x1; selfSaved->_dead = 0; try_trigger_astral_projection(selfSaved); if (local_54 != (GameStatePlayer)0x0) { uVar15 = (int)local_44 - (int)local_54 & 0xfffffffc; GVar11 = local_54; if (0xfff < uVar15) { GVar11 = *(GameStatePlayer *)((int)local_54 + -4); uVar15 = uVar15 + 0x23; if (0x1f < (uint)((int)local_54 + (-4 - (int)GVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)GVar11,uVar15); } ExceptionList = local_1c; return; } //@@ 007afc20 Entity_Player::try_trigger_astral_projection /* WARNING: Type propagation algorithm not settling */ /* DB: ? zero-hearts check, collectible effect 677, AddNullEffect prototype: db/protos.zhl */ byte __thiscall Entity_Player::try_trigger_astral_projection(Entity_Player *this) { ANM2 other; ANM2 *pAVar1; byte isNoHearts; void *astralEffect; int iVar3; uint seed; EntityPtr astralBody; LayerState *ghostLayer; Entity *linkEffect; Entity_Player *tempEffects; ANM2 aAStackY_8c70 [128]; undefined1 in_stack_fffffea4 [240]; float fVar4; float fVar5; float fVar6; Vector *position; Vector *pVVar7; Entity_Player *pEVar8; undefined4 uVar9; EntityRef emptyRef; EntityPtr *astralBodyRef; bool isNoHearts; TemporaryEffects *tempEffects; if (((this->_redHearts < 1) && (this->_soulHearts < 1)) && (this->_boneHearts < 1)) { isNoHearts = true; } else { isNoHearts = false; } if (((1 < *(int *)&g_game->_deathmatchManager) && (isNoHearts)) && (0 < this->_blackHearts)) { isNoHearts = false; } if (((this->_dead != 0) || (!isNoHearts)) || (this->_isCoopGhost != 0)) { return 0; } tempEffects = &this->_temporaryeffects; if (((this->_temporaryeffects)._disabled == 0) && (astralEffect = TemporaryEffects::GetCollectibleEffect(tempEffects,0x2a5), astralEffect != (void *)0x0)) { iVar3 = *(int *)((int)astralEffect + 4); if (iVar3 == 1) { return 0; } } else { iVar3 = 0; } isNoHearts = TemporaryEffects::HasCollectibleEffect(tempEffects,0x2c0); if (isNoHearts != 0) { return 0; } if (iVar3 != 2) { isNoHearts = HasCollectible(this,0x2a2,0); if (((isNoHearts != 0) && (iVar3 = TemporaryEffects::GetNullEffectNum(tempEffects,0x66), iVar3 == 0)) && (iVar3 = TemporaryEffects::GetNullEffectNum(tempEffects,0x65), iVar3 == 0)) { TemporaryEffects::AddNullEffect(tempEffects,0x65,1,1); TemporaryEffects::AddNullEffect(tempEffects,0x66,1,1); this->_soulHearts = 0; this->_blackHearts = 0; this->_eternalHearts = 0; this->_boneHeartsMask = 0; this->_boneHearts = 0; this->_rottenHearts = 0; if (this->_maxHearts < 1) { iVar3 = GetHealthType(this); if (iVar3 == 4) { this->_redHearts = 0; AddBoneHearts(tempEffects,1); } else { iVar3 = GetHealthType(tempEffects); if (iVar3 == 3) { this->_redHearts = 2; this->_maxHearts = 2; } else if (this->_playerType == 0x12) { this->_maxHearts = 2; this->_redHearts = 1; } else { this->_redHearts = 0; this->_soulHearts = 1; } } } else { this->_redHearts = 1; iVar3 = GetHealthType(this); if (iVar3 == 3) { this->_redHearts = 2; } } astralBodyRef = &this->_astralProjectionBody; this->_damageCooldown = 0x1e; if (this->_astralProjectionBody == (EntityPtr)0x0) { seed = Random(); iVar3 = 0; uVar9._0_1_ = 0; uVar9._1_1_ = 0; uVar9._2_2_ = 0; pVVar7 = &g_vectorZero; position = &this->_pos; fVar6 = 8.40779e-45; fVar5 = 1.4013e-42; fVar4 = 1.1295154e-38; pEVar8 = this; astralBody = (EntityPtr) Game::SpawnEx(g_game,1000,6,position,&g_vectorZero,(Entity *)this,0,seed,0); ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x15c),&this->_sprite); other._championColor._colorize[3] = fVar4; other._filename._buf[0] = in_stack_fffffea4[0]; other._filename._buf[1] = in_stack_fffffea4[1]; other._filename._buf[2] = in_stack_fffffea4[2]; other._filename._buf[3] = in_stack_fffffea4[3]; other._filename._buf[4] = in_stack_fffffea4[4]; other._filename._buf[5] = in_stack_fffffea4[5]; other._filename._buf[6] = in_stack_fffffea4[6]; other._filename._buf[7] = in_stack_fffffea4[7]; other._filename._buf[8] = in_stack_fffffea4[8]; other._filename._buf[9] = in_stack_fffffea4[9]; other._filename._buf[10] = in_stack_fffffea4[10]; other._filename._buf[0xb] = in_stack_fffffea4[0xb]; other._filename._buf[0xc] = in_stack_fffffea4[0xc]; other._filename._buf[0xd] = in_stack_fffffea4[0xd]; other._filename._buf[0xe] = in_stack_fffffea4[0xe]; other._filename._buf[0xf] = in_stack_fffffea4[0xf]; other._filename._size = in_stack_fffffea4._16_4_; other._filename._capacity = in_stack_fffffea4._20_4_; other._animDefaultName._buf[0] = in_stack_fffffea4[0x18]; other._animDefaultName._buf[1] = in_stack_fffffea4[0x19]; other._animDefaultName._buf[2] = in_stack_fffffea4[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffea4[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffea4[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffea4[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffea4[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffea4[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffea4[0x20]; other._animDefaultName._buf[9] = in_stack_fffffea4[0x21]; other._animDefaultName._buf[10] = in_stack_fffffea4[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffea4[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffea4[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffea4[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffea4[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffea4[0x27]; other._animDefaultName._size = in_stack_fffffea4._40_4_; other._animDefaultName._capacity = in_stack_fffffea4._44_4_; other._animState._animation = (void *)in_stack_fffffea4._48_4_; other._animState._animData = (void *)in_stack_fffffea4._52_4_; other._animState._layerFrames = (void *)in_stack_fffffea4._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffea4._60_4_; other._animState._animFrame = (float)in_stack_fffffea4._64_4_; other._animState._isPlaying = in_stack_fffffea4[0x44]; other._animState._21_3_ = in_stack_fffffea4._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffea4._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffea4._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffea4._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffea4._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffea4._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffea4._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffea4._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffea4[100]; other._overlayAnimState._21_3_ = in_stack_fffffea4._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffea4._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffea4._108_4_; other._overlayRenderFirst = in_stack_fffffea4[0x70]; other._113_3_ = in_stack_fffffea4._113_3_; other._animData = (void *)in_stack_fffffea4._116_4_; other._animCount = in_stack_fffffea4._120_4_; other._layerState = (void *)in_stack_fffffea4._124_4_; other._layerCount = in_stack_fffffea4._128_4_; other._nullLayerNames = (void *)in_stack_fffffea4._132_4_; other._numNullLayers = in_stack_fffffea4._136_4_; other._eventNames = (void *)in_stack_fffffea4._140_4_; other._numEvents = in_stack_fffffea4._144_4_; other._offset.x = (float)in_stack_fffffea4._148_4_; other._offset.y = (float)in_stack_fffffea4._152_4_; other._scale.x = (float)in_stack_fffffea4._156_4_; other._scale.y = (float)in_stack_fffffea4._160_4_; other._rotation = (float)in_stack_fffffea4._164_4_; other._color._tint[0] = (float)in_stack_fffffea4._168_4_; other._color._tint[1] = (float)in_stack_fffffea4._172_4_; other._color._tint[2] = (float)in_stack_fffffea4._176_4_; other._color._tint[3] = (float)in_stack_fffffea4._180_4_; other._color._colorize[0] = (float)in_stack_fffffea4._184_4_; other._color._colorize[1] = (float)in_stack_fffffea4._188_4_; other._color._colorize[2] = (float)in_stack_fffffea4._192_4_; other._color._colorize[3] = (float)in_stack_fffffea4._196_4_; other._color._offset[0] = (float)in_stack_fffffea4._200_4_; other._color._offset[1] = (float)in_stack_fffffea4._204_4_; other._color._offset[2] = (float)in_stack_fffffea4._208_4_; other._championColor._tint[0] = (float)in_stack_fffffea4._212_4_; other._championColor._tint[1] = (float)in_stack_fffffea4._216_4_; other._championColor._tint[2] = (float)in_stack_fffffea4._220_4_; other._championColor._tint[3] = (float)in_stack_fffffea4._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffea4._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffea4._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffea4._236_4_; other._championColor._offset[0] = fVar5; other._championColor._offset[1] = fVar6; other._championColor._offset[2] = (float)position; other._256_4_ = pVVar7; other._playbackSpeed = (float)pEVar8; other._264_1_ = (char)uVar9; other._loaded = SUB41(uVar9,1); other._266_2_ = SUB42(uVar9,2); other._shadowLayerIndex = seed; other._bitflags = iVar3; ANM2::operator_assign((ANM2 *)((int)astralBody + 0x48),other); ghostLayer = ANM2::GetLayer((ANM2 *)((int)astralBody + 0x48),(byte *)"ghost"); if (ghostLayer != (LayerState *)0x0) { ghostLayer->_visible = 0; } AnimationState::SetAnimationData((AnimationState *)((int)astralBody + 0x98),(void *)0x0); ANM2::Play((ANM2 *)((int)astralBody + 0x48),(byte *)"Death",0); *(uint *)((int)astralBody + 0x168) = *(uint *)((int)astralBody + 0x168) | 0x200000; *(undefined4 *)((int)astralBody + 0x16c) = *(undefined4 *)((int)astralBody + 0x16c); *(undefined4 *)((int)astralBody + 0x450) = 10; (**(code **)(*(int *)astralBody + 0xc))(); if (*astralBodyRef != (EntityPtr)0x0) { std::multiset::erase(); } *astralBodyRef = astralBody; std::multiset::insert(); if (*astralBodyRef == (EntityPtr)0x0) { return 0; } } seed = Random(); linkEffect = Game::SpawnEx(g_game,1000,0x72,&this->_pos,&g_vectorZero,(Entity *)0x0,0,seed,0); astralBody = *astralBodyRef; if (linkEffect->_child != (EntityPtr)0x0) { std::multiset::erase(); } linkEffect->_child = astralBody; if (astralBody != (EntityPtr)0x0) { std::multiset::insert(); } if (linkEffect->_target != (EntityPtr)0x0) { std::multiset::erase(); } linkEffect->_target = (EntityPtr)this; std::multiset::insert(); iVar3 = *(int *)linkEffect; pAVar1 = &linkEffect[1]._sprite; (pAVar1->_animDefaultName)._buf[0xc] = '\0'; (pAVar1->_animDefaultName)._buf[0xd] = '\0'; (pAVar1->_animDefaultName)._buf[0xe] = -0x60; (pAVar1->_animDefaultName)._buf[0xf] = 'B'; (linkEffect->_targetPosition).x = 10.0; (linkEffect->_targetPosition).y = 0.0; (**(code **)(iVar3 + 0xc))(); return 0; } if (((this->_lastDamageSource)._type == 6) || ((this->_lastDamageFlags & 0x400) != 0)) { Player_stats_add(&g_game->_onlinePlayerStats,4,this,1.0); } emptyRef._type = 0; emptyRef._variant = 0; emptyRef._spawnerType = 0; emptyRef._spawnerVariant = 0; emptyRef._position.x = g_vectorZero.x; emptyRef._position.y = g_vectorZero.y; emptyRef._velocity.x = g_vectorZero.x; emptyRef._velocity.y = g_vectorZero.y; emptyRef._flags = 0; emptyRef._entity = (void *)0x0; EntityRef::operator_(&this->_lastDamageSource,&emptyRef); } EntityRef::EntityRef(&emptyRef); (**(code **)(*(int *)this + 0x24))(); return 1; } //@@ 007b0070 Entity_Player::spawn_dark_esau /* DB: Dark Esau 866.0 at a free spot >= 80 px off (20 tries), stored at +0x1fc0 (characters_9.md) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::spawn_dark_esau(Entity_Player *this,void *gameStatePlayer) { void **ppvVar1; char cVar2; byte bVar3; uint uVar4; Menu_Stats *spawnedFamiliar; Entity *spawnedEntity; Entity_NPC *restoredEnemy; uint uVar5; Vector *candidatePos; EntityPtr familiarRecord; int *effectIt; int iVar7; Manager *manager; void *itemListBegin; float fVar8; float fVar9; undefined4 uVar10; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; float *local_6c; Vector local_64; float local_5c; EntityPtr local_58; EntityPtr local_54; Vector local_50; float fStack_48; undefined4 uStack_44; Vector spawnPos; EntityRef charmSource; float *effectsEnd; EntityPtr familiarRecord; void *itemListEnd; Room *room; std_vector *tempEffects; float velocityX; float velocityY; iVar7 = *(int *)((int)gameStatePlayer + 0x37c); if (iVar7 != (*(int *)((int)gameStatePlayer + 900) - *(int *)((int)gameStatePlayer + 0x380)) / 0x34) { KAGE_LogMessage(0x10,(byte *)"m_FamiliarCount does not match m_Familiars.size()"); iVar7 = *(int *)((int)gameStatePlayer + 0x37c); } local_64.x = 0.0; if (iVar7 != 0) { local_6c = (float *)0x0; do { local_54 = (EntityPtr)(*(int *)((int)gameStatePlayer + 0x380) + (int)local_6c); familiarRecord = *(EntityPtr *)local_54; local_58 = *(EntityPtr *)((int)local_54 + 8); room = g_game->_room; uVar4 = Random(); local_5c = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_5c = local_5c + local_5c; fVar8 = cos(local_5c); local_50.x = fVar8 * 20.0 + (this->_pos).x; fVar8 = sin(local_5c); local_50.y = fVar8 * 20.0 + (this->_pos).y; Room::GetClampedPositionImpl(room,&spawnPos,&local_50,20.0,20.0,20.0,20.0); familiarRecord = local_54; spawnedFamiliar = (Menu_Stats *) Game::SpawnEx(g_game,3,(uint)*(EntityPtr *)((int)local_54 + 4),&spawnPos,&g_vectorZero, (Entity *)this,(uint)local_58,(uint)familiarRecord,0); Menu_Stats::Render(spawnedFamiliar,familiarRecord); local_64.x = (float)((int)local_64.x + 1); local_6c = (float *)((int)local_6c + 0x34); } while ((uint)local_64.x < (uint)*(float *)((int)gameStatePlayer + 0x37c)); } if (this->_replacedPlayer == (void *)0x0) { if (this->_playerType == 0x11) { spawn_forgotten_body(this); } local_5c = 0.0; if (0 < *(int *)((int)gameStatePlayer + 0x22c)) { local_6c = (float *)((int)gameStatePlayer + 0x244); do { room = g_game->_room; local_58 = (EntityPtr)((room->_bottomRightPos).x - (room->_topLeftPos).x); local_54 = (EntityPtr)((room->_bottomRightPos).y - (room->_topLeftPos).y); uVar4 = Random(); familiarRecord = local_54; if ((float)local_54 <= (float)local_58) { familiarRecord = local_58; } local_50.y = (float)local_54 * 0.5 + (room->_topLeftPos).y; local_50.x = (float)local_58 * 0.5 + (room->_topLeftPos).x; Room::FindFreePickupSpawnPosition (room,&spawnPos,&local_50, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * (float)familiarRecord,0,0,0); uVar4 = Random(); uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; spawnedEntity = Game::Spawn(g_game,(uint)local_6c[-5],(uint)local_6c[-4],&spawnPos,&g_vectorZero, (Entity *)0x0,(uint)local_6c[-3],uVar4); restoredEnemy = (Entity_NPC *)__RTDynamicCast(spawnedEntity,uVar10,pTVar11,pTVar12,uVar13); if (restoredEnemy != (Entity_NPC *)0x0) { restoredEnemy->_health = local_6c[-1]; restoredEnemy->_maxHitPoints = *local_6c; Entity_NPC::Morph(restoredEnemy,(int)local_6c[-5],(int)local_6c[-4],(int)local_6c[-3], (int)local_6c[-2]); if (*(char *)(local_6c + 1) != '\0') { restoredEnemy->_controllerID = this->_controllerIndex; } local_64.x = (float)g_game->_room; cVar2 = (**(code **)(*(int *)restoredEnemy + 0x48))(); if ((cVar2 != '\0') && (restoredEnemy->_type != 0x362)) { *(int *)((int)local_64.x + 0x12c0) = *(int *)((int)local_64.x + 0x12c0) + -1; cVar2 = (**(code **)(*(int *)restoredEnemy + 0x4c))(); if (cVar2 != '\0') { *(int *)((int)local_64.x + 0x12c8) = *(int *)((int)local_64.x + 0x12c8) + -1; } } restoredEnemy->_canShutDoors = 0; charmSource._type = this->_type; charmSource._position.x = (this->_pos).x; charmSource._position.y = (this->_pos).y; charmSource._variant = this->_variant; charmSource._spawnerType = this->_spawnerType; charmSource._spawnerVariant = this->_spawnerVariant; charmSource._velocity.x = (this->_velocity).x; charmSource._velocity.y = (this->_velocity).y; local_64.x = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar5 = 0; } else { uVar5 = 4; } charmSource._flags = uVar5 | uVar4 | (uint)local_64.x; charmSource._entity = this; Entity::AddCharmed((Entity *)restoredEnemy,&charmSource,-1,0,0); (**(code **)(*(int *)restoredEnemy + 0xc))(); } local_5c = (float)((int)local_5c + 1); local_6c = local_6c + 7; } while ((int)local_5c < *(int *)((int)gameStatePlayer + 0x22c)); } if (&this->_levelEffectItems != (std_vector *)((int)gameStatePlayer + 0x424)) { local_54 = *(EntityPtr *)((int)gameStatePlayer + 0x424); local_64.x = (float)(*(int *)((int)gameStatePlayer + 0x428) - (int)local_54); local_5c = (float)((int)local_64.x >> 2); local_6c = (this->_levelEffectItems)._begin; if ((uint)((int)(this->_levelEffectItems)._capacity - (int)local_6c >> 2) < (uint)local_5c) { std::vector::reserve_clear(local_5c); local_6c = (this->_levelEffectItems)._begin; } memmove(local_6c,(void *)local_54,(size_t)local_64.x); (this->_levelEffectItems)._end = (void *)((int)local_64.x + (int)local_6c); } iVar7 = *(int *)((int)gameStatePlayer + 0x430); this->_bleedOutHealth = iVar7; if (0 < iVar7) { local_54 = (EntityPtr)this->_type; uVar4 = (uint)this->_flags; uVar5 = *(uint *)((int)&this->_flags + 4); fVar8 = (this->_pos).x; fVar9 = (this->_pos).y; velocityX = (this->_velocity).x; velocityY = (this->_velocity).y; local_58 = (EntityPtr)this->_variant; local_64.x = (float)this->_spawnerType; iVar7 = this->_spawnerVariant; *(uint *)&this->_flags = uVar4; *(uint *)((int)&this->_flags + 4) = uVar5 | 4; local_5c = (float)(uint)((uVar4 & 0x100) != 0); if ((uVar4 & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } if ((uVar5 & 0x400000) == 0) { uVar5 = 0; } else { uVar5 = 4; } (this->_entityRef2)._position.x = fVar8; (this->_entityRef2)._type = (int)local_54; (this->_entityRef2)._variant = (int)local_58; (this->_entityRef2)._spawnerType = (int)local_64.x; (this->_entityRef2)._spawnerVariant = iVar7; (this->_entityRef2)._position.y = fVar9; (this->_entityRef2)._velocity.x = velocityX; (this->_entityRef2)._velocity.y = velocityY; (this->_entityRef2)._flags = uVar5 | uVar4 | (uint)local_5c; (this->_entityRef2)._entity = this; } this->_greedsGulletHearts = *(short *)((int)gameStatePlayer + 0x434); tempEffects = &(this->_temporaryeffects)._effects; this->_greedsGulletOverflow = *(short *)((int)gameStatePlayer + 0x438); (this->_queuedItem)._item = *(void **)((int)gameStatePlayer + 0x408); (this->_queuedItem)._charge = *(int *)((int)gameStatePlayer + 0x40c); (this->_queuedItem)._flags = *(byte *)((int)gameStatePlayer + 0x410); if (tempEffects != (std_vector *)((int)gameStatePlayer + 0x414)) { local_54 = *(EntityPtr *)((int)gameStatePlayer + 0x414); local_64.x = (float)(*(int *)((int)gameStatePlayer + 0x418) - (int)local_54); local_5c = (float)((int)local_64.x >> 4); local_6c = tempEffects->_begin; if ((uint)((int)(this->_temporaryeffects)._effects._capacity - (int)local_6c >> 4) < (uint)local_5c) { vector16_clear_and_reserve(tempEffects,(uint)local_5c); local_6c = (this->_temporaryeffects)._effects._begin; } memmove(local_6c,(void *)local_54,(size_t)local_64.x); (this->_temporaryeffects)._effects._end = (void *)((int)local_64.x + (int)local_6c); } this->_strengthMaxHearts = *(int *)((int)gameStatePlayer + 0x420); if ((this->_temporaryeffects)._effects._begin == (this->_temporaryeffects)._effects._end) { iVar7 = *(int *)((int)gameStatePlayer + 0x518); local_64.x = 0.0; if (*(int *)((int)gameStatePlayer + 0x51c) - iVar7 >> 4 != 0) { local_6c = (float *)0x0; manager = g_manager; do { uVar4 = *(uint *)((int)local_6c + 4 + iVar7); iVar7 = *(int *)((int)local_6c + *(int *)((int)gameStatePlayer + 0x518)); if (iVar7 == 0) { if ((int)uVar4 < 0) goto LAB_007b07a0; itemListBegin = (manager->_itemConfig)._nullItems._begin; itemListEnd = (manager->_itemConfig)._nullItems._end; LAB_007b0792: if ((int)uVar4 < (int)itemListEnd - (int)itemListBegin >> 2) { local_50.x = *(float *)((int)itemListBegin + uVar4 * 4); } else { LAB_007b07a0: local_50.x = 0.0; } } else { if (iVar7 == 2) { itemListBegin = (manager->_itemConfig)._trinkets._begin; uVar4 = uVar4 & 0x7fff; itemListEnd = (manager->_itemConfig)._trinkets._end; goto LAB_007b0792; } if (g_game == (Game *)0x0) { if (-1 < (int)uVar4) goto LAB_007b0760; goto LAB_007b07a0; } if (-1 < (int)uVar4) { LAB_007b0760: itemListBegin = (manager->_itemConfig)._collectibles._begin; itemListEnd = (manager->_itemConfig)._collectibles._end; goto LAB_007b0792; } if ((-1 < (int)uVar4) || (itemListBegin = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)itemListBegin >> 2 <= (int)~uVar4)) goto LAB_007b07a0; local_50.x = **(float **)((int)itemListBegin + ~uVar4 * 4); } uStack_44 = 0; local_50.y = *(float *)((int)local_6c + 8 + *(int *)((int)gameStatePlayer + 0x518)); fStack_48 = *(float *)((int)local_6c + 0xc + *(int *)((int)gameStatePlayer + 0x518)); effectsEnd = (this->_temporaryeffects)._effects._end; if (effectsEnd == (this->_temporaryeffects)._effects._capacity) { std::vector::_Emplace_reallocate(effectsEnd,&local_50); manager = g_manager; } else { *effectsEnd = local_50.x; effectsEnd[1] = local_50.y; effectsEnd[2] = fStack_48; effectsEnd[3] = 0.0; ppvVar1 = &(this->_temporaryeffects)._effects._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } iVar7 = *(int *)((int)gameStatePlayer + 0x518); local_6c = (float *)((int)local_6c + 0x10); local_64.x = (float)((int)local_64.x + 1); } while ((uint)local_64.x < (uint)(*(int *)((int)gameStatePlayer + 0x51c) - iVar7 >> 4)); } } if (0.0 < *(float *)((int)gameStatePlayer + 0x530)) { if (this->_darkEsau != (EntityPtr)0x0) { (**(code **)(*(int *)this->_darkEsau + 0x28))(); } room = g_game->_room; local_58 = (EntityPtr)((room->_bottomRightPos).x - (room->_topLeftPos).x); local_54 = (EntityPtr)((room->_bottomRightPos).y - (room->_topLeftPos).y); uVar4 = Random(); familiarRecord = local_54; if ((float)local_54 <= (float)local_58) { familiarRecord = local_58; } local_50.y = (float)local_54 * 0.5 + (room->_topLeftPos).y; local_50.x = (float)local_58 * 0.5 + (room->_topLeftPos).x; Room::FindFreePickupSpawnPosition (room,&local_64,&local_50, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * (float)familiarRecord,1,0,0); local_5c = 0.0; do { fVar9 = (this->_pos).x - local_64.x; fVar8 = (this->_pos).y - local_64.y; if (6400.0 <= fVar8 * fVar8 + fVar9 * fVar9) break; room = g_game->_room; candidatePos = Room::GetRandomPosition(room,&spawnPos,20.0); candidatePos = Room::FindFreePickupSpawnPosition(room,&local_50,candidatePos,0.0,1,0,0); local_64.x = candidatePos->x; local_64.y = candidatePos->y; local_5c = (float)((int)local_5c + 1); } while ((int)local_5c < 0x14); uVar4 = Random(); familiarRecord = (EntityPtr) Game::SpawnEx(g_game,0x362,0,&local_64,&g_vectorZero,(Entity *)this,0,uVar4,0); if (this->_darkEsau != (EntityPtr)0x0) { local_54 = (EntityPtr)&this->_darkEsau; std::multiset::erase(&local_54); } this->_darkEsau = familiarRecord; if (familiarRecord != (EntityPtr)0x0) { std::multiset::insert(&this->_darkEsau); } *(uint *)((int)familiarRecord + 0x168) = *(uint *)((int)familiarRecord + 0x168) & 0xfffffffb; *(undefined4 *)((int)familiarRecord + 0x16c) = *(undefined4 *)((int)familiarRecord + 0x16c); (**(code **)(*(int *)familiarRecord + 0xc))(); } if (this->_isCoopGhost != 0) { reset_body_sprite(this); this->_isPlayingItemAnimation = 0; ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"GhostAppear",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 1; this->_isPlayingItemAnimation = 0; this->_entityGridCollisionClass = 3; this->_isCoopGhost = 1; this->_isInvicible = 1; this->_visible = 1; } if ((this->_temporaryeffects)._disabled == 0) { for (effectIt = (this->_temporaryeffects)._effects._begin; effectIt != (this->_temporaryeffects)._effects._end; effectIt = effectIt + 4) { if ((*(int *)*effectIt == 0) && (((int *)*effectIt)[1] == 0x78)) { if ((this->_parent != (EntityPtr)0x0) && ((int *)this->_subPlayer != (int *)0x0)) { (**(code **)(*(int *)this->_subPlayer + 0x44))(); if ((undefined4 *)this->_subPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_subPlayer)(1); } this->_subPlayer = 0; } break; } } } UpdateCanShoot(this); this->_cacheFlags = this->_cacheFlags | 0xffff; EvaluateItems(); Level::RemoveCompassEffect((Level *)g_game); this->_postLevelInitFinished = 1; } return; } //@@ 007b0b40 FUN_007b0b40 void FUN_007b0b40(undefined2 *param_1) { undefined2 uVar1; int in_ECX; if (*(int *)(in_ECX + 0x2c) == 1) { uVar1 = *(undefined2 *)(in_ECX + 0x1aec); } else { uVar1 = *(undefined2 *)(in_ECX + 0x13c0); } *param_1 = uVar1; param_1[1] = *(undefined2 *)(in_ECX + 0x1344); param_1[2] = *(undefined2 *)(in_ECX + 0x1340); param_1[3] = *(undefined2 *)(in_ECX + 0x134c); *(undefined4 *)(param_1 + 10) = *(undefined4 *)(in_ECX + 0x1350); if (*(int *)(in_ECX + 0x2c) == 1) { uVar1 = 0; } else { uVar1 = (undefined2)*(undefined4 *)(in_ECX + 0x1348); } param_1[4] = uVar1; param_1[5] = *(undefined2 *)(in_ECX + 0x194c); param_1[6] = 0; param_1[9] = *(undefined2 *)(in_ECX + 0x1da0); param_1[8] = *(undefined2 *)(in_ECX + 0x1da4); param_1[7] = *(undefined2 *)(in_ECX + 0x1d88); *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(in_ECX + 0x1d8c); return; } //@@ 007b0be0 Entity_Player::StoreGameState /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ZHL StoreGameState(GameStatePlayer*, bool saveTemporaryFamiliars): caller 00906100 does GameStatePlayer::Init(&s) then this(&s,1); copies 0x13c0 playerType etc into state prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::StoreGameState (Entity_Player *this,GameStatePlayer *saveState,byte saveTemporaryFamiliars) { EntityPtr EVar1; undefined4 uVar2; GameStatePlayer GVar3; char cVar4; Entity_Player *parentPlayer; GameStatePlayer *game; undefined4 *puVar6; GameStatePlayer GVar7; int iVar8; void *pvVar9; uint i; PlayerManager *playerManager; GameStatePlayer *pGVar10; GameStatePlayer GVar11; int iVar12; bool bVar13; undefined4 familiarBackup; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined4 local_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 local_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 local_78; undefined1 local_74; int roomEntities; undefined4 local_6c; GameStatePlayer local_68; void *local_64; GameStatePlayer *local_60; GameStatePlayer *local_5c; EntityPtr player; GameStatePlayer *local_54; void *local_50; GameStatePlayer *savedState; GameStatePlayer local_48; GameStatePlayer local_44; GameStatePlayer local_40; GameStatePlayer local_3c; GameStatePlayer local_38; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Entity_Familiar *familiar; Game *game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00affc4d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; savedState = saveState; saveState[0x149] = (GameStatePlayer)this->_controllerIndex; saveState[0xc].field_0x2 = this->_holyMantleState != 0; *saveState = (GameStatePlayer)this->_playerType; saveState[1] = (GameStatePlayer)this->_redHearts; saveState[2] = (GameStatePlayer)this->_maxHearts; saveState[3] = (GameStatePlayer)this->_soulHearts; saveState[4] = (GameStatePlayer)this->_blackHearts; saveState[0xdd] = (GameStatePlayer)this->_boneHearts; saveState[0xde] = (GameStatePlayer)this->_boneHeartsMask; saveState[5] = (GameStatePlayer)this->_eternalHearts; player = (EntityPtr)this; if (this->_subPlayer == 0) { *(undefined1 *)(saveState + 0xe6) = 0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } else { *(undefined1 *)(saveState + 0xe6) = 1; FUN_007b0b40(saveState + 0xe7); } GVar7 = (GameStatePlayer)0x0; local_50 = (void *)0x0; local_64 = (void *)0x0; local_38 = (GameStatePlayer)0x0; local_60 = (GameStatePlayer *)0x0; local_54 = (GameStatePlayer *)0x0; local_5c = (GameStatePlayer *)0x0; local_14 = 0; playerManager = &g_game->_playerManager; local_44 = (GameStatePlayer)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar9 = (playerManager->_playerList)._end; if ((int)pvVar9 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar9 = (playerManager->_playerList)._end; GVar7 = local_38; } pGVar10 = (playerManager->_playerList)._begin; if ((uint)local_44 < (uint)((int)pvVar9 - (int)pGVar10 >> 2)) { pGVar10 = pGVar10 + (int)local_44; } GVar11 = *pGVar10; if (*(int *)((int)GVar11 + 0x2c) == 1) { parentPlayer = *(void **)((int)GVar11 + 0x3bc); if ((parentPlayer == (Entity_Player *)0x0) || (parentPlayer->_type != 1)) { local_3c = (GameStatePlayer)g_game; puVar6 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)puVar6 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); puVar6 = (((PlayerManager *)((int)local_3c + 0x1baa8))->_playerList)._begin; } parentPlayer = (Entity_Player *)*puVar6; } GVar7 = local_38; if ((parentPlayer == this) && (*(void **)((int)GVar11 + 0x3bc) == (void *)0x0)) { local_3c = GVar11; if (local_38 == (GameStatePlayer)local_54) { std::vector::_Emplace_reallocate(local_38,&local_3c); local_54 = local_5c; } else { *(GameStatePlayer *)local_38 = GVar11; local_60 = (GameStatePlayer *)((int)local_38 + 4); } GVar7 = (GameStatePlayer)local_60; local_38 = (GameStatePlayer)local_60; } } playerManager = &g_game->_playerManager; local_44 = (GameStatePlayer)((int)local_44 + 1); } while ((uint)local_44 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); local_50 = local_64; saveState = savedState; } local_3c = (GameStatePlayer)(saveState + 0xe3); local_38 = (GameStatePlayer)((int)GVar7 - (int)local_50 >> 2); local_64 = local_50; vector28_resize(local_38); GVar7 = local_38; if (local_38 != (GameStatePlayer)0x0) { local_40 = (GameStatePlayer)0x0; GVar11 = (GameStatePlayer)0x0; do { FUN_007b0b40(*(int *)local_3c + (int)local_40); GVar11 = (GameStatePlayer)((int)GVar11 + 1); local_40 = (GameStatePlayer)((int)local_40 + 0x1c); } while ((uint)GVar11 < (uint)GVar7); saveState = savedState; this = (Entity_Player *)player; } if (saveState + 0xef != (GameStatePlayer *)((int)this + 0x1dec)) { std::vector::assign (*(GameStatePlayer *)((int)this + 0x1dec),*(undefined4 *)((int)this + 0x1df0),local_48 ); } GVar7 = *(GameStatePlayer *)((int)this + 0x1e04); GVar11 = *(GameStatePlayer *)((int)this + 0x1e08); GVar3 = *(GameStatePlayer *)((int)this + 0x1e0c); saveState[0xf2] = *(GameStatePlayer *)((int)this + 0x1e00); saveState[0xf3] = GVar7; saveState[0xf4] = GVar11; saveState[0xf5] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x1e14); GVar11 = *(GameStatePlayer *)((int)this + 0x1e18); GVar3 = *(GameStatePlayer *)((int)this + 0x1e1c); saveState[0xf6] = *(GameStatePlayer *)((int)this + 0x1e10); saveState[0xf7] = GVar7; saveState[0xf8] = GVar11; saveState[0xf9] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x1e24); GVar11 = *(GameStatePlayer *)((int)this + 0x1e28); GVar3 = *(GameStatePlayer *)((int)this + 0x1e2c); saveState[0xfa] = *(GameStatePlayer *)((int)this + 0x1e20); saveState[0xfb] = GVar7; saveState[0xfc] = GVar11; saveState[0xfd] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x1e34); GVar11 = *(GameStatePlayer *)((int)this + 0x1e38); GVar3 = *(GameStatePlayer *)((int)this + 0x1e3c); saveState[0xfe] = *(GameStatePlayer *)((int)this + 0x1e30); saveState[0xff] = GVar7; saveState[0x100] = GVar11; saveState[0x101] = GVar3; saveState[6] = *(GameStatePlayer *)((int)this + 0x1354); saveState[7] = *(GameStatePlayer *)((int)this + 0x1358); saveState[8] = *(GameStatePlayer *)((int)this + 0x1368); saveState[9] = *(GameStatePlayer *)((int)this + 0x135c); saveState[10] = *(GameStatePlayer *)((int)this + 0x1364); *(byte *)(saveState + 0xb) = *(byte *)((int)this + 0x1360); saveState[0xb].field_0x1 = *(byte *)((int)this + 0x1361); *(undefined2 *)&saveState[0xb].field_0x2 = *(undefined2 *)((int)this + 0x1394); *(undefined2 *)(saveState + 0xc) = *(undefined2 *)((int)this + 0x16b4); saveState[0x12] = *(GameStatePlayer *)((int)this + 0x1520); saveState[0x13] = *(GameStatePlayer *)((int)this + 0x1524); saveState[0x14] = *(GameStatePlayer *)((int)this + 0x1528); saveState[0x15] = *(GameStatePlayer *)((int)this + 0x152c); saveState[0x16] = *(GameStatePlayer *)((int)this + 0x1530); saveState[0x17] = *(GameStatePlayer *)((int)this + 0x1534); saveState[0x18] = *(GameStatePlayer *)((int)this + 0x1538); saveState[0x19] = *(GameStatePlayer *)((int)this + 0x153c); saveState[0x1a] = *(GameStatePlayer *)((int)this + 0x1540); *(short *)(saveState + 0xee) = *(short *)((int)this + 0x1890); saveState[0x10f] = *(GameStatePlayer *)((int)this + 0x1e74); saveState[0x110] = *(GameStatePlayer *)((int)this + 0x1da0); saveState[0x111] = *(GameStatePlayer *)((int)this + 0x1da4); saveState[0x112] = *(GameStatePlayer *)((int)this + 0x1da8); saveState[0x113] = *(GameStatePlayer *)((int)this + 0x1dcc); saveState[0x114] = *(GameStatePlayer *)((int)this + 0x1dd0); saveState[0x115] = *(GameStatePlayer *)((int)this + 0x1dd4); *(undefined8 *)(saveState + 0x116) = *(undefined8 *)((int)this + 0x1db0); saveState[0x118] = *(GameStatePlayer *)((int)this + 0x1db8); *(undefined8 *)(saveState + 0x119) = *(undefined8 *)((int)this + 0x1dbc); saveState[0x11b] = *(GameStatePlayer *)((int)this + 0x1dc4); saveState[0x11c] = *(GameStatePlayer *)((int)this + 0x1dc8); saveState[0x11f] = *(GameStatePlayer *)((int)this + 0x1eb8); saveState[0x11e] = *(GameStatePlayer *)((int)this + 0x1eb4); saveState[0x122] = *(GameStatePlayer *)((int)this + 0x1ec4); saveState[0x120] = *(GameStatePlayer *)((int)this + 0x1ebc); saveState[0x11d] = *(GameStatePlayer *)((int)this + 0x1eb0); saveState[0x121] = *(GameStatePlayer *)((int)this + 0x1ec0); saveState[0x123] = *(GameStatePlayer *)((int)this + 0x1ecc); saveState[0x124] = *(GameStatePlayer *)((int)this + 0x1ed4); saveState[0x125] = *(GameStatePlayer *)((int)this + 0x1ed8); saveState[0x126] = *(GameStatePlayer *)((int)this + 0x1ec8); saveState[0x127] = *(GameStatePlayer *)((int)this + 0x1f08); saveState[0x128] = *(GameStatePlayer *)((int)this + 0x1f0c); saveState[0x129] = *(GameStatePlayer *)((int)this + 0x1f10); saveState[0x12a] = *(GameStatePlayer *)((int)this + 0x1f14); saveState[299] = *(GameStatePlayer *)((int)this + 0x1ef4); if (saveState + 300 != (GameStatePlayer *)((int)this + 0x1f18)) { local_3c = (GameStatePlayer)((uint)local_3c & 0xffffff00); std::deque::operator_assign((GameStatePlayer *)((int)this + 0x1f18),local_3c); } pGVar10 = saveState + 0x131; FUN_007dccd0(8); *(byte *)*pGVar10 = *(byte *)((int)this + 0x1f44); *(byte *)((int)*pGVar10 + 1) = *(byte *)((int)this + 0x1f45); *(byte *)((int)*pGVar10 + 2) = *(byte *)((int)this + 0x1f46); *(byte *)((int)*pGVar10 + 3) = *(byte *)((int)this + 0x1f47); *(byte *)((int)*pGVar10 + 4) = *(byte *)((int)this + 0x1f48); *(byte *)((int)*pGVar10 + 5) = *(byte *)((int)this + 0x1f49); *(byte *)((int)*pGVar10 + 6) = *(byte *)((int)this + 0x1f4a); *(byte *)((int)*pGVar10 + 7) = *(byte *)((int)this + 0x1f4b); GVar7 = *(GameStatePlayer *)((int)this + 0x1f4c); savedState[0x135] = *(GameStatePlayer *)((int)this + 0x1f50); savedState[0x134] = GVar7; game = savedState + 0x137; FUN_007dccd0(6); pGVar10 = savedState; *(byte *)*game = *(byte *)((int)this + 0x1f58); *(byte *)((int)*game + 1) = *(byte *)((int)this + 0x1f59); *(byte *)((int)*game + 2) = *(byte *)((int)this + 0x1f5a); *(byte *)((int)*game + 3) = *(byte *)((int)this + 0x1f5b); *(byte *)((int)*game + 4) = *(byte *)((int)this + 0x1f5c); *(byte *)((int)*game + 5) = *(byte *)((int)this + 0x1f5d); FUN_007dccd0(0x14); i = 0; do { *(undefined1 *)(i + (int)pGVar10[0x13a]) = ((undefined1 *)((int)this + 0x1f5e))[i]; *(undefined1 *)((int)pGVar10[0x13a] + 1 + i) = ((undefined1 *)((int)this + 0x1f5f))[i]; *(undefined1 *)((int)pGVar10[0x13a] + 2 + i) = ((undefined1 *)((int)this + 0x1f60))[i]; *(undefined1 *)((int)pGVar10[0x13a] + 3 + i) = ((undefined1 *)((int)this + 0x1f61))[i]; *(undefined1 *)((int)pGVar10[0x13a] + 4 + i) = ((undefined1 *)((int)this + 0x1f62))[i]; i = i + 5; } while (i < 0x14); *(undefined1 *)(pGVar10 + 0x13d) = *(undefined1 *)((int)this + 0x1f72); pGVar10[0x136] = *(GameStatePlayer *)((int)this + 0x1f54); pGVar10[0x13e] = *(GameStatePlayer *)((int)this + 0x1f74); pGVar10[0x13f] = *(GameStatePlayer *)((int)this + 0x1dac); if (pGVar10 + 0x140 != (GameStatePlayer *)((int)this + 0x1fa4)) { local_3c = *(GameStatePlayer *)((int)this + 0x1fa4); local_44 = (GameStatePlayer)(*(int *)((int)this + 0x1fa8) - (int)local_3c); local_40 = (GameStatePlayer)((int)local_44 >> 2); local_38 = pGVar10[0x140]; if ((uint)((int)pGVar10[0x142] - (int)local_38 >> 2) < (uint)local_40) { std::vector::reserve_clear(local_40); local_38 = pGVar10[0x140]; } memmove((void *)local_38,(void *)local_3c,(size_t)local_44); pGVar10[0x141] = (GameStatePlayer)((int)local_44 + (int)local_38); } pGVar10[0x143] = *(GameStatePlayer *)((int)this + 0x1fb8); pGVar10[0x144] = *(GameStatePlayer *)((int)this + 0x1fbc); *(byte *)(pGVar10 + 0x14d) = *(byte *)((int)this + 0x1fc4); pGVar10[0x14d].field_0x1 = *(byte *)((int)this + 0x202c); GVar7 = *(GameStatePlayer *)((int)this + 0x2034); GVar11 = *(GameStatePlayer *)((int)this + 0x2038); GVar3 = *(GameStatePlayer *)((int)this + 0x203c); pGVar10[0x14e] = *(GameStatePlayer *)((int)this + 0x2030); pGVar10[0x14f] = GVar7; pGVar10[0x150] = GVar11; pGVar10[0x151] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x2044); GVar11 = *(GameStatePlayer *)((int)this + 0x2048); GVar3 = *(GameStatePlayer *)((int)this + 0x204c); pGVar10[0x152] = *(GameStatePlayer *)((int)this + 0x2040); pGVar10[0x153] = GVar7; pGVar10[0x154] = GVar11; pGVar10[0x155] = GVar3; if (pGVar10 + 0x156 != (GameStatePlayer *)((int)this + 0x2050)) { std::vector<52byte>::assign (*(GameStatePlayer *)((int)this + 0x2050),*(undefined4 *)((int)this + 0x2054),local_48 ); } pGVar10[0x159] = *(GameStatePlayer *)((int)this + 0x205c); GVar7 = *(GameStatePlayer *)((int)this + 0x2064); pGVar10[0x15a] = *(GameStatePlayer *)((int)this + 0x2060); pGVar10[0x15b] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x206c); pGVar10[0x15c] = *(GameStatePlayer *)((int)this + 0x2068); pGVar10[0x15d] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x2074); pGVar10[0x15e] = *(GameStatePlayer *)((int)this + 0x2070); pGVar10[0x15f] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x207c); pGVar10[0x160] = *(GameStatePlayer *)((int)this + 0x2078); pGVar10[0x161] = GVar7; pGVar10[0x162] = *(GameStatePlayer *)((int)this + 0x2080); pGVar10[0x163] = *(GameStatePlayer *)((int)this + 0x2084); *(byte *)(pGVar10 + 0x164) = *(byte *)((int)this + 0x20a9); GVar7 = *(GameStatePlayer *)((int)this + 0x20b0); pGVar10[0x165] = *(GameStatePlayer *)((int)this + 0x20ac); pGVar10[0x166] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x20b8); pGVar10[0x167] = *(GameStatePlayer *)((int)this + 0x20b4); pGVar10[0x168] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x20c0); pGVar10[0x169] = *(GameStatePlayer *)((int)this + 0x20bc); pGVar10[0x16a] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x20c8); pGVar10[0x16b] = *(GameStatePlayer *)((int)this + 0x20c4); pGVar10[0x16c] = GVar7; pGVar10[0x16d] = *(GameStatePlayer *)((int)this + 0x20cc); pGVar10[0x16e] = *(GameStatePlayer *)((int)this + 0x20d0); *(byte *)(pGVar10 + 0x16f) = *(byte *)((int)this + 0x2090); pGVar10[0x170] = *(GameStatePlayer *)((int)this + 0x2094); pGVar10[0x171] = *(GameStatePlayer *)((int)this + 0x2098); pGVar10[0x172] = *(GameStatePlayer *)((int)this + 0x209c); pGVar10[0x173] = *(GameStatePlayer *)((int)this + 0x20a0); EVar1 = *(EntityPtr *)((int)this + 0x3bc); if ((EVar1 != (EntityPtr)0x0) && (*(int *)((int)EVar1 + 0x28) == 1)) { pGVar10[0x14b] = *(GameStatePlayer *)((int)EVar1 + 0x1620); } GVar7 = (GameStatePlayer)0x0; if (*(EntityPtr *)((int)this + 0x1fc0) != (EntityPtr)0x0) { local_3c = *(GameStatePlayer *)((int)*(EntityPtr *)((int)this + 0x1fc0) + 0x380); local_40 = (GameStatePlayer)0x0; game = &local_3c; if ((float)local_3c <= 0.0) { game = &local_40; } GVar7 = *game; } pGVar10[0x14c] = GVar7; std_map_copy_assign(pGVar10 + 0x175,(std_set *)((int)this + 0x1fcc)); pGVar10[0x1b] = *(GameStatePlayer *)((int)this + 0x154c); pGVar10[0x1c] = *(GameStatePlayer *)((int)this + 0x1550); pGVar10[0x1d] = *(GameStatePlayer *)((int)this + 0x1554); pGVar10[0x1e] = *(GameStatePlayer *)((int)this + 0x1558); pGVar10[0x1f] = *(GameStatePlayer *)((int)this + 0x155c); pGVar10[0x20] = *(GameStatePlayer *)((int)this + 0x1560); pGVar10[0x21] = *(GameStatePlayer *)((int)this + 0x1608); pGVar10[0x22] = *(GameStatePlayer *)((int)this + 0x160c); pGVar10[0x23] = *(GameStatePlayer *)((int)this + 0x1580); pGVar10[0x24] = *(GameStatePlayer *)((int)this + 0x1584); pGVar10[0x25] = *(GameStatePlayer *)((int)this + 0x1588); pGVar10[0x26] = *(GameStatePlayer *)((int)this + 0x158c); pGVar10[0x27] = *(GameStatePlayer *)((int)this + 0x1598); pGVar10[0x28] = *(GameStatePlayer *)((int)this + 0x159c); pGVar10[0x29] = *(GameStatePlayer *)((int)this + 0x15a0); pGVar10[0x2a] = *(GameStatePlayer *)((int)this + 0x15a4); pGVar10[0x2b] = *(GameStatePlayer *)((int)this + 0x15a8); pGVar10[0x2c] = *(GameStatePlayer *)((int)this + 0x15ac); pGVar10[0x2d] = *(GameStatePlayer *)((int)this + 0x15b8); pGVar10[0x2e] = *(GameStatePlayer *)((int)this + 0x15bc); pGVar10[0x2f] = *(GameStatePlayer *)((int)this + 0x15c0); pGVar10[0x30] = *(GameStatePlayer *)((int)this + 0x15c4); pGVar10[0x31] = *(GameStatePlayer *)((int)this + 0x15c8); pGVar10[0x32] = *(GameStatePlayer *)((int)this + 0x15cc); pGVar10[0x33] = *(GameStatePlayer *)((int)this + 0x15d8); pGVar10[0x34] = *(GameStatePlayer *)((int)this + 0x15dc); pGVar10[0x35] = *(GameStatePlayer *)((int)this + 0x15e0); pGVar10[0x36] = *(GameStatePlayer *)((int)this + 0x15e4); pGVar10[0x37] = *(GameStatePlayer *)((int)this + 0x15e8); pGVar10[0x38] = *(GameStatePlayer *)((int)this + 0x15ec); pGVar10[0x39] = *(GameStatePlayer *)((int)this + 0x15f8); pGVar10[0x3a] = *(GameStatePlayer *)((int)this + 0x15fc); pGVar10[0x11] = *(GameStatePlayer *)((int)this + 0x1738); *(short *)(pGVar10 + 0xd) = *(short *)((int)this + 0x1380); *(short *)&pGVar10[0xd].field_0x2 = *(short *)((int)this + 0x1382); *(short *)(pGVar10 + 0xe) = *(short *)((int)this + 0x1384); pGVar10[0x3b] = *(GameStatePlayer *)((int)this + 0x14f0); pGVar10[0x3c] = *(GameStatePlayer *)((int)this + 0x14f4); if ((*(int *)((int)this + 0x2c) == 0) && (*(byte *)((int)this + 0x20a9) == 0)) { pGVar10[0x3d] = *(GameStatePlayer *)((int)this + 0x1500); pGVar10[0x3e] = *(GameStatePlayer *)((int)this + 0x1504); pGVar10[0x3f] = *(GameStatePlayer *)((int)this + 0x14f8); pGVar10[0x40] = *(GameStatePlayer *)((int)this + 0x14fc); } GVar7 = *(GameStatePlayer *)((int)this + 0x17a0); pGVar10[0x42] = *(GameStatePlayer *)((int)this + 0x17a4); pGVar10[0x41] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x17a8); pGVar10[0x44] = *(GameStatePlayer *)((int)this + 0x17ac); pGVar10[0x43] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x17b0); pGVar10[0x46] = *(GameStatePlayer *)((int)this + 0x17b4); pGVar10[0x45] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x17b8); pGVar10[0x48] = *(GameStatePlayer *)((int)this + 0x17bc); pGVar10[0x47] = GVar7; GVar7 = *(GameStatePlayer *)((int)this + 0x17e0); GVar11 = *(GameStatePlayer *)((int)this + 0x17e4); GVar3 = *(GameStatePlayer *)((int)this + 0x17e8); pGVar10[0x49] = *(GameStatePlayer *)((int)this + 0x17dc); pGVar10[0x4a] = GVar7; pGVar10[0x4b] = GVar11; pGVar10[0x4c] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x17f0); GVar11 = *(GameStatePlayer *)((int)this + 0x17f4); GVar3 = *(GameStatePlayer *)((int)this + 0x17f8); pGVar10[0x4d] = *(GameStatePlayer *)((int)this + 0x17ec); pGVar10[0x4e] = GVar7; pGVar10[0x4f] = GVar11; pGVar10[0x50] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x1800); GVar11 = *(GameStatePlayer *)((int)this + 0x1804); GVar3 = *(GameStatePlayer *)((int)this + 0x1808); pGVar10[0x51] = *(GameStatePlayer *)((int)this + 0x17fc); pGVar10[0x52] = GVar7; pGVar10[0x53] = GVar11; pGVar10[0x54] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x1810); GVar11 = *(GameStatePlayer *)((int)this + 0x1814); GVar3 = *(GameStatePlayer *)((int)this + 0x1818); pGVar10[0x55] = *(GameStatePlayer *)((int)this + 0x180c); pGVar10[0x56] = GVar7; pGVar10[0x57] = GVar11; pGVar10[0x58] = GVar3; pGVar10[0x59] = *(GameStatePlayer *)((int)this + 0x181c); if (pGVar10 + 0x5a != (GameStatePlayer *)((int)this + 0x16c8)) { local_3c = *(GameStatePlayer *)((int)this + 0x16c8); local_44 = (GameStatePlayer)(*(int *)((int)this + 0x16cc) - (int)local_3c); local_40 = (GameStatePlayer)((int)local_44 >> 2); local_38 = pGVar10[0x5a]; if ((uint)((int)pGVar10[0x5c] - (int)local_38 >> 2) < (uint)local_40) { std::vector::reserve_clear(local_40); local_38 = pGVar10[0x5a]; } memmove((void *)local_38,(void *)local_3c,(size_t)local_44); pGVar10[0x5b] = (GameStatePlayer)((int)local_44 + (int)local_38); } if (pGVar10 + 0x5d != (GameStatePlayer *)((int)this + 0x1754)) { local_3c = *(GameStatePlayer *)((int)this + 0x1754); local_44 = (GameStatePlayer)(*(int *)((int)this + 0x1758) - (int)local_3c); local_40 = (GameStatePlayer)((int)local_44 >> 2); local_38 = pGVar10[0x5d]; if ((uint)((int)pGVar10[0x5f] - (int)local_38 >> 2) < (uint)local_40) { std::vector::reserve_clear(local_40); local_38 = pGVar10[0x5d]; } memmove((void *)local_38,(void *)local_3c,(size_t)local_44); pGVar10[0x5e] = (GameStatePlayer)((int)local_44 + (int)local_38); } if (pGVar10 + 0x60 != (GameStatePlayer *)((int)this + 0x1760)) { local_3c = *(GameStatePlayer *)((int)this + 0x1760); local_44 = (GameStatePlayer)(*(int *)((int)this + 0x1764) - (int)local_3c); local_40 = (GameStatePlayer)((int)local_44 >> 3); local_38 = pGVar10[0x60]; if ((uint)((int)pGVar10[0x62] - (int)local_38 >> 3) < (uint)local_40) { std::vector<8byte>::_Clear_and_reserve(local_40); local_38 = pGVar10[0x60]; } memmove((void *)local_38,(void *)local_3c,(size_t)local_44); pGVar10[0x61] = (GameStatePlayer)((int)local_44 + (int)local_38); } pGVar10[99] = *(GameStatePlayer *)((int)this + 0x16c0); pGVar10[100] = *(GameStatePlayer *)((int)this + 0x16c4); GVar7 = (GameStatePlayer) (((int)*(void **)((int)this + 0x1224) - (int)((std_vector *)((int)this + 0x1220))->_begin) / 0x130); pGVar10[0x74] = GVar7; std::vector<8byte>::resize(GVar7); local_40 = (GameStatePlayer)0x0; if (pGVar10[0x74] != (GameStatePlayer)0x0) { local_44 = (GameStatePlayer)0x0; do { *(undefined4 *)((int)pGVar10[0x75] + (int)local_40 * 8) = **(undefined4 **) ((int)((std_vector *)((int)this + 0x1220))->_begin + (int)local_44 + 0x114U); *(undefined4 *)((int)pGVar10[0x75] + 4 + (int)local_40 * 8) = *(undefined4 *) (*(int *)((int)((std_vector *)((int)this + 0x1220))->_begin + (int)local_44 + 0x114U) + 4); local_40 = (GameStatePlayer)((int)local_40 + 1); local_44 = (GameStatePlayer)((int)local_44 + 0x130); } while ((uint)local_40 < (uint)pGVar10[0x74]); } local_48 = (GameStatePlayer)(pGVar10 + 0x78); std::vector::resize (((int)*(void **)((int)this + 0x1d80) - (int)((std_vector *)((int)this + 0x1d7c))->_begin) / 0x78); local_44 = (GameStatePlayer)((std_vector *)((int)this + 0x1d7c))->_begin; local_40 = (GameStatePlayer)0x0; iVar8 = (int)*(void **)((int)this + 0x1d80) - (int)local_44; iVar12 = iVar8 >> 0x1f; if (iVar8 / 0x78 + iVar12 != iVar12) { local_3c = (GameStatePlayer)0x0; do { local_38 = (GameStatePlayer)((int)*(GameStatePlayer *)local_48 + (int)local_3c); *(undefined4 *)local_38 = *(undefined4 *)((int)local_3c + (int)local_44); *(undefined4 *)((int)local_38 + 4) = *(undefined4 *)((int)((int)local_3c + 4) + (int)local_44) ; *(undefined4 *)((int)local_38 + 8) = *(undefined4 *)((int)((int)local_3c + 8) + (int)local_44) ; *(undefined4 *)((int)local_38 + 0xc) = *(undefined4 *)((int)((int)local_3c + 0xc) + (int)local_44); *(undefined4 *)((int)local_38 + 0x10) = *(undefined4 *)((int)((int)local_3c + 0x10) + (int)local_44); *(undefined4 *)((int)local_38 + 0x14) = *(undefined4 *)((int)((int)local_3c + 0x14) + (int)local_44); *(undefined4 *)((int)local_38 + 0x18) = *(undefined4 *)((int)((int)local_3c + 0x18) + (int)local_44); *(undefined1 *)((int)local_38 + 0x22) = *(undefined1 *)((int)local_3c + 0x22 + (int)local_44); *(undefined4 *)((int)local_38 + 0x24) = *(undefined4 *)((int)((int)local_3c + 0x24) + (int)local_44); *(undefined4 *)((int)local_38 + 0x1c) = *(undefined4 *)((int)((int)local_3c + 0x1c) + (int)local_44); *(undefined2 *)((int)local_38 + 0x20) = *(undefined2 *)((int)((int)local_3c + 0x20) + (int)local_44); *(undefined4 *)((int)local_38 + 0x28) = *(undefined4 *)((int)((int)local_3c + 0x28) + (int)local_44); *(undefined4 *)((int)local_38 + 0x2c) = *(undefined4 *)((int)((int)local_3c + 0x2c) + (int)local_44); *(undefined4 *)((int)local_38 + 0x30) = *(undefined4 *)((int)((int)local_3c + 0x30) + (int)local_44); *(undefined4 *)((int)local_38 + 0x34) = *(undefined4 *)((int)((int)local_3c + 0x34) + (int)local_44); *(undefined4 *)((int)local_38 + 0x38) = *(undefined4 *)((int)((int)local_3c + 0x38) + (int)local_44); *(undefined4 *)((int)local_38 + 0x3c) = *(undefined4 *)((int)((int)local_3c + 0x3c) + (int)local_44); *(undefined4 *)((int)local_38 + 0x40) = *(undefined4 *)((int)((int)local_3c + 0x40) + (int)local_44); iVar12 = *(int *)((int)((int)local_3c + 0x3c) + (int)local_44); *(int *)((int)local_38 + 0x48) = iVar12; *(int *)((int)local_38 + 0x4c) = iVar12 >> 0x1f; *(undefined1 *)((int)local_38 + 0x23) = *(undefined1 *)((int)local_3c + 0x23 + (int)local_44); *(undefined4 *)((int)local_38 + 0x50) = *(undefined4 *)((int)((int)local_3c + 0x50) + (int)local_44); *(undefined4 *)((int)local_38 + 0x54) = *(undefined4 *)((int)((int)local_3c + 0x54) + (int)local_44); *(undefined1 *)((int)local_38 + 0x60) = *(undefined1 *)((int)((int)local_3c + 0x60) + (int)local_44); *(undefined4 *)((int)local_38 + 0x58) = *(undefined4 *)((int)((int)local_3c + 0x58) + (int)local_44); *(undefined4 *)((int)local_38 + 0x5c) = *(undefined4 *)((int)((int)local_3c + 0x5c) + (int)local_44); puVar6 = (undefined4 *)FUN_004d7250((int)local_44 + (int)((int)local_3c + 100)); uVar2 = puVar6[1]; puVar6[1] = *(undefined4 *)((int)local_38 + 0x68); *(undefined4 *)((int)local_38 + 0x68) = uVar2; uVar2 = *puVar6; *puVar6 = *(undefined4 *)((int)local_38 + 100); *(undefined4 *)((int)local_38 + 100) = uVar2; local_14._0_1_ = 1; if (((local_68 != (GameStatePlayer)0x0) && (cVar4 = (**(code **)(*(int *)local_68 + 0xc))(), cVar4 != '\0')) && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(&local_6c); } GVar7 = local_3c; local_14 = (uint)local_14._1_3_ << 8; SharedPtr::assign((undefined4 *)((int)local_38 + 0x6c), (void *)((int)local_44 + (int)((int)local_3c + 0x6c))); local_44 = (GameStatePlayer)((std_vector *)((int)this + 0x1d7c))->_begin; local_3c = (GameStatePlayer)((int)GVar7 + 0x78); local_40 = (GameStatePlayer)((int)local_40 + 1); } while ((uint)local_40 < (uint)(((int)*(void **)((int)this + 0x1d80) - (int)local_44) / 0x78)); pGVar10 = savedState; } local_48 = (GameStatePlayer)(pGVar10 + 0x65); std::vector<4byte>::resize ((int)*(void **)((int)this + 0x1774) - (int)((std_vector *)((int)this + 6000))->_begin >> 4); i = 0; if ((int)*(void **)((int)this + 0x1774) - (int)((std_vector *)((int)this + 6000))->_begin >> 4 != 0) { iVar12 = 0; do { *(undefined4 *)((int)*(GameStatePlayer *)local_48 + i * 4) = *(undefined4 *)((int)((std_vector *)((int)this + 6000))->_begin + iVar12); i = i + 1; iVar12 = iVar12 + 0x10; } while (i < (uint)((int)*(void **)((int)this + 0x1774) - (int)((std_vector *)((int)this + 6000))->_begin >> 4)); pGVar10 = savedState; } local_48 = (GameStatePlayer)(pGVar10 + 0x68); std::vector<4byte>::resize ((int)*(void **)((int)this + 0x1780) - (int)((std_vector *)((int)this + 0x177c))->_begin >> 4); i = 0; if ((int)*(void **)((int)this + 0x1780) - (int)((std_vector *)((int)this + 0x177c))->_begin >> 4 != 0) { iVar12 = 0; do { *(undefined4 *)((int)*(GameStatePlayer *)local_48 + i * 4) = *(undefined4 *)((int)((std_vector *)((int)this + 0x177c))->_begin + iVar12); i = i + 1; iVar12 = iVar12 + 0x10; } while (i < (uint)((int)*(void **)((int)this + 0x1780) - (int)((std_vector *)((int)this + 0x177c))->_begin >> 4)); pGVar10 = savedState; } local_48 = (GameStatePlayer)(pGVar10 + 0x6b); std::vector<4byte>::resize ((int)*(void **)((int)this + 0x178c) - (int)((std_vector *)((int)this + 0x1788))->_begin >> 4); i = 0; if ((int)*(void **)((int)this + 0x178c) - (int)((std_vector *)((int)this + 0x1788))->_begin >> 4 != 0) { iVar12 = 0; do { *(undefined4 *)((int)*(GameStatePlayer *)local_48 + i * 4) = *(undefined4 *)((int)((std_vector *)((int)this + 0x1788))->_begin + iVar12); i = i + 1; iVar12 = iVar12 + 0x10; } while (i < (uint)((int)*(void **)((int)this + 0x178c) - (int)((std_vector *)((int)this + 0x1788))->_begin >> 4)); pGVar10 = savedState; } local_48 = (GameStatePlayer)(pGVar10 + 0x6e); std::vector<4byte>::resize ((int)*(void **)((int)this + 0x1798) - (int)((std_vector *)((int)this + 0x1794))->_begin >> 4); i = 0; if ((int)*(void **)((int)this + 0x1798) - (int)((std_vector *)((int)this + 0x1794))->_begin >> 4 != 0) { iVar12 = 0; do { *(undefined4 *)(*(int *)local_48 + i * 4) = *(undefined4 *)((int)((std_vector *)((int)this + 0x1794))->_begin + iVar12); i = i + 1; iVar12 = iVar12 + 0x10; } while (i < (uint)((int)*(void **)((int)this + 0x1798) - (int)((std_vector *)((int)this + 0x1794))->_begin >> 4)); pGVar10 = savedState; } if (pGVar10 + 0x71 != (GameStatePlayer *)((int)this + 0x16d4)) { local_48 = *(GameStatePlayer *)((int)this + 0x16d4); local_40 = (GameStatePlayer)(*(int *)((int)this + 0x16d8) - (int)local_48); local_3c = (GameStatePlayer)((int)local_40 >> 2); local_44 = pGVar10[0x71]; if ((uint)((int)pGVar10[0x73] - (int)local_44 >> 2) < (uint)local_3c) { std::vector::reserve_clear(local_3c); local_44 = pGVar10[0x71]; } memmove((void *)local_44,(void *)local_48,(size_t)local_40); pGVar10[0x72] = (GameStatePlayer)((int)local_40 + (int)local_44); } pGVar10[0x82] = *(GameStatePlayer *)((int)this + 0x145c); *(short *)(pGVar10 + 0x83) = *(short *)((int)this + 0x137c); *(short *)&pGVar10[0x83].field_0x2 = *(short *)((int)this + 0x137e); game = g_game; GVar7 = *(GameStatePlayer *)((int)this + 0x1914); GVar11 = *(GameStatePlayer *)((int)this + 0x1918); GVar3 = *(GameStatePlayer *)((int)this + 0x191c); local_74 = 1; pGVar10[0x84] = *(GameStatePlayer *)((int)this + 0x1910); pGVar10[0x85] = GVar7; pGVar10[0x86] = GVar11; pGVar10[0x87] = GVar3; GVar7 = *(GameStatePlayer *)((int)this + 0x1924); pGVar10[0x88] = *(GameStatePlayer *)((int)this + 0x1920); pGVar10[0x89] = GVar7; pGVar10[0x8a] = *(GameStatePlayer *)((int)this + 0x1928); pGVar10[0xd2] = *(GameStatePlayer *)((int)this + 0x192c); pGVar10[0xd3] = *(GameStatePlayer *)((int)this + 0x1930); pGVar10[0xd4] = *(GameStatePlayer *)((int)this + 0x1934); pGVar10[0xd5] = *(GameStatePlayer *)((int)this + 0x1938); pGVar10[0xd6] = *(GameStatePlayer *)((int)this + 0x193c); pGVar10[0xd7] = *(GameStatePlayer *)((int)this + 0x1940); pGVar10[0xd8] = *(GameStatePlayer *)((int)this + 0x1944); pGVar10[0xd9] = *(GameStatePlayer *)((int)this + 0x1948); pGVar10[0xda] = *(GameStatePlayer *)((int)this + 0x194c); pGVar10[0xf] = *(GameStatePlayer *)((int)this + 0x188c); pGVar10[0x10] = *(GameStatePlayer *)((int)this + 0x18e8); pGVar10[0x8b] = (GameStatePlayer)0x0; pvVar9 = game->_room; roomEntities = *(int *)((int)pvVar9 + 0x125c); local_6c = *(undefined4 *)((int)pvVar9 + 0x1260); local_68 = *(GameStatePlayer *)((int)pvVar9 + 0x1264); local_14._0_1_ = 2; local_44 = local_68; local_38 = (GameStatePlayer)roomEntities; if (*(void **)((int)this + 0x26c8) == (void *)0x0) { EVar1 = *(EntityPtr *)((int)this + 0x1e68); if ((((EVar1 == (EntityPtr)0x0) || (*(int *)((int)EVar1 + 0x161c) == -1)) || ((pGVar10 = savedState, *(int *)((int)this + 0x161c) <= *(int *)((int)EVar1 + 0x161c) || (EVar1 == (EntityPtr)this)))) && (local_40 = (GameStatePlayer)0x0, local_68 != (GameStatePlayer)0x0)) { do { if (9 < (int)pGVar10[0x8b]) break; local_3c = (GameStatePlayer) __RTDynamicCast(*(undefined4 *)((int)local_38 + (int)local_40 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (((local_3c != (GameStatePlayer)0x0) && ((*(uint *)((int)local_3c + 0x168) & 0x20000000) != 0)) && ((cVar4 = (**(code **)(*(int *)local_3c + 0x4c))(), cVar4 == '\0' && (((*(int *)((int)local_3c + 0x28) != 0x17 || (*(int *)((int)local_3c + 0x2c) != 0)) || (*(int *)((int)local_3c + 0x30) != 1)))))) { if (*(int *)((int)local_3c + 0xf1c) == -1) { if (*(int *)((int)this + 0x161c) == 0) goto LAB_007b1ea4; } else if (*(int *)((int)this + 0x1618) == *(int *)((int)local_3c + 0xf1c)) { LAB_007b1ea4: GVar7 = pGVar10[0x8b]; pGVar10[0x8b] = (GameStatePlayer)((int)GVar7 + 1); FUN_006d0370(pGVar10 + ((int)GVar7 + 0x14) * 7); } } local_40 = (GameStatePlayer)((int)local_40 + 1); } while ((uint)local_40 < (uint)local_44); } } if (*(char *)((int)this + 0x20e8) == '\0') { local_34 = CONCAT31(local_34._1_3_,1); pvVar9 = g_game->_room; uStack_30 = *(undefined4 *)((int)pvVar9 + 0x124c); uStack_2c = *(undefined4 *)((int)pvVar9 + 0x1250); uStack_28 = *(undefined4 *)((int)pvVar9 + 0x1254); local_14._0_1_ = 3; local_3c = (GameStatePlayer)0x0; if (local_44 != (GameStatePlayer)0x0) { GVar7 = local_38; GVar11 = local_44; do { familiar = *(Entity_Familiar **)((int)GVar7 + (int)local_3c * 4); if ((familiar->_type == 3) && (familiar->_player == this)) { iVar12 = familiar->_variant; if (iVar12 == 900) { LAB_007b1f9d: bVar13 = false; } else { if (iVar12 == 0xce) { bVar13 = familiar->_subtype == 0x18c; } else { bVar13 = iVar12 == 0xf0; } if ((bVar13) || ((saveTemporaryFamiliars == 0 && (familiar->_isNotCountedAsFollower != 0)))) goto LAB_007b1f9d; bVar13 = true; } if (bVar13) { uStack_84 = 0; local_88 = 0; Entity_Familiar::store_backup(familiar,&familiarBackup); GVar7 = pGVar10[0xe1]; if (GVar7 == pGVar10[0xe2]) { vector_PlayerItemBackup_emplace_reallocate(GVar7,&familiarBackup); } else { *(undefined4 *)GVar7 = familiarBackup; *(undefined4 *)((int)GVar7 + 4) = uStack_a4; *(undefined4 *)((int)GVar7 + 8) = uStack_a0; *(undefined4 *)((int)GVar7 + 0xc) = uStack_9c; *(undefined4 *)((int)GVar7 + 0x10) = local_98; *(undefined4 *)((int)GVar7 + 0x14) = uStack_94; *(undefined4 *)((int)GVar7 + 0x18) = uStack_90; *(undefined4 *)((int)GVar7 + 0x1c) = uStack_8c; *(undefined4 *)((int)GVar7 + 0x20) = local_88; *(undefined4 *)((int)GVar7 + 0x24) = uStack_84; *(undefined4 *)((int)GVar7 + 0x28) = uStack_80; *(undefined4 *)((int)GVar7 + 0x2c) = uStack_7c; *(undefined4 *)((int)GVar7 + 0x30) = local_78; pGVar10[0xe1] = (GameStatePlayer)((int)pGVar10[0xe1] + 0x34); } GVar11 = local_44; } GVar7 = local_38; } local_3c = (GameStatePlayer)((int)local_3c + 1); } while ((uint)local_3c < (uint)GVar11); } local_14._0_1_ = 2; } else if (pGVar10 + 0xe0 != (GameStatePlayer *)((int)this + 0x246c)) { std::vector<52byte>::assign (*(GameStatePlayer *)((int)this + 0x246c),*(undefined4 *)((int)this + 0x2470),local_48 ); } pGVar10[0xdf] = (GameStatePlayer)(((int)pGVar10[0xe1] - (int)pGVar10[0xe0]) / 0x34); std::vector::assign((int)this + 0x173c); if (((*(uint *)((int)this + 0x16c) & 4) == 0) || (*(EntityPtr *)((int)this + 0x28c) != (EntityPtr)this)) { GVar7 = (GameStatePlayer)0x0; } else { GVar7 = *(GameStatePlayer *)((int)this + 0x138c); } pGVar10[0x10c] = GVar7; pGVar10[0x10d] = (GameStatePlayer)(int)*(short *)((int)this + 0x1544); *(undefined2 *)(pGVar10 + 0x10e) = *(undefined2 *)((int)this + 0x1546); pGVar10[0x147] = pGVar10[0x146]; local_48 = (GameStatePlayer)((int)this + 0x150c); local_3c = *(GameStatePlayer *)local_48; local_40 = (GameStatePlayer)0x0; if (*(int *)((int)this + 0x1510) - (int)local_3c >> 4 != 0) { iVar12 = 0; do { if ((*(int *)((int)local_3c + iVar12) != 0) && (*(char *)(*(int *)((int)local_3c + iVar12) + 0xb4) != '\0')) { GVar7 = pGVar10[0x147]; local_34 = 0; uStack_30 = 0; uStack_2c = 0; uStack_28 = 0; if (GVar7 == pGVar10[0x148]) { FUN_007ddc40(GVar7,&local_34); } else { *(undefined4 *)GVar7 = 0; *(undefined4 *)((int)GVar7 + 4) = 0; *(undefined4 *)((int)GVar7 + 8) = 0; *(undefined4 *)((int)GVar7 + 0xc) = 0; pGVar10[0x147] = (GameStatePlayer)((int)pGVar10[0x147] + 0x10); } *(undefined4 *)((int)pGVar10[0x147] + -0x10) = **(undefined4 **)((int)local_3c + iVar12); *(undefined4 *)((int)pGVar10[0x147] + -0xc) = *(undefined4 *)(*(int *)((int)local_3c + iVar12) + 4); *(undefined4 *)((int)pGVar10[0x147] + -8) = *(undefined4 *)((int)local_3c + 4 + iVar12); *(undefined4 *)((int)pGVar10[0x147] + -4) = *(undefined4 *)((int)local_3c + 8 + iVar12); } iVar12 = iVar12 + 0x10; local_40 = (GameStatePlayer)((int)local_40 + 1); local_3c = *(GameStatePlayer *)local_48; } while ((uint)local_40 < (uint)((int)*(GameStatePlayer *)((int)local_48 + 4) - (int)local_3c >> 4)); this = (Entity_Player *)player; } *(undefined1 *)(pGVar10 + 0x174) = *(undefined1 *)((int)this + 0x1eec); pGVar10[0x174].field_0x1 = *(undefined1 *)((int)this + 0x1ef0); pGVar10[0x102] = *(GameStatePlayer *)((int)this + 0x17c4); pGVar10[0x103] = *(GameStatePlayer *)((int)this + 0x17c8); *(undefined1 *)(pGVar10 + 0x104) = *(undefined1 *)((int)this + 0x17cc); FUN_007dca70((int)this + 0x150c); pGVar10[0x108] = *(GameStatePlayer *)((int)this + 0x18a0); if (local_50 != (void *)0x0) { deallocate(local_50,(int)local_54 - (int)local_50 >> 2); } ExceptionList = local_1c; return; } //@@ 007b2200 Entity_Player::DonateLuck /* ZHL [lua] Lua binding EntityPlayer:DonateLuck prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::DonateLuck(Entity_Player *this,int luck) { this->_donateLuck = this->_donateLuck + luck; this->_cacheFlags = this->_cacheFlags | 0x400; EvaluateItems(); return; } //@@ 007b2230 Entity_Player::UseCard /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [lua] Lua binding EntityPlayer:UseCard prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::UseCard(Entity_Player *this,int cardType,uint useFlag) { code *pcVar1; RNG rng; bool bVar2; Game *game; byte bVar4; char cVar5; Room *pRVar6; uint uVar7; Entity_Player *player; PersistentGameData *persistentData; GlowingHourglassState *hourglassState; Entity_NPC *npc; Ambush *ambush; Minimap *minimap; RoomDescriptor *roomDesc; Seeds *seeds; char *pcVar14; Vector *vecResult2; float *pfVar16; int iVar17; ItemOverlay *itemOverlay; EntityList *entityList; Room *pRVar20; EntityPtr EVar21; Level *pLVar22; Level *level; Entity_Effect *effect; EntityRef *sourceRef; ItemPool_Item *pool; undefined4 *puVar27; undefined1 *puVar28; EntityPtr *pEVar29; HUD *hud; uint uVar30; Entity *tmpEntity; PlayerManager *playerManager; EntityPtr EVar33; Vector *vecResult; TemporaryEffects *playerEffects; undefined4 uVar36; int *piVar37; ItemConfig *itemConfig; ItemConfig_Item *configItem; ItemPool *itemPool; int iVar41; char *pcVar42; char *pcVar43; RNG *rngSource; void *pvVar45; undefined4 *puVar46; undefined1 *puVar47; float in_XMM0_Da; TypeDescriptor *pTVar48; TypeDescriptor *pTVar49; uint shiftidx; undefined4 uVar50; float fVar51; undefined4 uVar52; EntityRef EStack_4d0; Vector VStack_488; undefined1 auStack_480 [8]; undefined4 uStack_478; undefined1 auStack_470 [8]; undefined4 uStack_468; undefined1 auStack_460 [8]; int iStack_458; undefined1 auStack_450 [8]; int iStack_448; Vector VStack_440; EntityList_EL hermitPickups; EntityList_EL shardCollectibles; EntityList_EL creditPickups; ItemConfig_Item *whoreClothEffect; undefined4 uStack_404; int iStack_400; undefined4 uStack_3fc; ItemConfig_Item *whoreEffect; undefined4 uStack_3f4; int iStack_3f0; undefined4 uStack_3ec; ItemConfig_Item *belialEffect; undefined4 uStack_3e4; int iStack_3e0; undefined4 uStack_3dc; ItemConfig_Item *telepathyEffect; undefined4 uStack_3d4; int iStack_3d0; undefined4 uStack_3cc; EntityList_EL towerEffects; Vector spawnPos; EntityList_EL jeraPickups; Vector spawnPos2; Vector VStack_398; undefined1 auStack_390 [8]; undefined4 uStack_388; Vector pickupPos; undefined4 announcerDelay; Vector VStack_374; int cardConfig; Vector VStack_368; Vector VStack_360; Vector VStack_358; WeightedOutcomePicker outcomePicker [3]; Vector VStack_344; int targetsBegin; int targetsEnd; Vector VStack_330; undefined1 auStack_328 [12]; Vector VStack_31c; Vector VStack_314; undefined4 uStack_30c; Vector VStack_308; Vector VStack_300; undefined4 uStack_2f8; EntityPtr EStack_2f4; Vector VStack_2f0; undefined4 uStack_2e8; EntityPtr EStack_2e4; byte isPlayAnim; byte isPlayAnnouncer; Vector VStack_2dc; Vector VStack_2d4; Vector VStack_2cc; Vector VStack_2c4; Vector VStack_2bc; Vector VStack_2b4; undefined4 local_2ac; undefined4 local_2a8; undefined2 uStack_2a2; Vector VStack_2a0; undefined4 local_298; int card; EntityRef EStack_28c; RNG shardRng; EntityRef EStack_254; RNG RStack_22c; RNG towerRng; RNG RStack_20c; RNG tmpRng; int *speedStat; int *fireDelayStat; int *damageStat; int *rangeStat; int *shotSpeedStat; int *luckStat; char gridMarks [448]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00affd56; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(gridMarks + 0x1d0); card = cardType; if (cardType < 0) { return; } pvVar45 = (g_manager->_itemConfig)._cards._begin; if ((int)(g_manager->_itemConfig)._cards._end - (int)pvVar45 >> 2 <= cardType) { return; } cardConfig = *(int *)((int)pvVar45 + cardType * 4); if (cardConfig == 0) { return; } ExceptionList = &local_10; VStack_2d4.y = (float)this; Player_stats_add(5,this); announcerDelay = 2; VStack_2a0.y = (float)(g_manager->_optionsConfig)._announcerVoiceMode; if ((EntityPtr)VStack_2a0.y == (EntityPtr)0x0) { announcerDelay = 900; } if (g_game->_challenge == 0x20) { rngSource = (RNG *)(cardType * 0x10 + (int)(this->_cardRNGs)._begin); RNG::Next(rngSource); cardType = (uint)rngSource->_seed % 0x61 + 1; card = cardType; } VStack_2dc.y = (float)(useFlag >> 7 & 0xffffff01); local_2ac = useFlag >> 5 & 0xffffff01; bVar4 = HasCollectible(this,0x1c3,0); if ((bVar4 == 0) || ((*(int *)(cardConfig + 0x58) != 0 && (*(int *)(cardConfig + 0x58) != 5)))) { uStack_2a2._1_1_ = 0; bVar4 = ~(byte)(useFlag >> 1) & 1; LAB_007b23cf: local_2a8 = CONCAT31(local_2a8._1_3_,bVar4); } else { isPlayAnnouncer = 1; uStack_2a2._1_1_ = 1; VStack_2bc.y = (float)(CONCAT31((uint3)(useFlag >> 9),~(byte)(useFlag >> 1)) & 0xffffff01); local_2a8 = CONCAT31(local_2a8._1_3_,SUB41(VStack_2bc.y,0)); if ((useFlag & 4) != 0) { uStack_2a2._1_1_ = 1; local_2a8 = CONCAT31(local_2a8._1_3_,SUB41(VStack_2bc.y,0)); if ((char)local_2ac == '\0') { UseCard(this,cardType,0x20); uStack_2a2._1_1_ = isPlayAnnouncer; bVar4 = SUB41(VStack_2bc.y,0); goto LAB_007b23cf; } } } isPlayAnim = ~(byte)useFlag & 1; pRVar6 = (Room *)GetCardRNG(cardType); local_298 = pRVar6; uVar7 = Random(); if (((((((uVar7 & 1) == 0) && ((EntityPtr)VStack_2a0.y == (EntityPtr)0x0)) || ((EntityPtr)VStack_2a0.y == (EntityPtr)0x2)) && ((useFlag & 0x100) == 0)) && ((5 < g_game->_stage - 1U || (bVar4 = Game::GetStateFlag(g_game,0x30), bVar4 == 0)))) && (g_game->_stage != 0xd)) { isPlayAnnouncer = '\x01'; } else { isPlayAnnouncer = '\0'; } game = g_game; switch(card) { case 1: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } g_game->_leaveDoor = -1; Game::StartRoomTransition(game,game->_startingRoomIdx,-1,3,this,0); goto LAB_007b8998; case 2: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } piVar37 = (int *)BitSet128::operator_and(&g_tearFlagHoming); if ((*piVar37 != 0 || piVar37[1] != 0) || (piVar37[2] != 0 || piVar37[3] != 0)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x185); } telepathyEffect = ItemConfig::GetCollectible(&g_manager->_itemConfig,0xc0); uStack_3d4 = 0; iStack_3d0 = telepathyEffect->maxCooldown; uStack_3cc = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&telepathyEffect,(byte)local_2a8,1); if (uStack_2a2._1_1_ != 0) { belialEffect = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x22); uStack_3e4 = 0; iStack_3e0 = belialEffect->maxCooldown; uStack_3dc = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&belialEffect,(byte)local_2a8,1); } break; case 3: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } VStack_2dc.y = (float)g_game->_room; VStack_2d4.y = (float)this; VStack_2cc.y = (float)this; if ((((Level *)VStack_2dc.y)->_roomList[0x19].DecorationSeed != 0) && (((Level *)VStack_2dc.y)->_roomList[0x26].GreedSubType != 6)) { VStack_2b4.y = (float)((uint)VStack_2b4.y & 0xffffff00); VStack_2bc.y = 1.4013e-45; VStack_2a0.y = 0.0; if (1 < (uint)((Level *)VStack_2dc.y)->_roomList[0x19].DecorationSeed) { do { pRVar6 = *(Room **)(*(int *)&((RoomDescriptor *)((int)VStack_2dc.y + 0x14))[0x19]. PoopCount + (int)VStack_2bc.y * 4); cVar5 = (**(code **)(*(int *)this + 0x50))(pRVar6); if ((cVar5 != '\0') && (((bVar4 = Entity::IsVulnerableEnemy((Entity *)pRVar6,(Entity *)0x0), bVar4 != 0 || ((((1 < *(int *)&g_game->_deathmatchManager && (pRVar6->_gridEntities[1] == (void *)0x1)) || (((int)pRVar6->_gridEntities[1] - 10U < 0x3de && (pRVar6->_gridEntities[1] != (void *)0x21)))) && (VStack_2b4.y._0_1_ == '\0')))) && ((*(byte *)((int)pRVar6->_gridEntities + 0x14f) == 0 && (VStack_2a0.y <= (float)*(EntityPtr *)(pRVar6->_gridEntities + 0xd7))))))) { VStack_2d4.y = VStack_2cc.y; VStack_2cc.y = (float)pRVar6; VStack_2a0.y = (float)*(EntityPtr *)(pRVar6->_gridEntities + 0xd7); bVar4 = Entity::IsVulnerableEnemy((Entity *)pRVar6,(Entity *)0x0); VStack_2b4.y = (float)((uint)VStack_2b4.y & 0xff); if (bVar4 != 0) { VStack_2b4.y = 1.4013e-45; } } VStack_2bc.y = (float)((int)VStack_2bc.y + 1); } while ((uint)VStack_2bc.y < (uint)((RoomDescriptor *)((int)VStack_2dc.y + 0x14))[0x19].DecorationSeed); } } fVar51 = VStack_2cc.y; if (((Room *)VStack_2d4.y == (Room *)0x0) || ((Entity_Player *)VStack_2d4.y == this)) { VStack_2d4.y = VStack_2cc.y; } if ((Room *)VStack_2cc.y != (Room *)0x0) { uVar7 = Random(); VStack_2a0.x = ((Vector *)((void **)((int)fVar51 + 0x24) + 0xc6))->x; VStack_2a0.y = *(float *)((void **)((int)fVar51 + 0x24) + 199); uVar52 = 0; pTVar49 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar48 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar36 = 0; tmpEntity = Game::Spawn(g_game,1000,0x1d,&VStack_2a0,&g_vectorZero,(Entity *)0x0,0,uVar7); tmpEntity = (Entity *)__RTDynamicCast(tmpEntity,uVar36,pTVar48,pTVar49,uVar52); Entity::SetTarget(tmpEntity,(Entity *)VStack_2cc.y); (**(code **)(*(int *)tmpEntity + 0xc))(); } fVar51 = VStack_2d4.y; if ((uStack_2a2._1_1_ != 0) && ((Room *)VStack_2d4.y != (Room *)0x0)) { tmpEntity = (Entity *)Entity_Effect::CreateTimer(0,0); pvVar45 = ((void **)((int)fVar51 + 0x24))[199]; (tmpEntity->_pos).x = ((Vector *)((void **)((int)fVar51 + 0x24) + 0xc6))->x; (tmpEntity->_pos).y = (float)pvVar45; Entity::SetTarget(tmpEntity,(Entity *)fVar51); } break; case 4: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } bVar4 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x7a); if (bVar4 == 0) { ItemOverlay::Show(&g_game->_itemOverlay,3,3,(Entity_Player *)0x0); } whoreEffect = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x7a); uStack_3f4 = 0; iStack_3f0 = whoreEffect->maxCooldown; uStack_3ec = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&whoreEffect,(byte)local_2a8,1); if (uStack_2a2._1_1_ != 0) { whoreClothEffect = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x7a); uStack_404 = 0; iStack_400 = whoreClothEffect->maxCooldown; uStack_3fc = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&whoreClothEffect,(byte)local_2a8,1); } break; case 5: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } iVar41 = Level::QueryRoomTypeIndex(5,0,pRVar6,0); game = g_game; if (-1 < iVar41) { g_game->_leaveDoor = -1; Game::StartRoomTransition(game,iVar41,-1,3,this,-1); isPlayAnim = 0; } if (uStack_2a2._1_1_ != 0) { pLVar22 = (Level *)Config::GetCollectibles(); roomDesc = Level::GetRoomByIdx(pLVar22,iVar41,-1); if (roomDesc->VisitedCount == 0) { AddSoulHearts(this,2,0); } } break; case 6: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } VStack_2a0.y = (float)(uStack_2a2._1_1_ + 2); do { uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos2,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,3,uVar7); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); pRVar6 = local_298; } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; break; case 7: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } VStack_2a0.y = (float)(uStack_2a2._1_1_ + 2); do { uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,1,uVar7); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); pRVar6 = local_298; } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; break; case 8: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x4d); TemporaryEffect::TemporaryEffect(configItem); if (uStack_2a2._1_1_ != 0) { iStack_448 = iStack_448 * 2; } TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_450,(byte)local_2a8,1); break; case 9: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } VStack_2a0.y = (float)(uStack_2a2._1_1_ + 1); do { bVar4 = HasTrinket(this,0x16,0); if (bVar4 == 0) { LAB_007b2f5b: uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,0,uVar7); pRVar6 = local_298; } else { rngSource = (RNG *)FUN_005cbd00(0x16); uVar7 = RNG::RandomInt(rngSource,5); if (uVar7 == 0) goto LAB_007b2f5b; } uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos2,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x28,vecResult,&g_vectorZero,(Entity *)this,0,uVar7); uVar7 = RNG::Next((RNG *)local_298); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_358,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x1e,vecResult,&g_vectorZero,(Entity *)this,0,uVar7); uVar7 = RNG::Next((RNG *)local_298); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,0x14,vecResult,&g_vectorZero,(Entity *)this,0,uVar7); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); pRVar6 = local_298; } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; break; case 10: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } Config::GetCollectibles(); iVar41 = Level::QueryRoomTypeIndex(2,0,pRVar6,0); if (-1 < iVar41) { Config::GetCollectibles(); FUN_00428ae0(0xffffffff); Game::StartRoomTransition(g_game,iVar41,-1,3,this,-1); if (uStack_2a2._1_1_ != 0) { FUN_00420ae0(); FUN_00753c40(2); } goto LAB_007b8998; } break; case 0xb: play_sound_with_fart_seed(0x109,2,0,0x3f800000); VStack_2b4.y = 1.4013e-45; iVar41 = FUN_0067f030(); if (iVar41 == 0) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar4 = PersistentGameData::Unlocked(persistentData,0x25f); if (bVar4 == 0) goto LAB_007b319e; VStack_2b4.y = 2.24208e-44; } else if (iVar41 < 0x1a) { LAB_007b319e: VStack_2b4.y = 4.2039e-45; } uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0); pRVar6 = (Room *)VStack_2b4.y; goto LAB_007b31f0; case 0xc: TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0xc,(byte)local_2a8,1); iVar41 = GetHeartLimit(this,0); iVar17 = GetEffectiveMaxHearts(this); if (iVar17 < iVar41) { this->_strengthMaxHearts = this->_strengthMaxHearts + 1; AddMaxHearts(this,2,0); } AddHearts(this,2,0,0); break; case 0xd: itemConfig = Isaac::GetItemConfig(); iVar41 = 1; uVar7 = local_2a8; configItem = ItemConfig::GetCollectible(itemConfig,0x14); bVar4 = (byte)uVar7; goto LAB_007b327d; case 0xe: itemOverlay = (ItemOverlay *)Game::GetItemOverlay(); ItemOverlay::Show(itemOverlay,0xc,0,(Entity_Player *)0x0); SoundEffects::PlayWithFartOverride(0x21,2,0,0x3f800000); UseActiveItem(this,&uStack_2a2,0x23,1,-1,0); persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); PersistentGameData::IncreaseEventCounter(persistentData,7,1); break; case 0xf: play_sound_with_fart_seed(0x109,2,0,0x3f800000); uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0); pRVar6 = (Room *)0x2; goto LAB_007b31f0; case 0x10: SoundEffects::PlayWithFartOverride(0x22,2,0,0x3f800000); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x22,3,(Entity_Player *)0x0); itemConfig = Isaac::GetItemConfig(); iVar41 = 1; uVar7 = local_2a8; configItem = ItemConfig::GetCollectible(itemConfig,0x22); bVar4 = (byte)uVar7; goto LAB_007b327d; case 0x11: itemConfig = Isaac::GetItemConfig(); iVar41 = 1; uVar7 = local_2a8; configItem = ItemConfig::GetCollectible(itemConfig,0x41); bVar4 = (byte)uVar7; LAB_007b327d: pvVar45 = (void *)TemporaryEffect::TemporaryEffect(configItem); TemporaryEffects::AddEffect(&this->_temporaryeffects,pvVar45,bVar4,iVar41); break; case 0x12: Config::GetCollectibles(); VStack_2b4.y = (float)Level::QueryRoomTypeIndex(0x18,0,pRVar6,0); if ((int)VStack_2b4.y < 0) { LAB_007b3428: Config::GetCollectibles(); VStack_2b4.y = (float)Level::QueryRoomTypeIndex(4,0,pRVar6,0); if ((int)VStack_2b4.y < 0) break; } else { pLVar22 = (Level *)Config::GetCollectibles(); roomDesc = Level::GetRoomByIdx(pLVar22,(int)VStack_2b4.y,-1); if (*(int *)((int)roomDesc->Data + 8) != 0x18) goto LAB_007b3428; } Config::GetCollectibles(); FUN_00428ae0(0xffffffff); Game::StartRoomTransition(g_game,(int)VStack_2b4.y,-1,3,this,-1); if (uStack_2a2._1_1_ != 0) { FUN_00420ae0(); FUN_00753c40(1); } goto LAB_007b8998; case 0x13: Config::GetCollectibles(); uVar52 = 0; uVar36 = 7; goto LAB_007b34ad; case 0x14: if (uStack_2a2._1_1_ == 0) { fVar51 = 1.0; } else { fVar51 = 2.0; } VStack_2c4.y = fVar51 * 100.0; Level::GetCurrentRoom(); VStack_2dc.y = (float)Room::GetEntities(); EVar33 = (EntityPtr)0x0; VStack_2bc.y = 0.0; iVar41 = EntityList::Size(); if (iVar41 != 0) { do { pEVar29 = (EntityPtr *)std::vector::operator_index(EVar33); VStack_2a0.y = *(float *)pEVar29; bVar4 = Entity::IsVulnerableEnemy((Entity *)VStack_2a0.y,(Entity *)0x0); if (bVar4 != 0) { pcVar1 = *(code **)(*(int *)VStack_2a0.y + 0x20); EntityRef::constructor(&EStack_254,(Entity *)this); (*pcVar1)(VStack_2c4.y,0,0,&EStack_254,0x1e); EVar33 = (EntityPtr)VStack_2bc.y; } EVar33 = (EntityPtr)((int)EVar33 + 1); VStack_2bc.y = (float)EVar33; EVar21 = (EntityPtr)EntityList::Size(); } while ((uint)EVar33 < (uint)EVar21); } uVar7 = 0; Game::GetPlayerManager(g_game); iVar41 = std::vector::size(); if (iVar41 != 0) { do { playerManager = (PlayerManager *)Game::GetPlayerManager(g_game); player = PlayerManager::GetPlayer(playerManager,uVar7); if (player->_dead == 0) { SetFullHearts(player); } uVar7 = uVar7 + 1; Game::GetPlayerManager(g_game); uVar30 = std::vector::size(); } while (uVar7 < uVar30); } pLVar22 = (Level *)Config::GetCollectibles(); Level::ShowMap(pLVar22); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::StopRain(pRVar6); pLVar22 = (Level *)Config::GetCollectibles(); Level::RemoveCurses(pLVar22,1); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,5,0,(Entity_Player *)0x0); break; case 0x15: uVar7 = RNG::RandomInt((RNG *)pRVar6,3); if (uVar7 == 0) { VStack_2d4.y = (float)&DAT_00000005; } else { uVar7 = RNG::RandomInt((RNG *)pRVar6,0x32); if (uVar7 == 0) { VStack_2d4.y = (float)&DAT_0000000d; } else { uVar7 = RNG::RandomInt((RNG *)pRVar6,0x32); if (uVar7 == 0) { persistentData = (PersistentGameData *)Room::GetTopLeftPos((Room *)g_manager); bVar4 = PersistentGameData::Unlocked(persistentData,0x266); if (bVar4 != 0) { VStack_2d4.y = 2.52234e-44; goto LAB_007b36ff; } } uVar7 = RNG::RandomInt((RNG *)pRVar6,0x32); if (uVar7 == 0) { VStack_2d4.y = (float)&DAT_00000007; } else { uVar7 = RNG::RandomInt((RNG *)pRVar6,0x32); VStack_2d4.y = (float)&DAT_00000004; if (uVar7 == 0) { VStack_2d4.y = (float)&DAT_00000009; } } } } LAB_007b36ff: uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0); pRVar6 = (Room *)VStack_2d4.y; goto LAB_007b31f0; case 0x16: pLVar22 = (Level *)Config::GetCollectibles(); Level::ShowMap(pLVar22); break; case 0x17: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } iVar41 = this->_numBombs; if (iVar41 == 0) { iVar41 = 2; } AddBombs(this,iVar41 + (uint)uStack_2a2._1_1_ * 2); break; case 0x18: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } iVar41 = this->_numCoins; if (iVar41 == 0) { iVar41 = 2; } AddCoins(this,iVar41 + (uint)uStack_2a2._1_1_ * 2); break; case 0x19: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } iVar41 = this->_numKeys; if (iVar41 == 0) { iVar41 = 2; } AddKeys(this,iVar41 + (uint)uStack_2a2._1_1_ * 2); break; case 0x1a: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } if (this->_playerType == 0x24) { iVar41 = this->_effectiveBloodCharge; if (iVar41 == 0) { iVar41 = 2; } AddBloodCharge(iVar41 + (uint)uStack_2a2._1_1_ * 2); } else { iVar41 = this->_redHearts; iVar17 = iVar41; if (iVar41 == 0) { iVar17 = 2; } VStack_2a0.y = (float)((uint)uStack_2a2._1_1_ * 2); puVar28 = (undefined1 *)((int)VStack_2a0.y + iVar17); if (1 < *(int *)&g_game->_deathmatchManager) { iVar17 = iVar41; if (iVar41 == 0) { iVar17 = 0x10; } uVar7 = iVar17 + (uint)uStack_2a2._1_1_ * 0x10; puVar28 = (undefined1 *)(uVar7 >> 3); this->_redHearts = (uVar7 & 7) + iVar41; } AddHearts(this,(int)puVar28,0,0); } break; case 0x1b: case 0x1c: case 0x1d: case 0x1e: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } EVar33 = (EntityPtr)g_game->_room; VStack_2a0.y = (float)EVar33; FUN_00424510(); uStack_8 = 0; if (*(void **)((int)EVar33 + 0x1264) != (void *)0x0) { pvVar45 = (void *)0x0; do { pLVar22 = *(Level **) ((int)((PlayerCostumeMap *)((int)EVar33 + 0x125c))->_index + (int)pvVar45 * 4); if (pLVar22->_roomList[1].field_0xa7 == '\0') { puVar28 = pLVar22->_roomList[0].OverrideData; if (puVar28 == &DAT_00000005) { bVar4 = Entity_Pickup::CanReroll((Entity_Pickup *)pLVar22); if (((bVar4 != 0) && (pLVar22->_roomList[7].AllowedDoors == 0)) && (pLVar22->_roomList[0].AllowedDoors != 100)) { vecResult = &VStack_2dc; VStack_2dc.y = (float)pLVar22; goto LAB_007b2675; } } else if (((((*(int *)&g_game->_deathmatchManager < 2) || (puVar28 != (undefined1 *)0x1)) && ((puVar28 + -10 < (undefined1 *)0x3de && ((puVar28 != (undefined1 *)0x1 && (bVar4 = Entity::IsActiveEnemy((Entity *)pLVar22,0), bVar4 != 0)))))) && (pLVar22->_roomList[1].field_0xa7 == '\0')) && (cVar5 = Entity_NPC::CanReroll((Entity_NPC *)pLVar22), cVar5 != '\0')) { VStack_2c4.y = (float)pLVar22; vecResult = &VStack_2c4; LAB_007b2675: emplace_back<>(&vecResult->y); } } pvVar45 = (void *)((int)pvVar45 + 1); EVar33 = (EntityPtr)VStack_2a0.y; } while (pvVar45 < *(void **)((int)VStack_2a0.y + 0x1264)); this = (Entity_Player *)VStack_2d4.y; } VStack_2bc.y = 0.0; VStack_2f0.y = *(float *)(&DAT_00b6bbd8 + card * 4); if (targetsEnd - targetsBegin >> 2 != 0) { do { fVar51 = VStack_2bc.y; iVar41 = *(int *)(targetsBegin + (int)VStack_2bc.y * 4); if (((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar41 + 0x28) == 1)) || (*(int *)(iVar41 + 0x28) - 10U < 0x3de)) { uVar7 = Random(); iVar41 = *(int *)(targetsBegin + (int)fVar51 * 4); VStack_2cc.x = *(float *)(iVar41 + 0x33c); VStack_2cc.y = *(float *)(iVar41 + 0x340); Game::Spawn(g_game,1000,0xf,&VStack_2cc,&g_vectorZero,(Entity *)0x0,0,uVar7); } piVar37 = *(int **)(targetsBegin + (int)fVar51 * 4); VStack_2a0.y = 0.0; if (piVar37[10] == 5) { VStack_2a0.y = *(float *)(piVar37 + 0x14a); } (**(code **)(*piVar37 + 0x28))(); iVar41 = *(int *)(targetsBegin + (int)fVar51 * 4); VStack_2b4.x = *(float *)(iVar41 + 0x33c); VStack_2b4.y = *(float *)(iVar41 + 0x340); pRVar6 = g_game->_room; VStack_2d4.x = *(float *)(iVar41 + 0x33c); VStack_2d4.y = *(float *)(iVar41 + 0x340); iVar41 = Room::GetGridIndex(pRVar6,&VStack_2d4); uVar7 = Room::GetGridCollision(pRVar6,iVar41); if (uVar7 != 0) { vecResult = Room::FindFreePickupSpawnPosition (g_game->_room,&VStack_358,&VStack_2b4,0.0,0,0,0); VStack_2b4.x = vecResult->x; VStack_2b4.y = vecResult->y; } fVar51 = VStack_2bc.y; RStack_20c._seed = *(int *)(*(int *)(targetsBegin + (int)VStack_2bc.y * 4) + 0x3ec); RStack_20c._shift1 = 1; RStack_20c._shift2 = 5; RStack_20c._shift3 = 0x10; uStack_8._0_1_ = 1; uVar7 = RNG::Next(&RStack_20c); tmpEntity = Game::Spawn(g_game,5,(uint)VStack_2f0.y,&VStack_2b4,&g_vectorZero,(Entity *)this,0 ,uVar7); uStack_8 = (uint)uStack_8._1_3_ << 8; VStack_2bc.y = (float)((int)fVar51 + 1); tmpEntity[1]._sprite._championColor._tint[0] = VStack_2a0.y; } while ((uint)VStack_2bc.y < (uint)(targetsEnd - targetsBegin >> 2)); } uStack_8 = 0xffffffff; FID_conflict__Tidy(&targetsBegin); break; case 0x1f: g_game->_leaveDoor = -1; iVar41 = Level::QueryRoomTypeIndex(0xe,0,pRVar6,0); Game::StartRoomTransition(g_game,iVar41,-1,3,this,0); goto LAB_007b8998; case 0x20: use_card_hagalaz(0); break; case 0x21: Level::GetCurrentRoom(); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&jeraPickups,5,-1,-1,0,0); uStack_8 = 3; EVar33 = (EntityPtr)0x0; VStack_2bc.y = 0.0; iVar41 = EntityList::Size(); if (iVar41 != 0) { do { puVar27 = (undefined4 *)std::vector::operator_index(EVar33); bVar4 = Entity_Pickup::CanJeraDuplicate((Entity_Pickup *)*puVar27); if (bVar4 != 0) { pEVar29 = (EntityPtr *)std::vector::operator_index(EVar33); EVar33 = *pEVar29; VStack_2a0.y = (float)EVar33; VStack_2dc.y = (float)Entity::InitSeed((Entity *)EVar33); uVar7 = Entity::SubType((Entity *)EVar33); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Entity::Position((Entity *)VStack_2a0.y,&VStack_330); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_31c,vecResult,40.0,0,0,0); uVar30 = Entity::Variant((Entity *)VStack_2a0.y); this = (Entity_Player *)VStack_2d4.y; Game::Spawn(g_game,5,uVar30,vecResult,&g_vectorZero,(Entity *)VStack_2d4.y,uVar7, (uint)VStack_2dc.y); EVar33 = (EntityPtr)VStack_2bc.y; } EVar33 = (EntityPtr)((int)EVar33 + 1); VStack_2bc.y = (float)EVar33; EVar21 = (EntityPtr)EntityList::Size(); } while ((uint)EVar33 < (uint)EVar21); } itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x15,4,(Entity_Player *)0x0); uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&jeraPickups); break; case 0x22: UseActiveItem(this,(short *)((int)&uStack_2f8 + 2),0x54,1,-1,0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x16,4,(Entity_Player *)0x0); break; case 0x23: pLVar22 = (Level *)Config::GetCollectibles(); Level::RemoveCurses(pLVar22,0xffffffff); AddSoulHearts(this,2,0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x17,4,(Entity_Player *)0x0); Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 != '\0') { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x278); TemporaryEffect::TemporaryEffect(configItem); uStack_478 = 600; TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_480,1,1); } break; case 0x24: pLVar22 = (Level *)Config::GetCollectibles(); Level::ShowMap(pLVar22); pLVar22 = (Level *)Config::GetCollectibles(); Level::ApplyBlueMapEffect(pLVar22); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x18,4,(Entity_Player *)0x0); break; case 0x25: UseActiveItem(this,(short *)((int)&uStack_2f8 + 2),0x69,1,-1,0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x19,4,(Entity_Player *)0x0); break; case 0x26: iVar41 = 3; do { uVar7 = Random(); Game::Spawn(g_game,3,0xe7,&this->_pos,&g_vectorZero,(Entity *)this,0x19,uVar7); FUN_005b18f0(1); iVar41 = iVar41 + -1; } while (iVar41 != 0); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x1a,4,(Entity_Player *)0x0); break; case 0x27: itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x3a); TemporaryEffect::TemporaryEffect(configItem); uStack_468 = 600; TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_470,(byte)local_2a8,1); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x1b,4,(Entity_Player *)0x0); break; case 0x28: uVar7 = RNG::RandomInt((RNG *)pRVar6,4); if (uVar7 == 0) { if (VStack_2dc.y._0_1_ == '\0') { uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_330,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,300,vecResult,&g_vectorZero,(Entity *)this,0x28,uVar7); pRVar6 = local_298; } } uVar7 = RNG::RandomInt((RNG *)pRVar6,9); VStack_2b4.y = *(float *)(&DAT_00b6bc20 + uVar7 * 4); Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 != '\0') { Game::GetField26614(g_game); piVar37 = (int *)EntityList::Size(); cVar5 = (**(code **)(*piVar37 + 0x24))(VStack_2b4.y); if (cVar5 != '\0') { do { uVar7 = RNG::RandomInt((RNG *)pRVar6,9); pRVar20 = *(Room **)(&DAT_00b6bc20 + uVar7 * 4); VStack_2b4.y = (float)pRVar20; Game::GetField26614(g_game); piVar37 = (int *)EntityList::Size(); cVar5 = (**(code **)(*piVar37 + 0x24))(pRVar20); } while (cVar5 != '\0'); this = (Entity_Player *)VStack_2d4.y; } } UseCard(this,(int)VStack_2b4.y,0); break; case 0x29: if ((((this->_queuedItem)._item != (void *)0x0) && (cVar5 = Item::IsCollectible(), cVar5 != '\0')) && (bVar4 = Item::HasTags((this->_queuedItem)._item,0x8000), bVar4 == 0)) { speedStat = &this->_speedModifier; (this->_queuedItem)._item = (void *)0x0; fireDelayStat = &this->_fireDelayModifier; (this->_queuedItem)._charge = 0; damageStat = &this->_damageModifier; rangeStat = &this->_tearRangeModifier; shotSpeedStat = &this->_shotSpeedModifier; luckStat = &this->_luckModifier; uVar36 = FUN_005cbd00(0x29); FUN_005cbfe0(uVar36); *speedStat = *speedStat + 1; *fireDelayStat = *fireDelayStat + 1; uVar7 = Random(); this = (Entity_Player *)VStack_2d4.y; vecResult = (Vector *)Vector::Vector(); vecResult = Vector::__add((Vector *)((void **)((int)this + 0x24) + 0xc6),&VStack_31c,vecResult); Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); } Level::GetCurrentRoom((Level *)g_game); VStack_2b4.y = (float)Room::GetEntities(); uStack_2a2._1_1_ = 0; FUN_00424510(); uStack_8 = 4; pRVar6 = (Room *)0x0; VStack_2cc.y = 0.0; iVar41 = EntityList::Size(); if (iVar41 != 0) { do { std::vector::operator_index(pRVar6); local_298 = (Room *)FUN_00435e30(); if (((local_298 != (Room *)0x0) && (cVar5 = Entity_Pickup::IsShopItem((Entity_Pickup *)local_298), cVar5 == '\0')) && ((cVar5 = Entity::IsDead((Entity *)local_298), cVar5 == '\0' && (bVar4 = Entity_Pickup::CanReroll((Entity_Pickup *)local_298), bVar4 != 0)))) { iVar41 = Entity::Variant((Entity *)local_298); if (((iVar41 == 100) && (iVar41 = Entity::SubType((Entity *)local_298), iVar41 != 0)) && (iVar41 = Entity_Pickup::Timeout((Entity_Pickup *)local_298), iVar41 < 1)) { speedStat = (int *)&((Room *)this)->field_0x1520; uStack_2a2._1_1_ = 1; fireDelayStat = (int *)&((Room *)this)->field_0x1524; damageStat = (int *)&((Room *)this)->field_0x1528; rangeStat = (int *)&((Room *)this)->field_0x152c; shotSpeedStat = (int *)&((Room *)this)->field_0x1530; luckStat = (int *)&((Room *)this)->field_0x1534; uVar36 = FUN_005cbd00(0x29); FUN_005cbfe0(uVar36); *speedStat = *speedStat + 1; *fireDelayStat = *fireDelayStat + 1; uVar7 = Random(); vecResult = Entity::Position((Entity *)local_298,&VStack_330); vecResult2 = (Vector *)Vector::Vector(); vecResult = Vector::__add(vecResult,&VStack_360,vecResult2); Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); FUN_0060d1f0(4); Entity_Pickup::RemoveOtherOptions(); iVar41 = FUN_005b1960(); if (iVar41 != -1) { Game::GetPlayerManager(g_game); uVar7 = PlayerManager::GetNumAlivePlayers(); if (iVar41 + 1U < uVar7) { std::vector::push_back(&local_298); } } } else { iVar41 = Entity::Variant((Entity *)local_298); if ((iVar41 != 100) && (bVar4 = Entity_Pickup::CanReroll((Entity_Pickup *)local_298), bVar4 != 0)) { (**(code **)(*(int *)local_298 + 0x28))(); tmpEntity = (Entity *)0x0; vecResult = Entity::Position((Entity *)local_298,&VStack_368); AddBlueFlies(this,1,vecResult,tmpEntity); } } } puVar47 = (undefined1 *)((int)VStack_2cc.y + 1); VStack_2cc.y = (float)puVar47; puVar28 = (undefined1 *)EntityList::Size(); pRVar6 = (Room *)VStack_2cc.y; this = (Entity_Player *)VStack_2d4.y; } while (puVar47 < puVar28); } EVar33 = (EntityPtr)0x0; VStack_2bc.y = 0.0; iVar41 = std::vector::size(); if (iVar41 != 0) { VStack_2a0.y = (float)((void **)((int)VStack_2d4.y + 0x24) + 0xee); do { puVar27 = (undefined4 *)FUN_0042c810(EVar33); tmpEntity = (Entity *)*puVar27; iVar41 = FUN_005b1960(); Entity::Position(tmpEntity,&VStack_2dc); (**(code **)(*(int *)tmpEntity + 0x28))(); itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar7 = RNG::Next((RNG *)VStack_2a0.y); uVar7 = ItemPool::GetCollectible(itemPool,2,uVar7,0,0,0); uVar30 = RNG::Next((RNG *)VStack_2a0.y); tmpEntity = Game::Spawn(g_game,5,100,&VStack_2dc,&g_vectorZero,(Entity *)0x0,uVar7,uVar30); FUN_006e2ff0(iVar41 + 1); (**(code **)(*(int *)tmpEntity + 0xc))(); EVar33 = (EntityPtr)((int)VStack_2bc.y + 1); VStack_2bc.y = (float)EVar33; EVar21 = (EntityPtr)std::vector::size(); } while ((uint)EVar33 < (uint)EVar21); } FUN_007dc610(); this = (Entity_Player *)VStack_2d4.y; *(uint *)((int)VStack_2d4.y + 0x1574) = *(uint *)((int)VStack_2d4.y + 0x1574) | 0x41f; EvaluateItems(); UseActiveItem(this,(short *)((int)&uStack_2f8 + 2),0x23,1,-1,0); if (uStack_2a2._1_1_ != 0) { Level::GetCurrentRoom((Level *)g_game); iVar41 = GridEntity::GetVariant(); if (iVar41 != 0xb) { Level::GetCurrentRoom((Level *)g_game); iVar41 = GridEntity::GetVariant(); if (iVar41 != 0x11) goto LAB_007b4865; } ambush = (Ambush *)Game::GetAmbush(g_game); Ambush::StartChallenge(ambush); } LAB_007b4865: uStack_8 = 0xffffffff; FID_conflict__Tidy(auStack_328); break; case 0x2a: VStack_2dc.y = (float)&this->_lastVelocity; Vector::Normalized((Vector *)VStack_2dc.y,&VStack_2f0); bVar4 = Vector::operator_eq(&VStack_2f0,&g_vectorZero); if (bVar4 != 0) { Vector::operator_assign(&VStack_2f0,&this->_movementVector); } bVar4 = Vector::operator_eq(&VStack_2f0,&g_vectorZero); if (bVar4 != 0) { vecResult = (Vector *)Vector::Vector(); Vector::operator_assign(&VStack_2f0,vecResult); } uVar7 = Random(); VStack_2a0.y = 10.0; vecResult = Vector::__mul(&VStack_2f0,&VStack_398,&VStack_2a0.y); VStack_2bc.y = 0.5; vecResult2 = Vector::__mul((Vector *)VStack_2dc.y,&VStack_368,&VStack_2bc.y); VStack_2c4.y = 2.0; vecResult2 = Vector::__mul(vecResult2,&VStack_360,&VStack_2c4.y); vecResult = Vector::__add(vecResult,&VStack_31c,vecResult2); this = (Entity_Player *)VStack_2d4.y; Game::Spawn(g_game,2,9,(Vector *)((void **)((int)VStack_2d4.y + 0x24) + 0xc6),vecResult, (Entity *)VStack_2d4.y,0,uVar7); goto LAB_007b8998; case 0x2b: Level::GetCurrentRoom(); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&creditPickups,5,-1,-1,0,0); uStack_8 = 2; uVar7 = 0; iVar41 = EntityList::Size(); if (iVar41 != 0) { do { puVar27 = (undefined4 *)std::vector::operator_index(uVar7); VStack_2a0.y = (float)__RTDynamicCast(*puVar27,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup:: RTTI_Type_Descriptor,0); if (((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) && (iVar41 = Entity_Pickup::Price((Entity_Pickup *)VStack_2a0.y), iVar41 != 0)) { Entity_Pickup::update_price_sprite((Entity_Pickup *)VStack_2a0.y,0); } uVar7 = uVar7 + 1; uVar30 = EntityList::Size(); } while (uVar7 < uVar30); } uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&creditPickups); break; case 0x2c: VStack_2a0.y = RNG::RandomFloat((RNG *)pRVar6); if (0.05 <= VStack_2a0.y) { Game::ShowRule(); } else { FUN_0065d070(); } break; case 0x2d: play_sound_with_fart_seed(0x25,2,0,0x3f800000); Level::GetCurrentRoom((Level *)g_game); Room::SetCardAgainstHumanity(); break; case 0x2e: pcVar1 = *(code **)(*(int *)this + 0x24); sourceRef = EntityRef::EntityRef(&EStack_4d0); (*pcVar1)(sourceRef); *(undefined4 *)&this->_lastDamageFlags = 0; *(undefined4 *)((int)&this->_lastDamageFlags + 4) = 0; (this->_lastDamageSource)._type = 0; (this->_lastDamageSource)._variant = 0; VStack_2a0.y = 0.0; do { uVar7 = RNG::Next((RNG *)local_298); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_344,(Vector *)(((Room *)this)->_gridEntities + 0xc6),40.0, 0,0,0); uVar30 = RNG::RandomInt((RNG *)local_298,0xc); this = (Entity_Player *)VStack_2d4.y; Game::Spawn(g_game,5,*(uint *)(&DAT_00b6bbf0 + uVar30 * 4),vecResult,&g_vectorZero, (Entity *)VStack_2d4.y,0,uVar7); fVar51 = VStack_2a0.y; FUN_005b19f0(VStack_2a0.y); VStack_2a0.y = (float)((int)fVar51 + 1); } while ((int)VStack_2a0.y < 10); goto LAB_007b8998; case 0x2f: UseActiveItem(this,&uStack_2a2,0xaf,1,-1,0); break; case 0x30: iVar41 = this->_activeDesc[0]._item; if (iVar41 != 0) { if (iVar41 != 0x11e) { if ((((iVar41 == 0x1a6) && (hourglassState = Game::GetGlowingHourglassState(g_game), hourglassState != (GlowingHourglassState *)0x0)) && (-1 < this->_glowingHourglassIndex)) && (hourglassState = Game::GetGlowingHourglassState(g_game), hourglassState != (GlowingHourglassState *)0x0)) { VStack_2a0.y = (float)(hourglassState->_eventCounters + this->_glowingHourglassIndex * 0x177 + -0x182d); VStack_2b4.y = 0.0; pfVar16 = (float *)((int)VStack_2a0.y + 0x104); LAB_007b3be0: cVar5 = FUN_00753630(); if ((cVar5 == '\0') || (*pfVar16 != 6.72623e-44)) goto LAB_007b3bf0; if ((uint)VStack_2b4.y < (Room *)0x3) { puVar27 = (undefined4 *)((int)VStack_2b4.y * 8 + 0x10c + (int)VStack_2a0.y); puVar46 = (undefined4 *)((int)VStack_2b4.y * 8 + 0x104 + (int)VStack_2a0.y); for (uVar7 = (3 - (int)VStack_2b4.y) * 2 & 0x3ffffffe; uVar7 != 0; uVar7 = uVar7 - 1) { *puVar46 = *puVar27; puVar27 = puVar27 + 1; puVar46 = puVar46 + 1; } this = (Entity_Player *)VStack_2d4.y; } FUN_00753620(); } LAB_007b3c4c: UseActiveItem(this,(short *)((int)&uStack_2f8 + 2), ((ActiveItemDesc *)&((Room *)this)->field_0x1580)->_item,4,0,0); TriggerBookOfVirtues(((ActiveItemDesc *)&((Room *)this)->field_0x1580)->_item,0); goto LAB_007b8998; } pLVar22 = (Level *)Config::GetCollectibles(); bVar4 = Level::IsNextStageAvailable(pLVar22); if (bVar4 == 0) { uVar7 = Random(); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_31c,&this->_pos,0.0,0,0,0); Game::Spawn(g_game,0x11,2,vecResult,&g_vectorZero,(Entity *)this,0,uVar7); } else { Config::GetCollectibles(); FUN_00428ae0(0xffffffff); Game::StartRoomTransition(g_game,-2,-1,3,this,-1); } RemoveCollectible(this,this->_activeDesc[0]._item,0,0,1); } break; case 0x31: UseActiveItem(this,&uStack_2a2,0x69,1,-1,0); UseActiveItem(this,(short *)((int)&uStack_2f8 + 2),0xa6,1,-1,0); break; case 0x32: Level::GetCurrentRoom(); VStack_2a0.y = (float)Room::GetEntities(); pRVar6 = (Room *)0x0; VStack_2c4.x = 0.0; VStack_2c4.y = 0.0; VStack_2b4.y = 0.0; iVar41 = EntityList::Size(); if (iVar41 != 0) { do { puVar27 = (undefined4 *)std::vector::operator_index(pRVar6); bVar4 = Entity::IsVulnerableEnemy((Entity *)*puVar27,(Entity *)0x0); if (bVar4 != 0) { if (VStack_2c4.x == 0.0) { pfVar16 = (float *)std::vector::operator_index(pRVar6); VStack_2c4.x = *pfVar16; } else { if ((Entity *)VStack_2c4.y != (Entity *)0x0) { VStack_2dc.y = (float)Entity::Position((Entity *)VStack_2c4.y,&VStack_31c); VStack_2bc.y = (float)Entity::Position((Entity *)VStack_2c4.x,&VStack_360); puVar27 = (undefined4 *)std::vector::operator_index(pRVar6); vecResult = Entity::Position((Entity *)*puVar27,&VStack_368); vecResult2 = Entity::Position((Entity *)VStack_2c4.x,&VStack_398); VStack_2dc.y = Vector::DistanceSquared((Vector *)VStack_2dc.y,(Vector *)VStack_2bc.y); VStack_2bc.y = Vector::DistanceSquared(vecResult,vecResult2); pRVar6 = (Room *)VStack_2b4.y; if (VStack_2bc.y <= VStack_2dc.y) goto LAB_007b3d9f; } pfVar16 = (float *)std::vector::operator_index(pRVar6); VStack_2c4.y = *pfVar16; } } LAB_007b3d9f: pRVar6 = (Room *)&pRVar6->field_0x1; VStack_2b4.y = (float)pRVar6; puVar28 = (undefined1 *)EntityList::Size(); } while (pRVar6 < puVar28); } VStack_2a0.y = 0.0; do { EVar33 = *(EntityPtr *)(&VStack_2c4.x + (int)VStack_2a0.y); VStack_2bc.y = (float)EVar33; if (EVar33 != (EntityPtr)0x0) { uVar7 = Random(); vecResult = Entity::Position((Entity *)EVar33,&VStack_31c); vecResult2 = (Vector *)Vector::Vector(); vecResult = Vector::__add(vecResult,&VStack_368,vecResult2); uVar52 = 0; pTVar49 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar48 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar36 = 0; tmpEntity = Game::Spawn(g_game,1000,0x5b,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); effect = (Entity_Effect *)__RTDynamicCast(tmpEntity,uVar36,pTVar48,pTVar49,uVar52); fVar51 = VStack_2bc.y; Entity::SetTarget((Entity *)effect,(Entity *)VStack_2bc.y); Entity_Effect::SetTimeout(effect,0x96); (**(code **)(*(int *)effect + 0xc))(); npc = (Entity_NPC *) __RTDynamicCast(fVar51,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); vecResult = Entity::Position((Entity *)fVar51,&VStack_330); Entity_NPC::hold_set(npc,0x96,vecResult); } VStack_2a0.y = (float)((int)VStack_2a0.y + 1); this = (Entity_Player *)VStack_2d4.y; } while ((int)VStack_2a0.y < 2); break; case 0x33: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x2e); if (bVar4 == 0) { bVar4 = (byte)local_2a8; TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x2e,bVar4,1); TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x139,bVar4,1); } break; case 0x34: Game::ShakeScreen(g_game,0x1e); itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x29); cVar5 = vector_contains_int(configItem); if (cVar5 == '\0') { itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x29); TemporaryEffect::TemporaryEffect(configItem); TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_390,(byte)local_2a8,1); TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x12e,0,1); } break; case 0x35: pRVar20 = (Room *)Level::GetCurrentRoom(); Room::FindFreePickupSpawnPosition(pRVar20,&pickupPos,&this->_pos,0.0,0,0,0); VStack_2a0.y = (float)&this->_cardRNGs; VStack_2b4.y = 0.0; do { uVar7 = RNG::Next((RNG *)pRVar6); Game::GetItemPool(g_game); rngSource = (RNG *)FUN_005cbd00(0x35); uVar30 = RNG::Next(rngSource); uVar30 = ItemPool::GetCard(uVar30,1,0,0); vecResult = Vector::FromAngle(&VStack_374,(float)(int)VStack_2b4.y * -90.0); VStack_2dc.y = 2.0; vecResult = Vector::__mul(vecResult,&VStack_300,&VStack_2dc.y); this = (Entity_Player *)VStack_2d4.y; Game::Spawn(g_game,5,300,&pickupPos,vecResult,(Entity *)VStack_2d4.y,uVar30,uVar7); VStack_2b4.y = (float)((int)VStack_2b4.y + 1); pRVar6 = local_298; } while ((int)VStack_2b4.y < 3); break; case 0x36: itemConfig = Isaac::GetItemConfig(); configItem = Config::GetNullItem(itemConfig,0x2a); TemporaryEffect::TemporaryEffect(configItem); TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_390,1,1); Level::GetCurrentRoom((Level *)g_game); playerEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(playerEffects,0xe8,1,1); break; case 0x37: VStack_2b4.y = (float)RNG::RandomInt((RNG *)pRVar6,8); Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 != '\0') { pRVar20 = (Room *)VStack_2b4.y; do { if ((pRVar20 != (Room *)0x0) && (pRVar20 != (Room *)&DAT_00000006)) break; pRVar20 = (Room *)RNG::RandomInt((RNG *)pRVar6,8); VStack_2b4.y = (float)pRVar20; Game::GetField26614(g_game); cVar5 = FUN_00429550(); } while (cVar5 != '\0'); this = (Entity_Player *)VStack_2d4.y; } switch(VStack_2b4.y) { case 0.0: VStack_2dc.y = (float)Config::GetCollectibles(); uVar7 = Level::GetCurrentRoomIndex((Level *)VStack_2dc.y); if (-1 < (int)uVar7) { if (uVar7 < 0xa9) { pRVar6 = (Room *)((int)uVar7 / 0xd); VStack_2bc.y = (float)((int)uVar7 % 0xd); local_298 = (Room *)((int)VStack_2bc.y + -3); VStack_2c4.y = (float)((int)VStack_2bc.y + 3); VStack_2b4.y = (float)pRVar6; if ((int)local_298 <= (int)((int)VStack_2bc.y + 3)) { VStack_2cc.y = -NAN; do { fVar51 = VStack_2cc.y; if (((undefined1 *)((int)VStack_2cc.y + (int)VStack_2bc.y) < (undefined1 *)0xd) && ((int)&pRVar6[-1].field_0x7895 <= (int)&pRVar6->field_0x3)) { uVar7 = 0xfffffffd; VStack_2a0.y = 9.80909e-45; iVar41 = (int)local_298->_gridEntities + (int)&pRVar6[-1].field_0x7895 * 0xd + -0x24 ; do { if ((int)pRVar6->_gridEntities + (uVar7 - 0x24) < 0xd) { if ((int)((((uint)fVar51 ^ (int)fVar51 >> 0x1f) - ((int)fVar51 >> 0x1f)) + ((uVar7 ^ (int)uVar7 >> 0x1f) - ((int)uVar7 >> 0x1f))) < 4) { roomDesc = Level::GetRoomByIdx((Level *)VStack_2dc.y,iVar41,-1); pRVar6 = (Room *)VStack_2b4.y; fVar51 = VStack_2cc.y; if (roomDesc->Data != (void *)0x0) { roomDesc->DisplayFlags = roomDesc->DisplayFlags | 5; } } else { pRVar6 = (Room *)VStack_2b4.y; fVar51 = VStack_2cc.y; } } uVar7 = uVar7 + 1; iVar41 = iVar41 + 0xd; VStack_2a0.y = (float)((int)VStack_2a0.y + -1); } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; } local_298 = (Room *)&local_298->field_0x1; VStack_2cc.y = (float)((int)fVar51 + 1); } while ((int)local_298 <= (int)VStack_2c4.y); this = (Entity_Player *)VStack_2d4.y; } } } minimap = (Minimap *)FUN_00738380(); Minimap::Refresh(minimap); break; case 1.4013e-45: Game::GetItemPool(g_game); ItemPool::ResetRoomBlacklist(); Level::GetCurrentRoom((Level *)g_game); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&shardCollectibles,5,100,-1,0,0); uStack_8 = 5; uVar30 = 0xb; local_298 = (Room *)0x0; uVar7 = EntityPtr::Ref(); RNG::game_constructor(&shardRng,uVar7,uVar30); uStack_8 = CONCAT31(uStack_8._1_3_,6); uVar7 = RNG::RandomInt(&shardRng,2); VStack_2a0.y = (float)((-(uint)(uVar7 != 0) & 0xffffffdc) + 0x24); iVar41 = EntityList::Size(); if (iVar41 != 0) { uVar7 = 0; do { puVar27 = (undefined4 *)std::vector::operator_index(uVar7); tmpEntity = (Entity *)*puVar27; cVar5 = Entity::IsDead(tmpEntity); if ((cVar5 == '\0') && (iVar41 = Entity::SubType(tmpEntity), iVar41 != 0)) { pRVar6 = (Room *)__RTDynamicCast(tmpEntity,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup:: RTTI_Type_Descriptor,0); bVar4 = Entity_Pickup::CanReroll((Entity_Pickup *)pRVar6); if (((bVar4 != 0) && ((iVar41 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)pRVar6), iVar41 == 0 || (iVar41 = Entity_Pickup::Timeout((Entity_Pickup *)pRVar6), iVar41 < 0)))) && ((uVar30 = RNG::Next(&shardRng), local_298 == (Room *)0x0 || (uVar30 != 0)))) { local_298 = pRVar6; } } pRVar6 = local_298; uVar7 = uVar7 + 1; uVar30 = EntityList::Size(); this = (Entity_Player *)VStack_2d4.y; } while (uVar7 < uVar30); if (pRVar6 != (Room *)0x0) { iVar41 = Entity::Variant((Entity *)pRVar6); iVar17 = Entity::Type((Entity *)local_298); Entity_Pickup::Morph((Entity_Pickup *)local_298,iVar17,iVar41,(int)VStack_2a0.y,1,0,0); FUN_005b1950(0); } } guard_check_icall(); uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&shardCollectibles); break; case 2.8026e-45: uVar7 = Random(); Game::Spawn(g_game,3,0xe7,(Vector *)(((Room *)this)->_gridEntities + 0xc6),&g_vectorZero, (Entity *)this,0x19,uVar7); FUN_005b18f0(1); break; case 4.2039e-45: itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x3a); TemporaryEffect::TemporaryEffect(configItem); RStack_22c._shift2 = 0x5a; TemporaryEffects::AddEffect ((TemporaryEffects *)&((Room *)this)->field_0x1508,&RStack_22c,(byte)local_2a8,1); break; case 5.60519e-45: use_card_hagalaz(pRVar6); break; case 7.00649e-45: UseActiveItem(this,(short *)((int)&uStack_30c + 2),0x1dc,1,-1,0); break; case 8.40779e-45: UseActiveItem(this,(short *)((int)&VStack_314.y + 2),0x54,1,-1,0); break; case 9.80909e-45: AddSoulHearts(this,1,0); } break; case 0x38: iVar41 = 0; VStack_2bc.x = (float)this; uVar7 = 0; VStack_2bc.y = (float)this->_subPlayer; EVar33 = (EntityPtr)0x0; VStack_314.y = 0.0; EStack_2f4 = (EntityPtr)0x0; VStack_2b4.y = 0.0; uStack_2f8 = 0; VStack_2cc.y = 0.0; uStack_30c = 0; local_2a8 = 0; VStack_2a0.y = 0.0; do { player = (Entity_Player *)(&VStack_2bc.x)[(int)VStack_2a0.y]; if (player != (Entity_Player *)0x0) { uStack_2f8 = uStack_2f8 + player->_eternalHearts; VStack_2cc.y = (float)((int)VStack_2cc.y + player->_goldenHearts); VStack_2f0.y = (float)player->_rottenHearts; local_2ac = player->_redHearts; player->_eternalHearts = 0; player->_goldenHearts = 0; uStack_2e8 = (float)FUN_00759260(); EStack_2e4 = (EntityPtr)player->_soulHearts; VStack_2c4.y = (float)player->_boneHearts; if ((player->_redHearts < 1) || (player->_maxHearts < 1)) { if (player->_boneHearts < 1) { if (0 < (int)EStack_2e4) { AddSoulHearts(player,1 - (int)EStack_2e4,0); } } else { AddHearts(player,-player->_redHearts,0,0); AddSoulHearts(player,-player->_soulHearts,0); player->_boneHearts = 1; update_bone_hearts(player); } } else { iVar17 = GetHealthType(player); iVar41 = player->_redHearts; if (iVar17 == 3) { if (2 < iVar41) { iVar17 = 2; goto LAB_007b4f9f; } } else if (1 < iVar41) { iVar17 = 1; LAB_007b4f9f: AddHearts(player,iVar17 - iVar41,0,0); } AddSoulHearts(player,-player->_soulHearts,0); player->_boneHearts = 0; update_bone_hearts(player); } VStack_2f0.y = (float)((int)VStack_2f0.y - player->_rottenHearts); local_2ac = (local_2ac + (int)VStack_2f0.y * -2) - player->_redHearts; iVar41 = FUN_00759260(); uStack_2e8 = (float)((int)uStack_2e8 - iVar41); EStack_2e4 = (EntityPtr)(((int)EStack_2e4 + (int)uStack_2e8 * -2) - player->_soulHearts); if ((0 < (int)local_2ac) && (iVar41 = GetHealthType(player), iVar41 == 3)) { iVar41 = local_2ac + 1; local_2ac = 0; local_2a8 = local_2a8 + iVar41 / 2; } EVar33 = EStack_2e4; if ((int)EStack_2e4 < 0) { iVar41 = (1 - (int)EStack_2e4) / 2; uStack_2e8 = (float)((int)uStack_2e8 - iVar41); EVar33 = (EntityPtr)((int)EStack_2e4 + iVar41 * 2); } fVar51 = (float)((int)VStack_2c4.y - player->_boneHearts); uVar7 = uVar7 + local_2ac; VStack_2c4.y = fVar51; VStack_314.y = (float)((int)((int)VStack_2f0.y + 0x24) + (int)VStack_314.y + -0x24); VStack_2b4.y = (float)((int)VStack_2b4.y + (int)uStack_2e8); EVar33 = (EntityPtr)((int)EStack_2f4 + (int)EVar33); uStack_30c = uStack_30c + (int)fVar51; iVar41 = local_2a8; EStack_2f4 = EVar33; } this = (Entity_Player *)VStack_2d4.y; VStack_2a0.y = (float)((int)VStack_2a0.y + 1); } while ((uint)VStack_2a0.y < 2); if (0 < *(int *)((int)VStack_2d4.y + 0x1da8)) { EStack_2f4 = (EntityPtr)((int)EVar33 + *(int *)((int)VStack_2d4.y + 0x1da8)); *(undefined4 *)((int)VStack_2d4.y + 0x1da8) = 0; } uVar30 = uVar7; if (0 < *(int *)((int)VStack_2d4.y + 0x1dac)) { uVar30 = uVar7 + *(int *)((int)VStack_2d4.y + 0x1dac); *(undefined4 *)((int)VStack_2d4.y + 0x1dac) = 0; } local_2a8 = iVar41 + *(int *)((int)VStack_2d4.y + 0x1368); VStack_2bc.y = *(float *)((int)VStack_2d4.y + 0x1dd4); VStack_2dc.y = (float)(uint)(*(undefined1 *)((int)VStack_2d4.y + 0x1361) != '\0'); EStack_2e4 = (EntityPtr)(*(int *)((int)VStack_2d4.y + 0x1364) - (int)VStack_2bc.y); uStack_2e8 = *(float *)((int)VStack_2d4.y + 0x135c); *(undefined4 *)((int)VStack_2d4.y + 0x1368) = 0; VStack_2a0.y = (float)(uint)(*(undefined1 *)((int)VStack_2d4.y + 0x1360) != '\0'); *(undefined4 *)((int)VStack_2d4.y + 0x1364) = 0; *(undefined4 *)((int)VStack_2d4.y + 0x1dd4) = 0; *(undefined1 *)((int)VStack_2d4.y + 0x1361) = 0; *(undefined4 *)((int)VStack_2d4.y + 0x135c) = 0; *(undefined1 *)((int)VStack_2d4.y + 0x1360) = 0; local_2ac = uVar7; FUN_005b19d0(); shiftidx = 0x2c; uVar7 = RNG::Next((RNG *)local_298); RNG::game_constructor(&tmpRng,uVar7,shiftidx); uStack_8 = 7; VStack_2f0.y = (float)((void **)((int)this + 0x24) + 0xc6); if (0 < (int)uVar30) { do { iVar41 = nullsub_7dd380(); if ((int)uVar30 < iVar41) { iVar41 = nullsub_7dd380(); if ((int)uVar30 < iVar41) { VStack_2c4.y = 2.8026e-45; } else { VStack_2c4.y = 1.4013e-45; } } else { VStack_2c4.y = 7.00649e-45; } iVar41 = nullsub_7dd380(); local_2ac = uVar30 - iVar41; uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_300,(Vector *)((void **)((int)this + 0x24) + 0xc6),40.0, 0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,(uint)VStack_2c4.y,uVar7); uVar30 = local_2ac; } while (0 < (int)local_2ac); } VStack_2c4.y = (float)((void **)((int)this + 0x24) + 0xc6); fVar51 = VStack_314.y; EVar33 = EStack_2f4; if (0 < (int)VStack_314.y) { do { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_300,(Vector *)VStack_2c4.y,40.0,0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,0xc,uVar7); VStack_314.y = (float)((int)VStack_314.y + -1); fVar51 = 0.0; EVar33 = EStack_2f4; } while (VStack_314.y != 0.0); } while( true ) { VStack_314.y = fVar51; EStack_2f4 = EVar33; if ((int)EVar33 < 1) break; iVar41 = nullsub_7dd380(); if ((int)EVar33 < iVar41) { VStack_2c4.y = (float)&DAT_00000008; } else { VStack_2c4.y = 4.2039e-45; } iVar41 = nullsub_7dd380(); EStack_2f4 = (EntityPtr)((int)EVar33 - iVar41); uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_300,(Vector *)((void **)((int)this + 0x24) + 0xc6),40.0,0, 0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,(uint)VStack_2c4.y,uVar7); fVar51 = VStack_314.y; EVar33 = EStack_2f4; } VStack_2c4.y = 0.0; iVar41 = nullsub_7dd380(); if (0 < iVar41) { do { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_300,(Vector *)((void **)((int)this + 0x24) + 0xc6),40.0, 0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,6,uVar7); fVar51 = (float)((int)VStack_2c4.y + 1); VStack_2c4.y = fVar51; iVar41 = nullsub_7dd380(); } while ((int)fVar51 < iVar41); } if (0 < uStack_30c) { do { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_300,(Vector *)((void **)((int)this + 0x24) + 0xc6),40.0, 0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,0xb,uVar7); uStack_30c = uStack_30c + -1; } while (uStack_30c != 0); } if (0 < uStack_2f8) { do { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_374,(Vector *)((void **)((int)this + 0x24) + 0xc6),40.0, 0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,4,uVar7); uStack_2f8 = uStack_2f8 + -1; } while (uStack_2f8 != 0); } local_298 = (Room *)((void **)((int)this + 0x24) + 0xc6); if (0 < (int)VStack_2cc.y) { do { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_330,(Vector *)((void **)((int)this + 0x24) + 0xc6),40.0, 0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,7,uVar7); VStack_2cc.y = (float)((int)VStack_2cc.y + -1); } while (VStack_2cc.y != 0.0); VStack_2f0.y = (float)((void **)((int)this + 0x24) + 0xc6); VStack_2cc.y = 0.0; } VStack_2b4.y = (float)local_298; if (0 < (int)local_2a8) { do { if (local_2a8 < 100) { if (0x18 < local_2a8) { uVar7 = 0x4a; local_2a8 = local_2a8 - 0x19; goto LAB_007b5662; } VStack_2c4.y = 2.8026e-44; if (local_2a8 < 10) { if (local_2a8 < 5) { if (local_2a8 < 2) { uVar7 = 1; local_2a8 = local_2a8 - 1; } else { uVar7 = 4; local_2a8 = local_2a8 - 2; } } else { uVar7 = 2; local_2a8 = local_2a8 - 5; } } else { uVar7 = 3; local_2a8 = local_2a8 - 10; } local_298 = (Room *)RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); fVar51 = 40.0; } else { uVar7 = 0x12; local_2a8 = local_2a8 - 100; LAB_007b5662: VStack_2c4.y = 1.4013e-43; local_298 = (Room *)RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); fVar51 = 10.0; } vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_31c,(Vector *)VStack_2f0.y,fVar51,0,0,0); fVar51 = VStack_2c4.y; tmpEntity = Game::Spawn(g_game,5,(uint)VStack_2c4.y,vecResult,&g_vectorZero,(Entity *)this,uVar7 ,(uint)local_298); VStack_2c4.y = (float)tmpEntity; if (fVar51 == 1.4013e-43) { uVar7 = Random(); vecResult = Entity::Position((Entity *)VStack_2c4.y,&VStack_360); Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); } } while (0 < (int)local_2a8); local_298 = (Room *)VStack_2f0.y; } VStack_2cc.y = VStack_2b4.y; if (0 < (int)EStack_2e4) { do { if ((uint)EStack_2e4 < 99) { if (9 < (uint)EStack_2e4) { uVar7 = 0x13; EStack_2e4 = (EntityPtr)((int)EStack_2e4 + -10); goto LAB_007b57d2; } VStack_2c4.y = 5.60519e-44; if ((uint)EStack_2e4 < 2) { uVar7 = 1; EStack_2e4 = (EntityPtr)((int)EStack_2e4 + -1); } else { uVar7 = 2; EStack_2e4 = (EntityPtr)((int)EStack_2e4 + -2); } VStack_2b4.y = (float)RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); fVar51 = 40.0; } else { uVar7 = 0xbe; EStack_2e4 = (EntityPtr)((int)EStack_2e4 + -99); LAB_007b57d2: VStack_2c4.y = 1.4013e-43; VStack_2b4.y = (float)RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); fVar51 = 10.0; } vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_368,(Vector *)local_298,fVar51,0,0,0); fVar51 = VStack_2c4.y; tmpEntity = Game::Spawn(g_game,5,(uint)VStack_2c4.y,vecResult,&g_vectorZero,(Entity *)this,uVar7 ,(uint)VStack_2b4.y); VStack_2c4.y = (float)tmpEntity; if (fVar51 == 1.4013e-43) { uVar7 = Random(); vecResult = Entity::Position((Entity *)VStack_2c4.y,&VStack_398); Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); } } while (0 < (int)EStack_2e4); VStack_2b4.y = (float)local_298; } for (; VStack_2dc.y != 0.0; VStack_2dc.y = (float)((int)VStack_2dc.y - 1)) { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_344,(Vector *)VStack_2b4.y,40.0,0,0,0); Game::Spawn(g_game,5,0x28,vecResult,&g_vectorZero,(Entity *)this,4,uVar7); } VStack_2dc.y = 0.0; fVar51 = uStack_2e8; EVar33 = (EntityPtr)VStack_2bc.y; if (0 < (int)VStack_2bc.y) { do { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&spawnPos,(Vector *)VStack_2cc.y,40.0,0,0,0); Game::Spawn(g_game,5,0x28,vecResult,&g_vectorZero,(Entity *)this,7,uVar7); VStack_2bc.y = (float)((int)VStack_2bc.y + -1); fVar51 = uStack_2e8; EVar33 = (EntityPtr)0x0; } while ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0); } while (VStack_2bc.y = (float)EVar33, 0 < (int)fVar51) { if ((uint)fVar51 < 99) { VStack_2c4.y = 4.2039e-44; if ((uint)fVar51 < 2) { VStack_2dc.y = 1.4013e-45; fVar51 = (float)((int)fVar51 - 1); } else { VStack_2dc.y = 4.2039e-45; fVar51 = (float)((int)fVar51 - 2); } uStack_2e8 = fVar51; VStack_2bc.y = (float)RNG::Next(&tmpRng); pRVar20 = (Room *)Level::GetCurrentRoom((Level *)g_game); pRVar6 = (Room *)0x42200000; } else { VStack_2bc.y = (float)RNG::Next(&tmpRng); VStack_2f0.y = 10.0; fVar51 = (float)((int)fVar51 - 99); VStack_2c4.y = 1.4013e-43; VStack_2dc.y = (float)&DAT_00000011; uStack_2e8 = fVar51; pRVar20 = (Room *)Level::GetCurrentRoom((Level *)g_game); pRVar6 = (Room *)VStack_2f0.y; } vecResult = Room::FindFreePickupSpawnPosition (pRVar20,&spawnPos2,(Vector *)VStack_2cc.y,(float)pRVar6,0,0,0); VStack_2bc.y = (float)Game::Spawn(g_game,5,(uint)VStack_2c4.y,vecResult,&g_vectorZero, (Entity *)this,(uint)VStack_2dc.y,(uint)VStack_2bc.y); EVar33 = (EntityPtr)VStack_2bc.y; if (VStack_2c4.y == 1.4013e-43) { uVar7 = Random(); vecResult = Entity::Position((Entity *)VStack_2bc.y,&VStack_358); Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); fVar51 = uStack_2e8; EVar33 = (EntityPtr)VStack_2bc.y; } } for (; VStack_2a0.y != 0.0; VStack_2a0.y = (float)((int)VStack_2a0.y - 1)) { uVar7 = RNG::Next(&tmpRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_2bc,(Vector *)VStack_2cc.y,40.0,0,0,0); Game::Spawn(g_game,5,0x1e,vecResult,&g_vectorZero,(Entity *)this,2,uVar7); } iVar41 = 2; VStack_2a0.y = 0.0; do { pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(pRVar6,&pickupPos,(Vector *)VStack_2cc.y,0.0,0,0,0); DropTrinket(this,&pickupPos,0); iVar41 = iVar41 + -1; } while (iVar41 != 0); uVar30 = GetMaxPocketItems(this); uVar7 = 0; if (uVar30 != 0) { do { pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition (pRVar6,&VStack_300,(Vector *)VStack_2cc.y,0.0,0,0,0); DropPocketItem(this,uVar7,vecResult); uVar7 = uVar7 + 1; uVar30 = GetMaxPocketItems(this); } while (uVar7 < uVar30); } if (uStack_2a2._1_1_ != 0) { Config::GetCollectibles(); EVar33 = (EntityPtr)FUN_0042c7f0(); FUN_00424510(); uStack_8._0_1_ = 8; if (0 < (int)EVar33) { joined_r0x007b5c54: EVar33 = (EntityPtr)((int)EVar33 + -1); VStack_2a0.y = (float)EVar33; if (-1 < (int)EVar33) { Config::GetCollectibles(); iVar41 = FUN_005cbe00(EVar33); if (*(char *)(iVar41 + 4) == '\0') { Config::GetCollectibles(); iVar41 = FUN_005cbe00(EVar33); VStack_2b4.y = *(float *)(iVar41 + 8); bVar4 = CanRerollCollectible(this,(int)VStack_2b4.y,0); if (bVar4 != 0) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,(int)VStack_2b4.y); if (configItem->type != 3) { VStack_2bc.y = (float)&(((Room *)this)->_fxLayers).field_0xb0; iVar41 = 0; piVar37 = (int *)FUN_0042c810(VStack_2b4.y); EVar33 = (EntityPtr)VStack_2a0.y; if (0 < *piVar37) { do { uVar7 = std::vector::size(); this = (Entity_Player *)VStack_2d4.y; EVar33 = (EntityPtr)VStack_2a0.y; if (2 < uVar7) break; std::vector::push_back(&VStack_2b4.y); iVar41 = iVar41 + 1; piVar37 = (int *)FUN_0042c810(VStack_2b4.y); this = (Entity_Player *)VStack_2d4.y; EVar33 = (EntityPtr)VStack_2a0.y; } while (iVar41 < *piVar37); } } } } goto joined_r0x007b5c54; } uVar7 = 0; iVar41 = std::vector::size(); if (iVar41 != 0) { do { piVar37 = (int *)FUN_0042c810(uVar7); DropCollectible(this,*piVar37,(Entity_Pickup *)0x0,1); uVar7 = uVar7 + 1; uVar30 = std::vector::size(); } while (uVar7 < uVar30); } } uStack_8 = CONCAT31(uStack_8._1_3_,7); FID_conflict__Tidy(auStack_328); } FUN_005b19d0(); ConsumableCountChanged(this,-1); Game::GetHUD(g_game); FUN_009a6110(1); uStack_8 = 0xffffffff; guard_check_icall(); break; case 0x39: TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x3c,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x3c,(byte)local_2a8,1); break; case 0x3a: TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x3d,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x3d,(byte)local_2a8,1); break; case 0x3b: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x3e); if (bVar4 == 0) { itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x2a,3,(Entity_Player *)0x0); } iVar41 = this->_reverseEmpressMaxHearts; this->_reverseEmpressMaxHearts = 0; TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x3e,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x3e,(byte)local_2a8,1); this->_reverseEmpressMaxHearts = iVar41; VStack_2a0.y = (float)(((uint)uStack_2a2._1_1_ - iVar41) + 2); if (0 < (int)VStack_2a0.y) { do { iVar41 = GetHeartLimit(this,0); iVar17 = GetEffectiveMaxHearts(this); if (iVar17 < iVar41) { this->_reverseEmpressMaxHearts = this->_reverseEmpressMaxHearts + 1; AddMaxHearts(this,2,0); } AddHearts(this,2,0,0); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); } while ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0); VStack_2a0.y = 0.0; } break; case 0x3c: pLVar22 = (Level *)Config::GetCollectibles(); rngSource = (RNG *)FUN_005cbd00(0x3c); uVar7 = RNG::Next(rngSource); Level::TryInitializeExtraBossRoom(pLVar22,uVar7); pLVar22 = (Level *)Config::GetCollectibles(); roomDesc = Level::GetRoomByIdx(pLVar22,-0x11,-1); if (roomDesc->Data == (void *)0x0) { rngSource = (RNG *)FUN_005cbd00(0x3c); uVar7 = RNG::Next(rngSource); Game::MoveToRandomRoom(g_game,0,uVar7,this); } else { Config::GetCollectibles(); FUN_00428ae0(0xffffffff); Game::StartRoomTransition(g_game,-0x11,-1,3,this,0); } goto LAB_007b8998; case 0x3d: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } VStack_2a0.y = (float)(uStack_2a2._1_1_ + 2); do { uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,0xb,uVar7); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); pRVar6 = local_298; } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; break; case 0x3e: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } VStack_2a0.y = (float)(uStack_2a2._1_1_ + 1); VStack_2dc.y = (float)&this->_pos; do { EVar33 = (EntityPtr)RNG::Next((RNG *)pRVar6); VStack_2bc.y = (float)EVar33; pRVar20 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar7 = Room::GetSeededCollectible(pRVar20,(uint)EVar33,0); Game::GetField26614(g_game); cVar5 = FUN_00429550(); fVar51 = VStack_2bc.y; if (cVar5 != '\0') { do { Game::GetField26614(g_game); piVar37 = (int *)EntityList::Size(); cVar5 = (**(code **)(*piVar37 + 0x30))(uVar7); if (cVar5 == '\0') break; pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar7 = Room::GetSeededCollectible(pRVar6,(uint)fVar51,0); Game::GetField26614(g_game); cVar5 = FUN_00429550(); } while (cVar5 != '\0'); pRVar6 = local_298; } pRVar20 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(pRVar20,&VStack_2cc,(Vector *)VStack_2dc.y,40.0,0,0,0); uVar30 = RNG::Next((RNG *)pRVar6); Game::Spawn(g_game,5,100,&VStack_2cc,&g_vectorZero,(Entity *)0x0,uVar7,uVar30); uVar7 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xf,&VStack_2cc,&g_vectorZero,(Entity *)0x0,0,uVar7); pcVar1 = *(code **)(*(int *)tmpEntity + 0x3c); uVar36 = Color::Color(0x3f800000,0x40000000,0x3ecccccd,0x3ecccccd,0x3f800000,0,0,0); (*pcVar1)(uVar36,0xffffffff,0xff,0,1); SoundEffects::PlayWithFartOverride(0x13c,2,0,0x3f800000); this = (Entity_Player *)VStack_2d4.y; if (*(int *)((int)VStack_2d4.y + 0x1340) < 1) { if (*(int *)((int)VStack_2d4.y + 0x1d88) < 1) { AddSoulHearts((Entity_Player *)VStack_2d4.y,-4,0); } else { AddBoneHearts((Entity_Player *)VStack_2d4.y,-1); } } else { AddMaxHearts((Entity_Player *)VStack_2d4.y,-2,0); } if ((*(int *)((int)this + 0x13c0) != 10) && (*(int *)((int)this + 0x13c0) != 0x1f)) { AddBrokenHearts(this,1); } VStack_2a0.y = (float)((int)VStack_2a0.y + -1); *(undefined4 *)&((FXLayers *)((int)this + 0x1618))->field_0x90 = 0x400; *(undefined4 *)&((FXLayers *)((int)this + 0x1618))->field_0x94 = 0; pRVar6 = local_298; } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; break; case 0x3f: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x3f); if (bVar4 == 0) { play_sound_with_fart_seed(0x1e7,2,0,0x3f800000); Game::ShakeScreen(g_game,4); VStack_2f0.y = (float)&this->_pos; VStack_2bc.y = 4.2039e-45; do { vecResult = MusicManager::RandomVector(&VStack_308); random_float(); pLVar22 = (Level *)(in_XMM0_Da * 5.0); VStack_2dc.y = (float)pLVar22; Vector::__mul(vecResult,&VStack_2cc,&VStack_2dc.y); uVar7 = Random(); vecResult = MusicManager::RandomVector(&VStack_300); random_float(); VStack_2c4.y = (float)pLVar22 * 20.0; vecResult = Vector::__mul(vecResult,&VStack_374,&VStack_2c4.y); fVar51 = VStack_2f0.y; vecResult = Vector::__add((Vector *)VStack_2f0.y,&VStack_330,vecResult); uVar52 = 0; pTVar49 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar48 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar36 = 0; tmpEntity = Game::Spawn(g_game,1000,0x3b,vecResult,&VStack_2cc,(Entity *)0x0,0,uVar7); effect = (Entity_Effect *)__RTDynamicCast(tmpEntity,uVar36,pTVar48,pTVar49,uVar52); VStack_2a0.y = 1.0; vecResult = Entity::Position((Entity *)effect,&VStack_31c); vecResult = Vector::__sub(vecResult,&VStack_360,(Vector *)fVar51); vecResult2 = (Vector *)Vector::Vector(); VStack_2b4.y = Vector::Dot(vecResult,vecResult2); puVar28 = (undefined1 *)0x0; if (VStack_2b4.y < 0.0) { puVar28 = &DAT_bf800000; VStack_2a0.y = (float)&DAT_bf800000; } random_float(); fVar51 = ((float)puVar28 * 10.0 + 2.0) * VStack_2a0.y; Entity_Effect::set_rotation(effect,fVar51); iVar41 = Isaac::Random(0xf); Entity_Effect::SetTimeout(effect,iVar41 + 0xf); uVar50 = 0; uVar52 = 0; uVar36 = 0; pcVar1 = *(code **)(*(int *)effect + 0x3c); random_float(0,0,0); in_XMM0_Da = 1.0; uVar36 = Color::Color(fVar51 * 0.5 + 0.2,uVar36,uVar52,uVar50); (*pcVar1)(uVar36,0xffffffff,0xff,0,1); (**(code **)(*(int *)effect + 0xc))(); this = (Entity_Player *)VStack_2d4.y; VStack_2bc.y = (float)((int)VStack_2bc.y + -1); } while ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0); pcVar1 = *(code **)(*(int *)VStack_2d4.y + 0x3c); uVar36 = Color::Color(0x3f800000,0,0,0,0,0x3f4ccccd,0x3f4ccccd,0x3f4ccccd); (*pcVar1)(uVar36,2,0xff,1,1); pRVar6 = local_298; } TemporaryEffects::RemoveNullEffect((TemporaryEffects *)&((Room *)this)->field_0x1508,0x3f,1); TemporaryEffects::AddNullEffect((TemporaryEffects *)&((Room *)this)->field_0x1508,0x3f,1,1); uVar7 = RNG::RandomInt((RNG *)pRVar6,10); if (uVar7 == 0) { itemConfig = Isaac::GetItemConfig(); bVar4 = 0; configItem = Config::GetNullItem(itemConfig,0x44); AddCostume(this,configItem,bVar4); } goto LAB_007b8998; case 0x40: uVar7 = RNG::RandomInt((RNG *)pRVar6,(uStack_2a2._1_1_ + 1) * 3); EVar33 = (EntityPtr)(uVar7 + 2); VStack_2a0.y = (float)EVar33; if (EVar33 != (EntityPtr)0x0) { VStack_2bc.y = (float)&this->_pos; do { pRVar20 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::FindFreePickupSpawnPosition(pRVar20,&VStack_358,(Vector *)VStack_2bc.y,40.0,0,0,0); uVar7 = RNG::Next((RNG *)pRVar6); Game::Spawn(g_game,5,0x3c,&VStack_358,&g_vectorZero,(Entity *)0x0,0,uVar7); EVar33 = (EntityPtr)((int)EVar33 + -1); this = (Entity_Player *)VStack_2d4.y; } while (EVar33 != (EntityPtr)0x0); } break; case 0x41: local_2ac = 0; Level::GetCurrentRoom(); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&hermitPickups,5,-1,-1,0,0); uStack_8 = 9; EVar33 = (EntityPtr)0x0; VStack_2bc.y = 0.0; iVar41 = EntityList::Size(); if (iVar41 == 0) { LAB_007b6afb: uVar30 = 0x21; uVar7 = RNG::Next((RNG *)pRVar6); RNG::game_constructor(&RStack_22c,uVar7,uVar30); uStack_8 = CONCAT31(uStack_8._1_3_,0xb); uVar7 = RNG::Next(&RStack_22c); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); Level::GetCurrentRoom((Level *)g_game); vecResult = Room::GetCenterPos(&VStack_308); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_300,vecResult,0.0,0,0,0); Game::Spawn(g_game,5,0x14,vecResult,&g_vectorZero,(Entity *)0x0,1,uVar7); guard_check_icall(); } else { do { puVar27 = (undefined4 *)std::vector::operator_index(EVar33); pRVar6 = (Room *)*puVar27; VStack_2b4.y = (float)pRVar6; cVar5 = Entity::Exists((Entity *)pRVar6); if (((((cVar5 == '\0') || (cVar5 = Entity::IsDead((Entity *)pRVar6), cVar5 != '\0')) || (cVar5 = Entity_Pickup::IsShopItem((Entity_Pickup *)pRVar6), cVar5 != '\0')) || ((cVar5 = Entity::Visible((Entity *)pRVar6), cVar5 == '\0' || (iVar41 = Entity_Pickup::Timeout((Entity_Pickup *)pRVar6), 0 < iVar41)))) || (bVar4 = Entity_Pickup::CanReroll((Entity_Pickup *)pRVar6), bVar4 == 0)) goto switchD_007b66d7_caseD_b; uVar7 = Entity::Variant((Entity *)pRVar6); if (uVar7 < 0x47) { if (uVar7 == 0x46) { LAB_007b6844: local_2a8 = 5; } else { switch(uVar7) { case 10: iVar41 = Entity::SubType((Entity *)pRVar6); if ((iVar41 == 4) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 7)) { LAB_007b6706: local_2a8 = 10; } else { iVar41 = Entity::SubType((Entity *)pRVar6); if (((iVar41 == 6) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 0xb)) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 5)) { local_2a8 = 6; } else { iVar41 = Entity::SubType((Entity *)pRVar6); if (iVar41 == 3) goto LAB_007b6844; iVar41 = Entity::SubType((Entity *)pRVar6); if ((iVar41 == 8) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 0xc)) { local_2a8 = 2; } else { iVar41 = Entity::SubType((Entity *)pRVar6); local_2a8 = (uint)(iVar41 != 2) * 2 + 1; } } } break; default: goto switchD_007b66d7_caseD_b; case 0x1e: iVar41 = Entity::SubType((Entity *)pRVar6); if (((iVar41 == 3) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 2)) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 4)) goto LAB_007b6706; goto LAB_007b6844; case 0x28: iVar41 = Entity::SubType((Entity *)pRVar6); if ((iVar41 == 2) || (iVar41 = Entity::SubType((Entity *)pRVar6), iVar41 == 4)) goto LAB_007b6706; iVar41 = Entity::SubType((Entity *)pRVar6); if (iVar41 != 7) goto LAB_007b6844; local_2a8 = 10; break; case 0x45: local_2a8 = 7; } } LAB_007b684f: uVar30 = 0x10; uVar7 = Entity::InitSeed((Entity *)pRVar6); RNG::game_constructor(&tmpRng,uVar7,uVar30); uStack_8 = CONCAT31(uStack_8._1_3_,10); if (9 < local_2a8) { VStack_2a0.y = (float)((local_2a8 - 5) / 5); local_2a8 = local_2a8 + (int)VStack_2a0.y * -5; do { uVar7 = RNG::Next(&tmpRng); uVar30 = RNG::Next(&tmpRng); vecResult = RandomVector(&VStack_308,uVar30); VStack_2dc.y = RNG::RandomFloat(&tmpRng); vecResult = (Vector *)Vector::operator_mul(vecResult); VStack_2c4.y = 5.0; vecResult = Vector::__mul(vecResult,&VStack_374,&VStack_2c4.y); vecResult2 = Entity::Position((Entity *)VStack_2b4.y,&VStack_330); Game::Spawn(g_game,5,0x14,vecResult2,vecResult,(Entity *)0x0,2,uVar7); VStack_2a0.y = (float)((int)VStack_2a0.y - 1); } while (VStack_2a0.y != 0.0); VStack_2a0.y = 0.0; } if (0 < (int)local_2a8) { do { uVar7 = RNG::Next(&tmpRng); uVar30 = RNG::Next(&tmpRng); vecResult = RandomVector(&VStack_31c,uVar30); VStack_2f0.y = RNG::RandomFloat(&tmpRng); vecResult = (Vector *)Vector::operator_mul(vecResult); VStack_2cc.y = 5.0; vecResult = Vector::__mul(vecResult,&VStack_368,&VStack_2cc.y); vecResult2 = Entity::Position((Entity *)VStack_2b4.y,&VStack_398); Game::Spawn(g_game,5,0x14,vecResult2,vecResult,(Entity *)0x0,1,uVar7); local_2a8 = local_2a8 - 1; } while (local_2a8 != 0); } uVar7 = Random(); vecResult = Entity::Position((Entity *)VStack_2b4.y,&VStack_344); tmpEntity = Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); pcVar1 = *(code **)(*(int *)tmpEntity + 0x3c); uVar36 = Color::Color(0x3f800000,0x40400000,0x4019999a,0x3f800000,0x3f800000,0,0,0); (*pcVar1)(uVar36,0xffffffff,0xff,0,1); fVar51 = VStack_2b4.y; cVar5 = Entity::IsType((Entity *)VStack_2b4.y,5,100,0xffffffff); if (cVar5 == '\0') { (**(code **)(*(int *)fVar51 + 0x28))(); } else { FUN_0060d1f0(4); } Entity_Pickup::RemoveOtherOptions(); uVar7 = local_2ac + 1; uStack_8 = CONCAT31(uStack_8._1_3_,9); local_2ac = uVar7; guard_check_icall(); } else { if (uVar7 < 0x12d) { if ((uVar7 == 300) || (uVar7 == 0x5a)) goto LAB_007b6844; if (uVar7 == 100) { iVar41 = Entity::SubType((Entity *)pRVar6); local_2a8 = -(uint)(iVar41 != 0) & 0xf; if (local_2a8 != 0) goto LAB_007b684f; } } else if (uVar7 == 0x15e) goto LAB_007b6844; switchD_007b66d7_caseD_b: uVar7 = local_2ac; VStack_2bc.y = (float)EVar33; } EVar33 = (EntityPtr)((int)VStack_2bc.y + 1); VStack_2bc.y = (float)EVar33; EVar21 = (EntityPtr)EntityList::Size(); } while ((uint)EVar33 < (uint)EVar21); if (uVar7 == 0) { pRVar6 = local_298; goto LAB_007b6afb; } RNG::Next((RNG *)local_298); } uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&hermitPickups); this = (Entity_Player *)VStack_2d4.y; break; case 0x42: Game::Darken(g_game,0x3f800000,0x3c); Game::ShakeScreen(g_game,0x32); VStack_2a0.y = (float)RNG::RandomInt((RNG *)pRVar6,6); VStack_2bc.y = (float)RNG::Next((RNG *)pRVar6); fVar51 = VStack_2a0.y; if ((EntityPtr)VStack_2a0.y == (EntityPtr)0x0) { UseActiveItem(this,(short *)((int)&uStack_2e8 + 2),0x11c,0x11,-1,0); } else { if (((((EntityPtr)VStack_2a0.y == (EntityPtr)0x1) || ((EntityPtr)VStack_2a0.y == (EntityPtr)0x5)) || ((EntityPtr)VStack_2a0.y == (EntityPtr)0x2)) && ((UseActiveItem(this,(short *)&EStack_2e4.field_0x2,0xa6,1,-1,0), (EntityPtr)fVar51 == (EntityPtr)0x2 || ((EntityPtr)fVar51 == (EntityPtr)0x5)))) { Game::RerollLevelPickups(g_game,VStack_2bc.y); } if (((EntityPtr)fVar51 == (EntityPtr)0x3) || ((EntityPtr)fVar51 == (EntityPtr)0x5)) { Game::RerollLevelCollectibles(g_game); UseActiveItem(this,(short *)&EStack_2f4.field_0x2,0x69,1,-1,0); } if ((EntityPtr)fVar51 == (EntityPtr)0x4) { seeds = (Seeds *)Game::GetSeeds(g_game); Config::GetCollectibles(); uVar36 = _get_index_plus_one_if_kind_4_5(); Seeds::ForgetStageSeed(seeds,uVar36); Game::StartStageTransition(g_game,1,0,0); } else if ((EntityPtr)fVar51 == (EntityPtr)0x5) { uVar7 = 0; iVar41 = Game::GetNumPlayers(g_game); if (iVar41 != 0) { do { VStack_2a0.y = (float)Game::GetPlayer(g_game,uVar7); iVar41 = Entity::Variant((Entity *)VStack_2a0.y); if (iVar41 == 0) { UseActiveItem((Entity_Player *)VStack_2a0.y,(short *)((int)&VStack_314.y + 2),0x11c, 0x11,-1,0); } uVar7 = uVar7 + 1; uVar30 = Game::GetNumPlayers(g_game); } while (uVar7 < uVar30); } } } break; case 0x43: Level::GetCurrentRoom(); playerEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddNullEffect(playerEffects,0x40,1,1); break; case 0x44: TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x41,1,1); break; case 0x45: UseActiveItem(this,(short *)((int)&local_2ac + 2),0x221,3,-1,0); break; case 0x46: if ((char)local_2ac != '\0') { ExceptionList = local_10; return; } iVar41 = 5; if (uStack_2a2._1_1_ != 0) { iVar41 = 10; } do { TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x45,1,1); iVar41 = iVar41 + -1; } while (iVar41 != 0); this = (Entity_Player *)VStack_2d4.y; goto LAB_007b8998; case 0x47: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x43); if (bVar4 == 0) { play_sound_with_fart_seed(0x10a,2,0,0x3f800000); itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,10,3,(Entity_Player *)0x0); } TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x43,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x43,1,1); UseActiveItem(this,(short *)((int)&local_2a8 + 2),0x21,3,-1,0); break; case 0x48: uVar30 = 0x2d; uVar7 = RNG::Next((RNG *)pRVar6); RNG::game_constructor(&towerRng,uVar7,uVar30); uStack_8 = 0xc; memset(gridMarks,0,0x1c0); local_298 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar7 = EntityList::Size(); local_2a8 = uVar7; local_2ac = Room::GetGridHeight(local_298); VStack_2cc.y = (float)(local_2ac * uVar7); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,&towerEffects,1000,0xa1,-1,0,0); uStack_8 = CONCAT31(uStack_8._1_3_,0xd); if (0 < (int)VStack_2cc.y) { uVar7 = 0; pRVar6 = local_298; do { fVar51 = 0.0; vecResult = Room::GetGridPosition(pRVar6,&VStack_308,uVar7); bVar4 = Room::IsPositionInRoom(pRVar6,vecResult,fVar51); if (bVar4 != 0) { VStack_2a0.y = (float)Room::GetGridEntity(pRVar6,uVar7); uVar30 = Room::GetGridCollision(pRVar6,uVar7); if (uVar30 == 0) { if ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) { GridEntity::GetType(); cVar5 = is_grid_type_floor_special(); if (cVar5 != '\0') goto LAB_007b6f0b; } VStack_2b4.y = 0.0; iVar41 = EntityList::Size(); if (iVar41 != 0) { do { puVar27 = (undefined4 *)std::vector::operator_index(VStack_2b4.y); vecResult = Entity::Position((Entity *)*puVar27,&VStack_300); uVar30 = Room::GetGridIndex(local_298,vecResult); if (uVar30 == uVar7) { pRVar6 = local_298; goto LAB_007b6f0b; } VStack_2b4.y = (float)((int)VStack_2b4.y + 1); pRVar6 = (Room *)EntityList::Size(); } while ((uint)VStack_2b4.y < pRVar6); pRVar6 = local_298; } gridMarks[uVar7] = '\x05'; } } LAB_007b6f0b: uVar7 = uVar7 + 1; } while ((int)uVar7 < (int)VStack_2cc.y); uVar7 = local_2a8; this = (Entity_Player *)VStack_2d4.y; } EStack_2f4 = (EntityPtr)(uVar7 - 1); VStack_2a0.y = 1.4013e-45; if (1 < (int)EStack_2f4) { iVar41 = uVar7 - 1; VStack_2c4.y = (float)(local_2ac - 1); do { if (1 < (int)(local_2ac - 1)) { pcVar43 = gridMarks + (int)VStack_2a0.y; pcVar14 = gridMarks + (int)((int)VStack_2a0.y + uVar7 * 2); VStack_2dc.y = (float)(-1 - uVar7); pcVar42 = pcVar43 + uVar7; VStack_2bc.y = (float)(1 - uVar7); iVar41 = local_2ac - 2; do { if ((((*pcVar42 != '\0') && (uVar7 = local_2a8, pcVar14[(int)VStack_2bc.y] != '\0')) && (pcVar14[(int)(((Level *)VStack_2dc.y)->_roomList + -1) + 0xa4] != '\0')) && ((*pcVar14 != '\0' && (*pcVar43 != '\0')))) { *pcVar42 = '2'; } pcVar14 = pcVar14 + uVar7; pcVar43 = pcVar43 + uVar7; pcVar42 = pcVar42 + uVar7; iVar41 = iVar41 + -1; } while (iVar41 != 0); iVar41 = uVar7 - 1; } VStack_2a0.y = (float)((int)VStack_2a0.y + 1); } while ((int)VStack_2a0.y < iVar41); this = (Entity_Player *)VStack_2d4.y; } VStack_2b4.y = 0.0; do { FUN_00424510(); fVar51 = VStack_2cc.y; iVar41 = 0; uStack_8 = CONCAT31(uStack_8._1_3_,0xe); bVar2 = false; if ((int)VStack_2cc.y < 1) { LAB_007b73c1: std::vector::_Tidy(); break; } do { if (gridMarks[iVar41] != '\0') { WeightedOutcomePicker::AddOutcomeWeight(outcomePicker,iVar41,(int)gridMarks[iVar41],0); bVar2 = true; } iVar41 = iVar41 + 1; } while (iVar41 < (int)fVar51); this = (Entity_Player *)VStack_2d4.y; if (!bVar2) goto LAB_007b73c1; rng._shift1 = towerRng._shift1; rng._seed = towerRng._seed; rng._shift2 = towerRng._shift2; rng._shift3 = towerRng._shift3; uVar7 = WeightedOutcomePicker::PickOutcome(outcomePicker,rng); vecResult = Room::GetGridPosition(local_298,&VStack_308,uVar7); fVar51 = RNG::RandomFloat(&towerRng); VStack_2a0.y = fVar51 * 36.0 - 18.0; fVar51 = RNG::RandomFloat(&towerRng); VStack_2bc.y = fVar51 * 36.0 - 18.0; vecResult2 = (Vector *)Vector::Vector(); Vector::__add(vecResult,&VStack_314,vecResult2); VStack_2bc.y = 0.0; iVar41 = (int)uVar7 % (int)local_2a8; VStack_2c4.y = (float)((int)uVar7 / (int)local_2a8); VStack_2a0.y = (float)(iVar41 + -2); puVar27 = (undefined4 *)std::max(); pLVar22 = (Level *)*puVar27; EStack_2e4 = (EntityPtr)(iVar41 + 2); VStack_2bc.y = (float)EStack_2f4; VStack_2dc.y = (float)pLVar22; VStack_2a0.y = (float)EStack_2e4; piVar37 = (int *)std::min(); if ((int)pLVar22 <= *piVar37) { uStack_2e8 = (float)((int)VStack_2c4.y - 2); pRVar6 = (Room *)((int)VStack_2c4.y + 2); VStack_2f0.y = (float)pRVar6; do { VStack_2bc.y = 0.0; VStack_2a0.y = uStack_2e8; pfVar16 = (float *)std::max(); fVar51 = *pfVar16; VStack_2bc.y = (float)(local_2ac - 1); VStack_2c4.y = fVar51; VStack_2a0.y = (float)pRVar6; piVar37 = (int *)std::min(); if ((int)fVar51 <= *piVar37) { uVar7 = (int)((RoomDescriptor *)((int)VStack_2dc.y + 0x14))->_doors + (int)fVar51 * local_2a8 + -0x30; do { if (gridMarks[uVar7] != '\0') { Room::GetGridPosition(local_298,&VStack_358,uVar7); VStack_2a0.y = Vector::DistanceSquared(&VStack_358,&VStack_314); if (5625.0 < VStack_2a0.y) { gridMarks[uVar7] = '\x01'; } else { if (0x1bf < uVar7) { /* WARNING: Subroutine does not return */ FUN_00aef86f(); } gridMarks[uVar7] = '\0'; uVar30 = RNG::Next(&towerRng); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::GetGridPosition(pRVar6,&VStack_374,uVar7); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xb1,vecResult,&g_vectorZero, (Entity *)VStack_2d4.y,1,uVar30); Entity_Effect::SetTimeout(effect,(int)VStack_2b4.y); (**(code **)(*(int *)effect + 0xc))(); fVar51 = VStack_2c4.y; } } uVar7 = uVar7 + local_2a8; VStack_2a0.y = VStack_2f0.y; fVar51 = (float)((int)fVar51 + 1); VStack_2bc.y = (float)(local_2ac - 1); VStack_2c4.y = fVar51; piVar37 = (int *)std::min(); } while ((int)fVar51 <= *piVar37); pRVar6 = (Room *)VStack_2f0.y; } VStack_2a0.y = (float)EStack_2e4; pLVar22 = (Level *)((int)(int *)VStack_2dc.y + 1); VStack_2bc.y = (float)EStack_2f4; VStack_2dc.y = (float)pLVar22; piVar37 = (int *)std::min(); } while ((int)pLVar22 <= *piVar37); } uVar7 = RNG::Next(&towerRng); this = (Entity_Player *)VStack_2d4.y; effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xb1,&VStack_314,&g_vectorZero,(Entity *)VStack_2d4.y,0, uVar7); Entity_Effect::SetTimeout(effect,(int)VStack_2b4.y); (**(code **)(*(int *)effect + 0xc))(); std::vector::_Tidy(); VStack_2b4.y = (float)((int)((int)VStack_2b4.y + 4) + 1); } while ((int)VStack_2b4.y < 0x23); EntityList_Query::~EntityList_Query(&towerEffects); uStack_8 = 0xffffffff; guard_check_icall(); break; case 0x49: Config::GetCollectibles(); VStack_2bc.y = (float)FUN_0042c7f0(); if (0 < (int)VStack_2bc.y) { iVar41 = 0; do { Config::GetCollectibles(); piVar37 = (int *)FUN_005cbe00(iVar41); if (((char)piVar37[1] == '\0') && (0 < *piVar37)) { Config::GetCollectibles(); iVar17 = FUN_005cbe00(iVar41); VStack_2a0.y = *(float *)(iVar17 + 8); bVar4 = CanRerollCollectible(this,(int)VStack_2a0.y,0); if (bVar4 != 0) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,(int)VStack_2a0.y); if ((configItem->type != 3) && (piVar37 = (int *)FUN_0042c810(VStack_2a0.y), 0 < *piVar37)) { RemoveCollectibleByHistoryIndex(this,iVar41,1); AnimateCollectible(this,(int)VStack_2a0.y,(byte *)"Pickup", (byte *)"PlayerPickupSparkle"); TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x46,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x46,1,1); goto LAB_007b8998; } } } iVar41 = iVar41 + 1; } while (iVar41 < (int)VStack_2bc.y); } break; case 0x4a: Config::GetCollectibles(); uVar52 = 1; uVar36 = 0x1d; LAB_007b34ad: iVar41 = Level::QueryRoomTypeIndex(uVar36,0,pRVar6,uVar52); if (-1 < iVar41) { Config::GetCollectibles(); FUN_00428ae0(0xffffffff); Game::StartRoomTransition(g_game,iVar41,-1,3,this,-1); goto LAB_007b8998; } break; case 0x4b: bVar4 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x42); if (bVar4 == 0) { itemOverlay = (ItemOverlay *)Game::GetItemOverlay(g_game); ItemOverlay::Show(itemOverlay,0x2b,0,(Entity_Player *)0x0); } TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x42,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x42,1,1); if ((0 < this->_maxHearts) && (iVar41 = GetHealthType(this), iVar41 == 0)) { Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 == '\0') { iVar41 = this->_maxHearts; this->_maxHearts = 0; iVar41 = iVar41 / 2; this->_boneHearts = this->_boneHearts + iVar41; this->_boneHeartsMask = this->_boneHeartsMask << ((byte)iVar41 & 0x1f) | (1 << ((byte)iVar41 & 0x1f)) - 1U; UpdateHeartDependentEffects(this); this->_reverseSunBoneHearts = iVar41; break; } } Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 != '\0') { this->_boneHearts = this->_boneHearts + this->_redHearts; this->_maxHearts = 0; this->_redHearts = 0; } break; case 0x4c: play_sound_with_fart_seed(0x109,2,0,0x3f800000); uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0); pRVar6 = (Room *)0xa; LAB_007b31f0: tmpEntity = Game::Spawn(g_game,6,(uint)pRVar6,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); Entity::AddEntityFlags(tmpEntity,4); break; case 0x4d: pRVar6 = (Room *)Level::GetCurrentRoom(); VStack_2a0.y = (float)Room::GetGridIndex(pRVar6,&this->_pos); if (-1 < (int)VStack_2a0.y) { pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar7 = Random(); Room::SpawnGridEntity(pRVar6,(int)VStack_2a0.y,0x12,0,uVar7,0); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); VStack_2a0.y = (float)Room::GetGridEntity(pRVar6,(uint)VStack_2a0.y); if ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) { iVar41 = GridEntity::GetType(); if (iVar41 == 0x12) { iVar41 = GridEntity::GetVariant(); if (iVar41 == 0) { pLVar22 = (Level *)Config::GetCollectibles(); Level::SetStateFlag(pLVar22,0xd,1); uVar7 = Random(); vecResult = GridEntity::Position((GridEntity *)VStack_2a0.y,&VStack_308); tmpEntity = Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); } } } } break; case 0x4e: UseActiveItem(this,(short *)((int)&local_298 + 2),0x244,1,-1,0); break; case 0x4f: uVar7 = RNG::RandomInt((RNG *)pRVar6,0x14); VStack_2bc.y = (float)(uVar7 + 1); VStack_2a0.y = 0.0; if ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0) { do { uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0); tmpEntity = Game::Spawn(g_game,5,10,vecResult,&g_vectorZero,(Entity *)this,1,uVar7); FUN_005b19f0(VStack_2a0.y); (**(code **)(*(int *)tmpEntity + 0xc))(); VStack_2a0.y = (float)((int)VStack_2a0.y + 1); pRVar6 = local_298; } while ((uint)VStack_2a0.y < (uint)VStack_2bc.y); } break; case 0x50: if (-1 < (char)(byte)useFlag) { bVar4 = this->_wildCardItemType; if (bVar4 == 1) { UseCard(this,this->_wildCardItem,0x180); } else if (bVar4 == 0) { UsePill(this->_wildCardItem,this->_wildCardVarData,0x180); if (this->_cacheFlags != 0) { InvalidateCoPlayerItems(this); EvaluateItems(); } } else if (bVar4 == 2) { UseActiveItem(this,(short *)((int)&local_298 + 2),this->_wildCardItem,0x484,-1, this->_wildCardVarData); TriggerBookOfVirtues(this->_wildCardItem,0); goto LAB_007b8998; } } break; case 0x51: Level::GetCurrentRoom(); entityList = (EntityList *)FUN_00428a60(); EntityList::QuerySublist(entityList,(EntityList_EL *)&RStack_20c,5,100,-1,0,0); uStack_8 = 0xf; EVar33 = (EntityPtr)0x0; VStack_2a0.y = 0.0; iVar41 = EntityList::Size(); pRVar6 = local_298; if (iVar41 != 0) { do { puVar27 = (undefined4 *)std::vector::operator_index(EVar33); tmpEntity = (Entity *)*puVar27; cVar5 = Entity::IsDead(tmpEntity); if (cVar5 == '\0') { iVar41 = Entity::SubType(tmpEntity); if (iVar41 != 0) { EVar33 = (EntityPtr)FUN_00435e30(); VStack_2bc.y = (float)EVar33; if (((EVar33 != (EntityPtr)0x0) && ((iVar41 = Entity_Pickup::OptionsPickupIndex((Entity_Pickup *)EVar33), iVar41 == 0 || (iVar41 = Entity_Pickup::Timeout((Entity_Pickup *)EVar33), iVar41 < 0)))) && (bVar4 = Entity_Pickup::CanReroll((Entity_Pickup *)EVar33), bVar4 != 0)) { pRVar20 = (Room *)Level::GetCurrentRoom((Level *)g_game); uVar7 = RNG::Next((RNG *)pRVar6); iVar41 = Room::GetSeededCollectible(pRVar20,uVar7,0); FUN_006daca0(iVar41); uVar7 = Random(); vecResult = Entity::Position((Entity *)VStack_2bc.y,&VStack_308); tmpEntity = Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,(Entity *)0x0,0,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); } } } VStack_2a0.y = (float)((int)VStack_2a0.y + 1); EVar21 = (EntityPtr)EntityList::Size(); EVar33 = (EntityPtr)VStack_2a0.y; } while ((uint)VStack_2a0.y < (uint)EVar21); this = (Entity_Player *)VStack_2d4.y; } uStack_8 = 0xffffffff; EntityList_Query::~EntityList_Query(&RStack_20c); break; case 0x52: TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x72,1,1); break; case 0x53: SoundEffects::PlayWithFartOverride(0xcc,2,0,0x3f800000); VStack_2b4.y = 0.0; do { pLVar22 = (Level *)Config::GetCollectibles(); level = (Level *)Config::GetCollectibles(); iVar41 = Level::GetCurrentRoomIndex(level); bVar4 = Level::CanSpawnDoorOutline(pLVar22,iVar41,(uint)VStack_2b4.y); if (bVar4 != 0) { Config::GetCollectibles(); pLVar22 = (Level *)Config::GetCollectibles(); uVar36 = Level::GetCurrentRoomIndex(pLVar22); Level::MakeRedRoomDoor(uVar36,VStack_2b4.y); } pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); fVar51 = VStack_2b4.y; VStack_2a0.y = (float)Room::GetDoor(pRVar6,(int)VStack_2b4.y); if ((((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) && (cVar5 = FUN_0056ff60(0x10), cVar5 == '\0')) && (bVar4 = GridEntity_Door::TryUnlock((GridEntity_Door *)VStack_2a0.y,this,1), bVar4 == 0)) { GridEntity_Door::Open((GridEntity_Door *)VStack_2a0.y); GridEntity_Door::TryBlowOpen((GridEntity_Door *)VStack_2a0.y,0,(Entity *)0x0); } VStack_2b4.y = (float)((int)fVar51 + 1); } while ((int)VStack_2b4.y < 8); Level::GetCurrentRoom((Level *)g_game); playerEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(playerEffects,0xaf,1,1); break; case 0x54: itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x2c1); TemporaryEffect::TemporaryEffect(configItem); iStack_458 = 0x5a - iStack_458; TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_460,1,1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x80,1,1); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); Room::SetPauseTimer(pRVar6,0x5a); UseActiveItem(this,(short *)((int)&VStack_2d4.y + 2),0x2c1,9,-1,0); break; case 0x55: TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x73,1,1); play_sound_with_fart_seed(0x25,2,0,0x3f800000); play_sound_with_fart_seed(0x95,2,0,0x3fc00000); uVar7 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xc3,&this->_pos,&g_vectorZero,(Entity *)this,1,uVar7); Entity_Effect::SetTimeout(effect,0x24); Entity::SetParent((Entity *)effect,(Entity *)this); (**(code **)(*(int *)effect + 0xc))(); break; case 0x56: VStack_2a0.y = 2.10195e-44; do { Level::GetCurrentRoom((Level *)g_game); FUN_0043eed0(&VStack_2b4); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); random_float(); VStack_2dc.y = -80.0 - in_XMM0_Da * 120.0; vecResult = MusicManager::RandomVector(&VStack_308); VStack_2bc.y = 1000.0; vecResult = Vector::__mul(vecResult,&VStack_300,&VStack_2bc.y); vecResult = Vector::__add(&VStack_2b4,&VStack_374,vecResult); vecResult = Room::GetClampedPosition(pRVar6,&VStack_330,vecResult,VStack_2dc.y); Vector::operator_assign(&VStack_2b4,vecResult); uVar7 = Random(); effect = (Entity_Effect *) Game::Spawn(g_game,1000,0xc5,&VStack_2b4,&g_vectorZero,(Entity *)this,0,uVar7); VStack_2dc.y = *(float *)(*(int *)effect + 0x40); bVar4 = HasCollectible(this,0xf7,0); if (bVar4 == 0) { in_XMM0_Da = 1.0; } else { in_XMM0_Da = 2.0; } (*(code *)VStack_2dc.y)(in_XMM0_Da); iVar41 = Isaac::Random(0x96); Entity_Effect::SetTimeout(effect,iVar41 + 300); iVar41 = Isaac::Random(0x5a); Entity_Effect::set_state(effect,iVar41); (**(code **)(*(int *)effect + 0xc))(); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); } while ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0); break; case 0x57: itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x2c0); TemporaryEffect::TemporaryEffect(configItem); uStack_388 = 300; TemporaryEffects::AddEffect(&this->_temporaryeffects,auStack_390,1,1); play_sound_with_fart_seed(0x250,2,0,0x3f800000); play_sound_with_fart_seed(0x28a,2,0,0x3f800000); Level::GetCurrentRoom((Level *)g_game); Level::UpdateBackwardsPathStages(); break; case 0x58: Game::GetField26614(g_game); cVar5 = FUN_00429550(); iVar41 = 0xf0; if (cVar5 != '\0') { iVar41 = 0x5a; } this->_megaBlastDuration = iVar41; itemConfig = Isaac::GetItemConfig(); bVar4 = 0; configItem = Config::GetNullItem(itemConfig,0x1f); AddCostume(this,configItem,bVar4); break; case 0x59: TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x71,-1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x71,1,1); pcVar1 = *(code **)(*(int *)this + 0x24); sourceRef = EntityRef::EntityRef(&EStack_28c); (*pcVar1)(sourceRef); *(undefined4 *)&this->_lastDamageFlags = 0; *(undefined4 *)((int)&this->_lastDamageFlags + 4) = 0; (this->_lastDamageSource)._type = 0; (this->_lastDamageSource)._variant = 0; goto LAB_007b8998; case 0x5a: Level::GetCurrentRoom(); playerEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::AddCollectibleEffect(playerEffects,0x192,1,1); UseActiveItem(this,(short *)((int)&VStack_2d4.y + 2),0x69,1,-1,0); UseActiveItem(this,(short *)((int)&local_298 + 2),0xa6,1,-1,0); Level::GetCurrentRoom((Level *)g_game); playerEffects = (TemporaryEffects *)FUN_004360d0(); TemporaryEffects::RemoveCollectibleEffect(playerEffects,0x192,-1); break; case 0x5b: spawn_ghost_corpse(); TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x70,-1); TemporaryEffects::AddNullEffect(&this->_temporaryeffects,0x70,1,2); iVar41 = GetPlayerType(this); if (iVar41 != 10) { TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x139,1,1); std::string::string_from_cstr("Shimmer"); uStack_8 = 0x10; PlayCollectibleAnim(this,0x139,1,&EStack_254._position,0xffffffff,0); uStack_8 = 0xffffffff; std::string::_Tidy_deallocate(); } break; case 0x5c: FUN_00424510(); uStack_8 = 0x11; itemPool = (ItemPool *)Game::GetItemPool(g_game); pool = ItemPool::GetPool(itemPool,0x1c); VStack_2b4.y = (float)&pool->_poolList; VStack_2cc.y = 0.0; iVar41 = FUN_00414410(); if (iVar41 != 0) { do { iVar41 = FUN_004143f0(VStack_2cc.y); if (*(char *)(iVar41 + 0x14) != '\0') { Game::GetField26614(g_game); cVar5 = FUN_00429550(); if (cVar5 != '\0') { Game::GetField26614(g_game); piVar37 = (int *)EntityList::Size(); pcVar1 = *(code **)(*piVar37 + 0x30); puVar27 = (undefined4 *)FUN_004143f0(VStack_2cc.y); cVar5 = (*pcVar1)(*puVar27); if (cVar5 != '\0') goto LAB_007b81fb; this = (Entity_Player *)VStack_2d4.y; } itemConfig = Isaac::GetItemConfig(); piVar37 = (int *)FUN_004143f0(VStack_2cc.y); configItem = ItemConfig::GetCollectible(itemConfig,*piVar37); if ((configItem != (ItemConfig_Item *)0x0) && (configItem->type == 4)) { bVar4 = Item::HasTags(configItem,0x8000000); if ((bVar4 == 0) || (bVar4 = HasCollectible(this,configItem->id,0), bVar4 == 0)) { std::vector::push_back(&configItem->id); } } } LAB_007b81fb: puVar47 = (undefined1 *)((int)VStack_2cc.y + 1); VStack_2cc.y = (float)puVar47; puVar28 = (undefined1 *)FUN_00414410(); this = (Entity_Player *)VStack_2d4.y; } while (puVar47 < puVar28); pRVar6 = local_298; } cVar5 = FUN_004bc660(); if (cVar5 == '\0') { uVar7 = std::vector::size(); uVar7 = RNG::RandomInt((RNG *)pRVar6,uVar7); pEVar29 = (EntityPtr *)FUN_0042c810(uVar7); EVar33 = *pEVar29; VStack_2a0.y = (float)EVar33; itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,(int)EVar33); if ((useFlag & 0x800) == 0) { hud = (HUD *)Game::GetHUD(g_game); HUD::ShowItemText(hud,this,configItem); } SoundEffects::PlayWithFartOverride(0x80,2,0,0x3f800000); AnimateCollectible(this,(int)VStack_2a0.y,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); SetQueuedItem(configItem,0xffffffff,0,0,0xffffffff); isPlayAnim = 0; } uStack_8 = 0xffffffff; FID_conflict__Tidy(outcomePicker); break; case 0x5d: uVar7 = RNG::RandomInt((RNG *)pRVar6,0x19); VStack_2bc.y = (float)(uVar7 + 1); VStack_2a0.y = 0.0; if ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0) { do { uVar7 = RNG::Next((RNG *)pRVar6); pRVar6 = (Room *)Level::GetCurrentRoom((Level *)g_game); vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0); tmpEntity = Game::Spawn(g_game,5,0x14,vecResult,&g_vectorZero,(Entity *)this,0,uVar7); FUN_005b19f0(VStack_2a0.y); (**(code **)(*(int *)tmpEntity + 0xc))(); VStack_2a0.y = (float)((int)VStack_2a0.y + 1); pRVar6 = local_298; } while ((uint)VStack_2a0.y < (uint)VStack_2bc.y); } break; case 0x5e: VStack_2a0.y = 0.0; Game::GetField26614(g_game); FUN_00429550(); VStack_2bc.y = (float)&this->_pos; do { uVar7 = Random(); uVar30 = RNG::RandomInt((RNG *)pRVar6,5); vecResult = MusicManager::RandomVector(&VStack_308); vecResult = Vector::__add((Vector *)VStack_2bc.y,&VStack_300,vecResult); this = (Entity_Player *)VStack_2d4.y; tmpEntity = Game::Spawn(g_game,3,0x2b,vecResult,&g_vectorZero,(Entity *)VStack_2d4.y,uVar30 + 1, uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); EVar33 = (EntityPtr)((int)VStack_2a0.y + 1); VStack_2a0.y = (float)EVar33; Game::GetField26614(g_game); cVar5 = FUN_00429550(); iVar41 = 0xf; if (cVar5 != '\0') { iVar41 = 10; } pRVar6 = local_298; } while ((int)EVar33 < iVar41); break; case 0x5f: playerManager = (PlayerManager *)Game::GetPlayerManager(); EVar33 = (EntityPtr)PlayerManager::SpawnCoPlayer2(playerManager,0x10); VStack_2a0.y = (float)EVar33; SetControllerIndex((Entity_Player *)EVar33,this->_controllerIndex,0); Entity::SetParent((Entity *)EVar33,(Entity *)this); vecResult = (Vector *)Vector::Vector(); vecResult = Vector::__add(&this->_pos,&VStack_300,vecResult); Entity::SetPosition((Entity *)EVar33,vecResult); playerEffects = (TemporaryEffects *)GetEffects((Entity_Player *)EVar33); TemporaryEffects::AddNullEffect(playerEffects,0x78,1,1); init_forgotten_twin((Entity_Player *)EVar33); InitPostLevelInitStats((Entity_Player *)EVar33); AddBoneHearts((Entity_Player *)EVar33,1); AddHearts((Entity_Player *)EVar33,2,1,0); uVar7 = Random(); vecResult = &VStack_440; goto LAB_007b850e; case 0x60: VStack_2a0.y = 8.40779e-45; do { rngSource = (RNG *)FUN_005cbd00(0x2ad); Isaac::GetItemConfig(); Config::GetCollectibles(); iVar41 = std::vector::size(); uVar7 = RNG::RandomInt(rngSource,iVar41 - 1); VStack_2bc.y = (float)(uVar7 + 1); itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,uVar7 + 1); if (((configItem == (ItemConfig_Item *)0x0) || (cVar5 = ItemConfig::IsValidCollectible(VStack_2bc.y), cVar5 == '\0')) || (configItem->type != 3)) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x248); } if ((configItem[1].type == 0) || (*(short *)(configItem[1].type + 400) < 1)) { itemConfig = Isaac::GetItemConfig(); configItem = ItemConfig::GetCollectible(itemConfig,0x248); } AddWisp(this,configItem->id,&this->_pos,1,0); VStack_2a0.y = (float)((int)VStack_2a0.y + -1); } while ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0); SoundEffects::PlayWithFartOverride2(0x1d7,&this->_pos,2,0,0x3f800000); break; case 0x61: playerManager = (PlayerManager *)Game::GetPlayerManager(); EVar33 = (EntityPtr)PlayerManager::SpawnCoPlayer2(playerManager,0x14); VStack_2a0.y = (float)EVar33; SetControllerIndex((Entity_Player *)EVar33,this->_controllerIndex,0); Entity::SetParent((Entity *)EVar33,(Entity *)this); vecResult = (Vector *)Vector::Vector(); vecResult = Vector::__add(&this->_pos,&VStack_308,vecResult); Entity::SetPosition((Entity *)EVar33,vecResult); playerEffects = (TemporaryEffects *)GetEffects((Entity_Player *)EVar33); TemporaryEffects::AddNullEffect(playerEffects,0x79,1,1); init_forgotten_twin((Entity_Player *)EVar33); InitPostLevelInitStats((Entity_Player *)EVar33); VStack_2c4.y = (float)FUN_005cbd00(0x2bf); VStack_2cc.y = (float)((int)EVar33 + 0x1dec); FUN_005b16f0(1); VStack_2dc.y = (float)Config::GetCollectibles(); std::iterator_copy(&local_298); uVar36 = FUN_00456190(&VStack_2f0.y); cVar5 = FUN_0042c710(uVar36); while (cVar5 != '\0') { iVar41 = EntityPtr::Ref(); if (*(char *)(iVar41 + 4) == '\0') { iVar41 = EntityPtr::Ref(); piVar37 = (int *)FUN_0042c810(*(undefined4 *)(iVar41 + 8)); if (0 < *piVar37) { itemConfig = Isaac::GetItemConfig(); iVar41 = EntityPtr::Ref(); configItem = ItemConfig::GetCollectible(itemConfig,*(int *)(iVar41 + 8)); if (configItem->type != 3) { bVar4 = 0; iVar41 = EntityPtr::Ref(); bVar4 = CanRerollCollectible(this,*(int *)(iVar41 + 8),bVar4); if (bVar4 != 0) { piVar37 = (int *)EntityPtr::Ref(); EStack_254._spawnerVariant = *piVar37; EStack_254._position.x = (float)piVar37[1]; EStack_254._velocity.x = (float)piVar37[3]; EStack_254._velocity.y = (float)piVar37[4]; EStack_254._flags = piVar37[5]; EStack_254._entity = (void *)piVar37[6]; uStack_8 = 0x12; EStack_254._position.y = 0.0; VStack_2bc.y = 0.0; do { if (EStack_254._position.y != 0.0) goto LAB_007b8881; itemPool = (ItemPool *)Game::GetItemPool(g_game); uVar7 = RNG::Next((RNG *)VStack_2c4.y); iVar41 = EntityPtr::Ref(); EStack_254._position.y = (float)ItemPool::GetCollectible(itemPool,*(int *)(iVar41 + 0x18),uVar7,7,0,0); if (EStack_254._position.y == 8.67404e-43) { EStack_254._position.y = 0.0; } VStack_2bc.y = (float)((int)VStack_2bc.y + 1); } while ((int)VStack_2bc.y < 10); if (EStack_254._position.y != 0.0) { LAB_007b8881: AddCollectible((Entity_Player *)VStack_2a0.y,(int)EStack_254._position.y,0,1,0,0,0); itemConfig = Isaac::GetItemConfig(); iVar41 = EntityPtr::Ref(); ItemConfig::GetCollectible(itemConfig,*(int *)(iVar41 + 8)); Config::GetCollectibles(); FUN_007221a0(&EStack_254._spawnerVariant); } uStack_8 = 0xffffffff; guard_check_icall(); this = (Entity_Player *)VStack_2d4.y; } } } } FUN_005cba20(); uVar36 = FUN_00456190(&VStack_2f0.y); cVar5 = FUN_0042c710(uVar36); } FUN_005b16f0(0); uVar7 = Random(); vecResult = &VStack_488; LAB_007b850e: tmpEntity = *(Entity **)&((Room *)this)->field_0x1d9c; vecResult = Entity::Position((Entity *)VStack_2a0.y,vecResult); tmpEntity = Game::Spawn(g_game,1000,0xf,vecResult,&g_vectorZero,tmpEntity,0,uVar7); (**(code **)(*(int *)tmpEntity + 0xc))(); this = (Entity_Player *)VStack_2d4.y; break; default: Isaac::GetItemConfig(); Config::GetCards(); iVar41 = std::vector::size(); if (iVar41 <= card) { /* WARNING: Subroutine does not return */ KAGE_LogMessage(1,"Warning: Card % don\'t exist\n",card); } } if (isPlayAnim != 0) { AnimateCard(this,card,"UseItem"); } LAB_007b8998: if ((isPlayAnnouncer != '\0') && (*(int *)(cardConfig + 0x5c) != 0)) { PlayDelayedSFX(this,*(int *)(cardConfig + 0x5c),*(undefined4 *)(cardConfig + 0x60),announcerDelay); } FUN_00863cc0(card,this,useFlag); ExceptionList = local_10; return; LAB_007b3bf0: pfVar16 = pfVar16 + 2; VStack_2b4.y = (float)((int)VStack_2b4.y + 1); if ((undefined1 *)0x3 < (uint)VStack_2b4.y) goto LAB_007b3c4c; goto LAB_007b3be0; } //@@ 007b8c00 FUN_007b8c00 void FUN_007b8c00(int param_1) { int *piVar1; int iVar2; uint seed; Entity *pEVar3; int *piVar4; int *piStack_14; Vector local_10; seed = Random(); local_10.x = *(float *)(param_1 + 0x33c); local_10.y = *(float *)(param_1 + 0x340); pEVar3 = Game::SpawnEx(g_game,1000,0x1d,&local_10,&g_vectorZero,(Entity *)0x0,0,seed,0); piVar4 = (int *)__RTDynamicCast(pEVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); iVar2 = *(int *)(param_1 + 0x3c4); piVar1 = piVar4 + 0xf1; if (piVar4[0xf1] != 0) { piStack_14 = piVar1; std::multiset::erase(&piStack_14); } *piVar1 = iVar2; if (iVar2 != 0) { std::multiset::insert(piVar1); } (**(code **)(*piVar4 + 0xc))(); return; } //@@ 007b8cb0 Entity_Player::update_footprints /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from the player update: _footprintColor1/2 (0x1828/0x1854 ColorMod) drawn into the floor render target (SetRenderTarget/render_quad_set_rect/pop_render_target), skipped for coop ghosts/holograms; spawns 1000.99 particles prototype: db/protos.zhl */ void __thiscall Entity_Player::update_footprints(Entity_Player *this) { float fVar1; int iVar2; byte bVar3; Vector *tmpVec; uint rngResult; uint rngResult2; Entity *spawned; int *splat; ColorMod *color; KColor *color_00; int unusedArg; int effectTimeout; float oldOffsetBlue; double dVar5; undefined4 uVar6; TypeDescriptor *pTVar7; void *pvVar8; undefined1 auStack_13a [2]; undefined1 quad [112]; undefined4 shaderColor; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined4 local_b0; float floorRed; float floorGreen; float floorBlue; KColor tmpKColor; int savedBlendMode0; int savedBlendMode1; Vector VStack_7c; Vector local_74; Vector local_6c; Entity_Player *local_64; Vector local_60; Vector local_58; float local_50; Vector local_4c; undefined1 *local_44; Color tmpColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Manager *manager; float oldOffsetBlue; float oldOffsetGreen; float oldOffsetRed; code *sampleColorFn; local_8 = -NAN; puStack_c = &LAB_00affd9d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&tmpColor)[1]._colorize; ExceptionList = &local_10; if (((this->_variant == 0) && (this->_isCoopGhost == 0)) && (local_64 = this, bVar3 = IsHologram(this), bVar3 == 0)) { if ((this->_footprintColor2)._tint[3] == 0.0) { local_58.y = ((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_60.y = g_displayPixelRatio * g_screenPointScale; local_44 = (undefined1 *) ((((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_60.y + 0.5); dVar5 = floor((double)(float)local_44); VStack_7c.y = (float)dVar5 / local_60.y; local_44 = (undefined1 *)(local_58.y * local_60.y + 0.5); dVar5 = floor((double)(float)local_44); local_44 = (undefined1 *)((float)dVar5 / local_60.y); pvVar8 = g_game->_room; local_60.y = *(float *)((int)pvVar8 + 0x11fc); local_58.y = *(float *)((int)pvVar8 + 0x1200); shared_ptr::assign(&local_4c,(void *)((int)pvVar8 + 0x1bc8)); local_8 = 0.0; sampleColorFn = *(code **)(*(int *)local_4c.x + 0x2c); __ftoui3(); __ftoui3(); (*sampleColorFn)(&tmpKColor); local_8 = -NAN; FUN_0041c710(); this = local_64; local_60.y = (float)&local_64->_footprintColor2; (local_64->_footprintColor2)._tint[3] = 1.0; ((ColorMod *)local_60.y)->_tint[0] = 0.0; (local_64->_footprintColor2)._tint[1] = 0.0; (local_64->_footprintColor2)._tint[2] = 0.0; (local_64->_footprintColor2)._tint[3] = 0.7; (local_64->_footprintColor2)._offset[0] = tmpKColor._red * 0.9; (local_64->_footprintColor2)._offset[2] = tmpKColor._blue * 0.9; (local_64->_footprintColor2)._offset[1] = tmpKColor._green * 0.9; Color::operator_assign((Color *)&local_64->_footprintColor1,(ColorMod *)local_60.y); } else { local_60.y = (float)&this->_footprintColor2; } bVar3 = is_footstep_triggered(this,-1); if (bVar3 != 0) { local_6c.x = (this->_velocity).y; local_6c.y = -(this->_velocity).x; tmpVec = Vector::Normalized(&local_6c,&local_74); local_58.y = tmpVec->x + tmpVec->x; VStack_7c.y = tmpVec->y + tmpVec->y; bVar3 = is_footstep_triggered(this,0); local_44 = &DAT_bf800000; if (bVar3 == 0) { local_60.y = (float)&this->_footprintColor1; } else { local_58.y = local_58.y * -1.0; VStack_7c.y = VStack_7c.y * -1.0; } local_6c.x = local_58.y + (this->_pos).x; local_6c.y = VStack_7c.y + (this->_pos).y; local_58.y = g_displayPixelRatio * g_screenPointScale; VStack_7c.y = (local_6c.y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_50 = ((local_6c.x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_58.y + 0.5; dVar5 = floor((double)local_50); local_4c.y = (float)dVar5 / local_58.y; local_50 = VStack_7c.y * local_58.y + 0.5; dVar5 = floor((double)local_50); local_50 = (float)dVar5 / local_58.y; bVar3 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x271); manager = g_manager; if (bVar3 != 0) { local_58.y = 6.72623e-44; seed_fart_sound_override((int *)&local_58.y); SoundEffects::Play(&manager->_sfxManager,(int)local_58.y,0.5,1,0,1.0,0.0); Game::ShakeScreen(g_game,5); rngResult = Random(); local_58.x = (local_64->_velocity).x * 0.7; local_58.y = (local_64->_velocity).y * 0.7; tmpVec = MusicManager::RandomVector(&local_74); rngResult2 = Random(); oldOffsetBlue = (float)((double)(int)rngResult2 + __uint_to_double_fixup[-((int)rngResult2 >> 0x1f)] ) * 2.3283064e-10 * 20.0; VStack_7c.x = local_6c.x + oldOffsetBlue * tmpVec->x; VStack_7c.y = local_6c.y + oldOffsetBlue * tmpVec->y; spawned = Game::Spawn(g_game,1000,0x3b,&VStack_7c,&local_58,(Entity *)0x0,0,rngResult); rngResult = Random(); if ((rngResult & 1) == 0) { local_44 = (undefined1 *)0x3f800000; } rngResult = Random(); *(float *)(spawned[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 5.0 * (float)local_44; rngResult = Random(); iVar2 = *(int *)spawned; effectTimeout = rngResult % 0xf + 0xf; *(int *)(spawned[1]._sprite._filename._buf + 8) = effectTimeout; *(int *)(spawned[1]._sprite._filename._buf + 0xc) = effectTimeout; (**(code **)(iVar2 + 0xc))(); this = local_64; } oldOffsetBlue = (this->_velocity).y; fVar1 = (this->_velocity).x; if (0.16000001 < fVar1 * fVar1 + oldOffsetBlue * oldOffsetBlue) { rngResult = Random(); pTVar7 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar6 = 0; spawned = Game::Spawn(g_game,1000,7,&local_6c,&g_vectorZero,(Entity *)0x0,0,rngResult); splat = (int *)__RTDynamicCast(spawned,uVar6,pTVar7); oldOffsetBlue = g_vectorOne.y * 0.1; splat[0x39] = (int)(g_vectorOne.x * 0.1); splat[0x3a] = (int)oldOffsetBlue; (**(code **)(*splat + 0x3c))(local_60.y,0xffffffff,0xff); (**(code **)(*splat + 0xc))(); } pvVar8 = g_game->_room; local_58.y = *(float *)((int)pvVar8 + 0x11fc); local_44 = *(undefined1 **)((int)pvVar8 + 0x1200); shared_ptr::assign(&VStack_7c,(void *)((int)pvVar8 + 0x1bc8)); local_8 = 1.4013e-45; (**(code **)(*(int *)VStack_7c.x + 0x2c))(&floorRed); local_8 = -NAN; FUN_0041c710(); oldOffsetBlue = *(float *)((int)local_60.y + 0x20); fVar1 = ((float *)((int)local_60.y + 0x20))[2]; oldOffsetGreen = ((float *)((int)local_60.y + 0x20))[1]; oldOffsetRed = *(float *)((int)local_60.y + 0x20); ((float *)local_60.y)[3] = (0.7 - ((float *)local_60.y)[3]) * 0.3 + ((float *)local_60.y)[3]; oldOffsetBlue = ((float *)((int)local_60.y + 0x20))[2]; *(float *)((int)local_60.y + 0x20) = (floorRed * 0.9 - oldOffsetBlue) * 0.5 + oldOffsetRed; ((float *)((int)local_60.y + 0x20))[2] = (floorBlue * 0.9 - fVar1) * 0.5 + oldOffsetBlue; ((float *)((int)local_60.y + 0x20))[1] = (floorGreen * 0.9 - oldOffsetGreen) * 0.5 + ((float *)((int)local_60.y + 0x20))[1]; if (0.0 < *(float *)((int)g_game->_room + 0x7240)) { oldOffsetBlue = (this->_velocity).y; fVar1 = (this->_velocity).x; if (1.0 < fVar1 * fVar1 + oldOffsetBlue * oldOffsetBlue) { local_60.y = oldOffsetBlue + local_6c.y; local_60.x = local_6c.x + fVar1; rngResult = Random(); spawned = Game::Spawn(g_game,1000,99,&local_60,&g_vectorZero,(Entity *)this,0,rngResult); iVar2 = *(int *)spawned; (spawned->_velocity).x = (this->_velocity).x; (spawned->_velocity).y = (this->_velocity).y; (**(code **)(iVar2 + 0xc))(); rngResult = Random(); for (local_44 = (undefined1 *)(rngResult % 5 + 3); local_44 != (undefined1 *)0x0; local_44 = (undefined1 *)((int)local_44 + -1)) { rngResult = Random(); rngResult2 = Random(); local_50 = (float)((double)(int)rngResult2 + __uint_to_double_fixup[-((int)rngResult2 >> 0x1f)]) * 2.3283064e-10; local_64 = (Entity_Player *)(local_50 * (this->_velocity).y); local_50 = local_50 * (this->_velocity).x; rngResult2 = Random(); local_4c.y = (float)((double)(int)rngResult2 + __uint_to_double_fixup[-((int)rngResult2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_4c.y = local_4c.y + local_4c.y; local_58.y = sin(local_4c.y); oldOffsetBlue = cos(local_4c.y); local_74.x = oldOffsetBlue + local_50; local_74.y = local_58.y + (float)local_64; spawned = Game::Spawn(g_game,1000,99,&local_60,&local_74,(Entity *)this,1,rngResult); (**(code **)(*(int *)spawned + 0xc))(); } } } if ((*(char *)((int)g_game->_room + 0x1be8) != '\0') && (oldOffsetBlue = (this->_velocity).y, fVar1 = (this->_velocity).x, 0.16000001 < fVar1 * fVar1 + oldOffsetBlue * oldOffsetBlue)) { FUN_00683680(); g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; shared_ptr::assign(&local_74,(void *)((int)g_game->_room + 0x1bd8)); local_8 = 2.8026e-45; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)local_74.x,0); local_8 = -NAN; FUN_0041c710(); iVar2 = g_graphicsManager_blendMode[4]; savedBlendMode0 = g_graphicsManager_blendMode[0]; savedBlendMode1 = g_graphicsManager_blendMode[1]; VStack_7c.x = (float)g_graphicsManager_blendMode[2]; VStack_7c.y = (float)g_graphicsManager_blendMode[3]; g_graphicsManager_blendMode[4] = 7; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 0; local_44 = (undefined1 *)((g_screenHeight - 182.0) * 0.5); local_50 = (g_screenWidth - 338.0) * 0.5; local_60.y = g_displayPixelRatio * g_screenPointScale; local_4c.y = (local_50 - 52.0) * local_60.y + 0.5; dVar5 = floor((double)local_4c.y); local_58.y = (float)dVar5 / local_60.y; local_4c.y = ((float)local_44 - 52.0) * local_60.y + 0.5; dVar5 = floor((double)local_4c.y); local_64 = (Entity_Player *)((float)dVar5 / local_60.y); local_4c.y = ((local_6c.x - 60.0) * 0.65 + local_50) * local_60.y + 0.5; dVar5 = floor((double)local_4c.y); local_50 = (float)dVar5 / local_60.y; local_4c.y = ((local_6c.y - 140.0) * 0.65 + (float)local_44) * local_60.y + 0.5; dVar5 = floor((double)local_4c.y); local_4c.y = (float)dVar5; oldOffsetBlue = local_4c.y / local_60.y; KColor::SetFromARGB(&tmpKColor,0xffffffff); tmpVec = &local_74; local_74.x = 20.0; local_74.y = 20.0; local_4c.x = (local_50 - local_58.y) - 10.0; local_4c.y = (oldOffsetBlue - (float)local_64) - 10.0; render_quad_set_rect(quad,&local_4c,tmpVec,color_00); FUN_00682260(); pvVar8 = (void *)0x7b9800; Color::Color(&tmpColor); KAGE::SmartPointer::operator_assign(auStack_13a + -10,&DAT_00c79844); apply_sprite_shader_params(color,1,tmpVec,pvVar8); local_b0 = 0; shaderColor = 0x3f800000; uStack_bc = 0x3f800000; uStack_b8 = 0x3f800000; uStack_b4 = 0x3e75c28f; (**(code **)(*DAT_00c79844 + 0x1c))(); _glfw_context_reset(); pop_render_target(); g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = (int)VStack_7c.x; g_graphicsManager_blendMode[3] = (int)VStack_7c.y; g_graphicsManager_blendMode[4] = iVar2; shader_cache_find(unusedArg); } } } ExceptionList = local_10; return; } //@@ 007b98c0 Entity_Player::SetFootprintColor /* ZHL [exact] __thiscall void Entity_Player::SetFootprintColor(KColor color, bool unk); prototype: REPENTOGON, confirmed by RET 24 */ void __thiscall Entity_Player::SetFootprintColor(Entity_Player *this,KColor color,byte unk) { byte bVar1; bVar1 = is_footstep_triggered(this,-1); if (((bVar1 != 0) || (unk != 0)) && (this->_canFly == 0)) { bVar1 = is_footstep_triggered(this,0); if (bVar1 != 0) { (this->_footprintColor2)._offset[0] = color._red; (this->_footprintColor2)._offset[1] = color._green; (this->_footprintColor2)._offset[2] = color._blue; return; } (this->_footprintColor1)._offset[0] = color._red; (this->_footprintColor1)._offset[1] = color._green; (this->_footprintColor1)._offset[2] = color._blue; } return; } //@@ 007b9940 Entity_Player::is_footstep_triggered /* DB: (foot: -1 any, 0 left): if the player's costume layer sprite (+0x123c index into +0x1220, anm2 3/0x271) is playing, Sprite::IsEventTriggered "LeftFootstep"/"RightFootstep"; otherwise a frameCount%6 / %12 cadence when not paused and flag 0x4000 clear; Entity_Player::update_footprints, GridEntity_Poop::Update (creep under the player) prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Player::is_footstep_triggered(Entity_Player *this,int foot) { int iVar1; int *piVar2; Game *this_00; byte bVar3; byte bVar4; Sprite *this_01; this_00 = g_game; iVar1 = this->_playerCostumeMap[1]._index; if (-1 < iVar1) { this_01 = (Sprite *)(iVar1 * 0x130 + (int)(this->_costumeSpriteDescs)._begin); piVar2 = *(int **)this_01[1]._filename._buf; if (((piVar2 != (int *)0x0) && (*piVar2 == 3)) && (piVar2[1] == 0x271)) { if (foot != -1) { if (foot == 0) { bVar3 = Sprite::IsEventTriggered(this_01,"LeftFootstep"); return bVar3; } return 0; } bVar3 = Sprite::IsEventTriggered(this_01,"LeftFootstep"); if (bVar3 != 0) { return 1; } bVar3 = Sprite::IsEventTriggered(this_01,"RightFootstep"); if (bVar3 == 0) { return 0; } return 1; } } if ((((this->_flags & 0x4000) == 0) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)) && ((this_00->_frameCount % 6 == 0 && (this->_canFly == 0)))) { bVar3 = 1; bVar4 = Game::IsPaused(this_00); if ((bVar4 == 0) && (this_00->_frameCount % 0xc == 0)) { bVar4 = 1; goto LAB_007b9a30; } } else { bVar3 = 0; } bVar4 = 0; LAB_007b9a30: if (foot == -1) { return bVar3; } if (foot == 0) { return bVar4; } return 0; } //@@ 007b9a60 FUN_007b9a60 void FUN_007b9a60(void) { Entity_Player *in_ECX; if (in_ECX->_variant == 0) { in_ECX->_isControlsEnabled = 0; in_ECX->_visible = 0; in_ECX->_entityCollisionClass = 0; *(undefined4 *)&in_ECX->field_0x189c = 0xf0; return; } if (in_ECX->_variant == 1) { PlayerManager::RemoveCoPlayer(&g_game->_playerManager,in_ECX,(byte)in_ECX); } return; } //@@ 007b9aa0 FUN_007b9aa0 void FUN_007b9aa0(void) { Manager *pMVar1; int iVar2; Entity_Player *in_ECX; int local_8; if (((*(int *)&g_game->_roomTransition == 0) && (0 < *(int *)&in_ECX->field_0x189c)) && (iVar2 = *(int *)&in_ECX->field_0x189c + -1, *(int *)&in_ECX->field_0x189c = iVar2, pMVar1 = g_manager, iVar2 == 0)) { in_ECX->_isControlsEnabled = 1; in_ECX->_entityCollisionClass = 4; *(undefined4 *)&in_ECX->field_0x189c = 0; local_8 = 0xd6; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.0,2,0,1.0,0.0); Entity_Player::PlayExtraAnimation(in_ECX,(byte *)"TeleportDown"); in_ECX->_visible = 1; } return; } //@@ 007b9b50 Entity_Player::update_pitfall /* DB: ? ECX=Entity_Player: driven by _pitfallState, "FallIn"/"JumpOut" extra animations, Room::GetGridCollisionAtPos / FindFreePickupSpawnPosition, Entity_Player::Teleport; called from Entity_Player::Update */ void __thiscall Entity_Player::update_pitfall(Entity_Player *this) { Vector pos; byte bVar1; byte isRightPressed; byte isUpPressed; byte isDownPressed; byte *curAnimName; uint cmpResult; EntityRef *damageRefPtr; int iVar2; Vector *pVVar3; char *unused; Entity_Player *extraout_ECX; int unused_00; undefined4 extraout_ECX_00; int unused_01; bool isLess; Vector landingPos; Vector doorPos; Vector freeDoorPos; EntityRef damageRef; Room *room; iVar2 = this->_pitfallState; if (iVar2 != 0) { if (*(int *)&g_game->_roomTransition == 0) { if (this->_dead != 0) { return; } unused = (char *)this; if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying == 0)) { curAnimName = (this->_sprite)._animState._animData; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } unused = "FallIn"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*unused; if (bVar1 != *unused) { LAB_007b9bd8: cmpResult = -(uint)isLess | 1; goto LAB_007b9bdd; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)((Entity_Player *)unused)->field_0x1; if (bVar1 != ((Entity_Player *)unused)->field_0x1) goto LAB_007b9bd8; curAnimName = curAnimName + 2; unused = &((Entity_Player *)unused)->field_0x2; } while (bVar1 != 0); cmpResult = 0; LAB_007b9bdd: if ((cmpResult == 0) && (iVar2 == 1)) { this->_pitfallState = 2; damageRefPtr = EntityRef::EntityRef(&damageRef); (**(code **)(*(int *)this + 0x20))(0x3f800000,0x80000,0,damageRefPtr,0x1e); unused = (char *)extraout_ECX; } } if (((this->_pitfallState != 4) && (this->_pitfallState == 2)) && (this->_pitfallTimer = this->_pitfallTimer + 1, 0x27 < this->_pitfallTimer)) { bVar1 = input_is_action_pressed(0,this->_controllerIndex,(Entity *)this,(int)unused); isRightPressed = input_is_action_pressed(1,this->_controllerIndex,(Entity *)this,unused_00); isUpPressed = input_is_action_pressed (2,this->_controllerIndex,(Entity *)this, CONCAT31((int3)((uint)extraout_ECX_00 >> 8),bVar1 | isRightPressed) ); isDownPressed = input_is_action_pressed(3,this->_controllerIndex,(Entity *)this,unused_01); if ((isDownPressed != 0 || ((bVar1 | isRightPressed) != 0 || isUpPressed != 0)) || (0x77 < this->_pitfallTimer)) { landingPos.x = (this->_pos).x; landingPos.y = (this->_pos).y; room = g_game->_room; iVar2 = Room::GetGridCollisionAtPos(room,this->_pos); if (iVar2 < 1) { this->_pitfallState = 3; PlayExtraAnimation(this,(byte *)"JumpOut"); } else { Room::FindFreePickupSpawnPosition(room,&landingPos,&landingPos,0.0,1,0,0); room = g_game->_room; pos.y = landingPos.y; pos.x = landingPos.x; iVar2 = Room::GetGridCollisionAtPos(room,pos); if (((0 < iVar2) && (g_game->_enterDoor + 1U < 9)) && (room->_doors[g_game->_enterDoor] != (GridEntity *)0x0)) { pVVar3 = GridEntity::Position(room->_doors[g_game->_enterDoor],&doorPos); pVVar3 = Room::FindFreePickupSpawnPosition(room,&freeDoorPos,pVVar3,0.0,1,0,0); landingPos.x = pVVar3->x; landingPos.y = pVVar3->y; } Teleport(this,&landingPos,0,0); this->_pitfallState = 3; PlayExtraAnimation(this,(byte *)"JumpOut"); Sprite::SetLastFrame((Sprite *)&this->_sprite); } this->_damageCooldown = 0x78; } } if ((this->_pitfallState == 3) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { this->_isPlayingExtraAnimation = 0; this->_pitfallTimer = 0; this->_pitfallState = 0; this->_isControlsEnabled = 1; this->_entityCollisionClass = 4; return; } } else { if (iVar2 == 3) { return; } if ((g_game->_roomTransition)._animation != 2) { return; } } this->_isPlayingExtraAnimation = 1; } return; } //@@ 007b9e10 Entity_Player::TryDecreaseGlowingHourglassUses /* ZHL [exact] __thiscall void Entity_Player::TryDecreaseGlowingHourglassUses(int unk1, bool unk2); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::TryDecreaseGlowingHourglassUses(Entity_Player *this,int unk1,byte unk2) { byte bVar1; int iVar2; int iVar3; char cVar4; ActiveItemDesc *pAVar5; uint slot; void *pvVar6; pAVar5 = this->_activeDesc; slot = 0; cVar4 = (char)unk1; do { if (pAVar5->_item == 0x1a6) { if (pAVar5->_varData < 3) { if (unk2 == 0) { if (cVar4 != '\0') { pAVar5->_varData = pAVar5->_varData + 1; goto LAB_007b9e7b; } } else { this->_activeDesc[0]._varData = 3; } } } else if (((pAVar5->_item == 0x1dd) && (bVar1 = VoidHasCollectible(this,0x1a6), bVar1 != 0)) && (cVar4 != '\0')) { SetActiveCharge(this,0,slot); LAB_007b9e7b: cVar4 = '\0'; } slot = slot + 1; pAVar5 = pAVar5 + 1; if (3 < slot) { if (((this->_movingBoxContents)._begin != (this->_movingBoxContents)._end) && (bVar1 = HasCollectible(this,0x20b,0), bVar1 != 0)) { unk1 = 0; pvVar6 = (this->_movingBoxContents)._begin; iVar2 = (int)(this->_movingBoxContents)._end - (int)pvVar6; iVar3 = iVar2 >> 0x1f; if (iVar2 / 0x78 + iVar3 != iVar3) { iVar3 = 0; do { if (((*(int *)(iVar3 + (int)pvVar6) == 5) && (*(int *)(iVar3 + 4 + (int)pvVar6) == 100)) && (*(int *)(iVar3 + 8 + (int)pvVar6) == 0x1a6)) { if (unk2 == 0) { if ((cVar4 != '\0') && (iVar2 = *(int *)(iVar3 + 0x5c + (int)pvVar6), iVar2 < 3)) { *(int *)(iVar3 + 0x5c + (int)pvVar6) = iVar2 + 1; cVar4 = '\0'; } } else { *(undefined4 *)(iVar3 + 0x5c + (int)pvVar6) = 3; } } pvVar6 = (this->_movingBoxContents)._begin; iVar3 = iVar3 + 0x78; unk1 = unk1 + 1; } while ((uint)unk1 < (uint)(((int)(this->_movingBoxContents)._end - (int)pvVar6) / 0x78)) ; } } return; } } while( true ); } //@@ 007b9f60 Entity_Player::GetMouseAimTarget /* DB: ? NetInputDevice cursor 0x398 or GetFocusEntity pos prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity_Player::GetMouseAimTarget(Entity_Player *this,Vector *outTarget,byte isSkipNetCursor) { void *pvVar1; byte bVar2; char isLastRef; uint uVar3; int netDevice; int iVar4; int *windowSize; Entity *focusEntity; int unused; int extraout_ECX; float extraHeight; float pixelScale; int windowSizeBuf [2]; int device; int *deviceRefCount; double cursorY; double cursorX; float focusX; float local_14; void *local_10; undefined1 *puStack_c; int local_8; float cameraY; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00affddd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(windowSizeBuf + 0xe); ExceptionList = &local_10; iVar4 = this->_controllerIndex; InputManager::get_device(&PTR_vftable_00c57b18,&device,iVar4); local_8 = 0; if (device == 0) { netDevice = 0; } else { netDevice = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0,uVar3); } if (isSkipNetCursor == 0) { if ((netDevice == 0) || (*(char *)(netDevice + 0x3d4) == '\0')) goto LAB_007b9fe7; outTarget->x = *(float *)(netDevice + 0x398); outTarget->y = *(float *)(netDevice + 0x39c); LAB_007ba1ff: focusEntity = GetFocusEntity(this); if (focusEntity == (Entity *)0x0) { focusX = (this->_pos).x; local_14 = (this->_pos).y; } else { focusX = (focusEntity->_pos).x; local_14 = (focusEntity->_pos).y; } outTarget->x = (outTarget->x - focusX) * 0.2; outTarget->y = (outTarget->y - local_14) * 0.2; } else { if (netDevice != 0) { if (*(int *)(netDevice + 0x378) == 0) { iVar4 = -0x21524111; } else { iVar4 = *(int *)(*(int *)(netDevice + 0x378) + 0xc); } } LAB_007b9fe7: bVar2 = 0; if (((g_manager->_optionsConfig)._enableMouseControl == 0) || (iVar4 != 0)) goto LAB_007ba260; iVar4 = glfwGetMouseButton(); pvVar1 = g_glfwWindow; if (iVar4 == 0) goto LAB_007ba260; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x310); } cursorX = 0.0; cursorY = 0.0; if (_glfw == 0) { _glfwInputError(0x10001,0); } else if (*(int *)((int)pvVar1 + 0x70) == 0x34003) { cursorX = *(double *)((int)pvVar1 + 0x1e0); cursorY = *(double *)((int)pvVar1 + 0x1e8); } else { (*DAT_00c736a0)(pvVar1,&cursorX,&cursorY); } _isSkipNetCursor = (float)cursorX; local_14 = (float)cursorY; bVar2 = Room::IsMirrorWorld(g_game->_room); iVar4 = unused; if (bVar2 != 0) { windowSize = glfw_get_window_size(windowSizeBuf,unused); _isSkipNetCursor = (float)((double)*windowSize + __uint_to_double_fixup[-(*windowSize >> 0x1f)]) - _isSkipNetCursor; iVar4 = extraout_ECX; } windowSize = glfw_get_window_size(windowSizeBuf,iVar4); manager = g_manager; extraHeight = g_screenHeight - 182.0; pixelScale = (float)((double)windowSize[1] + __uint_to_double_fixup[-(windowSize[1] >> 0x1f)]) / DAT_00c79980; cameraY = *(float *)((int)g_game->_room + 0x1208); outTarget->x = ((_isSkipNetCursor / pixelScale - *(float *)((int)g_game->_room + 0x1204)) - (g_screenWidth - 338.0) * 0.5) / 0.65 + 60.0; outTarget->y = ((local_14 / pixelScale - cameraY) - extraHeight * 0.5) / 0.65 + 140.0; if (manager->_netplayManager == *(NetplayManager *)(manager + 1)) goto LAB_007ba1ff; } bVar2 = 1; LAB_007ba260: local_8 = 1; if (deviceRefCount != (int *)0x0) { isLastRef = (**(code **)(*deviceRefCount + 0xc))(); if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } } ExceptionList = local_10; return bVar2; } //@@ 007ba2b0 Entity_Player::update_baby_skin_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from player update when _variant==1 (co-op baby) or _isCoopGhost; switch on Entity_Player+0x1aec _babySkin (0,3,5,0x28,0x29..) spawning creep/troll bombs/blue spiders, "Dripping" overlay, HasCollectibleEffect checks prototype: db/protos.zhl */ void __thiscall Entity_Player::update_baby_skin_effects(Entity_Player *game) { code *pcVar1; byte bVar2; uint uVar3; Entity_Familiar **ppEVar4; Entity *spawnedEntity; int iVar5; BitSet128 *bombFlags; int *creepEffect; void *pvVar6; uint rngResult; Entity_Player *tmpPlayer; int enemyCount; Entity_Familiar **ppEVar7; Game *game; float fVar8; float fVar9; undefined4 uVar10; TypeDescriptor *pTVar11; TypeDescriptor *pTVar12; undefined4 uVar13; EntityRef sourceRef; int roomEntity; Entity_Familiar *local_a4 [2]; Entity_Familiar *local_9c; float local_98; undefined1 local_94 [12]; undefined4 *local_88; Entity_Player *local_84; int i; undefined1 tearHitParams [104]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; float pullStrength; undefined1 *blueFlyRef; qword bombFlagsHigh; qword bombFlagsLow; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00affe10; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(tearHitParams + 0x78); if (game->_dead != 0) { return; } iVar5 = game->_babySkin; ExceptionList = &local_10; local_84 = game; local_14 = uVar3; if (iVar5 == 0) { bVar2 = Entity::IsFrame((Entity *)game,0x78,game->_index); if ((bVar2 != 0) && (uVar3 = Random(), game = g_game, uVar3 % 0x1e == 0)) { enemyCount = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar5 = 0; if (0 < enemyCount) { iVar5 = enemyCount; } if ((iVar5 < 1) || (bVar2 = Entity::HasEntityFlags((Entity *)game,0x4000), bVar2 != 0)) goto LAB_007bb592; Room::FindFreePickupSpawnPosition(game->_room,(Vector *)(local_94 + 8),&game->_pos,0.0,1,0,0); game->_numBlueSpiders = game->_numBlueSpiders + 1; spawn_blue_spider((Vector *)(local_94 + 8),(Entity *)game,&g_vectorZero); } goto LAB_007bb58c; } if (iVar5 == 5) { i = 0; local_88 = g_game->_room; if (local_88[0x499] != 0) { do { roomEntity = *(int *)(local_88[0x497] + i * 4); if ((((1 < *(int *)&game->_deathmatchManager) && (*(int *)(roomEntity + 0x28) == 1)) || (*(int *)(roomEntity + 0x28) - 10U < 0x3de)) || (*(int *)(roomEntity + 0x28) == 9)) { local_a4[1] = (Entity_Familiar *)(game->_pos).y; local_9c = (Entity_Familiar *)(game->_pos).x; local_98 = (float)local_a4[1] - *(float *)(roomEntity + 0x340); local_84 = (Entity_Player *)((float)local_9c - *(float *)(roomEntity + 0x33c)); fVar8 = sqrtf(local_98 * local_98 + (float)local_84 * (float)local_84); if (0.0 < fVar8) { local_84 = (Entity_Player *)((float)local_84 * (1.0 / fVar8)); local_98 = local_98 * (1.0 / fVar8); } local_a4[0] = (Entity_Familiar *)0x3f666666; fVar8 = (float)local_a4[1] - *(float *)(roomEntity + 0x340); fVar9 = (float)local_9c - *(float *)(roomEntity + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); local_9c = (Entity_Familiar *)0x0; local_a4[1] = (Entity_Familiar *)(((300.0 - fVar8) * 0.9) / 300.0); ppEVar7 = local_a4 + 1; if ((float)local_a4[1] <= 0.0) { ppEVar7 = local_a4 + 2; } ppEVar4 = local_a4; if ((float)*ppEVar7 <= 0.9 && (float)*ppEVar7 != 0.9) { ppEVar4 = ppEVar7; } fVar8 = *(float *)(roomEntity + 0x36c); pullStrength = (float)*ppEVar4; if (fVar8 != 0.0) { *(float *)(roomEntity + 0x360) = (pullStrength * (float)local_84 * *(float *)(roomEntity + 0x39c)) / fVar8 + *(float *)(roomEntity + 0x360); *(float *)(roomEntity + 0x364) = (pullStrength * local_98 * *(float *)(roomEntity + 0x39c)) / fVar8 + *(float *)(roomEntity + 0x364); } } i = i + 1; } while ((uint)i < (uint)local_88[0x499]); } goto LAB_007bb592; } if (iVar5 == 6) { if ((g_game->_frameCount - game->_spawnFrame) % 900 != 0) goto LAB_007bb592; uVar3 = Random(); if ((uVar3 & 1) == 0) { game = g_game; if (g_game->_frameCount - game->_spawnFrame < 6) goto LAB_007bb592; uVar3 = Random(); uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; spawnedEntity = Game::Spawn(g_game,4,3,&game->_pos,&g_vectorZero,(Entity *)game,0,uVar3); iVar5 = __RTDynamicCast(spawnedEntity,uVar10,pTVar11,pTVar12,uVar13); if (iVar5 != 0) { bombFlags = GetBombFlags(game,(BitSet128 *)local_94,0); bombFlagsLow = bombFlags->_l; uVar10 = *(undefined4 *)((int)&bombFlags->_l + 4); bombFlagsHigh = bombFlags->_h; uVar13 = *(undefined4 *)((int)&bombFlags->_h + 4); *(undefined1 *)(iVar5 + 0x463) = 1; *(int *)(iVar5 + 0x438) = (int)bombFlagsLow; *(undefined4 *)(iVar5 + 0x43c) = uVar10; *(int *)(iVar5 + 0x440) = (int)bombFlagsHigh; *(undefined4 *)(iVar5 + 0x444) = uVar13; } } goto LAB_007bb58c; } if (iVar5 == 10) { uVar3 = Random(); if (uVar3 % 0x50 == 0) { uVar3 = Random(); uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; spawnedEntity = Game::Spawn(g_game,1000,0x2e,&game->_pos,&g_vectorZero,(Entity *)game,0,uVar3) ; creepEffect = (int *)__RTDynamicCast(spawnedEntity,uVar10,pTVar11,pTVar12,uVar13); uVar3 = Random(); fVar9 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.2; fVar8 = fVar9 * g_vectorOne.x; creepEffect[0x3a] = (int)(fVar9 * g_vectorOne.y); creepEffect[0x39] = (int)fVar8; (**(code **)(*creepEffect + 0xc))(); } bVar2 = IsExtraAnimationFinished(game); if (bVar2 == 0) goto LAB_007bb58c; LAB_007bb576: ANM2::PlayOverlay(&game->_sprite,(byte *)"Dripping",0); (game->_sprite)._overlayRenderFirst = 1; goto LAB_007bb58c; } if (iVar5 == 3) { pvVar6 = ANM2::GetAnimationData(&game->_sprite,(byte *)"Dripping"); if (pvVar6 != (void *)0x0) { bVar2 = IsExtraAnimationFinished(game); if (bVar2 != 0) goto LAB_007bb576; goto LAB_007bb58c; } LAB_007bade5: if (game->_babySkin == 0x28) { tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0xf8); if (bVar2 != 0) goto LAB_007bae5e; bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 == 0) || (uVar3 = Random(), uVar3 % 0x32 != 0)) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if (0x3e0 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU )) { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x3e0); goto LAB_007bad9f; } LAB_007bad98: local_94._0_4_ = 0; goto LAB_007bad9f; } LAB_007bae5e: if (game->_babySkin == 0x29) { tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0xce); if (bVar2 == 0) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 == 0) || (uVar3 = Random(), uVar3 % 0x32 != 0)) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if (0x338 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU)) { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x338); goto LAB_007bad9f; } goto LAB_007bad98; } } if (game->_babySkin == 0x2b) { tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0x7a); if (bVar2 == 0) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 == 0) || (uVar3 = Random(), uVar3 % 0x32 != 0)) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if (0x1e8 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU)) { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x1e8); goto LAB_007bad9f; } goto LAB_007bad98; } } if (game->_babySkin == 0x2d) { tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0xd6); if (bVar2 == 0) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 == 0) || (uVar3 = Random(), uVar3 % 0x32 != 0)) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if (0x358 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU)) { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x358); goto LAB_007bad9f; } goto LAB_007bad98; } } iVar5 = game->_babySkin; if (iVar5 != 0x30) { if (iVar5 == 0x2f) { bVar2 = Entity::IsFrame((Entity *)game,7,game->_index); if (bVar2 != 0) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_94, &game->_pos,150.0,8); local_8 = 0; i = 0; if (local_88 != (undefined4 *)0x0) { do { iVar5 = i; bVar2 = Entity::IsVulnerableEnemy(*(Entity **)(local_94._4_4_ + i * 4),(Entity *)0x0); if (bVar2 != 0) { pcVar1 = *(code **)(**(int **)(local_94._4_4_ + iVar5 * 4) + 0x20); EntityRef::constructor(&sourceRef,(Entity *)local_84); uVar3 = Random(); iVar5 = GetTearHitParams(tearHitParams,1,0x3f800000,(uVar3 & 1) * 2 + -1,0); (*pcVar1)(*(float *)(iVar5 + 0x48) * 0.3,0,0,&sourceRef,0x1e); iVar5 = i; } i = iVar5 + 1; } while ((uint)i < local_88); game = local_84; } EntityList_Query::~EntityList_Query(local_94); } goto LAB_007bb58c; } if (iVar5 != 0x32) { LAB_007bb2d2: if (game->_babySkin == 0x33) { tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0x22); if (bVar2 == 0) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (uVar3 = Random(), uVar3 % 0x32 == 0)) { pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if (0x88 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU)) { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x88); goto LAB_007bad9f; } goto LAB_007bad98; } goto LAB_007bb58c; } } game = g_game; if (game->_babySkin == 0x34) { bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x40); if (bVar2 != 0) goto LAB_007bb44f; bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if (bVar2 == 0) goto LAB_007bb592; uVar3 = Random(); if (uVar3 % 0x32 != 0) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU) < 0x101) { LAB_007bb3be: local_94._0_4_ = 0; } else { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x100); } LAB_007bb3c8: local_94._4_4_ = (undefined1 *)0x0; local_88 = (undefined4 *)0x0; local_94._8_4_ = 0x96; TemporaryEffects::AddEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),local_94,1,1); } else { if ((game->_babySkin == 0x31) && (tmpPlayer = GetMainPlayer(game), *(int *)&tmpPlayer->field_0x18e0 < 1)) { tmpPlayer = GetMainPlayer(game); iVar5 = *(int *)&tmpPlayer->field_0x18e0; if (iVar5 < 0x96) { iVar5 = 0x96; } *(int *)&tmpPlayer->field_0x18e0 = iVar5; goto LAB_007bb58c; } game = g_game; LAB_007bb44f: iVar5 = game->_babySkin; if (iVar5 == 0x35) { bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)game->_room + 0x7310),0xd7); if (bVar2 != 0) { LAB_007bb562: if (game->_isCoopGhost == 0) goto LAB_007bb592; LAB_007bb56b: bVar2 = IsExtraAnimationFinished(game); if (bVar2 == 0) goto LAB_007bb592; goto LAB_007bb576; } bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if (bVar2 == 0) goto LAB_007bb592; uVar3 = Random(); if (uVar3 % 0x32 == 0) { pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU ) < 0x35d) goto LAB_007bb3be; local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x35c); goto LAB_007bb3c8; } } else { if (iVar5 != 0x37) { if ((iVar5 != 0x3a) && (iVar5 != 0x3b)) goto LAB_007bb562; goto LAB_007bb56b; } if (*(int *)&game->field_0x1b14 != 0) goto LAB_007bb592; uVar13 = 0; pTVar12 = &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor; pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar10 = 0; spawnedEntity = AddBlueFlies(game,1,&game->_pos,(Entity *)0x0); local_a4[0] = (Entity_Familiar *) __RTDynamicCast(spawnedEntity,uVar10,pTVar11,pTVar12,uVar13); Entity_Familiar::set_player(local_a4[0],game); blueFlyRef = &game->field_0x1b14; if (*(int *)&game->field_0x1b14 != 0) { local_88 = (undefined4 *)blueFlyRef; std::multiset::erase(&local_88); } *(Entity_Familiar **)blueFlyRef = local_a4[0]; if (local_a4[0] != (Entity_Familiar *)0x0) { std::multiset::insert(blueFlyRef); } } } goto LAB_007bb58c; } tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0x19b); if (bVar2 != 0) goto LAB_007bb2d2; bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 == 0) || (uVar3 = Random(), uVar3 % 0x32 != 0)) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU) < 0x66d) { local_94._0_4_ = 0; local_94._4_4_ = &DAT_00000005; } else { local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x66c); local_94._4_4_ = &DAT_00000005; } goto LAB_007bada9; } bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (uVar3 = Random(), uVar3 % 0x32 == 0)) { local_98 = 0.0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,(uint)local_98); iVar5 = tmpPlayer->_coopBabyBuffTimers[0]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[0] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 1; EvaluateItems(); fVar8 = local_98; tmpPlayer = Game::GetPlayer(g_game,(uint)local_98); iVar5 = tmpPlayer->_coopBabyBuffTimers[1]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[1] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 2; EvaluateItems(); tmpPlayer = Game::GetPlayer(g_game,(uint)fVar8); iVar5 = tmpPlayer->_coopBabyBuffTimers[2]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[2] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x10; EvaluateItems(); tmpPlayer = Game::GetPlayer(g_game,(uint)fVar8); iVar5 = tmpPlayer->_coopBabyBuffTimers[3]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[3] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0xc; EvaluateItems(); tmpPlayer = Game::GetPlayer(g_game,(uint)fVar8); iVar5 = tmpPlayer->_coopBabyBuffTimers[4]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[4] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x400; EvaluateItems(); local_98 = (float)((int)fVar8 + 1); } while ((uint)local_98 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } } else { if (iVar5 == 0x1f) { if (game->_coopBabyBuffTimers[0] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[0]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[0] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 1; EvaluateItems(uVar3); i = i + 1; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x20) { if (game->_coopBabyBuffTimers[1] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[1]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[1] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 2; EvaluateItems(uVar3); i = i + 1; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x21) { if (game->_coopBabyBuffTimers[2] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[2]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[2] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x10; EvaluateItems(uVar3); i = i + 1; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x22) { if (game->_coopBabyBuffTimers[3] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[3]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[3] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0xc; EvaluateItems(uVar3); i = i + 1; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x23) { if (game->_coopBabyBuffTimers[4] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[4]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[4] = iVar5; tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x400; EvaluateItems(uVar3); i = i + 1; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x24) { if (game->_coopBabyBuffTimers[5] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[5]; if (iVar5 < 1) { tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x800; EvaluateItems(uVar3); iVar5 = tmpPlayer->_coopBabyBuffTimers[5]; } if (iVar5 < 0x96) { iVar5 = 0x96; } i = i + 1; tmpPlayer->_coopBabyBuffTimers[5] = iVar5; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x25) { if (game->_coopBabyBuffTimers[6] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(g_game,i); iVar5 = tmpPlayer->_coopBabyBuffTimers[6]; if (iVar5 < 1) { tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x800; EvaluateItems(uVar3); iVar5 = tmpPlayer->_coopBabyBuffTimers[6]; } if (iVar5 < 0x96) { iVar5 = 0x96; } i = i + 1; tmpPlayer->_coopBabyBuffTimers[6] = iVar5; } while ((uint)i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); game = g_game; game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 == 0x26) { if (game->_coopBabyBuffTimers[7] < 1) { bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 != 0) && (uVar3 = Random(), uVar3 % 0x32 == 0)) { i = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { tmpPlayer = Game::GetPlayer(game,i); game = g_game; iVar5 = tmpPlayer->_coopBabyBuffTimers[7]; if (iVar5 < 0x96) { iVar5 = 0x96; } tmpPlayer->_coopBabyBuffTimers[7] = iVar5; i = i + 1; } while ((uint)i < (uint)((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2)); game = local_84; } goto LAB_007bb592; } goto LAB_007bb58c; } goto LAB_007bade5; } if (iVar5 != 0x27) goto LAB_007bade5; tmpPlayer = GetMainPlayer(game); bVar2 = TemporaryEffects::HasCollectibleEffect(&tmpPlayer->_temporaryeffects,0x14); if (bVar2 != 0) goto LAB_007bade5; bVar2 = Entity::IsFrame((Entity *)game,0x1e,0); if ((bVar2 == 0) || (uVar3 = Random(), uVar3 % 0x32 != 0)) goto LAB_007bb58c; pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 & 0xfffffffcU) < 0x51) goto LAB_007bad98; local_94._0_4_ = *(undefined4 *)((int)pvVar6 + 0x50); LAB_007bad9f: local_94._4_4_ = (undefined1 *)0x0; LAB_007bada9: local_94._8_4_ = 0x96; local_88 = (undefined4 *)0x0; tmpPlayer = GetMainPlayer(game); TemporaryEffects::AddEffect(&tmpPlayer->_temporaryeffects,local_94,1,1); } LAB_007bb58c: game = g_game; LAB_007bb592: fVar8 = sin((float)game->_frameCount * 0.2); (game->_posOffset).y = fVar8 + fVar8; ExceptionList = local_10; return; } //@@ 007bb5e0 Entity_Player::coop_baby_death_effect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? TriggerDeath calls it when _variant==1 (co-op baby) before removal; spawns blue flies/spiders, ThrowSpider, FireTear, UseCard(0x14) prototype: db/protos.zhl */ void __thiscall Entity_Player::coop_baby_death_effect(Entity_Player *this) { Vector velocity; Vector targetPos; qword qVar1; qword qVar2; uint rngValue; Vector *spawnPos; Entity *spawned; BitSet128 *pBVar3; int *effect; undefined4 extraout_EAX; int iVar4; float fVar5; undefined1 auStack_58 [4]; float local_54; Entity_Player *local_50; float local_4c; undefined1 local_48 [16]; Color effectColor; uint local_c; Game *game; undefined4 temp_10305fbffd8d0a; undefined4 temp_12305fbffd8d0a; local_c = __security_cookie ^ (uint)auStack_58; iVar4 = this->_babySkin; local_50 = this; if (iVar4 == 0) { rngValue = Random(); iVar4 = rngValue % 3 + 1; if (iVar4 != 0) { do { rngValue = Random(); fVar5 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_50 = (Entity_Player *)(fVar5 + fVar5); rngValue = Random(); local_54 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 40.0; fVar5 = cos((float)local_50); local_48._0_4_ = fVar5 * local_54 + (this->_pos).x; fVar5 = sin((float)local_50); local_48._4_4_ = fVar5 * local_54 + (this->_pos).y; this->_numBlueSpiders = this->_numBlueSpiders + 1; spawn_blue_spider((Vector *)local_48,(Entity *)this,&g_vectorZero); iVar4 = iVar4 + -1; } while (iVar4 != 0); return; } } else { if (iVar4 == 1) { rngValue = Random(); game = g_game; spawnPos = Room::FindFreeTilePosition(g_game->_room,(Vector *)local_48,&local_50->_pos,0.0); Game::SpawnEx(game,5,10,spawnPos,&g_vectorZero,(Entity *)local_50,0,rngValue,0); return; } if (iVar4 == 3) { iVar4 = 0; do { local_54 = (float)iVar4 * 0.017453292; fVar5 = cos(local_54); local_50 = (Entity_Player *)(fVar5 * 10.0); local_4c = sin(local_54); local_4c = local_4c * 10.0; velocity.y = local_4c; velocity.x = (float)local_50; FireTear(this,&this->_pos,velocity,3,(Entity *)0x0,1.0); iVar4 = iVar4 + 0x2d; } while (iVar4 < 0x168); return; } if (iVar4 == 6) { rngValue = Random(); spawned = Game::SpawnEx(g_game,4,3,&this->_pos,&g_vectorZero,(Entity *)this,0,rngValue,0); iVar4 = __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0); if (iVar4 != 0) { pBVar3 = GetBombFlags(this,(BitSet128 *)local_48,0); qVar1 = pBVar3->_l; temp_10305fbffd8d0a = *(undefined4 *)((int)&pBVar3->_l + 4); qVar2 = pBVar3->_h; temp_12305fbffd8d0a = *(undefined4 *)((int)&pBVar3->_h + 4); *(undefined1 *)(iVar4 + 0x463) = 1; *(int *)(iVar4 + 0x438) = (int)qVar1; *(undefined4 *)(iVar4 + 0x43c) = temp_10305fbffd8d0a; *(int *)(iVar4 + 0x440) = (int)qVar2; *(undefined4 *)(iVar4 + 0x444) = temp_12305fbffd8d0a; return; } } else if (iVar4 == 9) { rngValue = Random(); iVar4 = rngValue % 3 + 1; if (iVar4 != 0) { do { Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)local_48,&this->_pos,100.0,0,0,0); targetPos.y = (float)local_48._4_4_; targetPos.x = (float)local_48._0_4_; Entity_NPC::ThrowSpider(&this->_pos,(Entity *)this,targetPos,0,-30.0); iVar4 = iVar4 + -1; } while (iVar4 != 0); return; } } else if (iVar4 == 0xf) { rngValue = Random(); local_54 = (float)(rngValue % 3 + 1); if (local_54 != 0.0) { do { rngValue = Random(); spawnPos = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)local_48,&this->_pos,40.0,0,0,0); Game::SpawnEx(g_game,5,0x14,spawnPos,&g_vectorZero,(Entity *)this,0,rngValue,0); local_54 = (float)((int)local_54 + -1); } while (local_54 != 0.0); return; } } else { if (iVar4 == 0x13) { rngValue = Random(); game = g_game; spawnPos = Room::FindFreeTilePosition(g_game->_room,(Vector *)local_48,&local_50->_pos,0.0); Game::SpawnEx(game,5,0x28,spawnPos,&g_vectorZero,(Entity *)0x0,0,rngValue,0); return; } if (iVar4 == 10) { rngValue = Random(); spawned = Game::SpawnEx(g_game,1000,0x25,&this->_pos,&g_vectorZero,(Entity *)this,0,rngValue ,0); effect = (int *)__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor ,&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0 ); Color::Color(&effectColor); (**(code **)(*effect + 0x3c))(extraout_EAX,0xffffffff,0xff,0,1); (**(code **)(*effect + 0xc))(); return; } if (iVar4 == 0xe) { rngValue = Random(); Game::SpawnEx(g_game,5,0,&this->_pos,&g_vectorZero,(Entity *)0x0,0,rngValue,0); return; } if (iVar4 == 0x16) { rngValue = Random(); AddBlueFlies(this,rngValue % 3 + 1,&this->_pos,(Entity *)0x0); return; } if ((iVar4 == 2) || (iVar4 == 0x37)) { effect = *(int **)&this->field_0x1b14; if (effect == (int *)0x0) { return; } } else { if (iVar4 == 0x17) { rngValue = Random(); game = g_game; spawnPos = Room::FindFreeTilePosition (g_game->_room,(Vector *)local_48,&local_50->_pos,0.0); Game::SpawnEx(game,5,10,spawnPos,&g_vectorZero,(Entity *)local_50,2,rngValue,0); return; } if (iVar4 == 0x2e) { UseCard(this,0x14,0); return; } if (iVar4 != 0x38) { return; } if (*(int **)&this->field_0x1b14 == (int *)0x0) { return; } (**(code **)(**(int **)&this->field_0x1b14 + 0x28))(); effect = *(int **)(*(int *)&this->field_0x1b14 + 0x3c0); if (effect == (int *)0x0) { return; } if (effect[10] != 3) { return; } if (effect[0xb] != 0x21) { return; } } (**(code **)(*effect + 0x28))(); } } return; } //@@ 007bbbd0 Entity_Player::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? no direct callers (vtable Init); firstPlayer=Entity_Player: looks up EntityConfig_Player by _playerType 0x13c0 ("Could not load config for player type %d"), stores GetDisplayName into +0x13c4, sets red hearts/max (+0x1340/+0x1344) and armor from config, many inline RNG::Next ("RNG Seed is zero!") */ void Entity_Player::Init(void) { undefined4 uVar1; code *pcVar2; undefined4 uVar3; undefined4 uVar4; byte bVar5; uint uVar6; void *pvVar7; int *extraout_EAX; int iVar8; Entity_Player *firstPlayer; ItemConfig_Item *collectibleID; byte rngShift2; byte rngShift3; Entity_Player *in_ECX; void *extraout_ECX; int iVar9; int *backupPlayer; uint uVar10; EntityConfig_Player *playerConfig; float rngFloat; undefined1 local_68 [8]; void *foundNode; uint initSeed; Manager *local_58; uint local_54; uint local_50; void *pvStack_4c; RNG rng; uint local_38; std_string *local_34; void *local_30; void *displayName [4]; uint displayNameSize; uint displayNameCapacity; uint stackCookie; void *local_10; undefined1 *puStack_c; void *local_8; Game *game; local_8 = (void *)0xffffffff; puStack_c = &LAB_00affe63; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(displayName + 10); ExceptionList = &local_10; initSeed = in_ECX->_initSeed; rng._shift1 = 1; rng._shift2 = 5; local_38 = 0x13; rng._shift3 = 0x13; stackCookie = uVar6; if ((in_ECX->_playerType < 0) || (pvVar7 = (void *)in_ECX->_playerType, ((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= (int)pvVar7)) { playerConfig = (EntityConfig_Player *)0x0; LAB_007bbc6a: KAGE_LogMessage(0x10,(byte *)"Could not load config for player type %d\n"); pvVar7 = extraout_ECX; } else { playerConfig = (EntityConfig_Player *) ((int)pvVar7 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); if (playerConfig == (EntityConfig_Player *)0x0) goto LAB_007bbc6a; } local_34 = EntityConfig_Player::GetDisplayName(playerConfig,(std_string *)displayName,pvVar7); if (&in_ECX->_name != local_34) { std::string::_Tidy_deallocate((in_ECX->_name)._buf); uVar1 = *(undefined4 *)(local_34->_buf + 4); uVar3 = *(undefined4 *)(local_34->_buf + 8); uVar4 = *(undefined4 *)(local_34->_buf + 0xc); *(undefined4 *)(in_ECX->_name)._buf = *(undefined4 *)local_34->_buf; *(undefined4 *)((in_ECX->_name)._buf + 4) = uVar1; *(undefined4 *)((in_ECX->_name)._buf + 8) = uVar3; *(undefined4 *)((in_ECX->_name)._buf + 0xc) = uVar4; uVar10 = local_34->_capacity; (in_ECX->_name)._size = local_34->_size; (in_ECX->_name)._capacity = uVar10; local_34->_size = 0; local_34->_capacity = 0xf; local_34->_buf[0] = '\0'; } if (0xf < displayNameCapacity) { uVar10 = displayNameCapacity + 1; pvVar7 = displayName[0]; if (0xfff < uVar10) { pvVar7 = *(void **)((int)displayName[0] + -4); uVar10 = displayNameCapacity + 0x24; if (0x1f < (uint)((int)displayName[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar10); } displayNameSize = 0; displayNameCapacity = 0xf; displayName[0] = (void *)((uint)displayName[0] & 0xffffff00); if ((in_ECX->_playerType == 10) || (in_ECX->_playerType == 0x1f)) { uVar1 = *(undefined4 *)((int)&in_ECX->_flags + 4); *(uint *)&in_ECX->_flags = (uint)in_ECX->_flags | 0x10000; *(undefined4 *)((int)&in_ECX->_flags + 4) = uVar1; } iVar9 = playerConfig->_heart * 8; if (*(int *)&g_game->_deathmatchManager < 2) { iVar9 = playerConfig->_heart; } in_ECX->_maxHearts = iVar9; in_ECX->_redHearts = iVar9; in_ECX->_soulHearts = playerConfig->_armor; local_58 = g_manager; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c812ac) && (_Init_thread_header(&DAT_00c812ac,uVar6), DAT_00c812ac == -1)) { local_8 = (void *)0x0; PersistentGameData::constructor((PersistentGameData *)&DAT_00c812b0); _atexit(FUN_00b15ba0); local_8 = (void *)0xffffffff; _Init_thread_footer(&DAT_00c812ac); } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar9 = *(int *)&in_ECX->field_0x1e50; if (iVar9 == 0) { pvStack_4c = (void *)0x0; local_50 = 0; } else { local_50 = *(uint *)(iVar9 + 8); pvStack_4c = *(void **)(iVar9 + 0xc); } local_34 = (std_string *)&g_manager[1]._gamestate.field_0xc0; local_54 = local_50; local_30 = pvStack_4c; FUN_00731ee0(local_68,&local_50); if (((*(char *)((int)foundNode + 0xd) == '\0') && (*(void **)((int)foundNode + 0x14) <= local_30)) && ((*(void **)((int)foundNode + 0x14) < local_30 || (*(uint *)((int)foundNode + 0x10) <= local_54)))) { pvVar7 = foundNode; } else { pvVar7 = *(void **)local_34->_buf; } if (pvVar7 != *(void **)local_34->_buf) { FUN_00914150(&local_50); } } iVar9 = in_ECX->_playerType; if (iVar9 == 0x10) { in_ECX->_soulHearts = 0; in_ECX->_redHearts = 0; in_ECX->_maxHearts = 0; AddBoneHearts(in_ECX,playerConfig->_heart / 2); AddHearts(in_ECX,playerConfig->_heart,0,0); uVar1 = *(undefined4 *)((int)&in_ECX->_flags + 4); *(uint *)&in_ECX->_flags = (uint)in_ECX->_flags | 0x10000; *(undefined4 *)((int)&in_ECX->_flags + 4) = uVar1; } else if (iVar9 != 0x11) { if (iVar9 == 0xe) { if (((local_58->_persistentGameData)._achievements[0xbf] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { in_ECX->_maxHearts = in_ECX->_maxHearts + 2; in_ECX->_redHearts = in_ECX->_redHearts + 2; } goto LAB_007bbfd5; } if (iVar9 == 0x1d) { if ((((in_ECX->_backupPlayer == (void *)0x0) && (-1 < in_ECX->_playerIndex)) && (g_game->_isStartingFromState == 0)) && (g_game->_isRestoringGlowingHourglassState == 0)) { local_58 = operator_new(0x2f00); local_8 = (void *)0x1; if (local_58 == (Manager *)0x0) { backupPlayer = (int *)0x0; } else { constructor((Entity_Player *)local_58); backupPlayer = extraout_EAX; } local_8 = (void *)0xffffffff; in_ECX->_backupPlayer = backupPlayer; (**(code **)(*backupPlayer + 4))(in_ECX->_type,in_ECX->_variant,0x26,in_ECX->_initSeed); *(Entity_Player **)((int)in_ECX->_backupPlayer + 0x1e6c) = in_ECX; *(undefined1 *)((int)in_ECX->_backupPlayer + 0x172) = 0; } goto LAB_007bbfd5; } if (iVar9 == 0x12) { bVar5 = HasCollectible(in_ECX,0x248,0); if (bVar5 != 0) { IncrementPlayerFormCounter(in_ECX,10,1); } goto LAB_007bbfd5; } if (iVar9 == 0x24) { AddBloodCharge(in_ECX,in_ECX->_redHearts); in_ECX->_maxHearts = 0; in_ECX->_redHearts = 0; goto LAB_007bbfd5; } if (iVar9 != 0x25) goto LAB_007bbfd5; } init_forgotten_twin(in_ECX); LAB_007bbfd5: AddBlackHearts(in_ECX,playerConfig->_blackHeart); AddBrokenHearts(in_ECX,playerConfig->_brokenHeart); iVar9 = in_ECX->_playerType; if (iVar9 == 0x16) { iVar8 = in_ECX->_maxHearts; if (4 < iVar8) { iVar8 = 4; } in_ECX->_redHearts = iVar8; } if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { firstPlayer = Game::GetPlayer(g_game,0); ConsumableCountChanged(firstPlayer,-1); iVar9 = in_ECX->_playerType; } if (DAT_00c7ac69 == '\0') { if (iVar9 == 0x19) { AddPoopMana(in_ECX,playerConfig->_bombs); poop_spell_roll(in_ECX); } else { AddBombs(in_ECX,playerConfig->_bombs); } AddKeys(in_ECX,playerConfig->_keys); AddCoins(in_ECX,playerConfig->_coins); iVar9 = in_ECX->_playerType; } if (iVar9 == 0xe) { if (((g_manager->_persistentGameData)._achievements[0xbf] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { in_ECX->_numCoins = in_ECX->_numCoins + 1; } } else if ((iVar9 == 0x12) && (0 < in_ECX->_soulHearts)) { AddSoulCharge(in_ECX,in_ECX->_soulHearts); game = g_game; in_ECX->_soulHearts = 0; if (*(int *)&game->_deathmatchManager < 2) { in_ECX->_blackHearts = 0; } } if ((playerConfig->_id == 9) || (playerConfig->_id == 0x1e)) { if (initSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = initSeed >> ((byte)rng._shift1 & 0x1f) ^ initSeed; uVar6 = uVar6 << ((byte)rng._shift2 & 0x1f) ^ uVar6; rng._seed = uVar6 >> ((byte)local_38 & 0x1f) ^ uVar6; iVar9 = (rng._seed & 3U) * 2; in_ECX->_maxHearts = iVar9; in_ECX->_redHearts = iVar9; uVar6 = RNG::RandomInt(&rng,4 - (rng._seed & 3U)); in_ECX->_soulHearts = uVar6 * 2; if ((in_ECX->_redHearts == 0) && ((int)(uVar6 * 2) < 3)) { in_ECX->_soulHearts = 4; } if ((void *)rng._seed == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } bVar5 = (byte)rng._shift1; uVar6 = (uint)rng._seed >> (bVar5 & 0x1f) ^ rng._seed; rngShift2 = (byte)rng._shift2; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; rngShift3 = (byte)rng._shift3; local_30 = (void *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); if (local_30 != (void *)(((uint)local_30 / 3) * 3)) { if (local_30 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_30 >> (bVar5 & 0x1f) ^ (uint)local_30; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; local_30 = (void *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); if (((uint)local_30 & 1) != 0) { if (local_30 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_30 >> (bVar5 & 0x1f) ^ (uint)local_30; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; rng._seed = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; local_30 = (void *)rng._seed; if ((uint)rng._seed % 3 == 0) { if ((void *)rng._seed == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)rng._seed >> (bVar5 & 0x1f) ^ rng._seed; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; local_30 = (void *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); in_ECX->_numCoins = (uint)local_30 % 5 + 1; } else if ((uint)rng._seed % 3 == 1) { in_ECX->_numKeys = 1; } else { uVar6 = RNG::RandomInt(&rng,2); in_ECX->_numBombs = uVar6 + 1; local_30 = (void *)rng._seed; } } } if (local_30 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } bVar5 = (byte)rng._shift1; local_38 = (uint)local_30 >> (bVar5 & 0x1f) ^ (uint)local_30; rngShift2 = (byte)rng._shift2; local_38 = local_38 << (rngShift2 & 0x1f) ^ local_38; rngShift3 = (byte)rng._shift3; local_38 = local_38 >> (rngShift3 & 0x1f) ^ local_38; rngFloat = (float)((double)(int)local_38 + __uint_to_double_fixup[-((int)local_38 >> 0x1f)]) * 2.3283062e-10; in_ECX->_edenDamage = (rngFloat + rngFloat) - 1.0; if (local_38 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = local_38 >> (bVar5 & 0x1f) ^ local_38; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; local_34 = (std_string *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); in_ECX->_edenSpeed = (float)((double)(int)local_34 + __uint_to_double_fixup[-((int)local_34 >> 0x1f)]) * 2.3283062e-10 * 0.3 - 0.15; if (local_34 == (std_string *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_34 >> (bVar5 & 0x1f) ^ (uint)local_34; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; local_34 = (std_string *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); in_ECX->_edenFireDelay = (float)((double)(int)local_34 + __uint_to_double_fixup[-((int)local_34 >> 0x1f)]) * 2.3283062e-10 * 1.5 - 0.75; if (local_34 == (std_string *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_34 >> (bVar5 & 0x1f) ^ (uint)local_34; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; local_34 = (std_string *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); in_ECX->_edenTearRange = (float)((double)(int)local_34 + __uint_to_double_fixup[-((int)local_34 >> 0x1f)]) * 2.3283062e-10 * 120.0 - 60.0; if (local_34 == (std_string *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_34 >> (bVar5 & 0x1f) ^ (uint)local_34; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; local_34 = (std_string *)(uVar6 >> (rngShift3 & 0x1f) ^ uVar6); in_ECX->_edenShotSpeed = (float)((double)(int)local_34 + __uint_to_double_fixup[-((int)local_34 >> 0x1f)]) * 2.3283062e-10 * 0.5 - 0.25; if (local_34 == (std_string *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = (uint)local_34 >> (bVar5 & 0x1f) ^ (uint)local_34; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; rngFloat = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10; in_ECX->_edenLuck = (rngFloat + rngFloat) - 1.0; } local_38 = g_game->_challenge; if (local_38 != 0) { local_30 = (g_manager->_challengeParams)._begin; uVar10 = ((int)(g_manager->_challengeParams)._end - (int)local_30) / 0xa4 - 1; uVar6 = local_38; if (uVar10 <= local_38) { uVar6 = uVar10; } iVar9 = *(int *)(uVar6 * 0xa4 + 0x60 + (int)local_30); local_30 = (void *)(uVar6 * 0xa4 + (int)local_30); if (iVar9 != 0) { AddMaxHearts(in_ECX,iVar9,0); } if (*(int *)((int)local_30 + 0x5c) != 0) { AddHearts(in_ECX,*(int *)((int)local_30 + 0x5c),0,0); } if (0 < *(int *)((int)local_30 + 0x54)) { AddSoulHearts(in_ECX,*(int *)((int)local_30 + 0x54),0); } if (0 < *(int *)((int)local_30 + 0x58)) { AddBlackHearts(in_ECX,*(int *)((int)local_30 + 0x58)); } if (*(int *)((int)local_30 + 100) != 0) { AddCoins(in_ECX,*(int *)((int)local_30 + 100)); } UpdateBlackHeartMask(in_ECX); } game = g_game; local_38 = 0x21; std::set::find_node(local_68,&local_38); if (((*(char *)((int)foundNode + 0xd) == '\0') && (*(int *)((int)foundNode + 0x10) < 0x22)) && (foundNode != (game->_seedEffects)._seedEffects)) { AddCoins(in_ECX,0x45); } game = g_game; local_38 = 0x2e; std::set::find_node(local_68,&local_38); if (((*(char *)((int)foundNode + 0xd) == '\0') && (*(int *)((int)foundNode + 0x10) < 0x2f)) && (foundNode != (game->_seedEffects)._seedEffects)) { pvVar7 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar7 & 0xfffffffcU) < 0x3d) { collectibleID = (ItemConfig_Item *)0x0; } else { collectibleID = *(ItemConfig_Item **)((int)pvVar7 + 0x3c); } AddCostume(in_ECX,collectibleID,0); } ExceptionList = local_10; return; } //@@ 007bc740 Entity_Player::InitPostLevelInitStats /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: own log string names it; challenge/daily starting items */ void __thiscall Entity_Player::InitPostLevelInitStats(Entity_Player *this) { code *pcVar1; int *piVar2; byte bVar3; char cVar4; uint uVar5; PersistentGameData *pPVar6; Entity_Player *tmpPlayer; int iVar7; ItemConfig_Item *collectibleConfig; void *pvVar8; Entity *familiar; byte shift2; byte shift3; ColorMod *other; NetplayManager *netplayManager; undefined4 *playerList; void *collectibles; Game *extraout_EDX; Game *extraout_EDX_00; Game *extraout_EDX_01; Game *pGVar9; Game *extraout_EDX_02; uint uVar10; uint uVar11; Entity_Player *pEVar12; int *piVar13; int iVar14; int *piVar15; ChallengeParam *pCVar16; undefined1 local_120 [8]; int local_118; undefined1 local_114 [8]; int local_10c; uint local_108; uint local_104; uint local_100; ItemConfig *local_fc; undefined4 razorBladeId; undefined4 woodenNickelId; undefined4 d6Id; int tmpEffect [3]; undefined4 local_e0; undefined8 local_dc; uint local_d4; ChallengeParam *local_d0; RNG rng; uint local_bc; ChallengeParam *pCStack_b8; ItemConfig *local_b4; int rngShift3; uint local_ac; uint uStack_a8; PersistentGameData *local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; PersistentGameData *local_94; uint local_90; Entity_Player *playerCopy; undefined4 local_88; int *itemsBegin; int *itemsEnd; int *itemsCapacity; Manager *local_78; int *local_74; Color tintColor; RNG cardRng; RNG local_34; RNG tmpRng; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Player *twin; Manager *manager; pGVar9 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00affeb0; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar10 = this->_initSeed; rng._shift1 = 1; rng._shift2 = 5; rngShift3 = 0x13; rng._shift3 = 0x13; rng._seed = uVar10; local_90 = uVar10; playerCopy = this; local_14 = uVar5; local_d0 = Game::GetChallengeParams(g_game); uStack_a8 = playerCopy->_playerType; if (((int)uStack_a8 < 0) || (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= (int)uStack_a8)) { local_a4 = (PersistentGameData *)0x0; LAB_007bc81f: KAGE_LogMessage(0x10,(byte *)"Could not load config for player type %d\n"); pGVar9 = g_game; } else { local_a4 = (PersistentGameData *) (uStack_a8 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); if (local_a4 == (PersistentGameData *)0x0) goto LAB_007bc81f; } pEVar12 = playerCopy; manager = g_manager; pCStack_b8 = (ChallengeParam *)pGVar9->_frameCount; local_94 = &g_manager->_persistentGameData; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar14 = *(int *)&playerCopy->field_0x1e50; if (iVar14 == 0) { local_dc = 0; local_dc._4_4_ = (ItemConfig *)0x0; local_dc._0_4_ = 0; local_fc = local_dc._4_4_; local_100 = (uint)local_dc; } else { local_fc = *(ItemConfig **)(iVar14 + 0xc); local_100 = *(uint *)(iVar14 + 8); } local_b4 = local_fc; uStack_a8 = local_100; FUN_00731ee0(local_114,&local_100); if ((((*(char *)(local_10c + 0xd) == '\0') && (*(undefined1 **)(local_10c + 0x14) <= local_b4)) && ((*(undefined1 **)(local_10c + 0x14) < local_b4 || (*(uint *)(local_10c + 0x10) <= uStack_a8)))) && ((local_10c != *(int *)&manager[1]._gamestate.field_0xc0 && (pPVar6 = (PersistentGameData *)FUN_00914150(&local_100), pPVar6 != (PersistentGameData *)0x0)))) { local_94 = pPVar6; } else { if (*(int *)&pEVar12->field_0x1e50 == 0) { local_dc = 0; } KAGE_LogMessage(4,(byte *) "Entity_Player::InitPostLevelInitStats -> Failed to find save data for player %llu, this will incorrectly use the local save data for this player!\n" ); } pGVar9 = g_game; } manager = g_manager; bVar3 = TemporaryEffects::HasCollectibleEffect(&playerCopy->_temporaryeffects,0x29b); pEVar12 = playerCopy; if (bVar3 != 0) { EvaluateItems(uVar5); tmpPlayer = Game::GetPlayer(g_game,0); ConsumableCountChanged(tmpPlayer,-1); goto LAB_007bea6e; } iVar14 = *(int *)(local_a4->_achievements + 0x90); if (iVar14 == 0) { iVar14 = *(int *)(local_a4->_achievements + 0x94); if (iVar14 == 0) { if (playerCopy->_playerType == 1) { if ((local_94->_achievements[0x14c] != 0) || (((manager->_state == 2 && (pGVar9 != (Game *)0x0)) && (((pGVar9->_dailyChallenge)._id != 0 || (pGVar9->_isDebug != 0)))))) { uVar5 = ItemPool::ForceAddPillEffect(&pGVar9->_itemPool,5); uVar11 = 0; do { uStack_a8 = ItemPool::ForceAddPillEffect(&g_game->_itemPool,7); if ((uVar5 != uStack_a8) || (uVar5 = ItemPool::ForceAddPillEffect(&g_game->_itemPool,5), uVar5 != uStack_a8)) break; uVar11 = uVar11 + 1; } while (uVar11 < 10); AddPocketItem(playerCopy,uVar5,0); uVar11 = -(uint)((uVar5 & 0x7ff) != 0) & uVar5 & 0x7ff; uVar5 = 0xe; if (uVar11 < 0xe) { uVar5 = uVar11; } *(undefined1 *)((int)(&g_game->_itemPool + 1) + uVar5 + 0x3c) = 1; } pEVar12 = playerCopy; } } else { if (iVar14 < 1) { iVar14 = ItemPool::GetPill(playerCopy->_initSeed); } AddPocketItem(pEVar12,iVar14,0); } } else if (iVar14 < 1) { iVar14 = playerCopy->_initSeed; iVar7 = ItemPool::GetCardEx(iVar14,0x19,10,10,1); cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._shift3 = 7; cardRng._seed = iVar14; iVar14 = lua_callback_run_get_card(&cardRng,iVar7,1,1,0); AddPocketItem(pEVar12,iVar14,1); uVar10 = local_90; } else { AddPocketItem(playerCopy,iVar14,1); } std::vector::copy_constructor(local_a4->_achievements + 0x9c); pPVar6 = local_94; local_8 = 0; if (g_game->_challenge == 0) { if ((pEVar12->_playerType == 0) && ((local_94->_achievements[0x1d] != 0 || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { d6Id = 0x69; if (itemsEnd == itemsCapacity) { std::vector::_Emplace_reallocate(itemsEnd,&d6Id); } else { *itemsEnd = 0x69; itemsEnd = itemsEnd + 1; } } if ((pEVar12->_playerType == 0xe) && ((pPVar6->_achievements[0xec] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { woodenNickelId = 0x15d; if (itemsEnd == itemsCapacity) { std::vector::_Emplace_reallocate(itemsEnd,&woodenNickelId); } else { *itemsEnd = 0x15d; itemsEnd = itemsEnd + 1; } } if ((pEVar12->_playerType == 5) && ((pPVar6->_achievements[0xf8] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { razorBladeId = 0x7e; if (itemsEnd == itemsCapacity) { std::vector::_Emplace_reallocate(itemsEnd,&razorBladeId); } else { *itemsEnd = 0x7e; itemsEnd = itemsEnd + 1; } } } switch((g_game->_dailyChallenge)._specialDailyId) { case 1: AddBombs(pEVar12,99); break; case 3: pEVar12->_luckModifier = pEVar12->_luckModifier + 7; local_9c = 0x17e; std::vector::push_back(&local_9c); local_a0 = 200; std::vector::push_back(&local_a0); local_98 = 0x3f; std::vector::push_back(&local_98); break; case 5: piVar15 = (int *)((int)(pEVar12->_pillEffectUses)._begin + 0x48); *piVar15 = *piVar15 + 0x12; pEVar12->_cacheFlags = pEVar12->_cacheFlags | 0x400; Color::Color(&tintColor); tintColor._colorize[0] = 0.0; tintColor._colorize[1] = 1.0; tintColor._colorize[2] = 0.0; tintColor._colorize[3] = 0.6; Color::operator_assign((Color *)&pEVar12->field_0x16e0,other); (**(code **)(*(int *)pEVar12 + 0x3c))(&tintColor,1,0xff,0,1); break; case 6: local_98 = 0x8a; std::vector::push_back(&local_98); local_9c = 7; std::vector::push_back(&local_9c); local_a0 = 0x53; std::vector::push_back(&local_a0); break; case 8: local_98 = 0x1f; std::vector::push_back(&local_98); local_9c = 0x29; std::vector::push_back(&local_9c); local_a0 = 0x37; std::vector::push_back(&local_a0); break; case 9: local_98 = 0xa3; std::vector::push_back(&local_98); local_9c = 0x43; std::vector::push_back(&local_9c); local_a0 = 8; std::vector::push_back(&local_a0); local_88 = 0x10c; std::vector::push_back(&local_88); local_78 = (Manager *)0x109; std::vector::push_back(&local_78); local_74 = (int *)0xf7; std::vector::push_back(&local_74); break; case 10: local_74 = (int *)0xaf; std::vector::push_back(&local_74); local_78 = (Manager *)0xaa; std::vector::push_back(&local_78); local_88 = 0x74; std::vector::push_back(&local_88); break; case 0xb: local_74 = (int *)0xbf; std::vector::push_back(&local_74); local_78 = (Manager *)0x1a2; std::vector::push_back(&local_78); local_88 = 0xae; std::vector::push_back(&local_88); break; case 0xc: local_74 = (int *)0x34; std::vector::push_back(&local_74); local_78 = (Manager *)0x16e; std::vector::push_back(&local_78); local_88 = 0x14a; std::vector::push_back(&local_88); local_98 = 0x247; std::vector::push_back(&local_98); break; case 0xd: local_a0 = 0x1a8; std::vector::push_back(&local_a0); break; case 0xe: itemsEnd = itemsBegin; local_a0 = 0x51; std::vector::push_back(&local_a0); break; case 0x10: local_a0 = 0x30; std::vector::push_back(&local_a0); break; case 0x11: local_a0 = 0x84; std::vector::push_back(&local_a0); local_9c = 0xad; std::vector::push_back(&local_9c); break; case 0x12: local_9c = 0x5d; std::vector::push_back(&local_9c); pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 >> 2 < 0x24) { AddCostume(pEVar12,(ItemConfig_Item *)0x0,0); } else { AddCostume(pEVar12,*(ItemConfig_Item **)((int)pvVar8 + 0x8c),0); } break; case 0x13: local_9c = 0x84; std::vector::push_back(&local_9c); local_a0 = 0x4a; std::vector::push_back(&local_a0); AddKeys(pEVar12,1); break; case 0x14: local_74 = (int *)0x91; std::vector::push_back(&local_74); local_78 = (Manager *)0x86; std::vector::push_back(&local_78); local_88 = 0xd4; std::vector::push_back(&local_88); break; case 0x16: local_74 = (int *)0x17a; std::vector::push_back(&local_74); local_78 = (Manager *)&DAT_00000006; std::vector::push_back(&local_78); local_88 = 0xd1; std::vector::push_back(&local_88); local_98 = 0x123; std::vector::push_back(&local_98); break; case 0x17: local_74 = (int *)0x96; std::vector::push_back(&local_74); local_78 = (Manager *)0x1be; std::vector::push_back(&local_78); local_88 = 0x56; std::vector::push_back(&local_88); break; case 0x18: local_74 = (int *)0x14a; std::vector::push_back(&local_74); local_78 = (Manager *)0x1b4; std::vector::push_back(&local_78); break; case 0x19: local_74 = (int *)0x174; std::vector::push_back(&local_74); local_78 = (Manager *)0x74; std::vector::push_back(&local_78); local_88 = 0x3f; std::vector::push_back(&local_88); local_98 = 0x164; std::vector::push_back(&local_98); local_9c = 0x8b; std::vector::push_back(&local_9c); break; case 0x1a: local_74 = (int *)0x19d; std::vector::push_back(&local_74); local_78 = (Manager *)0x186; std::vector::push_back(&local_78); local_88 = 499; std::vector::push_back(&local_88); break; case 0x1b: local_74 = (int *)&DAT_00000068; std::vector::push_back(&local_74); local_78 = (Manager *)0x18d; std::vector::push_back(&local_78); local_88 = 0x1c9; std::vector::push_back(&local_88); break; case 0x1d: local_74 = (int *)&DAT_00000043; std::vector::push_back(&local_74); local_78 = (Manager *)&DAT_00000008; std::vector::push_back(&local_78); local_88 = 0xa3; std::vector::push_back(&local_88); local_98 = 99; std::vector::push_back(&local_98); local_9c = 100; std::vector::push_back(&local_9c); local_a0 = 0x142; std::vector::push_back(&local_a0); break; case 0x1e: local_74 = (int *)0x111; std::vector::push_back(&local_74); local_78 = (Manager *)0x13c; std::vector::push_back(&local_78); local_88 = 0x173; std::vector::push_back(&local_88); local_98 = 0x51; std::vector::push_back(&local_98); local_9c = 0x81; std::vector::push_back(&local_9c); break; case 0x1f: local_74 = (int *)0xb4; std::vector::push_back(&local_74); local_78 = (Manager *)0x1bf; std::vector::push_back(&local_78); local_88 = 0x1e4; std::vector::push_back(&local_88); local_98 = 0x74; std::vector::push_back(&local_98); break; case 0x20: local_74 = (int *)0x44; std::vector::push_back(&local_74); local_78 = (Manager *)0x243; std::vector::push_back(&local_78); break; case 0x21: local_74 = (int *)0x11a; std::vector::push_back(&local_74); local_78 = (Manager *)0x13a; std::vector::push_back(&local_78); break; case 0x22: local_74 = (int *)0x1a8; std::vector::push_back(&local_74); local_78 = (Manager *)0xa6; std::vector::push_back(&local_78); break; case 0x23: local_74 = (int *)0xd2; std::vector::push_back(&local_74); local_78 = (Manager *)0x24; std::vector::push_back(&local_78); local_88 = 0x178; std::vector::push_back(&local_88); break; case 0x24: local_74 = (int *)0x12; std::vector::push_back(&local_74); break; case 0x25: local_74 = (int *)0x7f; std::vector::push_back(&local_74); break; case 0x26: local_74 = (int *)0x1e0; std::vector::push_back(&local_74); local_78 = (Manager *)0x97; std::vector::push_back(&local_78); local_88 = 0x10c; std::vector::push_back(&local_88); break; case 0x27: local_74 = (int *)0xf5; std::vector::push_back(&local_74); local_78 = (Manager *)0x7b; std::vector::push_back(&local_78); local_88 = 0x5f; std::vector::push_back(&local_88); break; case 0x28: local_74 = (int *)0x76; std::vector::push_back(&local_74); local_78 = (Manager *)0x26; std::vector::push_back(&local_78); local_88 = 0xdd; std::vector::push_back(&local_88); local_98 = 0x139; std::vector::push_back(&local_98); local_9c = 3; std::vector::push_back(&local_9c); break; case 0x2a: local_74 = (int *)0xb6; std::vector::push_back(&local_74); local_78 = (Manager *)0xb3; std::vector::push_back(&local_78); local_88 = 0x176; std::vector::push_back(&local_88); break; case 0x2b: local_74 = (int *)0xe8; std::vector::push_back(&local_74); local_78 = (Manager *)0x151; std::vector::push_back(&local_78); break; case 0x2d: local_74 = (int *)0x13a; std::vector::push_back(&local_74); local_78 = (Manager *)0x81; std::vector::push_back(&local_78); break; case 0x2e: local_74 = (int *)0x34; std::vector::push_back(&local_74); local_78 = (Manager *)0x16e; std::vector::push_back(&local_78); break; case 0x2f: local_74 = (int *)0x192; std::vector::push_back(&local_74); break; case 0x30: local_74 = (int *)0x9c; std::vector::push_back(&local_74); local_78 = (Manager *)0x11e; std::vector::push_back(&local_78); local_88 = 0x4a; std::vector::push_back(&local_88); local_98 = 0x4b; std::vector::push_back(&local_98); break; case 0x31: local_74 = (int *)0x13c; std::vector::push_back(&local_74); local_78 = (Manager *)0x173; std::vector::push_back(&local_78); local_88 = 0x16e; std::vector::push_back(&local_88); local_98 = 0x111; std::vector::push_back(&local_98); break; case 0x32: local_74 = (int *)0x11e; std::vector::push_back(&local_74); local_78 = (Manager *)0x4b; std::vector::push_back(&local_78); local_88 = 0x9c; std::vector::push_back(&local_88); break; case 0x33: local_74 = (int *)0xf9; std::vector::push_back(&local_74); local_78 = (Manager *)0x19e; std::vector::push_back(&local_78); break; case 0x34: itemsEnd = itemsBegin; } pEVar12 = playerCopy; if (*(int *)&g_game->_deathmatchManager < 2) { uVar5 = 0; uStack_a8 = (int)itemsEnd - (int)itemsBegin >> 2; if (uStack_a8 != 0) { do { uVar10 = itemsBegin[uVar5]; AddCollectible(pEVar12,uVar10,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar10,0,0); if (g_game == (Game *)0x0) { if (-1 < (int)uVar10) goto LAB_007bd89b; } else { if ((int)uVar10 < 0) { if (((int)uVar10 < 0) && (pvVar8 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar10 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar8 >> 2)) { iVar14 = **(int **)((int)pvVar8 + ~uVar10 * 4); } else { iVar14 = 0; } } else { LAB_007bd89b: pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 <= (int)uVar10) goto LAB_007bd8ee; iVar14 = *(int *)((int)pvVar8 + uVar10 * 4); } if (iVar14 != 0) { tmpEffect[2] = *(int *)(iVar14 + 0x78); tmpEffect[1] = 0; local_e0 = 0; tmpEffect[0] = iVar14; TemporaryEffects::RemoveEffect(&pEVar12->_temporaryeffects,tmpEffect,1); } } LAB_007bd8ee: uVar5 = uVar5 + 1; } while (uVar5 < uStack_a8); uVar10 = local_90; } } local_8 = 0xffffffff; FID_conflict__Tidy(&itemsBegin); pEVar12 = playerCopy; apply_innate_collectibles(playerCopy); if (g_game->_challenge == 0x2c) { SetPocketActiveItem(pEVar12,0x244,2,0); pEVar12->_activeDesc[2]._varData = 0x14; pGVar9 = extraout_EDX_00; } else { pGVar9 = extraout_EDX; if (*(int *)(local_a4->_achievements + 0xb8) != 0) { SetPocketActiveItem(pEVar12,*(int *)(local_a4->_achievements + 0xb8),2,0); pGVar9 = extraout_EDX_01; } } iVar14 = *(int *)(local_a4->_achievements + 0xa8); if (iVar14 != 0) goto LAB_007bdacf; if (g_game->_challenge == 0) { iVar7 = pEVar12->_playerType; if (iVar7 == 0xe) { if ((local_94->_achievements[0xed] != 0) || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { iVar14 = 0x53; } } else if (iVar7 == 2) { if ((local_94->_achievements[0xf5] != 0) || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { iVar14 = 0x13; } } else if ((iVar7 == 6) && ((local_94->_achievements[0x14e] != 0 || ((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { iVar14 = 0x22; } } pGVar9 = g_game; switch((g_game->_dailyChallenge)._specialDailyId) { case 4: iVar14 = 0x3d; break; default: if (iVar14 != 0) break; goto LAB_007bdb1f; case 0x12: iVar14 = 8; break; case 0x19: iVar14 = 3; AddTrinket(pEVar12,0x48,1); pGVar9 = g_game; pvVar8 = (g_game->_itemPool)._trinketPoolItems._begin; if (((0x48 < (int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar8 >> 3) && (*(char *)((int)pvVar8 + 0x244) != '\0')) && (*(char *)((int)pvVar8 + 0x245) != '\0')) { *(undefined1 *)((int)pvVar8 + 0x244) = 0; piVar15 = &(pGVar9->_itemPool)._numAvailableTrinkets; *piVar15 = *piVar15 + -1; } break; case 0x1e: case 0x31: iVar14 = 0x35; } LAB_007bdacf: if (*(int *)&g_game->_deathmatchManager < 2) { AddTrinket(pEVar12,iVar14,1); pGVar9 = g_game; if (((0 < iVar14) && (pvVar8 = (g_game->_itemPool)._trinketPoolItems._begin, iVar14 < (int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar8 >> 3)) && ((*(char *)((int)pvVar8 + iVar14 * 8 + 4) != '\0' && (*(char *)((int)pvVar8 + iVar14 * 8 + 5) != '\0')))) { *(undefined1 *)((int)pvVar8 + iVar14 * 8 + 4) = 0; piVar15 = &(pGVar9->_itemPool)._numAvailableTrinkets; *piVar15 = *piVar15 + -1; } } LAB_007bdb1f: pPVar6 = local_a4; if (*(int *)(local_a4->_achievements + 0x90) == 0) { iVar14 = (g_game->_dailyChallenge)._specialDailyId; if (iVar14 == 0x27) { iVar14 = 0x31; } else if (iVar14 == 0x30) { iVar14 = 0x15; } else { if (iVar14 != 0x32) goto LAB_007bdb5f; iVar14 = 0xc; } AddPocketItem(pEVar12,iVar14,1); pGVar9 = extraout_EDX_02; } LAB_007bdb5f: local_94 = (PersistentGameData *) CONCAT31((int3)((uint)pGVar9 >> 8),*(int *)&g_game->_deathmatchManager < 2); if ((*(int *)&g_game->_deathmatchManager < 2) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) { InputManager::get_device(&PTR_vftable_00c57b18,&local_dc,pEVar12->_controllerIndex); local_8 = 1; if ((uint)local_dc != 0) { iVar14 = __RTDynamicCast((uint)local_dc,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0); if (iVar14 != 0) { iVar14 = *(int *)(iVar14 + 0x374); if (iVar14 == 0) { local_ac = 0; uVar5 = local_ac; uStack_a8 = 0; local_ac = 0; local_108 = local_ac; uVar11 = uStack_a8; local_ac = uVar5; } else { local_108 = *(uint *)(iVar14 + 8); uVar11 = *(uint *)(iVar14 + 0xc); } local_104 = uVar11; uStack_a8 = local_108; FUN_00731ee0(local_120,&local_108); if (((*(char *)(local_118 + 0xd) != '\0') || (uVar11 < *(uint *)(local_118 + 0x14))) || ((uVar11 <= *(uint *)(local_118 + 0x14) && (uStack_a8 < *(uint *)(local_118 + 0x10))))) { local_118 = *(int *)&g_manager[1]._gamestate.field_0xc8; } local_94 = (PersistentGameData *)((uint)local_94 & 0xff); if (local_118 != *(int *)&g_manager[1]._gamestate.field_0xc8) { local_94 = (PersistentGameData *)0x0; } pPVar6 = local_a4; } } local_8 = 2; if (((local_dc._4_4_ != (ItemConfig *)0x0) && (cVar4 = (**(code **)(*(int *)local_dc._4_4_ + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_dc); } local_8 = 0xffffffff; } if (((char)local_94 != '\0') && ((*(int *)pPVar6 == 9 || (*(int *)pPVar6 == 0x1e)))) { if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } bVar3 = (byte)rng._shift1; uVar10 = uVar10 >> (bVar3 & 0x1f) ^ uVar10; shift2 = (byte)rng._shift2; uVar10 = uVar10 << (shift2 & 0x1f) ^ uVar10; shift3 = (byte)rngShift3; uVar10 = uVar10 >> (shift3 & 0x1f) ^ uVar10; if (uVar10 == (uVar10 / 3) * 3) { bVar3 = 1; uVar5 = ItemPool::GetTrinket(&g_game->_itemPool,0); AddTrinket(pEVar12,uVar5,bVar3); } else { if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar10 = uVar10 >> (bVar3 & 0x1f) ^ uVar10; uVar10 = uVar10 << (shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> (shift3 & 0x1f) ^ uVar10; if ((uVar10 & 1) == 0) { if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar10 = uVar10 >> (bVar3 & 0x1f) ^ uVar10; uVar10 = uVar10 << (shift2 & 0x1f) ^ uVar10; rng._seed = uVar10 >> (shift3 & 0x1f) ^ uVar10; if ((rng._seed & 1U) == 0) { uVar10 = RNG::Next(&rng); iVar14 = ItemPool::GetCardEx(uVar10,0x19,0,0,1); tmpRng._shift1 = 5; tmpRng._shift2 = 9; tmpRng._shift3 = 7; tmpRng._seed = uVar10; iVar14 = lua_callback_run_get_card(&tmpRng,iVar14,0,0,0); AddPocketItem(pEVar12,iVar14,1); } else { uVar10 = RNG::Next(&rng); iVar14 = ItemPool::GetPill(uVar10); AddPocketItem(pEVar12,iVar14,0); } uVar10 = rng._seed; rngShift3 = rng._shift3; } } local_90 = 0; local_94 = (PersistentGameData *)0x0; uStack_a8 = 100; do { uVar5 = ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) - 1; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar10 = uVar10 >> ((byte)rng._shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)rng._shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)rngShift3 & 0x1f) ^ uVar10; uVar11 = 0; if (uVar5 != 0) { uVar11 = uVar10 % uVar5; } uVar11 = uVar11 + 1; local_b4 = &g_manager->_itemConfig; if (g_game == (Game *)0x0) { if (-1 < (int)uVar11) goto LAB_007bdf2c; LAB_007bdf3f: piVar15 = (int *)0x0; } else if ((int)uVar11 < 0) { if (((int)uVar11 < 0) && (pvVar8 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar11 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar8 >> 2)) { piVar15 = (int *)**(undefined4 **)((int)pvVar8 + ~uVar11 * 4); } else { piVar15 = (int *)0x0; } } else { LAB_007bdf2c: pvVar8 = (local_b4->_collectibles)._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 <= (int)uVar11) goto LAB_007bdf3f; piVar15 = *(int **)((int)pvVar8 + uVar11 * 4); } rng._seed = uVar10; if (((((uVar11 != 0) && ((int)uVar11 < (int)(g_manager->_itemConfig)._collectibles._end - (int)(local_b4->_collectibles)._begin >> 2)) && (uVar11 != 0xeb)) && ((uVar11 != 0x2b && (uVar11 != 0x3d)))) && ((collectibleConfig = ItemConfig::GetCollectible(local_b4,uVar11), collectibleConfig != (ItemConfig_Item *)0x0 && ((piVar15[0x2f] & 1U) == 0)))) { bVar3 = Item::IsAvailable(piVar15,0xffffffff); if (bVar3 != 0) { if (*piVar15 == 3) { if (local_94 == (PersistentGameData *)0x0) { local_94 = (PersistentGameData *)uVar11; } } else if (local_90 == 0) { local_90 = uVar11; } } } pEVar12 = playerCopy; uVar5 = local_90; uStack_a8 = uStack_a8 - 1; } while (uStack_a8 != 0); local_90 = uVar10; if (local_94 != (PersistentGameData *)0x0) { AddCollectible(playerCopy,(int)local_94,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,(int)local_94,0,0); } if (uVar5 != 0) { AddCollectible(pEVar12,uVar5,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar5,0,0); } pEVar12 = playerCopy; } pCVar16 = local_d0; if (local_d0->_isMegaSatan != 0) { AddCollectible(pEVar12,0xee,0,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,0xee,0,0); AddCollectible(pEVar12,0xef,0,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,0xef,0,0); } if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) { if (pCStack_b8 == (ChallengeParam *)0x0) { local_a4 = &g_manager->_persistentGameData; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar14 = *(int *)&pEVar12->field_0x1e50; if (iVar14 == 0) { local_bc = 0; uVar5 = local_bc; pCStack_b8 = (ChallengeParam *)0x0; local_bc = 0; local_d4 = local_bc; pCVar16 = pCStack_b8; local_bc = uVar5; } else { local_d4 = *(uint *)(iVar14 + 8); pCVar16 = *(ChallengeParam **)(iVar14 + 0xc); } pCStack_b8 = (ChallengeParam *)&g_manager[1]._gamestate.field_0xc0; local_d0 = pCVar16; uStack_a8 = local_d4; FUN_00731ee0(&local_34._shift1,&local_d4); if ((((*(char *)(local_34._shift3 + 0xd) == '\0') && (*(ChallengeParam **)(local_34._shift3 + 0x14) <= pCVar16)) && ((*(ChallengeParam **)(local_34._shift3 + 0x14) < pCVar16 || (*(uint *)(local_34._shift3 + 0x10) <= uStack_a8)))) && (local_34._shift3 != *(int *)(pCStack_b8->_name)._buf)) { local_a4 = (PersistentGameData *)FUN_00914150(&local_d4); } else { local_a4 = (PersistentGameData *)0x0; } } local_94 = (PersistentGameData *)local_a4->_eventCounters[0x72]; local_b4 = (ItemConfig *)((uint)local_94 >> 0x10); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { local_b4 = (ItemConfig *)((uint)local_94 & 0xffff); } if ((ItemConfig *)0x2 < local_b4) { local_b4 = (ItemConfig *)0x2; } if (local_b4 != (ItemConfig *)0x0) { do { uStack_a8 = 0; LAB_007be1e0: uVar5 = ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) - 1; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar10 = uVar10 >> ((byte)rng._shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)rng._shift2 & 0x1f) ^ uVar10; rng._seed = uVar10 >> ((byte)rngShift3 & 0x1f) ^ uVar10; uVar10 = 0; if (uVar5 != 0) { uVar10 = (uint)rng._seed % uVar5; } uVar10 = uVar10 + 1; if (g_game == (Game *)0x0) { if (-1 < (int)uVar10) goto LAB_007be280; LAB_007be29a: piVar15 = (int *)0x0; } else if ((int)uVar10 < 0) { if ((-1 < (int)uVar10) || (pvVar8 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar8 >> 2 <= (int)~uVar10)) goto LAB_007be29a; piVar15 = (int *)**(undefined4 **)((int)pvVar8 + ~uVar10 * 4); } else { LAB_007be280: pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 <= (int)uVar10) goto LAB_007be29a; piVar15 = *(int **)((int)pvVar8 + uVar10 * 4); } local_90 = rng._seed; if ((((uVar10 == 0) || ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2 <= (int)uVar10)) || (uVar10 == 0xeb)) || (((uVar10 == 0x2b || (uVar10 == 0x3d)) || ((collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,uVar10), collectibleConfig == (ItemConfig_Item *)0x0 || ((piVar15[0x2f] & 1U) != 0)))))) { LAB_007be376: uStack_a8 = uStack_a8 + 1; pEVar12 = playerCopy; if (99 < (int)uStack_a8) goto LAB_007be345; uVar10 = local_90; goto LAB_007be1e0; } bVar3 = Item::IsAvailable(piVar15,0xffffffff); pEVar12 = playerCopy; if ((bVar3 == 0) || ((*piVar15 == 3 && (playerCopy->_activeDesc[0]._item != 0)))) goto LAB_007be376; AddCollectible(playerCopy,uVar10,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar10,0,0); LAB_007be345: local_b4 = (ItemConfig *)((int)(local_b4 + -1) + 0x10f); if (local_b4 == (ItemConfig *)0x0) goto code_r0x007be352; uVar10 = local_90; } while( true ); } } } else { twin = *(Entity_Player **)&pEVar12->_twinPlayer; if ((((twin == (Entity_Player *)0x0) || (twin->_playerIndex == -1)) || (pEVar12->_playerIndex <= twin->_playerIndex)) || (twin == pEVar12)) { piVar15 = (pCVar16->_collectibleList)._begin; if (piVar15 < (pCVar16->_collectibleList)._end) { do { iVar14 = *piVar15; if (iVar14 < 0) { RemoveCollectible(pEVar12,-iVar14,0,0,1); } else { AddCollectible(pEVar12,iVar14,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,*piVar15,0,0); } piVar15 = piVar15 + 1; } while (piVar15 < (pCVar16->_collectibleList)._end); } piVar15 = (pCVar16->_trinketList)._begin; if (piVar15 < (pCVar16->_trinketList)._end) { do { AddTrinket(pEVar12,*piVar15,1); pGVar9 = g_game; iVar14 = *piVar15; if (((0 < iVar14) && (pvVar8 = (g_game->_itemPool)._trinketPoolItems._begin, iVar14 < (int)(g_game->_itemPool)._trinketPoolItems._end - (int)pvVar8 >> 3)) && ((*(char *)((int)pvVar8 + iVar14 * 8 + 4) != '\0' && (*(char *)((int)pvVar8 + iVar14 * 8 + 5) != '\0')))) { *(undefined1 *)((int)pvVar8 + iVar14 * 8 + 4) = 0; piVar13 = &(pGVar9->_itemPool)._numAvailableTrinkets; *piVar13 = *piVar13 + -1; } piVar15 = piVar15 + 1; pCVar16 = local_d0; } while (piVar15 < (local_d0->_trinketList)._end); } if (pCVar16->_startingPill != -1) { uVar10 = ItemPool::ForceAddPillEffect(&g_game->_itemPool,pCVar16->_startingPill); AddPocketItem(pEVar12,uVar10,0); uVar5 = -(uint)((uVar10 & 0x7ff) != 0) & uVar10 & 0x7ff; uVar10 = 0xe; if (uVar5 < 0xe) { uVar10 = uVar5; } *(undefined1 *)((int)(&g_game->_itemPool + 1) + uVar10 + 0x3c) = 1; } iVar14 = pCVar16->_startingCard; if (iVar14 != 0) { if (iVar14 == -1) { if (local_90 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } local_90 = local_90 >> ((byte)rng._shift1 & 0x1f) ^ local_90; local_90 = local_90 << ((byte)rng._shift2 & 0x1f) ^ local_90; uVar10 = local_90 >> ((byte)rngShift3 & 0x1f) ^ local_90; rng._seed = uVar10; local_90 = uVar10; iVar14 = ItemPool::GetCardEx(uVar10,0x19,0,0,1); local_34._shift1 = 5; local_34._shift2 = 9; local_34._shift3 = 7; local_34._seed = uVar10; iVar14 = lua_callback_run_get_card(&local_34,iVar14,0,0,0); AddPocketItem(pEVar12,iVar14,1); goto LAB_007be608; } AddPocketItem(pEVar12,iVar14,1); } } else { piVar15 = (pCVar16->_collectibleTwinList)._begin; if (piVar15 < (pCVar16->_collectibleTwinList)._end) { do { iVar14 = *piVar15; if (iVar14 < 0) { RemoveCollectible(pEVar12,-iVar14,0,0,1); } else { AddCollectible(pEVar12,iVar14,-1,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,*piVar15,0,0); } piVar15 = piVar15 + 1; } while (piVar15 < (pCVar16->_collectibleTwinList)._end); } } } LAB_007be602: uVar10 = local_90; goto LAB_007be608; code_r0x007be352: netplayManager = &g_manager->_netplayManager; if (*netplayManager == *(NetplayManager *)(g_manager + 1)) { uVar5 = (uint)local_94 & 0xffff0000; } else { uVar5 = (uint)local_94 & 0xffff; } local_a4->_eventCounters[0x72] = uVar5; pvVar8 = InputManager::GetDeviceByPlayerEntity(netplayManager,pEVar12); if (pvVar8 == (void *)0x0) goto LAB_007be602; cVar4 = (**(code **)(*(int *)((int)pvVar8 + 0x370) + 0x14))(); uVar10 = local_90; if (cVar4 != '\0') { g_manager[1]._persistentGameData._eventCounters[0x83] = uVar5; } LAB_007be608: EvaluateItems(); pGVar9 = g_game; playerList = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)playerList >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerList = (pGVar9->_playerManager)._playerList._begin; } ConsumableCountChanged((Entity_Player *)*playerList,-1); if (pEVar12->_replacedPlayer == (void *)0x0) { iVar14 = pEVar12->_playerType; if (iVar14 == 0x13) { tmpPlayer = InitTwin(pEVar12,0x14); InitPostLevelInitStats(tmpPlayer); } else if (iVar14 == 0x23) { if (pEVar12->_isCoopGhost == 0) { tmpPlayer = InitTwin(pEVar12,0x28); InitPostLevelInitStats(tmpPlayer); } } else if (iVar14 == 0x22) { uVar5 = Random(); familiar = Game::Spawn(g_game,3,0xe7,&pEVar12->_pos,&g_vectorZero,(Entity *)pEVar12,0x19,uVar5 ); (**(code **)(*(int *)familiar + 0xc))(); } else if ((iVar14 == 0x25) && (g_game->_challenge != 0x2c)) { TemporaryEffects::RemoveNullEffect(&pEVar12->_temporaryeffects,0x6d,-1); pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 >> 2 < 0x6e) { tmpEffect[0] = 0; } else { tmpEffect[0] = *(int *)((int)pvVar8 + 0x1b4); } tmpEffect[1] = 0; local_e0 = 0; tmpRng._shift1 = 0xb; tmpRng._shift2 = 7; uVar5 = (g_game->_devilAngelRoomRNG)._seed; pCStack_b8 = (ChallengeParam *)0xc; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = uVar5 >> 0xb ^ uVar5; uVar5 = uVar5 << 7 ^ uVar5; tmpEffect[2] = ((uVar5 >> 0xc ^ uVar5) % 0x14) * 0x1e + 0x262; TemporaryEffects::AddEffect(&pEVar12->_temporaryeffects,tmpEffect,1,1); } } manager = g_manager; if (g_game->_challenge == 0x1f) { itemsBegin = (int *)0x0; itemsEnd = (int *)0x0; local_a4 = (PersistentGameData *)0x0; itemsCapacity = (int *)0x0; local_8 = 3; local_78 = g_manager; pvVar8 = (g_manager->_itemConfig)._collectibles._end; collectibles = (g_manager->_itemConfig)._collectibles._begin; uVar5 = (int)pvVar8 - (int)collectibles >> 2; if (uVar5 != 0) { if (0x3fffffff < uVar5) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(uVar5); pvVar8 = (manager->_itemConfig)._collectibles._end; collectibles = (manager->_itemConfig)._collectibles._begin; } uVar5 = 0; piVar15 = itemsEnd; local_a4 = (PersistentGameData *)itemsCapacity; if ((int)pvVar8 - (int)collectibles >> 2 != 0) { do { local_74 = *(int **)((int)collectibles + uVar5 * 4); if (uVar5 != 0) { pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if (((((int)uVar5 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2) && (uVar5 != 0xeb)) && (uVar5 != 0x2b)) && (uVar5 != 0x3d)) { if (g_game == (Game *)0x0) { if (-1 < (int)uVar5) goto LAB_007be8da; } else { if ((int)uVar5 < 0) { if (((int)uVar5 < 0) && (pvVar8 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar5 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar8 >> 2)) { iVar14 = **(int **)((int)pvVar8 + ~uVar5 * 4); } else { iVar14 = 0; } } else { LAB_007be8da: iVar14 = *(int *)((int)pvVar8 + uVar5 * 4); } if (((iVar14 != 0) && ((local_74[0x2f] & 1U) == 0)) && (*local_74 != 3)) { bVar3 = Item::IsAvailable(local_74,0xffffffff); if (bVar3 != 0) { pCStack_b8 = (ChallengeParam *)local_74[1]; if ((PersistentGameData *)piVar15 == local_a4) { std::vector::_Emplace_reallocate(piVar15,&pCStack_b8); local_a4 = (PersistentGameData *)itemsCapacity; piVar15 = itemsEnd; } else { *piVar15 = (int)pCStack_b8; itemsEnd = piVar15 + 1; piVar15 = itemsEnd; } } } } } } uVar5 = uVar5 + 1; collectibles = (local_78->_itemConfig)._collectibles._begin; } while (uVar5 < (uint)((int)(local_78->_itemConfig)._collectibles._end - (int)collectibles >> 2)); uVar10 = local_90; } local_d0 = (ChallengeParam *)0x0; piVar13 = itemsBegin; do { piVar2 = itemsBegin; if (piVar13 == piVar15) break; uVar5 = (int)piVar15 - (int)itemsBegin >> 2; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar10 = uVar10 >> ((byte)rng._shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)rng._shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)rngShift3 & 0x1f) ^ uVar10; uVar11 = 0; if (uVar5 != 0) { uVar11 = uVar10 % uVar5; } if (uVar11 < ((int)piVar15 - (int)itemsBegin >> 2) - 1U) { iVar14 = itemsBegin[uVar11]; itemsBegin[uVar11] = piVar15[-1]; piVar15[-1] = iVar14; } piVar15 = piVar15 + -1; AddCollectible(playerCopy,*piVar15,0,1,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,*piVar15,0,0); local_d0 = (ChallengeParam *)((local_d0->_name)._buf + 1); piVar13 = piVar2; itemsEnd = piVar15; } while (local_d0 < (ChallengeParam *)0xa); local_8 = 0xffffffff; if (piVar13 != (int *)0x0) { deallocate(piVar13,(int)local_a4 - (int)piVar13 >> 2); } pEVar12 = playerCopy; } if (g_game->_challenge == 0x2b) { iVar14 = 3; do { AddItemCard(pEVar12,0); iVar14 = iVar14 + -1; } while (iVar14 != 0); } LAB_007bea6e: pEVar12->_postLevelInitFinished = 1; ExceptionList = local_10; return; } //@@ 007bebb0 Entity_Player::update_player_skin /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: NiceLilith/ghost spritesheet replace + costumes, after ANM2 load in ChangePlayerType prototype: db/protos.zhl */ void __thiscall Entity_Player::update_player_skin(Entity_Player *this) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; void *pvVar4; ChallengeParam *challengeParams; ItemConfig_Item *costume; std_string *strResult; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; int iVar5; char *freePtr; void *extraout_ECX; void *extraout_ECX_00; void *extraout_ECX_01; undefined1 *freeSize; uint uVar6; Game *game; std_string *playerName; byte unk; Entity_Player *local_78; LayerState *local_74; EntityConfig_Player *playerConfig; void *displayName [5]; uint displayNameCapacity; void *skinColorStr [5]; uint skinColorStrCapacity; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; game = g_game; puStack_20 = (undefined1 *)(skinColorStr + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00affefd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(skinColorStr + 0x11); ExceptionList = &local_1c; local_78 = this; if (this->_isCoopGhost != 0) { reset_body_sprite(this); ExceptionList = local_1c; return; } iVar5 = this->_playerType; if ((iVar5 < 0) || (pvVar4 = (g_manager->_entityConfig)._players._begin, ((int)(g_manager->_entityConfig)._players._end - (int)pvVar4) / 0x148 <= iVar5)) { playerConfig = (EntityConfig_Player *)0x0; } else { playerConfig = (EntityConfig_Player *)(iVar5 * 0x148 + (int)pvVar4); } this->_bodyColor = -1; this->_headColor = -1; if (game->_challenge == 0x1e) { uVar6 = 0; puStack_20 = (undefined1 *)(skinColorStr + 0x14); do { local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x26; local_3c._capacity = (uint)&DAT_0000002f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/characters/costumes/NiceLilith.png",0x27); local_14 = (void *)0x0; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar6,&local_3c); local_14 = (void *)0xffffffff; unk = extraout_CL; if (&DAT_0000000f < local_3c._capacity) { freeSize = (undefined1 *)(local_3c._capacity + 1); freePtr = (char *)local_3c._buf._0_4_; if ((undefined1 *)0xfff < freeSize) { freePtr = *(char **)(local_3c._buf._0_4_ + -4); freeSize = (undefined1 *)(local_3c._capacity + 0x24); if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)freePtr))) goto LAB_007bee2a; } operator_delete(freePtr,(uint)freeSize); unk = extraout_CL_00; } uVar6 = uVar6 + 1; } while (uVar6 < 0xf); LAB_007bee42: ANM2::LoadGraphics(&this->_sprite,unk); } else { puStack_20 = (undefined1 *)(skinColorStr + 0x14); if ((playerConfig->_skinPath)._size != 0) { uVar6 = 0; local_74 = (LayerState *)&playerConfig->_skinPath; puStack_20 = (undefined1 *)(skinColorStr + 0x14); do { Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,uVar6,(std_string *)local_74); uVar6 = uVar6 + 1; } while (uVar6 < 0xf); local_74 = ANM2::GetLayer(&this->_sprite,(byte *)"ghost"); this = local_78; if (local_74 == (LayerState *)0x0) { unk = extraout_CL_01; } else { iVar5 = local_78->_playerType; pvVar4 = (void *)FUN_004562f0(skinColorStr); local_14 = (void *)0x1; strResult = costume_path_apply_skin_color(&local_3c,pvVar4,-1,iVar5,(byte *)0x0,(byte *)0x0) ; local_14._0_1_ = 2; if (local_74->_layerData == (int *)0x0) { iVar5 = -1; } else { iVar5 = *(int *)local_74->_layerData; } Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,iVar5,strResult); local_14 = (void *)CONCAT31(local_14._1_3_,1); unk = extraout_CL_02; if (&DAT_0000000f < local_3c._capacity) { freeSize = (undefined1 *)(local_3c._capacity + 1); freePtr = (char *)local_3c._buf._0_4_; if ((undefined1 *)0xfff < freeSize) { freePtr = *(char **)(local_3c._buf._0_4_ + -4); freeSize = (undefined1 *)(local_3c._capacity + 0x24); if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)freePtr))) goto LAB_007bee2a; } operator_delete(freePtr,(uint)freeSize); unk = extraout_CL_03; } local_14 = (void *)0xffffffff; local_3c._size = 0; local_3c._capacity = (uint)&DAT_0000000f; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < skinColorStrCapacity) { uVar6 = skinColorStrCapacity + 1; pvVar4 = skinColorStr[0]; if (0xfff < uVar6) { pvVar4 = *(void **)((int)skinColorStr[0] + -4); uVar6 = skinColorStrCapacity + 0x24; if (0x1f < (uint)((int)skinColorStr[0] + (-4 - (int)pvVar4))) { LAB_007bee2a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar6); unk = extraout_CL_04; } } goto LAB_007bee42; } } iVar5 = playerConfig->_costumeID; if (iVar5 == -1) { UpdateCostumes(this); } else if ((iVar5 < 0) || (pvVar4 = (g_manager->_itemConfig)._nullItems._begin, (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 >> 2 <= iVar5)) { AddCostume(this,(ItemConfig_Item *)0x0,0); } else { AddCostume(this,*(ItemConfig_Item **)((int)pvVar4 + iVar5 * 4),0); } game = g_game; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { challengeParams = Game::GetChallengeParams(g_game); if (challengeParams->_canShoot == 0) { if ((this->_playerType != 0x23) && (this->_playerType != 0x28)) { pvVar4 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 & 0xfffffffcU) < 0x39) { costume = (ItemConfig_Item *)0x0; } else { costume = *(ItemConfig_Item **)((int)pvVar4 + 0x38); } AddCostume(this,costume,0); goto LAB_007beef4; } } } else { LAB_007beef4: game = g_game; } local_78 = (Entity_Player *)0x36; std::set::find_node((undefined1 *)((int)&local_3c + 0xc),&local_78); if (((*(char *)(local_3c._capacity + 0xd) != '\0') || (0x36 < *(int *)(local_3c._capacity + 0x10)) ) || ((void *)local_3c._capacity == (game->_seedEffects)._seedEffects)) { pvVar4 = extraout_ECX; if ((game->_dailyChallenge)._specialDailyId != 0x13) goto LAB_007bef66; } pvVar4 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 & 0xfffffffcU) < 0x41) { costume = (ItemConfig_Item *)0x0; } else { costume = *(ItemConfig_Item **)((int)pvVar4 + 0x40); } AddCostume(this,costume,0); pvVar4 = extraout_ECX_00; game = g_game; LAB_007bef66: if ((game->_challenge == 0x2a) && (this->_playerType == 0x23)) { pvVar4 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 & 0xfffffffcU) < 0x1a9) { costume = (ItemConfig_Item *)0x0; } else { costume = *(ItemConfig_Item **)((int)pvVar4 + 0x1a8); } AddCostume(this,costume,0); pvVar4 = extraout_ECX_01; } strResult = EntityConfig_Player::GetDisplayName(playerConfig,(std_string *)displayName,pvVar4); playerName = &this->_name; if (playerName != strResult) { std::string::_Tidy_deallocate(playerName->_buf); uVar1 = *(undefined4 *)(strResult->_buf + 4); uVar2 = *(undefined4 *)(strResult->_buf + 8); uVar3 = *(undefined4 *)(strResult->_buf + 0xc); *(undefined4 *)playerName->_buf = *(undefined4 *)strResult->_buf; *(undefined4 *)((this->_name)._buf + 4) = uVar1; *(undefined4 *)((this->_name)._buf + 8) = uVar2; *(undefined4 *)((this->_name)._buf + 0xc) = uVar3; uVar6 = strResult->_capacity; (this->_name)._size = strResult->_size; (this->_name)._capacity = uVar6; strResult->_size = 0; strResult->_capacity = 0xf; strResult->_buf[0] = '\0'; } if (0xf < displayNameCapacity) { uVar6 = displayNameCapacity + 1; pvVar4 = displayName[0]; if (0xfff < uVar6) { pvVar4 = *(void **)((int)displayName[0] + -4); uVar6 = displayNameCapacity + 0x24; if (0x1f < (uint)((int)displayName[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar6); } ExceptionList = local_1c; return; } //@@ 007bf040 Entity_Player::InitBabySkin /* ZHL [lua] Lua binding EntityPlayer:InitBabySkin */ void __thiscall Entity_Player::InitBabySkin(Entity_Player *this) { Manager *pMVar1; byte unk; Entity_Player *pEVar2; Entity_Player *extraout_ECX; Entity_Player *extraout_ECX_00; Entity_Player *extraout_ECX_01; uint uVar3; pMVar1 = g_manager; uVar3 = this->_babySkin; if (uVar3 < 0x47) { pEVar2 = (Entity_Player *) ((int)(g_manager->_entityConfig)._babies._end - (int)(g_manager->_entityConfig)._babies._begin); if ((uint)((int)pEVar2 / 0x38) <= uVar3) { KAGE_LogMessage(0x10,(byte *)"Baby list is smaller than requested baby %d!"); pEVar2 = extraout_ECX; } uVar3 = 0; if ((this->_sprite)._layerCount != 0) { do { Sprite::ReplaceSpritesheet ((Sprite *)&this->_sprite,uVar3, (std_string *) ((int)(pMVar1->_entityConfig)._babies._begin + this->_babySkin * 0x38 + 0x1c)); uVar3 = uVar3 + 1; } while (uVar3 < (uint)(this->_sprite)._layerCount); ANM2::LoadGraphics(&this->_sprite,unk); return; } } else { pEVar2 = this; if (uVar3 == 0x47) { uVar3 = this->_subtype; if ((uVar3 < 0x47) || ((uint)(((int)(g_manager->_entityConfig)._babies._end - (int)(g_manager->_entityConfig)._babies._begin) / 0x38) <= uVar3)) { KAGE_LogMessage(0x10,(byte *)"Bad baby basic id %d"); uVar3 = this->_subtype; pEVar2 = extraout_ECX_00; if (uVar3 < 0x47) goto LAB_007bf18d; } pEVar2 = (Entity_Player *) ((int)(pMVar1->_entityConfig)._babies._end - (int)(pMVar1->_entityConfig)._babies._begin); if ((uVar3 < (uint)((int)pEVar2 / 0x38)) && (uVar3 = 0, (this->_sprite)._layerCount != 0)) { do { Sprite::ReplaceSpritesheet ((Sprite *)&this->_sprite,uVar3, (std_string *) ((int)(pMVar1->_entityConfig)._babies._begin + this->_subtype * 0x38 + 0x1c)); uVar3 = uVar3 + 1; pEVar2 = extraout_ECX_01; } while (uVar3 < (uint)(this->_sprite)._layerCount); } } } LAB_007bf18d: ANM2::LoadGraphics(&this->_sprite,(byte)pEVar2); return; } //@@ 007bf1a0 Entity_Player::FireDelayedBrimstone /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Lua EntityPlayer:FireDelayedBrimstone; ZHL sig said Entity_NPC::MakeBloodSplash */ Entity_Laser * __thiscall Entity_Player::FireDelayedBrimstone(Entity_Player *this,float param_2,int param_3) { EntityPtr *pEVar1; byte bVar2; int iVar3; Entity_Laser *pEVar4; uint uVar5; float *pfVar6; uint uVar7; int variant; uint uVar8; bool bVar9; float fVar10; float afStackY_2cc [128]; EntityPtr EVar11; undefined1 auStack_8c [4]; float local_88; int local_84; Vector local_80 [2]; uint uStack_6c; uint uStack_68; uint uStack_64; uint uStack_60; undefined4 uStack_58; uint local_c; local_c = __security_cookie ^ (uint)auStack_8c; local_88 = param_2; variant = 1; local_84 = param_3; bVar2 = HasCollectible(this,0x44,0); if (bVar2 != 0) { variant = 9; } iVar3 = GetCollectibleNum(this,0x76,0); if ((1 < iVar3) && (bVar9 = variant == 9, variant = 0xb, bVar9)) { variant = 0xe; } local_80[0].x = *(float *)(param_3 + 0x33c); local_80[0].y = *(float *)(param_3 + 0x340); pEVar4 = Entity_Laser::ShootAngle (variant,local_80,local_88,10,(Vector *)(param_3 + 0x34c),(Entity *)this,0); (**(code **)(*(int *)pEVar4 + 0x3c))(); uVar5 = Random(); EVar11 = (EntityPtr)0x0; fVar10 = (float)((uVar5 & 1) * 2 + -1); GetTearHitParams(auStack_8c,2,0x3f800000); (**(code **)(*(int *)pEVar4 + 0x40))(uStack_58); uVar8 = ~DAT_00c34b78; uVar7 = ~DAT_00c34b7c; uVar5 = ~DAT_00c34b74; *(uint *)&(pEVar4->_tearFlags)._l = ~DAT_00c34b70 & uStack_6c; *(uint *)((int)&(pEVar4->_tearFlags)._l + 4) = uVar5 & uStack_68; *(uint *)&(pEVar4->_tearFlags)._h = uVar8 & uStack_64; *(uint *)((int)&(pEVar4->_tearFlags)._h + 4) = uVar7 & uStack_60; pEVar4->field_0x517 = 1; fVar10 = sin(fVar10 * 0.017453292); if (fVar10 <= -0.5) { fVar10 = -10.0; } else { fVar10 = 3000.0; } pEVar1 = &pEVar4->_parent; pEVar4->_renderDepthOffset = fVar10; if (*pEVar1 != (EntityPtr)0x0) { std::multiset::erase(afStackY_2cc + 0x86); } *pEVar1 = EVar11; std::multiset::insert(pEVar1); if ((this->_playerType != 7) && (bVar2 = TemporaryEffects::HasTrinketEffect(&this->_temporaryeffects,0xa2), bVar2 == 0)) { return pEVar4; } bVar2 = HasCollectible(this,0x76,0); if (bVar2 == 0) { pfVar6 = afStackY_2cc + 0x87; if (this->_tearrange * 0.25 + 32.0 <= 60.0) { pfVar6 = afStackY_2cc + 0x86; } pEVar4->_maxDistance = *pfVar6; } return pEVar4; } //@@ 007bf3d0 Entity_Player::CanPickupItem /* ZHL [lua] Lua binding EntityPlayer:CanPickupItem prototype: db/protos.zhl */ byte __thiscall Entity_Player::CanPickupItem(Entity_Player *this) { byte bVar1; byte *pbVar2; uint uVar3; char *pcVar4; byte *pbVar5; byte *pbVar6; bool bVar7; pbVar6 = (this->_sprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } if ((this->_isPlayingExtraAnimation != 0) || (this->_isPlayingItemAnimation != 0)) { pbVar5 = &DAT_00b1d3b0; pbVar2 = pbVar6; do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_007bf423: uVar3 = -(uint)bVar7 | 1; goto LAB_007bf428; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_007bf423; pbVar2 = pbVar2 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_007bf428: if ((uVar3 != 0) && (bVar1 = IsHoldingItem(this), bVar1 == 0)) { return 0; } } if (this->_dead == 0) { pcVar4 = "Death"; do { bVar1 = *pbVar6; bVar7 = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_007bf465: uVar3 = -(uint)bVar7 | 1; goto LAB_007bf46a; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar7 = bVar1 < (byte)pcVar4[1]; if (bVar1 != pcVar4[1]) goto LAB_007bf465; pbVar6 = pbVar6 + 2; pcVar4 = pcVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_007bf46a: if ((uVar3 != 0) && (this->_megaBlastDuration < 1)) { return 1; } } return 0; } //@@ 007bf490 Entity_Player::IsHoldingItem /* ZHL [lua] Lua binding EntityPlayer:IsHoldingItem prototype: db/protos.zhl, confirmed by RET 0 */ byte __thiscall Entity_Player::IsHoldingItem(Entity_Player *this) { byte *animName; byte *animCursor; uint cmpResult; char *expectedCursor; bool isLess; byte ch; animName = (this->_bodySprite)._animState._animData; if (animName == (byte *)0x0) { animName = &s_empty; } else if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } expectedCursor = "Pickup"; animCursor = animName; do { ch = *animCursor; isLess = ch < (byte)*expectedCursor; if (ch != *expectedCursor) { LAB_007bf4d1: cmpResult = -(uint)isLess | 1; goto LAB_007bf4d6; } if (ch == 0) break; ch = animCursor[1]; isLess = ch < (byte)expectedCursor[1]; if (ch != expectedCursor[1]) goto LAB_007bf4d1; animCursor = animCursor + 2; expectedCursor = expectedCursor + 2; } while (ch != 0); cmpResult = 0; LAB_007bf4d6: if (cmpResult != 0) { expectedCursor = "Pickup_Online"; animCursor = animName; do { ch = *animCursor; isLess = ch < (byte)*expectedCursor; if (ch != *expectedCursor) { LAB_007bf505: cmpResult = -(uint)isLess | 1; goto LAB_007bf50a; } if (ch == 0) break; ch = animCursor[1]; isLess = ch < (byte)expectedCursor[1]; if (ch != expectedCursor[1]) goto LAB_007bf505; animCursor = animCursor + 2; expectedCursor = expectedCursor + 2; } while (ch != 0); cmpResult = 0; LAB_007bf50a: if (cmpResult != 0) { expectedCursor = "LiftItem"; animCursor = animName; do { ch = *animCursor; isLess = ch < (byte)*expectedCursor; if (ch != *expectedCursor) { LAB_007bf540: cmpResult = -(uint)isLess | 1; goto LAB_007bf545; } if (ch == 0) break; ch = animCursor[1]; isLess = ch < (byte)expectedCursor[1]; if (ch != expectedCursor[1]) goto LAB_007bf540; animCursor = animCursor + 2; expectedCursor = expectedCursor + 2; } while (ch != 0); cmpResult = 0; LAB_007bf545: if (cmpResult != 0) { expectedCursor = "HideItem"; animCursor = animName; do { ch = *animCursor; isLess = ch < (byte)*expectedCursor; if (ch != *expectedCursor) { LAB_007bf570: cmpResult = -(uint)isLess | 1; goto LAB_007bf575; } if (ch == 0) break; ch = animCursor[1]; isLess = ch < (byte)expectedCursor[1]; if (ch != expectedCursor[1]) goto LAB_007bf570; animCursor = animCursor + 2; expectedCursor = expectedCursor + 2; } while (ch != 0); cmpResult = 0; LAB_007bf575: if (cmpResult != 0) { expectedCursor = "UseItem"; do { ch = *animName; isLess = ch < (byte)*expectedCursor; if (ch != *expectedCursor) { LAB_007bf5a0: cmpResult = -(uint)isLess | 1; goto LAB_007bf5a5; } if (ch == 0) break; ch = animName[1]; isLess = ch < (byte)expectedCursor[1]; if (ch != expectedCursor[1]) goto LAB_007bf5a0; animName = animName + 2; expectedCursor = expectedCursor + 2; } while (ch != 0); cmpResult = 0; LAB_007bf5a5: if (cmpResult != 0) { return 0; } } } } } return 1; } //@@ 007bf5c0 Entity_Player::IsHeldItemVisible /* ZHL [lua] Lua binding EntityPlayer:IsHeldItemVisible */ undefined1 __thiscall Entity_Player::IsHeldItemVisible(Entity_Player *this) { byte bVar1; void *pvVar2; bVar1 = IsHoldingItem(this); if ((bVar1 != 0) && ((this->_bodySprite)._animState._animData != (void *)0x0)) { pvVar2 = AnimationState::GetNullFrameById(&(this->_bodySprite)._animState,0); if (pvVar2 != (void *)0x0) { return *(undefined1 *)((int)pvVar2 + 0xc); } } return 0; } //@@ 007bf5f0 Entity_Player::AddBlueSpider /* ZHL [lua] Lua binding EntityPlayer:AddBlueSpider */ void __thiscall Entity_Player::AddBlueSpider(Entity_Player *this,Vector *param_2) { undefined4 uVar1; uint seed; Entity *pEVar2; this->_numBlueSpiders = this->_numBlueSpiders + 1; seed = Random(); pEVar2 = Game::SpawnEx(g_game,3,0x49,param_2,&g_vectorZero,(Entity *)this,0,seed,0); uVar1 = *(undefined4 *)((int)&pEVar2->_flags + 4); *(uint *)&pEVar2->_flags = (uint)pEVar2->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar2->_flags + 4) = uVar1; return; } //@@ 007bf640 Entity_Player::ThrowBlueSpider /* ZHL [lua] Lua binding EntityPlayer:ThrowBlueSpider prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Familiar * __thiscall Entity_Player::ThrowBlueSpider(Entity_Player *this,Vector *position,Vector *target) { Entity_Familiar *extraout_EAX; this->_numBlueSpiders = this->_numBlueSpiders + 1; spawn_blue_spider(position,(Entity *)this,target); return extraout_EAX; } //@@ 007bf660 Entity_Player::RemoveBlueSpider /* ZHL [lua] Lua binding EntityPlayer:RemoveBlueSpider */ void __thiscall Entity_Player::RemoveBlueSpider(Entity_Player *this) { this->_numBlueSpiders = this->_numBlueSpiders + -1; return; } //@@ 007bf670 Entity_Player::GetExtraLives /* ZHL [exact] __thiscall int Entity_Player::GetExtraLives(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Player::GetExtraLives(Entity_Player *this) { void *pvVar1; int iVar2; pvVar1 = (this->_collectibleCounts)._begin; iVar2 = (int)this->_deadCatLives + *(int *)((int)pvVar1 + 0xac0) + *(int *)((int)pvVar1 + 0x530) + *(int *)((int)pvVar1 + 0x4dc) + *(int *)((int)pvVar1 + 0x350) + *(int *)((int)pvVar1 + 0x284) + *(int *)((int)pvVar1 + 0x2c); if (this->_playerType == 0x1f) { iVar2 = iVar2 + *(int *)((int)pvVar1 + 0x9ac); } return (uint)(this->_playerType == 8) + iVar2; } //@@ 007bf6c0 Entity_Player::GetTearHitParams /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding EntityPlayer:GetTearHitParams */ TearParams * Entity_Player::GetTearHitParams (TearParams *param_1,int param_2,float param_3,int param_4,Entity_Familiar *param_5) { qword *pqVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; code *pcVar7; undefined4 uVar8; undefined4 uVar9; qword qVar10; byte bVar11; int iVar12; int iVar13; TearParams *pTVar14; uint uVar15; int *effect; void *pvVar16; BitSet128 *addedFlags; Entity_Player *in_ECX; Entity_Player *this; Entity_Player *this_00; Entity_Player *this_01; uint uVar17; uint *puVar18; uint uVar19; uint uVar20; BitSet128 *tearFlags; bool bVar21; bool bVar22; float fVar23; float fVar24; uint *local_148; char local_142; char local_141; TemporaryEffects *local_140; char isNegativeDisplacement; uint local_138; ColorMod *local_134; uint local_130; Entity_Familiar *familiar; float baseDamage; float local_124; KColor local_120; Color laserTearColor; KColor laserColorMultiplier; undefined4 local_c0 [8]; undefined4 local_a0; undefined4 uStack_9c; undefined4 local_98; undefined4 local_94 [8]; undefined4 local_74; undefined4 uStack_70; undefined4 local_6c; undefined4 local_68 [8]; undefined4 local_48; undefined4 uStack_44; undefined4 local_40; ColorMod familiarTintColor; Manager *manager; if ((param_5 == (Entity_Familiar *)0x0) || (familiar = param_5, param_5->_type != 3)) { familiar = (Entity_Familiar *)0x0; } TearParams::constructor(param_1); local_134 = ¶m_1->_tearColor; param_1->_tearVariant = 0; tearFlags = ¶m_1->_flags; param_3 = param_3 * this_00->_damage; param_1->_tearDamage = param_3; param_1->_tearHeight = this_00->_tearheight; uVar8 = *(undefined4 *)((int)&(this_00->_tearFlags)._l + 4); qVar10 = (this_00->_tearFlags)._h; uVar9 = *(undefined4 *)((int)&(this_00->_tearFlags)._h + 4); *(int *)&tearFlags->_l = (int)(this_00->_tearFlags)._l; *(undefined4 *)((int)&(param_1->_flags)._l + 4) = uVar8; *(int *)&(param_1->_flags)._h = (int)qVar10; *(undefined4 *)((int)&(param_1->_flags)._h + 4) = uVar9; if (local_134 != &this_00->_tearColor) { fVar23 = (this_00->_tearColor)._tint[1]; fVar24 = (this_00->_tearColor)._tint[2]; fVar2 = (this_00->_tearColor)._tint[3]; local_134->_tint[0] = (this_00->_tearColor)._tint[0]; (param_1->_tearColor)._tint[1] = fVar23; (param_1->_tearColor)._tint[2] = fVar24; (param_1->_tearColor)._tint[3] = fVar2; fVar23 = (this_00->_tearColor)._colorize[1]; fVar24 = (this_00->_tearColor)._colorize[2]; fVar2 = (this_00->_tearColor)._colorize[3]; (param_1->_tearColor)._colorize[0] = (this_00->_tearColor)._colorize[0]; (param_1->_tearColor)._colorize[1] = fVar23; (param_1->_tearColor)._colorize[2] = fVar24; (param_1->_tearColor)._colorize[3] = fVar2; *(undefined8 *)(param_1->_tearColor)._offset = *(undefined8 *)(this_00->_tearColor)._offset; (param_1->_tearColor)._offset[2] = (this_00->_tearColor)._offset[2]; param_3 = param_1->_tearDamage; } param_1->_tearScale = 1.0; param_1[1]._tearVariant = 0x3f800000; param_1[1]._bombVariant = 0x3fd9999a; this_01 = this_00; local_140 = (TemporaryEffects *)tearFlags; if (familiar != (Entity_Familiar *)0x0) { if (familiar->_variant == 0xee) { if (*(int *)&g_game->_deathmatchManager < 2) { param_3 = param_3 * 0.35; goto LAB_007bf7d4; } } else { if (familiar->_variant == 0xeb) { param_3 = param_3 * 0.5; param_1->_tearDamage = param_3; } if ((this_00->_playerType != 0xd) && (this_00->_playerType != 0x20)) { param_3 = param_3 * 0.75; LAB_007bf7d4: param_1->_tearDamage = param_3; } } bVar11 = HasCollectible(this_00,0xf7,0); if (bVar11 != 0) { param_1->_tearDamage = param_1->_tearDamage + param_1->_tearDamage; } bVar11 = HasTrinket(in_ECX,0x7f,0); if (bVar11 == 0) { LAB_007bf859: if (familiar->_isLilDelirium != 0) { (param_1->_tearColor)._colorize[0] = 2.4; (param_1->_tearColor)._colorize[1] = 2.4; (param_1->_tearColor)._colorize[2] = 2.4; (param_1->_tearColor)._colorize[3] = 1.0; param_1->_tearVariant = 1; } } else { local_124 = (float)(*(uint *)((int)&(param_1->_flags)._h + 4) & g_tearFlagHoming._h._4_4_); if ((((uint)g_tearFlagHoming._l & (uint)tearFlags->_l) != 0 || (g_tearFlagHoming._l._4_4_ & *(uint *)((int)&(param_1->_flags)._l + 4)) != 0) || (((uint)(param_1->_flags)._h & (uint)g_tearFlagHoming._h) != 0 || local_124 != 0.0)) goto LAB_007bf859; Entity_Familiar::apply_baby_bender_tear_params (familiar,tearFlags,¶m_1->_tearColor,¶m_1->_tearHeight,&local_124,&local_138 ,0); } this_01 = in_ECX; } if (this_01->_playerType == 0x1a) { param_1->_tearScale = param_1->_tearScale * 0.8; } baseDamage = param_1->_tearDamage; fVar23 = this_01[1]._chargeBarSprites[0]._championColor._tint[0]; local_124 = 1.0; if ((fVar23 == 0.0) || (fVar23 != 4.2039e-44)) { iVar13 = GetTrinketMultiplier(this_01,0x1e); bVar22 = false; bVar21 = iVar13 == 0; LAB_007bf8f0: if (!bVar21 && bVar22 == iVar13 < 0) { this_01 = in_ECX; goto LAB_007bf8ff; } } else { if (*(char *)(this_01[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(this_01,0x1e); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007bf8f0; } LAB_007bf8ff: iVar12 = 10; iVar13 = GetTrinketMultiplier(this_01,0x1e); if (iVar13 < 3) { if (iVar13 == 2) { iVar12 = 0x14; } local_130 = iVar12; } else { local_130 = 0x21; } iVar13 = __ftoui3(); pvVar16 = (in_ECX->_trinketRNGs)._begin; local_130 = local_130 + iVar13; puVar18 = (uint *)((int)pvVar16 + 0x1e0); uVar15 = *puVar18; local_148 = puVar18; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar18; if (uVar15 == 0) { pcVar7 = (code *)swi(3); pTVar14 = (TearParams *)(*pcVar7)(); return pTVar14; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar16 + 0x1e4) & 0x1f) ^ uVar15; uVar15 = uVar15 << ((byte)*(undefined4 *)((int)pvVar16 + 0x1e8) & 0x1f) ^ uVar15; uVar15 = uVar15 >> ((byte)local_148[3] & 0x1f) ^ uVar15; *local_148 = uVar15; if (uVar15 % 100 < local_130) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagPoison._l; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | g_tearFlagPoison._l._4_4_; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | (uint)g_tearFlagPoison._h; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | g_tearFlagPoison._h._4_4_; if (param_2 != 5) { local_134->_tint[0] = 0.5; local_134->_tint[1] = 0.97; local_134->_tint[2] = 0.5; local_134->_tint[3] = 1.0; } (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } } bVar11 = HasCollectible(in_ECX,0x189,0); if ((bVar11 != 0) && (uVar15 = Random(), uVar15 % 100 < 0xf)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagPoison._l; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | g_tearFlagPoison._l._4_4_; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | (uint)g_tearFlagPoison._h; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | g_tearFlagPoison._h._4_4_; if (param_2 != 5) { (param_1->_tearColor)._tint[0] = 0.5; (param_1->_tearColor)._tint[1] = 0.97; (param_1->_tearColor)._tint[2] = 0.5; (param_1->_tearColor)._tint[3] = 1.0; } (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 4.34403e-44)) { iVar13 = GetTrinketMultiplier(in_ECX,0x1f); bVar22 = false; bVar21 = iVar13 == 0; LAB_007bfabc: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007bfac7; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x1f); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007bfabc; } LAB_007bfac7: iVar12 = GetTrinketMultiplier(in_ECX,0x1f); iVar13 = 10; if (iVar12 == 2) { iVar13 = 0x14; } else if (2 < iVar12) { iVar13 = 0x21; } pvVar16 = (in_ECX->_trinketRNGs)._begin; puVar18 = (uint *)((int)pvVar16 + 0x1f0); uVar15 = *puVar18; local_130 = iVar13 + (int)(in_ECX->_luck * 5.0); local_148 = puVar18; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar18; if (uVar15 == 0) { pcVar7 = (code *)swi(3); pTVar14 = (TearParams *)(*pcVar7)(); return pTVar14; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar16 + 500) & 0x1f) ^ uVar15; uVar15 = uVar15 << ((byte)*(undefined4 *)((int)pvVar16 + 0x1f8) & 0x1f) ^ uVar15; uVar15 = uVar15 >> ((byte)local_148[3] & 0x1f) ^ uVar15; *local_148 = uVar15; if (uVar15 % 100 < local_130) { uVar19 = DAT_00c34b58 | (uint)g_tearFlagSpectral._h; uVar17 = DAT_00c34b5c | g_tearFlagSpectral._h._4_4_; uVar15 = DAT_00c34b50 | (uint)g_tearFlagSpectral._l; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34b54 | g_tearFlagSpectral._l._4_4_; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | uVar19; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | uVar15; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | uVar17; local_134->_tint[0] = 1.5; local_134->_tint[1] = 2.0; local_134->_tint[2] = 2.0; local_134->_tint[3] = 0.5; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; param_1->_tearVariant = 0xb; } } bVar11 = HasCollectible(in_ECX,0x6e,0); if (bVar11 != 0) { local_148 = (uint *)(5 - (int)(in_ECX->_luck * 0.15)); if ((int)local_148 < 2) { local_148 = (uint *)0x2; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34be0; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34be4; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | DAT_00c34be8; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | DAT_00c34bec; (param_1->_tearColor)._tint[0] = 1.25; (param_1->_tearColor)._tint[1] = 0.05; (param_1->_tearColor)._tint[2] = 0.15; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } } bVar11 = HasCollectible(in_ECX,0x176,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x176), bVar11 != 0 )) { local_148 = (uint *)(10 - (int)(in_ECX->_luck * 0.9)); if ((int)local_148 < 2) { local_148 = (uint *)0x2; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34ab0; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34ab4; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | DAT_00c34ab8; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | DAT_00c34abc; } } bVar11 = HasCollectible(in_ECX,0x59,0); if (bVar11 != 0) { local_148 = (uint *)(4 - (int)(in_ECX->_luck * 0.2)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { (param_1->_tearColor)._tint[0] = 2.0; (param_1->_tearColor)._tint[1] = 2.0; (param_1->_tearColor)._tint[2] = 2.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.19607845; (param_1->_tearColor)._offset[1] = 0.19607845; (param_1->_tearColor)._offset[2] = 0.19607845; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c30; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34c34; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | DAT_00c34c38; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | DAT_00c34c3c; } } local_141 = '\0'; fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.82169e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,0x82); bVar22 = false; bVar21 = iVar13 == 0; LAB_007bfdf7: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007bfe02; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x82); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007bfdf7; } LAB_007bfe02: iVar13 = GetTrinketMultiplier(in_ECX,0x82); if (iVar13 == 2) { iVar13 = 5; } else if (iVar13 == 3) { iVar13 = 3; } else { iVar13 = 10; } local_148 = (uint *)(iVar13 - (int)(in_ECX->_luck * 0.5)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if (local_148 == (uint *)0x0) { uVar15 = 0; } else { uVar15 = Random(); uVar15 = uVar15 % (uint)local_148; } local_141 = uVar15 == 0; } bVar11 = HasCollectible(in_ECX,0xe7,0); if (bVar11 == 0) { LAB_007bfec1: if (local_141 != '\0') goto LAB_007bfec8; } else { local_148 = (uint *)(10 - (int)(in_ECX->_luck * 0.5)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 != (uint *)0x0) && (uVar15 = Random(), uVar15 % (uint)local_148 != 0)) goto LAB_007bfec1; LAB_007bfec8: uVar19 = DAT_00c34ad8 | DAT_00c34c38; uVar17 = DAT_00c34adc | DAT_00c34c3c; uVar15 = DAT_00c34ad0 | DAT_00c34c30; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34ad4 | DAT_00c34c34; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | uVar19; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | uVar15; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | uVar17; local_134->_tint[0] = 0.15; local_134->_tint[1] = 0.15; local_134->_tint[2] = 0.15; local_134->_tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } bVar11 = HasCollectible(in_ECX,0x67,0); if (bVar11 != 0) { local_148 = (uint *)(4 - (int)(in_ECX->_luck * 0.25)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagPoison._l; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | g_tearFlagPoison._l._4_4_; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | (uint)g_tearFlagPoison._h; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | g_tearFlagPoison._h._4_4_; (param_1->_tearColor)._tint[0] = 0.4; (param_1->_tearColor)._tint[1] = 0.97; (param_1->_tearColor)._tint[2] = 0.5; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } } bVar11 = HasCollectible(in_ECX,200,0); if (bVar11 != 0) { local_148 = (uint *)(10 - (int)(in_ECX->_luck * 0.334)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { (param_1->_tearColor)._tint[0] = 1.0; (param_1->_tearColor)._tint[1] = 0.0; (param_1->_tearColor)._tint[2] = 1.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.19607845; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c10; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34c14; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | DAT_00c34c18; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | DAT_00c34c1c; } } bVar11 = HasCollectible(in_ECX,0xc9,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0xc9), bVar11 != 0) ) { local_148 = (uint *)(10 - (int)(in_ECX->_luck * 0.334)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { (param_1->_tearColor)._tint[0] = 0.5; (param_1->_tearColor)._tint[1] = 0.5; (param_1->_tearColor)._tint[2] = 0.5; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34bf0; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | DAT_00c34bf4; pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | DAT_00c34bf8; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | DAT_00c34bfc; } } bVar11 = HasCollectible(in_ECX,0x1a2,0); if (bVar11 == 0) { bVar11 = TemporaryEffects::HasCollectibleEffect(&in_ECX->_temporaryeffects,0x1a2); if (bVar11 != 0) goto LAB_007c0179; } else { LAB_007c0179: local_120._red = *(float *)&tearFlags->_l; local_120._green = *(float *)((int)&(param_1->_flags)._l + 4); local_120._blue = *(float *)&(param_1->_flags)._h; local_120._alpha = *(float *)((int)&(param_1->_flags)._h + 4); uVar15 = Random(); uVar15 = uVar15 % 0x54; if (uVar15 < 0x40) { uVar17 = 1 << (uVar15 & 0x1f); uVar19 = 0; if (0x1f < uVar15) { uVar19 = uVar17; } uVar17 = uVar17 ^ uVar19; if (0x3f < uVar15) { uVar19 = uVar17; } *(uint *)&tearFlags->_l = (uint)tearFlags->_l | uVar17; puVar18 = (uint *)((int)&(param_1->_flags)._l + 4); *puVar18 = *puVar18 | uVar19; } else { uVar15 = uVar15 - 0x40; uVar17 = 1 << (uVar15 & 0x1f); uVar19 = 0; if (0x1f < uVar15) { uVar19 = uVar17; } uVar17 = uVar17 ^ uVar19; if (0x3f < uVar15) { uVar19 = uVar17; } pqVar1 = &(param_1->_flags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | uVar17; puVar18 = (uint *)((int)&(param_1->_flags)._h + 4); *puVar18 = *puVar18 | uVar19; } local_148 = (uint *)(DAT_00c34588 | DAT_00c34578); local_134 = (ColorMod *)(DAT_00c3458c | DAT_00c3457c); uVar19 = DAT_00c34b9c | DAT_00c3456c | DAT_00c34a9c | DAT_00c3499c; uVar17 = DAT_00c34a94 | DAT_00c34994 | DAT_00c34564 | DAT_00c34b94 | DAT_00c34584 | DAT_00c34574 ; uVar20 = DAT_00c34a98 | DAT_00c34998 | DAT_00c34568 | DAT_00c34b98; uVar15 = *(uint *)((int)&(param_1->_flags)._l + 4); *(uint *)&(param_1->_flags)._l = ~(DAT_00c34a90 | DAT_00c34990 | DAT_00c34560 | DAT_00c34b90 | DAT_00c34580 | DAT_00c34570) & (uint)(param_1->_flags)._l | (uint)local_120._red; *(uint *)((int)&(param_1->_flags)._l + 4) = ~uVar17 & uVar15 | (uint)local_120._green; qVar10 = (param_1->_flags)._h; *(uint *)((int)&(param_1->_flags)._h + 4) = ~((uint)local_134 | uVar19) & *(uint *)((int)&(param_1->_flags)._h + 4) | (uint)local_120._alpha; *(uint *)&(param_1->_flags)._h = ~((uint)local_148 | uVar20) & (uint)qVar10 | (uint)local_120._blue; tearFlags = (BitSet128 *)local_140; } if ((in_ECX->_temporaryeffects)._disabled == 0) { for (effect = (in_ECX->_temporaryeffects)._effects._begin; effect != (in_ECX->_temporaryeffects)._effects._end; effect = effect + 4) { if ((*(int *)*effect == 0) && (*(int *)(*effect + 4) == 0x39)) { param_1->_tearVariant = 1; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c346a0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c346a4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c346a8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c346ac; break; } } } bVar11 = HasCollectible(in_ECX,0x231,0); if (bVar11 == 0) { bVar11 = HasCollectible(in_ECX,0x14a,0); if (bVar11 != 0) { fVar23 = param_1->_tearScale * 0.5; goto LAB_007c034e; } } else { fVar23 = param_1->_tearScale * 0.7; LAB_007c034e: param_1->_tearScale = fVar23; } bVar11 = HasCollectible(in_ECX,0x150,0); if (bVar11 != 0) { param_1->_tearScale = param_1->_tearScale * 1.5; } local_142 = param_1->_tearVariant == 1; if ((param_4 < 0) || ((((((familiar != (Entity_Familiar *)0x0 || (in_ECX->_playerType == 2)) || (bVar11 = HasCollectible(in_ECX,0x1bc,0), bVar11 != 0)) || ((in_ECX->field_0x13f1 == '\0' || (bVar11 = HasCollectible(in_ECX,0x13c,0), bVar11 != 0)))) || ((bVar11 = HasCollectible(in_ECX,0x2c4,0), bVar11 != 0 || (in_ECX->_playerType == 0x17)))) && (uVar15 = Random(), (uVar15 & 1) == 0)))) { isNegativeDisplacement = '\x01'; } else { isNegativeDisplacement = '\0'; } if ((param_4 < 1) || (isNegativeDisplacement != '\0')) { local_141 = '\0'; param_1[1]._tearColor._tint[1] = (float)-(uint)(isNegativeDisplacement != '\0'); } else { local_141 = '\x01'; param_1[1]._tearColor._tint[1] = 1.4013e-45; } bVar11 = HasCollectible(in_ECX,0x14a,0); if ((bVar11 == 0) && (bVar11 = HasCollectible(in_ECX,0x231,0), bVar11 == 0)) { bVar11 = HasCollectible(in_ECX,0xe6,0); if ((((bVar11 == 0) && (((bVar11 = HasCollectible(in_ECX,0xe5,0), bVar11 == 0 && (bVar11 = HasCollectible(in_ECX,7,0), bVar11 == 0)) && (bVar11 = HasCollectible(in_ECX,0x8a,0), bVar11 == 0)))) && ((bVar11 = HasCollectible(in_ECX,0x50,0), bVar11 == 0 && (bVar11 = HasCollectible(in_ECX,0xb7,0), bVar11 == 0)))) && ((in_ECX->_variant != 1 || (in_ECX->_babySkin != 0xd)))) { local_140 = &in_ECX->_temporaryeffects; bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x22); if ((((bVar11 == 0) && (bVar11 = HasCollectible(in_ECX,0x5a,0), bVar11 == 0)) && ((bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x7a), bVar11 == 0 && (((bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x7e), bVar11 == 0 && (bVar11 = TemporaryEffects::HasTrinketEffect(local_140,0x28), bVar11 == 0)) && (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x1c4), bVar11 == 0)))))) && ((bVar11 = HasCollectible(in_ECX,399,0), bVar11 == 0 && (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x53), bVar11 == 0)))) goto LAB_007c05a1; } LAB_007c0764: local_142 = '\x01'; } else { LAB_007c05a1: bVar11 = HasCollectible(in_ECX,0x1b8,0); if ((bVar11 != 0) || ((((bVar11 = HasCollectible(in_ECX,0x1bb,0), bVar11 != 0 || (bVar11 = HasCollectible(in_ECX,0x1ce,0), bVar11 != 0)) || ((bVar11 = HasCollectible(in_ECX,0x1bc,0), bVar11 != 0 && (isNegativeDisplacement != '\0')) )) || ((((bVar11 = HasCollectible(in_ECX,0x9b,0), bVar11 != 0 && (isNegativeDisplacement != '\0')) || (local_148 = (uint *)in_ECX->_playerType, local_148 == (uint *)&DAT_0000000b)) || ((local_148 == (uint *)0xc || (0x5a < in_ECX->_redStewBonusDuration)))))))) goto LAB_007c0764; local_140 = &in_ECX->_temporaryeffects; bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x25d); if (((((bVar11 != 0) && (local_141 != '\0')) || (((local_148 == (uint *)&DAT_00000014 || (local_148 == (uint *)0x18)) || ((local_148 == (uint *)0x26 || (local_148 == (uint *)0x24)))))) || (((familiar != (Entity_Familiar *)0x0 && (familiar->_variant == 0xee)) && ((iVar13 = familiar->_subtype, iVar13 == 0 || ((iVar13 == 6 || (iVar13 == 7)))))))) || ((((bVar11 = TemporaryEffects::HasNullEffect(local_140,0x36), bVar11 != 0 || (((bVar11 = TemporaryEffects::HasNullEffect(local_140,0x37), bVar11 != 0 || (bVar11 = TemporaryEffects::HasNullEffect(local_140,0x7b), bVar11 != 0)) || (bVar11 = TemporaryEffects::HasNullEffect(local_140,0x7c), bVar11 != 0)))) || (((bVar11 = TemporaryEffects::HasNullEffect(local_140,0x81), bVar11 != 0 || (bVar11 = TemporaryEffects::HasNullEffect(local_140,0x82), bVar11 != 0)) || (bVar11 = TemporaryEffects::HasNullEffect(local_140,100), bVar11 != 0)))) || ((bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x2d9), bVar11 != 0 && (bVar11 = HasCollectible(in_ECX,0x3b,0), bVar11 != 0)))))) goto LAB_007c0764; } bVar11 = HasCollectible(in_ECX,0x45,0); local_130._0_1_ = local_142; if (bVar11 != 0) { local_130._0_1_ = '\0'; } local_130._1_3_ = 0; bVar11 = HasCollectible(in_ECX,0x214,0); if ((bVar11 != 0) && ((param_2 == 1 || (param_2 == 7)))) { param_1->_tearVariant = 0x24; } bVar11 = HasCollectible(in_ECX,0x1cc,0); if ((bVar11 != 0) && (uVar15 = Random(), uVar15 % 0x14 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a60; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a64; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a68; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a6c; param_1->_tearVariant = 0x18; } bVar11 = HasCollectible(in_ECX,0xe4,0); if ((bVar11 != 0) || (bVar11 = HasCollectible(in_ECX,0xe6,0), bVar11 != 0)) { local_148 = (uint *)(100 - (int)in_ECX->_luck); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 < 0xf)) { bVar11 = HasCollectible(in_ECX,0xe6,0); if (bVar11 == 0) { bVar11 = HasCollectible(in_ECX,0xe4,0); if (bVar11 != 0) { (param_1->_tearColor)._tint[0] = 1.0; (param_1->_tearColor)._tint[1] = 1.0; (param_1->_tearColor)._tint[2] = 0.454902; (param_1->_tearColor)._offset[0] = 0.16862746; (param_1->_tearColor)._offset[1] = 0.14509805; goto LAB_007c08cd; } } else { (param_1->_tearColor)._tint[0] = 0.3921569; (param_1->_tearColor)._tint[1] = 0.3921569; (param_1->_tearColor)._tint[2] = 0.3921569; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; LAB_007c08cd: (param_1->_tearColor)._offset[2] = 0.0; (param_1->_tearColor)._tint[3] = 1.0; } *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c20; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c24; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c28; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34c2c; } } if ((in_ECX->_variant == 1) && (in_ECX->_babySkin == 0x15)) { uVar15 = Random(); if (uVar15 % 0x1e == 0) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c20; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c24; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c28; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34c2c; } param_1->_tearScale = param_1->_tearScale + param_1->_tearScale; (param_1->_tearColor)._tint[0] = 0.0; (param_1->_tearColor)._tint[1] = 0.0; (param_1->_tearColor)._tint[2] = 0.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } bVar11 = HasCollectible(in_ECX,0x9b,0); if ((bVar11 != 0) && (isNegativeDisplacement != '\0')) { local_130._0_1_ = '\x01'; param_1->_tearDamage = param_1->_tearDamage * 1.35; } local_140 = &in_ECX->_temporaryeffects; bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x25d); if ((bVar11 != 0) && (local_141 != '\0')) { local_130._0_1_ = '\x01'; param_1->_tearDamage = param_1->_tearDamage * 1.35; } bVar11 = HasCollectible(in_ECX,0x9a,0); if ((bVar11 != 0) && (isNegativeDisplacement != '\0')) { local_130._0_1_ = '\x01'; param_1->_tearDamage = param_1->_tearDamage + 2.0; } bVar11 = HasCollectible(in_ECX,0x1cf,0); if ((bVar11 != 0) && (uVar15 = Random(), (uVar15 & 3) == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a30; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a34; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a38; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a3c; (param_1->_tearColor)._tint[0] = 1.0; (param_1->_tearColor)._tint[1] = 1.0; (param_1->_tearColor)._tint[2] = 0.1; (param_1->_tearColor)._tint[3] = 1.0; } bVar11 = HasCollectible(in_ECX,0xfe,0); if ((bVar11 != 0) && (isNegativeDisplacement != '\0')) { (param_1->_tearColor)._tint[0] = 1.0; (param_1->_tearColor)._tint[1] = 0.0; (param_1->_tearColor)._tint[2] = 0.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; param_1->_tearDamage = param_1->_tearDamage + 1.0; param_1->_tearScale = param_1->_tearScale * 1.25; param_1->_tearHeight = param_1->_tearHeight - 10.0; } bVar11 = HasCollectible(in_ECX,0x2db,0); if ((bVar11 != 0) && (local_141 != '\0')) { (param_1->_tearColor)._tint[0] = 1.5; (param_1->_tearColor)._tint[1] = 2.0; (param_1->_tearColor)._tint[2] = 2.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; param_1->_tearDamage = param_1->_tearDamage * 1.2857143; param_1->_tearScale = param_1->_tearScale * 1.25; param_1[1]._tearColor._tint[0] = param_1[1]._tearColor._tint[0] * 0.8; } bVar11 = HasCollectible(in_ECX,0x105,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x105), bVar11 != 0)) { param_1->_tearScale = param_1->_tearScale * 3.0; } bVar11 = HasCollectible(in_ECX,0x135,0); if ((bVar11 != 0) || (iVar13 = GetZodiacEffect(in_ECX), iVar13 == 0x135)) { param_1->_tearScale = param_1->_tearScale * 1.25; } bVar11 = HasCollectible(in_ECX,0x30,0); if (((bVar11 != 0) || (bVar11 = HasCollectible(in_ECX,0x132,0), bVar11 != 0)) || (iVar13 = GetZodiacEffect(in_ECX), iVar13 == 0x132)) { param_1->_tearVariant = 0xb; } bVar11 = HasCollectible(in_ECX,0x167,0); if (bVar11 != 0) { param_1->_tearVariant = 0xd; } bVar11 = HasCollectible(in_ECX,0x17b,0); if (bVar11 != 0) { param_1->_tearVariant = 0xe; param_1->_tearScale = param_1->_tearScale * 3.0; } bVar11 = HasCollectible(in_ECX,0x293,0); if (bVar11 != 0) { param_1->_tearScale = (param_1->_tearScale + 0.2) * 1.25; } bVar11 = HasCollectible(in_ECX,0x254,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x254), bVar11 != 0)) { param_1->_tearVariant = 0x29; uVar15 = Random(); if (uVar15 % 10 == 0) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34be0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34be4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34be8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34bec; } } bVar11 = HasCollectible(in_ECX,0x250,0); if (bVar11 != 0) { uVar15 = Random(); param_1->_tearVariant = 0x2a; fVar23 = (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10; local_148 = (uint *)((fVar23 + fVar23) - 1.0); fVar23 = pow(2.0,(float)local_148 * 0.2); param_1->_tearScale = fVar23 * param_1->_tearScale; fVar23 = pow(2.0,(float)local_148); param_1->_tearDamage = fVar23 * param_1->_tearDamage; } if ((in_ECX->_temporaryeffects)._disabled == 0) { for (effect = (in_ECX->_temporaryeffects)._effects._begin; effect != (in_ECX->_temporaryeffects)._effects._end; effect = effect + 4) { if ((*(int *)*effect == 0) && (((int *)*effect)[1] == 0x41)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c349a0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c349a4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c349a8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c349ac; break; } } } bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x19f); if (bVar11 != 0) { param_1->_tearVariant = 0x12; } bVar11 = HasCollectible(in_ECX,0x13b,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x13b), bVar11 != 0)) { param_1->_tearVariant = 3; } bVar11 = HasCollectible(in_ECX,0x1f0,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x1f0), bVar11 != 0)) { local_148 = (uint *)(0x1e - (int)(in_ECX->_luck + in_ECX->_luck)); if ((int)local_148 < 4) { local_148 = (uint *)&DAT_00000004; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { param_1->_tearVariant = 0x1f; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a10; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a14; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a18; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a1c; param_1->_tearDamage = param_1->_tearDamage * 3.0; } } bVar11 = HasCollectible(in_ECX,0x1cb,0); if ((bVar11 != 0) && (uVar15 = Random(), uVar15 % 5 == 0)) { param_1->_tearVariant = 0x1a; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a50; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a54; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a58; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a5c; } fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.37327e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,0x62); bVar22 = false; bVar21 = iVar13 == 0; LAB_007c0f31: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007c0f40; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x62); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007c0f31; } LAB_007c0f40: local_134 = (ColorMod *)0x3dcccccd; local_148 = (uint *)0x3f000000; iVar13 = GetTrinketMultiplier(in_ECX,0x62); if (iVar13 == 2) { local_134 = (ColorMod *)0x3e4ccccd; local_148 = (uint *)0x3f400000; } else if (iVar13 == 3) { local_134 = (ColorMod *)0x3e99999a; local_148 = (uint *)0x3f800000; } uVar15 = Random(); if ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 <= (float)local_134) { param_1->_tearVariant = 0x1a; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a50; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a54; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a58; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a5c; uVar15 = Random(); if ((float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10 <= (float)local_148) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagHoming._l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | g_tearFlagHoming._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)g_tearFlagHoming._h; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | g_tearFlagHoming._h._4_4_; } } } bVar11 = HasCollectible(in_ECX,0x229,0); if ((bVar11 != 0) && (uVar15 = Random(), (uVar15 & 3) == 0)) { param_1->_tearVariant = 0x30; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34630; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34634; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34638; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c3463c; } bVar11 = HasCollectible(in_ECX,0x191,0); if ((bVar11 != 0) && (uVar15 = Random(), (uVar15 & 3) == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34930; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34934; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34938; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c3493c; iVar13 = param_1->_tearVariant; if ((iVar13 == 0) || (((iVar13 == 1 || (iVar13 == 0xb)) || (iVar13 == 0xc)))) { param_1->_tearVariant = 0x13; } else { (param_1->_tearColor)._tint[0] = 0.2; (param_1->_tearColor)._tint[1] = 0.09; (param_1->_tearColor)._tint[2] = 0.065; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } } bVar11 = HasCollectible(in_ECX,0xd5,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0xd5), bVar11 != 0)) { param_1->_tearVariant = 10; } bVar11 = HasCollectible(in_ECX,0x1c5,0); if (bVar11 != 0) { param_1->_tearVariant = 0x1d; } bVar11 = HasCollectible(in_ECX,0x18e,0); if (((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x18e), bVar11 != 0)) && (uVar15 = Random(), uVar15 % 5 == 0)) { param_1->_tearVariant = 0x10; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a80; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a84; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a88; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a8c; if (param_2 != 1) { local_a0 = 0; uStack_9c = local_a0; local_98 = local_a0; if (¶m_1->_tearColor != (ColorMod *)local_c0) { (param_1->_tearColor)._colorize[0] = 0.0; (param_1->_tearColor)._colorize[1] = 0.0; (param_1->_tearColor)._colorize[2] = 0.0; (param_1->_tearColor)._colorize[3] = 0.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._tint[0] = 0.6; (param_1->_tearColor)._tint[1] = 0.7; (param_1->_tearColor)._tint[2] = 1.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[2] = 0.0; } } } bVar11 = HasCollectible(in_ECX,0x211,0); if (bVar11 != 0) { param_1->_tearVariant = ((char)local_130 != '\0') + 0x21; } bVar11 = HasCollectible(in_ECX,0x103,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x103), bVar11 != 0)) { local_148 = (uint *)(3 - (int)(in_ECX->_luck * 0.1)); if ((int)local_148 < 1) { local_148 = (uint *)0x1; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c20; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c24; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c28; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34c2c; } } bVar11 = HasCollectible(in_ECX,0x1ad,0); if (((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x1ad), bVar11 != 0)) || ((in_ECX->_variant == 1 && (in_ECX->_babySkin == 0x36)))) { param_1->_tearVariant = 0x14; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a70; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a74; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a78; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a7c; } bVar11 = HasCollectible(in_ECX,0xed,0); if ((bVar11 != 0) || (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0xed), bVar11 != 0)) { param_1->_tearVariant = 8; } fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.38729e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,99); bVar22 = false; bVar21 = iVar13 == 0; LAB_007c136f: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007c137e; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,99); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007c136f; } LAB_007c137e: iVar13 = GetTrinketMultiplier(in_ECX,99); if (iVar13 == 2) { iVar13 = 5; } else if (iVar13 == 3) { iVar13 = 3; } else { iVar13 = 10; } local_148 = (uint *)(iVar13 - (int)(in_ECX->_luck * 0.5)); if ((int)local_148 < 0) { local_148 = (uint *)0x0; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34b80; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34b84; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34b88; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34b8c; (param_1->_tearColor)._tint[0] = 1.0; (param_1->_tearColor)._tint[1] = 1.0; (param_1->_tearColor)._tint[2] = 0.8; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.1; (param_1->_tearColor)._offset[1] = 0.1; (param_1->_tearColor)._offset[2] = 0.1; } } bVar11 = HasCollectible(in_ECX,0x131,0); if ((bVar11 != 0) || (iVar13 = GetZodiacEffect(in_ECX), iVar13 == 0x131)) { (param_1->_tearColor)._tint[0] = 0.19607845; (param_1->_tearColor)._tint[1] = 1.0; (param_1->_tearColor)._tint[2] = 0.19607845; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; } fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.33123e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,0x5f); bVar22 = false; bVar21 = iVar13 == 0; LAB_007c14b4: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007c14c3; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x5f); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007c14b4; } LAB_007c14c3: iVar13 = GetTrinketMultiplier(in_ECX,0x5f); if (iVar13 == 2) { iVar13 = 0x10; } else if (iVar13 == 3) { iVar13 = 0xb; } else { iVar13 = 0x21; } puVar18 = (uint *)(iVar13 - (int)in_ECX->_luck); local_148 = (uint *)0x0; if (0 < (int)puVar18) { local_148 = puVar18; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { fVar23 = param_1->_tearDamage; if (fVar23 <= baseDamage + baseDamage) { fVar23 = baseDamage + baseDamage; } param_1->_tearVariant = 0x1e; param_1->_tearDamage = fVar23; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagPoison._l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | g_tearFlagPoison._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)g_tearFlagPoison._h; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | g_tearFlagPoison._h._4_4_; } } local_142 = '\0'; fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.80768e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,0x81); bVar22 = false; bVar21 = iVar13 == 0; LAB_007c159a: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007c15a5; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x81); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007c159a; } LAB_007c15a5: iVar13 = GetTrinketMultiplier(in_ECX,0x81); if (iVar13 == 2) { iVar13 = 5; } else if (iVar13 == 3) { iVar13 = 3; } else { iVar13 = 10; } puVar18 = (uint *)(iVar13 - (int)in_ECX->_luck); local_148 = (uint *)0x0; if (0 < (int)puVar18) { local_148 = puVar18; } if (local_148 == (uint *)0x0) { uVar15 = 0; } else { uVar15 = Random(); uVar15 = uVar15 % (uint)local_148; } local_142 = uVar15 == 0; } bVar11 = HasCollectible(in_ECX,0x96,0); if ((bVar11 == 0) && (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x96), bVar11 == 0)) { LAB_007c1656: if (local_142 != '\0') goto LAB_007c165d; } else { puVar18 = (uint *)(10 - (int)in_ECX->_luck); local_148 = (uint *)0x0; if (0 < (int)puVar18) { local_148 = puVar18; } if ((local_148 != (uint *)0x0) && (uVar15 = Random(), uVar15 % (uint)local_148 != 0)) goto LAB_007c1656; LAB_007c165d: fVar23 = param_1->_tearDamage; if (fVar23 <= baseDamage * 3.2) { fVar23 = baseDamage * 3.2; } param_1->_tearVariant = 2; param_1->_tearDamage = fVar23; } bVar11 = HasCollectible(in_ECX,0x1bb,0); if (bVar11 != 0) { puVar18 = (uint *)(0xf - (int)in_ECX->_luck); local_148 = (uint *)0x0; if (0 < (int)puVar18) { local_148 = puVar18; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { fVar23 = param_1->_tearDamage; if (fVar23 <= baseDamage * 4.0) { fVar23 = baseDamage * 4.0; } param_1->_tearVariant = 0x1c; param_1->_tearDamage = fVar23; } } bVar11 = HasCollectible(in_ECX,0x1cd,0); if (bVar11 != 0) { puVar18 = (uint *)(7 - (int)in_ECX->_luck); local_148 = (uint *)0x2; if (2 < (int)puVar18) { local_148 = puVar18; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { fVar23 = param_1->_tearHeight; param_1->_tearVariant = 0x1b; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a40; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a44; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a48; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a4c; param_1->_tearHeight = fVar23 + fVar23; } } fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.34525e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,0x60); bVar22 = false; bVar21 = iVar13 == 0; LAB_007c17ac: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007c17b7; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x60); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007c17ac; } LAB_007c17b7: puVar18 = (uint *)(10 - (int)in_ECX->_luck); local_148 = (uint *)0x1; if (1 < (int)puVar18) { local_148 = puVar18; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagHoming._l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | g_tearFlagHoming._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)g_tearFlagHoming._h; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | g_tearFlagHoming._h._4_4_; } } bVar11 = HasCollectible(in_ECX,0x1f7,0); if (bVar11 != 0) { puVar18 = (uint *)(0x14 - (int)in_ECX->_luck); local_148 = (uint *)&DAT_00000005; if (5 < (int)puVar18) { local_148 = puVar18; } if ((local_148 == (uint *)0x0) || (uVar15 = Random(), uVar15 % (uint)local_148 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a00; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a04; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a08; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a0c; local_74 = 0; uStack_70 = 0; local_6c = 0; if (¶m_1->_tearColor != (ColorMod *)local_94) { (param_1->_tearColor)._colorize[0] = 0.0; (param_1->_tearColor)._colorize[1] = 0.0; (param_1->_tearColor)._colorize[2] = 0.0; (param_1->_tearColor)._colorize[3] = 0.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._tint[0] = 0.0; (param_1->_tearColor)._tint[1] = 0.0; (param_1->_tearColor)._tint[2] = 0.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[2] = 0.0; } } } if (((local_140->_disabled == 0) && (pvVar16 = TemporaryEffects::GetCollectibleEffect(local_140,0x22b), pvVar16 != (void *)0x0)) && (0 < *(int *)((int)pvVar16 + 4))) { fVar23 = (param_1->_tearColor)._colorize[1]; fVar24 = (float)*(int *)((int)pvVar16 + 4) / 3.0; if (fVar24 <= 0.0) { fVar24 = 0.0; } fVar2 = (param_1->_tearColor)._colorize[3]; fVar3 = (param_1->_tearColor)._colorize[2]; if (0.9 <= fVar24) { fVar24 = 0.9; } fVar4 = (param_1->_tearColor)._colorize[1]; fVar5 = (param_1->_tearColor)._colorize[3]; fVar6 = (param_1->_tearColor)._colorize[2]; (param_1->_tearColor)._colorize[0] = (2.0 - (param_1->_tearColor)._colorize[0]) * fVar24 + (param_1->_tearColor)._colorize[0]; (param_1->_tearColor)._colorize[1] = (1.0 - fVar23) * fVar24 + fVar4; fVar23 = (param_1->_tearColor)._offset[0]; (param_1->_tearColor)._colorize[2] = (0.0 - fVar3) * fVar24 + fVar6; fVar3 = (param_1->_tearColor)._offset[1]; (param_1->_tearColor)._colorize[3] = (1.0 - fVar2) * fVar24 + fVar5; (param_1->_tearColor)._offset[0] = fVar24 * 0.1 + fVar23; (param_1->_tearColor)._offset[1] = fVar24 * 0.05 + fVar3; } if ((param_2 == 5) || (param_2 == 6)) { addedFlags = GetBombFlags(in_ECX,(BitSet128 *)&local_120,1); *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)addedFlags->_l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | *(uint *)((int)&addedFlags->_l + 4); *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)addedFlags->_h; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | *(uint *)((int)&addedFlags->_h + 4); uVar15 = (uint)tearFlags->_h; local_134 = *(ColorMod **)((int)&tearFlags->_h + 4); } else { uVar15 = (uint)(param_1->_flags)._h; local_134 = *(ColorMod **)((int)&(param_1->_flags)._h + 4); } if ((param_2 == 1) || (param_2 == 0xe)) { if ((((uint)tearFlags->_l & (uint)g_tearFlagExplosive._l) != 0 || (*(uint *)((int)&tearFlags->_l + 4) & g_tearFlagExplosive._l._4_4_) != 0) || ((uVar15 & (uint)g_tearFlagExplosive._h) != 0 || (g_tearFlagExplosive._h._4_4_ & (uint)local_134) != 0)) { if ((((uint)tearFlags->_l & (uint)g_tearFlagLudovico._l) == 0 && (*(uint *)((int)&tearFlags->_l + 4) & g_tearFlagLudovico._l._4_4_) == 0) && ((uVar15 & (uint)g_tearFlagLudovico._h) == 0 && (g_tearFlagLudovico._h._4_4_ & (uint)local_134) == 0)) { local_124 = 0.5; } } local_138 = uVar15 & DAT_00c34888; local_148 = (uint *)(DAT_00c3488c & (uint)local_134); if ((((uint)tearFlags->_l & DAT_00c34880) != 0 || (*(uint *)((int)&tearFlags->_l + 4) & DAT_00c34884) != 0) || (local_138 != 0 || local_148 != (uint *)0x0)) { local_138 = g_tearFlagLudovico._h._4_4_ & (uint)local_134; if ((((uint)tearFlags->_l & (uint)g_tearFlagLudovico._l) == 0 && (*(uint *)((int)&tearFlags->_l + 4) & g_tearFlagLudovico._l._4_4_) == 0) && ((uVar15 & (uint)g_tearFlagLudovico._h) == 0 && local_138 == 0)) { param_1->_tearScale = param_1->_tearScale * 1.2; } } bVar11 = HasCollectible(in_ECX,0x213,0); if (bVar11 == 0) { if (((in_ECX->_playerType == 0x10) || (in_ECX->_playerType == 0x23)) && (param_1->_tearVariant != 8)) { param_1->_tearVariant = 0x1d; } } else { param_1->_tearVariant = 0x23; bVar11 = HasCollectible(in_ECX,0x76,0); if (((bVar11 == 0) && (bVar11 = HasCollectible(in_ECX,0x44,0), bVar11 == 0)) && (bVar11 = HasCollectible(in_ECX,0x18b,0), bVar11 == 0)) { bVar11 = HasCollectible(in_ECX,0x34,0); if (bVar11 != 0) { param_1->_tearVariant = 0x26; } } else { param_1->_tearVariant = 0x25; } param_1->_tearScale = param_1->_tearScale * 1.71; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34960; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34964; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34968; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c3496c; } if (param_2 == 0xe) { param_1->_tearVariant = 0x32; } } else { bVar11 = HasCollectible(in_ECX,0x213,0); if (bVar11 != 0) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34960; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34964; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34968; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c3496c; } } bVar11 = HasCollectible(in_ECX,0x269,0); if (bVar11 != 0) { local_138 = (uint)(6.0 - in_ECX->_luck); if ((int)local_138 < 1) { local_138 = 1; } if ((local_138 == 0) || (uVar15 = Random(), uVar15 % local_138 == 0)) { (param_1->_tearColor)._colorize[0] = 0.5; (param_1->_tearColor)._colorize[1] = 0.5; (param_1->_tearColor)._colorize[2] = 0.5; (param_1->_tearColor)._colorize[3] = 1.0; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c349d0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c349d4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c349d8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c349dc; } } bVar11 = HasCollectible(in_ECX,0x26a,0); if (bVar11 != 0) { local_138 = (uint)(6.0 - in_ECX->_luck); if ((int)local_138 < 1) { local_138 = 1; } if ((local_138 == 0) || (uVar15 = Random(), uVar15 % local_138 == 0)) { (param_1->_tearColor)._tint[0] = 0.7; (param_1->_tearColor)._tint[1] = 0.14; (param_1->_tearColor)._tint[2] = 0.1; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[0] = 0.3; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._offset[2] = 0.0; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c349c0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c349c4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c349c8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c349cc; } } bVar11 = HasCollectible(in_ECX,0x27d,0); if (bVar11 != 0) { local_138 = (uint)(10.0 - in_ECX->_luck); if ((int)local_138 < 1) { local_138 = 1; } if ((local_138 == 0) || (uVar15 = Random(), uVar15 % local_138 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c349f0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c349f4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c349f8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c349fc; param_1->_tearVariant = 0x27; param_1->_tearScale = param_1->_tearScale * 1.5; } } bVar11 = HasCollectible(in_ECX,0x25e,0); if (bVar11 != 0) { uVar15 = 0x14 - (int)in_ECX->_luck; local_138 = 5; if (5 < (int)uVar15) { local_138 = uVar15; } if ((local_138 == 0) || (uVar15 = Random(), uVar15 % local_138 == 0)) { manager = g_manager; if ((familiar == (Entity_Familiar *)0x0) || (param_5->_variant != 0x6e)) { local_148 = (uint *)0x43f; seed_fart_sound_override((int *)&local_148); SoundEffects::Play(&manager->_sfxManager,(int)local_148,1.0,2,0,1.0,0.0); } *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34970; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34974; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34978; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c3497c; local_48 = 0; uStack_44 = 0; local_40 = 0; if (¶m_1->_tearColor != (ColorMod *)local_68) { (param_1->_tearColor)._colorize[0] = 0.0; (param_1->_tearColor)._colorize[1] = 0.0; (param_1->_tearColor)._colorize[2] = 0.0; (param_1->_tearColor)._colorize[3] = 0.0; (param_1->_tearColor)._offset[0] = 0.0; (param_1->_tearColor)._offset[1] = 0.0; (param_1->_tearColor)._tint[0] = 0.0; (param_1->_tearColor)._tint[1] = 0.0; (param_1->_tearColor)._tint[2] = 0.0; (param_1->_tearColor)._tint[3] = 1.0; (param_1->_tearColor)._offset[2] = 0.0; } } } if (in_ECX->_playerType == 0x13) { param_1->_tearScale = param_1->_tearScale * 0.9; } local_138 = (uint)tearFlags->_h & DAT_00c34c48; local_148 = (uint *)(*(uint *)((int)&tearFlags->_h + 4) & DAT_00c34c4c); if (((DAT_00c34c40 & (uint)tearFlags->_l) != 0 || (DAT_00c34c44 & *(uint *)((int)&tearFlags->_l + 4)) != 0) || (local_138 != 0 || local_148 != (uint *)0x0)) { param_1->_tearDamage = param_1->_tearDamage * 3.0; } bVar11 = HasCollectible(in_ECX,0x231,0); if (bVar11 != 0) { uVar15 = Random(); fVar23 = (float)((double)(int)uVar15 + __uint_to_double_fixup[-((int)uVar15 >> 0x1f)]) * 2.3283064e-10; if (0.05 <= fVar23) { if (0.1 <= fVar23) { if (0.3 <= fVar23) { puVar18 = (uint *)(uint)(fVar23 < 0.8); } else { puVar18 = (uint *)0x2; } } else { puVar18 = (uint *)0x3; } } else { puVar18 = (uint *)0x4; } if (((param_2 == 3) || (param_2 == 2)) || (param_2 == 9)) { local_142 = '\x01'; local_148 = (uint *)0x1; if (puVar18 == (uint *)0x0) { local_148 = puVar18; } } else { local_142 = '\0'; local_148 = puVar18; } if (local_148 != (uint *)0x0) { do { if (local_142 == '\0') { uVar15 = Random(); switch(uVar15 % 0xc) { case 0: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c348b0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c348b4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c348b8; uVar15 = DAT_00c348bc; break; case 1: goto LAB_007c2016; case 2: goto LAB_007c20bb; case 3: goto LAB_007c2037; case 4: goto LAB_007c2058; case 5: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34890; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34894; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34898; uVar15 = DAT_00c3489c; break; case 6: goto LAB_007c209a; case 7: goto LAB_007c2079; case 8: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34b80; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34b84; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34b88; uVar15 = DAT_00c34b8c; break; case 9: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34600; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34604; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34608; uVar15 = DAT_00c3460c; break; case 10: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34950; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34954; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34958; uVar15 = DAT_00c3495c; break; case 0xb: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c348e0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c348e4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c348e8; uVar15 = DAT_00c348ec; break; default: goto LAB_007c21ad; } goto LAB_007c21aa; } uVar15 = Random(); switch(uVar15 % 6) { case 0: LAB_007c2016: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c348c0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c348c4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c348c8; uVar15 = DAT_00c348cc; break; case 1: LAB_007c2037: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34870; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34874; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34878; uVar15 = DAT_00c3487c; break; case 2: LAB_007c2058: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34b60; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34b64; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34b68; uVar15 = DAT_00c34b6c; break; case 3: LAB_007c2079: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagHoming._l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | g_tearFlagHoming._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)g_tearFlagHoming._h; uVar15 = g_tearFlagHoming._h._4_4_; break; case 4: LAB_007c209a: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34860; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34864; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34868; uVar15 = DAT_00c3486c; break; case 5: LAB_007c20bb: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c348a0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c348a4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c348a8; uVar15 = DAT_00c348ac; break; default: goto LAB_007c21ad; } LAB_007c21aa: puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | uVar15; LAB_007c21ad: local_148 = (uint *)((int)local_148 - 1); } while (local_148 != (uint *)0x0); local_148 = (uint *)0x0; } } bVar11 = HasCollectible(in_ECX,0x23a,0); if (bVar11 != 0) { fVar23 = in_ECX->_luck; local_138 = (uint)(11.0 - fVar23 * 0.2); if ((int)local_138 < 6) { local_138 = 6; } if (local_138 == 0) { local_148 = (uint *)0x0; } else { uVar15 = Random(); local_148 = (uint *)(uVar15 % local_138); fVar23 = in_ECX->_luck; } local_138 = (uint)(6.0 - fVar23 * 0.5); if (local_138 == 0) { uVar15 = 0; } else { uVar15 = Random(); uVar15 = uVar15 % local_138; } if (((param_2 == 3) || (param_2 == 2)) || (param_2 == 9)) { bVar21 = true; } else { bVar21 = false; } local_134 = (ColorMod *)0; if (!bVar21) { local_134 = (ColorMod *)uVar15; } switch(local_148) { case (uint *)0x0: uVar15 = Random(); addedFlags = &g_tearFlagHoming; if ((uVar15 & 1) == 0) { addedFlags = (BitSet128 *)&DAT_00c34950; } *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)addedFlags->_l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | *(uint *)((int)&addedFlags->_l + 4); *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)addedFlags->_h; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | *(uint *)((int)&addedFlags->_h + 4); (param_1->_tearColor)._colorize[0] = 1.0; (param_1->_tearColor)._colorize[1] = 0.4; (param_1->_tearColor)._colorize[2] = 1.2; break; case (uint *)0x1: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagPoison._l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | g_tearFlagPoison._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)g_tearFlagPoison._h; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | g_tearFlagPoison._h._4_4_; (param_1->_tearColor)._colorize[0] = 0.4; (param_1->_tearColor)._colorize[1] = 0.8; (param_1->_tearColor)._colorize[2] = 0.5; break; case (uint *)0x2: uVar15 = Random(); if ((uVar15 & 1) == 0) { if ((int)local_134 < 2) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34be0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34be4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34be8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34bec; } } else { param_1->_tearDamage = param_1->_tearDamage + param_1->_tearDamage; } (param_1->_tearColor)._colorize[0] = 0.9; (param_1->_tearColor)._colorize[1] = 0.2; (param_1->_tearColor)._colorize[2] = 0.2; break; case (uint *)0x3: if ((int)local_134 < 3) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c20; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c24; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c28; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34c2c; } (param_1->_tearColor)._colorize[0] = 0.8; (param_1->_tearColor)._colorize[1] = 0.9; (param_1->_tearColor)._colorize[2] = 0.1; break; case (uint *)0x4: if ((int)local_134 < 3) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c10; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c14; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c18; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34c1c; } (param_1->_tearColor)._colorize[0] = 1.0; (param_1->_tearColor)._colorize[1] = 0.4; (param_1->_tearColor)._colorize[2] = 0.7; break; case (uint *)0x5: uVar15 = Random(); if (((uVar15 & 1) == 0) || (2 < (int)local_134)) { if ((int)local_134 < 4) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c00; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c04; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c08; uVar15 = DAT_00c34c0c; goto LAB_007c243b; } } else { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c349c0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c349c4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c349c8; uVar15 = DAT_00c349cc; LAB_007c243b: puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | uVar15; } (param_1->_tearColor)._colorize[0] = 1.0; (param_1->_tearColor)._colorize[1] = 0.4; (param_1->_tearColor)._colorize[2] = 0.2; break; case (uint *)0x6: uVar15 = Random(); if (((uVar15 & 1) == 0) || (2 < (int)local_134)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c349e0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c349e4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c349e8; uVar15 = DAT_00c349ec; } else { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c30; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c34; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c38; uVar15 = DAT_00c34c3c; } puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | uVar15; (param_1->_tearColor)._colorize[0] = 0.4; (param_1->_tearColor)._colorize[1] = 0.7; (param_1->_tearColor)._colorize[2] = 1.0; break; case (uint *)0x7: if ((int)local_134 < 2) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c40; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c44; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c48; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34c4c; } (param_1->_tearColor)._colorize[0] = 0.3; (param_1->_tearColor)._colorize[1] = 0.4; (param_1->_tearColor)._colorize[2] = 1.0; break; default: (param_1->_tearColor)._colorize[0] = 0.7; (param_1->_tearColor)._colorize[1] = 0.6; (param_1->_tearColor)._colorize[2] = 0.4; } (param_1->_tearColor)._colorize[3] = 1.5; } if ((param_2 == 10) && (bVar11 = TemporaryEffects::HasCollectibleEffect(local_140,0x2c0), bVar11 != 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c347e0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c347e4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c347e8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c347ec; } if ((familiar == (Entity_Familiar *)0x0) || (familiar->_variant != 0xee)) goto LAB_007c2763; switch(familiar->_subtype) { case 2: param_1->_tearVariant = 6; param_1->_tearDamage = param_1->_tearDamage * 1.25; param_1->_tearScale = param_1->_tearScale * 1.1; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34820; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34824; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34828; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c3482c; local_138 = 5 - (int)(in_ECX->_luck * 0.1); if ((int)local_138 < 1) { local_138 = 1; } if ((local_138 == 0) || (uVar15 = Random(), uVar15 % local_138 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34c20; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34c24; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34c28; uVar15 = DAT_00c34c2c; goto LAB_007c2760; } break; case 3: param_1->_tearDamage = param_1->_tearDamage * 1.5; param_1->_tearScale = param_1->_tearScale * 1.3; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | (uint)g_tearFlagHoming._l; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | g_tearFlagHoming._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | (uint)g_tearFlagHoming._h; uVar15 = g_tearFlagHoming._h._4_4_; goto LAB_007c2760; case 4: local_138 = 9 - (int)(in_ECX->_luck * 0.25); if ((int)local_138 < 3) { local_138 = 3; } if ((local_138 == 0) || (uVar15 = Random(), uVar15 % local_138 == 0)) { *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34a20; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34a24; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34a28; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34a2c; } familiarTintColor._tint[0] = 1.0; familiarTintColor._tint[1] = 1.0; familiarTintColor._tint[2] = 1.0; familiarTintColor._tint[3] = 1.0; familiarTintColor._offset[0] = 0.0; familiarTintColor._colorize[0] = 2.0; familiarTintColor._colorize[1] = 1.0; familiarTintColor._colorize[2] = 0.0; familiarTintColor._colorize[3] = 1.0; familiarTintColor._offset[1] = 0.0; familiarTintColor._offset[2] = 0.0; Color::__mul((Color *)¶m_1->_tearColor,&familiarTintColor); break; case 5: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c348f0; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c348f4; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c348f8; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c348fc; param_1->_tearVariant = 0x1d; break; case 6: *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34b00; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34b04; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34b08; uVar15 = DAT_00c34b0c; LAB_007c2760: puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | uVar15; } LAB_007c2763: bVar11 = HasCollectible(in_ECX,0x231,0); if (bVar11 == 0) { bVar11 = HasCollectible(in_ECX,0x14a,0); if (bVar11 != 0) { fVar23 = (float)param_1[1]._tearVariant * 0.2; goto LAB_007c27a7; } } else { fVar23 = (float)param_1[1]._tearVariant * 0.3; LAB_007c27a7: param_1[1]._tearVariant = (int)fVar23; } bVar11 = HasCollectible(in_ECX,0x135,0); if ((((bVar11 != 0) || (iVar13 = GetZodiacEffect(in_ECX), iVar13 == 0x135)) || (bVar11 = HasCollectible(in_ECX,0x167,0), bVar11 != 0)) || ((bVar11 = HasTrinket(in_ECX,0x4d,0), bVar11 != 0 || (bVar11 = HasCollectible(in_ECX,0x250,0), bVar11 != 0)))) { param_1[1]._tearVariant = (int)((float)param_1[1]._tearVariant * 3.0); } fVar23 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar23 == 0.0) || (fVar23 != 1.079e-43)) { iVar13 = GetTrinketMultiplier(in_ECX,0x4d); bVar22 = false; bVar21 = iVar13 == 0; LAB_007c284f: if (!bVar21 && bVar22 == iVar13 < 0) goto LAB_007c285a; bVar11 = HasCollectible(in_ECX,0x167,0); if ((bVar11 != 0) || (bVar11 = HasCollectible(in_ECX,0x250,0), bVar11 != 0)) { param_1[1]._bombVariant = 0x40000000; } } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar12 = GetTrinketMultiplier(in_ECX,0x4d); bVar22 = SBORROW4(iVar12,1); iVar13 = iVar12 + -1; bVar21 = iVar12 == 1; goto LAB_007c284f; } LAB_007c285a: iVar13 = GetTrinketMultiplier(in_ECX,0x4d); param_1[1]._bombVariant = (int)((float)iVar13 * 3.0); } iVar13 = GetTrinketMultiplier(in_ECX,0x90); if (iVar13 == 2) { pvVar16 = (in_ECX->_trinketRNGs)._begin; puVar18 = (uint *)((int)pvVar16 + 0x900); uVar15 = *puVar18; if (uVar15 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar15 = *puVar18; if (uVar15 == 0) { pcVar7 = (code *)swi(3); pTVar14 = (TearParams *)(*pcVar7)(); return pTVar14; } } uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar16 + 0x904) & 0x1f) ^ uVar15; uVar15 = uVar15 << ((byte)*(undefined4 *)((int)pvVar16 + 0x908) & 0x1f) ^ uVar15; uVar15 = uVar15 >> ((byte)*(undefined4 *)((int)pvVar16 + 0x90c) & 0x1f) ^ uVar15; *puVar18 = uVar15; if ((uVar15 & 3) != 0) goto LAB_007c2911; } else if ((iVar13 < 3) || (pvVar16 = (in_ECX->_trinketRNGs)._begin, RNG::Next((RNG *)((int)pvVar16 + 0x900)), (*(byte *)((int)pvVar16 + 0x900) & 1) != 0)) goto LAB_007c2911; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | DAT_00c34b50; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | DAT_00c34b54; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34b58; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | DAT_00c34b5c; param_1->_tearVariant = 0xb; LAB_007c2911: local_148 = (uint *)param_1->_tearScale; if (1.0 < (float)local_148) { fVar23 = log_precise((float)local_148); local_148 = (uint *)(fVar23 + 1.0); } fVar23 = sqrtf(baseDamage); param_1->_tearScale = (fVar23 * 0.23 + (float)local_148 * 0.55 + baseDamage * 0.01) * local_124; if ((char)local_130 != '\0') { iVar13 = param_1->_tearVariant; switch(iVar13) { case 0: iVar13 = 1; break; case 0xb: iVar13 = 0xc; break; case 0xd: iVar13 = 0x17; break; case 0xe: iVar13 = 0xf; break; case 0x10: iVar13 = 0x11; break; case 0x18: iVar13 = 0x19; break; case 0x21: iVar13 = 0x22; } param_1->_tearVariant = iVar13; } bVar11 = IsHologram(in_ECX); if (bVar11 != 0) { (param_1->_tearColor)._tint[3] = 0.2; } iVar13 = get_seeded_variant(this); if (iVar13 != -1) { param_1->_tearVariant = 0xd; fVar23 = (float)param_1[1]._bombVariant; if (fVar23 < 3.0) { fVar23 = 3.0; } laserColorMultiplier._unk = 0; param_1[1]._bombVariant = (int)fVar23; laserColorMultiplier._red = 1.0; laserColorMultiplier._green = 1.0; laserColorMultiplier._blue = 1.0; laserColorMultiplier._alpha = 1.0; Color::apply_to_kcolor(&local_120,&in_ECX->_laserColor,&laserColorMultiplier); Color::Reset(&laserTearColor); laserTearColor._tint[0] = local_120._red; laserTearColor._tint[1] = local_120._green; laserTearColor._tint[2] = local_120._blue; laserTearColor._tint[3] = (param_1->_tearColor)._tint[3]; if (¶m_1->_tearColor != (ColorMod *)&laserTearColor) { (param_1->_tearColor)._tint[0] = local_120._red; (param_1->_tearColor)._tint[1] = local_120._green; (param_1->_tearColor)._tint[2] = local_120._blue; (param_1->_tearColor)._tint[3] = laserTearColor._tint[3]; (param_1->_tearColor)._colorize[0] = laserTearColor._colorize[0]; (param_1->_tearColor)._colorize[1] = laserTearColor._colorize[1]; (param_1->_tearColor)._colorize[2] = laserTearColor._colorize[2]; (param_1->_tearColor)._colorize[3] = laserTearColor._colorize[3]; *(undefined8 *)(param_1->_tearColor)._offset = laserTearColor._offset._0_8_; (param_1->_tearColor)._offset[2] = laserTearColor._offset[2]; } } iVar13 = get_seeded_variant(in_ECX); switch(iVar13) { case 3: param_1->_tearScale = param_1->_tearScale + param_1->_tearScale; param_1->_tearDamage = param_1->_tearDamage * 4.0; case 2: uVar17 = DAT_00c346e0 | _DAT_00c34680; uVar15 = DAT_00c346e4 | _DAT_00c34684; uVar19 = DAT_00c346ec | _DAT_00c3468c; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c346e8 | _DAT_00c34688; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | uVar17; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | uVar15; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | uVar19; break; case 4: param_1->_tearDamage = param_1->_tearDamage * 0.6; break; case 5: param_1->_tearDamage = param_1->_tearDamage * 4.0; uVar19 = DAT_00c3469c | g_tearFlagExplosive._h._4_4_; uVar17 = DAT_00c34690 | (uint)g_tearFlagExplosive._l; uVar15 = DAT_00c34694 | g_tearFlagExplosive._l._4_4_; *(uint *)&tearFlags->_h = (uint)tearFlags->_h | DAT_00c34698 | (uint)g_tearFlagExplosive._h; *(uint *)&tearFlags->_l = (uint)tearFlags->_l | uVar17; puVar18 = (uint *)((int)&tearFlags->_l + 4); *puVar18 = *puVar18 | uVar15; puVar18 = (uint *)((int)&tearFlags->_h + 4); *puVar18 = *puVar18 | uVar19; param_1->_tearVariant = 0x17; } if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar11 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,in_ECX->_controllerIndex), bVar11 == 0)) { if ((g_game != (Game *)0x0) && (1 < *(int *)&g_game->_deathmatchManager)) { (param_1->_tearColor)._tint[3] = (param_1->_tearColor)._tint[3] * 1.0; return param_1; } (param_1->_tearColor)._tint[3] = ((float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1) * (param_1->_tearColor)._tint[3]; } return param_1; } //@@ 007c2d50 get_tear_trinket_multiplier /* DB: ? tear variant -> trinket multiplier prototype: db/protos.zhl, confirmed by RET 4 */ float get_tear_trinket_multiplier(Entity_Player *player,int tearVariant) { int iVar1; int iVar2; switch(tearVariant) { case 10: iVar1 = Entity_Player::GetTrinketMultiplier(player,10); iVar2 = 1; if (1 < iVar1) { iVar2 = iVar1; } return (float)iVar2; default: return 1.0; case 0x19: iVar1 = Entity_Player::GetTrinketMultiplier(player,9); iVar2 = 1; if (1 < iVar1) { iVar2 = iVar1; } break; case 0x1a: iVar1 = Entity_Player::GetTrinketMultiplier(player,0xb); iVar2 = 1; if (1 < iVar1) { iVar2 = iVar1; } return (float)iVar2; case 0x1b: iVar1 = Entity_Player::GetTrinketMultiplier(player,0xc); iVar2 = 1; if (1 < iVar1) { iVar2 = iVar1; } return (float)iVar2; case 0x1e: iVar1 = Entity_Player::GetTrinketMultiplier(player,0x1a); iVar2 = 1; if (1 < iVar1) { iVar2 = iVar1; } return (float)iVar2; case 0x2e: iVar1 = Entity_Player::GetTrinketMultiplier(player,0x60); iVar2 = 1; if (1 < iVar1) { iVar2 = iVar1; } return (float)iVar2; } return (float)iVar2; } //@@ 007c2e80 FUN_007c2e80 void FUN_007c2e80(void) { int in_ECX; *(uint *)(in_ECX + 0x1574) = *(uint *)(in_ECX + 0x1574) | 0x400; Entity_Player::EvaluateItems(); return; } //@@ 007c2e90 Entity_Player::GetGlitchBabySubType /* WARNING: Removing unreachable block (ram,0x007c30b1) */ /* WARNING: Removing unreachable block (ram,0x007c3061) */ /* WARNING: Removing unreachable block (ram,0x007c3070) */ /* WARNING: Removing unreachable block (ram,0x007c3080) */ /* WARNING: Removing unreachable block (ram,0x007c30c0) */ /* WARNING: Removing unreachable block (ram,0x007c30d0) */ /* WARNING: Removing unreachable block (ram,0x007c30d6) */ /* ZHL [exact] __thiscall unsigned int Entity_Player::GetGlitchBabySubType(); prototype: REPENTOGON, confirmed by RET 0 */ uint __thiscall Entity_Player::GetGlitchBabySubType(Entity_Player *this) { code *pcVar1; uint uVar2; Manager *pMVar3; byte bVar4; uint uVar5; void *pvVar6; void *extraout_EDX; void *pvVar7; int iVar8; int *piVar9; int *local_30; void *local_1c; uint local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar3 = g_manager; puStack_c = &LAB_00afff3d; local_10 = ExceptionList; ExceptionList = &local_10; uVar5 = *(uint *)&(g_game->_playerManager).field_0xa8; local_30 = (int *)0x0; local_8 = 0; local_14 = (g_manager->_entityConfig)._babies._end; pvVar6 = (g_manager->_entityConfig)._babies._begin; uVar2 = ((int)local_14 - (int)pvVar6) / 0x38; local_1c = pvVar6; if (uVar2 != 0) { if (0x3fffffff < uVar2) { /* WARNING: Subroutine does not return */ std::_Xlen(__security_cookie ^ (int)register0x00000010 - 4U); } std::vector::_Reallocate(uVar2); local_14 = (pMVar3->_entityConfig)._babies._end; pvVar6 = (pMVar3->_entityConfig)._babies._begin; } piVar9 = (int *)0x0; local_14 = (void *)((int)local_14 - (int)pvVar6); local_18 = 0; if ((int)local_14 / 0x38 + ((int)local_14 >> 0x1f) != (int)local_14 >> 0x1f) { iVar8 = 0; do { pvVar7 = (void *)(iVar8 + (int)pvVar6); if ((*(int *)(iVar8 + (int)pvVar6) != 0x19) && (*(int *)(iVar8 + (int)pvVar6) != 0x18)) { if (-1 < *(int *)((int)pvVar7 + 0x34)) { bVar4 = PersistentGameData::Unlocked (&g_manager->_persistentGameData,*(int *)((int)pvVar7 + 0x34)); pvVar7 = extraout_EDX; if (bVar4 == 0) goto LAB_007c2fce; } if (piVar9 == (int *)0x0) { local_1c = pvVar7; std::vector::_Emplace_reallocate(0,&local_1c); piVar9 = local_30; } else { *piVar9 = (int)pvVar7; local_30 = piVar9 + 1; piVar9 = local_30; } } LAB_007c2fce: iVar8 = iVar8 + 0x38; local_18 = local_18 + 1; pvVar6 = (pMVar3->_entityConfig)._babies._begin; local_1c = pvVar6; } while (local_18 < (uint)(((int)(pMVar3->_entityConfig)._babies._end - (int)pvVar6) / 0x38)); } if (piVar9 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[err] Couldn\'t select a baby subtype!\n"); ExceptionList = local_10; return 0x47; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar5 = (*pcVar1)(); return uVar5; } uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 9 ^ uVar5; if ((int)piVar9 >> 2 == 0) { uVar5 = 0; } else { uVar5 = (uVar5 >> 7 ^ uVar5) % (uint)((int)piVar9 >> 2); } ExceptionList = local_10; return **(uint **)(uVar5 * 4); } //@@ 007c3100 Entity_Player::HasInvincibility /* ZHL [lua] Lua binding EntityPlayer:HasInvincibility prototype: REPENTOGON, confirmed by RET 12 */ byte __thiscall Entity_Player::HasInvincibility(Entity_Player *this,ulonglong damageFlags,EntityRef *source) { TemporaryEffects *this_00; bool bVar1; byte bVar2; byte bVar3; void *pvVar4; bool bVar5; if ((damageFlags & 0x2000) != 0) { return 0; } bVar5 = (damageFlags & 0x20) != 0; this_00 = &this->_temporaryeffects; bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x3a); if (bVar2 == 0) { LAB_007c3182: bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x5d); if (((((((bVar2 == 0) && (bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x4d), bVar2 == 0)) && (bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x12a), bVar2 == 0)) && (bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x2c), bVar2 == 0)) && (((bVar2 = HasCollectible(this,0xd2,0), bVar2 == 0 || (this->_mass != 1000.0)) || (bVar5))) ) && (((bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x146), bVar2 == 0 && ((bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,299), bVar2 == 0 || (pvVar4 = TemporaryEffects::GetCollectibleEffect(this_00,299), *(int *)((int)pvVar4 + 8) == 0)))) && ((bVar2 = TemporaryEffects::HasNullEffect(this_00,0x3b), bVar2 == 0 || (bVar5)))))) && ((((bVar2 = TemporaryEffects::HasNullEffect(this_00,0x3f), bVar2 == 0 || (bVar5)) && (((bVar2 = TemporaryEffects::HasCollectibleEffect(this_00,0x2c1), bVar2 == 0 && (this->_darkArtsBlastPending == 0)) || (bVar5)))) && ((this->_suplexState == 0 || (bVar5)))))) { bVar3 = TemporaryEffects::HasCollectibleEffect(this_00,0x271); bVar2 = 0; if (bVar3 == 0) goto LAB_007c3287; } } else if (source != (EntityRef *)0x0) { if (source->_type == 6) { if (source->_variant == 2) { bVar1 = true; goto LAB_007c3167; } bVar1 = false; if (source->_variant != 5) goto LAB_007c3167; } else { bVar1 = false; LAB_007c3167: if (!bVar1) goto LAB_007c3285; } pvVar4 = TemporaryEffects::GetCollectibleEffect(this_00,0x3a); if (*(int *)((int)pvVar4 + 0xc) != 0) goto LAB_007c3182; } LAB_007c3285: bVar2 = 1; LAB_007c3287: if ((this->_variant == 1) && (this->_babySkin == 0x18)) { bVar2 = 1; } if (this->_isCoopGhost != 0) { bVar2 = 1; } return bVar2; } //@@ 007c32c0 Entity_Player::IsInvisible /* ZHL [exact] __thiscall bool Entity_Player::IsInvisible(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::IsInvisible(Entity_Player *this) { byte bVar1; int *piVar2; if ((this->_temporaryeffects)._disabled == 0) { for (piVar2 = (this->_temporaryeffects)._effects._begin; piVar2 != (this->_temporaryeffects)._effects._end; piVar2 = piVar2 + 4) { if ((*(int *)*piVar2 == 2) && (((int *)*piVar2)[1] == 0x45)) { return 1; } } } bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1f1); if ((bVar1 == 0) && (this->_playerType != 0x23)) { return 0; } return 1; } //@@ 007c3320 Entity_Player::HasPoisonImmunity /* ZHL [exact] __thiscall bool Entity_Player::HasPoisonImmunity(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::HasPoisonImmunity(Entity_Player *this) { byte bVar1; bVar1 = HasCollectible(this,0x252,0); if (bVar1 == 0) { bVar1 = HasCollectible(this,0x8c,0); if ((bVar1 == 0) && (((this->_hasCurseMistEffect != 0 || (this->_isCoopGhost != 0)) || (this->_playerForms[4] < 3)))) { return 0; } } return 1; } //@@ 007c3380 Entity_Player::CanCrushRocks /* ZHL [exact] __thiscall bool Entity_Player::CanCrushRocks(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::CanCrushRocks(Entity_Player *this) { byte bVar1; int iVar2; bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x53); if (bVar1 == 0) { bVar1 = HasCollectible(this,0x12e,0); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x12e); if (bVar1 == 0) { iVar2 = GetZodiacEffect(this); if (iVar2 != 0x12e) { bVar1 = HasCollectible(this,0x13a,0); if (bVar1 == 0) { bVar1 = HasPlayerForm(this,0xd); if (bVar1 == 0) { bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x271); if (bVar1 == 0) { return 0; } } } } } } } return 1; } //@@ 007c3410 Entity_Player::CanPickRedHearts /* ZHL [lua] Lua binding EntityPlayer:CanPickRedHearts */ uint __thiscall Entity_Player::CanPickRedHearts(Entity_Player *this) { byte bVar1; undefined3 extraout_var; int iVar2; Entity_Player *this_00; Entity_Player *extraout_ECX; do { iVar2 = *(int *)((int)this + 0x13c0); if (iVar2 == 0x24) { if (*(int *)((int)this + 0x1dac) < 99) { return 1; } LAB_007c3453: iVar2 = GetHealthType(this); this_00 = extraout_ECX; if (iVar2 == 3) { return 0; } LAB_007c343f: bVar1 = HasFullHearts(this_00); return CONCAT31(extraout_var,bVar1) ^ 1; } if (iVar2 != 0x28) { if ((iVar2 != 0x11) || (this_00 = *(Entity_Player **)((int)this + 0x1d98), this_00 == (Entity_Player *)0x0)) goto LAB_007c3453; goto LAB_007c343f; } if (*(EntityPtr *)((int)this + 0x1e68) == (EntityPtr)0x0) goto LAB_007c3453; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } while( true ); } //@@ 007c3460 Entity_Player::CanPickSoulHearts /* ZHL [lua] Lua binding EntityPlayer:CanPickSoulHearts prototype: db/protos.zhl */ byte __thiscall Entity_Player::CanPickSoulHearts(Entity_Player *this) { int iVar1; int iVar2; int *piVar3; uint local_c; if (1 < *(int *)&g_game->_deathmatchManager) { return this->_maxHearts < 0xa0; } while( true ) { while (*(int *)((int)this + 0x13c0) != 0x28) { if ((*(int *)((int)this + 0x13c0) != 0x10) || (*(EntityPtr *)((int)this + 0x1d98) == (EntityPtr)0x0)) goto LAB_007c34ac; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1d98); } if (*(EntityPtr *)((int)this + 0x1e68) == (EntityPtr)0x0) break; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } LAB_007c34ac: piVar3 = (int *)((int)this + 0x1588); local_c = 0; do { if ((piVar3[-2] == 0x249) && (iVar2 = *piVar3, iVar1 = GetActiveMaxCharge(this,local_c), iVar2 < iVar1)) { return 1; } local_c = local_c + 1; piVar3 = piVar3 + 8; } while (local_c < 4); if (*(int *)((int)this + 0x13c0) == 0x12) { if (*(int *)((int)this + 0x1da8) < 99) { return 1; } } else if (*(int *)((int)this + 0x13c0) == 0x10) { return 0; } iVar2 = GetHeartLimit(this,0); if (*(int *)((int)this + 0x134c) + *(int *)((int)this + 0x1d88) * 2 + *(int *)((int)this + 0x1340) < iVar2) { return 1; } return 0; } //@@ 007c3550 Entity_Player::CanPickBlackHearts /* ZHL [lua] Lua binding EntityPlayer:CanPickBlackHearts */ uint __thiscall Entity_Player::CanPickBlackHearts(Entity_Player *this) { int iVar1; byte bVar2; undefined3 extraout_var; uint uVar3; uint uVar4; if (1 < *(int *)&g_game->_deathmatchManager) { return CONCAT31((int3)((uint)g_game >> 8),this->_maxHearts < 0xa0); } while( true ) { while (*(int *)((int)this + 0x13c0) != 0x28) { if ((*(int *)((int)this + 0x13c0) != 0x10) || (*(EntityPtr *)((int)this + 0x1d98) == (EntityPtr)0x0)) goto LAB_007c359c; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1d98); } if (*(EntityPtr *)((int)this + 0x1e68) == (EntityPtr)0x0) break; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } LAB_007c359c: bVar2 = CanPickSoulHearts(this); uVar3 = CONCAT31(extraout_var,bVar2); if (bVar2 != 0) { LAB_007c35fb: return CONCAT31((int3)(uVar3 >> 8),1); } iVar1 = *(int *)((int)this + 0x134c); uVar4 = 1; if (1 < iVar1) { if (iVar1 < 1) goto LAB_007c35fb; do { if ((int)uVar4 < 1) goto LAB_007c35fb; uVar3 = uVar4 & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } if ((uVar3 != 1) || (uVar3 = (int)(uVar4 - 1) / 2, (*(uint *)((int)this + 0x1350) & 1 << ((byte)uVar3 & 0x1f)) == 0)) goto LAB_007c35fb; uVar4 = uVar4 + 2; } while ((int)uVar4 < iVar1); } return uVar3 & 0xffffff00; } //@@ 007c3620 Entity_Player::RemoveSkinCostume /* ZHL [lua] Lua binding EntityPlayer:RemoveSkinCostume prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity_Player::RemoveSkinCostume(Entity_Player *this) { int iVar1; void *pvVar2; iVar1 = this->_playerType; if (-1 < iVar1) { if (((iVar1 < ((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148) && (pvVar2 = (void *)(iVar1 * 0x148 + (int)(g_manager->_entityConfig)._players._begin), pvVar2 != (void *)0x0)) && (iVar1 = *(int *)((int)pvVar2 + 0xac), iVar1 != -1)) { if ((-1 < iVar1) && (pvVar2 = (g_manager->_itemConfig)._nullItems._begin, iVar1 < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar2 >> 2)) { RemoveCostume(this,*(ItemConfig_Item **)((int)pvVar2 + iVar1 * 4)); return; } RemoveCostume(this,(ItemConfig_Item *)0x0); } } return; } //@@ 007c36b0 Entity_Player::ResetItemState /* ZHL [lua] Lua binding EntityPlayer:ResetItemState prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Entity_Player::ResetItemState(Entity_Player *this) { byte bVar1; ItemConfig_Item *Item; int *piVar2; void *pvVar3; byte *pbVar4; uint uVar5; char *pcVar6; bool bVar7; undefined1 local_8 [4]; if (this->_itemState == 0x31) { TryRemoveCollectibleCostume(this,0x31,0); } else if (this->_itemState == 0x152) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar3 & 0xfffffffcU) < 0x79) { Item = (ItemConfig_Item *)0x0; } else { Item = *(ItemConfig_Item **)((int)pvVar3 + 0x78); } RemoveCostume(this,Item); } if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { pvVar3 = (this->_costumeSpriteDescs)._begin; if (pvVar3 != (this->_costumeSpriteDescs)._end) { do { if (*(char *)((int)pvVar3 + 0x129) == '\0') { pvVar3 = (void *)((int)pvVar3 + 0x130); } else { piVar2 = (int *)std::vector::erase(local_8,pvVar3); pvVar3 = (void *)*piVar2; } } while (pvVar3 != (this->_costumeSpriteDescs)._end); } UpdateCostumes(this); } if ((this->_isPlayingExtraAnimation != 0) || (this->_isPlayingItemAnimation != 0)) { if (((this->_bodySprite)._animState._animData != (void *)0x0) && ((this->_bodySprite)._animState._isPlaying != 0)) { pbVar4 = (this->_bodySprite)._animState._animData; if (pbVar4 == (byte *)0x0) { pbVar4 = &s_empty; } else if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar6 = "HideItem"; do { bVar1 = *pbVar4; bVar7 = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_007c37b3: uVar5 = -(uint)bVar7 | 1; goto LAB_007c37b8; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar7 = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_007c37b3; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_007c37b8: if (uVar5 == 0) goto LAB_007c37d4; } if (this->_itemState == 0x25c) { PlayExtraAnimation(this,(byte *)"HideItem"); } } LAB_007c37d4: this->_itemState = 0; return; } //@@ 007c37f0 Entity_Player::SetShootingCooldown /* ZHL [lua] Lua binding EntityPlayer:SetShootingCooldown */ void __thiscall Entity_Player::SetShootingCooldown(Entity_Player *this,int param_2) { int *piVar1; int *piVar2; piVar1 = &this->_fireBlockCooldown; piVar2 = ¶m_2; if (param_2 < *piVar1) { piVar2 = piVar1; } *piVar1 = *piVar2; return; } //@@ 007c3810 Entity_Player::NeedsCharge /* ZHL [exact] __thiscall bool Entity_Player::NeedsCharge(int slot); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::NeedsCharge(Entity_Player *this,int slot) { byte bVar1; ItemConfig_Item *pIVar2; int iVar3; uint slot_00; if (slot < 0) { slot_00 = 0; do { bVar1 = NeedsCharge(this,slot_00); if (bVar1 != 0) { return 1; } slot_00 = slot_00 + 1; } while (slot_00 < 4); return 0; } if ((slot < 4) && (iVar3 = this->_activeDesc[slot]._item, iVar3 != 0)) { pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar3); iVar3 = GetActiveMaxCharge(this,slot); if ((pIVar2 != (ItemConfig_Item *)0x0) && (((pIVar2->type == 3 && (iVar3 != 2)) && (iVar3 = GetActiveMaxCharge(this,slot), iVar3 != 0)) )) { if (iVar3 <= this->_activeDesc[slot]._charge) { bVar1 = HasCollectible(this,0x3f,0); if (bVar1 == 0) { return 0; } if (iVar3 <= this->_activeDesc[slot]._batteryCharge) { return 0; } } return 1; } } return 0; } //@@ 007c38c0 Entity_Player::FullCharge /* ZHL [exact] __thiscall bool Entity_Player::FullCharge(int slot, bool force); prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Entity_Player::FullCharge(Entity_Player *this,int slot,byte isForce,byte isOvercharge) { byte bVar1; ItemConfig_Item *pIVar2; int iVar3; int iVar4; uint slot_00; byte bVar5; if (slot < 0) { bVar5 = 0; slot_00 = 0; do { bVar1 = FullCharge(this,slot_00,isForce,0); slot_00 = slot_00 + 1; bVar5 = bVar5 + bVar1; } while (slot_00 < 4); return bVar5; } if (3 < slot) { return 0; } bVar5 = 0; pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,this->_activeDesc[slot]._item); if (pIVar2 != (ItemConfig_Item *)0x0) { iVar3 = GetActiveMaxCharge(this,slot); iVar4 = iVar3 * 2; if ((this->_activeDesc[slot]._item == 0x1b9) && (isForce == 0)) { iVar4 = iVar3 / 2; } iVar4 = AddActiveCharge(this,iVar4,slot,1,isOvercharge,isForce); bVar5 = (byte)iVar4; } return bVar5; } //@@ 007c3980 Entity_Player::add_random_stat_up /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX player; arg RNG*: Next() % 6 picks one of six ints at +0x1520..+0x1534 and increments it, _cacheFlags |= 0x41f, EvaluateItems, AnimateHappy unless busy; Room::SpawnClearAward calls it once/twice per Temporary Tattoo (177) multiplier and Room::update_deaths_list on a 1/4 roll */ void __thiscall Entity_Player::add_random_stat_up(Entity_Player *this,uint *param_2) { code *pcVar1; uint uVar2; int *local_20 [4]; int *local_10; int *local_c; int *local_8; local_8 = (int *)(__security_cookie ^ (uint)(local_20 + 7)); local_20[0] = &this->_speedModifier; uVar2 = *param_2; local_20[1] = &this->_fireDelayModifier; local_20[2] = &this->_damageModifier; local_20[3] = &this->_tearRangeModifier; local_10 = &this->_shotSpeedModifier; local_c = &this->_luckModifier; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = *param_2; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)param_2[1] & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)param_2[2] & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)param_2[3] & 0x1f) ^ uVar2; *param_2 = uVar2; *local_20[uVar2 % 6] = *local_20[uVar2 % 6] + 1; this->_cacheFlags = this->_cacheFlags | 0x41f; EvaluateItems(); if ((this->_pitfallState == 0) && (this->_dead == 0)) { AnimateHappy(this); } return; } //@@ 007c3a60 Entity_Player::preload_item_sounds /* DB: once from Entity_Player::room_enter: HasCollectible/HasTrinket chains then "Preload sound %d." per owned item prototype: db/protos.zhl */ void __thiscall Entity_Player::preload_item_sounds(Entity_Player *this) { byte isOwned; undefined1 *loadedCount; Manager *manager; void *sounds; manager = g_manager; if (this->field_0x13f1 != '\0') { sounds = (g_manager->_sfxManager)._sounds._begin; if (0x102 < ((int)(g_manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x1bd08) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x1bb70)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x1bd09) = 0; } sounds = (manager->_sfxManager)._sounds._begin; if (0x96 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x10368) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 66000)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x10369) = 0; } } if (this->field_0x13f3 != '\0') { sounds = (manager->_sfxManager)._sounds._begin; if (0x85 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0xe630) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0xe498)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0xe631) = 0; } } if (this->field_0x13f2 != '\0') { sounds = (manager->_sfxManager)._sounds._begin; if (7 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0xda0) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0xc08)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0xda1) = 0; } } isOwned = HasCollectible(this,0x9b,0); if (isOwned != 0) { sounds = (manager->_sfxManager)._sounds._begin; if (0xed < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x198f0) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x19758)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x198f1) = 0; } } sounds = (manager->_sfxManager)._sounds._begin; if (0x37 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x6020) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x5e88)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x6021) = 0; } isOwned = HasCollectible(this,0x31,0); if (isOwned != 0) { sounds = (manager->_sfxManager)._sounds._begin; if (5 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0xa30) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x898)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0xa31) = 0; } } if (this->_activeDesc[0]._item != 0) { sounds = (manager->_sfxManager)._sounds._begin; if (0xab < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x12780) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x125e8)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x12781) = 0; } sounds = (manager->_sfxManager)._sounds._begin; if (0xda < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x17848) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x176b0)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x17849) = 0; } isOwned = HasCollectible(this,0x3f,0); if (isOwned == 0) { isOwned = HasTrinket(this,3,0); if (isOwned == 0) goto LAB_007c3e5c; } sounds = (manager->_sfxManager)._sounds._begin; if (0xaa < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x125c8) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x12430)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x125c9) = 0; } } LAB_007c3e5c: isOwned = HasCollectible(this,0x24,0); if (isOwned != 0) { sounds = (manager->_sfxManager)._sounds._begin; if (0x25 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x4130) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x3f98)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x4131) = 0; } } isOwned = HasCollectible(this,0x2d,0); if (isOwned == 0) { isOwned = HasCollectible(this,0x3e,0); if (isOwned == 0) goto LAB_007c3f3a; } sounds = (manager->_sfxManager)._sounds._begin; if (0x9d < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x10f70) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x10dd8)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x10f71) = 0; } LAB_007c3f3a: isOwned = HasCollectible(this,0x53,0); if (isOwned != 0) { sounds = (manager->_sfxManager)._sounds._begin; if (0x77 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0xce20) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0xcc88)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0xce21) = 0; } } if ((this->_pocketSlots[1] == 0) && (this->_pocketSlots[0] != 0)) { sounds = (manager->_sfxManager)._sounds._begin; if (0x84 < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0xe478) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0xe2e0)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0xe479) = 0; } sounds = (manager->_sfxManager)._sounds._begin; if (0x10c < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x1ce38) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x1cca0)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x1ce39) = 0; } sounds = (manager->_sfxManager)._sounds._begin; if (0x10b < ((int)(manager->_sfxManager)._sounds._end - (int)sounds) / 0x1b8) { if (*(char *)((int)sounds + 0x1cc80) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load((SoundEffect *)((int)sounds + 0x1cae8)); loadedCount = &(manager->_sfxManager).field_0xc; *(int *)loadedCount = *(int *)loadedCount + 1; } *(undefined1 *)((int)sounds + 0x1cc81) = 0; } } return; } //@@ 007c40e0 Entity_Player::CanUsePill /* ZHL [exact] __thiscall bool Entity_Player::CanUsePill(int pillEffect); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::CanUsePill(Entity_Player *this,int pillEffect) { byte bVar1; int iVar2; int iVar3; if (pillEffect == 1) { bVar1 = HasInstantDeathCurse(this); if (bVar1 == 0) { iVar3 = (this->_boneHearts - this->_rottenHearts) + this->_soulHearts + this->_redHearts; LAB_007c410f: iVar2 = 0x10; if (*(int *)&g_game->_deathmatchManager < 2) { iVar2 = 2; } return iVar2 < iVar3; } } else { if (pillEffect != 6) { return 1; } bVar1 = HasInstantDeathCurse(this); if (bVar1 == 0) { iVar3 = GetHealthType(this); if (iVar3 == 1) { iVar3 = this->_soulHearts; } else { if (iVar3 == 3) { return 0; } if (iVar3 == 4) { iVar3 = this->_boneHearts * 2; } else { iVar3 = this->_maxHearts; } } goto LAB_007c410f; } } return 0; } //@@ 007c4180 Entity_Player::UsePill /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [lua] Lua binding EntityPlayer:UsePill */ void Entity_Player::UsePill(uint param_1,uint param_2,uint param_3) { std_vector *onlineStats; int iVar1; undefined4 uVar2; code *pcVar3; ANM2 *pAVar4; undefined2 *puVar5; char cVar6; byte bVar7; void *pvVar8; uint uVar9; uint uVar10; std_string *pillNameResult; StringTable *this; char *text; undefined4 *puVar11; undefined4 *******pppppppuVar12; uint uVar13; ColorMod *color; int iVar14; undefined3 extraout_var; Game *game; int *piVar15; ItemConfig_Item *itemConfig; Entity_Player *pEVar16; Entity_Tear *tear; BitSet128 *tearFlags; uint uVar17; Entity *tmpEntity; Vector *pVVar18; Entity_Player *in_ECX; uint *rngState; byte *pbVar19; byte *pbVar20; undefined4 *******ptr; ColorMod *color_00; Manager *extraout_ECX; Manager *extraout_ECX_00; Manager *extraout_ECX_01; Manager *extraout_ECX_02; Manager *extraout_ECX_03; ColorMod *other; Manager *extraout_ECX_04; Manager *extraout_ECX_05; Manager *extraout_ECX_06; Manager *extraout_ECX_07; Manager *extraout_ECX_08; void *Effect; Vector *direction; Manager *extraout_ECX_09; Manager *extraout_ECX_10; Manager *extraout_ECX_11; Manager *extraout_ECX_12; ColorMod *other_00; Manager *extraout_ECX_13; Manager *extraout_ECX_14; ColorMod *other_01; Manager *extraout_ECX_15; ColorMod *other_02; Manager *extraout_ECX_16; ColorMod *other_03; Manager *extraout_ECX_17; ColorMod *other_04; undefined2 *puVar21; Manager *extraout_ECX_18; Manager *extraout_ECX_19; Manager *extraout_ECX_20; Manager *extraout_ECX_21; Manager *extraout_ECX_22; undefined4 extraout_ECX_23; undefined4 extraout_ECX_24; Vector *direction_00; ColorMod *color_01; Manager *extraout_ECX_25; Manager *extraout_ECX_26; Manager *extraout_ECX_27; Manager *pMVar22; Manager *extraout_ECX_28; Manager *extraout_ECX_29; Manager *extraout_ECX_30; Manager *extraout_ECX_31; Manager *extraout_ECX_32; Manager *extraout_ECX_33; Manager *extraout_ECX_34; Manager *extraout_ECX_35; Manager *extraout_ECX_36; void *Effect_00; Manager *extraout_ECX_37; Manager *extraout_ECX_38; Manager *extraout_ECX_39; Manager *extraout_ECX_40; Manager *extraout_ECX_41; Manager *extraout_ECX_42; Manager *extraout_ECX_43; Manager *extraout_ECX_44; Manager *extraout_ECX_45; Manager *extraout_ECX_46; Manager *extraout_ECX_47; Manager *extraout_ECX_48; Manager *extraout_ECX_49; Manager *extraout_ECX_50; float **ppfVar23; char extraout_DL; undefined4 ******ppppppuVar24; ItemPool **textCapacity; RNG *pillRng; int extraout_EDX; ItemPool *pIVar25; byte *pbVar26; float *pfVar27; byte *pbVar28; bool bVar29; float rngFloat; float fVar30; char acStackY_308 [128]; void *in_stack_fffffd8c; int in_stack_fffffd90; char *in_stack_fffffd94; byte flashHUD; int iVar31; byte force; uint useFlags; Manager *pillConfig; Vector local_230; undefined1 tempEffect [4]; float *local_224; Vector local_220; byte local_216; char isSkipStatDown; undefined4 local_214; float *local_210; Manager *local_20c; ItemPool *local_208; uint isHorsePill; Color effectColor; int statPillEffects [11]; undefined4 *******local_13c; undefined4 ******ppppppuStack_138; undefined4 ******ppppppuStack_134; undefined4 ******ppppppuStack_130; undefined4 ******local_12c; undefined4 ******ppppppuStack_128; undefined4 *******local_11c; undefined4 ******ppppppuStack_118; undefined4 ******ppppppuStack_114; undefined4 ******ppppppuStack_110; undefined4 ******local_10c; undefined4 ******ppppppuStack_108; std_string pillName; undefined1 local_ec [8]; float fStack_e4; float fStack_e0; float fStack_dc; float **local_d8; float fStack_d4; float fStack_d0; float fStack_cc; float local_c8; undefined1 *local_c4; undefined1 local_c0 [20]; undefined1 local_ac [4]; byte local_a8 [132]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; game = g_game; puStack_20 = local_a8 + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00afff9c; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_a8 + 0x98); ExceptionList = &local_1c; onlineStats = &g_game->_onlinePlayerStats; g_game->_bloomDuration = 0x1e; game->_bloomTimer = 0x1e; game->_bloomStrength = 1.0; Player_stats_add(onlineStats,6,in_ECX,1.0); if (*(int *)&g_game->_deathmatchManager < 2) { useFlags = param_3; } else { pvVar8 = InputManager::GetDeviceByPlayerEntity(&g_manager->_netplayManager,in_ECX); if ((pvVar8 == (void *)0x0) || (cVar6 = (**(code **)(*(int *)((int)pvVar8 + 0x370) + 0x14))(), cVar6 != '\0')) { useFlags = param_3; } else { useFlags = param_3 | 0x900; } } isHorsePill = param_2 >> 0xb & 0xffffff01; uVar9 = param_2 & 0x7ff; if (uVar9 == 0xe) { pvVar8 = (in_ECX->_collectibleRNGs)._begin; rngState = (uint *)((int)pvVar8 + 0x4b0); local_208 = &g_game->_itemPool; uVar10 = *rngState; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = *rngState; if (uVar10 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar10 = uVar10 >> ((byte)*(undefined4 *)((int)pvVar8 + 0x4b4) & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)*(undefined4 *)((int)pvVar8 + 0x4b8) & 0x1f) ^ uVar10; *rngState = uVar10 >> ((byte)*(undefined4 *)((int)pvVar8 + 0x4bc) & 0x1f) ^ uVar10; in_stack_fffffd94 = (char *)0x7c4310; ItemPool::on_pill_used(); } else { uVar13 = -(uint)(uVar9 != 0) & uVar9; uVar10 = 0xe; if (uVar13 < 0xe) { uVar10 = uVar13; } *(undefined1 *)((int)(&g_game->_itemPool + 1) + uVar10 + 0x3c) = 1; } pillName._size = 0; pillName._capacity = 0xf; pillName._buf._0_4_ = (float **)0x0; local_10c = (undefined4 ******)0x0; ppppppuStack_108 = (undefined4 ******)0xf; local_11c = (undefined4 *******)0x0; local_14 = 1; local_20c = g_manager; if (((int)param_1 < 0) || (pvVar8 = (g_manager->_itemConfig)._pillEffects._begin, (int)(g_manager->_itemConfig)._pillEffects._end - (int)pvVar8 >> 2 <= (int)param_1)) { pillConfig = (Manager *)0x0; } else { pillConfig = *(Manager **)((int)pvVar8 + param_1 * 4); } if (g_game->_challenge == 0x20) { if (-1 < (int)param_1) { if ((int)param_1 < 0x32) { rngState = (uint *)(param_1 * 0x10 + (int)(in_ECX->_pillRNGs)._begin); uVar10 = *rngState; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = *rngState; if (uVar10 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar10 = uVar10 >> ((byte)rngState[1] & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)rngState[2] & 0x1f) ^ uVar10; local_208 = (ItemPool *)(uVar10 >> ((byte)rngState[3] & 0x1f)); uVar10 = (uint)local_208 ^ uVar10; *rngState = uVar10; uVar10 = uVar10 % 0x32; pvVar8 = (local_20c->_itemConfig)._pillEffects._begin; if ((int)(local_20c->_itemConfig)._pillEffects._end - (int)pvVar8 >> 2 <= (int)uVar10) { pillConfig = (Manager *)0x0; goto LAB_007c46b3; } pillConfig = *(Manager **)((int)pvVar8 + uVar10 * 4); } LAB_007c4477: if (pillConfig != (Manager *)0x0) { pillNameResult = PocketItemConfig::GetName(pillConfig,(std_string *)local_c0,0x14); if (&pillName != pillNameResult) { if (0xf < pillName._capacity) { uVar10 = pillName._capacity + 1; ppfVar23 = (float **)pillName._buf._0_4_; if (0xfff < uVar10) { ppfVar23 = *(float ***)(pillName._buf._0_4_ + -4); uVar10 = pillName._capacity + 0x24; if ((undefined1 *)0x1f < (undefined1 *)(pillName._buf._0_4_ + (-4 - (int)ppfVar23))) goto LAB_007c453e; } operator_delete(ppfVar23,uVar10); } pillName._buf._0_4_ = *(undefined4 *)pillNameResult->_buf; pillName._buf._4_4_ = *(undefined4 *)(pillNameResult->_buf + 4); pillName._buf._8_4_ = *(undefined4 *)(pillNameResult->_buf + 8); pillName._buf._12_4_ = *(undefined4 *)(pillNameResult->_buf + 0xc); pillName._size = pillNameResult->_size; pillName._capacity = pillNameResult->_capacity; pillNameResult->_size = 0; pillNameResult->_capacity = 0xf; pillNameResult->_buf[0] = '\0'; } if (0xf < (uint)local_ac) { uVar10 = (int)local_ac + 1; pvVar8 = (void *)local_c0._0_4_; if (0xfff < uVar10) { pvVar8 = *(void **)(local_c0._0_4_ + -4); uVar10 = (int)local_ac + 0x24; if (0x1f < (uint)(local_c0._0_4_ + (-4 - (int)pvVar8))) { LAB_007c453e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar10); } local_c0._16_4_ = 0; local_ac = (undefined1 [4])0xf; local_c0._0_4_ = local_c0._0_4_ & 0xffffff00; if (*(int *)&(pillConfig->_persistentGameData).field_0x1c == 0) { local_13c = (undefined4 *******)0x0; ppppppuStack_128 = (undefined4 ******)0xf; local_12c = (undefined4 ******)0x0; } else { pbVar20 = &(pillConfig->_persistentGameData).field_0xc; if (0xf < *(uint *)&(pillConfig->_persistentGameData).field_0x20) { pbVar20 = *(byte **)pbVar20; } this = &g_manager->_stringTable; local_20c = *(Manager **)this; if (*pbVar20 == 0x23) { local_208 = (ItemPool *)(pbVar20 + 1); local_214 = (float)((uint)local_214 & 0xffffff); in_stack_fffffd94 = "PocketItems"; in_stack_fffffd90 = 0x7c45e5; StringTable::get_string (this,(byte *)"PocketItems",(int)local_20c,(byte *)local_208, (byte *)((int)&local_214 + 3)); if (local_214._3_1_ == '\0') { local_216 = 0; in_stack_fffffd94 = "PocketItems"; in_stack_fffffd90 = 0x7c461e; pbVar20 = StringTable::get_string (this,(byte *)"PocketItems",(int)local_20c,(byte *)local_208, &local_216); } } local_13c = (undefined4 *******)0x0; local_12c = (undefined4 ******)0x0; ppppppuStack_128 = (undefined4 ******)0xf; pbVar19 = pbVar20; do { bVar7 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar7 != 0); std::string::assign((char *)&local_13c,pbVar20,(int)pbVar19 - (int)(pbVar20 + 1)); } if ((undefined4 ******)0xf < ppppppuStack_108) { ppppppuVar24 = (undefined4 ******)((int)ppppppuStack_108 + 1); pppppppuVar12 = local_11c; if ((undefined4 ******)0xfff < ppppppuVar24) { pppppppuVar12 = (undefined4 *******)local_11c[-1]; ppppppuVar24 = ppppppuStack_108 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_11c + (-4 - (int)pppppppuVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar12,(uint)ppppppuVar24); } local_11c = local_13c; ppppppuStack_118 = ppppppuStack_138; ppppppuStack_114 = ppppppuStack_134; ppppppuStack_110 = ppppppuStack_130; local_10c = local_12c; ppppppuStack_108 = ppppppuStack_128; } } } else if (-1 < (int)param_1) goto LAB_007c4477; LAB_007c46b3: game = g_game; local_208 = (ItemPool *)0x1d; std::set::find_node(); pMVar22 = g_manager; if ((*(char *)((int)local_220.y + 0xd) != '\0') || (pfVar27 = (float *)local_220.y, 0x1d < (int)*(float *)((int)local_220.y + 0x10))) { pfVar27 = (game->_seedEffects)._seedEffects; } if (pfVar27 != (game->_seedEffects)._seedEffects) { local_214 = (float)((uint)local_214 & 0xffffff); in_stack_fffffd94 = "PocketItems"; in_stack_fffffd90 = 0x7c472f; StringTable::get_string (&g_manager->_stringTable,(byte *)"PocketItems",*(int *)&g_manager->_stringTable, (byte *)0xb67da9,(byte *)((int)&local_214 + 3)); if (local_214._3_1_ == '\0') { local_216 = 0; in_stack_fffffd94 = "PocketItems"; in_stack_fffffd90 = 0x7c4761; text = (char *)StringTable::get_string (&pMVar22->_stringTable,(byte *)"PocketItems", *(int *)&pMVar22->_stringTable,(byte *)0xb67da9,&local_216); } else { text = "#QUESTION_MARKS_NAME"; } pbVar20 = (byte *)text; do { bVar7 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar7 != 0); std::string::assign(pillName._buf,(byte *)text,(int)pbVar20 - (int)(text + 1)); local_10c = (undefined4 ******)0x0; pppppppuVar12 = &local_11c; if ((undefined4 ******)0xf < ppppppuStack_108) { pppppppuVar12 = local_11c; } *(undefined1 *)pppppppuVar12 = 0; } game = g_game; textCapacity = &local_208; ppfVar23 = &local_224; local_208 = (ItemPool *)0x9; iVar31 = 0x7c47d0; std::set::find_node(); if ((*(char *)((int)local_220.y + 0xd) != '\0') || (pfVar27 = (float *)local_220.y, 9 < (int)*(float *)((int)local_220.y + 0x10))) { pfVar27 = (game->_seedEffects)._seedEffects; } if (pfVar27 != (game->_seedEffects)._seedEffects) { std::string::string(acStackY_308 + 0x94,&pillName); puVar11 = string_scramble_seeded (&local_d8,in_stack_fffffd8c,in_stack_fffffd90,(int)in_stack_fffffd94,iVar31 ,(uint)ppfVar23,(uint)textCapacity); if (&pillName != (std_string *)puVar11) { if (0xf < pillName._capacity) { textCapacity = (ItemPool **)(pillName._capacity + 1); ppfVar23 = (float **)pillName._buf._0_4_; if ((ItemPool **)0xfff < textCapacity) { ppfVar23 = *(float ***)(pillName._buf._0_4_ + -4); textCapacity = (ItemPool **)(pillName._capacity + 0x24); if ((undefined1 *)0x1f < (undefined1 *)(pillName._buf._0_4_ + (-4 - (int)ppfVar23))) goto LAB_007c48c4; } iVar31 = 0x7c4852; operator_delete(ppfVar23,(uint)textCapacity); } pillName._buf._0_4_ = *puVar11; pillName._buf._4_4_ = puVar11[1]; pillName._buf._8_4_ = puVar11[2]; pillName._buf._12_4_ = puVar11[3]; pillName._16_8_ = *(undefined8 *)(puVar11 + 4); puVar11[4] = 0; puVar11[5] = 0xf; *(undefined1 *)puVar11 = 0; } if (&DAT_0000000f < local_c4) { textCapacity = (ItemPool **)(local_c4 + 1); ppfVar23 = local_d8; if ((ItemPool **)0xfff < textCapacity) { ppfVar23 = (float **)local_d8[-1]; textCapacity = (ItemPool **)(local_c4 + 0x24); if ((undefined1 *)0x1f < (undefined1 *)((int)local_d8 + (-4 - (int)ppfVar23))) { LAB_007c48c4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } iVar31 = 0x7c48d1; operator_delete(ppfVar23,(uint)textCapacity); } std::string::string(acStackY_308 + 0x94,&local_11c); pppppppuVar12 = string_scramble_seeded (&local_13c,in_stack_fffffd8c,in_stack_fffffd90,(int)in_stack_fffffd94,iVar31, (uint)ppfVar23,(uint)textCapacity); if (&local_11c != (undefined4 ********)pppppppuVar12) { if ((undefined4 ******)0xf < ppppppuStack_108) { ppppppuVar24 = (undefined4 ******)((int)ppppppuStack_108 + 1); ptr = local_11c; if ((undefined4 ******)0xfff < ppppppuVar24) { ptr = (undefined4 *******)local_11c[-1]; ppppppuVar24 = ppppppuStack_108 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_11c + (-4 - (int)ptr))) goto LAB_007c49a4; } operator_delete(ptr,(uint)ppppppuVar24); } local_11c = (undefined4 *******)*pppppppuVar12; ppppppuStack_118 = pppppppuVar12[1]; ppppppuStack_114 = pppppppuVar12[2]; ppppppuStack_110 = pppppppuVar12[3]; local_10c = pppppppuVar12[4]; ppppppuStack_108 = pppppppuVar12[5]; pppppppuVar12[4] = (undefined4 ******)0x0; pppppppuVar12[5] = (undefined4 ******)0xf; *(undefined1 *)pppppppuVar12 = 0; } if ((undefined4 ******)0xf < ppppppuStack_128) { ppppppuVar24 = (undefined4 ******)((int)ppppppuStack_128 + 1); pppppppuVar12 = local_13c; if ((undefined4 ******)0xfff < ppppppuVar24) { pppppppuVar12 = (undefined4 *******)local_13c[-1]; ppppppuVar24 = ppppppuStack_128 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_13c + (-4 - (int)pppppppuVar12))) { LAB_007c49a4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar12,(uint)ppppppuVar24); } local_12c = (undefined4 ******)0x0; ppppppuStack_128 = (undefined4 ******)0xf; local_13c = (undefined4 *******)((uint)local_13c & 0xffffff00); } local_230.y = (float)(useFlags & 0x800); if ((EntityPtr *)local_230.y == (EntityPtr *)0x0) { if (param_1 != 0x31) { PlayerHUD::show_pill_name(); goto LAB_007c4a29; } LAB_007c4a2e: piVar15 = (int *)((int)(in_ECX->_pillEffectUses)._begin + param_1 * 4); *piVar15 = *piVar15 + 1; if ((char)isHorsePill != '\0') { piVar15 = (int *)((int)(in_ECX->_pillEffectUses)._begin + param_1 * 4); *piVar15 = *piVar15 + 1; } } else { LAB_007c4a29: if (param_1 < 0x32) goto LAB_007c4a2e; } FUN_00763290(); if (4 < *(int *)((int)(in_ECX->_pillEffectUses)._begin + 0xac)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x182); } iVar31 = 2; local_20c = (Manager *)(g_manager->_optionsConfig)._announcerVoiceMode; if (local_20c == (void *)0x0) { iVar31 = 900; } if (((int)param_1 < 0) || ((int)(in_ECX->_pillRNGs)._end - (int)(in_ECX->_pillRNGs)._begin >> 4 <= (int)param_1)) { KAGE_LogMessage(0x10,(byte *)"Pill ID out of bounds!\n"); } pvVar8 = (in_ECX->_pillRNGs)._begin; uVar10 = ((int)(in_ECX->_pillRNGs)._end - (int)pvVar8 >> 4) - 1; uVar13 = -(uint)(param_1 != 0) & param_1; if (uVar13 < uVar10) { uVar10 = uVar13; } pillRng = (RNG *)(uVar10 * 0x10 + (int)pvVar8); local_214 = (float)(useFlags >> 7 & 0xffffff01); uVar10 = Random(); if (((((uVar10 & 1) == 0) && (local_20c == (void *)0x0)) || (local_20c == (void *)0x2)) && ((useFlags & 0x100) == 0)) { iVar14 = g_game->_stage; if ((iVar14 < 1) || (6 < iVar14)) { if (iVar14 != 0xd) goto LAB_007c4b4b; goto LAB_007c4b59; } bVar7 = Game::GetStateFlag(g_game,0x30); if (bVar7 != 0) goto LAB_007c4b59; LAB_007c4b4b: local_216 = 1; } else { LAB_007c4b59: local_216 = 0; } game = g_game; cVar6 = (char)isHorsePill; local_208 = (ItemPool *)0x25c; local_210 = (float *)0x84; if (cVar6 != '\0') { local_210 = (float *)0x25c; } switch(param_1) { case 0: pVVar18 = &in_ECX->_pos; Color::Color((Color *)local_ec); if (extraout_DL != '\0') { Game::Fart(g_game,pVVar18,170.0,(Entity *)in_ECX,2.0,0,color); Game::ButterBeanFart(g_game,pVVar18,200.0,(Entity *)in_ECX,0,0); pIVar25 = g_game->_room; local_208 = pIVar25; iVar14 = FUN_00456540(); if (0 < iVar14) { cVar6 = '\0'; local_214 = (float)((uint)local_214 & 0xffffff); local_20c = (void *)0x0; if (pIVar25[2]._pools[0xf]._poolList._capacity != (void *)0x0) { do { tmpEntity = *(Entity **) ((int)pIVar25[2]._pools[0xf]._poolList._begin + (int)local_20c * 4); if (((1 < *(int *)&g_game->_deathmatchManager) && (tmpEntity->_type == 1)) || (tmpEntity->_type - 10U < 0x3de)) { local_ac = *(undefined1 (*) [4])((int)&tmpEntity->_flags + 4); if (((tmpEntity->_flags & 0x11) == 0) && ((tmpEntity->_flags & 0x20000011) == 0)) { EntityRef::constructor((EntityRef *)(local_ec + 4),(Entity *)in_ECX); Entity::AddPoison(tmpEntity,(EntityRef *)(local_ec + 4),0x5a,0.0,0); local_214 = (float)CONCAT13(1,(undefined3)local_214); cVar6 = '\x01'; } else { cVar6 = local_214._3_1_; } } local_20c = (Manager *)((int)local_20c + 1); pIVar25 = local_208; } while (local_20c < local_208[2]._pools[0xf]._poolList._capacity); if (cVar6 != '\0') { Color::Color((Color *)local_ec); fStack_dc = 0.0; local_d8 = (float **)0x3f800000; fStack_d4 = 0.0; fStack_d0 = 1.0; Game::start_poop_cloud_screen_effect((Game *)((int)g_game->_room + 0x1618),color_00); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX; break; } } } goto LAB_007c5fcc; } Game::Fart(g_game,pVVar18,85.0,(Entity *)in_ECX,1.0,0,color); Game::ButterBeanFart(g_game,pVVar18,120.0,(Entity *)in_ECX,0,0); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_00; break; case 1: pcVar3 = *(code **)(*(int *)in_ECX + 0x20); EntityRef::constructor((EntityRef *)(local_ec + 4),(Entity *)in_ECX); (*pcVar3)(); AnimateSad(in_ECX); pMVar22 = extraout_ECX_01; break; case 2: AddSoulHearts(in_ECX,(isHorsePill & 0xff) * 4 + 4,0); goto LAB_007c4df2; case 3: if (in_ECX->_playerType == 0x19) { iVar14 = in_ECX->_numKeys; in_ECX->_numKeys = in_ECX->_poopMana; in_ECX->_poopMana = iVar14; AddPoopMana(in_ECX,0); if ((char)isHorsePill != '\0') { AddPoopMana(in_ECX,(in_ECX->_poopMana + 1) / 2); goto LAB_007c4eaa; } } else { iVar14 = in_ECX->_numKeys; bVar7 = in_ECX->_hasGoldenBomb; in_ECX->_numKeys = in_ECX->_numBombs; in_ECX->_numBombs = iVar14; in_ECX->_hasGoldenBomb = in_ECX->_hasGoldenKey; in_ECX->_hasGoldenKey = bVar7; if (cVar6 != '\0') { AddBombs(in_ECX,(iVar14 + 1) / 2); LAB_007c4eaa: AddKeys(in_ECX,(in_ECX->_numKeys + 1) / 2); } } ConsumableCountChanged(in_ECX,0x1e); AnimateHappy(in_ECX); game = g_game; pMVar22 = extraout_ECX_03; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (game->_hud)._hudRefreshCountdown = 2; } break; case 4: play_sound_with_fart_seed(0x25,1.0,2,0,1.0); TemporaryEffects::RemoveNullEffect(&in_ECX->_temporaryeffects,0,-1); puVar11 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)puVar11 & 0xfffffffcU) < 1) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = (ItemConfig_Item *)*puVar11; } TemporaryEffect::TemporaryEffect(tempEffect,itemConfig); local_220.x = (float)&DAT_0000003c; TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,Effect,1,1); if ((char)isHorsePill != '\0') { local_220.x = 4.2039e-44; goto LAB_007c5476; } goto LAB_007c548c; case 5: if (cVar6 != '\0') { AddSoulHearts(in_ECX,6,0); } SetFullHearts(in_ECX); LAB_007c4df2: AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); pMVar22 = extraout_ECX_02; break; case 6: AddMaxHearts(in_ECX,(isHorsePill & 0xff ^ 1) * 2 + -4,0); TryPreventDeath(in_ECX); AnimationState::SetAnimationData(&(in_ECX->_sprite)._overlayAnimState,(void *)0x0); AnimateSad(in_ECX); pMVar22 = extraout_ECX_05; break; case 7: AddMaxHearts(in_ECX,(isHorsePill & 0xff) * 2 + 2,0); AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); Color::Color((Color *)local_ec); fStack_dc = 1.0; local_d8 = (float **)0x3f000000; fStack_d4 = 0.0; fStack_d0 = 0.33; Color::operator_assign((Color *)&in_ECX->field_0x16e0,other); Color::Color(); (**(code **)(*(int *)in_ECX + 0x3c))(); in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x1000; pMVar22 = extraout_ECX_04; break; case 8: pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 & 0xfffffffcU) < 9) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 8); } if (cVar6 != '\0') { RemoveCostume(in_ECX,itemConfig); pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 & 0xfffffffcU) < 0x1d9) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 0x1d8); } } AddCostume(in_ECX,itemConfig,0); play_sound_with_fart_seed(0xc5,1.0,2,0,1.0); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_10; break; case 9: pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 & 0xfffffffcU) < 5) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 4); } if (cVar6 != '\0') { RemoveCostume(in_ECX,itemConfig); pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 & 0xfffffffcU) < 0x1dd) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 0x1dc); } } AddCostume(in_ECX,itemConfig,0); AnimateSad(in_ECX); IncrementPlayerFormCounter(in_ECX,0xb,1); pMVar22 = extraout_ECX_11; break; case 10: if (cVar6 != '\0') { TemporaryEffects::AddNullEffect(&in_ECX->_temporaryeffects,0x6b,1,1); } in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x200; AnimateHappy(in_ECX); pMVar22 = extraout_ECX_08; break; case 0xb: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 8; AnimateSad(in_ECX); pMVar22 = extraout_ECX_12; break; case 0xc: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x1008; AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); Color::Color((Color *)local_ec); fStack_dc = 0.5; local_d8 = (float **)0x3f800000; fStack_d4 = 1.0; fStack_d0 = 0.33; Color::operator_assign((Color *)&in_ECX->field_0x16e0,other_00); goto LAB_007c5631; case 0xd: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x10; AnimateSad(in_ECX); pMVar22 = extraout_ECX_14; break; case 0xe: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x1010; AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); Color::Color((Color *)local_ec); fStack_dc = 1.0; local_d8 = (float **)0x3f800000; fStack_d4 = 0.0; fStack_d0 = 0.33; Color::operator_assign((Color *)&in_ECX->field_0x16e0,other_01); goto LAB_007c5631; case 0xf: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 2; AnimateSad(in_ECX); pMVar22 = extraout_ECX_15; break; case 0x10: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x1002; AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); Color::Color((Color *)local_ec); fStack_dc = 0.5; local_d8 = (float **)0x3f000000; fStack_d4 = 1.0; fStack_d0 = 0.33; Color::operator_assign((Color *)&in_ECX->field_0x16e0,other_02); goto LAB_007c5631; case 0x11: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x400; AnimateSad(in_ECX); pMVar22 = extraout_ECX_16; break; case 0x12: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x1400; AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); Color::Color((Color *)local_ec); fStack_dc = 0.0; local_d8 = (float **)0x3f800000; fStack_d4 = 0.0; fStack_d0 = 0.33; Color::operator_assign((Color *)&in_ECX->field_0x16e0,other_03); goto LAB_007c5631; case 0x13: if (cVar6 == '\0') { iVar14 = g_game->_stage; uVar10 = Level::GetCurses((Level *)g_game); if (((uVar10 & 2) != 0) && (bVar7 = Game::IsGreedMode(g_game), bVar7 == 0)) { iVar14 = iVar14 + 1; } bVar7 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0x226); if ((((bVar7 == 0) || (bVar7 = Game::IsGreedMode(g_game), bVar7 != 0)) || (iVar14 != 6)) && ((bVar7 = Level::HasPhotoDoor((Level *)g_game), bVar7 == 0 || (*(int *)(*(int *)((int)g_game->_room + 4) + 8) != g_game->_lastBossRoomListIdx)))) { local_20c = (Manager *)CONCAT31(local_20c._1_3_,1); } else { local_20c = (Manager *)((uint)local_20c & 0xffffff00); } uVar10 = RNG::Next((RNG *)((int)(in_ECX->_pillRNGs)._begin + 0x130)); Game::MoveToRandomRoom(g_game,(byte)local_20c,uVar10,in_ECX); pMVar22 = extraout_ECX_07; } else { local_224 = (float *)0x0; local_220.x = 0.0; local_220.y = 0.0; local_14 = CONCAT31(local_14._1_3_,2); local_208 = (ItemPool *)0x4; std::vector<4byte>::_Emplace_reallocate(); local_208 = (ItemPool *)0x2; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 2.8026e-45; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x7; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 9.80909e-45; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x8; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 1.12104e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x12; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 2.52234e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x14; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 2.8026e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x15; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 2.94273e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0xc; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 1.68156e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0xb; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 1.54143e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x18; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 3.36312e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)0x9; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 1.26117e-44; local_220.x = (float)((int)local_220.x + 4); } local_208 = (ItemPool *)&DAT_0000000d; if (local_220.x == local_220.y) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)local_220.x = 1.82169e-44; local_220.x = (float)((int)local_220.x + 4); } teleport_to_random_room_of_types(); local_14 = CONCAT31(local_14._1_3_,1); FID_conflict__Tidy(&local_224); pMVar22 = extraout_ECX_06; } break; case 0x14: uVar13 = 0; fVar30 = local_214; uVar10 = isHorsePill; do { if (SUB41(fVar30,0) == '\0') { LAB_007c5dc8: force = 0; bVar7 = 0; if ((char)uVar10 == '\0') { bVar7 = FullCharge(in_ECX,uVar13,0,0); if (CONCAT31(extraout_var,bVar7) != 0) break; } else { flashHUD = 1; uVar10 = uVar13; iVar14 = GetActiveMaxCharge(in_ECX,uVar13); AddActiveCharge(in_ECX,iVar14 * 2,uVar10,flashHUD,bVar7,force); } fVar30 = local_214; uVar10 = isHorsePill; } else if (uVar13 != 0) goto LAB_007c5dc8; uVar13 = uVar13 + 1; } while (uVar13 < 4); uVar10 = RNG::RandomInt(pillRng,2); local_208 = (ItemPool *)(uVar10 + 3); if ((char)isHorsePill == '\0') { local_208 = (ItemPool *)(uVar10 + 1); } iVar14 = 0; if (0 < (int)local_208) { do { local_230.y = (float)Random(); if (((char)local_214 == '\0') || (local_20c = (void *)0x2, iVar14 == 0)) { local_20c = (void *)0x1; } pVVar18 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_c0 + 0x10),&in_ECX->_pos,40.0,0,0,0); tmpEntity = Game::Spawn(g_game,5,0x5a,pVVar18,&g_vectorZero,(Entity *)in_ECX,(uint)local_20c ,(uint)local_230.y); tmpEntity[1]._sprite._flipX = (char)iVar14; tmpEntity[1]._sprite._flipY = (char)((uint)iVar14 >> 8); *(short *)&tmpEntity[1]._sprite.field_0x102 = (short)((uint)iVar14 >> 0x10); iVar14 = iVar14 + 1; } while (iVar14 < (int)local_208); } AnimateHappy(in_ECX); pMVar22 = extraout_ECX_19; break; case 0x15: iVar14 = GetEffectiveMaxHearts(in_ECX); if (2 < iVar14) { iVar14 = 2; } iVar14 = scale_for_hard_difficulty(iVar14); pEVar16 = (Entity_Player *)in_ECX->_subPlayer; in_ECX->_redHearts = iVar14; if (pEVar16 != (Entity_Player *)0x0) { iVar14 = GetEffectiveMaxHearts(pEVar16); if (2 < iVar14) { iVar14 = 2; } pEVar16->_redHearts = iVar14; } UpdateHeartDependentEffects(in_ECX); iVar14 = GetHealthType(in_ECX); local_230.y = (float)&DAT_00000014; if (iVar14 != 3) { local_230.y = 1.4013e-44; } uVar10 = RNG::RandomInt(pillRng,4); local_20c = (void *)0x0; local_208 = (ItemPool *)(uVar10 + 4); if ((char)isHorsePill == '\0') { local_208 = (ItemPool *)(uVar10 + 1); } if (0 < (int)local_208) { do { uVar10 = Random(); pVVar18 = Room::FindFreePickupSpawnPosition (g_game->_room,(Vector *)(local_c0 + 0x10),&in_ECX->_pos,40.0,0,0,0); tmpEntity = Game::Spawn(g_game,5,(uint)local_230.y,pVVar18,&g_vectorZero,(Entity *)in_ECX,1, uVar10); *(Manager **)&tmpEntity[1]._sprite._flipX = local_20c; local_20c = (Manager *)((int)local_20c + 1); } while ((int)local_20c < (int)local_208); } LAB_007c5fcc: AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_20; break; case 0x16: in_ECX->_controlsCooldown = 0x78; if (cVar6 != '\0') { in_ECX->_controlsCooldown = 0xf0; } Color::Color(); (**(code **)(*(int *)in_ECX + 0x3c))(); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_21; break; case 0x17: g_game->field_0x11 = 1; if (cVar6 != '\0') { Level::ApplyMapEffect((Level *)game); Level::ApplyBlueMapEffect((Level *)g_game); Level::ApplyCompassEffect((Level *)g_game,1); game = g_game; } Game::UpdateVisibility(game); AnimateHappy(in_ECX); pMVar22 = extraout_ECX_22; break; case 0x18: uVar10 = Random(); Game::Spawn(g_game,1000,0x22,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10); piVar15 = (int *)__RTDynamicCast(); Color::Color(&effectColor); (**(code **)(*piVar15 + 0x3c))(); if ((char)isHorsePill != '\0') { SFXManager::Stop(&g_manager->_sfxManager,0x25); FUN_0092df00(0x25,extraout_ECX_23,0,0); FUN_0092df00(0x25,extraout_ECX_24,0x14,0); Game::ShakeScreen(g_game,3); piVar15[0x39] = (int)((float)piVar15[0x39] + (float)piVar15[0x39]); piVar15[0x3a] = (int)((float)piVar15[0x3a] + (float)piVar15[0x3a]); } (**(code **)(*piVar15 + 0xc))(); ShootCandle(in_ECX,direction_00); local_20c = (void *)0x0; local_208 = g_game->_room; if (local_208[2]._pools[0xf]._poolList._capacity != (void *)0x0) { do { pEVar16 = *(Entity_Player **) ((int)local_208[2]._pools[0xf]._poolList._begin + (int)local_20c * 4); if ((pEVar16 != in_ECX) && (bVar7 = Entity::IsVulnerableEnemy((Entity *)pEVar16,(Entity *)0x0), bVar7 != 0)) { if ((char)isHorsePill == '\0') { EntityRef::constructor((EntityRef *)(local_ec + 4),(Entity *)in_ECX); iVar14 = 0x96; } else { cVar6 = (**(code **)(*(int *)pEVar16 + 0x4c))(); if ((cVar6 == '\0') && ((pEVar16->_flags & 0x20000000) == 0)) { EntityRef::constructor((EntityRef *)(local_ec + 4),(Entity *)in_ECX); Entity::AddCharmed((Entity *)pEVar16,(EntityRef *)(local_ec + 4),-1,0,1); if (pEVar16->_type == 0x104) { if (pEVar16->_parent != (EntityPtr)0x0) { local_230.y = (float)&pEVar16->_parent; std::multiset::erase(); } pEVar16->_parent = (EntityPtr)0x0; } goto LAB_007c62d0; } EntityRef::constructor((EntityRef *)(local_ec + 4),(Entity *)in_ECX); iVar14 = 300; } Entity::AddCharmed((Entity *)pEVar16,(EntityRef *)(local_ec + 4),iVar14,0,0); } LAB_007c62d0: local_20c = (Manager *)((int)local_20c + 1); } while (local_20c < local_208[2]._pools[0xf]._poolList._capacity); } if ((char)isHorsePill == '\0') { LAB_007c7497: AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_48; } else { Color::Color((Color *)local_ec); fStack_dc = 2.0; local_d8 = (float **)0x0; fStack_d4 = 1.0; fStack_d0 = 1.0; Game::start_poop_cloud_screen_effect ((Game *)(*(int *)(extraout_EDX + 0x18300) + 0x1618),color_01); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_25; } break; case 0x19: Level::AddCurse((Level *)g_game); if ((char)isHorsePill != '\0') { bVar7 = HasCollectible(in_ECX,0x28e,0); local_214 = (float)CONCAT13(bVar7,(undefined3)local_214); bVar7 = HasCollectible(in_ECX,0x4b,0); if (((bVar7 == 0) && (bVar7 = HasCollectible(in_ECX,0x12f,0), bVar7 == 0)) && ((bVar7 = HasCollectible(in_ECX,0x2e,0), bVar7 == 0 && (iVar14 = GetZodiacEffect(in_ECX), iVar14 != 0x12f)))) { bVar29 = false; } else { bVar29 = true; } game = g_game; if ((local_214._3_1_ == '\0') && (!bVar29)) { uVar10 = 0; do { uVar17 = -(uint)((uVar10 & 0x7ff) != 0) & uVar10 & 0x7ff; uVar13 = 0xe; if (uVar17 < 0xe) { uVar13 = uVar17; } uVar10 = uVar10 + 1; *(undefined1 *)((int)(&game->_itemPool + 1) + uVar13 + 0x3c) = 0; } while ((int)uVar10 < 0xe); AnimateSad(in_ECX); pMVar22 = extraout_ECX_26; break; } } goto LAB_007c679f; case 0x1a: uVar10 = Random(); Game::Spawn(g_game,1000,0x4e,&in_ECX->_pos,&g_vectorZero,(Entity *)in_ECX,0,uVar10); tmpEntity = (Entity *)__RTDynamicCast(); if ((char)isHorsePill != '\0') { pAVar4 = &tmpEntity[1]._sprite; (pAVar4->_animDefaultName)._buf[0xc] = '\0'; (pAVar4->_animDefaultName)._buf[0xd] = '\0'; (pAVar4->_animDefaultName)._buf[0xe] = '\0'; (pAVar4->_animDefaultName)._buf[0xf] = '@'; } goto LAB_007c6454; case 0x1b: pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 & 0xfffffffcU) < 0x19) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 0x18); } AddCostume(in_ECX,itemConfig,0); AnimateHappy(in_ECX); pMVar22 = (Manager *)0x708; cVar6 = (char)isHorsePill; iVar14 = 900; if (cVar6 != '\0') { iVar14 = 0x708; } in_ECX->_rUaWizardTimer = in_ECX->_rUaWizardTimer + iVar14; goto LAB_007c7557; case 0x1c: TemporaryEffects::AddCollectibleEffect(&in_ECX->_temporaryeffects,0x6c,1,1); if ((char)isHorsePill != '\0') { AddHearts(in_ECX,0x14,0,0); } AnimateHappy(in_ECX); pMVar22 = extraout_ECX_29; break; case 0x1d: TemporaryEffects::AddNullEffect(&in_ECX->_temporaryeffects,0x1d,1,1); if ((char)isHorsePill == '\0') goto LAB_007c679f; AddBrokenHearts(in_ECX,1); AnimateSad(in_ECX); pMVar22 = extraout_ECX_28; break; case 0x1e: play_sound_with_fart_seed(0x25,1.0,2,0,1.0); pvVar8 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar8 & 0xfffffffcU) < 0x71) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 0x70); } TemporaryEffect::TemporaryEffect(tempEffect,itemConfig); local_220.x = 4.2039e-44; if ((char)isHorsePill != '\0') { local_220.x = 4.2039e-43; } LAB_007c5476: TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,tempEffect,1,1); LAB_007c548c: AnimateSad(in_ECX); ShootCandle(in_ECX,direction); pMVar22 = extraout_ECX_09; break; case 0x1f: Level::AddCurse((Level *)g_game); pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 < 0x157) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)pvVar8 + 0x558); } AddCostume(in_ECX,itemConfig,0); if ((char)isHorsePill != '\0') { local_224 = (float *)0x0; local_210 = (float *)0x0; local_220.x = 0.0; local_220.y = 0.0; local_14 = CONCAT31(local_14._1_3_,4); uVar10 = Level::filter_curses((Level *)g_game,1); pfVar27 = (float *)0x0; if (uVar10 == 0) { local_230.y = 1.4013e-45; std::vector<4byte>::_Emplace_reallocate(); local_210 = (float *)local_220.y; pfVar27 = (float *)local_220.x; } uVar10 = Level::filter_curses((Level *)g_game,4); if (uVar10 == 0) { local_230.y = (float)&DAT_00000004; if (pfVar27 == local_210) { std::vector<4byte>::_Emplace_reallocate(); local_210 = (float *)local_220.y; pfVar27 = (float *)local_220.x; } else { *pfVar27 = 5.60519e-45; local_220.x = (float)(pfVar27 + 1); pfVar27 = (float *)local_220.x; } } uVar10 = Level::filter_curses((Level *)g_game,8); if (uVar10 == 0) { local_230.y = (float)&DAT_00000008; if (pfVar27 == local_210) { std::vector<4byte>::_Emplace_reallocate(); local_210 = (float *)local_220.y; pfVar27 = (float *)local_220.x; } else { *pfVar27 = 1.12104e-44; local_220.x = (float)(pfVar27 + 1); pfVar27 = (float *)local_220.x; } } uVar10 = Level::filter_curses((Level *)g_game,0x40); if (uVar10 == 0) { local_230.y = 8.96831e-44; if (pfVar27 == local_210) { std::vector<4byte>::_Emplace_reallocate(); local_210 = (float *)local_220.y; pfVar27 = (float *)local_220.x; } else { *pfVar27 = 8.96831e-44; local_220.x = (float)(pfVar27 + 1); pfVar27 = (float *)local_220.x; } } uVar10 = (int)pfVar27 - (int)local_224 >> 2; if (uVar10 != 0) { RNG::RandomInt(&g_game->_generationRNG,uVar10); Level::AddCurse((Level *)g_game); } local_14 = CONCAT31(local_14._1_3_,1); if (local_224 != (float *)0x0) { deallocate(local_224,(int)local_210 - (int)local_224 >> 2); } } LAB_007c679f: AnimateSad(in_ECX); pMVar22 = extraout_ECX_30; break; case 0x20: AnimatePill(in_ECX,param_2,(byte *)"UseItem"); in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x800; IncrementPlayerFormCounter(in_ECX,0xd,(isHorsePill & 0xff) + 1); pMVar22 = extraout_ECX_31; break; case 0x21: AnimatePill(in_ECX,param_2,(byte *)"UseItem"); in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x800; pMVar22 = extraout_ECX_32; break; case 0x22: pvVar8 = g_game->_room; local_210 = (float *)0x1; local_214 = (float)((uint)local_214 & 0xffffff); if (1 < *(int *)((int)pvVar8 + 0xc) + -1) { do { local_208 = (ItemPool *)0x1; pfVar27 = local_210; if (1 < *(int *)((int)pvVar8 + 0x10) + -1) { do { if (-1 < (int)pfVar27) { local_20c = *(Manager **)((int)pvVar8 + 0xc); if ((((int)pfVar27 < (int)local_20c) && (-1 < (int)local_208)) && ((int)local_208 < *(int *)((int)pvVar8 + 0x10))) { pfVar27 = (float *)((int)local_208 * (int)local_20c + (int)local_210); if (((-1 < (int)pfVar27) && (piVar15 = *(int **)((int)pvVar8 + (int)pfVar27 * 4 + 0x24), piVar15 != (int *)0x0)) && (piVar15[1] == 0xe)) { iVar14 = piVar15[9]; iVar1 = piVar15[9]; in_ECX->_numBlueSpiders = in_ECX->_numBlueSpiders + 1; local_230.x = (float)(iVar14 % (int)local_20c) * 40.0 + 40.0; local_230.y = (float)(iVar1 / (int)local_20c) * 40.0 + 120.0; spawn_blue_spider(&local_230,(Entity *)in_ECX,&g_vectorZero); if ((char)isHorsePill != '\0') { iVar14 = piVar15[9]; iVar1 = *(int *)((int)g_game->_room + 0xc); in_ECX->_numBlueSpiders = in_ECX->_numBlueSpiders + 1; local_c0._16_4_ = (float)(iVar14 % iVar1) * 40.0 + 40.0; local_ac = (undefined1 [4])((float)(iVar14 / iVar1) * 40.0 + 120.0); spawn_blue_spider((Vector *)(local_c0 + 0x10),(Entity *)in_ECX,&g_vectorZero); } pcVar3 = *(code **)(*piVar15 + 0x14); EntityRef::constructor((EntityRef *)(local_ec + 4),(Entity *)in_ECX); (*pcVar3)(); local_214 = (float)CONCAT13(1,(undefined3)local_214); } pfVar27 = local_210; } } local_208 = (ItemPool *)((int)&local_208->_seed + 1); pvVar8 = g_game->_room; } while ((int)local_208 < *(int *)((int)pvVar8 + 0x10) + -1); } local_210 = (float *)((int)pfVar27 + 1); pvVar8 = g_game->_room; } while ((int)local_210 < *(int *)((int)pvVar8 + 0xc) + -1); if (local_214._3_1_ != '\0') goto LAB_007c7497; } uVar10 = RNG::RandomInt(pillRng,2); iVar14 = uVar10 + 1; if (iVar14 < 1) goto LAB_007c7497; do { in_ECX->_numBlueSpiders = in_ECX->_numBlueSpiders + 1; spawn_blue_spider(&in_ECX->_pos,(Entity *)in_ECX,&g_vectorZero); if ((char)isHorsePill != '\0') { in_ECX->_numBlueSpiders = in_ECX->_numBlueSpiders + 1; spawn_blue_spider(&in_ECX->_pos,(Entity *)in_ECX,&g_vectorZero); } iVar14 = iVar14 + -1; } while (iVar14 != 0); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_33; break; case 0x23: iVar14 = Room::GetAliveEnemiesCount(g_game->_room); bVar29 = false; if (iVar14 == 0) { uVar10 = RNG::RandomInt(pillRng,3); iVar14 = uVar10 + 1; bVar29 = iVar14 == 0; } if (bVar29 || iVar14 < 0) goto LAB_007c7497; do { in_ECX->_numBlueSpiders = in_ECX->_numBlueSpiders + 1; spawn_blue_spider(&in_ECX->_pos,(Entity *)in_ECX,&g_vectorZero); if ((char)isHorsePill != '\0') { in_ECX->_numBlueSpiders = in_ECX->_numBlueSpiders + 1; spawn_blue_spider(&in_ECX->_pos,(Entity *)in_ECX,&g_vectorZero); } iVar14 = iVar14 + -1; } while (iVar14 != 0); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_34; break; case 0x24: TemporaryEffects::AddCollectibleEffect(&in_ECX->_temporaryeffects,0x5d,1,1); cVar6 = '\0'; pMVar22 = extraout_ECX_35; if ((char)isHorsePill != '\0') { Game::ShakeScreen(g_game,0x1e); local_230.y = (float)(g_manager->_itemConfig)._nullItems._begin; iVar14 = (int)(g_manager->_itemConfig)._nullItems._end - (int)local_230.y >> 2; if (iVar14 < 0x2a) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)local_230.y + 0xa4); } bVar7 = TemporaryEffects::has_item_effect(&in_ECX->_temporaryeffects,itemConfig); pMVar22 = extraout_ECX_36; if (bVar7 == 0) { if (iVar14 < 0x2a) { itemConfig = (ItemConfig_Item *)0x0; } else { itemConfig = *(ItemConfig_Item **)((int)local_230.y + 0xa4); } TemporaryEffect::TemporaryEffect(tempEffect,itemConfig); TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,Effect_00,1,1); TemporaryEffects::AddCollectibleEffect(&in_ECX->_temporaryeffects,0x12e,0,1); pMVar22 = extraout_ECX_37; } break; } goto LAB_007c7557; case 0x25: if ((1 < *(int *)&g_game->_deathmatchManager) && (pEVar16 = (Entity_Player *)FUN_0090b0e0(), pEVar16 != in_ECX)) goto LAB_007c7497; Game::AddPixelation(g_game); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_38; break; case 0x26: iVar14 = 3; if (cVar6 != '\0') { iVar14 = 0xc; } AddBlueFlies(in_ECX,iVar14,&in_ECX->_pos,(Entity *)0x0); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_39; break; case 0x27: local_210 = (float *)0x3; if (cVar6 != '\0') { local_210 = (float *)&DAT_00000009; } iVar14 = 0; do { uVar10 = Random(); local_230.y = (((float)iVar14 * 360.0) / 3.0) * 0.017453292; local_20c = (Manager *)cos(local_230.y); local_230.y = sin(local_230.y); if ((char)isHorsePill == '\0') { local_208 = (ItemPool *)0x42200000; } else { local_208 = (ItemPool *)0x42a00000; } uVar13 = Random(); fVar30 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * (float)local_208 + 35.0; local_ac = (undefined1 [4])(fVar30 * local_230.y + (in_ECX->_pos).y); local_c0._16_4_ = fVar30 * (float)local_20c + (in_ECX->_pos).x; tmpEntity = Game::Spawn(g_game,1000,0x5e,(Vector *)(local_c0 + 0x10),&g_vectorZero, (Entity *)in_ECX,0,uVar10); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags | 0x20000000; uVar2 = *(undefined4 *)((int)&tmpEntity->_flags + 4); (tmpEntity->_sprite)._scale.x = 5.0; (tmpEntity->_sprite)._scale.y = 5.0; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar2; if ((char)isHorsePill != '\0') { pAVar4 = &tmpEntity[1]._sprite; (pAVar4->_filename)._buf[8] = -0x7c; (pAVar4->_filename)._buf[9] = '\x03'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &tmpEntity[1]._sprite; (pAVar4->_filename)._buf[0xc] = -0x7c; (pAVar4->_filename)._buf[0xd] = '\x03'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; } (**(code **)(*(int *)tmpEntity + 0xc))(); iVar14 = iVar14 + 1; } while (iVar14 < (int)local_210); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_40; break; case 0x28: local_210 = (float *)0x3; if (cVar6 != '\0') { local_210 = (float *)&DAT_00000009; } iVar14 = 0; do { uVar10 = Random(); local_230.y = (((float)iVar14 * 360.0) / 3.0) * 0.017453292; local_20c = (Manager *)cos(local_230.y); local_230.y = sin(local_230.y); if ((char)isHorsePill == '\0') { local_208 = (ItemPool *)0x42200000; } else { local_208 = (ItemPool *)0x42a00000; } uVar13 = Random(); fVar30 = (float)((double)(int)uVar13 + __uint_to_double_fixup[-((int)uVar13 >> 0x1f)]) * 2.3283064e-10 * (float)local_208 + 35.0; local_ac = (undefined1 [4])(fVar30 * local_230.y + (in_ECX->_pos).y); local_c0._16_4_ = fVar30 * (float)local_20c + (in_ECX->_pos).x; tmpEntity = Game::Spawn(g_game,1000,0x2d,(Vector *)(local_c0 + 0x10),&g_vectorZero, (Entity *)in_ECX,0,uVar10); *(uint *)&tmpEntity->_flags = (uint)tmpEntity->_flags | 0x20000000; uVar2 = *(undefined4 *)((int)&tmpEntity->_flags + 4); (tmpEntity->_sprite)._scale.x = 5.0; (tmpEntity->_sprite)._scale.y = 5.0; *(undefined4 *)((int)&tmpEntity->_flags + 4) = uVar2; if ((char)isHorsePill != '\0') { pAVar4 = &tmpEntity[1]._sprite; (pAVar4->_filename)._buf[8] = -0x7c; (pAVar4->_filename)._buf[9] = '\x03'; (pAVar4->_filename)._buf[10] = '\0'; (pAVar4->_filename)._buf[0xb] = '\0'; pAVar4 = &tmpEntity[1]._sprite; (pAVar4->_filename)._buf[0xc] = -0x7c; (pAVar4->_filename)._buf[0xd] = '\x03'; (pAVar4->_filename)._buf[0xe] = '\0'; (pAVar4->_filename)._buf[0xf] = '\0'; } (**(code **)(*(int *)tmpEntity + 0xc))(); iVar14 = iVar14 + 1; } while (iVar14 < (int)local_210); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_41; break; case 0x29: if (cVar6 != '\0') { Level::SetStateFlag((Level *)g_game); } Room::SetBrokenWatchState(); Room::SetSlowDown(g_game->_room); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_42; break; case 0x2a: if (cVar6 != '\0') { Level::SetStateFlag((Level *)g_game); } Room::SetBrokenWatchState(); uVar10 = RNG::RandomInt(pillRng,2); in_ECX->_imExcitedSpeedupCountdown = (uVar10 + 2) * 900; TemporaryEffects::AddCollectibleEffect(&in_ECX->_temporaryeffects,0x1c,0,1); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_43; break; case 0x2b: if (cVar6 != '\0') { if (in_ECX->_trinketsID[0] != 0) { in_ECX->_trinketsID[0] = in_ECX->_trinketsID[0] | 0x8000; } if (in_ECX->_trinketsID[1] != 0) { in_ECX->_trinketsID[1] = in_ECX->_trinketsID[1] | 0x8000; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff; EvaluateItems(); } UseActiveItem(in_ECX,(short *)((int)&local_214 + 2),0x1df,1,-1,0); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_44; break; case 0x2c: if (cVar6 == '\0') { uVar10 = Random(); pVVar18 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_220,in_ECX->_headDirection); local_ac = (undefined1 [4])(pVVar18->y * 10.0 * in_ECX->_shotspeed); local_c0._16_4_ = pVVar18->x * 10.0 * in_ECX->_shotspeed; Game::Spawn(g_game,2,0,&in_ECX->_pos,(Vector *)(local_c0 + 0x10),(Entity *)in_ECX,0,uVar10); tear = (Entity_Tear *)__RTDynamicCast(); (**(code **)(*(int *)tear + 0x40))(); tearFlags = BitSet128::operator_or ((BitSet128 *)&ppppppuStack_138,&g_tearFlagExplosive,&g_tearFlagPoison); Entity_Tear::SetTearFlags(tear,*tearFlags); tear->_fallingAccel = 0.6; tear->_fallingSpeed = -13.0; Color::Color(); (**(code **)(*(int *)tear + 0x3c))(); (**(code **)(*(int *)tear + 0xc))(); pMVar22 = extraout_ECX_46; } else { local_20c = (Manager *)0x6; do { pVVar18 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_220,in_ECX->_headDirection); fVar30 = pVVar18->x; local_214 = pVVar18->y; local_210 = (float *)in_ECX->_shotspeed; uVar10 = Random(); rngFloat = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_230.y = rngFloat + rngFloat; local_208 = (ItemPool *)cos(local_230.y); local_230.y = sin(local_230.y); uVar10 = Random(); rngFloat = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10; local_c0._16_4_ = ((float)local_208 + (float)local_208) * rngFloat + fVar30 * 8.0 * (float)local_210; local_ac = (undefined1 [4]) ((local_230.y + local_230.y) * rngFloat + local_214 * 8.0 * (float)local_210); uVar10 = Random(); local_208 = (ItemPool *) ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 + 0.8); uVar10 = Random(); Game::Spawn(g_game,2,0,&in_ECX->_pos,(Vector *)(local_c0 + 0x10),(Entity *)in_ECX,0,uVar10); tear = (Entity_Tear *)__RTDynamicCast(); (**(code **)(*(int *)tear + 0x40))(); tearFlags = BitSet128::operator_or ((BitSet128 *)&ppppppuStack_138,&g_tearFlagExplosive,&g_tearFlagPoison ); Entity_Tear::SetTearFlags(tear,*tearFlags); tear->_fallingAccel = 0.6; uVar10 = Random(); tear->_fallingSpeed = -9.0 - (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 5.0; pIVar25 = local_208; if ((float)local_208 <= 0.01) { pIVar25 = (ItemPool *)0x3c23d70a; } tear->_baseScale = (float)pIVar25; tear->_fScale = (float)pIVar25; Entity_Tear::ResetSpriteScale(tear); Color::Reset((Color *)local_ec); local_ec._0_4_ = 0.5; local_ec._4_4_ = 0.9; fStack_e4 = 0.4; fStack_e0 = 1.0; (**(code **)(*(int *)tear + 0x3c))(); (**(code **)(*(int *)tear + 0xc))(); local_20c = (Manager *)((int)local_20c + -1); } while (local_20c != (Manager *)0x0); local_20c = (void *)0x0; pMVar22 = extraout_ECX_45; } break; case 0x2d: if (cVar6 == '\0') { UseActiveItem(in_ECX,(short *)((int)&local_214 + 2),0x12a,1,-1,0); goto LAB_007c7497; } TemporaryEffects::AddCollectibleEffect(&in_ECX->_temporaryeffects,0x5d,1,1); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_47; break; case 0x2e: uVar10 = param_2; if (*(uint *)&in_ECX->field_0x1738 != 0) { uVar10 = *(uint *)&in_ECX->field_0x1738; } uVar17 = Random(); pVVar18 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_220,&in_ECX->_pos,40.0,0,0,0); uVar13 = uVar10 | 0x800; if ((char)isHorsePill == '\0') { uVar13 = uVar10; } tmpEntity = Game::Spawn(g_game,5,0x46,pVVar18,&g_vectorZero,(Entity *)in_ECX,uVar13,uVar17); LAB_007c6454: (**(code **)(*(int *)tmpEntity + 0xc))(); AnimatePill(in_ECX,param_2,(byte *)"UseItem"); pMVar22 = extraout_ECX_27; break; case 0x2f: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 4; AnimateSad(in_ECX); pMVar22 = extraout_ECX_17; break; case 0x30: in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x1004; AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); Color::Color((Color *)local_ec); fStack_dc = 1.3; local_d8 = (float **)0x3fa66666; fStack_d4 = 1.3; fStack_d0 = 0.5; Color::operator_assign((Color *)&in_ECX->field_0x16e0,other_04); LAB_007c5631: Color::Color(); (**(code **)(*(int *)in_ECX + 0x3c))(); pMVar22 = extraout_ECX_13; break; case 0x31: statPillEffects[0] = 7; statPillEffects[1] = 0x10; statPillEffects[2] = 0xc; statPillEffects[3] = 0xe; local_c0._0_4_ = (void *)0x0; local_c0[4] = '\x02'; local_c0[5] = '\0'; local_c0[6] = '\0'; local_c0[7] = '\0'; local_c0._8_4_ = 8; local_c0._12_8_ = 0x40000000010; local_ac = (undefined1 [4])0x4; statPillEffects[4] = 0x12; statPillEffects[5] = 0x30; local_d8 = (float **)&DAT_00000006; fStack_d4 = 2.10195e-44; fStack_d0 = 1.54143e-44; fStack_cc = 1.82169e-44; local_c8 = 2.38221e-44; local_c4 = &DAT_0000002f; local_13c = (undefined4 *******)0xb6b3ac; ppppppuStack_138 = (undefined4 ******)0xb6b398; ppppppuStack_134 = (undefined4 ******)0xb6b500; ppppppuStack_130 = (undefined4 ******)0xb6b4ec; local_12c = (undefined4 ******)0xb6b52c; ppppppuStack_128 = (undefined4 ******)0xb6b514; bVar7 = HasCollectible(in_ECX,0x4b,0); if (((bVar7 == 0) && (bVar7 = HasCollectible(in_ECX,0x12f,0), bVar7 == 0)) && ((bVar7 = HasCollectible(in_ECX,0x2e,0), bVar7 == 0 && (iVar14 = GetZodiacEffect(in_ECX), iVar14 != 0x12f)))) { isSkipStatDown = '\0'; bVar7 = HasCollectible(in_ECX,0x28e,0); local_214 = (float)CONCAT13(bVar7,(undefined3)local_214); } else { bVar7 = HasCollectible(in_ECX,0x28e,0); fVar30 = local_214; local_214 = (float)CONCAT13(bVar7,(undefined3)local_214); isSkipStatDown = '\x01'; if (bVar7 != 0) { local_214 = (float)((uint)fVar30 & 0xffffff); isSkipStatDown = '\0'; } } local_224 = (float *)0x0; local_220.x = 0.0; local_220.y = 0.0; local_14 = CONCAT31(local_14._1_3_,3); std::vector::_Reallocate(); local_20c = (void *)0x0; pfVar27 = (float *)local_220.y; do { if ((float *)local_220.x == pfVar27) { std::vector::_Emplace_reallocate(); pfVar27 = (float *)local_220.y; } else { *(Manager **)local_220.x = local_20c; local_220.x = (float)((int)local_220.x + 4); } fVar30 = local_220.x; local_20c = (Manager *)((int)local_20c + 1); } while (local_20c < (void *)0x6); RNG::Shuffle((RNG *)((int)(in_ECX->_pillRNGs)._begin + 0x310),(int *)local_224, (int *)local_220.x); if ((*local_224 == 0.0) && (bVar7 = CanUsePill(in_ECX,6), bVar7 == 0)) { *local_224 = *(float *)((int)fVar30 + -4); *(float *)((int)fVar30 + -4) = 0.0; } pfVar27 = local_224; bVar7 = (byte)isHorsePill; if (local_214._3_1_ == '\0') { piVar15 = (int *)((int)(in_ECX->_pillEffectUses)._begin + statPillEffects[(int)local_224[1]] * 4); *piVar15 = *piVar15 + 1; if (bVar7 != 0) { piVar15 = (int *)((int)(in_ECX->_pillEffectUses)._begin + statPillEffects[(int)local_224[1]] * 4); *piVar15 = *piVar15 + 1; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | *(uint *)(local_c0 + (int)local_224[1] * 4); if (local_224[1] == 0.0) { AddMaxHearts(in_ECX,(isHorsePill & 0xff) * 2 + 2,0); bVar7 = (byte)isHorsePill; } } if (isSkipStatDown == '\0') { piVar15 = (int *)((int)(in_ECX->_pillEffectUses)._begin + *(int *)(local_c0 + (int)*pfVar27 * 4 + -0x18) * 4); *piVar15 = *piVar15 + 1; if (bVar7 != 0) { piVar15 = (int *)((int)(in_ECX->_pillEffectUses)._begin + *(int *)(local_c0 + (int)*pfVar27 * 4 + -0x18) * 4); *piVar15 = *piVar15 + 1; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | *(uint *)(local_c0 + (int)*pfVar27 * 4); if (*pfVar27 == 0.0) { AddMaxHearts(in_ECX,(bVar7 ^ 1) * 2 + -4,0); TryPreventDeath(in_ECX); } } if ((EntityPtr *)local_230.y == (EntityPtr *)0x0) { if (isSkipStatDown == '\0') { if (local_214._3_1_ == '\0') { sprintf((byte *)&fStack_e0,(byte *)statPillEffects[(int)pfVar27[1] + 0xb]); pbVar19 = string_table_translate(&g_manager->_stringTable,(byte *)&fStack_e0); pbVar20 = pbVar19; do { bVar7 = *pbVar20; pbVar20[(int)(local_a8 + -(int)pbVar19)] = bVar7; pbVar20 = pbVar20 + 1; } while (bVar7 != 0); puVar5 = (undefined2 *)(local_ac + 3); do { puVar21 = puVar5; puVar5 = (undefined2 *)((int)puVar21 + 1); } while (*(char *)((int)puVar21 + 1) != '\0'); *(undefined2 *)((int)puVar21 + 1) = 0x202c; *(undefined1 *)((int)puVar21 + 3) = 0; sprintf((byte *)&fStack_e0,(byte *)statPillEffects[(int)*pfVar27 + 0xb]); pbVar19 = string_table_translate(&g_manager->_stringTable,(byte *)&fStack_e0); pbVar20 = pbVar19; do { bVar7 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar7 != 0); pbVar28 = local_ac + 3; do { pbVar26 = pbVar28 + 1; pbVar28 = pbVar28 + 1; } while (*pbVar26 != 0); pbVar26 = pbVar19; for (uVar10 = (uint)((int)pbVar20 - (int)pbVar19) >> 2; uVar10 != 0; uVar10 = uVar10 - 1) { *(undefined4 *)pbVar28 = *(undefined4 *)pbVar26; pbVar26 = pbVar26 + 4; pbVar28 = pbVar28 + 4; } for (uVar10 = (int)pbVar20 - (int)pbVar19 & 3; uVar10 != 0; uVar10 = uVar10 - 1) { *pbVar28 = *pbVar26; pbVar26 = pbVar26 + 1; pbVar28 = pbVar28 + 1; } pfVar27 = local_224; } else { sprintf((byte *)&fStack_e0,(byte *)statPillEffects[(int)*pfVar27 + 0xb]); pbVar19 = string_table_translate(&g_manager->_stringTable,(byte *)&fStack_e0); pbVar20 = pbVar19; do { bVar7 = *pbVar20; pbVar20[(int)(local_a8 + -(int)pbVar19)] = bVar7; pbVar20 = pbVar20 + 1; } while (bVar7 != 0); } } else { sprintf((byte *)&fStack_e0,(byte *)statPillEffects[(int)pfVar27[1] + 0xb]); pbVar19 = string_table_translate(&g_manager->_stringTable,(byte *)&fStack_e0); pbVar20 = pbVar19; do { bVar7 = *pbVar20; pbVar20[(int)(local_a8 + -(int)pbVar19)] = bVar7; pbVar20 = pbVar20 + 1; } while (bVar7 != 0); } iVar14 = toupper((int)(char)local_a8[0]); local_a8[0] = (byte)iVar14; PlayerHUD::show_pill_name(); } if (isSkipStatDown == '\0') { if (local_214._3_1_ == '\0') { AnimateHappy(in_ECX); } else { AnimateSad(in_ECX); } } else { AnimateHappy(in_ECX); play_sound_with_fart_seed((int)local_210,1.0,2,0,1.0); } local_14 = CONCAT31(local_14._1_3_,1); deallocate(pfVar27,(int)local_220.y - (int)pfVar27 >> 2); pMVar22 = extraout_ECX_18; break; default: pMVar22 = g_manager; if ((int)(g_manager->_itemConfig)._pillEffects._end - (int)(g_manager->_itemConfig)._pillEffects._begin >> 2 <= (int)param_1) { KAGE_LogMessage(1,(byte *)"Pill %d Effect Not Implemented!\n"); pMVar22 = extraout_ECX_49; break; } goto LAB_007c7557; } cVar6 = (char)isHorsePill; LAB_007c7557: if (((local_216 != 0) && (pMVar22 = pillConfig, pillConfig != (Manager *)0x0)) && (uVar10 = *(uint *)&(pillConfig->_persistentGameData).field_0x28, uVar10 != 0)) { if (cVar6 != '\0') { uVar10 = *(uint *)&(pillConfig->_persistentGameData).field_0x2c; } PlayDelayedSFX(in_ECX,uVar10,*(int *)&(pillConfig->_persistentGameData).field_0x30,iVar31,1.0); pMVar22 = extraout_ECX_50; } LuaEngine::UsePill((LuaEngine *)pMVar22,param_1,in_ECX,useFlags); if ((char)isHorsePill != '\0') { bVar7 = ANM2::IsPlaying(&in_ECX->_sprite,(byte *)"Happy"); if (bVar7 == 0) { bVar7 = ANM2::IsPlaying(&in_ECX->_sprite,&DAT_00b1cdf8); if (bVar7 == 0) goto LAB_007c7658; SFXManager::Stop(&g_manager->_sfxManager,0x10b); iVar31 = 0x25b; } else { SFXManager::Stop(&g_manager->_sfxManager,0x10c); iVar31 = 0x25a; } SoundEffects::Play(&g_manager->_sfxManager,iVar31,1.0,2,0,1.0,0.0); } LAB_007c7658: bVar7 = HasCollectible(in_ECX,0x28e,0); if ((bVar7 != 0) && (((in_ECX->_cacheFlags = in_ECX->_cacheFlags | 1, param_1 == 0x19 || (param_1 == 1)) || ((((param_1 == 0x1b || ((param_1 == 0x16 || (param_1 == 0x1d)))) || (param_1 == 0x1f)) || ((param_1 == 0x25 || (param_1 == 0x2a)))))))) { local_c0._12_8_ = 0x30000000d; local_c0._8_4_ = pillRng->_seed; local_ac = (undefined1 [4])0x1b; uVar10 = RNG::Next((RNG *)(local_c0 + 8)); pVVar18 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_220,&in_ECX->_pos,40.0,0,0,0); Game::Spawn(g_game,5,10,pVVar18,&g_vectorZero,(Entity *)0x0,6,uVar10); } if ((param_2 != 0) && (uVar9 != 0xe)) { *(uint *)&in_ECX->field_0x1738 = param_2; } if ((undefined4 ******)0xf < ppppppuStack_108) { ppppppuVar24 = (undefined4 ******)((int)ppppppuStack_108 + 1); pppppppuVar12 = local_11c; if ((undefined4 ******)0xfff < ppppppuVar24) { pppppppuVar12 = (undefined4 *******)local_11c[-1]; ppppppuVar24 = ppppppuStack_108 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_11c + (-4 - (int)pppppppuVar12))) goto LAB_007c77b1; } operator_delete(pppppppuVar12,(uint)ppppppuVar24); } local_10c = (undefined4 ******)0x0; ppppppuStack_108 = (undefined4 ******)0xf; local_11c = (undefined4 *******)((uint)local_11c & 0xffffff00); if (0xf < pillName._capacity) { uVar9 = pillName._capacity + 1; ppfVar23 = (float **)pillName._buf._0_4_; if (0xfff < uVar9) { ppfVar23 = *(float ***)(pillName._buf._0_4_ + -4); uVar9 = pillName._capacity + 0x24; if ((undefined1 *)0x1f < (undefined1 *)(pillName._buf._0_4_ + (-4 - (int)ppfVar23))) { LAB_007c77b1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppfVar23,uVar9); } ExceptionList = local_1c; return; } //@@ 007c78b0 Entity_Player::AddDeadEyeCharge /* ZHL [lua] Lua binding EntityPlayer:AddDeadEyeCharge */ void __thiscall Entity_Player::AddDeadEyeCharge(Entity_Player *this) { if (this->_deadEyeCharges < 8) { this->_cacheFlags = this->_cacheFlags | 1; this->_deadEyeCharges = this->_deadEyeCharges + 1; EvaluateItems(); } this->_deadEyeMisses = 0; return; } //@@ 007c78e0 Entity_Player::ClearDeadEyeCharge /* ZHL [exact] __thiscall void Entity_Player::ClearDeadEyeCharge(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::ClearDeadEyeCharge(Entity_Player *this) { uint uVar1; uint uVar2; if (this->_deadEyeCharges != 0) { this->_deadEyeMisses = this->_deadEyeMisses + 1; uVar2 = 0x32; if (this->_deadEyeMisses == 1) { uVar2 = 0x14; } else if (this->_deadEyeMisses == 2) { uVar2 = 0x21; } if (this->field_0x13fa != '\0') { uVar2 = 100; } uVar1 = Random(); if (uVar1 % 100 < uVar2) { this->_cacheFlags = this->_cacheFlags | 1; this->_deadEyeMisses = 0; this->_deadEyeCharges = 0; EvaluateItems(); return; } } return; } //@@ 007c7960 Entity_Player::GetZodiacEffect /* ZHL [lua] Lua binding EntityPlayer:GetZodiacEffect prototype: db/protos.zhl, confirmed by RET 0 */ int __thiscall Entity_Player::GetZodiacEffect(Entity_Player *this) { code *pcVar1; Game *pGVar2; byte bVar3; int iVar4; uint uVar5; bVar3 = HasCollectible(this,0x188,0); pGVar2 = g_game; if (bVar3 == 0) { return 0; } uVar5 = g_game->_stage; if ((g_game->_seedEffects)._gameStartSeed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); } if (uVar5 == 0) { uVar5 = 0; } else if (0xc < uVar5) { uVar5 = 0xd; } uVar5 = (pGVar2->_seedEffects)._stageSeeds[uVar5]; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar4 = (*pcVar1)(); return iVar4; } uVar5 = uVar5 >> 2 ^ uVar5; uVar5 = uVar5 << 7 ^ uVar5; return *(int *)(&DAT_00b6bb10 + ((uVar5 >> 9 ^ uVar5) % 0xc) * 4); } //@@ 007c7a20 Entity_Player::ReplaceCostumeSprite /* ZHL [lua] Lua binding EntityPlayer:ReplaceCostumeSprite */ void __thiscall Entity_Player::ReplaceCostumeSprite(Entity_Player *this,int param_2,std_string *param_3) { int iVar1; int extraout_ECX; int iVar2; uint layerId; void *pvVar3; uint local_8; if (((this->_variant != 1) && (this->_isCoopGhost == 0)) && (param_2 != 0)) { pvVar3 = (this->_costumeSpriteDescs)._begin; local_8 = 0; iVar1 = (int)(this->_costumeSpriteDescs)._end - (int)pvVar3; iVar2 = iVar1 >> 0x1f; if (iVar1 / 0x130 + iVar2 != iVar2) { iVar2 = 0; do { if (*(int *)(iVar2 + 0x114 + (int)pvVar3) == param_2) { layerId = 0; iVar1 = param_2; if (*(int *)(iVar2 + 0x80 + (int)pvVar3) != 0) { do { Sprite::ReplaceSpritesheet((Sprite *)((int)pvVar3 + iVar2),layerId,param_3); layerId = layerId + 1; pvVar3 = (this->_costumeSpriteDescs)._begin; iVar1 = extraout_ECX; } while (layerId < *(uint *)(iVar2 + 0x80 + (int)pvVar3)); } ANM2::LoadGraphics((ANM2 *)(iVar2 + (int)pvVar3),(byte)iVar1); } pvVar3 = (this->_costumeSpriteDescs)._begin; iVar2 = iVar2 + 0x130; local_8 = local_8 + 1; } while (local_8 < (uint)(((int)(this->_costumeSpriteDescs)._end - (int)pvVar3) / 0x130)); } } return; } //@@ 007c7b10 FUN_007c7b10 undefined1 FUN_007c7b10(uint param_1,int param_2) { int iVar1; qword qVar2; void *pvVar3; uint uVar4; uint uVar5; qword *pqVar6; int *piVar7; EntityRef *pEVar8; int *piVar9; code *extraout_EDX; undefined1 uVar10; uint uVar11; EntityRef local_4c; EntityList_EL local_24; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afffdd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_24,3,0xce,-1,0,0); pvVar3 = local_24._data; local_8 = 0; uVar11 = 0; uVar5 = local_24._size; if (local_24._size != 0) { do { iVar1 = *(int *)((int)pvVar3 + uVar11 * 4); if ((((*(char *)(iVar1 + 0x173) == '\0') && (*(int *)(iVar1 + 0x410) == local_14)) && (*(int *)(iVar1 + 0x2c) == 0xce)) && ((*(int *)(iVar1 + 0x30) == 0x1e6 && ((param_1 & 0x200020) == 0)))) { uVar5 = Random(); if (uVar5 % 5 == 0) { if (*(int *)(iVar1 + 0x410) != 0) { piVar9 = (int *)(*(int *)(iVar1 + 0x410) + 0x13bc); param_2 = 0xf; piVar7 = ¶m_2; if (0xe < *piVar9) { piVar7 = piVar9; } *piVar9 = *piVar7; } pEVar8 = EntityRef::EntityRef(&local_4c); (*extraout_EDX)(pEVar8,uVar4); uVar10 = 1; goto LAB_007c7bd2; } uVar5 = local_24._size; } uVar11 = uVar11 + 1; } while (uVar11 < uVar5); } uVar10 = 0; LAB_007c7bd2: if (local_24._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } if (local_24._data != (void *)0x0) { uVar5 = *(uint *)((int)local_24._data + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar5; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar5); free((uint *)((int)local_24._data + -4)); } } ExceptionList = local_10; return uVar10; } //@@ 007c7c60 Entity_Player::update_purity_glow /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX is an Entity_Player; refreshes the Purity glow costume (was a ZHL prefix match Entity_Knife::Init) prototype: db/protos.zhl */ void __fastcall Entity_Player::update_purity_glow(Entity_Player *player) { byte bVar1; byte *text; int iVar2; undefined4 uVar3; byte *pbVar4; void *pvVar5; uint size; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af6ebd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; iVar2 = player->_purityState; if (3 < iVar2) { KAGE_LogMessage(0x10,(byte *)"[err] Purity has a wrong state!"); iVar2 = player->_purityState; } text = (&PTR_s_gfx_characters_costumes_PurityGl_00b6bb40)[iVar2]; local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar4 = text; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,text,(int)pbVar4 - (int)(text + 1)); local_8 = (void *)0x0; pvVar5 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar5 & 0xfffffffcU) < 0x45) { uVar3 = 0; } else { uVar3 = *(undefined4 *)((int)pvVar5 + 0x44); } ReplaceCostumeSprite(player,uVar3,local_2c,0); if (0xf < local_18) { size = local_18 + 1; pvVar5 = local_2c[0]; if (0xfff < size) { pvVar5 = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,size); } ExceptionList = local_10; return; } //@@ 007c7d70 Entity_Player::trigger_immaculate_conception /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: string "[err] Immaculate has a wrong state!"; picks the reward for the Immaculate Conception counter (param 0 -> normal path with 5 options); callers Entity_Player::AddImmaculateConceptionCounter, TakeDamage */ void Entity_Player::trigger_immaculate_conception(char param_1) { byte bVar1; int playerType; int iVar2; Entity_Player *in_ECX; byte *costumePathEnd; int iVar3; void *freeBlock; uint freeSize; int iVar4; void *immaculateSkinPath [5]; uint immaculateSkinPathCapacity; void *cambionSkinPath [5]; uint cambionSkinPathCapacity; void *immaculatePath [4]; undefined4 immaculatePathSize; uint immaculatePathCapacity; void *cambionPath [4]; undefined4 cambionPathSize; uint cambionPathCapacity; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; byte *costumePath; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b00025; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(cambionPath + 0xb); ExceptionList = &local_10; if (param_1 == '\0') { iVar4 = 5; iVar3 = in_ECX->_immaculateConceptionState; if (1 < *(int *)&g_game->_deathmatchManager) { iVar4 = 0x14; } iVar2 = 0xf; if (1 < *(int *)&g_game->_deathmatchManager) { iVar2 = 0x3c; } if (iVar2 <= iVar3) { KAGE_LogMessage(0x10,(byte *)"[err] Immaculate has a wrong state!"); iVar3 = in_ECX->_immaculateConceptionState; } iVar2 = in_ECX->_bodyColor; playerType = in_ECX->_playerType; immaculatePathSize = 0; immaculatePathCapacity = 0xf; costumePath = (&PTR_s_gfx_characters_costumes_costume__00b6bb04)[iVar3 / iVar4]; immaculatePath[0] = (void *)0x0; costumePathEnd = costumePath; do { bVar1 = *costumePathEnd; costumePathEnd = costumePathEnd + 1; } while (bVar1 != 0); std::string::assign((char *)immaculatePath,costumePath, (int)costumePathEnd - (int)(costumePath + 1)); local_8 = (void *)0x3; costume_path_apply_skin_color (immaculateSkinPath,immaculatePath,iVar2,playerType,(byte *)0x0,(byte *)0x0); local_8 = (void *)CONCAT31(local_8._1_3_,5); if (0xf < immaculatePathCapacity) { freeSize = immaculatePathCapacity + 1; freeBlock = immaculatePath[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)immaculatePath[0] + -4); freeSize = immaculatePathCapacity + 0x24; if (0x1f < (uint)((int)immaculatePath[0] + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } immaculatePathSize = 0; immaculatePathCapacity = 0xf; immaculatePath[0] = (void *)((uint)immaculatePath[0] & 0xffffff00); ReplaceCostumeSprite(); if (immaculateSkinPathCapacity < 0x10) { ExceptionList = local_10; return; } freeSize = immaculateSkinPathCapacity + 1; freeBlock = immaculateSkinPath[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)immaculateSkinPath[0] + -4); freeSize = immaculateSkinPathCapacity + 0x24; if (0x1f < (uint)((int)immaculateSkinPath[0] + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { iVar3 = in_ECX->_playerType; iVar4 = in_ECX->_bodyColor; iVar2 = GetCambionPregnancyLevel(in_ECX); cambionPathSize = 0; cambionPathCapacity = 0xf; costumePath = (&PTR_s_gfx_characters_costumes_costume__00b6baf8)[iVar2]; cambionPath[0] = (void *)0x0; costumePathEnd = costumePath; do { bVar1 = *costumePathEnd; costumePathEnd = costumePathEnd + 1; } while (bVar1 != 0); std::string::assign((char *)cambionPath,costumePath,(int)costumePathEnd - (int)(costumePath + 1) ); local_8 = (void *)0x0; costume_path_apply_skin_color(cambionSkinPath,cambionPath,iVar4,iVar3,(byte *)0x0,(byte *)0x0); local_8 = (void *)CONCAT31(local_8._1_3_,2); if (0xf < cambionPathCapacity) { freeSize = cambionPathCapacity + 1; freeBlock = cambionPath[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)cambionPath[0] + -4); freeSize = cambionPathCapacity + 0x24; if (0x1f < (uint)((int)cambionPath[0] + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } cambionPathSize = 0; cambionPathCapacity = 0xf; cambionPath[0] = (void *)((uint)cambionPath[0] & 0xffffff00); ReplaceCostumeSprite(); if (cambionSkinPathCapacity < 0x10) { ExceptionList = local_10; return; } freeSize = cambionSkinPathCapacity + 1; freeBlock = cambionSkinPath[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)cambionSkinPath[0] + -4); freeSize = cambionSkinPathCapacity + 0x24; if (0x1f < (uint)((int)cambionSkinPath[0] + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } operator_delete(freeBlock,freeSize); ExceptionList = local_10; return; } //@@ 007c8050 Entity_Player::AddImmaculateConceptionCounter /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Immaculate Conception 413 counter +0x1930, spawn heart */ void Entity_Player::AddImmaculateConceptionCounter(int param_1) { void *pvVar1; uint uVar2; code *pcVar3; Manager *pMVar4; byte bVar5; uint uVar6; Vector *position; Entity_Player *in_ECX; int iVar7; uint *puVar8; undefined1 auStack_34 [4]; int local_30; Vector local_2c; int local_24; uint local_20 [7]; local_20[5] = __security_cookie ^ (uint)auStack_34; bVar5 = HasCollectible(in_ECX,0x19d,0); if (bVar5 != 0) { iVar7 = 0xf; local_30 = 5; if (1 < *(int *)&g_game->_deathmatchManager) { local_30 = 0x14; iVar7 = 0x3c; } local_24 = in_ECX->_immaculateConceptionState / local_30; if (*(int *)&g_game->_deathmatchManager < 2) { param_1 = 1; } else { param_1 = param_1 << 3; } param_1 = in_ECX->_immaculateConceptionState + param_1; in_ECX->_immaculateConceptionState = param_1; if (iVar7 <= param_1) { pvVar1 = (in_ECX->_collectibleRNGs)._begin; puVar8 = (uint *)((int)pvVar1 + 0x19d0); local_20[0] = 0x40; local_20[1] = 0x80; local_20[2] = 0x100; local_20[3] = 0x200; local_20[4] = 0x400; uVar6 = *puVar8; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar8; if (uVar6 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar6 = uVar6 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x19d4) & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)*(undefined4 *)((int)pvVar1 + 0x19d8) & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x19dc) & 0x1f) ^ uVar6; *puVar8 = uVar6; pMVar4 = g_manager; iVar7 = 0; do { uVar2 = local_20[(int)(uVar6 % 5 + iVar7) % 5]; if ((in_ECX->_conceptionFamiliarFlags & uVar2) == 0) { local_2c.x = 1.41531e-42; seed_fart_sound_override((int *)&local_2c); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_2c.x,1.0,2,0,1.0,0.0); in_ECX->_conceptionFamiliarFlags = in_ECX->_conceptionFamiliarFlags | uVar2; in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x200; EvaluateItems(); break; } iVar7 = iVar7 + 1; } while (iVar7 < 5); uVar6 = Random(); position = Room::FindFreePickupSpawnPosition(g_game->_room,&local_2c,&in_ECX->_pos,40.0,0,0,0) ; Game::SpawnEx(g_game,5,10,position,&g_vectorZero,(Entity *)in_ECX,3,uVar6,0); in_ECX->_immaculateConceptionState = 0; param_1 = 0; } if (local_24 != param_1 / local_30) { trigger_immaculate_conception(0); } } return; } //@@ 007c8240 Entity_Player::dash_impact /* DB: ? called from HandleCollision after velocity=dir*speed and +0x1e94=-1, from player update 00782af0 Entity_Player::Update item effects 00794e50; sets +0x1e98=1, +0x13bc=max(.,30), spawns ring of 8 effects 1000.147 radius 40, QueryRadius enemies: AddKnockback/AddBurn, Projectile Reflect/Deflect (Mars-style dash) prototype: db/protos.zhl */ void __thiscall Entity_Player::dash_impact(Entity_Player *this) { uint *puVar1; float fVar2; qword qVar3; byte bVar4; int *piVar5; uint seed; Entity *ringEffect; Vector *pushDirection; Entity *unused; Entity *unused_00; Game *game; int iVar6; float fVar7; double dVar8; float fVar9; EntityRef sourceRef; EntityList_EL nearbyEntities; Vector pushResult; Vector targetPos; Vector local_40; Vector local_38; Vector reflectVelocity; float local_28; float local_24; float local_20; float local_1c; float local_18; float deltaX; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *damageCooldown; undefined4 flagsHigh; Entity_Projectile *target; local_8 = 0xffffffff; puStack_c = &LAB_00b0005d; local_10 = ExceptionList; ExceptionList = &local_10; qVar3 = this->_flags; damageCooldown = &this->_damageCooldown; puVar1 = (uint *)((int)&this->_flags + 4); *puVar1 = *puVar1 & 0xffffffef; game = g_game; *(int *)&this->_flags = (int)qVar3; this->_marsUnkBool = 1; local_20 = 4.2039e-44; piVar5 = (int *)&local_20; if (0x1d < *damageCooldown) { piVar5 = damageCooldown; } iVar6 = 0; *damageCooldown = *piVar5; do { local_20 = (float)iVar6 * 360.0 * 0.125 * 0.017453292; local_18 = sin(local_20); local_20 = cos(local_20); local_20 = local_20 * 40.0; local_18 = local_18 * 40.0; local_40.x = local_20 + (this->_pos).x; local_40.y = local_18 + (this->_pos).y; bVar4 = Room::IsPositionInRoom(game->_room,&local_40,0.0); if (bVar4 != 0) { seed = Random(); local_38.x = local_20 + (this->_pos).x; local_38.y = local_18 + (this->_pos).y; ringEffect = Game::Spawn(g_game,1000,0x93,&local_38,&g_vectorZero,(Entity *)this,0,seed); flagsHigh = *(undefined4 *)((int)&ringEffect->_flags + 4); *(uint *)&ringEffect->_flags = (uint)ringEffect->_flags | 0x20000000; *(undefined4 *)((int)&ringEffect->_flags + 4) = flagsHigh; EntityRef::constructor(&sourceRef,(Entity *)this); Entity::AddBurn(ringEffect,&sourceRef,10,0.0,0); (**(code **)(*(int *)ringEffect + 0xc))(); game = g_game; } iVar6 = iVar6 + 1; } while (iVar6 < 8); EntityList::QueryRadius ((EntityList *)((int)game->_room + 0x1218),&nearbyEntities,&this->_pos,80.0,0xffffffff); local_8 = 0; local_20 = 0.0; if (nearbyEntities._size != 0) { do { fVar9 = local_20; target = *(Entity_Projectile **)((int)nearbyEntities._data + (int)local_20 * 4); if (((target->_type != 1) && (((bVar4 = Entity::IsVulnerableEnemy((Entity *)target,(Entity *)0x0), bVar4 != 0 || (target->_type == 4)) || (target->_type == 5)))) && ((target->_mass != 0.0 && ((target->_flags & 0x4000000) == 0)))) { local_28 = target->_size + 80.0; deltaX = (target->_pos).x - (this->_pos).x; local_18 = (target->_pos).y - (this->_pos).y; local_24 = local_18 * local_18 + deltaX * deltaX; local_1c = sqrtf(local_24); if (0.0 < local_1c) { if (target->_type == 9) { fVar7 = (target->_velocity).x; fVar2 = (target->_velocity).y; if (local_1c <= 0.0) { reflectVelocity.x = deltaX; reflectVelocity.y = local_18; Entity_Projectile::Reflect(target,unused,&reflectVelocity); } else { fVar7 = sqrtf(fVar7 * fVar7 + fVar2 * fVar2); reflectVelocity.y = (fVar7 / local_1c) * local_18; reflectVelocity.x = (fVar7 / local_1c) * deltaX; Entity_Projectile::Reflect(target,unused_00,&reflectVelocity); } } else if ((target->_type == 2) && (iVar6 = __RTDynamicCast(target,0,&IsaacRepentancePlus::Entity:: RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0 ), iVar6 != 0)) { local_20 = (target->_velocity).x; local_1c = (target->_velocity).y; local_24 = sqrtf(local_24); if (local_24 <= 0.0) { local_38.y = local_18; local_38.x = deltaX; } else { fVar7 = sqrtf(local_20 * local_20 + local_1c * local_1c); local_38.y = local_18 * (fVar7 / local_24); local_38.x = deltaX * (fVar7 / local_24); } Entity_Projectile::Deflect(target,(Entity *)this,&local_38); } else { fVar7 = 7.0; if (local_28 - local_1c <= 7.0) { fVar7 = local_28 - local_1c; } fVar2 = target->_mass; fVar7 = fVar7 + fVar7; if (fVar2 <= 20.0) { if (fVar2 <= 30.0) { if (50.0 < fVar2) { fVar7 = fVar7 * 0.015; } } else { fVar7 = fVar7 * 0.2; } } else { fVar7 = fVar7 * 0.5; } (target->_velocity).x = (deltaX / local_1c) * fVar7 + (target->_velocity).x * 0.5; (target->_velocity).y = (local_18 / local_1c) * fVar7 + (target->_velocity).y * 0.5; bVar4 = Entity::IsVulnerableEnemy((Entity *)target,(Entity *)0x0); if ((((bVar4 != 0) && (0.0 < target->_mass)) && (bVar4 = Entity::HasEntityFlags((Entity *)target,0x4000000), bVar4 == 0)) && (bVar4 = Entity::HasEntityFlags((Entity *)target,0x20000000), bVar4 == 0)) { targetPos.x = (target->_pos).x; targetPos.y = (target->_pos).y; Vector::__sub(&targetPos,&local_40,&this->_pos); fVar9 = Vector::Length(&local_40); local_28 = fVar9; Vector::__div_assign(&local_40,&local_28); local_24 = assert_lerp_range((fVar9 - (this->_size + target->_size)) + target->_mass, 10.0,80.0,20.0,1.0,1); local_28 = 16.0; pushDirection = Vector::__mul(&local_40,&pushResult,&local_28); EntityRef::constructor(&sourceRef,(Entity *)this); bVar4 = 1; dVar8 = floor((double)local_24); local_28 = (float)dVar8; iVar6 = thunk_FUN_00af0780(); Entity::AddKnockback((Entity *)target,&sourceRef,pushDirection,iVar6,bVar4); fVar9 = local_20; } } } } local_20 = (float)((int)fVar9 + 1); } while ((uint)local_20 < (uint)nearbyEntities._size); } EntityList_Query::~EntityList_Query(&nearbyEntities); ExceptionList = local_10; return; } //@@ 007c8830 Entity_Player::spawn_locusts /* DB: for each locust trinket 0x71..0x75 (Locust of Wrath..Conquest) GetTrinketMultiplier, doubled/tripled by Fish Tail (0x5e) with 1/5 rolls, spawns that many locust familiars via Game::SpawnEx ("RNG Seed is zero!"); Entity_Player::room_enter, Ambush::SpawnWave/SpawnBossrushWave prototype: db/protos.zhl */ void __thiscall Entity_Player::spawn_locusts(Entity_Player *this) { float fVar1; code *pcVar2; byte isFishTailHeld; int iVar3; int locustCount; int iVar4; uint uVar5; Entity *pEVar6; int fishTailMultiplier; uint rngResult; uint *conquestRngSeed; bool bVar7; bool bVar8; void *trinketRngs; fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 1.58347e-43)) { locustCount = GetTrinketMultiplier(this,0x71); bVar8 = false; bVar7 = locustCount == 0; LAB_007c8868: if (!bVar7 && bVar8 == locustCount < 0) goto LAB_007c8873; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x71); bVar8 = SBORROW4(iVar3,1); locustCount = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007c8868; } LAB_007c8873: locustCount = GetTrinketMultiplier(this,0x71); iVar3 = 1; isFishTailHeld = HasTrinket(this,0x5e,0); if (isFishTailHeld != 0) { iVar3 = 2; iVar4 = GetTrinketMultiplier(this,0x5e); if (iVar4 == 2) { uVar5 = Random(); if (uVar5 % 5 == 0) { iVar3 = 3; } } else if ((iVar4 == 3) && (uVar5 = Random(), uVar5 % 5 == 0)) { iVar3 = 4; } } iVar3 = iVar3 * locustCount; if (0 < iVar3) { do { uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,(Entity *)this,1,uVar5,0); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar3 = iVar3 + -1; } while (iVar3 != 0); } } fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 1.59748e-43)) { locustCount = GetTrinketMultiplier(this,0x72); bVar8 = false; bVar7 = locustCount == 0; LAB_007c894d: if (!bVar7 && bVar8 == locustCount < 0) goto LAB_007c8958; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x72); bVar8 = SBORROW4(iVar3,1); locustCount = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007c894d; } LAB_007c8958: locustCount = GetTrinketMultiplier(this,0x72); fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; iVar3 = 1; if ((fVar1 == 0.0) || (fVar1 != 1.31722e-43)) { iVar4 = GetTrinketMultiplier(this,0x5e); bVar8 = false; bVar7 = iVar4 == 0; LAB_007c8997: if (!bVar7 && bVar8 == iVar4 < 0) goto LAB_007c899e; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { fishTailMultiplier = GetTrinketMultiplier(this,0x5e); bVar8 = SBORROW4(fishTailMultiplier,1); iVar4 = fishTailMultiplier + -1; bVar7 = fishTailMultiplier == 1; goto LAB_007c8997; } LAB_007c899e: iVar3 = 2; iVar4 = GetTrinketMultiplier(this,0x5e); if (iVar4 == 2) { uVar5 = Random(); if (uVar5 % 5 == 0) { iVar3 = 3; } } else if ((iVar4 == 3) && (uVar5 = Random(), uVar5 % 5 == 0)) { iVar3 = 4; } } iVar3 = iVar3 * locustCount; if (0 < iVar3) { do { uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,(Entity *)this,2,uVar5,0); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar3 = iVar3 + -1; } while (iVar3 != 0); } } fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 1.61149e-43)) { locustCount = GetTrinketMultiplier(this,0x73); bVar8 = false; bVar7 = locustCount == 0; LAB_007c8a59: if (!bVar7 && bVar8 == locustCount < 0) goto LAB_007c8a64; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x73); bVar8 = SBORROW4(iVar3,1); locustCount = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007c8a59; } LAB_007c8a64: locustCount = GetTrinketMultiplier(this,0x73); fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; iVar3 = 1; if ((fVar1 == 0.0) || (fVar1 != 1.31722e-43)) { iVar4 = GetTrinketMultiplier(this,0x5e); bVar8 = false; bVar7 = iVar4 == 0; LAB_007c8aa3: if (!bVar7 && bVar8 == iVar4 < 0) goto LAB_007c8aaa; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { fishTailMultiplier = GetTrinketMultiplier(this,0x5e); bVar8 = SBORROW4(fishTailMultiplier,1); iVar4 = fishTailMultiplier + -1; bVar7 = fishTailMultiplier == 1; goto LAB_007c8aa3; } LAB_007c8aaa: iVar3 = 2; iVar4 = GetTrinketMultiplier(this,0x5e); if (iVar4 == 2) { uVar5 = Random(); if (uVar5 % 5 == 0) { iVar3 = 3; } } else if ((iVar4 == 3) && (uVar5 = Random(), uVar5 % 5 == 0)) { iVar3 = 4; } } iVar3 = iVar3 * locustCount; if (0 < iVar3) { do { uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,(Entity *)this,3,uVar5,0); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar3 = iVar3 + -1; } while (iVar3 != 0); } } fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 1.62551e-43)) { locustCount = GetTrinketMultiplier(this,0x74); bVar8 = false; bVar7 = locustCount == 0; LAB_007c8b68: if (!bVar7 && bVar8 == locustCount < 0) goto LAB_007c8b73; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x74); bVar8 = SBORROW4(iVar3,1); locustCount = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007c8b68; } LAB_007c8b73: locustCount = GetTrinketMultiplier(this,0x74); fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; iVar3 = 1; if ((fVar1 == 0.0) || (fVar1 != 1.31722e-43)) { iVar4 = GetTrinketMultiplier(this,0x5e); bVar8 = false; bVar7 = iVar4 == 0; LAB_007c8bb2: if (!bVar7 && bVar8 == iVar4 < 0) goto LAB_007c8bb9; } else { if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { fishTailMultiplier = GetTrinketMultiplier(this,0x5e); bVar8 = SBORROW4(fishTailMultiplier,1); iVar4 = fishTailMultiplier + -1; bVar7 = fishTailMultiplier == 1; goto LAB_007c8bb2; } LAB_007c8bb9: iVar3 = 2; iVar4 = GetTrinketMultiplier(this,0x5e); if (iVar4 == 2) { uVar5 = Random(); if (uVar5 % 5 == 0) { iVar3 = 3; } } else if ((iVar4 == 3) && (uVar5 = Random(), uVar5 % 5 == 0)) { iVar3 = 4; } } iVar3 = iVar3 * locustCount; if (0 < iVar3) { do { uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,(Entity *)this,4,uVar5,0); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); iVar3 = iVar3 + -1; } while (iVar3 != 0); } } fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 1.63952e-43)) { locustCount = GetTrinketMultiplier(this,0x75); bVar8 = false; bVar7 = locustCount == 0; LAB_007c8c78: if (bVar7 || bVar8 != locustCount < 0) { return; } } else if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar3 = GetTrinketMultiplier(this,0x75); bVar8 = SBORROW4(iVar3,1); locustCount = iVar3 + -1; bVar7 = iVar3 == 1; goto LAB_007c8c78; } locustCount = GetTrinketMultiplier(this,0x75); trinketRngs = (this->_trinketRNGs)._begin; conquestRngSeed = (uint *)((int)trinketRngs + 0x750); iVar3 = GetTrinketMultiplier(this,0x75); uVar5 = *conquestRngSeed; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = *conquestRngSeed; if (uVar5 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar5 = uVar5 >> ((byte)*(undefined4 *)((int)trinketRngs + 0x754) & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)*(undefined4 *)((int)trinketRngs + 0x758) & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)*(undefined4 *)((int)trinketRngs + 0x75c) & 0x1f) ^ uVar5; *conquestRngSeed = uVar5; uVar5 = uVar5 % (5 - (iVar3 != 2)); fVar1 = this[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 1.31722e-43)) { iVar3 = GetTrinketMultiplier(this,0x5e); bVar8 = false; bVar7 = iVar3 == 0; LAB_007c8d1e: if (bVar7 || bVar8 != iVar3 < 0) goto LAB_007c8d6e; } else if (*(char *)(this[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar4 = GetTrinketMultiplier(this,0x5e); bVar8 = SBORROW4(iVar4,1); iVar3 = iVar4 + -1; bVar7 = iVar4 == 1; goto LAB_007c8d1e; } iVar4 = 2; iVar3 = GetTrinketMultiplier(this,0x5e); if (iVar3 == 2) { rngResult = Random(); if (rngResult % 5 == 0) { iVar4 = 3; } } else if ((iVar3 == 3) && (rngResult = Random(), rngResult % 5 == 0)) { iVar4 = 4; } uVar5 = uVar5 * iVar4; LAB_007c8d6e: locustCount = locustCount + uVar5; if (0 < locustCount) { do { uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,3,0x2b,&this->_pos,&g_vectorZero,(Entity *)this,5,uVar5,0); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar6->_flags + 4) = *(undefined4 *)((int)&pEVar6->_flags + 4); locustCount = locustCount + -1; } while (locustCount != 0); } return; } //@@ 007c8dc0 Entity_Player::SpawnMawOfVoid /* ZHL [lua] Lua binding EntityPlayer:SpawnMawOfVoid prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Laser * __thiscall Entity_Player::SpawnMawOfVoid(Entity_Player *this,int timeout) { EntityPtr *pEVar1; Manager *pMVar2; uint uVar3; Entity *pEVar4; Entity_Laser *pEVar5; uint uVar6; uint uVar7; undefined4 local_c; pMVar2 = g_manager; local_c = (EntityPtr *)0x1aa; seed_fart_sound_override(&local_c); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_c,1.0,2,0,1.0,0.0); uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,7,1,&this->_pos,&g_vectorZero,(Entity *)this,3,uVar3,0); pEVar5 = (Entity_Laser *) __RTDynamicCast(pEVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); pEVar1 = &pEVar5->_parent; (pEVar5->_posOffset).x = 0.0; (pEVar5->_posOffset).y = -20.0; if (*pEVar1 != (EntityPtr)0x0) { local_c = pEVar1; std::multiset::erase(&local_c); } *pEVar1 = (EntityPtr)this; if (this != (Entity_Player *)0x0) { std::multiset::insert(pEVar1); } pEVar5->_renderDepthOffset = 3000.0; uVar3 = ~(DAT_00c34b34 | DAT_00c34c44) & *(uint *)((int)&(this->_tearFlags)._l + 4) | DAT_00c34894 ; uVar7 = ~(DAT_00c34b38 | DAT_00c34c48) & (uint)(this->_tearFlags)._h | DAT_00c34898; uVar6 = ~(DAT_00c34b3c | DAT_00c34c4c) & *(uint *)((int)&(this->_tearFlags)._h + 4) | DAT_00c3489c ; *(uint *)&(pEVar5->_tearFlags)._l = ~(DAT_00c34b30 | DAT_00c34c40) & (uint)(this->_tearFlags)._l | DAT_00c34890; *(uint *)((int)&(pEVar5->_tearFlags)._l + 4) = uVar3; *(uint *)&(pEVar5->_tearFlags)._h = uVar7; *(uint *)((int)&(pEVar5->_tearFlags)._h + 4) = uVar6; (**(code **)(*(int *)pEVar5 + 0x40))(this->_damage); pEVar5->_timeout = timeout; if (pEVar5->_spawnerEntity != (EntityPtr)0x0) { std::multiset::erase((int)register0x00000010 + -0x10); } pEVar5->_spawnerEntity = (EntityPtr)this; std::multiset::insert(&pEVar5->_spawnerEntity); return pEVar5; } //@@ 007c8f80 Entity_Player::AddGoldenBomb /* ZHL [lua] Lua binding EntityPlayer:AddGoldenBomb */ void Entity_Player::AddGoldenBomb(void) { Game *pGVar1; Entity_Player *in_ECX; in_ECX->_hasGoldenBomb = 1; ConsumableCountChanged(in_ECX,0x10); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007c8fc0 Entity_Player::RemoveGoldenBomb /* ZHL [lua] Lua binding EntityPlayer:RemoveGoldenBomb */ void Entity_Player::RemoveGoldenBomb(void) { Game *pGVar1; Entity_Player *in_ECX; in_ECX->_hasGoldenBomb = 0; ConsumableCountChanged(in_ECX,0x10); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007c9000 Entity_Player::AddDollarBillEffect /* ZHL [lua] Lua binding EntityPlayer:AddDollarBillEffect */ void __thiscall Entity_Player::AddDollarBillEffect(Entity_Player *this) { int id; Manager *pMVar1; uint uVar2; ItemConfig_Item *pIVar3; ItemConfig_Item *pIVar4; uVar2 = Random(); pMVar1 = g_manager; id = *(int *)(&DAT_00b6bb50 + (uVar2 % 0x26) * 4); pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,this->_threeDollarBillItem); pIVar4 = ItemConfig::GetCollectible(&pMVar1->_itemConfig,id); this->_threeDollarBillItem = id; if (pIVar3 != (ItemConfig_Item *)0x0) { this->_cacheFlags = this->_cacheFlags | pIVar3->cacheFlags; } if (pIVar4 != (ItemConfig_Item *)0x0) { this->_cacheFlags = this->_cacheFlags | pIVar4->cacheFlags; } EvaluateItems(); return; } //@@ 007c9080 FUN_007c9080 char FUN_007c9080(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x1934); if (iVar1 < 0xf) { return '\0'; } if (iVar1 < 0x1e) { return '\x01'; } if (iVar1 < 0x3c) { return '\x02'; } return (0x59 < iVar1) + '\x03'; } //@@ 007c90b0 Entity_Player::GetCambionPregnancyLevel /* ZHL [exact] __thiscall int Entity_Player::GetCambionPregnancyLevel(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Player::GetCambionPregnancyLevel(Entity_Player *this) { int iVar1; iVar1 = this->_cambionConceptionState; if (0xe < iVar1) { if (0x1d < iVar1) { if (iVar1 < 0x3c) { return (iVar1 + -0x1e) / 10; } if (iVar1 < 0x5a) { return (iVar1 + -0x3c) / 10; } if (iVar1 < 99) { return (iVar1 + -0x5a) / 3; } return 0; } iVar1 = iVar1 + -0xf; } return iVar1 / 5; } //@@ 007c9130 Entity_Player::ShootRedCandle /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity* Entity_Player::ShootRedCandle(Vector * dir); prototype: REPENTOGON, confirmed by RET 4 */ Entity * __thiscall Entity_Player::ShootRedCandle(Entity_Player *this,Vector *dir) { Manager *pMVar1; byte bVar2; uint uVar3; Entity *pEVar4; NetplayManager *this_00; float fVar5; float fVar6; undefined4 uVar7; Vector local_c0; Vector VStack_b8; float fStack_b0; float fStack_ac; float fStack_a8; float fStack_a4; float fStack_a0; undefined8 uStack_9c; float fStack_94; undefined1 local_78 [52]; float fStack_44; uint local_c; local_c = __security_cookie ^ (uint)&local_c0; uVar7 = 0; uVar3 = Random(); local_c0.x = 1.0; fVar6 = 1.4013e-45; GetTearHitParams(local_78,1,0x3f800000,(uVar3 & 1) * 2 + -1,uVar7); GetTearMovementInheritance(this,&local_c0,dir,0); uVar3 = Random(); pEVar4 = Game::SpawnEx(g_game,1000,0x34,&this->_pos,(Vector *)(local_78 + -0x50),(Entity *)this,0, uVar3,0); (**(code **)(*(int *)pEVar4 + 0x40))((fStack_44 * 4.0 * this->_meleeDamage) / this->_damage); pMVar1 = g_manager; this_00 = &g_manager->_netplayManager; fVar5 = fStack_44 * g_vectorOne.y; (pEVar4->_sprite)._scale.x = fStack_44 * g_vectorOne.x; (pEVar4->_sprite)._scale.y = fVar5; if (*this_00 != *(NetplayManager *)(pMVar1 + 1)) { bVar2 = NetplayManager::IsIdxLocalPlayer(this_00,this->_controllerIndex); if (bVar2 == 0) { local_c0.y = (pEVar4->_sprite)._color._tint[0]; VStack_b8.x = (pEVar4->_sprite)._color._tint[1]; VStack_b8.y = (pEVar4->_sprite)._color._tint[2]; fStack_94 = (pEVar4->_sprite)._color._offset[2]; fStack_ac = (pEVar4->_sprite)._color._colorize[0]; fStack_a8 = (pEVar4->_sprite)._color._colorize[1]; fStack_a4 = (pEVar4->_sprite)._color._colorize[2]; fStack_a0 = (pEVar4->_sprite)._color._colorize[3]; uStack_9c = *(undefined8 *)(pEVar4->_sprite)._color._offset; if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { fVar6 = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } fStack_b0 = (pEVar4->_sprite)._color._tint[3] * fVar6; (**(code **)(*(int *)pEVar4 + 0x3c))(&local_c0.y,0xffffffff,0xff,0,1); } } (**(code **)(*(int *)pEVar4 + 0xc))(); return pEVar4; } //@@ 007c9350 Entity_Player::ShootBlueCandle /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity* Entity_Player::ShootBlueCandle(Vector * dir); prototype: REPENTOGON, confirmed by RET 4 */ Entity * __thiscall Entity_Player::ShootBlueCandle(Entity_Player *this,Vector *dir) { ANM2 *pAVar1; Manager *pMVar2; byte bVar3; uint uVar4; Entity *pEVar5; NetplayManager *this_00; float fVar6; float fVar7; undefined4 uVar8; Vector local_c0; Vector VStack_b8; float fStack_b0; float fStack_ac; float fStack_a8; float fStack_a4; float fStack_a0; undefined8 uStack_9c; float fStack_94; undefined1 local_78 [52]; float fStack_44; uint local_c; local_c = __security_cookie ^ (uint)&local_c0; uVar8 = 0; uVar4 = Random(); local_c0.x = 1.0; fVar7 = 1.4013e-45; GetTearHitParams(local_78,1,0x3f800000,(uVar4 & 1) * 2 + -1,uVar8); GetTearMovementInheritance(this,&local_c0,dir,0); uVar4 = Random(); pEVar5 = Game::SpawnEx(g_game,1000,10,&this->_pos,(Vector *)(local_78 + -0x50),(Entity *)this,0, uVar4,0); (**(code **)(*(int *)pEVar5 + 0x40))((fStack_44 * 6.0 * this->_meleeDamage) / this->_damage); pMVar2 = g_manager; pAVar1 = &pEVar5[1]._sprite; (pAVar1->_filename)._buf[8] = '<'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; this_00 = &pMVar2->_netplayManager; pAVar1 = &pEVar5[1]._sprite; (pAVar1->_filename)._buf[0xc] = '<'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; fVar6 = fStack_44 * g_vectorOne.y; fStack_44 = fStack_44 * g_vectorOne.x; pEVar5->_entityGridCollisionClass = 0; (pEVar5->_sprite)._scale.y = fVar6; (pEVar5->_sprite)._scale.x = fStack_44; if (*this_00 != *(NetplayManager *)(pMVar2 + 1)) { bVar3 = NetplayManager::IsIdxLocalPlayer(this_00,this->_controllerIndex); if (bVar3 == 0) { local_c0.y = (pEVar5->_sprite)._color._tint[0]; VStack_b8.x = (pEVar5->_sprite)._color._tint[1]; VStack_b8.y = (pEVar5->_sprite)._color._tint[2]; fStack_94 = (pEVar5->_sprite)._color._offset[2]; fStack_ac = (pEVar5->_sprite)._color._colorize[0]; fStack_a8 = (pEVar5->_sprite)._color._colorize[1]; fStack_a4 = (pEVar5->_sprite)._color._colorize[2]; fStack_a0 = (pEVar5->_sprite)._color._colorize[3]; uStack_9c = *(undefined8 *)(pEVar5->_sprite)._color._offset; if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { fVar7 = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } fStack_b0 = (pEVar5->_sprite)._color._tint[3] * fVar7; (**(code **)(*(int *)pEVar5 + 0x3c))(&local_c0.y,0xffffffff,0xff,0,1); } } (**(code **)(*(int *)pEVar5 + 0xc))(); return pEVar5; } //@@ 007c9590 Entity_Player::DoZitEffect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:DoZitEffect */ void Entity_Player::DoZitEffect(Vector *param_1) { BitSet128 flags; uint uVar1; float *extraout_EAX; Entity *pEVar2; Entity_Tear *this; Entity_Player *in_ECX; int iVar3; undefined1 auStack_54 [4]; float local_50; float local_4c; Vector local_48; Vector local_40; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_54; uVar1 = Random(); for (iVar3 = uVar1 % 3 + 1; iVar3 != 0; iVar3 = iVar3 + -1) { local_4c = (float)Random(); uVar1 = Random(); local_50 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10; local_48.x = sqrtf(param_1->x * param_1->x + param_1->y * param_1->y); if (local_48.x <= 0.0) { local_48.x = param_1->x; local_48.y = param_1->y; } else { local_48.x = (local_50 * 75.0 + 10.0) / local_48.x; local_48.y = local_48.x * param_1->y; local_48.x = local_48.x * param_1->x; } local_48.x = local_48.x + (in_ECX->_pos).x; local_48.y = local_48.y + (in_ECX->_pos).y; Game::SpawnEx(g_game,1000,0x2c,&local_48,&g_vectorZero,(Entity *)in_ECX,0,(uint)local_4c,0); } local_4c = param_1->x; local_50 = param_1->y; GetTearMovementInheritance(in_ECX,&local_40,param_1,0); local_48.x = (local_4c * 10.0 + *extraout_EAX) * in_ECX->_shotspeed; local_48.y = (local_50 * 10.0 + extraout_EAX[1]) * in_ECX->_shotspeed; uVar1 = Random(); pEVar2 = Game::SpawnEx(g_game,2,0,&in_ECX->_pos,&local_48,(Entity *)in_ECX,0,uVar1,0); this = (Entity_Tear *) __RTDynamicCast(pEVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0); uStack_18 = 0x3f333333; uStack_14 = 0x3f333333; uStack_10 = 0x3f333333; uStack_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_38 = 0x3e99999a; uStack_34 = 0x3e99999a; uStack_30 = 0x3e99999a; uStack_2c = 0x3f800000; (**(code **)(*(int *)this + 0x3c))(&uStack_38,0xffffffff,0xff,0,1); (**(code **)(*(int *)this + 0x40))(in_ECX->_damage + in_ECX->_damage); flags._l._4_4_ = DAT_00c34c34; flags._l._0_4_ = DAT_00c34c30; flags._h._0_4_ = DAT_00c34c38; flags._h._4_4_ = DAT_00c34c3c; Entity_Tear::SetTearFlags(this,flags); this->_baseScale = 0.5; this->_fScale = 0.5; Entity_Tear::ResetSpriteScale(this); (**(code **)(*(int *)this + 0xc))(); return; } //@@ 007c97f0 Entity_Player::apply_victory_lap_penalty /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x007c9a76) */ /* WARNING: Removing unreachable block (ram,0x007c9a88) */ /* WARNING: Removing unreachable block (ram,0x007c9a98) */ /* WARNING: Removing unreachable block (ram,0x007c9a9e) */ /* DB: thiscall Entity_Player, only caller Game::NextVictoryLap (0x6f7cac); branches on g_game->_victoryLap==2 / >=3: caps max hearts to 6 (AddMaxHearts), removes collectibles, RemoveSkinCostume, EvaluateItems, UpdateCanShoot */ void Entity_Player::apply_victory_lap_penalty(uint param_1) { code *pcVar1; uint uVar2; Entity_Player *in_ECX; uint uVar3; void *historyItem; undefined4 *itemsEnd; float removeFraction; undefined4 *local_3c; int shuffleIndex; undefined4 *local_2c; uint remaining; uint swapIndex; uint i; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 swapTmp; local_8 = 0xffffffff; puStack_c = &LAB_00b0008d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; if (g_game->_victoryLap == 2) { ExceptionList = &local_10; if (6 < in_ECX->_maxHearts) { AddMaxHearts(in_ECX,6 - in_ECX->_maxHearts,0); } removeFraction = 0.5; } else { if (g_game->_victoryLap < 3) { return; } ExceptionList = &local_10; RemoveSkinCostume(in_ECX); in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff; in_ECX->_maxHearts = 0; in_ECX->_redHearts = 0; in_ECX->_soulHearts = 1; in_ECX->_blackHearts = 0; in_ECX->_boneHeartsMask = 0; in_ECX->_boneHearts = 0; in_ECX->_eternalHearts = 0; in_ECX->_playerType = 10; EvaluateItems(); update_player_skin(in_ECX); UpdateCanShoot(in_ECX); if (g_game->_victoryLap < 4) { ExceptionList = local_10; return; } removeFraction = 0.75; } itemsEnd = (undefined4 *)0x0; local_2c = (undefined4 *)0x0; local_3c = (undefined4 *)0x0; local_8 = 0; historyItem = (in_ECX->_history)._historyItems._begin; if (historyItem != (in_ECX->_history)._historyItems._end) { do { if (*(char *)((int)historyItem + 4) == '\0') { if (itemsEnd == (undefined4 *)0x0) { std::vector::_Emplace_reallocate(0,(undefined4 *)((int)historyItem + 8)); itemsEnd = local_3c; } else { *itemsEnd = *(undefined4 *)((int)historyItem + 8); local_3c = itemsEnd + 1; itemsEnd = local_3c; } } historyItem = (void *)((int)historyItem + 0x1c); } while (historyItem != (in_ECX->_history)._historyItems._end); local_2c = itemsEnd; } uVar3 = (int)local_2c >> 2; shuffleIndex = uVar3 - 1; if (0 < shuffleIndex) { remaining = uVar3; do { if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } param_1 = param_1 >> 4 ^ param_1; param_1 = param_1 << 5 ^ param_1; param_1 = param_1 >> 0xf ^ param_1; if (remaining == 0) { swapIndex = 0; } else { swapIndex = param_1 % remaining; } remaining = remaining - 1; swapTmp = *(undefined4 *)(shuffleIndex * 4); *(undefined4 *)(shuffleIndex * 4) = *(undefined4 *)(swapIndex * 4); shuffleIndex = shuffleIndex + -1; *(undefined4 *)(swapIndex * 4) = swapTmp; } while (0 < shuffleIndex); } floor((double)((float)((double)(int)(uVar3 + 1) + __uint_to_double_fixup[-((int)(uVar3 + 1) >> 0x1f)]) * removeFraction)); uVar2 = __ftoui3(uVar2); if (uVar2 < uVar3) { uVar3 = uVar2; } i = 0; if (uVar3 != 0) { do { RemoveCollectible(in_ECX,*(uint *)(i * 4),0,0,1); i = i + 1; } while (i < uVar3); } ExceptionList = local_10; return; } //@@ 007c9ad0 Entity_Player::get_voice_pitch /* DB: thiscall float: 1.0 (variant 0) or 1.5 (co-op baby) + 0.1*count, +0.5 with Pluto 598 or Inner Child 688 effect, +0.2 Binky 438, -0.2 when +0x1808>=3 unless curse mist/coop ghost, clamped [0.5,2.0]; try_end_astral_projection passes it as the pitch of SoundEffects::Play right after; also TakeDamage prototype: db/protos.zhl */ float __thiscall Entity_Player::get_voice_pitch(Entity_Player *this) { void *pvVar1; byte bVar2; float local_c; if (this->_variant == 0) { local_c = 1.0; } else { local_c = 1.5; } pvVar1 = (this->_pillEffectUses)._begin; local_c = (float)(*(int *)((int)pvVar1 + 0x84) - *(int *)((int)pvVar1 + 0x80)) * 0.1 + local_c; bVar2 = HasCollectible(this,0x256,0); if (bVar2 == 0) { bVar2 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x2b0); if (bVar2 == 0) goto LAB_007c9b57; } local_c = local_c + 0.5; LAB_007c9b57: bVar2 = HasCollectible(this,0x1b6,0); if (bVar2 != 0) { local_c = local_c + 0.2; } if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && (2 < this->_playerForms[0xb])) { local_c = local_c - 0.2; } if (local_c <= 0.5) { local_c = 0.5; } if (2.0 <= local_c) { local_c = 2.0; } return local_c; } //@@ 007c9bb0 Entity_Player::AddJarFlies /* ZHL [exact] __thiscall void Entity_Player::AddJarFlies(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddJarFlies(Entity_Player *this,int amount) { Game *pGVar1; int iVar2; int iVar3; iVar3 = this->_jarFlies + amount; iVar2 = 0x14; if (iVar3 < 0x14) { iVar2 = iVar3; } this->_jarFlies = iVar2; pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007c9c00 Entity_Player::IsPosInSpotLight /* ZHL [lua] Lua binding EntityPlayer:IsPosInSpotLight */ undefined4 __thiscall Entity_Player::IsPosInSpotLight(Entity_Player *this,float *param_2) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float x; fVar1 = *param_2 - (this->_pos).x; fVar2 = param_2[1] - (this->_pos).y; fVar3 = this->_bodyAngle * 0.017453292; fVar4 = cos(fVar3); fVar3 = sin(fVar3); x = fVar1 * fVar1 + fVar2 * fVar2; fVar5 = sqrtf(x); if (0.0 < fVar5) { fVar1 = fVar1 * (1.0 / fVar5); fVar2 = fVar2 * (1.0 / fVar5); } if (x < 40000.0) { fVar2 = fVar1 * fVar4 + fVar3 * fVar2; FUN_00652a70(); if (fVar2 * 57.295776 < 20.0) { return 1; } } return 0; } //@@ 007c9d10 Entity_Player::AddGoldenHearts /* ZHL [exact] __thiscall void Entity_Player::AddGoldenHearts(int amount, bool retBool); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddGoldenHearts(Entity_Player *this,int amount,byte retBool) { int iVar1; EntityPtr EVar2; EntityPtr *pEVar3; int iVar4; uint uVar5; int iVar6; iVar1 = this->_playerType; while ((iVar1 == 0x28 && (EVar2 = *(EntityPtr *)((int)this + 0x1e68), EVar2 != (EntityPtr)0x0))) { retBool = 0; iVar1 = *(int *)((int)EVar2 + 0x13c0); this = (Entity_Player *)EVar2; } iVar1 = *(int *)((int)this + 0x13c0); if ((((iVar1 == 10) || (iVar1 == 0x1f)) || (iVar1 == 0xe)) || (iVar1 == 0x21)) { BreakGoldenHearts(this,1); } else { if (1 < *(int *)&g_game->_deathmatchManager) { ClampHeartsToLimit(this,7,amount * 2); return; } iVar1 = *(int *)((int)this + 0x194c); iVar4 = *(int *)((int)this + 0x1344); if (*(int *)((int)this + 0x1340) < *(int *)((int)this + 0x1344)) { iVar4 = *(int *)((int)this + 0x1340); } iVar6 = amount + iVar1; iVar4 = (iVar4 + 1) / 2 + (*(int *)((int)this + 0x134c) + 1) / 2 + *(int *)((int)this + 0x1d88); if (iVar4 < iVar6) { iVar6 = iVar4; } iVar4 = 0; if (0 < iVar6) { iVar4 = iVar6; } *(int *)((int)this + 0x194c) = iVar4; ClampGoldenHearts(this,retBool); if (iVar1 < *(int *)((int)this + 0x194c)) { pEVar3 = (EntityPtr *)&g_game->_hud; uVar5 = 0; do { if (*pEVar3 == (EntityPtr)this) { pEVar3[3].field_0x2 = 4; return; } uVar5 = uVar5 + 1; pEVar3 = pEVar3 + 0x1b7; } while (uVar5 < 8); return; } } return; } //@@ 007c9e30 Entity_Player::CanPickGoldenHearts /* ZHL [lua] Lua binding EntityPlayer:CanPickGoldenHearts */ undefined4 __thiscall Entity_Player::CanPickGoldenHearts(Entity_Player *this) { int iVar1; int iVar2; if (1 < *(int *)&g_game->_deathmatchManager) { return CONCAT31((int3)((uint)g_game >> 8),this->_maxHearts < 0xa0); } while ((*(int *)((int)this + 0x13c0) == 0x28 && (*(EntityPtr *)((int)this + 0x1e68) != (EntityPtr)0x0))) { this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } iVar1 = *(int *)((int)this + 0x1344); if (*(int *)((int)this + 0x1340) < *(int *)((int)this + 0x1344)) { iVar1 = *(int *)((int)this + 0x1340); } iVar2 = (*(int *)((int)this + 0x134c) + 1) / 2; return CONCAT31((int3)((uint)iVar2 >> 8), *(int *)((int)this + 0x194c) < (iVar1 + 1) / 2 + iVar2 + *(int *)((int)this + 0x1d88)); } //@@ 007c9ea0 Entity_Player::UpdateHeartDependentEffects /* DB: ? called after every heart change; Whore of Babylon/Crown of Light effects, rotten clamp prototype: db/protos.zhl */ void __thiscall Entity_Player::UpdateHeartDependentEffects(Entity_Player *this) { byte isOwned; int iVar1; int *entitySlot; int iVar2; int iVar3; Game *game; float redHeartRatio; char *pcVar4; int nullEffect [3]; undefined4 local_c; void *nullItems; if (*(int *)&g_game->_deathmatchManager < 2) { iVar3 = this->_redHearts; iVar1 = (iVar3 + 1) / 2; iVar2 = this->_rottenHearts; if (iVar1 < this->_rottenHearts) { iVar2 = iVar1; } this->_rottenHearts = iVar2; if (iVar3 < iVar2 * 2) { iVar3 = iVar2 * 2; } this->_redHearts = iVar3; } update_greeds_gullet(this); game = g_game; if (((this->_dead == 0) && (this->_playerType == 0x1a)) && (this->_boneHearts + this->_goldenHearts + this->_soulHearts + this->_eternalHearts + this->_redHearts == 1)) { pcVar4 = g_game->_room; if (((*pcVar4 != '\0') && (1 < g_game->_frameCount - *(int *)(pcVar4 + 0x11f0))) && (isOwned = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x6e), isOwned == 0)) { iVar3 = *(int *)(pcVar4 + 0x1254); iVar2 = 0; if (iVar3 != 0) { entitySlot = *(int **)((int)game->_room + 0x124c); do { iVar1 = *entitySlot; if (((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 3)) && ((*(Entity_Player **)(iVar1 + 0x410) == this && (((*(int *)(iVar1 + 0x2c) == 0xee && (*(int *)(iVar1 + 0x30) != 7)) && (*(char *)(iVar1 + 0x173) == '\0')))))) { iVar2 = iVar2 + 1; } entitySlot = entitySlot + 1; iVar3 = iVar3 + -1; } while (iVar3 != 0); if (iVar2 != 0) goto LAB_007ca02e; } ItemOverlay::Show(&game->_itemOverlay,3,3,(Entity_Player *)0x0); nullItems = (g_manager->_itemConfig)._nullItems._begin; if ((0x1b8 < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)nullItems & 0xfffffffcU)) && (iVar3 = *(int *)((int)nullItems + 0x1b8), iVar3 != 0)) { nullEffect[2] = *(undefined4 *)(iVar3 + 0x78); nullEffect[1] = 0; local_c = 0; nullEffect[0] = iVar3; TemporaryEffects::AddEffect(&this->_temporaryeffects,nullEffect,1,1); } goto LAB_007ca028; } } else { LAB_007ca028: game = g_game; } LAB_007ca02e: iVar3 = *(int *)&game->_deathmatchManager; iVar2 = (1 < iVar3) + 1; if (this->_dead == 0) { if (1 < iVar3) { iVar2 = iVar2 * 8; } if (iVar2 < this->_redHearts) { if (this->_playerType == 5) { iVar2 = 0x10; if (iVar3 < 2) { iVar2 = 2; } if (iVar2 < this->_redHearts) { isOwned = HasCollectible(this,0x26b,0); if (isOwned == 0) goto LAB_007ca100; game = g_game; } if ((*(char *)game->_room != '\0') && (1 < game->_frameCount - *(int *)((int)game->_room + 0x11f0))) goto LAB_007ca0b0; } } else { LAB_007ca0b0: isOwned = HasCollectible(this,0x7a,0); if ((isOwned != 0) && (isOwned = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x7a), isOwned == 0)) { if (this->_postLevelInitFinished != 0) { ItemOverlay::Show(&g_game->_itemOverlay,3,3,(Entity_Player *)0x0); } TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x7a,1,1); } } } LAB_007ca100: isOwned = HasCollectible(this,0x19f,0); if (isOwned != 0) { if (*(int *)&g_game->_deathmatchManager < 2) { if ((this->field_0x13b5 != '\0') || (isOwned = HasFullHearts(this), isOwned == 0)) goto LAB_007ca198; LAB_007ca169: isOwned = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x19f); if (isOwned != 0) goto LAB_007ca1c8; TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x19f,1,1); pcVar4 = "FloatGlow"; } else { if (0.8 <= (float)this->_redHearts / (float)this->_maxHearts) goto LAB_007ca169; LAB_007ca198: isOwned = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x19f); if (isOwned == 0) goto LAB_007ca1c8; TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x19f,1); pcVar4 = "FloatNoGlow"; } ANM2::Play(&this->_crownOfLightSprite,(byte *)pcVar4,0); } LAB_007ca1c8: isOwned = HasCollectible(this,0x1ba,0); if (isOwned == 0) goto LAB_007ca260; if (*(int *)&g_game->_deathmatchManager < 2) { if (this->_redHearts == 2) goto LAB_007ca2a6; LAB_007ca230: isOwned = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1ba); if (isOwned == 0) goto LAB_007ca260; TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x1ba,1); pcVar4 = "FloatNoGlow"; } else { redHeartRatio = (float)this->_redHearts / (float)this->_maxHearts; if ((redHeartRatio < 0.1) || (0.3 < redHeartRatio)) goto LAB_007ca230; LAB_007ca2a6: isOwned = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1ba); if (isOwned != 0) goto LAB_007ca260; TemporaryEffects::AddCollectibleEffect(&this->_temporaryeffects,0x1ba,1,1); pcVar4 = "FloatGlow"; } ANM2::Play(&this->_darkPrincesCrownSprite,(byte *)pcVar4,0); LAB_007ca260: isOwned = HasCollectible(this,0x1ed,0); if ((isOwned != 0) || (isOwned = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x1ed), isOwned != 0 )) { this->_cacheFlags = this->_cacheFlags | 1; EvaluateItems(); } return; } //@@ 007ca2d0 Entity_Player::BreakGoldenHearts /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ?count>0: plays sound, spawns coins 5.20 + midas freeze, UltraGreedCoins anm2, CrumbleNoDebris prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::BreakGoldenHearts(Entity_Player *this,int count) { Vector *position; qword qVar1; ANM2 *pAVar2; byte bVar3; uint uVar4; Entity *effect; byte *curAnimName; char *pcVar5; Entity_Player *self; undefined1 *size; int *piVar6; qword *allocCounter; bool isLess; EntityList_EL nearbyEnemies; Vector coinPos; Vector randomVelocity; Vector coinVelocity; Entity *local_5c; Entity_Player *player; ANM2 *local_54; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; char *pcStack_3c; float fStack_38; float fStack_34; float local_30; float local_2c; undefined1 *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; Entity_Player *enemy; Manager *manager; int vtable; manager = g_manager; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00b000d5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); if (count < 1) { return; } local_54 = (ANM2 *)0x1ab; ExceptionList = &local_1c; player = this; seed_fart_sound_override((int *)&local_54); SoundEffects::Play(&manager->_sfxManager,(int)local_54,1.0,2,0,1.0,0.0); uVar4 = Random(); effect = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar4); local_2c = 0.0; local_28 = &DAT_0000000f; pcStack_3c = (char *)0x0; local_5c = effect; local_54 = &effect->_sprite; pcStack_3c = std::_Allocate(0x30); local_2c = 4.48416e-44; local_28 = &DAT_0000002f; builtin_strncpy(pcStack_3c,"gfx/293.000_UltraGreedCoins.anm2",0x21); local_14 = 0; ANM2::Load(&effect->_sprite,(std_string *)&pcStack_3c,1); local_14 = 0xffffffff; if (&DAT_0000000f < local_28) { size = local_28 + 1; pcVar5 = pcStack_3c; if ((undefined1 *)0xfff < size) { pcVar5 = *(char **)(pcStack_3c + -4); size = local_28 + 0x24; if ((char *)0x1f < pcStack_3c + (-4 - (int)pcVar5)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,(uint)size); } pAVar2 = local_54; animData = (effect->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } pcVar5 = "CrumbleNoDebris"; do { bVar3 = *curAnimName; isLess = bVar3 < (byte)*pcVar5; if (bVar3 != *pcVar5) { LAB_007ca463: uVar4 = -(uint)isLess | 1; goto LAB_007ca468; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; isLess = bVar3 < (byte)pcVar5[1]; if (bVar3 != pcVar5[1]) goto LAB_007ca463; curAnimName = curAnimName + 2; pcVar5 = pcVar5 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_007ca468: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((local_54->_animState)._isPlaying != 0)))) goto LAB_007ca49c; } bVar3 = ANM2::SetAnimation(local_54,(byte *)"CrumbleNoDebris",1); if (bVar3 != 0) { AnimationState::Rewind(&pAVar2->_animState); (pAVar2->_animState)._isPlaying = 1; } LAB_007ca49c: (**(code **)(*(int *)local_5c + 0xc))(); uVar4 = Random(); position = &this->_pos; effect = Game::Spawn(g_game,1000,0x12,position,&g_vectorZero,(Entity *)0x0,0,uVar4); vtable = *(int *)effect; (effect->_sprite)._color._colorize[0] = 10.0; (effect->_sprite)._color._colorize[1] = 7.5; (effect->_sprite)._color._colorize[2] = 0.0; (effect->_sprite)._color._colorize[3] = 1.0; (**(code **)(vtable + 0xc))(); pAVar2 = local_54; do { local_54 = pAVar2; local_5c = (Entity *)(this->_posOffset).y; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; fStack_44 = 1.0; local_30 = 0.0; local_2c = 0.0; local_40 = 0.0; pcStack_3c = (char *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_28 = (undefined1 *)0x0; uVar4 = Random(); Game::SpawnParticles (g_game,position,0x5f,10, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 12.0 + 8.0,(ColorMod *)local_50,(float)local_5c,0); uVar4 = Random(); piVar6 = (int *)(uVar4 % 6); while (local_54 = (ANM2 *)((int)piVar6 + 3), local_54 != (ANM2 *)0x0) { Isaac::GetRandomPickupVelocity(&randomVelocity,position,0,(RNG *)0x0); uVar4 = Random(); coinVelocity.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.66 + 0.33; coinVelocity.x = randomVelocity.x * coinVelocity.y; coinVelocity.y = randomVelocity.y * coinVelocity.y; uVar4 = Random(); coinPos.x = coinVelocity.x + position->x; coinPos.y = coinVelocity.y + (this->_pos).y; Game::Spawn(g_game,5,0x14,&coinPos,&coinVelocity,(Entity *)this,0,uVar4); piVar6 = &local_54[-1]._bitflags; } count = count + -1; pAVar2 = (ANM2 *)0x0; } while (count != 0); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEnemies,position,80.0,8); uVar4 = 0; local_14 = 1; if (nearbyEnemies._size != 0) { self = player; do { enemy = *(Entity_Player **)((int)nearbyEnemies._data + uVar4 * 4); if ((((1 < *(int *)&g_game->_deathmatchManager) && (enemy->_type == 1)) || (enemy->_type - 10U < 0x3de)) && (enemy != self)) { enemy->_bossStatusEffectCooldown = 0; Entity::CopyStatusEffects((Entity *)enemy); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)player); Entity::AddMidasFreeze((Entity *)enemy,(EntityRef *)(local_50 + 4),0xb4,0); if ((enemy->_flags & 0x400) != 0) { local_30 = 1.0; local_40 = 0.0; pcStack_3c = (char *)0x0; fStack_38 = 0.0; fStack_34 = 0.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; fStack_48 = 1.0; fStack_44 = 1.0; local_2c = 0.9; local_28 = (undefined1 *)0x0; (**(code **)(*(int *)enemy + 0x3c))(local_50,0xf,0xff,1,1); } self = player; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)nearbyEnemies._size); } if (nearbyEnemies._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEnemies._data != (void *)0x0) { uVar4 = *(uint *)((int)nearbyEnemies._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); free((void *)((int)nearbyEnemies._data + -4)); } } ExceptionList = local_1c; return; } //@@ 007ca7c0 Entity_Player::ClampGoldenHearts /* DB: caps golden hearts (0x194c) to heart containers count; called from AddMaxHearts/AddHearts/AddSoulHearts/RemoveBlackHeart prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::ClampGoldenHearts(Entity_Player *this,byte isSkipBreak) { int iVar1; int iVar2; if (((*(int *)&g_game->_deathmatchManager < 2) && (this->_dead == 0)) && (iVar1 = this->_goldenHearts, 0 < iVar1)) { iVar2 = this->_redHearts; if (this->_maxHearts < this->_redHearts) { iVar2 = this->_maxHearts; } iVar2 = (iVar2 + 1) / 2 + (this->_soulHearts + 1) / 2 + this->_boneHearts; if (iVar2 < iVar1) { if (isSkipBreak == 0) { BreakGoldenHearts(this,iVar1 - iVar2); } this->_goldenHearts = iVar2; } } return; } //@@ 007ca840 Entity_Player::AddBoneHearts /* ZHL [exact] __thiscall void Entity_Player::AddBoneHearts(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddBoneHearts(Entity_Player *this,int amount) { uint uVar1; int iVar2; Entity_Player *this_00; int iVar3; uint uVar4; int extraout_EDX; while( true ) { while ((*(int *)((int)this + 0x13c0) == 0x28 && (*(EntityPtr *)((int)this + 0x1e68) != (EntityPtr)0x0))) { this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } iVar2 = GetHealthType(this); if (iVar2 == 2) { return; } iVar2 = GetHealthType(this_00); if (iVar2 == 3) { if (amount < 1) { return; } AddBlueFlies(this,amount * 4,(Vector *)((int)this + 0x33c),(Entity *)0x0); return; } if (extraout_EDX != 0x11) break; this = *(Entity_Player **)((int)this + 0x1d98); if ((EntityPtr)this == (EntityPtr)0x0) { return; } } if (1 < *(int *)&g_game->_deathmatchManager) { ClampHeartsToLimit(this,0xb,amount * 2); UpdateHeartDependentEffects(this); return; } if (amount < 0) { iVar2 = GetHealthType(this); if (iVar2 == 4) { trigger_max_hearts_removed(this,amount * -2); } iVar3 = *(int *)((int)this + 0x1d88) + amount; iVar2 = 0; if (0 < iVar3) { iVar2 = iVar3; } *(int *)((int)this + 0x1d88) = iVar2; iVar3 = GetEffectiveMaxHearts(this); iVar2 = *(int *)((int)this + 0x1344); if (iVar3 < *(int *)((int)this + 0x1344)) { iVar2 = iVar3; } *(int *)((int)this + 0x1344) = iVar2; update_bone_hearts(this); UpdateHeartDependentEffects(this); return; } iVar2 = *(int *)((int)this + 0x134c); iVar3 = GetHeartLimit(this,0); iVar3 = (iVar2 + (*(int *)((int)this + 0x1d88) + amount) * 2 + *(int *)((int)this + 0x1340)) - iVar3; if (iVar3 < iVar2) { iVar2 = iVar3; } if (0 < iVar2) { AddSoulHearts(this,-iVar2,0); } iVar2 = GetHeartLimit(this,0); iVar2 = iVar2 / 2 - (*(int *)((int)this + 0x1340) + 1 + *(int *)((int)this + 0x134c) + *(int *)((int)this + 0x1d88) * 2 >> 1); if (iVar2 < amount) { amount = iVar2; } if (amount < 1) { return; } iVar2 = *(int *)((int)this + 0x1d88); uVar4 = *(uint *)((int)this + 0x1d8c); *(int *)((int)this + 0x1d88) = iVar2 + amount; iVar3 = 0; do { uVar1 = iVar3 + (*(int *)((int)this + 0x134c) + 1 >> 1) + iVar2; iVar3 = iVar3 + 1; uVar4 = uVar4 | 1 << (uVar1 & 0x1f); } while (iVar3 < amount); *(uint *)((int)this + 0x1d8c) = uVar4; UpdateHeartDependentEffects(this); return; } //@@ 007caa00 Entity_Player::CanPickBoneHearts /* ZHL [lua] Lua binding EntityPlayer:CanPickBoneHearts */ uint __thiscall Entity_Player::CanPickBoneHearts(Entity_Player *this) { uint uVar1; int iVar2; Entity_Player *this_00; int extraout_EDX; if (1 < *(int *)&g_game->_deathmatchManager) { return CONCAT31((int3)((uint)g_game >> 8),this->_maxHearts < 0xa0); } while( true ) { while (*(int *)((int)this + 0x13c0) != 0x28) { if ((*(int *)((int)this + 0x13c0) != 0x11) || (*(EntityPtr *)((int)this + 0x1d98) == (EntityPtr)0x0)) goto LAB_007caa4c; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1d98); } if (*(EntityPtr *)((int)this + 0x1e68) == (EntityPtr)0x0) break; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } LAB_007caa4c: uVar1 = GetHealthType(this); if ((uVar1 != 2) && (extraout_EDX != 0x11)) { iVar2 = GetHeartLimit(this_00,0); uVar1 = iVar2 / 2; if (*(int *)((int)this + 0x1340) + *(int *)((int)this + 0x1d88) * 2 >> 1 < (int)uVar1) { return CONCAT31((int3)(uVar1 >> 8),1); } } return uVar1 & 0xffffff00; } //@@ 007caaa0 Entity_Player::IsBoneHeart /* ZHL [lua] Lua binding EntityPlayer:IsBoneHeart */ uint __thiscall Entity_Player::IsBoneHeart(Entity_Player *this,byte param_2) { uint in_EAX; if ((this->_boneHearts < 1) || (in_EAX = 1 << (param_2 & 0x1f), (this->_boneHeartsMask & in_EAX) == 0)) { return in_EAX & 0xffffff00; } return CONCAT31((int3)(in_EAX >> 8),1); } //@@ 007caad0 Entity_Player::TryPreventDeath /* ZHL [exact] __thiscall bool Entity_Player::TryPreventDeath(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::TryPreventDeath(Entity_Player *this) { int iVar1; Entity_Player *this_00; byte unk; byte unk2; if (this->_boneHearts + this->_redHearts + this->_soulHearts != 0) { return 0; } iVar1 = GetHealthType(this); switch(iVar1) { case 0: if (this->_playerType == 0x12) { if (this->_maxHearts < 2) { AddMaxHearts(this_00,2,0); } AddHearts(this,1,1,0); return 1; } if (0 < this->_maxHearts) { unk2 = 0; unk = 1; iVar1 = scale_for_hard_difficulty(1); AddHearts(this,iVar1,unk,unk2); return 1; } break; case 3: if (this->_maxHearts < 2) { AddMaxHearts(this_00,2,0); } AddHearts(this,2,1,0); return 1; case 4: AddBoneHearts(this_00,1); return 1; } this->_soulHearts = 1; return 1; } //@@ 007cabc0 Entity_Player::update_bone_hearts /* ZHL [exact] __thiscall void Entity_Player::update_bone_hearts(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::update_bone_hearts(Entity_Player *this) { byte bVar1; int iVar2; int iVar3; uint uVar4; uint uVar5; uint uVar6; if (*(int *)&g_game->_deathmatchManager < 2) { iVar2 = GetHeartLimit(this,0); iVar3 = iVar2 / 2 - (this->_maxHearts + 1 + this->_soulHearts >> 1); iVar2 = this->_boneHearts; if (iVar3 < this->_boneHearts) { iVar2 = iVar3; } this->_boneHearts = iVar2; if (iVar2 < 1) { this->_boneHearts = 0; this->_boneHeartsMask = 0; return; } iVar3 = (this->_soulHearts + 1) / 2 + iVar2; this->_boneHeartsMask = this->_boneHeartsMask & 0xffffffffU >> (0x20U - (char)iVar3 & 0x1f); uVar6 = 0; uVar4 = this->_boneHeartsMask; if (0 < iVar3) { uVar5 = 1; do { if (((uVar5 & uVar4) != 0) && (iVar2 = iVar2 + -1, iVar2 < 0)) { uVar4 = uVar4 & ~(1 << (uVar6 & 0x1f)); } uVar6 = uVar6 + 1; uVar5 = uVar5 << 1 | (uint)((int)uVar5 < 0); } while ((int)uVar6 < iVar3); this->_boneHeartsMask = uVar4; } uVar4 = iVar3 - 1; if (-1 < (int)uVar4) { bVar1 = (byte)uVar4 & 0x1f; uVar6 = 1 << bVar1 | 1U >> 0x20 - bVar1; do { if (iVar2 < 1) { return; } if ((uVar6 & this->_boneHeartsMask) == 0) { iVar2 = iVar2 + -1; this->_boneHeartsMask = this->_boneHeartsMask | 1 << (uVar4 & 0x1f); } uVar6 = uVar6 >> 1 | (uint)((uVar6 & 1) != 0) << 0x1f; uVar4 = uVar4 - 1; } while (-1 < (int)uVar4); } } return; } //@@ 007cacb0 Entity_Player::ClampHeartsToLimit /* DB: ? called by all Add*Hearts; trims hearts above GetHeartLimit prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Player::ClampHeartsToLimit(Entity_Player *this,int heartType,int amount) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int local_8; if (*(int *)&g_game->_deathmatchManager < 2) { return; } iVar2 = amount * 8; iVar3 = GetHeartLimit(this,0); local_8 = this->_soulHearts; iVar1 = this->_blackHearts; iVar5 = this->_rottenHearts; iVar6 = this->_maxHearts + local_8 + iVar1 + this->_goldenHearts + this->_boneHearts + iVar5 + iVar2; if ((iVar3 < iVar6) && (0 < local_8)) { iVar4 = iVar6 - iVar3; if (local_8 < iVar6 - iVar3) { iVar4 = local_8; } local_8 = local_8 - iVar4; iVar6 = iVar6 - iVar4; this->_soulHearts = local_8; } amount = this->_goldenHearts; if (iVar3 < iVar6) { if (0 < amount) { iVar4 = iVar6 - iVar3; if (amount < iVar6 - iVar3) { iVar4 = amount; } amount = amount - iVar4; iVar6 = iVar6 - iVar4; this->_goldenHearts = amount; if (iVar6 <= iVar3) goto LAB_007cadbc; } if (0 < iVar5) { iVar4 = iVar6 - iVar3; if (iVar5 < iVar6 - iVar3) { iVar4 = iVar5; } iVar6 = iVar6 - iVar4; this->_rottenHearts = iVar5 - iVar4; } if (iVar3 < iVar6) { iVar5 = this->_boneHearts; if (0 < iVar5) { iVar4 = iVar6 - iVar3; if (iVar5 < iVar6 - iVar3) { iVar4 = iVar5; } iVar6 = iVar6 - iVar4; this->_boneHearts = iVar5 - iVar4; if (iVar6 <= iVar3) goto LAB_007cadbc; } if (0 < iVar1) { iVar5 = iVar6 - iVar3; if (iVar1 < iVar6 - iVar3) { iVar5 = iVar1; } iVar6 = iVar6 - iVar5; this->_blackHearts = iVar1 - iVar5; } } } LAB_007cadbc: iVar3 = (iVar2 - iVar6) + iVar3; if (iVar2 < iVar3) { iVar3 = iVar2; } if (iVar3 < 0) { iVar3 = 0; } switch(heartType) { case 3: this->_soulHearts = local_8 + iVar3; return; case 6: this->_blackHearts = this->_blackHearts + iVar3; break; case 7: this->_goldenHearts = iVar3 + amount; return; case 0xb: this->_boneHearts = this->_boneHearts + iVar3; return; case 0xc: this->_rottenHearts = this->_rottenHearts + iVar3; return; } return; } //@@ 007cae60 Entity_Player::GetHeartLimit /* ZHL [lua] Lua binding EntityPlayer:GetHeartLimit prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall Entity_Player::GetHeartLimit(Entity_Player *this,byte isKeeperBypass) { byte bVar1; int iVar2; int iVar3; int iVar4; if (1 < *(int *)&g_game->_deathmatchManager) { return 0xa0; } if (this->_variant == 0) { iVar2 = this->_playerType; if ((iVar2 == 0x10) && (bVar1 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x78), bVar1 != 0)) { return 6; } if ((iVar2 == 0x14) && (bVar1 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x79), bVar1 != 0)) { return 4; } LAB_007caedc: iVar2 = this->_playerType; if ((iVar2 != 0x10) && (iVar2 != 0x11)) { iVar4 = 0x18; goto LAB_007caefe; } } else if (this->_variant != 1) goto LAB_007caedc; iVar2 = this->_playerType; iVar4 = 0xc; LAB_007caefe: if ((iVar2 == 1) && (bVar1 = HasCollectible(this,0x26b,0), bVar1 != 0)) { iVar4 = iVar4 + 0xc; } iVar2 = this->_playerType; if ((iVar2 == 0xe) || (iVar2 == 0x21)) { if (isKeeperBypass != 0) { return iVar4; } iVar4 = GetGreedsGulletHearts(this); iVar2 = (uint)(iVar2 != 0x21) * 2 + 4 + iVar4 * 2; iVar4 = 0x18; if (iVar2 < 0x18) { iVar4 = iVar2; } if ((this->_playerType == 0xe) && (bVar1 = HasCollectible(this,0x26b,0), bVar1 != 0)) { iVar4 = iVar4 + 2; } bVar1 = HasCollectible(this,0x1f5,0); if (bVar1 != 0) { iVar2 = this->_numCoins / 0x19; iVar3 = iVar2 + 1; if (this->_numCoins != 99) { iVar3 = iVar2; } iVar4 = iVar4 + iVar3 * 2; } } else if (isKeeperBypass != 0) { return iVar4; } iVar4 = iVar4 + this->_brokenHearts * -2; iVar2 = 0; if (0 < iVar4) { iVar2 = iVar4; } return iVar2; } //@@ 007cafe0 Entity_Player::GetHealthType /* ZHL [exact] __thiscall int Entity_Player::GetHealthType(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Player::GetHealthType(Entity_Player *this) { switch(this->_playerType) { case 4: case 0xc: case 0x11: case 0x18: case 0x19: case 0x23: case 0x24: return 1; default: return 0; case 10: case 0x1f: case 0x28: return 2; case 0xe: case 0x21: return 3; case 0x10: return 4; } } //@@ 007cb060 Entity_Player::GetEffectiveMaxHearts /* ZHL [lua] Lua binding EntityPlayer:GetEffectiveMaxHearts prototype: db/protos.zhl, confirmed by RET 0 */ int __thiscall Entity_Player::GetEffectiveMaxHearts(Entity_Player *this) { int iVar1; int extraout_EDX; iVar1 = GetHealthType(this); if ((iVar1 == 1) || (iVar1 == 2)) { return *(int *)(extraout_EDX + 0x1340); } return *(int *)(extraout_EDX + 0x1340) + *(int *)(extraout_EDX + 0x1d88) * 2; } //@@ 007cb090 Entity_Player::apply_coop_baby_spawn_bonus /* DB: ECX player; switch on _babySkin: 27 AddBlackHearts 2, 28 +2 max hearts, 29 main player eternal heart, 30 soul hearts, 42 SetFullHearts on main player, 58 spawns effect 1000.114 linked to the main player, 59 converts to 1 soul heart; called right after PlayerManager::SpawnCoPlayerBaby in Console::RunCommand and EvaluateItems prototype: db/protos.zhl */ void __thiscall Entity_Player::apply_coop_baby_spawn_bonus(Entity_Player *this) { EntityPtr *pEVar1; int iVar2; ANM2 *pAVar3; Entity_Player *pEVar4; EntityPtr EVar5; uint seed; Entity *pEVar6; Entity_Player *local_8; local_8 = this; switch(this->_babySkin) { case 0x1b: AddBlackHearts(this,2); return; case 0x1c: AddMaxHearts(this,2,0); AddHearts(this,2,0,0); return; case 0x1d: pEVar4 = GetMainPlayer(this); AddEternalHearts(pEVar4,1); return; case 0x1e: AddSoulHearts(this,2,0); return; case 0x2a: pEVar4 = GetMainPlayer(this); SetFullHearts(pEVar4); return; case 0x3a: EVar5 = (EntityPtr)GetMainPlayer(this); seed = Random(); pEVar6 = Game::Spawn(g_game,1000,0x72,(Vector *)((int)EVar5 + 0x33c),&g_vectorZero,(Entity *)0x0 ,0,seed); if (pEVar6->_child != (EntityPtr)0x0) { local_8 = (Entity_Player *)&pEVar6->_child; std::multiset::erase(&local_8); } pEVar6->_child = EVar5; if (EVar5 != (EntityPtr)0x0) { std::multiset::insert(&pEVar6->_child); } pEVar1 = &pEVar6->_target; if (pEVar6->_target != (EntityPtr)0x0) { local_8 = (Entity_Player *)pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)this; std::multiset::insert(pEVar1); iVar2 = *(int *)pEVar6; pAVar3 = &pEVar6[1]._sprite; (pAVar3->_animDefaultName)._buf[0xc] = '\0'; (pAVar3->_animDefaultName)._buf[0xd] = '\0'; (pAVar3->_animDefaultName)._buf[0xe] = -0x10; (pAVar3->_animDefaultName)._buf[0xf] = 'B'; (**(code **)(iVar2 + 0xc))(); return; case 0x3b: AddMaxHearts(this,-this->_maxHearts,0); this->_soulHearts = 1; } return; } //@@ 007cb230 Entity_Player::FireTechXLaser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity_Laser* Entity_Player::FireTechXLaser(const Vector& pos, const Vector& dir, float radius, Entity * source, float damageMultiplier); prototype: REPENTOGON, confirmed by RET 20 */ Entity_Laser * __thiscall Entity_Player::FireTechXLaser (Entity_Player *this,Vector *pos,Vector *dir,float radius,Entity *source, float damageMultiplier) { byte bVar1; int iVar2; uint seed; Entity_Laser *this_00; int unaff_ESI; EntityPtr spawner; bool bVar3; undefined1 auStackY_148 [128]; float fVar4; undefined1 auStack_90 [4]; float local_8c; uint local_88; Vector *local_84; Entity_Player *local_80; Vector *local_7c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; float fStack_50; uint local_c; local_c = __security_cookie ^ (uint)auStack_90; local_84 = pos; spawner = (EntityPtr)this; if (source != (Entity *)0x0) { spawner = (EntityPtr)source; } local_7c = dir; local_80 = this; local_8c = sqrtf(damageMultiplier); if (*(int *)((int)spawner + 0x28) == 3) { local_8c = local_8c * 0.5; } local_88 = 2; bVar1 = HasCollectible(this,0x76,0); if ((bVar1 != 0) || (iVar2 = this->_playerType, iVar2 == 7)) { iVar2 = this->_playerType; local_88 = 1; } if ((iVar2 == 0x1c) && (bVar1 = HasCollectible(this,0x76,0), bVar1 == 0)) { local_8c = local_8c * 0.5; local_88 = 1; } iVar2 = GetCollectibleNum(this,0x76,0); if (1 < iVar2) { local_8c = local_8c + local_8c; } if ((1.5 < local_8c) && (local_88 == 1)) { local_8c = local_8c * 0.5; local_88 = 0xb; } bVar1 = HasCollectible(this,0x44,0); if ((bVar1 != 0) && (bVar3 = local_88 == 0xb, local_88 = 9, bVar3)) { local_88 = 0xe; } seed = Random(); Game::SpawnEx(g_game,7,local_88,local_84,local_7c,(Entity *)spawner,2,seed,0); this_00 = (Entity_Laser *)__RTDynamicCast(); Random(); GetTearHitParams(); (this_00->_posOffset).x = 0.0; (this_00->_posOffset).y = -20.0; if (this_00->_parent != (EntityPtr)0x0) { std::multiset::erase(); } this_00->_parent = spawner; if (spawner != (EntityPtr)0x0) { std::multiset::insert(); } fVar4 = 3.57331e-43; this_00->_renderDepthOffset = 3000.0; (**(code **)(*(int *)this_00 + 0x3c))(unaff_ESI + 0x14c4,0xffffffff,0xff,0); iVar2 = *(int *)this_00; *(undefined4 *)&(this_00->_tearFlags)._l = uStack_68; *(undefined4 *)((int)&(this_00->_tearFlags)._l + 4) = uStack_64; *(undefined4 *)&(this_00->_tearFlags)._h = uStack_60; *(undefined4 *)((int)&(this_00->_tearFlags)._h + 4) = uStack_5c; (**(code **)(iVar2 + 0x40))(uStack_58); this_00->_scale = fVar4; Entity_Laser::ResetSpriteScale(this_00); this_00->_radius = radius; if (this_00->_spawnerEntity != (EntityPtr)0x0) { std::multiset::erase(auStackY_148 + 0x98); } this_00->_spawnerEntity = spawner; if (spawner != (EntityPtr)0x0) { std::multiset::insert(&this_00->_spawnerEntity); } this_00->field_0x517 = 1; this_00->_mass = fStack_50 * this_00->_mass; this_00->_damageMultiplier = damageMultiplier; return this_00; } //@@ 007cb4f0 FUN_007cb4f0 void FUN_007cb4f0(void) { int *in_ECX; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; if (g_game->_challenge == 0x1d) { local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; (**(code **)(*in_ECX + 0x20))(0x3f800000,0x2000,0,&local_30,0x1e); } return; } //@@ 007cb580 Entity_Player::IsFullSpriteRendering /* ZHL [lua] Lua binding EntityPlayer:IsFullSpriteRendering prototype: db/protos.zhl, confirmed by RET 0 */ byte __thiscall Entity_Player::IsFullSpriteRendering(Entity_Player *this) { byte bVar1; char cVar2; bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x271); if ((bVar1 != 0) || ((this->_isPlayingExtraAnimation == 0 && (this->_isPlayingItemAnimation == 0)))) { return 0; } bVar1 = IsHoldingItem(this); if ((bVar1 == 0) || (cVar2 = IsHeldItemVisible(this), cVar2 != '\0')) { return 1; } return 0; } //@@ 007cb5d0 Entity_Player::PlayDelayedSFX /* ZHL [exact] __thiscall void Entity_Player::PlayDelayedSFX(unsigned int soundEffectID, int soundDelay, int frameDelay, float volume); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_Player::PlayDelayedSFX (Entity_Player *this,uint soundEffectId,int soundDelay,int frameDelay,float volume) { float Volume; int FrameDelay; Manager *pMVar1; int local_8; pMVar1 = g_manager; if ((this->_delayedSfxId != 0) && (0 < this->_delayedSfxDelay)) { Volume = this->_delayedSfxVolume; FrameDelay = this->_delayedSfxFrameDelay; local_8 = this->_delayedSfxId; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,Volume,FrameDelay,0,1.0,0.0); } pMVar1 = g_manager; if (soundDelay == 0) { seed_fart_sound_override((int *)&soundEffectId); SoundEffects::Play(&pMVar1->_sfxManager,soundEffectId,volume,2,0,1.0,0.0); volume = 1.0; soundDelay = 0; frameDelay = 2; soundEffectId = 0; } this->_delayedSfxId = soundEffectId; this->_delayedSfxVolume = volume; this->_delayedSfxDelay = soundDelay; this->_delayedSfxFrameDelay = frameDelay; return; } //@@ 007cb6e0 Entity_Player::GetTrinketMultiplier /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:GetTrinketMultiplier prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetTrinketMultiplier(Entity_Player *this,uint type) { float fVar1; void *pvVar2; byte isHasCollectible; char cVar3; EntityPtr parentPlayer; uint uVar4; int iVar5; RoomDescriptor *roomDesc; int *trinketSlot; float trinketId; int multiplier; Entity_Player *player; int trinketSlotsLeft; RNG roomRng; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; player = this; if (this->_variant == 1) { do { parentPlayer = *(EntityPtr *)((int)this + 0x3bc); if (((parentPlayer == (EntityPtr)0x0) || (*(int *)((int)parentPlayer + 0x28) != 1)) && ((player = this, *(int *)((int)this + 0x2c) != 1 || (parentPlayer = (EntityPtr)Game::GetPlayer(g_game,0), parentPlayer == (EntityPtr)0x0)))) break; this = (Entity_Player *)parentPlayer; player = (Entity_Player *)parentPlayer; } while (*(int *)((int)parentPlayer + 0x2c) == 1); } multiplier = 0; if ((type == 0x56) && (player->_playerType == 4)) { multiplier = 1; } if (player->_hasCurseMistEffect != 0) { return multiplier; } if (player->_isCoopGhost != 0) { return multiplier; } trinketId = (float)(type & 0x7fff); if ((g_game->_dailyChallenge)._specialDailyId == 0x1c) { uVar4 = 0; do { if (trinketId == *(float *)((int)&DAT_00b6bad0 + uVar4)) { multiplier = multiplier + 1; break; } uVar4 = uVar4 + 4; } while (uVar4 < 0x28); } if (((trinketId != 2.94273e-44) && (trinketId != 8.96831e-44)) && (trinketId != 1.05097e-43)) { iVar5 = GetTrinketMultiplier(player,0x15); if (0 < iVar5) { uVar4 = g_game->_frameCount & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } if ((trinketId == 6.72623e-44) && ((uVar4 == 2 || ((1 < iVar5 && (uVar4 == 3)))))) { return iVar5 + multiplier; } } iVar5 = GetTrinketMultiplier(player,0x40); if ((0 < iVar5) && (trinketId == (float)(&DAT_00b6bad0)[(uint)(g_game->_frameCount / 0x5a) % 10])) { multiplier = multiplier + iVar5; } iVar5 = GetTrinketMultiplier(player,0x4b); if (0 < iVar5) { if ((trinketId == 1.70958e-43) && (g_game->_challenge == 0x29)) goto LAB_007cb8d8; roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); if (roomDesc->SpawnSeed != 0) { roomRng._shift1 = 2; roomRng._shift2 = 7; roomRng._shift3 = 0x19; roomRng._seed = roomDesc->SpawnSeed; uVar4 = RNG::RandomInt(&roomRng,0xbd); if (trinketId == (float)(uVar4 + 1)) { multiplier = multiplier + iVar5; } } } if (trinketId == 3.22299e-44) { iVar5 = TemporaryEffects::GetTrinketEffectNum(&player->_temporaryeffects,0x17); multiplier = multiplier + iVar5; } else { if (trinketId == 3.36312e-44) { iVar5 = player->_coopBabyBuffTimers[7]; } else { if (trinketId != 2.66247e-44) goto LAB_007cb8d8; iVar5 = *(int *)&player->field_0x18e0; } if (0 < iVar5) { multiplier = multiplier + 1; } } } LAB_007cb8d8: trinketSlotsLeft = 1; isHasCollectible = HasCollectible(player,0x8b,0); if ((isHasCollectible != 0) || (isHasCollectible = HasCollectible(player,0x1ca,0), isHasCollectible != 0)) { trinketSlotsLeft = 2; } trinketSlot = player->_trinketsID; do { iVar5 = multiplier; if (((float)(*trinketSlot & 0x7fffU) == trinketId) && (iVar5 = multiplier + 1, (*trinketSlot & 0x8000U) != 0)) { iVar5 = multiplier + 2; } trinketSlot = trinketSlot + 1; trinketSlotsLeft = trinketSlotsLeft + -1; multiplier = iVar5; } while (trinketSlotsLeft != 0); trinketSlot = (player->_queuedItem)._item; if (((((trinketSlot != (int *)0x0) && (*trinketSlot == 2)) && ((float)trinketSlot[1] == trinketId) ) && ((fVar1 = player[1]._chargeBarSprites[0]._championColor._tint[0], fVar1 == 0.0 || (fVar1 == trinketId)))) && (multiplier = iVar5 + 1, ((player->_queuedItem)._flags & 2) != 0)) { multiplier = iVar5 + 2; } pvVar2 = (player->_smeltedTrinkets)._begin; if ((uint)trinketId < (uint)((int)(player->_smeltedTrinkets)._end - (int)pvVar2 >> 2)) { multiplier = *(short *)((int)pvVar2 + (int)trinketId * 4) + multiplier + *(short *)((int)pvVar2 + (int)trinketId * 4 + 2) * 2; } pvVar2 = (player->_extraTrinketCounts)._begin; if ((int)trinketId < (int)(player->_extraTrinketCounts)._end - (int)pvVar2) { cVar3 = *(char *)((int)pvVar2 + (int)trinketId); } else { cVar3 = '\0'; } fVar1 = player[1]._chargeBarSprites[0]._championColor._tint[0]; iVar5 = multiplier + 1; if (cVar3 == '\0') { iVar5 = multiplier; } if ((fVar1 != 0.0) && ((float)((uint)fVar1 & 0x7fff) == trinketId)) { if (*(char *)(player[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { multiplier = 0; if (0 < iVar5 + -1) { multiplier = iVar5 + -1; } iVar5 = multiplier; if (((uint)fVar1 & 0x8000) != 0) { iVar5 = 0; if (0 < multiplier + -1) { iVar5 = multiplier + -1; } } } else { iVar5 = (((uint)fVar1 & 0x8000) != 0) + 1 + iVar5; } } if ((0 < iVar5) && (isHasCollectible = HasCollectible(player,0x1b7,0), isHasCollectible != 0)) { iVar5 = iVar5 + 1; } return iVar5; } //@@ 007cba30 Entity_Player::UpdateCanShoot /* ZHL [lua] Lua binding EntityPlayer:UpdateCanShoot prototype: db/protos.zhl */ void __thiscall Entity_Player::UpdateCanShoot(Entity_Player *this) { int iVar1; byte bVar2; char cVar3; ChallengeParam *pCVar4; void *pvVar5; Game *this_00; Game *pGVar6; byte local_5; this_00 = g_game; iVar1 = this->_variant; this->_canShoot = 1; pGVar6 = g_game; if (iVar1 == 0) { pCVar4 = Game::GetChallengeParams(this_00); if (pCVar4->_canShoot != 0) goto LAB_007cba8b; this->_canShoot = 0; local_5 = 0; } else { if ((iVar1 == 1) && (this->_babySkin == 0x1a)) { bVar2 = 0; this->_canShoot = 0; goto LAB_007cbb1a; } LAB_007cba8b: bVar2 = 1; local_5 = 1; pGVar6 = this_00; if (iVar1 != 0) goto LAB_007cbb1a; } if (this->_playerType < 0) { LAB_007cbaf2: pvVar5 = (void *)0x0; LAB_007cbaf4: KAGE_LogMessage(0x10,(byte *)"Could not load config for player type %d\n"); local_5 = this->_canShoot; this_00 = g_game; } else { pvVar5 = (g_manager->_entityConfig)._players._begin; if (((int)(g_manager->_entityConfig)._players._end - (int)pvVar5) / 0x148 <= this->_playerType) goto LAB_007cbaf2; pvVar5 = (void *)(this->_playerType * 0x148 + (int)pvVar5); if (pvVar5 == (void *)0x0) goto LAB_007cbaf4; } if ((local_5 == 0) || (*(char *)((int)pvVar5 + 0xd0) == '\0')) { bVar2 = 0; } else { bVar2 = 1; } this->_canShoot = bVar2; pGVar6 = this_00; LAB_007cbb1a: if (1 < *(int *)&pGVar6->_deathmatchManager) { if (bVar2 != 0) { cVar3 = (**(code **)(*(int *)(pGVar6->_deathmatchManager)._type + 0x48))(this); if (cVar3 != '\0') { this->_canShoot = 1; return; } } this->_canShoot = 0; } return; } //@@ 007cbb60 Entity_Player::WillPlayerRevive /* ZHL [lua] Lua binding EntityPlayer:WillPlayerRevive prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::WillPlayerRevive(Entity_Player *this) { byte bVar1; bVar1 = TriggerDeath(this,1); return bVar1; } //@@ 007cbb70 Entity_Player::GetGreedDonationBreakChance /* ZHL [lua] Lua binding EntityPlayer:GetGreedDonationBreakChance */ float10 Entity_Player::GetGreedDonationBreakChance(void) { Entity_Player *in_ECX; float fVar1; fVar1 = GetGreedDonationJamChance(in_ECX,(PersistentGameData *)0x0); return (float10)fVar1; } //@@ 007cbb90 Entity_Player::GetGreedDonationJamChance /* DB: ? from greed donation count *0.023, capped 100; Slot::Update, GetGreedDonationBreakChance prototype: db/protos.zhl, confirmed by RET 4 */ float __thiscall Entity_Player::GetGreedDonationJamChance(Entity_Player *this,PersistentGameData *data) { float fVar1; int iVar2; float fVar3; double dVar4; if (0x28 < this->_playerType) { return 99.9; } if (data == (PersistentGameData *)0x0) { data = &g_manager->_persistentGameData; } iVar2 = this->_playerType * 0x90; if (iVar2 == -0xc35ed0) { iVar2 = 0; } else { iVar2 = *(int *)(&DAT_00c35f10 + iVar2); } fVar3 = (float)((double)data->_eventCounters[iVar2] + __uint_to_double_fixup[-(data->_eventCounters[iVar2] >> 0x1f)]) * 0.023; FUN_007df1e0(this); fVar3 = fVar3 - 1.0; if (100.0 <= fVar3) { fVar3 = 100.0; } dVar4 = floor((double)(fVar3 * 0.2 + 0.5)); fVar3 = (float)dVar4; if (g_game->_difficulty == 3) { fVar1 = 1.0; if (fVar3 <= 1.0) { fVar1 = fVar3; } fVar3 = fVar1; } return fVar3; } //@@ 007cbc60 Entity_Player::hallowed_ground_add /* DB: same pass with creep flag 0x40: _hallowedGroundCountdown (+0x1d90) = min(+n, 4), EvaluateItems on change (characters_11) */ void __thiscall Entity_Player::hallowed_ground_add(Entity_Player *this,int param_2) { int iVar1; iVar1 = this->_hallowedGroundCountdown; param_2 = param_2 + iVar1; if (4 < param_2) { param_2 = 4; } this->_hallowedGroundCountdown = param_2; if (0 < iVar1 != 0 < param_2) { this->_cacheFlags = this->_cacheFlags | 99; EvaluateItems(); } return; } //@@ 007cbcb0 FUN_007cbcb0 void FUN_007cbcb0(void) { return; } //@@ 007cbcd0 Entity_Player::init_forgotten_twin /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? player types 16/17, allocs 0x2f00 sub-player at 0x1d98 prototype: db/protos.zhl */ void __thiscall Entity_Player::init_forgotten_twin(Entity_Player *this) { Entity *spawner; EntityPtr spawner_00; byte bVar1; uint uVar2; undefined4 extraout_EAX; int *extraout_EAX_00; int *piVar3; code *extraout_EDX; Vector local_50; Vector local_48; Color local_40; uint local_14; void *local_10; undefined1 *puStack_c; int *local_8; local_8 = (int *)0xffffffff; puStack_c = &LAB_00b00117; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&local_40)[1]._colorize; ExceptionList = &local_10; if (-1 < this->_playerIndex) { if ((this->_playerType == 0x10) || (this->_playerType == 0x11)) { piVar3 = (int *)this->_subPlayer; bVar1 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x78); if (bVar1 == 0) { if (piVar3 == (int *)0x0) { local_48.y = (float)operator_new(0x2f00); if ((Entity_Player *)local_48.y == (Entity_Player *)0x0) { piVar3 = (int *)0x0; } else { local_8 = piVar3; constructor((Entity_Player *)local_48.y); piVar3 = extraout_EAX_00; } local_8 = (int *)0xffffffff; this->_subPlayer = (int)piVar3; (**(code **)(*piVar3 + 4)) (this->_type,this->_variant,(this->_playerType == 0x10) + '\x10',this->_initSeed ); } } else if (piVar3 != (int *)0x0) { (**(code **)(*piVar3 + 0x44))(); if ((undefined4 *)this->_subPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_subPlayer)(1); } this->_subPlayer = 0; } } else { piVar3 = (int *)this->_subPlayer; if ((piVar3 != (int *)0x0) && ((char)piVar3[0x5c] == '\0')) { (**(code **)(*piVar3 + 0x44))(local_14); if ((undefined4 *)this->_subPlayer != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_subPlayer)(1); } this->_subPlayer = 0; } if (this->_forgottenBody != (void *)0x0) { uVar2 = Random(); spawner = this->_forgottenBody; local_48.x = (spawner->_pos).x; local_48.y = (spawner->_pos).y; Game::Spawn(g_game,1000,0xf,&local_48,&g_vectorZero,spawner,0,uVar2); (**(code **)(*(int *)this->_forgottenBody + 0x28))(); } if (((this->_darkEsau != (EntityPtr)0x0) && (this->_playerType != 0x25)) && (this->_playerType != 0x27)) { uVar2 = Random(); spawner_00 = this->_darkEsau; local_50.x = ((Vector *)((int)spawner_00 + 0x33c))->x; local_50.y = *(float *)((int)spawner_00 + 0x340); Game::Spawn(g_game,1000,0xf,&local_50,&g_vectorZero,(Entity *)spawner_00,0,uVar2); Color::Color(&local_40); (*extraout_EDX)(extraout_EAX,0xffffffff,0xff,0,1); (**(code **)(*(int *)this->_darkEsau + 0x28))(); } } } ExceptionList = local_10; return; } //@@ 007cbef0 Entity_Player::spawn_forgotten_body /* DB: ECX Entity_Player: reuses _forgottenBody unless missing, Game::SpawnEx(3, 900 FAMILIAR_FORGOTTEN_BODY) at _pos (or _forgottenBodyPos when HasCollectible(0x26b Birthright) and _playerType 0x11), copies size/scale/colour, stores _forgottenBody/_forgottenBodyRoomIdx/_forgottenBodyPos, poof effect 1000/0x72; Entity_Player::room_enter, init_player_type_state prototype: db/protos.zhl */ Entity * __thiscall Entity_Player::spawn_forgotten_body(Entity_Player *this) { ColorMod *pCVar1; int iVar2; float fVar3; float fVar4; float fVar5; ANM2 *pAVar6; undefined4 uVar7; byte bVar8; RoomDescriptor *bodyRoom; Entity_Familiar *body; Entity *pEVar9; uint bodyDimension; uint uVar10; EntityPtr *pEStack_14; Vector spawnPos; void **bodySlot; Game *game; bool isBirthrightBody; int *roomConfig; pEVar9 = this->_forgottenBody; bodySlot = &this->_forgottenBody; if (pEVar9 != (Entity *)0x0) { if (this->_replacedPlayer != (void *)0x0) { return pEVar9; } (**(code **)(*(int *)pEVar9 + 0x28))(); } bVar8 = HasCollectible(this,0x26b,0); if ((bVar8 == 0) || (this->_playerType != 0x11)) { isBirthrightBody = false; } else { isBirthrightBody = true; } uVar10 = this->_forgottenBodyRoomIdx; bodyDimension = 0; if (-1 < (int)uVar10) { bodyDimension = uVar10 / 0xa9; uVar10 = uVar10 % 0xa9; } if (((((isBirthrightBody) && (uVar10 != 0xfffe7961)) && ((roomConfig = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10), roomConfig == (int *)0x0 || ((roomConfig[2] != 0x10 || (*roomConfig != 0x23)))))) && (bodyDimension == g_game->_currentDimensionIdx)) && (bodyRoom = Level::GetRoomByIdx((Level *)g_game,uVar10,bodyDimension), bodyRoom != *(RoomDescriptor **)((int)g_game->_room + 4))) { return (Entity *)0x0; } spawnPos.x = (this->_pos).x; spawnPos.y = (this->_pos).y; if ((isBirthrightBody) && (this->_forgottenBodyRoomIdx != -99999)) { spawnPos.x = (this->_forgottenBodyPos).x; spawnPos.y = (this->_forgottenBodyPos).y; } uVar10 = Random(); body = (Entity_Familiar *) Game::SpawnEx(g_game,3,900,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar10,0); (body->_pos).x = spawnPos.x; (body->_pos).y = spawnPos.y; Entity::SetSize((Entity *)body,this->_size,this->_sizeMulti,-1); pCVar1 = &(body->_sprite)._color; (body->_sprite)._scale.x = (this->_playerSpriteScale).x; (body->_sprite)._scale.y = (this->_playerSpriteScale).y; if (pCVar1 != (ColorMod *)&this->field_0x16e0) { fVar3 = *(float *)&this->field_0x16e4; fVar4 = *(float *)&this->field_0x16e8; fVar5 = *(float *)&this->field_0x16ec; pCVar1->_tint[0] = *(float *)&this->field_0x16e0; (body->_sprite)._color._tint[1] = fVar3; (body->_sprite)._color._tint[2] = fVar4; (body->_sprite)._color._tint[3] = fVar5; fVar3 = *(float *)&this->field_0x16f4; fVar4 = *(float *)&this->field_0x16f8; fVar5 = *(float *)&this->field_0x16fc; (body->_sprite)._color._colorize[0] = *(float *)&this->field_0x16f0; (body->_sprite)._color._colorize[1] = fVar3; (body->_sprite)._color._colorize[2] = fVar4; (body->_sprite)._color._colorize[3] = fVar5; uVar7 = *(undefined4 *)&this->field_0x1704; (body->_sprite)._color._offset[0] = (float)*(undefined4 *)&this->field_0x1700; (body->_sprite)._color._offset[1] = (float)uVar7; (body->_sprite)._color._offset[2] = *(float *)&this->field_0x1708; } *(uint *)&body->_flags = (uint)body->_flags & 0xfffffffb; *(undefined4 *)((int)&body->_flags + 4) = *(undefined4 *)((int)&body->_flags + 4); if (*bodySlot != (void *)0x0) { pEStack_14 = (EntityPtr *)bodySlot; std::multiset::erase(&pEStack_14); } *bodySlot = body; std::multiset::insert(bodySlot); game = g_game; iVar2 = g_game->_currentRoomIdx; if (iVar2 != -0x10) { this->_forgottenBodyRoomIdx = iVar2; if (-1 < iVar2) { this->_forgottenBodyRoomIdx = game->_currentDimensionIdx * 0xa9 + iVar2; } (this->_forgottenBodyPos).x = spawnPos.x; (this->_forgottenBodyPos).y = spawnPos.y; } if (!isBirthrightBody) { uVar10 = Random(); pEVar9 = Game::SpawnEx(g_game,1000,0x72,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar10,0); if (pEVar9->_child != (EntityPtr)0x0) { pEStack_14 = &pEVar9->_child; std::multiset::erase(&pEStack_14); } pEVar9->_child = (EntityPtr)body; std::multiset::insert(&pEVar9->_child); if (pEVar9->_target != (EntityPtr)0x0) { pEStack_14 = &pEVar9->_target; std::multiset::erase(&pEStack_14); } pEVar9->_target = (EntityPtr)this; std::multiset::insert(&pEVar9->_target); iVar2 = *(int *)pEVar9; pAVar6 = &pEVar9[1]._sprite; (pAVar6->_animDefaultName)._buf[0xc] = '\0'; (pAVar6->_animDefaultName)._buf[0xd] = '\0'; (pAVar6->_animDefaultName)._buf[0xe] = -0x10; (pAVar6->_animDefaultName)._buf[0xf] = 'B'; (**(code **)(iVar2 + 0xc))(); } return (Entity *)body; } //@@ 007cc200 Entity_Player::SwapForgottenForm /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: the Forgotten/Soul form swap, REPENTOGON SwapForgottenForm(bool, bool); RET 8 prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Entity_Player::SwapForgottenForm(Entity_Player *this,byte isForce,byte isNoEffects) { float fVar1; undefined1 uVar2; undefined4 uVar3; void *pvVar4; byte bVar5; uint uVar6; RoomDescriptor *bodyRoom; ItemConfig_Item **ppIVar7; Entity *spawnedEffect; ItemConfig_Item *pIVar8; int *piVar9; byte *pbVar10; undefined4 *effect; byte *pbVar11; Entity_Player *spawnedEffect; ItemConfig_Item **ppIVar13; char *pcVar14; undefined1 *swapByte; void **ppvVar15; int iVar16; uint uVar17; TemporaryEffects *tempEffects; bool bVar18; float fVar19; double dVar20; undefined8 uVar21; Color spriteColor; ItemConfig_Item *trailCount; int trailIndex; float trailX; float angleSin; undefined1 local_a0 [12]; float local_94; Vector poofVelocity; float local_88; ItemConfig_Item *local_84; int local_80 [2]; float local_78; ItemConfig_Item *local_74; Entity_Player *local_70; ItemConfig_Item *local_6c; undefined4 uStack_68; Vector VStack_64; ItemConfig_Item *local_5c; byte local_55; ItemConfig_Item *local_54; ColorMod colorMod; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; int *effectsEnd; Entity_Player *effectsOwner; Game *game; int playerType; puStack_20 = (undefined1 *)(&colorMod)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00b00140; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)((&colorMod)[1]._colorize + 1); iVar16 = this->_subPlayer; if (iVar16 == 0) { return 0; } playerType = this->_playerType; if ((playerType == 0x10) || (playerType == 0x11)) { if (isForce == 0) { if (0 < this->_forgottenSwapFormCooldown) goto LAB_007cc270; if (((*(int *)(iVar16 + 0x1344) < 1) && (*(int *)(iVar16 + 0x134c) < 1)) && (*(int *)(iVar16 + 0x1d88) < 1)) { return 0; } if (*(int *)&g_game->_roomTransition != 0) { return 0; } if (*(int *)&g_game->_stageTransition != 0) { return 0; } if (0 < g_game->_deathCertificateExitTimer) { return 0; } } } else { LAB_007cc270: if (((playerType != 0x25) && (playerType != 0x27)) || (isForce == 0)) { return 0; } } ExceptionList = &local_1c; if (((playerType == 0x10) || (playerType == 0x11)) && (isNoEffects == 0)) { this->_forgottenSwapFormCooldown = 0xf; } local_70 = this; local_24 = uVar6; RemoveSkinCostume(this); bVar5 = HasCollectible(this,0x7a,0); if ((bVar5 == 0) || (local_55 = 1, 1 < this->_redHearts)) { local_55 = 0; } ppvVar15 = this->_weapons; local_5c = (ItemConfig_Item *)&DAT_00000004; do { ppvVar15 = ppvVar15 + 1; if (*ppvVar15 != (int *)0x0) { (**(code **)(*(int *)*ppvVar15 + 0x14))(uVar6); } local_5c = (ItemConfig_Item *)((int)&local_5c[-1]._initCharge + 3); } while (local_5c != (ItemConfig_Item *)0x0); iVar16 = this->_redHearts; this->_redHearts = *(int *)(this->_subPlayer + 0x1344); *(int *)(this->_subPlayer + 0x1344) = iVar16; iVar16 = this->_maxHearts; this->_maxHearts = *(int *)(this->_subPlayer + 0x1340); *(int *)(this->_subPlayer + 0x1340) = iVar16; iVar16 = this->_soulHearts; this->_soulHearts = *(int *)(this->_subPlayer + 0x134c); *(int *)(this->_subPlayer + 0x134c) = iVar16; iVar16 = this->_blackHearts; this->_blackHearts = *(int *)(this->_subPlayer + 0x1350); *(int *)(this->_subPlayer + 0x1350) = iVar16; iVar16 = this->_eternalHearts; this->_eternalHearts = *(int *)(this->_subPlayer + 0x1348); *(int *)(this->_subPlayer + 0x1348) = iVar16; iVar16 = this->_boneHearts; this->_boneHearts = *(int *)(this->_subPlayer + 0x1d88); *(int *)(this->_subPlayer + 0x1d88) = iVar16; iVar16 = this->_boneHeartsMask; this->_boneHeartsMask = *(int *)(this->_subPlayer + 0x1d8c); *(int *)(this->_subPlayer + 0x1d8c) = iVar16; iVar16 = this->_brokenHearts; this->_brokenHearts = *(int *)(this->_subPlayer + 0x1da0); *(int *)(this->_subPlayer + 0x1da0) = iVar16; iVar16 = this->_rottenHearts; this->_rottenHearts = *(int *)(this->_subPlayer + 0x1da4); *(int *)(this->_subPlayer + 0x1da4) = iVar16; iVar16 = this->_reverseEmpressMaxHearts; this->_reverseEmpressMaxHearts = *(int *)(this->_subPlayer + 0x1ecc); *(int *)(this->_subPlayer + 0x1ecc) = iVar16; iVar16 = this->_goldenHearts; this->_goldenHearts = *(int *)(this->_subPlayer + 0x194c); *(int *)(this->_subPlayer + 0x194c) = iVar16; iVar16 = this->_playerType; this->_playerType = *(int *)(this->_subPlayer + 0x13c0); *(int *)(this->_subPlayer + 0x13c0) = iVar16; bVar5 = this->_tearDisplacement; this->_tearDisplacement = *(byte *)(this->_subPlayer + 0x1578); *(byte *)(this->_subPlayer + 0x1578) = bVar5; iVar16 = this->_strengthMaxHearts; this->_strengthMaxHearts = *(int *)(this->_subPlayer + 0x18a0); *(int *)(this->_subPlayer + 0x18a0) = iVar16; uVar3 = *(undefined4 *)&this->field_0x1950; *(undefined4 *)&this->field_0x1950 = *(undefined4 *)(this->_subPlayer + 0x1950); *(undefined4 *)(this->_subPlayer + 0x1950) = uVar3; swapByte = &this->field_0x13f0; spawnedEffect = (Entity_Player *)this->_subPlayer; if ((this != spawnedEffect) && (swapByte != &this->field_0x1401)) { do { uVar2 = *swapByte; *swapByte = swapByte[(int)spawnedEffect - (int)this]; swapByte[(int)spawnedEffect - (int)this] = uVar2; swapByte = swapByte + 1; } while (swapByte != &this->field_0x1401); spawnedEffect = (Entity_Player *)local_70->_subPlayer; this = local_70; } ppvVar15 = this->_weapons + 1; if ((ppvVar15 != spawnedEffect->_weapons + 1) && (local_54 = (ItemConfig_Item *)&this->field_0x13f0, (ItemConfig_Item *)ppvVar15 != local_54)) { iVar16 = (int)(spawnedEffect->_weapons + 1) - (int)ppvVar15; do { pvVar4 = *ppvVar15; *ppvVar15 = *(void **)((int)ppvVar15 + iVar16); *(void **)((int)ppvVar15 + iVar16) = pvVar4; ppvVar15 = ppvVar15 + 1; } while ((ItemConfig_Item *)ppvVar15 != local_54); } if (this->_weapons[1] != (void *)0x0) { *(Entity_Player **)((int)this->_weapons[1] + 4) = this; } if (this->_weapons[2] != (void *)0x0) { *(Entity_Player **)((int)this->_weapons[2] + 4) = this; } if (this->_weapons[3] != (void *)0x0) { *(Entity_Player **)((int)this->_weapons[3] + 4) = this; } if (this->_weapons[4] != (void *)0x0) { *(Entity_Player **)((int)this->_weapons[4] + 4) = this; } if (this->_playerType == 0x11) { if ((isNoEffects == 0) || (this->_forgottenBody == (void *)0x0)) { spawn_forgotten_body(this); } (**(code **)(*(int *)this + 0x60))(); if (isNoEffects == 0) { spriteColor._offset[2] = (this->_sprite)._color._offset[2]; colorMod._colorize[0] = 0.0; colorMod._colorize[1] = 0.0; colorMod._colorize[2] = 0.0; colorMod._colorize[3] = 0.0; colorMod._tint[0] = 1.0; colorMod._tint[1] = 1.0; colorMod._tint[2] = 1.0; colorMod._tint[3] = 1.0; spriteColor._tint[0] = (this->_sprite)._color._tint[0]; spriteColor._tint[1] = (this->_sprite)._color._tint[1]; spriteColor._tint[2] = (this->_sprite)._color._tint[2]; spriteColor._tint[3] = (this->_sprite)._color._tint[3]; colorMod._offset[0] = 1.0; colorMod._offset[1] = 1.0; colorMod._offset[2] = 1.0; spriteColor._colorize[0] = (this->_sprite)._color._colorize[0]; spriteColor._colorize[1] = (this->_sprite)._color._colorize[1]; spriteColor._colorize[2] = (this->_sprite)._color._colorize[2]; spriteColor._colorize[3] = (this->_sprite)._color._colorize[3]; spriteColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; Color::__mul(&spriteColor,&colorMod); colorMod._tint[0] = spriteColor._tint[0]; colorMod._tint[1] = spriteColor._tint[1]; colorMod._tint[2] = spriteColor._tint[2]; colorMod._tint[3] = spriteColor._tint[3]; colorMod._offset[2] = spriteColor._offset[2]; colorMod._colorize[0] = spriteColor._colorize[0]; colorMod._colorize[1] = spriteColor._colorize[1]; colorMod._colorize[2] = spriteColor._colorize[2]; colorMod._colorize[3] = spriteColor._colorize[3]; colorMod._offset[0] = spriteColor._offset[0]; colorMod._offset[1] = spriteColor._offset[1]; (**(code **)(*(int *)this + 0x3c))(&colorMod,8,0xff,1); } } else if (this->_playerType == 0x10) { uVar6 = this->_forgottenBodyRoomIdx; local_5c = (ItemConfig_Item *)0x0; uVar17 = uVar6; if (-1 < (int)uVar6) { local_5c = (ItemConfig_Item *)(uVar6 / 0xa9); uVar17 = uVar6 % 0xa9; uVar6 = this->_forgottenBodyRoomIdx; } if (((this->_forgottenBody == (void *)0x0) && (uVar6 != 0xfffe7961)) && (bodyRoom = Level::GetRoomByIdx((Level *)g_game,uVar17,(int)local_5c), bodyRoom != *(RoomDescriptor **)((int)g_game->_room + 4))) { bVar5 = HasCollectible(this,0x26b,0); game = g_game; if (bVar5 == 0) goto LAB_007cc74d; g_game->_leaveDoor = -1; Game::StartRoomTransition(game,uVar17,-1,0x11,this,(int)local_5c); this->_forgottenBodyRoomIdx = -99999; } else { LAB_007cc74d: pvVar4 = this->_forgottenBody; if (pvVar4 == (void *)0x0) { local_78 = g_vectorZero.x; local_74 = (ItemConfig_Item *)g_vectorZero.y; } else { local_78 = *(float *)((int)pvVar4 + 0x33c) - (this->_pos).x; local_74 = (ItemConfig_Item *)(*(float *)((int)pvVar4 + 0x340) - (this->_pos).y); } poofVelocity.x = local_78 * 0.1; poofVelocity.y = (float)local_74 * 0.1; local_5c = (ItemConfig_Item *)poofVelocity.y; local_54 = (ItemConfig_Item *)poofVelocity.x; if (isNoEffects == 0) { if (pvVar4 != (void *)0x0) { fVar19 = sqrtf(poofVelocity.y * poofVelocity.y + poofVelocity.x * poofVelocity.x); if ((4.0 < fVar19) && (0.0 < fVar19)) { poofVelocity.y = (4.0 / fVar19) * (float)local_5c; poofVelocity.x = (4.0 / fVar19) * (float)local_54; } local_84 = (ItemConfig_Item *)0xc; local_5c = (ItemConfig_Item *)&DAT_00000004; fVar19 = sqrtf(local_78 * local_78 + (float)local_74 * (float)local_74); local_54 = (ItemConfig_Item *)(fVar19 / 20.0); dVar20 = floor((double)(float)local_54); local_54 = (ItemConfig_Item *)(int)dVar20; ppIVar13 = &local_5c; if (3 < (int)dVar20) { ppIVar13 = &local_54; } ppIVar7 = &local_84; if ((int)*ppIVar13 < 0xd) { ppIVar7 = ppIVar13; } trailCount = *ppIVar7; if (0 < (int)trailCount) { local_74 = (ItemConfig_Item *)(float)(int)((int)&trailCount->type + 1); trailIndex = 0; do { trailIndex = trailIndex + 1; trailX = (this->_pos).x; local_88 = (this->_pos).y; local_5c = (ItemConfig_Item *)((float)trailIndex / (float)local_74); trailX = trailX + (*(float *)((int)this->_forgottenBody + 0x33c) - trailX) * (float)local_5c; local_88 = local_88 + (*(float *)((int)this->_forgottenBody + 0x340) - local_88) * (float)local_5c; uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_84 = (ItemConfig_Item *)(fVar19 + fVar19); angleSin = sin((float)local_84); uVar6 = Random(); local_54 = (ItemConfig_Item *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)] ) * 2.3283064e-10); fVar19 = cos((float)local_84); VStack_64.x = fVar19 * (float)local_54 * 15.0 + trailX; VStack_64.y = local_88 + (float)local_54 * angleSin * 15.0; uVar6 = Random(); uVar17 = Random(); local_94 = (float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; local_a0._8_4_ = poofVelocity.x * local_94; local_94 = poofVelocity.y * local_94; spawnedEffect = Game::SpawnEx(g_game,1000,0x6f,&VStack_64,(Vector *)(local_a0 + 8),(Entity *)0x0, 0,uVar6,0); colorMod._colorize[0] = 0.0; colorMod._colorize[1] = 0.0; colorMod._colorize[2] = 0.0; colorMod._colorize[3] = 0.0; colorMod._tint[0] = 1.0; colorMod._tint[1] = 1.0; colorMod._tint[2] = 1.0; colorMod._tint[3] = 1.0; colorMod._offset[0] = 1.0; colorMod._offset[1] = 1.0; colorMod._offset[2] = 1.0; (**(code **)(*(int *)spawnedEffect + 0x3c))(&colorMod,0xffffffff,0xff,0); local_88 = (float)local_5c * g_vectorOne.x; local_5c = (ItemConfig_Item *)((float)local_5c * g_vectorOne.y); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; (spawnedEffect->_sprite)._scale.y = fVar19 * (float)local_5c; (spawnedEffect->_sprite)._scale.x = fVar19 * local_88; fVar19 = (this->_sprite)._scale.y; fVar1 = (this->_posOffset).y; (spawnedEffect->_posOffset).x = (this->_posOffset).x + 0.0; (spawnedEffect->_posOffset).y = fVar19 * -16.0 + fVar1; } while (trailIndex < (int)trailCount); } } uVar6 = Random(); spawnedEffect = Game::SpawnEx(g_game,1000,0x10,&this->_pos,&poofVelocity,(Entity *)0x0,10,uVar6,0); (spawnedEffect->_posOffset).x = (this->_posOffset).x; (spawnedEffect->_posOffset).y = (this->_posOffset).y; (spawnedEffect->_sprite)._scale.x = (this->_sprite)._scale.x; (spawnedEffect->_sprite)._scale.y = (this->_sprite)._scale.y; pvVar4 = this->_forgottenBody; if ((pvVar4 != (void *)0x0) && (10 < g_game->_frameCount - *(int *)((int)pvVar4 + 0x328))) { VStack_64.x = *(float *)((int)pvVar4 + 0x33c); VStack_64.y = *(float *)((int)pvVar4 + 0x340); EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_a0, &VStack_64,*(float *)((int)pvVar4 + 0x370) + 25.0,2); fVar19 = 0.0; if (local_94 != 0.0) { do { iVar16 = *(int *)(local_a0._4_4_ + (int)fVar19 * 4); if ((*(char *)(iVar16 + 0x173) == '\0') && (-50.0 < *(float *)(iVar16 + 0x410))) { *(undefined4 *)(iVar16 + 0x438) = 0; *(undefined4 *)(iVar16 + 0x43c) = 0; *(undefined1 *)(iVar16 + 0x173) = 1; } fVar19 = (float)((int)fVar19 + 1); } while ((uint)fVar19 < (uint)local_94); } if (local_a0[0] == '\0') { local_14 = 0.0; tracked_alloc(1,(void *)local_a0._4_4_,0); local_14 = -NAN; } } } pvVar4 = this->_forgottenBody; if (pvVar4 != (void *)0x0) { VStack_64.x = *(float *)((int)pvVar4 + 0x33c); VStack_64.y = *(float *)((int)pvVar4 + 0x340); Teleport(this,&VStack_64,0,0); piVar9 = this->_forgottenBody; (this->_velocity).x = g_vectorZero.x; iVar16 = *piVar9; (this->_velocity).y = g_vectorZero.y; (**(code **)(iVar16 + 0x28))(); } } (**(code **)(*(int *)this + 0x60))(); if (isNoEffects == 0) { spriteColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; colorMod._tint[0] = (this->_sprite)._color._tint[0] * 1.0; colorMod._tint[1] = (this->_sprite)._color._tint[1] * 1.0; colorMod._tint[2] = (this->_sprite)._color._tint[2] * 1.0; colorMod._tint[3] = (this->_sprite)._color._tint[3] * 1.0; spriteColor._offset[2] = (this->_sprite)._color._offset[2] + 1.0; colorMod._colorize[0] = (this->_sprite)._color._colorize[0]; colorMod._colorize[1] = (this->_sprite)._color._colorize[1]; colorMod._colorize[2] = (this->_sprite)._color._colorize[2]; colorMod._colorize[3] = (this->_sprite)._color._colorize[3]; colorMod._offset[1] = spriteColor._offset[1] + 1.0; colorMod._offset[0] = spriteColor._offset[0] + 1.0; colorMod._offset[2] = spriteColor._offset[2]; (**(code **)(*(int *)this + 0x3c))(&colorMod,8,0xff,1); } this->_forgottenBodyRoomIdx = -99999; } tempEffects = &this->_temporaryeffects; if ((this->_temporaryeffects)._disabled == 0) { for (piVar9 = (this->_temporaryeffects)._effects._begin; piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x7a)) { local_74 = (ItemConfig_Item *)piVar9[1]; pIVar8 = local_74; if (0 < (int)local_74) { local_5c = local_74; do { pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((0x1e8 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) && (pIVar8 = *(ItemConfig_Item **)((int)pvVar4 + 0x1e8), pIVar8 != (ItemConfig_Item *)0x0)) { VStack_64.x = (float)pIVar8->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = pIVar8; TemporaryEffects::RemoveEffect(tempEffects,&local_6c,1); } local_5c = (ItemConfig_Item *)((int)&local_5c[-1]._initCharge + 3); } while (local_5c != (ItemConfig_Item *)0x0); local_5c = (ItemConfig_Item *)0x0; pIVar8 = local_74; } goto LAB_007ccdf8; } } } pIVar8 = (ItemConfig_Item *)0x0; LAB_007ccdf8: local_54 = (ItemConfig_Item *)((int)&pIVar8[-1]._initCharge + 3); if (local_55 == 0) { local_54 = pIVar8; } bVar5 = HasCollectible(this,0x7a,0); if (bVar5 != 0) { if ((this->_temporaryeffects)._disabled == 0) { piVar9 = (this->_temporaryeffects)._effects._begin; effectsEnd = (this->_temporaryeffects)._effects._end; if (piVar9 != effectsEnd) { do { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x7a) ) goto LAB_007ccfa0; piVar9 = piVar9 + 4; } while (piVar9 != effectsEnd); piVar9 = (this->_temporaryeffects)._effects._begin; do { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x7a) ) goto LAB_007ccf4a; piVar9 = piVar9 + 4; } while (piVar9 != (this->_temporaryeffects)._effects._end); } } pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU) < 0x1e9) { local_5c = (ItemConfig_Item *)0x0; } else { local_5c = *(ItemConfig_Item **)((int)pvVar4 + 0x1e8); } if ((local_5c->addCostumeOnPickup == 0) || (bVar5 = HasCollectible(this,0x7a,0), bVar5 == 0)) { RemoveCostume(this,local_5c); } LAB_007ccf4a: if (((this->_redHearts < 2) && (pvVar4 = (g_manager->_itemConfig)._collectibles._begin, 0x1e8 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) ) && (pIVar8 = *(ItemConfig_Item **)((int)pvVar4 + 0x1e8), pIVar8 != (ItemConfig_Item *)0x0) ) { VStack_64.x = (float)pIVar8->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = pIVar8; TemporaryEffects::AddEffect(tempEffects,&local_6c,1,1); } } LAB_007ccfa0: spawnedEffect = this; if (0 < (int)local_54) { pIVar8 = local_54; do { pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if (0x1e8 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU )) { local_5c = *(ItemConfig_Item **)((int)pvVar4 + 0x1e8); if (local_5c != (ItemConfig_Item *)0x0) { local_74 = (ItemConfig_Item *)local_5c->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = local_5c; VStack_64.x = (float)local_74; if ((this->_temporaryeffects)._disabled == 0) { effect = (this->_temporaryeffects)._effects._begin; if (effect != (this->_temporaryeffects)._effects._end) { do { if ((ItemConfig_Item *)*effect == local_5c) { if (effect != (this->_temporaryeffects)._effects._end) { effect[1] = effect[1] + 1; effect[2] = (local_74->name)._buf + effect[2] + -8; goto LAB_007cd080; } break; } effect = effect + 4; } while (effect != (this->_temporaryeffects)._effects._end); } effect = (this->_temporaryeffects)._effects._end; if (effect == (this->_temporaryeffects)._effects._capacity) { std::vector::_Emplace_reallocate(effect,&local_6c); local_5c = local_6c; } else { *effect = local_5c; effect[1] = 0; effect[2] = local_74; effect[3] = 0; ppvVar15 = &(this->_temporaryeffects)._effects._end; *ppvVar15 = (void *)((int)*ppvVar15 + 0x10); } local_54 = (this->_temporaryeffects)._effects._end; pvVar4 = (this->_temporaryeffects)._effects._begin; *(undefined4 *)((((int)local_54 - (int)pvVar4 & 0xfffffff0U) - 0xc) + (int)pvVar4) = 1; spawnedEffect = (this->_temporaryeffects)._player; local_6c = local_5c; if (spawnedEffect != (Entity_Player *)0x0) { local_6c = local_5c; AddCostume(spawnedEffect,local_5c,0); } LAB_007cd080: tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_5c->cacheFlags; (this->_temporaryeffects)._shouldEvaluateCache = 1; } } } pIVar8 = (ItemConfig_Item *)((int)&pIVar8[-1]._initCharge + 3); } while (pIVar8 != (ItemConfig_Item *)0x0); spawnedEffect = local_70; } pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((0x664 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) && (pIVar8 = *(ItemConfig_Item **)((int)pvVar4 + 0x664), pIVar8 != (ItemConfig_Item *)0x0)) { VStack_64.x = (float)pIVar8->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = pIVar8; TemporaryEffects::RemoveEffect(tempEffects,&local_6c,1); } bVar5 = HasCollectible(spawnedEffect,0x199,0); if (bVar5 != 0) { if ((spawnedEffect->_temporaryeffects)._disabled == 0) { for (piVar9 = (spawnedEffect->_temporaryeffects)._effects._begin; piVar9 != (spawnedEffect->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x199)) goto LAB_007cd27a; } } pvVar4 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 & 0xfffffffcU) < 0x49) { pIVar8 = (ItemConfig_Item *)0x0; } else { pIVar8 = *(ItemConfig_Item **)((int)pvVar4 + 0x48); } RemoveCostume(spawnedEffect,pIVar8); if (spawnedEffect->_redHearts < 1) { pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if (0x664 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU )) { local_54 = *(ItemConfig_Item **)((int)pvVar4 + 0x664); if (local_54 != (ItemConfig_Item *)0x0) { local_74 = (ItemConfig_Item *)local_54->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = local_54; VStack_64.x = (float)local_74; if ((this->_temporaryeffects)._disabled == 0) { effect = (this->_temporaryeffects)._effects._begin; if (effect != (this->_temporaryeffects)._effects._end) { do { if ((ItemConfig_Item *)*effect == local_54) { if (effect != (this->_temporaryeffects)._effects._end) { effect[1] = effect[1] + 1; effect[2] = (local_74->name)._buf + effect[2] + -8; goto LAB_007cd242; } break; } effect = effect + 4; } while (effect != (this->_temporaryeffects)._effects._end); } effect = (this->_temporaryeffects)._effects._end; if (effect == (this->_temporaryeffects)._effects._capacity) { std::vector::_Emplace_reallocate(effect,&local_6c); local_54 = local_6c; } else { *effect = local_54; effect[1] = 0; effect[2] = local_74; effect[3] = 0; ppvVar15 = &(this->_temporaryeffects)._effects._end; *ppvVar15 = (void *)((int)*ppvVar15 + 0x10); } local_70 = (this->_temporaryeffects)._effects._end; pvVar4 = (this->_temporaryeffects)._effects._begin; *(undefined4 *)((((int)local_70 - (int)pvVar4 & 0xfffffff0U) - 0xc) + (int)pvVar4) = 1; effectsOwner = (this->_temporaryeffects)._player; local_6c = local_54; if (effectsOwner != (Entity_Player *)0x0) { local_6c = local_54; AddCostume(effectsOwner,local_54,0); } LAB_007cd242: tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_54->cacheFlags; (this->_temporaryeffects)._shouldEvaluateCache = 1; } } } pvVar4 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 & 0xfffffffcU) < 0x49) { pIVar8 = (ItemConfig_Item *)0x0; } else { pIVar8 = *(ItemConfig_Item **)((int)pvVar4 + 0x48); } AddCostume(spawnedEffect,pIVar8,0); } } LAB_007cd27a: bVar5 = HasCollectible(spawnedEffect,0x19f,0); if (bVar5 != 0) { if (spawnedEffect->field_0x13b5 == '\0') { iVar16 = GetHealthType(spawnedEffect); if ((iVar16 == 1) || (iVar16 == 2)) { iVar16 = spawnedEffect->_maxHearts; } else { iVar16 = spawnedEffect->_maxHearts + spawnedEffect->_boneHearts * 2; } if (iVar16 <= spawnedEffect->_redHearts) { bVar5 = (spawnedEffect->_temporaryeffects)._disabled; if (bVar5 == 0) { piVar9 = (spawnedEffect->_temporaryeffects)._effects._begin; effectsEnd = (spawnedEffect->_temporaryeffects)._effects._end; if (piVar9 != effectsEnd) { do { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x19f)) goto LAB_007cd59e; piVar9 = piVar9 + 4; } while (piVar9 != effectsEnd); bVar5 = (spawnedEffect->_temporaryeffects)._disabled; } } pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if (0x67c < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) { local_54 = *(ItemConfig_Item **)((int)pvVar4 + 0x67c); if (local_54 != (ItemConfig_Item *)0x0) { local_74 = (ItemConfig_Item *)local_54->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = local_54; VStack_64.x = (float)local_74; if (bVar5 == 0) { effect = (this->_temporaryeffects)._effects._begin; if (effect != (this->_temporaryeffects)._effects._end) { do { if ((ItemConfig_Item *)*effect == local_54) { if (effect != (this->_temporaryeffects)._effects._end) { effect[1] = effect[1] + 1; effect[2] = (local_74->name)._buf + effect[2] + -8; goto LAB_007cd3ef; } break; } effect = effect + 4; } while (effect != (this->_temporaryeffects)._effects._end); } effect = (this->_temporaryeffects)._effects._end; if (effect == (this->_temporaryeffects)._effects._capacity) { std::vector::_Emplace_reallocate(effect,&local_6c); local_54 = local_6c; } else { *effect = local_54; effect[1] = 0; effect[2] = local_74; effect[3] = 0; ppvVar15 = &(this->_temporaryeffects)._effects._end; *ppvVar15 = (void *)((int)*ppvVar15 + 0x10); } local_70 = (this->_temporaryeffects)._effects._end; pvVar4 = (this->_temporaryeffects)._effects._begin; *(undefined4 *)((((int)local_70 - (int)pvVar4 & 0xfffffff0U) - 0xc) + (int)pvVar4) = 1 ; effectsOwner = (this->_temporaryeffects)._player; local_6c = local_54; if (effectsOwner != (Entity_Player *)0x0) { local_6c = local_54; AddCostume(effectsOwner,local_54,0); } LAB_007cd3ef: tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_54->cacheFlags; (this->_temporaryeffects)._shouldEvaluateCache = 1; } } } pbVar10 = (spawnedEffect->_crownOfLightSprite)._animState._animData; if (pbVar10 != (byte *)0x0) { if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar14 = "FloatGlow"; do { bVar5 = *pbVar10; bVar18 = bVar5 < (byte)*pcVar14; if (bVar5 != *pcVar14) { LAB_007cd434: uVar6 = -(uint)bVar18 | 1; goto LAB_007cd439; } if (bVar5 == 0) break; bVar5 = pbVar10[1]; bVar18 = bVar5 < (byte)pcVar14[1]; if (bVar5 != pcVar14[1]) goto LAB_007cd434; pbVar10 = pbVar10 + 2; pcVar14 = pcVar14 + 2; } while (bVar5 != 0); uVar6 = 0; LAB_007cd439: if (uVar6 == 0) { if ((*(char *)((int)(spawnedEffect->_crownOfLightSprite)._animState._animData + 0x34) != '\0') && ((spawnedEffect->_crownOfLightSprite)._animState._isPlaying == 0)) { uVar21 = 0x100b6ae50; goto LAB_007cd57d; } goto LAB_007cd59e; } } uVar21 = 0x100b6ae50; goto LAB_007cd57d; } } if ((spawnedEffect->_temporaryeffects)._disabled == 0) { for (piVar9 = (spawnedEffect->_temporaryeffects)._effects._begin; piVar9 != (spawnedEffect->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x19f)) { pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((0x67c < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) && (pIVar8 = *(ItemConfig_Item **)((int)pvVar4 + 0x67c), pIVar8 != (ItemConfig_Item *)0x0) ) { VStack_64.x = (float)pIVar8->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = pIVar8; TemporaryEffects::RemoveEffect(tempEffects,&local_6c,1); } pbVar10 = (spawnedEffect->_crownOfLightSprite)._animState._animData; if (pbVar10 == (byte *)0x0) goto LAB_007cd576; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar14 = "FloatNoGlow"; goto LAB_007cd530; } } } } goto LAB_007cd59e; while( true ) { bVar5 = pbVar11[1]; bVar18 = bVar5 < (byte)pcVar14[1]; if (bVar5 != pcVar14[1]) goto LAB_007cd880; pbVar11 = pbVar11 + 2; pcVar14 = pcVar14 + 2; if (bVar5 == 0) break; LAB_007cd860: bVar5 = *pbVar11; bVar18 = bVar5 < (byte)*pcVar14; if (bVar5 != *pcVar14) { LAB_007cd880: uVar6 = -(uint)bVar18 | 1; goto LAB_007cd885; } if (bVar5 == 0) break; } uVar6 = 0; LAB_007cd885: if ((uVar6 != 0) || ((pbVar10[0x34] != 0 && ((spawnedEffect->_darkPrincesCrownSprite)._animState._isPlaying == 0)))) { LAB_007cd8a4: uVar21 = 0x100b6ae44; goto LAB_007cd8ab; } goto LAB_007cd8c2; while( true ) { bVar5 = pbVar10[1]; bVar18 = bVar5 < (byte)pcVar14[1]; if (bVar5 != pcVar14[1]) goto LAB_007cd550; pbVar10 = pbVar10 + 2; pcVar14 = pcVar14 + 2; if (bVar5 == 0) break; LAB_007cd530: bVar5 = *pbVar10; bVar18 = bVar5 < (byte)*pcVar14; if (bVar5 != *pcVar14) { LAB_007cd550: uVar6 = -(uint)bVar18 | 1; goto LAB_007cd555; } if (bVar5 == 0) break; } uVar6 = 0; LAB_007cd555: if ((uVar6 != 0) || ((*(char *)((int)(spawnedEffect->_crownOfLightSprite)._animState._animData + 0x34) != '\0' && ((spawnedEffect->_crownOfLightSprite)._animState._isPlaying == 0)))) { LAB_007cd576: uVar21 = 0x100b6ae44; LAB_007cd57d: bVar5 = ANM2::SetAnimation(&spawnedEffect->_crownOfLightSprite,(byte *)uVar21, (byte)((ulonglong)uVar21 >> 0x20)); if (bVar5 != 0) { AnimationState::Rewind(&(spawnedEffect->_crownOfLightSprite)._animState); tempEffects = &spawnedEffect->_temporaryeffects; (spawnedEffect->_crownOfLightSprite)._animState._isPlaying = 1; } } LAB_007cd59e: bVar5 = HasCollectible(spawnedEffect,0x1ba,0); if (bVar5 == 0) goto LAB_007cd90a; if (*(int *)&g_game->_deathmatchManager < 2) { if (spawnedEffect->_redHearts != 2) goto LAB_007cd606; LAB_007cd657: local_55 = (spawnedEffect->_temporaryeffects)._disabled; if (local_55 == 0) { for (piVar9 = (spawnedEffect->_temporaryeffects)._effects._begin; piVar9 != (spawnedEffect->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (*(int *)(*piVar9 + 4) == 0x1ba)) goto LAB_007cd8c2; } } pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if (0x6e8 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) { local_54 = *(ItemConfig_Item **)((int)pvVar4 + 0x6e8); if (local_54 != (ItemConfig_Item *)0x0) { local_74 = (ItemConfig_Item *)local_54->maxCooldown; uStack_68 = 0; VStack_64.y = 0.0; local_6c = local_54; VStack_64.x = (float)local_74; if (local_55 == 0) { effect = (tempEffects->_effects)._begin; if (effect != (tempEffects->_effects)._end) { do { if ((ItemConfig_Item *)*effect == local_54) { if (effect != (tempEffects->_effects)._end) { effect[1] = effect[1] + 1; effect[2] = (local_74->name)._buf + effect[2] + -8; goto LAB_007cd76f; } break; } effect = effect + 4; } while (effect != (tempEffects->_effects)._end); } effect = (tempEffects->_effects)._end; if (effect == (tempEffects->_effects)._capacity) { std::vector::_Emplace_reallocate(effect,&local_6c); local_54 = local_6c; } else { *effect = local_54; effect[1] = 0; effect[2] = local_74; effect[3] = 0; ppvVar15 = &(tempEffects->_effects)._end; *ppvVar15 = (void *)((int)*ppvVar15 + 0x10); } local_70 = (tempEffects->_effects)._end; pvVar4 = (tempEffects->_effects)._begin; *(undefined4 *)((((int)local_70 - (int)pvVar4 & 0xfffffff0U) - 0xc) + (int)pvVar4) = 1; local_6c = local_54; if (tempEffects->_player != (Entity_Player *)0x0) { local_6c = local_54; AddCostume(tempEffects->_player,local_54,0); } LAB_007cd76f: tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_54->cacheFlags; tempEffects->_shouldEvaluateCache = 1; } } } pbVar10 = (spawnedEffect->_darkPrincesCrownSprite)._animState._animData; if (pbVar10 == (byte *)0x0) { LAB_007cd7e4: uVar21 = 0x100b6ae50; } else { pbVar11 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar11 = *(byte **)pbVar10; } pcVar14 = "FloatGlow"; do { bVar5 = *pbVar11; bVar18 = bVar5 < (byte)*pcVar14; if (bVar5 != *pcVar14) { LAB_007cd7b4: uVar6 = -(uint)bVar18 | 1; goto LAB_007cd7b9; } if (bVar5 == 0) break; bVar5 = pbVar11[1]; bVar18 = bVar5 < (byte)pcVar14[1]; if (bVar5 != pcVar14[1]) goto LAB_007cd7b4; pbVar11 = pbVar11 + 2; pcVar14 = pcVar14 + 2; } while (bVar5 != 0); uVar6 = 0; LAB_007cd7b9: if (uVar6 != 0) goto LAB_007cd7e4; if ((pbVar10[0x34] == 0) || ((spawnedEffect->_darkPrincesCrownSprite)._animState._isPlaying != 0)) goto LAB_007cd8c2; uVar21 = 0x100b6ae50; } LAB_007cd8ab: bVar5 = ANM2::SetAnimation(&spawnedEffect->_darkPrincesCrownSprite,(byte *)uVar21, (byte)((ulonglong)uVar21 >> 0x20)); if (bVar5 != 0) { AnimationState::Rewind(&(spawnedEffect->_darkPrincesCrownSprite)._animState); (spawnedEffect->_darkPrincesCrownSprite)._animState._isPlaying = 1; } } else { fVar19 = (float)spawnedEffect->_redHearts / (float)spawnedEffect->_maxHearts; if ((0.1 <= fVar19) && (fVar19 <= 0.3)) goto LAB_007cd657; LAB_007cd606: if ((spawnedEffect->_temporaryeffects)._disabled == 0) { for (piVar9 = (spawnedEffect->_temporaryeffects)._effects._begin; piVar9 != (spawnedEffect->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) { iVar16 = *(int *)*piVar9; if ((((iVar16 == 1) || (iVar16 == 3)) || (iVar16 == 4)) && (((int *)*piVar9)[1] == 0x1ba)) { pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((0x6e8 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) && (iVar16 = *(int *)((int)pvVar4 + 0x6e8), iVar16 != 0)) { local_78 = *(float *)(iVar16 + 0x78); local_80[1] = 0; local_74 = (ItemConfig_Item *)0x0; local_80[0] = iVar16; TemporaryEffects::RemoveEffect(&spawnedEffect->_temporaryeffects,local_80,1); } pbVar10 = (spawnedEffect->_darkPrincesCrownSprite)._animState._animData; if (pbVar10 == (byte *)0x0) goto LAB_007cd8a4; pbVar11 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar11 = *(byte **)pbVar10; } pcVar14 = "FloatNoGlow"; goto LAB_007cd860; } } } } LAB_007cd8c2: bVar5 = HasCollectible(spawnedEffect,0x19f,0); if (bVar5 == 0) { (spawnedEffect->_darkPrincesCrownSprite)._offset.x = g_vectorZero.x; (spawnedEffect->_darkPrincesCrownSprite)._offset.y = g_vectorZero.y; } else { (spawnedEffect->_darkPrincesCrownSprite)._offset.x = 0.0; (spawnedEffect->_darkPrincesCrownSprite)._offset.y = -7.0; } LAB_007cd90a: spawnedEffect->_cacheFlags = spawnedEffect->_cacheFlags | 0xffff; spawnedEffect->_itemHoldCooldown = 10; EvaluateItems(); stop_costume_item_anims(spawnedEffect); update_player_skin(spawnedEffect); update_purity_glow(spawnedEffect); ExceptionList = local_1c; return 1; } //@@ 007cd950 Entity_Player::Teleport /* DB: TeleportUp/TeleportDown strings; recurses for twin at +0x1e68; ZHL put the name on 008c99b0 prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity_Player::Teleport (Entity_Player *this,Vector *position,byte doEffects,byte teleportTwinPlayers) { EntityPtr this_00; byte bVar1; uint uVar2; Entity *pEVar3; LayerState *layer; int gridIndex; Vector *vecResult; void *familiarData; char *cmpAnimChar; ANM2 *familiar; qword *allocCounter; byte *pbVar4; bool bVar5; float fVar6; float gridXf; float fVar7; undefined3 in_stack_0000000d; ANM2 spriteCopy; Vector followPos; Vector freePos; Vector dropPos; EntityList_EL familiars; Vector local_24; Entity_Player *local_1c; Room *local_18; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Familiar *familiar; Game *game; Manager *manager; Room *poofSprite; qword prevAllocated; local_8 = 0xffffffff; puStack_c = &LAB_00b0017d; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = this; if ((teleportTwinPlayers != 0) && (this_00 = this->_twinPlayer, this_00 != (EntityPtr)0x0)) { _teleportTwinPlayers = (this->_pos).x; local_18 = (Room *)(this->_pos).y; fVar7 = _teleportTwinPlayers - ((Vector *)((int)this_00 + 0x33c))->x; fVar6 = (float)local_18 - *(float *)((int)this_00 + 0x340); fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); if (fVar6 <= 52.0) { _teleportTwinPlayers = ((Vector *)((int)this_00 + 0x33c))->x - _teleportTwinPlayers; local_14 = (Entity *)(*(float *)((int)this_00 + 0x340) - (float)local_18); fVar6 = sqrtf(_teleportTwinPlayers * _teleportTwinPlayers + (float)local_14 * (float)local_14) ; if (fVar6 <= 0.0) { fVar7 = _teleportTwinPlayers; pEVar3 = local_14; } else { fVar7 = (1.0 / fVar6) * _teleportTwinPlayers; pEVar3 = (Entity *)((float)local_14 * (1.0 / fVar6)); } local_24.x = fVar7 * 10.0 + position->x; local_24.y = (float)pEVar3 * 10.0 + position->y; Teleport((Entity_Player *)this_00,&local_24,doEffects,0); } } if (doEffects == 0) goto LAB_007cdbce; uVar2 = Random(); pEVar3 = Game::Spawn(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar2); local_14 = pEVar3; ANM2::ANM2(&spriteCopy,&this->_sprite); local_18 = (Room *)&pEVar3->_sprite; Isaac::SwapANM2((ANM2 *)local_18,&spriteCopy); local_8 = 0; ANM2::Reset(familiar); AnimationState::~AnimationState(&spriteCopy._overlayAnimState); AnimationState::~AnimationState(&spriteCopy._animState); std::string::_Tidy_deallocate(spriteCopy._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&spriteCopy); poofSprite = local_18; local_8 = 0xffffffff; pbVar4 = (byte *)0x0; if ((local_14->_sprite)._layerCount != 0) { do { _teleportTwinPlayers = (float)CONCAT13(pbVar4 == (byte *)0xc,_teleportTwinPlayers); layer = ANM2::GetLayer((ANM2 *)poofSprite,pbVar4); pbVar4 = pbVar4 + 1; layer->_visible = in_stack_0000000d._2_1_; } while (pbVar4 < (byte *)(local_14->_sprite)._layerCount); this = local_1c; } poofSprite = local_18; pbVar4 = local_18->_gridEntities[4]; if (pbVar4 == (byte *)0x0) { LAB_007cdba8: bVar1 = ANM2::SetAnimation((ANM2 *)local_18,(byte *)"TeleportUp",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(poofSprite->_gridEntities + 3)); *(undefined1 *)(poofSprite->_gridEntities + 8) = 1; } } else { if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } cmpAnimChar = "TeleportUp"; do { bVar1 = *pbVar4; bVar5 = bVar1 < (byte)*cmpAnimChar; if (bVar1 != *cmpAnimChar) { LAB_007cdb90: uVar2 = -(uint)bVar5 | 1; goto LAB_007cdb95; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar5 = bVar1 < (byte)cmpAnimChar[1]; if (bVar1 != cmpAnimChar[1]) goto LAB_007cdb90; pbVar4 = pbVar4 + 2; cmpAnimChar = cmpAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_007cdb95: if ((uVar2 != 0) || ((*(char *)((int)local_18->_gridEntities[4] + 0x34) != '\0' && (*(char *)(local_18->_gridEntities + 8) == '\0')))) goto LAB_007cdba8; } (**(code **)(*(int *)local_14 + 0xc))(); LAB_007cdbce: (this->_pos).x = position->x; (this->_pos).y = position->y; game = g_game; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; EntityList::QuerySublist((EntityList *)((int)game->_room + 0x1218),&familiars,3,-1,-1,1,0); local_8 = 1; fVar6 = 0.5; _teleportTwinPlayers = 0.0; if (familiars._size != 0) { fVar7 = 40.0; familiarData = familiars._data; do { familiar = *(Entity_Familiar **)((int)familiarData + (int)_teleportTwinPlayers * 4); if (familiar->_player == this) { bVar1 = Entity_Familiar::is_detached_from_follow(familiar); if (((bVar1 == 0) && (familiar->_orbitLayer < 0)) && (familiar->_variant != 0x3e)) { if (familiar->_variant == 900) { dropPos.x = position->x; dropPos.y = position->y; local_18 = g_game->_room; gridXf = (position->x - fVar7) / fVar7 + fVar6; gridIndex = (int)((position->y - 120.0) / fVar7 + fVar6); local_1c = (Entity_Player *)(int)gridXf; if ((((int)local_1c < 0) || (local_18->_gridWidth <= (int)local_1c)) || ((gridIndex < 0 || (local_18->_gridHeight <= gridIndex)))) { gridIndex = -1; } else { gridIndex = gridIndex * local_18->_gridWidth + (int)gridXf; } local_24.y = dropPos.y; local_14 = (Entity *)dropPos.x; uVar2 = Room::GetGridCollision(local_18,gridIndex); if (uVar2 == 0) { pEVar3 = local_14; fVar6 = local_24.y; } else { vecResult = Room::FindFreePickupSpawnPosition(local_18,&freePos,&dropPos,0.0,1,0,0); pEVar3 = (Entity *)vecResult->x; fVar6 = vecResult->y; } (familiar->_pos).x = (float)pEVar3; (familiar->_pos).y = fVar6; (familiar->_targetPosition).x = (float)pEVar3; (familiar->_targetPosition).y = fVar6; goto LAB_007cdd90; } } else { vecResult = Entity_Familiar::GetFollowTargetPosition(familiar,&followPos,0); (familiar->_pos).x = vecResult->x; (familiar->_pos).y = vecResult->y; LAB_007cdd90: fVar6 = 0.5; fVar7 = 40.0; } familiarData = familiars._data; } _teleportTwinPlayers = (float)((int)_teleportTwinPlayers + 1); } while ((uint)_teleportTwinPlayers < (uint)familiars._size); } if (doEffects != 0) { this->_isPlayingItemAnimation = 0; ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"TeleportDown",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 1; this->_isPlayingItemAnimation = 0; if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,10.0); } manager = g_manager; this->_controlsCooldown = 3; _teleportTwinPlayers = 2.99878e-43; seed_fart_sound_override((int *)&teleportTwinPlayers); SoundEffects::Play(&manager->_sfxManager,(int)_teleportTwinPlayers,0.5,10,0,1.0,0.0); Entity_Effect::CreateTimer(FUN_007cdee0,6,0,0); } if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar2 = *(uint *)((int)familiars._data + -4); prevAllocated = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)prevAllocated < uVar2); free((uint *)((int)familiars._data + -4)); } } ExceptionList = local_10; return; } //@@ 007cdee0 FUN_007cdee0 void FUN_007cdee0(void) { Manager *pMVar1; int local_8; pMVar1 = g_manager; local_8 = 0xd7; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,0.75,10,0,1.0,0.0); return; } //@@ 007cdf30 teleport_to_random_room_of_types /* DB: no ECX; arg1 vector of room types, arg2 bool prefer-unvisited: walks the level room list (g_game+0x14 stride 0xb8, count +0x182cc, current dimension +0x1830c) collecting rooms whose RoomConfig type is in the list (set dedups), RNG-picks one (prefers unvisited when arg2) and calls Game::StartRoomTransition(idx,-1,3); returns true if it teleported; UsePill builds the type list (0xb/0x18/0x9/0xd) and TakeDamage pushes 20/21/24 */ undefined1 teleport_to_random_room_of_types(undefined4 *param_1,char param_2) { code *pcVar1; Game *this; undefined1 uVar2; int *piVar3; void *pvVar4; int roomIndex; uint uVar5; void *pvVar6; uint uVar7; uint *puVar8; int *piVar9; int *piVar10; undefined1 local_64 [8]; void *local_5c; void *local_58; int *local_54; int *local_50; void *local_4c; int *local_48; int *local_44; undefined1 local_40 [8]; void *local_38; undefined4 local_34; Entity_Player *local_30; int local_2c; int local_28; int *local_24; int *local_20; int *local_1c; void *local_18; undefined1 local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b001bd; local_10 = ExceptionList; ExceptionList = &local_10; local_11 = 0; local_38 = (void *)0x0; local_34 = 0; local_38 = operator_new(0x14); *(void **)local_38 = local_38; *(void **)((int)local_38 + 4) = local_38; *(void **)((int)local_38 + 8) = local_38; *(undefined2 *)((int)local_38 + 0xc) = 0x101; local_20 = (int *)0x0; piVar10 = (int *)0x0; local_4c = (void *)0x0; local_48 = (int *)0x0; local_44 = (int *)0x0; local_1c = (int *)0x0; piVar9 = (int *)0x0; local_18 = (void *)0x0; local_58 = (void *)0x0; local_54 = (int *)0x0; local_50 = (int *)0x0; local_8 = 2; local_28 = 0; if (0 < g_game->_nbRooms) { local_2c = 0; do { local_24 = (int *)((int)g_game->_roomList[0]._doors + local_2c + -0x1c); if ((local_24[4] != 0) && (local_24[3] == g_game->_currentDimensionIdx)) { uVar5 = 0; piVar3 = (int *)*param_1; uVar7 = param_1[1] - (int)piVar3 >> 2; if (uVar7 != 0) { do { if (*(int *)(local_24[4] + 8) == *piVar3) { pvVar6 = (void *)*local_24; local_18 = pvVar6; std::set::find_node(local_64,&local_18); if ((*(char *)((int)local_5c + 0xd) != '\0') || (pvVar4 = local_5c, (int)pvVar6 < *(int *)((int)local_5c + 0x10))) { pvVar4 = local_38; } if (pvVar4 == local_38) { std::set::insert(local_40,&local_18); if ((local_24[0x10] == 0) && (param_2 != '\0')) { if (piVar10 == local_20) { std::vector::_Emplace_reallocate(piVar10,&local_18); local_20 = local_44; piVar10 = local_48; } else { *piVar10 = (int)local_18; local_48 = piVar10 + 1; piVar10 = local_48; } } else if (piVar9 == local_1c) { std::vector::_Emplace_reallocate(piVar9,&local_18); local_1c = local_50; piVar9 = local_54; } else { *piVar9 = (int)local_18; local_54 = piVar9 + 1; piVar9 = local_54; } } break; } uVar5 = uVar5 + 1; piVar3 = piVar3 + 1; } while (uVar5 < uVar7); } } local_28 = local_28 + 1; local_2c = local_2c + 0xb8; } while (local_28 < g_game->_nbRooms); local_18 = local_58; } pvVar4 = local_4c; uVar5 = (int)piVar10 - (int)local_4c >> 2; pvVar6 = (local_30->_pillRNGs)._begin; puVar8 = (uint *)((int)pvVar6 + 0x130); local_58 = local_18; if (uVar5 == 0) { uVar5 = (int)piVar9 - (int)local_18 >> 2; if (uVar5 != 0) { uVar7 = *puVar8; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar8; if (uVar7 == 0) { pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } } uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar6 + 0x134) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)((int)pvVar6 + 0x138) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar6 + 0x13c) & 0x1f) ^ uVar7; *puVar8 = uVar7; roomIndex = *(int *)((int)local_18 + (uVar7 % uVar5) * 4); goto LAB_007ce1a7; } } else { uVar7 = *puVar8; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar7 = *puVar8; if (uVar7 == 0) { pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } } uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar6 + 0x134) & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)*(undefined4 *)((int)pvVar6 + 0x138) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)*(undefined4 *)((int)pvVar6 + 0x13c) & 0x1f) ^ uVar7; *puVar8 = uVar7; roomIndex = *(int *)((int)pvVar4 + (uVar7 % uVar5) * 4); LAB_007ce1a7: this = g_game; if (roomIndex != 0) { g_game->_leaveDoor = -1; Game::StartRoomTransition(this,roomIndex,-1,3,local_30,-1); local_11 = 1; } } if (local_18 != (void *)0x0) { uVar5 = (int)local_1c - (int)local_18 & 0xfffffffc; pvVar6 = local_18; if (0xfff < uVar5) { pvVar6 = *(void **)((int)local_18 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_18 + (-4 - (int)pvVar6))) goto LAB_007ce227; } operator_delete(pvVar6,uVar5); } if (pvVar4 != (void *)0x0) { uVar5 = (int)local_20 - (int)pvVar4 & 0xfffffffc; pvVar6 = pvVar4; if (0xfff < uVar5) { pvVar6 = *(void **)((int)pvVar4 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)pvVar6))) { LAB_007ce227: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar5); } FID_conflict__Erase_tree_>_> (&local_38,(fuzzer_allocator_> *)&local_38, *(_Tree_node **)((int)local_38 + 4)); operator_delete(local_38,0x14); ExceptionList = local_10; return local_11; } //@@ 007ce270 Entity_Player::GetMainPlayer /* DB: ? parent 0x3bc if player else player 0 for variant 1 prototype: db/protos.zhl */ Entity_Player * __thiscall Entity_Player::GetMainPlayer(Entity_Player *this) { Entity_Player *pEVar1; EntityPtr EVar2; EVar2 = this->_parent; if ((EVar2 == (EntityPtr)0x0) || (*(int *)((int)EVar2 + 0x28) != 1)) { if (this->_variant == 1) { pEVar1 = Game::GetPlayer(g_game,0); return pEVar1; } EVar2 = (EntityPtr)0x0; } return (Entity_Player *)EVar2; } //@@ 007ce2a0 Entity_Player::CanRerollCollectible /* ZHL [exact] __thiscall bool Entity_Player::CanRerollCollectible(int id, bool unk); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Player::CanRerollCollectible(Entity_Player *this,int id,byte unk) { int iVar1; byte bVar2; ChallengeParam *pCVar3; int iVar4; Manager *this_00; int *piVar5; bool bVar6; if (id == 0x102) { return 0; } if (id == 0x290) { return 0; } bVar2 = ItemConfig::IsQuestItem(id); if (bVar2 != 0) { return 0; } if (g_game->_challenge != 0) { bVar6 = false; pCVar3 = Manager::GetChallengeParams(this_00,g_game->_challenge); piVar5 = (pCVar3->_collectibleList)._begin; iVar4 = (int)(pCVar3->_collectibleList)._end - (int)piVar5 >> 2; if (iVar4 != 0) { do { iVar1 = *piVar5; piVar5 = piVar5 + 1; if (iVar1 == id) { bVar6 = true; } iVar4 = iVar4 + -1; } while (iVar4 != 0); if (bVar6) { return 0; } } } if (unk == 0) { iVar4 = this->_playerType; if (iVar4 == 2) { bVar6 = id == 0x2e; } else if (iVar4 == 5) { if (id == 0x75) { return 0; } bVar6 = id == 0x7a; } else if (iVar4 == 6) { bVar6 = id == 0x9d; } else if (iVar4 == 8) { bVar6 = id == 0xd6; } else if (iVar4 == 10) { bVar6 = id == 0x139; } else { if (iVar4 != 0xd) { if (iVar4 != 0x12) { return 1; } if (id == 0x248) { return 0; } return 1; } if (id == 0x168) { return 0; } bVar6 = id == 0x19c; } if (bVar6) { return 0; } } return 1; } //@@ 007ce390 Entity_Player::GetGreedsGulletHearts /* ZHL [exact] __thiscall int Entity_Player::GetGreedsGulletHearts(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Player::GetGreedsGulletHearts(Entity_Player *this) { byte bVar1; int iVar2; int iVar3; iVar3 = 0; bVar1 = HasCollectible(this,0x1f5,0); if (bVar1 != 0) { iVar2 = this->_numCoins; if (99 < iVar2) { iVar3 = GetTrinketMultiplier(this,0x9c); return iVar3 + iVar2 / 100 + 3; } if (iVar2 == 99) { iVar3 = GetTrinketMultiplier(this,0x9c); return iVar3 + 4; } iVar3 = 0; if (0 < iVar2) { iVar3 = iVar2; } iVar3 = iVar3 / 0x19; } iVar2 = GetTrinketMultiplier(this,0x9c); return iVar2 + iVar3; } //@@ 007ce420 Entity_Player::update_greeds_gullet /* ZHL [exact] __thiscall void Entity_Player::update_greeds_gullet(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::update_greeds_gullet(Entity_Player *this) { byte isHeld; int iVar1; int iVar2; int iVar3; short cappedHearts; short sVar4; int amount; short extraout_DX; int extraout_EDX; int extraout_EDX_00; Entity_Player *healthPlayer; if (g_game->_isRestoringGlowingHourglassState != 0) { return; } if (g_game->_isStartingFromState != 0) { return; } healthPlayer = this; if ((this->_playerType == 0x11) && ((Entity_Player *)this->_subPlayer != (Entity_Player *)0x0)) { healthPlayer = (Entity_Player *)this->_subPlayer; } if (healthPlayer->_isUpdatingGreedsGullet != 0) { return; } healthPlayer->_isUpdatingGreedsGullet = 1; sVar4 = this->_greedsGulletHearts; iVar1 = (int)sVar4; this->_isUpdatingGreedsGullet = 1; iVar2 = GetHealthType(healthPlayer); switch(iVar2) { case 0: case 3: iVar2 = healthPlayer->_maxHearts; break; case 1: iVar2 = healthPlayer->_soulHearts + 1; break; default: goto switchD_007ce498_caseD_2; case 4: cappedHearts = (short)healthPlayer->_boneHearts + this->_greedsGulletOverflow; if (cappedHearts < sVar4) { sVar4 = cappedHearts; } goto LAB_007ce4e1; } cappedHearts = (short)(iVar2 >> 1) + this->_greedsGulletOverflow; if (cappedHearts < sVar4) { sVar4 = cappedHearts; } LAB_007ce4e1: this->_greedsGulletHearts = sVar4; switchD_007ce498_caseD_2: if (sVar4 < iVar1) { isHeld = HasTrinket(this,0x9c,0); if (isHeld != 0) { TryRemoveTrinket(this,0x9c); iVar1 = iVar1 + -1; } if (this->_greedsGulletHearts < iVar1) { do { iVar1 = iVar1 + -1; if (iVar1 < 3) { iVar2 = -0x19; } else if (iVar1 == 3) { iVar2 = -0x18; } else { iVar2 = (iVar1 != 4) - 0x65; } AddCoins(this,iVar2); } while (this->_greedsGulletHearts < iVar1); } } iVar1 = GetGreedsGulletHearts(this); iVar2 = (int)this->_greedsGulletHearts; if ((iVar1 != iVar2) || (0 < this->_greedsGulletOverflow)) { if ((1 < *(int *)&g_game->_deathmatchManager) && ((iVar2 < iVar1 && (this->_greedsGulletRedHearts < iVar1)))) { iVar3 = scale_for_hard_difficulty((iVar1 - iVar2) * 2); this->_redHearts = this->_redHearts + iVar3; this->_greedsGulletRedHearts = extraout_DX; } iVar3 = GetHealthType(healthPlayer); sVar4 = (short)iVar1; switch(iVar3) { case 0: case 3: iVar3 = (this->_greedsGulletOverflow - iVar2) + extraout_EDX; iVar1 = healthPlayer->_maxHearts; iVar2 = iVar3 * 8; if (*(int *)&g_game->_deathmatchManager < 2) { iVar2 = iVar3; } AddMaxHearts(healthPlayer,iVar3 * 2,0); this->_greedsGulletHearts = sVar4; iVar1 = (iVar2 + (iVar1 >> 1)) - (healthPlayer->_maxHearts >> 1); break; case 1: iVar2 = scale_for_hard_difficulty(extraout_EDX + (this->_greedsGulletOverflow - iVar2)); iVar1 = healthPlayer->_soulHearts; AddSoulHearts(healthPlayer,extraout_EDX_00 * 2,0); this->_greedsGulletHearts = sVar4; iVar1 = ((iVar1 + 1 >> 1) + iVar2) - (healthPlayer->_soulHearts + 1 >> 1); break; default: goto switchD_007ce5c5_caseD_2; case 4: iVar2 = scale_for_hard_difficulty((this->_greedsGulletOverflow - iVar2) + extraout_EDX); iVar1 = healthPlayer->_boneHearts; AddBoneHearts(healthPlayer,amount); this->_greedsGulletHearts = sVar4; iVar1 = (iVar2 + iVar1) - healthPlayer->_boneHearts; } sVar4 = 0; if (0 < iVar1) { sVar4 = (short)iVar1; } this->_greedsGulletOverflow = sVar4; } switchD_007ce5c5_caseD_2: healthPlayer->_isUpdatingGreedsGullet = 0; this->_isUpdatingGreedsGullet = 0; return; } //@@ 007ce6e0 Entity_Player::ChangePlayerType /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:ChangePlayerType prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::ChangePlayerType(Entity_Player *this,int playerType,byte unk) { code *pcVar1; byte bVar2; Entity_Player *pEVar3; ItemConfig_Item *Item; float *pfVar4; int iVar5; void *pvVar6; Vector *pos; byte *nameCursor; int *extraout_EAX; Entity_Player *subPlayer; undefined4 extraout_ECX; int *piVar7; uint uVar8; uint uVar9; void *pvVar10; int iVar11; bool isLess; RNG heartRng; int twinRedHearts; int local_50; int twinRottenHearts; int oldPlayerType; float local_44; uint local_40; Entity_Player *local_3c; Vector local_38; byte local_2d; Entity_Player *animName [4]; void *animNameSize; float animNameCapacity; uint local_14; void *local_10; undefined1 *puStack_c; Entity_Player *local_8; byte *curAnim; uint *flagsHigh; Game *game; qword oldFlags; short *smeltedCount; EntityPtr twinPlayer; local_8 = (Entity_Player *)0xffffffff; puStack_c = &LAB_00b001ff; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(animName + 10); if (playerType < 0) { return; } ExceptionList = &local_10; local_3c = this; if (unk != 0) { if (playerType == 0x10) { if (this->_playerType == 0x11) { LAB_007cea0f: SwapForgottenForm(this,1,1); ExceptionList = local_10; return; } } else if ((playerType == 0x11) && (this->_playerType == 0x10)) goto LAB_007cea0f; } uVar8 = 0; if (((this->_playerType == 0x12) && (local_38.y = (float)this->_effectiveSoulCharge, 0 < (int)local_38.y)) && (unk == 0)) { iVar11 = 0; iVar5 = iVar11; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pEVar3 = Game::GetPlayer(g_game,uVar8); iVar11 = iVar5 + 1; if (pEVar3->_playerType != 0x12) { iVar11 = iVar5; } uVar8 = uVar8 + 1; iVar5 = iVar11; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } uVar8 = (int)local_38.y / iVar11; if (uVar8 == 0) { uVar8 = 1; } } RemoveSkinCostume(this); oldPlayerType = this->_playerType; if (oldPlayerType == 0xb) { oldPlayerType = 0xb; local_38.y = (float)(g_manager->_entityConfig)._players._begin; if ((8 < ((int)(g_manager->_entityConfig)._players._end - (int)local_38.y) / 0x148) && ((void *)local_38.y != (void *)0xfffff5c0)) { oldPlayerType = 0xb; if (*(int *)((int)local_38.y + 0xaec) != -1) { Item = Config::GetNullItem(&g_manager->_itemConfig,*(int *)((int)local_38.y + 0xaec)); RemoveCostume(this,Item); oldPlayerType = this->_playerType; } } } this->_playerType = playerType; if (0 < (int)uVar8) { AddSoulCharge(this,-uVar8); AddSoulHearts(this,uVar8,0); } if (oldPlayerType == 0x23) { twinPlayer = this->_twinPlayer; if (twinPlayer != (EntityPtr)0x0) { local_38.x = *(float *)((int)twinPlayer + 0x33c); local_38.y = *(float *)((int)twinPlayer + 0x340); Teleport(this,&local_38,0,0); } oldFlags = this->_flags; flagsHigh = (uint *)((int)&this->_flags + 4); *flagsHigh = *flagsHigh & 0xfbffffff; (this->_posOffset).y = 0.0; this->_heightVelocity = 0.0; *(int *)&this->_flags = (int)oldFlags; } pEVar3 = (Entity_Player *)GetHealthType(this); local_40 = this->_subPlayer; if (local_40 != 0) { iVar11 = this->_soulHearts; iVar5 = this->_boneHearts; bVar2 = (byte)((iVar11 + 1) / 2); local_3c->_maxHearts = local_3c->_maxHearts + *(int *)(local_40 + 0x1340); local_3c->_redHearts = local_3c->_redHearts + *(int *)(local_40 + 0x1344); local_3c->_soulHearts = *(int *)(local_40 + 0x134c) + iVar11; iVar11 = local_3c->_subPlayer; local_3c->_boneHearts = *(int *)(local_40 + 0x1d88) + iVar5; local_3c->_blackHearts = local_3c->_blackHearts | *(int *)(iVar11 + 0x1350) << (bVar2 & 0x1f); local_3c->_boneHeartsMask = local_3c->_boneHeartsMask | *(int *)(iVar11 + 0x1d8c) << ((char)iVar5 + bVar2 & 0x1f); local_3c->_eternalHearts = local_3c->_eternalHearts + *(int *)(iVar11 + 0x1348); local_3c->_rottenHearts = local_3c->_rottenHearts + *(int *)(iVar11 + 0x1da4); local_3c->_goldenHearts = local_3c->_goldenHearts + *(int *)(iVar11 + 0x194c); this = local_3c; } local_38.y = (float)pEVar3; init_forgotten_twin(this); if ((Entity_Player *)this->_subPlayer != (Entity_Player *)0x0) { iVar11 = GetHealthType((Entity_Player *)this->_subPlayer); if (iVar11 == 1) { subPlayer->_soulHearts = this->_soulHearts; *(int *)(this->_subPlayer + 0x1350) = this->_blackHearts; this->_soulHearts = 0; this->_blackHearts = 0; } else if (iVar11 == 4) { AddBoneHearts(subPlayer,this->_boneHearts); *(int *)(this->_subPlayer + 0x1344) = this->_redHearts; this->_redHearts = 0; this->_boneHearts = 0; this->_boneHeartsMask = 0; } if (1 < this->_eternalHearts) { this->_eternalHearts = this->_eternalHearts + -1; piVar7 = (int *)(this->_subPlayer + 0x1348); *piVar7 = *piVar7 + 1; } update_bone_hearts((Entity_Player *)this->_subPlayer); } if (pEVar3 == (Entity_Player *)0x2) { this->_rottenHearts = 0; this->_boneHeartsMask = 0; this->_boneHearts = 0; this->_eternalHearts = 0; this->_maxHearts = 0; this->_redHearts = 0; this->_soulHearts = 1; LAB_007ceb8b: this->_blackHearts = 0; } else { if (pEVar3 == (Entity_Player *)0x3) { local_38.y = 1.4013e-45; pfVar4 = &local_38.y; if (this->_brokenHearts < 2) { pfVar4 = (float *)&this->_brokenHearts; } this->_brokenHearts = (int)*pfVar4; AddMaxHearts(this,4,0); this->_rottenHearts = 0; this->_boneHeartsMask = 0; this->_boneHearts = 0; LAB_007ceb81: this->_soulHearts = 0; goto LAB_007ceb8b; } if (pEVar3 == (Entity_Player *)0x1) { this->_rottenHearts = 0; this->_maxHearts = 0; this->_redHearts = 0; } else if (pEVar3 == (Entity_Player *)&DAT_00000004) { iVar11 = this->_maxHearts; this->_maxHearts = 0; iVar11 = iVar11 / 2; if (0 < iVar11) { AddBoneHearts(this,iVar11); } local_38.y = (float)GetEffectiveMaxHearts(this); piVar7 = &this->_redHearts; pfVar4 = &local_38.y; if (*piVar7 <= (int)local_38.y) { pfVar4 = (float *)piVar7; } *piVar7 = (int)*pfVar4; goto LAB_007ceb81; } } if (this->_isCoopGhost == 0) { TryPreventDeath(this); } update_bone_hearts(this); UpdateHeartDependentEffects(this); UpdateCanShoot(this); AddEternalHearts(this,0); twinPlayer = this->_twinPlayer; if (twinPlayer == (EntityPtr)0x0) { LAB_007ceccc: if (this->_playerType == 0x13) { LAB_007cecd9: if (unk == 0) { local_3c = InitTwin(this,0x14); InitPostLevelInitStats(local_3c); heartRng._shift3 = 0x17; heartRng._seed = *(uint *)((int)(this->_collectibleRNGs)._begin + 0x1e20); heartRng._shift1 = 8; heartRng._shift2 = 9; uVar9 = (this->_maxHearts + 1) / 2; uVar8 = uVar9 & 0x80000001; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffe) + 1; } uVar8 = RNG::RandomInt(&heartRng,uVar8 + 1); uVar8 = (uVar8 + (int)uVar9 / 2) * 2; uVar9 = this->_boneHearts & 0x80000001; if ((int)uVar9 < 0) { uVar9 = (uVar9 - 1 | 0xfffffffe) + 1; } local_40 = uVar8; uVar9 = RNG::RandomInt(&heartRng,uVar9 + 1); local_50 = uVar9 + this->_boneHearts / 2; iVar11 = uVar8 + local_50 * 2; uVar8 = this->_redHearts; uVar9 = uVar8 & 0x80000001; if ((int)uVar9 < 0) { uVar9 = (uVar9 - 1 | 0xfffffffe) + 1; } uVar9 = RNG::RandomInt(&heartRng,uVar9 + 1); twinRedHearts = uVar9 + (int)uVar8 / 2; if (iVar11 < twinRedHearts) { twinRedHearts = iVar11; } uVar9 = this->_rottenHearts; iVar5 = local_40 + (((local_50 - this->_boneHearts) * 2 - this->_maxHearts) - twinRedHearts) + uVar8; iVar11 = 0; if (0 < iVar5) { iVar11 = iVar5; } twinRedHearts = twinRedHearts + iVar11; uVar8 = uVar9 & 0x80000001; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffe) + 1; } uVar8 = RNG::RandomInt(&heartRng,uVar8 + 1); iVar11 = uVar8 + (int)uVar9 / 2; twinRottenHearts = (twinRedHearts + 1) / 2; if (iVar11 < twinRottenHearts) { twinRottenHearts = iVar11; } iVar5 = (uVar9 - (this->_redHearts - twinRedHearts) / 2) - twinRottenHearts; iVar11 = 0; if (0 < iVar5) { iVar11 = iVar5; } twinRottenHearts = twinRottenHearts + iVar11; uVar8 = this->_soulHearts & 0x80000001; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffe) + 1; } uVar8 = RNG::RandomInt(&heartRng,uVar8 + 1); local_44 = (float)(uVar8 + this->_soulHearts / 2); uVar8 = this->_goldenHearts & 0x80000001; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffffe) + 1; } uVar8 = RNG::RandomInt(&heartRng,uVar8 + 1); pEVar3 = local_3c; local_38.y = (float)(uVar8 + this->_goldenHearts / 2); local_3c->_maxHearts = local_40; AddBoneHearts(local_3c,local_50); iVar11 = twinRedHearts; pEVar3->_soulHearts = (int)local_44; pEVar3->_redHearts = twinRedHearts; pEVar3->_blackHearts = pEVar3->_blackHearts | this->_blackHearts << ((byte)((this->_soulHearts - (int)local_44) / 2) & 0x1f); pEVar3->_goldenHearts = (int)local_38.y; pEVar3->_rottenHearts = twinRottenHearts; pEVar3->_brokenHearts = this->_brokenHearts; if (0 < (int)local_44) { AddSoulHearts(this,-(int)local_44,0); } if (0 < iVar11) { AddHearts(this,-iVar11,0,0); } if (0 < local_50) { AddBoneHearts(this,-local_50); } if (0 < (int)local_40) { AddMaxHearts(this,-local_40,0); } this->_goldenHearts = this->_goldenHearts - (int)local_38.y; this->_rottenHearts = this->_rottenHearts - twinRottenHearts; if (this->_soulHearts + this->_redHearts + this->_boneHearts < 1) { AddSoulHearts(this,1,0); } if (pEVar3->_boneHearts + pEVar3->_redHearts + pEVar3->_soulHearts < 1) { AddSoulHearts(pEVar3,1,0); } if (((*(int *)&g_game->_deathmatchManager < 2) && (this->_dead == 0)) && (0 < this->_goldenHearts)) { iVar11 = (this->_soulHearts + 1) / 2 + (*(int *)((int)(&this->_headAnim + 1) + ((this->_redHearts <= this->_maxHearts) + 2) * 4) + 1) / 2 + this->_boneHearts; if (iVar11 < this->_goldenHearts) { BreakGoldenHearts(this,this->_goldenHearts - iVar11); this->_goldenHearts = iVar11; } } update_bone_hearts(this); UpdateHeartDependentEffects(this); ClampGoldenHearts(pEVar3,0); update_bone_hearts(pEVar3); UpdateHeartDependentEffects(pEVar3); (this->_history)._isLocked = 1; pvVar10 = (this->_history)._historyItems._begin; if (pvVar10 != (this->_history)._historyItems._end) { uVar8 = heartRng._seed; do { local_40 = *(uint *)((int)pvVar10 + 8); local_2d = '\0'; if (*(char *)((int)pvVar10 + 4) == '\0') { local_38.y = (float)ItemConfig::GetCollectible(&g_manager->_itemConfig,local_40); bVar2 = CanRerollCollectible(this,local_40,0); if (((bVar2 != 0) && (*(int *)local_38.y != 3)) && (local_44 = (float)(local_40 * 4), 0 < *(int *)((int)(this->_collectibleCounts)._begin + (int)local_44))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)heartRng._shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)heartRng._shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)heartRng._shift3 & 0x1f) ^ uVar8; if ((uVar8 & 1) == 0) { piVar7 = (int *)((int)local_44 + (int)(local_3c->_collectibleCounts)._begin); *piVar7 = *piVar7 + 1; if (*(char *)((int)&(((ANM2 *)((int)local_38.y + 0x48))->_overlayAnimState). _currentlyTriggeredEvents + 2) != '\0') { AddCostume(local_3c,(ItemConfig_Item *)local_38.y,0); } History::AddHistoryItem(&local_3c->_history,pvVar10); piVar7 = (int *)std::vector::erase(&local_50,pvVar10); pvVar10 = (void *)*piVar7; History::remove_index_refs (&this->_history, ((int)pvVar10 - (int)(this->_history)._historyItems._begin) / 0x1c); local_2d = '\x01'; RemoveCollectible(this,local_40,1,0,1); } } } else { uVar9 = local_40 & 0x7fff; pvVar6 = (g_manager->_itemConfig)._trinkets._begin; if ((int)uVar9 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar6 >> 2) { local_38.y = *(float *)((int)pvVar6 + uVar9 * 4); } else { local_38.y = 0.0; } pvVar6 = (this->_smeltedTrinkets)._begin; local_44 = (float)(uVar9 * 4); if ((0 < *(short *)((int)pvVar6 + (int)local_44)) || (0 < *(short *)((int)pvVar6 + (int)local_44 + 2))) { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> ((byte)heartRng._shift1 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)heartRng._shift2 & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)heartRng._shift3 & 0x1f) ^ uVar8; if ((uVar8 & 1) == 0) { pvVar6 = (local_3c->_smeltedTrinkets)._begin; if ((*(short *)((int)pvVar6 + (int)local_44) < 1) && (*(short *)((int)pvVar6 + (int)local_44 + 2) < 1)) { AddCostume(local_3c,(ItemConfig_Item *)local_38.y,0); pvVar6 = (local_3c->_smeltedTrinkets)._begin; } if ((*(uint *)((int)pvVar10 + 8) & 0x8000) == 0) { *(short *)((int)local_44 + (int)pvVar6) = *(short *)((int)local_44 + (int)pvVar6) + 1; } else { smeltedCount = (short *)((int)local_44 + 2 + (int)pvVar6); *smeltedCount = *smeltedCount + 1; } History::AddHistoryItem(&local_3c->_history,pvVar10); TryRemoveSmeltedTrinket(this,*(uint *)((int)pvVar10 + 8)); piVar7 = (int *)std::vector::erase(&twinRedHearts,pvVar10); pvVar10 = (void *)*piVar7; History::remove_index_refs (&this->_history, ((int)pvVar10 - (int)(this->_history)._historyItems._begin) / 0x1c); local_2d = '\x01'; } } } pvVar6 = (void *)((int)pvVar10 + 0x1c); if (local_2d != '\0') { pvVar6 = pvVar10; } pvVar10 = pvVar6; } while (pvVar6 != (this->_history)._historyItems._end); pEVar3 = local_3c; } (this->_history)._isLocked = 0; pEVar3->_cacheFlags = 0xffff; EvaluateItems(); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); uVar9 = 0; uVar8 = GetMaxPocketItems(this); if (uVar8 != 0) { do { pos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_38,&this->_pos,0.0,0,0,0); DropPocketItem(this,uVar9,pos); uVar9 = uVar9 + 1; uVar8 = GetMaxPocketItems(this); } while (uVar9 < uVar8); } } } } else { if (this->_playerType == 0x13) goto LAB_007cecd9; if (unk != 0) goto LAB_007ceccc; iVar11 = this->_soulHearts; local_38.y = (float)*(Entity_Player **)((int)twinPlayer + 0x1da0); piVar7 = &this->_brokenHearts; pfVar4 = &local_38.y; if ((int)*(Entity_Player **)((int)twinPlayer + 0x1da0) <= *piVar7) { pfVar4 = (float *)piVar7; } *piVar7 = (int)*pfVar4; AddMaxHearts(this,*(int *)((int)twinPlayer + 0x1340),0); AddBoneHearts(this,*(int *)((int)this->_twinPlayer + 0x1d88)); AddEternalHearts(this,*(int *)((int)this->_twinPlayer + 0x1348)); AddHearts(this,*(int *)((int)this->_twinPlayer + 0x1344),1,0); AddSoulHearts(this,*(int *)((int)this->_twinPlayer + 0x134c),0); AddGoldenHearts(this,*(int *)((int)this->_twinPlayer + 0x194c),0); this->_blackHearts = this->_blackHearts | *(int *)((int)this->_twinPlayer + 0x1350) << ((byte)(iVar11 / 2) & 0x1f); iVar11 = this->_rottenHearts + *(int *)((int)this->_twinPlayer + 0x1da4); iVar5 = (this->_redHearts + 1) / 2; if (iVar5 < iVar11) { iVar11 = iVar5; } this->_rottenHearts = iVar11; UpdateBlackHeartMask(this); } if ((this->_playerType == 0x12) && (0 < this->_soulHearts)) { AddSoulCharge(this,this->_soulHearts); game = g_game; this->_soulHearts = 0; if (*(int *)&game->_deathmatchManager < 2) { this->_blackHearts = 0; } iVar11 = GetHealthType(this); if ((iVar11 == 1) || (iVar11 == 2)) { iVar11 = this->_maxHearts; } else { iVar11 = this->_maxHearts + this->_boneHearts * 2; } if (iVar11 < 1) { this->_maxHearts = 2; this->_redHearts = 2; } } if (this->_playerType == 0x19) { poop_spell_roll(this); } if (this->_config == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Player Config invalid!\n"); } pvVar10 = (this->_sprite)._animState._animData; if (pvVar10 == (void *)0x0) { animNameCapacity = 2.10195e-44; animNameSize = (void *)0x0; animName[0] = (Entity_Player *)0x0; } else { std::string::string((char *)animName,pvVar10); } local_8 = (Entity_Player *)0x0; local_2d = (this->_sprite)._animState._isPlaying; local_44 = (this->_sprite)._animState._animFrame; ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),0); update_player_skin(this); (**(code **)(*(int *)this + 0x60))(); RemoveCollectible(this,oldPlayerType,extraout_ECX); if (animNameSize == (void *)0x0) goto LAB_007cf515; if (local_2d == 0) { pEVar3 = (Entity_Player *)animName; if (0xf < (uint)animNameCapacity) { pEVar3 = animName[0]; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)pEVar3,1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)local_44), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } goto LAB_007cf515; } curAnim = (this->_sprite)._animState._animData; local_38.y = (float)animName; if (0xf < (uint)animNameCapacity) { local_38.y = (float)animName[0]; } if (curAnim == (byte *)0x0) { LAB_007cf49f: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)local_38.y,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { nameCursor = curAnim; pEVar3 = (Entity_Player *)local_38.y; if (0xf < *(uint *)(curAnim + 0x14)) { nameCursor = *(byte **)curAnim; } do { bVar2 = *nameCursor; isLess = bVar2 < *(byte *)pEVar3; if (bVar2 != *(byte *)pEVar3) { LAB_007cf486: uVar8 = -(uint)isLess | 1; goto LAB_007cf48b; } if (bVar2 == 0) break; bVar2 = nameCursor[1]; isLess = bVar2 < (byte)pEVar3->field_0x1; if (bVar2 != pEVar3->field_0x1) goto LAB_007cf486; nameCursor = nameCursor + 2; pEVar3 = (Entity_Player *)&pEVar3->field_0x2; } while (bVar2 != 0); uVar8 = 0; LAB_007cf48b: if ((uVar8 != 0) || ((curAnim[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_007cf49f; } if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,local_44); } LAB_007cf515: if (unk == 0) { if (this->_playerType == 0x23) { pEVar3 = InitTwin(this,0x28); InitPostLevelInitStats(pEVar3); } else if ((this->_playerType == 0x1d) && (this->_backupPlayer == (void *)0x0)) { local_38.y = (float)operator_new(0x2f00); local_8._0_1_ = 1; if ((Entity_Player *)local_38.y == (Entity_Player *)0x0) { piVar7 = (int *)0x0; } else { constructor((Entity_Player *)local_38.y); piVar7 = extraout_EAX; } local_8 = (Entity_Player *)((uint)local_8._1_3_ << 8); this->_backupPlayer = piVar7; (**(code **)(*piVar7 + 4))(this->_type,this->_variant,0x26,this->_initSeed); *(Entity_Player **)((int)this->_backupPlayer + 0x1e6c) = this; } } this->_cacheFlags = 0xffff; EvaluateItems(); apply_innate_collectibles(this); UpdateCostumes(this); if (0xf < (uint)animNameCapacity) { uVar8 = (int)animNameCapacity + 1; pEVar3 = animName[0]; if (0xfff < uVar8) { pEVar3 = animName[0][-1]._replacedPlayer; uVar8 = (int)animNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)animName[0] + (-4 - (int)pEVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar3,uVar8); } ExceptionList = local_10; return; } //@@ 007cf610 Entity_Player::RemoveCollectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Entity_Player::RemoveCollectible(unsigned int CollectibleType, bool IgnoreModifiers, unsigned int ActiveSlot, bool RemoveFromPlayerForm); */ void __thiscall Entity_Player::RemoveCollectible(Entity_Player *this,int param_2) { code *pcVar1; byte bVar2; int playerType; undefined4 *eraseResult; uint uVar3; Entity_Player *extraout_ECX; Entity_Player *this_00; Entity_Player *extraout_ECX_00; void *pvVar4; bool isPairedType; undefined1 eraseOut [4]; undefined4 tempEffect; undefined4 local_28; int effectCooldown; undefined4 local_20; Entity_Player *local_1c; undefined8 local_14; undefined4 local_8; local_8 = __security_cookie ^ (uint)(eraseOut + 0x2c); playerType = this->_playerType; if (param_2 == playerType) { return; } if (playerType == 0x25) { isPairedType = param_2 == 0x27; LAB_007cf648: if (isPairedType) { return; } } else if (playerType == 0x27) { isPairedType = param_2 == 0x25; goto LAB_007cf648; } if (this->_twinPlayer != (EntityPtr)0x0) { if (*(int *)((int)this->_twinPlayer + 0x13c0) == param_2) { return; } if (param_2 == 0x13) { if (playerType == 0x13) goto LAB_007cf690; } else { if (param_2 != 0x23) goto LAB_007cf67f; if (playerType == 0x23) goto LAB_007cf690; } remove_twin(); } LAB_007cf67f: if ((param_2 == 0x1d) || (param_2 == 0x26)) { remove_twin(); } LAB_007cf690: playerType = this->_playerType; if (playerType == 0x15) { bVar2 = HasCollectible(this,0x26b,0); (this->_history)._isLocked = 1; pvVar4 = (this->_history)._historyItems._begin; this_00 = (Entity_Player *)((uint)(bVar2 != 0) * 4 + 8); local_1c = this_00; if (pvVar4 != (this->_history)._historyItems._end) { do { if (*(char *)((int)pvVar4 + 4) == '\0') { uVar3 = *(uint *)((int)pvVar4 + 8); bVar2 = CanAddCollectibleToInventory(this_00,uVar3); this_00 = extraout_ECX; if (bVar2 == 0) goto LAB_007cf6f6; if (0 < (int)local_1c) { this_00 = (Entity_Player *)((int)&local_1c[-1]._replacedPlayer + 3); local_1c = this_00; goto LAB_007cf6f6; } if (0 < *(int *)((int)(this->_collectibleCounts)._begin + uVar3 * 4)) { RemoveCollectible(this,uVar3,1,0,1); } eraseResult = (undefined4 *)std::vector::erase(eraseOut,pvVar4); pvVar4 = (void *)*eraseResult; this_00 = extraout_ECX_00; } else { LAB_007cf6f6: pvVar4 = (void *)((int)pvVar4 + 0x1c); } } while (pvVar4 != (this->_history)._historyItems._end); } (this->_history)._isLocked = 0; FUN_00721eb0(); playerType = this->_playerType; } if (((playerType == 0x25) || (playerType == 0x27)) && (bVar2 = TemporaryEffects::HasNullEffect(&this->_temporaryeffects,0x6d), bVar2 == 0)) { pvVar4 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar4 & 0xfffffffcU) < 0x1b5) { tempEffect = 0; } else { tempEffect = *(undefined4 *)((int)pvVar4 + 0x1b4); } local_28 = 0; local_20 = 0; local_14 = 0x70000000b; uVar3 = (g_game->_devilAngelRoomRNG)._seed; local_1c = (Entity_Player *)0xc; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 0xb ^ uVar3; uVar3 = uVar3 << 7 ^ uVar3; effectCooldown = ((uVar3 >> 0xc ^ uVar3) % 3) * 0x1e + 100; TemporaryEffects::AddEffect(&this->_temporaryeffects,&tempEffect,1,1); } if (param_2 == 0x23) { this->_cacheFlags = this->_cacheFlags | 0x80; this->_canFly = 1; EvaluateItems(); } playerType = this->_playerType; if ((playerType < 0) || (pvVar4 = (g_manager->_entityConfig)._players._begin, ((int)(g_manager->_entityConfig)._players._end - (int)pvVar4) / 0x148 <= playerType)) { pvVar4 = (void *)0x0; } else { pvVar4 = (void *)(playerType * 0x148 + (int)pvVar4); } SetPocketActiveItem(this,*(int *)((int)pvVar4 + 0xf0),2,0); HUD::mark_all_slots_dirty(&g_game->_hud,1,1); return; } //@@ 007cf8c0 Entity_Player::IsLocalPlayer /* DB: true when no netplay else NetplayManager::IsIdxLocalPlayer(this+0x1618) prototype: REPENTOGON */ byte __thiscall Entity_Player::IsLocalPlayer(Entity_Player *this) { byte bVar1; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { return 1; } bVar1 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerIndex); return bVar1; } //@@ 007cf8f0 Entity_Player::IsLocalPlayer /* DB: ? NetplayManager::IsIdxLocalPlayer prototype: REPENTOGON */ byte __thiscall Entity_Player::IsLocalPlayer(Entity_Player *this) { NetplayManager NVar1; NVar1 = g_manager->_netplayManager; if (NVar1 != *(NetplayManager *)(g_manager + 1)) { NVar1._0_1_ = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,this->_controllerIndex); NVar1._1_3_ = 0; if (NVar1._0_1_ == 0) { return (byte)g_manager; } } return NVar1._0_1_; } //@@ 007cf940 FUN_007cf940 void FUN_007cf940(void) { byte bVar1; int in_ECX; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar1 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,*(uint *)(in_ECX + 0x1618)) ; if ((bVar1 == 0) && ((g_game == (Game *)0x0 || (*(int *)&g_game->_deathmatchManager < 2)))) { return; } } return; } //@@ 007cf9a0 FUN_007cf9a0 float10 FUN_007cf9a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int iVar1; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0023d; local_10 = ExceptionList; ExceptionList = &local_10; FUN_0041d4d0(param_3); local_2c = 0; local_28 = 0xffff; local_24 = 0; local_20 = 0x3f800000; local_1c = 0xffffffff; local_18 = 0; local_14 = 0; local_8 = 0; Font::DrawString(&DAT_00c82240,param_2,&local_2c); iVar1 = Font::get_string_width_n(&g_manager->_font8_LuaMiniOutlined,&DAT_00c82240,-1); ExceptionList = local_10; return (float10)(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); } //@@ 007cfa90 FUN_007cfa90 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined * FUN_007cfa90(void) { std_string *_Source; ItemConfig_Item *in_ECX; void *ptr; byte *format; uint size; void *local_24 [5]; uint local_10; uint local_c; local_c = __security_cookie ^ (uint)local_24; if (in_ECX == (ItemConfig_Item *)0x0) { strncpy(&DAT_00c82640,"NULL",0x20); } else { if ((in_ECX->name)._size == 0) { if (in_ECX->type == 0) { format = &DAT_00b6b728; } else { format = &DAT_00b66208; if (in_ECX->type != 2) { format = &DAT_00b66204; } } sprintf_s(&DAT_00c82640,0x20,format); return &DAT_00c82640; } _Source = ItemConfig_Item::GetLocalizedName(in_ECX,(std_string *)local_24,0); if (0xf < _Source->_capacity) { _Source = *(std_string **)_Source->_buf; } strncpy(&DAT_00c82640,_Source->_buf,0x20); if (0xf < local_10) { size = local_10 + 1; ptr = local_24[0]; if (0xfff < size) { ptr = *(void **)((int)local_24[0] + -4); size = local_10 + 0x24; if (0x1f < (uint)((int)local_24[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return &DAT_00c82640; } } return &DAT_00c82640; } //@@ 007cfba0 Game::render_debug_player_info /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: debug text overlay from Game::Render: "Player items","Player effects","History","Hearts: %d(%d rotten)" */ void Game::render_debug_player_info(float *param_1) { 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; void *colorQuads_04; void *quad_03; int iVar5; void *quad_04; void *quad_05; void *quad_06; void *quad_07; void *quad_08; void *quad_09; Entity_Player *in_ECX; 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 *******pppppppuVar6; Entity_Player *player; float10 textWidth; float fVar7; char *ptr; undefined1 bgQuad [112]; KColor bgColor; float local_b8; Entity_Player *local_b4; float local_b0; StringTable *local_ac; Vector local_a8; float *local_a0; float local_9c; int local_98; KColor textColor; Vector local_80; byte isStringFound; Vector rowSize; Vector linePos; float lineY; undefined4 *******bitsText; undefined4 ******ppppppuStack_5c; undefined4 ******ppppppuStack_58; undefined4 ******ppppppuStack_54; undefined8 local_50; 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 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0027d; local_1c = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; bgColor._red = 0.0; bgColor._green = 0.0; bgColor._blue = 0.0; bgColor._alpha = 0.5; local_a0 = param_1; local_9c = *param_1; linePos.y = param_1[1]; bgColor._unk = 0; local_b4 = in_ECX; linePos.x = local_9c; lineY = linePos.y; local_24 = uVar1; fVar7 = RoomTransition::get_hud_alpha(&g_game->_roomTransition); if ((fVar7 * *(float *)&(game->_minimap).field_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); KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_01,"Player items",uVar1); linePos.y = lineY + 3.0; lineY = linePos.y; KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_02,"_____________________"); linePos.y = lineY + 8.0; uVar1 = 0; pvVar3 = (in_ECX->_collectibleCounts)._begin; lineY = linePos.y; if ((int)(in_ECX->_collectibleCounts)._end - (int)pvVar3 >> 2 != 0) { do { local_98 = *(int *)((int)pvVar3 + uVar1 * 4); iVar2 = Entity_Player::GetCollectibleNum(in_ECX,uVar1,0); if ((iVar2 != 0) || (local_98 != 0)) { local_ac = (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 ((*(float *)((int)extraout_EAX + 0x40) + *(float *)((int)extraout_EAX + 0x2c) + *(float *)((int)extraout_EAX + 0x54) + *(float *)((int)extraout_EAX + 0x68)) * 0.25 != 0.0) { local_a8.y = (float)extraout_EAX; shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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) { KColor::SetFromARGB(&textColor,0xff00ff00); diffFormat = &DAT_00b6b898; LAB_007d021d: FUN_007cf9a0(&local_80,&textColor,diffFormat,iVar2 - local_98); } else if (iVar2 < local_98) { KColor::SetFromARGB(&textColor,0xffff0000); diffFormat = &DAT_00b6b834; goto LAB_007d021d; } linePos.y = lineY + 8.0; lineY = linePos.y; } uVar1 = uVar1 + 1; pvVar3 = (local_b4->_collectibleCounts)._begin; in_ECX = local_b4; } while (uVar1 < (uint)((int)(local_b4->_collectibleCounts)._end - (int)pvVar3 >> 2)); } fVar7 = 0.0; rowSize.x = 120.0; rowSize.y = 7.0; linePos.x = *local_a0 + 128.0; linePos.y = local_a0[1] + 0.0; lineY = linePos.y; render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor); if ((*(float *)((int)colorQuads + 0x40) + *(float *)((int)colorQuads + 0x2c) + *(float *)((int)colorQuads + 0x54) + *(float *)((int)colorQuads + 0x68)) * 0.25 != fVar7) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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)(in_ECX->_temporaryeffects)._effects._begin; local_9c = 0.0; if ((int)(in_ECX->_temporaryeffects)._effects._end - (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 (*(char *)(*(int *)((int)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 ((*(float *)((int)extraout_EAX_00 + 0x40) + *(float *)((int)extraout_EAX_00 + 0x2c) + *(float *)((int)extraout_EAX_00 + 0x54) + *(float *)((int)extraout_EAX_00 + 0x68)) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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,(byte *)"Shader stack empty\n"); } uVar1 = g_shaderStackSize; puVar4 = (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, *(undefined4 *)((int)pvVar3 + local_98 + 4), *(undefined4 *)((int)pvVar3 + local_98 + 8)); lineY = lineY + 8.0; local_a8.y = (float)(in_ECX->_temporaryeffects)._effects._begin; local_9c = (float)((int)local_9c + 1); local_98 = local_98 + 0x10; } while ((uint)local_9c < (uint)((int)(in_ECX->_temporaryeffects)._effects._end - (int)local_a8.y >> 4)); } local_a8.y = 0.0; local_ac = (StringTable *)((int)g_game->_room + 0x7314); iVar2 = *(int *)local_ac; if (*(int *)((int)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 ((*(float *)((int)colorQuads_00 + 0x40) + *(float *)((int)colorQuads_00 + 0x2c) + *(float *)((int)colorQuads_00 + 0x54) + *(float *)((int)colorQuads_00 + 0x68)) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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,(byte *)"Shader stack empty\n"); } uVar1 = g_shaderStackSize; puVar4 = (undefined4 *)FUN_00684fc0(); g_shaderStackSize = uVar1 - 1; g_currentShader = (void *)*puVar4; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } } fVar7 = 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, *(undefined4 *)(iVar2 + 4 + (int)local_9c), *(undefined4 *)(iVar2 + 8 + (int)local_9c)); local_9c = (float)((int)fVar7 + 0x10); lineY = lineY + 8.0; iVar2 = *(int *)local_ac; local_a8.y = (float)((int)local_a8.y + 1); } while ((uint)local_a8.y < (uint)(*(int *)&local_ac->field_0x4 - iVar2 >> 4)); in_ECX = local_b4; } fVar7 = 0.0; rowSize.x = 120.0; rowSize.y = 7.0; linePos.x = *local_a0 + 256.0; linePos.y = local_a0[1] + 0.0; lineY = linePos.y; render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor); if ((*(float *)((int)colorQuads_01 + 0x40) + *(float *)((int)colorQuads_01 + 0x2c) + *(float *)((int)colorQuads_01 + 0x54) + *(float *)((int)colorQuads_01 + 0x68)) * 0.25 != fVar7) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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,(byte *)"Shader stack empty\n"); } uVar1 = g_shaderStackSize; puVar4 = (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)",in_ECX->_redHearts, in_ECX->_rottenHearts,in_ECX->_maxHearts,in_ECX->_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 ((*(float *)((int)colorQuads_02 + 0x40) + *(float *)((int)colorQuads_02 + 0x2c) + *(float *)((int)colorQuads_02 + 0x54) + *(float *)((int)colorQuads_02 + 0x68)) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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,(byte *)"Shader stack empty\n"); } uVar1 = g_shaderStackSize; puVar4 = (undefined4 *)FUN_00684fc0(); g_shaderStackSize = uVar1 - 1; g_currentShader = (void *)*puVar4; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } } iVar2 = in_ECX->_eternalHearts; iVar5 = in_ECX->_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",iVar5,iVar2); linePos.y = lineY + 8.0; local_80.y = (float)in_ECX->_blackHearts; lineY = linePos.y; std::bitset<32>::to_string(&bitsText,iVar5,iVar2); local_14 = 0; rowSize.x = 120.0; rowSize.y = 7.0; render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor); if ((*(float *)((int)colorQuads_03 + 0x40) + *(float *)((int)colorQuads_03 + 0x2c) + *(float *)((int)colorQuads_03 + 0x54) + *(float *)((int)colorQuads_03 + 0x68)) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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,(byte *)"Shader stack empty\n"); } uVar1 = g_shaderStackSize; puVar4 = (undefined4 *)FUN_00684fc0(); g_shaderStackSize = uVar1 - 1; g_currentShader = (void *)*puVar4; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } } pppppppuVar6 = &bitsText; if (0xf < local_50._4_4_) { pppppppuVar6 = bitsText; } local_2c = 0; local_28 = 0xf; local_3c = (undefined4 *******)0x0; std::string::append_reversed((int)local_50 + (int)pppppppuVar6,pppppppuVar6,local_80.y); local_14._0_1_ = 1; pppppppuVar6 = &local_3c; if (0xf < local_28) { pppppppuVar6 = 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",pppppppuVar6); local_14 = (uint)local_14._1_3_ << 8; if (0xf < local_28) { pppppppuVar6 = (undefined4 *******)(local_28 + 1); ptr = (char *)local_3c; if ((undefined4 *******)0xfff < pppppppuVar6) { ptr = (char *)local_3c[-1]; pppppppuVar6 = (undefined4 *******)(local_28 + 0x24); if (0x1f < (uint)((int)local_3c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,(uint)pppppppuVar6); } linePos.y = lineY + 8.0; local_80.y = (float)in_ECX->_boneHearts; lineY = linePos.y; pppppppuVar6 = (undefined4 *******)std::bitset<32>::to_string(&local_3c,ptr,pppppppuVar6); if (&bitsText != (undefined4 ********)pppppppuVar6) { std::string::_Tidy_deallocate((char *)&bitsText); bitsText = (undefined4 *******)*pppppppuVar6; ppppppuStack_5c = pppppppuVar6[1]; ppppppuStack_58 = pppppppuVar6[2]; ppppppuStack_54 = pppppppuVar6[3]; local_50 = *(undefined8 *)(pppppppuVar6 + 4); pppppppuVar6[4] = (undefined4 ******)0x0; pppppppuVar6[5] = (undefined4 ******)0xf; *(char *)pppppppuVar6 = '\0'; } if (0xf < local_28) { uVar1 = local_28 + 1; pppppppuVar6 = local_3c; if (0xfff < uVar1) { pppppppuVar6 = (undefined4 *******)local_3c[-1]; uVar1 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pppppppuVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar6,uVar1); } rowSize.x = 120.0; rowSize.y = 7.0; render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor); if ((*(float *)((int)colorQuads_04 + 0x40) + *(float *)((int)colorQuads_04 + 0x2c) + *(float *)((int)colorQuads_04 + 0x54) + *(float *)((int)colorQuads_04 + 0x68)) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); local_38 = 0; local_48 = 0; local_3c = (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(); } pppppppuVar6 = &bitsText; if (0xf < local_50._4_4_) { pppppppuVar6 = bitsText; } local_2c = 0; local_28 = 0xf; local_3c = (undefined4 *******)0x0; std::string::append_reversed((int)local_50 + (int)pppppppuVar6,pppppppuVar6,local_80.y); local_14._0_1_ = 2; pppppppuVar6 = &local_3c; if (0xf < local_28) { pppppppuVar6 = local_3c; } KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_03,"Bone hearts.: %s",pppppppuVar6); local_14 = (uint)local_14._1_3_ << 8; if (0xf < local_28) { uVar1 = local_28 + 1; pppppppuVar6 = local_3c; if (0xfff < uVar1) { pppppppuVar6 = (undefined4 *******)local_3c[-1]; uVar1 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pppppppuVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar6,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)in_ECX->_brokenHearts; iVar2 = Entity_Player::GetHeartLimit(in_ECX,1); iVar5 = Entity_Player::GetHeartLimit(local_b4,0); KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_04,"Heart limit: %d (base:%d, broken:%d)\n",iVar5,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); KColor::SetFromARGB(&textColor,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); KColor::SetFromARGB(&textColor,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); KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_07,"HP overflow from items: %d", *(undefined4 *)&player->field_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); KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_08,"Greed\'s Gullet: %d (overflow:%d)", (int)player->_greedsGulletHearts,(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); KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_09,&s_empty); linePos.y = lineY + 8.0; uVar1 = 0; lineY = linePos.y; do { if (((int)uVar1 < 0) || (pvVar3 = (g_manager->_itemConfig)._playerForms._begin, (int)(g_manager->_itemConfig)._playerForms._end - (int)pvVar3 >> 2 <= (int)uVar1)) { local_a0 = (float *)0x0; } else { local_a0 = *(float **)((int)pvVar3 + uVar1 * 4); } if (local_a0 != (float *)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 = (byte *)((int)local_a0 + 0x10); if (0xf < *(uint *)((int)local_a0 + 0x24)) { labelText = *(byte **)labelText; } local_ac = &g_manager->_stringTable; if (*labelText == 0x23) { isStringFound = 0; local_80.y = (float)(labelText + 1); StringTable::get_string(local_ac,(byte *)"Default",0,(byte *)local_80.y,&isStringFound); if (isStringFound == 0) { isStringFound = 0; labelText = StringTable::get_string (local_ac,(byte *)"Default",0,(byte *)local_80.y,&isStringFound); } } KColor::SetFromARGB(&textColor,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 < local_50._4_4_) { uVar1 = local_50._4_4_ + 1; pppppppuVar6 = bitsText; if (0xfff < uVar1) { pppppppuVar6 = (undefined4 *******)bitsText[-1]; uVar1 = local_50._4_4_ + 0x24; if (0x1f < (uint)((int)bitsText + (-4 - (int)pppppppuVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar6,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); KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX,"History",uVar1); linePos.y = lineY + 3.0; lineY = linePos.y; KColor::SetFromARGB(&textColor,0xffffffff); FUN_007cf9a0(&linePos,extraout_ECX_00,"_____________________"); puVar4 = (in_ECX->_history)._historyItems._begin; if (puVar4 != (in_ECX->_history)._historyItems._end) { do { lineY = lineY + 8.0; linePos.y = lineY; if (*(char *)(puVar4 + 1) == '\0') { local_a0 = (float *)FUN_007cfa90(); local_b8 = local_9c; local_b4 = (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 (((int)uVar1 < 0) || (0x1e < uVar1)) { labelText = &s_empty; } else { labelText = (&PTR_s_treasure_00b1f3d0)[uVar1]; } uVar1 = puVar4[5]; if (((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 = (float *)FUN_007cfa90(); local_b0 = local_9c; local_ac = (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 (((int)uVar1 < 0) || (0x1e < uVar1)) { labelText = &s_empty; } else { labelText = (&PTR_s_treasure_00b1f3d0)[uVar1]; } uVar1 = puVar4[5]; if (((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 != (in_ECX->_history)._historyItems._end); } } ExceptionList = local_1c; return; } //@@ 007d12c0 Entity_Player::GetGlyphOfBalanceDrop /* ZHL [exact] __thiscall void Entity_Player::GetGlyphOfBalanceDrop(int * variant, int * subtype); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::GetGlyphOfBalanceDrop(Entity_Player *this,int *variant,int *subtype) { int iVar1; int iVar2; uint bombsOrMana; EntityList_EL *trinketList; int effectiveMaxHearts; bool isQueryMade; Entity_Player *this_00; Entity_Player *this_01; EntityList_EL trinketQuery; bool isDropTrinket; bool isSoulHealth; isQueryMade = false; iVar1 = GetHealthType(this); if (((iVar1 == 0) || (iVar1 = GetHealthType(this_00), iVar1 == 4)) && (this->_playerType != 0x12)) { isSoulHealth = true; } else { isSoulHealth = false; } if (this->_redHearts < 2) { iVar1 = GetHealthType(this); if ((iVar1 == 1) || (iVar1 == 2)) { iVar1 = this->_maxHearts; } else { iVar1 = this->_maxHearts + this->_boneHearts * 2; } if ((1 < iVar1) && ((iVar1 = GetHealthType(this), iVar1 == 0 || (iVar1 = GetHealthType(this_01), iVar1 == 4)))) goto LAB_007d15d3; } iVar1 = GetHealthType(this); if ((iVar1 == 1) || (iVar1 == 2)) { iVar1 = this->_maxHearts; } else { iVar1 = this->_maxHearts + this->_boneHearts * 2; } if (((iVar1 == 0) && (this->_soulHearts < 4)) && (isSoulHealth)) goto LAB_007d1599; if (this->_numKeys < 1) { LAB_007d1505: if (*variant != 0x1e) { *variant = 0x1e; *subtype = 0; return; } } else { iVar1 = this->_playerType; if (iVar1 == 0x19) { if (this->_poopMana < 1) { if (*variant == 0x2a) { return; } *variant = 0x2a; *subtype = 1; return; } } else { if (this->_numBombs < 1) goto LAB_007d1541; if (iVar1 == 0x12) { if (this->_effectiveSoulCharge < 1) goto LAB_007d1599; } else if ((iVar1 == 0x24) && (this->_effectiveBloodCharge < 1)) goto LAB_007d15d3; } iVar2 = GetEffectiveMaxHearts(this); if (((this->_redHearts < iVar2) && (iVar2 = GetEffectiveMaxHearts(this), -1 < iVar2)) && (iVar2 = GetHealthType(this), iVar2 != 3)) goto LAB_007d15d3; if (4 < this->_numCoins) { if (iVar1 == 0x19) { bombsOrMana = this->_poopMana; } else { bombsOrMana = (uint)(4 < this->_numBombs); } if (((bombsOrMana == 0) || (this->_numKeys < 5)) || (this->_trinketsID[0] != 0)) { LAB_007d14a0: isDropTrinket = false; } else { trinketList = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&trinketQuery,5,0x15e, -1,0,0); isQueryMade = true; if (trinketList->_size != 0) goto LAB_007d14a0; isDropTrinket = true; } if (isQueryMade) { EntityList_Query::~EntityList_Query(&trinketQuery); } if (isDropTrinket) { *variant = 0x15e; *subtype = 0; return; } if (0xe < this->_numCoins) { if (4 < this->_numKeys) { iVar1 = this->_playerType; if (iVar1 == 0x19) { if (this->_poopMana < 5) { if (*variant == 0x2a) { return; } *variant = 0x2a; *subtype = 1; return; } } else { if (this->_numBombs < 5) { LAB_007d1541: if (*variant == 0x28) { return; } *variant = 0x28; *subtype = 0; return; } if (iVar1 == 0x12) { if (this->_effectiveSoulCharge < 0xc) goto LAB_007d1599; } else if ((iVar1 == 0x24) && (this->_effectiveBloodCharge < 0xc)) { LAB_007d15d3: if (*variant == 10) { return; } *variant = 10; *subtype = 1; return; } } iVar2 = GetHeartLimit(this,0); effectiveMaxHearts = GetEffectiveMaxHearts(this); iVar1 = 0xc; if (iVar2 < 0xc) { iVar1 = iVar2; } if (iVar1 <= effectiveMaxHearts + this->_soulHearts) { return; } if (!isSoulHealth) { return; } LAB_007d1599: if (*variant == 10) { if (*subtype == 3) { return; } if (*subtype == 6) { return; } } *variant = 10; *subtype = 3; return; } goto LAB_007d1505; } } if (*variant != 0x14) { *variant = 0x14; *subtype = 0; return; } } return; } //@@ 007d1620 Entity_Player::GetEnterPosition /* ZHL [exact] __thiscall void Entity_Player::GetEnterPosition(Vector * buffer); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::GetEnterPosition(Entity_Player *this,Vector *buffer) { int iVar1; int iVar2; Game *this_00; uint uVar3; Vector *pVVar4; uint uVar5; float fVar6; float fVar7; Vector local_18; Vector local_10; uVar3 = g_game->_enterDoor; if (uVar3 == 0xffffffff) { uVar3 = Random(); uVar3 = uVar3 & 7; uVar5 = 0; do { if ((uVar3 < 8) && ((*(uint *)(*(int *)(*(int *)((int)g_game->_room + 4) + 0x10) + 0x38 + (uVar3 >> 5) * 4) & 1 << ((byte)uVar3 & 0x1f)) != 0)) break; uVar3 = uVar3 + 1 & 0x80000007; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff8) + 1; } uVar5 = uVar5 + 1; } while (uVar5 < 8); } this_00 = g_game; buffer->y = 0.0; buffer->x = 0.0; pVVar4 = Level::GetEnterPosition((Level *)this_00,&local_18); if ((pVVar4->x == g_vectorZero.x) && (pVVar4->y == g_vectorZero.y)) { fVar6 = g_vectorZero.y; fVar7 = g_vectorZero.x; if (uVar3 < 8) { iVar1 = *(int *)((int)g_game->_room + uVar3 * 4 + 0x744); iVar2 = *(int *)((int)g_game->_room + 0xc); fVar7 = (float)(iVar1 % iVar2) * 40.0 + 40.0; fVar6 = (float)(iVar1 / iVar2) * 40.0 + 120.0; } buffer->x = fVar7; buffer->y = fVar6; uVar3 = uVar3 & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } switch(uVar3) { case 0: buffer->x = fVar7 + 40.0; buffer->y = fVar6 + 0.0; return; case 1: buffer->y = fVar6 + 40.0; buffer->x = fVar7 + 0.0; return; case 2: buffer->x = fVar7 - 40.0; buffer->y = fVar6 - 0.0; return; case 3: buffer->y = fVar6 - 40.0; buffer->x = fVar7 - 0.0; return; } } else { pVVar4 = Level::GetEnterPosition((Level *)g_game,&local_10); buffer->x = pVVar4->x; buffer->y = pVVar4->y; } return; } //@@ 007d1810 FUN_007d1810 bool FUN_007d1810(void) { int iVar1; char cVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x184); if ((((iVar1 == 0) || (iVar1 == 3)) || (iVar1 == 1)) || (iVar1 == 2)) { return false; } cVar2 = FUN_00823be0(in_ECX + 0x33c,in_ECX,0); return cVar2 == '\0'; } //@@ 007d1860 Entity_Player::AddMinisaac /* ZHL [lua] Lua binding EntityPlayer:AddMinisaac */ Entity * __thiscall Entity_Player::AddMinisaac(Entity_Player *this,Vector *param_2,char param_3) { byte bVar1; uint uVar2; uint seed; Entity *minisaac; byte *curAnimName; Entity *bloodSplat; char *appearName; byte *splatAnimName; bool bVar3; float fVar4; float fVar5; float fVar6; Vector local_24; Vector local_1c; Entity_Player *player; Vector launchVelocity; byte *animData; Manager *manager; player = this; if (param_3 == '\0') { launchVelocity.x = g_vectorZero.x; launchVelocity.y = g_vectorZero.y; } else { uVar2 = Random(); local_24.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_24.x = local_24.x + local_24.x; uVar2 = Random(); local_1c.x = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0; fVar4 = cos(local_24.x); launchVelocity.x = fVar4 * local_1c.x; fVar4 = sin(local_24.x); launchVelocity.y = fVar4 * local_1c.x; } local_1c.x = (float)&launchVelocity; local_24.x = launchVelocity.x; local_24.y = launchVelocity.y; uVar2 = this->_headColor + 1; if (this->_headColor < 0) { uVar2 = 0; } if (this->_playerType == 0x10) { uVar2 = 99; } seed = Random(); minisaac = Game::SpawnEx(g_game,3,0xe4,param_2,&local_24,(Entity *)this,uVar2,seed,0); if (param_3 == '\0') goto LAB_007d1be2; *(uint *)&minisaac->_flags = (uint)minisaac->_flags & 0xfffffffb; *(undefined4 *)((int)&minisaac->_flags + 4) = *(undefined4 *)((int)&minisaac->_flags + 4); animData = (minisaac->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_007d19f9: bVar1 = ANM2::SetAnimation(&minisaac->_sprite,(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind(&(minisaac->_sprite)._animState); (minisaac->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } appearName = "Appear"; do { bVar1 = *curAnimName; bVar3 = bVar1 < (byte)*appearName; if (bVar1 != *appearName) { LAB_007d19e3: uVar2 = -(uint)bVar3 | 1; goto LAB_007d19e8; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar3 = bVar1 < (byte)appearName[1]; if (bVar1 != appearName[1]) goto LAB_007d19e3; curAnimName = curAnimName + 2; appearName = appearName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_007d19e8: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((minisaac->_sprite)._animState._isPlaying == 0)))) goto LAB_007d19f9; } AnimationState::SetAnimationData(&(minisaac->_sprite)._overlayAnimState,(void *)0x0); minisaac[3]._shadowOffset.y = 1.4013e-45; minisaac->_entityCollisionClass = 0; uVar2 = Random(); local_1c.y = *(float *)((int)local_1c.x + 4) * 0.4; local_1c.x = *(float *)local_1c.x * 0.4; bloodSplat = Game::SpawnEx(g_game,1000,2,param_2,&local_1c,(Entity *)0x0,1,uVar2,0); local_1c.x = (float)bloodSplat; uVar2 = Random(); (bloodSplat->_sprite)._rotation = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 360.0; animData = (bloodSplat->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_007d1b16: bVar1 = ANM2::SetAnimation(&bloodSplat->_sprite,&DAT_00b1d534,1); if (bVar1 != 0) { AnimationState::Rewind(&(bloodSplat->_sprite)._animState); (bloodSplat->_sprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } splatAnimName = &DAT_00b1d534; do { bVar1 = *curAnimName; bVar3 = bVar1 < *splatAnimName; if (bVar1 != *splatAnimName) { LAB_007d1b00: uVar2 = -(uint)bVar3 | 1; goto LAB_007d1b05; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar3 = bVar1 < splatAnimName[1]; if (bVar1 != splatAnimName[1]) goto LAB_007d1b00; curAnimName = curAnimName + 2; splatAnimName = splatAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_007d1b05: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((bloodSplat->_sprite)._animState._isPlaying == 0)))) goto LAB_007d1b16; } uVar2 = Random(); fVar4 = local_1c.x; manager = g_manager; local_1c.x = 4.2039e-44; fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.8; fVar5 = fVar6 * g_vectorOne.y; (((ANM2 *)((int)fVar4 + 0x48))->_scale).x = fVar6 * g_vectorOne.x; (((ANM2 *)((int)fVar4 + 0x48))->_scale).y = fVar5; *(int *)((int)fVar4 + 0x354) = 2000; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&manager->_sfxManager,(int)local_1c.x,1.0,2,0,1.0,0.0); LAB_007d1be2: minisaac->_entityGridCollisionClass = (uint)(player->_canFly == 0) * 2 + 3; return minisaac; } //@@ 007d1c10 Entity_Player::play_hurt_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Entity_Player::take_damage_impl unless damage flags & 0x100d0400 (no-gib flags); spawn_gibs, Game::ShakeScreen, ANM2::Play hurt anim, Color flash, Room::IsPositionInRoom */ undefined4 Entity_Player::play_hurt_effects(void) { qword qVar1; byte isOwned; void *pvVar2; int iVar3; Entity_Laser *laser; Entity_Player *in_ECX; uint wispIdx; qword *heapCounter; uint uVar4; int wispCount; short local_52; undefined1 local_50 [12]; float local_44 [12]; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; void *collectibleConfigs; Manager *manager; local_8 = -NAN; puStack_c = &LAB_00b002bd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_44 + 0x10); ExceptionList = &local_10; pvVar2 = TemporaryEffects::GetCollectibleEffect(&in_ECX->_temporaryeffects,0x146); if ((((0 < in_ECX->_damageCooldown) && ((in_ECX->_flags & 0x1000000000) == 0)) || (pvVar2 == (void *)0x0)) || (*(int *)((int)pvVar2 + 4) != 2)) { ExceptionList = local_10; return 0; } collectibleConfigs = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)collectibleConfigs >> 2 < 0x147) { iVar3 = 0; } else { iVar3 = *(int *)((int)collectibleConfigs + 0x518); } if (*(int *)((int)pvVar2 + 8) < *(int *)(iVar3 + 0x78) + -5) { ExceptionList = local_10; return 0; } TemporaryEffects::RemoveCollectibleEffect(&in_ECX->_temporaryeffects,0x146,1); isOwned = HasCollectible(in_ECX,0x3b,0); if (isOwned == 0) { uVar4 = 0; do { local_50._8_4_ = 0; local_44[0] = -12.0; laser = Entity_Laser::ShootAngle (5,&in_ECX->_pos, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 90.0,0x1e,(Vector *)(local_50 + 8),(Entity *)in_ECX,0); (**(code **)(*(int *)laser + 0x40))(0x41400000); local_44[1] = 1.0; local_44[2] = 1.0; local_44[3] = 1.0; local_44[4] = 1.0; local_44[5] = 1.0; local_44[6] = 1.0; local_44[7] = 1.0; local_44[8] = 1.0; local_44[9] = 0.0; local_44[10] = 0.0; local_44[0xb] = 0.0; (**(code **)(*(int *)laser + 0x3c))(local_44 + 1,0xffffffff,0xff,0,1); laser->_disableFollowParent = 1; if (uVar4 == 3) { laser->_renderDepthOffset = -10.0; break; } uVar4 = uVar4 + 1; laser->_renderDepthOffset = 3000.0; } while (uVar4 < 4); pvVar2 = TemporaryEffects::GetCollectibleEffect(&in_ECX->_temporaryeffects,0x3a); if ((pvVar2 != (void *)0x0) && (0x95 < *(int *)((int)pvVar2 + 8))) goto LAB_007d1f00; pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 < 0x3b) { local_50._0_4_ = 0; } else { local_50._0_4_ = *(undefined4 *)((int)pvVar2 + 0xe8); } local_50._8_4_ = 0x1e; iVar3 = 1; } else { UseActiveItem(in_ECX,&local_52,0x23,9,-1,0); manager = g_manager; local_44[0] = 1.12104e-43; seed_fart_sound_override((int *)local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44[0],1.0,2,0,1.0,0.0); manager = g_manager; local_44[0] = 4.76441e-44; seed_fart_sound_override((int *)local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44[0],1.0,2,0,1.0,0.0); pvVar2 = (g_manager->_itemConfig)._nullItems._begin; if ((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar2 >> 2 < 0x70) { local_50._0_4_ = 0; local_50._8_4_ = 0x96; iVar3 = 0x14; } else { local_50._0_4_ = *(undefined4 *)((int)pvVar2 + 0x1bc); local_50._8_4_ = 0x96; iVar3 = 0x14; } } local_50._4_4_ = (void *)0x0; local_44[0] = 0.0; TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,local_50,1,iVar3); LAB_007d1f00: isOwned = HasCollectible(in_ECX,0x248,0); if (isOwned != 0) { iVar3 = 0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_50,3,0xce,0x146,0, 0); wispIdx = 0; local_8 = 0.0; wispCount = iVar3; if (local_44[0] != 0.0) { do { iVar3 = wispCount + 1; if (*(Entity_Player **)(*(int *)(local_50._4_4_ + wispIdx * 4) + 0x410) != in_ECX) { iVar3 = wispCount; } wispIdx = wispIdx + 1; wispCount = iVar3; } while (wispIdx < (uint)local_44[0]); } iVar3 = 4 - iVar3; if (0 < iVar3) { do { AddWisp(in_ECX,0x146,&in_ECX->_pos,1,0); iVar3 = iVar3 + -1; } while (iVar3 != 0); } if (local_50[0] == '\0') { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_50._4_4_ != (void *)0x0) { uVar4 = *(uint *)(local_50._4_4_ + -4); qVar1 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar4; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar1 < uVar4); free((uint *)(local_50._4_4_ + -4)); } } } ExceptionList = local_10; return 1; } //@@ 007d2000 Entity_Player::InitTwin /* DB: SpawnCoPlayer, sets _otherTwin +0x1e68, offsets positions +-20 prototype: REPENTOGON, confirmed by RET 4 */ Entity_Player * __thiscall Entity_Player::InitTwin(Entity_Player *this,int playerType) { float fVar1; float fVar2; Game *pGVar3; EntityPtr EVar4; Vector *pVVar5; float fStack_1c; undefined1 auStack_e [10]; fStack_1c = (float)playerType; EVar4 = (EntityPtr)PlayerManager::SpawnCoPlayer2(&g_game->_playerManager); if (*(EntityPtr *)((int)EVar4 + 0x1e68) != (EntityPtr)this) { if (*(EntityPtr *)((int)EVar4 + 0x1e68) != (EntityPtr)0x0) { std::multiset::erase(auStack_e + -6); } *(EntityPtr *)((int)EVar4 + 0x1e68) = (EntityPtr)this; if (this != (Entity_Player *)0x0) { std::multiset::insert((EntityPtr *)((int)EVar4 + 0x1e68)); } } if (this->_twinPlayer != EVar4) { if (this->_twinPlayer != (EntityPtr)0x0) { std::multiset::erase(auStack_e + -6); } this->_twinPlayer = EVar4; if (EVar4 != (EntityPtr)0x0) { std::multiset::insert(&this->_twinPlayer); } } SetControllerIndex((Entity_Player *)EVar4,this->_controllerIndex,0); fStack_1c = (this->_pos).x; pVVar5 = PlayerManager::find_safe_spawn_position((Vector *)&fStack_1c,this->_pos); ((Vector *)((int)EVar4 + 0x33c))->x = pVVar5->x; pGVar3 = g_game; *(float *)((int)EVar4 + 0x340) = pVVar5->y; fVar1 = (this->_pos).y; fVar2 = (this->_pos).x; *(undefined4 *)((int)EVar4 + 0x1e50) = *(undefined4 *)&this->field_0x1e50; *(float *)((int)EVar4 + 0x340) = fVar1 + 0.0; ((Vector *)((int)EVar4 + 0x33c))->x = fVar2 + 20.0; (this->_pos).x = (this->_pos).x - 20.0; (this->_pos).y = (this->_pos).y + 0.0; HUD::AssignPlayerHUDs(&pGVar3->_hud); return (Entity_Player *)EVar4; } //@@ 007d2170 Entity_Player::TryHoldEntity /* ZHL [lua] Lua binding EntityPlayer:TryHoldEntity prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Player::TryHoldEntity(Entity_Player *this,Entity *entity) { int iVar1; byte bVar2; Entity_Player *local_c [2]; qword flags; uint *flagsHigh; void **heldSlot; Manager *manager; if (this->_heldEntity != (void *)0x0) { return 0; } if (entity == (Entity *)0x0) { return 0; } this->_isHeldEntityVisible = entity->_visible; this->_heldEntityGridCollisionClass = entity->_entityGridCollisionClass; this->_heldEntityCollisionClass = entity->_entityCollisionClass; iVar1 = entity->_type; local_c[0] = this; if (iVar1 == 4) { if (entity->_entityCollisionClass == 0) { return 0; } if (entity->_dead != 0) { return 0; } iVar1 = this->_type; flagsHigh = (uint *)((int)&entity->_flags + 4); *flagsHigh = *flagsHigh | 0x2000020; entity->_spawnerType = iVar1; *(int *)&entity->_flags = (int)entity->_flags; (entity->_posOffset).x = g_vectorZero.x; (entity->_posOffset).y = g_vectorZero.y; bVar2 = Entity_Bomb::IsRocket((Entity_Bomb *)entity); if (bVar2 != 0) { ANM2::Play(&entity->_sprite,s_Idle,0); (entity->_sprite)._rotation = 0.0; } goto LAB_007d23e6; } if (iVar1 == 1000) { if (entity->_variant == 0x88) { iVar1 = this->_type; flagsHigh = (uint *)((int)&entity->_flags + 4); *flagsHigh = *flagsHigh | 0x20; entity->_spawnerType = iVar1; *(int *)&entity->_flags = (int)entity->_flags; (entity->_posOffset).x = 0.0; (entity->_posOffset).y = -10.0; goto LAB_007d23e6; } LAB_007d23a4: bVar2 = Entity::IsEnemy(entity); if ((bVar2 == 0) || (this->_suplexState != 1)) { if (iVar1 != 0xf5) { return 0; } flagsHigh = (uint *)((int)&entity->_flags + 4); *flagsHigh = *flagsHigh | 0x2000020; } else { flagsHigh = (uint *)((int)&entity->_flags + 4); *flagsHigh = *flagsHigh | 0x2000000; } } else { if (iVar1 != 3) { if ((((iVar1 == 1) && ((Entity_Player *)entity != this)) && (entity[4]._prevPosition.y == 4.90454e-44)) && ((bVar2 = Entity::HasEntityFlags(entity,0x200000000000000), bVar2 == 0 && (bVar2 = Entity::HasEntityFlags(entity,0x400000000000000), bVar2 == 0)))) { (entity->_velocity).x = g_vectorZero.x; (entity->_velocity).y = g_vectorZero.y; flags = entity->_flags; flagsHigh = (uint *)((int)&entity->_flags + 4); *flagsHigh = *flagsHigh | 0x2000000; *(int *)&entity->_flags = (int)flags; bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&entity[5]._sprite._nullLayerNames,0x2ca); manager = g_manager; if (bVar2 != 0) { local_c[0] = (Entity_Player *)0x248; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&manager->_sfxManager,(int)local_c[0],1.0,2,0,1.0,0.0); } TemporaryEffects::RemoveCollectibleEffect ((TemporaryEffects *)&entity[5]._sprite._nullLayerNames,0x2ca,-1); goto LAB_007d23e6; } goto LAB_007d23a4; } if ((entity->_variant != 0xc9) && (entity->_variant != 0xef)) goto LAB_007d23a4; flagsHigh = (uint *)((int)&entity->_flags + 4); *flagsHigh = *flagsHigh | 0x2000000; } *(int *)&entity->_flags = (int)entity->_flags; LAB_007d23e6: heldSlot = &this->_heldEntity; entity->_visible = 0; entity->_entityCollisionClass = 0; if (*heldSlot != (void *)0x0) { local_c[0] = (Entity_Player *)heldSlot; std::multiset::erase(local_c); } *heldSlot = entity; std::multiset::insert(heldSlot); PlayExtraAnimation(this,(byte *)"LiftItem"); ANM2::Reset(&this->_heldSprite); FlushQueueItem(this); this->_itemState = 0x25c; this->_itemStateCooldown = 0; return 1; } //@@ 007d2470 Entity_Player::ThrowHeldEntity /* ZHL [lua] Lua binding EntityPlayer:ThrowHeldEntity prototype: REPENTOGON, confirmed by RET 4 */ Entity * __thiscall Entity_Player::ThrowHeldEntity(Entity_Player *this,Vector *Velocity) { ANM2 other; char cVar1; Entity_Tear *thrownEntity; LayerState *layer; Entity *unaff_EBX; int *heldEntity; byte *layerIndex; float fVar2; ANM2 aAStackY_8c88 [128]; undefined1 in_stack_fffffe8c [244]; float fVar3; float fVar4; int iVar5; int iVar6; Vector *local_44; undefined4 flagsHigh; void **heldEntitySlot; Manager *manager; heldEntitySlot = &this->_heldEntity; thrownEntity = *heldEntitySlot; if (thrownEntity == (Entity_Tear *)0x0) { return (Entity *)0x0; } thrownEntity->_visible = this->_isHeldEntityVisible; *(int *)((int)*heldEntitySlot + 0x188) = this->_heldEntityCollisionClass; *(int *)((int)*heldEntitySlot + 0x184) = this->_heldEntityGridCollisionClass; local_44 = (Vector *)(uint)((this->_flags & 0x100) != 0); cVar1 = (**(code **)(*(int *)*heldEntitySlot + 0x54))(); heldEntity = *heldEntitySlot; iVar5 = heldEntity[10]; if (cVar1 == '\0') { if (iVar5 == 4) { if ((heldEntity[0xb] == 0x13) || (heldEntity[0xb] == 0x14)) { fVar2 = atan2f(Velocity->y,Velocity->x); heldEntity[0x10a] = (int)(fVar2 * 57.295776); iVar5 = -0x3ea00000; } else { iVar5 = -0x3e400000; heldEntity[0x107] = -0x3f800000; } heldEntity[0xd3] = 0; heldEntity[0xd4] = iVar5; heldEntity[0xd8] = (int)Velocity->x; fVar2 = Velocity->y; heldEntity[0x5b] = heldEntity[0x5b] & 0xfdffffdf; heldEntity[0xd9] = (int)fVar2; heldEntity[0x5a] = heldEntity[0x5a]; heldEntity[0x10b] = 0x41700000; } else if (iVar5 == 1000) { if (heldEntity[0xb] == 0x88) { fVar4 = 5.60519e-44; fVar3 = 2.8026e-45; fVar2 = 1.1493498e-38; thrownEntity = (Entity_Tear *) Game::SpawnEx(g_game,2,0x28,local_44,Velocity,unaff_EBX, (uint)*(ushort *)(heldEntity + 0x109) | heldEntity[0x108] << 0x10,heldEntity[0x10c],0); (**(code **)(*(int *)thrownEntity + 0x40))(); if (heldEntity[0x108] == 0xe) { thrownEntity->_health = (float)heldEntity[0x10a]; if (heldEntity[0x109] - 7U < 4) { thrownEntity->_baseScale = 3.0; thrownEntity->_fScale = 3.0; Entity_Tear::ResetSpriteScale(thrownEntity); } (**(code **)(*(int *)thrownEntity + 0x40))(); if (heldEntity[0x10d] == 1) { flagsHigh = *(undefined4 *)((int)&thrownEntity->_flags + 4); *(uint *)&thrownEntity->_flags = (uint)thrownEntity->_flags | 0x40000; *(undefined4 *)((int)&thrownEntity->_flags + 4) = flagsHigh; } } if ((heldEntity[0x108] == 0x19) && (heldEntity[0x10a] == 4)) { (**(code **)(*(int *)thrownEntity + 0x40))(); } thrownEntity->_tearIdx = heldEntity[0x114]; iVar6 = -0x3e100000; iVar5 = 0x7d284a; Entity_Projectile::SetHeight((Entity_Projectile *)thrownEntity,-30.0); thrownEntity->_fallingAccel = 0.8; thrownEntity->_fallingSpeed = -5.0; thrownEntity->_prismTouched = 1; ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x174),(ANM2 *)(heldEntity + 0x12)); other._championColor._offset[0] = fVar2; other._filename._buf[0] = in_stack_fffffe8c[0]; other._filename._buf[1] = in_stack_fffffe8c[1]; other._filename._buf[2] = in_stack_fffffe8c[2]; other._filename._buf[3] = in_stack_fffffe8c[3]; other._filename._buf[4] = in_stack_fffffe8c[4]; other._filename._buf[5] = in_stack_fffffe8c[5]; other._filename._buf[6] = in_stack_fffffe8c[6]; other._filename._buf[7] = in_stack_fffffe8c[7]; other._filename._buf[8] = in_stack_fffffe8c[8]; other._filename._buf[9] = in_stack_fffffe8c[9]; other._filename._buf[10] = in_stack_fffffe8c[10]; other._filename._buf[0xb] = in_stack_fffffe8c[0xb]; other._filename._buf[0xc] = in_stack_fffffe8c[0xc]; other._filename._buf[0xd] = in_stack_fffffe8c[0xd]; other._filename._buf[0xe] = in_stack_fffffe8c[0xe]; other._filename._buf[0xf] = in_stack_fffffe8c[0xf]; other._filename._size = in_stack_fffffe8c._16_4_; other._filename._capacity = in_stack_fffffe8c._20_4_; other._animDefaultName._buf[0] = in_stack_fffffe8c[0x18]; other._animDefaultName._buf[1] = in_stack_fffffe8c[0x19]; other._animDefaultName._buf[2] = in_stack_fffffe8c[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffe8c[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffe8c[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffe8c[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffe8c[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffe8c[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffe8c[0x20]; other._animDefaultName._buf[9] = in_stack_fffffe8c[0x21]; other._animDefaultName._buf[10] = in_stack_fffffe8c[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffe8c[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffe8c[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffe8c[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffe8c[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffe8c[0x27]; other._animDefaultName._size = in_stack_fffffe8c._40_4_; other._animDefaultName._capacity = in_stack_fffffe8c._44_4_; other._animState._animation = (void *)in_stack_fffffe8c._48_4_; other._animState._animData = (void *)in_stack_fffffe8c._52_4_; other._animState._layerFrames = (void *)in_stack_fffffe8c._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffe8c._60_4_; other._animState._animFrame = (float)in_stack_fffffe8c._64_4_; other._animState._isPlaying = in_stack_fffffe8c[0x44]; other._animState._21_3_ = in_stack_fffffe8c._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffe8c._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffe8c._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffe8c._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffe8c._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffe8c._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffe8c._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffe8c._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffe8c[100]; other._overlayAnimState._21_3_ = in_stack_fffffe8c._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffe8c._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffe8c._108_4_; other._overlayRenderFirst = in_stack_fffffe8c[0x70]; other._113_3_ = in_stack_fffffe8c._113_3_; other._animData = (void *)in_stack_fffffe8c._116_4_; other._animCount = in_stack_fffffe8c._120_4_; other._layerState = (void *)in_stack_fffffe8c._124_4_; other._layerCount = in_stack_fffffe8c._128_4_; other._nullLayerNames = (void *)in_stack_fffffe8c._132_4_; other._numNullLayers = in_stack_fffffe8c._136_4_; other._eventNames = (void *)in_stack_fffffe8c._140_4_; other._numEvents = in_stack_fffffe8c._144_4_; other._offset.x = (float)in_stack_fffffe8c._148_4_; other._offset.y = (float)in_stack_fffffe8c._152_4_; other._scale.x = (float)in_stack_fffffe8c._156_4_; other._scale.y = (float)in_stack_fffffe8c._160_4_; other._rotation = (float)in_stack_fffffe8c._164_4_; other._color._tint[0] = (float)in_stack_fffffe8c._168_4_; other._color._tint[1] = (float)in_stack_fffffe8c._172_4_; other._color._tint[2] = (float)in_stack_fffffe8c._176_4_; other._color._tint[3] = (float)in_stack_fffffe8c._180_4_; other._color._colorize[0] = (float)in_stack_fffffe8c._184_4_; other._color._colorize[1] = (float)in_stack_fffffe8c._188_4_; other._color._colorize[2] = (float)in_stack_fffffe8c._192_4_; other._color._colorize[3] = (float)in_stack_fffffe8c._196_4_; other._color._offset[0] = (float)in_stack_fffffe8c._200_4_; other._color._offset[1] = (float)in_stack_fffffe8c._204_4_; other._color._offset[2] = (float)in_stack_fffffe8c._208_4_; other._championColor._tint[0] = (float)in_stack_fffffe8c._212_4_; other._championColor._tint[1] = (float)in_stack_fffffe8c._216_4_; other._championColor._tint[2] = (float)in_stack_fffffe8c._220_4_; other._championColor._tint[3] = (float)in_stack_fffffe8c._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffe8c._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffe8c._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffe8c._236_4_; other._championColor._colorize[3] = (float)in_stack_fffffe8c._240_4_; other._championColor._offset[1] = fVar3; other._championColor._offset[2] = fVar4; other._256_4_ = local_44; other._playbackSpeed = (float)Velocity; other._264_4_ = unaff_EBX; other._shadowLayerIndex = iVar5; other._bitflags = iVar6; ANM2::operator_assign(&thrownEntity->_sprite,other); layerIndex = (byte *)0x0; if ((thrownEntity->_sprite)._layerCount != 0) { do { layer = ANM2::GetLayer(&thrownEntity->_sprite,layerIndex); (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; layer = ANM2::GetLayer(&thrownEntity->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_size).x = g_vectorOne.x; (layer->_size).y = g_vectorOne.y; } while (layerIndex < (byte *)(thrownEntity->_sprite)._layerCount); } (**(code **)(*(int *)thrownEntity + 0xc))(); iVar5 = *(int *)*heldEntitySlot; } else { if (heldEntity[0xb] != 0x76) goto LAB_007d28f9; iVar5 = *heldEntity; } (**(code **)(iVar5 + 0x28))(); } } else { if (iVar5 == 1) { heldEntity[0x5b] = heldEntity[0x5b] | 0x4000000; *(undefined1 *)(heldEntity + 0x104) = 1; heldEntity[0x5a] = heldEntity[0x5a]; heldEntity[0x61] = 3; heldEntity = *heldEntitySlot; } manager = g_manager; if (heldEntity[10] == 0xf5) { seed_fart_sound_override((int *)((int)register0x00000010 + -0x50)); SoundEffects::Play(&manager->_sfxManager,0x361,1.0,2,0,1.0,0.0); heldEntity = *heldEntitySlot; } heldEntity[0x5b] = heldEntity[0x5b] & 0xfdffffff; heldEntity[0x5a] = heldEntity[0x5a]; } LAB_007d28f9: if (*heldEntitySlot != (void *)0x0) { std::multiset::erase(); } *heldEntitySlot = (void *)0x0; return (Entity *)thrownEntity; } //@@ 007d2930 Entity_Player::TryThrow /* ZHL [exact] bool TryThrow(const EntityRef& Source, Vector* pos, float unk); */ undefined4 __thiscall Entity_Player::TryThrow(Entity_Player *this,int *param_2,float *param_3,float param_4) { float fVar1; if (((this->_canFly != 0) || (this->_entityGridCollisionClass != 5)) || ((this->_posOffset).y < 0.0)) { if (*param_2 != 1) { return 0; } } else if (*param_2 != 1) goto LAB_007d299b; (this->_velocity).x = (this->_velocity).x * 0.3; (this->_velocity).y = (this->_velocity).y * 0.3; LAB_007d299b: this->_heightVelocity = -param_4; fVar1 = (this->_velocity).x; (this->_posOffset).y = 0.0; (this->_velocity).x = fVar1 + *param_3; (this->_velocity).y = param_3[1] + (this->_velocity).y; return 1; } //@@ 007d2a00 Entity_Player::AddFriendlyDip /* ZHL [lua] Lua binding EntityPlayer:AddFriendlyDip */ void Entity_Player::AddFriendlyDip(int param_1,Vector *param_2) { Entity *in_ECX; Entity_Familiar::ThrowDip(param_1,param_2,in_ECX); return; } //@@ 007d2a20 Entity_Player::ThrowFriendlyDip /* ZHL [lua] Lua binding EntityPlayer:ThrowFriendlyDip */ void Entity_Player::ThrowFriendlyDip(int param_1,Vector *param_2,Vector *param_3) { Entity *in_ECX; spawn_dip_at(param_1,param_2,in_ECX,param_3); return; } //@@ 007d2a40 Entity_Player::AddBrokenHearts /* ZHL [exact] __thiscall void Entity_Player::AddBrokenHearts(int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddBrokenHearts(Entity_Player *this,int amount) { EntityPtr EVar1; byte bVar2; int iVar3; int iVar4; int iVar5; iVar4 = this->_playerType; while ((iVar4 == 0x28 && (EVar1 = *(EntityPtr *)((int)this + 0x1e68), EVar1 != (EntityPtr)0x0))) { iVar4 = *(int *)((int)EVar1 + 0x13c0); this = (Entity_Player *)EVar1; } iVar5 = *(int *)((int)this + 0x1da0) + amount; iVar3 = GetHeartLimit(this,1); iVar4 = 0; if (0 < iVar5) { iVar4 = iVar5; } iVar5 = iVar3 / 2; if (iVar4 < iVar3 / 2) { iVar5 = iVar4; } *(int *)((int)this + 0x1da0) = iVar5; AddMaxHearts(this,0,0); bVar2 = HasCollectible(this,0x2b6,0); if (bVar2 != 0) { *(uint *)((int)this + 0x1574) = *(uint *)((int)this + 0x1574) | 1; EvaluateItems(); } return; } //@@ 007d2ad0 Entity_Player::AddSoulCharge /* ZHL [lua] Lua binding EntityPlayer:AddSoulCharge prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::AddSoulCharge(Entity_Player *this,int count) { int iVar1; Game *pGVar2; int *piVar3; int *piVar4; int local_c [2]; local_c[1] = 99; local_c[0] = 0; iVar1 = this->_effectiveSoulCharge; count = count + iVar1; piVar4 = local_c + 1; if (count < 100) { piVar4 = &count; } piVar3 = local_c; if (-1 < *piVar4) { piVar3 = piVar4; } this->_effectiveSoulCharge = *piVar3; apply_soul_charge_to_actives(iVar1); ConsumableCountChanged(this,0x20); pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007d2b50 Entity_Player::GetEffectiveSoulCharge /* ZHL [lua] Lua binding EntityPlayer:GetEffectiveSoulCharge */ int __thiscall Entity_Player::GetEffectiveSoulCharge(Entity_Player *this) { if (this->_playerType == 0x12) { return this->_effectiveSoulCharge; } return 0; } //@@ 007d2b70 Entity_Player::apply_soul_charge_to_actives /* DB: ? only for PLAYER_BETHANY (0x12): for each active slot with a chargeable item compares the charge before/after adding param soul charge (_effectiveSoulCharge) and calls HUD::FlashChargeBar + charge sound (0xab/0xda) when a bar fills; Entity_Player::AddSoulCharge, SyncConsumables */ void Entity_Player::apply_soul_charge_to_actives(int param_1) { void *pvVar1; Manager *pMVar2; byte bVar3; int iVar4; Entity_Player *in_ECX; uint uVar5; uint unused; int iVar6; uint slot; bool bVar7; int local_8; if (in_ECX->_playerType == 0x12) { slot = 0; do { unused = in_ECX->_activeDesc[slot]._item; if (g_game == (Game *)0x0) { if (-1 < (int)unused) goto LAB_007d2bd3; LAB_007d2bf5: local_8 = 0; } else if ((int)unused < 0) { uVar5 = ~unused; bVar7 = -1 < (int)unused; unused = uVar5; if ((bVar7) || (pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2 <= (int)uVar5)) goto LAB_007d2bf5; local_8 = **(int **)((int)pvVar1 + uVar5 * 4); } else { LAB_007d2bd3: pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 >> 2 <= (int)unused) goto LAB_007d2bf5; local_8 = *(int *)((int)pvVar1 + unused * 4); } if (slot == 3) { iVar6 = 0; } else if (((slot == 2) && (in_ECX->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)) { iVar6 = 0; } else { iVar6 = GetCollectibleMaxCharge (in_ECX,in_ECX->_activeDesc[slot]._item,in_ECX->_activeDesc[slot]._varData ,unused); } iVar4 = GetActiveMaxCharge(in_ECX,slot); if (((local_8 != 0) && (iVar4 != 1)) && (0 < iVar6)) { local_8 = GetTotalActiveCharge(in_ECX,slot); if (in_ECX->_playerType == 0x12) { iVar4 = in_ECX->_effectiveSoulCharge; } else { iVar4 = 0; } iVar4 = (local_8 - iVar4) + param_1; if ((iVar4 < local_8) && (iVar4 < iVar6)) { HUD::FlashChargeBar(&g_game->_hud,in_ECX,slot); iVar4 = local_8; pMVar2 = g_manager; local_8 = 0xda; if (iVar4 < iVar6) { local_8 = 0xab; } seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar2->_sfxManager,local_8,1.0,2,0,1.0,0.0); } } slot = slot + 1; } while (slot < 4); bVar3 = HasTrinket(in_ECX,0x65,0); if ((bVar3 == 0) && (bVar3 = HasTrinket(in_ECX,100,0), bVar3 == 0)) { return; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x40f; EvaluateItems(); } return; } //@@ 007d2d40 Entity_Player::AddBloodCharge /* ZHL [lua] Lua binding EntityPlayer:AddBloodCharge prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::AddBloodCharge(Entity_Player *this,int amount) { int iVar1; Game *pGVar2; int *piVar3; int *piVar4; int local_c [2]; local_c[1] = 99; local_c[0] = 0; iVar1 = this->_effectiveBloodCharge; amount = amount + iVar1; piVar4 = local_c + 1; if (amount < 100) { piVar4 = &amount; } piVar3 = local_c; if (-1 < *piVar4) { piVar3 = piVar4; } this->_effectiveBloodCharge = *piVar3; blood_charge_changed(iVar1); ConsumableCountChanged(this,0x100); pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007d2dd0 Entity_Player::GetEffectiveBloodCharge /* ZHL [lua] Lua binding EntityPlayer:GetEffectiveBloodCharge */ int __thiscall Entity_Player::GetEffectiveBloodCharge(Entity_Player *this) { if (this->_playerType == 0x24) { return this->_effectiveBloodCharge; } return 0; } //@@ 007d2df0 Entity_Player::blood_charge_changed /* DB: ECX player; only for playerType 36 (Tainted Bethany); arg is the OLD _effectiveBloodCharge: per active slot flashes charge bar and plays sound when the blood charge crosses the max; Vibrant/Dim Bulb (100/101) re-evaluate cache; called from AddBloodCharge and SyncConsumables right after _effectiveBloodCharge is written */ void Entity_Player::blood_charge_changed(int param_1) { void *pvVar1; Manager *pMVar2; byte bVar3; int iVar4; Entity_Player *in_ECX; uint uVar5; uint unused; int iVar6; uint slot; bool bVar7; int local_8; if (in_ECX->_playerType == 0x24) { slot = 0; do { unused = in_ECX->_activeDesc[slot]._item; if (g_game == (Game *)0x0) { if (-1 < (int)unused) goto LAB_007d2e53; LAB_007d2e75: local_8 = 0; } else if ((int)unused < 0) { uVar5 = ~unused; bVar7 = -1 < (int)unused; unused = uVar5; if ((bVar7) || (pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2 <= (int)uVar5)) goto LAB_007d2e75; local_8 = **(int **)((int)pvVar1 + uVar5 * 4); } else { LAB_007d2e53: pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 >> 2 <= (int)unused) goto LAB_007d2e75; local_8 = *(int *)((int)pvVar1 + unused * 4); } if (slot == 3) { iVar6 = 0; } else if (((slot == 2) && (in_ECX->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)) { iVar6 = 0; } else { iVar6 = GetCollectibleMaxCharge (in_ECX,in_ECX->_activeDesc[slot]._item,in_ECX->_activeDesc[slot]._varData ,unused); } iVar4 = GetActiveMaxCharge(in_ECX,slot); if (((local_8 != 0) && (iVar4 != 1)) && (0 < iVar6)) { local_8 = GetTotalActiveCharge(in_ECX,slot); if (in_ECX->_playerType == 0x24) { iVar4 = in_ECX->_effectiveBloodCharge; } else { iVar4 = 0; } iVar4 = (local_8 - iVar4) + param_1; if ((iVar4 < local_8) && (iVar4 < iVar6)) { HUD::FlashChargeBar(&g_game->_hud,in_ECX,slot); iVar4 = local_8; pMVar2 = g_manager; local_8 = 0xda; if (iVar4 < iVar6) { local_8 = 0xab; } seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar2->_sfxManager,local_8,1.0,2,0,1.0,0.0); } } slot = slot + 1; } while (slot < 4); bVar3 = HasTrinket(in_ECX,0x65,0); if ((bVar3 == 0) && (bVar3 = HasTrinket(in_ECX,100,0), bVar3 == 0)) { return; } in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x40f; EvaluateItems(); } return; } //@@ 007d2fc0 Entity_Player::AddRottenHearts /* ZHL [exact] __thiscall void Entity_Player::AddRottenHearts(int amount, bool unk); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::AddRottenHearts(Entity_Player *this,int amount,byte unk) { int iVar1; int iVar2; int iVar3; Entity_Player *this_00; Entity_Player *this_01; Entity_Player *this_02; int iVar4; int amount_00; while( true ) { while ((iVar4 = *(int *)((int)this + 0x13c0), iVar4 == 0x28 && (*(EntityPtr *)((int)this + 0x1e68) != (EntityPtr)0x0))) { this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } if (((0 < amount) && (unk == 0)) && (g_game->_challenge == 0x19)) break; if ((iVar4 != 0x11) || (*(EntityPtr *)((int)this + 0x1d98) == (EntityPtr)0x0)) { iVar2 = GetHealthType(this); if ((iVar2 != 1) && (iVar2 = GetHealthType(this_00), iVar2 != 2)) { iVar2 = GetHealthType(this_01); if (iVar2 == 3) { if (0 < amount_00) { AddBlueFlies(this_02,(amount_00 * 3 + 1) / 2,(Vector *)((int)this + 0x33c),(Entity *)0x0 ); return; } } else { if (1 < *(int *)&g_game->_deathmatchManager) { ClampHeartsToLimit(this,0xc,amount_00); return; } iVar2 = amount_00; if (((iVar4 == 0x16) && (unk == 0)) && (0 < amount_00)) { iVar2 = amount_00 * 2; } iVar1 = *(int *)((int)this + 0x1da4); iVar4 = *(int *)((int)this + 0x1340) + *(int *)((int)this + 0x1d88) * 2; iVar3 = *(int *)((int)this + 0x1344) + iVar2; if (iVar3 < iVar4) { iVar4 = iVar3; } if (iVar4 < 0) { iVar4 = 0; } *(int *)((int)this + 0x1344) = iVar4; if (iVar2 < 1) { *(int *)((int)this + 0x1da4) = (iVar2 + -1) / 2 + iVar1; UpdateHeartDependentEffects(this); ClampGoldenHearts(this,0); update_bone_hearts(this); } else { *(uint *)((int)this + 0x16c) = *(uint *)((int)this + 0x16c) & 0xfffffffb; *(undefined4 *)((int)this + 0x138c) = 0; *(int *)((int)this + 0x1da4) = (iVar2 + 1) / 2 + iVar1; *(undefined4 *)((int)this + 0x168) = *(undefined4 *)((int)this + 0x168); UpdateHeartDependentEffects(this); ClampGoldenHearts(this,0); update_bone_hearts(this); if (iVar1 < *(int *)((int)this + 0x1da4)) { _player_hud_set_heart_anim_state(this); return; } } } } return; } unk = 0; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1d98); } return; } //@@ 007d3180 Entity_Player::CanPickRottenHearts /* ZHL [lua] Lua binding EntityPlayer:CanPickRottenHearts */ bool __thiscall Entity_Player::CanPickRottenHearts(Entity_Player *this) { byte bVar1; int iVar2; if (1 < *(int *)&g_game->_deathmatchManager) { return this->_maxHearts < 0xa0; } while( true ) { while (*(int *)((int)this + 0x13c0) != 0x28) { if ((*(int *)((int)this + 0x13c0) != 0x11) || (*(EntityPtr *)((int)this + 0x1d98) == (EntityPtr)0x0)) goto LAB_007d31bd; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1d98); } if (*(EntityPtr *)((int)this + 0x1e68) == (EntityPtr)0x0) break; this = (Entity_Player *)*(EntityPtr *)((int)this + 0x1e68); } LAB_007d31bd: iVar2 = GetHealthType(this); if (iVar2 == 3) { return false; } bVar1 = HasFullHearts(this); if ((bVar1 == 0) || (iVar2 = GetEffectiveMaxHearts(this), *(int *)((int)this + 0x1da4) * 2 < iVar2)) { return true; } return false; } //@@ 007d3200 Entity_Player::UpdateBookOfVirtues /* ZHL [exact] __thiscall void Entity_Player::UpdateBookOfVirtues(bool addedBookOfVirtues); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::UpdateBookOfVirtues(Entity_Player *this,byte addedBookOfVirtues) { void *pvVar1; byte bVar2; int iVar3; Game *extraout_ECX; Game *unused; int iVar4; iVar4 = 0; bVar2 = HasCollectible(this,0x248,0); if (bVar2 != 0) { iVar4 = 0x248; } bVar2 = HasCollectible(this,0x3b,0); unused = extraout_ECX; if (bVar2 != 0) { iVar4 = 0x3b; pvVar1 = (g_game->_itemPool)._removedCollectibles._begin; unused = g_game; if ((((*(byte *)((int)pvVar1 + 4) & 4) == 0) && (g_game->_challenge != 0x2b)) && (0x22 < (g_game->_itemPool)._removedCollectibles._size)) { unused = (Game *)((int)pvVar1 + 4); unused->_stage = unused->_stage | 4; iVar3 = this->_activeDesc[0]._item; goto LAB_007d327a; } } iVar3 = this->_activeDesc[0]._item; if (iVar4 == 0) { if ((iVar3 == 0x248) || (iVar3 == 0x3b)) { this->_activeDesc[0]._item = 0; return; } return; } LAB_007d327a: if ((iVar4 == iVar3) || (((iVar3 != 0 && (iVar3 != 0x248)) && (iVar3 != 0x3b)))) { return; } this->_activeDesc[0]._item = iVar4; if ((addedBookOfVirtues == 0) && ((this->_playerType != 0x12 || (iVar4 != 0x248)))) { iVar4 = 0; } else { iVar4 = GetCollectibleMaxCharge(this,iVar4,this->_activeDesc[0]._varData,(int)unused); } this->_activeDesc[0]._charge = iVar4; this->_activeDesc[0]._batteryCharge = 0; this->_activeDesc[0]._subCharge = 0; this->_activeDesc[0]._partialCharge = 0; this->_activeDesc[0]._timeRechargeCooldown = 0; this->_activeDesc[0]._varData = 0; return; } //@@ 007d3330 FUN_007d3330 void FUN_007d3330(int param_1) { int in_ECX; *(int *)(in_ECX + 0x1dc8) = *(int *)(in_ECX + 0x1dc8) + param_1; *(uint *)(in_ECX + 0x1574) = *(uint *)(in_ECX + 0x1574) | 1; Entity_Player::EvaluateItems(); return; } //@@ 007d3350 Entity_Player::trigger_vampire_charm_kill /* DB: ECX player; HasCollectible 62 (Charm of the Vampire) increments _vampireCharmKills, at 13 (8 in greed) heals 1 heart, plays sound, spawns effect 1000.49 (heart); called from trigger_npc_death and Entity_Tear::HandleCollision */ void Entity_Player::trigger_vampire_charm_kill(void) { Manager *pMVar1; byte bVar2; uint seed; Entity *pEVar3; Entity_Player *in_ECX; int iVar4; int local_c [2]; iVar4 = 0xd; if (1 < *(int *)&g_game->_deathmatchManager) { iVar4 = 8; } bVar2 = HasCollectible(in_ECX,0x3e,0); if (((bVar2 != 0) && (in_ECX->_vampireCharmKills = in_ECX->_vampireCharmKills + 1, pMVar1 = g_manager, iVar4 <= in_ECX->_vampireCharmKills)) && (in_ECX->_dead == 0)) { local_c[0] = 0x9d; if (in_ECX->_playerType == 0x16) { local_c[0] = 0x266; } seed_fart_sound_override(local_c); SoundEffects::Play(&pMVar1->_sfxManager,local_c[0],1.0,2,0,1.0,0.0); AddHearts(in_ECX,1,1,0); in_ECX->_vampireCharmKills = in_ECX->_vampireCharmKills - iVar4; seed = Random(); pEVar3 = Game::SpawnEx(g_game,1000,0x31,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,0,seed,0); iVar4 = __RTDynamicCast(pEVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar4 + 0xdc) = 0; *(undefined4 *)(iVar4 + 0xe0) = 0xc1c00000; *(undefined4 *)(iVar4 + 0x358) = 0x3f800000; } return; } //@@ 007d3480 Entity_Player::AddUrnSouls /* ZHL [exact] __thiscall void Entity_Player::AddUrnSouls(unsigned int amount); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddUrnSouls(Entity_Player *this,uint amount) { Game *pGVar1; uint *puVar2; uint *puVar3; uint local_c [2]; amount = amount + this->_urnSouls; local_c[1] = 0x14; puVar3 = &amount; if (0x13 < (int)amount) { puVar3 = local_c + 1; } puVar2 = local_c; if (0 < (int)*puVar3) { puVar2 = puVar3; } this->_urnSouls = *puVar2; pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007d34f0 Entity_Player::AddGigaBombs /* ZHL [lua] Lua binding EntityPlayer:AddGigaBombs prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AddGigaBombs(Entity_Player *this,int amount) { Game *pGVar1; int *piVar2; int *piVar3; int local_8; amount = this->_numGigaBombs + amount; piVar3 = &amount; if (this->_numBombs <= amount) { piVar3 = &this->_numBombs; } local_8 = 0; piVar2 = &local_8; if (0 < *piVar3) { piVar2 = piVar3; } this->_numGigaBombs = *piVar2; ConsumableCountChanged(this,0x40); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007d3560 FUN_007d3560 Game * FUN_007d3560(void) { Game *pGVar1; if (1 < *(int *)&g_game->_deathmatchManager) { return g_game; } if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { pGVar1 = (Game *)(g_game->_stage + 1); } else { pGVar1 = (Game *)g_game->_stage; } return pGVar1; } //@@ 007d35b0 Entity_Player::try_end_astral_projection /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? bool; flag player+0x1519 (projecting) or manager float: RemoveCostume, poof 1000.16 + 1000.111 effects, Teleport back to the body entity (player+0x1eac ptr pos), try_trigger_astral_projection, "Death"/GetDeathAnimName extra anim; in take_damage_impl a true return negates the hit, also called at TriggerRoomClear start prototype: db/protos.zhl */ byte __thiscall Entity_Player::try_end_astral_projection(Entity_Player *this) { float fVar1; byte bVar2; float fVar3; Manager *pMVar4; void *pvVar5; ItemConfig_Item *Item; uint uVar6; uint rngResult; Entity *effect; float *roomColorMod; byte *deathAnimChar; int iVar7; char *expectedAnimChar; bool isCharLess; float fVar8; double dVar9; undefined1 auStack_f4 [20]; int soundId [3]; float local_d4; float local_d0; float local_cc; float local_c8; float local_c4; float trailStepDivisor; Vector local_bc; float bodyX; float playerY; int trailStep; Color local_a8; Vector trailVelocity; ColorMod effectColor; uint local_44; EntityPtr astralBody; Game *game; local_44 = __security_cookie ^ (uint)auStack_f4; if ((((this->_temporaryeffects)._disabled != 0) || (pvVar5 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryeffects,0x2a5), pvVar5 == (void *)0x0)) || (*(int *)((int)pvVar5 + 4) != 1)) { return 0; } pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((0xa94 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU)) && (fVar8 = *(float *)((int)pvVar5 + 0xa94), fVar8 != 0.0)) { local_a8._tint[2] = *(float *)((int)fVar8 + 0x78); local_a8._tint[1] = 0.0; local_a8._tint[3] = 0.0; local_a8._tint[0] = fVar8; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_a8,1,1); } pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 & 0xfffffffcU) < 0xa95) { Item = (ItemConfig_Item *)0x0; } else { Item = *(ItemConfig_Item **)((int)pvVar5 + 0xa94); } RemoveCostume(this,Item); astralBody = this->_astralProjectionBody; if (astralBody != (EntityPtr)0x0) { local_d4 = *(float *)((int)astralBody + 0x33c) - (this->_pos).x; local_d0 = *(float *)((int)astralBody + 0x340) - (this->_pos).y; local_cc = local_d4 * 0.1; local_c8 = local_d0 * 0.1; local_bc.x = local_cc; local_bc.y = local_c8; fVar8 = sqrtf(local_cc * local_cc + local_c8 * local_c8); if ((4.0 < fVar8) && (0.0 < fVar8)) { local_bc.y = (4.0 / fVar8) * local_c8; local_bc.x = (4.0 / fVar8) * local_cc; } local_d4 = sqrtf(local_d0 * local_d0 + local_d4 * local_d4); local_d4 = local_d4 / 20.0; dVar9 = floor((double)local_d4); local_d4 = (float)dVar9; iVar7 = (int)dVar9; if (iVar7 < 4) { iVar7 = 4; } if (0xc < iVar7) { iVar7 = 0xc; } if (0 < iVar7) { trailStepDivisor = (float)(iVar7 + 1); trailStep = 0; do { trailStep = trailStep + 1; local_d0 = (float)trailStep / trailStepDivisor; bodyX = *(float *)((int)this->_astralProjectionBody + 0x33c); local_c4 = *(float *)((int)this->_astralProjectionBody + 0x340); local_d4 = (this->_pos).x; playerY = (this->_pos).y; uVar6 = Random(); local_c8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_c8 = local_c8 + local_c8; uVar6 = Random(); local_cc = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar8 = cos(local_c8); local_a8._tint[0] = fVar8 * local_cc * 15.0 + (bodyX - local_d4) * local_d0 + local_d4; fVar8 = sin(local_c8); local_a8._tint[1] = fVar8 * local_cc * 15.0 + (local_c4 - playerY) * local_d0 + playerY; uVar6 = Random(); rngResult = Random(); trailVelocity.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; trailVelocity.y = trailVelocity.x * local_bc.y; trailVelocity.x = trailVelocity.x * local_bc.x; effect = Game::SpawnEx(g_game,1000,0x6f,(Vector *)&local_a8,&trailVelocity,(Entity *)0x0,0, uVar6,0); effectColor._offset[0] = 1.0; effectColor._offset[1] = 1.0; effectColor._colorize[0] = 0.0; effectColor._colorize[1] = 0.0; effectColor._colorize[2] = 0.0; effectColor._colorize[3] = 0.0; effectColor._tint[0] = 1.0; effectColor._tint[1] = 1.0; effectColor._tint[2] = 1.0; effectColor._tint[3] = 1.0; effectColor._offset[2] = 1.0; (**(code **)(*(int *)effect + 0x3c))(&effectColor,0xffffffff,0xff,0); local_c4 = local_d0 * g_vectorOne.x; local_d0 = local_d0 * g_vectorOne.y; uVar6 = Random(); fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; (effect->_sprite)._scale.y = local_d0 * fVar8; (effect->_sprite)._scale.x = fVar8 * local_c4; fVar8 = (this->_posOffset).y; fVar1 = (this->_sprite)._scale.y; (effect->_posOffset).x = (this->_posOffset).x + 0.0; (effect->_posOffset).y = fVar8 - fVar1 * 16.0; } while (trailStep < iVar7); } uVar6 = Random(); effect = Game::SpawnEx(g_game,1000,0x10,&this->_pos,&local_bc,(Entity *)0x0,10,uVar6,0); effectColor._tint[0] = 1.0; effectColor._tint[1] = 1.0; effectColor._tint[2] = 1.0; effectColor._tint[3] = 1.0; effectColor._colorize[0] = 1.0; effectColor._colorize[1] = 1.0; effectColor._colorize[2] = 1.0; effectColor._colorize[3] = 1.0; effectColor._offset[0] = 0.0; effectColor._offset[1] = 0.0; effectColor._offset[2] = 0.0; (**(code **)(*(int *)effect + 0x3c))(&effectColor,0xffffffff,0xff,0); (effect->_posOffset).x = (this->_posOffset).x; (effect->_posOffset).y = (this->_posOffset).y; (effect->_sprite)._scale.x = (this->_sprite)._scale.x; (effect->_sprite)._scale.y = (this->_sprite)._scale.y; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; local_bc.x = *(float *)((int)this->_astralProjectionBody + 0x33c); local_bc.y = *(float *)((int)this->_astralProjectionBody + 0x340); Teleport(this,&local_bc,0,0); (**(code **)(*(int *)this->_astralProjectionBody + 0x28))(); } (**(code **)(*(int *)this + 0x60))(); local_a8._offset[2] = (this->_sprite)._color._offset[2]; effectColor._colorize[0] = 0.0; effectColor._colorize[1] = 0.0; effectColor._colorize[2] = 0.0; effectColor._colorize[3] = 0.0; effectColor._tint[0] = 1.0; effectColor._tint[1] = 1.0; effectColor._tint[2] = 1.0; effectColor._tint[3] = 1.0; local_a8._tint[0] = (this->_sprite)._color._tint[0]; local_a8._tint[1] = (this->_sprite)._color._tint[1]; local_a8._tint[2] = (this->_sprite)._color._tint[2]; local_a8._tint[3] = (this->_sprite)._color._tint[3]; effectColor._offset[0] = 1.0; effectColor._offset[1] = 1.0; effectColor._offset[2] = 1.0; local_a8._colorize[0] = (this->_sprite)._color._colorize[0]; local_a8._colorize[1] = (this->_sprite)._color._colorize[1]; local_a8._colorize[2] = (this->_sprite)._color._colorize[2]; local_a8._colorize[3] = (this->_sprite)._color._colorize[3]; local_a8._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; Color::__mul(&local_a8,&effectColor); effectColor._tint[0] = local_a8._tint[0]; effectColor._tint[1] = local_a8._tint[1]; effectColor._tint[2] = local_a8._tint[2]; effectColor._tint[3] = local_a8._tint[3]; effectColor._offset[2] = local_a8._offset[2]; effectColor._colorize[0] = local_a8._colorize[0]; effectColor._colorize[1] = local_a8._colorize[1]; effectColor._colorize[2] = local_a8._colorize[2]; effectColor._colorize[3] = local_a8._colorize[3]; effectColor._offset[0] = local_a8._offset[0]; effectColor._offset[1] = local_a8._offset[1]; (**(code **)(*(int *)this + 0x3c))(&effectColor,8,0xff,1,1); game = g_game; g_game->_bloomDuration = 10; game->_bloomTimer = 10; game->_bloomStrength = 0.6; roomColorMod = Room::get_color_modifier(game->_room,&local_bc.x); game = g_game; fVar8 = roomColorMod[1]; fVar1 = roomColorMod[2]; fVar3 = roomColorMod[3]; (g_game->_targetColorModifier)._red = *roomColorMod; (game->_targetColorModifier)._green = fVar8; (game->_targetColorModifier)._blue = fVar1; (game->_targetColorModifier)._amount = fVar3; fVar8 = roomColorMod[5]; (game->_targetColorModifier)._brightness = roomColorMod[4]; (game->_targetColorModifier)._contrast = fVar8; fVar8 = (game->_targetColorModifier)._green; fVar1 = (game->_targetColorModifier)._blue; fVar3 = (game->_targetColorModifier)._amount; (game->_currentColorModifier)._red = (game->_targetColorModifier)._red; (game->_currentColorModifier)._green = fVar8; (game->_currentColorModifier)._blue = fVar1; (game->_currentColorModifier)._amount = fVar3; fVar8 = (game->_targetColorModifier)._contrast; (game->_currentColorModifier)._brightness = (game->_targetColorModifier)._brightness; (game->_currentColorModifier)._contrast = fVar8; game->_shouldLerpColorModState = 0; try_trigger_astral_projection(this); if (this->_dead == 0) { iVar7 = this->_damageCooldown; if (iVar7 < 0x78) { iVar7 = 0x78; } this->_damageCooldown = iVar7; } else { expectedAnimChar = "Death"; deathAnimChar = GetDeathAnimName(this); do { bVar2 = *deathAnimChar; isCharLess = bVar2 < (byte)*expectedAnimChar; if (bVar2 != *expectedAnimChar) { LAB_007d3d20: uVar6 = -(uint)isCharLess | 1; goto LAB_007d3d25; } if (bVar2 == 0) break; bVar2 = deathAnimChar[1]; isCharLess = bVar2 < (byte)expectedAnimChar[1]; if (bVar2 != expectedAnimChar[1]) goto LAB_007d3d20; deathAnimChar = deathAnimChar + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar2 != 0); uVar6 = 0; LAB_007d3d25: if (uVar6 == 0) { PlayExtraAnimation(this,(byte *)"Death"); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,24.0); } local_d4 = get_voice_pitch(this); pMVar4 = g_manager; soundId[0] = 0xd9; seed_fart_sound_override(soundId); SoundEffects::Play(&pMVar4->_sfxManager,soundId[0],1.0,2,0,local_d4,0.0); return 1; } } return 1; } //@@ 007d3e00 FUN_007d3e00 void FUN_007d3e00(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x1eb0) = 0; *(undefined4 *)(in_ECX + 0x1eb4) = 0; *(undefined4 *)(in_ECX + 0x1eb8) = 0; *(undefined4 *)(in_ECX + 0x1ebc) = 0; *(undefined4 *)(in_ECX + 0x1ec0) = 0; *(undefined4 *)(in_ECX + 0x1ec4) = 0xc61c3c00; return; } //@@ 007d3e40 Entity_Player::fire_saturnus_tears /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: once from Entity_Player::room_enter under HasCollectible(595 Saturnus): ring of Entity_Player::FireTear with SetTearFlags, sin/cos spread */ void __thiscall Entity_Player::fire_saturnus_tears(Entity_Player *this) { double dVar1; uint uVar2; uint uVar3; Vector velocity; BitSet128 flags; qword qVar4; qword qVar5; Game *pGVar6; uint uVar7; Entity_Tear *this_00; float fVar8; float fVar9; float fVar10; int local_3c; Vector local_28; uint uStack_20; uint uStack_1c; uint uStack_18; uint uStack_14; uVar7 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]; local_3c = 0; do { fVar10 = (float)((double)(int)uVar7 + dVar1) * 2.3283064e-10 * 360.0 - (float)local_3c * 51.42857; fVar8 = fVar10 * 0.017453292; fVar9 = cos(fVar8); local_28.x = fVar9 * 4.0 + (this->_pos).x; fVar8 = sin(fVar8); local_28.y = fVar8 * 4.0 + (this->_pos).y; fVar10 = (fVar10 + 90.0) * 0.017453292; fVar8 = this->_shotspeed * 10.0; fVar9 = cos(fVar10); fVar10 = sin(fVar10); velocity.y = fVar10 * fVar8; velocity.x = fVar9 * fVar8; this_00 = FireTear(this,&local_28,velocity,0x47,(Entity *)0x0,1.5); (**(code **)(*(int *)this_00 + 0x40))(this_00->_collisionDamage + 5.0); qVar4 = (this_00->_tearFlags)._l; uVar2 = *(uint *)((int)&(this_00->_tearFlags)._l + 4); qVar5 = (this_00->_tearFlags)._h; uVar3 = *(uint *)((int)&(this_00->_tearFlags)._h + 4); this_00->_tearIdx = 1; uStack_20 = ~((uint)g_tearFlagHoming._l | DAT_00c34b80 | DAT_00c34860 | DAT_00c34b60 | (uint)g_tearFlagLudovico._l | DAT_00c34b70) & ((uint)qVar4 | _DAT_00c346f0 | (uint)g_tearFlagSpectral._l | DAT_00c34600); uStack_1c = ~(g_tearFlagHoming._l._4_4_ | DAT_00c34b84 | DAT_00c34864 | DAT_00c34b64 | g_tearFlagLudovico._l._4_4_ | DAT_00c34b74) & (uVar2 | _DAT_00c346f4 | g_tearFlagSpectral._l._4_4_ | DAT_00c34604); uStack_18 = ~((uint)g_tearFlagHoming._h | DAT_00c34b88 | DAT_00c34868 | DAT_00c34b68 | (uint)g_tearFlagLudovico._h | DAT_00c34b78) & ((uint)qVar5 | _DAT_00c346f8 | (uint)g_tearFlagSpectral._h | DAT_00c34608); uStack_14 = ~(g_tearFlagHoming._h._4_4_ | DAT_00c34b8c | DAT_00c3486c | DAT_00c34b6c | g_tearFlagLudovico._h._4_4_ | DAT_00c34b7c) & (uVar3 | _DAT_00c346fc | g_tearFlagSpectral._h._4_4_ | DAT_00c3460c); flags._l._4_4_ = uStack_1c; flags._l._0_4_ = uStack_20; flags._h._0_4_ = uStack_18; flags._h._4_4_ = uStack_14; Entity_Tear::SetTearFlags(this_00,flags); this_00->_height = -20.0; fVar8 = Entity_Tear::get_height_offset_y(this_00,-20.0); pGVar6 = g_game; (this_00->_posOffset).y = fVar8; if (*(int *)((int)pGVar6->_room + 8) == 0x10) { (this_00->_posOffset).y = -18.0; } local_3c = local_3c + 1; this_00->_fallingSpeed = 0.0; this_00->_fallingAccel = -0.096; } while (local_3c < 7); return; } //@@ 007d4150 Entity_Player::GetMaxInventorySize /* ZHL [exact] __thiscall int Entity_Player::GetMaxInventorySize(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Entity_Player::GetMaxInventorySize(Entity_Player *this) { byte bVar1; bVar1 = HasCollectible(this,0x26b,0); return (uint)(bVar1 != 0) * 4 + 8; } //@@ 007d4170 Entity_Player::CanAddCollectibleToInventory /* ZHL [exact] __thiscall bool Entity_Player::CanAddCollectibleToInventory(int id); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::CanAddCollectibleToInventory(Entity_Player *this,int id) { byte bVar1; ItemConfig_Item *this_00; this_00 = ItemConfig::GetCollectible(&g_manager->_itemConfig,id); if ((((this_00 != (ItemConfig_Item *)0x0) && (this_00->type != 3)) && (id != 0x290)) && (id != 0x26b)) { bVar1 = Item::HasTags(this_00,0x8000); if (bVar1 == 0) { return 1; } } return 0; } //@@ 007d41d0 Entity_Player::SetPocketActiveItem /* ZHL [exact] __thiscall void Entity_Player::SetPocketActiveItem(int collectible, int slot, bool keepInPools); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Entity_Player::SetPocketActiveItem(Entity_Player *this,int collectible,int slot,byte keepInPools) { uint *puVar1; Game *pGVar2; ItemConfig_Item *pIVar3; uint uVar4; int *piVar5; int *piVar6; int *piVar7; uint local_10; if (slot - 2U < 2) { piVar5 = this->_pocketSlots; local_10 = 0; do { if ((piVar5[1] == 2) && (*piVar5 == slot + 1)) { uVar4 = this->_activeDesc[*piVar5 + -1]._item; if (uVar4 != 0) { RemoveCollectible(this,uVar4,1,slot,1); } if (local_10 < 3) { piVar6 = piVar5 + 2; piVar7 = piVar5; for (uVar4 = (3 - local_10) * 2 & 0x3ffffffe; uVar4 != 0; uVar4 = uVar4 - 1) { *piVar7 = *piVar6; piVar6 = piVar6 + 1; piVar7 = piVar7 + 1; } } this->_pocketSlots[6] = 0; this->_pocketSlots[7] = 1; } local_10 = local_10 + 1; piVar5 = piVar5 + 2; } while (local_10 < 4); if ((collectible != 0) && (pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectible), pIVar3 != (ItemConfig_Item *)0x0)) { AddPocketItem(this,slot + 1,2); AddCollectible(this,collectible,-1,1,slot,0,0); pGVar2 = g_game; if ((keepInPools == 0) && ((-1 < collectible && (g_game->_challenge != 0x2b)))) { if (collectible == 0x1e4) { ItemPool::RemoveCollectible(&g_game->_itemPool,0x126,0,0); } if ((uint)collectible < (pGVar2->_itemPool)._removedCollectibles._size) { puVar1 = (uint *)((int)(pGVar2->_itemPool)._removedCollectibles._begin + ((uint)collectible >> 5) * 4); *puVar1 = *puVar1 | 1 << (collectible & 0x1fU); } } } } return; } //@@ 007d4320 FUN_007d4320 char FUN_007d4320(void) { byte bVar1; Entity_Player *in_ECX; bVar1 = Entity_Player::HasCollectible(in_ECX,0x26b,0); return (bVar1 != 0) * '\x02' + '\x04'; } //@@ 007d4340 FUN_007d4340 void FUN_007d4340(void) { int in_ECX; if (*(char *)(in_ECX + 0x1519) == '\0') { TemporaryEffects::GetCollectibleEffect((TemporaryEffects *)(in_ECX + 0x1508),0x2b8); } return; } //@@ 007d4390 Entity_Player::update_suplex /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strs LeapUp/LeapDown/SuperLeapUp/SuperLeapDown/HideItem; uses _suplexState (0x1f2c here, zhl 0x1f1c), ThrowHeldEntity, MakeShockwave, BombDamage, Book of Virtues (0x248) AddWisp; called from player update 0x782af0 */ void __thiscall Entity_Player::update_suplex(Entity_Player *this) { EntityPtr EVar1; byte bVar2; uint uVar3; char *animName; undefined1 **ppuVar4; std_string *curAnimChars; uint uVar5; Entity *effect; uint rngResult; int iVar6; Entity_Familiar *wisp; float *targetPos; void *pvVar7; int iVar8; int *piVar9; AnimationState *animState; float fVar10; float fVar11; float markedPosX; Entity *local_7c8; undefined1 *local_7c4; undefined1 *bombRadius; EntityPtr local_7bc; undefined1 *local_7b8; undefined1 *local_7b4; byte isSuperLeap; Entity_Player *local_7ac; NPCAI_Pathfinder pathfinder; void *local_60 [2]; undefined4 local_58; EntityRef EStack_54; void *curAnim [2]; undefined1 local_24 [12]; int *local_18; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; uint *animNameSize; Manager *manager; Vector *playerPos; Room *room; int *suplexWisp; code *takeDamageFn; local_8 = 0xffffffff; puStack_c = &LAB_00b00308; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; local_7bc = (EntityPtr)this; iVar6 = this->_suplexState; if (((iVar6 != 0) && (1 < iVar6)) && (this->_entityCollisionClass = 0, 2 < iVar6)) { this->_entityGridCollisionClass = 0; } pvVar7 = this->_heldEntity; if ((((pvVar7 != (void *)0x0) && (*(int *)((int)pvVar7 + 0x28) == 4)) && ((iVar6 == 2 || ((iVar6 == 3 || (iVar6 == 4)))))) && (*(int *)((int)pvVar7 + 0x410) < 2)) { *(undefined4 *)((int)pvVar7 + 0x410) = 10; *(undefined4 *)((int)pvVar7 + 0x414) = 10; iVar6 = this->_suplexState; } stackCookie = uVar3; if (0 < this->_suplexAimCountdown) { iVar8 = this->_suplexAimCountdown + ((int)this->_updateTime - (int)this->_prevUpdateTime) * -2; this->_suplexAimCountdown = iVar8; if (iVar6 == 5) { this->_suplexAimCountdown = 0; LAB_007d44b8: if (this->_heldEntity == (void *)0x0) { this->_cacheFlags = this->_cacheFlags | 0x80; this->_suplexState = 0; this->_entityCollisionClass = 4; EvaluateItems(uVar3); this->_blinkTime = 1; this->_itemStateCooldown = 5; PlayExtraAnimation(this,(byte *)"HideItem"); } else { pvVar7 = this->_markedTarget; targetPos = &markedPosX; if (pvVar7 == (void *)0x0) { local_24._8_4_ = (this->_pos).x; local_18 = (int *)(this->_pos).y; targetPos = (float *)(local_24 + 8); } else { markedPosX = *(float *)((int)pvVar7 + 0x33c); local_7c8 = *(Entity **)((int)pvVar7 + 0x340); } (this->_suplexTargetPos).x = *targetPos; (this->_suplexTargetPos).y = targetPos[1]; (this->_suplexLandPos).x = (this->_pos).x; (this->_suplexLandPos).y = (this->_pos).y; animName = "SuperLeapUp"; if (this->_suplexState != 5) { animName = "LeapUp"; } PlayExtraAnimation(this,(byte *)animName); manager = g_manager; this->_suplexState = 3; local_7ac = (Entity_Player *)0x408; seed_fart_sound_override((int *)&local_7ac); SoundEffects::Play(&manager->_sfxManager,(int)local_7ac,1.0,2,0,1.0,0.0); bVar2 = HasCollectible(this,0x248,0); if (bVar2 != 0) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_24,3,0xce, 0x2c5,0,0); piVar9 = (int *)0x0; local_8 = 0; if (local_18 != (int *)0x0) { pvVar7 = (void *)local_24._4_4_; do { suplexWisp = *(int **)((int)pvVar7 + (int)piVar9 * 4); if ((Entity_Player *)suplexWisp[0x104] == this) { EStack_54._position.x = g_vectorZero.x; EStack_54._velocity.x = g_vectorZero.x; EStack_54._position.y = g_vectorZero.y; EStack_54._velocity.y = g_vectorZero.y; EStack_54._type = 0; EStack_54._variant = 0; EStack_54._spawnerType = 0; EStack_54._spawnerVariant = 0; EStack_54._flags = 0; EStack_54._entity = (void *)0x0; (**(code **)(*suplexWisp + 0x24))(&EStack_54); pvVar7 = (void *)local_24._4_4_; } piVar9 = (int *)((int)piVar9 + 1); } while (piVar9 < local_18); } local_8 = 0xffffffff; if (local_24[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_24._4_4_,0); local_8 = 0xffffffff; } } } } else if (iVar8 < 1) { this->_suplexAimCountdown = 0; if (iVar6 == 1) { this->_cacheFlags = this->_cacheFlags | 0x80; this->_suplexState = 0; this->_entityCollisionClass = 4; EvaluateItems(uVar3); } else if (iVar6 == 2) goto LAB_007d44b8; } } if (this->_suplexState == 3) { if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { ExceptionList = local_10; return; } this->_suplexState = 4; Teleport(this,&this->_suplexTargetPos,0,0); pvVar7 = this->_heldEntity; if (pvVar7 != (void *)0x0) { *(float *)((int)pvVar7 + 0x33c) = (this->_suplexTargetPos).x; *(float *)((int)pvVar7 + 0x340) = (this->_suplexTargetPos).y; } curAnimChars = ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState,(std_string *)curAnim); animNameSize = &curAnimChars->_size; if (0xf < curAnimChars->_capacity) { curAnimChars = *(std_string **)curAnimChars->_buf; } isSuperLeap = str_eq((byte *)curAnimChars,*animNameSize,(byte *)"SuperLeapUp",0xb); if (&DAT_0000000f < local_18) { piVar9 = (int *)((int)local_18 + 1); pvVar7 = curAnim[0]; if ((int *)0xfff < piVar9) { pvVar7 = *(void **)((int)curAnim[0] + -4); piVar9 = local_18 + 9; if (0x1f < (uint)((int)curAnim[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,(uint)piVar9); } if (isSuperLeap == 0) { animName = "LeapDown"; } else { animName = "SuperLeapDown"; } PlayExtraAnimation(this,(byte *)animName); ExceptionList = local_10; return; } if (this->_suplexState != 4) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._animData != (void *)0x0) { bVar2 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b1d534); manager = g_manager; if (bVar2 != 0) { fVar10 = (this->_playerSpriteScale).x; if (*(int *)&g_game->_deathmatchManager < 2) { local_7b4 = (undefined1 *)0x42200000; local_7b8 = (undefined1 *)(fVar10 * 50.0); ppuVar4 = &local_7b8; if ((float)local_7b8 <= 40.0) { ppuVar4 = &local_7b4; } bombRadius = *ppuVar4; } else { bombRadius = (undefined1 *)0x41c80000; } local_7b4 = (undefined1 *)(fVar10 * 25.0); local_7c4 = (undefined1 *)0x41a00000; local_7ac = (Entity_Player *)0x409; ppuVar4 = &local_7b4; if ((float)local_7b4 <= 20.0) { ppuVar4 = &local_7c4; } local_7b8 = *ppuVar4; seed_fart_sound_override((int *)&local_7ac); SoundEffects::Play(&manager->_sfxManager,(int)local_7ac,1.0,2,0,1.0,0.0); curAnimChars = ANM2::GetAnimation((ANM2 *)((int)local_7bc + 0x78),(std_string *)curAnim); animNameSize = &curAnimChars->_size; if (0xf < curAnimChars->_capacity) { curAnimChars = *(std_string **)curAnimChars->_buf; } isSuperLeap = str_eq((byte *)curAnimChars,*animNameSize,(byte *)"SuperLeapDown",0xd); if (&DAT_0000000f < local_18) { piVar9 = (int *)((int)local_18 + 1); pvVar7 = curAnim[0]; if ((int *)0xfff < piVar9) { pvVar7 = *(void **)((int)curAnim[0] + -4); piVar9 = local_18 + 9; if (0x1f < (uint)((int)curAnim[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,(uint)piVar9); } manager = g_manager; local_24._8_4_ = 0.0; local_18 = (int *)0xf; curAnim[0] = (void *)((uint)curAnim[0] & 0xffffff00); if (isSuperLeap == 0) { Game::ShakeScreen(g_game,0xe); manager = g_manager; local_7b4 = (undefined1 *)0x34; seed_fart_sound_override((int *)&local_7b4); SoundEffects::Play(&manager->_sfxManager,(int)local_7b4,1.0,2,0,1.0,0.0); this = (Entity_Player *)local_7bc; Game::MakeShockwave(g_game,(Vector *)((int)local_7bc + 0x33c),0.04,0.025,0xd); local_7b4 = (undefined1 *)0x428c0000; local_7c4 = (undefined1 *)(*(float *)((int)this + 0x14f0) * 40.0 + 50.0); ppuVar4 = &local_7c4; if ((float)local_7c4 <= 70.0) { ppuVar4 = &local_7b4; } local_18 = (int *)((float)*ppuVar4 / 9.0); uVar5 = Random(); local_7c8 = Game::Spawn(g_game,1000,0x3d,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)this,0,uVar5); local_7bc = (EntityPtr)&local_7c8->_parent; if (local_7c8->_parent != (EntityPtr)0x0) { local_7ac = (Entity_Player *)local_7bc; std::multiset::erase(&local_7ac); } *(Entity_Player **)local_7bc = this; std::multiset::insert(local_7bc); *(undefined4 *)local_7c8[1]._sprite._filename._buf = *(undefined4 *)((int)this + 0x370); *(undefined1 **)(local_7c8[1]._sprite._filename._buf + 4) = *ppuVar4; *(int *)(local_7c8[1]._sprite._filename._buf + 8) = (int)(float)local_18; *(int *)(local_7c8[1]._sprite._filename._buf + 0xc) = (int)(float)local_18; } else { bombRadius = (undefined1 *)((float)bombRadius * 6.0); local_7ac = (Entity_Player *)0x34; local_7b8 = (undefined1 *)((float)*ppuVar4 + (float)*ppuVar4); seed_fart_sound_override((int *)&local_7ac); SoundEffects::Play(&manager->_sfxManager,(int)local_7ac,1.0,2,0,1.0,0.0); uVar5 = Random(); EVar1 = local_7bc; playerPos = (Vector *)((int)local_7bc + 0x33c); effect = Game::Spawn(g_game,1000,0x7f,playerPos,&g_vectorZero,(Entity *)local_7bc,0,uVar5); fVar10 = *(float *)((int)EVar1 + 0x340); iVar6 = *(int *)effect; (effect->_targetPosition).x = playerPos->x; (effect->_targetPosition).y = fVar10; (**(code **)(iVar6 + 0xc))(); uVar5 = Random(); effect = Game::Spawn(g_game,1000,0x12,playerPos,&g_vectorZero,(Entity *)0x0,0,uVar5); fVar10 = g_vectorOne.y * 2.0; iVar6 = *(int *)effect; (effect->_sprite)._scale.x = g_vectorOne.x * 2.0; (effect->_sprite)._scale.y = fVar10; (**(code **)(iVar6 + 0xc))(); uVar5 = 0; do { rngResult = Random(); local_7c4 = (undefined1 *) ((((((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) + (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10) - 0.5) * 360.0) / 15.0) * 0.017453292); local_7ac = (Entity_Player *)sin((float)local_7c4); rngResult = Random(); local_7b4 = (undefined1 *) ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 5.0 + 15.0); local_24._8_4_ = cos((float)local_7c4); local_24._8_4_ = (float)local_24._8_4_ * (float)local_7b4; local_18 = (int *)((float)local_7b4 * (float)local_7ac * 0.85); rngResult = Random(); local_7ac = (Entity_Player *) Game::Spawn(g_game,1000,0x3b,playerPos,(Vector *)(local_24 + 8),(Entity *)0x0, 0,rngResult); rngResult = Random(); if ((rngResult & 1) == 0) { local_7b4 = &DAT_bf800000; } else { local_7b4 = (undefined1 *)0x3f800000; } rngResult = Random(); (local_7ac->_bodySprite)._overlayAnimState._layerFrames = (void *)(((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_7b4); rngResult = Random(); fVar11 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.6 + 1.0; fVar10 = fVar11 * g_vectorOne.x; (local_7ac->_sprite)._scale.y = fVar11 * g_vectorOne.y; (local_7ac->_sprite)._scale.x = fVar10; rngResult = Random(); EStack_54._velocity.y = 0.0; EStack_54._flags = 0; fVar10 = (float)(rngResult % 0x28 + 0x28); EStack_54._entity = (void *)0x0; EStack_54._spawnerVariant = 0; EStack_54._position.x = 0.0; EStack_54._position.y = 0.0; EStack_54._velocity.x = 0.0; iVar6 = *(int *)local_7ac; (local_7ac->_bodySprite)._animState._animFrame = fVar10; *(float *)&(local_7ac->_bodySprite)._animState._isPlaying = fVar10; local_58 = 0x3ee66666; EStack_54._type = 0x3ee66666; EStack_54._variant = 0x3eeb851f; EStack_54._spawnerType = 0x3f400000; (**(code **)(iVar6 + 0x3c))(); uVar5 = uVar5 + 1; } while (uVar5 < 0xf); uVar5 = Random(); this = (Entity_Player *)local_7bc; effect = Game::Spawn(g_game,1000,0x10,playerPos,&g_vectorZero,(Entity *)local_7bc,1,uVar5); fVar10 = g_vectorOne.y * 2.0; (effect->_sprite)._scale.x = g_vectorOne.x * 2.0; (effect->_sprite)._scale.y = fVar10; uVar5 = Random(); (effect->_sprite)._flipX = ((byte)uVar5 ^ 0xff) & 1; (**(code **)(*(int *)effect + 0xc))(); } local_18 = *(int **)((int)this + 0x1410); if (local_18 != (int *)0x0) { takeDamageFn = *(code **)(*local_18 + 0x20); EntityRef::constructor(&EStack_54,(Entity *)this); (*takeDamageFn)(); iVar6 = *(int *)((int)this + 0x1410); if (*(int *)(iVar6 + 0x28) == 4) { *(undefined4 *)(iVar6 + 0x410) = 0; *(undefined4 *)(iVar6 + 0x414) = 0; (**(code **)(**(int **)((int)this + 0x1410) + 0xc))(); } } playerPos = (Vector *)((int)this + 0x33c); Game::BombDamage(g_game,playerPos,(float)bombRadius,(float)local_7b8,0,(Entity *)this, g_tearFlagsNone,0x1000000,0); room = g_game->_room; iVar8 = (int)((playerPos->x - 40.0) / 40.0 + 0.5); iVar6 = (int)((*(float *)((int)this + 0x340) - 120.0) / 40.0 + 0.5); if ((((iVar8 < 0) || (room->_gridWidth <= iVar8)) || (iVar6 < 0)) || (room->_gridHeight <= iVar6)) { iVar8 = -1; } else { iVar8 = iVar6 * room->_gridWidth + iVar8; } uVar5 = Room::GetGridCollision(room,iVar8); if ((uVar5 == 0) || ((*(char *)((int)this + 0x1570) != '\0' && ((int)uVar5 < 4)))) { PathFinder::Init((PathFinder *)&pathfinder,(Entity *)this); local_8 = 2; bVar2 = NPCAI_Pathfinder::HasPathToPos(&pathfinder,(Vector *)((int)this + 0x1f3c),0); if (bVar2 != 0) { *(float *)((int)this + 0x1f3c) = playerPos->x; *(undefined4 *)((int)this + 8000) = *(undefined4 *)((int)this + 0x340); } local_8 = 0xffffffff; FID_conflict__Erase_tree_>_> (local_60,(fuzzer_allocator_> *)local_60, *(_Tree_node **)((int)local_60[0] + 4)); operator_delete(local_60[0],0x14); } bVar2 = HasCollectible(this,0x248,0); if (bVar2 != 0) { local_7b8 = (undefined1 *)0x3; do { wisp = AddWisp(this,0x2c5,playerPos,0,1); if (wisp != (Entity_Familiar *)0x0) { fVar10 = *(float *)((int)this + 0x340); (wisp->_targetPosition).x = playerPos->x; (wisp->_targetPosition).y = fVar10; } local_7b8 = local_7b8 + -1; } while (local_7b8 != (undefined1 *)0x0); } } if (*(int *)((int)this + 0x7c) != 0) { animState = (AnimationState *)((int)this + 0x78); bVar2 = AnimationState::IsEventTriggered(animState,&DAT_00b1d3b0); if (bVar2 != 0) { ThrowHeldEntity(this,&g_vectorZero); } goto LAB_007d4fc6; } } animState = (AnimationState *)((int)this + 0x78); LAB_007d4fc6: if (*(int *)((int)this + 0x7c) != 0) { bVar2 = AnimationState::WasEventTriggered(animState,&DAT_00b1d3b0); if (bVar2 != 0) { *(float *)((int)this + 0x360) = (*(float *)((int)this + 0x1f3c) - *(float *)((int)this + 0x33c)) * 0.3; *(float *)((int)this + 0x364) = (*(float *)((int)this + 8000) - *(float *)((int)this + 0x340)) * 0.3; } if ((*(int *)((int)this + 0x7c) != 0) && (*(char *)((int)this + 0x8c) != '\0')) { ExceptionList = local_10; return; } } *(undefined4 *)((int)this + 0x1f2c) = 0; *(undefined4 *)((int)this + 0x1338) = 1; *(undefined4 *)((int)this + 0x1604) = 5; iVar6 = *(int *)((int)this + 0x13bc); *(undefined4 *)((int)this + 0x188) = 4; if (iVar6 < 0xf) { iVar6 = 0xf; } *(uint *)((int)this + 0x1574) = *(uint *)((int)this + 0x1574) | 0x80; *(int *)((int)this + 0x13bc) = iVar6; EvaluateItems(uVar3); ExceptionList = local_10; return; } //@@ 007d5170 Entity_Player::bag_of_crafting_collect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: salvage c5_bag.c; str Collect */ uint Entity_Player::bag_of_crafting_collect(Entity_Pickup *param_1) { int iVar1; float fVar2; Entity *pEVar3; byte bVar4; uint uVar5; undefined3 extraout_var; byte *animName; uint *craftingOutput; HUD *playerHud; Entity_Player *in_ECX; char *collectAnimName; Entity_Pickup *extraout_ECX; Entity_Pickup *pickup; uint uVar6; int iVar7; bool isLess; Entity *local_50; Entity_Pickup *collectedPickup; ColorMod poofColor; undefined1 local_1c [12]; float local_10; uint local_c; undefined1 auStack_8 [4]; bool isCoinUpgraded; Manager *manager; local_c = __security_cookie ^ (uint)(auStack_8 + 4); collectedPickup = param_1; uVar5 = param_1->_variant; if ((((uVar5 == 10) || (uVar5 == 0x14)) || (uVar5 == 0x5a)) || (((uVar5 == 0x28 || (uVar5 == 0x1e)) || ((uVar5 == 0x46 || (uVar5 == 300)))))) { if ((uVar5 == 0x45) || (uVar5 == 0x29)) goto switchD_007d5299_caseD_4; } else if ((uVar5 == 0x15e) || (((uVar5 == 0x45 || (uVar5 == 0x29)) || (uVar5 != 0x2a)))) goto switchD_007d5299_caseD_4; if ((param_1->_price != 0) && (uVar5 = Entity_Pickup::can_player_buy(param_1,in_ECX), (char)uVar5 == '\0')) goto switchD_007d5299_caseD_4; iVar1 = param_1->_variant; iVar7 = param_1->_subtype; local_50 = (Entity *)0x0; isCoinUpgraded = false; bVar4 = HasCollectible(in_ECX,0x3b,0); pickup = collectedPickup; uVar5 = CONCAT31(extraout_var,bVar4); if ((bVar4 == 0) || (iVar1 != 10)) { if (iVar1 < 0x2b) { if (iVar1 != 0x2a) goto LAB_007d5282; } else if (iVar1 != 0x46) { if (iVar1 == 0x5a) { if ((iVar7 == 1) || (iVar7 == 3)) goto LAB_007d54dd; } else { if (iVar1 != 300) goto switchD_007d5299_caseD_4; if (iVar7 == 0x31) goto LAB_007d54dd; if (iVar7 != 0x4e) { ItemConfig::GetCard(&g_manager->_itemConfig,collectedPickup->_subtype); } } goto LAB_007d54e0; } goto LAB_007d54dd; } if (((iVar7 == 2) || (iVar7 == 1)) || (iVar7 == 5)) { local_1c._4_4_ = 1; local_1c._8_4_ = 0x13; local_1c._0_4_ = collectedPickup->_initSeed; local_10 = 4.2039e-45; uVar5 = RNG::RandomInt((RNG *)local_1c,8); if (uVar5 != 0) goto LAB_007d5282; iVar7 = 6; isCoinUpgraded = true; } else { LAB_007d5282: isCoinUpgraded = false; if (0x1e < iVar1 - 10U) goto switchD_007d5299_caseD_4; } uVar5 = 0; pickup = collectedPickup; /* WARNING (jumptable): Sanity check requires truncation of jumptable */ /* WARNING: Could not find normalized switch variable to match jumptable */ switch(*(undefined1 *)((int)&PTR_caseD_2_007d587c + iVar1 + 2)) { case 0: switch(iVar7) { case 3: case 8: break; case 4: break; case 5: local_50 = (Entity *)0x1; break; case 6: break; case 7: break; default: break; case 10: local_50 = (Entity *)0x1; break; case 0xb: break; case 0xc: } break; case 1: switch(iVar7) { case 2: break; case 3: break; case 4: local_50 = (Entity *)0x8; break; case 5: break; case 6: goto switchD_007d5299_caseD_4; case 7: break; default: } break; case 2: if (iVar7 == 2) break; if (iVar7 == 3) { local_50 = (Entity *)0xc; break; } goto LAB_007d54e0; case 3: if (iVar7 == 2) { local_50 = (Entity *)0xf; } else if (iVar7 != 4) goto LAB_007d54e0; break; case 4: switchD_007d5299_caseD_4: return uVar5 & 0xffffff00; } LAB_007d54dd: pickup = collectedPickup; LAB_007d54e0: uVar6 = 0; uVar5 = 0; do { if (in_ECX->_bagOfCraftingContent[uVar5] == 0) break; uVar5 = uVar5 + 1; uVar6 = uVar6 + 1; } while (uVar5 < 8); uVar5 = 0; do { fVar2 = poofColor._tint[uVar5 - 3]; if (fVar2 != 0.0) { if (7 < uVar6) { uVar6 = 7; in_ECX->_bagOfCraftingContent[0] = in_ECX->_bagOfCraftingContent[1]; in_ECX->_bagOfCraftingContent[1] = in_ECX->_bagOfCraftingContent[2]; in_ECX->_bagOfCraftingContent[2] = in_ECX->_bagOfCraftingContent[3]; in_ECX->_bagOfCraftingContent[3] = in_ECX->_bagOfCraftingContent[4]; in_ECX->_bagOfCraftingContent[4] = in_ECX->_bagOfCraftingContent[5]; in_ECX->_bagOfCraftingContent[5] = in_ECX->_bagOfCraftingContent[6]; in_ECX->_bagOfCraftingContent[6] = in_ECX->_bagOfCraftingContent[7]; in_ECX->_bagOfCraftingContent[7] = 0; } in_ECX->_bagOfCraftingContent[uVar6] = SUB41(fVar2,0); uVar6 = uVar6 + 1; } uVar5 = uVar5 + 1; } while (uVar5 < 2); uVar5 = Random(); local_10 = (pickup->_pos).y; local_1c._8_4_ = (pickup->_pos).x; local_50 = Game::Spawn(g_game,1000,0xf,(Vector *)(local_1c + 8),&g_vectorZero,(Entity *)0x0,1, uVar5); if (isCoinUpgraded) { poofColor._offset[0] = 0.0; poofColor._colorize[0] = 0.0; poofColor._colorize[1] = 0.0; poofColor._colorize[2] = 0.0; poofColor._colorize[3] = 0.0; poofColor._offset[1] = 0.0; poofColor._offset[2] = 0.0; poofColor._tint[0] = 0.12; poofColor._tint[1] = 0.12; poofColor._tint[2] = 0.12; poofColor._tint[3] = 1.0; (**(code **)(*(int *)local_50 + 0x3c))(&poofColor,0xffffffff,0xff,0,1); } (**(code **)(*(int *)local_50 + 0xc))(); Entity_Pickup::RemoveOtherOptions(); local_50 = (Entity *)&pickup->_sprite; (pickup->_velocity).x = g_vectorZero.x; (pickup->_velocity).y = g_vectorZero.y; pickup->_entityCollisionClass = 0; pickup->_entityGridCollisionClass = 3; animName = (pickup->_sprite)._animState._animData; if (animName == (byte *)0x0) { LAB_007d5690: bVar4 = ANM2::SetAnimation(&pickup->_sprite,(byte *)"Collect",1); pEVar3 = local_50; if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)&local_50->_subtype); pEVar3->field_0x44 = 1; pickup = collectedPickup; } } else { if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } collectAnimName = "Collect"; do { bVar4 = *animName; isLess = bVar4 < (byte)*collectAnimName; if (bVar4 != *collectAnimName) { LAB_007d5670: uVar5 = -(uint)isLess | 1; goto LAB_007d5675; } if (bVar4 == 0) break; bVar4 = animName[1]; isLess = bVar4 < (byte)collectAnimName[1]; if (bVar4 != collectAnimName[1]) goto LAB_007d5670; animName = animName + 2; collectAnimName = collectAnimName + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007d5675: if ((uVar5 != 0) || ((*(char *)((int)(pickup->_sprite)._animState._animData + 0x34) != '\0' && ((pickup->_sprite)._animState._isPlaying == 0)))) goto LAB_007d5690; } local_50 = (Entity *)0xf9; pickup->_dead = 1; manager = g_manager; if (isCoinUpgraded) { local_50 = (Entity *)0x13c; } seed_fart_sound_override((int *)&local_50); SoundEffects::Play(&manager->_sfxManager,(int)local_50,1.0,2,0,1.0,0.0); pickup = collectedPickup; if (collectedPickup->_price != 0) { Entity_Pickup::CollectTrinket(collectedPickup,in_ECX,0); pickup = extraout_ECX; } if (uVar6 < 8) { playerHud = &g_game->_hud; in_ECX->_bagOfCraftingOutput = 0; *(undefined4 *)&in_ECX->field_0x1f50 = 0xffffffff; if (in_ECX == (Entity_Player *)0x0) goto LAB_007d57e0; uVar5 = 0; while (*(Entity_Player **)playerHud->_playerHUD != in_ECX) { uVar5 = uVar5 + 1; playerHud = (HUD *)(playerHud->_playerHUD + 0x6dc); if (7 < uVar5) { return CONCAT31((int3)((uint)playerHud >> 8),1); } } } else { craftingOutput = CalculateBagOfCraftingOutput ((uint *)(local_1c + 8),in_ECX->_bagOfCraftingContent,(byte)pickup); uVar5 = *craftingOutput; *(uint *)&in_ECX->field_0x1f50 = craftingOutput[1]; playerHud = &g_game->_hud; in_ECX->_bagOfCraftingOutput = uVar5; if (in_ECX == (Entity_Player *)0x0) { LAB_007d57e0: if (*(int *)playerHud->_playerHUD != 0) { playerHud->_playerHUD[0x6ad] = 1; } if (*(int *)(playerHud->_playerHUD + 0x6dc) != 0) { playerHud->_playerHUD[0xd89] = 1; } if (*(int *)(playerHud->_playerHUD + 0xdb8) != 0) { playerHud->_playerHUD[0x1465] = 1; } if (*(int *)(playerHud->_playerHUD + 0x1494) != 0) { playerHud->_playerHUD[0x1b41] = 1; } if (*(int *)(playerHud->_playerHUD + 0x1b70) != 0) { playerHud->_playerHUD[0x221d] = 1; } if (*(int *)(playerHud->_playerHUD + 0x224c) != 0) { playerHud->_playerHUD[0x28f9] = 1; } if (*(int *)(playerHud->_playerHUD + 0x2928) != 0) { playerHud->_playerHUD[0x2fd5] = 1; } if (*(int *)(playerHud->_playerHUD + 0x3004) != 0) { playerHud->_playerHUD[0x36b1] = 1; } return CONCAT31((int3)((uint)playerHud >> 8),1); } uVar5 = 0; while (*(Entity_Player **)playerHud->_playerHUD != in_ECX) { uVar5 = uVar5 + 1; playerHud = (HUD *)(playerHud->_playerHUD + 0x6dc); if (7 < uVar5) { return CONCAT31((int3)((uint)playerHud >> 8),1); } } } playerHud->_playerHUD[0x6ad] = 1; return CONCAT31((int3)((uint)playerHud >> 8),1); } //@@ 007d58f0 Entity_Player::tainted_cain_pedestal_burst /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: HandleCollision calls it for player type 0x17 on a free pedestal; spawns max(4,3+rand4) pickups by pool (characters-8) */ void __thiscall Entity_Player::tainted_cain_pedestal_burst(void) { void *pvVar1; code *pcVar2; RNG rng; byte bVar3; uint uVar4; Game *game; float *pickerEnd; byte bVar5; void *in_ECX; uint uVar6; uint uVar7; float *pickerCapacityEnd; WeightedOutcomePicker ptr; float *weightEntry; undefined4 *playerSlot; uint *trinketRng; float outcomeIndex; int iVar8; Entity_Player *tmpPlayer; Vector *in_stack_00000004; uint in_stack_0000000c; int in_stack_00000010; Vector *velocity; Vector bombVelocity; Vector keyVelocity; Vector heartVelocity; Vector coinVelocity; Vector pickupVelocity; uint pickupCountBefore; Vector local_a8; float local_a0; Entity_Player *local_9c; undefined8 rngShift12; Vector *position; undefined4 rngShift3; Game *local_80; uint pickupCount; uint local_78; char local_71; uint pickupTable [2]; float local_68; undefined4 local_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; uint pickupTrinkets [2]; WeightedOutcomePicker WStack_20; float *pfStack_1c; float *local_18; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; bool isUnlocked; Vector *spawnPosition; float weight; local_8 = 0xffffffff; puStack_c = &LAB_00b0034d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(pickupTrinkets + 9); ExceptionList = &local_10; position = in_stack_00000004; rngShift12 = 0x700000002; rngShift3 = 0x19; if (in_stack_0000000c == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = in_stack_0000000c >> 2 ^ in_stack_0000000c; uVar7 = uVar7 << 7 ^ uVar7; uVar7 = uVar7 >> 0x19 ^ uVar7; uVar4 = (uVar7 & 3) + 3; pickupCount = 4; if (4 < uVar4) { pickupCount = uVar4; } if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> 2 ^ uVar7; uVar7 = uVar7 << 7 ^ uVar7; uVar7 = uVar7 >> 0x19 ^ uVar7; local_9c = in_ECX; if ((uVar7 % 3 != 0) && (bVar3 = HasTrinket(in_ECX,0x2a,0), bVar3 != 0)) { pickupCount = pickupCount + 1; } pickupTrinkets[0] = 0x2d; pickupTrinkets[1] = 0x2c; WStack_20 = (WeightedOutcomePicker)0x22; pfStack_1c = (float *)0x29; local_18 = (float *)0x24; local_a0 = 0.0; LAB_007d5a10: uVar4 = pickupTrinkets[(int)local_a0]; local_80 = g_game; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2 <= (int)(uVar4 & 0x7fff)) || (iVar8 = *(int *)((int)pvVar1 + (uVar4 & 0x7fff) * 4), iVar8 == 0)) || (local_71 = '\x01', (*(uint *)(iVar8 + 0xb8) & 0x80000000) == 0)) { local_71 = '\0'; } playerSlot = (g_game->_playerManager)._playerList._begin; local_78 = uVar4; if (playerSlot != (g_game->_playerManager)._playerList._end) { game = g_game; do { tmpPlayer = (Entity_Player *)*playerSlot; if (tmpPlayer->_variant == 0) { bVar3 = HasTrinket(tmpPlayer,uVar4,0); if (bVar3 == 0) { if (((local_71 == '\0') || (tmpPlayer->_backupPlayer == (Entity_Player *)0x0)) || (bVar3 = HasTrinket(tmpPlayer->_backupPlayer,local_78,0), bVar3 == 0)) { game = local_80; uVar4 = local_78; goto LAB_007d5aae; } tmpPlayer = tmpPlayer->_backupPlayer; } if (tmpPlayer != (Entity_Player *)0x0) { if (local_78 != 0x22) goto LAB_007d5bde; local_80 = g_game; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2 < 0x17) || (iVar8 = *(int *)((int)pvVar1 + 0x58), iVar8 == 0)) || ((*(uint *)(iVar8 + 0xb8) & 0x80000000) == 0)) { local_71 = '\0'; } else { local_71 = '\x01'; } playerSlot = (g_game->_playerManager)._playerList._begin; if (playerSlot == (g_game->_playerManager)._playerList._end) goto LAB_007d5bde; goto LAB_007d5b33; } break; } LAB_007d5aae: playerSlot = playerSlot + 1; } while (playerSlot != (game->_playerManager)._playerList._end); } goto LAB_007d5c4e; LAB_007d5b33: do { tmpPlayer = (Entity_Player *)*playerSlot; if (tmpPlayer->_variant == 0) { bVar3 = HasTrinket(tmpPlayer,0x16,0); if (bVar3 == 0) { if (((local_71 == '\0') || (tmpPlayer->_backupPlayer == (Entity_Player *)0x0)) || (bVar3 = HasTrinket(tmpPlayer->_backupPlayer,0x16,0), bVar3 == 0)) goto LAB_007d5b66; tmpPlayer = tmpPlayer->_backupPlayer; } if (tmpPlayer != (Entity_Player *)0x0) { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; if (uVar7 != (uVar7 / 5) * 5) goto LAB_007d5c4e; } break; } LAB_007d5b66: playerSlot = playerSlot + 1; } while (playerSlot != (local_80->_playerManager)._playerList._end); LAB_007d5bde: uVar6 = local_78; iVar8 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,local_78); uVar4 = 0x21; if (iVar8 == 2) { uVar4 = 0x42; } else if (2 < iVar8) { uVar4 = 100; } if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; if (uVar7 % 100 < uVar4) { uVar4 = 10; switch(uVar6) { case 0x24: uVar4 = 0x1e; break; case 0x29: uVar4 = 0x28; break; case 0x2c: uVar4 = 0x46; break; case 0x2d: uVar4 = 300; } Isaac::GetRandomPickupVelocity(&local_a8,position,0,(RNG *)0x0); trinketRng = (uint *)(uVar6 * 0x10 + (int)(local_9c->_trinketRNGs)._begin); uVar6 = *trinketRng; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *trinketRng; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; uVar6 = uVar6 >> ((byte)trinketRng[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)trinketRng[2] & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)trinketRng[3] & 0x1f) ^ uVar6; *trinketRng = uVar6; Game::Spawn(game,5,uVar4,position,&local_a8,(Entity *)0x0,0,uVar6); goto LAB_007d5d1e; } LAB_007d5c4e: local_a0 = (float)((int)local_a0 + 1); if (4 < (uint)local_a0) goto LAB_007d5d1e; goto LAB_007d5a10; LAB_007d5d1e: tmpPlayer = local_9c; bVar3 = HasCollectible(local_9c,0x26b,0); if ((bVar3 != 0) && (tmpPlayer->_playerType == 0x17)) { pickupCount = pickupCount * 2; } local_80 = (Game *)0x0; if (pickupCount != 0) { do { pickupCountBefore = pickupCount; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; bVar3 = (byte)((ulonglong)rngShift12 >> 0x20); uVar7 = uVar7 << (bVar3 & 0x1f) ^ uVar7; bVar5 = (byte)rngShift3; uVar7 = uVar7 >> (bVar5 & 0x1f) ^ uVar7; local_a0 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10; if (local_80 != (Game *)0x0) goto LAB_007d6248; if (in_stack_00000010 == -1) { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << (bVar3 & 0x1f) ^ uVar7; uVar7 = uVar7 >> (bVar5 & 0x1f) ^ uVar7; in_stack_00000010 = ItemPool::GetPoolForRoom(&g_game->_itemPool,*(uint *)((int)g_game->_room + 8),uVar7); } tmpPlayer = local_9c; switch(in_stack_00000010) { case 3: case 0x13: uVar4 = 10; local_78 = 6; break; case 4: case 0x14: uVar4 = 10; local_78 = 4; break; case 5: case 0x16: if (((g_manager->_persistentGameData)._achievements[0x187] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { isUnlocked = false; } else { isUnlocked = true; } uVar4 = 10; local_78 = 0xb; if (!isUnlocked) { uVar4 = 0; local_78 = 0; } goto LAB_007d61d0; default: pickupTable[0] = 10; pickupTable[1] = 3; bVar3 = HasTrinket(local_9c,0x16,0); if (bVar3 == 0) { LAB_007d6039: local_68 = 1.4013e-44; } else { pvVar1 = (tmpPlayer->_trinketRNGs)._begin; trinketRng = (uint *)((int)pvVar1 + 0x160); uVar4 = *trinketRng; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *trinketRng; if (uVar4 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x164) & 0x1f) ^ uVar4; local_68 = 0.0; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar1 + 0x168) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x16c) & 0x1f) ^ uVar4; *trinketRng = uVar4; if (uVar4 % 5 == 0) goto LAB_007d6039; } local_64 = 0x14; uStack_60 = 2; uStack_5c = 10; uStack_58 = 0x14; local_44 = 1; local_54 = 3; uStack_50 = 5; uStack_4c = 0x1e; uStack_48 = 2; local_40 = 0x28; local_3c = 4; if (((g_manager->_persistentGameData)._achievements[0xe2] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { local_38 = 0; } else { local_38 = 1; } pickerCapacityEnd = (float *)0x0; pickerEnd = (float *)0x0; local_34 = 0; local_30 = 0; local_2c = 0x1e; WStack_20 = (WeightedOutcomePicker)0x0; pfStack_1c = (float *)0x0; local_18 = (float *)0x0; local_8 = 0; weightEntry = &local_68; outcomeIndex = 0.0; do { weight = *weightEntry; if (0 < (int)weight) { local_a8.x = outcomeIndex; local_a8.y = weight; if (pickerEnd == pickerCapacityEnd) { std::vector<8byte>::_Emplace_reallocate(pickerEnd,&local_a8); pickerEnd = pfStack_1c; pickerCapacityEnd = local_18; } else { *pickerEnd = outcomeIndex; pickerEnd[1] = weight; pfStack_1c = pickerEnd + 2; pickerEnd = pickerEnd + 2; } } outcomeIndex = (float)((int)outcomeIndex + 1); weightEntry = weightEntry + 3; } while ((uint)outcomeIndex < 6); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; rng._shift1 = 5; rng._seed = uVar7; rng._shift2 = 9; rng._shift3 = 7; uVar4 = WeightedOutcomePicker::PickOutcome(&WStack_20,rng); local_78 = pickupTable[uVar4 * 3 + 1]; uVar4 = pickupTable[uVar4 * 3]; local_8 = 0xffffffff; if (WStack_20 != (WeightedOutcomePicker)0x0) { uVar6 = (int)local_18 - (int)WStack_20 & 0xfffffff8; ptr = WStack_20; if (0xfff < uVar6) { ptr = *(WeightedOutcomePicker *)((int)WStack_20 + -4); uVar6 = uVar6 + 0x23; if (0x1f < ((int)WStack_20 - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar6); WStack_20 = (WeightedOutcomePicker)0x0; pfStack_1c = (float *)0x0; local_18 = (float *)0x0; } goto LAB_007d61d0; case 9: if (((g_manager->_persistentGameData)._achievements[0x19f] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { isUnlocked = false; } else { isUnlocked = true; } uVar4 = 300; local_78 = 0x4e; if (!isUnlocked) { uVar4 = 0; local_78 = 0; } goto LAB_007d61d0; case 0xc: case 0x15: if (((g_manager->_persistentGameData)._achievements[0x19b] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { isUnlocked = false; } else { isUnlocked = true; } uVar4 = 10; local_78 = 0xc; if (!isUnlocked) { uVar4 = 0; local_78 = 0; } LAB_007d61d0: if (uVar4 != 0) break; LAB_007d6248: spawnPosition = position; tmpPlayer = local_9c; if (0.35 <= local_a0) { if (local_a0 < 0.55) { bVar3 = HasTrinket(local_9c,0x16,0); if (bVar3 != 0) { pvVar1 = (tmpPlayer->_trinketRNGs)._begin; trinketRng = (uint *)((int)pvVar1 + 0x160); uVar4 = *trinketRng; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *trinketRng; if (uVar4 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x164) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar1 + 0x168) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x16c) & 0x1f) ^ uVar4; *trinketRng = uVar4; if (uVar4 % 5 != 0) goto LAB_007d645b; } spawnPosition = position; Isaac::GetRandomPickupVelocity(&heartVelocity,position,0,(RNG *)0x0); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; bVar3 = (byte)rngShift3; uVar7 = uVar7 >> (bVar3 & 0x1f) ^ uVar7; Game::Spawn(g_game,5,10,spawnPosition,&heartVelocity,(Entity *)0x0,0,uVar7); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> (bVar3 & 0x1f) ^ uVar7; pickupCount = pickupCountBefore - 1; if ((uVar7 & 1) != 0) { pickupCount = pickupCountBefore; } goto LAB_007d652a; } LAB_007d645b: spawnPosition = position; if (0.7 <= local_a0) { Isaac::GetRandomPickupVelocity(&bombVelocity,position,0,(RNG *)0x0); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; velocity = &bombVelocity; uVar6 = 0; uVar4 = 0x28; } else { Isaac::GetRandomPickupVelocity(&keyVelocity,position,0,(RNG *)0x0); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; velocity = &keyVelocity; uVar6 = 0; uVar4 = 0x1e; } goto LAB_007d651a; } if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; for (iVar8 = uVar7 % 3 + 1; iVar8 != 0; iVar8 = iVar8 + -1) { Isaac::GetRandomPickupVelocity(&coinVelocity,spawnPosition,0,(RNG *)0x0); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; Game::Spawn(g_game,5,0x14,spawnPosition,&coinVelocity,(Entity *)0x0,0,uVar7); } goto LAB_007d652a; case 0x18: uVar4 = 300; local_78 = 0x4e; break; case 0x1a: uVar4 = 300; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> (bVar5 & 0x1f) ^ uVar7; local_78 = ItemPool::GetCardEx(uVar7,0,-1,0,1); } Isaac::GetRandomPickupVelocity(&pickupVelocity,position,0,(RNG *)0x0); if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar7 = uVar7 >> ((byte)rngShift12 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)((ulonglong)rngShift12 >> 0x20) & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rngShift3 & 0x1f) ^ uVar7; velocity = &pickupVelocity; spawnPosition = position; uVar6 = local_78; LAB_007d651a: Game::Spawn(g_game,5,uVar4,spawnPosition,velocity,(Entity *)0x0,uVar6,uVar7); LAB_007d652a: local_80 = (Game *)((int)local_80 + 1); } while ((int)local_80 < (int)pickupCount); } ExceptionList = local_10; return; } //@@ 007d65c0 Entity_Player::GetMaxPoopMana /* ZHL [lua] Lua binding EntityPlayer:GetMaxPoopMana */ char Entity_Player::GetMaxPoopMana(void) { Entity_Player *pEVar1; pEVar1 = PlayerManager::FirstBirthrightOwner(&g_game->_playerManager,0x19); return (-(pEVar1 != (Entity_Player *)0x0) & 0x14U) + 9; } //@@ 007d65e0 Entity_Player::AddPoopMana /* ZHL [lua] Lua binding EntityPlayer:AddPoopMana prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::AddPoopMana(Entity_Player *this,int amount) { Game *pGVar1; Entity_Player *pEVar2; int *piVar3; int *piVar4; int iVar5; int local_c; int local_8; iVar5 = amount + this->_poopMana; amount = iVar5; pEVar2 = PlayerManager::FirstBirthrightOwner(&g_game->_playerManager,0x19); local_c = 0; local_8 = (-(uint)(pEVar2 != (Entity_Player *)0x0) & 0x14) + 9; piVar4 = &amount; if (local_8 <= iVar5) { piVar4 = &local_8; } piVar3 = &local_c; if (0 < *piVar4) { piVar3 = piVar4; } this->_poopMana = *piVar3; ConsumableCountChanged(this,0x80); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 007d6670 Entity_Player::poop_spell_roll /* DB: salvage spellq.c (Tainted ???); weighted pick; verify prototype: db/protos.zhl */ void __thiscall Entity_Player::poop_spell_roll(Entity_Player *this) { code *pcVar1; RNG *pRVar2; uint uVar3; int *piVar4; int cumulativeWeight; byte bVar5; uint uVar6; uint uVar7; void *freeBlock; uint weightRoll; undefined4 local_d4; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; uint slot; uint local_4c; Entity_Player *player; void *earlyPoolData; void *earlyPoolBegin; undefined4 *earlyPoolEnd; undefined4 *earlyPoolCapacity; RNG *spellRng; void *midPoolData; void *latePoolData; void *midPoolBegin; undefined4 *midPoolEnd; undefined4 *midPoolCapacity; void *latePoolBegin; undefined4 *latePoolEnd; undefined4 *latePoolCapacity; void *local_10; undefined1 *puStack_c; undefined4 local_8; RNG *rng; void *latePoolDataCopy; undefined4 *latePoolEndCopy; Entity_Player *playerCopy; puStack_c = &LAB_00b0039d; local_10 = ExceptionList; ExceptionList = &local_10; spellRng = (RNG *)((int)(this->_collectibleRNGs)._begin + 0x17a0); slot = 0; player = this; do { if (this->_poopSpellQueue[slot] == 0) { if (this->field_0x1f72 == '\0') { this->field_0x1f5e = 10; this->field_0x1f72 = 1; latePoolBegin = (void *)0x0; latePoolEnd = (undefined4 *)0x0; latePoolCapacity = (undefined4 *)0x0; this->field_0x1f5f = 9; this->field_0x1f72 = this->field_0x1f72 + '\x01'; this->_poopSpellQueue[(byte)this->field_0x1f72 + 6] = 8; this->field_0x1f72 = this->field_0x1f72 + '\x01'; local_8 = 0; local_5c = 1; local_58 = 5; std::vector<8byte>::_Emplace_reallocate(0,&local_5c); uVar3 = 0; latePoolData = latePoolBegin; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 9) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 5; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d67ba; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_64 = 9; local_60 = 5; if (latePoolEnd == latePoolCapacity) { std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_64); } else { *latePoolEnd = 9; latePoolEnd[1] = 5; latePoolEnd = latePoolEnd + 2; } LAB_007d67ba: uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 8) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 3; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6821; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_6c = 8; local_68 = 3; if (latePoolEnd == latePoolCapacity) { latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_6c); } else { *latePoolEnd = 8; latePoolEnd[1] = 3; latePoolEnd = latePoolEnd + 2; } LAB_007d6821: uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 2) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d688a; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_74 = 2; local_70 = 1; if (latePoolEnd == latePoolCapacity) { latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_74); } else { *latePoolEnd = 2; latePoolEnd[1] = 1; latePoolEnd = latePoolEnd + 2; } LAB_007d688a: uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 3) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d68f1; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_7c = 3; local_78 = 1; if (latePoolEnd == latePoolCapacity) { latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_7c); } else { *latePoolEnd = 3; latePoolEnd[1] = 1; latePoolEnd = latePoolEnd + 2; } LAB_007d68f1: uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 4) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d695a; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_84 = 4; local_80 = 1; if (latePoolEnd == latePoolCapacity) { latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_84); } else { *latePoolEnd = 4; latePoolEnd[1] = 1; latePoolEnd = latePoolEnd + 2; } LAB_007d695a: uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 5) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d69ca; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_8c = 5; local_88 = 1; if (latePoolEnd == latePoolCapacity) { latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_8c); } else { *latePoolEnd = 5; latePoolEnd[1] = 1; latePoolEnd = latePoolEnd + 2; } LAB_007d69ca: uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)latePoolBegin + uVar3 * 8) == 10) { piVar4 = (int *)((int)latePoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)latePoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6a3a; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_94 = 10; local_90 = 1; if (latePoolEnd == latePoolCapacity) { latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&local_94); } else { *latePoolEnd = 10; latePoolEnd[1] = 1; latePoolEnd = latePoolEnd + 2; } LAB_007d6a3a: latePoolEndCopy = latePoolEnd; latePoolDataCopy = latePoolBegin; midPoolBegin = (void *)0x0; midPoolEnd = (undefined4 *)0x0; midPoolCapacity = (undefined4 *)0x0; local_8 = CONCAT31(local_8._1_3_,1); local_9c = 2; local_98 = 1; latePoolData = latePoolBegin; std::vector<8byte>::_Emplace_reallocate(0,&local_9c); uVar3 = 0; uVar6 = (int)midPoolEnd - (int)midPoolBegin >> 3; midPoolData = midPoolBegin; if (uVar6 != 0) { do { if (*(int *)((int)midPoolBegin + uVar3 * 8) == 3) { piVar4 = (int *)((int)midPoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)midPoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6af3; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_a4 = 3; local_a0 = 1; if (midPoolEnd == midPoolCapacity) { std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&local_a4); } else { *midPoolEnd = 3; midPoolEnd[1] = 1; midPoolEnd = midPoolEnd + 2; } LAB_007d6af3: uVar3 = 0; uVar6 = (int)midPoolEnd - (int)midPoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)midPoolBegin + uVar3 * 8) == 4) { piVar4 = (int *)((int)midPoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)midPoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6b64; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_ac = 4; local_a8 = 1; if (midPoolEnd == midPoolCapacity) { midPoolData = midPoolBegin; std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&local_ac); } else { *midPoolEnd = 4; midPoolEnd[1] = 1; midPoolEnd = midPoolEnd + 2; } LAB_007d6b64: uVar3 = 0; uVar6 = (int)midPoolEnd - (int)midPoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)midPoolBegin + uVar3 * 8) == 5) { piVar4 = (int *)((int)midPoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)midPoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6bd5; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_b4 = 5; local_b0 = 1; if (midPoolEnd == midPoolCapacity) { midPoolData = midPoolBegin; std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&local_b4); } else { *midPoolEnd = 5; midPoolEnd[1] = 1; midPoolEnd = midPoolEnd + 2; } LAB_007d6bd5: uVar3 = 0; uVar6 = (int)midPoolEnd - (int)midPoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)midPoolBegin + uVar3 * 8) == 10) { piVar4 = (int *)((int)midPoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)midPoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6c46; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_bc = 10; local_b8 = 1; if (midPoolEnd == midPoolCapacity) { midPoolData = midPoolBegin; std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&local_bc); } else { *midPoolEnd = 10; midPoolEnd[1] = 1; midPoolEnd = midPoolEnd + 2; } LAB_007d6c46: earlyPoolBegin = (void *)0x0; earlyPoolEnd = (undefined4 *)0x0; earlyPoolCapacity = (undefined4 *)0x0; local_8 = CONCAT31(local_8._1_3_,2); local_c4 = 6; local_c0 = 1; midPoolData = midPoolBegin; std::vector<8byte>::_Emplace_reallocate(0,&local_c4); uVar3 = 0; uVar6 = (int)earlyPoolEnd - (int)earlyPoolBegin >> 3; earlyPoolData = earlyPoolBegin; if (uVar6 != 0) { do { if (*(int *)((int)earlyPoolBegin + uVar3 * 8) == 7) { piVar4 = (int *)((int)earlyPoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)earlyPoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6cfb; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_cc = 7; local_c8 = 1; if (earlyPoolEnd == earlyPoolCapacity) { std::vector<8byte>::_Emplace_reallocate(earlyPoolEnd,&local_cc); } else { *earlyPoolEnd = 7; earlyPoolEnd[1] = 1; earlyPoolEnd = earlyPoolEnd + 2; } LAB_007d6cfb: uVar3 = 0; uVar6 = (int)earlyPoolEnd - (int)earlyPoolBegin >> 3; if (uVar6 != 0) { do { if (*(int *)((int)earlyPoolBegin + uVar3 * 8) == 0xb) { piVar4 = (int *)((int)earlyPoolBegin + uVar3 * 8 + 4); *piVar4 = *piVar4 + 1; if (*piVar4 < 0) { *(undefined4 *)((int)earlyPoolBegin + uVar3 * 8 + 4) = 0; } goto LAB_007d6d73; } uVar3 = uVar3 + 1; } while (uVar3 < uVar6); } local_d4 = 0xb; local_d0 = 1; if (earlyPoolEnd == earlyPoolCapacity) { earlyPoolData = earlyPoolBegin; std::vector<8byte>::_Emplace_reallocate(earlyPoolEnd,&local_d4); } else { *earlyPoolEnd = 0xb; earlyPoolEnd[1] = 1; earlyPoolEnd = earlyPoolEnd + 2; } LAB_007d6d73: bVar5 = this->field_0x1f72; playerCopy = player; earlyPoolData = earlyPoolBegin; pRVar2 = spellRng; while (player = playerCopy, spellRng = pRVar2, bVar5 < 0x14) { uVar3 = pRVar2->_seed; if (bVar5 < 4) { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = pRVar2->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)pRVar2->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)pRVar2->_shift2 & 0x1f) ^ uVar3; uVar6 = 0; uVar3 = uVar3 >> ((byte)pRVar2->_shift3 & 0x1f) ^ uVar3; local_4c = 7; pRVar2->_seed = uVar3; weightRoll = 0; uVar7 = (int)earlyPoolEnd - (int)earlyPoolData >> 3; if (uVar7 != 0) { piVar4 = (int *)((int)earlyPoolData + 4); do { weightRoll = weightRoll + *piVar4; piVar4 = piVar4 + 2; uVar6 = uVar6 + 1; } while (uVar6 < uVar7); } if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 5 ^ uVar3; uVar3 = uVar3 << 9 ^ uVar3; if (weightRoll == 0) { weightRoll = 0; } else { weightRoll = (uVar3 >> 7 ^ uVar3) % weightRoll; } cumulativeWeight = 0; uVar3 = 0; uVar6 = (int)earlyPoolEnd - (int)earlyPoolData >> 3; if (uVar6 == 0) { LAB_007d6e6a: KAGE_LogMessage(0x10,(byte *) "No weights were added. At least one outcome needs weight."); } else { piVar4 = (int *)((int)earlyPoolData + 4); do { cumulativeWeight = cumulativeWeight + *piVar4; if ((int)weightRoll < cumulativeWeight) { bVar5 = (byte)*(undefined4 *)((int)earlyPoolData + uVar3 * 8); goto LAB_007d6e7b; } uVar3 = uVar3 + 1; piVar4 = piVar4 + 2; } while (uVar3 < uVar6); if (cumulativeWeight < 1) goto LAB_007d6e6a; } bVar5 = 0; LAB_007d6e7b: player->_poopSpellQueue[(byte)player->field_0x1f72 + 6] = bVar5; player->field_0x1f72 = player->field_0x1f72 + '\x01'; bVar5 = player->field_0x1f72; playerCopy = player; pRVar2 = spellRng; latePoolEndCopy = latePoolEnd; } else { if (bVar5 < 0xf) { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = pRVar2->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)pRVar2->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)pRVar2->_shift2 & 0x1f) ^ uVar3; uVar6 = 0; uVar3 = uVar3 >> ((byte)pRVar2->_shift3 & 0x1f) ^ uVar3; local_4c = 7; pRVar2->_seed = uVar3; weightRoll = 0; uVar7 = (int)midPoolEnd - (int)midPoolData >> 3; if (uVar7 != 0) { piVar4 = (int *)((int)midPoolData + 4); do { weightRoll = weightRoll + *piVar4; piVar4 = piVar4 + 2; uVar6 = uVar6 + 1; } while (uVar6 < uVar7); } if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 5 ^ uVar3; uVar3 = uVar3 << 9 ^ uVar3; if (weightRoll == 0) { weightRoll = 0; } else { weightRoll = (uVar3 >> 7 ^ uVar3) % weightRoll; } cumulativeWeight = 0; uVar3 = 0; uVar6 = (int)midPoolEnd - (int)midPoolData >> 3; if (uVar6 == 0) goto LAB_007d6f8c; piVar4 = (int *)((int)midPoolData + 4); do { cumulativeWeight = cumulativeWeight + *piVar4; if ((int)weightRoll < cumulativeWeight) { bVar5 = (byte)*(undefined4 *)((int)midPoolData + uVar3 * 8); goto LAB_007d6f9d; } uVar3 = uVar3 + 1; piVar4 = piVar4 + 2; } while (uVar3 < uVar6); LAB_007d6f88: if (cumulativeWeight < 1) goto LAB_007d6f8c; } else { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = pRVar2->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)pRVar2->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)pRVar2->_shift2 & 0x1f) ^ uVar3; uVar6 = 0; local_4c = uVar3 >> ((byte)pRVar2->_shift3 & 0x1f) ^ uVar3; pRVar2->_seed = local_4c; uVar7 = 0; local_54 = 7; uVar3 = (int)latePoolEndCopy - (int)latePoolDataCopy >> 3; if (uVar3 != 0) { piVar4 = (int *)((int)latePoolDataCopy + 4); do { uVar7 = uVar7 + *piVar4; piVar4 = piVar4 + 2; uVar6 = uVar6 + 1; } while (uVar6 < uVar3); } if (local_4c == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = local_4c >> 5 ^ local_4c; uVar3 = uVar3 << 9 ^ uVar3; if (uVar7 == 0) { uVar7 = 0; } else { uVar7 = (uVar3 >> 7 ^ uVar3) % uVar7; } cumulativeWeight = 0; uVar3 = 0; uVar6 = (int)latePoolEnd - (int)latePoolDataCopy >> 3; if (uVar6 != 0) { piVar4 = (int *)((int)latePoolDataCopy + 4); do { cumulativeWeight = cumulativeWeight + *piVar4; if ((int)uVar7 < cumulativeWeight) { bVar5 = (byte)*(undefined4 *)((int)latePoolDataCopy + uVar3 * 8); goto LAB_007d6f9d; } uVar3 = uVar3 + 1; piVar4 = piVar4 + 2; } while (uVar3 < uVar6); goto LAB_007d6f88; } LAB_007d6f8c: KAGE_LogMessage(0x10,(byte *) "No weights were added. At least one outcome needs weight."); } bVar5 = 0; LAB_007d6f9d: player->_poopSpellQueue[(byte)player->field_0x1f72 + 6] = bVar5; player->field_0x1f72 = player->field_0x1f72 + '\x01'; bVar5 = player->field_0x1f72; playerCopy = player; pRVar2 = spellRng; latePoolEndCopy = latePoolEnd; } } uVar3 = 0; do { uVar6 = spellRng->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = spellRng->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } latePoolDataCopy = latePoolData; uVar6 = uVar6 >> ((byte)spellRng->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)spellRng->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)spellRng->_shift3 & 0x1f) ^ uVar6; uVar7 = 0; spellRng->_seed = uVar6; if (0x14 - uVar3 != 0) { uVar7 = uVar6 % (0x14 - uVar3); } uVar7 = uVar7 + uVar3; if (uVar7 != uVar3) { bVar5 = playerCopy->_poopSpellQueue[uVar3 + 6]; playerCopy->_poopSpellQueue[uVar3 + 6] = playerCopy->_poopSpellQueue[uVar7 + 6]; playerCopy->_poopSpellQueue[uVar7 + 6] = bVar5; } uVar3 = uVar3 + 1; } while (uVar3 < 0x13); local_8._0_1_ = 1; if (earlyPoolData != (void *)0x0) { uVar3 = ((int)earlyPoolCapacity - (int)earlyPoolData >> 3) * 8; freeBlock = earlyPoolData; if (0xfff < uVar3) { freeBlock = *(void **)((int)earlyPoolData + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)earlyPoolData + (-4 - (int)freeBlock))) goto LAB_007d7282; } operator_delete(freeBlock,uVar3); earlyPoolBegin = (void *)0x0; earlyPoolEnd = (undefined4 *)0x0; earlyPoolCapacity = (undefined4 *)0x0; } local_8._0_1_ = 0; if (midPoolData != (void *)0x0) { uVar3 = ((int)midPoolCapacity - (int)midPoolData >> 3) * 8; freeBlock = midPoolData; if (0xfff < uVar3) { freeBlock = *(void **)((int)midPoolData + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)midPoolData + (-4 - (int)freeBlock))) goto LAB_007d7282; } operator_delete(freeBlock,uVar3); midPoolBegin = (void *)0x0; midPoolEnd = (undefined4 *)0x0; midPoolCapacity = (undefined4 *)0x0; } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (latePoolDataCopy != (void *)0x0) { uVar3 = (int)latePoolCapacity - (int)latePoolDataCopy & 0xfffffff8; freeBlock = latePoolDataCopy; if (0xfff < uVar3) { freeBlock = *(void **)((int)latePoolDataCopy + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)latePoolDataCopy + (-4 - (int)freeBlock))) { LAB_007d7282: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } this = player; } this->field_0x1f72 = this->field_0x1f72 + -1; this->_poopSpellQueue[slot] = this->_poopSpellQueue[(byte)this->field_0x1f72 + 6]; } slot = slot + 1; if (5 < slot) { ExceptionList = local_10; return; } } while( true ); } //@@ 007d7290 Entity_Player::UsePoopSpell /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding EntityPlayer:UsePoopSpell */ void __thiscall Entity_Player::UsePoopSpell(Entity_Player *this,uint param_2) { Vector *pos; int iVar1; code *pcVar2; ANM2 *pAVar3; uint rngResult; Entity *spawned; ColorMod *color; Vector *direction; uint *poopRngSeed; undefined1 auStack_68 [4]; EntityPtr *local_64; Vector local_60; undefined4 local_58; undefined4 local_54; BitSet128 bombFlags; Color fartColor; uint securityCookie; void *collectibleRngs; Game *game; Manager *manager; float *nullItems; EntityPtr oldParent; EntityPtr *parentRef; manager = g_manager; securityCookie = __security_cookie ^ (uint)auStack_68; collectibleRngs = (this->_collectibleRNGs)._begin; poopRngSeed = (uint *)((int)collectibleRngs + 0x17a0); if (((-1 < (int)param_2) && (param_2 < 0xc)) && (local_64 = (EntityPtr *)(&PTR_00b6ba00)[param_2], 0 < (int)local_64)) { rngResult = *poopRngSeed; if (rngResult == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); rngResult = *poopRngSeed; if (rngResult == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } game = g_game; rngResult = rngResult >> ((byte)*(undefined4 *)((int)collectibleRngs + 0x17a4) & 0x1f) ^ rngResult; rngResult = rngResult << ((byte)*(undefined4 *)((int)collectibleRngs + 0x17a8) & 0x1f) ^ rngResult; rngResult = rngResult >> ((byte)*(undefined4 *)((int)collectibleRngs + 0x17ac) & 0x1f) ^ rngResult; *poopRngSeed = rngResult; spawned = Game::SpawnEx(game,0xf5,(uint)local_64,&this->_pos,&g_vectorZero,(Entity *)this,0, rngResult,0); (**(code **)(*(int *)spawned + 0xc))(); if ((spawned->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(spawned->_sprite)._animState, *(int *)((int)(spawned->_sprite)._animState._animData + 0x30) + -1); } TryHoldEntity(this,spawned); manager = g_manager; local_64 = (EntityPtr *)0x25f; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,(int)local_64,1.0,2,0,1.0,0.0); return; } switch(param_2) { case 8: local_64 = (EntityPtr *)0x25; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,(int)local_64,1.0,2,0,1.0,0.0); manager = g_manager; local_64 = (EntityPtr *)0x95; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,(int)local_64,1.0,2,0,1.5,0.0); rngResult = Random(); local_60.x = (float)Game::SpawnEx(g_game,1000,0xc3,&this->_pos,&g_vectorZero,(Entity *)this,1, rngResult,0); oldParent = ((Entity *)local_60.x)->_parent; pAVar3 = &((Entity *)((int)local_60.x + 0x40c))->_sprite; (pAVar3->_filename)._buf[8] = '$'; (pAVar3->_filename)._buf[9] = '\0'; (pAVar3->_filename)._buf[10] = '\0'; (pAVar3->_filename)._buf[0xb] = '\0'; parentRef = &((Entity *)local_60.x)->_parent; pAVar3 = &((Entity *)((int)local_60.x + 0x40c))->_sprite; (pAVar3->_filename)._buf[0xc] = '$'; (pAVar3->_filename)._buf[0xd] = '\0'; (pAVar3->_filename)._buf[0xe] = '\0'; (pAVar3->_filename)._buf[0xf] = '\0'; if (oldParent != (EntityPtr)0x0) { local_64 = parentRef; std::multiset::erase(&local_64); } *parentRef = (EntityPtr)this; std::multiset::insert(parentRef); (**(code **)(*(int *)local_60.x + 0xc))(); break; case 9: Color::Color(&fartColor); pos = &this->_pos; Game::Fart(g_game,pos,85.0,(Entity *)this,1.0,0,color); Game::ButterBeanFart(g_game,pos,120.0,(Entity *)this,0,0); rngResult = Random(); spawned = Game::SpawnEx(g_game,1000,0x8d,pos,&g_vectorZero,(Entity *)this,1,rngResult,0); iVar1 = *(int *)spawned; pAVar3 = &spawned[1]._sprite; (pAVar3->_filename)._buf[8] = -1; (pAVar3->_filename)._buf[9] = -1; (pAVar3->_filename)._buf[10] = -1; (pAVar3->_filename)._buf[0xb] = -1; pAVar3 = &spawned[1]._sprite; (pAVar3->_filename)._buf[0xc] = -1; (pAVar3->_filename)._buf[0xd] = -1; (pAVar3->_filename)._buf[0xe] = -1; (pAVar3->_filename)._buf[0xf] = -1; (**(code **)(iVar1 + 0xc))(); return; case 10: GetBombFlags(this,&bombFlags,0); rngResult = Random(); local_60.x = (this->_velocity).x * 0.1; local_60.y = (this->_velocity).y * 0.1; spawned = Game::SpawnEx(g_game,4,9,&this->_pos,&local_60,(Entity *)this,0,rngResult,0); spawned = (Entity *) __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0); spawned[1]._variant = (int)bombFlags._l; spawned[1]._subtype = bombFlags._l._4_4_; spawned[1]._spawnerType = (int)bombFlags._h; spawned[1]._spawnerVariant = bombFlags._h._4_4_; spawned[1]._sprite._filename._buf[0xf] = '\x01'; TryHoldEntity(this,spawned); manager = g_manager; local_64 = (EntityPtr *)0x25f; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,(int)local_64,1.0,2,0,1.0,0.0); return; case 0xb: local_64 = (EntityPtr *)0x25; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,(int)local_64,1.0,2,0,1.0,0.0); TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0,-1); nullItems = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)nullItems & 0xfffffffcU) < 1) { local_60.x = 0.0; } else { local_60.x = *nullItems; } local_60.y = 0.0; local_54 = 0; local_58 = 0x3c; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_60,1,1); AnimateSad(this); ShootCandle(this,direction); return; } return; } //@@ 007d7740 Entity_Player::RecomputeWispCollectibles /* DB: ? matches REPENTOGON's RecomputeWispCollectibles_TriggerCollectibleRemoved hook site prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::RecomputeWispCollectibles(Entity_Player *this,Entity_Familiar *wisp) { char cVar1; void *pvVar2; void *pvVar3; int *piVar4; Entity_Player *this_00; int *piVar5; byte bVar6; Entity_Familiar *pEVar7; int iVar8; Game *game; uint uVar9; Entity_Familiar *pEVar10; ItemConfig_Item *item; int *removedNode; undefined1 local_50 [8]; Entity_Familiar *roomWispFoundNode; undefined1 local_44 [4]; undefined1 local_40 [4]; Entity_Familiar *wispFoundNode; int *removedItems; undefined4 local_34; Entity_Familiar *newWispItems; uint newWispItemsSize; Entity_Familiar *insertKey; std_map *local_24; undefined1 local_20 [4]; Entity_Familiar *local_1c; Entity_Player *player; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Familiar *oldListHead; local_8 = 0xffffffff; puStack_c = &LAB_00b003d5; local_10 = ExceptionList; ExceptionList = &local_10; newWispItems = (Entity_Familiar *)0x0; newWispItemsSize = 0; player = this; pEVar7 = operator_new(0x18); *(Entity_Familiar **)pEVar7 = pEVar7; *(Entity_Familiar **)&pEVar7->field_0x4 = pEVar7; (pEVar7->_damageEvents)._begin = pEVar7; *(undefined2 *)&(pEVar7->_damageEvents)._end = 0x101; local_8 = 0; newWispItems = pEVar7; if ((((wisp != (Entity_Familiar *)0x0) && (wisp->_type == 3)) && (wisp->_variant == 0xed)) && (wisp->_dead == 0)) { pEVar10 = (Entity_Familiar *)wisp->_subtype; wisp = pEVar10; std::set::find_node(local_44,&wisp); if (((*(char *)((int)&(wispFoundNode->_damageEvents)._end + 1) == '\0') && ((int)(wispFoundNode->_damageEvents)._capacity <= (int)pEVar10)) && (wispFoundNode != pEVar7)) { wispFoundNode->_pendingDamage = (float)((int)wispFoundNode->_pendingDamage + 1); } else { local_24 = (std_map *)0x1; insertKey = pEVar10; FUN_005cc7e0(local_20,&insertKey); } } uVar9 = 0; local_1c = g_game->_room; if (*(int *)((int)local_1c + 0x1254) != 0) { do { iVar8 = *(int *)(*(int *)((int)local_1c + 0x124c) + uVar9 * 4); if (((iVar8 != 0) && (*(int *)(iVar8 + 0x28) == 3)) && ((*(Entity_Player **)(iVar8 + 0x410) == this && (((*(int *)(iVar8 + 0x2c) == 0xed && (*(char *)(iVar8 + 0x172) != '\0')) && (*(char *)(iVar8 + 0x173) == '\0')))))) { pEVar7 = *(Entity_Familiar **)(iVar8 + 0x30); wisp = pEVar7; std::set::find_node(local_50,&wisp); if (((*(char *)((int)&(roomWispFoundNode->_damageEvents)._end + 1) == '\0') && ((int)(roomWispFoundNode->_damageEvents)._capacity <= (int)pEVar7)) && (roomWispFoundNode != newWispItems)) { roomWispFoundNode->_pendingDamage = (float)((int)roomWispFoundNode->_pendingDamage + 1); } else { local_24 = (std_map *)0x1; insertKey = pEVar7; FUN_005cc7e0(local_40,&insertKey); } } uVar9 = uVar9 + 1; } while (uVar9 < *(uint *)((int)local_1c + 0x1254)); } local_24 = &this->_itemWispsList; pEVar7 = *(Entity_Familiar **)(this->_itemWispsList)._head; pEVar10 = *(Entity_Familiar **)newWispItems; removedItems = (int *)0x0; local_34 = 0; wisp = pEVar10; local_1c = pEVar7; removedItems = operator_new(0x14); *removedItems = (int)removedItems; removedItems[1] = (int)removedItems; removedItems[2] = (int)removedItems; *(undefined2 *)(removedItems + 3) = 0x101; local_8 = CONCAT31(local_8._1_3_,1); game = g_game; LAB_007d7900: while (oldListHead = local_24->_head, pEVar7 != oldListHead) { if (pEVar10 == newWispItems) { LAB_007d7a52: pvVar2 = (pEVar7->_damageEvents)._capacity; if (game == (Game *)0x0) { if (-1 < (int)pvVar2) goto LAB_007d7a8a; } else { if ((int)pvVar2 < 0) { if (((int)pvVar2 < 0) && (pvVar3 = (game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)pvVar2 < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar3 >> 2)) { iVar8 = **(int **)((int)pvVar3 + ~(uint)pvVar2 * 4); } else { iVar8 = 0; } } else { LAB_007d7a8a: pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 >> 2 <= (int)pvVar2) goto LAB_007d7ab7; iVar8 = *(int *)((int)pvVar3 + (int)pvVar2 * 4); } if (iVar8 != 0) { player->_cacheFlags = player->_cacheFlags | *(uint *)(iVar8 + 0x54); } } LAB_007d7ab7: FUN_007dd660(local_40,&(pEVar7->_damageEvents)._capacity); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1c); pEVar7 = local_1c; game = g_game; } else { pvVar3 = (pEVar7->_damageEvents)._capacity; pvVar2 = (pEVar10->_damageEvents)._capacity; if ((int)pvVar2 < (int)pvVar3) goto LAB_007d7914; if ((int)pvVar3 < (int)pvVar2) goto LAB_007d7a52; if (pEVar7->_pendingDamage != pEVar10->_pendingDamage) { if (game == (Game *)0x0) { if (-1 < (int)pvVar3) goto LAB_007d79a5; } else { if ((int)pvVar3 < 0) { if (((int)pvVar3 < 0) && (pvVar2 = (game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)pvVar3 < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2)) { iVar8 = **(int **)((int)pvVar2 + ~(uint)pvVar3 * 4); } else { iVar8 = 0; } } else { LAB_007d79a5: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)pvVar3) goto LAB_007d79d2; iVar8 = *(int *)((int)pvVar2 + (int)pvVar3 * 4); } if (iVar8 != 0) { player->_cacheFlags = player->_cacheFlags | *(uint *)(iVar8 + 0x54); } } } LAB_007d79d2: std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1c); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&wisp); pEVar10 = wisp; pEVar7 = local_1c; } } if (pEVar10 != newWispItems) { LAB_007d7914: pvVar2 = (pEVar10->_damageEvents)._capacity; if (game == (Game *)0x0) { if (-1 < (int)pvVar2) goto LAB_007d79f5; LAB_007d7a24: item = (ItemConfig_Item *)0x0; } else { if ((int)pvVar2 < 0) { if (((int)pvVar2 < 0) && (pvVar3 = (game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)pvVar2 < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar3 >> 2)) { item = (ItemConfig_Item *)**(int **)((int)pvVar3 + ~(uint)pvVar2 * 4); } else { item = (ItemConfig_Item *)0x0; } } else { LAB_007d79f5: pvVar3 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar3 >> 2 <= (int)pvVar2) goto LAB_007d7a24; item = *(ItemConfig_Item **)((int)pvVar3 + (int)pvVar2 * 4); } if (item != (ItemConfig_Item *)0x0) { player->_cacheFlags = player->_cacheFlags | item->cacheFlags; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&wisp); if (item->addCostumeOnPickup == 0) { pEVar10 = wisp; } else { AddCostume(player,item,0); pEVar10 = wisp; game = g_game; } goto LAB_007d7900; } if (local_24 != (std_map *)&newWispItems) { local_24->_head = newWispItems; uVar9 = local_24->_size; local_24->_size = newWispItemsSize; newWispItems = oldListHead; newWispItemsSize = uVar9; } removedNode = (int *)*removedItems; if (removedNode == removedItems) { LAB_007d7bcf: EvaluateItems(); FID_conflict__Erase_tree_>_> (&removedItems,(fuzzer_allocator_> *)&removedItems ,(_Tree_node *)removedItems[1]); operator_delete(removedItems,0x14); FID_conflict__Erase_tree_>_> (&newWispItems,(fuzzer_allocator_> *)&newWispItems ,*(_Tree_node **)&newWispItems->field_0x4); operator_delete(newWispItems,0x18); ExceptionList = local_10; return; } do { this_00 = player; uVar9 = removedNode[4]; if (game == (Game *)0x0) { if (-1 < (int)uVar9) goto LAB_007d7b33; LAB_007d7b52: item = (ItemConfig_Item *)0x0; } else if ((int)uVar9 < 0) { if ((-1 < (int)uVar9) || (pvVar2 = (game->_proceduralItemManager)._proceduralItems._begin, (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2 <= (int)~uVar9 )) goto LAB_007d7b52; item = (ItemConfig_Item *)**(undefined4 **)((int)pvVar2 + ~uVar9 * 4); } else { LAB_007d7b33: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)uVar9) goto LAB_007d7b52; item = *(ItemConfig_Item **)((int)pvVar2 + uVar9 * 4); } TriggerCollectibleRemoved(player,uVar9); if ((item->addCostumeOnPickup != 0) && (bVar6 = HasCollectible(this_00,removedNode[4],0), bVar6 == 0)) { RemoveCostume(this_00,item); } piVar4 = (int *)removedNode[2]; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); removedNode = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); removedNode = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(removedNode[1] + 0xd); piVar5 = (int *)removedNode[1]; piVar4 = removedNode; while ((removedNode = piVar5, cVar1 == '\0' && (piVar4 == (int *)removedNode[2]))) { cVar1 = *(char *)(removedNode[1] + 0xd); piVar5 = (int *)removedNode[1]; piVar4 = removedNode; } } if (removedNode == removedItems) goto LAB_007d7bcf; game = g_game; } while( true ); } //@@ 007d7c30 Entity_Player::trigger_cracked_orb /* DB: called from take_damage_impl when HasCollectible(0x2a3 COLLECTIBLE_CRACKED_ORB); GridEntity_Door::TryBlowOpen/TryUnlock, Minimap::Refresh, spawns effect FollowParent prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::trigger_cracked_orb(Entity_Player *door,Vector *effectPos) { float fVar1; float fVar2; code *pcVar3; Entity_Player *parent; byte bVar4; uint uVar5; RoomDescriptor *revealedRoom; Game *pGVar6; Entity *unlockEffect; Entity_Effect *orbEffect; float *extraout_EAX; int *piVar7; void *pvVar8; uint uVar9; int iVar10; int *pushCursor; uint roomCount; int *roomListEntry; uint *rngSeed; EntityRef playerRef; int *unrevealedRooms; int *unrevealedEnd; int *unrevealedCapacity; Vector local_44; Vector blownDoorPos; Vector gridEffectPos; int *unrevealedCapEnd; int *unrevealedBegin; Game *local_24; Entity_Player *player; uint local_1c; char isAnyOpened; void *local_10; undefined1 *puStack_c; undefined4 local_8; GridEntity_Door *door; Manager *manager; int *roomIdxList; puStack_c = &LAB_00b0040d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar10 = 0; piVar7 = (int *)0x0; local_24 = g_game; pushCursor = (int *)0x0; unrevealedBegin = (int *)0x0; unrevealedRooms = (int *)0x0; unrevealedEnd = (int *)0x0; unrevealedCapEnd = (int *)0x0; unrevealedCapacity = (int *)0x0; local_8 = 0; player = door; if (0 < g_game->_nbRooms) { roomListEntry = &g_game->_roomList[0].SafeGridIndex; do { if (((byte)roomListEntry[0xe] & 5) != 5) { if (pushCursor == piVar7) { std::vector::_Emplace_reallocate(pushCursor,roomListEntry); piVar7 = unrevealedCapacity; pushCursor = unrevealedEnd; } else { *pushCursor = *roomListEntry; unrevealedEnd = pushCursor + 1; pushCursor = unrevealedEnd; } } roomIdxList = unrevealedRooms; iVar10 = iVar10 + 1; roomListEntry = roomListEntry + 0x2e; } while (iVar10 < local_24->_nbRooms); unrevealedBegin = unrevealedRooms; unrevealedCapEnd = piVar7; if (unrevealedRooms != pushCursor) { roomCount = (int)pushCursor - (int)unrevealedRooms >> 2; pvVar8 = (player->_collectibleRNGs)._begin; rngSeed = (uint *)((int)pvVar8 + 0x2a30); uVar9 = *rngSeed; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar9 = *rngSeed; if (uVar9 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar9 = uVar9 >> ((byte)*(undefined4 *)((int)pvVar8 + 0x2a34) & 0x1f) ^ uVar9; uVar9 = uVar9 ^ uVar9 << ((byte)*(undefined4 *)((int)pvVar8 + 0x2a38) & 0x1f); uVar9 = uVar9 ^ uVar9 >> ((byte)*(undefined4 *)((int)pvVar8 + 0x2a3c) & 0x1f); *rngSeed = uVar9; if (roomCount == 0) { uVar9 = 0; } else { uVar9 = uVar9 % roomCount; } revealedRoom = Level::GetRoomByIdx((Level *)local_24,roomIdxList[uVar9],-1); revealedRoom->DisplayFlags = revealedRoom->DisplayFlags | 5; Minimap::Refresh(&g_game->_minimap); manager = g_manager; local_24 = (Game *)0x352; seed_fart_sound_override((int *)&local_24); SoundEffects::Play(&manager->_sfxManager,(int)local_24,1.0,2,0,1.0,0.0); } } isAnyOpened = '\0'; local_24 = (Game *)0x0; pvVar8 = g_game->_room; if (0 < *(int *)((int)pvVar8 + 0x10) * *(int *)((int)pvVar8 + 0xc)) { local_1c = 0x24; do { if (((local_24 < (Game *)0x1c0) && (piVar7 = *(int **)(local_1c + (int)pvVar8), piVar7 != (int *)0x0)) && ((((iVar10 = piVar7[1], iVar10 == 2 || (((((iVar10 == 3 || (iVar10 == 4)) || (iVar10 == 5)) || ((iVar10 == 6 || (iVar10 == 0x16)))) || (iVar10 == 0x18)))) || (((iVar10 == 0x19 || (iVar10 == 0x1a)) || (iVar10 == 0x1b)))) && ((((piVar7[3] == 1 || (piVar7[3] == 4)) && (iVar10 != 3)) && (iVar10 != 0x18)))))) { if ((iVar10 != 4) && (iVar10 != 0x16)) { if ((g_game->_levelStateFlags & 0x2000U) == 0) { pGVar6 = *(Game **)((int)pvVar8 + 0x768); } else { pGVar6 = (Game *)0xffffffff; } if (pGVar6 != local_24) goto LAB_007d7f10; } pcVar3 = *(code **)(*piVar7 + 0x14); EntityRef::constructor(&playerRef,(Entity *)player); (*pcVar3)(1,&playerRef,uVar5); uVar9 = Random(); iVar10 = *(int *)((int)g_game->_room + 0xc); gridEffectPos.x = (float)(piVar7[9] % iVar10) * 40.0 + 40.0; gridEffectPos.y = (float)(piVar7[9] / iVar10) * 40.0 + 120.0; unlockEffect = Game::Spawn(g_game,1000,0xad,&gridEffectPos,&g_vectorZero,(Entity *)0x0,0, uVar9); (**(code **)(*(int *)unlockEffect + 0xc))(); isAnyOpened = '\x01'; } LAB_007d7f10: local_24 = (Game *)((int)&local_24->_stage + 1); local_1c = local_1c + 4; pvVar8 = g_game->_room; } while ((int)local_24 < *(int *)((int)pvVar8 + 0x10) * *(int *)((int)pvVar8 + 0xc)); } local_1c = 0; local_24 = (Game *)0x724; do { pGVar6 = local_24; local_1c = local_1c + 1; if ((local_1c < 9) && (door = *(GridEntity_Door **)((int)g_game->_room + (int)(local_24->_roomList + -1) + 0xa4), door != (GridEntity_Door *)0x0)) { iVar10 = (door->_desc)._variant; if (((iVar10 == 1) || (((iVar10 == 4 || (iVar10 == 3)) || (iVar10 == 2)))) || (iVar10 == 5)) { bVar4 = GridEntity_Door::TryUnlock(door,player,1); if (bVar4 == 0) goto LAB_007d80f4; uVar5 = Random(); iVar10 = *(int *)((int)g_game->_room + 0xc); local_44.x = (float)(door->_gridIndex % iVar10) * 40.0 + 40.0; local_44.y = (float)(door->_gridIndex / iVar10) * 40.0 + 120.0; unlockEffect = Game::Spawn(g_game,1000,0xad,&local_44,&g_vectorZero,(Entity *)0x0,0,uVar5); (**(code **)(*(int *)unlockEffect + 0xc))(); isAnyOpened = '\x01'; } else { if ((((door->_currentRoomType != 7) && (door->_targetRoomType != 7)) && ((door->_currentRoomType != 8 && (door->_targetRoomType != 8)))) || (bVar4 = GridEntity_Door::TryBlowOpen(door,0,(Entity *)0x0), bVar4 == 0)) goto LAB_007d80f4; uVar5 = Random(); iVar10 = *(int *)((int)g_game->_room + 0xc); blownDoorPos.x = (float)(door->_gridIndex % iVar10) * 40.0 + 40.0; blownDoorPos.y = (float)(door->_gridIndex / iVar10) * 40.0 + 120.0; unlockEffect = Game::Spawn(g_game,1000,0xad,&blownDoorPos,&g_vectorZero,(Entity *)0x0,0, uVar5); (**(code **)(*(int *)unlockEffect + 0xc))(); isAnyOpened = '\x01'; } } else { LAB_007d80f4: local_24 = pGVar6; } local_24 = (Game *)&local_24->_stageType; if (0x743 < (int)local_24) { if (isAnyOpened != '\0') { uVar5 = Random(); orbEffect = (Entity_Effect *) Game::Spawn(g_game,1000,0xad,effectPos,&g_vectorZero,(Entity *)0x0,0,uVar5); parent = player; (orbEffect->_sprite)._scale.x = (player->_playerSpriteScale).x; (orbEffect->_sprite)._scale.y = (player->_playerSpriteScale).y; if ((effectPos->x == g_vectorZero.x) && (effectPos->y == g_vectorZero.y)) { (orbEffect->_pos).x = (player->_pos).x; (orbEffect->_pos).y = (player->_pos).y; GetFlyingOffset(player,&local_44); fVar1 = extraout_EAX[1]; fVar2 = (parent->_posOffset).y; (orbEffect->_posOffset).x = (parent->_posOffset).x + *extraout_EAX; (orbEffect->_posOffset).y = fVar1 + fVar2; Entity_Effect::FollowParent(orbEffect,(Entity *)parent); } else { (orbEffect->_posOffset).x = 0.0; (orbEffect->_posOffset).y = -16.0; } (**(code **)(*(int *)orbEffect + 0xc))(); } if (unrevealedBegin != (int *)0x0) { uVar5 = (int)unrevealedCapEnd - (int)unrevealedBegin & 0xfffffffc; piVar7 = unrevealedBegin; if (0xfff < uVar5) { piVar7 = (int *)unrevealedBegin[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)unrevealedBegin + (-4 - (int)piVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar7,uVar5); } ExceptionList = local_10; return; } } while( true ); } //@@ 007d8240 Entity_Player::AddItemCard /* ZHL [exact] __thiscall unsigned int Entity_Player::AddItemCard(unsigned int itemID); prototype: REPENTOGON, confirmed by RET 4 */ uint __thiscall Entity_Player::AddItemCard(Entity_Player *this,uint itemID) { void **ppvVar1; void *pvVar2; void *pvVar3; uint *puVar4; uint *_Src; int iVar5; uint uVar6; Entity *pEVar7; int iVar8; size_t _Size; Vector local_10; if (itemID != 0) { pvVar2 = (this->_itemCards)._end; pvVar3 = (this->_itemCards)._begin; iVar5 = GetCollectibleNum(this,0xfb,0); iVar8 = 0x14; if (iVar5 + 3 < 0x14) { iVar8 = iVar5 + 3; } if ((int)pvVar2 - (int)pvVar3 >> 2 == iVar8) { Room::FindFreePickupSpawnPosition(g_game->_room,&local_10,&this->_pos,0.0,0,0,0); uVar6 = Random(); pEVar7 = Game::SpawnEx(g_game,5,300,&local_10,&g_vectorZero,(Entity *)this, *(uint *)(this->_itemCards)._begin | 0x8000,uVar6,0); if (pEVar7 != (Entity *)0x0) { pEVar7[1]._sprite._championColor._offset[1] = 5.60519e-45; } pvVar3 = (this->_itemCards)._begin; pvVar2 = (void *)((int)pvVar3 + 4); memmove(pvVar3,pvVar2,(int)(this->_itemCards)._end - (int)pvVar2); ppvVar1 = &(this->_itemCards)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -4); } } pvVar2 = (this->_itemCards)._end; pvVar3 = (this->_itemCards)._begin; iVar8 = GetCollectibleNum(this,0xfb,0); uVar6 = 0x14; if ((int)(iVar8 + 3U) < 0x14) { uVar6 = iVar8 + 3U; } if (uVar6 <= (uint)((int)pvVar2 - (int)pvVar3 >> 2)) { return 0; } if (itemID == 0) { uVar6 = RNG::Next((RNG *)((int)(this->_collectibleRNGs)._begin + 0x2c60)); itemID = ItemPool::GetCardImpl(uVar6); } uVar6 = itemID; puVar4 = (this->_itemCards)._end; _Src = (this->_itemCards)._begin; if (puVar4 == (this->_itemCards)._capacity) { std::vector::_Emplace_reallocate(_Src,&itemID); uVar6 = itemID; } else if (_Src == puVar4) { *puVar4 = itemID; ppvVar1 = &(this->_itemCards)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } else { *puVar4 = puVar4[-1]; ppvVar1 = &(this->_itemCards)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); _Size = (int)puVar4 + (-4 - (int)_Src); memmove((void *)((int)puVar4 - _Size),_Src,_Size); *_Src = uVar6; } HUD::mark_all_slots_dirty(&g_game->_hud,0,0); return uVar6; } //@@ 007d83f0 Entity_Player::spawn_lil_clot_familiars /* DB: thiscall Entity_Player: counts this player's FAMILIAR 3.238 subtype 7 (Lil Clot blood clot) in the room entity list, and while below GetTrinketMultiplier(TRINKET_LIL_CLOT 176) spawns more at a random angle (Game::SpawnEx(3,0xee,..,7)); Entity_Player::room_enter, TriggerTrinketAdded */ void Entity_Player::spawn_lil_clot_familiars(void) { float fVar1; undefined4 uVar2; Manager *pMVar3; int iVar4; int iVar5; uint uVar6; Entity *pEVar7; Entity *pEVar8; Entity_Player *in_ECX; uint uVar9; int iVar10; bool bVar11; bool bVar12; float local_1c; int local_18; float local_14; Vector local_10; uVar9 = 0; iVar10 = 0; uVar6 = *(uint *)((int)g_game->_room + 0x1254); if (uVar6 != 0) { do { iVar5 = *(int *)(*(int *)((int)g_game->_room + 0x124c) + uVar9 * 4); if ((((*(int *)(iVar5 + 0x28) == 3) && (*(int *)(iVar5 + 0x2c) == 0xee)) && (*(int *)(iVar5 + 0x30) == 7)) && (*(Entity_Player **)(iVar5 + 0x410) == in_ECX)) { iVar10 = iVar10 + 1; } uVar9 = uVar9 + 1; } while (uVar9 < uVar6); } fVar1 = in_ECX[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != 2.46629e-43)) { iVar5 = GetTrinketMultiplier(in_ECX,0xb0); bVar12 = false; bVar11 = iVar5 == 0; } else { if (*(char *)(in_ECX[1]._chargeBarSprites[0]._color._offset + 1) != '\0') goto LAB_007d8486; iVar4 = GetTrinketMultiplier(in_ECX,0xb0); bVar12 = SBORROW4(iVar4,1); iVar5 = iVar4 + -1; bVar11 = iVar4 == 1; } if (bVar11 || bVar12 != iVar5 < 0) { return; } LAB_007d8486: iVar5 = GetTrinketMultiplier(in_ECX,0xb0); if ((iVar10 < iVar5) && (local_18 = GetTrinketMultiplier(in_ECX,0xb0), iVar10 < local_18)) { local_18 = local_18 - iVar10; do { uVar6 = Random(); uVar9 = Random(); local_1c = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1c = local_1c + local_1c; local_14 = cos(local_1c); local_10.y = sin(local_1c); local_10.x = local_14 + local_14; local_10.y = local_10.y + local_10.y; pEVar7 = Game::SpawnEx(g_game,3,0xee,&in_ECX->_pos,&local_10,(Entity *)in_ECX,7,uVar6,0); uVar2 = *(undefined4 *)((int)&pEVar7->_flags + 4); iVar10 = *(int *)pEVar7; *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar7->_flags + 4) = uVar2; (**(code **)(iVar10 + 0xc))(); pMVar3 = g_manager; local_1c = 1.00893e-43; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&pMVar3->_sfxManager,(int)local_1c,1.0,2,0,1.0,0.0); uVar6 = Random(); pEVar8 = Game::SpawnEx(g_game,1000,2,&in_ECX->_pos,&g_vectorZero,(Entity *)0x0,2,uVar6,0); (**(code **)(*(int *)pEVar8 + 0x3c))(&pEVar7->_splatColor,0xffffffff,0xff,0,1); iVar10 = *(int *)pEVar8; (pEVar8->_sprite)._offset.x = 0.0; (pEVar8->_sprite)._offset.y = -6.0; pEVar8->_renderDepthOffset = 10.0; (**(code **)(iVar10 + 0xc))(); local_18 = local_18 + -1; } while (local_18 != 0); } return; } //@@ 007d8630 FUN_007d8630 void FUN_007d8630(int param_1) { void *pvVar1; int iVar2; Manager *pMVar3; byte bVar4; Entity_Player *in_ECX; int local_28 [3]; undefined4 local_1c; int local_18 [3]; undefined4 local_c; bVar4 = Entity_Player::HasCollectible(in_ECX,0x2cc,0); pMVar3 = g_manager; if (bVar4 != 0) { in_ECX->_keepersSackBonus = in_ECX->_keepersSackBonus + param_1; pvVar1 = (pMVar3->_itemConfig)._collectibles._begin; if ((0xb30 < (int)((int)(pMVar3->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU)) && (iVar2 = *(int *)((int)pvVar1 + 0xb30), iVar2 != 0)) { local_28[2] = *(undefined4 *)(iVar2 + 0x78); local_28[1] = 0; local_1c = 0; local_28[0] = iVar2; TemporaryEffects::RemoveEffect(&in_ECX->_temporaryeffects,local_28,-1); } pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0xb30 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) ) && (iVar2 = *(int *)((int)pvVar1 + 0xb30), iVar2 != 0)) { local_18[2] = *(undefined4 *)(iVar2 + 0x78); local_18[1] = 0; local_c = 0; local_18[0] = iVar2; TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,local_18,1,1); } } iVar2 = *(int *)((int)g_game->_room + 4); if ((iVar2 != 0) && (*(short *)(iVar2 + 0x48) = *(short *)(iVar2 + 0x48) + (short)param_1, 0x27 < *(ushort *)(iVar2 + 0x48))) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x246); } return; } //@@ 007d8740 Entity_Player::creep_contact_add /* DB: player creep pass of Entity_Effect::Update 005e90d7: +0x2024 = min(+n, 4), +0x2028 = creep flags, EvaluateItems on change (characters_11) */ void __thiscall Entity_Player::creep_contact_add(Entity_Player *this,int param_2,int param_3) { int iVar1; int iVar2; iVar1 = this->_grantedCollectibleCountdown; param_3 = param_3 + iVar1; iVar2 = this->_grantedCollectibleFlags; this->_grantedCollectibleFlags = param_2; if (4 < param_3) { param_3 = 4; } this->_grantedCollectibleCountdown = param_3; if ((0 < iVar1 != 0 < param_3) || (iVar2 != param_2)) { this->_cacheFlags = this->_cacheFlags | 99; EvaluateItems(); } return; } //@@ 007d87a0 Entity_Player::spawn_ghost_corpse /* DB: effect 1000.6 playing the player's Death, before the Lost Curse (alt_path.md) */ undefined4 Entity_Player::spawn_ghost_corpse(void) { byte *pbVar1; undefined4 uVar2; int iVar3; byte bVar4; uint uVar5; Entity *pEVar6; LayerState *pLVar7; byte *pbVar8; Entity *in_ECX; char *pcVar9; ANM2 *this; Vector *pVVar10; bool bVar11; ANM2 local_12c; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00430; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; uVar5 = Random(); pEVar6 = Game::SpawnEx(g_game,1000,6,&in_ECX->_pos,&g_vectorZero,in_ECX,0,uVar5,0); ANM2::ANM2(&local_12c,&in_ECX->_sprite); Isaac::SwapANM2(&pEVar6->_sprite,&local_12c); local_8 = 0; ANM2::Reset(this); AnimationState::~AnimationState(&local_12c._overlayAnimState); AnimationState::~AnimationState(&local_12c._animState); std::string::_Tidy_deallocate(local_12c._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_12c); local_8 = 0xffffffff; pLVar7 = ANM2::GetLayer(&pEVar6->_sprite,(byte *)"ghost"); if (pLVar7 != (LayerState *)0x0) { pLVar7->_visible = 0; } AnimationState::SetAnimationData(&(pEVar6->_sprite)._overlayAnimState,(void *)0x0); (pEVar6->_sprite)._playbackSpeed = 1.0; pbVar1 = (pEVar6->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar8 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar8 = *(byte **)pbVar1; } pcVar9 = "Death"; do { bVar4 = *pbVar8; bVar11 = bVar4 < (byte)*pcVar9; if (bVar4 != *pcVar9) { LAB_007d88c0: uVar5 = -(uint)bVar11 | 1; goto LAB_007d88c5; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar11 = bVar4 < (byte)pcVar9[1]; if (bVar4 != pcVar9[1]) goto LAB_007d88c0; pbVar8 = pbVar8 + 2; pcVar9 = pcVar9 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_007d88c5: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((pEVar6->_sprite)._animState._isPlaying != 0)))) goto LAB_007d88f8; } bVar4 = ANM2::SetAnimation(&pEVar6->_sprite,(byte *)"Death",1); if (bVar4 != 0) { AnimationState::Rewind(&(pEVar6->_sprite)._animState); (pEVar6->_sprite)._animState._isPlaying = 1; } LAB_007d88f8: if ((pEVar6->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar6->_sprite)._animState,6.0); } uVar2 = *(undefined4 *)((int)&pEVar6->_flags + 4); *(uint *)&pEVar6->_flags = (uint)pEVar6->_flags | 0x200000; *(undefined4 *)((int)&pEVar6->_flags + 4) = uVar2; iVar3 = *(int *)pEVar6; *(undefined4 *)&pEVar6[1].field_0x44 = 10; (**(code **)(iVar3 + 0xc))(); pVVar10 = &local_14[7]._charmSource._velocity; if (pVVar10->x != 0.0) { local_14 = (Entity *)pVVar10; std::multiset::erase(&local_14); } pVVar10->x = (float)pEVar6; std::multiset::insert(pVVar10); ExceptionList = local_10; return 1; } //@@ 007d8980 Entity_Player::AddCurseMistEffect /* ZHL [lua] Lua binding EntityPlayer:AddCurseMistEffect prototype: db/protos.zhl */ void __thiscall Entity_Player::AddCurseMistEffect(Entity_Player *this) { void **ppvVar1; uint *puVar2; int iVar3; qword qVar4; uint securityCookie; Entity_Familiar *familiar; void *familiarListData; undefined8 emptyBackup; undefined8 uStack_60; undefined8 local_58; undefined8 uStack_50; undefined4 local_48; undefined4 uStack_44; undefined8 uStack_40; undefined4 local_38; undefined4 tmpBackup; undefined4 local_30; undefined4 local_2c; undefined2 local_28; EntityList_EL familiarList; uint familiarIdx; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *backupEnd; undefined4 *backupSlot; int *familiarEntity; local_8 = 0xffffffff; puStack_c = &LAB_00b0045d; local_10 = ExceptionList; securityCookie = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (this->_hasCurseMistEffect == 0) { if ((this->_backupPlayer != (Entity_Player *)0x0) && (this->_valid != 0)) { AddCurseMistEffect(this->_backupPlayer); } qVar4 = this->_flags; puVar2 = (uint *)((int)&this->_flags + 4); *puVar2 = *puVar2 & 0xfffffffb; this->_cacheFlags = this->_cacheFlags | 0xffff; *(int *)&this->_flags = (int)qVar4; this->_bleedOutHealth = 0; this->_hasCurseMistEffect = 1; UpdateCostumes(this); if (this->_valid != 0) { (this->_consumablesBackup).coins = this->_numCoins; (this->_consumablesBackup).keys = this->_numKeys; (this->_consumablesBackup).bombs = this->_numBombs; (this->_consumablesBackup).goldkey = this->_hasGoldenKey; (this->_consumablesBackup).goldbomb = this->_hasGoldenBomb; (this->_consumablesBackup).gigabombs = this->_numGigaBombs; (this->_consumablesBackup).soulcharges = this->_effectiveSoulCharge; (this->_consumablesBackup).bloodcharges = this->_effectiveBloodCharge; (this->_consumablesBackup).poopmana = this->_poopMana; tmpBackup = 0; local_30 = 0; local_2c = 0; local_28 = 0; familiarList._0_4_ = 0; familiarList._data = (void *)0x0; familiarList._capacity = 0; familiarList._size = 0; restore_curse_mist_backup(&tmpBackup); (this->_curseMistFamiliars)._end = (this->_curseMistFamiliars)._begin; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiarList,3,-1,-1,0,0); local_8 = 0; familiarIdx = 0; if (familiarList._size != 0) { familiarListData = familiarList._data; do { iVar3 = *(int *)(*(int *)((int)familiarListData + familiarIdx * 4) + 0x2c); if (((iVar3 == 0x58) || (iVar3 == 0xca)) || (iVar3 == 0xe7)) { backupSlot = (this->_curseMistFamiliars)._end; emptyBackup = 0; uStack_60 = 0; local_58 = 0; uStack_50 = 0; uStack_40 = 0; local_38 = 0; uStack_44 = 0; local_48 = 0; if (backupSlot == (this->_curseMistFamiliars)._capacity) { vector_PlayerItemBackup_emplace_reallocate(backupSlot,&emptyBackup); familiarListData = familiarList._data; } else { *backupSlot = 0; backupSlot[1] = 0; backupSlot[2] = 0; backupSlot[3] = 0; backupSlot[4] = 0; backupSlot[5] = 0; backupSlot[6] = 0; backupSlot[7] = 0; backupSlot[8] = 0; backupSlot[9] = 0; backupSlot[10] = 0; backupSlot[0xb] = 0; backupSlot[0xc] = 0; ppvVar1 = &(this->_curseMistFamiliars)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x34); } backupEnd = (this->_curseMistFamiliars)._end; familiar = (Entity_Familiar *) __RTDynamicCast(*(undefined4 *)((int)familiarListData + familiarIdx * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0 ); Entity_Familiar::store_backup(familiar,(int)backupEnd + -0x34); familiarEntity = *(int **)((int)familiarList._data + familiarIdx * 4); if (familiarEntity[0xb] == 0xe7) { (**(code **)(*familiarEntity + 0x28))(); } familiarListData = familiarList._data; } familiarIdx = familiarIdx + 1; } while (familiarIdx < (uint)familiarList._size); } local_8 = 0xffffffff; if (familiarList._0_1_ == '\0') { local_8 = 1; tracked_alloc(1,familiarList._data,0); local_8 = 0xffffffff; } } iVar3 = this->_pocketSlots[0]; this->_curseMistPocketSlots[1] = this->_pocketSlots[1]; this->_curseMistPocketSlots[0] = iVar3; this->_pocketSlots[0] = 0; this->_pocketSlots[1] = 1; iVar3 = this->_pocketSlots[2]; this->_curseMistPocketSlots[3] = this->_pocketSlots[3]; this->_curseMistPocketSlots[2] = iVar3; this->_pocketSlots[2] = 0; this->_pocketSlots[3] = 1; iVar3 = this->_pocketSlots[4]; this->_curseMistPocketSlots[5] = this->_pocketSlots[5]; this->_curseMistPocketSlots[4] = iVar3; this->_pocketSlots[4] = 0; this->_pocketSlots[5] = 1; iVar3 = this->_pocketSlots[6]; this->_curseMistPocketSlots[7] = this->_pocketSlots[7]; this->_curseMistPocketSlots[6] = iVar3; this->_pocketSlots[6] = 0; this->_pocketSlots[7] = 1; this->_curseMistTrinkets[0] = this->_trinketsID[0]; iVar3 = this->_trinketsID[1]; this->_trinketsID[0] = 0; this->_curseMistTrinkets[1] = iVar3; this->_trinketsID[1] = 0; EvaluateItems(securityCookie); if (this->_playerType == 0xe) { this->_curseMistRedHearts = this->_redHearts; AddMaxHearts(this,0,0); } } ExceptionList = local_10; return; } //@@ 007d8d20 Entity_Player::RemoveCurseMistEffect /* ZHL [lua] Lua binding EntityPlayer:RemoveCurseMistEffect prototype: db/protos.zhl */ void __thiscall Entity_Player::RemoveCurseMistEffect(Entity_Player *this) { qword qVar1; byte bVar2; uint uVar3; Entity_Player *itemOwner; int iVar4; undefined4 *puVar5; uint *puVar6; uint variantIdx; Entity_Familiar *familiar; int *piVar7; qword *allocatedBytes; int iVar8; uint *key; EntityList_EL familiars; undefined1 lowerBound [8]; void *lowerBoundNode; void *variantCounts; undefined4 variantCountsSize; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; ConsumableData *backup; Game *game; void *savedFamiliars; local_8 = 0xffffffff; puStack_c = &LAB_00b00495; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(lowerBound + 0x24); ExceptionList = &local_10; if (this->_hasCurseMistEffect != 0) { if ((this->_backupPlayer != (Entity_Player *)0x0) && (this->_valid != 0)) { RemoveCurseMistEffect(this->_backupPlayer); } this->_cacheFlags = this->_cacheFlags | 0xffff; this->_hasCurseMistEffect = 0; UpdateCostumes(this); bVar2 = 0; if (this->_valid != 0) { backup = &this->_consumablesBackup; iVar8 = this->_numCoins + backup->coins; itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1a0,(RNG **)&g_game->_playerManager,1); iVar4 = (-(uint)(itemOwner != (Entity_Player *)0x0) & 900) + 99; if (iVar8 < iVar4) { iVar4 = iVar8; } iVar8 = this->_numKeys + (this->_consumablesBackup).keys; backup->coins = iVar4; iVar4 = 99; if (iVar8 < 99) { iVar4 = iVar8; } (this->_consumablesBackup).keys = iVar4; iVar8 = (this->_consumablesBackup).bombs + this->_numBombs; iVar4 = 99; if (iVar8 < 99) { iVar4 = iVar8; } (this->_consumablesBackup).bombs = iVar4; if (((this->_consumablesBackup).goldkey == 0) && (this->_hasGoldenKey == 0)) { bVar2 = 0; } else { bVar2 = 1; } (this->_consumablesBackup).goldkey = bVar2; if (((this->_consumablesBackup).goldbomb == 0) && (this->_hasGoldenBomb == 0)) { bVar2 = 0; } else { bVar2 = 1; } (this->_consumablesBackup).goldbomb = bVar2; local_14 = (this->_consumablesBackup).gigabombs + this->_numGigaBombs; piVar7 = (int *)&local_14; if (iVar4 <= (int)local_14) { piVar7 = &(this->_consumablesBackup).bombs; } iVar8 = this->_effectiveSoulCharge + (this->_consumablesBackup).soulcharges; (this->_consumablesBackup).gigabombs = *piVar7; game = g_game; iVar4 = 99; if (iVar8 < 99) { iVar4 = iVar8; } (this->_consumablesBackup).soulcharges = iVar4; iVar8 = (this->_consumablesBackup).bloodcharges + this->_effectiveBloodCharge; iVar4 = 99; if (iVar8 < 99) { iVar4 = iVar8; } (this->_consumablesBackup).bloodcharges = iVar4; iVar8 = this->_poopMana + (this->_consumablesBackup).poopmana; itemOwner = PlayerManager::FirstBirthrightOwner(&game->_playerManager,0x19); iVar4 = (-(uint)(itemOwner != (Entity_Player *)0x0) & 0x14) + 9; if (iVar8 < iVar4) { iVar4 = iVar8; } (this->_consumablesBackup).poopmana = iVar4; restore_curse_mist_backup(backup); bVar2 = this->_valid; } iVar4 = this->_curseMistPocketSlots[1]; this->_pocketSlots[0] = this->_curseMistPocketSlots[0]; iVar8 = this->_curseMistPocketSlots[2]; this->_pocketSlots[1] = iVar4; iVar4 = this->_curseMistPocketSlots[3]; this->_pocketSlots[2] = iVar8; iVar8 = this->_curseMistPocketSlots[4]; this->_pocketSlots[3] = iVar4; iVar4 = this->_curseMistPocketSlots[5]; this->_pocketSlots[4] = iVar8; iVar8 = this->_curseMistPocketSlots[6]; this->_pocketSlots[5] = iVar4; iVar4 = this->_curseMistPocketSlots[7]; this->_pocketSlots[6] = iVar8; this->_pocketSlots[7] = iVar4; this->_trinketsID[0] = this->_curseMistTrinkets[0]; this->_trinketsID[1] = this->_curseMistTrinkets[1]; if (bVar2 != 0) { ConsumableCountChanged(this,-1); } EvaluateItems(uVar3); savedFamiliars = (this->_curseMistFamiliars)._begin; variantCounts = (void *)0x0; variantCountsSize = 0; variantCounts = operator_new(0x18); *(void **)variantCounts = variantCounts; *(void **)((int)variantCounts + 4) = variantCounts; *(void **)((int)variantCounts + 8) = variantCounts; *(undefined2 *)((int)variantCounts + 0xc) = 0x101; local_8 = 0; if (savedFamiliars != (this->_curseMistFamiliars)._end) { key = (uint *)((int)savedFamiliars + 4); do { _Find_lower_bound<>(lowerBound,key); if (((*(char *)((int)lowerBoundNode + 0xd) != '\0') || (*key < *(uint *)((int)lowerBoundNode + 0x10))) || (lowerBoundNode == variantCounts)) { puVar5 = map_find_value(&variantCounts,(uint)key); *puVar5 = 0; } puVar6 = map_find_value(&variantCounts,(uint)key); uVar3 = *key; variantIdx = *puVar6; local_14 = variantIdx; if (uVar3 == 0xe7) { uVar3 = Random(); Game::Spawn(g_game,3,0xe7,&this->_pos,&g_vectorZero,(Entity *)this,key[1],uVar3); uVar3 = *key; } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,uVar3,-1,0,0); local_8._0_1_ = 1; if (familiars._size != 0) { variantIdx = -(uint)(variantIdx != 0) & variantIdx; uVar3 = familiars._size - 1U; if (variantIdx < familiars._size - 1U) { uVar3 = variantIdx; } familiar = (Entity_Familiar *) __RTDynamicCast(*(undefined4 *)((int)familiars._data + uVar3 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); Menu_Stats::Render((Menu_Stats *)familiar,key + -1); *(uint *)&familiar->_flags = (uint)familiar->_flags | 4; iVar4 = familiar->_variant; *(undefined4 *)((int)&familiar->_flags + 4) = *(undefined4 *)((int)&familiar->_flags + 4); if (iVar4 == 0xca) { familiar->_subtype = key[1]; } variantIdx = local_14; } local_8 = (uint)local_8._1_3_ << 8; if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar3 = *(uint *)((int)familiars._data + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < uVar3); free((uint *)((int)familiars._data + -4)); } local_8 = local_8 & 0xffffff00; } piVar7 = map_find_value(&variantCounts,(uint)key); *piVar7 = variantIdx + 1; puVar6 = key + 0xc; key = key + 0xd; } while (puVar6 != (this->_curseMistFamiliars)._end); } iVar4 = this->_playerType; (this->_curseMistFamiliars)._end = (this->_curseMistFamiliars)._begin; if (iVar4 == 0xe) { bVar2 = 0; iVar4 = GetHeartLimit(this,0); AddMaxHearts(this,iVar4 - this->_maxHearts,bVar2); this->_redHearts = this->_curseMistRedHearts; } FID_conflict__Erase_tree_>_> (&variantCounts, (fuzzer_allocator_> *)&variantCounts, *(_Tree_node **)((int)variantCounts + 4)); operator_delete(variantCounts,0x18); } ExceptionList = local_10; return; } //@@ 007d9180 Entity_Player::AttachMinecart /* ZHL [exact] __thiscall void Entity_Player::AttachMinecart(Entity_NPC * minecart); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Player::AttachMinecart(Entity_Player *this,Entity_NPC *minecart) { EntityPtr *pEVar1; float fVar2; float fVar3; Entity_Player *local_c [2]; pEVar1 = &this->_minecart; if (this->_minecart != (EntityPtr)minecart) { local_c[0] = this; if (this->_minecart != (EntityPtr)0x0) { local_c[0] = (Entity_Player *)pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)minecart; if (minecart != (Entity_NPC *)0x0) { std::multiset::insert(pEVar1); } } fVar2 = (this->_pos).y; fVar3 = (minecart->_targetPosition).y; (this->_minecartOffset).x = (this->_pos).x - (minecart->_targetPosition).x; (this->_minecartOffset).y = fVar2 - fVar3; return; } //@@ 007d9200 Entity_Player::add_samson_berserk_charge /* DB: ECX player, arg added to +0x209c capped 99999; at 100000 resets and adds temp effect collectible 704 Berserk! plus two sounds; callers gate on playerType 27 (Tainted Samson) in TakeDamage and the damage-dealt path of update_item_effects */ void __thiscall Entity_Player::add_samson_berserk_charge(Entity_Player *this,int param_2) { int *piVar1; void *pvVar2; int iVar3; Manager *pMVar4; int *piVar5; int local_1c; int local_18 [3]; undefined4 local_c; param_2 = param_2 + this->_samsonBerserkCharge; piVar1 = &this->_samsonBerserkCharge; *piVar1 = param_2; if (this->_suplexState != 0) { local_1c = 99999; piVar5 = &local_1c; if (param_2 < 100000) { piVar5 = piVar1; } param_2 = *piVar5; *piVar1 = param_2; } if (99999 < param_2) { *piVar1 = 0; pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((0xb00 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 & 0xfffffffcU) ) && (iVar3 = *(int *)((int)pvVar2 + 0xb00), iVar3 != 0)) { local_18[2] = *(undefined4 *)(iVar3 + 0x78); local_18[1] = 0; local_c = 0; local_18[0] = iVar3; TemporaryEffects::AddEffect(&this->_temporaryeffects,local_18,1,1); } pMVar4 = g_manager; local_1c = 0x250; seed_fart_sound_override(&local_1c); SoundEffects::Play(&pMVar4->_sfxManager,local_1c,1.0,2,0,1.0,0.0); pMVar4 = g_manager; local_1c = 0x28a; seed_fart_sound_override(&local_1c); SoundEffects::Play(&pMVar4->_sfxManager,local_1c,1.0,2,0,1.0,0.0); Level::UpdateBackwardsPathStages(g_game->_room); } this->_cacheFlags = this->_cacheFlags | 0x1000; (this->_temporaryeffects)._shouldEvaluateCache = 1; return; } //@@ 007d9360 FUN_007d9360 void FUN_007d9360(void) { float *pfVar1; int in_ECX; float in_XMM1_Da; float local_c; float local_8; if (0.0 <= *(float *)(in_ECX + 0x20a0)) { local_8 = *(float *)(in_ECX + 0x20a0) + in_XMM1_Da; local_c = 1.0; pfVar1 = &local_8; if (1.0 <= local_8) { pfVar1 = &local_c; } *(float *)(in_ECX + 0x20a0) = *pfVar1; } return; } //@@ 007d93b0 Entity_Player::RevivePlayerGhost /* ZHL [exact] __thiscall void Entity_Player::RevivePlayerGhost(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::RevivePlayerGhost(Entity_Player *this) { int iVar1; byte isAnimSet; std_string *ANM2Path; int iVar2; uint seed; Entity_Player *twin; void *configNode; void *configHead; int aiStack_1c [2]; undefined1 lowerBound [8]; void *boundNode; Manager *manager; aiStack_1c[1] = 0x100000; do { this->_isCoopGhost = 0; this->_isInvicible = 0; this->_entityCollisionClass = 4; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); manager = g_manager; _Find_lower_bound<>(lowerBound,aiStack_1c + 1); if ((*(char *)((int)boundNode + 0xd) == '\0') && (*(uint *)((int)boundNode + 0x10) < 0x100001)) { configNode = boundNode; configHead = (manager->_entityConfig)._entities._head; } else { configNode = (manager->_entityConfig)._entities._head; configHead = configNode; } ANM2Path = (std_string *)((int)configNode + 0x8c); if (configNode == configHead) { ANM2Path = (std_string *)0x74; } ANM2::Load(&this->_sprite,ANM2Path,0); update_player_skin(this); if (g_game->_isRestoringGlowingHourglassState == 0) { PlayExtraAnimation(this,(byte *)"Appear"); } this->_damageCooldown = 0x3c; UpdateCostumes(this); iVar2 = this->_ghostPocketSlots[0]; this->_pocketSlots[1] = this->_ghostPocketSlots[1]; iVar1 = this->_ghostPocketSlots[3]; this->_pocketSlots[0] = iVar2; iVar2 = this->_ghostPocketSlots[2]; this->_pocketSlots[3] = iVar1; iVar1 = this->_ghostPocketSlots[5]; this->_pocketSlots[2] = iVar2; iVar2 = this->_ghostPocketSlots[4]; this->_pocketSlots[5] = iVar1; iVar1 = this->_ghostPocketSlots[7]; this->_pocketSlots[4] = iVar2; iVar2 = this->_ghostPocketSlots[6]; this->_pocketSlots[7] = iVar1; this->_pocketSlots[6] = iVar2; this->_trinketsID[0] = this->_ghostTrinkets[0]; this->_trinketsID[1] = this->_ghostTrinkets[1]; this->_cacheFlags = this->_cacheFlags | 0xffff; EvaluateItems(); iVar2 = this->_maxHearts; this->_soulHearts = 0; this->_blackHearts = 0; this->_eternalHearts = 0; this->_boneHeartsMask = 0; this->_boneHearts = 0; this->_rottenHearts = 0; if (iVar2 < 1) { iVar2 = GetHealthType(this); if (iVar2 == 4) { this->_redHearts = 2; AddBoneHearts(this,1); } else { iVar2 = GetHealthType(this); if (iVar2 == 3) { this->_redHearts = 4; this->_maxHearts = 4; } else { iVar2 = GetHealthType(this); this->_redHearts = 0; this->_soulHearts = (uint)(iVar2 != 2) * 2 + 1; } } } else { if (3 < iVar2) { iVar2 = 3; } this->_redHearts = iVar2; iVar2 = GetHealthType(this); if (iVar2 == 3) { this->_redHearts = 2; } } manager = g_manager; aiStack_1c[0] = 0x50; seed_fart_sound_override(aiStack_1c); SoundEffects::Play(&manager->_sfxManager,aiStack_1c[0],1.0,2,0,1.0,0.0); seed = Random(); Game::SpawnEx(g_game,1000,0xf,&this->_pos,&g_vectorZero,(Entity *)0x0,0,seed,0); if (this->_playerType == 0x23) { twin = InitTwin(this,0x28); InitPostLevelInitStats(twin); twin->_isPlayingItemAnimation = 0; ANM2::Reset(&twin->_bodySprite); (twin->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(twin->_sprite)._overlayAnimState,(void *)0x0); isAnimSet = ANM2::SetAnimation(&twin->_sprite,(byte *)"Appear",1); if (isAnimSet != 0) { AnimationState::Rewind(&(twin->_sprite)._animState); (twin->_sprite)._animState._isPlaying = 1; } twin->_isPlayingExtraAnimation = 1; twin->_isPlayingItemAnimation = 0; twin->_damageCooldown = 0x3c; } this = this->_backupPlayer; } while ((this != (Entity_Player *)0x0) && (this->_isCoopGhost != 0)); return; } //@@ 007d96f0 Entity_Player::MorphToCoopGhost /* ZHL [exact] __thiscall void Entity_Player::MorphToCoopGhost(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::MorphToCoopGhost(Entity_Player *this) { qword qVar1; byte isAnimChanged; uint uVar2; int secondTrinket; int iVar3; qword *allocCounter; uint i; EntityList_EL itemWisps; EntityList_EL wisps; EntityPtr *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Player *backupPlayer; Game *game; EntityPtr *twinRef; int *wisp; void *wispData; local_8 = 0xffffffff; puStack_c = &LAB_00b004d5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (this->_playerType != 0x28) { if (this->_playerType == 0x23) { twinRef = &this->_twinPlayer; if ((this->_twinPlayer != (EntityPtr)0x0) && (PlayerManager::RemoveCoPlayer (&g_game->_playerManager,(Entity_Player *)this->_twinPlayer, (byte)&g_game->_playerManager), *twinRef != (EntityPtr)0x0)) { local_14 = twinRef; std::multiset::erase(&local_14); *twinRef = (EntityPtr)0x0; } } Revive(this); if ((this->_playerType == 0x11) && (this->_forgottenBody != (void *)0x0)) { SwapForgottenForm(this,1,0); } TemporaryEffects::RemoveNullEffect(&this->_temporaryeffects,0x70,1); if (1 < *(int *)&g_game->_deathmatchManager) { (**(code **)(*(int *)(g_game->_deathmatchManager)._type + 0x60))(this,uVar2); } UpdateCostumes(this); if (this->_hasCurseMistEffect == 0) { iVar3 = this->_pocketSlots[1]; this->_ghostPocketSlots[0] = this->_pocketSlots[0]; this->_ghostPocketSlots[1] = iVar3; this->_pocketSlots[0] = 0; this->_pocketSlots[1] = 1; iVar3 = this->_pocketSlots[3]; this->_ghostPocketSlots[2] = this->_pocketSlots[2]; this->_ghostPocketSlots[3] = iVar3; this->_pocketSlots[2] = 0; this->_pocketSlots[3] = 1; iVar3 = this->_pocketSlots[5]; this->_ghostPocketSlots[4] = this->_pocketSlots[4]; this->_ghostPocketSlots[5] = iVar3; this->_pocketSlots[4] = 0; this->_pocketSlots[5] = 1; iVar3 = this->_pocketSlots[7]; this->_ghostPocketSlots[6] = this->_pocketSlots[6]; this->_ghostPocketSlots[7] = iVar3; this->_pocketSlots[6] = 0; this->_pocketSlots[7] = 1; iVar3 = this->_trinketsID[0]; secondTrinket = this->_trinketsID[1]; this->_trinketsID[0] = 0; this->_trinketsID[1] = 0; } else { iVar3 = this->_curseMistPocketSlots[1]; this->_ghostPocketSlots[0] = this->_curseMistPocketSlots[0]; this->_ghostPocketSlots[1] = iVar3; this->_curseMistPocketSlots[0] = 0; this->_curseMistPocketSlots[1] = 1; iVar3 = this->_curseMistPocketSlots[3]; this->_ghostPocketSlots[2] = this->_curseMistPocketSlots[2]; this->_ghostPocketSlots[3] = iVar3; this->_curseMistPocketSlots[2] = 0; this->_curseMistPocketSlots[3] = 1; iVar3 = this->_curseMistPocketSlots[5]; this->_ghostPocketSlots[4] = this->_curseMistPocketSlots[4]; this->_ghostPocketSlots[5] = iVar3; this->_curseMistPocketSlots[4] = 0; this->_curseMistPocketSlots[5] = 1; iVar3 = this->_curseMistPocketSlots[7]; this->_ghostPocketSlots[6] = this->_curseMistPocketSlots[6]; this->_ghostPocketSlots[7] = iVar3; this->_curseMistPocketSlots[6] = 0; this->_curseMistPocketSlots[7] = 1; iVar3 = this->_curseMistTrinkets[0]; secondTrinket = this->_curseMistTrinkets[1]; this->_curseMistTrinkets[0] = 0; this->_curseMistTrinkets[1] = 0; } this->_ghostTrinkets[0] = iVar3; this->_ghostTrinkets[1] = secondTrinket; reset_body_sprite(this); this->_isPlayingItemAnimation = 0; ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); isAnimChanged = ANM2::SetAnimation(&this->_sprite,(byte *)"GhostAppear",1); if (isAnimChanged != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } game = g_game; this->_isPlayingExtraAnimation = 1; this->_isPlayingItemAnimation = 0; if (1 < *(int *)&game->_deathmatchManager) { this->_entityCollisionClass = 0; } this->_entityGridCollisionClass = 3; this->_cacheFlags = this->_cacheFlags | 0xffff; this->_isCoopGhost = 1; this->_isInvicible = 1; this->_visible = 1; EvaluateItems(); EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&wisps,3,0xce,-1,0,0); wispData = wisps._data; local_8 = 0; i = 0; uVar2 = wisps._size; if (wisps._size != 0) { do { wisp = *(int **)((int)wispData + i * 4); if ((Entity_Player *)wisp[0x104] == this) { (**(code **)(*wisp + 0x28))(); uVar2 = wisps._size; } i = i + 1; } while (i < uVar2); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&itemWisps,3,0xed,-1,0,0); local_8 = CONCAT31(local_8._1_3_,1); i = 0; uVar2 = itemWisps._size; if (itemWisps._size != 0) { do { wisp = *(int **)((int)itemWisps._data + i * 4); if ((Entity_Player *)wisp[0x104] == this) { (**(code **)(*wisp + 0x28))(); uVar2 = itemWisps._size; } i = i + 1; } while (i < uVar2); } if (itemWisps._0_1_ == '\0') { allocCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (itemWisps._data != (void *)0x0) { uVar2 = *(uint *)((int)itemWisps._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar2); free((void *)((int)itemWisps._data + -4)); } } local_8 = 0xffffffff; if (wisps._0_1_ == '\0') { allocCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (wisps._data != (void *)0x0) { uVar2 = *(uint *)((int)wisps._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar2); free((uint *)((int)wisps._data + -4)); } } local_8 = 0xffffffff; backupPlayer = this->_backupPlayer; if ((backupPlayer != (Entity_Player *)0x0) && (backupPlayer->_isCoopGhost == 0)) { MorphToCoopGhost(backupPlayer); } } ExceptionList = local_10; return; } //@@ 007d9b70 Entity_Player::reset_body_sprite /* DB: loads entity 1.0.0 anm2, replaces sheets per player type prototype: db/protos.zhl */ void __thiscall Entity_Player::reset_body_sprite(Entity_Player *this) { ANM2 *this_00; Manager *pMVar1; EntityConfig_Entity *pEVar2; int iVar3; int extraout_ECX; uint layerId; int iVar4; undefined1 local_18 [8]; void *local_10; Entity_Player *local_c; Manager *local_8; pMVar1 = g_manager; local_8 = (Manager *)0x100100; local_c = this; _Find_lower_bound<>(local_18,&local_8); if (((*(char *)((int)local_10 + 0xd) == '\0') && (*(uint *)((int)local_10 + 0x10) < 0x100101)) && (local_10 != (pMVar1->_entityConfig)._entities._head)) { pEVar2 = (EntityConfig_Entity *)((int)local_10 + 0x18); } else { pEVar2 = EntityConfig::GetEntity(&pMVar1->_entityConfig,1,0,0); } this_00 = &this->_sprite; ANM2::Load(this_00,&pEVar2->anm2Path,0); iVar4 = this->_playerType; iVar3 = 0x3c; if ((iVar4 == 4) || (iVar4 == 0x19)) { iVar3 = 0x3e; } else if (((iVar4 == 0xe) || (iVar4 == 0x21)) || ((iVar4 == 0xf || (((iVar4 == 0x22 || (iVar4 == 0x10)) || (iVar4 == 0x23)))))) { iVar3 = 0x3f; } else if (((iVar4 == 7) || (iVar4 == 0x1c)) || ((iVar4 == 0xd || (iVar4 == 0x20)))) { iVar3 = 0x3d; } layerId = 0; local_8 = g_manager; if ((this->_sprite)._layerCount != 0) { iVar4 = iVar3 * 0x38; do { Sprite::ReplaceSpritesheet ((Sprite *)this_00,layerId, (std_string *)((int)(local_8->_entityConfig)._babies._begin + iVar4 + 0x1c)); layerId = layerId + 1; iVar3 = extraout_ECX; } while (layerId < (uint)(local_c->_sprite)._layerCount); } ANM2::LoadGraphics(this_00,(byte)iVar3); return; } //@@ 007d9ca0 FUN_007d9ca0 uint FUN_007d9ca0(void) { int iVar1; code *pcVar2; uint uVar3; int in_ECX; uint *puVar4; iVar1 = *(int *)(in_ECX + 0x177c); puVar4 = (uint *)(iVar1 + 0x610); uVar3 = *puVar4; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *puVar4; if (uVar3 == 0) { pcVar2 = (code *)swi(3); uVar3 = (*pcVar2)(); return uVar3; } } uVar3 = uVar3 >> ((byte)*(undefined4 *)(iVar1 + 0x614) & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)*(undefined4 *)(iVar1 + 0x618) & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)*(undefined4 *)(iVar1 + 0x61c) & 0x1f) ^ uVar3; *puVar4 = uVar3; *(short *)(in_ECX + 0x1380) = (short)(uVar3 % 7) + 6; return uVar3 / 7; } //@@ 007d9d00 Entity_Player::CalculateBagOfCraftingOutput /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static BagOfCraftingOutput* Entity_Player::CalculateBagOfCraftingOutput(BagOfCraftingOutput* implicit_output, BagOfCraftingPickup* bagContent, bool unused); prototype: db/protos.zhl, confirmed by RET 12 */ uint * Entity_Player::CalculateBagOfCraftingOutput(uint *output,byte *bagContent,byte unused) { int iVar1; code *pcVar2; byte pickup4; ItemConfig_Item *recipeItem; uint *puVar4; uint uVar5; int iVar6; int iVar7; uint weightCount; void *pvVar8; Game *game; std_vector *psVar9; undefined4 *puVar10; float fVar11; float fVar12; int itemWeightsEnd; void *itemWeightsCapacityEnd; uint seed; uint local_7c; int maxQuality; int minQuality; void *local_70; float totalWeight; std_vector *local_68; byte *local_64; undefined8 *local_60; undefined4 *local_5c; void *poolWeights; undefined4 *poolWeightsEnd; undefined4 *poolWeightsCapacityEnd; uint local_4c; float local_48; uint pickupCounts; uint uStack_40; uint uStack_3c; uint uStack_38; undefined8 local_34; uint local_2c; undefined2 local_28; undefined1 local_26; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; byte pickup2; byte pickup3; byte pickup4; byte pickup5; byte pickup6; byte pickup7; char *pickupCountSlot; manager = g_manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b00518; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_64 = bagContent; FUN_00753660(&local_4c,bagContent); recipeItem = ItemConfig::GetCollectible(&manager->_itemConfig,local_4c); if ((recipeItem == (ItemConfig_Item *)0x0) || (pickup4 = Item::IsAvailable(recipeItem,0xffffffff), pickup4 == 0)) { local_4c = 0; local_48 = -NAN; } if (local_4c == 0) { pickupCounts = 0; uStack_40 = 0; uStack_3c = 0; uStack_38 = 0; local_2c = 0; local_34 = 0; pickup4 = *local_64; pickup3 = local_64[3]; pickup4 = local_64[4]; pickup5 = local_64[5]; local_28 = 0; local_26 = 0; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup4); *pickupCountSlot = *pickupCountSlot + '\x01'; local_68 = (std_vector *)(uint)local_64[1]; poolWeights = (void *)0x0; poolWeightsEnd = (undefined4 *)0x0; *(char *)((int)&pickupCounts + (int)local_68) = *(char *)((int)&pickupCounts + (int)local_68) + '\x01'; pickup2 = local_64[2]; pickup6 = local_64[6]; poolWeightsCapacityEnd = (undefined4 *)0x0; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup2); *pickupCountSlot = *pickupCountSlot + '\x01'; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup3); *pickupCountSlot = *pickupCountSlot + '\x01'; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup4); *pickupCountSlot = *pickupCountSlot + '\x01'; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup5); *pickupCountSlot = *pickupCountSlot + '\x01'; pickup7 = local_64[7]; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup6); *pickupCountSlot = *pickupCountSlot + '\x01'; pickupCountSlot = (char *)((int)&pickupCounts + (uint)pickup7); *pickupCountSlot = *pickupCountSlot + '\x01'; iVar6 = *(int *)(&DAT_00b6ba30 + (uint)pickup7 * 4) + *(int *)(&DAT_00b6ba30 + (uint)pickup6 * 4) + *(int *)(&DAT_00b6ba30 + (uint)pickup5 * 4) + *(int *)(&DAT_00b6ba30 + (uint)pickup4 * 4) + *(int *)(&DAT_00b6ba30 + (uint)pickup3 * 4) + *(int *)(&DAT_00b6ba30 + (uint)pickup2 * 4) + *(int *)(&DAT_00b6ba30 + (int)local_68 * 4) + *(int *)(&DAT_00b6ba30 + (uint)pickup4 * 4); local_14 = 0; local_4c = 0; local_48 = 1.0; FUN_007dd690(0,&local_4c); local_4c = 1; local_48 = 2.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 1; poolWeightsEnd[1] = 0x40000000; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 2; local_48 = 2.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 2; poolWeightsEnd[1] = 0x40000000; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 4; local_48 = (float)(uStack_40 & 0xff) * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 4; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 3; local_48 = (float)(pickupCounts >> 0x18) * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 3; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 5; local_48 = (float)(uStack_40 >> 0x10 & 0xff) * 5.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 5; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 8; local_48 = (float)(uStack_40 >> 8 & 0xff) * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 8; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 0xc; local_48 = (float)(uStack_40 >> 0x18) * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 0xc; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 9; local_48 = (float)(local_2c >> 8 & 0xff) * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 9; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } local_4c = 7; local_48 = (float)local_28._1_1_ * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 7; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } if ((pickupCounts >> 8 & 0xff) + (uStack_3c & 0xff) + (uStack_38 & 0xff) + (uStack_38 >> 0x18) == 0) { local_4c = 0x1a; local_48 = (float)local_34._7_1_ * 10.0; if (poolWeightsEnd == poolWeightsCapacityEnd) { local_5c = poolWeightsEnd; FUN_007dd690(poolWeightsEnd,&local_4c); } else { *poolWeightsEnd = 0x1a; poolWeightsEnd[1] = local_48; poolWeightsEnd = poolWeightsEnd + 2; } } game = g_game; seed = (g_game->_seedEffects)._gameStartSeed; local_5c = poolWeightsEnd; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); seed = (game->_seedEffects)._gameStartSeed; } local_70 = (void *)0x0; psVar9 = (std_vector *)(1 - (int)&pickupCounts); local_60 = &DAT_00b1f4d4; local_7c = 0x1f; local_68 = psVar9; do { if (*(char *)((int)&pickupCounts + (int)local_70) != '\0') { if (0x50 < (uint)((int)&pickupCounts + (int)&psVar9->_begin + (int)local_70)) { KAGE_LogMessage(0x10,(byte *)"RNG: Invalid ShiftIdx\n"); } local_64 = (byte *)0x0; do { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); puVar4 = (uint *)(*pcVar2)(); return puVar4; } seed = seed >> ((byte)*local_60 & 0x1f) ^ seed; seed = seed << ((byte)((ulonglong)*local_60 >> 0x20) & 0x1f) ^ seed; seed = seed >> ((byte)*(undefined4 *)(local_60 + 1) & 0x1f) ^ seed; local_64 = local_64 + 1; } while (local_64 < (byte *)(uint)*(byte *)((int)&pickupCounts + (int)local_70)); psVar9 = local_68; } puVar10 = local_5c; local_60 = (undefined8 *)((int)local_60 + 0xc); local_70 = (void *)((int)local_70 + 1); local_7c = local_7c + -1; } while (local_7c != 0); local_48 = 2.8026e-44; local_34 = 0x1500000001; local_68 = (std_vector *)0x0; local_70 = (void *)0x0; local_64 = (byte *)((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2); itemWeightsEnd = 0; itemWeightsCapacityEnd = (void *)0x0; if (local_64 != (byte *)0x0) { if (0x3fffffff < local_64) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar5 = (int)local_64 * 4; local_70 = std::_Allocate(uVar5); itemWeightsCapacityEnd = (void *)((int)local_70 + uVar5); itemWeightsEnd = std::fill_n<4byte>(local_70,local_64,&local_68); } local_14 = CONCAT31(local_14._1_3_,1); totalWeight = 0.0; puVar10 = (undefined4 *)((int)puVar10 - (int)poolWeights >> 3); local_64 = (byte *)0x0; pvVar8 = poolWeights; local_5c = puVar10; if (puVar10 != (undefined4 *)0x0) { do { fVar11 = *(float *)((int)pvVar8 + (int)local_64 * 8 + 4); if (0.0 < fVar11) { iVar1 = *(int *)((int)pvVar8 + (int)local_64 * 8); if (((iVar1 == 4) || (iVar1 == 3)) || (iVar7 = iVar6, iVar1 == 5)) { iVar7 = iVar6 + -5; } minQuality = 0; maxQuality = 1; if (iVar7 < 0x23) { if (iVar7 < 0x1f) { if (iVar7 < 0x1b) { if (iVar7 < 0x17) { if (iVar7 < 0x13) { if (iVar7 < 0xf) { if (iVar7 < 9) goto LAB_007da41c; minQuality = 0; } else { minQuality = 1; } maxQuality = 2; } else { maxQuality = 3; minQuality = 2; } } else { maxQuality = 4; minQuality = 2; } } else { maxQuality = 4; minQuality = 3; } } else { maxQuality = 4; minQuality = 3; } } else { maxQuality = 4; minQuality = 4; } LAB_007da41c: local_7c = 0; local_68 = &(g_game->_itemPool)._pools[iVar1]._poolList; pvVar8 = local_68->_begin; iVar7 = (int)local_68->_end - (int)pvVar8; iVar1 = iVar7 >> 0x1f; if (iVar7 / 0x18 + iVar1 == iVar1) { pvVar8 = poolWeights; } else { local_60 = (undefined8 *)0x0; game = g_game; do { uVar5 = *(uint *)((int)pvVar8 + (int)local_60); if (game == (Game *)0x0) { if (-1 < (int)uVar5) goto LAB_007da49b; } else { if ((int)uVar5 < 0) { if (((int)uVar5 < 0) && (pvVar8 = (game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar5 < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar8 >> 2)) { pvVar8 = (void *)**(undefined4 **)((int)pvVar8 + ~uVar5 * 4); } else { pvVar8 = (void *)0x0; } LAB_007da4b3: if (((pvVar8 != (void *)0x0) && (pickup4 = Item::IsAvailable(pvVar8,1), pickup4 != 0)) && ((minQuality <= *(int *)((int)pvVar8 + 0xc4) && (*(int *)((int)pvVar8 + 0xc4) <= maxQuality)))) { fVar12 = fVar11 * *(float *)((int)local_60 + (int)local_68->_begin + 4); totalWeight = fVar12 + totalWeight; *(float *)((int)local_70 + *(int *)((int)pvVar8 + 4) * 4) = fVar12 + *(float *)((int)local_70 + *(int *)((int)pvVar8 + 4) * 4); } } else { LAB_007da49b: pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)uVar5 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2) { pvVar8 = *(void **)((int)pvVar8 + uVar5 * 4); goto LAB_007da4b3; } } game = g_game; } local_60 = local_60 + 3; local_7c = local_7c + 1; pvVar8 = local_68->_begin; } while (local_7c < (uint)(((int)local_68->_end - (int)pvVar8) / 0x18)); pvVar8 = poolWeights; puVar10 = local_5c; } } local_64 = (byte *)((int)local_64 + 1); } while (local_64 < puVar10); } local_5c = (undefined4 *)0x19; game = g_game; if (0.0 < totalWeight) { local_68 = (std_vector *)0x0; do { local_5c = (undefined4 *)0x19; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); puVar4 = (uint *)(*pcVar2)(); return puVar4; } seed = seed >> ((byte)local_34 & 0x1f) ^ seed; seed = seed << ((byte)((ulonglong)local_34 >> 0x20) & 0x1f) ^ seed; seed = seed >> (SUB41(local_48,0) & 0x1f) ^ seed; weightCount = itemWeightsEnd - (int)local_70 >> 2; uVar5 = 0; fVar11 = (float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10 * totalWeight; if (weightCount != 0) { do { fVar12 = *(float *)((int)local_70 + uVar5 * 4); if (fVar11 < fVar12) { local_5c = (undefined4 *)uVar5; goto LAB_007da627; } uVar5 = uVar5 + 1; fVar11 = fVar11 - fVar12; } while (uVar5 < weightCount); } LAB_007da627: if (game == (Game *)0x0) { if (-1 < (int)local_5c) goto LAB_007da666; } else { if ((int)local_5c < 0) { iVar6 = -1 - (int)local_5c; if ((iVar6 < 0) || (pvVar8 = (game->_proceduralItemManager)._proceduralItems._begin, (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar8 >> 2 <= iVar6 )) { pvVar8 = (void *)0x0; } else { pvVar8 = (void *)**(undefined4 **)((int)pvVar8 + iVar6 * 4); } } else { LAB_007da666: pvVar8 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar8 >> 2 <= (int)local_5c ) goto LAB_007da698; pvVar8 = *(void **)((int)pvVar8 + (int)local_5c * 4); } if (pvVar8 != (void *)0x0) { pickup4 = Item::IsAvailable(pvVar8,6); game = g_game; if (pickup4 != 0) break; } } LAB_007da698: local_68 = (std_vector *)((int)&local_68->_begin + 1); local_5c = (undefined4 *)0x19; } while ((int)local_68 < 0x14); } uVar5 = ItemPool::GetFirstItemPoolForCollectible(&game->_itemPool,(int)local_5c); *output = (uint)local_5c; output[1] = uVar5; if (local_70 != (void *)0x0) { uVar5 = (int)itemWeightsCapacityEnd - (int)local_70 & 0xfffffffc; pvVar8 = local_70; if (0xfff < uVar5) { pvVar8 = *(void **)((int)local_70 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_70 + (-4 - (int)pvVar8))) goto LAB_007da72b; } operator_delete(pvVar8,uVar5); } if (poolWeights != (void *)0x0) { uVar5 = (int)poolWeightsCapacityEnd - (int)poolWeights & 0xfffffff8; pvVar8 = poolWeights; if (0xfff < uVar5) { pvVar8 = *(void **)((int)poolWeights + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)poolWeights + (-4 - (int)pvVar8))) { LAB_007da72b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar5); } } else { output[1] = (uint)local_48; *output = local_4c; } ExceptionList = local_1c; return output; } //@@ 007da770 FUN_007da770 uint FUN_007da770(void) { byte bVar1; undefined3 extraout_var; uint uVar2; Entity_Player *in_ECX; uVar2 = in_ECX->_playerType; if ((uVar2 == 3) || (uVar2 == 0xc)) { bVar1 = Entity_Player::HasCollectible(in_ECX,0x26b,0); uVar2 = CONCAT31(extraout_var,bVar1); if (bVar1 != 0) { return CONCAT31(extraout_var,1); } } return uVar2 & 0xffffff00; } //@@ 007da7a0 FUN_007da7a0 undefined4 FUN_007da7a0(uint param_1) { int id; ItemConfig_Item *pIVar1; int in_ECX; if (param_1 < 4) { id = *(int *)((param_1 + 0xac) * 0x20 + in_ECX); if (id != 0) { if ((((id < (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) && (id != 0xeb)) && (id != 0x2b)) && (id != 0x3d)) { pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,id); if (((pIVar1 != (ItemConfig_Item *)0x0) && (id != 0x248)) && (id != 0x3b)) { return 0; } } } } return 1; } //@@ 007da810 Entity_Player::SpawnClot /* ZHL [exact] __thiscall void Entity_Player::SpawnClot(Vector * pos, bool unk); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::SpawnClot(Entity_Player *this,Vector *pos,byte unk) { undefined4 uVar1; char isBoneHeart; int iVar2; float blackHeartMask; uint uVar3; uint angleRoll; Entity *bloodSplat; int minRedHearts; int extraout_EDX; int iVar4; uint uVar5; float local_18; Entity *local_14; Vector clotVelocity; Game *game; Manager *manager; iVar2 = GetHealthType(this); game = g_game; if (0 < this->_goldenHearts) { iVar2 = this->_goldenHearts + -1; this->_goldenHearts = iVar2; if (((*(int *)&game->_deathmatchManager < 2) && (this->_dead == 0)) && (0 < iVar2)) { iVar4 = this->_redHearts; if (this->_maxHearts < this->_redHearts) { iVar4 = this->_maxHearts; } iVar4 = (iVar4 + 1) / 2 + (this->_soulHearts + 1) / 2 + this->_boneHearts; if (iVar4 < iVar2) { BreakGoldenHearts(this,iVar2 - iVar4); this->_goldenHearts = iVar4; } } uVar5 = 4; goto LAB_007daaa6; } if (0 < this->_eternalHearts) { this->_eternalHearts = this->_eternalHearts + -1; UpdateHeartDependentEffects(this); uVar5 = 3; goto LAB_007daaa6; } iVar4 = this->_redHearts; if ((iVar4 < 1) || (this->_boneHearts + this->_soulHearts < 1)) { if (unk == 0) { minRedHearts = (iVar2 == 3) + 1; } else { minRedHearts = 0; } if (iVar4 - this->_rottenHearts <= minRedHearts) { iVar2 = this->_boneHearts; uVar5 = this->_soulHearts; if ((int)(iVar2 + uVar5) <= (int)(unk ^ 1)) { return; } if ((0 < iVar2) && (isBoneHeart = IsBoneHeart(this,((int)(uVar5 + 1) >> 1) + iVar2 + -1), isBoneHeart != '\0') ) { AddBoneHearts(this,-1); uVar5 = 5; goto LAB_007daaa6; } iVar2 = GetHealthType(this); if ((iVar2 == 2) && (unk != 0)) { this->_soulHearts = 0; } else { if (0 < (int)uVar5) { uVar3 = uVar5 & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } if (uVar3 != 1) goto LAB_007daa01; blackHeartMask = (float)this->_blackHearts; if (((uint)blackHeartMask & 1 << ((byte)((int)(uVar5 - 1) / 2) & 0x1f)) == 0) goto LAB_007daa0d; LAB_007daa69: this->_blackHearts = (uint)blackHeartMask & ~(1 << (uVar5 >> 1 & 0x1f)); ClampGoldenHearts(this,0); update_bone_hearts(this); LAB_007daa84: AddSoulHearts(this,-1,0); uVar5 = 2; goto LAB_007daaa6; } LAB_007daa01: if (0 < (int)uVar5) { LAB_007daa0d: uVar3 = uVar5 - 1; if (((int)uVar3 <= (int)uVar5) && (0 < (int)uVar3)) { uVar3 = uVar3 & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } if (uVar3 == 1) { blackHeartMask = (float)this->_blackHearts; local_18 = blackHeartMask; if (((uint)blackHeartMask & 1 << ((byte)((int)(uVar5 - 2) / 2) & 0x1f)) != 0) { uVar3 = uVar5 & 0x80000001; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffe) + 1; } if ((uVar3 == 1) && (-1 < (int)uVar5)) goto LAB_007daa69; goto LAB_007daa84; } } } } AddSoulHearts(this,-1,0); } uVar5 = 1; goto LAB_007daaa6; } } if (this->_rottenHearts < 1) { uVar5 = 0; iVar4 = 2; if (iVar2 != 3) { iVar4 = 1; } iVar2 = scale_for_hard_difficulty(iVar4); this->_redHearts = extraout_EDX - iVar2; UpdateHeartDependentEffects(this); } else { this->_rottenHearts = this->_rottenHearts + -1; iVar2 = 0x10; uVar5 = 6; if (*(int *)&g_game->_deathmatchManager < 2) { iVar2 = 2; } this->_redHearts = iVar4 - iVar2; UpdateHeartDependentEffects(this); } LAB_007daaa6: uVar3 = Random(); angleRoll = Random(); local_18 = (float)((double)(int)angleRoll + __uint_to_double_fixup[-((int)angleRoll >> 0x1f)]) * 2.3283064e-10 * 3.14; local_18 = local_18 + local_18; local_14 = (Entity *)cos(local_18); clotVelocity.y = sin(local_18); clotVelocity.x = (float)local_14 + (float)local_14; clotVelocity.y = clotVelocity.y + clotVelocity.y; local_14 = Game::SpawnEx(g_game,3,0xee,pos,&clotVelocity,(Entity *)this,uVar5,uVar3,0); uVar1 = *(undefined4 *)((int)&local_14->_flags + 4); iVar2 = *(int *)local_14; *(uint *)&local_14->_flags = (uint)local_14->_flags & 0xfffffffb; *(undefined4 *)((int)&local_14->_flags + 4) = uVar1; (**(code **)(iVar2 + 0xc))(); manager = g_manager; local_18 = 1.00893e-43; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,(int)local_18,1.0,2,0,1.0,0.0); uVar5 = Random(); bloodSplat = Game::SpawnEx(g_game,1000,2,pos,&g_vectorZero,(Entity *)0x0,2,uVar5,0); (**(code **)(*(int *)bloodSplat + 0x3c))(&local_14->_splatColor,0xffffffff,0xff,0,1); iVar2 = *(int *)bloodSplat; (bloodSplat->_sprite)._offset.x = 0.0; (bloodSplat->_sprite)._offset.y = -6.0; bloodSplat->_renderDepthOffset = 10.0; (**(code **)(iVar2 + 0xc))(); if (unk != 0) { try_trigger_astral_projection(this); } return; } //@@ 007dac30 FUN_007dac30 undefined4 FUN_007dac30(void) { int in_ECX; if ((((*(int *)(in_ECX + 0x194c) < 1) && (*(int *)(in_ECX + 0x1348) < 1)) && ((*(int *)(in_ECX + 0x1344) < 1 || (*(int *)(in_ECX + 0x1d88) + *(int *)(in_ECX + 0x134c) < 1) ))) && ((*(int *)(in_ECX + 0x1344) - *(int *)(in_ECX + 0x1da4) < 2 && (*(int *)(in_ECX + 0x1d88) + *(int *)(in_ECX + 0x134c) < 2)))) { return 0; } return 1; } //@@ 007dac80 Entity_Player::TryForgottenThrow /* ZHL [exact] __thiscall bool Entity_Player::TryForgottenThrow(Vector * dir); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Player::TryForgottenThrow(Entity_Player *this,Vector *dir) { EntityPtr this_00; float *extraout_EAX; Vector local_20; Vector local_18; Vector local_10; if ((((this->_playerType == 0x23) && (this_00 = this->_twinPlayer, this_00 != (EntityPtr)0x0)) && (*(void **)((int)this_00 + 0x1410) == this)) && (this->_peeBurstCooldown < 1)) { Vector::Normalized(dir,&local_18); local_20.x = local_18.x * 10.0; local_20.y = local_18.y * 10.0; GetTearMovementInheritance((Entity_Player *)this_00,&local_10,&local_18,0); local_20.x = (local_20.x + *extraout_EAX) * 1.2; local_20.y = (extraout_EAX[1] + local_20.y) * 1.2; ThrowHeldEntity((Entity_Player *)this_00,&local_20); ANM2::Reset((ANM2 *)((int)this_00 + 0xff8)); *(int *)((int)this_00 + 0x1338) = 1; *(int *)((int)this_00 + 0x1604) = 5; PlayExtraAnimation((Entity_Player *)this_00,(byte *)"HideItem"); return 1; } return 0; } //@@ 007dad80 FUN_007dad80 void FUN_007dad80(void) { void **ppvVar1; int *piVar2; undefined4 *puVar3; Game *pGVar4; Entity_Player *pEVar5; byte bVar6; ItemConfig_Item *pIVar7; Entity_Player *in_ECX; Entity_Player *this; int *piVar8; Entity_Player *local_c [2]; (in_ECX->_greedResetCollectibles)._end = (in_ECX->_greedResetCollectibles)._begin; local_c[0] = in_ECX; if (in_ECX->_variant == 0) { while (pEVar5 = local_c[0], local_c[0]->_isCoopGhost == 0) { piVar8 = (local_c[0]->_history)._historyItems._begin; this = local_c[0]; if (piVar8 != (local_c[0]->_history)._historyItems._end) { do { if (((char)piVar8[1] == '\0') && (piVar8[6] != -1)) { pIVar7 = ItemConfig::GetCollectible(&g_manager->_itemConfig,piVar8[2]); pGVar4 = g_game; if ((pIVar7 == (ItemConfig_Item *)0x0) || ((pIVar7->tags & 0x8000) == 0)) { if (0 < *piVar8) { ItemPool::ResetCollectible(&g_game->_itemPool,piVar8[2]); *(short *)((int)(&pGVar4->_itemPool + 1) + piVar8[6] * 2 + 0x4c) = *(short *)((int)(&pGVar4->_itemPool + 1) + piVar8[6] * 2 + 0x4c) + 1; this = local_c[0]; } } else { piVar2 = (pEVar5->_greedResetCollectibles)._end; if (piVar2 == (pEVar5->_greedResetCollectibles)._capacity) { std::vector::_Emplace_reallocate(piVar2,piVar8 + 2); } else { *piVar2 = piVar8[2]; ppvVar1 = &(pEVar5->_greedResetCollectibles)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } } } piVar8 = piVar8 + 7; } while (piVar8 != (this->_history)._historyItems._end); } bVar6 = Entity_Player::HasCollectible(this,0x3b,0); if (bVar6 != 0) { puVar3 = (pEVar5->_greedResetCollectibles)._end; local_c[0] = (Entity_Player *)0x33; if (puVar3 == (pEVar5->_greedResetCollectibles)._capacity) { std::vector::_Emplace_reallocate(puVar3,local_c); } else { *puVar3 = 0x33; ppvVar1 = &(pEVar5->_greedResetCollectibles)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } } local_c[0] = this->_backupPlayer; if (local_c[0] == (Entity_Player *)0x0) { return; } if (this->_valid == 0) { return; } (local_c[0]->_greedResetCollectibles)._end = (local_c[0]->_greedResetCollectibles)._begin; if (local_c[0]->_variant != 0) { return; } } } return; } //@@ 007daed0 Entity_Player::ResetPlayer /* ZHL [exact] __thiscall void Entity_Player::ResetPlayer(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Player::ResetPlayer(Entity_Player *this) { void *pvVar1; void *pvVar2; std_vector *psVar3; uint uVar4; int local_14 [4]; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { InitPostLevelInitStats(); uVar4 = 0; if ((int)(this->_greedResetCollectibles)._end - (int)(this->_greedResetCollectibles)._begin >> 2 != 0) { do { AddCollectible(this,*(int *)((int)(this->_greedResetCollectibles)._begin + uVar4 * 4),0,0,0, 0,0); uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(this->_greedResetCollectibles)._end - (int)(this->_greedResetCollectibles)._begin >> 2)); } EvaluateItems(); RecomputeWispCollectibles(this,(Entity_Familiar *)0x0); } psVar3 = &this->_greedResetCollectibles; if ((std_vector *)local_14 != psVar3) { pvVar1 = psVar3->_begin; pvVar2 = (this->_greedResetCollectibles)._capacity; psVar3->_begin = (void *)0x0; (this->_greedResetCollectibles)._end = (void *)0x0; (this->_greedResetCollectibles)._capacity = (void *)0x0; if (pvVar1 != (void *)0x0) { uVar4 = (int)pvVar2 - (int)pvVar1 & 0xfffffffc; pvVar2 = pvVar1; if (0xfff < uVar4) { pvVar2 = *(void **)((int)pvVar1 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } } return; } //@@ 007dafb0 FUN_007dafb0 int FUN_007dafb0(void) { int iVar1; Entity_Player *in_ECX; iVar1 = Entity_Player::GetTrinketMultiplier(in_ECX,0x79); if (iVar1 == 0) { iVar1 = 0; } else if (iVar1 == 1) { iVar1 = 1; } else { iVar1 = 2; } iVar1 = iVar1 - (in_ECX->_holyMantleStacks & 0xf); if (iVar1 < 0) { iVar1 = 0; } return iVar1; } //@@ 007daff0 FUN_007daff0 void FUN_007daff0(void) { void *pvVar1; byte bVar2; int iVar3; Entity_Player *in_ECX; int local_18 [3]; undefined4 local_c; iVar3 = Entity_Player::GetTrinketMultiplier(in_ECX,0x79); if (iVar3 == 0) { in_ECX->_holyMantleStacks = 0; return; } if (iVar3 == 1) { iVar3 = 1; bVar2 = 0x10; } else { iVar3 = 2; bVar2 = 0x20; } in_ECX->_holyMantleStacks = bVar2; do { pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4e4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) ) && (local_18[0] = *(int *)((int)pvVar1 + 0x4e4), local_18[0] != 0)) { local_18[2] = *(undefined4 *)(local_18[0] + 0x78); local_18[1] = 0; local_c = 0; TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,local_18,1,1); } iVar3 = iVar3 + -1; } while (iVar3 != 0); return; } //@@ 007db0a0 FUN_007db0a0 void FUN_007db0a0(void) { void *pvVar1; int iVar2; byte bVar3; Entity_Player *in_ECX; int local_14 [3]; undefined4 local_8; iVar2 = Entity_Player::GetTrinketMultiplier(in_ECX,0x79); if (iVar2 == 0) { iVar2 = 0; } else if (iVar2 == 1) { iVar2 = 1; } else { iVar2 = 2; } bVar3 = in_ECX->_holyMantleStacks; iVar2 = iVar2 - (bVar3 & 0xf); if (iVar2 < 0) { iVar2 = 0; } if (iVar2 != 0) { pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4e4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) ) && (local_14[0] = *(int *)((int)pvVar1 + 0x4e4), local_14[0] != 0)) { local_14[2] = *(undefined4 *)(local_14[0] + 0x78); local_14[1] = 0; local_8 = 0; TemporaryEffects::AddEffect(&in_ECX->_temporaryeffects,local_14,1,1); bVar3 = in_ECX->_holyMantleStacks; } in_ECX->_holyMantleStacks = (bVar3 & 0xf0) + 0x10 | bVar3 & 0xf; } return; } //@@ 007db160 Entity_Player::remove_wooden_cross_mantles /* DB: ECX Entity_Player; GetTrinketMultiplier(TRINKET_WOODEN_CROSS 121) clamps to 0..2, lowers the high nibble of _holyMantleStacks, removes Holy Mantle (313) temp effects/costumes; called when trinket 121 or Mom's Box (439) is removed (TriggerTrinketRemoved/TriggerCollectibleRemoved) */ void Entity_Player::remove_wooden_cross_mantles(void) { void *pvVar1; int iVar2; int *piVar3; int iVar4; int *piVar5; byte bVar6; Entity_Player *in_ECX; uint uVar7; byte bVar8; uint uVar9; int local_18 [3]; undefined4 local_c; int local_8; iVar4 = GetTrinketMultiplier(in_ECX,0x79); if (iVar4 == 0) { iVar4 = 0; } else if (iVar4 == 1) { iVar4 = 1; } else { iVar4 = 2; } bVar6 = in_ECX->_holyMantleStacks; uVar7 = iVar4 - (bVar6 & 0xf); if ((int)uVar7 < 0) { uVar7 = 0; } bVar8 = bVar6 >> 4; uVar9 = (uint)bVar8; if (uVar7 < uVar9) { local_8 = uVar9 - uVar7; do { iVar4 = local_8; uVar9 = uVar9 - 1; bVar8 = (byte)uVar9; pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4e4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU)) && (iVar2 = *(int *)((int)pvVar1 + 0x4e4), iVar2 != 0)) { local_18[2] = *(undefined4 *)(iVar2 + 0x78); local_18[1] = 0; local_c = 0; local_18[0] = iVar2; TemporaryEffects::RemoveEffect(&in_ECX->_temporaryeffects,local_18,1); } if ((in_ECX->_temporaryeffects)._disabled == 0) { piVar5 = (in_ECX->_temporaryeffects)._effects._begin; piVar3 = (in_ECX->_temporaryeffects)._effects._end; if (piVar5 != piVar3) { do { iVar4 = *(int *)*piVar5; if ((((iVar4 == 1) || (iVar4 == 3)) || (iVar4 == 4)) && (((int *)*piVar5)[1] == 0x139)) { if (0 < piVar5[1]) goto LAB_007db29a; break; } piVar5 = piVar5 + 4; } while (piVar5 != piVar3); iVar4 = local_8; } } pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) < 0x4e5) { RemoveCostume(in_ECX,(ItemConfig_Item *)0x0); local_8 = iVar4; } else { RemoveCostume(in_ECX,*(ItemConfig_Item **)((int)pvVar1 + 0x4e4)); local_8 = iVar4; } LAB_007db29a: local_8 = local_8 + -1; } while (local_8 != 0); bVar6 = in_ECX->_holyMantleStacks; } in_ECX->_holyMantleStacks = bVar6 & 0xf | bVar8 << 4; return; } //@@ 007db2d0 FUN_007db2d0 undefined4 FUN_007db2d0(void) { byte bVar1; int iVar2; Entity_Player *in_ECX; iVar2 = Entity_Player::GetTrinketMultiplier(in_ECX,0x79); if (iVar2 == 0) { iVar2 = 0; } else if (iVar2 == 1) { iVar2 = 1; } else { iVar2 = 2; } bVar1 = in_ECX->_holyMantleStacks; iVar2 = iVar2 - (bVar1 & 0xf); if (iVar2 < 0) { iVar2 = 0; } if (iVar2 == 0) { return 0; } in_ECX->_holyMantleStacks = ((bVar1 >> 4) - 1) * '\x10' | bVar1 + 1 & 0xf; return 1; } //@@ 007db330 Game::damage_cooldown_scale /* DB: returns ticks, or ticks>>3 (min 1) when game field 0x26614 >= 2 (characters-8) */ uint Game::damage_cooldown_scale(uint param_1) { uint uVar1; if (*(int *)&g_game->_deathmatchManager < 2) { return param_1; } uVar1 = 1; if (0xf < (int)param_1) { uVar1 = param_1 >> 3; } return uVar1; } //@@ 007db360 FUN_007db360 int FUN_007db360(void) { uint3 uVar1; int in_ECX; float fVar2; uVar1 = (uint3)((uint)g_game >> 8); if (*(int *)&g_game->_deathmatchManager < 2) { return CONCAT31(uVar1,*(int *)(in_ECX + 0x1344) == 2); } fVar2 = (float)*(int *)(in_ECX + 0x1344) / (float)*(int *)(in_ECX + 0x1340); if ((0.1 <= fVar2) && (fVar2 <= 0.3)) { return CONCAT31(uVar1,1); } return (uint)uVar1 << 8; } //@@ 007db3b0 Game::reset_players_for_greed /* DB: ? called from Level::generate_greed; for each familiar (type 3) owned by player: Remove; Entity_Player::release_weapons_and_effects, SetControllerIndex, ResetPlayer */ void Game::reset_players_for_greed(void) { int *piVar1; uint uVar2; void *pvVar3; void **ppvVar4; Entity_Player *in_ECX; uint i; void *pvVar5; void **ppvVar6; undefined4 uVar7; 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 ^ (int)register0x00000010 - 4U; if (in_ECX->_exists == 0) { return; } if (in_ECX->_valid == 0) { return; } local_20 = (void **)in_ECX->_controllerIndex; ExceptionList = &local_10; EntityList::QuerySublist((EntityList *)((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 = *(int **)((int)pvVar3 + i * 4); if (((piVar1 != (int *)0x0) && (piVar1[10] == 3)) && ((Entity_Player *)piVar1[0x104] == in_ECX)) { (**(code **)(*piVar1 + 0x28))(uVar2); pvVar3 = familiars._data; } i = i + 1; } while (i < (uint)familiars._size); } local_2c = (void *)0x0; local_14 = (void *)0x0; local_8 = CONCAT31(local_8._1_3_,1); otherPlayer = in_ECX->_twinPlayer; local_18 = (void *)0x0; if ((otherPlayer != (EntityPtr)0x0) || (otherPlayer = (EntityPtr)in_ECX->_backupPlayer, otherPlayer != (EntityPtr)0x0)) { local_18 = (void *)0x0; ppvVar4 = (void **)((int)otherPlayer + 0x20dc); if (&local_2c != ppvVar4) { local_14 = *(void **)((int)otherPlayer + 0x20e0); local_18 = *(void **)((int)otherPlayer + 0x20e4); local_2c = *ppvVar4; *ppvVar4 = (void *)0x0; *(undefined4 *)((int)otherPlayer + 0x20e0) = 0; *(undefined4 *)((int)otherPlayer + 0x20e4) = 0; } } local_24 = local_18; local_1c = local_2c; if (in_ECX->_playerType == 0x26) { greedResetCollectibles = &in_ECX->_greedResetCollectibles; in_ECX->_playerType = 0x1d; if ((std_vector *)&local_2c != greedResetCollectibles) { local_1c = greedResetCollectibles->_begin; local_24 = (in_ECX->_greedResetCollectibles)._capacity; pvVar3 = (in_ECX->_greedResetCollectibles)._end; greedResetCollectibles->_begin = local_2c; (in_ECX->_greedResetCollectibles)._end = local_14; (in_ECX->_greedResetCollectibles)._capacity = local_18; local_14 = pvVar3; } } else if (in_ECX->_playerType == 0x27) { in_ECX->_playerType = 0x25; } pvVar3 = local_24; local_2c = local_1c; local_28 = local_14; Entity_Player::release_weapons_and_effects(in_ECX,1); savedDamageTaken = in_ECX->_totalDamageTaken; (**(code **)(*(int *)in_ECX + 4)) (in_ECX->_type,in_ECX->_variant,in_ECX->_playerType,in_ECX->_initSeed); uVar7 = 0; ppvVar6 = local_20; Entity_Player::SetControllerIndex(); ppvVar4 = local_20; in_ECX->_totalDamageTaken = savedDamageTaken; if (in_ECX->_twinPlayer != (EntityPtr)0x0) { Entity_Player::SetControllerIndex((Entity_Player *)in_ECX->_twinPlayer,local_20,0,ppvVar6,uVar7) ; } if (in_ECX->_backupPlayer != (Entity_Player *)0x0) { Entity_Player::SetControllerIndex(in_ECX->_backupPlayer,ppvVar4,0,ppvVar6,uVar7); } Entity_Player::ResetPlayer(in_ECX); pvVar5 = local_1c; if (local_1c == local_14) goto LAB_007db61a; otherPlayer = in_ECX->_twinPlayer; if (otherPlayer == (EntityPtr)0x0) { otherPlayer = (EntityPtr)in_ECX->_backupPlayer; if (otherPlayer == (EntityPtr)0x0) goto LAB_007db61a; local_20 = (void **)((int)otherPlayer + 0x20dc); if (&local_2c != local_20) { local_2c = *local_20; *local_20 = local_1c; local_28 = *(void **)((int)otherPlayer + 0x20e0); local_24 = *(void **)((int)otherPlayer + 0x20e4); *(void **)((int)otherPlayer + 0x20e0) = local_14; *(void **)((int)otherPlayer + 0x20e4) = pvVar3; otherPlayer = (EntityPtr)in_ECX->_backupPlayer; goto LAB_007db60d; } } else { local_20 = (void **)((int)otherPlayer + 0x20dc); if (&local_2c != local_20) { local_2c = *local_20; *local_20 = local_1c; local_28 = *(void **)((int)otherPlayer + 0x20e0); local_24 = *(void **)((int)otherPlayer + 0x20e4); *(void **)((int)otherPlayer + 0x20e0) = local_14; *(void **)((int)otherPlayer + 0x20e4) = pvVar3; otherPlayer = in_ECX->_twinPlayer; LAB_007db60d: pvVar3 = local_24; pvVar5 = local_2c; } } Entity_Player::ResetPlayer((Entity_Player *)otherPlayer); LAB_007db61a: in_ECX->_visible = 0; if (in_ECX->_twinPlayer != (EntityPtr)0x0) { *(undefined1 *)((int)in_ECX->_twinPlayer + 0x171) = 0; } local_8 = local_8 & 0xffffff00; if (pvVar5 != (void *)0x0) { uVar2 = (int)pvVar3 - (int)pvVar5 & 0xfffffffc; pvVar3 = pvVar5; if (0xfff < uVar2) { pvVar3 = *(void **)((int)pvVar5 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } if (familiars._0_1_ == '\0') { local_8 = 2; tracked_alloc(1,familiars._data,0); } ExceptionList = local_10; return; } //@@ 007db6b0 Entity_Player::HasInstantDeathCurse /* ZHL [exact] __thiscall bool Entity_Player::HasInstantDeathCurse(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::HasInstantDeathCurse(Entity_Player *this) { int *piVar1; if ((this->_temporaryeffects)._disabled == 0) { for (piVar1 = (this->_temporaryeffects)._effects._begin; piVar1 != (this->_temporaryeffects)._effects._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 0) && (((int *)*piVar1)[1] == 0x70)) { return 1; } } } if (this->_playerType == 0x27) { return 1; } return 0; } //@@ 007db700 Entity_Player::IsHologram /* ZHL [exact] __thiscall bool Entity_Player::IsHologram(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Entity_Player::IsHologram(Entity_Player *this) { EntityPtr EVar1; if (((this->_exists == 0) || (((this->_playerType != 0x1d && (this->_playerType != 0x26)) || (EVar1 = this->_twinPlayer, EVar1 == (EntityPtr)0x0)))) || (((*(int *)((int)EVar1 + 0x161c) == -1 || (this->_playerIndex <= *(int *)((int)EVar1 + 0x161c)) ) || (EVar1 == (EntityPtr)this)))) { return 0; } return 1; } //@@ 007db740 Entity_Player::TriggerEchoChamber /* ZHL [prefix20/21] __thiscall void Entity_Player::TriggerEchoChamber(uint32_t pocketItemType, int cardOrPillColor); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Entity_Player::TriggerEchoChamber(Entity_Player *this,uint pocketItemType,int cardOrPillColor) { uint *puVar1; uint pillColor; byte bVar2; int iVar3; uint uVar4; Vector local_10; bVar2 = HasCollectible(this,700,0); if (bVar2 != 0) { local_10.x = (float)(this->_echoChamberItems)._proxy; uVar4 = (this->_echoChamberItems)._offset; while (uVar4 != (this->_echoChamberItems)._size + (this->_echoChamberItems)._offset) { if ((int *)local_10.x == (int *)0x0) { iVar3 = 0; } else { iVar3 = *(int *)local_10.x; } puVar1 = (uint *)(*(int *)(*(int *)(iVar3 + 4) + (uVar4 >> 1 & *(int *)(iVar3 + 8) - 1U) * 4) + (uVar4 & 1) * 8); if (puVar1[1] == 1) { UseCard(this,*puVar1,0x980); uVar4 = uVar4 + 1; } else { if (puVar1[1] == 0) { pillColor = *puVar1; iVar3 = ItemPool::GetPillEffect(&g_game->_itemPool,pillColor,this); UsePill(iVar3,pillColor,0x980); } uVar4 = uVar4 + 1; } } local_10.y = (float)pocketItemType; local_10.x = (float)cardOrPillColor; if ((pocketItemType == 1) || (pocketItemType == 0)) { std::deque::push_back(&this->_echoChamberItems,&local_10); uVar4 = (this->_echoChamberItems)._size; if (3 < uVar4) { while( true ) { uVar4 = uVar4 - 1; (this->_echoChamberItems)._size = uVar4; if (uVar4 == 0) break; if (uVar4 < 4) { return; } } (this->_echoChamberItems)._offset = 0; } } } return; } //@@ 007db860 is_achievement_79_unlocked /* DB: ? std::set find key 0x4f, byte vec 0x1fd4[0x8f]; called by GFuel/EvaluateItems prototype: db/protos.zhl */ int __fastcall is_achievement_79_unlocked(Entity_Player *player) { void *pvVar1; Game *pGVar2; undefined1 local_14 [8]; void *local_c; undefined4 local_8; pGVar2 = g_game; local_8 = 0x4f; std::set::find_node(local_14,&local_8); if ((((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x50)) && (local_c != (pGVar2->_seedEffects)._seedEffects)) && (pvVar1 = (player->_extraCollectibleCounts)._begin, 0x8f < (int)(player->_extraCollectibleCounts)._end - (int)pvVar1)) { return (uint)*(byte *)((int)pvVar1 + 0x8f); } return 0; } //@@ 007db8d0 Entity_Player::get_seeded_variant /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? switch on FUN_007db860 (set 79 + player vec byte 0x8f) else seed-derived 2..5 prototype: db/protos.zhl */ int __thiscall Entity_Player::get_seeded_variant(Entity_Player *this) { code *pcVar1; Game *pGVar2; int iVar3; int iVar4; uint uVar5; iVar3 = is_achievement_79_unlocked(this); pGVar2 = g_game; switch(iVar3) { case 0: case 1: return -1; case 2: return 0; case 3: return 1; case 4: return 2; case 5: return 3; case 6: return 4; case 7: return 5; } iVar4 = (g_game->_seedEffects)._gameStartSeed; if (iVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); iVar4 = (pGVar2->_seedEffects)._gameStartSeed; } uVar5 = 1; if (1 < (uint)(iVar4 + iVar3)) { uVar5 = iVar4 + iVar3; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } uVar5 = uVar5 >> 2 ^ uVar5; uVar5 = uVar5 << 0xf ^ uVar5; return ((uVar5 >> 0x11 ^ uVar5) & 3) + 2; } //@@ 007dba30 Entity_Player::is_evil_charm_immune /* DB: true if the player has Evil Charm (632, item or effect) and the source type/variant is a creep/hazard it blocks (case list incl. 1000.22-26, 1000.169); creep damage skips the hit (dogma_effects.md) prototype: db/protos.zhl, confirmed by RET 40 */ byte __thiscall Entity_Player::is_evil_charm_immune(Entity_Player *this,EntityRef source) { byte bVar1; bool bVar2; bVar2 = false; bVar1 = HasCollectible(this,0x278,0); if ((bVar1 == 0) && (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryeffects,0x278), bVar1 == 0)) { return 0; } if (source._type < 0x22) { if (source._type == 0x21) { return 1; } if (source._type == 0) { bVar2 = source._variant == 10000; } else if ((source._type == 9) && (source._variant == 2)) { switchD_007dbabc_caseD_16: bVar2 = true; } } else if (source._type == 1000) { switch(source._variant) { case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x20: case 0x25: case 0x2c: case 0x2d: case 0x2e: case 0x35: case 0x36: case 0x38: case 0x4e: case 0x5a: case 0x5e: case 0x8d: case 0x93: case 0x9b: case 0xa9: case 0xcc: goto switchD_007dbabc_caseD_16; default: break; } } if ((*(char *)&this[1]._damageEvents._begin != '\0') || (bVar2)) { *(undefined1 *)&this[1]._damageEvents._begin = 1; if ((bVar2) && (*(int *)&this[1].field_0x4 < 0x1e)) { return 1; } } else { *(undefined1 *)&this[1]._damageEvents._begin = 0; } return 0; } //@@ 007dbba0 Entity_Player::add_random_drug_item_effect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? picks one of 13,14,240,70,143,345,493,496, TemporaryEffects::AddEffect */ void __thiscall Entity_Player::add_random_drug_item_effect(Entity_Player *this) { void *pvVar1; float id; code *pcVar2; Manager *pMVar3; uint uVar4; uint *puVar5; float local_28 [4]; ItemConfig_Item *local_18; undefined4 uStack_14; int iStack_10; undefined4 uStack_c; float local_8; local_8 = (float)(__security_cookie ^ (uint)(local_28 + 9)); local_28[0] = 1.82169e-44; local_28[1] = 1.96182e-44; local_28[2] = 3.36312e-43; local_28[3] = 9.80909e-44; pvVar1 = (this->_trinketRNGs)._begin; puVar5 = (uint *)((int)pvVar1 + 0x840); local_18 = (ItemConfig_Item *)0x8f; uStack_14 = 0x159; iStack_10 = 0x1ed; uStack_c = 0x1f0; uVar4 = *puVar5; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *puVar5; if (uVar4 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } pMVar3 = g_manager; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x844) & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)*(undefined4 *)((int)pvVar1 + 0x848) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x84c) & 0x1f) ^ uVar4; *puVar5 = uVar4; id = local_28[uVar4 & 7]; local_18 = ItemConfig::GetCollectible(&pMVar3->_itemConfig,(int)id); iStack_10 = local_18->maxCooldown; uStack_14 = 0; uStack_c = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_18,1,1); if (1 < *(int *)&g_game->_deathmatchManager) { this[1]._chargeBarSprites[0]._color._colorize[0] = id; } return; } //@@ 007dbc80 Entity_Player::AddRandomMomItemEffect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? RNG pick from list 29,30,31,55,110,114,217,228,355,508,732 */ void __thiscall Entity_Player::AddRandomMomItemEffect(Entity_Player *this) { void *pvVar1; float id; code *pcVar2; uint uVar3; uint *puVar4; ItemConfig_Item *local_4c; undefined4 local_48; int local_44; undefined4 local_40; float local_3c [13]; float local_8; local_8 = (float)(__security_cookie ^ (uint)(local_3c + 0xe)); local_3c[0xc] = 1.02575e-42; local_3c[0] = 4.06377e-44; local_3c[1] = 4.2039e-44; local_3c[2] = 4.34403e-44; local_3c[3] = 7.70714e-44; pvVar1 = (this->_trinketRNGs)._begin; puVar4 = (uint *)((int)pvVar1 + 0x990); local_3c[4] = 1.54143e-43; local_3c[5] = 1.59748e-43; local_3c[6] = 2.78858e-43; local_3c[7] = 2.8026e-43; uVar3 = *puVar4; local_3c[8] = 3.04082e-43; local_3c[9] = 3.19496e-43; local_3c[10] = 4.97461e-43; local_3c[0xb] = 7.1186e-43; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *puVar4; if (uVar3 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar3 = uVar3 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x994) & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)*(undefined4 *)((int)pvVar1 + 0x998) & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)*(undefined4 *)((int)pvVar1 + 0x99c) & 0x1f) ^ uVar3; *puVar4 = uVar3; id = local_3c[uVar3 % 0xd]; local_4c = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)id); local_44 = local_4c->maxCooldown; local_48 = 0; local_40 = 0; TemporaryEffects::AddEffect(&this->_temporaryeffects,&local_4c,1,1); if (1 < *(int *)&g_game->_deathmatchManager) { this[1]._chargeBarSprites[0]._color._colorize[1] = id; } return; } //@@ 007dbd70 Entity_Player::ModelingClay_roll /* DB: seeded collectible stored +0x1fb8, costume; trinket added/new room */ void Entity_Player::ModelingClay_roll(uint *param_1) { void **ppvVar1; undefined4 *puVar2; void *pvVar3; code *pcVar4; Manager *pMVar5; uint uVar6; int iVar7; ItemConfig_Item *collectibleID; Entity_Player *in_ECX; code *local_8; pMVar5 = g_manager; local_8 = FUN_007dbe70; puVar2 = (g_manager->_itemConfig)._availabilityFilters._end; if (puVar2 == (g_manager->_itemConfig)._availabilityFilters._capacity) { std::vector<4byte>::_Emplace_reallocate(puVar2,&local_8); } else { *puVar2 = FUN_007dbe70; ppvVar1 = &(pMVar5->_itemConfig)._availabilityFilters._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } uVar6 = *param_1; pvVar3 = g_game->_room; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *param_1; if (uVar6 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar6 = uVar6 >> ((byte)param_1[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)param_1[2] & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)param_1[3] & 0x1f) ^ uVar6; *param_1 = uVar6; iVar7 = ItemPool::GetSeededCollectible(uVar6,1,*(RoomDescriptor **)((int)pvVar3 + 4)); pMVar5 = g_manager; in_ECX->_modelingClayEffect = iVar7; ppvVar1 = &(pMVar5->_itemConfig)._availabilityFilters._end; *ppvVar1 = (void *)((int)*ppvVar1 + -4); collectibleID = ItemConfig::GetCollectible(&pMVar5->_itemConfig,in_ECX->_modelingClayEffect); if (collectibleID != (ItemConfig_Item *)0x0) { in_ECX->_cacheFlags = in_ECX->_cacheFlags | collectibleID->cacheFlags; (in_ECX->_temporaryeffects)._shouldEvaluateCache = 1; if (collectibleID->addCostumeOnPickup != 0) { AddCostume(in_ECX,collectibleID,0); } HUD::mark_all_slots_dirty(&g_game->_hud,0,0); } return; } //@@ 007dbe70 FUN_007dbe70 undefined4 FUN_007dbe70(uint *param_1) { uint uVar1; uVar1 = *param_1; if ((((uVar1 == 1) || (uVar1 == 3)) || (uVar1 == 4)) && (uVar1 = param_1[0x2e] & 0x1000000, uVar1 == 0)) { return 0; } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 007dbeb0 Entity_Player::twins_duplicate_familiars /* DB: The Twins: param copies of a random owned familiar item for the room, else Brother Bobby/Sister Maggy (called from 007a6c50 Entity_Player::room_enter RandomInt(mult+1)); not HistoryHUD::RecomputeAll (trinkets-cards) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Player::twins_duplicate_familiars(Entity_Player *this,int count) { float *pfVar1; void *pvVar2; code *pcVar3; ItemConfig_Item *collectibleConfig; ItemConfig *itemConfig; int *piVar4; uint *puVar5; uint uVar6; uint *itemsBegin; uint *itemsEnd; int iVar7; uint uVar8; int effectEntry [3]; undefined4 local_38; uint *familiarItems; uint *familiarItemsEnd; uint *familiarItemsCapEnd; TemporaryEffects *temporaryEffects; uint local_24; uint local_20; Entity_Player *player; uint *itemsCapEnd; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Entity_Player *playerReg; int roomEntity; puStack_c = &LAB_00b0059d; local_10 = ExceptionList; if (count < 1) { return; } iVar7 = *(int *)((int)g_game->_room + 0x1264); if (iVar7 != 0) { piVar4 = *(int **)((int)g_game->_room + 0x125c); uVar8 = 0; do { roomEntity = *piVar4; piVar4 = piVar4 + 1; uVar6 = uVar8 + 1; if (*(int *)(roomEntity + 0x28) != 3) { uVar6 = uVar8; } iVar7 = iVar7 + -1; uVar8 = uVar6; } while (iVar7 != 0); if (0x3b < uVar6) { return; } } puVar5 = (uint *)0x0; itemsEnd = (uint *)0x0; familiarItems = (uint *)0x0; familiarItemsEnd = (uint *)0x0; itemsCapEnd = (uint *)0x0; familiarItemsCapEnd = (uint *)0x0; local_8 = 0; uVar8 = 1; itemConfig = &g_manager->_itemConfig; ExceptionList = &local_10; player = this; if (4 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin & 0xfffffffcU)) { do { if (g_game == (Game *)0x0) { if (-1 < (int)uVar8) goto LAB_007dbf93; } else { if ((int)uVar8 < 0) { if (((int)uVar8 < 0) && (pvVar2 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar8 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2)) { piVar4 = (int *)**(undefined4 **)((int)pvVar2 + ~uVar8 * 4); } else { piVar4 = (int *)0x0; } } else { LAB_007dbf93: pvVar2 = (itemConfig->_collectibles)._begin; if ((int)(itemConfig->_collectibles)._end - (int)pvVar2 >> 2 <= (int)uVar8) goto LAB_007dc03e; piVar4 = *(int **)((int)pvVar2 + uVar8 * 4); } if (piVar4 != (int *)0x0) { if ((piVar4[0x2e] & 0x8000000U) == 0) { if (*piVar4 == 4) { iVar7 = GetCollectibleNum(player,uVar8,0); if (((((iVar7 < 1) || (uVar8 == 0)) || ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2 <= (int)uVar8)) || ((uVar8 == 0xeb || (uVar8 == 0x2b)))) || (uVar8 == 0x3d)) { puVar5 = itemsCapEnd; } else { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,uVar8); puVar5 = itemsCapEnd; if (collectibleConfig != (ItemConfig_Item *)0x0) { local_20 = uVar8; if (itemsEnd == itemsCapEnd) { std::vector::_Emplace_reallocate(itemsEnd,&local_20); itemsCapEnd = familiarItemsCapEnd; puVar5 = familiarItemsCapEnd; itemsEnd = familiarItemsEnd; } else { *itemsEnd = uVar8; familiarItemsEnd = itemsEnd + 1; itemsEnd = familiarItemsEnd; } } } } } } } LAB_007dc03e: uVar8 = uVar8 + 1; itemConfig = &g_manager->_itemConfig; } while ((int)uVar8 < (int)(g_manager->_itemConfig)._collectibles._end - (int)(itemConfig->_collectibles)._begin >> 2); } temporaryEffects = &player->_temporaryeffects; itemsBegin = familiarItems; do { playerReg = player; if (itemsBegin == itemsEnd) { local_20 = 8; if (itemsEnd == puVar5) { std::vector::_Emplace_reallocate(itemsEnd,&local_20); itemsCapEnd = familiarItemsCapEnd; puVar5 = familiarItemsCapEnd; itemsBegin = familiarItems; } else { *itemsEnd = 8; familiarItemsEnd = itemsEnd + 1; } local_20 = 0x43; if (familiarItemsEnd == puVar5) { std::vector::_Emplace_reallocate(familiarItemsEnd,&local_20); itemsCapEnd = familiarItemsCapEnd; itemsBegin = familiarItems; itemsEnd = familiarItemsEnd; } else { *familiarItemsEnd = 0x43; familiarItemsEnd = familiarItemsEnd + 1; itemsEnd = familiarItemsEnd; } } pvVar2 = (playerReg->_trinketRNGs)._begin; puVar5 = (uint *)((int)pvVar2 + 0xb70); local_20 = (int)itemsEnd - (int)itemsBegin >> 2; uVar8 = *puVar5; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *puVar5; if (uVar8 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar2 + 0xb74) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)((int)pvVar2 + 0xb78) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar2 + 0xb7c) & 0x1f) ^ uVar8; *puVar5 = uVar8; if (local_20 != 0) { local_20 = uVar8 % local_20; } pvVar2 = (player->_trinketRNGs)._begin; puVar5 = (uint *)((int)pvVar2 + 0xb70); local_24 = (int)itemsEnd - (int)itemsBegin >> 2; uVar8 = *puVar5; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *puVar5; if (uVar8 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar2 + 0xb74) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)((int)pvVar2 + 0xb78) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)pvVar2 + 0xb7c) & 0x1f) ^ uVar8; uVar6 = 0; *puVar5 = uVar8; if (local_24 != 0) { uVar6 = uVar8 % local_24; } uVar8 = itemsBegin[uVar6]; local_24 = uVar8; if (g_game == (Game *)0x0) { if (-1 < (int)uVar8) goto LAB_007dc1df; } else { if ((int)uVar8 < 0) { if (((int)uVar8 < 0) && (pvVar2 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar8 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar2 >> 2)) { iVar7 = **(int **)((int)pvVar2 + ~uVar8 * 4); } else { iVar7 = 0; } } else { LAB_007dc1df: pvVar2 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar2 >> 2 <= (int)uVar8) goto LAB_007dc222; iVar7 = *(int *)((int)pvVar2 + uVar8 * 4); } if (iVar7 != 0) { effectEntry[2] = *(undefined4 *)(iVar7 + 0x78); effectEntry[1] = 0; local_38 = 0; effectEntry[0] = iVar7; TemporaryEffects::AddEffect(temporaryEffects,effectEntry,1,1); } } LAB_007dc222: itemsEnd = itemsEnd + -1; uVar6 = itemsBegin[local_20]; itemsBegin[local_20] = *itemsEnd; game = g_game; *itemsEnd = uVar6; familiarItemsEnd = itemsEnd; if (1 < *(int *)&game->_deathmatchManager) { puVar5 = (uint *)player[1]._chargeBarSprites[0]._color._colorize[3]; if (puVar5 == (uint *)player[1]._chargeBarSprites[0]._color._offset[0]) { std::vector::_Emplace_reallocate(puVar5,&local_24); } else { *puVar5 = uVar8; pfVar1 = player[1]._chargeBarSprites[0]._color._colorize + 3; *pfVar1 = (float)((int)*pfVar1 + 4); } } count = count + -1; if (count == 0) { if (itemsBegin != (uint *)0x0) { uVar8 = (int)itemsCapEnd - (int)itemsBegin & 0xfffffffc; puVar5 = itemsBegin; if (0xfff < uVar8) { puVar5 = (uint *)itemsBegin[-1]; uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)itemsBegin + (-4 - (int)puVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar5,uVar8); } ExceptionList = local_10; return; } puVar5 = itemsCapEnd; } while( true ); } //@@ 007dc2d0 _Entity_Player::SpawnTrinketRandomPickup /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ? trinket RNG +0x177c, random of 5 variants, SpawnEx pickup */ uint _Entity_Player::SpawnTrinketRandomPickup(void) { float fVar1; undefined4 uVar2; code *pcVar3; Entity *pEVar4; Entity *in_ECX; uint uVar5; uint uVar6; uint *puVar7; int iVar8; float fVar9; float local_34; float local_30; float local_2c; uint local_28; float local_24; uint local_20 [7]; local_20[5] = __security_cookie ^ (uint)&local_34; local_20[4] = 5; local_20[0] = 3; local_20[1] = 2; local_20[2] = 1; local_20[3] = 4; fVar9 = in_ECX[5]._preInterpolatePos.x; if ((int)((int)fVar9 - (int)in_ECX[5]._pos.y & 0xfffffff0U) < 0xb91) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); fVar9 = in_ECX[5]._preInterpolatePos.x; } fVar1 = in_ECX[5]._pos.y; uVar6 = ((int)fVar9 - (int)fVar1 >> 4) - 1; if (0xb9 < uVar6) { uVar6 = 0xb9; } puVar7 = (uint *)(uVar6 * 0x10 + (int)fVar1); uVar6 = *puVar7; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar7; if (uVar6 == 0) { pcVar3 = (code *)swi(3); uVar6 = (*pcVar3)(); return uVar6; } } uVar6 = uVar6 >> ((byte)puVar7[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)puVar7[2] & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)puVar7[3] & 0x1f) ^ uVar6; *puVar7 = uVar6; local_28 = local_20[uVar6 % 5]; if (local_28 == 5) { fVar9 = in_ECX[5]._preInterpolatePos.x; if ((int)((int)fVar9 - (int)in_ECX[5]._pos.y & 0xfffffff0U) < 0xb91) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); fVar9 = in_ECX[5]._preInterpolatePos.x; } fVar1 = in_ECX[5]._pos.y; uVar6 = ((int)fVar9 - (int)fVar1 >> 4) - 1; if (0xb9 < uVar6) { uVar6 = 0xb9; } puVar7 = (uint *)(uVar6 * 0x10 + (int)fVar1); uVar6 = *puVar7; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar7; if (uVar6 == 0) { pcVar3 = (code *)swi(3); uVar6 = (*pcVar3)(); return uVar6; } } uVar6 = uVar6 >> ((byte)puVar7[1] & 0x1f) ^ uVar6; uVar5 = uVar6 << ((byte)puVar7[2] & 0x1f) ^ uVar6; uVar5 = uVar5 >> ((byte)puVar7[3] & 0x1f) ^ uVar5; *puVar7 = uVar5; iVar8 = (uVar5 & 3) + 1; if (iVar8 == 0) { return uVar6; } } else { iVar8 = 1; } do { uVar6 = Random(); pEVar4 = Game::SpawnEx(g_game,3,0x2b,&in_ECX->_pos,&g_vectorZero,in_ECX,local_28,uVar6,0); uVar2 = *(undefined4 *)((int)&pEVar4->_flags + 4); *(uint *)&pEVar4->_flags = (uint)pEVar4->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar4->_flags + 4) = uVar2; local_30 = (in_ECX->_pos).y - (pEVar4->_pos).y; local_34 = (in_ECX->_pos).x - (pEVar4->_pos).x; fVar9 = sqrtf(local_30 * local_30 + local_34 * local_34); if (0.0 < fVar9) { local_34 = local_34 * (1.0 / fVar9); local_30 = local_30 * (1.0 / fVar9); } uVar6 = Random(); local_2c = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 48.0 - 24.0) * 0.017453292; local_24 = cos(local_2c); local_2c = sin(local_2c); uVar6 = Random(); fVar9 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 10.0; (pEVar4->_velocity).x = (local_34 * local_24 - local_30 * local_2c) * fVar9; (pEVar4->_velocity).y = (local_34 * local_2c + local_30 * local_24) * fVar9; uVar6 = Random(); pEVar4[3]._shadowOffset.y = (float)(uVar6 % 5 + 6); iVar8 = iVar8 + -1; } while (iVar8 != 0); return uVar6 / 5; } //@@ 007dc610 FUN_007dc610 void FUN_007dc610(void) { undefined4 *in_ECX; in_ECX[1] = *in_ECX; return; } //@@ 007dc620 FUN_007dc620 void FUN_007dc620(undefined4 *param_1) { undefined4 *puVar1; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<4byte>::_Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 4; return; } //@@ 007dc650 FUN_007dc650 void FUN_007dc650(void) { int in_ECX; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -4; return; } //@@ 007dc660 FUN_007dc660 void FUN_007dc660(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (DAT_00c7f480 != (code *)0x0)) { (*DAT_00c7f480)(); } } ExceptionList = local_10; return; } //@@ 007dc6d0 FUN_007dc6d0 undefined4 FUN_007dc6d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,int param_4) { FUN_007dce90(param_1,param_2,0,param_4,param_2,0,param_4 + 1); return param_1; } //@@ 007dc720 FUN_007dc720 void FUN_007dc720(void) { void *ptr; undefined4 *in_ECX; std::deque<12byte>::_Tidy(); ptr = (void *)*in_ECX; *in_ECX = 0; operator_delete(ptr,8); return; } //@@ 007dc740 FUN_007dc740 void FUN_007dc740(undefined8 *param_1) { int iVar1; undefined8 *puVar2; void *pvVar3; void *in_ECX; uint count; int iVar4; uint uVar5; count = *(uint *)((int)in_ECX + 0x10); uVar5 = *(uint *)((int)in_ECX + 8); if (uVar5 <= count + 1) { std_deque_growmap(in_ECX,count); uVar5 = *(uint *)((int)in_ECX + 8); count = *(uint *)((int)in_ECX + 0x10); } *(uint *)((int)in_ECX + 0xc) = *(uint *)((int)in_ECX + 0xc) & uVar5 - 1; iVar1 = (count + *(int *)((int)in_ECX + 0xc) & uVar5 - 1) * 4; iVar4 = *(int *)((int)in_ECX + 4); if (*(int *)(iVar4 + iVar1) == 0) { pvVar3 = operator_new(0xc); *(void **)(iVar1 + *(int *)((int)in_ECX + 4)) = pvVar3; iVar4 = *(int *)((int)in_ECX + 4); } puVar2 = *(undefined8 **)(iVar1 + iVar4); *puVar2 = *param_1; *(undefined4 *)(puVar2 + 1) = *(undefined4 *)(param_1 + 1); *(int *)((int)in_ECX + 0x10) = *(int *)((int)in_ECX + 0x10) + 1; return; } //@@ 007dc7b0 FUN_007dc7b0 void FUN_007dc7b0(void) { std::deque::push_back(); return; } //@@ 007dc7c0 FUN_007dc7c0 void FUN_007dc7c0(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_007ddf80(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x130) * 0x130; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007dc840 vector28_resize /* DB: ? std::vector<0x1c-byte element>::resize(n): shrink sets end, grow within capacity default-constructs (FUN_007de2f0) or reallocates (FUN_007deaf0); only callers Entity_Player::StoreGameState and Entity_Player::restore_save_state_part2 */ int vector28_resize(uint param_1) { uint uVar1; int iVar2; int *in_ECX; int iVar3; iVar3 = in_ECX[1] - *in_ECX; iVar2 = iVar3 * -0x6db6db6d; uVar1 = iVar3 / 0x1c; if (param_1 < uVar1) { iVar2 = *in_ECX + param_1 * 0x1c; in_ECX[1] = iVar2; return iVar2; } if (uVar1 < param_1) { if ((uint)((in_ECX[2] - *in_ECX) / 0x1c) < param_1) { iVar2 = std::vector<28byte>::_Resize_reallocate(param_1,¶m_1); return iVar2; } iVar2 = FUN_007de2f0(in_ECX[1],param_1 - uVar1,param_1); in_ECX[1] = iVar2; } return iVar2; } //@@ 007dc8d0 std::vector<52byte>::_Tidy /* DB: frees a vector of trivially destructible 0x34-byte elements; called twice from GameStatePlayer::~GameStatePlayer (00754d90) and Entity_Player::~Entity_Player */ void std::vector<52byte>::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x34) * 0x34; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007dc940 std::vector<8byte>::resize /* DB: (n): shrinks by moving end, or grows zero-filling in capacity (memset) or via 00737f40 (_Resize_reallocate); callers Entity_Player::StoreGameState and GameStatePlayer::read */ void std::vector<8byte>::resize(uint param_1) { int *in_ECX; uint uVar1; void *_Dst; int iVar2; _Dst = (void *)in_ECX[1]; iVar2 = *in_ECX; uVar1 = (int)_Dst - iVar2 >> 3; if (param_1 < uVar1) { in_ECX[1] = iVar2 + param_1 * 8; return; } if (uVar1 < param_1) { if ((uint)(in_ECX[2] - iVar2 >> 3) < param_1) { _Resize_reallocate(param_1,uVar1); return; } iVar2 = param_1 - uVar1; if (iVar2 != 0) { memset(_Dst,0,iVar2 * 8); _Dst = (void *)((int)_Dst + iVar2 * 8); } in_ECX[1] = (int)_Dst; } return; } //@@ 007dc9b0 std::vector::resize /* DB: element size 0x78: shrinks by destroying the tail (dtor folded as invoke_pending_callbacks), grows in place (FUN_007de4b0) or reallocates (FUN_007dec60); Entity_Player::StoreGameState/RestoreGameState */ void std::vector::resize(uint param_1) { void *pvVar1; uint uVar2; void *pvVar3; int *in_ECX; void *owner; pvVar1 = (void *)in_ECX[1]; uVar2 = ((int)pvVar1 - *in_ECX) / 0x78; if (param_1 < uVar2) { pvVar3 = (void *)(*in_ECX + param_1 * 0x78); owner = pvVar3; if (pvVar3 != pvVar1) { do { invoke_pending_callbacks(owner); owner = (void *)((int)owner + 0x78); } while (owner != pvVar1); in_ECX[1] = (int)pvVar3; return; } } else { if (param_1 <= uVar2) { return; } if ((uint)((in_ECX[2] - *in_ECX) / 0x78) < param_1) { FUN_007dec60(param_1,in_ECX[2] - *in_ECX); return; } pvVar3 = (void *)FUN_007de4b0(pvVar1,param_1 - uVar2,param_1); } in_ECX[1] = (int)pvVar3; return; } //@@ 007dca70 FUN_007dca70 void FUN_007dca70(int *param_1) { void *_Src; int *in_ECX; size_t _Size; void *_Dst; if (in_ECX != param_1) { _Src = (void *)*param_1; _Size = param_1[1] - (int)_Src; _Dst = (void *)*in_ECX; if ((uint)(in_ECX[2] - (int)_Dst >> 4) < (uint)((int)_Size >> 4)) { vector16_clear_and_reserve(in_ECX,(int)_Size >> 4); _Dst = (void *)*in_ECX; } memmove(_Dst,_Src,_Size); in_ECX[1] = (int)_Dst + _Size; } return; } //@@ 007dcad0 FUN_007dcad0 undefined4 * FUN_007dcad0(int *param_1) { int *piVar1; int *piVar2; int iVar3; uint uVar4; void *pvVar5; undefined4 *in_ECX; undefined4 extraout_ECX; uint uVar6; int iVar7; int iVar8; int *local_14; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; local_8 = 0xff; auStack_7 = (undefined1 [3])0xffffff; puStack_c = &LAB_00b00606; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(auStack_7 + 3); ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; piVar1 = (int *)*param_1; piVar2 = (int *)param_1[1]; if (piVar1 != piVar2) { uVar6 = ((int)piVar2 - (int)piVar1) / 0xb8; if (0x1642c85 < uVar6) { LAB_007dccc0: /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar4); } uVar6 = uVar6 * 0xb8; param_1 = std::_Allocate(uVar6); *in_ECX = param_1; in_ECX[1] = param_1; in_ECX[2] = (void *)(uVar6 + (int)param_1); auStack_7 = (undefined1 [3])0x0; local_14 = piVar1 + 0x1a; do { local_8 = 1; FUN_007df140(local_14 + -0x1a); local_8 = 2; piVar1 = (int *)((int)param_1 + 0x68); *piVar1 = 0; *(undefined4 *)((int)param_1 + 0x6c) = 0; *(undefined4 *)((int)param_1 + 0x70) = 0; iVar8 = *local_14; iVar3 = local_14[1]; if (iVar8 != iVar3) { uVar6 = (iVar3 - iVar8) / 0x68; if (0x2762762 < uVar6) goto LAB_007dccc0; uVar6 = uVar6 * 0x68; pvVar5 = std::_Allocate(uVar6); *piVar1 = (int)pvVar5; *(void **)((int)param_1 + 0x6c) = pvVar5; *(void **)((int)param_1 + 0x70) = (void *)((int)pvVar5 + uVar6); iVar7 = *piVar1; local_8 = 4; do { FUN_007df140(iVar8); iVar7 = iVar7 + 0x68; iVar8 = iVar8 + 0x68; } while (iVar8 != iVar3); FUN_00731bf0(extraout_ECX); *(int *)((int)param_1 + 0x6c) = iVar7; } local_8 = 5; *(int *)((int)param_1 + 0x74) = local_14[3]; *(int *)((int)param_1 + 0x78) = local_14[4]; *(int *)((int)param_1 + 0x7c) = local_14[5]; *(int *)((int)param_1 + 0x80) = local_14[6]; std::string::string((char *)((int)param_1 + 0x84),local_14 + 7); local_8 = 6; std::string::string((char *)((int)param_1 + 0x9c),local_14 + 0xd); param_1 = (int *)((int)param_1 + 0xb8); piVar1 = local_14 + 0x14; local_14 = local_14 + 0x2e; } while (piVar1 != piVar2); in_ECX[1] = param_1; } ExceptionList = local_10; return in_ECX; } //@@ 007dccd0 FUN_007dccd0 void FUN_007dccd0(uint param_1) { void *_Dst; int iVar1; int *in_ECX; uint uVar2; _Dst = (void *)in_ECX[1]; iVar1 = *in_ECX; uVar2 = (int)_Dst - iVar1; if (param_1 < uVar2) { in_ECX[1] = iVar1 + param_1; return; } if (uVar2 < param_1) { if ((uint)(in_ECX[2] - iVar1) < param_1) { FUN_007dedb0(param_1,uVar2); return; } memset(_Dst,0,param_1 - uVar2); in_ECX[1] = (param_1 - uVar2) + (int)_Dst; } return; } //@@ 007dcd30 FUN_007dcd30 void FUN_007dcd30(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007dcd80 FUN_007dcd80 void FUN_007dcd80(void) { void *pvVar1; int *piVar2; uint size; undefined4 *in_ECX; void *ptr; piVar2 = (int *)*in_ECX; if (piVar2 == (int *)0x0) { return; } if (*piVar2 != 0) { FUN_00731b90(*piVar2); pvVar1 = (void *)*piVar2; size = ((piVar2[2] - (int)pvVar1) / 0xb8) * 0xb8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *piVar2 = 0; piVar2[1] = 0; piVar2[2] = 0; } return; } //@@ 007dcd90 FUN_007dcd90 undefined4 FUN_007dcd90(void) { void *ptr; short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); ptr = (void *)in_ECX[5]; if (ptr != (void *)0x0) { FUN_006efde0(); operator_delete(ptr,0x6dc); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x007dcde7. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 007dce00 std::deque<12byte>::_Tidy /* DB: pops all (size +0x10, off +0xc), deletes each 0xc block of the map at +4 (mapsize +8), frees map; same as 00752710 std::deque<12byte>::~deque the proxy delete; Entity_Player::room_exit, NetplayManager::reset */ void std::deque<12byte>::_Tidy(void) { void *pvVar1; void *ptr; int in_ECX; uint size; int iVar2; iVar2 = *(int *)(in_ECX + 0x10); if (iVar2 != 0) { do { iVar2 = iVar2 + -1; *(int *)(in_ECX + 0x10) = iVar2; } while (iVar2 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; } iVar2 = *(int *)(in_ECX + 8); while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(*(int *)(in_ECX + 4) + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0xc); } } pvVar1 = *(void **)(in_ECX + 4); if (pvVar1 != (void *)0x0) { size = *(int *)(in_ECX + 8) * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 007dce90 FUN_007dce90 void FUN_007dce90(undefined4 *param_1,undefined4 param_2,undefined4 param_3,int param_4, undefined4 param_5,undefined4 param_6,int param_7) { int *piVar1; int iVar2; undefined4 *in_ECX; int iVar3; undefined4 local_8; if (in_ECX == (undefined4 *)0x0) { local_8 = 0; } else { local_8 = *in_ECX; } iVar2 = in_ECX[3]; iVar3 = param_7 - param_4; if (iVar3 == 0) { *param_1 = local_8; param_1[2] = param_4; param_1[1] = 0; return; } if ((uint)(param_4 - iVar2) < (uint)((in_ECX[4] - param_7) + in_ECX[3])) { FUN_007dde40(*in_ECX,0,in_ECX[3],local_8,0,param_4,local_8,0,param_7); do { piVar1 = in_ECX + 4; *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { in_ECX[3] = 0; } else { in_ECX[3] = in_ECX[3] + 1; } iVar3 = iVar3 + -1; } while (iVar3 != 0); } else { FUN_007ddee0(local_8,0,param_7,*in_ECX,0,in_ECX[4] + in_ECX[3],local_8,0,param_4); do { piVar1 = in_ECX + 4; *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { in_ECX[3] = 0; } iVar3 = iVar3 + -1; } while (iVar3 != 0); } *param_1 = *in_ECX; param_1[2] = in_ECX[3] + (param_4 - iVar2); param_1[1] = 0; return; } //@@ 007dcfd0 FUN_007dcfd0 void FUN_007dcfd0(void) { FUN_007ddf80(); return; } //@@ 007dcff0 FUN_007dcff0 void FUN_007dcff0(void) { int iVar1; int iVar2; void *pvVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00630; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = in_ECX[1]; iVar2 = *in_ECX; pvVar3 = std::_Allocate(0x2600); local_8 = 0; FUN_007dd240(*in_ECX,in_ECX[1],pvVar3); FUN_007dd1b0(pvVar3,(iVar1 - iVar2) / 0x130,0x20); ExceptionList = local_10; return; } //@@ 007dd075 Catch_All@007dd075 void Catch_All_007dd075(void) { int unaff_EBP; FUN_007dd2d0(*(undefined4 *)(unaff_EBP + -0x14),0x20); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007dd090 std::deque::operator_assign /* DB: (other): overwrites existing 8-byte elements (2 per block) from other, push_backs the remainder or pops the surplus from the back; Entity_Player::StoreGameState/RestoreGameState copy a deque (position history) with it; same shape as 004b0e40 std::deque::assign */ void std::deque::operator_assign(int param_1) { int *piVar1; undefined4 uVar2; int iVar3; uint uVar4; uint uVar5; uint uVar6; int iVar7; int in_ECX; uint uVar8; uint uVar9; uint uVar10; uVar10 = *(uint *)(param_1 + 0xc); uVar4 = *(int *)(param_1 + 0x10) + uVar10; uVar9 = *(uint *)(in_ECX + 0xc); uVar5 = *(int *)(in_ECX + 0x10) + uVar9; while( true ) { if (uVar10 == uVar4) { for (iVar7 = uVar5 - uVar9; iVar7 != 0; iVar7 = iVar7 + -1) { piVar1 = (int *)(in_ECX + 0x10); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; } } return; } if (uVar9 == uVar5) break; uVar8 = uVar10 >> 1; uVar6 = uVar10 & 1; uVar10 = uVar10 + 1; iVar7 = *(int *)(*(int *)(param_1 + 4) + (uVar8 & *(int *)(param_1 + 8) - 1U) * 4); uVar2 = *(undefined4 *)(iVar7 + 4 + uVar6 * 8); iVar3 = *(int *)(*(int *)(in_ECX + 4) + (uVar9 >> 1 & *(int *)(in_ECX + 8) - 1U) * 4); *(undefined4 *)(iVar3 + (uVar9 & 1) * 8) = *(undefined4 *)(iVar7 + uVar6 * 8); *(undefined4 *)(iVar3 + 4 + (uVar9 & 1) * 8) = uVar2; uVar9 = uVar9 + 1; } do { push_back(*(int *)(*(int *)(param_1 + 4) + (uVar10 >> 1 & *(int *)(param_1 + 8) - 1U) * 4) + (uVar10 & 1) * 8); uVar10 = uVar10 + 1; } while (uVar10 != uVar4); return; } //@@ 007dd1b0 FUN_007dd1b0 void FUN_007dd1b0(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_007ddf80(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x130) * 0x130; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x130 + param_1; in_ECX[2] = param_3 * 0x130 + param_1; return; } //@@ 007dd240 FUN_007dd240 void FUN_007dd240(int param_1,int param_2) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0065d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 0x130) { FUN_007de0e0(param_1); ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_007ddf80(in_ECX,uVar2); ExceptionList = local_10; return; } //@@ 007dd2d0 FUN_007dd2d0 void FUN_007dd2d0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x130; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 007dd310 FUN_007dd310 void FUN_007dd310(void) { undefined4 uVar1; undefined4 uVar2; int in_ECX; int in_EDX; uint uVar3; uint uVar4; int iVar5; uVar4 = in_EDX - in_ECX >> 3; iVar5 = uVar4 - 1; if (0 < iVar5) { do { if (uVar4 == 0) { uVar3 = 0; } else { uVar3 = Random(); uVar3 = uVar3 % uVar4; } uVar1 = *(undefined4 *)(in_ECX + iVar5 * 8); uVar4 = uVar4 - 1; uVar2 = *(undefined4 *)(in_ECX + 4 + iVar5 * 8); *(undefined4 *)(in_ECX + iVar5 * 8) = *(undefined4 *)(in_ECX + uVar3 * 8); *(undefined4 *)(in_ECX + 4 + iVar5 * 8) = *(undefined4 *)(in_ECX + 4 + uVar3 * 8); iVar5 = iVar5 + -1; *(undefined4 *)(in_ECX + uVar3 * 8) = uVar1; *(undefined4 *)(in_ECX + 4 + uVar3 * 8) = uVar2; } while (0 < iVar5); } return; } //@@ 007dd380 scale_for_hard_difficulty /* DB: returns ECX*8 when g_game+0x26614 (difficulty) >= 2, else ECX prototype: db/protos.zhl */ int __fastcall scale_for_hard_difficulty(int value) { int iVar1; iVar1 = value * 8; if (*(int *)&g_game->_deathmatchManager < 2) { iVar1 = value; } return iVar1; } //@@ 007dd3a0 FUN_007dd3a0 byte * FUN_007dd3a0(void) { byte *in_ECX; byte *in_EDX; if (*in_EDX < *in_ECX) { in_ECX = in_EDX; } return in_ECX; } //@@ 007dd3b0 Vector::operator_assign /* DB: ?8-byte copy (ICF-foldable) prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::operator_assign(Vector *this,Vector *other) { this->x = other->x; this->y = other->y; return this; } //@@ 007dd3d0 FUN_007dd3d0 void FUN_007dd3d0(undefined4 param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_007de1a0(param_1); uVar1 = puVar4[1]; puVar4[1] = in_ECX[1]; in_ECX[1] = uVar1; uVar1 = *puVar4; *puVar4 = *in_ECX; *in_ECX = uVar1; local_8 = 0; if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 0xc))(uVar3); if ((cVar2 != '\0') && (DAT_00c7f480 != (code *)0x0)) { (*DAT_00c7f480)(local_18); } } ExceptionList = local_10; return; } //@@ 007dd460 FUN_007dd460 bool FUN_007dd460(void) { short sVar1; sVar1 = fdclass(); return sVar1 < 1; } //@@ 007dd490 FUN_007dd490 void FUN_007dd490(undefined4 *param_1) { undefined4 uVar1; undefined4 *in_ECX; undefined4 *in_EDX; *in_ECX = *in_EDX; uVar1 = *param_1; in_ECX[2] = param_1[1]; in_ECX[1] = uVar1; return; } //@@ 007dd4b0 std::bitset<32>::to_string /* DB: builds a std::string of 32 chars from bit 31 down, '|' for set bits and '.' for clear (to_string('.', '|')); caller Game::render_debug_player_info */ undefined4 * std::bitset<32>::to_string(undefined4 *param_1) { uint uVar1; char *pcVar2; uint uVar3; void *_Src; uint uVar4; uint uVar5; undefined4 *puVar6; void *_Dst; int in_ECX; uint uVar7; char cVar8; uint uVar9; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afe6fe; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; local_8 = 0; FUN_00753230(0x20); uVar5 = 0x20; do { uVar3 = param_1[5]; uVar5 = uVar5 - 1; uVar7 = param_1[4]; cVar8 = (-((1 << ((byte)uVar5 & 0x1f) & *(uint *)(in_ECX + (uVar5 >> 5) * 4)) != 0) & 0x4eU) + 0x2e; if (uVar7 < uVar3) { param_1[4] = uVar7 + 1; puVar6 = param_1; if (0xf < uVar3) { puVar6 = (undefined4 *)*param_1; } *(char *)((int)puVar6 + uVar7) = cVar8; *(undefined1 *)((int)puVar6 + uVar7 + 1) = 0; } else { if (uVar7 == 0x7fffffff) { /* WARNING: Subroutine does not return */ string::_Xlen(uVar4); } uVar9 = uVar7 + 1 | 0xf; if (uVar9 < 0x80000000) { if (0x7fffffff - (uVar3 >> 1) < uVar3) { uVar9 = 0x7fffffff; } else { uVar1 = (uVar3 >> 1) + uVar3; if (uVar9 < uVar1) { uVar9 = uVar1; } } } else { uVar9 = 0x7fffffff; } _Dst = _Allocate(uVar9 + 1); param_1[4] = uVar7 + 1; param_1[5] = uVar9; pcVar2 = (char *)((int)_Dst + uVar7); if (uVar3 < 0x10) { memcpy(_Dst,param_1,uVar7); *pcVar2 = cVar8; pcVar2[1] = '\0'; } else { _Src = (void *)*param_1; memcpy(_Dst,_Src,uVar7); uVar7 = uVar3 + 1; *pcVar2 = cVar8; pcVar2[1] = '\0'; ptr = _Src; if (0xfff < uVar7) { ptr = *(void **)((int)_Src + -4); uVar7 = uVar3 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *param_1 = _Dst; } } while (uVar5 != 0); ExceptionList = local_10; return param_1; } //@@ 007dd660 FUN_007dd660 void FUN_007dd660(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::set::_Emplace(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 007dd690 FUN_007dd690 undefined4 * FUN_007dd690(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; void *pvVar5; undefined4 *puVar6; int iVar7; uint uVar8; undefined4 *puVar9; void *ptr; int *in_ECX; uint uVar10; uint uVar11; undefined4 *puVar12; undefined4 *puVar13; undefined4 *puVar14; iVar2 = *in_ECX; iVar7 = in_ECX[1] - iVar2 >> 3; if (iVar7 == 0x1fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar8 = iVar7 + 1; uVar10 = in_ECX[2] - iVar2 >> 3; if (0x1fffffff - (uVar10 >> 1) < uVar10) { uVar11 = 0x1fffffff; } else { uVar10 = (uVar10 >> 1) + uVar10; uVar11 = uVar8; if (uVar8 <= uVar10) { uVar11 = uVar10; } if (0x1fffffff < uVar11) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar9 = std::_Allocate(uVar11 * 8); puVar1 = puVar9 + ((int)param_1 - iVar2 >> 3) * 2; uVar3 = param_2[1]; *puVar1 = *param_2; puVar1[1] = uVar3; puVar12 = (undefined4 *)*in_ECX; puVar13 = (undefined4 *)in_ECX[1]; puVar6 = puVar9; if (param_1 == puVar13) { for (; puVar12 != puVar13; puVar12 = puVar12 + 2) { uVar3 = puVar12[1]; *puVar6 = *puVar12; puVar6[1] = uVar3; puVar6 = puVar6 + 2; } } else { puVar14 = puVar9; puVar6 = param_1; if (puVar12 != param_1) { do { uVar3 = *puVar12; uVar4 = puVar12[1]; puVar12 = puVar12 + 2; *puVar14 = uVar3; puVar14[1] = uVar4; puVar14 = puVar14 + 2; } while (puVar12 != param_1); puVar13 = (undefined4 *)in_ECX[1]; } for (; puVar6 != puVar13; puVar6 = puVar6 + 2) { uVar3 = puVar6[1]; *(undefined4 *)((int)puVar1 + (8 - (int)param_1) + (int)puVar6) = *puVar6; *(undefined4 *)((int)puVar1 + (0xc - (int)param_1) + (int)puVar6) = uVar3; } } pvVar5 = (void *)*in_ECX; if (pvVar5 != (void *)0x0) { uVar10 = in_ECX[2] - (int)pvVar5 & 0xfffffff8; ptr = pvVar5; if (0xfff < uVar10) { ptr = *(void **)((int)pvVar5 + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar10); } *in_ECX = (int)puVar9; in_ECX[1] = (int)(puVar9 + uVar8 * 2); in_ECX[2] = (int)(puVar9 + uVar11 * 2); return puVar1; } //@@ 007dd800 FUN_007dd800 void FUN_007dd800(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6694; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7f480 != (code *)0x0)) { (*DAT_00c7f480)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 007dd8a0 FUN_007dd8a0 void FUN_007dd8a0(ANM2 *param_1) { ANM2 *in_EDX; ANM2::ANM2(in_EDX,param_1); *(undefined4 *)in_EDX[1]._filename._buf = *(undefined4 *)param_1[1]._filename._buf; *(undefined4 *)(in_EDX[1]._filename._buf + 4) = *(undefined4 *)(param_1[1]._filename._buf + 4); in_EDX[1]._filename._buf[8] = param_1[1]._filename._buf[8]; in_EDX[1]._filename._buf[9] = param_1[1]._filename._buf[9]; in_EDX[1]._filename._buf[10] = param_1[1]._filename._buf[10]; in_EDX[1]._filename._buf[0xb] = param_1[1]._filename._buf[0xb]; *(undefined4 *)(in_EDX[1]._filename._buf + 0xc) = *(undefined4 *)(param_1[1]._filename._buf + 0xc) ; in_EDX[1]._filename._size = param_1[1]._filename._size; *(char *)&in_EDX[1]._filename._capacity = (char)param_1[1]._filename._capacity; *(undefined1 *)((int)&in_EDX[1]._filename._capacity + 1) = *(undefined1 *)((int)¶m_1[1]._filename._capacity + 1); *(undefined4 *)in_EDX[1]._animDefaultName._buf = *(undefined4 *)param_1[1]._animDefaultName._buf; return; } //@@ 007dd940 FUN_007dd940 void * FUN_007dd940(int param_1,undefined4 param_2) { uint uVar1; int iVar2; int iVar3; void *pvVar4; void *pvVar5; int *in_ECX; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00680; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0x130; if (iVar3 == 0xd79435) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0x130; if (0xd79435 - (uVar1 >> 1) < uVar1) { uVar6 = 0xd79435; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar6 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar6 = uVar1; } if (0xd79435 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = std::_Allocate(uVar6 * 0x130); local_8 = 0; pvVar5 = (void *)(((param_1 - iVar2) / 0x130) * 0x130 + (int)pvVar4); FUN_007dd8a0(param_2); if (param_1 == in_ECX[1]) { FUN_007dd240(*in_ECX,in_ECX[1],pvVar4); } else { FUN_007de200(*in_ECX,param_1,pvVar4); FUN_007de200(param_1,in_ECX[1],(int)pvVar5 + 0x130); } FUN_007dd1b0(pvVar4,iVar3 + 1,uVar6); ExceptionList = local_10; return pvVar5; } //@@ 007dda8e Catch_All@007dda8e void Catch_All_007dda8e(void) { int unaff_EBP; FUN_007dcfd0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_007dd2d0(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007ddac0 FUN_007ddac0 void * FUN_007ddac0(int param_1,undefined4 param_2) { uint uVar1; int iVar2; int iVar3; void *pvVar4; void *pvVar5; int *in_ECX; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b006a0; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0x130; if (iVar3 == 0xd79435) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0x130; if (0xd79435 - (uVar1 >> 1) < uVar1) { uVar6 = 0xd79435; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar6 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar6 = uVar1; } if (0xd79435 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = std::_Allocate(uVar6 * 0x130); local_8 = 0; pvVar5 = (void *)(((param_1 - iVar2) / 0x130) * 0x130 + (int)pvVar4); FUN_007de0e0(param_2); if (param_1 == in_ECX[1]) { FUN_007dd240(*in_ECX,in_ECX[1],pvVar4); } else { FUN_007de200(*in_ECX,param_1,pvVar4); FUN_007de200(param_1,in_ECX[1],(int)pvVar5 + 0x130); } FUN_007dd1b0(pvVar4,iVar3 + 1,uVar6); ExceptionList = local_10; return pvVar5; } //@@ 007ddc0b Catch_All@007ddc0b void Catch_All_007ddc0b(void) { int unaff_EBP; FUN_007dcfd0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_007dd2d0(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007ddc40 FUN_007ddc40 undefined4 * FUN_007ddc40(void *param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; int iVar3; void *_Src; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; int iVar7; void *_Dst; int *in_ECX; uint uVar8; uint uVar9; iVar3 = *in_ECX; iVar7 = in_ECX[1] - iVar3 >> 4; if (iVar7 == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar7 + 1; uVar8 = in_ECX[2] - iVar3 >> 4; if (0xfffffff - (uVar8 >> 1) < uVar8) { uVar9 = 0xfffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; uVar9 = uVar1; if (uVar1 <= uVar8) { uVar9 = uVar8; } if (0xfffffff < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar9 << 4); puVar2 = (undefined4 *)(((int)param_1 - iVar3 & 0xfffffff0U) + (int)_Dst); uVar4 = param_2[1]; uVar5 = param_2[2]; uVar6 = param_2[3]; *puVar2 = *param_2; puVar2[1] = uVar4; puVar2[2] = uVar5; puVar2[3] = uVar6; _Src = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,_Src,in_ECX[1] - (int)_Src); } else { memmove(_Dst,_Src,(int)param_1 - (int)_Src); memmove(puVar2 + 4,param_1,in_ECX[1] - (int)param_1); } FUN_007de290(_Dst,uVar1,uVar9); return puVar2; } //@@ 007ddd20 vector_PlayerItemBackup_emplace_reallocate /* DB: ? std::vector<0x34-byte element>::_Emplace_reallocate (max 0x4ec4ec4); only callers Entity_Player::StoreGameState and Entity_Player::AddCurseMistEffect (backing up player item/state records) */ undefined4 * vector_PlayerItemBackup_emplace_reallocate(int param_1,undefined4 *param_2) { uint uVar1; int iVar2; int iVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; void *pvVar7; int *in_ECX; uint uVar8; undefined4 *puVar9; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0x34; if (iVar3 == 0x4ec4ec4) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0x34; if (0x4ec4ec4 - (uVar1 >> 1) < uVar1) { uVar8 = 0x4ec4ec4; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar8 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar8 = uVar1; } if (0x4ec4ec4 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar7 = std::_Allocate(uVar8 * 0x34); puVar9 = (undefined4 *)(((param_1 - iVar2) / 0x34) * 0x34 + (int)pvVar7); uVar4 = param_2[1]; uVar5 = param_2[2]; uVar6 = param_2[3]; *puVar9 = *param_2; puVar9[1] = uVar4; puVar9[2] = uVar5; puVar9[3] = uVar6; uVar4 = param_2[5]; uVar5 = param_2[6]; uVar6 = param_2[7]; puVar9[4] = param_2[4]; puVar9[5] = uVar4; puVar9[6] = uVar5; puVar9[7] = uVar6; uVar4 = param_2[9]; uVar5 = param_2[10]; uVar6 = param_2[0xb]; puVar9[8] = param_2[8]; puVar9[9] = uVar4; puVar9[10] = uVar5; puVar9[0xb] = uVar6; puVar9[0xc] = param_2[0xc]; if (param_1 == in_ECX[1]) { FUN_007de3a0(*in_ECX,in_ECX[1],pvVar7); } else { FUN_007de3e0(*in_ECX,param_1,pvVar7); FUN_007de3e0(param_1,in_ECX[1],puVar9 + 0xd); } FUN_007de330(pvVar7,iVar3 + 1,uVar8); return puVar9; } //@@ 007dde40 FUN_007dde40 undefined4 * FUN_007dde40(undefined4 param_1,undefined4 param_2,uint param_3,int *param_4,undefined4 param_5, uint param_6,int *param_7,undefined4 param_8,uint param_9) { undefined4 *puVar1; undefined4 *puVar2; int iVar3; undefined4 *in_ECX; int iVar4; if (param_4 == (int *)0x0) { iVar3 = 0; } else { iVar3 = *param_4; } if (param_7 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *param_7; } if (param_3 != param_6) { do { param_6 = param_6 - 1; param_9 = param_9 - 1; puVar1 = *(undefined4 **)(*(int *)(iVar3 + 4) + (*(int *)(iVar3 + 8) - 1U & param_6) * 4); puVar2 = *(undefined4 **)(*(int *)(iVar4 + 4) + (*(int *)(iVar4 + 8) - 1U & param_9) * 4); *puVar2 = *puVar1; puVar2[1] = puVar1[1]; puVar2[2] = puVar1[2]; } while (param_6 != param_3); } *in_ECX = param_7; in_ECX[2] = param_9; in_ECX[1] = 0; return in_ECX; } //@@ 007ddee0 FUN_007ddee0 undefined4 * FUN_007ddee0(int *param_1,undefined4 param_2,uint param_3,undefined4 param_4,undefined4 param_5, uint param_6,int *param_7,undefined4 param_8,uint param_9) { undefined4 *puVar1; undefined4 *puVar2; int iVar3; undefined4 *in_ECX; int iVar4; uint uVar5; if (param_1 == (int *)0x0) { iVar3 = 0; } else { iVar3 = *param_1; } if (param_7 == (int *)0x0) { iVar4 = 0; } else { iVar4 = *param_7; } if (param_3 != param_6) { do { uVar5 = *(int *)(iVar3 + 8) - 1U & param_3; param_3 = param_3 + 1; puVar1 = *(undefined4 **)(*(int *)(iVar3 + 4) + uVar5 * 4); uVar5 = *(int *)(iVar4 + 8) - 1U & param_9; param_9 = param_9 + 1; puVar2 = *(undefined4 **)(*(int *)(iVar4 + 4) + uVar5 * 4); *puVar2 = *puVar1; puVar2[1] = puVar1[1]; puVar2[2] = puVar1[2]; } while (param_3 != param_6); } *in_ECX = param_7; in_ECX[2] = param_9; in_ECX[1] = 0; return in_ECX; } //@@ 007ddf80 FUN_007ddf80 void FUN_007ddf80(void) { int *piVar1; int iVar2; uint uVar3; qword qVar4; int *in_ECX; int *in_EDX; qword *pqVar5; int *piVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b006c0; local_10 = ExceptionList; ExceptionList = &local_10; if (in_ECX != in_EDX) { piVar6 = in_ECX + 0x17; do { local_8 = 0; ANM2::Reset((ANM2 *)(piVar6 + -0x17)); iVar2 = piVar6[-1]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar6[-1] = 0; } iVar2 = *piVar6; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); *piVar6 = 0; } iVar2 = piVar6[-9]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar6[-9] = 0; } iVar2 = piVar6[-8]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar6[-8] = 0; } std::string::_Tidy_deallocate((char *)(piVar6 + -0x11)); std::string::_Tidy_deallocate((char *)(piVar6 + -0x17)); piVar1 = piVar6 + 0x35; piVar6 = piVar6 + 0x4c; } while (piVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 007de0e0 FUN_007de0e0 void FUN_007de0e0(ANM2 *param_1) { ANM2 *in_ECX; ANM2::ANM2(in_ECX,param_1); *(undefined4 *)in_ECX[1]._filename._buf = *(undefined4 *)param_1[1]._filename._buf; *(undefined4 *)(in_ECX[1]._filename._buf + 4) = *(undefined4 *)(param_1[1]._filename._buf + 4); in_ECX[1]._filename._buf[8] = param_1[1]._filename._buf[8]; in_ECX[1]._filename._buf[9] = param_1[1]._filename._buf[9]; in_ECX[1]._filename._buf[10] = param_1[1]._filename._buf[10]; in_ECX[1]._filename._buf[0xb] = param_1[1]._filename._buf[0xb]; *(undefined4 *)(in_ECX[1]._filename._buf + 0xc) = *(undefined4 *)(param_1[1]._filename._buf + 0xc) ; in_ECX[1]._filename._size = param_1[1]._filename._size; *(char *)&in_ECX[1]._filename._capacity = (char)param_1[1]._filename._capacity; *(undefined1 *)((int)&in_ECX[1]._filename._capacity + 1) = *(undefined1 *)((int)¶m_1[1]._filename._capacity + 1); *(undefined4 *)in_ECX[1]._animDefaultName._buf = *(undefined4 *)param_1[1]._animDefaultName._buf; return; } //@@ 007de190 FUN_007de190 void FUN_007de190(void) { FUN_007ddf80(); return; } //@@ 007de1a0 FUN_007de1a0 void FUN_007de1a0(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (DAT_00c7f480 != (code *)0x0)) { (*DAT_00c7f480)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 007de200 FUN_007de200 int FUN_007de200(int param_1,int param_2,int param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0065d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 0x130) { FUN_007dd8a0(param_1,uVar2); param_3 = param_3 + 0x130; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_007ddf80(in_ECX); ExceptionList = local_10; return param_3; } //@@ 007de290 FUN_007de290 void FUN_007de290(int param_1,int param_2,int param_3) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffff0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x10 + param_1; in_ECX[2] = param_3 * 0x10 + param_1; return; } //@@ 007de2f0 FUN_007de2f0 void FUN_007de2f0(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[6] = 0; param_1 = param_1 + 7; } return; } //@@ 007de330 FUN_007de330 void FUN_007de330(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x34) * 0x34; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x34 + param_1; in_ECX[2] = param_3 * 0x34 + param_1; return; } //@@ 007de3a0 FUN_007de3a0 void FUN_007de3a0(undefined4 *param_1,undefined4 *param_2,int param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; if (param_1 != param_2) { param_3 = param_3 - (int)param_1; do { uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; puVar1 = (undefined4 *)(param_3 + (int)param_1); *puVar1 = *param_1; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; uVar2 = param_1[5]; uVar3 = param_1[6]; uVar4 = param_1[7]; puVar1 = (undefined4 *)(param_3 + 0x10 + (int)param_1); *puVar1 = param_1[4]; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; uVar2 = param_1[9]; uVar3 = param_1[10]; uVar4 = param_1[0xb]; puVar1 = (undefined4 *)(param_3 + 0x20 + (int)param_1); *puVar1 = param_1[8]; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; *(undefined4 *)(param_3 + 0x30 + (int)param_1) = param_1[0xc]; param_1 = param_1 + 0xd; } while (param_1 != param_2); } return; } //@@ 007de3e0 FUN_007de3e0 void FUN_007de3e0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; for (; param_1 != param_2; param_1 = param_1 + 0xd) { uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *param_3 = *param_1; param_3[1] = uVar1; param_3[2] = uVar2; param_3[3] = uVar3; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; param_3[4] = param_1[4]; param_3[5] = uVar1; param_3[6] = uVar2; param_3[7] = uVar3; uVar1 = param_1[9]; uVar2 = param_1[10]; uVar3 = param_1[0xb]; param_3[8] = param_1[8]; param_3[9] = uVar1; param_3[10] = uVar2; param_3[0xb] = uVar3; param_3[0xc] = param_1[0xc]; param_3 = param_3 + 0xd; } return; } //@@ 007de420 std::fill_n<4byte> /* DB: (dest, count, &value): memset 0 when value is 0, otherwise stores value count times (unrolled by 4); returns dest + count; callers Entity_Player::CalculateBagOfCraftingOutput, Menu_Character::Reset, 0094e670 std::vector::_Resize_reallocate int * std::fill_n<4byte>(int *param_1,uint param_2,int *param_3) { int iVar1; if (*param_3 == 0) { memset(param_1,0,param_2 * 4); return param_1 + param_2; } if (3 < param_2) { iVar1 = (param_2 - 4 >> 2) + 1; do { param_2 = param_2 - 4; *param_1 = *param_3; param_1[1] = *param_3; param_1[2] = *param_3; param_1[3] = *param_3; param_1 = param_1 + 4; iVar1 = iVar1 + -1; } while (iVar1 != 0); } for (; param_2 != 0; param_2 = param_2 - 1) { *param_1 = *param_3; param_1 = param_1 + 1; } return param_1; } //@@ 007de4b0 FUN_007de4b0 EntitySaveState * FUN_007de4b0(EntitySaveState *param_1,int param_2) { int extraout_ECX; int extraout_EDX; if (param_2 != 0) { do { EntitySaveState::constructor(param_1); param_1 = (EntitySaveState *)(extraout_ECX + 0x78); } while (extraout_EDX != 1); } return param_1; } //@@ 007de4e0 std::vector<8byte>::insert_range /* DB: MSVC vector range insert(pos, first, last) for 8-byte elements (1.5x growth, _Xlen at 0x1fffffff, memmove tail); Entity_Player::remove_twin calls it right after std::vector<4byte>::insert_range to append the twin's +0x1760..0x1764 vector into this player's */ void std::vector<8byte>::insert_range(void *param_1,int param_2,int param_3) { uint uVar1; void *pvVar2; uint uVar3; uint *puVar4; int iVar5; int *in_ECX; int iVar6; uint uVar7; void *pvVar8; size_t _Size; uint local_14; iVar5 = *in_ECX; uVar7 = param_3 - param_2 >> 3; pvVar2 = (void *)in_ECX[1]; if (uVar7 != 0) { if ((uint)(in_ECX[2] - (int)pvVar2 >> 3) < uVar7) { iVar6 = (int)pvVar2 - iVar5 >> 3; if (0x1fffffffU - iVar6 < uVar7) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar6 + uVar7; uVar3 = in_ECX[2] - iVar5 >> 3; if (0x1fffffff - (uVar3 >> 1) < uVar3) { local_14 = 0x1fffffff; } else { uVar3 = uVar3 + (uVar3 >> 1); local_14 = uVar1; if (uVar1 <= uVar3) { local_14 = uVar3; } if (0x1fffffff < local_14) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = _Allocate(local_14 << 3); iVar6 = (int)param_1 - iVar5 >> 3; FUN_0042f550(param_2,param_3,puVar4 + iVar6 * 2); if ((uVar7 == 1) && (param_1 == pvVar2)) { FUN_0042f6f0(iVar5,pvVar2,puVar4); } else { FUN_0042f550(iVar5,param_1,puVar4); FUN_0042f550(param_1,pvVar2,puVar4 + (iVar6 + uVar7) * 2); } FID_conflict__Change_array(in_ECX,puVar4,uVar1,local_14); return; } if (uVar7 < (uint)((int)pvVar2 - (int)param_1 >> 3)) { pvVar8 = (void *)((int)pvVar2 + uVar7 * -8); iVar5 = FUN_0042f550(pvVar8,pvVar2,pvVar2); _Size = (int)pvVar8 - (int)param_1; in_ECX[1] = iVar5; memmove((void *)((int)pvVar2 - _Size),param_1,_Size); } else { iVar5 = FUN_0042f550(param_1,pvVar2,(void *)(uVar7 * 8 + (int)param_1)); in_ECX[1] = iVar5; } FUN_0042f550(param_2,param_3,param_1); } return; } //@@ 007de660 std::string::append_reversed /* DB: ? appends the chars of [param_2, param_1) in reverse (reverse_iterator range) to ECX std::string, growing with the 0x7fffffff checks; caller Game::render_debug_player_info */ void std::string::append_reversed(undefined1 *param_1,undefined1 *param_2) { undefined1 *puVar1; undefined1 uVar2; uint uVar3; void *_Src; uint uVar4; undefined4 *puVar5; uint uVar6; void *_Dst; void *ptr; undefined4 *in_ECX; uint uVar7; uint uVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b006ed; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00753230((int)param_1 - (int)param_2); local_8 = 0; while( true ) { while( true ) { if (param_1 == param_2) { ExceptionList = local_10; return; } uVar8 = in_ECX[4]; param_1 = param_1 + -1; uVar3 = in_ECX[5]; uVar2 = *param_1; if (uVar3 <= uVar8) break; in_ECX[4] = uVar8 + 1; puVar5 = in_ECX; if (0xf < uVar3) { puVar5 = (undefined4 *)*in_ECX; } *(undefined1 *)((int)puVar5 + uVar8) = uVar2; *(undefined1 *)((int)puVar5 + uVar8 + 1) = 0; } if (uVar8 == 0x7fffffff) break; uVar7 = uVar8 + 1 | 0xf; if (uVar7 < 0x80000000) { if (0x7fffffff - (uVar3 >> 1) < uVar3) { uVar7 = 0x7fffffff; } else { uVar6 = (uVar3 >> 1) + uVar3; if (uVar7 < uVar6) { uVar7 = uVar6; } } } else { uVar7 = 0x7fffffff; } _Dst = _Allocate(uVar7 + 1); in_ECX[5] = uVar7; in_ECX[4] = uVar8 + 1; puVar1 = (undefined1 *)((int)_Dst + uVar8); if (uVar3 < 0x10) { memcpy(_Dst,in_ECX,uVar8); *puVar1 = uVar2; puVar1[1] = 0; } else { _Src = (void *)*in_ECX; memcpy(_Dst,_Src,uVar8); uVar8 = uVar3 + 1; *puVar1 = uVar2; puVar1[1] = 0; ptr = _Src; if (0xfff < uVar8) { ptr = *(void **)((int)_Src + -4); uVar8 = uVar3 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar8); } *in_ECX = _Dst; } /* WARNING: Subroutine does not return */ _Xlen(uVar4); } //@@ 007de7f0 std::set::_Emplace /* DB: MSVC _Tree insert-unique: walks tree comparing node+0x10 int, returns {node,false} if found, else operator_new(0x14) node (max_size 0xccccccc); wrapper 0x7dd660 used by Entity_Player::RecomputeWispCollectibles */ void std::set::_Emplace(undefined4 *param_1,int *param_2) { char cVar1; int *piVar2; undefined4 *puVar3; bool bVar4; int *piVar5; undefined4 *puVar6; undefined4 *in_ECX; undefined4 *puVar7; int *piVar8; undefined4 *puVar9; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0071d; local_10 = ExceptionList; piVar2 = (int *)*in_ECX; bVar4 = false; local_14 = (int *)piVar2[1]; piVar8 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar5 = local_14; do { local_14 = piVar5; if (local_14[4] < *param_2) { piVar5 = (int *)local_14[2]; } else { piVar5 = (int *)*local_14; piVar8 = local_14; } bVar4 = *param_2 <= local_14[4]; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if ((*(char *)((int)piVar8 + 0xd) == '\0') && (piVar8[4] <= *param_2)) { *param_1 = piVar8; *(undefined1 *)(param_1 + 1) = 0; return; } ExceptionList = &local_10; if (in_ECX[1] == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; puVar6 = operator_new(0x14); puVar6[4] = *param_2; *puVar6 = piVar2; puVar6[1] = piVar2; puVar6[2] = piVar2; *(undefined2 *)(puVar6 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; puVar6[1] = local_14; if (local_14 == piVar2) { *piVar2 = (int)puVar6; piVar2[1] = (int)puVar6; piVar2[2] = (int)puVar6; *(undefined1 *)(puVar6 + 3) = 1; } else { if (bVar4) { *local_14 = (int)puVar6; if (local_14 == (int *)*piVar2) { *piVar2 = (int)puVar6; } } else { local_14[2] = (int)puVar6; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)puVar6; } } cVar1 = *(char *)(puVar6[1] + 0xc); puVar9 = puVar6; while (cVar1 == '\0') { puVar3 = (undefined4 *)puVar9[1]; puVar7 = *(undefined4 **)puVar3[1]; if (puVar3 == puVar7) { puVar7 = (undefined4 *)((undefined4 *)puVar3[1])[2]; if (*(char *)(puVar7 + 3) == '\0') goto LAB_007de96b; if (puVar9 == (undefined4 *)puVar3[2]) { FUN_00415fe0(puVar3); puVar9 = puVar3; } *(undefined1 *)(puVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar9[1] + 4)); } else if (*(char *)(puVar7 + 3) == '\0') { LAB_007de96b: *(undefined1 *)(puVar3 + 3) = 1; *(undefined1 *)(puVar7 + 3) = 1; *(undefined1 *)(*(int *)(puVar9[1] + 4) + 0xc) = 0; puVar9 = *(undefined4 **)(puVar9[1] + 4); } else { if (puVar9 == (undefined4 *)*puVar3) { FUN_00415f80(puVar3); puVar9 = puVar3; } *(undefined1 *)(puVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar9[1] + 4)); } cVar1 = *(char *)(puVar9[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *param_1 = puVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 007de9f0 FUN_007de9f0 void FUN_007de9f0(uint param_1) { undefined4 uVar1; undefined4 *puVar2; int *in_ECX; uint uVar3; undefined4 *puVar4; undefined4 *puVar5; int iVar6; undefined4 *puVar7; uint size; int iVar8; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar3 = in_ECX[2] - *in_ECX >> 2; iVar8 = in_ECX[1] - *in_ECX >> 2; if (0x3fffffff - (uVar3 >> 1) < uVar3) { uVar3 = 0x3fffffff; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < param_1) { uVar3 = param_1; } else if (0x3fffffff < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar2 = std::_Allocate(uVar3 * 4); puVar4 = puVar2 + iVar8; for (iVar6 = param_1 - iVar8; iVar6 != 0; iVar6 = iVar6 + -1) { *puVar4 = 0; puVar4 = puVar4 + 1; } puVar4 = (undefined4 *)*in_ECX; puVar5 = (undefined4 *)in_ECX[1]; puVar7 = puVar2; if (puVar4 != puVar5) { do { uVar1 = *puVar4; puVar4 = puVar4 + 1; *puVar7 = uVar1; puVar7 = puVar7 + 1; } while (puVar4 != puVar5); puVar4 = (undefined4 *)*in_ECX; } if (puVar4 != (undefined4 *)0x0) { size = in_ECX[2] - (int)puVar4 & 0xfffffffc; puVar5 = puVar4; if (0xfff < size) { puVar5 = (undefined4 *)puVar4[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar4 + (-4 - (int)puVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar5,size); } *in_ECX = (int)puVar2; in_ECX[1] = (int)(puVar2 + param_1); in_ECX[2] = (int)(puVar2 + uVar3); return; } //@@ 007deaf0 std::vector<28byte>::_Resize_reallocate /* DB: MSVC resize(n, val) growth path, 0x1c-byte elements, max 0x9249249, fills new tail via FUN_007de2f0 then moves old elements; sole caller vector28_resize */ void std::vector<28byte>::_Resize_reallocate(uint param_1,undefined1 *param_2) { undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; uint uVar6; undefined4 *puVar7; int *in_ECX; undefined4 *puVar8; undefined4 *puVar9; undefined4 *puVar10; uint size; if (0x9249249 < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar2 = (in_ECX[1] - *in_ECX) / 0x1c; uVar6 = (in_ECX[2] - *in_ECX) / 0x1c; if (0x9249249 - (uVar6 >> 1) < uVar6) { uVar6 = 0x9249249; } else { uVar6 = (uVar6 >> 1) + uVar6; if (uVar6 < param_1) { uVar6 = param_1; } else if (0x9249249 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = _Allocate(uVar6 * 0x1c); FUN_007de2f0(puVar7 + iVar2 * 7,param_1 - iVar2,*param_2); puVar8 = (undefined4 *)*in_ECX; puVar9 = (undefined4 *)in_ECX[1]; puVar10 = puVar7; if (puVar8 != puVar9) { do { uVar3 = puVar8[1]; uVar4 = puVar8[2]; uVar5 = puVar8[3]; *puVar10 = *puVar8; puVar10[1] = uVar3; puVar10[2] = uVar4; puVar10[3] = uVar5; *(undefined8 *)(puVar10 + 4) = *(undefined8 *)(puVar8 + 4); puVar1 = puVar8 + 6; puVar8 = puVar8 + 7; puVar10[6] = *puVar1; puVar10 = puVar10 + 7; } while (puVar8 != puVar9); puVar8 = (undefined4 *)*in_ECX; } if (puVar8 != (undefined4 *)0x0) { size = ((in_ECX[2] - (int)puVar8) / 0x1c) * 0x1c; puVar9 = puVar8; if (0xfff < size) { puVar9 = (undefined4 *)puVar8[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar8 + (-4 - (int)puVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar9,size); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + param_1 * 7); in_ECX[2] = (int)(puVar7 + uVar6 * 7); return; } //@@ 007dec60 FUN_007dec60 void FUN_007dec60(uint param_1) { uint uVar1; uint uVar2; void *pvVar3; int *in_ECX; int extraout_ECX; EntitySaveState *this; int extraout_EDX; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00740; local_10 = ExceptionList; ExceptionList = &local_10; if (0x2222222 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (in_ECX[1] - *in_ECX) / 0x78; uVar1 = (in_ECX[2] - *in_ECX) / 0x78; if (0x2222222 - (uVar1 >> 1) < uVar1) { uVar4 = 0x2222222; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar4 = param_1; if ((param_1 <= uVar1) && (uVar4 = uVar1, 0x2222222 < uVar1)) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = std::_Allocate(uVar4 * 0x78); local_8 = 0; this = (EntitySaveState *)((int)pvVar3 + uVar2 * 0x78); if (param_1 != uVar2) { do { EntitySaveState::constructor(this); this = (EntitySaveState *)(extraout_ECX + 0x78); } while (extraout_EDX != 1); } FUN_004d73e0(*in_ECX,in_ECX[1],pvVar3); std::vector::_Change_array(pvVar3,param_1,uVar4); ExceptionList = local_10; return; } //@@ 007ded73 Catch_All@007ded73 void Catch_All_007ded73(void) { int unaff_EBP; FUN_004d7310(*(undefined4 *)(unaff_EBP + -0x20),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_004d7450(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + 8)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007dedb0 FUN_007dedb0 void FUN_007dedb0(uint param_1) { void *_Dst; int *in_ECX; uint uVar1; int iVar2; if (0x7fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar2 = in_ECX[1] - *in_ECX; uVar1 = in_ECX[2] - *in_ECX; if (0x7fffffff - (uVar1 >> 1) < uVar1) { uVar1 = 0x7fffffff; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } } _Dst = std::_Allocate(uVar1); memset((void *)((int)_Dst + iVar2),0,param_1 - iVar2); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FUN_007df050(_Dst,param_1,uVar1); return; } //@@ 007dee40 std::vector<52byte>::assign /* DB: (first, last) over 0x34-byte elements: copies in place (007df0b0) when it fits, else frees and reallocates with x1.5 growth (max 0x4ec4ec4, _Xlen) then copies; used by Entity_Player::StoreGameState/RestoreGameState for the GameStatePlayer vector freed by 007dc8d0 */ void std::vector<52byte>::assign(int param_1,undefined4 *param_2) { uint uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; void *pvVar5; int *in_ECX; uint uVar6; undefined4 *puVar7; undefined4 *extraout_EDX; undefined4 *puVar8; uint uVar9; void *ptr; uVar1 = ((int)param_2 - param_1) / 0x34; pvVar5 = (void *)*in_ECX; if (uVar1 <= (uint)((in_ECX[1] - (int)pvVar5) / 0x34)) { FUN_007df0b0(pvVar5); in_ECX[1] = (int)(uVar1 * 0x34 + (int)pvVar5); return; } uVar6 = (in_ECX[2] - (int)pvVar5) / 0x34; if (uVar6 < uVar1) { if (0x4ec4ec4 < uVar1) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x4ec4ec4 - (uVar6 >> 1) < uVar6) { uVar9 = 0x4ec4ec4; } else { uVar9 = (uVar6 >> 1) + uVar6; if (uVar9 < uVar1) { uVar9 = uVar1; } } if (pvVar5 != (void *)0x0) { uVar6 = uVar6 * 0x34; ptr = pvVar5; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar5 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x4ec4ec4 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar5 = _Allocate(uVar9 * 0x34); *in_ECX = (int)pvVar5; in_ECX[1] = (int)pvVar5; in_ECX[2] = (int)(uVar9 * 0x34 + (int)pvVar5); } FUN_007df0b0(pvVar5); puVar7 = (undefined4 *)in_ECX[1]; for (puVar8 = extraout_EDX; puVar8 != param_2; puVar8 = puVar8 + 0xd) { uVar2 = puVar8[1]; uVar3 = puVar8[2]; uVar4 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar2; puVar7[2] = uVar3; puVar7[3] = uVar4; uVar2 = puVar8[5]; uVar3 = puVar8[6]; uVar4 = puVar8[7]; puVar7[4] = puVar8[4]; puVar7[5] = uVar2; puVar7[6] = uVar3; puVar7[7] = uVar4; uVar2 = puVar8[9]; uVar3 = puVar8[10]; uVar4 = puVar8[0xb]; puVar7[8] = puVar8[8]; puVar7[9] = uVar2; puVar7[10] = uVar3; puVar7[0xb] = uVar4; puVar7[0xc] = puVar8[0xc]; puVar7 = puVar7 + 0xd; } in_ECX[1] = (int)puVar7; return; } //@@ 007defc0 vector16_clear_and_reserve /* DB: std::vector<16-byte element>::_Clear_and_reserve(n): frees the old buffer (FUN_005cbf50), grows to max(n, 1.5x) up to 0xfffffff and allocates; init_engine_parameters, Entity_Player::spawn_dark_esau prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall vector16_clear_and_reserve(void *this,uint count) { int iVar1; void *pvVar2; uint uVar3; uint uVar4; if (0xfffffff < count) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar1 = *(int *)this; uVar3 = *(int *)((int)this + 8) - iVar1 >> 4; if (0xfffffff - (uVar3 >> 1) < uVar3) { uVar4 = 0xfffffff; } else { uVar4 = (uVar3 >> 1) + uVar3; if (uVar4 < count) { uVar4 = count; } } if (iVar1 != 0) { FUN_005cbf50(iVar1,uVar3); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; } if (0xfffffff < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar2 = std::_Allocate(uVar4 * 0x10); *(void **)this = pvVar2; *(void **)((int)this + 4) = pvVar2; *(void **)((int)this + 8) = (void *)((int)pvVar2 + uVar4 * 0x10); return; } //@@ 007df050 FUN_007df050 void FUN_007df050(int param_1,int param_2,int param_3) { void *pvVar1; void *ptr; int *in_ECX; uint size; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 + param_1; in_ECX[2] = param_3 + param_1; return; } //@@ 007df0b0 FUN_007df0b0 undefined4 * FUN_007df0b0(undefined4 *param_1) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar2; if (in_ECX == in_EDX) { return param_1; } puVar2 = in_ECX + 1; do { *param_1 = puVar2[-1]; param_1[1] = *puVar2; param_1[2] = puVar2[1]; param_1[3] = puVar2[2]; param_1[4] = puVar2[3]; param_1[5] = puVar2[4]; param_1[6] = puVar2[5]; param_1[7] = puVar2[6]; param_1[8] = puVar2[7]; param_1[9] = puVar2[8]; param_1[10] = puVar2[9]; param_1[0xb] = puVar2[10]; *(undefined1 *)(param_1 + 0xc) = *(undefined1 *)(puVar2 + 0xb); *(undefined1 *)((int)param_1 + 0x31) = *(undefined1 *)((int)puVar2 + 0x2d); puVar1 = puVar2 + 0xc; param_1 = param_1 + 0xd; puVar2 = puVar2 + 0xd; } while (puVar1 != in_EDX); return param_1; } //@@ 007df130 FUN_007df130 void FUN_007df130(void) { uint uVar1; void *pvVar2; int *piVar3; void *ptr; uint size; undefined4 *in_ECX; piVar3 = (int *)*in_ECX; if (piVar3 == (int *)0x0) { return; } uVar1 = piVar3[5]; if (0xf < uVar1) { pvVar2 = (void *)*piVar3; size = uVar1 + 1; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = uVar1 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } piVar3[4] = 0; piVar3[5] = 0xf; *(undefined1 *)piVar3 = 0; return; } //@@ 007df140 FUN_007df140 void FUN_007df140(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0077b; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = *param_1; in_ECX[1] = param_1[1]; uVar1 = param_1[3]; uVar2 = param_1[4]; uVar3 = param_1[5]; in_ECX[2] = param_1[2]; in_ECX[3] = uVar1; in_ECX[4] = uVar2; in_ECX[5] = uVar3; in_ECX[6] = param_1[6]; in_ECX[7] = param_1[7]; std::string::string((char *)(in_ECX + 8),param_1 + 8); local_8 = 0; std::string::string((char *)(in_ECX + 0xe),param_1 + 0xe); local_8 = CONCAT31(local_8._1_3_,1); std::string::string((char *)(in_ECX + 0x14),param_1 + 0x14); ExceptionList = local_10; return; } //@@ 007df1d0 FUN_007df1d0 void FUN_007df1d0(void) { void *pvVar1; int *piVar2; uint size; undefined4 *in_ECX; void *ptr; piVar2 = (int *)*in_ECX; if (piVar2 == (int *)0x0) { return; } if (*piVar2 != 0) { FUN_00731bf0(*piVar2); pvVar1 = (void *)*piVar2; size = ((piVar2[2] - (int)pvVar1) / 0x68) * 0x68; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *piVar2 = 0; piVar2[1] = 0; piVar2[2] = 0; } return; } //@@ 007df1e0 FUN_007df1e0 void FUN_007df1e0(void) { libm_sse2_exp_precise(); return; } //@@ 007df200 FUN_007df200 void FUN_007df200(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[5] = 0; in_ECX[6] = 0xf; in_ECX[7] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0xf; in_ECX[0xd] = 0; in_ECX[0x11] = 0; in_ECX[0x12] = 0xf; *(undefined2 *)(in_ECX + 0x13) = 0x100; in_ECX[0x14] = 0x3f800000; in_ECX[0x15] = 0x3ca3d70a; in_ECX[0x16] = 0; in_ECX[0x17] = 0; return; } //@@ 007df2b0 FUN_007df2b0 void FUN_007df2b0(void) { void *in_ECX; SoundInstance::SoundInstance(in_ECX); *(undefined4 *)((int)in_ECX + 0x18) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x1c) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x20) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x24) = 0x3da3d70a; *(undefined1 *)((int)in_ECX + 0x28) = 0; *(undefined4 *)((int)in_ECX + 0x2c) = 0; *(undefined4 *)((int)in_ECX + 0x30) = 0; return; } //@@ 007df300 FUN_007df300 void FUN_007df300(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b007ad; local_10 = ExceptionList; ExceptionList = &local_10; SoundInstance::SoundInstance(in_ECX); *(undefined4 *)((int)in_ECX + 0x18) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x1c) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x20) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x24) = 0x3da3d70a; *(undefined1 *)((int)in_ECX + 0x28) = 0; *(undefined4 *)((int)in_ECX + 0x2c) = 0; *(undefined4 *)((int)in_ECX + 0x30) = 0; local_8 = 0; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x34),0x34,6,FUN_007df2b0,thunk_FUN_00a2ab40); *(undefined4 *)((int)in_ECX + 0x16c) = 0; *(undefined4 *)((int)in_ECX + 0x170) = 1; *(undefined4 *)((int)in_ECX + 0x174) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x178) = 0x3f800000; *(undefined4 *)((int)in_ECX + 0x17c) = 0x3da3d70a; *(undefined1 *)((int)in_ECX + 0x180) = 0; *(undefined4 *)((int)in_ECX + 0x16c) = 0; ExceptionList = local_10; return; } //@@ 007df3f0 FUN_007df3f0 void FUN_007df3f0(void) { uint uVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x34),0x34,6,thunk_FUN_00a2ab40); FUN_00a2ab40(uVar1); ExceptionList = local_10; return; } //@@ 007df450 MusicManager::~MusicManager /* DB: Manager::destructor member: resets two 0x184-byte channels (each with 6 layer streams, stride 0x34) via FUN_00a2ae60, releases the sound ref at +0x32c (g_soundReleaseFn), 007e26c0, then destroys the 2 x 0x184 channel array at +4; the array ends at +0x30c where MusicManager _currentMusicID starts (src/structs.hpp) */ void MusicManager::~MusicManager(void) { int iVar1; char cVar2; int in_ECX; int iVar3; int iVar4; int local_14; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b007d0; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = in_ECX + 0xd; local_14 = 2; do { KAGE::SmartPointer::reset(0); *(undefined2 *)(iVar4 + -1) = 0; *(undefined1 *)(iVar4 + 1) = 0; iVar3 = 6; *(undefined4 *)(iVar4 + 3) = 0x3f800000; *(undefined4 *)(iVar4 + 7) = 0; *(undefined4 *)(iVar4 + 0xb) = 0x3f800000; iVar1 = iVar4; do { KAGE::SmartPointer::reset(0); *(undefined2 *)(iVar1 + 0x33) = 0; *(undefined1 *)(iVar1 + 0x35) = 0; *(undefined4 *)(iVar1 + 0x37) = 0x3f800000; *(undefined4 *)(iVar1 + 0x3b) = 0; *(undefined4 *)(iVar1 + 0x3f) = 0x3f800000; iVar3 = iVar3 + -1; iVar1 = iVar1 + 0x34; } while (iVar3 != 0); iVar4 = iVar4 + 0x184; local_14 = local_14 + -1; } while (local_14 != 0); KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 0x334) = 0; *(undefined1 *)(in_ECX + 0x336) = 0; *(undefined4 *)(in_ECX + 0x338) = 0x3f800000; *(undefined4 *)(in_ECX + 0x33c) = 0; *(undefined4 *)(in_ECX + 0x340) = 0x3f800000; local_8 = iVar3; KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 0x334) = 0; *(undefined1 *)(in_ECX + 0x336) = 0; *(undefined4 *)(in_ECX + 0x338) = 0x3f800000; *(undefined4 *)(in_ECX + 0x33c) = 0; *(undefined4 *)(in_ECX + 0x340) = 0x3f800000; local_8 = CONCAT31(local_8._1_3_,1); if (*(int **)(in_ECX + 0x330) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(in_ECX + 0x330) + 0xc))(); if ((cVar2 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(in_ECX + 0x32c); } } local_8 = 0xffffffff; std::vector::_Tidy(); _eh_vector_destructor_iterator_((void *)(in_ECX + 4),0x184,2,FUN_007df3f0); ExceptionList = local_10; return; } //@@ 007df5b0 FUN_007df5b0 void FUN_007df5b0(void) { int *in_ECX; int iVar1; int iVar2; if ((int *)*in_ECX != (int *)0x0) { (**(code **)(*(int *)*in_ECX + 0x2c))(1); *(undefined2 *)((int)in_ECX + 9) = 1; } iVar1 = (int)in_ECX + 0x3e; iVar2 = 6; do { if (*(int **)(iVar1 + -10) != (int *)0x0) { (**(code **)(**(int **)(iVar1 + -10) + 0x2c))(1); *(undefined2 *)(iVar1 + -1) = 1; } iVar1 = iVar1 + 0x34; iVar2 = iVar2 + -1; } while (iVar2 != 0); *(char *)(in_ECX + 0x60) = (char)in_ECX[10]; return; } //@@ 007df600 FUN_007df600 void FUN_007df600(void) { int in_ECX; int iVar1; undefined1 *puVar2; if (*(char *)(in_ECX + 0x180) != '\0') { FUN_007e1730(); puVar2 = (undefined1 *)(in_ECX + 0x3d); iVar1 = 6; do { if (puVar2[0x1f] != '\0') { if (*(int **)(puVar2 + -9) != (int *)0x0) { (**(code **)(**(int **)(puVar2 + -9) + 0x3c))(); *puVar2 = 0; } KAGE::SmartPointer::reset(0); *(undefined2 *)(puVar2 + -1) = 0; puVar2[1] = 0; *(undefined4 *)(puVar2 + 3) = 0x3f800000; *(undefined4 *)(puVar2 + 7) = 0; *(undefined4 *)(puVar2 + 0xb) = 0x3f800000; puVar2[0x1f] = 0; *(undefined4 *)(puVar2 + 0x23) = 0; } puVar2 = puVar2 + 0x34; iVar1 = iVar1 + -1; } while (iVar1 != 0); *(undefined1 *)(in_ECX + 0x180) = 0; } return; } //@@ 007df690 Music::SetPitchAll /* DB: ? sets pitch float on main + 6 layer tracks if playing; Music::ResetPitch prototype: db/protos.zhl */ void __thiscall Music::SetPitchAll(Music *this,float pitch) { char cVar1; Music *pMVar2; int iVar3; if (*this != (Music)0x0) { cVar1 = (**(code **)(*(int *)*this + 0x28))(); if (cVar1 != '\0') { this[5] = (Music)pitch; if (*this != (Music)0x0) { (**(code **)(*(int *)*this + 0x58))(pitch); } } } iVar3 = 6; do { pMVar2 = this + 0xd; if (*pMVar2 != (Music)0x0) { cVar1 = (**(code **)(*(int *)*pMVar2 + 0x28))(); if (cVar1 != '\0') { this[0x12] = (Music)pitch; if (*pMVar2 != (Music)0x0) { (**(code **)(*(int *)*pMVar2 + 0x58))(pitch); } } } iVar3 = iVar3 + -1; this = pMVar2; } while (iVar3 != 0); return; } //@@ 007df710 MusicChannel::play_track /* DB: ? (track): starts the track's main stream (+0x34, or the +0x1c intro when +0x2c) on this channel's stream (ECX+0), sets volume/fade fields (+0x18..+0x24, +0x16c/+0x170), stops and restarts up to 6 layers (stride 0x34 at +0x10) from the track's layer list (+0x58/+0x5c); callers Music::Play and MusicManager::Crossfade */ void MusicChannel::play_track(int param_1) { int iVar1; int iVar2; int *in_ECX; undefined4 *puVar3; int *piVar4; uint uVar5; undefined4 in_XMM3_Da; piVar4 = (int *)(param_1 + 0x34); if (*(int *)(param_1 + 0x2c) == 0) { MusicStream::play(piVar4,*(undefined1 *)(param_1 + 0x4c),in_XMM3_Da); } else { MusicStream::play(param_1 + 0x1c,0,in_XMM3_Da); if (0xf < *(uint *)(param_1 + 0x48)) { piVar4 = (int *)*piVar4; } if ((int *)*in_ECX != (int *)0x0) { (**(code **)(*(int *)*in_ECX + 0xc))(piVar4,*(undefined1 *)(param_1 + 0x4c)); } } uVar5 = 0; in_ECX[0x5c] = (uint)*(byte *)(param_1 + 0x4d); in_ECX[8] = 0x3f800000; in_ECX[7] = 0x3f800000; in_ECX[6] = *(int *)(param_1 + 0x50); in_ECX[9] = *(int *)(param_1 + 0x54); in_ECX[0x5b] = 0; piVar4 = in_ECX + 0x10; iVar1 = -0x40 - (int)in_ECX; do { if ((char)piVar4[7] != '\0') { if ((int *)piVar4[-3] != (int *)0x0) { (**(code **)(*(int *)piVar4[-3] + 0x3c))(); *(undefined1 *)((int)piVar4 + -3) = 0; } KAGE::SmartPointer::reset(0); *(undefined2 *)(piVar4 + -1) = 0; *(undefined1 *)((int)piVar4 + -2) = 0; *piVar4 = 0x3f800000; piVar4[1] = 0; piVar4[2] = 0x3f800000; *(undefined1 *)(piVar4 + 7) = 0; piVar4[8] = 0; } if ((uVar5 < *(uint *)(param_1 + 0x5c)) && (iVar2 = (int)piVar4 + *(int *)(param_1 + 0x58) + iVar1, *(int *)(iVar2 + 0x28) != 0)) { if (*(int *)(iVar2 + 0x10) == 0) { MusicStream::play(iVar2 + 0x18,1,in_XMM3_Da); } else { MusicStream::play(iVar2,0,in_XMM3_Da); puVar3 = (undefined4 *)((int)piVar4 + *(int *)(param_1 + 0x58) + 0x18 + iVar1); if (0xf < (uint)puVar3[5]) { puVar3 = (undefined4 *)*puVar3; } if ((int *)piVar4[-3] != (int *)0x0) { (**(code **)(*(int *)piVar4[-3] + 0xc))(puVar3,1); } } piVar4[5] = 0; piVar4[4] = 0; if ((int *)piVar4[-3] != (int *)0x0) { (**(code **)(*(int *)piVar4[-3] + 0x2c))(1); *(undefined2 *)((int)piVar4 + -3) = 1; } piVar4[6] = *(int *)(param_1 + 0x54); piVar4[3] = *(int *)((int)piVar4 + *(int *)(param_1 + 0x58) + 0x30 + iVar1); } uVar5 = uVar5 + 1; piVar4 = piVar4 + 0xd; } while (uVar5 < 6); return; } //@@ 007df8e0 MusicChannel::update_volume /* DB: ? ECX=one of the two 0x184-byte music channel records of MusicManager (loop in 007e17b0, also MusicManager::EnableLayer): lerps volume +0x174 toward target +0x178 by rate +0x17c, then derives per-layer volumes (+0x20, +0x54, +0x90 ...) from the layer mask +0x16c and mode +0x170 */ void MusicChannel::update_volume(char param_1) { float fVar1; int in_ECX; undefined1 *puVar2; int iVar3; undefined4 uVar4; float fVar5; undefined4 uVar6; int local_14; fVar1 = *(float *)(in_ECX + 0x174); fVar5 = *(float *)(in_ECX + 0x178); if (*(float *)(in_ECX + 0x17c) < ABS(fVar1 - fVar5)) { fVar5 = (fVar5 - fVar1) * *(float *)(in_ECX + 0x17c) + fVar1; } *(float *)(in_ECX + 0x174) = fVar5; uVar4 = 0x3f800000; if (*(int *)(in_ECX + 0x170) == 2) { if (*(int *)(in_ECX + 0x16c) == 0) { uVar6 = 0x3f800000; } else { uVar6 = 0; } *(undefined4 *)(in_ECX + 0x20) = uVar6; } if (*(char *)(in_ECX + 0x5c) != '\0') { if ((*(byte *)(in_ECX + 0x16c) & 1) == 0) { uVar6 = 0; } else { uVar6 = 0x3f800000; } *(undefined4 *)(in_ECX + 0x54) = uVar6; } if (*(char *)(in_ECX + 0x90) != '\0') { if ((*(byte *)(in_ECX + 0x16c) & 2) == 0) { uVar6 = 0; } else { uVar6 = 0x3f800000; } *(undefined4 *)(in_ECX + 0x88) = uVar6; } if (*(char *)(in_ECX + 0xc4) != '\0') { if ((*(byte *)(in_ECX + 0x16c) & 4) == 0) { uVar6 = 0; } else { uVar6 = 0x3f800000; } *(undefined4 *)(in_ECX + 0xbc) = uVar6; } if (*(char *)(in_ECX + 0xf8) != '\0') { if ((*(byte *)(in_ECX + 0x16c) & 8) == 0) { uVar6 = 0; } else { uVar6 = 0x3f800000; } *(undefined4 *)(in_ECX + 0xf0) = uVar6; } if (*(char *)(in_ECX + 300) != '\0') { if ((*(byte *)(in_ECX + 0x16c) & 0x10) == 0) { uVar6 = 0; } else { uVar6 = 0x3f800000; } *(undefined4 *)(in_ECX + 0x124) = uVar6; } if (*(char *)(in_ECX + 0x160) != '\0') { if ((*(byte *)(in_ECX + 0x16c) & 0x20) == 0) { uVar4 = 0; } *(undefined4 *)(in_ECX + 0x158) = uVar4; } FUN_007e15a0(0); iVar3 = 6; do { FUN_007e15a0(0); iVar3 = iVar3 + -1; } while (iVar3 != 0); *(char *)(in_ECX + 0x180) = *(char *)(in_ECX + 0x28); if (*(char *)(in_ECX + 0x28) == '\0') { puVar2 = (undefined1 *)(in_ECX + 0x3d); local_14 = 6; do { if (puVar2[0x1f] != '\0') { if (*(int **)(puVar2 + -9) != (int *)0x0) { (**(code **)(**(int **)(puVar2 + -9) + 0x3c))(); *puVar2 = 0; } KAGE::SmartPointer::reset(0); *(undefined2 *)(puVar2 + -1) = 0; puVar2[1] = 0; *(undefined4 *)(puVar2 + 3) = 0x3f800000; *(undefined4 *)(puVar2 + 7) = 0; *(undefined4 *)(puVar2 + 0xb) = 0x3f800000; puVar2[0x1f] = 0; *(undefined4 *)(puVar2 + 0x23) = 0; } puVar2 = puVar2 + 0x34; local_14 = local_14 + -1; } while (local_14 != 0); } if ((*(float *)(in_ECX + 0x174) <= 0.0) && (param_1 != '\0')) { FUN_007df600(); } return; } //@@ 007dfaf0 Music::LoadConfig /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ZHL Music::LoadConfig(xmlpath, ismod): 'Could not find root node music in %s', layer/layerintro/layermode attrs, ModManager::TryRedirectPath prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Music::LoadConfig(Music *this,byte *xmlpath,byte ismod) { Music MVar1; int iVar2; int iVar3; Manager *pMVar4; byte bVar5; undefined1 uVar6; uint uVar7; Music MVar8; int iVar9; void *pvVar10; void *pvVar11; byte *******extraout_EAX; byte *******extraout_EAX_00; void **extraout_EAX_01; byte *******pppppppbVar12; void **extraout_EAX_02; int *******pppppppiVar13; int *extraout_EAX_03; int *extraout_EAX_04; undefined4 *puVar14; uint *puVar15; uint uVar16; byte *pbVar17; byte *pbVar18; byte *pbVar19; std_string *psVar20; byte ******ppppppbVar21; Music *pMVar22; uint *puVar23; code *pcVar24; char *pcVar26; char *pcVar25; int *piVar27; undefined4 *puVar28; uint *this_00; bool bVar29; double dVar30; uint uVar31; Music MStack_10238; Music MStack_10234; Music MStack_10230; Music *pMStack_1022c; Music MStack_10228; float fStack_10224; Music MStack_10220; uint uStack_1021c; Music MStack_10218; byte *pbStack_10214; int iStack_10210; byte *******apppppppbStack_1020c [4]; uint uStack_101fc; uint uStack_101f8; byte *******pppppppbStack_101f4; byte ******ppppppbStack_101f0; byte ******ppppppbStack_101ec; byte ******ppppppbStack_101e8; byte ******ppppppbStack_101e4; byte ******ppppppbStack_101e0; byte *******pppppppbStack_101dc; byte ******ppppppbStack_101d8; byte ******ppppppbStack_101d4; byte ******ppppppbStack_101d0; byte ******ppppppbStack_101cc; byte ******ppppppbStack_101c8; undefined2 uStack_101c4; float fStack_101c0; float fStack_101bc; undefined4 *puStack_101b8; byte *pbStack_101b4; undefined1 auStack_101b0 [48]; undefined1 auStack_10180 [65564]; std_string local_164; std_string local_14c; void *local_134 [4]; uint local_124; uint local_120; void *local_11c [4]; uint local_10c; uint local_108; void *local_104 [4]; uint local_f4; uint local_f0; void *local_ec [4]; uint local_dc; uint local_d8; void *local_d4 [4]; undefined4 local_c4; uint local_c0; void *local_bc; undefined4 local_ac; uint local_a8; undefined4 local_a4; void *local_a0; void *pvStack_9c; void *pvStack_98; void *pvStack_94; void *local_90; void *pvStack_8c; void *local_88; void *pvStack_84; void *pvStack_80; void *pvStack_7c; void *local_78; void *pvStack_74; float local_70; int *******local_6c [4]; int local_5c; uint local_58; std_string local_54; byte *******local_3c [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ******local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b00897; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; uVar31 = 0; pbStack_10214 = xmlpath; uStack_1021c = 0; local_24 = uVar7; MStack_10218 = (Music)FileSystem::Open(&PTR_vftable_00c37a10,xmlpath,(int *)0x0); if (MStack_10218 != (Music)0x0) { if (ismod == 0) { MVar8 = this[199]; pMVar22 = this + 199; MStack_10220 = (Music)0x0; iVar9 = (int)this[200] - (int)MVar8 >> 0x1f; pMStack_1022c = pMVar22; if (((int)this[200] - (int)MVar8) / 0x60 + iVar9 != iVar9) { MStack_10228 = (Music)0x0; do { pvVar10 = *(void **)((int)((int)MVar8 + 0x58) + (int)MStack_10228); if (pvVar10 != (void *)0x0) { xmlpath = (byte *)((int)pvVar10 + -4); local_14 = (byte ******)0x0; _eh_vector_destructor_iterator_(pvVar10,0x34,*(uint *)xmlpath,FUN_007e1430); uVar31 = *(uint *)xmlpath * 0x34 + 4; operator_delete(xmlpath,uVar31); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; *(undefined4 *)((int)*pMStack_1022c + 0x58 + (int)MStack_10228) = 0; pMVar22 = pMStack_1022c; } MVar8 = *pMVar22; MStack_10228 = (Music)((int)MStack_10228 + 0x60); MStack_10220 = (Music)((int)MStack_10220 + 1); } while ((uint)MStack_10220 < (uint)(((int)pMVar22[1] - (int)MVar8) / 0x60)); } if (&MStack_10238 != pMVar22) { MStack_10220 = pMVar22[1]; MStack_10228 = pMVar22[2]; *pMVar22 = (Music)0x0; pMVar22[1] = (Music)0x0; pMVar22[2] = (Music)0x0; if (MVar8 != (Music)0x0) { if (MVar8 != MStack_10220) { puVar23 = (uint *)((int)MVar8 + 0x48); do { uVar31 = *puVar23; if (0xf < uVar31) { pvVar10 = (void *)puVar23[-5]; uVar16 = uVar31 + 1; pvVar11 = pvVar10; if (0xfff < uVar16) { pvVar11 = *(void **)((int)pvVar10 - 4); uVar16 = uVar31 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar11))) goto LAB_007e13a8; } operator_delete(pvVar11,uVar16); } puVar23[-1] = 0; *puVar23 = 0xf; *(undefined1 *)(puVar23 + -5) = 0; uVar31 = puVar23[-6]; if (0xf < uVar31) { pvVar10 = (void *)puVar23[-0xb]; uVar16 = uVar31 + 1; pvVar11 = pvVar10; if (0xfff < uVar16) { pvVar11 = *(void **)((int)pvVar10 - 4); uVar16 = uVar31 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar11))) goto LAB_007e13a8; } operator_delete(pvVar11,uVar16); } puVar23[-7] = 0; puVar23[-6] = 0xf; *(undefined1 *)(puVar23 + -0xb) = 0; uVar31 = puVar23[-0xc]; if (0xf < uVar31) { pvVar10 = (void *)puVar23[-0x11]; uVar16 = uVar31 + 1; pvVar11 = pvVar10; if (0xfff < uVar16) { pvVar11 = *(void **)((int)pvVar10 - 4); uVar16 = uVar31 + 0x24; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar11))) goto LAB_007e13a8; } operator_delete(pvVar11,uVar16); } puVar23[-0xd] = 0; puVar23[-0xc] = 0xf; *(undefined1 *)(puVar23 + -0x11) = 0; MVar1 = (Music)(puVar23 + 6); puVar23 = puVar23 + 0x18; } while (MVar1 != MStack_10220); pMVar22 = pMStack_1022c; } uVar31 = (((int)MStack_10228 - (int)MVar8) / 0x60) * 0x60; xmlpath = (byte *)MVar8; if (0xfff < uVar31) { xmlpath = *(byte **)((int)MVar8 + -4); uVar31 = uVar31 + 0x23; if (0x1f < ((int)MVar8 - (int)xmlpath) - 4U) goto LAB_007e13a8; } operator_delete(xmlpath,uVar31); } } MStack_10220 = pMVar22[1]; uVar16 = ((int)MStack_10220 - (int)*pMVar22) / 0x60; if (uVar16 < 0x79) { if (uVar16 < 0x78) { if ((uint)(((int)pMVar22[2] - (int)*pMVar22) / 0x60) < 0x78) { FUN_007e2fa0(xmlpath,uVar31); } else { MVar8 = (Music)FUN_007e2f60(pMVar22[1],0x78 - uVar16,fStack_10224); pMVar22[1] = MVar8; } } } else { MVar8 = *pMVar22; FUN_007e2e00((int)MStack_10220 - (int)*pMVar22,uVar7); this[200] = (Music)((int)MVar8 + 0x2d00); } } MVar8 = MStack_10218; iVar9 = (**(code **)(*(int *)MStack_10218 + 4))(); pMStack_1022c = operator_new_tracked(iVar9 + 1); (**(code **)(*(int *)MVar8 + 0x14))(pMStack_1022c,1,iVar9); *(undefined1 *)((int)&pMStack_1022c->field_0x0 + iVar9) = 0; (*(code *)**(undefined4 **)MVar8)(1); FUN_00413b90(); local_14 = (byte ******)0x1; uVar7 = 0x7dfea5; pMVar22 = pMStack_1022c; rapidxml::xml_document::parse(auStack_101b0,(byte *)pMStack_1022c); bVar5 = (byte)pMVar22; pvVar10 = xml_node::first_node(auStack_101b0,(byte *)"music",uVar7,bVar5); pvVar11 = xml_node::first_attribute(pvVar10,&DAT_00b66f40,uVar7,bVar5); local_2c = 0; local_28 = 0xf; local_3c[0] = (byte *******)0x0; pbVar19 = &g_xmlNullStr; if (*(byte **)((int)pvVar11 + 4) != (byte *)0x0) { pbVar19 = *(byte **)((int)pvVar11 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); std::string::assign((char *)local_3c,pbVar19,(int)pbVar17 - (int)(pbVar19 + 1)); local_14._0_1_ = 2; if (pvVar10 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Could not find root node \'music\' in %s\n"); } for (MStack_10220 = *(Music *)((int)pvVar10 + 0x18); MStack_10220 != (Music)0x0; MStack_10220 = *(Music *)((int)MStack_10220 + 0x2c)) { iStack_10210 = 0; uStack_101fc = 0; uStack_101f8 = 0xf; apppppppbStack_1020c[0] = (byte *******)0x0; ppppppbStack_101e4 = (byte ******)0x0; ppppppbStack_101e0 = (byte ******)0xf; pppppppbStack_101f4 = (byte *******)0x0; ppppppbStack_101cc = (byte ******)0x0; ppppppbStack_101c8 = (byte ******)0xf; pppppppbStack_101dc = (byte *******)0x0; uStack_101c4 = 0x100; fStack_101c0 = 1.0; fStack_101bc = 0.02; puStack_101b8 = (undefined4 *)0x0; pbStack_101b4 = (byte *)0x0; MStack_10218 = (Music)0x0; MStack_10238 = (Music)0x0; MStack_10234 = (Music)0x0; MStack_10228 = (Music)0x0; MStack_10230 = (Music)0x0; local_90 = (void *)0x0; pvStack_8c = (void *)0xf; local_a0 = (void *)0x0; local_78 = (void *)0x0; pvStack_74 = (void *)0xf; local_88 = (void *)0x0; local_70 = 1.0; local_14._0_1_ = 5; pbStack_10214 = *(byte **)((int)MStack_10220 + 0x20); pcVar24 = atoi_exref; if (pbStack_10214 != (byte *)0x0) { do { pMVar4 = g_manager; pbVar19 = *(byte **)pbStack_10214; pbVar18 = s_id; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e0078: uVar7 = -(uint)bVar29 | 1; goto LAB_007e007d; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e0078; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e007d: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } iStack_10210 = (*pcVar24)(pbVar19); } else { pbVar18 = s_name; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e00d4: uVar7 = -(uint)bVar29 | 1; goto LAB_007e00d9; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e00d4; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e00d9: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); std::string::assign((char *)apppppppbStack_1020c,pbVar19, (int)pbVar17 - (int)(pbVar19 + 1)); } else { pcVar25 = "intro"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0140: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0145; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0140; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0145: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); psVar20 = (std_string *)(pbVar17 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar20) goto LAB_007e1407; pppppppbVar12 = (byte *******)local_3c; if (0xf < local_28) { pppppppbVar12 = local_3c[0]; } std::string::concat(local_54._buf,(int)fStack_10224,psVar20,(byte *)pppppppbVar12, local_2c,pbVar19,(uint)psVar20); uStack_1021c = uStack_1021c | 1; local_14._0_1_ = 6; ModManager::TryRedirectPath(&pMVar4->_modManager,(std_string *)local_ec,&local_54); if (&pppppppbStack_101f4 != (byte ********)extraout_EAX) { if ((byte ******)0xf < ppppppbStack_101e0) { ppppppbVar21 = (byte ******)((int)ppppppbStack_101e0 + 1); pppppppbVar12 = pppppppbStack_101f4; if ((byte ******)0xfff < ppppppbVar21) { pppppppbVar12 = (byte *******)pppppppbStack_101f4[-1]; ppppppbVar21 = ppppppbStack_101e0 + 9; if ((byte *)0x1f < (byte *)((int)pppppppbStack_101f4 + (-4 - (int)pppppppbVar12))) goto LAB_007e13a8; } operator_delete(pppppppbVar12,(uint)ppppppbVar21); } pppppppbStack_101f4 = (byte *******)*extraout_EAX; ppppppbStack_101f0 = extraout_EAX[1]; ppppppbStack_101ec = extraout_EAX[2]; ppppppbStack_101e8 = extraout_EAX[3]; ppppppbStack_101e4 = extraout_EAX[4]; ppppppbStack_101e0 = extraout_EAX[5]; extraout_EAX[4] = (byte ******)0x0; extraout_EAX[5] = (byte ******)0xf; *(undefined1 *)extraout_EAX = 0; } if (0xf < local_d8) { uVar7 = local_d8 + 1; pvVar10 = local_ec[0]; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_ec[0] + -4); uVar7 = local_d8 + 0x24; if (0x1f < (uint)((int)local_ec[0] + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } local_dc = 0; local_d8 = 0xf; local_ec[0] = (void *)((uint)local_ec[0] & 0xffffff00); LAB_007e028f: local_14._0_1_ = 5; if (0xf < local_54._capacity) { uVar7 = local_54._capacity + 1; pvVar10 = (void *)local_54._buf._0_4_; if (0xfff < uVar7) { pvVar10 = *(void **)(local_54._buf._0_4_ + -4); uVar7 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } } else { pbVar18 = &DAT_00b66e0c; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e0385: uVar7 = -(uint)bVar29 | 1; goto LAB_007e038a; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e0385; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e038a: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); psVar20 = (std_string *)(pbVar17 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar20) goto LAB_007e1407; pppppppbVar12 = (byte *******)local_3c; if (0xf < local_28) { pppppppbVar12 = local_3c[0]; } std::string::concat(local_54._buf,(int)fStack_10224,psVar20,(byte *)pppppppbVar12, local_2c,pbVar19,(uint)psVar20); uStack_1021c = uStack_1021c | 2; local_14._0_1_ = 7; ModManager::TryRedirectPath (&pMVar4->_modManager,(std_string *)local_104,&local_54); if (&pppppppbStack_101dc != (byte ********)extraout_EAX_00) { if ((byte ******)0xf < ppppppbStack_101c8) { ppppppbVar21 = (byte ******)((int)ppppppbStack_101c8 + 1); pppppppbVar12 = pppppppbStack_101dc; if ((byte ******)0xfff < ppppppbVar21) { pppppppbVar12 = (byte *******)pppppppbStack_101dc[-1]; ppppppbVar21 = ppppppbStack_101c8 + 9; if ((byte *)0x1f < (byte *)((int)pppppppbStack_101dc + (-4 - (int)pppppppbVar12))) goto LAB_007e13a8; } operator_delete(pppppppbVar12,(uint)ppppppbVar21); } pppppppbStack_101dc = (byte *******)*extraout_EAX_00; ppppppbStack_101d8 = extraout_EAX_00[1]; ppppppbStack_101d4 = extraout_EAX_00[2]; ppppppbStack_101d0 = extraout_EAX_00[3]; ppppppbStack_101cc = extraout_EAX_00[4]; ppppppbStack_101c8 = extraout_EAX_00[5]; extraout_EAX_00[4] = (byte ******)0x0; extraout_EAX_00[5] = (byte ******)0xf; *(undefined1 *)extraout_EAX_00 = 0; } if (0xf < local_f0) { uVar7 = local_f0 + 1; pvVar10 = local_104[0]; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_104[0] + -4); uVar7 = local_f0 + 0x24; if (0x1f < (uint)((int)local_104[0] + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } local_f4 = 0; local_f0 = 0xf; local_104[0] = (void *)((uint)local_104[0] & 0xffffff00); goto LAB_007e028f; } pcVar25 = "layerintro"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0503: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0508; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0503; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0508: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); psVar20 = (std_string *)(pbVar17 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar20) goto LAB_007e1407; pppppppbVar12 = (byte *******)local_3c; if (0xf < local_28) { pppppppbVar12 = local_3c[0]; } std::string::concat(local_54._buf,(int)fStack_10224,psVar20,(byte *)pppppppbVar12, local_2c,pbVar19,(uint)psVar20); uStack_1021c = uStack_1021c | 4; local_14._0_1_ = 8; ModManager::TryRedirectPath (&pMVar4->_modManager,(std_string *)local_11c,&local_54); if (&local_a0 != extraout_EAX_01) { if ((void *)0xf < pvStack_8c) { uVar7 = (int)pvStack_8c + 1; pvVar10 = local_a0; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_a0 + -4); uVar7 = (int)pvStack_8c + 0x24; if (0x1f < (uint)((int)local_a0 + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } local_a0 = *extraout_EAX_01; pvStack_9c = extraout_EAX_01[1]; pvStack_98 = extraout_EAX_01[2]; pvStack_94 = extraout_EAX_01[3]; local_90 = extraout_EAX_01[4]; pvStack_8c = extraout_EAX_01[5]; extraout_EAX_01[4] = (void *)0x0; extraout_EAX_01[5] = (void *)0xf; *(undefined1 *)extraout_EAX_01 = 0; } if (0xf < local_108) { uVar7 = local_108 + 1; pvVar10 = local_11c[0]; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_11c[0] + -4); uVar7 = local_108 + 0x24; if (0x1f < (uint)((int)local_11c[0] + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } local_10c = 0; local_108 = 0xf; local_11c[0] = (void *)((uint)local_11c[0] & 0xffffff00); goto LAB_007e028f; } pcVar25 = "layer"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0680: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0685; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0680; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0685: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); psVar20 = (std_string *)(pbVar17 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar20) { LAB_007e1407: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar12 = (byte *******)local_3c; if (0xf < local_28) { pppppppbVar12 = local_3c[0]; } std::string::concat(local_54._buf,(int)fStack_10224,psVar20,(byte *)pppppppbVar12, local_2c,pbVar19,(uint)psVar20); uStack_1021c = uStack_1021c | 8; local_14._0_1_ = 9; ModManager::TryRedirectPath (&pMVar4->_modManager,(std_string *)local_134,&local_54); if (&local_88 != extraout_EAX_02) { if ((void *)0xf < pvStack_74) { uVar7 = (int)pvStack_74 + 1; pvVar10 = local_88; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_88 + -4); uVar7 = (int)pvStack_74 + 0x24; if (0x1f < (uint)((int)local_88 + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } local_88 = *extraout_EAX_02; pvStack_84 = extraout_EAX_02[1]; pvStack_80 = extraout_EAX_02[2]; pvStack_7c = extraout_EAX_02[3]; local_78 = extraout_EAX_02[4]; pvStack_74 = extraout_EAX_02[5]; extraout_EAX_02[4] = (void *)0x0; extraout_EAX_02[5] = (void *)0xf; *(undefined1 *)extraout_EAX_02 = 0; } if (0xf < local_120) { uVar7 = local_120 + 1; pvVar10 = local_134[0]; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_134[0] + -4); uVar7 = local_120 + 0x24; if (0x1f < (uint)((int)local_134[0] + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } local_124 = 0; local_120 = 0xf; local_134[0] = (void *)((uint)local_134[0] & 0xffffff00); goto LAB_007e028f; } pbVar18 = &DAT_00b6be9c; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e07f4: uVar7 = -(uint)bVar29 | 1; goto LAB_007e07f9; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e07f4; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e07f9: if (uVar7 != 0) { pcVar25 = "layermode"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0984: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0989; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0984; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0989: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } uVar6 = (*pcVar24)(pbVar19); uStack_101c4 = CONCAT11(uVar6,(undefined1)uStack_101c4); } else { pbVar18 = &DAT_00b6be40; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e09e0: uVar7 = -(uint)bVar29 | 1; goto LAB_007e09e5; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e09e0; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e09e5: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } dVar30 = atof((char *)pbVar19); fStack_101c0 = (float)dVar30; } else { pcVar25 = "layermul"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0a40: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0a45; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0a40; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0a45: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } dVar30 = atof((char *)pbVar19); local_70 = (float)dVar30; } else { pcVar25 = "layerfadespeed"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0aa0: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0aa5; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0aa0; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0aa5: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } dVar30 = atof((char *)pbVar19); fStack_101bc = (float)dVar30; } } } } goto LAB_007e02cd; } local_6c[0] = (int *******)0x0; local_5c = 0; local_58 = 0xf; pbVar19 = &g_xmlNullStr; if (*(byte **)(pbStack_10214 + 4) != (byte *)0x0) { pbVar19 = *(byte **)(pbStack_10214 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); std::string::assign((char *)local_6c,pbVar19,(int)pbVar17 - (int)(pbVar19 + 1)); if (local_5c == 0) { LAB_007e0901: uStack_101c4 = uStack_101c4 & 0xff00; } else { pppppppiVar13 = (int *******)local_6c; if (0xf < local_58) { pppppppiVar13 = local_6c[0]; } if (local_5c == 4) { if ((*pppppppiVar13 == (int ******)0x65757274) || ((((bVar5 = (byte)*pppppppiVar13, bVar29 = bVar5 < 0x74, bVar5 == 0x74 && (bVar29 = *(byte *)((int)pppppppiVar13 + 1) < 0x72, *(byte *)((int)pppppppiVar13 + 1) == 0x72)) && (bVar29 = *(byte *)((int)pppppppiVar13 + 2) < 0x75, *(byte *)((int)pppppppiVar13 + 2) == 0x75)) && (bVar29 = *(byte *)((int)pppppppiVar13 + 3) < 0x65, *(byte *)((int)pppppppiVar13 + 3) == 0x65)))) { uVar7 = 0; } else { uVar7 = -(uint)bVar29 | 1; } if (uVar7 != 0) goto LAB_007e0899; } else { LAB_007e0899: pppppppiVar13 = (int *******)local_6c; if (0xf < local_58) { pppppppiVar13 = local_6c[0]; } if (local_5c == 4) { if ((*pppppppiVar13 == (int ******)0x65757254) || (((bVar5 = (byte)*pppppppiVar13, bVar29 = bVar5 < 0x54, bVar5 == 0x54 && (bVar29 = *(byte *)((int)pppppppiVar13 + 1) < 0x72, *(byte *)((int)pppppppiVar13 + 1) == 0x72)) && ((bVar29 = *(byte *)((int)pppppppiVar13 + 2) < 0x75, *(byte *)((int)pppppppiVar13 + 2) == 0x75 && (bVar29 = *(byte *)((int)pppppppiVar13 + 3) < 0x65, *(byte *)((int)pppppppiVar13 + 3) == 0x65)))))) { uVar7 = 0; } else { uVar7 = -(uint)bVar29 | 1; } if (uVar7 == 0) goto LAB_007e08f8; } pppppppiVar13 = (int *******)local_6c; if (0xf < local_58) { pppppppiVar13 = local_6c[0]; } iVar9 = atoi((char *)pppppppiVar13); if (iVar9 == 0) goto LAB_007e0901; } LAB_007e08f8: uStack_101c4 = CONCAT11(uStack_101c4._1_1_,1); } if (0xf < local_58) { uVar7 = local_58 + 1; pppppppiVar13 = local_6c[0]; if (0xfff < uVar7) { pppppppiVar13 = (int *******)local_6c[0][-1]; uVar7 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pppppppiVar13))) goto LAB_007e13a8; } operator_delete(pppppppiVar13,uVar7); } local_5c = 0; local_58 = 0xf; local_6c[0] = (int *******)((uint)local_6c[0] & 0xffffff00); } pcVar24 = atoi_exref; } } LAB_007e02cd: } while ((*(int *)(pbStack_10214 + 0x10) != 0) && (pbStack_10214 = *(byte **)(pbStack_10214 + 0x18), pbStack_10214 != (byte *)0x0)); if (local_78 != (void *)0x0) { std::vector<52byte>::_Emplace_reallocate(0,&local_a0); MStack_10228 = MStack_10230; MStack_10218 = MStack_10238; } } pcVar25 = "layer"; do { pcVar26 = pcVar25; pcVar25 = pcVar26 + 1; } while (*pcVar25 != '\0'); for (pbStack_10214 = *(byte **)((int)MStack_10220 + 0x18); pbStack_10214 != (byte *)0x0; pbStack_10214 = *(byte **)(pbStack_10214 + 0x2c)) { pbVar19 = *(byte **)pbStack_10214; if (pbVar19 == (byte *)0x0) { pcVar25 = (char *)0x0; pbVar19 = &g_xmlNullStr; } else { pcVar25 = *(char **)(pbStack_10214 + 8); } if (pcVar25 == pcVar26 + -0xb69bd7) { pbVar17 = (byte *)(pcVar25 + (int)pbVar19); if (pbVar17 <= pbVar19) goto LAB_007e0b23; iVar9 = (int)"layer" - (int)pbVar19; while (*pbVar19 == pbVar19[iVar9]) { pbVar19 = pbVar19 + 1; if (pbVar17 <= pbVar19) goto LAB_007e0b23; } } } pbStack_10214 = (byte *)0x0; LAB_007e0b23: if (pbStack_10214 != (byte *)0x0) { do { MVar8 = MStack_10234; local_c4 = 0; local_c0 = 0xf; local_d4[0] = (void *)0x0; local_ac = 0; local_a8 = 0xf; local_bc = (void *)0x0; local_a4 = 0x3f800000; local_14 = (byte ******)CONCAT31(local_14._1_3_,0xb); if (MStack_10234 == MStack_10228) { FUN_007e28f0(MStack_10234,local_d4); MStack_10228 = MStack_10230; } else { FUN_007e2870(); MStack_10234 = (Music)((int)MVar8 + 0x34); } MVar8 = MStack_10234; local_14._0_1_ = 5; if (0xf < local_a8) { uVar7 = local_a8 + 1; pvVar10 = local_bc; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_bc + -4); uVar7 = local_a8 + 0x24; if (0x1f < (uint)((int)local_bc + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } if (0xf < local_c0) { uVar7 = local_c0 + 1; pvVar10 = local_d4[0]; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_d4[0] + -4); uVar7 = local_c0 + 0x24; if (0x1f < (uint)((int)local_d4[0] + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } MStack_10218 = *(Music *)(pbStack_10214 + 0x20); if (MStack_10218 != (Music)0x0) { do { pMVar4 = g_manager; pbVar19 = *(byte **)MStack_10218; pcVar25 = "intro"; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < (byte)*pcVar25; if (bVar5 != *pcVar25) { LAB_007e0c98: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0c9d; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < (byte)pcVar25[1]; if (bVar5 != pcVar25[1]) goto LAB_007e0c98; pbVar17 = pbVar17 + 2; pcVar25 = pcVar25 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0c9d: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)((int)MStack_10218 + 4) != (byte *)0x0) { pbVar19 = *(byte **)((int)MStack_10218 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); psVar20 = (std_string *)(pbVar17 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar20) goto LAB_007e1407; pppppppbVar12 = (byte *******)local_3c; if (0xf < local_28) { pppppppbVar12 = local_3c[0]; } std::string::concat(local_54._buf,(int)fStack_10224,psVar20,(byte *)pppppppbVar12, local_2c,pbVar19,(uint)psVar20); uStack_1021c = uStack_1021c | 0x10; local_14 = (byte ******)CONCAT31(local_14._1_3_,0xc); ModManager::TryRedirectPath(&pMVar4->_modManager,&local_14c,&local_54); MVar8 = MStack_10234; piVar27 = (int *)((int)MStack_10234 + -0x34); if (piVar27 != extraout_EAX_03) { std::string::_Tidy_deallocate((char *)piVar27); iVar9 = extraout_EAX_03[1]; iVar2 = extraout_EAX_03[2]; iVar3 = extraout_EAX_03[3]; *piVar27 = *extraout_EAX_03; *(int *)((int)MVar8 + -0x30) = iVar9; *(int *)((int)MVar8 + -0x2c) = iVar2; *(int *)((int)MVar8 + -0x28) = iVar3; iVar9 = extraout_EAX_03[5]; *(int *)((int)MVar8 + -0x24) = extraout_EAX_03[4]; *(int *)((int)MVar8 + -0x20) = iVar9; extraout_EAX_03[4] = 0; extraout_EAX_03[5] = 0xf; *(undefined1 *)extraout_EAX_03 = 0; } psVar20 = &local_14c; LAB_007e0e57: std::string::_Tidy_deallocate(psVar20->_buf); local_14._0_1_ = 5; std::string::_Tidy_deallocate(local_54._buf); } else { pbVar18 = &DAT_00b66e0c; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e0d90: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0d95; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e0d90; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0d95: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)((int)MStack_10218 + 4) != (byte *)0x0) { pbVar19 = *(byte **)((int)MStack_10218 + 4); } pbVar17 = pbVar19; do { bVar5 = *pbVar17; pbVar17 = pbVar17 + 1; } while (bVar5 != 0); psVar20 = (std_string *)(pbVar17 + -(int)(pbVar19 + 1)); if (psVar20 <= (std_string *)(0x7fffffff - local_2c)) { pppppppbVar12 = (byte *******)local_3c; if (0xf < local_28) { pppppppbVar12 = local_3c[0]; } std::string::concat(local_54._buf,(int)fStack_10224,psVar20, (byte *)pppppppbVar12,local_2c,pbVar19,(uint)psVar20); uStack_1021c = uStack_1021c | 0x20; local_14 = (byte ******)CONCAT31(local_14._1_3_,0xd); ModManager::TryRedirectPath(&pMVar4->_modManager,&local_164,&local_54); MVar8 = MStack_10234; piVar27 = (int *)((int)MStack_10234 + -0x1c); if (piVar27 != extraout_EAX_04) { std::string::_Tidy_deallocate((char *)piVar27); iVar9 = extraout_EAX_04[1]; iVar2 = extraout_EAX_04[2]; iVar3 = extraout_EAX_04[3]; *piVar27 = *extraout_EAX_04; *(int *)((int)MVar8 + -0x18) = iVar9; *(int *)((int)MVar8 + -0x14) = iVar2; *(int *)((int)MVar8 + -0x10) = iVar3; iVar9 = extraout_EAX_04[5]; *(int *)((int)MVar8 + -0xc) = extraout_EAX_04[4]; *(int *)((int)MVar8 + -8) = iVar9; extraout_EAX_04[4] = 0; extraout_EAX_04[5] = 0xf; *(undefined1 *)extraout_EAX_04 = 0; } psVar20 = &local_164; goto LAB_007e0e57; } goto LAB_007e1407; } pbVar18 = &DAT_00b6be40; pbVar17 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar17 = pbVar19; } do { bVar5 = *pbVar17; bVar29 = bVar5 < *pbVar18; if (bVar5 != *pbVar18) { LAB_007e0ea0: uVar7 = -(uint)bVar29 | 1; goto LAB_007e0ea5; } if (bVar5 == 0) break; bVar5 = pbVar17[1]; bVar29 = bVar5 < pbVar18[1]; if (bVar5 != pbVar18[1]) goto LAB_007e0ea0; pbVar17 = pbVar17 + 2; pbVar18 = pbVar18 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_007e0ea5: if (uVar7 == 0) { pbVar19 = &g_xmlNullStr; if (*(byte **)((int)MStack_10218 + 4) != (byte *)0x0) { pbVar19 = *(byte **)((int)MStack_10218 + 4); } dVar30 = atof((char *)pbVar19); fStack_10224 = (float)dVar30; *(float *)((int)MVar8 + -4) = fStack_10224; } } if ((*(int *)((int)MStack_10218 + 0x10) == 0) || (MStack_10218 = *(Music *)((int)MStack_10218 + 0x18), MStack_10218 == (Music)0x0)) break; MVar8 = MStack_10234; } while( true ); } pbStack_10214 = *(byte **)(pbStack_10214 + 0x2c); } while (pbStack_10214 != (byte *)0x0); MStack_10218 = MStack_10238; } if (MStack_10218 != MStack_10234) { pbVar19 = (byte *)(((int)MStack_10234 - (int)MStack_10218) / 0x34); fStack_10224 = 0.0; uVar7 = -(uint)((int)(ZEXT48(pbVar19) * 0x34 >> 0x20) != 0) | (uint)(ZEXT48(pbVar19) * 0x34) ; pbStack_10214 = pbVar19; pbStack_101b4 = pbVar19; puVar14 = operator_new_tracked(-(uint)(0xfffffffb < uVar7) | uVar7 + 4); local_14._0_1_ = 0xe; if (puVar14 == (undefined4 *)0x0) { puVar28 = (undefined4 *)0x0; } else { puVar28 = puVar14 + 1; *puVar14 = pbVar19; _eh_vector_constructor_iterator_ (puVar28,0x34,(uint)pbVar19,(_func_void_void_ptr *)&LAB_007df270,FUN_007e1430); } local_14._0_1_ = 5; puStack_101b8 = puVar28; if (pbVar19 != (byte *)0x0) { this_00 = puVar28 + 6; puVar23 = (uint *)((int)MStack_10218 + 0x2c); do { if (this_00 != puVar23 + -5) { puVar15 = puVar23 + -0xb; if (0xf < puVar23[-6]) { puVar15 = (uint *)*puVar15; } std::string::assign((char *)(this_00 + -6),(byte *)puVar15,puVar23[-7]); puVar15 = puVar23 + -5; if (0xf < *puVar23) { puVar15 = (uint *)*puVar15; } std::string::assign((char *)this_00,(byte *)puVar15,puVar23[-1]); } puVar15 = puVar23 + 1; puVar23 = puVar23 + 0xd; this_00[6] = *puVar15; this_00 = this_00 + 0xd; pbStack_10214 = pbStack_10214 + -1; } while (pbStack_10214 != (byte *)0x0); } } if (ismod == 0) { if (iStack_10210 - 1U < 0x77) { iVar9 = iStack_10210 * 0x60; pvVar10 = *(void **)((int)this[199] + 0x58 + iVar9); if (pvVar10 != (void *)0x0) { puVar23 = (uint *)((int)pvVar10 + -4); local_14._0_1_ = 0xf; _eh_vector_destructor_iterator_(pvVar10,0x34,*puVar23,FUN_007e1430); operator_delete(puVar23,*puVar23 * 0x34 + 4); local_14._0_1_ = 5; *(undefined4 *)((int)this[199] + 0x58 + iVar9) = 0; } piVar27 = (int *)((int)this[199] + iVar9); *piVar27 = iStack_10210; if ((byte ********)(piVar27 + 1) != apppppppbStack_1020c) { pppppppbVar12 = (byte *******)apppppppbStack_1020c; if (0xf < uStack_101f8) { pppppppbVar12 = apppppppbStack_1020c[0]; } std::string::assign((char *)(piVar27 + 1),(byte *)pppppppbVar12,uStack_101fc); } if ((byte ********)(piVar27 + 7) != &pppppppbStack_101f4) { pppppppbVar12 = (byte *******)&pppppppbStack_101f4; if ((byte ******)0xf < ppppppbStack_101e0) { pppppppbVar12 = pppppppbStack_101f4; } std::string::assign((char *)(piVar27 + 7),(byte *)pppppppbVar12,(uint)ppppppbStack_101e4 ); } if ((byte ********)(piVar27 + 0xd) != &pppppppbStack_101dc) { pppppppbVar12 = (byte *******)&pppppppbStack_101dc; if ((byte ******)0xf < ppppppbStack_101c8) { pppppppbVar12 = pppppppbStack_101dc; } std::string::assign((char *)(piVar27 + 0xd),(byte *)pppppppbVar12, (uint)ppppppbStack_101cc); } *(undefined1 *)(piVar27 + 0x13) = (undefined1)uStack_101c4; *(undefined1 *)((int)piVar27 + 0x4d) = uStack_101c4._1_1_; piVar27[0x14] = (int)fStack_101c0; piVar27[0x16] = (int)puStack_101b8; piVar27[0x15] = (int)fStack_101bc; piVar27[0x17] = (int)pbStack_101b4; } } else { MVar8 = this[200]; iStack_10210 = ((int)MVar8 - (int)this[199]) / 0x60; if (MVar8 == this[0xc9]) { FUN_007e2c90(MVar8,&iStack_10210); } else { FUN_007e2bf0(); this[200] = (Music)((int)this[200] + 0x60); } } local_14._0_1_ = 4; if ((void *)0xf < pvStack_74) { uVar7 = (int)pvStack_74 + 1; pvVar10 = local_88; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_88 + -4); uVar7 = (int)pvStack_74 + 0x24; if (0x1f < (uint)((int)local_88 + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } if ((void *)0xf < pvStack_8c) { uVar7 = (int)pvStack_8c + 1; pvVar10 = local_a0; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_a0 + -4); uVar7 = (int)pvStack_8c + 0x24; if (0x1f < (uint)((int)local_a0 + (-4 - (int)pvVar10))) goto LAB_007e13a8; } operator_delete(pvVar10,uVar7); } MVar1 = MStack_10234; local_14._0_1_ = 3; MVar8 = MStack_10218; if (MStack_10218 != (Music)0x0) { for (; MVar8 != MVar1; MVar8 = (Music)((int)MVar8 + 0x34)) { std::string::_Tidy_deallocate((char *)((int)MVar8 + 0x18)); std::string::_Tidy_deallocate((char *)MVar8); } uVar7 = (((int)MStack_10228 - (int)MStack_10218) / 0x34) * 0x34; MVar8 = MStack_10218; if (0xfff < uVar7) { MVar8 = *(Music *)((int)MStack_10218 + -4); uVar7 = uVar7 + 0x23; if (0x1f < ((int)MStack_10218 - (int)MVar8) - 4U) goto LAB_007e13a8; } operator_delete((void *)MVar8,uVar7); MStack_10238 = (Music)0x0; MStack_10234 = (Music)0x0; MStack_10230 = (Music)0x0; } local_14._0_1_ = 2; if ((byte ******)0xf < ppppppbStack_101c8) { ppppppbVar21 = (byte ******)((int)ppppppbStack_101c8 + 1); pppppppbVar12 = pppppppbStack_101dc; if ((byte ******)0xfff < ppppppbVar21) { pppppppbVar12 = (byte *******)pppppppbStack_101dc[-1]; ppppppbVar21 = ppppppbStack_101c8 + 9; if ((byte *)0x1f < (byte *)((int)pppppppbStack_101dc + (-4 - (int)pppppppbVar12))) goto LAB_007e13a8; } operator_delete(pppppppbVar12,(uint)ppppppbVar21); } if ((byte ******)0xf < ppppppbStack_101e0) { ppppppbVar21 = (byte ******)((int)ppppppbStack_101e0 + 1); pppppppbVar12 = pppppppbStack_101f4; if ((byte ******)0xfff < ppppppbVar21) { pppppppbVar12 = (byte *******)pppppppbStack_101f4[-1]; ppppppbVar21 = ppppppbStack_101e0 + 9; if ((byte *)0x1f < (byte *)((int)pppppppbStack_101f4 + (-4 - (int)pppppppbVar12))) goto LAB_007e13a8; } operator_delete(pppppppbVar12,(uint)ppppppbVar21); } if (0xf < uStack_101f8) { uVar7 = uStack_101f8 + 1; pppppppbVar12 = apppppppbStack_1020c[0]; if (0xfff < uVar7) { pppppppbVar12 = (byte *******)apppppppbStack_1020c[0][-1]; uVar7 = uStack_101f8 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_1020c[0] + (-4 - (int)pppppppbVar12))) goto LAB_007e13a8; } operator_delete(pppppppbVar12,uVar7); } } local_14._0_1_ = 1; if (0xf < local_28) { uVar7 = local_28 + 1; pppppppbVar12 = local_3c[0]; if (0xfff < uVar7) { pppppppbVar12 = (byte *******)local_3c[0][-1]; uVar7 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c[0] + (-4 - (int)pppppppbVar12))) { LAB_007e13a8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar12,uVar7); } local_14 = (byte ******)0x10; xml_memory_pool::clear(auStack_10180); local_14 = (byte ******)0x11; tracked_alloc(1,pMStack_1022c,0); } ExceptionList = local_1c; return; } //@@ 007e1410 FUN_007e1410 void FUN_007e1410(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); return; } //@@ 007e1430 FUN_007e1430 void FUN_007e1430(void) { char *in_ECX; std::string::_Tidy_deallocate(in_ECX + 0x18); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 007e1450 MusicStream::play /* DB: ? thiscall stream slot of MusicChannel (track +0x34/+0x1c, layers): loads the sound via the sound manager vtable +0x24, SoundInstance::assign, sets loop (vfunc +0x40), pitch +0x58, volume (XMM3 * master) +0x48; MusicChannel::play_track, Music::PlayJingle */ void MusicStream::play(undefined4 *param_1,undefined4 param_2,int param_3) { char cVar1; int *in_ECX; int *piVar2; int *piVar3; float in_XMM3_Da; undefined1 local_20 [4]; int *local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b008dd; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = in_XMM3_Da; if ((int *)*in_ECX != (int *)0x0) { cVar1 = (**(code **)(*(int *)*in_ECX + 0x28))(__security_cookie ^ (uint)(local_20 + 0x1c)); if (cVar1 != '\0') { KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 2) = 0; *(undefined1 *)((int)in_ECX + 10) = 0; in_ECX[3] = 0x3f800000; in_ECX[4] = 0; in_ECX[5] = 0x3f800000; } } if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } (**(code **)(PTR_vftable_00c5aaa0 + 0x24))(local_20,param_1,1,0); local_8 = 0; SoundInstance::assign(in_ECX,local_20); local_8 = 1; if (local_1c != (int *)0x0) { cVar1 = (**(code **)(*local_1c + 0xc))(); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_20); } } local_8 = 0xffffffff; *(char *)(in_ECX + 2) = (char)param_2; piVar2 = (int *)0x0; if ((int *)*in_ECX != (int *)0x0) { (**(code **)(*(int *)*in_ECX + 0x40))(param_2); piVar2 = (int *)*in_ECX; } in_ECX[0xb] = 0; *(undefined1 *)(in_ECX + 10) = 1; in_ECX[5] = param_3; piVar3 = (int *)0x0; if (piVar2 != (int *)0x0) { (**(code **)(*piVar2 + 0x58))(param_3); piVar3 = (int *)*in_ECX; } if (in_ECX[0xc] == 0) { in_ECX[8] = (int)local_18; in_ECX[7] = (int)local_18; } local_18 = local_18 * DAT_00c7167c; in_ECX[3] = (int)local_18; if (piVar3 != (int *)0x0) { (**(code **)(*piVar3 + 0x48))(local_18); } ExceptionList = local_10; return; } //@@ 007e15a0 FUN_007e15a0 void FUN_007e15a0(char param_1) { float fVar1; char cVar2; char cVar3; int *in_ECX; float10 fVar4; float fVar5; float local_14; local_14 = DAT_00c7167c; if (in_ECX[0xc] != 0) { local_14 = DAT_00c7167c * *(float *)(in_ECX[0xc] + 0x174); } if (in_ECX[0xb] < 0xb) { cVar3 = (char)in_ECX[10]; } else if ((int *)*in_ECX == (int *)0x0) { cVar3 = '\0'; *(undefined1 *)(in_ECX + 10) = 0; } else { if ((*(char *)((int)in_ECX + 9) != '\0') && (cVar3 = (**(code **)(*(int *)*in_ECX + 0x38))(), cVar3 != '\0')) { *(undefined1 *)((int)in_ECX + 9) = 0; } cVar2 = (**(code **)(*(int *)*in_ECX + 0x38))(); cVar3 = '\x01'; if (cVar2 == '\0') { cVar3 = *(char *)((int)in_ECX + 9); } *(char *)(in_ECX + 10) = cVar3; } if (cVar3 == '\0') { if ((((int *)*in_ECX != (int *)0x0) && (cVar3 = (**(code **)(*(int *)*in_ECX + 0x28))(), cVar3 != '\0')) && ((*in_ECX == 0 || (*(char *)((int)in_ECX + 10) == '\0')))) { KAGE_LogMessage(1,(byte *)"music stopped playing\n"); FUN_00a2abd0(); } } else { fVar5 = (float)in_ECX[7]; fVar1 = (float)in_ECX[8]; in_ECX[0xb] = in_ECX[0xb] + 1; if (ABS(fVar5 - fVar1) <= (float)in_ECX[9]) { if ((((fVar5 != fVar1) && (in_ECX[7] = (int)fVar1, fVar1 == 0.0)) && (param_1 != '\0')) && (FUN_007e1730(), (char)in_ECX[10] == '\0')) { return; } } else { in_ECX[7] = (int)((fVar1 - fVar5) * (float)in_ECX[9] + fVar5); } local_14 = (float)in_ECX[6] * (float)in_ECX[7] * local_14; if ((int *)*in_ECX == (int *)0x0) { fVar5 = (float)in_ECX[3]; } else { fVar4 = (float10)(**(code **)(*(int *)*in_ECX + 0x4c))(); fVar5 = (float)fVar4; } if (local_14 != fVar5) { in_ECX[3] = (int)local_14; if ((int *)*in_ECX != (int *)0x0) { (**(code **)(*(int *)*in_ECX + 0x48))(local_14); return; } } } return; } //@@ 007e1730 FUN_007e1730 void FUN_007e1730(void) { int *in_ECX; if ((char)in_ECX[10] != '\0') { if ((int *)*in_ECX != (int *)0x0) { (**(code **)(*(int *)*in_ECX + 0x3c))(); *(undefined1 *)((int)in_ECX + 9) = 0; } KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 2) = 0; *(undefined1 *)((int)in_ECX + 10) = 0; in_ECX[3] = 0x3f800000; in_ECX[4] = 0; in_ECX[5] = 0x3f800000; *(undefined1 *)(in_ECX + 10) = 0; in_ECX[0xb] = 0; } return; } //@@ 007e1780 MusicManager::GetCurrentMusicID /* ZHL [lua] Lua binding MusicManager:GetCurrentMusicID */ int __thiscall MusicManager::GetCurrentMusicID(MusicManager *this) { return this->_currentMusicID; } //@@ 007e1790 MusicManager::GetQueuedMusicID /* ZHL [lua] Lua binding MusicManager:GetQueuedMusicID */ int __thiscall MusicManager::GetQueuedMusicID(MusicManager *this) { int iVar1; iVar1 = this->_queuedMusicID; if (iVar1 == 0) { iVar1 = this->_currentMusicID; } return iVar1; } //@@ 007e17b0 Music::Update /* DB: ECX Music (Manager::Update): volume fade (+0xd8/+0xd9 timer), pitch target +0xc6 -> +0xc5 lerp with Music::SetPitchAll, Game::IsInTimedSet, stream pitch vfunc +0x58, Music::Play */ void Music::Update(void) { byte bVar1; Game *pGVar2; char cVar3; Music *in_ECX; Music *this; Manager *pMVar4; double dVar5; Music MVar6; float fVar7; undefined1 local_3c [8]; void *local_34; double local_30; void **local_28; Music local_20; Music *local_1c; void **local_18; char local_11; DAT_00c7167c = (g_manager->_optionsConfig)._sfxVolume; FUN_007e15a0(1); fVar7 = 1.0; if ((*(char *)(in_ECX + 0xd5) == '\0') || ((int)in_ECX[0xd9] < 1)) { MVar6 = in_ECX[0xd8]; if (in_ECX[0xd9] == (Music)0xffffff9c) { MVar6 = (Music)((1.0 - (float)MVar6) * 0.04 + (float)MVar6); } else if (0.033333335 < ABS((float)MVar6 - 1.0)) { if (1.0 <= (float)MVar6) { MVar6 = (Music)((float)MVar6 - 0.033333335); } else { MVar6 = (Music)((float)MVar6 + 0.033333335); } } else { MVar6 = (Music)0x3f800000; } } else { in_ECX[0xd9] = (Music)((int)in_ECX[0xd9] + -1); MVar6 = (Music)((0.1 - (float)in_ECX[0xd8]) * 0.08 + (float)in_ECX[0xd8]); } in_ECX[0xd8] = MVar6; local_20 = (Music)0x0; if ((*(char *)(in_ECX + 0xca) == '\0') && (g_manager->_state != 3)) { fVar7 = 0.0; } DAT_00c7167c = fVar7 * (float)MVar6; local_1c = in_ECX + 1; MVar6 = (Music)0x0; do { MusicChannel::update_volume(MVar6 != *in_ECX); pMVar4 = g_manager; MVar6 = (Music)((int)MVar6 + 1); local_1c = local_1c + 0x61; } while ((uint)MVar6 < 2); cVar3 = '\0'; local_11 = '\0'; if (g_game != (Game *)0x0) { local_1c = (Music *)&DAT_0000002a; local_18 = &(g_game->_seedEffects)._seedEffects; std::set::find_node(&local_30,&local_1c); if (((*(char *)((int)local_28 + 0xd) == '\0') && ((int)local_28[4] < 0x2b)) && (local_28 != *local_18)) { in_ECX[0xc5] = (Music)0x3e19999a; cVar3 = '\x01'; } else { local_28 = &(g_game->_seedEffects)._seedEffects; local_1c = (Music *)0x29; std::set::find_node(local_3c,&local_1c); if (((*(char *)((int)local_34 + 0xd) == '\0') && (*(int *)((int)local_34 + 0x10) < 0x2a)) && (local_34 != *local_18)) { in_ECX[0xc5] = (Music)0x3f400000; cVar3 = '\x01'; } else { local_1c = (Music *)&DAT_0000002b; std::set::find_node(local_3c,&local_1c); if (((*(char *)((int)local_34 + 0xd) == '\0') && (*(int *)((int)local_34 + 0x10) < 0x2c)) && (local_34 != *local_18)) { in_ECX[0xc5] = (Music)0x3fa00000; cVar3 = '\x01'; } else { bVar1 = Game::IsInTimedSet(g_game,0x2c); if (bVar1 == 0) { cVar3 = local_11; } else { in_ECX[0xc5] = (Music)0x40200000; cVar3 = '\x01'; } } } } if (pMVar4->_state == 2) { if (g_game->_dizzyIntensity <= 0.0) { MVar6 = in_ECX[0xc5]; pGVar2 = g_game; } else { local_30 = (double)pMVar4->_framecount * 0.05000000074505806; local_1c = (Music *)log_precise((float)in_ECX[0xc5]); fVar7 = log_precise(2.0); local_1c = (Music *)((float)local_1c / fVar7); dVar5 = local_30 * 0.8; libm_sse2_sin_precise(); local_18 = (void **)((float)dVar5 * 0.4); dVar5 = local_30; libm_sse2_sin_precise(); local_18 = (void **)((float)local_18 + (float)dVar5 * 0.2); dVar5 = local_30 * 0.37; libm_sse2_sin_precise(); MVar6 = (Music)pow(2.0,((float)local_18 + (float)dVar5 * 0.4) * g_game->_dizzyIntensity * 0.05 + (float)local_1c); pGVar2 = g_game; in_ECX[0xc5] = MVar6; cVar3 = '\x01'; } if ((*(uint *)(*(int *)((int)pGVar2->_room + 4) + 0x44) >> 10 & 1) != 0) { local_30 = (double)pMVar4->_framecount * 0.009999999776482582; local_18 = (void **)log_precise((float)MVar6); fVar7 = log_precise(2.0); local_18 = (void **)((float)local_18 / fVar7); dVar5 = local_30 * 0.8; libm_sse2_sin_precise(); local_1c = (Music *)((float)dVar5 * 0.4); dVar5 = local_30; libm_sse2_sin_precise(); local_1c = (Music *)((float)local_1c + (float)dVar5 * 0.2); dVar5 = local_30 * 0.37; libm_sse2_sin_precise(); MVar6 = (Music)pow(2.0,(float)local_18 + ((float)local_1c + (float)dVar5 * 0.4) * 0.002); in_ECX[0xc5] = MVar6; cVar3 = '\x01'; } } } fVar7 = (float)in_ECX[0xc6] - (float)in_ECX[0xc5]; if (ABS(fVar7) <= 0.001) { if (cVar3 == '\0') goto LAB_007e1c86; } else { in_ECX[0xc5] = (Music)(fVar7 * 0.1 + (float)in_ECX[0xc5]); } local_1c = (Music *)0x2; this = in_ECX + 1; do { SetPitchAll(this,(float)in_ECX[0xc5]); this = this + 0x61; local_1c = (Music *)&local_1c[-1].field_0x3; } while (local_1c != (Music *)0x0); in_ECX[0xd0] = in_ECX[0xc5]; if (in_ECX[0xcb] != (Music)0x0) { (**(code **)(*(int *)in_ECX[0xcb] + 0x58))(in_ECX[0xc5]); } pMVar4 = g_manager; LAB_007e1c86: if ((*(char *)(in_ECX + ((int)*in_ECX + 1) * 0x61) == '\0') && (in_ECX[0xc4] != (Music)0x0)) { if ((pMVar4->_musicManager)._isEnabled != 0) { local_20 = (Music)(pMVar4->_optionsConfig)._musicVolume; } if (-1 < (int)in_ECX[0xc4]) { if ((int)in_ECX[0xc4] < ((int)in_ECX[200] - (int)in_ECX[199]) / 0x60) { Play(in_ECX,(int)in_ECX[0xc4],0.0); in_ECX[(int)*in_ECX * 0x61 + 0x5e] = (Music)0x0; in_ECX[(int)*in_ECX * 0x61 + 0x5f] = local_20; in_ECX[(int)*in_ECX * 0x61 + 0x60] = (Music)0x3da3d70a; } } in_ECX[0xc4] = (Music)0x0; } return; } //@@ 007e1d50 Music::Play /* ZHL [exact] __thiscall void Music::Play(int musicid,float volume); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Music::Play(Music *this,int musicid,float volume) { Music MVar1; int iVar2; int iVar3; if ((((-1 < musicid) && (musicid < ((int)this[200] - (int)this[199]) / 0x60)) || (KAGE_LogMessage(0x10,(byte *)"Music ID %d out of bounds.\n"), -1 < musicid)) && (musicid < ((int)this[200] - (int)this[199]) / 0x60)) { iVar2 = musicid * 0x60 + (int)this[199]; if (*(int *)(iVar2 + 0x44) == 0) { KAGE_LogMessage(1,(byte *)"[warn] no music for ID %d (%s).\n"); return; } iVar3 = 2; do { FUN_007df600(); iVar3 = iVar3 + -1; } while (iVar3 != 0); MVar1 = *this; this[0xc3] = (Music)musicid; this[0xc4] = (Music)0x0; this[(int)MVar1 * 0x61 + 0x5f] = (Music)volume; this[(int)MVar1 * 0x61 + 0x5e] = (Music)volume; MusicChannel::play_track(iVar2); FUN_007df5b0(); } return; } //@@ 007e1e70 MusicManager::Crossfade /* ZHL [lua] Lua binding MusicManager:Crossfade prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall MusicManager::Crossfade(MusicManager *this,int musicId,float fadeRate) { int iVar1; Manager *pMVar2; char cVar3; void *pvVar4; uint uVar5; int iVar6; int *piVar7; if ((((-1 < musicId) && (musicId < ((int)(this->_entries)._end - (int)(this->_entries)._begin) / 0x60)) || (KAGE_LogMessage(0x10,(byte *)"Music ID %d out of bounds.\n"), -1 < musicId)) && (pvVar4 = (this->_entries)._begin, musicId < ((int)(this->_entries)._end - (int)pvVar4) / 0x60) ) { if (musicId == this->_currentMusicID) { KAGE_LogMessage(1,(byte *) "Music::Crossfade: music already playing, only adjusting target volume.\n"); if ((g_manager->_musicManager)._isEnabled == 0) { this->_channels[this->_currentChannel]._targetVolume = 0.0; return; } this->_channels[this->_currentChannel]._targetVolume = (g_manager->_optionsConfig)._musicVolume; return; } pvVar4 = (void *)(musicId * 0x60 + (int)pvVar4); if (*(int *)((int)pvVar4 + 0x44) == 0) { KAGE_LogMessage(1,(byte *)"[warn] no music for ID %d (%s).\n"); return; } this->_channels[this->_currentChannel]._targetVolume = 0.0; iVar1 = this->_currentChannel; if ((*(int **)(this->_channels + iVar1) != (int *)0x0) && (cVar3 = (**(code **)(**(int **)(this->_channels + iVar1) + 0x28))(), cVar3 != '\0')) { piVar7 = *(int **)(this->_channels + iVar1); this->_channels[iVar1].field_0x8 = 0; if (piVar7 != (int *)0x0) { (**(code **)(*piVar7 + 0x40))(0); } } iVar6 = 6; piVar7 = (int *)&this->_channels[iVar1].field_0x34; do { if (((int *)*piVar7 != (int *)0x0) && (cVar3 = (**(code **)(*(int *)*piVar7 + 0x28))(), cVar3 != '\0')) { *(undefined1 *)(piVar7 + 2) = 0; if ((int *)*piVar7 != (int *)0x0) { (**(code **)(*(int *)*piVar7 + 0x40))(0); } } piVar7 = piVar7 + 0xd; iVar6 = iVar6 + -1; } while (iVar6 != 0); this->_channels[this->_currentChannel]._fadeRate = fadeRate; uVar5 = this->_currentChannel + 1U & 0x80000001; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xfffffffe) + 1; } this->_currentChannel = uVar5; pMVar2 = g_manager; this->_currentMusicID = musicId; this->_queuedMusicID = 0; this->_channels[uVar5]._volume = 0.0; this->_channels[uVar5]._targetVolume = (pMVar2->_optionsConfig)._musicVolume; MusicChannel::play_track(pvVar4); this->_channels[uVar5]._fadeRate = fadeRate; FUN_007df5b0(); } return; } //@@ 007e2080 Music::Fadein /* ZHL [exact] __thiscall void Music::Fadein(unsigned int Id, float Volume, float FadeRate); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Music::Fadein(Music *this,uint Id,float Volume,float FadeRate) { if ((-1 < (int)Id) && ((int)Id < ((int)this[200] - (int)this[199]) / 0x60)) { Play(this,Id,0.0); this[(int)*this * 0x61 + 0x5e] = (Music)0x0; this[(int)*this * 0x61 + 0x5f] = (Music)Volume; this[(int)*this * 0x61 + 0x60] = (Music)FadeRate; } return; } //@@ 007e2100 Music::Fadeout /* ZHL [exact] __thiscall void Music::Fadeout(float FadeRate); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Music::Fadeout(Music *this,float FadeRate) { this[(int)*this * 0x61 + 0x5f] = (Music)0x0; this[(int)*this * 0x61 + 0x60] = (Music)FadeRate; this[0xc4] = (Music)0x0; return; } //@@ 007e2140 Music::Pause /* ZHL [exact] __thiscall void Music::Pause(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Music::Pause(Music *this) { Music MVar1; char cVar2; int iVar3; Music *pMVar4; MVar1 = *this; if (this[(int)MVar1 * 0x61 + 1] != (Music)0x0) { cVar2 = (**(code **)(*(int *)this[(int)MVar1 * 0x61 + 1] + 0x28))(); if (cVar2 != '\0') { if (this[(int)MVar1 * 0x61 + 1] != (Music)0x0) { cVar2 = (**(code **)(*(int *)this[(int)MVar1 * 0x61 + 1] + 0x38))(); if ((cVar2 != '\0') || (this[(int)MVar1 * 0x61 + 3].field_0x1 != '\0')) { (**(code **)(*(int *)this[(int)MVar1 * 0x61 + 1] + 0x30))(); *(undefined2 *)&this[(int)MVar1 * 0x61 + 3].field_0x1 = 0x100; } } *(undefined1 *)(this + (int)MVar1 * 0x61 + 0xb) = 0; this[(int)MVar1 * 0x61 + 0xc] = (Music)0x0; } } pMVar4 = this + (int)MVar1 * 0x61 + 0xe; iVar3 = 6; do { if (*pMVar4 != (Music)0x0) { cVar2 = (**(code **)(*(int *)*pMVar4 + 0x28))(); if (cVar2 != '\0') { if (*pMVar4 != (Music)0x0) { cVar2 = (**(code **)(*(int *)*pMVar4 + 0x38))(); if ((cVar2 != '\0') || (pMVar4[2].field_0x1 != '\0')) { (**(code **)(*(int *)*pMVar4 + 0x30))(); *(undefined2 *)&pMVar4[2].field_0x1 = 0x100; } } *(undefined1 *)(pMVar4 + 10) = 0; pMVar4[0xb] = (Music)0x0; } } pMVar4 = pMVar4 + 0xd; iVar3 = iVar3 + -1; } while (iVar3 != 0); *(undefined1 *)(this + (int)MVar1 * 0x61 + 0x61) = *(undefined1 *)(this + (int)MVar1 * 0x61 + 0xb) ; return; } //@@ 007e21f0 Music::Resume /* ZHL [exact] __thiscall void Music::Resume(); */ void __thiscall Music::Resume(Music *this) { Music MVar1; char cVar2; Music *pMVar3; int iVar4; MVar1 = *this; if (this[(int)MVar1 * 0x61 + 1] != (Music)0x0) { cVar2 = (**(code **)(*(int *)this[(int)MVar1 * 0x61 + 1] + 0x28))(); if (cVar2 != '\0') { if ((this[(int)MVar1 * 0x61 + 1] != (Music)0x0) && (this[(int)MVar1 * 0x61 + 3].field_0x2 != '\0')) { (**(code **)(*(int *)this[(int)MVar1 * 0x61 + 1] + 0x34))(); *(undefined2 *)&this[(int)MVar1 * 0x61 + 3].field_0x1 = 1; } *(undefined1 *)(this + (int)MVar1 * 0x61 + 0xb) = 1; } } pMVar3 = this + (int)MVar1 * 0x61 + 0xe; iVar4 = 6; do { if (*pMVar3 != (Music)0x0) { cVar2 = (**(code **)(*(int *)*pMVar3 + 0x28))(); if (cVar2 != '\0') { if ((*pMVar3 != (Music)0x0) && (pMVar3[2].field_0x2 != '\0')) { (**(code **)(*(int *)*pMVar3 + 0x34))(); *(undefined2 *)&pMVar3[2].field_0x1 = 1; } *(undefined1 *)(pMVar3 + 10) = 1; } } pMVar3 = pMVar3 + 0xd; iVar4 = iVar4 + -1; } while (iVar4 != 0); *(undefined1 *)(this + (int)MVar1 * 0x61 + 0x61) = *(undefined1 *)(this + (int)MVar1 * 0x61 + 0xb) ; return; } //@@ 007e2280 MusicManager::EnableLayer /* ZHL [lua] Lua binding MusicManager:EnableLayer prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall MusicManager::EnableLayer(MusicManager *this,int layerId,byte isInstant) { int *piVar1; int iVar2; char cVar3; int iVar4; int extraout_EDX; undefined4 uVar5; undefined4 uVar6; if (((uint)layerId < 6) && (piVar1 = &this->_channels[this->_currentChannel]._enabledLayers + ((uint)layerId >> 5), *piVar1 = *piVar1 | 1 << ((byte)layerId & 0x1f), isInstant != 0)) { iVar2 = this->_currentChannel; iVar4 = iVar2 * 0x184; piVar1 = &this->_channels[iVar2]._enabledLayers; uVar5 = 0x3f800000; if ((*piVar1 != 0) && (this->_channels[iVar2]._layerMode == 2)) { cVar3 = std::bitset<8>::any(); if (cVar3 == '\0') { uVar6 = uVar5; } else { uVar6 = 0; } *(undefined4 *)&this->_channels[iVar2].field_0x20 = uVar6; *(undefined4 *)&this->_channels[iVar2].field_0x1c = uVar6; iVar4 = extraout_EDX; } if (this->_channels[iVar2].field_0x5c != '\0') { if ((*piVar1 & 1) == 0) { uVar6 = 0; } else { uVar6 = uVar5; } *(undefined4 *)(&this->_channels[0].field_0x54 + iVar4) = uVar6; *(undefined4 *)(&this->_channels[0].field_0x50 + iVar4) = uVar6; } if ((&this->_channels[0].field_0x90)[iVar4] != '\0') { if ((*piVar1 & 2) == 0) { uVar6 = 0; } else { uVar6 = uVar5; } *(undefined4 *)(&this->_channels[0].field_0x88 + iVar4) = uVar6; *(undefined4 *)(&this->_channels[0].field_0x84 + iVar4) = uVar6; } if ((&this->_channels[0].field_0xc4)[iVar4] != '\0') { if ((*piVar1 & 4) == 0) { uVar6 = 0; } else { uVar6 = uVar5; } *(undefined4 *)(&this->_channels[0].field_0xbc + iVar4) = uVar6; *(undefined4 *)(&this->_channels[0].field_0xb8 + iVar4) = uVar6; } if ((&this->_channels[0].field_0xf8)[iVar4] != '\0') { if ((*piVar1 & 8) == 0) { uVar6 = 0; } else { uVar6 = uVar5; } *(undefined4 *)(&this->_channels[0].field_0xf0 + iVar4) = uVar6; *(undefined4 *)(&this->_channels[0].field_0xec + iVar4) = uVar6; } if ((&this->_channels[0].field_0x12c)[iVar4] != '\0') { if ((*piVar1 & 0x10) == 0) { uVar6 = 0; } else { uVar6 = uVar5; } *(undefined4 *)(&this->_channels[0].field_0x124 + iVar4) = uVar6; *(undefined4 *)(&this->_channels[0].field_0x120 + iVar4) = uVar6; } if ((&this->_channels[0].field_0x160)[iVar4] != '\0') { if ((*piVar1 & 0x20) == 0) { uVar5 = 0; } *(undefined4 *)(&this->_channels[0].field_0x158 + iVar4) = uVar5; *(undefined4 *)(&this->_channels[0].field_0x154 + iVar4) = uVar5; } MusicChannel::update_volume(0); } return; } //@@ 007e2410 Music::DisableLayer /* ZHL [exact] __thiscall void Music::DisableLayer(int id); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Music::DisableLayer(Music *this,int id) { if ((uint)id < 6) { this[((uint)id >> 5) + (int)*this * 0x61 + 0x5c] = (Music)((uint)this[((uint)id >> 5) + (int)*this * 0x61 + 0x5c] & ~(1 << ((byte)id & 0x1f))) ; } return; } //@@ 007e2440 Music::IsLayerEnabled /* ZHL [exact] __thiscall bool Music::IsLayerEnabled(unsigned int id); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Music::IsLayerEnabled(Music *this,uint id) { if (id < 6) { return ((uint)this[(id >> 5) + (int)*this * 0x61 + 0x5c] & 1 << ((byte)id & 0x1f)) != 0; } return 0; } //@@ 007e2480 MusicManager::Queue /* ZHL [lua] Lua binding MusicManager:Queue */ void __thiscall MusicManager::Queue(MusicManager *this,int param_2) { if ((-1 < param_2) && (param_2 < ((int)(this->_entries)._end - (int)(this->_entries)._begin) / 0x60)) { this->_queuedMusicID = param_2; } return; } //@@ 007e24c0 MusicManager::PitchSlide /* ZHL [lua] Lua binding MusicManager:PitchSlide */ void __thiscall MusicManager::PitchSlide(MusicManager *this,float param_2) { this->_targetPitch = param_2; return; } //@@ 007e24e0 Music::ResetPitch /* ZHL [exact] __thiscall void Music::ResetPitch(); */ void __thiscall Music::ResetPitch(Music *this) { this[0xc5] = (Music)0x3f800000; this[0xc6] = (Music)0x3f800000; SetPitchAll(this + (int)*this * 0x61 + 1,1.0); return; } //@@ 007e2510 Music::VolumeSlide /* ZHL [exact] __thiscall void Music::VolumeSlide(float TargetVolume, float FadeRate); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Music::VolumeSlide(Music *this,float TargetVolume,float FadeRate) { this[(int)*this * 0x61 + 0x5f] = (Music)(TargetVolume * (g_manager->_optionsConfig)._musicVolume); this[(int)*this * 0x61 + 0x60] = (Music)FadeRate; return; } //@@ 007e2550 Music::UpdateVolume /* ZHL [exact] __thiscall void Music::UpdateVolume(); */ void __thiscall Music::UpdateVolume(Music *this) { Manager *pMVar1; pMVar1 = g_manager; this[(int)*this * 0x61 + 0x5e] = (Music)(g_manager->_optionsConfig)._musicVolume; this[(int)*this * 0x61 + 0x5f] = (Music)(pMVar1->_optionsConfig)._musicVolume; return; } //@@ 007e2580 Music::PlayJingle /* ZHL [exact] __thiscall void Music::PlayJingle(int musicid, int unusedInt, bool unusedBool); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Music::PlayJingle(Music *this,int musicid,int unusedInt,byte unusedBool) { int iVar1; undefined4 extraout_ECX; if ((-1 < musicid) && (musicid < ((int)this[200] - (int)this[199]) / 0x60)) { iVar1 = musicid * 0x60 + (int)this[199]; if ((this[0xc3] != (Music)0x34) && ((this[0xc3] != (Music)0x76 && (*(int *)(iVar1 + 0x44) != 0)))) { MusicStream::play(iVar1 + 0x34,*(undefined1 *)(iVar1 + 0x4c),this[0xc5]); FUN_00a2ac00(extraout_ECX); this[0xd9] = (Music)0x8c; } } return; } //@@ 007e2630 FUN_007e2630 void FUN_007e2630(void) { uint size; int *in_ECX; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); this = this + 0x34; } while (this != pcVar1); this = (char *)*in_ECX; } size = ((in_ECX[2] - (int)this) / 0x34) * 0x34; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007e26c0 std::vector::_Tidy /* DB: destroys 0x60-byte tracks (FUN_007e2e00, stride matches musicid*0x60 in Music::PlayJingle), frees, nulls; MusicManager::~MusicManager */ void std::vector::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_007e2e00(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x60) * 0x60; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007e2740 FUN_007e2740 void FUN_007e2740(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 007e27a0 FUN_007e27a0 void FUN_007e27a0(char *param_1,char *param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x34) { std::string::_Tidy_deallocate(param_1 + 0x18); std::string::_Tidy_deallocate(param_1); } return; } //@@ 007e27d0 FUN_007e27d0 void FUN_007e27d0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x34; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 007e2810 FUN_007e2810 void FUN_007e2810(void) { FUN_007e2e00(); return; } //@@ 007e2830 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x60; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 007e2870 FUN_007e2870 void FUN_007e2870(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; in_EDX[4] = 0; in_EDX[5] = 0; *in_EDX = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_EDX = *param_1; in_EDX[1] = uVar1; in_EDX[2] = uVar2; in_EDX[3] = uVar3; *(undefined8 *)(in_EDX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; in_EDX[10] = 0; in_EDX[0xb] = 0; in_EDX[6] = 0; uVar1 = param_1[7]; uVar2 = param_1[8]; uVar3 = param_1[9]; in_EDX[6] = param_1[6]; in_EDX[7] = uVar1; in_EDX[8] = uVar2; in_EDX[9] = uVar3; *(undefined8 *)(in_EDX + 10) = *(undefined8 *)(param_1 + 10); param_1[10] = 0; param_1[0xb] = 0xf; *(undefined1 *)(param_1 + 6) = 0; in_EDX[0xc] = param_1[0xc]; return; } //@@ 007e28f0 FUN_007e28f0 void * FUN_007e28f0(int param_1,undefined4 param_2) { uint uVar1; uint uVar2; void *pvVar3; int *in_ECX; int extraout_ECX; int iVar4; int extraout_ECX_00; int iVar5; uint uVar6; int iVar7; iVar5 = param_1 - *in_ECX; iVar7 = (in_ECX[1] - *in_ECX) / 0x34; if (iVar7 == 0x4ec4ec4) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar7 + 1; uVar2 = (in_ECX[2] - *in_ECX) / 0x34; if (0x4ec4ec4 - (uVar2 >> 1) < uVar2) { uVar6 = 0x4ec4ec4; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar6 = uVar1; if (uVar1 <= uVar2) { uVar6 = uVar2; } if (0x4ec4ec4 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = std::_Allocate(uVar6 * 0x34); FUN_007e2870(param_2); iVar7 = in_ECX[1]; iVar4 = *in_ECX; if (param_1 == iVar7) { while (iVar4 != iVar7) { FUN_007e2870(iVar4); iVar4 = extraout_ECX + 0x34; } } else { if (iVar4 != param_1) { do { FUN_007e2870(iVar4); iVar4 = extraout_ECX_00 + 0x34; } while (iVar4 != param_1); iVar7 = in_ECX[1]; } for (; param_1 != iVar7; param_1 = param_1 + 0x34) { FUN_007e2870(param_1); } } FUN_007e2e40(pvVar3,uVar1,uVar6); return (void *)((int)pvVar3 + (iVar5 / 0x34) * 0x34); } //@@ 007e2a30 std::vector<52byte>::_Emplace_reallocate /* DB: growth/max 0x4ec4ec4 by /0x34; caller Music::LoadConfig */ char * std::vector<52byte>::_Emplace_reallocate(int param_1,void *param_2) { uint uVar1; uint uVar2; void *pvVar3; int *in_ECX; int extraout_ECX; int iVar4; int extraout_ECX_00; char *this; int iVar5; uint local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0090d; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0x34; if (iVar5 == 0x4ec4ec4) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = iVar5 + 1; uVar1 = (in_ECX[2] - *in_ECX) / 0x34; if (0x4ec4ec4 - (uVar1 >> 1) < uVar1) { local_1c = 0x4ec4ec4; } else { uVar1 = (uVar1 >> 1) + uVar1; local_1c = uVar2; if (uVar2 <= uVar1) { local_1c = uVar1; } if (0x4ec4ec4 < local_1c) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = _Allocate(local_1c * 0x34); local_8 = 0; this = (char *)(((param_1 - iVar4) / 0x34) * 0x34 + (int)pvVar3); string::string(this,param_2); local_8 = CONCAT31(local_8._1_3_,1); string::string(this + 0x18,(void *)((int)param_2 + 0x18)); *(undefined4 *)(this + 0x30) = *(undefined4 *)((int)param_2 + 0x30); iVar5 = in_ECX[1]; iVar4 = *in_ECX; if (param_1 == iVar5) { while (iVar4 != iVar5) { FUN_007e2870(iVar4); iVar4 = extraout_ECX + 0x34; } } else { if (iVar4 != param_1) { do { FUN_007e2870(iVar4); iVar4 = extraout_ECX_00 + 0x34; } while (iVar4 != param_1); iVar5 = in_ECX[1]; } for (; param_1 != iVar5; param_1 = param_1 + 0x34) { FUN_007e2870(param_1); } } FUN_007e2e40(pvVar3,uVar2,local_1c); ExceptionList = local_10; return this; } //@@ 007e2bc7 Catch_All@007e2bc7 void Catch_All_007e2bc7(void) { int unaff_EBP; FUN_007e27a0(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x24)); FUN_007e27d0(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007e2bf0 FUN_007e2bf0 void FUN_007e2bf0(undefined4 *param_1) { undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0094b; local_10 = ExceptionList; ExceptionList = &local_10; *in_EDX = *param_1; std::string::string((char *)(in_EDX + 1),param_1 + 1); local_8 = 0; std::string::string((char *)(in_EDX + 7),param_1 + 7); local_8 = CONCAT31(local_8._1_3_,1); std::string::string((char *)(in_EDX + 0xd),param_1 + 0xd); *(undefined1 *)(in_EDX + 0x13) = *(undefined1 *)(param_1 + 0x13); *(undefined1 *)((int)in_EDX + 0x4d) = *(undefined1 *)((int)param_1 + 0x4d); in_EDX[0x14] = param_1[0x14]; in_EDX[0x15] = param_1[0x15]; in_EDX[0x16] = param_1[0x16]; in_EDX[0x17] = param_1[0x17]; ExceptionList = local_10; return; } //@@ 007e2c90 FUN_007e2c90 void * FUN_007e2c90(int param_1,undefined4 param_2) { uint uVar1; int iVar2; void *pvVar3; void *pvVar4; int *in_ECX; uint uVar5; void *pvVar6; int iVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00970; local_10 = ExceptionList; ExceptionList = &local_10; iVar7 = *in_ECX; iVar2 = (in_ECX[1] - iVar7) / 0x60; if (iVar2 == 0x2aaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = (in_ECX[2] - iVar7) / 0x60; if (0x2aaaaaa - (uVar1 >> 1) < uVar1) { uVar5 = 0x2aaaaaa; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar2 + 1U; if (iVar2 + 1U <= uVar1) { uVar5 = uVar1; } if (0x2aaaaaa < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = std::_Allocate(uVar5 * 0x60); local_8 = 0; pvVar4 = (void *)(((param_1 - iVar7) / 0x60) * 0x60 + (int)pvVar3); FUN_007e2bf0(param_2); iVar7 = *in_ECX; pvVar6 = pvVar3; if (param_1 != in_ECX[1]) { FUN_007e3060(pvVar3,iVar7); pvVar6 = (void *)((int)pvVar4 + 0x60); } FUN_007e3060(pvVar6,iVar7); FUN_007e2ed0(pvVar3,iVar2 + 1,uVar5); ExceptionList = local_10; return pvVar4; } //@@ 007e2dd0 Catch_All@007e2dd0 void Catch_All_007e2dd0(void) { int unaff_EBP; FUN_007e2810(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007e2e00 FUN_007e2e00 void FUN_007e2e00(void) { char *pcVar1; char *in_ECX; char *in_EDX; char *this; if (in_ECX != in_EDX) { this = in_ECX + 0x1c; do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); std::string::_Tidy_deallocate(this + -0x18); pcVar1 = this + 0x44; this = this + 0x60; } while (pcVar1 != in_EDX); } return; } //@@ 007e2e40 FUN_007e2e40 void FUN_007e2e40(int param_1,int param_2,int param_3) { uint size; int *in_ECX; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); this = this + 0x34; } while (this != pcVar1); this = (char *)*in_ECX; } size = ((in_ECX[2] - (int)this) / 0x34) * 0x34; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x34 + param_1; in_ECX[2] = param_3 * 0x34 + param_1; return; } //@@ 007e2ed0 FUN_007e2ed0 void FUN_007e2ed0(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_007e2e00(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x60) * 0x60; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x60 + param_1; in_ECX[2] = param_3 * 0x60 + param_1; return; } //@@ 007e2f60 FUN_007e2f60 int FUN_007e2f60(int param_1,int param_2) { undefined4 in_ECX; undefined4 extraout_ECX; int extraout_EDX; if (param_2 != 0) { do { FUN_007df200(); param_1 = param_1 + 0x60; in_ECX = extraout_ECX; } while (extraout_EDX != 1); } FUN_007e2e00(in_ECX); return param_1; } //@@ 007e2fa0 FUN_007e2fa0 void FUN_007e2fa0(void) { int iVar1; void *pvVar2; int *in_ECX; void *pvVar3; int extraout_ECX; int extraout_EDX; uint uVar4; iVar1 = (in_ECX[1] - *in_ECX) / 0x60; uVar4 = (in_ECX[2] - *in_ECX) / 0x60; if (0x2aaaaaa - (uVar4 >> 1) < uVar4) { uVar4 = 0x2aaaaaa; } else { uVar4 = (uVar4 >> 1) + uVar4; if (uVar4 < 0x78) { uVar4 = 0x78; } else if (0x2aaaaaa < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar2 = std::_Allocate(uVar4 * 0x60); pvVar3 = (void *)(iVar1 * 0x60 + (int)pvVar2); if (iVar1 != 0x78) { do { FUN_007df200(); pvVar3 = (void *)(extraout_ECX + 0x60); } while (extraout_EDX != 1); } FUN_007e2e00(pvVar3); FUN_007e3060(pvVar2); FUN_007e2ed0(pvVar2,0x78,uVar4); return; } //@@ 007e3060 FUN_007e3060 undefined4 * FUN_007e3060(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *puVar5; undefined4 *in_EDX; undefined4 *puVar6; undefined8 *puVar7; undefined4 *puVar8; puVar5 = in_ECX; puVar8 = param_1; if (in_ECX != in_EDX) { puVar6 = in_ECX + 6; puVar7 = (undefined8 *)(param_1 + 0xb); do { *puVar8 = puVar6[-6]; *(undefined4 *)(puVar7 + -5) = 0; puVar8 = puVar8 + 0x18; *(undefined4 *)(puVar7 + -3) = 0; *(undefined4 *)((int)param_1 + (-0x60 - (int)in_ECX) + (int)(puVar6 + 0x18)) = 0; uVar2 = puVar6[-4]; uVar3 = puVar6[-3]; uVar4 = puVar6[-2]; *(undefined4 *)(puVar7 + -5) = puVar6[-5]; *(undefined4 *)((int)puVar7 + -0x24) = uVar2; *(undefined4 *)(puVar7 + -4) = uVar3; *(undefined4 *)((int)puVar7 + -0x1c) = uVar4; puVar7[-3] = *(undefined8 *)(puVar6 + -1); puVar6[-1] = 0; *puVar6 = 0xf; *(undefined1 *)(puVar6 + -5) = 0; *(undefined4 *)(puVar7 + -2) = 0; *(undefined4 *)puVar7 = 0; *(undefined4 *)((int)puVar7 + 4) = 0; uVar2 = puVar6[2]; uVar3 = puVar6[3]; uVar4 = puVar6[4]; *(undefined4 *)(puVar7 + -2) = puVar6[1]; *(undefined4 *)((int)puVar7 + -0xc) = uVar2; *(undefined4 *)(puVar7 + -1) = uVar3; *(undefined4 *)((int)puVar7 + -4) = uVar4; *puVar7 = *(undefined8 *)(puVar6 + 5); puVar6[5] = 0; puVar6[6] = 0xf; *(undefined1 *)(puVar6 + 1) = 0; *(undefined4 *)(puVar7 + 1) = 0; *(undefined4 *)(puVar7 + 3) = 0; *(undefined4 *)((int)puVar7 + 0x1c) = 0; uVar2 = puVar6[8]; uVar3 = puVar6[9]; uVar4 = puVar6[10]; *(undefined4 *)(puVar7 + 1) = puVar6[7]; *(undefined4 *)((int)puVar7 + 0xc) = uVar2; *(undefined4 *)(puVar7 + 2) = uVar3; *(undefined4 *)((int)puVar7 + 0x14) = uVar4; puVar7[3] = *(undefined8 *)(puVar6 + 0xb); puVar6[0xb] = 0; puVar6[0xc] = 0xf; *(undefined1 *)(puVar6 + 7) = 0; *(undefined1 *)(puVar7 + 4) = *(undefined1 *)(puVar6 + 0xd); *(undefined1 *)((int)puVar7 + 0x21) = *(undefined1 *)((int)puVar6 + 0x35); *(undefined4 *)((int)puVar7 + 0x24) = puVar6[0xe]; *(undefined4 *)(puVar7 + 5) = puVar6[0xf]; *(undefined4 *)((int)puVar7 + 0x2c) = puVar6[0x10]; *(undefined4 *)(puVar7 + 6) = puVar6[0x11]; puVar1 = puVar6 + 0x12; puVar5 = in_EDX; puVar6 = puVar6 + 0x18; puVar7 = puVar7 + 0xc; } while (puVar1 != in_EDX); } FUN_007e2e00(puVar5); return puVar8; } //@@ 007e3190 FUN_007e3190 void FUN_007e3190(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 8)); return; } //@@ 007e31a0 PathFinder::Init /* DB: sets owner, Reset; NPC/Familiar constructors prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall PathFinder::Init(PathFinder *this,Entity *owner) { float *pfVar1; void *pvVar2; pfVar1 = &this[1]._movementTarget.y; (this->_movementTarget).y = 0.0; (this->_movementTarget).x = 0.0; *(undefined4 *)&this->field_0x10 = 0; *(undefined4 *)&this->field_0xc = 0; *(Entity **)this = owner; *(undefined4 *)&this->field_0x734 = 0; *(undefined4 *)&this->field_0x730 = 0; *pfVar1 = 0.0; *(undefined4 *)&this[1].field_0xc = 0; pvVar2 = operator_new(0x14); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *pfVar1 = (float)pvVar2; Reset(this); return; } //@@ 007e3230 FUN_007e3230 void FUN_007e3230(void) { undefined4 *this; int in_ECX; this = (undefined4 *)(in_ECX + 0x748); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 0x748) + 4)); operator_delete((void *)*this,0x14); return; } //@@ 007e3260 PathFinder::Reset /* ZHL [lua] Lua binding PathFinder:Reset prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall PathFinder::Reset(PathFinder *this) { float *this_00; float fVar1; _Tree_node *p_Var2; float fVar3; fVar1 = this[1]._movementTarget.y; *(undefined4 *)&this->field_0x20 = 0xffffffff; this_00 = &this[1]._movementTarget.y; *(undefined4 *)&this->field_0x24 = 0; *(undefined4 *)&this->field_0x28 = 0; *(undefined2 *)&this->_hasDirectPath = 0; *(float *)&this->field_0x730 = g_vectorZero.x; fVar3 = g_vectorZero.y; this->_evadeMovementCountdown = 0; *(undefined4 *)(this + 1) = 0; this[1]._movementTarget.x = 0.0; p_Var2 = *(_Tree_node **)((int)fVar1 + 4); *(float *)&this->field_0x734 = fVar3; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00,p_Var2); *(float *)((int)fVar1 + 4) = fVar1; *(float *)fVar1 = fVar1; *(float *)((int)fVar1 + 8) = fVar1; *(undefined4 *)&this[1].field_0xc = 0; *(undefined4 *)&this->field_0x14 = 0xffffffff; *(undefined4 *)&this->field_0x18 = 0; *(undefined4 *)&this->field_0x1c = 0xffffffff; this->field_0x738 = 0; (this->_movementTarget).x = g_vectorZero.x; (this->_movementTarget).y = g_vectorZero.y; *(float *)&this->field_0xc = g_vectorZero.x; *(float *)&this->field_0x10 = g_vectorZero.y; return; } //@@ 007e3340 PathFinder::is_entity_friendly /* DB: ? this[0] = entity: true when FLAG_CHARM (0x168 & 0x100), type ENTITY_BLOOD_PUPPY (802), target with entity flag, type outside 10..999, or NPC with _controllerID (+0xf1c) != -1 / _forcedTarget (+0xf38); used by PathFinder::FindGridPath/MoveRandomly* prototype: db/protos.zhl */ byte __thiscall PathFinder::is_entity_friendly(PathFinder *this) { int iVar1; int iVar2; byte bVar3; iVar1 = *(int *)this; if (iVar1 == 0) { return 0; } if (((*(uint *)(iVar1 + 0x168) & 0x100) == 0) && (iVar2 = *(int *)(iVar1 + 0x28), iVar2 != 0x322)) { if ((*(Entity **)(iVar1 + 0x3c4) != (Entity *)0x0) && (bVar3 = Entity::HasEntityFlags(*(Entity **)(iVar1 + 0x3c4),0x10000000000000), bVar3 != 0)) { return 1; } if (iVar2 < 10) { return 0; } if (999 < iVar2) { return 0; } if ((*(int *)(iVar1 + 0xf1c) == -1) && (*(int *)(iVar1 + 0xf38) == 0)) { return 0; } } return 1; } //@@ 007e33c0 PathFinder::FindGridPath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding PathFinder:FindGridPath prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall PathFinder::FindGridPath (PathFinder *this,Vector *targetPos,float speed,int pathMarker,byte isUseDirectPath) { undefined1 *puVar1; Entity *pEVar2; Room *pRVar3; float *pfVar4; KColor color; uint *width; int *piVar5; Vector *pVVar6; byte bVar7; uint uVar8; int iVar9; uint uVar10; int iVar11; int iVar12; GridEntity *pGVar13; GridEntity *this_00; void *pvVar14; GridEntity *this_01; int iVar15; uint *puVar16; Game *pGVar17; void *pvVar18; int iVar19; undefined4 unaff_EBX; uint *puVar20; undefined4 unaff_ESI; Entity_NPC *this_02; undefined4 *puVar21; float fVar22; undefined4 unaff_EDI; undefined4 *puVar23; float *pfVar24; PathFinder *pPVar25; float fVar26; float fVar27; undefined1 auVar28 [16]; float fVar29; undefined1 auVar30 [16]; float fVar31; float fVar32; undefined1 auStackY_180 [128]; uint in_stack_ffffff08; void *in_stack_ffffff0c; uint *puVar33; uint *puVar34; uint *puVar35; int in_stack_ffffff2c; undefined1 auStack_ce [2]; undefined1 local_cc [12]; uint *local_c0; uint *local_bc; uint *local_b8; undefined1 local_b4 [8]; undefined1 local_ac [12]; int *local_a0; void *local_9c; uint *local_98; uint *local_94; uint *local_90; float local_8c; uint local_88; void *local_84; uint *local_80; uint local_7c; uint *local_78; float local_74; Vector local_70; Vector local_68; float local_60; int *local_5c; float local_58; float local_54; uint local_50; Vector local_4c; float *local_44; float *local_40; float *local_3c; Vector *local_38; float local_34; char local_2f; char local_2e; char local_2d; void *local_2c; PathFinder *local_28; uint local_24; void *local_20; float *local_1c; float *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; local_8 = 0xff; auStack_7 = (undefined1 [3])0xffffff; puStack_c = &LAB_00b009df; local_10 = ExceptionList; uVar8 = __security_cookie ^ (uint)(auStack_7 + 3); ExceptionList = &local_10; this_02 = *(Entity_NPC **)this; local_38 = targetPos; local_28 = this; local_14 = uVar8; if ((((1 < *(int *)&g_game->_deathmatchManager) && (this_02->_type == 1)) || (this_02->_type - 10U < 0x3de)) && (this_02->_controllerID != -1)) { Entity_NPC::GetControllerInput(this_02,&local_68,0.0); NPCAI_Pathfinder::SimulatePlayerMovement((NPCAI_Pathfinder *)this); iVar12 = (int)(((this_02->_pos).x - 40.0) / 40.0 + 0.5); iVar9 = (int)(((this_02->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar12 < 0) || (iVar11 = *(int *)((int)g_game->_room + 0xc), iVar11 <= iVar12)) || ((iVar9 < 0 || (*(int *)((int)g_game->_room + 0x10) <= iVar9)))) { *(undefined4 *)&local_28->field_0x20 = 0xffffffff; local_28->_hasDirectPath = 1; ExceptionList = local_10; return; } *(int *)&local_28->field_0x20 = iVar9 * iVar11 + iVar12; local_28->_hasDirectPath = 1; ExceptionList = local_10; return; } local_68.y = *(float *)((int)&this_02->_flags + 4); if (((this_02->_flags & 0x200) != 0) && ((this_02->_flags & 0x100) == 0)) { MoveRandomly(this,1); iVar9 = *(int *)this; local_70.y = *(float *)(iVar9 + 0x360); local_60 = *(float *)(iVar9 + 0x364); fVar26 = sqrtf(local_70.y * local_70.y + local_60 * local_60); fVar27 = local_70.y; fVar29 = local_60; if (0.0 < fVar26) { fVar29 = local_60 * (1.0 / fVar26); fVar27 = local_70.y * (1.0 / fVar26); } *(float *)(iVar9 + 0x360) = g_vectorZero.x; *(float *)(iVar9 + 0x364) = g_vectorZero.y; this_02 = *(Entity_NPC **)this; fVar26 = this_02->_friction; if (fVar26 != 0.0) { fVar22 = this_02->_speedMultiplier; (this_02->_velocity).y = (fVar22 * fVar29 * speed) / fVar26 + (this_02->_velocity).y; (this_02->_velocity).x = (fVar22 * fVar27 * speed) / fVar26 + (this_02->_velocity).x; this_02 = *(Entity_NPC **)this; } } iVar9 = pathMarker; local_34 = g_vectorZero.x; local_68.x = g_vectorZero.x; local_40 = (float *)g_vectorZero.y; local_68.y = g_vectorZero.y; local_54 = this_02->_size * (this_02->_sizeMulti).y; local_74 = this_02->_size * (this_02->_sizeMulti).x; local_54 = local_54 + local_54; local_74 = local_74 + local_74; if ((40.0 < local_74) || (local_2e = '\0', 40.0 < local_54)) { local_2e = '\x01'; } if ((this_02->_type != 3) || (local_2d = '\x01', 0 < pathMarker)) { local_2d = '\0'; } bVar7 = is_entity_friendly(this); if ((bVar7 != 0) || (local_2f = '\0', iVar9 < 0)) { local_2f = '\x01'; } local_54 = fmodf(local_54,80.0); fVar27 = fmodf(local_74,80.0); fVar29 = 40.0; if (40.0 < fVar27) { local_68.x = local_34 + 19.960001; local_34 = local_68.x; } if (40.0 < local_54) { local_68.y = (float)local_40 + 19.960001; local_40 = (float *)local_68.y; } local_5c = (int *)(this_02->_pos).x; local_58 = (this_02->_pos).y; fVar31 = (float)local_5c - local_34; fVar32 = local_58 - (float)local_40; fVar26 = 0.5; fVar27 = local_38->x; fVar22 = 120.0; pvVar18 = g_game->_room; local_2c = pvVar18; iVar9 = (int)((fVar27 - 40.0) / 40.0 + 0.5); iVar12 = (int)((local_38->y - 120.0) / 40.0 + 0.5); if ((((iVar9 < 0) || (*(int *)((int)pvVar18 + 0xc) <= iVar9)) || (iVar12 < 0)) || (*(int *)((int)pvVar18 + 0x10) <= iVar12)) { local_50 = 0xffffffff; LAB_007e37a4: pGVar13 = (GridEntity *)0x0; } else { local_50 = iVar12 * *(int *)((int)pvVar18 + 0xc) + iVar9; if (0x1bf < local_50) goto LAB_007e37a4; pGVar13 = *(GridEntity **)((int)pvVar18 + local_50 * 4 + 0x24); } local_8c = fVar31; local_74 = fVar32; if (this->field_0x738 == '\0') { if (((int)local_50 < 0) || (((int)local_50 < 0x1c0 && (999 < *(int *)((int)pvVar18 + local_50 * 4 + 0x76c))))) goto LAB_007e3801; LAB_007e37e5: pGVar17 = g_game; *(float *)&this->field_0x730 = fVar27; *(float *)&this->field_0x734 = local_38->y; } else { if ((pGVar13 != (GridEntity *)0x0) && (bVar7 = GridEntity::IsEasyCrushableOrWalkable(pGVar13), bVar7 == 0)) { bVar7 = GridEntity::IsDangerousCrushableOrWalkable(this_00); if (bVar7 == 0) goto LAB_007e37e5; } LAB_007e3801: pGVar17 = g_game; if ((*(float *)&this->field_0x730 != g_vectorZero.x) || (*(float *)&this->field_0x734 != g_vectorZero.y)) { iVar9 = (int)((*(float *)&this->field_0x730 - fVar29) / fVar29 + fVar26); iVar12 = (int)((*(float *)&this->field_0x734 - fVar22) / fVar29 + fVar26); if ((iVar9 < 0) || (((*(int *)((int)pvVar18 + 0xc) <= iVar9 || (iVar12 < 0)) || (*(int *)((int)pvVar18 + 0x10) <= iVar12)))) { local_50 = 0xffffffff; } else { local_50 = iVar12 * *(int *)((int)pvVar18 + 0xc) + iVar9; } } } pvVar14 = pGVar17->_room; iVar9 = (int)((fVar31 - fVar29) / fVar29 + fVar26); iVar12 = (int)((fVar32 - fVar22) / fVar29 + fVar26); if (((iVar9 < 0) || (iVar11 = *(int *)((int)pvVar14 + 0xc), iVar11 <= iVar9)) || ((iVar12 < 0 || (*(int *)((int)pvVar14 + 0x10) <= iVar12)))) { iVar11 = *(int *)((int)pvVar14 + 0xc); iVar9 = -1; } else { iVar9 = iVar12 * iVar11 + iVar9; } local_70.x = (float)(iVar9 % iVar11) * fVar29 + fVar29; local_70.y = (float)(iVar9 / iVar11) * fVar29 + fVar22; if (iVar9 != *(int *)&this->field_0x20) { puVar1 = &local_28->field_0x24; *(int *)puVar1 = *(int *)puVar1 + ((int)*(float *)(*(int *)local_28 + 0x3a4) - (int)*(float *)(*(int *)local_28 + 0x3a0)) * -10; if (*(int *)puVar1 < 0) { local_54 = 0.2; *(int *)&local_28->field_0x20 = iVar9; pfVar24 = &speed; if (speed <= 0.2) { pfVar24 = &local_54; } *(int *)&local_28->field_0x24 = (int)(20.0 / *pfVar24); } } local_54 = 1.0; if (local_2d == '\0') { pEVar2 = *(Entity **)local_28; bVar7 = Entity::IsFrame(pEVar2,3,1); if (bVar7 != 0) { local_4c.y = (pEVar2->_velocity).x; local_3c = (float *)(pEVar2->_velocity).y; fVar27 = sqrtf(local_4c.y * local_4c.y + (float)local_3c * (float)local_3c); if (fVar27 <= 0.0) { pfVar24 = local_3c; } else { local_4c.y = (1.0 / fVar27) * (pEVar2->_velocity).x; pfVar24 = (float *)((1.0 / fVar27) * (pEVar2->_velocity).y); } local_4c.x = local_4c.y * 40.0 + local_8c; local_4c.y = (float)pfVar24 * 40.0 + local_74; Room::GetGridIndex(g_game->_room,&local_4c); iVar9 = FUN_007e7fb0(); if (iVar9 - 1U < 0x3b5) { local_54 = 0.7; } } if ((-1 < pathMarker) && (iVar9 = FUN_007e7fb0(), iVar9 != 0)) { FUN_004cdd30(); } } pEVar2 = *(Entity **)local_28; puVar33 = (uint *)0x7e3a98; bVar7 = Entity::IsFrame(pEVar2,10,pEVar2->_index); pPVar25 = local_28; if (bVar7 != 0) { pRVar3 = g_game->_room; iVar12 = (int)((local_38->x - 40.0) / 40.0 + 0.5); iVar9 = (int)((local_38->y - 120.0) / 40.0 + 0.5); if ((((iVar12 < 0) || (iVar11 = pRVar3->_gridWidth, iVar11 <= iVar12)) || (iVar9 < 0)) || (pRVar3->_gridHeight <= iVar9)) { iVar11 = pRVar3->_gridWidth; iVar12 = -1; } else { iVar12 = iVar9 * iVar11 + iVar12; } pvVar14 = (void *)0x0; local_4c.y = (float)(iVar12 / iVar11) * 40.0 + 120.0; local_4c.x = (float)(iVar12 % iVar11) * 40.0 + 40.0; if ((local_2f != '\0') || (local_2d != '\0')) { pvVar14 = (void *)0x384; } if (pEVar2->_entityGridCollisionClass == 3) { local_28->_hasDirectPath = 1; } else { puVar33 = (uint *)CONCAT31((int3)((uint)(iVar12 / iVar11) >> 8),local_28->field_0x738); in_stack_ffffff08 = 0; bVar7 = Room::CheckLine(pRVar3,&local_70,&local_4c,0,(int)pvVar14,local_28->field_0x738,0, (Vector *)0x0); pPVar25->_hasDirectPath = bVar7; in_stack_ffffff0c = pvVar14; } } pVVar6 = local_38; local_60 = g_vectorZero.x; local_70.y = g_vectorZero.y; if (isUseDirectPath == 0) { local_44 = (float *)0x428c0000; } else { local_44 = (float *)0x443b8000; } if ((local_2e != '\0') && (isUseDirectPath == 0)) { iVar9 = *(int *)pPVar25; local_3c = (float *)(*(float *)(iVar9 + 0x370) * *(float *)(iVar9 + 0x374)); local_4c.y = *(float *)(iVar9 + 0x370) * *(float *)(iVar9 + 0x378); pfVar24 = &local_4c.y; if (local_4c.y <= (float)local_3c) { pfVar24 = (float *)&local_3c; } local_44 = (float *)((float)local_44 + (float)*pfVar24); } if (((pPVar25->_hasDirectPath != 0) && (fVar27 = local_38->y - local_58, fVar29 = local_38->x - (float)local_5c, fVar27 = sqrtf(fVar27 * fVar27 + fVar29 * fVar29), fVar27 < (float)local_44)) || (uVar10 = *(uint *)&pPVar25->field_0x20, uVar10 == local_50)) { iVar9 = *(int *)pPVar25; local_60 = pVVar6->x - local_34; local_70.y = pVVar6->y - (float)local_40; *(int *)&pPVar25->field_0x28 = *(int *)&pPVar25->field_0x28 + ((int)*(float *)(iVar9 + 0x3a0) - (int)*(float *)(iVar9 + 0x3a4)) * 10; *(int *)&pPVar25->field_0x24 = *(int *)&pPVar25->field_0x24 + ((int)*(float *)(iVar9 + 0x3a0) - (int)*(float *)(iVar9 + 0x3a4)) * 0x32; goto LAB_007e4703; } if (((uVar10 < 0x1c0) && (*(int *)((int)pvVar18 + uVar10 * 4 + 0x76c) == 1000)) || (0 < *(int *)&pPVar25->field_0x28)) { *(int *)&pPVar25->field_0x28 = *(int *)&pPVar25->field_0x28 + ((int)*(float *)(*(int *)pPVar25 + 0x3a0) - (int)*(float *)(*(int *)pPVar25 + 0x3a4)); } else { uVar10 = Random(); *(uint *)&pPVar25->field_0x28 = uVar10 % 10 + 10; FUN_007e4860(); auStack_7 = (undefined1 [3])0x0; if (local_2e == '\0') { puVar21 = (undefined4 *)((int)pvVar18 + 0x76c); puVar23 = (undefined4 *)&pPVar25->field_0x2c; for (iVar9 = 0x1c0; iVar9 != 0; iVar9 = iVar9 + -1) { *puVar23 = *puVar21; puVar21 = puVar21 + 1; puVar23 = puVar23 + 1; } } else { local_20 = (void *)0x0; local_1c = (float *)0x0; local_18 = (float *)0x0; local_8 = 1; auStack_7 = (undefined1 [3])0x0; local_5c = (int *)(*(int *)pPVar25 + 0x178); std::vector<8byte>::reserve(); if (local_1c == local_18) { std::vector::_Emplace_reallocate(); local_40 = (float *)local_68.y; local_34 = local_68.x; } else { *local_1c = local_34; local_1c[1] = (float)local_40; local_1c = local_1c + 2; } piVar5 = local_5c; uVar10 = 0; iVar9 = *local_5c; if (local_5c[1] - iVar9 >> 3 != 0) { pfVar24 = local_18; local_44 = local_1c; do { local_68.x = local_34 + *(float *)(iVar9 + uVar10 * 8); local_68.y = (float)local_40 + *(float *)(iVar9 + 4 + uVar10 * 8); if (local_1c == pfVar24) { std::vector::_Emplace_reallocate(); pfVar24 = local_18; } else { *local_1c = local_68.x; local_1c[1] = local_68.y; local_1c = local_1c + 2; } uVar10 = uVar10 + 1; iVar9 = *piVar5; } while (uVar10 < (uint)(piVar5[1] - iVar9 >> 3)); pvVar18 = local_2c; pPVar25 = local_28; } puVar33 = (uint *)&pPVar25->field_0x2c; in_stack_ffffff0c = (void *)0x7e3e02; local_44 = local_1c; local_40 = (float *)puVar33; memset(puVar33,0,0x700); iVar12 = *(int *)((int)pvVar18 + 0xc); iVar9 = *(int *)((int)pvVar18 + 0x10); local_4c.y = 0.0; if (0 < iVar12 * iVar9) { fVar27 = 40.0; fVar29 = 120.0; pfVar24 = (float *)((uint)((int)local_44 - (int)local_20 >> 3) >> 1); local_44 = pfVar24; do { local_3c = (float *)0x0; auVar28 = ZEXT416((uint)((float)((int)local_4c.y % iVar12) * fVar27 + fVar27)); auVar30 = ZEXT416((uint)((float)((int)local_4c.y / iVar12) * fVar27 + fVar29)); if (pfVar24 != (float *)0x0) { fVar26 = 0.5; do { iVar9 = (int)(((auVar28._0_4_ + *(float *)((int)local_20 + (int)local_3c * 8)) - fVar27) / fVar27 + fVar26); iVar12 = (int)(((auVar30._0_4_ + *(float *)((int)local_20 + (int)local_3c * 8 + 4)) - fVar29) / fVar27 + fVar26); if (((iVar9 < 0) || (iVar11 = *(int *)((int)local_2c + 0xc), iVar11 <= iVar9)) || ((iVar12 < 0 || (iVar19 = *(int *)((int)local_2c + 0x10), iVar19 <= iVar12)))) { iVar11 = *(int *)((int)local_2c + 0xc); iVar19 = *(int *)((int)local_2c + 0x10); LAB_007e3eea: fVar22 = 0.0; } else { uVar10 = iVar12 * iVar11 + iVar9; if (0x1bf < uVar10) goto LAB_007e3eea; fVar22 = *(float *)((int)local_2c + uVar10 * 4 + 0x76c); } fVar31 = fVar22; local_34 = fVar22; if (((((local_28->field_0x738 != '\0') && (-1 < iVar9)) && (iVar9 < iVar11)) && ((-1 < iVar12 && (iVar12 < iVar19)))) && ((uVar10 = iVar11 * iVar12 + iVar9, uVar10 < 0x1c0 && (pGVar13 = *(GridEntity **)((int)local_2c + uVar10 * 4 + 0x24), pGVar13 != (GridEntity *)0x0)))) { bVar7 = GridEntity::IsEasyCrushableOrWalkable(pGVar13); if (bVar7 != 0) { fVar31 = 1.4013e-45; } bVar7 = GridEntity::IsDangerousCrushableOrWalkable(this_01); if (bVar7 != 0) { fVar31 = 1.12104e-42; } if ((int)fVar22 < (int)fVar31) { fVar31 = fVar22; } } if ((local_3c == (float *)0x0) || (((int)*local_40 < (int)fVar22 && (900 < (int)fVar22)))) { *local_40 = fVar31; } local_3c = (float *)((int)local_3c + 1); } while (local_3c < local_44); iVar9 = *(int *)((int)local_2c + 0x10); iVar12 = *(int *)((int)local_2c + 0xc); pvVar18 = local_2c; pfVar24 = local_44; } local_40 = local_40 + 1; local_4c.y = (float)((int)local_4c.y + 1); } while ((int)local_4c.y < iVar9 * iVar12); pPVar25 = local_28; } iVar9 = *(int *)(&pPVar25->field_0x2c + local_50 * 4); if ((900 < iVar9) && ((0x1bf < local_50 || (*(int *)((int)pvVar18 + local_50 * 4 + 0x76c) < 0x385)))) { pRVar3 = g_game->_room; iVar11 = Room::GetGridIndex(pRVar3,local_38); iVar12 = pRVar3->_gridWidth; pfVar24 = (float *)*local_5c; local_2c = (void *)((uint)(local_5c[1] - (int)pfVar24 >> 3) >> 1); if (local_2c != (void *)0x0) { do { iVar19 = (int)(((((float)(iVar11 % iVar12) * 40.0 + 40.0) - *pfVar24) - 40.0) / 40.0 + 0.5); iVar15 = (int)(((((float)(iVar11 / iVar12) * 40.0 + 120.0) - pfVar24[1]) - 120.0) / 40.0 + 0.5); if ((((iVar19 < 0) || (*(int *)((int)pvVar18 + 0xc) <= iVar19)) || (iVar15 < 0)) || (*(int *)((int)pvVar18 + 0x10) <= iVar15)) { uVar10 = 0xffffffff; } else { uVar10 = iVar15 * *(int *)((int)pvVar18 + 0xc) + iVar19; } iVar19 = *(int *)(&local_28->field_0x2c + uVar10 * 4); if (iVar9 <= *(int *)(&local_28->field_0x2c + uVar10 * 4)) { iVar19 = iVar9; uVar10 = local_50; } local_50 = uVar10; pfVar24 = pfVar24 + 2; local_2c = (void *)((int)local_2c + -1); iVar9 = iVar19; } while (local_2c != (void *)0x0); local_2c = (void *)0x0; } } local_8 = 0; if (local_20 != (void *)0x0) { uVar10 = ((int)local_18 - (int)local_20 >> 3) * 8; pvVar18 = local_20; if (0xfff < uVar10) { pvVar18 = *(void **)((int)local_20 + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar18))) goto LAB_007e4595; } puVar33 = (uint *)0x7e40e7; operator_delete(pvVar18,uVar10); } } local_80 = (uint *)0x0; local_7c = 0; local_78 = (uint *)0x0; local_88 = local_50; local_84 = (void *)0x0; local_8 = 2; FUN_007e85a0(); local_8 = 0; if (local_80 != (uint *)0x0) { uVar10 = ((int)local_78 - (int)local_80 >> 2) * 4; puVar16 = local_80; if (0xfff < uVar10) { puVar16 = (uint *)local_80[-1]; uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_80 + (-4 - (int)puVar16))) { LAB_007e4595: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } puVar33 = (uint *)0x7e4164; operator_delete(puVar16,uVar10); } local_28->field_0x72d = 0; puVar16 = local_bc; if (local_c0 != local_bc) { while (puVar35 = local_c0, local_28->field_0x72d == '\0') { local_a0 = (int *)*local_c0; local_3c = (float *)local_c0[2]; local_9c = (void *)local_c0[1]; local_98 = (uint *)0x0; local_94 = (uint *)0x0; local_90 = (uint *)0x0; local_4c.y = 0.0; local_5c = local_a0; local_2c = local_9c; if (local_3c != (float *)local_c0[3]) { local_58 = (float)((int)local_c0[3] - (int)local_3c); uVar10 = (int)local_58 >> 2; if (0x3fffffff < uVar10) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } puVar33 = std::_Allocate(uVar10 * 4); puVar34 = puVar33 + uVar10; in_stack_ffffff0c = (void *)0x7e4215; local_98 = puVar33; local_90 = puVar34; memmove(puVar33,local_3c,(size_t)local_58); local_4c.y = (float)local_98; local_94 = puVar34; } local_8 = 3; local_98 = (uint *)local_4c.y; if ((*(int *)((int)g_game->_room + 0x10) * *(int *)((int)g_game->_room + 0xc)) / 2 <= (int)local_2c) { if ((uint *)local_4c.y != (uint *)0x0) { uVar8 = (int)local_94 - (int)local_4c.y & 0xfffffffc; puVar33 = (uint *)local_4c.y; if (0xfff < uVar8) { puVar33 = *(uint **)((int)local_4c.y + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)local_4c.y + (-4 - (int)puVar33))) goto LAB_007e4595; } operator_delete(puVar33,uVar8); } break; } puVar34 = (uint *)0x7e425d; PathNode::PathNode(auStack_ce + -6,local_b4); if (1 < ((int)puVar16 - (int)puVar35) / 0x14) { local_88 = puVar16[-5]; puVar33 = puVar16 + -5; local_78 = (uint *)puVar16[-1]; local_7c = puVar16[-2]; local_84 = (void *)puVar16[-4]; local_80 = (uint *)puVar16[-3]; puVar16[-1] = 0; puVar16[-2] = 0; puVar16[-3] = 0; local_8 = 5; puVar34 = &local_88; in_stack_ffffff0c = (void *)0x7e42ca; std::_Pop_heap_unchecked(); FID_conflict__Tidy(&local_80); } FID_conflict__Tidy(local_cc); puVar16 = local_bc + -5; puVar35 = (uint *)0x7e42f1; FID_conflict__Tidy(local_bc + -3); local_38 = g_game->_room; fVar27 = local_38[1].y; iVar12 = (int)local_5c % (int)fVar27; iVar9 = (int)local_5c / (int)fVar27; local_58 = (float)(iVar12 + -1); if ((((int)local_58 < 0) || ((int)fVar27 <= (int)local_58)) || ((iVar9 < 0 || ((int)local_38[2].x <= iVar9)))) { local_24 = -1; if (-1 < iVar12) goto LAB_007e4351; LAB_007e4365: local_20 = (void *)0xffffffff; } else { local_24 = iVar9 * (int)fVar27 + (int)local_58; LAB_007e4351: iVar11 = iVar9 + -1; if ((((int)fVar27 <= iVar12) || (iVar11 < 0)) || ((int)local_38[2].x <= iVar11)) goto LAB_007e4365; local_20 = (void *)(iVar11 * (int)fVar27 + iVar12); } iVar11 = iVar12 + 1; if ((((iVar11 < 0) || ((int)fVar27 <= iVar11)) || (iVar9 < 0)) || ((int)local_38[2].x <= iVar9)) { local_1c = (float *)0xffffffff; } else { local_1c = (float *)(iVar9 * (int)fVar27 + iVar11); } iVar9 = iVar9 + 1; if (((iVar12 < 0) || ((int)fVar27 <= iVar12)) || ((iVar9 < 0 || ((int)local_38[2].x <= iVar9)))) { local_18 = (float *)0xffffffff; } else { local_18 = (float *)(iVar9 * (int)fVar27 + iVar12); } local_3c = (float *)0x0; local_bc = puVar16; do { local_88 = *(uint *)(auStack_7 + (int)local_3c * 4 + -0x1d); puVar20 = (uint *)0x0; local_80 = (uint *)0x0; local_7c = 0; local_4c.y = 0.0; local_78 = (uint *)0x0; local_84 = local_2c; local_8 = 6; if (-1 < (int)local_88) { iVar9 = *(int *)(&local_28->field_0x2c + local_88 * 4); if ((-1 < iVar9) && (iVar9 < 0x3b6)) { if ((iVar9 < 1) || (local_2f != '\0')) { local_84 = (void *)((int)local_2c + 1); } else { local_84 = (void *)((int)local_2c + 7); } *(int *)(&local_28->field_0x2c + local_88 * 4) = -(int)local_84; if (local_88 == *(uint *)&local_28->field_0x20) { local_28->field_0x72d = 1; } if (puVar16 == local_b8) { puVar35 = &local_88; puVar33 = (uint *)0x7e4476; vector_PathNode_emplace_reallocate(&local_c0,puVar16,puVar35); local_4c.y = (float)local_78; puVar34 = puVar16; } else { *puVar16 = local_88; puVar16[1] = (uint)local_84; puVar16[2] = 0; puVar16[3] = 0; puVar16[4] = 0; local_bc = puVar16 + 5; } puVar20 = local_80; width = local_bc; puVar16 = local_c0; local_78 = (uint *)local_4c.y; PathNode::PathNode(auStackY_180 + 0x88,local_b4); color._green = (float)unaff_EDI; color._red = (float)uVar8; color._blue = (float)unaff_ESI; color._alpha = (float)unaff_EBX; color._unk = in_stack_ffffff2c; KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (puVar16,(uint)width,in_stack_ffffff08,in_stack_ffffff0c,(byte *)puVar33, (uint)puVar34,(uint)puVar35,color); puVar16 = local_bc; } } pfVar24 = local_3c; local_8 = 3; if (puVar20 != (uint *)0x0) { puVar35 = (uint *)(((int)local_4c.y - (int)puVar20 >> 2) * 4); puVar34 = puVar20; if ((uint *)0xfff < puVar35) { puVar34 = (uint *)puVar20[-1]; puVar35 = (uint *)((int)puVar35 + 0x23); if (0x1f < (uint)((int)puVar20 + (-4 - (int)puVar34))) goto LAB_007e4595; } puVar33 = (uint *)0x7e44eb; operator_delete(puVar34,(uint)puVar35); } local_3c = (float *)((int)pfVar24 + 1); } while ((float *)((int)pfVar24 + 1) < &DAT_00000004); local_8 = 0; if (local_98 != (uint *)0x0) { uVar10 = (int)local_90 - (int)local_98 & 0xfffffffc; puVar35 = local_98; if (0xfff < uVar10) { puVar35 = (uint *)local_98[-1]; uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_98 + (-4 - (int)puVar35))) goto LAB_007e4595; } puVar33 = (uint *)0x7e4535; operator_delete(puVar35,uVar10); } if (local_c0 == puVar16) break; } } FID_conflict__Tidy(local_ac); FUN_007e8620(); pPVar25 = local_28; } if (pPVar25->field_0x72d == '\0') goto LAB_007e4703; pvVar18 = g_game->_room; iVar12 = *(int *)((int)pvVar18 + 0xc); pfVar24 = *(float **)&local_28->field_0x20; local_3c = pfVar24; iVar11 = (int)pfVar24 / iVar12; iVar19 = (int)pfVar24 % iVar12; iVar9 = iVar19 + -1; if ((((iVar9 < 0) || (iVar12 <= iVar9)) || (iVar11 < 0)) || (*(int *)((int)pvVar18 + 0x10) <= iVar11)) { local_24 = -1; if (-1 < iVar19) goto LAB_007e460d; LAB_007e4621: local_20 = (void *)0xffffffff; } else { local_24 = iVar11 * iVar12 + iVar9; LAB_007e460d: iVar9 = iVar11 + -1; if (((iVar12 <= iVar19) || (iVar9 < 0)) || (*(int *)((int)pvVar18 + 0x10) <= iVar9)) goto LAB_007e4621; local_20 = (void *)(iVar9 * iVar12 + iVar19); } local_58 = (float)(iVar19 + 1); if ((((int)local_58 < 0) || (iVar12 <= (int)local_58)) || ((iVar11 < 0 || (*(int *)((int)pvVar18 + 0x10) <= iVar11)))) { local_1c = (float *)0xffffffff; } else { local_1c = (float *)(iVar11 * iVar12 + (int)local_58); } iVar11 = iVar11 + 1; if ((((iVar19 < 0) || (iVar12 <= iVar19)) || (iVar11 < 0)) || (*(int *)((int)pvVar18 + 0x10) <= iVar11)) { local_18 = (float *)0xffffffff; } else { local_18 = (float *)(iVar11 * iVar12 + iVar19); } uVar8 = 0; local_4c.y = -NAN; do { if (((*(int *)((int)pvVar18 + 8) != 0x10) || (uVar8 != 1)) || (((void *)0x1bf < local_20 || ((iVar9 = *(int *)((int)pvVar18 + (int)local_20 * 4 + 0x24), iVar9 == 0 || (*(int *)(iVar9 + 4) != 0x13)))))) { pfVar4 = *(float **)(auStack_7 + uVar8 * 4 + -0x1d); if (-1 < (int)pfVar4) { puVar33 = *(uint **)(&local_28->field_0x2c + (int)pfVar4 * 4); if (((int)puVar33 < 0) && ((int)local_4c.y < (int)puVar33)) { local_4c.y = (float)puVar33; pfVar24 = pfVar4; } } } uVar8 = uVar8 + 1; } while (uVar8 < 4); local_60 = (float)((int)pfVar24 % iVar12) * 40.0 + 40.0; local_70.y = (float)((int)pfVar24 / iVar12) * 40.0 + 120.0; pPVar25 = local_28; LAB_007e4703: if ((local_60 == g_vectorZero.x) && (local_70.y == g_vectorZero.y)) { *(float *)(*(int *)pPVar25 + 0x36c) = *(float *)(*(int *)pPVar25 + 0x36c) * 0.85; } else { local_70.y = local_70.y - local_74; local_60 = local_60 - local_8c; iVar9 = *(int *)pPVar25; fVar27 = sqrtf(local_70.y * local_70.y + local_60 * local_60); if (fVar27 <= 1.0) { *(float *)(iVar9 + 0x36c) = *(float *)(iVar9 + 0x36c) * 0.5; } else { fVar29 = fVar27 * 0.1; if (2.0 <= fVar29) { fVar29 = 2.0; } fVar29 = fVar29 * local_54 * speed; *(float *)(iVar9 + 0x36c) = *(float *)(iVar9 + 0x36c) * 0.7; iVar9 = *(int *)pPVar25; fVar26 = *(float *)(iVar9 + 0x36c); if (fVar26 != 0.0) { *(float *)(iVar9 + 0x360) = ((local_60 / fVar27) * fVar29 * *(float *)(iVar9 + 0x39c)) / fVar26 + *(float *)(iVar9 + 0x360); *(float *)(iVar9 + 0x364) = ((local_70.y / fVar27) * fVar29 * *(float *)(iVar9 + 0x39c)) / fVar26 + *(float *)(iVar9 + 0x364); } } } ExceptionList = local_10; return; } //@@ 007e4860 FUN_007e4860 void FUN_007e4860(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; return; } //@@ 007e4890 FUN_007e4890 void FUN_007e4890(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 0x14)); FUN_007e8620(); return; } //@@ 007e48b0 PathNode::PathNode /* DB: copy constructor of the 0x14-byte pathfinder node: copies two dwords and the std::vector at +8 (memmove); PathFinder::FindGridPath, std::priority_queue::pop, vector_PathNode_emplace_reallocate prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall PathNode::PathNode(void *this,void *other) { void *_Src; size_t _Size; uint uVar1; void *pvVar2; *(undefined4 *)this = *(undefined4 *)other; *(undefined4 *)((int)this + 4) = *(undefined4 *)((int)other + 4); *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; _Src = *(void **)((int)other + 8); if (_Src != *(void **)((int)other + 0xc)) { _Size = (int)*(void **)((int)other + 0xc) - (int)_Src; uVar1 = (int)_Size >> 2; if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar1 = uVar1 * 4; pvVar2 = std::_Allocate(uVar1); *(void **)((int)this + 8) = pvVar2; *(void **)((int)this + 0xc) = pvVar2; *(void **)((int)this + 0x10) = (void *)((int)pvVar2 + uVar1); pvVar2 = *(void **)((int)this + 8); memmove(pvVar2,_Src,_Size); *(void **)((int)this + 0xc) = (void *)(uVar1 + (int)pvVar2); } return this; } //@@ 007e4940 PathFinder::EvadeTarget /* ZHL [lua] Lua binding PathFinder:EvadeTarget prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall PathFinder::EvadeTarget(PathFinder *this,Vector *targetPos,byte isIgnoreStatusEffects) { Game *pGVar1; undefined1 *puVar2; byte bVar3; uint uVar4; Entity_NPC *this_00; Entity *pEVar5; Vector *pVVar6; int iVar7; int iVar8; undefined8 *puVar9; int *newNode; int iVar10; float fVar11; float *this_01; float fVar12; float fVar13; Room *pRVar14; float fVar15; undefined1 local_90 [12]; undefined1 local_84 [8]; Room *local_7c; undefined8 local_78; Vector local_6c; Vector local_64; float *local_5c; undefined4 local_58; Vector local_54; float local_4c; float local_48; float local_44; float local_40; Vector local_3c; PathFinder *local_34; float local_30; float local_2c; Room *local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_84 + 0x80; local_14 = 0xffffffff; puStack_18 = &LAB_00b00a1d; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_84 + 0x74); ExceptionList = &local_1c; local_34 = this; puVar2 = local_84 + 0x80; if (isIgnoreStatusEffects == 0) { bVar3 = is_entity_friendly(this); puVar2 = puStack_20; if (bVar3 != 0) { this_00 = (Entity_NPC *) __RTDynamicCast(*(undefined4 *)this,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4); pEVar5 = Entity_NPC::GetPlayerTarget(this_00); local_54.x = (pEVar5->_pos).x; local_54.y = (pEVar5->_pos).y; FindGridPath(this,&local_54,1.079,0,1); ExceptionList = local_1c; return; } } puStack_20 = puVar2; iVar8 = *(int *)this; local_3c.y = (float)(iVar8 + 0x33c); local_40 = targetPos->x - *(float *)local_3c.y; local_44 = targetPos->y - *(float *)(iVar8 + 0x340); local_30 = sqrtf(local_40 * local_40 + local_44 * local_44); local_3c.x = 20.0; pVVar6 = &local_3c; if (this[1]._movementTarget.x <= 20.0) { pVVar6 = &this[1]._movementTarget; } this[1]._movementTarget.x = pVVar6->x; local_3c.x = *(float *)(iVar8 + 0x20); if ((((*(uint *)(iVar8 + 0x168) & 0x4000) == 0) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)) && (iVar7 = g_game->_frameCount + (int)local_3c.x, local_3c.x = 1.96182e-44, iVar7 % 0xe == 0)) { local_54.x = *(float *)local_3c.y; local_54.y = *(float *)((int)local_3c.y + 4); bVar3 = Room::CheckLine(g_game->_room,&local_54,targetPos,1,0,0,0,(Vector *)0x0); if (bVar3 == 0) { fVar12 = 170.0; } else { fVar12 = 250.0; } if (fVar12 <= local_30) { iVar8 = *(int *)this; this->_evadeMovementCountdown = this->_evadeMovementCountdown - ((int)*(float *)(iVar8 + 0x3a4) - (int)*(float *)(iVar8 + 0x3a0)); } else { if (this->_evadeMovementCountdown < 1) { (this->_movementTarget).x = g_vectorZero.x; (this->_movementTarget).y = g_vectorZero.y; } iVar8 = *(int *)this; this->_evadeMovementCountdown = 3; } } pGVar1 = g_game; local_3c.x = *(float *)(iVar8 + 0x20); if ((((*(uint *)(iVar8 + 0x168) & 0x4000) == 0) && (bVar3 = Game::IsPaused(g_game), bVar3 == 0)) && ((pGVar1->_frameCount + (int)local_3c.x) % 0x1e == 0)) { fVar12 = this[1]._movementTarget.y; this_01 = &this[1]._movementTarget.y; FID_conflict__Erase_tree_>_> (this_01,(fuzzer_allocator_> *)this_01, *(_Tree_node **)((int)fVar12 + 4)); *(float *)((int)fVar12 + 4) = fVar12; *(float *)fVar12 = fVar12; *(float *)((int)fVar12 + 8) = fVar12; *(undefined4 *)&this[1].field_0xc = 0; this = local_34; } if (this->_evadeMovementCountdown < 1) { fVar12 = this[1]._movementTarget.x; *(undefined4 *)(this + 1) = 0; this[1]._movementTarget.x = fVar12 * 0.9; MoveRandomly(this,1); *(float *)(*(int *)this + 0x36c) = *(float *)(*(int *)this + 0x36c) * 0.9; ExceptionList = local_1c; return; } local_3c.x = (float)&this->_movementTarget; if ((((this->_movementTarget).x == g_vectorZero.x) && ((this->_movementTarget).y == g_vectorZero.y)) || (20.0 < this[1]._movementTarget.x)) { local_2c = g_vectorZero.x; local_28 = (Room *)g_vectorZero.y; local_24 = 0.0; if (0.0 < local_30) { local_2c = local_40 / -local_30; local_28 = (Room *)(local_44 / -local_30); } fVar12 = local_2c; pRVar14 = local_28; if (ABS(ABS(local_2c) - ABS((float)local_28)) < 0.25) { uVar4 = Random(); if ((uVar4 & 1) == 0) { fVar12 = local_2c * 0.5; pRVar14 = local_28; } else { pRVar14 = (Room *)((float)local_28 * 0.5); fVar12 = local_2c; } } iVar8 = *(int *)this; fVar13 = *(float *)(iVar8 + 0x36c); if (fVar13 != 0.0) { *(float *)(iVar8 + 0x360) = (fVar12 * 1.5 * *(float *)(iVar8 + 0x39c)) / fVar13 + *(float *)(iVar8 + 0x360); *(float *)(iVar8 + 0x364) = ((float)pRVar14 * 1.5 * *(float *)(iVar8 + 0x39c)) / fVar13 + *(float *)(iVar8 + 0x364); iVar8 = *(int *)this; } local_48 = *(float *)(iVar8 + 0x33c) + fVar12 * 30.0; local_4c = *(float *)(iVar8 + 0x340) + (float)pRVar14 * 30.0; if (0.0 < 7.0 - this[1]._movementTarget.x * 0.3) { do { uVar4 = Random(); local_34 = (PathFinder *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 450.0 + 30.0); uVar4 = Random(); local_44 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_44 = local_44 + local_44; local_40 = sin(local_44); fVar12 = cos(local_44); fVar13 = 0.5; local_54.x = fVar12 * (float)local_34 + local_48; fVar12 = 40.0; fVar15 = 120.0; local_54.y = local_40 * 0.5 * (float)local_34 + local_4c; iVar7 = (int)((local_54.x - 40.0) / 40.0 + 0.5); iVar8 = (int)((local_54.y - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (iVar10 = *(int *)((int)g_game->_room + 0xc), iVar10 <= iVar7)) || (iVar8 < 0)) || (*(int *)((int)g_game->_room + 0x10) <= iVar8)) { fVar11 = -NAN; } else { fVar11 = (float)(iVar10 * iVar8 + iVar7); } local_2c = fVar11; std::set::find_node(local_84,&local_2c); if ((*(char *)((int)&local_7c->_gridWidth + 1) == '\0') && (local_7c->_gridHeight <= (int)fVar11)) { local_28 = (Room *)this[1]._movementTarget.y; if (local_7c == local_28) goto LAB_007e4e8c; local_24 = local_24 - 0.7; } else { local_28 = (Room *)this[1]._movementTarget.y; LAB_007e4e8c: puVar9 = (undefined8 *)std::set::find_node(local_90,&local_2c); local_78 = *puVar9; if ((*(char *)(*(int *)(puVar9 + 1) + 0xd) != '\0') || ((int)fVar11 < *(int *)(*(int *)(puVar9 + 1) + 0x10))) { if (*(int *)&this[1].field_0xc == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } local_14 = 0; local_58 = 0; local_5c = &this[1]._movementTarget.y; newNode = operator_new(0x14); local_14 = 0xffffffff; local_58 = 0; newNode[4] = (int)fVar11; *newNode = (int)local_28; newNode[1] = (int)local_28; newNode[2] = (int)local_28; *(undefined2 *)(newNode + 3) = 0; std::_Tree::_Insert_node (&this[1]._movementTarget.y,(void *)local_78,local_78._4_4_,newNode); fVar12 = 40.0; fVar13 = 0.5; fVar15 = 120.0; } pRVar14 = g_game->_room; iVar8 = pRVar14->_gridWidth; local_54.x = (float)((int)fVar11 % iVar8) * fVar12 + fVar12; local_54.y = (float)((int)fVar11 / iVar8) * fVar12 + fVar15; iVar10 = (int)((local_54.x - fVar12) / fVar12 + fVar13); iVar7 = (int)((local_54.y - fVar15) / fVar12 + fVar13); if ((((iVar10 < 0) || (iVar8 <= iVar10)) || (iVar7 < 0)) || (pRVar14->_gridHeight <= iVar7)) { iVar10 = -1; } else { iVar10 = iVar8 * iVar7 + iVar10; } local_3c.y = local_54.y; local_2c = local_54.x; local_28 = pRVar14; uVar4 = Room::GetGridCollision(pRVar14,iVar10); if (uVar4 == 0) { local_64.x = *(float *)(*(int *)this + 0x33c); local_64.y = *(float *)(*(int *)this + 0x340); bVar3 = Room::CheckLine(pRVar14,&local_64,&local_54,1,0,this->field_0x738,0, (Vector *)0x0); if (bVar3 != 0) { local_6c.x = *(float *)(*(int *)this + 0x33c); local_6c.y = *(float *)(*(int *)this + 0x340); bVar3 = Room::CheckLine(g_game->_room,targetPos,&local_6c,1,0,this->field_0x738,0, (Vector *)0x0); if ((bVar3 == 0) || (fVar12 = this[1]._movementTarget.x, 20.0 <= fVar12)) { local_44 = *(float *)(this + 1); fVar12 = targetPos->y - local_3c.y; fVar13 = targetPos->x - local_2c; fVar12 = sqrtf(fVar12 * fVar12 + fVar13 * fVar13); if (((float)local_34 / 3.0 + local_30 + 100.0 + this[1]._movementTarget.x) - local_44 <= fVar12) { (this->_movementTarget).x = local_2c; (this->_movementTarget).y = local_3c.y; fVar12 = this[1]._movementTarget.x; if (fVar12 < 20.0) { this[1]._movementTarget.x = fVar12 * 0.5; } break; } *(float *)(this + 1) = local_44 + 10.0; } else { this[1]._movementTarget.x = fVar12 + 0.35; } } } } local_24 = local_24 + 1.0; } while (local_24 < 7.0 - this[1]._movementTarget.x * 0.3); } } pGVar1 = g_game; local_48 = (this->_movementTarget).x; if ((local_48 == g_vectorZero.x) && ((this->_movementTarget).y == g_vectorZero.y)) { ExceptionList = local_1c; return; } local_4c = *(float *)(*(int *)this + 0x20); pVVar6 = &this->_movementTarget; fVar12 = local_48; if ((*(uint *)(*(int *)this + 0x168) & 0x4000) == 0) { bVar3 = Game::IsPaused(g_game); if (bVar3 == 0) { iVar8 = pGVar1->_frameCount + (int)local_4c; local_4c = 1.4013e-44; pVVar6 = (Vector *)local_3c.x; fVar12 = *(float *)local_3c.x; if (iVar8 % 10 == 0) { bVar3 = Room::CheckLine(pGVar1->_room,targetPos,(Vector *)local_3c.x,1,0,this->field_0x738,0 ,(Vector *)0x0); if ((bVar3 == 0) || (20.0 < this[1]._movementTarget.x || this[1]._movementTarget.x == 20.0)) { fVar13 = targetPos->x - *(float *)local_3c.x; fVar12 = targetPos->y - *(float *)((int)local_3c.x + 4); pVVar6 = (Vector *)local_3c.x; if ((40000.0 <= fVar12 * fVar12 + fVar13 * fVar13) && ((20.0 <= ABS(fVar13) && (fVar12 = *(float *)local_3c.x, 20.0 <= ABS(targetPos->y - (this->_movementTarget).y)) ))) goto LAB_007e529c; } else { pVVar6 = &this->_movementTarget; } pVVar6->x = g_vectorZero.x; pVVar6->y = g_vectorZero.y; fVar12 = pVVar6->x; } } else { pVVar6 = &this->_movementTarget; fVar12 = local_48; } } LAB_007e529c: if ((fVar12 != g_vectorZero.x) || (pVVar6->y != g_vectorZero.y)) { FindGridPath(this,pVVar6,1.079,0,1); } ExceptionList = local_1c; return; } //@@ 007e5340 PathFinder::MoveRandomlyAxisAligned /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding PathFinder:MoveRandomlyAxisAligned prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall PathFinder::MoveRandomlyAxisAligned(PathFinder *this,float speed,byte isIgnoreStatusEffects) { float *pfVar1; void *pvVar2; Room *this_00; int *piVar3; Game *pGVar4; uint uVar5; byte bVar6; Entity_NPC *this_01; Entity *pEVar7; Vector *pVVar8; uint uVar9; uint uVar10; undefined4 *puVar11; float *pfVar12; undefined4 uVar13; uint uVar14; int iVar15; uint uVar16; undefined1 *puVar17; int iVar18; PathFinder *pPVar19; float fVar20; float fVar21; undefined1 *puVar22; undefined1 auStack_a8 [4]; PathFinder *local_a4; undefined1 *local_a0; undefined1 *local_9c; Vector *local_98; float local_94; uint local_90; Entity_NPC *local_8c; float local_88; float local_84; undefined1 **local_80; Vector local_7c; Vector local_74; int local_6c; float local_68; float local_64; Vector VStack_60; Vector VStack_58; uint local_50 [7]; undefined1 *local_34; float afStack_30 [2]; undefined1 *puStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; uint local_14; local_14 = __security_cookie ^ (uint)auStack_a8; iVar18 = *(int *)this; if (*(int *)(iVar18 + 0x3d4) == 0) { local_a4 = this; if ((isIgnoreStatusEffects == 0) && (bVar6 = is_entity_friendly(this), bVar6 != 0)) { this_01 = (Entity_NPC *) __RTDynamicCast(iVar18,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); Entity_NPC::CalcTargetPosition(this_01,&local_7c,0.0); pPVar19 = local_a4; if (((*(uint *)(*(int *)local_a4 + 0x168) & 0x20000000) != 0) && ((pEVar7 = Entity_NPC::GetPlayerTarget(this_01), pEVar7->_type == 1 && (local_7c.x = (this_01->_pos).x - local_7c.x, local_7c.y = (this_01->_pos).y - local_7c.y, local_7c.y * local_7c.y + local_7c.x * local_7c.x < 1600.0)))) { iVar18 = *(int *)pPVar19; *(float *)(iVar18 + 0x36c) = *(float *)(iVar18 + 0x36c) * 0.8; return; } pVVar8 = Entity_NPC::CalcTargetPosition(this_01,&local_7c,0.0); FindGridPath(pPVar19,pVVar8,speed,0,1); local_7c.y = (this_01->_velocity).y; local_7c.x = (this_01->_velocity).x; pVVar8 = Vector::ToCardinal(&local_74,&local_7c); fVar21 = (this_01->_velocity).y; fVar20 = (this_01->_velocity).x; fVar20 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21); fVar21 = pVVar8->x; (this_01->_velocity).y = fVar20 * pVVar8->y; (this_01->_velocity).x = fVar20 * fVar21; return; } pGVar4 = g_game; local_34 = &DAT_bf800000; afStack_30[0] = 0.0; afStack_30[1] = 0.0; puStack_28 = &DAT_bf800000; iVar18 = g_game->_frameCount; iVar15 = *(int *)&local_a4->field_0x1c; *(int *)&local_a4->field_0x1c = iVar18; pvVar2 = pGVar4->_room; local_24 = 0x3f800000; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0x3f800000; local_74.x = (float)(iVar18 - iVar15); local_68 = *(float *)((int)pvVar2 + 0x14); local_7c.x = *(float *)((int)pvVar2 + 0x14); local_88 = *(float *)((int)pvVar2 + 0x18); local_64 = *(float *)((int)pvVar2 + 0x1c); local_84 = *(float *)((int)pvVar2 + 0x20); local_7c.y = local_88; iVar18 = 10; LAB_007e5558: do { fVar21 = (local_a4->_movementTarget).x; if (((fVar21 != g_vectorZero.x) || ((local_a4->_movementTarget).y != g_vectorZero.y)) || (iVar18 < 1)) goto LAB_007e5f59; local_8c = (Entity_NPC *)local_50; local_a0 = (undefined1 *)0x1; local_6c = iVar18 + -1; local_80 = &local_34; local_50[0] = 0; local_50[1] = 0; local_50[2] = 0; local_50[3] = 0; local_9c = (undefined1 *)0x4; pPVar19 = local_a4; do { uVar9 = Random(); uVar9 = uVar9 % 0xc; uVar14 = *(uint *)pPVar19; if ((*(uint *)(uVar14 + 0x168) & 0x1000800) != 0) { uVar9 = Random(); uVar14 = *(uint *)pPVar19; uVar9 = (uVar9 & 3) + 1; } local_98 = *(Vector **)(uVar14 + 0x340); puVar17 = *local_80; fVar20 = (float)(uVar9 * 0x28) * (float)puVar17 + *(float *)(uVar14 + 0x33c); fVar21 = (float)(uVar9 * 0x28) * (float)local_80[1] + *(float *)(uVar14 + 0x340); if (((local_64 < fVar20) || (fVar20 < local_68)) || (local_84 < fVar21)) { LAB_007e5667: fVar21 = g_vectorZero.y; fVar20 = g_vectorZero.x; } else if (fVar21 < local_88) goto LAB_007e5667; if ((fVar20 != g_vectorZero.x) || (fVar21 != g_vectorZero.y)) { iVar18 = 1; if (1 < uVar9) { local_94 = 5.60519e-44; pvVar2 = g_game->_room; do { fVar21 = (((float)puVar17 * (float)(int)local_94 + *(float *)(uVar14 + 0x33c)) - 40.0) / 40.0 + 0.5; iVar15 = (int)fVar21; if ((((iVar15 < 0) || (*(int *)((int)pvVar2 + 0xc) <= iVar15)) || (iVar15 = (int)((((float)local_80[1] * (float)(int)local_94 + (float)local_98) - 120.0) / 40.0 + 0.5), iVar15 < 0)) || ((*(int *)((int)pvVar2 + 0x10) <= iVar15 || (uVar14 = *(int *)((int)pvVar2 + 0xc) * iVar15 + (int)fVar21, 0x1bf < uVar14)))) { uVar10 = 0; } else { uVar10 = *(uint *)((int)pvVar2 + uVar14 * 4 + 0x76c); } uVar14 = *(uint *)local_a4; if (*(int *)(uVar14 + 0x184) == 6) { uVar16 = uVar10 - 3000; if (999 < uVar10 - 3000) { uVar16 = uVar10; } uVar10 = uVar16; } else if (*(int *)(uVar14 + 0x184) != 5) { if (uVar10 - 1000 < 1000) { uVar10 = uVar10 - 1000; } if (uVar10 - 3000 < 1000) { uVar10 = uVar10 - 3000; } } if (((300 < (int)uVar10) && ((0 < local_6c || (0x3e6 < (int)uVar10)))) && (((*(uint *)(uVar14 + 0x168) & 0x1000800) == 0 || (800 < (int)uVar10)))) { uVar9 = iVar18 - 1; break; } iVar18 = iVar18 + 1; local_94 = (float)((int)local_94 + 0x28); } while (iVar18 < (int)uVar9); } local_90 = *(uint *)local_a4; fVar20 = (float)(int)(uVar9 * 0x28) * (float)local_80[1] + *(float *)(local_90 + 0x340); fVar21 = (float)(int)(uVar9 * 0x28) * (float)puVar17 + *(float *)(local_90 + 0x33c); uVar14 = (int)local_a0 + 2U & 0x80000003; if ((int)uVar14 < 0) { uVar14 = (uVar14 - 1 | 0xfffffffc) + 1; } uVar10 = (uint)local_a0 & 0x80000003; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xfffffffc) + 1; } pvVar2 = g_game->_room; iVar18 = (int)((((float)(&local_34)[uVar14 * 2] * 40.0 + fVar21) - 40.0) / 40.0 + 0.5); if ((((iVar18 < 0) || (*(int *)((int)pvVar2 + 0xc) <= iVar18)) || (iVar15 = (int)(((afStack_30[uVar14 * 2] * 40.0 + fVar20) - 120.0) / 40.0 + 0.5), iVar15 < 0)) || ((*(int *)((int)pvVar2 + 0x10) <= iVar15 || (uVar14 = iVar15 * *(int *)((int)pvVar2 + 0xc) + iVar18, 0x1bf < uVar14)))) { uVar14 = 0; } else { uVar14 = *(uint *)((int)pvVar2 + uVar14 * 4 + 0x76c); } if (local_90 != 0) { if (*(int *)(local_90 + 0x184) == 6) { if (uVar14 - 3000 < 1000) { uVar14 = uVar14 - 3000; } } else if (*(int *)(local_90 + 0x184) != 5) { if (uVar14 - 1000 < 1000) { uVar14 = uVar14 - 1000; } if (uVar14 - 3000 < 1000) { uVar14 = uVar14 - 3000; } } } local_94 = (float)(int)((((float)(&local_34)[uVar10 * 2] * 40.0 + fVar21) - 40.0) / 40.0 + 0.5); iVar18 = (int)(((afStack_30[uVar10 * 2] * 40.0 + fVar20) - 120.0) / 40.0 + 0.5); if ((((int)local_94 < 0) || (*(int *)((int)pvVar2 + 0xc) <= (int)local_94)) || ((iVar18 < 0 || ((*(int *)((int)pvVar2 + 0x10) <= iVar18 || (uVar10 = iVar18 * *(int *)((int)pvVar2 + 0xc) + (int)local_94, 0x1bf < uVar10)))))) { uVar10 = 0; } else { uVar10 = *(uint *)((int)pvVar2 + uVar10 * 4 + 0x76c); } if (local_90 != 0) { if (*(int *)(local_90 + 0x184) == 6) { if (uVar10 - 3000 < 1000) { uVar10 = uVar10 - 3000; } } else if (*(int *)(local_90 + 0x184) != 5) { if (uVar10 - 1000 < 1000) { uVar10 = uVar10 - 1000; } if (uVar10 - 3000 < 1000) { uVar10 = uVar10 - 3000; } } } if ((((int)uVar14 < 200) || ((int)uVar10 < 200)) || (uVar14 = Random(), uVar14 % 10 == 0)) { *(uint *)local_8c = uVar9; } pPVar19 = local_a4; } local_80 = local_80 + 2; local_a0 = (undefined1 *)((int)local_a0 + 1); local_8c = (Entity_NPC *)((int)local_8c + 4); local_9c = local_9c + -1; } while (local_9c != (undefined1 *)0x0); uVar14 = 0; uVar9 = 0xffffffff; local_8c = (Entity_NPC *) __RTDynamicCast(*(uint *)local_a4,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); uVar10 = Random(); local_a0 = (undefined1 *)(uVar10 & 3); if (((*(uint *)(*(uint *)local_a4 + 0x168) & 0x1000800) == 0) || (local_8c == (Entity_NPC *)0x0)) { LAB_007e5b55: local_98 = (Vector *)(local_a0 + 4); puVar17 = local_a0; uVar10 = uVar14; do { uVar16 = (uint)puVar17 & 0x80000003; if ((int)uVar16 < 0) { uVar16 = (uVar16 - 1 | 0xfffffffc) + 1; } uVar14 = local_50[uVar16]; if ((int)local_50[uVar16] <= (int)uVar10) { uVar14 = uVar10; uVar16 = uVar9; } uVar9 = uVar16; puVar17 = puVar17 + 1; uVar10 = uVar14; } while ((int)puVar17 < (int)local_98); } else { pEVar7 = Entity_NPC::GetPlayerTarget(local_8c); local_94 = (pEVar7->_pos).x - *(float *)(*(uint *)local_a4 + 0x33c); local_98 = (Vector *)((pEVar7->_pos).y - *(float *)(*(uint *)local_a4 + 0x340)); local_80 = (undefined1 **)(local_a0 + 4); local_9c = local_a0; do { local_90 = (uint)local_9c & 0x80000003; if ((int)local_90 < 0) { local_90 = (local_90 - 1 | 0xfffffffc) + 1; } pVVar8 = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_60,local_90); if ((float)local_98 * pVVar8->y + local_94 * pVVar8->x <= 0.0) { if ((int)uVar14 < (int)local_50[local_90]) { uVar14 = local_50[local_90]; uVar9 = local_90; } } local_9c = local_9c + 1; } while ((int)local_9c < (int)local_80); if (uVar14 == 0) { if (ABS((float)local_98) <= ABS(local_94)) { uVar16 = 1; uVar10 = uVar14; do { uVar14 = local_50[uVar16]; uVar5 = uVar16; if ((int)local_50[uVar16] <= (int)uVar10) { uVar14 = uVar10; uVar5 = uVar9; } uVar9 = uVar5; uVar16 = uVar16 + 2; uVar10 = uVar14; } while ((int)uVar16 < 4); } else { uVar16 = 0; uVar10 = uVar14; do { uVar14 = local_50[uVar16]; uVar5 = uVar16; if ((int)local_50[uVar16] <= (int)uVar10) { uVar14 = uVar10; uVar5 = uVar9; } uVar9 = uVar5; uVar16 = uVar16 + 2; uVar10 = uVar14; } while ((int)uVar16 < 4); } if (uVar14 == 0) goto LAB_007e5b55; } } if ((((int)uVar14 < 2) && (uVar10 = Random(), uVar10 % 10 != 0)) && ((*(uint *)(*(uint *)local_a4 + 0x168) & 0x1000800) == 0)) { uVar9 = 0xffffffff; } uVar10 = *(int *)&local_a4->field_0x14 - uVar9; uVar16 = (int)uVar10 >> 0x1f; if (((((uVar10 ^ uVar16) - uVar16 != 2) || (uVar10 = Random(), uVar10 % 5 == 0)) || ((*(uint *)(*(uint *)local_a4 + 0x168) & 0x1000800) != 0)) && (-1 < (int)uVar9)) { if ((*(uint *)(*(uint *)local_a4 + 0x168) & 0x1000800) != 0) { local_98 = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_58,uVar9); pEVar7 = Entity_NPC::GetPlayerTarget(local_8c); local_9c = (undefined1 *)((pEVar7->_pos).y - *(float *)(*(uint *)local_a4 + 0x340)); local_a0 = (undefined1 *)((pEVar7->_pos).x - *(float *)(*(uint *)local_a4 + 0x33c)); fVar21 = sqrtf((float)local_9c * (float)local_9c + (float)local_a0 * (float)local_a0); if (fVar21 <= 0.0) { puVar22 = local_a0; puVar17 = local_9c; } else { puVar22 = (undefined1 *)((float)local_a0 * (1.0 / fVar21)); puVar17 = (undefined1 *)((float)local_9c * (1.0 / fVar21)); } if (0.95 < (float)puVar17 * local_98->y + (float)puVar22 * local_98->x) goto LAB_007e5bf0; } local_a0 = (&local_34)[uVar9 * 2]; pvVar2 = g_game->_room; fVar21 = (((float)local_a0 * (float)(int)(uVar14 * 0x28) + *(float *)(*(uint *)local_a4 + 0x33c)) - 40.0) / 40.0 + 0.5; iVar18 = (int)fVar21; if (((iVar18 < 0) || (iVar15 = *(int *)((int)pvVar2 + 0xc), iVar15 <= iVar18)) || ((iVar18 = (int)((((float)(int)(uVar14 * 0x28) * afStack_30[uVar9 * 2] + *(float *)(*(uint *)local_a4 + 0x340)) - 120.0) / 40.0 + 0.5), iVar18 < 0 || (*(int *)((int)pvVar2 + 0x10) <= iVar18)))) { iVar15 = *(int *)((int)pvVar2 + 0xc); iVar18 = -1; } else { iVar18 = iVar18 * iVar15 + (int)fVar21; } local_94 = (float)(iVar18 % iVar15) * 40.0 + 40.0; local_98 = (Vector *)((float)(iVar18 / iVar15) * 40.0 + 120.0); local_9c = (undefined1 *)(int)((local_94 - 40.0) / 40.0 + 0.5); if ((((int)local_9c < 0) || (iVar15 <= (int)local_9c)) || ((iVar18 = (int)(((float)local_98 - 120.0) / 40.0 + 0.5), iVar18 < 0 || (((*(int *)((int)g_game->_room + 0x10) <= iVar18 || ((undefined1 *)0x1bf < local_9c + iVar18 * iVar15)) || (*(int *)((int)g_game->_room + (int)(local_9c + iVar18 * iVar15) * 4 + 0x76c) != 999))) ))) { *(uint *)&local_a4->field_0x14 = uVar9; this_00 = g_game->_room; iVar18 = (int)(((float)local_98 - 120.0) / 40.0 + 0.5); if (((((int)local_9c < 0) || (this_00->_gridWidth <= (int)local_9c)) || (iVar18 < 0)) || (this_00->_gridHeight <= iVar18)) { puVar17 = (undefined1 *)0xffffffff; } else { puVar17 = local_9c + iVar18 * this_00->_gridWidth; } piVar3 = *(int **)((int)this_00->_descriptor + 0x10); if (((piVar3 != (int *)0x0) && (piVar3[2] == 0x10)) && (*piVar3 == 0x23)) goto LAB_007e5ee3; if (-1 < (int)puVar17) { if (this_00->_gridEntities[(int)puVar17] == (void *)0x0) { if ((2999 < this_00->_gridPaths[(int)puVar17]) || (999 < this_00->_gridPaths[(int)puVar17])) goto LAB_007e5e93; } else if (*(int *)((int)this_00->_gridEntities[(int)puVar17] + 0x3c) != 0) goto LAB_007e5e93; LAB_007e5ee3: (local_a4->_movementTarget).x = local_94; fVar21 = afStack_30[uVar9 * 2]; (local_a4->_movementTarget).y = (float)local_98; uVar9 = *(uint *)local_a4; puVar11 = (undefined4 *)(uVar9 + 0x360); iVar18 = local_6c; if (ABS((float)local_a0) <= ABS(fVar21)) { *puVar11 = 0; *(undefined4 *)(uVar9 + 0x364) = *(undefined4 *)(uVar9 + 0x364); *(undefined4 *)&local_a4->field_0x18 = 0; } else { *puVar11 = *puVar11; *(undefined4 *)(uVar9 + 0x364) = 0; *(undefined4 *)&local_a4->field_0x18 = 0; } goto LAB_007e5558; } LAB_007e5e93: if (local_8c->_entityGridCollisionClass == 3) { if (((((int)local_9c < 0) || (this_00->_gridWidth <= (int)local_9c)) || (iVar18 < 0)) || (this_00->_gridHeight <= iVar18)) { puVar17 = (undefined1 *)0xffffffff; } else { puVar17 = local_9c + this_00->_gridWidth * iVar18; } uVar14 = Room::GetGridCollision(this_00,(int)puVar17); if (uVar14 != 4) goto LAB_007e5ee3; } } } LAB_007e5bf0: *(undefined4 *)&local_a4->field_0x18 = 0; iVar18 = local_6c; } while( true ); } LAB_007e62e0: return; LAB_007e5f59: if ((fVar21 != g_vectorZero.x) || ((local_a4->_movementTarget).y != g_vectorZero.y)) { if (1 < (int)local_74.x) { (local_a4->_movementTarget).x = g_vectorZero.x; (local_a4->_movementTarget).y = g_vectorZero.y; return; } pVVar8 = &local_7c; if (local_68 < fVar21) { pVVar8 = &local_a4->_movementTarget; } fVar21 = pVVar8->x; if (local_64 <= fVar21) { fVar21 = local_64; } pfVar1 = &(local_a4->_movementTarget).y; (local_a4->_movementTarget).x = fVar21; pfVar12 = &local_7c.y; if (local_88 < *pfVar1) { pfVar12 = pfVar1; } local_88 = *pfVar12; if (local_84 <= local_88) { local_88 = local_84; } uVar9 = *(uint *)local_a4; *pfVar1 = local_88; local_84 = (*(float *)(uVar9 + 0x33c) + *(float *)(uVar9 + 0x360)) - fVar21; local_88 = (*(float *)(uVar9 + 0x340) + *(float *)(uVar9 + 0x364)) - local_88; local_74.x = local_88 * local_88 + local_84 * local_84; fVar21 = sqrtf(local_74.x); if (5.0 <= fVar21) { fVar21 = sqrtf(*(float *)(uVar9 + 0x360) * *(float *)(uVar9 + 0x360) + *(float *)(uVar9 + 0x364) * *(float *)(uVar9 + 0x364)); if ((fVar21 < 0.6) && (iVar18 = *(int *)&local_a4->field_0x18 + 1, *(int *)&local_a4->field_0x18 = iVar18, 10 < iVar18)) { (local_a4->_movementTarget).x = g_vectorZero.x; (local_a4->_movementTarget).y = g_vectorZero.y; } } else { (local_a4->_movementTarget).x = g_vectorZero.x; (local_a4->_movementTarget).y = g_vectorZero.y; } pPVar19 = local_a4; fVar21 = sqrtf(local_74.x); if (0.0 < fVar21) { local_88 = local_88 * (1.0 / fVar21); local_84 = local_84 * (1.0 / fVar21); } uVar9 = *(uint *)pPVar19; fVar21 = *(float *)(uVar9 + 0x36c); if (fVar21 != 0.0) { *(float *)(uVar9 + 0x364) = (*(float *)(uVar9 + 0x39c) * -local_88 * speed) / fVar21 + *(float *)(uVar9 + 0x364); *(float *)(uVar9 + 0x360) = (*(float *)(uVar9 + 0x39c) * -local_84 * speed) / fVar21 + *(float *)(uVar9 + 0x360); uVar9 = *(uint *)pPVar19; } local_88 = *(float *)(uVar9 + 0x33c); local_98 = *(Vector **)(uVar9 + 0x360); local_74.x = *(float *)(uVar9 + 0x364); local_84 = *(float *)(uVar9 + 0x340); fVar21 = sqrtf((float)local_98 * (float)local_98 + local_74.x * local_74.x); if (fVar21 <= 0.0) { pVVar8 = local_98; fVar21 = local_74.x; } else { pVVar8 = (Vector *)(*(float *)(uVar9 + 0x360) * (1.0 / fVar21)); fVar21 = *(float *)(uVar9 + 0x364) * (1.0 / fVar21); } pvVar2 = g_game->_room; iVar18 = (int)((((float)pVVar8 * 40.0 + local_88) - 40.0) / 40.0 + 0.5); if ((((iVar18 < 0) || (*(int *)((int)pvVar2 + 0xc) <= iVar18)) || (iVar15 = (int)(((fVar21 * 40.0 + local_84) - 120.0) / 40.0 + 0.5), iVar15 < 0)) || ((*(int *)((int)pvVar2 + 0x10) <= iVar15 || (uVar9 = *(int *)((int)pvVar2 + 0xc) * iVar15 + iVar18, 0x1bf < uVar9)))) { uVar13 = 0; } else { uVar13 = *(undefined4 *)((int)pvVar2 + uVar9 * 4 + 0x76c); } iVar18 = FUN_007e7fb0(uVar13); if (((700 < iVar18) && (fVar21 = *(float *)(*(uint *)pPVar19 + 0x360), fVar20 = *(float *)(*(uint *)pPVar19 + 0x364), fVar21 = sqrtf(fVar20 * fVar20 + fVar21 * fVar21), 3.0 < fVar21)) && (iVar18 = *(int *)&pPVar19->field_0x18 + 1, *(int *)&pPVar19->field_0x18 = iVar18, 2 < iVar18 )) { (pPVar19->_movementTarget).x = g_vectorZero.x; (pPVar19->_movementTarget).y = g_vectorZero.y; } } goto LAB_007e62e0; } //@@ 007e6300 PathFinder::MoveRandomly /* DB: Lua PathFinder:MoveRandomly; ZHL said NPCAI_Pathfinder::MoveRandomlyBoss prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall PathFinder::MoveRandomly(PathFinder *this,byte isIgnoreStatusEffects) { Vector pos; byte bVar1; Entity_NPC *pEVar2; Vector *targetPos; Entity *pEVar3; uint uVar4; float fVar5; float fVar6; float fVar7; int iVar8; Vector local_10; iVar8 = *(int *)this; if (*(int *)(iVar8 + 0x3d4) != 0) { return 1; } if (isIgnoreStatusEffects == 0) { bVar1 = is_entity_friendly(this); if (bVar1 != 0) { pEVar2 = (Entity_NPC *) __RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); bVar1 = 1; iVar8 = 0; fVar7 = 0.5; targetPos = Entity_NPC::CalcTargetPosition(pEVar2,&local_10,0.0); FindGridPath(this,targetPos,fVar7,iVar8,bVar1); return 1; } if ((*(uint *)(iVar8 + 0x168) & 0x1000800) != 0) { pEVar2 = (Entity_NPC *) __RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); pEVar3 = Entity_NPC::GetPlayerTarget(pEVar2); local_10.x = (pEVar3->_pos).x; local_10.y = (pEVar3->_pos).y; EvadeTarget(this,&local_10,0); return 1; } } if (((this->_movementTarget).x == g_vectorZero.x) && ((this->_movementTarget).y == g_vectorZero.y) ) { fVar7 = *(float *)(iVar8 + 0x33c); local_10.x = *(float *)(iVar8 + 0x340); uVar4 = Random(); fVar5 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar5 = fVar5 + fVar5; fVar6 = cos(fVar5); fVar7 = fVar6 * 40.0 + fVar7; fVar5 = sin(fVar5); local_10.x = fVar5 * 40.0 + local_10.x; pos.y = local_10.x; pos.x = fVar7; iVar8 = Room::GetGridCollisionAtPos(g_game->_room,pos); if (iVar8 == 0) { (this->_movementTarget).x = fVar7; (this->_movementTarget).y = local_10.x; } } fVar7 = (this->_movementTarget).x; if ((fVar7 == g_vectorZero.x) && ((this->_movementTarget).y == g_vectorZero.y)) { return 0; } iVar8 = *(int *)this; fVar5 = (this->_movementTarget).y - *(float *)(iVar8 + 0x340); fVar7 = fVar7 - *(float *)(iVar8 + 0x33c); local_10.x = sqrtf(fVar5 * fVar5 + fVar7 * fVar7); if (((3.0 <= local_10.x) && (*(char *)(iVar8 + 400) == '\0')) && ((0.1 <= *(float *)(iVar8 + 0x364) * *(float *)(iVar8 + 0x364) + *(float *)(iVar8 + 0x360) * *(float *)(iVar8 + 0x360) || (uVar4 = Random(), uVar4 % 10 != 0)))) { if (0.0 < local_10.x) { iVar8 = *(int *)this; fVar6 = *(float *)(iVar8 + 0x36c); if (fVar6 != 0.0) { *(float *)(iVar8 + 0x360) = ((fVar7 / local_10.x) * 0.5 * *(float *)(iVar8 + 0x39c)) / fVar6 + *(float *)(iVar8 + 0x360); *(float *)(iVar8 + 0x364) = ((fVar5 / local_10.x) * 0.5 * *(float *)(iVar8 + 0x39c)) / fVar6 + *(float *)(iVar8 + 0x364); } } return 0; } (this->_movementTarget).x = g_vectorZero.x; (this->_movementTarget).y = g_vectorZero.y; return 1; } //@@ 007e6650 PathFinder::MoveRandomlyBoss /* ZHL [lua] Lua binding PathFinder:MoveRandomlyBoss prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall PathFinder::MoveRandomlyBoss(PathFinder *this,byte isIgnoreStatusEffects) { Room *this_00; byte bVar1; Entity_NPC *pEVar2; Vector *pVVar3; Entity *pEVar4; uint uVar5; int iVar6; float fVar7; float fVar8; float fVar9; int iVar10; int local_20; Vector local_18; Vector local_10; iVar10 = *(int *)this; if (*(int *)(iVar10 + 0x3d4) == 0) { if (isIgnoreStatusEffects == 0) { bVar1 = is_entity_friendly(this); if (bVar1 != 0) { pEVar2 = (Entity_NPC *) __RTDynamicCast(iVar10,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); bVar1 = 1; iVar10 = 0; fVar9 = 0.5; pVVar3 = Entity_NPC::CalcTargetPosition(pEVar2,&local_10,0.0); FindGridPath(this,pVVar3,fVar9,iVar10,bVar1); return; } if ((*(uint *)(iVar10 + 0x168) & 0x1000800) != 0) { pEVar2 = (Entity_NPC *) __RTDynamicCast(iVar10,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); pEVar4 = Entity_NPC::GetPlayerTarget(pEVar2); local_10.x = (pEVar4->_pos).x; local_10.y = (pEVar4->_pos).y; EvadeTarget(this,&local_10,0); return; } } fVar9 = *(float *)&this->field_0xc; if ((fVar9 == g_vectorZero.x) && (*(float *)&this->field_0x10 == g_vectorZero.y)) { uVar5 = Random(); fVar7 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar7 = fVar7 + fVar7; fVar9 = cos(fVar7); fVar7 = sin(fVar7); *(float *)&this->field_0xc = fVar9; *(float *)&this->field_0x10 = fVar7; iVar10 = *(int *)this; } else { fVar7 = *(float *)&this->field_0x10; } fVar8 = *(float *)(iVar10 + 0x36c); if (fVar8 != 0.0) { *(float *)(iVar10 + 0x364) = (*(float *)(iVar10 + 0x39c) * fVar7 * 0.5) / fVar8 + *(float *)(iVar10 + 0x364); *(float *)(iVar10 + 0x360) = (*(float *)(iVar10 + 0x39c) * fVar9 * 0.5) / fVar8 + *(float *)(iVar10 + 0x360); iVar10 = *(int *)this; } local_10.x = ((Vector *)(iVar10 + 0x33c))->x; local_10.y = *(float *)(iVar10 + 0x340); iVar10 = Room::GetGridCollisionAtPos(g_game->_room,*(Vector *)(iVar10 + 0x33c)); if (iVar10 == 0) { uVar5 = Random(); if (uVar5 % 0x1e == 0) { pVVar3 = MusicManager::RandomVector(&local_10); fVar8 = pVVar3->x + *(float *)&this->field_0xc; *(float *)&this->field_0xc = fVar8; fVar7 = pVVar3->y + *(float *)&this->field_0x10; *(float *)&this->field_0x10 = fVar7; fVar9 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (0.0 < fVar9) { *(float *)&this->field_0xc = (1.0 / fVar9) * fVar8; *(float *)&this->field_0x10 = fVar7 * (1.0 / fVar9); } } if (((*(Entity **)this)->_collidesWithGrid != 0) && (bVar1 = Entity::IsFrame(*(Entity **)this,5,0), bVar1 != 0)) { *(uint *)&this->field_0xc = *(uint *)&this->field_0xc ^ 0x80000000; *(uint *)&this->field_0x10 = *(uint *)&this->field_0x10 ^ 0x80000000; } local_20 = 5; while( true ) { fVar9 = *(float *)&this->field_0xc; local_10.x = *(float *)&this->field_0x10; this_00 = g_game->_room; iVar10 = (int)(((fVar9 * 10.0 + *(float *)(*(int *)this + 0x33c)) - 40.0) / 40.0 + 0.5); iVar6 = (int)(((local_10.x * 10.0 + *(float *)(*(int *)this + 0x340)) - 120.0) / 40.0 + 0.5) ; if ((((iVar10 < 0) || (this_00->_gridWidth <= iVar10)) || (iVar6 < 0)) || (this_00->_gridHeight <= iVar6)) { iVar10 = -1; } else { iVar10 = this_00->_gridWidth * iVar6 + iVar10; } uVar5 = Room::GetGridCollision(this_00,iVar10); if ((uVar5 == 0) || (local_20 < 1)) break; uVar5 = Random(); local_18.x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_18.x = local_18.x + local_18.x; fVar7 = cos(local_18.x); fVar7 = fVar7 - fVar9; fVar9 = sin(local_18.x); fVar9 = fVar9 - local_10.x; fVar8 = sqrtf(fVar9 * fVar9 + fVar7 * fVar7); if (0.0 < fVar8) { fVar7 = fVar7 * (1.0 / fVar8); fVar9 = fVar9 * (1.0 / fVar8); } *(float *)&this->field_0xc = fVar7; *(float *)&this->field_0x10 = fVar9; iVar10 = *(int *)this; *(float *)(iVar10 + 0x360) = g_vectorZero.x; *(float *)(iVar10 + 0x364) = g_vectorZero.y; local_20 = local_20 + -1; } } else { uVar5 = Random(); if (uVar5 % 0x1e == 0) { local_10.x = *(float *)(*(int *)this + 0x33c); local_10.y = *(float *)(*(int *)this + 0x340); Room::FindFreePickupSpawnPosition(g_game->_room,&local_18,&local_10,0.0,0,0,0); fVar7 = local_18.y - *(float *)(*(int *)this + 0x340); fVar8 = local_18.x - *(float *)(*(int *)this + 0x33c); *(float *)&this->field_0x10 = fVar7; *(float *)&this->field_0xc = fVar8; fVar9 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (0.0 < fVar9) { *(float *)&this->field_0xc = fVar8 * (1.0 / fVar9); *(float *)&this->field_0x10 = fVar7 * (1.0 / fVar9); return; } } } } return; } //@@ 007e6b90 PathFinder::update_chase_movement /* DB: ? called from NpcAI::ENTITY_PEEPER_FATTY; ECX struct with the NPC at [0] and countdown at +0x28 (PathFinder); charmed/controlled NPC uses Entity_NPC::GetControllerInput, else GetPlayerTarget + PathFinder::Reset/FindGridPath, approach_angle; returns velocity */ void PathFinder::update_chase_movement(void) { Entity_NPC *pEVar1; int iVar2; qword qVar3; byte bVar4; Vector *pVVar5; uint uVar6; Entity *pEVar7; PathFinder *in_ECX; float fVar8; float fVar9; float fVar10; Vector local_20; float local_14; pEVar1 = *(Entity_NPC **)in_ECX; if ((pEVar1 == (Entity_NPC *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (pEVar1->_type != 1)) && (0x3dd < pEVar1->_type - 10U)))) { local_20.y = 0.0; } else { local_20.y = (float)pEVar1; if (pEVar1->_controllerID != -1) { pEVar1->_friction = pEVar1->_friction * 0.6; pVVar5 = Entity_NPC::GetControllerInput(pEVar1,&local_20,0.0); fVar8 = pEVar1->_speedMultiplier; fVar9 = pVVar5->y; (pEVar1->_velocity).x = pVVar5->x * 1.2 * 1.25 * fVar8 + (pEVar1->_velocity).x; (pEVar1->_velocity).y = fVar9 * 1.2 * 1.25 * fVar8 + (pEVar1->_velocity).y; return; } } fVar8 = local_20.y; pEVar1->_friction = pEVar1->_friction * 0.6; local_14 = (float)((int)pEVar1->_updateTime - (int)pEVar1->_prevUpdateTime); if ((pEVar1->_flags & 0x1000b00) != 0) { *(undefined4 *)&in_ECX->field_0x28 = 10; } if ((Entity_NPC *)local_20.y != (Entity_NPC *)0x0) { pEVar1 = *(Entity_NPC **)((int)((int)local_20.y + 0x168) + 4); qVar3 = *(qword *)((int)local_20.y + 0x168); local_20.y = (float)pEVar1; if ((qVar3 & 0x200) == 0) { if ((qVar3 & 0x100) == 0) { if ((qVar3 & 0x1000800) == 0) goto LAB_007e6de9; pEVar7 = Entity_NPC::GetPlayerTarget((Entity_NPC *)fVar8); fVar9 = ((Vector *)((int)fVar8 + 0x33c))->x - (pEVar7->_pos).x; fVar8 = ((Vector *)((int)fVar8 + 0x33c))->y - (pEVar7->_pos).y; } else { local_20.y = (float)Entity_NPC::GetPlayerTarget((Entity_NPC *)fVar8); bVar4 = Entity::IsFrame((Entity *)fVar8,5,*(int *)((int)fVar8 + 0x20)); if (bVar4 == 0) goto LAB_007e6de9; Reset(in_ECX); local_20.x = ((Vector *)((int)local_20.y + 0x33c))->x; local_20.y = ((Vector *)((int)local_20.y + 0x33c))->y; FindGridPath(in_ECX,&local_20,1.0,900,1); fVar9 = ((Vector *)((int)fVar8 + 0x360))->x; fVar8 = ((Vector *)((int)fVar8 + 0x360))->y; } fVar8 = atan2f(fVar8,fVar9); fVar8 = fVar8 * 57.295776; } else { uVar6 = Random(); if (uVar6 % 5 != 0) goto LAB_007e6de9; uVar6 = Random(); fVar8 = normalize_angle_degrees ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0); } (in_ECX->_movementTarget).x = fVar8; } LAB_007e6de9: *(int *)&in_ECX->field_0x28 = *(int *)&in_ECX->field_0x28 - (int)local_14; local_14 = (in_ECX->_movementTarget).y * 0.017453292; local_20.y = cos(local_14); local_14 = sin(local_14); iVar2 = *(int *)in_ECX; *(float *)(iVar2 + 0x360) = local_20.y * 1.2 * *(float *)(iVar2 + 0x39c) + *(float *)(iVar2 + 0x360); *(float *)(iVar2 + 0x364) = local_14 * 1.2 * *(float *)(iVar2 + 0x39c) + *(float *)(iVar2 + 0x364) ; fVar8 = approach_angle((in_ECX->_movementTarget).y,(in_ECX->_movementTarget).x,10.0); (in_ECX->_movementTarget).y = fVar8; if (*(char *)(*(int *)in_ECX + 400) != '\0') { uVar6 = Random(); if ((uVar6 & 3) == 0) { fVar8 = *(float *)(*(int *)in_ECX + 0x19c); fVar9 = *(float *)(*(int *)in_ECX + 0x1a0); fVar10 = local_14 * fVar9 + local_20.y * fVar8; fVar8 = atan2f(local_14 - (fVar9 + fVar9) * fVar10,local_20.y - (fVar8 + fVar8) * fVar10); (in_ECX->_movementTarget).x = fVar8 * 57.295776; } } if (*(int *)&in_ECX->field_0x28 < 1) { uVar6 = Random(); fVar8 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0; if (360.0 < ABS(fVar8)) { fVar8 = fmodf(fVar8,360.0); } if (fVar8 <= 180.0) { if (fVar8 < -180.0) { fVar8 = fVar8 + 360.0; } } else { fVar8 = fVar8 - 360.0; } (in_ECX->_movementTarget).x = fVar8; uVar6 = Random(); *(uint *)&in_ECX->field_0x28 = uVar6 % 0x78 + 0x2d; } return; } //@@ 007e6fa0 NPCAI_Pathfinder::ResetMovementTarget /* ZHL [exact] __thiscall void NPCAI_Pathfinder::ResetMovementTarget(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall NPCAI_Pathfinder::ResetMovementTarget(NPCAI_Pathfinder *this) { (this->_movementTarget).x = g_vectorZero.x; (this->_movementTarget).y = g_vectorZero.y; (this->_moveDirection).x = g_vectorZero.x; (this->_moveDirection).y = g_vectorZero.y; return; } //@@ 007e6ff0 PathFinder::UpdateGridIndex /* ZHL [lua] Lua binding PathFinder:UpdateGridIndex prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall PathFinder::UpdateGridIndex(PathFinder *this) { int iVar1; int iVar2; int iVar3; iVar3 = (int)((*(float *)(*(int *)this + 0x33c) - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (iVar1 = *(int *)((int)g_game->_room + 0xc), iVar1 <= iVar3)) || (iVar2 = (int)((*(float *)(*(int *)this + 0x340) - 120.0) / 40.0 + 0.5), iVar2 < 0)) || (*(int *)((int)g_game->_room + 0x10) <= iVar2)) { *(undefined4 *)&this->field_0x20 = 0xffffffff; return; } *(int *)&this->field_0x20 = iVar1 * iVar2 + iVar3; return; } //@@ 007e7070 NPCAI_Pathfinder::HasPathToPos /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool NPCAI_Pathfinder::HasPathToPos(Vector * Position, bool IgnorePoop); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall NPCAI_Pathfinder::HasPathToPos(NPCAI_Pathfinder *this,Vector *position,byte isIgnorePoop) { KColor color; KColor color_00; uint *puVar1; undefined1 *puVar2; undefined1 *puVar3; uint uVar4; int iVar5; byte *pbVar6; undefined1 *puVar7; int iVar8; void *pvVar9; uint uVar10; int iVar11; undefined4 unaff_EBX; int iVar12; uint *puVar13; undefined4 unaff_ESI; int *piVar14; uint *puVar15; undefined4 unaff_EDI; int *piVar16; size_t _Size; uint uVar17; undefined1 auStackY_83c [128]; void *unused_1; byte *pbVar18; byte *pbVar19; byte *pbVar20; size_t in_stack_fffff874; undefined1 *local_778; uint local_774; uint local_770; void *local_76c; undefined4 local_768; undefined1 *local_764; uint *local_760; uint *local_75c; uint *local_758; uint local_754; void *local_750; void *local_74c; void *local_748; int local_744; undefined1 *local_740; uint local_73c; uint local_738; void *local_734; undefined1 *local_730; undefined1 *local_72c; byte local_725; int local_724 [448]; uint local_24 [4]; uint local_14; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; puStack_c = &LAB_00b00a71; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(auStack_7 + 3); pvVar9 = g_game->_room; iVar5 = (int)((*(float *)((int)this->_entity + 0x33c) - 40.0) / 40.0 + 0.5); iVar12 = (int)((*(float *)((int)this->_entity + 0x340) - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (*(int *)((int)pvVar9 + 0xc) <= iVar5)) || (iVar12 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar12)) { local_73c = 0xffffffff; } else { local_73c = iVar12 * *(int *)((int)pvVar9 + 0xc) + iVar5; if ((local_73c < 0x1c0) && (*(int *)((int)pvVar9 + local_73c * 4 + 0x76c) == 1000)) { return 0; } } local_760 = (uint *)0x0; local_75c = (uint *)0x0; local_758 = (uint *)0x0; local_74c = (void *)0x0; local_748 = (void *)0x0; local_744 = 0; iVar12 = (int)((position->x - 40.0) / 40.0 + 0.5); iVar5 = (int)((position->y - 120.0) / 40.0 + 0.5); if (((iVar12 < 0) || (*(int *)((int)pvVar9 + 0xc) <= iVar12)) || ((iVar5 < 0 || (*(int *)((int)pvVar9 + 0x10) <= iVar5)))) { local_774 = 0xffffffff; } else { local_774 = iVar5 * *(int *)((int)pvVar9 + 0xc) + iVar12; } local_76c = (void *)0x0; local_768 = 0; local_764 = (undefined1 *)0x0; local_770 = 0; local_8 = 1; auStack_7 = (undefined1 [3])0x0; ExceptionList = &local_10; local_14 = uVar4; vector_PathNode_emplace_reallocate_copy(&local_760,(void *)0x0,&local_774); pvVar9 = local_74c; local_730 = auStackY_83c + 0x8c; pbVar18 = (byte *)0x0; pbVar19 = (byte *)0x0; pbVar20 = (byte *)0x0; uVar10 = local_754; unused_1 = local_750; puVar7 = auStackY_83c + 0x8c; if (local_74c != local_748) { local_72c = (undefined1 *)((int)local_748 - (int)local_74c); puVar7 = local_740; puVar3 = auStackY_83c + 0x8c; if (0x3fffffff < (uint)((int)local_72c >> 2)) { LAB_007e780c: local_730 = puVar3; local_740 = puVar7; /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar17 = ((int)local_72c >> 2) * 4; pbVar6 = std::_Allocate(uVar17); pbVar20 = pbVar6 + uVar17; pbVar18 = pbVar6; pbVar19 = pbVar6; memmove(pbVar6,pvVar9,(size_t)local_72c); *(byte **)(local_730 + 0xc) = pbVar6 + uVar17; puVar7 = local_730; } local_730 = puVar7; puVar13 = local_75c; color._green = (float)unaff_EDI; color._red = (float)uVar4; color._blue = (float)unaff_ESI; color._alpha = (float)unaff_EBX; color._unk = in_stack_fffff874; KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (local_760,(uint)local_75c,uVar10,unused_1,pbVar18,(uint)pbVar19,(uint)pbVar20,color); local_8 = 0; if (local_76c != (void *)0x0) { uVar10 = ((int)local_764 - (int)local_76c >> 2) * 4; pvVar9 = local_76c; if (0xfff < uVar10) { pvVar9 = *(void **)((int)local_76c + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_76c + (-4 - (int)pvVar9))) goto LAB_007e77d8; } operator_delete(pvVar9,uVar10); } local_725 = 0; piVar14 = (int *)((int)g_game->_room + 0x76c); piVar16 = local_724; for (iVar5 = 0x1c0; iVar5 != 0; iVar5 = iVar5 + -1) { *piVar16 = *piVar14; piVar14 = piVar14 + 1; piVar16 = piVar16 + 1; } puVar15 = local_760; if (local_760 != puVar13) { while (puVar15 = local_760, local_725 == 0) { local_734 = (void *)*local_760; local_730 = (undefined1 *)local_760[2]; local_738 = local_760[1]; local_778 = (undefined1 *)0x0; local_72c = (undefined1 *)0x0; if (local_730 != (undefined1 *)local_760[3]) { _Size = local_760[3] - (int)local_730; uVar10 = (int)_Size >> 2; puVar7 = local_740; puVar3 = local_730; if (0x3fffffff < uVar10) goto LAB_007e780c; uVar10 = uVar10 * 4; puVar7 = std::_Allocate(uVar10); local_778 = puVar7 + uVar10; memmove(puVar7,local_730,_Size); local_72c = puVar7; } puVar2 = local_72c; puVar15 = local_760; local_8 = 2; if ((*(int *)((int)g_game->_room + 0x10) * *(int *)((int)g_game->_room + 0xc)) / 2 <= (int)local_738) { if (local_72c != (undefined1 *)0x0) { uVar4 = (int)local_778 - (int)local_72c & 0xfffffffc; puVar7 = local_72c; if (0xfff < uVar4) { puVar7 = *(undefined1 **)(local_72c + -4); uVar4 = uVar4 + 0x23; if ((undefined1 *)0x1f < local_72c + (-4 - (int)puVar7)) goto LAB_007e77d8; } operator_delete(puVar7,uVar4); } break; } std::priority_queue::pop(); pvVar9 = g_game->_room; iVar12 = *(int *)((int)pvVar9 + 0xc); iVar11 = (int)local_734 % iVar12; iVar8 = (int)local_734 / iVar12; iVar5 = iVar11 + -1; if ((((iVar5 < 0) || (iVar12 <= iVar5)) || (iVar8 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar8)) { local_24[0] = 0xffffffff; if (-1 < iVar11) goto LAB_007e7462; LAB_007e7478: local_24[1] = -1; } else { local_24[0] = iVar12 * iVar8 + iVar5; LAB_007e7462: iVar5 = iVar8 + -1; if (((iVar12 <= iVar11) || (iVar5 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar5)) goto LAB_007e7478; local_24[1] = iVar12 * iVar5 + iVar11; } iVar5 = iVar11 + 1; if (((iVar5 < 0) || (iVar12 <= iVar5)) || ((iVar8 < 0 || (*(int *)((int)pvVar9 + 0x10) <= iVar8)))) { local_24[2] = -1; } else { local_24[2] = iVar12 * iVar8 + iVar5; } iVar8 = iVar8 + 1; if ((((iVar11 < 0) || (iVar12 <= iVar11)) || (iVar8 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar8)) { local_24[3] = -1; } else { local_24[3] = iVar12 * iVar8 + iVar11; } local_72c = (undefined1 *)0x0; puVar13 = local_75c; do { local_774 = local_24[(int)local_72c]; local_734 = (void *)0x0; local_76c = (void *)0x0; local_768 = 0; local_730 = (undefined1 *)0x0; local_764 = (undefined1 *)0x0; local_770 = local_738; local_8 = 3; if ((-1 < (int)local_774) && (((iVar5 = local_724[local_774], -1 < iVar5 && (iVar5 < 0x3b6)) || ((isIgnorePoop != 0 && (iVar5 == 0x5dc)))))) { local_770 = local_738 + 1; local_724[local_774] = -local_770; if (local_774 == local_73c) { local_725 = 1; break; } if (puVar13 == local_758) { vector_PathNode_emplace_reallocate(&local_760,puVar13,&local_774); local_730 = local_764; local_734 = local_76c; } else { *puVar13 = local_774; puVar13[1] = local_770; puVar13[2] = 0; puVar13[3] = 0; puVar13[4] = 0; local_75c = puVar13 + 5; } puVar13 = local_75c; local_740 = auStackY_83c + 0x8c; pbVar18 = (byte *)0x0; pbVar19 = (byte *)0x0; pbVar20 = (byte *)0x0; uVar10 = local_754; pvVar9 = local_750; local_76c = local_734; local_764 = local_730; puVar7 = auStackY_83c + 0x8c; if (local_74c != local_748) { in_stack_fffff874 = (int)local_748 - (int)local_74c; puVar7 = auStackY_83c + 0x8c; puVar3 = local_730; if (0x3fffffff < (uint)((int)in_stack_fffff874 >> 2)) goto LAB_007e780c; uVar17 = ((int)in_stack_fffff874 >> 2) * 4; pbVar6 = std::_Allocate(uVar17); pbVar20 = pbVar6 + uVar17; pbVar18 = pbVar6; pbVar19 = pbVar6; memmove(pbVar6,local_74c,in_stack_fffff874); *(byte **)(local_740 + 0xc) = pbVar6 + uVar17; puVar7 = local_740; } local_740 = puVar7; color_00._green = (float)unaff_EDI; color_00._red = (float)uVar4; color_00._blue = (float)unaff_ESI; color_00._alpha = (float)unaff_EBX; color_00._unk = in_stack_fffff874; KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (local_760,(uint)puVar13,uVar10,pvVar9,pbVar18,(uint)pbVar19,(uint)pbVar20, color_00); } puVar7 = local_72c; local_8 = 2; if (local_734 != (void *)0x0) { uVar10 = (int)local_730 - (int)local_734 & 0xfffffffc; pvVar9 = local_734; if (0xfff < uVar10) { pvVar9 = *(void **)((int)local_734 + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_734 + (-4 - (int)pvVar9))) goto LAB_007e77d8; } operator_delete(pvVar9,uVar10); } local_72c = puVar7 + 1; } while (local_72c < &DAT_00000004); local_8 = 0; if (puVar2 != (undefined1 *)0x0) { uVar10 = (int)local_778 - (int)puVar2 & 0xfffffffc; puVar7 = puVar2; if (0xfff < uVar10) { puVar7 = *(undefined1 **)(puVar2 + -4); uVar10 = uVar10 + 0x23; if ((undefined1 *)0x1f < puVar2 + (-4 - (int)puVar7)) goto LAB_007e77d8; } operator_delete(puVar7,uVar10); } puVar15 = local_760; if (local_760 == puVar13) break; } } if (local_74c != (void *)0x0) { uVar4 = local_744 - (int)local_74c & 0xfffffffc; pvVar9 = local_74c; if (0xfff < uVar4) { pvVar9 = *(void **)((int)local_74c + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_74c + (-4 - (int)pvVar9))) goto LAB_007e77d8; } operator_delete(pvVar9,uVar4); } puVar1 = puVar15; if (puVar15 != (uint *)0x0) { for (; puVar1 != puVar13; puVar1 = puVar1 + 5) { FID_conflict__Tidy(puVar1 + 2); } uVar4 = (((int)local_758 - (int)puVar15) / 0x14) * 0x14; puVar13 = puVar15; if (0xfff < uVar4) { puVar13 = (uint *)puVar15[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)puVar15 + (-4 - (int)puVar13))) { LAB_007e77d8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar13,uVar4); } ExceptionList = local_10; return local_725; } //@@ 007e7820 pathfinder_can_reach_pos /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=Vector pos, arg=Room: reads Room::_gridPath (+0x76c, 0x1c0 ints, 1000 = blocked) at the pos cell, copies the whole grid path table and flood-fills (most blocks folded by the decompiler); sits in the NPCAI_Pathfinder block next to HasPathToPos; caller 0x7a4ba0 tests every trapdoor (grid type 0x11) */ char pathfinder_can_reach_pos(void) { KColor color; KColor color_00; uint *puVar1; undefined1 *puVar2; undefined1 *puVar3; uint uVar4; int iVar5; byte *pbVar6; undefined1 *puVar7; int iVar8; float *in_ECX; void *pvVar9; float *in_EDX; int iVar10; uint uVar11; int iVar12; undefined4 unaff_EBX; uint *puVar13; undefined4 unaff_ESI; int *piVar14; uint *puVar15; undefined4 unaff_EDI; int *piVar16; uint uVar17; undefined1 auStackY_840 [128]; void *unused_1; byte *pbVar18; byte *pbVar19; byte *pbVar20; size_t in_stack_fffff870; undefined1 *local_77c; uint local_778; uint local_774; void *local_770; undefined4 local_76c; undefined1 *local_768; uint *local_764; uint *local_760; uint *local_75c; uint local_758; void *local_754; void *local_750; void *local_74c; int local_748; undefined1 *local_744; uint local_740; uint local_73c; void *local_738; undefined1 *local_734; undefined1 *local_730; char local_729; int local_728 [448]; uint local_28 [4]; uint local_18; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; puStack_c = &LAB_00b00ad1; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(auStack_7 + 3); pvVar9 = g_game->_room; iVar10 = (int)((*in_ECX - 40.0) / 40.0 + 0.5); iVar5 = (int)((in_ECX[1] - 120.0) / 40.0 + 0.5); if ((((iVar10 < 0) || (*(int *)((int)pvVar9 + 0xc) <= iVar10)) || (iVar5 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar5)) { local_740 = 0xffffffff; } else { local_740 = *(int *)((int)pvVar9 + 0xc) * iVar5 + iVar10; if ((local_740 < 0x1c0) && (*(int *)((int)pvVar9 + local_740 * 4 + 0x76c) == 1000)) { return '\0'; } } local_764 = (uint *)0x0; local_760 = (uint *)0x0; local_75c = (uint *)0x0; local_750 = (void *)0x0; local_74c = (void *)0x0; local_748 = 0; iVar10 = (int)((*in_EDX - 40.0) / 40.0 + 0.5); iVar5 = (int)((in_EDX[1] - 120.0) / 40.0 + 0.5); if (((iVar10 < 0) || (*(int *)((int)pvVar9 + 0xc) <= iVar10)) || ((iVar5 < 0 || (*(int *)((int)pvVar9 + 0x10) <= iVar5)))) { local_778 = 0xffffffff; } else { local_778 = iVar5 * *(int *)((int)pvVar9 + 0xc) + iVar10; } local_770 = (void *)0x0; local_76c = 0; local_768 = (undefined1 *)0x0; local_774 = 0; local_8 = 1; auStack_7 = (undefined1 [3])0x0; ExceptionList = &local_10; local_18 = uVar4; vector_PathNode_emplace_reallocate_copy(&local_764,(void *)0x0,&local_778); pvVar9 = local_750; local_734 = auStackY_840 + 0x8c; pbVar18 = (byte *)0x0; pbVar19 = (byte *)0x0; pbVar20 = (byte *)0x0; uVar11 = local_758; unused_1 = local_754; puVar7 = auStackY_840 + 0x8c; if (local_750 != local_74c) { local_730 = (undefined1 *)((int)local_74c - (int)local_750); puVar7 = local_744; puVar3 = auStackY_840 + 0x8c; if (0x3fffffff < (uint)((int)local_730 >> 2)) { LAB_007e7fa0: local_734 = puVar3; local_744 = puVar7; /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar17 = ((int)local_730 >> 2) * 4; pbVar6 = std::_Allocate(uVar17); pbVar20 = pbVar6 + uVar17; pbVar18 = pbVar6; pbVar19 = pbVar6; memmove(pbVar6,pvVar9,(size_t)local_730); *(byte **)(local_734 + 0xc) = pbVar6 + uVar17; puVar7 = local_734; } local_734 = puVar7; puVar13 = local_760; color._green = (float)unaff_EDI; color._red = (float)uVar4; color._blue = (float)unaff_ESI; color._alpha = (float)unaff_EBX; color._unk = in_stack_fffff870; KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (local_764,(uint)local_760,uVar11,unused_1,pbVar18,(uint)pbVar19,(uint)pbVar20,color); local_8 = 0; if (local_770 != (void *)0x0) { uVar11 = ((int)local_768 - (int)local_770 >> 2) * 4; pvVar9 = local_770; if (0xfff < uVar11) { pvVar9 = *(void **)((int)local_770 + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)local_770 + (-4 - (int)pvVar9))) goto LAB_007e7f6e; } operator_delete(pvVar9,uVar11); } local_729 = '\0'; piVar14 = (int *)((int)g_game->_room + 0x76c); piVar16 = local_728; for (iVar5 = 0x1c0; iVar5 != 0; iVar5 = iVar5 + -1) { *piVar16 = *piVar14; piVar14 = piVar14 + 1; piVar16 = piVar16 + 1; } puVar15 = local_764; if (local_764 != puVar13) { while (puVar15 = local_764, local_729 == '\0') { local_738 = (void *)*local_764; local_734 = (undefined1 *)local_764[2]; local_73c = local_764[1]; local_77c = (undefined1 *)0x0; local_730 = (undefined1 *)0x0; if (local_734 != (undefined1 *)local_764[3]) { local_730 = (undefined1 *)(local_764[3] - (int)local_734); puVar7 = local_744; puVar3 = local_734; if (0x3fffffff < (uint)((int)local_730 >> 2)) goto LAB_007e7fa0; uVar11 = ((int)local_730 >> 2) * 4; puVar7 = std::_Allocate(uVar11); local_77c = puVar7 + uVar11; memmove(puVar7,local_734,(size_t)local_730); local_730 = puVar7; } puVar2 = local_730; puVar15 = local_764; local_8 = 2; if ((*(int *)((int)g_game->_room + 0x10) * *(int *)((int)g_game->_room + 0xc)) / 2 <= (int)local_73c) { if (local_730 != (undefined1 *)0x0) { uVar4 = (int)local_77c - (int)local_730 & 0xfffffffc; puVar7 = local_730; if (0xfff < uVar4) { puVar7 = *(undefined1 **)(local_730 + -4); uVar4 = uVar4 + 0x23; if ((undefined1 *)0x1f < local_730 + (-4 - (int)puVar7)) goto LAB_007e7f6e; } operator_delete(puVar7,uVar4); } break; } std::priority_queue::pop(); pvVar9 = g_game->_room; iVar10 = *(int *)((int)pvVar9 + 0xc); iVar12 = (int)local_738 % iVar10; iVar8 = (int)local_738 / iVar10; iVar5 = iVar12 + -1; if ((((iVar5 < 0) || (iVar10 <= iVar5)) || (iVar8 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar8)) { local_28[0] = 0xffffffff; if (-1 < iVar12) goto LAB_007e7c11; LAB_007e7c27: local_28[1] = -1; } else { local_28[0] = iVar10 * iVar8 + iVar5; LAB_007e7c11: iVar5 = iVar8 + -1; if (((iVar10 <= iVar12) || (iVar5 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar5)) goto LAB_007e7c27; local_28[1] = iVar10 * iVar5 + iVar12; } iVar5 = iVar12 + 1; if (((iVar5 < 0) || (iVar10 <= iVar5)) || ((iVar8 < 0 || (*(int *)((int)pvVar9 + 0x10) <= iVar8)))) { local_28[2] = -1; } else { local_28[2] = iVar10 * iVar8 + iVar5; } iVar8 = iVar8 + 1; if ((((iVar12 < 0) || (iVar10 <= iVar12)) || (iVar8 < 0)) || (*(int *)((int)pvVar9 + 0x10) <= iVar8)) { local_28[3] = -1; } else { local_28[3] = iVar10 * iVar8 + iVar12; } local_730 = (undefined1 *)0x0; puVar13 = local_760; do { local_778 = local_28[(int)local_730]; local_738 = (void *)0x0; local_770 = (void *)0x0; local_76c = 0; local_734 = (undefined1 *)0x0; local_768 = (undefined1 *)0x0; local_774 = local_73c; local_8 = 3; if (((-1 < (int)local_778) && (-1 < local_728[local_778])) && (local_728[local_778] < 0x3b6) ) { local_774 = local_73c + 1; local_728[local_778] = -local_774; if (local_778 == local_740) { local_729 = '\x01'; break; } if (puVar13 == local_75c) { vector_PathNode_emplace_reallocate(&local_764,puVar13,&local_778); local_734 = local_768; local_738 = local_770; } else { *puVar13 = local_778; puVar13[1] = local_774; puVar13[2] = 0; puVar13[3] = 0; puVar13[4] = 0; local_760 = puVar13 + 5; } puVar13 = local_760; local_744 = auStackY_840 + 0x8c; pbVar18 = (byte *)0x0; pbVar19 = (byte *)0x0; pbVar20 = (byte *)0x0; uVar11 = local_758; pvVar9 = local_754; local_770 = local_738; local_768 = local_734; puVar7 = auStackY_840 + 0x8c; if (local_750 != local_74c) { in_stack_fffff870 = (int)local_74c - (int)local_750; puVar7 = auStackY_840 + 0x8c; puVar3 = local_734; if (0x3fffffff < (uint)((int)in_stack_fffff870 >> 2)) goto LAB_007e7fa0; uVar17 = ((int)in_stack_fffff870 >> 2) * 4; pbVar6 = std::_Allocate(uVar17); pbVar20 = pbVar6 + uVar17; pbVar18 = pbVar6; pbVar19 = pbVar6; memmove(pbVar6,local_750,in_stack_fffff870); *(byte **)(local_744 + 0xc) = pbVar6 + uVar17; puVar7 = local_744; } local_744 = puVar7; color_00._green = (float)unaff_EDI; color_00._red = (float)uVar4; color_00._blue = (float)unaff_ESI; color_00._alpha = (float)unaff_EBX; color_00._unk = in_stack_fffff870; KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (local_764,(uint)puVar13,uVar11,pvVar9,pbVar18,(uint)pbVar19,(uint)pbVar20, color_00); } puVar7 = local_730; local_8 = 2; if (local_738 != (void *)0x0) { uVar11 = (int)local_734 - (int)local_738 & 0xfffffffc; pvVar9 = local_738; if (0xfff < uVar11) { pvVar9 = *(void **)((int)local_738 + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)local_738 + (-4 - (int)pvVar9))) goto LAB_007e7f6e; } operator_delete(pvVar9,uVar11); } local_730 = puVar7 + 1; } while (local_730 < &DAT_00000004); local_8 = 0; if (puVar2 != (undefined1 *)0x0) { uVar11 = (int)local_77c - (int)puVar2 & 0xfffffffc; puVar7 = puVar2; if (0xfff < uVar11) { puVar7 = *(undefined1 **)(puVar2 + -4); uVar11 = uVar11 + 0x23; if ((undefined1 *)0x1f < puVar2 + (-4 - (int)puVar7)) goto LAB_007e7f6e; } operator_delete(puVar7,uVar11); } puVar15 = local_764; if (local_764 == puVar13) break; } } if (local_750 != (void *)0x0) { uVar4 = local_748 - (int)local_750 & 0xfffffffc; pvVar9 = local_750; if (0xfff < uVar4) { pvVar9 = *(void **)((int)local_750 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_750 + (-4 - (int)pvVar9))) goto LAB_007e7f6e; } operator_delete(pvVar9,uVar4); } puVar1 = puVar15; if (puVar15 != (uint *)0x0) { for (; puVar1 != puVar13; puVar1 = puVar1 + 5) { FID_conflict__Tidy(puVar1 + 2); } uVar4 = (((int)local_75c - (int)puVar15) / 0x14) * 0x14; puVar13 = puVar15; if (0xfff < uVar4) { puVar13 = (uint *)puVar15[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)puVar15 + (-4 - (int)puVar13))) { LAB_007e7f6e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar13,uVar4); } ExceptionList = local_10; return local_729; } //@@ 007e7fb0 FUN_007e7fb0 uint FUN_007e7fb0(uint param_1) { int iVar1; uint uVar2; int *in_ECX; if (*in_ECX != 0) { iVar1 = *(int *)(*in_ECX + 0x184); if (iVar1 == 6) { uVar2 = param_1 - 3000; if (999 < param_1 - 3000) { uVar2 = param_1; } return uVar2; } if (iVar1 != 5) { uVar2 = param_1 - 1000; if (999 < param_1 - 1000) { uVar2 = param_1; } if (uVar2 - 3000 < 1000) { uVar2 = uVar2 - 3000; } return uVar2; } } return param_1; } //@@ 007e8010 NPCAI_Pathfinder::SimulatePlayerMovement /* ZHL [exact] __thiscall void NPCAI_Pathfinder::SimulatePlayerMovement(Vector * movementInput, float speed, bool unused); */ void __thiscall NPCAI_Pathfinder::SimulatePlayerMovement(NPCAI_Pathfinder *this,float *param_2) { int *piVar1; int iVar2; void *pvVar3; int iVar4; byte isClamped; uint uVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float in_XMM2_Da; float fVar13; float local_58; float local_54; float local_50; float local_44; int local_40; local_44 = *param_2; local_54 = param_2[1]; iVar2 = *(int *)((int)this->_entity + 0x184); if (((*(uint *)((int)this->_entity + 0x168) & 0x8000) != 0) && (iVar2 == 5)) { local_54 = 0.0; } fVar6 = sqrtf(local_54 * local_54 + local_44 * local_44); if ((1.0 < fVar6) && (0.0 < fVar6)) { local_44 = *param_2 * (1.0 / fVar6); local_54 = local_54 * (1.0 / fVar6); } fVar6 = in_XMM2_Da * 0.25 + 0.75; fVar13 = fVar6 * local_54; fVar6 = fVar6 * local_44; (this->_moveDirection).y = fVar13; (this->_moveDirection).x = fVar6; this->_direction = -1; if (ABS(fVar6) <= ABS(fVar13)) { if (fVar13 < 0.0) { this->_direction = 1; goto LAB_007e813f; } iVar4 = this->_direction; if (0.0 < fVar13) { iVar4 = 3; } } else { iVar4 = 0; if (0.0 <= fVar6) { iVar4 = 2; } } this->_direction = iVar4; LAB_007e813f: pvVar3 = this->_entity; if ((*(uint *)((int)pvVar3 + 0x168) & 0x8000000) == 0) { piVar1 = &this->_moveCountdown; *piVar1 = *piVar1 + -1; iVar4 = this->_moveCountdown; if (*piVar1 < 0) { this->_moveCountdown = 0; iVar4 = 0; } } else { this->_moveCountdown = 0x3c; iVar4 = 0x3c; } uVar5 = *(uint *)((int)pvVar3 + 0x168); local_50 = ((float)iVar4 - 0.0) / 60.0; if ((uVar5 & 0x80) != 0) { local_50 = 0.0; } local_58 = *(float *)((int)pvVar3 + 0x364) * 0.5; local_54 = *(float *)((int)pvVar3 + 0x360) * 0.5; fVar8 = local_50; fVar7 = Math::lerp(-0.2,0.5,local_50,0); fVar8 = Math::lerp(0.775,0.96,fVar8,isClamped); fVar8 = sqrtf(fVar8); uVar5 = uVar5 & 0x8000; local_40 = 2; do { if (((fVar6 != 0.0) || (fVar13 != 0.0)) && ((uVar5 == 0 || (iVar2 != 5)))) { fVar11 = local_58 * fVar13 + local_54 * fVar6; fVar12 = fVar11 * fVar13; fVar11 = fVar11 * fVar6; fVar9 = Math::lerp(0.8,1.0,local_50,0); fVar9 = sqrtf(fVar9); local_54 = (local_54 - fVar11) * fVar9 + fVar11; local_58 = (local_58 - fVar12) * fVar9 + fVar12; } fVar11 = fVar7 * (local_58 * fVar13 + local_54 * fVar6); if (fVar11 <= 0.0) { fVar11 = 0.0; } fVar11 = (fVar11 / in_XMM2_Da + 3.0) * 0.4; fVar11 = (fVar11 * 0.25 - fVar11) * local_50 + fVar11; fVar9 = local_54 + fVar6 * 0.5 * fVar11; fVar11 = local_58 + fVar13 * 0.5 * fVar11; if (((0.0 < local_50) && (fVar12 = fVar9 * fVar9 + fVar11 * fVar11, in_XMM2_Da * 4.41 * in_XMM2_Da * 4.41 < fVar12)) && (fVar12 = sqrtf(fVar12), 0.0 < fVar12)) { fVar10 = sqrtf(local_58 * local_58 + local_54 * local_54); fVar11 = (fVar10 / fVar12) * fVar11; fVar9 = (fVar10 / fVar12) * fVar9; } local_54 = fVar9 * fVar8; if ((uVar5 == 0) || (iVar2 != 5)) { local_58 = fVar11 * fVar8; } else { local_58 = fVar11 + 0.225; } local_40 = local_40 + -1; } while (local_40 != 0); *(float *)((int)pvVar3 + 0x360) = local_54 + local_54; *(float *)((int)pvVar3 + 0x364) = local_58 + local_58; return; } //@@ 007e84c0 std::priority_queue::pop /* DB: ? pops the top of a binary heap of 0x14-byte nodes (each with a vector at +8): moves the last element down via 007e8d60 std::_Pop_heap_unchecked and shrinks the vector by 0x14; callers NPCAI_Pathfinder::HasPathToPos and pathfinder_can_reach_pos (A* open list) */ void std::priority_queue::pop(void) { int iVar1; int iVar2; uint uVar3; int *in_ECX; undefined1 local_3c [8]; undefined1 local_34 [12]; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00b15; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; iVar1 = *in_ECX; iVar2 = in_ECX[1]; local_14 = iVar1; PathNode::PathNode(local_3c,in_ECX + 3); local_8 = 0; if (1 < (iVar2 - iVar1) / 0x14) { local_28 = *(undefined4 *)(iVar2 + -0x14); local_24 = *(undefined4 *)(iVar2 + -0x10); local_18 = *(undefined4 *)(iVar2 + -4); local_1c = *(undefined4 *)(iVar2 + -8); local_20 = *(undefined4 *)(iVar2 + -0xc); *(undefined4 *)(iVar2 + -4) = 0; *(undefined4 *)(iVar2 + -8) = 0; *(undefined4 *)(iVar2 + -0xc) = 0; local_8 = 1; _Pop_heap_unchecked(iVar2 + -0x14,&local_28,local_3c,uVar3); FID_conflict__Tidy(&local_20); } FID_conflict__Tidy(local_34); FID_conflict__Tidy((void *)(in_ECX[1] + -0xc)); in_ECX[1] = in_ECX[1] + -0x14; ExceptionList = local_10; return; } //@@ 007e85a0 FUN_007e85a0 void FUN_007e85a0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; uint width; void *implicit_output; undefined4 *in_ECX; undefined4 unaff_EBX; undefined4 unaff_EBP; undefined4 unaff_ESI; undefined4 unaff_EDI; KColor color; int unaff_retaddr; undefined1 auStackY_ac [128]; uint in_stack_ffffffdc; void *in_stack_ffffffe0; byte *in_stack_ffffffe4; undefined4 *in_stack_ffffffe8; undefined4 *where; undefined4 *in_stack_ffffffec; undefined8 in_stack_fffffff0; undefined1 auVar4 [16]; undefined1 auVar5 [16]; auVar4._8_4_ = unaff_EBX; auVar4._0_8_ = in_stack_fffffff0; auVar4._12_4_ = unaff_EBP; auVar5._8_8_ = auVar4._8_8_; auVar5._4_4_ = unaff_ESI; auVar5._0_4_ = unaff_EDI; where = (undefined4 *)in_ECX[1]; if (where == (undefined4 *)in_ECX[2]) { in_stack_ffffffe4 = (byte *)0x7e85f3; vector_PathNode_emplace_reallocate_copy(in_ECX,where,param_1); in_stack_ffffffec = param_1; } else { *where = *param_1; where[1] = param_1[1]; uVar1 = param_1[4]; uVar2 = param_1[3]; uVar3 = param_1[2]; param_1[4] = 0; param_1[3] = 0; param_1[2] = 0; where[2] = uVar3; where[3] = uVar2; where[4] = uVar1; in_ECX[1] = in_ECX[1] + 0x14; where = in_stack_ffffffe8; } width = in_ECX[1]; implicit_output = (void *)*in_ECX; PathNode::PathNode(auStackY_ac + 0x88,in_ECX + 3); color._unk = unaff_retaddr; color._red = (float)auVar5._0_4_; color._green = (float)auVar5._4_4_; color._blue = (float)auVar5._8_4_; color._alpha = (float)auVar5._12_4_; KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (implicit_output,width,in_stack_ffffffdc,in_stack_ffffffe0,in_stack_ffffffe4,(uint)where ,(uint)in_stack_ffffffec,color); return; } //@@ 007e8620 FUN_007e8620 void FUN_007e8620(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FID_conflict__Tidy((void *)((int)pvVar1 + 8)); pvVar1 = (void *)((int)pvVar1 + 0x14); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x14) * 0x14; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 007e86b0 std::vector<8byte>::reserve /* DB: _Xlen guard */ void std::vector<8byte>::reserve(uint param_1) { int *in_ECX; if (param_1 <= (uint)(in_ECX[2] - *in_ECX >> 3)) { return; } if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } _Reallocate_exactly(); return; } //@@ 007e86e0 FUN_007e86e0 void FUN_007e86e0(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x14) { FID_conflict__Tidy((void *)(param_1 + 8)); } return; } //@@ 007e8710 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x14; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 007e8750 KAGE_Graphics_ImageManager::CreateProceduralImage_Internal /* ZHL [prefix47/54] static KAGE_SmartPointer_ImageBase* KAGE_Graphics_ImageManager::CreateProceduralImage_Internal(KAGE_SmartPointer_ImageBase* implicit_output, uint32_t width, uint32_t height, void* unused_1, const char* name, uint32_t unused_2, uint32_t unused_3, KColor color); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ void * __cdecl KAGE_Graphics_ImageManager::CreateProceduralImage_Internal (void *implicit_output,uint width,uint height,void *unused_1,byte *name,uint unused_2, uint unused_3,KColor color) { uint uVar1; void *extraout_EAX; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b00b55; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (1 < (int)(width - (int)implicit_output) / 0x14) { local_24 = *(undefined4 *)(width - 0x14); local_14 = *(undefined4 *)(width - 4); local_18 = *(undefined4 *)(width - 8); local_20 = *(undefined4 *)(width - 0x10); local_1c = *(undefined4 *)(width - 0xc); *(undefined4 *)(width - 4) = 0; *(undefined4 *)(width - 8) = 0; *(undefined4 *)(width - 0xc) = 0; local_8 = 1; FUN_007e8b50(width,&local_24,&height,uVar1); FID_conflict__Tidy(&local_1c); } FID_conflict__Tidy(&name); ExceptionList = local_10; return extraout_EAX; } //@@ 007e8810 vector_PathNode_emplace_reallocate_copy /* DB: ? second std::vector<0x14-byte element>::_Emplace_reallocate (copies 5 dwords of param_2) for the same pathfinder node vector as 007e8950; NPCAI_Pathfinder::HasPathToPos, pathfinder_can_reach_pos prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall vector_PathNode_emplace_reallocate_copy(void *this,void *where,void *value) { uint uVar1; undefined4 *puVar2; uint uVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; int iVar7; undefined4 *puVar8; uint uVar9; undefined4 *puVar10; undefined4 uVar11; iVar4 = *(int *)this; iVar7 = (*(int *)((int)this + 4) - iVar4) / 0x14; if (iVar7 == 0xccccccc) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar7 + 1; uVar3 = (*(int *)((int)this + 8) - iVar4) / 0x14; if (0xccccccc - (uVar3 >> 1) < uVar3) { uVar9 = 0xccccccc; } else { uVar3 = (uVar3 >> 1) + uVar3; uVar9 = uVar1; if (uVar1 <= uVar3) { uVar9 = uVar3; } if (0xccccccc < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar8 = std::_Allocate(uVar9 * 0x14); puVar2 = puVar8 + (((int)where - iVar4) / 0x14) * 5; *puVar2 = *(undefined4 *)value; puVar2[1] = *(undefined4 *)((int)value + 4); uVar11 = *(undefined4 *)((int)value + 0x10); uVar5 = *(undefined4 *)((int)value + 0xc); *(undefined4 *)((int)value + 0x10) = 0; *(undefined4 *)((int)value + 0xc) = 0; uVar6 = *(undefined4 *)((int)value + 8); *(undefined4 *)((int)value + 8) = 0; puVar2[2] = uVar6; puVar2[3] = uVar5; puVar2[4] = uVar11; uVar11 = *(undefined4 *)this; puVar10 = puVar8; if (where != *(void **)((int)this + 4)) { std::_Uninitialized_move(puVar8,uVar11); puVar10 = puVar2 + 5; } std::_Uninitialized_move(puVar10,uVar11); std::vector::_Change_array(puVar8,uVar1,uVar9); return puVar2; } //@@ 007e8950 vector_PathNode_emplace_reallocate /* DB: ? std::vector<0x14-byte element>::_Emplace_reallocate (max 0xccccccc); only callers are PathFinder::FindGridPath, NPCAI_Pathfinder::HasPathToPos, pathfinder_can_reach_pos (open-list nodes) prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall vector_PathNode_emplace_reallocate(void *this,void *where,void *value) { void *this_00; uint uVar1; int iVar2; int iVar3; void *pvVar4; uint uVar5; void *pvVar6; undefined4 uVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00b80; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *(int *)this; iVar3 = (*(int *)((int)this + 4) - iVar2) / 0x14; if (iVar3 == 0xccccccc) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = (*(int *)((int)this + 8) - iVar2) / 0x14; if (0xccccccc - (uVar1 >> 1) < uVar1) { uVar5 = 0xccccccc; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0xccccccc < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = std::_Allocate(uVar5 * 0x14); local_8 = 0; this_00 = (void *)((int)pvVar4 + (((int)where - iVar2) / 0x14) * 0x14); PathNode::PathNode(this_00,value); uVar7 = *(undefined4 *)this; pvVar6 = pvVar4; if (where != *(void **)((int)this + 4)) { std::_Uninitialized_move(pvVar4,uVar7); pvVar6 = (void *)((int)this_00 + 0x14); } std::_Uninitialized_move(pvVar6,uVar7); std::vector::_Change_array(pvVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return this_00; } //@@ 007e8a8b Catch_All@007e8a8b void Catch_All_007e8a8b(void) { int unaff_EBP; FUN_007e86e0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 007e8ac0 std::vector::_Change_array /* DB: destroys old 0x14-byte PathNodes (_Tidy vector at +8), frees, installs new buffer; vector_PathNode_emplace_reallocate(_copy) */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FID_conflict__Tidy((void *)((int)pvVar1 + 8)); pvVar1 = (void *)((int)pvVar1 + 0x14); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x14) * 0x14; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x14; in_ECX[2] = param_1 + param_3 * 0x14; return; } //@@ 007e8b50 FUN_007e8b50 void FUN_007e8b50(undefined4 param_1,undefined4 *param_2) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *puVar3; bool bVar4; int iVar5; int in_ECX; int in_EDX; int iVar6; undefined4 *puVar7; undefined1 local_40 [4]; int local_3c; undefined1 local_38 [12]; undefined1 local_2c [4]; int local_28; undefined1 local_24 [12]; undefined4 *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00bad; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; if (0 < in_EDX) { do { iVar5 = local_14; iVar6 = in_EDX + -1 >> 1; PathNode::PathNode(local_40,param_2); local_8 = 0; local_18 = (undefined4 *)(iVar5 + iVar6 * 0x14); PathNode::PathNode(local_2c,local_18); local_8 = 0xffffffff; bVar4 = local_28 <= local_3c; FID_conflict__Tidy(local_24); FID_conflict__Tidy(local_38); puVar2 = local_18; if (bVar4) break; puVar3 = (undefined4 *)(local_14 + in_EDX * 0x14); puVar1 = puVar3 + 2; *puVar3 = *local_18; puVar7 = local_18 + 2; puVar3[1] = local_18[1]; if (puVar1 != puVar7) { FID_conflict__Tidy(puVar1); *puVar1 = *puVar7; puVar3[3] = puVar2[3]; puVar3[4] = puVar2[4]; *puVar7 = 0; puVar2[3] = 0; puVar2[4] = 0; } in_EDX = iVar6; } while (0 < iVar6); in_ECX = local_14; } puVar3 = (undefined4 *)(in_ECX + in_EDX * 0x14); puVar2 = puVar3 + 2; puVar1 = param_2 + 2; *puVar3 = *param_2; puVar3[1] = param_2[1]; if (puVar2 != puVar1) { FID_conflict__Tidy(puVar2); *puVar2 = *puVar1; puVar3[3] = param_2[3]; puVar3[4] = param_2[4]; *puVar1 = 0; param_2[3] = 0; param_2[4] = 0; } ExceptionList = local_10; return; } //@@ 007e8c90 std::_Uninitialized_move /* DB: moves 0x14-byte PathNodes (steals the vector at +8, zeroes source); vector_PathNode_emplace_reallocate(_copy) */ undefined4 * std::_Uninitialized_move(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 3; do { *puVar6 = puVar5[-3]; puVar6[1] = puVar5[-2]; uVar2 = *puVar5; uVar3 = puVar5[1]; uVar4 = puVar5[-1]; puVar5[1] = 0; *puVar5 = 0; puVar5[-1] = 0; *(undefined4 *)((int)param_1 + (-0x14 - (int)in_ECX) + (int)(puVar5 + 5)) = uVar2; puVar1 = puVar5 + 2; puVar6[2] = uVar4; puVar6[4] = uVar3; puVar6 = puVar6 + 5; puVar5 = puVar5 + 5; } while (puVar1 != in_EDX); } return puVar6; } //@@ 007e8d00 FUN_007e8d00 void FUN_007e8d00(undefined4 *param_1) { undefined4 *puVar1; undefined4 *this; undefined4 *in_ECX; puVar1 = param_1 + 2; this = in_ECX + 2; *in_ECX = *param_1; in_ECX[1] = param_1[1]; if (this != puVar1) { FID_conflict__Tidy(this); *this = *puVar1; in_ECX[3] = param_1[3]; in_ECX[4] = param_1[4]; *puVar1 = 0; param_1[3] = 0; param_1[4] = 0; } return; } //@@ 007e8d60 std::_Pop_heap_unchecked /* DB: moves the top (ECX) PathNode into param, sift-down over the 0x14-byte node heap (ECX..EDX); std::priority_queue::pop, PathFinder::FindGridPath */ void std::_Pop_heap_unchecked(undefined4 *param_1,undefined4 param_2,undefined4 param_3) { undefined4 *puVar1; int *piVar2; int *piVar3; void *pvVar4; bool bVar5; int iVar6; uint uVar7; uint size; undefined4 *in_ECX; void *ptr; int iVar8; uint in_EDX; undefined4 *puVar9; undefined1 local_4c [4]; int local_48; undefined1 local_44 [12]; undefined1 local_38 [4]; int local_34; undefined1 local_30 [12]; int local_24; int local_20; int local_1c; uint local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00bdd; local_10 = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; puVar1 = in_ECX + 2; *param_1 = *in_ECX; param_1[1] = in_ECX[1]; puVar9 = param_1 + 2; local_14 = in_ECX; if (puVar9 != puVar1) { local_18 = in_EDX; FID_conflict__Tidy(puVar9); *puVar9 = *puVar1; param_1[3] = in_ECX[3]; param_1[4] = in_ECX[4]; *puVar1 = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_EDX = local_18; } param_1 = (undefined4 *)0x0; local_18 = (int)(in_EDX - (int)in_ECX) / 0x14; local_24 = local_18 - 1; local_20 = local_24 >> 1; iVar8 = 0; if (0 < local_20) { do { local_1c = (int)param_1 * 2; PathNode::PathNode(local_4c,in_ECX + (int)param_1 * 10 + 10 + -5); local_8 = 0; PathNode::PathNode(local_38,in_ECX + (int)param_1 * 10 + 10); local_8 = 0xffffffff; bVar5 = local_48 < local_34; FID_conflict__Tidy(local_30); FID_conflict__Tidy(local_44); local_1c = (bVar5 ^ 1) + local_1c + 1; puVar1 = local_14 + local_1c * 5; piVar2 = puVar1 + 2; puVar9 = local_14 + (int)param_1 * 5; piVar3 = puVar9 + 2; *puVar9 = *puVar1; puVar9[1] = puVar1[1]; if (piVar3 != piVar2) { pvVar4 = (void *)*piVar3; if (pvVar4 != (void *)0x0) { size = puVar9[4] - (int)pvVar4 & 0xfffffffc; ptr = pvVar4; if (0xfff < size) { ptr = *(void **)((int)pvVar4 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *piVar3 = 0; puVar9[3] = 0; puVar9[4] = 0; } *piVar3 = *piVar2; puVar9[3] = puVar1[3]; puVar9[4] = puVar1[4]; *piVar2 = 0; puVar1[3] = 0; puVar1[4] = 0; } param_1 = (undefined4 *)local_1c; in_ECX = local_14; } while (local_1c < local_20); iVar8 = local_1c; } iVar6 = local_24; if ((iVar8 == local_20) && ((local_18 & 1) == 0)) { FUN_007e8d00(in_ECX + local_18 * 5 + -5); iVar8 = iVar6; } FUN_007e8b50(iVar8,param_2,param_3,uVar7); ExceptionList = local_10; return; } //@@ 007e8f70 FUN_007e8f70 void FUN_007e8f70(void) { undefined4 *in_ECX; *(undefined8 *)(in_ECX + 1) = 0x900000005; in_ECX[3] = 7; *in_ECX = 0xaa17414f; return; } //@@ 007e8f90 RNG::game_constructor /* ZHL [exact] __thiscall void RNG::game_constructor(unsigned int seed, unsigned int shiftidx); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall RNG::game_constructor(RNG *this,uint seed,uint shiftidx) { undefined8 uVar1; int iVar2; this->_seed = seed; if (0x50 < shiftidx) { KAGE_LogMessage(0x10,(byte *)"RNG: Invalid ShiftIdx\n"); } uVar1 = *(undefined8 *)(&DAT_00b1f4c8 + shiftidx * 0xc); iVar2 = *(int *)(&DAT_00b1f4d0 + shiftidx * 0xc); this->_shift1 = (int)uVar1; this->_shift2 = (int)((ulonglong)uVar1 >> 0x20); this->_shift3 = iVar2; return; } //@@ 007e8fe0 RNG::SetSeed /* ZHL [exact] __thiscall void RNG::SetSeed(unsigned int Seed, unsigned int ShiftIdx); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall RNG::SetSeed(RNG *this,uint Seed,uint ShiftIdx) { undefined8 uVar1; int iVar2; uint uVar3; uint uVar4; this->_seed = Seed; uVar4 = -(uint)(ShiftIdx != 0) & ShiftIdx; uVar3 = 0x50; if (uVar4 < 0x50) { uVar3 = uVar4; } uVar1 = *(undefined8 *)(&DAT_00b1f4c8 + uVar3 * 0xc); iVar2 = *(int *)(&DAT_00b1f4d0 + uVar3 * 0xc); this->_shift1 = (int)uVar1; this->_shift2 = (int)((ulonglong)uVar1 >> 0x20); this->_shift3 = iVar2; return; } //@@ 007e9020 RNG::RandomInt /* ZHL [exact] __thiscall unsigned int RNG::RandomInt(unsigned int max); prototype: REPENTOGON, confirmed by RET 4 */ uint __thiscall RNG::RandomInt(RNG *this,uint max) { code *pcVar1; uint uVar2; uVar2 = this->_seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = this->_seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } } uVar2 = uVar2 >> ((byte)this->_shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)this->_shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)this->_shift3 & 0x1f) ^ uVar2; this->_seed = uVar2; if (max == 0) { return 0; } return uVar2 % max; } //@@ 007e9080 RNG::RandomFloat /* DB: src/rooms decompile labels (RNG::RandomFloat) prototype: REPENTOGON */ float __thiscall RNG::RandomFloat(RNG *this) { code *pcVar1; uint uVar2; float10 fVar3; RNG *pRVar4; uVar2 = this->_seed; if (uVar2 == 0) { pRVar4 = this; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = this->_seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); fVar3 = (float10)(*pcVar1)(pRVar4); return (float)fVar3; } } uVar2 = uVar2 >> ((byte)this->_shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)this->_shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)this->_shift3 & 0x1f) ^ uVar2; this->_seed = uVar2; return (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283062e-10 ; } //@@ 007e90f0 RNG::Next /* DB: src/rooms decompile labels (RNG::Next) prototype: REPENTOGON */ uint __thiscall RNG::Next(RNG *this) { code *pcVar1; uint uVar2; uVar2 = this->_seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = this->_seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); uVar2 = (*pcVar1)(); return uVar2; } } uVar2 = uVar2 >> ((byte)this->_shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)this->_shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)this->_shift3 & 0x1f) ^ uVar2; this->_seed = uVar2; return uVar2; } //@@ 007e9130 Entity::GetBossID /* ZHL [lua] Lua binding Entity:GetBossID */ undefined4 __thiscall Entity::GetBossID(Entity *this) { if (this->_config == (void *)0x0) { return 0; } return *(undefined4 *)((int)this->_config + 0x30); } //@@ 007e9150 FUN_007e9150 void FUN_007e9150(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 2; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xfffffffd; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 007e9170 FUN_007e9170 void FUN_007e9170(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 0x20; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xffffffdf; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 007e9190 RoomDescriptor::NoReward /* ZHL [lua] Lua binding RoomDescriptor:NoReward */ uint __thiscall RoomDescriptor::NoReward(RoomDescriptor *this) { return CONCAT31((uint3)((uint)this->Flags >> 0xf),(char)((uint)this->Flags >> 7)) & 0xffffff01; } //@@ 007e91a0 Room::GetRedHeartDamage /* ZHL [lua] Lua binding Room:GetRedHeartDamage */ byte __thiscall Room::GetRedHeartDamage(Room *this) { return this->_redHeartDamage; } //@@ 007e91b0 Room::SetFloorColor /* ZHL [lua] Lua binding Room:SetFloorColor */ void __thiscall Room::SetFloorColor(Room *this,float param_2,float param_3,float param_4,float param_5,float param_6 ,float param_7,float param_8,float param_9,undefined8 param_10,float param_11) { if (&this->_floorColor != (ColorMod *)¶m_2) { (this->_floorColor)._tint[0] = param_2; (this->_floorColor)._tint[1] = param_3; (this->_floorColor)._tint[2] = param_4; (this->_floorColor)._tint[3] = param_5; (this->_floorColor)._colorize[0] = param_6; (this->_floorColor)._colorize[1] = param_7; (this->_floorColor)._colorize[2] = param_8; (this->_floorColor)._colorize[3] = param_9; *(undefined8 *)(this->_floorColor)._offset = param_10; (this->_floorColor)._offset[2] = param_11; } return; } //@@ 007e91f0 Room::SetWallColor /* ZHL [lua] Lua binding Room:SetWallColor */ void __thiscall Room::SetWallColor(Room *this,float param_2,float param_3,float param_4,float param_5,float param_6, float param_7,float param_8,float param_9,undefined8 param_10,float param_11) { if (&this->_wallColor != (ColorMod *)¶m_2) { (this->_wallColor)._tint[0] = param_2; (this->_wallColor)._tint[1] = param_3; (this->_wallColor)._tint[2] = param_4; (this->_wallColor)._tint[3] = param_5; (this->_wallColor)._colorize[0] = param_6; (this->_wallColor)._colorize[1] = param_7; (this->_wallColor)._colorize[2] = param_8; (this->_wallColor)._colorize[3] = param_9; *(undefined8 *)(this->_wallColor)._offset = param_10; (this->_wallColor)._offset[2] = param_11; } return; } //@@ 007e9230 Entity_Laser::GetEndPoint /* ZHL [lua] Lua binding EntityLaser:GetEndPoint */ Vector * __thiscall Entity_Laser::GetEndPoint(Entity_Laser *this) { return &this->_endPoint; } //@@ 007e9240 Entity_Laser::IsSampleLaser /* ZHL [lua] Lua binding EntityLaser:IsSampleLaser */ bool __thiscall Entity_Laser::IsSampleLaser(Entity_Laser *this) { return this->_sampleLaser != 0; } //@@ 007e9250 Level::IsDevilRoomDisabled /* ZHL [lua] Lua binding Level:IsDevilRoomDisabled */ undefined1 Level::IsDevilRoomDisabled(void) { int in_ECX; return *(undefined1 *)(in_ECX + 9); } //@@ 007e9260 Level::DisableDevilRoom /* ZHL [lua] Lua binding Level:DisableDevilRoom */ void Level::DisableDevilRoom(void) { int in_ECX; *(undefined1 *)(in_ECX + 9) = 1; return; } //@@ 007e9270 Level::GetAngelRoomChance /* ZHL [lua] Lua binding Level:GetAngelRoomChance */ float10 __thiscall Level::GetAngelRoomChance(Level *this) { return (float10)this->_angelRoomChance; } //@@ 007e9280 Entity_Player::GetName /* ZHL [lua] Lua binding EntityPlayer:GetName */ std_string * __thiscall Entity_Player::GetName(Entity_Player *this) { std_string *psVar1; psVar1 = &this->_name; if (0xf < (this->_name)._capacity) { psVar1 = *(std_string **)psVar1->_buf; } return psVar1; } //@@ 007e92a0 Entity_Player::GetSmoothBodyRotation /* ZHL [lua] Lua binding EntityPlayer:GetSmoothBodyRotation */ float10 __thiscall Entity_Player::GetSmoothBodyRotation(Entity_Player *this) { return (float10)this->_bodyAngle; } //@@ 007e92b0 Entity_NPC::GetBossColorIdx /* ZHL [lua] Lua binding EntityNPC:GetBossColorIdx */ int __thiscall Entity_NPC::GetBossColorIdx(Entity_NPC *this) { return this->_bosscoloridx; } //@@ 007e92c0 Game::GetDonationModAngel /* ZHL [lua] Lua binding Game:GetDonationModAngel */ int __thiscall Game::GetDonationModAngel(Game *this) { return this->_donationModAngel; } //@@ 007e92d0 Game::GetLastLevelWithDamage /* ZHL [lua] Lua binding Game:GetLastLevelWithDamage */ int __thiscall Game::GetLastLevelWithDamage(Game *this) { return this->_lastLevelWithDamage; } //@@ 007e92e0 FUN_007e92e0 void FUN_007e92e0(undefined4 param_1,undefined4 param_2) { int in_ECX; *(undefined4 *)(in_ECX + 0x2650c) = param_1; *(undefined4 *)(in_ECX + 0x26510) = param_2; return; } //@@ 007e9310 Game::BossRushParTime /* ZHL [lua] Lua binding Game:BossRushParTime */ int __thiscall Game::BossRushParTime(Game *this) { return this->_bossRushParTime; } //@@ 007e9320 Game::BlueWombParTime /* ZHL [lua] Lua binding Game:BlueWombParTime */ int __thiscall Game::BlueWombParTime(Game *this) { return this->_blueWombParTime; } //@@ 007e9330 Game::SetLastDevilRoomStage /* ZHL [lua] Lua binding Game:SetLastDevilRoomStage */ void __thiscall Game::SetLastDevilRoomStage(Game *this,int param_2) { int iVar1; if (param_2 < 1) { param_2 = 0; } iVar1 = 0xd; if (param_2 < 0xd) { iVar1 = param_2; } this->_lastDevilRoomStage = iVar1; return; } //@@ 007e9360 Game::GetLastDevilRoomStage /* ZHL [lua] Lua binding Game:GetLastDevilRoomStage */ int __thiscall Game::GetLastDevilRoomStage(Game *this) { return this->_lastDevilRoomStage; } //@@ 007e9370 Game::AddTreasureRoomsVisited /* ZHL [lua] Lua binding Game:AddTreasureRoomsVisited */ void __thiscall Game::AddTreasureRoomsVisited(Game *this) { this->_treasureRoomsVisited = this->_treasureRoomsVisited + 1; return; } //@@ 007e9380 Game::GetStagesWithoutDamage /* ZHL [lua] Lua binding Game:GetStagesWithoutDamage */ int __thiscall Game::GetStagesWithoutDamage(Game *this) { return this->_stagesWithoutDamage; } //@@ 007e9390 Entity_Pickup::Charge /* ZHL [lua] Lua binding EntityPickup:Charge */ int __thiscall Entity_Pickup::Charge(Entity_Pickup *this) { return this->_charge; } //@@ 007e93a0 Entity_Pickup::AutoUpdatePrice /* ZHL [lua] Lua binding EntityPickup:AutoUpdatePrice */ byte __thiscall Entity_Pickup::AutoUpdatePrice(Entity_Pickup *this) { return this->_isAutoUpdatePrice; } //@@ 007e93b0 Entity_Pickup::Touched /* ZHL [lua] Lua binding EntityPickup:Touched */ byte __thiscall Entity_Pickup::Touched(Entity_Pickup *this) { return this->_isTouched; } //@@ 007e93c0 Entity_Pickup::ShopItemId /* ZHL [lua] Lua binding EntityPickup:ShopItemId */ int __thiscall Entity_Pickup::ShopItemId(Entity_Pickup *this) { return this->_shopItemId; } //@@ 007e93d0 FUN_007e93d0 void FUN_007e93d0(int param_1) { int iVar1; int in_ECX; if (param_1 < -1) { param_1 = -2; } iVar1 = 7; if (param_1 < 7) { iVar1 = param_1; } *(int *)(in_ECX + 0x53c) = iVar1; return; } //@@ 007e9400 Room::constructor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Room * Room::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ Room * __thiscall Room::constructor(Room *this) { int *dequeProxy; void *pvVar1; undefined4 *extraout_EAX; undefined4 *puVar2; int entriesLeft; undefined4 *puVar3; uint uVar4; float fVar5; void *redirectedPath [4]; uint redirectedPathSize; uint redirectedPathCapacity; std_string backdropsPath; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; byte *gridIndexSet; std_deque *shopItemDeque; puStack_20 = (undefined1 *)(redirectedPath + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b00d42; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(redirectedPath + 0x11); ExceptionList = &local_1c; *(undefined1 *)this = 0; this->_descriptor = (void *)0x0; this->_roomType = 0; (this->_topLeftPos).y = 0.0; (this->_topLeftPos).x = 0.0; (this->_bottomRightPos).y = 0.0; (this->_bottomRightPos).x = 0.0; this->field_0x11f6 = 1; (this->_renderSurfaceTopLeft).y = 0.0; (this->_renderSurfaceTopLeft).x = 0.0; (this->_renderScrollOffset).y = 0.0; (this->_renderScrollOffset).x = 0.0; init_render_buffers((Room *)&this->_entityList,stackCookie); local_14 = (void *)0x0; *(undefined4 *)&(this->_fxLayers).field_0x4 = 0; *(undefined4 *)&this->_fxLayers = 0; (this->_fxLayers)._loaded = 0; *(undefined4 *)&(this->_fxLayers).field_0xc = 0; *(undefined4 *)&(this->_fxLayers).field_0x10 = 0; *(undefined4 *)&(this->_fxLayers).field_0x14 = 0; *(undefined4 *)&(this->_fxLayers).field_0x18 = 0; *(undefined4 *)&(this->_fxLayers).field_0x1c = 0; *(undefined4 *)&(this->_fxLayers).field_0x20 = 0; *(undefined4 *)&(this->_fxLayers).field_0x24 = 0; *(undefined4 *)&(this->_fxLayers).field_0x28 = 0; *(undefined4 *)&(this->_fxLayers).field_0x2c = 0; FXParams::FXParams((FXParams *)&(this->_fxLayers).field_0x38); local_14._0_1_ = 3; *(undefined4 *)&(this->_fxLayers).field_0x84 = 0x3f800000; entriesLeft = 10; *(undefined4 *)&(this->_fxLayers).field_0x88 = 0x3f800000; *(undefined4 *)&(this->_fxLayers).field_0x8c = 0x3f800000; *(undefined4 *)&(this->_fxLayers).field_0x90 = 0x3f800000; *(undefined4 *)&(this->_fxLayers).field_0x94 = 0; *(undefined4 *)&(this->_fxLayers).field_0x98 = 0; *(undefined4 *)&(this->_fxLayers).field_0x9c = 0; *(undefined4 *)&(this->_fxLayers).field_0xa0 = 0; *(undefined4 *)&(this->_fxLayers).field_0xa4 = 0; *(undefined4 *)&(this->_fxLayers).field_0xa8 = 0; *(undefined4 *)&(this->_fxLayers).field_0xac = 0; *(undefined4 *)&(this->_fxLayers).field_0xb4 = 0; *(undefined4 *)&(this->_fxLayers).field_0xb0 = 0; *(undefined4 *)&(this->_fxLayers).field_0xbc = 0; *(undefined4 *)&(this->_fxLayers).field_0xb8 = 0; puVar2 = (undefined4 *)&(this->_fxLayers).field_0xc0; do { *puVar2 = 0; puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0x3f800000; puVar2[7] = 0; puVar2[8] = 0x3f800000; puVar2[9] = 0; *(undefined1 *)(puVar2 + 0xc) = 0; *(undefined8 *)(puVar2 + 1) = 0; puVar2[0xb] = 0; puVar2[10] = 0; puVar2[3] = 0; entriesLeft = entriesLeft + -1; puVar2 = puVar2 + 0xd; } while (entriesLeft != 0); _eh_vector_constructor_iterator_ (&(this->_fxLayers).field_0x2c8,0x114,2,ANM2::constructor,ANM2::~ANM2); *(undefined4 *)&(this->_fxLayers).field_0x4f4 = 0; *(undefined4 *)&(this->_fxLayers).field_0x4f0 = 0; FXParams::FXParams(&(this->_fxLayers)._fxParams); *(undefined4 *)&this->field_0x1bb8 = 0; local_14._0_1_ = 5; *(undefined4 *)&this->field_0x1bc4 = 0; *(undefined4 *)&this->field_0x1bc0 = 0; Backdrop::constructor(); local_14._0_1_ = 6; ANM2::constructor(&this->_lightSprite); local_14._0_1_ = 7; ANM2::constructor((ANM2 *)&this->field_0x6f54); local_14._0_1_ = 8; shopItemDeque = &this->_shopItemDeque; shopItemDeque->_proxy = (void *)0x0; (this->_shopItemDeque)._map = (void *)0x0; (this->_shopItemDeque)._mapSize = 0; (this->_shopItemDeque)._offset = 0; (this->_shopItemDeque)._size = 0; dequeProxy = operator_new(8); dequeProxy[1] = 0; shopItemDeque->_proxy = dequeProxy; *dequeProxy = (int)shopItemDeque; local_14._0_1_ = 9; entriesLeft = 2; puVar2 = (undefined4 *)&this->field_0x70c4; do { *puVar2 = 0xc3160000; puVar2[1] = 0; puVar2[2] = 0; puVar2[3] = 0x3c23d70a; puVar2[4] = 0x3dcccccd; puVar2[5] = 0; puVar2[6] = 5; entriesLeft = entriesLeft + -1; puVar2 = puVar2 + 7; } while (entriesLeft != 0); ANM2::constructor((ANM2 *)&this->field_0x7100); local_14._0_1_ = 10; gridIndexSet = this->_pendingGridRemovals; gridIndexSet[0] = 0; gridIndexSet[1] = 0; gridIndexSet[2] = 0; gridIndexSet[3] = 0; this->_pendingGridRemovals[4] = 0; this->_pendingGridRemovals[5] = 0; this->_pendingGridRemovals[6] = 0; this->_pendingGridRemovals[7] = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *(void **)gridIndexSet = pvVar1; local_14._0_1_ = 0xb; KColor::SetFromARGB(&this->_waterColor,0xffffffff); KColor::SetFromARGB(&this->_waterColorMultiplier,0xffffffff); KColor::SetFromARGB(&this->_waterLerpTargetColor,0xffffffff); KColor::SetFromARGB(&this->_waterLerpTargetColorMult,0xffffffff); (this->_floorColor)._tint[0] = 1.0; (this->_floorColor)._tint[1] = 1.0; (this->_floorColor)._tint[2] = 1.0; (this->_floorColor)._tint[3] = 1.0; (this->_floorColor)._colorize[0] = 0.0; (this->_floorColor)._colorize[1] = 0.0; (this->_floorColor)._colorize[2] = 0.0; (this->_floorColor)._colorize[3] = 0.0; (this->_floorColor)._offset[0] = 0.0; (this->_floorColor)._offset[1] = 0.0; (this->_floorColor)._offset[2] = 0.0; (this->_wallColor)._tint[0] = 1.0; (this->_wallColor)._tint[1] = 1.0; (this->_wallColor)._tint[2] = 1.0; (this->_wallColor)._tint[3] = 1.0; (this->_wallColor)._colorize[0] = 0.0; (this->_wallColor)._colorize[1] = 0.0; (this->_wallColor)._colorize[2] = 0.0; (this->_wallColor)._colorize[3] = 0.0; (this->_wallColor)._offset[0] = 0.0; (this->_wallColor)._offset[1] = 0.0; (this->_wallColor)._offset[2] = 0.0; *(undefined4 *)&this->field_0x7300 = 0; *(undefined4 *)&this->field_0x7304 = 0; pvVar1 = operator_new(0x20); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)&this->field_0x7300 = pvVar1; local_14._0_1_ = 0xc; gridIndexSet = this->_litGridIndices; gridIndexSet[0] = 0; gridIndexSet[1] = 0; gridIndexSet[2] = 0; gridIndexSet[3] = 0; this->_litGridIndices[4] = 0; this->_litGridIndices[5] = 0; this->_litGridIndices[6] = 0; this->_litGridIndices[7] = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *(void **)gridIndexSet = pvVar1; (this->_temporaryEffects)._effects._begin = (void *)0x0; (this->_temporaryEffects)._effects._end = (void *)0x0; (this->_temporaryEffects)._effects._capacity = (void *)0x0; (this->_temporaryEffects)._cacheFlags = 0; (this->_temporaryEffects)._shouldEvaluateCache = 0; (this->_temporaryEffects)._disabled = 0; (this->_temporaryEffects)._player = (void *)0x0; local_14._0_1_ = 0xe; _eh_vector_constructor_iterator_(this->_outputGroupGridIndices,8,10,FUN_005cbe20,FUN_00424420); local_14._0_1_ = 0xf; _eh_vector_constructor_iterator_ (this->_outputGroupCallbacks,0xc,10,FUN_00424510,FID_conflict__Tidy); local_14._0_1_ = 0x10; entriesLeft = 4; puVar2 = (undefined4 *)&this->field_0x7408; puVar3 = (undefined4 *)&this->field_0x73f4; do { puVar2[-4] = 0; *puVar3 = 0; puVar2[-2] = 0; puVar2[-3] = 0; *puVar2 = 0; puVar2[-1] = 0; entriesLeft = entriesLeft + -1; puVar2 = puVar2 + 6; puVar3 = puVar3 + 6; } while (entriesLeft != 0); (this->_waterCurrent).y = 0.0; (this->_waterCurrent).x = 0.0; (this->_railManager)._room = this; ANM2::constructor(&(this->_railManager)._sprite); local_14._0_1_ = 0x11; _eh_vector_constructor_iterator_(this->_redDoorOutlines,4,8,FUN_0042a020,FUN_00579700); local_14._0_1_ = 0x12; *(Room **)&this->field_0x776c = this; ANM2::constructor((ANM2 *)&this->field_0x7770); this->field_0x7884 = 0; *(undefined4 *)&this->field_0x7888 = 0; this->_beastBlastForce = 0.0; *(undefined4 *)&this->field_0x7890 = 0; local_14._0_1_ = 0x13; memset(this->_gridEntities,0,0x720); init_room_render_surfaces(); builtin_strncpy(backdropsPath._buf + 8,"s.xml",6); backdropsPath._capacity = 0xf; backdropsPath._size = 0xd; builtin_strncpy(backdropsPath._buf,"backdrop",8); local_14._0_1_ = 0x14; ModManager::TryRedirectPath(&g_manager->_modManager,(std_string *)redirectedPath,&backdropsPath); local_14 = (void *)CONCAT31(local_14._1_3_,0x15); puVar2 = extraout_EAX; if (0xf < (uint)extraout_EAX[5]) { puVar2 = (undefined4 *)*extraout_EAX; } Backdrop::LoadConfig(puVar2); if (0xf < redirectedPathCapacity) { uVar4 = redirectedPathCapacity + 1; pvVar1 = redirectedPath[0]; if (0xfff < uVar4) { pvVar1 = *(void **)((int)redirectedPath[0] + -4); uVar4 = redirectedPathCapacity + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)pvVar1))) goto LAB_007e9af3; } operator_delete(pvVar1,uVar4); } redirectedPathSize = 0; redirectedPathCapacity = 0xf; redirectedPath[0] = (void *)((uint)redirectedPath[0] & 0xffffff00); if (0xf < backdropsPath._capacity) { uVar4 = backdropsPath._capacity + 1; pvVar1 = (void *)backdropsPath._buf._0_4_; if (0xfff < uVar4) { pvVar1 = *(void **)(backdropsPath._buf._0_4_ + -4); uVar4 = backdropsPath._capacity + 0x24; if (0x1f < (uint)(backdropsPath._buf._0_4_ + (-4 - (int)pvVar1))) { LAB_007e9af3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,uVar4); } this->_Camera = (void *)0x0; fVar5 = g_screenHeight - 182.0; (this->_renderSurfaceTopLeft).x = (g_screenWidth - 338.0) * 0.5 - 52.0; (this->_renderSurfaceTopLeft).y = fVar5 * 0.5 - 52.0; *(undefined4 *)&this->field_0x7084 = 0; *(undefined4 *)&this->field_0x7088 = 0; *(undefined4 *)&this->field_0x708c = 0; *(undefined4 *)&this->field_0x7090 = 0; *(undefined4 *)&this->field_0x7094 = 0; *(undefined4 *)&this->field_0x7098 = 0; *(undefined4 *)&this->field_0x709c = 0; *(undefined4 *)&this->field_0x70a0 = 0; *(undefined4 *)&this->field_0x70a4 = 0; *(undefined4 *)&this->field_0x70a8 = 0; *(undefined4 *)&this->field_0x70ac = 0; *(undefined4 *)&this->field_0x70b0 = 0; *(undefined4 *)&this->field_0x70b4 = 0; *(undefined4 *)&this->field_0x70b8 = 0; *(undefined4 *)&this->field_0x70bc = 0; *(undefined4 *)&this->field_0x70c0 = 0; ExceptionList = local_1c; return this; } //@@ 007e9ba0 Room::~Room /* DB: Game::~Game calls it on Game+0x18300 (_room) then operator_delete(0x7898); destroys the 0x1c0 grid entity pointers at +0x24 via vtable dtor, ANM2::Reset, Backdrop/FXLayers destructors prototype: db/protos.zhl */ void __thiscall Room::~Room(Room *this) { byte *gridIndexSet; uint uVar2; qword *allocCounter; void **gridEntitySlot; int iVar3; Room *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword allocatedBytes; void *freeBlock; ANM2 *railSprite; undefined1 *refSlot; local_8 = 0xffffffff; puStack_c = &LAB_00b00d70; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; gridEntitySlot = this->_gridEntities; iVar3 = 0x1c0; local_14 = this; do { if (*gridEntitySlot != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*gridEntitySlot)(1,uVar2); } gridEntitySlot = gridEntitySlot + 1; iVar3 = iVar3 + -1; } while (iVar3 != 0); if (this->_Camera != (void *)0x0) { FUN_007ea0c0(this->_Camera); } local_8 = 0; ANM2::Reset((ANM2 *)&this->field_0x7770); iVar3 = *(int *)&this->field_0x77c8; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x77c8 = 0; } iVar3 = *(int *)&this->field_0x77cc; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x77cc = 0; } iVar3 = *(int *)&this->field_0x77a8; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x77a8 = 0; } iVar3 = *(int *)&this->field_0x77ac; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x77ac = 0; } std::string::_Tidy_deallocate(&this->field_0x7788); std::string::_Tidy_deallocate(&this->field_0x7770); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(this->_redDoorOutlines,4,8,FUN_00579700); railSprite = &(this->_railManager)._sprite; local_8 = 5; ANM2::Reset(railSprite); freeBlock = (this->_railManager)._sprite._overlayAnimState._layerFrames; if (freeBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)freeBlock + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)((int)freeBlock + -4)); (this->_railManager)._sprite._overlayAnimState._layerFrames = (void *)0x0; } freeBlock = (this->_railManager)._sprite._overlayAnimState._nullLayerFrames; if (freeBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)freeBlock + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)((int)freeBlock + -4)); (this->_railManager)._sprite._overlayAnimState._nullLayerFrames = (void *)0x0; } freeBlock = (this->_railManager)._sprite._animState._layerFrames; if (freeBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)freeBlock + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)((int)freeBlock + -4)); (this->_railManager)._sprite._animState._layerFrames = (void *)0x0; } freeBlock = (this->_railManager)._sprite._animState._nullLayerFrames; if (freeBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)freeBlock + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)((int)freeBlock + -4)); (this->_railManager)._sprite._animState._nullLayerFrames = (void *)0x0; } std::string::_Tidy_deallocate((this->_railManager)._sprite._animDefaultName._buf); std::string::_Tidy_deallocate((char *)railSprite); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(this->_outputGroupCallbacks,0xc,10,FID_conflict__Tidy); _eh_vector_destructor_iterator_(this->_outputGroupGridIndices,8,10,FUN_00424420); FUN_004b3950(); gridIndexSet = this->_litGridIndices; FID_conflict__Erase_tree_>_> (gridIndexSet,(fuzzer_allocator_> *)gridIndexSet, *(_Tree_node **)(*(int *)this->_litGridIndices + 4)); operator_delete(*(void **)gridIndexSet,0x14); FUN_00827f30(); gridIndexSet = this->_pendingGridRemovals; FID_conflict__Erase_tree_>_> (gridIndexSet,(fuzzer_allocator_> *)gridIndexSet, *(_Tree_node **)(*(int *)this->_pendingGridRemovals + 4)); operator_delete(*(void **)gridIndexSet,0x14); local_8 = 10; ANM2::Reset((ANM2 *)&this->field_0x7100); iVar3 = *(int *)&this->field_0x7158; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x7158 = 0; } iVar3 = *(int *)&this->field_0x715c; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x715c = 0; } iVar3 = *(int *)&this->field_0x7138; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x7138 = 0; } iVar3 = *(int *)&this->field_0x713c; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x713c = 0; } std::string::_Tidy_deallocate(&this->field_0x7118); std::string::_Tidy_deallocate(&this->field_0x7100); std::deque::_Tidy(); freeBlock = (this->_shopItemDeque)._proxy; (this->_shopItemDeque)._proxy = (void *)0x0; operator_delete(freeBlock,8); local_8 = 0xf; ANM2::Reset((ANM2 *)&this->field_0x6f54); iVar3 = *(int *)&this->field_0x6fac; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); allocatedBytes = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)allocatedBytes < uVar2); free((void *)(iVar3 + -4)); *(undefined4 *)&this->field_0x6fac = 0; } if (*(void **)&this->field_0x6fb0 != (void *)0x0) { local_8 = CONCAT31(local_8._1_3_,0x11); tracked_alloc(1,*(void **)&this->field_0x6fb0,0); *(undefined4 *)&this->field_0x6fb0 = 0; } AnimationState::~AnimationState((AnimationState *)&this->field_0x6f84); std::string::_Tidy_deallocate(&this->field_0x6f6c); std::string::_Tidy_deallocate(&this->field_0x6f54); local_8 = 0x12; ANM2::Reset(&this->_lightSprite); AnimationState::~AnimationState(&(this->_lightSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_lightSprite)._animState); std::string::_Tidy_deallocate((this->_lightSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_lightSprite); Backdrop::destructor(); refSlot = &this->field_0x1bb8; if (*(int *)refSlot != 0) { local_14 = (Room *)refSlot; std::multiset::erase(&local_14); *(undefined4 *)refSlot = 0; } FXLayers::destructor(); FUN_00417e50(); ExceptionList = local_10; return; } //@@ 007ea0c0 FUN_007ea0c0 void FUN_007ea0c0(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b00d90; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; tracked_alloc(1,(void *)in_ECX[0x14],0); local_8 = 1; tracked_alloc(1,(void *)in_ECX[0x10],0); local_8 = 2; tracked_alloc(1,(void *)in_ECX[0xc],0); local_8 = 3; tracked_alloc(1,(void *)in_ECX[8],0); local_8 = 4; tracked_alloc(1,(void *)in_ECX[4],0); local_8 = 5; tracked_alloc(1,(void *)*in_ECX,0); operator_delete(in_ECX,0x94); ExceptionList = local_10; return; } //@@ 007ea190 Room::is_type_16 /* DB: body `return *(int*)(this+8) == 0x10` (room type 16: crawl space / Beast room); ECX from Level::GetCurrentRoom in Entity_Projectile::Update 0x653070 (flag at 0x653bd2), Entity_Tear::Update, Entity_Effect::Update/Init, Entity_Familiar::Update, Entity_NPC::Update; tiny, beware ICF prototype: db/protos.zhl */ byte __thiscall Room::is_type_16(Room *this) { return this->_roomType == 0x10; } //@@ 007ea1a0 Room::TriggerEffectRemoved /* ZHL [exact] __thiscall void Room::TriggerEffectRemoved(ItemConfig_Item* item, int unused); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Room::TriggerEffectRemoved(Room *this,ItemConfig_Item *item,int unused) { int iVar1; void *pvVar2; Game *pGVar3; Manager *pMVar4; uint uVar5; float fVar6; pMVar4 = g_manager; pGVar3 = g_game; iVar1 = item->type; if (((iVar1 != 1) && (iVar1 != 3)) && (iVar1 != 4)) { return; } iVar1 = item->id; if (iVar1 != 0x42) { if (iVar1 == 0x1de) { uVar5 = 0; pvVar2 = g_game->_room; if (*(int *)((int)pvVar2 + 0x1264) == 0) { return; } do { iVar1 = *(int *)(*(int *)((int)pvVar2 + 0x125c) + uVar5 * 4); if (((1 < *(int *)&pGVar3->_deathmatchManager) && (*(int *)(iVar1 + 0x28) == 1)) || ((*(int *)(iVar1 + 0x28) - 10U < 0x3de || (*(int *)(iVar1 + 0x28) == 1000)))) { *(undefined4 *)(iVar1 + 0x31c) = 0; } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar2 + 0x1264)); return; } if (iVar1 != 0x2a5) { return; } } fVar6 = time_scale_update(this); (pMVar4->_musicManager)._targetPitch = fVar6; return; } //@@ 007ea260 Room::SetPauseTimer /* ZHL [exact] __thiscall void Room::SetPauseTimer(int Duration); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Room::SetPauseTimer(Room *this,int Duration) { int iVar1; int iVar2; uint uVar3; uVar3 = 0; if ((this->_entityList)._updateEL._size != 0) { do { iVar1 = *(int *)((int)(this->_entityList)._updateEL._data + uVar3 * 4); if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar1 + 0x28) == 1)) || (iVar2 = *(int *)(iVar1 + 0x28), iVar2 - 10U < 0x3de)) || ((iVar2 == 9 || (iVar2 == 1000)))) { *(int *)(iVar1 + 0x31c) = Duration; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)(this->_entityList)._updateEL._size); } return; } //@@ 007ea2d0 Room::time_scale_update /* DB: misnamed GetDevilRoomChance: the global time scale (manager+0x2a2d4) SetBrokenWatchState stores: Stop Watch effect (0xe8) / Hourglass effect (0x42) / Broken Watch state 1 -> 0.7, state 2 or challenge 22 -> 1.43, Stop Watch owned -> 0.9, collectible 0x2a5's countdown eases it; plus (GFuel count - 1) * 0.1 (rif/rebirth-pills) prototype: db/protos.zhl */ float __thiscall Room::time_scale_update(Room *this) { byte bVar1; void *pvVar2; Entity_Player *pEVar3; int iVar4; int iVar5; float fVar6; float local_8; local_8 = 1.0; pvVar2 = TemporaryEffects::GetCollectibleEffect(&this->_temporaryEffects,0x2a5); if (pvVar2 != (void *)0x0) { fVar6 = ((float)*(int *)((int)pvVar2 + 8) - 0.0) / 90.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } local_8 = 1.0 - fVar6 * 0.8; if (local_8 <= 0.5) { local_8 = 0.5; } goto LAB_007ea3b4; } bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryEffects,0xe8); if ((bVar1 == 0) && (bVar1 = TemporaryEffects::HasCollectibleEffect(&this->_temporaryEffects,0x42), bVar1 == 0)) { if (g_game->_challenge != 0x16) { if (this->_brokenWatchState == 1) goto LAB_007ea3a7; if (this->_brokenWatchState != 2) { pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xe8,(RNG **)&g_game->_playerManager,1); if (pEVar3 != (Entity_Player *)0x0) { local_8 = 0.9; } goto LAB_007ea3b4; } } local_8 = 1.43; } else { LAB_007ea3a7: local_8 = 0.7; } LAB_007ea3b4: iVar4 = PlayerManager::GetGFuelCount(); iVar5 = 0; if (0 < iVar4 + -1) { iVar5 = iVar4 + -1; } return (float)iVar5 * 0.1 + local_8; } //@@ 007ea3e0 Room::GetTimeScale /* ZHL [exact] __thiscall float Room::GetTimeScale(Vector* unused, Entity* ent); prototype: db/protos.zhl, confirmed by RET 8 */ float __thiscall Room::GetTimeScale(Room *this,Vector *unusedPosition,Entity *entity) { float fVar1; Game *this_00; byte bVar2; Entity_Player *pEVar3; int iVar4; void *pvVar5; int iVar6; float fVar7; float local_20; undefined4 local_1c; Room *local_18; undefined1 local_14 [8]; void *local_c; local_20 = 1.0; local_18 = this; if ((entity == (Entity *)0x0) || (entity->_type != 1)) { pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xe8,(RNG **)&g_game->_playerManager,1); this_00 = g_game; if (pEVar3 != (Entity_Player *)0x0) { local_20 = 0.8; } local_1c = 0x4d; std::set::find_node(local_14,&local_1c); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x4e)) && (local_c != (this_00->_seedEffects)._seedEffects)) { pEVar3 = Game::GetPlayer(this_00,0); fVar7 = (pEVar3->_velocity).x; fVar1 = (pEVar3->_velocity).y; local_20 = sqrtf(fVar1 * fVar1 + fVar7 * fVar7); local_20 = local_20 / 4.2; if (local_20 <= 0.02) { local_20 = 0.02; } if (1.75 <= local_20) { local_20 = 1.75; } } } iVar4 = PlayerManager::GetGFuelCount(); iVar6 = 0; if (0 < iVar4 + -1) { iVar6 = iVar4 + -1; } local_20 = (float)iVar6 * 0.1 + local_20; pvVar5 = TemporaryEffects::GetCollectibleEffect(&local_18->_temporaryEffects,0x2a5); if (pvVar5 != (void *)0x0) { if ((entity == (Entity *)0x0) || (entity->_type != 1)) { fVar7 = ((float)*(int *)((int)pvVar5 + 8) - 0.0) / 90.0; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } local_20 = (1.0 - fVar7) * local_20; if (local_20 <= 0.02) { local_20 = 0.02; } } else { bVar2 = Entity_Player::HasCollectible((Entity_Player *)entity,0x2a5,0); if (bVar2 != 0) { fVar7 = ((float)*(int *)((int)pvVar5 + 8) - 0.0) / 90.0; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } local_20 = local_20 * (fVar7 + 1.0); } } } if ((g_game->_challenge == 0x16) || (*(int *)((int)g_game->_room + 0x1210) == 2)) { local_20 = local_20 * 1.43; } return local_20; } //@@ 007ea5d0 FUN_007ea5d0 void FUN_007ea5d0(void) { int soundId; Manager *pMVar1; byte bVar2; int in_ECX; uint uVar3; undefined4 *puVar4; puVar4 = (undefined4 *)(in_ECX + 0x7084); uVar3 = 0; do { pMVar1 = g_manager; *puVar4 = 0; soundId = *(int *)((int)&DAT_00b1f930 + uVar3); bVar2 = SFXManager::IsPlaying(&pMVar1->_sfxManager,soundId); if (bVar2 != 0) { SFXManager::Stop(&pMVar1->_sfxManager,soundId); } uVar3 = uVar3 + 0x10; puVar4 = puVar4 + 1; } while (uVar3 < 0x100); return; } //@@ 007ea630 init_room_render_surfaces /* DB: creates the named render surfaces ("Floor Water Surface", "Shadow Surface", "Mirror Surface", "Heat Wave Surface"...) via Manager::LoadImage, gfx/grid/lava.png, caustics.png; called by Room::constructor and 007084c0 Game::recreate_render_targets void init_room_render_surfaces(void) { int *piVar1; char cVar2; uint uVar3; void *pvVar4; KColor *clearColor; KColor *clearColor_00; KColor *clearColor_01; KColor *clearColor_02; KColor *clearColor_03; KColor *clearColor_04; KColor *clearColor_05; KColor *clearColor_06; KColor *clearColor_07; KColor *clearColor_08; KColor *clearColor_09; KColor *clearColor_10; KColor *clearColor_11; undefined1 local_b4 [4]; int *local_b0; undefined1 local_ac [4]; int *local_a8; undefined1 local_a4 [4]; int *local_a0; undefined1 local_9c [4]; int *local_98; undefined1 local_94 [4]; int *local_90; undefined1 local_8c [4]; int *local_88; undefined1 local_84 [4]; int *local_80; undefined1 local_7c [4]; int *local_78; undefined1 local_74 [4]; int *local_70; undefined1 local_6c [4]; int *local_68; undefined1 local_64 [4]; int *local_60; undefined1 local_5c [4]; int *local_58; undefined1 local_54 [4]; int *local_50; undefined1 local_4c [4]; int *local_48; undefined1 local_44 [4]; int *local_40; undefined1 local_3c [4]; int *local_38; undefined1 local_34 [4]; int *local_30; undefined1 local_2c [4]; int *local_28; KColor local_24; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00e5f; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; if (DAT_00c797b4 == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_34,(int)g_screenWidth,(int)g_screenHeight,(byte *)"Shadow Surface", clearColor); local_8 = 0; shared_ptr::operator_assign(&DAT_00c797b4,pvVar4); local_8 = 1; if (((local_30 != (int *)0x0) && (cVar2 = (**(code **)(*local_30 + 0xc))(uVar3), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_34); } } local_8 = 0xffffffff; if ((DAT_00c797cc == 0) && ((g_manager->_optionsConfig)._enableLighting != 0)) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_3c,(int)g_screenWidth,(int)g_screenHeight, (byte *)"Light Overlay Surface",clearColor_00); local_8 = 2; shared_ptr::operator_assign(&DAT_00c797cc,pvVar4); local_8 = 3; if ((local_38 != (int *)0x0) && ((cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0' && (g_renderTargetReleaseFn != (void *)0x0)))) { (*g_renderTargetReleaseFn)(local_3c); } } local_8 = 0xffffffff; if ((DAT_00c797c4 == (int *)0x0) && ((g_manager->_optionsConfig)._enableCaustics != 0)) { pvVar4 = Manager::LoadImage(local_44,(byte *)"gfx/backdrop/caustics.png"); local_8 = 4; KAGE::SmartPointer::operator_assign(&DAT_00c797c4,pvVar4); local_8 = 5; if ((local_40 != (int *)0x0) && ((cVar2 = (**(code **)(*local_40 + 0xc))(), cVar2 != '\0' && (g_imageReleaseFn != (void *)0x0)))) { (*g_imageReleaseFn)(local_44); } piVar1 = DAT_00c797c4; local_8 = 0xffffffff; if ((DAT_00c797c4[0xe] != 0) || (DAT_00c797c4[0xf] != 0)) { (**(code **)(*DAT_00c797c4 + 0x48))(0,0); piVar1[0xe] = 0; piVar1[0xf] = 0; } } if ((DAT_00c797d4 == 0) && ((g_manager->_optionsConfig)._enableShockwave != 0)) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_4c,g_framebufferWidth,DAT_00c79114,(byte *)"Shockwave Surface", clearColor_01); local_8 = 6; shared_ptr::operator_assign(&DAT_00c797d4,pvVar4); local_8 = 7; if ((local_48 != (int *)0x0) && ((cVar2 = (**(code **)(*local_48 + 0xc))(), cVar2 != '\0' && (g_renderTargetReleaseFn != (void *)0x0)))) { (*g_renderTargetReleaseFn)(local_4c); } local_8 = 0xffffffff; } if (DAT_00c797dc == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_54,g_framebufferWidth,DAT_00c79114,(byte *)"Floor Water Surface", clearColor_02); local_8 = 8; shared_ptr::operator_assign(&DAT_00c797dc,pvVar4); local_8 = 9; if (((local_50 != (int *)0x0) && (cVar2 = (**(code **)(*local_50 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_54); } local_8 = 0xffffffff; } if ((DAT_00c797e4 == 0) && ((g_manager->_optionsConfig)._getsSetToEnableWaterSurface != 0)) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_5c,g_framebufferWidth,DAT_00c79114,(byte *)"Water Overlay Surface", clearColor_03); local_8 = 10; shared_ptr::operator_assign(&DAT_00c797e4,pvVar4); local_8 = 0xb; if ((local_58 != (int *)0x0) && ((cVar2 = (**(code **)(*local_58 + 0xc))(), cVar2 != '\0' && (g_renderTargetReleaseFn != (void *)0x0)))) { (*g_renderTargetReleaseFn)(local_5c); } local_8 = 0xffffffff; } if (DAT_00c797fc == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_64,g_framebufferWidth,DAT_00c79114,(byte *)"Dizzy Overlay Surface", clearColor_04); local_8 = 0xc; shared_ptr::operator_assign(&DAT_00c797fc,pvVar4); local_8 = 0xd; if (((local_60 != (int *)0x0) && (cVar2 = (**(code **)(*local_60 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_64); } local_8 = 0xffffffff; } if (DAT_00c797ec == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_6c,0x30c,0x1d4,(byte *)"Shading Surface (workaround)",clearColor_05); local_8 = 0xe; shared_ptr::operator_assign(&DAT_00c797ec,pvVar4); local_8 = 0xf; if (((local_68 != (int *)0x0) && (cVar2 = (**(code **)(*local_68 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_6c); } local_8 = 0xffffffff; } if (DAT_00c797f4 == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_74,0x30c,0x1d4,(byte *)"Floor Water Surface (V2)",clearColor_06); local_8 = 0x10; shared_ptr::operator_assign(&DAT_00c797f4,pvVar4); local_8 = 0x11; if (((local_70 != (int *)0x0) && (cVar2 = (**(code **)(*local_70 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_74); } local_8 = 0xffffffff; } if (DAT_00c7981c == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_7c,0x30c,0x1d4,(byte *)"Textured Pit Surface",clearColor_07); local_8 = 0x12; shared_ptr::operator_assign(&DAT_00c7981c,pvVar4); local_8 = 0x13; if (((local_78 != (int *)0x0) && (cVar2 = (**(code **)(*local_78 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_7c); } local_8 = 0xffffffff; } if (DAT_00c79804 == 0) { pvVar4 = Manager::LoadImage(local_84,(byte *)"gfx/grid/grid_pit_mask.png"); local_8 = 0x14; KAGE::SmartPointer::operator_assign(&DAT_00c79804,pvVar4); local_8 = 0x15; if (((local_80 != (int *)0x0) && (cVar2 = (**(code **)(*local_80 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_84); } local_8 = 0xffffffff; } if (DAT_00c7980c == (int *)0x0) { pvVar4 = Manager::LoadImage(local_8c,(byte *)"gfx/grid/lava.png"); local_8 = 0x16; KAGE::SmartPointer::operator_assign(&DAT_00c7980c,pvVar4); local_8 = 0x17; if (((local_88 != (int *)0x0) && (cVar2 = (**(code **)(*local_88 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_8c); } piVar1 = DAT_00c7980c; local_8 = 0xffffffff; if ((DAT_00c7980c[0xe] != 0) || (DAT_00c7980c[0xf] != 0)) { (**(code **)(*DAT_00c7980c + 0x48))(0,0); piVar1[0xe] = 0; piVar1[0xf] = 0; } } if (DAT_00c79814 == (int *)0x0) { pvVar4 = Manager::LoadImage(local_94,(byte *)"gfx/grid/lava_cold.png"); local_8 = 0x18; KAGE::SmartPointer::operator_assign(&DAT_00c79814,pvVar4); local_8 = 0x19; if (((local_90 != (int *)0x0) && (cVar2 = (**(code **)(*local_90 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_94); } piVar1 = DAT_00c79814; local_8 = 0xffffffff; if ((DAT_00c79814[0xe] != 0) || (DAT_00c79814[0xf] != 0)) { (**(code **)(*DAT_00c79814 + 0x48))(0,0); piVar1[0xe] = 0; piVar1[0xf] = 0; } } if (DAT_00c79824 == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_9c,(int)g_screenWidth,(int)g_screenHeight, (byte *)"Dust Overlay Surface",clearColor_08); local_8 = 0x1a; shared_ptr::operator_assign(&DAT_00c79824,pvVar4); local_8 = 0x1b; if (((local_98 != (int *)0x0) && (cVar2 = (**(code **)(*local_98 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_9c); } local_8 = 0xffffffff; } if (DAT_00c7982c == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_a4,(int)g_screenWidth,(int)g_screenHeight, (byte *)"Dust Overlay Temp Surface",clearColor_09); local_8 = 0x1c; shared_ptr::operator_assign(&DAT_00c7982c,pvVar4); local_8 = 0x1d; if (((local_a0 != (int *)0x0) && (cVar2 = (**(code **)(*local_a0 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_a4); } local_8 = 0xffffffff; } if (DAT_00c7983c == (int *)0x0) { pvVar4 = Manager::LoadImage(local_ac,(byte *)"gfx/backdrop/8bitclouds_64_thick.png"); local_8 = 0x1e; KAGE::SmartPointer::operator_assign(&DAT_00c7983c,pvVar4); local_8 = 0x1f; if (((local_a8 != (int *)0x0) && (cVar2 = (**(code **)(*local_a8 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_ac); } piVar1 = DAT_00c7983c; local_8 = 0xffffffff; if ((DAT_00c7983c[0xe] != 0) || (DAT_00c7983c[0xf] != 0)) { (**(code **)(*DAT_00c7983c + 0x48))(0,0); piVar1[0xe] = 0; piVar1[0xf] = 0; } piVar1 = DAT_00c7983c; if ((DAT_00c7983c[0xc] != 1) || (DAT_00c7983c[0xd] != 1)) { (**(code **)(*DAT_00c7983c + 0x44))(1,1); piVar1[0xc] = 1; piVar1[0xd] = 1; } } if (DAT_00c79844 == (int *)0x0) { pvVar4 = Manager::LoadImage(local_2c,(byte *)"gfx/ash_mask.png"); local_8 = 0x20; KAGE::SmartPointer::operator_assign(&DAT_00c79844,pvVar4); local_8 = 0x21; if (((local_28 != (int *)0x0) && (cVar2 = (**(code **)(*local_28 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_2c); } piVar1 = DAT_00c79844; local_8 = 0xffffffff; if ((DAT_00c79844[0xc] != 1) || (DAT_00c79844[0xd] != 1)) { (**(code **)(*DAT_00c79844 + 0x44))(1,1); piVar1[0xc] = 1; piVar1[0xd] = 1; } } if ((DAT_00c7984c == 0) && ((g_manager->_optionsConfig)._getsSetToEnableWaterSurface != 0)) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_2c,g_framebufferWidth,DAT_00c79114,(byte *)"Heat Wave Surface", clearColor_10); local_8 = 0x22; shared_ptr::operator_assign(&DAT_00c7984c,pvVar4); local_8 = 0x23; if ((local_28 != (int *)0x0) && ((cVar2 = (**(code **)(*local_28 + 0xc))(), cVar2 != '\0' && (g_renderTargetReleaseFn != (void *)0x0)))) { (*g_renderTargetReleaseFn)(local_2c); } local_8 = 0xffffffff; } if (DAT_00c79854 == 0) { KColor::SetFromARGB(&local_24,0); pvVar4 = KAGE_Graphics::create_render_target (local_b4,g_framebufferWidth,DAT_00c79114,(byte *)"Mirror Surface", clearColor_11); local_8 = 0x24; shared_ptr::operator_assign(&DAT_00c79854,pvVar4); local_8 = 0x25; if (((local_b0 != (int *)0x0) && (cVar2 = (**(code **)(*local_b0 + 0xc))(), cVar2 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_b4); } } ExceptionList = local_10; return; } //@@ 007eb010 FUN_007eb010 void FUN_007eb010(void) { int iVar1; Game *pGVar2; undefined2 *in_ECX; undefined4 *puVar3; int iVar4; uint uVar5; int *piVar6; undefined4 local_5c [11]; undefined4 local_30 [11]; EntityList::Reset((EntityList *)(in_ECX + 0x90c)); uVar5 = 0; *(undefined4 *)(in_ECX + 0x90a) = 0; if (*(int *)(in_ECX + 0x932) != 0) { do { iVar4 = *(int *)(in_ECX + 0x90a); iVar1 = *(int *)(*(int *)(in_ECX + 0x92e) + uVar5 * 4); uVar5 = uVar5 + 1; *(int *)(in_ECX + 0x90a) = iVar4 + 1; *(int *)(iVar1 + 0x20) = iVar4; } while (uVar5 < *(uint *)(in_ECX + 0x932)); } *(undefined4 *)(in_ECX + 0x3912) = 0; puVar3 = (undefined4 *)(in_ECX + 0x3842); uVar5 = 0; do { if (((&DAT_00b1f93c)[uVar5] & 1) == 0) { *puVar3 = 0; } uVar5 = uVar5 + 0x10; puVar3 = puVar3 + 1; } while (uVar5 < 0x100); piVar6 = (int *)(in_ECX + 0x12); iVar4 = 0x1c0; do { if ((undefined4 *)*piVar6 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar6)(1); } piVar6 = piVar6 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); memset(in_ECX + 0x12,0,0x700); pGVar2 = g_game; *(undefined4 *)(in_ECX + 0x392) = 0; *(undefined4 *)(in_ECX + 0x394) = 0; *(undefined4 *)(in_ECX + 0x396) = 0; *(undefined4 *)(in_ECX + 0x398) = 0; *(undefined4 *)(in_ECX + 0x39a) = 0; *(undefined4 *)(in_ECX + 0x39c) = 0; *(undefined4 *)(in_ECX + 0x39e) = 0; *(undefined4 *)(in_ECX + 0x3a0) = 0; (pGVar2->_ambush)._isActive = 0; (pGVar2->_ambush)._currentWave = 0; *(undefined4 *)&pGVar2->field_0x265f0 = 0; *(undefined1 *)(in_ECX + 0x8fa) = 0; *in_ECX = 0; *(float *)(in_ECX + 0x902) = g_vectorZero.x; *(float *)(in_ECX + 0x904) = g_vectorZero.y; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x391e) = 0xffffffff; *(undefined4 *)(in_ECX + 0x397e) = 0xffffffff; if ((undefined4 *)(in_ECX + 0x3968) != local_30) { *(undefined4 *)(in_ECX + 0x3968) = 0x3f800000; *(undefined4 *)(in_ECX + 0x396a) = 0x3f800000; *(undefined4 *)(in_ECX + 0x396c) = 0x3f800000; *(undefined4 *)(in_ECX + 0x396e) = 0x3f800000; *(undefined8 *)(in_ECX + 0x3978) = 0; *(undefined4 *)(in_ECX + 0x3970) = 0; *(undefined4 *)(in_ECX + 0x3972) = 0; *(undefined4 *)(in_ECX + 0x3974) = 0; *(undefined4 *)(in_ECX + 0x3976) = 0; *(undefined4 *)(in_ECX + 0x397c) = 0; } if ((undefined4 *)(in_ECX + 0x3952) != local_5c) { *(undefined4 *)(in_ECX + 0x3952) = 0x3f800000; *(undefined4 *)(in_ECX + 0x3954) = 0x3f800000; *(undefined4 *)(in_ECX + 0x3956) = 0x3f800000; *(undefined4 *)(in_ECX + 0x3958) = 0x3f800000; *(undefined8 *)(in_ECX + 0x3962) = 0; *(undefined4 *)(in_ECX + 0x395a) = 0; *(undefined4 *)(in_ECX + 0x395c) = 0; *(undefined4 *)(in_ECX + 0x395e) = 0; *(undefined4 *)(in_ECX + 0x3960) = 0; *(undefined4 *)(in_ECX + 0x3966) = 0; } return; } //@@ 007eb1b0 Room::PlayMusic /* ZHL [lua] Lua binding Room:PlayMusic prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Room::PlayMusic(Room *this) { int roomType; code *pcVar2; byte bVar3; uint uVar4; uint uVar5; Game *game; float musicPitch; undefined8 uVar6; int unusedInt; byte unusedBool; uint stageType; int jingleId; float local_c; uint stage; uint currentMusic; Manager *manager; MusicManager *musicManager; int roomType; stage = g_game->_stage; stageType = g_game->_stageType; if (g_game->_challenge == 0x2c) { stageType = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); } game = g_game; roomType = this->_roomType; jingleId = 0; if (g_game->_challenge == 0x2d) { local_c = (float)g_game->_dungeonPlacementSeed; if (stage - 1 < 0xb) { if (local_c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = (uint)local_c >> 2 ^ (uint)local_c; uVar4 = uVar4 << 7 ^ uVar4; local_c = (float)(uVar4 >> 9 ^ uVar4); stage = (uint)local_c % 0xb + 1; } if (local_c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = (uint)local_c >> 2 ^ (uint)local_c; uVar4 = uVar4 << 7 ^ uVar4; stageType = (uVar4 >> 9 ^ uVar4) % 5; if (stageType == 3) { stageType = 4; } } local_c = 0.08; unusedInt = 0x7eb2f9; uVar4 = RoomConfig::GetStageID(stage,stageType,-1); if (roomType == 5) { if ((*(byte *)((int)this->_descriptor + 0x44) & 1) == 0) { switch(this->_bossId) { case 6: uVar6 = CONCAT44(uVar4,0x14); break; default: switchD_007eb334_caseD_7: uVar6 = FUN_008206e0(); break; case 8: case 0x19: uVar6 = CONCAT44(uVar4,0x15); break; case 0x18: case 0x37: switchD_007eb334_caseD_18: uVar6 = CONCAT44(uVar4,0x21); break; case 0x27: uVar6 = CONCAT44(uVar4,0x16); break; case 0x28: case 0x3f: uVar6 = CONCAT44(uVar4,0x19); break; case 0x36: uVar6 = CONCAT44(uVar4,0x18); break; case 0x3e: uVar6 = CONCAT44(uVar4,0x1c); break; case 0x46: uVar6 = CONCAT44(uVar4,0x67); break; case 0x58: uVar6 = CONCAT44(uVar4,0x2b); } } else { uVar6 = CONCAT44(uVar4,0x25); } } else if ((roomType == 6) || (*(char *)((int)game->_room + 0x7228) != '\0')) { uVar6 = CONCAT44(uVar4,0x26 - (uint)((*(byte *)((int)this->_descriptor + 0x44) & 1) != 0)); } else if (roomType == 2) { uVar6 = CONCAT44(uVar4,0x23); } else if (roomType == 0xc) { uVar6 = CONCAT44(uVar4,0x1e); } else if (roomType == 0xf) { uVar6 = CONCAT44(uVar4,0x22); } else if (roomType == 9) { uVar6 = CONCAT44(uVar4,0x24); } else { if (roomType == 0xe) goto switchD_007eb334_caseD_18; if (roomType == 7) { uVar6 = CONCAT44(uVar4,0x1f); } else if (roomType == 8) { uVar6 = CONCAT44(uVar4,0x20); } else if (roomType == 0x1d) { uVar6 = CONCAT44(uVar4,0x33); } else if (roomType == 0xb) { if ((*(uint *)((int)this->_descriptor + 0x44) >> 3 & 1) == 0) { LAB_007eb438: if (game->_currentRoomIdx == -0xb) { uVar6 = CONCAT44(uVar4,0x25); } else if (roomType == 0x18) { uVar6 = CONCAT44(uVar4,0x32); } else if (((roomType == 0x10) && (roomType = *(int *)((int)this->_descriptor + 0x10), roomType != 0)) && (*(int *)(roomType + 0x10) == 4)) { uVar6 = CONCAT44(uVar4,0x2d); } else if ((stage == 0xd) && (stageType == 1)) { if (((byte)*(undefined4 *)((int)this->_descriptor + 0x44) & 5) == 4) { local_c = 1.0; uVar6 = CONCAT44(uVar4,0x2c); } else { uVar6 = CONCAT44(uVar4,*(undefined4 *) (game->_ventricleRazorPortals + uVar4 * 0xc4 + 0x654)); } } else { if (roomType == 0x10) { roomType = *(int *)((int)this->_descriptor + 0x10); if ((roomType != 0) && ((roomType = *(int *)(roomType + 0x10), roomType == 2 || (roomType == 3)))) goto switchD_007eb334_caseD_7; } else if ((roomType == 4) && (this->field_0x1 != '\0')) { uVar5 = Random(); jingleId = (uVar5 & 3) + 0x57; game = g_game; } uVar6 = CONCAT44(uVar4,*(undefined4 *) (game->_ventricleRazorPortals + uVar4 * 0xc4 + 0x654)); } } else { uVar6 = CONCAT44(uVar4,0x25); } } else { if (roomType != 0x1b) goto LAB_007eb438; uVar6 = CONCAT44(uVar4,0x25); } } uVar5 = (uint)uVar6; if ((((game->_difficulty != 2) && (game->_difficulty != 3)) && (stage == 9)) && (roomType != 5)) { uVar5 = *(uint *)(game->_ventricleRazorPortals + (int)((ulonglong)uVar6 >> 0x20) * 0xc4 + 0x654) ; jingleId = 0; } unusedBool = 0x50; bVar3 = Level::IsMausoleumHeartStage((Level *)game); if (bVar3 != 0) { if (g_game->_currentRoomIdx != -10) { local_c = 1.0; } uVar5 = 0; jingleId = 0; if (g_game->_currentRoomIdx != -10) { uVar5 = 0x34; } } if (g_game->_currentDimensionIdx == 2) { uVar5 = 0x45; jingleId = 0; } else { unusedBool = 0x9e; bVar3 = Level::HasMirrorDimension((Level *)g_game); if (((bVar3 == 0) || (g_game->_currentDimensionIdx != 1)) || ((roomType == 5 || ((roomType == 6 || (*(char *)((int)g_game->_room + 0x7228) != '\0')))))) { unusedBool = 0xdf; bVar3 = Level::HasAbandonedMineshaft((Level *)g_game); if ((bVar3 == 0) || (g_game->_currentDimensionIdx != 1)) { if (((0 < g_game->_stage) && (g_game->_stage < 7)) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { uVar5 = 0x76; jingleId = 0; } } else { jingleId = 0; uVar5 = (g_game->_levelStateFlags & 0x400000U | 0x1d000000) >> 0x16; } } else { uVar5 = (uVar4 == 0x1c) + 0x72; jingleId = 0; } } manager = g_manager; uVar4 = (g_manager->_musicManager)._queuedMusicID; musicManager = &g_manager->_musicManager; currentMusic = (g_manager->_musicManager)._currentMusicID; if (uVar4 == 0) { uVar4 = currentMusic; } if (currentMusic == 0x68) { if (uVar5 == 0x72) { LAB_007eb66b: local_c = 0.008; goto LAB_007eb678; } } else if (currentMusic == 0x72) { if (uVar5 == 0x68) goto LAB_007eb66b; } else { LAB_007eb678: if (currentMusic == 0x41) { local_c = 0.01; } else if (currentMusic == 0x2d) { local_c = 1.0; } else if ((currentMusic == 0x5f) || (currentMusic == 0x40)) { if ((-1 < (int)uVar5) && ((int)uVar5 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60)) { (g_manager->_musicManager)._queuedMusicID = uVar5; } goto LAB_007eb7d5; } } if (jingleId == 0) { if (((uVar4 == 0) && (currentMusic != uVar5)) || (uVar4 != uVar5)) { if (uVar5 == 0) { musicManager->_channels[musicManager->_currentChannel]._targetVolume = 0.0; musicManager->_channels[musicManager->_currentChannel]._fadeRate = 0.08; (manager->_musicManager)._queuedMusicID = 0; } else if (local_c < 1.0) { MusicManager::Crossfade(musicManager,uVar5,local_c); } else { Music::Play((Music *)musicManager,uVar5,(g_manager->_optionsConfig)._musicVolume); } *(undefined4 *)&manager->field_0x2a304 = 0; *(undefined4 *)&manager->field_0x2a320 = 0xffffff9c; } } else { Music::PlayJingle((Music *)musicManager,jingleId,unusedInt,unusedBool); if ((uVar5 != 0) && (((uVar4 == 0 && (currentMusic != uVar5)) || (uVar4 != uVar5)))) { if (local_c < 1.0) { MusicManager::Crossfade(musicManager,uVar5,local_c); } else { Music::Play((Music *)musicManager,uVar5,(g_manager->_optionsConfig)._musicVolume); } } } LAB_007eb7d5: musicPitch = time_scale_update(this); (g_manager->_musicManager)._targetPitch = musicPitch; return; } //@@ 007eb870 Level::UpdateBackwardsPathStages /* DB: ? Invalid backwards path stage ID; stage bitmask prototype: db/protos.zhl */ byte __thiscall Level::UpdateBackwardsPathStages(Level *this) { int *piVar1; int iVar2; byte isHasEffect; char cVar3; uint layer; int effectiveStage; Entity_Player *player; uint uVar4; Game *pGVar5; Game *pGVar6; float fVar7; uint layerMask; float extraHp; float local_14; int stageOffset; piVar1 = *(int **)(this->_stageType + 0x10); if (((piVar1 != (int *)0x0) && (piVar1[2] == 0x10)) && (*piVar1 == 0x23)) { return 0; } iVar2 = g_game->_stage; if ((iVar2 < 1) || (6 < iVar2)) { if ((iVar2 == 0xd) && (g_game->_stageType == 1)) { return 1; } } else if ((g_game->_gameStateFlags & 0x1000000000000) != 0) { if ((g_game->_stageType == 4) || (local_14 = (float)iVar2, g_game->_stageType == 5)) { local_14 = (float)(iVar2 + 1); } stageOffset = (int)local_14 * 800; uVar4 = 0; pGVar6 = g_game; fVar7 = local_14; do { pGVar5 = pGVar6; if ((fVar7 != local_14) || (*(int *)(*(int *)((int)pGVar6->_room + 4) + 8) != pGVar6->_lastBossRoomListIdx)) { if (((int)fVar7 < 1) || (7 < (int)fVar7)) { KAGE_LogMessage(0x10,(byte *)"Invalid backwards path stage ID"); pGVar5 = g_game; } iVar2 = *(int *)((int)(pGVar6->_glowingHourglassStates + 2) + stageOffset + 0xd8); if ((iVar2 == 4) || (iVar2 == 5)) { layer = ((int)fVar7 + -2) / 2 + 3; } else { layer = ((int)fVar7 + -1) / 2; } uVar4 = uVar4 | 1 << (layer & 0x1f); } stageOffset = stageOffset + 800; fVar7 = (float)((int)fVar7 + 1); pGVar6 = pGVar5; } while (stageOffset < 0x15e1); layer = 0; layerMask = 1; do { if ((uVar4 & layerMask) == 0) { if (layer < 6) { piVar1 = &(g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel] ._enabledLayers + (layer >> 5); *piVar1 = *piVar1 & ~(1 << ((byte)layer & 0x1f)); } } else if (layer < 6) { piVar1 = &(g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]. _enabledLayers + (layer >> 5); *piVar1 = *piVar1 | 1 << ((byte)layer & 0x1f); } layer = layer + 1; layerMask = layerMask << 1 | (uint)((int)layerMask < 0); } while ((int)layer < 6); return uVar4 != 0; } local_14 = 0.0; if ((g_game->_difficulty == 2) || (effectiveStage = iVar2, g_game->_difficulty == 3)) { if (iVar2 < 5) { effectiveStage = iVar2 * 2 + -1; } else { effectiveStage = 0; if (iVar2 == 5) { effectiveStage = 10; } } } uVar4 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar4); isHasEffect = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x2c0); if (isHasEffect != 0) { local_14 = 10000.0; break; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } extraHp = 10000.0; fVar7 = local_14; if (g_game->_stage < 9) { uVar4 = 0; pGVar6 = g_game; if (this->_roomList[0x19].DecorationSeed != 0) { do { piVar1 = *(int **)(*(int *)&this->_roomList[0x19].PoopCount + uVar4 * 4); if ((*(int *)&pGVar6->_deathmatchManager < 2) || (piVar1[10] != 1)) { if (piVar1[10] - 10U < 0x3de) goto LAB_007ebb35; } else { LAB_007ebb35: cVar3 = (**(code **)(*piVar1 + 0x48))(); if (((cVar3 != '\0') && (*(char *)((int)piVar1 + 0x173) == '\0')) && ((piVar1[0x5a] & 0x10U) == 0)) { local_14 = local_14 + (float)piVar1[0xe0]; } pGVar6 = g_game; fVar7 = local_14; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)this->_roomList[0x19].DecorationSeed); } if (fVar7 <= 0.0) goto LAB_007ebbfe; if (pGVar6->_challenge == 0x2c) { uVar4 = GetRoomStageType((Level *)pGVar6,pGVar6->_currentRoomIdx); fVar7 = local_14; } else { if (pGVar6->_currentDimensionIdx == 2) goto LAB_007ebbfe; uVar4 = pGVar6->_stageType; } uVar4 = RoomConfig::GetStageID(pGVar6->_stage,uVar4,-1); if (((uVar4 != 0x1d) || (iVar2 = this->_stageType, (*(byte *)(iVar2 + 0x44) & 1) != 0)) || (((*(uint *)(iVar2 + 0x44) >> 5 & 1) == 0 || ((*(uint *)(iVar2 + 0x44) >> 8 & 1) != 0)))) goto LAB_007ebbfe; extraHp = (float)*(int *)(iVar2 + 0x54) * 3.0; local_14 = fVar7; } else if ((*(byte *)(this->_stageType + 0x44) & 1) != 0) goto LAB_007ebbfe; fVar7 = local_14 + extraHp; LAB_007ebbfe: iVar2 = (g_manager->_musicManager)._currentChannel; if ((float)effectiveStage * 14.0 + 40.0 <= fVar7) { piVar1 = &(g_manager->_musicManager)._channels[iVar2]._enabledLayers; *piVar1 = *piVar1 | 1; return 1; } piVar1 = &(g_manager->_musicManager)._channels[iVar2]._enabledLayers; *piVar1 = *piVar1 & 0xfffffffe; return 0; } //@@ 007ebc40 FUN_007ebc40 void FUN_007ebc40(void) { int musicId; int in_ECX; if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { MusicManager::Crossfade(&g_manager->_musicManager,0x29,0.08); return; } musicId = 9; if ((*(uint *)(*(int *)(in_ECX + 4) + 0x44) >> 6 & 1) != 0) { musicId = 0x1a; } MusicManager::Crossfade(&g_manager->_musicManager,musicId,0.08); return; } //@@ 007ebca0 Room::SpawnGridEntity /* ZHL [exact] __thiscall bool Room::SpawnGridEntity(int GridIndex, unsigned int Type, unsigned int Variant, unsigned int Seed, int VarData); prototype: REPENTOGON, confirmed by RET 20 */ byte __thiscall Room::SpawnGridEntity(Room *this,int GridIndex,uint Type,uint Variant,uint Seed,int VarData) { int iVar1; uint uVar2; GridEntity *this_00; bool bVar3; bool bVar4; if ((GridIndex < 0) || (0x1bf < GridIndex)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((uint)GridIndex < 0x1c0) { if ((((Type == 0x11) || (Type == 0x12)) || (Type == 0x14)) || (Type == 0x17)) { uVar2 = GetGridCollision(this,GridIndex); bVar4 = false; bVar3 = uVar2 == 0; } else { iVar1 = this->_gridPaths[GridIndex]; bVar4 = SBORROW4(iVar1,900); uVar2 = iVar1 - 900; bVar3 = iVar1 == 900; } if (bVar3 || bVar4 != (int)uVar2 < 0) { this_00 = Isaac::CreateGridEntity(Type,GridIndex); if (this_00 != (GridEntity *)0x0) { if (this->_gridEntities[GridIndex] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[GridIndex])(1); } this->_gridEntities[GridIndex] = this_00; (this_00->_desc)._variant = Variant; (this_00->_desc)._varData = VarData; GridEntity::Init(this_00,Seed); return 1; } } } return 0; } //@@ 007ebd50 Room::SpawnGridEntityDesc /* ZHL [exact] __thiscall bool Room::SpawnGridEntityDesc(int GridIndex, GridEntityDesc *Desc); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Room::SpawnGridEntityDesc(Room *this,int GridIndex,GridEntityDesc *Desc) { int *piVar1; int iVar2; int iVar3; int iVar4; int iVar5; byte bVar6; undefined3 uVar7; Game *pGVar8; uint uVar9; GridEntity *pGVar10; bool bVar11; bool bVar12; if ((GridIndex < 0) || (0x1bf < GridIndex)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } iVar2 = Desc->_type; if ((((iVar2 == 0x11) || (iVar2 == 0x12)) || (iVar2 == 0x14)) || (iVar2 == 0x17)) { uVar9 = GetGridCollision(this,GridIndex); bVar12 = false; bVar11 = uVar9 == 0; } else { iVar3 = this->_gridPaths[GridIndex]; bVar12 = SBORROW4(iVar3,900); uVar9 = iVar3 - 900; bVar11 = iVar3 == 900; } if (bVar11 || bVar12 != (int)uVar9 < 0) { pGVar10 = Isaac::CreateGridEntity(iVar2,GridIndex); if (pGVar10 != (GridEntity *)0x0) { if (this->_gridEntities[GridIndex] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[GridIndex])(1); } this->_gridEntities[GridIndex] = pGVar10; iVar2 = Desc->_variant; iVar3 = Desc->_state; iVar4 = Desc->_spawnCount; (pGVar10->_desc)._type = Desc->_type; (pGVar10->_desc)._variant = iVar2; (pGVar10->_desc)._state = iVar3; (pGVar10->_desc)._spawnCount = iVar4; iVar3 = Desc->_spawnSeed; iVar4 = Desc->_varData; bVar6 = Desc->_initialized; uVar7 = *(undefined3 *)&Desc->field_0x19; iVar5 = Desc->_variableSeed; iVar2 = *(int *)pGVar10; pGVar10->_collisionClass = 0; (pGVar10->_desc)._spawnSeed = iVar3; (pGVar10->_desc)._varData = iVar4; (pGVar10->_desc)._initialized = bVar6; *(undefined3 *)&(pGVar10->_desc).field_0x19 = uVar7; (pGVar10->_desc)._variableSeed = iVar5; (**(code **)(iVar2 + 0x20))(); pGVar8 = g_game; piVar1 = &(pGVar10->_desc)._spawnCount; *piVar1 = *piVar1 + 1; (pGVar10->_desc)._initialized = 1; pGVar10->_spawnFrame = pGVar8->_frameCount; return 1; } } return 0; } //@@ 007ebe20 ItemPool::get_pool_from_room_entities /* DB: ? GetPoolForRoom, scans room spawns */ int ItemPool::get_pool_from_room_entities(int *param_1) { float fVar1; float fVar2; int iVar3; EntityConfig *entityConfig; EntityConfig_Entity *entityEntry; int iVar4; uint roomType; uint in_ECX; int iVar5; int *in_EDX; int bestEntry; int entries; uint entryCount; int iVar6; int iVar7; float bestWeight; float fVar8; float fVar9; int spawnOffset; int spawnIndex; int *roomData; iVar4 = in_EDX[4]; roomType = *(uint *)(iVar4 + 8); iVar5 = (int)param_1; if ((roomType == 5) && (param_1 == (int *)0x0)) { spawnIndex = *(ushort *)(iVar4 + 0x44) - 1; if (-1 < spawnIndex) { iVar3 = *(int *)(iVar4 + 0x40); spawnOffset = spawnIndex * 0x10; entityConfig = &g_manager->_entityConfig; param_1 = (int *)(iVar3 + 4 + spawnOffset); do { entryCount = (uint)*(byte *)(param_1 + 1); bestEntry = -1; iVar5 = 0; bestWeight = 0.0; if (entryCount < 4) { if (entryCount != 0) { entries = *param_1; goto LAB_007ebf30; } } else { entries = *param_1; do { fVar9 = *(float *)(entries + 8 + iVar5 * 0xc); fVar8 = bestWeight; if (bestWeight < fVar9) { fVar8 = fVar9; } fVar1 = *(float *)(entries + 0x14 + iVar5 * 0xc); iVar6 = iVar5; if (fVar9 <= bestWeight) { iVar6 = bestEntry; } fVar9 = fVar8; if (fVar8 < fVar1) { fVar9 = fVar1; } fVar2 = *(float *)(entries + 0x20 + iVar5 * 0xc); iVar7 = iVar5 + 1; if (fVar1 <= fVar8) { iVar7 = iVar6; } bestWeight = fVar9; if (fVar9 < fVar2) { bestWeight = fVar2; } fVar8 = *(float *)(entries + 0x2c + iVar5 * 0xc); bestEntry = iVar5 + 2; if (fVar2 <= fVar9) { bestEntry = iVar7; } if (bestWeight < fVar8) { bestEntry = iVar5 + 3; bestWeight = fVar8; } iVar5 = iVar5 + 4; } while (iVar5 < (int)(entryCount - 3)); for (; iVar5 < (int)entryCount; iVar5 = iVar5 + 1) { LAB_007ebf30: fVar9 = *(float *)(entries + 8 + iVar5 * 0xc); if (bestWeight < fVar9) { bestEntry = iVar5; bestWeight = fVar9; } } } iVar5 = *(int *)(spawnOffset + 4 + iVar3); entityEntry = EntityConfig::GetEntity (entityConfig,*(int *)(iVar5 + bestEntry * 0xc), (uint)*(ushort *)(iVar5 + 4 + bestEntry * 0xc), (uint)*(ushort *)(iVar5 + 6 + bestEntry * 0xc)); if ((entityEntry != (EntityConfig_Entity *)0x0) && (iVar5 = entityEntry->bossID, iVar5 != 0) ) goto LAB_007ebfab; spawnOffset = spawnOffset + -0x10; spawnIndex = spawnIndex + -1; param_1 = param_1 + -4; } while (-1 < spawnIndex); } LAB_007ebfb9: if ((g_game->_levelStateFlags & 0x20000U) == 0) goto LAB_007ebfd2; } else { LAB_007ebfab: if (iVar5 != 0x17) { if (roomType != 5) { if (roomType == 4) { if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) && (*in_EDX != g_game->_greedModeTreasureRoomIdx)) { roomType = 5; } else if (((uint)in_EDX[0x11] >> 0xb & 1) != 0) { roomType = 0xe; } } else if ((roomType == 0xb) && (*(int *)(iVar4 + 0x10) == 1)) { roomType = 5; } goto LAB_007ebfd2; } goto LAB_007ebfb9; } } roomType = 0xe; LAB_007ebfd2: iVar4 = GetPoolForRoom(&g_game->_itemPool,roomType,in_ECX); roomData = (int *)in_EDX[4]; if (((roomData[2] == 1) && (*roomData == 0x23)) && (roomData[4] == 2)) { iVar4 = 0xf; } return iVar4; } //@@ 007ec080 Room::GetSeededCollectible /* ZHL [lua] Lua binding Room:GetSeededCollectible prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall Room::GetSeededCollectible(Room *this,uint Seed,byte NoDecrease) { int iVar1; iVar1 = ItemPool::GetSeededCollectible(Seed,NoDecrease,this->_descriptor); return iVar1; } //@@ 007ec0a0 ItemPool::GetSeededCollectible /* ZHL [exact] static cleanup int ItemPool::GetSeededCollectible(uint32_t seed, bool noDecrease, RoomDescriptor* roomDesc); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl ItemPool::GetSeededCollectible(uint seed,byte isNoDecrease,RoomDescriptor *roomDesc) { int iVar1; iVar1 = get_pool_from_room_entities(0); if (iVar1 == -1) { iVar1 = GetCollectible(&g_game->_itemPool,0,seed,(uint)isNoDecrease,0,0); return iVar1; } iVar1 = GetCollectible(&g_game->_itemPool,iVar1,seed,(uint)isNoDecrease,0,0); return iVar1; } //@@ 007ec100 Room::TransformEntry /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (Room::TransformEntry?(out,gridIdx,seed)) prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Room::TransformEntry(Room *this,void *entry,uint gridIndex,uint seed) { code *pcVar1; byte bVar2; uint uVar3; int iVar4; uint uVar5; uint preventedCurses; ChallengeParam *challengeParams; uint uVar6; ushort uVar7; Game *game; int endStage; Game *curGame; short sVar8; Manager *extraout_EDX; Manager *manager; undefined4 uVar9; char cVar12; uint uVar10; uint uVar11; ushort *puVar13; int *entityType; bool bVar14; RNG slotRng; uint gridX; ushort *variantPtr; int *entryPtr; uint local_58; int *local_54; RNG rng; uint local_40; Room *room; char isBurningBasement; char isFloodedCaves; char isScarredWomb; char local_33; char local_32; char local_31; ushort *local_30; RNG lockedCardRng; RNG cardRng; uint local_c; undefined1 auStack_8 [4]; void *cardConfigs; ushort *subTypePtr; local_c = __security_cookie ^ (uint)(auStack_8 + 4); uVar7 = 1; entryPtr = entry; local_58 = seed; rng._seed = seed; rng._shift1 = 1; rng._shift2 = 0x15; rng._shift3 = 0x14; room = this; if (*(int *)entry == 0x578) { *(undefined4 *)entry = 0x21; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } rng._seed = seed >> 1 ^ seed; rng._seed = rng._seed << 0x15 ^ rng._seed; rng._seed = (uint)rng._seed >> 0x14 ^ rng._seed; uVar7 = (ushort)(rng._seed == ((uint)rng._seed / 0x28) * 0x28); LAB_007ec1a6: *(ushort *)((int)entry + 4) = uVar7; } else if (*(int *)entry == 0x582) { *(undefined4 *)entry = 0x21; goto LAB_007ec1a6; } local_40 = *(uint *)entry; local_30 = (ushort *)((int)entry + 6); puVar13 = (ushort *)((int)entry + 4); variantPtr = puVar13; local_33 = LuaEngine::Callback_PreEntitySpawn(&local_40,puVar13,local_30,gridIndex,seed); *(uint *)entry = local_40; if ((local_40 == 5) && (*puVar13 == 0x12d)) { *puVar13 = 300; uVar3 = RNG::Next(&rng); iVar4 = ItemPool::GetCardEx(uVar3,0,1,0,1); cardRng._shift3 = 7; cardRng._shift1 = 5; cardRng._shift2 = 9; cardRng._seed = uVar3; iVar4 = lua_callback_run_get_card(&cardRng,iVar4,0,1,1); *(short *)((int)entry + 6) = (short)iVar4; } manager = g_manager; game = g_game; if (local_33 != '\0') { return; } if (*(int *)entry == 5) { local_40 = RNG::Next(&rng); subTypePtr = local_30; game = g_game; uVar7 = *puVar13; if (uVar7 == 0x28) { if (*local_30 == 4) { bVar14 = (manager->_persistentGameData)._achievements[0xe2] == 0; goto LAB_007ec3d4; } } else if (uVar7 == 10) { if (*local_30 == 7) { bVar14 = (manager->_persistentGameData)._achievements[0xe0] == 0; LAB_007ec3d4: if (bVar14) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *local_30 = 0; } goto LAB_007ec4c4; } } else { uVar7 = *local_30; if (uVar7 == 8) { if ((manager->_persistentGameData)._achievements[0x21] == 0) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *local_30 = 3; } goto LAB_007ec4c4; } } else if (uVar7 == 9) { if ((manager->_persistentGameData)._achievements[0x148] == 0) { iVar4 = g_manager->_state; puVar13 = local_30; goto LAB_007ec308; } } else { if (uVar7 == 0xb) { bVar2 = (manager->_persistentGameData)._achievements[0x187]; } else { if (uVar7 != 0xc) goto LAB_007ec4be; bVar2 = (manager->_persistentGameData)._achievements[0x19b]; } if (bVar2 == 0) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *local_30 = 2; } goto LAB_007ec4c4; } } } } else { if (uVar7 == 0x14) { if (*local_30 == 5) { bVar14 = (manager->_persistentGameData)._achievements[0xf2] == 0; } else if (*local_30 == 6) { bVar14 = (manager->_persistentGameData)._achievements[0xf0] == 0; } else { if (*local_30 != 7) goto LAB_007ec4be; bVar14 = (manager->_persistentGameData)._achievements[0x265] == 0; } goto LAB_007ec3d4; } if (uVar7 == 0x1e) { if (*local_30 == 4) { bVar14 = (manager->_persistentGameData)._achievements[0x14d] == 0; goto LAB_007ec3d4; } } else if (uVar7 == 300) { uVar7 = *local_30; if ((((uVar7 != 0) && (cardConfigs = (g_manager->_itemConfig)._cards._begin, (int)(uint)uVar7 < (int)(g_manager->_itemConfig)._cards._end - (int)cardConfigs >> 2)) && (iVar4 = *(int *)((int)cardConfigs + (uint)uVar7 * 4), iVar4 != 0)) && (iVar4 = *(int *)(iVar4 + 4), -1 < iVar4)) { bVar2 = PersistentGameData::Unlocked(&manager->_persistentGameData,iVar4); uVar3 = local_40; if (bVar2 == 0) { iVar4 = ItemPool::GetCardEx(local_40,0x19,10,10,1); lockedCardRng._shift3 = 7; lockedCardRng._seed = uVar3; lockedCardRng._shift1 = 5; lockedCardRng._shift2 = 9; iVar4 = lua_callback_run_get_card(&lockedCardRng,iVar4,1,1,0); *subTypePtr = (ushort)iVar4; } } } else if (uVar7 == 0x45) { if (*local_30 == 2) { bVar14 = (manager->_persistentGameData)._achievements[0x25c] == 0; goto LAB_007ec3d4; } } else if (uVar7 == 0x5a) { if (*local_30 == 4) { bVar14 = (manager->_persistentGameData)._achievements[0x267] == 0; goto LAB_007ec3d4; } } else { if (uVar7 == 0x38) { bVar2 = (manager->_persistentGameData)._achievements[0x261]; } else { if (uVar7 != 0x3a) { if ((uVar7 == 0x39) && ((manager->_persistentGameData)._achievements[0x259] == 0)) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *puVar13 = 0x3c; } goto LAB_007ec4c4; } goto LAB_007ec4be; } bVar2 = (manager->_persistentGameData)._achievements[0x263]; } if (bVar2 == 0) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *puVar13 = 0x32; } goto LAB_007ec4c4; } } } LAB_007ec4be: game = g_game; } else { if (*(int *)entry != 6) goto LAB_007ec4be; uVar7 = *puVar13; if (uVar7 != 0xf) { if (uVar7 == 0x12) { if ((g_manager->_persistentGameData)._achievements[0x266] == 0) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *puVar13 = 7; } goto LAB_007ec4c4; } } else if (uVar7 == 0x11) { if ((g_manager->_persistentGameData)._achievements[0x268] == 0) { if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *(undefined4 *)entry = 5; *puVar13 = 10; *(undefined2 *)((int)entry + 6) = 3; } goto LAB_007ec4c4; } } else if (uVar7 == 0x10) { if ((g_manager->_persistentGameData)._achievements[0x25f] == 0) { iVar4 = g_manager->_state; LAB_007ec308: game = g_game; if (((iVar4 != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *puVar13 = 1; } goto LAB_007ec4c4; } } else if (uVar7 == 0xe) { Game::GetPlayer(g_game,0); iVar4 = FUN_00929b00(); manager = g_manager; if ((iVar4 != 0) && (-1 < *(int *)(iVar4 + 0x7c))) { bVar2 = PersistentGameData::Unlocked (&g_manager->_persistentGameData,*(int *)(iVar4 + 0x7c)); manager = extraout_EDX; if (bVar2 == 0) goto LAB_007ec4be; } game = g_game; if (((manager->_persistentGameData)._achievements[0x1b2] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { *(undefined4 *)entry = 0x11; *(undefined4 *)((int)entry + 4) = 0; } else { *(undefined4 *)entry = 5; *(undefined4 *)((int)entry + 4) = 0x2b00064; } goto LAB_007ec4c4; } goto LAB_007ec4be; } if ((g_manager->_persistentGameData)._achievements[0x260] != 0) goto LAB_007ec4be; if (((g_manager->_state != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) { *puVar13 = 5; } } LAB_007ec4c4: uVar3 = game->_debugCurses; uVar6 = game->_stage; uVar10 = game->_curses; uVar5 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); game = g_game; uVar11 = uVar6 + 1; if ((~preventedCurses & (uVar5 | uVar3 | uVar10) & 2) == 0) { uVar11 = uVar6; } iVar4 = g_game->_difficulty; if ((iVar4 == 2) || (local_40 = uVar11, iVar4 == 3)) { if ((int)uVar11 < 5) { local_40 = uVar11 * 2 - 1; } else { local_40 = 0; if (uVar11 == 5) { local_40 = 10; } } } uVar3 = local_40; local_30 = (ushort *)g_game->_stageType; if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) { LAB_007ec7f3: local_32 = '\x01'; } else { challengeParams = Game::GetChallengeParams(g_game); local_32 = '\0'; if (challengeParams->_pathType == 1) goto LAB_007ec7f3; } if ((game->_challenge == 0) && ((game->_dailyChallenge)._id == 0)) { LAB_007ec81d: local_31 = '\0'; } else { challengeParams = Game::GetChallengeParams(game); local_31 = '\x01'; if (challengeParams->_pathType != 1) goto LAB_007ec81d; } entityType = entryPtr; if ((iVar4 == 2) || (iVar4 == 3)) { if ((*entryPtr == 9000) && ((game->_currentRoomIdx == -0xc && (bVar2 = Level::IsNextStageAvailable((Level *)game), bVar2 == 0)))) goto LAB_007ec9c4; goto LAB_007ec9e3; } if (*entryPtr != 9000) goto LAB_007ec8f4; if (((game->_stage < 1) || (6 < game->_stage)) || ((game->_gameStateFlags & 0x1000000000000) == 0) ) { if ((uVar3 == 0xb) && (room->_roomType == 3)) { challengeParams = Game::GetChallengeParams(game); curGame = g_game; iVar4 = 0xc; if ((challengeParams->_endStage != 0xc) && (((game->_challenge != 0 || ((game->_dailyChallenge)._id != 0)) || (((g_manager->_persistentGameData)._achievements[0x140] == 0 && ((g_manager->_state != 2 || (game->_isDebug == 0)))))))) { iVar4 = 0xb; } endStage = iVar4; if (challengeParams->_isPathTypeSet != 0) { endStage = challengeParams->_endStage; if (challengeParams->_endStage == 0) { endStage = iVar4; } if (challengeParams->_pathType == 3) goto LAB_007ec8f4; } if (endStage < 0xc) goto LAB_007ec8f4; *(undefined2 *)(entityType + 1) = 1; } else { LAB_007ec8f4: if (*entityType == 9000) { if ((room->_roomType == 3) && (bVar2 = Level::IsNextStageAvailable((Level *)game), bVar2 == 0)) { LAB_007ec9c4: curGame = g_game; *entityType = 0x238c; *(undefined2 *)(entityType + 1) = 3; goto LAB_007ec9e6; } if ((*entityType == 9000) && ((room->_roomType == 0xf || ((((room->_roomType == 3 && ((uVar3 == 8 || (uVar3 == 9)))) && (((uVar6 = RNG::RandomInt(&rng,2), uVar6 == 0 && (local_32 != '\0')) || (local_31 != '\0')))) || (((9 < (int)uVar3 && (local_30 != (ushort *)0x0)) || (g_game->_currentRoomIdx == -0xc)) )))))) { bVar2 = Level::IsNextStageAvailable((Level *)g_game); if (bVar2 == 0) goto LAB_007ec9c4; bVar2 = Level::IsStageWithinEnd(10,1); if (bVar2 != 0) goto LAB_007ec98c; } } LAB_007ec9e3: curGame = g_game; } } else { LAB_007ec98c: curGame = g_game; *entityType = 999; *(undefined2 *)(entityType + 1) = 0x27; } LAB_007ec9e6: puVar13 = (ushort *)(entityType + 1); if (((room->_roomType == 4) && ((*(uint *)((int)room->_descriptor + 0x44) >> 0xb & 1) != 0)) && ((*entityType == 5 && ((*puVar13 == 100 && (*(short *)((int)entityType + 6) == 0)))))) { *puVar13 = 0x96; } if (*entityType == 6) { slotRng._seed = local_58; slotRng._shift3 = 0xd; slotRng._shift1 = 0xb; slotRng._shift2 = 0x11; if (*puVar13 == 6) { if ((((g_manager->_persistentGameData)._achievements[0x260] != 0) || (((g_manager->_state == 2 && (curGame != (Game *)0x0)) && (((curGame->_dailyChallenge)._id != 0 || (curGame->_isDebug != 0)))))) && (0 < curGame->_devilRoomDeals)) { uVar6 = RNG::RandomInt(&slotRng,4); if (uVar6 == 0) { uVar7 = 0xf; goto LAB_007ecad2; } goto LAB_007ecad5; } } else if ((*puVar13 == 4) && (((g_manager->_persistentGameData)._achievements[0x266] != 0 || (((g_manager->_state == 2 && (curGame != (Game *)0x0)) && (((curGame->_dailyChallenge)._id != 0 || (curGame->_isDebug != 0)))))))) { uVar6 = RNG::RandomInt(&slotRng,0xf); if (uVar6 == 0) { uVar7 = 0x12; LAB_007ecad2: *puVar13 = uVar7; } LAB_007ecad5: curGame = g_game; } } if (*entityType - 1U < 999) { local_54 = (int *)(uint)*puVar13; Entity_NPC::Redirect(entityType,(int *)&local_54); curGame = g_game; *puVar13 = (ushort)local_54; } if ((room->_descriptor == (void *)0x0) || (iVar4 = *(int *)((int)room->_descriptor + 0x10), iVar4 == 0)) { bVar2 = 0; } else { bVar2 = (byte)*(undefined4 *)(iVar4 + 0x4c) & 1; } if (bVar2 != 0) { return; } if (room->_roomType == 0x1b) { return; } local_30 = (ushort *)curGame->_stageType; if ((((uVar3 != 3) && (uVar3 != 4)) || (local_30 == (ushort *)0x4)) || (local_33 = '\x01', local_30 == (ushort *)0x5)) { local_33 = '\0'; } if ((local_30 == (ushort *)0x2) && ((uVar3 == 1 || (uVar3 == 2)))) { uVar9 = 0x100; isBurningBasement = '\x01'; LAB_007ecb70: if ((uVar3 != 3) && (uVar3 != 4)) goto LAB_007ecb80; isFloodedCaves = '\x01'; LAB_007ecb89: if ((uVar3 != 5) && (uVar3 != 6)) goto LAB_007ecb99; local_31 = '\x01'; LAB_007ecba2: if ((uVar3 != 7) && (uVar3 != 8)) goto LAB_007ecbb2; isScarredWomb = '\x01'; } else { uVar9 = 0; isBurningBasement = '\0'; if (local_30 == (ushort *)0x2) goto LAB_007ecb70; LAB_007ecb80: isFloodedCaves = '\0'; if (local_30 == (ushort *)0x2) goto LAB_007ecb89; LAB_007ecb99: local_31 = '\0'; if (local_30 == (ushort *)0x2) goto LAB_007ecba2; LAB_007ecbb2: isScarredWomb = '\0'; } if (((g_manager->_persistentGameData)._achievements[0x15c] == 0) && ((g_manager->_state != 2 || (((curGame->_dailyChallenge)._id == 0 && (curGame->_isDebug == 0))) ))) { sVar8 = (short)((uint)uVar9 >> 8) << 8; } else { sVar8 = (short)CONCAT31((int3)((uint)uVar9 >> 8),1); } iVar4 = *entityType; local_32 = (char)sVar8; if (0x12e < iVar4) goto switchD_007ecc0d_caseD_b; if (iVar4 == 0x12e) { if ((curGame->_dailyChallenge)._specialDailyId != 7) { if (curGame->_challenge != 0x20) goto switchD_007ecc0d_caseD_b; } uVar6 = RNG::RandomInt(&rng,5); if (uVar6 == 0) { *puVar13 = 10; return; } goto switchD_007ecc0d_caseD_b; } cVar12 = (char)((ushort)sVar8 >> 8); switch(iVar4) { case 10: goto LAB_007ecc16; case 0xc: uVar6 = RNG::RandomInt(&rng,0x3c); if (uVar6 == 0) { *entityType = 0x32c; *puVar13 = 0; return; } break; case 0x16: bVar14 = isFloodedCaves == '\0'; goto LAB_007ecc9f; case 0x17: if ((isFloodedCaves != '\0') && (uVar6 = RNG::RandomInt(&rng,2), uVar6 == 0)) { *entityType = 0x17; *puVar13 = 1; return; } break; case 0x18: cVar12 = local_31; goto LAB_007eccd6; case 0x19: cVar12 = isFloodedCaves; LAB_007eccd6: if (cVar12 != '\0') { uVar6 = 2; LAB_007eccde: uVar6 = RNG::RandomInt(&rng,uVar6); if (uVar6 == 0) goto LAB_007ecc2f; } break; case 0x1b: if (((local_33 != '\0') && (uVar6 = RNG::RandomInt(&rng,5), uVar6 == 0)) && (local_32 != '\0')) { *entityType = 300; *puVar13 = 0; return; } break; case 0x1d: if (((*puVar13 == 0) && (cVar12 != '\0')) && (uVar6 = RNG::RandomInt(&rng,5), uVar6 < 3)) { *entityType = 0x36; *puVar13 = 0; return; } break; case 0x23: uVar6 = 0xf; goto LAB_007eccde; case 0x27: if (((*puVar13 != 2) && (isScarredWomb != '\0')) && (uVar6 = RNG::RandomInt(&rng,2), uVar6 == 0) ) { *puVar13 = 3; return; } break; case 0x28: case 0x3a: bVar14 = isScarredWomb == '\0'; goto LAB_007ecc9f; case 0x29: if (*puVar13 == 0) { uVar6 = 0x3c; goto LAB_007eccde; } break; case 0x55: if (((local_30 == (ushort *)0x4) || (local_30 == (ushort *)0x5)) && ((uVar3 == 1 || (uVar3 == 2)))) { *entityType = 0x32e; *puVar13 = 0; return; } goto LAB_007ecf5d; case 0xd0: if (((local_32 != '\0') && (*puVar13 == 1)) && (uVar6 = RNG::RandomInt(&rng,10), uVar6 == 0)) { *entityType = 0x12e; *puVar13 = 0; return; } cVar12 = isBurningBasement; LAB_007ecc16: if (cVar12 != '\0') { uVar6 = RNG::RandomInt(&rng,5); bVar14 = uVar6 < 3; LAB_007ecc29: if (bVar14) { LAB_007ecc2f: *puVar13 = 2; return; } } break; case 0xd4: case 0xdc: bVar14 = local_31 == '\0'; LAB_007ecc9f: if (!bVar14) { uVar6 = RNG::RandomInt(&rng,2); if (uVar6 == 0) { LAB_007eccb7: *puVar13 = 1; return; } } break; case 0xe2: if (cVar12 == '\0') break; uVar6 = RNG::RandomInt(&rng,5); bVar14 = uVar6 < 2; goto LAB_007ecc29; case 0xe7: uVar6 = RNG::RandomInt(&rng,5); if (uVar6 == 0) { if (local_32 != '\0') { local_58 = gridIndex / (uint)room->_gridWidth; gridX = gridIndex % (uint)room->_gridWidth; local_54 = room->_doorGridPositions; uVar3 = 0; do { puVar13 = variantPtr; if (((*(uint *)((int)room->_descriptor + (uVar3 >> 5) * 4 + 0x18) & 1 << ((byte)uVar3 & 0x1f)) != 0) && (uVar6 = *local_54 / room->_gridWidth - local_58, uVar5 = *local_54 % room->_gridWidth - gridX, uVar10 = (int)uVar6 >> 0x1f, uVar11 = (int)uVar5 >> 0x1f, (int)(((uVar6 ^ uVar10) - uVar10) + ((uVar5 ^ uVar11) - uVar11)) < 4)) { entityType = entryPtr; uVar3 = local_40; goto switchD_007ecc0d_caseD_b; } uVar3 = uVar3 + 1; local_54 = local_54 + 1; } while ((int)uVar3 < 8); goto LAB_007eccb7; } } } switchD_007ecc0d_caseD_b: LAB_007ecf5d: local_32 = '\0'; local_33 = '\0'; local_31 = '\0'; if (*puVar13 == 0) { switch(*entityType) { case 0xe: case 0x10: case 0x18: case 0x1a: case 0x1b: switchD_007ecf80_caseD_e: local_32 = '\x01'; break; case 0x19: if (2 < (int)uVar3) goto switchD_007ecf80_caseD_e; break; case 0x1d: case 0x1e: case 0x26: case 0x2a: case 0x39: case 0x3d: case 0x58: local_31 = '\x01'; break; case 0x27: if (((uVar3 == 7) || (uVar3 == 8)) && (local_30 == (ushort *)0x1)) { local_31 = '\x01'; } break; case 0x29: case 0x37: case 0x3c: local_33 = '\x01'; } } switch(*entityType) { case 0xf: case 0x10: case 0x1a: case 0x1e: case 0x27: case 0x37: case 0x58: uVar3 = RNG::RandomInt(&rng,100); if (uVar3 == 0) { *puVar13 = 2; } } if (local_33 == '\0') { if ((local_32 == '\0') && (local_31 == '\0')) goto LAB_007ed028; uVar3 = RNG::RandomInt(&rng,0x15); if (uVar3 != 0) goto LAB_007ecffe; } else { LAB_007ecffe: if (((local_31 != '\0') || (uVar3 = RNG::RandomInt(&rng,0x19), uVar3 != 0)) && (uVar3 = RNG::RandomInt(&rng,100), uVar3 != 0)) goto LAB_007ed028; } *puVar13 = 1; LAB_007ed028: if (((*entityType == 0x19) && (*puVar13 == 3)) && (*(short *)((int)entityType + 6) == 100)) { uVar3 = RNG::RandomInt(&rng,2); *(short *)((int)entityType + 6) = (short)uVar3; } return; } //@@ 007ed240 FUN_007ed240 undefined4 FUN_007ed240(void) { uint uVar1; uint uVar2; Game *this; uint uVar3; uint uVar4; RoomDescriptor *pRVar5; this = g_game; if (g_game->_stage != 6) { if (g_game->_stage != 5) { return 0; } uVar1 = g_game->_debugCurses; uVar2 = g_game->_curses; uVar3 = Seeds::GetForcedCurses(); uVar4 = Seeds::GetPreventedCurses(); if ((~uVar4 & (uVar3 | uVar1 | uVar2) & 2) == 0) { return 0; } } pRVar5 = Level::GetRoomByIdx((Level *)this,this->_currentRoomIdx,-1); if (pRVar5->ListIndex == g_game->_lastBossRoomListIdx) { return 1; } return 0; } //@@ 007ed2a0 Room::IsPersistentRoomEntity /* ZHL [exact] bool Room::IsPersistentRoomEntity(int type, int variant, int subtype); */ undefined4 Room::IsPersistentRoomEntity(int param_1,int param_2) { if ((((param_1 != 0x2a) && (param_1 != 0xeb)) && (param_1 != 0xec)) && ((param_1 != 0xca && (param_1 != 0xcb)))) { if (param_1 == 0x2c) { if (param_2 == 0) { return 0; } } else if ((((param_1 != 0xda) && (param_1 != 0x324)) && ((param_1 != 0x329 && (((param_1 != 0x36d && (param_1 != 0x37d)) && (param_1 != 0x354)))))) && (param_1 != 0x3c5)) { return 0; } } return 1; } //@@ 007ed310 Room::SpawnEntry /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: src/rooms decompile labels (Room::SpawnEntry(gridIdx,Entry*,seed,b,b) ret14) */ byte __thiscall Room::SpawnEntry(void) { int *piVar1; code *pcVar2; byte bVar3; char cVar4; undefined2 newVariant; uint uVar5; int iVar6; Entity_Player *itemOwner; void *extraout_EAX; void *pvVar7; int iVar8; uint uVar9; Entity *pEVar10; GridEntity *gridEntity; byte unused; byte unused_00; void *in_ECX; Manager *extraout_ECX; Manager *extraout_ECX_00; Manager *extraout_ECX_01; Manager *pMVar11; int extraout_ECX_02; int extraout_ECX_03; uint extraout_EDX; Room *pRVar12; Game *game; undefined4 *gridVariant; float fVar13; float fVar14; float fVar15; float fVar16; float in_stack_00000004; ulonglong *in_stack_00000008; float in_stack_0000000c; undefined4 *in_stack_00000010; char in_stack_00000014; EntityRef entityRef; float ellipseCenterX; Vector local_7c; Vector local_74; PlayerManager *local_6c; RNG tmpRng; float local_58; float local_54; RNG rng; float local_40; float local_3c; float gridIndex; char local_31; Entity *local_30; undefined4 *local_2c; Manager *local_28; Room *room; undefined8 entry; undefined4 entryWeight; undefined4 local_14; bool isUnlocked; short *poopCount; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; local_2c = in_stack_00000010; rng._shift1 = 5; rng._shift2 = 9; entry = *in_stack_00000008; entryWeight = (undefined4)in_stack_00000008[1]; local_30 = (Entity *)in_stack_0000000c; rng._seed = (int)in_stack_0000000c; local_28 = (Manager *)&DAT_00000007; rng._shift3 = (int)&DAT_00000007; gridIndex = in_stack_00000004; local_54 = in_stack_0000000c; room = in_ECX; TransformEntry(in_ECX,&entry,(uint)in_stack_00000004,(uint)in_stack_0000000c); if (((g_game->_currentRoomIdx == -0xc) && ((uint)entry == 5)) && (entry._4_2_ == 100)) goto LAB_007ed567; bVar3 = Level::HasMirrorDimension((Level *)g_game); if ((((bVar3 != 0) && (in_stack_00000014 == '\0')) && ((g_game->_currentDimensionIdx == 1 && ((uint)entry == 5)))) && ((iVar6 = *(int *)((int)room->_descriptor + 0x10), *(int *)(iVar6 + 8) != 4 || (*(int *)(iVar6 + 0x10) != 0x22)))) goto LAB_007ed567; pvVar7 = room->_descriptor; if ((pvVar7 == (void *)0x0) || (*(int *)((int)pvVar7 + 0x10) == 0)) { bVar3 = 0; } else { bVar3 = (byte)(*(uint *)(*(int *)((int)pvVar7 + 0x10) + 0x4c) >> 3) & 1; } iVar6 = (uint)entry; if (bVar3 != 0) { if ((uint)entry == 1000) { if ((float)room->_tintedRockIdx != gridIndex) goto LAB_007ed444; } else if (((uint)entry == 0x3e9) || ((uint)entry == 0x3ea)) { LAB_007ed444: if ((g_game->_stageType == 2) && (*(int *)(*(int *)((int)pvVar7 + 0x10) + 8) == 1)) { if (local_54 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = (uint)local_30 >> ((byte)rng._shift1 & 0x1f) ^ (uint)local_30; uVar5 = uVar5 << ((byte)rng._shift2 & 0x1f) ^ uVar5; rng._seed = uVar5 >> ((byte)local_28 & 0x1f) ^ uVar5; local_30 = (Entity *)rng._seed; if ((uint)rng._seed % 10 == 0) { iVar8 = g_game->_stage; if ((iVar8 == 1) || (iVar8 == 2)) { entry = CONCAT44(entry._4_4_,0x21); uVar5 = RNG::RandomInt(&rng,0x28); iVar6 = (uint)entry; entry = (ulonglong)CONCAT14(uVar5 == 0,(uint)entry); local_28 = (Manager *)rng._shift3; local_30 = (Entity *)rng._seed; } else if ((iVar8 == 3) || (iVar8 == 4)) { entry = 3000; iVar6 = 3000; } else if ((iVar8 == 5) || (iVar8 == 6)) { entry = 0x78a; iVar6 = 0x78a; } else if ((iVar8 == 7) || (iVar8 == 8)) { entry = 0x5d2; iVar6 = 0x5d2; } } } } } pMVar11 = (Manager *)room; if (((room->_roomType == 2) && (*(int *)room->_descriptor < 0)) && (iVar6 == 6)) { if (entry._4_2_ == 8) goto LAB_007ed567; LAB_007ed9e7: bVar3 = *(byte *)((int)room->_descriptor + 0x44); local_54 = (float)(CONCAT31((int3)((uint)pMVar11 >> 8),bVar3) & 0xffffff01); if ((((bVar3 & 1) == 0) && (room->_roomType == 5)) && ((*(uint *)((int)room->_descriptor + 0x44) & 0x10000) != 0)) { local_54 = (float)(uint)(iVar6 != 0x38f); } if (iVar6 == 5) { bVar3 = Level::IsMausoleumHeartStage((Level *)g_game); if (bVar3 != 0) goto LAB_007ed567; iVar6 = (uint)entry; } game = g_game; if (((iVar6 == 0x3c5) && ((*(uint *)((int)room->_descriptor + 0x44) >> 2 & 1) != 0)) || ((((SUB41(local_54,0) != '\0' && ((cVar4 = IsPersistentRoomEntity(), cVar4 == '\0' && (bVar3 = Game::IsInTimedSet(game,0x19), bVar3 == 0)))) && (bVar3 = Game::IsInTimedSet(game,0x20), bVar3 == 0)) && ((in_stack_00000014 == '\0' && (cVar4 = entity_type_is_saved(), cVar4 == '\0')))))) goto LAB_007ed567; EntityRef::EntityRef(&entityRef); pRVar12 = room; fVar16 = gridIndex; if (((uint)gridIndex < 0x1c0) && (room->_gridEntities[(int)gridIndex] != (int *)0x0)) { (**(code **)(*(int *)room->_gridEntities[(int)gridIndex] + 0x14))(1); } local_74.x = (float)((int)fVar16 % pRVar12->_gridWidth) * 40.0 + 40.0; local_74.y = (float)((int)fVar16 / pRVar12->_gridWidth) * 40.0 + 120.0; uVar5 = RNG::Next(&rng); local_30 = Game::Spawn(g_game,(uint)entry,(uint)entry._4_2_,&local_74,&g_vectorZero, (Entity *)0x0,(uint)entry._6_2_,uVar5); local_30->_spawnGridIndex = (int)fVar16; if (local_30->_type == 5) { iVar6 = __RTDynamicCast(local_30,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor); if (iVar6 != 0) { *(undefined4 *)(iVar6 + 0x544) = 0; if (((*(int *)(iVar6 + 0x28) == 5) && (*(int *)(iVar6 + 0x2c) == 100)) && ((*(int *)(iVar6 + 0x30) == 0x272 || (*(int *)(iVar6 + 0x30) == 0x273)))) { *(undefined4 *)(iVar6 + 0x5c0) = 0; } itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2c7,(RNG **)&g_game->_playerManager,1); if ((itemOwner != (Entity_Player *)0x0) && (*(char *)(iVar6 + 0x173) == '\0')) { bVar3 = Entity_Pickup::CanRerollVariant(*(int *)(iVar6 + 0x2c),*(int *)(iVar6 + 0x30)); if ((bVar3 != 0) && (((bVar3 = Entity_Pickup::IsChest(*(int *)(iVar6 + 0x2c)), bVar3 == 0 || (*(int *)(iVar6 + 0x30) != 0)) && (extraout_ECX_02 == 100)))) { local_7c.y = (float)operator_new(0x78); if ((EntitySaveState *)local_7c.y == (EntitySaveState *)0x0) { pvVar7 = (void *)0x0; } else { EntitySaveState::constructor((EntitySaveState *)local_7c.y); pvVar7 = extraout_EAX; } piVar1 = (int *)(iVar6 + 0x5c8); EntitySaveStateRef::Set(piVar1,pvVar7); tmpRng._shift1 = 5; tmpRng._shift2 = 0xf; *(undefined4 *)*piVar1 = *(undefined4 *)(iVar6 + 0x28); *(undefined4 *)(*piVar1 + 4) = *(undefined4 *)(iVar6 + 0x2c); tmpRng._seed = *(int *)(iVar6 + 0x3ec); tmpRng._shift3 = 0x11; uVar5 = RNG::Next(&tmpRng); *(uint *)(*piVar1 + 0x34) = uVar5; iVar8 = ItemPool::GetSeededCollectible (*(uint *)(*piVar1 + 0x34),1, *(RoomDescriptor **)((int)g_game->_room + 4)); *(int *)(*piVar1 + 8) = iVar8; pRVar12 = room; } } ANM2::Reset((ANM2 *)(iVar6 + 0x5d0)); } fVar16 = gridIndex; } cVar4 = entity_type_is_saved(); if (cVar4 != '\0') { local_3c = fVar16; std::set::insert(&local_7c,&local_3c); } iVar6 = pRVar12->_roomType; if (iVar6 == 0x11) { LAB_007edd85: if (((uint)entry == 5) && ((entry._4_2_ == 100 && (local_30->_type == 5)))) { local_30[1]._sprite._championColor._tint[0] = 1.4013e-45; } } else if (iVar6 == 4) { iVar6 = *(int *)(*(int *)((int)pRVar12->_descriptor + 0x10) + 0x10); if (((iVar6 == 1) || (iVar6 == 3)) || (bVar3 = Level::IsAltPath((Level *)g_game), bVar3 != 0)) goto LAB_007edd85; } else if ((iVar6 == 0x18) || (iVar6 == 0xf)) goto LAB_007edd85; pEVar10 = local_30; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { KAGE_LogMessage(1,(byte *)"[Frame %d] "); } KAGE_LogMessage(1,(byte *)"Spawn Entity with Type(%d), Variant(%d), Pos(%.2f,%.2f)\n"); if (local_2c != (undefined4 *)0x0) { *local_2c = pEVar10; return 1; } goto LAB_007ee699; } if (iVar6 == 1000) { if ((float)room->_tintedRockIdx != gridIndex) goto LAB_007ed5aa; goto LAB_007ed926; } if ((iVar6 == 0x3e9) || (iVar6 == 0x3ea)) { LAB_007ed5aa: if (room->_roomType != 0x10) { local_3c = 2.66247e-44; local_6c = &g_game->_playerManager; tmpRng._shift1 = 1; tmpRng._shift2 = 5; if (local_54 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = (uint)local_54 >> 1 ^ (uint)local_54; uVar5 = uVar5 << 5 ^ uVar5; uVar5 = uVar5 >> 0x13 ^ uVar5; itemOwner = PlayerManager::RandomCollectibleOwner(local_6c,0x240,uVar5,(RNG **)0x0); pMVar11 = extraout_ECX; if (itemOwner != (Entity_Player *)0x0) { local_3c = itemOwner->_luck * 0.005 + 0.0625; if (0.1 <= local_3c) { local_3c = 0.1; } if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = uVar5 >> ((byte)tmpRng._shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)tmpRng._shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> 0x13 ^ uVar5; pMVar11 = (Manager *)0x0; if ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10 <= local_3c) { iVar6 = 0x5dc; entry = 0x5dc; goto LAB_007ed926; } } iVar6 = (uint)entry; } } if (iVar6 == 0x514) { if (local_30 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = (uint)local_30 >> ((byte)rng._shift1 & 0x1f) ^ (uint)local_30; uVar5 = uVar5 << ((byte)rng._shift2 & 0x1f) ^ uVar5; rng._seed = uVar5 >> ((byte)local_28 & 0x1f) ^ uVar5; pMVar11 = (Manager *)(((uint)rng._seed / 10) * 10); local_30 = (Entity *)rng._seed; if ((uint)rng._seed % 10 != 0) goto LAB_007ed72b; iVar6 = 0x124; entry._4_4_ = 0; LAB_007ed9e4: entry = CONCAT44(entry._4_4_,iVar6); goto LAB_007ed9e7; } LAB_007ed72b: if (iVar6 != 9000) { if (iVar6 != 999) goto LAB_007ed79c; if (entry._4_2_ == 0x27) goto LAB_007ed746; LAB_007ed9df: iVar6 = 1000; goto LAB_007ed9e4; } LAB_007ed746: bVar3 = Level::IsNextStageAvailable((Level *)g_game); if ((((bVar3 == 0) && (iVar6 = room->_roomType, iVar6 != 3)) && ((iVar6 != 0x1b && (g_game->_currentRoomIdx != -0xc)))) && ((iVar6 != 5 || (*(int *)(*(int *)((int)room->_descriptor + 0x10) + 0x10) != 0x58)))) { iVar6 = 0x794; entry = 0x794; pMVar11 = extraout_ECX_00; goto LAB_007ed926; } pMVar11 = extraout_ECX_00; iVar6 = (uint)entry; LAB_007ed79c: if (iVar6 == 9000) { LAB_007ed7b7: bVar3 = Level::HasMirrorDimension((Level *)g_game); if ((bVar3 != 0) && (g_game->_currentDimensionIdx == 1)) { iVar6 = 0; entry = 0; pMVar11 = extraout_ECX_01; goto LAB_007ed926; } pMVar11 = extraout_ECX_01; iVar6 = (uint)entry; } else if (iVar6 == 999) { if (entry._4_2_ != 0x27) goto LAB_007ed9df; goto LAB_007ed7b7; } if (iVar6 == 0x11) { if (entry._4_2_ == 0) { if (local_30 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = (uint)local_30 >> ((byte)rng._shift1 & 0x1f) ^ (uint)local_30; uVar5 = uVar5 << ((byte)rng._shift2 & 0x1f) ^ uVar5; rng._seed = uVar5 >> ((byte)local_28 & 0x1f) ^ uVar5; pMVar11 = local_28; local_30 = (Entity *)rng._seed; if (((rng._seed & 3U) != 0) || ((pMVar11 = g_manager, (g_manager->_persistentGameData)._achievements[0xf7] == 0 && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))))) goto LAB_007ed870; newVariant = 3; LAB_007ed8ea: entry._0_6_ = CONCAT24(newVariant,(uint)entry); rng._seed = (int)local_30; } else { LAB_007ed870: if (entry._4_2_ == 1) { if (local_30 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = (uint)local_30 >> ((byte)rng._shift1 & 0x1f) ^ (uint)local_30; uVar5 = uVar5 << ((byte)rng._shift2 & 0x1f) ^ uVar5; rng._seed = uVar5 >> ((byte)local_28 & 0x1f) ^ uVar5; pMVar11 = local_28; local_30 = (Entity *)rng._seed; if (((rng._seed & 3U) == 0) && (((g_manager->_persistentGameData)._achievements[0xf3] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { newVariant = 4; goto LAB_007ed8ea; } } } } if (iVar6 == 5000) { if ((*(uint *)(g_game->_bossPool)._removedBosses._begin & 0x1000000) != 0) { iVar6 = 1000; entry = 0x10000000003e8; } LAB_007ed926: if (in_stack_00000014 != '\0') goto LAB_007ed567; } else if ((iVar6 < 1) || (999 < iVar6)) goto LAB_007ed926; game = g_game; if (iVar6 == 0x3ca) goto LAB_007ee699; if (iVar6 == 0x3c9) { add_trigger_output_cell(); add_trigger_output_cell(); add_trigger_output_cell(); add_trigger_output_cell(); return 1; } if (iVar6 == 6000) { (room->_railManager)._sprite._filename._buf[(int)gridIndex + -0x1c0] = entry._4_1_; return 1; } if ((0 < iVar6) && (iVar6 < 1000)) { if (iVar6 != 999) goto LAB_007ed9e7; goto LAB_007ed9df; } if (iVar6 == 0x1771) { iVar6 = 3000; (room->_railManager)._sprite._filename._buf[(int)gridIndex + -0x1c0] = entry._4_1_; entry = CONCAT26(entry._6_2_,3000); } if (room->_gridEntities[(int)gridIndex] != (void *)0x0) goto LAB_007ed567; local_2c = (undefined4 *)(uint)entry._4_2_; local_6c = (PlayerManager *)0x0; local_31 = has_room_config_flag(); local_3c = 2.8026e-45; pRVar12 = room; if (iVar6 < 0x515) { if (iVar6 == 0x514) { iVar6 = 0xc; local_28 = (Manager *)0xc; gridVariant = (undefined4 *)extraout_EDX; goto LAB_007ee65c; } switch(iVar6) { case 1000: if ((local_31 != '\0') || (entry._6_2_ != 0)) { iVar6 = 2; local_28 = (Manager *)0x2; gridVariant = (undefined4 *)extraout_EDX; break; } if (((g_manager->_persistentGameData)._achievements[0x264] != 0) || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) { tmpRng._shift1 = 3; tmpRng._shift2 = 3; tmpRng._seed = *(int *)(*(int *)(extraout_ECX_03 + 4) + 0x58); tmpRng._shift3 = 0x1a; uVar5 = RNG::RandomInt(&tmpRng,10); if (uVar5 == 0) { local_74.y = RNG::RandomFloat(&tmpRng); pRVar12 = room; local_30 = (Entity *)(float)room->_gridHeight; local_74.y = local_74.y * (float)local_30; ellipseCenterX = RNG::RandomFloat(&tmpRng); ellipseCenterX = ellipseCenterX * (float)pRVar12->_gridWidth; local_28 = (Manager *)0x3fa00000; local_30 = (Entity *)0x3e99999a; uVar5 = Game::GetStageID(g_game,unused); if ((uVar5 == 0x1d) || (uVar5 = Game::GetStageID(g_game,unused_00), uVar5 == 0x1e)) { local_28 = (Manager *)0x3fe66666; local_30 = (Entity *)0x3f000000; } local_58 = RNG::RandomFloat(&tmpRng); local_40 = RNG::RandomFloat(&tmpRng); local_7c.y = (local_58 + local_40) * (float)local_30 + 0.3; local_40 = RNG::RandomFloat(&tmpRng); local_58 = RNG::RandomFloat(&tmpRng); local_30 = (Entity *)((local_40 + local_58) * (float)local_28 + 0.5); fVar16 = RNG::RandomFloat(&tmpRng); uVar5 = pRVar12->_gridWidth; uVar9 = (uint)gridIndex / uVar5; uVar5 = (uint)gridIndex % uVar5; local_40 = -(fVar16 * 360.0) * 0.017453292; local_58 = cos(local_40); fVar16 = sin(local_40); fVar15 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) - ellipseCenterX; fVar13 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) - local_74.y; fVar14 = (fVar15 * local_58 - fVar16 * fVar13) / (float)local_30; fVar16 = (fVar15 * fVar16 + local_58 * fVar13) / local_7c.y; local_31 = fVar16 * fVar16 + fVar14 * fVar14 <= 1.0; } } uVar5 = RNG::RandomInt(&rng,0x3e9); if ((float)room->_tintedRockIdx == gridIndex) { local_28 = (Manager *)0x4; uVar5 = RNG::RandomInt(&rng,0x14); if ((uVar5 == 0) && (((g_manager->_persistentGameData)._achievements[0x143] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { iVar6 = 0x16; local_28 = (Manager *)0x16; } else { iVar6 = 4; } } else { if (9 < (int)uVar5) { pRVar12 = room; gridVariant = local_2c; if (local_31 == '\0') { iVar6 = (uint)((int)uVar5 < 0x10) * 4 + 2; local_28 = (Manager *)iVar6; } else { iVar6 = 0x1b; local_28 = (Manager *)0x1b; } break; } iVar6 = 5; local_28 = (Manager *)0x5; } goto LAB_007ee659; case 0x3e9: iVar6 = 5; local_28 = (Manager *)0x5; gridVariant = (undefined4 *)extraout_EDX; break; case 0x3ea: iVar6 = 6; local_28 = (Manager *)0x6; gridVariant = (undefined4 *)extraout_EDX; break; case 0x3eb: iVar6 = 4; local_28 = (Manager *)0x4; gridVariant = (undefined4 *)extraout_EDX; break; case 0x3ec: iVar6 = 0x16; local_28 = (Manager *)0x16; gridVariant = (undefined4 *)extraout_EDX; break; default: goto switchD_007ede2a_caseD_3ed; case 0x3f0: iVar6 = 0x1a; local_28 = (Manager *)0x1a; gridVariant = (undefined4 *)extraout_EDX; break; case 0x3f1: iVar6 = 2; local_28 = (Manager *)0x2; gridVariant = (undefined4 *)10000; break; case 0x3f2: iVar6 = 0x19; local_28 = (Manager *)0x19; gridVariant = (undefined4 *)extraout_EDX; break; case 0x3f3: if (((g_manager->_persistentGameData)._achievements[0x264] == 0) && (((g_manager->_state != 2 || (game == (Game *)0x0)) || (((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) { isUnlocked = false; } else { isUnlocked = true; } iVar6 = 0x1b; if (!isUnlocked) { iVar6 = 2; } gridVariant = (undefined4 *)extraout_EDX; local_28 = (Manager *)iVar6; } goto LAB_007ee65c; } if (0x76c < iVar6) { if (4000 < iVar6) { if (iVar6 < 0x17d5) { if (iVar6 == 0x17d4) { iVar6 = 0x17; local_28 = (Manager *)0x17; gridVariant = (undefined4 *)extraout_EDX; } else { if (0x1389 < iVar6) { if (iVar6 == 0x1771) goto switchD_007ee4c1_caseD_bb8; goto switchD_007ede2a_caseD_3ed; } if (iVar6 == 0x1389) { iVar6 = 0x15; local_28 = (Manager *)0x15; gridVariant = (undefined4 *)1; } else if (iVar6 == 0x1194) { iVar6 = 0x14; local_28 = (Manager *)0x14; gridVariant = (undefined4 *)extraout_EDX; } else { if (iVar6 != 5000) goto switchD_007ede2a_caseD_3ed; iVar6 = 0x15; local_28 = (Manager *)0x15; gridVariant = (undefined4 *)0; } } } else if (iVar6 == 9000) { iVar6 = 0x11; local_28 = (Manager *)0x11; gridVariant = (undefined4 *)0; local_6c = (PlayerManager *)extraout_EDX; } else if (iVar6 == 0x238c) { iVar6 = 0x12; local_28 = (Manager *)0x12; gridVariant = (undefined4 *)extraout_EDX; } else { if (iVar6 != 10000) goto switchD_007ede2a_caseD_3ed; iVar6 = 0x13; local_28 = (Manager *)0x13; gridVariant = (undefined4 *)extraout_EDX; } goto LAB_007ee65c; } if (iVar6 == 4000) { iVar6 = 0xb; local_28 = (Manager *)0xb; gridVariant = (undefined4 *)extraout_EDX; goto LAB_007ee65c; } if (iVar6 < 2000) { if (iVar6 == 1999) { iVar6 = 0xf; local_28 = (Manager *)0xf; gridVariant = (undefined4 *)extraout_EDX; } else { switch(iVar6) { case 0x76d: iVar6 = 0x18; local_28 = (Manager *)0x18; gridVariant = (undefined4 *)extraout_EDX; break; default: goto switchD_007ede2a_caseD_3ed; case 0x78a: iVar6 = 8; local_28 = (Manager *)0x8; gridVariant = (undefined4 *)extraout_EDX; break; case 0x78b: iVar6 = 9; local_28 = (Manager *)0x9; gridVariant = (undefined4 *)extraout_EDX; break; case 0x794: iVar6 = 10; local_28 = (Manager *)0xa; gridVariant = (undefined4 *)extraout_EDX; } } goto LAB_007ee65c; } switch(iVar6) { case 3000: case 0xbba: switchD_007ee4c1_caseD_bb8: gridVariant = (undefined4 *)extraout_EDX; goto LAB_007ee5d9; case 0xbb9: local_28 = (Manager *)0x7; uVar5 = RNG::Next(&rng); local_7c.x = (float)((int)gridIndex % room->_gridWidth) * 40.0 + 40.0; local_7c.y = (float)((int)gridIndex / room->_gridWidth) * 40.0 + 120.0; pEVar10 = Game::Spawn(g_game,1000,0xc0,&local_7c,&g_vectorZero,(Entity *)0x0,(uint)entry._6_2_ ,uVar5); (**(code **)(*(int *)pEVar10 + 0xc))(); iVar6 = 7; piVar1 = (int *)((int)room->_descriptor + 0x54); *piVar1 = *piVar1 + 1; pRVar12 = room; gridVariant = local_2c; break; default: switchD_007ede2a_caseD_3ed: iVar6 = 1; local_28 = (Manager *)0x1; gridVariant = (undefined4 *)extraout_EDX; break; case 0xbc1: gridVariant = (undefined4 *)0x80; LAB_007ee5d9: iVar6 = 7; local_28 = (Manager *)0x7; piVar1 = (int *)((int)room->_descriptor + 0x54); *piVar1 = *piVar1 + 1; } goto LAB_007ee65c; } if (iVar6 == 0x76c) { iVar6 = 3; local_28 = (Manager *)0x3; gridVariant = (undefined4 *)extraout_EDX; goto LAB_007ee65c; } switch(iVar6) { case 0x578: iVar6 = 0xd; local_28 = (Manager *)0xd; gridVariant = (undefined4 *)0; goto LAB_007ee65c; default: goto switchD_007ede2a_caseD_3ed; case 0x582: iVar6 = 0xd; local_28 = (Manager *)0xd; gridVariant = (undefined4 *)1; goto LAB_007ee65c; case 0x5d2: local_2c = (undefined4 *)0x1; break; case 0x5d6: local_2c = (undefined4 *)0x4; break; case 0x5d7: local_2c = (undefined4 *)0x2; break; case 0x5d8: local_2c = (undefined4 *)0x3; break; case 0x5d9: local_2c = (undefined4 *)0x5; break; case 0x5da: local_2c = (undefined4 *)0x6; break; case 0x5db: local_2c = (undefined4 *)0x7; break; case 0x5dc: local_2c = (undefined4 *)0x0; break; case 0x5dd: local_2c = (undefined4 *)0xb; } iVar6 = 0xe; local_28 = (Manager *)0xe; if ((local_31 == '\0') && (entry._6_2_ == 0)) { if (local_2c == (undefined4 *)0x0) { uVar5 = RNG::RandomInt(&rng,0x28); if (uVar5 == 0) { local_2c = (undefined4 *)0x2; goto LAB_007ee333; } uVar5 = RNG::RandomInt(&rng,100); if (uVar5 == 0) { game = g_game; pEVar10 = (Entity *)rng._seed; if (((g_manager->_persistentGameData)._achievements[0x25d] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { local_2c = (undefined4 *)0xb; } goto LAB_007ee378; } goto switchD_007ee34a_caseD_3; } if (local_2c == (undefined4 *)0x2) { LAB_007ee333: uVar5 = RNG::RandomInt(&rng,0x28); switch(uVar5) { case 1: case 2: local_2c = (undefined4 *)0x3; default: switchD_007ee34a_caseD_3: pEVar10 = (Entity *)rng._seed; game = g_game; break; case 5: case 6: case 7: local_2c = (undefined4 *)0x4; pEVar10 = (Entity *)rng._seed; game = g_game; } } else { pEVar10 = local_30; } LAB_007ee378: itemOwner = PlayerManager::FirstTrinketOwner(&game->_playerManager,0x5b); if (itemOwner == (Entity_Player *)0x0) { iVar6 = 0xe; poopCount = (short *)((int)room->_descriptor + 0x50); *poopCount = *poopCount + 1; pRVar12 = room; gridVariant = local_2c; } else { tmpRng._shift3 = 0x19; uVar5 = 0x21; tmpRng._shift1 = 2; tmpRng._shift2 = 7; tmpRng._seed = (int)pEVar10; iVar6 = Entity_Player::GetTrinketMultiplier(itemOwner,0x5b); if (iVar6 == 2) { uVar5 = 0x42; } else if (iVar6 == 3) { uVar5 = 100; } uVar9 = RNG::RandomInt(&tmpRng,100); gridVariant = local_2c; if (uVar9 < uVar5) { gridVariant = (undefined4 *)0x5; } iVar6 = 0xe; poopCount = (short *)((int)room->_descriptor + 0x50); *poopCount = *poopCount + 1; pRVar12 = room; } } else { LAB_007ee659: pRVar12 = room; gridVariant = local_2c; } LAB_007ee65c: gridEntity = Isaac::CreateGridEntity(iVar6,(uint)gridIndex); if (gridEntity == (GridEntity *)0x0) { LAB_007ed567: bVar3 = 0; } else { pRVar12->_gridEntities[(int)gridIndex] = gridEntity; (gridEntity->_desc)._variant = (int)gridVariant; (gridEntity->_desc)._varData = (int)local_6c; if (local_28 == (Manager *)0x17) { fVar16 = 0.0; if (entry._6_2_ != 0) { fVar16 = local_3c; } (gridEntity->_desc)._state = (int)fVar16; } GridEntity::Init(gridEntity,(uint)local_54); LAB_007ee699: bVar3 = 1; } return bVar3; } //@@ 007ee7e0 Room::make_wall /* DB: "make_wall index out of bounds"; crawl space (type 16) ladder special cases (beast.md) */ undefined4 __thiscall Room::make_wall(Room *this,int param_2,int param_3) { uint uVar1; GridEntity *gridEntity; uint Seed; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; int roomData; int roomSubtype; local_8 = 0xffffffff; puStack_c = &LAB_00b00ebb; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar2 = this->_gridWidth * param_3 + param_2; if (((int)uVar2 < 0) || (this->_gridHeight * this->_gridWidth <= (int)uVar2)) { KAGE_LogMessage(0x10,(byte *)"make_wall index out of bounds\n"); } if (this->_gridEntities[uVar2] != (void *)0x0) { ExceptionList = local_10; return 0; } if (this->_roomType == 0x10) { roomData = *(int *)((int)this->_descriptor + 0x10); roomSubtype = *(int *)(roomData + 0x10); if ((roomSubtype != 2) && (roomSubtype != 3)) { if (param_3 == 0) { if (param_2 == 2) { uVar1 = Random(); if (((int)uVar2 < 0) || (0x1bf < (int)uVar2)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (0x1bf < uVar2) { ExceptionList = local_10; return 0; } if (900 < this->_gridPaths[uVar2]) { ExceptionList = local_10; return 0; } gridEntity = operator_new(0x154); local_8 = 0; if (gridEntity == (GridEntity *)0x0) { gridEntity = (GridEntity *)0x0; } else { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Decoration::vftable; } local_8 = 0xffffffff; if (gridEntity == (GridEntity *)0x0) { ExceptionList = local_10; return 0; } (gridEntity->_desc)._type = 1; gridEntity->_gridIndex = uVar2; if (this->_gridEntities[uVar2] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[uVar2])(1); } this->_gridEntities[uVar2] = gridEntity; (gridEntity->_desc)._variant = 10; (gridEntity->_desc)._varData = 0; GridEntity::Init(gridEntity,uVar1); ExceptionList = local_10; return 0; } } else if ((((param_3 == 3) || (param_3 == 4)) && (param_2 == 0xe)) && (*(int *)(roomData + 0xc) == 1)) { Seed = Random(); if ((((int)uVar2 < 0) || (0x1bf < (int)uVar2)) && ((KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"), (int)uVar2 < 0 || (0x1bf < (int)uVar2)))) { (**(code **)(iRam00000000 + 4))(uVar1); ExceptionList = local_10; return 0; } if (this->_gridPaths[uVar2] < 0x385) { gridEntity = operator_new(0x154); local_8 = 0x29; if (gridEntity == (GridEntity *)0x0) { gridEntity = (GridEntity *)0x0; } else { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Gravity::vftable; } local_8 = 0xffffffff; if (gridEntity != (GridEntity *)0x0) { (gridEntity->_desc)._type = 0x13; gridEntity->_gridIndex = uVar2; if (this->_gridEntities[uVar2] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[uVar2])(1); } this->_gridEntities[uVar2] = gridEntity; (gridEntity->_desc)._variant = 0; (gridEntity->_desc)._varData = 0; GridEntity::Init(gridEntity,Seed); } } (**(code **)(*(int *)this->_gridEntities[uVar2] + 4))(); ExceptionList = local_10; return 0; } } } gridEntity = operator_new(0x154); local_8 = 0x33; if (gridEntity == (GridEntity *)0x0) { gridEntity = (GridEntity *)0x0; } else { GridEntity::GridEntity(gridEntity); *(undefined ***)gridEntity = IsaacRepentancePlus::GridEntity_Wall::vftable; } local_8 = 0xffffffff; if (gridEntity == (GridEntity *)0x0) { ExceptionList = local_10; return 0; } (gridEntity->_desc)._type = 0xf; gridEntity->_gridIndex = uVar2; this->_gridEntities[uVar2] = gridEntity; uVar2 = Random(); GridEntity::Init(gridEntity,uVar2); ExceptionList = local_10; return 1; } //@@ 007eea90 Room::MakeDoor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix46/47] __thiscall void Room::MakeDoor(int slot); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Room::MakeDoor(Room *this,int slot) { int iVar1; Game *pGVar2; uint uVar3; int *piVar4; GridEntity *this_00; int local_24 [5]; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b00f0d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_24 + 8); ExceptionList = &local_10; if (this->_doors[slot] == (void *)0x0) { iVar1 = this->_doorGridPositions[slot]; local_24[4] = uVar3; if (iVar1 < 0) { KAGE_LogMessage(0x10,(byte *)"invalid GridIndex while spawning door (slot %d)"); } piVar4 = (int *)__RTDynamicCast(this->_gridEntities[iVar1],0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0, uVar3); if (piVar4 == (int *)0x0) { this_00 = operator_new(0x404); local_8 = 2; if (this_00 == (GridEntity *)0x0) { this_00 = (GridEntity *)0x0; } else { GridEntity::GridEntity(this_00); local_8._0_1_ = 3; *(undefined ***)this_00 = IsaacRepentancePlus::GridEntity_Door::vftable; ANM2::constructor((ANM2 *)&this_00[1]._desc._spawnSeed); local_8 = CONCAT31(local_8._1_3_,4); ANM2::constructor((ANM2 *)(this_00[1]._sprite._championColor._colorize + 1)); this_00[2]._sprite._color._colorize[1] = 0.0; this_00[2]._sprite._color._offset[1] = 0.0; this_00[2]._sprite._color._offset[2] = 2.10195e-44; *(undefined1 *)(this_00[2]._sprite._color._colorize + 1) = 0; this_00[2]._sprite._championColor._tint[0] = 0.0; this_00[2]._sprite._championColor._colorize[0] = 0.0; this_00[2]._sprite._championColor._colorize[1] = 2.10195e-44; *(undefined1 *)this_00[2]._sprite._championColor._tint = 0; this_00[2]._sprite._championColor._colorize[2] = 0.0; this_00[2]._sprite._championColor._offset[2] = 0.0; this_00[2]._sprite._flipX = 0xf; this_00[2]._sprite._flipY = 0; *(undefined2 *)&this_00[2]._sprite.field_0x102 = 0; *(undefined1 *)(this_00[2]._sprite._championColor._colorize + 2) = 0; this_00[2]._sprite._playbackSpeed = 0.0; *(undefined4 *)(this_00 + 3) = 0; this_00[3]._desc._type = 0xf; *(undefined1 *)&this_00[2]._sprite._playbackSpeed = 0; } local_8 = 0xffffffff; if (this_00 != (GridEntity *)0x0) { (this_00->_desc)._type = 0x10; this_00->_gridIndex = iVar1; } piVar4 = (int *)__RTDynamicCast(this_00,0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0, uVar3); piVar4[2] = 0; piVar4[3] = 0; if (this->_gridEntities[iVar1] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[iVar1])(1); } this->_gridEntities[iVar1] = piVar4; } uVar3 = Random(); piVar4[5] = uVar3; piVar4[0xf] = 0; (**(code **)(*piVar4 + 0x20))(); pGVar2 = g_game; piVar4[4] = piVar4[4] + 1; *(undefined1 *)(piVar4 + 7) = 1; piVar4[10] = pGVar2->_frameCount; uVar3 = slot & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } local_24[0] = -0x3d4c0000; local_24[1] = 0; local_24[2] = 0x42b40000; local_24[3] = 0x43340000; piVar4[0x59] = uVar3; iVar1 = local_24[uVar3]; piVar4[0x39] = iVar1; piVar4[200] = iVar1; piVar4[0x83] = iVar1; piVar4[0x56] = slot; this->_doors[slot] = piVar4; } ExceptionList = local_10; return; } //@@ 007eece0 Room::GetRoomConfigStage /* ZHL [exact] __thiscall int Room::GetRoomConfigStage(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Room::GetRoomConfigStage(Room *this) { int *piVar1; if ((this->_descriptor == (void *)0x0) || (piVar1 = *(int **)((int)this->_descriptor + 0x10), piVar1 == (int *)0x0)) { KAGE_LogMessage(4,(byte *)"Room stage config is missing, returning a default one (SPECIAL)!\n"); return 0; } return *piVar1; } //@@ 007eed10 entity_type_is_saved /* DB: ? (ECX = type, EDX = variant, subtype, spawnerType, flag): per type/variant whitelist (pickups except variant 41, bombs except 13/19/20, many effect variants 0x15/0x21/0x3f../0x9e..., types 0x11/0x21/0x123/0x124/0x38b/0x3c0/0x3c5...) of entities kept in the room's saved state, forced true while saving/rewinding (Manager+0x20dcc, Game+0x269ea); callers Room::SpawnEntry and 007eeeb0 Entity_Pickup::CanFlip stores the EntitySaveState) */ uint entity_type_is_saved(uint param_1,int param_2,char param_3) { uint uVar1; Game *pGVar2; uint3 uVar3; int in_ECX; uint in_EDX; bool bVar4; pGVar2 = (Game *)g_manager; if ((g_manager->_isSavingGameState == 0) && (pGVar2 = g_game, g_game->_isStoringGlowingHourglassState == 0)) { uVar1 = (uint)g_game & 0xffffff00; } else { uVar1 = CONCAT31((int3)((uint)pGVar2 >> 8),1); } uVar3 = (uint3)(uVar1 >> 8); if (in_ECX == 5) { if (in_EDX != 0x29) goto LAB_007eed43; LAB_007eeea5: return (uint)uVar3 << 8; } if (in_ECX == 4) { if ((in_EDX == 0xd) || (in_EDX == 0x13)) goto LAB_007eeea5; if (in_EDX == 0x14) { return (uint)uVar3 << 8; } } else if (in_ECX != 6) { if (in_ECX == 1000) { if ((((((((in_EDX == 0x15) || (in_EDX == 0x21)) || (in_EDX == 0x44)) || ((in_EDX == 0x3f || (in_EDX == 0x41)))) || ((in_EDX == 0x40 || ((in_EDX == 0x45 || (in_EDX == 0x9e)))))) || (in_EDX == 0x9f)) && ((param_3 != '\0' || (param_2 == 0)))) || (((in_EDX == 0x4a || (((in_EDX == 0x4c || (in_EDX == 0x27)) || (in_EDX == 0x74)))) || ((in_EDX == 0x78 || (in_EDX == 0xc0)))))) goto LAB_007eed43; if (in_EDX != 0x8d) { if (in_EDX == 0xa1) { if ((param_1 < 900) && ((char)uVar1 == '\0')) { return uVar1; } } else { if ((in_EDX != 0x9c) || (param_1 != 1)) goto LAB_007eeea5; if ((char)uVar1 == '\0') { return uVar1; } } goto LAB_007eed43; } bVar4 = param_2 == 0; } else { if (in_ECX == 0x11) goto LAB_007eed43; if (in_ECX == 0x21) { if (9 < in_EDX) { return (uint)uVar3 << 8; } goto LAB_007eed43; } if (in_ECX == 0x124) goto LAB_007eed43; if (in_ECX == 0x123) { bVar4 = param_2 == 0; } else { if (in_ECX == 0x3c5) { if (in_EDX == 10) { return (uint)uVar3 << 8; } goto LAB_007eed43; } if (in_ECX == 0x38b) { if (param_1 != 1) goto LAB_007eeea5; if (param_3 == '\0') { return (uint)uVar3 << 8; } goto LAB_007eed43; } bVar4 = in_ECX == 0x3c0; } } if (!bVar4) goto LAB_007eeea5; } LAB_007eed43: return CONCAT31(uVar3,1); } //@@ 007eeeb0 Entity_Pickup::CanFlip /* DB: ? flip validity checks, used by TryFlip/HandleCollision prototype: db/protos.zhl, confirmed by RET 12 */ byte Entity_Pickup::CanFlip (Room *room,Entity_Pickup *pickup,EntitySaveState *outSaveState,byte isIgnoreMinecart ) { char isSavedType; byte bVar1; EntitySaveState child; void *pvVar3; EntitySaveState *flipSaveState; void *extraout_EAX; BitSet128 *invertedMaskResult; Entity *lastSpawner; int extraout_ECX; uint cycleIndex; int iVar4; float angle; BitSet128 invertedMask; undefined1 bombFlags [12]; void *pvStack_28; EntitySaveState local_24; EntitySaveState local_20; EntitySaveState local_1c; EntitySaveState local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; EntityPtr child; uint cycleCount; local_8 = 0xffffffff; puStack_c = &LAB_00b00f6d; local_10 = ExceptionList; local_14 = 0; if (pickup->_dead != 0) { return 0; } if ((pickup->_flags & 0x2000000000) != 0) { return 0; } if ((pickup->_minecart != (EntityPtr)0x0) && (isIgnoreMinecart == 0)) { return 0; } ExceptionList = &local_10; isSavedType = entity_type_is_saved (pickup->_subtype,pickup->_spawnerType, CONCAT31((int3)((uint)room->_descriptor >> 8), *(undefined1 *)((int)room->_descriptor + 0x44)) & 0xffffff01, __security_cookie ^ (uint)(bombFlags + 0x30)); if (isSavedType == '\0') { ExceptionList = local_10; return 0; } *outSaveState = (EntitySaveState)pickup->_type; outSaveState[1] = (EntitySaveState)pickup->_variant; outSaveState[2] = (EntitySaveState)pickup->_subtype; child = (EntitySaveState)(pickup->_pos).y; outSaveState[10] = (EntitySaveState)(pickup->_pos).x; outSaveState[0xb] = child; outSaveState[0xd] = (EntitySaveState)pickup->_initSeed; outSaveState[0xe] = (EntitySaveState)(pickup->_dropRNG)._seed; outSaveState[0xf] = (EntitySaveState)pickup->_spawnerType; outSaveState[0x10] = (EntitySaveState)pickup->_spawnerVariant; *(short *)(outSaveState + 8) = (short)pickup->_spawnGridIndex; outSaveState[0x16] = (EntitySaveState)pickup->_scoreMultiplier; iVar4 = pickup->_type; if (iVar4 == 5) { iVar4 = pickup->_variant; if (((iVar4 != 100) && (((iVar4 != 0x17c && (iVar4 != 0x154)) && (iVar4 != 0x172)))) && ((iVar4 != 0x186 && (iVar4 != 0x39)))) goto LAB_007ef00e; } else if ((iVar4 != 6) && (iVar4 != 0x3c0)) goto LAB_007ef00e; child = (EntitySaveState)(pickup->_targetPosition).x; if (((float)child != g_vectorZero.x) || ((pickup->_targetPosition).y != g_vectorZero.y)) { outSaveState[10] = child; outSaveState[0xb] = (EntitySaveState)(pickup->_targetPosition).y; } LAB_007ef00e: iVar4 = pickup->_type; if (iVar4 == 5) { iVar4 = pickup->_variant; if ((iVar4 == 0x35) && (0 < pickup->_chestReCloseTimer)) { outSaveState[2] = (EntitySaveState)0x1; iVar4 = pickup->_variant; } bVar1 = IsChest(iVar4); if ((((bVar1 != 0) || (extraout_ECX == 100)) && (outSaveState[2] == (EntitySaveState)0x0)) || (((extraout_ECX == 0x3a && (bVar1 = Entity::HasEntityFlags((Entity *)pickup,0x600000000000000), bVar1 != 0)) || (-1 < pickup->_timeout)))) { ExceptionList = local_10; return 0; } outSaveState[4] = (EntitySaveState)pickup->_charge; outSaveState[5] = (EntitySaveState)pickup->_price; *(byte *)(outSaveState + 0x18) = pickup->_isAutoUpdatePrice; outSaveState[6] = (EntitySaveState)pickup->_shopItemId; outSaveState[8].field_0x2 = pickup->_isTouched; outSaveState[9] = (EntitySaveState)pickup->_coopDuplicateIndex; outSaveState[0xc] = (EntitySaveState)pickup->_optionsPickupIndex; outSaveState[7] = (EntitySaveState)pickup->_timeout; outSaveState[0x15] = (EntitySaveState)(pickup->_sprite)._scale.x; outSaveState[8].field_0x3 = pickup->_isForceBlind; child = (EntitySaveState)GetAlternatePedestal(pickup); outSaveState[3] = child; outSaveState[0x17] = (EntitySaveState)pickup->_varData; outSaveState[0x14] = (EntitySaveState)pickup->_itemPoolType; cycleCount = pickup->_cycleCollectibleCount; if (cycleCount != 0) { pvVar3 = operator_new(0x20); EntitySaveState::set_extra_data(pvVar3); cycleIndex = 0; do { if (cycleIndex < (uint)pickup->_cycleCollectibleCount) { iVar4 = pickup->_cycleCollectibleList[cycleIndex]; } else { iVar4 = 0; } *(int *)((int)outSaveState[0x19] + cycleIndex * 4) = iVar4; cycleIndex = cycleIndex + 1; } while (cycleIndex < cycleCount); if (cycleCount < 8) { *(undefined4 *)((int)outSaveState[0x19] + cycleCount * 4) = 0; } } if (pickup->_flipSaveState != 0) { flipSaveState = operator_new(0x78); local_8 = 0; if (flipSaveState == (EntitySaveState *)0x0) { pvVar3 = (void *)0x0; } else { FUN_004d7190(&pickup->_flipSaveState); local_8 = CONCAT31(local_8._1_3_,1); local_14 = 3; EntitySaveState::copy(flipSaveState,(void *)local_1c); pvVar3 = extraout_EAX; } local_8 = 2; EntitySaveStateRef::Set(outSaveState + 0x1b,pvVar3); if ((local_14 & 1) != 0) { FUN_004d7130(); ExceptionList = local_10; return 1; } } } else if (iVar4 == 6) { iVar4 = *(int *)(pickup->_priceANM2)._filename._buf; if (((iVar4 == 3) || (iVar4 == 4)) && (pickup->_variant != 8)) { ExceptionList = local_10; return 0; } outSaveState[3] = (EntitySaveState)(pickup->_priceANM2)._filename._size; outSaveState[0xc] = (EntitySaveState)pickup->_timeout; if (pickup->_variant == 10) { outSaveState[4] = (EntitySaveState)(pickup->_priceANM2)._filename._capacity; ExceptionList = local_10; return 1; } } else if ((iVar4 == 0x21) || (iVar4 == 0x124)) { child = (EntitySaveState)__ftoui3(); outSaveState[3] = child; } else { if (iVar4 == 4) { if (pickup->_visible == 0) { ExceptionList = local_10; return 0; } invertedMaskResult = BitSet128::__bnot((BitSet128 *)&DAT_00c345e0,&invertedMask); bombFlags._0_4_ = (pickup->_priceANM2)._animDefaultName._size; bombFlags._4_4_ = (pickup->_priceANM2)._animDefaultName._capacity; bombFlags._8_4_ = (pickup->_priceANM2)._animState._animation; pvStack_28 = (pickup->_priceANM2)._animState._animData; BitSet128::operator_and((BitSet128 *)&local_24,(BitSet128 *)bombFlags,invertedMaskResult); outSaveState[7] = local_18; outSaveState[6] = local_1c; outSaveState[5] = local_20; outSaveState[4] = local_24; outSaveState[8].field_0x3 = *(undefined1 *)&(pickup->_priceANM2)._animState._layerFrames; outSaveState[0x14] = *(EntitySaveState *)((pickup->_priceANM2)._filename._buf + 8); outSaveState[0x15] = (EntitySaveState)(pickup->_priceANM2)._animState._nullLayerFrames; *(undefined1 *)(outSaveState + 0x18) = 0xff; lastSpawner = Entity::GetLastSpawner((Entity *)pickup); if ((lastSpawner != (Entity *)0x0) && (lastSpawner->_type == 1)) { *(undefined1 *)(outSaveState + 0x18) = *(undefined1 *)(lastSpawner[5]._color._offset + 2); } outSaveState[3] = *(EntitySaveState *)((pickup->_priceANM2)._animDefaultName._buf + 0xc); ExceptionList = local_10; return 1; } if (iVar4 == 1000) { iVar4 = pickup->_variant; if (iVar4 != 0x74) { if (iVar4 == 0x78) { outSaveState[6] = (EntitySaveState)(pickup->_priceANM2)._filename._size; outSaveState[4] = (EntitySaveState)(pickup->_priceANM2)._filename._capacity; } else if (iVar4 != 0x9f) { if (iVar4 != 0x27) { ExceptionList = local_10; return 1; } if (pickup->_subtype != 1) { ExceptionList = local_10; return 1; } if ((int)(pickup->_priceANM2)._animState._animFrame < 0) { ExceptionList = local_10; return 0; } if (pickup->_spawnerType == 0) { ExceptionList = local_10; return 1; } ExceptionList = local_10; return 0; } outSaveState[3] = (EntitySaveState)(pickup->_priceANM2)._animState._animFrame; ExceptionList = local_10; return 1; } outSaveState[3] = (EntitySaveState)(pickup->_priceANM2)._animState._animFrame; child = pickup->_child; if ((child != (EntityPtr)0x0) && (*(int *)((int)child + 0x28) == 1000)) { *(int *)((int)child + 0x450) = -1; (**(code **)(*(int *)child + 0xc))(); ExceptionList = local_10; return 1; } } else if (iVar4 == 0x3c5) { angle = atan2f((pickup->_targetPosition).y,(pickup->_targetPosition).x); outSaveState[0x14] = (EntitySaveState)(angle * 57.295776); ExceptionList = local_10; return 1; } } ExceptionList = local_10; return 1; } //@@ 007ef420 Entity_Pickup::RestoreState /* DB: applies saved pickup data (charge, price, shopItemId, touched); Room::RestoreState prototype: db/protos.zhl, confirmed by RET 8 */ void Entity_Pickup::RestoreState(Room *room,Entity_Pickup *entity,void *saveState) { undefined4 uVar1; void *pvVar2; byte bVar3; Vector *vecResult; int iVar4; uint uVar5; EntityPtr player; uint uVar6; EntityPtr *spawnerSlot; float fVar7; float fVar8; byte bVar9; byte bVar10; Vector local_18; Vector local_10; void *gameRoom; double uintFixup; if (((entity->_pos).x == g_vectorZero.x) && ((entity->_pos).y == g_vectorZero.y)) { bVar10 = 0; bVar9 = 0; bVar3 = 1; fVar8 = 40.0; vecResult = Room::GetRandomPosition(room,&local_10,0.0); vecResult = Room::FindFreePickupSpawnPosition(room,&local_18,vecResult,fVar8,bVar3,bVar9,bVar10) ; (entity->_pos).x = vecResult->x; (entity->_pos).y = vecResult->y; } (entity->_dropRNG)._seed = *(int *)((int)saveState + 0x38); (entity->_dropRNG)._shift1 = 4; (entity->_dropRNG)._shift2 = 3; (entity->_dropRNG)._shift3 = 0x11; iVar4 = entity->_type; entity->_spawnGridIndex = (int)*(short *)((int)saveState + 0x20); entity->_scoreMultiplier = *(float *)((int)saveState + 0x58); if (iVar4 == 5) { if (*(int *)((int)saveState + 8) != 0) { entity->_charge = *(int *)((int)saveState + 0x10); } update_price_sprite(entity,*(int *)((int)saveState + 0x14)); entity->_isAutoUpdatePrice = *(byte *)((int)saveState + 0x60); iVar4 = *(int *)((int)saveState + 0x18); if (iVar4 < -1) { iVar4 = -2; } else if (6 < iVar4) { iVar4 = 7; } entity->_shopItemId = iVar4; entity->_isTouched = *(byte *)((int)saveState + 0x22); iVar4 = *(int *)((int)saveState + 0x24); entity->_coopDuplicateIndex = iVar4; if ((iVar4 != 0) && (iVar4 != -1)) { entity->_cycleCollectibleCount = 0; } bVar3 = entity->_isForceBlind; entity->_optionsPickupIndex = *(int *)((int)saveState + 0x30); entity->_spawnerType = *(int *)((int)saveState + 0x3c); entity->_spawnerVariant = *(int *)((int)saveState + 0x40); entity->_timeout = *(int *)((int)saveState + 0x1c); fVar8 = *(float *)((int)saveState + 0x54) * g_vectorOne.x; (entity->_sprite)._scale.y = *(float *)((int)saveState + 0x54) * g_vectorOne.y; (entity->_sprite)._scale.x = fVar8; bVar9 = *(byte *)((int)saveState + 0x23); entity->_isForceBlind = bVar9; if (((entity->_variant == 100) && (entity->_subtype != 0)) && (bVar3 != bVar9)) { UpdateSprite(entity,0); } SetAlternatePedestal(entity,*(int *)((int)saveState + 0xc)); entity->_varData = *(int *)((int)saveState + 0x5c); entity->_itemPoolType = *(int *)((int)saveState + 0x50); if (*(int *)((int)saveState + 100) != 0) { entity->_cycleCollectibleCount = 0; uVar6 = 0; do { iVar4 = *(int *)(uVar6 + *(int *)((int)saveState + 100)); if (iVar4 == 0) break; if ((uint)entity->_cycleCollectibleCount < 8) { entity->_cycleCollectibleList[entity->_cycleCollectibleCount] = iVar4; entity->_cycleCollectibleCount = entity->_cycleCollectibleCount + 1; } uVar6 = uVar6 + 4; } while (uVar6 < 0x20); } if (*(int *)((int)saveState + 0x6c) != 0) { SharedPtr::assign(&entity->_flipSaveState,(int *)((int)saveState + 0x6c)); ANM2::Reset(&entity->_altPedestalANM2); } UpdateLootPreview(entity); if (((g_game->_currentRoomIdx == -0xc) && (g_game->_isStartingFromState != 0)) && ((entity->_variant == 100 && (-1 < entity->_spawnGridIndex)))) { uVar1 = *(undefined4 *)((int)&entity->_flags + 4); *(uint *)&entity->_flags = (uint)entity->_flags | 0x40000; *(undefined4 *)((int)&entity->_flags + 4) = uVar1; *(undefined4 *)&room->field_0x7764 = 0xffffffff; return; } } else { if (iVar4 == 6) { iVar4 = entity->_variant; (entity->_priceANM2)._filename._size = *(uint *)((int)saveState + 0xc); if (iVar4 == 10) { (entity->_priceANM2)._filename._capacity = *(uint *)((int)saveState + 0x10); } Entity_Slot::SetPrizeType((Entity_Slot *)entity,*(undefined4 *)((int)saveState + 0x30)); return; } if (iVar4 == 1000) { iVar4 = entity->_variant; if (((iVar4 == 0x15) || (iVar4 == 0x21)) || ((iVar4 == 0x3f || ((((iVar4 == 0x40 || (iVar4 == 0x41)) || (iVar4 == 0x45)) || (iVar4 == 0x9e)))))) { gameRoom = g_game->_room; local_10.x = *(float *)((int)gameRoom + 0x14); fVar8 = *(float *)((int)gameRoom + 0x18); local_18.x = *(float *)((int)gameRoom + 0x1c); fVar7 = *(float *)((int)gameRoom + 0x20); uVar6 = Random(); uintFixup = __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]; uVar5 = Random(); (entity->_pos).x = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * (local_18.x - local_10.x) + local_10.x; (entity->_pos).y = (float)((double)(int)uVar6 + uintFixup) * 2.3283064e-10 * (fVar7 - fVar8) + fVar8; return; } if (iVar4 == 0x44) { (**(code **)(*(int *)entity + 0xc))(); return; } if (iVar4 != 0x74) { if (iVar4 != 0x78) { return; } (entity->_priceANM2)._filename._size = *(uint *)((int)saveState + 0x18); (entity->_priceANM2)._filename._capacity = *(uint *)((int)saveState + 0x10); } (entity->_priceANM2)._animState._animFrame = *(float *)((int)saveState + 0xc); return; } if ((iVar4 == 0x21) || (iVar4 == 0x124)) { entity->_health = (float)((double)*(int *)((int)saveState + 0xc) + __uint_to_double_fixup[-(*(int *)((int)saveState + 0xc) >> 0x1f)]); } else if (iVar4 == 4) { gameRoom = *(void **)((int)saveState + 0x18); pvVar2 = *(void **)((int)saveState + 0x1c); uVar6 = *(uint *)((int)saveState + 0x14); (entity->_priceANM2)._animDefaultName._size = *(uint *)((int)saveState + 0x10); (entity->_priceANM2)._animDefaultName._capacity = uVar6; (entity->_priceANM2)._animState._animation = gameRoom; (entity->_priceANM2)._animState._animData = pvVar2; *(undefined1 *)((int)&(entity->_priceANM2)._overlayAnimState._animation + 3) = 1; *(undefined1 *)&(entity->_priceANM2)._animState._layerFrames = *(undefined1 *)((int)saveState + 0x23); *(undefined4 *)((entity->_priceANM2)._filename._buf + 8) = *(undefined4 *)((int)saveState + 0x50); (entity->_priceANM2)._animState._nullLayerFrames = *(void **)((int)saveState + 0x54); fVar8 = *(float *)((int)saveState + 0x54) * g_vectorOne.x; (entity->_sprite)._scale.y = *(float *)((int)saveState + 0x54) * g_vectorOne.y; (entity->_sprite)._scale.x = fVar8; entity->_spawnerType = *(int *)((int)saveState + 0x3c); *(undefined4 *)((entity->_priceANM2)._animDefaultName._buf + 0xc) = *(undefined4 *)((int)saveState + 0xc); if (-1 < *(char *)((int)saveState + 0x60)) { uVar6 = (uint)*(char *)((int)saveState + 0x60); if ((uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2) <= uVar6) { uVar6 = 0; } player = (EntityPtr)Game::GetPlayer(g_game,uVar6); spawnerSlot = &entity->_spawnerEntity; if (entity->_spawnerEntity != (EntityPtr)0x0) { local_10.x = (float)spawnerSlot; std::multiset::erase(&local_10); } *spawnerSlot = player; if (player != (EntityPtr)0x0) { std::multiset::insert(spawnerSlot); return; } } } else { bVar3 = Entity::IsEnemy((Entity *)entity); if (((bVar3 != 0) && (iVar4 != 0x11)) && (iVar4 != 0x38b)) { entity->_health = *(float *)((int)saveState + 0x50); if (-1 < *(int *)((int)saveState + 0x18)) { Entity_NPC::MakeChampion ((Entity_NPC *)entity,*(uint *)((int)saveState + 0x34), *(int *)((int)saveState + 0x18),0); } bVar3 = Vector::operator_eq((Vector *)((int)saveState + 0x28),&g_vectorZero); if (bVar3 != 0) { bVar10 = 0; bVar9 = 0; bVar3 = 1; fVar8 = 80.0; vecResult = Room::GetCenterPos(&local_18); Room::FindFreePickupSpawnPosition(room,&local_10,vecResult,fVar8,bVar3,bVar9,bVar10); vecResult = MusicManager::RandomVector(&local_18); uVar6 = Random(); fVar7 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; fVar8 = vecResult->x; (entity->_pos).y = fVar7 * vecResult->y * 20.0 + local_10.y; (entity->_pos).x = fVar7 * fVar8 * 20.0 + local_10.x; return; } } } } return; } //@@ 007efa50 Room::on_leave /* DB: ? Level::ChangeRoom and 006f9000 Game::store_game_state it on the current Room: ShopRestockPartial when +0x706c timer, pending SpawnClearAward (_roomClearDelay 1..8 and descriptor flag), IsGreedMode, Entity_Pickup::CanFlip + EntitySaveState::copy of pickups prototype: db/protos.zhl */ void __thiscall Room::on_leave(Room *this) { void *pvVar1; Entity_Pickup *pickup; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; Room *pRVar9; byte bVar10; char isReleased; uint uVar11; int gridSaveOffset; void **gridEntitySlot; int gridIndex; EntitySaveState childSaveState; undefined4 local_120; undefined4 local_11c; undefined4 local_118; undefined4 local_114; undefined4 uStack_110; undefined4 uStack_10c; undefined4 uStack_108; undefined4 local_104; undefined4 local_100; float local_fc; float local_f8; undefined4 local_f4; undefined4 local_f0; undefined4 local_ec; undefined4 local_e8; undefined4 local_e4; undefined4 local_dc; undefined4 local_d8; undefined4 local_d4; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; undefined1 local_c4; undefined4 local_c0; int *piStack_bc; undefined4 uStack_b8; int *piStack_b4; EntitySaveState saveState; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 local_8c; undefined4 local_88; float local_84; float local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined1 local_4c; undefined4 local_48; int *piStack_44; undefined4 uStack_40; int *piStack_3c; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; uint uStack_1c; undefined4 uStack_18; Room *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; short *clearCount; Game *game; undefined4 *gridSaveSlot; int gridSaveStates; bool isPairedPickup; EntitySaveState *savedEntitiesEnd; local_8 = 0xffffffff; puStack_c = &LAB_00b00fab; local_10 = ExceptionList; uVar11 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = this; if (0 < this->_shopRestockTimer) { this->_shopRestockTimer = -1; ShopRestockPartial(this); } pRVar9 = local_14; game = g_game; if ((g_game->_currentRoomIdx != -3) && (pvVar1 = this->_descriptor, *(int *)((int)pvVar1 + 0x40) != 0)) { if ((this->_roomClearDelay - 1U < 8) && ((*(byte *)((int)pvVar1 + 0x44) & 1) == 0)) { this->_roomClearDelay = 0; *(uint *)((int)pvVar1 + 0x44) = *(uint *)((int)pvVar1 + 0x44) | 1; clearCount = (short *)((int)this->_descriptor + 0x4a); *clearCount = *clearCount + 1; pvVar1 = this->_descriptor; ScoreSheet::add_cleared_room (&game->_scoreSheet,local_14->_roomType, *(int *)(*(int *)((int)pvVar1 + 0x10) + 0x48),(uint)*(ushort *)((int)pvVar1 + 0x4a) ,(byte)(*(uint *)((int)pvVar1 + 0x44) >> 10) & 1); game = g_game; bVar10 = Game::IsGreedMode(g_game); if ((bVar10 == 0) || (pRVar9->_roomType != 1)) { PlayerManager::trigger_room_clear(&game->_playerManager); } SpawnClearAward(); game = g_game; bVar10 = Game::IsGreedMode(g_game); this = pRVar9; if ((bVar10 != 0) && (pRVar9->_roomType == 1)) { game->_greedLastBeatenWave = game->_greedModeWave; } } FUN_00571170(uVar11); gridIndex = 0; if (0 < this->_gridWidth * this->_gridHeight) { gridSaveOffset = 0; gridEntitySlot = this->_gridEntities; do { pvVar1 = *gridEntitySlot; if (pvVar1 == (void *)0x0) { local_34 = 0; uStack_30 = 0; uStack_2c = 0; gridSaveStates = *(int *)((int)this->_descriptor + 0x68); uStack_28 = 0; local_24 = 0x16a9de81; uStack_20 = 0; gridSaveSlot = (undefined4 *)(gridSaveStates + gridSaveOffset); *gridSaveSlot = 0; gridSaveSlot[1] = 0; gridSaveSlot[2] = 0; gridSaveSlot[3] = 0; uStack_1c = uStack_1c & 0xffffff00; uStack_18 = 0x16a9de81; gridSaveSlot = (undefined4 *)(gridSaveStates + 0x10 + gridSaveOffset); *gridSaveSlot = 0x16a9de81; gridSaveSlot[1] = 0; gridSaveSlot[2] = uStack_1c; gridSaveSlot[3] = 0x16a9de81; } else { uVar2 = *(undefined4 *)((int)pvVar1 + 8); uVar3 = *(undefined4 *)((int)pvVar1 + 0xc); uVar4 = *(undefined4 *)((int)pvVar1 + 0x10); uVar5 = *(undefined4 *)((int)pvVar1 + 0x14); uVar6 = *(undefined4 *)((int)pvVar1 + 0x18); uVar7 = *(undefined4 *)((int)pvVar1 + 0x1c); uVar8 = *(undefined4 *)((int)pvVar1 + 0x20); gridSaveStates = *(int *)((int)this->_descriptor + 0x68); gridSaveSlot = (undefined4 *)(gridSaveStates + gridSaveOffset); *gridSaveSlot = *(undefined4 *)((int)pvVar1 + 4); gridSaveSlot[1] = uVar2; gridSaveSlot[2] = uVar3; gridSaveSlot[3] = uVar4; gridSaveSlot = (undefined4 *)(gridSaveStates + 0x10 + gridSaveOffset); *gridSaveSlot = uVar5; gridSaveSlot[1] = uVar6; gridSaveSlot[2] = uVar7; gridSaveSlot[3] = uVar8; } gridIndex = gridIndex + 1; gridEntitySlot = gridEntitySlot + 1; gridSaveOffset = gridSaveOffset + 0x20; } while (gridIndex < this->_gridWidth * this->_gridHeight); } local_14 = (Room *)0x0; if ((this->_entityList)._updateEL._size != 0) { do { pickup = *(Entity_Pickup **)((int)(this->_entityList)._updateEL._data + (int)local_14 * 4); local_9c = 0; uStack_98 = 0; uStack_94 = 0xffffffff; uStack_90 = 0xffffffff; saveState = (EntitySaveState)0x0; local_84 = g_vectorZero.x; local_80 = g_vectorZero.y; local_a8 = 0; local_a4 = 0; local_a0 = 0; local_8c = 0; local_88 = 0; local_7c = 0; local_78 = 0; local_74 = 0; local_70 = 0; local_6c = 0; local_64 = 0xffffffff; local_60 = 0xffffffff; local_5c = 0x42700000; local_58 = 0x3f800000; local_54 = 0x3f800000; local_50 = 0; local_4c = 1; local_48 = 0; piStack_44 = (int *)0x0; uStack_40 = 0; piStack_3c = (int *)0x0; local_8 = 0; if ((pickup->_type == 0x3c5) && (pickup->_variant == 0)) { isPairedPickup = true; } else { isPairedPickup = false; } if (isPairedPickup) { local_114 = 0; uStack_110 = 0; uStack_10c = 0xffffffff; uStack_108 = 0xffffffff; childSaveState = (EntitySaveState)0x0; local_fc = g_vectorZero.x; local_f8 = g_vectorZero.y; local_120 = 0; local_11c = 0; local_118 = 0; local_104 = 0; local_100 = 0; local_f4 = 0; local_f0 = 0; local_ec = 0; local_e8 = 0; local_e4 = 0; local_dc = 0xffffffff; local_d8 = 0xffffffff; local_d4 = 0x42700000; local_d0 = 0x3f800000; local_cc = 0x3f800000; local_c8 = 0; local_c4 = 1; local_c0 = 0; piStack_bc = (int *)0x0; uStack_b8 = 0; piStack_b4 = (int *)0x0; local_8 = 1; if (pickup->_child != (EntityPtr)0x0) { bVar10 = Entity_Pickup::CanFlip(this,(Entity_Pickup *)pickup->_child,&childSaveState,1); if (bVar10 != 0) { bVar10 = Entity_Pickup::CanFlip(this,pickup,&saveState,0); if (bVar10 != 0) { pvVar1 = this->_descriptor; savedEntitiesEnd = *(EntitySaveState **)((int)pvVar1 + 0x78); if (savedEntitiesEnd == *(EntitySaveState **)((int)pvVar1 + 0x7c)) { std::vector::_Emplace_reallocate(savedEntitiesEnd,&saveState); } else { EntitySaveState::copy(savedEntitiesEnd,&saveState); *(int *)((int)pvVar1 + 0x78) = *(int *)((int)pvVar1 + 0x78) + 0x78; } pvVar1 = this->_descriptor; savedEntitiesEnd = *(EntitySaveState **)((int)pvVar1 + 0x78); if (savedEntitiesEnd == *(EntitySaveState **)((int)pvVar1 + 0x7c)) { std::vector::_Emplace_reallocate (savedEntitiesEnd,&childSaveState); } else { EntitySaveState::copy(savedEntitiesEnd,&childSaveState); *(int *)((int)pvVar1 + 0x78) = *(int *)((int)pvVar1 + 0x78) + 0x78; } } } } local_8._0_1_ = 2; if (piStack_b4 != (int *)0x0) { isReleased = (**(code **)(*piStack_b4 + 0xc))(); if ((isReleased != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(&uStack_b8); } } local_8 = CONCAT31(local_8._1_3_,3); if (piStack_bc != (int *)0x0) { isReleased = (**(code **)(*piStack_bc + 0xc))(); if ((isReleased != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(&local_c0); } } } else { bVar10 = Entity_Pickup::CanFlip(this,pickup,&saveState,0); if (bVar10 != 0) { pvVar1 = this->_descriptor; savedEntitiesEnd = *(EntitySaveState **)((int)pvVar1 + 0x78); if (savedEntitiesEnd == *(EntitySaveState **)((int)pvVar1 + 0x7c)) { std::vector::_Emplace_reallocate(savedEntitiesEnd,&saveState); } else { EntitySaveState::copy(savedEntitiesEnd,&saveState); *(int *)((int)pvVar1 + 0x78) = *(int *)((int)pvVar1 + 0x78) + 0x78; } } } local_8 = 4; if (piStack_3c != (int *)0x0) { isReleased = (**(code **)(*piStack_3c + 0xc))(); if ((isReleased != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(&uStack_40); } } local_8 = 5; if (piStack_44 != (int *)0x0) { isReleased = (**(code **)(*piStack_44 + 0xc))(); if ((isReleased != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(&local_48); } } local_14 = (Room *)((int)local_14 + 1); } while (local_14 < (uint)(this->_entityList)._updateEL._size); } } ExceptionList = local_10; return; } //@@ 007eff50 Room::RestoreState /* ZHL [exact] __thiscall void Room::RestoreState(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Room::RestoreState(Room *this) { float fVar1; void *pvVar2; undefined4 *puVar3; Entity_Pickup *pEVar4; int iVar5; void *owner; int iVar6; uint uVar7; uint *saveState; uint *saveState_00; int iVar8; Vector *local_20; void *local_1c; Vector local_18; Vector local_10; g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; local_1c = this->_descriptor; saveState_00 = *(uint **)((int)local_1c + 0x74); if (saveState_00 != *(uint **)((int)local_1c + 0x78)) { local_20 = (Vector *)(saveState_00 + 10); do { if ((*saveState_00 == 0x3c5) && (saveState_00[1] == 0)) { local_20 = local_20 + 0xf; saveState = saveState_00 + 0x1e; pEVar4 = (Entity_Pickup *) Game::SpawnEx(g_game,*saveState,saveState_00[0x1f],local_20,&g_vectorZero, (Entity *)0x0,saveState_00[0x20],saveState_00[0x2b],0); Entity_Pickup::RestoreState(this,pEVar4,saveState); fVar1 = (float)saveState_00[0x14]; local_18.x = cos(fVar1 * 0.017453292); local_18.y = sin(fVar1 * 0.017453292); local_10.x = (float)((int)(short)saveState_00[8] % this->_gridWidth) * 40.0 + 40.0; local_10.y = (float)((int)(short)saveState_00[8] / this->_gridWidth) * 40.0 + 120.0; Entity::GiveMinecart((Entity *)pEVar4,&local_10,&local_18); saveState_00 = saveState; } else { pEVar4 = (Entity_Pickup *) Game::SpawnEx(g_game,*saveState_00,saveState_00[1],local_20,&g_vectorZero, (Entity *)0x0,saveState_00[2],saveState_00[0xd],0); Entity_Pickup::RestoreState(this,pEVar4,saveState_00); } local_1c = this->_descriptor; saveState_00 = saveState_00 + 0x1e; local_20 = local_20 + 0xf; } while (saveState_00 != *(uint **)((int)local_1c + 0x78)); } pvVar2 = *(void **)((int)local_1c + 0x78); owner = *(void **)((int)local_1c + 0x74); if (owner != pvVar2) { do { invoke_pending_callbacks(owner); owner = (void *)((int)owner + 0x78); } while (owner != pvVar2); owner = *(void **)((int)local_1c + 0x74); } iVar8 = g_pickupIgnoreModifiers; *(void **)((int)local_1c + 0x78) = owner; if (((*(int *)this->_descriptor != -10) || (g_game->_stage != 8)) || ((*(byte *)((int)this->_descriptor + 0x44) & 1) == 0)) { g_pickupIgnoreModifiers = iVar8 + -1; return; } iVar8 = 1; if (1 < this->_gridHeight + -1) { do { iVar5 = this->_gridWidth; iVar6 = 1; if (1 < iVar5 + -1) { do { if ((((-1 < iVar6) && (iVar6 < iVar5)) && ((-1 < iVar8 && ((iVar8 < this->_gridHeight && (iVar5 = iVar5 * iVar8 + iVar6, -1 < iVar5)))))) && ((pvVar2 = this->_gridEntities[iVar5], pvVar2 != (void *)0x0 && ((((*(int *)((int)pvVar2 + 4) == 0xf && (uVar7 = *(uint *)((int)pvVar2 + 0x24), uVar7 < 0x1c0)) && (puVar3 = this->_gridEntities[uVar7], puVar3 != (undefined4 *)0x0)) && (puVar3[1] != 1)))))) { this->_gridPaths[uVar7] = 900; this->_gridEntities[uVar7] = (void *)0x0; (**(code **)*puVar3)(1); } iVar5 = this->_gridWidth; iVar6 = iVar6 + 1; } while (iVar6 < iVar5 + -1); } iVar8 = iVar8 + 1; } while (iVar8 < this->_gridHeight + -1); } uVar7 = 0; do { RemoveDoor(this,uVar7); uVar7 = uVar7 + 1; } while (uVar7 < 8); g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1; return; } //@@ 007f01c0 Room::update_door_transitions /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: players walking into doors start room transitions; a 0x10 door (mirror) passes while not open (alt_path.md) */ void __thiscall Room::update_door_transitions(Room *this) { GridEntity_Door *this_00; Entity_Player *player; uint direction; RoomDescriptor *roomDesc; uint uVar1; Game *this_01; uint uVar2; bool isDoorPassable; float velocityY; float fVar4; float fVar5; float fVar6; int iVar7; uint playerIndex; void **doorSlot; float doorOffsets [8]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Game *game; float playerX; float playerY; int *roomConfig; int targetRoomIdx; int transitionAnim; float velocityY; puStack_20 = (undefined1 *)(doorOffsets + 0x10); local_14 = -NAN; puStack_18 = &LAB_00b00ff1; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(doorOffsets + 0xd); ExceptionList = &local_1c; if (((*(int *)&g_game->_roomTransition == 0) && (((roomConfig = *(int **)((int)this->_descriptor + 0x10), roomConfig == (int *)0x0 || (roomConfig[2] != 0x10)) || (*roomConfig != 0x23)))) && (playerIndex = 0, (int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0)) { do { player = Game::GetPlayer(g_game,playerIndex); if (player->_variant == 0) { playerX = (player->_pos).x; uVar2 = 0; playerY = (player->_pos).y; doorSlot = this->_doors; do { this_00 = *doorSlot; direction = uVar2 & 3; doorOffsets[0] = -18.0; doorOffsets[1] = 0.0; doorOffsets[2] = 0.0; doorOffsets[3] = -18.0; doorOffsets[4] = 18.0; doorOffsets[5] = 0.0; doorOffsets[6] = 0.0; doorOffsets[7] = 18.0; if (this_00 != (GridEntity_Door *)0x0) { iVar7 = *(int *)((int)g_game->_room + 0xc); velocityY = (float)(this_00->_gridIndex / iVar7) * 40.0 + 120.0 + doorOffsets[direction * 2 + 1]; fVar5 = (float)(this_00->_gridIndex % iVar7) * 40.0 + 40.0 + doorOffsets[direction * 2]; fVar4 = velocityY - playerY; fVar6 = fVar5 - playerX; fVar4 = sqrtf(fVar4 * fVar4 + fVar6 * fVar6); uVar1 = player->_moveDirection; if (player->_playerType == 0x23) { fVar6 = (player->_velocity).x; velocityY = (player->_velocity).y; if (4.0 < fVar6 * fVar6 + velocityY * velocityY) { if (ABS(fVar6) <= ABS(velocityY)) { uVar1 = (uint)(0.0 <= velocityY) * 2 + 1; } else { uVar1 = 2; if (fVar6 < 0.0) { uVar1 = 0; } } iVar7 = (this_00->_desc)._variant; if (((iVar7 == 1) || (iVar7 == 4)) || ((iVar7 == 3 || ((iVar7 == 2 || (iVar7 == 5)))))) { fVar5 = fVar5 - (playerX + fVar6 + fVar6); velocityY = velocityY - (playerY + velocityY + velocityY); fVar4 = sqrtf(velocityY * velocityY + fVar5 * fVar5); } } } iVar7 = (this_00->_desc)._state; if ((this_00->_doorFlags & 0x10) == 0) { isDoorPassable = iVar7 == 2; } else { isDoorPassable = iVar7 != 2; } if ((isDoorPassable) && (fVar4 < 25.0)) { Game::save_rewind_state(uVar2); game = g_game; if ((int)uVar2 < 0) { uVar1 = 0xffffffff; } else { uVar1 = uVar2; if (6 < (int)uVar2) { uVar1 = 7; } } g_game->_leaveDoor = uVar1; this_01 = game; if (*(int *)((int)this->_doors[uVar2] + 0x394) == -1) { if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard ) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { local_14 = 0.0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_14 = -NAN; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } this_01 = g_game; } roomDesc = &g_roomDescriptorDummy; if ((uint)game->_currentDimensionIdx < 3) { roomDesc = game->_roomList + 0x1fb; } if (roomDesc->Data == (void *)0x0) { iVar7 = *(int *)((int)this->_doors[uVar2] + 0x160); Level::InitializeDevilAngelRoom((Level *)this_01,iVar7 == 0xf,iVar7 != 0xf); this_01 = g_game; *(undefined4 *)((int)&g_game->_gameStateFlags + 4) = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); if (iVar7 == 0xf) { *(uint *)&this_01->_gameStateFlags = (uint)this_01->_gameStateFlags | 1; } else { *(uint *)&this_01->_gameStateFlags = (uint)this_01->_gameStateFlags | 0x20; } } } iVar7 = -1; targetRoomIdx = *(int *)((int)this->_doors[uVar2] + 0x394); if (targetRoomIdx < -99) { roomDesc = Level::GetRoomByIdx((Level *)this_01,targetRoomIdx,-1); transitionAnim = 0x12; iVar7 = roomDesc->Dimension; if (*(int *)((int)this->_doors[uVar2] + 0x394) != -100) { transitionAnim = 0; } targetRoomIdx = roomDesc->GridIndex; this_01 = g_game; } else { transitionAnim = 0; } Game::StartRoomTransition(this_01,targetRoomIdx,direction,transitionAnim,player,iVar7) ; g_game->_isPocketItemRewindSaved = 0; ExceptionList = local_1c; return; } iVar7 = (this_00->_desc)._variant; if (((((iVar7 == 1) || (iVar7 == 4)) || (iVar7 == 3)) || ((iVar7 == 2 || (iVar7 == 5)))) && (((*(byte *)((int)this->_descriptor + 0x44) & 1) != 0 && ((fVar4 < 60.0 && (uVar1 == direction)))))) { GridEntity_Door::TryUnlock(this_00,player,0); } } game = g_game; uVar2 = uVar2 + 1; doorSlot = doorSlot + 1; } while (uVar2 < 8); if (this->_roomType == 0x10) { if ((playerY < 120.0) || (((playerY < 110.0 && (100.0 < playerX)) && (playerX < 140.0)))) { transitionAnim = 2; iVar7 = g_game->_enterDoor; targetRoomIdx = g_game->_dungeonReturnRoomIndex; LAB_007f070c: Game::StartRoomTransition(game,targetRoomIdx,iVar7,transitionAnim,player,-1); ExceptionList = local_1c; return; } if ((this->_bottomRightPos).x + 20.0 < playerX) { transitionAnim = 0; iVar7 = 2; if (*(int *)this->_descriptor == -0xe) { targetRoomIdx = -0xf; g_game->_leaveDoor = 2; } else { uVar2 = *(uint *)(*(int *)((int)this->_descriptor + 0x10) + 0x38); g_game->_leaveDoor = 2; if ((uVar2 >> 2 & 1) == 0) { targetRoomIdx = -2; } else { targetRoomIdx = -6; } } goto LAB_007f070c; } if (playerX < 0.0) { transitionAnim = 0; iVar7 = 0; g_game->_leaveDoor = 0; targetRoomIdx = -2; goto LAB_007f070c; } if ((this->_bottomRightPos).y + 20.0 < playerY) { transitionAnim = 0; iVar7 = 3; g_game->_leaveDoor = 3; targetRoomIdx = -2; goto LAB_007f070c; } } } playerIndex = playerIndex + 1; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } ExceptionList = local_1c; return; } //@@ 007f0780 Room::GetGridCollisionAtPos /* ZHL [lua] Lua binding Room:GetGridCollisionAtPos prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Room::GetGridCollisionAtPos(Room *this,Vector pos) { uint uVar1; int iVar2; int iVar3; iVar3 = (int)((pos.x - 40.0) / 40.0 + 0.5); iVar2 = (int)((pos.y - 120.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar2 < 0)) || (this->_gridHeight <= iVar2)) { uVar1 = GetGridCollision(this,-1); return uVar1; } uVar1 = GetGridCollision(this,this->_gridWidth * iVar2 + iVar3); return uVar1; } //@@ 007f0800 Room::GetGridCollision /* ZHL [exact] __thiscall uint32_t Room::GetGridCollision(int index); prototype: REPENTOGON, confirmed by RET 4 */ uint __thiscall Room::GetGridCollision(Room *this,int index) { int *piVar1; int iVar2; piVar1 = *(int **)((int)this->_descriptor + 0x10); if (((piVar1 != (int *)0x0) && (piVar1[2] == 0x10)) && (*piVar1 == 0x23)) { return 0; } if (index < 0) { return 4; } if (this->_gridEntities[index] != (void *)0x0) { return *(uint *)((int)this->_gridEntities[index] + 0x3c); } iVar2 = this->_gridPaths[index]; if (iVar2 < 3000) { if (iVar2 < 1000) { return 0; } } else if (iVar2 < 4000) { return 1; } return 3; } //@@ 007f0870 Room::check_line_collision /* DB: ? bool(Vector* from, Vector* to, ..., char, ...) stepping the grid with Room::GetGridCollision over 0x1c0 cells; used by NpcAI::ENTITY_CLICKETY_CLACK and FUN_009a0520; sibling of Room::CheckLine */ bool Room::check_line_collision (float *param_1,Vector *param_2,undefined4 param_3,char param_4,undefined4 param_5, float *param_6) { int iVar1; int iVar2; int iVar3; int gridX; uint gridCollision; Room *in_ECX; void *gridEntity; Vector *resultPos; int gridX; uint gridIdx; float t; float tX; float t; float tX; Vector hitPos; float curY; float curX; int cellPixelY; int gridY; int cellPixelX; float progress; curX = *param_1; hitPos.x = curX; curY = param_1[1]; tX = param_2->x - *param_1; t = param_2->y - curY; hitPos.y = curY; gridX = (int)((curX - 40.0) / 40.0 + 0.5); iVar1 = (uint)(0.0 < tX) * 2; iVar3 = iVar1 + -1; gridY = (int)((curY - 120.0) / 40.0 + 0.5); iVar2 = (uint)(0.0 < t) * 2; gridX = iVar2 + -1; t = 0.0; progress = 0.0; if ((tX != g_vectorZero.x) || (t != g_vectorZero.y)) { cellPixelY = gridY * 0x28; cellPixelX = gridX * 0x28; do { hitPos.x = curX; hitPos.y = curY; if ((((gridX < 0) || (in_ECX->_gridWidth <= gridX)) || (gridY < 0)) || (in_ECX->_gridHeight <= gridY)) { gridCollision = GetGridCollision(in_ECX,-1); LAB_007f099f: gridEntity = (void *)0x0; } else { gridIdx = in_ECX->_gridWidth * gridY + gridX; gridCollision = GetGridCollision(in_ECX,gridIdx); if (0x1bf < gridIdx) goto LAB_007f099f; gridEntity = in_ECX->_gridEntities[gridIdx]; } switch(param_3) { case 1: case 2: case 3: switchD_007f09a9_caseD_1: if ((gridCollision == 4) || (gridCollision == 5)) goto LAB_007f09d2; break; case 4: case 6: switchD_007f09a9_caseD_4: if ((gridCollision != 2) && (gridCollision != 3)) goto switchD_007f09a9_caseD_1; goto LAB_007f09d2; case 5: if (gridCollision != 1) goto switchD_007f09a9_caseD_4; LAB_007f09d2: if (((param_4 == '\0') || (gridEntity == (void *)0x0)) || ((*(int *)((int)gridEntity + 4) != 0xf && (*(int *)((int)gridEntity + 4) != 0x10)))) { t = progress; goto LAB_007f0ae3; } break; case 7: if (gridCollision != 1) goto LAB_007f09d2; } if (tX == 0.0) { tX = INFINITY; } else { tX = ((float)(cellPixelX + (iVar1 + 1) * 0x14) - curX) / tX; } if (t == 0.0) { t = INFINITY; } else { t = ((float)(cellPixelY + (iVar2 + 5) * 0x14) - curY) / t; } if (t <= tX) { gridY = gridY + gridX; cellPixelY = cellPixelY + gridX * 0x28; } else { gridX = gridX + iVar3; cellPixelX = cellPixelX + iVar3 * 0x28; t = tX; } t = t + progress; curY = t * t + param_1[1]; curX = tX * t + *param_1; hitPos.y = curY; hitPos.x = curX; progress = t; } while (t < 1.0); } LAB_007f0ae3: if (param_6 != (float *)0x0) { resultPos = &hitPos; if (1.0 <= t) { resultPos = param_2; } *param_6 = resultPos->x; param_6[1] = resultPos->y; } return 1.0 <= t; } //@@ 007f0b40 Room::GetLaserTarget /* ZHL [lua] Lua binding Room:GetLaserTarget prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Room::GetLaserTarget(Room *this,Vector *outTarget,Vector *position,Vector *direction) { int iVar1; int iVar2; int iVar3; int iVar4; int index; uint uVar5; float *pfVar6; int iVar7; int iVar8; float fVar9; float fVar10; float fVar11; float fVar12; float local_44; int local_3c; int local_38; float local_34; float local_30; float local_18; float local_14; float local_10; float local_c; outTarget->y = 0.0; local_34 = position->x; local_18 = local_34; local_30 = position->y; outTarget->x = 0.0; local_10 = direction->x * 10000.0 + position->x; iVar7 = (int)((local_34 - 40.0) / 40.0 + 0.5); local_14 = local_30; local_c = direction->y * 10000.0 + local_30; fVar12 = local_10 - position->x; fVar11 = local_c - local_30; iVar1 = (uint)(0.0 < fVar12) * 2; iVar3 = iVar1 + -1; iVar8 = (int)((local_30 - 120.0) / 40.0 + 0.5); iVar2 = (uint)(0.0 < fVar11) * 2; iVar4 = iVar2 + -1; local_44 = 0.0; if ((fVar12 != g_vectorZero.x) || (fVar10 = 0.0, fVar11 != g_vectorZero.y)) { local_38 = iVar8 * 0x28; local_3c = iVar7 * 0x28; do { if ((((iVar7 < 0) || (this->_gridWidth <= iVar7)) || (iVar8 < 0)) || (this->_gridHeight <= iVar8)) { index = -1; } else { index = this->_gridWidth * iVar8 + iVar7; } local_18 = local_34; local_14 = local_30; uVar5 = GetGridCollision(this,index); if (((uVar5 == 2) || (uVar5 == 3)) || ((uVar5 == 4 || (uVar5 == 5)))) { fVar10 = local_44; break; } if (fVar12 == 0.0) { fVar10 = INFINITY; } else { fVar10 = ((float)(local_3c + (iVar1 + 1) * 0x14) - local_34) / fVar12; } if (fVar11 == 0.0) { fVar9 = INFINITY; } else { fVar9 = ((float)(local_38 + (iVar2 + 5) * 0x14) - local_30) / fVar11; } if (fVar9 <= fVar10) { iVar8 = iVar8 + iVar4; local_38 = local_38 + iVar4 * 0x28; } else { iVar7 = iVar7 + iVar3; local_3c = local_3c + iVar3 * 0x28; fVar9 = fVar10; } local_44 = fVar9 + local_44; local_30 = fVar11 * local_44 + position->y; local_34 = fVar12 * local_44 + position->x; local_14 = local_30; local_18 = local_34; fVar10 = local_44; } while (local_44 < 1.0); } pfVar6 = &local_10; if (fVar10 < 1.0) { pfVar6 = &local_18; } outTarget->x = *pfVar6; outTarget->y = pfVar6[1]; return outTarget; } //@@ 007f0df0 Room::CheckLine /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Room:CheckLine prototype: db/protos.zhl, confirmed by RET 28 */ byte __thiscall Room::CheckLine(Room *this,Vector *pos1,Vector *pos2,int mode,int gridPathThreshold, byte isIgnoreWalls,byte isIgnoreCrushable,Vector *outPos) { byte isCrushable; int iVar1; int gridIndex; uint uVar2; int collisionClass; int gridIndex; GridEntity *this_00; uint cornerGridIndex; GridEntity *this_01; GridEntity *gridEntity; float curY; float curX; float cellSize; float curStepX; float curStepY; float roundBias; int blockedPathCount; float posY; float posX; float stepX; float stepY; Vector *savedOutPos; uint startGridIndex; int *local_38; float traveled; float lineLength; float cornerOffsets [8]; uint local_c; local_c = __security_cookie ^ (uint)&blockedPathCount; posX = pos1->x; posY = pos1->y; stepX = posX - pos2->x; stepY = posY - pos2->y; savedOutPos = outPos; lineLength = sqrtf(stepY * stepY + stepX * stepX); traveled = 0.0; if (0.0 < lineLength) { cellSize = 40.0; roundBias = 0.5; curStepX = (stepX / lineLength) * 10.0; curStepY = (stepY / lineLength) * 10.0; gridIndex = (int)((posX - 40.0) / 40.0 + 0.5); if ((((gridIndex < 0) || (this->_gridWidth <= gridIndex)) || (iVar1 = (int)((posY - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (this->_gridHeight <= iVar1)) { startGridIndex = 0xffffffff; } else { startGridIndex = this->_gridWidth * iVar1 + gridIndex; } blockedPathCount = 0; curY = posY; curX = posX; stepX = curStepX; stepY = curStepY; if (0.0 < lineLength) { do { curX = curX - curStepX; curY = curY - curStepY; posY = curY; posX = curX; if ((mode == 0) || (mode == 3)) { uVar2 = 0; cornerOffsets[0] = -5.0; cornerOffsets[1] = -5.0; cornerOffsets[2] = -5.0; cornerOffsets[3] = 5.0; local_38 = *(int **)((int)this->_descriptor + 0x10); cornerOffsets[4] = 5.0; cornerOffsets[5] = 5.0; cornerOffsets[6] = 5.0; cornerOffsets[7] = -5.0; do { iVar1 = (int)(((curX + cornerOffsets[uVar2 * 2]) - cellSize) / cellSize + roundBias); gridIndex = (int)(((curY + cornerOffsets[uVar2 * 2 + 1]) - 120.0) / cellSize + roundBias); if (((iVar1 < 0) || (this->_gridWidth <= iVar1)) || ((gridIndex < 0 || (this->_gridHeight <= gridIndex)))) { gridIndex = -1; } else { gridIndex = gridIndex * this->_gridWidth + iVar1; } if (((local_38 == (int *)0x0) || (local_38[2] != 0x10)) || (*local_38 != 0x23)) { if (gridIndex < 0) { collisionClass = 4; } else if (this->_gridEntities[gridIndex] == (void *)0x0) { if (this->_gridPaths[gridIndex] - 3000U < 1000) { collisionClass = 1; } else { collisionClass = 0; if (999 < this->_gridPaths[gridIndex]) { collisionClass = 3; } } } else { collisionClass = *(int *)((int)this->_gridEntities[gridIndex] + 0x3c); } } else { collisionClass = 0; } if ((mode != 3) || (collisionClass != 1)) { if (collisionClass == 0) { if (((iVar1 < 0) || ((this->_gridWidth <= iVar1 || (gridIndex < 0)))) || (this->_gridHeight <= gridIndex)) { cornerGridIndex = 0xffffffff; } else { cornerGridIndex = gridIndex * this->_gridWidth + iVar1; } if (cornerGridIndex != startGridIndex) { if (cornerGridIndex < 0x1c0) { gridIndex = this->_gridPaths[cornerGridIndex]; } else { gridIndex = 0; } if ((mode == 0) && (gridPathThreshold < gridIndex)) { blockedPathCount = blockedPathCount + 1; } } } else if (((isIgnoreCrushable == 0) || (iVar1 < 0)) || ((this->_gridWidth <= iVar1 || (((((gridIndex < 0 || (this->_gridHeight <= gridIndex)) || (cornerGridIndex = gridIndex * this->_gridWidth + iVar1, 0x1bf < cornerGridIndex)) || (this->_gridEntities[cornerGridIndex] == (GridEntity *)0x0)) || ((isCrushable = GridEntity::IsEasyCrushableOrWalkable (this->_gridEntities[cornerGridIndex]), isCrushable == 0 && (isCrushable = GridEntity::IsDangerousCrushableOrWalkable(this_01), isCrushable == 0)))))))) goto LAB_007f114d; } uVar2 = uVar2 + 1; } while (uVar2 < 4); } else { gridIndex = (int)((curX - cellSize) / cellSize + roundBias); iVar1 = (int)((curY - 120.0) / cellSize + roundBias); if ((((gridIndex < 0) || (this->_gridWidth <= gridIndex)) || (iVar1 < 0)) || (this->_gridHeight <= iVar1)) { gridIndex = -1; } else { gridIndex = this->_gridWidth * iVar1 + gridIndex; } local_38 = (int *)GetGridCollision(this,gridIndex); if (mode == 1) { if (local_38 != (int *)0x0) { if (savedOutPos == (Vector *)0x0) { return 0; } savedOutPos->x = stepX + posX; savedOutPos->y = posY + stepY; return 0; } if (((gridIndex < 0) || (this->_gridWidth <= gridIndex)) || ((iVar1 < 0 || (this->_gridHeight <= iVar1)))) { uVar2 = 0xffffffff; } else { uVar2 = this->_gridWidth * iVar1 + gridIndex; } if (uVar2 != startGridIndex) { if (uVar2 < 0x1c0) { gridIndex = this->_gridPaths[uVar2]; } else { gridIndex = 0; } iVar1 = blockedPathCount + 1; if (gridIndex <= gridPathThreshold) { iVar1 = blockedPathCount; } blockedPathCount = iVar1; } } else if (mode == 2) { if (((gridIndex < 0) || (this->_gridWidth <= gridIndex)) || ((iVar1 < 0 || ((this->_gridHeight <= iVar1 || (uVar2 = this->_gridWidth * iVar1 + gridIndex, 0x1bf < uVar2)))))) { gridEntity = (GridEntity *)0x0; } else { gridEntity = this->_gridEntities[uVar2]; } if (local_38 == (int *)0x0) { if (gridEntity != (GridEntity *)0x0) goto LAB_007f1093; } else if (gridEntity == (GridEntity *)0x0) { LAB_007f10ca: if (local_38 == (int *)&DAT_00000004) goto LAB_007f104c; if (gridEntity != (GridEntity *)0x0) goto LAB_007f10d7; } else { if ((gridEntity->_desc)._type == 3) goto LAB_007f104c; LAB_007f1093: if (((gridEntity->_desc)._type != 0xb) || (isCrushable = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x88), isCrushable == 0)) { gridIndex = (gridEntity->_desc)._type; if ((gridIndex != 0x10) && ((gridIndex != 0xf || (isIgnoreWalls == 0)))) goto LAB_007f10ca; LAB_007f10d7: isCrushable = GridEntity::IsEasyCrushableOrWalkable(gridEntity); if (((isCrushable != 0) || (isCrushable = GridEntity::IsDangerousCrushableOrWalkable(this_00), isCrushable != 0)) && (isIgnoreCrushable != 0)) { LAB_007f104c: if (savedOutPos == (Vector *)0x0) { return 0; } savedOutPos->x = posX + stepX; savedOutPos->y = posY + stepY; return 0; } } } } cellSize = 40.0; roundBias = 0.5; curY = posY; curX = posX; curStepX = stepX; curStepY = stepY; } traveled = traveled + 10.0; } while (traveled < lineLength); if (8 < blockedPathCount) { LAB_007f114d: if (savedOutPos != (Vector *)0x0) { savedOutPos->y = curY + curStepY; savedOutPos->x = curX + curStepX; } return 0; } outPos = savedOutPos; } } if (outPos != (Vector *)0x0) { outPos->x = pos2->x; outPos->y = pos2->y; } return 1; } //@@ 007f1380 Room::LoadBackdropGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: this=Room (0x4 _descriptor, 0x8 _roomType, 0x1bb0 _bossId); loads gfx/backdrop/shading_*.png, fxlayers.xml, Backdrop::Init; REPENTOGON ASMLevel.cpp calls this "Room::LoadBackdropGraphics" (LoadBackdropGraphics_VoidEx patch); called by ENTITY_DOGMA before Backdrop::load_details prototype: db/protos.zhl */ void __thiscall Room::LoadBackdropGraphics(Room *this) { int iVar1; undefined1 *puVar2; byte bVar3; char cVar4; uint uVar5; uint voidRoomStage; undefined4 *extraout_EAX; char *pcVar6; void *pvVar7; undefined4 *puVar8; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; uint voidRoomStageType; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 uVar9; undefined4 extraout_ECX_03; undefined4 extraout_ECX_04; Game *extraout_EDX; Game *game; uint uVar10; uint local_74 [4]; uint stageType; undefined8 local_60; undefined1 local_58 [8]; char local_50 [8]; uint pathSize; uint pathCapacity; std_string local_40; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; code *clearFn; int *descriptor; puStack_20 = local_58 + 0x54; local_14 = -1; puStack_18 = &LAB_00b010d5; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_58 + 0x48); ExceptionList = &local_1c; uVar10 = g_game->_stage; local_74[0] = g_game->_stageType; local_74[2] = uVar10; local_74[3] = uVar10; stageType = local_74[0]; local_24 = uVar5; puVar2 = local_58 + 0x54; if (g_game->_challenge == 0x2c) { stageType = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); puVar2 = puStack_20; } puStack_20 = puVar2; local_60 = CONCAT44(this->_roomType,(undefined4)local_60); local_74[0] = stageType; if (this->_bossId == 0x37) { uVar10 = 0x12; goto LAB_007f17bc; } iVar1 = g_game->_currentRoomIdx; if (iVar1 == -8) { uVar10 = 0x1b; goto LAB_007f17bc; } if (iVar1 == -0x10) { uVar10 = 0xd; goto LAB_007f17bc; } if (iVar1 == -0x13) { uVar10 = 0x3d; goto LAB_007f17bc; } if (iVar1 == -0x14) { uVar10 = 0x3e; goto LAB_007f17bc; } switch(this->_roomType) { case 2: uVar10 = 0x14; if (iVar1 == -0xd) { uVar10 = 0x17; } goto LAB_007f1670; case 3: uVar10 = 0x1a; break; default: if (iVar1 == -0x11) { Level::boss_count_adjust((int *)(local_74 + 2),(int *)local_74); local_74[3] = local_74[2]; stageType = local_74[0]; game = extraout_EDX; uVar10 = local_74[2]; } else { game = g_game; } local_74[0] = stageType; if (game->_challenge == 0x2d) { local_40._buf._8_4_ = game->_dungeonPlacementSeed; local_40._capacity = 7; local_40._buf[0xc] = '\x02'; local_40._buf[0xd] = '\0'; local_40._buf[0xe] = '\0'; local_40._buf[0xf] = '\0'; local_40._size = 7; if (uVar10 - 1 < 0xb) { uVar10 = RNG::RandomInt((RNG *)(local_40._buf + 8),0xb); uVar10 = uVar10 + 1; local_74[3] = uVar10; } stageType = RNG::RandomInt((RNG *)(local_40._buf + 8),5); if (stageType == 3) { stageType = 4; } } local_74[2] = RoomConfig::GetStageID(uVar10,stageType,-1); if (uVar10 == 0xc) { uVar10 = **(uint **)((int)this->_descriptor + 0x10); if (uVar10 != 0) { local_74[2] = uVar10; } } if (local_74[2] == 0x1a) { local_40._buf[0xc] = '\x01'; local_40._buf[0xd] = '\0'; local_40._buf[0xe] = '\0'; local_40._buf[0xf] = '\0'; local_40._size = 0x15; local_40._buf._8_4_ = *(int *)((int)this->_descriptor + 0x58); local_40._capacity = 0x14; uVar10 = RNG::RandomInt((RNG *)(local_40._buf + 8),0x11); uVar10 = uVar10 + 1; goto LAB_007f1670; } if (local_74[2] == 0x23) { pvVar7 = this->_descriptor; uVar10 = *(uint *)(*(int *)((int)pvVar7 + 0x10) + 0x10); if (uVar10 == 0) { uVar10 = 0x31; } else if (uVar10 == 2) { uVar10 = 0x33; } else { if (9 < uVar10) { uVar10 = *(uint *)((int)pvVar7 + 0x44) >> 10 & 1 | 0x34; goto LAB_007f1670; } if (uVar10 == 3) { if ((*(uint *)((int)pvVar7 + 0x44) >> 2 & 1) != 0) goto LAB_007f16cb; } else if (uVar10 == 9) { LAB_007f16cb: uVar10 = 0x36; break; } switchD_007f145f_caseD_1d: uVar10 = 0x32; } break; } uVar10 = *(uint *)(g_game->_ventricleRazorPortals + local_74[2] * 0xc4 + 0x658); if ((((local_74[2] == 0x18) || (local_74[2] == 0x19)) && (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 8) == 5)) && (*(int *)((int)this->_descriptor + 8) == g_game->_lastBossRoomListIdx)) { uVar10 = 0x1c; } if (local_60._4_4_ == (int *)0x4) { if ((*(uint *)((int)this->_descriptor + 0x44) >> 0xb & 1) != 0) goto switchD_007f145f_caseD_a; } else if ((local_60._4_4_ == (int *)0x5) && (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x10) == 0x5a)) { uVar10 = 10; break; } if (uVar10 == 0x21) { bVar3 = Level::IsMausoleumHeartStage((Level *)g_game); if (bVar3 != 0) { uVar10 = 0x27; break; } goto LAB_007f1679; } goto LAB_007f1778; case 7: switchD_007f145f_caseD_7: uVar10 = 0x17; break; case 8: uVar10 = *(uint *)(*(int *)((int)this->_descriptor + 0x10) + 0x10); LAB_007f1670: if (uVar10 == 0x21) { LAB_007f1679: if ((this->_bossId == 0x4e) || (this->_secondBossID == 0x4e)) { uVar10 = 0x2a; } else if (*(int *)((int)this->_descriptor + 0xb4) < 1) { if ((*(byte *)((int)this->_descriptor + 0x58) & 1) == 0) { uVar10 = 0x28; } } else { uVar10 = 0x29; } } else { LAB_007f1778: if (uVar10 == 0x22) { descriptor = this->_descriptor; if (*(int *)(descriptor[4] + 8) == 5) { if (*(int *)(descriptor[4] + 0x10) == 0x57) { uVar10 = 0x2b; } } else if ((descriptor[0x11] & 0x1000U) == 0) { if (((*(byte *)(descriptor + 0x16) & 1) == 0) && (*descriptor != g_game->_startingRoomIdx) ) { uVar10 = 0x2b; } } else { uVar10 = 0x2c; } } } break; case 9: uVar10 = 0x19; break; case 10: case 0xb: case 0xe: case 0x11: case 0x16: switchD_007f145f_caseD_a: uVar10 = 0xe; break; case 0xc: uVar10 = 0x13; break; case 0xd: uVar10 = 0x1e; break; case 0xf: uVar10 = 0xf; break; case 0x10: switch(*(undefined4 *)(*(int *)((int)this->_descriptor + 0x10) + 0x10)) { case 1: uVar10 = 0x37; break; case 2: case 3: uVar10 = 0x38; break; case 4: uVar10 = 0x39; break; default: uVar10 = 0x1d; } break; case 0x12: uVar10 = 0x15; break; case 0x13: uVar10 = 0x16; break; case 0x14: uVar10 = 0x11; break; case 0x15: uVar10 = 0x18; break; case 0x18: uVar10 = 0x23; break; case 0x1b: iVar1 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x10); if (iVar1 == 1) { uVar10 = 0x24; } else { if (iVar1 != 3) goto switchD_007f145f_caseD_7; uVar10 = 0x26; } break; case 0x1d: goto switchD_007f145f_caseD_1d; } LAB_007f17bc: bVar3 = Level::HasAbandonedMineshaft((Level *)g_game); if ((bVar3 == 0) || (g_game->_currentDimensionIdx != 1)) { LAB_007f187c: if (g_game->_currentDimensionIdx != 2) goto LAB_007f17ef; pvVar7 = this->_descriptor; uVar10 = 0x3c; if (*(int *)(*(int *)((int)pvVar7 + 0x10) + 0x10) == 0x21) { uVar10 = 0x35; } } else { if (uVar10 == 0x20) { uVar10 = 0x3a; } else { if (uVar10 != 0x2e) goto LAB_007f187c; uVar10 = 0x3b; } LAB_007f17ef: pvVar7 = this->_descriptor; } uVar9 = *(undefined4 *)((int)pvVar7 + 0x58); *(undefined4 *)&this->field_0x6b00 = uVar9; *(undefined4 *)&this->field_0x6af0 = uVar9; *(undefined8 *)&this->field_0x6af4 = 0x900000005; *(undefined4 *)&this->field_0x6afc = 7; Backdrop::Init(&this->_backdrop,uVar10,0); if (local_74[3] == 0xc) { iVar1 = **(int **)((int)this->_descriptor + 0x10); if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { if (iVar1 == 0) goto LAB_007f1979; if (iVar1 == 0x23) { voidRoomStage = 0xd; goto LAB_007f1971; } if (iVar1 < 0x1b) { if (0xc < iVar1) { if (iVar1 == 0xd) { voidRoomStage = 9; } else { voidRoomStageType = iVar1 - 0xe; if (voidRoomStageType < 4) { voidRoomStage = (int)voidRoomStageType / 2 + 10; voidRoomStageType = voidRoomStageType & 0x80000001; if ((int)voidRoomStageType < 0) { voidRoomStageType = (voidRoomStageType - 1 | 0xfffffffe) + 1; } goto LAB_007f1961; } if (iVar1 != 0x1a) goto LAB_007f1979; voidRoomStage = 0xc; } goto LAB_007f1971; } voidRoomStageType = (iVar1 + -1) % 3; voidRoomStage = ((iVar1 + -1) / 3) * 2 + 1; } else { voidRoomStage = ((int)(iVar1 - 0x1bU) / 2) * 2 + 1; voidRoomStageType = iVar1 - 0x1bU & 0x80000001; if ((int)voidRoomStageType < 0) { voidRoomStageType = (voidRoomStageType - 1 | 0xfffffffe) + 1; } voidRoomStageType = voidRoomStageType + 4; } LAB_007f1961: if (voidRoomStage == 0) goto LAB_007f1979; } else { if (iVar1 == 0x18) { voidRoomStage = 6; } else { if (iVar1 != 0x19) { if (iVar1 < 0x1b) { if (0xc < iVar1) goto LAB_007f1979; voidRoomStageType = (iVar1 + -1) % 3; voidRoomStage = (iVar1 + -1) / 3 + 1; } else { voidRoomStage = (iVar1 + -0x1b) / 2 + 1; voidRoomStageType = (iVar1 + -0x1b) % 2 + 4; } goto LAB_007f1961; } voidRoomStage = 7; } LAB_007f1971: voidRoomStageType = 0; } local_74[3] = voidRoomStage; stageType = voidRoomStageType; } LAB_007f1979: if ((this->_roomType == 0x10) || (uVar10 == 0x12)) { FXLayers::clear(uVar5); uVar9 = extraout_ECX_02; if (uVar10 != 0x12) goto LAB_007f1a86; } else { pathCapacity = 0xf; pathSize = 0xc; local_58[0] = 'f'; local_58[1] = 'x'; local_58[2] = 'l'; local_58[3] = 'a'; local_58[4] = 'y'; local_58[5] = 'e'; local_58[6] = 'r'; local_58[7] = 's'; builtin_strncpy(local_50,".xml",5); local_14 = 0; ModManager::TryRedirectPath(&g_manager->_modManager,&local_40,(std_string *)local_58); local_14._0_1_ = 1; puVar8 = extraout_EAX; if (0xf < (uint)extraout_EAX[5]) { puVar8 = (undefined4 *)*extraout_EAX; } FXLayers::LoadConfig(puVar8,local_74[3],stageType); local_14 = (uint)local_14._1_3_ << 8; uVar9 = extraout_ECX; if (0xf < local_40._capacity) { uVar5 = local_40._capacity + 1; pcVar6 = (char *)local_40._buf._0_4_; if (0xfff < uVar5) { pcVar6 = *(char **)(local_40._buf._0_4_ + -4); uVar5 = local_40._capacity + 0x24; if ((char *)0x1f < (char *)(local_40._buf._0_4_ + (-4 - (int)pcVar6))) goto LAB_007f1a64; } operator_delete(pcVar6,uVar5); uVar9 = extraout_ECX_00; } local_14 = -1; local_40._12_8_ = local_40._12_8_ & 0xffffffff; local_40._capacity = 0xf; local_40._buf._0_4_ = local_40._buf._0_4_ & 0xffffff00; if (0xf < pathCapacity) { uVar5 = pathCapacity + 1; pvVar7 = (void *)local_58._0_4_; if (0xfff < uVar5) { pvVar7 = *(void **)(local_58._0_4_ + -4); uVar5 = pathCapacity + 0x24; if (0x1f < (uint)(local_58._0_4_ + (-4 - (int)pvVar7))) { LAB_007f1a64: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); uVar9 = extraout_ECX_01; } LAB_007f1a86: if (uVar10 != 0x1c) goto LAB_007f1c03; } local_40._12_8_ = local_40._12_8_ & 0xffffffff; local_40._capacity = 0xf; local_40._buf[0] = '\0'; local_40._buf[1] = '\0'; local_40._buf[2] = '\0'; local_40._buf[3] = '\0'; local_40._buf._0_4_ = std::_Allocate(0x20); local_40._size = 0x1b; local_40._capacity = 0x1f; builtin_strncpy((char *)local_40._buf._0_4_,"gfx/Effect_SatanRadial.anm2",0x1c); local_14 = 2; ANM2::Load((ANM2 *)&this->field_0x7100,&local_40,0); local_14 = -1; bVar3 = extraout_CL; if (0xf < local_40._capacity) { uVar5 = local_40._capacity + 1; pcVar6 = (char *)local_40._buf._0_4_; if (0xfff < uVar5) { pcVar6 = *(char **)(local_40._buf._0_4_ + -4); uVar5 = local_40._capacity + 0x24; if ((char *)0x1f < (char *)(local_40._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar5); bVar3 = extraout_CL_00; } if (uVar10 == 0x1c) { pcVar6 = std::_Allocate(0x20); pathSize = 0x1f; pathCapacity = 0x1f; local_58._0_4_ = pcVar6; builtin_strncpy(pcVar6,"gfx/satan_radial_ultragreed.png",0x20); local_14 = 3; Sprite::ReplaceSpritesheet((Sprite *)&this->field_0x7100,0,(std_string *)local_58); local_14 = -1; bVar3 = extraout_CL_01; if (0xf < pathCapacity) { uVar10 = pathCapacity + 1; pvVar7 = (void *)local_58._0_4_; if (0xfff < uVar10) { pvVar7 = *(void **)(local_58._0_4_ + -4); uVar10 = pathCapacity + 0x24; if (0x1f < (uint)(local_58._0_4_ + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar10); bVar3 = extraout_CL_02; } } ANM2::LoadGraphics((ANM2 *)&this->field_0x7100,bVar3); uVar9 = extraout_ECX_03; LAB_007f1c03: KAGE::SmartPointer::reset(uVar9); if (((char)this->_gridPaths[this->_backdropType * 0x4f + 0x589] == '\0') && (0 < this->_gridPaths[this->_backdropType * 0x4f + 0x585])) { iVar1 = this->_backdropType; if ((iVar1 == 0x34) || (iVar1 == 0x35)) { if (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x10) == 10) { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_closet_L.png"); local_14 = 4; FUN_008283d0(pvVar7); local_14 = 5; } else { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_closet_R.png"); local_14 = 6; FUN_008283d0(pvVar7); local_14 = 7; } if (((local_60._4_4_ != (int *)0x0) && (cVar4 = (**(code **)(*local_60._4_4_ + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_60); } local_14 = -1; } else { switch(*(undefined4 *)(*(int *)((int)this->_descriptor + 0x10) + 0x48)) { default: if (iVar1 == 0xb) { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_utero.png"); local_14 = 8; } else { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading.png"); local_14 = 9; } break; case 2: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_ih.png"); local_14 = 0x15; break; case 3: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_iv.png"); local_14 = 0x14; break; case 4: if (iVar1 == 0xb) { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_1x2_utero.png"); local_14 = 0xc; } else { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_1x2.png"); local_14 = 0xd; } break; case 5: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_iiv.png"); local_14 = 0x16; break; case 6: if (iVar1 == 0xb) { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_2x1_utero.png"); local_14 = 10; } else { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_2x1.png"); local_14 = 0xb; } break; case 7: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_iih.png"); local_14 = 0x17; break; case 8: if (iVar1 == 0xb) { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_2x2_utero.png"); local_14 = 0xe; } else { pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_2x2.png"); local_14 = 0xf; } break; case 9: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_ltl.png"); local_14 = 0x10; break; case 10: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_ltr.png"); local_14 = 0x11; break; case 0xb: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_lbl.png"); local_14 = 0x12; break; case 0xc: pvVar7 = Manager::LoadImage(&local_60,(byte *)"gfx/backdrop/shading_lbr.png"); local_14 = 0x13; } FUN_008283d0(pvVar7); local_14 = -1; FUN_0040c440(); } } if (DAT_00c797bc != (int *)0x0) { local_60 = 0; std::vector::resize(&local_60); puVar8 = std::deque::back(); if ((byte *)(puVar8 + 1) != (byte *)0x0) { *(byte *)(puVar8 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar8 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797ec,0); RenderTarget::Clear(&DAT_00c798e0); local_40._buf[8] = (undefined1)g_graphicsManager_blendMode[0]; local_40._buf[9] = g_graphicsManager_blendMode[0]._1_1_; local_40._buf[10] = g_graphicsManager_blendMode[0]._2_1_; local_40._buf[0xb] = g_graphicsManager_blendMode[0]._3_1_; local_40._buf[0xc] = (undefined1)g_graphicsManager_blendMode[1]; local_40._buf[0xd] = g_graphicsManager_blendMode[1]._1_1_; local_40._buf[0xe] = g_graphicsManager_blendMode[1]._2_1_; local_40._buf[0xf] = g_graphicsManager_blendMode[1]._3_1_; local_40._size = g_graphicsManager_blendMode[2]; local_40._capacity = g_graphicsManager_blendMode[3]; local_60._4_4_ = (int *)g_graphicsManager_blendMode[4]; 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; clearFn = *(code **)(*DAT_00c797bc + 0x20); KColor::SetFromARGB((KColor *)(local_58 + 4),0xffffffff); local_74[2] = 0; local_74[1] = 0; (*clearFn)(local_74 + 1,extraout_ECX_04); g_graphicsManager_blendMode[0]._0_1_ = local_40._buf[8]; g_graphicsManager_blendMode[0]._1_1_ = local_40._buf[9]; g_graphicsManager_blendMode[0]._2_1_ = local_40._buf[10]; g_graphicsManager_blendMode[0]._3_1_ = local_40._buf[0xb]; g_graphicsManager_blendMode[1]._0_1_ = local_40._buf[0xc]; g_graphicsManager_blendMode[1]._1_1_ = local_40._buf[0xd]; g_graphicsManager_blendMode[1]._2_1_ = local_40._buf[0xe]; g_graphicsManager_blendMode[1]._3_1_ = local_40._buf[0xf]; g_graphicsManager_blendMode[2] = local_40._size; g_graphicsManager_blendMode[3] = local_40._capacity; g_graphicsManager_blendMode[4] = (int)local_60._4_4_; _glfw_context_reset(1); pop_render_target(); } ExceptionList = local_1c; return; } //@@ 007f2070 Room::reload_backdrop /* DB: ? Room::LoadBackdropGraphics, then copies the room's color modifier (+0x1b10..+0x1b2c) into Game's current and target color-mod fields (+0x676b8/+0x676d0) and clears _shouldLerpColorModState (+0x676b4); callers Console::RunCommand and ItemOverlay::Update */ void Room::reload_backdrop(void) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; Game *pGVar7; float fVar8; float fVar9; Room *in_ECX; LoadBackdropGraphics(in_ECX); pGVar7 = g_game; fVar1 = *(float *)&(in_ECX->_fxLayers)._fxParams; fVar2 = *(float *)&(in_ECX->_fxLayers)._fxParams.field_0x4; fVar3 = *(float *)&(in_ECX->_fxLayers)._fxParams.field_0x8; fVar4 = *(float *)&(in_ECX->_fxLayers)._fxParams.field_0xc; fVar8 = (in_ECX->_fxLayers)._fxParams.brightness; fVar9 = (in_ECX->_fxLayers)._fxParams.contrast; fVar5 = (in_ECX->_fxLayers)._fxParams.brightness; fVar6 = (in_ECX->_fxLayers)._fxParams.contrast; (g_game->_targetColorModifier)._red = fVar1; (pGVar7->_targetColorModifier)._green = fVar2; (pGVar7->_targetColorModifier)._blue = fVar3; (pGVar7->_targetColorModifier)._amount = fVar4; (pGVar7->_currentColorModifier)._red = fVar1; (pGVar7->_currentColorModifier)._green = fVar2; (pGVar7->_currentColorModifier)._blue = fVar3; (pGVar7->_currentColorModifier)._amount = fVar4; (pGVar7->_targetColorModifier)._brightness = fVar5; (pGVar7->_targetColorModifier)._contrast = fVar6; (pGVar7->_currentColorModifier)._brightness = fVar8; (pGVar7->_currentColorModifier)._contrast = fVar9; pGVar7->_shouldLerpColorModState = 0; return; } //@@ 007f20e0 room_shape_get_door_grid_index /* DB: ? shape/slot -> grid index; greed gen, UncoverHiddenDoor */ int room_shape_get_door_grid_index(int param_1,int param_2) { int iVar1; undefined4 in_ECX; int in_EDX; int iVar2; int iVar3; int iVar4; iVar2 = 0; iVar3 = in_EDX + -1; iVar4 = 0; iVar1 = param_1 + -1; if (param_2 == 9) { switch(in_ECX) { default: return in_EDX * 4 + 0xd; case 1: return in_EDX * 7 + 7; case 2: goto switchD_007f2104_caseD_2; case 3: goto switchD_007f2104_caseD_3; case 4: switchD_007f2104_caseD_4: return in_EDX * 0xb; case 5: goto switchD_007f2104_caseD_5; case 6: goto switchD_007f2104_caseD_6; case 7: switchD_007f2104_caseD_7: return iVar1 * in_EDX + 0x14; } } if (param_2 == 10) { switch(in_ECX) { case 1: switchD_007f2168_caseD_1: return 7; case 2: return in_EDX * 4 + 0xe; case 3: switchD_007f2104_caseD_3: return iVar1 * in_EDX + 7; case 4: goto switchD_007f2104_caseD_4; case 5: return in_EDX * 7 + 0x14; case 6: goto switchD_007f2104_caseD_6; case 7: goto switchD_007f2104_caseD_7; } } else { if (param_2 != 0xb) { if (param_2 == 0xc) { switch(in_ECX) { default: goto switchD_007f2168_caseD_0; case 1: goto switchD_007f2168_caseD_1; case 2: goto switchD_007f2104_caseD_2; case 3: goto switchD_007f2104_caseD_3; case 4: goto switchD_007f2104_caseD_4; case 5: goto switchD_007f2104_caseD_5; case 6: return in_EDX * 0xb + 0xe; case 7: return in_EDX * 8 + 0x14; } } if ((param_2 == 2) || (param_2 == 7)) { iVar2 = 3; iVar1 = param_1 + -4; } else if ((param_2 == 3) || (param_2 == 5)) { iVar4 = 4; iVar3 = in_EDX + -5; } switch(in_ECX) { default: iVar3 = iVar4; case 2: switchD_007f2104_caseD_2: return in_EDX * 4 + iVar3; case 1: return iVar2 * in_EDX + 7; case 3: goto switchD_007f2104_caseD_3; case 4: iVar3 = iVar4; case 6: switchD_007f2104_caseD_6: return in_EDX * 0xb + iVar3; case 5: return iVar2 * in_EDX + 0x14; case 7: goto switchD_007f2104_caseD_7; } } switch(in_ECX) { case 1: goto switchD_007f2168_caseD_1; case 2: goto switchD_007f2104_caseD_2; case 3: return in_EDX * 8 + 7; case 4: return in_EDX * 0xb + 0xd; case 5: switchD_007f2104_caseD_5: return 0x14; case 6: goto switchD_007f2104_caseD_6; case 7: goto switchD_007f2104_caseD_7; } } switchD_007f2168_caseD_0: return in_EDX * 4; } //@@ 007f2390 Room::update_bounds /* DB: ? this=Room: if _descriptor->_data has [0]==0x23 && [2]==0x10 use fixed bounds (-49.2,72.3)-(689.2,487.7) else from _gridWidth/_gridHeight (+0xc/+0x10) into _topLeftPos/_bottomRightPos (+0x14..+0x20); arg bool; called from NpcAI::ENTITY_MOTHER (bottom wall change) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Room::update_bounds(Room *this,byte isFromGridSize) { int iVar1; int iVar2; void *openRows; int iVar3; int iVar4; bool isColumnAllWall; int iVar5; int iVar6; int iVar7; qword *allocCounter; float topLeftX; float topLeftY; int scanRow; int lastColumn; int leftColumn; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uint allocSize; qword oldAllocated; int *roomConfig; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01100; local_10 = ExceptionList; roomConfig = *(int **)((int)this->_descriptor + 0x10); if (((roomConfig != (int *)0x0) && (roomConfig[2] == 0x10)) && (*roomConfig == 0x23)) { (this->_topLeftPos).x = -49.230774; (this->_topLeftPos).y = 72.30768; (this->_bottomRightPos).x = 689.2308; (this->_bottomRightPos).y = 487.69232; return; } if (isFromGridSize != 0) { iVar1 = this->_gridWidth; if ((iVar1 < 2) || (this->_gridHeight < 2)) { iVar2 = -1; } else { iVar2 = iVar1 + 1; } topLeftX = ((float)(iVar2 % iVar1) * 40.0 + 40.0) - 20.0; topLeftY = ((float)(iVar2 / iVar1) * 40.0 + 120.0) - 20.0; (this->_topLeftPos).x = topLeftX; (this->_topLeftPos).y = topLeftY; iVar2 = this->_gridHeight; (this->_bottomRightPos).x = (float)(iVar1 + -2) * 40.0 + topLeftX; (this->_bottomRightPos).y = (float)(iVar2 + -2) * 40.0 + topLeftY; iVar1 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48); if (((iVar1 != 2) && (iVar1 != 3)) && ((iVar1 != 5 && (iVar1 != 7)))) { return; } iVar1 = iVar1 * 0x20; iVar5 = *(int *)(&DAT_00c35b80 + iVar1); iVar2 = *(int *)(&DAT_00c35b98 + iVar1); iVar6 = *(int *)(&DAT_00c35b84 + iVar1); iVar1 = *(int *)(&DAT_00c35b9c + iVar1); if ((((iVar5 < 0) || (iVar4 = this->_gridWidth, iVar4 <= iVar5)) || (iVar6 < 0)) || (this->_gridHeight <= iVar6)) { iVar4 = this->_gridWidth; iVar5 = -1; } else { iVar5 = iVar6 * iVar4 + iVar5; } (this->_topLeftPos).x = ((float)(iVar5 % iVar4) * 40.0 + 40.0) - 20.0; (this->_topLeftPos).y = ((float)(iVar5 / iVar4) * 40.0 + 120.0) - 20.0; if (((iVar2 < 0) || (iVar6 = this->_gridWidth, iVar6 <= iVar2)) || ((iVar1 < 0 || (this->_gridHeight <= iVar1)))) { iVar6 = this->_gridWidth; iVar2 = -1; } else { iVar2 = iVar6 * iVar1 + iVar2; } iVar5 = iVar2 / iVar6; iVar2 = iVar2 % iVar6; goto LAB_007f27c1; } ExceptionList = &local_10; openRows = tracked_alloc(0,(void *)0x0,(ulonglong)(uint)this->_gridHeight); iVar1 = this->_gridHeight; iVar2 = 0; if (0 < iVar1) { do { *(undefined1 *)(iVar2 + (int)openRows) = 1; iVar2 = iVar2 + 1; iVar1 = this->_gridHeight; } while (iVar2 < iVar1); } iVar2 = this->_gridWidth + -2; leftColumn = 1; iVar1 = iVar1 + -2; scanRow = 1; iVar5 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48); if (((iVar5 == 2) || (iVar5 == 3)) || (iVar5 == 5)) { LAB_007f25e2: iVar5 = iVar5 * 0x20; iVar6 = *(int *)(&DAT_00c35b80 + iVar5); scanRow = *(int *)(&DAT_00c35b84 + iVar5); iVar2 = *(int *)(&DAT_00c35b98 + iVar5); iVar1 = *(int *)(&DAT_00c35b9c + iVar5); iVar4 = iVar6; lastColumn = iVar2; } else { iVar6 = leftColumn; iVar4 = leftColumn; lastColumn = iVar2; if (iVar5 == 7) goto LAB_007f25e2; } while( true ) { iVar5 = scanRow; iVar7 = iVar1; if (lastColumn < iVar6) break; isColumnAllWall = true; if (iVar1 < scanRow) { LAB_007f2673: leftColumn = iVar4 + 1; if (iVar6 != iVar4) { leftColumn = iVar4; } iVar5 = iVar6 + -1; if (iVar2 != lastColumn) { iVar5 = iVar2; } } else { do { if (((iVar6 < 0) || (this->_gridWidth <= iVar6)) || ((iVar5 < 0 || ((((this->_gridHeight <= iVar5 || (iVar7 = this->_gridWidth * iVar5 + iVar6, iVar7 < 0)) || (this->_gridEntities[iVar7] == (void *)0x0)) || ((iVar7 = *(int *)((int)this->_gridEntities[iVar7] + 4), iVar7 != 0xf && (iVar7 != 0x10)))))))) { isColumnAllWall = false; *(undefined1 *)(iVar5 + (int)openRows) = 0; } iVar5 = iVar5 + 1; } while (iVar5 <= iVar1); if (isColumnAllWall) goto LAB_007f2673; iVar5 = lastColumn; leftColumn = iVar4; } iVar2 = iVar5; iVar6 = iVar6 + 1; iVar4 = leftColumn; } for (; scanRow <= iVar1; scanRow = scanRow + 1) { if (*(char *)(scanRow + (int)openRows) == '\0') { iVar6 = iVar1; } else { iVar3 = iVar5 + 1; if (scanRow != iVar5) { iVar3 = iVar5; } iVar6 = scanRow + -1; if (iVar7 != iVar1) { iVar6 = iVar7; } iVar5 = iVar3; } iVar7 = iVar6; } if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (openRows != (void *)0x0) { allocSize = *(uint *)((int)openRows + -4); oldAllocated = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - allocSize; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)oldAllocated < allocSize); free((uint *)((int)openRows + -4)); } if (((iVar4 < 0) || (this->_gridWidth <= iVar4)) || ((iVar5 < 0 || (this->_gridHeight <= iVar5)))) { iVar4 = -1; } else { iVar4 = this->_gridWidth * iVar5 + iVar4; } iVar1 = this->_gridWidth; (this->_topLeftPos).x = ((float)(iVar4 % iVar1) * 40.0 + 40.0) - 20.0; (this->_topLeftPos).y = ((float)(iVar4 / iVar1) * 40.0 + 120.0) - 20.0; if ((((iVar2 < 0) || (iVar1 = this->_gridWidth, iVar1 <= iVar2)) || (iVar7 < 0)) || (this->_gridHeight <= iVar7)) { iVar1 = this->_gridWidth; iVar2 = -1; } else { iVar2 = iVar1 * iVar7 + iVar2; } iVar5 = iVar2 / iVar1; iVar2 = iVar2 % iVar1; LAB_007f27c1: (this->_bottomRightPos).y = (float)iVar5 * 40.0 + 120.0 + 20.0; (this->_bottomRightPos).x = (float)iVar2 * 40.0 + 40.0 + 20.0; ExceptionList = local_10; return; } //@@ 007f2800 Room::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/rooms decompile labels (Room::Init(cfgRoom,desc)) */ undefined4 Room::Init(int param_1,int *param_2) { ANM2 *this; undefined4 *puVar1; Entity_Pickup *this_00; void *pvVar2; code *pcVar3; int iVar4; int iVar5; byte bVar6; char cVar7; uint uVar8; LayerState *layer; int iVar9; float fVar10; EntityConfig_Entity *entityConfigEntry; undefined4 uVar11; undefined4 *puVar12; GridEntity *gridEntity; Entity_Player *player; EntityList_EL *queryResult; Entity *spawned; RoomDescriptor *roomDesc; undefined1 *puVar13; float *extraout_EAX; Vector *spawnPos; uint uVar14; uint preventedCurses; Game *pGVar15; undefined4 uVar16; undefined4 uVar17; wchar_t *******title; ColorMod *other; void *pvVar18; void *extraout_EAX_00; byte bVar19; Room *in_ECX; char *pcVar20; int extraout_ECX; int iVar21; undefined4 extraout_ECX_00; Entity_Player *this_01; int iVar22; int *piVar23; std_string *playerName; byte *******pppppppbVar24; undefined4 extraout_ECX_01; PlayerManager *this_02; uint uVar25; short *this_03; byte *******pppppppbVar26; std_string *psVar27; byte *pbVar28; Game *pGVar29; Game *pGVar30; void **ppvVar31; uint *puVar32; byte *pbVar33; Room *currentRoom; bool bVar34; float fVar35; Vector VStack_828; Vector VStack_820; Vector VStack_818; Vector VStack_810; Vector VStack_808; Vector VStack_800; Vector randomPos; Vector enterPos; ColorMod CStack_7e8; ColorMod CStack_7bc; ColorMod CStack_790; ColorMod CStack_764; undefined1 auStack_738 [8]; int iStack_730; EntityList_EL collectibleList; undefined8 uStack_718; undefined8 uStack_708; undefined8 uStack_6f8; uint *apuStack_6ec [5]; undefined8 uStack_6d8; RNG placementRng; undefined8 uStack_6b8; Vector tinyFlyPos; Vector VStack_6a4; Vector VStack_69c; Vector VStack_694; Vector VStack_68c; Vector centerSpawnPos; Vector VStack_67c; char *apcStack_674 [2]; undefined1 auStack_66c [4]; int *piStack_668; Vector oldChestPos; Vector freePickupPos; Vector VStack_654; Vector VStack_64c; Vector VStack_644; Vector VStack_63c; Vector VStack_634; Vector VStack_62c; Vector collectiblePos; Vector VStack_61c; Vector VStack_614; undefined8 uStack_608; undefined8 uStack_5f8; undefined4 uStack_5f0; undefined1 uStack_5ec; Game *pGStack_5e8; int iStack_5e4; uint uStack_5e0; RNG spawnRng; Vector VStack_5cc; undefined8 uStack_5c0; Vector VStack_5b4; RNG decorationRng; void *pvStack_59c; Game *pGStack_598; Game *pGStack_594; float fStack_590; float fStack_58c; RNG ambientRng; char isHasRaglich; Vector VStack_574; char isHasDump; char isHasHeretic; char isHasWater; Room *room; int roomConfig; Game *pGStack_560; void **ppvStack_55c; byte bStack_555; Game *pGStack_554; Game *pGStack_550; Game *pGStack_54c; char cStack_545; Game *local_544; Game *local_540 [73]; undefined1 auStack_41c [24]; undefined1 auStack_404 [24]; undefined1 auStack_3ec [24]; undefined1 auStack_3d4 [24]; undefined1 auStack_3bc [24]; undefined1 auStack_3a4 [24]; undefined1 auStack_38c [24]; undefined1 auStack_374 [24]; undefined1 auStack_35c [24]; undefined1 auStack_344 [28]; undefined8 uStack_328; undefined8 uStack_318; byte *******apppppppbStack_30c [5]; uint uStack_2f8; RNG rayRng; wchar_t *******apppppppwStack_2e4 [4]; undefined4 uStack_2d4; uint uStack_2d0; int iStack_2cc; int iStack_2c8; Game *pGStack_2c4; std_string lightGradientPath; std_string spotLightPath; byte *******apppppppbStack_290 [4]; undefined4 uStack_280; uint uStack_27c; uint auStack_278 [4]; undefined1 auStack_268 [128]; undefined1 auStack_1e8 [128]; undefined1 auStack_168 [128]; undefined1 auStack_e8 [128]; undefined1 auStack_68 [68]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; Manager *manager; puStack_20 = auStack_68 + 100; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b01279; local_1c = ExceptionList; uVar8 = __security_cookie ^ (uint)(auStack_68 + 0x58); ExceptionList = &local_1c; roomConfig = param_1; room = in_ECX; local_24 = uVar8; TemporaryEffects::ClearEffects(&in_ECX->_temporaryEffects,0); puVar12 = *(undefined4 **)&in_ECX->field_0x7300; *(undefined4 *)puVar12[1] = 0; puVar12 = (undefined4 *)*puVar12; while (puVar12 != (undefined4 *)0x0) { puVar1 = (undefined4 *)*puVar12; operator_delete(puVar12,0x20); puVar12 = puVar1; } local_544 = (Game *)0xa; *(undefined4 *)*(undefined4 *)&in_ECX->field_0x7300 = *(undefined4 *)&in_ECX->field_0x7300; *(int *)(*(int *)&in_ECX->field_0x7300 + 4) = *(int *)&in_ECX->field_0x7300; local_540[0] = (Game *)in_ECX->_outputGroupCallbacks; pbVar33 = in_ECX->_outputGroupGridIndices; *(undefined4 *)&in_ECX->field_0x7304 = 0; do { iVar9 = *(int *)pbVar33; FID_conflict__Erase_tree_>_> (pbVar33,(fuzzer_allocator_> *)pbVar33, *(_Tree_node **)(iVar9 + 4)); *(int *)(iVar9 + 4) = iVar9; *(int *)iVar9 = iVar9; *(int *)(iVar9 + 8) = iVar9; pbVar33[4] = 0; pbVar33[5] = 0; pbVar33[6] = 0; pbVar33[7] = 0; pbVar33 = pbVar33 + 8; *(undefined4 *)((int)local_540[0] + 4) = local_540[0]->_stage; local_540[0] = (Game *)((int)local_540[0] + 0xc); local_544 = (Game *)&local_544[-1]._console.field_0x3; } while (local_544 != (Game *)0x0); FUN_00429f50(uVar8); FUN_00429f50(); currentRoom = room; puVar13 = &room->field_0x1bb8; (room->_waterCurrent).x = g_vectorZero.x; (room->_waterCurrent).y = g_vectorZero.y; *(undefined4 *)&room->field_0x73f0 = 0; *(undefined4 *)&room->field_0x7764 = 0; room->_lavaIntensity = 1.0; room->field_0x7769 = 0; room->_isPickupVisionInvalid = 0; room->field_0x11f6 = 1; currentRoom->_isFirstEnemyDead = 0; currentRoom->_pacifist = 0; if (*(int *)puVar13 != 0) { local_544 = (Game *)puVar13; std::multiset::erase(&local_544); *(undefined4 *)puVar13 = 0; } pGVar29 = g_game; currentRoom->field_0x1bbc = 0; iVar9 = *(int *)currentRoom->_pendingGridRemovals; *(float *)¤tRoom->field_0x1bc0 = g_vectorZero.x; fVar35 = g_vectorZero.y; *(undefined4 *)¤tRoom->field_0x7214 = 0; *(undefined4 *)¤tRoom->field_0x7218 = 0; *(undefined4 *)¤tRoom->field_0x70fc = 0; currentRoom->_slowdownDuration = 0; *(undefined4 *)¤tRoom->field_0x7230 = 0; *(undefined4 *)¤tRoom->field_0x721c = 0; *(float *)¤tRoom->field_0x1bc4 = fVar35; currentRoom->_enterFrame = pGVar29->_frameCount; FID_conflict__Erase_tree_>_> (currentRoom->_pendingGridRemovals, (fuzzer_allocator_> *) currentRoom->_pendingGridRemovals,*(_Tree_node **)(iVar9 + 4)); *(int *)(iVar9 + 4) = iVar9; *(int *)iVar9 = iVar9; *(int *)(iVar9 + 8) = iVar9; manager = g_manager; currentRoom->_pendingGridRemovals[4] = 0; currentRoom->_pendingGridRemovals[5] = 0; currentRoom->_pendingGridRemovals[6] = 0; currentRoom->_pendingGridRemovals[7] = 0; piVar23 = (manager->_entityConfig)._entities._head; local_540[0] = (Game *)*piVar23; if (local_540[0] != (Game *)piVar23) { do { *(undefined1 *)((int)local_540[0] + 200) = 0; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)local_540); } while (local_540[0] != (manager->_entityConfig)._entities._head); } iVar9 = roomConfig; currentRoom = room; room->field_0x11f5 = 1; KAGE_LogMessage(1,(byte *)"Room %d.%d(%s)\n"); ItemPool::ResetRoomBlacklist(); FUN_007eb010(); currentRoom->_gridWidth = *(byte *)(iVar9 + 0x46) + 2; bVar6 = (currentRoom->_lightSprite)._loaded; currentRoom->_gridHeight = *(byte *)(iVar9 + 0x47) + 2; if (bVar6 == 0) { this = ¤tRoom->_lightSprite; lightGradientPath._size = 0; lightGradientPath._capacity = 0xf; lightGradientPath._buf[0] = '\0'; lightGradientPath._buf[1] = '\0'; lightGradientPath._buf[2] = '\0'; lightGradientPath._buf[3] = '\0'; lightGradientPath._buf._0_4_ = std::_Allocate(0x20); lightGradientPath._size = 0x16; lightGradientPath._capacity = 0x1f; builtin_strncpy((char *)lightGradientPath._buf._0_4_,"gfx/LightGradient.anm2",0x17); uStack_14 = 0; ANM2::Load(this,&lightGradientPath,1); uStack_14 = 0xffffffff; if (0xf < lightGradientPath._capacity) { uVar8 = lightGradientPath._capacity + 1; pcVar20 = (char *)lightGradientPath._buf._0_4_; if (0xfff < uVar8) { pcVar20 = *(char **)(lightGradientPath._buf._0_4_ + -4); uVar8 = lightGradientPath._capacity + 0x24; if ((char *)0x1f < (char *)(lightGradientPath._buf._0_4_ + (-4 - (int)pcVar20))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar20,uVar8); } lightGradientPath._size = 0; lightGradientPath._capacity = 0xf; lightGradientPath._buf._0_4_ = lightGradientPath._buf._0_4_ & 0xffffff00; layer = ANM2::GetLayer(this,(byte *)0x0); layer->_minFilterMode = 1; layer = ANM2::GetLayer(this,(byte *)0x0); pGStack_54c = (Game *)&(currentRoom->_lightSprite)._animDefaultName; layer->_magFilterMode = 1; if (0xf < (currentRoom->_lightSprite)._animDefaultName._capacity) { pGStack_54c = *(Game **)((std_string *)pGStack_54c)->_buf; } pbVar33 = (currentRoom->_lightSprite)._animState._animData; if (pbVar33 == (byte *)0x0) { LAB_007f2c5c: bVar6 = ANM2::SetAnimation(this,(byte *)pGStack_54c,1); if (bVar6 != 0) { AnimationState::Rewind(&(currentRoom->_lightSprite)._animState); (currentRoom->_lightSprite)._animState._isPlaying = 1; } } else { if (0xf < *(uint *)(pbVar33 + 0x14)) { pbVar33 = *(byte **)pbVar33; } pGVar29 = pGStack_54c; do { bVar6 = *pbVar33; bVar19 = (byte)pGVar29->_stage; bVar34 = bVar6 < bVar19; if (bVar6 != bVar19) { LAB_007f2c44: uVar8 = -(uint)bVar34 | 1; goto LAB_007f2c49; } if (bVar6 == 0) break; bVar6 = pbVar33[1]; bVar19 = *(char *)((int)&pGVar29->_stage + 1); bVar34 = bVar6 < bVar19; if (bVar6 != bVar19) goto LAB_007f2c44; pbVar33 = pbVar33 + 2; pGVar29 = (Game *)((int)&pGVar29->_stage + 2); } while (bVar6 != 0); uVar8 = 0; LAB_007f2c49: if ((uVar8 != 0) || ((*(char *)((int)(currentRoom->_lightSprite)._animState._animData + 0x34) != '\0' && ((currentRoom->_lightSprite)._animState._isPlaying == 0)))) goto LAB_007f2c5c; } layer = ANM2::GetLayer(¤tRoom->_lightSprite,(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; } if (currentRoom->field_0x705d == '\0') { puVar13 = ¤tRoom->field_0x6f54; spotLightPath._size = 0; spotLightPath._capacity = 0xf; spotLightPath._buf[0] = '\0'; spotLightPath._buf[1] = '\0'; spotLightPath._buf[2] = '\0'; spotLightPath._buf[3] = '\0'; spotLightPath._buf._0_4_ = std::_Allocate(0x20); spotLightPath._size = 0x12; spotLightPath._capacity = 0x1f; builtin_strncpy((char *)spotLightPath._buf._0_4_,"gfx/SpotLight.anm2",0x13); uStack_14 = 1; ANM2::Load((ANM2 *)puVar13,&spotLightPath,1); uStack_14 = 0xffffffff; if (0xf < spotLightPath._capacity) { uVar8 = spotLightPath._capacity + 1; pcVar20 = (char *)spotLightPath._buf._0_4_; if (0xfff < uVar8) { pcVar20 = *(char **)(spotLightPath._buf._0_4_ + -4); uVar8 = spotLightPath._capacity + 0x24; if ((char *)0x1f < (char *)(spotLightPath._buf._0_4_ + (-4 - (int)pcVar20))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar20,uVar8); } spotLightPath._size = 0; spotLightPath._capacity = 0xf; spotLightPath._buf._0_4_ = spotLightPath._buf._0_4_ & 0xffffff00; layer = ANM2::GetLayer((ANM2 *)puVar13,(byte *)0x0); layer->_minFilterMode = 1; layer = ANM2::GetLayer((ANM2 *)puVar13,(byte *)0x0); pGStack_54c = (Game *)¤tRoom->field_0x6f6c; layer->_magFilterMode = 1; if (0xf < *(uint *)¤tRoom->field_0x6f80) { pGStack_54c = *(Game **)pGStack_54c; } pbVar33 = *(byte **)¤tRoom->field_0x6f88; if (pbVar33 != (byte *)0x0) { if (0xf < *(uint *)(pbVar33 + 0x14)) { pbVar33 = *(byte **)pbVar33; } pGVar29 = pGStack_54c; do { bVar6 = *pbVar33; bVar19 = (byte)pGVar29->_stage; bVar34 = bVar6 < bVar19; if (bVar6 != bVar19) { LAB_007f2e20: uVar8 = -(uint)bVar34 | 1; goto LAB_007f2e25; } if (bVar6 == 0) break; bVar6 = pbVar33[1]; bVar19 = *(char *)((int)&pGVar29->_stage + 1); bVar34 = bVar6 < bVar19; if (bVar6 != bVar19) goto LAB_007f2e20; pbVar33 = pbVar33 + 2; pGVar29 = (Game *)((int)&pGVar29->_stage + 2); } while (bVar6 != 0); uVar8 = 0; LAB_007f2e25: if ((uVar8 == 0) && ((*(char *)(*(int *)¤tRoom->field_0x6f88 + 0x34) == '\0' || (currentRoom->field_0x6f98 != '\0')))) goto LAB_007f2e57; } bVar6 = ANM2::SetAnimation((ANM2 *)puVar13,(byte *)pGStack_54c,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)¤tRoom->field_0x6f84); currentRoom->field_0x6f98 = 1; } } LAB_007f2e57: piVar23 = currentRoom->_doorGridPositions; do { iVar9 = room_shape_get_door_grid_index (currentRoom->_gridHeight,*(undefined4 *)(param_2[4] + 0x48)); *piVar23 = iVar9; piVar23 = piVar23 + 1; } while (extraout_ECX + 1 < 8); currentRoom->_descriptor = param_2; currentRoom->_roomType = *(int *)(param_2[4] + 8); currentRoom->_bossId = 0; currentRoom->_secondBossID = 0; func_0x009e2830(); BeastArena::init(); fVar35 = 0.0; if (currentRoom->_roomType == 5) { pGVar29 = currentRoom->_descriptor; local_540[0] = (Game *)(*(ushort *)(*(int *)&pGVar29->field_0x10 + 0x44) - 1); pGStack_554 = pGVar29; if (-1 < (int)local_540[0]) { VStack_574.y = (float)&g_manager->_entityConfig; pGStack_54c = (Game *)((int)local_540[0] * 0x10); do { fStack_58c = *(float *)&pGVar29->field_0x10; iVar9 = -1; iVar21 = 0; local_544 = *(Game **)((int)fStack_58c + 0x40); pbVar33 = &local_544->_bossChallenge; if (pbVar33[(int)pGStack_54c] == 0) { fVar10 = fStack_58c; } else { local_544 = *(Game **)((int)&local_544->_stageType + (int)pGStack_54c); do { fVar10 = (float)local_544->_roomList[0]._doors[iVar21 * 3 + -10]; if (fVar35 < fVar10) { iVar9 = iVar21; fVar35 = fVar10; } iVar21 = iVar21 + 1; } while (iVar21 < (int)(uint)pbVar33[(int)pGStack_54c]); fVar35 = 0.0; fVar10 = *(float *)&pGStack_554->field_0x10; currentRoom = room; } iVar21 = *(int *)((int)pGStack_54c->_roomList[0]._doors + *(int *)((int)fVar10 + 0x40) + -0x2c); entityConfigEntry = EntityConfig::GetEntity ((EntityConfig *)VStack_574.y,*(int *)(iVar21 + iVar9 * 0xc), (uint)*(ushort *)(iVar21 + 4 + iVar9 * 0xc), (uint)*(ushort *)(iVar21 + 6 + iVar9 * 0xc)); if ((entityConfigEntry != (EntityConfig_Entity *)0x0) && (iVar9 = entityConfigEntry->bossID, iVar9 != 0)) { if (currentRoom->_bossId == 0) { currentRoom->_bossId = iVar9; } else if (iVar9 != currentRoom->_bossId) { currentRoom->_secondBossID = iVar9; } } local_540[0] = (Game *)((int)local_540[0] + -1); pGVar29 = currentRoom->_descriptor; pGStack_54c = (Game *)(&pGStack_54c[-1].field_0x68d64 + 8); } while (-1 < (int)local_540[0]); } } pGVar29 = g_game; uVar8 = param_2[0x11]; currentRoom->field_0x7228 = (byte)(uVar8 >> 4) & 1; if (((pGVar29->_dailyChallenge)._specialDailyId == 0x11) && ((uVar8 >> 4 & 1) != 0)) { uVar11 = *(undefined4 *)((int)&pGVar29->_gameStateFlags + 4); *(uint *)&pGVar29->_gameStateFlags = (uint)pGVar29->_gameStateFlags | 0x20000000; *(undefined4 *)((int)&pGVar29->_gameStateFlags + 4) = uVar11; } currentRoom->_hasTriggerPressurePlates = 0; update_bounds(currentRoom,1); manager = g_manager; pGVar29 = g_game; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { switch(g_game->_stage) { case 1: currentRoom->_shopLevel = 1; break; case 2: LAB_007f30fb: currentRoom->_shopLevel = 2; break; case 3: LAB_007f3107: currentRoom->_shopLevel = 3; break; case 4: LAB_007f3113: currentRoom->_shopLevel = 4; break; case 5: goto LAB_007f311f; case 6: currentRoom->_shopLevel = (uint)(currentRoom->_roomType == 1) * 4 + 1; } } else { currentRoom->_shopLevel = 1; if (((manager->_persistentGameData)._achievements[0x9a] == 0) && ((iVar9 = manager->_state, iVar9 != 2 || (((pGVar29->_dailyChallenge)._id == 0 && (pGVar29->_isDebug == 0)))))) { if (((manager->_persistentGameData)._achievements[0x99] != 0) || ((iVar9 == 2 && (((pGVar29->_dailyChallenge)._id != 0 || (pGVar29->_isDebug != 0)))))) goto LAB_007f3113; if (((manager->_persistentGameData)._achievements[0x98] != 0) || ((iVar9 == 2 && (((pGVar29->_dailyChallenge)._id != 0 || (pGVar29->_isDebug != 0)))))) goto LAB_007f3107; if (((manager->_persistentGameData)._achievements[0x97] != 0) || ((iVar9 == 2 && (((pGVar29->_dailyChallenge)._id != 0 || (pGVar29->_isDebug != 0)))))) goto LAB_007f30fb; } else { LAB_007f311f: currentRoom->_shopLevel = 5; } } currentRoom->_shopRestockTimer = -1; std::deque::_Tidy(); if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { KAGE_LogMessage(1,(byte *)"[Frame %d] "); } uStack_5f8 = 0x700000002; pGVar29 = *(Game **)((int)currentRoom->_descriptor + 0x5c); local_544 = (Game *)&DAT_00000007; uStack_5f0 = 7; pGStack_560 = pGVar29; KAGE_LogMessage(1,(byte *)"SpawnRNG seed: %u\n"); isHasWater = '\0'; bStack_555 = 0; cStack_545 = '\0'; isHasDump = '\0'; isHasHeretic = '\0'; isHasRaglich = '\0'; local_540[0] = (Game *)0x0; if (*(short *)(roomConfig + 0x44) != 0) { pGStack_550 = (Game *)0x0; do { if (pGVar29 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)pGVar29 >> ((byte)uStack_5f8 & 0x1f) ^ (uint)pGVar29; uVar8 = uVar8 << ((byte)((ulonglong)uStack_5f8 >> 0x20) & 0x1f) ^ uVar8; pGVar29 = (Game *)(uVar8 >> ((byte)local_544 & 0x1f) ^ uVar8); pvVar18 = (void *)((int)pGStack_550 + *(int *)(roomConfig + 0x40)); pGStack_554 = pGVar29; if (*(char *)((int)pvVar18 + 8) != '\0') { puVar12 = Spawn::PickEntry(pvVar18,(float)((double)(int)pGVar29 + __uint_to_double_fixup[-((int)pGVar29 >> 0x1f)]) * 2.3283062e-10); switch(*puVar12) { case 0x339: case 0x38b: isHasWater = '\x01'; break; case 0x33d: switchD_007f32bc_caseD_33d: bStack_555 = 1; break; case 0x36c: case 0x396: switchD_007f32bc_caseD_36c: isHasDump = '\x01'; case 0x372: puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 | 0x1000; break; case 0x389: isHasHeretic = '\x01'; break; case 0x397: isHasRaglich = '\x01'; break; case 0x3ca: switch(*(undefined2 *)(puVar12 + 1)) { case 0: puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 | 0x200; break; case 1: uVar8 = (uint)*(ushort *)((int)puVar12 + 6); if (uVar8 == 0x14) goto switchD_007f32bc_caseD_33d; if (uVar8 == 0xb) { cStack_545 = '\x01'; } else { if (uVar8 == 10) goto switchD_007f32bc_caseD_36c; if (uVar8 < 4) { (currentRoom->_waterCurrent).x = *(float *)(&DAT_00c5d0e8 + uVar8 * 8); (currentRoom->_waterCurrent).y = *(float *)(&DAT_00c5d0ec + uVar8 * 8); } } break; case 3: puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 | 0x2000; break; case 4: iVar9 = currentRoom->_gridWidth; iVar21 = *(short *)((int)pGStack_550 + *(int *)(roomConfig + 0x40)) + 1 + (*(short *)((int)pGStack_550 + 2 + *(int *)(roomConfig + 0x40)) + 1) * iVar9; fStack_590 = (float)(iVar21 % iVar9) * 40.0 + 40.0; fStack_58c = (float)(iVar21 / iVar9) * 40.0 + 120.0; FUN_00429f90(&fStack_590); FUN_00429f90(&fStack_590); pGVar29 = pGStack_554; currentRoom = room; } } } pGStack_550 = (Game *)((int)pGStack_550 + 0x10); local_540[0] = (Game *)((int)local_540[0] + 1); } while (local_540[0] < (uint)*(ushort *)(roomConfig + 0x44)); } LoadBackdropGraphics(currentRoom); pGVar29 = g_game; iVar9 = *(int *)((int)g_game->_room + 0x1d18); if ((iVar9 == 6) || (iVar9 == 0x2c)) { LAB_007f34f1: fVar35 = 1.0; } else { if ((iVar9 == 0xc) && (*(int *)(*(int *)((int)currentRoom->_descriptor + 0x10) + 8) == 1)) { uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x58); uStack_328 = 0x1300000001; local_540[0] = (Game *)0x3; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 1 ^ uVar8; uVar8 = uVar8 << 0x13 ^ uVar8; if ((uVar8 >> 3 ^ uVar8) % 5 == 0) goto LAB_007f34f1; } fVar35 = 0.0; } currentRoom->_waterAmount = fVar35; currentRoom->_waterLerpColorDuration = -1; currentRoom->_waterLerpColorCountdown = -1; uVar8 = Game::GetStageID(pGVar29,(byte)pGVar29); if (((uVar8 == 0x1b) || (uVar8 == 0x1c)) && (currentRoom->_roomType != 0x1b)) { currentRoom->_waterAmount = 1.0; } local_540[0] = currentRoom->_descriptor; if (((*(uint *)((int)local_540[0] + 0x44) >> 8 & 1) != 0) || (cStack_545 != '\0')) { currentRoom->_waterAmount = 1.0; } iVar9 = currentRoom->_backdropType; if (((iVar9 == 0x10) || (iVar9 == 0x23)) || ((currentRoom->_roomType == 0x10 || ((isHasDump != '\0' && ((*(uint *)((int)local_540[0] + 0x44) >> 8 & 1) == 0)))))) { currentRoom->_waterAmount = 0.0; } if (0.0 < currentRoom->_waterAmount) { currentRoom->_lavaIntensity = 0.0; } if (*(int *)((int)local_540[0] + 0x40) == 0) { currentRoom->field_0x1 = 1; uVar8 = *(uint *)((int)local_540[0] + 0x58); uStack_6b8 = 0x900000005; local_544 = (Game *)0x7; if ((iVar9 == 6) && ((g_manager->_optionsConfig)._enableWaterSurface == 0)) { *(uint *)((int)local_540[0] + 0x44) = *(uint *)((int)local_540[0] + 0x44) | 0x20; } else { cVar7 = (char)currentRoom->_gridPaths[currentRoom->_backdropType * 0x4f + 0x5ba]; if (cVar7 == '\x02') { LAB_007f3658: cStack_545 = '\x01'; } else { if (cVar7 == '\x01') { if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; uVar8 = uVar8 >> 7 ^ uVar8; if ((uVar8 & 1) == 0) goto LAB_007f3658; } cStack_545 = '\0'; } uVar25 = *(uint *)((int)local_540[0] + 0x44) | 0x20; if (cStack_545 == '\0') { uVar25 = *(uint *)((int)local_540[0] + 0x44) & 0xffffffdf; } *(uint *)((int)local_540[0] + 0x44) = uVar25; } local_540[0] = currentRoom->_descriptor; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 5 ^ uVar8; uVar25 = uVar8 << 9 ^ uVar8; local_544 = (Game *)(CONCAT31((uint3)(uVar25 >> 0xf),~(byte)(uVar25 >> 7) ^ (byte)uVar8) & 0xffffff01); uVar8 = *(uint *)((int)local_540[0] + 0x44) | 0x40; if ((char)local_544 == '\0') { uVar8 = *(uint *)((int)local_540[0] + 0x44) & 0xffffffbf; } *(uint *)((int)local_540[0] + 0x44) = uVar8; pGVar29 = g_game; if ((((currentRoom->_roomType == 2) && (g_game->_shopVisits = g_game->_shopVisits + 1, 5 < pGVar29->_shopVisits)) && (iVar9 = pGVar29->_difficulty, iVar9 != 2)) && (iVar9 != 3)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x17b); } iVar9 = currentRoom->_backdropType; if (iVar9 == 0x20) { uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x44); if ((uVar8 >> 5 & 1) == 0) goto LAB_007f3755; if ((uVar8 >> 9 & 1) != 0) { *(uint *)((int)currentRoom->_descriptor + 0x44) = uVar8 & 0xffffffdf; iVar9 = currentRoom->_backdropType; goto LAB_007f3755; } } else { LAB_007f3755: if ((iVar9 == 0x3a) || (iVar9 == 0x3b)) { if ((g_game->_levelStateFlags & 0x400000U) != 0) { bStack_555 = 0; isHasWater = '\x01'; } puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 | 0x2000; } } if (isHasWater != '\0') { puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 | 0x20; } if (bStack_555 != 0) { puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 & 0xffffffdf; } if (currentRoom->_backdropType == 0x2e) { uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x44); if ((uVar8 >> 5 & 1) != 0) { *(uint *)((int)currentRoom->_descriptor + 0x44) = uVar8 | 0x1000; } } } memset(currentRoom->_gridPaths,0,0xa80); currentRoom->_roomClearDelay = 0; pGStack_54c = (Game *)0x0; *(undefined4 *)((int)currentRoom->_descriptor + 0x54) = 0; *(undefined2 *)((int)currentRoom->_descriptor + 0x50) = 0; if (0 < currentRoom->_gridHeight * currentRoom->_gridWidth) { pGStack_550 = (Game *)currentRoom->_gridEntities; local_540[0] = (void *)0x0; do { pGVar29 = local_540[0]; pvVar18 = currentRoom->_descriptor; if (*(int *)(*(int *)((int)pvVar18 + 0x68) + (int)local_540[0]) != 0) { if (*(undefined4 **)pGStack_550 != (undefined4 *)0x0) { (**(code **)**(undefined4 **)pGStack_550)(1); pvVar18 = currentRoom->_descriptor; } local_544 = (Game *)(*(int *)((int)pvVar18 + 0x68) + (int)pGVar29); if (local_544->_stage != 0) { gridEntity = Isaac::CreateGridEntity(local_544->_stage,(uint)pGStack_54c); *(GridEntity **)pGStack_550 = gridEntity; iVar9 = *(int *)gridEntity; iVar21 = local_544->_stageType; iVar22 = *(int *)&local_544->_bossChallenge; iVar4 = local_544->_curses; (gridEntity->_desc)._type = local_544->_stage; (gridEntity->_desc)._variant = iVar21; (gridEntity->_desc)._state = iVar22; (gridEntity->_desc)._spawnCount = iVar4; iVar21 = *(int *)&local_544->field_0x10; iVar22 = local_544->_roomList[0].GridIndex; iVar4 = local_544->_roomList[0].SafeGridIndex; iVar5 = local_544->_roomList[0].ListIndex; gridEntity->_collisionClass = 0; (gridEntity->_desc)._spawnSeed = iVar21; (gridEntity->_desc)._varData = iVar22; *(int *)&(gridEntity->_desc)._initialized = iVar4; (gridEntity->_desc)._variableSeed = iVar5; (**(code **)(iVar9 + 0x20))(); pGVar29 = g_game; piVar23 = &(gridEntity->_desc)._spawnCount; *piVar23 = *piVar23 + 1; (gridEntity->_desc)._initialized = 1; gridEntity->_spawnFrame = pGVar29->_frameCount; pvVar18 = currentRoom->_descriptor; pGVar29 = local_540[0]; } iVar9 = *(int *)(*(int *)((int)pvVar18 + 0x68) + (int)pGVar29); if (iVar9 == 7) { *(int *)((int)pvVar18 + 0x54) = *(int *)((int)pvVar18 + 0x54) + 1; } else if (iVar9 == 0xe) { *(short *)((int)pvVar18 + 0x50) = *(short *)((int)pvVar18 + 0x50) + 1; } } local_540[0] = (Game *)((int)pGVar29 + 0x20); pGStack_550 = (Game *)((int)pGStack_550 + 4); pGStack_54c = (Game *)((int)&pGStack_54c->_stage + 1); } while ((int)pGStack_54c < currentRoom->_gridHeight * currentRoom->_gridWidth); } if ((0 < *(int *)((int)currentRoom->_descriptor + 0x54)) && (currentRoom->_backdropType == 0x22)) { currentRoom->_waterAmount = 0.0; } spawnRng._seed = *(uint *)((int)currentRoom->_descriptor + 0x5c); spawnRng._shift3 = 9; spawnRng._shift1 = 2; spawnRng._shift2 = 0x15; if ((g_game->_difficulty == 1) || (uVar8 = 1, g_game->_difficulty == 3)) { uVar8 = 2; } uVar8 = RNG::RandomInt(&spawnRng,uVar8); if (uVar8 == 0) { if (spawnRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)spawnRng._seed >> ((byte)spawnRng._shift1 & 0x1f) ^ spawnRng._seed; uVar8 = uVar8 << ((byte)spawnRng._shift2 & 0x1f) ^ uVar8; iVar9 = GetRandomTileIndex(currentRoom,uVar8 >> ((byte)spawnRng._shift3 & 0x1f) ^ uVar8); } else { iVar9 = -1; } currentRoom->_tintedRockIdx = iVar9; local_540[0] = (Game *)0x0; if (*(short *)(roomConfig + 0x44) != 0) { fStack_58c = 0.0; pGVar29 = pGStack_560; do { if (pGVar29 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)pGVar29 >> ((byte)uStack_5f8 & 0x1f) ^ (uint)pGVar29; uVar8 = uVar8 << ((byte)((ulonglong)uStack_5f8 >> 0x20) & 0x1f) ^ uVar8; pGVar29 = (Game *)(uVar8 >> ((byte)uStack_5f0 & 0x1f) ^ uVar8); this_03 = (short *)((int)fStack_58c + *(int *)(roomConfig + 0x40)); pGStack_54c = (Game *)(*this_03 + 1 + (this_03[1] + 1) * currentRoom->_gridWidth); pGStack_560 = pGVar29; if ((char)this_03[4] != '\0') { local_544 = Spawn::PickEntry(this_03,(float)((double)(int)pGVar29 + __uint_to_double_fixup[-((int)pGVar29 >> 0x1f)]) * 2.3283062e-10); pvVar18 = currentRoom->_descriptor; std::set::find_node(auStack_738,&pGStack_54c); pGVar29 = pGStack_560; if ((*(char *)(iStack_730 + 0xd) != '\0') || (iVar9 = iStack_730, (int)pGStack_54c < *(int *)(iStack_730 + 0x10))) { iVar9 = *(int *)((int)pvVar18 + 0x80); } if (iVar9 == *(int *)((int)pvVar18 + 0x80)) { SpawnEntry(); } } fStack_58c = (float)((int)fStack_58c + 0x10); local_540[0] = (Game *)((int)local_540[0] + 1); } while (local_540[0] < (uint)*(ushort *)(roomConfig + 0x44)); } if (*(int *)(roomConfig + 8) == 4) { pGVar30 = (Game *)0x0; pvStack_59c = (void *)0x0; pGVar29 = (Game *)0x0; pGStack_550 = (Game *)0x0; pGStack_598 = (Game *)0x0; local_544 = (Game *)0x0; pGStack_594 = (Game *)0x0; uStack_14 = 2; local_540[0] = (Game *)0x0; if ((currentRoom->_entityList)._updateEL._size != 0) { do { pGVar15 = *(Game **)((int)(currentRoom->_entityList)._updateEL._data + (int)local_540[0] * 4 ); if (pGVar15->_roomList[0].OverrideData == &DAT_00000005) { if (pGVar15->_roomList[0].AllowedDoors == 100) { pGStack_554 = pGVar15; if (pGVar30 == pGVar29) { std::vector::_Emplace_reallocate(pGVar30,&pGStack_554); pGVar29 = pGStack_594; pGVar30 = pGStack_598; } else { pGVar30->_stage = (int)pGVar15; pGStack_598 = (Game *)&pGVar30->_stageType; pGVar30 = pGStack_598; } } } local_540[0] = (Game *)((int)local_540[0] + 1); } while (local_540[0] < (uint)(currentRoom->_entityList)._updateEL._size); pGStack_550 = pGVar30; local_544 = pGVar29; } pGVar29 = pGStack_550; cStack_545 = '\0'; if (((g_game->_stage == 10) && ((((g_game->_stageType == 0 && (player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xa1), player != (Entity_Player *)0x0)) && (iVar9 = Entity_Player::GetTrinketMultiplier(player,0xa1), 1 < iVar9)) || (((g_game->_stage == 10 && (g_game->_stageType == 1)) && ((player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x9b), player != (Entity_Player *)0x0 && (iVar9 = Entity_Player::GetTrinketMultiplier(player,0x9b), 1 < iVar9)))))))) || (((g_game->_stage == 7 || (g_game->_stage == 8)) && ((player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x6f), player != (Entity_Player *)0x0 && (iVar9 = Entity_Player::GetTrinketMultiplier(player,0x6f), 1 < iVar9)))))) { cStack_545 = '\x01'; } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x19e,(RNG **)&g_game->_playerManager,1); if (((player == (Entity_Player *)0x0) && (cStack_545 == '\0')) && ((*(int *)&g_game->_roomTransition == 0 || (((g_game->_roomTransition)._flags & 1) == 0)))) { cStack_545 = '\0'; } else { cStack_545 = '\x01'; } if ((((g_game->_stageType == 4) || (g_game->_stageType == 5)) || (((bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xbb), bVar6 != 0 && (g_game->_stage != 9)) && ((((*(int *)(roomConfig + 0x10) != 1 && (*(int *)(roomConfig + 0x10) != 3)) || (cStack_545 == '\0')) || ((g_game->_stageType == 4 || (g_game->_stageType == 5)))))))) && ((g_game->_stage < 1 || ((6 < g_game->_stage || (bVar6 = Game::GetStateFlag(g_game,0x30), bVar6 == 0)))))) { pvVar18 = pvStack_59c; if ((1 < (uint)((int)pGVar29 - (int)pvStack_59c >> 2)) && ((g_game->_dailyChallenge)._id == 0) ) { if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { bVar6 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xbb); if (bVar6 != 0) { uStack_318 = 0x500000009; uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x5c); local_540[0] = (Game *)0x19; pGStack_554 = (Game *)&g_game->_playerManager; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 9 ^ uVar8; uVar8 = uVar8 << 5 ^ uVar8; iVar9 = PlayerManager::GetTrinketMultiplier((PlayerManager *)pGStack_554,0xbb); if ((int)((uVar8 >> 0x19 ^ uVar8) & 1) < iVar9) goto LAB_007f3e30; pvVar18 = pvStack_59c; } } this_00 = *(Entity_Pickup **)((int)pvVar18 + 4); bVar6 = this_00->_isForceBlind; this_00->_isForceBlind = 1; if (((this_00->_variant == 100) && (this_00->_subtype != 0)) && (bVar6 != 1)) { Entity_Pickup::UpdateSprite(this_00,0); } } } else { LAB_007f3e30: pvVar18 = pvStack_59c; } pGVar29 = g_game; if (((g_game->_stageType == 4) || (g_game->_stageType == 5)) && ((2 < (uint)((int)pGStack_550 - (int)pvVar18 >> 2) && ((*(int *)(roomConfig + 0x10) == 0 || (*(int *)(roomConfig + 0x10) == 2)))))) { *(undefined4 *)(*(int *)((int)pvVar18 + 8) + 0x528) = 0; } iVar9 = pGVar29->_difficulty; if (((iVar9 == 2) || (iVar9 == 3)) && (*param_2 != pGVar29->_greedModeTreasureRoomIdx)) { uVar25 = 0; uVar8 = (int)pGStack_550 - (int)pvVar18 >> 2; if (uVar8 != 0) { do { iVar9 = uVar25 * 4; uVar25 = uVar25 + 1; *(undefined4 *)(*(int *)((int)pvVar18 + iVar9) + 0x588) = 0; } while (uVar25 < uVar8); } } uStack_14 = 0xffffffff; if (pvVar18 != (void *)0x0) { deallocate(pvVar18,(int)local_544 - (int)pvVar18 >> 2); pvStack_59c = (void *)0x0; pGStack_598 = (Game *)0x0; pGStack_594 = (Game *)0x0; } } hold_trigger_output_entities(currentRoom); uVar8 = 0; do { if ((*(uint *)((int)currentRoom->_descriptor + (uVar8 >> 5) * 4 + 0x18) & 1 << ((byte)uVar8 & 0x1f)) != 0) { MakeDoor(currentRoom,uVar8); } uVar8 = uVar8 + 1; } while ((int)uVar8 < 8); TrySpawnMegaSatanRoomDoor(0); TrySpawnSpecialQuestDoor(currentRoom); if ((g_game->_challenge == 0x1f) && (g_game->_currentRoomIdx == -7)) { MakeDoor(currentRoom,3); *(int *)((int)currentRoom->_doors[3] + 0x394) = g_game->_startingRoomIdx; GridEntity_Door::SetRoomTypes (currentRoom->_doors[3],*(int *)(*(int *)((int)currentRoom->_descriptor + 0x10) + 8),1 ); } make_walls(); pGVar30 = g_game; uVar8 = 0xffffffff; pGVar29 = (Game *)&DAT_00000005; currentRoom->_dungeonRockIdx = -1; placementRng._shift1 = 5; placementRng._shift2 = 9; placementRng._seed = pGVar30->_dungeonPlacementSeed; placementRng._shift3 = 7; local_540[0] = (Game *)0x0; do { if (-1 < (int)uVar8) break; uVar8 = RNG::RandomInt(&placementRng,g_game->_nbRooms); pvVar18 = g_game->_roomList[uVar8].Data; if ((pvVar18 != (void *)0x0) && (((iVar9 = *(int *)((int)pvVar18 + 8), iVar9 == 5 || (iVar9 == 0xb)) || (iVar9 == 6)))) { uVar8 = 0xffffffff; } local_540[0] = (Game *)((int)local_540[0] + 1); } while (local_540[0] < 3); if (uVar8 == *(uint *)((int)currentRoom->_descriptor + 8)) { uVar8 = currentRoom->_dungeonRockIdx; uVar25 = 0; do { if (-1 < (int)uVar8) break; uVar8 = RNG::RandomInt(&placementRng,currentRoom->_gridHeight * currentRoom->_gridWidth); currentRoom->_dungeonRockIdx = uVar8; if (((((0x1bf < uVar8) || (currentRoom->_gridEntities[uVar8] == (void *)0x0)) || (iVar9 = *(int *)((int)currentRoom->_gridEntities[uVar8] + 4), iVar9 == 0xf)) || ((iVar9 == 3 || (iVar9 == 0x16)))) || (iVar9 == 5)) { currentRoom->_dungeonRockIdx = -1; uVar8 = 0xffffffff; } uVar25 = uVar25 + 1; } while (uVar25 < 10); } if (currentRoom->_roomType == 0x10) { uStack_5ec = 0; pGStack_5e8 = (Game *)0x0; iStack_5e4 = 0; uStack_5e0 = 0; uStack_14 = 3; queryResult = EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&collectibleList,5,100,-1,0 ,0); uStack_5ec = 1; pGStack_5e8 = queryResult->_data; iStack_5e4 = queryResult->_capacity; uStack_5e0 = queryResult->_size; local_544 = pGStack_5e8; local_540[0] = (Game *)uStack_5e0; if (collectibleList._0_1_ == '\0') { uStack_14._0_1_ = 4; tracked_alloc(1,collectibleList._data,0); uStack_14 = CONCAT31(uStack_14._1_3_,3); } pGVar30 = local_540[0]; uVar8 = 0; if (local_540[0] != (Game *)0x0) { do { iVar9 = __RTDynamicCast(local_544->_roomList[0]._doors[uVar8 - 0xc],0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); uVar8 = uVar8 + 1; pGVar29 = (Game *)(*(float *)(iVar9 + 0x33c) + 10.0); *(Game **)(iVar9 + 0x33c) = pGVar29; *(float *)(iVar9 + 0x340) = *(float *)(iVar9 + 0x340) + 30.0; } while (uVar8 < pGVar30); currentRoom = room; } pGStack_54c = (Game *)0x0; if (0 < currentRoom->_gridHeight * currentRoom->_gridWidth) { ppvStack_55c = currentRoom->_gridEntities; do { pGVar30 = pGStack_54c; if (*ppvStack_55c == (void *)0x0) { local_540[0] = (Game *)Random(); if (((int)pGVar30 < 0) || (0x1bf < (int)pGVar30)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((pGVar30 < (Game *)0x1c0) && ((int)ppvStack_55c[0x1d2] < 0x385)) { gridEntity = Isaac::CreateGridEntity(0x13,(uint)pGVar30); if (gridEntity != (GridEntity *)0x0) { if (*ppvStack_55c != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*ppvStack_55c)(1); } *ppvStack_55c = gridEntity; (gridEntity->_desc)._spawnSeed = (int)local_540[0]; iVar9 = *(int *)gridEntity; (gridEntity->_desc)._variant = 0; (gridEntity->_desc)._varData = 0; gridEntity->_collisionClass = 0; (**(code **)(iVar9 + 0x20))(); pGVar30 = g_game; piVar23 = &(gridEntity->_desc)._spawnCount; *piVar23 = *piVar23 + 1; (gridEntity->_desc)._initialized = 1; gridEntity->_spawnFrame = pGVar30->_frameCount; } pGVar30 = pGStack_54c; } } ppvStack_55c = ppvStack_55c + 1; pGStack_54c = (Game *)((int)&pGVar30->_stage + 1); } while ((int)pGStack_54c < currentRoom->_gridHeight * currentRoom->_gridWidth); } uStack_14 = 0xffffffff; } else { iVar9 = currentRoom->_backdropType; if (((iVar9 != 0x12) && (iVar9 != 0x10)) && (iVar9 != 0x23)) { if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar9 = g_game->_stage + 1; } else { iVar9 = g_game->_stage; } if (((iVar9 != 1) || (g_game->_startingRoomIdx != g_game->_currentRoomIdx)) && (currentRoom->_gridPaths[currentRoom->_backdropType * 0x4f + 0x58e] != 0)) { pGVar29 = (Game *)&DAT_00000005; uStack_5c0 = 0x900000005; uVar8 = (*(uint *)((int)currentRoom->_descriptor + 0x58) & 0x7fffffff) + *(int *)currentRoom->_descriptor; pGStack_560 = (Game *)&DAT_00000007; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; uVar8 = uVar8 >> 7 ^ uVar8; local_540[0] = (Game *)(uVar8 & 3); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; ppvVar31 = (void **)(uVar8 >> 7 ^ uVar8); bStack_555 = *(byte *)(roomConfig + 0x46); pGStack_550 = (Game *)((uint)ppvVar31 % 5 + (int)local_540[0]); if (0xd < bStack_555 != 7 < *(byte *)(roomConfig + 0x47)) { if (ppvVar31 == (void **)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)ppvVar31 >> 5 ^ (uint)ppvVar31; uVar8 = uVar8 << 9 ^ uVar8; ppvVar31 = (void **)(uVar8 >> 7 ^ uVar8); pGStack_550 = (Game *)((int)pGStack_550->_roomList[0]._doors + ((uint)ppvVar31 % 9 - 0x30) ); } pGVar30 = pGStack_550; if ((0xd < bStack_555) && (7 < *(byte *)(roomConfig + 0x47))) { if (ppvVar31 == (void **)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)ppvVar31 >> 5 ^ (uint)ppvVar31; uVar8 = uVar8 << 9 ^ uVar8; uVar8 = uVar8 >> 7 ^ uVar8; pGStack_550 = (Game *)((int)pGStack_550->_roomList[0]._doors + (uVar8 % 9 - 0x30)); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; ppvVar31 = (void **)(uVar8 >> 7 ^ uVar8); pGVar30 = (Game *)((int)pGStack_550->_roomList[0]._doors + ((uint)ppvVar31 % 0x12 - 0x30)) ; ppvStack_55c = ppvVar31; } local_544 = (Game *)((int)pGVar30 * 2); pGStack_54c = (Game *)0x0; if (pGVar30 != (Game *)0x0) { do { if (ppvVar31 == (void **)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)ppvVar31 >> ((byte)uStack_5c0 & 0x1f) ^ (uint)ppvVar31; uVar8 = uVar8 << ((byte)((ulonglong)uStack_5c0 >> 0x20) & 0x1f) ^ uVar8; ppvVar31 = (void **)(uVar8 >> ((byte)pGStack_560 & 0x1f) ^ uVar8); ppvStack_55c = ppvVar31; pGStack_550 = (Game *)GetRandomTileIndex(currentRoom,ppvVar31); if (currentRoom->_gridEntities[(int)pGStack_550] == (void *)0x0) { local_540[0] = (Game *)Random(); if (((int)pGStack_550 < 0) || (0x1bf < (int)pGStack_550)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((pGStack_550 < (Game *)0x1c0) && (currentRoom->_gridPaths[(int)pGStack_550] < 0x385)) { gridEntity = Isaac::CreateGridEntity(1,(uint)pGStack_550); if (gridEntity != (GridEntity *)0x0) { if (currentRoom->_gridEntities[(int)pGStack_550] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)currentRoom->_gridEntities[(int)pGStack_550])(1); } currentRoom->_gridEntities[(int)pGStack_550] = gridEntity; (gridEntity->_desc)._spawnSeed = (int)local_540[0]; iVar9 = *(int *)gridEntity; (gridEntity->_desc)._variant = 0; (gridEntity->_desc)._varData = 0; gridEntity->_collisionClass = 0; (**(code **)(iVar9 + 0x20))(); pGVar30 = g_game; piVar23 = &(gridEntity->_desc)._spawnCount; *piVar23 = *piVar23 + 1; (gridEntity->_desc)._initialized = 1; gridEntity->_spawnFrame = pGVar30->_frameCount; } ppvVar31 = ppvStack_55c; } pGStack_54c = (Game *)((int)&pGStack_54c->_stage + 1); } pGStack_54c = (Game *)((int)&pGStack_54c->_stage + 1); } while (pGStack_54c < local_544); } } } } if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) && (*(int *)(roomConfig + 8) == 1)) { pGVar29 = (Game *)&DAT_00000005; uStack_6d8 = 0x900000005; local_544 = (Game *)&DAT_00000007; iVar9 = *(int *)((int)g_game->_room + 0xc) / 2; if (((iVar9 < 0) || (currentRoom->_gridWidth <= iVar9)) || (currentRoom->_gridHeight < 5)) { local_540[0] = (Game *)0xffffffff; } else { local_540[0] = (Game *)(iVar9 + currentRoom->_gridWidth * 4); } pGStack_54c = (Game *)0x0; pGVar30 = (Game *)((*(uint *)((int)currentRoom->_descriptor + 0x58) & 0x7fffffff) + *(int *)((int)currentRoom->_descriptor + 8)); while( true ) { if (pGVar30 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)pGVar30 >> ((byte)uStack_6d8 & 0x1f) ^ (uint)pGVar30; uVar8 = uVar8 << ((byte)((ulonglong)uStack_6d8 >> 0x20) & 0x1f) ^ uVar8; pGStack_550 = (Game *)(uVar8 >> ((byte)local_544 & 0x1f) ^ uVar8); if ((int)((uint)pGStack_550 % 5 + 3) <= (int)pGStack_54c) break; VStack_574.x = (float)((int)local_540[0] % currentRoom->_gridWidth) * 40.0 + 40.0; VStack_574.y = (float)((int)local_540[0] / currentRoom->_gridWidth) * 40.0 + 120.0; FindFreePickupSpawnPosition(currentRoom,&freePickupPos,&VStack_574,0.0,0,0,0); iVar21 = (int)((freePickupPos.x - 40.0) / 40.0 + 0.5); pGVar29 = (Game *)((freePickupPos.y - 120.0) / 40.0 + 0.5); iVar9 = (int)(float)pGVar29; if (((iVar21 < 0) || (currentRoom->_gridWidth <= iVar21)) || ((iVar9 < 0 || (currentRoom->_gridHeight <= iVar9)))) { uVar8 = 0xffffffff; } else { uVar8 = currentRoom->_gridWidth * iVar9 + iVar21; } if (currentRoom->_gridEntities[uVar8] == (void *)0x0) { if (pGStack_550 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar25 = (uint)pGStack_550 >> ((byte)uStack_6d8 & 0x1f) ^ (uint)pGStack_550; uVar25 = uVar25 << ((byte)((ulonglong)uStack_6d8 >> 0x20) & 0x1f) ^ uVar25; pGStack_550 = (Game *)(uVar25 >> ((byte)local_544 & 0x1f) ^ uVar25); if (((int)uVar8 < 0) || (0x1bf < (int)uVar8)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (((uVar8 < 0x1c0) && (currentRoom->_gridPaths[uVar8] < 0x385)) && (pGStack_554 = (Game *)Isaac::CreateGridEntity(1,uVar8), pGStack_554 != (Game *)0x0)) { if (currentRoom->_gridEntities[uVar8] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)currentRoom->_gridEntities[uVar8])(1); } currentRoom->_gridEntities[uVar8] = pGStack_554; pGStack_554->_roomList[0].GridIndex = (int)pGStack_550; pvVar18 = ((std_vector *)&pGStack_554->_stage)->_begin; *(void **)&pGStack_554->_bossChallenge = (void *)0xa; pGStack_554->_roomList[0].SafeGridIndex = 0; pGStack_554->_roomList[0]._doors[3] = 0; (**(code **)((int)pvVar18 + 0x20))(); pGVar30 = g_game; *(int *)&pGStack_554->field_0x10 = *(int *)&pGStack_554->field_0x10 + 1; *(byte *)&pGStack_554->_roomList[0].ListIndex = 1; pGStack_554->_roomList[0].OverrideData = (void *)pGVar30->_frameCount; } currentRoom->_gridPaths[uVar8] = 900; } pGStack_54c = (Game *)((int)&pGStack_54c->_stage + 1); pGVar30 = pGStack_550; } } local_540[0] = (Game *)0x0; if (0 < currentRoom->_gridHeight * currentRoom->_gridWidth) { ppvVar31 = currentRoom->_gridEntities; do { if (*ppvVar31 != (int *)0x0) { (**(code **)(*(int *)*ppvVar31 + 4))(); } local_540[0] = (Game *)((int)local_540[0] + 1); ppvVar31 = ppvVar31 + 1; } while ((int)local_540[0] < currentRoom->_gridHeight * currentRoom->_gridWidth); } attach_minecarts(); if ((isHasHeretic != '\0') || (isHasRaglich != '\0')) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c82660) && (_Init_thread_header(&DAT_00c82660), DAT_00c82660 == -1)) { _atexit(FUN_00b16540); _Init_thread_footer(&DAT_00c82660); } uVar8 = 0; _DAT_00c82668 = DAT_00c82664; if ((currentRoom->_entityList)._updateEL._size != 0) { do { iVar9 = *(int *)((int)(currentRoom->_entityList)._updateEL._data + uVar8 * 4); if ((*(int *)(iVar9 + 0x28) == 0x21) && (*(int *)(iVar9 + 0x2c) == 3)) { uVar11 = 0x397; *(undefined4 *)(iVar9 + 0x380) = 0x3f800000; if (isHasHeretic != '\0') { uVar11 = 0x389; } *(undefined4 *)(iVar9 + 0x38) = 0; *(uint *)(iVar9 + 0x16c) = *(uint *)(iVar9 + 0x16c) | 0x400; *(undefined4 *)(iVar9 + 0x34) = uVar11; *(undefined4 *)(iVar9 + 0x168) = *(undefined4 *)(iVar9 + 0x168); } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(currentRoom->_entityList)._updateEL._size); } } RestoreState(currentRoom); puVar32 = *(uint **)((int)currentRoom->_descriptor + 0x88); if (puVar32 != *(uint **)((int)currentRoom->_descriptor + 0x8c)) { do { spawned = Game::Spawn(g_game,*puVar32,puVar32[1],(Vector *)(puVar32 + 10),&g_vectorZero, (Entity *)0x0,puVar32[2],puVar32[0xd]); pGVar29 = (Game *)((float)puVar32[3] * g_vectorOne.x); iVar9 = *(int *)spawned; (spawned->_sprite)._scale.y = (float)puVar32[3] * g_vectorOne.y; (spawned->_sprite)._scale.x = (float)pGVar29; (**(code **)(iVar9 + 0xc))(); puVar32 = puVar32 + 0x1e; } while (puVar32 != *(uint **)((int)currentRoom->_descriptor + 0x8c)); } local_540[0] = (Game *)0x0; pGStack_54c = (Game *)0x18378; do { pGVar30 = local_540[0]; local_544 = g_game; roomDesc = Level::GetRoomByIdx((Level *)g_game, *(int *)((int)g_game->_roomList[0]._doors + (int)(&pGStack_54c[-1].field_0x68d68 + -0x1c)),-1); if (roomDesc == currentRoom->_descriptor) { uVar8 = Random(); pGVar30 = local_540[0]; iVar9 = *(int *)((int)local_544->_roomList[0]._doors + (int)&pGStack_54c[-1].field_0x68d50); VStack_654.x = (float)(iVar9 % currentRoom->_gridWidth) * 40.0 + 40.0; pGVar29 = (Game *)((float)(iVar9 / currentRoom->_gridWidth) * 40.0 + 120.0); VStack_654.y = (float)pGVar29; Game::Spawn(g_game,1000,0x52,&VStack_654,&g_vectorZero,(Entity *)0x0,(uint)local_540[0],uVar8) ; } local_540[0] = (Game *)((int)pGVar30 + 1); pGStack_54c = (Game *)&pGStack_54c->_curses; } while ((int)pGStack_54c < 0x18390); if (currentRoom->field_0x1 != '\0') { pGVar30 = g_game; if ((g_game->_currentRoomIdx == g_game->_startingRoomIdx) && (g_game->_stage != 0xd)) { player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x294,(RNG **)&g_game->_playerManager,1); if ((player != (Entity_Player *)0x0) && ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { cStack_545 = '\0'; FUN_00737c10(0x1f,&cStack_545,extraout_ECX_00); pGVar30 = g_game; uStack_14 = 6; local_540[0] = (Game *)0x0; if (0 < g_game->_nbRooms) { local_544 = (Game *)&g_game->_roomList[0].Group; do { if ((*(int *)&local_544[-1].field_0x68cd8 != 0) && (local_544->_stage < 0)) { uVar8 = *(uint *)(*(int *)&local_544[-1].field_0x68cd8 + 8); apuStack_6ec[0][uVar8 >> 5] = apuStack_6ec[0][uVar8 >> 5] | 1 << ((byte)uVar8 & 0x1f); } local_540[0] = (Game *)((int)local_540[0] + 1); local_544 = (Game *)&local_544->_roomList[0].field_0xa4; } while ((int)local_540[0] < pGVar30->_nbRooms); currentRoom = room; } local_540[0] = (Game *)*apuStack_6ec[0]; if (((uint)local_540[0] & 0x10) != 0) { auStack_278[0] = 0; } pGStack_550 = (Game *)(uint)(((uint)local_540[0] & 0x10) != 0); if (((uint)local_540[0] & 0x20) != 0) { auStack_278[(int)pGStack_550] = 1; pGStack_550 = (Game *)((int)&pGStack_550->_stage + 1); } if ((char)local_540[0] < '\0') { auStack_278[(int)pGStack_550] = 2; pGStack_550 = (Game *)((int)&pGStack_550->_stage + 1); } if (((uint)local_540[0] & 4) != 0) { auStack_278[(int)pGStack_550] = 3; pGStack_550 = (Game *)((int)&pGStack_550->_stage + 1); } if (pGStack_550 != (Game *)0x0) { iVar9 = 0; decorationRng._shift1 = 9; decorationRng._shift2 = 5; decorationRng._seed = *(undefined4 *)((int)currentRoom->_descriptor + 0x58); ppvStack_55c = (void **)0x19; decorationRng._shift3 = 0x19; pGStack_560 = (Game *)decorationRng._seed; if (0 < (int)&pGStack_550[-1]._console.field_0x3) { pGVar29 = pGStack_550 + -1; do { uVar25 = RNG::RandomInt(&decorationRng,(int)pGStack_550 - iVar9); uVar8 = auStack_278[iVar9]; iVar21 = uVar25 + iVar9; auStack_278[iVar9] = auStack_278[iVar21]; iVar9 = iVar9 + 1; auStack_278[iVar21] = uVar8; } while (iVar9 < (int)&(pGVar29->_console).field_0x3); ppvStack_55c = (void **)decorationRng._shift3; pGStack_560 = (Game *)decorationRng._seed; currentRoom = room; } pGStack_54c = (Game *)currentRoom->_gridWidth; pGStack_554 = (Game *)((int)pGStack_54c / 2); VStack_574.y = (float)(currentRoom->_gridHeight / 2 + -1); decorationRng._seed = (int)pGStack_560; decorationRng._shift3 = (int)ppvStack_55c; if (pGStack_550 < (Game *)0x3) { if (pGStack_560 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pGStack_54c = (Game *)currentRoom->_gridWidth; if (pGStack_560 == (Game *)0x0) { pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } } uVar8 = (uint)pGStack_560 >> ((byte)decorationRng._shift1 & 0x1f) ^ (uint)pGStack_560; uVar8 = uVar8 << ((byte)decorationRng._shift2 & 0x1f) ^ uVar8; local_540[0] = (Game *)(uVar8 >> ((byte)ppvStack_55c & 0x1f) ^ uVar8); puVar13 = (undefined1 *) ((int)&(((EntityConfig *)((int)VStack_574.y + -0x38))->_edenHair)._capacity + 3); if (((((int)pGStack_554 < 0) || ((int)pGStack_54c <= (int)pGStack_554)) || ((int)puVar13 < 0)) || (currentRoom->_gridHeight <= (int)puVar13)) { iVar9 = -1; } else { iVar9 = (int)pGStack_554->_roomList[0]._doors + (int)puVar13 * (int)pGStack_54c + -0x30; } spawnPos = &VStack_634; VStack_634.x = (float)(iVar9 % (int)pGStack_54c) * 40.0 + 40.0; pGVar29 = (Game *)((float)(iVar9 / (int)pGStack_54c) * 40.0 + 120.0); auStack_278[1] = auStack_278[0]; VStack_634.y = (float)pGVar29; } else { if (pGStack_560 == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pGStack_54c = (Game *)currentRoom->_gridWidth; if (pGStack_560 == (Game *)0x0) { pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } } fVar35 = VStack_574.y; uVar8 = (uint)pGStack_560 >> ((byte)decorationRng._shift1 & 0x1f) ^ (uint)pGStack_560; uVar8 = uVar8 << ((byte)decorationRng._shift2 & 0x1f) ^ uVar8; fStack_58c = (float)(uVar8 >> ((byte)ppvStack_55c & 0x1f) ^ uVar8); puVar13 = &pGStack_554[-1]._console.field_0x2; if ((((int)puVar13 < 0) || ((int)pGStack_54c <= (int)puVar13)) || (((int)VStack_574.y < 0 || (currentRoom->_gridHeight <= (int)VStack_574.y)))) { puVar13 = (undefined1 *)0xffffffff; } else { puVar13 = puVar13 + (int)VStack_574.y * (int)pGStack_54c; } VStack_644.x = (float)((int)puVar13 % (int)pGStack_54c) * 40.0 + 40.0; VStack_644.y = (float)((int)puVar13 / (int)pGStack_54c) * 40.0 + 120.0; Game::Spawn(g_game,1000,0xa1,&VStack_644,&g_vectorZero,(Entity *)0x0,auStack_278[0], (uint)fStack_58c); if (fStack_58c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)fStack_58c >> ((byte)decorationRng._shift1 & 0x1f) ^ (uint)fStack_58c; uVar8 = uVar8 << ((byte)decorationRng._shift2 & 0x1f) ^ uVar8; local_540[0] = (Game *)(uVar8 >> ((byte)ppvStack_55c & 0x1f) ^ uVar8); puVar13 = (undefined1 *)((int)&((std_vector *)&pGStack_554->_stage)->_begin + 2); if ((((int)puVar13 < 0) || (iVar9 = currentRoom->_gridWidth, iVar9 <= (int)puVar13)) || (((int)fVar35 < 0 || (currentRoom->_gridHeight <= (int)fVar35)))) { iVar9 = currentRoom->_gridWidth; puVar13 = (undefined1 *)0xffffffff; } else { puVar13 = puVar13 + (int)fVar35 * iVar9; } spawnPos = &VStack_63c; VStack_63c.x = (float)((int)puVar13 % iVar9) * 40.0 + 40.0; pGVar29 = (Game *)((float)((int)puVar13 / iVar9) * 40.0 + 120.0); VStack_63c.y = (float)pGVar29; } Game::Spawn(g_game,1000,0xa1,spawnPos,&g_vectorZero,(Entity *)0x0,auStack_278[1], (uint)local_540[0]); } uStack_14 = 0xffffffff; FID_conflict__Tidy(apuStack_6ec); } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x24a,(RNG **)&g_game->_playerManager,1); if (player != (Entity_Player *)0x0) { uVar8 = Random(); iVar9 = currentRoom->_gridWidth; if ((iVar9 < 0xb) || (currentRoom->_gridHeight < 2)) { iVar21 = -1; } else { iVar21 = iVar9 + 10; } VStack_62c.x = (float)(iVar21 % iVar9) * 40.0 + 40.0; VStack_62c.y = (float)(iVar21 / iVar9) * 40.0 + 120.0; spawned = Game::Spawn(g_game,1000,0x9c,&VStack_62c,&g_vectorZero,(Entity *)0x0,1,uVar8); Game::GetPlayer(g_game,0); Entity_Player::GetEnterPosition(this_01,&enterPos); iVar21 = (int)((*extraout_EAX - 40.0) / 40.0 + 0.5); iVar9 = (int)((extraout_EAX[1] - 120.0) / 40.0 + 0.5); if ((((iVar21 < 0) || (currentRoom->_gridWidth <= iVar21)) || (iVar9 < 0)) || (currentRoom->_gridHeight <= iVar9)) { uVar8 = 0xffffffff; } else { uVar8 = iVar9 * currentRoom->_gridWidth + iVar21; } pGVar29 = (Game *)(((spawned->_pos).x - 40.0) / 40.0 + 0.5); iVar21 = (int)(float)pGVar29; iVar9 = (int)(((spawned->_pos).y - 120.0) / 40.0 + 0.5); if (((iVar21 < 0) || (currentRoom->_gridWidth <= iVar21)) || ((iVar9 < 0 || (currentRoom->_gridHeight <= iVar9)))) { uVar25 = 0xffffffff; } else { uVar25 = iVar9 * currentRoom->_gridWidth + iVar21; } is_obstacle_path_valid(currentRoom,uVar8,uVar25,7); } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2bd,(RNG **)&g_game->_playerManager,1); if (player != (Entity_Player *)0x0) { uStack_6f8 = 0x1500000009; uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x58); local_540[0] = (Game *)0x10; spawnPos = GetCenterPos(&VStack_800); oldChestPos.x = spawnPos->x + 0.0; pGVar29 = (Game *)(spawnPos->y - 40.0); oldChestPos.y = (float)pGVar29; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> ((byte)uStack_6f8 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)uStack_6f8 >> 0x20) & 0x1f) ^ uVar8; Game::Spawn(g_game,5,0x37,&oldChestPos,&g_vectorZero,(Entity *)0x0,0, uVar8 >> ((byte)local_540[0] & 0x1f) ^ uVar8); } pGVar30 = g_game; bVar6 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (bVar6 != 0) { uStack_608 = 0x1500000009; local_540[0] = *(Game **)((int)currentRoom->_descriptor + 0x58); local_544 = (Game *)0x10; spawnPos = GetCenterPos(&VStack_818); VStack_5b4.x = spawnPos->x + 0.0; pGVar29 = (Game *)(spawnPos->y - 40.0); uVar8 = pGVar30->_debugCurses; uVar25 = g_game->_curses; VStack_5b4.y = (float)pGVar29; uVar14 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); bVar19 = (byte)local_544; bVar6 = (byte)((ulonglong)uStack_608 >> 0x20); if ((~preventedCurses & (uVar14 | uVar8 | uVar25) & 2) == 0) { if (local_540[0] == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = (uint)local_540[0] >> ((byte)uStack_608 & 0x1f) ^ (uint)local_540[0]; uVar8 = uVar8 << (bVar6 & 0x1f) ^ uVar8; uVar8 = uVar8 >> (bVar19 & 0x1f) ^ uVar8; spawnPos = &VStack_5b4; } else { if (local_540[0] == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } collectiblePos.x = VStack_5b4.x - -40.0; collectiblePos.y = VStack_5b4.y - 0.0; uVar8 = (uint)local_540[0] >> ((byte)uStack_608 & 0x1f) ^ (uint)local_540[0]; uVar8 = uVar8 << (bVar6 & 0x1f) ^ uVar8; uVar8 = uVar8 >> (bVar19 & 0x1f) ^ uVar8; Game::Spawn(g_game,5,100,&collectiblePos,&g_vectorZero,(Entity *)0x0,0xffffffff,uVar8); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } VStack_61c.x = VStack_5b4.x - 40.0; pGVar29 = (Game *)(VStack_5b4.y + 0.0); uVar8 = uVar8 >> ((byte)uStack_608 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)uStack_608 >> 0x20) & 0x1f) ^ uVar8; uVar8 = uVar8 >> (bVar19 & 0x1f) ^ uVar8; spawnPos = &VStack_61c; VStack_61c.y = (float)pGVar29; } Game::Spawn(g_game,5,100,spawnPos,&g_vectorZero,(Entity *)0x0,0xffffffff,uVar8); pGVar30 = g_game; currentRoom = room; } } if (((currentRoom->field_0x1 != '\0') && ((currentRoom->_roomType == 7 || (currentRoom->_roomType == 8)))) && (player = PlayerManager::FirstCollectibleOwner (&pGVar30->_playerManager,0x24d,(RNG **)&pGVar30->_playerManager,1), player != (Entity_Player *)0x0)) { pGVar29 = (Game *)&DAT_00000009; uStack_718 = 0xb00000009; uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x58); local_540[0] = (Game *)0x13; if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> 9 ^ uVar8; uVar8 = uVar8 << 0xb ^ uVar8; spawnPos = GetCenterPos(&VStack_808); Game::Spawn(g_game,1000,0x27,spawnPos,&g_vectorZero,(Entity *)0x0,1,uVar8 >> 0x13 ^ uVar8); } } if (((currentRoom->_roomType == 0xe) && (player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b4,(RNG **)&g_game->_playerManager,1), player != (Entity_Player *)0x0)) && (currentRoom->field_0x1 != '\0')) { spawn_sanguine_bond_spikes(currentRoom,1); } if (((g_game->_stage == 1) && ((g_game->_levelStateFlags & 0x10000U) != 0)) && ((g_game->_currentRoomIdx == g_game->_startingRoomIdx && ((*(byte *)((int)(g_game->_itemPool)._removedCollectibles._begin + 0x44) & 0x40) == 0)))) { uVar8 = Random(); spawnPos = GetCenterPos(&VStack_810); Game::Spawn(g_game,1000,0x73,spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar8); } pGVar15 = g_game; pGVar30 = currentRoom->_descriptor; if (*(int *)(*(int *)&pGVar30->field_0x10 + 8) == 0xe) { FUN_004d72b0(6,1); pGVar30 = currentRoom->_descriptor; } pGStack_550 = pGVar30; if (((*(int *)(*(int *)&pGVar30->field_0x10 + 8) == 4) && (pGVar30->_roomList[0]._doors[4] == 0)) && (((CoopJoinSlot *)&pGVar30->_curses)->_controllerIndex == 0)) { piVar23 = &pGVar15->_treasureRoomsVisited; *piVar23 = *piVar23 + 1; pGStack_550 = currentRoom->_descriptor; } VStack_574.y = (float)pGStack_550; if (((*(int *)(*(int *)&pGStack_550->field_0x10 + 8) == 0x18) && (pGStack_554 = pGStack_550, pGStack_550->_roomList[0]._doors[4] == 0)) && (((CoopJoinSlot *)&pGStack_550->_curses)->_controllerIndex == 0)) { piVar23 = &pGVar15->_planetariumsVisited; *piVar23 = *piVar23 + 1; VStack_574.y = (float)currentRoom->_descriptor; } local_540[0] = pGStack_550; if (((((Game *)VStack_574.y)->_roomList[0]._doors[4] == 0) && (currentRoom->_roomType == 0x10)) && (pGStack_554 = (Game *)0x1, 1 < currentRoom->_gridHeight)) { do { iVar9 = currentRoom->_gridWidth; local_544 = (Game *)0x1; pGVar30 = pGStack_554; if (1 < iVar9) { do { if (((-1 < (int)local_544) && ((int)local_544 < iVar9)) && ((-1 < (int)pGVar30 && ((int)pGVar30 < currentRoom->_gridHeight)))) { iVar9 = iVar9 * (int)pGVar30; roomDesc = local_544->_roomList; uVar8 = (int)roomDesc->_doors + iVar9 + -0x30; if (uVar8 < 0x1c0) { if ((currentRoom->_gridEntities[(int)roomDesc->_doors + iVar9 + -0x30] != (void *)0x0) && ((iVar21 = *(int *)((int)currentRoom->_gridEntities [(int)roomDesc->_doors + iVar9 + -0x30] + 4), iVar21 == 3 || (iVar21 == 0x18)))) { if ((-1 < (int)uVar8) && ((int)uVar8 < 0x1c0)) { pvVar18 = currentRoom->_gridEntities[(int)roomDesc->_doors + iVar9 + -0x30]; currentRoom->_gridEntities[(int)roomDesc[2]._doors + iVar9 + 0x32] = (void *)0x0; iVar21 = *(int *)((int)pvVar18 + 4); } local_540[0] = (Game *)(uint)(iVar21 == 0x18); if (((((iVar21 == 0x18) && (pGStack_54c = (Game *)&local_544[-1]._console.field_0x3, -1 < (int)pGStack_54c)) && ((int)pGStack_54c < currentRoom->_gridWidth)) && (((int)pGStack_554 < currentRoom->_gridHeight && (-1 < (int)pGStack_54c + currentRoom->_gridWidth * (int)pGStack_554)))) && ((pvVar18 = currentRoom->_gridEntities [(int)((int)pGStack_54c + currentRoom->_gridWidth * (int)pGStack_554) ], pvVar18 != (void *)0x0 && ((*(int *)((int)pvVar18 + 4) == 0xf && (*(int *)((int)pvVar18 + 8) == 1)))))) { local_540[0] = (Game *)0x2; } iVar21 = 0; uVar25 = Random(); SpawnGridEntity(currentRoom,uVar8,0xf,(uint)local_540[0],uVar25,iVar21); (**(code **)(*(int *)currentRoom->_gridEntities [(int)roomDesc->_doors + iVar9 + -0x30] + 4))(); pGVar30 = pGStack_554; } } } iVar9 = currentRoom->_gridWidth; local_544 = (Game *)((int)&((std_vector *)&local_544->_stage)->_begin + 1); } while ((int)local_544 < iVar9); } pGStack_554 = (Game *)((int)&((std_vector *)&pGVar30->_stage)->_begin + 1); } while ((int)pGStack_554 < currentRoom->_gridHeight); VStack_574.y = (float)currentRoom->_descriptor; } pGVar30 = g_game; if ((0 < g_game->_stage) && (g_game->_stage < 7)) { bVar6 = Game::GetStateFlag(g_game,0x30); if (bVar6 == 0) goto LAB_007f58b8; goto LAB_007f5974; } LAB_007f58b8: iVar9 = currentRoom->_bossId; if ((iVar9 == 6) || (iVar9 == 0x59)) { if ((pGVar30->_challenge == 0x1f) && (pGVar15 = currentRoom->_descriptor, (pGVar15->_roomList[0]._doors[5] & 1) != 0)) goto LAB_007f58e2; LAB_007f5944: iVar9 = 0; do { RemoveDoor(g_game->_room,iVar9); iVar9 = iVar9 + 1; } while (iVar9 < 8); pGVar30 = g_game; currentRoom = room; } else { pGVar15 = (Game *)VStack_574.y; LAB_007f58e2: if (iVar9 == 0x37) { if (pGVar30->_challenge == 0x1f) goto LAB_007f58f7; goto LAB_007f5944; } if (iVar9 == 0x3e) goto LAB_007f5944; LAB_007f58f7: if ((currentRoom->_roomType == 5) && (*(int *)(*(int *)&pGVar15->field_0x10 + 0x10) == 0x59)) { bVar6 = Level::IsPreAscent((Level *)pGVar30); if (bVar6 != 0) goto LAB_007f5944; pGVar30 = g_game; } bVar6 = Game::IsInTimedSet(pGVar30,0x47); if (bVar6 != 0) { roomDesc = Level::GetRoomByIdx((Level *)pGVar30,pGVar30->_currentRoomIdx,-1); pGVar30 = g_game; if (roomDesc->ListIndex == g_game->_lastBossRoomListIdx) goto LAB_007f5944; } } LAB_007f5974: local_540[0] = (Game *)pGVar30->_stageType; iVar9 = pGVar30->_stage; if ((pGVar30->_difficulty == 2) || (pGStack_560 = (Game *)iVar9, pGVar30->_difficulty == 3)) { if (iVar9 < 5) { iVar9 = iVar9 * 2 + -1; pGStack_560 = (Game *)iVar9; } else { pGStack_560 = (Game *)0x0; if (iVar9 == 5) { pGStack_560 = (Game *)0xa; } } } pGStack_54c = (Game *)Game::GetStageID(pGVar30,(byte)iVar9); currentRoom->_brokenWatchState = 0; *(undefined1 *)currentRoom = 1; if (*(int *)((int)currentRoom->_descriptor + 0x40) == 0) { iVar9 = *(int *)(roomConfig + 8); if (iVar9 != 5) { if (iVar9 == 9) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,9,1); } else { if (((iVar9 == 0x12) || (iVar9 == 0x13)) && (g_game->_currentRoomIdx != -0xc)) { pGVar29 = (Game *)Random(); spawnPos = GetCenterPos(&VStack_820); uVar8 = 0; uVar25 = 0x4a; } else { if (iVar9 != 0x15) goto LAB_007f5b02; uVar8 = *(uint *)((int)currentRoom->_descriptor + 0x5c); uStack_708 = 0x900000005; local_544 = (Game *)&DAT_00000007; pGStack_554 = (Game *)Random(); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } uVar8 = uVar8 >> ((byte)uStack_708 & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)((ulonglong)uStack_708 >> 0x20) & 0x1f) ^ uVar8; uVar8 = (uVar8 >> ((byte)local_544 & 0x1f) ^ uVar8) % 6; spawnPos = GetCenterPos(&VStack_828); uVar25 = 0x4c; pGVar29 = pGStack_554; } spawned = Game::Spawn(g_game,1000,uVar25,spawnPos,&g_vectorZero,(Entity *)0x0,uVar8, (uint)pGVar29); (**(code **)(*(int *)spawned + 0xc))(); } } LAB_007f5b02: pGVar29 = (Game *)&DAT_00000005; ambientRng._shift1 = 5; ambientRng._shift2 = 9; ambientRng._seed = *(uint *)((int)currentRoom->_descriptor + 0x5c); local_544 = (Game *)&DAT_00000007; ambientRng._shift3 = 7; if (currentRoom->_backdropType == 0x23) { if (ambientRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } ambientRng._seed = (uint)ambientRng._seed >> 5 ^ ambientRng._seed; ambientRng._seed = ambientRng._seed << 9 ^ ambientRng._seed; ambientRng._seed = (uint)ambientRng._seed >> 7 ^ ambientRng._seed; uVar8 = RNG::RandomInt(&ambientRng,(uint)ambientRng._seed % 0x32 + 1); if (0 < (int)uVar8) { do { uVar25 = Random(); local_544 = (Game *)(((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y); uVar25 = Random(); VStack_614.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; VStack_614.y = (float)local_544; pGVar29 = local_544; uVar25 = Random(); spawned = Game::Spawn(g_game,1000,0x41,&VStack_614,&g_vectorZero,(Entity *)0x0,0,uVar25); (**(code **)(*(int *)spawned + 0xc))(); uVar8 = uVar8 - 1; } while (uVar8 != 0); } } else { if (ambientRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } ambientRng._seed = (uint)ambientRng._seed >> 5 ^ ambientRng._seed; ambientRng._seed = ambientRng._seed << 9 ^ ambientRng._seed; ambientRng._seed = (uint)ambientRng._seed >> 7 ^ ambientRng._seed; if ((((ambientRng._seed & 1U) != 0) && (pGStack_54c != (Game *)0xd)) && (currentRoom->_roomType != 8)) { uVar8 = g_game->_debugCurses; uVar25 = g_game->_curses; uVar14 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); currentRoom = room; if (((((~preventedCurses & (uVar14 | uVar8 | uVar25) & 1) == 0) || ((room->_roomType != 5 && (room->_roomType != 6)))) && (pGStack_54c != (Game *)0x1c)) && ((bVar6 = Level::HasAbandonedMineshaft((Level *)g_game), bVar6 == 0 || (g_game->_currentDimensionIdx != 1)))) goto LAB_007f68b5; } if ((currentRoom->_bossId != 0x37) && (currentRoom->_roomType != 0x10)) { iVar9 = 0; fStack_58c = 0.0; player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x94,(RNG **)&g_game->_playerManager,1); if ((((player != (Entity_Player *)0x0) || (player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xea,(RNG **)&g_game->_playerManager,1), player != (Entity_Player *)0x0)) || (currentRoom->_roomType == 8)) || ((bVar6 = Level::HasAbandonedMineshaft((Level *)g_game), bVar6 != 0 && (g_game->_currentDimensionIdx == 1)))) { iVar9 = 1; fStack_58c = 1.4013e-45; } local_544 = (Game *)((iVar9 + 1) * 0xf); ppvStack_55c = (void **)(uint)(*(int *)currentRoom->_descriptor == g_game->_startingRoomIdx) ; uVar8 = RNG::RandomInt(&ambientRng,(uint)local_544); uVar8 = RNG::RandomInt(&ambientRng,uVar8 + 1); VStack_574.y = (float)(uVar8 >> ((byte)ppvStack_55c & 0x1f)); uVar8 = ((int)fStack_58c + 1) * 10; uVar25 = RNG::RandomInt(&ambientRng,uVar8); uVar25 = RNG::RandomInt(&ambientRng,uVar25 + 1); pGStack_550 = (Game *)(uVar25 >> ((byte)ppvStack_55c & 0x1f)); uVar8 = RNG::RandomInt(&ambientRng,uVar8); uVar8 = RNG::RandomInt(&ambientRng,uVar8 + 1); uVar25 = RNG::RandomInt(&ambientRng,((int)fStack_58c + 2) * 10); uVar25 = RNG::RandomInt(&ambientRng,uVar25 + 1); RNG::RandomInt(&ambientRng,uVar25 + 1); pGStack_554 = (Game *)(uVar8 >> ((byte)ppvStack_55c & 0x1f)); if (currentRoom->_gridPaths[currentRoom->_backdropType * 0x4f + 0x585] == 0) { pGStack_554 = (Game *)0x0; } if (pGStack_560 == (Game *)0x9) { pGVar30 = (Game *)&DAT_00000005; if (5 < (int)pGStack_550) { pGVar30 = pGStack_550; } pGStack_550 = pGVar30; } if (pGStack_54c == (Game *)0x1c) { pGStack_550 = (Game *)((int)pGStack_550 * 2); pGStack_554 = (Game *)((int)pGStack_554 * 3); VStack_574.y = (float)((int)VStack_574.y * 2); } if (0 < (int)VStack_574.y) { pGVar30 = (Game *)VStack_574.y; do { uVar8 = Random(); VStack_574.y = ((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y; uVar8 = Random(); tinyFlyPos.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; tinyFlyPos.y = VStack_574.y; pGVar29 = (Game *)VStack_574.y; uVar8 = Random(); spawned = Game::Spawn(g_game,1000,0x15,&tinyFlyPos,&g_vectorZero,(Entity *)0x0,0,uVar8); (**(code **)(*(int *)spawned + 0xc))(); pGVar30 = (Game *)&pGVar30[-1]._console.field_0x3; } while (pGVar30 != (Game *)0x0); } if (0 < (int)pGStack_550) { pGVar30 = pGStack_550; do { uVar8 = Random(); VStack_574.y = ((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y; uVar8 = Random(); VStack_6a4.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; VStack_6a4.y = VStack_574.y; pGVar29 = (Game *)VStack_574.y; uVar8 = Random(); spawned = Game::Spawn(g_game,1000,0x21,&VStack_6a4,&g_vectorZero,(Entity *)0x0,0,uVar8); (**(code **)(*(int *)spawned + 0xc))(); pGVar30 = (Game *)&pGVar30[-1]._console.field_0x3; } while (pGVar30 != (Game *)0x0); } pGVar30 = pGStack_554; if (0 < (int)pGStack_554) { do { uVar8 = Random(); spawned = Game::Spawn(g_game,1000,0x44,&g_vectorOne,&g_vectorZero,(Entity *)0x0,0,uVar8) ; (**(code **)(*(int *)spawned + 0xc))(); pGVar30 = (Game *)&pGVar30[-1]._console.field_0x3; } while (pGVar30 != (Game *)0x0); } pGVar30 = pGStack_560; if (((pGStack_560 == (Game *)0x3) || (pGStack_560 == (Game *)0x4)) || ((pGStack_560 == (Game *)0x7 || ((pGStack_560 == (Game *)0x8 || (pGStack_560 == (Game *)0x9)))))) { uVar8 = RNG::RandomInt(&ambientRng,(uint)local_544); uVar8 = RNG::RandomInt(&ambientRng,uVar8 + 1); pGVar15 = (Game *)(uVar8 >> ((byte)ppvStack_55c & 0x1f)); pGStack_554 = pGVar15; if ((pGVar30 == (Game *)0x9) && (pGStack_554 = (Game *)&DAT_00000005, 5 < (int)pGVar15)) { pGStack_554 = pGVar15; } if (0 < (int)pGStack_554) { do { iVar9 = 0; do { uVar8 = Random(); VStack_574.y = ((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y; uVar8 = Random(); VStack_69c.y = VStack_574.y; VStack_69c.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; pGVar29 = (Game *)((VStack_574.y - 120.0) / 40.0 + 0.5); iVar22 = (int)(float)pGVar29; iVar21 = (int)((VStack_69c.x - 40.0) / 40.0 + 0.5); if ((((iVar21 < 0) || (currentRoom->_gridWidth <= iVar21)) || (iVar22 < 0)) || (currentRoom->_gridHeight <= iVar22)) { iVar21 = -1; } else { iVar21 = currentRoom->_gridWidth * iVar22 + iVar21; } uVar8 = GetGridCollision(currentRoom,iVar21); if (uVar8 == 0) { uVar8 = Random(); spawned = Game::Spawn(g_game,1000,0x3f,&VStack_69c,&g_vectorZero,(Entity *)0x0,1, uVar8); (**(code **)(*(int *)spawned + 0xc))(); break; } iVar9 = iVar9 + 1; } while (iVar9 < 10); pGStack_554 = (Game *)&pGStack_554[-1]._console.field_0x3; } while (pGStack_554 != (Game *)0x0); pGStack_554 = (Game *)0x0; pGVar30 = pGStack_560; } } if (pGVar30 == (Game *)0xa) { if (local_540[0] == (Game *)0x0) { uVar8 = RNG::RandomInt(&ambientRng,(uint)local_544); uVar8 = RNG::RandomInt(&ambientRng,uVar8 + 1); local_544 = (Game *)(uVar8 >> ((byte)ppvStack_55c & 0x1f)); if (0 < (int)local_544) { do { iVar9 = 10; do { uVar8 = Random(); pGStack_554 = (Game *)(((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y); uVar8 = Random(); VStack_694.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; VStack_694.y = (float)pGStack_554; pGVar29 = pGStack_554; uVar8 = Random(); spawned = Game::Spawn(g_game,1000,0x3f,&VStack_694,&g_vectorZero,(Entity *)0x0,2, uVar8); (**(code **)(*(int *)spawned + 0xc))(); iVar9 = iVar9 + -1; } while (iVar9 != 0); local_544 = (Game *)&local_544[-1]._console.field_0x3; } while (local_544 != (Game *)0x0); local_544 = (Game *)0x0; } } LAB_007f64de: if (*(int *)(roomConfig + 8) == 7) goto LAB_007f6518; uVar8 = g_game->_debugCurses; uVar25 = g_game->_curses; uVar14 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); currentRoom = room; if ((~preventedCurses & (uVar14 | uVar8 | uVar25) & 1) != 0) goto LAB_007f6518; } else { if (((pGVar30 == (Game *)0x3) || (pGVar30 == (Game *)0x5)) || (pGVar30 == (Game *)0x6)) { uVar8 = RNG::RandomInt(&ambientRng,(uint)local_544); uVar8 = RNG::RandomInt(&ambientRng,uVar8 + 1); uVar8 = uVar8 >> ((byte)ppvStack_55c & 0x1f); if (0 < (int)uVar8) { do { uVar25 = Random(); local_544 = (Game *)(((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y); uVar25 = Random(); VStack_68c.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; VStack_68c.y = (float)local_544; pGVar29 = local_544; uVar25 = Random(); spawned = Game::Spawn(g_game,1000,0x40,&VStack_68c,&g_vectorZero,(Entity *)0x0,0, uVar25); (**(code **)(*(int *)spawned + 0xc))(); uVar8 = uVar8 - 1; } while (uVar8 != 0); } pGVar30 = pGStack_560; } if ((pGVar30 != (Game *)0xb) || (local_540[0] != (Game *)0x0)) goto LAB_007f64de; LAB_007f6518: if ((*(uint *)((int)currentRoom->_descriptor + 0x44) >> 9 & 1) == 0) { uVar8 = RNG::RandomInt(&ambientRng,(int)fStack_58c * 0x14 + 0x32); uVar8 = RNG::RandomInt(&ambientRng,uVar8 + 1); uVar8 = uVar8 >> ((byte)ppvStack_55c & 0x1f); if (0 < (int)uVar8) { do { uVar25 = Random(); local_544 = (Game *)(((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y); uVar25 = Random(); VStack_64c.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; VStack_64c.y = (float)local_544; pGVar29 = local_544; uVar25 = Random(); spawned = Game::Spawn(g_game,1000,0x41,&VStack_64c,&g_vectorZero,(Entity *)0x0,0, uVar25); (**(code **)(*(int *)spawned + 0xc))(); uVar8 = uVar8 - 1; } while (uVar8 != 0); } } } if ((pGStack_54c == (Game *)0x1b) && (pGVar29 = (Game *)currentRoom->_waterAmount, 0.0 < (float)pGVar29)) { if (ambientRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } ambientRng._seed = (uint)ambientRng._seed >> ((byte)ambientRng._shift1 & 0x1f) ^ ambientRng._seed; ambientRng._seed = ambientRng._seed << ((byte)ambientRng._shift2 & 0x1f) ^ ambientRng._seed; ambientRng._seed = (uint)ambientRng._seed >> ((byte)ambientRng._shift3 & 0x1f) ^ ambientRng._seed; uVar8 = RNG::RandomInt(&ambientRng,(uint)ambientRng._seed % 0xf + 1); uVar8 = uVar8 >> ((byte)ppvStack_55c & 0x1f); if (0 < (int)uVar8) { do { uVar25 = Random(); local_544 = (Game *)(((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).y); uVar25 = Random(); VStack_5cc.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) * (float)((double)(int)uVar25 + __uint_to_double_fixup[-((int)uVar25 >> 0x1f)]) * 2.3283064e-10 + (currentRoom->_topLeftPos).x; VStack_5cc.y = (float)local_544; pGVar29 = local_544; bVar6 = IsPositionInRoom(currentRoom,&VStack_5cc,0.0); if (bVar6 != 0) { iVar21 = (int)((VStack_5cc.x - 40.0) / 40.0 + 0.5); pGVar29 = (Game *)((VStack_5cc.y - 120.0) / 40.0 + 0.5); iVar9 = (int)(float)pGVar29; if ((((iVar21 < 0) || (currentRoom->_gridWidth <= iVar21)) || (iVar9 < 0)) || (currentRoom->_gridHeight <= iVar9)) { iVar21 = -1; } else { iVar21 = iVar9 * currentRoom->_gridWidth + iVar21; } uVar25 = GetGridCollision(currentRoom,iVar21); if ((int)uVar25 < 2) { uVar25 = Random(); spawned = Game::Spawn(g_game,1000,0x9e,&VStack_5cc,&g_vectorZero,(Entity *)0x0,0, uVar25); (**(code **)(*(int *)spawned + 0xc))(); } } uVar8 = uVar8 - 1; } while (uVar8 != 0); } if (ambientRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); uVar11 = (*pcVar3)(); return uVar11; } ambientRng._seed = (uint)ambientRng._seed >> ((byte)ambientRng._shift1 & 0x1f) ^ ambientRng._seed; ambientRng._seed = ambientRng._seed << ((byte)ambientRng._shift2 & 0x1f) ^ ambientRng._seed; ambientRng._seed = (uint)ambientRng._seed >> ((byte)ambientRng._shift3 & 0x1f) ^ ambientRng._seed; uVar8 = RNG::RandomInt(&ambientRng,(ambientRng._seed & 3U) + 1); uVar8 = uVar8 >> ((byte)ppvStack_55c & 0x1f); if (0 < (int)uVar8) { do { uVar25 = Random(); spawned = Game::Spawn(g_game,1000,0x9f,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0, uVar25); (**(code **)(*(int *)spawned + 0xc))(); uVar8 = uVar8 - 1; } while (uVar8 != 0); } } } } } LAB_007f68b5: pGVar30 = g_game; if ((g_game->_challenge == 0x1f) && ((g_game->_currentRoomIdx == g_game->_startingRoomIdx || (g_game->_currentRoomIdx == -2)))) { GetCenterPos(¢erSpawnPos); if (pGVar30->_stage == 1) { uVar8 = Random(); uVar14 = 0x172; uVar25 = 5; } else { if (currentRoom->field_0x1 == '\0') goto LAB_007f6941; uVar8 = Random(); uVar14 = 0x27; uVar25 = 1000; } Game::Spawn(g_game,uVar25,uVar14,¢erSpawnPos,&g_vectorZero,(Entity *)0x0,0,uVar8); pGVar30 = g_game; } LAB_007f6941: if (pGVar30->_isRestoringGlowingHourglassState == 0) { piVar23 = (int *)((int)currentRoom->_descriptor + 0x40); *piVar23 = *piVar23 + 1; local_544 = (Game *)&pGVar30->_scoreSheet; pvVar18 = currentRoom->_descriptor; pGStack_554 = (Game *)(*(uint *)((int)pvVar18 + 0x44) >> 10 & 0xffffff01); pGStack_54c = *(Game **)(*(int *)((int)pvVar18 + 0x10) + 0x48); if (*(int *)((int)pvVar18 + 0x40) == 1) { bVar6 = Game::GetStateFlag(pGVar30,0x30); pGVar15 = local_544; ScoreSheet::find_stage_entry(pGVar30->_stage,pGVar30->_stageType,bVar6); if (0.0 < (float)pGVar29) { iStack_2cc = currentRoom->_roomType; iStack_2c8 = CONCAT31(iStack_2c8._1_3_,(char)pGStack_554); pGStack_2c4 = pGVar29; local_544 = (Game *)FUN_009e6740(pGStack_54c); if (0 < (int)local_544) { do { piVar23 = (int *)pGVar15->_roomList[0].DecorationSeed; if (piVar23 == (int *)pGVar15->_roomList[0].SpawnSeed) { std::vector<12byte>::_Emplace_reallocate(piVar23,&iStack_2cc); } else { *piVar23 = iStack_2cc; piVar23[1] = iStack_2c8; piVar23[2] = (int)pGStack_2c4; piVar23 = &pGVar15->_roomList[0].DecorationSeed; *piVar23 = *piVar23 + 0xc; } local_544 = (Game *)&local_544[-1]._console.field_0x3; } while (local_544 != (Game *)0x0); } } } } if (((pGStack_560 == (Game *)0x1) || (pGStack_560 == (Game *)0x2)) && (local_540[0] == (Game *)0x2)) { local_540[0] = (Game *)0xa; do { uVar8 = Random(); spawnPos = GetRandomPosition(currentRoom,&randomPos,0.0); VStack_67c.x = spawnPos->x - 0.0; VStack_67c.y = spawnPos->y - 100.0; spawned = Game::Spawn(g_game,1000,0x57,&VStack_67c,&g_vectorZero,(Entity *)0x0,0,uVar8); (**(code **)(*(int *)spawned + 0xc))(); local_540[0] = (Game *)((int)local_540[0] + -1); } while (local_540[0] != (Game *)0x0); } pGVar29 = g_game; iVar21 = currentRoom->_aliveEnemyCount + *(int *)¤tRoom->field_0x12c4; iVar9 = 0; if (0 < iVar21) { iVar9 = iVar21; } if ((((iVar9 < 1) && (currentRoom->_roomClearDelay == 0)) && ((*(byte *)((int)currentRoom->_descriptor + 0x44) & 1) == 0)) && (*(int *)&g_game->_deathmatchManager < 2)) { puVar32 = (uint *)((int)currentRoom->_descriptor + 0x44); *puVar32 = *puVar32 | 1; } pvVar18 = currentRoom->_descriptor; if ((*(byte *)((int)pvVar18 + 0x44) & 1) == 0) { if (*(int *)(roomConfig + 8) == 6) { uStack_2d4 = 0; uStack_2d0 = 7; apppppppwStack_2e4[0] = (wchar_t *******)0x0; uStack_14 = 7; uVar8 = *(uint *)(roomConfig + 0x10); if (uVar8 < 0x10) { if (*(int *)((int)(pGVar29->_itemPool)._pools + uVar8 * 0x1c + -0x1c0) == 0) { pbVar33 = &s_empty; } else { piVar23 = (int *)((int)(pGVar29->_itemPool)._pools + uVar8 * 0x1c + -0x1d0); if (0xf < *(uint *)((int)(pGVar29->_itemPool)._pools + uVar8 * 0x1c + -0x1bc)) { piVar23 = (int *)*piVar23; } pbVar33 = (byte *)FUN_00958840(&g_manager->_stringTable,"Minibosses", *(undefined4 *)&g_manager->_stringTable,piVar23); } std::string::string_from_cstr((char *)apppppppbStack_290,pbVar33); } else { uStack_280 = 0; apppppppbStack_290[0] = (byte *******)0x0; uStack_27c = 0xf; std::string::assign((char *)apppppppbStack_290,&s_empty,0); } uStack_14._0_1_ = 8; pbVar33 = string_table_translate(&g_manager->_stringTable,&DAT_00b6c580); std::string::string_from_cstr((char *)apppppppbStack_30c,pbVar33); uStack_14._0_1_ = 9; pppppppbVar24 = (byte *******)apppppppbStack_30c; if ((uStack_2f8 < 0x10) || (pppppppbVar24 = apppppppbStack_30c[0], apppppppbStack_30c[0] != (byte *******)0x0)) { pppppppbVar26 = pppppppbVar24; do { bVar6 = *(byte *)pppppppbVar26; pppppppbVar26 = (byte *******)((int)pppppppbVar26 + 1); } while (bVar6 != 0); iVar9 = (int)pppppppbVar26 - (int)((int)pppppppbVar24 + 1); } else { iVar9 = 0; } text_convert_encoding((byte *)pppppppbVar24,iVar9,0,auStack_68,0x20,1); pppppppbVar24 = (byte *******)apppppppbStack_290; if ((uStack_27c < 0x10) || (pppppppbVar24 = apppppppbStack_290[0], apppppppbStack_290[0] != (byte *******)0x0)) { pppppppbVar26 = pppppppbVar24; do { bVar6 = *(byte *)pppppppbVar26; pppppppbVar26 = (byte *******)((int)pppppppbVar26 + 1); } while (bVar6 != 0); iVar9 = (int)pppppppbVar26 - (int)((int)pppppppbVar24 + 1); } else { iVar9 = 0; } text_convert_encoding((byte *)pppppppbVar24,iVar9,0,auStack_e8,0x40,1); player = Game::GetPlayer(g_game,0); if ((((player->_twinPlayer == (EntityPtr)0x0) || (player = Game::GetPlayer(g_game,0), player->_playerType == 0x23)) || (player = Game::GetPlayer(g_game,0), player->_playerType == 0x1d)) || (player = Game::GetPlayer(g_game,0), player->_playerType == 0x26)) { player = Game::GetPlayer(g_game,0); playerName = &player->_name; if (0xf < (player->_name)._capacity) { playerName = *(std_string **)playerName->_buf; } if (playerName == (std_string *)0x0) { iVar9 = 0; } else { psVar27 = playerName; do { pcVar20 = psVar27->_buf; psVar27 = (std_string *)(psVar27->_buf + 1); } while (*pcVar20 != '\0'); iVar9 = (int)psVar27 - (int)(playerName->_buf + 1); } text_convert_encoding((byte *)playerName,iVar9,0,auStack_168,0x40,1); local_544 = (Game *)FUN_00828050(auStack_e8); uStack_14._0_1_ = 0x16; local_540[0] = (Game *)FUN_00828050(&DAT_00b6c57c); uStack_14._0_1_ = 0x17; uVar11 = FUN_00828050(auStack_68); uStack_14._0_1_ = 0x18; uVar16 = FUN_00828050(&DAT_00b6c57c); uStack_14._0_1_ = 0x19; uVar17 = FUN_00828050(auStack_168); uStack_14._0_1_ = 0x1a; FUN_008284d0(local_540[0],uVar17,uVar16); uStack_14._0_1_ = 0x1b; FUN_008284d0(local_540[0],auStack_41c,uVar11); uStack_14._0_1_ = 0x1c; FUN_008284d0(local_540[0],auStack_38c,local_540[0]); uStack_14 = CONCAT31(uStack_14._1_3_,0x1d); FUN_008284d0(local_540[0],auStack_35c,local_544); bVar6 = 0xcb; FUN_00828010(auStack_344); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); } else { player = Game::GetPlayer(g_game,0); playerName = &player->_name; if (0xf < (player->_name)._capacity) { playerName = *(std_string **)playerName->_buf; } if (playerName == (std_string *)0x0) { iVar9 = 0; } else { psVar27 = playerName; do { pcVar20 = psVar27->_buf; psVar27 = (std_string *)(psVar27->_buf + 1); } while (*pcVar20 != '\0'); iVar9 = (int)psVar27 - (int)(playerName->_buf + 1); } text_convert_encoding((byte *)playerName,iVar9,0,auStack_1e8,0x40,1); player = Game::GetPlayer(g_game,0); pbVar33 = (byte *)((int)player->_twinPlayer + 0x13c4); if (0xf < *(uint *)((int)player->_twinPlayer + 0x13d8)) { pbVar33 = *(byte **)pbVar33; } if (pbVar33 == (byte *)0x0) { iVar9 = 0; } else { pbVar28 = pbVar33; do { bVar6 = *pbVar28; pbVar28 = pbVar28 + 1; } while (bVar6 != 0); iVar9 = (int)pbVar28 - (int)(pbVar33 + 1); } text_convert_encoding(pbVar33,iVar9,0,auStack_268,0x40,1); pGStack_54c = (Game *)FUN_00828050(auStack_e8); uStack_14._0_1_ = 10; pGStack_554 = (Game *)FUN_00828050(&DAT_00b6c57c); uStack_14._0_1_ = 0xb; local_544 = (Game *)FUN_00828050(auStack_68); uStack_14._0_1_ = 0xc; local_540[0] = (Game *)FUN_00828050(&DAT_00b6c57c); uStack_14._0_1_ = 0xd; uVar11 = FUN_00828050(auStack_268); uStack_14._0_1_ = 0xe; uVar16 = FUN_00828050(&DAT_00b6c518); uStack_14._0_1_ = 0xf; uVar17 = FUN_00828050(auStack_1e8); uStack_14._0_1_ = 0x10; FUN_008284d0(local_540[0],uVar17,uVar16); uStack_14._0_1_ = 0x11; FUN_008284d0(local_540[0],auStack_3a4,uVar11); uStack_14._0_1_ = 0x12; FUN_008284d0(local_540[0],auStack_374,local_540[0]); uStack_14._0_1_ = 0x13; FUN_008284d0(local_540[0],auStack_3bc,local_544); uStack_14._0_1_ = 0x14; FUN_008284d0(local_540[0],auStack_3d4,pGStack_554); uStack_14 = CONCAT31(uStack_14._1_3_,0x15); FUN_008284d0(local_540[0],auStack_3ec,pGStack_54c); bVar6 = 0xf5; FUN_00828010(auStack_404); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); FUN_00828ab0(); } uStack_14._0_1_ = 9; bVar19 = 0x32; FUN_00828ab0(); title = (wchar_t *******)apppppppwStack_2e4; if (7 < uStack_2d0) { title = apppppppwStack_2e4[0]; } HUD::ShowStackedItemTextCustomUTF16(&g_game->_hud,(wchar_t *)title,L"",bVar6,bVar19); std::string::_Tidy_deallocate((char *)apppppppbStack_30c); uStack_14 = CONCAT31(uStack_14._1_3_,7); if (0xf < uStack_27c) { uVar8 = uStack_27c + 1; pppppppbVar24 = apppppppbStack_290[0]; if (0xfff < uVar8) { pppppppbVar24 = (byte *******)apppppppbStack_290[0][-1]; uVar8 = uStack_27c + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_290[0] + (-4 - (int)pppppppbVar24))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar24,uVar8); } uStack_14 = 0xffffffff; uStack_280 = 0; uStack_27c = 0xf; apppppppbStack_290[0] = (byte *******)((uint)apppppppbStack_290[0] & 0xffffff00); if (7 < uStack_2d0) { FUN_00828a70(apppppppwStack_2e4[0],uStack_2d0 + 1); } pvVar18 = room->_descriptor; currentRoom = room; } if ((*(byte *)((int)pvVar18 + 0x44) & 1) != 0) goto LAB_007f71f4; } else { LAB_007f71f4: currentRoom->field_0x1bbc = 1; } currentRoom->_redHeartDamage = 0; init_rain(currentRoom); pGVar29 = g_game; if (((*(uint *)((int)currentRoom->_descriptor + 0x44) >> 10 & 1) == 0) || (currentRoom->_backdropType == 0x35)) { if (currentRoom->_roomType == 0x1d) { (currentRoom->_floorColor)._colorize[0] = 1.0; (currentRoom->_floorColor)._colorize[1] = 0.7; (currentRoom->_floorColor)._colorize[2] = 0.7; (currentRoom->_floorColor)._colorize[3] = 0.6; (currentRoom->_wallColor)._colorize[0] = 1.0; (currentRoom->_wallColor)._colorize[1] = 0.4; (currentRoom->_wallColor)._colorize[2] = 0.4; (currentRoom->_wallColor)._colorize[3] = 0.6; } else { if (((g_game->_stage < 1) || (6 < g_game->_stage)) || (bVar6 = Game::GetStateFlag(g_game,0x30), bVar6 == 0)) { if ((currentRoom->_backdropType != 6) || (bVar6 = Seeds::HasSeedEffect(&pGVar29->_seedEffects,0x4f), bVar6 == 0)) goto LAB_007f7445; CStack_790._tint[0] = 1.0; CStack_790._tint[1] = 1.0; CStack_790._tint[2] = 1.0; CStack_790._tint[3] = 1.0; CStack_790._offset[0] = 0.0; CStack_790._colorize[0] = 1.0; CStack_790._colorize[1] = 1.0; CStack_790._colorize[2] = 1.0; CStack_790._colorize[3] = (float)&DAT_bf800000; CStack_790._offset[1] = 0.0; CStack_790._offset[2] = 0.0; Color::operator_assign((Color *)¤tRoom->_floorColor,&CStack_790); other = &CStack_7bc; CStack_7bc._tint[0] = 1.0; CStack_7bc._tint[1] = 1.0; CStack_7bc._tint[2] = 1.0; CStack_7bc._tint[3] = 1.0; CStack_7bc._offset[0] = 0.0; CStack_7bc._colorize[0] = 1.0; CStack_7bc._colorize[1] = 1.0; CStack_7bc._colorize[2] = 1.0; CStack_7bc._colorize[3] = (float)&DAT_bf800000; CStack_7bc._offset[1] = 0.0; CStack_7bc._offset[2] = 0.0; } else { CStack_764._tint[0] = 1.0; CStack_764._tint[1] = 1.0; CStack_764._tint[2] = 1.0; CStack_764._tint[3] = 1.0; CStack_764._offset[0] = 0.076400004; CStack_764._colorize[0] = 1.2; CStack_764._colorize[1] = 1.2; CStack_764._colorize[2] = 1.2; CStack_764._colorize[3] = 0.6; CStack_764._offset[1] = -0.0216; CStack_764._offset[2] = -0.0884; Color::operator_assign((Color *)¤tRoom->_floorColor,&CStack_764); other = &CStack_7e8; CStack_7e8._tint[0] = 1.0; CStack_7e8._tint[1] = 1.0; CStack_7e8._tint[2] = 1.0; CStack_7e8._tint[3] = 1.0; CStack_7e8._offset[0] = 0.076400004; CStack_7e8._colorize[0] = 1.2; CStack_7e8._colorize[1] = 1.2; CStack_7e8._colorize[2] = 1.2; CStack_7e8._colorize[3] = 0.6; CStack_7e8._offset[1] = -0.0216; CStack_7e8._offset[2] = -0.0884; } Color::operator_assign((Color *)¤tRoom->_wallColor,other); } } else { (currentRoom->_floorColor)._colorize[0] = 1.0; (currentRoom->_floorColor)._colorize[1] = 0.0; (currentRoom->_floorColor)._colorize[2] = 0.0; (currentRoom->_floorColor)._colorize[3] = 0.3; (currentRoom->_wallColor)._colorize[0] = 1.0; (currentRoom->_wallColor)._colorize[1] = 0.2; (currentRoom->_wallColor)._colorize[2] = 0.2; (currentRoom->_wallColor)._colorize[3] = 0.8; } LAB_007f7445: cVar7 = FUN_008242f0(); if (cVar7 != '\0') { apcStack_674[0] = "gfx/backdrop/fx_ray_3.png"; apcStack_674[1] = "gfx/backdrop/fx_ray_4.png"; if (DAT_00c79834 != (int *)0x0) { KAGE::SmartPointer::reset(extraout_ECX_01); } rayRng._shift1 = 1; rayRng._shift2 = 0x1b; rayRng._seed = *(int *)((int)currentRoom->_descriptor + 0x58); rayRng._shift3 = 0x1b; uVar8 = RNG::RandomInt(&rayRng,2); pvVar18 = Manager::LoadImage(auStack_66c,(byte *)apcStack_674[uVar8]); uStack_14 = 0x1e; FUN_008283d0(pvVar18); uStack_14 = 0x1f; if (((piStack_668 != (int *)0x0) && (cVar7 = (**(code **)(*piStack_668 + 0xc))(), cVar7 != '\0') ) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStack_66c); } piVar23 = DAT_00c79834; uStack_14 = 0xffffffff; if ((DAT_00c79834[0xc] != 1) || (DAT_00c79834[0xd] != 1)) { (**(code **)(*DAT_00c79834 + 0x44))(1,1); piVar23[0xc] = 1; piVar23[0xd] = 1; } } if (((*(uint *)((int)currentRoom->_descriptor + 0x44) & 0x10000) != 0) && (currentRoom->_bossId == 0x57)) { currentRoom->_bossId = 0; } FUN_00823540(); bVar6 = Level::HasAbandonedMineshaft((Level *)g_game); if ((bVar6 == 0) || (g_game->_currentDimensionIdx != 1)) { if (currentRoom->_roomType != 8) goto LAB_007f760e; (currentRoom->_floorColor)._colorize[0] = 1.0; (currentRoom->_floorColor)._colorize[1] = 0.9; (currentRoom->_floorColor)._colorize[2] = 0.8; (currentRoom->_wallColor)._colorize[0] = 1.0; (currentRoom->_wallColor)._colorize[1] = 0.9; (currentRoom->_wallColor)._colorize[2] = 0.8; } else { (currentRoom->_floorColor)._colorize[0] = 0.9; (currentRoom->_floorColor)._colorize[1] = 0.8; (currentRoom->_floorColor)._colorize[2] = 1.0; (currentRoom->_wallColor)._colorize[0] = 0.9; (currentRoom->_wallColor)._colorize[1] = 0.8; (currentRoom->_wallColor)._colorize[2] = 1.0; } (currentRoom->_wallColor)._colorize[3] = 0.5; (currentRoom->_floorColor)._colorize[3] = 0.4; LAB_007f760e: update_bounds(currentRoom,0); if (currentRoom->_Camera != (void *)0x0) { FUN_007ea0c0(currentRoom->_Camera); } local_540[0] = operator_new(0x94); uStack_14 = 0x20; if (local_540[0] == (Game *)0x0) { pvVar18 = (void *)0x0; } else { Camera::constructor((Camera *)local_540[0],currentRoom); pvVar18 = extraout_EAX_00; } uStack_14 = 0xffffffff; currentRoom->_Camera = pvVar18; *(undefined4 *)¤tRoom->field_0x70d8 = *(undefined4 *)¤tRoom->field_0x70dc; *(undefined4 *)¤tRoom->field_0x70f4 = *(undefined4 *)¤tRoom->field_0x70f8; Backdrop::load_details(¤tRoom->_backdrop); TextureCache::Purge(); pvVar18 = g_luaEngine; local_540[0] = g_luaEngine; lua_gc(*(undefined4 *)((int)g_luaEngine + 0x18),2,0); lua_gc(*(undefined4 *)((int)pvVar18 + 0x18),4,0); lua_gc((int)*(qword *)((int)local_540[0] + 0x18),3,0); KAGE_LogMessage(1,(byte *)"Lua mem usage: %d KB and %d bytes\n"); if (((room->_bossId == 0x3e) && (g_game->_difficulty == 3)) && ((*(byte *)((int)room->_descriptor + 0x44) & 1) != 0)) { TurnGold(); } manager = g_manager; pGVar29 = g_game; if ((g_game->_levelStateFlags & 0x1000000U) != 0) { currentRoom = g_game->_room; currentRoom->_brokenWatchState = 1; fVar35 = time_scale_update(currentRoom); pGVar29 = g_game; (manager->_musicManager)._targetPitch = fVar35; iVar9 = *(int *)((int)pGVar29->_room + 0x722c); if (iVar9 < 0x7fffffff) { iVar9 = 0x7fffffff; } *(int *)((int)pGVar29->_room + 0x722c) = iVar9; } manager = g_manager; if ((pGVar29->_levelStateFlags & 0x2000000U) != 0) { currentRoom = pGVar29->_room; currentRoom->_brokenWatchState = 2; fVar35 = time_scale_update(currentRoom); pGVar29 = g_game; this_02 = &g_game->_playerManager; (manager->_musicManager)._targetPitch = fVar35; uVar8 = 0; if ((int)(pGVar29->_playerManager)._playerList._end - (int)(this_02->_playerList)._begin >> 2 != 0) { do { player = PlayerManager::GetPlayer(this_02,uVar8); if (player->_variant == 0) { local_540[0] = (Game *)PlayerManager::GetPlayer(&g_game->_playerManager,uVar8); player = PlayerManager::GetPlayer(&g_game->_playerManager,uVar8); pvVar18 = (player->_pillRNGs)._end; if ((int)((int)pvVar18 - (int)(player->_pillRNGs)._begin & 0xfffffff0U) < 0x2a1) { KAGE_LogMessage(0x10,(byte *)"Pill ID out of bounds!\n"); pvVar18 = (player->_pillRNGs)._end; } pvVar2 = (player->_pillRNGs)._begin; uVar25 = ((int)pvVar18 - (int)pvVar2 >> 4) - 1; if (0x2a < uVar25) { uVar25 = 0x2a; } uVar25 = RNG::RandomInt((RNG *)((int)pvVar2 + uVar25 * 0x10),2); *(uint *)((int)local_540[0] + 0x18e8) = (uVar25 + 2) * 900; player = PlayerManager::GetPlayer(&g_game->_playerManager,uVar8); TemporaryEffects::AddCollectibleEffect(&player->_temporaryeffects,0x1c,0,1); } uVar8 = uVar8 + 1; this_02 = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(this_02->_playerList)._begin >> 2)); } } ExceptionList = local_1c; return 1; } //@@ 007f79d0 Room::GetDoorSlotPosition /* ZHL [lua] Lua binding Room:GetDoorSlotPosition */ void __thiscall Room::GetDoorSlotPosition(Room *this,float *param_2,uint param_3) { int iVar1; int iVar2; float fVar3; fVar3 = g_vectorZero.y; if (param_3 < 8) { iVar1 = this->_doorGridPositions[param_3]; iVar2 = this->_gridWidth; *param_2 = (float)(iVar1 % iVar2) * 40.0 + 40.0; param_2[1] = (float)(iVar1 / iVar2) * 40.0 + 120.0; return; } *param_2 = g_vectorZero.x; param_2[1] = fVar3; return; } //@@ 007f7a40 Room::TrySpawnSecretExit /* ZHL [lua] Lua binding Room:TrySpawnSecretExit prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::TrySpawnSecretExit(Room *door,byte isAnimate,byte isForce) { int iVar1; code *pcVar2; bool bVar3; Room *pRVar4; byte bVar5; ChallengeParam *challengeParams; uint forcedCurses; uint preventedCurses; int iVar6; RoomDescriptor *currentRoomDesc; float fVar7; Entity_Player *player; Vector *doorDir; Entity *particle; void *doorEntity; uint preventedCurses; uint uVar9; int particleTimeout; Game *game; float rotationSign; undefined1 local_4c [8]; float local_44; Vector particleVelocity; float perpDirY; ChallengeParam *local_34; float local_30; float local_2c; float local_28; float local_24; void *local_20; float local_1c; Room *local_18; char isAltPathUnlocked; GridEntity_Door *door; local_24 = 0.0; local_18 = door; if (isForce == 0) { if (g_game->_challenge == 0x2c) { return 0; } if (((door->_roomType == 5) && (*(int *)(*(int *)((int)door->_descriptor + 0x10) + 0x10) == 0x59)) && (bVar5 = Level::IsPreAscent((Level *)g_game), bVar5 != 0)) { return 0; } if (((0 < g_game->_stage) && (g_game->_stage < 7)) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { return 0; } } game = g_game; challengeParams = Game::GetChallengeParams(g_game); if ((challengeParams->_pathType == 3) || ((((g_manager->_persistentGameData)._achievements[0x27b] != 0 || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) && ((game->_challenge == 0 && ((game->_dailyChallenge)._id == 0)))))) { isAltPathUnlocked = '\x01'; } else { isAltPathUnlocked = '\0'; } if (game->_stage == 6) { LAB_007f7b57: bVar3 = true; } else { if (game->_stage == 5) { preventedCurses = game->_debugCurses; uVar9 = game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); door = local_18; game = g_game; if ((~preventedCurses & (forcedCurses | preventedCurses | uVar9) & 2) != 0) goto LAB_007f7b57; } bVar3 = false; } if ((((isAltPathUnlocked == '\0') || (!bVar3)) || (game->_currentRoomIdx != game->_startingRoomIdx)) || ((game->_stageType == 4 || (game->_stageType == 5)))) { if (isForce == 0) { currentRoomDesc = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx,-1); game = g_game; if (currentRoomDesc->ListIndex != g_game->_lastBossRoomListIdx) goto LAB_007f817f; } local_34 = Game::GetChallengeParams(game); if (((isForce != 0) || ((((game->_challenge == 0 && ((game->_dailyChallenge)._id == 0)) || (local_34->_pathType == 2)) && (((g_manager->_persistentGameData)._achievements[0x197] != 0 || ((g_manager->_state == 2 && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))) )))))) && ((local_30 = (float)Level::get_secret_exit_kind((Level *)game), local_30 != 0.0 && (((isForce != 0 || (local_30 != 5.60519e-45)) || (bVar5 = Level::IsMausoleumHeartStage((Level *)game), bVar5 == 0)))))) { pRVar4 = local_18; local_20 = door->_descriptor; local_2c = *(float *)((int)local_20 + 0x5c); local_4c = (undefined1 [8])0x900000002; local_28 = 2.10195e-44; if (local_2c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar5 = (*pcVar2)(); return bVar5; } preventedCurses = (uint)local_2c >> 2 ^ (uint)local_2c; local_1c = 0.0; preventedCurses = preventedCurses << 9 ^ preventedCurses; local_2c = *(float *)((int)local_20 + 0x10); preventedCurses = (preventedCurses >> 0xf ^ preventedCurses) & 7; fVar7 = local_24; do { uVar9 = 1 << ((byte)preventedCurses & 0x1f); if ((((*(uint *)((int)local_2c + 0x38 + (preventedCurses >> 5) * 4) & uVar9) == 0) || (local_18->_doors[preventedCurses] != (void *)0x0)) || (fVar7 = (float)((uint)fVar7 | 1), (*(uint *)((int)local_20 + (preventedCurses >> 5) * 4 + 0x18) & uVar9) != 0)) { bVar3 = false; } else { bVar3 = true; } if (((uint)fVar7 & 1) != 0) { fVar7 = 0.0; } if (bVar3) break; preventedCurses = preventedCurses + 1 & 0x80000007; if ((int)preventedCurses < 0) { preventedCurses = (preventedCurses - 1 | 0xfffffff8) + 1; } local_1c = (float)((int)local_1c + 1); } while ((int)local_1c < 8); if (-1 < (int)preventedCurses) { local_30 = (float)Level::get_secret_exit_room((Level *)g_game,local_30); doorEntity = pRVar4->_doors[preventedCurses]; local_18 = (Room *)(pRVar4->_doors + preventedCurses); if (doorEntity == (void *)0x0) { MakeDoor(pRVar4,preventedCurses); doorEntity = *(void **)local_18; } pRVar4 = local_18; *(undefined4 *)((int)doorEntity + 0x394) = 0xfffffff6; GridEntity_Door::SetRoomTypes (*(GridEntity_Door **)local_18,1,*(int *)(*(int *)((int)local_30 + 0x10) + 8)); if (local_34->_pathType == 2) { door = *(GridEntity_Door **)pRVar4; local_34 = (ChallengeParam *)(door->_desc)._variant; if ((local_34 != (ChallengeParam *)&DAT_00000008) && (iVar6 = GridEntity_Door::get_secret_exit_kind(door), iVar6 != 4)) { if ((local_34 == (ChallengeParam *)0x1) || ((local_34 == (ChallengeParam *)&DAT_00000004 || (local_34 == (ChallengeParam *)0x2)) )) { bVar5 = 1; player = Game::GetPlayer(g_game,0); GridEntity_Door::TryUnlock(door,player,bVar5); } else { bVar5 = 1; player = Game::GetPlayer(g_game,0); GridEntity_Door::TryUnlock(door,player,bVar5); GridEntity_Door::Open(door); GridEntity_Door::TryBlowOpen(door,0,(Entity *)0x0); } } } if (isAnimate != 0) { preventedCurses = preventedCurses & 0x80000003; if ((int)preventedCurses < 0) { preventedCurses = (preventedCurses - 1 | 0xfffffffc) + 1; } doorDir = Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)(local_4c + 4),preventedCurses); local_1c = -doorDir->x; local_20 = (void *)-doorDir->y; local_34 = (ChallengeParam *)cos(1.5707964); fVar7 = sin(1.5707964); local_30 = local_1c * (float)local_34 - (float)local_20 * fVar7; perpDirY = local_1c * fVar7 + (float)local_20 * (float)local_34; preventedCurses = Random(); iVar6 = *(int *)((int)g_game->_room + 0xc); local_28 = (float)(*(int *)((int)*(void **)local_18 + 0x24) % iVar6) * 40.0 + 40.0; local_2c = (float)(*(int *)((int)*(void **)local_18 + 0x24) / iVar6) * 40.0 + 120.0; for (iVar6 = (preventedCurses & 3) + 5; iVar6 != 0; iVar6 = iVar6 + -1) { preventedCurses = Random(); uVar9 = Random(); local_34 = (ChallengeParam *) ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10); uVar9 = Random(); fVar7 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; fVar7 = (fVar7 + fVar7) - 1.0; particleVelocity.x = (float)local_34 * local_1c * 5.0 + local_30 * fVar7; particleVelocity.y = (float)local_34 * (float)local_20 * 5.0 + perpDirY * fVar7; uVar9 = Random(); fVar7 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_18 = (Room *)(fVar7 + fVar7); uVar9 = Random(); local_24 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; fVar7 = cos((float)local_18); local_4c._4_4_ = fVar7 * local_24 * 20.0 + local_28; fVar7 = sin((float)local_18); local_44 = fVar7 * local_24 * 20.0 + local_2c; particle = Game::Spawn(g_game,1000,0x3b,(Vector *)(local_4c + 4),&particleVelocity, (Entity *)0x0,0,preventedCurses); local_34 = (ChallengeParam *)(particle->_pos).x; local_24 = (particle->_pos).y; preventedCurses = Random(); if (((float)((double)(int)preventedCurses + __uint_to_double_fixup[-((int)preventedCurses >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)(((float)local_34 - local_28) * local_1c + (local_24 - local_2c) * (float)local_20 < 0.0) == 0.0) { rotationSign = 1.0; } else { rotationSign = (float)&DAT_bf800000; } *(float *)(particle[1]._sprite._animDefaultName._buf + 8) = rotationSign; preventedCurses = Random(); iVar1 = *(int *)particle; particleTimeout = preventedCurses % 10 + 0x1e; *(int *)(particle[1]._sprite._filename._buf + 8) = particleTimeout; *(int *)(particle[1]._sprite._filename._buf + 0xc) = particleTimeout; (**(code **)(iVar1 + 0xc))(); } } return 1; } } } else if (door->_doors[1] == (void *)0x0) { MakeDoor(door,1); iVar6 = Level::get_secret_exit_room((Level *)g_game,3); *(undefined4 *)((int)door->_doors[1] + 0x394) = 0xfffffff6; GridEntity_Door::SetRoomTypes (door->_doors[1],*(int *)(*(int *)((int)door->_descriptor + 0x10) + 8), *(int *)(*(int *)(iVar6 + 0x10) + 8)); return 1; } LAB_007f817f: return 0; } //@@ 007f8190 Room::TrySpawnSecretShop /* ZHL [lua] Lua binding Room:TrySpawnSecretShop */ undefined4 Room::TrySpawnSecretShop(uint param_1) { int iVar1; Manager *pMVar2; Entity_Player *pEVar3; uint uVar4; GridEntity *pGVar5; Room *in_ECX; uint index; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b012c7; local_10 = ExceptionList; ExceptionList = &local_10; if ((char)param_1 == '\0') { if (in_ECX->_roomType == 2) { pEVar3 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x25a,(RNG **)&g_game->_playerManager,1); if ((pEVar3 != (Entity_Player *)0x0) || (*(int *)in_ECX->_descriptor < 0)) goto LAB_007f8201; } ExceptionList = local_10; return 0; } LAB_007f8201: pMVar2 = g_manager; iVar1 = in_ECX->_gridWidth; if ((iVar1 < 0xb) || (in_ECX->_gridHeight < 2)) { index = 0xffffffff; } else { index = iVar1 + 10; } if (*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 0x48) == 6) { if ((iVar1 < 0x15) || (in_ECX->_gridHeight < 3)) { index = 0xffffffff; } else { index = (iVar1 + 10) * 2; } } if (*(int *)in_ECX->_descriptor < 0) { uVar4 = Random(); local_18.x = (float)((int)index % in_ECX->_gridWidth) * 40.0 + 40.0; local_18.y = (float)((int)index / in_ECX->_gridWidth) * 40.0 + 120.0; Game::SpawnEx(g_game,1000,0x9c,&local_18,&g_vectorZero,(Entity *)0x0,0,uVar4,0); } else { param_1 = 0x394; seed_fart_sound_override((int *)¶m_1); SoundEffects::Play(&pMVar2->_sfxManager,param_1,1.0,2,0,1.0,0.0); param_1 = Random(); if (((int)index < 0) || (0x1bf < (int)index)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (index < 0x1c0) { uVar4 = GetGridCollision(in_ECX,index); if ((int)uVar4 < 1) { pGVar5 = operator_new(0x154); local_8 = 0x11; local_18.y = (float)pGVar5; if (pGVar5 == (GridEntity *)0x0) { pGVar5 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar5); *(undefined ***)pGVar5 = IsaacRepentancePlus::GridEntity_Stairs::vftable; } local_8 = 0xffffffff; if (pGVar5 != (GridEntity *)0x0) { (pGVar5->_desc)._type = 0x12; pGVar5->_gridIndex = index; if (in_ECX->_gridEntities[index] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_gridEntities[index])(1); } in_ECX->_gridEntities[index] = pGVar5; (pGVar5->_desc)._variant = 2; (pGVar5->_desc)._varData = 0; GridEntity::Init(pGVar5,param_1); } } } } ExceptionList = local_10; return 1; } //@@ 007f83b0 Room::TrySpawnDevilRoomDoor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Room:TrySpawnDevilRoomDoor prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::TrySpawnDevilRoomDoor(Room *this,byte isAnimate,byte isForce) { code *pcVar1; undefined1 *puVar2; byte bVar3; uint uVar4; RoomDescriptor *roomDesc; Entity_Player *dualityOwner; void **TargetRoomType; Vector *doorDir; Entity *dustEffect; int *piVar5; int iVar6; GridEntity_Door *this_00; uint uVar7; int iVar8; void *ptr; Room *this_01; Game *game; float fVar9; float fVar10; undefined4 uVar11; TypeDescriptor *pTVar12; TypeDescriptor *pTVar13; undefined4 uVar14; undefined1 local_84 [12]; int local_78; Vector local_74; Vector local_6c; uint local_64; float local_60; undefined8 local_58; int *freeSlotsCapacity; float local_4c; undefined1 *local_48; undefined1 *local_44; uint local_40; undefined1 *local_3c; void **local_38; Room *savedRoom; char isAngelDoorPlaced; void **local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *flagsGame; Manager *manager; puStack_20 = local_84 + 0x80; local_14 = 0xffffffff; puStack_18 = &LAB_00b01315; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_84 + 0x74); ExceptionList = &local_1c; savedRoom = this; local_24 = uVar4; puVar2 = local_84 + 0x80; if (isForce == 0) { bVar3 = Level::CanSpawnDevilRoom((Level *)g_game); if (bVar3 == 0) { ExceptionList = local_1c; return 0; } puVar2 = puStack_20; } puStack_20 = puVar2; isAngelDoorPlaced = '\0'; if ((isForce == 0) && (roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1), roomDesc->ListIndex != g_game->_lastBossRoomListIdx)) { ExceptionList = local_1c; return 0; } local_48 = (undefined1 *)GetDevilRoomChance(this); if (isForce == 0) { local_28 = (float)(g_game->_devilAngelRoomRNG)._seed; local_58 = 0x1500000002; local_3c = (undefined1 *)0x9; if (local_28 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); bVar3 = (*pcVar1)(); return bVar3; } uVar7 = (uint)local_28 >> 2 ^ (uint)local_28; uVar7 = uVar7 << 0x15 ^ uVar7; uVar7 = uVar7 >> 9 ^ uVar7; if (((float)local_48 <= (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10 ) && ((float)local_48 < 1.0)) { g_game->_devilRoomDisabled = 1; ExceptionList = local_1c; return 0; } } dualityOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1f2,(RNG **)&g_game->_playerManager,1); game = g_game; if (dualityOwner != (Entity_Player *)0x0) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard,uVar4), g_invalidRoomDescriptorGuard == -1 )) { local_14 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_14 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } roomDesc = &g_roomDescriptorDummy; if ((uint)game->_currentDimensionIdx < 3) { roomDesc = game->_roomList + 0x1fb; } if (roomDesc->Data == (void *)0x0) { local_84._4_4_ = 2; local_84._8_4_ = 5; local_84._0_4_ = *(int *)((int)this->_descriptor + 0x58); local_78 = 0x15; local_28 = (float)RNG::RandomInt((RNG *)local_84,8); local_58 = 0; freeSlotsCapacity = (int *)0x0; local_14 = 1; std::vector::_Reallocate(4); local_2c = (void **)0x0; piVar5 = local_58._4_4_; do { this_01 = savedRoom; local_48 = (undefined1 *)((int)local_28 + (int)local_2c & 0x80000007); if ((int)local_48 < 0) { local_48 = (undefined1 *)(((uint)(local_48 + -1) | 0xfffffff8) + 1); } local_3c = local_48; if (((*(uint *)(*(int *)((int)savedRoom->_descriptor + 0x10) + 0x38 + ((uint)local_48 >> 5) * 4) & 1 << ((byte)local_48 & 0x1f)) != 0) && (savedRoom->_doors[(int)local_48] == (void *)0x0)) { if (piVar5 == freeSlotsCapacity) { std::vector::_Emplace_reallocate(piVar5,&local_48); piVar5 = local_58._4_4_; } else { *piVar5 = (int)local_48; local_58 = CONCAT44(piVar5 + 1,(int *)local_58); piVar5 = piVar5 + 1; } } local_2c = (void **)((int)local_2c + 1); } while ((int)local_2c < 8); if (1 < (uint)((int)piVar5 - (int)(int *)local_58 >> 2)) { RNG::Shuffle((RNG *)local_84,(int *)local_58,piVar5); local_40 = 0; do { uVar4 = *(uint *)((int)(int *)local_58 + local_40 * 4); local_38 = this_01->_doors + uVar4; if (this_01->_doors[uVar4] == (void *)0x0) { MakeDoor(this_01,uVar4); } if ((local_40 == 0) || (isAngelDoorPlaced != '\0')) { TargetRoomType = (void **)0xe; local_2c = (void **)0xe; if (isAngelDoorPlaced == '\0') goto LAB_007f86a4; } else { local_2c = (void **)0xf; LAB_007f86a4: bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,7); if (bVar3 == 0) { TargetRoomType = local_2c; if (local_2c != (void **)0xf) goto LAB_007f86ce; } else { TargetRoomType = (void **)2.10195e-44; } isAngelDoorPlaced = '\x01'; } LAB_007f86ce: GridEntity_Door::SetRoomTypes(*local_38,1,(int)TargetRoomType); *(undefined4 *)((int)*local_38 + 0x394) = 0xffffffff; GridEntity_Door::Open(*local_38); if (isAnimate != 0) { uVar4 = uVar4 & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } doorDir = Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)(local_84 + 8),uVar4); local_2c = (void **)-doorDir->x; local_3c = (undefined1 *)((uint)doorDir->y ^ 0x80000000); uVar4 = Random(); local_28 = 0.0; local_4c = (float)((uVar4 & 3) + 5); if (local_4c != 0.0) { local_48 = (undefined1 *)((uint)local_2c ^ 0x80000000); do { local_64 = Random(); uVar4 = Random(); local_44 = (undefined1 *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 5.0); uVar4 = Random(); fVar10 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar10 = (fVar10 + fVar10) - 1.0; local_6c.x = fVar10 * (float)local_3c + (float)local_2c * (float)local_44; local_6c.y = fVar10 * (float)local_48 + (float)local_3c * (float)local_44; iVar8 = *(int *)((int)*local_38 + 0x24); iVar6 = *(int *)((int)g_game->_room + 0xc); uVar4 = Random(); local_60 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_60 = local_60 + local_60; uVar4 = Random(); local_44 = (undefined1 *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar10 = cos(local_60); local_74.x = fVar10 * (float)local_44 + (float)(iVar8 % iVar6) * 40.0 + 40.0; fVar9 = sin(local_60); fVar10 = local_28; uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; local_74.y = fVar9 * (float)local_44 + (float)(iVar8 / iVar6) * 40.0 + 120.0; uVar11 = 0; dustEffect = Game::Spawn(g_game,1000,0x3b,&local_74,&local_6c,(Entity *)0x0, (uint)(local_28 == 0.0),local_64); piVar5 = (int *)__RTDynamicCast(dustEffect,uVar11,pTVar12,pTVar13,uVar14); local_44 = (undefined1 *)0x3f800000; iVar8 = *(int *)((int)g_game->_room + 0xc); if (((float)piVar5[0xd0] - ((float)(*(int *)((int)*local_38 + 0x24) / iVar8) * 40.0 + 120.0)) * (float)local_48 + ((float)piVar5[0xcf] - ((float)(*(int *)((int)*local_38 + 0x24) % iVar8) * 40.0 + 40.0)) * (float)local_3c < 0.0) { local_44 = &DAT_bf800000; } uVar4 = Random(); piVar5[0x11d] = (int)(((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_44); uVar4 = Random(); iVar8 = uVar4 % 10 + 0x1e; piVar5[0x117] = iVar8; piVar5[0x118] = iVar8; (**(code **)(*piVar5 + 0xc))(); local_28 = (float)((int)fVar10 + 1); this_01 = savedRoom; } while ((int)local_28 < (int)local_4c); } } manager = g_manager; local_40 = local_40 + 1; } while (local_40 < 2); if (isAnimate != 0) { local_28 = 4.48416e-43; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); manager = g_manager; local_28 = 3.22299e-44; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); } if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar8 = g_game->_stage + 1; } else { iVar8 = g_game->_stage; } if (iVar8 < 1) { iVar8 = 0; } iVar6 = 0xd; if (iVar8 < 0xd) { iVar6 = iVar8; } g_game->_lastDevilRoomStage = iVar6; if ((int *)local_58 != (void *)0x0) { uVar4 = (int)freeSlotsCapacity - (int)(int *)local_58 & 0xfffffffc; ptr = (int *)local_58; if (0xfff < uVar4) { ptr = *(void **)((int)(int *)local_58 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)(int *)local_58 + (-4 - (int)ptr))) goto LAB_007f8b59; } operator_delete(ptr,uVar4); } ExceptionList = local_1c; return 1; } local_14 = 0xffffffff; if ((int *)local_58 != (int *)0x0) { uVar4 = (int)freeSlotsCapacity - (int)(int *)local_58 & 0xfffffffc; piVar5 = (int *)local_58; if (0xfff < uVar4) { piVar5 = (int *)((int *)local_58)[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)(int *)local_58 + (-4 - (int)piVar5))) { LAB_007f8b59: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar5,uVar4); local_58 = 0; freeSlotsCapacity = (int *)0x0; } } } game = g_game; bVar3 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,7); Level::InitializeDevilAngelRoom((Level *)game,bVar3 != 0,0); game = g_game; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { local_14 = 2; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_14 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } flagsGame = g_game; if ((uint)game->_currentDimensionIdx < 3) { roomDesc = game->_roomList + 0x1fb; } else { roomDesc = &g_roomDescriptorDummy; } local_2c = &roomDesc->Data; fVar10 = (float)g_game->_enterDoor; if ((((g_game->_lastRoomIdx != -1) || ((int)fVar10 < 0)) || ((*(uint *)(*(int *)((int)savedRoom->_descriptor + 0x10) + 0x38 + ((uint)fVar10 >> 5) * 4) & 1 << (SUB41(fVar10,0) & 0x1f)) == 0)) || (savedRoom->_doors[(int)fVar10] != (void *)0x0)) { local_38 = savedRoom->_descriptor; local_4c = *(float *)((int)local_38 + 0x58); local_58 = 0x500000002; local_64 = 0x15; if (local_4c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); bVar3 = (*pcVar1)(); return bVar3; } uVar4 = (uint)local_4c >> 2 ^ (uint)local_4c; uVar4 = uVar4 << 5 ^ uVar4; local_40 = (uVar4 >> 0x15 ^ uVar4) & 7; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { local_40 = 4; } local_28 = 0.0; do { local_4c = (float)((int)local_28 + local_40 & 0x80000007); if ((int)local_4c < 0) { local_4c = (float)(((int)local_4c - 1U | 0xfffffff8) + 1); } uVar4 = (int)local_4c + 2U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } if ((((*(uint *)(*(int *)((int)local_38 + 0x10) + 0x38 + ((uint)local_4c >> 5) * 4) & 1 << (SUB41(local_4c,0) & 0x1f)) != 0) && ((*(uint *)((int)*local_2c + (uVar4 >> 5) * 4 + 0x38) & 1 << ((byte)uVar4 & 0x1f)) != 0)) && (savedRoom->_doors[(int)local_4c] == (void *)0x0)) { fVar10 = local_4c; if (-1 < (int)local_4c) goto LAB_007f8d89; break; } local_28 = (float)((int)local_28 + 1); } while ((int)local_28 < 8); local_28 = 0.0; while( true ) { fVar10 = (float)(local_40 + (int)local_28 & 0x80000007); if ((int)fVar10 < 0) { fVar10 = (float)(((int)fVar10 - 1U | 0xfffffff8) + 1); } if (((*(uint *)(*(int *)((int)local_38 + 0x10) + 0x38 + ((uint)fVar10 >> 5) * 4) & 1 << (SUB41(fVar10,0) & 0x1f)) != 0) && (savedRoom->_doors[(int)fVar10] == (void *)0x0)) break; local_28 = (float)((int)local_28 + 1); if (7 < (int)local_28) { ExceptionList = local_1c; return 0; } } if ((int)fVar10 < 0) { ExceptionList = local_1c; return 0; } } LAB_007f8d89: local_2c = *(void ***)((int)*local_2c + 8); if (local_2c == (void **)0xe) { *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x20; } else { if (local_2c != (void **)0xf) goto LAB_007f8dc6; *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 1; } *(undefined4 *)((int)&flagsGame->_gameStateFlags + 4) = *(undefined4 *)((int)&flagsGame->_gameStateFlags + 4); LAB_007f8dc6: this_00 = savedRoom->_doors[(int)fVar10]; local_38 = savedRoom->_doors + (int)fVar10; if (this_00 == (GridEntity_Door *)0x0) { MakeDoor(savedRoom,(int)fVar10); this_00 = *local_38; } GridEntity_Door::SetRoomTypes(this_00,1,(int)local_2c); *(undefined4 *)((int)*local_38 + 0x394) = 0xffffffff; GridEntity_Door::Open(*local_38); game = g_game; if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar8 = g_game->_stage + 1; } else { iVar8 = g_game->_stage; } if (iVar8 < 1) { iVar8 = 0; } iVar6 = 0xd; if (iVar8 < 0xd) { iVar6 = iVar8; } g_game->_lastDevilRoomStage = iVar6; manager = g_manager; if (isAnimate != 0) { local_28 = 4.48416e-43; if (local_2c != (void **)0xe) { local_28 = 3.22299e-44; } seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); uVar4 = (uint)fVar10 & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } doorDir = Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)(local_84 + 8),uVar4); local_28 = -doorDir->x; local_44 = (undefined1 *)((uint)doorDir->y ^ 0x80000000); uVar4 = Random(); local_40 = (uVar4 & 3) + 5; if (local_40 != 0) { local_60 = -local_28; local_2c = (void **)(uint)(local_2c == (void **)0xe); do { local_64 = Random(); uVar4 = Random(); local_4c = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 5.0; uVar4 = Random(); fVar10 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10; fVar10 = (fVar10 + fVar10) - 1.0; local_74.x = local_4c * local_28 + fVar10 * (float)local_44; local_74.y = local_60 * fVar10 + local_4c * (float)local_44; iVar8 = *(int *)((int)*local_38 + 0x24); iVar6 = *(int *)((int)g_game->_room + 0xc); uVar4 = Random(); fVar10 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_3c = (undefined1 *)(fVar10 + fVar10); uVar4 = Random(); local_48 = (undefined1 *) ((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 20.0); fVar10 = cos((float)local_3c); local_6c.x = fVar10 * (float)local_48 + (float)(iVar8 % iVar6) * 40.0 + 40.0; fVar10 = sin((float)local_3c); uVar14 = 0; pTVar13 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; local_6c.y = fVar10 * (float)local_48 + (float)(iVar8 / iVar6) * 40.0 + 120.0; pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar11 = 0; dustEffect = Game::Spawn(g_game,1000,0x3b,&local_6c,&local_74,(Entity *)0x0,(uint)local_2c, local_64); piVar5 = (int *)__RTDynamicCast(dustEffect,uVar11,pTVar12,pTVar13,uVar14); local_3c = (undefined1 *)0x3f800000; iVar8 = *(int *)((int)g_game->_room + 0xc); if (((float)piVar5[0xcf] - ((float)(*(int *)((int)*local_38 + 0x24) % iVar8) * 40.0 + 40.0)) * (float)local_44 + ((float)piVar5[0xd0] - ((float)(*(int *)((int)*local_38 + 0x24) / iVar8) * 40.0 + 120.0) ) * local_60 < 0.0) { local_3c = &DAT_bf800000; } uVar4 = Random(); piVar5[0x11d] = (int)(((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_3c); uVar4 = Random(); iVar8 = uVar4 % 10 + 0x1e; piVar5[0x117] = iVar8; piVar5[0x118] = iVar8; (**(code **)(*piVar5 + 0xc))(); local_40 = local_40 - 1; } while (local_40 != 0); } game = g_game; } uVar4 = (game->_devilAngelRoomRNG)._seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = (game->_devilAngelRoomRNG)._seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); bVar3 = (*pcVar1)(); return bVar3; } } uVar4 = uVar4 >> ((byte)(game->_devilAngelRoomRNG)._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)(game->_devilAngelRoomRNG)._shift2 & 0x1f) ^ uVar4; (game->_devilAngelRoomRNG)._seed = uVar4 >> ((byte)(game->_devilAngelRoomRNG)._shift3 & 0x1f) ^ uVar4; ExceptionList = local_1c; return 1; } //@@ 007f92b0 Room::GetDevilRoomChance /* ZHL [lua] Lua binding Room:GetDevilRoomChance prototype: REPENTOGON, confirmed by RET 0 */ float __thiscall Room::GetDevilRoomChance(Room *this) { byte isHasEffect; Entity_Player *owner; int iVar1; RoomDescriptor *currentRoom; int iVar2; float chance; Game *game; chance = 0.01; owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x33,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = 0.11; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x104,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = chance + 0.15; } iVar1 = PlayerManager::GetNumCollectibles(&g_game->_playerManager,0x33); if (1 < iVar1) { chance = chance + 0.05; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x22,(RNG **)&g_game->_playerManager,1); if ((owner != (Entity_Player *)0x0) || (owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x3b,(RNG **)&g_game->_playerManager,1), owner != (Entity_Player *)0x0)) { chance = chance + 0.125; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x4e,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = chance + 0.175; } if ((g_game->_levelStateFlags & 1) != 0) { chance = chance + 0.35; } currentRoom = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); if ((g_game->_lastBossRoomListIdx == currentRoom->ListIndex) && (*(char *)((int)g_game->_room + 0x120c) != '\0')) { owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x259,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = chance + 0.15; } } else { chance = chance + 0.35; } if ((g_game->_levelStateFlags & 4) == 0) { chance = chance + 0.99; } else { owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x259,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = chance + 0.4; } } if ((g_game->_levelStateFlags & 0x40) != 0) { chance = chance + 0.1; } owner = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xae); if (owner != (Entity_Player *)0x0) { iVar1 = Entity_Player::GetTrinketMultiplier(owner,0xae); if (iVar1 == 1) { chance = chance + 0.1; } else if (iVar1 == 2) { chance = chance + 0.15; } else if (iVar1 == 3) { chance = chance + 0.2; } } owner = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,7); if (owner != (Entity_Player *)0x0) { iVar1 = Entity_Player::GetTrinketMultiplier(owner,7); if (iVar1 == 2) { chance = chance + 0.05; } else if (iVar1 == 3) { chance = chance + 0.1; } } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x29d,(RNG **)&g_game->_playerManager,1); game = g_game; if (owner != (Entity_Player *)0x0) { chance = chance + 0.069; } iVar2 = FUN_0041b770(0x124); iVar1 = game->_lastDevilRoomStage; chance = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 0.1 + chance; if (iVar1 != 0) { if ((game->_stageType == 4) || (game->_stageType == 5)) { iVar2 = game->_stage + 1; } else { iVar2 = game->_stage; } if ((iVar2 == iVar1) || (iVar2 - iVar1 == 1)) { chance = chance * 0.25; } else if (iVar2 - iVar1 == 2) { chance = chance * 0.5; } } if (game->_devilRoomDisabled != 0) { chance = 0.0; } owner = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0xd7,(RNG **)&game->_playerManager,1); if ((owner != (Entity_Player *)0x0) || (isHasEffect = TemporaryEffects::HasCollectibleEffect(&this->_temporaryEffects,0xd7), isHasEffect != 0)) { chance = 66.6; } if (((g_game->_dailyChallenge)._specialDailyId == 0x11) && ((g_game->_gameStateFlags & 0x20000000) == 0)) { chance = 1.0; } owner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,499,(RNG **)&g_game->_playerManager,1); if (owner != (Entity_Player *)0x0) { chance = 1.0; } iVar1 = g_game->_difficulty; if (((iVar1 == 2) || (iVar1 == 3)) && (chance = 1.0, (uint)g_game->_greedModeWave < (iVar1 == 3) + 0xb)) { chance = 0.0; } return chance; } //@@ 007f96f0 get_angel_room_chance /* DB: ? FirstCollectibleOwner of 238/239 Key Pieces, 584 Book of Virtues, 601, 499 Eucharist and game flag 0x20 -> angel room chance; callers Level::InitializeDevilAngelRoom, StatHUD::RecomputeStats (Found HUD chance), 0084cc40 prototype: db/protos.zhl */ float __cdecl get_angel_room_chance(void) { uint uVar1; Entity_Player *pEVar2; float local_8; local_8 = 0.5; if (((g_game->_gameStateFlags & 0x40) == 0) && ((g_game->_gameStateFlags & 0x41) == 0)) { local_8 = 1.0; } pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xee,(RNG **)&g_game->_playerManager,1); if (pEVar2 != (Entity_Player *)0x0) { local_8 = local_8 + (1.0 - local_8) * 0.25; } pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xef,(RNG **)&g_game->_playerManager,1); if (pEVar2 != (Entity_Player *)0x0) { local_8 = (1.0 - local_8) * 0.25 + local_8; } pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x248,(RNG **)&g_game->_playerManager,1); if (pEVar2 != (Entity_Player *)0x0) { local_8 = local_8 + (1.0 - local_8) * 0.25; } if (9 < g_game->_donationModAngel) { local_8 = local_8 + (1.0 - local_8) * 0.5; } uVar1 = g_game->_levelStateFlags; if ((uVar1 & 2) != 0) { local_8 = local_8 + (1.0 - local_8) * 0.25; } if ((bool)((byte)(uVar1 >> 3) & 1) != ((uVar1 & 0x10) != 0)) { if ((uVar1 & 8) != 0) { local_8 = local_8 + (1.0 - local_8) * 0.1; } if ((uVar1 & 0x10) != 0) { local_8 = local_8 - (1.0 - local_8) * 0.1; } } if ((0.0 < g_game->_angelRoomChance) || (((pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x259,(RNG **)&g_game->_playerManager,1), pEVar2 != (Entity_Player *)0x0 && ((g_game->_gameStateFlags & 0x20) != 0)) || (pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x248,(RNG **)&g_game->_playerManager,1), pEVar2 != (Entity_Player *)0x0)))) { local_8 = (1.0 - local_8) * g_game->_angelRoomChance + local_8; } else if (((g_game->_gameStateFlags & 0x20) == 0) || (g_game->_devilRoomDeals != 0)) { local_8 = 0.0; } pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,499,(RNG **)&g_game->_playerManager,1); if (pEVar2 != (Entity_Player *)0x0) { local_8 = 77.0; } if (local_8 <= 0.0) { local_8 = 0.0; } if (1.0 <= local_8) { local_8 = 1.0; } return local_8; } //@@ 007f9960 Room::TrySpawnBossRushDoor /* ZHL [lua] Lua binding Room:TrySpawnBossRushDoor prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::TrySpawnBossRushDoor(Room *this,byte isIgnoreTime,byte isForce) { uint *puVar1; code *pcVar2; byte bVar3; RoomDescriptor *currentRoom; uint forcedCurses; uint preventedCurses; int gridWidth; Entity_Player *shovelOwner; void **doorSlot; GridEntity_Door *this_00; Game *game; uint uVar5; uint uVar6; float dy; float dx; uint entityIndex; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; int *entity; int gridWidth; void *updateList; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01359; local_10 = ExceptionList; ExceptionList = &local_10; if ((isForce != 0) || (((((g_game->_challenge != 0x2c && (((this->_roomType != 5 || (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x10) != 0x59)) || (bVar3 = Level::IsPreAscent((Level *)g_game), bVar3 == 0)))) && (((g_game->_stage < 1 || (6 < g_game->_stage)) || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) && ((g_game->_currentDimensionIdx == 0 && (currentRoom = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1), currentRoom->ListIndex == g_game->_lastBossRoomListIdx)))) && (bVar3 = Level::IsMausoleumHeartStage((Level *)g_game), bVar3 == 0)))) { uVar6 = g_game->_debugCurses; uVar5 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); gridWidth = g_game->_stage; if ((~preventedCurses & (forcedCurses | uVar6 | uVar5) & 2) != 0) { gridWidth = gridWidth + 1; } if ((isForce != 0) || (gridWidth == 6)) { gridWidth = 0; doorSlot = this->_doors; do { if ((*doorSlot != (void *)0x0) && (*(int *)((int)*doorSlot + 0x394) == -5)) { ExceptionList = local_10; return 0; } gridWidth = gridWidth + 1; doorSlot = doorSlot + 1; } while (gridWidth < 8); shovelOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x226,(RNG **)&g_game->_playerManager,1); if (shovelOwner != (Entity_Player *)0x0) { isIgnoreTime = 1; } KAGE_LogMessage(1,(byte *)"Mom clear time: %d\n"); KAGE_LogMessage(1,(byte *)"Par time: %d\n"); if (((g_game->_timeCounter <= g_game->_bossRushParTime) || (isIgnoreTime != 0)) || (isForce != 0)) { KAGE_LogMessage(1,(byte *)"Spawning boss rush door\n"); uVar6 = g_game->_enterDoor; if (((g_game->_lastRoomIdx != -5) || ((int)uVar6 < 0)) || (this->_doors[uVar6] != (void *)0x0)) { uVar5 = *(uint *)((int)this->_descriptor + 0x58); if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); bVar3 = (*pcVar2)(); return bVar3; } uVar5 = uVar5 >> 1 ^ uVar5; gridWidth = 0; uVar5 = uVar5 << 0xb ^ uVar5; do { uVar6 = gridWidth + ((uVar5 >> 0x10 ^ uVar5) & 7) & 0x80000007; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffff8) + 1; } } while ((((*(uint *)(*(int *)((int)this->_descriptor + 0x10) + 0x38 + (uVar6 >> 5) * 4) & 1 << ((byte)uVar6 & 0x1f)) == 0) || (this->_doors[uVar6] != (void *)0x0)) && (gridWidth = gridWidth + 1, gridWidth < 8)); if ((int)uVar6 < 0) { ExceptionList = local_10; return 0; } } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) { uStack_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); uStack_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } this_00 = this->_doors[uVar6]; if (this_00 == (GridEntity_Door *)0x0) { MakeDoor(this,uVar6); this_00 = this->_doors[uVar6]; } GridEntity_Door::SetRoomTypes (this_00,*(int *)(*(int *)((int)this->_descriptor + 0x10) + 8),0x11); *(undefined4 *)((int)this->_doors[uVar6] + 0x394) = 0xfffffffb; GridEntity_Door::Open(this->_doors[uVar6]); GridEntity_Door::SpawnDust(this->_doors[uVar6]); game = g_game; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&game->_gameStateFlags = (int)game->_gameStateFlags; if (isIgnoreTime != 0) { updateList = (this->_entityList)._updateEL._data; uVar5 = (this->_entityList)._updateEL._size; uStack_8 = 1; entityIndex = 0; if (uVar5 != 0) { do { entity = *(int **)((int)updateList + entityIndex * 4); if ((entity[10] == 0x2d) && (entity[0xb] == 0)) { gridWidth = *(int *)((int)this->_doors[uVar6] + 0x24); gridWidth = *(int *)((int)game->_room + 0xc); dx = ((float)(gridWidth % gridWidth) * 40.0 + 40.0) - (float)entity[0xcf]; dy = ((float)(gridWidth / gridWidth) * 40.0 + 120.0) - (float)entity[0xd0]; if (dy * dy + dx * dx < 2500.0) { (**(code **)(*entity + 0x28))(); } game = g_game; } entityIndex = entityIndex + 1; } while (entityIndex < uVar5); } } ExceptionList = local_10; return 1; } KAGE_LogMessage(1,(byte *)"Did not meet par time, did not spawn boss rush door.\n"); } } ExceptionList = local_10; return 0; } //@@ 007f9df0 Room::TrySpawnMegaSatanRoomDoor /* ZHL [lua] Lua binding Room:TrySpawnMegaSatanRoomDoor */ undefined4 Room::TrySpawnMegaSatanRoomDoor(char param_1) { Game *pGVar1; char cVar2; Room *in_ECX; char extraout_DL; pGVar1 = g_game; Game::GetChallengeParams(g_game); if (param_1 == '\0') { if (pGVar1->_currentRoomIdx != pGVar1->_startingRoomIdx) { return 0; } if (pGVar1->_stage != 0xb) { return 0; } if (pGVar1->_currentDimensionIdx != 0) { return 0; } if ((g_manager->_persistentGameData)._achievements[0x9b] == 0) { if (g_manager->_state != 2) { return 0; } if (((pGVar1->_dailyChallenge)._id == 0) && (pGVar1->_isDebug == 0)) { return 0; } } cVar2 = Game::IsChallengeOrDaily(pGVar1); if ((cVar2 != '\0') && (extraout_DL == '\0')) { return 0; } } KAGE_LogMessage(1,(byte *)"Spawning Mega Satan door\n"); if (in_ECX->_doors[1] == (void *)0x0) { MakeDoor(in_ECX,1); *(undefined4 *)((int)in_ECX->_doors[1] + 0x394) = 0xfffffff9; GridEntity_Door::SetRoomTypes (in_ECX->_doors[1],*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 8),5); return 1; } KAGE_LogMessage(1,(byte *)"[warn] no space for Mega Satan door\n"); return 0; } //@@ 007f9ee0 Room::clear_reward_position /* DB: ? ECX=Room, param=position: destroys the grid entity there (type 5 turned into 2 first, vtable Destroy), bridges pits (type 7, Room::TryMakeBridge), handles type 0xe, then Room::FindFreePickupSpawnPosition; from Room::SpawnClearAward before spawning trophies/chests (5.340, 5.370) */ void Room::clear_reward_position(Vector *param_1) { int *piVar1; int iVar2; uint uVar3; Vector *pVVar4; Room *in_ECX; int iVar5; GridEntity *pGVar6; GridEntity *pit; GridEntity *local_3c; Vector local_38; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; iVar5 = (int)((param_1->x - 40.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (in_ECX->_gridWidth <= iVar5)) || (iVar2 = (int)((param_1->y - 120.0) / 40.0 + 0.5), iVar2 < 0)) || (in_ECX->_gridHeight <= iVar2)) { pGVar6 = (GridEntity *)0xffffffff; LAB_007f9f79: pit = (GridEntity *)0x0; LAB_007f9f7f: local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; if ((pGVar6 < (GridEntity *)0x1c0) && (piVar1 = in_ECX->_gridEntities[(int)pGVar6], piVar1 != (int *)0x0)) { if (piVar1[1] == 5) { piVar1[1] = 2; } (**(code **)(*piVar1 + 0x14))(1,&local_30); } if (pit == (GridEntity *)0x0) goto LAB_007fa044; } else { pGVar6 = (GridEntity *)(in_ECX->_gridWidth * iVar2 + iVar5); if ((GridEntity *)0x1bf < pGVar6) goto LAB_007f9f79; pit = in_ECX->_gridEntities[(int)pGVar6]; local_3c = pit; if ((pit == (GridEntity *)0x0) || ((pit->_desc)._type != 7)) goto LAB_007f9f7f; TryMakeBridge(in_ECX,pit,(GridEntity *)0x0); pit = local_3c; } if ((((pit->_desc)._type == 0xe) && (local_3c = pGVar6, pGVar6 < (GridEntity *)0x1c0)) && ((in_ECX->_gridEntities[(int)pGVar6] != (void *)0x0 && (*(int *)((int)in_ECX->_gridEntities[(int)pGVar6] + 4) != 1)))) { in_ECX->_gridPaths[(int)pGVar6] = 900; std::set::insert(&local_38,&local_3c); } LAB_007fa044: iVar5 = (int)((param_1->x - 40.0) / 40.0 + 0.5); iVar2 = (int)((param_1->y - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (in_ECX->_gridWidth <= iVar5)) || (iVar2 < 0)) || (in_ECX->_gridHeight <= iVar2)) { iVar5 = -1; } else { iVar5 = in_ECX->_gridWidth * iVar2 + iVar5; } uVar3 = GetGridCollision(in_ECX,iVar5); if (uVar3 != 0) { pVVar4 = FindFreePickupSpawnPosition(in_ECX,&local_38,param_1,0.0,0,0,0); param_1->x = pVVar4->x; param_1->y = pVVar4->y; } return; } //@@ 007fa0e0 Room::clear_grid_for_pickup /* DB: ? (float* gridIndex in/out): destroys the grid entity at the index (state 5 -> 2, vtable +0x14 Destroy), poop (type 14) gets gridPath 900, and if collision remains moves the index to Room::FindFreePickupSpawnPosition (or -1); Room::SpawnClearAward before spawning the reward */ void Room::clear_grid_for_pickup(float *param_1) { int *piVar1; void *pvVar2; uint uVar3; Vector *pVVar4; Room *in_ECX; int iVar5; int iVar6; float index; Vector local_40; Vector VStack_38; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; if (((uint)*param_1 < 0x1c0) && (piVar1 = in_ECX->_gridEntities[(int)*param_1], piVar1 != (int *)0x0)) { if (piVar1[1] == 5) { piVar1[1] = 2; } (**(code **)(*piVar1 + 0x14))(1,&local_30); } index = *param_1; if (((((uint)index < 0x1c0) && (pvVar2 = in_ECX->_gridEntities[(int)index], pvVar2 != (void *)0x0) ) && (*(int *)((int)pvVar2 + 4) == 0xe)) && ((local_40.x = index, pvVar2 != (void *)0x0 && (*(int *)((int)pvVar2 + 4) != 1)))) { in_ECX->_gridPaths[(int)index] = 900; std::set::insert(&VStack_38,&local_40); index = *param_1; } uVar3 = GetGridCollision(in_ECX,(int)index); if (uVar3 != 0) { local_40.x = (float)((int)index % in_ECX->_gridWidth) * 40.0 + 40.0; local_40.y = (float)((int)index / in_ECX->_gridWidth) * 40.0 + 120.0; pVVar4 = FindFreePickupSpawnPosition(in_ECX,&VStack_38,&local_40,0.0,0,0,0); iVar6 = (int)((pVVar4->x - 40.0) / 40.0 + 0.5); if (((-1 < iVar6) && (iVar6 < in_ECX->_gridWidth)) && ((iVar5 = (int)((pVVar4->y - 120.0) / 40.0 + 0.5), -1 < iVar5 && (iVar5 < in_ECX->_gridHeight)))) { *param_1 = (float)(in_ECX->_gridWidth * iVar5 + iVar6); return; } *param_1 = -NAN; } return; } //@@ 007fa2a0 FUN_007fa2a0 void FUN_007fa2a0(float *param_1) { Room *in_ECX; int iVar1; int local_c [2]; local_c[0] = (int)((*param_1 - 40.0) / 40.0 + 0.5); if ((((local_c[0] < 0) || (in_ECX->_gridWidth <= local_c[0])) || (iVar1 = (int)((param_1[1] - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (in_ECX->_gridHeight <= iVar1)) { local_c[0] = -1; } else { local_c[0] = in_ECX->_gridWidth * iVar1 + local_c[0]; } Room::remove_grid_entity_for_spawn(in_ECX,local_c); iVar1 = in_ECX->_gridWidth; *param_1 = (float)(local_c[0] % iVar1) * 40.0 + 40.0; param_1[1] = (float)(local_c[0] / iVar1) * 40.0 + 120.0; return; } //@@ 007fa360 Room::remove_grid_entity_for_spawn /* DB: ? called from Room::SpawnClearAward after FindFreePickupSpawnPosition with grid index; nulls grid slot (+0x24 array) and +0x76c entry, fixes neighbor pits (GridEntity_Pit::UpdateCollision), QuerySublist prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Room::remove_grid_entity_for_spawn(Room *this,int *gridIndex) { int *piVar1; GridEntity_Pit *this_00; uint uVar2; int iVar3; int npcGridIndex; void *listData; Vector *freePos; int iVar4; float fVar5; uint uVar6; float fVar7; undefined4 neighborDestroyRef; undefined4 local_80; undefined4 local_7c; undefined4 local_78; float local_74; float local_70; float local_6c; float local_68; undefined4 local_64; undefined4 local_60; undefined4 destroyRef; undefined4 local_58; undefined4 local_54; undefined4 local_50; float local_4c; float local_48; float local_44; float local_40; undefined4 local_3c; undefined4 local_38; undefined1 local_34 [12]; float local_28; Vector local_24; int rowsLeft; int dx; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 *gridEntity; local_8 = 0xffffffff; puStack_c = &LAB_00b0138d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; if (-1 < *gridIndex) { gridEntity = this->_gridEntities[*gridIndex]; if (gridEntity != (undefined4 *)0x0) { if (gridEntity[1] == 7) { this->_gridPaths[gridEntity[9]] = 0; this->_gridEntities[gridEntity[9]] = (void *)0x0; (**(code **)*gridEntity)(1); local_24.y = (float)(*gridIndex % this->_gridWidth); dx = -1; local_28 = (float)(*gridIndex / this->_gridWidth - 1); do { npcGridIndex = dx + (int)local_24.y; rowsLeft = 3; iVar4 = dx; fVar5 = local_28; do { if (((-1 < npcGridIndex) && (npcGridIndex < this->_gridWidth)) && ((-1 < (int)fVar5 && (((int)fVar5 < this->_gridHeight && (iVar3 = this->_gridWidth * (int)fVar5 + iVar4 + (int)local_24.y, -1 < iVar3)))))) { piVar1 = this->_gridEntities[iVar3]; if ((piVar1 != (int *)0x0) && (piVar1[1] == 7)) { (**(code **)(*piVar1 + 4))(); } iVar4 = dx; } fVar5 = (float)((int)fVar5 + 1); rowsLeft = rowsLeft + -1; } while (rowsLeft != 0); dx = iVar4 + 1; } while (dx < 2); rowsLeft = 0; } else { if (gridEntity[1] == 0xe) { EntityList::QuerySublist(&this->_entityList,(EntityList_EL *)local_34,0x60,-1,-1,0,0); uVar6 = 0; local_8 = 0; if (local_28 != 0.0) { listData = (void *)local_34._4_4_; do { piVar1 = *(int **)((int)listData + uVar6 * 4); if (piVar1[0xef] == 0) { npcGridIndex = (int)(((float)piVar1[0xcd] - 40.0) / 40.0 + 0.5); iVar4 = (int)(((float)piVar1[0xce] - 120.0) / 40.0 + 0.5); if ((((npcGridIndex < 0) || (this->_gridWidth <= npcGridIndex)) || (iVar4 < 0)) || (this->_gridHeight <= iVar4)) { npcGridIndex = -1; } else { npcGridIndex = this->_gridWidth * iVar4 + npcGridIndex; } if (npcGridIndex == *gridIndex) { piVar1[0x2d9] = 0x10; (**(code **)(*piVar1 + 0xc))(); } listData = (void *)local_34._4_4_; } uVar6 = uVar6 + 1; } while (uVar6 < (uint)local_28); } if (local_34[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_34._4_4_,0); } } local_8 = 0xffffffff; destroyRef = 0; local_58 = 0; local_54 = 0; local_50 = 0; local_4c = g_vectorZero.x; local_48 = g_vectorZero.y; local_44 = g_vectorZero.x; local_40 = g_vectorZero.y; local_3c = 0; local_38 = 0; if (((uint)*gridIndex < 0x1c0) && (piVar1 = this->_gridEntities[*gridIndex], piVar1 != (int *)0x0)) { if (piVar1[1] == 5) { piVar1[1] = 2; } (**(code **)(*piVar1 + 0x14))(1,&destroyRef,uVar2); } } } npcGridIndex = *gridIndex; uVar2 = GetGridCollision(this,npcGridIndex); if (uVar2 != 0) { local_34._8_4_ = (float)(npcGridIndex % this->_gridWidth) * 40.0 + 40.0; local_28 = (float)(npcGridIndex / this->_gridWidth) * 40.0 + 120.0; freePos = FindFreePickupSpawnPosition(this,&local_24,(Vector *)(local_34 + 8),0.0,0,0,0); npcGridIndex = (int)((freePos->x - 40.0) / 40.0 + 0.5); iVar4 = (int)((freePos->y - 120.0) / 40.0 + 0.5); if ((((npcGridIndex < 0) || (this->_gridWidth <= npcGridIndex)) || (iVar4 < 0)) || (this->_gridHeight <= iVar4)) { npcGridIndex = -1; } else { npcGridIndex = this->_gridWidth * iVar4 + npcGridIndex; } *gridIndex = npcGridIndex; } iVar4 = npcGridIndex / this->_gridWidth; npcGridIndex = npcGridIndex % this->_gridWidth; fVar5 = (float)(npcGridIndex + 1); npcGridIndex = npcGridIndex + -1; if (npcGridIndex <= (int)fVar5) { fVar7 = (float)(iVar4 + -1); local_28 = fVar5; local_24.y = fVar7; do { if ((int)fVar7 <= iVar4 + 1) { do { if (((npcGridIndex < 0) || (this->_gridWidth <= npcGridIndex)) || (((int)fVar7 < 0 || (this->_gridHeight <= (int)fVar7)))) { uVar2 = 0xffffffff; } else { uVar2 = this->_gridWidth * (int)fVar7 + npcGridIndex; } this_00 = this->_gridEntities[uVar2]; if ((this_00 != (GridEntity_Pit *)0x0) && ((((piVar1 = *(int **)((int)this->_descriptor + 0x10), piVar1 == (int *)0x0 || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) && (((int)uVar2 < 0 || (this_00->_collisionClass != 0)))))) { iVar3 = (this_00->_desc)._type; if (iVar3 == 7) { if ((this_00->_desc)._state == 0) { (this_00->_desc)._state = 2; GridEntity_Pit::UpdateCollision(this_00); } } else { neighborDestroyRef = 0; local_80 = 0; local_7c = 0; local_78 = 0; local_74 = g_vectorZero.x; local_70 = g_vectorZero.y; local_6c = g_vectorZero.x; local_68 = g_vectorZero.y; local_64 = 0; local_60 = 0; if (uVar2 < 0x1c0) { if (iVar3 == 5) { (this_00->_desc)._type = 2; } (**(code **)(*(int *)this_00 + 0x14))(1,&neighborDestroyRef); } } } fVar7 = (float)((int)fVar7 + 1); } while ((int)fVar7 <= iVar4 + 1); fVar5 = local_28; fVar7 = local_24.y; } npcGridIndex = npcGridIndex + 1; } while (npcGridIndex <= (int)fVar5); } } ExceptionList = local_10; return; } //@@ 007fa7d0 FUN_007fa7d0 void FUN_007fa7d0(void) { GridEntity_Pit *this; uint uVar1; int iVar2; int iVar3; Room *in_ECX; int iVar4; int local_14; iVar3 = in_ECX->_gridWidth; iVar2 = in_ECX->_gridHeight; local_14 = 0; if (-1 < iVar3) { do { iVar4 = 0; if (-1 < iVar2) { do { if ((((-1 < local_14) && (local_14 < in_ECX->_gridWidth)) && (-1 < iVar4)) && (((iVar4 < iVar2 && (uVar1 = in_ECX->_gridWidth * iVar4 + local_14, uVar1 < 0x1c0)) && ((this = (GridEntity_Pit *) __RTDynamicCast(in_ECX->_gridEntities[uVar1],0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0) , this != (GridEntity_Pit *)0x0 && (uVar1 = Room::GetGridCollision(in_ECX,uVar1), uVar1 != 0)))))) { iVar2 = __ftoui3(); if ((this->_desc)._state == 0) { if (iVar2 * 2 == 0) { (this->_desc)._state = 2; GridEntity_Pit::UpdateCollision(this); } else { (this->_desc)._varData = iVar2 * 2; (this->_desc)._state = 1; } } } iVar2 = in_ECX->_gridHeight; iVar4 = iVar4 + 1; } while (iVar4 <= iVar2); iVar3 = in_ECX->_gridWidth; } local_14 = local_14 + 1; } while (local_14 <= iVar3); } return; } //@@ 007fa920 RoomClear_PickVariant /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: room clear award variant: Smelter 1/50 trinket, Guppy's Tail chests (items sweep 10) prototype: db/protos.zhl, confirmed by RET 8 */ int RoomClear_PickVariant(RNG *rng,byte isForcePickup) { code *pcVar1; byte bVar2; int iVar3; uint uVar4; Entity_Player *player; int *playerIter; float *pfVar5; Game *game; uint uVar6; float fVar7; undefined4 *playerEntry; float normalizedRoll; float local_30; float local_2c; float local_28; char local_21; Game *local_20; float trinketIds [5]; float local_8; PlayerManager *playerManager; void *trinketConfigs; local_8 = (float)(__security_cookie ^ (uint)(trinketIds + 6)); uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } game = g_game; fVar7 = 0.0; uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; local_28 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10; player = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x2e,(RNG **)&game->_playerManager,1); if (player != (Entity_Player *)0x0) { local_28 = local_28 * 0.9 + 0.1; } local_2c = 0.0; for (playerIter = (g_game->_playerManager)._playerList._begin; playerIter != (g_game->_playerManager)._playerList._end; playerIter = playerIter + 1) { iVar3 = *playerIter; if ((*(int *)(iVar3 + 0x2c) == 0) && (*(char *)(iVar3 + 0x20a9) == '\0')) { local_2c = local_2c + *(float *)(iVar3 + 0x156c); } } local_30 = 0.0; pfVar5 = &local_2c; if (local_2c <= 0.0) { pfVar5 = &local_30; } local_2c = *pfVar5; if (10.0 <= local_2c) { local_2c = 10.0; } uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; playerManager = &g_game->_playerManager; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; local_20 = (Game *)((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 * local_2c * 0.1 + local_28); bVar2 = PlayerManager::AnyoneHasTrinket(playerManager,0x2a); if (bVar2 != 0) { player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2e,(RNG **)&g_game->_playerManager,1); if ((player == (Entity_Player *)0x0) || (local_2c <= 0.0)) { local_20 = (Game *)((float)local_20 * 0.9 + 0.1); } else { local_20 = (Game *)((float)local_20 * 0.98 + 0.02); } } player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x29e,(RNG **)&g_game->_playerManager,1); if ((player != (Entity_Player *)0x0) && ((float)local_20 < 0.06)) { normalizedRoll = ((float)local_20 - 0.0) / 0.06; if (normalizedRoll <= 0.0) { normalizedRoll = 0.0; } if (1.0 <= normalizedRoll) { normalizedRoll = 1.0; } local_20 = (Game *)(1.0 - normalizedRoll * 0.78); } if (((float)local_20 <= 0.22) && (isForcePickup != 0)) { normalizedRoll = ((float)local_20 - 0.0) / 0.22; if (normalizedRoll <= 0.0) { normalizedRoll = 0.0; } if (1.0 <= normalizedRoll) { normalizedRoll = 1.0; } local_20 = (Game *)(normalizedRoll * 0.7799 + 0.2201); } if ((float)local_20 <= 0.22) goto LAB_007fb097; if (0.3 <= (float)local_20) { if (((float)local_20 < 0.45) || (((float)local_20 < 0.5 && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x54), bVar2 != 0)))) { fVar7 = 2.8026e-44; } else if ((0.6 <= (float)local_20) || ((bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16), bVar2 != 0 && (uVar4 = RNG::RandomInt(rng,5), uVar4 != 0)))) { if (0.8 <= (float)local_20) { fVar7 = 7.00649e-44; if ((float)local_20 < 0.95) { fVar7 = 5.60519e-44; } } else { fVar7 = 4.2039e-44; } } else { fVar7 = 1.4013e-44; } } else { uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if (uVar4 % 3 == 0) { fVar7 = 4.2039e-43; } else { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } fVar7 = 9.80909e-44; uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if ((uVar4 & 1) == 0) { fVar7 = 4.90454e-43; } } } uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if ((uVar4 % 0xf == 0) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x48), bVar2 != 0)) { fVar7 = 1.26117e-43; } player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x9f); if (player != (Entity_Player *)0x0) { iVar3 = Entity_Player::GetTrinketMultiplier(player,0x9f); if (iVar3 == 2) { uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; uVar4 = uVar4 % 10; } else { if (iVar3 < 3) goto LAB_007fae16; uVar4 = RNG::RandomInt(rng,4); } if (uVar4 == 0) { fVar7 = 7.00649e-44; } } LAB_007fae16: uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; trinketIds[4] = 5.04467e-44; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; trinketIds[0] = 6.30584e-44; trinketIds[1] = 6.16571e-44; trinketIds[2] = 4.76441e-44; trinketIds[3] = 5.74532e-44; if (uVar4 % 0x32 == 0) { fVar7 = 9.66896e-44; } local_2c = fVar7; local_30 = 0.0; do { fVar7 = trinketIds[(int)local_30]; local_20 = g_game; trinketConfigs = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)trinketConfigs >> 2 <= (int)((uint)fVar7 & 0x7fff)) || (iVar3 = *(int *)((int)trinketConfigs + ((uint)fVar7 & 0x7fff) * 4), iVar3 == 0)) || (local_21 = '\x01', (*(uint *)(iVar3 + 0xb8) & 0x80000000) == 0)) { local_21 = '\0'; } playerEntry = (g_game->_playerManager)._playerList._begin; local_28 = fVar7; if (playerEntry != (g_game->_playerManager)._playerList._end) { game = g_game; do { player = (Entity_Player *)*playerEntry; if (player->_variant == 0) { bVar2 = Entity_Player::HasTrinket(player,(uint)fVar7,0); if (bVar2 == 0) { if (((local_21 == '\0') || (player->_backupPlayer == (Entity_Player *)0x0)) || (bVar2 = Entity_Player::HasTrinket (player->_backupPlayer,(uint)trinketIds[(int)local_30],0), bVar2 == 0)) { game = local_20; fVar7 = local_28; goto LAB_007faf22; } player = player->_backupPlayer; } fVar7 = local_28; if (player == (Entity_Player *)0x0) break; if ((local_28 == 4.76441e-44) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16), bVar2 != 0)) { uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if (uVar4 % 5 != 0) break; } iVar3 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,(int)fVar7); uVar4 = 10; if (iVar3 == 2) { uVar4 = 0x14; } else if (2 < iVar3) { uVar4 = 0x32; } uVar6 = rng->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = rng->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar6 = uVar6 >> ((byte)rng->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)rng->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)rng->_shift3 & 0x1f) ^ uVar6; rng->_seed = uVar6; if (uVar6 % 100 < uVar4) { switch(fVar7) { case 4.76441e-44: fVar7 = 1.4013e-44; break; default: goto switchD_007fb171_caseD_23; case 5.04467e-44: fVar7 = 4.2039e-44; break; case 5.74532e-44: fVar7 = 5.60519e-44; break; case 6.16571e-44: fVar7 = 9.80909e-44; break; case 6.30584e-44: fVar7 = 4.2039e-43; } goto LAB_007fb02e; } break; } LAB_007faf22: playerEntry = playerEntry + 1; } while (playerEntry != (game->_playerManager)._playerList._end); } local_30 = (float)((int)local_30 + 1); } while ((uint)local_30 < 5); switchD_007fb171_caseD_23: fVar7 = local_2c; LAB_007fb02e: player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1df,(RNG **)&g_game->_playerManager,1); if (player != (Entity_Player *)0x0) { uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if (uVar4 % 0x32 == 0) { fVar7 = 4.90454e-43; } } LAB_007fb097: player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x86,(RNG **)&g_game->_playerManager,1); if (player != (Entity_Player *)0x0) { uVar4 = rng->_seed; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if (uVar4 % 3 == 0) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; iVar3 = 0x32; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; if ((uVar4 & 1) != 0) { iVar3 = 0x3c; } return iVar3; } if (isForcePickup == 0) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = rng->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } } uVar4 = uVar4 >> ((byte)rng->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rng->_shift3 & 0x1f) ^ uVar4; rng->_seed = uVar4; return -(uint)(uVar4 % 3 != 0) & (uint)fVar7; } } return (int)fVar7; } //@@ 007fb250 Room::SpawnClearAward /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: Lua Room:SpawnClearAward; ZHL sig said Entity_Bomb::Update; called from Room::TriggerClear */ void Room::SpawnClearAward(void) { uint *puVar1; code *pcVar2; bool bVar3; qword qVar4; Vector VVar5; char cVar6; byte bVar7; uint uVar8; Entity_Player *pEVar9; int iVar10; Entity_Player *pEVar11; RNG *itemPool; Entity_Pickup *spawnedPickup; Entity *spawned; undefined3 extraout_var; ChallengeParam *challengeParams; RoomDescriptor *roomDesc; Vector *pVVar12; std_vector *psVar13; Room *in_ECX; int extraout_ECX; PlayerManager *playerManager; int *piVar14; void *trinketRngEnd; uint uVar15; int iVar16; float fVar17; PersistentGameData *persistentData; Room *roomAlias; Game *game; float fVar18; float fVar19; undefined4 uVar20; TypeDescriptor *pTVar21; TypeDescriptor *pTVar22; undefined4 uVar23; Vector cantrippedCardPos; Vector leftItemPos; Vector rightItemPos; Vector local_e0; Vector local_d8; Vector tmpPos; Vector local_c8; Vector local_c0; Entity_Player *local_b8; float local_b4; RNG awardRng; Vector spawnPos; byte local_95; float local_94; Entity_Player *local_90; Room *room; Entity_Player *local_88; byte local_81; Vector rewardPos; Entity_Player *local_78; char isShopItems; Entity_Player *local_70; bool local_6a; bool local_69; Entity_Player *local_68; float playerColor; float local_60; float local_5c; undefined4 local_58; undefined4 local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; RNG local_38; KColor local_28; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; ItemPool *itemPool; Manager *manager; void *trinketRngBegin; local_8 = 0xffffffff; puStack_c = &LAB_00b013bd; local_10 = ExceptionList; uVar8 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; awardRng._shift1 = 5; awardRng._shift2 = 9; awardRng._seed = *(uint *)((int)in_ECX->_descriptor + 0x60); local_c0.y = 9.80909e-45; awardRng._shift3 = 7; room = in_ECX; local_14 = uVar8; GetCenterPos(&rewardPos); cVar6 = FUN_00866220(&awardRng,&rewardPos,uVar8); if (cVar6 != '\0') { ExceptionList = local_10; return; } local_94 = (float)FUN_00823ec0(); fVar19 = 40.0; spawnPos.x = rewardPos.x + 0.0; local_e0.y = rewardPos.y + 80.0; local_b4 = 0.0; leftItemPos.x = spawnPos.x - 40.0; leftItemPos.y = local_e0.y + 0.0; rightItemPos.x = spawnPos.x + 40.0; isShopItems = '\0'; local_70 = (Entity_Player *)0xffffffff; local_d8.x = spawnPos.x - 80.0; local_c8.y = leftItemPos.y; local_c8.x = spawnPos.x + 80.0; fVar18 = rewardPos.y; rightItemPos.y = leftItemPos.y; local_d8.y = leftItemPos.y; local_b8 = (Entity_Player *)local_e0.y; spawnPos.y = local_e0.y; local_88 = (Entity_Player *)spawnPos.x; pEVar9 = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x21); if (pEVar9 == (Entity_Player *)0x0) { if (((g_game->_levelStateFlags & 0x20000U) != 0) && (in_ECX->_roomType == 5)) { local_70 = (Entity_Player *)0xfffffffe; local_b8 = (Entity_Player *)(fVar18 + fVar19); spawnPos.y = (float)local_b8; goto LAB_007fb3f3; } } else { LAB_007fb3f3: isShopItems = '\x01'; } if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { piVar14 = *(int **)((int)in_ECX->_descriptor + 0x10); if ((piVar14 != (int *)0x0) && ((piVar14[2] == 0x10 && (*piVar14 == 0x23)))) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,1,1); PlayerManager::unlock_completion_mark(0xe); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x1ec,1); Game::End(g_game,0xe); goto switchD_007fd7f9_caseD_3; } iVar10 = in_ECX->_roomType; if ((iVar10 != 5) && (iVar10 != 0x11)) { if ((iVar10 == 0x10) || ((bVar7 = Level::HasAbandonedMineshaft((Level *)g_game), bVar7 != 0 && (g_game->_currentDimensionIdx == 1)))) goto switchD_007fd7f9_caseD_3; pEVar9 = (Entity_Player *)RoomClear_PickVariant(&awardRng,0); local_90 = (Entity_Player *)0x0; local_b8 = (Entity_Player *)0x0; local_68 = (Entity_Player *)0x1; local_88 = pEVar9; local_78 = pEVar9; bVar7 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0xf1); if ((bVar7 != 0) && (pEVar9 != (Entity_Player *)0x15e)) { iVar10 = PlayerManager::GetNumCollectibles(&g_game->_playerManager,0xf1); local_68 = (Entity_Player *)(iVar10 + 1); local_70 = (Entity_Player *)RNG::RandomFloat(&awardRng); fVar18 = pow(0.666,(float)(int)((int)local_68 - 1)); if ((float)local_70 < fVar18 * 0.5) { local_68 = (Entity_Player *)0x0; } } if ((g_game->_difficulty == 1) && (pEVar9 == (Entity_Player *)0xa)) { uVar8 = RNG::RandomInt(&awardRng,100); local_68 = (Entity_Player *)((uint)local_68 & -(uint)(uVar8 < 0x42)); } bVar7 = Entity_Pickup::IsChest((int)pEVar9); if (bVar7 == 0) { pEVar11 = PlayerManager::RandomCollectibleOwner (&g_game->_playerManager,0x1d0,awardRng._seed,(RNG **)0x0); if (pEVar11 != (Entity_Player *)0x0) { Entity_Player::GetGlyphOfBalanceDrop(pEVar11,(int *)&local_88,(int *)&local_b8); local_78 = local_88; local_90 = local_b8; pEVar9 = local_88; } } if ((*(int *)in_ECX->_descriptor == -0x10) && (pEVar11 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x96), pEVar11 != (Entity_Player *)0x0)) { iVar10 = Entity_Player::GetTrinketMultiplier(pEVar11,0x96); local_68 = (Entity_Player *)(iVar10 * (int)local_68); } bVar7 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0x202); if ((((bVar7 == 0) || (uVar8 = RNG::RandomInt(&awardRng,4), uVar8 != 0)) || ((int)local_68 < 1)) || (((pEVar9 != (Entity_Player *)&DAT_00000014 && (pEVar9 != (Entity_Player *)0xa)) && ((pEVar9 != (Entity_Player *)0x1e && ((pEVar9 != (Entity_Player *)0x45 && (pEVar9 != (Entity_Player *)0x28)))))))) { local_6a = false; } else { local_6a = true; } if ((((pEVar9 == (Entity_Player *)&DAT_00000014) || (pEVar9 == (Entity_Player *)0x0)) || (local_68 == (Entity_Player *)0x0)) && (pEVar11 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1a0,(RNG **)&g_game->_playerManager,0), pEVar11 != (Entity_Player *)0x0)) { pEVar9 = (Entity_Player *)&DAT_00000014; local_78 = (Entity_Player *)&DAT_00000014; RNG::game_constructor(&local_38,awardRng._seed,0x13); uVar8 = RNG::RandomInt(itemPool,3); uVar8 = uVar8 + (int)local_68; local_68 = (Entity_Player *)1; if (1 < uVar8) { local_68 = (Entity_Player *)uVar8; } LAB_007fb6b7: bVar7 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x54); if ((bVar7 != 0) && (local_88 = (Entity_Player *) PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x54), 1 < (int)local_88)) { local_70 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x54); trinketRngEnd = (local_70->_trinketRNGs)._end; if ((int)((int)trinketRngEnd - (int)(local_70->_trinketRNGs)._begin & 0xfffffff0U) < 0x541 ) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); trinketRngEnd = (local_70->_trinketRNGs)._end; } trinketRngBegin = (local_70->_trinketRNGs)._begin; uVar8 = ((int)trinketRngEnd - (int)trinketRngBegin >> 4) - 1; if (0x54 < uVar8) { uVar8 = 0x54; } local_70 = (Entity_Player *)(uVar8 * 0x10 + (int)trinketRngBegin); uVar8 = RNG::RandomInt((RNG *)local_70,10000); uVar15 = 0x29a; if (2 < (int)local_88) { uVar15 = 0x514; } if (uVar8 < uVar15) { local_28._red = 5.60519e-45; local_28._green = 2.8026e-45; local_28._blue = 4.2039e-45; local_28._alpha = 7.00649e-45; local_28._unk = 7; uVar8 = RNG::RandomInt((RNG *)local_70,5); local_90 = (Entity_Player *)(&local_28._red)[uVar8]; } } } else if (pEVar9 == (Entity_Player *)&DAT_00000014) goto LAB_007fb6b7; local_94 = 0.0; pEVar11 = local_68; if (0 < (int)local_68) { do { if (pEVar9 != (Entity_Player *)0x0) { FindFreePickupSpawnPosition(in_ECX,&spawnPos,&rewardPos,0.0,0,0,0); uVar8 = RNG::Next(&awardRng); spawnedPickup = (Entity_Pickup *) Game::Spawn(g_game,5,(uint)pEVar9,&spawnPos,&g_vectorZero,(Entity *)0x0, (uint)local_90,uVar8); bVar7 = Entity_Pickup::IsChest(spawnedPickup->_variant); if (bVar7 == 0) { local_90 = (Entity_Player *)spawnedPickup->_subtype; } if ((spawnedPickup->_type == 5) && ((extraout_ECX == 0x34 || (extraout_ECX == 0x36)))) { bVar7 = 0; iVar10 = GetGridIndex(in_ECX,&spawnPos); bVar7 = CanSpawnObstacleAtPosition(in_ECX,iVar10,bVar7); if (bVar7 == 0) { Entity_Pickup::Morph(spawnedPickup,5,0x32,1,0,0,0); local_90 = (Entity_Player *)0x1; } } if ((local_6a != false) && (local_94 == 0.0)) { qVar4 = spawnedPickup->_flags; puVar1 = (uint *)((int)&spawnedPickup->_flags + 4); *puVar1 = *puVar1 | 0x100; *(int *)&spawnedPickup->_flags = (int)qVar4; } pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x29e,(RNG **)&g_game->_playerManager,1); if (pEVar9 != (Entity_Player *)0x0) { spawn_options_alternative(spawnedPickup); } pEVar11 = local_68; pEVar9 = local_78; } local_94 = (float)((int)local_94 + 1); } while ((int)local_94 < (int)pEVar11); } bVar7 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x8f); game = g_game; if (bVar7 != 0) { iVar10 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x8f); fVar19 = (float)iVar10; fVar18 = PlayerManager::get_total_luck(&game->_playerManager); local_70 = (Entity_Player *)((fVar18 * 0.03 + 0.2) * fVar19); local_88 = (Entity_Player *)RNG::RandomFloat(&awardRng); in_ECX = room; pEVar9 = local_70; if (0.33 <= (float)local_70) { pEVar9 = (Entity_Player *)0x3ea8f5c3; } if ((float)local_88 < (float)pEVar9) { FindFreePickupSpawnPosition(room,&tmpPos,&rewardPos,0.0,0,0,0); uVar8 = RNG::Next(&awardRng); spawned = Game::Spawn(g_game,5,0x5a,&tmpPos,&g_vectorZero,(Entity *)0x0,1,uVar8); bVar7 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0x29e); if (bVar7 != 0) { spawn_options_alternative(spawned); } } } bVar7 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xb1); if ((bVar7 != 0) && (in_ECX->_roomType == 0xb)) { if (*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 0x10) == 1) { FindFreePickupSpawnPosition(in_ECX,&tmpPos,&rewardPos,0.0,0,0,0); uVar8 = RNG::Next(&awardRng); pVVar12 = &tmpPos; uVar15 = 100; } else { FindFreePickupSpawnPosition(in_ECX,&local_c8,&rewardPos,0.0,0,0,0); uVar8 = RNG::Next(&awardRng); pVVar12 = &local_c8; uVar15 = 0x32; } Game::Spawn(g_game,5,uVar15,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar8); uVar8 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { local_88 = PlayerManager::GetPlayer(playerManager,uVar8); local_70 = (Entity_Player *)Entity_Player::GetTrinketMultiplier(local_88,0xb1); if (1 < (int)local_70) { Entity_Player::add_random_stat_up(local_88,&awardRng); } if (2 < (int)local_70) { Entity_Player::add_random_stat_up(local_88,&awardRng); } uVar8 = uVar8 + 1; playerManager = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } if (g_game->_challenge == 0x2b) { FindFreePickupSpawnPosition(in_ECX,&cantrippedCardPos,&rewardPos,0.0,0,0,0); uVar8 = RNG::Next(&awardRng); Game::Spawn(g_game,5,300,&cantrippedCardPos,&g_vectorZero,(Entity *)0x0,1,uVar8); } goto switchD_007fd7f9_caseD_3; } pEVar9 = (Entity_Player *)g_game->_stage; local_78 = (Entity_Player *)g_game->_stageType; local_68 = pEVar9; local_90 = pEVar9; if (g_game->_currentRoomIdx == -0x11) { Level::boss_count_adjust((int *)&local_90,(int *)&local_78); pEVar9 = local_90; LAB_007fbbc4: local_68 = pEVar9; } else { uVar8 = Level::filter_curses((Level *)g_game,2); if (((uVar8 != 0) && ((int)pEVar9 < 8)) || (g_game->_challenge == 0x2c)) { pEVar9 = (Entity_Player *)(&pEVar9->field_0x0 + 1); goto LAB_007fbbc4; } } local_90 = (Entity_Player *)Game::GetChallengeParams(g_game); local_95 = Level::IsStageWithinEnd(10,0); local_81 = Level::IsStageWithinEnd(10,1); iVar10 = CONCAT31(extraout_var,local_81); if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { LAB_007fbc83: local_69 = false; } else { challengeParams = Game::GetChallengeParams(g_game); iVar10 = 0xc; if (challengeParams->_endStage != 0xc) { if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) { in_ECX = room; if (((g_manager->_persistentGameData)._achievements[0x140] != 0) || ((pEVar9 = local_68, g_manager->_state == 2 && (g_game->_isDebug != 0)))) goto LAB_007fbc61; } iVar10 = 0xb; } LAB_007fbc61: iVar16 = iVar10; if (challengeParams->_isPathTypeSet != 0) { iVar16 = challengeParams->_endStage; if (challengeParams->_endStage == 0) { iVar16 = iVar10; } if (challengeParams->_pathType == 3) goto LAB_007fbc83; } local_69 = 0xb < iVar16; } local_78 = (Entity_Player *)CONCAT31((int3)((uint)iVar10 >> 8),1); if (*(byte *)((int)&(local_90->_sprite)._animState._animData + 3) != 0) { local_78 = (Entity_Player *)(uint)((int)pEVar9 < *(int *)&local_90->field_0x40); } if (in_ECX->_roomType == 0x11) { PlayerManager::unlock_completion_mark(3); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x6f,1); game = g_game; qVar4 = g_game->_gameStateFlags; puVar1 = (uint *)((int)&g_game->_gameStateFlags + 4); *puVar1 = *puVar1 | 2; *(int *)&game->_gameStateFlags = (int)qVar4; } if ((in_ECX->_descriptor == (void *)0x0) || (iVar10 = *(int *)((int)in_ECX->_descriptor + 0x10), iVar10 == 0)) goto switchD_007fbd6e_caseD_e79; uVar8 = *(uint *)(iVar10 + 0xc); if (uVar8 < 0xeb6) { if (uVar8 != 0xeb5) { if (0xcc2 < uVar8) { switch(uVar8) { case 0xe78: case 0xe7b: case 0xe7e: case 0xe82: case 0xeb0: goto switchD_007fbd6e_caseD_e78; default: goto switchD_007fbd6e_caseD_e79; } } if (uVar8 != 0xcc2) { if (uVar8 < 0x7ea) { if (((uVar8 == 0x7e9) || (uVar8 == 0x421)) || (uVar8 == 0x43f)) goto switchD_007fbd6e_caseD_e78; } else if ((uVar8 == 0x810) || (uVar8 == 0xcc1)) goto switchD_007fbd6e_caseD_e78; goto switchD_007fbd6e_caseD_e79; } } switchD_007fbd6e_caseD_e78: FUN_007fa7d0(); } else { if (0x1436 < uVar8) { switch(uVar8) { case 0x143c: case 0x143d: case 0x1466: case 0x146d: case 0x14f1: goto switchD_007fbd6e_caseD_e78; default: goto switchD_007fbd6e_caseD_e79; } } if (uVar8 == 0x1436) goto switchD_007fbd6e_caseD_e78; if (uVar8 < 0xfca) { if (((uVar8 == 0xfc9) || (uVar8 == 0xeeb)) || (uVar8 == 0xfb6)) goto switchD_007fbd6e_caseD_e78; } else if ((uVar8 == 0x13ef) || (uVar8 == 0x1418)) goto switchD_007fbd6e_caseD_e78; } switchD_007fbd6e_caseD_e79: cVar6 = IsCurrentRoomLastBoss(); if ((cVar6 == '\0') && ((g_game->_currentRoomIdx != -10 || (in_ECX->_roomType != 5)))) { local_6a = false; } else { local_6a = true; } if (g_game->_challenge == 0x2c) { roomDesc = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx, g_game->_currentDimensionIdx); local_6a = *(int *)((int)roomDesc->Data + 8) == 5; } game = g_game; bVar7 = PlayerManager::IsCoopPlay(&g_game->_playerManager); if ((bVar7 != 0) && (local_6a != false)) { PlayerManager::revive_player_ghosts(&game->_playerManager); } if ((g_game->_currentRoomIdx == -10) && (in_ECX->_roomType == 5)) { if (local_68 == (Entity_Player *)0x6) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,1,1); PlayerManager::unlock_completion_mark(0); } else if (local_68 == (Entity_Player *)0x8) { PlayerManager::unlock_completion_mark(0xd); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x1eb,1); if (*(byte *)((int)&(local_90->_sprite)._animState._animData + 3) != 0) { clear_reward_position(&rewardPos); goto LAB_007fbea9; } clear_reward_position(&rewardPos); (g_manager->_achievementOverlay)._isPopupBlocked = 1; uVar8 = RNG::Next(&awardRng); Game::Spawn(g_game,5,0x154,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); if ((((char)local_78 != '\0') && (local_69 != false)) && (1 < (uint)(g_manager->_persistentGameData)._eventCounters[0x1eb])) { spawnPos.x = rewardPos.x + 0.0; spawnPos.y = rewardPos.y + 40.0; pVVar12 = FindFreePickupSpawnPosition(in_ECX,&tmpPos,&spawnPos,80.0,1,0,0); local_88 = (Entity_Player *)GetGridIndex(in_ECX,pVVar12); remove_grid_entity_for_spawn(in_ECX,(int *)&local_88); uVar8 = Random(); SpawnGridEntity(in_ECX,(int)local_88,0x11,0,uVar8,1); } } goto LAB_007fd75c; } if (((int)local_68 < 8) && (local_68 != (Entity_Player *)0x6)) { LAB_007fcf52: if (local_6a != false) { if ((char)local_78 == '\0') { clear_reward_position(&rewardPos); uVar8 = Random(); Game::Spawn(g_game,5,0x172,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); } else { uVar8 = Level::filter_curses((Level *)g_game,2); local_95 = uVar8 != 0; if ((local_90->_sprite)._animState._layerFrames == (void *)0x3) { cVar6 = FUN_007ed240(); local_81 = 1; if (cVar6 == '\0') goto LAB_007fcf96; } else { LAB_007fcf96: local_81 = 0; } game = g_game; challengeParams = Game::GetChallengeParams(g_game); if ((challengeParams->_pathType == 2) && (((bVar7 = Level::IsAltPath((Level *)game), bVar7 == 0 || (local_95 != 0)) || ((local_68 != (Entity_Player *)0x1 && (((local_68 != (Entity_Player *)0x3 && (local_68 != (Entity_Player *)0x5)) && (local_68 != (Entity_Player *)0x7)))))))) { bVar3 = true; } else { bVar3 = false; } if ((g_game->_challenge == 0x2c) || ((local_81 == 0 && (!bVar3)))) { remove_grid_entity_for_spawn(in_ECX,(int *)&local_94); uVar8 = Random(); SpawnGridEntity(in_ECX,(int)local_94,0x11,0,uVar8,0); } } } LAB_007fd052: if ((in_ECX->_bossId == 0x26) && (bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,0xb5,1), bVar7 != 0)) { uVar8 = 0xb5; LAB_007fd2ec: ItemPool::RemoveCollectible(&g_game->_itemPool,uVar8,0,0); } else { if ((in_ECX->_bossId == 0x16) && (bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,0x82,1), bVar7 != 0)) { uVar8 = 0x82; goto LAB_007fd2ec; } if ((in_ECX->_bossId == 0x15) && (bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,0x60,1), bVar7 != 0)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x19); uVar8 = 0x60; goto LAB_007fd2ec; } if ((in_ECX->_bossId == 0x13) && (bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,99,1), bVar7 != 0)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x17); uVar8 = 99; goto LAB_007fd2ec; } if ((in_ECX->_bossId == 0x14) && ((bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,0x32,1), bVar7 != 0 || (bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,100,1), bVar7 != 0)))) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x18); bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,100,1); if ((bVar7 == 0) || (uVar8 = RNG::RandomInt(&awardRng,6), uVar8 == 0)) { uVar8 = 0x32; } else { uVar8 = 100; } goto LAB_007fd2ec; } iVar10 = in_ECX->_bossId; if ((((8 < iVar10) && (iVar10 < 0xd)) || (iVar10 == 0x26)) || (iVar10 == 0x16)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,7); uVar8 = RNG::RandomInt(&awardRng,2); uVar8 = (-(uint)(uVar8 != 0) & 0x86) + 0x49; pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x49,(RNG **)&g_game->_playerManager,1); if (pEVar9 == (Entity_Player *)0x0) { pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xcf,(RNG **)&g_game->_playerManager,1); if (pEVar9 != (Entity_Player *)0x0) { uVar8 = 0xcf; } } else { uVar8 = 0x49; } goto LAB_007fd2ec; } if ((in_ECX->_roomType == 0x11) && (pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x226,(RNG **)&g_game->_playerManager,1), pEVar9 != (Entity_Player *)0x0)) { uVar8 = 0x227; goto LAB_007fd2ec; } if ((in_ECX->_bossId == 0x54) && (*(int *)&in_ECX->field_0x73f0 == -1)) { bVar7 = ItemPool::is_collectible_available(&g_game->_itemPool,0x28a,1); manager = g_manager; if (bVar7 != 0) { *(undefined4 *)&in_ECX->field_0x73f0 = 0; PersistentGameData::TryUnlock(&manager->_persistentGameData,0x19a); uVar8 = 0x28a; goto LAB_007fd2ec; } } uVar8 = RNG::Next(&awardRng); uVar8 = ItemPool::GetSeededCollectible(uVar8,0,in_ECX->_descriptor); } if (g_game->_challenge == 0x2b) { spawnPos.x = (float)local_88; spawnPos.y = (float)local_b8; clear_reward_position(&spawnPos); g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; FUN_007fa2a0(&spawnPos); uVar8 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&spawnPos,&g_vectorZero,(Entity *)0x0,0xfb,uVar8); spawnedPickup = (Entity_Pickup *)__RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); if (isShopItems != '\0') { Entity_Pickup::MakeShopItem(spawnedPickup,-2); } g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1; spawnedPickup->_coopDuplicateIndex = 0; } else { local_b4 = 0.0; local_94 = 0.0; local_69 = (bool)pick_special_clear_award (in_ECX,(int *)&local_b4,(uint *)&local_94,&awardRng); local_c0.x = (float)local_88; local_c0.y = (float)local_b8; pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xf9,(RNG **)&g_game->_playerManager,1); if ((pEVar9 == (Entity_Player *)0x0) || (local_69 == false)) { pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xf9,(RNG **)&g_game->_playerManager,1); if ((pEVar9 != (Entity_Player *)0x0) != local_69) { local_c0.x = leftItemPos.x; local_c0.y = leftItemPos.y; } } else { local_c0.x = (float)local_88; local_c0.y = local_e0.y; } clear_reward_position(&local_c0); FUN_007fa2a0(&local_c0); uVar15 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&local_c0,&g_vectorZero,(Entity *)0x0,uVar8,uVar15); pEVar9 = (Entity_Player *)__RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); local_70 = pEVar9; if (isShopItems != '\0') { Entity_Pickup::MakeShopItem((Entity_Pickup *)pEVar9,-2); } playerManager = &g_game->_playerManager; (pEVar9->_crownOfLightSprite)._overlayAnimState._layerFrames = (void *)0x0; iVar10 = -1; pEVar9 = PlayerManager::FirstCollectibleOwner(playerManager,0xf9,(RNG **)playerManager,1); if (pEVar9 != (Entity_Player *)0x0) { uVar8 = RNG::Next(&awardRng); uVar8 = ItemPool::GetSeededCollectible(uVar8,0,in_ECX->_descriptor); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar8,0,0); pVVar12 = &local_d8; if (local_69 == false) { pVVar12 = &rightItemPos; } local_c0.x = (float)pVVar12->x; local_c0.y = pVVar12->y; clear_reward_position(&local_c0); FUN_007fa2a0(&local_c0); uVar15 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&local_c0,&g_vectorZero,(Entity *)0x0,uVar8,uVar15); spawnedPickup = (Entity_Pickup *)__RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); if (isShopItems != '\0') { Entity_Pickup::MakeShopItem(spawnedPickup,-2); } iVar10 = Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)local_70); spawnedPickup->_coopDuplicateIndex = 0; spawnedPickup->_optionsPickupIndex = iVar10; } if (local_69 != false) { pEVar9 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xf9,(RNG **)&g_game->_playerManager,1); pVVar12 = &local_c8; if (pEVar9 == (Entity_Player *)0x0) { pVVar12 = &rightItemPos; } local_c0.x = (float)pVVar12->x; local_c0.y = pVVar12->y; if (local_b4 != 0.0) { ItemPool::RemoveCollectible(&g_game->_itemPool,(int)local_b4,0,0); clear_reward_position(&local_c0); FUN_007fa2a0(&local_c0); uVar8 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&local_c0,&g_vectorZero,(Entity *)0x0,(uint)local_b4, uVar8); spawnedPickup = (Entity_Pickup *)__RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); if (isShopItems != '\0') { Entity_Pickup::MakeShopItem(spawnedPickup,-2); } if (iVar10 == -1) { iVar10 = Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)local_70); } spawnedPickup->_optionsPickupIndex = iVar10; spawnedPickup->_coopDuplicateIndex = 0; } fVar18 = local_94; if (local_94 != 0.0) { uVar8 = Random(); pVVar12 = &local_c0; uVar15 = 0x15e; goto LAB_007fd74c; } } } } else { if (((local_68 == (Entity_Player *)0x8) || (local_68 == (Entity_Player *)0x6)) && (local_6a == false)) goto LAB_007fd052; if ((in_ECX->_roomType == 0x11) || ((g_game->_challenge == 0x2c && ((int)local_68 < 8)))) goto LAB_007fcf52; if (in_ECX->_bossId == 0x37) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x1a,1); FUN_0092a5e0(0x37); PlayerManager::unlock_completion_mark(6); if ((byte)(local_90->_sprite)._animDefaultName._capacity == 0) { if (((char)local_78 == '\0') || (local_69 == false)) { Game::End(g_game,8); } else { (g_manager->_achievementOverlay)._isPopupBlocked = 1; uVar8 = RNG::Next(&awardRng); Game::Spawn(g_game,5,0x154,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); pVVar12 = FindFreePickupSpawnPosition(in_ECX,&tmpPos,&rewardPos,80.0,1,0,0); local_88 = (Entity_Player *)GetGridIndex(in_ECX,pVVar12); remove_grid_entity_for_spawn(in_ECX,(int *)&local_88); uVar8 = Random(); SpawnGridEntity(in_ECX,(int)local_88,0x11,0,uVar8,1); } goto LAB_007fd75c; } clear_reward_position(&rewardPos); uVar8 = Random(); fVar18 = 0.0; pVVar12 = &rewardPos; uVar15 = 0x172; LAB_007fd74c: Game::Spawn(g_game,5,uVar15,pVVar12,&g_vectorZero,(Entity *)0x0,(uint)fVar18,uVar8); } else { if (local_68 == (Entity_Player *)0x6) { if (((g_manager->_persistentGameData)._achievements[4] == 0) && ((g_manager->_state != 2 || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (*(byte *)((int)&(local_90->_sprite)._animState._animData + 3) != 0) { if ((char)local_78 == '\0') goto LAB_007fc202; if (((byte)(local_90->_sprite)._animDefaultName._capacity != 0) || (6 < *(int *)&local_90->field_0x40)) goto LAB_007fc1ca; } PersistentGameData::TryUnlock(&g_manager->_persistentGameData,4); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,5); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,6); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x281); Game::End(g_game,2); goto LAB_007fd75c; } if ((char)local_78 == '\0') { LAB_007fc202: clear_reward_position(&rewardPos); uVar8 = Random(); Game::Spawn(g_game,5,0x172,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); } else { LAB_007fc1ca: if ((*(byte *)((int)&(local_90->_sprite)._animState._animData + 3) == 0) || ((local_90->_sprite)._animState._layerFrames != (void *)0x3)) { remove_grid_entity_for_spawn(in_ECX,(int *)&local_94); uVar8 = Random(); SpawnGridEntity(in_ECX,(int)local_94,0x11,0,uVar8,0); } } game = g_game; local_d8.x = 320.0; local_d8.y = 360.0; challengeParams = Game::GetChallengeParams(g_game); roomAlias = room; if ((challengeParams->_pathType == 3) || ((((g_manager->_persistentGameData)._achievements[0x39] != 0 || (((g_manager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) && (local_81 != 0)) )) { bVar7 = 1; if (challengeParams->_pathType != 3) goto LAB_007fc299; LAB_007fc2d1: bVar3 = true; } else { bVar7 = 0; LAB_007fc299: if ((((g_manager->_persistentGameData)._achievements[0x4e] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) && (local_95 != 0)) goto LAB_007fc2d1; bVar3 = false; } if (bVar7 == 0) { if (bVar3) goto LAB_007fc47e; bVar7 = 0; uVar8 = RNG::Next(&awardRng); uVar8 = GetSeededCollectible(in_ECX,uVar8,bVar7); roomAlias = room; clear_reward_position(&local_d8); uVar15 = RNG::Next(&awardRng); spawnedPickup = (Entity_Pickup *) Game::Spawn(g_game,5,100,&local_d8,&g_vectorZero,(Entity *)0x0,uVar8,uVar15); if (isShopItems != '\0') { Entity_Pickup::MakeShopItem(spawnedPickup,(int)local_70); } spawnedPickup->_coopDuplicateIndex = 0; } else if (!bVar3) { LAB_007fc47e: uVar15 = (bVar7 ^ 1) + 0x147; clear_reward_position(&local_d8); uVar8 = RNG::Next(&awardRng); spawned = Game::Spawn(g_game,5,100,&local_d8,&g_vectorZero,(Entity *)0x0,uVar15,uVar8); itemPool = &g_game->_itemPool; spawned[1]._colorParams._capacity = (void *)0x0; spawned[1]._collisionPoints._end = (void *)0x0; ItemPool::RemoveCollectible(itemPool,uVar15,0,0); } else { clear_reward_position(&leftItemPos); uVar8 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&leftItemPos,&g_vectorZero,(Entity *)0x0,0x147,uVar8) ; spawnedPickup = (Entity_Pickup *)__RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); ItemPool::RemoveCollectible(&g_game->_itemPool,0x147,0,0); iVar10 = Entity_Pickup::AssignOptionsIndex(spawnedPickup); spawnedPickup->_cycleCollectibleCount = 0; spawnedPickup->_coopDuplicateIndex = 0; clear_reward_position(&rightItemPos); uVar8 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&rightItemPos,&g_vectorZero,(Entity *)0x0,0x148,uVar8 ); iVar16 = __RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); ItemPool::RemoveCollectible(&g_game->_itemPool,0x148,0,0); *(int *)(iVar16 + 0x528) = iVar10; *(undefined4 *)(iVar16 + 0x5c0) = 0; *(undefined4 *)(iVar16 + 0x588) = 0; roomAlias = room; } if (((char)local_78 != '\0') && (local_69 != false)) { local_94 = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { uVar8 = 0; do { pEVar9 = Game::GetPlayer(g_game,uVar8); if (pEVar9->_variant == 0) { iVar10 = 0; piVar14 = (pEVar9->_collectibleCounts)._begin; for (iVar16 = (int)(pEVar9->_collectibleCounts)._end - (int)piVar14 >> 2; iVar16 != 0; iVar16 = iVar16 + -1) { iVar10 = iVar10 + *piVar14; piVar14 = piVar14 + 1; } fVar18 = pEVar9->_damage; if (pEVar9->_damage <= local_b4) { fVar18 = local_b4; } local_94 = (float)((int)local_94 + iVar10); local_b4 = fVar18; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); roomAlias = room; } fVar18 = local_94; uVar8 = RNG::RandomInt(&awardRng,0x14); if ((uVar8 == 0) && ((0x13 < (int)fVar18 || (100.0 < local_b4)))) { pVVar12 = FindFreePickupSpawnPosition(roomAlias,&tmpPos,&rewardPos,80.0,1,0,0); local_70 = (Entity_Player *)GetGridIndex(roomAlias,pVVar12); remove_grid_entity_for_spawn(roomAlias,(int *)&local_70); uVar8 = Random(); SpawnGridEntity(roomAlias,(int)local_70,0x11,0,uVar8,1); } } PersistentGameData::TryUnlock(&g_manager->_persistentGameData,4); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,5); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,6); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x281); goto LAB_007fd75c; } if ((local_68 == (Entity_Player *)0x8) || (local_68 == (Entity_Player *)0x9)) { if (((((g_manager->_persistentGameData)._achievements[0x22] == 0) && ((g_manager->_state != 2 || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) || (local_68 != (Entity_Player *)0x8)) && ((((g_manager->_persistentGameData)._eventCounters[0x9e] == 0 || (local_68 != (Entity_Player *)0x9)) && ((*(byte *)((int)&(local_90->_sprite)._animState._animData + 3) == 0 || (((byte)(local_90->_sprite)._animDefaultName._capacity == 0 && (*(int *)&local_90->field_0x40 <= (int)local_68)))))))) { clear_reward_position(&rewardPos); if ((char)local_78 == '\0') goto LAB_007fce68; (g_manager->_achievementOverlay)._isPopupBlocked = 1; uVar8 = RNG::Next(&awardRng); uVar15 = 0x154; LAB_007fce80: Game::Spawn(g_game,5,uVar15,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); } else { if ((char)local_78 == '\0') { clear_reward_position(&rewardPos); LAB_007fce68: uVar8 = Random(); uVar15 = 0x172; goto LAB_007fce80; } if (local_95 != 0) { pVVar12 = GetCenterPos(&tmpPos); spawnPos.y = 280.0; spawnPos.x = pVVar12->x - 40.0; local_70 = (Entity_Player *)GetGridIndex(in_ECX,&spawnPos); remove_grid_entity_for_spawn(in_ECX,(int *)&local_70); uVar8 = Random(); SpawnGridEntity(in_ECX,(int)local_70,0x11,0,uVar8,0); } if (local_81 != 0) { pVVar12 = GetCenterPos(&tmpPos); spawnPos.y = 280.0; spawnPos.x = pVVar12->x + 40.0; local_70 = (Entity_Player *)GetGridIndex(in_ECX,&spawnPos); clear_grid_for_pickup(&local_70); uVar8 = Random(); pVVar12 = GetGridPosition(room,&tmpPos,(int)local_70); Game::Spawn(g_game,1000,0x27,pVVar12,&g_vectorZero,(Entity *)0x0,0,uVar8); in_ECX = room; } } if (local_68 == (Entity_Player *)0x8) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,1,1); PlayerManager::unlock_completion_mark(0); uVar8 = RNG::RandomInt(&awardRng,10); if ((((uVar8 == 0) && ((char)local_78 != '\0')) && (local_69 != false)) && (challengeParams = Game::GetChallengeParams(g_game), challengeParams->_endStage != 0xc)) { pVVar12 = &local_c8; goto LAB_007fca07; } } else if (local_68 == (Entity_Player *)0x9) { PlayerManager::unlock_completion_mark(9); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x9e,1); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x140); Game::SetStateFlag(0x28,1); } } else if (local_68 == (Entity_Player *)0xb) { if (g_game->_stageType == 0) { PlayerManager::unlock_completion_mark(5); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x19,1); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x15c); if (g_game->_timeCounter < 36000) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x146); } bVar7 = Game::GetStateFlag(g_game,0x29); if (bVar7 == 0) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x147); } if (0 < g_game->_victoryLap) { bVar7 = Game::AchievementUnlocksDisallowed(g_game); FUN_009299e0(bVar7); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x141); manager = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = 1; } if (1 < g_game->_victoryLap) { bVar7 = Game::AchievementUnlocksDisallowed(g_game); FUN_009299e0(bVar7); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x168); manager = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = 1; } if (2 < g_game->_victoryLap) { bVar7 = Game::AchievementUnlocksDisallowed(g_game); FUN_009299e0(bVar7); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x151); manager = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (manager->_persistentGameData)._isReadOnly = 1; } game = g_game; if (((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) && (bVar7 = Game::IsGreedMode(g_game), bVar7 == 0)) { if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (uVar8 = PlayerManager::count_main_players(&game->_playerManager), uVar8 < 2)) { GenericPrompt::Show(&game->_genericPrompt,0); } else { GenericPrompt::Show(&game->_genericPrompt,1); online_vote_start(game,1,2); } } in_ECX = room; } else { PlayerManager::unlock_completion_mark(4); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x18,1); } challengeParams = Game::GetChallengeParams(g_game); if (challengeParams->_endStage == 0xc) { LAB_007fc9db: if ((char)local_78 == '\0') goto LAB_007fd75c; } else { clear_reward_position(&rewardPos); if ((char)local_78 == '\0') { LAB_007fbea9: uVar8 = Random(); fVar18 = 0.0; pVVar12 = &rewardPos; uVar15 = 0x172; goto LAB_007fd74c; } (g_manager->_achievementOverlay)._isPopupBlocked = 1; uVar8 = RNG::Next(&awardRng); Game::Spawn(g_game,5,0x154,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); } if (local_69 != false) { pVVar12 = &tmpPos; LAB_007fca07: pVVar12 = FindFreePickupSpawnPosition(in_ECX,pVVar12,&rewardPos,80.0,1,0,0); local_70 = (Entity_Player *)GetGridIndex(in_ECX,pVVar12); remove_grid_entity_for_spawn(in_ECX,(int *)&local_70); uVar8 = Random(); SpawnGridEntity(in_ECX,(int)local_70,0x11,0,uVar8,1); } } else if (local_68 == (Entity_Player *)0xa) { if (g_game->_stageType == 0) { PlayerManager::unlock_completion_mark(2); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,3); iVar10 = 0xd; } else { PlayerManager::unlock_completion_mark(1); iVar10 = 0xb; } PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,iVar10,1); clear_reward_position(&rewardPos); if ((char)local_78 == '\0') { uVar8 = Random(); uVar15 = 0x172; } else { (g_manager->_achievementOverlay)._isPopupBlocked = 1; uVar8 = RNG::Next(&awardRng); uVar15 = 0x154; } Game::Spawn(g_game,5,uVar15,&rewardPos,&g_vectorZero,(Entity *)0x0,0,uVar8); challengeParams = Game::GetChallengeParams(g_game); if ((challengeParams->_endStage != 0xc) && (uVar8 = RNG::RandomInt(&awardRng,100), uVar8 < 0xf)) goto LAB_007fc9db; } else if (local_68 == (Entity_Player *)0xc) { if (in_ECX->_bossId == 0x46) { PlayerManager::unlock_completion_mark(0xc); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x152); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x165); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xbb,1); clear_reward_position(&rewardPos); if ((char)local_78 != '\0') { (g_manager->_achievementOverlay)._isPopupBlocked = 1; uVar8 = RNG::Next(&awardRng); fVar18 = 0.0; pVVar12 = &rewardPos; uVar15 = 0x154; goto LAB_007fd74c; } goto LAB_007fbea9; } uVar8 = RNG::RandomInt(&awardRng,0x11); game = g_game; if (uVar8 == 0x10) { uVar8 = 0x19; } uVar15 = RNG::Next(&awardRng); uVar8 = ItemPool::GetCollectible(&game->_itemPool,uVar8,uVar15,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar8,0,0); bVar7 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0xf9); pVVar12 = &leftItemPos; if (bVar7 == 0) { pVVar12 = &spawnPos; } local_e0.x = pVVar12->x; local_e0.y = pVVar12->y; clear_reward_position(&local_e0); uVar15 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&local_e0,&g_vectorZero,(Entity *)0x0,uVar8,uVar15); local_70 = (Entity_Player *)__RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); playerManager = &g_game->_playerManager; (local_70->_crownOfLightSprite)._overlayAnimState._layerFrames = (void *)0x0; bVar7 = PlayerManager::AnyoneHasCollectible(playerManager,0xf9); if (bVar7 != 0) { uVar8 = RNG::RandomInt(&awardRng,0x11); game = g_game; if (uVar8 == 0x10) { uVar8 = 0x19; } uVar15 = RNG::Next(&awardRng); uVar8 = ItemPool::GetCollectible(&game->_itemPool,uVar8,uVar15,0,0,0); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar8,0,0); clear_reward_position(&rightItemPos); uVar15 = RNG::Next(&awardRng); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; spawned = Game::Spawn(g_game,5,100,&rightItemPos,&g_vectorZero,(Entity *)0x0,uVar8, uVar15); iVar10 = __RTDynamicCast(spawned,uVar20,pTVar21,pTVar22,uVar23); iVar16 = Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)local_70); *(int *)(iVar10 + 0x528) = iVar16; *(undefined4 *)(iVar10 + 0x588) = 0; } } } } LAB_007fd75c: manager = g_manager; persistentData = &g_manager->_persistentGameData; if ((g_manager->_persistentGameData)._isReadOnly == 0) { piVar14 = (g_manager->_persistentGameData)._cutsceneCounters + (int)&local_68[-1].field_0x2696 ; *piVar14 = *piVar14 + 1; uVar8 = *(uint *)&(manager->_persistentGameData).field_0xdd0; *(undefined1 *)persistentData = 1; if (0x27 < uVar8) { PersistentGameData::TryUnlock(persistentData,0x10); } if (0x1d < *(uint *)&(manager->_persistentGameData).field_0xdd8) { PersistentGameData::TryUnlock(persistentData,0x11); } if (0x13 < *(uint *)&(manager->_persistentGameData).field_0xde0) { PersistentGameData::TryUnlock(persistentData,0x12); } } pEVar9 = local_68; if (local_68 == (Entity_Player *)0x2) { iVar10 = 0xd; LAB_007fd7ca: PersistentGameData::TryUnlock(&g_manager->_persistentGameData,iVar10); } else { if (local_68 == (Entity_Player *)0x4) { iVar10 = 0xe; goto LAB_007fd7ca; } if (local_68 == (Entity_Player *)0xb) { iVar10 = 0x9b; goto LAB_007fd7ca; } } if (local_6a != false) { iVar10 = g_game->_lastLevelWithDamage; switch(pEVar9) { case (Entity_Player *)0x2: if (iVar10 < 1) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x25); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x15f); } break; case (Entity_Player *)0x4: if (iVar10 < 3) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x26); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x16d); } break; case (Entity_Player *)0x6: if (iVar10 < 5) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x27); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x170); } break; case (Entity_Player *)0x8: if (iVar10 < 7) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x28); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x176); } break; case (Entity_Player *)0xb: if (iVar10 < 0xb) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x53); } } } goto switchD_007fd7f9_caseD_3; } if (in_ECX->_roomType != 1) { if ((in_ECX->_roomType == 5) && (in_ECX->_bossId == 0x3e)) { MusicManager::Crossfade(&g_manager->_musicManager,0x25,0.08); EntityList::QuerySublist(&in_ECX->_entityList,(EntityList_EL *)&local_38,0x196,0,-1,0,0); local_8 = 0; local_b4 = g_vectorZero.x; local_90 = (Entity_Player *)g_vectorZero.y; if (local_38._shift3 != 0) { pVVar12 = (Vector *)(*(int *)local_38._shift1 + 0x33c); local_b4 = pVVar12->x; local_90 = *(Entity_Player **)(*(int *)local_38._shift1 + 0x340); local_c8 = *pVVar12; uVar8 = GetGridIndex(in_ECX,&local_c8); if (uVar8 < 0x1c0) { in_ECX->_gridPaths[uVar8] = 1000; } } game = g_game; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { local_b8 = (Entity_Player *)0x1; } else { local_b8 = (Entity_Player *)PlayerManager::count_main_players(&g_game->_playerManager); if (local_b8 == (Entity_Player *)0x0) { LAB_007fdb1d: local_d8.x = rewardPos.x; local_d8.y = rewardPos.y; if ((local_b4 != g_vectorZero.x) || ((float)local_90 != g_vectorZero.y)) { tmpPos.x = local_b4 + 0.0; tmpPos.y = (float)local_90 + 40.0; GetClampedPositionImpl(in_ECX,&local_c8,&tmpPos,40.0,40.0,40.0,40.0); local_d8.y = local_c8.y; local_d8.x = local_c8.x; if (local_c8.y - (float)local_90 < 20.0) { if (0.0 <= rewardPos.x - local_c8.x) { local_d8.x = 40.0; } else { local_d8.x = -40.0; } local_d8.x = local_c8.x + local_d8.x; } } clear_reward_position(&local_d8); uVar8 = RNG::Next(&awardRng); Game::Spawn(g_game,5,0x154,&local_d8,&g_vectorZero,(Entity *)0x0,0,uVar8); PlayerManager::unlock_completion_mark(7); if (g_game->_difficulty == 3) { PlayerManager::unlock_completion_mark(0xb); } if ((char)local_38._seed == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_38._shift1,0); } goto switchD_007fd7f9_caseD_3; } } local_78 = (Entity_Player *)0x0; do { local_88 = PlayerManager::get_main_player(&game->_playerManager,(int)local_78); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_007fdd45: local_94 = (local_88->_pos).x; local_68 = (Entity_Player *)(local_88->_pos).y; uVar8 = Random(); fVar18 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_e0.y = fVar18 + fVar18; local_70 = (Entity_Player *)sin(local_e0.y); fVar18 = cos(local_e0.y); tmpPos.x = fVar18 * 80.0 + local_94; tmpPos.y = (float)local_70 * 80.0 + (float)local_68; GetClampedPositionImpl(in_ECX,&spawnPos,&tmpPos,40.0,40.0,40.0,40.0); if ((ABS(spawnPos.x - local_b4) < 20.0) && (spawnPos.y < (float)local_90)) { if (0.0 <= rewardPos.x - spawnPos.x) { fVar18 = 40.0; } else { fVar18 = -40.0; } spawnPos.x = fVar18 + spawnPos.x; } clear_reward_position(&spawnPos); pEVar9 = (Entity_Player *)0x0; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pEVar9 = local_88; } if (awardRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } awardRng._seed = (uint)awardRng._seed >> ((byte)awardRng._shift1 & 0x1f) ^ awardRng._seed; awardRng._seed = awardRng._seed << ((byte)awardRng._shift2 & 0x1f) ^ awardRng._seed; awardRng._seed = (uint)awardRng._seed >> (SUB41(local_c0.y,0) & 0x1f) ^ awardRng._seed; spawned = Game::Spawn(g_game,6,0xb,&spawnPos,&g_vectorZero,(Entity *)pEVar9,0, awardRng._seed); *(uint *)&spawned->_flags = (uint)spawned->_flags | 4; *(undefined4 *)((int)&spawned->_flags + 4) = *(undefined4 *)((int)&spawned->_flags + 4); if ((Entity_Player *)0x1 < local_b8) { iVar10 = 0; piVar14 = (int *)&(g_game->_playerManager).field_0x60; do { if (*piVar14 == local_88->_controllerIndex) goto LAB_007fdf6a; iVar10 = iVar10 + 1; piVar14 = piVar14 + 1; } while (iVar10 < 4); iVar10 = 5; LAB_007fdf6a: PlayerManager::GetPlayerColorValue(&local_28,iVar10); local_44 = 0; local_54 = 0; uStack_50 = 0; uStack_4c = 0; uStack_48 = 0; playerColor = local_28._red; local_60 = local_28._green; local_40 = 0; local_3c = 0; local_5c = local_28._blue; local_58 = 0x3f800000; (**(code **)(*(int *)spawned + 0x3c))(&playerColor,0xffffffff,0xff,0,1); } (**(code **)(*(int *)spawned + 0xc))(); in_ECX = room; } else { local_6a = false; local_e0.y = (float)FUN_0090b010(local_88->_controllerIndex); if ((Entity_Player *)local_e0.y != (Entity_Player *)0x0) { local_70 = (g_manager->_lobbyMembers)._begin; local_94 = (float)(((int)(g_manager->_lobbyMembers)._end - (int)local_70) / 0x14); if (local_94 != 0.0) { fVar18 = (((Entity_Player *)local_e0.y)->_sizeMulti).x; pEVar9 = local_70; do { psVar13 = &pEVar9->_damageEvents; if (fVar18 == 0.0) { local_c8.x = 0.0; local_c8.y = 0.0; VVar5 = local_c8; local_c8.x = 0.0; local_70 = (Entity_Player *)0x0; fVar19 = local_c8.x; local_c8 = VVar5; } else { local_70 = *(Entity_Player **)((int)fVar18 + 0xc); fVar19 = *(float *)((int)fVar18 + 8); } iVar10 = *(int *)((int)(psVar13 + -1) + 8); if (iVar10 == 0) { local_c8.x = 0.0; local_c8.y = 0.0; VVar5 = local_c8; local_c8.y = 0.0; local_c8.x = 0.0; pEVar9 = (Entity_Player *)local_c8.y; fVar17 = local_c8.x; local_c8 = VVar5; } else { pEVar9 = *(Entity_Player **)(iVar10 + 0xc); fVar17 = *(float *)(iVar10 + 8); } if ((fVar19 == fVar17) && (local_70 == pEVar9)) { local_6a = (bool)(*(byte *)&psVar13->_begin & 1); } pEVar9 = (Entity_Player *)(psVar13 + 1); local_94 = (float)((int)local_94 - 1); } while (local_94 != 0.0); local_94 = 0.0; in_ECX = room; if (local_6a != false) goto LAB_007fdd45; } } } local_78 = (Entity_Player *)&local_78->field_0x1; if (local_b8 <= local_78) goto LAB_007fdb1d; game = g_game; } while( true ); } goto switchD_007fd7f9_caseD_3; } switch((g_manager->_musicManager)._currentMusicID) { case 9: fVar18 = (g_manager->_optionsConfig)._musicVolume; iVar10 = 0x53; break; default: piVar14 = &(g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]. _enabledLayers; *piVar14 = *piVar14 & 0xfffffffe; goto switchD_007fd7f9_caseD_3; case 0x17: MusicManager::Crossfade(&g_manager->_musicManager,0x25,0.08); goto switchD_007fd7f9_caseD_3; case 0x1a: fVar18 = (g_manager->_optionsConfig)._musicVolume; iVar10 = 0x61; break; case 0x26: Music::Play((Music *)&g_manager->_musicManager,0x5c,(g_manager->_optionsConfig)._musicVolume); if (0x23 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60) { (g_manager->_musicManager)._queuedMusicID = 0x23; } goto switchD_007fd7f9_caseD_3; case 0x29: fVar18 = (g_manager->_optionsConfig)._musicVolume; iVar10 = 0x2a; } Music::Play((Music *)&g_manager->_musicManager,iVar10,fVar18); if (0x25 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60) { (g_manager->_musicManager)._queuedMusicID = 0x25; } switchD_007fd7f9_caseD_3: *(int *)((int)room->_descriptor + 0x60) = awardRng._seed; ExceptionList = local_10; return; } //@@ 007fe220 Room::card_against_humanity_fill /* DB: Room::Update calls it while flag 0x11f4 (Room::SetCardAgainstHumanity) is set; it clears the flag and puts a poop (33% black with Meconium) on every free interior cell not under an entity; 1 in 8 an effect 1000.33 at a player (trinkets-cards) prototype: db/protos.zhl */ void __thiscall Room::card_against_humanity_fill(Room *playerManager) { code *pcVar1; GridEntity *pGVar2; ANM2 *pAVar3; byte bVar4; Entity_Player *pEVar5; Entity *spawnedEffect; uint uVar6; ItemConfig_Item *item; void *pvVar7; Game *pGVar8; GridEntity *pGVar9; int iVar10; PlayerManager *playerManager; int iVar11; uint pickIdx; int *piVar12; undefined4 *puVar13; uint pickIdx; uint *cardRng; int iVar15; undefined4 *puVar16; Room *pRVar17; float fVar18; undefined1 local_5c [8]; void *local_54; undefined4 *local_50; undefined4 *freeCellsEnd; undefined4 *local_48; Vector local_44; void *occupiedCells; undefined4 occupiedCellsSize; GridEntity *local_34; uint local_30; uint meconiumRoll; uint *local_28; undefined4 *freeCellsCapEnd; Game *local_20; undefined4 *freeCells; Room *local_18; char isMeconiumBackupCounts; void *local_10; undefined1 *puStack_c; undefined4 local_8; int roomShape; local_8 = 0xffffffff; puStack_c = &LAB_00b01417; local_10 = ExceptionList; ExceptionList = &local_10; playerManager->field_0x11f4 = 0; occupiedCells = (void *)0x0; occupiedCellsSize = 0; local_18 = playerManager; occupiedCells = operator_new(0x14); *(void **)occupiedCells = occupiedCells; *(void **)((int)occupiedCells + 4) = occupiedCells; *(void **)((int)occupiedCells + 8) = occupiedCells; *(undefined2 *)((int)occupiedCells + 0xc) = 0x101; pickIdx = 0; local_8 = 0; if ((playerManager->_entityList)._updateEL._size != 0) { do { iVar10 = *(int *)((int)(playerManager->_entityList)._updateEL._data + pickIdx * 4); if ((((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar10 + 0x28) == 1)) || (iVar11 = *(int *)(iVar10 + 0x28), iVar11 - 10U < 0x3de)) || ((iVar11 == 1 || (iVar11 == 6)))) || (iVar11 == 5)) || (iVar11 == 4)) { iVar11 = (int)((*(float *)(iVar10 + 0x33c) - 40.0) / 40.0 + 0.5); iVar10 = (int)((*(float *)(iVar10 + 0x340) - 120.0) / 40.0 + 0.5); if (((iVar11 < 0) || (iVar15 = *(int *)((int)g_game->_room + 0xc), iVar15 <= iVar11)) || ((iVar10 < 0 || (*(int *)((int)g_game->_room + 0x10) <= iVar10)))) { local_28 = (uint *)0xffffffff; } else { local_28 = (uint *)(iVar15 * iVar10 + iVar11); } std::set::insert(&local_44,&local_28); } pickIdx = pickIdx + 1; } while (pickIdx < (uint)(playerManager->_entityList)._updateEL._size); } pGVar8 = g_game; piVar12 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar12 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar12 = (pGVar8->_playerManager)._playerList._begin; } iVar10 = *piVar12; iVar11 = *(int *)(iVar10 + 0x1798); if (iVar11 - *(int *)(iVar10 + 0x1794) >> 4 < 0x2e) { KAGE_LogMessage(0x10,(byte *)"Card ID out of bounds!\n"); iVar11 = *(int *)(iVar10 + 0x1798); } pickIdx = (iVar11 - *(int *)(iVar10 + 0x1794) >> 4) - 1; if (0x2d < pickIdx) { pickIdx = 0x2d; } cardRng = (uint *)(pickIdx * 0x10 + *(int *)(iVar10 + 0x1794)); pickIdx = *cardRng; local_28 = cardRng; if (pickIdx == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pickIdx = *cardRng; if (pickIdx == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } pickIdx = pickIdx >> ((byte)cardRng[1] & 0x1f) ^ pickIdx; pickIdx = pickIdx << ((byte)cardRng[2] & 0x1f) ^ pickIdx; pickIdx = pickIdx >> ((byte)cardRng[3] & 0x1f) ^ pickIdx; *cardRng = pickIdx; if ((pickIdx & 7) == 0) { pickIdx = Random(); pEVar5 = Game::GetRandomPlayer(g_game,&g_vectorZero,9999999.0); local_44.x = (pEVar5->_pos).x; local_44.y = (pEVar5->_pos).y; spawnedEffect = Game::Spawn(g_game,1000,0x21,&local_44,&g_vectorZero,(Entity *)0x0,0,pickIdx); (**(code **)(*(int *)spawnedEffect + 0xc))(); } freeCells = (undefined4 *)0x0; local_50 = (undefined4 *)0x0; freeCellsEnd = (undefined4 *)0x0; freeCellsCapEnd = (undefined4 *)0x0; local_48 = (undefined4 *)0x0; local_8 = CONCAT31(local_8._1_3_,1); iVar10 = playerManager->_gridWidth; pickIdx = (playerManager->_gridHeight * iVar10) / 2; if (pickIdx != 0) { if (0x3fffffff < pickIdx) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(pickIdx); iVar10 = playerManager->_gridWidth; freeCellsCapEnd = local_48; freeCells = local_50; } iVar11 = 1; local_50 = freeCells; local_48 = freeCellsCapEnd; if (1 < iVar10) { do { iVar10 = playerManager->_gridHeight; iVar15 = 1; if (1 < iVar10) { do { roomShape = *(int *)(*(int *)((int)local_18->_descriptor + 0x10) + 0x48); if (roomShape == 0xb) { if (local_18->_gridWidth / 2 <= iVar11) goto LAB_007fe72c; joined_r0x007fe6ae: if (iVar15 <= iVar10 / 2) goto LAB_007fe72c; } else { if (roomShape == 0xc) { if (local_18->_gridWidth / 2 < iVar11) goto joined_r0x007fe6ae; } else if (roomShape == 9) { if (iVar11 < local_18->_gridWidth / 2) { joined_r0x007fe6d3: if (iVar15 < iVar10 / 2) goto LAB_007fe51b; } } else if (roomShape == 10) { if (local_18->_gridWidth / 2 < iVar11) goto joined_r0x007fe6d3; } else if ((((roomShape == 2) || (roomShape == 7)) && (2 < iVar15 - 3U)) || (((roomShape == 3 || (roomShape == 5)) && (4 < iVar11 - 5U)))) goto LAB_007fe51b; LAB_007fe72c: pvVar7 = g_game->_room; if (((iVar11 < 0) || (*(int *)((int)pvVar7 + 0xc) <= iVar11)) || ((iVar15 < 0 || (*(int *)((int)pvVar7 + 0x10) <= iVar15)))) { local_20 = (Game *)0xffffffff; } else { local_20 = (Game *)(*(int *)((int)pvVar7 + 0xc) * iVar15 + iVar11); if (((local_20 < (Game *)0x1c0) && (iVar10 = *(int *)((int)pvVar7 + (int)local_20 * 4 + 0x24), iVar10 != 0)) && (*(int *)(iVar10 + 4) != 1)) goto LAB_007fe51b; } pGVar8 = local_20; std::set::find_node(local_5c,&local_20); if ((*(char *)((int)local_54 + 0xd) != '\0') || (pvVar7 = local_54, (int)pGVar8 < *(int *)((int)local_54 + 0x10))) { pvVar7 = occupiedCells; } if (pvVar7 == occupiedCells) { if (freeCellsEnd == freeCellsCapEnd) { std::vector::_Emplace_reallocate(freeCellsEnd,&local_20); freeCellsCapEnd = local_48; local_18->field_0x11f4 = 1; } else { *freeCellsEnd = pGVar8; freeCellsEnd = freeCellsEnd + 1; local_18->field_0x11f4 = 1; } } } LAB_007fe51b: iVar10 = local_18->_gridHeight; iVar15 = iVar15 + 1; } while (iVar15 < iVar10); } iVar11 = iVar11 + 1; playerManager = local_18; } while (iVar11 < local_18->_gridWidth); freeCells = local_50; } puVar13 = freeCellsEnd; local_50 = freeCells; if (freeCells != freeCellsEnd) { do { cardRng = local_28; pickIdx = *local_28; if (pickIdx == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pickIdx = *cardRng; if (pickIdx == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } pickIdx = pickIdx >> ((byte)cardRng[1] & 0x1f) ^ pickIdx; pickIdx = pickIdx << ((byte)cardRng[2] & 0x1f) ^ pickIdx; pickIdx = pickIdx >> ((byte)cardRng[3] & 0x1f) ^ pickIdx; *cardRng = pickIdx; if ((pickIdx & 3) == 0) break; local_18 = (Room *)0x0; if (pickIdx == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pickIdx = *cardRng; if (pickIdx == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } pickIdx = pickIdx >> ((byte)cardRng[1] & 0x1f) ^ pickIdx; pickIdx = pickIdx << ((byte)cardRng[2] & 0x1f) ^ pickIdx; pickIdx = pickIdx >> ((byte)cardRng[3] & 0x1f) ^ pickIdx; *cardRng = pickIdx; uVar6 = pickIdx; if (pickIdx == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *cardRng; } if (uVar6 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = uVar6 >> ((byte)cardRng[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)cardRng[2] & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)cardRng[3] & 0x1f) ^ uVar6; *cardRng = uVar6; meconiumRoll = uVar6; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *cardRng; } if (uVar6 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar6 = uVar6 >> ((byte)cardRng[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)cardRng[2] & 0x1f) ^ uVar6; local_30 = uVar6 >> ((byte)cardRng[3] & 0x1f) ^ uVar6; playerManager = &g_game->_playerManager; *cardRng = local_30; pEVar5 = PlayerManager::FirstCollectibleOwner(playerManager,0x21f,(RNG **)playerManager,1); pGVar8 = g_game; local_20 = g_game; if (pEVar5 == (Entity_Player *)0x0) { pvVar7 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar7 >> 2 < 0x220) { item = (ItemConfig_Item *)0x0; } else { item = *(ItemConfig_Item **)((int)pvVar7 + 0x87c); } bVar4 = PlayerManager::HasTemporaryEffect(&g_game->_playerManager,item); if (bVar4 != 0) goto LAB_007fe7f7; } else { LAB_007fe7f7: if (pickIdx % 100 < 0x21) { local_18 = (Room *)&DAT_00000006; } } pvVar7 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar7 >> 2 < 0x5c) || (iVar10 = *(int *)((int)pvVar7 + 0x16c), iVar10 == 0)) || (isMeconiumBackupCounts = '\x01', (*(uint *)(iVar10 + 0xb8) & 0x80000000) == 0)) { isMeconiumBackupCounts = '\0'; } puVar16 = (pGVar8->_playerManager)._playerList._begin; if (puVar16 != (pGVar8->_playerManager)._playerList._end) { do { pEVar5 = (Entity_Player *)*puVar16; if (pEVar5->_variant == 0) { bVar4 = Entity_Player::HasTrinket(pEVar5,0x5b,0); if (bVar4 == 0) { if (((isMeconiumBackupCounts == '\0') || (pEVar5->_backupPlayer == (Entity_Player *)0x0)) || (bVar4 = Entity_Player::HasTrinket(pEVar5->_backupPlayer,0x5b,0), bVar4 == 0)) { pGVar8 = local_20; goto LAB_007fe8a2; } pEVar5 = pEVar5->_backupPlayer; } if (pEVar5 != (Entity_Player *)0x0) { if (meconiumRoll % 100 < 0x21) { local_18 = (Room *)&DAT_00000005; } pGVar8 = g_game; goto LAB_007fe8b6; } break; } LAB_007fe8a2: puVar16 = puVar16 + 1; } while (puVar16 != (pGVar8->_playerManager)._playerList._end); pGVar8 = g_game; } LAB_007fe8b6: pRVar17 = local_18; pEVar5 = PlayerManager::FirstCollectibleOwner (&pGVar8->_playerManager,0xca,(RNG **)&pGVar8->_playerManager,1); cardRng = local_28; if (pEVar5 != (Entity_Player *)0x0) { fVar18 = 0.0; for (piVar12 = (g_game->_playerManager)._playerList._begin; piVar12 != (g_game->_playerManager)._playerList._end; piVar12 = piVar12 + 1) { iVar10 = *piVar12; if ((*(int *)(iVar10 + 0x2c) == 0) && (*(char *)(iVar10 + 0x20a9) == '\0')) { fVar18 = fVar18 + *(float *)(iVar10 + 0x156c); } } if ((int)((int)(fVar18 * -5.0) + (local_30 / 100) * -100 + local_30) < 0xb) { pRVar17 = (Room *)0x3; } local_18 = pRVar17; } uVar6 = (int)puVar13 - (int)freeCells >> 2; pickIdx = *local_28; if (pickIdx == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pickIdx = *cardRng; if (pickIdx == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } pickIdx = pickIdx >> ((byte)cardRng[1] & 0x1f) ^ pickIdx; pickIdx = pickIdx << ((byte)cardRng[2] & 0x1f) ^ pickIdx; pickIdx = pickIdx >> ((byte)cardRng[3] & 0x1f) ^ pickIdx; pickIdx = 0; *cardRng = pickIdx; if (uVar6 != 0) { pickIdx = pickIdx % uVar6; } pickIdx = freeCells[pickIdx]; puVar16 = freeCells + pickIdx; memmove(puVar16,puVar16 + 1,(int)puVar13 - (int)(puVar16 + 1)); cardRng = local_28; puVar13 = puVar13 + -1; uVar6 = *local_28; local_20 = g_game->_room; freeCellsEnd = puVar13; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *cardRng; if (uVar6 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar6 = uVar6 >> ((byte)cardRng[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)cardRng[2] & 0x1f) ^ uVar6; local_30 = uVar6 >> ((byte)cardRng[3] & 0x1f) ^ uVar6; *cardRng = local_30; if (((int)pickIdx < 0) || (0x1bf < (int)pickIdx)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((pickIdx < 0x1c0) && (local_20->_roomMap[pickIdx - 0x5cdc] < 0x385)) { pGVar9 = operator_new(0x19c); local_8._0_1_ = 9; local_34 = pGVar9; if (pGVar9 == (GridEntity *)0x0) { pGVar9 = (GridEntity *)0x0; } else { GridEntity::GridEntity(pGVar9); *(undefined ***)pGVar9 = IsaacRepentancePlus::GridEntity_Poop::vftable; pGVar9[1]._desc._type = 0; pGVar9[1]._desc._spawnSeed = 0; pGVar9[1]._desc._varData = 0xf; *(undefined1 *)&pGVar9[1]._desc._type = 0; pGVar9[1]._desc._variableSeed = 0; pGVar9[1]._gridIndex = 0; pGVar9[1]._spawnFrame = 0; pGVar9[1]._rng._seed = 0; fVar18 = g_vectorZero.y; pGVar9[1]._rng._shift1 = (int)g_vectorZero.x; pGVar9[1]._rng._shift2 = (int)fVar18; fVar18 = g_vectorZero.y; pGVar9[1]._rng._shift3 = (int)g_vectorZero.x; pGVar9[1]._collisionClass = (int)fVar18; pGVar2 = pGVar9 + 1; (pGVar2->_sprite)._filename._buf[0] = '\0'; (pGVar2->_sprite)._filename._buf[1] = '\0'; (pGVar2->_sprite)._filename._buf[2] = '\0'; (pGVar2->_sprite)._filename._buf[3] = '\0'; pAVar3 = &pGVar9[1]._sprite; (pAVar3->_filename)._buf[4] = '\0'; (pAVar3->_filename)._buf[5] = '\0'; (pAVar3->_filename)._buf[6] = '\0'; (pAVar3->_filename)._buf[7] = '\0'; } local_8 = CONCAT31(local_8._1_3_,1); if (pGVar9 != (GridEntity *)0x0) { (pGVar9->_desc)._type = 0xe; pGVar9->_gridIndex = pickIdx; if ((undefined4 *)local_20->_roomMap[pickIdx - 0x5eae] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_20->_roomMap[pickIdx - 0x5eae])(1); } local_20->_roomMap[pickIdx - 0x5eae] = (int)pGVar9; (pGVar9->_desc)._variant = (int)local_18; (pGVar9->_desc)._spawnSeed = local_30; iVar10 = *(int *)pGVar9; (pGVar9->_desc)._varData = 0; pGVar9->_collisionClass = 0; (**(code **)(iVar10 + 0x20))(); pGVar8 = g_game; piVar12 = &(pGVar9->_desc)._spawnCount; *piVar12 = *piVar12 + 1; (pGVar9->_desc)._initialized = 1; pGVar9->_spawnFrame = pGVar8->_frameCount; } } } while (freeCells != puVar13); } if (freeCells != (undefined4 *)0x0) { pickIdx = (int)freeCellsCapEnd - (int)freeCells & 0xfffffffc; puVar13 = freeCells; if (0xfff < pickIdx) { puVar13 = (undefined4 *)freeCells[-1]; pickIdx = pickIdx + 0x23; if (0x1f < (uint)((int)freeCells + (-4 - (int)puVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar13,pickIdx); } FID_conflict__Erase_tree_>_> (&occupiedCells,(fuzzer_allocator_> *)&occupiedCells ,*(_Tree_node **)((int)occupiedCells + 4)); operator_delete(occupiedCells,0x14); ExceptionList = local_10; return; } //@@ 007fec00 Room::TriggerBossDeath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: own log string "TriggerBossDeath: %d bosses remaining." with ECX+0x7224 (Room boss counter: Entity_NPC::Init increments g_game+0x18300 room +0x7224 for bosses); skips type 0x19b variant 1/2, sets entity flag 0x100000; called from Entity::RemoveWithPoof and boss AIs (Lamb, Gideon, Dogma) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Room::TriggerBossDeath(Room *this,Entity *entity) { int *piVar1; void *pvVar2; byte isAngelSpawnRoom; byte bVar4; RoomDescriptor *returnRoom; uint uVar5; undefined4 uVar6; RNG *this_00; uint uVar7; int *node; uint3 extraout_var; Entity_Player *player; Vector *pVVar8; uint uVar9; float fVar10; float extraout_ECX; ItemOverlay *itemOverlay; int iVar11; int *piVar12; Game *game; int iVar13; code *pcVar14; int bossType; bool bVar15; Vector *position; EntityRef EStack_dc; undefined1 auStack_b0 [12]; Entity *bossEntity; undefined1 auStack_a0 [12]; int iStack_94; undefined1 auStack_90 [12]; int iStack_84; Vector VStack_80; Vector VStack_78; Vector VStack_70; Vector VStack_68; Vector VStack_60; Vector VStack_58; Vector VStack_50; RNG rng; Vector VStack_38; Room *local_30; Vector VStack_2c; byte bStack_23; byte bStack_22; char local_21; int iStack_20; RNG subRng; uint local_c; undefined1 auStack_8 [4]; bool isAngelSpawnRoom; local_c = __security_cookie ^ (uint)(auStack_8 + 4); bossEntity = entity; if (entity->_type == 0x19b) { if (entity->_variant == 1) { return; } if (entity->_variant == 2) { return; } } if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) || (local_21 = '\x01', this->_roomType != 1)) { local_21 = '\0'; } uVar7 = (uint)entity->_flags; if ((uVar7 & 0x80100000) != 0) { return; } *(undefined4 *)((int)&entity->_flags + 4) = *(undefined4 *)((int)&entity->_flags + 4); *(uint *)&entity->_flags = uVar7 | 0x100000; if ((uVar7 & 0x20000000) != 0) { return; } local_30 = this; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { KAGE_LogMessage(1,(byte *)"[Frame %d] "); } KAGE_LogMessage(1,(byte *)"TriggerBossDeath: %d bosses remaining.\n"); *(int *)&this->field_0x7224 = *(int *)&this->field_0x7224 + -1; if (0 < *(int *)&this->field_0x7224) goto LAB_00800060; bossType = entity->_type; VStack_58.y = (float)entity->_variant; VStack_38.y = (float)entity->_subtype; if ((g_game->_ambush)._isActive == 0) { uVar7 = *(uint *)((int)local_30->_descriptor + 100); } else { uVar7 = *(uint *)&g_game->field_0x265f4; } rng._shift1 = 4; rng._shift2 = 3; rng._shift3 = 0x11; VStack_68.y = (float)bossType; rng._seed = uVar7; if ((((((Entity *)bossType != (Entity *)0x2e) && ((Entity *)bossType != (Entity *)&DAT_0000002f)) && (((Entity *)bossType != (Entity *)0x30 && (((Entity *)bossType != (Entity *)0x31 && ((Entity *)bossType != (Entity *)0x32)))))) && ((Entity *)bossType != (Entity *)&DAT_00000033)) && ((Entity *)bossType != (Entity *)0x34)) { if ((Entity *)bossType == (Entity *)0x51) { bVar15 = VStack_58.y == 1.4013e-45; LAB_007fed8f: if (bVar15) goto LAB_007ff7d4; } else if ((Entity *)bossType == (Entity *)0x26) { bVar15 = VStack_58.y == 2.8026e-45; goto LAB_007fed8f; } if ((local_30->_roomType == 0x10) && ((iVar13 = *(int *)(*(int *)((int)local_30->_descriptor + 0x10) + 0x10), iVar13 == 2 || (iVar13 == 3)))) { if (((Entity *)bossType == (Entity *)0x38f) && (iVar13 == 3)) { returnRoom = Level::GetRoomByIdx((Level *)g_game,g_game->_dungeonReturnRoomIndex,-1); if ((returnRoom->Data != (void *)0x0) && (*(int *)((int)returnRoom->Data + 8) == 5)) { returnRoom->Flags = returnRoom->Flags | 0x10000; } } } else { KAGE_LogMessage(1,(byte *)"deathspawn_boss, color idx %d\n"); VStack_80.x = (entity->_pos).x; VStack_80.y = (entity->_pos).y; VStack_50.y = (float)local_30->_roomType; if ((((undefined1 *)VStack_50.y == &DAT_00000005) || (((((undefined1 *)VStack_50.y == &DAT_0000000f || (iVar13 = (g_manager->_musicManager)._currentMusicID, iVar13 == 9)) || (iVar13 == 0x1a) ) || (iVar13 == 0x29)))) && (((((g_game->_ambush)._isActive == 0 && ((isAngelSpawnRoom = Game::IsGreedMode(g_game), isAngelSpawnRoom == 0 || ((code *)VStack_50.y != (code *)0x1)) )) && (iVar13 = GetBossVictoryJingle(local_30), iVar13 != 0)) && (((g_manager->_musicManager)._currentMusicID != iVar13 && (Music::Play((Music *)&g_manager->_musicManager,iVar13, (g_manager->_optionsConfig)._musicVolume), 0x25 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60)))))) { (g_manager->_musicManager)._queuedMusicID = 0x25; } if ((local_30->_roomType == 5) || (local_30->_roomType == 0x11)) { auStack_90._0_4_ = RNG::Next(&rng); VStack_78.y = (float)entity->_initSeed; VStack_70.y = 9.80909e-45; auStack_90._4_8_ = 0x900000002; iStack_84 = 0xf; auStack_b0._0_8_ = 0xd00000003; VStack_50.y = (float)auStack_90._0_4_; if (local_30->_roomType == 0x11) { VStack_60.y = 1.4013e-45; if (((g_manager->_persistentGameData)._achievements[0x21] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { uVar7 = RNG::RandomInt((RNG *)auStack_90,2); VStack_60.y = (float)(1 - uVar7); VStack_50.y = (float)auStack_90._0_4_; } auStack_90._0_4_ = VStack_50.y; isAngelSpawnRoom = Game::IsHardMode(); if (isAngelSpawnRoom == 0) { fVar10 = VStack_60.y; goto LAB_007feffd; } LAB_007fef9b: uVar7 = RNG::RandomInt((RNG *)auStack_90,2); fVar10 = (float)((int)VStack_60.y - uVar7); pcVar14 = (code *)auStack_90._0_4_; VStack_60.y = fVar10; } else { if (((g_manager->_persistentGameData)._achievements[0x21] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { VStack_60.y = 2.8026e-45; } else { VStack_60.y = 1.4013e-45; } isAngelSpawnRoom = Game::IsHardMode(); fVar10 = extraout_ECX; if (isAngelSpawnRoom != 0) goto LAB_007fef9b; LAB_007feffd: pcVar14 = (code *)VStack_50.y; } uVar7 = rng._seed; if (0 < (int)fVar10) { do { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar7 = uVar7 >> ((byte)rng._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)rng._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rng._shift3 & 0x1f) ^ uVar7; isAngelSpawnRoom = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16); if ((isAngelSpawnRoom == 0) || (uVar7 == (uVar7 / 5) * 5)) { if (pcVar14 == (code *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar9 = (uint)pcVar14 >> (auStack_90[4] & 0x1f) ^ (uint)pcVar14; uVar9 = uVar9 << (auStack_90[8] & 0x1f) ^ uVar9; pcVar14 = (code *)(uVar9 >> ((byte)iStack_84 & 0x1f) ^ uVar9); if (VStack_78.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar9 = (uint)VStack_78.y >> (auStack_b0[0] & 0x1f) ^ (uint)VStack_78.y; subRng._shift1 = 3; subRng._shift2 = 1; uVar9 = uVar9 << (auStack_b0[4] & 0x1f) ^ uVar9; VStack_78.y = (float)(uVar9 >> (SUB41(VStack_70.y,0) & 0x1f) ^ uVar9); VStack_50.y = 1.96182e-44; if (VStack_78.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar9 = (uint)VStack_78.y >> 3 ^ (uint)VStack_78.y; uVar9 = uVar9 << 1 ^ uVar9; uVar9 = uVar9 >> 0xe ^ uVar9; fVar10 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 * 3.14; VStack_50.y = fVar10 + fVar10; VStack_2c.x = cos(VStack_50.y); VStack_2c.x = VStack_2c.x * 7.0; VStack_2c.y = sin(VStack_50.y); VStack_2c.y = VStack_2c.y * 7.0; pVVar8 = FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_a0 + 8),&VStack_80,0.0,0,0,0); Game::Spawn(g_game,5,10,pVVar8,&VStack_2c,entity,0,(uint)pcVar14); } VStack_60.y = (float)((int)VStack_60.y + -1); } while (VStack_60.y != 0.0); VStack_60.y = 0.0; rng._seed = uVar7; } } if (((PlayerManager *)VStack_38.y != (PlayerManager *)0x0) && (local_21 == '\0')) { uVar7 = 0; iVar13 = *(int *)(entity[3]._sprite._filename._buf + 0xc); switch(VStack_68.y) { case 2.66247e-44: if ((VStack_58.y == 0.0) && (iVar13 == 1)) goto DAT_007ff20d; break; case 6.30584e-44: DAT_007ff20d: uVar7 = 3; break; case 8.82818e-44: if ((VStack_58.y == 0.0) && (iVar13 == 0)) { uVar7 = 3; } break; case 1.10703e-43: if (((VStack_58.y == 0.0) || (VStack_58.y == 1.4013e-44)) && (iVar13 == 1)) { uVar7 = 3; } break; case 1.38729e-43: if (iVar13 == 0) { uVar7 = 3; } } uVar9 = RNG::Next(&rng); isAngelSpawnRoom = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16); if ((isAngelSpawnRoom == 0) || (uVar9 == (uVar9 / 5) * 5)) { auStack_90._0_4_ = entity->_initSeed; auStack_90._4_8_ = 0x500000003; iStack_84 = 0x16; uVar9 = RNG::Next(&rng); uVar5 = RNG::Next((RNG *)auStack_90); pVVar8 = RandomVector((Vector *)(auStack_b0 + 4),uVar5); VStack_78.y = pVVar8->y * 7.0; VStack_78.x = pVVar8->x * 7.0; pVVar8 = FindFreePickupSpawnPosition(g_game->_room,&VStack_60,&VStack_80,0.0,0,0,0); Game::Spawn(g_game,5,10,pVVar8,&VStack_78,entity,uVar7,uVar9); } uVar7 = rng._seed; } if ((*(int *)((int)local_30->_descriptor + 8) == g_game->_lastBossRoomListIdx) && (player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x24c,(RNG **)&g_game->_playerManager,1), player != (Entity_Player *)0x0)) { uVar9 = 0; VStack_70.y = 3.50325e-44; pvVar2 = g_game->_room; subRng._shift1 = 5; subRng._shift2 = 0x1b; if (*(int *)((int)pvVar2 + 0x1264) != 0) { do { VStack_68.y = *(float *)(*(int *)((int)pvVar2 + 0x125c) + uVar9 * 4); isAngelSpawnRoom = Entity::IsVulnerableEnemy((Entity *)VStack_68.y,(Entity *)0x0); if (isAngelSpawnRoom != 0) { VStack_50.y = *(float *)(*(int *)VStack_68.y + 0x20); VStack_38.y = (float)&g_game->_playerManager; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar7 = uVar7 >> ((byte)subRng._shift1 & 0x1f) ^ uVar7; uVar7 = uVar7 << ((byte)subRng._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> (SUB41(VStack_70.y,0) & 0x1f) ^ uVar7; player = PlayerManager::RandomCollectibleOwner ((PlayerManager *)VStack_38.y,0x24c,uVar7,(RNG **)0x0); EntityRef::constructor(&EStack_dc,(Entity *)player); (*(code *)VStack_50.y)(0x42c80000,0,0,&EStack_dc,0x1e); } uVar9 = uVar9 + 1; } while (uVar9 < *(uint *)((int)pvVar2 + 0x1264)); entity = bossEntity; } uVar7 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar7); Entity_Player::SetFullHearts(player); Entity_Player::FullCharge(player,-1,0,0); isAngelSpawnRoom = Entity_Player::HasCollectible(player,0x24c,0); if (((isAngelSpawnRoom != 0) && (pvVar2 = (g_manager->_itemConfig)._nullItems._begin, 0xe0 < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar2 & 0xfffffffcU))) && (pcVar14 = *(code **)((int)pvVar2 + 0xe0), pcVar14 != (code *)0x0)) { auStack_90._4_8_ = (ulonglong)*(uint *)(pcVar14 + 0x78) << 0x20; iStack_84 = 0; auStack_90._0_4_ = pcVar14; TemporaryEffects::AddEffect(&player->_temporaryeffects,auStack_90,1,1); } uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } Level::RemoveCurses((Level *)g_game,0xffffffff); Level::ShowMap((Level *)g_game); itemOverlay = &g_game->_itemOverlay; *(undefined1 *)((int)g_game->_room + 0x745c) = 1; ItemOverlay::Show(itemOverlay,5,0,(Entity_Player *)0x0); } if ((entity->_type == 0x38a) && (entity->_dead != 0)) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x222); game = g_game; iStack_20 = 0x100; subRng._seed = 0xdc; subRng._shift1 = 0x13; subRng._shift2 = 0x89; subRng._shift3 = 0x286; uVar7 = RNG::Next(&rng); uVar7 = ItemPool::GetCollectibleFromList(&game->_itemPool,&iStack_20,5,uVar7,0,0,0); if ((uVar7 == 0) || (uVar9 = RNG::RandomInt(&rng,7), uVar9 != 0)) { RNG::game_constructor(&subRng,entity->_initSeed,0x17); iVar13 = 3; do { uVar7 = RNG::Next(&rng); uVar9 = RNG::Next(&subRng); pVVar8 = RandomVector(&VStack_58,uVar9); VStack_38.y = (entity->_pos).y; VStack_38.x = (entity->_pos).x; VStack_80.y = pVVar8->y * 7.0; VStack_80.x = pVVar8->x * 7.0; Game::Spawn(g_game,5,0x28,&VStack_38,&VStack_80,entity,0,uVar7); iVar13 = iVar13 + -1; } while (iVar13 != 0); } else { VStack_80.y = (entity->_pos).y; VStack_80.x = (entity->_pos).x; FindFreePickupSpawnPosition(g_game->_room,&VStack_50,&VStack_80,0.0,0,0,0); uVar9 = RNG::Next(&rng); Game::Spawn(g_game,5,100,&VStack_50,&g_vectorZero,entity,uVar7,uVar9); pvVar2 = (g_game->_itemPool)._removedCollectibles._begin; *(uint *)((int)pvVar2 + (uVar7 >> 5) * 4) = *(uint *)((int)pvVar2 + (uVar7 >> 5) * 4) | 1 << (uVar7 & 0x1f); } } if (((*(int *)((int)local_30->_descriptor + 8) == g_game->_lastBossRoomListIdx) && (1 < g_game->_stagesWithoutDamage)) && (((g_game->_levelStateFlags & 0x20) == 0 && (isAngelSpawnRoom = Game::GetStateFlag(g_game,0x2d), isAngelSpawnRoom == 0)))) { Game::SetStateFlag(0x2d,1); RNG::game_constructor(&subRng,entity->_initSeed,0x18); uVar7 = RNG::Next(&rng); uVar9 = RNG::Next(&subRng); pVVar8 = RandomVector((Vector *)(auStack_90 + 8),uVar9); VStack_68.y = (entity->_pos).y; VStack_68.x = (entity->_pos).x; VStack_70.y = pVVar8->y * 7.0; VStack_70.x = pVVar8->x * 7.0; Game::Spawn(g_game,5,0x15e,&VStack_68,&VStack_70,entity,0x91,uVar7); } uVar6 = Entity::GetBossID(entity); FUN_0092a5e0(uVar6); if (entity->_type == 0x38c) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x1ed,1); } } goto LAB_00800032; } LAB_007ff7d4: if ((((local_30->_roomType == 6) || (local_30->field_0x7228 != '\0')) || ((local_30->_roomType == 5 && (isAngelSpawnRoom = Game::IsGreedMode(g_game), isAngelSpawnRoom != 0)))) && ((iVar13 = GetBossVictoryJingle(local_30), iVar13 != 0 && (Music::Play((Music *)&g_manager->_musicManager,iVar13, (g_manager->_optionsConfig)._musicVolume), 0x25 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60)))) { (g_manager->_musicManager)._queuedMusicID = 0x25; } if (local_21 != '\0') goto LAB_007fffcd; if ((Entity *)bossType == (Entity *)0x2e) { if (VStack_58.y != 2.8026e-45) goto LAB_007ffad3; uVar7 = RNG::Next(&rng); VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; pVVar8 = FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_90 + 8),&VStack_2c,0.0,0,0,0); Game::Spawn(g_game,5,0x15e,pVVar8,&g_vectorZero,entity,0x3d,uVar7); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x4d); bossType = (int)VStack_68.y; goto LAB_00800005; } if ((Entity *)bossType != (Entity *)0x26) { if (((Entity *)bossType != (Entity *)0x51) || (VStack_58.y != 1.4013e-45)) goto LAB_007ffad3; VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; FindFreePickupSpawnPosition(g_game->_room,&VStack_58,&VStack_2c,0.0,0,0,0); uVar7 = 0x84; isAngelSpawnRoom = ItemPool::is_collectible_available(&g_game->_itemPool,0x125,1); if ((isAngelSpawnRoom != 0) && (uVar9 = RNG::RandomInt(&rng,2), uVar9 != 0)) { uVar7 = 0x125; } uVar9 = RNG::Next(&rng); Game::Spawn(g_game,5,100,&VStack_58,&g_vectorZero,entity,uVar7,uVar9); ItemPool::RemoveCollectible(&g_game->_itemPool,uVar7,0,0); goto LAB_0080001f; } if (VStack_58.y == 2.8026e-45) { uVar7 = RNG::RandomInt(&rng,4); if (((uVar7 == 0) && (isAngelSpawnRoom = ItemPool::is_collectible_available(&g_game->_itemPool,0x261,0), isAngelSpawnRoom != 0)) && (isAngelSpawnRoom = ItemPool::RemoveCollectible(&g_game->_itemPool,0x261,0,0), isAngelSpawnRoom != 0)) { VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; FindFreePickupSpawnPosition(g_game->_room,&VStack_78,&VStack_2c,0.0,0,0,0); uVar7 = RNG::Next(&rng); uVar5 = 0x261; pVVar8 = &VStack_78; uVar9 = 100; } else { VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; FindFreePickupSpawnPosition(g_game->_room,&VStack_60,&VStack_2c,0.0,0,0,0); uVar7 = RNG::Next(&rng); uVar5 = 0; pVVar8 = &VStack_60; uVar9 = 0x1e; } Game::Spawn(g_game,5,uVar9,pVVar8,&g_vectorZero,entity,uVar5,uVar7); goto LAB_00800005; } LAB_007ffad3: uVar7 = RNG::RandomInt(&rng,4); if ((uVar7 != 0) && ((uVar7 = RNG::RandomInt(&rng,7), uVar7 != 0 || (VStack_58.y != 1.4013e-45)))) goto LAB_007ffaf7; switch(bossType) { case 0x2e: uVar7 = 0x2a; uVar9 = 0x8c; break; case 0x2f: uVar7 = 0xd; uVar9 = 0x2d; break; case 0x30: uVar7 = 0x25; uVar9 = 0x6a; break; case 0x31: uVar7 = 0xf; uVar9 = 0x81; break; case 0x32: if ((VStack_58.y == 1.4013e-45) && (((g_manager->_persistentGameData)._achievements[10] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { uVar7 = 0x4a; } else { uVar7 = 0x40; } goto code_r0x007ffbb6; case 0x33: uVar7 = (-(uint)((uint)VStack_58.y % 10 != 1) & 0xffffffb1) + 0x80; goto code_r0x007ffbb6; case 0x34: uVar7 = 0x41; uVar9 = 0x51; break; default: goto LAB_007ffaf7; } if (VStack_58.y == 1.4013e-45) { uVar7 = uVar9; } code_r0x007ffbb6: isAngelSpawnRoom = ItemPool::is_collectible_available(&g_game->_itemPool,uVar7,0); if (isAngelSpawnRoom != 0) { isAngelSpawnRoom = ItemPool::RemoveCollectible(&g_game->_itemPool,uVar7,0,0); if (isAngelSpawnRoom != 0) { VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; FindFreePickupSpawnPosition(g_game->_room,(Vector *)(auStack_b0 + 4),&VStack_2c,0.0,0,0,0); uVar9 = RNG::Next(&rng); pVVar8 = &g_vectorZero; position = (Vector *)(auStack_b0 + 4); uVar5 = 100; goto code_r0x007fffc0; } LAB_007ffaf7: if ((undefined1 *)((int)&(((Entity *)(bossType + -0x40c))->_dropRNG)._seed + 2) < &DAT_00000007) goto code_r0x007ffb03; goto LAB_007fffcd; } code_r0x007ffb03: switch((&PTR_DAT_008004c0)[(int)((int)&(((Entity *)(bossType + -0x40c))->_dropRNG)._seed + 2)]) { case (undefined *)0x7ffc4e: uVar5 = 0x46; break; case (undefined *)0x7ffc58: uVar5 = 10; code_r0x007ffe1d: auStack_a0._0_4_ = entity->_initSeed; iStack_94 = 0x1d; auStack_a0._4_4_ = 3; auStack_a0._8_4_ = 3; uVar7 = RNG::Next((RNG *)auStack_a0); pVVar8 = RandomVector((Vector *)(auStack_90 + 8),uVar7); VStack_70.y = pVVar8->y * 5.0; VStack_70.x = pVVar8->x * 5.0; uVar7 = RNG::Next(&rng); VStack_2c.x = (entity->_pos).x; VStack_2c.y = (entity->_pos).y; Game::Spawn(g_game,5,uVar5,&VStack_2c,&VStack_70,entity,0,uVar7); VStack_38.y = (float)RNG::Next(&rng); if (((uVar5 != 10) || (isAngelSpawnRoom = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x16), isAngelSpawnRoom == 0)) || (((uint)VStack_38.y & 1) == 0)) { uVar9 = RNG::Next(&rng); VStack_38.x = VStack_70.x * -1.0; VStack_68.x = (entity->_pos).x; VStack_68.y = (entity->_pos).y; uVar7 = 0; pVVar8 = &VStack_38; VStack_38.y = VStack_70.y * -1.0; position = &VStack_68; goto code_r0x007fffc0; } goto LAB_007fffcd; case (undefined *)0x7ffc62: uVar7 = entity->_initSeed; auStack_a0._4_4_ = 3; auStack_a0._8_4_ = 3; VStack_38.y = (float)&DAT_0000001d; uVar9 = RNG::RandomInt(&rng,5); VStack_60.y = (float)(uVar9 + 4); if (0 < (int)VStack_60.y) { uVar9 = rng._seed; do { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar7 = uVar7 >> (auStack_a0[4] & 0x1f) ^ uVar7; subRng._shift1 = 3; subRng._shift2 = 1; uVar7 = uVar7 << (auStack_a0[8] & 0x1f) ^ uVar7; uVar7 = uVar7 >> (SUB41(VStack_38.y,0) & 0x1f) ^ uVar7; VStack_70.y = 1.96182e-44; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar5 = uVar7 >> 3 ^ uVar7; uVar5 = uVar5 << 1 ^ uVar5; uVar5 = uVar5 >> 0xe ^ uVar5; fVar10 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10 * 3.14; VStack_50.y = fVar10 + fVar10; uVar5 = Random(); VStack_78.y = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 5.0 + 2.0; VStack_2c.x = cos(VStack_50.y); VStack_2c.x = VStack_2c.x * VStack_78.y; VStack_2c.y = sin(VStack_50.y); VStack_2c.y = VStack_2c.y * VStack_78.y; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar14 = (code *)swi(3); (*pcVar14)(); return; } uVar9 = uVar9 >> ((byte)rng._shift1 & 0x1f) ^ uVar9; uVar9 = uVar9 << ((byte)rng._shift2 & 0x1f) ^ uVar9; VStack_80.y = (entity->_pos).y; uVar9 = uVar9 >> ((byte)rng._shift3 & 0x1f) ^ uVar9; VStack_80.x = (entity->_pos).x; Game::Spawn(g_game,5,0x14,&VStack_80,&VStack_2c,entity,0,uVar9); VStack_60.y = (float)((int)VStack_60.y + -1); } while (VStack_60.y != 0.0); VStack_60.y = 0.0; bossType = (int)VStack_68.y; } goto LAB_007fffcd; case (undefined *)0x7ffe18: uVar5 = 0x28; goto code_r0x007ffe1d; case (undefined *)0x7fff34: uVar5 = 300; break; case (undefined *)0x7fff3b: uVar5 = 0x1e; break; case (undefined *)0x7fff97: uVar9 = RNG::Next(&rng); VStack_50.x = (entity->_pos).x; VStack_50.y = (entity->_pos).y; uVar7 = 3; pVVar8 = &g_vectorZero; position = &VStack_50; uVar5 = 0x28; goto code_r0x007fffc0; } VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; FindFreePickupSpawnPosition(g_game->_room,(Vector *)(auStack_a0 + 8),&VStack_2c,0.0,0,0,0); uVar9 = RNG::Next(&rng); uVar7 = 0; pVVar8 = &g_vectorZero; position = (Vector *)(auStack_a0 + 8); code_r0x007fffc0: Game::Spawn(g_game,5,uVar5,position,pVVar8,entity,uVar7,uVar9); LAB_007fffcd: if ((bossType < 0x2e) || (0x34 < bossType)) { fVar10 = VStack_58.y; if (bossType != 0x26) goto LAB_00800015; if (VStack_58.y == 2.8026e-45) goto LAB_00800005; } else if ((bossType == 0x2e) && (VStack_58.y == 2.8026e-45)) { LAB_00800005: fVar10 = VStack_58.y; FUN_0092a520(6); LAB_00800015: if (((Entity *)bossType == (Entity *)0x51) && (fVar10 == 1.4013e-45)) { LAB_0080001f: PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x8f); } } else { FUN_0092a520(bossType + -0x2e); } LAB_00800032: this = local_30; if ((g_game->_ambush)._isActive == 0) { RNG::game_constructor(&subRng,*(uint *)((int)local_30->_descriptor + 100),4); uVar7 = RNG::Next(this_00); *(uint *)((int)this->_descriptor + 100) = uVar7; } LAB_00800060: if ((entity->_type == 0x10f) || (entity->_type == 0x110)) { bVar15 = true; } else { bVar15 = false; } iVar13 = *(int *)((int)g_game->_room + 8); if (((iVar13 == 0xf) || (iVar13 == 0xd)) || (iVar13 == 8)) { isAngelSpawnRoom = true; } else { isAngelSpawnRoom = false; } if (!bVar15) { return; } if (!isAngelSpawnRoom) { return; } piVar12 = *(int **)&this->field_0x7300; node = (int *)*piVar12; if (node != piVar12) { iVar13 = 0; do { piVar1 = node + 4; node = (int *)*node; iVar11 = iVar13 + 1; if (*piVar1 != entity->_type) { iVar11 = iVar13; } iVar13 = iVar11; } while (node != piVar12); this = local_30; if (iVar11 != 0) { return; } } RNG::game_constructor(&rng,entity->_initSeed,0x1e); game = g_game; iVar13 = entity->_type; if (iVar13 == 0x10f) { isAngelSpawnRoom = Game::GetStateFlag(g_game,0x32); if (isAngelSpawnRoom == 0) { Game::SetStateFlag(0x32,1); game = g_game; *(int *)&g_game->field_0x2675c = *(int *)&g_game->field_0x2675c + 1; iVar13 = entity->_type; goto LAB_00800123; } } else { LAB_00800123: if ((iVar13 == 0x110) && (isAngelSpawnRoom = Game::GetStateFlag(game,0x33), isAngelSpawnRoom == 0)) { Game::SetStateFlag(0x33,1); game = g_game; *(int *)&g_game->field_0x2675c = *(int *)&g_game->field_0x2675c + 1; } } VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; FindFreePickupSpawnPosition(game->_room,&VStack_38,&VStack_2c,0.0,0,0,0); bStack_23 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0xee); bStack_22 = PlayerManager::AnyoneHasCollectible(&g_game->_playerManager,0xef); iVar13 = (this->_entityList)._updateEL._size; VStack_68.y = (float)((uint)extraout_var << 8); local_21 = '\0'; if (iVar13 != 0) { piVar12 = (this->_entityList)._updateEL._data; do { iVar11 = *piVar12; if ((*(int *)(iVar11 + 0x28) == 5) && (*(int *)(iVar11 + 0x2c) == 100)) { if (*(int *)(iVar11 + 0x30) == 0xee) { local_21 = '\x01'; } else { VStack_68.y = (float)((uint)VStack_68.y & 0xff); if (*(int *)(iVar11 + 0x30) == 0xef) { VStack_68.y = 1.4013e-45; } } } piVar12 = piVar12 + 1; iVar13 = iVar13 + -1; } while (iVar13 != 0); entity = bossEntity; } isAngelSpawnRoom = bStack_22; if (((bStack_23 == 0) && (local_21 == '\0')) && ((bVar4 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x7b), isAngelSpawnRoom = bStack_22, bVar4 == 0 || (bStack_22 != 0)))) { bStack_22 = '\x01'; } else { bStack_22 = '\0'; } if (((isAngelSpawnRoom == 0) && (VStack_68.y._0_1_ == '\0')) && ((isAngelSpawnRoom = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x7b), isAngelSpawnRoom == 0 || (bStack_23 != 0)))) { bStack_23 = '\x01'; } else { bStack_23 = '\0'; } if (entity->_type == 0x10f) { if (bStack_22 == '\0') { LAB_008002a5: isAngelSpawnRoom = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0x7b); game = g_game; if (isAngelSpawnRoom == 0) { uVar7 = 0; } else { uVar7 = RNG::Next(&rng); uVar7 = ItemPool::GetCollectible(&game->_itemPool,4,uVar7,0,0,0); player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x7b); if (player != (Entity_Player *)0x0) { iVar13 = Entity_Player::GetTrinketMultiplier(player,0x7b); if (iVar13 == 2) { uVar9 = RNG::Next(&rng); Game::Spawn(g_game,5,10,&VStack_38,&g_vectorZero,entity,8,uVar9); VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; pVVar8 = FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_90 + 8),&VStack_2c,0.0,0,0,0); VStack_38.x = pVVar8->x; VStack_38.y = pVVar8->y; } else if (iVar13 == 3) { uVar9 = RNG::Next(&rng); Game::Spawn(g_game,5,10,&VStack_38,&g_vectorZero,entity,3,uVar9); VStack_2c.y = (entity->_pos).y; VStack_2c.x = (entity->_pos).x; pVVar8 = FindFreePickupSpawnPosition (g_game->_room,(Vector *)(auStack_90 + 8),&VStack_2c,0.0,0,0,0); VStack_38.x = pVVar8->x; VStack_38.y = pVVar8->y; } } } if (bStack_22 == '\0') { if (bStack_23 == '\0') { if (uVar7 == 0) { return; } goto LAB_0080041c; } goto LAB_0080029b; } } uVar7 = 0xee; } else { if ((entity->_type != 0x110) || (bStack_23 == '\0')) goto LAB_008002a5; LAB_0080029b: uVar7 = 0xef; } LAB_0080041c: uVar9 = RNG::Next(&rng); Game::Spawn(g_game,5,100,&VStack_38,&g_vectorZero,entity,uVar7,uVar9); return; } //@@ 00800500 Room::update_ambient_sounds /* DB: sfxManager=Room; averages player positions, then SFXManager::SetAmbientSound x8 smoothing volumes stored at Room+0x7084..; called from Room::Update prototype: db/protos.zhl */ void __thiscall Room::update_ambient_sounds(Room *sfxManager) { byte bVar1; LayerState *layer; float *pfVar2; int iVar3; void *playerListEnd; SoundEffects *sfxManager; Game *game; PlayerManager *playerManager; int *piVar4; uint playerIdx; int iVar5; void **ppvVar6; float fVar7; float fVar8; float fVar9; float fVar10; float flyBuzzPitch; float avgPlayerVelY; float avgPlayerVelX; float sfxA3Volume; float local_6c; float portalVolume; float minecartVolume; float flyBuzzVolume; float sfx1d9Volume; int flyCount; float fireVolume; float visFattyLaserVolume; float ballAndChainVolume; float sfx217Volume; float sfx22eVolume; float dogmaVolume; float dogmaAngelVolume; float dogmaAngelPitch; float sfx264Volume; float local_24; float laserLoopVolume; float sfx1dcVolume; float local_18; float local_14; Vector playersCenter; Manager *manager; players_center_position(&g_game->_playerManager,&playersCenter,1); if (g_manager->_framecount == DAT_00c5c4d8) { avgPlayerVelX = DAT_00c94374; avgPlayerVelY = DAT_00c94378; } else { playerManager = &g_game->_playerManager; local_6c = 0.0; fVar9 = 0.0; fVar10 = 0.0; playerIdx = 0; avgPlayerVelY = 0.0; avgPlayerVelX = 0.0; fVar8 = (float)0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; fVar9 = avgPlayerVelY; fVar10 = avgPlayerVelX; } piVar4 = (playerManager->_playerList)._begin; if (playerIdx < (uint)((int)playerListEnd - (int)piVar4 >> 2)) { piVar4 = piVar4 + playerIdx; } iVar3 = *piVar4; if (*(int *)(iVar3 + 0x2c) == 0) { if (*(int *)(iVar3 + 0x13c0) == 0x23) goto LAB_0080060f; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar3 + 0x1618)), bVar1 == 0) ) { fVar9 = avgPlayerVelY; fVar10 = avgPlayerVelX; goto LAB_0080060f; } fVar10 = *(float *)(iVar3 + 0x360) + avgPlayerVelX; fVar9 = *(float *)(iVar3 + 0x364) + avgPlayerVelY; local_6c = (float)((int)local_6c + 1); avgPlayerVelY = fVar9; avgPlayerVelX = fVar10; } else { LAB_0080060f: } playerIdx = playerIdx + 1; playerManager = &g_game->_playerManager; fVar8 = local_6c; } while (playerIdx < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } DAT_00c5c4d8 = g_manager->_framecount; if ((int)fVar8 < 1) { avgPlayerVelY = g_vectorZero.y; avgPlayerVelX = g_vectorZero.x; } else { avgPlayerVelY = fVar9 / (float)(int)fVar8; avgPlayerVelX = fVar10 / (float)(int)fVar8; } } fireVolume = 0.0; flyBuzzVolume = 0.0; flyBuzzPitch = 0.0; laserLoopVolume = 0.0; visFattyLaserVolume = 0.0; sfxA3Volume = 0.0; sfx1d9Volume = 0.0; sfx1dcVolume = 0.0; local_6c = 0.0; portalVolume = 0.0; minecartVolume = 0.0; sfx217Volume = 0.0; sfx22eVolume = 0.0; dogmaAngelVolume = 0.0; dogmaAngelPitch = 0.0; dogmaVolume = 0.0; ballAndChainVolume = 0.0; sfx264Volume = 0.0; DAT_00c94374 = avgPlayerVelX; DAT_00c94378 = avgPlayerVelY; bVar1 = Game::IsPaused(g_game); if ((bVar1 != 0) && (*(int *)&g_game->_roomTransition == 0)) goto LAB_00801544; flyCount = 0; local_24 = 0.0; game = g_game; fVar8 = playersCenter.y; fVar9 = playersCenter.x; if ((sfxManager->_entityList)._updateEL._size == 0) { LAB_00801137: local_24 = 1.0; } else { do { iVar3 = *(int *)((int)(sfxManager->_entityList)._updateEL._data + (int)local_24 * 4); if (((*(int *)&game->_deathmatchManager < 2) || (iVar5 = 1, *(int *)(iVar3 + 0x28) != 1)) && (iVar5 = *(int *)(iVar3 + 0x28), 0x3dd < iVar5 - 10U)) { if (iVar5 != 7) { if (iVar5 == 1000) { if (*(int *)(iVar3 + 0x2c) == 0xa8) { fVar10 = 1.0; if (1.0 <= sfxA3Volume) { fVar10 = sfxA3Volume; } sfxA3Volume = fVar10; } else if (*(int *)(iVar3 + 0x2c) == 0xb2) { fVar10 = *(float *)(iVar3 + 0x478) * 1.6; if (fVar10 <= sfx217Volume) { fVar10 = sfx217Volume; } sfx217Volume = fVar10; } else { if (*(int *)(iVar3 + 0x2c) == 0xb4) { fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 450.0; portalVolume = fVar8 * fVar8 * 0.2 * *(float *)(iVar3 + 0xe4) + portalVolume; goto LAB_008008f0; } if (((*(int *)(iVar3 + 0x2c) == 0xab) && (*(int *)(iVar3 + 0x30) == 0)) && (*(int *)(iVar3 + 0x450) == 1)) { if (*(int *)(iVar3 + 0x7c) == 0) goto switchD_00800885_caseD_f; if (*(char *)(*(int *)(iVar3 + 0x7c) + 0x34) != '\0') { fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 2000.0; sfx22eVolume = fVar8 * fVar8 + sfx22eVolume; goto LAB_008008f0; } } if ((*(int *)(iVar3 + 0x2c) == 0xc1) && (*(int *)(iVar3 + 0x30) == 0)) { if (*(int *)(iVar3 + 0x45c) - 1U < 0x59) { local_18 = 1.0; local_14 = (float)(0x5a - *(int *)(iVar3 + 0x45c)) / 30.0; pfVar2 = &local_14; if (1.0 <= local_14) { pfVar2 = &local_18; } fVar10 = *pfVar2; if (fVar10 <= sfx264Volume) { fVar10 = sfx264Volume; } sfx264Volume = fVar10; } } } } goto switchD_00800885_caseD_f; } if (*(int *)(iVar3 + 0x2c) != 6) { if (*(int *)(iVar3 + 0x2c) != 0xf) goto switchD_00800885_caseD_f; } if (*(int *)(iVar3 + 0x458) != 0) { laserLoopVolume = 1.2; } goto LAB_00801103; } if (iVar3 == 0) goto switchD_00800885_caseD_f; if ((*(int *)&game->_deathmatchManager < 2) || (iVar5 != 1)) { if (0x3dd < iVar5 - 10U) goto switchD_00800885_caseD_f; } if (*(char *)(iVar3 + 0x173) != '\0') goto switchD_00800885_caseD_f; if (0 < *(short *)(iVar3 + 0xc74)) goto switchD_00800885_caseD_f; if (*(float *)(iVar3 + 0x39c) <= 0.0) goto switchD_00800885_caseD_f; if (0 < *(int *)(iVar3 + 0x31c)) goto switchD_00800885_caseD_f; if ((*(uint *)(iVar3 + 0x168) & 0x20) != 0 || (*(uint *)(iVar3 + 0x16c) & 0x2000000) != 0) goto switchD_00800885_caseD_f; if (iVar5 != 0x3c5) { fVar10 = ABS(*(float *)(iVar3 + 0x340) - fVar8); fVar7 = ABS(*(float *)(iVar3 + 0x33c) - fVar9); if (fVar10 <= fVar7) { fVar10 = fVar7; } if (fVar10 <= 450.0) { if (iVar5 < 0x11a) { if (iVar5 == 0x119) { switchD_00800885_caseD_d: fVar10 = *(float *)(iVar3 + 0x33c); fVar7 = *(float *)(iVar3 + 0x340); fVar9 = fVar9 - fVar10; flyCount = flyCount + 1; fVar8 = fVar8 - fVar7; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 450.0; fVar8 = fVar8 * fVar8; if (iVar5 == 0x128) { fVar8 = fVar8 * 0.05; } else { fVar8 = fVar8 * 0.35; } flyBuzzVolume = fVar8 + flyBuzzVolume; fVar10 = fVar10 - playersCenter.x; if (1.5 <= flyBuzzVolume) { flyBuzzVolume = 1.5; } fVar7 = fVar7 - playersCenter.y; fVar8 = sqrtf(fVar10 * fVar10 + fVar7 * fVar7); if (0.0 < fVar8) { fVar7 = fVar7 * (1.0 / fVar8); fVar10 = fVar10 * (1.0 / fVar8); } flyBuzzPitch = flyBuzzPitch + (fVar7 * avgPlayerVelY + fVar10 * avgPlayerVelX + 100.0) / (*(float *)(iVar3 + 0x364) * fVar7 + *(float *)(iVar3 + 0x360) * fVar10 + 100.0); game = g_game; fVar8 = playersCenter.y; fVar9 = playersCenter.x; goto LAB_00801103; } switch(iVar5) { case 0xd: case 0xe: case 0x12: case 0x19: case 0x3d: case 0x50: case 0xd6: case 0xde: case 0xf9: case 0x100: goto switchD_00800885_caseD_d; case 0x21: if (*(int *)(iVar3 + 0x188) != 0) { fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 450.0; fireVolume = fVar8 * fVar8 * 0.6 + fireVolume; goto LAB_008008f0; } } } else { if (0x364 < iVar5) goto code_r0x008009bf; if (iVar5 == 0x364) goto switchD_00800885_caseD_d; if (iVar5 < 0x329) { if ((iVar5 == 0x328) || (iVar5 == 0x128)) goto switchD_00800885_caseD_d; if (iVar5 == 0x132) { fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 450.0; portalVolume = fVar8 * fVar8 * 0.6 + portalVolume; goto LAB_008008f0; } } else if ((iVar5 == 0x333) || (iVar5 == 0x346)) goto switchD_00800885_caseD_d; } } goto switchD_00800885_caseD_f; } code_r0x008009bf: switch(iVar5) { case 0x376: if ((*(int *)(iVar3 + 0x2c) == 0) && (iVar3 = *(int *)(iVar3 + 0xbec), iVar3 != 0)) { if (*(int *)(iVar3 + 0x28) == 7) { fVar10 = *(float *)(iVar3 + 0xe4) * 0.5; if (fVar10 <= visFattyLaserVolume) { fVar10 = visFattyLaserVolume; } visFattyLaserVolume = fVar10; } goto LAB_00801103; } break; case 0x37d: if ((*(float *)(iVar3 + 0x334) != g_vectorZero.x) || (*(float *)(iVar3 + 0x338) != g_vectorZero.y)) { fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 1200.0; ballAndChainVolume = fVar8 * fVar8 * 0.4 + ballAndChainVolume; goto LAB_008008f0; } break; case 0x3b6: if (*(int *)(iVar3 + 0x2c) == 0) { fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = fVar8 - *(float *)(iVar3 + 0x340); layer = ANM2::GetLayer((ANM2 *)(iVar3 + 0x48),(byte *)0x0); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = 1.0 - fVar8 / 1500.0; fVar8 = 0.0; if (0.0 <= fVar9) { fVar8 = fVar9; } fVar9 = (layer->_color)._colorize[2]; if (1.0 <= fVar9) { fVar9 = 1.0; } dogmaVolume = fVar9 * fVar8 * fVar8 + dogmaVolume; if (dogmaVolume <= 0.02) { dogmaVolume = 0.02; } } else { if ((*(int *)(iVar3 + 0x2c) != 2) || (*(int *)(iVar3 + 0xb64) != 10)) break; fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); local_14 = *(float *)(iVar3 + 0x360); fVar9 = 1.0 - fVar8 / 450.0; fVar8 = 0.0; if (0.0 <= fVar9) { fVar8 = fVar9; } local_18 = *(float *)(iVar3 + 0x364); fVar9 = sqrtf(local_14 * local_14 + local_18 * local_18); fVar9 = fVar9 * 0.125; if (1.0 <= fVar9) { fVar9 = 1.0; } fVar10 = *(float *)(iVar3 + 0x33c) - playersCenter.x; dogmaAngelVolume = fVar9 * fVar8 * fVar8 + dogmaAngelVolume; fVar8 = *(float *)(iVar3 + 0x340) - playersCenter.y; fVar9 = sqrtf(fVar10 * fVar10 + fVar8 * fVar8); if (0.0 < fVar9) { fVar8 = fVar8 * (1.0 / fVar9); fVar10 = fVar10 * (1.0 / fVar9); } dogmaAngelPitch = (fVar8 * avgPlayerVelY + fVar10 * avgPlayerVelX + 100.0) / (local_18 * fVar8 + local_14 * fVar10 + 100.0) + dogmaAngelPitch; } goto LAB_008008f0; case 0x3b7: if ((*(int *)(iVar3 + 0x2c) == 0xb) || (*(int *)(iVar3 + 0x2c) == 0x15)) goto switchD_00800885_caseD_d; break; case 0x3c5: fVar8 = fVar8 - *(float *)(iVar3 + 0x340); fVar9 = fVar9 - *(float *)(iVar3 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = 1.0 - fVar8 / 1200.0; fVar8 = sqrtf(*(float *)(iVar3 + 0x364) * *(float *)(iVar3 + 0x364) + *(float *)(iVar3 + 0x360) * *(float *)(iVar3 + 0x360)); fVar8 = fVar8 / 30.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } minecartVolume = fVar8 * fVar9 * fVar9 + minecartVolume; LAB_008008f0: game = g_game; fVar8 = playersCenter.y; fVar9 = playersCenter.x; } switchD_00800885_caseD_f: LAB_00801103: local_24 = (float)((int)local_24 + 1); } while ((uint)local_24 < (uint)(sfxManager->_entityList)._updateEL._size); if (flyCount == 0) goto LAB_00801137; local_24 = flyBuzzPitch / (float)flyCount; } fVar8 = sin((float)game->_frameCount / 53.0); game = g_game; fVar9 = sin((float)g_game->_frameCount / 61.0); fVar10 = sin((float)game->_frameCount / 23.0); flyBuzzPitch = (fVar8 + fVar9 + fVar10) * 0.02 + local_24; if (0 < sfxManager->_numRainSpawners) { pfVar2 = (float *)&sfxManager->field_0x73f4; local_24 = (float)sfxManager->_numRainSpawners; do { fVar8 = sqrtf((pfVar2[1] - playersCenter.y) * (pfVar2[1] - playersCenter.y) + (*pfVar2 - playersCenter.x) * (*pfVar2 - playersCenter.x)); pfVar2 = pfVar2 + 6; local_24 = (float)((int)local_24 + -1); fVar8 = 1.0 - fVar8 / 900.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } sfx1d9Volume = sfxManager->_rainIntensity * fVar8 * fVar8 * 0.6 + sfx1d9Volume; } while (local_24 != 0.0); if (1.0 <= sfx1d9Volume) { sfx1d9Volume = 1.0; } } game = g_game; if (((sfxManager->_waterCurrent).x != g_vectorZero.x) || ((sfxManager->_waterCurrent).y != g_vectorZero.y)) { sfx1dcVolume = 1.0; } playerListEnd = sfxManager->_descriptor; piVar4 = *(int **)((int)playerListEnd + 0x10); if (((piVar4 == (int *)0x0) || (piVar4[2] != 0x10)) || (*piVar4 != 0x23)) { if (sfxManager->_backdropType != 0x20) goto LAB_0080141b; if (((*(uint *)((int)playerListEnd + 0x44) >> 5 & 1) != 0) && (0 < *(int *)((int)playerListEnd + 0x54))) { local_24 = (float)(sfxManager->_gridHeight * sfxManager->_gridWidth); if (0 < (int)local_24) { ppvVar6 = sfxManager->_gridEntities; do { playerListEnd = *ppvVar6; if ((playerListEnd != (void *)0x0) && (*(int *)((int)playerListEnd + 4) == 7)) { iVar3 = *(int *)((int)game->_room + 0xc); fVar8 = ((float)(*(int *)((int)playerListEnd + 0x24) / iVar3) * 40.0 + 120.0) - playersCenter.y; fVar9 = ((float)(*(int *)((int)playerListEnd + 0x24) % iVar3) * 40.0 + 40.0) - playersCenter.x; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 900.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } local_6c = fVar8 * fVar8 * 0.1 + local_6c; } ppvVar6 = ppvVar6 + 1; local_24 = (float)((int)local_24 + -1); } while (local_24 != 0.0); } local_6c = local_6c * sfxManager->_lavaIntensity; if (1.0 <= local_6c) { local_6c = 1.0; } } } else { fVar8 = 1.0 - (((sfxManager->_bottomRightPos).y - 30.0) - playersCenter.y) / 900.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } local_6c = fVar8 * fVar8 + 0.0; if (1.0 <= local_6c) { local_6c = 1.0; } LAB_0080141b: if (((sfxManager->_backdropType == 9) && ((*(uint *)((int)playerListEnd + 0x44) >> 5 & 1) != 0)) && (0 < *(int *)((int)playerListEnd + 0x54))) { local_24 = (float)(sfxManager->_gridHeight * sfxManager->_gridWidth); if (0 < (int)local_24) { ppvVar6 = sfxManager->_gridEntities; do { playerListEnd = *ppvVar6; if ((playerListEnd != (void *)0x0) && (*(int *)((int)playerListEnd + 4) == 7)) { iVar3 = *(int *)((int)game->_room + 0xc); fVar8 = ((float)(*(int *)((int)playerListEnd + 0x24) / iVar3) * 40.0 + 120.0) - playersCenter.y; fVar9 = ((float)(*(int *)((int)playerListEnd + 0x24) % iVar3) * 40.0 + 40.0) - playersCenter.x; fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar8 = 1.0 - fVar8 / 900.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } sfxA3Volume = fVar8 * fVar8 * 0.1 + sfxA3Volume; } ppvVar6 = ppvVar6 + 1; local_24 = (float)((int)local_24 + -1); } while (local_24 != 0.0); } if (1.0 <= sfxA3Volume) { sfxA3Volume = 1.0; } } } if (2.0 <= minecartVolume) { minecartVolume = 2.0; } LAB_00801544: manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x7084; if (0.5 < ABS(fVar8 - fireVolume)) { if (fireVolume <= fVar8) { fireVolume = fVar8 - 0.5; } else { fireVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x7084 = fireVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x10d,fireVolume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x7088; if (0.5 < ABS(fVar8 - flyBuzzVolume)) { if (flyBuzzVolume <= fVar8) { flyBuzzVolume = fVar8 - 0.5; } else { flyBuzzVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x7088 = flyBuzzVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,4,flyBuzzVolume,flyBuzzPitch); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x708c; if (0.5 < ABS(fVar8 - laserLoopVolume)) { if (laserLoopVolume <= fVar8) { laserLoopVolume = fVar8 - 0.5; } else { laserLoopVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x708c = laserLoopVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x117,laserLoopVolume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x7094; if (0.5 < ABS(fVar8 - visFattyLaserVolume)) { if (visFattyLaserVolume <= fVar8) { visFattyLaserVolume = fVar8 - 0.5; } else { visFattyLaserVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x7094 = visFattyLaserVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x119,visFattyLaserVolume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x7090; if (0.03 < ABS(fVar8 - sfxA3Volume)) { if (sfxA3Volume <= fVar8) { sfxA3Volume = fVar8 - 0.03; } else { sfxA3Volume = fVar8 + 0.03; } } *(float *)&sfxManager->field_0x7090 = sfxA3Volume; SFXManager::SetAmbientSound(&manager->_sfxManager,0xa3,sfxA3Volume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x7098; if (0.03 < ABS(fVar8 - sfx1d9Volume)) { if (sfx1d9Volume <= fVar8) { sfx1d9Volume = fVar8 - 0.03; } else { sfx1d9Volume = fVar8 + 0.03; } } *(float *)&sfxManager->field_0x7098 = sfx1d9Volume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x1d9,sfx1d9Volume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70a0; if (0.03 < ABS(fVar8 - sfx1dcVolume)) { if (sfx1dcVolume <= fVar8) { sfx1dcVolume = fVar8 - 0.03; } else { sfx1dcVolume = fVar8 + 0.03; } } *(float *)&sfxManager->field_0x70a0 = sfx1dcVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x1dc,sfx1dcVolume * 0.8,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x709c; if (0.03 < ABS(fVar8 - local_6c)) { if (local_6c <= fVar8) { local_6c = fVar8 - 0.03; } else { local_6c = fVar8 + 0.03; } } *(float *)&sfxManager->field_0x709c = local_6c; SFXManager::SetAmbientSound(&manager->_sfxManager,0x1e0,local_6c,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70a4; if (0.5 < ABS(fVar8 - portalVolume)) { if (portalVolume <= fVar8) { portalVolume = fVar8 - 0.5; } else { portalVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70a4 = portalVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0xa1,portalVolume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70a8; if (0.5 < ABS(fVar8 - minecartVolume)) { if (minecartVolume <= fVar8) { minecartVolume = fVar8 - 0.5; } else { minecartVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70a8 = minecartVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x1f9,minecartVolume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70bc; if (0.5 < ABS(fVar8 - ballAndChainVolume)) { if (ballAndChainVolume <= fVar8) { ballAndChainVolume = fVar8 - 0.5; } else { ballAndChainVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70bc = ballAndChainVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x244,ballAndChainVolume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70ac; if (0.5 < ABS(fVar8 - sfx217Volume)) { if (sfx217Volume <= fVar8) { sfx217Volume = fVar8 - 0.5; } else { sfx217Volume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70ac = sfx217Volume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x217,sfx217Volume,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70b0; if (0.5 < ABS(fVar8 - sfx22eVolume)) { if (sfx22eVolume <= fVar8) { sfx22eVolume = fVar8 - 0.5; } else { sfx22eVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70b0 = sfx22eVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x22e,sfx22eVolume * 1.3,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70b8; if (0.5 < ABS(fVar8 - dogmaVolume)) { if (dogmaVolume <= fVar8) { dogmaVolume = fVar8 - 0.5; } else { dogmaVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70b8 = dogmaVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x229,dogmaVolume * 1.5,1.0); manager = g_manager; fVar8 = *(float *)&sfxManager->field_0x70b4; if (0.5 < ABS(fVar8 - dogmaAngelVolume)) { if (dogmaAngelVolume <= fVar8) { dogmaAngelVolume = fVar8 - 0.5; } else { dogmaAngelVolume = fVar8 + 0.5; } } *(float *)&sfxManager->field_0x70b4 = dogmaAngelVolume; SFXManager::SetAmbientSound(&manager->_sfxManager,0x22b,dogmaAngelVolume * 1.5,dogmaAngelPitch); fVar8 = *(float *)&sfxManager->field_0x70c0; if (0.5 < ABS(fVar8 - sfx264Volume)) { if (sfx264Volume <= fVar8) { sfx264Volume = fVar8 - 0.5; } else { sfx264Volume = fVar8 + 0.5; } } sfxManager = &g_manager->_sfxManager; *(float *)&sfxManager->field_0x70c0 = sfx264Volume; SFXManager::SetAmbientSound(sfxManager,0x264,sfx264Volume,1.0); if (-1 < *(int *)&sfxManager->field_0x72fc) { iVar3 = *(int *)&sfxManager->field_0x72fc + 1; *(int *)&sfxManager->field_0x72fc = iVar3; if (iVar3 == 10) { SoundEffects::Play(&g_manager->_sfxManager,0x1cc,1.0,2,0,1.0,0.0); return; } if (10 < iVar3) { bVar1 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x1cc); if (bVar1 == 0) { *(undefined4 *)&sfxManager->field_0x72fc = 0xffffffff; } else { iVar3 = g_game->_currentRoomIdx; local_14 = (float)g_game->_startingRoomIdx; if (-1 < iVar3) { fVar8 = (float)((int)local_14 / 0xd - iVar3 / 0xd); fVar9 = (float)(((iVar3 / 0xd - (int)local_14 / 0xd) * 0xd - iVar3) + (int)local_14); sqrtf(fVar8 * fVar8 + fVar9 * fVar9); SFXManager::adjust_pan(0x1cc); return; } } } } return; } //@@ 00801ee0 Room::UpdateGreedWave /* DB: greed timer, stage 7 boss trigger */ void Room::UpdateGreedWave(void) { uint *puVar1; float *pfVar2; undefined4 uVar3; Manager *pMVar4; int iVar5; Entity_Player *pEVar6; Entity *pEVar7; Room *in_ECX; int iVar8; Game *this; int iVar9; uint uVar10; Vector local_10; this = g_game; if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { if (0 < in_ECX->_greedWaveTimer) { iVar9 = in_ECX->_greedWaveTimer + -1; in_ECX->_greedWaveTimer = iVar9; iVar8 = *(int *)&in_ECX->field_0x12c4 + in_ECX->_aliveEnemyCount; iVar5 = 0; if (0 < iVar8) { iVar5 = iVar8; } if ((iVar5 < 1) && (0x13 < iVar9)) { this->_greedLastBeatenWave = this->_greedModeWave; in_ECX->_greedWaveTimer = 0x13; } else if (iVar9 == 0) { SpawnGreedModeWave(); this = g_game; } } if ((((this->_stage == 7) && (in_ECX->_roomType == 5)) && ((this->_levelStateFlags & 0x1000U) == 0)) && (uVar10 = 0, (int)(this->_playerManager)._playerList._end - (int)(this->_playerManager)._playerList._begin >> 2 != 0)) { while( true ) { pEVar6 = Game::GetPlayer(this,uVar10); pfVar2 = &(pEVar6->_pos).y; if (*pfVar2 <= 320.0 && *pfVar2 != 320.0) break; uVar10 = uVar10 + 1; this = g_game; if ((uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2) <= uVar10) { return; } } if (pEVar6 != (Entity_Player *)0x0) { Music::Play((Music *)&g_manager->_musicManager,9,(g_manager->_optionsConfig)._musicVolume); puVar1 = (uint *)((int)in_ECX->_descriptor + 0x44); *puVar1 = *puVar1 & 0xffffffbf; g_game->_levelStateFlags = g_game->_levelStateFlags | 0x1000; if (*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 0xc) == 0) { uVar10 = Random(); local_10.x = (pEVar6->_pos).x; local_10.y = (pEVar6->_pos).y; pEVar7 = Game::SpawnEx(g_game,0x14,0,&local_10,&g_vectorZero,(Entity *)0x0,0xffffffff, uVar10,0); uVar3 = *(undefined4 *)((int)&pEVar7->_flags + 4); iVar5 = *(int *)pEVar7; *(uint *)&pEVar7->_flags = (uint)pEVar7->_flags & 0xfffffffb; *(undefined4 *)((int)&pEVar7->_flags + 4) = uVar3; (**(code **)(iVar5 + 0xc))(); } TriggerOutput(in_ECX,0); pMVar4 = g_manager; local_10.x = 2.66247e-43; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_10.x,1.0,2,0,1.0,0.0); } } } return; } //@@ 008020d0 Room::update_deaths_list /* DB: Room::Update helper: FirstCollectibleOwner(0x212 Deaths List), +0x1bb8/+0x1bbc state, picks next vulnerable enemy (not 802 Blood Puppy, follows parent chain, DoesEntityShareStatus) and marks it with effect 1000.109, spawns reward pickup 5.x at FindFreePickupSpawnPosition */ void Room::update_deaths_list(void) { EntityPtr EVar1; code *pcVar2; byte bVar3; Entity_Player *player; undefined4 *playerSlot; uint uVar4; EntityPtr rootParent; Vector *freePos; Entity *rewardPickup; Room *in_ECX; void *playersEnd; PlayerManager *playerManager; RNG rng; Vector freePosOut; Vector playerPos; Vector markerPos; uint pickupVariant; uint variantRoll; EntityPtr *local_1c; EntityPtr *local_18; Entity *local_14; Room *savedRoom; uint playerIndex; int rngShift3; int candidate; undefined1 *markedEnemyRef; EntityPtr nextParent; Room *room; EntityPtr *targetRef; savedRoom = in_ECX; player = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x212,(RNG **)&g_game->_playerManager,1); markedEnemyRef = &in_ECX->field_0x1bb8; if (player == (Entity_Player *)0x0) { in_ECX->field_0x1bbc = 1; } else if (in_ECX->field_0x1bbc == '\0') { if ((*(int *)markedEnemyRef == 0) && (uVar4 = 0, (in_ECX->_entityList)._updateEL._size != 0)) { do { EVar1 = *(EntityPtr *)((int)(in_ECX->_entityList)._updateEL._data + uVar4 * 4); bVar3 = Entity::IsVulnerableEnemy((Entity *)EVar1,(Entity *)0x0); if ((bVar3 != 0) && ((((*(uint *)((int)EVar1 + 0x168) & 0x20000000) == 0 && ((*(uint *)((int)EVar1 + 0x16c) & 0x400) == 0)) && (*(int *)((int)EVar1 + 0x28) != 0x322)))) { bVar3 = Entity::DoesEntityShareStatus((Entity *)EVar1); if ((bVar3 != 0) && (nextParent = *(EntityPtr *)((int)EVar1 + 0x3bc), *(EntityPtr *)((int)EVar1 + 0x3bc) != (EntityPtr)0x0)) { do { rootParent = nextParent; nextParent = *(EntityPtr *)((int)rootParent + 0x3bc); } while (nextParent != (EntityPtr)0x0); if (rootParent != EVar1) goto LAB_008022c4; } markedEnemyRef = &in_ECX->field_0x1bb8; candidate = *(int *)((int)(in_ECX->_entityList)._updateEL._data + uVar4 * 4); if (*(int *)markedEnemyRef != candidate) { if (*(int *)markedEnemyRef != 0) { local_18 = (EntityPtr *)markedEnemyRef; std::multiset::erase(&local_18); } *(int *)markedEnemyRef = candidate; if (candidate != 0) { std::multiset::insert(markedEnemyRef); } } uVar4 = Random(); markerPos.x = *(float *)(*(int *)markedEnemyRef + 0x33c); markerPos.y = *(float *)(*(int *)markedEnemyRef + 0x340); local_14 = Game::Spawn(g_game,1000,0x6d,&markerPos,&g_vectorZero,(Entity *)0x0,0,uVar4); EVar1 = *(EntityPtr *)markedEnemyRef; targetRef = &local_14->_target; if (local_14->_target != (EntityPtr)0x0) { local_1c = targetRef; std::multiset::erase(&local_1c); } *targetRef = EVar1; if (EVar1 != (EntityPtr)0x0) { std::multiset::insert(targetRef); } (**(code **)(*(int *)local_14 + 0xc))(); break; } LAB_008022c4: uVar4 = uVar4 + 1; } while (uVar4 < (uint)(in_ECX->_entityList)._updateEL._size); } goto LAB_0080212a; } if (*(int *)markedEnemyRef != 0) { local_1c = (EntityPtr *)markedEnemyRef; std::multiset::erase(&local_1c); *(undefined4 *)markedEnemyRef = 0; } LAB_0080212a: if (((*(byte *)((int)in_ECX->_descriptor + 0x44) & 1) != 0) && (in_ECX->field_0x1bbc == '\0')) { playerManager = &g_game->_playerManager; uVar4 = *(uint *)((int)in_ECX->_descriptor + 0x60); rng._shift1 = 1; rng._shift2 = 0x1b; rngShift3 = 0x1b; rng._shift3 = 0x1b; playerIndex = 0; rng._seed = uVar4; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playersEnd = (playerManager->_playerList)._end; if ((int)playersEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playersEnd = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (playerIndex < (uint)((int)playersEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + playerIndex; } player = (Entity_Player *)*playerSlot; if (player->_variant == 0) { bVar3 = Entity_Player::HasCollectible(player,0x212,0); room = savedRoom; if (bVar3 != 0) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rng._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)rng._shift2 & 0x1f) ^ uVar4; rng._seed = uVar4 >> ((byte)rngShift3 & 0x1f) ^ uVar4; if ((rng._seed & 3U) == 0) { Entity_Player::add_random_stat_up(player,&rng); rngShift3 = rng._shift3; in_ECX = savedRoom; uVar4 = rng._seed; } else { if (rng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } variantRoll = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; variantRoll = variantRoll << ((byte)rng._shift2 & 0x1f) ^ variantRoll; variantRoll = variantRoll >> ((byte)rngShift3 & 0x1f) ^ variantRoll; pickupVariant = *(uint *)(&DAT_00b6c9c0 + (variantRoll % 5) * 4); local_14 = (Entity *)0x0; if (pickupVariant == 0x14) { local_14 = (Entity *)0x2; } else if (pickupVariant == 10) { local_14 = (Entity *)0x3; } if ((*(float *)&savedRoom->field_0x1bc0 == g_vectorZero.x) && (*(float *)&savedRoom->field_0x1bc4 == g_vectorZero.y)) { playerPos.y = (player->_pos).y; playerPos.x = (player->_pos).x; freePos = FindFreePickupSpawnPosition(savedRoom,&freePosOut,&playerPos,40.0,0,0,0); *(float *)&room->field_0x1bc0 = freePos->x; *(float *)&room->field_0x1bc4 = freePos->y; } if (variantRoll == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = variantRoll >> ((byte)rng._shift1 & 0x1f) ^ variantRoll; uVar4 = uVar4 << ((byte)rng._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)rngShift3 & 0x1f) ^ uVar4; rng._seed = uVar4; rewardPickup = Game::Spawn(g_game,5,pickupVariant,(Vector *)&room->field_0x1bc0, &g_vectorZero,(Entity *)player,(uint)local_14,uVar4); (**(code **)(*(int *)rewardPickup + 0xc))(); in_ECX = room; } } } playerManager = &g_game->_playerManager; playerIndex = playerIndex + 1; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } in_ECX->field_0x1bbc = 1; } return; } //@@ 008024f0 Room::update_pressure_plates /* DB: ECX=Room: scans grid (+0x24, w*h) for type 0x14 GRID_PRESSURE_PLATE, counts variant 0 plates and unpressed ones (state 0), variant 9 pressed; sets Room+0x7229 = any plates; when all pressed sets descriptor Flags(+0x44) bit 2 (PressurePlatesTriggered) and morphs fireplaces (type 0x21) variant 1->0 and 3->2 in the room entity list; called once per frame from Room::Update before update_door_transitions */ void __thiscall Room::update_pressure_plates(Room *this) { uint *puVar1; void *pvVar2; bool bVar3; int iVar4; Entity_NPC *this_00; int iVar5; int iVar6; void **ppvVar7; int iVar8; uint uVar9; if ((*(uint *)((int)this->_descriptor + 0x44) >> 1 & 1) == 0) { bVar3 = false; iVar5 = this->_gridHeight * this->_gridWidth; iVar6 = 0; iVar8 = 0; if (0 < iVar5) { ppvVar7 = this->_gridEntities; iVar6 = 0; do { pvVar2 = *ppvVar7; if ((pvVar2 != (void *)0x0) && (*(int *)((int)pvVar2 + 4) == 0x14)) { if (*(int *)((int)pvVar2 + 8) == 0) { iVar6 = iVar6 + 1; iVar4 = iVar8 + 1; if (*(int *)((int)pvVar2 + 0xc) != 0) { iVar4 = iVar8; } iVar8 = iVar4; } else if ((*(int *)((int)pvVar2 + 8) == 9) && (*(int *)((int)pvVar2 + 0xc) != 0)) { bVar3 = true; } } ppvVar7 = ppvVar7 + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); } this->_hasTriggerPressurePlates = iVar6 != 0; if (((iVar6 != 0) || (bVar3)) && (iVar8 == 0)) { puVar1 = (uint *)((int)this->_descriptor + 0x44); *puVar1 = *puVar1 | 2; uVar9 = 0; if ((this->_entityList)._updateEL._size != 0) { do { iVar8 = *(int *)((int)(this->_entityList)._updateEL._data + uVar9 * 4); if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar8 + 0x28) == 1)) || (*(int *)(iVar8 + 0x28) - 10U < 0x3de)) && (this_00 = (Entity_NPC *) __RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), this_00->_type == 0x21)) { iVar8 = this_00->_variant; if (iVar8 == 1) { Entity_NPC::Morph(this_00,0x21,0,this_00->_subtype,-1); this_00->_state = 0; (**(code **)(*(int *)this_00 + 0xc))(); iVar8 = this_00->_variant; } if (iVar8 == 3) { Entity_NPC::Morph(this_00,this_00->_type,2,this_00->_subtype,-1); this_00->_state = 0; (**(code **)(*(int *)this_00 + 0xc))(); } } uVar9 = uVar9 + 1; } while (uVar9 < (uint)(this->_entityList)._updateEL._size); } } } return; } //@@ 00802670 Room::update_door_targets /* DB: MakeDoor for each slot bit, set target room idx + room types */ void Room::update_door_targets(void) { GridEntity_Door *this; int idx; int TargetRoomType; RoomDescriptor *pRVar1; Room *in_ECX; uint slot; int iVar2; slot = 0; iVar2 = 0x1c; do { if ((*(uint *)((int)in_ECX->_descriptor + (slot >> 5) * 4 + 0x18) & 1 << ((byte)slot & 0x1f)) != 0) { MakeDoor(in_ECX,slot); this = *(GridEntity_Door **)((int)in_ECX->_gridEntities + iVar2 + 0x6e4); idx = *(int *)(iVar2 + (int)in_ECX->_descriptor); if (-1 < idx) { pRVar1 = Level::GetRoomByIdx((Level *)g_game,idx,-1); if ((pRVar1->Data != (void *)0x0) && (this != (GridEntity_Door *)0x0)) { pRVar1 = Level::GetRoomByIdx((Level *)g_game,idx,-1); TargetRoomType = *(int *)((int)pRVar1->Data + 8); this->_targetRoomIdx = idx; GridEntity_Door::SetRoomTypes (this,*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 8),TargetRoomType); this->_slot = slot; } } } iVar2 = iVar2 + 4; slot = slot + 1; } while (iVar2 < 0x3c); Game::UpdateVisibility(g_game); return; } //@@ 00802740 random_position_away_from_players /* DB: ? EDX=center, XMM3=start radius, XMM2=clearance: up to 20 random points on a growing ring (+16/+4) that are on non-colliding grid tiles and farther than clearance+20 from every player, else the center; result in ECX; several times from Room::Update when spawning pickups */ float * random_position_away_from_players(void) { Room *this; uint uVar1; int *piVar2; float *in_ECX; int iVar3; void *pvVar4; float *in_EDX; Game *pGVar5; int iVar6; PlayerManager *pPVar7; float fVar8; float fVar9; float fVar10; float fVar11; float in_XMM2_Da; float in_XMM3_Da; float local_24; uint local_20; local_20 = 0; local_24 = in_XMM3_Da; do { uVar1 = Random(); fVar8 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar8 = fVar8 + fVar8; fVar9 = cos(fVar8); fVar9 = fVar9 * local_24 + *in_EDX; fVar8 = sin(fVar8); fVar8 = fVar8 * local_24 + in_EDX[1]; if (local_20 == 0) { local_24 = local_24 + 16.0; LAB_00802802: local_24 = local_24 + 4.0; } else if ((local_20 & 3) == 0) goto LAB_00802802; this = g_game->_room; iVar6 = (int)((fVar9 - 40.0) / 40.0 + 0.5); iVar3 = (int)((fVar8 - 120.0) / 40.0 + 0.5); if ((((iVar6 < 0) || (this->_gridWidth <= iVar6)) || (iVar3 < 0)) || (this->_gridHeight <= iVar3)) { iVar6 = -1; } else { iVar6 = this->_gridWidth * iVar3 + iVar6; } uVar1 = Room::GetGridCollision(this,iVar6); if (uVar1 != 0) break; uVar1 = 0; pPVar7 = &g_game->_playerManager; pGVar5 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar7->_playerList)._begin >> 2 == 0 ) { LAB_00802926: *in_ECX = fVar9; in_ECX[1] = fVar8; return in_ECX; } while( true ) { pvVar4 = (pPVar7->_playerList)._end; if ((int)pvVar4 - (int)(pPVar7->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (pPVar7->_playerList)._end; pGVar5 = g_game; } piVar2 = (pPVar7->_playerList)._begin; if (uVar1 < (uint)((int)pvVar4 - (int)piVar2 >> 2)) { piVar2 = piVar2 + uVar1; } fVar11 = fVar9 - *(float *)(*piVar2 + 0x33c); fVar10 = fVar8 - *(float *)(*piVar2 + 0x340); if (fVar10 * fVar10 + fVar11 * fVar11 <= (in_XMM2_Da + 20.0) * (in_XMM2_Da + 20.0)) break; pPVar7 = &pGVar5->_playerManager; uVar1 = uVar1 + 1; if ((uint)((int)(pGVar5->_playerManager)._playerList._end - (int)(pPVar7->_playerList)._begin >> 2) <= uVar1) goto LAB_00802926; } local_20 = local_20 + 1; } while (local_20 < 0x14); fVar8 = in_EDX[1]; *in_ECX = *in_EDX; in_ECX[1] = fVar8; return in_ECX; } //@@ 00802980 Room::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Room:Update */ void Room::Update(void) { uint *puVar1; std_vector *psVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; GridEntity_Door *this; code *pcVar11; ColorMod color; RNG rng; qword qVar12; float fVar13; Manager *pMVar14; Level *this_00; RNG *pRVar15; byte bVar16; char cVar17; Entity_Player *pEVar18; int iVar19; float fVar20; uint uVar21; Entity_Pickup *pEVar22; uint uVar23; Game *pGVar24; Vector *pVVar25; void *pvVar26; byte *pbVar27; Vector *position; std_vector *psVar28; int *piVar29; GridEntity_Pit *this_01; Entity_NPC *this_02; undefined1 *puVar30; short sVar31; Level *in_ECX; void *pvVar32; byte *pbVar33; undefined4 uVar34; Entity *pEVar35; int iVar36; qword *pqVar37; int iVar38; undefined4 *puVar39; float *pfVar40; void **ppvVar41; PlayerManager *pPVar42; int *piVar43; float *pfVar44; EntityPtr EVar45; bool bVar46; Game *pGVar47; float fVar48; Color aCStackY_2148 [128]; undefined4 in_stack_fffff4f4; uint in_stack_fffff4f8; Entity *in_stack_fffff4fc; Vector *in_stack_fffff500; byte isAllowPits; byte isAvoidDoors; EntityRef slowSource; undefined1 local_a90 [12]; void *local_a84; undefined8 local_a7c; undefined4 local_a74; undefined1 local_a70 [16]; Vector local_a60; undefined1 local_a58 [24]; Vector local_a40; Vector local_a38; Vector local_a30; Vector local_a28; Vector local_a20; Vector local_a18; void *local_a10; float *local_a0c; float *local_a08; Vector local_a04; undefined1 local_9f8 [20]; float *local_9e4; Vector local_9e0; char local_9d5; Vector local_9d4; Level *local_9cc; Vector local_9c8; RNG *local_9c0; Game *local_9bc; std_vector local_9b8; ItemPool *local_9ac; Entity *local_9a8; Game *local_9a4; Game *local_9a0; Entity *local_99c; int gridOccupied [448]; int pairOffsets [3]; int aiStack_28c [2]; void *pvStack_284; void *pvStack_280; void *pvStack_27c; float local_278; undefined4 uStack_274; EntitySaveState EStack_270; int iStack_26c; int local_268; int iStack_264; int iStack_260; int iStack_25c; int local_258; int iStack_254; undefined4 uStack_250; undefined4 uStack_24c; undefined4 local_248; char acStack_244 [48]; void *pvStack_214; void *pvStack_210; void *pvStack_20c; void *local_208; float fStack_204; undefined4 uStack_200; int iStack_1fc; int cornerTopLeft; int cornerTopRight; int cornerBottomLeft; int cornerBottomRight; int local_1e8 [113]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; pGVar24 = g_game; puStack_20 = (undefined1 *)(local_1e8 + 0x79); local_14 = -NAN; puStack_18 = &LAB_00b014a8; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_1e8 + 0x76); ExceptionList = &local_1c; iVar19 = in_ECX->_stage; *(undefined1 *)&in_ECX->_roomList[0x9e].SavedEntities._capacity = 0; pMVar14 = g_manager; local_9cc = in_ECX; piVar29 = local_1e8 + 0x79; if ((char)iVar19 != '\0') { piVar29 = local_1e8 + 0x79; if (pGVar24->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c == 1) { piVar29 = local_1e8 + 0x79; if (*(int *)&in_ECX->field_0x8 == 5) { piVar29 = local_1e8 + 0x79; if (*(int *)(in_ECX->_stageType + 0x40) == 1) { if ((((pGVar24->_difficulty == 2) || (pGVar24->_difficulty == 3)) && (pGVar24->_stage == 7)) && (*(int *)(*(int *)(in_ECX->_stageType + 0x10) + 0x10) == 0) ) { piVar29 = local_1e8 + 0x79; if ((pGVar24->_levelStateFlags & 0x1000U) == 0) goto LAB_00802a8d; } piVar29 = local_1e8 + 0x79; if (in_ECX->_roomList[0x26].GreedSubType != 0) { local_9b8._capacity = (Entity *)0xbe; seed_fart_sound_override((int *)&local_9b8._capacity); in_stack_fffff500 = (Vector *)0x3f800000; in_stack_fffff4f8 = 0x802a87; in_stack_fffff4fc = local_9b8._capacity; SoundEffects::Play(&pMVar14->_sfxManager,(int)local_9b8._capacity,1.0,2,0,1.0,0.0); pGVar24 = g_game; piVar29 = (int *)puStack_20; } } } LAB_00802a8d: puStack_20 = (undefined1 *)piVar29; piVar29 = (int *)puStack_20; if ((pGVar24->_levelStateFlags & 0x80000U) == 0) { pGVar24->_levelStateFlags = pGVar24->_levelStateFlags | 0x80000; iVar19 = in_ECX->_curses; iVar36 = *(int *)&in_ECX->_isHeartPicked; if ((iVar19 < 2) || (iVar36 < 2)) { cornerTopLeft = -1; } else { cornerTopLeft = iVar19 + 1; } local_9a4 = (Game *)(iVar19 + -2); if ((((int)local_9a4 < 0) || (iVar19 <= (int)local_9a4)) || (iVar36 < 2)) { cornerTopRight = -1; if (1 < in_ECX->_curses) goto LAB_00802b01; LAB_00802b10: cornerBottomLeft = -1; } else { cornerTopRight = iVar19 + (int)local_9a4; LAB_00802b01: iVar19 = iVar36 + -2; if ((iVar19 < 0) || (iVar36 <= iVar19)) goto LAB_00802b10; cornerBottomLeft = iVar19 * in_ECX->_curses + 1; } iVar19 = iVar36 + -2; if (((((int)local_9a4 < 0) || (iVar38 = in_ECX->_curses, iVar38 <= (int)local_9a4)) || (iVar19 < 0)) || (iVar36 <= iVar19)) { cornerBottomRight = -1; } else { cornerBottomRight = iVar19 * iVar38 + iVar38 + -2; } if ((pGVar24->_myosotisPickups)._begin != (pGVar24->_myosotisPickups)._end) { FUN_00752830(); local_14 = 0.0; pEVar18 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x89); pfVar40 = (float *)&DAT_00000004; if (pEVar18 != (Entity_Player *)0x0) { iVar19 = Entity_Player::GetTrinketMultiplier(pEVar18,0x89); if (iVar19 == 2) { pfVar40 = (float *)&DAT_00000006; } else if (iVar19 == 3) { pfVar40 = (float *)&DAT_00000008; } } local_a7c = 0x900000001; local_9b8._end = (void *)(((int)local_a0c - (int)local_a10) / 0x78); if (pfVar40 < local_9b8._end) { local_9b8._end = pfVar40; } local_9a4 = (Game *)0x0; local_9bc = (Game *)&DAT_0000001d; local_a74 = 0x1d; if (0 < (int)local_9b8._end) { local_99c = (Entity *)0x0; local_9a8 = *(Entity **)(in_ECX->_stageType + 0x58); do { fVar20 = (float)((int)local_9b8._end - (int)local_9a4); if (local_9a8 == (Entity *)0x0) { local_9a8 = (Entity *)fVar20; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar21 = (uint)local_9a8 >> ((byte)local_a7c & 0x1f) ^ (uint)local_9a8; uVar21 = uVar21 << (SUB81(local_a7c,4) & 0x1f) ^ uVar21; local_9c0 = (RNG *)(uVar21 >> ((byte)local_9bc & 0x1f) ^ uVar21); uVar21 = 0; if (fVar20 != 0.0) { uVar21 = (uint)local_9c0 % (uint)fVar20; } local_9a8 = (Entity *)fVar20; if ((Game *)(uVar21 + (int)local_9a4) != local_9a4) { EntitySaveState::copy (&EStack_270, (void *)((int)local_a10 + (int)(&local_99c->_sprite + -1) + 0xcc)); local_14._0_1_ = 1; FUN_004d3230(); FUN_004d3230(); local_14 = (float)((uint)local_14._1_3_ << 8); invoke_pending_callbacks(&EStack_270); in_ECX = local_9cc; } local_9b8._begin = (void *)((int)local_a10 + (int)local_99c); if (local_9c0 == (RNG *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar21 = (uint)local_9c0 >> ((byte)local_a7c & 0x1f) ^ (uint)local_9c0; uVar21 = uVar21 << (SUB81(local_a7c,4) & 0x1f) ^ uVar21; local_9a8 = (Entity *)(uVar21 >> ((byte)local_9bc & 0x1f) ^ uVar21); uVar21 = ((Game *)local_9b8._begin)->_roomList[0]._doors[1]; uVar23._0_1_ = ((Game *)local_9b8._begin)->_bossChallenge; uVar23._1_1_ = ((Game *)local_9b8._begin)->_devilRoomDisabled; uVar23._2_2_ = *(undefined2 *)&((Game *)local_9b8._begin)->field_0xa; local_a38.x = (float)(local_1e8[((uint)local_9a8 & 3) - 4] % in_ECX->_curses) * 40.0 + 40.0; local_a38.y = (float)(local_1e8[((uint)local_9a8 & 3) - 4] / in_ECX->_curses) * 40.0 + 120.0; in_stack_fffff500 = FindFreePickupSpawnPosition((Room *)local_9cc,&local_a60,&local_a38,24.0,0,0,0); pvVar32 = local_9b8._begin; in_stack_fffff4fc = *(Entity **)((int)local_9b8._begin + 4); in_stack_fffff4f8 = *(uint *)local_9b8._begin; in_stack_fffff4f4 = 0x802dc9; pEVar22 = (Entity_Pickup *) Game::Spawn(g_game,in_stack_fffff4f8,(uint)in_stack_fffff4fc, in_stack_fffff500,&g_vectorZero,(Entity *)0x0,uVar23,uVar21); in_ECX = local_9cc; Entity_Pickup::RestoreState((Room *)local_9cc,pEVar22,pvVar32); local_99c = (Entity *)&(local_99c->_sprite)._animState; local_9a4 = (Game *)((int)local_9a4 + 1); pEVar22->_spawnGridIndex = -1; } while ((int)local_9a4 < (int)local_9b8._end); } local_14 = -NAN; std::vector::_Tidy(); pGVar24 = g_game; piVar29 = (int *)puStack_20; } } } } puStack_20 = (undefined1 *)piVar29; iVar19 = in_ECX->_roomList[0xa6].GridIndex; if (-1 < iVar19) { if ((iVar19 == 0) && (pGVar24->_currentRoomIdx == -0xc)) { pEVar18 = Game::GetPlayer(pGVar24,0); pvVar32 = (pEVar18->_collectibleRNGs)._end; if ((int)pvVar32 - (int)(pEVar18->_collectibleRNGs)._begin >> 4 < 0x26f) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); pvVar32 = (pEVar18->_collectibleRNGs)._end; } pvVar26 = (pEVar18->_collectibleRNGs)._begin; uVar23 = ((int)pvVar32 - (int)pvVar26 >> 4) - 1; uVar21 = 0x26e; if (uVar23 < 0x26e) { uVar21 = uVar23; } local_9c0 = (RNG *)(uVar21 * 0x10 + (int)pvVar26); local_9bc = g_game; local_9a8 = (Entity *)RNG::Next(local_9c0); pvVar32 = (void *)0x0; pGVar24 = (Game *)0x0; local_9f8._12_4_ = (void *)0x0; pfVar40 = (float *)0x0; local_9a0 = (Game *)0x0; local_9f8._16_4_ = (float *)0x0; local_9e4 = (float *)0x0; local_14 = 2.8026e-45; local_9d5 = '\0'; fVar20 = 0.0; local_99c = (Entity *)&local_9bc->field_0x1af30; do { if (0 < *(short *)local_99c) { local_9a4 = (Game *)(int)*(short *)local_99c; uVar23 = (int)pfVar40 - (int)pvVar32 >> 3; uVar21 = 0; if (uVar23 != 0) { do { if (*(float *)((int)pvVar32 + uVar21 * 8) == fVar20) { piVar29 = (int *)((int)pvVar32 + uVar21 * 8 + 4); *piVar29 = (int)(*piVar29 + (int)local_9a4); if (*piVar29 < 0) { *(undefined4 *)((int)pvVar32 + uVar21 * 8 + 4) = 0; } goto LAB_00802f53; } uVar21 = uVar21 + 1; } while (uVar21 < uVar23); } if ((int)local_9a4 < 1) { LAB_00802f53: } else { local_a30.x = fVar20; local_a30.y = (float)local_9a4; if ((Game *)pfVar40 != local_9a0) { *pfVar40 = fVar20; pfVar40[1] = (float)local_9a4; pfVar40 = pfVar40 + 2; local_9f8._16_4_ = pfVar40; goto LAB_00802f53; } std::vector<8byte>::_Emplace_reallocate(); local_9a0 = (Game *)local_9e4; pvVar32 = (void *)local_9f8._12_4_; pfVar40 = (float *)local_9f8._16_4_; } local_9d5 = '\x01'; pGVar24 = local_9a0; } in_ECX = local_9cc; fVar20 = (float)((int)fVar20 + 1); local_99c = (Entity *)&local_99c->field_0x2; } while ((uint)fVar20 < 0x1f); if (local_9d5 == '\0') { local_14 = -NAN; if (pvVar32 == (void *)0x0) goto LAB_008030f1; uVar21 = ((int)pGVar24 - (int)pvVar32 >> 3) * 8; pvVar26 = pvVar32; if (0xfff < uVar21) { pvVar26 = *(void **)((int)pvVar32 + -4); uVar21 = uVar21 + 0x23; if (0x1f < (uint)((int)pvVar32 + (-4 - (int)pvVar26))) goto LAB_008030be; } operator_delete(pvVar26,uVar21); local_9f8._12_4_ = (void *)0x0; local_9f8._16_4_ = (float *)0x0; local_9e4 = (float *)0x0; in_ECX->_roomList[0xa6].GridIndex = 0x3c; } else { in_stack_fffff500 = (Vector *)0x803072; rng._shift1 = 5; rng._seed = (int)local_9a8; rng._shift2 = 9; rng._shift3 = 7; pEVar35 = (Entity *) WeightedOutcomePicker::PickOutcome((WeightedOutcomePicker *)(local_9f8 + 0xc),rng) ; *(short *)((int)(&local_9bc->_itemPool + 1) + (int)pEVar35 * 2 + 0x4c) = *(short *)((int)(&local_9bc->_itemPool + 1) + (int)pEVar35 * 2 + 0x4c) + -1; local_14 = -NAN; local_9a8 = pEVar35; if ((void *)local_9f8._12_4_ != (void *)0x0) { uVar21 = (int)local_9e4 - local_9f8._12_4_ & 0xfffffff8; pvVar32 = (void *)local_9f8._12_4_; if (0xfff < uVar21) { pvVar32 = *(void **)(local_9f8._12_4_ + -4); uVar21 = uVar21 + 0x23; if (0x1f < (uint)(local_9f8._12_4_ + (-4 - (int)pvVar32))) { LAB_008030be: local_14 = -NAN; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar32,uVar21); local_9f8._12_4_ = (void *)0x0; local_9f8._16_4_ = (float *)0x0; local_9e4 = (float *)0x0; } if (pEVar35 == (Entity *)0xffffffff) { LAB_008030f1: in_ECX->_roomList[0xa6].GridIndex = 0x3c; } else { iVar19 = in_ECX->_stageType; local_99c = (Entity *)0x0; if (*(short *)(*(int *)(iVar19 + 0x10) + 0x44) != 0) { local_9a4 = (Game *)0x0; do { pRVar15 = local_9c0; local_9bc = (Game *)(*(int *)(*(int *)(iVar19 + 0x10) + 0x40) + (int)local_9a4); if (((local_9bc->_bossChallenge == 1) && (piVar29 = (int *)local_9bc->_stageType, *piVar29 == 5)) && (((short)piVar29[1] == 100 && (*(short *)((int)piVar29 + 6) == 0)))) { iVar19 = (short)local_9bc->_stage + 1 + (*(short *)((int)&local_9bc->_stage + 2) + 1) * in_ECX->_curses; local_9ac = &g_game->_itemPool; uVar21 = local_9c0->_seed; local_a04.x = (float)(iVar19 % in_ECX->_curses) * 40.0 + 40.0; local_a04.y = (float)(iVar19 / in_ECX->_curses) * 40.0 + 120.0; if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar21 = pRVar15->_seed; if (uVar21 == 0) { pcVar11 = (code *)swi(3); (*pcVar11)(); return; } } uVar21 = uVar21 >> ((byte)pRVar15->_shift1 & 0x1f) ^ uVar21; uVar21 = uVar21 << ((byte)pRVar15->_shift2 & 0x1f) ^ uVar21; uVar21 = uVar21 >> ((byte)pRVar15->_shift3 & 0x1f) ^ uVar21; pRVar15->_seed = uVar21; local_9ac = (ItemPool *) ItemPool::GetCollectible(local_9ac,(int)local_9a8,uVar21,0,0,0); uVar21 = pRVar15->_seed; if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar21 = pRVar15->_seed; if (uVar21 == 0) { pcVar11 = (code *)swi(3); (*pcVar11)(); return; } } pGVar24 = g_game; uVar21 = uVar21 >> ((byte)pRVar15->_shift1 & 0x1f) ^ uVar21; uVar21 = uVar21 << ((byte)pRVar15->_shift2 & 0x1f) ^ uVar21; uVar21 = uVar21 >> ((byte)pRVar15->_shift3 & 0x1f) ^ uVar21; pRVar15->_seed = uVar21; in_stack_fffff500 = &local_a04; in_stack_fffff4fc = (Entity *)0x64; in_stack_fffff4f8 = 5; in_stack_fffff4f4 = 0x803273; pEVar35 = Game::Spawn(pGVar24,5,100,in_stack_fffff500,&g_vectorZero,(Entity *)0x0, (uint)local_9ac,uVar21); if ((pEVar35 == (Entity *)0x0) || (pEVar35->_type != 5)) { pEVar35 = (Entity *)0x0; } sVar31 = *(short *)((int)&local_9bc->_stage + 2); iVar36 = local_9bc->_stage; iVar19 = in_ECX->_curses; *(uint *)&pEVar35->_flags = (uint)pEVar35->_flags | 0x40000; pEVar35->_spawnGridIndex = (short)iVar36 + 1 + (sVar31 + 1) * iVar19; *(undefined4 *)((int)&pEVar35->_flags + 4) = *(undefined4 *)((int)&pEVar35->_flags + 4); if (((char)in_ECX->_stage != '\0') && (4 < g_game->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c)) { uVar21 = Random(); in_stack_fffff500 = &local_a04; in_stack_fffff4fc = (Entity *)&DAT_0000000f; in_stack_fffff4f8 = 1000; in_stack_fffff4f4 = 0x8032f5; Game::Spawn(g_game,1000,0xf,in_stack_fffff500,&g_vectorZero,(Entity *)0x0,0,uVar21 ); } } iVar19 = in_ECX->_stageType; local_9a4 = (Game *)((int)local_9a4 + 0x10); local_99c = (Entity *)&local_99c->field_0x1; } while (local_99c < (undefined1 *)(uint)*(ushort *)(*(int *)(iVar19 + 0x10) + 0x44)); } } } } in_ECX->_roomList[0xa6].GridIndex = in_ECX->_roomList[0xa6].GridIndex + -1; } pEVar18 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x28d,(RNG **)&g_game->_playerManager,1); *(bool *)&in_ECX->_roomList[0xa6].SafeGridIndex = pEVar18 != (Entity_Player *)0x0; bVar16 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&in_ECX->_roomList[0x9f].Group,0x2a5); pMVar14 = g_manager; if (bVar16 != 0) { fVar20 = time_scale_update((Room *)in_ECX); (pMVar14->_musicManager)._targetPitch = fVar20; } if (*(char *)((int)&in_ECX->_roomList[0xa0].Dimension + 1) == '\0') { for (piVar29 = (int *)in_ECX->_roomList[0xa0].GridIndex; piVar29 != (int *)in_ECX->_roomList[0xa0].SafeGridIndex; piVar29 = piVar29 + 4) { if ((*(int *)*piVar29 == 0) && (((int *)*piVar29)[1] == 0x40)) { Game::start_poop_cloud_screen_effect ((Game *)&in_ECX->_roomList[0x1e].SavedEntities,(ColorMod *)&DAT_00c5d108); break; } } } if (*(int *)in_ECX->_stageType == -0x14) { in_stack_fffff500 = (Vector *)0x3e8; in_stack_fffff4fc = (Entity *)local_a90; in_stack_fffff4f8 = 0x8033e4; EntityList::QuerySublist ((EntityList *)&in_ECX->_roomList[0x19].Dimension,(EntityList_EL *)in_stack_fffff4fc, 1000,0xa1,-1,0,0); local_14 = 4.2039e-45; if (local_a84 == (void *)0x0) { isAvoidDoors = 0; isAllowPits = 0; bVar16 = 1; fVar20 = 40.0; pVVar25 = GetCenterPos((Vector *)(local_a70 + 8)); FindFreePickupSpawnPosition ((Room *)in_ECX,&local_a18,pVVar25,fVar20,bVar16,isAllowPits,isAvoidDoors); uVar21 = Random(); in_stack_fffff500 = &local_a18; in_stack_fffff4fc = (Entity *)0xa1; in_stack_fffff4f8 = 1000; in_stack_fffff4f4 = 0x803455; Game::Spawn(g_game,1000,0xa1,in_stack_fffff500,&g_vectorZero,(Entity *)0x0, g_game->_lastRoomIdx + 1000,uVar21); } else { *(int *)(*(int *)local_a90._4_4_ + 0x30) = g_game->_lastRoomIdx + 1000; } if ((*(char *)((int)&in_ECX->_stage + 1) != '\0') && (*(int *)&in_ECX->_roomList[0x18].field_0x9c == g_game->_frameCount)) { uVar21 = *(uint *)(in_ECX->_stageType + 0x5c); local_9a4 = (Game *)&DAT_00000007; local_9f8._8_4_ = &DAT_00000007; local_9f8._0_4_ = (void *)0x5; local_9f8._4_4_ = (void *)0x9; FindFreePickupSpawnPosition((Room *)in_ECX,&local_9e0,(Vector *)in_ECX->_roomList,0.0,1,0,0); if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar21 = uVar21 >> (local_9f8[0] & 0x1f) ^ uVar21; uVar21 = uVar21 << (local_9f8[4] & 0x1f) ^ uVar21; uVar21 = uVar21 >> ((byte)local_9a4 & 0x1f) ^ uVar21; uVar23 = uVar21 % 100; local_9a0 = (Game *)0x32; if (uVar23 < 4) { local_9a0 = (Game *)0x35; } else if (uVar23 < 9) { local_9a0 = (Game *)0x34; } else if (uVar23 < 0x13) { local_9a0 = (Game *)&DAT_00000033; } else if (uVar23 < 0x1d) { local_9a0 = (Game *)0x168; } else if (uVar23 < 0x36) { local_9a0 = (Game *)&DAT_0000003c; } uVar23 = Random(); in_stack_fffff4f4 = 0x8035a6; Game::Spawn(g_game,5,(uint)local_9a0,&local_9e0,&g_vectorZero,(Entity *)0x0,1,uVar23); in_stack_fffff500 = &local_a28; local_a28.x = (float)in_ECX->_roomList[0].ListIndex + 0.0; local_a28.y = (float)in_ECX->_roomList[0].Dimension + 32.0; in_stack_fffff4fc = (Entity *)local_a70; in_stack_fffff4f8 = 0x8035f2; pVVar25 = FindFreePickupSpawnPosition ((Room *)in_ECX,(Vector *)in_stack_fffff4fc,in_stack_fffff500,0.0,1,0,0); local_9e0.x = pVVar25->x; local_9e0.y = pVVar25->y; if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar21 = uVar21 >> (local_9f8[0] & 0x1f) ^ uVar21; uVar21 = uVar21 << (local_9f8[4] & 0x1f) ^ uVar21; pEVar35 = (Entity *)(uVar21 >> ((byte)local_9a4 & 0x1f) ^ uVar21); uVar21 = (uint)pEVar35 % 100; local_9a8 = pEVar35; if (uVar21 < 0x19) { uVar21 = Random(); uVar23 = 0x31; LAB_0080366d: in_stack_fffff4fc = (Entity *)0x12c; LAB_0080377c: in_stack_fffff500 = &local_9e0; in_stack_fffff4f8 = 5; in_stack_fffff4f4 = 0x803789; Game::Spawn(g_game,5,(uint)in_stack_fffff4fc,in_stack_fffff500,&g_vectorZero,(Entity *)0x0, uVar23,uVar21); } else if (uVar21 < 0x32) { if (((g_manager->_persistentGameData)._achievements[0x168] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { uVar21 = Random(); uVar23 = 0x7a; in_stack_fffff4fc = (Entity *)0x15e; goto LAB_0080377c; } } else if (uVar21 < 0x3c) { if (((g_manager->_persistentGameData)._achievements[0x273] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { uVar21 = Random(); uVar23 = 0x5a; goto LAB_0080366d; } } else if ((uVar21 < 0x3d) && (((g_manager->_persistentGameData)._achievements[0x16e] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { uVar21 = Random(); uVar23 = 0x20b; in_stack_fffff4fc = (Entity *)0x64; goto LAB_0080377c; } if (pEVar35 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar21 = (uint)pEVar35 >> (local_9f8[0] & 0x1f) ^ (uint)pEVar35; uVar21 = uVar21 << (local_9f8[4] & 0x1f) ^ uVar21; if (((uVar21 >> ((byte)local_9a4 & 0x1f) ^ uVar21) & 3) == 0) { local_a40.y = (float)in_ECX->_roomList[0].Dimension; local_a40.x = (float)in_ECX->_roomList[0].GridIndex; FindFreePickupSpawnPosition ((Room *)in_ECX,(Vector *)(local_a58 + 0x10),&local_a40,0.0,1,0,0); uVar21 = Random(); in_stack_fffff500 = (Vector *)(local_a58 + 0x10); in_stack_fffff4fc = (Entity *)0x5a; in_stack_fffff4f8 = 5; in_stack_fffff4f4 = 0x803822; Game::Spawn(g_game,5,0x5a,in_stack_fffff500,&g_vectorZero,(Entity *)0x0,0,uVar21); } } local_14 = -NAN; if (local_a90[0] == '\0') { local_14 = 5.60519e-45; tracked_alloc(1,(void *)local_a90._4_4_,0); local_14 = -NAN; } } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c82670) && (_Init_thread_header(), DAT_00c82670 == -1)) { _atexit(FUN_00b16550); _Init_thread_footer(); } if (DAT_00c82674 != DAT_00c82678) { DAT_00c82678 = DAT_00c82674; } if (((char)in_ECX->_stage != '\0') && (g_game->_frameCount == *(int *)&in_ECX->_roomList[0x18].field_0x9c)) { if ((g_game->_challenge == 0x28) && (local_9a4 = (Game *)0x0, in_ECX->_roomList[0x19].DecorationSeed != 0)) { do { pGVar24 = *(Game **)(*(int *)&in_ECX->_roomList[0x19].PoopCount + (int)local_9a4 * 4); if ((pGVar24 == (Game *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (pGVar24->_roomList[0].OverrideData != (void *)0x1)) && (0x3dd < (int)pGVar24->_roomList[0].OverrideData - 10U)))) { local_9bc = (Game *)0x0; } else { local_9bc = pGVar24; if ((((((*(uint *)&pGVar24->_roomList[1].field_0x9c & 0x20000000) == 0) && (cVar17 = (**(code **)(pGVar24->_stage + 0x48))(), cVar17 != '\0')) && ((-1 < pGVar24->_roomList[4]._doors[7] && ((pvVar32 = pGVar24->_roomList[0].OverrideData, pvVar32 != (void *)0x2d && (pvVar32 != (void *)0x54)))))) && (pvVar32 != (void *)0x112)) && ((pvVar32 != (void *)0x113 && ((pvVar32 != (void *)0x4e || (pGVar24->_roomList[0].AllowedDoors != 10)))))) { if (DAT_00c82678 == DAT_00c8267c) { std::vector::_Emplace_reallocate(); } else { *DAT_00c82678 = pGVar24; DAT_00c82678 = DAT_00c82678 + 1; } } } local_9a4 = (Game *)((int)local_9a4 + 1); } while (local_9a4 < (int *)in_ECX->_roomList[0x19].DecorationSeed); } local_9a8 = (Entity *)PlayerManager::GetGFuelCount(); if ((3 < (int)local_9a8) && (local_9b8._begin = (Game *)0x0, in_ECX->_roomList[0x19].DecorationSeed != 0)) { do { pGVar24 = *(Game **)(*(int *)&in_ECX->_roomList[0x19].PoopCount + (int)local_9b8._begin * 4) ; if ((pGVar24 == (Game *)0x0) || (((*(int *)&g_game->_deathmatchManager < 2 || (*(int *)((int)pGVar24 + 0x28) != 1)) && (0x3dd < *(int *)((int)pGVar24 + 0x28) - 10U)))) { local_9a4 = (Game *)0x0; } else { local_9a4 = pGVar24; if ((((*(uint *)((int)pGVar24 + 0x168) & 0x20000000) == 0) && (cVar17 = (**(code **)(pGVar24->_stage + 0x48))(), cVar17 != '\0')) && ((-1 < *(int *)((int)pGVar24 + 0x32c) && (cVar17 = (**(code **)(pGVar24->_stage + 0x4c))(), cVar17 == '\0')))) { local_99c = (Entity *)((int)&local_9a8[-1]._luaBridgeRef + 1); do { uVar21 = *(uint *)((int)pGVar24 + 0x3dc); if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar21 = *(uint *)((int)pGVar24 + 0x3dc); if (uVar21 == 0) { pcVar11 = (code *)swi(3); (*pcVar11)(); return; } } uVar21 = uVar21 >> ((byte)*(int *)((int)pGVar24 + 0x3e0) & 0x1f) ^ uVar21; uVar21 = uVar21 << ((byte)*(int *)((int)pGVar24 + 0x3e4) & 0x1f) ^ uVar21; uVar21 = uVar21 >> ((byte)*(int *)((int)pGVar24 + 1000) & 0x1f) ^ uVar21; *(uint *)((int)pGVar24 + 0x3dc) = uVar21; if ((uVar21 & 1) == 0) { if (DAT_00c82678 == DAT_00c8267c) { std::vector::_Emplace_reallocate(); pGVar24 = local_9a4; } else { *DAT_00c82678 = pGVar24; DAT_00c82678 = DAT_00c82678 + 1; } } local_99c = (Entity *)((int)&local_99c[-1]._luaBridgeRef + 3); } while (0 < (int)local_99c); } } local_9b8._begin = (void *)((int)local_9b8._begin + 1); } while (local_9b8._begin < (Game *)in_ECX->_roomList[0x19].DecorationSeed); } } iVar19 = in_ECX->_roomList[0x9f].DisplayFlags; if (0 < iVar19) { in_ECX->_roomList[0x9f].DisplayFlags = iVar19 + -1; } if (*(int *)&in_ECX->_roomList[0x9e].field_0x94 != 0) { pGVar24 = in_ECX->_roomList[0x9e].SavedEffects._capacity; local_9b8._begin = (void *)pGVar24->_stage; if (local_9b8._begin != pGVar24) { do { iVar19 = *(int *)((int)local_9b8._begin + 0x10); if (((-1 < iVar19) && (iVar19 < *(int *)&in_ECX->_isHeartPicked * in_ECX->_curses)) && ((undefined4 *)in_ECX->_roomMap[iVar19 + -0x5eae] != (undefined4 *)0x0)) { (*(code *)**(undefined4 **)in_ECX->_roomMap[iVar19 + -0x5eae])(); in_ECX->_roomMap[iVar19 + -0x5eae] = 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_9b8); pGVar24 = in_ECX->_roomList[0x9e].SavedEffects._capacity; } while (local_9b8._begin != pGVar24); } ppvVar41 = &in_ECX->_roomList[0x9e].SavedEffects._capacity; FID_conflict__Erase_tree_>_> (ppvVar41,(fuzzer_allocator_> *)ppvVar41, (_Tree_node *)pGVar24->_stageType); pGVar24->_stageType = (int)pGVar24; pGVar24->_stage = (int)pGVar24; *(Game **)&pGVar24->_bossChallenge = pGVar24; *(undefined4 *)&in_ECX->_roomList[0x9e].field_0x94 = 0; } iVar19 = *(int *)&in_ECX->_isHeartPicked; iVar36 = in_ECX->_curses; local_99c = (Entity *)0x0; if (0 < iVar19 * iVar36) { ppvVar41 = &in_ECX->_roomList[0].Data; do { if (*ppvVar41 != (int *)0x0) { (**(code **)(*(int *)*ppvVar41 + 8))(); } iVar36 = in_ECX->_curses; local_99c = (Entity *)&local_99c->field_0x1; ppvVar41 = ppvVar41 + 1; } while ((int)local_99c < iVar36 * *(int *)&in_ECX->_isHeartPicked); iVar19._0_1_ = in_ECX->_isHeartPicked; iVar19._1_1_ = in_ECX->_isCanSeeEverything; iVar19._2_2_ = *(undefined2 *)&in_ECX->field_0x12; } local_9ac = (ItemPool *)0x3; local_9c0 = (void *)0x3e8; if ((g_game->_frameCount % 3 == 0) && (local_9b8._end = (float *)0x0, 0 < iVar36 * iVar19)) { local_99c = (Entity *)&in_ECX->_roomList[0x13].DeliriumDistance; piVar29 = in_ECX->_roomList[10]._doors + 3; local_9b8._end = (float *)0x0; do { iVar19 = *piVar29; iVar36 = iVar19 % 1000; if (iVar19 == 3999) { *piVar29 = 900; } else if (iVar36 < 0x385) { if (100 < iVar36) { iVar36 = 100; } *piVar29 = iVar19 - iVar36; } if ((ushort)(*(short *)local_99c - 1U) < 99) { iVar19 = *(short *)local_99c + -1; local_9d4.y = 0.0; sVar31 = 0; if (0 < iVar19) { sVar31 = (short)iVar19; } *(short *)local_99c = sVar31; } local_99c = (Entity *)&local_99c->field_0x2; local_9b8._end = (void *)((int)local_9b8._end + 1); piVar29 = piVar29 + 1; } while ((int)local_9b8._end < *(int *)&in_ECX->_isHeartPicked * in_ECX->_curses); } pEVar18 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x226,(RNG **)&g_game->_playerManager,1); if ((((pEVar18 != (Entity_Player *)0x0) && ((char)in_ECX->_stage != '\0')) && (g_game->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c == 4)) && ((*(int *)((int)g_game->_room + 8) == 0x11 && ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 3 & 1) == 0)))) { in_stack_fffff500 = (Vector *)&DAT_00000005; in_stack_fffff4fc = (Entity *)local_a58; in_stack_fffff4f8 = 0x803d67; EntityList::QuerySublist ((EntityList *)&in_ECX->_roomList[0x19].Dimension,(EntityList_EL *)in_stack_fffff4fc,5 ,100,-1,0,0); local_14 = 7.00649e-45; if ((void *)local_a58._12_4_ == (void *)0x0) { Ambush::StartChallenge(&g_game->_ambush); } local_14 = -NAN; if (local_a58[0] == '\0') { if (g_mainHeap == (void *)0x0) { pqVar37 = &g_allocatedBytesNoHeap; } else { pqVar37 = (qword *)((int)g_mainHeap + 0x30); } if (local_a58._4_4_ != 0) { uVar21 = *(uint *)(local_a58._4_4_ + -4); qVar12 = *pqVar37; *(uint *)pqVar37 = (uint)*pqVar37 - uVar21; *(uint *)((int)pqVar37 + 4) = *(uint *)((int)pqVar37 + 4) - (uint)((uint)qVar12 < uVar21); free((void *)(local_a58._4_4_ + -4)); } local_14 = -NAN; } } if (((*(int *)&in_ECX->field_0x8 == 0xb) || (*(int *)&in_ECX->field_0x8 == 0x11)) && ((g_game->_ambush)._isActive != 0)) { Ambush::Update(); } if (in_ECX->_roomList[0x18].field_0xa0 != '\0') { card_against_humanity_fill((Room *)in_ECX); } pvVar26 = (void *)(in_ECX->_roomList[0x1a].SafeGridIndex + in_ECX->_roomList[0x1a].ListIndex); pvVar32 = (void *)0x0; if (0 < (int)pvVar26) { pvVar32 = pvVar26; } if (((int)pvVar32 < 1) && (0 < (int)in_ECX->_roomList[0x9e].RestrictedGridIndexes._head)) { if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { KAGE_LogMessage(1,(byte *)"[Frame %d] "); } KAGE_LogMessage(1,(byte *)"[warn] last boss died without triggering the deathspawn.\n"); } in_ECX->_roomList[0x9e].RestrictedGridIndexes._head = pvVar32; EntityList::Update((EntityList *)&in_ECX->_roomList[0x19].Dimension,0); Camera::Update((Camera *)&in_ECX->_roomList[0x1e].SavedEntities,0); if (*(char *)((int)in_ECX->_roomList[0x28]._doors + 0x1d) != '\0') { AnimationState::Update((AnimationState *)&in_ECX->_roomList[0x27].AllowedDoors); AnimationState::Update((AnimationState *)(in_ECX->_roomList[0x27]._doors + 7)); } if (in_ECX->_roomList[0x28].Flags == 0x1a) { pbVar27 = (byte *)in_ECX->_roomList[0x27]._doors[0]; if (pbVar27 != (byte *)0x0) { if (0xf < *(uint *)(pbVar27 + 0x14)) { pbVar27 = *(byte **)pbVar27; } pbVar33 = s_Idle; do { bVar16 = *pbVar27; bVar46 = bVar16 < *pbVar33; if (bVar16 != *pbVar33) { LAB_00803ee0: uVar21 = -(uint)bVar46 | 1; goto LAB_00803ee5; } if (bVar16 == 0) break; bVar16 = pbVar27[1]; bVar46 = bVar16 < pbVar33[1]; if (bVar16 != pbVar33[1]) goto LAB_00803ee0; pbVar27 = pbVar27 + 2; pbVar33 = pbVar33 + 2; } while (bVar16 != 0); uVar21 = 0; LAB_00803ee5: if ((uVar21 == 0) && ((*(char *)(in_ECX->_roomList[0x27]._doors[0] + 0x34) == '\0' || ((char)in_ECX->_roomList[0x27]._doors[4] != '\0')))) goto LAB_00803f16; } bVar16 = ANM2::SetAnimation((ANM2 *)&in_ECX->_roomList[0x26].field_0xa0,s_Idle,1); if (bVar16 != 0) { AnimationState::Rewind((AnimationState *)&in_ECX->_roomList[0x27].AllowedDoors); *(undefined1 *)(in_ECX->_roomList[0x27]._doors + 4) = 1; } } LAB_00803f16: BeastArena::update(); if (((char)in_ECX->_stage != '\0') && (g_game->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c == 1)) { Level::UpdateBackwardsPathStages(in_ECX); } if (*(char *)((int)&in_ECX->_roomList[0xa0].Dimension + 1) == '\0') { for (piVar29 = (int *)in_ECX->_roomList[0xa0].GridIndex; piVar29 != (int *)in_ECX->_roomList[0xa0].SafeGridIndex; piVar29 = piVar29 + 4) { iVar19 = *(int *)*piVar29; if ((((iVar19 == 1) || (iVar19 == 3)) || (iVar19 == 4)) && (((int *)*piVar29)[1] == 0x1e1)) { uVar21 = Random(); pMVar14 = g_manager; if (uVar21 % 10 == 0) { uVar21 = Random(); if ((uVar21 & 1) == 0) { uVar21 = Random(); fVar20 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 0.1 + 0.2; } else { uVar21 = Random(); fVar20 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 1.5; } (pMVar14->_musicManager)._pitch = fVar20; (pMVar14->_musicManager)._targetPitch = fVar20; Music::SetPitchAll((Music *)((pMVar14->_musicManager)._channels + (pMVar14->_musicManager)._currentChannel),fVar20); pMVar14 = g_manager; uVar21 = Random(); if ((uVar21 & 3) == 0) { uVar21 = Random(); fVar20 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 0.7 + 0.3; } else { fVar20 = 1.0; } fVar20 = fVar20 * (g_manager->_optionsConfig)._musicVolume; (pMVar14->_musicManager)._channels[(pMVar14->_musicManager)._currentChannel]._targetVolume = fVar20; (pMVar14->_musicManager)._channels[(pMVar14->_musicManager)._currentChannel]._volume = fVar20; } else { iVar19 = (g_manager->_musicManager)._currentChannel; (g_manager->_musicManager)._pitch = 1.0; (pMVar14->_musicManager)._targetPitch = 1.0; Music::SetPitchAll((Music *)((pMVar14->_musicManager)._channels + iVar19),1.0); } break; } } } TemporaryEffects::Update((TemporaryEffects *)&in_ECX->_roomList[0x9f].Group); update_deaths_list(); pvVar32 = (void *)in_ECX->_stageType; local_9c8.y = (float)pvVar32; if (((*(byte *)((int)pvVar32 + 0x44) & 1) == 0) && ((g_game->_ambush)._isActive == 0)) { iVar36 = in_ECX->_roomList[0x19].Group + in_ECX->_roomList[0x1a].GridIndex; iVar19 = 0; if (0 < iVar36) { iVar19 = iVar36; } if (((iVar19 < 1) && (*(int *)&in_ECX->_roomList[0x9e].field_0x98 < 1)) && (*(int *)&in_ECX->_roomList[0x18].field_0x98 < 1)) { TriggerOutput((Room *)in_ECX,9); pvVar32 = (void *)in_ECX->_stageType; } } pGVar24 = g_game; if ((g_game->_ambush)._isActive == 0) { iVar36 = in_ECX->_roomList[0x19].Group + in_ECX->_roomList[0x1a].GridIndex; iVar19 = 0; if (0 < iVar36) { iVar19 = iVar36; } if ((0 < iVar19) || (0 < *(int *)&in_ECX->_roomList[0x9e].field_0x98)) goto LAB_00804293; iVar19 = *(int *)&in_ECX->_roomList[0x18].field_0x98; if (iVar19 < 1) { if (*(int *)&in_ECX->field_0x8 == 0x10) { iVar19 = *(int *)(*(int *)(in_ECX->_stageType + 0x10) + 0x10); if (iVar19 != 2) { if (iVar19 != 3) goto LAB_00804212; in_stack_fffff500 = (Vector *)g_game->_dungeonReturnRoomIndex; g_game->_enterDoor = -1; in_stack_fffff4fc = (Entity *)0x80420d; Game::StartRoomTransition(pGVar24,(int)in_stack_fffff500,-1,0,(Entity_Player *)0x0,-1); } } else { LAB_00804212: iVar19 = g_game->_stage; if ((iVar19 != 0xd) && (((iVar19 < 1 || (6 < iVar19)) || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) { piVar29 = &(g_manager->_musicManager)._channels [(g_manager->_musicManager)._currentChannel]._enabledLayers; *piVar29 = *piVar29 & 0xfffffffe; } puVar39 = (undefined4 *)&in_ECX->_roomList[9].field_0x98; local_99c = (Entity *)&DAT_00000008; do { if ((GridEntity_Door *)*puVar39 != (GridEntity_Door *)0x0) { GridEntity_Door::Open((GridEntity_Door *)*puVar39); } puVar39 = puVar39 + 1; local_99c = (Entity *)((int)&local_99c[-1]._luaBridgeRef + 3); } while (local_99c != (Entity *)0x0); if ((*(byte *)(in_ECX->_stageType + 0x44) & 9) == 0) { TriggerClear((Room *)in_ECX,0); } } } else { *(int *)&in_ECX->_roomList[0x18].field_0x98 = iVar19 + -1; } } else { LAB_00804293: iVar19 = *(int *)&in_ECX->field_0x8; *(undefined4 *)&in_ECX->_roomList[0x18].field_0x98 = 10; if (iVar19 == 0x10) { uVar34 = *(undefined4 *)&in_ECX->_roomList[0x18].field_0x98; if (*(int *)(*(int *)((int)pvVar32 + 0x10) + 0x10) == 3) { uVar34 = 0x14; } *(undefined4 *)&in_ECX->_roomList[0x18].field_0x98 = uVar34; } } puVar39 = (undefined4 *)&in_ECX->_roomList[9].field_0x98; local_99c = (Entity *)&DAT_00000008; do { this = (GridEntity_Door *)*puVar39; if ((this != (GridEntity_Door *)0x0) && ((this->_desc)._state == 5)) { GridEntity_Door::Open(this); } puVar39 = puVar39 + 1; local_99c = (Entity *)((int)&local_99c[-1]._luaBridgeRef + 3); } while (local_99c != (Entity *)0x0); update_pressure_plates((Room *)in_ECX); update_door_transitions((Room *)in_ECX); local_9a0 = g_game; local_9c8.y = (float)g_game->_stageType; iVar19 = g_game->_stage; if ((g_game->_difficulty == 2) || (iVar36 = iVar19, g_game->_difficulty == 3)) { if (iVar19 < 5) { iVar36 = iVar19 * 2 + -1; } else { iVar36 = 0; if (iVar19 == 5) { iVar36 = 10; } } local_9c8.y = 0.0; } if (((((iVar36 == 3) || (iVar36 == 4)) && ((undefined1 *)local_9c8.y == (undefined1 *)0x0)) || (((iVar36 == 7 || (iVar36 == 8)) && ((undefined1 *)local_9c8.y == (undefined1 *)0x0)))) || (((iVar36 == 5 || (iVar36 == 6)) && ((undefined1 *)local_9c8.y == (undefined1 *)0x2)))) { uVar21 = Random(); if (uVar21 % 0x1e != 0) { local_9a0 = g_game; goto LAB_0080439a; } LAB_00804511: uVar21 = Random(); uVar23 = Random(); local_a20.y = -10.0; in_stack_fffff500 = &local_a20; in_stack_fffff4fc = (Entity *)0x29; in_stack_fffff4f8 = 1000; local_a20.x = ((float)in_ECX->_roomList[0].ListIndex - (float)in_ECX->_roomList[0].GridIndex) * (float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)]) * 2.3283064e-10 + (float)in_ECX->_roomList[0].GridIndex; in_stack_fffff4f4 = 0x804585; pEVar35 = Game::Spawn(g_game,1000,0x29,in_stack_fffff500,&g_vectorZero,(Entity *)0x0,0,uVar21); (**(code **)(*(int *)pEVar35 + 0xc))(); } else { LAB_0080439a: if (((iVar36 == 3) || (iVar36 == 4)) && ((undefined1 *)local_9c8.y == (undefined1 *)0x2)) { g_game = local_9a0; uVar21 = Random(); if (uVar21 % 6 == 0) goto LAB_00804511; local_9a0 = g_game; } if (((iVar36 == 7) || (iVar36 == 8)) && ((undefined1 *)local_9c8.y == (undefined1 *)0x2)) { g_game = local_9a0; uVar21 = Random(); if ((uVar21 & 7) == 0) goto LAB_00804511; local_9a0 = g_game; } g_game = local_9a0; if ((iVar36 == 1) || (iVar36 == 2)) { if ((undefined1 *)local_9c8.y == &DAT_00000004) { uVar21 = Random(); if ((uVar21 & 3) == 0) goto LAB_00804511; local_9a0 = g_game; } g_game = local_9a0; if ((iVar36 == 1) || (iVar36 == 2)) { if ((undefined1 *)local_9c8.y == &DAT_00000005) { uVar21 = Random(); if ((uVar21 & 3) == 0) goto LAB_00804511; local_9a0 = g_game; } g_game = local_9a0; if ((((iVar36 == 1) || (iVar36 == 2)) && ((undefined1 *)local_9c8.y == (undefined1 *)0x2)) && (uVar21 = Random(), uVar21 % 0x14 == 0)) { uVar21 = Random(); uVar23 = Random(); local_9c8.y = -10.0; in_stack_fffff500 = &local_9c8; in_stack_fffff4fc = (Entity *)0x57; in_stack_fffff4f8 = 1000; local_9c8.x = ((float)in_ECX->_roomList[0].ListIndex - (float)in_ECX->_roomList[0].GridIndex) * (float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)] ) * 2.3283064e-10 + (float)in_ECX->_roomList[0].GridIndex; in_stack_fffff4f4 = 0x8044ff; pEVar35 = Game::Spawn(g_game,1000,0x57,in_stack_fffff500,&g_vectorZero,(Entity *)0x0,0, uVar21); (**(code **)(*(int *)pEVar35 + 0xc))(); } } } } pGVar24 = g_game; if (g_game->_challenge == 0x2c) { uVar21 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); } else { if (g_game->_currentDimensionIdx == 2) goto LAB_008046e2; uVar21 = g_game->_stageType; } pGVar47 = g_game; uVar21 = RoomConfig::GetStageID(pGVar24->_stage,uVar21,-1); if (uVar21 == 0x1b) { uVar21 = pGVar47->_frameCount & 0x80000003; bVar46 = uVar21 == 0; if ((int)uVar21 < 0) { bVar46 = (uVar21 - 1 | 0xfffffffc) == 0xffffffff; } if ((bVar46) && (uVar21 = Random(), uVar21 % 100 == 0)) { uVar21 = Random(); g_game->_lightningIntensity = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 1.3; uVar21 = Random(); pMVar14 = g_manager; local_99c = (Entity *)0x1d8; local_9a8 = (Entity *) ((float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); seed_fart_sound_override((int *)&local_99c); in_stack_fffff500 = (Vector *)0x3f800000; in_stack_fffff4f8 = 0x8046e2; in_stack_fffff4fc = local_99c; SoundEffects::Play(&pMVar14->_sfxManager,(int)local_99c,1.0,0x5a,0,(float)local_9a8,0.0); } } LAB_008046e2: update_ambient_spawns(); update_ambient_effects((Room *)in_ECX); update_water_current((Room *)in_ECX); bVar16 = Level::IsMausoleumHeartStage((Level *)g_game); pGVar24 = g_game; if (bVar16 != 0) { if ((*(char *)g_game->_room == '\0') || (g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0) < 2)) { g_game->_darknessModifier = 1.0; } pGVar24->_darknessStrength = 1.0; pGVar24->_darknessTimeout = 10; } piVar29 = *(int **)(in_ECX->_stageType + 0x10); if (((piVar29 != (int *)0x0) && (piVar29[2] == 0x10)) && (*piVar29 == 0x23)) { pGVar47 = (Game *)((float)in_ECX->_roomList[0].Dimension - 30.0); local_9a0 = pGVar47; if ((char)in_ECX->_stage != '\0') { uVar21 = pGVar24->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c & 0x80000003; bVar46 = uVar21 == 0; if ((int)uVar21 < 0) { bVar46 = (uVar21 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar46) { pPVar42 = &pGVar24->_playerManager; if ((int)(pGVar24->_playerManager)._playerList._end - (int)(pPVar42->_playerList)._begin >> 2 != 0) { uVar21 = 0; pGVar24 = g_game; do { pvVar32 = (pPVar42->_playerList)._end; if ((int)pvVar32 - (int)(pPVar42->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar32 = (pPVar42->_playerList)._end; pGVar24 = g_game; pGVar47 = local_9a0; } pfVar40 = (pPVar42->_playerList)._begin; if (uVar21 < (uint)((int)pvVar32 - (int)pfVar40 >> 2)) { pfVar40 = pfVar40 + uVar21; } local_9a8 = (Entity *)*pfVar40; if ((float)pGVar47 <= (local_9a8->_pos).y + local_9a8->_size) { if (local_9a8->_entityCollisionClass != 0) { bVar16 = 0; slowSource._position.x = g_vectorZero.x; slowSource._velocity.x = g_vectorZero.x; slowSource._type = 0; slowSource._variant = 0; slowSource._spawnerType = 0; slowSource._spawnerVariant = 0; slowSource._position.y = g_vectorZero.y; slowSource._velocity.y = g_vectorZero.y; slowSource._flags = 0; slowSource._entity = (void *)0x0; Color::Reset(aCStackY_2148 + 0x81); pEVar35 = local_9a8; color._tint[2] = 1.3; color._tint[0] = 1.0; color._tint[1] = 1.0; color._tint[3] = 1.0; color._colorize[0] = (float)in_stack_fffff4f4; color._colorize[1] = (float)in_stack_fffff4f8; color._colorize[2] = (float)in_stack_fffff4fc; color._colorize[3] = (float)in_stack_fffff500; color._offset[0] = 0.15686275; color._offset[1] = 0.15686275; color._offset[2] = 0.15686275; Entity::AddSlowing(local_9a8,&slowSource,4,0.6,color,bVar16); in_stack_fffff500 = (Vector *)0x3f800000; in_stack_fffff4fc = (Entity *)0x804968; (**(code **)(*(int *)pEVar35 + 0x20))(); pGVar24 = g_game; pGVar47 = local_9a0; } } pPVar42 = &pGVar24->_playerManager; uVar21 = uVar21 + 1; } while (uVar21 < (uint)((int)(pGVar24->_playerManager)._playerList._end - (int)(pPVar42->_playerList)._begin >> 2)); in_ECX = local_9cc; } } } uVar21 = Random(); if ((uVar21 & 1) == 0) { uVar21 = Random(); local_9a8 = (Entity *) ((float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * -2.8799999); uVar21 = Random(); local_a20.x = ((float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 - 0.5) * 0.4; local_a20.y = (float)local_9a8; uVar21 = Random(); fVar20 = (float)in_ECX->_roomList[0].GridIndex + 40.0; local_9a0 = (Game *)(((float)local_9a0 - fVar20) * (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 + fVar20); uVar21 = Random(); local_a40.y = (float)local_9a0; local_a40.x = ((float)in_ECX->_roomList[0].ListIndex - (float)in_ECX->_roomList[0].GridIndex) * (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 + (float)in_ECX->_roomList[0].GridIndex; uVar21 = Random(); pEVar35 = Game::Spawn(g_game,1000,0x42,&local_a40,&local_a20,(Entity *)0x0,10,uVar21); uVar21 = Random(); fVar48 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 1.2 + 0.8; fVar20 = fVar48 * g_vectorOne.x; (pEVar35->_sprite)._scale.y = fVar48 * g_vectorOne.y; (pEVar35->_sprite)._scale.x = fVar20; uVar21 = Random(); if (uVar21 % (uint)local_9ac == 0) { pEVar35->_renderDepthOffset = 80.0; } else { pEVar35->_sortingLayer = 1; fVar20 = (pEVar35->_sprite)._scale.x; fVar48 = (pEVar35->_sprite)._scale.y; (pEVar35->_sprite)._color._tint[3] = 0.6; (pEVar35->_sprite)._scale.x = fVar20 * 0.6; (pEVar35->_sprite)._scale.y = fVar48 * 0.6; } (**(code **)(*(int *)pEVar35 + 0xc))(); } } iVar19 = *(int *)&in_ECX->_roomList[0x9c].field_0xa4; if (iVar19 < *(int *)&in_ECX->_roomList[0x9c].field_0xa8) { fVar20 = *(float *)&in_ECX->_roomList[0x9c].field_0xa0; fVar48 = *(float *)&in_ECX->_roomList[0x9c].field_0x98; *(int *)&in_ECX->_roomList[0x9c].field_0xa4 = iVar19 + 1; *(float *)&in_ECX->_roomList[0x9c].field_0x98 = fVar20 + fVar48; } iVar19 = in_ECX->_roomList[0x9d].ListIndex; if (iVar19 < in_ECX->_roomList[0x9d].Dimension) { in_ECX->_roomList[0x9c].Group = (int)((float)in_ECX->_roomList[0x9d].SafeGridIndex + (float)in_ECX->_roomList[0x9c].Group); in_ECX->_roomList[0x9d].ListIndex = iVar19 + 1; } pvVar32 = in_ECX->_roomList[0x9e].SavedGridEntities._capacity; if (0 < (int)pvVar32) { psVar2 = &in_ECX->_roomList[0x9e].SavedEntities; local_9bc = (Game *)((float)in_ECX->_roomList[0].Dimension - (float)in_ECX->_roomList[0].SafeGridIndex); local_9a4 = (Game *)((float)in_ECX->_roomList[0].ListIndex - (float)in_ECX->_roomList[0].GridIndex); in_ECX->_roomList[0x9e].SavedGridEntities._capacity = (void *)((int)pvVar32 + -1); local_9b8._begin = (Game *)0x20; psVar28 = &local_9b8; if ((int)psVar2->_begin < 0x20) { psVar28 = psVar2; } local_9b8._capacity = (Entity *)0x0; if (0 < (int)psVar28->_begin) { local_9ac = (ItemPool *)((float)local_9a4 + (float)local_9a4); local_9a8 = (Entity *)((float)local_9bc + (float)local_9bc + (float)local_9ac); do { uVar21 = Random(); local_99c = (Entity *) ((float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * (float)local_9a8); if ((float)local_9a4 <= (float)local_99c) { if ((float)local_9a4 + (float)local_9bc <= (float)local_99c) { if ((float)local_9bc + (float)local_9ac <= (float)local_99c) { uVar21 = Random(); uVar23 = Random(); fVar20 = (float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9b8._end = (void *)(fVar20 + fVar20); local_9a0 = (Game *)sin((float)local_9b8._end); local_9c8.x = cos((float)local_9b8._end); pVVar25 = &local_9c8; local_9c8.y = (float)local_9a0 * 5.0; local_9c8.x = local_9c8.x * 5.0; local_a18.x = (float)in_ECX->_roomList[0].GridIndex; position = &local_a18; local_a18.y = (((float)local_99c + (float)in_ECX->_roomList[0].SafeGridIndex) - (float)local_9ac) - (float)local_9bc; } else { uVar21 = Random(); uVar23 = Random(); fVar20 = (float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9b8._end = (void *)(fVar20 + fVar20); local_9a0 = (Game *)sin((float)local_9b8._end); fVar20 = cos((float)local_9b8._end); pVVar25 = &local_9e0; local_9e0.y = (float)local_9a0 * 5.0; local_9e0.x = fVar20 * 5.0; local_9d4.y = (float)in_ECX->_roomList[0].Dimension; position = &local_9d4; local_9d4.x = (((float)local_99c + (float)in_ECX->_roomList[0].GridIndex) - (float)local_9a4) - (float)local_9bc; } } else { uVar21 = Random(); uVar23 = Random(); fVar20 = (float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9b8._end = (void *)(fVar20 + fVar20); local_9a0 = (Game *)sin((float)local_9b8._end); local_a38.x = cos((float)local_9b8._end); pVVar25 = &local_a38; local_a38.y = (float)local_9a0 * 5.0; local_a38.x = local_a38.x * 5.0; local_a04.x = (float)in_ECX->_roomList[0].ListIndex; local_a04.y = ((float)local_99c + (float)in_ECX->_roomList[0].SafeGridIndex) - (float)local_9a4; position = &local_a04; } } else { uVar21 = Random(); uVar23 = Random(); fVar20 = (float)((double)(int)uVar23 + __uint_to_double_fixup[-((int)uVar23 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9b8._end = (void *)(fVar20 + fVar20); local_9a0 = (Game *)sin((float)local_9b8._end); local_a28.x = cos((float)local_9b8._end); pVVar25 = &local_a28; local_a28.y = (float)local_9a0 * 5.0; local_a28.x = local_a28.x * 5.0; local_a30.x = (float)local_99c + (float)in_ECX->_roomList[0].GridIndex; local_a30.y = (float)in_ECX->_roomList[0].SafeGridIndex; position = &local_a30; } pEVar35 = Game::Spawn(g_game,1000,5,position,pVVar25,(Entity *)0x0,0,uVar21); iVar19 = in_ECX->_roomList[0x28].Flags; if (((iVar19 == 0x22) || (iVar19 == 0x2b)) || (iVar19 == 0x2c)) { (**(code **)(*(int *)pEVar35 + 0x3c))(); fVar13 = g_colorGreenSplat._tint[3]; fVar48 = g_colorGreenSplat._tint[2]; fVar20 = g_colorGreenSplat._tint[1]; if (&pEVar35->_splatColor != &g_colorGreenSplat) { (pEVar35->_splatColor)._tint[0] = g_colorGreenSplat._tint[0]; (pEVar35->_splatColor)._tint[1] = fVar20; (pEVar35->_splatColor)._tint[2] = fVar48; (pEVar35->_splatColor)._tint[3] = fVar13; fVar13 = g_colorGreenSplat._colorize[3]; fVar48 = g_colorGreenSplat._colorize[2]; fVar20 = g_colorGreenSplat._colorize[1]; (pEVar35->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0]; (pEVar35->_splatColor)._colorize[1] = fVar20; (pEVar35->_splatColor)._colorize[2] = fVar48; (pEVar35->_splatColor)._colorize[3] = fVar13; *(undefined8 *)(pEVar35->_splatColor)._offset = g_colorGreenSplat._offset._0_8_; (pEVar35->_splatColor)._offset[2] = g_colorGreenSplat._offset[2]; } } (**(code **)(*(int *)pEVar35 + 0xc))(); psVar2 = &in_ECX->_roomList[0x9e].SavedEntities; local_9b8._capacity = (void *)((int)local_9b8._capacity + 1); psVar28 = &local_9b8; if ((int)psVar2->_begin < 0x20) { psVar28 = psVar2; } } while ((int)local_9b8._capacity < (int)psVar28->_begin); } } bVar16 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x123); if ((bVar16 != 0) && (*(int *)&in_ECX->field_0x8 != 0x10)) { fVar20 = *(float *)&in_ECX->_roomList[0x9e].field_0x9c + 0.1; *(float *)&in_ECX->_roomList[0x9e].field_0x9c = fVar20; if ((0.89 < fVar20) && ((fVar20 < 0.91 && (puVar1 = (uint *)(in_ECX->_stageType + 0x44), *puVar1 = *puVar1 | 0x100, (*(uint *)(in_ECX->_stageType + 0x44) >> 5 & 1) != 0)))) { iVar19 = in_ECX->_curses; local_99c = (Entity *)0x1; if (1 < iVar19 + -1) { do { iVar36 = *(int *)&in_ECX->_isHeartPicked; local_9b8._capacity = (Entity *)0x1; if (1 < iVar36 + -1) { do { if (((((int)local_99c < 0) || (iVar19 = in_ECX->_curses, iVar19 <= (int)local_99c)) || ((int)local_9b8._capacity < 0)) || (iVar36 <= (int)local_9b8._capacity)) { iVar19 = in_ECX->_curses; } else if (((-1 < (int)(&(local_99c->_sprite)._filename + -3) + (int)local_9b8._capacity * iVar19) && (local_9ac = (ItemPool *) in_ECX->_roomList[0]._doors [(int)((local_99c->_sprite)._filename._buf + (int)local_9b8._capacity * iVar19 + -0x4b)], local_9ac != (ItemPool *)0x0)) && (*(float *)((int)local_9ac + 4) == 9.80909e-45)) { piVar29 = (int *)__RTDynamicCast(); (**(code **)(*piVar29 + 0x20))(); (**(code **)(*piVar29 + 4))(); iVar36._0_1_ = in_ECX->_isHeartPicked; iVar36._1_1_ = in_ECX->_isCanSeeEverything; iVar36._2_2_ = *(undefined2 *)&in_ECX->field_0x12; iVar19 = in_ECX->_curses; } local_9b8._capacity = &((Entity *)local_9b8._capacity)->field_0x1; } while ((int)local_9b8._capacity < iVar36 + -1); } local_99c = (Entity *)&local_99c->field_0x1; } while ((int)local_99c < iVar19 + -1); } } if (1.0 < *(float *)&in_ECX->_roomList[0x9e].field_0x9c) { *(undefined4 *)&in_ECX->_roomList[0x9e].field_0x9c = 0x3f800000; } } if ((0.0 < *(float *)&in_ECX->_roomList[0x9e].field_0x9c) && (fVar20 = *(float *)&in_ECX->_roomList[0xa5].field_0x94, 0.0 < fVar20)) { fVar48 = fVar20 * 0.92; *(float *)&in_ECX->_roomList[0xa5].field_0x94 = fVar48; if ((fVar48 < 0.2) && (0.2 <= fVar20)) { iVar19 = in_ECX->_curses; local_99c = (Entity *)0x1; if (1 < iVar19 + -1) { do { iVar38 = *(int *)&in_ECX->_isHeartPicked; iVar36 = 1; if (1 < iVar38 + -1) { do { if (((((int)local_99c < 0) || (iVar19 = in_ECX->_curses, iVar19 <= (int)local_99c)) || (iVar36 < 0)) || (iVar38 <= iVar36)) { iVar19 = in_ECX->_curses; } else if (((-1 < (int)(&(local_99c->_sprite)._filename + -3) + iVar36 * iVar19) && (local_9ac = (ItemPool *) in_ECX->_roomList[0]._doors [(int)((local_99c->_sprite)._filename._buf + iVar36 * iVar19 + -0x4b)], local_9ac != (ItemPool *)0x0)) && (*(float *)((int)local_9ac + 4) == 9.80909e-45)) { this_01 = (GridEntity_Pit *)__RTDynamicCast(); GridEntity_Pit::UpdateCollision(this_01); iVar38._0_1_ = in_ECX->_isHeartPicked; iVar38._1_1_ = in_ECX->_isCanSeeEverything; iVar38._2_2_ = *(undefined2 *)&in_ECX->field_0x12; iVar19 = in_ECX->_curses; } iVar36 = iVar36 + 1; } while (iVar36 < iVar38 + -1); } local_99c = (Entity *)&local_99c->field_0x1; } while ((int)local_99c < iVar19 + -1); fVar48 = *(float *)&in_ECX->_roomList[0xa5].field_0x94; } } if (fVar48 < 0.001) { *(undefined4 *)&in_ECX->_roomList[0xa5].field_0x94 = 0; } FUN_00823540(); } if ((((g_game->_levelStateFlags & 0x4000U) != 0) && ((*(uint *)(in_ECX->_stageType + 0x44) & 0x4000) == 0)) && (((char)in_ECX->_stage != '\0' && ((g_game->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c == 1 && (bVar16 = Game::IsPaused(g_game), bVar16 == 0)))))) { MamaMegaExplosion((Room *)in_ECX); } pvVar32 = in_ECX->_roomList[0x9e].SavedEffects._begin; if (0 < (int)pvVar32) { in_ECX->_roomList[0x9e].SavedEffects._begin = (void *)((int)pvVar32 + -1); } UpdateGreedWave(); update_ambient_sounds((Room *)in_ECX); iVar19 = in_ECX->_roomList[0x9c]._doors[7]; if ((0 < iVar19) && (iVar19 = iVar19 + -1, in_ECX->_roomList[0x9c]._doors[7] = iVar19, iVar19 < 1) ) { in_ECX->_roomList[0x9c]._doors[7] = -1; ShopRestockPartial((Room *)in_ECX); } if ((((*(int *)&in_ECX->field_0x8 == 2) && (pEVar18 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x209,(RNG **)&g_game->_playerManager,1), pEVar18 != (Entity_Player *)0x0)) && ((char)in_ECX->_stage != '\0')) && (1 < g_game->_frameCount - *(int *)&in_ECX->_roomList[0x18].field_0x9c)) { iVar19 = in_ECX->_stageType; sVar31 = *(short *)(iVar19 + 0xac); if ((0 < sVar31) && ((sVar31 <= *(short *)(iVar19 + 0xae) || (*(short *)(iVar19 + 0xae) == -1))) ) { local_a58._0_4_ = *(int *)(iVar19 + 0x58); local_a58._12_4_ = (void *)0x1b; local_a58._4_8_ = 0x1b00000001; uVar21 = RNG::RandomInt((RNG *)local_a58,(int)sVar31); *(short *)(in_ECX->_stageType + 0xae) = (short)uVar21; } } pvVar32 = in_ECX->_roomList[0x9e].SavedEffects._end; if (0 < (int)pvVar32) { if ((int)pvVar32 % 5 == 0) { get_random_pickup_position(g_game->_room,(Vector *)(local_a58 + 0x10),0,0); uVar21 = Random(); Game::Spawn(g_game,4,3,(Vector *)(local_a58 + 0x10),&g_vectorZero,(Entity *)0x0,0,uVar21); __RTDynamicCast(); pvVar32 = in_ECX->_roomList[0x9e].SavedEffects._end; } in_ECX->_roomList[0x9e].SavedEffects._end = (void *)((int)pvVar32 + -1); } if (*(char *)&in_ECX->_roomList[0xa7].SavedEntities._end != '\0') { uVar21 = 0; if (in_ECX->_roomList[0x19].DecorationSeed != 0) { do { pEVar22 = *(Entity_Pickup **)(*(int *)&in_ECX->_roomList[0x19].PoopCount + uVar21 * 4); iVar19 = pEVar22->_type; if (iVar19 == 5) { Entity_Pickup::UpdateLootPreview(pEVar22); } else if ((((1 < *(int *)&g_game->_deathmatchManager) && (iVar19 == 1)) || (iVar19 - 10U < 0x3de)) && (this_02 = (Entity_NPC *)__RTDynamicCast(), this_02 != (Entity_NPC *)0x0)) { Entity_NPC::UpdatePickupGhosts(this_02); } uVar21 = uVar21 + 1; } while (uVar21 < (uint)in_ECX->_roomList[0x19].DecorationSeed); } *(undefined1 *)&in_ECX->_roomList[0xa7].SavedEntities._end = 0; } if (*(char *)((int)&in_ECX->_roomList[0xa6].SafeGridIndex + 1) != '\0') { g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1; local_9f8._12_4_ = (void *)0x0; local_9f8._16_4_ = (float *)0x0; local_9b8._end = (float *)0x0; local_9e4 = (float *)0x0; local_14 = 9.80909e-45; memset(local_1e8,0,0x1c0); local_9a8 = (Entity *)(*(int *)&in_ECX->_isHeartPicked * in_ECX->_curses); iVar19 = 0; if (0 < (int)local_9a8) { do { uVar21 = GetGridCollision((Room *)in_ECX,iVar19); *(char *)((int)local_1e8 + iVar19) = -(uVar21 != 0); iVar19 = iVar19 + 1; } while (iVar19 < (int)local_9a8); } local_9b8._capacity = (Entity *)0x0; if (in_ECX->_roomList[0x19].DecorationSeed != 0) { do { pfVar40 = *(float **) (*(int *)&in_ECX->_roomList[0x19].PoopCount + (int)local_9b8._capacity * 4); if ((pfVar40 == (float *)0x0) || (pfVar40[10] != 7.00649e-45)) { local_9ac = (ItemPool *)0x0; } else { local_9ac = (ItemPool *)pfVar40; if (pfVar40[0xb] == 1.4013e-43) { iVar36 = (int)((pfVar40[0xcf] - 40.0) / 40.0 + 0.5); iVar19 = (int)((pfVar40[0xd0] - 120.0) / 40.0 + 0.5); if ((((-1 < iVar36) && (iVar36 < in_ECX->_curses)) && (-1 < iVar19)) && ((iVar3._0_1_ = in_ECX->_isHeartPicked, iVar3._1_1_ = in_ECX->_isCanSeeEverything, iVar3._2_2_ = *(undefined2 *)&in_ECX->field_0x12, iVar19 < iVar3 && (iVar36 = iVar19 * in_ECX->_curses + iVar36, -1 < iVar36)))) { *(undefined1 *)((int)local_1e8 + iVar36) = 1; } if (((*(char *)((int)pfVar40 + 0x173) == '\0') && (pfVar40[0x14d] == 0.0)) && ((((uint)pfVar40[0x5a] & 0x80000) != 0 && (cVar17 = FUN_0072fe80(), cVar17 == '\0'))) ) { pfVar40[0x5a] = (float)((uint)pfVar40[0x5a] & 0xfff7ffff); pfVar40[0x5b] = pfVar40[0x5b]; if ((void *)local_9f8._16_4_ == local_9b8._end) { std::vector::_Emplace_reallocate(); local_9b8._end = local_9e4; } else { *(float **)local_9f8._16_4_ = pfVar40; local_9f8._16_4_ = local_9f8._16_4_ + 4; } } } } local_9b8._capacity = (void *)((int)local_9b8._capacity + 1); } while (local_9b8._capacity < (undefined1 *)in_ECX->_roomList[0x19].DecorationSeed); } local_9e0.x = 0.0; local_9e0.y = 0.0; local_9e0.x = (float)operator_new(0x18); this_00 = local_9cc; *(float *)local_9e0.x = local_9e0.x; *(float *)((int)local_9e0.x + 4) = local_9e0.x; *(float *)((int)local_9e0.x + 8) = local_9e0.x; *(undefined2 *)((int)local_9e0.x + 0xc) = 0x101; local_14 = (float)CONCAT31(local_14._1_3_,8); pairOffsets[0] = -1; pairOffsets[1] = 0; pairOffsets[2] = 1; aiStack_28c[0] = 0; local_9a4 = (Game *)0x0; aiStack_28c[1] = 0; pvStack_284 = (void *)0xffffffff; pvStack_280 = (void *)0x0; pvStack_27c = (void *)0x1; local_9a0 = (Game *)((int)(local_9f8._16_4_ - local_9f8._12_4_) >> 2); local_278 = -NAN; uStack_274 = 0xffffffff; EStack_270 = (EntitySaveState)0x1; iStack_26c = 1; local_9bc = (Game *)0xffffffff; local_268 = -1; iStack_264 = 1; iStack_260 = 1; iStack_25c = -1; local_258 = 1; iStack_254 = -1; uStack_250 = 0xffffffff; uStack_24c = 1; local_99c = (Entity *)aiStack_28c; local_248 = 1; acStack_244[0] = '\x01'; acStack_244[1] = '\0'; acStack_244[2] = '\0'; acStack_244[3] = '\0'; acStack_244[4] = -1; acStack_244[5] = -1; acStack_244[6] = -1; acStack_244[7] = -1; acStack_244[8] = -1; acStack_244[9] = -1; acStack_244[10] = -1; acStack_244[0xb] = -1; acStack_244[0xc] = -1; acStack_244[0xd] = -1; acStack_244[0xe] = -1; acStack_244[0xf] = -1; acStack_244[0x10] = '\0'; acStack_244[0x11] = '\0'; acStack_244[0x12] = '\0'; acStack_244[0x13] = '\0'; acStack_244[0x14] = '\0'; acStack_244[0x15] = '\0'; acStack_244[0x16] = '\0'; acStack_244[0x17] = '\0'; acStack_244[0x18] = '\0'; acStack_244[0x19] = '\0'; acStack_244[0x1a] = '\0'; acStack_244[0x1b] = '\0'; acStack_244[0x1c] = '\0'; acStack_244[0x1d] = '\0'; acStack_244[0x1e] = '\0'; acStack_244[0x1f] = '\0'; acStack_244[0x20] = '\0'; acStack_244[0x21] = '\0'; acStack_244[0x22] = '\0'; acStack_244[0x23] = '\0'; acStack_244[0x24] = '\x01'; acStack_244[0x25] = '\0'; acStack_244[0x26] = '\0'; acStack_244[0x27] = '\0'; acStack_244[0x28] = '\0'; acStack_244[0x29] = '\0'; acStack_244[0x2a] = '\0'; acStack_244[0x2b] = '\0'; acStack_244[0x2c] = '\0'; acStack_244[0x2d] = '\0'; acStack_244[0x2e] = '\0'; acStack_244[0x2f] = '\0'; pvStack_214 = (void *)0xffffffff; pvStack_210 = (void *)0x0; pvStack_20c = (void *)0x0; local_208 = (void *)0x0; fStack_204 = 0.0; uStack_200._0_1_ = 0; uStack_200._1_3_ = 0; iStack_1fc = 1; pGVar24 = local_9a0; LAB_008058a0: local_9b8._begin = (Game *)0x0; piVar29 = local_1e8; piVar43 = gridOccupied; for (iVar19 = 0x70; iVar19 != 0; iVar19 = iVar19 + -1) { *piVar43 = *piVar29; piVar29 = piVar29 + 1; piVar43 = piVar43 + 1; } pGVar47 = (Game *)0x0; local_9c8.y = local_9e0.x; if (pGVar24 != (Game *)0x0) { pEVar35 = (Entity *)local_9cc->_curses; local_9a8 = pEVar35; do { iVar19 = *(int *)(local_9f8._12_4_ + (int)local_9b8._begin * 4); fVar20 = *(float *)(iVar19 + 0x33c); fVar48 = *(float *)(iVar19 + 0x340); iVar36 = (int)((fVar20 - 40.0) / 40.0 + 0.5); iVar19 = (int)((fVar48 - 120.0) / 40.0 + 0.5); if ((((iVar36 < 0) || ((int)pEVar35 <= iVar36)) || (iVar19 < 0)) || (iVar4._0_1_ = local_9cc->_isHeartPicked, iVar4._1_1_ = local_9cc->_isCanSeeEverything, iVar4._2_2_ = *(undefined2 *)&local_9cc->field_0x12, iVar4 <= iVar19)) { iVar36 = -1; } else { iVar36 = (int)pEVar35 * iVar19 + iVar36; } local_9ac = (ItemPool *)(iVar36 / (int)pEVar35); local_9b8._capacity = (void *)(iVar36 % (int)pEVar35); if (((float)(int)local_9b8._capacity * 40.0 + 40.0 == fVar20) && ((float)(int)local_9ac * 40.0 + 120.0 == fVar48)) { puVar30 = (undefined1 *)((int)local_99c[-1]._scoreMultiplier + (int)local_9ac); iVar19 = (int)(&(((Entity *)local_9b8._capacity)->_sprite)._filename + -3) + local_99c[-1]._pitfallTimer; if (((iVar19 < 0) || (((int)pEVar35 <= iVar19 || ((int)puVar30 < 0)))) || (iVar5._0_1_ = local_9cc->_isHeartPicked, iVar5._1_1_ = local_9cc->_isCanSeeEverything, iVar5._2_2_ = *(undefined2 *)&local_9cc->field_0x12, iVar5 <= (int)puVar30)) { iVar19 = -1; } else { iVar19 = iVar19 + (int)puVar30 * (int)pEVar35; } puVar30 = (undefined1 *)(*(int *)local_99c + (int)local_9ac); local_9ac = (ItemPool *)((int)local_99c[-1]._luaBridgeRef + (int)local_9b8._capacity); if (((((int)local_9ac < 0) || ((int)pEVar35 <= (int)local_9ac)) || ((int)puVar30 < 0)) || (iVar6._0_1_ = local_9cc->_isHeartPicked, iVar6._1_1_ = local_9cc->_isCanSeeEverything, iVar6._2_2_ = *(undefined2 *)&local_9cc->field_0x12, iVar6 <= (int)puVar30)) { pfVar40 = (float *)0xffffffff; } else { pfVar40 = (float *)((int)pEVar35 * (int)puVar30 + (int)local_9ac); } if (((iVar19 < 0) || ((int)pfVar40 < 0)) || ((gridOccupied[iVar19] != 0 || (gridOccupied[(int)pfVar40] != 0)))) goto LAB_00805bb8; gridOccupied[iVar19] = 1; gridOccupied[(int)pfVar40] = 1; gridOccupied[iVar36] = 0; pEVar35 = local_9a8; } local_9b8._begin = (void *)((int)local_9b8._begin + 1); pGVar47 = local_9a0; if (local_9a0 <= local_9b8._begin) break; } while( true ); } local_9bc = local_9a4; if (pGVar47 == (Game *)0x0) goto LAB_0080603d; LAB_00805a6e: local_9a0 = (Game *)0x0; do { local_9f8._0_4_ = (void *)0x3; local_9f8._4_4_ = (void *)0x3; local_9b8._begin = *(void **)(local_9f8._12_4_ + (int)local_9a0 * 4); local_9a4 = (Game *)&DAT_0000001d; local_9a8 = (Entity *)((Game *)local_9b8._begin)->_roomList[5].VisitedCount; if (local_9a8 == (Entity *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar21 = (uint)local_9a8 >> 3 ^ (uint)local_9a8; uVar21 = uVar21 << 3 ^ uVar21; local_9ac = (ItemPool *)(uVar21 >> 0x1d ^ uVar21); if (local_9ac == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } local_a04.x = *(float *)&((Game *)local_9b8._begin)->_roomList[4].TotalMoneySpent; local_a04.y = (float)((Game *)local_9b8._begin)->_roomList[4].GreedSubType; uVar21 = uVar21 >> 3 ^ (uint)local_9ac; uVar21 = uVar21 << 3 ^ uVar21; local_9ac = (ItemPool *)(uVar21 >> 0x1d ^ uVar21); iVar19 = (int)((local_a04.x - 40.0) / 40.0 + 0.5); iVar36 = (int)((local_a04.y - 120.0) / 40.0 + 0.5); if (((iVar19 < 0) || (this_00->_curses <= iVar19)) || ((iVar36 < 0 || (iVar7._0_1_ = this_00->_isHeartPicked, iVar7._1_1_ = this_00->_isCanSeeEverything, iVar7._2_2_ = *(undefined2 *)&this_00->field_0x12, iVar7 <= iVar36)))) { uVar21 = 0xffffffff; } else { uVar21 = iVar36 * this_00->_curses + iVar19; } local_9d4.y = 0.0; local_9d4.x = 0.0; if ((((int)local_9bc < 0) || ((float)((int)uVar21 % this_00->_curses) * 40.0 + 40.0 != local_a04.x)) || ((float)((int)uVar21 / this_00->_curses) * 40.0 + 120.0 != local_a04.y)) { pVVar25 = FindFreePickupSpawnPosition ((Room *)this_00,(Vector *)local_a70,&local_a04,60.0,0,0,0); local_9b8._capacity = (void *)pVVar25->x; local_99c = (Entity *)pVVar25->y; iVar36 = (int)(((float)local_9b8._capacity - 40.0) / 40.0 + 0.5); iVar19 = (int)(((float)local_99c - 120.0) / 40.0 + 0.5); if (((-1 < iVar36) && (iVar36 < this_00->_curses)) && ((-1 < iVar19 && ((iVar8._0_1_ = this_00->_isHeartPicked, iVar8._1_1_ = this_00->_isCanSeeEverything, iVar8._2_2_ = *(undefined2 *)&this_00->field_0x12, iVar19 < iVar8 && (local_9a8 = (Entity *)(iVar19 * this_00->_curses + iVar36), local_9a8 < 0x1c0)))))) { iVar19 = this_00->_roomMap[(int)local_9a8 - 0x5cdc] % (int)local_9c0; if (iVar19 < 900) { this_00->_roomMap[(int)local_9a8 - 0x5cdc] = (this_00->_roomMap[(int)local_9a8 - 0x5cdc] - iVar19) + 900; } } pVVar25 = FindFreePickupSpawnPosition ((Room *)this_00,(Vector *)(local_a70 + 8),&local_a04,60.0,1,0,0); local_9d4.x = pVVar25->x; local_9d4.y = pVVar25->y; } else { local_99c = (Entity *)((float)pairOffsets[(int)local_9bc * 4 + 1] * 40.0 + local_a04.y); local_9d4.y = (float)aiStack_28c[(int)local_9bc * 4] * 40.0 + local_a04.y; local_9b8._capacity = (Entity *)((float)pairOffsets[(int)local_9bc * 4] * 40.0 + local_a04.x); local_9d4.x = (float)pairOffsets[(int)local_9bc * 4 + 2] * 40.0 + local_a04.x; } if (*(int *)&this_00->field_0x8 == 0x10) { local_9d4.y = local_9d4.y + 30.0; local_99c = (Entity *)((float)local_99c + 30.0); } if (local_9ac == (ItemPool *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } uVar23 = (uint)local_9ac >> (local_9f8[0] & 0x1f) ^ (uint)local_9ac; uVar23 = uVar23 << (local_9f8[4] & 0x1f) ^ uVar23; local_9a4 = (Game *)Game::Spawn(g_game,(uint)((RoomDescriptor *)((int)local_9b8._begin + 0x14) )->OverrideData, ((RoomDescriptor *)((int)local_9b8._begin + 0x14))-> AllowedDoors,&local_9d4,&g_vectorZero,(Entity *)0x0,0, uVar23 >> ((byte)local_9a4 & 0x1f) ^ uVar23); iVar19 = Entity_Pickup::GetAlternatePedestal(local_9b8._begin); Entity_Pickup::SetAlternatePedestal((Entity_Pickup *)local_9a4,iVar19); pvVar32 = local_9b8._begin; if (-1 < (int)uVar21) { if (0x1bf < uVar21) { FUN_00aef86f(); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } *(undefined1 *)((int)local_1e8 + uVar21) = 0; } iVar19 = (int)((local_9d4.x - 40.0) / 40.0 + 0.5); iVar36 = (int)((local_9d4.y - 120.0) / 40.0 + 0.5); if ((((iVar19 < 0) || (this_00->_curses <= iVar19)) || (iVar36 < 0)) || (iVar9._0_1_ = this_00->_isHeartPicked, iVar9._1_1_ = this_00->_isCanSeeEverything, iVar9._2_2_ = *(undefined2 *)&this_00->field_0x12, iVar9 <= iVar36)) { iVar19 = -1; } else { iVar19 = iVar36 * this_00->_curses + iVar19; } iVar38 = (int)(((float)local_9b8._capacity - 40.0) / 40.0 + 0.5); iVar36 = (int)(((float)local_99c - 120.0) / 40.0 + 0.5); if (((iVar38 < 0) || (this_00->_curses <= iVar38)) || ((iVar36 < 0 || (iVar10._0_1_ = this_00->_isHeartPicked, iVar10._1_1_ = this_00->_isCanSeeEverything, iVar10._2_2_ = *(undefined2 *)&this_00->field_0x12, iVar10 <= iVar36)))) { iVar38 = -1; } else { iVar38 = iVar36 * this_00->_curses + iVar38; } if (-1 < iVar19) { *(undefined1 *)((int)local_1e8 + iVar19) = 1; } if (-1 < iVar38) { *(undefined1 *)((int)local_1e8 + iVar38) = 1; } *(void **)&((RoomDescriptor *)((int)local_9b8._begin + 0x14))[4].TotalMoneySpent = local_9b8._capacity; ((RoomDescriptor *)((int)local_9b8._begin + 0x14))[4].GreedSubType = (int)local_99c; ((RoomDescriptor *)((int)local_9b8._begin + 0x14))[4].VisitedCount = (int)local_9b8._capacity; ((RoomDescriptor *)((int)local_9b8._begin + 0x14))[4].Flags = (int)local_99c; fVar20 = (float)((RoomDescriptor *)((int)local_9b8._begin + 0x14))[7].Dimension; if (0 < (int)fVar20) { local_9a8 = (Entity *)fVar20; std::set::find_node(); if ((*(char *)((int)local_a08 + 0xd) != '\0') || (pfVar40 = local_a08, ((RoomDescriptor *)((int)pvVar32 + 0x14))[7].Dimension < *(int *)((int)local_a08 + 0x10)) ) { pfVar40 = (float *)local_9e0.x; } if (pfVar40 == (float *)local_9e0.x) { local_a18.y = (float)Entity_Pickup::AssignOptionsIndex((Entity_Pickup *)local_9a4); local_a18.x = (float)((RoomDescriptor *)((int)pvVar32 + 0x14))[7].Dimension; std_map_int_insert(&local_9e0,&local_a60,(int *)&local_a18); } else { local_9a4->_roomList[7].Dimension = *(int *)((int)pfVar40 + 0x14); } } local_9a0 = (Game *)((int)&local_9a0->_stage + 1); } while (local_9a0 < (Game *)((int)(local_9f8._16_4_ - local_9f8._12_4_) >> 2)); LAB_0080603d: g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1; *(undefined1 *)((int)&this_00->_roomList[0xa6].SafeGridIndex + 1) = 0; FID_conflict__Erase_tree_>_> (&local_9e0,(fuzzer_allocator_> *)&local_9e0, *(_Tree_node **)((int)local_9e0.x + 4)); operator_delete((void *)local_9e0.x,0x18); local_14 = -NAN; if ((void *)local_9f8._12_4_ != (void *)0x0) { deallocate((void *)local_9f8._12_4_,(int)local_9b8._end - local_9f8._12_4_ >> 2); } } if (DAT_00c82674 != DAT_00c82678) { pfVar44 = (float *)0x0; local_a10 = (void *)0x0; pfVar40 = (float *)0x0; local_9c8.y = 0.0; local_a0c = (float *)0x0; local_9a4 = (Game *)0x0; local_a08 = (float *)0x0; local_14 = 1.26117e-44; local_9c0 = (void *)0x0; puVar39 = DAT_00c82674; if ((int)DAT_00c82678 - (int)DAT_00c82674 >> 2 != 0) { do { fVar20 = (float)puVar39[(int)local_9c0]; iVar19 = *(int *)((int)fVar20 + 0x28); if (((iVar19 == 0x1c) || (iVar19 == 0x13)) || (iVar19 == 0xef)) { LAB_008060ff: if (pfVar44 == pfVar40) { local_9a8 = (Entity *)fVar20; std::vector::_Emplace_reallocate(); pfVar40 = local_a08; } else { *pfVar44 = fVar20; local_a0c = pfVar44 + 1; } *(uint *)((int)fVar20 + 0x16c) = *(uint *)((int)fVar20 + 0x16c) | 0x4000; *(undefined4 *)((int)fVar20 + 0x168) = *(undefined4 *)((int)fVar20 + 0x168); puVar39 = DAT_00c82674; pfVar44 = local_a0c; } else if (iVar19 == 0x59) goto LAB_008060ff; local_9c0 = (RNG *)((int)local_9c0 + 1); } while (local_9c0 < (void *)((int)DAT_00c82678 - (int)puVar39 >> 2)); local_9c8.y = (float)pfVar44; local_9a4 = (Game *)pfVar40; } local_9a8 = (Entity *)0x0; pfVar40 = (float *)local_9c8.y; if ((int)DAT_00c82678 - (int)puVar39 >> 2 != 0) { do { EVar45 = *(EntityPtr *)(puVar39 + (int)local_9a8); local_9b8._begin = *(void **)((int)EVar45 + 0x2c); local_99c = (Entity *)((Vector *)((int)EVar45 + 0x33c))->x; local_9a0 = *(Game **)((int)EVar45 + 0x340); local_9bc = *(Game **)((int)EVar45 + 0x28); local_9b8._end = *(void **)((int)EVar45 + 0x30); local_9cc = *(Level **)((int)EVar45 + 0x3ec); local_9d4.y = (float)EVar45; if ((*(uint *)((int)EVar45 + 0x16c) & 0x4000) == 0) { if (((((local_9bc == (Game *)0x4e) || (local_9bc == (Game *)0x24)) || ((local_9bc == (Game *)0x10a || ((local_9bc == (Game *)0x54 || (local_9bc == (Game *)0x106)))))) || (local_9bc == (Game *)0x107)) || (local_9bc == (Game *)&DAT_00000065)) { local_a38.x = (float)local_99c - 60.0; local_a38.y = (float)local_9a0 - 0.0; pVVar25 = (Vector *)random_position_away_from_players(); local_9b8._capacity = Game::Spawn(g_game,(uint)local_9bc,(uint)local_9b8._begin,pVVar25,&g_vectorZero, (Entity *)0x0,(uint)local_9b8._end,(uint)local_9cc); local_a04.x = (float)local_99c + 60.0; local_a04.y = (float)local_9a0 + 0.0; LAB_008067bb: pfVar44 = (float *)random_position_away_from_players(); ((Vector *)((int)EVar45 + 0x33c))->x = *pfVar44; *(float *)((int)EVar45 + 0x340) = pfVar44[1]; pEVar35 = local_9b8._capacity; } else { if (local_9bc == (Game *)0x66) { local_a20.x = (float)local_99c + 0.0; local_a20.y = (float)local_9a0 + 30.0; pVVar25 = (Vector *)random_position_away_from_players(); local_9b8._capacity = Game::Spawn(g_game,(uint)local_9bc,(uint)local_9b8._begin,pVVar25,&g_vectorZero, (Entity *)0x0,(uint)local_9b8._end,(uint)local_9cc); local_a40.x = (float)local_99c - 0.0; local_a40.y = (float)local_9a0 - 30.0; goto LAB_008067bb; } local_9c0 = *(RNG **)((int)EVar45 + 0x370); if (*(int *)((int)EVar45 + 0x184) == 5) { uVar21 = Random(); fVar20 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9d4.y = fVar20 + fVar20; fVar20 = cos(local_9d4.y); local_a28.x = fVar20 * 20.0 + (float)local_99c; fVar20 = sin(local_9d4.y); local_a28.y = fVar20 * 20.0 + (float)local_9a0; } else { uVar21 = Random(); fVar20 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9d4.y = fVar20 + fVar20; fVar20 = cos(local_9d4.y); local_a30.x = fVar20 * 20.0 + (float)local_99c; fVar20 = sin(local_9d4.y); local_a30.y = fVar20 * 20.0 + (float)local_9a0; } pVVar25 = (Vector *)random_position_away_from_players(); pEVar35 = Game::Spawn(g_game,(uint)local_9bc,(uint)local_9b8._begin,pVVar25, &g_vectorZero,(Entity *)0x0,(uint)local_9b8._end,(uint)local_9cc); } if (pEVar35 != (Entity *)0x0) { qVar12 = pEVar35->_flags; puVar1 = (uint *)((int)&pEVar35->_flags + 4); *puVar1 = *puVar1 | 0x80; *(int *)&pEVar35->_flags = (int)qVar12; pEVar35->_spawnGridIndex = *(int *)((int)EVar45 + 0x32c); } } else { uVar21 = Random(); fVar20 = (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_9c0 = (RNG *)(fVar20 + fVar20); local_9ac = (ItemPool *)sin((float)local_9c0); fVar20 = cos((float)local_9c0); if (*(EntityPtr *)((int)EVar45 + 0x3c0) == (EntityPtr)0x0) { pEVar35 = (Entity *)0x0; local_9f8._0_4_ = (void *)0x0; local_9f8._4_4_ = (void *)0x0; local_9b8._capacity = (Entity *)0x0; local_9f8._8_4_ = (Entity *)0x0; local_14 = (float)CONCAT31(local_14._1_3_,10); local_9a0 = (Game *)((float)local_9a0 + (float)local_9ac * 40.0); local_9c0 = (RNG *)(fVar20 * 40.0 + (float)local_99c); EVar45 = (EntityPtr)local_9d4.y; do { local_a18.x = (float)local_9c0; local_a18.y = (float)local_9a0; local_9d4.y = (float)Game::Spawn(g_game,(uint)local_9bc,(uint)local_9b8._begin, &local_a18,&g_vectorZero,(Entity *)0x0, (uint)local_9b8._end,(uint)local_9cc); if (pEVar35 == local_9b8._capacity) { std::vector::_Emplace_reallocate(); local_9b8._capacity = (void *)local_9f8._8_4_; pEVar35 = (Entity *)local_9f8._4_4_; } else { *(float *)pEVar35 = local_9d4.y; local_9f8._4_4_ = &pEVar35->field_0x4; pEVar35 = (Entity *)&pEVar35->field_0x4; } EVar45 = *(EntityPtr *)((int)EVar45 + 0x3bc); } while ((EVar45 != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar45 + 0x28) == 1)) || (*(int *)((int)EVar45 + 0x28) - 10U < 0x3de)))); pvVar32 = (void *)((int)pEVar35 - local_9f8._0_4_ >> 2); local_9d4.y = 0.0; if (pvVar32 != (void *)0x0) { pvVar26 = (void *)0x0; do { (**(code **)(**(int **)(local_9f8._0_4_ + pvVar26 * 4) + 0xc))(); pvVar26 = (void *)((int)pvVar26 + 1); } while (pvVar26 < pvVar32); local_9c0 = (void *)0x0; local_9ac = (ItemPool *)local_9f8._0_4_; pfVar40 = (float *)local_9c8.y; do { fVar20 = *(float *)local_9ac; *(uint *)((int)fVar20 + 0x16c) = *(uint *)((int)fVar20 + 0x16c) | 0x4080; *(undefined4 *)((int)fVar20 + 0x168) = *(undefined4 *)((int)fVar20 + 0x168); if ((Game *)pfVar40 == local_9a4) { std::vector::_Emplace_reallocate(); local_9a4 = (Game *)local_a08; } else { *pfVar40 = *(float *)local_9ac; local_a0c = pfVar40 + 1; } local_9ac = (ItemPool *)((int)local_9ac + 4); local_9c0 = (RNG *)((int)local_9c0 + 1); pfVar40 = local_a0c; } while (local_9c0 < pvVar32); local_9c8.y = (float)local_a0c; } pfVar40 = (float *)local_9c8.y; local_14 = (float)CONCAT31(local_14._1_3_,9); if ((float *)local_9f8._0_4_ != (float *)0x0) { deallocate((void *)local_9f8._0_4_,(int)local_9b8._capacity - local_9f8._0_4_ >> 2); local_9f8._0_4_ = (void *)0x0; local_9f8._4_4_ = (void *)0x0; local_9f8._8_4_ = (Entity *)0x0; } } } local_9a8 = (Entity *)((int)local_9a8 + 1); puVar39 = DAT_00c82674; } while (local_9a8 < (uint)((int)DAT_00c82678 - (int)DAT_00c82674 >> 2)); } uVar21 = 0; uVar23 = (int)pfVar40 - (int)local_a10 >> 2; if (uVar23 != 0) { do { iVar19 = *(int *)((int)local_a10 + uVar21 * 4); uVar21 = uVar21 + 1; *(uint *)(iVar19 + 0x16c) = *(uint *)(iVar19 + 0x16c) & 0xffffbfff; *(undefined4 *)(iVar19 + 0x168) = *(undefined4 *)(iVar19 + 0x168); } while (uVar21 < uVar23); } if (local_a10 != (void *)0x0) { deallocate(local_a10,(int)local_9a4 - (int)local_a10 >> 2); } } ExceptionList = local_1c; return; LAB_00805bb8: local_99c = (Entity *)&(local_99c->_damageEvents)._capacity; local_9a4 = (Game *)((int)&local_9a4->_stage + 1); if ((Game *)&DAT_00000009 < local_9a4) goto LAB_00805a6e; pGVar24 = local_9a0; goto LAB_008058a0; } //@@ 008068f0 Room::TriggerClear /* ZHL [exact] __thiscall void Room::TriggerClear(bool playSound); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Room::TriggerClear(Room *this,byte playSound) { uint *puVar1; short *psVar2; ScoreSheet *this_00; void *pvVar3; uint uVar4; int iVar5; uint uVar6; Manager *pMVar7; byte bVar8; ChallengeParam *pCVar9; RoomDescriptor *pRVar10; uint uVar11; uint uVar12; int iVar13; int unusedArg; Game *pGVar14; undefined3 in_stack_00000005; this_00 = &g_game->_scoreSheet; puVar1 = (uint *)((int)this->_descriptor + 0x44); *puVar1 = *puVar1 | 1; psVar2 = (short *)((int)this->_descriptor + 0x4a); *psVar2 = *psVar2 + 1; pvVar3 = this->_descriptor; ScoreSheet::add_cleared_room (this_00,this->_roomType,*(int *)(*(int *)((int)pvVar3 + 0x10) + 0x48), (uint)*(ushort *)((int)pvVar3 + 0x4a),(byte)(*(uint *)((int)pvVar3 + 0x44) >> 10) & 1); pGVar14 = g_game; if ((((g_game->_challenge == 0x1f) || (pCVar9 = Game::GetChallengeParams(g_game), pCVar9->_pathType == 3)) || (pCVar9->_endStage == 0xd)) && (pRVar10 = Level::GetRoomByIdx((Level *)pGVar14,pGVar14->_currentRoomIdx,-1), pGVar14 = g_game, pRVar10->ListIndex == g_game->_lastBossRoomListIdx)) { uVar4 = g_game->_debugCurses; iVar5 = g_game->_stage; uVar6 = g_game->_curses; uVar11 = Seeds::GetForcedCurses(); uVar12 = Seeds::GetPreventedCurses(); iVar13 = iVar5 + 1; if ((~uVar12 & (uVar11 | uVar4 | uVar6) & 2) == 0) { iVar13 = iVar5; } if (iVar13 == 6) { update_door_targets(); } pGVar14 = g_game; } if ((pGVar14->_difficulty != 2) && (pGVar14->_difficulty != 3)) { TrySpawnSecretExit(this,1,0); } TrySpawnDevilRoomDoor(this,1,0); pMVar7 = g_manager; if (playSound == 0) { _playSound = 0x24; seed_fart_sound_override((int *)&playSound); SoundEffects::Play(&pMVar7->_sfxManager,_playSound,1.0,2,0,1.0,0.0); } pGVar14 = g_game; if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { TrySpawnBossRushDoor(this,0,0); TrySpawnBlueWombDoor(1,0,0); TrySpawnTheVoidDoor(0); pMVar7 = g_manager; pGVar14 = g_game; if ((((((g_game->_seedEffects)._isCustomRun == 0) && (((bVar8 = Seeds::AchievementUnlocksDisallowed(&g_game->_seedEffects), bVar8 == 0 && (bVar8 = Manager::IsGameplayInputActive(unusedArg), bVar8 == 0)) && (pGVar14->_isRerun == 0)))) || (pMVar7->_netplayManager != *(NetplayManager *)(pMVar7 + 1))) && ((((pMVar7->_persistentGameData)._eventCounters[0x19] != 0 && ((pGVar14->_levelStateFlags & 0x10000U) == 0)) && ((pRVar10 = Level::GetRoomByIdx((Level *)pGVar14,pGVar14->_currentRoomIdx,-1), pGVar14 = g_game, pRVar10->ListIndex == g_game->_lastBossRoomListIdx && ((g_game->_stage == 1 && (g_game->_stageType != 4)))))))) && ((g_game->_stageType != 5 && (g_game->_frameCount < 0x709)))) { g_game->_levelStateFlags = g_game->_levelStateFlags | 0x10000; pMVar7 = g_manager; _playSound = 0x5a; seed_fart_sound_override((int *)&playSound); SoundEffects::Play(&pMVar7->_sfxManager,_playSound,1.0,2,0,1.0,0.0); pGVar14 = g_game; *(undefined4 *)&this->field_0x72fc = 0; } } if ((*(uint *)((int)this->_descriptor + 0x44) >> 7 & 1) == 0) { if (((pGVar14->_difficulty != 2) && (pGVar14->_difficulty != 3)) || (this->_roomType != 1)) { PlayerManager::trigger_room_clear(&pGVar14->_playerManager); } SpawnClearAward(); pGVar14 = g_game; } iVar5 = pGVar14->_difficulty; if ((iVar5 == 2) || (iVar5 == 3)) { if (this->_roomType == 1) { iVar13 = pGVar14->_greedModeWave; pGVar14->_greedLastBeatenWave = iVar13; bVar8 = PlayerManager::IsCoopPlay(&pGVar14->_playerManager); if ((bVar8 == 0) || (iVar13 != (iVar5 == 3) + 10)) goto LAB_00806c0a; } else if (((this->_roomType != 5) || (this->_bossId != 0x3e)) || (bVar8 = PlayerManager::IsCoopPlay(&pGVar14->_playerManager), bVar8 == 0)) goto LAB_00806c0a; PlayerManager::revive_player_ghosts(&pGVar14->_playerManager); } LAB_00806c0a: Game::save_rewind_state(-1); return; } //@@ 00806c20 Game::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Game::Render(); */ void __thiscall Game::Render(Game *this,Entity_Player *param_2,float *param_3) { int iVar1; EntityPtr EVar2; Entity_Player *pEVar3; char cVar4; byte bVar5; float *pfVar6; Vector *pVVar7; char *local_EAX_515; byte *pbVar8; LayerState *layer; int frameIndex; ItemConfig_Item *costumeItem; Font *pFVar9; BitSet128 *maskedTearFlags; Seeds *seeds; Sprite *sprite; undefined4 uVar10; uint uVar11; int *piVar12; AnimationState *pAVar13; void *pvVar14; Vector *pVVar15; Vector *pVVar16; Entity *pEVar17; KColor *pKVar18; std_string *layerName; uint uVar19; ColorMod *color; Vector *pVVar20; Room *roomAlias; Room *pRVar21; ANM2 *pAVar22; int iVar23; ANM2 *lightSprite; float10 fVar24; float fVar25; float fVar26; undefined1 entityColor [12]; float fStack_26c; Vector *bottomrightclamp; Vector flameQuad; Vector local_238; Vector local_230 [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 renderOffset; 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; undefined1 local_68 [8]; float fStack_60; float fStack_5c; float local_58; float fStack_54; float fStack_50; float fStack_4c; float local_48 [2]; void *local_40; RNG flickerRng; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; puStack_20 = (undefined1 *)(local_48 + 0x11); puStack_18 = &LAB_00b014f8; local_1c = ExceptionList; local_24 = (float)(__security_cookie ^ (uint)(local_48 + 0xe)); ExceptionList = &local_1c; flickerRng._seed = g_game->_frameCount + param_2->_initSeed; lightEntity = param_2; if ((void *)flickerRng._seed == (void *)0x0) { flickerRng._seed = 1; } flickerRng._shift1 = 5; flickerRng._shift2 = 0x1b; flickerRng._shift3 = 0x19; local_14 = 0.0; renderOffset.x = *param_3; renderOffset.y = param_3[1]; DAT_00c7977e = 1; room = (Room *)this; pfVar6 = (float *)FUN_006b7cc0(); renderOffset.x = renderOffset.x + *pfVar6; renderOffset.y = renderOffset.y + pfVar6[1]; if (param_2->_visible != 0) { uVar19 = (param_2->_sprite)._bitflags; if ((uVar19 >> 0xb & 1) != 0) { local_178._0_4_ = (param_2->_pos).x + (param_2->_posOffset).x; local_178._4_4_ = (param_2->_pos).y + (param_2->_posOffset).y; pVVar7 = Isaac::GetRenderPosition(&local_13c,(Vector *)local_178,1); local_160.y = renderOffset.x + pVVar7->x; local_100.y = renderOffset.y + pVVar7->y; local_130 = ¶m_2->_sprite; local_180.x = (float)&(param_2->_sprite)._overlayAnimState; local_180.y = (float)&(param_2->_sprite)._animState; if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)&this->_roomList[0x99].BossDeathSeed,0.0); } lightSprite = local_130; local_150.y = 0.0; do { local_108 = *(ANM2 **)(*(int *)(local_178 + (int)local_150.y * 4 + -8) + 4); if ((local_108 != (ANM2 *)0x0) && (local_12c = (ANM2 *)0x0, *(int *)((int)(local_108->_animDefaultName)._buf + 0xc) != 0)) { local_154 = 0.0; do { local_130 = *(ANM2 **)(*(int *)((int)(local_108->_animDefaultName)._buf + 8) + (int)local_154); local_EAX_515 = (char *)FUN_0040b4d0(); pbVar8 = std::string::c_str(local_EAX_515); if ((*pbVar8 == 0x2a) && ((lightSprite->_animState)._animData != (void *)0x0)) { local_130 = AnimationState::GetNullFrameById ((AnimationState *)local_180.y,(int)local_130); if ((local_130 != (ANM2 *)0x0) && (((local_130->_filename)._buf[0xc] != '\0' && (0.0 < *(float *)((local_130->_animDefaultName)._buf + 0xc))))) { local_120.y = ((lightSprite->_offset).y + *(float *)((local_130->_filename)._buf + 4)) * (lightSprite->_scale).y ; local_120.x = ((lightSprite->_offset).x + *(float *)(local_130->_filename)._buf) * (lightSprite->_scale).x; Vector::Rotated(&local_120,&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; } KColor::SetFromARGB((KColor *)(local_c8 + 0x18),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]; pKVar18 = (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]; lightColor._offset._0_8_ = *(undefined8 *)(lightSprite->_color)._offset; Color::__mul(&lightColor,(ColorMod *)&local_130->_animDefaultName); Color::operator_assign((Color *)local_68,(ColorMod *)&lightColor); Color::apply_to_kcolor(&local_1a8,(ColorMod *)local_68,pKVar18); local_1b0.y = local_1a8._alpha; local_1b8.y = local_1a8._blue; local_194.y = local_1a8._green; local_188.y = local_1a8._red; Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,local_188.y,local_194.y,local_1b8.y,local_1b0.y); Color::operator_assign ((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); fVar26 = (float)(local_130->_filename)._size; fVar25 = (lightSprite->_scale).x; (room->_lightSprite)._scale.y = (lightSprite->_scale).y * (float)(local_130->_filename)._capacity; (room->_lightSprite)._scale.x = fVar26 * fVar25; local_110.x = local_160.y + local_170.x; (room->_lightSprite)._rotation = lightSprite->_rotation + *(float *)&(local_130->_animState)._isPlaying; local_110.y = local_100.y + local_170.y; ANM2::Render((ANM2 *)(this->_roomList[0x99]._doors + 6),&local_110,&g_vectorZero, &g_vectorZero); this = (Game *)room; } } local_12c = (ANM2 *)((int)(local_12c->_filename)._buf + 1); local_154 = (float)((int)local_154 + 0x10); } while (local_12c < *(ANM2 **)((int)(local_108->_animDefaultName)._buf + 0xc)); } local_150.y = (float)((int)((std_string *)local_150.y)->_buf + 1); } while ((uint)local_150.y < (ANM2 *)0x2); this->_roomList[0x9a]._doors[1] = 0; uVar19 = (lightEntity->_sprite)._bitflags; param_2 = lightEntity; } if ((uVar19 >> 10 & 1) != 0) { local_120.x = (param_2->_pos).x + (param_2->_posOffset).x; local_120.y = (param_2->_pos).y + (param_2->_posOffset).y; pVVar7 = Isaac::GetRenderPosition(&local_194,&local_120,1); lightSprite = ¶m_2->_sprite; local_188.x = renderOffset.x + pVVar7->x; local_188.y = renderOffset.y + pVVar7->y; local_180.x = (float)&(param_2->_sprite)._overlayAnimState; local_180.y = (float)&(param_2->_sprite)._animState; local_154 = 0.0; local_12c = lightSprite; do { pvVar14 = *(void **)(*(int *)(local_178 + (int)local_154 * 4 + -8) + 4); local_160.y = (float)pvVar14; if (pvVar14 != (void *)0x0) { local_150.y = 0.0; if (*(int *)((int)pvVar14 + 0x1c) != 0) { iVar23 = 0; do { local_100.y = *(float *)(iVar23 + *(int *)((int)pvVar14 + 0x18)); layer = ANM2::GetLayer(lightSprite,(byte *)local_100.y); if ((layer->_bitflags & 4) != 0) { iVar1 = *(int *)((int)pvVar14 + 0x18); frameIndex = AnimationState::GetLayerFrameIdx(); AnimationLayer::RenderFrame ((AnimationLayer *)(iVar1 + iVar23),&local_188,frameIndex,&g_vectorZero, &g_vectorZero,local_12c); pvVar14 = (void *)local_160.y; } iVar23 = iVar23 + 0x10; local_150.y = (float)((int)((std_string *)local_150.y)->_buf + 1); lightSprite = local_12c; } while ((uint)local_150.y < *(ANM2 **)((int)pvVar14 + 0x1c)); } } local_154 = (float)((int)local_154 + 1); } while ((uint)local_154 < 2); this = (Game *)room; param_2 = lightEntity; } } iVar23 = param_2->_type; lightSprite = (ANM2 *)0x3f800000; if (iVar23 < 0x1a) { if (iVar23 == 0x19) { if ((param_2->_variant == 3) && (this->_roomList[0x28].Flags == 0x2e)) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.4,0.0,1.0); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); fVar26 = g_vectorOne.x * 0.8; this->_roomList[0x9a]._doors[0] = (int)(g_vectorOne.y * 0.8); this->_roomList[0x9a].AllowedDoors = (int)fVar26; local_110.x = (param_2->_pos).x + 0.0; local_110.y = (param_2->_pos).y - 16.0; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_100.y = renderOffset.x + pVVar7->x; local_160.y = renderOffset.y + pVVar7->y; uVar19 = RNG::Next(&flickerRng); pVVar7 = RandomVector(&local_128,uVar19); RNG::Next(&flickerRng); fVar26 = (float)((double)flickerRng._seed + __uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10; fVar26 = fVar26 + fVar26; local_120.y = fVar26 * pVVar7->y + local_160.y; local_120.x = fVar26 * pVVar7->x + local_100.y; LAB_00809a2f: pRVar21 = room; ANM2::Render(&room->_lightSprite,&local_120,&g_vectorZero,&g_vectorZero); goto LAB_00807b3d; } goto switchD_00809dea_caseD_2; } switch(iVar23) { case 1: if (param_2->_exists != 0) { local_110.x = (param_2->_pos).x + (param_2->_posOffset).x; local_110.y = (param_2->_pos).y + (param_2->_posOffset).y; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_170.x = renderOffset.x + pVVar7->x; local_170.y = renderOffset.y + pVVar7->y; local_108 = (ANM2 *)0x3f800000; if (((param_2->_temporaryeffects)._disabled == 0) && (pvVar14 = TemporaryEffects::GetNullEffect(¶m_2->_temporaryeffects,0x4a), pvVar14 != (void *)0x0)) { iVar23 = *(int *)((int)pvVar14 + 4); } else { iVar23 = 0; } local_150.y = (float)iVar23; if (5.0 <= local_150.y) { local_150.y = 5.0; } bVar5 = TemporaryEffects::HasNullEffect(¶m_2->_temporaryeffects,0x4a); if (bVar5 != 0) { BlendMode::SetMode(local_148,2,0); lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); layer = ANM2::GetLayer(lightSprite,(byte *)0x0); layer->_blendMode[0] = local_148._0_4_; layer->_blendMode[1] = local_148._4_4_; layer->_blendMode[2] = (int)local_140; layer->_blendMode[3] = (int)local_13c.x; layer->_blendMode[4] = (int)local_13c.y; Color::Reset(&lightColor); Color::SetTint(&lightColor,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; Color::operator_assign((Color *)&(room->_lightSprite)._color,(ColorMod *)&lightColor); fVar26 = (local_150.y + 2.0) * g_vectorOne.x; (room->_lightSprite)._scale.y = (local_150.y + 2.0) * g_vectorOne.y; (room->_lightSprite)._scale.x = fVar26; ANM2::Render(lightSprite,&local_170,&g_vectorZero,&g_vectorZero); BlendMode::SetMode(local_148,1,0); layer = ANM2::GetLayer(lightSprite,(byte *)0x0); layer->_blendMode[0] = local_148._0_4_; layer->_blendMode[1] = local_148._4_4_; layer->_blendMode[2] = (int)local_140; layer->_blendMode[3] = (int)local_13c.x; layer->_blendMode[4] = (int)local_13c.y; } bVar5 = Level::IsMausoleumHeartStage((Level *)g_game); if (bVar5 != 0) { local_108 = (ANM2 *)0x3f266666; } bVar5 = Entity_Player::IsHologram(param_2); if (bVar5 != 0) { local_108 = (ANM2 *)((float)local_108 * 0.3); } fVar26 = 0.0; costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x100); bVar5 = Entity_Player::IsItemCostumeVisible(param_2,costumeItem,(int)fVar26); if (bVar5 == 0) { fVar26 = -NAN; costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x101); bVar5 = Entity_Player::IsItemCostumeVisible(param_2,costumeItem,(int)fVar26); if ((bVar5 != 0) || (bVar5 = Entity_Player::IsNullItemCostumeVisible(param_2,0x38,0), bVar5 != 0)) goto LAB_008077c8; fVar26 = -NAN; costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,3); bVar5 = Entity_Player::IsItemCostumeVisible(param_2,costumeItem,(int)fVar26); if (bVar5 != 0) { LAB_00807700: roomAlias = room; if (param_2->_playerType == 0xc) { Color::Reset(&lightColor); Color::SetTint(&lightColor,1.0,0.0,0.03,1.0); color = (ColorMod *)&lightColor; lightColor._offset[0] = 0.0; lightColor._offset[1] = 0.0; lightColor._offset[2] = 0.0; } else { Color::Reset((Color *)local_c8); Color::SetTint((Color *)local_c8,0.9,0.3,1.0,1.0); local_a8 = (ANM2 *)0x0; color = (ColorMod *)local_c8; local_a4 = (void *)0x0; local_a0 = 0.0; } goto LAB_0080787f; } fVar26 = -NAN; costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,0xc0); bVar5 = Entity_Player::IsItemCostumeVisible(param_2,costumeItem,(int)fVar26); if (bVar5 != 0) goto LAB_00807700; fVar26 = -NAN; costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x23c); bVar5 = Entity_Player::IsItemCostumeVisible(param_2,costumeItem,(int)fVar26); if (bVar5 != 0) goto LAB_00807700; Color::Reset(&lightColor); Color::SetTint(&lightColor,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; Color::operator_assign((Color *)&(room->_lightSprite)._color,(ColorMod *)&lightColor); fVar26 = -NAN; costumeItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x5b); bVar5 = Entity_Player::IsItemCostumeVisible(param_2,costumeItem,(int)fVar26); if (bVar5 != 0) { fVar25 = g_vectorOne.x * 1.75; fVar26 = g_vectorOne.y * 1.75; goto LAB_008078ab; } bVar5 = Entity_Player::HasCollectible(param_2,0x22e,0); if (bVar5 != 0) goto LAB_0080788b; (roomAlias->_lightSprite)._scale.x = g_vectorOne.x; (roomAlias->_lightSprite)._scale.y = g_vectorOne.y; } else { LAB_008077c8: roomAlias = room; if (param_2->_playerType == 0xc) { Color::Reset(&lightColor2); Color::SetTint(&lightColor2,1.0,0.0,0.03,1.0); lightColor2._offset[0] = 0.0; color = (ColorMod *)&lightColor2; lightColor2._offset[1] = 0.0; lightColor2._offset[2] = 0.0; } else { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.9,0.8,1.0); color = (ColorMod *)local_68; local_48[0] = 0.0; local_48[1] = 0.0; local_40 = (void *)0x0; } LAB_0080787f: Color::operator_assign((Color *)&(roomAlias->_lightSprite)._color,color); LAB_0080788b: fVar25 = g_vectorOne.x * 1.5; fVar26 = g_vectorOne.y * 1.5; LAB_008078ab: (roomAlias->_lightSprite)._scale.y = fVar26; (roomAlias->_lightSprite)._scale.x = fVar25; } 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) { AnimationState::SetFrameFloat(&(roomAlias->_lightSprite)._animState,1.0); } uVar19 = Level::GetCurses((Level *)g_game); if ((uVar19 & 1) == 0) { fVar26 = g_game->_darknessStrength * g_game->_darknessModifier; } else { fVar26 = 1.0; } fVar25 = fVar26 * 0.5 + 1.0; fVar26 = fVar25 * g_vectorOne.x; (roomAlias->_lightSprite)._scale.y = fVar25 * g_vectorOne.y; (roomAlias->_lightSprite)._scale.x = fVar26; ANM2::Render(&roomAlias->_lightSprite,&local_170,&g_vectorZero,&g_vectorZero); if ((roomAlias->_lightSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(roomAlias->_lightSprite)._animState,0.0); } bVar5 = Entity_Player::HasCollectible(param_2,0x1a9,0); if (bVar5 != 0) { *(float *)&roomAlias->field_0x6ff8 = param_2->_bodyAngle - 90.0; Color::Reset((Color *)local_68); Color::operator_assign((Color *)&roomAlias->field_0x6ffc,(ColorMod *)local_68); BlendMode::SetMode(local_148,1,0); layer = ANM2::GetLayer((ANM2 *)&roomAlias->field_0x6f54,(byte *)0x0); layer->_blendMode[0] = local_148._0_4_; layer->_blendMode[1] = local_148._4_4_; layer->_blendMode[2] = (int)local_140; layer->_blendMode[3] = (int)local_13c.x; layer->_blendMode[4] = (int)local_13c.y; ANM2::Render((ANM2 *)&roomAlias->field_0x6f54,&local_170,&g_vectorZero,&g_vectorZero); roomAlias = room; } uVar19 = GetStageID(g_game,0); if ((uVar19 == 0xd) && (*(int *)(*(int *)((int)roomAlias->_descriptor + 0x10) + 8) == 5)) { uVar19 = (roomAlias->_entityList)._updateEL._size; uVar11 = 0; fVar26 = 0.1; if (uVar19 != 0) { do { iVar23 = *(int *)((int)(roomAlias->_entityList)._updateEL._data + uVar11 * 4); if ((*(int *)(iVar23 + 0x28) == 0x197) && (*(int *)(iVar23 + 0x2c) == 0)) { fVar26 = 1.0 - *(float *)(iVar23 + 0x380) / *(float *)(iVar23 + 900); break; } uVar11 = uVar11 + 1; } while (uVar11 < uVar19); } fVar26 = sin((float)g_game->_frameCount * (fVar26 * 0.18 + 0.02)); pVVar7 = &local_170; pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; fVar25 = (fVar26 + 3.0) * g_vectorOne.y; ((Vector *)((int)local_100.y + 0x9c))->x = (fVar26 + 3.0) * g_vectorOne.x; ((Vector *)((int)local_100.y + 0x9c))->y = fVar25; lightSprite = (ANM2 *)local_100.y; goto LAB_00807b32; } } break; case 2: Entity_Tear::TearFlags((Entity_Tear *)param_2,(BitSet128 *)tearFlags); local_154 = 0.0; local_130 = (ANM2 *)0x0; local_108 = (ANM2 *)(this->_roomList[0x99]._doors + 6); local_12c = (ANM2 *)0x3ecccccd; pFVar9 = (Font *)Sprite::Color((Sprite *)local_108); Font::SetLineHeightModifier(pFVar9,0.0); maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,(BitSet128 *)&DAT_00c34920); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if (bVar5 != 0) { color = (ColorMod *)Color::Color(); pAVar22 = local_108; Sprite::SetColor((Sprite *)local_108,color); lightSprite = (ANM2 *)((float)local_12c * 1.3); local_154 = 2.0; local_130 = (ANM2 *)0x1; local_12c = lightSprite; goto LAB_00808404; } maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,(BitSet128 *)&DAT_00c34ac0); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if (bVar5 == 0) { maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,(BitSet128 *)&DAT_00c34c00); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if (bVar5 != 0) goto LAB_00808253; maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,(BitSet128 *)&DAT_00c34a00); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if (bVar5 != 0) goto LAB_00808253; maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,(BitSet128 *)&DAT_00c34ab0); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if (bVar5 != 0) goto LAB_00808253; maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,(BitSet128 *)&DAT_00c34900); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if (bVar5 == 0) { iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 0x2e) { color = (ColorMod *)Color::Color(); pAVar22 = local_108; Sprite::SetColor((Sprite *)local_108,color); local_154 = 2.0; } else { bVar5 = IsInTimedSet(g_game,0x26); if (bVar5 == 0) { iVar23 = Entity::Variant((Entity *)param_2); if ((iVar23 == 0xd) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 == 0x17)) { seeds = (Seeds *)GetSeeds(g_game); bVar5 = Seeds::HasSeedEffect(seeds,0x4f); if (bVar5 != 0) goto LAB_008083e7; } maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)tearFlags,&g_tearFlagLudovico); bVar5 = BitSet128::IsNonZero(maskedTearFlags); if ((bVar5 == 0) || (cVar4 = FUN_004f88e0(), cVar4 == '\0')) { pAVar22 = local_108; } else { lightSprite = (ANM2 *)0x3f800000; color = (ColorMod *)Color::Color(); pAVar22 = local_108; Sprite::SetColor((Sprite *)local_108,color); } } else { LAB_008083e7: color = (ColorMod *)Entity::GetColor((Entity *)param_2); pAVar22 = local_108; Sprite::SetColor((Sprite *)local_108,color); } } } else { color = (ColorMod *)Color::Color(); pAVar22 = local_108; Sprite::SetColor((Sprite *)local_108,color); local_154 = 6.0; } } else { LAB_00808253: color = (ColorMod *)Color::Color(); pAVar22 = local_108; Sprite::SetColor((Sprite *)local_108,color); } LAB_00808404: FUN_0060cd50(); local_150.y = (float)lightSprite; if (0.0 < (float)lightSprite) { Sprite::Color((Sprite *)pAVar22); Sprite::Color((Sprite *)local_108); fVar24 = (float10)Color::R(); local_100.y = (float)(fVar24 + (float10)local_150.y); FUN_005cd370(); pFVar9 = (Font *)Sprite::Color((Sprite *)local_108); Sprite::Color((Sprite *)local_108); fVar24 = (float10)Color::A(); local_100.y = (float)(fVar24 + (float10)local_150.y); Font::SetLineHeightModifier(pFVar9,local_100.y); } lightSprite = local_108; Sprite::Color((Sprite *)local_108); fVar24 = (float10)Color::A(); local_100.y = (float)fVar24; if (0.0 < local_100.y) { pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,(float *)&local_12c); Sprite::SetScale((Sprite *)lightSprite,pVVar7); if (local_130 != (ANM2 *)0x0) { Sprite::SetFrame_1((Sprite *)lightSprite,(int)local_130); } pVVar7 = Entity::Position((Entity *)param_2,&local_13c); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)param_2); pVVar7 = Vector::__add(pVVar7,&local_128,pVVar20); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_110,uVar19); pVVar20 = Vector::__mul(pVVar20,&local_120,&local_154); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_180,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_170,&renderOffset); lightSprite = local_108; ANM2::Render(local_108,pVVar7,pVVar20,pVVar16); if (local_130 != (ANM2 *)0x0) { Sprite::SetFrame_1((Sprite *)lightSprite,0); } } break; case 3: if (param_2->_variant == 0x3e) { if (param_2->_visible != 0) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.8,0.8,1.0); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); fVar26 = g_vectorOne.y * 0.4; this->_roomList[0x9a].AllowedDoors = (int)(g_vectorOne.x * 0.4); this->_roomList[0x9a]._doors[0] = (int)fVar26; if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat ((AnimationState *)&this->_roomList[0x99].BossDeathSeed,1.0); } local_110.y = (param_2->_pos).y - 14.0; goto LAB_00807d20; } } else if ((param_2->_variant == 0xce) && (param_2->_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 = ANM2::GetLayer(¶m_2->_sprite,(byte *)0x0); local_68._0_4_ = (param_2->_sprite)._color._tint[0]; local_68._4_4_ = (param_2->_sprite)._color._tint[1]; fStack_60 = (param_2->_sprite)._color._tint[2]; fStack_5c = (param_2->_sprite)._color._tint[3]; local_40 = (void *)(param_2->_sprite)._color._offset[2]; local_58 = (param_2->_sprite)._color._colorize[0]; fStack_54 = (param_2->_sprite)._color._colorize[1]; fStack_50 = (param_2->_sprite)._color._colorize[2]; fStack_4c = (param_2->_sprite)._color._colorize[3]; local_48 = *(float (*) [2])(param_2->_sprite)._color._offset; Color::__mul((Color *)local_68,&layer->_color); Color::operator_assign(&lightColor2,(ColorMod *)local_68); Color::apply_to_kcolor(&layer0Color,(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 = ANM2::GetLayer(¶m_2->_sprite,(byte *)0x1); local_68._0_4_ = (param_2->_sprite)._color._tint[0]; local_68._4_4_ = (param_2->_sprite)._color._tint[1]; fStack_60 = (param_2->_sprite)._color._tint[2]; fStack_5c = (param_2->_sprite)._color._tint[3]; local_40 = (void *)(param_2->_sprite)._color._offset[2]; local_58 = (param_2->_sprite)._color._colorize[0]; fStack_54 = (param_2->_sprite)._color._colorize[1]; fStack_50 = (param_2->_sprite)._color._colorize[2]; fStack_4c = (param_2->_sprite)._color._colorize[3]; local_48 = *(float (*) [2])(param_2->_sprite)._color._offset; Color::__mul((Color *)local_68,&layer->_color); Color::operator_assign(&lightColor2,(ColorMod *)local_68); Color::apply_to_kcolor((KColor *)(local_c8 + 0x18),(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 = (float)local_c8._24_4_; local_194.y = (float)local_a8; if (layer0Color._green * 0.7152 + layer0Color._red * 0.2126 + layer0Color._blue * 0.0722 <= ((float)local_ac * 0.7152 + (float)local_c8._24_4_ * 0.2126 + (float)local_a8 * 0.0722) - 0.25) { Color::Reset((Color *)local_68); lightSprite = (ANM2 *)local_1b0.y; pvVar14 = (void *)local_1b8.y; pAVar22 = (ANM2 *)local_194.y; } else { Color::Reset((Color *)local_68); lightSprite = (ANM2 *)local_188.y; pvVar14 = (void *)local_160.y; pAVar22 = (ANM2 *)local_100.y; } Color::SetTint((Color *)local_68,(float)lightSprite,(float)pvVar14,(float)pAVar22,1.0); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); layer = ANM2::GetLayer(¶m_2->_sprite,(byte *)0x0); fVar26 = (layer->_size).y; this->_roomList[0x9a].AllowedDoors = (int)((layer->_size).x * 0.4); this->_roomList[0x9a]._doors[0] = (int)(fVar26 * 0.4); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)&this->_roomList[0x99].BossDeathSeed,1.0); } local_110.y = (param_2->_pos).y - 9.0; LAB_00807d20: local_110.x = (param_2->_pos).x + 0.0; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_120.y = renderOffset.y + pVVar7->y; local_120.x = renderOffset.x + pVVar7->x; ANM2::Render((ANM2 *)(this->_roomList[0x99]._doors + 6),&local_120,&g_vectorZero, &g_vectorZero); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)&this->_roomList[0x99].BossDeathSeed,0.0); } } break; case 4: iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 8) { color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); local_100.y = 0.75; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),pVVar7); pVVar20 = Entity::Position((Entity *)param_2,&local_128); pVVar7 = &local_13c; goto LAB_00808e0d; } lightSprite = (ANM2 *)Entity::GetSprite((Entity *)param_2); local_100.y = (float)ANM2::GetLayer(lightSprite,(byte *)"sparks"); if ((ANM2 *)local_100.y != (ANM2 *)0x0) { Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); iVar23 = _ptr_deref_or_minus1(); pvVar14 = AnimationState::GetLayerFrame(pAVar13,iVar23); if ((pvVar14 != (void *)0x0) && (*(char *)((int)pvVar14 + 0x2c) != '\0')) { local_100.y = 0.5; pVVar7 = Vector::operator_mul(&local_13c,&local_100.y,(Vector *)((int)pvVar14 + 8)); pVVar7 = Vector::__sub(pVVar7,&local_128,(Vector *)((int)pvVar14 + 0x20)); pVVar7 = Vector::Mul(pVVar7,&local_110,(Vector *)((int)pvVar14 + 0x18)); Vector::__add((Vector *)((int)pvVar14 + 0x10),&local_160,pVVar7); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); fVar24 = (float10)Sprite::Rotation(sprite); pVVar7 = Vector::Rotated(&local_160,&local_13c,(float)fVar24); Vector::operator_assign(&local_160,pVVar7); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); Sprite::Scale(sprite); FUN_00a10570(); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); cVar4 = Sprite::FlipX(sprite); if (cVar4 != '\0') { local_160.x = -local_160.x; } sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); cVar4 = Sprite::FlipY(sprite); if (cVar4 != '\0') { local_160.y = (float)((uint)local_160.y ^ 0x80000000); } lightSprite = &room->_lightSprite; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,color); local_100.y = 0.3; pVVar7 = Vector::operator_mul(&local_13c,&local_100.y,&g_vectorOne); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)lightEntity,&local_128); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_110,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,&local_120,&renderOffset); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&local_160); goto LAB_00807b32; } } break; default: goto switchD_008072ae_caseD_5; case 7: cVar4 = Entity::Visible((Entity *)param_2); if (cVar4 == '\0') break; sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); local_100.y = (float)Sprite::GetNullFrame(sprite,(byte *)"Light"); if ((ANM2 *)local_100.y == (ANM2 *)0x0) { uVar10 = Entity::Variant((Entity *)param_2); switch(uVar10) { case 3: case 10: break; case 4: break; case 5: case 8: break; default: Entity::GetSprite((Entity *)param_2); lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); local_108 = lightSprite; cVar4 = _has_flag_0x110(); if (cVar4 == '\0') { Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); lightSprite = local_108; Sprite::SetColor((Sprite *)local_108,color); local_108 = lightSprite; goto LAB_008087d4; } color = (ColorMod *)Entity::GetColor((Entity *)param_2); Sprite::SetColor((Sprite *)lightSprite,color); goto LAB_008087da; case 7: } local_108 = (ANM2 *)(this->_roomList[0x99]._doors + 6); Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); lightSprite = local_108; Sprite::SetColor((Sprite *)local_108,color); LAB_008087d4: param_2 = lightEntity; LAB_008087da: iVar23 = Entity::Variant((Entity *)param_2); if (((iVar23 == 2) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 == 10)) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 == 7)) { pfVar6 = (float *)Entity::SpriteScale((Entity *)param_2); local_100.y = *pfVar6 * 0.35; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); local_108 = lightSprite; } else { pfVar6 = (float *)Entity::SpriteScale((Entity *)param_2); local_100.y = *pfVar6 * 0.75; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); } } else { local_108 = (ANM2 *)(this->_roomList[0x99]._doors + 6); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); Sprite::SetColor((Sprite *)local_108,color); pVVar7 = Vector::Mul(&g_vectorOne,&local_13c,(Vector *)&((std_string *)local_100.y)->_size); param_2 = lightEntity; pfVar6 = (float *)Entity::SpriteScale((Entity *)lightEntity); pVVar7 = Vector::__mul(pVVar7,&local_128,pfVar6); lightSprite = local_108; Sprite::SetScale((Sprite *)local_108,pVVar7); } EntityPtr::clear((EntityPtr *)&local_170); Entity::PositionOffset((Entity *)param_2); pVVar7 = (Vector *)Vector::mul_065(); Vector::__add(&renderOffset,&local_120,pVVar7); cVar4 = Entity_Laser::IsSampleLaser((Entity_Laser *)param_2); if (cVar4 == '\0') { pVVar7 = Entity::Position((Entity *)param_2,&local_13c); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)param_2); Vector::__add(pVVar7,(Vector *)local_178,pVVar20); piVar12 = (int *)Entity_Laser::GetEndPoint((Entity_Laser *)param_2); local_180.x = (float)*piVar12; local_180.y = (float)piVar12[1]; local_150.y = 0.0; do { local_130 = (ANM2 *)((float)(int)local_150.y / 19.0); iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 4) { pfVar6 = (float *)Entity::SpriteScale((Entity *)param_2); local_100.y = ((float)local_130 * 0.7 + 0.3) * *pfVar6 * 0.75; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); lightSprite = local_108; Sprite::SetScale((Sprite *)local_108,pVVar7); } else { lightSprite = local_108; } bVar5 = 1; pVVar7 = vector_lerp(&local_128,(Vector *)local_178,&local_180,0,(float)local_130); Isaac::GetRenderPosition(&local_110,pVVar7,bVar5); pVVar7 = Vector::__sub(&local_110,&local_188,&local_170); local_160.y = Vector::LengthSquared(pVVar7); if (0.0 <= local_160.y) { Vector::operator_assign(&local_170,&local_110); bVar5 = 1; pVVar7 = vector_lerp(&local_194,(Vector *)local_178,&local_180,0,(float)local_130); pVVar7 = Isaac::GetRenderPosition(&local_1b8,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_1b0,&renderOffset); ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); } local_150.y = (float)((int)((std_string *)local_150.y)->_buf + 1); } while ((int)local_150.y < 0x14); } else { local_108 = (ANM2 *)Entity_Laser::GetNonOptimizedSamples(); iVar23 = FUN_0042f160(); if (iVar23 != 0) { iVar23 = FUN_0042f160(); local_160.y = 1.4013e-45; local_100.y = (float)(iVar23 / 0x14); pfVar6 = (float *)std::max(); uVar19 = 0; local_160.y = *pfVar6; iVar23 = FUN_0042f160(); if (iVar23 != 0) { do { bVar5 = 1; pVVar7 = (Vector *)std::vector::operator__(); Isaac::GetRenderPosition(&local_110,pVVar7,bVar5); pVVar7 = Vector::__sub(&local_110,&local_13c,&local_170); local_100.y = Vector::LengthSquared(pVVar7); if (0.0 <= local_100.y) { Vector::operator_assign(&local_170,&local_110); bVar5 = 1; pVVar7 = (Vector *)std::vector::operator__(); pVVar7 = Isaac::GetRenderPosition(&local_128,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&local_120); ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); } uVar19 = uVar19 + (int)local_160.y; uVar11 = FUN_0042f160(); } while (uVar19 < uVar11); } bVar5 = 1; pVVar7 = (Vector *)EntityPtr::Ref(); pVVar7 = Isaac::GetRenderPosition(&local_13c,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_128,&local_120); goto LAB_00807b32; } } break; case 9: iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 2) { sprite = (Sprite *)(this->_roomList[0x99]._doors + 6); Entity::GetColor((Entity *)lightEntity); Color::Color(0x3f800000); color = (ColorMod *)FUN_004072e0(); Sprite::SetColor(sprite,color); Sprite::SetScale(sprite,&g_vectorOne); bVar5 = 1; pVVar7 = Entity::Position((Entity *)lightEntity,&local_13c); pVVar7 = Isaac::GetRenderPosition(&local_128,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,&local_110,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_120,uVar19); fVar26 = RNG::RandomFloat(&flickerRng); local_100.y = fVar26 * 3.0; pVVar20 = Vector::__mul(pVVar20,(Vector *)local_178,&local_100.y); pVVar15 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_180,pVVar20); pRVar21 = room; ANM2::Render(&room->_lightSprite,pVVar7,pVVar16,pVVar15); goto LAB_00807b3d; } local_100.y = Room::GetLightingAlpha((Room *)this); if (0.5 < local_100.y) { color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); local_100.y = 0.1; goto LAB_0080ae36; } } goto switchD_00809dea_caseD_2; } if (iVar23 < 0x332) { if (iVar23 == 0x331) { if (param_2->_variant == 1) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.8,0.4,1.0); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); this->_roomList[0x9a].AllowedDoors = (int)g_vectorOne.x; this->_roomList[0x9a]._doors[0] = (int)g_vectorOne.y; local_110.x = (param_2->_pos).x + 0.0; local_110.y = (param_2->_pos).y - 16.0; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_100.y = renderOffset.x + pVVar7->x; local_160.y = renderOffset.y + pVVar7->y; uVar19 = RNG::Next(&flickerRng); pVVar7 = RandomVector(&local_128,uVar19); RNG::Next(&flickerRng); fVar26 = (float)((double)flickerRng._seed + __uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10; fVar26 = fVar26 + fVar26; local_120.y = pVVar7->y * fVar26 + local_160.y; local_120.x = fVar26 * pVVar7->x + local_100.y; goto LAB_00809a2f; } } else { if (iVar23 < 0x108) { if (iVar23 == 0x107) { color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); local_100.y = 2.0; LAB_0080968a: pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),pVVar7); pVVar7 = Entity::Position((Entity *)param_2,&local_128); pVVar20 = Vector::Vector(&local_13c,0.0,-15.0); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_110,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_120,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_180,uVar19); local_100.y = RNG::RandomFloat(&flickerRng); goto LAB_0080972b; } if (iVar23 != 0x21) { if (iVar23 != 0x55) goto switchD_008072ae_caseD_5; iVar23 = Room::GetBossID((Room *)this); if (iVar23 != 0x33) { cVar4 = FUN_004f88e0(); if (cVar4 == '\0') goto switchD_00809dea_caseD_2; } lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,color); local_100.y = 0.3; goto LAB_008092a3; } fVar24 = (float10)Entity::HitPoints((Entity *)param_2); local_100.y = (float)fVar24; if (local_100.y <= 1.0) goto switchD_00809dea_caseD_2; fVar24 = (float10)Entity::HitPoints((Entity *)param_2); local_100.y = (float)fVar24; fVar24 = (float10)Entity::MaxHitPoints(); local_150.y = 1.0; local_12c = (ANM2 *)(float)((float10)1 - (float10)local_100.y / fVar24); iVar23 = Entity::Variant((Entity *)param_2); if ((((iVar23 == 3) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 == 0xd)) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 == 2)) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 == 0xc)) { local_108 = (ANM2 *)(this->_roomList[0x99]._doors + 6); LAB_00809546: color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); } else { sprite = (Sprite *)(this->_roomList[0x99]._doors + 6); local_154 = 1.0 - (float)local_12c * 0.5; local_108 = (ANM2 *)sprite; iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 1) goto LAB_00809546; iVar23 = Entity::Variant((Entity *)param_2); if ((iVar23 == 4) || (iVar23 = Entity::Variant((Entity *)param_2), iVar23 != 0xb)) { color = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,color); local_108 = (ANM2 *)sprite; } else { color = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,color); local_150.y = 0.4; local_108 = (ANM2 *)sprite; } } local_160.y = 1.2 - (float)local_12c * 0.2; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_160.y); pVVar7 = Vector::__mul(pVVar7,&local_128,&local_150.y); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),pVVar7); bVar5 = 1; pVVar7 = Entity::Position((Entity *)param_2,&local_110); pVVar7 = Isaac::GetRenderPosition(&local_13c,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,&local_128,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_120,uVar19); fVar26 = RNG::RandomFloat(&flickerRng); local_100.y = fVar26 * 3.0; pVVar15 = Vector::__mul(pVVar20,(Vector *)local_178,&local_100.y); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_180,pVVar15); lightSprite = local_108; goto LAB_00807b32; } if (iVar23 == 0x111) { iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 10) { color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); local_100.y = 1.5; goto LAB_0080968a; } } else { if (iVar23 != 0x328) goto switchD_008072ae_caseD_5; if (param_2->_visible != 0) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.8,0.4,1.0); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); fVar26 = g_vectorOne.y * 0.8; this->_roomList[0x9a].AllowedDoors = (int)(g_vectorOne.x * 0.8); this->_roomList[0x9a]._doors[0] = (int)fVar26; local_110.x = (param_2->_pos).x + 0.0; local_110.y = (param_2->_pos).y - 16.0; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); local_120.y = renderOffset.y + pVVar7->y; local_120.x = renderOffset.x + pVVar7->x; pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = &local_120; goto LAB_00807b32; } } } goto switchD_00809dea_caseD_2; } switch(iVar23) { case 0x332: if (param_2->_variant == 2) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,1.0,0.7,1.0); local_48[0] = 0.0; local_48[1] = 0.0; local_40 = (void *)0x0; Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); local_188.y = (float)(this->_roomList[0x99]._doors + 6); fVar26 = g_vectorOne.y * 0.6; this->_roomList[0x9a].AllowedDoors = (int)(g_vectorOne.x * 0.6); this->_roomList[0x9a]._doors[0] = (int)fVar26; if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)&this->_roomList[0x99].BossDeathSeed,1.0); } local_110.y = (param_2->_pos).y; local_110.x = (param_2->_pos).x; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_100.y = renderOffset.x + pVVar7->x; local_160.y = renderOffset.y + pVVar7->y; uVar19 = RNG::Next(&flickerRng); pVVar7 = RandomVector(&local_128,uVar19); RNG::Next(&flickerRng); fVar26 = (float)((double)flickerRng._seed + __uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10 * 3.0; local_120.y = fVar26 * pVVar7->y + local_160.y; local_120.x = fVar26 * pVVar7->x + local_100.y; LAB_00809c03: ANM2::Render((ANM2 *)local_188.y,&local_120,&g_vectorZero,&g_vectorZero); LAB_00809c21: pRVar21 = room; if ((room->_lightSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(room->_lightSprite)._animState,0.0); } goto LAB_00807b3d; } break; default: switchD_008072ae_caseD_5: bVar5 = Entity::IsEnemy((Entity *)param_2); if ((((bVar5 == 0) || (uVar19 = Entity::GetEntityFlags((Entity *)param_2), (uVar19 & 0x1000) == 0)) && (bVar5 = Entity::IsType((Entity *)param_2,0x36,-1,-1), bVar5 == 0)) && ((bVar5 = Entity::IsType((Entity *)param_2,10,2,-1), bVar5 == 0 && (bVar5 = Entity::IsType((Entity *)param_2,0xd0,2,-1), bVar5 == 0)))) { bVar5 = Entity::IsType((Entity *)param_2,0xe2,2,-1); if (bVar5 == 0) break; } color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),&g_vectorOne); pVVar7 = Entity::Position((Entity *)param_2,&local_13c); pVVar20 = Vector::Vector(&local_128,0.0,-15.0); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_110,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_120,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_180,uVar19); fVar26 = RNG::RandomFloat(&flickerRng); local_100.y = fVar26 * 3.0; goto LAB_0080972b; case 0x387: iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 0) { iVar23 = FUN_00447760(); if (iVar23 == 0x71) { LAB_0080b3a9: sprite = (Sprite *)(this->_roomList[0x99]._doors + 6); color = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,color); Sprite::SetScale(sprite,&g_vectorOne); pVVar20 = Entity::Position((Entity *)lightEntity,&local_13c); pVVar7 = &local_128; } else { iVar23 = FUN_00447760(); if (iVar23 != 0x68) break; sprite = (Sprite *)(this->_roomList[0x99]._doors + 6); color = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,color); local_100.y = 1.5; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale(sprite,pVVar7); pVVar20 = Entity::Position((Entity *)lightEntity,&local_128); pVVar7 = &local_13c; } lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); pVVar7 = Vector::Vector(pVVar7,0.0,-14.0); bVar5 = 1; pVVar7 = Vector::__add(pVVar20,&local_110,pVVar7); pVVar7 = Isaac::GetRenderPosition(&local_120,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&renderOffset); goto LAB_00807b32; } iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 1) { iVar23 = FUN_00447760(); if (0x68 < iVar23) goto LAB_0080b3a9; } else { iVar23 = Entity::Variant((Entity *)param_2); if (iVar23 == 0x14) { sprite = (Sprite *)(this->_roomList[0x99]._doors + 6); color = (ColorMod *)Color::Color(); Sprite::SetColor(sprite,color); local_100.y = 0.6; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale(sprite,pVVar7); Sprite::SetFrame_1(sprite,1); pVVar7 = Entity::Position((Entity *)lightEntity,&local_128); pVVar20 = Vector::Vector(&local_13c,0.0,-14.0); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_110,pVVar20); pVVar20 = Isaac::GetRenderPosition(&local_120,pVVar7,bVar5); pVVar7 = (Vector *)local_178; goto LAB_0080a2e8; } } break; case 0x389: Entity::GetSprite((Entity *)param_2); Config::GetPillEffects(); local_12c = (ANM2 *)GridEntity::GetType(); if (local_12c != (ANM2 *)0x0) { uVar19 = 0; if (*(int *)((int)(local_12c->_animDefaultName)._buf + 4) != 0) { local_150.y = 0.0; do { local_130 = *(ANM2 **)((int)((std_string *)local_150.y)->_buf + *(int *)(local_12c->_animDefaultName)._buf); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); Sprite::GetLayer(sprite,(byte *)local_130); layerName = (std_string *)_get_name_string(); local_14._0_1_ = 1; isFlameLayer = str_eq_cstr(layerName,(byte *)"flame"); local_14 = (float)((uint)local_14._1_3_ << 8); std::string::_Tidy_deallocate(local_c8 + 0x14); if (isFlameLayer != 0) { if (-1 < (int)uVar19) { Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); local_160.y = (float)AnimationState::GetLayerFrame(pAVar13,(int)local_130); if (((void *)local_160.y != (void *)0x0) && (*(char *)((int)local_160.y + 0x2c) != '\0')) { pVVar7 = Vector::Vector(&local_13c,33.0,37.0); local_100.y = 96.0; Vector::__div(pVVar7,(Vector *)local_178,&local_100.y); pVVar7 = Vector::Vector(&local_128,31.0,35.0); local_100.y = 96.0; Vector::__div(pVVar7,&local_120,&local_100.y); pVVar7 = Vector::Vector(&local_180,62.0,39.0); local_100.y = 96.0; Vector::__div(pVVar7,&local_110,&local_100.y); pVVar7 = Vector::Vector(&local_170,39.0,35.0); local_100.y = 96.0; Vector::__div(pVVar7,&local_188,&local_100.y); local_100.y = (float)(uVar19 * 0x10 + *(int *)(local_12c->_animDefaultName)._buf); lightSprite = (ANM2 *)Entity::GetSprite((Entity *)param_2); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); layer = Sprite::GetLayer(sprite,(byte *)local_130); fVar26 = 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 (*(float *)((int)fVar26 + 0x14) == 864.0) { lightSprite = (ANM2 *)&local_110; } else { lightSprite = (ANM2 *)&local_120; if (*(float *)((int)fVar26 + 0x10) < 576.0) { lightSprite = (ANM2 *)local_178; } } local_150.y = (float)lightSprite; pVVar7 = Vector::__sub(&local_238,&local_13c,&flameQuad); pVVar7 = Vector::__mul(pVVar7,&local_128,(float *)lightSprite); pVVar7 = Vector::__add(&flameQuad,&local_180,pVVar7); pVVar20 = Vector::__sub(local_230,&local_170,&flameQuad); pVVar20 = Vector::__mul(pVVar20,&local_100, (float *)((int)((std_string *)local_150.y)->_buf + 4)); Vector::__add(pVVar7,&local_194,pVVar20); pRVar21 = room; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&pRVar21->_lightSprite,color); local_100.y = 0.6; pVVar7 = Vector::__mul(&g_vectorOne,&local_160,&local_100.y); Sprite::SetScale((Sprite *)&pRVar21->_lightSprite,pVVar7); bVar5 = 1; pVVar7 = Entity::Position((Entity *)param_2,&local_1b8); pVVar7 = Isaac::GetRenderPosition(&local_13c,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,&local_128,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_180,uVar19); local_100.y = RNG::RandomFloat(&flickerRng); pVVar20 = Vector::__mul(pVVar20,&local_170,&local_100.y); local_160.y = 0.75; pVVar16 = Vector::__mul(pVVar20,&local_1b0,&local_160.y); pVVar20 = &local_150; goto LAB_00809757; } } break; } uVar19 = uVar19 + 1; local_150.y = (float)&((std_string *)local_150.y)->_size; } while (uVar19 < (uint)*(int *)((int)(local_12c->_animDefaultName)._buf + 4)); } } break; case 0x3c5: if (this->_roomList[0x28].Flags == 0x2e) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.4,0.0,0.5); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); local_188.y = (float)(this->_roomList[0x99]._doors + 6); fVar26 = g_vectorOne.y * 0.6; this->_roomList[0x9a].AllowedDoors = (int)(g_vectorOne.x * 0.6); this->_roomList[0x9a]._doors[0] = (int)fVar26; if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)&this->_roomList[0x99].BossDeathSeed,1.0); } local_110.y = (param_2->_pos).y - 12.0; local_110.x = (param_2->_pos).x + 0.0; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_100.y = renderOffset.x + pVVar7->x; local_160.y = renderOffset.y + pVVar7->y; uVar19 = RNG::Next(&flickerRng); pVVar7 = RandomVector(&local_128,uVar19); RNG::Next(&flickerRng); fVar26 = (float)((double)flickerRng._seed + __uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10; fVar26 = fVar26 + fVar26; local_120.y = pVVar7->y * fVar26 + local_160.y; local_120.x = fVar26 * pVVar7->x + local_100.y; goto LAB_00809c03; } break; case 1000: switch(param_2->_variant) { case 1: iVar23 = g_game->_frameCount - param_2->_spawnFrame; if (iVar23 < 7) { local_100.y = (float)iVar23 / 6.0; Color::Reset((Color *)local_c8); Color::SetTint((Color *)local_c8,1.0,1.0,1.0,1.0 - local_100.y * local_100.y); local_a8 = (ANM2 *)0x3e48c8ca; local_a4 = (void *)0x3e48c8ca; local_a0 = 0.19607845; Color::__mul((Color *)local_c8,&(param_2->_sprite)._color); Color::operator_assign((Color *)local_68,(ColorMod *)local_c8); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); local_100.y = (float)(this->_roomList[0x99]._doors + 6); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat ((AnimationState *)&this->_roomList[0x99].BossDeathSeed, (float)(1.5 < (param_2->_sprite)._scale.x)); } fVar26 = (param_2->_sprite)._scale.y; this->_roomList[0x9a].AllowedDoors = (int)((param_2->_sprite)._scale.x * 1.5); this->_roomList[0x9a]._doors[0] = (int)(fVar26 * 1.5); local_110.y = (param_2->_pos).y; local_110.x = (param_2->_pos).x; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_120.y = renderOffset.y + pVVar7->y; local_120.x = renderOffset.x + pVVar7->x; ANM2::Render((ANM2 *)local_100.y,&local_120,&g_vectorZero,&g_vectorZero); Sprite::SetFrame_1((Sprite *)local_100.y,0); } break; case 10: sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); Sprite::Color(sprite); Color::A(); color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),&g_vectorOne); pVVar20 = Entity::Position((Entity *)param_2,&local_13c); pVVar7 = &local_128; goto LAB_00808e0d; case 0x16: case 0x17: lightSprite = (ANM2 *)Room::GetLightingAlpha((Room *)this); local_100.y = (float)lightSprite; if (0.5 < (float)lightSprite) { pVVar7 = Entity::Position((Entity *)param_2,&local_13c); local_130 = (ANM2 *)Room::GetGridIndex((Room *)this,pVVar7); local_12c = (ANM2 *)&this->_roomList[0x9f].ShopItemIdx; std::set::find(); std::iterator_copy(local_12c,&local_160.y); cVar4 = FUN_00557bb0(); if (cVar4 != '\0') { pfVar6 = (float *)Entity::SpriteScale((Entity *)param_2); FUN_00417340(); local_100.y = (float)lightSprite * *pfVar6; Entity::GetColor((Entity *)param_2); fVar24 = (float10)Color::A(); local_150.y = (float)fVar24; iVar23 = Entity::FrameCount((Entity *)param_2); if (iVar23 < 10) { Entity::FrameCount((Entity *)param_2); } lightSprite = &room->_lightSprite; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,color); local_100.y = local_100.y * 0.02; local_160.y = 0.5; pfVar6 = (float *)std::max(); pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,pfVar6); Sprite::SetScale((Sprite *)lightSprite,pVVar7); bVar5 = 1; pVVar7 = Entity::Position((Entity *)param_2,&local_128); pVVar7 = Isaac::GetRenderPosition(&local_13c,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_110,&renderOffset); ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); std::set::insert(); } } break; case 0x1e: case 0x99: EVar2 = param_2->_spawnerEntity; if ((EVar2 != (EntityPtr)0x0) && (((1 < *(int *)&g_game->_deathmatchManager && (*(int *)((int)EVar2 + 0x28) == 1)) || (*(int *)((int)EVar2 + 0x28) - 10U < 0x3de)))) { cVar4 = is_local_player_owned(); if (cVar4 == '\0') break; } pvVar14 = AnimationState::GetLayerFrame(&(param_2->_sprite)._animState,0); if ((pvVar14 != (void *)0x0) && (*(char *)((int)pvVar14 + 0x2c) != '\0')) { Color::Reset((Color *)local_68); Color::SetTint((Color *)local_68,1.0,0.0,0.0,1.0); Color::operator_assign((Color *)(this->_roomList[0x9a]._doors + 2),(ColorMod *)local_68); fVar26 = (param_2->_sprite)._scale.y; this->_roomList[0x9a].AllowedDoors = (int)((param_2->_sprite)._scale.x * 0.5); this->_roomList[0x9a]._doors[0] = (int)(fVar26 * 0.5); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { AnimationState::SetFrameFloat((AnimationState *)&this->_roomList[0x99].BossDeathSeed,1.0); } lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); layer = ANM2::GetLayer(lightSprite,(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 = (param_2->_pos).y; local_110.x = (param_2->_pos).x; pVVar7 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_120.y = renderOffset.y + pVVar7->y; local_120.x = renderOffset.x + pVVar7->x; ANM2::Render(lightSprite,&local_120,&g_vectorZero,&g_vectorZero); layer = ANM2::GetLayer(lightSprite,(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: iVar23 = Entity::Parent((Entity *)param_2); if (iVar23 == 0) { Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); pvVar14 = AnimationState::GetLayerFrame(pAVar13,0); if (pvVar14 == (void *)0x0) break; fVar24 = (float10)Color::A(); local_100.y = (float)fVar24; fVar24 = (float10)Color::B(); local_160.y = (float)fVar24; fVar24 = (float10)Color::G(); local_188.y = (float)fVar24; fVar24 = (float10)Color::R(); lightSprite = &room->_lightSprite; local_194.y = (float)fVar24; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,color); local_100.y = 1.5; LAB_008092a3: pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); goto LAB_008092c5; } break; case 0x33: case 0x34: color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),&g_vectorOne); pVVar20 = Entity::Position((Entity *)param_2,&local_13c); pVVar7 = &local_128; LAB_00808e0d: pVVar7 = Vector::Vector(pVVar7,0.0,-15.0); bVar5 = 1; pVVar7 = Vector::__add(pVVar20,&local_110,pVVar7); pVVar7 = Isaac::GetRenderPosition(&local_120,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector(&local_180,uVar19); fVar26 = RNG::RandomFloat(&flickerRng); local_100.y = fVar26 + fVar26; LAB_0080972b: pVVar16 = Vector::__mul(pVVar20,&local_170,&local_100.y); pVVar20 = &local_160; LAB_00809757: bottomrightclamp = &g_vectorZero; pVVar15 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,pVVar20,pVVar16); pRVar21 = room; ANM2::Render(&room->_lightSprite,pVVar7,pVVar15,bottomrightclamp); goto LAB_00807b3d; case 0x41: color = (ColorMod *)Entity::SplatColor((Entity *)param_2); Color::operator_assign((Color *)local_68,color); pfVar6 = (float *)Entity::SpriteScale((Entity *)param_2); Font::SetLineHeightModifier((Font *)local_68,*pfVar6); color = (ColorMod *)local_68; goto LAB_0080a338; case 0x46: local_100.y = 1.0; Entity::IsDead((Entity *)param_2); Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); lightSprite = &room->_lightSprite; Sprite::SetColor((Sprite *)lightSprite,color); local_100.y = 0.3; pVVar7 = &g_vectorOne; LAB_0080a5c3: pVVar7 = Vector::__mul(pVVar7,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); param_2 = lightEntity; LAB_008092c5: bVar5 = 1; pVVar7 = Entity::Position((Entity *)param_2,&local_128); pVVar7 = Isaac::GetRenderPosition(&local_13c,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_110,&renderOffset); goto LAB_00807b32; case 0x47: case 0x6e: cVar4 = Entity::Visible((Entity *)param_2); if (cVar4 != '\0') { local_100.y = (float)(this->_roomList[0x99]._doors + 6); Sprite::SetFrame_1((Sprite *)local_100.y,1); Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); lightSprite = (ANM2 *)local_100.y; Sprite::SetColor((Sprite *)local_100.y,color); pEVar3 = lightEntity; Entity::GetSprite((Entity *)lightEntity); pAVar13 = (AnimationState *)Config::GetPillEffects(); pvVar14 = AnimationState::GetLayerFrame(pAVar13,0); if (pvVar14 == (void *)0x0) { local_160.y = 1.0; } else { local_160.y = *(float *)((int)pvVar14 + 0x18); } pfVar6 = (float *)Entity::SpriteScale((Entity *)pEVar3); pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,pfVar6); pVVar7 = Vector::__mul(pVVar7,&local_128,&local_160.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)pEVar3,&local_110); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar20 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = &local_128; goto LAB_0080aace; } break; case 0x5d: Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); pvVar14 = AnimationState::GetLayerFrame(pAVar13,0); if (pvVar14 != (void *)0x0) { fVar24 = (float10)Color::RO(); local_100.y = (float)(fVar24 + (float10)1.0); Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); lightSprite = &room->_lightSprite; Sprite::SetColor((Sprite *)lightSprite,color); pVVar7 = (Vector *)Entity::SpriteScale((Entity *)lightEntity); local_100.y = 4.0; goto LAB_0080a5c3; } break; case 0x68: color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); LAB_0080a338: lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); Sprite::SetColor((Sprite *)lightSprite,color); local_100.y = 0.5; pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); pfVar6 = (float *)Entity::SpriteScale((Entity *)lightEntity); pVVar7 = Vector::__mul(pVVar7,&local_128,pfVar6); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)lightEntity,&local_110); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar20 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = &local_128; LAB_0080a3bc: pVVar7 = Isaac::GetRenderPosition(pVVar7,pVVar20,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_120,&renderOffset); goto LAB_00807b32; case 0x6f: iVar23 = Entity::SubType((Entity *)param_2); if (iVar23 != 1) break; Entity::GetSprite((Entity *)param_2); _empty_check_0x34(); local_100.y = (float)lightSprite; Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); iVar23 = AnimationState::GetAnimationLength(pAVar13); local_100.y = 1.0 - local_100.y / (float)iVar23; pKVar18 = KColor::KColor((KColor *)(local_c8 + 0x18),0.7,0.0,0.0,1.0); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); color = (ColorMod *)Sprite::Color(sprite); Color::apply_to_kcolor(&local_1a8,color,pKVar18); lightSprite = &room->_lightSprite; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,color); sprite = (Sprite *)Entity::GetSprite((Entity *)lightEntity); pVVar7 = (Vector *)Sprite::Scale(sprite); local_100.y = 0.5; pVVar7 = Vector::__mul(pVVar7,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)lightEntity,&local_128); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar20 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = &local_110; goto LAB_0080a3bc; case 0x70: Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); AnimationState::GetLayerFrame(pAVar13,0); fVar24 = (float10)Color::A(); local_100.y = (float)(fVar24 * (float10)6.4); color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); pVVar7 = (Vector *)Entity::SpriteScale((Entity *)param_2); Sprite::SetScale((Sprite *)(this->_roomList[0x99]._doors + 6),pVVar7); pVVar7 = Entity::Position((Entity *)param_2,&local_13c); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)param_2); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_128,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_110,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,&local_120,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector((Vector *)local_178,uVar19); fVar26 = RNG::RandomFloat(&flickerRng); local_100.y = fVar26 + fVar26; pVVar16 = Vector::__mul(pVVar20,&local_180,&local_100.y); pVVar20 = &local_170; goto LAB_00809757; case 0x71: Sprite::SetFrame_1((Sprite *)(this->_roomList[0x99]._doors + 6),1); Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); lightSprite = &room->_lightSprite; Sprite::SetColor((Sprite *)lightSprite,color); pfVar6 = (float *)Entity::SpriteScale((Entity *)lightEntity); pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,pfVar6); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)lightEntity,&local_128); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar20 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = &local_110; LAB_0080aace: pVVar7 = Isaac::GetRenderPosition(pVVar7,pVVar20,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_120,&renderOffset); ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); Sprite::SetFrame_1((Sprite *)lightSprite,0); break; case 0x73: local_100.y = Room::GetLightingAlpha((Room *)this); if (0.5 < local_100.y) { fVar26 = Room::GetLightingAlpha((Room *)this); local_100.y = fVar26 - 0.5; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)(this->_roomList[0x99]._doors + 6),color); local_100.y = 4.0; LAB_0080ae36: lightSprite = (ANM2 *)(this->_roomList[0x99]._doors + 6); pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)lightEntity,&local_128); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar20 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = &local_110; goto LAB_0080a3bc; } break; case 0x79: cVar4 = Entity::Visible((Entity *)param_2); if (cVar4 != '\0') { fVar24 = (float10)Entity_Effect::Scale((Entity_Effect *)param_2); local_160.y = (float)fVar24; local_188.y = (float)Entity::GetSprite((Entity *)param_2); pVVar7 = Entity::Position((Entity *)param_2,&local_13c); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)param_2); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_128,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_110,pVVar7,bVar5); pVVar7 = Vector::__add(pVVar7,&local_120,&renderOffset); uVar19 = RNG::Next(&flickerRng); pVVar20 = RandomVector((Vector *)local_178,uVar19); local_100.y = RNG::RandomFloat(&flickerRng); pVVar20 = Vector::__mul(pVVar20,&local_180,&local_100.y); pVVar20 = Vector::__mul(pVVar20,&local_170,&local_160.y); pVVar7 = Vector::__add(pVVar7,&local_194,pVVar20); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; lightSprite = (ANM2 *)local_188.y; goto LAB_00807b32; } break; case 0x7e: cVar4 = Entity::Visible((Entity *)param_2); if (cVar4 != '\0') { local_100.y = (float)(this->_roomList[0x99]._doors + 6); Sprite::SetFrame_1((Sprite *)local_100.y,1); Color::Color(); color = (ColorMod *)Entity::GetColor((Entity *)lightEntity); Color::operator_assign((Color *)entityColor,color); color = (ColorMod *)FUN_004072e0(); sprite = (Sprite *)local_100.y; Sprite::SetColor((Sprite *)local_100.y,color); pEVar3 = lightEntity; Entity::GetSprite((Entity *)lightEntity); local_150.y = (float)Config::GetPillEffects(); bVar5 = AnimationState::IsLoopingAnimation((AnimationState *)local_150.y); if (bVar5 == 0) { FUN_00407370(); local_100.y = (float)lightSprite; iVar23 = AnimationState::GetAnimationLength((AnimationState *)local_150.y); local_160.y = 1.0 - local_100.y / (float)iVar23; } else { local_160.y = 1.0; } pfVar6 = (float *)Entity::SpriteScale((Entity *)pEVar3); pVVar7 = Vector::__mul(&g_vectorOne,&local_13c,pfVar6); local_100.y = 0.2; pVVar7 = Vector::__mul(pVVar7,&local_128,&local_100.y); pVVar7 = Vector::__mul(pVVar7,&local_110,&local_160.y); Sprite::SetScale(sprite,pVVar7); pVVar7 = Entity::Position((Entity *)pEVar3,&local_120); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar20 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = &local_128; LAB_0080a2c7: pVVar20 = Isaac::GetRenderPosition(pVVar7,pVVar20,bVar5); pVVar7 = &local_110; LAB_0080a2e8: pVVar15 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar7 = Vector::__add(pVVar20,pVVar7,&renderOffset); ANM2::Render((ANM2 *)sprite,pVVar7,pVVar16,pVVar15); Sprite::SetFrame_1(sprite,0); } break; case 0x8d: pVVar7 = Entity::Position((Entity *)param_2,&local_13c); local_130 = (ANM2 *)Room::GetGridIndex((Room *)this,pVVar7); local_12c = (ANM2 *)&this->_roomList[0x9f].ShopItemIdx; std::set::find(); std::iterator_copy(local_12c,&local_160.y); cVar4 = FUN_00557bb0(); if (cVar4 != '\0') { Entity::GetColor((Entity *)param_2); fVar24 = (float10)Color::A(); local_150.y = (float)fVar24; iVar23 = Entity::FrameCount((Entity *)param_2); if (iVar23 < 10) { iVar23 = Entity::FrameCount((Entity *)param_2); local_150.y = ((float)iVar23 / 10.0) * local_150.y; } pEVar3 = lightEntity; lightSprite = &room->_lightSprite; sprite = (Sprite *)Entity::GetSprite((Entity *)lightEntity); color = (ColorMod *)Sprite::Color(sprite); Sprite::SetColor((Sprite *)lightSprite,color); pFVar9 = (Font *)Sprite::Color((Sprite *)lightSprite); Font::SetLineHeightModifier(pFVar9,local_150.y); sprite = (Sprite *)Entity::GetSprite((Entity *)pEVar3); pVVar7 = (Vector *)Sprite::Scale(sprite); local_100.y = 0.8; pVVar7 = Vector::__mul(pVVar7,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Entity::Position((Entity *)pEVar3,&local_128); pVVar20 = (Vector *)Entity::PositionOffset((Entity *)lightEntity); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_13c,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_110,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_120,&renderOffset); ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); std::set::insert(); } break; case 0xaf: iVar23 = Entity::Target((Entity *)param_2); if (iVar23 == 0) { pVVar20 = Entity::Position((Entity *)param_2,&local_120); pVVar16 = (Vector *)Entity::PositionOffset((Entity *)param_2); pVVar7 = (Vector *)local_178; } else { pEVar17 = (Entity *)Entity::Target(); pVVar20 = Entity::Position(pEVar17,&local_13c); pEVar17 = (Entity *)Entity::Target((Entity *)param_2); pVVar16 = (Vector *)Entity::PositionOffset(pEVar17); pVVar7 = &local_128; } pVVar7 = Vector::__add(pVVar20,pVVar7,pVVar16); lightSprite = &room->_lightSprite; local_110.x = pVVar7->x; local_110.y = pVVar7->y; sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); color = (ColorMod *)Sprite::Color(sprite); Sprite::SetColor((Sprite *)lightSprite,color); sprite = (Sprite *)Entity::GetSprite((Entity *)param_2); pVVar7 = (Vector *)Sprite::Scale(sprite); local_100.y = 0.6; pVVar7 = Vector::__mul(pVVar7,&local_13c,&local_100.y); Sprite::SetScale((Sprite *)lightSprite,pVVar7); pVVar7 = Isaac::GetRenderPosition(&local_128,&local_110,1); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,&local_13c,&renderOffset); LAB_00807b32: ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); break; case 0xb1: iVar23 = Entity::SubType((Entity *)param_2); if (iVar23 == 0) { cVar4 = Entity::Visible((Entity *)param_2); if (cVar4 != '\0') { Entity::GetSprite((Entity *)param_2); pAVar13 = (AnimationState *)Config::GetPillEffects(); local_100.y = (float)AnimationState::GetAnimationLength(pAVar13); lightSprite = (ANM2 *)Entity::GetSprite((Entity *)param_2); iVar23 = ANM2::GetFrame(lightSprite); if ((int)local_100.y - iVar23 < 7) { sprite = (Sprite *)(this->_roomList[0x99]._doors + 6); local_100.y = (float)((int)local_100.y - iVar23) / 6.0; Entity::GetColor((Entity *)lightEntity); Color::Color(1.0 - local_100.y * local_100.y,0x32,0x32,0x32); color = (ColorMod *)FUN_004072e0(); Sprite::SetColor(sprite,color); pEVar3 = lightEntity; pfVar6 = (float *)Entity::SpriteScale((Entity *)lightEntity); Sprite::SetFrame_1(sprite,(uint)(1.5 < *pfVar6)); pVVar7 = (Vector *)Entity::SpriteScale((Entity *)pEVar3); local_100.y = 1.5; pVVar7 = Vector::__mul(pVVar7,&local_13c,&local_100.y); Sprite::SetScale(sprite,pVVar7); bVar5 = 1; pVVar20 = Entity::Position((Entity *)pEVar3,&local_128); pVVar7 = &local_13c; goto LAB_0080a2c7; } } } } } switchD_00809dea_caseD_2: pRVar21 = room; LAB_00807b3d: bVar5 = Entity::IsEnemy((Entity *)lightEntity); if (((bVar5 != 0) && (cVar4 = FUN_004567d0(), cVar4 != '\0')) && (cVar4 = is_local_player_owned(), cVar4 != '\0')) { lightSprite = &pRVar21->_lightSprite; color = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,color); Sprite::SetScale((Sprite *)lightSprite,&g_vectorOne); Sprite::SetFrame_1((Sprite *)lightSprite,1); pVVar7 = Entity::Position((Entity *)lightEntity,&local_13c); pVVar20 = Vector::Vector(&local_128,0.0,-15.0); bVar5 = 1; pVVar7 = Vector::__add(pVVar7,&local_110,pVVar20); pVVar7 = Isaac::GetRenderPosition(&local_120,pVVar7,bVar5); pVVar16 = &g_vectorZero; pVVar20 = &g_vectorZero; pVVar7 = Vector::__add(pVVar7,(Vector *)local_178,&renderOffset); ANM2::Render(lightSprite,pVVar7,pVVar20,pVVar16); Sprite::SetFrame_1((Sprite *)lightSprite,0); } DAT_00c7977e = 0; guard_check_icall(); ExceptionList = local_1c; return; } //@@ 0080bd20 Room::render_player_light /* DB: ? Room::Render loop over room players: renders Room+0x6e40 ANM2 at player pos scaled by TemporaryEffects::GetNullEffectNum(0x4a) (max 4) when HasNullEffect(0x4a), RandomFloat flicker, _babySkin==0x42 branch prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Room::render_player_light(Room *this,Entity_Player *player,Vector *offset) { void *pvVar1; int iVar2; Room *pRVar3; code *pcVar4; byte bVar5; Vector *pVVar6; uint uVar7; int iVar8; LayerState *layer; ANM2 *lightSprite; float fVar9; float fVar10; float fVar11; float fVar12; double dVar13; undefined4 local_88 [8]; undefined4 local_68; undefined4 uStack_64; undefined4 local_60; ColorMod color; RNG rng; float renderOffsetX; Room *local_1c; Vector renderPos; float local_10; Vector local_c; ColorMod *lightColor; EntityPtr minecart; rng._seed = g_game->_frameCount + player->_initSeed; minecart = player->_minecart; rng._shift3 = 0x19; rng._shift1 = 5; rng._shift2 = 0x1b; renderOffsetX = offset->x; fVar9 = offset->y; local_1c = this; if (minecart == (EntityPtr)0x0) { fVar10 = g_vectorZero.x; fVar11 = g_vectorZero.y; } else { if ((*(int *)((int)minecart + 0x7c) == 0) || (pVVar6 = AnimationState::GetNullFrameById((AnimationState *)((int)minecart + 0x78),0), pVVar6 == (Vector *)0x0)) { pVVar6 = &g_vectorZero; } fVar10 = pVVar6->x; fVar11 = pVVar6->y; } iVar8 = player->_type; renderOffsetX = renderOffsetX + fVar10; fVar9 = fVar9 + fVar11; if (iVar8 == 1) { local_c.y = g_displayPixelRatio * g_screenPointScale; local_10 = ((g_screenWidth - 338.0) * 0.5 + ((player->_pos).x - 60.0) * 0.65) * local_c.y + 0.5; dVar13 = floor((double)local_10); local_10 = (float)dVar13 / local_c.y; renderPos.y = ((g_screenHeight - 182.0) * 0.5 + ((player->_pos).y - 140.0) * 0.65) * local_c.y + 0.5; dVar13 = floor((double)renderPos.y); renderPos.x = local_10 + renderOffsetX; offset = (Vector *)(fVar9 + (float)dVar13 / local_c.y); renderPos.y = (float)offset; local_10 = renderPos.x; iVar8 = TemporaryEffects::GetNullEffectNum(&player->_temporaryeffects,0x4a); local_c.y = (float)iVar8; if (4.0 <= local_c.y) { local_c.y = 4.0; } bVar5 = TemporaryEffects::HasNullEffect(&player->_temporaryeffects,0x4a); uVar7 = g_graphicsManager_flags; if (bVar5 != 0) { lightSprite = &this->_lightSprite; layer = ANM2::GetLayer(lightSprite,(byte *)0x0); color._tint[0] = 0.4; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; iVar8 = 1; if ((uVar7 & 4) == 0) { iVar8 = 6; } layer->_blendMode[1] = iVar8; layer->_blendMode[0] = 0; layer->_blendMode[2] = 1; color._tint[3] = local_c.y * 0.07 + 0.2; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; color._tint[1] = 0.6; color._tint[2] = 1.0; color._offset[0] = 0.0; color._offset[1] = 0.0; color._offset[2] = 0.0; Sprite::SetColor((Sprite *)lightSprite,&color); fVar10 = local_c.y * 0.5 + 1.0; fVar9 = fVar10 * g_vectorOne.x; (local_1c->_lightSprite)._scale.y = fVar10 * g_vectorOne.y; (local_1c->_lightSprite)._scale.x = fVar9; ANM2::Render(lightSprite,&renderPos,&g_vectorZero,&g_vectorZero); uVar7 = g_graphicsManager_flags; layer = ANM2::GetLayer(lightSprite,(byte *)0x0); iVar8 = 1; offset = (Vector *)renderPos.y; if ((uVar7 & 4) == 0) { iVar8 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar8; layer->_blendMode[2] = 7; layer->_blendMode[3] = 1; layer->_blendMode[4] = 7; local_10 = renderPos.x; this = local_1c; } uVar7 = g_graphicsManager_flags; if (player->_babySkin == 0x42) { lightSprite = &this->_lightSprite; layer = ANM2::GetLayer(lightSprite,(byte *)0x0); color._offset[0] = 0.0; color._offset[1] = 0.0; iVar8 = 1; color._offset[2] = 0.0; if ((uVar7 & 4) == 0) { iVar8 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar8; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; color._tint[0] = 1.0; color._tint[1] = 1.0; color._tint[2] = 0.9; color._tint[3] = 1.0; Sprite::SetColor((Sprite *)lightSprite,&color); fVar9 = g_vectorOne.y * 2.0; (local_1c->_lightSprite)._scale.x = g_vectorOne.x * 2.0; (local_1c->_lightSprite)._scale.y = fVar9; ANM2::Render(lightSprite,&renderPos,&g_vectorZero,&g_vectorZero); uVar7 = g_graphicsManager_flags; layer = ANM2::GetLayer(lightSprite,(byte *)0x0); iVar8 = 1; offset = (Vector *)renderPos.y; if ((uVar7 & 4) == 0) { iVar8 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar8; layer->_blendMode[2] = 7; layer->_blendMode[3] = 1; layer->_blendMode[4] = 7; local_10 = renderPos.x; } pvVar1 = (g_manager->_itemConfig)._collectibles._begin; if ((int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar1 & 0xfffffffcU) < 0x401) { local_c.y = 0.0; } else { local_c.y = *(float *)((int)pvVar1 + 0x400); } iVar8 = player->_playerCostumeMap[0]._index; if (((iVar8 < 0) || (*(float *)(iVar8 * 0x130 + 0x114 + (int)(player->_costumeSpriteDescs)._begin) != local_c.y) ) && (bVar5 = Entity_Player::HasCollectible(player,0x101,0), pRVar3 = local_1c, bVar5 == 0)) { pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU) < 0xe1) { iVar8 = 0; } else { iVar8 = *(int *)((int)pvVar1 + 0xe0); } iVar2 = player->_playerCostumeMap[0]._index; if ((iVar2 < 0) || (*(int *)(iVar2 * 0x130 + 0x114 + (int)(player->_costumeSpriteDescs)._begin) != iVar8)) { return; } color._offset[0] = 0.0; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; color._tint[0] = 1.0; color._tint[1] = 0.8; color._tint[2] = 0.7; color._tint[3] = 0.7; color._offset[1] = 0.0; color._offset[2] = 0.0; Sprite::SetColor((Sprite *)&local_1c->_lightSprite,&color); (pRVar3->_lightSprite)._scale.x = g_vectorOne.x; (pRVar3->_lightSprite)._scale.y = g_vectorOne.y; uVar7 = RNG::Next(&rng); pVVar6 = RandomVector(&local_c,uVar7); fVar10 = RNG::RandomFloat(&rng); fVar9 = (fVar10 + fVar10) * pVVar6->y; renderPos.x = (fVar10 + fVar10) * pVVar6->x; } else { pRVar3 = local_1c; local_68 = 0; uStack_64 = 0; lightColor = &(local_1c->_lightSprite)._color; local_60 = 0; if (lightColor != (ColorMod *)local_88) { (local_1c->_lightSprite)._color._colorize[0] = 0.0; (local_1c->_lightSprite)._color._colorize[1] = 0.0; (local_1c->_lightSprite)._color._colorize[2] = 0.0; (local_1c->_lightSprite)._color._colorize[3] = 0.0; (local_1c->_lightSprite)._color._offset[0] = 0.0; (local_1c->_lightSprite)._color._offset[1] = 0.0; lightColor->_tint[0] = 1.0; (local_1c->_lightSprite)._color._tint[1] = 0.6; (local_1c->_lightSprite)._color._tint[2] = 0.4; (local_1c->_lightSprite)._color._tint[3] = 0.7; (local_1c->_lightSprite)._color._offset[2] = 0.0; } (local_1c->_lightSprite)._scale.x = g_vectorOne.x; (local_1c->_lightSprite)._scale.y = g_vectorOne.y; uVar7 = RNG::Next(&rng); pVVar6 = RandomVector(&local_c,uVar7); if (rng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar7 = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; uVar7 = uVar7 << ((byte)rng._shift2 & 0x1f) ^ uVar7; uVar7 = uVar7 >> ((byte)rng._shift3 & 0x1f) ^ uVar7; renderPos.x = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10; renderPos.x = renderPos.x + renderPos.x; fVar9 = renderPos.x * pVVar6->y; renderPos.x = renderPos.x * pVVar6->x; } lightSprite = &pRVar3->_lightSprite; renderPos.y = fVar9 + (float)offset; renderPos.x = renderPos.x + local_10; } else if (iVar8 == 9) { if ((g_manager->_optionsConfig)._enableBulletVisibility == 0) { return; } fVar10 = sin((float)g_game->_frameCount * 0.8); color._offset[0] = 0.0; color._offset[1] = 0.0; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; color._offset[2] = 0.0; fVar11 = (fVar10 * 0.5 + 0.5) * 0.20000002 + 0.1; color._tint[0] = 1.0; color._tint[1] = 1.0; color._tint[2] = 1.0; color._tint[3] = 0.4; Sprite::SetColor((Sprite *)&this->_lightSprite,&color); fVar10 = g_displayPixelRatio; fVar12 = fVar11 * g_vectorOne.x; (this->_lightSprite)._scale.y = fVar11 * g_vectorOne.y; (this->_lightSprite)._scale.x = fVar12; fVar10 = fVar10 * g_screenPointScale; local_c.y = ((((player->_pos).x + (player->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar10 + 0.5; dVar13 = floor((double)local_c.y); renderPos.x = (float)dVar13 / fVar10 + renderOffsetX; local_c.y = ((((player->_pos).y + (player->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar10 + 0.5; dVar13 = floor((double)local_c.y); local_c.y = (float)dVar13; lightSprite = &this->_lightSprite; renderPos.y = local_c.y / fVar10 + fVar9; } else { if (iVar8 != 0x328) { return; } if (player->_visible == 0) { return; } local_1c = (Room *)(g_displayPixelRatio * g_screenPointScale); dVar13 = floor((double)(((((player->_pos).x + 0.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_1c + 0.5)); fVar10 = (float)dVar13 / (float)local_1c; local_c.y = ((((player->_pos).y - 16.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_1c + 0.5; dVar13 = floor((double)local_c.y); local_c.y = (float)dVar13; fVar10 = fVar10 + renderOffsetX; fVar11 = local_c.y / (float)local_1c; color._offset[0] = 0.0; color._offset[1] = 0.0; color._offset[2] = 0.0; color._colorize[0] = 0.0; color._colorize[1] = 0.0; color._colorize[2] = 0.0; color._colorize[3] = 0.0; color._tint[0] = 0.6; color._tint[1] = 0.4; color._tint[2] = 0.2; color._tint[3] = 0.7; Sprite::SetColor((Sprite *)&this->_lightSprite,&color); uVar7 = RNG::Next(&rng); pVVar6 = RandomVector(&local_c,uVar7); if (rng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); (*pcVar4)(); return; } uVar7 = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; uVar7 = uVar7 << ((byte)rng._shift2 & 0x1f) ^ uVar7; lightSprite = &this->_lightSprite; uVar7 = uVar7 >> ((byte)rng._shift3 & 0x1f) ^ uVar7; fVar12 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10; renderPos.y = fVar12 * pVVar6->y + fVar9 + fVar11; renderPos.x = fVar12 * pVVar6->x + fVar10; fVar9 = g_vectorOne.y * 0.5; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.5; (this->_lightSprite)._scale.y = fVar9; } ANM2::Render(lightSprite,&renderPos,&g_vectorZero,&g_vectorZero); return; } //@@ 0080c810 Room::render_grid_entity_light /* DB: this=Room (+0x1d18 backdrop); switch GridEntity type PIT/DOOR/TRAPDOOR/PRESSURE_PLATE/TELEPORTER drawing glow sprites into light target; called per grid entity from light pass FUN_0080ea80 */ void __thiscall Room::render_grid_entity_light(Room *this,GridEntity *param_2,float *param_3) { int *piVar1; char isLastBoss; byte bVar2; int iVar3; int frame; RoomDescriptor *roomDesc; ColorMod *tmpColor; void *layerFrame; uint uVar4; Vector *randomDir; LayerState *layer; Vector *pVVar5; byte unused; byte unused_00; byte unused_01; Game *game; float fVar6; double dVar7; float fVar8; RNG local_3c; Vector gridPos; Vector local_20; Vector local_18; float *local_10; Vector local_c; GridEntity *gridEntity; ANM2 *lightSprite; gridEntity = param_2; game = g_game; local_3c._shift1 = 5; local_3c._shift2 = 0x1b; local_10 = (float *)g_game->_frameCount; local_3c._seed = (param_2->_desc)._spawnSeed + (int)local_10; local_3c._shift3 = 0x19; local_20.y = (float)this; iVar3 = Level::get_secret_exit_kind((Level *)g_game); switch((param_2->_desc)._type) { case 7: iVar3 = this->_backdropType; if (iVar3 == 0x20) { if ((*(uint *)((int)this->_descriptor + 0x44) >> 5 & 1) != 0) { fVar6 = sin((float)(int)local_10 * 0.1); local_20.y = fVar6 * 0.2 + 0.8; local_c.y = (local_20.y * 0.1 + 0.9) * this->_lavaIntensity; if (1 < (uint)(param_2->_desc)._state) { local_c.y = local_c.y * 0.5; } if (local_c.y <= 0.0) { return; } pVVar5 = GridEntity::Position(param_2,&gridPos); fVar6 = g_displayPixelRatio * g_screenPointScale; local_10 = (float *)(((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * fVar6 + 0.5); dVar7 = floor((double)(float)local_10); local_18.y = (float)dVar7 / fVar6; local_10 = (float *)(((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar6 + 0.5); dVar7 = floor((double)(float)local_10); local_10 = (float *)(float)dVar7; local_18.x = local_18.y + *param_3; local_18.y = (float)local_10 / fVar6 + param_3[1]; tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); pVVar5 = &local_18; fVar6 = g_vectorOne.y * 0.8; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.8; (this->_lightSprite)._scale.y = fVar6; goto LAB_0080e2d3; } } else if (((iVar3 == 0x3a) || (iVar3 == 0x3b)) && ((*(uint *)((int)this->_descriptor + 0x44) >> 5 & 1) != 0)) goto LAB_0080cac5; bVar2 = Seeds::HasSeedEffect(&game->_seedEffects,0x4f); if (bVar2 == 0) { return; } uVar4 = Game::GetStageID(game,unused); if (uVar4 != 6) { return; } if (this->_waterAmount <= 0.5) { return; } game = g_game; LAB_0080cac5: fVar6 = sin((float)game->_frameCount * 0.1); local_c.y = fVar6 * 0.2 + 0.8; param_2 = (GridEntity *)this->_lavaIntensity; bVar2 = Seeds::HasSeedEffect(&game->_seedEffects,0x4f); if ((bVar2 != 0) && (uVar4 = Game::GetStageID(game,unused_00), uVar4 == 6)) { param_2 = (GridEntity *)0x3f800000; } fVar6 = (local_c.y * 0.1 + 0.9) * (float)param_2; if (1 < (uint)(gridEntity->_desc)._state) { fVar6 = fVar6 * 0.5; } if (fVar6 <= 0.0) { return; } pVVar5 = GridEntity::Position(gridEntity,&gridPos); local_10 = (float *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)local_10 + 0.5 ; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)local_10; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_10 + 0.5; dVar7 = floor((double)local_20.y); local_20.x = local_18.y + *param_3; local_20.y = (float)dVar7 / (float)local_10 + param_3[1]; layer = ANM2::GetLayer(&this->_lightSprite,(byte *)0x0); game = g_game; layer->_blendMode[0] = DAT_00c35b6c; layer->_blendMode[1] = DAT_00c35b70; layer->_blendMode[2] = DAT_00c35b74; layer->_blendMode[3] = DAT_00c35b78; layer->_blendMode[4] = DAT_00c35b7c; bVar2 = Seeds::HasSeedEffect(&game->_seedEffects,0x4f); if (bVar2 != 0) { Game::GetStageID(game,unused_01); } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); fVar6 = g_vectorOne.y * 0.8; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.8; (this->_lightSprite)._scale.y = fVar6; ANM2::Render(&this->_lightSprite,&local_20,&g_vectorZero,&g_vectorZero); layer = ANM2::GetLayer(&this->_lightSprite,(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; return; default: goto switchD_0080c86a_caseD_8; case 0x10: if (param_2[1]._desc._state == 0x1b) { if (iVar3 == 2) { if ((param_2->_desc)._variant == 8) { tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } else { if ((param_2->_desc)._state != 4) { return; } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); fVar6 = g_vectorOne.y * 0.5; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.5; (this->_lightSprite)._scale.y = fVar6; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } } else { if (iVar3 != 3) { return; } iVar3 = (param_2->_desc)._variant; if (iVar3 == 1) { return; } bVar2 = ANM2::IsPlaying(¶m_2->_sprite,(byte *)"KeyOpen"); if ((bVar2 != 0) && (frame = ANM2::GetFrame(¶m_2->_sprite), frame < 0x13)) { return; } if (iVar3 != 8) { return; } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } } else if ((game->_currentRoomIdx == -10) && (iVar3 == 4)) { if ((param_2->_desc)._variant != 8) { return; } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } else { piVar1 = *(int **)(*(int *)((int)game->_room + 4) + 0x10); if ((piVar1 == (int *)0x0) || (*piVar1 != 0x23)) { roomDesc = Level::GetRoomByIdx((Level *)game,(int)param_2[2]._sprite._color._tint[1],-1); if ((roomDesc->Flags & 0x40000U) == 0) { if ((((uint)param_2[2]._sprite._color._colorize[0] >> 5 & 1) == 0) || (g_game->_currentDimensionIdx != 1)) { if (param_2[1]._desc._state != 0xf) { return; } if ((param_2->_desc)._variant != 8) { return; } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } else { layer = ANM2::GetLayer(¶m_2->_sprite,&DAT_00000005); if (layer->_visible == 0) { return; } layer = ANM2::GetLayer(¶m_2->_sprite,&DAT_00000005); if ((layer->_color)._tint[3] <= 0.0) { return; } ANM2::GetLayer(¶m_2->_sprite,&DAT_00000005); tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } } else { tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); fVar6 = g_vectorOne.y * 0.7; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.7; (this->_lightSprite)._scale.y = fVar6; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } } else { layer = ANM2::GetLayer(¶m_2->_sprite,(byte *)0x3); if (layer->_visible == 0) { return; } layer = ANM2::GetLayer(¶m_2->_sprite,(byte *)0x3); Sprite::SetColor((Sprite *)&this->_lightSprite,&layer->_color); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } } break; case 0x11: if ((this->_roomType != 0x1b) || (iVar3 != 2)) { isLastBoss = IsCurrentRoomLastBoss(); if (isLastBoss == '\0') { return; } bVar2 = Level::IsMausoleumHeartStage((Level *)g_game); if (bVar2 == 0) { return; } lightSprite = &this->_lightSprite; layer = ANM2::GetLayer(lightSprite,(byte *)0x0); local_3c._seed = layer->_blendMode[0]; local_3c._shift1 = layer->_blendMode[1]; local_3c._shift2 = layer->_blendMode[2]; local_3c._shift3 = layer->_blendMode[3]; iVar3 = layer->_blendMode[4]; layer = ANM2::GetLayer(lightSprite,(byte *)0x0); layer->_blendMode[0] = DAT_00c35b6c; layer->_blendMode[1] = DAT_00c35b70; layer->_blendMode[2] = DAT_00c35b74; layer->_blendMode[3] = DAT_00c35b78; layer->_blendMode[4] = DAT_00c35b7c; tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)lightSprite,tmpColor); (((ANM2 *)((int)local_20.y + 0x6e40))->_scale).x = 1.2; (((ANM2 *)((int)local_20.y + 0x6e40))->_scale).y = 0.75; pVVar5 = GridEntity::Position(param_2,&gridPos); fVar6 = g_displayPixelRatio * g_screenPointScale; local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * fVar6 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / fVar6; local_20.y = ((g_screenHeight - 182.0) * 0.5 + (pVVar5->y - 140.0) * 0.65) * fVar6 + 0.5; dVar7 = floor((double)local_20.y); local_20.x = local_18.y + *param_3; local_20.y = (float)dVar7 / fVar6 + param_3[1]; ANM2::Render(lightSprite,&local_20,&g_vectorZero,&g_vectorZero); layer = ANM2::GetLayer(lightSprite,(byte *)0x0); layer->_blendMode[1] = local_3c._shift1; layer->_blendMode[0] = local_3c._seed; layer->_blendMode[2] = local_3c._shift2; layer->_blendMode[3] = local_3c._shift3; layer->_blendMode[4] = iVar3; return; } layerFrame = ANM2::GetLayerFrame(¶m_2->_sprite,0); if (layerFrame == (void *)0x0) { return; } if (*(char *)((int)layerFrame + 0xc) == '\0') { return; } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; pVVar5 = GridEntity::Position(param_2,&gridPos); fVar6 = g_displayPixelRatio * g_screenPointScale; local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * fVar6 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / fVar6; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar6 + 0.5; dVar7 = floor((double)local_20.y); local_20.y = (float)dVar7 / fVar6; fVar6 = *param_3; local_10 = (float *)param_3[1]; uVar4 = RNG::Next(&local_3c); randomDir = RandomVector(&local_c,uVar4); fVar8 = RNG::RandomFloat(&local_3c); pVVar5 = &local_18; local_18.x = local_18.y + fVar6 + 0.0 + fVar8 * randomDir->x * 3.0; local_18.y = fVar8 * randomDir->y * 3.0 + ((local_20.y + (float)local_10) - 14.0); goto LAB_0080e2d3; case 0x14: iVar3 = (param_2->_desc)._variant; if (iVar3 == 9) { tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); fVar6 = g_vectorOne.y * 0.5; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.5; (this->_lightSprite)._scale.y = fVar6; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } else if (iVar3 == 3) { tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); fVar6 = g_vectorOne.y * 0.5; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.5; (this->_lightSprite)._scale.y = fVar6; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } else { if ((param_2->_desc)._state != 0) { return; } tmpColor = (ColorMod *)Color::Color(); Sprite::SetColor((Sprite *)&this->_lightSprite,tmpColor); fVar6 = g_vectorOne.y * 0.5; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.5; (this->_lightSprite)._scale.y = fVar6; pVVar5 = GridEntity::Position(param_2,&gridPos); param_2 = (GridEntity *)(g_displayPixelRatio * g_screenPointScale); local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / (float)param_2; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 + 0.5; dVar7 = floor((double)local_20.y); fVar6 = (float)dVar7; } break; case 0x17: if ((param_2->_sprite)._animState._animData == (void *)0x0) { return; } local_10 = AnimationState::GetNullFrameById(&(param_2->_sprite)._animState,0); if (local_10 == (float *)0x0) { return; } if (*(char *)(local_10 + 3) == '\0') { return; } Sprite::SetColor((Sprite *)&this->_lightSprite,(ColorMod *)(local_10 + 6)); (this->_lightSprite)._scale.x = local_10[4]; (this->_lightSprite)._scale.y = local_10[5]; pVVar5 = GridEntity::Position(param_2,&gridPos); fVar6 = g_displayPixelRatio * g_screenPointScale; local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar5->x - 60.0) * 0.65) * fVar6 + 0.5; dVar7 = floor((double)local_20.y); local_18.y = (float)dVar7 / fVar6; local_20.y = ((pVVar5->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar6 + 0.5; dVar7 = floor((double)local_20.y); local_20.x = local_18.y + *param_3 + *local_10; local_20.y = (float)dVar7 / fVar6 + param_3[1] + local_10[1]; goto LAB_0080e2c3; } local_20.x = local_18.y + *param_3; local_20.y = fVar6 / (float)param_2 + param_3[1]; LAB_0080e2c3: pVVar5 = &local_20; LAB_0080e2d3: ANM2::Render(&this->_lightSprite,pVVar5,&g_vectorZero,&g_vectorZero); switchD_0080c86a_caseD_8: return; } //@@ 0080e320 Room::pick_special_clear_award /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Room::SpawnClearAward; by room +0x1bb0 type switch writes collectible ids (0x27f, 0x180, 0x242, 0x219) checked with ItemPool::is_collectible_available, RNG::RandomInt prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Room::pick_special_clear_award(Room *this,int *outCollectible,uint *outTrinket,RNG *rng) { code *pcVar1; byte bVar2; uint uVar3; int collectibleId; uint trinketChoices [12]; Game *game; int *numAvailableTrinkets; void *trinketPool; trinketChoices[0xb] = __security_cookie ^ (uint)(trinketChoices + 0xc); *outCollectible = 0; *outTrinket = 0; if ((this->_roomType != 5) && (this->_secondBossID != 0)) { return 0; } uVar3 = rng->_seed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = rng->_seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); bVar2 = (*pcVar1)(); return bVar2; } } uVar3 = uVar3 >> ((byte)rng->_shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)rng->_shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)rng->_shift3 & 0x1f) ^ uVar3; rng->_seed = uVar3; if (uVar3 % 100 != 0) goto switchD_0080e3e0_caseD_5; if ((*(uint *)((int)this->_descriptor + 0x44) & 0x10000) != 0) { switchD_0080e3e0_caseD_56: *outCollectible = 0x27f; collectibleId = 0x27f; goto LAB_0080e7b8; } switch(this->_bossId) { case 1: *outCollectible = 0x56; collectibleId = 0x56; break; case 2: case 7: case 0x1a: case 0x25: trinketChoices[0] = 0xc; trinketChoices[1] = 0x1a; trinketChoices[2] = 9; trinketChoices[3] = 0xb; trinketChoices[4] = 0x1b; trinketChoices[5] = 10; trinketChoices[6] = 0x40; trinketChoices[7] = 0x41; trinketChoices[8] = 0x60; trinketChoices[9] = 0x90; trinketChoices[10] = 0x42; uVar3 = RNG::RandomInt(rng,0xb); *outTrinket = trinketChoices[uVar3]; goto switchD_0080e3e0_caseD_5; case 3: *outCollectible = 0x58; collectibleId = 0x58; break; case 4: case 0x1c: case 0x31: case 0x38: *outCollectible = 0x180; collectibleId = 0x180; break; case 5: *outCollectible = 0xe5; collectibleId = 0xe5; break; default: goto switchD_0080e3e0_caseD_5; case 9: *outTrinket = 0x73; goto switchD_0080e3e0_caseD_5; case 10: *outTrinket = 0x72; goto switchD_0080e3e0_caseD_5; case 0xb: *outTrinket = 0x71; goto switchD_0080e3e0_caseD_5; case 0xc: *outTrinket = 0x74; goto switchD_0080e3e0_caseD_5; case 0xd: *outCollectible = 10; collectibleId = 10; break; case 0xe: *outCollectible = 0x242; collectibleId = 0x242; break; case 0xf: *outCollectible = 0x57; collectibleId = 0x57; break; case 0x10: *outCollectible = 0x219; collectibleId = 0x219; break; case 0x11: *outCollectible = 0x13e; collectibleId = 0x13e; break; case 0x12: *outCollectible = 0x20d; collectibleId = 0x20d; break; case 0x17: *outCollectible = 0x286; collectibleId = 0x286; break; case 0x1b: *outCollectible = 0x2ab; collectibleId = 0x2ab; break; case 0x1d: *outCollectible = 0x94; collectibleId = 0x94; break; case 0x1e: *outCollectible = 0x9b; collectibleId = 0x9b; break; case 0x1f: *outCollectible = 0x1b3; collectibleId = 0x1b3; break; case 0x20: *outCollectible = 0x264; collectibleId = 0x264; break; case 0x21: *outCollectible = 0x285; collectibleId = 0x285; break; case 0x22: *outCollectible = 0xd3; collectibleId = 0xd3; break; case 0x23: *outCollectible = 0xf2; collectibleId = 0xf2; break; case 0x24: *outCollectible = 0x10a; collectibleId = 0x10a; break; case 0x26: *outTrinket = 0x75; goto switchD_0080e3e0_caseD_5; case 0x29: *outCollectible = 0xaa; collectibleId = 0xaa; break; case 0x2a: *outCollectible = 0x59; collectibleId = 0x59; break; case 0x2b: *outCollectible = 0x115; collectibleId = 0x115; break; case 0x2c: *outCollectible = 0x24; collectibleId = 0x24; break; case 0x2d: *outCollectible = 0x171; collectibleId = 0x171; break; case 0x2e: *outCollectible = 0x177; collectibleId = 0x177; break; case 0x2f: *outCollectible = 0x13a; collectibleId = 0x13a; break; case 0x30: *outCollectible = 0x262; collectibleId = 0x262; break; case 0x32: *outCollectible = 0x103; collectibleId = 0x103; break; case 0x33: *outCollectible = 0x23c; collectibleId = 0x23c; break; case 0x34: *outCollectible = 0x292; collectibleId = 0x292; break; case 0x35: *outCollectible = 0xa7; collectibleId = 0xa7; break; case 0x39: *outCollectible = 0x2aa; collectibleId = 0x2aa; break; case 0x3a: *outCollectible = 0x240; collectibleId = 0x240; break; case 0x3b: *outCollectible = 0x221; collectibleId = 0x221; break; case 0x3c: case 0x45: *outCollectible = 0x1f7; collectibleId = 0x1f7; break; case 0x3d: *outCollectible = 0x120; collectibleId = 0x120; break; case 0x40: *outCollectible = 0x2a8; collectibleId = 0x2a8; break; case 0x41: *outCollectible = 0x17a; collectibleId = 0x17a; break; case 0x42: *outCollectible = 0x225; collectibleId = 0x225; break; case 0x43: *outCollectible = 3; collectibleId = 3; break; case 0x44: *outCollectible = 0xe1; collectibleId = 0xe1; break; case 0x48: *outCollectible = 0x1d9; collectibleId = 0x1d9; break; case 0x49: *outCollectible = 0x1c5; collectibleId = 0x1c5; break; case 0x4a: *outCollectible = 0x166; collectibleId = 0x166; break; case 0x4b: *outCollectible = 0x134; collectibleId = 0x134; break; case 0x4c: *outCollectible = 0x10e; collectibleId = 0x10e; break; case 0x4d: *outCollectible = 0x1d5; collectibleId = 0x1d5; break; case 0x4e: *outCollectible = 0x2a4; collectibleId = 0x2a4; break; case 0x4f: *outTrinket = 0x8d; goto switchD_0080e3e0_caseD_5; case 0x50: *outCollectible = 0x297; collectibleId = 0x297; break; case 0x51: *outCollectible = 0xd8; collectibleId = 0xd8; break; case 0x52: *outCollectible = 0x100; collectibleId = 0x100; break; case 0x53: *outCollectible = 0xd2; collectibleId = 0xd2; break; case 0x55: *outCollectible = 0x282; collectibleId = 0x282; break; case 0x56: *outCollectible = 0x2d9; collectibleId = 0x2d9; break; case 0x57: goto switchD_0080e3e0_caseD_56; case 0x5b: *outCollectible = 0x108; collectibleId = 0x108; break; case 0x5c: *outCollectible = 0x123; collectibleId = 0x123; break; case 0x5d: *outCollectible = 0x268; collectibleId = 0x268; break; case 0x5f: *outCollectible = 0xd1; collectibleId = 0xd1; break; case 0x60: *outCollectible = 0x281; collectibleId = 0x281; break; case 0x61: *outCollectible = 0x1f8; collectibleId = 0x1f8; break; case 0x65: *outTrinket = 0xb7; switchD_0080e3e0_caseD_5: collectibleId = *outCollectible; if (collectibleId == 0) goto LAB_0080e7d5; break; case 0x66: *outCollectible = 0x2a5; collectibleId = 0x2a5; } LAB_0080e7b8: bVar2 = ItemPool::is_collectible_available(&g_game->_itemPool,collectibleId,0); if (bVar2 == 0) { *outCollectible = 0; } LAB_0080e7d5: game = g_game; uVar3 = *outTrinket; if (uVar3 != 0) { if (((((int)uVar3 < 1) || (trinketPool = (g_game->_itemPool)._trinketPoolItems._begin, (int)(g_game->_itemPool)._trinketPoolItems._end - (int)trinketPool >> 3 <= (int)uVar3)) || (*(char *)((int)trinketPool + uVar3 * 8 + 4) == '\0')) || (*(char *)((int)trinketPool + uVar3 * 8 + 5) == '\0')) { *outTrinket = 0; } else { *(undefined1 *)((int)trinketPool + uVar3 * 8 + 4) = 0; numAvailableTrinkets = &(game->_itemPool)._numAvailableTrinkets; *numAvailableTrinkets = *numAvailableTrinkets + -1; } } if ((*outCollectible == 0) && (*outTrinket == 0)) { return 0; } return 1; } //@@ 0080ea80 Room::render_lighting /* DB: ? Game::Render -> this: sets light render targets (DAT_00c797b4/DAT_00c797cc), renders each entity light then FUN_0080c810 per grid entity, curses via Seeds::GetForcedCurses, then FUN_00825de0 overlay; "PopRenderTarget: stack is empty!" prototype: db/protos.zhl */ void __thiscall Room::render_lighting(Room *this) { ColorMod *pCVar1; int iVar2; uint uVar3; Room *pRVar4; char cVar5; byte bVar6; undefined4 *targetEntry; void *quad; Vector *centerPos; uint forcedCurses; uint preventedCurses; AnimationState *beamAnim; uint uVar7; void **gridEntitySlot; float fVar8; double dVar9; Vector local_118; float local_110; Room *room; float darkness; float local_ec; undefined8 renderOffset; KColor ambientColor; float baseBlue; float baseGreen; Vector local_b4; undefined4 local_ac [8]; undefined4 local_8c; undefined4 uStack_88; undefined4 local_84; undefined1 local_80 [124]; Room *thisRoom; renderOffset = 0; room = this; std::vector::resize(&renderOffset); targetEntry = std::deque::back(); if ((byte *)(targetEntry + 1) != (byte *)0x0) { *(byte *)(targetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *targetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797b4,0); RenderTarget::Clear(&DAT_00c798e0); render_entity_light_masks(); _glfw_context_reset(); pop_render_target(); local_b4.x = (float)g_game->_stage; local_ec = (float)g_game->_stageType; if ((g_manager->_optionsConfig)._enableLighting == 0) goto LAB_0080f1ce; if (g_game->_darknessModifier <= 0.0) { Seeds::GetForcedCurses(); Seeds::GetPreventedCurses(); } local_118.x = 0.0; local_118.y = 0.0; std::vector::resize(&local_118); targetEntry = std::deque::back(); if ((byte *)(targetEntry + 1) != (byte *)0x0) { *(byte *)(targetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *targetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797cc,1); RenderTarget::Clear(&DAT_00c798e0); ambientColor._red = *(float *)&this->field_0x1b5c; local_118.x = (float)g_currentShader; ambientColor._unk = *(int *)&this->field_0x1b6c; baseGreen = *(float *)&this->field_0x1b60; baseBlue = *(float *)&this->field_0x1b64; ambientColor._alpha = *(float *)&this->field_0x1b68; if ((*(uint *)((int)this->_descriptor + 0x44) >> 9 & 1) != 0) { ambientColor._red = 0.0; ambientColor._alpha = 1.0; baseBlue = 0.0; baseGreen = 0.0; ambientColor._unk = 0; } local_110 = ambientColor._red; ambientColor._green = baseGreen; ambientColor._blue = baseBlue; quad = render_quad_set_uniform_color(local_80,0.0,0.0,DAT_00c7997c,DAT_00c79980,&ambientColor); render_color_shader_pass(quad); 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] = 1; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 1; renderOffset = CONCAT44((this->_renderScrollOffset).y + (g_game->_screenShakeOffset).y, (this->_renderScrollOffset).x + (g_game->_screenShakeOffset).x); if (this->_backdropType == 0x39) { BeastArena::render_light(); } else if ((*(uint *)((int)this->_descriptor + 0x44) >> 9 & 1) == 0) { uVar7 = g_game->_debugCurses; uVar3 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); this = room; if ((~preventedCurses & (forcedCurses | uVar7 | uVar3) & 1) == 0) { darkness = g_game->_darknessStrength * g_game->_darknessModifier; } else { darkness = 1.0; } if ((((room->_roomType == 8) || (room->_roomType == 0x1d)) || ((bVar6 = Level::HasAbandonedMineshaft((Level *)g_game), bVar6 != 0 && (g_game->_currentDimensionIdx == 1)))) || (cVar5 = is_pre_ascent_mom_room(), cVar5 != '\0') ) { fVar8 = darkness + 0.6; if (1.0 <= darkness + 0.6) { fVar8 = 1.0; } } else { fVar8 = darkness; } if (((local_b4.x == 1.82169e-44) && (local_ec == 1.4013e-45)) && ((*(uint *)((int)this->_descriptor + 0x44) >> 2 & 1) == 0)) { fVar8 = 1.0; } fVar8 = fVar8 - g_game->_lightningIntensity; ambientColor._alpha = *(float *)&this->field_0x1b7c; if (fVar8 <= 0.0) { fVar8 = 0.0; } ambientColor._unk = 0; ambientColor._blue = (baseBlue - *(float *)&this->field_0x1b78) * fVar8 + *(float *)&this->field_0x1b78; ambientColor._green = (baseGreen - *(float *)&this->field_0x1b74) * fVar8 + *(float *)&this->field_0x1b74; ambientColor._red = (local_110 - *(float *)&this->field_0x1b70) * fVar8 + *(float *)&this->field_0x1b70; if (((void *)local_118.x != (void *)0x0) && ((*(byte *)((int)local_118.x + 4) & 1) != 0)) { g_currentShader = (void *)local_118.x; } render_color_quad_list(); } iVar2 = *(int *)this->_litGridIndices; FID_conflict__Erase_tree_>_> (this->_litGridIndices, (fuzzer_allocator_> *)this->_litGridIndices, *(_Tree_node **)(iVar2 + 4)); pRVar4 = room; *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; uVar7 = 0; this->_litGridIndices[4] = 0; this->_litGridIndices[5] = 0; this->_litGridIndices[6] = 0; this->_litGridIndices[7] = 0; if ((room->_entityList)._updateEL._size != 0) { do { Game::Render((Game *)pRVar4, *(undefined4 *)((int)(pRVar4->_entityList)._updateEL._data + uVar7 * 4), &renderOffset); uVar7 = uVar7 + 1; } while (uVar7 < (uint)(pRVar4->_entityList)._updateEL._size); } local_110 = (float)(pRVar4->_gridHeight * pRVar4->_gridWidth); if (0 < (int)local_110) { gridEntitySlot = pRVar4->_gridEntities; do { if (*gridEntitySlot != (void *)0x0) { render_grid_entity_light(pRVar4,*gridEntitySlot,&renderOffset); } gridEntitySlot = gridEntitySlot + 1; local_110 = (float)((int)local_110 + -1); } while (local_110 != 0.0); } if (((pRVar4->_roomType == 5) && (*(int *)(*(int *)((int)pRVar4->_descriptor + 0x10) + 0x10) == 0x59)) && (bVar6 = Level::IsPreAscent((Level *)g_game), bVar6 != 0)) { centerPos = GetCenterPos(&local_b4); local_110 = g_displayPixelRatio * g_screenPointScale; fVar8 = ((g_screenWidth - 338.0) * 0.5 + (centerPos->x - 60.0) * 0.65) * local_110 + 0.5; local_118.x = fVar8; dVar9 = floor((double)fVar8); local_ec = (float)dVar9 / local_110; local_118.x = ((centerPos->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_110 + 0.5 ; dVar9 = floor((double)local_118.x); pCVar1 = &(pRVar4->_lightSprite)._color; (pRVar4->_lightSprite)._scale.x = g_vectorOne.x; (pRVar4->_lightSprite)._scale.y = g_vectorOne.y; local_8c = 0; uStack_88 = 0; local_84 = 0; if (pCVar1 != (ColorMod *)local_ac) { pCVar1->_tint[0] = 1.0; (pRVar4->_lightSprite)._color._tint[1] = 1.0; (pRVar4->_lightSprite)._color._tint[2] = 1.0; (pRVar4->_lightSprite)._color._tint[3] = 1.0; (pRVar4->_lightSprite)._color._offset[0] = 0.0; (pRVar4->_lightSprite)._color._offset[1] = 0.0; (pRVar4->_lightSprite)._color._colorize[0] = 0.0; (pRVar4->_lightSprite)._color._colorize[1] = 0.0; (pRVar4->_lightSprite)._color._colorize[2] = 0.0; (pRVar4->_lightSprite)._color._colorize[3] = 0.0; (pRVar4->_lightSprite)._color._offset[2] = 0.0; } local_118.y = renderOffset._4_4_ + (float)dVar9 / local_110; local_118.x = (float)renderOffset + local_ec; if ((pRVar4->_lightSprite)._loaded != 0) { if ((pRVar4->_lightSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(pRVar4->_lightSprite)._animState,&local_118,&g_vectorZero,&g_vectorZero); beamAnim = &(pRVar4->_lightSprite)._overlayAnimState; } else { AnimationState::Render (&(pRVar4->_lightSprite)._overlayAnimState,&local_118,&g_vectorZero,&g_vectorZero) ; beamAnim = &(pRVar4->_lightSprite)._animState; } AnimationState::Render(beamAnim,&local_118,&g_vectorZero,&g_vectorZero); } } this = pRVar4; if ((g_manager->_optionsConfig)._enableCaustics != 0) { if (g_game->_darknessModifier <= 0.0) { uVar7 = g_game->_debugCurses; uVar3 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); this = room; if ((~preventedCurses & (forcedCurses | uVar7 | uVar3) & 1) == 0) goto LAB_0080f17b; } render_water(); } LAB_0080f17b: _glfw_context_reset(); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } targetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*targetEntry,*(byte *)(targetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } LAB_0080f1ce: render_darkness_overlay(this); if (this->field_0x11f6 == '\x01') { this->field_0x11f6 = 0; render_lava_pit_mask(this); } render_water(this); return; } //@@ 0080f200 Room::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Room:Render */ void Room::Render(void) { std_set *psVar1; int iVar2; uint uVar3; int iVar4; code *pcVar5; int iVar6; undefined1 *puVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; ColorMod color; RoomDescriptor *pRVar12; byte bVar13; char cVar14; uint uVar15; undefined4 *puVar16; void *pvVar17; uint uVar18; uint uVar19; LayerState *layer; int *extraout_EAX; int *extraout_EAX_00; ColorMod *color_00; int *piVar20; int *extraout_EAX_01; ColorMod *color_01; int iVar21; Game *pGVar22; ColorMod *color_02; int *extraout_EAX_02; int *extraout_EAX_03; int *extraout_EAX_04; ColorMod *color_03; undefined *puVar23; ColorMod *color_04; Game *in_ECX; KColor *input; float *pfVar24; AnimationState *rock; int unusedArg; KColor *color_05; int unused; int unusedArg_00; int unusedArg_01; KColor *color_06; int unused_00; int unusedArg_02; int iVar25; int iVar26; KColor *color_07; int unusedArg_03; int unusedArg_04; KColor *color_08; int unusedArg_05; KColor *color_09; KColor *color_10; int *extraout_ECX; int *extraout_ECX_00; int unused_01; int unused_02; int extraout_ECX_01; KColor *color_11; int unused_03; int unused_04; int unused_05; int extraout_ECX_02; KColor *color_12; int unused_06; int unused_07; int extraout_ECX_03; KColor *pKVar27; void **ppvVar28; short *this_00; Room *room; bool bVar29; float fVar30; float fVar31; Game *pGVar32; float fVar33; float fVar34; double dVar35; Vector *pVVar36; void *pvVar37; undefined1 auStack_2d2 [2]; undefined1 screenQuad [112]; Color nightLightColor; Vector renderOffset; Vector local_224; Vector local_21c; Game *local_214; Game *local_210; Game *local_20c; byte isDataminer; char isMineshaftDimension; char isBeastWaterSurface; Game *local_204; Game *local_200; Vector local_1f8; Game *local_1f0; char isWaterSurface; Game *local_1e4; Game *local_1e0; char local_1d5; Game *local_1d4; std_string stageName; undefined1 local_1b8 [28]; float fStack_19c; float fStack_198; float fStack_194; float local_190; Color shaderColor; undefined *roomTypeNames; char *local_15c; undefined *local_158; char *local_154; char *local_150; undefined *local_14c; char *local_148; char *local_144; char *local_140; char *local_13c; char *local_138; char *local_134; char *local_130; char *local_12c; char *local_128; char *local_124; char *local_120; char *local_11c; char *local_118; char *local_114; char *local_110; undefined *local_10c; char *local_108; undefined *local_104; char *local_100; char *local_fc; char *local_f8; char *local_f4; undefined *local_f0; char *local_ec; KColor local_e8; Game *local_d0; Game *pGStack_cc; Game *pGStack_c8; Vector VStack_c4; undefined1 local_bc [16]; Game *local_ac; byte debugText [132]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; GridEntity_Rock *rock; pGVar32 = g_game; puStack_20 = debugText + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00b0154b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(debugText + 0x98); ExceptionList = &local_1c; local_210 = (Game *)0x4e; local_200 = in_ECX; std::set::find_node(); DAT_00c79a4c = 1.0; if (((*(char *)((int)local_1f8.y + 0xd) != '\0') || (0x4e < *(int *)((int)local_1f8.y + 0x10))) || ((void *)local_1f8.y == (pGVar32->_seedEffects)._seedEffects)) { iVar26 = pGVar32->_pixelationTimer; if (iVar26 < 1) { DAT_00c79a4c = 0.0; } else if (pGVar32->_pixelationDuration + -0xf < iVar26) { DAT_00c79a4c = (float)(pGVar32->_pixelationDuration - iVar26) / 15.0; } else if (iVar26 < 0xf) { DAT_00c79a4c = (float)iVar26 / 15.0; } } isDataminer = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)&in_ECX->_roomList[0x9f].Group,0x1e1); if (isDataminer != 0) { DAT_00c7977f = 1; } iVar26 = in_ECX->_roomList[0x28].Flags; if ((iVar26 == 0xb) && ((g_manager->_optionsConfig)._getsSetToEnableWaterSurface != 0)) { local_20c = (Game *)pGVar32->_dizzyIntensity; isWaterSurface = '\x01'; } else { local_20c = (Game *)pGVar32->_dizzyIntensity; isWaterSurface = '\0'; if ((iVar26 == 0x39) && (isWaterSurface = '\0', (g_manager->_optionsConfig)._getsSetToEnableWaterSurface != 0)) { isBeastWaterSurface = '\x01'; isWaterSurface = '\0'; goto LAB_0080f352; } } isBeastWaterSurface = '\0'; LAB_0080f352: local_210 = local_20c; if (((pGVar32->_currentDimensionIdx == 1) && ((pGVar32->_stageType == 4 || (pGVar32->_stageType == 5)))) && ((pGVar32->_stage == 2 || ((pGVar32->_stage == 1 && (uVar15 = Level::GetCurses((Level *)pGVar32), (uVar15 & 2) != 0))))) ) { isMineshaftDimension = '\x01'; local_1f8.x = 0.0; local_1f8.y = 0.0; std::vector::resize(&local_1f8); puVar16 = std::deque::back(); if ((byte *)(puVar16 + 1) != (byte *)0x0) { *(byte *)(puVar16 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar16 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c79854,1); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_1d5 = '\0'; } else { isMineshaftDimension = '\0'; local_1d5 = '\x01'; } if (0.0 < (float)local_20c) { local_1f8.x = 0.0; local_1f8.y = 0.0; std::vector::resize(&local_1f8); puVar16 = std::deque::back(); if ((byte *)(puVar16 + 1) != (byte *)0x0) { *(byte *)(puVar16 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar16 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797fc,1); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_1d5 = '\0'; } if (((g_manager->_optionsConfig)._enableShockwave != 0) && ((*(int *)&in_ECX->_roomList[0x9c].field_0xa4 < *(int *)&in_ECX->_roomList[0x9c].field_0xa8 || (in_ECX->_roomList[0x9d].ListIndex < in_ECX->_roomList[0x9d].Dimension)))) { local_1f8.x = 0.0; local_1f8.y = 0.0; std::vector::resize(&local_1f8); puVar16 = std::deque::back(); if ((byte *)(puVar16 + 1) != (byte *)0x0) { *(byte *)(puVar16 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar16 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797d4,1); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_1d5 = '\0'; } if (isWaterSurface != '\0') { local_1f8.x = 0.0; local_1f8.y = 0.0; std::vector::resize(&local_1f8); puVar16 = std::deque::back(); if ((byte *)(puVar16 + 1) != (byte *)0x0) { *(byte *)(puVar16 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar16 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797e4,1); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_1d5 = '\0'; } if (isBeastWaterSurface != '\0') { local_1f8.x = 0.0; local_1f8.y = 0.0; std::vector::resize(&local_1f8); puVar16 = std::deque::back(); if ((byte *)(puVar16 + 1) != (byte *)0x0) { *(byte *)(puVar16 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar16 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c7984c,1); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_1d5 = '\0'; } if (in_ECX->_roomList[0x28].Flags == 0x39) { render_beast_arena_background(); } 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; local_1f8.y = (float)&in_ECX->_roomList[0x1e].SavedEntities; FXLayers::render_behind_layers(); fVar34 = 2.0; if (local_1d5 != '\0') { if (in_ECX->_roomList[0x28].Flags == 0x1c) { local_1b8._24_4_ = 0.2784314; fStack_19c = 0.18039216; fStack_198 = 0.101960786; fStack_194 = 1.0; local_190 = 0.0; fVar33 = ((Vector *)&in_ECX->_roomList[0x18].field_0xa8)->x + (g_game->_screenShakeOffset).x + ((Vector *)&in_ECX->_roomList[0x18].DeliriumDistance)->x; fVar31 = *(float *)&in_ECX->_roomList[0x18].ShopItemIdx + (g_game->_screenShakeOffset).y + (float)in_ECX->_roomList[0x18].Group; fVar30 = (float)in_ECX->_curses - 2.0; fVar34 = (float)*(int *)&in_ECX->field_0x10 - 2.0; LAB_0080f949: local_bc._12_4_ = fVar30 * 26.0; local_ac = (Game *)(fVar34 * 26.0); VStack_c4.y = fVar31 + 52.0; VStack_c4.x = fVar33 + 52.0; render_quad_set_rect (screenQuad,&VStack_c4,(Vector *)(local_bc + 0xc),(KColor *)(local_1b8 + 0x18)); render_color_shader_pass(screenQuad); } else { KColor::SetFromARGB(&local_e8,0xff000000); Color::apply_to_kcolor ((KColor *)(local_1b8 + 0x18),(ColorMod *)&in_ECX->_roomList[0x9f].TotalMoneySpent, input); KColor::SetFromARGB(&local_e8,0xff000000); pfVar24 = (float *)(local_1b8 + 0x18); uVar15 = 0xc; pKVar27 = &local_e8; do { if (*pfVar24 != pKVar27->_red) { fVar30 = (float)in_ECX->_curses - fVar34; fVar33 = (g_game->_screenShakeOffset).x + ((Vector *)&in_ECX->_roomList[0x18].field_0xa8)->x + ((Vector *)&in_ECX->_roomList[0x18].DeliriumDistance)->x; fVar31 = (g_game->_screenShakeOffset).y + *(float *)&in_ECX->_roomList[0x18].ShopItemIdx + (float)in_ECX->_roomList[0x18].Group; fVar34 = (float)*(int *)&in_ECX->field_0x10 - fVar34; goto LAB_0080f949; } pfVar24 = pfVar24 + 1; pKVar27 = (KColor *)&pKVar27->_green; bVar29 = 3 < uVar15; uVar15 = uVar15 - 4; } while (bVar29); } } if (((g_manager->_optionsConfig)._enableShockwave == 0) && ((local_1d4 = (Game *)&in_ECX->_roomList[0x9c].field_0xa4, *(int *)&in_ECX->_roomList[0x9c].field_0xa4 < *(int *)&in_ECX->_roomList[0x9c].field_0xa8 || (in_ECX->_roomList[0x9d].ListIndex < in_ECX->_roomList[0x9d].Dimension)))) { local_1f0 = (Game *)0x2; do { local_1e4 = *(Game **)local_1d4; local_204 = *(Game **)((int)local_1d4 + 4); pGVar32 = local_1d4; if (((int)local_1e4 < (int)local_204) && (((iVar26 = in_ECX->_roomList[0x28].Flags, iVar26 == 0x12 || (iVar26 == 0x1c)) && ((*(byte *)((int)in_ECX->_stageType + 0x44) & 1) == 0)))) { ppvVar28 = &in_ECX->_roomList[0x9d].OverrideData; pvVar17 = ANM2::GetAnimationData((ANM2 *)ppvVar28,s_Idle); local_1e4 = (Game *)(int)((float)*(int *)((int)pvVar17 + 0x30) * ((float)(int)local_1e4 / (float)(int)local_204)); bVar13 = ANM2::SetAnimation((ANM2 *)ppvVar28,s_Idle,1); if (((bVar13 != 0) && (iVar26._0_2_ = in_ECX->_roomList[0x9d].TotalMoneySpent, iVar26._2_2_ = in_ECX->_roomList[0x9d].ClearCount, iVar26 != 0)) && (AnimationState::SetFrameFloat ((AnimationState *)&in_ECX->_roomList[0x9d].Flags,(float)(int)local_1e4), iVar21._0_2_ = in_ECX->_roomList[0x9d].TotalMoneySpent, iVar21._2_2_ = in_ECX->_roomList[0x9d].ClearCount, iVar21 != 0)) { *(undefined1 *)&in_ECX->_roomList[0x9d].DecorationSeed = 0; } pGVar32 = local_1d4; pfVar24 = (float *)((int)local_1d4 + -0x14); local_204 = (Game *)((*(float *)((int)local_1d4 + -0x10) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5); local_1d4 = (Game *)(g_displayPixelRatio * g_screenPointScale); local_1e4 = (Game *)(((*pfVar24 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_1d4 + 0.5); dVar35 = floor((double)(float)local_1e4); local_1e0 = (Game *)((float)dVar35 / (float)local_1d4); local_1e4 = (Game *)((float)local_204 * (float)local_1d4 + 0.5); dVar35 = floor((double)(float)local_1e4); local_1e4 = (Game *)(float)dVar35; local_bc._12_4_ = (float)local_1e0 + ((Vector *)&in_ECX->_roomList[0x18].DeliriumDistance)->x; local_ac = (Game *)((float)local_1e4 / (float)local_1d4 + (float)in_ECX->_roomList[0x18].Group); if (*(undefined1 *)((int)&in_ECX->_roomList[0x9e].BossDeathSeed + 1) != '\0') { if ((char)in_ECX->_roomList[0x9d].RestrictedGridIndexes._size == '\0') { AnimationState::Render ((AnimationState *)&in_ECX->_roomList[0x9d].Flags,(Vector *)(local_bc + 0xc), &g_vectorZero,&g_vectorZero); rock = (AnimationState *)&in_ECX->_roomList[0x9d].BossDeathSeed; } else { AnimationState::Render ((AnimationState *)&in_ECX->_roomList[0x9d].BossDeathSeed, (Vector *)(local_bc + 0xc),&g_vectorZero,&g_vectorZero); rock = (AnimationState *)&in_ECX->_roomList[0x9d].Flags; } AnimationState::Render(rock,(Vector *)(local_bc + 0xc),&g_vectorZero,&g_vectorZero); } } local_1d4 = (Game *)((int)pGVar32 + 0x1c); local_1f0 = (Game *)((int)local_1f0 + -1); } while (local_1f0 != (Game *)0x0); local_1f0 = (Game *)0x0; } local_1e4 = (Game *)g_graphicsManager_blendMode[4]; local_e8._red = (float)g_graphicsManager_blendMode[0]; local_e8._green = (float)g_graphicsManager_blendMode[1]; local_e8._blue = (float)g_graphicsManager_blendMode[2]; local_e8._alpha = (float)g_graphicsManager_blendMode[3]; if ((*(float *)&in_ECX->_roomList[0x9e].field_0x9c <= 0.0) || ((g_manager->_optionsConfig)._enableWaterSurface == 0)) { local_1d5 = '\0'; } else { local_1d5 = '\x01'; } local_204 = (Game *)&in_ECX->_roomList[0x18].DeliriumDistance; renderOffset.y = *(float *)&in_ECX->_roomList[0x18].ShopItemIdx + (g_game->_screenShakeOffset).y + (float)in_ECX->_roomList[0x18].Group; renderOffset.x = (g_game->_screenShakeOffset).x + ((Vector *)&in_ECX->_roomList[0x18].field_0xa8)->x + ((Vector *)local_204)->x; if (local_1d5 == '\0') { local_1f0 = (Game *)&in_ECX->_roomList[0x19].Dimension; *(int *)&in_ECX->_roomList[0x19].ShopItemIdx = 0; in_ECX->_roomList[0x19].DeliriumDistance = 1; iVar25._0_1_ = in_ECX->_bossChallenge; iVar25._1_1_ = in_ECX->_devilRoomDisabled; iVar25._2_2_ = *(undefined2 *)&in_ECX->field_0xa; if (iVar25 == 0x10) { local_1d4 = (Game *)0x0; if (0 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses) { local_1e0 = (Game *)&in_ECX->_roomList[0].Data; do { if (*(int **)local_1e0 != (int *)0x0) { (**(code **)(**(int **)local_1e0 + 0xc))(); } local_1e0 = (Game *)((int)local_1e0 + 4); local_1d4 = (Game *)((int)local_1d4 + 1); } while ((int)local_1d4 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses); } } else { uVar8._0_2_ = in_ECX->_roomList[0x9f].TotalMoneySpent; uVar8._2_2_ = in_ECX->_roomList[0x9f].ClearCount; uVar9._0_2_ = in_ECX->_roomList[0x9f].PoopCount; uVar9._2_2_ = in_ECX->_roomList[0x9f].TKeeperCoinSpawns; Backdrop::RenderFloor (&renderOffset,uVar8,in_ECX->_roomList[0x9f].GreedSubType,uVar9, in_ECX->_roomList[0x9f].PitsCount,in_ECX->_roomList[0x9f].DecorationSeed, in_ECX->_roomList[0x9f].SpawnSeed,in_ECX->_roomList[0x9f].AwardSeed, in_ECX->_roomList[0x9f].BossDeathSeed, in_ECX->_roomList[0x9f].SavedGridEntities._begin); if ((char)in_ECX->_roomList[0x26].RestrictedGridIndexes._size != '\0') { uVar10._0_2_ = in_ECX->_roomList[0x9f].TotalMoneySpent; uVar10._2_2_ = in_ECX->_roomList[0x9f].ClearCount; uVar11._0_2_ = in_ECX->_roomList[0x9f].PoopCount; uVar11._2_2_ = in_ECX->_roomList[0x9f].TKeeperCoinSpawns; Backdrop::render_floor_surface (&renderOffset,uVar10,in_ECX->_roomList[0x9f].GreedSubType,uVar11, in_ECX->_roomList[0x9f].PitsCount,in_ECX->_roomList[0x9f].DecorationSeed, in_ECX->_roomList[0x9f].SpawnSeed,in_ECX->_roomList[0x9f].AwardSeed, in_ECX->_roomList[0x9f].BossDeathSeed, in_ECX->_roomList[0x9f].SavedGridEntities._begin); } FXLayers::render_veins(); local_1d4 = (Game *)0x0; if (0 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses) { local_1e0 = (Game *)&in_ECX->_roomList[0].Data; do { piVar20 = *(int **)local_1e0; if ((piVar20 != (int *)0x0) && (piVar20[1] == 1)) { (**(code **)(*piVar20 + 0xc))(); } local_1e0 = (Game *)((int)local_1e0 + 4); local_1d4 = (Game *)((int)local_1d4 + 1); } while ((int)local_1d4 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses); } } EntityList::render_up_to(); if (in_ECX->_roomList[0x28].Flags == 0x39) { render_beast_arena_background(); } } else { render_water_shader((Room *)in_ECX,&renderOffset); local_1f0 = (Game *)&in_ECX->_roomList[0x19].Dimension; *(int *)&in_ECX->_roomList[0x19].ShopItemIdx = 0; in_ECX->_roomList[0x19].DeliriumDistance = 3; EntityList::render_up_to(); } iVar2._0_1_ = in_ECX->_bossChallenge; iVar2._1_1_ = in_ECX->_devilRoomDisabled; iVar2._2_2_ = *(undefined2 *)&in_ECX->field_0xa; if (iVar2 != 0x10) { color._tint[0] = (float)in_ECX->_roomList[0x9f].SavedEntities._begin; color._tint[1] = (float)in_ECX->_roomList[0x9f].SavedEntities._end; color._tint[2] = (float)in_ECX->_roomList[0x9f].SavedEntities._capacity; color._tint[3] = (float)in_ECX->_roomList[0x9f].RestrictedGridIndexes._head; color._colorize[0] = (float)in_ECX->_roomList[0x9f].RestrictedGridIndexes._size; color._colorize[1] = (float)in_ECX->_roomList[0x9f].SavedEffects._begin; color._colorize[2] = (float)in_ECX->_roomList[0x9f].SavedEffects._end; color._colorize[3] = (float)in_ECX->_roomList[0x9f].SavedEffects._capacity; color._offset[0] = *(float *)&in_ECX->_roomList[0x9f].field_0x94; color._offset[1] = *(float *)&in_ECX->_roomList[0x9f].field_0x98; color._offset[2] = *(float *)&in_ECX->_roomList[0x9f].field_0x9c; Backdrop::RenderWalls((Backdrop *)&in_ECX->_roomList[0x26].BossDeathSeed,&renderOffset,color); if (((g_manager->_optionsConfig)._enableCaustics != 0) && (g_game->_darknessModifier <= 0.0)) { uVar15 = g_game->_debugCurses; uVar3 = g_game->_curses; uVar18 = Seeds::GetForcedCurses(); uVar19 = Seeds::GetPreventedCurses(); if ((~uVar19 & (uVar18 | uVar15 | uVar3) & 1) == 0) { set_blend_mode(&DAT_00c798e0,2); in_ECX = local_200; render_water(); g_graphicsManager_blendMode[0] = (int)local_e8._red; g_graphicsManager_blendMode[1] = (int)local_e8._green; g_graphicsManager_blendMode[2] = (int)local_e8._blue; g_graphicsManager_blendMode[3] = (int)local_e8._alpha; g_graphicsManager_blendMode[4] = (int)local_1e4; } else { in_ECX = local_200; } } if (local_1d5 == '\0') { local_1e4 = (Game *)&in_ECX->_roomList[0xa1].field_0x9c; RailManager::Render(); local_1d4 = (Game *)0x0; if (0 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses) { local_1e0 = (Game *)&in_ECX->_roomList[0].Data; do { piVar20 = *(int **)local_1e0; if ((piVar20 != (int *)0x0) && ((iVar26 = piVar20[1], iVar26 == 7 || ((iVar26 != 0x10 && (((iVar26 == 0x11 || (iVar26 == 0x12)) || ((iVar26 == 0xe && (piVar20[3] == 1000))))) ))))) { (**(code **)(*piVar20 + 0xc))(); } local_1d4 = (Game *)((int)local_1d4 + 1); local_1e0 = (Game *)((int)local_1e0 + 4); } while ((int)local_1d4 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses); } if ((in_ECX->_roomList[0x28].Flags == 0x20) && ((*(uint *)((int)in_ECX->_stageType + 0x44) >> 5 & 1) != 0)) { render_water_overlay(); local_1d4 = (Game *)0x0; if (0 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses) { local_1e0 = (Game *)&in_ECX->_roomList[0].Data; do { pvVar17 = *(void **)local_1e0; if ((pvVar17 != (void *)0x0) && (*(int *)((int)pvVar17 + 4) == 7)) { layer = ANM2::GetLayer((ANM2 *)((int)pvVar17 + 0x40),(byte *)0x0); layer->_visible = 0; (**(code **)(**(int **)local_1e0 + 0xc))(); layer = ANM2::GetLayer((ANM2 *)((int)*(void **)local_1e0 + 0x40),(byte *)0x0); layer->_visible = 1; } local_1e0 = (Game *)((int)local_1e0 + 4); local_1d4 = (Game *)((int)local_1d4 + 1); } while ((int)local_1d4 < *(int *)&in_ECX->field_0x10 * in_ECX->_curses); } } render_pit_rails((Room *)local_1e4); } } pVVar36 = (Vector *)0x2710; EntityList::render_up_to(); if (isBeastWaterSurface != '\0') { _glfw_context_reset(); pop_render_target(); BlendMode::SetMode(local_1b8 + 0x18,1,unusedArg); g_graphicsManager_blendMode[0] = *extraout_EAX; g_graphicsManager_blendMode[1] = extraout_EAX[1]; g_graphicsManager_blendMode[2] = extraout_EAX[2]; g_graphicsManager_blendMode[3] = extraout_EAX[3]; g_graphicsManager_blendMode[4] = extraout_EAX[4]; shaderColor._colorize[2] = 0.0; shaderColor._tint[2] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._tint[3] = 0.0; shaderColor._offset[0] = 1.0; shaderColor._colorize[0] = 1.0; shaderColor._offset[1] = 1.0; shaderColor._colorize[3] = 1.0; shaderColor._offset[2]._0_1_ = 0; KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_05); pGVar32 = g_game; puVar23 = &DAT_00c79618; if ((DAT_00c7961c & 1) == 0) { puVar23 = g_currentShader; } local_21c.y = (float)((double)DAT_00c7984c[7] + __uint_to_double_fixup[-(DAT_00c7984c[7] >> 0x1f)]); local_224.y = (float)((double)DAT_00c7984c[6] + __uint_to_double_fixup[-(DAT_00c7984c[6] >> 0x1f)]); VStack_c4.y = local_224.y / (g_screenPointScale * 1024.0); local_ac = (Game *)(local_21c.y / (g_screenPointScale * 1024.0)); local_1d4 = (Game *)(g_displayPixelRatio * g_screenPointScale); local_1e0 = (Game *)((g_screenHeight - 182.0) * 0.5); local_1e4 = (Game *)((((float)local_200->_roomList[0].GridIndex - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_1d4 + 0.5); g_currentShader = puVar23; dVar35 = floor((double)(float)local_1e4); local_214 = (Game *)(float)dVar35; local_1e4 = (Game *)((((float)local_200->_roomList[0].SafeGridIndex - 140.0) * 0.65 + (float)local_1e0) * (float)local_1d4 + 0.5); iVar26 = (int)((ulonglong)(double)(float)local_1e4 >> 0x20); dVar35 = floor((double)(float)local_1e4); local_1e4 = (Game *)(float)dVar35; VStack_c4.x = (((float)local_204->_stage + (pGVar32->_screenShakeOffset).x + (float)local_214 / (float)local_1d4) * g_screenPointScale) / local_224.y; pGStack_cc = (Game *)VStack_c4.y; VStack_c4.y = (((pGVar32->_screenShakeOffset).y + (float)local_204->_stageType + (float)local_1e4 / (float)local_1d4) * g_screenPointScale) / local_21c.y; pGStack_c8 = local_ac; local_ac = (Game *)((float)(pGVar32->_frameCount % 0x3c) / 60.0); Shader::set_uniform(puVar23,(byte *)"Ratio",0xb,&pGStack_cc,iVar26); Shader::set_uniform(g_currentShader,(byte *)"Amount",8,&local_ac,unused); (**(code **)(*DAT_00c7984c + 0x14))(shaderColor._tint + 2); pVVar36 = (Vector *)0x81049f; shader_cache_find(unusedArg_00); } pGVar32 = local_200; if (local_200->_roomList[0x28].Flags == 0x39) { pVVar36 = (Vector *)0x8104bb; render_beast_arena_background(); } iVar4._0_1_ = pGVar32->_bossChallenge; iVar4._1_1_ = pGVar32->_devilRoomDisabled; iVar4._2_2_ = *(undefined2 *)&pGVar32->field_0xa; if (iVar4 != 0x10) { local_1d4 = (Game *)0x0; if (0 < *(int *)&pGVar32->field_0x10 * pGVar32->_curses) { ppvVar28 = &pGVar32->_roomList[0].Data; do { piVar20 = *ppvVar28; if ((piVar20 != (int *)0x0) && (piVar20[1] == 0x10)) { pVVar36 = (Vector *)0x8104fa; (**(code **)(*piVar20 + 0xc))(); } local_1d4 = (Game *)((int)local_1d4 + 1); ppvVar28 = ppvVar28 + 1; } while ((int)local_1d4 < *(int *)&pGVar32->field_0x10 * pGVar32->_curses); } piVar20 = DAT_00c797bc; if (DAT_00c797bc != (int *)0x0) { BlendMode::SetMode(local_1b8 + 0x18,1,(int)local_1d4); g_graphicsManager_blendMode[0] = *extraout_EAX_00; g_graphicsManager_blendMode[1] = extraout_EAX_00[1]; g_graphicsManager_blendMode[2] = extraout_EAX_00[2]; g_graphicsManager_blendMode[3] = extraout_EAX_00[3]; g_graphicsManager_blendMode[4] = extraout_EAX_00[4]; pcVar5 = *(code **)(*piVar20 + 0x20); KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); pVVar36 = &renderOffset; (*pcVar5)(); } shader_stack_push(); pvVar17 = (void *)0x8105a3; Color::Color(&shaderColor); KAGE::SmartPointer::operator_assign(auStack_2d2 + -10,&DAT_00c797b4); apply_sprite_shader_params(color_00,1,pVVar36,pvVar17); local_190 = 0.0; local_1b8._24_4_ = 1.0; fStack_19c = 1.0; fStack_198 = 1.0; fStack_194 = 0.24; (**(code **)(*DAT_00c797b4 + 0x20))(); piVar20 = (int *)FUN_00684fc0(); pvVar17 = (void *)*piVar20; if ((pvVar17 != (void *)0x0) && ((*(byte *)((int)pvVar17 + 4) & 1) != 0)) { g_currentShader = pvVar17; } DAT_00c79770 = DAT_00c79770 + -1; if (DAT_00c79770 == 0) { DAT_00c7976c = 0; } } FXLayers::render_background_layers(); if (isWaterSurface != '\0') { _glfw_context_reset(); pop_render_target(); BlendMode::SetMode(local_1b8 + 0x18,1,unusedArg_01); g_graphicsManager_blendMode[0] = *extraout_EAX_01; g_graphicsManager_blendMode[1] = extraout_EAX_01[1]; g_graphicsManager_blendMode[2] = extraout_EAX_01[2]; g_graphicsManager_blendMode[3] = extraout_EAX_01[3]; g_graphicsManager_blendMode[4] = extraout_EAX_01[4]; shaderColor._colorize[2] = 0.0; shaderColor._tint[2] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._tint[3] = 0.0; shaderColor._offset[0] = 1.0; shaderColor._colorize[0] = 1.0; shaderColor._offset[1] = 1.0; shaderColor._colorize[3] = 1.0; shaderColor._offset[2]._0_1_ = 0; KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_06); pGVar32 = g_game; puVar23 = &DAT_00c79578; if ((DAT_00c7957c & 1) == 0) { puVar23 = g_currentShader; } local_214 = (Game *)(float)((double)DAT_00c797e4[7] + __uint_to_double_fixup[-(DAT_00c797e4[7] >> 0x1f)]); local_224.y = (float)((double)DAT_00c797e4[6] + __uint_to_double_fixup[-(DAT_00c797e4[6] >> 0x1f)]); local_1e4 = (Game *)(local_224.y / (g_screenPointScale * 1024.0)); local_1e0 = (Game *)((float)local_214 / (g_screenPointScale * 1024.0)); local_1d4 = (Game *)(g_displayPixelRatio * g_screenPointScale); VStack_c4.y = (g_screenHeight - 182.0) * 0.5; local_ac = (Game *)((((float)local_200->_roomList[0].GridIndex - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_1d4 + 0.5); g_currentShader = puVar23; dVar35 = floor((double)(float)local_ac); local_21c.y = (float)dVar35; local_ac = (Game *)((((float)local_200->_roomList[0].SafeGridIndex - 140.0) * 0.65 + VStack_c4.y ) * (float)local_1d4 + 0.5); iVar26 = (int)((ulonglong)(double)(float)local_ac >> 0x20); dVar35 = floor((double)(float)local_ac); VStack_c4.x = (((pGVar32->_screenShakeOffset).x + (float)local_204->_stage + local_21c.y / (float)local_1d4) * g_screenPointScale) / local_224.y; pGStack_cc = local_1e4; VStack_c4.y = (((pGVar32->_screenShakeOffset).y + (float)local_204->_stageType + (float)dVar35 / (float)local_1d4) * g_screenPointScale) / (float)local_214; pGStack_c8 = local_1e0; local_ac = (Game *)((float)(pGVar32->_frameCount % 0x3c) / 60.0); Shader::set_uniform(puVar23,(byte *)"Ratio",0xb,&pGStack_cc,iVar26); Shader::set_uniform(g_currentShader,(byte *)"Amount",8,&local_ac,unused_00); (**(code **)(*DAT_00c797e4 + 0x14))(shaderColor._tint + 2); shader_cache_find(unusedArg_02); pGVar32 = local_200; } Color::Color(&shaderColor); Sprite::SetColor((Sprite *)(pGVar32->_roomList[0x99]._doors + 6),color_01); iVar26 = *(int *)&pGVar32->_roomList[0x9f].ShopItemIdx; this_00 = &pGVar32->_roomList[0x9f].ShopItemIdx; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(iVar26 + 4)); room = (Room *)local_200; *(int *)(iVar26 + 4) = iVar26; *(int *)iVar26 = iVar26; *(int *)(iVar26 + 8) = iVar26; pGVar32->_roomList[0x9f].DeliriumDistance = 0; local_1d4 = (Game *)0x0; pRVar12 = local_200->_roomList; if (local_200->_roomList[0x19].DecorationSeed != 0) { do { render_player_light(room,*(Entity_Player **) ((int)*(void **)&((Game *)room)->_roomList[0x19].PoopCount + (int)local_1d4 * 4),(Vector *)&pRVar12[0x18].DeliriumDistance); local_1d4 = (Game *)((int)local_1d4 + 1); } while (local_1d4 < (uint)((Game *)room)->_roomList[0x19].DecorationSeed); } iVar6._0_1_ = ((Game *)room)->_bossChallenge; iVar6._1_1_ = ((Game *)room)->_devilRoomDisabled; iVar6._2_2_ = *(undefined2 *)&((Game *)room)->field_0xa; if (iVar6 != 0x10) { iVar21 = *(int *)&((Game *)room)->field_0x10; iVar26 = ((Game *)room)->_curses; local_1d4 = (Game *)0x0; if (0 < iVar21 * iVar26) { local_1e0 = (Game *)&((Game *)room)->_roomList[0].Data; do { local_ac = *(Game **)local_1e0; if ((((((local_ac != (Game *)0x0) && (puVar7 = (undefined1 *)local_ac->_stageType, puVar7 != (undefined1 *)0x1)) && (puVar7 != &DAT_00000007)) && ((puVar7 != (undefined1 *)0x10 && (puVar7 != &DAT_00000011)))) && ((puVar7 != (undefined1 *)0x12 && ((puVar7 != &DAT_0000000e || (local_ac->_curses != 1000)))))) && ((local_1d5 == '\0' || ((**(code **)(local_ac->_stage + 0x18))(), ((uint)VStack_c4.x & 2) == 0)))) { (**(code **)(local_ac->_stage + 0xc))(); } iVar21 = *(int *)&((Game *)room)->field_0x10; iVar26 = ((Game *)room)->_curses; local_1d4 = (Game *)((int)local_1d4 + 1); local_1e0 = (Game *)((int)local_1e0 + 4); } while ((int)local_1d4 < iVar21 * iVar26); } local_1e0 = (Game *)0x2710; local_1d4 = (Game *)0x0; if (0 < iVar21) { VStack_c4.y = 10000.0; do { if (((iVar26 < 1) || ((int)local_1d4 < 0)) || (iVar21 <= (int)local_1d4)) { iVar21 = -1; } else { iVar21 = (int)local_1d4 * iVar26; } local_ac = (Game *)(((float)(iVar21 / iVar26) * 40.0 + 120.0 + 20.0) * 100.0 + 10030.0 + 0.5 ); dVar35 = floor((double)(float)local_ac); local_ac = (Game *)(float)dVar35; local_1e0 = (Game *)__ftoui3(); EntityList::render_up_to(); iVar26 = ((Game *)room)->_curses; iVar21 = 0; if (0 < iVar26) { do { if (((((-1 < iVar21) && (iVar21 < iVar26)) && ((-1 < (int)local_1d4 && (((int)local_1d4 < *(int *)&((Game *)room)->field_0x10 && (iVar25 = (int)local_1d4 * iVar26 + iVar21, -1 < iVar25)))))) && (rock = (GridEntity_Rock *)((Game *)room)->_roomMap[iVar25 + -0x5eae], rock != (GridEntity_Rock *)0x0)) && ((rock->_desc)._type == 0x18)) { GridEntity_Rock::RenderTop (rock,(Vector *)&((Game *)room)->_roomList[0x18].DeliriumDistance); iVar26 = ((Game *)room)->_curses; } iVar21 = iVar21 + 1; } while (iVar21 < iVar26); } iVar21 = *(int *)&((Game *)room)->field_0x10; local_1d4 = (Game *)((int)local_1d4 + 1); } while ((int)local_1d4 < iVar21); } EntityList::render_up_to(); } if (local_1d5 != '\0') { ((Game *)room)->_roomList[0x19].DeliriumDistance = 1; } pVVar36 = (Vector *)0xffffffff; EntityList::render_up_to(); pGVar32 = local_1f0; uVar15 = 0; pGVar22 = (Game *)&((Game *)room)->_roomList[0x19].Dimension; if (*(int *)&((Game *)room)->_roomList[0x19].ShopItemIdx != 0) { do { (**(code **)(**(int **)((int)((EntityList_EL *)((int)pGVar32 + 0x50))->_data + uVar15 * 4) + 0x1c))(); uVar15 = uVar15 + 1; } while (uVar15 < (uint)*(int *)((int)pGVar32 + 0xa0)); pGVar22 = local_1f0; room = (Room *)local_200; } pGVar32 = g_game; ((EntityList *)pGVar22)->_renderMode = 0; local_1d4 = (Game *)0x0; if ((int)(pGVar32->_playerManager)._extraPlayers._end - (int)(pGVar32->_playerManager)._extraPlayers._begin >> 2 != 0) { do { pVVar36 = (Vector *)0x810d10; (**(code **)(**(int **)((int)(pGVar32->_playerManager)._extraPlayers._begin + (int)local_1d4 * 4) + 0x14))(); local_1d4 = (Game *)((int)&local_1d4->_stage + 1); pGVar32 = g_game; } while (local_1d4 < (undefined1 *) ((int)(g_game->_playerManager)._extraPlayers._end - (int)(g_game->_playerManager)._extraPlayers._begin >> 2)); room = (Room *)local_200; } local_1f0 = (Game *)0x0; if ((int)(pGVar32->_playerManager)._playerList._end - (int)(pGVar32->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar17 = (pGVar32->_playerManager)._playerList._end; puVar16 = (pGVar32->_playerManager)._playerList._begin; if ((int)pvVar17 - (int)puVar16 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar17 = (pGVar32->_playerManager)._playerList._end; puVar16 = (pGVar32->_playerManager)._playerList._begin; } pGVar32 = local_1f0; if (local_1f0 < (Game *)((int)pvVar17 - (int)puVar16 >> 2)) { puVar16 = puVar16 + (int)local_1f0; } pVVar36 = (Vector *)0x1a9; bVar13 = Entity_Player::HasCollectible((Entity_Player *)*puVar16,0x1a9,0); if (bVar13 != 0) { local_ac = g_game; pvVar17 = (g_game->_playerManager)._playerList._end; piVar20 = (g_game->_playerManager)._playerList._begin; if ((int)pvVar17 - (int)piVar20 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar17 = (local_ac->_playerManager)._playerList._end; piVar20 = (local_ac->_playerManager)._playerList._begin; } if (pGVar32 < (Game *)((int)pvVar17 - (int)piVar20 >> 2)) { piVar20 = piVar20 + (int)pGVar32; } ((Game *)room)->_roomList[0x9b].SavedEntities._capacity = (void *)(*(float *)(*piVar20 + 0x1ae4) - 90.0); Color::Reset(&nightLightColor); psVar1 = &((Game *)room)->_roomList[0x9b].RestrictedGridIndexes; nightLightColor._offset[0] = 0.0; nightLightColor._offset[1] = 0.0; nightLightColor._offset[2] = 0.0; if ((Color *)psVar1 != &nightLightColor) { psVar1->_head = (void *)0x3f800000; ((Game *)room)->_roomList[0x9b].RestrictedGridIndexes._size = 0x3f800000; ((Game *)room)->_roomList[0x9b].SavedEffects._begin = (void *)0x3f800000; ((Game *)room)->_roomList[0x9b].SavedEffects._end = (void *)0x3e4ccccd; ((Game *)room)->_roomList[0x9b].SavedEffects._capacity = (void *)nightLightColor._colorize[0]; *(float *)&((Game *)room)->_roomList[0x9b].field_0x94 = nightLightColor._colorize[1]; *(float *)&((Game *)room)->_roomList[0x9b].field_0x98 = nightLightColor._colorize[2]; *(float *)&((Game *)room)->_roomList[0x9b].field_0x9c = nightLightColor._colorize[3]; *(undefined8 *)&((Game *)room)->_roomList[0x9b].field_0xa0 = 0; *(undefined4 *)&((Game *)room)->_roomList[0x9b].field_0xa8 = 0; } uVar15 = g_graphicsManager_flags; layer = ANM2::GetLayer((ANM2 *)&((Game *)room)->_roomList[0x9a].SavedEffects._capacity, (byte *)0x0); pGVar32 = g_game; iVar26 = 1; if ((uVar15 & 4) == 0) { iVar26 = 6; } layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar26; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; pvVar17 = (pGVar32->_playerManager)._playerList._end; piVar20 = (pGVar32->_playerManager)._playerList._begin; if ((int)pvVar17 - (int)piVar20 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar17 = (pGVar32->_playerManager)._playerList._end; piVar20 = (pGVar32->_playerManager)._playerList._begin; } pGVar32 = local_1f0; if (local_1f0 < (Game *)((int)pvVar17 - (int)piVar20 >> 2)) { piVar20 = piVar20 + (int)local_1f0; } local_1d4 = (Game *)(g_displayPixelRatio * g_screenPointScale); VStack_c4.y = (*(float *)(*piVar20 + 0x340) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5 ; local_ac = (Game *)((float)local_1d4 * ((*(float *)(*piVar20 + 0x33c) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) + 0.5); dVar35 = floor((double)(float)local_ac); local_21c.y = (float)dVar35 / (float)local_1d4; local_ac = (Game *)((float)local_1d4 * VStack_c4.y + 0.5); dVar35 = floor((double)(float)local_ac); local_ac = (Game *)(float)dVar35; pVVar36 = &g_vectorZero; local_224.x = local_21c.y + ((Vector *)&((Game *)room)->_roomList[0x18].DeliriumDistance)->x ; local_224.y = (float)local_ac / (float)local_1d4 + (float)((Game *)room)->_roomList[0x18].Group; ANM2::Render((ANM2 *)&((Game *)room)->_roomList[0x9a].SavedEffects._capacity,&local_224, &g_vectorZero,&g_vectorZero); } local_1f0 = (Game *)((int)&pGVar32->_stage + 1); pGVar32 = g_game; } while (local_1f0 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } if (((uint)pGVar32->_debugFlags >> 1 & 1) != 0) { pVVar36 = (Vector *)0x8110b2; render_debug_grid_values(room); pGVar32 = g_game; } if (((uint)pGVar32->_debugFlags >> 10 & 1) != 0) { pVVar36 = (Vector *)0x8110d3; render_debug_grid_indices(room); pGVar32 = g_game; } puVar23 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar23 = g_currentShader; } g_currentShader = puVar23; if ((g_manager->_optionsConfig)._enableLighting != 0) { if (pGVar32->_darknessModifier <= 0.0) { Seeds::GetForcedCurses(); Seeds::GetPreventedCurses(); } fVar30 = GetLightingAlpha(room); fVar34 = g_game->_lightningIntensity; if (fVar34 <= 0.0) { fVar34 = 0.0; } if (1.0 <= fVar34) { fVar34 = 1.0; } local_ac = (Game *)(fVar30 - fVar34 * 0.2); if (0.0 < (float)local_ac) { VStack_c4.y = (float)g_graphicsManager_blendMode[4]; local_1b8._24_4_ = g_graphicsManager_blendMode[0]; fStack_19c = (float)g_graphicsManager_blendMode[1]; fStack_198 = (float)g_graphicsManager_blendMode[2]; fStack_194 = (float)g_graphicsManager_blendMode[3]; g_graphicsManager_blendMode[4] = 7; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 4; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 8; pvVar17 = (void *)0x8111a8; Color::Color(&shaderColor); KAGE::SmartPointer::operator_assign(auStack_2d2 + -10,&DAT_00c797cc); apply_sprite_shader_params(color_02,1,pVVar36,pvVar17); local_e8._unk = 0; local_e8._red = 1.0; local_e8._green = 1.0; pcVar5 = *(code **)(*DAT_00c797cc + 0x1c); local_e8._blue = 1.0; local_e8._alpha = (float)local_ac; KColor::SetFromARGB((KColor *)local_bc,0xffffffff); render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_07); (*pcVar5)(); if (0.0 < g_game->_lightningIntensity) { pGVar32 = (Game *)(g_game->_lightningIntensity * 0.5); if ((float)pGVar32 <= 0.0) { pGVar32 = (Game *)0x0; } if (0.5 <= (float)pGVar32) { pGVar32 = (Game *)0x3f000000; } BlendMode::SetMode(&local_e8,2,unusedArg_03); g_graphicsManager_blendMode[0] = *extraout_EAX_02; g_graphicsManager_blendMode[1] = extraout_EAX_02[1]; g_graphicsManager_blendMode[2] = extraout_EAX_02[2]; g_graphicsManager_blendMode[3] = extraout_EAX_02[3]; g_graphicsManager_blendMode[4] = extraout_EAX_02[4]; local_e8._red = (float)pGVar32 * 0.85; local_e8._green = (float)pGVar32 * 0.9; local_e8._unk = 0; local_e8._blue = (float)pGVar32; local_e8._alpha = (float)pGVar32; render_color_quad_list(); } g_graphicsManager_blendMode[0] = local_1b8._24_4_; g_graphicsManager_blendMode[1] = (int)fStack_19c; g_graphicsManager_blendMode[2] = (int)fStack_198; g_graphicsManager_blendMode[3] = (int)fStack_194; g_graphicsManager_blendMode[4] = (int)VStack_c4.y; room = (Room *)local_200; } } if (((Game *)room)->_roomList[0x28].Flags == 0x39) { render_beast_arena_background(); } FXLayers::Render(); cVar14 = FUN_008242f0(); if (cVar14 != '\0') { local_1f8.y = (float)g_graphicsManager_blendMode[4]; local_e8._red = (float)g_graphicsManager_blendMode[0]; local_e8._green = (float)g_graphicsManager_blendMode[1]; local_e8._blue = (float)g_graphicsManager_blendMode[2]; local_e8._alpha = (float)g_graphicsManager_blendMode[3]; BlendMode::SetMode(local_1b8 + 0x18,2,unusedArg_04); g_graphicsManager_blendMode[0] = *extraout_EAX_03; g_graphicsManager_blendMode[1] = extraout_EAX_03[1]; g_graphicsManager_blendMode[2] = extraout_EAX_03[2]; g_graphicsManager_blendMode[3] = extraout_EAX_03[3]; g_graphicsManager_blendMode[4] = extraout_EAX_03[4]; pcVar5 = *(code **)(*DAT_00c79824 + 0x1c); KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_08); (*pcVar5)(); g_graphicsManager_blendMode[0] = (int)local_e8._red; g_graphicsManager_blendMode[1] = (int)local_e8._green; g_graphicsManager_blendMode[2] = (int)local_e8._blue; g_graphicsManager_blendMode[3] = (int)local_e8._alpha; g_graphicsManager_blendMode[4] = (int)local_1f8.y; room = (Room *)local_200; } if (((g_manager->_optionsConfig)._enableShockwave != 0) && ((*(int *)&((Game *)room)->_roomList[0x9c].field_0xa4 < *(int *)&((Game *)room)->_roomList[0x9c].field_0xa8 || (((Game *)room)->_roomList[0x9d].ListIndex < ((Game *)room)->_roomList[0x9d].Dimension)))) { _glfw_context_reset(); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); BlendMode::SetMode(local_1b8 + 0x18,1,unusedArg_05); pGVar32 = (Game *)&((Game *)room)->_roomList[0x18].DeliriumDistance; g_graphicsManager_blendMode[0] = *extraout_EAX_04; g_graphicsManager_blendMode[1] = extraout_EAX_04[1]; g_graphicsManager_blendMode[2] = extraout_EAX_04[2]; g_graphicsManager_blendMode[3] = extraout_EAX_04[3]; g_graphicsManager_blendMode[4] = extraout_EAX_04[4]; if (((Game *)room)->_roomList[0x28].Flags == 0x1c) { local_1b8._24_4_ = 0.2784314; fStack_19c = 0.18039216; fStack_198 = 0.101960786; fStack_194 = 1.0; local_1f8.x = ((float)((Game *)room)->_curses - 2.0) * 26.0; local_190 = 0.0; local_bc._12_4_ = (g_game->_screenShakeOffset).x + ((Vector *)&((Game *)room)->_roomList[0x18].field_0xa8)->x + ((Vector *)pGVar32)->x + 52.0; local_ac = (Game *)((g_game->_screenShakeOffset).y + *(float *)&((Game *)room)->_roomList[0x18].ShopItemIdx + (float)((Game *)room)->_roomList[0x18].Group + 52.0); local_1f8.y = ((float)*(int *)&((Game *)room)->field_0x10 - 2.0) * 26.0; render_quad_set_rect (screenQuad,(Vector *)(local_bc + 0xc),&local_1f8,(KColor *)(local_1b8 + 0x18)); pvVar17 = (void *)0x811600; render_color_shader_pass(screenQuad); if ((g_manager->_optionsConfig)._enableLighting != 0) { if (g_game->_darknessModifier <= 0.0) { Seeds::GetForcedCurses(); Seeds::GetPreventedCurses(); } local_ac = (Game *)g_graphicsManager_blendMode[4]; local_e8._red = (float)g_graphicsManager_blendMode[0]; local_e8._green = (float)g_graphicsManager_blendMode[1]; local_e8._blue = (float)g_graphicsManager_blendMode[2]; local_e8._alpha = (float)g_graphicsManager_blendMode[3]; g_graphicsManager_blendMode[4] = 7; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 4; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 8; local_1f8.y = GetLightingAlpha(room); pvVar37 = (void *)0x81167b; Color::Color((Color *)local_1b8); KAGE::SmartPointer::operator_assign(auStack_2d2 + -10,&DAT_00c797cc); apply_sprite_shader_params(color_03,1,pvVar17,pvVar37); VStack_c4.y = 0.0; local_d0 = (Game *)local_1f8.y; pGStack_cc = (Game *)local_1f8.y; pGStack_c8 = (Game *)local_1f8.y; VStack_c4.x = local_1f8.y; pcVar5 = *(code **)(*DAT_00c797cc + 0x1c); KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_09); (*pcVar5)(); g_graphicsManager_blendMode[1] = (int)local_e8._green; g_graphicsManager_blendMode[0] = (int)local_e8._red; g_graphicsManager_blendMode[2] = (int)local_e8._blue; g_graphicsManager_blendMode[3] = (int)local_e8._alpha; g_graphicsManager_blendMode[4] = (int)local_ac; pGVar32 = local_204; room = (Room *)local_200; } } if ((*(byte *)((int)room->_descriptor + 0x44) & 1) == 0) { local_1d4 = (Game *)&room->field_0x70d8; local_204 = (Game *)0x2; do { local_1f8.y = *(float *)local_1d4; local_ac = *(Game **)((int)local_1d4 + 4); if (((int)local_1f8.y < (int)local_ac) && ((room->_backdropType == 0x12 || (room->_backdropType == 0x1c)))) { pvVar17 = ANM2::GetAnimationData((ANM2 *)&room->field_0x7100,s_Idle); local_1f8.y = (float)(int)((float)*(int *)((int)pvVar17 + 0x30) * ((float)(int)local_1f8.y / (float)(int)local_ac)); bVar13 = ANM2::SetAnimation((ANM2 *)&room->field_0x7100,s_Idle,1); if ((bVar13 != 0) && ((*(int *)&room->field_0x7134 != 0 && (AnimationState::SetFrameFloat ((AnimationState *)&room->field_0x7130,(float)(int)local_1f8.y), *(int *)&room->field_0x7134 != 0)))) { room->field_0x7144 = 0; } local_ac = (Game *)((*(float *)((int)local_1d4 + -0x10) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5); local_1f0 = (Game *)(g_displayPixelRatio * g_screenPointScale); local_1f8.y = (float)local_1f0 * ((*(float *)((int)local_1d4 + -0x14) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) + 0.5; dVar35 = floor((double)local_1f8.y); VStack_c4.y = (float)dVar35 / (float)local_1f0; local_1f8.y = (float)local_1f0 * (float)local_ac + 0.5; dVar35 = floor((double)local_1f8.y); local_21c.x = VStack_c4.y + (float)pGVar32->_stage; local_21c.y = (float)dVar35 / (float)local_1f0 + (float)pGVar32->_stageType; local_1f8.y = (float)(float)dVar35; ANM2::Render((ANM2 *)&room->field_0x7100,&local_21c,&g_vectorZero,&g_vectorZero); } local_1d4 = (Game *)((int)local_1d4 + 0x1c); local_204 = (Game *)((int)local_204 + -1); } while (local_204 != (Game *)0x0); } shaderColor._colorize[2] = 0.0; shaderColor._tint[2] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._tint[3] = 0.0; shaderColor._offset[0] = 1.0; shaderColor._colorize[0] = 1.0; shaderColor._offset[1] = 1.0; shaderColor._colorize[3] = 1.0; shaderColor._offset[2]._0_1_ = 0; KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); pGVar32 = (Game *)0x0; render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_10); local_204 = (Game *)0xc3160000; puVar23 = &DAT_00c79488; if ((DAT_00c7948c & 1) == 0) { puVar23 = g_currentShader; } local_1d4 = *(Game **)&room->field_0x70cc; local_1f8.y = *(float *)&room->field_0x70d8; local_1f0 = *(Game **)&room->field_0x70e8; g_currentShader = puVar23; local_200 = local_204; local_1e4 = pGVar32; local_1e0 = pGVar32; fVar34 = pow((float)(int)local_1f8.y / (float)*(int *)&room->field_0x70dc,0.4); iVar26 = *(int *)&room->field_0x70f4; local_ac = (Game *)((1.0 - fVar34) * *(float *)&room->field_0x70d0); fVar34 = pow((float)iVar26 / (float)*(int *)&room->field_0x70f8,0.4); VStack_c4.y = (1.0 - fVar34) * *(float *)&room->field_0x70ec; local_21c.y = 0.66015625 / ((g_screenPointScale * 520.0) / (float)((double)DAT_00c797d4[6] + __uint_to_double_fixup[-(DAT_00c797d4[6] >> 0x1f)])); local_224.y = 0.35546875 / ((g_screenPointScale * 280.0) / (float)((double)DAT_00c797d4[7] + __uint_to_double_fixup[-(DAT_00c797d4[7] >> 0x1f)])); if (room->field_0x7220 != '\0') { local_1d4 = (Game *)(*(float *)&room->field_0x70d4 * 0.5 + (float)local_1d4); local_1f0 = (Game *)(*(float *)&room->field_0x70f0 * 0.5 + (float)local_1f0); } piVar20 = DAT_00c797d4; if ((int)local_1f8.y < *(int *)&room->field_0x70dc) { KAGE::SmartPointer::operator_assign(auStack_2d2 + -10,&DAT_00c797d4); puVar16 = (undefined4 *)compute_overlay_texcoords(room,&local_1f8,&room->field_0x70c4); iVar26 = *(int *)&room->field_0x70f4; local_204 = (Game *)*puVar16; local_1e0 = (Game *)puVar16[1]; piVar20 = extraout_ECX; } if (iVar26 < *(int *)&room->field_0x70f8) { KAGE::SmartPointer::operator_assign(auStack_2d2 + -10,&DAT_00c797d4); puVar16 = (undefined4 *)compute_overlay_texcoords(room,&local_1f8,&room->field_0x70e0); local_200 = (Game *)*puVar16; local_1e4 = (Game *)puVar16[1]; piVar20 = extraout_ECX_00; } local_e8._green = (float)local_204; local_e8._blue = (float)local_1e0; local_e8._unk = (int)local_ac; local_bc._4_4_ = local_200; local_bc._8_4_ = local_1e4; local_ac = (Game *)VStack_c4.y; local_e8._alpha = (float)local_1d4; local_bc._12_4_ = local_1f0; local_1f8.x = local_21c.y; local_1f8.y = local_224.y; Shader::set_uniform(g_currentShader,(byte *)"Shockwave1",0xb,&local_e8._green,(int)piVar20); Shader::set_uniform(g_currentShader,(byte *)"Shockwave2",0xb,local_bc + 4,unused_01); Shader::set_uniform(g_currentShader,(byte *)"Ratio",9,&local_1f8,unused_02); (**(code **)(*DAT_00c797d4 + 0x14))(shaderColor._tint + 2); set_blend_mode(&DAT_00c798e0,1); } if (isDataminer != 0) { DAT_00c7977f = 0; } FXLayers::render_overlay_layers(); local_204 = (Game *)0x258; iVar26 = extraout_ECX_01; if (0.0 < (float)local_20c) { _glfw_context_reset(); pop_render_target(); set_blend_mode(&DAT_00c798e0,1); shaderColor._colorize[2] = 0.0; shaderColor._tint[2] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._tint[3] = 0.0; shaderColor._offset[0] = 1.0; shaderColor._colorize[0] = 1.0; shaderColor._offset[1] = 1.0; shaderColor._colorize[3] = 1.0; shaderColor._offset[2]._0_1_ = 0; KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_11); local_1e0 = (Game *)&DAT_00c795c8; if ((DAT_00c795cc & 1) == 0) { local_1e0 = g_currentShader; } local_224.y = (float)((double)DAT_00c797fc[7] + __uint_to_double_fixup[-(DAT_00c797fc[7] >> 0x1f)]); local_20c = (Game *)((float)((double)DAT_00c797fc[5] + __uint_to_double_fixup[-(DAT_00c797fc[5] >> 0x1f)]) / local_224.y); local_21c.y = (float)((double)DAT_00c797fc[6] + __uint_to_double_fixup[-(DAT_00c797fc[6] >> 0x1f)]); local_214 = (Game *)((float)((double)DAT_00c797fc[4] + __uint_to_double_fixup[-(DAT_00c797fc[4] >> 0x1f)]) / local_21c.y); local_1d4 = (Game *)(local_21c.y / (g_screenPointScale * 1024.0)); local_1f0 = (Game *)(local_224.y / (g_screenPointScale * 1024.0)); local_ac = (Game *)((g_screenHeight - 182.0) * 0.5); local_1e4 = (Game *)(g_displayPixelRatio * g_screenPointScale); local_1f8.y = (((float)((Game *)room)->_roomList[0].GridIndex - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_1e4 + 0.5; g_currentShader = local_1e0; dVar35 = floor((double)local_1f8.y); VStack_c4.y = (float)dVar35; fVar34 = (((float)((Game *)room)->_roomList[0].SafeGridIndex - 140.0) * 0.65 + (float)local_ac) * (float)local_1e4 + 0.5; local_1f8.y = fVar34; dVar35 = floor((double)fVar34); local_1f8.y = (float)dVar35; local_bc._12_4_ = local_214; local_e8._alpha = (((g_game->_screenShakeOffset).x + ((Vector *)&((Game *)room)->_roomList[0x18].DeliriumDistance)->x + VStack_c4.y / (float)local_1e4) * g_screenPointScale) / local_21c.y; local_ac = local_20c; local_e8._unk = (int)((((float)((Game *)room)->_roomList[0x18].Group + (g_game->_screenShakeOffset).y + (float)dVar35 / (float)local_1e4) * g_screenPointScale) / local_224.y); local_e8._green = (float)local_1d4; local_e8._blue = (float)local_1f0; bVar13 = Game::IsPaused(g_game); if (bVar13 == 0) { uVar15 = g_manager->_framecount + 1U & 0x80000001; if ((int)uVar15 < 0) { uVar15 = (uVar15 - 1 | 0xfffffffe) + 1; } } else { uVar15 = 0; } local_1f8.y = (float)((float)(int)(uVar15 + (g_game->_frameCount % (int)local_204) * 2) / 120.0) ; Shader::set_uniform(local_1e0,(byte *)"TextureSize",9,local_bc + 0xc,uVar15); Shader::set_uniform(g_currentShader,(byte *)"Ratio",0xb,&local_e8._green,unused_03); Shader::set_uniform(g_currentShader,&DAT_00b6837c,8,&local_1f8.y,unused_04); Shader::set_uniform(g_currentShader,(byte *)"Amount",8,&local_210,unused_05); (**(code **)(*DAT_00c797fc + 0x14))(shaderColor._tint + 2); iVar26 = extraout_ECX_02; } if (isMineshaftDimension != '\0') { _glfw_context_reset(); pop_render_target(); set_blend_mode(&DAT_00c798e0,1); shaderColor._colorize[2] = 1.0; shaderColor._tint[2] = 1.0; shaderColor._colorize[1] = 0.0; shaderColor._tint[3] = 0.0; shaderColor._offset[0] = 0.0; shaderColor._colorize[0] = 0.0; shaderColor._offset[1] = 1.0; shaderColor._colorize[3] = 1.0; shaderColor._offset[2]._0_1_ = 0; KColor::SetFromARGB((KColor *)(local_1b8 + 0x18),0xffffffff); pvVar17 = (void *)g_screenHeight; render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_12); if ((g_manager->_optionsConfig)._getsSetToEnableWaterSurface == 0) { puVar23 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar23 = g_currentShader; } pvVar37 = (void *)0x8125f0; g_currentShader = puVar23; Color::Color((Color *)local_1b8); KAGE::SmartPointer::operator_assign(auStack_2d2 + -10,&DAT_00c79854); apply_sprite_shader_params(color_04,1,pvVar17,pvVar37); } else { local_1f0 = (Game *)&DAT_00c79668; if ((DAT_00c7966c & 1) == 0) { local_1f0 = g_currentShader; } local_224.y = (float)((double)DAT_00c79854[7] + __uint_to_double_fixup[-(DAT_00c79854[7] >> 0x1f)]); local_1e4 = (Game *)((float)((double)DAT_00c79854[5] + __uint_to_double_fixup[-(DAT_00c79854[5] >> 0x1f)]) / local_224.y) ; local_21c.y = (float)((double)DAT_00c79854[6] + __uint_to_double_fixup[-(DAT_00c79854[6] >> 0x1f)]); local_214 = (Game *)((float)((double)DAT_00c79854[4] + __uint_to_double_fixup[-(DAT_00c79854[4] >> 0x1f)]) / local_21c.y) ; local_20c = (Game *)(local_21c.y / (g_screenPointScale * 1024.0)); local_1d4 = (Game *)(local_224.y / (g_screenPointScale * 1024.0)); local_210 = (Game *)(g_displayPixelRatio * g_screenPointScale); local_ac = (Game *)((g_screenHeight - 182.0) * 0.5); local_1f8.y = (((float)((Game *)room)->_roomList[0].GridIndex - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_210 + 0.5; g_currentShader = local_1f0; dVar35 = floor((double)local_1f8.y); VStack_c4.y = (float)dVar35; fVar34 = (((float)((Game *)room)->_roomList[0].SafeGridIndex - 140.0) * 0.65 + (float)local_ac ) * (float)local_210 + 0.5; local_1f8.y = fVar34; dVar35 = floor((double)fVar34); local_1f8.y = (float)dVar35; local_bc._12_4_ = local_214; local_e8._alpha = (((g_game->_screenShakeOffset).x + ((Vector *)&((Game *)room)->_roomList[0x18].DeliriumDistance)->x + VStack_c4.y / (float)local_210) * g_screenPointScale) / local_21c.y; local_ac = local_1e4; local_e8._unk = (int)((((float)((Game *)room)->_roomList[0x18].Group + (g_game->_screenShakeOffset).y + (float)dVar35 / (float)local_210) * g_screenPointScale) / local_224.y); local_e8._green = (float)local_20c; local_e8._blue = (float)local_1d4; bVar13 = Game::IsPaused(g_game); if (bVar13 == 0) { uVar15 = g_manager->_framecount + 1U & 0x80000001; if ((int)uVar15 < 0) { uVar15 = (uVar15 - 1 | 0xfffffffe) + 1; } } else { uVar15 = 0; } local_1f8.y = (float)((float)(int)(uVar15 + (g_game->_frameCount % 600) * 2) / 120.0); Shader::set_uniform(local_1f0,(byte *)"TextureSize",9,local_bc + 0xc,uVar15); Shader::set_uniform(g_currentShader,(byte *)"Ratio",0xb,&local_e8._green,unused_06); Shader::set_uniform(g_currentShader,&DAT_00b6837c,8,&local_1f8.y,unused_07); } (**(code **)(*DAT_00c79854 + 0x14))(shaderColor._tint + 2); iVar26 = extraout_ECX_03; } DAT_00c79a4c = 0.0; shader_cache_find(iVar26); if (((uint)g_game->_debugFlags >> 4 & 1) != 0) { roomTypeNames = &DAT_00b6c690; local_15c = "Default"; local_158 = &DAT_00b6c688; local_154 = "Error"; local_150 = "Treasure"; local_14c = &DAT_00b6c734; local_148 = "Miniboss"; local_144 = "Secret"; local_140 = "SSecret"; local_13c = "Arcade"; local_138 = "Curse"; local_134 = "Ambush"; local_130 = "Library"; local_12c = "Sacrifice"; local_128 = "Devil"; local_124 = "Angel"; local_120 = "Dungeon"; local_11c = "Bossrush"; local_118 = "Isaac"; local_114 = "Barren"; local_110 = "Chest"; local_10c = &DAT_00b6c74c; local_108 = "Market"; local_104 = &DAT_00b6c75c; local_100 = "Planetarium"; local_fc = "TeleEntrance"; local_f8 = "TeleExit"; local_f4 = "SecretExit"; local_f0 = &DAT_00b634c0; local_ec = "USecret"; RoomConfigStage::GetDisplayName ((RoomConfig_Stage *) (g_game->_ventricleRazorPortals + **(int **)((int)((Game *)room)->_stageType + 0x10) * 0xc4 + 0x598),&stageName,0); local_14 = 0; local_1f8.y = *(float *)((int)((Game *)room)->_stageType + 0xb4); sprintf_s(debugText,0x80,(byte *)"%s %s %d %s (group %d)"); Font::get_string_width_n(&g_manager->_font5_terminus8,debugText,-1); local_1b8._16_4_ = 0.0; local_1b8._20_4_ = 9.18341e-41; local_1b8._24_4_ = 0.0; fStack_19c = 1.0; fStack_198 = -NAN; fStack_194 = 0.0; local_190 = 0.0; local_14 = CONCAT31(local_14._1_3_,1); Font::DrawString(debugText); std::string::_Tidy_deallocate(stageName._buf); } ExceptionList = local_1c; return; } //@@ 008128f0 Room::render_debug_grid_values /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Room::Render; sprintf_s of per-cell +0x76c value for every grid cell, drawn with font FUN_00a1bb10/FUN_00a1bd80 */ void __thiscall Room::render_debug_grid_values(Room *this,float *param_2) { KColor color; Manager *pMVar1; void *glyphs; int iVar2; int iVar3; double dVar4; float local_100 [28]; undefined1 local_90 [16]; undefined4 local_80; undefined4 local_7c; KColor local_78; float local_64; float local_60; float local_5c; byte local_58 [64]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b01598; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_58 + 0x54); ExceptionList = &local_10; iVar3 = 0; iVar2 = this->_gridWidth; if (0 < this->_gridHeight * iVar2) { do { local_8 = 0xffffffff; local_60 = g_displayPixelRatio * g_screenPointScale; local_64 = (((float)(iVar3 / iVar2) * 40.0 + 120.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_5c = ((((float)(iVar3 % iVar2) * 40.0 + 40.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_60 + 0.5; dVar4 = floor((double)local_5c); local_5c = (float)dVar4 / local_60; local_64 = local_64 * local_60 + 0.5; dVar4 = floor((double)local_64); local_64 = (float)dVar4; local_78._unk = 0; local_60 = local_64 / local_60 + param_2[1]; local_5c = local_5c + *param_2; local_78._red = 1.0; local_78._green = 1.0; local_78._blue = 0.0; local_78._alpha = 0.2; render_quad_set_uniform_color (local_100,local_5c - 13.0,local_60 - 13.0,local_5c + 13.0,local_60 + 13.0,&local_78 ); render_quad_draw_color_shader(local_100,1.0); sprintf_s(local_58,0x40,s__d); pMVar1 = g_manager; local_80 = 0; local_7c = 0xffff; local_78._red = 0.0; local_78._green = 1.0; local_78._blue = -NAN; local_78._alpha = 0.0; local_78._unk = 0; local_8 = 0; local_5c = local_5c - 12.0; local_60 = local_60 - 10.0; glyphs = Font::measure_string (&g_manager->_font6_PFTempestaSevenCondensed,local_90,local_58,&local_80, &g_vectorOne); local_8 = CONCAT31(local_8._1_3_,1); color._alpha = 0.2; color._red = 1.0; color._green = 1.0; color._blue = 0.0; color._unk = 0; Font::render_glyph_quads (&pMVar1->_font6_PFTempestaSevenCondensed,glyphs,local_5c,local_60,1.0,1.0,color, &local_80); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); iVar3 = iVar3 + 1; iVar2 = this->_gridWidth; } while (iVar3 < this->_gridHeight * iVar2); } ExceptionList = local_10; return; } //@@ 00812c10 Room::GetGridPathFromPos /* ZHL [lua] Lua binding Room:GetGridPathFromPos prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall Room::GetGridPathFromPos(Room *this,Vector *position) { uint uVar1; int iVar2; int iVar3; iVar3 = (int)((position->x - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar2 = (int)((position->y - 120.0) / 40.0 + 0.5), iVar2 < 0)) || ((this->_gridHeight <= iVar2 || (uVar1 = this->_gridWidth * iVar2 + iVar3, 0x1bf < uVar1)))) { return 0; } return this->_gridPaths[uVar1]; } //@@ 00812c90 Room::GetGridIndex /* ZHL [lua] Lua binding Room:GetGridIndex prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall Room::GetGridIndex(Room *this,Vector *pos) { int iVar1; int iVar2; iVar2 = (int)((pos->x - 40.0) / 40.0 + 0.5); if ((((iVar2 < 0) || (this->_gridWidth <= iVar2)) || (iVar1 = (int)((pos->y - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (this->_gridHeight <= iVar1)) { return -1; } return this->_gridWidth * iVar1 + iVar2; } //@@ 00812d00 Room::GetCenterPos /* ZHL [lua] Lua binding Room:GetCenterPos prototype: db/protos.zhl, confirmed by RET 4 */ Vector * Room::GetCenterPos(Vector *outPos) { void *pvVar1; int iVar2; uint uVar3; pvVar1 = g_game->_room; if ((*(int *)((int)pvVar1 + 4) == 0) || (iVar2 = *(int *)(*(int *)((int)pvVar1 + 4) + 0x10), iVar2 == 0)) { switchD_00812d27_default: outPos->x = (*(float *)((int)pvVar1 + 0x1c) - *(float *)((int)pvVar1 + 0x14)) * 0.5 + *(float *)((int)pvVar1 + 0x14); outPos->y = (*(float *)((int)pvVar1 + 0x20) - *(float *)((int)pvVar1 + 0x18)) * 0.5 + *(float *)((int)pvVar1 + 0x18); return outPos; } switch(*(undefined4 *)(iVar2 + 0x48)) { case 9: uVar3 = 0x148; break; case 10: uVar3 = 0x13b; break; case 0xb: uVar3 = 0x84; break; case 0xc: uVar3 = 0x77; break; default: goto switchD_00812d27_default; } iVar2 = *(int *)((int)pvVar1 + 0xc); outPos->x = (float)(int)((longlong)(ulonglong)uVar3 % (longlong)iVar2) * 40.0 + 40.0; outPos->y = (float)(int)((longlong)(ulonglong)uVar3 / (longlong)iVar2) * 40.0 + 120.0; return outPos; } //@@ 00812de0 Room::GetClampedGridIndex /* ZHL [lua] Lua binding Room:GetClampedGridIndex */ int __thiscall Room::GetClampedGridIndex(Room *this,float *param_2) { int iVar1; int iVar2; int iVar3; int iVar4; iVar2 = (int)((*param_2 - 40.0) / 40.0 + 0.5); iVar3 = 0; if (0 < iVar2) { iVar3 = iVar2; } iVar2 = this->_gridHeight + -1; iVar4 = (int)((param_2[1] - 120.0) / 40.0 + 0.5); iVar1 = 0; if (0 < iVar4) { iVar1 = iVar4; } if (iVar1 < iVar2) { iVar2 = iVar1; } iVar1 = this->_gridWidth + -1; if (iVar3 < iVar1) { iVar1 = iVar3; } return iVar2 * this->_gridWidth + iVar1; } //@@ 00812e60 Room::GetGridIndexByTile /* ZHL [exact] __thiscall int Room::GetGridIndexByTile(int GridRow, int GridColumn); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall Room::GetGridIndexByTile(Room *this,int GridRow,int GridColumn) { if ((((GridRow < 0) || (this->_gridWidth <= GridRow)) || (GridColumn < 0)) || (this->_gridHeight <= GridColumn)) { return -1; } return this->_gridWidth * GridColumn + GridRow; } //@@ 00812ea0 FUN_00812ea0 void FUN_00812ea0(float *param_1,int *param_2,int *param_3) { *param_2 = (int)((*param_1 - 40.0) / 40.0 + 0.5); *param_3 = (int)((param_1[1] - 120.0) / 40.0 + 0.5); return; } //@@ 00812f00 Room::GetGridPosition /* ZHL [lua] Lua binding Room:GetGridPosition prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Room::GetGridPosition(Room *this,Vector *outPos,int gridIndex) { int iVar1; iVar1 = this->_gridWidth; outPos->x = (float)(gridIndex % iVar1) * 40.0 + 40.0; outPos->y = (float)(gridIndex / iVar1) * 40.0 + 120.0; return outPos; } //@@ 00812f50 Room::GetClampedPositionImpl /* DB: only callee GetLRoomAreaDesc; clamps vec to room bounds, wrapped by Room::GetClampedPosition prototype: db/protos.zhl, confirmed by RET 20 */ Vector * __thiscall Room::GetClampedPositionImpl (Room *this,Vector *outPosition,Vector *position,float marginTop,float marginRight, float marginBottom,float marginLeft) { int iVar1; float fVar2; float fVar3; float fVar4; float minX; float notchY; float lAreaDesc [2]; float local_20; float local_1c; float local_18; float local_14; float local_10; if ((this->_descriptor == (void *)0x0) || (iVar1 = *(int *)((int)this->_descriptor + 0x10), iVar1 == 0)) { fVar4 = position->y; outPosition->x = position->x; outPosition->y = fVar4; return outPosition; } if (3 < *(int *)(iVar1 + 0x48) - 9U) { fVar3 = marginLeft + (this->_topLeftPos).x; fVar4 = position->x; if (position->x <= fVar3) { fVar4 = fVar3; } fVar3 = (this->_bottomRightPos).x - marginRight; if (fVar3 <= fVar4) { fVar4 = fVar3; } fVar3 = marginTop + (this->_topLeftPos).y; outPosition->x = fVar4; fVar4 = position->y; if (position->y <= fVar3) { fVar4 = fVar3; } fVar3 = (this->_bottomRightPos).y - marginBottom; if (fVar3 <= fVar4) { fVar4 = fVar3; } outPosition->y = fVar4; return outPosition; } fVar4 = position->x; fVar3 = position->y; GetLRoomAreaDesc(this,lAreaDesc); lAreaDesc[0] = lAreaDesc[0] - -marginLeft; local_20 = -marginRight + local_20; local_10 = -marginRight + local_10; local_18 = local_18 - -marginLeft; notchY = local_14 - -marginTop; if (local_10 - local_18 <= local_20 - lAreaDesc[0]) { notchY = -marginBottom + local_1c; } minX = marginLeft + (this->_topLeftPos).x; fVar2 = (this->_bottomRightPos).x - marginRight; if (fVar4 <= minX) { fVar4 = minX; } if (fVar2 <= fVar4) { fVar4 = fVar2; } fVar2 = marginTop + (this->_topLeftPos).y; iVar1 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48); if (fVar3 <= fVar2) { fVar3 = fVar2; } fVar2 = (this->_bottomRightPos).y - marginBottom; if (fVar2 <= fVar3) { fVar3 = fVar2; } if (iVar1 == 9) { if ((lAreaDesc[0] <= fVar4) || (notchY <= fVar3)) goto LAB_00813155; if (lAreaDesc[0] - fVar4 < notchY - fVar3) { outPosition->x = lAreaDesc[0]; outPosition->y = fVar3; return outPosition; } } else if (iVar1 == 10) { if ((fVar4 <= local_20) || (notchY <= fVar3)) goto LAB_00813155; if (fVar4 - local_20 < notchY - fVar3) { outPosition->x = local_20; outPosition->y = fVar3; return outPosition; } } else { if (iVar1 == 0xb) { if ((local_18 <= fVar4) || (fVar3 <= notchY)) goto LAB_00813155; fVar2 = local_18 - fVar4; local_10 = local_18; } else { if (((iVar1 != 0xc) || (fVar4 <= local_10)) || (fVar3 <= notchY)) goto LAB_00813155; fVar2 = fVar4 - local_10; } if (fVar2 < fVar3 - notchY) { outPosition->x = local_10; outPosition->y = fVar3; return outPosition; } } fVar3 = notchY; LAB_00813155: outPosition->x = fVar4; outPosition->y = fVar3; return outPosition; } //@@ 008131e0 Room::ScreenWrapPositionImpl /* DB: Room::GetClampedPositionImpl(out,pos,margins...); if pos is inside returns it, else moves it across to the opposite wall along the axis with the larger overshoot using the room bounds at ECX+0x14..0x20; called by Room::ScreenWrapPosition (Lua wrapper) and Entity_Laser::UpdateHits/update_laser prototype: db/protos.zhl, confirmed by RET 20 */ Vector * __thiscall Room::ScreenWrapPositionImpl (Room *this,Vector *outPosition,Vector *position,float marginTop,float marginRight, float marginBottom,float marginLeft) { float fVar1; bool bVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; Vector local_10; GetClampedPositionImpl(this,&local_10,position,marginTop,marginRight,marginBottom,marginLeft); fVar1 = position->x; if ((local_10.x == fVar1) && (local_10.y == position->y)) { fVar1 = position->y; outPosition->x = position->x; outPosition->y = fVar1; return outPosition; } fVar4 = position->y; fVar5 = local_10.y - position->y; if ((fVar5 == 0.0) || ((bVar2 = false, local_10.x - fVar1 != 0.0 && (ABS(local_10.x - fVar1) < ABS(fVar5))))) { bVar2 = true; } fVar6 = marginLeft + (this->_topLeftPos).x; fVar7 = marginTop + (this->_topLeftPos).y; fVar5 = (this->_bottomRightPos).x - marginRight; fVar3 = (this->_bottomRightPos).y - marginBottom; if (bVar2) { if (fVar1 < local_10.x) { outPosition->y = fVar4; outPosition->x = fVar1 + (fVar5 - fVar6); return outPosition; } if (local_10.x < fVar1) { outPosition->y = fVar4; outPosition->x = fVar1 - (fVar5 - fVar6); return outPosition; } } else { if (fVar4 < local_10.y) { outPosition->x = fVar1; outPosition->y = fVar4 + (fVar3 - fVar7); return outPosition; } if (local_10.y < fVar4) { fVar4 = fVar4 - (fVar3 - fVar7); } } outPosition->x = fVar1; outPosition->y = fVar4; return outPosition; } //@@ 00813360 Room::IsPositionInRoom /* ZHL [lua] Lua binding Room:IsPositionInRoom prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::IsPositionInRoom(Room *this,Vector *position,float margin) { Vector local_10; if (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48) - 9U < 4) { GetClampedPositionImpl(this,&local_10,position,margin,margin,margin,margin); if ((local_10.x == position->x) && (local_10.y == position->y)) { return 1; } } else if ((((margin + (this->_topLeftPos).x <= position->x) && (position->x <= (this->_bottomRightPos).x - margin)) && (margin + (this->_topLeftPos).y <= position->y)) && (position->y <= (this->_bottomRightPos).y - margin)) { return 1; } return 0; } //@@ 00813420 FUN_00813420 undefined4 FUN_00813420(int param_1,int param_2) { int in_ECX; if ((((param_1 < 0) || (*(int *)(in_ECX + 0xc) <= param_1)) || (param_2 < 0)) || ((*(int *)(in_ECX + 0x10) <= param_2 || (param_1 = *(int *)(in_ECX + 0xc) * param_2 + param_1, param_1 < 0)))) { return 0; } return *(undefined4 *)(in_ECX + 0x24 + param_1 * 4); } //@@ 00813460 Room::get_random_pickup_position /* DB: ? random point in rect +0x14..0x20 then FindFreePickupSpawnPosition prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Room::get_random_pickup_position (Room *this,Vector *outPosition,byte isAvoidActiveEntities,byte isAllowPits) { float fVar1; uint uVar2; float fVar3; Vector local_10; local_10.x = (this->_bottomRightPos).x - (this->_topLeftPos).x; fVar3 = (this->_bottomRightPos).y - (this->_topLeftPos).y; uVar2 = Random(); fVar1 = fVar3; if (fVar3 <= local_10.x) { fVar1 = local_10.x; } local_10.y = fVar3 * 0.5 + (this->_topLeftPos).y; local_10.x = local_10.x * 0.5 + (this->_topLeftPos).x; FindFreePickupSpawnPosition (this,outPosition,&local_10, (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * fVar1,isAvoidActiveEntities,isAllowPits,0); return outPosition; } //@@ 00813520 Room::FindFreePickupSpawnPosition /* ZHL [lua] Lua binding Room:FindFreePickupSpawnPosition prototype: db/protos.zhl, confirmed by RET 24 */ Vector * __thiscall Room::FindFreePickupSpawnPosition (Room *this,Vector *outPos,Vector *pos,float initialStep,byte isAvoidActiveEntities, byte isAllowPits,byte isAvoidDoors) { code *pcVar1; uint gridCollision; void *pvVar2; Vector *retryPos; int iVar3; void **roomPtr; int iVar4; int iVar5; int *entityIter; float fVar6; float dist; float fVar7; Vector clampedPos; Vector candidatePos; undefined4 rngShift3; Room *savedThis; uint rngSeed; int attemptsLeft; float local_c; float candidateX; int entityType; attemptsLeft = 0x7d; local_c = g_vectorZero.y; iVar4 = -1; candidateX = g_vectorZero.x; rngSeed = 0x441c1dfd; rngShift3 = 0x1d; savedThis = this; do { attemptsLeft = attemptsLeft + -1; gridCollision = GetGridCollision(this,iVar4); iVar5 = 700; if (0x3b < attemptsLeft) { iVar5 = 600; } if (attemptsLeft < 0x28) { iVar5 = 800; } if (attemptsLeft < 0x14) { iVar5 = 900; } if (attemptsLeft < 5) { iVar5 = 1000; } if ((-1 < iVar4) && ((this->_gridPaths[iVar4] < iVar5 || (((isAllowPits != 0 && (gridCollision == 1)) && (this->_gridPaths[iVar4] < iVar5 + 3000))))) ) { if (iVar4 < 0x1c0) { pvVar2 = this->_gridEntities[iVar4]; } else { pvVar2 = (void *)0x0; } if (((gridCollision == 0) || ((isAllowPits != 0 && (gridCollision == 1)))) && ((pvVar2 == (void *)0x0 || (((iVar3 = *(int *)((int)pvVar2 + 4), iVar3 != 0x11 && (iVar3 != 0x12)) && ((iVar3 != 0x14 && (iVar3 != 0x17)))))))) { iVar4 = attemptsLeft; goto LAB_008138a7; } } if (500.0 < initialStep) { initialStep = 0.0; } initialStep = initialStep + 5.0; if (rngSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); retryPos = (Vector *)(*pcVar1)(); return retryPos; } rngSeed = rngSeed >> 1 ^ rngSeed; rngSeed = rngSeed << 9 ^ rngSeed; rngSeed = rngSeed >> ((byte)rngShift3 & 0x1f) ^ rngSeed; local_c = (float)((double)(int)rngSeed + __uint_to_double_fixup[-((int)rngSeed >> 0x1f)]) * 2.3283062e-10 * 360.0 * 0.017453292; fVar6 = cos(local_c); candidateX = fVar6 * initialStep + pos->x; fVar6 = sin(local_c); candidatePos.x = candidateX; candidatePos.y = fVar6 * initialStep + pos->y; local_c = candidatePos.y; GetClampedPositionImpl(this,&clampedPos,&candidatePos,0.0,0.0,0.0,0.0); if ((clampedPos.x == candidateX) && (clampedPos.y == local_c)) { iVar4 = (int)((candidateX - 40.0) / 40.0 + 0.5); if ((iVar4 < 0) || (((this->_gridWidth <= iVar4 || (iVar3 = (int)((local_c - 120.0) / 40.0 + 0.5), iVar3 < 0)) || (this->_gridHeight <= iVar3)))) { iVar4 = -1; } else { iVar4 = this->_gridWidth * iVar3 + iVar4; if ((-1 < iVar4) && (this->_gridPaths[iVar4] < iVar5)) { iVar5 = (this->_entityList)._updateEL._size; fVar7 = (float)(iVar4 % this->_gridWidth) * 40.0 + 40.0; fVar6 = (float)(iVar4 / this->_gridWidth) * 40.0 + 120.0; local_c = fVar6; candidateX = fVar7; if (iVar5 != 0) { entityIter = (savedThis->_entityList)._updateEL._data; do { iVar3 = *entityIter; entityType = *(int *)(iVar3 + 0x28); if (((((entityType == 5) || (entityType == 4)) || (entityType == 6)) || ((isAvoidActiveEntities != 0 && ((((1 < *(int *)&g_game->_deathmatchManager && (entityType == 1)) || (entityType - 10U < 0x3de)) || (entityType == 1)))))) && (fVar7 = *(float *)(iVar3 + 0x33c) - fVar7, fVar6 = *(float *)(iVar3 + 0x340) - fVar6, dist = sqrtf(fVar6 * fVar6 + fVar7 * fVar7), fVar6 = local_c, fVar7 = candidateX, dist < 20.0)) { iVar4 = -1; } entityIter = entityIter + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); } this = savedThis; } } } } while (0 < attemptsLeft); iVar4 = attemptsLeft + -1; LAB_008138a7: outPos->x = candidateX; outPos->y = local_c; if (iVar4 < 1) { GetClampedPositionImpl(this,&clampedPos,pos,20.0,20.0,20.0,20.0); iVar4 = (int)((clampedPos.x - 40.0) / 40.0 + 0.5); iVar5 = (int)((clampedPos.y - 120.0) / 40.0 + 0.5); if (((iVar4 < 0) || (iVar3 = this->_gridWidth, iVar3 <= iVar4)) || ((iVar5 < 0 || (this->_gridHeight <= iVar5)))) { iVar3 = this->_gridWidth; iVar4 = -1; } else { iVar4 = iVar3 * iVar5 + iVar4; } outPos->x = (float)(iVar4 % iVar3) * 40.0 + 40.0; outPos->y = (float)(iVar4 / iVar3) * 40.0 + 120.0; } if (isAvoidDoors == 0) { return outPos; } roomPtr = &g_game->_room; iVar4 = 0; pvVar2 = *roomPtr; do { iVar5 = *(int *)((int)pvVar2 + iVar4 * 4 + 0x724); if (iVar5 != 0) { iVar5 = *(int *)(iVar5 + 0x24); iVar3 = *(int *)((int)pvVar2 + 0xc); fVar6 = ((float)(iVar5 / iVar3) * 40.0 + 120.0) - outPos->y; fVar7 = ((float)(iVar5 % iVar3) * 40.0 + 40.0) - outPos->x; if (fVar6 * fVar6 + fVar7 * fVar7 < 4900.0) { if (iVar4 < 0) { return outPos; } fVar6 = ((float)(iVar5 / iVar3) * 40.0 + 120.0) - outPos->y; fVar7 = ((float)(iVar5 % iVar3) * 40.0 + 40.0) - outPos->x; fVar6 = fVar6 * fVar6 + fVar7 * fVar7; iVar5 = 0x14; while( true ) { if (4900.0 <= fVar6) { return outPos; } if (iVar5 < 1) break; retryPos = FindFreePickupSpawnPosition(*roomPtr,&clampedPos,outPos,40.0,0,0,0); roomPtr = &g_game->_room; fVar6 = retryPos->x; outPos->x = fVar6; fVar7 = retryPos->y; outPos->y = fVar7; iVar3 = *(int *)(*(int *)((int)pvVar2 + iVar4 * 4 + 0x724) + 0x24); fVar6 = ((float)(iVar3 % *(int *)((int)*roomPtr + 0xc)) * 40.0 + 40.0) - fVar6; fVar7 = ((float)(iVar3 / *(int *)((int)*roomPtr + 0xc)) * 40.0 + 120.0) - fVar7; fVar6 = fVar7 * fVar7 + fVar6 * fVar6; iVar5 = iVar5 + -1; } return outPos; } } iVar4 = iVar4 + 1; } while (iVar4 < 8); return outPos; } //@@ 00813b30 Room::DamageGridWithSource /* ZHL [lua] Lua binding Room:DamageGridWithSource prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Room::DamageGridWithSource(Room *this,int gridIndex,int damage,EntityRef *source) { byte bVar1; if (((uint)gridIndex < 0x1c0) && (this->_gridEntities[gridIndex] != (int *)0x0)) { bVar1 = (**(code **)(*(int *)this->_gridEntities[gridIndex] + 0x10))(damage,source); return bVar1; } return 0; } //@@ 00813b60 Room::DamageGrid /* ZHL [lua] Lua binding Room:DamageGrid */ uint __thiscall Room::DamageGrid(Room *this,uint param_2,undefined4 param_3) { uint uVar1; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; float local_1c; float local_18; float local_14; float local_10; undefined4 local_c; undefined4 local_8; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = 0; local_1c = g_vectorZero.x; local_18 = g_vectorZero.y; local_14 = g_vectorZero.x; local_10 = g_vectorZero.y; local_c = 0; local_8 = 0; if ((param_2 < 0x1c0) && (this->_gridEntities[param_2] != (int *)0x0)) { uVar1 = (**(code **)(*(int *)this->_gridEntities[param_2] + 0x10))(param_3,&local_2c); return uVar1; } return (uint)this & 0xffffff00; } //@@ 00813bf0 Room::DestroyGridWithSource /* ZHL [lua] Lua binding Room:DestroyGridWithSource */ uint __thiscall Room::DestroyGridWithSource (Room *this,uint param_2,undefined4 param_3,char param_4,undefined4 param_5) { int *piVar1; uint uVar2; if ((0x1bf < param_2) || (piVar1 = this->_gridEntities[param_2], piVar1 == (int *)0x0)) { return (uint)this & 0xffffff00; } if ((param_4 != '\0') && (piVar1[1] == 5)) { piVar1[1] = 2; } uVar2 = (**(code **)(*piVar1 + 0x14))(param_3,param_5); return uVar2; } //@@ 00813c40 Room::DestroyGrid /* ZHL [lua] Lua binding Room:DestroyGrid */ uint __thiscall Room::DestroyGrid(Room *this,uint param_2,undefined4 param_3,char param_4) { int *piVar1; uint uVar2; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; if ((0x1bf < param_2) || (piVar1 = this->_gridEntities[param_2], piVar1 == (int *)0x0)) { return (uint)this & 0xffffff00; } if ((param_4 != '\0') && (piVar1[1] == 5)) { piVar1[1] = 2; } uVar2 = (**(code **)(*piVar1 + 0x14))(param_3,&local_30); return uVar2; } //@@ 00813ce0 Room::GetFrameCount /* ZHL [exact] __thiscall int Room::GetFrameCount(); prototype: REPENTOGON, confirmed by RET 0 */ int __thiscall Room::GetFrameCount(Room *this) { if (*(char *)this == '\0') { return -1; } return g_game->_frameCount - this->_enterFrame; } //@@ 00813d00 Room::greed_shop_slot_type /* DB: ? ECX is a seed; seed % 10 -> 3,1,0,4,8,10,5,2,6,11: Room::init_shop_item_slots 00813d90 Greed branch fills the last four shop slots with it */ undefined4 Room::greed_shop_slot_type(void) { uint in_ECX; switch(in_ECX % 10) { case 0: return 3; case 1: return 1; case 2: return 0; case 3: return 4; case 4: return 8; case 5: return 10; case 6: return 5; case 7: return 2; case 8: return 6; case 9: return 0xb; default: return 0xffffffff; } } //@@ 00813d90 Room::init_shop_item_slots /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called by Room::ShopRestockFull on room types 2/0x16: fills RoomDescriptor+0x94..0xa2 int16 shop slot item types (RNG::Shuffle), ShopItemIdx 0xac / ShopItemDiscountIdx 0xae, IsGreedMode prototype: db/protos.zhl */ void __thiscall Room::init_shop_item_slots(Room *this) { code *pcVar1; byte bVar2; undefined2 slotValue; uint uVar3; byte shift2; byte shift3; uint allocSize; int iVar4; int *piVar5; int *piVar6; int slotOffset; uint local_38; RNG shopRng; int *slotTypes; int *slotTypesEnd; int *slotTypesCapacity; int *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *descriptor; int *slotTypesCapacityCopy; local_8 = 0xffffffff; puStack_c = &LAB_00b015f5; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; shopRng._shift1 = 5; shopRng._shift2 = 9; local_38 = *(uint *)((int)this->_descriptor + 0x60); *(undefined8 *)((int)this->_descriptor + 0xa4) = 0; iVar4 = this->_roomType; local_18 = (int *)0x7; shopRng._shift3 = 7; shopRng._seed = local_38; if (((iVar4 == 0xe) || (iVar4 == 0x16)) || (descriptor = this->_descriptor, (*(uint *)((int)descriptor + 0x44) >> 0xb & 1) != 0)) { *(undefined2 *)((int)this->_descriptor + 0x94) = 8; *(undefined2 *)((int)this->_descriptor + 0x96) = 8; *(undefined2 *)((int)this->_descriptor + 0x98) = 8; *(undefined2 *)((int)this->_descriptor + 0x9a) = 8; *(undefined2 *)((int)this->_descriptor + 0x9c) = 8; *(undefined2 *)((int)this->_descriptor + 0x9e) = 8; *(undefined2 *)((int)this->_descriptor + 0xa0) = 8; *(undefined2 *)((int)this->_descriptor + 0xa2) = 8; *(undefined2 *)((int)this->_descriptor + 0xac) = 0; if (local_38 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } shopRng._seed = local_38 >> 5 ^ local_38; shopRng._seed = shopRng._seed << 9 ^ shopRng._seed; shopRng._seed = (uint)shopRng._seed >> 7 ^ shopRng._seed; if (shopRng._seed == ((uint)shopRng._seed / 3) * 3) { LAB_00814851: slotValue = 0xffff; uVar3 = shopRng._seed; } else { if (shopRng._seed == 0) { shopRng._seed = local_38; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } shopRng._seed = (uint)shopRng._seed >> 5 ^ shopRng._seed; shopRng._seed = shopRng._seed << 9 ^ shopRng._seed; uVar3 = (uint)shopRng._seed >> 7 ^ shopRng._seed; slotValue = (undefined2)(uVar3 % 6); } LAB_00814854: *(undefined2 *)((int)this->_descriptor + 0xae) = slotValue; } else { if (iVar4 == 0xf) { slotTypes = (int *)0x0; slotTypesEnd = (int *)0x0; slotTypesCapacity = (int *)0x0; local_8 = 0; local_18 = (int *)0x8; std::vector::_Emplace_reallocate(0,&local_18); local_18 = (int *)0x4; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 4; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x4; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 4; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x3; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 3; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x3; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 3; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x13; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 0x13; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x13; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 0x13; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x14; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 0x14; slotTypesEnd = slotTypesEnd + 1; } piVar6 = slotTypesEnd; piVar5 = slotTypes; RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd); piVar6 = (int *)((int)piVar6 - (int)piVar5 >> 2); iVar4 = 0; local_18 = (int *)&DAT_00000008; if ((int)piVar6 < 8) { local_18 = piVar6; } if (0 < (int)local_18) { slotOffset = 0x94; do { piVar6 = piVar5 + iVar4; iVar4 = iVar4 + 1; *(short *)(slotOffset + (int)this->_descriptor) = (short)*piVar6; slotOffset = slotOffset + 2; } while (iVar4 < (int)local_18); } *(undefined2 *)((int)this->_descriptor + 0x96) = 8; *(undefined2 *)((int)this->_descriptor + 0xac) = 0; if (shopRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = (uint)shopRng._seed >> ((byte)shopRng._shift1 & 0x1f) ^ shopRng._seed; uVar3 = uVar3 << ((byte)shopRng._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)shopRng._shift3 & 0x1f) ^ uVar3; if (uVar3 % 3 == 0) { slotValue = 0xffff; } else { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> ((byte)shopRng._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)shopRng._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)shopRng._shift3 & 0x1f) ^ uVar3; slotValue = (undefined2)(uVar3 % 6); } *(undefined2 *)((int)this->_descriptor + 0xae) = slotValue; if (slotTypes != (int *)0x0) { allocSize = (int)slotTypesCapacity - (int)slotTypes & 0xfffffffc; piVar5 = slotTypes; if (0xfff < allocSize) { piVar5 = (int *)slotTypes[-1]; allocSize = allocSize + 0x23; if (0x1f < (uint)((int)slotTypes + (-4 - (int)piVar5))) goto LAB_00814776; } operator_delete(piVar5,allocSize); } goto LAB_0081485e; } if ((iVar4 == 2) && (*(int *)(*(int *)((int)descriptor + 0x10) + 0x10) - 100U < 0x14)) { slotTypes = (int *)0x0; slotTypesEnd = (int *)0x0; slotTypesCapacity = (int *)0x0; local_8 = 1; local_18 = (int *)0xb; std::vector::_Emplace_reallocate(0,&local_18); local_18 = (int *)0x3; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 3; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x1; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 1; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x6; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 6; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x5; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 5; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x2; if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 2; slotTypesEnd = slotTypesEnd + 1; } slotTypesCapacityCopy = slotTypesCapacity; piVar6 = slotTypesEnd; RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd); piVar5 = slotTypes; *(short *)((int)this->_descriptor + 0x94) = (short)*slotTypes; *(short *)((int)this->_descriptor + 0x96) = (short)slotTypes[1]; *(undefined2 *)((int)this->_descriptor + 0x98) = 8; *(undefined2 *)((int)this->_descriptor + 0x9a) = 9; *(undefined2 *)((int)this->_descriptor + 0x9c) = 10; *slotTypes = 8; slotTypes[1] = 10; RNG::Shuffle(&shopRng,slotTypes,piVar6); *(short *)((int)this->_descriptor + 0x9e) = (short)*piVar5; *(short *)((int)this->_descriptor + 0xa0) = (short)piVar5[1]; *(undefined2 *)((int)this->_descriptor + 0xa2) = 10; *(undefined2 *)((int)this->_descriptor + 0xac) = 0; uVar3 = RNG::RandomInt(&shopRng,3); if (uVar3 == 0) { slotValue = 0xffff; } else { uVar3 = RNG::RandomInt(&shopRng,8); slotValue = (undefined2)uVar3; } uVar3 = (int)slotTypesCapacityCopy - (int)piVar5 & 0xfffffffc; *(undefined2 *)((int)this->_descriptor + 0xae) = slotValue; piVar6 = piVar5; if (0xfff < uVar3) { piVar6 = (int *)piVar5[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)piVar5 + (-4 - (int)piVar6))) goto LAB_00814776; } operator_delete(piVar6,uVar3); uVar3 = shopRng._seed; goto LAB_0081485e; } if (g_game->_currentRoomIdx == -0xd) { slotTypes = (int *)0x0; slotTypesEnd = (int *)0x0; slotTypesCapacity = (int *)0x0; local_8 = 2; local_18 = (int *)0x8; std::vector::_Emplace_reallocate(0,&local_18); uVar3 = RNG::RandomInt(&shopRng,2); local_18 = (int *)(0xd - (uint)(uVar3 != 0)); if (slotTypesEnd == slotTypesCapacity) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = (int)local_18; slotTypesEnd = slotTypesEnd + 1; } piVar6 = slotTypesCapacity; piVar5 = slotTypesEnd; uVar3 = RNG::RandomInt(&shopRng,8); local_18 = (int *)((-(uint)(uVar3 != 0) & 0xfffffffb) + 0xe); if (piVar5 == piVar6) { std::vector::_Emplace_reallocate(piVar5,&local_18); piVar6 = slotTypesCapacity; } else { *piVar5 = (int)local_18; slotTypesEnd = piVar5 + 1; } local_18 = (int *)0xb; if (slotTypesEnd == piVar6) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); piVar6 = slotTypesCapacity; } else { *slotTypesEnd = 0xb; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0xb; if (slotTypesEnd == piVar6) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); piVar6 = slotTypesCapacity; } else { *slotTypesEnd = 0xb; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0xf; if (slotTypesEnd == piVar6) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); piVar6 = slotTypesCapacity; } else { *slotTypesEnd = 0xf; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x6; if (slotTypesEnd == piVar6) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); piVar6 = slotTypesCapacity; } else { *slotTypesEnd = 6; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)0x10; if (slotTypesEnd == piVar6) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); } else { *slotTypesEnd = 0x10; slotTypesEnd = slotTypesEnd + 1; } piVar6 = slotTypesEnd; piVar5 = slotTypes; RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd); piVar6 = (int *)((int)piVar6 - (int)piVar5 >> 2); iVar4 = 0; local_18 = (int *)&DAT_00000008; if ((int)piVar6 < 8) { local_18 = piVar6; } if (0 < (int)local_18) { slotOffset = 0x94; do { piVar6 = piVar5 + iVar4; iVar4 = iVar4 + 1; *(short *)(slotOffset + (int)this->_descriptor) = (short)*piVar6; slotOffset = slotOffset + 2; } while (iVar4 < (int)local_18); } *(undefined2 *)((int)this->_descriptor + 0xac) = 0; if (shopRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } shopRng._seed = (uint)shopRng._seed >> ((byte)shopRng._shift1 & 0x1f) ^ shopRng._seed; shopRng._seed = shopRng._seed << ((byte)shopRng._shift2 & 0x1f) ^ shopRng._seed; shopRng._seed = (uint)shopRng._seed >> ((byte)shopRng._shift3 & 0x1f) ^ shopRng._seed; if ((uint)shopRng._seed % 3 == 0) { slotValue = 0xffff; } else { uVar3 = RNG::RandomInt(&shopRng,8); slotValue = (undefined2)uVar3; } *(undefined2 *)((int)this->_descriptor + 0xae) = slotValue; uVar3 = shopRng._seed; if (slotTypes == (int *)0x0) goto LAB_0081485e; allocSize = (int)slotTypesCapacity - (int)slotTypes & 0xfffffffc; piVar5 = slotTypes; if (0xfff < allocSize) { piVar5 = (int *)slotTypes[-1]; iVar4 = (int)slotTypes - (int)piVar5; joined_r0x00814770: allocSize = allocSize + 0x23; if (0x1f < iVar4 - 4U) { LAB_00814776: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { bVar2 = Game::IsGreedMode(g_game); if ((bVar2 != 0) || (((iVar4 == 2 && (uVar3 = *(uint *)(*(int *)((int)descriptor + 0x10) + 0x10), 99 < uVar3)) && (uVar3 < 0x78)))) { *(undefined2 *)((int)descriptor + 0x94) = 3; *(undefined2 *)((int)this->_descriptor + 0x96) = 0; *(undefined2 *)((int)this->_descriptor + 0x98) = 8; *(undefined2 *)((int)this->_descriptor + 0x9a) = 9; RNG::Next(&shopRng); slotValue = greed_shop_slot_type(); *(undefined2 *)((int)this->_descriptor + 0x9c) = slotValue; RNG::Next(&shopRng); slotValue = greed_shop_slot_type(); *(undefined2 *)((int)this->_descriptor + 0x9e) = slotValue; RNG::Next(&shopRng); slotValue = greed_shop_slot_type(); *(undefined2 *)((int)this->_descriptor + 0xa0) = slotValue; RNG::Next(&shopRng); slotValue = greed_shop_slot_type(); *(undefined2 *)((int)this->_descriptor + 0xa2) = slotValue; *(undefined2 *)((int)this->_descriptor + 0xac) = 0; uVar3 = RNG::RandomInt(&shopRng,3); if (uVar3 == 0) goto LAB_00814851; uVar3 = RNG::RandomInt(&shopRng,8); slotValue = (undefined2)uVar3; uVar3 = shopRng._seed; goto LAB_00814854; } slotTypes = (int *)0x0; piVar5 = (int *)0x0; slotTypesEnd = (int *)0x0; slotTypesCapacity = (int *)0x0; local_8 = 3; local_18 = (int *)0x0; do { if (slotTypesEnd == piVar5) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_18); piVar5 = slotTypesCapacity; } else { *slotTypesEnd = (int)local_18; slotTypesEnd = slotTypesEnd + 1; } local_18 = (int *)((int)local_18 + 1); } while ((int)local_18 < 8); local_18 = piVar5; if (3 < this->_shopLevel) { local_38 = 8; if (slotTypesEnd == piVar5) { std::vector::_Emplace_reallocate(slotTypesEnd,&local_38); local_18 = slotTypesCapacity; } else { *slotTypesEnd = 8; slotTypesEnd = slotTypesEnd + 1; } } piVar6 = slotTypesEnd; piVar5 = slotTypes; RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd); uVar3 = (int)piVar6 - (int)piVar5 >> 2; iVar4 = 0; local_38 = 8; if ((int)uVar3 < 8) { local_38 = uVar3; } if (0 < (int)local_38) { slotOffset = 0x94; do { piVar6 = piVar5 + iVar4; iVar4 = iVar4 + 1; *(short *)(slotOffset + (int)this->_descriptor) = (short)*piVar6; slotOffset = slotOffset + 2; } while (iVar4 < (int)local_38); } if (shopRng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } bVar2 = (byte)shopRng._shift1; uVar3 = (uint)shopRng._seed >> (bVar2 & 0x1f) ^ shopRng._seed; shift2 = (byte)shopRng._shift2; uVar3 = uVar3 << (shift2 & 0x1f) ^ uVar3; shift3 = (byte)shopRng._shift3; uVar3 = uVar3 >> (shift3 & 0x1f) ^ uVar3; *(undefined2 *)((int)this->_descriptor + (uVar3 & 1) * 2 + 0x94) = 8; *(undefined2 *)((int)this->_descriptor + 0xac) = 0; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> (bVar2 & 0x1f) ^ uVar3; uVar3 = uVar3 << (shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> (shift3 & 0x1f) ^ uVar3; if (uVar3 % 3 == 0) { slotValue = 0xffff; } else { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> (bVar2 & 0x1f) ^ uVar3; uVar3 = uVar3 << (shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> (shift3 & 0x1f) ^ uVar3; slotValue = (undefined2)(uVar3 % 6); } *(undefined2 *)((int)this->_descriptor + 0xae) = slotValue; if (slotTypes == (int *)0x0) goto LAB_0081485e; allocSize = (int)local_18 - (int)slotTypes & 0xfffffffc; piVar5 = slotTypes; if (0xfff < allocSize) { piVar5 = (int *)slotTypes[-1]; iVar4 = (int)slotTypes - (int)piVar5; goto joined_r0x00814770; } } operator_delete(piVar5,allocSize); } LAB_0081485e: *(uint *)((int)this->_descriptor + 0x60) = uVar3; ExceptionList = local_10; return; } //@@ 00814980 FUN_00814980 int FUN_00814980(uint *param_1,int *param_2,int *param_3,undefined4 param_4) { short *psVar1; ushort *puVar2; uint uVar3; uint uVar4; int shopItemId; int iVar5; Room *in_ECX; if (*(short *)((int)in_ECX->_descriptor + 0xac) < 0) { Room::init_shop_item_slots(in_ECX); } uVar3 = (in_ECX->_shopItemDeque)._size; if (uVar3 == 0) { shopItemId = (int)*(short *)((int)in_ECX->_descriptor + 0xac); } else { uVar4 = (in_ECX->_shopItemDeque)._offset; shopItemId = *(int *)(*(int *)((int)(in_ECX->_shopItemDeque)._map + (uVar4 >> 1 & (in_ECX->_shopItemDeque)._mapSize - 1) * 4) + 4 + (uVar4 & 1) * 8); } pickup_roll_random_variant(shopItemId,param_1,param_2,param_4); iVar5 = Room::GetShopItemPrice(in_ECX,*param_1,*param_2,shopItemId,(Entity_Player *)0x0); *param_3 = iVar5; iVar5 = _Room::ResolveHeartSubType(shopItemId,iVar5,0); *param_3 = iVar5; if (uVar3 == 0) { psVar1 = (short *)((int)in_ECX->_descriptor + 0xac); *psVar1 = *psVar1 + 1; puVar2 = (ushort *)((int)in_ECX->_descriptor + 0xac); *puVar2 = *puVar2 & 7; } return shopItemId; } //@@ 00814a50 pickup_roll_random_variant /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (seed, &variant, &subtype, rng): random pickup variant/subtype via ItemPool::GetCollectible/GetTrinket/GetCardEx/GetPill, lua_callback_run_get_card; called from Entity_Pickup::Init (00814980) and Entity_Pickup::Morph when variant 0 */ void pickup_roll_random_variant(uint param_1,undefined4 *param_2,uint *param_3,uint param_4) { short sVar1; bool bVar2; Entity_Player *this; int iVar3; uint uVar4; uint uVar5; undefined4 uVar6; int in_ECX; Game *pGVar7; uint uVar8; uint uVar9; uint uVar10; uint uVar11; uint uVar12; uint local_24; uint local_20; byte local_19; RNG local_18; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if ((g_game->_difficulty == 2) || (local_19 = 0, g_game->_difficulty == 3)) { local_19 = 1; } uVar4 = 8; if ((int)param_1 < 8) { uVar4 = param_1; } uVar8 = 0; if (0 < (int)uVar4) { uVar8 = uVar4; } this = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xb8); pGVar7 = g_game; if ((this != (Entity_Player *)0x0) && ((*(int *)(in_ECX + 8) == 2 || (*(int *)(in_ECX + 8) == 0x16)))) { iVar3 = *(int *)(in_ECX + 4) + uVar8 * 2; sVar1 = *(short *)(iVar3 + 0x94); if ((sVar1 == 8) || (sVar1 == 0x11)) { *(undefined2 *)(iVar3 + 0x94) = 0x12; } iVar3 = Entity_Player::GetTrinketMultiplier(this,0xb8); pGVar7 = g_game; if ((2 < iVar3) && (((g_manager->_persistentGameData)._achievements[0x275] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { uVar4 = 0xffffffff; uVar12 = 0xffffffff; local_20 = 0xffffffff; uVar11 = 0xffffffff; local_24 = 0xffffffff; uVar10 = 0xffffffff; uVar9 = 0; iVar3 = *(int *)(in_ECX + 4); do { if (*(ushort *)(iVar3 + 0x94 + uVar9 * 2) < 0x16) { uVar4 = local_20; /* WARNING (jumptable): Sanity check requires truncation of jumptable */ /* WARNING: Could not find normalized switch variable to match jumptable */ switch((&DAT_0081516c)[*(short *)(iVar3 + 0x94 + uVar9 * 2)]) { case 0: uVar5 = uVar9; if (local_24 != 0xffffffff) { uVar5 = local_24; } local_24 = uVar5; break; case 1: uVar5 = uVar9; if (uVar11 != 0xffffffff) { uVar5 = uVar11; } uVar11 = uVar5; break; case 2: uVar5 = uVar9; if (uVar12 != 0xffffffff) { uVar5 = uVar12; } uVar12 = uVar5; break; case 3: uVar5 = uVar9; if (uVar10 != 0xffffffff) { uVar5 = uVar10; } uVar10 = uVar5; break; case 4: if (local_20 == 0xffffffff) { uVar4 = uVar9; } local_20 = uVar4; goto LAB_00814ba6; } } LAB_00814ba6: uVar9 = uVar9 + 1; } while (uVar9 < 8); if (uVar4 == 0xffffffff) { if (uVar12 == 0xffffffff) { if (uVar11 == 0xffffffff) { if (uVar10 == 0xffffffff) { if (local_24 != 0xffffffff) { uVar4 = local_24; } } else { uVar4 = uVar10; } } else { uVar4 = uVar11; } } else { uVar4 = uVar12; } } if (uVar4 == uVar8) { *(undefined2 *)(iVar3 + 0x94 + uVar4 * 2) = 0x15; } } } local_18._seed = param_4; switch(*(undefined2 *)(*(int *)(in_ECX + 4) + 0x94 + uVar8 * 2)) { case 0: *param_2 = 10; *param_3 = 1; return; case 1: *param_2 = 0x28; *param_3 = 1; return; case 2: *param_2 = 0x46; uVar4 = ItemPool::GetPill(param_4); *param_3 = uVar4; return; case 3: *param_2 = 0x1e; *param_3 = 1; return; case 4: *param_2 = 10; *param_3 = 3; return; case 5: *param_2 = 0x5a; *param_3 = 1; return; case 6: *param_2 = 300; iVar3 = ItemPool::GetCardEx(param_4,0x19,0,10,1); local_18._shift1 = 5; local_18._shift2 = 9; local_18._shift3 = 7; uVar4 = lua_callback_run_get_card(&local_18,iVar3,1,0,0); *param_3 = uVar4; return; case 7: *param_2 = 0x45; *param_3 = 1; return; case 8: *param_2 = 100; uVar4 = ItemPool::GetSeededCollectible(param_4,0,*(RoomDescriptor **)(in_ECX + 4)); *param_3 = uVar4; return; case 9: *param_2 = 100; iVar3 = 2; if (local_19 != 0) { iVar3 = 0x11; } uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,iVar3,param_4,0,0,0); *param_3 = uVar4; return; case 10: *param_2 = 100; uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,(uint)local_19 << 4,param_4,0,0,0); *param_3 = uVar4; return; case 0xb: *param_2 = 0x15e; uVar4 = ItemPool::GetTrinket(&pGVar7->_itemPool,0); *param_3 = uVar4; return; case 0xc: *param_2 = 100; uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,(uint)local_19 * 0x10 + 3,param_4,0,0,0); *param_3 = uVar4; return; case 0xd: *param_2 = 100; uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,(uint)local_19 * 0x10 + 4,param_4,0,0,0); *param_3 = uVar4; return; case 0xe: *param_2 = 100; iVar3 = 5; if (local_19 != 0) { iVar3 = 0x16; } uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,iVar3,param_4,0,0,0); *param_3 = uVar4; return; case 0xf: *param_2 = 10; *param_3 = 6; local_18._shift1 = 7; local_18._shift2 = 1; local_18._shift3 = 9; uVar4 = RNG::RandomInt(&local_18,3); if (uVar4 == 0) { *param_3 = 4; } uVar4 = RNG::RandomInt(&local_18,4); if ((uVar4 == 0) && (((g_manager->_persistentGameData)._achievements[0x19b] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_3 = 0xc; } uVar4 = RNG::RandomInt(&local_18,4); if ((uVar4 == 0) && (((g_manager->_persistentGameData)._achievements[0x187] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) { *param_3 = 0xb; return; } break; case 0x10: *param_2 = 300; iVar3 = ItemPool::GetCardEx(param_4,0,1,0,1); local_18._shift1 = 5; local_18._shift2 = 9; local_18._shift3 = 7; uVar4 = lua_callback_run_get_card(&local_18,iVar3,0,1,1); *param_3 = uVar4; return; case 0x11: *param_2 = 100; iVar3 = 1; if (local_19 != 0) { iVar3 = 0x12; } uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,iVar3,param_4,0,0,0); *param_3 = uVar4; return; case 0x12: *param_2 = 100; uVar4 = ItemPool::GetCollectible(&pGVar7->_itemPool,0x1c,param_4,0,0,0); *param_3 = uVar4; return; case 0x13: *param_2 = 10; *param_3 = 4; return; case 0x14: if (((g_manager->_persistentGameData)._achievements[0x125] == 0) && (((g_manager->_state != 2 || (pGVar7 == (Game *)0x0)) || (((pGVar7->_dailyChallenge)._id == 0 && (pGVar7->_isDebug == 0)))))) { bVar2 = false; } else { bVar2 = true; } uVar4 = 0x33; if (!bVar2) { uVar4 = 1; } uVar6 = 300; if (!bVar2) { uVar6 = 0x1e; } *param_2 = uVar6; *param_3 = uVar4; return; case 0x15: *param_2 = 300; *param_3 = 0x5c; } return; } //@@ 008151e0 Room::GetShopItemPrice /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: log string prototype: db/protos.zhl, confirmed by RET 16 */ int __thiscall Room::GetShopItemPrice(Room *this,uint variant,int subType,int shopItemId,Entity_Player *player) { code *pcVar1; byte bVar2; byte isNullEffectActive; Entity_Player *foundPlayer; int iVar3; uint coinFlip; uint uVar4; ItemConfig_Item *collectibleConfig; int extraout_ECX; char isPoundOfFlesh; undefined4 unaff_EBX; undefined3 uVar5; RNG priceRng; undefined4 local_38; PlayerManager *playerManager; Entity_Player *bargainOwner; uint seed; Room *room; uint local_24; Entity_Player *local_20; char isKeeperPricing; RNG bargainRng; undefined4 local_8; short shopSlotType; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; local_20 = player; priceRng._shift1 = 5; priceRng._shift2 = 9; priceRng._seed = subType + variant | *(uint *)((int)this->_descriptor + 0x58) & 0xfffff800; local_38 = 7; priceRng._shift3 = 7; uVar5 = (undefined3)((uint)unaff_EBX >> 8); seed = priceRng._seed; room = this; if (player == (Entity_Player *)0x0) { bargainOwner = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xab); foundPlayer = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2a0,(RNG **)&g_game->_playerManager,1); uVar4 = CONCAT31(uVar5,foundPlayer != (Entity_Player *)0x0); playerManager = &g_game->_playerManager; local_24 = uVar4; foundPlayer = PlayerManager::FirstPlayerByType(playerManager,0xe); if (foundPlayer != (Entity_Player *)0x0) goto LAB_00815375; foundPlayer = PlayerManager::FirstPlayerByType(playerManager,0x21); if (foundPlayer != (Entity_Player *)0x0) goto LAB_00815375; if ((bargainOwner != (Entity_Player *)0x0) && (bVar2 = Entity_Player::HasTrinket(bargainOwner,0xab,0), bVar2 != 0)) { iVar3 = Entity_Player::GetTrinketMultiplier(bargainOwner,0xab); if (iVar3 < 2) { bargainRng._seed = seed; bargainRng._shift1 = 0xf; bargainRng._shift2 = 1; bargainRng._shift3 = 0x1d; coinFlip = RNG::RandomInt(&bargainRng,2); if (coinFlip != 0) goto LAB_008152fc; } goto LAB_00815375; } LAB_008152fc: isKeeperPricing = '\0'; } else { bVar2 = Entity_Player::HasCollectible(player,0x2a0,0); uVar4 = CONCAT31(uVar5,bVar2); local_24 = uVar4; if ((local_20->_playerType != 0xe) && (local_20->_playerType != 0x21)) { bVar2 = Entity_Player::HasTrinket(local_20,0xab,0); if (bVar2 == 0) goto LAB_008152fc; iVar3 = Entity_Player::GetTrinketMultiplier(local_20,0xab); if (iVar3 < 2) { bargainRng._seed = seed; bargainRng._shift1 = 0xf; bargainRng._shift2 = 1; bargainRng._shift3 = 0x1d; coinFlip = RNG::RandomInt(&bargainRng,2); if (coinFlip != 0) { isKeeperPricing = '\0'; goto LAB_00815377; } } } LAB_00815375: isKeeperPricing = '\x01'; } LAB_00815377: isPoundOfFlesh = (char)uVar4; if (g_game->_currentRoomIdx == -0xd) { if (300 < variant) { if (variant != 0x15e) { return 5; } if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) { return 0xf; } return -5; } if (variant == 300) { if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) { return 6; } return -5; } if (variant == 10) { if ((isPoundOfFlesh != '\0') && (isKeeperPricing == '\0')) { return -5; } if (subType == 4) { return 0xf; } if ((subType == 0xb) || (subType == 6)) { return 8; } if (subType == 3) { return 6; } return 5; } if (variant != 100) { return 5; } if ((isPoundOfFlesh != '\0') && (isKeeperPricing == '\0')) { uVar4 = RNG::RandomInt(&priceRng,2); return -1 - (uint)(uVar4 != 0); } iVar3 = 0x1e; if ((-1 < shopItemId) && ((uint)shopItemId < 8)) { shopSlotType = *(short *)((int)room->_descriptor + shopItemId * 2 + 0x94); if ((shopSlotType == 0xc) || (shopSlotType == 0xd)) { iVar3 = 0x32; } else if (shopSlotType == 0xe) { uVar4 = RNG::RandomInt(&priceRng,0x50); return uVar4 + 0x14; } } uVar4 = RNG::RandomInt(&priceRng,iVar3 - 0xe); return uVar4 + 0xf; } iVar3 = room->_roomType; if (((((iVar3 != 0xe) && (iVar3 != 0x16)) && ((*(uint *)((int)room->_descriptor + 0x44) >> 0xb & 1) == 0)) && ((iVar3 != 5 || (((g_game->_levelStateFlags & 0x20000U) == 0 && (foundPlayer = PlayerManager::FirstPlayerByType(&g_game->_playerManager,0x21), foundPlayer == (Entity_Player *)0x0)))))) && (shopItemId != -2)) { if (variant == 10) { if ((subType == 1) || (subType == 2)) { if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) { return 3; } return -5; } } else if (variant == 0x28) { if (subType == 4) { LAB_008155cf: if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) { return 10; } return -5; } } else if (variant == 0x1e) { if (subType == 2) goto LAB_008155cf; } else if (variant == 100) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,subType); if ((isPoundOfFlesh != '\0') && (isKeeperPricing == '\0')) { if (collectibleConfig == (ItemConfig_Item *)0x0) { return -1; } return -(int)collectibleConfig->devilprice; } if (collectibleConfig == (ItemConfig_Item *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] Room::GetShopItemPrice: no config for collectible %d.\n"); return 0xf; } iVar3 = (int)collectibleConfig->shopPrice; if (room->_roomType != 0xf) { return iVar3; } if (iVar3 != 0xf) { return iVar3; } if (collectibleConfig->devilprice == 2) { return 0x1e; } return 0xf; } if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) { return (uint)(variant == 0x45) * 2 + 5; } return -5; } if (local_20 == (Entity_Player *)0x0) { bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xad); } else { bVar2 = Entity_Player::HasTrinket(local_20,0xad,0); if (((bVar2 == 0) && (iVar3 = Entity_Player::GetHealthType(local_20), iVar3 != 2)) && (*(int *)(extraout_ECX + 0x13c0) != 0x27)) { isNullEffectActive = TemporaryEffects::HasNullEffect((TemporaryEffects *)(extraout_ECX + 0x1508),0x70); bVar2 = 0; if (isNullEffectActive == 0) goto LAB_008156ef; } bVar2 = 1; } LAB_008156ef: if ((isKeeperPricing != '\0') && (local_24 = uVar4 & 0xff, bVar2 == 0)) { local_24 = 1; } if (variant == 100) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,subType); if (collectibleConfig == (ItemConfig_Item *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] Room::GetShopItemPrice: no config for collectible %d.\n"); if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); iVar3 = (*pcVar1)(); return iVar3; } uVar4 = seed >> ((byte)priceRng._shift1 & 0x1f) ^ seed; uVar4 = uVar4 << ((byte)priceRng._shift2 & 0x1f) ^ uVar4; uVar4 = ~(uVar4 >> ((byte)local_38 & 0x1f) ^ uVar4) | 0xfffffffe; } else { uVar4 = (collectibleConfig->devilprice < 2) - 2; } if ((char)local_24 != '\0') { iVar3 = 0xf; if (uVar4 == 0xfffffffe) { iVar3 = 0x1e; } return iVar3; } if ((collectibleConfig != (ItemConfig_Item *)0x0) && (bVar2 = Item::HasTags(collectibleConfig,0x200000000), bVar2 != 0)) { uVar4 = 0xfffffff6; } } else { uVar4 = 0xfffffffb; if ((char)local_24 != '\0') { return 5; } } return uVar4; } //@@ 00815800 Room::TriggerRestock /* ZHL [exact] __thiscall void Room::TriggerRestock(int grid_idx, int shop_idx); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Room::TriggerRestock(Room *this,int grid_idx,int shop_idx) { uint *puVar1; int iVar2; uint uVar3; uint uVar4; void *pvVar5; uint uVar6; this->_shopRestockTimer = 0x1e; uVar6 = (this->_shopItemDeque)._size; uVar4 = (this->_shopItemDeque)._offset; if (((uVar4 + uVar6 & 1) == 0) && ((this->_shopItemDeque)._mapSize <= uVar6 + 2 >> 1)) { std::deque::_Growmap(uVar6); uVar4 = (this->_shopItemDeque)._offset; uVar6 = (this->_shopItemDeque)._size; } uVar3 = (this->_shopItemDeque)._mapSize; uVar4 = uVar3 * 2 - 1 & uVar4; uVar6 = uVar6 + uVar4; (this->_shopItemDeque)._offset = uVar4; uVar4 = uVar3 - 1 & uVar6 >> 1; pvVar5 = (this->_shopItemDeque)._map; iVar2 = uVar4 * 4; if (*(int *)((int)pvVar5 + uVar4 * 4) == 0) { pvVar5 = operator_new(0x10); *(void **)(iVar2 + (int)(this->_shopItemDeque)._map) = pvVar5; pvVar5 = (this->_shopItemDeque)._map; } iVar2 = *(int *)(iVar2 + (int)pvVar5); uVar6 = uVar6 & 1; *(int *)(iVar2 + uVar6 * 8) = grid_idx; *(int *)(iVar2 + 4 + uVar6 * 8) = shop_idx; puVar1 = &(this->_shopItemDeque)._size; *puVar1 = *puVar1 + 1; return; } //@@ 008158a0 Room::ShopRestockPartial /* ZHL [exact] __thiscall void Room::ShopRestockPartial(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Room::ShopRestockPartial(Room *this) { uint *puVar1; char cVar2; int iVar3; int iVar4; code *pcVar5; Entity *pEVar6; uint uVar7; uint uVar8; uint uVar9; Vector local_10; undefined4 local_8; if (this->_roomType != 2) { KAGE_LogMessage(1,(byte *)"[warn] restock disabled for room type %d.\n"); return; } uVar9 = *(uint *)((int)this->_descriptor + 0x5c); local_8 = 7; if ((this->_shopItemDeque)._size != 0) { while( true ) { uVar7 = (this->_shopItemDeque)._offset; uVar8 = uVar7 & 1; iVar3 = *(int *)((int)(this->_shopItemDeque)._map + (uVar7 >> 1 & (this->_shopItemDeque)._mapSize - 1) * 4); iVar4 = *(int *)(iVar3 + 4 + uVar8 * 8); uVar7 = *(uint *)(iVar3 + uVar8 * 8); if (-1 < iVar4) { cVar2 = *(char *)(iVar4 + 0xa4 + (int)this->_descriptor); if (cVar2 != -1) { *(char *)(iVar4 + 0xa4 + (int)this->_descriptor) = cVar2 + '\x01'; } } local_10.x = (float)((int)uVar7 % this->_gridWidth) * 40.0 + 40.0; local_10.y = (float)((int)uVar7 / this->_gridWidth) * 40.0 + 120.0; if ((uVar7 < 0x1c0) && (this->_gridEntities[uVar7] != (int *)0x0)) { (**(code **)(*(int *)this->_gridEntities[uVar7] + 0x14))(1); } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar9 = uVar9 >> 2 ^ uVar9; uVar9 = uVar9 << 7 ^ uVar9; uVar9 = uVar9 >> ((byte)local_8 & 0x1f) ^ uVar9; pEVar6 = Game::Spawn(g_game,5,0x96,&local_10,&g_vectorZero,(Entity *)0x0,0,uVar9); pEVar6->_spawnGridIndex = uVar7; uVar7 = Random(); Game::Spawn(g_game,1000,0xf,&local_10,&g_vectorZero,(Entity *)0x0,0,uVar7); KAGE_LogMessage(1,(byte *)"Spawn shop pickup (restock), Pos(%.2f,%.2f)\n"); puVar1 = &(this->_shopItemDeque)._size; *puVar1 = *puVar1 - 1; if (*puVar1 == 0) break; puVar1 = &(this->_shopItemDeque)._offset; *puVar1 = *puVar1 + 1; } (this->_shopItemDeque)._offset = 0; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar5 = (code *)swi(3); (*pcVar5)(); return; } uVar9 = uVar9 >> 2 ^ uVar9; uVar9 = uVar9 << 7 ^ uVar9; *(uint *)((int)this->_descriptor + 0x5c) = uVar9 >> ((byte)local_8 & 0x1f) ^ uVar9; return; } //@@ 00815ae0 Room::ShopRestockFull /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Room::ShopRestockFull(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Room::ShopRestockFull(Room *this) { code *pcVar1; Entity_Player *player; int *pickup; undefined8 *pickedEntry; uint nextSeed; Entity *spawned; int iVar2; short *spawnEntry; qword *allocatedBytes; uint uVar3; void *pvVar4; uint uVar5; float dy; float dx; EntityList_EL shopPickups; EntityList_EL roomPickups; Vector freePos; undefined4 spawnRngShift3; uint gridIndex; undefined4 rngShift3; uint spawnIndex; Room *room; uint spawnSeed; Vector spawnPos; undefined4 uStack_24; undefined8 entry; undefined4 uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; qword prevAllocatedBytes; short spawnX; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01635; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; room = this; if ((this->_roomType == 2) || (this->_roomType == 0x16)) { this->_shopRestockTimer = -1; std::deque::_Tidy(local_14); init_shop_item_slots(this); spawnSeed = *(uint *)((int)this->_descriptor + 0x5c); rngShift3 = 7; KAGE_LogMessage(1,(byte *)"SpawnRNG seed: %u\n"); EntityList::QuerySublist(&this->_entityList,&shopPickups,5,-1,-1,0,0); pvVar4 = shopPickups._data; uStack_8 = 0; uVar3 = 0; if (shopPickups._size != 0) { do { pickup = (int *)__RTDynamicCast(*(undefined4 *)((int)pvVar4 + uVar3 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor); if (pickup[0x14d] != 0) { (**(code **)(*pickup + 0x28))(); } uVar3 = uVar3 + 1; } while (uVar3 < (uint)shopPickups._size); this = room; } pvVar4 = this->_descriptor; spawnIndex = 0; if (*(short *)(*(int *)((int)pvVar4 + 0x10) + 0x44) != 0) { uStack_24 = 0; uVar3 = spawnSeed; do { if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 2 ^ uVar3; uVar3 = uVar3 << 7 ^ uVar3; uVar3 = uVar3 >> ((byte)rngShift3 & 0x1f) ^ uVar3; spawnEntry = (short *)(*(int *)(*(int *)((int)pvVar4 + 0x10) + 0x40) + uStack_24); spawnX = *spawnEntry; iVar2 = (spawnEntry[1] + 1) * this->_gridWidth; uVar5 = spawnX + 1 + iVar2; gridIndex = uVar5; spawnSeed = uVar3; if ((char)spawnEntry[4] != '\0') { pickedEntry = Spawn::PickEntry(spawnEntry, (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283062e-10); entry = *pickedEntry; uStack_18 = *(undefined4 *)(pickedEntry + 1); spawnRngShift3 = 7; TransformEntry(this,&entry,uVar5,uVar3); if (((uint)entry == 5) && (entry._4_2_ == 0x96)) { spawnPos.x = (float)((int)uVar5 % this->_gridWidth) * 40.0 + 40.0; spawnPos.y = (float)((int)uVar5 / this->_gridWidth) * 40.0 + 120.0; if ((uVar5 < 0x1c0) && (this->_gridEntities[iVar2 + spawnX + 1] != (int *)0x0)) { (**(code **)(*(int *)this->_gridEntities[iVar2 + spawnX + 1] + 0x14))(1); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&roomPickups,5,-1,-1,1,0); pvVar4 = roomPickups._data; uStack_8._0_1_ = 1; uVar3 = 0; if (roomPickups._size != 0) { do { iVar2 = __RTDynamicCast(*(undefined4 *)((int)pvVar4 + uVar3 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor); if ((iVar2 != 0) && (dx = spawnPos.x - *(float *)(iVar2 + 0x33c), dy = spawnPos.y - *(float *)(iVar2 + 0x340), dy * dy + dx * dx < 900.0)) { FindFreePickupSpawnPosition(g_game->_room,&freePos,&spawnPos,10.0,0,0,0); *(float *)(iVar2 + 0x33c) = freePos.x; *(float *)(iVar2 + 0x340) = freePos.y; *(float *)(iVar2 + 0x334) = freePos.x; *(float *)(iVar2 + 0x338) = freePos.y; *(undefined4 *)(iVar2 + 0x544) = 0x14; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)roomPickups._size); uVar5 = gridIndex; } uStack_8 = (uint)uStack_8._1_3_ << 8; if (roomPickups._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (pvVar4 != (void *)0x0) { uVar3 = *(uint *)((int)pvVar4 + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar3); free((void *)((int)pvVar4 + -4)); } uStack_8 = uStack_8 & 0xffffff00; } uVar3 = spawnSeed; if (spawnSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } nextSeed = spawnSeed >> 5 ^ spawnSeed; nextSeed = nextSeed << 9 ^ nextSeed; spawned = Game::Spawn(g_game,(uint)entry,(uint)entry._4_2_,&spawnPos,&g_vectorZero, (Entity *)0x0,(uint)entry._6_2_, nextSeed >> ((byte)spawnRngShift3 & 0x1f) ^ nextSeed); spawned->_spawnGridIndex = uVar5; uVar5 = Random(); Game::Spawn(g_game,1000,0xf,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar5); KAGE_LogMessage(1,(byte *)"Spawn Entity with Type(%d), Variant(%d), Pos(%.2f,%.2f)\n"); this = room; } } pvVar4 = this->_descriptor; uStack_24 = uStack_24 + 0x10; spawnIndex = spawnIndex + 1; } while (spawnIndex < *(ushort *)(*(int *)((int)pvVar4 + 0x10) + 0x44)); } if (shopPickups._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (shopPickups._data != (void *)0x0) { uVar3 = *(uint *)((int)shopPickups._data + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar3; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar3); free((uint *)((int)shopPickups._data + -4)); } } } else { player = Game::GetPlayer(g_game,0); Entity_Player::UseActiveItem(player,(short *)((int)&uStack_24 + 2),0x69,1,-1,0); } ExceptionList = local_10; return; } //@@ 00816000 Room::ShopReshuffle /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0081620f) */ /* WARNING: Removing unreachable block (ram,0x0081621f) */ /* ZHL [lua] Lua binding Room:ShopReshuffle */ void Room::ShopReshuffle(char param_1,char param_2) { code *pcVar1; int *begin; uint uVar2; int in_ECX; short *shopSlot; int *shuffledCursor; uint slotCount; undefined2 *shopSlotOut; int *end; int iVar3; RNG rng; int swappedValue; int *shuffledSlot; short *local_1c; int room; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0166d; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar3 = *(int *)(in_ECX + 4); rng._shift1 = 5; rng._shift2 = 9; rng._seed = *(uint *)(iVar3 + 0x60); rng._shift3 = 7; local_1c = (short *)(iVar3 + 0xa4); room = in_ECX; begin = std::_Allocate(0x20); end = begin; for (shopSlot = (short *)(iVar3 + 0x94); shopSlot != local_1c; shopSlot = shopSlot + 1) { *end = (int)*shopSlot; end = end + 1; } local_8 = 0; RNG::Shuffle(&rng,begin,end); if (param_1 != '\0') { local_1c = (short *)0x94; shuffledSlot = begin; do { if ((*(short *)(*(int *)(room + 4) + (int)local_1c) == 8) && (swappedValue = *shuffledSlot, swappedValue != 8)) { uVar2 = 0; slotCount = (int)end - (int)begin >> 2; if (slotCount != 0) { shopSlot = (short *)(*(int *)(room + 4) + 0x94); do { if ((*shopSlot != 8) && (begin[uVar2] == 8)) { *shuffledSlot = 8; begin[uVar2] = swappedValue; break; } uVar2 = uVar2 + 1; shopSlot = shopSlot + 1; } while (uVar2 < slotCount); } } shuffledSlot = shuffledSlot + 1; local_1c = local_1c + 1; } while (local_1c < (short *)0xa4); } iVar3 = *(int *)(room + 4); shuffledCursor = begin; shopSlotOut = (undefined2 *)(iVar3 + 0x94); if (begin != end) { do { iVar3 = *shuffledCursor; shuffledCursor = shuffledCursor + 1; *shopSlotOut = (short)iVar3; shopSlotOut = shopSlotOut + 1; } while (shuffledCursor != end); iVar3 = *(int *)(room + 4); } uVar2 = rng._seed; if (param_2 != '\0') { if (rng._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar2 = (uint)rng._seed >> ((byte)rng._shift1 & 0x1f) ^ rng._seed; uVar2 = uVar2 << ((byte)rng._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)rng._shift3 & 0x1f) ^ uVar2; if (uVar2 == (uVar2 / 3) * 3) { *(undefined2 *)(iVar3 + 0xae) = 0xffff; } else { if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar2 = uVar2 >> ((byte)rng._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)rng._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)rng._shift3 & 0x1f) ^ uVar2; *(ushort *)(*(int *)(room + 4) + 0xae) = (ushort)uVar2 & 7; } } *(uint *)(*(int *)(room + 4) + 0x60) = uVar2; if (begin != (int *)0x0) { operator_delete(begin,0x20); } ExceptionList = local_10; return; } //@@ 00816250 _Room::ResolveHeartSubType /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ? remaps negative pseudo heart subtypes by health type/Keeper/trinket multiplier; pickup Init/Morph */ int _Room::ResolveHeartSubType(uint param_1,int param_2,Entity_Player *param_3) { EntityPtr EVar1; byte bVar2; Entity_Player *pEVar3; int iVar4; int iVar5; int iVar6; RNG *this; uint uVar7; EntityPtr this_00; int in_ECX; Entity_Player *this_01; Entity_Player *this_02; int extraout_EDX; Game *pGVar8; bool bVar9; bool bVar10; double dVar11; uint local_2c; int local_20; RNG local_1c; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (param_2 < 1) { if (-1 < param_2) { return param_2; } if ((param_2 != -5) && (param_2 != -10)) { iVar4 = 0; local_20 = 0; if (param_3 == (Entity_Player *)0x0) { local_2c = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { local_20 = 0; do { this_00 = (EntityPtr)Game::GetPlayer(g_game,local_2c); if (((*(int *)((int)this_00 + 0x2c) == 0) && (*(byte *)((int)this_00 + 0x20a9) == 0)) && ((((*(byte *)((int)this_00 + 0x172) == 0 || (((*(int *)((int)this_00 + 0x13c0) != 0x1d && (*(int *)((int)this_00 + 0x13c0) != 0x26)) || (EVar1 = *(EntityPtr *)((int)this_00 + 0x1e68), EVar1 == (EntityPtr)0x0)))) || (((*(int *)((int)EVar1 + 0x161c) == -1 || (*(int *)((int)this_00 + 0x161c) <= *(int *)((int)EVar1 + 0x161c))) || (EVar1 == this_00)))) && (*(int *)((int)this_00 + 0x3bc) == 0)))) { iVar5 = Entity_Player::GetHealthType((Entity_Player *)this_00); if ((iVar5 == 2) || (bVar2 = Entity_Player::HasInstantDeathCurse(this_02), bVar2 != 0) ) { bVar10 = SBORROW4(iVar4,1); bVar9 = iVar4 + -1 < 0; iVar5 = 1; } else { iVar5 = Entity_Player::GetHealthType((Entity_Player *)this_00); if ((iVar5 == 1) || (iVar5 == 2)) { if (local_20 < *(int *)((int)this_00 + 0x1340)) { local_20 = *(int *)((int)this_00 + 0x1340); } iVar5 = *(int *)((int)this_00 + 0x134c); bVar10 = SBORROW4(iVar4,iVar5); bVar9 = iVar4 - iVar5 < 0; } else { iVar5 = *(int *)((int)this_00 + 0x1340) + *(int *)((int)this_00 + 0x1d88) * 2; if (local_20 < iVar5) { local_20 = iVar5; } iVar5 = *(int *)((int)this_00 + 0x134c); bVar10 = SBORROW4(iVar4,iVar5); bVar9 = iVar4 - iVar5 < 0; } } if (bVar10 != bVar9) { iVar4 = iVar5; } } local_2c = local_2c + 1; } while (local_2c < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } pGVar8 = g_game; pEVar3 = PlayerManager::FirstPlayerByType(&g_game->_playerManager,4); bVar9 = pEVar3 != (Entity_Player *)0x0; } else { iVar5 = Entity_Player::GetHealthType(param_3); local_20 = extraout_EDX; if (iVar5 == 2) { LAB_00816573: iVar4 = 1; } else { bVar2 = Entity_Player::HasInstantDeathCurse(this_01); if (bVar2 != 0) { local_20 = 0; goto LAB_00816573; } iVar5 = Entity_Player::GetEffectiveMaxHearts(param_3); local_20 = 0; if (0 < iVar5) { local_20 = iVar5; } if (0 < param_3->_soulHearts) { iVar4 = param_3->_soulHearts; } } bVar9 = param_3->_playerType == 4; pGVar8 = g_game; } if (bVar9) { if (param_2 == -1) { param_2 = -7; } else if (param_2 == -2) { param_2 = -8; } } else if (local_20 < 1) { param_2 = -3; } else { if (((int)param_1 < 0) || ((int)*(short *)(*(int *)(in_ECX + 4) + 0xae) != param_1)) { bVar9 = false; } else { bVar9 = true; } if (param_2 == -2) { if (((bVar9) && (3 < iVar4)) || (local_20 < 4)) { param_2 = -4; } } else if (((param_2 == -1) && (bVar9)) && (5 < iVar4)) { param_2 = -3; } } bVar2 = PlayerManager::AnyoneHasTrinket(&pGVar8->_playerManager,0x38); if (bVar2 != 0) { if (param_2 == -2) { param_2 = -1; } iVar4 = PlayerManager::GetTrinketMultiplier(&g_game->_playerManager,0x38); if (1 < iVar4) { if (param_2 == -3) { param_2 = -8; goto LAB_00816484; } if (param_2 == -8) { param_2 = -7; goto LAB_00816484; } if (param_2 == -4) { param_2 = -9; goto LAB_00816484; } if (param_2 == -9) { param_2 = -1; goto LAB_00816484; } } } goto LAB_00816470; } } else { pEVar3 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xb8); iVar4 = param_2; if ((pEVar3 != (Entity_Player *)0x0) && (*(short *)(*(int *)(in_ECX + 4) + 0x94 + param_1 * 2) == 0x12)) { iVar4 = Entity_Player::GetTrinketMultiplier(pEVar3,0xb8); if (iVar4 < 2) { iVar4 = (param_2 * 2) / 3; } else { iVar4 = 6; } } iVar5 = PlayerManager::GetNumCollectibles(&g_game->_playerManager,0x40); if ((iVar5 == 0) && (((-1 < (int)param_1 && ((int)*(short *)(*(int *)(in_ECX + 4) + 0xae) == param_1)) || (bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)g_game->_room + 0x7310),0x40), bVar2 != 0)))) { iVar5 = 1; } pEVar3 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0xab); if (((*(int *)(in_ECX + 8) == 0xe) && (pEVar3 != (Entity_Player *)0x0)) && (iVar6 = Entity_Player::GetTrinketMultiplier(pEVar3,0xab), 2 < iVar6)) { RNG::game_constructor(&local_1c,*(uint *)(*(int *)(in_ECX + 4) + 0x60),param_1); uVar7 = RNG::RandomInt(this,3); if (uVar7 == 0) { iVar5 = iVar5 + 1; } } if ((*(int *)(in_ECX + 8) == 2) && (bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xd), bVar2 != 0)) { param_2 = -1000; } else { param_2 = iVar4; if (0 < iVar5) { if (iVar4 < 6) { if (0 < iVar4) goto LAB_008163c6; } else if (iVar5 == 1) { param_2 = iVar4 / 2; } else { LAB_008163c6: dVar11 = ceil((double)((float)iVar4 / (float)(iVar5 + 1))); param_2 = (int)dVar11; } } } if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { if (param_2 < 0) goto LAB_00816478; if ((int)param_1 < 0) { return param_2; } uVar7 = (uint)*(byte *)(*(int *)(in_ECX + 4) + 0xa4 + param_1); if (uVar7 == 0) { return param_2; } iVar5 = 1; if (1 < iVar4 / 7) { iVar5 = iVar4 / 7; } iVar4 = (int)(iVar5 * (uVar7 + 1) * uVar7) / 2 + param_2; param_2 = 99; if (iVar4 < 99) { param_2 = iVar4; } } LAB_00816470: if (-1 < param_2) { return param_2; } } LAB_00816478: if (param_2 == -1000) { return -1000; } LAB_00816484: if (param_3 == (Entity_Player *)0x0) { bVar2 = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xad); if (bVar2 != 0) { param_2 = -6; } } else { bVar2 = Entity_Player::HasTrinket(param_3,0xad,0); if (((bVar2 != 0) || ((((iVar4 = Entity_Player::GetHealthType(param_3), iVar4 == 2 && (param_3->_playerType != 0x28)) || (iVar4 = param_3->_playerType, iVar4 == 0x27)) || (bVar2 = TemporaryEffects::HasNullEffect(¶m_3->_temporaryeffects,0x70), bVar2 != 0)))) || (((iVar4 == 0x28 && (param_3->_twinPlayer != (EntityPtr)0x0)) && ((bVar2 = Entity_Player::HasTrinket((Entity_Player *)param_3->_twinPlayer,0xad,0), bVar2 != 0 || (bVar2 = TemporaryEffects::HasNullEffect ((TemporaryEffects *)((int)param_3->_twinPlayer + 0x1508),0x70), bVar2 != 0)))))) { param_2 = -6; } } return param_2; } //@@ 008167e0 Room::RemoveDoor /* ZHL [lua] Lua binding Room:RemoveDoor prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Room::RemoveDoor(Room *this,int doorSlot) { uint uVar1; int iVar2; GridEntity *this_00; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b016b7; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (((uint)doorSlot < 8) && (this->_doors[doorSlot] != (void *)0x0)) { iVar3 = this->_doorGridPositions[doorSlot]; if (iVar3 < 0) { KAGE_LogMessage(0x10,(byte *)"invalid GridIndex while removing door (slot %d)"); } if (iVar3 < 1) { iVar3 = 0; } iVar2 = 0x1bf; if (iVar3 < 0x1bf) { iVar2 = iVar3; } iVar3 = __RTDynamicCast(this->_gridEntities[iVar2],0, &IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0,uVar1); if (iVar3 != 0) { if (this->_gridEntities[iVar2] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[iVar2])(1); } this->_gridEntities[iVar2] = (void *)0x0; } this->_doors[doorSlot] = (void *)0x0; this_00 = operator_new(0x154); local_8 = 5; if (this_00 == (GridEntity *)0x0) { this_00 = (GridEntity *)0x0; } else { GridEntity::GridEntity(this_00); *(undefined ***)this_00 = IsaacRepentancePlus::GridEntity_Wall::vftable; } local_8 = 0xffffffff; if (this_00 != (GridEntity *)0x0) { (this_00->_desc)._type = 0xf; this_00->_gridIndex = iVar2; this->_gridEntities[iVar2] = this_00; uVar1 = Random(); GridEntity::Init(this_00,uVar1); } } ExceptionList = local_10; return; } //@@ 00816910 Room::SpawnGreedModeWave /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Room::SpawnGreedModeWave(bool unusedBool); */ void __thiscall Room::SpawnGreedModeWave(Room *this) { int *piVar1; code *pcVar2; char cVar3; uint uVar4; float bossWave; Entity *spawned; Entity_Pickup *coin; uint rngResult; undefined4 *playerSlot; Vector *freePos; undefined8 *pickedEntry; EntityConfig_Entity *entityConfig; byte rngShiftLeft; MusicManager *musicManager; uint extraout_ECX; int iVar5; void *pvVar6; uint extraout_ECX_00; int iVar7; void **doorSlot; float bossWave; PlayerManager *playerManager; int spawnX; uint uVar9; uint *puVar10; uint rngResult; Room *pRVar12; Room *door; bool bVar13; undefined4 uVar14; TypeDescriptor *pTVar15; TypeDescriptor *pTVar16; undefined4 uVar17; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; float fStack_c8; float fStack_c4; float fStack_c0; float fStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; Vector coinPos; Vector VStack_a8; float local_a0; float local_9c; void *championCandidates; uint *championCandidatesEnd; uint *championCandidatesCapacity; undefined8 rngShifts; undefined4 local_80; uint local_7c; uint local_78; Vector VStack_74; Room *savedRoom; uint local_68; uint local_64; RoomConfig_Room *local_60; uint local_5c; uint local_58; uint local_54; undefined8 spawnEntry; undefined4 uStack_48; ColorMod particleColor; uint local_18; void *local_10; undefined1 *puStack_c; float fStack_8; GridEntity_Door *door; Game *game; Manager *manager; RoomConfig_Room *waveRoom; fStack_8 = -NAN; puStack_c = &LAB_00b016f0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)((&particleColor)[1]._colorize + 1); ExceptionList = &local_10; iVar7 = 8; local_5c = 3; iVar5 = g_game->_stage; if (g_game->_difficulty == 2) { if (iVar5 == 3) { iVar7 = 7; } else if (iVar5 == 4) { iVar7 = 6; } if (((g_manager->_persistentGameData)._achievements[0xf6] == 0) && ((g_manager->_state != 2 || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0))) ))) { bVar13 = false; } else { bVar13 = true; } local_58 = iVar7 + -1; if (!bVar13) { local_58 = iVar7; } local_68 = 0x19; if (!bVar13) { local_68 = 0x1c; } } else { if (iVar5 == 1) { local_58 = 9; } else if (iVar5 == 2) { local_58 = 7; } else if (iVar5 == 3) { local_58 = 5; } else { local_58 = (iVar5 == 4) + 3; } local_68 = 0xf; local_5c = 0; } doorSlot = this->_doors; puVar10 = (uint *)((int)this->_descriptor + 0x44); *puVar10 = *puVar10 & 0xfffffffe; local_64 = 8; savedRoom = this; local_18 = uVar4; do { door = *doorSlot; if (door != (GridEntity_Door *)0x0) { if ((door->_desc)._state != 1) { (door->_desc)._state = 1; GridEntity_Door::UpdateAnimation(door); iVar7 = door->_currentRoomType; if (((((iVar7 == 7) || (iVar5 = door->_targetRoomType, iVar5 == 7)) || (iVar7 == 8)) || ((iVar5 == 8 || (iVar7 == 0x1d)))) || (iVar5 == 0x1d)) { std::string::assign((door->_openAnimation)._buf,s_Open,4); } } if (((*doorSlot)->_desc)._variant == 8) { GridEntity_Door::Bar(*doorSlot,uVar4); } } game = g_game; doorSlot = doorSlot + 1; local_64 = local_64 + -1; } while (local_64 != 0); local_7c = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); iVar7 = game->_greedModeWave; VStack_74.y = (float)&game->_roomConfig; local_60 = (RoomConfig_Room *)0x1; bossWave = (float)(iVar7 + 1); local_54 = 10; uVar4 = -(uint)(bossWave != 0.0) & (uint)bossWave; if (uVar4 < 0xc) { game->_greedModeWave = uVar4; if (uVar4 - 1 < 0xc) goto LAB_00816b00; local_78 = 0; } else { game->_greedModeWave = 0xc; uVar4 = 0xc; LAB_00816b00: local_78 = game->_greedWaveSeeds[uVar4 - 1]; } local_64 = 0x1b; local_80 = 0x1b; rngShifts = 0x1b00000001; local_9c = (float)((game->_difficulty == 3) + 9); VStack_a8.y = (float)((-(uint)((uint)bossWave < (uint)local_9c) & 6) + 5); if (game->_difficulty == 2) { switch(iVar7) { case 0: case 1: case 2: case 8: goto switchD_00816b56_caseD_0; case 3: case 4: case 5: case 9: goto switchD_00816b56_caseD_3; case 6: case 7: case 10: goto switchD_00816b56_caseD_6; } } else { switch(iVar7) { case 0: case 1: case 2: case 9: switchD_00816b56_caseD_0: local_60 = (RoomConfig_Room *)0x1; local_54 = 1; break; case 3: case 4: case 5: case 10: switchD_00816b56_caseD_3: local_60 = (RoomConfig_Room *)0x5; local_54 = 5; break; case 6: case 7: case 8: case 0xb: switchD_00816b56_caseD_6: local_60 = (RoomConfig_Room *)0xa; local_54 = 10; } } if ((uint)bossWave < (uint)local_9c) { savedRoom->_greedWaveTimer = (local_58 + iVar7) * 0x1e; local_5c = game->_difficulty; local_58 = (local_5c == 2) + 1; } else { savedRoom->_greedWaveTimer = ((iVar7 + -6) * local_5c + local_68) * 0x1e; local_5c = game->_difficulty; local_58 = (local_5c == 2) + 3; } if (local_5c == 3) { if (bossWave != 1.26117e-44) { if (bossWave == 1.54143e-44) { local_58 = local_58 + 3; } goto LAB_00816c08; } local_58 = local_58 + 1; LAB_00816c3e: savedRoom->_greedWaveTimer = -1; local_5c = game->_difficulty; } else { LAB_00816c08: if (((bossWave == (float)((local_5c == 3) + 8)) || (bossWave == (float)((local_5c == 3) + 10))) || ((local_5c == 3) + 0xb <= (uint)bossWave)) goto LAB_00816c3e; } bossWave = (float)((local_5c == 3) + 0xb); local_68 = 0; if (bossWave != bossWave) { local_68 = local_58; } local_a0 = bossWave; if ((uint)bossWave < (uint)local_9c) { if (local_7c == 0x18) { MusicManager::Crossfade(&g_manager->_musicManager,0x26,0.08); } else { MusicManager::EnableLayer(&g_manager->_musicManager,0,0); } } else { musicManager = &g_manager->_musicManager; if (bossWave == bossWave) { MusicManager::Crossfade(musicManager,0x17,0.08); } else if ((game->_stageType == 4) || (game->_stageType == 5)) { MusicManager::Crossfade(musicManager,0x29,0.08); } else { iVar7 = 9; if ((*(uint *)((int)savedRoom->_descriptor + 0x44) >> 6 & 1) != 0) { iVar7 = 0x1a; } MusicManager::Crossfade(musicManager,iVar7,0.08); } } game = g_game; local_58 = local_68; if (local_68 != 0) { if ((g_game->_levelStateFlags & 0x800U) != 0) { local_58 = local_68 - 1; g_game->_levelStateFlags = g_game->_levelStateFlags & 0xfffff7ff; } } iVar7 = game->_greedWavesClearedWithoutRedHeartDamage; if ((0 < iVar7) && (iVar7 == (iVar7 / 3) * 3)) { local_58 = local_58 + 1; } piVar1 = &game->_greedWavesClearedWithoutRedHeartDamage; *piVar1 = *piVar1 + 1; manager = g_manager; local_68 = 0x367; seed_fart_sound_override((int *)&local_68); SoundEffects::Play(&manager->_sfxManager,local_68,1.0,3,0,1.0,0.0); door = savedRoom; local_9c = 0.0; local_5c = *(uint *)(*(int *)((int)savedRoom->_descriptor + 0x10) + 0x48); if (local_78 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = local_78 >> ((byte)rngShifts & 0x1f) ^ local_78; uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_64 & 0x1f) ^ uVar4; local_60 = RoomConfig::GetRandomRoom ((RoomConfig *)VStack_74.y,uVar4,0,local_7c,(int)VStack_a8.y,local_5c,0,-1, (int)local_60,local_54,(uint *)&local_9c,0xffffffff,-1); if (local_60 == (RoomConfig_Room *)0x0) { KAGE_LogMessage(1,(byte *)"Did not find wave level %d (greed mode).\n"); ExceptionList = local_10; return; } KAGE_LogMessage(1,(byte *)"Spawning greed mode wave from room variant %d.\n"); if ((uint)g_game->_greedLastPaidWave < (uint)bossWave) { PlayerManager::trigger_room_clear(&g_game->_playerManager); uVar9 = local_64; VStack_74.y = (float)g_game->_room; iVar5 = *(int *)&((RoomConfig *)VStack_74.y)->field_0xc; iVar7 = iVar5 / 2; if (((iVar7 < 0) || (iVar5 <= iVar7)) || (*(int *)&((RoomConfig *)VStack_74.y)->field_0x10 < 5)) { iVar7 = -1; } else { iVar7 = iVar7 + iVar5 * 4; } VStack_a8.x = (float)(iVar7 % iVar5) * 40.0 + 40.0; VStack_a8.y = (float)(iVar7 / iVar5) * 40.0 + 120.0; if (0 < (int)local_58) { rngResult = local_58; do { FindFreePickupSpawnPosition(g_game->_room,&coinPos,&VStack_a8,0.0,0,0,0); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; uVar17 = 0; pTVar16 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor; pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; uVar14 = 0; uVar4 = uVar4 >> ((byte)uVar9 & 0x1f) ^ uVar4; spawned = Game::Spawn(g_game,5,0x14,&coinPos,&g_vectorZero,(Entity *)0x0,1,uVar4); coin = (Entity_Pickup *)__RTDynamicCast(spawned,uVar14,pTVar15,pTVar16,uVar17); if (coin != (Entity_Pickup *)0x0) { Entity_Pickup::AppearFast(coin); } particleColor._tint[0] = 1.0; particleColor._tint[1] = 1.0; particleColor._tint[2] = 1.0; particleColor._tint[3] = 1.0; particleColor._offset[0] = 0.0; particleColor._offset[1] = 0.0; particleColor._colorize[0] = 0.0; particleColor._colorize[1] = 0.0; particleColor._colorize[2] = 0.0; particleColor._colorize[3] = 0.0; particleColor._offset[2] = 0.0; rngResult = Random(); VStack_74.y = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0; rngResult = Random(); Game::SpawnParticles (g_game,&coinPos,0x5f,rngResult % 3 + 5,VStack_74.y,&particleColor,100000.0,0); rngResult = rngResult - 1; } while (rngResult != 0); bossWave = local_a0; door = savedRoom; } game = g_game; local_5c = 0; g_game->_greedLastPaidWave = (int)bossWave; playerManager = &game->_playerManager; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; if ((int)pvVar6 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (local_5c < (uint)((int)pvVar6 - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_5c; } Entity_Player::spawn_locusts((Entity_Player *)*playerSlot); playerManager = &g_game->_playerManager; local_5c = local_5c + 1; } while (local_5c < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } waveRoom = local_60; *(undefined1 *)door = 0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_64 & 0x1f) ^ uVar4; uVar9 = local_64; local_58 = uVar4; if (door->_gridWidth != local_60->Width + 2) { KAGE_LogMessage(0x10,(byte *)"Greed Mode wave does not match room size\n"); uVar9 = extraout_ECX; } local_68 = 0; if (waveRoom->SpawnCount != 0) { local_5c = 0; pRVar12 = door; do { door = savedRoom; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; iVar7 = pRVar12->_gridWidth; uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_64 & 0x1f) ^ uVar4; uStack_d8 = 0; uStack_d4 = 0; uStack_d0 = 0; uStack_cc = 0; uStack_b8 = 0; uStack_b4 = 0; spawnX = (int)*(short *)(local_5c + (int)local_60->Spawns); iVar5 = (*(short *)(local_5c + 2 + (int)local_60->Spawns) + 1) * iVar7; local_a0 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10; uVar9 = spawnX + iVar5 + 1; fStack_c8 = g_vectorZero.x; fStack_c0 = g_vectorZero.x; fStack_c4 = g_vectorZero.y; fStack_bc = g_vectorZero.y; VStack_74.x = (float)((int)uVar9 % iVar7) * 40.0 + 40.0; VStack_74.y = (float)((int)uVar9 / iVar7) * 40.0 + 120.0; if ((uVar9 < 0x1c0) && (savedRoom->_gridEntities[iVar5 + spawnX + 1] != (int *)0x0)) { (**(code **)(*(int *)savedRoom->_gridEntities[iVar5 + spawnX + 1] + 0x14))(1,&uStack_d8); } piVar1 = *(int **)((int)door->_descriptor + 0x10); if (((piVar1 != (int *)0x0) && (piVar1[2] == 0x10)) && (*piVar1 == 0x23)) goto LAB_00817335; if ((int)uVar9 < 0) { LAB_008172a7: freePos = FindFreePickupSpawnPosition(g_game->_room,&VStack_a8,&VStack_74,0.0,0,0,0); VStack_74.x = freePos->x; VStack_74.y = freePos->y; iVar7 = (int)((VStack_74.x - 40.0) / 40.0 + 0.5); iVar5 = (int)((VStack_74.y - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (door->_gridWidth <= iVar7)) || (iVar5 < 0)) || (door->_gridHeight <= iVar5)) { uVar9 = 0xffffffff; } else { uVar9 = iVar5 * door->_gridWidth + iVar7; } } else if (door->_gridEntities[iVar5 + spawnX + 1] == (void *)0x0) { if ((door->_gridPaths[iVar5 + spawnX + 1] - 3000U < 1000) || (999 < door->_gridPaths[iVar5 + spawnX + 1])) goto LAB_008172a7; } else if (*(int *)((int)door->_gridEntities[iVar5 + spawnX + 1] + 0x3c) != 0) goto LAB_008172a7; LAB_00817335: pvVar6 = (void *)(local_5c + (int)local_60->Spawns); if (*(char *)((int)pvVar6 + 8) != '\0') { pickedEntry = Spawn::PickEntry(pvVar6,local_a0); spawnEntry = *pickedEntry; uStack_48 = *(undefined4 *)(pickedEntry + 1); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; local_78 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; local_7c = local_78 >> ((byte)local_64 & 0x1f); uVar4 = local_7c ^ local_78; TransformEntry(door,&spawnEntry,uVar9,uVar4); if (0 < (int)spawnEntry) { if ((int)spawnEntry < 1000) { rngShiftLeft = (byte)((ulonglong)rngShifts >> 0x20); if ((int)spawnEntry == 999) { spawnEntry = CONCAT44(spawnEntry._4_4_,1000); if (local_7c == local_78) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; uVar4 = uVar4 << (rngShiftLeft & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_64 & 0x1f) ^ uVar4; spawned = Game::Spawn(g_game,1000,spawnEntry._4_4_ & 0xffff,&VStack_74,&g_vectorZero, (Entity *)0x0,spawnEntry._4_4_ >> 0x10,uVar4); (**(code **)(*(int *)spawned + 0xc))(); spawned->_spawnGridIndex = uVar9; door = savedRoom; } else { if (local_7c == local_78) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; uVar4 = uVar4 << (rngShiftLeft & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_64 & 0x1f) ^ uVar4; iVar7 = spawn_enemy_spawner_effect ((int)spawnEntry,spawnEntry._4_2_,&VStack_74,local_64,0, spawnEntry._6_2_,uVar4,local_64,uVar9); game = g_game; *(undefined4 *)(iVar7 + 0x354) = 0x3e9; if ((((game != (Game *)0x0) && (1 < *(int *)&game->_deathmatchManager)) && ((int)spawnEntry == 1)) || ((int)spawnEntry - 10U < 0x3de)) { *(uint *)(iVar7 + 0x16c) = *(uint *)(iVar7 + 0x16c) | 0x80; *(undefined4 *)(iVar7 + 0x168) = *(undefined4 *)(iVar7 + 0x168); } } } else { SpawnEntry(); } } } uVar9 = local_68 + 1; local_5c = local_5c + 0x10; pRVar12 = door; local_68 = uVar9; } while (uVar9 < (ushort)local_60->SpawnCount); local_58 = uVar4; } if (g_game->_difficulty != 3) goto LAB_008177a4; championCandidates = (void *)0x0; championCandidatesEnd = (uint *)0x0; championCandidatesCapacity = (uint *)0x0; fStack_8 = 0.0; FUN_005cbed0(uVar9); uVar9 = extraout_ECX_00 & 0xffffff00; puVar10 = championCandidatesEnd; local_54 = uVar9; if ((door->_entityList)._updateEL._size == 0) { LAB_008176d1: uVar9 = (int)puVar10 - (int)championCandidates >> 2; if (uVar9 != 0) { if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; rngShiftLeft = (byte)((ulonglong)rngShifts >> 0x20); uVar4 = uVar4 << (rngShiftLeft & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_64 & 0x1f) ^ uVar4; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } rngResult = uVar4 >> ((byte)rngShifts & 0x1f) ^ uVar4; rngResult = rngResult << (rngShiftLeft & 0x1f) ^ rngResult; Entity_NPC::MakeChampion (*(Entity_NPC **)((int)championCandidates + (uVar4 % uVar9) * 4), rngResult >> ((byte)local_64 & 0x1f) ^ rngResult,-1,0); } } else { uVar4 = 0; do { piVar1 = *(int **)((int)(door->_entityList)._updateEL._data + uVar4 * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (piVar1[10] != 1)) { iVar7 = piVar1[10]; if ((0x3dd < iVar7 - 10U) || (((iVar7 == 0x21 || (iVar7 == 0x11)) || (iVar7 == 0x124)))) goto LAB_008176b6; if (iVar7 == 0x375) { bVar13 = piVar1[0xb] == 10; } else { if ((iVar7 == 0x3c0) || (iVar7 == 0x3c5)) goto LAB_008176b6; bVar13 = iVar7 == 0xf5; } uVar9 = local_54; if (!bVar13) goto LAB_008175f1; } else { LAB_008175f1: if (*(char *)((int)piVar1 + 0x173) == '\0') { cVar3 = (**(code **)(*piVar1 + 0x4c))(); if ((cVar3 == '\0') && (iVar7 = *(int *)((int)(door->_entityList)._updateEL._data + uVar4 * 4), g_game->_frameCount == *(int *)(iVar7 + 0x328))) { local_5c = __RTDynamicCast(iVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,*(int *)(local_5c + 0x28), *(int *)(local_5c + 0x2c),*(int *)(local_5c + 0x30)); if ((entityConfig != (EntityConfig_Entity *)0x0) && (entityConfig->canBeChampion != 0)) { if (puVar10 == championCandidatesCapacity) { std::vector::_Emplace_reallocate(puVar10,&local_5c); } else { *puVar10 = local_5c; championCandidatesEnd = puVar10 + 1; } local_54 = local_54 & 0xff; if (*(char *)(local_5c + 0xc63) != '\0') { local_54 = 1; } uVar9 = local_54; puVar10 = championCandidatesEnd; goto LAB_008176b9; } } LAB_008176b6: uVar9 = local_54; } } LAB_008176b9: uVar4 = uVar4 + 1; } while (uVar4 < (uint)(door->_entityList)._updateEL._size); uVar4 = local_58; if ((char)uVar9 == '\0') goto LAB_008176d1; } if (championCandidates != (void *)0x0) { uVar4 = (int)championCandidatesCapacity - (int)championCandidates & 0xfffffffc; pvVar6 = championCandidates; if (0xfff < uVar4) { pvVar6 = *(void **)((int)championCandidates + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)championCandidates + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar4); } LAB_008177a4: *(undefined1 *)door = 1; ExceptionList = local_10; return; } //@@ 00817830 Room::render_water /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Unable to use type for symbol room */ /* DB: this=Room: _waterAmount 0x7240, backdrop id 0x1d18, flooded stage ids 4/5/6/0x1b/0x1c, skipped under Curse of Darkness; KAGE_ColorTextureShader (REPENTOGON calls it Backdrop::RenderWater but the this is Room) */ void Room::render_water(void) { code *pcVar1; uint stageId; Vector *pVVar2; undefined4 *puVar3; Vector *pVVar4; Vector *pVVar5; int *piVar6; Vector *topLeft; Room *in_ECX; int iVar7; float *pfVar8; undefined4 *puVar9; double dVar10; undefined1 auStackY_8b4 [128]; byte bVar11; DestinationQuad *color; void *pvVar12; float edgeMargin; Vector local_814; Vector waveScroll; Vector renderOffset; Vector waveRotation; Vector local_7f4; Vector local_7ec; Vector local_7e4; Vector local_7dc; Vector local_7d4; Vector local_7cc; Vector local_7c4; Vector local_7bc; Vector local_7b4; float topLeftY; float topLeftX; Vector local_7a4; float local_79c; float bottomRightY; float bottomRightX; Vector local_790; Vector local_788; Vector local_780; Vector local_778; Vector local_770; Vector local_768; Vector local_760; Vector local_758; Vector local_750; Vector local_748; Vector local_740; Vector local_738; Vector local_730; Vector local_728; Vector local_720; Vector local_718; Vector local_710; Vector local_708; DestinationQuad local_700; undefined4 local_6e0; Vector local_6d0; char isFloodRoom; Vector local_6c4; undefined1 local_6bc [20]; DestinationQuad local_6a8; KColor whiteColorC; KColor whiteColorB [2]; undefined1 tileQuad [112]; undefined1 local_5b4 [112]; undefined1 roomAreaDesc [176]; Color waterColor; float local_468; float fStack_464; float fStack_460; float fStack_45c; float local_458; float fStack_454; float fStack_450; float fStack_44c; undefined4 local_448; float local_444; float fStack_440; float fStack_43c; float fStack_438; float local_434; float fStack_430; float fStack_42c; float fStack_428; undefined4 local_424; float local_420; float fStack_41c; float fStack_418; float fStack_414; float local_410; float fStack_40c; float fStack_408; float fStack_404; undefined4 local_400; float local_3fc; float fStack_3f8; float fStack_3f4; float fStack_3f0; float local_3ec; float fStack_3e8; float fStack_3e4; float fStack_3e0; undefined4 local_3dc; float local_3d8; float fStack_3d4; float fStack_3d0; float fStack_3cc; float local_3c8; float fStack_3c4; float fStack_3c0; float fStack_3bc; undefined4 local_3b8; float local_3b4; float fStack_3b0; float fStack_3ac; float fStack_3a8; float local_3a4; float fStack_3a0; float fStack_39c; float fStack_398; undefined4 local_394; float local_390; float fStack_38c; float fStack_388; float fStack_384; float local_380; float fStack_37c; float fStack_378; float fStack_374; undefined4 local_370; float local_36c; float fStack_368; float fStack_364; float fStack_360; float local_35c; float fStack_358; float fStack_354; float fStack_350; undefined4 local_34c; float local_348; float fStack_344; float fStack_340; float fStack_33c; float local_338; float fStack_334; float fStack_330; float fStack_32c; undefined4 local_328; float local_324; float fStack_320; float fStack_31c; float fStack_318; float local_314; float fStack_310; float fStack_30c; float fStack_308; undefined4 local_304; float local_300; float fStack_2fc; float fStack_2f8; float fStack_2f4; float local_2f0; float fStack_2ec; float fStack_2e8; float fStack_2e4; undefined4 local_2e0; float local_2dc; float fStack_2d8; float fStack_2d4; float fStack_2d0; float local_2cc; float fStack_2c8; float fStack_2c4; float fStack_2c0; undefined4 local_2bc; undefined4 edgeQuad0 [28]; undefined4 edgeQuad1 [28]; undefined4 edgeQuad2 [28]; undefined4 edgeQuad3 [28]; undefined4 edgeQuad4 [28]; undefined4 edgeQuad5 [29]; uint stackCookie; float room; stackCookie = __security_cookie ^ (uint)&edgeMargin; local_7dc.x = (float)in_ECX; stageId = Game::GetStageID(g_game,0); if (in_ECX->_gridPaths[in_ECX->_backdropType * 0x4f + 0x585] == 0) { return; } if (((((stageId == 4) || (stageId == 5)) || (stageId == 6)) || ((stageId == 0x1b || (stageId == 0x1c)))) && ((-1 < *(int *)((int)in_ECX->_descriptor + 0x54) && ((*(uint *)((int)in_ECX->_descriptor + 0x44) >> 5 & 1) != 0)))) { isFloodRoom = '\x01'; } else { isFloodRoom = '\0'; } if ((in_ECX->_waterAmount <= 0.0) && (isFloodRoom == '\0')) { return; } bottomRightX = (in_ECX->_bottomRightPos).x; topLeftX = (in_ECX->_topLeftPos).x; renderOffset.x = (g_game->_screenShakeOffset).x + (in_ECX->_renderScrollOffset).x; renderOffset.y = (g_game->_screenShakeOffset).y + (in_ECX->_renderScrollOffset).y; topLeftY = (in_ECX->_topLeftPos).y; bottomRightY = (in_ECX->_bottomRightPos).y; local_708.x = bottomRightY - topLeftY; local_79c = bottomRightX - topLeftX; local_7ec.x = local_79c + local_79c + local_708.x + local_708.x; local_7f4.x = (float)((double)*(int *)(DAT_00c797c4 + 0x10) + __uint_to_double_fixup[-(*(int *)(DAT_00c797c4 + 0x10) >> 0x1f)]); local_814.x = local_7ec.x / local_7f4.x + 0.5; dVar10 = floor((double)local_814.x); local_7b4.x = ((float)dVar10 * local_7f4.x) / local_7ec.x; local_778.x = local_7b4.x * local_708.x; edgeMargin = local_7b4.x * 50.0; local_7b4.x = local_7b4.x * local_79c; local_7ec.x = *(float *)&in_ECX->field_0x1b70; local_7f4.x = *(float *)&in_ECX->field_0x1b74; local_814.x = *(float *)&in_ECX->field_0x1b78; Color::Reset(&waterColor); Color::SetTint(&waterColor,local_7ec.x,local_7f4.x,local_814.x,1.0); if (in_ECX->_backdropType == 0x2c) { waterColor._tint[0] = 1.0; waterColor._tint[1] = 0.3; waterColor._tint[2] = 0.3; } if (isFloodRoom == '\0') { waterColor._tint[3] = 0.0; } else { waterColor._tint[3] = (float)*(int *)((int)in_ECX->_descriptor + 0x54) / 30.0; if (waterColor._tint[3] <= 0.0) { waterColor._tint[3] = 0.0; } if (1.0 <= waterColor._tint[3]) { waterColor._tint[3] = 1.0; } } if (0.0 < in_ECX->_waterAmount) { waterColor._tint[3] = waterColor._tint[3] + (1.0 - waterColor._tint[3]) * in_ECX->_waterAmount; } waveRotation.x = (float)g_game->_frameCount * 0.01; waveScroll.x = (float)g_game->_frameCount * 0.5; local_7a4.x = waveScroll.x * 0.1; shader_cache_find(0xb1a5b0); if (3 < *(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 0x48) - 9U) { local_7f4.x = local_7a4.x + edgeMargin; local_814.x = waveScroll.x + local_778.x; FUN_00a110e0(); local_7ec.x = local_7b4.x + local_778.x; FUN_00a110e0(); local_7e4.x = local_778.x + local_778.x; local_7dc.x = local_7e4.x + local_7b4.x; FUN_00a110e0(); local_814.x = local_7b4.x + local_7b4.x + local_7e4.x; FUN_00a110e0(); pVVar2 = Vector::Vector(&local_6c4,local_778.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6d0,waveRotation.x); pVVar4 = Vector::Vector(&local_750,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_758,pVVar4); pVVar2 = Vector::Vector(&local_710,0.0,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_718,waveRotation.x); pVVar4 = Vector::Vector(&local_720,waveScroll.x,0.0); local_7e4.x = (float)Vector::__add(pVVar2,&local_728,pVVar4); pVVar2 = Vector::Vector(&local_730,local_778.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_738,waveRotation.x); pVVar4 = Vector::Vector(&local_740,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_748,pVVar4); pVVar4 = Vector::Vector(&local_780,0.0,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_770,waveRotation.x); pVVar5 = Vector::Vector(&local_768,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_760,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7e4.x); pVVar2 = Vector::Vector(&local_7d4,local_7ec.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6c4,waveRotation.x); pVVar4 = Vector::Vector(&local_6d0,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_750,pVVar4); pVVar2 = Vector::Vector(&local_758,local_778.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_710,waveRotation.x); pVVar4 = Vector::Vector(&local_718,waveScroll.x,0.0); local_7e4.x = (float)Vector::__add(pVVar2,&local_720,pVVar4); pVVar2 = Vector::Vector(&local_728,local_7ec.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_730,waveRotation.x); pVVar4 = Vector::Vector(&local_738,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_740,pVVar4); pVVar4 = Vector::Vector(&local_748,local_778.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_780,waveRotation.x); pVVar5 = Vector::Vector(&local_770,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_768,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7e4.x); pVVar2 = Vector::Vector(&local_7cc,local_7dc.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6c4,waveRotation.x); pVVar4 = Vector::Vector(&local_6d0,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_750,pVVar4); pVVar2 = Vector::Vector(&local_758,local_7ec.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_710,waveRotation.x); pVVar4 = Vector::Vector(&local_718,waveScroll.x,0.0); local_7e4.x = (float)Vector::__add(pVVar2,&local_720,pVVar4); pVVar2 = Vector::Vector(&local_728,local_7dc.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_730,waveRotation.x); pVVar4 = Vector::Vector(&local_738,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_740,pVVar4); pVVar4 = Vector::Vector(&local_748,local_7ec.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_780,waveRotation.x); pVVar5 = Vector::Vector(&local_770,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_768,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7e4.x); pVVar2 = Vector::Vector(&local_7bc,local_814.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6c4,waveRotation.x); pVVar4 = Vector::Vector(&local_6d0,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_750,pVVar4); pVVar2 = Vector::Vector(&local_758,local_7dc.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_710,waveRotation.x); pVVar4 = Vector::Vector(&local_718,waveScroll.x,0.0); local_7ec.x = (float)Vector::__add(pVVar2,&local_720,pVVar4); pVVar2 = Vector::Vector(&local_728,local_814.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_730,waveRotation.x); pVVar4 = Vector::Vector(&local_738,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_740,pVVar4); pVVar4 = Vector::Vector(&local_748,local_7dc.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_780,waveRotation.x); pVVar5 = Vector::Vector(&local_770,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_768,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7ec.x); KColor::SetFromARGB((KColor *)&local_700,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,topLeftX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); local_7f4.x = topLeftY - edgeMargin; local_7ec.x = topLeftX - edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7ec.x,local_7f4.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); local_7dc.x = bottomRightY + edgeMargin; bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7ec.x,local_7dc.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors (edgeQuad0,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)&local_700); KColor::SetFromARGB(whiteColorB,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,bottomRightX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); local_7e4.x = bottomRightX + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7e4.x,local_7f4.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7ec.x,local_7f4.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors(edgeQuad1,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,whiteColorB); KColor::SetFromARGB(&whiteColorC,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,bottomRightX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,bottomRightX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7e4.x,local_7dc.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7e4.x,local_7f4.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors(edgeQuad2,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,&whiteColorC); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,topLeftX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,bottomRightX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar4 = Vector::__add(pVVar2,&local_718,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_720,local_7ec.x,local_7dc.x); pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar11); pVVar5 = Vector::__add(pVVar2,&local_730,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_738,local_7e4.x,local_7dc.x); pVVar2 = Isaac::GetRenderPosition(&local_740,pVVar2,bVar11); topLeft = Vector::__add(pVVar2,&local_748,&renderOffset); pVVar2 = (Vector *)local_814.x; set_quad_corner_colors (edgeQuad3,topLeft,pVVar5,pVVar4,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); pvVar12 = (void *)0x81de65; FUN_00682260(); KAGE::SmartPointer::operator_assign(auStackY_8b4 + 0x8c,&DAT_00c797c4); apply_sprite_shader_params((ColorMod *)&waterColor,1,pVVar2,pvVar12); local_7ec.x = (float)&local_468; local_7f4.x = 0.0; do { piVar6 = (int *)EntityPtr::Ref(); pcVar1 = *(code **)(*piVar6 + 0x14); FUN_00407220(); (*pcVar1)(local_7ec.x); local_7ec.x = (float)((int)local_7ec.x + 0x24); local_7f4.x = (float)((int)local_7f4.x + 1); } while ((int)local_7f4.x < 8); goto LAB_0081deea; } GetLRoomAreaDesc(in_ECX,roomAreaDesc); pfVar8 = &local_468; local_814.x = 1.68156e-44; do { local_814.x = (float)((int)&((Vector *)((int)local_814.x + -8))->y + 3); FUN_00a10690(); *(undefined1 *)(pfVar8 + 8) = 0; pfVar8 = pfVar8 + 9; } while ((Vector *)local_814.x != (Vector *)0x0); puVar3 = edgeQuad0; iVar7 = 6; do { KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); pVVar2 = (Vector *)0x817bbd; ColorQuad::ColorQuad(puVar3,(KColor *)local_6bc); room = local_7dc.x; puVar3 = puVar3 + 0x1c; iVar7 = iVar7 + -1; } while (iVar7 != 0); if ((*(void **)((int)local_7dc.x + 4) == (void *)0x0) || (iVar7 = *(int *)((int)*(void **)((int)local_7dc.x + 4) + 0x10), iVar7 == 0)) { LAB_0081a975: iVar7 = GetRoomShape((Room *)local_7dc.x); if (iVar7 == 0xb) { local_790.x = local_778.x * 0.5; local_7c4.x = local_7a4.x + edgeMargin; local_814.x = local_790.x + waveScroll.x; FUN_00a110e0(); FUN_00a112a0(); local_7dc.x = local_790.x + local_7b4.x; FUN_00a110e0(); FUN_00a112a0(); local_814.x = local_778.x * 1.5; local_7e4.x = local_814.x + local_7b4.x; local_7ec.x = waveScroll.x + local_7b4.x; FUN_00a110e0(); FUN_00a112a0(); local_7f4.x = local_7b4.x * 1.5; local_788.x = local_7f4.x + local_814.x; FUN_00a110e0(); FUN_00a112a0(); local_778.x = local_778.x + local_778.x; local_7ec.x = local_7f4.x + local_778.x; local_7f4.x = local_7f4.x + waveScroll.x; FUN_00a110e0(); FUN_00a112a0(); local_7b4.x = local_7b4.x + local_7b4.x + local_778.x; FUN_00a110e0(); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_750,local_790.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_758,waveRotation.x); pVVar4 = Vector::Vector(&local_710,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_718,pVVar4); pVVar2 = Vector::Vector(&local_720,0.0,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_728,waveRotation.x); pVVar4 = Vector::Vector(&local_730,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_738,pVVar4); pVVar2 = Vector::Vector(&local_740,local_790.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_748,waveRotation.x); pVVar4 = Vector::Vector(&local_780,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_770,pVVar4); pVVar4 = Vector::Vector(&local_768,0.0,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_760,waveRotation.x); pVVar5 = Vector::Vector(&local_7d4,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7cc,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_750,local_7dc.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_758,waveRotation.x); pVVar4 = Vector::Vector(&local_710,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_718,pVVar4); pVVar2 = Vector::Vector(&local_720,local_790.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_728,waveRotation.x); pVVar4 = Vector::Vector(&local_730,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_738,pVVar4); pVVar2 = Vector::Vector(&local_740,local_7dc.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_748,waveRotation.x); pVVar4 = Vector::Vector(&local_780,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_770,pVVar4); pVVar4 = Vector::Vector(&local_768,local_790.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_760,waveRotation.x); pVVar5 = Vector::Vector(&local_7d4,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7cc,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_750,local_7e4.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_758,waveRotation.x); pVVar4 = Vector::Vector(&local_710,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_718,pVVar4); pVVar2 = Vector::Vector(&local_720,local_7dc.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_728,waveRotation.x); pVVar4 = Vector::Vector(&local_730,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_738,pVVar4); pVVar2 = Vector::Vector(&local_740,local_7e4.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_748,waveRotation.x); pVVar4 = Vector::Vector(&local_780,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_770,pVVar4); pVVar4 = Vector::Vector(&local_768,local_7dc.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_760,waveRotation.x); pVVar5 = Vector::Vector(&local_7d4,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7cc,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_7bc,local_788.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_750,waveRotation.x); pVVar4 = Vector::Vector(&local_758,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_710,pVVar4); pVVar2 = Vector::Vector(&local_718,local_7e4.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_720,waveRotation.x); pVVar4 = Vector::Vector(&local_728,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_730,pVVar4); pVVar2 = Vector::Vector(&local_738,local_788.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_740,waveRotation.x); pVVar4 = Vector::Vector(&local_748,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_780,pVVar4); pVVar4 = Vector::Vector(&local_770,local_7e4.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_768,waveRotation.x); pVVar5 = Vector::Vector(&local_760,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7d4,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_7a4,local_7ec.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_750,waveRotation.x); pVVar4 = Vector::Vector(&local_758,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_710,pVVar4); pVVar2 = Vector::Vector(&local_718,local_788.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_720,waveRotation.x); pVVar4 = Vector::Vector(&local_728,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_730,pVVar4); pVVar2 = Vector::Vector(&local_738,local_7ec.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_740,waveRotation.x); pVVar4 = Vector::Vector(&local_748,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_780,pVVar4); pVVar4 = Vector::Vector(&local_770,local_788.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_768,waveRotation.x); pVVar5 = Vector::Vector(&local_760,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7d4,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_6d0,local_7b4.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_750,waveRotation.x); pVVar4 = Vector::Vector(&local_758,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_710,pVVar4); pVVar2 = Vector::Vector(&local_718,local_7ec.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_720,waveRotation.x); pVVar4 = Vector::Vector(&local_728,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_730,pVVar4); pVVar2 = Vector::Vector(&local_738,local_7b4.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_740,waveRotation.x); pVVar4 = Vector::Vector(&local_748,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_780,pVVar4); pVVar4 = Vector::Vector(&local_770,local_7ec.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_768,waveRotation.x); pVVar5 = Vector::Vector(&local_760,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7d4,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6d0,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_750,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_758,&renderOffset); local_708.x = local_708.x * 0.5 + topLeftY; bVar11 = 1; pVVar2 = Vector::Vector(&local_710,topLeftX,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_718,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_720,&renderOffset); local_7f4.x = topLeftY - edgeMargin; local_7e4.x = topLeftX - edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_728,local_7e4.x,local_7f4.x); pVVar4 = Isaac::GetRenderPosition(&local_730,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_738,&renderOffset); local_788.x = local_708.x + edgeMargin; bVar11 = 1; pVVar5 = Vector::Vector(&local_740,local_7e4.x,local_788.x); pVVar5 = Isaac::GetRenderPosition(&local_748,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_780,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); FUN_00a11060(); KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6d0,bottomRightX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_750,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_758,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_710,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_718,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_720,&renderOffset); local_7ec.x = bottomRightX + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_728,local_7ec.x,local_7f4.x); pVVar4 = Isaac::GetRenderPosition(&local_730,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_738,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_740,local_7e4.x,local_7f4.x); pVVar5 = Isaac::GetRenderPosition(&local_748,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_780,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)local_6bc); FUN_00a11060(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_770,bottomRightX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_768,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_760,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_7d4,bottomRightX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_7cc,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_7bc,&renderOffset); local_7dc.x = bottomRightY + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_7c4,local_7ec.x,local_7dc.x); pVVar4 = Isaac::GetRenderPosition(&local_790,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_7b4,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_7a4,local_7ec.x,local_7f4.x); pVVar5 = Isaac::GetRenderPosition(&local_778,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&waveRotation,&renderOffset); set_quad_corner_colors (local_5b4,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); FUN_00a11060(); KColor::SetFromARGB(&whiteColorC,0xffffffff); local_79c = local_79c * 0.5 + topLeftX; bVar11 = 1; pVVar2 = Vector::Vector(&local_6d0,local_79c,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_750,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_758,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_710,bottomRightX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_718,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_720,&renderOffset); local_7f4.x = local_79c - edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_728,local_7f4.x,local_7dc.x); pVVar4 = Isaac::GetRenderPosition(&local_730,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_738,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_740,local_7ec.x,local_7dc.x); pVVar5 = Isaac::GetRenderPosition(&local_748,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_780,&renderOffset); set_quad_corner_colors(tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,&whiteColorC); FUN_00a11060(); KColor::SetFromARGB(whiteColorB,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6d0,local_79c,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_750,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_758,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_710,local_79c,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_718,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_720,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_728,local_7f4.x,local_788.x); pVVar4 = Isaac::GetRenderPosition(&local_730,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_738,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_740,local_7f4.x,local_7dc.x); pVVar5 = Isaac::GetRenderPosition(&local_748,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_780,&renderOffset); set_quad_corner_colors(tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,whiteColorB); FUN_00a11060(); KColor::SetFromARGB((KColor *)&local_700,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6d0,topLeftX,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_750,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_758,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_710,local_79c,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_718,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_720,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_728,local_7e4.x,local_788.x); pVVar4 = Isaac::GetRenderPosition(&local_730,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_738,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_740,local_7f4.x,local_788.x); pVVar5 = Isaac::GetRenderPosition(&local_748,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_780,&renderOffset); color = &local_700; } else { iVar7 = GetRoomShape((Room *)room); if (iVar7 != 0xc) goto LAB_0081d167; local_7c4.x = local_7a4.x + edgeMargin; local_814.x = waveScroll.x + local_778.x; FUN_00a110e0(); FUN_00a112a0(); local_7ec.x = local_7b4.x + local_778.x; FUN_00a110e0(); FUN_00a112a0(); local_814.x = local_778.x * 1.5; local_7dc.x = local_814.x + local_7b4.x; local_788.x = waveScroll.x + local_7b4.x; FUN_00a110e0(); FUN_00a112a0(); local_7f4.x = local_7b4.x * 1.5; local_7e4.x = local_7f4.x + local_814.x; FUN_00a110e0(); FUN_00a112a0(); local_790.x = local_778.x + local_778.x; local_788.x = local_7f4.x + local_790.x; local_7f4.x = local_7f4.x + waveScroll.x; FUN_00a110e0(); FUN_00a112a0(); local_7b4.x = local_7b4.x + local_7b4.x + local_790.x; FUN_00a110e0(); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_6d0,local_778.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_750,waveRotation.x); pVVar4 = Vector::Vector(&local_758,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_710,pVVar4); pVVar2 = Vector::Vector(&local_718,0.0,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_720,waveRotation.x); pVVar4 = Vector::Vector(&local_728,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_730,pVVar4); pVVar2 = Vector::Vector(&local_738,local_778.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_740,waveRotation.x); pVVar4 = Vector::Vector(&local_748,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_780,pVVar4); pVVar4 = Vector::Vector(&local_770,0.0,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_768,waveRotation.x); pVVar5 = Vector::Vector(&local_760,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_7d4,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_7cc,local_7ec.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6d0,waveRotation.x); pVVar4 = Vector::Vector(&local_750,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_758,pVVar4); pVVar2 = Vector::Vector(&local_710,local_778.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_718,waveRotation.x); pVVar4 = Vector::Vector(&local_720,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_728,pVVar4); pVVar2 = Vector::Vector(&local_730,local_7ec.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_738,waveRotation.x); pVVar4 = Vector::Vector(&local_740,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_748,pVVar4); pVVar4 = Vector::Vector(&local_780,local_778.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_770,waveRotation.x); pVVar5 = Vector::Vector(&local_768,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_760,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_7bc,local_7dc.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6d0,waveRotation.x); pVVar4 = Vector::Vector(&local_750,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_758,pVVar4); pVVar2 = Vector::Vector(&local_710,local_7ec.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_718,waveRotation.x); pVVar4 = Vector::Vector(&local_720,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_728,pVVar4); pVVar2 = Vector::Vector(&local_730,local_7dc.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_738,waveRotation.x); pVVar4 = Vector::Vector(&local_740,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_748,pVVar4); pVVar4 = Vector::Vector(&local_780,local_7ec.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_770,waveRotation.x); pVVar5 = Vector::Vector(&local_768,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_760,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_7a4,local_7e4.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6d0,waveRotation.x); pVVar4 = Vector::Vector(&local_750,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_758,pVVar4); pVVar2 = Vector::Vector(&local_710,local_7dc.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_718,waveRotation.x); pVVar4 = Vector::Vector(&local_720,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_728,pVVar4); pVVar2 = Vector::Vector(&local_730,local_7e4.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_738,waveRotation.x); pVVar4 = Vector::Vector(&local_740,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_748,pVVar4); pVVar4 = Vector::Vector(&local_780,local_7dc.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_770,waveRotation.x); pVVar5 = Vector::Vector(&local_768,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_760,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_778,local_788.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6d0,waveRotation.x); pVVar4 = Vector::Vector(&local_750,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_758,pVVar4); pVVar2 = Vector::Vector(&local_710,local_7e4.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_718,waveRotation.x); pVVar4 = Vector::Vector(&local_720,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_728,pVVar4); pVVar2 = Vector::Vector(&local_730,local_788.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_738,waveRotation.x); pVVar4 = Vector::Vector(&local_740,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_748,pVVar4); pVVar4 = Vector::Vector(&local_780,local_7e4.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_770,waveRotation.x); pVVar5 = Vector::Vector(&local_768,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_760,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); pVVar2 = Vector::Vector(&local_6c4,local_7b4.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_6d0,waveRotation.x); pVVar4 = Vector::Vector(&local_750,waveScroll.x,0.0); local_814.x = (float)Vector::__add(pVVar2,&local_758,pVVar4); pVVar2 = Vector::Vector(&local_710,local_788.x,edgeMargin); pVVar2 = Vector::Rotated(pVVar2,&local_718,waveRotation.x); pVVar4 = Vector::Vector(&local_720,waveScroll.x,0.0); local_7f4.x = (float)Vector::__add(pVVar2,&local_728,pVVar4); pVVar2 = Vector::Vector(&local_730,local_7b4.x,0.0); pVVar2 = Vector::Rotated(pVVar2,&local_738,waveRotation.x); pVVar4 = Vector::Vector(&local_740,waveScroll.x,0.0); pVVar2 = Vector::__add(pVVar2,&local_748,pVVar4); pVVar4 = Vector::Vector(&local_780,local_788.x,0.0); pVVar4 = Vector::Rotated(pVVar4,&local_770,waveRotation.x); pVVar5 = Vector::Vector(&local_768,waveScroll.x,0.0); pVVar4 = Vector::__add(pVVar4,&local_760,pVVar5); FUN_00a11130(pVVar4,pVVar2,local_7f4.x); FUN_00a112a0(); KColor::SetFromARGB((KColor *)&local_700,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,topLeftX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); local_7f4.x = topLeftY - edgeMargin; local_7e4.x = topLeftX - edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7e4.x,local_7f4.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); local_788.x = bottomRightY + edgeMargin; bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7e4.x,local_788.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)&local_700); FUN_00a11060(); KColor::SetFromARGB(whiteColorB,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,bottomRightX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); local_7ec.x = bottomRightX + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7ec.x,local_7f4.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7e4.x,local_7f4.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors(tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,whiteColorB); FUN_00a11060(); KColor::SetFromARGB((KColor *)&local_700,0xffffffff); local_708.x = local_708.x * 0.5 + topLeftY; bVar11 = 1; pVVar2 = Vector::Vector(&local_780,bottomRightX,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_770,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_768,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_760,bottomRightX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_7d4,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_7cc,&renderOffset); local_7dc.x = local_708.x + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_7bc,local_7ec.x,local_7dc.x); pVVar4 = Isaac::GetRenderPosition(&local_7c4,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_790,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_7b4,local_7ec.x,local_7f4.x); pVVar5 = Isaac::GetRenderPosition(&local_7a4,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_778,&renderOffset); set_quad_corner_colors (local_5b4,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)&local_700); FUN_00a11060(); KColor::SetFromARGB(&whiteColorC,0xffffffff); local_79c = local_79c * 0.5 + topLeftX; bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,local_79c,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,bottomRightX,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); local_7f4.x = local_79c + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7f4.x,local_7dc.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7ec.x,local_7dc.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors(tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,&whiteColorC); FUN_00a11060(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,local_79c,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,local_79c,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7f4.x,local_788.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7f4.x,local_7dc.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); FUN_00a11060(); KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_6c4,topLeftX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_6d0,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_750,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_758,local_79c,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_710,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_718,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_720,local_7e4.x,local_788.x); pVVar4 = Isaac::GetRenderPosition(&local_728,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_730,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_738,local_7f4.x,local_788.x); pVVar5 = Isaac::GetRenderPosition(&local_740,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_748,&renderOffset); color = (DestinationQuad *)local_6bc; } LAB_0081d14b: set_quad_corner_colors(tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)color); pVVar2 = (Vector *)0x81d167; FUN_00a11060(); } else { if (*(int *)(iVar7 + 0x48) != 9) { if (*(int *)(iVar7 + 0x48) != 10) goto LAB_0081a975; local_7c4.x = local_7a4.x + edgeMargin; local_814.x = waveScroll.x + local_778.x; FUN_00a10690(); local_468 = local_700._topLeft.x; fStack_464 = local_700._topLeft.y; fStack_460 = local_700._topRight.x; fStack_45c = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_448 = local_6e0; local_458 = local_700._bottomLeft.x; fStack_454 = local_700._bottomLeft.y; fStack_450 = local_700._bottomRight.x; fStack_44c = local_700._bottomRight.y; local_7ec.x = local_7b4.x * 0.5; local_7dc.x = local_7ec.x + local_778.x; FUN_00a10690(); local_444 = local_700._topLeft.x; fStack_440 = local_700._topLeft.y; fStack_43c = local_700._topRight.x; fStack_438 = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_434 = local_700._bottomLeft.x; fStack_430 = local_700._bottomLeft.y; fStack_42c = local_700._bottomRight.x; fStack_428 = local_700._bottomRight.y; local_424 = local_6e0; local_7f4.x = local_778.x * 1.5; local_7e4.x = local_7f4.x + local_7ec.x; local_7ec.x = local_7ec.x + waveScroll.x; FUN_00a10690(); local_788.x = local_7f4.x + local_7b4.x; local_420 = local_700._topLeft.x; fStack_41c = local_700._topLeft.y; fStack_418 = local_700._topRight.x; fStack_414 = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_410 = local_700._bottomLeft.x; fStack_40c = local_700._bottomLeft.y; fStack_408 = local_700._bottomRight.x; fStack_404 = local_700._bottomRight.y; local_400 = local_6e0; FUN_00a10690(); local_3fc = local_700._topLeft.x; fStack_3f8 = local_700._topLeft.y; fStack_3f4 = local_700._topRight.x; fStack_3f0 = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_3dc = local_6e0; local_3ec = local_700._bottomLeft.x; fStack_3e8 = local_700._bottomLeft.y; fStack_3e4 = local_700._bottomRight.x; fStack_3e0 = local_700._bottomRight.y; local_814.x = local_778.x + local_778.x; local_790.x = local_814.x + local_7b4.x; FUN_00a10690(); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_3b8 = local_6e0; local_3d8 = local_700._topLeft.x; fStack_3d4 = local_700._topLeft.y; fStack_3d0 = local_700._topRight.x; fStack_3cc = local_700._topRight.y; local_7f4.x = local_7b4.x + local_7b4.x + local_814.x; local_3c8 = local_700._bottomLeft.x; fStack_3c4 = local_700._bottomLeft.y; fStack_3c0 = local_700._bottomRight.x; fStack_3bc = local_700._bottomRight.y; FUN_00a10690(); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_3b4 = local_700._topLeft.x; fStack_3b0 = local_700._topLeft.y; fStack_3ac = local_700._topRight.x; fStack_3a8 = local_700._topRight.y; local_394 = local_6e0; local_3a4 = local_700._bottomLeft.x; fStack_3a0 = local_700._bottomLeft.y; fStack_39c = local_700._bottomRight.x; fStack_398 = local_700._bottomRight.y; local_7d4.x = local_778.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = 0.0; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_778.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7b4.y = pVVar2->y + 0.0; local_7b4.x = waveScroll.x + pVVar2->x; local_814.x = 0.0; local_814.y = 0.0; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7a4.y = pVVar2->y + 0.0; local_7a4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7a4,&local_7b4,&local_7c4,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_390 = local_700._topLeft.x; fStack_38c = local_700._topLeft.y; fStack_388 = local_700._topRight.x; fStack_384 = local_700._topRight.y; local_370 = local_6e0; local_380 = local_700._bottomLeft.x; fStack_37c = local_700._bottomLeft.y; fStack_378 = local_700._bottomRight.x; fStack_374 = local_700._bottomRight.y; local_7d4.x = local_7dc.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_778.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_7dc.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7b4.y = pVVar2->y + 0.0; local_7b4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_778.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7a4.y = pVVar2->y + 0.0; local_7a4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7a4,&local_7b4,&local_7c4,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_36c = local_700._topLeft.x; fStack_368 = local_700._topLeft.y; fStack_364 = local_700._topRight.x; fStack_360 = local_700._topRight.y; local_34c = local_6e0; local_35c = local_700._bottomLeft.x; fStack_358 = local_700._bottomLeft.y; fStack_354 = local_700._bottomRight.x; fStack_350 = local_700._bottomRight.y; local_7d4.x = local_7e4.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_7dc.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_7e4.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7b4.y = pVVar2->y + 0.0; local_7b4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_7dc.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7a4.y = pVVar2->y + 0.0; local_7a4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7a4,&local_7b4,&local_7c4,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_348 = local_700._topLeft.x; fStack_344 = local_700._topLeft.y; fStack_340 = local_700._topRight.x; fStack_33c = local_700._topRight.y; local_328 = local_6e0; local_338 = local_700._bottomLeft.x; fStack_334 = local_700._bottomLeft.y; fStack_330 = local_700._bottomRight.x; fStack_32c = local_700._bottomRight.y; local_7d4.x = local_788.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_7e4.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7dc.y = pVVar2->y + 0.0; local_7dc.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_788.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_7e4.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7b4.y = pVVar2->y + 0.0; local_7b4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7b4,&local_7c4,&local_7dc,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_324 = local_700._topLeft.x; fStack_320 = local_700._topLeft.y; fStack_31c = local_700._topRight.x; fStack_318 = local_700._topRight.y; local_304 = local_6e0; local_314 = local_700._bottomLeft.x; fStack_310 = local_700._bottomLeft.y; fStack_30c = local_700._bottomRight.x; fStack_308 = local_700._bottomRight.y; local_7d4.x = local_790.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_788.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7dc.y = pVVar2->y + 0.0; local_7dc.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_790.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7e4.y = pVVar2->y + 0.0; local_7e4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_788.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7c4,&local_7e4,&local_7dc,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_300 = local_700._topLeft.x; fStack_2fc = local_700._topLeft.y; fStack_2f8 = local_700._topRight.x; fStack_2f4 = local_700._topRight.y; local_2f0 = local_700._bottomLeft.x; fStack_2ec = local_700._bottomLeft.y; fStack_2e8 = local_700._bottomRight.x; fStack_2e4 = local_700._bottomRight.y; local_7d4.x = local_7f4.x; local_7d4.y = edgeMargin; local_2e0 = local_6e0; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_790.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7dc.y = pVVar2->y + 0.0; local_7dc.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_7f4.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7e4.y = pVVar2->y + 0.0; local_7e4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_790.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_788.y = pVVar2->y + 0.0; local_788.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_788,&local_7e4,&local_7dc,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_2dc = local_700._topLeft.x; fStack_2d8 = local_700._topLeft.y; fStack_2d4 = local_700._topRight.x; fStack_2d0 = local_700._topRight.y; local_2bc = local_6e0; local_2cc = local_700._bottomLeft.x; fStack_2c8 = local_700._bottomLeft.y; fStack_2c4 = local_700._bottomRight.x; fStack_2c0 = local_700._bottomRight.y; KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = topLeftX; local_7d4.y = topLeftY; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.x = topLeftX; local_7cc.y = bottomRightY; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_7dc.x = renderOffset.x + pVVar2->x; local_7dc.y = renderOffset.y + pVVar2->y; local_7bc.x = topLeftX - edgeMargin; local_7ec.x = topLeftY - edgeMargin; local_7bc.y = local_7ec.x; local_788.x = local_7bc.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_7e4.x = renderOffset.x + pVVar2->x; local_7e4.y = renderOffset.y + pVVar2->y; local_814.x = local_788.x; local_814.y = bottomRightY + edgeMargin; local_7c4.x = local_814.y; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_790.y = renderOffset.y + pVVar2->y; local_790.x = renderOffset.x + pVVar2->x; puVar3 = set_quad_corner_colors (local_5b4,&local_790,&local_7e4,&local_7dc,&local_7f4,(KColor *)local_6bc) ; puVar9 = edgeQuad0; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = local_79c * 0.5 + topLeftX; local_7d4.y = topLeftY; local_79c = local_7d4.x; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_814.x = (float)Vector::__add(pVVar2,&local_770,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_768,topLeftX,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_760,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_7cc,&renderOffset); local_7dc.x = local_79c + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_7bc,local_7dc.x,local_7ec.x); pVVar4 = Isaac::GetRenderPosition(&local_7f4,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_790,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_7b4,local_788.x,local_7ec.x); pVVar5 = Isaac::GetRenderPosition(&local_7a4,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_778,&renderOffset); set_quad_corner_colors (local_5b4,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)local_6bc); FUN_00a11060(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); local_708.x = local_708.x * 0.5 + topLeftY; bVar11 = 1; pVVar2 = Vector::Vector(&waveRotation,local_79c,local_708.x); pVVar2 = Isaac::GetRenderPosition(&waveScroll,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_748,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_740,local_79c,topLeftY); pVVar2 = Isaac::GetRenderPosition(&local_738,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_730,&renderOffset); local_7e4.x = local_708.x - edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_728,local_7dc.x,local_7e4.x); pVVar4 = Isaac::GetRenderPosition(&local_720,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_718,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_710,local_7dc.x,local_7ec.x); pVVar5 = Isaac::GetRenderPosition(&local_758,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_750,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); FUN_00a11060(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_750,bottomRightX,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_758,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_710,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_718,local_79c,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_720,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_728,&renderOffset); local_7ec.x = bottomRightX + edgeMargin; bVar11 = 1; pVVar4 = Vector::Vector(&local_730,local_7ec.x,local_7e4.x); pVVar4 = Isaac::GetRenderPosition(&local_738,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_740,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_748,local_7dc.x,local_7e4.x); pVVar5 = Isaac::GetRenderPosition(&local_780,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_770,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); FUN_00a11060(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_750,bottomRightX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_758,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_710,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_718,bottomRightX,local_708.x); pVVar2 = Isaac::GetRenderPosition(&local_720,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_728,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_730,local_7ec.x,local_7c4.x); pVVar4 = Isaac::GetRenderPosition(&local_738,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_740,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_748,local_7ec.x,local_7e4.x); pVVar5 = Isaac::GetRenderPosition(&local_780,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_770,&renderOffset); set_quad_corner_colors (tileQuad,pVVar5,pVVar4,pVVar2,(Vector *)local_814.x,(KColor *)(local_6bc + 0x14)); FUN_00a11060(); KColor::SetFromARGB((KColor *)(local_6bc + 0x14),0xffffffff); bVar11 = 1; pVVar2 = Vector::Vector(&local_750,topLeftX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_758,pVVar2,bVar11); local_814.x = (float)Vector::__add(pVVar2,&local_710,&renderOffset); bVar11 = 1; pVVar2 = Vector::Vector(&local_718,bottomRightX,bottomRightY); pVVar2 = Isaac::GetRenderPosition(&local_720,pVVar2,bVar11); pVVar2 = Vector::__add(pVVar2,&local_728,&renderOffset); bVar11 = 1; pVVar4 = Vector::Vector(&local_730,local_788.x,local_7c4.x); pVVar4 = Isaac::GetRenderPosition(&local_738,pVVar4,bVar11); pVVar4 = Vector::__add(pVVar4,&local_740,&renderOffset); bVar11 = 1; pVVar5 = Vector::Vector(&local_748,local_7ec.x,local_7c4.x); pVVar5 = Isaac::GetRenderPosition(&local_780,pVVar5,bVar11); pVVar5 = Vector::__add(pVVar5,&local_770,&renderOffset); color = (DestinationQuad *)(local_6bc + 0x14); goto LAB_0081d14b; } local_790.x = local_778.x * 0.5; local_7c4.x = local_7a4.x + edgeMargin; local_814.x = local_790.x + waveScroll.x; FUN_00a10690(); local_468 = local_700._topLeft.x; fStack_464 = local_700._topLeft.y; fStack_460 = local_700._topRight.x; fStack_45c = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_448 = local_6e0; local_458 = local_700._bottomLeft.x; fStack_454 = local_700._bottomLeft.y; fStack_450 = local_700._bottomRight.x; fStack_44c = local_700._bottomRight.y; local_7ec.x = local_7b4.x * 0.5; local_788.x = local_7ec.x + local_790.x; FUN_00a10690(); local_444 = local_700._topLeft.x; fStack_440 = local_700._topLeft.y; fStack_43c = local_700._topRight.x; fStack_438 = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_434 = local_700._bottomLeft.x; fStack_430 = local_700._bottomLeft.y; fStack_42c = local_700._bottomRight.x; fStack_428 = local_700._bottomRight.y; local_424 = local_6e0; local_7e4.x = local_7ec.x + local_778.x; local_7ec.x = local_7ec.x + waveScroll.x; FUN_00a10690(); local_7dc.x = local_7b4.x + local_778.x; local_420 = local_700._topLeft.x; fStack_41c = local_700._topLeft.y; fStack_418 = local_700._topRight.x; fStack_414 = local_700._topRight.y; local_6e0 = CONCAT31(local_6e0._1_3_,1); local_410 = local_700._bottomLeft.x; fStack_40c = local_700._bottomLeft.y; fStack_408 = local_700._bottomRight.x; fStack_404 = local_700._bottomRight.y; local_400 = local_6e0; FUN_00a10690(); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_3fc = local_700._topLeft.x; fStack_3f8 = local_700._topLeft.y; fStack_3f4 = local_700._topRight.x; fStack_3f0 = local_700._topRight.y; local_3dc = local_6e0; local_3ec = local_700._bottomLeft.x; fStack_3e8 = local_700._bottomLeft.y; fStack_3e4 = local_700._bottomRight.x; fStack_3e0 = local_700._bottomRight.y; local_814.x = local_778.x + local_778.x; local_778.x = local_814.x + local_7b4.x; FUN_00a10690(); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_3b8 = local_6e0; local_3d8 = local_700._topLeft.x; fStack_3d4 = local_700._topLeft.y; fStack_3d0 = local_700._topRight.x; fStack_3cc = local_700._topRight.y; local_7f4.x = local_7b4.x + local_7b4.x + local_814.x; local_3c8 = local_700._bottomLeft.x; fStack_3c4 = local_700._bottomLeft.y; fStack_3c0 = local_700._bottomRight.x; fStack_3bc = local_700._bottomRight.y; FUN_00a10690(); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_3b4 = local_700._topLeft.x; fStack_3b0 = local_700._topLeft.y; fStack_3ac = local_700._topRight.x; fStack_3a8 = local_700._topRight.y; local_394 = local_6e0; local_3a4 = local_700._bottomLeft.x; fStack_3a0 = local_700._bottomLeft.y; fStack_39c = local_700._bottomRight.x; fStack_398 = local_700._bottomRight.y; local_814.x = local_790.x; local_814.y = edgeMargin; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7a4.y = pVVar2->y + 0.0; local_7a4.x = waveScroll.x + pVVar2->x; local_7ec.x = 0.0; local_7ec.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7ec,&local_768,waveRotation.x); local_7bc.y = pVVar2->y + 0.0; local_7bc.x = waveScroll.x + pVVar2->x; local_7c4.y = 0.0; local_7c4.x = local_790.x; pVVar2 = Vector::Rotated(&local_7c4,&local_770,waveRotation.x); local_7cc.y = pVVar2->y + 0.0; local_7cc.x = waveScroll.x + pVVar2->x; local_7b4.x = 0.0; local_7b4.y = 0.0; pVVar2 = Vector::Rotated(&local_7b4,&local_780,waveRotation.x); local_7d4.y = pVVar2->y + 0.0; local_7d4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7d4,&local_7cc,&local_7bc,&local_7a4); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_390 = local_700._topLeft.x; fStack_38c = local_700._topLeft.y; fStack_388 = local_700._topRight.x; fStack_384 = local_700._topRight.y; local_370 = local_6e0; local_380 = local_700._bottomLeft.x; fStack_37c = local_700._bottomLeft.y; fStack_378 = local_700._bottomRight.x; fStack_374 = local_700._bottomRight.y; local_7d4.x = local_788.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_790.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_788.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7b4.y = pVVar2->y + 0.0; local_7b4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_790.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7a4.y = pVVar2->y + 0.0; local_7a4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7a4,&local_7b4,&local_7c4,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_36c = local_700._topLeft.x; fStack_368 = local_700._topLeft.y; fStack_364 = local_700._topRight.x; fStack_360 = local_700._topRight.y; local_34c = local_6e0; local_35c = local_700._bottomLeft.x; fStack_358 = local_700._bottomLeft.y; fStack_354 = local_700._bottomRight.x; fStack_350 = local_700._bottomRight.y; local_7d4.x = local_7e4.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_788.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_7e4.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_790.y = pVVar2->y + 0.0; local_790.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_788.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7b4.y = pVVar2->y + 0.0; local_7b4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7b4,&local_790,&local_7c4,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_348 = local_700._topLeft.x; fStack_344 = local_700._topLeft.y; fStack_340 = local_700._topRight.x; fStack_33c = local_700._topRight.y; local_328 = local_6e0; local_338 = local_700._bottomLeft.x; fStack_334 = local_700._bottomLeft.y; fStack_330 = local_700._bottomRight.x; fStack_32c = local_700._bottomRight.y; local_7d4.x = local_7dc.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_7e4.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_788.y = pVVar2->y + 0.0; local_788.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_7dc.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_7e4.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_790.y = pVVar2->y + 0.0; local_790.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_790,&local_7c4,&local_788,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_324 = local_700._topLeft.x; fStack_320 = local_700._topLeft.y; fStack_31c = local_700._topRight.x; fStack_318 = local_700._topRight.y; local_304 = local_6e0; local_314 = local_700._bottomLeft.x; fStack_310 = local_700._bottomLeft.y; fStack_30c = local_700._bottomRight.x; fStack_308 = local_700._bottomRight.y; local_7d4.x = local_778.x; local_7d4.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_7dc.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7e4.y = pVVar2->y + 0.0; local_7e4.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_778.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_788.y = pVVar2->y + 0.0; local_788.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_7dc.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_7c4.y = pVVar2->y + 0.0; local_7c4.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_7c4,&local_788,&local_7e4,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_300 = local_700._topLeft.x; fStack_2fc = local_700._topLeft.y; fStack_2f8 = local_700._topRight.x; fStack_2f4 = local_700._topRight.y; local_2f0 = local_700._bottomLeft.x; fStack_2ec = local_700._bottomLeft.y; fStack_2e8 = local_700._bottomRight.x; fStack_2e4 = local_700._bottomRight.y; local_7d4.x = local_7f4.x; local_7d4.y = edgeMargin; local_2e0 = local_6e0; pVVar2 = Vector::Rotated(&local_7d4,&local_780,waveRotation.x); local_7ec.y = pVVar2->y + 0.0; local_7ec.x = waveScroll.x + pVVar2->x; local_7cc.x = local_778.x; local_7cc.y = edgeMargin; pVVar2 = Vector::Rotated(&local_7cc,&local_770,waveRotation.x); local_7dc.y = pVVar2->y + 0.0; local_7dc.x = waveScroll.x + pVVar2->x; local_7bc.y = 0.0; local_7bc.x = local_7f4.x; pVVar2 = Vector::Rotated(&local_7bc,&local_768,waveRotation.x); local_7e4.y = pVVar2->y + 0.0; local_7e4.x = waveScroll.x + pVVar2->x; local_814.y = 0.0; local_814.x = local_778.x; pVVar2 = Vector::Rotated(&local_814,&local_760,waveRotation.x); local_788.y = pVVar2->y + 0.0; local_788.x = waveScroll.x + pVVar2->x; DestinationQuad::DestinationQuad(&local_700,&local_788,&local_7e4,&local_7dc,&local_7ec); local_6e0 = CONCAT31(local_6e0._1_3_,1); local_2dc = local_700._topLeft.x; fStack_2d8 = local_700._topLeft.y; fStack_2d4 = local_700._topRight.x; fStack_2d0 = local_700._topRight.y; local_2bc = local_6e0; local_2cc = local_700._bottomLeft.x; fStack_2c8 = local_700._bottomLeft.y; fStack_2c4 = local_700._bottomRight.x; fStack_2c0 = local_700._bottomRight.y; KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = topLeftX; local_7d4.y = local_708.x * 0.5 + topLeftY; local_708.x = local_7d4.y; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.y = bottomRightY; local_7cc.x = topLeftX; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_7dc.x = renderOffset.x + pVVar2->x; local_7dc.y = renderOffset.y + pVVar2->y; local_7bc.x = topLeftX - edgeMargin; local_7ec.x = local_708.x - edgeMargin; local_7bc.y = local_7ec.x; local_788.x = local_7bc.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_7e4.x = renderOffset.x + pVVar2->x; local_7e4.y = renderOffset.y + pVVar2->y; local_814.x = local_788.x; local_814.y = bottomRightY + edgeMargin; local_7c4.x = local_814.y; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_790.y = renderOffset.y + pVVar2->y; local_790.x = renderOffset.x + pVVar2->x; puVar3 = set_quad_corner_colors (local_5b4,&local_790,&local_7e4,&local_7dc,&local_7f4,(KColor *)local_6bc); puVar9 = edgeQuad0; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = local_79c * 0.5 + topLeftX; local_7d4.y = local_708.x; local_79c = local_7d4.x; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.x = topLeftX; local_7cc.y = local_708.x; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_7e4.x = renderOffset.x + pVVar2->x; local_7e4.y = renderOffset.y + pVVar2->y; local_7dc.x = local_79c - edgeMargin; local_7bc.y = local_7ec.x; local_7bc.x = local_7dc.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_790.x = renderOffset.x + pVVar2->x; local_790.y = renderOffset.y + pVVar2->y; local_814.x = local_788.x; local_814.y = local_7ec.x; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_7b4.y = renderOffset.y + pVVar2->y; local_7b4.x = renderOffset.x + pVVar2->x; puVar3 = set_quad_corner_colors (local_5b4,&local_7b4,&local_790,&local_7e4,&local_7f4,(KColor *)local_6bc); puVar9 = edgeQuad1; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = local_79c; local_7d4.y = topLeftY; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.x = local_79c; local_7cc.y = local_708.x; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_790.x = renderOffset.x + pVVar2->x; local_790.y = renderOffset.y + pVVar2->y; local_7bc.x = local_7dc.x; local_7e4.x = topLeftY - edgeMargin; local_7bc.y = local_7e4.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_7b4.x = renderOffset.x + pVVar2->x; local_7b4.y = renderOffset.y + pVVar2->y; local_814.x = local_7dc.x; local_814.y = local_7ec.x; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_7a4.y = renderOffset.y + pVVar2->y; local_7a4.x = renderOffset.x + pVVar2->x; puVar3 = set_quad_corner_colors (local_5b4,&local_7a4,&local_7b4,&local_790,&local_7f4,(KColor *)local_6bc); puVar9 = edgeQuad2; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = bottomRightX; local_7d4.y = topLeftY; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.x = local_79c; local_7cc.y = topLeftY; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_790.x = renderOffset.x + pVVar2->x; local_790.y = renderOffset.y + pVVar2->y; local_7ec.x = bottomRightX + edgeMargin; local_7bc.y = local_7e4.x; local_7bc.x = local_7ec.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_7b4.x = renderOffset.x + pVVar2->x; local_7b4.y = renderOffset.y + pVVar2->y; local_814.x = local_7dc.x; local_814.y = local_7e4.x; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_708.y = renderOffset.y + pVVar2->y; local_708.x = renderOffset.x + pVVar2->x; puVar3 = set_quad_corner_colors (local_5b4,&local_708,&local_7b4,&local_790,&local_7f4,(KColor *)local_6bc); puVar9 = edgeQuad3; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = bottomRightX; local_7d4.y = bottomRightY; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.x = bottomRightX; local_7cc.y = topLeftY; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_7dc.x = renderOffset.x + pVVar2->x; local_7dc.y = renderOffset.y + pVVar2->y; local_7bc.x = local_7ec.x; local_7bc.y = local_7c4.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_790.x = renderOffset.x + pVVar2->x; local_790.y = renderOffset.y + pVVar2->y; local_814.x = local_7ec.x; local_814.y = local_7e4.x; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_7b4.x = renderOffset.x + pVVar2->x; local_7b4.y = renderOffset.y + pVVar2->y; puVar3 = set_quad_corner_colors (local_5b4,&local_7b4,&local_790,&local_7dc,&local_7f4,(KColor *)local_6bc); puVar9 = edgeQuad4; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } KColor::SetFromARGB((KColor *)local_6bc,0xffffffff); local_7d4.x = topLeftX; local_7d4.y = bottomRightY; pVVar2 = Isaac::GetRenderPosition(&local_780,&local_7d4,1); local_7f4.x = renderOffset.x + pVVar2->x; local_7f4.y = renderOffset.y + pVVar2->y; local_7cc.x = bottomRightX; local_7cc.y = bottomRightY; pVVar2 = Isaac::GetRenderPosition(&local_770,&local_7cc,1); local_7dc.x = renderOffset.x + pVVar2->x; local_7dc.y = renderOffset.y + pVVar2->y; local_7bc.x = local_788.x; local_7bc.y = local_7c4.x; pVVar2 = Isaac::GetRenderPosition(&local_768,&local_7bc,1); local_7e4.x = renderOffset.x + pVVar2->x; local_7e4.y = renderOffset.y + pVVar2->y; local_814.x = local_7ec.x; local_814.y = local_7c4.x; pVVar2 = Isaac::GetRenderPosition(&local_760,&local_814,1); local_790.y = renderOffset.y + pVVar2->y; local_790.x = renderOffset.x + pVVar2->x; pVVar2 = &local_7f4; puVar3 = set_quad_corner_colors (local_5b4,&local_790,&local_7e4,&local_7dc,pVVar2,(KColor *)local_6bc); puVar9 = edgeQuad5; for (iVar7 = 0x1c; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar9 = *puVar3; puVar3 = puVar3 + 1; puVar9 = puVar9 + 1; } } LAB_0081d167: pvVar12 = (void *)0x81d16e; FUN_00682260(); KAGE::SmartPointer::operator_assign(auStackY_8b4 + 0x8c,&DAT_00c797c4); apply_sprite_shader_params((ColorMod *)&waterColor,1,pVVar2,pvVar12); local_7f4.x = (float)&local_468; local_7ec.x = 0.0; do { piVar6 = (int *)EntityPtr::Ref(); pcVar1 = *(code **)(*piVar6 + 0x14); FUN_00407220(); (*pcVar1)(local_7f4.x); local_7f4.x = (float)((int)local_7f4.x + 0x24); local_7ec.x = (float)((int)local_7ec.x + 1); } while ((int)local_7ec.x < 0xc); LAB_0081deea: shader_cache_find(0xb1a5b0); return; } //@@ 0081df10 Game::SetShockwaveParams /* DB: ? "Shockwave id is too large!" id<2, copies 0x1c-byte params prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Game::SetShockwaveParams(Game *this,int shockwaveId,void *params) { if (1 < (uint)shockwaveId) { KAGE_LogMessage(0x10,(byte *)"Shockwave id is too large!"); } this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x1d] = *(int *)params; this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x1e] = *(int *)((int)params + 4); this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x1f] = *(int *)((int)params + 8); this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x20] = *(int *)((int)params + 0xc); this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x21] = *(int *)((int)params + 0x10); this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x22] = *(int *)((int)params + 0x14); this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x23] = *(int *)((int)params + 0x18); return; } //@@ 0081df80 Room::compute_overlay_texcoords /* DB: ? (out, world pos, texture with w/h at +0x10/+0x14, shader): maps a world position through the room render offset (+0x1204) to normalized texture coordinates, assert_lerp "Start and End parameters cannot be the same!"; used twice in Room::Render for the layers at +0x70c4/+0x70e0 */ float * __thiscall Room::compute_overlay_texcoords(Room *this,float *param_2,float *param_3,int param_4,int *param_5) { float fVar1; float fVar2; float fVar3; char cVar4; uint uVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; double dVar12; double dVar13; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0172d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; fVar6 = g_screenHeight - 182.0; fVar11 = g_displayPixelRatio * g_screenPointScale; dVar12 = floor((double)(((*param_3 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar11 + 0.5) ); dVar13 = floor((double)(((param_3[1] - 140.0) * 0.65 + fVar6 * 0.5) * fVar11 + 0.5)); fVar6 = (g_game->_screenShakeOffset).x; fVar1 = (g_game->_screenShakeOffset).y; fVar2 = (this->_renderScrollOffset).x; fVar3 = (this->_renderScrollOffset).y; fVar9 = (float)((double)*(int *)(param_4 + 0x1c) + __uint_to_double_fixup[-(*(int *)(param_4 + 0x1c) >> 0x1f)]); fVar7 = (float)((double)*(int *)(param_4 + 0x14) + __uint_to_double_fixup[-(*(int *)(param_4 + 0x14) >> 0x1f)]) / g_screenHeight; if (fVar9 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar10 = (float)((double)*(int *)(param_4 + 0x18) + __uint_to_double_fixup[-(*(int *)(param_4 + 0x18) >> 0x1f)]); fVar8 = (float)((double)*(int *)(param_4 + 0x10) + __uint_to_double_fixup[-(*(int *)(param_4 + 0x10) >> 0x1f)]) / g_screenWidth; if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } *param_2 = (fVar8 * ((float)dVar12 / fVar11 + fVar6 + fVar2) - 0.0) / (fVar10 - 0.0) + 0.0; param_2[1] = (fVar7 * ((float)dVar13 / fVar11 + fVar1 + fVar3) - 0.0) / (fVar9 - 0.0) + 0.0; local_8 = 1; if (param_5 != (int *)0x0) { cVar4 = (**(code **)(*param_5 + 0xc))(uVar5); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } ExceptionList = local_10; return param_2; } //@@ 0081e220 FUN_0081e220 uint FUN_0081e220(void) { uint uVar1; int in_ECX; *(int *)(in_ECX + 0x70fc) = *(int *)(in_ECX + 0x70fc) + 1; uVar1 = *(uint *)(in_ECX + 0x70fc) & 0x80000001; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffe) + 1; } return uVar1; } //@@ 0081e240 Room::IsAmbushActive /* ZHL [lua] Lua binding Room:IsAmbushActive */ undefined4 Room::IsAmbushActive(void) { return CONCAT31((int3)((uint)g_game >> 8),(g_game->_ambush)._isActive); } //@@ 0081e250 Room::GetLightingAlpha /* ZHL [exact] __thiscall float Room::GetLightingAlpha(); prototype: REPENTOGON, confirmed by RET 0 */ float __thiscall Room::GetLightingAlpha(Room *this) { int iVar1; uint uVar2; Game *this_00; byte bVar3; uint uVar4; uint uVar5; Entity_Player *pEVar6; uint uVar7; float fVar8; float fVar9; float local_18; Vector local_10; if (this->_backdropType == 0x39) { return g_game->_darknessStrength * g_game->_darknessModifier; } if ((*(uint *)((int)this->_descriptor + 0x44) >> 9 & 1) != 0) { return 1.0; } iVar1 = g_game->_stage; uVar2 = g_game->_debugCurses; uVar7 = g_game->_curses; local_10.x = (float)g_game->_stageType; uVar4 = Seeds::GetForcedCurses(); uVar5 = Seeds::GetPreventedCurses(); if ((~uVar5 & (uVar4 | uVar2 | uVar7) & 1) == 0) { local_18 = (this->_fxLayers)._fxParams.shadowAlpha; if ((((iVar1 == 1) && (local_10.x != 5.60519e-45)) && (local_10.x != 7.00649e-45)) && (local_10.x != 2.8026e-45)) { local_18 = local_18 * 0.6; } } else { local_18 = 1.0; } pEVar6 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1a9,(RNG **)&g_game->_playerManager,1); if (pEVar6 != (Entity_Player *)0x0) { local_18 = local_18 * 0.5; } pEVar6 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1cc,(RNG **)&g_game->_playerManager,1); if ((pEVar6 != (Entity_Player *)0x0) && (local_18 = local_18 + 0.1, 1.0 <= local_18)) { local_18 = 1.0; } local_18 = (g_game->_darknessStrength - local_18) * g_game->_darknessModifier + local_18; if ((((this->_roomType == 8) || (this->_roomType == 0x1d)) || ((bVar3 = Level::HasAbandonedMineshaft((Level *)g_game), bVar3 != 0 && (g_game->_currentDimensionIdx == 1)))) || (g_game->_currentDimensionIdx == 2)) { fVar9 = local_18 + 0.33; local_18 = 1.0; if (fVar9 <= 1.0) { local_18 = fVar9; } } this_00 = g_game; if (iVar1 == 9) { if (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 8) == 5) { uVar2 = (this->_entityList)._updateEL._size; uVar7 = 0; if (uVar2 != 0) { while ((iVar1 = *(int *)((int)(this->_entityList)._updateEL._data + uVar7 * 4), *(int *)(iVar1 + 0x28) != 0x197 || (*(int *)(iVar1 + 0x2c) != 0))) { uVar7 = uVar7 + 1; if (uVar2 <= uVar7) { return local_18; } } fVar9 = 1.0 - *(float *)(iVar1 + 0x380) / *(float *)(iVar1 + 900); if (fVar9 <= local_18) { fVar9 = local_18; } return fVar9; } } else if (g_game->_currentRoomIdx == -9) { GetCenterPos(&local_10); pEVar6 = Game::GetNearestPlayer(this_00,&local_10); local_10.y = local_10.y - (pEVar6->_pos).y; fVar9 = local_10.x - (pEVar6->_pos).x; fVar8 = sqrtf(local_10.y * local_10.y + fVar9 * fVar9); fVar9 = 300.0; if (fVar8 <= 300.0) { fVar9 = fVar8; } local_18 = 1.0 - fVar9 / 300.0; } } return local_18; } //@@ 0081e520 Room::FindFreeTilePosition /* ZHL [lua] Lua binding Room:FindFreeTilePosition prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Room::FindFreeTilePosition(Room *this,Vector *outPos,Vector *pos,float distanceThreshold) { int iVar1; uint uVar2; int iVar3; int index; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float local_18; float local_14; float local_c; iVar3 = (int)((pos->x - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar1 = (int)((pos->y - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (this->_gridHeight <= iVar1)) { iVar3 = -1; } else { iVar3 = this->_gridWidth * iVar1 + iVar3; } uVar2 = GetGridCollision(this,iVar3); if (uVar2 == 0) { fVar8 = pos->y; outPos->x = pos->x; outPos->y = fVar8; return outPos; } index = 0; iVar1 = this->_gridHeight * this->_gridWidth; local_18 = (float)(iVar3 % this->_gridWidth) * 40.0 + 40.0; local_c = 1e+06; local_14 = (float)(iVar3 / this->_gridWidth) * 40.0 + 120.0; fVar8 = local_14; fVar4 = local_14; fVar7 = local_18; fVar5 = local_18; if (0 < iVar1) { do { if ((index != iVar3) && (uVar2 = GetGridCollision(this,index), fVar4 = local_14, fVar5 = local_18, uVar2 == 0)) { fVar8 = (float)(index / this->_gridWidth) * 40.0 + 120.0; fVar7 = (float)(index % this->_gridWidth) * 40.0 + 40.0; fVar5 = fVar8 - pos->y; fVar4 = fVar7 - pos->x; fVar6 = fVar5 * fVar5 + fVar4 * fVar4; fVar4 = local_14; fVar5 = local_18; if ((fVar6 < local_c) && (local_18 = fVar7, local_14 = fVar8, local_c = fVar6, fVar4 = fVar8, fVar5 = fVar7, fVar6 < distanceThreshold * distanceThreshold)) break; } fVar7 = fVar5; fVar8 = fVar4; index = index + 1; fVar4 = fVar8; fVar5 = fVar7; } while (index < iVar1); } outPos->x = fVar7; outPos->y = fVar8; return outPos; } //@@ 0081e6e0 Room::TryMakeBridge /* ZHL [lua] Lua binding Room:TryMakeBridge prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall Room::TryMakeBridge(Room *this,GridEntity *pit,GridEntity *rock) { uint uVar1; void *pvVar2; GridEntity_Pit *this_00; int iVar3; int iVar4; void *pvVar5; void *pvVar6; int iVar7; float fVar8; float fVar9; void *local_c; if (pit == (GridEntity *)0x0) { return 0; } if ((pit->_desc)._type != 7) { return 0; } iVar4 = *(int *)((int)g_game->_room + 0xc); fVar8 = (float)(pit->_gridIndex / iVar4) * 40.0 + 120.0; fVar9 = (float)(pit->_gridIndex % iVar4) * 40.0 + 40.0; iVar4 = (int)(((fVar9 + 40.0) - 40.0) / 40.0 + 0.5); if ((((iVar4 < 0) || (this->_gridWidth <= iVar4)) || (iVar3 = (int)(((fVar8 + 0.0) - 120.0) / 40.0 + 0.5), iVar3 < 0)) || ((this->_gridHeight <= iVar3 || (uVar1 = this->_gridWidth * iVar3 + iVar4, 0x1bf < uVar1)))) { local_c = (void *)0x0; } else { local_c = this->_gridEntities[uVar1]; } iVar4 = (int)(((fVar9 - 40.0) - 40.0) / 40.0 + 0.5); if (((iVar4 < 0) || (this->_gridWidth <= iVar4)) || ((iVar3 = (int)(((fVar8 + 0.0) - 120.0) / 40.0 + 0.5), iVar3 < 0 || ((this->_gridHeight <= iVar3 || (uVar1 = this->_gridWidth * iVar3 + iVar4, 0x1bf < uVar1)))))) { pvVar6 = (void *)0x0; } else { pvVar6 = this->_gridEntities[uVar1]; } iVar4 = (int)(((fVar9 + 0.0) - 40.0) / 40.0 + 0.5); if ((((iVar4 < 0) || (this->_gridWidth <= iVar4)) || (iVar3 = (int)(((fVar8 + 40.0) - 120.0) / 40.0 + 0.5), iVar3 < 0)) || ((this->_gridHeight <= iVar3 || (uVar1 = this->_gridWidth * iVar3 + iVar4, 0x1bf < uVar1)))) { pvVar5 = (void *)0x0; if ((-1 < iVar4) && (iVar3 = this->_gridWidth, iVar4 < iVar3)) goto LAB_0081e871; } else { pvVar5 = this->_gridEntities[uVar1]; iVar3 = this->_gridWidth; LAB_0081e871: iVar7 = (int)(((fVar8 - 40.0) - 120.0) / 40.0 + 0.5); if (((-1 < iVar7) && (iVar7 < this->_gridHeight)) && (uVar1 = iVar3 * iVar7 + iVar4, uVar1 < 0x1c0)) { pvVar2 = this->_gridEntities[uVar1]; goto LAB_0081e89e; } } pvVar2 = (void *)0x0; LAB_0081e89e: if ((((local_c != (void *)0x0) && (*(int *)((int)local_c + 4) == 7)) || ((pvVar6 != (void *)0x0 && (*(int *)((int)pvVar6 + 4) == 7)))) && (((pvVar2 != (void *)0x0 && (*(int *)((int)pvVar2 + 4) == 7)) || ((pvVar5 != (void *)0x0 && (*(int *)((int)pvVar5 + 4) == 7)))))) { return 0; } this_00 = (GridEntity_Pit *) __RTDynamicCast(pit,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0); if ((this_00->_desc)._state == 0) { if (((rock == (GridEntity *)0x0) || ((rock->_desc)._type != 0x19)) || (iVar4 = 3, *(int *)rock[1]._sprite._filename._buf != 1)) { iVar4 = 2; } (this_00->_desc)._state = iVar4; GridEntity_Pit::UpdateCollision(this_00); } return 1; } //@@ 0081e930 Room::RemoveGridEntity /* ZHL [lua] Lua binding Room:RemoveGridEntity prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Room::RemoveGridEntity(Room *this,int gridIndex,int pathTrail,byte isKeepDecoration) { undefined1 local_10 [12]; if ((((uint)gridIndex < 0x1c0) && (this->_gridEntities[gridIndex] != (void *)0x0)) && ((*(int *)((int)this->_gridEntities[gridIndex] + 4) != 1 || (isKeepDecoration == 0)))) { this->_gridPaths[gridIndex] = pathTrail; std::set::insert(local_10,&gridIndex); } return; } //@@ 0081e980 Room::RemoveGridEntityImmediate /* ZHL [exact] __thiscall void Room::RemoveGridEntityImmediate(int GridIndex, int PathTrail, bool KeepDecoration); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Room::RemoveGridEntityImmediate(Room *this,int GridIndex,int PathTrail,byte KeepDecoration) { undefined4 *puVar1; if ((((uint)GridIndex < 0x1c0) && (puVar1 = this->_gridEntities[GridIndex], puVar1 != (undefined4 *)0x0)) && ((puVar1[1] != 1 || (KeepDecoration == 0)))) { this->_gridPaths[GridIndex] = PathTrail; this->_gridEntities[GridIndex] = (void *)0x0; (**(code **)*puVar1)(1); } return; } //@@ 0081e9d0 Room::GetRandomPosition /* ZHL [lua] Lua binding Room:GetRandomPosition prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Room::GetRandomPosition(Room *this,Vector *outPosition,float margin) { double dVar1; double dVar2; uint uVar3; uint uVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float local_4c; Vector local_30; float local_28; float local_24; float local_20; float local_1c; float local_18; float local_14; float local_10; float local_c; if (3 < *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48) - 9U) { uVar3 = Random(); local_30.x = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10; uVar3 = Random(); local_30.x = ((this->_bottomRightPos).x - (this->_topLeftPos).x) * local_30.x + (this->_topLeftPos).x; local_30.y = ((this->_bottomRightPos).y - (this->_topLeftPos).y) * (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 + (this->_topLeftPos).y; GetClampedPositionImpl(this,outPosition,&local_30,margin,margin,margin,margin); return outPosition; } GetLRoomAreaDesc(this,&local_28); local_30.x = local_28 - margin; local_4c = local_1c + margin; fVar8 = (local_20 + margin) - local_30.x; fVar6 = (local_10 + margin) - (local_18 - margin); if (fVar8 < fVar6) { local_4c = local_14 - margin; } fVar7 = local_4c - (local_24 - margin); fVar9 = (local_c + margin) - local_4c; fVar5 = ABS(fVar7 * fVar8); uVar3 = Random(); if ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 < fVar5 / (ABS(fVar9 * fVar6) + fVar5)) { uVar3 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]; uVar4 = Random(); dVar2 = __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]; outPosition->x = fVar8 * (float)((double)(int)uVar3 + dVar1) * 2.3283064e-10 + local_30.x; outPosition->y = (float)((double)(int)uVar4 + dVar2) * 2.3283064e-10 * fVar7 + (local_24 - margin); return outPosition; } uVar3 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]; uVar4 = Random(); dVar2 = __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]; outPosition->x = fVar6 * (float)((double)(int)uVar3 + dVar1) * 2.3283064e-10 + (local_18 - margin) ; outPosition->y = (float)((double)(int)uVar4 + dVar2) * 2.3283064e-10 * fVar9 + local_4c; return outPosition; } //@@ 0081ecc0 Room::GetRandomTileIndex /* ZHL [lua] Lua binding Room:GetRandomTileIndex */ int __thiscall Room::GetRandomTileIndex(Room *this,uint param_2) { LRoomTileDesc LVar1; int iVar2; uint uVar3; int iVar4; int iVar5; LRoomTileDesc local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; RNG local_20; int local_10; Room *local_c; iVar4 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48); iVar5 = iVar4 * 0x20; local_c = this; if (iVar4 - 9U < 4) { local_30 = *(LRoomTileDesc *)(&DAT_00c35b80 + iVar5); local_2c = *(undefined4 *)(&DAT_00c35b84 + iVar5); local_28 = *(undefined4 *)(&DAT_00c35b88 + iVar5); local_24 = *(undefined4 *)(&DAT_00c35b8c + iVar5); local_20._seed = *(int *)(&DAT_00c35b90 + iVar5); local_20._4_8_ = *(undefined8 *)(&DAT_00c35b94 + iVar5); local_20._shift3 = *(int *)(&DAT_00c35b9c + iVar5); LRoomTileDesc::GetRandomTile(&local_30,&local_10,param_2); if (((-1 < local_10) && (local_10 < this->_gridWidth)) && ((-1 < (int)local_c && ((int)local_c < this->_gridHeight)))) { return this->_gridWidth * (int)local_c + local_10; } } else { LVar1 = *(LRoomTileDesc *)(&DAT_00c35b80 + iVar5); iVar4 = *(int *)(&DAT_00c35b84 + iVar5); iVar2 = *(int *)(&DAT_00c35b8c + iVar5); local_20._seed = param_2; local_20._shift3 = 0x1d; local_20._shift1 = 1; local_20._shift2 = 9; uVar3 = RNG::RandomInt(&local_20,*(int *)(&DAT_00c35b88 + iVar5) - (int)LVar1); iVar5 = uVar3 + (int)LVar1; uVar3 = RNG::RandomInt(&local_20,iVar2 - iVar4); iVar4 = uVar3 + iVar4; if (-1 < iVar5) { if (((iVar5 < local_c->_gridWidth) && (-1 < iVar4)) && (iVar4 < local_c->_gridHeight)) { return iVar4 * local_c->_gridWidth + iVar5; } } } return -1; } //@@ 0081edd0 Room::GetBrokenWatchState /* ZHL [exact] __thiscall uint32_t Room::GetBrokenWatchState(); prototype: REPENTOGON, confirmed by RET 0 */ uint __thiscall Room::GetBrokenWatchState(Room *this) { uint uVar1; uVar1 = 2; if (g_game->_challenge != 0x16) { uVar1 = this->_brokenWatchState; } return uVar1; } //@@ 0081edf0 Room::SetBrokenWatchState /* ZHL [lua] Lua binding Room:SetBrokenWatchState */ void Room::SetBrokenWatchState(int param_1) { Manager *pMVar1; Room *in_ECX; float fVar2; pMVar1 = g_manager; in_ECX->_brokenWatchState = param_1; fVar2 = time_scale_update(in_ECX); (pMVar1->_musicManager)._targetPitch = fVar2; return; } //@@ 0081ee20 Room::make_walls /* DB: calls Room::make_wall on the border cells (L-shape variants by shape); skipped in the Beast room (beast.md) */ void Room::make_walls(void) { Room *in_ECX; int iVar1; LRoomTileDesc tileDesc; int tileMinY; int tileMaxX; int tileMaxY; int *roomConfig; roomConfig = *(int **)((int)in_ECX->_descriptor + 0x10); if (((roomConfig == (int *)0x0) || (roomConfig[2] != 0x10)) || (*roomConfig != 0x23)) { iVar1 = roomConfig[0x12]; if (iVar1 == 0xb) { iVar1 = 0; if (0 < in_ECX->_gridWidth) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridWidth); } iVar1 = 0; if (0 < in_ECX->_gridHeight + -1) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridHeight + -1); return; } } else if (iVar1 == 0xc) { iVar1 = 0; if (0 < in_ECX->_gridWidth) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridWidth); } iVar1 = 0; if (0 < in_ECX->_gridHeight + -1) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridHeight + -1); return; } } else if (iVar1 == 9) { iVar1 = 0; if (0 < in_ECX->_gridWidth) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridWidth); } iVar1 = 0; if (0 < in_ECX->_gridHeight + -1) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridHeight + -1); return; } } else if (iVar1 == 10) { iVar1 = 0; if (0 < in_ECX->_gridWidth) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridWidth); } iVar1 = 0; if (0 < in_ECX->_gridHeight + -1) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridHeight + -1); return; } } else if (((iVar1 == 2) || (iVar1 == 3)) || ((iVar1 == 7 || (iVar1 == 5)))) { GetLRoomTileDesc(in_ECX,&tileDesc); for (iVar1 = (int)tileDesc + -1; iVar1 <= tileMaxX + 1; iVar1 = iVar1 + 1) { make_wall(); make_wall(); } iVar1 = tileMinY + -1; if (iVar1 <= tileMaxY + 1) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 <= tileMaxY + 1); } } else { iVar1 = 0; if (0 < in_ECX->_gridWidth) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridWidth); } iVar1 = 0; if (0 < in_ECX->_gridHeight + -1) { do { make_wall(); make_wall(); iVar1 = iVar1 + 1; } while (iVar1 < in_ECX->_gridHeight + -1); return; } } } return; } //@@ 0081f130 Room::render_debug_grid_indices /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Room::Render; sprintf_s("%d,%d") per grid cell plus render_color_quad with floor() */ void __thiscall Room::render_debug_grid_indices(Room *this,float *param_2) { KColor color; KColor color_00; int columnGridIndex; void *glyphQuads; int gridWidth; int iVar1; int columnGridIndex; double dVar3; undefined1 glyphBuffer [16]; KColor lineColor; undefined4 fontSettings; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; Vector lineEnd; Vector local_70; float local_68; float local_64; float local_60; float local_5c; byte labelText [64]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00b01781; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(labelText + 0x54); ExceptionList = &local_10; iVar1 = 0; gridWidth = this->_gridWidth; lineColor._unk = 0; lineColor._red = 1.0; lineColor._green = 1.0; lineColor._blue = 0.0; lineColor._alpha = 0.2; if (0 < gridWidth) { do { if (((iVar1 < 0) || (gridWidth <= iVar1)) || (columnGridIndex = this->_gridHeight, columnGridIndex < 1)) { columnGridIndex = this->_gridHeight; columnGridIndex = -1; } else { columnGridIndex = iVar1; } local_68 = g_displayPixelRatio * g_screenPointScale; local_64 = ((((float)(columnGridIndex / gridWidth) * 40.0 + 120.0) - 20.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_5c = (((((float)(columnGridIndex % gridWidth) * 40.0 + 40.0) - 20.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_68 + 0.5; dVar3 = floor((double)local_5c); local_60 = (float)dVar3 / local_68; local_5c = local_64 * local_68 + 0.5; dVar3 = floor((double)local_5c); local_5c = (float)dVar3; lineEnd.x = local_60 + *param_2; local_70.y = local_5c / local_68 + param_2[1]; lineEnd.y = param_2[1] + (float)columnGridIndex * 26.0 + local_5c / local_68; local_70.x = lineEnd.x; render_color_quad(&local_70,&lineEnd,&lineColor,&lineColor,1.0); gridWidth = this->_gridWidth; iVar1 = iVar1 + 1; } while (iVar1 < gridWidth); } iVar1 = this->_gridHeight; columnGridIndex = 0; if (0 < iVar1) { do { gridWidth = this->_gridWidth; if (((gridWidth < 1) || (columnGridIndex < 0)) || (iVar1 <= columnGridIndex)) { iVar1 = -1; } else { iVar1 = gridWidth * columnGridIndex; } local_68 = g_displayPixelRatio * g_screenPointScale; local_5c = ((((float)(iVar1 / gridWidth) * 40.0 + 120.0) - 20.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_60 = (((((float)(iVar1 % gridWidth) * 40.0 + 40.0) - 20.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_68 + 0.5; dVar3 = floor((double)local_60); local_64 = (float)dVar3 / local_68; local_60 = local_5c * local_68 + 0.5; dVar3 = floor((double)local_60); local_60 = (float)dVar3; lineEnd.y = local_60 / local_68 + param_2[1]; local_70.x = local_64 + *param_2; lineEnd.x = *param_2 + (float)gridWidth * 26.0 + local_64; local_70.y = lineEnd.y; render_color_quad(&local_70,&lineEnd,&lineColor,&lineColor,1.0); iVar1 = this->_gridHeight; columnGridIndex = columnGridIndex + 1; } while (columnGridIndex < iVar1); gridWidth = this->_gridWidth; } local_68 = 0.0; if (0 < gridWidth * iVar1) { do { local_5c = g_displayPixelRatio * g_screenPointScale; local_70.y = (((float)((int)local_68 / gridWidth) * 40.0 + 120.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_60 = local_5c * ((((float)((int)local_68 % gridWidth) * 40.0 + 40.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) + 0.5; dVar3 = floor((double)local_60); local_60 = (float)dVar3; local_64 = local_60 / local_5c; local_70.y = local_5c * local_70.y + 0.5; dVar3 = floor((double)local_70.y); local_70.y = (float)dVar3; local_5c = local_70.y / local_5c; sprintf_s(labelText,0x3f,s__d); manager = g_manager; fontSettings = 0; local_90 = 0xffff; local_8c = 0; local_88 = 0x3f800000; local_84 = 0xffffffff; local_80 = 0; local_7c = 0; local_8 = 0; local_70.y = (local_5c - 13.0) + param_2[1]; local_64 = local_64 - 13.0; local_60 = local_64 + *param_2; glyphQuads = Font::measure_string (&g_manager->_font2_TeamMeatEx12,&lineColor._green,labelText, &fontSettings,&g_vectorOne); local_8 = CONCAT31(local_8._1_3_,1); color._alpha = 0.2; color._red = 1.0; color._green = 1.0; color._blue = 0.0; color._unk = 0; Font::render_glyph_quads (&manager->_font2_TeamMeatEx12,glyphQuads,local_60,local_70.y,1.0,1.0,color, &fontSettings); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); sprintf_s(labelText,0x3f,(byte *)"%d,%d"); manager = g_manager; fontSettings = 0; local_90 = 0xffff; local_8c = 0; local_88 = 0x3f800000; local_84 = 0xffffffff; local_80 = 0; local_7c = 0; local_8 = 2; local_5c = local_5c + param_2[1]; local_64 = local_64 + *param_2; glyphQuads = Font::measure_string (&g_manager->_font2_TeamMeatEx12,glyphBuffer,labelText,&fontSettings, &g_vectorOne); local_8 = CONCAT31(local_8._1_3_,3); color_00._alpha = 0.2; color_00._red = 1.0; color_00._green = 1.0; color_00._blue = 0.0; color_00._unk = 0; Font::render_glyph_quads (&manager->_font2_TeamMeatEx12,glyphQuads,local_64,local_5c,1.0,1.0,color_00, &fontSettings); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_8 = 0xffffffff; local_68 = (float)((int)local_68 + 1); gridWidth = this->_gridWidth; } while ((int)local_68 < this->_gridHeight * gridWidth); } ExceptionList = local_10; return; } //@@ 0081f890 Room::IsLShapedRoom /* ZHL [lua] Lua binding Room:IsLShapedRoom */ undefined4 Room::IsLShapedRoom(void) { uint uVar1; int in_ECX; uVar1 = *(int *)(*(int *)(*(int *)(in_ECX + 4) + 0x10) + 0x48) - 9; return CONCAT31((int3)(uVar1 >> 8),uVar1 < 4); } //@@ 0081f8b0 Room::GetLRoomAreaDesc /* ZHL [exact] __thiscall LRoomAreaDesc * Room::GetLRoomAreaDesc(LRoomAreaDesc * buffer); prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall Room::GetLRoomAreaDesc(Room *this,void *buffer) { int iVar1; int iVar2; int iVar3; int iVar4; float fVar5; float fVar6; float fVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; iVar11 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48); if (3 < iVar11 - 9U) { fVar5 = (this->_topLeftPos).x; fVar6 = (this->_topLeftPos).y; *(float *)((int)buffer + 4) = (this->_topLeftPos).y; *(float *)((int)buffer + 0xc) = (this->_bottomRightPos).y; fVar7 = (this->_topLeftPos).x; *(float *)buffer = fVar5; fVar5 = (this->_bottomRightPos).x; *(float *)((int)buffer + 0x10) = fVar7; *(float *)((int)buffer + 0x14) = fVar6; fVar6 = (this->_bottomRightPos).y; *(float *)((int)buffer + 8) = fVar5; *(float *)((int)buffer + 0x18) = fVar5; *(float *)((int)buffer + 0x1c) = fVar6; return buffer; } iVar11 = iVar11 * 0x20; iVar10 = *(int *)(&DAT_00c35b80 + iVar11); iVar8 = *(int *)(&DAT_00c35b98 + iVar11); iVar1 = *(int *)(&DAT_00c35b94 + iVar11); iVar2 = *(int *)(&DAT_00c35b9c + iVar11); iVar3 = *(int *)(&DAT_00c35b84 + iVar11); iVar9 = *(int *)(&DAT_00c35b88 + iVar11); iVar4 = *(int *)(&DAT_00c35b8c + iVar11); iVar11 = *(int *)(&DAT_00c35b90 + iVar11); if ((((iVar8 < 0) || (iVar12 = this->_gridWidth, iVar12 <= iVar8)) || (iVar2 < 0)) || (this->_gridHeight <= iVar2)) { iVar12 = this->_gridWidth; iVar8 = -1; } else { iVar8 = iVar12 * iVar2 + iVar8; } if (((iVar11 < 0) || (iVar12 <= iVar11)) || ((iVar1 < 0 || (this->_gridHeight <= iVar1)))) { iVar11 = -1; } else { iVar11 = iVar12 * iVar1 + iVar11; } if (((iVar9 < 0) || (iVar12 <= iVar9)) || ((iVar4 < 0 || (this->_gridHeight <= iVar4)))) { iVar9 = -1; } else { iVar9 = iVar12 * iVar4 + iVar9; } if ((((iVar10 < 0) || (iVar12 <= iVar10)) || (iVar3 < 0)) || (this->_gridHeight <= iVar3)) { iVar10 = -1; } else { iVar10 = iVar12 * iVar3 + iVar10; } *(float *)((int)buffer + 8) = (float)(iVar9 % iVar12) * 40.0 + 40.0 + 20.0; *(float *)((int)buffer + 0xc) = (float)(iVar9 / iVar12) * 40.0 + 120.0 + 20.0; *(float *)((int)buffer + 0x10) = ((float)(iVar11 % iVar12) * 40.0 + 40.0) - 20.0; *(float *)((int)buffer + 0x14) = ((float)(iVar11 / iVar12) * 40.0 + 120.0) - 20.0; *(float *)((int)buffer + 4) = ((float)(iVar10 / iVar12) * 40.0 + 120.0) - 20.0; *(float *)((int)buffer + 0x18) = (float)(iVar8 % iVar12) * 40.0 + 40.0 + 20.0; *(float *)buffer = ((float)(iVar10 % iVar12) * 40.0 + 40.0) - 20.0; *(float *)((int)buffer + 0x1c) = (float)(iVar8 / iVar12) * 40.0 + 120.0 + 20.0; return buffer; } //@@ 0081fae0 FUN_0081fae0 void FUN_0081fae0(undefined4 *param_1) { undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = param_1[2]; in_ECX[3] = param_1[3]; in_ECX[4] = param_1[4]; in_ECX[5] = param_1[5]; in_ECX[6] = param_1[6]; in_ECX[7] = param_1[7]; return; } //@@ 0081fb20 Room::GetLRoomTileDesc /* ZHL [exact] __thiscall LRoomTileDesc * Room::GetLRoomTileDesc(LRoomTileDesc * buffer); prototype: REPENTOGON, confirmed by RET 4 */ LRoomTileDesc * __thiscall Room::GetLRoomTileDesc(Room *this,LRoomTileDesc *buffer) { int iVar1; iVar1 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48) * 0x20; *buffer = *(LRoomTileDesc *)(&DAT_00c35b80 + iVar1); buffer[1] = *(LRoomTileDesc *)(&DAT_00c35b84 + iVar1); buffer[2] = *(LRoomTileDesc *)(&DAT_00c35b88 + iVar1); buffer[3] = *(LRoomTileDesc *)(&DAT_00c35b8c + iVar1); buffer[4] = *(LRoomTileDesc *)(&DAT_00c35b90 + iVar1); buffer[5] = *(LRoomTileDesc *)(&DAT_00c35b94 + iVar1); buffer[6] = *(LRoomTileDesc *)(&DAT_00c35b98 + iVar1); buffer[7] = *(LRoomTileDesc *)(&DAT_00c35b9c + iVar1); return buffer; } //@@ 0081fb70 LRoomTileDesc::GetRandomTile /* ZHL [exact] __thiscall XY * LRoomTileDesc::GetRandomTile(XY * ret, unsigned int seed); prototype: REPENTOGON, confirmed by RET 8 */ void * __thiscall LRoomTileDesc::GetRandomTile(LRoomTileDesc *this,void *ret,uint seed) { LRoomTileDesc LVar1; code *pcVar2; uint uVar3; void *pvVar4; uint uVar5; uint uVar6; uint uVar7; uint uVar8; uint uVar9; uint uVar10; uint uVar11; uVar3 = (int)this[3] - (int)this[1]; uVar6 = (int)this[2] - (int)*this; uVar5 = (int)this[7] - (int)this[5]; uVar11 = (int)this[6] - (int)this[4]; uVar7 = (int)(uVar3 * uVar6) >> 0x1f; uVar7 = (uVar3 * uVar6 ^ uVar7) - uVar7; uVar8 = (int)(uVar5 * uVar11) >> 0x1f; uVar8 = ((uVar5 * uVar11 ^ uVar8) - uVar8) + uVar7; if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pvVar4 = (void *)(*pcVar2)(); return pvVar4; } uVar9 = seed >> 1 ^ seed; uVar9 = uVar9 << 9 ^ uVar9; uVar10 = 0; uVar9 = uVar9 >> 0x1d ^ uVar9; if (uVar8 != 0) { uVar10 = uVar9 % uVar8; } if (uVar10 < uVar7) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pvVar4 = (void *)(*pcVar2)(); return pvVar4; } uVar9 = uVar9 >> 1 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 0x1d ^ uVar9; uVar8 = 0; if (uVar6 != 0) { uVar8 = uVar9 % uVar6; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pvVar4 = (void *)(*pcVar2)(); return pvVar4; } uVar9 = uVar9 >> 1 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; if (uVar3 == 0) { uVar3 = 0; } else { uVar3 = (uVar9 >> 0x1d ^ uVar9) % uVar3; } LVar1 = this[1]; *(uint *)ret = (int)*this + uVar8; *(uint *)((int)ret + 4) = (int)LVar1 + uVar3; return ret; } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pvVar4 = (void *)(*pcVar2)(); return pvVar4; } uVar9 = uVar9 >> 1 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 0x1d ^ uVar9; uVar3 = 0; if (uVar11 != 0) { uVar3 = uVar9 % uVar11; } LVar1 = this[4]; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pvVar4 = (void *)(*pcVar2)(); return pvVar4; } uVar9 = uVar9 >> 1 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; if (uVar5 == 0) { *(LRoomTileDesc *)((int)ret + 4) = this[5]; *(uint *)ret = (int)LVar1 + uVar3; return ret; } *(uint *)((int)ret + 4) = (int)this[5] + (uVar9 >> 0x1d ^ uVar9) % uVar5; *(uint *)ret = (int)LVar1 + uVar3; return ret; } //@@ 0081fd60 Room::RespawnEnemies /* ZHL [lua] Lua binding Room:RespawnEnemies */ void Room::RespawnEnemies(void) { uint *puVar1; int *piVar2; code *pcVar3; byte isSpawned; char cVar4; uint uVar5; int in_ECX; void *freeBlock; short *spawnEntry; undefined4 *puVar6; int iVar7; undefined1 auStack_6c [8]; void *pvStack_64; void *pvStack_60; undefined4 *puStack_5c; undefined4 *puStack_58; undefined1 auStack_54 [4]; undefined1 auStack_50 [4]; void *pvStack_4c; undefined1 auStack_48 [8]; void *spawnedEntitySet; undefined4 uStack_3c; void *respawnGridIdxSet; int respawnCount; int *piStack_30; undefined4 rngShift3; uint i; undefined4 *puStack_24; void *pvStack_20; int *roomData; int gridIdx; int *piStack_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; int currentRoomType; GridEntity_Door *door; int targetRoomType; uStack_8 = 0xffffffff; puStack_c = &LAB_00b017cd; local_10 = ExceptionList; ExceptionList = &local_10; uVar5 = *(uint *)(*(int *)(in_ECX + 4) + 0x5c); rngShift3 = 7; KAGE_LogMessage(1,(byte *)"SpawnRNG seed: %u\n"); iVar7 = *(int *)(in_ECX + 4); piVar2 = *(int **)(iVar7 + 0x14); roomData = *(int **)(iVar7 + 0x10); if (((piVar2 != (int *)0x0) && (*piVar2 == 0)) && (piVar2[2] == 6)) { roomData = piVar2; } *(int *)(iVar7 + 0x40) = *(int *)(iVar7 + 0x40) + 1; *(undefined1 *)(in_ECX + 1) = 0; respawnGridIdxSet = (void *)0x0; respawnCount = 0; respawnGridIdxSet = operator_new(0x14); *(void **)respawnGridIdxSet = respawnGridIdxSet; *(void **)((int)respawnGridIdxSet + 4) = respawnGridIdxSet; *(void **)((int)respawnGridIdxSet + 8) = respawnGridIdxSet; *(undefined2 *)((int)respawnGridIdxSet + 0xc) = 0x101; uStack_8 = 0; spawnedEntitySet = (void *)0x0; uStack_3c = 0; spawnedEntitySet = operator_new(0x14); *(void **)spawnedEntitySet = spawnedEntitySet; *(void **)((int)spawnedEntitySet + 4) = spawnedEntitySet; *(void **)((int)spawnedEntitySet + 8) = spawnedEntitySet; *(undefined2 *)((int)spawnedEntitySet + 0xc) = 0x101; puVar6 = (undefined4 *)0x0; pvStack_20 = (void *)0x0; pvStack_60 = (void *)0x0; puStack_5c = (undefined4 *)0x0; puStack_24 = (undefined4 *)0x0; puStack_58 = (undefined4 *)0x0; uStack_8 = CONCAT31(uStack_8._1_3_,2); i = 0; if ((short)roomData[0x11] != 0) { pvStack_20 = (void *)0x0; do { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar5 = uVar5 >> 2 ^ uVar5; uVar5 = uVar5 << 7 ^ uVar5; uVar5 = uVar5 >> ((byte)rngShift3 & 0x1f) ^ uVar5; spawnEntry = (short *)(roomData[0x10] + (int)pvStack_20); gridIdx = *spawnEntry + 1 + (spawnEntry[1] + 1) * *(int *)(in_ECX + 0xc); if ((char)spawnEntry[4] != '\0') { piStack_30 = Spawn::PickEntry(spawnEntry, (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283062e-10); piStack_14 = (int *)(*(int *)(in_ECX + 4) + 0x80); std::set::find_node(auStack_6c,&gridIdx); if (((*(char *)((int)pvStack_64 + 0xd) != '\0') || (gridIdx < *(int *)((int)pvStack_64 + 0x10))) || (pvStack_64 == (void *)*piStack_14)) { piStack_14 = (int *)0x0; isSpawned = SpawnEntry(); if ((isSpawned != 0) && (piStack_14 != (int *)0x0)) { std::set::insert(auStack_48,&gridIdx); FUN_008284a0(auStack_50,&piStack_14); if (puVar6 == puStack_24) { std::vector::_Emplace_reallocate(puVar6,&piStack_14); puStack_24 = puStack_58; puVar6 = puStack_5c; } else { *puVar6 = piStack_14; puStack_5c = puVar6 + 1; puVar6 = puStack_5c; } } } } pvStack_20 = (void *)((int)pvStack_20 + 0x10); i = i + 1; } while (i < *(ushort *)(roomData + 0x11)); pvStack_20 = pvStack_60; } uVar5 = (int)puVar6 - (int)pvStack_20 >> 2; i = 0; pvStack_60 = pvStack_20; if (uVar5 != 0) { do { piVar2 = *(int **)((int)pvStack_20 + i * 4); (**(code **)(*piVar2 + 0xc))(); cVar4 = (**(code **)(*piVar2 + 0x48))(); if (cVar4 != '\0') { puVar1 = (uint *)(*(int *)(in_ECX + 4) + 0x44); *puVar1 = *puVar1 & 0xfffffffe; puVar1 = (uint *)(*(int *)(in_ECX + 4) + 0x44); *puVar1 = *puVar1 & 0xffffff7f; } i = i + 1; } while (i < uVar5); } if (respawnCount == 0) { puVar1 = (uint *)(*(int *)(in_ECX + 4) + 0x44); *puVar1 = *puVar1 | 1; } else { uVar5 = 0; if (*(int *)(in_ECX + 0x1264) != 0) { do { piVar2 = *(int **)(*(int *)(in_ECX + 0x125c) + uVar5 * 4); piStack_30 = piVar2; _Find_lower_bound<>(auStack_6c,&piStack_30); if (((*(char *)((int)pvStack_64 + 0xd) != '\0') || (piVar2 < *(int **)((int)pvStack_64 + 0x10))) || (pvStack_64 == spawnedEntitySet)) { piStack_30 = (int *)piVar2[0xcb]; std::set::find_node(auStack_54,&piStack_30); if (((*(char *)((int)pvStack_4c + 0xd) == '\0') && (*(int *)((int)pvStack_4c + 0x10) <= piVar2[0xcb])) && (pvStack_4c != respawnGridIdxSet)) { (**(code **)(*piVar2 + 0x28))(); } } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)(in_ECX + 0x1264)); } puVar6 = (undefined4 *)(in_ECX + 0x724); iVar7 = 8; do { door = (GridEntity_Door *)*puVar6; if ((door != (GridEntity_Door *)0x0) && ((door->_desc)._state != 1)) { (door->_desc)._state = 1; GridEntity_Door::UpdateAnimation(door); currentRoomType = door->_currentRoomType; if ((currentRoomType == 7) || ((((targetRoomType = door->_targetRoomType, targetRoomType == 7 || (currentRoomType == 8) ) || (targetRoomType == 8)) || ((currentRoomType == 0x1d || (targetRoomType == 0x1d))) ))) { std::string::assign((door->_openAnimation)._buf,s_Open,4); } } puVar6 = puVar6 + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); } if (pvStack_20 != (void *)0x0) { uVar5 = (int)puStack_24 - (int)pvStack_20 & 0xfffffffc; freeBlock = pvStack_20; if (0xfff < uVar5) { freeBlock = *(void **)((int)pvStack_20 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvStack_20 + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar5); } FID_conflict__Erase_tree_>_> (&spawnedEntitySet, (fuzzer_allocator_> *)&spawnedEntitySet, *(_Tree_node **)((int)spawnedEntitySet + 4)); operator_delete(spawnedEntitySet,0x14); FID_conflict__Erase_tree_>_> (&respawnGridIdxSet, (fuzzer_allocator_> *)&respawnGridIdxSet, *(_Tree_node **)((int)respawnGridIdxSet + 4)); operator_delete(respawnGridIdxSet,0x14); ExceptionList = local_10; return; } //@@ 00820170 Room::TrySpawnBlueWombDoor /* ZHL [lua] Lua binding Room:TrySpawnBlueWombDoor */ uint Room::TrySpawnBlueWombDoor(char param_1,char param_2,char param_3) { code *pcVar1; byte isHasTrinket; RoomDescriptor *currentRoom; uint forcedCurses; uint preventedCurses; Manager *pMVar2; uint uVar3; void *door; Room *in_ECX; void **doorSlot; uint uVar4; int effectiveStage; int iVar5; void *local_10; undefined1 *puStack_c; int local_8; uint *flagsHigh; Game *game; qword oldStateFlags; local_8 = -1; puStack_c = &LAB_00b01801; local_10 = ExceptionList; ExceptionList = &local_10; if ((param_3 != '\0') || ((pMVar2 = ExceptionList, g_game->_challenge != 0x2c && (((g_manager->_persistentGameData)._achievements[0xea] != 0 || ((pMVar2 = g_manager, g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))) { isHasTrinket = PlayerManager::AnyoneHasTrinket(&g_game->_playerManager,0xaf); if (isHasTrinket != 0) { param_2 = '\x01'; } if (param_3 == '\0') { currentRoom = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); pMVar2 = (Manager *)currentRoom->ListIndex; if (pMVar2 != (Manager *)g_game->_lastBossRoomListIdx) goto LAB_00820448; } uVar3 = g_game->_debugCurses; iVar5 = g_game->_stage; uVar4 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); game = g_game; effectiveStage = iVar5 + 1; if ((~preventedCurses & (forcedCurses | uVar3 | uVar4) & 2) == 0) { effectiveStage = iVar5; } pMVar2 = (Manager *)Game::GetChallengeParams(g_game); if ((param_3 != '\0') || (((((pMVar2->_persistentGameData)._achievements[0x33] == 0 || (effectiveStage < *(int *)&(pMVar2->_persistentGameData).field_0x2c)) && (effectiveStage == 8)) && ((pMVar2 = (Manager *)game->_stageType, pMVar2 != (Manager *)&DAT_00000004 && (pMVar2 != (Manager *)&DAT_00000005)))))) { pMVar2 = (Manager *)0x0; doorSlot = in_ECX->_doors; do { if ((*doorSlot != (void *)0x0) && (*(int *)((int)*doorSlot + 0x394) == -8)) goto LAB_00820448; pMVar2 = (Manager *)&pMVar2->field_0x1; doorSlot = doorSlot + 1; } while ((int)pMVar2 < 8); pMVar2 = (Manager *)game->_timeCounter; if ((((int)pMVar2 <= game->_blueWombParTime) || (param_2 != '\0')) || (param_3 != '\0')) { uVar3 = game->_enterDoor; if (((game->_lastRoomIdx != -8) || ((int)uVar3 < 0)) || (in_ECX->_doors[uVar3] != (void *)0x0)) { uVar4 = *(uint *)((int)in_ECX->_descriptor + 0x58); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); uVar3 = (*pcVar1)(); return uVar3; } uVar4 = uVar4 >> 1 ^ uVar4; iVar5 = 0; uVar4 = uVar4 << 0xb ^ uVar4; do { uVar3 = iVar5 + ((uVar4 >> 0x10 ^ uVar4) & 7) & 0x80000007; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff8) + 1; } pMVar2 = (Manager *)(uVar3 >> 5); if (((*(uint *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 0x38 + (int)pMVar2 * 4) & 1 << ((byte)uVar3 & 0x1f)) != 0) && (in_ECX->_doors[uVar3] == (void *)0x0)) break; iVar5 = iVar5 + 1; } while (iVar5 < 8); if ((int)uVar3 < 0) goto LAB_00820448; } if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) { _Init_thread_header(&g_invalidRoomDescriptorGuard); if (g_invalidRoomDescriptorGuard == -1) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = -1; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } } door = in_ECX->_doors[uVar3]; if (door == (void *)0x0) { MakeDoor(in_ECX,uVar3); door = in_ECX->_doors[uVar3]; } *(undefined4 *)((int)door + 0x394) = 0xfffffff8; GridEntity_Door::SetRoomTypes (in_ECX->_doors[uVar3],*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 8),1); GridEntity_Door::Open(in_ECX->_doors[uVar3]); if (param_1 != '\0') { GridEntity_Door::SpawnDust(in_ECX->_doors[uVar3]); } game = g_game; oldStateFlags = g_game->_gameStateFlags; flagsHigh = (uint *)((int)&g_game->_gameStateFlags + 4); *flagsHigh = *flagsHigh | 0x80; *(int *)&game->_gameStateFlags = (int)oldStateFlags; ExceptionList = local_10; return CONCAT31((int3)(oldStateFlags >> 8),1); } } } LAB_00820448: ExceptionList = local_10; return (uint)pMVar2 & 0xffffff00; } //@@ 008204b0 Room::TrySpawnTheVoidDoor /* ZHL [lua] Lua binding Room:TrySpawnTheVoidDoor */ undefined4 Room::TrySpawnTheVoidDoor(char param_1) { uint uVar1; uint uVar2; Game *this; uint uVar3; uint uVar4; uint uVar5; ChallengeParam *pCVar6; void *pvVar7; Room *in_ECX; int iVar8; int iVar9; int iVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01831; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; if ((param_1 == '\0') && (g_game->_challenge == 0x2c)) { return 0; } uVar1 = g_game->_debugCurses; iVar8 = g_game->_stage; uVar2 = g_game->_curses; ExceptionList = &local_10; uVar4 = Seeds::GetForcedCurses(); uVar5 = Seeds::GetPreventedCurses(); this = g_game; iVar10 = iVar8 + 1; if ((~uVar5 & (uVar4 | uVar1 | uVar2) & 2) == 0) { iVar10 = iVar8; } if (param_1 == '\0') { if (iVar10 != 9) { ExceptionList = local_10; return 0; } if (*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 8) != 5) { ExceptionList = local_10; return 0; } if (g_game->_currentRoomIdx < 0) { ExceptionList = local_10; return 0; } if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) goto LAB_00820601; pCVar6 = Game::GetChallengeParams(g_game); iVar8 = 0xc; if ((pCVar6->_endStage != 0xc) && (((this->_challenge != 0 || ((this->_dailyChallenge)._id != 0)) || (((g_manager->_persistentGameData)._achievements[0x140] == 0 && ((g_manager->_state != 2 || (this->_isDebug == 0)))))))) { iVar8 = 0xb; } iVar9 = iVar8; if (pCVar6->_isPathTypeSet != 0) { iVar9 = pCVar6->_endStage; if (pCVar6->_endStage == 0) { iVar9 = iVar8; } if (pCVar6->_pathType == 3) goto LAB_00820601; } if ((iVar9 < 0xc) || ((this->_levelStateFlags & 0x200000U) != 0)) goto LAB_00820601; } pCVar6 = Game::GetChallengeParams(this); if ((param_1 != '\0') || ((pCVar6->_isPathTypeSet == 0 || (iVar10 < pCVar6->_endStage)))) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < g_invalidRoomDescriptorGuard) && (_Init_thread_header(&g_invalidRoomDescriptorGuard,uVar3), g_invalidRoomDescriptorGuard == -1 )) { local_8 = 0; RoomDescriptor::constructor(&g_roomDescriptorDummy); _atexit(FUN_00b15b30); local_8 = 0xffffffff; _Init_thread_footer(&g_invalidRoomDescriptorGuard); } pvVar7 = in_ECX->_doors[5]; if (pvVar7 == (void *)0x0) { MakeDoor(in_ECX,5); pvVar7 = in_ECX->_doors[5]; } *(undefined4 *)((int)pvVar7 + 0x394) = 0xfffffff7; GridEntity_Door::SetRoomTypes (in_ECX->_doors[5],*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 8),1); GridEntity_Door::Open(in_ECX->_doors[5]); ExceptionList = local_10; return 1; } LAB_00820601: this->_levelStateFlags = this->_levelStateFlags | 0x200000; ExceptionList = local_10; return 0; } //@@ 008206e0 FUN_008206e0 undefined4 FUN_008206e0(void) { undefined4 uVar1; int in_ECX; if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { return 0x29; } uVar1 = 9; if ((*(uint *)(*(int *)(in_ECX + 4) + 0x44) >> 6 & 1) != 0) { uVar1 = 0x1a; } return uVar1; } //@@ 00820720 Room::GetBossVictoryJingle /* ZHL [exact] __thiscall uint32_t Room::GetBossVictoryJingle(); */ undefined4 __thiscall Room::GetBossVictoryJingle(Room *this) { Game *pGVar1; int iVar2; undefined4 uVar3; pGVar1 = g_game; if ((g_game->_stage != 0xd) || (g_game->_stageType != 1)) { iVar2 = Level::get_secret_exit_kind((Level *)g_game); if ((iVar2 != 4) || (pGVar1->_currentRoomIdx != -10)) { if ((*(int *)((int)pGVar1->_room + 8) == 6) || (*(char *)((int)pGVar1->_room + 0x7228) != '\0')) { return 0x5c; } if ((pGVar1->_stageType == 4) || (pGVar1->_stageType == 5)) { return 0x2a; } uVar3 = 0x53; if ((*(uint *)((int)this->_descriptor + 0x44) >> 6 & 1) != 0) { uVar3 = 0x61; } return uVar3; } } return 0; } //@@ 008207a0 FUN_008207a0 uint FUN_008207a0(void) { uint *puVar1; void *pvVar2; Game *this; EntityList_EL *pEVar3; int in_ECX; uint uVar4; EntityList_EL local_28; Vector local_18; void *local_10; undefined1 *puStack_c; int local_8; this = g_game; local_8 = -1; puStack_c = &LAB_00af1690; local_10 = ExceptionList; ExceptionList = &local_10; pEVar3 = ExceptionList; if ((((g_game->_stage == 1) && ((g_game->_levelStateFlags & 0x10000U) != 0)) && (pEVar3 = (EntityList_EL *)g_game->_currentRoomIdx, pEVar3 == (EntityList_EL *)g_game->_startingRoomIdx)) && (pvVar2 = (g_game->_itemPool)._removedCollectibles._begin, (*(byte *)((int)pvVar2 + 0x44) & 0x40) == 0)) { Room::GetCenterPos(&local_18); puVar1 = (uint *)((int)pvVar2 + 0x44); *puVar1 = *puVar1 | 0x40; uVar4 = 0; if (*(int *)(in_ECX + 4) != 0) { uVar4 = *(uint *)(*(int *)(in_ECX + 4) + 0x5c); } Game::SpawnEx(this,5,0x6e,&local_18,&g_vectorZero,(Entity *)0x0,0,uVar4,0); Game::ShakeScreen(g_game,8); pEVar3 = EntityList::QuerySublist((EntityList *)(in_ECX + 0x1218),&local_28,1000,0x73,-1,0,0); uVar4 = 0; if (local_28._size != 0) { do { pEVar3 = *(EntityList_EL **)((int)local_28._data + uVar4 * 4); uVar4 = uVar4 + 1; *(undefined4 *)(pEVar3 + 0x45) = 1; } while (uVar4 < (uint)local_28._size); } if (local_28._0_1_ == '\0') { local_8 = 0; pEVar3 = tracked_alloc(1,local_28._data,0); } } ExceptionList = local_10; return (uint)pEVar3 & 0xffffff00; } //@@ 008208c0 Room::HasWater /* ZHL [lua] Lua binding Room:HasWater */ bool __thiscall Room::HasWater(Room *this) { return 0.0 < this->_waterAmount; } //@@ 008208e0 Room::IsCurrentRoomLastBoss /* ZHL [lua] Lua binding Room:IsCurrentRoomLastBoss */ bool Room::IsCurrentRoomLastBoss(void) { RoomDescriptor *pRVar1; pRVar1 = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); return pRVar1->ListIndex == g_game->_lastBossRoomListIdx; } //@@ 00820910 Room::MamaMegaExplosion /* ZHL [lua] Lua binding Room:MamaMegaExplosion */ void __thiscall Room::MamaMegaExplosion(Room *this,Vector *param_2,Entity_Player *param_3) { uint *puVar1; float fVar2; int iVar3; uint seed; Entity *pEVar4; Entity_Player *pEVar5; float fVar6; float fVar7; float fVar8; puVar1 = (uint *)((int)this->_descriptor + 0x44); *puVar1 = *puVar1 | 0x4000; seed = Random(); if (param_3 == (Entity_Player *)0x0) { param_3 = Game::GetPlayer(g_game,0); } pEVar4 = Game::SpawnEx(g_game,1000,0x7f,param_2,&g_vectorZero,(Entity *)param_3,0,seed,0); if ((param_2->x != g_vectorZero.x) || (param_2->y != g_vectorZero.y)) { fVar2 = param_2->y; iVar3 = *(int *)pEVar4; (pEVar4->_targetPosition).x = param_2->x; (pEVar4->_targetPosition).y = fVar2; (**(code **)(iVar3 + 0xc))(); return; } pEVar5 = Game::GetPlayer(g_game,0); fVar2 = (pEVar5->_pos).x; fVar8 = fVar2 - (((this->_bottomRightPos).x - (this->_topLeftPos).x) * 0.5 + (this->_topLeftPos).x ); fVar7 = (pEVar5->_pos).y - (((this->_bottomRightPos).y - (this->_topLeftPos).y) * 0.5 + (this->_topLeftPos).y); fVar6 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (0.0 < fVar6) { fVar8 = fVar8 * (200.0 / fVar6); fVar7 = fVar7 * (200.0 / fVar6); } iVar3 = *(int *)pEVar4; (pEVar4->_targetPosition).y = fVar7 + (pEVar5->_pos).y; (pEVar4->_targetPosition).x = fVar2 + fVar8; (**(code **)(iVar3 + 0xc))(); return; } //@@ 00820aa0 Room::GetDungeonRockIdx /* ZHL [lua] Lua binding Room:GetDungeonRockIdx */ int __thiscall Room::GetDungeonRockIdx(Room *this) { if ((g_game->_levelStateFlags & 0x2000U) == 0) { return this->_dungeonRockIdx; } return -1; } //@@ 00820ac0 Room::TurnGold /* ZHL [lua] Lua binding Room:TurnGold */ void Room::TurnGold(void) { void *pvVar1; Room *in_ECX; uint GridIndex; void **ppvVar2; GridEntityDesc local_d0; undefined4 local_b0; undefined4 uStack_ac; undefined4 local_a8; undefined4 local_9c [8]; undefined4 local_7c; undefined4 uStack_78; undefined4 local_74; undefined4 local_70 [12]; undefined4 local_40 [15]; local_b0 = 0; uStack_ac = 0; local_a8 = 0; local_7c = 0; uStack_78 = 0; local_74 = 0; if (&in_ECX->_floorColor != (ColorMod *)local_70) { (in_ECX->_floorColor)._offset[0] = 0.0; (in_ECX->_floorColor)._offset[1] = 0.0; (in_ECX->_floorColor)._tint[0] = 1.0; (in_ECX->_floorColor)._tint[1] = 1.0; (in_ECX->_floorColor)._tint[2] = 1.0; (in_ECX->_floorColor)._tint[3] = 1.0; (in_ECX->_floorColor)._offset[2] = 0.0; (in_ECX->_floorColor)._colorize[0] = 5.0; (in_ECX->_floorColor)._colorize[1] = 3.0; (in_ECX->_floorColor)._colorize[2] = 0.0; (in_ECX->_floorColor)._colorize[3] = 0.8; } if (&in_ECX->_wallColor != (ColorMod *)local_40) { (in_ECX->_wallColor)._offset[0] = 0.0; (in_ECX->_wallColor)._offset[1] = 0.0; (in_ECX->_wallColor)._tint[0] = 1.0; (in_ECX->_wallColor)._tint[1] = 1.0; (in_ECX->_wallColor)._tint[2] = 1.0; (in_ECX->_wallColor)._tint[3] = 1.0; (in_ECX->_wallColor)._offset[2] = 0.0; (in_ECX->_wallColor)._colorize[0] = 5.0; (in_ECX->_wallColor)._colorize[1] = 3.0; (in_ECX->_wallColor)._colorize[2] = 0.0; (in_ECX->_wallColor)._colorize[3] = 0.8; } GridIndex = 0; ppvVar2 = in_ECX->_gridEntities; do { if ((GridIndex < 0x1c0) && (pvVar1 = *ppvVar2, pvVar1 != (void *)0x0)) { if (*(int *)((int)pvVar1 + 4) == 0xe) { if (*(int *)((int)pvVar1 + 8) != 3) { local_d0._type = *(int *)((int)pvVar1 + 4); local_d0._state = *(int *)((int)pvVar1 + 0xc); local_d0._spawnCount = *(int *)((int)pvVar1 + 0x10); local_d0._variant = 3; local_d0._spawnSeed = *(int *)((int)pvVar1 + 0x14); local_d0._varData = *(int *)((int)pvVar1 + 0x18); local_d0._24_4_ = *(undefined4 *)((int)pvVar1 + 0x1c); local_d0._variableSeed = *(int *)((int)pvVar1 + 0x20); SpawnGridEntityDesc(in_ECX,GridIndex,&local_d0); } } else if ((undefined4 *)((int)pvVar1 + 0xe8) != local_9c) { *(undefined4 *)((int)pvVar1 + 0x108) = local_7c; *(undefined4 *)((int)pvVar1 + 0x10c) = uStack_78; *(undefined4 *)((int)pvVar1 + 0xe8) = 0x3f800000; *(undefined4 *)((int)pvVar1 + 0xec) = 0x3f800000; *(undefined4 *)((int)pvVar1 + 0xf0) = 0x3f800000; *(undefined4 *)((int)pvVar1 + 0xf4) = 0x3f800000; *(undefined4 *)((int)pvVar1 + 0x110) = local_74; *(undefined4 *)((int)pvVar1 + 0xf8) = 0x40400000; *(undefined4 *)((int)pvVar1 + 0xfc) = 0x3fe66666; *(undefined4 *)((int)pvVar1 + 0x100) = 0; *(undefined4 *)((int)pvVar1 + 0x104) = 0x3f4ccccd; } } GridIndex = GridIndex + 1; ppvVar2 = ppvVar2 + 1; } while ((int)GridIndex < 0x1c0); return; } //@@ 00820c00 Room::WorldToScreenPosition /* ZHL [lua] Lua binding Room:WorldToScreenPosition */ void __thiscall Room::WorldToScreenPosition(Room *this,float *param_2,float param_3,float param_4) { float fVar1; float fVar2; float fVar3; double dVar4; double dVar5; fVar3 = g_displayPixelRatio * g_screenPointScale; dVar4 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (param_3 - 60.0) * 0.65) * fVar3 + 0.5)); dVar5 = floor((double)(((g_screenHeight - 182.0) * 0.5 + (param_4 - 140.0) * 0.65) * fVar3 + 0.5)) ; fVar1 = (this->_renderScrollOffset).y; fVar2 = (g_game->_screenShakeOffset).y; *param_2 = (float)dVar4 / fVar3 + (this->_renderScrollOffset).x + (g_game->_screenShakeOffset).x; param_2[1] = (float)dVar5 / fVar3 + fVar1 + fVar2; return; } //@@ 00820d30 Room::record_killed_npc /* DB: ? ECX=Room: skips some types (0xd8, 0xef, 0xf4.2, 0x194.1, 0x38d, 0x390, 0x396 ...), takes type/variant/subtype/champion color(+0x3ec)/flag 0x20000000 and position (FindFreeTilePosition if on a grid collision) and pushes it to a std::list at Room+0x7300 capped at 32 ("list too long"); from Entity_NPC::trigger_kill_item_effects */ void Room::record_killed_npc(int param_1) { float fVar1; float fVar2; undefined2 subtype16; int iVar3; Vector *freePos; int *node; Room *in_ECX; int npcType; undefined4 uStack_48; Vector local_44; undefined4 championColor; undefined4 local_38; undefined4 local_34; Vector local_30; float posX; undefined1 isFriendly; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; undefined4 championColorCopy; uint listSize; undefined4 *prevNode; undefined2 variant16; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0185d; local_1c = ExceptionList; npcType = *(int *)(param_1 + 0x28); if (npcType < 0xd9) { if (npcType == 0xd8) { return; } switch(npcType) { case 0x13: case 0x1c: case 0x23: case 0x3e: case 0x59: goto switchD_00820d91_caseD_13; } switchD_00820d91_caseD_14: if (npcType == 0x199) { iVar3 = *(int *)(param_1 + 0x2c); goto joined_r0x00820dc1; } } else { if (0x38d < npcType) { if (npcType == 0x390) { return; } if (npcType == 0x396) { return; } goto switchD_00820d91_caseD_14; } if (npcType == 0x38d) { return; } if (npcType == 0xef) { return; } if (npcType == 0xf4) { if (*(int *)(param_1 + 0x2c) == 2) { return; } goto switchD_00820d91_caseD_14; } if (npcType != 0x194) goto switchD_00820d91_caseD_14; iVar3 = *(int *)(param_1 + 0x2c); joined_r0x00820dc1: if (iVar3 == 1) { return; } } local_34 = *(undefined4 *)(param_1 + 0x2c); local_44.x = *(float *)(param_1 + 0x33c); local_38 = *(undefined4 *)(param_1 + 0x30); championColor = *(undefined4 *)(param_1 + 0x3ec); isFriendly = (*(uint *)(param_1 + 0x168) & 0x20000000) != 0; local_44.y = *(float *)(param_1 + 0x340); if (npcType == 0x23) { npcType = 0xb; } ExceptionList = &local_1c; local_30.y = local_44.y; posX = local_44.x; iVar3 = GetGridCollisionAtPos(in_ECX,*(Vector *)(param_1 + 0x33c)); if (iVar3 != 0) { freePos = FindFreeTilePosition(in_ECX,&local_30,&local_44,40.0); posX = freePos->x; local_30.y = freePos->y; } listSize = *(uint *)&in_ECX->field_0x7304; championColorCopy = championColor; fVar1 = local_30.y; fVar2 = posX; while (championColor = championColorCopy, local_30.y = fVar1, posX = fVar2, 0x1f < listSize) { node = *(int **)(*(int *)&in_ECX->field_0x7300 + 4); iVar3 = *node; *(int *)&in_ECX->field_0x7304 = *(int *)&in_ECX->field_0x7304 + -1; *(int *)node[1] = iVar3; *(int *)(iVar3 + 4) = node[1]; operator_delete(node,0x20); championColorCopy = championColor; fVar1 = local_30.y; fVar2 = posX; listSize = *(uint *)&in_ECX->field_0x7304; } variant16 = (undefined2)local_34; subtype16 = (undefined2)local_38; uStack_48 = CONCAT31(uStack_48._1_3_,isFriendly); iVar3 = **(int **)&in_ECX->field_0x7300; if (*(int *)&in_ECX->field_0x7304 == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_14 = 0; local_44.y = 0.0; local_44.x = (float)&in_ECX->field_0x7300; node = operator_new(0x20); node[2] = (int)fVar2; node[3] = (int)fVar1; node[4] = npcType; node[5] = CONCAT22(subtype16,variant16); *(ulonglong *)(node + 6) = CONCAT44(uStack_48,championColorCopy); *(int *)&in_ECX->field_0x7304 = *(int *)&in_ECX->field_0x7304 + 1; prevNode = *(undefined4 **)(iVar3 + 4); *node = iVar3; node[1] = (int)prevNode; *(int **)(iVar3 + 4) = node; *prevNode = node; switchD_00820d91_caseD_13: ExceptionList = local_1c; return; } //@@ 00820fd0 Room::render_water /* DB: ? this=Room (ESI=ECX): early-out unless _waterAmount (+0x7240)>0 and option Manager+0x2a3c9; renders screen-size pass with _floorColor +0x72a4, backdrop 0x2d special, KAGE_ColorTextureShader, RenderTarget push/pop; last call of 0080ea80 Room::render_lighting render stage) */ void __thiscall Room::render_water(Room *this) { void *pvVar1; ColorMod color; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; LayerState *layer; int iVar11; int *piVar12; undefined4 *renderTargetEntry; uint hashChar; byte lowerChar; uint uVar13; Room *room; float gridCount; int iVar14; void **gridEntityIt; char *shaderNameChar; float brightness; float fVar15; double dVar16; Color aCStackY_16d8 [128]; Color tintedFloorColor; int savedBlendMode0; int savedBlendMode1; int savedBlendMode2; int savedBlendMode3; float renderOffsetX; float local_30; float savedShakeY; float savedShakeX; int savedBlendMode4; Room *local_20; byte local_1c; uint local_18; float local_14; Game *game; byte shaderChar; fVar15 = g_vectorZero.y; game = g_game; if ((0.0 < this->_waterAmount) && ((g_manager->_optionsConfig)._enableWaterSurface != 0)) { gridCount = (float)(this->_gridWidth * this->_gridHeight); savedShakeX = (g_game->_screenShakeOffset).x; savedShakeY = (g_game->_screenShakeOffset).y; (g_game->_screenShakeOffset).x = g_vectorZero.x; (game->_screenShakeOffset).y = fVar15; local_20 = this; local_14 = gridCount; FUN_00683680(); savedBlendMode0 = g_graphicsManager_blendMode[0]; savedBlendMode1 = g_graphicsManager_blendMode[1]; savedBlendMode2 = g_graphicsManager_blendMode[2]; savedBlendMode3 = g_graphicsManager_blendMode[3]; savedBlendMode4 = g_graphicsManager_blendMode[4]; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c797f4,0); g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; RenderTarget::Clear(&DAT_00c798e0); if ((this->_backdropType == 0x2d) && (fVar15 = this->_waterAmount, 0.0 < fVar15)) { Color::operator_assign(&tintedFloorColor,&this->_floorColor); brightness = fVar15 * 0.6 + 1.0; tintedFloorColor._tint[0] = tintedFloorColor._tint[0] * brightness; tintedFloorColor._tint[1] = tintedFloorColor._tint[1] * brightness; tintedFloorColor._tint[2] = tintedFloorColor._tint[2] * brightness; tintedFloorColor._offset[0] = fVar15 * 0.08 + tintedFloorColor._offset[0]; tintedFloorColor._offset[1] = fVar15 * 0.06 + tintedFloorColor._offset[1]; tintedFloorColor._offset[2] = fVar15 * 0.03 + tintedFloorColor._offset[2]; Color::operator_assign(aCStackY_16d8 + 0x81,(ColorMod *)&tintedFloorColor); } Backdrop::RenderFloor(&g_vectorZero); if (0 < (int)gridCount) { gridEntityIt = this->_gridEntities; local_18 = (uint)local_14; do { piVar12 = *gridEntityIt; if ((piVar12 != (int *)0x0) && (piVar12[1] == 1)) { renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; (**(code **)(*piVar12 + 0xc))(); } gridEntityIt = gridEntityIt + 1; local_18 = local_18 + -1; } while (local_18 != 0); local_18 = 0; gridCount = local_14; } (this->_entityList)._renderCursor = 0; (this->_entityList)._renderMode = 4; renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; EntityList::render_up_to(); uVar2 = (this->_floorColor)._tint[0]; uVar3 = (this->_floorColor)._tint[1]; uVar4 = (this->_floorColor)._tint[2]; uVar5 = (this->_floorColor)._tint[3]; uVar6 = (this->_floorColor)._colorize[0]; uVar7 = (this->_floorColor)._colorize[1]; uVar8 = (this->_floorColor)._colorize[2]; uVar9 = (this->_floorColor)._colorize[3]; uVar10 = (this->_floorColor)._offset[0]; color._offset[0] = (float)uVar10; color._colorize[3] = (float)uVar9; color._colorize[2] = (float)uVar8; color._colorize[1] = (float)uVar7; color._colorize[0] = (float)uVar6; color._tint[3] = (float)uVar5; color._tint[2] = (float)uVar4; color._tint[1] = (float)uVar3; color._tint[0] = (float)uVar2; color._offset[1] = (float)(int)((ulonglong)*(undefined8 *)(this->_floorColor)._offset >> 0x20); color._offset[2] = (this->_floorColor)._offset[2]; Backdrop::RenderWalls(&this->_backdrop,&g_vectorZero,color); renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; RailManager::Render(); if (0 < (int)gridCount) { gridEntityIt = this->_gridEntities; do { if ((*gridEntityIt != (int *)0x0) && ((**(code **)(*(int *)*gridEntityIt + 0x18))(), (local_1c & 8) == 0)) { renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; (**(code **)(*(int *)*gridEntityIt + 0xc))(); } gridEntityIt = gridEntityIt + 1; local_14 = (float)((int)local_14 + -1); } while (local_14 != 0.0); } if ((this->_backdropType == 0x20) && ((*(uint *)((int)this->_descriptor + 0x44) >> 5 & 1) != 0)) { render_water_overlay(); iVar11 = this->_gridWidth; iVar14 = this->_gridHeight; local_18 = 0; if (0 < iVar11 * iVar14) { gridEntityIt = this->_gridEntities; do { pvVar1 = *gridEntityIt; if ((pvVar1 != (void *)0x0) && (*(int *)((int)pvVar1 + 4) == 7)) { layer = ANM2::GetLayer((ANM2 *)((int)pvVar1 + 0x40),(byte *)0x0); layer->_visible = 0; renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; (**(code **)(*(int *)*gridEntityIt + 0xc))(); layer = ANM2::GetLayer((ANM2 *)((int)*gridEntityIt + 0x40),(byte *)0x0); layer->_visible = 1; } iVar11 = this->_gridWidth; local_18 = local_18 + 1; gridEntityIt = gridEntityIt + 1; } while ((int)local_18 < iVar11 * this->_gridHeight); iVar14 = this->_gridHeight; } local_18 = 0; if (0 < iVar11 * iVar14) { gridEntityIt = this->_gridEntities; do { pvVar1 = *gridEntityIt; if ((pvVar1 != (void *)0x0) && (*(int *)((int)pvVar1 + 4) == 7)) { layer = ANM2::GetLayer((ANM2 *)((int)pvVar1 + 0x40),(byte *)0x0); layer->_visible = 0; renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; (**(code **)(*(int *)*gridEntityIt + 0xc))(); layer = ANM2::GetLayer((ANM2 *)((int)*gridEntityIt + 0x40),(byte *)0x0); layer->_visible = 1; } local_18 = local_18 + 1; gridEntityIt = gridEntityIt + 1; } while ((int)local_18 < this->_gridWidth * this->_gridHeight); } } renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; render_pit_rails((Room *)&this->_railManager); FXLayers::render_underwater_layers(); iVar11 = this->_gridHeight; local_18 = 0; if (0 < iVar11) { do { iVar14 = this->_gridWidth; if (((iVar14 < 1) || ((int)local_18 < 0)) || (iVar11 <= (int)local_18)) { iVar11 = -1; } else { iVar11 = iVar14 * local_18; } local_14 = (((float)(iVar11 / iVar14) * 40.0 + 120.0) - 20.0) * 100.0 + 10030.0 + 0.5; dVar16 = floor((double)local_14); local_14 = (float)dVar16; local_14 = (float)__ftoui3(); renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; EntityList::render_up_to(); iVar11 = this->_gridHeight; local_18 = local_18 + 1; } while ((int)local_18 < iVar11); } renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; EntityList::render_up_to(); renderOffsetX = -(this->_renderSurfaceTopLeft).x; local_30 = -(this->_renderSurfaceTopLeft).y; room = this; if ((this->_entityList)._renderCursor != 0) { uVar13 = 0; do { (**(code **)(**(int **)((int)(this->_entityList)._renderEL._data + uVar13 * 4) + 0x1c))(); uVar13 = uVar13 + 1; } while (uVar13 < (uint)(this->_entityList)._renderCursor); room = local_20; } (this->_entityList)._renderMode = 0; (room->_entityList)._renderCursor = 0; (room->_entityList)._renderMode = 2; renderOffsetX = -(room->_renderSurfaceTopLeft).x; local_30 = -(room->_renderSurfaceTopLeft).y; EntityList::render_up_to(); (room->_entityList)._renderMode = 5; iVar11 = room->_gridHeight; local_18 = 0; if (0 < iVar11) { do { iVar14 = room->_gridWidth; if (((iVar14 < 1) || ((int)local_18 < 0)) || (iVar11 <= (int)local_18)) { iVar11 = -1; } else { iVar11 = iVar14 * local_18; } local_20 = (Room *)((((float)(iVar11 / iVar14) * 40.0 + 120.0) - 20.0) * 100.0 + 10030.0 + 0.5); dVar16 = floor((double)(float)local_20); local_20 = (Room *)(float)dVar16; local_20 = (Room *)__ftoui3(); renderOffsetX = -(room->_renderSurfaceTopLeft).x; local_30 = -(room->_renderSurfaceTopLeft).y; EntityList::render_up_to(); iVar11 = room->_gridHeight; local_18 = local_18 + 1; } while ((int)local_18 < iVar11); } renderOffsetX = -(room->_renderSurfaceTopLeft).x; local_30 = -(room->_renderSurfaceTopLeft).y; EntityList::render_up_to(); renderOffsetX = -(room->_renderSurfaceTopLeft).x; local_30 = -(room->_renderSurfaceTopLeft).y; EntityList::render_up_to(); uVar13 = 0; if ((this->_entityList)._renderCursor != 0) { do { (**(code **)(**(int **)((int)(this->_entityList)._renderEL._data + uVar13 * 4) + 0x1c))(); uVar13 = uVar13 + 1; } while (uVar13 < (uint)(this->_entityList)._renderCursor); } (this->_entityList)._renderMode = 0; uVar13 = 0x1505; shaderNameChar = "KAGE_ColorTextureShader"; shaderChar = 0x4b; do { shaderNameChar = shaderNameChar + 1; lowerChar = shaderChar + 0x20; if (0x19 < (byte)(shaderChar + 0xbf)) { lowerChar = shaderChar; } hashChar = (uint)lowerChar; if (lowerChar == 0x5c) { hashChar = 0x2f; } uVar13 = uVar13 * 0x21 + hashChar; shaderChar = *shaderNameChar; } while (shaderChar != 0); local_18 = uVar13; _Find_lower_bound<>(); if (((*(char *)((int)local_30 + 0xd) == '\0') && (*(uint *)((int)local_30 + 0x10) <= uVar13)) && (local_30 != DAT_00c379bc)) { piVar12 = (int *)std::map::operator_index(); pvVar1 = (void *)*piVar12; if ((pvVar1 != (void *)0x0) && ((*(byte *)((int)pvVar1 + 4) & 1) != 0)) { g_currentShader = pvVar1; } } _glfw_context_reset(); g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = savedBlendMode2; g_graphicsManager_blendMode[3] = savedBlendMode3; g_graphicsManager_blendMode[4] = savedBlendMode4; g_graphicsManager_flags = g_graphicsManager_flags | 2; if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); game = g_game; g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } (g_game->_screenShakeOffset).x = savedShakeX; (game->_screenShakeOffset).y = savedShakeY; } return; } //@@ 00821940 FUN_00821940 void FUN_00821940(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x72a1) = 0; return; } //@@ 00821950 Room::render_water_shader /* DB: ? Room::Render else-branch: shader_cache_find + uniforms ColorMul/CurrentDir/PixelationAmount/TextureSize from room +0x1b30..+0x1b54 and rect +0x6ae0..+0x6aec, render_quad_set_rect prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Room::render_water_shader(Room *shader,Vector *renderOffset) { float *offsetIter; Vector *quadSizePtr; undefined4 extraout_EAX; int iVar1; int unused; int unused_00; int unused_01; int unused_02; int unusedArg; undefined *shader; float colorBlue; float fVar2; float fVar3; float colorRed; float colorGreen; float local_130 [2]; int quadCount; float quadOffsets [4]; Vector quadSizes; undefined4 local_10c; undefined4 uStack_108; int *local_104; KColor quadColor; Vector local_dc; void *seedNode; float shaderParams; float fStack_cc; float fStack_c8; float fStack_c4; undefined4 local_c0; float uvQuad; float local_a0; float local_9c; float local_98; float local_94; float local_90; float local_8c; float local_88; undefined1 local_84; undefined1 quad [124]; code *drawFn; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; shader = &DAT_00c79708; if ((DAT_00c7970c & 1) == 0) { shader = g_currentShader; } if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } iVar1 = 2; offsetIter = quadOffsets; do { offsetIter[1] = 0.0; *offsetIter = 0.0; iVar1 = iVar1 + -1; offsetIter = offsetIter + 2; } while (iVar1 != 0); iVar1 = 2; quadSizePtr = &quadSizes; do { quadSizePtr->y = 0.0; quadSizePtr->x = 0.0; iVar1 = iVar1 + -1; quadSizePtr = quadSizePtr + 1; } while (iVar1 != 0); quadCount = 1; quadOffsets[0] = 52.0; quadOffsets[1] = 52.0; quadSizes.x = (*(float *)&shader->field_0x6ae8 - *(float *)&shader->field_0x6ae0) + 0.0; quadSizes.y = (*(float *)&shader->field_0x6aec - *(float *)&shader->field_0x6ae4) + 0.0; if ((shader->_descriptor == (void *)0x0) || (iVar1 = *(int *)((int)shader->_descriptor + 0x10), iVar1 == 0)) goto LAB_00821b14; switch(*(undefined4 *)(iVar1 + 0x48)) { case 2: case 7: quadSizes.y = quadSizes.y - 104.0; quadOffsets[1] = 104.0; goto LAB_00821b14; case 3: case 5: quadSizes.x = quadSizes.x - 208.0; quadOffsets[0] = 156.0; default: goto LAB_00821b14; case 9: quadOffsets[0] = 390.0; quadOffsets[2] = 52.0; quadOffsets[3] = 234.0; break; case 10: quadOffsets[2] = 390.0; quadOffsets[3] = 234.0; break; case 0xb: quadOffsets[0] = 390.0; quadOffsets[2] = 52.0; goto LAB_00821ae6; case 0xc: quadOffsets[2] = 390.0; LAB_00821ae6: quadOffsets[3] = 52.0; } quadSizes.x = quadSizes.x - 338.0; quadCount = 2; uStack_108 = 0x43360000; local_10c = 0x43a90000; LAB_00821b14: shaderParams = *(float *)&(shader->_fxLayers)._fxParams.field_0x20; local_c0 = *(undefined4 *)&(shader->_fxLayers)._fxParams.field_0x30; fVar3 = *(float *)&(shader->_fxLayers)._fxParams.field_0x2c; colorRed = *(float *)&(shader->_fxLayers)._fxParams.field_0x34; colorGreen = *(float *)&(shader->_fxLayers)._fxParams.field_0x38; colorBlue = *(float *)&(shader->_fxLayers)._fxParams.field_0x3c; fStack_cc = *(float *)&(shader->_fxLayers)._fxParams.field_0x24; quadColor._unk = *(int *)&(shader->_fxLayers)._fxParams.field_0x44; fStack_c8 = *(float *)&(shader->_fxLayers)._fxParams.field_0x28; quadColor._alpha = *(float *)&(shader->_fxLayers)._fxParams.field_0x40; local_130[0] = 1.10703e-43; g_currentShader = shader; fStack_c4 = fVar3; std::set::find_node(&local_dc,local_130); if (((*(char *)((int)seedNode + 0xd) == '\0') && (*(int *)((int)seedNode + 0x10) < 0x50)) && (seedNode != (g_game->_seedEffects)._seedEffects)) { fVar3 = 0.5; shaderParams = 0.5; fStack_cc = 0.7; fStack_c8 = 1.0; quadColor._alpha = 1.0; colorBlue = 1.0; colorGreen = 0.7; colorRed = 0.5; local_c0 = 0; quadColor._unk = 0; } iVar1 = shader->_waterLerpColorDuration; if (-1 < iVar1) { fVar2 = 1.0; if (iVar1 != 0) { fVar2 = 1.0 - (float)shader->_waterLerpColorCountdown / (float)iVar1; if (fVar2 <= 0.0) { fVar2 = 0.0; } if (1.0 <= fVar2) { fVar2 = 1.0; } } shaderParams = (shader->_waterColor)._red; fVar3 = (shader->_waterColor)._alpha; shaderParams = ((shader->_waterLerpTargetColor)._red - shaderParams) * fVar2 + shaderParams; fStack_cc = (shader->_waterColor)._green; fVar3 = ((shader->_waterLerpTargetColor)._alpha - fVar3) * fVar2 + fVar3; fStack_cc = ((shader->_waterLerpTargetColor)._green - fStack_cc) * fVar2 + fStack_cc; fStack_c8 = (shader->_waterColor)._blue; fStack_c8 = ((shader->_waterLerpTargetColor)._blue - fStack_c8) * fVar2 + fStack_c8; colorRed = (shader->_waterColorMultiplier)._red; colorRed = ((shader->_waterLerpTargetColorMult)._red - colorRed) * fVar2 + colorRed; colorGreen = (shader->_waterColorMultiplier)._green; colorGreen = ((shader->_waterLerpTargetColorMult)._green - colorGreen) * fVar2 + colorGreen; colorBlue = (shader->_waterColorMultiplier)._blue; colorBlue = ((shader->_waterLerpTargetColorMult)._blue - colorBlue) * fVar2 + colorBlue; quadColor._alpha = (shader->_waterColorMultiplier)._alpha; quadColor._alpha = ((shader->_waterLerpTargetColorMult)._alpha - quadColor._alpha) * fVar2 + quadColor._alpha; } fVar2 = shader->_waterAmount; fStack_c4 = fVar2 * fVar3; quadColor._red = (colorRed - 1.0) * fVar2 + 1.0; local_130[0] = (float)g_game->_frameCount + (float)g_game->_frameCount; quadColor._green = (colorGreen - 1.0) * fVar2 + 1.0; quadColor._blue = (colorBlue - 1.0) * fVar2 + 1.0; local_dc.x = (float)((double)DAT_00c797f4[6] + __uint_to_double_fixup[-(DAT_00c797f4[6] >> 0x1f)]) ; local_dc.y = (float)((double)DAT_00c797f4[7] + __uint_to_double_fixup[-(DAT_00c797f4[7] >> 0x1f)]) ; local_104 = DAT_00c79a4c; Shader::set_uniform(shader,&DAT_00b6837c,8,local_130,(int)DAT_00c797f4); Shader::set_uniform(g_currentShader,(byte *)"ColorMul",10,&quadColor,unused); Shader::set_uniform(g_currentShader,(byte *)"CurrentDir",9,&shader->_waterCurrent,unused_00); Shader::set_uniform(g_currentShader,(byte *)"TextureSize",9,&local_dc,unused_01); Shader::set_uniform(g_currentShader,(byte *)"PixelationAmount",8,&local_104,unused_02); local_130[0] = 0.0; do { local_104 = DAT_00c797f4; quadColor._red = 1.0; quadColor._green = 1.0; quadColor._blue = 1.0; quadColor._alpha = 1.0; quadColor._unk = 0; drawFn = *(code **)(*DAT_00c797f4 + 0x14); local_dc.x = *(float *)((int)quadOffsets + (int)local_130[0]) + renderOffset->x; local_dc.y = *(float *)((int)quadOffsets + (int)local_130[0] + 4) + renderOffset->y; quadSizePtr = (Vector *)((int)quadOffsets + (int)local_130[0] + 0x10); render_quad_set_rect(quad,&local_dc,quadSizePtr,&quadColor); fVar3 = local_130[0]; local_84 = 1; local_94 = *(float *)((int)quadOffsets + (int)local_130[0]); local_98 = *(float *)((int)quadOffsets + (int)local_130[0] + 4); uvQuad = local_94; local_9c = local_94 + quadSizePtr->x; local_a0 = local_98; local_90 = local_98 + *(float *)((int)quadOffsets + (int)local_130[0] + 0x14); local_8c = local_9c; local_88 = local_90; (*drawFn)(&uvQuad,extraout_EAX,&shaderParams); local_130[0] = (float)((int)fVar3 + 8); quadCount = quadCount + -1; } while (quadCount != 0); shader_cache_find(unusedArg); return; } //@@ 00821fc0 Room::is_obstacle_path_valid /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? flood fill over 448-cell grid arrays after temporarily placing obstacle (GridEntity_Pit::UpdateCollision, Room::PickupGridEntity); called per candidate from Room::CanSpawnObstacleAtPosition prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Room::is_obstacle_path_valid(Room *pathGrid,uint startIndex,uint goalIndex,uint flags) { int rightCol; int iVar2; void *pvVar3; int iVar4; int iVar5; ushort score; Room *pRVar6; int iVar7; uint scanIndex; byte isPathFound; int *node; uint score; float fVar9; float fVar10; undefined1 local_129c [8]; undefined1 local_1294 [8]; undefined1 openFind [8]; int *openNode; undefined1 closedFind [8]; void *closedNode; undefined4 destroySource; undefined4 local_1270; undefined4 local_126c; undefined4 local_1268; float local_1264; float local_1260; float local_125c; float local_1258; undefined4 local_1254; undefined4 local_1250; void *closedSetHead; undefined4 closedSetSize; uint current; int *openSetHead; int openSetSize; int goalRow; int goalCol; undefined1 local_1230 [4]; int *local_122c; void *local_1228; Room *room; uint local_1220; uint local_121c; uint fScore [448]; uint gScore [448]; uint neighbors [4]; uint auStack_408 [28]; ushort cameFrom [448]; uint local_18; undefined4 uStack_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *neighborGrid; GridEntity_Pit *pathGrid; int rightCol; local_8 = 0xffffffff; puStack_c = &LAB_00b0189b; local_10 = ExceptionList; uStack_14 = 0x821fdb; local_18 = __security_cookie ^ (uint)(cameFrom + 0x1ca); ExceptionList = &local_10; local_1220 = startIndex; openSetHead = (int *)0x0; openSetSize = 0; room = pathGrid; openSetHead = operator_new(0x14); *openSetHead = (int)openSetHead; openSetHead[1] = (int)openSetHead; openSetHead[2] = (int)openSetHead; *(undefined2 *)(openSetHead + 3) = 0x101; local_8 = 0; closedSetHead = (void *)0x0; closedSetSize = 0; closedSetHead = operator_new(0x14); *(void **)closedSetHead = closedSetHead; *(void **)((int)closedSetHead + 4) = closedSetHead; *(void **)((int)closedSetHead + 8) = closedSetHead; *(undefined2 *)((int)closedSetHead + 0xc) = 0x101; local_8 = CONCAT31(local_8._1_3_,1); std::set::insert(local_1230,&local_1220); memset(gScore,0xff,0x700); memset(fScore,0xff,0x700); memset(cameFrom,0xff,0x380); score = local_1220; iVar5 = pathGrid->_gridWidth; goalRow = (int)goalIndex / iVar5; goalCol = (int)goalIndex % iVar5; gScore[local_1220] = 0; fVar10 = (float)goalCol - (float)((int)local_1220 % iVar5); fVar9 = (float)goalRow - (float)((int)local_1220 / iVar5); fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); fScore[score] = (int)(fVar9 * 10.0) & 0xffff; while (openSetSize != 0) { local_1220 = 0xffff; node = (int *)*openSetHead; local_122c = node; if (node != openSetHead) { do { score = (ushort)fScore[local_122c[4]]; if (score < (ushort)local_1220) { node = local_122c; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_122c); if ((ushort)local_1220 <= score) { score = (ushort)local_1220; } local_1220 = (uint)score; } while (local_122c != openSetHead); } current = node[4]; local_121c = current; if (current == goalIndex) { if ((flags & 4) == 0) goto LAB_00822813; pRVar6 = room; goto LAB_008226e0; } pvVar3 = std::_Tree::_Extract(&openSetHead,node); operator_delete(pvVar3,0x14); std::set::insert(local_1294,¤t); iVar2 = goalCol; rightCol = goalRow; iVar5 = room->_gridWidth; iVar4 = (int)current / iVar5; iVar7 = (int)current % iVar5; if ((((iVar7 + -1 < 0) || (iVar5 <= iVar7 + -1)) || (iVar4 < 0)) || (room->_gridHeight <= iVar4) ) { local_1220 = 0xffffffff; } else { local_1220 = iVar5 * iVar4 + -1 + iVar7; } local_122c = (int *)(iVar5 * iVar4); neighbors[0] = local_1220; rightCol = iVar7 + 1; if (((rightCol < 0) || (iVar5 <= rightCol)) || ((iVar4 < 0 || (room->_gridHeight <= iVar4)))) { neighbors[1] = -1; } else { neighbors[1] = rightCol + (int)local_122c; } local_1228 = (void *)(iVar4 + -1); if (((iVar7 < 0) || (iVar5 <= iVar7)) || (((int)local_1228 < 0 || (room->_gridHeight <= (int)local_1228)))) { neighbors[2] = -1; if ((-1 < iVar7) && (iVar7 < iVar5)) goto LAB_008222fe; LAB_00822339: neighbors[3] = -1; } else { neighbors[2] = (int)local_1228 * iVar5 + iVar7; LAB_008222fe: local_121c = iVar4 + 1; if (((int)local_121c < 0) || (room->_gridHeight <= (int)local_121c)) goto LAB_00822339; neighbors[3] = local_121c * iVar5 + iVar7; } score = 4; local_121c = 4; if ((flags & 2) != 0) { if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar4 < 0)) || (room->_gridHeight <= iVar4)) { iVar7 = -1; } else { iVar7 = (int)local_122c + iVar7; } local_1228 = room->_gridEntities[iVar7]; if (((local_1228 != (void *)0x0) && (*(int *)((int)local_1228 + 4) == 0x17)) && (*(int *)((int)local_1228 + 0xc) != 2)) { iVar4 = room->_gridHeight * room->_gridWidth; scanIndex = *(uint *)((int)local_1228 + 0x24); iVar5 = iVar4 + -2; if (0 < iVar5) { do { scanIndex = (int)(scanIndex + 1) % iVar4; if (((scanIndex < 0x1c0) && (pvVar3 = room->_gridEntities[scanIndex], pvVar3 != (void *)0x0)) && ((*(int *)((int)pvVar3 + 4) == 0x17 && ((*(int *)((int)pvVar3 + 8) == *(int *)((int)local_1228 + 8) && (score < 0x20)))))) { neighbors[score] = scanIndex; score = score + 1; } iVar5 = iVar5 + -1; } while (iVar5 != 0); local_121c = score; } } } local_1220 = 0; if (0 < (int)local_121c) { score = local_121c; pRVar6 = room; do { pvVar3 = (void *)neighbors[local_1220]; local_1228 = pvVar3; if (-1 < (int)pvVar3) { neighborGrid = pRVar6->_gridEntities[(int)pvVar3]; if (neighborGrid == (void *)0x0) { iVar5 = 0; } else { iVar5 = *(int *)((int)neighborGrid + 0x3c); if (*(int *)((int)neighborGrid + 4) == 8) { iVar5 = 3; } } if (999 < room->_gridPaths[(int)pvVar3]) { iVar5 = 3; } if ((flags & 1) != 0) { if (iVar5 == 5) { iVar5 = 0; } } local_122c = (int *)0x1; if (((flags & 4) == 0) || (iVar5 != 3)) { if (iVar5 == 0) goto LAB_0082250a; } else if ((neighborGrid != (void *)0x0) && ((iVar5 = *(int *)((int)neighborGrid + 4), iVar5 == 2 || ((iVar5 != 3 && ((((iVar5 == 4 || (iVar5 == 5)) || (iVar5 == 6)) || ((iVar5 == 0x16 || ((iVar5 != 0x18 && (((iVar5 == 0x19 || (iVar5 == 0x1a)) || ((iVar5 == 0x1b || (iVar5 == 7))))))) ))))))))) { local_122c = (int *)0x1c0; LAB_0082250a: std::set::find_node(closedFind,&local_1228); if (((*(char *)((int)closedNode + 0xd) != '\0') || ((int)pvVar3 < *(int *)((int)closedNode + 0x10))) || (closedNode == closedSetHead)) { local_122c = (int *)((int)local_122c + gScore[current]); std::set::find_node(openFind,&local_1228); if (((*(char *)((int)openNode + 0xd) == '\0') && (openNode[4] <= (int)pvVar3)) && (openNode != openSetHead)) { if ((int *)gScore[(int)pvVar3] <= local_122c) goto LAB_0082262f; } else { std::set::insert(local_129c,&local_1228); pvVar3 = local_1228; } gScore[(int)pvVar3] = (uint)local_122c; cameFrom[(int)pvVar3] = (ushort)current; fVar10 = (float)iVar2 - (float)((int)pvVar3 % room->_gridWidth); fVar9 = (float)rightCol - (float)((int)pvVar3 / room->_gridWidth); sqrtf(fVar9 * fVar9 + fVar10 * fVar10); iVar5 = __ftoui3(); fScore[(int)pvVar3] = iVar5 + (int)local_122c; } } LAB_0082262f: score = local_121c; pRVar6 = room; } local_1220 = local_1220 + 1; } while ((int)local_1220 < (int)score); } } isPathFound = 0; goto LAB_0082265f; LAB_008226e0: do { pathGrid = pRVar6->_gridEntities[local_121c]; if (pathGrid != (GridEntity_Pit *)0x0) { iVar5 = (pathGrid->_desc)._type; if (iVar5 == 2) { LAB_0082274f: if (pRVar6->_enterFrame == g_game->_frameCount) { PickupGridEntity(pRVar6,local_121c); } else { destroySource = 0; local_1270 = 0; local_126c = 0; local_1268 = 0; local_1264 = g_vectorZero.x; local_1260 = g_vectorZero.y; local_125c = g_vectorZero.x; local_1258 = g_vectorZero.y; local_1254 = 0; local_1250 = 0; (**(code **)(*(int *)pathGrid + 0x14))(1,&destroySource); } } else { if (iVar5 == 3) goto LAB_008227f9; if ((((iVar5 == 4) || (iVar5 == 5)) || (iVar5 == 6)) || (iVar5 == 0x16)) goto LAB_0082274f; if (iVar5 == 0x18) goto LAB_008227f9; if (((iVar5 == 0x19) || (iVar5 == 0x1a)) || (iVar5 == 0x1b)) goto LAB_0082274f; if ((iVar5 != 7) || ((pathGrid->_desc)._state != 0)) goto LAB_008227f9; (pathGrid->_desc)._state = 2; GridEntity_Pit::UpdateCollision(pathGrid); } pRVar6 = room; } LAB_008227f9: local_121c = (uint)cameFrom[local_121c]; } while (local_121c != 0xffff); LAB_00822813: isPathFound = 1; LAB_0082265f: FID_conflict__Erase_tree_>_> (&closedSetHead,(fuzzer_allocator_> *)&closedSetHead ,*(_Tree_node **)((int)closedSetHead + 4)); operator_delete(closedSetHead,0x14); FID_conflict__Erase_tree_>_> (&openSetHead,(fuzzer_allocator_> *)&openSetHead, (_Tree_node *)openSetHead[1]); operator_delete(openSetHead,0x14); ExceptionList = local_10; return isPathFound; } //@@ 00822820 Room::CanSpawnObstacleAtPosition /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool Room::CanSpawnObstacleAtPosition(int GridIndex, bool Force); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Room::CanSpawnObstacleAtPosition(Room *this,int GridIndex,byte Force) { byte isValid; char cVar1; Entity_Player *player; int iVar2; int iVar3; int iVar4; int iVar5; uint uVar6; uint uVar7; int iVar8; Game *game; uint uVar9; uint uVar10; undefined1 auStack_64 [4]; int targetColumn; byte isPathClear; int *local_58; int nextNeighbor; Vector local_50; int targetGridIndex; int *local_44; Room *local_40; uint neighborGridIndices [4]; int neighborOffsets [10]; void *neighborGridEntity; game = g_game; neighborOffsets[8] = __security_cookie ^ (uint)auStack_64; targetGridIndex = GridIndex; if ((uint)GridIndex < 0x1c0) { iVar5 = g_game->_room->_gridWidth; local_50.x = (float)(GridIndex % iVar5) * 40.0 + 40.0; local_50.y = (float)(GridIndex / iVar5) * 40.0 + 120.0; local_40 = this; isValid = IsPositionInRoom(g_game->_room,&local_50,0.0); if (((isValid != 0) && (*(int *)((int)game->_room + 8) != 0x10)) && ((this->_gridEntities[targetGridIndex] == (void *)0x0 || ((cVar1 = FUN_0070bf60(), cVar1 != '\0' && (cVar1 = is_grid_type_floor_special(), cVar1 == '\0')))))) { if (Force == 0) { uVar9 = 0; if ((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(game,uVar9); iVar5 = (int)(((player->_pos).x - 40.0) / 40.0 + 0.5); iVar3 = (int)(((player->_pos).y - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (this->_gridWidth <= iVar5)) || (iVar3 < 0)) || (this->_gridHeight <= iVar3)) { iVar5 = -1; } else { iVar5 = this->_gridWidth * iVar3 + iVar5; } if (((iVar5 == targetGridIndex) && (iVar5 = player->_entityGridCollisionClass, iVar5 != 0)) && ((iVar5 != 3 && ((iVar5 != 1 && (iVar5 != 2)))))) { return 0; } uVar9 = uVar9 + 1; game = g_game; } while (uVar9 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } } iVar3 = 0; iVar5 = targetGridIndex / this->_gridWidth; targetColumn = targetGridIndex % this->_gridWidth; local_44 = *(int **)((int)this->_descriptor + 0x10); local_58 = this->_doorGridPositions; local_50.x = 0.0; do { if (((local_44 != (int *)0x0) && ((local_44[((uint)local_50.x >> 5) + 0xe] & 1 << (SUB41(local_50.x,0) & 0x1f)) != 0)) && (uVar9 = *local_58 / this->_gridWidth - iVar5, uVar10 = *local_58 % this->_gridWidth - targetColumn, uVar6 = (int)uVar9 >> 0x1f, uVar7 = (int)uVar10 >> 0x1f, (int)(((uVar9 ^ uVar6) - uVar6) + ((uVar10 ^ uVar7) - uVar7)) < 2)) { return 0; } local_50.x = (float)((int)local_50.x + 1); local_58 = local_58 + 1; } while ((int)local_50.x < 8); local_50.x = 0.0; if ((this->_entityList)._updateEL._size != 0) { local_44 = (this->_entityList)._updateEL._data; do { iVar4 = *local_44; if (*(int *)(iVar4 + 0x28) == 1000) { if (*(int *)(iVar4 + 0x2c) == 0x9c) goto LAB_00822ab9; } else if ((*(int *)(iVar4 + 0x28) == 5) && (*(int *)(iVar4 + 0x534) != 0)) { LAB_00822ab9: iVar8 = (int)((*(float *)(iVar4 + 0x33c) - 40.0) / 40.0 + 0.5); iVar4 = (int)((*(float *)(iVar4 + 0x340) - 120.0) / 40.0 + 0.5); if ((((-1 < iVar8) && ((iVar2 = this->_gridWidth, iVar8 < iVar2 && (-1 < iVar4)))) && (iVar4 < this->_gridHeight)) && ((iVar8 = iVar2 * iVar4 + iVar8, -1 < iVar8 && (uVar6 = iVar8 % iVar2 - targetColumn, uVar9 = iVar8 / iVar2 - iVar5, uVar7 = (int)uVar6 >> 0x1f, uVar10 = (int)uVar9 >> 0x1f, (int)(((uVar6 ^ uVar7) - uVar7) + ((uVar9 ^ uVar10) - uVar10)) < 2)))) { return 0; } } local_50.x = (float)((int)local_50.x + 1); local_44 = local_44 + 1; } while ((uint)local_50.x < (uint)(this->_entityList)._updateEL._size); } iVar4 = 0; neighborOffsets[0] = -1; neighborOffsets[1] = 0; neighborOffsets[2] = 1; neighborOffsets[3] = 0; neighborOffsets[4] = 0; neighborOffsets[5] = 0xffffffff; neighborOffsets[6] = 0; neighborOffsets[7] = 1; do { iVar8 = neighborOffsets[iVar4 * 2] + targetColumn; if (-1 < iVar8) { if (iVar8 < this->_gridWidth) { iVar2 = neighborOffsets[iVar4 * 2 + 1] + iVar5; if ((-1 < iVar2) && (iVar2 < this->_gridHeight)) { uVar9 = this->_gridWidth * iVar2 + iVar8; if (-1 < (int)uVar9) { neighborGridEntity = this->_gridEntities[uVar9]; if (neighborGridEntity == (void *)0x0) { if (this->_gridPaths[uVar9] < 1000) goto LAB_00822c10; } else { iVar8 = *(int *)((int)neighborGridEntity + 4); if (iVar8 == 0x10) { return 0; } if (((((0x1bf < *(uint *)((int)neighborGridEntity + 0x24)) || (this = local_40, *(int *)((int)g_game->_room + *(uint *)((int)neighborGridEntity + 0x24) * 4 + 0x76c) < 1000)) || (iVar8 == 0xc)) || (iVar8 == 0xe)) && (((iVar8 != 0x11 && (iVar8 != 0x12)) && ((iVar8 != 0x14 && (iVar8 != 0x17)))))) { LAB_00822c10: neighborGridIndices[iVar3] = uVar9; iVar3 = iVar3 + 1; } } } } } } iVar4 = iVar4 + 1; } while (iVar4 < 4); isValid = 1; isPathClear = 1; local_50.x = (float)this->_gridPaths[targetGridIndex]; this->_gridPaths[targetGridIndex] = 1000; if (0 < iVar3 + -1) { local_58 = (int *)neighborGridIndices; nextNeighbor = 1; do { if (isValid == 0) break; iVar5 = nextNeighbor; local_40 = (Room *)nextNeighbor; if (nextNeighbor < iVar3) { do { isValid = is_obstacle_path_valid(this,*local_58,neighborGridIndices[iVar5],0); if (isValid == 0) { isPathClear = 0; break; } iVar5 = iVar5 + 1; } while (iVar5 < iVar3); isValid = isPathClear; } nextNeighbor = nextNeighbor + 1; local_58 = local_58 + 1; } while ((int)local_40 < iVar3 + -1); } this->_gridPaths[targetGridIndex] = (int)local_50.x; return isValid; } } return 0; } //@@ 00822cf0 Room::add_trigger_output_index /* DB: group < 10: insert the grid index in the output set (room+0x7328) (room-features) */ void Room::add_trigger_output_index(uint param_1,undefined1 param_2) { undefined1 local_10 [12]; if (param_1 < 10) { std::set::insert(local_10,¶m_2); } return; } //@@ 00822d20 Room::add_trigger_output_cell /* DB: (group, x, y): bounds-checked GetGridIndexByTile then add_trigger_output_index; SpawnEntry 969 calls it for the 4 sides (room-features) */ void Room::add_trigger_output_cell(undefined4 param_1,int param_2,int param_3) { int iVar1; Room *in_ECX; if ((((-1 < param_2) && (-1 < param_3)) && (param_2 < in_ECX->_gridWidth)) && (param_3 < in_ECX->_gridHeight)) { iVar1 = GetGridIndexByTile(in_ECX,param_2,param_3); add_trigger_output_index(param_1,iVar1); } return; } //@@ 00822d60 Room::hold_trigger_output_entities /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: after spawning: each entity on an output cell becomes a Spawner 1000.120 of its group (room-features) */ void __thiscall Room::hold_trigger_output_entities(Room *this) { int *piVar1; int iVar2; undefined8 *findResult; Game *game; uint groupIdx; undefined4 *puVar3; byte *groupSet; undefined1 local_20c [12]; undefined8 insertPos; undefined4 *local_1f4; undefined4 local_1f0; int local_1ec; int gridIdxKey; undefined4 *heldIndexSet; Room *local_1e0; int *local_1dc; char isAnyOutput; char cellGroup [448]; uint securityCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *descriptor; int entityType; int gridIdx; undefined4 setHead; local_8 = 0xffffffff; puStack_c = &LAB_00b018e0; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(cellGroup + 0x1d0); ExceptionList = &local_10; local_1e0 = this; memset(cellGroup,0xff,0x1c0); groupSet = this->_outputGroupGridIndices; isAnyOutput = '\0'; groupIdx = 0; do { piVar1 = *(int **)groupSet; local_1dc = (int *)*piVar1; if (local_1dc != piVar1) { isAnyOutput = '\x01'; do { if (cellGroup[local_1dc[4]] < '\0') { cellGroup[local_1dc[4]] = (char)groupIdx; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1dc); } while (local_1dc != piVar1); } game = g_game; groupIdx = groupIdx + 1; groupSet = groupSet + 8; } while (groupIdx < 10); if (isAnyOutput != '\0') { local_1dc = (int *)0x0; *(undefined1 *)((int)g_game->_room + 0x11f5) = 0; if ((local_1e0->_entityList)._updateEL._size != 0) { do { iVar2 = *(int *)((int)(local_1e0->_entityList)._updateEL._data + (int)local_1dc * 4); gridIdx = *(int *)(iVar2 + 0x32c); if ((-1 < gridIdx) && (local_1ec = (int)cellGroup[gridIdx], -1 < local_1ec)) { entityType = *(int *)(iVar2 + 0x28); gridIdxKey = gridIdx; if ((entityType != 5) || (*(int *)(iVar2 + 0x534) != 0)) { if (((*(int *)&game->_deathmatchManager < 2) || (entityType != 1)) && (0x3dd < entityType - 10U)) { if (entityType != 4) goto LAB_00822f83; } else { descriptor = local_1e0->_descriptor; puVar3 = (undefined4 *)((int)descriptor + 0x80); heldIndexSet = puVar3; findResult = (undefined8 *)std::set::find_node(local_20c,&gridIdxKey); insertPos = *findResult; if ((*(char *)(*(int *)(findResult + 1) + 0xd) != '\0') || (gridIdx < *(int *)(*(int *)(findResult + 1) + 0x10))) { if (*(int *)((int)descriptor + 0x84) == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } setHead = *puVar3; local_1f4 = heldIndexSet; local_8 = 0; local_1f0 = 0; puVar3 = operator_new(0x14); local_8 = 0xffffffff; local_1f0 = 0; puVar3[4] = gridIdx; *puVar3 = setHead; puVar3[1] = setHead; puVar3[2] = setHead; *(undefined2 *)(puVar3 + 3) = 0; std::_Tree::_Insert_node(heldIndexSet,(void *)insertPos,insertPos._4_4_,puVar3); } } } piVar1 = local_1dc; hold_entity_in_spawner(local_1e0,iVar2,local_1ec); game = g_game; local_1dc = piVar1; } LAB_00822f83: local_1dc = (int *)((int)local_1dc + 1); } while (local_1dc < (uint)(local_1e0->_entityList)._updateEL._size); } } ExceptionList = local_10; return; } //@@ 00822fd0 Room::hold_entity_in_spawner /* DB: Spawner 1000.120 at the entity, 0x420/0x424 its variant/subtype, 0x450 the group; the entity removed (room-features) */ Entity * __thiscall Room::hold_entity_in_spawner(Room *this,int *param_2,undefined4 param_3) { char cVar1; Entity *pEVar2; Vector local_10; local_10.x = (float)param_2[0xcf]; local_10.y = (float)param_2[0xd0]; pEVar2 = Game::SpawnEx(g_game,1000,0x78,&local_10,&g_vectorZero,(Entity *)0x0,param_2[10], param_2[0xfb],0); pEVar2[1]._pendingDamage = (float)param_2[0xb]; *(int *)&pEVar2[1]._pendingDamageFlags = param_2[0xc]; *(undefined4 *)&pEVar2[1].field_0x44 = param_3; cVar1 = (**(code **)(*param_2 + 0x48))(); if ((cVar1 != '\0') && (param_2[10] != 0x362)) { this->_aliveEnemyCount = this->_aliveEnemyCount + -1; cVar1 = (**(code **)(*param_2 + 0x4c))(); if (cVar1 != '\0') { this->_aliveBossCount = this->_aliveBossCount + -1; } } (**(code **)(*param_2 + 0x28))(); return pEVar2; } //@@ 00823080 Room::TriggerOutput /* DB: REPENTOGON Room.zhl TriggerOutput(group): output cells' grids react (FUN_00823150), group's 1000.120 Spawners release, callbacks (room-features) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Room::TriggerOutput(Room *this,uint outputGroupdIdx) { int *piVar1; uint uVar2; undefined4 *puVar3; int local_c [2]; local_c[0] = **(int **)(this->_outputGroupGridIndices + outputGroupdIdx * 8); if ((int *)local_c[0] != *(int **)(this->_outputGroupGridIndices + outputGroupdIdx * 8)) { do { if (this->_gridEntities[*(int *)(local_c[0] + 0x10)] != (void *)0x0) { GridEntity::trigger_output(this->_gridEntities[*(int *)(local_c[0] + 0x10)]); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)local_c); } while (local_c[0] != *(int *)(this->_outputGroupGridIndices + outputGroupdIdx * 8)); } uVar2 = 0; if ((this->_entityList)._updateEL._size != 0) { do { piVar1 = *(int **)((int)(this->_entityList)._updateEL._data + uVar2 * 4); if (((piVar1[10] == 1000) && (piVar1[0xb] == 0x78)) && (piVar1[0x114] == outputGroupdIdx)) { *(undefined1 *)((int)piVar1 + 0x173) = 1; (**(code **)(*piVar1 + 0xc))(); } uVar2 = uVar2 + 1; } while (uVar2 < (uint)(this->_entityList)._updateEL._size); } puVar3 = *(undefined4 **)(this->_outputGroupCallbacks + outputGroupdIdx * 0xc); if (puVar3 != *(undefined4 **)(this->_outputGroupCallbacks + outputGroupdIdx * 0xc + 4)) { do { (*(code *)*puVar3)(); puVar3 = puVar3 + 1; } while (puVar3 != *(undefined4 **)(this->_outputGroupCallbacks + outputGroupdIdx * 0xc + 4)); } return; } //@@ 00823150 GridEntity::trigger_output /* DB: TNT explodes, plate Switched, event rock breaks, event pit fills, teleporter toggles (room-features) */ void GridEntity::trigger_output(GridEntity_Pit *param_1) { int iVar1; Manager *pMVar2; EntityRef *pEVar3; uint seed; int local_3c; Vector local_38; EntityRef local_30; iVar1 = (param_1->_desc)._type; if (iVar1 == 0xc) { if ((uint)(param_1->_desc)._state < 4) { local_30._position.y = g_vectorZero.y; local_30._velocity.y = g_vectorZero.y; local_30._type = 0; local_30._variant = 0; local_30._spawnerType = 0; local_30._spawnerVariant = 0; local_30._position.x = g_vectorZero.x; local_30._velocity.x = g_vectorZero.x; local_30._flags = 0; local_30._entity = (void *)0x0; (**(code **)(*(int *)param_1 + 0x14))(1,&local_30); return; } } else if (iVar1 == 0x14) { if ((param_1->_desc)._state == 0) { ANM2::Play(¶m_1->_sprite,(byte *)"Switched",0); return; } } else if (iVar1 == 2) { if (((param_1->_desc)._varData != 0) && ((param_1->_desc)._state == 1)) { pEVar3 = EntityRef::EntityRef(&local_30); (**(code **)(*(int *)param_1 + 0x14))(1,pEVar3); return; } } else if (iVar1 == 7) { if (((param_1->_desc)._varData != 0) && ((param_1->_desc)._state == 0)) { seed = Random(); iVar1 = *(int *)((int)g_game->_room + 0xc); local_38.x = (float)(param_1->_gridIndex % iVar1) * 40.0 + 40.0; local_38.y = (float)(param_1->_gridIndex / iVar1) * 40.0 + 120.0; Game::SpawnEx(g_game,1000,0xf,&local_38,&g_vectorZero,(Entity *)0x0,0,seed,0); pMVar2 = g_manager; local_3c = 0x89; seed_fart_sound_override(&local_3c); SoundEffects::Play(&pMVar2->_sfxManager,local_3c,1.0,2,0,1.0,0.0); if ((param_1->_desc)._state == 0) { (param_1->_desc)._state = 2; GridEntity_Pit::UpdateCollision(param_1); return; } } } else if (iVar1 == 0x17) { if ((param_1->_desc)._state == 2) { ANM2::Play(¶m_1->_sprite,(byte *)"TurnOn",0); (param_1->_desc)._state = 1; return; } ANM2::Play(¶m_1->_sprite,(byte *)"TurnOff",0); (param_1->_desc)._state = 2; } return; } //@@ 00823370 Room::get_color_modifier /* DB: ? thiscall Room (out 6 floats r,g,b,a,brightness,contrast): copies the room FX color (+0x1b10..+0x1b28), lerps 75% to neutral for room types 7/8/29 or the Abandoned Mineshaft dimension, +0.03 brightness for descriptor flag 0x200, darkens with the backdrop 0x20 kill ratio; callers Entity_Player::TakeDamage, try_end_astral_projection prototype: db/protos.zhl, confirmed by RET 4 */ float * __thiscall Room::get_color_modifier(Room *this,float *outColor) { int iVar1; void *pvVar2; uint uVar3; byte bVar4; float fVar5; *outColor = *(float *)&(this->_fxLayers)._fxParams; outColor[1] = *(float *)&(this->_fxLayers)._fxParams.field_0x4; outColor[2] = *(float *)&(this->_fxLayers)._fxParams.field_0x8; outColor[3] = *(float *)&(this->_fxLayers)._fxParams.field_0xc; outColor[4] = (this->_fxLayers)._fxParams.brightness; outColor[5] = (this->_fxLayers)._fxParams.contrast; iVar1 = this->_roomType; if (((iVar1 != 7) && (iVar1 != 8)) && (iVar1 != 0x1d)) { bVar4 = Level::HasAbandonedMineshaft((Level *)g_game); if ((bVar4 == 0) || (g_game->_currentDimensionIdx != 1)) goto LAB_00823474; } *outColor = (1.0 - *outColor) * 0.75 + *outColor; outColor[4] = (0.0 - outColor[4]) * 0.75 + outColor[4]; outColor[1] = (1.0 - outColor[1]) * 0.75 + outColor[1]; outColor[2] = (1.0 - outColor[2]) * 0.75 + outColor[2]; outColor[5] = (1.0 - outColor[5]) * 0.75 + outColor[5]; outColor[3] = (0.0 - outColor[3]) * 0.75 + outColor[3]; LAB_00823474: pvVar2 = this->_descriptor; uVar3 = *(uint *)((int)pvVar2 + 0x44); if ((uVar3 >> 9 & 1) != 0) { outColor[4] = outColor[4] + 0.03; } if ((this->_backdropType == 0x20) && ((uVar3 >> 5 & 1) != 0)) { fVar5 = ((float)*(int *)((int)pvVar2 + 0x54) / (float)((this->_gridHeight + -2) * (this->_gridWidth + -2))) * this->_lavaIntensity; *outColor = *outColor - fVar5; outColor[2] = fVar5 * 0.4 + outColor[2]; outColor[1] = fVar5 * 0.4 + outColor[1]; outColor[5] = fVar5 * 0.2 + outColor[5]; outColor[3] = outColor[3] - fVar5 * 0.45; } return outColor; } //@@ 00823540 FUN_00823540 void FUN_00823540(void) { byte lerp; Room *in_ECX; Game *this; ColorModState local_20; Room::get_color_modifier(in_ECX,&local_20._red); if ((g_game->_isLevelGenerating == 0) && (g_game->_isStartingFromState == 0)) { lerp = 1; } else { lerp = 0; } Game::SetColorModifier(this,&local_20,lerp,0.015); return; } //@@ 00823590 Room::GetFloorColorAt /* ZHL [exact] __thiscall KColor Room::GetFloorColorAt(Vector& pos, float radius); prototype: db/protos.zhl, confirmed by RET 8 */ KColor * __thiscall Room::GetFloorColorAt(Room *this,KColor *outColor,Vector *position,float radius) { float fVar1; float fVar2; char cVar3; uint uVar4; undefined4 uVar5; int *medianNode; float fVar6; Backdrop *pBVar7; float *sampledColor; int medianSteps; float fVar8; float fVar9; float fVar10; float fVar11; double dVar12; float sampleLuminance; float local_7c; float local_78; float local_74; float local_70; undefined4 local_6c; float sampleColor; float fStack_64; float fStack_60; float fStack_5c; undefined4 local_58; int *backdrop; int *backdropRefCount; undefined4 *sampleTreeHead; undefined4 local_48; undefined1 sampleSet [4]; Room *room; Backdrop *local_3c; float sampleX; float local_34; float local_30; float sampleRadius; float local_28; float screenX; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int *parentNode; code *samplePixelFn; int *walkNode; puStack_20 = sampleSet + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00b0192d; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(sampleSet + 0x34); ExceptionList = &local_1c; room = this; sampleRadius = radius; KColor::SetFromARGB(outColor,0xffffffff); local_28 = g_displayPixelRatio * g_screenPointScale; local_34 = (g_screenHeight - 182.0) * 0.5; local_30 = ((position->x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_28 + 0.5; dVar12 = floor((double)local_30); local_30 = (float)dVar12; screenX = local_30 / local_28; local_34 = ((position->y - 140.0) * 0.65 + local_34) * local_28 + 0.5; dVar12 = floor((double)local_34); local_34 = (float)dVar12; screenX = screenX - *(float *)((int)g_game->_room + 0x11fc); local_28 = local_34 / local_28 - *(float *)((int)g_game->_room + 0x1200); if (sampleRadius <= 0.0) { shared_ptr::assign(&backdrop,&this->_backdrop); local_14 = 3; samplePixelFn = *(code **)(*backdrop + 0x2c); local_30 = (float)__ftoui3(uVar4); local_3c = (Backdrop *)__ftoui3(); sampledColor = (float *)(*samplePixelFn)(&local_7c,local_3c,local_30); fVar6 = sampledColor[1]; fVar10 = sampledColor[2]; fVar11 = sampledColor[3]; outColor->_red = *sampledColor; outColor->_green = fVar6; outColor->_blue = fVar10; outColor->_alpha = fVar11; outColor->_unk = (int)sampledColor[4]; local_14 = 4; if (((backdropRefCount != (int *)0x0) && (cVar3 = (**(code **)(*backdropRefCount + 0xc))(), cVar3 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } local_14 = 0xffffffff; pBVar7 = local_3c; fVar6 = local_30; } else { sampleTreeHead = (undefined4 *)0x0; local_48 = 0; sampleTreeHead = operator_new(0x28); *sampleTreeHead = sampleTreeHead; sampleTreeHead[1] = sampleTreeHead; sampleTreeHead[2] = sampleTreeHead; *(undefined2 *)(sampleTreeHead + 3) = 0x101; local_3c = &this->_backdrop; local_14 = 0; local_30 = 0.0; do { local_34 = sampleRadius * *(float *)((int)&DAT_00c5d14c + (int)local_30) * 0.65 + local_28; sampleX = sampleRadius * *(float *)((int)&DAT_00c5d148 + (int)local_30) * 0.65 + screenX; shared_ptr::assign(&backdrop,local_3c); local_14._0_1_ = 1; samplePixelFn = *(code **)(*backdrop + 0x2c); __ftoui3(); uVar5 = __ftoui3(); (*samplePixelFn)(&sampleColor,uVar5); local_14._0_1_ = 2; if (((backdropRefCount != (int *)0x0) && (cVar3 = (**(code **)(*backdropRefCount + 0xc))(), cVar3 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } local_14 = (uint)local_14._1_3_ << 8; local_6c = local_58; local_7c = sampleColor; local_78 = fStack_64; local_74 = fStack_60; sampleLuminance = fStack_64 * 0.71516 + sampleColor * 0.212671 + fStack_60 * 0.072169; local_70 = fStack_5c; FUN_00828860(sampleSet,&sampleLuminance); local_30 = (float)((int)local_30 + 8); } while ((uint)local_30 < 0x28); medianSteps = 2; medianNode = (int *)*sampleTreeHead; do { walkNode = (int *)medianNode[2]; if (*(char *)((int)walkNode + 0xd) == '\0') { cVar3 = *(char *)(*walkNode + 0xd); medianNode = walkNode; walkNode = (int *)*walkNode; while (cVar3 == '\0') { cVar3 = *(char *)(*walkNode + 0xd); medianNode = walkNode; walkNode = (int *)*walkNode; } } else { cVar3 = *(char *)(medianNode[1] + 0xd); parentNode = (int *)medianNode[1]; walkNode = medianNode; while ((medianNode = parentNode, cVar3 == '\0' && (walkNode == (int *)medianNode[2]))) { cVar3 = *(char *)(medianNode[1] + 0xd); parentNode = (int *)medianNode[1]; walkNode = medianNode; } } medianSteps = medianSteps + -1; } while (medianSteps != 0); fVar6 = (float)medianNode[6]; fVar10 = (float)medianNode[7]; fVar11 = (float)medianNode[8]; outColor->_red = (float)medianNode[5]; outColor->_green = fVar6; outColor->_blue = fVar10; outColor->_alpha = fVar11; outColor->_unk = medianNode[9]; local_14 = 0xffffffff; FID_conflict__Erase_tree_>_> (&sampleTreeHead, (fuzzer_allocator_> *)&sampleTreeHead, (_Tree_node *)sampleTreeHead[1]); operator_delete(sampleTreeHead,0x28); fVar6 = (float)__ftoui3(); pBVar7 = (Backdrop *)__ftoui3(); } if ((DAT_00c797bc != 0) && (DAT_00c797ec != (int *)0x0)) { (**(code **)(*DAT_00c797ec + 0x2c))(&sampleColor,pBVar7,fVar6); outColor->_red = (sampleColor - outColor->_red) * fStack_5c + outColor->_red; outColor->_green = (fStack_64 - outColor->_green) * fStack_5c + outColor->_green; outColor->_blue = (fStack_60 - outColor->_blue) * fStack_5c + outColor->_blue; } fVar6 = room->_waterAmount; if (fVar6 <= 0.0) { fVar6 = outColor->_blue; fVar10 = outColor->_red; fVar11 = outColor->_green; } else { fVar1 = *(float *)&(room->_fxLayers)._fxParams.field_0x28; fVar9 = fVar6 * *(float *)&(room->_fxLayers)._fxParams.field_0x2c; fVar11 = *(float *)&(room->_fxLayers)._fxParams.field_0x38; fVar2 = *(float *)&(room->_fxLayers)._fxParams.field_0x24; fVar8 = *(float *)&(room->_fxLayers)._fxParams.field_0x3c; fVar10 = ((*(float *)&(room->_fxLayers)._fxParams.field_0x20 - outColor->_red) * fVar6 * fVar9 + outColor->_red) * ((*(float *)&(room->_fxLayers)._fxParams.field_0x34 - 1.0) * fVar6 + 1.0); outColor->_red = fVar10; fVar11 = ((fVar2 - outColor->_green) * fVar9 * room->_waterAmount + outColor->_green) * ((fVar11 - 1.0) * fVar6 + 1.0); outColor->_green = fVar11; fVar6 = ((fVar1 - outColor->_blue) * fVar9 * room->_waterAmount + outColor->_blue) * ((fVar8 - 1.0) * fVar6 + 1.0); outColor->_blue = fVar6; } fVar1 = (room->_floorColor)._colorize[3]; fVar2 = (room->_floorColor)._tint[3]; fVar10 = fVar10 * (room->_floorColor)._tint[0]; fVar11 = fVar11 * (room->_floorColor)._tint[1]; fVar6 = fVar6 * (room->_floorColor)._tint[2]; if (fVar1 != 0.0) { fVar8 = fVar11 * 0.71516 + fVar10 * 0.212671 + fVar6 * 0.072169; fVar10 = fVar10 + (fVar8 * (room->_floorColor)._colorize[0] - fVar10) * fVar1; fVar11 = fVar11 + (fVar8 * (room->_floorColor)._colorize[1] - fVar11) * fVar1; fVar6 = fVar6 + (fVar8 * (room->_floorColor)._colorize[2] - fVar6) * fVar1; } fVar1 = (room->_floorColor)._offset[1]; fVar8 = (room->_floorColor)._offset[2]; outColor->_red = fVar10 + (room->_floorColor)._offset[0]; outColor->_green = fVar11 + fVar1; outColor->_blue = fVar6 + fVar8; outColor->_alpha = fVar2 * outColor->_alpha; outColor->_unk = 0; ExceptionList = local_1c; return outColor; } //@@ 00823be0 FUN_00823be0 byte FUN_00823be0(float *param_1,Entity_Player *param_2,char param_3) { byte bVar1; Vector *extraout_EAX; Vector *pVVar2; int iVar3; uint uVar4; Room *in_ECX; Room *extraout_ECX; Room *this; int iVar5; uint goalIndex; uint startIndex; Vector local_10; this = in_ECX; if (param_2 == (Entity_Player *)0x0) { param_2 = Game::GetPlayer(g_game,0); this = extraout_ECX; } if (param_3 == '\0') { Entity_Player::GetEnterPosition((Entity_Player *)this,&local_10); pVVar2 = extraout_EAX; } else { local_10.y = (param_2->_pos).y; pVVar2 = &local_10; local_10.x = (param_2->_pos).x; } iVar5 = (int)((pVVar2->x - 40.0) / 40.0 + 0.5); iVar3 = (int)((pVVar2->y - 120.0) / 40.0 + 0.5); if ((((iVar5 < 0) || (in_ECX->_gridWidth <= iVar5)) || (iVar3 < 0)) || (in_ECX->_gridHeight <= iVar3)) { goalIndex = 0xffffffff; } else { goalIndex = in_ECX->_gridWidth * iVar3 + iVar5; } iVar3 = (int)((*param_1 - 40.0) / 40.0 + 0.5); if (((-1 < iVar3) && (iVar3 < in_ECX->_gridWidth)) && ((iVar5 = (int)((param_1[1] - 120.0) / 40.0 + 0.5), -1 < iVar5 && (iVar5 < in_ECX->_gridHeight) ))) { startIndex = in_ECX->_gridWidth * iVar5 + iVar3; uVar4 = Room::GetGridCollision(in_ECX,startIndex); if (((-1 < (int)startIndex) && (-1 < (int)goalIndex)) && ((uVar4 == 0 || (uVar4 == 5)))) { bVar1 = Room::is_obstacle_path_valid(in_ECX,startIndex,goalIndex,3); return bVar1; } } return 0; } //@@ 00823d10 Room::find_reachable_position /* DB: ? (Vector* out, Vector* pos): if 00823be0 (pathable from the player's enter position) fails, spirals outward over the room grid up to 16 rings for the first tile centre that passes; else returns pos; Game::DevolveEnemy moves the new enemy there */ void __thiscall Room::find_reachable_position(Room *this,float *param_2,float *param_3) { char cVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; float fVar7; float fVar8; int local_2c; int local_28; int local_24; float local_10; float local_c; cVar1 = FUN_00823be0(param_3,0,0); if (cVar1 == '\0') { local_24 = 0; local_28 = -1; local_2c = 1; iVar6 = (int)((*param_3 - 40.0) / 40.0 + 0.5); iVar5 = (int)((param_3[1] - 120.0) / 40.0 + 0.5); do { iVar4 = 0; if (0 < local_2c) { do { iVar6 = iVar6 + local_24; iVar5 = iVar5 + local_28; if ((((0 < iVar6) && (0 < iVar5)) && (iVar3 = this->_gridWidth, iVar6 < iVar3 + -1)) && (iVar5 < this->_gridHeight + -1)) { if ((iVar6 < iVar3) && (iVar5 < this->_gridHeight)) { iVar2 = iVar3 * iVar5 + iVar6; } else { iVar2 = -1; } fVar7 = (float)(iVar2 % iVar3) * 40.0 + 40.0; fVar8 = (float)(iVar2 / iVar3) * 40.0 + 120.0; local_10 = fVar7; local_c = fVar8; cVar1 = FUN_00823be0(&local_10,0,0); if (cVar1 != '\0') { *param_2 = fVar7; param_2[1] = fVar8; return; } } iVar4 = iVar4 + 1; } while (iVar4 < local_2c); } iVar3 = -local_28; iVar4 = local_2c + 1; if (iVar3 != 0) { iVar4 = local_2c; } local_2c = iVar4; local_28 = local_24; local_24 = iVar3; } while (iVar4 < 0x10); } fVar7 = param_3[1]; *param_2 = *param_3; param_2[1] = fVar7; return; } //@@ 00823ec0 FUN_00823ec0 int FUN_00823ec0(void) { Vector *pVVar1; int in_ECX; int iVar2; int iVar3; Vector local_c; pVVar1 = Room::GetCenterPos(&local_c); iVar3 = (int)(((pVVar1->x + 0.0) - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (*(int *)(in_ECX + 0xc) <= iVar3)) || (iVar2 = (int)(((pVVar1->y - 80.0) - 120.0) / 40.0 + 0.5), iVar2 < 0)) || (*(int *)(in_ECX + 0x10) <= iVar2)) { return -1; } return *(int *)(in_ECX + 0xc) * iVar2 + iVar3; } //@@ 00823f50 Room::attach_minecarts /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Room::Init calls it; for each room entity (+0x125c list, types 10..0x3e7 or player in deathmatch) with a spawn grid index, checks the 4 neighbours in the rail grid byte array Room+0x746c and calls Entity::GiveMinecart, special case type 0x3c5 variant 10; Entity_NPC::update_move_direction_anim */ void Room::attach_minecarts(void) { int *piVar1; Entity_NPC *this; void *pvVar2; byte railCell; uint uVar3; int in_ECX; int neighborRow; int iVar4; int iVar5; undefined1 *puVar6; undefined1 *puVar7; float railX; float railY; undefined1 auStack_54 [3]; char isMinecartNpc; int local_50; int gridRow; int self; Vector railDir; Entity_NPC *local_3c; uint entityIndex; Vector cartPos; int neighborOffsets [10]; Game *game; int gridWidth; neighborOffsets[8] = __security_cookie ^ (uint)auStack_54; entityIndex = 0; self = in_ECX; if (*(int *)(in_ECX + 0x1264) != 0) { do { game = g_game; puVar6 = &DAT_bf800000; puVar7 = (undefined1 *)0x0; this = *(Entity_NPC **)(*(int *)(in_ECX + 0x125c) + entityIndex * 4); iVar5 = this->_type; if ((iVar5 != 0x3c5) || (isMinecartNpc = '\x01', this->_variant != 10)) { isMinecartNpc = '\0'; } if (((1 < *(int *)&g_game->_deathmatchManager) && (iVar5 == 1)) || (iVar5 - 10U < 0x3de)) { local_50 = this->_spawnGridIndex; if ((-1 < local_50) && ((((iVar5 != 0x3c5 || (this->_variant != 0)) && (this->_minecart == (EntityPtr)0x0)) || (isMinecartNpc != '\0')))) { gridRow = local_50 / *(int *)(in_ECX + 0xc); local_50 = local_50 % *(int *)(in_ECX + 0xc); iVar5 = 0; neighborOffsets[0] = 0; neighborOffsets[1] = 1; neighborOffsets[2] = 0; neighborOffsets[3] = 0xffffffff; neighborOffsets[4] = 0xffffffff; neighborOffsets[5] = 0; neighborOffsets[6] = 1; neighborOffsets[7] = 0; do { iVar4 = neighborOffsets[iVar5 * 2] + local_50; if (0 < iVar4) { neighborRow = neighborOffsets[iVar5 * 2 + 1] + gridRow; if (0 < neighborRow) { gridWidth = *(int *)(in_ECX + 0xc); if (iVar4 < gridWidth + -1) { piVar1 = (int *)(in_ECX + 0x10); in_ECX = self; if (((neighborRow < *piVar1 + -1) && (iVar4 < gridWidth)) && ((neighborRow < *piVar1 && (((iVar4 = gridWidth * neighborRow + iVar4, -1 < iVar4 && (iVar4 < 0x1c0)) && (railCell = *(byte *)(self + 0x746c + iVar4), -1 < (char)railCell)))))) { if (railCell == 0xff) { uVar3 = 0; } else if ((railCell & 0x40) == 0) { if ((railCell & 0x10) == 0) { uVar3 = railCell >> 5 & 1; } else { uVar3 = 0xffffffff; } } else { uVar3 = 0; } railCell = *(byte *)(self + 0x746c + iVar4); if ((railCell != 0xff) && ((uVar3 != 0 || (isMinecartNpc != '\0')))) { railDir.y = 0.0; railDir.x = 0.0; if (uVar3 != 0) { if ((railCell & 0xf) == 0) { railDir.y = (float)puVar7; if ((int)uVar3 < 0) { puVar7 = puVar6; } else { puVar7 = (undefined1 *)0x3f800000; } } else { if (-1 < (int)uVar3) { puVar6 = (undefined1 *)0x3f800000; } railDir.y = (float)puVar6; } railDir.x = (float)puVar7; } railX = (float)(iVar4 % *(int *)(self + 0xc)) * 40.0 + 40.0; railY = (float)(iVar4 / *(int *)(self + 0xc)) * 40.0 + 120.0; in_ECX = self; local_3c = this; if (isMinecartNpc == '\0') { cartPos.x = railX; cartPos.y = railY; Entity::GiveMinecart((Entity *)this,&cartPos,&railDir); } else { (this->_velocity).y = railDir.y; (this->_pos).x = railX; (this->_pos).y = railY; (this->_velocity).x = railDir.x; (this->_targetPosition).x = railX; (this->_targetPosition).y = railY; pvVar2 = game->_room; iVar5 = (int)(((this->_pos).x - 40.0) / 40.0 + 0.5); if (((iVar5 < 0) || (*(int *)((int)pvVar2 + 0xc) <= iVar5)) || (((iVar4 = (int)((railY - 120.0) / 40.0 + 0.5), iVar4 < 0 || (((*(int *)((int)pvVar2 + 0x10) <= iVar4 || (uVar3 = *(int *)((int)pvVar2 + 0xc) * iVar4 + iVar5, 0x1bf < uVar3)) || (railCell = *(byte *)((int)pvVar2 + uVar3 + 0x746c), railCell == 0xff)))) || (((railCell = railCell & 0xf, railCell != 1 && (railCell != 9)) && (railCell != 10)))))) { iVar5 = 0; } else { iVar5 = 4; } this->_i1 = iVar5; Entity_NPC::update_move_direction_anim(this); (this->_v2).x = 0.2; } break; } } } } } iVar5 = iVar5 + 1; } while (iVar5 < 4); } } entityIndex = entityIndex + 1; } while (entityIndex < *(uint *)(in_ECX + 0x1264)); } return; } //@@ 008242d0 Room::HasLava /* ZHL [lua] Lua binding Room:HasLava */ uint __thiscall Room::HasLava(Room *this) { uint uVar1; uint in_EAX; if (this->_backdropType == 0x20) { uVar1 = *(uint *)((int)this->_descriptor + 0x44); in_EAX = uVar1 >> 5; if ((in_EAX & 1) != 0) { return CONCAT31((uint3)(uVar1 >> 0xd),1); } } return in_EAX & 0xffffff00; } //@@ 008242f0 FUN_008242f0 bool FUN_008242f0(void) { Game *pGVar1; uint uVar2; pGVar1 = g_game; if (g_game->_challenge == 0x2c) { uVar2 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); uVar2 = RoomConfig::GetStageID(pGVar1->_stage,uVar2,-1); return uVar2 == 0x1e; } if (g_game->_currentDimensionIdx == 2) { return false; } uVar2 = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); return uVar2 == 0x1e; } //@@ 00824350 Room::init_rain /* DB: ECX=Room: zeroes _numRainSpawners (+0x7454), clears _isRainStopped (+0x745c); when _waterAmount (+0x7240)>0 and stage 27/28 (Downpour/Dross) or backdrop 0x2c, picks 0..4 spawners from the room seed (RNG % 1000) and fills the spawner array +0x73f4 with random positions/velocities, then 10x Room::update_ambient_spawns (db/fields.tsv already cites it as "rain init") */ void __thiscall Room::init_rain(Room *this) { uint uVar1; byte unused; byte rngShiftB; uint baseCount; uint roll; uint spawnersLeft; int updatesLeft; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float local_4c; float local_48; float local_44; undefined8 rngShiftsAB; Vector spawnPos; uint attempt; code *breakTrap; this->_numRainSpawners = 0; this->_rainIntensity = 1.0; this->_isRainStopped = 0; if ((0.0 < this->_waterAmount) && (((uVar1 = Game::GetStageID(g_game,(byte)this), uVar1 == 0x1b || (uVar1 = Game::GetStageID(g_game,unused), uVar1 == 0x1c)) || (this->_backdropType == 0x2c)))) { rngShiftsAB = 0xb00000001; uVar1 = *(uint *)((int)this->_descriptor + 0x58); if (this->_bossId == 0x4d) { spawnersLeft = ((byte)~*(byte *)((int)this->_descriptor + 0x44) & 1) << 2; } else { if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar1 = uVar1 >> 1 ^ uVar1; uVar1 = uVar1 << 0xb ^ uVar1; uVar1 = uVar1 >> 6 ^ uVar1; roll = uVar1 % 1000; baseCount = (roll < 300) + 1; if (99 < roll) { baseCount = (uint)(roll < 300); } spawnersLeft = baseCount + 1; if (0x27 < roll) { spawnersLeft = baseCount; } if (roll < 10) { spawnersLeft = spawnersLeft + 1; } } attempt = 0; do { if (spawnersLeft == 0) break; if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar1 = uVar1 >> ((byte)rngShiftsAB & 0x1f) ^ uVar1; rngShiftB = (byte)((ulonglong)rngShiftsAB >> 0x20); uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1; uVar1 = uVar1 >> 6 ^ uVar1; fVar2 = (this->_topLeftPos).y + 20.0; fVar2 = (((this->_bottomRightPos).y - 20.0) - fVar2) * (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283062e-10 + fVar2; if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar1 = uVar1 >> ((byte)rngShiftsAB & 0x1f) ^ uVar1; uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1; uVar1 = uVar1 >> 6 ^ uVar1; fVar3 = (this->_topLeftPos).x + 20.0; fVar3 = (((this->_bottomRightPos).x - 20.0) - fVar3) * (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283062e-10 + fVar3; spawnPos.x = fVar3; spawnPos.y = fVar2; FUN_00995f40(&local_4c,&spawnPos); if (0.6 <= (local_48 + local_4c + local_44) * 0.333) { updatesLeft = this->_numRainSpawners; if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar1 = uVar1 >> ((byte)rngShiftsAB & 0x1f) ^ uVar1; uVar1 = uVar1 << ((byte)((ulonglong)rngShiftsAB >> 0x20) & 0x1f) ^ uVar1; uVar1 = uVar1 >> 6 ^ uVar1; fVar4 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283062e-10 * 360.0 * 0.017453292; fVar5 = cos(fVar4); fVar4 = sin(fVar4); *(float *)(this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x7c) = fVar3; *(float *)(this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x80) = fVar2; if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar1 = uVar1 >> ((byte)rngShiftsAB & 0x1f) ^ uVar1; rngShiftB = (byte)((ulonglong)rngShiftsAB >> 0x20); uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1; uVar1 = uVar1 >> 6 ^ uVar1; fVar2 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283062e-10 * 60.0 + 20.0; *(float *)(this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x88) = fVar2 * fVar4; *(float *)(this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x84) = fVar2 * fVar5; fVar2 = cos(1.5707964); fVar3 = sin(1.5707964); if (uVar1 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); breakTrap = (code *)swi(3); (*breakTrap)(); return; } uVar1 = uVar1 >> ((byte)rngShiftsAB & 0x1f) ^ uVar1; uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1; uVar1 = uVar1 >> 6 ^ uVar1; fVar6 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283062e-10 * 60.0 + 20.0; *(float *)(this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x90) = fVar6 * (fVar3 * fVar5 + fVar2 * fVar4); *(float *)(this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x8c) = fVar6 * (fVar2 * fVar5 - fVar3 * fVar4); this->_numRainSpawners = this->_numRainSpawners + 1; spawnersLeft = spawnersLeft - 1; } attempt = attempt + 1; } while (attempt < 10); updatesLeft = 10; do { update_ambient_spawns(); updatesLeft = updatesLeft + -1; } while (updatesLeft != 0); } return; } //@@ 00824800 Room::update_ambient_spawns /* DB: ? Room::Update tail: Room::GetTimeScale, random SpawnEx(1000,0x87) at clamped positions */ void Room::update_ambient_spawns(void) { uint uVar1; Entity *pEVar2; Room *in_ECX; int iVar3; float *pfVar4; float fVar5; float fVar6; float fVar7; Vector local_18; Vector local_10; if ((0 < in_ECX->_numRainSpawners) && (fVar7 = in_ECX->_rainIntensity, 0.0 < fVar7)) { if (in_ECX->_isRainStopped != 0) { fVar7 = fVar7 - 0.02; if (fVar7 <= 0.0) { fVar7 = 0.0; } in_ECX->_rainIntensity = fVar7; } if (fVar7 < 0.01) { in_ECX->_rainIntensity = 0.0; return; } fVar7 = GetTimeScale(in_ECX,(Vector *)in_ECX,(Entity *)0x0); iVar3 = (int)(1.0 / (fVar7 * in_ECX->_rainIntensity)); if (((iVar3 == 0) || (g_game->_frameCount % iVar3 < 1)) && (iVar3 = 0, 0 < in_ECX->_numRainSpawners)) { pfVar4 = (float *)&in_ECX->field_0x7408; do { uVar1 = Random(); fVar7 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar7 = fVar7 + fVar7; uVar1 = Random(); fVar5 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10; fVar6 = cos(fVar7); fVar6 = fVar6 * fVar5; fVar7 = sin(fVar7); fVar7 = fVar7 * fVar5; local_18.x = fVar6 * pfVar4[-3] + pfVar4[-5] + fVar7 * pfVar4[-1]; local_18.y = fVar6 * pfVar4[-2] + pfVar4[-4] + fVar7 * *pfVar4; if (*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 0x48) - 9U < 4) { GetClampedPositionImpl(in_ECX,&local_10,&local_18,0.0,0.0,0.0,0.0); if ((local_10.x == local_18.x) && (local_10.y == local_18.y)) { LAB_00824a1f: uVar1 = Random(); pEVar2 = Game::SpawnEx(g_game,1000,0x87,&local_18,&g_vectorZero,(Entity *)0x0,0,uVar1,0) ; (**(code **)(*(int *)pEVar2 + 0xc))(); } } else if ((((in_ECX->_topLeftPos).x + 0.0 <= local_18.x) && (local_18.x <= (in_ECX->_bottomRightPos).x - 0.0)) && (((in_ECX->_topLeftPos).y + 0.0 <= local_18.y && (local_18.y <= (in_ECX->_bottomRightPos).y - 0.0)))) goto LAB_00824a1f; iVar3 = iVar3 + 1; pfVar4 = pfVar4 + 6; } while (iVar3 < in_ECX->_numRainSpawners); } } return; } //@@ 00824a70 Room::update_ambient_effects /* DB: ? called from Room::Update; this=Room (+8 roomType, +0x1bb0 _bossId, +0x1d18 _backdropType, +0x14..0x20 bounds); skips boss 0x5b room and Level::HasAbandonedMineshaft; spawns effect 1000/0x8a particles with color per backdrop (0x2b/0x2c CORPSE2/3) */ uint __thiscall Room::update_ambient_effects(Room *this) { double dVar1; byte bVar2; uint stageId; uint uVar3; uint uVar4; Entity *particle; void *idleAnimData; LayerState *layer; Game *pGVar5; float spawnTop; int framesSinceEnter; int remainingSpawns; Vector spawnPos; Vector velocity; ColorMod particleColor; int backdropType; Game *game; ANM2 *particleSprite; float roomBottom; float roomLeft; float roomRight; game = g_game; if (g_game->_challenge == 0x2c) { stageId = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); LAB_00824abd: pGVar5 = g_game; stageId = RoomConfig::GetStageID(game->_stage,stageId,-1); if ((stageId != 0x21) && (stageId != 0x1c)) goto LAB_00824ad7; } else { if (g_game->_currentDimensionIdx != 2) { stageId = g_game->_stageType; goto LAB_00824abd; } stageId = 0x23; pGVar5 = g_game; LAB_00824ad7: if (((this->_roomType != 5) || (this->_bossId != 0x5b)) && (pGVar5->_currentRoomIdx != -0x10)) { bVar2 = Level::HasAbandonedMineshaft((Level *)pGVar5); pGVar5 = g_game; if (((bVar2 == 0) || (g_game->_currentDimensionIdx != 1)) && (g_game->_currentDimensionIdx == 0)) { return (uint)bVar2; } } } if (*(char *)this == '\0') { framesSinceEnter = -1; } else { framesSinceEnter = pGVar5->_frameCount - this->_enterFrame; if (framesSinceEnter == 0) goto LAB_00824b4c; } if (pGVar5->_frameCount % 0xd2 != 0) { return pGVar5->_frameCount / 0xd2; } LAB_00824b4c: roomRight = (this->_bottomRightPos).x; roomBottom = (this->_bottomRightPos).y; spawnTop = (this->_topLeftPos).y - 40.0; roomLeft = (this->_topLeftPos).x; remainingSpawns = (uint)(framesSinceEnter == 0) * 4 + 1; do { uVar3 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]; uVar4 = Random(); spawnPos.x = ((roomRight + 500.0) - roomLeft) * (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 + roomLeft; if (framesSinceEnter != 0) { spawnPos.x = roomRight + 600.0; } spawnPos.y = ((roomBottom + 40.0) - spawnTop) * (float)((double)(int)uVar3 + dVar1) * 2.3283064e-10 + spawnTop; uVar3 = Random(); velocity.y = 0.0; velocity.x = -0.25 - (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.5; uVar3 = Random(); particle = Game::SpawnEx(g_game,1000,0x8a,&spawnPos,&velocity,(Entity *)0x0,0,uVar3,0); particleSprite = &particle->_sprite; idleAnimData = ANM2::GetAnimationData(particleSprite,s_Idle); uVar3 = *(uint *)((int)idleAnimData + 0x30); uVar4 = 0; if (uVar3 != 0) { uVar4 = Random(); uVar4 = uVar4 % uVar3; } bVar2 = ANM2::SetAnimation(particleSprite,s_Idle,1); if (((bVar2 != 0) && ((particle->_sprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(particle->_sprite)._animState,(float)(int)uVar4), (particle->_sprite)._animState._animData != (void *)0x0)) { (particle->_sprite)._animState._isPlaying = 0; } uVar3 = Random(); (particle->_sprite)._flipX = (byte)uVar3 & 1; uVar3 = Random(); particleColor._offset[0] = 0.0; (particle->_sprite)._flipY = (byte)uVar3 & 1; particleColor._offset[1] = 0.0; particleColor._offset[2] = 0.0; if (stageId == 0x1b) { particleColor._tint[0] = 0.87843144; particleColor._tint[1] = 0.9607844; particleColor._tint[2] = 0.97647065; } else { backdropType = this->_backdropType; if ((backdropType == 0x2c) || (backdropType == 0x2b)) { particleColor._tint[0] = 0.54901963; particleColor._tint[1] = 0.16470589; particleColor._tint[2] = 0.16470589; } else if (backdropType == 0xd) { particleColor._tint[0] = 0.83921576; particleColor._tint[1] = 0.9176471; particleColor._tint[2] = 0.97647065; } else if (stageId == 0x1c) { particleColor._tint[0] = 0.21960786; particleColor._tint[1] = 0.27450982; particleColor._tint[2] = 0.08627451; } else if ((stageId == 0x1d) || (stageId == 0x1e)) { particleColor._tint[0] = 0.3921569; particleColor._tint[1] = 0.3137255; particleColor._tint[2] = 0.50980395; } else if (g_game->_currentDimensionIdx == 2) { particleColor._tint[0] = 0.47058827; particleColor._tint[1] = 0.47058827; particleColor._tint[2] = 0.47058827; } else { particleColor._tint[0] = 0.43921572; particleColor._tint[1] = 0.54901963; particleColor._tint[2] = 0.1764706; } } uVar3 = Random(); particleColor._tint[3] = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.7; layer = ANM2::GetLayer(particleSprite,(byte *)0x0); if (&layer->_color != &particleColor) { (layer->_color)._tint[0] = particleColor._tint[0]; (layer->_color)._tint[1] = particleColor._tint[1]; (layer->_color)._tint[2] = particleColor._tint[2]; (layer->_color)._tint[3] = particleColor._tint[3]; (layer->_color)._colorize[0] = 0.0; (layer->_color)._colorize[1] = 0.0; (layer->_color)._colorize[2] = 0.0; (layer->_color)._colorize[3] = 0.0; *(ulonglong *)(layer->_color)._offset = CONCAT44(particleColor._offset[1],particleColor._offset[0]); (layer->_color)._offset[2] = particleColor._offset[2]; } uVar3 = (**(code **)(*(int *)particle + 0xc))(); remainingSpawns = remainingSpawns + -1; } while (remainingSpawns != 0); return uVar3; } //@@ 00824ee0 Room::update_water_current /* DB: called from Room::Update; this=Room (+0x7460 _waterCurrent Vector, +0x125c/+0x1264 entity list, +0xc/+0x10 grid dims, +0x24 grid array); pushes pickups/NPCs by _waterCurrent*0.4 and spawns effect 1000/99 splashes every 3 frames prototype: db/protos.zhl */ void __thiscall Room::update_water_current(Room *this) { byte bVar1; uint uVar2; uint rngValue; Entity *splash; int iVar3; Entity *pEVar4; int framesInRoom; int iVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; uint entityIndex; int gridIndex; void **local_40; Vector local_38; Vector local_30; Vector gridPos; Vector clampedPos; Vector splashVelocity; Vector splashPos; Game *game; if (((this->_waterCurrent).x != g_vectorZero.x) || ((this->_waterCurrent).y != g_vectorZero.y)) { entityIndex = 0; if ((this->_entityList)._updateEL._size != 0) { do { pEVar4 = *(Entity **)((int)(this->_entityList)._updateEL._data + entityIndex * 4); framesInRoom = pEVar4->_type; if (framesInRoom == 5) { if (pEVar4->_entityCollisionClass != 0) { LAB_00824f78: if ((pEVar4->_entityGridCollisionClass == 5) || (pEVar4->_entityGridCollisionClass == 6) ) { fVar9 = (this->_waterCurrent).y; (pEVar4->_velocity).x = (this->_waterCurrent).x * 0.4 + (pEVar4->_velocity).x; (pEVar4->_velocity).y = fVar9 * 0.4 + (pEVar4->_velocity).y; game = g_game; if ((((pEVar4->_flags & 0x4000) == 0) && ((bVar1 = Game::IsPaused(g_game), bVar1 == 0 && (game->_frameCount % 3 == 0)))) && ((pEVar4->_type == 1 || (pEVar4->_type - 10U < 0x3de)))) { uVar2 = Random(); for (framesInRoom = uVar2 % 3 + 2; framesInRoom != 0; framesInRoom = framesInRoom + -1) { fVar9 = (pEVar4->_pos).x; fVar11 = (pEVar4->_pos).y; uVar2 = Random(); fVar6 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)] ) * 2.3283064e-10 * 3.14; fVar6 = fVar6 + fVar6; fVar10 = pEVar4->_size; uVar2 = Random(); fVar7 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)] ) * 2.3283064e-10; fVar8 = cos(fVar6); local_38.x = fVar8 * fVar10 * fVar7 + fVar9; fVar9 = sin(fVar6); local_38.y = fVar9 * fVar10 * fVar7 + fVar11; uVar2 = Random(); rngValue = Random(); fVar10 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 6.0 + 4.0; fVar9 = (this->_waterCurrent).x; fVar11 = (this->_waterCurrent).y; rngValue = Random(); fVar6 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar6 = fVar6 + fVar6; local_30.x = cos(fVar6); local_30.x = local_30.x + fVar9 * fVar10; local_30.y = sin(fVar6); local_30.y = local_30.y + fVar11 * fVar10; splash = Game::SpawnEx(g_game,1000,99,&local_38,&local_30,pEVar4,1,uVar2,0); (**(code **)(*(int *)splash + 0xc))(); } } } } } else if (((framesInRoom == 1) || (framesInRoom - 10U < 0x3de)) || (framesInRoom == 4)) goto LAB_00824f78; entityIndex = entityIndex + 1; } while (entityIndex < (uint)(this->_entityList)._updateEL._size); } if ((*(char *)this != '\0') && (framesInRoom = g_game->_frameCount - this->_enterFrame, framesInRoom == (framesInRoom / 3) * 3)) { framesInRoom = this->_gridWidth * this->_gridHeight; fVar9 = (this->_waterCurrent).x * 40.0; fVar11 = (this->_waterCurrent).y * 40.0; gridIndex = 0; if (0 < framesInRoom) { local_40 = this->_gridEntities; do { if ((*local_40 != (void *)0x0) && (*(int *)((int)*local_40 + 4) == 0xf)) { fVar6 = (float)(gridIndex % this->_gridWidth) * 40.0 + 40.0 + fVar9; fVar10 = (float)(gridIndex / this->_gridWidth) * 40.0 + 120.0 + fVar11; gridPos.x = fVar6; gridPos.y = fVar10; if (*(int *)(*(int *)((int)this->_descriptor + 0x10) + 0x48) - 9U < 4) { GetClampedPositionImpl(this,&clampedPos,&gridPos,0.0,0.0,0.0,0.0); if ((clampedPos.x == fVar6) && (clampedPos.y == fVar10)) { LAB_0082540c: iVar5 = (int)((fVar6 - 40.0) / 40.0 + 0.5); iVar3 = (int)((fVar10 - 120.0) / 40.0 + 0.5); if (((iVar5 < 0) || ((this->_gridWidth <= iVar5 || (iVar3 < 0)))) || (this->_gridHeight <= iVar3)) { iVar5 = -1; } else { iVar5 = iVar3 * this->_gridWidth + iVar5; } uVar2 = GetGridCollision(this,iVar5); if ((int)uVar2 < 2) { uVar2 = Random(); for (iVar3 = uVar2 % 3 + 2; iVar3 != 0; iVar3 = iVar3 + -1) { uVar2 = Random(); rngValue = Random(); fVar8 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 6.0 + 4.0; fVar7 = (this->_waterCurrent).x; local_30.x = (this->_waterCurrent).y; rngValue = Random(); local_38.x = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_38.x = local_38.x + local_38.x; splashVelocity.x = cos(local_38.x); splashVelocity.x = splashVelocity.x + fVar7 * fVar8; splashVelocity.y = sin(local_38.x); splashVelocity.y = splashVelocity.y + local_30.x * fVar8; rngValue = Random(); local_30.x = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 - 0.5; local_38.x = (this->_waterCurrent).x; fVar7 = (this->_waterCurrent).y; rngValue = Random(); fVar8 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 ; splashPos.x = local_30.x * fVar11 + (fVar6 - fVar9 * 0.54) + local_38.x * 3.0 * fVar8; splashPos.y = local_30.x * fVar9 + (fVar10 - fVar11 * 0.54) + fVar7 * 3.0 * fVar8; pEVar4 = Game::SpawnEx(g_game,1000,99,&splashPos,&splashVelocity,(Entity *)0x0,1 ,uVar2,0); fVar7 = (pEVar4->_sprite)._scale.x; fVar8 = (pEVar4->_sprite)._scale.y; iVar5 = *(int *)pEVar4; (pEVar4->_sprite)._scale.x = fVar7 + fVar7; (pEVar4->_sprite)._scale.y = fVar8 + fVar8; (**(code **)(iVar5 + 0xc))(); } } } } else if (((((this->_topLeftPos).x + 0.0 <= fVar6) && (fVar6 <= (this->_bottomRightPos).x - 0.0)) && ((this->_topLeftPos).y + 0.0 <= fVar10)) && (fVar10 <= (this->_bottomRightPos).y - 0.0)) goto LAB_0082540c; } gridIndex = gridIndex + 1; local_40 = local_40 + 1; } while (gridIndex < framesInRoom); } } } return; } //@@ 00825730 Room::CanPickupGridEntity /* ZHL [exact] __thiscall bool Room::CanPickupGridEntity(int GridIndex); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Room::CanPickupGridEntity(Room *this,int GridIndex) { void *pvVar1; int iVar2; if (0x1bf < (uint)GridIndex) { return 0; } pvVar1 = this->_gridEntities[GridIndex]; if (pvVar1 == (void *)0x0) { return 0; } if (*(int *)((int)pvVar1 + 0x3c) == 0) { return 0; } iVar2 = *(int *)((int)pvVar1 + 4); if (((((iVar2 == 2) || (iVar2 == 4)) || (iVar2 == 5)) || ((iVar2 == 6 || (iVar2 == 0x1a)))) || ((iVar2 == 0x16 || (iVar2 == 0x1b)))) { return 1; } if (iVar2 == 0xc) { if (*(uint *)((int)pvVar1 + 0xc) < 4) { return 1; } } else if ((iVar2 == 0xe) && (*(int *)((int)pvVar1 + 0xc) != 1000)) { return 1; } return 0; } //@@ 008257a0 Room::spawn_grid_from_desc /* WARNING: Unable to use type for symbol gigaGridIndex */ /* DB: ? (gridIdx, GridEntityDesc*, ANM2*) -> bool: GridEntity::GridEntity/Init at the index, SetBigRockFrame, UpdateNeighbors, TrySpawnWorms/TrySpawnLadder, "SpawnGridEntity: Grid index invalid"; called from Room::PickupGridEntity prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Room::spawn_grid_from_desc(Room *this,uint gridIndex,GridEntityDesc *outDesc,ANM2 *outSprite) { int iVar1; int iVar2; ANM2 other; undefined3 uVar3; Room *pRVar4; void **ppvVar5; byte isLadderSpawned; GridEntity_Poop *gigaPart; GridEntity *decoration; uint flyGridIndex; void *listData; Room *pRVar6; GridEntity_Rock *pGVar7; int iVar8; uint uVar9; ANM2 aAStackY_8c7c [128]; undefined1 in_stack_fffffe98 [248]; float in_stack_ffffff90; float in_stack_ffffff94; undefined4 in_stack_ffffff98; float in_stack_ffffff9c; undefined4 in_stack_ffffffa0; int in_stack_ffffffa4; int in_stack_ffffffa8; EntityList_EL flies; GridEntity *allocatedGrid; uint spawnSeed; GridEntity_Rock *local_30; int partVariant; Room *room; char isRock; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; GridEntity_Rock *gigaGridIndex; int *eternalFly; undefined4 *oldGrid; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b01993; local_1c = ExceptionList; if (0x1bf < gridIndex) { return 0; } pGVar7 = this->_gridEntities[gridIndex]; if (pGVar7 == (GridEntity_Rock *)0x0) { return 0; } if (pGVar7->_collisionClass == 0) { return 0; } iVar8 = (pGVar7->_desc)._type; isRock = '\0'; local_30 = pGVar7; room = this; if (((((iVar8 == 2) || (iVar8 == 4)) || (iVar8 == 5)) || ((iVar8 == 6 || (iVar8 == 0x16)))) || ((iVar8 == 0x19 || ((iVar8 == 0x1a || (iVar8 == 0x1b)))))) { ExceptionList = &local_1c; GridEntity_Rock::TrySpawnWorms(pGVar7); uVar9 = (pGVar7->_desc)._variant; if ((999 < uVar9) && (-1 < (int)(uVar9 - 1000))) { GridEntity_Rock::UpdateNeighbors(pGVar7); in_stack_ffffffa4 = 0x82588a; GridEntity_Rock::SetBigRockFrame(pGVar7); } in_stack_ffffffa8 = 0x825892; grid_mark_neighbors_dirty(pGVar7->_gridIndex); isRock = '\x01'; ppvVar5 = ExceptionList; } else { ppvVar5 = &local_1c; if (iVar8 == 0xc) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if (3 < (uint)(pGVar7->_desc)._state) { return 0; } } else { if (iVar8 != 0xe) { return 0; } puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if ((pGVar7->_desc)._state == 1000) { return 0; } } } ExceptionList = ppvVar5; if (outSprite != (ANM2 *)0x0) { ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x168),&pGVar7->_sprite); other._championColor._offset[1] = in_stack_ffffff90; other._filename._buf[0] = in_stack_fffffe98[0]; other._filename._buf[1] = in_stack_fffffe98[1]; other._filename._buf[2] = in_stack_fffffe98[2]; other._filename._buf[3] = in_stack_fffffe98[3]; other._filename._buf[4] = in_stack_fffffe98[4]; other._filename._buf[5] = in_stack_fffffe98[5]; other._filename._buf[6] = in_stack_fffffe98[6]; other._filename._buf[7] = in_stack_fffffe98[7]; other._filename._buf[8] = in_stack_fffffe98[8]; other._filename._buf[9] = in_stack_fffffe98[9]; other._filename._buf[10] = in_stack_fffffe98[10]; other._filename._buf[0xb] = in_stack_fffffe98[0xb]; other._filename._buf[0xc] = in_stack_fffffe98[0xc]; other._filename._buf[0xd] = in_stack_fffffe98[0xd]; other._filename._buf[0xe] = in_stack_fffffe98[0xe]; other._filename._buf[0xf] = in_stack_fffffe98[0xf]; other._filename._size = in_stack_fffffe98._16_4_; other._filename._capacity = in_stack_fffffe98._20_4_; other._animDefaultName._buf[0] = in_stack_fffffe98[0x18]; other._animDefaultName._buf[1] = in_stack_fffffe98[0x19]; other._animDefaultName._buf[2] = in_stack_fffffe98[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffe98[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffe98[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffe98[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffe98[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffe98[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffe98[0x20]; other._animDefaultName._buf[9] = in_stack_fffffe98[0x21]; other._animDefaultName._buf[10] = in_stack_fffffe98[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffe98[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffe98[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffe98[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffe98[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffe98[0x27]; other._animDefaultName._size = in_stack_fffffe98._40_4_; other._animDefaultName._capacity = in_stack_fffffe98._44_4_; other._animState._animation = (void *)in_stack_fffffe98._48_4_; other._animState._animData = (void *)in_stack_fffffe98._52_4_; other._animState._layerFrames = (void *)in_stack_fffffe98._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffe98._60_4_; other._animState._animFrame = (float)in_stack_fffffe98._64_4_; other._animState._isPlaying = in_stack_fffffe98[0x44]; other._animState._21_3_ = in_stack_fffffe98._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffe98._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffe98._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffe98._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffe98._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffe98._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffe98._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffe98._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffe98[100]; other._overlayAnimState._21_3_ = in_stack_fffffe98._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffe98._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffe98._108_4_; other._overlayRenderFirst = in_stack_fffffe98[0x70]; other._113_3_ = in_stack_fffffe98._113_3_; other._animData = (void *)in_stack_fffffe98._116_4_; other._animCount = in_stack_fffffe98._120_4_; other._layerState = (void *)in_stack_fffffe98._124_4_; other._layerCount = in_stack_fffffe98._128_4_; other._nullLayerNames = (void *)in_stack_fffffe98._132_4_; other._numNullLayers = in_stack_fffffe98._136_4_; other._eventNames = (void *)in_stack_fffffe98._140_4_; other._numEvents = in_stack_fffffe98._144_4_; other._offset.x = (float)in_stack_fffffe98._148_4_; other._offset.y = (float)in_stack_fffffe98._152_4_; other._scale.x = (float)in_stack_fffffe98._156_4_; other._scale.y = (float)in_stack_fffffe98._160_4_; other._rotation = (float)in_stack_fffffe98._164_4_; other._color._tint[0] = (float)in_stack_fffffe98._168_4_; other._color._tint[1] = (float)in_stack_fffffe98._172_4_; other._color._tint[2] = (float)in_stack_fffffe98._176_4_; other._color._tint[3] = (float)in_stack_fffffe98._180_4_; other._color._colorize[0] = (float)in_stack_fffffe98._184_4_; other._color._colorize[1] = (float)in_stack_fffffe98._188_4_; other._color._colorize[2] = (float)in_stack_fffffe98._192_4_; other._color._colorize[3] = (float)in_stack_fffffe98._196_4_; other._color._offset[0] = (float)in_stack_fffffe98._200_4_; other._color._offset[1] = (float)in_stack_fffffe98._204_4_; other._color._offset[2] = (float)in_stack_fffffe98._208_4_; other._championColor._tint[0] = (float)in_stack_fffffe98._212_4_; other._championColor._tint[1] = (float)in_stack_fffffe98._216_4_; other._championColor._tint[2] = (float)in_stack_fffffe98._220_4_; other._championColor._tint[3] = (float)in_stack_fffffe98._224_4_; other._championColor._colorize[0] = (float)in_stack_fffffe98._228_4_; other._championColor._colorize[1] = (float)in_stack_fffffe98._232_4_; other._championColor._colorize[2] = (float)in_stack_fffffe98._236_4_; other._championColor._colorize[3] = (float)in_stack_fffffe98._240_4_; other._championColor._offset[0] = (float)in_stack_fffffe98._244_4_; other._championColor._offset[2] = in_stack_ffffff94; other._flipX = (byte)in_stack_ffffff98; other._flipY = SUB41(in_stack_ffffff98,1); other._258_2_ = SUB42(in_stack_ffffff98,2); other._playbackSpeed = in_stack_ffffff9c; other._264_1_ = (char)in_stack_ffffffa0; other._loaded = SUB41(in_stack_ffffffa0,1); other._266_2_ = SUB42(in_stack_ffffffa0,2); other._shadowLayerIndex = in_stack_ffffffa4; other._bitflags = in_stack_ffffffa8; ANM2::operator_assign(outSprite,other); } if (outDesc != (GridEntityDesc *)0x0) { iVar8 = (pGVar7->_desc)._variant; iVar1 = (pGVar7->_desc)._state; iVar2 = (pGVar7->_desc)._spawnCount; outDesc->_type = (pGVar7->_desc)._type; outDesc->_variant = iVar8; outDesc->_state = iVar1; outDesc->_spawnCount = iVar2; iVar8 = (pGVar7->_desc)._varData; isLadderSpawned = (pGVar7->_desc)._initialized; uVar3 = *(undefined3 *)&(pGVar7->_desc).field_0x19; iVar1 = (pGVar7->_desc)._variableSeed; outDesc->_spawnSeed = (pGVar7->_desc)._spawnSeed; outDesc->_varData = iVar8; outDesc->_initialized = isLadderSpawned; *(undefined3 *)&outDesc->field_0x19 = uVar3; outDesc->_variableSeed = iVar1; } if (((pGVar7->_desc)._type == 0xe) && ((pGVar7->_desc)._variant - 7U < 4)) { if (outDesc != (GridEntityDesc *)0x0) { outDesc->_variant = 7; } partVariant = 7; pRVar6 = room; do { iVar8 = partVariant; if (partVariant != (pGVar7->_desc)._variant) { gigaPart = GridEntity_Poop::get_giga_part((GridEntity_Poop *)pGVar7,partVariant,0); if (gigaPart != (GridEntity_Poop *)0x0) { uVar9 = gigaPart->_gridIndex; spawnSeed = (gigaPart->_desc)._spawnSeed; if ((uVar9 < 0x1c0) && (oldGrid = room->_gridEntities[uVar9], oldGrid != (undefined4 *)0x0)) { room->_gridPaths[uVar9] = 0; room->_gridEntities[uVar9] = (void *)0x0; (**(code **)*oldGrid)(); } if (((int)uVar9 < 0) || (0x1bf < (int)uVar9)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((0x1bf < uVar9) || (900 < room->_gridPaths[uVar9])) { pRVar6 = room; goto LAB_00825a05; } decoration = operator_new(0x154); local_14 = 0; allocatedGrid = decoration; if (decoration == (GridEntity *)0x0) { decoration = (GridEntity *)0x0; } else { GridEntity::GridEntity(decoration); *(undefined ***)decoration = IsaacRepentancePlus::GridEntity_Decoration::vftable; } pRVar6 = room; local_14 = 0xffffffff; if (decoration != (GridEntity *)0x0) { decoration->_gridIndex = uVar9; (decoration->_desc)._type = 1; if (room->_gridEntities[uVar9] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)room->_gridEntities[uVar9])(); } pRVar6->_gridEntities[uVar9] = decoration; (decoration->_desc)._variant = 1000; (decoration->_desc)._varData = 0; GridEntity::Init(decoration,spawnSeed); } pGVar7 = local_30; iVar8 = partVariant; } pRVar6 = room; partVariant = iVar8; } LAB_00825a05: partVariant = partVariant + 1; } while (partVariant < 0xb); gigaGridIndex = (GridEntity_Rock *)pGVar7->_gridIndex; spawnSeed = (pGVar7->_desc)._spawnSeed; local_30 = gigaGridIndex; if ((gigaGridIndex < (GridEntity_Rock *)0x1c0) && (oldGrid = pRVar6->_gridEntities[(int)gigaGridIndex], oldGrid != (undefined4 *)0x0)) { pRVar6->_gridPaths[(int)gigaGridIndex] = 0; pRVar6->_gridEntities[(int)gigaGridIndex] = (void *)0x0; (**(code **)*oldGrid)(); } if (((int)gigaGridIndex < 0) || (0x1bf < (int)gigaGridIndex)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } pRVar6 = room; if (((GridEntity_Rock *)0x1bf < gigaGridIndex) || (900 < room->_gridPaths[(int)local_30])) goto LAB_00825b02; decoration = operator_new(0x154); local_14 = 0x17; allocatedGrid = decoration; if (decoration == (GridEntity *)0x0) { decoration = (GridEntity *)0x0; } else { GridEntity::GridEntity(decoration); *(undefined ***)decoration = IsaacRepentancePlus::GridEntity_Decoration::vftable; } pRVar4 = room; pGVar7 = local_30; local_14 = 0xffffffff; if (decoration == (GridEntity *)0x0) goto LAB_00825b02; (decoration->_desc)._type = 1; decoration->_gridIndex = (int)local_30; if (room->_gridEntities[(int)local_30] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)room->_gridEntities[(int)local_30])(); } pRVar4->_gridEntities[(int)pGVar7] = decoration; (decoration->_desc)._variant = 1000; (decoration->_desc)._varData = 0; GridEntity::Init(decoration,spawnSeed); } else if ((isRock == '\0') || (isLadderSpawned = GridEntity_Rock::TrySpawnLadder(pGVar7), isLadderSpawned == 0)) { spawnSeed = (pGVar7->_desc)._spawnSeed; room->_gridPaths[gridIndex] = 0; room->_gridEntities[gridIndex] = (void *)0x0; (*(code *)**(undefined4 **)pGVar7)(); pRVar6 = room; if (room->_gridPaths[gridIndex] < 0x385) { decoration = operator_new(0x154); local_14 = 0x2e; allocatedGrid = decoration; if (decoration == (GridEntity *)0x0) { decoration = (GridEntity *)0x0; } else { GridEntity::GridEntity(decoration); *(undefined ***)decoration = IsaacRepentancePlus::GridEntity_Decoration::vftable; } local_14 = 0xffffffff; if (decoration != (GridEntity *)0x0) { (decoration->_desc)._type = 1; decoration->_gridIndex = gridIndex; if (pRVar6->_gridEntities[gridIndex] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)pRVar6->_gridEntities[gridIndex])(); } pRVar6->_gridEntities[gridIndex] = decoration; (decoration->_desc)._variant = 1000; (decoration->_desc)._varData = 0; GridEntity::Init(decoration,spawnSeed); } } goto LAB_00825b02; } pRVar6 = room; LAB_00825b02: EntityList::QuerySublist(&pRVar6->_entityList,&flies,0x60,-1,-1,0,0); uVar9 = 0; local_14 = 0x45; if (flies._size != 0) { listData = flies._data; do { eternalFly = *(int **)((int)listData + uVar9 * 4); if (eternalFly[0xef] == 0) { flyGridIndex = GetGridIndex(room,(Vector *)(eternalFly + 0xcd)); if (flyGridIndex == gridIndex) { eternalFly[0x2d9] = 0x10; (**(code **)(*eternalFly + 0xc))(); } listData = flies._data; } uVar9 = uVar9 + 1; } while (uVar9 < (uint)flies._size); } EntityList_Query::~EntityList_Query(&flies); ExceptionList = local_1c; return 1; } //@@ 00825c50 Room::PickupGridEntity /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity_Effect* Room::PickupGridEntity(int GridIndex); prototype: REPENTOGON, confirmed by RET 4 */ Entity_Effect * __thiscall Room::PickupGridEntity(Room *this,int GridIndex) { byte bVar1; uint seed; Entity_Effect *pEVar2; GridEntityDesc local_160; ANM2 local_140; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)&(&local_140)[1]._animDefaultName._size; local_14 = 0xffffffff; puStack_18 = &LAB_00b019c0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&local_140)[1]._animDefaultName._buf + 4); ExceptionList = &local_1c; local_160._type = 0; local_160._variant = 0; local_160._state = 0; local_160._spawnCount = 0; local_160._spawnSeed = 0x16a9de81; local_160._varData = 0; local_160._24_4_ = local_160._24_4_ & 0xffffff00; local_160._variableSeed = 0x16a9de81; ANM2::constructor(&local_140); local_14 = 0; bVar1 = spawn_grid_from_desc(this,GridIndex,&local_160,&local_140); if (bVar1 == 0) { pEVar2 = (Entity_Effect *)0x0; } else { seed = Random(); pEVar2 = (Entity_Effect *) Game::Spawn(g_game,1000,0x88,&g_vectorZero,&g_vectorZero,(Entity *)0x0,0,seed); Isaac::SwapANM2(&local_140,&pEVar2->_sprite); *(int *)&(pEVar2->_varData)._l = local_160._type; *(int *)((int)&(pEVar2->_varData)._l + 4) = local_160._variant; *(int *)&(pEVar2->_varData)._h = local_160._state; *(int *)((int)&(pEVar2->_varData)._h + 4) = local_160._spawnCount; *(int *)&pEVar2->field_0x430 = local_160._spawnSeed; *(int *)&pEVar2->field_0x434 = local_160._varData; pEVar2->field_0x438 = local_160._initialized; *(undefined3 *)&pEVar2->field_0x439 = local_160._25_3_; *(int *)&pEVar2->field_0x43c = local_160._variableSeed; pEVar2->_state = this->_backdropType; } local_14 = 1; ANM2::Reset(&local_140); AnimationState::~AnimationState(&local_140._overlayAnimState); AnimationState::~AnimationState(&local_140._animState); std::string::_Tidy_deallocate(local_140._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_140); ExceptionList = local_1c; return pEVar2; } //@@ 00825de0 Room::render_darkness_overlay /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called at end of Room light pass FUN_0080ea80; KAGE_ColorShader, Seeds::GetForcedCurses/GetPreventedCurses (Curse of Darkness), render_color_shader_pass, Game::IsPaused prototype: db/protos.zhl */ void __thiscall Room::render_darkness_overlay(Room *this) { uint uVar1; code *pcVar2; char cVar3; byte bVar4; undefined4 *renderTargetEntry; int iVar5; uint uVar6; undefined *shader; void *pvVar7; uint preventedCurses; byte rngShift2; byte rngShift3; KColor *color; int unusedArg; int unused; int iVar8; uint uVar9; bool bVar10; float fVar11; float fVar12; undefined1 auVar13 [12]; float fVar14; double dVar15; undefined1 auStackY_230 [128]; void *imageRefCount; undefined1 lightQuad [112]; undefined1 screenQuad [32]; undefined4 local_108; undefined4 uStack_104; undefined4 uStack_100; float fStack_fc; undefined4 local_f8; undefined4 local_f4; undefined4 uStack_f0; undefined4 uStack_ec; float fStack_e8; undefined4 local_e4; undefined4 local_e0; undefined4 uStack_dc; undefined4 uStack_d8; float fStack_d4; undefined4 local_d0; undefined4 local_cc; undefined4 uStack_c8; undefined4 uStack_c4; float fStack_c0; undefined4 local_bc; KColor quadColor; Vector local_a4; Vector local_9c; float local_94; float fStack_90; float fStack_8c; float fStack_88; float local_84; float fStack_80; float fStack_7c; float fStack_78; float local_74; Vector local_70; KColor local_68; float local_54; float local_50; Room *local_4c; float local_48; undefined4 *local_44; ColorMod local_40; float local_14; Game *game; Room *room; local_14 = (float)(__security_cookie ^ (uint)((&local_40)[1]._tint + 1)); local_4c = this; cVar3 = FUN_008242f0(); if (cVar3 != '\0') { KColor::SetFromARGB(&quadColor,0xff000000); render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color); local_70.x = 0.0; local_70.y = 0.0; std::vector::resize(&local_70); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c7982c,1); RenderTarget::Clear(&DAT_00c798e0); render_color_shader_pass(screenQuad); game = g_game; g_graphicsManager_blendMode[1] = 1; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; bVar4 = Game::IsPaused(g_game); if (bVar4 == 0) { uVar6 = g_manager->_framecount + 1U & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } local_54 = (float)(int)uVar6 * 0.5; } else { local_54 = 0.0; } if (*(char *)local_4c == '\0') { iVar5 = -1; } else { iVar5 = game->_frameCount - local_4c->_enterFrame; } uVar6 = *(uint *)((int)local_4c->_descriptor + 0x58); local_50 = 8.40779e-45; local_54 = (float)iVar5 + local_54; local_68._blue = 1.4013e-45; local_68._alpha = 1.54143e-44; local_9c.x = (float)((double)*(int *)((int)DAT_00c79824 + 0x10) + __uint_to_double_fixup[-(*(int *)((int)DAT_00c79824 + 0x10) >> 0x1f)]); local_9c.y = (float)((double)*(int *)((int)DAT_00c79824 + 0x14) + __uint_to_double_fixup[-(*(int *)((int)DAT_00c79824 + 0x14) >> 0x1f)]); local_a4.x = -((local_4c->_renderScrollOffset).x + (g_game->_screenShakeOffset).x); local_a4.y = -((local_4c->_renderScrollOffset).y + (g_game->_screenShakeOffset).y); quad_set_rect(local_40._tint + 2,&local_a4,&local_9c,(int)DAT_00c79824); local_48 = 4.2039e-45; fVar12 = 8.40779e-45; do { fVar14 = local_50; local_74 = local_40._offset[2]; local_44 = (undefined4 *)DAT_00c7983c[5]; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } bVar4 = local_68._blue._0_1_; uVar6 = uVar6 >> (bVar4 & 0x1f) ^ uVar6; rngShift2 = local_68._alpha._0_1_; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> (SUB41(fVar12,0) & 0x1f) ^ uVar6; if (local_44 == (undefined4 *)0x0) { uVar9 = 0; } else { uVar9 = uVar6 % (uint)local_44; } if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> (bVar4 & 0x1f) ^ uVar6; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; rngShift3 = SUB41(local_50,0); uVar6 = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10; local_44 = (undefined4 *) (((fVar12 + fVar12) - 1.0) * local_54 + (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)])); if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> (bVar4 & 0x1f) ^ uVar6; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; uVar9 = 0; if (DAT_00c7983c[4] != 0) { uVar9 = uVar6 % (uint)DAT_00c7983c[4]; } if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> (bVar4 & 0x1f) ^ uVar6; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; fStack_7c = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 * 3.0 + 1.0) * local_54 + (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]); local_94 = fStack_7c + local_40._tint[2]; fStack_90 = (float)local_44 + local_40._tint[3]; fStack_8c = fStack_7c + local_40._colorize[0]; fStack_88 = (float)local_44 + local_40._colorize[1]; local_84 = fStack_7c + local_40._colorize[2]; fStack_7c = fStack_7c + local_40._offset[0]; fStack_80 = (float)local_44 + local_40._colorize[3]; fStack_78 = (float)local_44 + local_40._offset[1]; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> (bVar4 & 0x1f) ^ uVar6; quadColor._red = 1.0; uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6; quadColor._green = 1.0; quadColor._blue = 1.0; uVar6 = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; local_bc = 0; local_d0 = 0; local_e4 = 0; local_f8 = 0; fStack_fc = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 * 4.0 + 2.0; local_cc = 0x3f800000; uStack_c8 = 0x3f800000; uStack_c4 = 0x3f800000; local_e0 = 0x3f800000; uStack_dc = 0x3f800000; uStack_d8 = 0x3f800000; local_f4 = 0x3f800000; uStack_f0 = 0x3f800000; uStack_ec = 0x3f800000; local_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_100 = 0x3f800000; fStack_e8 = fStack_fc; fStack_d4 = fStack_fc; fStack_c0 = fStack_fc; quadColor._alpha = fStack_fc; (**(code **)(*DAT_00c7983c + 0x14))(&local_94); local_48 = (float)((int)local_48 + -1); fVar12 = fVar14; } while (local_48 != 0.0); _glfw_context_reset(); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } local_70.x = 0.0; local_70.y = 0.0; std::vector::resize(&local_70); local_44 = std::deque::back(); if ((byte *)(local_44 + 1) != (byte *)0x0) { *(byte *)(local_44 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *local_44 = g_graphicsManager_renderTarget; pvVar7 = DAT_00c79824; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c79824,1); imageRefCount = (void *)0x8263df; RenderTarget::Clear(&DAT_00c798e0); uVar9 = g_graphicsManager_flags & 0xfffffffd; if ((g_manager->_optionsConfig)._enableLighting != 0) { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } g_graphicsManager_blendMode[1] = 1; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; local_40._tint[0] = 1.0; local_40._tint[1] = 1.0; local_40._tint[2] = 1.0; local_40._tint[3] = 1.0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_40._colorize[0] = 0.5; local_40._colorize[1] = 0.5; local_40._colorize[2] = 0.5; local_40._colorize[3] = (float)&DAT_bf800000; local_40._offset[0] = -0.8; local_40._offset[1] = -0.8; local_40._offset[2] = -0.8; g_currentShader = shader; g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; KAGE::SmartPointer::operator_assign(auStackY_230 + 0x88,&DAT_00c797cc); apply_sprite_shader_params(&local_40,1,pvVar7,imageRefCount); local_cc = 0x3f800000; uStack_c8 = 0x3f800000; uStack_c4 = 0x3f800000; fStack_c0 = 1.0; local_bc = 0; local_e0 = 0x3f800000; uStack_dc = 0x3f800000; uStack_d8 = 0x3f800000; fStack_d4 = 1.0; local_d0 = 0; local_f4 = 0x3f800000; uStack_f0 = 0x3f800000; uStack_ec = 0x3f800000; fStack_e8 = 1.0; local_e4 = 0; local_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_100 = 0x3f800000; fStack_fc = 1.0; local_f8 = 0; (**(code **)(*DAT_00c797cc + 0x1c))(); shader_cache_find(unusedArg); uVar9 = g_graphicsManager_flags; } g_graphicsManager_flags = uVar9; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 1; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 1; local_cc = 0x3d4ccccd; uStack_c8 = 0x3d4ccccd; uStack_c4 = 0x3d4ccccd; fStack_c0 = 1.0; local_bc = 0; local_e0 = 0x3d4ccccd; uStack_dc = 0x3d4ccccd; uStack_d8 = 0x3d4ccccd; fStack_d4 = 1.0; local_d0 = 0; local_f4 = 0x3d4ccccd; uStack_f0 = 0x3d4ccccd; uStack_ec = 0x3d4ccccd; fStack_e8 = 1.0; local_e4 = 0; local_108 = 0x3d4ccccd; uStack_104 = 0x3d4ccccd; uStack_100 = 0x3d4ccccd; fStack_fc = 1.0; local_f8 = 0; shader_push((byte *)"KAGE_ColorShader"); local_84 = 0.0; local_94 = 0.0; fStack_88 = 0.0; fStack_90 = 0.0; fStack_7c = 1.0; fStack_8c = 1.0; fStack_78 = 1.0; fStack_80 = 1.0; local_74 = (float)((uint)local_74 & 0xffffff00); pvVar7 = kage_graphics_flush((void *)0x0); render_quad_draw(pvVar7,&local_94,screenQuad,1,unused); FUN_00a14200(); if ((((g_manager->_optionsConfig)._enableLighting != 0) && ((*(uint *)((int)local_4c->_descriptor + 0x44) >> 9 & 1) == 0)) && (DAT_00c79834 != (int *)0x0)) { 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] = 1; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 1; local_a4.y = (float)((double)DAT_00c79834[4] + __uint_to_double_fixup[-(DAT_00c79834[4] >> 0x1f)]); local_9c.y = (float)((double)DAT_00c79834[5] + __uint_to_double_fixup[-(DAT_00c79834[5] >> 0x1f)]); if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar6 = uVar6 >> (local_68._blue._0_1_ & 0x1f) ^ uVar6; uVar6 = uVar6 << (local_68._alpha._0_1_ & 0x1f) ^ uVar6; uVar6 = uVar6 >> (rngShift3 & 0x1f) ^ uVar6; uVar9 = g_game->_debugCurses; uVar1 = g_game->_curses; fVar12 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10 * 9.0 + 0.1; uVar6 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); room = local_4c; if ((~preventedCurses & (uVar6 | uVar9 | uVar1) & 1) == 0) { fVar14 = g_game->_darknessStrength * g_game->_darknessModifier; } else { fVar14 = 1.0; } local_68._unk = 0; local_68._red = 1.0; local_68._green = 0.9 - fVar14 * 0.19999999; auVar13 = ZEXT812(0x3d4ccccd); fVar11 = fVar12 * auVar13._0_4_; if (fVar11 <= auVar13._0_4_) { auVar13._4_8_ = auVar13._4_8_; auVar13._0_4_ = fVar11; } local_68._alpha = (auVar13._0_4_ - fVar12) * fVar14 + fVar12; local_68._blue = 0.8 - fVar14 * 0.15000004; if ((local_4c->_descriptor == (void *)0x0) || (iVar5 = *(int *)((int)local_4c->_descriptor + 0x10), iVar5 == 0)) { local_4c = (Room *)0x1; } else { local_4c = *(Room **)(iVar5 + 0x48); } uVar6 = 0; do { iVar5 = (&DAT_00b6c9b0)[uVar6 * 2]; if (((-1 < iVar5) && (iVar8 = (&DAT_00b6c9b4)[uVar6 * 2], -1 < iVar8)) && ((local_48 = (float)room->_gridWidth, iVar5 < (int)local_48 && (iVar8 < room->_gridHeight)))) { if (uVar6 == 0) { bVar10 = local_4c == (Room *)&DAT_00000009; LAB_0082681a: if (bVar10) goto LAB_008269ef; } else if (uVar6 == 1) { bVar10 = local_4c == (Room *)0xa; goto LAB_0082681a; } iVar5 = iVar8 * (int)local_48 + iVar5; iVar8 = iVar5 % (int)local_48; local_54 = (float)(iVar5 / (int)local_48) * 40.0 + 120.0; local_48 = g_displayPixelRatio * g_screenPointScale; local_44 = (undefined4 *) (((g_screenWidth - 338.0) * 0.5 + (((float)iVar8 * 40.0 + 40.0) - 60.0) * 0.65) * local_48 + 0.5); dVar15 = floor((double)(float)local_44); local_50 = (float)dVar15 / local_48; local_44 = (undefined4 *) (((g_screenHeight - 182.0) * 0.5 + (local_54 - 140.0) * 0.65) * local_48 + 0.5) ; dVar15 = floor((double)(float)local_44); local_44 = (undefined4 *)(float)dVar15; local_70.y = (float)local_44 / local_48 + (room->_renderScrollOffset).y + (g_game->_screenShakeOffset).y; local_70.x = local_50 + (room->_renderScrollOffset).x + (g_game->_screenShakeOffset).x; render_quad_set_uniform_color (lightQuad,local_70.x - local_a4.y * 0.5,local_70.y - local_9c.y * 0.6, local_a4.y * 0.5 + local_70.x,local_9c.y * 0.4 + local_70.y,&local_68); Quad::rotate(lightQuad,&local_70,-0.7853982); (**(code **)(*DAT_00c79834 + 0x1c))(); } LAB_008269ef: uVar6 = uVar6 + 1; } while (uVar6 < 2); } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 4; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 4; g_graphicsManager_blendMode[4] = 7; local_cc = 0x3f800000; uStack_c8 = 0x3f800000; uStack_c4 = 0x3f800000; fStack_c0 = 1.0; local_bc = 0; local_e0 = 0x3f800000; uStack_dc = 0x3f800000; uStack_d8 = 0x3f800000; fStack_d4 = 1.0; local_d0 = 0; local_f4 = 0x3f800000; uStack_f0 = 0x3f800000; uStack_ec = 0x3f800000; fStack_e8 = 1.0; local_e4 = 0; local_108 = 0x3f800000; uStack_104 = 0x3f800000; uStack_100 = 0x3f800000; fStack_fc = 1.0; local_f8 = 0; (**(code **)(*DAT_00c7982c + 0x1c))(); g_graphicsManager_flags = g_graphicsManager_flags | 2; _glfw_context_reset(); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } } return; } //@@ 00826ae0 Room::render_lava_pit_mask /* DB: ? ECX=Room: when _backdropType (0x1d18)==0x20 renders every pit grid (type 7, grid +0x24, width +0xc/height +0x10) into a render target with custom blend, uses _lavaIntensity (0x7740); called from Room::render_lighting when a dirty flag is set */ void __thiscall Room::render_lava_pit_mask(Room *this) { char cVar1; undefined4 *targetStackEntry; undefined *shader; int iVar2; undefined4 extraout_EAX; int gridIndex; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int row; int column; undefined1 auStackY_19c [128]; int *piVar3; undefined1 quad [112]; int savedBlendMode0; int savedBlendMode1; int savedBlendMode2; int savedBlendMode3; KColor white; int savedBlendMode4; void *gridEntity; float local_58; float local_54; float local_50; float local_4c; float local_48; float local_44; float local_40; float local_3c; undefined1 local_38; float local_34; float local_30; float local_2c; float local_28; undefined4 local_24; Vector targetSize; undefined4 local_18; float targetHeight; float targetWidth; int local_c; Room *room; code *shaderDrawFn; if ((this->_backdropType == 0x20) && ((*(uint *)((int)this->_descriptor + 0x44) >> 5 & 1) != 0)) { targetSize.x = 0.0; targetSize.y = 0.0; room = this; std::vector::resize(&targetSize); targetStackEntry = std::deque::back(); if ((byte *)(targetStackEntry + 1) != (byte *)0x0) { *(byte *)(targetStackEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *targetStackEntry = g_graphicsManager_renderTarget; savedBlendMode0 = g_graphicsManager_blendMode[0]; savedBlendMode1 = g_graphicsManager_blendMode[1]; savedBlendMode2 = g_graphicsManager_blendMode[2]; savedBlendMode3 = g_graphicsManager_blendMode[3]; savedBlendMode4 = g_graphicsManager_blendMode[4]; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c7981c,0); g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; RenderTarget::Clear(&DAT_00c798e0); 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; DAT_00c33910 = 0; targetWidth = (float)((double)*(int *)((int)DAT_00c7981c + 0x10) + __uint_to_double_fixup[-(*(int *)((int)DAT_00c7981c + 0x10) >> 0x1f)]); shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_c = 0; targetHeight = (float)((double)*(int *)((int)DAT_00c7981c + 0x14) + __uint_to_double_fixup[-(*(int *)((int)DAT_00c7981c + 0x14) >> 0x1f)]); targetSize.y = targetHeight; targetSize.x = targetWidth; g_currentShader = shader; if (0 < this->_gridHeight) { do { iVar2 = this->_gridWidth; column = 0; row = local_c; if (0 < iVar2) { do { if ((((-1 < column) && (column < iVar2)) && (-1 < row)) && ((row < this->_gridHeight && (gridIndex = iVar2 * row + column, -1 < gridIndex)))) { gridEntity = this->_gridEntities[gridIndex]; if ((gridEntity == (void *)0x0) || (*(int *)((int)gridEntity + 4) != 7)) { this = room; } else { piVar3 = (int *)0x0; local_18 = DAT_00c79804; if (DAT_00c79808 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79808 + 4))(); iVar2 = extraout_ECX; if ((cVar1 != '\0') && (iVar2 = 0, piVar3 != (int *)0x0)) { cVar1 = (**(code **)(*piVar3 + 0xc))(); iVar2 = extraout_ECX_00; if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStackY_19c + 0x90); iVar2 = extraout_ECX_01; } } } FUN_007135d0(iVar2); iVar2 = room->_gridWidth; row = local_c; this = room; } } column = column + 1; } while (column < iVar2); } local_c = row + 1; } while (local_c < this->_gridHeight); } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 6; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 0; g_graphicsManager_blendMode[4] = 1; local_30 = this->_lavaIntensity; DAT_00c33910 = 1; shaderDrawFn = *(code **)(*DAT_00c7980c + 0x14); local_24 = 0; local_34 = local_30 * 0.5 + 0.5; local_28 = 1.0; white._unk = 0; white._red = 1.0; white._green = 1.0; white._blue = 1.0; white._alpha = 1.0; local_2c = local_30; render_quad_set_rect(quad,&g_vectorZero,&targetSize,&white); local_50 = targetWidth + g_vectorZero.x; local_48 = g_vectorZero.x; local_58 = g_vectorZero.x; local_44 = targetHeight + g_vectorZero.y; local_4c = g_vectorZero.y; local_54 = g_vectorZero.y; local_38 = 1; local_40 = local_50; local_3c = local_44; (*shaderDrawFn)(&local_58); if (0.0 < this->_waterAmount) { local_24 = 0; local_34 = 1.0; local_28 = 1.0 - this->_lavaIntensity * this->_lavaIntensity; local_30 = 1.0; shaderDrawFn = *(code **)(*DAT_00c79814 + 0x14); local_2c = 1.0; white._unk = 0; white._red = 1.0; white._green = 1.0; white._blue = 1.0; white._alpha = 1.0; render_quad_set_rect(quad,&g_vectorZero,&targetSize,&white); local_50 = targetWidth + g_vectorZero.x; local_48 = g_vectorZero.x; local_58 = g_vectorZero.x; local_44 = targetHeight + g_vectorZero.y; local_4c = g_vectorZero.y; local_54 = g_vectorZero.y; local_38 = 1; local_40 = local_50; local_3c = local_44; (*shaderDrawFn)(&local_58,extraout_EAX,&local_34); } _glfw_context_reset(1); g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = savedBlendMode2; g_graphicsManager_blendMode[3] = savedBlendMode3; g_graphicsManager_blendMode[4] = savedBlendMode4; g_graphicsManager_flags = g_graphicsManager_flags | 2; if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } targetStackEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*targetStackEntry,*(byte *)(targetStackEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } shader_cache_find(0); } return; } //@@ 00826f80 Room::render_water_overlay /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? draws the room render target DAT_00c7981c as a quad over the room rect (+0x6ae0..+0x6aec) offset by 52 px with the current shader; Room::Render and Room::render_water call it only when _backdropType == 0x20 (Mines) and the room descriptor flag bit 5 (0x20, has water) is set */ void Room::render_water_overlay(float *param_1) { code *pcVar1; undefined *puVar2; int in_ECX; KColor *color; int unusedArg; float fVar3; undefined1 auStackY_178 [128]; void *in_stack_ffffff10; void *in_stack_ffffff14; Vector local_e0; Vector local_d8; KColor local_d0; KColor local_bc; undefined1 local_a8 [112]; ColorMod local_38; uint local_c; local_c = __security_cookie ^ (uint)&local_e0; local_e0.x = *(float *)(in_ECX + 0x6ae8) - *(float *)(in_ECX + 0x6ae0); local_e0.y = *(float *)(in_ECX + 0x6aec) - *(float *)(in_ECX + 0x6ae4); puVar2 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar2 = g_currentShader; } g_graphicsManager_blendMode[1] = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; g_currentShader = puVar2; KAGE::SmartPointer::operator_assign(auStackY_178 + 0x88,&DAT_00c7981c); apply_sprite_shader_params(&local_38,1,in_stack_ffffff10,in_stack_ffffff14); pcVar1 = *(code **)(*DAT_00c7981c + 0x14); KColor::SetFromARGB(&local_bc,0xffffffff); KColor::SetFromARGB(&local_d0,0xffffffff); fVar3 = 52.0; local_d8.x = *param_1 + 52.0; local_d8.y = param_1[1] + 52.0; render_quad_set_rect(local_a8,&local_d8,&local_e0,color); local_38._tint[2] = local_e0.x + fVar3; local_38._colorize[1] = local_e0.y + fVar3; local_38._colorize[0] = 52.0; local_38._tint[3] = 52.0; local_38._tint[0] = 52.0; local_38._tint[1] = 52.0; local_38._offset[0] = (float)CONCAT31(local_38._offset[0]._1_3_,1); local_38._colorize[2] = local_38._tint[2]; local_38._colorize[3] = local_38._colorize[1]; (*pcVar1)(&local_38); shader_cache_find(unusedArg); return; } //@@ 00827180 FUN_00827180 uint FUN_00827180(float *param_1) { int iVar1; uint uVar2; int in_ECX; int *piVar3; float fVar4; float fVar5; uVar2 = 0; piVar3 = (int *)(in_ECX + 0x7744); while ((iVar1 = *piVar3, iVar1 == 0 || (fVar4 = param_1[1] - *(float *)(iVar1 + 0x340), fVar5 = *param_1 - *(float *)(iVar1 + 0x33c), 14400.0 <= fVar4 * fVar4 + fVar5 * fVar5))) { uVar2 = uVar2 + 1; piVar3 = piVar3 + 1; if (7 < uVar2) { return 0xffffffff; } } return uVar2; } //@@ 008271e0 Room::UpdateRedKey /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Room::UpdateRedKey(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Room::UpdateRedKey(Room *this) { byte isCanSpawnOutline; uint uVar1; int *piVar2; Entity_Player *redKeyOwner; uint uVar3; Room *pRVar4; uint pocketSlot; EntityPtr outlineSlot; EntityPtr *doorOutlineSlot; Game *game; int iVar5; float fVar6; EntityPtr local_34; Room *room; EntityPtr *local_2c; float angleRad; Vector spawnPos; float doorAngles [4]; uint local_c; bool isHasRedKey; void *playerListEnd; int pocketCardId; local_c = __security_cookie ^ (uint)&local_34; local_34 = (EntityPtr)0x0; isHasRedKey = false; game = g_game; room = this; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { LAB_0082731a: pRVar4 = room; redKeyOwner = PlayerManager::FirstCollectibleOwner (&game->_playerManager,0x244,(RNG **)&game->_playerManager,1); if ((redKeyOwner == (Entity_Player *)0x0) && (!isHasRedKey)) { outlineSlot = (EntityPtr)pRVar4->_redDoorOutlines; iVar5 = 8; do { if ((*(int **)outlineSlot != (int *)0x0) && ((**(code **)(**(int **)outlineSlot + 0x28))(), *(int *)outlineSlot != 0)) { local_34 = outlineSlot; std::multiset::erase(&local_34); *(int *)outlineSlot = 0; } outlineSlot = (EntityPtr)((int)outlineSlot + 4); iVar5 = iVar5 + -1; } while (iVar5 != 0); return; } doorAngles[0] = -90.0; doorAngles[1] = 0.0; doorAngles[2] = 90.0; doorAngles[3] = 180.0; piVar2 = room->_descriptor; if (((*(int *)(piVar2[4] + 8) != 5) || (piVar2[2] != g_game->_lastBossRoomListIdx)) && (-1 < *piVar2)) { uVar1 = 0; doorOutlineSlot = room->_redDoorOutlines; uVar3 = 1; pRVar4 = room; do { if (*doorOutlineSlot == (EntityPtr)0x0) { if ((((*(uint *)(*(int *)((int)pRVar4->_descriptor + 0x10) + 0x38 + (uVar1 >> 5) * 4) & uVar3) != 0) && (doorOutlineSlot[-0x1c08] == (EntityPtr)0x0)) && (isCanSpawnOutline = Level::CanSpawnDoorOutline ((Level *)g_game,*(int *)((int)pRVar4->_descriptor + 4),uVar1), isCanSpawnOutline != 0)) { local_34 = (EntityPtr)Random(); spawnPos.x = (float)((int)doorOutlineSlot[-0x1c00] % room->_gridWidth) * 40.0 + 40.0; spawnPos.y = (float)((int)doorOutlineSlot[-0x1c00] / room->_gridWidth) * 40.0 + 120.0; local_34 = (EntityPtr) Game::SpawnEx(g_game,1000,0x9a,&spawnPos,&g_vectorZero,(Entity *)0x0,0, (uint)local_34,0); fVar6 = doorAngles[uVar1 & 3]; *(float *)((int)local_34 + 0xec) = fVar6; angleRad = (fVar6 + 90.0) * 0.017453292; fVar6 = cos(angleRad); local_2c = (EntityPtr *)(fVar6 * 15.0); fVar6 = sin(angleRad); ((Vector *)((int)local_34 + 0xdc))->x = (float)local_2c; *(float *)((int)local_34 + 0xe0) = fVar6 * 15.0; if (*doorOutlineSlot != local_34) { if (*doorOutlineSlot != (EntityPtr)0x0) { local_2c = doorOutlineSlot; std::multiset::erase(&local_2c); } *doorOutlineSlot = local_34; std::multiset::insert(doorOutlineSlot); } } pRVar4 = room; } uVar1 = uVar1 + 1; uVar3 = uVar3 << 1 | (uint)((int)uVar3 < 0); doorOutlineSlot = doorOutlineSlot + 1; } while (uVar1 < 8); } return; } LAB_00827222: playerListEnd = (game->_playerManager)._playerList._end; piVar2 = (game->_playerManager)._playerList._begin; if ((int)playerListEnd - (int)piVar2 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (game->_playerManager)._playerList._end; piVar2 = (game->_playerManager)._playerList._begin; game = g_game; } if ((uint)local_34 < (uint)((int)playerListEnd - (int)piVar2 >> 2)) { piVar2 = piVar2 + (int)local_34; } iVar5 = *piVar2; uVar3 = 0; do { if (isHasRedKey) break; uVar1 = uVar3; if ((int)uVar3 < 1) { uVar1 = 0; } pocketSlot = 3; if ((int)uVar1 < 3) { pocketSlot = uVar1; } if ((*(int *)(iVar5 + 0x17a4 + pocketSlot * 8) == 1) && ((pocketCardId = *(int *)(iVar5 + 0x17a0 + pocketSlot * 8), pocketCardId == 0x4e || (pocketCardId == 0x53)))) { isHasRedKey = true; break; } uVar3 = uVar3 + 1; } while (uVar3 < 4); uVar3 = 0; piVar2 = (int *)(iVar5 + 0x1580); do { if (*piVar2 == 0x1dd) { if (-1 < (int)uVar3) { uVar3 = 0; piVar2 = *(int **)(iVar5 + 0x1754); uVar1 = *(int *)(iVar5 + 0x1758) - (int)piVar2 >> 2; if (uVar1 != 0) goto LAB_008272e2; } break; } uVar3 = uVar3 + 1; piVar2 = piVar2 + 8; } while (uVar3 < 4); goto LAB_008272f6; while( true ) { uVar3 = uVar3 + 1; piVar2 = piVar2 + 1; if (uVar1 <= uVar3) break; LAB_008272e2: if (*piVar2 == 0x244) { isHasRedKey = true; break; } } LAB_008272f6: local_34 = (EntityPtr)((int)local_34 + 1); if ((uint)((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2) <= (uint)local_34) goto LAB_0082731a; goto LAB_00827222; } //@@ 00827550 Room::open_red_room_doors /* DB: ? ECX = Room: for each slot allowed by the descriptor (+0x18) without a door, Room::MakeDoor, sets target index / GridEntity_Door::SetRoomTypes / LoadSprite / UpdateAnimation; then removes _redDoorOutlines[param_1] and plays sound 0x9c; Level::MakeRedRoomDoor when the new room is the current one */ void Room::open_red_room_doors(int param_1,int param_2) { EntityPtr this; Manager *pMVar1; char extraout_AL; int iVar2; Room *in_ECX; EntityPtr *pEVar3; uint slot; EntityPtr *local_c [2]; local_c[0] = (EntityPtr *)in_ECX->_doors; slot = 0; do { pEVar3 = local_c[0]; if (((*(uint *)((int)in_ECX->_descriptor + (slot >> 5) * 4 + 0x18) & 1 << ((byte)slot & 0x1f)) != 0) && (*local_c[0] == (EntityPtr)0x0)) { MakeDoor(in_ECX,slot); if (extraout_AL != '\0') { this = *pEVar3; if (param_2 == 0) { *(int *)((int)this + 0x394) = -2; iVar2 = 1; } else { *(int *)((int)this + 0x394) = *(int *)(param_2 + 4); iVar2 = *(int *)(*(int *)(param_2 + 0x10) + 8); } GridEntity_Door::SetRoomTypes ((GridEntity_Door *)this,*(int *)(*(int *)((int)in_ECX->_descriptor + 0x10) + 8), iVar2); iVar2 = *(int *)((int)this + 8); *(uint *)((int)this + 0x158) = slot; if (((iVar2 == 1) || (iVar2 == 2)) || (iVar2 == 3)) { *(int *)((int)this + 8) = 8; ANM2::Reset((ANM2 *)((int)this + 0x27c)); GridEntity_Door::LoadSprite((GridEntity_Door *)this); iVar2 = *(int *)((int)this + 8); } if (iVar2 == 7) { *(int *)((int)this + 8) = 8; } GridEntity_Door::UpdateAnimation((GridEntity_Door *)this); pEVar3 = local_c[0]; } } slot = slot + 1; local_c[0] = pEVar3 + 1; } while (slot < 8); pEVar3 = in_ECX->_redDoorOutlines + param_1; if ((*pEVar3 != (EntityPtr)0x0) && ((**(code **)(*(int *)*pEVar3 + 0x28))(), *pEVar3 != (EntityPtr)0x0)) { local_c[0] = pEVar3; std::multiset::erase(local_c); *pEVar3 = (EntityPtr)0x0; } pMVar1 = g_manager; local_c[0] = (EntityPtr *)0x9c; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_c[0],1.0,2,0,1.0,0.0); return; } //@@ 008276e0 Room::spawn_options_alternative /* DB: (Entity_Pickup*): Room::SpawnClearAward calls it when a player has COLLECTIBLE_OPTIONS (0x29e): spawns a second pickup (RoomClear_PickVariant, Morph, CanSpawnObstacleAtPosition) linked with AssignOptionsIndex */ Entity_Pickup * Room::spawn_options_alternative(Entity_Pickup *param_1) { uint *puVar1; float fVar2; code *pcVar3; qword qVar4; byte bVar5; Entity_Pickup *pEVar6; int iVar7; uint uVar8; int iVar9; uint variant; uint uVar10; RNG local_34; undefined1 local_20 [8]; float local_18; float local_14; float local_10; Room *local_c; float local_8; variant = 0; local_34._seed = param_1->_initSeed; uVar10 = 0; local_34._shift1 = 3; local_34._shift2 = 5; local_34._shift3 = 0x19; do { if ((variant != 0) && (variant != param_1->_variant)) goto LAB_00827735; variant = RoomClear_PickVariant(&local_34,1); uVar10 = uVar10 + 1; } while (uVar10 < 10); if (variant == 0) { return (Entity_Pickup *)0x0; } LAB_00827735: fVar2 = (param_1->_pos).x; local_8 = (param_1->_pos).y; if (local_34._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); pEVar6 = (Entity_Pickup *)(*pcVar3)(); return pEVar6; } uVar10 = (uint)local_34._seed >> ((byte)local_34._shift1 & 0x1f) ^ local_34._seed; local_20 = (undefined1 [8])0x100000003; uVar10 = uVar10 << ((byte)local_34._shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)local_34._shift3 & 0x1f) ^ uVar10; local_14 = 1.96182e-44; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); pEVar6 = (Entity_Pickup *)(*pcVar3)(); return pEVar6; } uVar8 = uVar10 >> 3 ^ uVar10; uVar8 = uVar8 << 1 ^ uVar8; uVar8 = uVar8 >> 0xe ^ uVar8; local_14 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10 * 3.14; local_14 = local_14 + local_14; local_10 = cos(local_14); local_10 = local_10 * 15.0; local_14 = sin(local_14); local_14 = local_14 * 15.0; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); pEVar6 = (Entity_Pickup *)(*pcVar3)(); return pEVar6; } uVar10 = uVar10 >> ((byte)local_34._shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)local_34._shift2 & 0x1f) ^ uVar10; local_20._4_4_ = fVar2 + local_10; local_18 = local_8 + local_14; pEVar6 = (Entity_Pickup *) Game::Spawn(g_game,5,variant,(Vector *)(local_20 + 4),&g_vectorZero,(Entity *)0x0,0, uVar10 >> ((byte)local_34._shift3 & 0x1f) ^ uVar10); if ((pEVar6->_type == 5) && (((iVar9 = pEVar6->_variant, iVar9 == 0x34 || (iVar9 == 0x36)) || (iVar9 == 0x39)))) { iVar9 = (int)((fVar2 - 40.0) / 40.0 + 0.5); iVar7 = (int)((local_8 - 120.0) / 40.0 + 0.5); if ((((iVar9 < 0) || (local_c->_gridWidth <= iVar9)) || (iVar7 < 0)) || (local_c->_gridHeight <= iVar7)) { iVar9 = -1; } else { iVar9 = local_c->_gridWidth * iVar7 + iVar9; } bVar5 = CanSpawnObstacleAtPosition(local_c,iVar9,0); if (bVar5 == 0) { Entity_Pickup::Morph(pEVar6,5,0x32,1,0,0,0); } } if ((param_1->_flags & 0x10000000000) != 0) { qVar4 = pEVar6->_flags; puVar1 = (uint *)((int)&pEVar6->_flags + 4); *puVar1 = *puVar1 | 0x100; *(int *)&pEVar6->_flags = (int)qVar4; } iVar9 = Entity_Pickup::AssignOptionsIndex(param_1); pEVar6->_optionsPickupIndex = iVar9; (param_1->_pos).x = fVar2 - local_10; (param_1->_pos).y = local_8 - local_14; return param_1; } //@@ 008279a0 Room::IsBeastDungeon /* DB: returns RoomConfig stage 0x23 && type 0x10 (only the Home type-16 rooms: Beast room 666 and its test rooms); was IsGravityDungeon (beast.md) prototype: db/protos.zhl */ byte __thiscall Room::IsBeastDungeon(Room *this) { int *piVar1; piVar1 = *(int **)((int)this->_descriptor + 0x10); if (((piVar1 == (int *)0x0) || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) { return 0; } return 1; } //@@ 008279c0 Room::get_lava_line_y /* DB: body: returns Room+0x20 (BottomRight.y) - 30 (0xbaa8d0); the Lava Spawner case of Entity_Effect::Update (0x5e1f3a) spawns its eruption at that y (beast_war_death.md) */ void Room::get_lava_line_y(void) { return; } //@@ 008279d0 Room::TrySpawnSpecialQuestDoor /* ZHL [exact] __thiscall bool Room::TrySpawnSpecialQuestDoor(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Room::TrySpawnSpecialQuestDoor(Room *this) { int iVar1; uint uVar2; bool bVar3; bool bVar4; uint uVar5; uint uVar6; uint uVar7; iVar1 = g_game->_stage; if ((g_game->_stageType != 4) && (g_game->_stageType != 5)) { return 0; } if (iVar1 == 2) { LAB_00827a28: bVar4 = true; } else { if (iVar1 == 1) { uVar7 = g_game->_debugCurses; uVar2 = g_game->_curses; uVar5 = Seeds::GetForcedCurses(); uVar6 = Seeds::GetPreventedCurses(); if ((~uVar6 & (uVar5 | uVar7 | uVar2) & 2) != 0) goto LAB_00827a28; } bVar4 = false; } if (iVar1 == 4) { LAB_00827a59: bVar3 = true; } else { if (iVar1 == 3) { uVar7 = g_game->_debugCurses; uVar2 = g_game->_curses; uVar5 = Seeds::GetForcedCurses(); uVar6 = Seeds::GetPreventedCurses(); if ((~uVar6 & (uVar5 | uVar7 | uVar2) & 2) != 0) goto LAB_00827a59; } bVar3 = false; } if (bVar4) { iVar1 = *(int *)((int)this->_descriptor + 0x10); if ((*(int *)(iVar1 + 8) == 1) && (*(int *)(iVar1 + 0x10) == 0x22)) { uVar7 = 0; do { if ((*(uint *)(iVar1 + 0x3c + (uVar7 >> 5) * 4) & 1 << ((byte)uVar7 & 0x1f)) != 0) { if (uVar7 == 0xffffffff) { return 0; } if (this->_doors[uVar7] != (void *)0x0) { return 0; } MakeDoor(this,uVar7); *(undefined4 *)((int)this->_doors[uVar7] + 0x394) = 0xffffff9c; goto LAB_00827ace; } uVar7 = uVar7 + 1; } while ((int)uVar7 < 8); } } else if (((bVar3) && (iVar1 = *(int *)((int)this->_descriptor + 0x10), *(int *)(iVar1 + 8) == 1)) && ((*(int *)(iVar1 + 0x10) == 10 || (*(int *)(iVar1 + 0x10) == 0xb)))) { uVar7 = 0; while ((*(uint *)(iVar1 + 0x3c + (uVar7 >> 5) * 4) & 1 << ((byte)uVar7 & 0x1f)) == 0) { uVar7 = uVar7 + 1; if (7 < (int)uVar7) { return 0; } } if ((uVar7 != 0xffffffff) && (this->_doors[uVar7] == (void *)0x0)) { MakeDoor(this,uVar7); *(undefined4 *)((int)this->_doors[uVar7] + 0x394) = 0xffffff9b; LAB_00827ace: iVar1 = *(int *)(*(int *)((int)this->_descriptor + 0x10) + 8); GridEntity_Door::SetRoomTypes(this->_doors[uVar7],iVar1,iVar1); return 1; } } return 0; } //@@ 00827b70 Room::IsMirrorWorld /* ZHL [lua] Lua binding Room:IsMirrorWorld prototype: db/protos.zhl */ byte __thiscall Room::IsMirrorWorld(Room *this) { uint uVar1; if ((g_game->_currentDimensionIdx == 1) && ((g_game->_stageType == 4 || (g_game->_stageType == 5)))) { if (g_game->_stage == 2) { return 1; } if ((g_game->_stage == 1) && (uVar1 = Level::GetCurses((Level *)g_game), (uVar1 & 2) != 0)) { return 1; } } return 0; } //@@ 00827bb0 Room::HasCurseMist /* ZHL [exact] __thiscall bool Room::HasCurseMist(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Room::HasCurseMist(Room *this) { return (byte)(*(uint *)((int)this->_descriptor + 0x44) >> 0xd) & 1; } //@@ 00827bc0 Room::is_pre_ascent_mom_room /* DB: room type 5, room config subtype 0x59 and Level::IsPreAscent; callers Room::render_lighting, Backdrop::pre_render_walls, the AddCollectible body 0x762646 (Dad's Note); notes/systems/ascent.md */ uint Room::is_pre_ascent_mom_room(void) { byte bVar1; uint in_EAX; undefined3 extraout_var; int in_ECX; if ((*(int *)(in_ECX + 8) == 5) && (in_EAX = *(uint *)(*(int *)(in_ECX + 4) + 0x10), *(int *)(in_EAX + 0x10) == 0x59)) { bVar1 = Level::IsPreAscent((Level *)g_game); in_EAX = CONCAT31(extraout_var,bVar1); if (bVar1 != 0) { return CONCAT31(extraout_var,1); } } return in_EAX & 0xffffff00; } //@@ 00827bf0 Room::spawn_sanguine_bond_spikes /* DB: ECX=Room (grid width +0xc, height +0x10, grid entity array +0x24, 0x1c0 cells): only in room type 0xe (ROOM_DEVIL) when PlayerManager::FirstCollectibleOwner(692 COLLECTIBLE_SANGUINE_BOND); clears the cell at width*4+7, GridEntity::GridEntity/Init spikes there ("SpawnGridEntity: Grid index invalid"), unsummons other GridEntity_Spikes; callers Entity_Player::AddCollectible and Room::Init */ undefined4 __thiscall Room::spawn_sanguine_bond_spikes(Room *this,char param_2) { int iVar1; GridEntity_Spikes *this_00; code *pcVar2; uint uVar3; Entity_Player *bondOwner; int rowStart; undefined4 uVar4; GridEntity *newSpikes; Entity *poof; int cellIdx; int iVar5; undefined4 *existingGrid; void **gridSlot; int gridY; uint spikeIdx; Vector local_28; int rowsLeft; int dx; uint spikeGridIdx; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *neighborGrid; local_8 = 0xffffffff; puStack_c = &LAB_00b01a07; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((this->_roomType != 0xe) || (bondOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b4,(RNG **)&g_game->_playerManager,1), bondOwner == (Entity_Player *)0x0)) { ExceptionList = local_10; return 0; } iVar1 = this->_gridWidth; if ((iVar1 < 8) || (this->_gridHeight < 5)) { spikeIdx = 0xffffffff; spikeGridIdx = 0xffffffff; } else { spikeIdx = iVar1 * 4 + 7; spikeGridIdx = spikeIdx; if ((spikeIdx < 0x1c0) && (existingGrid = this->_gridEntities[iVar1 * 4 + 7], existingGrid != (undefined4 *)0x0)) { local_28.y = (float)(existingGrid + 1); if (*(int *)local_28.y == 8) { if (existingGrid[2] == 100) { ExceptionList = local_10; return 0; } } else if (*(int *)local_28.y == 7) { dx = -1; do { gridY = 3; iVar1 = dx + 7; rowsLeft = 3; iVar5 = dx; do { if ((((-1 < iVar1) && (iVar1 < this->_gridWidth)) && (-1 < gridY)) && (gridY < this->_gridHeight)) { rowStart = this->_gridWidth * gridY; cellIdx = iVar5 + 7 + rowStart; if (((-1 < cellIdx) && (cellIdx < 0x1c0)) && ((neighborGrid = this->_gridEntities[rowStart + iVar5 + 7], neighborGrid != (int *)0x0 && (neighborGrid[1] == 7)))) { (**(code **)(*neighborGrid + 4))(uVar3); } iVar5 = dx; } spikeIdx = spikeGridIdx; gridY = gridY + 1; rowsLeft = rowsLeft + -1; } while (rowsLeft != 0); dx = iVar5 + 1; } while (dx < 2); existingGrid = (undefined4 *)0x0; if (this->_gridEntities[spikeGridIdx] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[spikeGridIdx])(1); existingGrid = (undefined4 *)0x0; this->_gridEntities[spikeIdx] = (void *)0x0; } } if (((*(int *)local_28.y == 8) || (*(int *)local_28.y == 9)) && ((existingGrid != (undefined4 *)0x0 && (existingGrid[1] != 1)))) { this->_gridPaths[spikeIdx] = 900; this->_gridEntities[spikeIdx] = (void *)0x0; (**(code **)*existingGrid)(1); } } } if (param_2 == '\0') { uVar3 = 0; if (0 < this->_gridWidth * this->_gridHeight) { gridSlot = this->_gridEntities; do { if ((((uVar3 != spikeGridIdx) && (uVar3 < 0x1c0)) && (this_00 = *gridSlot, this_00 != (GridEntity_Spikes *)0x0)) && ((iVar1 = (this_00->_desc)._type, iVar1 == 8 || (iVar1 == 9)))) { GridEntity_Spikes::unsummon(this_00,0); } uVar3 = uVar3 + 1; gridSlot = gridSlot + 1; } while ((int)uVar3 < this->_gridWidth * this->_gridHeight); } spikeIdx = spikeGridIdx; } uVar3 = *(uint *)((int)this->_descriptor + 0x58); local_28.y = 1.68156e-44; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar3 = uVar3 >> 0xb ^ uVar3; uVar3 = uVar3 << 7 ^ uVar3; if (((int)spikeIdx < 0) || (0x1bf < (int)spikeIdx)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if ((spikeIdx < 0x1c0) && (this->_gridPaths[spikeIdx] < 0x385)) { newSpikes = operator_new(0x158); local_8 = 0xd; local_28.y = (float)newSpikes; if (newSpikes == (GridEntity *)0x0) { newSpikes = (GridEntity *)0x0; } else { GridEntity::GridEntity(newSpikes); *(undefined ***)newSpikes = IsaacRepentancePlus::GridEntity_Spikes::vftable; } local_8 = 0xffffffff; if (newSpikes != (GridEntity *)0x0) { (newSpikes->_desc)._type = 8; newSpikes->_gridIndex = spikeGridIdx; if (this->_gridEntities[spikeGridIdx] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_gridEntities[spikeGridIdx])(1); } this->_gridEntities[spikeGridIdx] = newSpikes; (newSpikes->_desc)._variant = 100; (newSpikes->_desc)._varData = 0; GridEntity::Init(newSpikes,uVar3 >> 0xc ^ uVar3); } spikeIdx = spikeGridIdx; } if (param_2 == '\0') { uVar3 = Random(); local_28.x = (float)((int)spikeIdx % this->_gridWidth) * 40.0 + 40.0; local_28.y = (float)((int)spikeIdx / this->_gridWidth) * 40.0 + 120.0; poof = Game::Spawn(g_game,1000,0xf,&local_28,&g_vectorZero,(Entity *)0x0,0,uVar3); (**(code **)(*(int *)poof + 0xc))(); } ExceptionList = local_10; return 1; } //@@ 00827f30 FUN_00827f30 void FUN_00827f30(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0x20); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x20); return; } //@@ 00827f70 EntitySaveState::set_extra_data /* DB: ? (value): allocates a 0x18-byte ReferenceCount holding value at +0x14, releases the previous one (ECX+4) and stores {value, ptr} in ECX; callers Entity_Pickup::CanFlip (cycle collectible save path, after operator_new(0x20)) and read_entity_save_state_tree */ void EntitySaveState::set_extra_data(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(); } } in_ECX[1] = this; *in_ECX = param_1; ExceptionList = local_10; return; } //@@ 00828010 FUN_00828010 void FUN_00828010(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; if (in_ECX != param_1) { FUN_00828ab0(); uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 7; *(undefined2 *)param_1 = 0; } return; } //@@ 00828050 FUN_00828050 void FUN_00828050(short *param_1) { short sVar1; void *_Dst; undefined4 *in_ECX; uint uVar2; short *psVar3; uint uVar4; uint local_8; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 7; psVar3 = param_1; do { sVar1 = *psVar3; psVar3 = psVar3 + 1; } while (sVar1 != 0); uVar4 = (int)psVar3 - (int)(param_1 + 1) >> 1; if (uVar4 < 8) { in_ECX[4] = uVar4; memmove(in_ECX,param_1,uVar4 * 2); *(undefined2 *)(uVar4 * 2 + (int)in_ECX) = 0; return; } if (0x7ffffffe < uVar4) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } local_8 = uVar4 | 7; if (local_8 < 0x7fffffff) { if (local_8 < 10) { local_8 = 10; } uVar2 = local_8 + 1; if (0x7fffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } else { local_8 = 0x7ffffffe; uVar2 = 0x7fffffff; } _Dst = std::_Allocate(uVar2 * 2); in_ECX[4] = uVar4; in_ECX[5] = local_8; memcpy(_Dst,param_1,uVar4 * 2); *(undefined2 *)(uVar4 * 2 + (int)_Dst) = 0; *in_ECX = _Dst; return; } //@@ 00828120 FUN_00828120 undefined4 FUN_00828120(void) { short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); if ((void *)in_ECX[5] != (void *)0x0) { operator_delete((void *)in_ECX[5],0x20); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x0082816d. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 00828180 std::_Tree::_Extract /* DB: red-black tree node unlink: finds successor (operator++), splices it into the erased node's place, fixes head min/max/root, then recolour/rotate (FUN_00415f80/00415fe0); returns erased node prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std::_Tree::_Extract(void *this,void *node) { char cVar1; void *pvVar2; int *piVar3; int *piVar4; int *piVar5; void *pvVar6; int *piVar7; undefined8 uVar8; pvVar2 = node; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&node); piVar5 = *(int **)pvVar2; piVar7 = *(int **)((int)pvVar2 + 8); pvVar6 = pvVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { if (*(char *)((int)*(int **)((int)pvVar2 + 8) + 0xd) == '\0') { piVar7 = *(int **)((int)node + 8); if (node != pvVar2) { piVar5[1] = (int)node; *(undefined4 *)node = *(undefined4 *)pvVar2; if (node == *(void **)((int)pvVar2 + 8)) { piVar5 = node; } else { piVar5 = *(int **)((int)node + 4); if (*(char *)((int)piVar7 + 0xd) == '\0') { piVar7[1] = (int)piVar5; } *piVar5 = (int)piVar7; *(undefined4 *)((int)node + 8) = *(undefined4 *)((int)pvVar2 + 8); *(void **)(*(int *)((int)pvVar2 + 8) + 4) = node; } if (*(void **)(*(int *)this + 4) == pvVar2) { *(void **)(*(int *)this + 4) = node; } else { piVar4 = *(int **)((int)pvVar2 + 4); if ((void *)*piVar4 == pvVar2) { *piVar4 = (int)node; } else { piVar4[2] = (int)node; } } *(undefined4 *)((int)node + 4) = *(undefined4 *)((int)pvVar2 + 4); cVar1 = *(char *)((int)node + 0xc); *(undefined1 *)((int)node + 0xc) = *(undefined1 *)((int)pvVar2 + 0xc); *(char *)((int)pvVar2 + 0xc) = cVar1; goto LAB_0082828c; } } else { piVar7 = piVar5; } } piVar5 = *(int **)((int)pvVar2 + 4); if (*(char *)((int)piVar7 + 0xd) == '\0') { piVar7[1] = (int)piVar5; } if (*(void **)(*(int *)this + 4) == pvVar2) { *(int **)(*(int *)this + 4) = piVar7; } else if ((void *)*piVar5 == pvVar2) { *piVar5 = (int)piVar7; } else { piVar5[2] = (int)piVar7; } if ((void *)**(int **)this == pvVar2) { if (*(char *)((int)piVar7 + 0xd) == '\0') { piVar4 = piVar7; piVar3 = (int *)*piVar7; if (*(char *)(*piVar7 + 0xd) == '\0') { do { piVar4 = piVar3; piVar3 = (int *)*piVar4; } while (*(char *)(*piVar4 + 0xd) == '\0'); } } else { piVar4 = piVar5; } **(undefined4 **)this = piVar4; } if (*(void **)(*(int *)this + 8) == pvVar2) { if (*(char *)((int)piVar7 + 0xd) != '\0') { *(int **)(*(int *)this + 8) = piVar5; cVar1 = *(char *)((int)pvVar2 + 0xc); goto LAB_0082828c; } uVar8 = FUN_00709400(); pvVar6 = (void *)((ulonglong)uVar8 >> 0x20); *(int *)(*(int *)this + 8) = (int)uVar8; } cVar1 = *(char *)((int)pvVar6 + 0xc); LAB_0082828c: if (cVar1 == '\x01') { if (piVar7 != *(int **)(*(int *)this + 4)) { do { piVar4 = piVar5; if ((char)piVar7[3] != '\x01') break; piVar5 = (int *)*piVar4; if (piVar7 == piVar5) { piVar5 = (int *)piVar4[2]; if ((char)piVar5[3] == '\0') { *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar4 + 3) = 0; FUN_00415fe0(piVar4); piVar5 = (int *)piVar4[2]; } if (*(char *)((int)piVar5 + 0xd) == '\0') { if ((*(char *)(*piVar5 + 0xc) == '\x01') && (*(char *)(piVar5[2] + 0xc) == '\x01')) goto LAB_00828359; if (*(char *)(piVar5[2] + 0xc) == '\x01') { *(undefined1 *)(*piVar5 + 0xc) = 1; *(undefined1 *)(piVar5 + 3) = 0; FUN_00415f80(piVar5); piVar5 = (int *)piVar4[2]; } *(char *)(piVar5 + 3) = (char)piVar4[3]; *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar5[2] + 0xc) = 1; FUN_00415fe0(piVar4); break; } } else { if ((char)piVar5[3] == '\0') { *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar4 + 3) = 0; FUN_00415f80(piVar4); piVar5 = (int *)*piVar4; } if (*(char *)((int)piVar5 + 0xd) == '\0') { if ((*(char *)(piVar5[2] + 0xc) != '\x01') || (*(char *)(*piVar5 + 0xc) != '\x01')) { if (*(char *)(*piVar5 + 0xc) == '\x01') { *(undefined1 *)(piVar5[2] + 0xc) = 1; *(undefined1 *)(piVar5 + 3) = 0; FUN_00415fe0(piVar5); piVar5 = (int *)*piVar4; } *(char *)(piVar5 + 3) = (char)piVar4[3]; *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(*piVar5 + 0xc) = 1; FUN_00415f80(piVar4); break; } LAB_00828359: *(undefined1 *)(piVar5 + 3) = 0; } } piVar5 = (int *)piVar4[1]; piVar7 = piVar4; } while (piVar4 != *(int **)(*(int *)this + 4)); pvVar6 = pvVar2; } *(undefined1 *)(piVar7 + 3) = 1; } if (*(int *)((int)this + 4) != 0) { *(int *)((int)this + 4) = *(int *)((int)this + 4) + -1; } return pvVar6; } //@@ 008283d0 FUN_008283d0 void FUN_008283d0(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; int *piVar4; undefined4 uVar5; undefined4 local_1c; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = 0; local_18 = (int *)0x0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; piVar4 = (int *)0x0; uVar5 = 0; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar3 == '\0') { piVar4 = local_18; uVar5 = local_1c; } else { if (local_18 != (int *)0x0) { cVar3 = (**(code **)(*local_18 + 0xc))(); if ((cVar3 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&local_1c); } } piVar4 = piVar1; uVar5 = uVar2; } } local_18 = (int *)in_ECX[1]; local_1c = *in_ECX; in_ECX[1] = piVar4; *in_ECX = uVar5; local_8 = 0; if (local_18 != (int *)0x0) { cVar3 = (**(code **)(*local_18 + 0xc))(); if ((cVar3 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&local_1c); } } ExceptionList = local_10; return; } //@@ 008284a0 FUN_008284a0 void FUN_008284a0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_00828690(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 008284d0 FUN_008284d0 void FUN_008284d0(undefined4 param_1,undefined4 *param_2,undefined4 *param_3) { uint uVar1; uint uVar2; uint uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; void *pvVar7; undefined4 *in_ECX; uint uVar8; undefined4 *puVar9; puVar9 = param_3; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar2 = param_2[4]; uVar3 = param_3[4]; uVar1 = uVar3 + uVar2; if ((uVar3 <= param_2[5] - uVar2) && ((uint)param_3[5] <= (uint)param_2[5])) { uVar4 = param_2[1]; uVar5 = param_2[2]; uVar6 = param_2[3]; *in_ECX = *param_2; in_ECX[1] = uVar4; in_ECX[2] = uVar5; in_ECX[3] = uVar6; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_2 + 4); param_2[4] = 0; param_2[5] = 7; *(undefined2 *)param_2 = 0; puVar9 = in_ECX; if (7 < (uint)in_ECX[5]) { puVar9 = (undefined4 *)*in_ECX; } if (7 < (uint)param_3[5]) { param_3 = (undefined4 *)*param_3; } memcpy((void *)((int)puVar9 + uVar2 * 2),param_3,uVar3 * 2 + 2); in_ECX[4] = uVar1; return; } if (uVar2 <= param_3[5] - uVar3) { uVar4 = param_3[1]; uVar5 = param_3[2]; uVar6 = param_3[3]; *in_ECX = *param_3; in_ECX[1] = uVar4; in_ECX[2] = uVar5; in_ECX[3] = uVar6; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_3 + 4); *(undefined2 *)param_3 = 0; param_3[4] = 0; param_3[5] = 7; pvVar7 = (void *)*in_ECX; memmove((void *)(uVar2 * 2 + (int)pvVar7),pvVar7,uVar3 * 2 + 2); if (7 < (uint)param_2[5]) { param_2 = (undefined4 *)*param_2; } memcpy(pvVar7,param_2,uVar2 * 2); in_ECX[4] = uVar1; return; } if (0x7ffffffe - uVar2 < uVar3) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } param_3 = (undefined4 *)(uVar1 | 7); if (param_3 < 0x7fffffff) { if (param_3 < 10) { param_3 = (undefined4 *)0xa; } uVar8 = (int)param_3 + 1; if (0x7fffffff < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } else { param_3 = (undefined4 *)0x7ffffffe; uVar8 = 0x7fffffff; } pvVar7 = std::_Allocate(uVar8 * 2); *in_ECX = pvVar7; in_ECX[4] = uVar1; in_ECX[5] = param_3; if (7 < (uint)param_2[5]) { param_2 = (undefined4 *)*param_2; } memcpy(pvVar7,param_2,uVar2 * 2); if (7 < (uint)puVar9[5]) { puVar9 = (undefined4 *)*puVar9; } memcpy((void *)(uVar2 * 2 + (int)pvVar7),puVar9,uVar3 * 2 + 2); return; } //@@ 00828690 FUN_00828690 void FUN_00828690(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1a2d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)_Find_lower_bound<>(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(uint *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x14); local_28 = (int *)uVar1; piVar8[4] = *param_2; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_008287da: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_008287da; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00828860 FUN_00828860 void FUN_00828860(undefined4 *param_1,undefined4 param_2) { undefined4 local_10 [3]; FUN_00828890(local_10,param_2); *param_1 = local_10[0]; return; } //@@ 00828890 FUN_00828890 void FUN_00828890(undefined4 *param_1,float *param_2) { float fVar1; char cVar2; int iVar3; int *piVar4; bool bVar5; uint uVar6; int *piVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b01a45; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar3 = *in_ECX; local_8 = 0; piVar7 = operator_new(0x28); fVar1 = *param_2; piVar7[4] = (int)fVar1; piVar7[5] = (int)param_2[1]; piVar7[6] = (int)param_2[2]; piVar7[7] = (int)param_2[3]; piVar7[8] = (int)param_2[4]; piVar7[9] = (int)param_2[5]; *piVar7 = iVar3; piVar7[1] = iVar3; piVar7[2] = iVar3; *(undefined2 *)(piVar7 + 3) = 0; local_8 = 1; bVar5 = false; piVar4 = (int *)*in_ECX; piVar9 = (int *)piVar4[1]; if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar8 = piVar9; do { piVar9 = piVar8; bVar5 = fVar1 < (float)piVar9[4]; if (bVar5) { piVar8 = (int *)*piVar9; } else { piVar8 = (int *)piVar9[2]; } } while (*(char *)((int)piVar8 + 0xd) == '\0'); } if (in_ECX[1] == 0x6666666) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } in_ECX[1] = in_ECX[1] + 1; piVar7[1] = (int)piVar9; if (piVar9 == piVar4) { *piVar4 = (int)piVar7; piVar4[1] = (int)piVar7; piVar4[2] = (int)piVar7; *(undefined1 *)(piVar7 + 3) = 1; } else { if (bVar5) { *piVar9 = (int)piVar7; if (piVar9 == (int *)*piVar4) { *piVar4 = (int)piVar7; } } else { piVar9[2] = (int)piVar7; if (piVar9 == (int *)piVar4[2]) { piVar4[2] = (int)piVar7; } } cVar2 = *(char *)(piVar7[1] + 0xc); piVar9 = piVar7; while (cVar2 == '\0') { piVar8 = (int *)piVar9[1]; piVar10 = *(int **)piVar8[1]; if (piVar8 == piVar10) { piVar10 = (int *)((undefined4 *)piVar8[1])[2]; if ((char)piVar10[3] == '\0') goto LAB_008289f0; if (piVar9 == (int *)piVar8[2]) { FUN_00415fe0(piVar8); piVar9 = piVar8; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar9[1] + 4)); } else if ((char)piVar10[3] == '\0') { LAB_008289f0: *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(piVar10 + 3) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; piVar9 = *(int **)(piVar9[1] + 4); } else { if (piVar9 == (int *)*piVar8) { FUN_00415f80(piVar8); piVar9 = piVar8; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar9[1] + 4)); } cVar2 = *(char *)(piVar9[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00828a70 FUN_00828a70 void FUN_00828a70(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 2; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 00828ab0 FUN_00828ab0 void FUN_00828ab0(void) { int iVar1; void *pvVar2; void *ptr; int *in_ECX; uint size; if (7 < (uint)in_ECX[5]) { pvVar2 = (void *)*in_ECX; iVar1 = in_ECX[5] * 2; size = iVar1 + 2; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = iVar1 + 0x25; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } in_ECX[4] = 0; in_ECX[5] = 7; *(undefined2 *)in_ECX = 0; return; } //@@ 00828b10 FUN_00828b10 void FUN_00828b10(void) { int iVar1; void *pvVar2; void *ptr; uint size; int *in_ECX; if (7 < (uint)in_ECX[5]) { pvVar2 = (void *)*in_ECX; iVar1 = in_ECX[5] * 2; size = iVar1 + 2; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = iVar1 + 0x25; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } in_ECX[4] = 0; in_ECX[5] = 7; *(undefined2 *)in_ECX = 0; return; } //@@ 00828b60 RoomConfigMode::ctor /* DB: src/rooms decompile labels (RoomConfigMode::ctor) */ void RoomConfigMode::ctor(void) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af192d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0xf; *(undefined1 *)in_ECX = 0; local_8 = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[8] = pvVar1; *(undefined1 *)(in_ECX + 10) = 0; ExceptionList = local_10; return; } //@@ 00828c00 RoomConfigMode::Clear /* DB: src/rooms decompile labels (RoomConfigMode::Clear) */ void RoomConfigMode::Clear(void) { undefined4 *roomMap; qword qVar1; int in_ECX; void *pvVar2; qword *allocCounter; int spawnOffset; int spawnEntry; int *mapNode; int room; int *piVar3; int roomOffset; uint roomIdx; uint spawnIdx; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uint *blockHeader; uint blockSize; undefined4 *entryList; char isNil; void *nextNode; int *parentNode; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01a70; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(in_ECX + 0x1c) != 0) { KAGE_LogMessage(1,(byte *)"delete %d rooms.\n"); roomIdx = 0; if (*(int *)(in_ECX + 0x1c) != 0) { roomOffset = 0; pvVar2 = g_mainHeap; do { room = *(int *)(in_ECX + 0x18) + roomOffset; if (*(short *)(room + 0x44) != 0) { spawnIdx = 0; spawnOffset = 0; do { spawnEntry = *(int *)(room + 0x40) + spawnOffset; if (*(char *)(spawnEntry + 8) != '\0') { allocCounter = (qword *)((int)pvVar2 + 0x30); if (pvVar2 == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (*(int *)(spawnEntry + 4) != 0) { blockHeader = (uint *)(*(int *)(spawnEntry + 4) + -4); blockSize = *blockHeader; qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - blockSize; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < blockSize); free(blockHeader); pvVar2 = g_mainHeap; } } *(undefined4 *)(spawnEntry + 4) = 0; spawnOffset = spawnOffset + 0x10; *(undefined1 *)(spawnEntry + 8) = 0; spawnIdx = spawnIdx + 1; } while (spawnIdx < *(ushort *)(room + 0x44)); allocCounter = (qword *)((int)pvVar2 + 0x30); if (pvVar2 == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } if (*(int *)(room + 0x40) != 0) { blockHeader = (uint *)(*(int *)(room + 0x40) + -4); blockSize = *blockHeader; qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - blockSize; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < blockSize); free(blockHeader); pvVar2 = g_mainHeap; } uStack_8 = 0xffffffff; } *(undefined4 *)(room + 0x40) = 0; roomIdx = roomIdx + 1; *(undefined2 *)(room + 0x44) = 0; roomOffset = roomOffset + 0x5c; } while (roomIdx < *(uint *)(in_ECX + 0x1c)); } pvVar2 = *(void **)(in_ECX + 0x18); if (pvVar2 != (void *)0x0) { blockHeader = (uint *)((int)pvVar2 + -4); uStack_8 = 2; _eh_vector_destructor_iterator_(pvVar2,0x5c,*blockHeader,RoomConfigRoom::dtor); operator_delete(blockHeader,*blockHeader * 0x5c + 4); } } piVar3 = *(int **)(in_ECX + 0x20); roomMap = (undefined4 *)(in_ECX + 0x20); mapNode = (int *)*piVar3; if (mapNode != piVar3) { do { entryList = (undefined4 *)mapNode[5]; if (entryList != (undefined4 *)0x0) { pvVar2 = (void *)*entryList; while (pvVar2 != (void *)0x0) { nextNode = *(void **)((int)pvVar2 + 8); operator_delete(pvVar2,0xc); pvVar2 = nextNode; } *entryList = 0; operator_delete(entryList,4); mapNode[5] = 0; } piVar3 = (int *)mapNode[2]; if (*(char *)((int)piVar3 + 0xd) == '\0') { isNil = *(char *)(*piVar3 + 0xd); mapNode = piVar3; piVar3 = (int *)*piVar3; while (isNil == '\0') { isNil = *(char *)(*piVar3 + 0xd); mapNode = piVar3; piVar3 = (int *)*piVar3; } } else { isNil = *(char *)(mapNode[1] + 0xd); parentNode = (int *)mapNode[1]; piVar3 = mapNode; while ((mapNode = parentNode, isNil == '\0' && (piVar3 == (int *)mapNode[2]))) { isNil = *(char *)(mapNode[1] + 0xd); parentNode = (int *)mapNode[1]; piVar3 = mapNode; } } piVar3 = (int *)*roomMap; } while (mapNode != piVar3); } FID_conflict__Erase_tree_>_> (roomMap,(fuzzer_allocator_> *)roomMap, (_Tree_node *)piVar3[1]); piVar3[1] = (int)piVar3; *piVar3 = (int)piVar3; piVar3[2] = (int)piVar3; *(undefined4 *)(in_ECX + 0x24) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined1 *)(in_ECX + 0x28) = 0; ExceptionList = local_10; return; } //@@ 00828e50 RoomSet::GetVariantSet /* ZHL [exact] __thiscall RoomConfig_VariantSet* RoomSet::GetVariantSet(uint32_t type); prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall RoomSet::GetVariantSet(RoomSet *this,uint type) { qword qVar1; uint uVar2; undefined4 *puVar3; qword *pqVar4; uint local_1c; undefined4 *local_18; undefined1 local_14 [8]; RoomSet local_c; _Find_lower_bound<>(local_14,&type); uVar2 = type; if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) <= type)) && (local_c != this[8])) { return *(void **)((int)local_c + 0x14); } if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(8); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 8; *puVar3 = 8; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xfffffff7 < (uint)qVar1); puVar3 = puVar3 + 1; if (puVar3 != (undefined4 *)0x0) { *puVar3 = 0; goto LAB_00828ec0; } } puVar3 = (undefined4 *)0x0; LAB_00828ec0: local_1c = uVar2; local_18 = puVar3; std::map::insert(local_14,&local_1c); return puVar3; } //@@ 00828f00 RoomConfigStage::ctor /* DB: src/rooms decompile labels (RoomConfigStage::ctor) */ void RoomConfigStage::ctor(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b01ac1; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x18) = 0xf; *(undefined1 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x2c) = 0; *(undefined4 *)(in_ECX + 0x30) = 0xf; *(undefined1 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0xf; *(undefined1 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x5c) = 0; *(undefined4 *)(in_ECX + 0x60) = 0xf; *(undefined1 *)(in_ECX + 0x4c) = 0; local_8 = 3; _eh_vector_constructor_iterator_ ((void *)(in_ECX + 100),0x2c,2,RoomConfigMode::ctor,RoomConfigMode::dtor); *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined4 *)(in_ECX + 0xc0) = 0; ExceptionList = local_10; return; } //@@ 00828fe0 RoomConfig_Stage::unload /* ZHL [exact] __thiscall void RoomConfig_Stage::unload(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall RoomConfig_Stage::unload(RoomConfig_Stage *this) { char cVar1; qword qVar2; RoomConfig_Stage RVar3; void *nextNode; qword *allocatedBytes; int spawnOffset; int spawnEntry; RoomConfig_Stage treeNode; int room; RoomConfig_Stage RVar5; int roomSetsLeft; int roomOffset; RoomConfig_Stage roomIndex; uint spawnIndex; RoomConfig_Stage *roomSet; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uint *allocHeader; uint blockSize; undefined4 *entryList; void *nextNode; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01a70; local_10 = ExceptionList; ExceptionList = &local_10; roomSet = this + 0x21; roomSetsLeft = 2; do { if (roomSet[-1] != (RoomConfig_Stage)0x0) { KAGE_LogMessage(1,(byte *)"delete %d rooms.\n"); roomIndex = (RoomConfig_Stage)0x0; if (roomSet[-1] != (RoomConfig_Stage)0x0) { roomOffset = 0; nextNode = g_mainHeap; do { room = (int)roomSet[-2] + roomOffset; if (*(short *)(room + 0x44) != 0) { spawnIndex = 0; spawnOffset = 0; do { spawnEntry = *(int *)(room + 0x40) + spawnOffset; if (*(char *)(spawnEntry + 8) != '\0') { allocatedBytes = (qword *)((int)nextNode + 0x30); if (nextNode == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (*(int *)(spawnEntry + 4) != 0) { allocHeader = (uint *)(*(int *)(spawnEntry + 4) + -4); blockSize = *allocHeader; qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - blockSize; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < blockSize); free(allocHeader); nextNode = g_mainHeap; } } *(undefined4 *)(spawnEntry + 4) = 0; spawnOffset = spawnOffset + 0x10; *(undefined1 *)(spawnEntry + 8) = 0; spawnIndex = spawnIndex + 1; } while (spawnIndex < *(ushort *)(room + 0x44)); allocatedBytes = (qword *)((int)nextNode + 0x30); if (nextNode == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } if (*(int *)(room + 0x40) != 0) { allocHeader = (uint *)(*(int *)(room + 0x40) + -4); blockSize = *allocHeader; qVar2 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - blockSize; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar2 < blockSize); free(allocHeader); nextNode = g_mainHeap; } uStack_8 = 0xffffffff; } *(undefined4 *)(room + 0x40) = 0; roomIndex = (RoomConfig_Stage)((int)roomIndex + 1); *(undefined2 *)(room + 0x44) = 0; roomOffset = roomOffset + 0x5c; } while ((uint)roomIndex < (uint)roomSet[-1]); } RVar5 = roomSet[-2]; if (RVar5 != (RoomConfig_Stage)0x0) { allocHeader = (uint *)((int)RVar5 + -4); uStack_8 = 2; _eh_vector_destructor_iterator_((void *)RVar5,0x5c,*allocHeader,RoomConfigRoom::dtor); operator_delete(allocHeader,*allocHeader * 0x5c + 4); uStack_8 = 0xffffffff; } } RVar5 = *roomSet; treeNode = *(RoomConfig_Stage *)RVar5; if (treeNode != RVar5) { do { entryList = *(undefined4 **)((int)treeNode + 0x14); if (entryList != (undefined4 *)0x0) { nextNode = (void *)*entryList; while (nextNode != (void *)0x0) { nextNode = *(void **)((int)nextNode + 8); operator_delete(nextNode,0xc); nextNode = nextNode; } *entryList = 0; operator_delete(entryList,4); *(int *)((int)treeNode + 0x14) = 0; } RVar5 = *(RoomConfig_Stage *)((int)treeNode + 8); if (*(char *)((int)RVar5 + 0xd) == '\0') { cVar1 = *(char *)((int)*(RoomConfig_Stage *)RVar5 + 0xd); treeNode = RVar5; RVar5 = *(RoomConfig_Stage *)RVar5; while (cVar1 == '\0') { cVar1 = *(char *)((int)*(RoomConfig_Stage *)RVar5 + 0xd); treeNode = RVar5; RVar5 = *(RoomConfig_Stage *)RVar5; } } else { cVar1 = *(char *)((int)*(RoomConfig_Stage *)((int)treeNode + 4) + 0xd); RVar3 = *(RoomConfig_Stage *)((int)treeNode + 4); RVar5 = treeNode; while ((treeNode = RVar3, cVar1 == '\0' && (RVar5 == *(RoomConfig_Stage *)((int)treeNode + 8)))) { cVar1 = *(char *)((int)*(RoomConfig_Stage *)((int)treeNode + 4) + 0xd); RVar3 = *(RoomConfig_Stage *)((int)treeNode + 4); RVar5 = treeNode; } } RVar5 = *roomSet; } while (treeNode != RVar5); } FID_conflict__Erase_tree_>_> (roomSet,(fuzzer_allocator_> *)roomSet, *(_Tree_node **)((int)RVar5 + 4)); *(RoomConfig_Stage *)((int)RVar5 + 4) = RVar5; *(RoomConfig_Stage *)RVar5 = RVar5; *(RoomConfig_Stage *)((int)RVar5 + 8) = RVar5; roomSet[1] = (RoomConfig_Stage)0x0; roomSet[-1] = (RoomConfig_Stage)0x0; roomSet[-2] = (RoomConfig_Stage)0x0; *(undefined1 *)(roomSet + 2) = 0; roomSet = roomSet + 0xb; roomSetsLeft = roomSetsLeft + -1; } while (roomSetsLeft != 0); ExceptionList = local_10; return; } //@@ 00829260 RoomConfigMode::dtor /* DB: src/rooms decompile labels (RoomConfigMode::dtor?) */ void RoomConfigMode::dtor(void) { char *this; char *in_ECX; this = in_ECX + 0x20; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 0x20) + 4)); operator_delete(*(void **)this,0x18); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 00829290 VariantRanges::Insert /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/rooms decompile labels (VariantRanges::Insert(variant)->bool newlyInserted) */ undefined4 VariantRanges::Insert(uint param_1) { qword qVar1; uint *puVar2; undefined4 *puVar3; uint uVar4; undefined4 *in_ECX; uint *puVar5; qword *pqVar6; uint *ptr; if ((uint *)*in_ECX == (uint *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x10); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x10; puVar5 = puVar3 + 1; *puVar3 = 0x10; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffef < (uint)qVar1); if (puVar5 != (uint *)0x0) { *puVar5 = param_1; puVar3[2] = param_1; puVar3[3] = 0; *in_ECX = puVar5; return 1; } } *in_ECX = 0; return 1; } puVar5 = (uint *)0x0; puVar2 = (uint *)*in_ECX; do { ptr = puVar2; if (param_1 < *ptr) { uVar4 = *ptr - 1; if (param_1 == uVar4) { if ((puVar5 == (uint *)0x0) || (param_1 != puVar5[1] + 1)) { *ptr = uVar4; return 1; } puVar5[1] = ptr[1]; puVar5[2] = ptr[2]; operator_delete(ptr,0xc); return 1; } if (puVar5 == (uint *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x10); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x10; *puVar3 = 0x10; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffef < (uint)qVar1) ; puVar5 = puVar3 + 1; if (puVar5 != (uint *)0x0) { *puVar5 = param_1; puVar3[2] = param_1; *in_ECX = puVar5; puVar3[3] = ptr; return 1; } } *in_ECX = 0; _DAT_00000008 = ptr; return 1; } uVar4 = puVar5[1] + 1; if (param_1 != uVar4) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x10); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { *puVar3 = 0x10; qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x10; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffef < (uint)qVar1) ; puVar2 = puVar3 + 1; if (puVar2 != (uint *)0x0) { *puVar2 = param_1; puVar3[2] = param_1; puVar5[2] = (uint)puVar2; puVar3[3] = ptr; return 1; } } puVar5[2] = 0; _DAT_00000008 = ptr; return 1; } goto LAB_00829343; } if (param_1 <= ptr[1]) { return 0; } puVar5 = ptr; puVar2 = (uint *)ptr[2]; } while ((uint *)ptr[2] != (uint *)0x0); uVar4 = ptr[1] + 1; if (param_1 != uVar4) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x10); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x10; *puVar3 = 0x10; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffef < (uint)qVar1); puVar5 = puVar3 + 1; if (puVar5 != (uint *)0x0) { *puVar5 = param_1; puVar3[2] = param_1; puVar3[3] = 0; ptr[2] = (uint)puVar5; return 1; } } ptr[2] = 0; return 1; } LAB_00829343: puVar5[1] = uVar4; return 1; } //@@ 00829500 RoomConfigStage::GetDisplayName /* DB: src/rooms decompile labels (RoomConfigStage::GetDisplayName) prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall RoomConfigStage::GetDisplayName(RoomConfig_Stage *this,std_string *outName,int language) { StringTable *this_00; char cVar1; RoomConfig_Stage RVar2; byte *text; int language_00; if (this[5] == (RoomConfig_Stage)0x0) { text = &s_empty; } else { text = (byte *)(this + 1); if (0xf < (uint)this[6]) { text = *(byte **)text; } language_00 = language; if (language == 0x14) { language_00 = *(int *)&g_manager->_stringTable; } this_00 = &g_manager->_stringTable; if (*text == '#') { language = language & 0xffffff; StringTable::get_string (this_00,(byte *)"Stages",language_00,(byte *)((int)text + 1), (byte *)((int)&language + 3)); if (language._3_1_ == '\0') { language = language & 0xffffff; text = StringTable::get_string (this_00,(byte *)"Stages",language_00,(byte *)((int)text + 1), (byte *)((int)&language + 3)); } } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; RVar2 = (RoomConfig_Stage)text; do { cVar1 = *(char *)RVar2; RVar2 = (RoomConfig_Stage)((int)RVar2 + 1); } while (cVar1 != '\0'); std::string::assign(outName->_buf,text,(int)RVar2 - (int)((int)text + 1)); return outName; } //@@ 008295c0 FUN_008295c0 byte * FUN_008295c0(void) { uint in_ECX; if (((int)in_ECX < 0) || (0x1d < in_ECX)) { return &s_empty; } return (&PTR_DAT_00b1fd50)[in_ECX]; } //@@ 008295e0 RoomConfig_Stage::game_destructor /* ZHL [exact] __thiscall void RoomConfig_Stage::game_destructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall RoomConfig_Stage::game_destructor(RoomConfig_Stage *this) { void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(this + 0x19,0x2c,2,RoomConfigMode::dtor); std::string::_Tidy_deallocate((char *)(this + 0x13)); std::string::_Tidy_deallocate((char *)(this + 0xd)); std::string::_Tidy_deallocate((char *)(this + 7)); std::string::_Tidy_deallocate((char *)(this + 1)); ExceptionList = local_10; return; } //@@ 00829670 RoomConfig::~RoomConfig /* DB: ECX typed RoomConfig_Stage*: RoomConfig_Stage::unload on all 0x25 stages (stride 0xc4), 0082e050, the 0x10 x 0x1c array at +0x1c60 (dtor 0069d1f0) and the 0x25-stage array (RoomConfig_Stage::game_destructor) = the inverse of Game::constructor's _roomConfig construction (0x25 x 0xc4 RoomConfigStage::ctor, 0x10 x 0x1c at field_0x1a570); called from Game::~Game */ void RoomConfig::~RoomConfig(void) { uint uVar1; RoomConfig_Stage *in_ECX; uint uVar2; RoomConfig_Stage *this; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01ae0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar2 = 0; this = in_ECX; do { RoomConfig_Stage::unload(this); uVar2 = uVar2 + 1; this = this + 0x31; } while (uVar2 < 0x25); FUN_0082e050(uVar1); _eh_vector_destructor_iterator_(in_ECX + 0x718,0x1c,0x10,FUN_0069d1f0); std::vector<28byte_string>::_Tidy(); _eh_vector_destructor_iterator_(in_ECX,0xc4,0x25,RoomConfig_Stage::game_destructor); ExceptionList = local_10; return; } //@@ 00829710 RoomConfig::LoadRoomFromXmlFile /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (RoomConfig::LoadRoomFromXmlFile(ecx=Room*,edx=path) (--load-room)) */ void RoomConfig::LoadRoomFromXmlFile(void) { uint uVar1; int *piVar2; int iVar3; byte *text; void *pvVar4; byte *in_EDX; byte *pbVar5; undefined1 auStack_1011c [48]; undefined1 auStack_100ec [65560]; RoomConfig_Room local_d4; undefined1 local_74 [20]; void *local_60; undefined4 local_50; uint local_4c; int local_3c; undefined4 local_38; void *local_34; short local_30; undefined4 local_28; undefined4 local_24; undefined4 local_20; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b01b18; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_74 + 0x70); ExceptionList = &local_10; local_50 = 0; local_4c = 0xf; local_60 = (void *)0x0; local_3c = 0; local_38 = 0; local_34 = (void *)0x0; local_30 = 0; local_20 = 0; local_24 = 0; local_8 = 0; local_74._0_4_ = 0; local_28 = 0; if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } local_14 = uVar1; piVar2 = FileSystem::Open(&PTR_vftable_00c37a10,in_EDX,(int *)0x0); if (piVar2 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[error] Could not open %s\n"); FUN_00829920(local_74); if (local_4c < 0x10) { ExceptionList = local_10; return; } uVar1 = local_4c + 1; pvVar4 = local_60; if (uVar1 < 0x1000) goto LAB_00829805; pvVar4 = *(void **)((int)local_60 + -4); iVar3 = (int)local_60 - (int)pvVar4; } else { iVar3 = (**(code **)(*piVar2 + 4))(uVar1); text = operator_new_tracked(iVar3 + 1); (**(code **)(*piVar2 + 0x14))(text,1,iVar3); text[iVar3] = 0; (**(code **)*piVar2)(1); FUN_00413b90(); local_8._0_1_ = 1; iVar3 = 0x829878; pbVar5 = text; rapidxml::xml_document::parse(auStack_1011c,text); pvVar4 = xml_node::first_node(auStack_1011c,&DAT_00b1c17c,iVar3,(byte)pbVar5); RoomConfigRoom::ParseXml(&local_d4,pvVar4,(RoomConfig_Room *)local_74); std::string::_Tidy_deallocate(&local_d4.field_0x14); local_8._0_1_ = 2; xml_memory_pool::clear(auStack_100ec); local_8 = CONCAT31(local_8._1_3_,3); tracked_alloc(1,text,0); FUN_00829920(local_74); if (local_4c < 0x10) { ExceptionList = local_10; return; } uVar1 = local_4c + 1; pvVar4 = local_60; if (uVar1 < 0x1000) goto LAB_00829805; pvVar4 = *(void **)((int)local_60 + -4); iVar3 = (int)local_60 - (int)pvVar4; } uVar1 = local_4c + 0x24; if (0x1f < iVar3 - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_00829805: operator_delete(pvVar4,uVar1); ExceptionList = local_10; return; } //@@ 00829920 FUN_00829920 void FUN_00829920(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = param_1[2]; in_ECX[3] = param_1[3]; in_ECX[4] = param_1[4]; in_ECX[5] = 0; in_ECX[9] = 0; in_ECX[10] = 0; uVar1 = param_1[6]; uVar2 = param_1[7]; uVar3 = param_1[8]; in_ECX[5] = param_1[5]; in_ECX[6] = uVar1; in_ECX[7] = uVar2; in_ECX[8] = uVar3; *(undefined8 *)(in_ECX + 9) = *(undefined8 *)(param_1 + 9); param_1[9] = 0; param_1[10] = 0xf; *(undefined1 *)(param_1 + 5) = 0; in_ECX[0xb] = param_1[0xb]; in_ECX[0xc] = param_1[0xc]; in_ECX[0xd] = param_1[0xd]; in_ECX[0xe] = param_1[0xe]; in_ECX[0xf] = param_1[0xf]; in_ECX[0x10] = param_1[0x10]; *(undefined2 *)(in_ECX + 0x11) = *(undefined2 *)(param_1 + 0x11); *(undefined1 *)((int)in_ECX + 0x46) = *(undefined1 *)((int)param_1 + 0x46); *(undefined1 *)((int)in_ECX + 0x47) = *(undefined1 *)((int)param_1 + 0x47); in_ECX[0x12] = param_1[0x12]; in_ECX[0x13] = param_1[0x13]; uVar1 = param_1[0x15]; in_ECX[0x14] = param_1[0x14]; in_ECX[0x15] = uVar1; in_ECX[0x16] = param_1[0x16]; return; } //@@ 008299e0 FUN_008299e0 undefined4 FUN_008299e0(short *param_1,short *param_2) { if ((param_1[1] < param_2[1]) || ((param_1[1] == param_2[1] && (*param_1 < *param_2)))) { return 1; } return 0; } //@@ 00829a10 RoomConfig::get_door_from_position /* ZHL [exact] static cleanup int RoomConfig::get_door_from_position(int16_t posX, int16_t posY, int shape); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ int __cdecl RoomConfig::get_door_from_position(short posX,short posY,int shape) { int iVar1; undefined2 in_register_00000006; int iVar2; undefined2 in_register_0000000a; int iVar3; iVar3 = CONCAT22(in_register_0000000a,posY); iVar2 = CONCAT22(in_register_00000006,posX); iVar1 = -1; if ((iVar2 == -1) || (iVar2 == 0xc)) { if (iVar3 == 3) { return 0; } if (((iVar2 == -1) || (iVar2 == 0xc)) && (iVar3 == 10)) { return 4; } } if (iVar2 == 6) { if (iVar3 != -1) { if (iVar3 != 0xe) { if (iVar3 != 6) { if (iVar3 == 7) { return 3; } return -1; } if (shape == 9) { return 1; } return -1; } if (shape != 0xb) { return 3; } } return 1; } if (iVar2 != 0x13) { if ((iVar2 == 0xd) || (iVar2 == 0x1a)) { if (iVar3 == 3) { return 2; } if (((iVar2 == 0xd) || (iVar2 == 0x1a)) && (iVar3 == 10)) { iVar1 = 6; } } return iVar1; } if (iVar3 != -1) { if (iVar3 != 0xe) { if (iVar3 != 6) { if (iVar3 == 7) { return 7; } return -1; } if (shape == 10) { return 5; } return -1; } if (shape != 0xc) { return 7; } } return 5; } //@@ 00829af0 RoomConfigRoom::ParseXml /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0082a8c1) */ /* WARNING: Removing unreachable block (ram,0x0082a769) */ /* WARNING: Removing unreachable block (ram,0x0082a78e) */ /* WARNING: Removing unreachable block (ram,0x0082a7a2) */ /* WARNING: Removing unreachable block (ram,0x0082a8d3) */ /* WARNING: Removing unreachable block (ram,0x0082a8e9) */ /* DB: src/rooms decompile labels (RoomConfigRoom::ParseXml(node)) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ RoomConfig_Room * __cdecl RoomConfigRoom::ParseXml(RoomConfig_Room *outRoom,void *node,RoomConfig_Room *room) { byte bVar1; uint uVar2; int iVar3; void *spawns; undefined4 *puVar4; byte *pbVar5; uint uVar6; byte *pbVar7; byte *****pppppbVar8; int *piVar9; byte *pbVar10; code *pcVar11; code *pcVar12; char *pcVar13; char *pcVar14; bool bVar15; double dVar16; byte *****in_stack_ffffff60; byte *****in_stack_ffffff64; undefined4 *spawnsLast; uint local_6c; undefined4 *spawnNode; int *entriesLast; float local_58; undefined4 *childNode; byte local_49; int entityType; undefined4 uStack_44; float entityWeight; byte *****local_3c [2]; undefined4 spawnCoords; void *spawnEntries; uint uStack_2c; float fStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00b01b86; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; puVar4 = *(undefined4 **)((int)node + 0x20); pcVar11 = atoi_exref; local_24 = uVar2; pppppbVar8 = (byte *****)(local_3c + 0xe); if (puVar4 != (undefined4 *)0x0) { do { pcVar12 = atoi_exref; pbVar10 = &DAT_00b69a0c; pbVar5 = &g_xmlNullStr; if ((byte *)*puVar4 != (byte *)0x0) { pbVar5 = (byte *)*puVar4; } do { local_49 = *pbVar5; bVar15 = local_49 < *pbVar10; pbVar7 = (byte *)*puVar4; if (local_49 != *pbVar10) { LAB_00829b94: uVar6 = -(uint)bVar15 | 1; goto LAB_00829b99; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < pbVar10[1]; pbVar7 = (byte *)*puVar4; if (local_49 != pbVar10[1]) goto LAB_00829b94; pbVar5 = pbVar5 + 2; pbVar10 = pbVar10 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829b99: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829bad; iVar3 = (*pcVar11)(in_stack_ffffff64,uVar2); room->Type = iVar3; pcVar12 = pcVar11; } else { pcVar13 = "variant"; pbVar5 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar5 = pbVar7; } do { local_49 = *pbVar5; bVar15 = local_49 < (byte)*pcVar13; pbVar10 = (byte *)*puVar4; if (local_49 != *pcVar13) { LAB_00829bf3: uVar6 = -(uint)bVar15 | 1; goto LAB_00829bf8; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < (byte)pcVar13[1]; pbVar10 = (byte *)*puVar4; if (local_49 != pcVar13[1]) goto LAB_00829bf3; pbVar5 = pbVar5 + 2; pcVar13 = pcVar13 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829bf8: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829c0c; iVar3 = (*pcVar11)(in_stack_ffffff64,uVar2); room->originalVariant = iVar3; room->Variant = iVar3; pcVar12 = pcVar11; } else { pcVar13 = "subtype"; pbVar5 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar5 = pbVar10; } do { local_49 = *pbVar5; bVar15 = local_49 < (byte)*pcVar13; pbVar10 = (byte *)*puVar4; if (local_49 != *pcVar13) { LAB_00829c55: uVar6 = -(uint)bVar15 | 1; goto LAB_00829c5a; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < (byte)pcVar13[1]; pbVar10 = (byte *)*puVar4; if (local_49 != pcVar13[1]) goto LAB_00829c55; pbVar5 = pbVar5 + 2; pcVar13 = pcVar13 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829c5a: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829c6e; iVar3 = (*pcVar11)(in_stack_ffffff64,uVar2); room->Subtype = iVar3; pcVar12 = pcVar11; } else { pbVar7 = s_name; pbVar5 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar5 = pbVar10; } do { local_49 = *pbVar5; bVar15 = local_49 < *pbVar7; pbVar10 = (byte *)*puVar4; if (local_49 != *pbVar7) { LAB_00829cb4: uVar6 = -(uint)bVar15 | 1; goto LAB_00829cb9; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < pbVar7[1]; pbVar10 = (byte *)*puVar4; if (local_49 != pbVar7[1]) goto LAB_00829cb4; pbVar5 = pbVar5 + 2; pbVar7 = pbVar7 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829cb9: if (uVar6 == 0) { in_stack_ffffff60 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff60 = (byte *****)puVar4[1]; } pppppbVar8 = in_stack_ffffff60; do { bVar1 = *(byte *)pppppbVar8; pppppbVar8 = (byte *****)((int)pppppbVar8 + 1); } while (bVar1 != 0); in_stack_ffffff64 = (byte *****)((int)pppppbVar8 - (int)((int)in_stack_ffffff60 + 1)); std::string::assign(&room->field_0x14,(byte *)in_stack_ffffff60, (uint)in_stack_ffffff64); LAB_00829ce6: pcVar12 = atoi_exref; } else { pcVar13 = "difficulty"; pbVar5 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar5 = pbVar10; } do { local_49 = *pbVar5; bVar15 = local_49 < (byte)*pcVar13; pbVar10 = (byte *)*puVar4; if (local_49 != *pcVar13) { LAB_00829d5e: uVar6 = -(uint)bVar15 | 1; goto LAB_00829d63; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < (byte)pcVar13[1]; pbVar10 = (byte *)*puVar4; if (local_49 != pcVar13[1]) goto LAB_00829d5e; pbVar5 = pbVar5 + 2; pcVar13 = pcVar13 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829d63: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829d77; iVar3 = (*pcVar11)(in_stack_ffffff64,uVar2); room->Difficulty = iVar3; pcVar12 = pcVar11; } else { pcVar13 = "weight"; pbVar5 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar5 = pbVar10; } do { local_49 = *pbVar5; bVar15 = local_49 < (byte)*pcVar13; pbVar10 = (byte *)*puVar4; if (local_49 != *pcVar13) { LAB_00829dbe: uVar6 = -(uint)bVar15 | 1; goto LAB_00829dc3; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < (byte)pcVar13[1]; pbVar10 = (byte *)*puVar4; if (local_49 != pcVar13[1]) goto LAB_00829dbe; pbVar5 = pbVar5 + 2; pcVar13 = pcVar13 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829dc3: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829ddb; dVar16 = atof((char *)in_stack_ffffff64); local_58 = (float)dVar16; room->Weight = local_58; room->InitialWeight = local_58; pcVar12 = pcVar11; } else { pcVar13 = "width"; pbVar5 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar5 = pbVar10; } do { local_49 = *pbVar5; bVar15 = local_49 < (byte)*pcVar13; pbVar10 = (byte *)*puVar4; if (local_49 != *pcVar13) { LAB_00829e30: uVar6 = -(uint)bVar15 | 1; goto LAB_00829e35; } if (local_49 == 0) break; local_49 = pbVar5[1]; bVar15 = local_49 < (byte)pcVar13[1]; pbVar10 = (byte *)*puVar4; if (local_49 != pcVar13[1]) goto LAB_00829e30; pbVar5 = pbVar5 + 2; pcVar13 = pcVar13 + 2; } while (local_49 != 0); uVar6 = 0; LAB_00829e35: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829e49; bVar1 = (*pcVar11)(in_stack_ffffff64,uVar2); room->Width = bVar1; pcVar12 = pcVar11; } else { if (pbVar10 == (byte *)0x0) { pbVar10 = &g_xmlNullStr; pbVar5 = (byte *)0x0; } else { pbVar5 = pbVar10; } pcVar13 = "height"; do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_00829e90: uVar6 = -(uint)bVar15 | 1; goto LAB_00829e95; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_00829e90; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_00829e95: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829eaf; iVar3 = atoi((char *)in_stack_ffffff64); room->Height = (byte)iVar3; } else { pcVar13 = "shape"; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_00829ef0: uVar6 = -(uint)bVar15 | 1; goto LAB_00829ef5; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_00829ef0; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_00829ef5: if (uVar6 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829f0f; iVar3 = atoi((char *)in_stack_ffffff64); room->Shape = iVar3; } else { pcVar13 = "flags"; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_00829f50: uVar6 = -(uint)bVar15 | 1; goto LAB_00829f55; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_00829f50; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_00829f55: if (uVar6 != 0) goto LAB_00829ce6; in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829f73; iVar3 = atoi((char *)in_stack_ffffff64); *(int *)&room->field_0x4c = iVar3; } } } } } } } } } if (puVar4[4] == 0) break; puVar4 = (undefined4 *)puVar4[6]; pcVar11 = pcVar12; } while (puVar4 != (undefined4 *)0x0); pppppbVar8 = (byte *****)puStack_20; } puStack_20 = (undefined1 *)pppppbVar8; if (room->Type == 0) { FUN_0082a920(room); } else { childNode = xml_node::first_node (node,&DAT_00b6cb48,(int)in_stack_ffffff60,(byte)in_stack_ffffff64); bVar1 = (byte)in_stack_ffffff64; if (childNode != (undefined4 *)0x0) { LAB_00829fa0: for (puVar4 = (undefined4 *)childNode[8]; puVar4 != (undefined4 *)0x0; puVar4 = (undefined4 *)puVar4[6]) { pbVar5 = (byte *)*puVar4; pbVar7 = &DAT_00b66150; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_00829fe1: uVar2 = -(uint)bVar15 | 1; goto LAB_00829fe6; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_00829fe1; pbVar10 = pbVar10 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00829fe6: if (uVar2 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x829ffe; uVar2 = atoi((char *)in_stack_ffffff64); local_6c = uVar2 & 0xffff; } else { pbVar7 = &DAT_00b6cb44; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_0082a040: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a045; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_0082a040; pbVar7 = pbVar7 + 2; pbVar10 = pbVar10 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a045: if (uVar2 == 0) { in_stack_ffffff64 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff64 = (byte *****)puVar4[1]; } in_stack_ffffff60 = (byte *****)0x82a05d; uVar2 = atoi((char *)in_stack_ffffff64); local_58 = (float)(uVar2 & 0xffff); } else { pcVar13 = "exists"; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_0082a0a0: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a0a5; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_0082a0a0; pcVar13 = pcVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a0a5: if (uVar2 == 0) { local_3c[0] = (byte *****)0x0; uStack_2c = 0; in_stack_ffffff60 = (byte *****)&g_xmlNullStr; if ((byte *****)puVar4[1] != (byte *****)0x0) { in_stack_ffffff60 = (byte *****)puVar4[1]; } fStack_28 = 2.10195e-44; pppppbVar8 = in_stack_ffffff60; do { bVar1 = *(byte *)pppppbVar8; pppppbVar8 = (byte *****)((int)pppppbVar8 + 1); } while (bVar1 != 0); in_stack_ffffff64 = (byte *****)((int)pppppbVar8 - (int)((int)in_stack_ffffff60 + 1)); std::string::assign((char *)local_3c,(byte *)in_stack_ffffff60,(uint)in_stack_ffffff64 ); if (uStack_2c == 0) { LAB_0082a1a2: local_49 = 0; } else { pppppbVar8 = (byte *****)local_3c; if (0xf < (uint)fStack_28) { pppppbVar8 = local_3c[0]; } if (uStack_2c == 4) { if ((*pppppbVar8 == (byte ****)0x65757274) || ((((bVar1 = (byte)*pppppbVar8, bVar15 = bVar1 < 0x74, bVar1 == 0x74 && (bVar15 = *(byte *)((int)pppppbVar8 + 1) < 0x72, *(byte *)((int)pppppbVar8 + 1) == 0x72)) && (bVar15 = *(byte *)((int)pppppbVar8 + 2) < 0x75, *(byte *)((int)pppppbVar8 + 2) == 0x75)) && (bVar15 = *(byte *)((int)pppppbVar8 + 3) < 0x65, *(byte *)((int)pppppbVar8 + 3) == 0x65)))) { uVar2 = 0; } else { uVar2 = -(uint)bVar15 | 1; } if (uVar2 != 0) goto LAB_0082a13d; } else { LAB_0082a13d: pppppbVar8 = (byte *****)local_3c; if (0xf < (uint)fStack_28) { pppppbVar8 = local_3c[0]; } if (uStack_2c == 4) { if ((*pppppbVar8 == (byte ****)0x65757254) || (((bVar1 = (byte)*pppppbVar8, bVar15 = bVar1 < 0x54, bVar1 == 0x54 && (bVar15 = *(byte *)((int)pppppbVar8 + 1) < 0x72, *(byte *)((int)pppppbVar8 + 1) == 0x72)) && ((bVar15 = *(byte *)((int)pppppbVar8 + 2) < 0x75, *(byte *)((int)pppppbVar8 + 2) == 0x75 && (bVar15 = *(byte *)((int)pppppbVar8 + 3) < 0x65, *(byte *)((int)pppppbVar8 + 3) == 0x65)))))) { uVar2 = 0; } else { uVar2 = -(uint)bVar15 | 1; } if (uVar2 == 0) goto LAB_0082a19c; } in_stack_ffffff64 = (byte *****)local_3c; if (0xf < (uint)fStack_28) { in_stack_ffffff64 = local_3c[0]; } in_stack_ffffff60 = (byte *****)0x82a18f; iVar3 = atoi((char *)in_stack_ffffff64); if (iVar3 == 0) goto LAB_0082a1a2; } LAB_0082a19c: local_49 = 1; } if (0xf < (uint)fStack_28) { in_stack_ffffff64 = (byte *****)((int)fStack_28 + 1); in_stack_ffffff60 = local_3c[0]; if ((byte *****)0xfff < in_stack_ffffff64) { in_stack_ffffff60 = (byte *****)local_3c[0][-1]; in_stack_ffffff64 = (byte *****)((int)fStack_28 + 0x24); if ((byte *)0x1f < (byte *)((int)local_3c[0] + (-4 - (int)in_stack_ffffff60))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(in_stack_ffffff60,(uint)in_stack_ffffff64); } } } } if (puVar4[4] == 0) break; } if (local_49 != 0) { in_stack_ffffff64 = (byte *****)room->Shape; in_stack_ffffff60 = (byte *****)0x82a211; uVar2 = RoomConfig::get_door_from_position ((short)local_6c,SUB42(local_58,0),(int)in_stack_ffffff64); if (-1 < (int)uVar2) { if (7 < uVar2) { LAB_0082a913: /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } (&room->Doors)[uVar2 >> 5] = (&room->Doors)[uVar2 >> 5] | 1 << ((byte)uVar2 & 0x1f); } } bVar1 = (byte)in_stack_ffffff64; pcVar13 = "door"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); childNode = (undefined4 *)childNode[0xb]; if (childNode != (undefined4 *)0x0) { do { pbVar5 = (byte *)*childNode; if (pbVar5 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar5 = &g_xmlNullStr; } else { pcVar13 = (char *)childNode[2]; } if (pcVar13 == pcVar14 + -0xb6cb47) { pbVar10 = (byte *)(pcVar13 + (int)pbVar5); if (pbVar10 <= pbVar5) goto LAB_00829fa0; iVar3 = (int)&DAT_00b6cb48 - (int)pbVar5; while (*pbVar5 == pbVar5[iVar3]) { pbVar5 = pbVar5 + 1; if (pbVar10 <= pbVar5) goto LAB_00829fa0; } } childNode = (undefined4 *)childNode[0xb]; if (childNode == (undefined4 *)0x0) break; } while( true ); } } spawnsLast = (undefined4 *)0x0; local_14 = (byte ****)0x0; spawnNode = xml_node::first_node(node,(byte *)&DAT_00b65804,(int)in_stack_ffffff60,bVar1); if (spawnNode != (undefined4 *)0x0) { LAB_0082a2d1: puVar4 = (undefined4 *)spawnNode[8]; local_58 = 0.0; local_58._0_2_ = 0; spawnCoords = 0; local_6c = 0; local_6c._0_2_ = 0; spawnEntries = (void *)0x0; uStack_2c = uStack_2c & 0xffffff00; fStack_28 = 0.0; for (; puVar4 != (undefined4 *)0x0; puVar4 = (undefined4 *)puVar4[6]) { pbVar5 = (byte *)*puVar4; pbVar7 = &DAT_00b66150; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_0082a326: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a32b; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_0082a326; pbVar10 = pbVar10 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a32b: if (uVar2 == 0) { pbVar5 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar5 = (byte *)puVar4[1]; } local_58 = (float)atoi((char *)pbVar5); spawnCoords = CONCAT22(spawnCoords._2_2_,SUB42(local_58,0)); } else { pbVar7 = &DAT_00b6cb44; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_0082a380: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a385; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_0082a380; pbVar7 = pbVar7 + 2; pbVar10 = pbVar10 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a385: if (uVar2 == 0) { pbVar5 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar5 = (byte *)puVar4[1]; } local_6c = atoi((char *)pbVar5); spawnCoords = CONCAT22((short)local_6c,(undefined2)spawnCoords); } } if (puVar4[4] == 0) break; } entriesLast = (int *)0x0; local_14 = (byte ****)CONCAT31(local_14._1_3_,1); pcVar13 = "entity"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); childNode = (undefined4 *)spawnNode[6]; piVar9 = (int *)0x0; if (childNode == (undefined4 *)0x0) goto LAB_0082a493; do { pbVar5 = (byte *)*childNode; if (pbVar5 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar5 = &g_xmlNullStr; } else { pcVar13 = (char *)childNode[2]; } if (pcVar13 == pcVar14 + -0xb66be3) { pbVar10 = (byte *)(pcVar13 + (int)pbVar5); if (pbVar10 <= pbVar5) goto LAB_0082a433; iVar3 = (int)"entity" - (int)pbVar5; while (*pbVar5 == pbVar5[iVar3]) { pbVar5 = pbVar5 + 1; if (pbVar10 <= pbVar5) goto LAB_0082a433; } } childNode = (undefined4 *)childNode[0xb]; } while (childNode != (undefined4 *)0x0); goto LAB_0082a490; } LAB_0082a82c: uVar2 = (int)spawnsLast >> 4; std::_Sort_unchecked<16byte>(uVar2,FUN_008299e0); spawns = operator_new_tracked (-(uint)((int)((ulonglong)uVar2 * 0x10 >> 0x20) != 0) | (uint)((ulonglong)uVar2 * 0x10)); if (spawns == (void *)0x0) { spawns = (void *)0x0; } else if (uVar2 != 0) { puVar4 = (undefined4 *)((int)spawns + 4); uVar6 = uVar2; do { *(undefined1 *)(puVar4 + 1) = 0; puVar4[-1] = 0; *puVar4 = 0; puVar4[2] = 0; uVar6 = uVar6 - 1; puVar4 = puVar4 + 4; } while (uVar6 != 0); } local_14 = (byte ****)((uint)local_14 & 0xffffff00); room->SpawnCount = (short)uVar2; room->Spawns = spawns; memcpy(spawns,(void *)0x0,uVar2 << 4); FUN_0082a920(room); } ExceptionList = local_1c; return outRoom; LAB_0082a433: for (puVar4 = (undefined4 *)childNode[8]; puVar4 != (undefined4 *)0x0; puVar4 = (undefined4 *)puVar4[6]) { pbVar5 = (byte *)*puVar4; pbVar7 = &DAT_00b69a0c; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_0082a4f8: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a4fd; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_0082a4f8; pbVar10 = pbVar10 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a4fd: if (uVar2 == 0) { pbVar5 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar5 = (byte *)puVar4[1]; } entityType = atoi((char *)pbVar5); } else { pcVar13 = "variant"; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_0082a550: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a555; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_0082a550; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a555: if (uVar2 == 0) { pbVar5 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar5 = (byte *)puVar4[1]; } iVar3 = atoi((char *)pbVar5); uStack_44 = CONCAT22(uStack_44._2_2_,(short)iVar3); } else { pcVar13 = "subtype"; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_0082a5a5: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a5aa; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_0082a5a5; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a5aa: if (uVar2 == 0) { pbVar5 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar5 = (byte *)puVar4[1]; } iVar3 = atoi((char *)pbVar5); uStack_44 = CONCAT22((short)iVar3,(short)uStack_44); } else { pcVar13 = "weight"; pbVar10 = &g_xmlNullStr; if (pbVar5 != (byte *)0x0) { pbVar10 = pbVar5; } do { bVar1 = *pbVar10; bVar15 = bVar1 < (byte)*pcVar13; if (bVar1 != *pcVar13) { LAB_0082a5f7: uVar2 = -(uint)bVar15 | 1; goto LAB_0082a5fc; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < (byte)pcVar13[1]; if (bVar1 != pcVar13[1]) goto LAB_0082a5f7; pbVar10 = pbVar10 + 2; pcVar13 = pcVar13 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0082a5fc: if (uVar2 == 0) { pbVar5 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar5 = (byte *)puVar4[1]; } dVar16 = atof((char *)pbVar5); entityWeight = (float)dVar16; fStack_28 = entityWeight + fStack_28; } } } } if (puVar4[4] == 0) break; } if (entityType == 0x3ca) { if (((short)uStack_44 == 2) && (uVar2 = RoomConfig::get_door_from_position(local_58._0_2_,(short)local_6c,room->Shape), -1 < (int)uVar2)) { if (7 < uVar2) goto LAB_0082a913; *(uint *)(&room->field_0x3c + (uVar2 >> 5) * 4) = *(uint *)(&room->field_0x3c + (uVar2 >> 5) * 4) | 1 << ((byte)uVar2 & 0x1f); } } else if ((entityType == 0x1194) && ((short)uStack_44 == 0)) { *(uint *)&room->field_0x4c = *(uint *)&room->field_0x4c | 0x80; } if (entriesLast == (int *)0x0) { std::vector<12byte>::_Emplace_reallocate(0,&entityType); } else { *entriesLast = entityType; entriesLast[1] = uStack_44; entriesLast[2] = (int)entityWeight; entriesLast = entriesLast + 3; } pcVar13 = "entity"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); childNode = (undefined4 *)childNode[0xb]; if (childNode != (undefined4 *)0x0) { do { pbVar5 = (byte *)*childNode; if (pbVar5 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar5 = &g_xmlNullStr; } else { pcVar13 = (char *)childNode[2]; } if (pcVar13 == pcVar14 + -0xb66be3) { pbVar10 = (byte *)(pcVar13 + (int)pbVar5); if (pbVar10 <= pbVar5) goto LAB_0082a433; iVar3 = (int)"entity" - (int)pbVar5; while (*pbVar5 == pbVar5[iVar3]) { pbVar5 = pbVar5 + 1; if (pbVar10 <= pbVar5) goto LAB_0082a433; } } childNode = (undefined4 *)childNode[0xb]; if (childNode == (undefined4 *)0x0) break; } while( true ); } LAB_0082a490: piVar9 = entriesLast; LAB_0082a493: uVar2 = (int)piVar9 / 0xc; spawnEntries = operator_new_tracked (-(uint)((int)((ulonglong)uVar2 * 0xc >> 0x20) != 0) | (uint)((ulonglong)uVar2 * 0xc)); memcpy(spawnEntries,(void *)0x0,uVar2 * 0xc); uStack_2c = CONCAT31(uStack_2c._1_3_,(char)uVar2); if (spawnsLast == (undefined4 *)0x0) { std::vector::_Emplace_reallocate(0,&spawnCoords); } else { *spawnsLast = spawnCoords; spawnsLast[1] = spawnEntries; spawnsLast[2] = uStack_2c; spawnsLast[3] = fStack_28; spawnsLast = spawnsLast + 4; } local_14 = (byte ****)((uint)local_14 & 0xffffff00); pcVar13 = "spawn"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); spawnNode = (undefined4 *)spawnNode[0xb]; do { if (spawnNode == (undefined4 *)0x0) goto LAB_0082a82c; pbVar5 = (byte *)*spawnNode; if (pbVar5 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar5 = &g_xmlNullStr; } else { pcVar13 = (char *)spawnNode[2]; } if (pcVar13 == pcVar14 + -0xb65803) { pbVar10 = (byte *)(pcVar13 + (int)pbVar5); if (pbVar10 <= pbVar5) goto LAB_0082a2d1; iVar3 = (int)&DAT_00b65804 - (int)pbVar5; while (*pbVar5 == pbVar5[iVar3]) { pbVar5 = pbVar5 + 1; if (pbVar10 <= pbVar5) goto LAB_0082a2d1; } } spawnNode = (undefined4 *)spawnNode[0xb]; } while( true ); } //@@ 0082a920 FUN_0082a920 void FUN_0082a920(undefined4 *param_1) { undefined4 uVar1; undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = param_1[2]; in_ECX[3] = param_1[3]; in_ECX[4] = param_1[4]; std::string::string((char *)(in_ECX + 5),param_1 + 5); in_ECX[0xb] = param_1[0xb]; in_ECX[0xc] = param_1[0xc]; in_ECX[0xd] = param_1[0xd]; in_ECX[0xe] = param_1[0xe]; in_ECX[0xf] = param_1[0xf]; in_ECX[0x10] = param_1[0x10]; *(undefined2 *)(in_ECX + 0x11) = *(undefined2 *)(param_1 + 0x11); *(undefined1 *)((int)in_ECX + 0x46) = *(undefined1 *)((int)param_1 + 0x46); *(undefined1 *)((int)in_ECX + 0x47) = *(undefined1 *)((int)param_1 + 0x47); in_ECX[0x12] = param_1[0x12]; in_ECX[0x13] = param_1[0x13]; uVar1 = param_1[0x15]; in_ECX[0x14] = param_1[0x14]; in_ECX[0x15] = uVar1; in_ECX[0x16] = param_1[0x16]; return; } //@@ 0082a9c0 RoomConfig::ResetStageWeights /* DB: src/rooms decompile labels (RoomConfig::ResetStageWeights(stageId,mode) ret8) */ void RoomConfig::ResetStageWeights(uint param_1,uint param_2) { int iVar1; RoomConfig *in_ECX; int iVar2; uint uVar3; if (param_2 == 0xffffffff) { if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { param_2 = 0; } else { param_2 = 1; } } iVar1 = param_2 * 0x2c + param_1 * 0xc4 + 100; if ((&in_ECX->field_0x8c)[iVar1 + -100] == '\0') { LoadStageBinary(in_ECX,param_1,param_2); return; } uVar3 = 0; if (*(int *)(&in_ECX->field_0x80 + iVar1 + -100) != 0) { iVar2 = 0; do { iVar2 = iVar2 + 0x5c; uVar3 = uVar3 + 1; *(undefined4 *)(*(int *)(&in_ECX->field_0x7c + iVar1 + -100) + -0x28 + iVar2) = *(undefined4 *)(*(int *)(&in_ECX->field_0x7c + iVar1 + -100) + -0x2c + iVar2); } while (uVar3 < *(uint *)(&in_ECX->field_0x80 + iVar1 + -100)); } return; } //@@ 0082aa40 RoomConfig::LoadStageBinary /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (RoomConfig::LoadStageBinary(stageId,mode) thiscall ret8) prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall RoomConfig::LoadStageBinary(RoomConfig *this,uint Stage,uint Mode) { int iVar1; RoomSet RVar2; undefined4 *puVar3; byte *extraout_EAX; byte *path; int *fileHandle; RoomSet length; void *pvVar4; uint uVar5; uint allocSize; RoomConfig_Stage *roomSet; uint *puVar6; int magic; int *file; uint local_7c; uint local_78; uint *puStack_74; undefined1 isLoaded; void *redirectedPath [4]; uint uStack_5c; uint uStack_58; void *tmpString; char acStack_50 [4]; char acStack_4c [4]; char acStack_48 [8]; uint uStack_40; void *basePath [4]; undefined4 uStack_2c; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; RoomSet roomSet; int roomVariant; puStack_20 = (undefined1 *)(basePath + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b01c02; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(basePath + 0xb); local_7c = Stage; local_78 = Mode; roomSet = (RoomConfig_Stage *)(&this->field_0x0 + Stage * 0xc4); if (Mode == 0xffffffff) { if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { local_78 = 0; } else { local_78 = 1; } } roomSet = (RoomSet)(roomSet + local_78 * 0xb + 0x19); if (roomSet[local_78 * 0xb + 0x1d] == (RoomConfig_Stage)0x0) { return; } ExceptionList = &local_1c; RoomConfigStage::GetDisplayName(roomSet,(std_string *)&tmpString,0x14); local_14 = (void *)0x0; KAGE_LogMessage(1,(byte *)"[RoomConfig] load stage %d: %s (mode %d)\n"); local_14 = (void *)0xffffffff; if (0xf < uStack_40) { uVar5 = uStack_40 + 1; pvVar4 = tmpString; if (0xfff < uVar5) { pvVar4 = *(void **)((int)tmpString + -4); uVar5 = uStack_40 + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } RVar2 = *(RoomSet *)((int)roomSet + 0x10); uStack_2c = 0; uStack_28 = 0xf; basePath[0] = (void *)0x0; length = (RoomSet)((int)RVar2 - 3U); if ((uint)RVar2 < (int)RVar2 - 3U) { length = RVar2; } RVar2 = roomSet; if (0xf < (uint)*(RoomSet *)((int)roomSet + 0x14)) { RVar2 = *(RoomSet *)roomSet; } std::string::assign((char *)basePath,(byte *)RVar2,(uint)length); local_14 = (void *)0x1; puVar3 = std::string::append((char *)basePath,&UNK_00b6cb40,3); tmpString = (void *)*puVar3; acStack_50 = (char [4])puVar3[1]; acStack_4c = (char [4])puVar3[2]; acStack_48._0_4_ = puVar3[3]; unique0x0000a400 = *(undefined8 *)(puVar3 + 4); puVar3[4] = 0; puVar3[5] = 0xf; *(undefined1 *)puVar3 = 0; local_14._0_1_ = 3; if (0xf < uStack_28) { uVar5 = uStack_28 + 1; pvVar4 = basePath[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)basePath[0] + -4); uVar5 = uStack_28 + 0x24; if (0x1f < (uint)((int)basePath[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } uStack_2c = 0; uStack_28 = 0xf; basePath[0] = (void *)((uint)basePath[0] & 0xffffff00); ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)redirectedPath,(std_string *)&tmpString); local_14._0_1_ = 4; path = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { path = *(byte **)extraout_EAX; } fileHandle = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); local_14._0_1_ = 3; file = fileHandle; if (0xf < uStack_58) { uVar5 = uStack_58 + 1; pvVar4 = redirectedPath[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)redirectedPath[0] + -4); uVar5 = uStack_58 + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } uStack_5c = 0; uStack_58 = 0xf; redirectedPath[0] = (void *)((uint)redirectedPath[0] & 0xffffff00); if (fileHandle != (int *)0x0) { RoomConfigMode::Clear(); (**(code **)(*fileHandle + 0x14))(&magic,1,4); if (magic == 0x31425453) { (**(code **)(*fileHandle + 0x14))((int)roomSet + 0x1c,4,1); if (*(int *)((int)roomSet + 0x1c) != 0) { KAGE_LogMessage(1,(byte *)"allocate %d rooms.\n"); uVar5 = *(uint *)((int)roomSet + 0x1c); puStack_74 = (uint *)0x0; allocSize = -(uint)((int)((ulonglong)uVar5 * 0x5c >> 0x20) != 0) | (uint)((ulonglong)uVar5 * 0x5c); puStack_74 = operator_new_tracked(-(uint)(0xfffffffb < allocSize) | allocSize + 4); local_14._0_1_ = 5; if (puStack_74 == (uint *)0x0) { puVar6 = (uint *)0x0; } else { *puStack_74 = uVar5; puVar6 = puStack_74 + 1; _eh_vector_constructor_iterator_ (puVar6,0x5c,uVar5,(_func_void_void_ptr *)&UNK_00828b20,RoomConfigRoom::dtor); } local_14._0_1_ = 3; *(uint **)((int)roomSet + 0x18) = puVar6; uVar5 = 0; if (*(int *)((int)roomSet + 0x1c) != 0) { puStack_74 = (uint *)0x0; do { ReadRoom(); *(uint *)(*(int *)((int)roomSet + 0x18) + 4 + (int)puStack_74) = local_78; RoomSet::GetVariantSet ((RoomSet *)roomSet, *(uint *)(*(int *)((int)roomSet + 0x18) + 8 + (int)puStack_74)); VariantRanges::Insert (*(undefined4 *)(*(int *)((int)roomSet + 0x18) + 0xc + (int)puStack_74)); iVar1 = *(int *)((int)roomSet + 0x18); switch(local_7c) { case 1: case 2: case 3: roomVariant = *(int *)((int)puStack_74 + iVar1 + 0xc); if ((roomVariant == 0x25b) || (roomVariant == 0x2cc)) { puVar6 = (uint *)((int)puStack_74 + iVar1 + 0x4c); *puVar6 = *puVar6 | 4; } break; case 0x1d: case 0x1e: if ((*(int *)((int)puStack_74 + iVar1 + 8) == 1) && (*(int *)((int)puStack_74 + iVar1 + 0x10) == 0x1f)) { puVar6 = (uint *)((int)puStack_74 + iVar1 + 0x4c); *puVar6 = *puVar6 | 2; } } puStack_74 = puStack_74 + 0x17; uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)roomSet + 0x1c)); } fileHandle = file; } (**(code **)*fileHandle)(1); ModManager::LoadModRooms(local_7c,local_78); *(undefined1 *)((int)roomSet + 0x28) = 1; isLoaded = 1; goto LAB_0082ae11; } } isLoaded = 0; LAB_0082ae11: if (0xf < uStack_40) { uVar5 = uStack_40 + 1; pvVar4 = tmpString; if (0xfff < uVar5) { pvVar4 = *(void **)((int)tmpString + -4); uVar5 = uStack_40 + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } ExceptionList = local_1c; return; } //@@ 0082aea0 RoomConfig::ReadRoom /* DB: src/rooms decompile labels (RoomConfig::ReadRoom(ecx=mode,edx=idx,stack:stageId,File*)) */ void __cdecl RoomConfig::ReadRoom(void) { ushort spawnCount; uint uVar1; uint *roomName; uint doorSlot; void *pvVar2; undefined4 *spawnInit; int in_ECX; uint *nameBuf; byte *entryCountPtr; char entryCountCopy; int in_EDX; int entryType; int *file; uint *room; int iVar3; undefined4 uStack00000004; int *in_stack_00000008; uint roomSubtype; uint roomType; uint spawnIndex; float entryWeight; uint roomWeight; uint roomVariant; undefined2 entrySubtype [2]; undefined2 entryVariant [2]; ushort entryTypeRaw [2]; undefined2 spawnY [2]; undefined2 spawnX [2]; uint local_24; int local_20; ushort nameLength [3]; byte roomShape; undefined1 roomHeight; undefined1 roomWidth; byte roomDifficulty; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte entryCount; file = in_stack_00000008; local_8 = 0xffffffff; puStack_c = &LAB_00b01c56; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(nameLength + 0xc); ExceptionList = &local_10; room = (uint *)(in_EDX * 0x5c + *(int *)(in_ECX + 0x18)); *room = uStack00000004; (**(code **)(*in_stack_00000008 + 0x14))(&roomType,4,1,uVar1); (**(code **)(*file + 0x14))(&roomVariant,4,1); (**(code **)(*file + 0x14))(&roomSubtype,4,1); (**(code **)(*file + 0x14))(&roomDifficulty,1,1); (**(code **)(*file + 0x14))(nameLength,2,1); roomName = room + 5; if (nameLength[0] == 0) { if (0xf < room[10]) { roomName = (uint *)*roomName; } room[9] = 0; *(char *)roomName = '\0'; } else { uVar1 = (uint)nameLength[0]; if (room[9] < uVar1) { std::string::append_n((char *)roomName,uVar1 - room[9],0); } else { nameBuf = roomName; if (0xf < room[10]) { nameBuf = (uint *)*roomName; } room[9] = uVar1; *(char *)((int)nameBuf + uVar1) = '\0'; } if (0xf < room[10]) { roomName = (uint *)*roomName; } (**(code **)(*file + 0x14))(roomName,1,nameLength[0]); } (**(code **)(*file + 0x14))(&roomWeight,4,1); (**(code **)(*file + 0x14))(&roomWidth,1,1); (**(code **)(*file + 0x14))(&roomHeight,1,1); (**(code **)(*file + 0x14))(&roomShape,1,1); room[2] = roomType; room[0x16] = roomVariant; room[3] = roomVariant; room[4] = roomSubtype; room[0xb] = (uint)roomDifficulty; room[0xd] = roomWeight; room[0xc] = roomWeight; *(undefined1 *)((int)room + 0x46) = roomWidth; *(undefined1 *)((int)room + 0x47) = roomHeight; room[0x12] = (uint)roomShape; room[0x13] = 0; (**(code **)(*file + 0x14))((int)&uStack00000004 + 3,1,1); (**(code **)(*file + 0x14))(room + 0x11,2,1); spawnCount = (ushort)room[0x11]; uVar1 = 0; if (uStack00000004._3_1_ != '\0') { do { (**(code **)(*file + 0x14))(&local_24,2,1); (**(code **)(*file + 0x14))(&local_20,2,1); (**(code **)(*file + 0x14))(&local_11,1,1); if (local_11 != 0) { doorSlot = get_door_from_position((short)local_24,(short)local_20,room[0x12]); if (-1 < (int)doorSlot) { if (7 < doorSlot) { LAB_0082b2de: /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } room[(doorSlot >> 5) + 0xe] = room[(doorSlot >> 5) + 0xe] | 1 << ((byte)doorSlot & 0x1f); } } uVar1 = uVar1 + 1; } while (uVar1 < uStack00000004 >> 0x18); spawnCount = (ushort)room[0x11]; } if (spawnCount != 0) { uVar1 = (uint)spawnCount; pvVar2 = operator_new_tracked(uVar1 * 0x10); if (pvVar2 == (void *)0x0) { pvVar2 = (void *)0x0; } else if (uVar1 != 0) { spawnInit = (undefined4 *)((int)pvVar2 + 4); do { spawnInit[-1] = 0; *spawnInit = 0; *(undefined1 *)(spawnInit + 1) = 0; spawnInit[2] = 0; uVar1 = uVar1 - 1; spawnInit = spawnInit + 4; } while (uVar1 != 0); } local_8 = 0xffffffff; room[0x10] = (uint)pvVar2; spawnIndex = 0; if ((short)room[0x11] != 0) { local_20 = 0; do { iVar3 = local_20; local_24 = room[0x10]; (**(code **)(*file + 0x14))(spawnX,2,1); (**(code **)(*file + 0x14))(spawnY,2,1); entryCountPtr = (byte *)(local_24 + 8 + iVar3); (**(code **)(*file + 0x14))(entryCountPtr,1,1); *(undefined2 *)(iVar3 + local_24) = spawnX[0]; *(undefined2 *)(iVar3 + 2 + local_24) = spawnY[0]; entryCount = *(byte *)(local_24 + 8 + iVar3); entryCountCopy = '\0'; if (entryCount != 0) { pvVar2 = operator_new_tracked((uint)entryCount * 0xc); entryCountCopy = *(char *)(iVar3 + 8 + local_24); *(void **)(iVar3 + 4 + local_24) = pvVar2; } uVar1 = 0; local_11 = 0; if (entryCountCopy != '\0') { do { iVar3 = *(int *)(local_20 + 4 + local_24); (**(code **)(*in_stack_00000008 + 0x14))(entryTypeRaw,2,1); (**(code **)(*in_stack_00000008 + 0x14))(entryVariant,2,1); (**(code **)(*in_stack_00000008 + 0x14))(entrySubtype,2,1); (**(code **)(*in_stack_00000008 + 0x14))(&entryWeight,4,1); *(uint *)(iVar3 + uVar1 * 0xc) = (uint)entryTypeRaw[0]; *(undefined2 *)(iVar3 + 4 + uVar1 * 0xc) = entryVariant[0]; *(undefined2 *)(iVar3 + 6 + uVar1 * 0xc) = entrySubtype[0]; *(float *)(iVar3 + 8 + uVar1 * 0xc) = entryWeight; *(float *)(local_20 + 0xc + local_24) = entryWeight + *(float *)(local_20 + 0xc + local_24); entryType = *(int *)(iVar3 + uVar1 * 0xc); if (entryType == 0x3ca) { if ((*(short *)(iVar3 + 4 + uVar1 * 0xc) == 2) && (doorSlot = get_door_from_position (*(short *)(local_20 + local_24), *(short *)(local_20 + 2 + local_24),room[0x12]), -1 < (int)doorSlot)) { if (doorSlot < 8) { room[(doorSlot >> 5) + 0xf] = room[(doorSlot >> 5) + 0xf] | 1 << ((byte)doorSlot & 0x1f); entryType = *(int *)(iVar3 + uVar1 * 0xc); goto LAB_0082b280; } goto LAB_0082b2de; } } else { LAB_0082b280: if ((entryType == 0x1194) && (*(short *)(iVar3 + 4 + uVar1 * 0xc) == 0)) { room[0x13] = room[0x13] | 0x80; } } local_11 = local_11 + 1; uVar1 = (uint)local_11; } while (local_11 < *entryCountPtr); file = in_stack_00000008; iVar3 = local_20; } local_20 = iVar3 + 0x10; spawnIndex = spawnIndex + 1; } while (spawnIndex < (ushort)room[0x11]); } } ExceptionList = local_10; return; } //@@ 0082b2f0 RoomConfig::LoadStagesXml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (RoomConfig::LoadStagesXml(path) thiscall ret4) prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall RoomConfig::LoadStagesXml(RoomConfig *destString,byte *path) { qword qVar1; byte bVar2; uint uVar3; int *file; int fileSize; byte *text; void *node; void *pvVar4; byte ****ppppbVar5; byte *strCursor; byte *literalCursor; std_string *valueLength; char *keyLiteral; byte *pbVar6; void **destString; qword *allocCounter; undefined4 *attr; bool isLess; int iStack_10198; void *stageName [4]; undefined4 uStack_10184; uint uStack_10180; void *playerSpotPath; undefined4 uStack_10178; undefined4 uStack_10174; undefined4 uStack_10170; undefined4 uStack_1016c; uint uStack_10168; void *bossSpotPath; undefined4 uStack_10160; undefined4 uStack_1015c; undefined4 uStack_10158; undefined4 uStack_10154; uint uStack_10150; void *stageSuffix [4]; undefined4 uStack_1013c; uint uStack_10138; void *normalMode; undefined4 uStack_10130; undefined4 uStack_1012c; undefined4 uStack_10128; void *greedMode; undefined4 uStack_10104; undefined4 uStack_10100; undefined4 uStack_100fc; undefined4 uStack_100f8; uint uStack_100f4; int musicId; int backdropId; undefined1 xmlDoc [48]; undefined1 auStack_100a0 [65564]; byte ****roomsRoot [4]; uint local_74; uint local_70; byte ****greedRoot [4]; uint local_5c; uint local_58; void *concatResult; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 local_44; uint uStack_40; byte ****bossGfxRoot [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ***local_14; puStack_20 = (undefined1 *)(bossGfxRoot + 0xe); local_14 = (byte ***)0xffffffff; puStack_18 = &LAB_00b01cdf; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(bossGfxRoot + 0xb); ExceptionList = &local_1c; local_24 = uVar3; file = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (file == (int *)0x0) { bVar2 = 0; } else { fileSize = (**(code **)(*file + 4))(uVar3); text = operator_new_tracked(fileSize + 1); (**(code **)(*file + 0x14))(text,1,fileSize); text[fileSize] = 0; (**(code **)*file)(1); FUN_00413b90(); local_14 = (byte ***)0x0; uVar3 = 0x82b3bf; pbVar6 = text; rapidxml::xml_document::parse(xmlDoc,text); bVar2 = (byte)pbVar6; node = xml_node::first_node(xmlDoc,(byte *)"stages",uVar3,bVar2); pvVar4 = xml_node::first_attribute(node,&DAT_00b66f40,uVar3,bVar2); if (pvVar4 == (void *)0x0) { pbVar6 = &DAT_00b6cbb4; } else { pbVar6 = &g_xmlNullStr; if (*(byte **)((int)pvVar4 + 4) != (byte *)0x0) { pbVar6 = *(byte **)((int)pvVar4 + 4); } } local_74 = 0; local_70 = 0xf; roomsRoot[0] = (byte ****)0x0; strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); uVar3 = (int)strCursor - (int)(pbVar6 + 1); std::string::assign((char *)roomsRoot,pbVar6,uVar3); local_14._0_1_ = 1; pvVar4 = xml_node::first_attribute(node,(byte *)"greedroot",(uint)pbVar6,(byte)uVar3); if (pvVar4 == (void *)0x0) { pbVar6 = (byte *)"rooms/greed/"; } else { pbVar6 = &g_xmlNullStr; if (*(byte **)((int)pvVar4 + 4) != (byte *)0x0) { pbVar6 = *(byte **)((int)pvVar4 + 4); } } local_5c = 0; local_58 = 0xf; greedRoot[0] = (byte ****)0x0; strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); uVar3 = (int)strCursor - (int)(pbVar6 + 1); std::string::assign((char *)greedRoot,pbVar6,uVar3); local_14._0_1_ = 2; pvVar4 = xml_node::first_attribute(node,(byte *)"bossgfxroot",(uint)pbVar6,(byte)uVar3); local_2c = 0; local_28 = 0xf; bossGfxRoot[0] = (byte ****)0x0; pbVar6 = &g_xmlNullStr; if (*(byte **)((int)pvVar4 + 4) != (byte *)0x0) { pbVar6 = *(byte **)((int)pvVar4 + 4); } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); uVar3 = (int)strCursor - (int)(pbVar6 + 1); std::string::assign((char *)bossGfxRoot,pbVar6,uVar3); for (node = xml_node::first_node(node,(byte *)"stage",(int)pbVar6,(byte)uVar3); node != (void *)0x0; node = *(void **)((int)node + 0x2c)) { uStack_10184 = 0; uStack_10180 = 0xf; stageName[0] = (void *)0x0; uStack_1016c = 0; uStack_10168 = 0xf; playerSpotPath = (void *)0x0; uStack_10154 = 0; uStack_10150 = 0xf; bossSpotPath = (void *)0x0; uStack_1013c = 0; uStack_10138 = 0xf; stageSuffix[0] = (void *)0x0; local_14._0_1_ = 7; _eh_vector_constructor_iterator_(&normalMode,0x2c,2,RoomConfigMode::ctor,RoomConfigMode::dtor) ; musicId = 0; backdropId = 0; local_14._0_1_ = 8; attr = *(undefined4 **)((int)node + 0x20); if (attr != (undefined4 *)0x0) { do { pbVar6 = (byte *)*attr; literalCursor = s_id; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < *literalCursor; if (bVar2 != *literalCursor) { LAB_0082b611: uVar3 = -(uint)isLess | 1; goto LAB_0082b616; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < literalCursor[1]; if (bVar2 != literalCursor[1]) goto LAB_0082b611; strCursor = strCursor + 2; literalCursor = literalCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082b616: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } iStack_10198 = atoi((char *)pbVar6); } else { literalCursor = s_name; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < *literalCursor; if (bVar2 != *literalCursor) { LAB_0082b670: uVar3 = -(uint)isLess | 1; goto LAB_0082b675; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < literalCursor[1]; if (bVar2 != literalCursor[1]) goto LAB_0082b670; literalCursor = literalCursor + 2; strCursor = strCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082b675: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); uVar3 = (int)strCursor - (int)(pbVar6 + 1); destString = stageName; LAB_0082bab2: std::string::assign((char *)destString,pbVar6,uVar3); } else { literalCursor = &DAT_00b66e0c; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < *literalCursor; if (bVar2 != *literalCursor) { LAB_0082b6d4: uVar3 = -(uint)isLess | 1; goto LAB_0082b6d9; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < literalCursor[1]; if (bVar2 != literalCursor[1]) goto LAB_0082b6d4; strCursor = strCursor + 2; literalCursor = literalCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082b6d9: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); valueLength = (std_string *)(strCursor + -(int)(pbVar6 + 1)); if ((std_string *)(0x7fffffff - local_74) < valueLength) { LAB_0082bd57: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar5 = (byte ****)roomsRoot; if (0xf < local_70) { ppppbVar5 = roomsRoot[0]; } std::string::concat((char *)&concatResult,(int)destString,valueLength,(byte *)ppppbVar5, local_74,pbVar6,(uint)valueLength); std::string::_Tidy_deallocate((char *)&normalMode); normalMode = concatResult; uStack_10130 = uStack_50; uStack_1012c = uStack_4c; uStack_10128 = uStack_48; pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); valueLength = (std_string *)(strCursor + -(int)(pbVar6 + 1)); if ((std_string *)(0x7fffffff - local_5c) < valueLength) goto LAB_0082bd57; ppppbVar5 = (byte ****)greedRoot; if (0xf < local_58) { ppppbVar5 = greedRoot[0]; } std::string::concat((char *)&concatResult,(int)destString,valueLength,(byte *)ppppbVar5, local_5c,pbVar6,(uint)valueLength); std::string::_Tidy_deallocate((char *)&greedMode); greedMode = concatResult; uStack_10104 = uStack_50; uStack_10100 = uStack_4c; uStack_100fc = uStack_48; uStack_100f8 = local_44; uStack_100f4 = uStack_40; } else { keyLiteral = "playerspot"; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < (byte)*keyLiteral; if (bVar2 != *keyLiteral) { LAB_0082b800: uVar3 = -(uint)isLess | 1; goto LAB_0082b805; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < (byte)keyLiteral[1]; if (bVar2 != keyLiteral[1]) goto LAB_0082b800; strCursor = strCursor + 2; keyLiteral = keyLiteral + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082b805: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); valueLength = (std_string *)(strCursor + -(int)(pbVar6 + 1)); if ((std_string *)(0x7fffffff - local_2c) < valueLength) goto LAB_0082bd57; ppppbVar5 = (byte ****)bossGfxRoot; if (0xf < local_28) { ppppbVar5 = bossGfxRoot[0]; } std::string::concat((char *)&concatResult,(int)destString,valueLength,(byte *)ppppbVar5, local_2c,pbVar6,(uint)valueLength); if (0xf < uStack_10168) { uVar3 = uStack_10168 + 1; pvVar4 = playerSpotPath; if (0xfff < uVar3) { pvVar4 = *(void **)((int)playerSpotPath + -4); uVar3 = uStack_10168 + 0x24; if (0x1f < (uint)((int)playerSpotPath + (-4 - (int)pvVar4))) goto LAB_0082bce0; } operator_delete(pvVar4,uVar3); } playerSpotPath = concatResult; uStack_10178 = uStack_50; uStack_10174 = uStack_4c; uStack_10170 = uStack_48; uStack_1016c = local_44; uStack_10168 = uStack_40; } else { keyLiteral = "bossspot"; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < (byte)*keyLiteral; if (bVar2 != *keyLiteral) { LAB_0082b8e6: uVar3 = -(uint)isLess | 1; goto LAB_0082b8eb; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < (byte)keyLiteral[1]; if (bVar2 != keyLiteral[1]) goto LAB_0082b8e6; strCursor = strCursor + 2; keyLiteral = keyLiteral + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082b8eb: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); valueLength = (std_string *)(strCursor + -(int)(pbVar6 + 1)); if ((std_string *)(0x7fffffff - local_2c) < valueLength) goto LAB_0082bd57; ppppbVar5 = (byte ****)bossGfxRoot; if (0xf < local_28) { ppppbVar5 = bossGfxRoot[0]; } std::string::concat((char *)&concatResult,(int)destString,valueLength, (byte *)ppppbVar5,local_2c,pbVar6,(uint)valueLength); if (0xf < uStack_10150) { uVar3 = uStack_10150 + 1; pvVar4 = bossSpotPath; if (0xfff < uVar3) { pvVar4 = *(void **)((int)bossSpotPath + -4); uVar3 = uStack_10150 + 0x24; if (0x1f < (uint)((int)bossSpotPath + (-4 - (int)pvVar4))) goto LAB_0082bce0; } operator_delete(pvVar4,uVar3); } bossSpotPath = concatResult; uStack_10160 = uStack_50; uStack_1015c = uStack_4c; uStack_10158 = uStack_48; uStack_10154 = local_44; uStack_10150 = uStack_40; } else { keyLiteral = "music"; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < (byte)*keyLiteral; if (bVar2 != *keyLiteral) { LAB_0082b9d0: uVar3 = -(uint)isLess | 1; goto LAB_0082b9d5; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < (byte)keyLiteral[1]; if (bVar2 != keyLiteral[1]) goto LAB_0082b9d0; keyLiteral = keyLiteral + 2; strCursor = strCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082b9d5: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } musicId = atoi((char *)pbVar6); } else { keyLiteral = "backdrop"; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < (byte)*keyLiteral; if (bVar2 != *keyLiteral) { LAB_0082ba30: uVar3 = -(uint)isLess | 1; goto LAB_0082ba35; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < (byte)keyLiteral[1]; if (bVar2 != keyLiteral[1]) goto LAB_0082ba30; keyLiteral = keyLiteral + 2; strCursor = strCursor + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082ba35: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } backdropId = atoi((char *)pbVar6); } else { keyLiteral = "suffix"; strCursor = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { strCursor = pbVar6; } do { bVar2 = *strCursor; isLess = bVar2 < (byte)*keyLiteral; if (bVar2 != *keyLiteral) { LAB_0082ba87: uVar3 = -(uint)isLess | 1; goto LAB_0082ba8c; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < (byte)keyLiteral[1]; if (bVar2 != keyLiteral[1]) goto LAB_0082ba87; strCursor = strCursor + 2; keyLiteral = keyLiteral + 2; } while (bVar2 != 0); uVar3 = 0; LAB_0082ba8c: if (uVar3 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } strCursor = pbVar6; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); uVar3 = (int)strCursor - (int)(pbVar6 + 1); destString = stageSuffix; goto LAB_0082bab2; } } } } } } } } } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); } RoomConfigStage::operator_assign(&iStack_10198); local_14._0_1_ = 9; _eh_vector_destructor_iterator_(&normalMode,0x2c,2,RoomConfigMode::dtor); if (0xf < uStack_10138) { uVar3 = uStack_10138 + 1; pvVar4 = stageSuffix[0]; if (0xfff < uVar3) { pvVar4 = *(void **)((int)stageSuffix[0] + -4); uVar3 = uStack_10138 + 0x24; if (0x1f < (uint)((int)stageSuffix[0] + (-4 - (int)pvVar4))) goto LAB_0082bce0; } operator_delete(pvVar4,uVar3); } uStack_1013c = 0; uStack_10138 = 0xf; stageSuffix[0] = (void *)((uint)stageSuffix[0] & 0xffffff00); if (0xf < uStack_10150) { uVar3 = uStack_10150 + 1; pvVar4 = bossSpotPath; if (0xfff < uVar3) { pvVar4 = *(void **)((int)bossSpotPath + -4); uVar3 = uStack_10150 + 0x24; if (0x1f < (uint)((int)bossSpotPath + (-4 - (int)pvVar4))) goto LAB_0082bce0; } operator_delete(pvVar4,uVar3); } uStack_10154 = 0; uStack_10150 = 0xf; bossSpotPath = (void *)((uint)bossSpotPath & 0xffffff00); if (0xf < uStack_10168) { uVar3 = uStack_10168 + 1; pvVar4 = playerSpotPath; if (0xfff < uVar3) { pvVar4 = *(void **)((int)playerSpotPath + -4); uVar3 = uStack_10168 + 0x24; if (0x1f < (uint)((int)playerSpotPath + (-4 - (int)pvVar4))) goto LAB_0082bce0; } operator_delete(pvVar4,uVar3); } uStack_1016c = 0; uStack_10168 = 0xf; playerSpotPath = (void *)((uint)playerSpotPath & 0xffffff00); if (0xf < uStack_10180) { uVar3 = uStack_10180 + 1; pvVar4 = stageName[0]; if (0xfff < uVar3) { pvVar4 = *(void **)((int)stageName[0] + -4); uVar3 = uStack_10180 + 0x24; if (0x1f < (uint)((int)stageName[0] + (-4 - (int)pvVar4))) goto LAB_0082bce0; } operator_delete(pvVar4,uVar3); } } local_14._0_1_ = 2; if (0xf < local_28) { uVar3 = local_28 + 1; ppppbVar5 = bossGfxRoot[0]; if (0xfff < uVar3) { ppppbVar5 = (byte ****)bossGfxRoot[0][-1]; uVar3 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)bossGfxRoot[0] + (-4 - (int)ppppbVar5))) goto LAB_0082bce0; } operator_delete(ppppbVar5,uVar3); } local_14._0_1_ = 1; if (0xf < local_58) { uVar3 = local_58 + 1; ppppbVar5 = greedRoot[0]; if (0xfff < uVar3) { ppppbVar5 = (byte ****)greedRoot[0][-1]; uVar3 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)greedRoot[0] + (-4 - (int)ppppbVar5))) goto LAB_0082bce0; } operator_delete(ppppbVar5,uVar3); } local_14._0_1_ = 0; if (0xf < local_70) { uVar3 = local_70 + 1; ppppbVar5 = roomsRoot[0]; if (0xfff < uVar3) { ppppbVar5 = (byte ****)roomsRoot[0][-1]; uVar3 = local_70 + 0x24; if ((byte *)0x1f < (byte *)((int)roomsRoot[0] + (-4 - (int)ppppbVar5))) { LAB_0082bce0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar5,uVar3); } local_14 = (byte ***)0xa; xml_memory_pool::clear(auStack_100a0); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar3 = *(uint *)(text + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free(text + -4); } bVar2 = 1; } ExceptionList = local_1c; return bVar2; } //@@ 0082bd60 RoomConfigStage::operator_assign /* DB: src/rooms decompile labels (RoomConfigStage::operator=(const&)) */ undefined4 * RoomConfigStage::operator_assign(undefined4 *param_1) { char cVar1; uint uVar2; int *piVar3; int *piVar4; int iVar5; int iVar6; int *piVar7; byte *pbVar8; uint *puVar9; undefined4 uVar10; undefined4 *in_ECX; uint *this; uint *puVar11; int local_8; *in_ECX = *param_1; pbVar8 = (byte *)(param_1 + 1); if ((byte *)(in_ECX + 1) != pbVar8) { if (0xf < (uint)param_1[6]) { pbVar8 = *(byte **)pbVar8; } std::string::assign((char *)(in_ECX + 1),pbVar8,param_1[5]); } pbVar8 = (byte *)(param_1 + 7); if ((byte *)(in_ECX + 7) != pbVar8) { if (0xf < (uint)param_1[0xc]) { pbVar8 = *(byte **)pbVar8; } std::string::assign((char *)(in_ECX + 7),pbVar8,param_1[0xb]); } pbVar8 = (byte *)(param_1 + 0xd); if ((byte *)(in_ECX + 0xd) != pbVar8) { if (0xf < (uint)param_1[0x12]) { pbVar8 = *(byte **)pbVar8; } std::string::assign((char *)(in_ECX + 0xd),pbVar8,param_1[0x11]); } pbVar8 = (byte *)(param_1 + 0x13); if ((byte *)(in_ECX + 0x13) != pbVar8) { if (0xf < (uint)param_1[0x18]) { pbVar8 = *(byte **)pbVar8; } std::string::assign((char *)(in_ECX + 0x13),pbVar8,param_1[0x17]); } this = in_ECX + 0x21; puVar11 = param_1 + 0x1d; local_8 = 2; do { if (this != puVar11 + 4) { puVar9 = puVar11 + -4; if (0xf < puVar11[1]) { puVar9 = (uint *)*puVar9; } std::string::assign((char *)(this + -8),(byte *)puVar9,*puVar11); } this[-2] = puVar11[2]; this[-1] = puVar11[3]; if (this != puVar11 + 4) { uVar2 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(uVar2 + 4)); *(uint *)(uVar2 + 4) = uVar2; *(uint *)uVar2 = uVar2; *(uint *)(uVar2 + 8) = uVar2; this[1] = 0; uVar10 = std::map::_Copy_nodes(*(undefined4 *)(puVar11[4] + 4),*this,param_1); *(undefined4 *)(*this + 4) = uVar10; piVar3 = (int *)*this; this[1] = *(uint *)((int)param_1 + (4 - (int)in_ECX) + (int)this); piVar4 = (int *)piVar3[1]; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar7 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar7 + 0xd); piVar4 = piVar7; piVar7 = (int *)*piVar7; } *piVar3 = (int)piVar4; iVar5 = *(int *)(*this + 4); iVar6 = *(int *)(iVar5 + 8); cVar1 = *(char *)(iVar6 + 0xd); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar6 + 8) + 0xd); iVar5 = iVar6; iVar6 = *(int *)(iVar6 + 8); } *(int *)(*this + 8) = iVar5; } else { *piVar3 = (int)piVar3; *(uint *)(*this + 8) = *this; } } puVar9 = puVar11 + 6; puVar11 = puVar11 + 0xb; *(char *)(this + 2) = (char)*puVar9; this = this + 0xb; local_8 = local_8 + -1; } while (local_8 != 0); in_ECX[0x2f] = param_1[0x2f]; in_ECX[0x30] = param_1[0x30]; return in_ECX; } //@@ 0082bf00 RoomConfig::LoadCursesXml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (RoomConfig::LoadCursesXml(path,flag)?) prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall RoomConfig::LoadCursesXml(RoomConfig *this,byte *path,byte isAppend) { std_vector *psVar1; void **ppvVar2; qword qVar3; byte bVar4; uint curseCount; byte *pbVar6; int *piVar7; int iVar8; void *node; byte ****text; byte *expectedAttrChar; byte ****ppppbVar9; qword *allocCounter; byte *pbVar10; bool isCharLess; byte *pbStack_1007c; int curseId; byte ****curseName [4]; uint uStack_10064; uint uStack_10060; undefined1 xmlDoc [48]; undefined1 xmlPool [65564]; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 *attribute; uint curseCount; void *cursesBegin; local_8 = 0xffffffff; puStack_c = &LAB_00b01d2b; local_10 = ExceptionList; curseCount = __security_cookie ^ (uint)(xmlPool + 0x10028); ExceptionList = &local_10; if (isAppend != 0) goto LAB_0082c007; pbVar6 = (this->_curses)._end; psVar1 = &this->_curses; pbVar10 = psVar1->_begin; if (pbVar10 != pbVar6) { do { std::string::_Tidy_deallocate((char *)(pbVar10 + 4)); pbVar10 = pbVar10 + 0x1c; } while (pbVar10 != pbVar6); pbVar10 = psVar1->_begin; } (this->_curses)._end = pbVar10; curseCount = ((int)pbVar10 - (int)psVar1->_begin) / 0x1c; if (curseCount < 10) { if (8 < curseCount) goto LAB_0082c007; iVar8 = (int)(this->_curses)._capacity - (int)psVar1->_begin; if ((uint)(iVar8 / 0x1c) < 9) { FUN_0082e650(iVar8,&pbStack_1007c); goto LAB_0082c007; } pbVar6 = (byte *)FUN_0082e340(pbVar10,9 - curseCount,pbStack_1007c); } else { pbVar6 = (byte *)((int)psVar1->_begin + 0xfc); pbStack_1007c = pbVar6; if (pbVar6 != pbVar10) { do { std::string::_Tidy_deallocate((char *)(pbVar6 + 4)); pbVar6 = pbVar6 + 0x1c; } while (pbVar6 != pbVar10); pbVar6 = pbStack_1007c; } } (this->_curses)._end = pbVar6; LAB_0082c007: piVar7 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (piVar7 == (int *)0x0) { bVar4 = 0; } else { iVar8 = (**(code **)(*piVar7 + 4))(curseCount); pbVar6 = operator_new_tracked(iVar8 + 1); pbStack_1007c = pbVar6; (**(code **)(*piVar7 + 0x14))(pbVar6,1,iVar8); pbVar6[iVar8] = 0; (**(code **)*piVar7)(1); FUN_00413b90(); local_8 = 0; iVar8 = 0x82c073; rapidxml::xml_document::parse(xmlDoc,pbVar6); bVar4 = (byte)pbVar6; node = xml_node::first_node(xmlDoc,(byte *)"curses",iVar8,bVar4); for (node = xml_node::first_node(node,(byte *)"curse",iVar8,bVar4); node != (void *)0x0; node = *(void **)((int)node + 0x2c)) { uStack_10064 = 0; uStack_10060 = 0xf; curseName[0] = (byte ****)0x0; curseCount = local_8 >> 8; local_8 = CONCAT31((int3)curseCount,1); for (attribute = *(undefined4 **)((int)node + 0x20); attribute != (undefined4 *)0x0; attribute = (undefined4 *)attribute[6]) { pbVar6 = (byte *)*attribute; expectedAttrChar = s_id; pbVar10 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar10 = pbVar6; } do { bVar4 = *pbVar10; isCharLess = bVar4 < *expectedAttrChar; if (bVar4 != *expectedAttrChar) { LAB_0082c105: curseCount = -(uint)isCharLess | 1; goto LAB_0082c10a; } if (bVar4 == 0) break; bVar4 = pbVar10[1]; isCharLess = bVar4 < expectedAttrChar[1]; if (bVar4 != expectedAttrChar[1]) goto LAB_0082c105; pbVar10 = pbVar10 + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar4 != 0); curseCount = 0; LAB_0082c10a: if (curseCount == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar6 = (byte *)attribute[1]; } curseId = atoi((char *)pbVar6); } else { expectedAttrChar = s_name; pbVar10 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar10 = pbVar6; } do { bVar4 = *pbVar10; isCharLess = bVar4 < *expectedAttrChar; if (bVar4 != *expectedAttrChar) { LAB_0082c160: curseCount = -(uint)isCharLess | 1; goto LAB_0082c165; } if (bVar4 == 0) break; bVar4 = pbVar10[1]; isCharLess = bVar4 < expectedAttrChar[1]; if (bVar4 != expectedAttrChar[1]) goto LAB_0082c160; pbVar10 = pbVar10 + 2; expectedAttrChar = expectedAttrChar + 2; } while (bVar4 != 0); curseCount = 0; LAB_0082c165: if (curseCount == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar6 = (byte *)attribute[1]; } pbVar10 = pbVar6; do { bVar4 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar4 != 0); std::string::assign((char *)curseName,pbVar6,(int)pbVar10 - (int)(pbVar6 + 1)); } } if (attribute[4] == 0) break; } if (isAppend == 0) { cursesBegin = (this->_curses)._begin; *(int *)((int)cursesBegin + curseId * 0x1c) = curseId; ppppbVar9 = (byte ****)((int)cursesBegin + curseId * 0x1c + 4); if ((byte *****)ppppbVar9 != curseName) { text = (byte ****)curseName; if (0xf < uStack_10060) { text = curseName[0]; } std::string::assign((char *)ppppbVar9,(byte *)text,uStack_10064); } } else { piVar7 = (this->_curses)._end; curseId = ((int)piVar7 - (int)(this->_curses)._begin) / 0x1c; if (piVar7 == (this->_curses)._capacity) { FUN_0082e0e0(piVar7,&curseId); } else { *piVar7 = curseId; std::string::string((char *)(piVar7 + 1),curseName); ppvVar2 = &(this->_curses)._end; *ppvVar2 = (void *)((int)*ppvVar2 + 0x1c); } } local_8 = local_8 & 0xffffff00; if (0xf < uStack_10060) { curseCount = uStack_10060 + 1; ppppbVar9 = curseName[0]; if (0xfff < curseCount) { ppppbVar9 = (byte ****)curseName[0][-1]; curseCount = uStack_10060 + 0x24; if ((byte *)0x1f < (byte *)((int)curseName[0] + (-4 - (int)ppppbVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar9,curseCount); } } local_8 = 2; xml_memory_pool::clear(xmlPool); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (pbStack_1007c != (byte *)0x0) { curseCount = *(uint *)(pbStack_1007c + -4); qVar3 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - curseCount; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar3 < curseCount); free(pbStack_1007c + -4); } bVar4 = 1; } ExceptionList = local_10; return bVar4; } //@@ 0082c310 Game::LoadMinibossesXml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? 'minibosses'/'miniboss' xml parse */ undefined4 Game::LoadMinibossesXml(byte *param_1) { qword qVar1; uint uVar2; int *file; undefined4 isLoaded; int iVar3; byte *text; void *node; byte *pbVar4; byte *****text_00; int in_ECX; byte *pbVar5; byte *pbVar6; byte *****pppppbVar7; qword *allocatedBytes; bool bVar8; byte 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; uVar2 = __security_cookie ^ (uint)(xmlMemoryPool + 0x10028); ExceptionList = &local_10; file = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (file == (int *)0x0) { isLoaded = 0; } else { iVar3 = (**(code **)(*file + 4))(uVar2); text = operator_new_tracked(iVar3 + 1); (**(code **)(*file + 0x14))(text,1,iVar3); text[iVar3] = 0; (**(code **)*file)(1); FUN_00413b90(); local_8 = 0; iVar3 = 0x82c3b7; pbVar6 = text; rapidxml::xml_document::parse(xmlDocument,text); bVar9 = (byte)pbVar6; node = xml_node::first_node(xmlDocument,(byte *)"minibosses",iVar3,bVar9); for (node = xml_node::first_node(node,(byte *)"miniboss",iVar3,bVar9); node != (void *)0x0; node = *(void **)((int)node + 0x2c)) { minibossNameSize = 0; minibossNameCapacity = 0xf; minibossName[0] = (byte *****)0x0; uVar2 = local_8 >> 8; local_8 = CONCAT31((int3)uVar2,1); for (attribute = *(undefined4 **)((int)node + 0x20); attribute != (undefined4 *)0x0; attribute = (undefined4 *)attribute[6]) { pbVar6 = (byte *)*attribute; pbVar5 = s_id; pbVar4 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; } do { bVar9 = *pbVar4; bVar8 = bVar9 < *pbVar5; if (bVar9 != *pbVar5) { LAB_0082c456: uVar2 = -(uint)bVar8 | 1; goto LAB_0082c45b; } if (bVar9 == 0) break; bVar9 = pbVar4[1]; bVar8 = bVar9 < pbVar5[1]; if (bVar9 != pbVar5[1]) goto LAB_0082c456; pbVar4 = pbVar4 + 2; pbVar5 = pbVar5 + 2; } while (bVar9 != 0); uVar2 = 0; LAB_0082c45b: if (uVar2 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar6 = (byte *)attribute[1]; } minibossId = atoi((char *)pbVar6); } else { pbVar5 = s_name; pbVar4 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; } do { bVar9 = *pbVar4; bVar8 = bVar9 < *pbVar5; if (bVar9 != *pbVar5) { LAB_0082c4b0: uVar2 = -(uint)bVar8 | 1; goto LAB_0082c4b5; } if (bVar9 == 0) break; bVar9 = pbVar4[1]; bVar8 = bVar9 < pbVar5[1]; if (bVar9 != pbVar5[1]) goto LAB_0082c4b0; pbVar4 = pbVar4 + 2; pbVar5 = pbVar5 + 2; } while (bVar9 != 0); uVar2 = 0; LAB_0082c4b5: if (uVar2 == 0) { pbVar6 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar6 = (byte *)attribute[1]; } pbVar4 = pbVar6; do { bVar9 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar9 != 0); std::string::assign((char *)minibossName,pbVar6,(int)pbVar4 - (int)(pbVar6 + 1)); } } if (attribute[4] == 0) break; } if (minibossId < 0x10) { *(uint *)(in_ECX + 0x1c60 + minibossId * 0x1c) = minibossId; pppppbVar7 = (byte *****)(in_ECX + (minibossId * 7 + 0x719) * 4); if ((byte ******)pppppbVar7 != minibossName) { text_00 = (byte *****)minibossName; if (0xf < minibossNameCapacity) { text_00 = minibossName[0]; } std::string::assign((char *)pppppbVar7,(byte *)text_00,minibossNameSize); } } local_8 = local_8 & 0xffffff00; if (0xf < minibossNameCapacity) { uVar2 = minibossNameCapacity + 1; pppppbVar7 = minibossName[0]; if (0xfff < uVar2) { pppppbVar7 = (byte *****)minibossName[0][-1]; uVar2 = minibossNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)minibossName[0] + (-4 - (int)pppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar7,uVar2); } } if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar2 = *(uint *)(text + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar2; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < uVar2); free(text + -4); } local_8 = 3; xml_memory_pool::clear(xmlMemoryPool); isLoaded = 1; } ExceptionList = local_10; return isLoaded; } //@@ 0082c600 Level::GetCurseNameByIdx /* DB: looks up curse name string, translating '#' keys in "Curses" table */ char * Level::GetCurseNameByIdx(char *param_1,uint param_2) { byte bVar1; int iVar2; Manager *pMVar3; int in_ECX; byte *pbVar4; byte *text; pMVar3 = g_manager; if (param_2 != 0) { iVar2 = *(int *)(in_ECX + 0x1c54); if (param_2 < (uint)((*(int *)(in_ECX + 0x1c58) - iVar2) / 0x1c)) { if (*(int *)(iVar2 + 0x14 + param_2 * 0x1c) == 0) { text = &s_empty; } else { text = (byte *)(iVar2 + 4 + param_2 * 0x1c); if (0xf < *(uint *)(iVar2 + 0x18 + param_2 * 0x1c)) { text = *(byte **)text; } iVar2 = *(int *)&g_manager->_stringTable; if (*text == 0x23) { param_2 = param_2 & 0xffffff; StringTable::get_string (&g_manager->_stringTable,(byte *)"Curses",iVar2,text + 1, (byte *)((int)¶m_2 + 3)); if (param_2._3_1_ == '\0') { param_2 = param_2 & 0xffffff; text = StringTable::get_string (&pMVar3->_stringTable,(byte *)"Curses",iVar2,text + 1, (byte *)((int)¶m_2 + 3)); } } } param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; pbVar4 = text; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign(param_1,text,(int)pbVar4 - (int)(text + 1)); return param_1; } } param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; *param_1 = '\0'; return param_1; } //@@ 0082c720 RoomConfig::GetRoomByStageTypeAndVariant /* DB: src/rooms labels; ZHL said ResetRoomWeights prototype: REPENTOGON, confirmed by RET 16 */ RoomConfig_Room * __thiscall RoomConfig::GetRoomByStageTypeAndVariant (RoomConfig *this,uint stage,uint type,uint variant,int mode) { RoomConfig_Room *pRVar1; uint uVar2; int iVar3; if (mode == -1) { if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { mode = 0; } else { mode = 1; } } iVar3 = mode * 0x2c; if ((&this->field_0x8c)[iVar3 + stage * 0xc4] == '\0') { LoadStageBinary(this,stage,mode); } uVar2 = 0; if (*(uint *)(&this->field_0x80 + iVar3 + stage * 0xc4) != 0) { pRVar1 = *(RoomConfig_Room **)(&this->field_0x7c + iVar3 + stage * 0xc4); do { if ((pRVar1->Type == type) && (pRVar1->Variant == variant)) { return pRVar1; } uVar2 = uVar2 + 1; pRVar1 = pRVar1 + 1; } while (uVar2 < *(uint *)(&this->field_0x80 + iVar3 + stage * 0xc4)); } KAGE_LogMessage(1,(byte *)"[warn] StageID %d Room type %d, variant %d not found!\n"); return (RoomConfig_Room *)0x0; } //@@ 0082c7d0 RoomConfig::GetRandomRoom /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall RoomConfig_Room* RoomConfig::GetRandomRoom(unsigned int seed, bool reduceWeight, int stage, int roomType, int roomShape, unsigned int minVariant, int maxVariant, int minDifficulty, int maxDifficulty, unsigned int* requiredDoors, unsigned int roomSubtype, int mode); prototype: REPENTOGON, confirmed by RET 48 */ RoomConfig_Room * __thiscall RoomConfig::GetRandomRoom (RoomConfig *this,uint seed,byte reduceWeight,int stage,int roomType,int roomShape, uint minVariant,int maxVariant,int minDifficulty,int maxDifficulty,uint *requiredDoors, uint roomSubtype,int mode) { code *pcVar1; char isDoorsRequired; uint uVar2; uint preventedCurses; RoomConfig_Room *pRVar3; int **collectedRooms; int *piVar4; void *freePtr; int *extraout_EDX; int *piVar5; int *piVar6; int *_Dst; size_t _Size; int *candidateIt; float fVar7; float runningWeight; undefined1 auVar8 [12]; RoomConfig *pRVar9; float fVar10; int *in_stack_ffffff64; int *piVar11; int *roomsBegin; int *roomsEnd; float local_60; float local_5c; int *local_58; int *local_54; int *local_50; float local_4c; uint local_48; uint *requiredDoorsPtr; int *roomIt; float local_3c; byte isReduceWeight; RoomConfig *local_34; int *local_30; void *doorsText [3]; undefined8 local_20; uint doorsTextCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; int curses; int debugCurses; RoomConfig *roomConfig; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b01ddd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(doorsText + 10); ExceptionList = &local_10; local_4c = (float)seed; isReduceWeight = reduceWeight; local_30 = (int *)CONCAT31(local_30._1_3_,reduceWeight); local_48 = stage; local_3c = (float)mode; requiredDoorsPtr = requiredDoors; debugCurses = g_game->_debugCurses; curses = g_game->_curses; local_34 = this; uVar2 = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); pRVar9 = local_34; if ((char)(~(byte)preventedCurses & ((byte)uVar2 | (byte)debugCurses | (byte)curses)) < '\0') { local_20 = 0x1500000002; if (local_4c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pRVar3 = (RoomConfig_Room *)(*pcVar1)(); return pRVar3; } uVar2 = (uint)local_4c >> 2 ^ (uint)local_4c; if (((uVar2 >> 9 ^ uVar2) & 1) == 0) { in_stack_ffffff64 = (int *)roomSubtype; pRVar3 = (RoomConfig_Room *) GetRandomSplitRoom(local_4c,local_30,local_48,roomType,roomShape,minVariant, maxVariant,minDifficulty,maxDifficulty,requiredDoors,roomSubtype, local_3c); if (pRVar3 != (RoomConfig_Room *)0x0) { ExceptionList = local_10; return pRVar3; } } } piVar6 = local_30; roomConfig = local_34; _Dst = (int *)0x0; fVar7 = 0.0; roomIt = (int *)0x0; roomsBegin = (int *)0x0; roomsEnd = (int *)0x0; local_5c = 0.0; local_60 = 0.0; local_8 = (void *)0x0; if (((g_game->_stage == 0xc) && (local_48 != 0)) && (local_48 != 0x23)) { uVar2 = 1; do { if (uVar2 != 0xd) { CollectRooms(roomConfig,&local_58,uVar2,roomType,roomShape,minVariant,maxVariant, minDifficulty,0x14,requiredDoorsPtr,roomSubtype,(int)local_3c); local_8._0_1_ = 1; in_stack_ffffff64 = local_54; std::vector<4byte>::insert_range(roomsEnd,local_58,local_54,piVar6); local_8 = (void *)((uint)local_8._1_3_ << 8); FID_conflict__Tidy(&local_58); } uVar2 = uVar2 + 1; } while (uVar2 < 0x12); local_5c = local_60; roomIt = roomsBegin; _Dst = roomsBegin; fVar7 = local_60; } else { collectedRooms = CollectRooms(pRVar9,&local_58,local_48,roomType,roomShape,minVariant,maxVariant, minDifficulty,maxDifficulty,requiredDoorsPtr,roomSubtype,(int)local_3c); local_8 = (void *)CONCAT31(local_8._1_3_,2); in_stack_ffffff64 = (int *)roomSubtype; if (&roomsBegin != collectedRooms) { local_30 = *collectedRooms; _Size = (int)collectedRooms[1] - (int)local_30; if ((int)_Size >> 2 != 0) { std::vector::reserve_clear((int)_Size >> 2); local_5c = local_60; roomIt = roomsBegin; _Dst = roomsBegin; fVar7 = local_60; } in_stack_ffffff64 = local_30; memmove(_Dst,local_30,_Size); roomsEnd = (int *)((int)_Dst + _Size); } FID_conflict__Tidy(&local_58); } local_58 = (int *)0x0; local_54 = (int *)0x0; local_50 = (int *)0x0; local_8 = (void *)CONCAT31(local_8._1_3_,3); if (_Dst != roomsEnd) { piVar6 = (int *)0x0; pRVar9 = (RoomConfig *)0x0; fVar10 = 0.0; local_34 = (RoomConfig *)0x0; piVar4 = roomsEnd; candidateIt = _Dst; do { fVar10 = fVar10 + *(float *)(*candidateIt + 0x34); piVar11 = (int *)0x82ca51; local_3c = fVar10; isDoorsRequired = std::bitset<8>::any(); piVar5 = extraout_EDX; if (isDoorsRequired != '\0') { piVar4 = roomsEnd; if (*(uint *)(*candidateIt + 0x38) == *requiredDoorsPtr) { if (piVar6 == extraout_EDX) { piVar11 = candidateIt; std::vector::_Emplace_reallocate(piVar6,candidateIt); piVar5 = local_50; fVar10 = local_3c; in_stack_ffffff64 = piVar6; } else { *piVar6 = *candidateIt; local_54 = piVar6 + 1; piVar5 = extraout_EDX; local_34 = pRVar9; } pRVar9 = (RoomConfig *)((float)local_34 + *(float *)(*candidateIt + 0x34)); piVar6 = local_54; local_34 = pRVar9; } } _Dst = roomIt; fVar7 = local_5c; candidateIt = candidateIt + 1; } while (candidateIt != piVar4); local_30 = piVar5; if (0.0 < fVar10) { local_20 = 0x1500000001; local_48 = 0x14; if (local_4c == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pRVar3 = (RoomConfig_Room *)(*pcVar1)(); return pRVar3; } uVar2 = (uint)local_4c >> 1 ^ (uint)local_4c; uVar2 = uVar2 << 0x15 ^ uVar2; piVar6 = (int *)(uVar2 >> 0x14 ^ uVar2); local_5c = (float)((double)(int)piVar6 + __uint_to_double_fixup[-((int)piVar6 >> 0x1f)]) * 2.3283062e-10; local_4c = ((float)pRVar9 / fVar10) * 9.99; if (local_58 == local_54) { LAB_0082cd3d: if (roomIt != roomsEnd) { runningWeight = 0.0; do { pRVar3 = (RoomConfig_Room *)*roomIt; runningWeight = runningWeight + pRVar3->Weight; if (local_5c * fVar10 < runningWeight) goto LAB_0082cd6a; roomIt = roomIt + 1; } while (roomIt != roomsEnd); } } else { if (piVar6 == (int *)0x0) { roomIt = piVar6; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pRVar3 = (RoomConfig_Room *)(*pcVar1)(); return pRVar3; } uVar2 = (uint)piVar6 >> 1 ^ (uint)piVar6; uVar2 = uVar2 << 0x15 ^ uVar2; uVar2 = uVar2 >> 0x14 ^ uVar2; if (local_4c <= (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283062e-10) goto LAB_0082cd3d; if (local_58 != local_54) { fVar10 = 0.0; piVar4 = local_58; do { pRVar3 = (RoomConfig_Room *)*piVar4; fVar10 = fVar10 + pRVar3->Weight; if (local_5c * (float)pRVar9 < fVar10) goto LAB_0082cd6a; piVar4 = piVar4 + 1; } while (piVar4 != local_54); } } pRVar3 = (RoomConfig_Room *)0x0; goto LAB_0082ccd5; } std::bitset<8>::to_string(doorsText,in_stack_ffffff64,piVar11); local_8 = (void *)CONCAT31(local_8._1_3_,4); KAGE_LogMessage(1,(byte *) "[warn] GetRandomRoom: unable to find matching room \t\t\t\t(seed %x, StageID %d, Type %d, Shape %d, MinVariant %d, MaxVariant %d, MinDifficulty %d, MaxDifficulty %d, RequiredDoors %s, Subtype %d, \t\t\t\treturning NULL\n" ); if (0xf < doorsTextCapacity) { uVar2 = doorsTextCapacity + 1; freePtr = doorsText[0]; if (0xfff < uVar2) { freePtr = *(void **)((int)doorsText[0] + -4); uVar2 = doorsTextCapacity + 0x24; if (0x1f < (uint)((int)doorsText[0] + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar2); } if (local_58 != (int *)0x0) { uVar2 = (int)local_30 - (int)local_58 & 0xfffffffc; piVar6 = local_58; if (0xfff < uVar2) { piVar6 = (int *)local_58[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_58 + (-4 - (int)piVar6))) goto LAB_0082cd33; } operator_delete(piVar6,uVar2); } } if (_Dst != (int *)0x0) { uVar2 = (int)fVar7 - (int)_Dst & 0xfffffffc; piVar6 = _Dst; if (0xfff < uVar2) { piVar6 = (int *)_Dst[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)_Dst + (-4 - (int)piVar6))) { LAB_0082cd33: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar6,uVar2); } ExceptionList = local_10; return (RoomConfig_Room *)0x0; LAB_0082cd6a: if ((pRVar3 != (RoomConfig_Room *)0x0) && (isReduceWeight != 0)) { fVar10 = pRVar3->Weight * 0.1; auVar8 = ZEXT812(0x33d6bf95); if (auVar8._0_4_ <= fVar10) { auVar8._4_8_ = auVar8._4_8_; auVar8._0_4_ = fVar10; } pRVar3->Weight = auVar8._0_4_; } LAB_0082ccd5: roomIt = piVar6; if (local_58 != (int *)0x0) { uVar2 = (int)piVar5 - (int)local_58 & 0xfffffffc; piVar4 = local_58; if (0xfff < uVar2) { piVar4 = (int *)local_58[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_58 + (-4 - (int)piVar4))) goto LAB_0082cd33; } operator_delete(piVar4,uVar2); } if (_Dst != (int *)0x0) { uVar2 = (int)fVar7 - (int)_Dst & 0xfffffffc; piVar6 = _Dst; if (0xfff < uVar2) { piVar6 = (int *)_Dst[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)_Dst + (-4 - (int)piVar6))) goto LAB_0082cd33; } operator_delete(piVar6,uVar2); } ExceptionList = local_10; return pRVar3; } //@@ 0082cdd0 RoomConfig::GetRandomRoomWithFallbackStage /* DB: src/rooms decompile labels (RoomConfig::GetRandomRoomWithFallbackStage? ret34) prototype: db/protos.zhl, confirmed by RET 52 */ void * __thiscall RoomConfig::GetRandomRoomWithFallbackStage (RoomConfig *this,uint seed,byte isReduceWeight,int stage,int fallbackStage,int roomType, int roomShape,uint minVariant,int maxVariant,int minDifficulty,int maxDifficulty, uint *requiredDoors,uint roomSubtype,int mode) { RoomConfig_Room *pRVar1; pRVar1 = GetRandomRoom(this,seed,isReduceWeight,stage,roomType,roomShape,0,-1,minDifficulty, maxDifficulty,requiredDoors,roomSubtype,-1); if (pRVar1 == (RoomConfig_Room *)0x0) { pRVar1 = GetRandomRoom(this,seed,isReduceWeight,fallbackStage,roomType,roomShape,0,-1, minDifficulty,maxDifficulty,requiredDoors,roomSubtype,-1); } return pRVar1; } //@@ 0082ce40 RoomConfig::CollectRooms /* DB: src/rooms decompile labels (RoomConfig::CollectRooms(out vector,stageId,type,shape,minVar,maxVar,minDiff,maxDiff,doors*,subtype,mode) ret2c) prototype: db/protos.zhl, confirmed by RET 44 */ void * __thiscall RoomConfig::CollectRooms (RoomConfig *this,void *outRooms,uint stageId,int roomType,int shape,uint minVariant, uint maxVariant,int minDifficulty,int maxDifficulty,uint *doorMask,int subType,int mode) { int *piVar1; Game *pGVar2; int iVar3; undefined1 local_28 [8]; void *local_20; int local_1c [2]; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b01e2e; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; local_1c[1] = 0; if (mode == -1) { if ((g_game == (Game *)0x0) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) { mode = 0; } else { mode = 1; } } local_14 = &this->field_0x64 + mode * 0x2c + stageId * 0xc4; if (local_14[0x28] == '\0') { LoadStageBinary(this,stageId,mode); } *(undefined4 *)outRooms = 0; *(undefined4 *)((int)outRooms + 4) = 0; *(undefined4 *)((int)outRooms + 8) = 0; local_8 = 0; local_1c[1] = 1; mode = 0; if (*(int *)(local_14 + 0x1c) != 0) { stageId = 0; do { pGVar2 = g_game; iVar3 = *(int *)(local_14 + 0x18) + stageId; if ((((*(int *)(iVar3 + 8) == roomType) && (((shape == 0xd || (shape == *(int *)(iVar3 + 0x48))) && (minVariant <= *(uint *)(iVar3 + 0xc))))) && (((*(uint *)(iVar3 + 0xc) <= maxVariant && (minDifficulty <= *(int *)(iVar3 + 0x2c))) && (*(int *)(iVar3 + 0x2c) <= maxDifficulty)))) && (((*doorMask & *(uint *)(iVar3 + 0x38)) == *doorMask && ((subType == -1 || (*(int *)(iVar3 + 0x10) == subType)))))) { local_1c[0] = 0x4f; std::set::find_node(local_28,local_1c); if ((*(char *)((int)local_20 + 0xd) != '\0') || (((0x4f < *(int *)((int)local_20 + 0x10) || (local_20 == (pGVar2->_seedEffects)._seedEffects)) || ((*(byte *)(iVar3 + 0x4c) & 0x80) == 0)))) { piVar1 = *(int **)((int)outRooms + 4); if (piVar1 == *(int **)((int)outRooms + 8)) { local_1c[0] = iVar3; std::vector::_Emplace_reallocate(piVar1,local_1c); } else { *piVar1 = iVar3; *(int *)((int)outRooms + 4) = *(int *)((int)outRooms + 4) + 4; } } } mode = mode + 1; stageId = stageId + 0x5c; } while ((uint)mode < *(uint *)(local_14 + 0x1c)); } ExceptionList = local_10; return outRooms; } //@@ 0082d000 RoomConfig::GetStageDisplayName /* DB: src/rooms decompile labels (RoomConfig::GetStageDisplayName(out,stageId,?)) */ std_string * RoomConfig::GetStageDisplayName(std_string *param_1,int param_2,int param_3) { int in_ECX; RoomConfigStage::GetDisplayName((RoomConfig_Stage *)(param_2 * 0xc4 + in_ECX),param_1,param_3); return param_1; } //@@ 0082d030 RoomConfig::GetStageID /* ZHL [exact] static cleanup unsigned int RoomConfig::GetStageID(unsigned int LevelStage, unsigned int StageType, unsigned int Mode); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ uint __cdecl RoomConfig::GetStageID(uint levelStage,uint stageType,int mode) { uint uVar1; if (mode == -1) { if ((g_game != (Game *)0x0) && ((g_game->_difficulty == 2 || (g_game->_difficulty == 3)))) { LAB_0082d065: if (levelStage == 7) { return 0x19; } if (levelStage == 6) { return 0x18; } if (levelStage == 5) { return 0xe; } if (stageType == 4) { return levelStage * 2 + 0x19; } if (stageType == 5) { return levelStage * 2 + 0x1a; } return stageType + levelStage * 3 + -2; } } else if (mode == 1) goto LAB_0082d065; if (levelStage == 0xd) { return 0x23; } if (8 < (int)levelStage) { if (levelStage == 9) { uVar1 = 0xd; if (stageType == 4) { uVar1 = 0x24; } return uVar1; } if (levelStage == 0xc) { return 0x1a; } return stageType + (levelStage - 3) * 2; } if (stageType == 4) { return (levelStage - 1 & 0xfffffffe) + 0x1b; } uVar1 = levelStage - 1 >> 1; if (stageType == 5) { return uVar1 * 2 + 0x1c; } return stageType + 1 + uVar1 * 3; } //@@ 0082d100 RoomConfig::GetStageIdByName /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (RoomConfig::GetStageIdByName?(std::string*)) */ undefined4 RoomConfig::GetStageIdByName(void) { byte bVar1; undefined1 *puVar2; byte *pbVar3; uint *puVar4; byte *pbVar5; int iVar6; byte *in_ECX; void *ptr; undefined1 *puVar7; uint uVar8; undefined4 uVar9; undefined1 *local_34; int local_30; void *local_2c [3]; undefined1 local_20 [4]; undefined4 local_1c; undefined1 *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01e65; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; local_34 = (undefined1 *)0x0; local_30 = 0; local_34 = operator_new(0x2c); *(undefined1 **)local_34 = local_34; *(undefined1 **)(local_34 + 4) = local_34; *(undefined1 **)(local_34 + 8) = local_34; *(undefined2 *)(local_34 + 0xc) = 0x101; local_8 = 0; if (local_30 == 0) { uVar8 = 1; do { pbVar5 = (&PTR_DAT_00b1fd50)[uVar8]; local_1c = 0; local_18 = &DAT_0000000f; local_2c[0] = (void *)0x0; pbVar3 = pbVar5; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar5,(int)pbVar3 - (int)(pbVar5 + 1)); local_8._0_1_ = 1; puVar4 = (uint *)FUN_0069d630(local_2c); local_8 = (uint)local_8._1_3_ << 8; *puVar4 = uVar8; if (&DAT_0000000f < local_18) { puVar7 = local_18 + 1; ptr = local_2c[0]; if ((undefined1 *)0xfff < puVar7) { ptr = *(void **)((int)local_2c[0] + -4); puVar7 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,(uint)puVar7); } uVar8 = uVar8 + 1; } while (uVar8 < 0x1e); } puVar7 = local_34; std::map::_Find_lower_bound(local_20,in_ECX); puVar2 = local_18; if (local_18[0xd] == '\0') { pbVar5 = local_18 + 0x10; if (0xf < *(uint *)(local_18 + 0x24)) { pbVar5 = *(byte **)pbVar5; } puVar4 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } iVar6 = string_compare(in_ECX,*puVar4,pbVar5,*(uint *)(local_18 + 0x20)); if ((-1 < iVar6) && (puVar2 != puVar7)) { uVar9 = *(undefined4 *)(puVar2 + 0x28); goto LAB_0082d24b; } } uVar9 = 0; LAB_0082d24b: FUN_004235c0(&local_34,*(undefined4 *)(puVar7 + 4)); operator_delete(local_34,0x2c); ExceptionList = local_10; return uVar9; } //@@ 0082d290 Spawn::PickEntry /* ZHL [lua] Lua binding Spawn:PickEntry prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall Spawn::PickEntry(void *this,float value) { byte bVar1; float fVar2; bVar1 = 0; fVar2 = 0.0; if (*(byte *)((int)this + 8) != 0) { do { fVar2 = fVar2 + *(float *)(*(int *)((int)this + 4) + 8 + (uint)bVar1 * 0xc); if (value * *(float *)((int)this + 0xc) < fVar2) { return (void *)(*(int *)((int)this + 4) + (uint)bVar1 * 0xc); } bVar1 = bVar1 + 1; } while (bVar1 < *(byte *)((int)this + 8)); } KAGE_LogMessage(1,(byte *) "[warn] RoomConfig::Spawn::PickEntry did not terminate properly. Picking first entry: (%d, %d, %d, %f)\n" ); return *(void **)((int)this + 4); } //@@ 0082d320 RoomConfig::ClearGeneratedRooms /* DB: src/rooms decompile labels (RoomConfig::ClearGeneratedRooms) */ void RoomConfig::ClearGeneratedRooms(void) { uint *puVar1; uint uVar2; undefined4 *puVar3; undefined4 *ptr; qword qVar4; int *piVar5; int in_ECX; void *pvVar6; qword *pqVar7; int iVar8; int *piVar9; int iVar10; uint uStack_18; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01e90; local_10 = ExceptionList; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"delete %d generated rooms.\n"); piVar5 = *(int **)(in_ECX + 0x1e20); piVar9 = (int *)*piVar5; if (piVar9 != piVar5) { pvVar6 = g_mainHeap; do { if ((short)piVar9[0x13] != 0) { uStack_18 = 0; iVar8 = 0; do { iVar10 = piVar9[0x12] + iVar8; if (*(char *)(iVar10 + 8) != '\0') { pqVar7 = (qword *)((int)pvVar6 + 0x30); if (pvVar6 == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } if (*(int *)(iVar10 + 4) != 0) { puVar1 = (uint *)(*(int *)(iVar10 + 4) + -4); uVar2 = *puVar1; qVar4 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar2; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar4 < uVar2); free(puVar1); pvVar6 = g_mainHeap; } } *(undefined4 *)(iVar10 + 4) = 0; iVar8 = iVar8 + 0x10; *(undefined1 *)(iVar10 + 8) = 0; uStack_18 = uStack_18 + 1; } while (uStack_18 < *(ushort *)(piVar9 + 0x13)); pqVar7 = (qword *)((int)pvVar6 + 0x30); if (pvVar6 == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } if (piVar9[0x12] != 0) { puVar1 = (uint *)(piVar9[0x12] + -4); uVar2 = *puVar1; qVar4 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar2; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar4 < uVar2); free(puVar1); pvVar6 = g_mainHeap; } } piVar9[0x12] = 0; *(undefined2 *)(piVar9 + 0x13) = 0; piVar9 = (int *)*piVar9; piVar5 = *(int **)(in_ECX + 0x1e20); } while (piVar9 != piVar5); } *(undefined4 *)piVar5[1] = 0; ptr = (undefined4 *)*piVar5; while (ptr != (undefined4 *)0x0) { puVar3 = (undefined4 *)*ptr; std::string::_Tidy_deallocate((char *)(ptr + 7)); operator_delete(ptr,100); ptr = puVar3; } *(undefined4 *)*(undefined4 *)(in_ECX + 0x1e20) = *(undefined4 *)(in_ECX + 0x1e20); *(int *)(*(int *)(in_ECX + 0x1e20) + 4) = *(int *)(in_ECX + 0x1e20); *(undefined4 *)(in_ECX + 0x1e24) = 0; ExceptionList = local_10; return; } //@@ 0082d4a0 RoomConfig::MergeRoomsIntoGenerated /* DB: src/rooms decompile labels (RoomConfig::MergeRoomsIntoGenerated?(roomA,roomB,shape)) prototype: db/protos.zhl, confirmed by RET 12 */ RoomConfig_Room * __thiscall RoomConfig::MergeRoomsIntoGenerated (RoomConfig *this,RoomConfig_Room *roomA,RoomConfig_Room *roomB,int shape) { undefined4 *puVar1; short sVar2; short sVar3; uint spawnWord1; int mergedRoomNode; uint spawnWord2; short *spawnDst; short *spawnInit; undefined1 mergedDim; ushort spawnWord3; RoomConfig_Room *pRVar7; int iVar8; uint uVar9; uint doorWord; int *mergeRule; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; uint *doorMaskWord; byte heightA; uint shiftedDoor; undefined4 spawnWord1; undefined4 spawnWord2; undefined4 spawnWord3; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b01ed6; local_1c = ExceptionList; spawnWord1 = __security_cookie ^ (int)register0x00000010 - 0x10U; mergeRule = (int *)(&PTR_DAT_00b1f494)[shape]; mergedRoomNode = *mergeRule; if (mergedRoomNode != 0) { do { if ((roomA->Shape == mergedRoomNode) && (roomB->Shape == mergeRule[4])) { ExceptionList = &local_1c; std::list<92byte>::resize(*(int *)&this[1].field_0x1c4 + 1); mergedRoomNode = *(int *)(*(int *)&this[1].field_0x1c0 + 4); pRVar7 = roomA; if (roomA->Difficulty < roomB->Difficulty) { pRVar7 = roomB; } uVar9 = 0; *(int *)(mergedRoomNode + 0x34) = pRVar7->Difficulty; *(undefined4 *)(mergedRoomNode + 0x40) = 0; *(undefined4 *)(mergedRoomNode + 0x44) = 0; goto LAB_0082d570; } mergedRoomNode = mergeRule[8]; mergeRule = mergeRule + 8; } while (mergedRoomNode != 0); } return (RoomConfig_Room *)0x0; LAB_0082d570: spawnWord2 = 1 << ((byte)uVar9 & 0x1f); doorWord = uVar9 >> 5; if ((((&roomA->Doors)[doorWord] & spawnWord2) != 0) && ((mergeRule[doorWord + 3] & spawnWord2) == 0)) { if (((mergeRule[1] < 1) || ((uVar9 != 1 && (uVar9 != 3)))) && ((mergeRule[2] < 1 || ((uVar9 != 0 && (uVar9 != 2)))))) { if (7 < uVar9) goto LAB_0082d871; doorMaskWord = (uint *)(mergedRoomNode + 0x40 + doorWord * 4); *doorMaskWord = *doorMaskWord | spawnWord2; } else { shiftedDoor = uVar9 + 4; if (7 < shiftedDoor) goto LAB_0082d871; doorMaskWord = (uint *)(mergedRoomNode + 0x40 + (shiftedDoor >> 5) * 4); *doorMaskWord = *doorMaskWord | 1 << ((byte)shiftedDoor & 0x1f); } } if ((((&roomB->Doors)[doorWord] & spawnWord2) != 0) && ((mergeRule[doorWord + 7] & spawnWord2) == 0)) { if (((mergeRule[5] < 1) || ((uVar9 != 1 && (uVar9 != 3)))) && ((mergeRule[6] < 1 || ((uVar9 != 0 && (uVar9 != 2)))))) { if (7 < uVar9) { LAB_0082d871: /* WARNING: Subroutine does not return */ std::bitset::_Xran(spawnWord1); } doorMaskWord = (uint *)(mergedRoomNode + 0x40 + doorWord * 4); *doorMaskWord = *doorMaskWord | spawnWord2; } else { spawnWord2 = uVar9 + 4; if (7 < spawnWord2) goto LAB_0082d871; doorMaskWord = (uint *)(mergedRoomNode + 0x40 + (spawnWord2 >> 5) * 4); *doorMaskWord = *doorMaskWord | 1 << ((byte)spawnWord2 & 0x1f); } } uVar9 = uVar9 + 1; if (7 < uVar9) { spawnWord1 = roomB->Width + 0xd; if (mergeRule[5] < 1) { spawnWord1 = (uint)roomB->Width; } uVar9 = roomA->Width + 0xd; if (mergeRule[1] < 1) { uVar9 = (uint)roomA->Width; } mergedDim = (char)uVar9; if (uVar9 < spawnWord1) { mergedDim = (char)spawnWord1; } *(undefined1 *)(mergedRoomNode + 0x4e) = mergedDim; spawnWord1 = roomB->Height + 7; if (mergeRule[6] < 1) { spawnWord1 = (uint)roomB->Height; } iVar8 = mergeRule[2]; heightA = roomA->Height; *(undefined4 *)(mergedRoomNode + 0x3c) = 0x3f800000; *(undefined4 *)(mergedRoomNode + 0x38) = 0x3f800000; uVar9 = heightA + 7; if (iVar8 < 1) { uVar9 = (uint)heightA; } mergedDim = (char)uVar9; if (uVar9 < spawnWord1) { mergedDim = (char)spawnWord1; } *(undefined1 *)(mergedRoomNode + 0x4f) = mergedDim; std::string::assign((char *)(mergedRoomNode + 0x1c),(byte *)"generated",9); *(int *)(mergedRoomNode + 0x50) = shape; ((RoomConfig_Room *)(mergedRoomNode + 8))->StageId = roomA->StageId; *(int *)(mergedRoomNode + 0x10) = roomA->Type; *(int *)(mergedRoomNode + 0x14) = roomA->Variant; *(int *)(mergedRoomNode + 0x18) = roomA->Subtype; spawnWord3 = roomB->SpawnCount + roomA->SpawnCount; *(ushort *)(mergedRoomNode + 0x4c) = spawnWord3; *(uint *)(mergedRoomNode + 0x54) = *(uint *)&roomA->field_0x4c | *(uint *)&roomB->field_0x4c | 0x10; spawnWord1 = (uint)spawnWord3; spawnDst = operator_new_tracked(spawnWord1 * 0x10); if (spawnDst == (short *)0x0) { spawnDst = (short *)0x0; } else if (spawnWord1 != 0) { spawnInit = spawnDst + 2; do { *(undefined1 *)(spawnInit + 2) = 0; spawnInit[-0xffffffff00000002] = 0; spawnInit[-0xffffffff00000001] = 0; spawnInit[0] = 0; spawnInit[1] = 0; spawnInit[4] = 0; spawnInit[5] = 0; spawnWord1 = spawnWord1 - 1; spawnInit = spawnInit + 8; } while (spawnWord1 != 0); } *(short **)(mergedRoomNode + 0x48) = spawnDst; sVar2 = 0; if (roomA->SpawnCount != 0) { if (0 < mergeRule[1]) { sVar2 = 0xd; } sVar3 = 0; if (0 < mergeRule[2]) { sVar3 = 7; } spawnWord1 = 0; iVar8 = 0; do { spawnWord1 = spawnWord1 + 1; puVar1 = (undefined4 *)((int)roomA->Spawns + iVar8); spawnWord1 = puVar1[1]; spawnWord2 = puVar1[2]; spawnWord3 = puVar1[3]; *(undefined4 *)spawnDst = *puVar1; *(undefined4 *)(spawnDst + 2) = spawnWord1; *(undefined4 *)(spawnDst + 4) = spawnWord2; *(undefined4 *)(spawnDst + 6) = spawnWord3; *spawnDst = *spawnDst + sVar2; spawnDst[1] = spawnDst[1] + sVar3; spawnDst = spawnDst + 8; iVar8 = iVar8 + 0x10; } while (spawnWord1 < (ushort)roomA->SpawnCount); } sVar2 = 0; if (roomB->SpawnCount != 0) { if (0 < mergeRule[5]) { sVar2 = 0xd; } sVar3 = 0; if (0 < mergeRule[6]) { sVar3 = 7; } iVar8 = 0; spawnWord1 = 0; do { spawnWord1 = spawnWord1 + 1; puVar1 = (undefined4 *)((int)roomB->Spawns + iVar8); spawnWord1 = puVar1[1]; spawnWord2 = puVar1[2]; spawnWord3 = puVar1[3]; iVar8 = iVar8 + 0x10; *(undefined4 *)spawnDst = *puVar1; *(undefined4 *)(spawnDst + 2) = spawnWord1; *(undefined4 *)(spawnDst + 4) = spawnWord2; *(undefined4 *)(spawnDst + 6) = spawnWord3; *spawnDst = *spawnDst + sVar2; spawnDst[1] = spawnDst[1] + sVar3; spawnDst = spawnDst + 8; } while (spawnWord1 < (ushort)roomB->SpawnCount); } *(RoomConfig_Room **)(mergedRoomNode + 0x58) = roomA; *(RoomConfig_Room **)(mergedRoomNode + 0x5c) = roomB; ExceptionList = local_1c; return (RoomConfig_Room *)(mergedRoomNode + 8); } goto LAB_0082d570; } //@@ 0082d880 RoomConfig::GetRandomSplitRoom /* DB: src/rooms decompile labels (RoomConfig::GetRandomSplitRoom (Curse of Giant) ret30) */ RoomConfig_Room * RoomConfig::GetRandomSplitRoom (uint param_1,undefined4 param_2,int param_3,uint param_4,int param_5,uint param_6, int param_7,int param_8,int param_9,int param_10,uint param_11,int param_12) { code *pcVar1; int *piVar2; RoomConfig_Room *pRVar3; RoomConfig_Room *roomB; uint uVar4; uint uVar5; uint uVar6; int *piVar7; RNG local_1c; uint local_c; RoomConfig *local_8; if ((param_4 == 1) && (param_5 != 0xd)) { piVar7 = (int *)(&PTR_DAT_00b1f494)[param_5]; uVar4 = 0; piVar2 = piVar7; if (*piVar7 != 0) { do { piVar2 = piVar2 + 8; uVar4 = uVar4 + 1; } while (*piVar2 != 0); if (uVar4 != 0) { local_1c._seed = param_1; local_1c._shift1 = 7; local_1c._shift2 = 0x11; local_1c._shift3 = 0x15; uVar4 = RNG::RandomInt(&local_1c,uVar4); piVar7 = piVar7 + uVar4 * 8; uVar4 = 0; param_4 = piVar7[3]; param_1 = piVar7[7]; do { if ((*(uint *)(param_10 + (uVar4 >> 5) * 4) & 1 << ((byte)uVar4 & 0x1f)) != 0) { if (((0 < piVar7[2]) && ((uVar4 == 4 || (uVar4 == 6)))) || ((uVar6 = uVar4, 0 < piVar7[1] && ((uVar4 == 5 || (uVar4 == 7)))))) { uVar6 = uVar4 - 4; } uVar5 = 1 << ((byte)uVar6 & 0x1f); if ((*(uint *)(&DAT_00b1f894 + (*piVar7 + (uVar6 >> 5)) * 4) & uVar5) != 0) { if (7 < uVar6) goto LAB_0082dab9; (¶m_4)[uVar6 >> 5] = (¶m_4)[uVar6 >> 5] | uVar5; } if (((0 < piVar7[6]) && ((uVar4 == 4 || (uVar4 == 6)))) || ((uVar6 = uVar4, 0 < piVar7[5] && ((uVar4 == 5 || (uVar4 == 7)))))) { uVar6 = uVar4 - 4; } local_c = 1 << ((byte)uVar6 & 0x1f); if ((*(uint *)(&DAT_00b1f894 + (piVar7[4] + (uVar6 >> 5)) * 4) & local_c) != 0) { if (7 < uVar6) { LAB_0082dab9: /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } (¶m_1)[uVar6 >> 5] = (¶m_1)[uVar6 >> 5] | local_c; } } uVar4 = uVar4 + 1; if (7 < uVar4) { if (local_1c._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pRVar3 = (RoomConfig_Room *)(*pcVar1)(); return pRVar3; } uVar4 = (uint)local_1c._seed >> ((byte)local_1c._shift1 & 0x1f) ^ local_1c._seed; uVar4 = uVar4 << ((byte)local_1c._shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)local_1c._shift3 & 0x1f) ^ uVar4; pRVar3 = GetRandomRoom(local_8,uVar4,(byte)param_2,param_3,1,*piVar7,param_6,param_7, param_8,param_9,¶m_4,param_11,param_12); if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); pRVar3 = (RoomConfig_Room *)(*pcVar1)(); return pRVar3; } uVar4 = uVar4 >> ((byte)local_1c._shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)local_1c._shift2 & 0x1f) ^ uVar4; roomB = GetRandomRoom(local_8,uVar4 >> ((byte)local_1c._shift3 & 0x1f) ^ uVar4, (byte)param_2,param_3,1,piVar7[4],param_6,param_7,param_8,param_9, ¶m_1,param_11,param_12); if ((pRVar3 == (RoomConfig_Room *)0x0) || (roomB == (RoomConfig_Room *)0x0)) { return (RoomConfig_Room *)0x0; } pRVar3 = MergeRoomsIntoGenerated(local_8,pRVar3,roomB,param_5); return pRVar3; } } while( true ); } } } return (RoomConfig_Room *)0x0; } //@@ 0082dac0 RoomConfig::make_generated_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (RoomConfig_Room src): allocates the next generated room slot (+0x1e24 count, 0082de80), copies shape/type/variant/weights, remaps the 8 door bits per shape table DAT_00b1f8cc, names it "generated"; returned by Level::get_room_config_from_saved_id for saved ids */ undefined4 * RoomConfig::make_generated_room(undefined4 *param_1) { uint doorWord; void *pvVar1; undefined4 *dstSpawn; int in_ECX; uint uVar2; uint doorBit; short *srcSpawn; uint doorBits; int srcEntries; int srcSpawnOffset; uint entryIndex; uint spawnIndex; uint doorRemap [8]; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; int dstEntries; int newNode; char shapeFlag; int srcEntries; local_8 = 0xffffffff; puStack_c = &LAB_00b01f26; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(doorRemap + 0xc); ExceptionList = &local_10; std::list<92byte>::resize(*(int *)(in_ECX + 0x1e24) + 1); srcEntries = param_1[0x12]; doorRemap[0] = 2; newNode = *(int *)(*(int *)(in_ECX + 0x1e20) + 4); doorRemap[2] = 0; doorRemap[4] = 6; *(undefined4 *)(newNode + 0x34) = param_1[0xb]; *(undefined4 *)(newNode + 0x40) = 0; shapeFlag = (&DAT_00b1f8cc)[srcEntries * 8]; doorRemap[6] = 4; doorRemap[1] = (uint)(shapeFlag != '\0') * 4 + 1; doorRemap[3] = (uint)(shapeFlag != '\0') * 4 + 3; doorRemap[5] = (uint)(shapeFlag == '\0') * 4 + 1; uVar2 = 0; doorRemap[7] = (uint)(shapeFlag == '\0') * 4 + 3; do { doorWord = uVar2 >> 5; doorBit = 1 << ((byte)uVar2 & 0x1f); doorBits = *(uint *)(newNode + 0x40 + doorWord * 4); if ((param_1[(doorRemap[uVar2] >> 5) + 0xe] & 1 << ((byte)doorRemap[uVar2] & 0x1f)) == 0) { doorBits = doorBits & ~doorBit; } else { doorBits = doorBits | doorBit; } uVar2 = uVar2 + 1; *(uint *)(newNode + 0x40 + doorWord * 4) = doorBits; } while (uVar2 < 8); *(undefined1 *)(newNode + 0x4e) = *(undefined1 *)((int)param_1 + 0x46); *(undefined1 *)(newNode + 0x4f) = *(undefined1 *)((int)param_1 + 0x47); *(undefined4 *)(newNode + 0x3c) = 0x3f800000; *(undefined4 *)(newNode + 0x38) = 0x3f800000; std::string::assign((char *)(newNode + 0x1c),(byte *)"generated",9); *(undefined4 *)(newNode + 0x50) = *(undefined4 *)(&DAT_00b1f8c8 + srcEntries * 8); *(undefined4 *)(newNode + 8) = *param_1; *(undefined4 *)(newNode + 0x10) = param_1[2]; *(undefined4 *)(newNode + 0x14) = param_1[3]; *(undefined4 *)(newNode + 0x18) = param_1[4]; *(uint *)(newNode + 0x54) = param_1[0x13] | 0x20; uVar2 = (uint)*(ushort *)(param_1 + 0x11); *(ushort *)(newNode + 0x4c) = *(ushort *)(param_1 + 0x11); pvVar1 = operator_new_tracked(uVar2 * 0x10); if (pvVar1 == (void *)0x0) { pvVar1 = (void *)0x0; } else if (uVar2 != 0) { dstSpawn = (undefined4 *)((int)pvVar1 + 4); do { dstSpawn[-1] = 0; *dstSpawn = 0; *(undefined1 *)(dstSpawn + 1) = 0; dstSpawn[2] = 0; uVar2 = uVar2 - 1; dstSpawn = dstSpawn + 4; } while (uVar2 != 0); } local_8 = 0xffffffff; *(void **)(newNode + 0x48) = pvVar1; spawnIndex = 0; if (*(short *)(param_1 + 0x11) != 0) { dstSpawn = (undefined4 *)((int)pvVar1 + 0xc); srcSpawnOffset = 0; do { srcSpawn = (short *)(param_1[0x10] + srcSpawnOffset); *(ushort *)(dstSpawn + -3) = ((ushort)*(byte *)(newNode + 0x4e) - *srcSpawn) + -1; *(short *)((int)dstSpawn + -10) = srcSpawn[1]; *dstSpawn = *(undefined4 *)(srcSpawn + 6); *(char *)(dstSpawn + -1) = (char)srcSpawn[4]; if (*(byte *)(srcSpawn + 4) != 0) { pvVar1 = operator_new_tracked((uint)*(byte *)(srcSpawn + 4) * 0xc); dstSpawn[-2] = pvVar1; entryIndex = 0; if ((char)srcSpawn[4] != '\0') { srcEntries = 0; do { srcEntries = *(int *)(srcSpawn + 2); dstEntries = dstSpawn[-2]; *(undefined8 *)(dstEntries + srcEntries) = *(undefined8 *)(srcEntries + srcEntries); *(undefined4 *)((undefined8 *)(dstEntries + srcEntries) + 1) = *(undefined4 *)(srcEntries + 8 + srcEntries); FUN_0082dd80(); srcEntries = srcEntries + 0xc; entryIndex = entryIndex + 1; } while (entryIndex < *(byte *)(srcSpawn + 4)); } } dstSpawn = dstSpawn + 4; srcSpawnOffset = srcSpawnOffset + 0x10; spawnIndex = spawnIndex + 1; } while (spawnIndex < *(ushort *)(param_1 + 0x11)); } ExceptionList = local_10; return (undefined4 *)(newNode + 8); } //@@ 0082dd80 FUN_0082dd80 void FUN_0082dd80(void) { ushort uVar1; int iVar2; ushort uVar3; int *in_ECX; bool bVar4; iVar2 = *in_ECX; if (iVar2 < 0x355) { if (iVar2 == 0x354) goto LAB_0082ddb5; if (iVar2 < 0xcc) { if (iVar2 != 0xcb) { if (iVar2 == 0x28) goto LAB_0082ddff; if (iVar2 != 0xca) { return; } } goto LAB_0082ddb5; } if (iVar2 == 0xda) { LAB_0082ddff: if (*(short *)((int)in_ECX + 6) == 1) { *(undefined2 *)((int)in_ECX + 6) = 3; return; } if (*(short *)((int)in_ECX + 6) == 3) { *(undefined2 *)((int)in_ECX + 6) = 1; return; } return; } bVar4 = iVar2 == 0x324; } else { if (0x3ca < iVar2) { if (iVar2 != 6000) { return; } uVar1 = *(ushort *)(&DAT_00b6cd7c + (*(ushort *)(in_ECX + 1) & 0xf) * 4); uVar3 = *(ushort *)(in_ECX + 1) & 0xfff0 | uVar1; *(ushort *)(in_ECX + 1) = uVar3; if ((uVar1 & 0xf) != 0) { return; } if ((uVar3 & 0x10) != 0) { *(ushort *)(in_ECX + 1) = uVar3 & 0xffef | 0x20; return; } if ((uVar3 & 0x20) == 0) { return; } *(ushort *)(in_ECX + 1) = uVar3 & 0xffdf | 0x10; return; } if (iVar2 != 0x3ca) { if (iVar2 != 0x35e) { if (iVar2 == 0x377) { *(short *)((int)in_ECX + 6) = 1 - *(short *)((int)in_ECX + 6); return; } return; } goto LAB_0082ddff; } bVar4 = (short)in_ECX[1] == 1; } if (!bVar4) { return; } LAB_0082ddb5: if (*(short *)((int)in_ECX + 6) == 0) { *(undefined2 *)((int)in_ECX + 6) = 2; return; } if (*(short *)((int)in_ECX + 6) == 2) { *(undefined2 *)((int)in_ECX + 6) = 0; return; } return; } //@@ 0082de80 std::list<92byte>::resize /* DB: grows by allocating 100-byte list nodes (payload zero-init with an empty std::string at +0x1c) and splicing them at the end, shrinks otherwise; RoomConfig::MergeRoomsIntoGenerated resizes to count+1 */ void std::list<92byte>::resize(uint param_1) { undefined4 *puVar1; void *pvVar2; void *ptr; int *in_ECX; uint size; uint uVar3; int iVar4; int *piVar5; int iVar6; int *local_24; int *local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01f65; local_10 = ExceptionList; ExceptionList = &local_10; uVar3 = in_ECX[1]; if (uVar3 < param_1) { iVar4 = 0; if (param_1 - uVar3 == 0) { } else { local_8 = 1; local_20 = operator_new(100); local_20[7] = 0; local_20[0xb] = 0; local_20[0xc] = 0xf; local_20[0x10] = 0; local_20[0x11] = 0; local_20[0x12] = 0; iVar4 = 1; *(undefined2 *)(local_20 + 0x13) = 0; local_20[0x17] = 0; local_20[0x16] = 0; iVar6 = (param_1 - uVar3) + -1; piVar5 = local_20; local_24 = local_20; if (iVar6 != 0) { do { local_24 = operator_new(100); iVar4 = iVar4 + 1; local_24[7] = 0; local_24[0xb] = 0; local_24[0xc] = 0xf; local_24[0x10] = 0; local_24[0x11] = 0; local_24[0x12] = 0; *(undefined2 *)(local_24 + 0x13) = 0; local_24[0x17] = 0; local_24[0x16] = 0; *piVar5 = (int)local_24; local_24[1] = (int)piVar5; iVar6 = iVar6 + -1; piVar5 = local_24; } while (iVar6 != 0); } } iVar6 = *in_ECX; if (iVar4 != 0) { puVar1 = *(undefined4 **)(iVar6 + 4); local_20[1] = (int)puVar1; *puVar1 = local_20; *local_24 = iVar6; *(int **)(iVar6 + 4) = local_24; in_ECX[1] = in_ECX[1] + iVar4; } } else if (param_1 < uVar3) { do { piVar5 = *(int **)(*in_ECX + 4); iVar4 = *piVar5; in_ECX[1] = uVar3 - 1; *(int *)piVar5[1] = iVar4; *(int *)(iVar4 + 4) = piVar5[1]; uVar3 = piVar5[0xc]; if (0xf < uVar3) { pvVar2 = (void *)piVar5[7]; size = uVar3 + 1; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = uVar3 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } piVar5[0xb] = 0; piVar5[0xc] = 0xf; *(undefined1 *)(piVar5 + 7) = 0; operator_delete(piVar5,100); uVar3 = in_ECX[1]; } while (param_1 < uVar3); ExceptionList = local_10; return; } ExceptionList = local_10; return; } //@@ 0082e050 FUN_0082e050 void FUN_0082e050(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; std::string::_Tidy_deallocate((char *)(puVar1 + 7)); operator_delete(puVar1,100); puVar1 = puVar2; } operator_delete((void *)*in_ECX,100); return; } //@@ 0082e0a0 FUN_0082e0a0 void FUN_0082e0a0(void) { undefined4 *puVar1; undefined4 *ptr; int in_ECX; if (*(int *)(in_ECX + 4) != 0) { *(undefined4 *)(*(int *)(in_ECX + 0xc) + 4) = 0; **(undefined4 **)(in_ECX + 8) = 0; ptr = *(undefined4 **)(in_ECX + 0xc); while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; std::string::_Tidy_deallocate((char *)(ptr + 7)); operator_delete(ptr,100); ptr = puVar1; } } return; } //@@ 0082e0e0 FUN_0082e0e0 undefined4 * FUN_0082e0e0(int param_1,undefined4 *param_2) { undefined4 *puVar1; uint uVar2; int iVar3; undefined4 *puVar4; int *in_ECX; uint uVar5; undefined4 *puVar6; int iVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01f90; local_10 = ExceptionList; ExceptionList = &local_10; iVar7 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x1c; if (iVar3 == 0x9249249) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (in_ECX[2] - *in_ECX) / 0x1c; if (0x9249249 - (uVar2 >> 1) < uVar2) { uVar5 = 0x9249249; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar2) { uVar5 = uVar2; } if (0x9249249 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = std::_Allocate(uVar5 * 0x1c); local_8 = 0; puVar1 = puVar4 + ((param_1 - iVar7) / 0x1c) * 7; *puVar1 = *param_2; std::string::string((char *)(puVar1 + 1),param_2 + 1); iVar7 = *in_ECX; puVar6 = puVar4; if (param_1 != in_ECX[1]) { FUN_006a0ab0(puVar4,iVar7); puVar6 = puVar1 + 7; } FUN_006a0ab0(puVar6,iVar7); FUN_0082e290(puVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return puVar1; } //@@ 0082e234 Catch_All@0082e234 void Catch_All_0082e234(void) { int unaff_EBP; FUN_0069dd10(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x14)); FUN_0069dd40(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0082e270 FUN_0082e270 void FUN_0082e270(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),100); } return; } //@@ 0082e290 FUN_0082e290 void FUN_0082e290(int param_1,int param_2,int param_3) { int *in_ECX; uint size; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { std::string::_Tidy_deallocate((char *)((int)pvVar1 + 4)); pvVar1 = (void *)((int)pvVar1 + 0x1c); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x1c) * 0x1c; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x1c; in_ECX[2] = param_1 + param_3 * 0x1c; return; } //@@ 0082e340 FUN_0082e340 void FUN_0082e340(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[1] = 0; param_1[5] = 0; param_1[6] = 0xf; param_1 = param_1 + 7; } return; } //@@ 0082e3a0 std::_Sort_unchecked<16byte> /* DB: MSVC std::sort introsort loop: (first in ECX, last in EDX, ideal, pred): recurses on itself while range > 32 elements (0x200 bytes of 16-byte items), heap-sort fallback when ideal<=0 (0082ea50/0082e810), memmove insertion; RoomConfigRoom::ParseXml sorts with predicate FUN_008299e0 */ void std::_Sort_unchecked<16byte>(int param_1,code *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; char cVar4; undefined4 *in_ECX; int iVar5; undefined4 *in_EDX; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 local_2c; undefined4 uStack_28; undefined4 *puStack_24; undefined4 *puStack_20; undefined4 *local_1c; undefined4 *local_18; undefined4 *local_14; undefined4 *local_10; undefined4 *local_c; undefined4 *local_8; local_14 = in_ECX; local_8 = in_EDX; if (0x200 < (int)((int)in_EDX - (int)in_ECX & 0xfffffff0U)) { do { puVar6 = local_8; if (param_1 < 1) { local_14 = (undefined4 *)((int)local_8 - (int)in_ECX >> 4); iVar5 = (int)local_8 - (int)in_ECX >> 5; if (0 < iVar5) { local_18 = (undefined4 *)((int)local_14 - 1); local_10 = (undefined4 *)((int)local_18 >> 1); puStack_20 = in_ECX + iVar5 * 4; local_c = (undefined4 *)iVar5; do { local_3c = puStack_20[-4]; uStack_38 = puStack_20[-3]; uStack_34 = puStack_20[-2]; uStack_30 = puStack_20[-1]; puStack_20 = puStack_20 + -4; iVar5 = (int)local_c + -1; puVar6 = (undefined4 *)iVar5; local_c = (undefined4 *)iVar5; if (iVar5 < (int)local_10) { do { puVar6 = (undefined4 *)(iVar5 * 2 + 2); cVar4 = (*param_2)(in_ECX + (int)puVar6 * 4,in_ECX + (int)puVar6 * 4 + -4); if (cVar4 != '\0') { puVar6 = (undefined4 *)(iVar5 * 2 + 1); } puVar7 = in_ECX + (int)puVar6 * 4; uVar1 = puVar7[1]; uVar2 = puVar7[2]; uVar3 = puVar7[3]; puVar8 = in_ECX + iVar5 * 4; *puVar8 = *puVar7; puVar8[1] = uVar1; puVar8[2] = uVar2; puVar8[3] = uVar3; iVar5 = (int)puVar6; } while ((int)puVar6 < (int)local_10); } if ((puVar6 == local_10) && (((uint)local_14 & 1) == 0)) { puVar7 = in_ECX + (int)local_14 * 4 + -4; uVar1 = puVar7[1]; uVar2 = puVar7[2]; uVar3 = puVar7[3]; puVar6 = in_ECX + (int)puVar6 * 4; *puVar6 = *puVar7; puVar6[1] = uVar1; puVar6[2] = uVar2; puVar6[3] = uVar3; puVar6 = local_18; } if ((int)local_c < (int)puVar6) { do { iVar5 = (int)puVar6 + -1 >> 1; local_1c = in_ECX + iVar5 * 4; cVar4 = (*param_2)(local_1c,&local_3c); if (cVar4 == '\0') break; uVar1 = local_1c[1]; uVar2 = local_1c[2]; uVar3 = local_1c[3]; puVar6 = in_ECX + (int)puVar6 * 4; *puVar6 = *local_1c; puVar6[1] = uVar1; puVar6[2] = uVar2; puVar6[3] = uVar3; puVar6 = (undefined4 *)iVar5; } while ((int)local_c < iVar5); } puVar6 = in_ECX + (int)puVar6 * 4; *puVar6 = local_3c; puVar6[1] = uStack_38; puVar6[2] = uStack_34; puVar6[3] = uStack_30; } while (0 < (int)local_c); } puVar6 = local_8; if ((int)local_14 < 2) { return; } do { puVar7 = puVar6 + -4; local_3c = *puVar7; uStack_38 = puVar6[-3]; uStack_34 = puVar6[-2]; uStack_30 = puVar6[-1]; uVar1 = in_ECX[1]; uVar2 = in_ECX[2]; uVar3 = in_ECX[3]; *puVar7 = *in_ECX; puVar6[-3] = uVar1; puVar6[-2] = uVar2; puVar6[-1] = uVar3; FUN_0082ea50((int)puVar7 - (int)in_ECX >> 4,&local_3c,param_2); puVar6 = puVar7; } while (0x1f < (int)((int)puVar7 - (int)in_ECX & 0xfffffff0U)); return; } _Partition_by_median_guess_unchecked<16byte>(local_8,param_2); param_1 = (param_1 >> 1) + (param_1 >> 2); if ((int)((int)puStack_24 - (int)in_ECX & 0xfffffff0U) < (int)((int)puVar6 - (int)puStack_20 & 0xfffffff0U)) { _Sort_unchecked<16byte>(param_1,param_2); local_14 = puStack_20; in_ECX = puStack_20; } else { _Sort_unchecked<16byte>(param_1,param_2); local_8 = puStack_24; } } while (0x200 < (int)((int)local_8 - (int)in_ECX & 0xfffffff0U)); } if ((in_ECX != local_8) && (local_18 = in_ECX + 4, local_18 != local_8)) { local_10 = in_ECX; do { puVar7 = local_10; puVar6 = local_18; local_2c = *local_18; uStack_28 = local_18[1]; puStack_24 = (undefined4 *)local_18[2]; puStack_20 = (undefined4 *)local_18[3]; local_c = local_18; cVar4 = (*param_2)(&local_2c,in_ECX); if (cVar4 == '\0') { cVar4 = (*param_2)(&local_2c,local_10); if (cVar4 != '\0') { puVar6 = local_c; do { puVar8 = puVar7; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar6 = *puVar8; puVar6[1] = uVar1; puVar6[2] = uVar2; puVar6[3] = uVar3; cVar4 = (*param_2)(&local_2c,puVar8 + -4); puVar7 = puVar8 + -4; puVar6 = puVar8; } while (cVar4 != '\0'); in_ECX = local_14; local_c = puVar8; } *local_c = local_2c; local_c[1] = uStack_28; local_c[2] = puStack_24; local_c[3] = puStack_20; } else { memmove((void *)((int)puVar6 + (0x10 - ((int)puVar6 - (int)in_ECX))),in_ECX, (int)puVar6 - (int)in_ECX); *in_ECX = local_2c; in_ECX[1] = uStack_28; in_ECX[2] = puStack_24; in_ECX[3] = puStack_20; local_18 = puVar6; local_10 = puVar7; } local_18 = local_18 + 4; local_10 = local_10 + 4; } while (local_18 != local_8); } return; } //@@ 0082e650 FUN_0082e650 void FUN_0082e650(undefined4 param_1,undefined1 *param_2) { int iVar1; void *pvVar2; int *in_ECX; undefined4 extraout_ECX; uint uVar3; iVar1 = (in_ECX[1] - *in_ECX) / 0x1c; uVar3 = (in_ECX[2] - *in_ECX) / 0x1c; if (0x9249249 - (uVar3 >> 1) < uVar3) { uVar3 = 0x9249249; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < 9) { uVar3 = 9; } else if (0x9249249 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar2 = std::_Allocate(uVar3 * 0x1c); FUN_0082e340((void *)((int)pvVar2 + iVar1 * 0x1c),9 - iVar1,*param_2); FUN_006a0ab0(pvVar2,extraout_ECX); FUN_0082e290(pvVar2,9,uVar3); return; } //@@ 0082e720 std::map::_Copy_nodes /* DB: ? recursive _Tree::_Copy_nodes for 0x18-byte nodes (8-byte key/value at +0x10); RoomConfigStage::operator_assign, std_map_copy_assign */ int * std::map::_Copy_nodes(undefined4 *param_1,int param_2,undefined4 param_3) { int *piVar1; int iVar2; int *piVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b01fbd; local_10 = ExceptionList; ExceptionList = &local_10; piVar3 = (int *)*in_ECX; if (*(char *)((int)param_1 + 0xd) == '\0') { local_8 = 0; piVar1 = operator_new(0x18); iVar2 = param_1[4]; piVar1[5] = param_1[5]; piVar1[4] = iVar2; *piVar1 = (int)piVar3; piVar1[2] = (int)piVar3; *(undefined2 *)(piVar1 + 3) = 0; piVar1[1] = param_2; *(undefined1 *)(piVar1 + 3) = *(undefined1 *)(param_1 + 3); local_8 = 1; if (*(char *)((int)piVar3 + 0xd) != '\0') { piVar3 = piVar1; } iVar2 = _Copy_nodes(*param_1,piVar1,param_3); *piVar1 = iVar2; iVar2 = _Copy_nodes(param_1[2],piVar1,param_3); piVar1[2] = iVar2; } ExceptionList = local_10; return piVar3; } //@@ 0082e7ec Catch_All@0082e7ec void Catch_All_0082e7ec(void) { fuzzer_allocator_> *pfVar1; void *this; int unaff_EBP; _Tree_node *p_Var2; p_Var2 = *(_Tree_node **)(unaff_EBP + 8); pfVar1 = (fuzzer_allocator_> *)Config::GetCollectibles(); FID_conflict__Erase_tree_>_> (this,pfVar1,p_Var2); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0082e810 std::_Partition_by_median_guess_unchecked<16byte> /* DB: MSVC std::sort partition with predicate (param_2 code*), stride 0x10, median-of-3/ninther (FUN_0082eb20) when >40; only caller std::_Sort_unchecked<16byte> */ void std::_Partition_by_median_guess_unchecked<16byte>(undefined4 *param_1,code *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; char cVar8; int iVar9; undefined4 *puVar10; undefined4 *puVar11; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar12; undefined4 *puVar13; undefined4 *puVar14; undefined4 *puVar15; undefined4 *puVar16; undefined4 *local_14; undefined4 *local_10; undefined4 *local_8; puVar10 = param_1 + -4; iVar9 = (int)puVar10 - (int)in_EDX >> 4; puVar12 = in_EDX + ((int)param_1 - (int)in_EDX >> 5) * 4; if (0x28 < iVar9) { iVar9 = iVar9 + 1 >> 3; FUN_0082eb20(in_EDX + iVar9 * 8,param_2); FUN_0082eb20(puVar12 + iVar9 * 4,param_2); FUN_0082eb20(puVar10,param_2); puVar10 = puVar10 + iVar9 * -4; } FUN_0082eb20(puVar10,param_2); local_8 = puVar12 + 4; do { puVar10 = puVar12; if (puVar10 <= in_EDX) break; puVar12 = puVar10 + -4; cVar8 = (*param_2)(puVar12,puVar10); if (cVar8 != '\0') break; cVar8 = (*param_2)(puVar10,puVar12); } while (cVar8 == '\0'); if (local_8 < param_1) { do { cVar8 = (*param_2)(local_8,puVar10); if ((cVar8 != '\0') || (cVar8 = (*param_2)(puVar10,local_8), cVar8 != '\0')) break; local_8 = local_8 + 4; } while (local_8 < param_1); } puVar12 = local_8; puVar14 = puVar10; puVar16 = local_8; LAB_0082e91c: local_10 = puVar10; LAB_0082e91f: local_14 = puVar16; do { puVar11 = puVar10; if (puVar16 < param_1) { do { cVar8 = (*param_2)(puVar14,puVar16); if (cVar8 == '\0') { cVar8 = (*param_2)(puVar16,puVar14); if (cVar8 != '\0') break; if (puVar12 != puVar16) { uVar1 = puVar16[1]; uVar2 = puVar16[2]; uVar3 = puVar16[3]; uVar4 = *puVar12; uVar5 = puVar12[1]; uVar6 = puVar12[2]; uVar7 = puVar12[3]; *puVar12 = *puVar16; puVar12[1] = uVar1; puVar12[2] = uVar2; puVar12[3] = uVar3; *puVar16 = uVar4; puVar16[1] = uVar5; puVar16[2] = uVar6; puVar16[3] = uVar7; } puVar12 = puVar12 + 4; } puVar16 = puVar16 + 4; } while (puVar16 < param_1); puVar11 = local_10; local_14 = puVar16; local_8 = puVar12; } puVar13 = puVar12; if (in_EDX < puVar11) { puVar12 = puVar14; puVar10 = local_10; do { puVar16 = puVar10 + -4; cVar8 = (*param_2)(puVar16,puVar12); puVar14 = puVar12; if (cVar8 == '\0') { cVar8 = (*param_2)(puVar12,puVar16); puVar11 = local_10; if (cVar8 != '\0') break; puVar14 = puVar12 + -4; if (puVar14 != puVar16) { uVar1 = puVar10[-3]; uVar2 = puVar10[-2]; uVar3 = puVar10[-1]; uVar4 = *puVar14; uVar5 = puVar12[-3]; uVar6 = puVar12[-2]; uVar7 = puVar12[-1]; *puVar14 = *puVar16; puVar12[-3] = uVar1; puVar12[-2] = uVar2; puVar12[-1] = uVar3; *puVar16 = uVar4; puVar10[-3] = uVar5; puVar10[-2] = uVar6; puVar10[-1] = uVar7; } } local_10 = local_10 + -4; puVar11 = local_10; puVar12 = puVar14; puVar10 = puVar16; } while (in_EDX < local_10); puVar13 = local_8; puVar16 = local_14; local_10 = puVar11; } if (puVar11 == in_EDX) break; puVar10 = puVar11 + -4; if (puVar16 != param_1) { uVar1 = *puVar16; uVar2 = puVar16[1]; uVar3 = puVar16[2]; uVar4 = puVar16[3]; uVar5 = puVar11[-3]; uVar6 = puVar11[-2]; uVar7 = puVar11[-1]; *puVar16 = *puVar10; puVar16[1] = uVar5; puVar16[2] = uVar6; puVar16[3] = uVar7; puVar16 = puVar16 + 4; *puVar10 = uVar1; puVar11[-3] = uVar2; puVar11[-2] = uVar3; puVar11[-1] = uVar4; puVar12 = puVar13; goto LAB_0082e91c; } puVar15 = puVar14 + -4; if (puVar10 != puVar15) { uVar1 = puVar14[-3]; uVar2 = puVar14[-2]; uVar3 = puVar14[-1]; uVar4 = *puVar10; uVar5 = puVar11[-3]; uVar6 = puVar11[-2]; uVar7 = puVar11[-1]; *puVar10 = *puVar15; puVar11[-3] = uVar1; puVar11[-2] = uVar2; puVar11[-1] = uVar3; *puVar15 = uVar4; puVar14[-3] = uVar5; puVar14[-2] = uVar6; puVar14[-1] = uVar7; } uVar1 = puVar13[-3]; uVar2 = puVar13[-2]; uVar3 = puVar13[-1]; puVar12 = puVar13 + -4; uVar4 = *puVar15; uVar5 = puVar14[-3]; uVar6 = puVar14[-2]; uVar7 = puVar14[-1]; *puVar15 = puVar13[-4]; puVar14[-3] = uVar1; puVar14[-2] = uVar2; puVar14[-1] = uVar3; *puVar12 = uVar4; puVar13[-3] = uVar5; puVar13[-2] = uVar6; puVar13[-1] = uVar7; puVar14 = puVar15; local_10 = puVar10; local_8 = puVar12; } while( true ); if (puVar16 == param_1) { *in_ECX = puVar14; in_ECX[1] = puVar13; return; } if (puVar13 != puVar16) { uVar1 = puVar13[1]; uVar2 = puVar13[2]; uVar3 = puVar13[3]; uVar4 = *puVar14; uVar5 = puVar14[1]; uVar6 = puVar14[2]; uVar7 = puVar14[3]; *puVar14 = *puVar13; puVar14[1] = uVar1; puVar14[2] = uVar2; puVar14[3] = uVar3; *puVar13 = uVar4; puVar13[1] = uVar5; puVar13[2] = uVar6; puVar13[3] = uVar7; } uVar1 = puVar16[1]; uVar2 = puVar16[2]; uVar3 = puVar16[3]; puVar12 = puVar13 + 4; uVar4 = *puVar14; uVar5 = puVar14[1]; uVar6 = puVar14[2]; uVar7 = puVar14[3]; *puVar14 = *puVar16; puVar14[1] = uVar1; puVar14[2] = uVar2; puVar14[3] = uVar3; puVar14 = puVar14 + 4; *puVar16 = uVar4; puVar16[1] = uVar5; puVar16[2] = uVar6; puVar16[3] = uVar7; puVar16 = puVar16 + 4; puVar10 = puVar11; local_8 = puVar12; goto LAB_0082e91f; } //@@ 0082ea50 FUN_0082ea50 void FUN_0082ea50(uint param_1,undefined4 *param_2,code *param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; char cVar5; int iVar6; undefined4 *puVar7; int in_ECX; int iVar8; int in_EDX; int iVar9; int iVar10; iVar6 = (int)(param_1 - 1) >> 1; iVar10 = in_EDX; iVar9 = in_EDX; if (in_EDX < iVar6) { do { iVar9 = iVar10 * 2 + 2; iVar8 = iVar9 * 0x10 + in_ECX; cVar5 = (*param_3)(iVar8,iVar8 + -0x10); if (cVar5 != '\0') { iVar9 = iVar10 * 2 + 1; } puVar7 = (undefined4 *)(in_ECX + iVar9 * 0x10); uVar2 = puVar7[1]; uVar3 = puVar7[2]; uVar4 = puVar7[3]; puVar1 = (undefined4 *)(in_ECX + iVar10 * 0x10); *puVar1 = *puVar7; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; iVar10 = iVar9; } while (iVar9 < iVar6); } if ((iVar9 == iVar6) && ((param_1 & 1) == 0)) { puVar1 = (undefined4 *)(in_ECX + -0x10 + param_1 * 0x10); uVar2 = puVar1[1]; uVar3 = puVar1[2]; uVar4 = puVar1[3]; puVar7 = (undefined4 *)(in_ECX + iVar9 * 0x10); *puVar7 = *puVar1; puVar7[1] = uVar2; puVar7[2] = uVar3; puVar7[3] = uVar4; iVar9 = param_1 - 1; } while (in_EDX < iVar9) { iVar10 = iVar9 + -1 >> 1; puVar7 = (undefined4 *)(iVar10 * 0x10 + in_ECX); cVar5 = (*param_3)(puVar7,param_2); if (cVar5 == '\0') break; uVar2 = puVar7[1]; uVar3 = puVar7[2]; uVar4 = puVar7[3]; puVar1 = (undefined4 *)(in_ECX + iVar9 * 0x10); *puVar1 = *puVar7; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; iVar9 = iVar10; } uVar2 = param_2[1]; uVar3 = param_2[2]; uVar4 = param_2[3]; puVar7 = (undefined4 *)(in_ECX + iVar9 * 0x10); *puVar7 = *param_2; puVar7[1] = uVar2; puVar7[2] = uVar3; puVar7[3] = uVar4; return; } //@@ 0082eb20 FUN_0082eb20 void FUN_0082eb20(undefined4 *param_1,code *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; char cVar8; undefined4 *in_ECX; undefined4 *in_EDX; cVar8 = (*param_2)(); if (cVar8 != '\0') { uVar1 = in_ECX[1]; uVar2 = in_ECX[2]; uVar3 = in_ECX[3]; uVar4 = *in_EDX; uVar5 = in_EDX[1]; uVar6 = in_EDX[2]; uVar7 = in_EDX[3]; *in_EDX = *in_ECX; in_EDX[1] = uVar1; in_EDX[2] = uVar2; in_EDX[3] = uVar3; *in_ECX = uVar4; in_ECX[1] = uVar5; in_ECX[2] = uVar6; in_ECX[3] = uVar7; } cVar8 = (*param_2)(param_1); if (cVar8 != '\0') { uVar1 = in_EDX[1]; uVar2 = in_EDX[2]; uVar3 = in_EDX[3]; uVar4 = *param_1; uVar5 = param_1[1]; uVar6 = param_1[2]; uVar7 = param_1[3]; *param_1 = *in_EDX; param_1[1] = uVar1; param_1[2] = uVar2; param_1[3] = uVar3; *in_EDX = uVar4; in_EDX[1] = uVar5; in_EDX[2] = uVar6; in_EDX[3] = uVar7; cVar8 = (*param_2)(); if (cVar8 != '\0') { uVar1 = in_ECX[1]; uVar2 = in_ECX[2]; uVar3 = in_ECX[3]; uVar4 = *in_EDX; uVar5 = in_EDX[1]; uVar6 = in_EDX[2]; uVar7 = in_EDX[3]; *in_EDX = *in_ECX; in_EDX[1] = uVar1; in_EDX[2] = uVar2; in_EDX[3] = uVar3; *in_ECX = uVar4; in_ECX[1] = uVar5; in_ECX[2] = uVar6; in_ECX[3] = uVar7; } } return; } //@@ 0082eb80 Room::GetSecondBossID /* ZHL [lua] Lua binding Room:GetSecondBossID */ int __thiscall Room::GetSecondBossID(Room *this) { return this->_secondBossID; } //@@ 0082eb90 FUN_0082eb90 int FUN_0082eb90(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x1c); uVar2 = (uint3)((uint)iVar1 >> 8); if ((((iVar1 == 3) || (iVar1 == 0xc)) || (iVar1 == 0xd)) || (iVar1 == 0xb)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 0082ebb0 FUN_0082ebb0 void FUN_0082ebb0(void) { int *in_ECX; std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x128); return; } //@@ 0082ebd0 RoomTransition::~RoomTransition /* DB: Game::~Game member: its ANM2 at +0x38 and tree at +0x224 are the Game+0x1b874 ANM2 and the Game+0x1ba60 tree head built in Game::constructor, i.e. this = Game+0x1b83c (_roomTransition, src/structs.hpp); also resets two SmartPointer, a multiset +0x234 and two render-target refs (+0x28/+0x30) */ void RoomTransition::~RoomTransition(void) { int *piVar1; char cVar2; int *in_ECX; undefined4 extraout_ECX; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01fe0; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; KAGE::SmartPointer::reset(in_ECX); KAGE::SmartPointer::reset(extraout_ECX); piVar1 = in_ECX + 0x8d; if (*piVar1 != 0) { local_14 = piVar1; std::multiset::erase(&local_14); *piVar1 = 0; } std::map::_Erase_tree(in_ECX + 0x89,*(undefined4 *)(in_ECX[0x89] + 4)); operator_delete((void *)in_ECX[0x89],0x128); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0xe)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x22)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1a)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x14)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xe)); local_8 = 2; if ((int *)in_ECX[0xd] != (int *)0x0) { cVar2 = (**(code **)(*(int *)in_ECX[0xd] + 0xc))(); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 0xc); } } local_8 = 3; if ((int *)in_ECX[0xb] != (int *)0x0) { cVar2 = (**(code **)(*(int *)in_ECX[0xb] + 0xc))(); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 10); } } ExceptionList = local_10; return; } //@@ 0082ed00 FUN_0082ed00 void FUN_0082ed00(void) { char cVar1; void *pvVar2; int in_ECX; int extraout_ECX; int iVar3; KColor *clearColor; KColor *clearColor_00; KColor local_34; undefined1 local_20 [4]; int *local_1c; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02015; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = in_ECX; if (*(int *)(in_ECX + 0x28) != 0) { KAGE::SmartPointer::reset(in_ECX); iVar3 = extraout_ECX; } if (*(int *)(in_ECX + 0x30) != 0) { KAGE::SmartPointer::reset(iVar3); } KColor::SetFromARGB(&local_34,0); pvVar2 = KAGE_Graphics::create_render_target (local_18,g_framebufferWidth,DAT_00c79114,(byte *)"Old Room Surface",clearColor ); local_8 = 0; shared_ptr::operator_assign((void *)(in_ECX + 0x28),pvVar2); local_8 = 1; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_18); } } local_8 = 0xffffffff; KColor::SetFromARGB(&local_34,0); pvVar2 = KAGE_Graphics::create_render_target (local_20,g_framebufferWidth,DAT_00c79114,(byte *)"New Room Surface", clearColor_00); local_8 = 2; shared_ptr::operator_assign((void *)(in_ECX + 0x30),pvVar2); local_8 = 3; if (local_1c != (int *)0x0) { cVar1 = (**(code **)(*local_1c + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_20); } } ExceptionList = local_10; return; } //@@ 0082ee30 FUN_0082ee30 bool FUN_0082ee30(void) { int *in_ECX; return *in_ECX != 0; } //@@ 0082ee40 RoomTransition::start /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: __thiscall on RoomTransition (Game+0x1b83c), 5 args, only from Game::StartRoomTransition; sets +4/+8/+0x10..+0x24/+0x238; the log message is its first statement */ void __thiscall RoomTransition::start (RoomTransition *this,int param_2,int param_3,int param_4,void *param_5,int param_6) { char isTeleporting; uint uVar1; int iVar2; char *freeBlock; void *playerListEnd; int duration; uint freeSize; Game *extraout_EDX; Game *game; PlayerManager *playerManager; undefined4 *playerSlot; uint playerIndex; int iStack_40; std_string versusScreenPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; Manager *manager; Entity_Player *player; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_24 = uVar1; KAGE_LogMessage(1,(byte *)"[Frame %d] Starting room transition (type %d) \n"); if ((this->_versusScreenSprite)._loaded == 0) { versusScreenPath._size = 0; versusScreenPath._capacity = 0xf; versusScreenPath._buf[0] = '\0'; versusScreenPath._buf[1] = '\0'; versusScreenPath._buf[2] = '\0'; versusScreenPath._buf[3] = '\0'; versusScreenPath._buf._0_4_ = std::_Allocate(0x20); versusScreenPath._size = 0x1d; versusScreenPath._capacity = 0x1f; builtin_strncpy((char *)versusScreenPath._buf._0_4_,"gfx/ui/boss/versusscreen.anm2",0x1e); uStack_14 = 0; ANM2::Load(&this->_versusScreenSprite,&versusScreenPath,1); uStack_14 = 0xffffffff; if (0xf < versusScreenPath._capacity) { freeSize = versusScreenPath._capacity + 1; freeBlock = (char *)versusScreenPath._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(char **)(versusScreenPath._buf._0_4_ + -4); freeSize = versusScreenPath._capacity + 0x24; if ((char *)0x1f < (char *)(versusScreenPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } versusScreenPath._size = 0; versusScreenPath._capacity = 0xf; versusScreenPath._buf._0_4_ = versusScreenPath._buf._0_4_ & 0xffffff00; } game = g_game; if ((*(int *)&g_game->_stageTransition == 0) || (param_4 == 0xf)) { if ((param_2 == g_game->_currentRoomIdx) && (param_6 == g_game->_currentDimensionIdx)) { param_3 = -1; } this->_targetRoomIdx = param_2; this->_frame = 0; this->_animation = param_4; this->_direction = param_3; this->_bossIntroBossId = 0; (game->_playerManager)._roomTransitionPlayer = param_5; *(undefined4 *)&this->field_0x20 = 0; this->_flags = 0; iVar2 = param_6; if (param_6 < 0) { iVar2 = game->_currentDimensionIdx; } this->_targetDimension = iVar2; playerManager = &game->_playerManager; playerIndex = 0; iStack_40 = param_3; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playerListEnd = (playerManager->_playerList)._end; if ((int)playerListEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (playerIndex < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + playerIndex; } player = (Entity_Player *)*playerSlot; if (player->_variant == 0) { isTeleporting = FUN_0082eb90(uVar1); if ((isTeleporting == '\0') || (player->_dead != 0)) { game = extraout_EDX; if (this->_animation == 0x14) { Entity_Player::PlayExtraAnimation(player,(byte *)"DeathTeleport"); goto LAB_0082f089; } } else { Entity_Player::AnimateTeleport(param_4 != 0xb); LAB_0082f089: game = g_game; } (player->_velocity).x = g_vectorZero.x; (player->_velocity).y = g_vectorZero.y; player->_isControlsEnabled = 0; } playerIndex = playerIndex + 1; playerManager = &game->_playerManager; } while (playerIndex < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } iVar2 = this->_animation; *(undefined4 *)this = 1; if (iVar2 == 2) { this->_duration = 0x1e; *(undefined4 *)&this->field_0xc = 0; (this->_slideOffset).x = g_vectorZero.x; (this->_slideOffset).y = g_vectorZero.y; } else { duration = 3; if (iStack_40 != -1) { duration = 7; } this->_duration = duration; *(undefined4 *)&this->field_0xc = 0; (this->_slideOffset).x = g_vectorZero.x; (this->_slideOffset).y = g_vectorZero.y; manager = g_manager; if (iVar2 == 0x12) { iStack_40 = (param_6 != 1) + 0x260; seed_fart_sound_override(&iStack_40); SoundEffects::Play(&manager->_sfxManager,iStack_40,1.0,2,0,1.0,0.0); } } } ExceptionList = local_1c; return; } //@@ 0082f1c0 RoomTransition::StartBossIntro /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0082f3b7) */ /* WARNING: Removing unreachable block (ram,0x0082f31c) */ /* WARNING: Removing unreachable block (ram,0x0082f472) */ /* WARNING: Removing unreachable block (ram,0x0082f421) */ /* WARNING: Removing unreachable block (ram,0x0082f410) */ /* WARNING: Removing unreachable block (ram,0x0082f2df) */ /* WARNING: Removing unreachable block (ram,0x0082f2e8) */ /* WARNING: Removing unreachable block (ram,0x0082f2eb) */ /* WARNING: Removing unreachable block (ram,0x0082f32d) */ /* WARNING: Removing unreachable block (ram,0x0082f38a) */ /* WARNING: Removing unreachable block (ram,0x0082f3d7) */ /* WARNING: Removing unreachable block (ram,0x0082f3e0) */ /* WARNING: Removing unreachable block (ram,0x0082f3e3) */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall void RoomTransition::StartBossIntro(unsigned int bossID1,unsigned int bossID2); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall RoomTransition::StartBossIntro(RoomTransition *this,uint bossID1,uint bossID2) { byte bVar1; char cVar2; uint uVar3; std_string *psVar4; LayerState *layer; int iVar5; EntityPtr coopPlayer; uint uVar6; uint *puVar7; int *piVar8; undefined4 *puVar9; RoomDescriptor *roomDesc; byte extraout_CL; byte extraout_CL_00; undefined1 *puVar10; void *pvVar11; Game *pGVar12; uint *puVar13; char *pcVar14; byte *pbVar15; float extraout_ECX; float extraout_ECX_00; float fVar16; Game *extraout_EDX; Game *pGVar17; Sprite *stageType; byte *pbVar18; void **ppvVar19; Sprite *versusSprite; Game *pGVar20; undefined4 uVar21; undefined4 uVar22; char *pcVar23; undefined4 uVar24; Game *local_7c; char isAnm2LoadNeeded; int *portraitTexture; std_string *local_70; EntityPtr local_6c; Game *local_68; Sprite *local_64; byte local_5d; std_string anm2Path; std_string tmpString; byte local_2c; byte local_2b; byte local_2a; Game *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ANM2 *versusAnm2; puStack_20 = (undefined1 *)((int)&tmpString + 0x40); local_14 = 0xffffffff; puStack_18 = &LAB_00b02107; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)((int)&tmpString + 0x34U); ExceptionList = &local_1c; local_6c = (EntityPtr)0x0; local_68 = (Game *)0x0; this->_bossIntroBossId = bossID1; local_7c = (Game *)this; local_24 = uVar3; puVar10 = (undefined1 *)((int)&tmpString + 0x40); if (*(int *)this != 0) { Music::Play((Music *)&g_manager->_musicManager,0x51,(g_manager->_optionsConfig)._musicVolume); puVar10 = puStack_20; } puStack_20 = puVar10; FUN_007ea5d0(uVar3); (g_game->_hud)._isVisible = 0; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1d; anm2Path._capacity = (uint)&DAT_0000001f; *(undefined4 *)((std_string *)anm2Path._buf._0_4_)->_buf = 0x2f786667; *(undefined4 *)((int)((std_string *)anm2Path._buf._0_4_)->_buf + 4) = 0x622f6975; builtin_strncpy((char *)((int)((std_string *)anm2Path._buf._0_4_)->_buf + 8),"oss/",4); builtin_strncpy((char *)((int)((std_string *)anm2Path._buf._0_4_)->_buf + 0xc),"vers",4); ((std_string *)anm2Path._buf._0_4_)->_size = 0x63737375; ((std_string *)anm2Path._buf._0_4_)->_capacity = 0x6e656572; builtin_strncpy(((std_string *)(anm2Path._buf._0_4_ + 0x18))->_buf,".anm2",6); local_14 = 0; local_5d = 0; if (bossID1 == 99) { local_70 = (std_string *)0x1f; local_6c = (EntityPtr)&DAT_0000002f; local_70 = std::_Allocate(0x30); anm2Path._size = 0x23; anm2Path._capacity = (uint)local_6c; *(undefined4 *)local_70->_buf = 0x2f786667; *(undefined4 *)((int)local_70->_buf + 4) = 0x622f6975; builtin_strncpy((char *)((int)local_70->_buf + 8),"oss/",4); builtin_strncpy((char *)((int)local_70->_buf + 0xc),"vers",4); local_70->_size = 0x63737375; local_70->_capacity = 0x6e656572; builtin_strncpy(local_70[1]._buf,"_dogma.anm2",0xc); operator_delete((void *)anm2Path._buf._0_4_,0x20); anm2Path._buf._0_4_ = local_70; local_5d = 1; } else if (bossID1 == 0x58) { local_70 = (std_string *)0x1f; local_6c = (EntityPtr)&DAT_0000002f; local_70 = std::_Allocate(0x30); anm2Path._capacity = (uint)local_6c; anm2Path._size = 0x24; *(undefined4 *)local_70->_buf = 0x2f786667; *(undefined4 *)((int)local_70->_buf + 4) = 0x622f6975; builtin_strncpy((char *)((int)local_70->_buf + 8),"oss/",4); builtin_strncpy((char *)((int)local_70->_buf + 0xc),"vers",4); local_70->_size = 0x63737375; local_70->_capacity = 0x6e656572; builtin_strncpy(local_70[1]._buf,"_mother.anm2",0xd); operator_delete((void *)anm2Path._buf._0_4_,0x20); anm2Path._buf._0_4_ = local_70; } if ((this->_versusScreenSprite)._loaded == 0) { pbVar18 = (byte *)tmpString._buf._0_4_; LAB_0082f4e7: isAnm2LoadNeeded = '\x01'; } else { std::string::string(tmpString._buf,&this->_versusScreenSprite); pbVar18 = (byte *)tmpString._buf._0_4_; local_68 = (Game *)&DAT_00000009; psVar4 = &anm2Path; if ((Game *)&DAT_0000000f < anm2Path._capacity) { psVar4 = (std_string *)anm2Path._buf._0_4_; } pbVar15 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar15 = (byte *)tmpString._buf._0_4_; } bVar1 = str_eq(pbVar15,tmpString._size,(byte *)psVar4,anm2Path._size); if (bVar1 == 0) goto LAB_0082f4e7; isAnm2LoadNeeded = '\0'; } if ((((uint)local_68 & 1) != 0) && (local_68 = (Game *)((uint)local_68 & 0xfffffffe), &DAT_0000000f < tmpString._capacity)) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar15 = pbVar18; if ((undefined1 *)0xfff < puVar10) { pbVar15 = *(byte **)((int)pbVar18 + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < pbVar18 + (-4 - (int)pbVar15)) goto LAB_00830911; } operator_delete(pbVar15,(uint)puVar10); } local_64 = (Sprite *)&this->_versusScreenSprite; if (isAnm2LoadNeeded != '\0') { ANM2::Load((ANM2 *)local_64,&anm2Path,1); } if (bossID1 == 99) { local_64 = (Sprite *)&this->_versusScreenSprite; layer = ANM2::GetLayer((ANM2 *)local_64,&DAT_0000000b); layer->_bitflags = layer->_bitflags | 0x60; } layer = ANM2::GetLayer(&this->_versusScreenSprite,&DAT_0000000b); layer->_blendMode[0] = 0; layer->_blendMode[1] = 4; layer->_blendMode[2] = 7; layer->_blendMode[3] = 4; layer->_blendMode[4] = 7; pvVar11 = (this->_sprites)._head; std::map::_Erase_tree(&this->_sprites,*(undefined4 *)((int)pvVar11 + 4)); pGVar20 = g_game; *(void **)((int)pvVar11 + 4) = pvVar11; *(void **)pvVar11 = pvVar11; *(void **)((int)pvVar11 + 8) = pvVar11; (this->_sprites)._size = 0; local_6c = (EntityPtr)(pGVar20->_playerManager)._roomTransitionPlayer; if (local_6c == (EntityPtr)0x0) { local_6c = (EntityPtr)Game::GetPlayer(pGVar20,0); } versusSprite = local_64; iVar5 = *(int *)((int)local_6c + 0x13c0); if (iVar5 < 0) { LAB_0082f7d9: KAGE_LogMessage(1,(byte *)"[warn] could not load player config for type %d.\n"); versusSprite = local_64; pGVar20 = local_7c; } else { local_70 = (g_manager->_entityConfig)._players._begin; if (((int)(g_manager->_entityConfig)._players._end - (int)local_70) / 0x148 <= iVar5) goto LAB_0082f7d9; psVar4 = (std_string *)((int)local_70 + iVar5 * 0x148); local_70 = psVar4; if (psVar4 == (std_string *)0x0) goto LAB_0082f7d9; layer = ANM2::GetLayer((ANM2 *)local_64,&DAT_00000005); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0xc); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000f); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x12); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x15); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x10); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_00000013); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x16); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_00000011); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_00000014); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_00000017); pGVar20 = local_7c; layer->_visible = 0; FUN_00831780(psVar4,5,0xc,3); Sprite::ReplaceSpritesheet(versusSprite,6,(std_string *)(local_70[2]._buf + 4)); local_7c = (Game *)&g_game->_playerManager; local_64 = (Sprite *)0x1; iVar5 = PlayerManager::count_main_players((PlayerManager *)local_7c); if (iVar5 != 0) { uVar3 = 0; do { coopPlayer = (EntityPtr)PlayerManager::get_main_player((PlayerManager *)local_7c,uVar3); if (((coopPlayer != (EntityPtr)0x0) && (coopPlayer != local_6c)) && (coopPlayer != *(EntityPtr *)((int)local_6c + 0x1e68))) { local_70 = *(std_string **)((int)coopPlayer + 0x13c0); if (((int)local_70 < 0) || (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= (int)local_70)) { pvVar11 = (void *)0x0; } else { pvVar11 = (void *)((int)local_70 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); } if (local_64 == (Sprite *)0x1) { uVar24 = 0xf; uVar22 = 0x15; uVar21 = 0x12; LAB_0082f7ac: FUN_00831780(pvVar11,uVar21,uVar22,uVar24); } else { if (local_64 == (Sprite *)0x2) { uVar24 = 0x10; uVar22 = 0x16; uVar21 = 0x13; goto LAB_0082f7ac; } if (local_64 == (Sprite *)0x3) { uVar24 = 0x11; uVar22 = 0x17; uVar21 = 0x14; goto LAB_0082f7ac; } KAGE_LogMessage(0x10,(byte *)"Ran out of slots for players"); } local_64 = (Sprite *)((local_64->_filename)._buf + 1); } uVar3 = uVar3 + 1; local_7c = (Game *)&g_game->_playerManager; uVar6 = PlayerManager::count_main_players((PlayerManager *)local_7c); } while (uVar3 < uVar6); versusSprite = (Sprite *)(pGVar20->_roomList[0]._doors + 2); } } local_7c = (Game *)g_game->_stage; local_28 = local_7c; local_70 = (std_string *)Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); local_6c = (EntityPtr)g_game; local_64 = (Sprite *)local_70; if (g_game->_currentRoomIdx == -0x11) { Level::boss_count_adjust((int *)&local_7c,(int *)&local_70); local_64 = (Sprite *)local_70; pGVar12 = local_7c; pGVar17 = extraout_EDX; } else { pGVar12 = local_28; pGVar17 = g_game; } if ((*(int *)((int)pGVar17->_room + 8) == 5) && (*(int *)(*(int *)(*(int *)((int)pGVar17->_room + 4) + 0x10) + 0x10) == 0x5a)) { pGVar12 = (Game *)0x8; stageType = (Sprite *)(std_string *)0x0; } else { stageType = local_64; } local_70 = &local_64->_filename; local_7c = (Game *)RoomConfig::GetStageID((uint)pGVar12,(uint)stageType,-1); local_28 = (Game *)g_manager; if (((int)bossID1 < 0) || (((int)(g_manager->_entityConfig)._bosses._end - (int)(g_manager->_entityConfig)._bosses._begin ) / 100 <= (int)bossID1)) { KAGE_LogMessage(0x10,(byte *)"BossID out of bounds\n"); local_6c = (EntityPtr)g_game; } local_64 = (Sprite *) (bossID1 * 100 + *(int *)&local_28->_glowingHourglassStates[0]._gameState.field_0x3ca0) ; uVar3 = 0xffffffff; if (local_6c != (EntityPtr)0x0) { if (*(int *)((int)local_6c + 0x26584) == 0x2c) { uVar6 = Level::GetRoomStageType((Level *)local_6c,*(int *)((int)local_6c + 0x18304)); uVar3 = *(int *)local_6c; } else { if (*(int *)((int)local_6c + 0x1830c) == 2) { uVar3 = 0x23; goto LAB_0082f917; } uVar6 = *(int *)((int)local_6c + 4); uVar3 = *(int *)local_6c; } uVar3 = RoomConfig::GetStageID(uVar3,uVar6,-1); } LAB_0082f917: puVar7 = *(uint **)((int)local_64 + 0x58); if (puVar7 != *(uint **)((int)local_64 + 0x5c)) { do { if (*puVar7 == uVar3) { puVar7 = puVar7 + 1; goto LAB_0082f933; } puVar7 = puVar7 + 7; } while (puVar7 != *(uint **)((int)local_64 + 0x5c)); } puVar7 = (uint *)((int)local_64 + 0x34); LAB_0082f933: if (0xf < puVar7[5]) { puVar7 = (uint *)*puVar7; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)((int)puVar7 + 1); puVar13 = puVar7; do { uVar3 = *puVar13; puVar13 = (uint *)((int)puVar13 + 1); } while ((char)uVar3 != '\0'); std::string::assign(tmpString._buf,(byte *)puVar7,(int)puVar13 - (int)local_28); local_14._0_1_ = 1; if (4 < *(int *)&pGVar20->_roomList[0].field_0xa4) { local_28 = *(Game **)&pGVar20->_roomList[0].field_0xa0; piVar8 = &local_28->_roomList[3].GreedSubType; if (0xf < (uint)local_28->_roomList[3].AwardSeed) { piVar8 = (int *)local_28->_roomList[3].GreedSubType; } pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } bVar1 = str_eq(pbVar18,tmpString._size,(byte *)piVar8,local_28->_roomList[3].SpawnSeed); if (bVar1 == 0) { piVar8 = &local_28->_roomList[3].GreedSubType; pGVar12 = local_28; if ((std_string *)piVar8 != &tmpString) { pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } std::string::assign((char *)piVar8,pbVar18,tmpString._size); pGVar12 = *(Game **)&pGVar20->_roomList[0].field_0xa0; } *(undefined1 *)&pGVar12->_roomList[3].SavedEntities._begin = 0; } } local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } uVar3 = 0xffffffff; local_28 = g_game; if (g_game != (Game *)0x0) { if (g_game->_challenge == 0x2c) { uVar6 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); uVar3 = local_28->_stage; } else { if (g_game->_currentDimensionIdx == 2) { uVar3 = 0x23; goto LAB_0082fa81; } uVar6 = g_game->_stageType; uVar3 = g_game->_stage; } uVar3 = RoomConfig::GetStageID(uVar3,uVar6,-1); } LAB_0082fa81: puVar7 = *(uint **)((int)local_64 + 0x58); if (puVar7 != *(uint **)((int)local_64 + 0x5c)) { do { if (*puVar7 == uVar3) { puVar7 = puVar7 + 1; goto LAB_0082faa3; } puVar7 = puVar7 + 7; } while (puVar7 != *(uint **)((int)local_64 + 0x5c)); } puVar7 = (uint *)((int)local_64 + 0x34); LAB_0082faa3: if (0xf < puVar7[5]) { puVar7 = (uint *)*puVar7; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)((int)puVar7 + 1); puVar13 = puVar7; do { uVar3 = *puVar13; puVar13 = (uint *)((int)puVar13 + 1); } while ((char)uVar3 != '\0'); std::string::assign(tmpString._buf,(byte *)puVar7,(int)puVar13 - (int)local_28); local_14._0_1_ = 2; if (0xd < *(int *)&pGVar20->_roomList[0].field_0xa4) { local_28 = *(Game **)&pGVar20->_roomList[0].field_0xa0; piVar8 = local_28->_roomList[0xb]._doors + 4; if (0xf < (uint)local_28->_roomList[0xb].VisitedCount) { piVar8 = (int *)local_28->_roomList[0xb]._doors[4]; } pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } bVar1 = str_eq(pbVar18,tmpString._size,(byte *)piVar8,local_28->_roomList[0xb].DisplayFlags); if (bVar1 == 0) { piVar8 = local_28->_roomList[0xb]._doors + 4; pGVar12 = local_28; if ((std_string *)piVar8 != &tmpString) { pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } std::string::assign((char *)piVar8,pbVar18,tmpString._size); pGVar12 = versusSprite->_layerState; } *(undefined1 *)&pGVar12->_roomList[0xb].PitsCount = 0; } } local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } if (bossID2 == 0) { uVar3 = 0xffffffff; if (g_game != (Game *)0x0) { uVar3 = Game::GetStageID(g_game,(byte)g_game); } puVar7 = *(uint **)((int)local_64 + 0x58); if (puVar7 != *(uint **)((int)local_64 + 0x5c)) { do { if (*puVar7 == uVar3) { puVar7 = puVar7 + 1; goto LAB_0082fdd5; } puVar7 = puVar7 + 7; } while (puVar7 != *(uint **)((int)local_64 + 0x5c)); } puVar7 = (uint *)((int)local_64 + 0x34); LAB_0082fdd5: if (0xf < puVar7[5]) { puVar7 = (uint *)*puVar7; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)((int)puVar7 + 1); puVar13 = puVar7; do { uVar3 = *puVar13; puVar13 = (uint *)((int)puVar13 + 1); } while ((char)uVar3 != '\0'); std::string::assign(tmpString._buf,(byte *)puVar7,(int)puVar13 - (int)local_28); local_14._0_1_ = 5; if (9 < *(int *)&pGVar20->_roomList[0].field_0xa4) { local_28 = *(Game **)&pGVar20->_roomList[0].field_0xa0; ppvVar19 = &local_28->_roomList[7].SavedEffects._end; if (0xf < *(uint *)&local_28->_roomList[7].field_0xa0) { ppvVar19 = local_28->_roomList[7].SavedEffects._end; } pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } bVar1 = str_eq(pbVar18,tmpString._size,(byte *)ppvVar19, *(uint *)&local_28->_roomList[7].field_0x9c); if (bVar1 == 0) { ppvVar19 = &local_28->_roomList[7].SavedEffects._end; pGVar12 = local_28; if ((std_string *)ppvVar19 != &tmpString) { pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } std::string::assign((char *)ppvVar19,pbVar18,tmpString._size); pGVar12 = *(Game **)&pGVar20->_roomList[0].field_0xa0; } *(undefined1 *)&pGVar12->_roomList[7].Group = 0; } } local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } uVar3 = 0xffffffff; if (g_game != (Game *)0x0) { uVar3 = Game::GetStageID(g_game,(byte)g_game); } puVar7 = *(uint **)((int)local_64 + 0x58); if (puVar7 != *(uint **)((int)local_64 + 0x5c)) { do { if (*puVar7 == uVar3) { puVar7 = puVar7 + 1; goto LAB_0082ff03; } puVar7 = puVar7 + 7; } while (puVar7 != *(uint **)((int)local_64 + 0x5c)); } puVar7 = (uint *)((int)local_64 + 0x34); LAB_0082ff03: if (0xf < puVar7[5]) { puVar7 = (uint *)*puVar7; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)((int)puVar7 + 1); puVar13 = puVar7; do { uVar3 = *puVar13; puVar13 = (uint *)((int)puVar13 + 1); } while ((char)uVar3 != '\0'); std::string::assign(tmpString._buf,(byte *)puVar7,(int)puVar13 - (int)local_28); local_14 = CONCAT31(local_14._1_3_,6); } else { local_28 = (Game *)g_manager; if (((int)bossID2 < 0) || (((int)(g_manager->_entityConfig)._bosses._end - (int)(g_manager->_entityConfig)._bosses._begin) / 100 <= (int)bossID2)) { KAGE_LogMessage(0x10,(byte *)"BossID out of bounds\n"); } uVar3 = 0xffffffff; local_70 = (std_string *) (bossID2 * 100 + *(int *)&local_28->_glowingHourglassStates[0]._gameState.field_0x3ca0); if (g_game != (Game *)0x0) { uVar3 = Game::GetStageID(g_game,(byte)g_game); } puVar7 = (uint *)local_70[3]._size; if (puVar7 != (uint *)local_70[3]._capacity) { do { if (*puVar7 == uVar3) { pcVar23 = (char *)(puVar7 + 1); goto LAB_0082fc23; } puVar7 = puVar7 + 7; } while (puVar7 != (uint *)local_70[3]._capacity); } pcVar23 = local_70[2]._buf + 4; LAB_0082fc23: if (0xf < *(uint *)(pcVar23 + 0x14)) { pcVar23 = *(char **)pcVar23; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)(pcVar23 + 1); pcVar14 = pcVar23; do { cVar2 = *pcVar14; pcVar14 = pcVar14 + 1; } while (cVar2 != '\0'); std::string::assign(tmpString._buf,(byte *)pcVar23,(int)pcVar14 - (int)local_28); local_14._0_1_ = 3; if (9 < *(int *)&pGVar20->_roomList[0].field_0xa4) { local_28 = *(Game **)&pGVar20->_roomList[0].field_0xa0; ppvVar19 = &local_28->_roomList[7].SavedEffects._end; if (0xf < *(uint *)&local_28->_roomList[7].field_0xa0) { ppvVar19 = local_28->_roomList[7].SavedEffects._end; } pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } bVar1 = str_eq(pbVar18,tmpString._size,(byte *)ppvVar19, *(uint *)&local_28->_roomList[7].field_0x9c); if (bVar1 == 0) { ppvVar19 = &local_28->_roomList[7].SavedEffects._end; pGVar12 = local_28; if ((std_string *)ppvVar19 != &tmpString) { pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } std::string::assign((char *)ppvVar19,pbVar18,tmpString._size); pGVar12 = *(Game **)&pGVar20->_roomList[0].field_0xa0; } *(undefined1 *)&pGVar12->_roomList[7].Group = 0; } } local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } uVar3 = 0xffffffff; if (g_game != (Game *)0x0) { uVar3 = Game::GetStageID(g_game,(byte)g_game); } puVar7 = (uint *)local_70[3]._size; if (puVar7 != (uint *)local_70[3]._capacity) { do { if (*puVar7 == uVar3) { pcVar23 = (char *)(puVar7 + 1); goto LAB_0082fd47; } puVar7 = puVar7 + 7; } while (puVar7 != (uint *)local_70[3]._capacity); } pcVar23 = local_70[2]._buf + 4; LAB_0082fd47: if (0xf < *(uint *)(pcVar23 + 0x14)) { pcVar23 = *(char **)pcVar23; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)(pcVar23 + 1); pcVar14 = pcVar23; do { cVar2 = *pcVar14; pcVar14 = pcVar14 + 1; } while (cVar2 != '\0'); std::string::assign(tmpString._buf,(byte *)pcVar23,(int)pcVar14 - (int)local_28); local_14 = CONCAT31(local_14._1_3_,4); } if (0xe < *(int *)&pGVar20->_roomList[0].field_0xa4) { local_28 = *(Game **)&pGVar20->_roomList[0].field_0xa0; ppvVar19 = &local_28->_roomList[0xc].OverrideData; if (0xf < (uint)local_28->_roomList[0xc]._doors[3]) { ppvVar19 = local_28->_roomList[0xc].OverrideData; } pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } bVar1 = str_eq(pbVar18,tmpString._size,(byte *)ppvVar19,local_28->_roomList[0xc]._doors[2]); if (bVar1 == 0) { ppvVar19 = &local_28->_roomList[0xc].OverrideData; pGVar12 = local_28; if ((std_string *)ppvVar19 != &tmpString) { pbVar18 = (byte *)&tmpString; if (&DAT_0000000f < tmpString._capacity) { pbVar18 = (byte *)tmpString._buf._0_4_; } std::string::assign((char *)ppvVar19,pbVar18,tmpString._size); pGVar12 = *(Game **)&pGVar20->_roomList[0].field_0xa0; } *(undefined1 *)&pGVar12->_roomList[0xc].DisplayFlags = 0; } } local_14 = local_14 & 0xffffff00; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } if (bossID1 == 0x28) { local_70 = (std_string *)&(g_game->_seedEffects)._seedEffects; local_28 = (Game *)&DAT_0000004f; std::set::find_node((undefined1 *)((int)&tmpString + 0xc),&local_28); if ((*(char *)(tmpString._capacity + 0xd) != '\0') || (0x4f < *(int *)(tmpString._capacity + 0x10))) { tmpString._capacity = *(uint *)local_70->_buf; } if ((undefined1 *)tmpString._capacity != *(undefined1 **)local_70->_buf) { tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; std::string::assign(tmpString._buf, (byte *)"gfx/promo/gfuel/ui/boss/g fuel bluebaby portrait.png",0x34); local_14._0_1_ = 7; Sprite::ReplaceSpritesheet(versusSprite,4,&tmpString); local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; std::string::assign(tmpString._buf, (byte *)"gfx/promo/gfuel/ui/boss/g fuel bluebaby portrait.png",0x34); local_14._0_1_ = 8; Sprite::ReplaceSpritesheet(versusSprite,0xd,&tmpString); local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } } } pbVar18 = (byte *)((int)local_64 + 0x1c); if (0xf < *(uint *)((int)local_64 + 0x30)) { pbVar18 = *(byte **)pbVar18; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)(pbVar18 + 1); pbVar15 = pbVar18; do { bVar1 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar1 != 0); std::string::assign(tmpString._buf,pbVar18,(int)pbVar15 - (int)local_28); local_14._0_1_ = 9; Sprite::ReplaceSpritesheet(versusSprite,7,&tmpString); local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); } layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_00000004); (layer->_pos).x = *(float *)((int)local_64 + 0x4c); (layer->_pos).y = *(float *)((int)local_64 + 0x50); layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000d); (layer->_pos).x = *(float *)((int)local_64 + 0x4c); (layer->_pos).y = *(float *)((int)local_64 + 0x50); layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_00000009); (layer->_pos).x = *(float *)((int)local_64 + 0x4c); (layer->_pos).y = *(float *)((int)local_64 + 0x50); layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000e); (layer->_pos).x = *(float *)((int)local_64 + 0x4c); fVar16 = *(float *)((int)local_64 + 0x50); (layer->_pos).y = fVar16; if (local_5d == 0) { iVar5 = (int)local_7c * 0xc4; std::string::string(tmpString._buf,g_game->_ventricleRazorPortals + iVar5 + 0x5b4); local_68 = (Game *)((uint)local_68 | 0x10); local_14._0_1_ = 10; Sprite::ReplaceSpritesheet((Sprite *)(pGVar20->_roomList[0]._doors + 2),3,&tmpString); local_14 = (uint)local_14._1_3_ << 8; std::string::_Tidy_deallocate(tmpString._buf); std::string::string(tmpString._buf,g_game->_ventricleRazorPortals + iVar5 + 0x5b4); local_68 = (Game *)((uint)local_68 | 0x20); local_14._0_1_ = 0xb; Sprite::ReplaceSpritesheet((Sprite *)(pGVar20->_roomList[0]._doors + 2),0xf,&tmpString); local_14 = (uint)local_14._1_3_ << 8; std::string::_Tidy_deallocate(tmpString._buf); std::string::string(tmpString._buf,g_game->_ventricleRazorPortals + iVar5 + 0x5b4); local_68 = (Game *)((uint)local_68 | 0x40); local_14._0_1_ = 0xc; Sprite::ReplaceSpritesheet((Sprite *)(pGVar20->_roomList[0]._doors + 2),0x10,&tmpString); local_14 = (uint)local_14._1_3_ << 8; std::string::_Tidy_deallocate(tmpString._buf); std::string::string(tmpString._buf,g_game->_ventricleRazorPortals + iVar5 + 0x5b4); local_68 = (Game *)((uint)local_68 | 0x80); local_14._0_1_ = 0xd; Sprite::ReplaceSpritesheet((Sprite *)(pGVar20->_roomList[0]._doors + 2),0x11,&tmpString); local_14 = (uint)local_14._1_3_ << 8; std::string::_Tidy_deallocate(tmpString._buf); std::string::string(tmpString._buf,g_game->_ventricleRazorPortals + iVar5 + 0x5cc); local_68 = (Game *)((uint)local_68 | 0x100); local_14._0_1_ = 0xe; versusSprite = (Sprite *)(pGVar20->_roomList[0]._doors + 2); Sprite::ReplaceSpritesheet(versusSprite,2,&tmpString); local_14 = (uint)local_14._1_3_ << 8; std::string::_Tidy_deallocate(tmpString._buf); local_5d = bossID1 != 0x37; layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x2); layer->_visible = local_5d; fVar16 = extraout_ECX; } if (bossID1 == 0x58) { pbVar18 = (byte *)FUN_0069d250(fVar16); if (0xf < *(uint *)(pbVar18 + 0x14)) { pbVar18 = *(byte **)pbVar18; } tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; local_28 = (Game *)(pbVar18 + 1); pbVar15 = pbVar18; do { bVar1 = *pbVar15; pbVar15 = pbVar15 + 1; } while (bVar1 != 0); std::string::assign(tmpString._buf,pbVar18,(int)pbVar15 - (int)local_28); local_14._0_1_ = 0xf; Sprite::ReplaceSpritesheet(versusSprite,0x18,&tmpString); local_14 = (uint)local_14._1_3_ << 8; fVar16 = extraout_ECX_00; if (tmpString._capacity < (undefined1 *)0x10) goto LAB_0083066a; puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); ANM2::LoadGraphics((ANM2 *)versusSprite,(byte)puVar10); LAB_0083041c: layer = ANM2::GetLayer((ANM2 *)(pGVar20->_roomList[0]._doors + 2),(byte *)0x2); piVar8 = LayerState::GetTexture(layer,&portraitTexture); local_14 = CONCAT31(local_14._1_3_,0x10); local_6c = (EntityPtr)((uint)local_68 | 2); local_68 = (Game *)local_6c; if (*piVar8 == 0) { LAB_0083047c: local_5d = 0; } else { layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x2); puVar9 = LayerState::GetTexture(layer,&local_2c); local_14 = 0x11; local_6c = (EntityPtr)((uint)local_68 | 4); local_68 = (Game *)local_6c; cVar2 = (*(code *)**(undefined4 **)*puVar9)(); local_5d = 1; if (cVar2 == '\0') goto LAB_0083047c; } if (((uint)local_68 & 4) != 0) { local_6c = (EntityPtr)((uint)local_68 & 0xfffffffb); local_14 = 0x12; local_68 = (Game *)local_6c; if (((local_28 != (Game *)0x0) && (cVar2 = (**(code **)((int)local_28->_stage + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_2c); } } local_14 = 0; if (((uint)local_68 & 2) != 0) { local_14 = 0x13; if (((local_70 != (std_string *)0x0) && (cVar2 = (**(code **)((int)*(void **)local_70->_buf + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&portraitTexture); } local_14 = local_14 & 0xffffff00; } versusAnm2 = (ANM2 *)(pGVar20->_roomList[0]._doors + 2); if (local_5d == 0) { layer = ANM2::GetLayer(versusAnm2,(byte *)0x0); (layer->_color)._tint[0] = 0.0; (layer->_color)._tint[1] = 0.0; (layer->_color)._tint[2] = 0.0; (layer->_color)._tint[3] = 1.0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000d); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 0.5568628; (layer->_color)._tint[2] = 0.4666667; (layer->_color)._tint[3] = 1.0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000e); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 0.5568628; (layer->_color)._tint[2] = 0.4666667; (layer->_color)._tint[3] = 1.0; } else { layer = ANM2::GetLayer(versusAnm2,(byte *)0x2); LayerState::GetTexture(layer,&portraitTexture); local_14._0_1_ = 0x14; (**(code **)(*portraitTexture + 0x30))(0,0,2,1,&local_2c); layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x0); (layer->_color)._tint[3] = 1.0; (layer->_color)._tint[0] = (float)local_2c * 0.003921569; (layer->_color)._tint[1] = (float)local_2b * 0.003921569; (layer->_color)._tint[2] = (float)local_2a * 0.003921569; layer = ANM2::GetLayer((ANM2 *)(pGVar20->_roomList[0]._doors + 2),&DAT_0000000d); (layer->_color)._tint[3] = 1.0; (layer->_color)._tint[0] = (float)(((uint)local_28 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[1] = (float)(((uint)local_28 >> 8 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[2] = (float)(((uint)local_28 >> 0x10 & 0xff) * 2) * 0.003921569; layer = ANM2::GetLayer((ANM2 *)(pGVar20->_roomList[0]._doors + 2),&DAT_0000000e); (layer->_color)._tint[0] = (float)(((uint)local_28 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[1] = (float)(((uint)local_28 >> 8 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[2] = (float)(((uint)local_28 >> 0x10 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[3] = 1.0; local_14._0_1_ = 0x15; if (((local_70 != (std_string *)0x0) && (cVar2 = (**(code **)((int)*(void **)local_70->_buf + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&portraitTexture); } local_14 = (uint)local_14._1_3_ << 8; versusSprite = (Sprite *)(pGVar20->_roomList[0]._doors + 2); } if (bossID1 == 0x37) { layer = ANM2::GetLayer((ANM2 *)versusSprite,(byte *)0x0); (layer->_color)._tint[0] = 0.0; (layer->_color)._tint[1] = 0.0; (layer->_color)._tint[2] = 0.0; goto LAB_0083077d; } } else { LAB_0083066a: ANM2::LoadGraphics((ANM2 *)versusSprite,SUB41(fVar16,0)); if (bossID1 != 99) goto LAB_0083041c; layer = ANM2::GetLayer((ANM2 *)(pGVar20->_roomList[0]._doors + 2),(byte *)0x0); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000d); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; layer = ANM2::GetLayer((ANM2 *)versusSprite,&DAT_0000000e); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; LAB_0083077d: (layer->_color)._tint[3] = 1.0; } roomDesc = Level::GetRoomByIdx((Level *)g_game,pGVar20->_roomList[0].GridIndex,-1); local_28 = (Game *)&roomDesc->Data; pvVar11 = *(void **)local_28; if (pvVar11 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"Room Data is NULL in RoomTransition::change_room.\n"); pvVar11 = (void *)local_28->_stage; } if ((*(int *)((int)pvVar11 + 8) == 5) && (*(int *)((int)pvVar11 + 0xc) - 0xe74U < 0x96)) { tmpString._size = 0; tmpString._capacity = (uint)&DAT_0000000f; tmpString._buf._0_4_ = (byte *)0x0; std::string::assign(tmpString._buf,(byte *)"gfx/ui/boss/doubletrouble.png",0x1d); local_14._0_1_ = 0x16; Sprite::ReplaceSpritesheet(versusSprite,10,&tmpString); local_14 = (uint)local_14._1_3_ << 8; bVar1 = extraout_CL; if (&DAT_0000000f < tmpString._capacity) { puVar10 = (undefined1 *)(tmpString._capacity + 1); pbVar18 = (byte *)tmpString._buf._0_4_; if ((undefined1 *)0xfff < puVar10) { pbVar18 = *(byte **)(tmpString._buf._0_4_ + 0xfffffffc); puVar10 = (undefined1 *)(tmpString._capacity + 0x24); if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pbVar18))) goto LAB_00830911; } operator_delete(pbVar18,(uint)puVar10); bVar1 = extraout_CL_00; } ANM2::LoadGraphics((ANM2 *)versusSprite,bVar1); if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (uVar3 = PlayerManager::count_main_players(&g_game->_playerManager), uVar3 < 2)) { pcVar23 = "DoubleTrouble"; goto LAB_008308ce; } ANM2::Play((ANM2 *)versusSprite,(byte *)"DoubleTroubleCoop",1); } else if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (uVar3 = PlayerManager::count_main_players(&g_game->_playerManager), uVar3 < 2)) { pcVar23 = "Scene"; LAB_008308ce: bVar1 = ANM2::SetAnimation((ANM2 *)versusSprite,(byte *)pcVar23,1); if (bVar1 != 0) { AnimationState::Rewind(&versusSprite->_animState); (versusSprite->_animState)._isPlaying = 1; } } else { ANM2::Play((ANM2 *)versusSprite,(byte *)"SceneCoop",1); } pGVar20->_stage = 2; if ((Game *)&DAT_0000000f < anm2Path._capacity) { ppvVar19 = (void **)((int)(int *)anm2Path._capacity + 1); psVar4 = (std_string *)anm2Path._buf._0_4_; if ((void **)0xfff < ppvVar19) { psVar4 = (std_string *)((std_string *)(anm2Path._buf._0_4_ + -0x18))->_capacity; ppvVar19 = &((RoomDescriptor *)(anm2Path._capacity + 0x14))->Data; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)psVar4))) { LAB_00830911: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar4,(uint)ppvVar19); } ExceptionList = local_1c; return; } //@@ 00830950 RoomTransition::ChangeRoom /* DB: uses _roomIndex/_direction, Game::ChangeRoom, boss intro; ZHL had put the name on 006414c0 prototype: REPENTOGON */ void __thiscall RoomTransition::ChangeRoom(RoomTransition *this) { qword qVar1; byte isAnimSet; RoomDescriptor *currentRoomDesc; uint uVar2; int iVar3; float *pfVar4; uint randomValue; undefined4 *puVar5; void *pvVar6; int iVar7; float fVar8; qword *allocCounter; Game *game; PlayerManager *playerManager; float *playerIt; float player; Entity_Player *pEVar9; int *piVar10; EntityList_EL familiars; undefined8 local_5c; float local_54; Vector local_50; Vector local_48; ANM2 *local_40; float local_3c; RoomDescriptor *local_38; RoomTransition *transition; Entity_Player *local_30; int *local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ANM2 *playerSprite; Room *room; int roomWidth; GridEntity *teleporter; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b02130; local_1c = ExceptionList; ExceptionList = &local_1c; local_24 = g_vectorZero.x; local_3c = (float)g_game->_currentRoomIdx; local_28 = g_vectorZero.y; transition = this; currentRoomDesc = Level::GetRoomByIdx((Level *)g_game,(int)local_3c,g_game->_currentDimensionIdx); local_38 = Level::GetRoomByIdx((Level *)g_game,this->_targetRoomIdx,this->_targetDimension); if (((this->_targetRoomIdx < 0) || ((int)local_3c < 0)) || (currentRoomDesc->Dimension != local_38->Dimension)) { switch(this->_direction) { case 0: local_24 = -(float)*(byte *)((int)local_38->Data + 0x46) * 26.0; break; case 1: local_28 = -(float)*(byte *)((int)local_38->Data + 0x47) * 26.0; break; case 2: local_24 = (float)*(byte *)((int)currentRoomDesc->Data + 0x46) * 26.0; break; case 3: local_28 = (float)*(byte *)((int)currentRoomDesc->Data + 0x47) * 26.0; } } else { local_3c = (float)(currentRoomDesc->GridIndex % 0xd); local_24 = (float)((local_38->GridIndex % 0xd - (int)local_3c) * 0xd) * 26.0; local_28 = (float)((local_38->GridIndex / 0xd - currentRoomDesc->GridIndex / 0xd) * 7) * 26.0; this = transition; } if (((g_game->_currentDimensionIdx == 1) && ((g_game->_stageType == 4 || (g_game->_stageType == 5)))) && ((g_game->_stage == 2 || ((g_game->_stage == 1 && (uVar2 = Level::GetCurses((Level *)g_game), (uVar2 & 2) != 0)))))) { local_24 = local_24 * -1.0; } game = g_game; local_2c = *(int **)((int)g_game->_room + 0x1204); local_30 = *(Entity_Player **)((int)g_game->_room + 0x1208); if ((*(int *)&g_game->_deathmatchManager < 2) && (piVar10 = (g_game->_playerManager)._playerList._begin, piVar10 != (g_game->_playerManager)._playerList._end)) { do { iVar7 = *piVar10; piVar10 = piVar10 + 1; *(undefined1 *)(iVar7 + 0x410) = 1; } while (piVar10 != (game->_playerManager)._playerList._end); } if (this->_animation == 0xc) { Game::rewind((game->_playerManager)._roomTransitionPlayer); } else { if (this->_direction == -1) { game->_leaveDoor = -1; } Game::ChangeRoom(this->_targetRoomIdx,this->_targetDimension); } game = g_game; piVar10 = (g_game->_playerManager)._playerList._begin; if (piVar10 != (g_game->_playerManager)._playerList._end) { do { iVar7 = *piVar10; piVar10 = piVar10 + 1; *(undefined1 *)(iVar7 + 0x410) = 0; } while (piVar10 != (game->_playerManager)._playerList._end); } local_38 = *(RoomDescriptor **)((int)game->_room + 0x1204); local_3c = *(float *)((int)game->_room + 0x1208); if (this->_animation != 0) goto switchD_00830c6b_default; if ((game->_currentDimensionIdx == 1) && ((game->_stageType == 4 || (game->_stageType == 5)))) { if (game->_stage != 2) { if (game->_stage == 1) { uVar2 = Level::GetCurses((Level *)game); game = g_game; if ((uVar2 & 2) != 0) goto LAB_00830c5f; } goto LAB_00830cb4; } LAB_00830c5f: switch(this->_direction) { case 0: (this->_slideOffset).x = (((float)local_2c - (float)local_38) - g_screenWidth) - local_24; break; case 1: goto switchD_00830c6b_caseD_1; case 2: (this->_slideOffset).x = (((float)local_38 - (float)local_2c) - g_screenWidth) + local_24; break; case 3: goto switchD_00830c6b_caseD_3; } } else { LAB_00830cb4: switch(this->_direction) { case 0: (this->_slideOffset).x = (((float)local_38 - (float)local_2c) - g_screenWidth) - local_24; break; case 1: switchD_00830c6b_caseD_1: (this->_slideOffset).y = ((local_3c - (float)local_30) - g_screenHeight) - local_28; break; case 2: (this->_slideOffset).x = (((float)local_2c - (float)local_38) - g_screenWidth) + local_24; break; case 3: switchD_00830c6b_caseD_3: (this->_slideOffset).y = (((float)local_30 - local_3c) - g_screenHeight) + local_28; } } switchD_00830c6b_default: local_30 = (game->_playerManager)._roomTransitionPlayer; if (local_30 == (Entity_Player *)0x0) { local_30 = Game::GetPlayer(game,0); game = g_game; } room = game->_room; local_38 = (RoomDescriptor *)room->_bossId; local_3c = (float)room->_secondBossID; if (local_38 == (RoomDescriptor *)0x0) { LAB_00830d9d: piVar10 = *(int **)((int)room->_descriptor + 0x10); if ((((*piVar10 == 0x23) && (piVar10[2] == 1)) && (piVar10[3] == 1000)) && ((*(byte *)((int)room->_descriptor + 0x44) & 1) == 0)) { StartBossIntro(this,99,0); goto LAB_00830dda; } if (*(int *)&game->_deathmatchManager < 2) { Room::PlayMusic(room); goto LAB_00830dda; } } else { iVar3 = room->_aliveBossCount + *(int *)&room->field_0x12cc; iVar7 = 0; if (0 < iVar3) { iVar7 = iVar3; } if (iVar7 < 1) goto LAB_00830d9d; StartBossIntro(this,(uint)local_38,(uint)local_3c); LAB_00830dda: game = g_game; } iVar7 = this->_animation; if (((iVar7 == 3) || (iVar7 == 0xc)) || (iVar7 == 0xd)) { LAB_00830e96: if (iVar7 != 0xb) { if (iVar7 == 0x11) { puVar5 = (game->_playerManager)._playerList._begin; if (puVar5 != (game->_playerManager)._playerList._end) { do { pEVar9 = (Entity_Player *)*puVar5; if ((pEVar9 != (Entity_Player *)0x0) && ((game->_playerManager)._roomTransitionPlayer == pEVar9)) { Entity_Player::Teleport(pEVar9,&pEVar9->_forgottenBodyPos,0,0); game = g_game; } puVar5 = puVar5 + 1; } while (puVar5 != (game->_playerManager)._playerList._end); } } else if (iVar7 == 0x14) { if (game->_currentDimensionIdx == 2) { iVar7 = *(int *)((int)game->_room + 0xc); if ((iVar7 < 0xb) || (*(int *)((int)game->_room + 0x10) < 5)) { iVar3 = -1; } else { iVar3 = iVar7 * 4 + 10; } fVar8 = 0.0; playerIt = (g_game->_playerManager)._playerList._begin; pEVar9 = (Entity_Player *)((float)(iVar3 % iVar7) * 40.0 + 40.0); piVar10 = (int *)((float)(iVar3 / iVar7) * 40.0 + 120.0); game = g_game; local_30 = pEVar9; local_2c = piVar10; if (playerIt != (g_game->_playerManager)._playerList._end) { do { local_50.y = *playerIt; if ((Entity_Player *)local_50.y != (Entity_Player *)0x0) { local_48.y = (float)((int)fVar8 + 1); if (fVar8 != 0.0) { uVar2 = Random(); fVar8 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)] ) * 2.3283064e-10 * 3.14; fVar8 = fVar8 + fVar8; local_5c = CONCAT44(fVar8,(undefined4)local_5c); local_54 = sin(fVar8); fVar8 = cos((float)local_5c._4_4_); pEVar9 = (Entity_Player *)(fVar8 * 10.0 + (float)local_30); piVar10 = (int *)(local_54 * 10.0 + (float)local_2c); } fVar8 = local_50.y; ((Vector *)((int)local_50.y + 0x33c))->x = (float)pEVar9; ((Vector *)((int)local_50.y + 0x33c))->y = (float)piVar10; Entity_Player::PlayExtraAnimation((Entity_Player *)local_50.y,(byte *)"Appear"); if ((((ANM2 *)((int)fVar8 + 0x48))->_animState)._animData != (void *)0x0) { AnimationState::SetFrameFloat(&((ANM2 *)((int)fVar8 + 0x48))->_animState,2.0); } *(byte *)((int)fVar8 + 0x410) = 0; fVar8 = local_48.y; game = g_game; piVar10 = local_2c; pEVar9 = local_30; } playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); } EntityList::QuerySublist ((EntityList *)((int)game->_room + 0x1218),&familiars,3,0xee,-1,0,0); fVar8 = 0.0; if ((float)familiars._size != 0.0) { do { iVar7 = *(int *)((int)familiars._data + (int)fVar8 * 4); fVar8 = (float)((int)fVar8 + 1); *(Entity_Player **)(iVar7 + 0x33c) = local_30; *(int **)(iVar7 + 0x340) = local_2c; } while ((uint)fVar8 < (uint)familiars._size); } if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar2 = *(uint *)((int)familiars._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar2); free((void *)((int)familiars._data + -4)); } LAB_00831623: local_14 = 0xffffffff; } } else { puVar5 = (game->_playerManager)._playerList._begin; if (puVar5 != (game->_playerManager)._playerList._end) { do { pEVar9 = (Entity_Player *)*puVar5; if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::PlayExtraAnimation(pEVar9,(byte *)"Appear"); if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,2.0); } game = g_game; pEVar9->_isControlsEnabled = 0; } puVar5 = puVar5 + 1; } while (puVar5 != (game->_playerManager)._playerList._end); } } } else if ((iVar7 == 3) && (0 < *(int *)&this->field_0x20)) { pvVar6 = game->_room; if ((*(int *)((int)pvVar6 + 8) == 0x19) || (*(int *)((int)pvVar6 + 8) == 0x1a)) { iVar7 = *(int *)&this->field_0x20 + -1; iVar3 = *(int *)((int)pvVar6 + 0x10) * *(int *)((int)pvVar6 + 0xc); uVar2 = 0; if (0 < iVar3) { puVar5 = (undefined4 *)((int)pvVar6 + 0x24); LAB_00831497: if ((((0x1bf < uVar2) || (teleporter = (GridEntity *)*puVar5, teleporter == (GridEntity *)0x0)) || ((teleporter->_desc)._type != 0x17)) || ((-1 < iVar7 && ((teleporter->_desc)._variant != iVar7)))) goto LAB_008314b3; GridEntity::Position(teleporter,&local_50); Entity_Player::Teleport(local_30,&local_50,0,0); if ((teleporter->_desc)._state == 0) { (teleporter->_desc)._state = 1; } uVar2 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pEVar9 = Game::GetPlayer(g_game,uVar2); if (pEVar9 != local_30) { randomValue = Random(); fVar8 = (float)((double)(int)randomValue + __uint_to_double_fixup[-((int)randomValue >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar8 = fVar8 + fVar8; local_5c = CONCAT44(fVar8,(undefined4)local_5c); local_54 = sin(fVar8); fVar8 = cos((float)local_5c._4_4_); local_48.x = fVar8 * 10.0 + local_50.x; local_48.y = local_54 * 10.0 + local_50.y; Entity_Player::Teleport(pEVar9,&local_48,0,0); } uVar2 = uVar2 + 1; } while (uVar2 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,0xee,-1,0,0); fVar8 = 0.0; if ((float)familiars._size != 0.0) { do { iVar7 = *(int *)((int)familiars._data + (int)fVar8 * 4); fVar8 = (float)((int)fVar8 + 1); *(float *)(iVar7 + 0x33c) = local_50.x; *(float *)(iVar7 + 0x340) = local_50.y; } while ((uint)fVar8 < (uint)familiars._size); } if (familiars._0_1_ != '\0') goto LAB_0083162a; local_14 = 2; tracked_alloc(1,familiars._data,0); goto LAB_00831623; } } } goto LAB_0083162a; } } else if (iVar7 != 0xb) { playerManager = &game->_playerManager; uVar2 = 0; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 == 0) { this = transition; } else { do { pvVar6 = (playerManager->_playerList)._end; if ((int)pvVar6 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (playerManager->_playerList)._end; game = g_game; } piVar10 = (playerManager->_playerList)._begin; if (uVar2 < (uint)((int)pvVar6 - (int)piVar10 >> 2)) { piVar10 = piVar10 + uVar2; } iVar7 = *piVar10; if ((*(int *)(iVar7 + 0x2c) == 0) && ((*(uint *)(iVar7 + 0x16c) & 0x2000000) == 0)) { *(undefined1 *)(iVar7 + 0x171) = 1; } playerManager = &game->_playerManager; uVar2 = uVar2 + 1; } while (uVar2 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); iVar7 = transition->_animation; this = transition; } goto LAB_00830e96; } local_28 = 2.3283064e-10; local_24 = 3.14; local_38 = (RoomDescriptor *)0x18378; local_5c = CONCAT44(free_exref,(undefined4)local_5c); local_50.y = 2.0; do { local_2c = (int *)((int)game->_roomList[0]._doors + ((int)local_38 - 0x30U)); if (*local_2c == game->_currentRoomIdx) { playerIt = (game->_playerManager)._playerList._begin; fVar8 = 0.0; if (playerIt != (game->_playerManager)._playerList._end) { do { player = *playerIt; local_48.y = player; if (player != 0.0) { local_54 = (float)((int)fVar8 + 1); iVar7 = local_2c[1]; iVar3 = *(int *)((int)game->_room + 0xc); if (fVar8 == 0.0) { fVar8 = (float)(iVar7 % iVar3) * 40.0 + 40.0; pEVar9 = (Entity_Player *)((float)(iVar7 / iVar3) * 40.0 + 120.0); } else { local_40 = (ANM2 *)((float)(iVar7 % iVar3) * 40.0 + 40.0); local_30 = (Entity_Player *)((float)(iVar7 / iVar3) * 40.0 + 120.0); uVar2 = Random(); local_3c = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * local_28 * local_24; local_3c = local_3c + local_3c; fVar8 = sin(local_3c); local_30 = (Entity_Player *)((float)local_30 + fVar8); fVar8 = cos(local_3c); fVar8 = fVar8 + (float)local_40; pEVar9 = local_30; } *(float *)((int)player + 0x33c) = fVar8; *(Entity_Player **)((int)player + 0x340) = pEVar9; *(undefined1 *)((int)player + 0x139a) = 0; ANM2::Reset((ANM2 *)((int)player + 0x41c)); *(undefined4 *)((int)player + 0x14c) = 0x3f800000; AnimationState::SetAnimationData((AnimationState *)((int)player + 0x98),(void *)0x0); local_40 = (ANM2 *)((int)player + 0x48); isAnimSet = ANM2::SetAnimation(local_40,s_Jump,1); playerSprite = local_40; if (isAnimSet != 0) { AnimationState::Rewind(&local_40->_animState); (playerSprite->_animState)._isPlaying = 1; player = local_48.y; } *(undefined1 *)((int)player + 0x1398) = 1; *(undefined1 *)((int)player + 0x139a) = 0; if (*(int *)((int)player + 0x7c) != 0) { AnimationState::SetFrameFloat((AnimationState *)((int)player + 0x78),local_50.y); } game = g_game; pfVar4 = &local_48.y; if (0x22 < *(int *)((int)player + 0x13bc)) { pfVar4 = (float *)((int)player + 0x13bc); } local_48.y = 4.90454e-44; *(float *)((int)player + 0x13bc) = *pfVar4; *(undefined1 *)((int)player + 0x410) = 0; fVar8 = local_54; } playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); } EntityList::QuerySublist((EntityList *)((int)game->_room + 0x1218),&familiars,3,0xee,-1,0,0); game = g_game; local_3c = 0.0; if ((float)familiars._size != 0.0) { do { iVar7 = *(int *)((int)familiars._data + (int)local_3c * 4); iVar3 = local_2c[1]; roomWidth = *(int *)((int)game->_room + 0xc); local_3c = (float)((int)local_3c + 1); *(float *)(iVar7 + 0x33c) = (float)(iVar3 % roomWidth) * 40.0 + 40.0; *(float *)(iVar7 + 0x340) = (float)(iVar3 / roomWidth) * 40.0 + 120.0; } while ((uint)local_3c < (uint)familiars._size); } if (familiars._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (familiars._data != (void *)0x0) { uVar2 = *(uint *)((int)familiars._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar2; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar2); (*local_5c._4_4_)((uint *)((int)familiars._data + -4)); } local_14 = 0xffffffff; } game = g_game; } local_38 = (RoomDescriptor *)((int)local_38 + 0xc); } while ((int)local_38 < 0x18390); LAB_0083162a: Room::render_lighting(g_game->_room); local_5c = 0; std::vector::resize(&local_5c); puVar5 = std::deque::back(); if ((byte *)(puVar5 + 1) != (byte *)0x0) { *(byte *)(puVar5 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar5 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)&transition->field_0x30,1); RenderTarget::Clear(&DAT_00c798e0); 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; Room::Render(); _glfw_context_reset(1); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } puVar5 = std::deque::back(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*puVar5,*(byte *)(puVar5 + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } ExceptionList = local_1c; return; LAB_008314b3: uVar2 = uVar2 + 1; puVar5 = puVar5 + 1; if (iVar3 <= (int)uVar2) goto LAB_0083162a; goto LAB_00831497; } //@@ 00831780 FUN_00831780 void FUN_00831780(int *param_1,byte *param_2,byte *param_3,byte *param_4) { byte *pbVar1; byte bVar2; LayerState *pLVar3; ANM2 *pAVar4; int iVar5; byte *pbVar6; uint uVar7; int in_ECX; byte *pbVar8; byte *anim; bool bVar9; pLVar3 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x38),param_4); pLVar3->_visible = 1; iVar5 = *param_1; if ((((iVar5 == 4) || (iVar5 == 0x10)) || (iVar5 == 0x11)) || (((iVar5 == 0xe || (iVar5 == 0x19)) || ((iVar5 == 0x23 || (iVar5 == 0x21)))))) { param_2 = param_3; } param_4 = param_2; Sprite::ReplaceSpritesheet((Sprite *)(in_ECX + 0x38),(int)param_2,(std_string *)(param_1 + 0x13)); pLVar3 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x38),param_4); pLVar3->_visible = 1; if (param_1[0x23] != 0) { pAVar4 = (ANM2 *)FUN_00833010(¶m_4); ANM2::Load(pAVar4,(std_string *)(param_1 + 0x1f),1); pAVar4 = (ANM2 *)FUN_00833010(¶m_4); iVar5 = FUN_00833010(¶m_4); anim = (byte *)(iVar5 + 0x18); if (0xf < *(uint *)(iVar5 + 0x2c)) { anim = *(byte **)anim; } pbVar1 = (pAVar4->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pbVar8 = anim; do { bVar2 = *pbVar6; bVar9 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00831866: uVar7 = -(uint)bVar9 | 1; goto LAB_0083186b; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00831866; pbVar6 = pbVar6 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_0083186b: if (uVar7 == 0) { if (pbVar1[0x34] == 0) { return; } if ((pAVar4->_animState)._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(pAVar4,anim,1); if (bVar2 != 0) { AnimationState::Rewind(&pAVar4->_animState); (pAVar4->_animState)._isPlaying = 1; } } return; } //@@ 008318a0 RoomTransition::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? state machine on this+0x1c that calls ChangeRoom; TeleportDown/Pickup anims prototype: REPENTOGON */ void __thiscall RoomTransition::Update(RoomTransition *this) { float fVar1; float fVar2; char cVar3; byte bVar4; std_string *psVar5; Vector *tmpVec; undefined4 uVar6; int *parentNode; undefined4 *puVar8; Entity_Player *pEVar9; int iVar10; uint uVar11; EntityPtr EVar12; int iVar13; int *piVar14; uint uVar15; float randomScale; double dVar16; Entity_Player *idlePlayer; Vector local_68; std_string *local_60; byte local_59; Vector local_58; Entity_Player *local_50; EntityPtr local_4c; char local_45; std_string animName; EntityPtr animSuffix [4]; int animSuffixSize; uint animSuffixCapacity; uint local_14; void *local_10; undefined1 *puStack_c; EntityPtr local_8; void *animData; Game *game; Manager *manager; EntityPtr minecart; int *parentNode; manager = g_manager; local_8 = (EntityPtr)0xffffffff; puStack_c = &LAB_00b02165; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(animSuffix + 10); ExceptionList = &local_10; local_50 = (Entity_Player *)0x0; local_4c = (EntityPtr)0x0; pEVar9 = (g_game->_playerManager)._roomTransitionPlayer; EVar12 = this->_minecart; if (((EVar12 != (EntityPtr)0x0) && (*(int *)((int)EVar12 + 0x28) == 0x3c5)) && (local_4c = (EntityPtr)0x0, *(int *)((int)EVar12 + 0x2c) == 10)) { local_4c = EVar12; } local_58.y = (float)pEVar9; switch(*(undefined4 *)this) { case 1: local_45 = '\x01'; idlePlayer = (Entity_Player *)0x0; local_50 = (Entity_Player *)0x0; local_60 = (std_string *)0x3e8; EntityList::Update((EntityList *)((int)g_game->_room + 0x1218),1); Room::update_ambient_sounds(g_game->_room); iVar13 = this->_animation; if (iVar13 == 0x13) { uVar15 = 0; uVar11 = 0x724; do { uVar15 = uVar15 + 1; if ((uVar15 < 9) && (parentNode = *(int **)(uVar11 + (int)g_game->_room), parentNode != (int *)0x0)) { (**(code **)(*parentNode + 8))(); } uVar11 = uVar11 + 4; } while (uVar11 < 0x744); iVar13 = this->_animation; } puVar8 = (g_game->_playerManager)._playerList._begin; if (puVar8 != (g_game->_playerManager)._playerList._end) { do { pEVar9 = (Entity_Player *)*puVar8; if (pEVar9 != (Entity_Player *)0x0) { if (pEVar9->_dead == 0) { if (((pEVar9->_isPlayingExtraAnimation == 0) && (pEVar9->_isPlayingItemAnimation == 0)) || ((animData = (pEVar9->_sprite)._animState._animData, animData != (void *)0x0 && (*(char *)((int)animData + 0x34) != '\0')))) { if ((idlePlayer == (Entity_Player *)0x0) && (pEVar9->_visible != 0)) { idlePlayer = pEVar9; } if (this->_animation == 0x13) { (**(code **)(*(int *)pEVar9 + 0xc))(); } } else { if (this->_animation == 0) { pEVar9->_isPlayingExtraAnimation = 0; pEVar9->_isPlayingItemAnimation = 0; } (**(code **)(*(int *)pEVar9 + 0xc))(); if ((pEVar9->_itemState != 0) && (pEVar9->_itemState != 0x25c)) { Entity_Player::ResetItemState(pEVar9); } iVar13 = this->_animation; if (iVar13 == 0) { pEVar9->_isPlayingExtraAnimation = 0; pEVar9->_isPlayingItemAnimation = 0; iVar13 = this->_animation; } if ((((iVar13 == 0x13) && (local_4c != (EntityPtr)0x0)) && ((pEVar9->_sprite)._animState._animData != (void *)0x0)) && (bVar4 = AnimationState::IsEventTriggered (&(pEVar9->_sprite)._animState,&DAT_00b1d534), bVar4 != 0)) { Entity_Player::AttachMinecart(pEVar9,(Entity_NPC *)local_4c); pEVar9->_visible = 0; } if (((pEVar9->_isPlayingExtraAnimation == 0) && (pEVar9->_isPlayingItemAnimation == 0) ) || (pEVar9->_pitfallState == 4)) { pEVar9->_visible = 0; } else { if ((pEVar9->_sprite)._animState._animData == (void *)0x0) { psVar5 = (std_string *)0xffffffff; } else { fVar1 = (pEVar9->_sprite)._animState._animFrame; local_68.y = fVar1; dVar16 = floor((double)fVar1); local_68.y = (float)dVar16; psVar5 = (std_string *)(int)dVar16; } local_45 = '\0'; if ((int)local_60 <= (int)psVar5) { psVar5 = local_60; pEVar9 = local_50; } local_50 = pEVar9; local_60 = psVar5; } } } else { (**(code **)(*(int *)pEVar9 + 0xc))(); } } puVar8 = puVar8 + 1; } while (puVar8 != (g_game->_playerManager)._playerList._end); iVar13 = this->_animation; } pEVar9 = local_50; if ((((iVar13 == 0xb) || (iVar13 == 0x10)) || (iVar13 == 0x13)) && (((local_50 != (Entity_Player *)0x0 && (idlePlayer != (Entity_Player *)0x0)) && (5 < (int)local_60)))) { psVar5 = ANM2::GetAnimation((ANM2 *)&(local_50->_sprite)._animState,&animName); local_8 = (EntityPtr)0x0; if (0xf < psVar5->_capacity) { psVar5 = *(std_string **)psVar5->_buf; } Entity_Player::PlayExtraAnimation(idlePlayer,(byte *)psVar5); local_8 = (EntityPtr)0xffffffff; if (0xf < animName._capacity) { uVar11 = animName._capacity + 1; psVar5 = (std_string *)animName._buf._0_4_; if (0xfff < uVar11) { psVar5 = (std_string *)((std_string *)(animName._buf._0_4_ + -0x18))->_capacity; uVar11 = animName._capacity + 0x24; if (0x1f < (uint)(animName._buf._0_4_ + (-4 - (int)psVar5))) { LAB_00831b99: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar5,uVar11); } fVar1 = (pEVar9->_moveToTarget).y; (idlePlayer->_moveToTarget).x = (pEVar9->_moveToTarget).x; (idlePlayer->_moveToTarget).y = fVar1; iVar13 = this->_animation; animName._size = 0; animName._capacity = 0xf; animName._buf._0_4_ = animName._buf._0_4_ & 0xffffff00; if ((iVar13 == 0x13) && (local_4c != (EntityPtr)0x0)) { tmpVec = MusicManager::RandomVector(&local_68); uVar11 = Random(); randomScale = (float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 2.3283064e-10; fVar1 = tmpVec->x; fVar2 = *(float *)((int)local_4c + 0x334); (idlePlayer->_moveToTarget).y = randomScale * tmpVec->y * 8.0 + *(float *)((int)local_4c + 0x338); (idlePlayer->_moveToTarget).x = randomScale * fVar1 * 8.0 + fVar2; iVar13 = this->_animation; } LAB_00831c6a: if (iVar13 != 0x15) break; } else if (local_45 == '\0') goto LAB_00831c6a; EVar12 = local_4c; game = g_game; if (iVar13 == 0x13) { minecart = this->_minecart; if (((minecart == (EntityPtr)0x0) || (*(int *)((int)minecart + 0x28) != 0x3c5)) || (*(int *)((int)minecart + 0x2c) != 10)) goto LAB_00831dc6; if (*(int *)((int)local_4c + 0xb64) != 4) { iVar13 = 1; *(uint *)((int)local_4c + 0x16c) = *(uint *)((int)local_4c + 0x16c) | 0x1000; *(undefined4 *)((int)local_4c + 0x168) = *(undefined4 *)((int)local_4c + 0x168); Room::GetGridIndex(game->_room,(Vector *)((int)local_4c + 0x334)); uVar6 = FUN_004ce0f0(); switch(uVar6) { case 7: iVar13 = 2; break; case 8: iVar13 = 0; break; case 9: iVar13 = 3; } tmpVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_58,iVar13); fVar1 = tmpVec->y; fVar2 = tmpVec->x; *(undefined4 *)((int)EVar12 + 0xb64) = 4; *(float *)((int)EVar12 + 0x364) = fVar1 * 0.1; *(float *)((int)EVar12 + 0x360) = fVar2 * 0.1; fVar1 = g_vectorZero.y; *(float *)((int)EVar12 + 0x334) = g_vectorZero.x; *(float *)((int)EVar12 + 0x338) = fVar1; } } else if (((iVar13 == 0xb) || (iVar13 == 0x10)) && (this->_targetRoomIdx == g_game->_currentRoomIdx)) { parentNode = (g_game->_playerManager)._playerList._begin; if (parentNode != (g_game->_playerManager)._playerList._end) { do { iVar13 = *parentNode; if (iVar13 != 0) { *(undefined1 *)(iVar13 + 0x171) = 0; *(undefined1 *)(iVar13 + 0x410) = 1; } parentNode = parentNode + 1; } while (parentNode != (game->_playerManager)._playerList._end); } LAB_00831db4: this->_frame = 0; *(undefined4 *)this = 0; } else { LAB_00831dc6: this->_frame = 0; game = g_game; if ((((this->_direction != -1) || (iVar13 == 3)) || (((iVar13 == 0xc || ((iVar13 == 0xd || (iVar13 == 0xb)))) || (iVar13 == 0x10)))) && (puVar8 = (g_game->_playerManager)._playerList._begin, puVar8 != (g_game->_playerManager)._playerList._end)) { do { pEVar9 = (Entity_Player *)*puVar8; if ((pEVar9 != (Entity_Player *)0x0) && ((((this->_animation != 0 && (this->_animation != 2)) || (this->_direction == -1)) || (pEVar9 == (Entity_Player *)local_58.y)))) { pEVar9->_visible = 0; } puVar8 = puVar8 + 1; } while (puVar8 != (game->_playerManager)._playerList._end); } Room::render_lighting(g_game->_room); local_68.x = 0.0; local_68.y = 0.0; std::vector::resize(&local_68); puVar8 = std::deque::back(); if ((byte *)(puVar8 + 1) != (byte *)0x0) { *(byte *)(puVar8 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar8 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)&this->field_0x28,1); RenderTarget::Clear(&DAT_00c798e0); 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; Room::Render(); _glfw_context_reset(); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } puVar8 = std::deque::back(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*puVar8,*(byte *)(puVar8 + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } iVar13 = this->_animation; if ((((iVar13 == 1) || (iVar13 == 2)) || ((this->_direction == -1 || ((iVar13 == 0xb || (iVar13 == 0xf)))))) || ((iVar13 == 0x10 || ((((iVar13 == 0x11 || (iVar13 == 0x14)) || (iVar13 == 0x12)) || ((iVar13 == 0x13 || (iVar13 == 0x15)))))))) { *(undefined4 *)this = 2; if ((iVar13 == 0xf) || (iVar13 == 0x15)) { ChangeRoom(this); } } else { *(undefined4 *)this = 3; ChangeRoom(this); } } break; case 2: if (this->_bossIntroBossId == 0) { iVar13 = this->_frame; if (iVar13 < this->_duration) goto LAB_008320bd; this->_frame = 0; *(undefined4 *)this = 3; ChangeRoom(this); } else { ANM2::Update(&this->_versusScreenSprite); parentNode = (this->_sprites)._head; piVar14 = (int *)*parentNode; if (piVar14 != parentNode) { do { if (*(char *)((int)piVar14 + 0x11d) != '\0') { AnimationState::Update((AnimationState *)(piVar14 + 0x11)); AnimationState::Update((AnimationState *)(piVar14 + 0x19)); } parentNode = (int *)piVar14[2]; if (*(char *)((int)parentNode + 0xd) == '\0') { cVar3 = *(char *)(*parentNode + 0xd); piVar14 = parentNode; parentNode = (int *)*parentNode; while (cVar3 == '\0') { cVar3 = *(char *)(*parentNode + 0xd); piVar14 = parentNode; parentNode = (int *)*parentNode; } } else { cVar3 = *(char *)(piVar14[1] + 0xd); parentNode = (int *)piVar14[1]; parentNode = piVar14; while ((piVar14 = parentNode, cVar3 == '\0' && (parentNode == (int *)piVar14[2]))) { cVar3 = *(char *)(piVar14[1] + 0xd); parentNode = (int *)piVar14[1]; parentNode = piVar14; } } } while (piVar14 != (this->_sprites)._head); } if (((this->_versusScreenSprite)._animState._animData == (void *)0x0) || ((this->_versusScreenSprite)._animState._isPlaying == 0)) { Room::PlayMusic(g_game->_room); game = g_game; (g_game->_hud)._isVisible = 1; this->_frame = this->_duration; *(undefined4 *)this = 3; parentNode = (game->_playerManager)._playerList._begin; if (parentNode != (game->_playerManager)._playerList._end) { do { iVar13 = *parentNode; if (iVar13 != 0) { iVar10 = 10; if (10 < *(int *)(iVar13 + 0x418)) { iVar10 = *(int *)(iVar13 + 0x418); } *(int *)(iVar13 + 0x418) = iVar10; } parentNode = parentNode + 1; } while (parentNode != (game->_playerManager)._playerList._end); } } } break; case 3: iVar13 = this->_frame; if (iVar13 < this->_duration) { LAB_008320bd: this->_frame = iVar13 + 1; } else { FUN_00421260(local_14); this->_frame = 0; cVar3 = FUN_0082eb90(); manager = g_manager; if (cVar3 == '\0') { iVar13 = this->_animation; if (iVar13 == 5) { if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateCollectible (pEVar9,0xa1,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } LAB_008321d0: *(undefined4 *)this = 4; break; } if (iVar13 == 6) { if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateCollectible (pEVar9,0x51,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); *(undefined4 *)this = 4; break; } goto LAB_008321d0; } if (iVar13 == 7) { local_58.y = 1.4013e-45; seed_fart_sound_override((int *)&local_58.y); SoundEffects::Play(&manager->_sfxManager,(int)local_58.y,1.0,2,0,1.0,0.0); if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateCollectible (pEVar9,0xb,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); *(undefined4 *)this = 4; break; } goto LAB_008321d0; } if (iVar13 == 8) { if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateCollectible (pEVar9,0xd4,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); *(undefined4 *)this = 4; break; } goto LAB_008321d0; } if (iVar13 == 9) { if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateCollectible (pEVar9,0x137,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); *(undefined4 *)this = 4; break; } goto LAB_008321d0; } if (iVar13 == 10) { if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateCollectible (pEVar9,0x14c,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); *(undefined4 *)this = 4; break; } goto LAB_008321d0; } if (iVar13 == 0xe) { if (pEVar9 != (Entity_Player *)0x0) { Entity_Player::AnimateTrinket(pEVar9,0x17,"Pickup","PlayerPickupSparkle"); *(undefined4 *)this = 4; break; } goto LAB_008321d0; } if (((iVar13 == 1) || (iVar13 == 2)) || (iVar13 == 0x12)) goto LAB_008321d0; if (((iVar13 != 0xb) && (iVar13 != 0x10)) && ((iVar13 != 0x11 && (iVar13 != 0x13)))) { if (iVar13 == 0x14) goto LAB_008321d0; EntityList::Update((EntityList *)((int)g_game->_room + 0x1218),1); parentNode = (g_game->_playerManager)._playerList._begin; if (parentNode == (g_game->_playerManager)._playerList._end) goto LAB_00831db4; do { piVar14 = (int *)*parentNode; if (piVar14 != (int *)0x0) { if (*(int *)&g_game->_deathmatchManager < 2) { *(undefined1 *)(piVar14 + 0x104) = 1; } (**(code **)(*piVar14 + 0xc))(); } parentNode = parentNode + 1; } while (parentNode != (g_game->_playerManager)._playerList._end); this->_frame = 0; *(undefined4 *)this = 0; break; } EntityList::Update((EntityList *)((int)g_game->_room + 0x1218),1); parentNode = (g_game->_playerManager)._playerList._begin; if (parentNode != (g_game->_playerManager)._playerList._end) { do { piVar14 = (int *)*parentNode; if (piVar14 != (int *)0x0) { (**(code **)(*piVar14 + 0xc))(); *(undefined1 *)(piVar14 + 0x104) = 1; } parentNode = parentNode + 1; } while (parentNode != (g_game->_playerManager)._playerList._end); this->_frame = 0; *(undefined4 *)this = 0; break; } goto LAB_00831db4; } puVar8 = (g_game->_playerManager)._playerList._begin; if (puVar8 != (g_game->_playerManager)._playerList._end) { do { pEVar9 = (Entity_Player *)*puVar8; if (pEVar9 != (Entity_Player *)0x0) { if (this->_animation == 3) { Entity_Player::PlayExtraAnimation(pEVar9,(byte *)"TeleportDown"); } if ((pEVar9->_flags & 0x200000000000000) == 0) { pEVar9->_visible = 1; } } puVar8 = puVar8 + 1; } while (puVar8 != (g_game->_playerManager)._playerList._end); } if (this->_animation == 0xc) { if ((Entity_Player *)local_58.y == (Entity_Player *)0x0) goto LAB_008321d0; Entity_Player::AnimateCollectible ((Entity_Player *)local_58.y,0x1a6,(byte *)"Pickup",(byte *)"PlayerPickupSparkle") ; *(undefined4 *)this = 4; } else { if ((this->_animation != 0xd) || ((Entity_Player *)local_58.y == (Entity_Player *)0x0)) goto LAB_008321d0; Entity_Player::AnimateCollectible ((Entity_Player *)local_58.y,0x1b5,(byte *)"Pickup",(byte *)"PlayerPickupSparkle") ; *(undefined4 *)this = 4; } } break; case 4: if ((this->_animation == 3) && (this->_frame == 8)) { local_58.y = 2.99878e-43; seed_fart_sound_override((int *)&local_58.y); SoundEffects::Play(&manager->_sfxManager,(int)local_58.y,1.0,2,0,1.0,0.0); } game = g_game; this->_frame = this->_frame + 1; local_58.y = (float)CONCAT31(local_58.y._1_3_,1); EntityList::Update((EntityList *)((int)game->_room + 0x1218),1); parentNode = (g_game->_playerManager)._playerList._begin; if (parentNode != (g_game->_playerManager)._playerList._end) { pEVar9 = (Entity_Player *)local_58.y; do { piVar14 = (int *)*parentNode; local_59 = (byte)pEVar9; if ((piVar14 != (int *)0x0) && (((char)piVar14[0x4e6] != '\0' || (*(char *)((int)piVar14 + 0x139a) != '\0')))) { if (piVar14[0x1f] == 0) { cVar3 = '\0'; } else { cVar3 = *(char *)(piVar14[0x1f] + 0x34); } if (cVar3 == '\0') { (**(code **)(*piVar14 + 0xc))(); if ((void *)piVar14[0x1f] == (void *)0x0) { animName._capacity = 0xf; animName._size = 0; animName._buf._0_4_ = (std_string *)0x0; } else { std::string::string(animName._buf,(void *)piVar14[0x1f]); } local_8 = (EntityPtr)0x1; local_50 = (Entity_Player *)((uint)local_50 | 0x20); local_60 = (std_string *)animName._buf._0_4_; if ((((char)piVar14[0x4e6] == '\0') && (*(char *)((int)piVar14 + 0x139a) == '\0')) || (animName._size < 5)) { local_4c = animSuffix[0]; uVar11 = animSuffixCapacity; LAB_00832568: local_45 = '\0'; } else { fVar1 = (float)(animName._size - 5); animSuffix[0] = (EntityPtr)0x0; local_68.y = fVar1; animSuffixCapacity = 0xf; if (animName._size < (uint)fVar1) { /* WARNING: Subroutine does not return */ FUN_00499950(); } pEVar9 = (Entity_Player *)0xffffffff; if ((Entity_Player *)(animName._size - (int)fVar1) != (Entity_Player *)0xffffffff) { pEVar9 = (Entity_Player *)(animName._size - (int)fVar1); } psVar5 = &animName; if (0xf < animName._capacity) { psVar5 = (std_string *)animName._buf._0_4_; } local_68.y = (float)(psVar5->_buf + (int)fVar1); local_58.y = (float)pEVar9; if ((Entity_Player *)&DAT_0000000f < pEVar9) { if ((Entity_Player *)0x7fffffff < pEVar9) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar11 = (uint)pEVar9 | 0xf; if (uVar11 < 0x80000000) { if (uVar11 < 0x16) { uVar11 = 0x16; } } else { uVar11 = 0x7fffffff; } local_4c = (EntityPtr)std::_Allocate(uVar11 + 1); animSuffixSize = (int)local_58.y; animSuffixCapacity = uVar11; memcpy((void *)local_4c,(void *)local_68.y,(size_t)local_58.y); animSuffix[0] = local_4c; *(undefined1 *) ((int)(&((ANM2 *)((int)local_58.y + 0x48))->_filename + -3) + (int)local_4c) = 0; pEVar9 = (Entity_Player *)local_58.y; } else { animSuffixSize = (int)pEVar9; memmove(animSuffix,psVar5->_buf + (int)fVar1,(size_t)pEVar9); (&animSuffix[-0x12].field_0x0)[(int)(pEVar9->_sprite)._filename._buf] = 0; pEVar9 = (Entity_Player *)animSuffixSize; uVar11 = animSuffixCapacity; } local_50 = (Entity_Player *)((uint)local_50 | 0x41); EVar12 = (EntityPtr)animSuffix; if (0xf < uVar11) { EVar12 = animSuffix[0]; } local_4c = animSuffix[0]; bVar4 = str_eq((byte *)EVar12,(uint)pEVar9,(byte *)"Death",5); if (bVar4 != 0) goto LAB_00832568; local_45 = '\x01'; } if ((((uint)local_50 & 1) != 0) && (local_50 = (Entity_Player *)((uint)local_50 & 0xfffffffe), 0xf < uVar11)) { uVar15 = uVar11 + 1; EVar12 = local_4c; if (0xfff < uVar15) { EVar12 = *(EntityPtr *)((int)local_4c + -4); uVar15 = uVar11 + 0x24; if (0x1f < ((int)local_4c - (int)EVar12) - 4U) goto LAB_00831b99; } operator_delete((void *)EVar12,uVar15); } local_8 = (EntityPtr)0xffffffff; local_58.y = (float)(Entity_Player *)0x0; if (local_45 == '\0') { local_58.y = (float)(uint)local_59; } pEVar9 = (Entity_Player *)local_58.y; if (0xf < animName._capacity) { uVar11 = animName._capacity + 1; psVar5 = local_60; if (0xfff < uVar11) { psVar5 = (std_string *)local_60[-1]._capacity; uVar11 = animName._capacity + 0x24; if (0x1f < (uint)((int)local_60 + (-4 - (int)psVar5))) goto LAB_00831b99; } operator_delete(psVar5,uVar11); pEVar9 = (Entity_Player *)local_58.y; } } } parentNode = parentNode + 1; } while (parentNode != (g_game->_playerManager)._playerList._end); if ((char)pEVar9 == '\0') break; } game = g_game; *(undefined4 *)this = 0; this->_frame = 0; parentNode = (game->_playerManager)._playerList._begin; if (parentNode != (game->_playerManager)._playerList._end) { do { iVar13 = *parentNode; if ((iVar13 != 0) && (*(undefined1 *)(iVar13 + 0x410) = 1, (*(uint *)(iVar13 + 0x16c) & 0x2000000) == 0)) { *(undefined1 *)(iVar13 + 0x171) = 1; } parentNode = parentNode + 1; } while (parentNode != (game->_playerManager)._playerList._end); } break; default: goto switchD_0083190e_default; } *(float *)&this->field_0xc = (float)this->_frame / (float)this->_duration; game = g_game; if ((*(int *)this == 2) || (*(int *)this == 3)) { (g_game->_hud)._hudRefreshType = 2; (game->_hud)._hudRefreshCountdown = 2; } switchD_0083190e_default: ExceptionList = local_10; return; } //@@ 008327e0 RoomTransition::get_hud_alpha /* DB: ? thiscall float, ECX = Game+0x1b83c _roomTransition (Minimap::GetDisplayedSize: lea ecx,[c71678+0x1b83c]); state(+0) 2 -> 1-progress(+0xc), 3 -> progress, only for modes(+0x1c) 1,2,11,16-20 or +0x10==-1; else 1.0; result multiplies minimap/HUD alpha prototype: db/protos.zhl */ float __thiscall RoomTransition::get_hud_alpha(RoomTransition *this) { int iVar1; int iVar2; iVar1 = *(int *)this; if (((iVar1 == 2) || (iVar1 == 3)) && ((((iVar2 = this->_animation, iVar2 == 1 || ((((iVar2 == 2 || (this->_direction == -1)) || (iVar2 == 0xb)) || ((iVar2 == 0x10 || (iVar2 == 0x11)))))) || (iVar2 == 0x12)) || ((iVar2 == 0x14 || (iVar2 == 0x13)))))) { if (iVar1 == 2) { return 1.0 - *(float *)&this->field_0xc; } if (iVar1 == 3) { return *(float *)&this->field_0xc; } } return 1.0; } //@@ 00832850 Entity_Player::TriggerRoomExit /* ZHL [exact] __thiscall void Entity_Player::TriggerRoomExit(bool unk); */ void __thiscall Entity_Player::TriggerRoomExit(Entity_Player *this) { void *pvVar1; void *pvVar2; undefined4 uVar3; int iVar4; int iVar5; LayerState *layerState; int iVar6; void *pvVar7; AnimationState *lastAnimState; KColor *color; KColor *color_00; KColor *color_01; int *transitionTarget; float fVar8; float fVar9; AnimationLayer *local_168; Vector local_164; Vector local_15c; void *layerFrame; Vector local_150; int layerOffset; float local_144; KColor local_140; uint local_120; int local_11c; undefined4 local_118; undefined4 local_114; undefined4 local_110; float local_10c; undefined4 local_108; KColor whiteColor; undefined1 quadPrimary [104]; undefined1 auStack_88 [8]; undefined1 quadSecondary [124]; AnimationLayer *layerId; iVar6 = *(int *)this; if ((iVar6 != 2) && (iVar6 != 3)) { return; } if ((this->_bossStatusEffectCooldown != 0) && (iVar6 == 2)) { local_15c.x = g_screenWidth * 0.5; local_11c = *(int *)((this->_sprite)._animDefaultName._buf + 0xc); local_15c.y = g_screenHeight * 0.5; if (local_11c == 0) { return; } local_120 = 0; if (*(int *)(local_11c + 0x1c) == 0) { return; } layerOffset = 0; do { layerId = *(AnimationLayer **)(layerOffset + *(int *)(local_11c + 0x18)); layerFrame = AnimationState::GetLayerFrame ((AnimationState *)((this->_sprite)._animDefaultName._buf + 8), (int)layerId); layerState = ANM2::GetLayer((ANM2 *)&this->_spawnerVariant,(byte *)layerId); if (((layerState->_visible != 0) && (layerFrame != (void *)0x0)) && (*(char *)((int)layerFrame + 0x2c) != '\0')) { local_168 = (AnimationLayer *)(*(int *)(local_11c + 0x18) + layerOffset); if (((((int)layerId < 0) || (*(int *)(*(int *)((this->_sprite)._animDefaultName._buf + 8) + 0x80) <= (int)layerId)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), (int)layerId < 0)) || (*(int *)(*(int *)((this->_sprite)._animDefaultName._buf + 8) + 0x80) <= (int)layerId)) { iVar6 = 0; } else { iVar6 = *(int *)((this->_sprite)._animDefaultName._size + *(int *)(*(int *)((this->_sprite)._animDefaultName._buf + 0xc) + 0x38 + (int)layerId * 4) * 4); } AnimationLayer::RenderFrame (local_168,&local_15c,iVar6,&g_vectorZero,&g_vectorZero, (ANM2 *)&this->_spawnerVariant); local_168 = layerId; _Find_lower_bound<>(&local_140,&local_168); if (((*(char *)((int)local_140._blue + 0xd) == '\0') && (*(AnimationLayer **)((int)local_140._blue + 0x10) <= layerId)) && ((local_140._blue != (float)this->_charmedCountdown && (local_168 = layerId, iVar6 = FUN_00833010(&local_168), *(char *)(iVar6 + 0x109) != '\0' )))) { local_150.x = -*(float *)((int)layerFrame + 0x20) * *(float *)((int)layerFrame + 0x18); local_164.x = -*(float *)((int)layerFrame + 0x24) * *(float *)((int)layerFrame + 0x1c); local_144 = *(float *)((int)layerFrame + 0x5c) * 0.017453292; local_168 = (AnimationLayer *)cos(local_144); fVar8 = sin(local_144); local_144 = (float)local_168 * local_150.x - fVar8 * local_164.x; local_168 = (AnimationLayer *)((float)local_168 * local_164.x + fVar8 * local_150.x); local_164.x = (float)layerId; local_150.x = (float)((int)layerFrame + 0x30); iVar6 = FUN_00833010(&local_164); if ((AnimationState *)(iVar6 + 0xa8) != (AnimationState *)local_150.x) { pvVar7 = *(void **)((int)local_150.x + 4); pvVar1 = *(void **)((int)local_150.x + 8); pvVar2 = *(void **)((int)local_150.x + 0xc); ((AnimationState *)(iVar6 + 0xa8))->_animation = *(void **)local_150.x; *(void **)(iVar6 + 0xac) = pvVar7; *(void **)(iVar6 + 0xb0) = pvVar1; *(void **)(iVar6 + 0xb4) = pvVar2; uVar3 = *(undefined4 *)((int)local_150.x + 0x14); iVar4 = *(int *)((int)local_150.x + 0x18); iVar5 = *(int *)((int)local_150.x + 0x1c); *(float *)(iVar6 + 0xb8) = *(float *)((int)local_150.x + 0x10); *(undefined4 *)(iVar6 + 0xbc) = uVar3; *(int *)(iVar6 + 0xc0) = iVar4; *(int *)(iVar6 + 0xc4) = iVar5; *(undefined8 *)(iVar6 + 200) = *(undefined8 *)((int)local_150.x + 0x20); *(void **)(iVar6 + 0xd0) = ((AnimationState *)((int)local_150.x + 0x20))->_layerFrames; } local_164.x = (float)layerId; iVar6 = FUN_00833010(&local_164); *(undefined4 *)(iVar6 + 0xa4) = *(undefined4 *)((int)layerFrame + 0x5c); local_164.x = (float)layerId; iVar6 = FUN_00833010(&local_164); *(undefined4 *)(iVar6 + 0x9c) = *(undefined4 *)((int)layerFrame + 0x18); *(undefined4 *)(iVar6 + 0xa0) = *(undefined4 *)((int)layerFrame + 0x1c); local_164.x = (float)layerId; iVar6 = FUN_00833010(&local_164); fVar8 = (float)(this->_sprite)._numNullLayers; fVar9 = *(float *)((int)layerFrame + 0x14); *(float *)(iVar6 + 0x94) = local_144 + (float)(this->_sprite)._nullLayerNames + *(float *)((int)layerFrame + 0x10); *(float *)(iVar6 + 0x98) = (float)local_168 + fVar8 + fVar9; local_164.x = (float)layerId; iVar6 = FUN_00833010(&local_164); if (*(char *)(iVar6 + 0x109) != '\0') { local_150.x = (float)(iVar6 + 0x50); if (*(char *)(iVar6 + 0x70) == '\0') { AnimationState::Render ((AnimationState *)(iVar6 + 0x30),&local_15c,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)local_150.x; } else { AnimationState::Render ((AnimationState *)local_150.x,&local_15c,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(iVar6 + 0x30); } AnimationState::Render(lastAnimState,&local_15c,&g_vectorZero,&g_vectorZero); } } } local_120 = local_120 + 1; layerOffset = layerOffset + 0x10; } while (local_120 < *(uint *)(local_11c + 0x1c)); return; } iVar6 = *(int *)((int)&this->_pendingDamageFlags + 4); if ((((((iVar6 != 1) && (iVar6 != 2)) && (pvVar7 = (this->_damageEvents)._capacity, pvVar7 != (void *)0xffffffff)) && ((iVar6 != 0xb && (iVar6 != 0x10)))) && ((iVar6 != 0x11 && ((iVar6 != 0x12 && (iVar6 != 0x14)))))) && (iVar6 != 0x13)) { pvVar1 = (this->_damageEvents)._end; fVar9 = 1.0; local_15c.y = 0.0; local_15c.x = 0.0; local_164.y = 0.0; local_164.x = 0.0; fVar8 = (3.0 - ((float)pvVar1 + (float)pvVar1)) * (float)pvVar1 * (float)pvVar1; switch(pvVar7) { case (void *)0x0: local_15c.x = (float)this->_midasFreezeCountdown + g_screenWidth; local_164.x = (fVar8 - 1.0) * local_15c.x; local_15c.x = local_15c.x * fVar8; break; case (void *)0x1: local_15c.y = (float)this->_fearCountdown + g_screenHeight; local_164.y = (fVar8 - 1.0) * local_15c.y; local_15c.y = local_15c.y * fVar8; break; case (void *)0x2: local_15c.x = (float)this->_midasFreezeCountdown + g_screenWidth; local_164.x = (1.0 - fVar8) * local_15c.x; local_15c.x = -fVar8 * local_15c.x; break; case (void *)0x3: local_15c.y = (float)this->_fearCountdown + g_screenHeight; local_164.y = (1.0 - fVar8) * local_15c.y; local_15c.y = -fVar8 * local_15c.y; } set_blend_mode(&DAT_00c798e0,1); KColor::SetFromARGB(&whiteColor,0xffffffff); local_150.x = g_screenWidth; local_150.y = g_screenHeight; render_quad_set_rect(quadPrimary,&local_15c,&local_150,color); KColor::SetFromARGB(&whiteColor,0xffffffff); local_15c.x = g_screenWidth; local_15c.y = g_screenHeight; render_quad_set_rect(quadSecondary,&local_164,&local_15c,color_00); local_140._alpha = fVar9 - fVar8; local_140._unk = 0; local_140._red = 1.0; local_140._green = 1.0; local_140._blue = 1.0; local_108 = 0; local_118 = 0x3f800000; local_114 = 0x3f800000; local_110 = 0x3f800000; local_10c = fVar8; (**(code **)(*(int *)this->_type + 0x1c))(quadPrimary,&local_140); (**(code **)(*(int *)this->_subtype + 0x1c))(auStack_88,&local_120); return; } 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; KColor::SetFromARGB(&whiteColor,0xffffffff); render_quad_set_uniform_color(quadPrimary,0.0,0.0,g_screenWidth,g_screenHeight,color_01); if (*(int *)this == 2) { transitionTarget = (int *)this->_type; } else { if (*(int *)this != 3) goto LAB_00832ee2; transitionTarget = (int *)this->_subtype; } (**(code **)(*transitionTarget + 0x1c))(quadPrimary,g_drawRectUnset); LAB_00832ee2: g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; if (((byte)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; iVar6 = *(int *)((int)&this->_pendingDamageFlags + 4); local_140._red = 0.0; local_140._green = 0.0; local_140._blue = 0.0; if ((iVar6 == 3) || (iVar6 == 0x12)) { local_140._red = 1.0; local_140._green = 1.0; local_140._blue = 1.0; local_140._alpha = 1.0; } local_140._unk = 0; local_140._alpha = RoomTransition::get_hud_alpha((RoomTransition *)this); local_140._alpha = 1.0 - local_140._alpha; pvVar7 = render_quad_set_uniform_color (quadSecondary,0.0,0.0,g_screenWidth,g_screenHeight,&local_140); render_color_shader_pass(pvVar7); return; } //@@ 00832fd0 FUN_00832fd0 void FUN_00832fd0(void) { int iVar1; int *in_ECX; iVar1 = *in_ECX; if ((iVar1 != 2) && (iVar1 != 3)) { return; } if (iVar1 == 3) { return; } return; } //@@ 00833010 FUN_00833010 int FUN_00833010(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b021a5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(uint *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0xdd67c8) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = (undefined4 *)0x0; newNode = operator_new(0x128); local_8 = 1; newNode[4] = *param_1; local_14 = newNode; ANM2::constructor((ANM2 *)(newNode + 5)); *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 008330e0 std::map::_Erase_tree /* DB: ? recursive _Erase_tree: ANM2::Reset of the node value (+0x14) and tracked frees; RoomTransition::~RoomTransition, RoomTransition::StartBossIntro */ void std::map::_Erase_tree(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; int iVar3; uint uVar4; qword qVar5; void **ppvVar6; qword *pqVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af74e0; cVar1 = *(char *)((int)param_2 + 0xd); ppvVar6 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar6, cVar1 == '\0') { _Erase_tree(param_1,param_2[2]); piVar2 = (int *)*param_2; local_8 = 0; ANM2::Reset((ANM2 *)(param_2 + 5)); iVar3 = param_2[0x1b]; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar3 + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)(iVar3 + -4)); param_2[0x1b] = 0; } iVar3 = param_2[0x1c]; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar3 + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)(iVar3 + -4)); param_2[0x1c] = 0; } iVar3 = param_2[0x13]; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar3 + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)(iVar3 + -4)); param_2[0x13] = 0; } iVar3 = param_2[0x14]; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar3 + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)(iVar3 + -4)); param_2[0x14] = 0; } string::_Tidy_deallocate((char *)(param_2 + 0xb)); string::_Tidy_deallocate((char *)(param_2 + 5)); local_8 = 0xffffffff; operator_delete(param_2,0x128); ppvVar6 = ExceptionList; param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } ExceptionList = local_10; return; } //@@ 00833270 FUN_00833270 void FUN_00833270(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x128); } return; } //@@ 00833290 GridEntity_Door::Slot /* ZHL [lua] Lua binding GridEntityDoor:Slot */ int __thiscall GridEntity_Door::Slot(GridEntity_Door *this) { return this->_slot; } //@@ 008332a0 FUN_008332a0 void FUN_008332a0(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x44) | 8; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x44) & 0xfffffff7; } *(uint *)(in_ECX + 0x44) = uVar1; return; } //@@ 008332c0 Room::SetAmbushDone /* ZHL [lua] Lua binding Room:SetAmbushDone */ void Room::SetAmbushDone(char param_1) { uint uVar1; int in_ECX; uint uVar2; uVar1 = *(uint *)(*(int *)(in_ECX + 4) + 0x44); uVar2 = uVar1 | 8; if (param_1 == '\0') { uVar2 = uVar1 & 0xfffffff7; } *(uint *)(*(int *)(in_ECX + 4) + 0x44) = uVar2; return; } //@@ 008332e0 Ambush::shuffle_waves /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? copies the wave list (+0..+4) into the vector at +0xc and Fisher-Yates shuffles its 0xc-byte entries with a xorshift seeded from the current RoomDescriptor +0x5c ("RNG Seed is zero!"); callers Ambush::StartChallenge, Game::restore_game_state */ undefined4 * Ambush::shuffle_waves(void) { undefined4 *puVar1; int iVar2; undefined4 uVar3; code *pcVar4; undefined4 *puVar5; uint uVar6; int *in_ECX; uint uVar7; uint uVar8; undefined4 local_1c; int local_18; int local_14; if (in_ECX + 3 != in_ECX) { std::vector>::assign(*in_ECX,in_ECX[1],local_1c); } iVar2 = *(int *)((int)g_game->_room + 4); uVar6 = 0; if (iVar2 != 0) { uVar6 = *(uint *)(iVar2 + 0x5c); } iVar2 = in_ECX[3]; puVar5 = (undefined4 *)((in_ECX[4] - iVar2) * 0x2aaaaaab); uVar8 = (in_ECX[4] - iVar2) / 0xc; local_14 = uVar8 - 1; if (0 < local_14) { local_18 = local_14 * 0xc; do { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); puVar5 = (undefined4 *)(*pcVar4)(); return puVar5; } uVar6 = uVar6 >> 1 ^ uVar6; uVar6 = uVar6 << 5 ^ uVar6; uVar6 = uVar6 >> 0x13 ^ uVar6; uVar7 = 0; if (uVar8 != 0) { uVar7 = uVar6 % uVar8; } puVar1 = (undefined4 *)(iVar2 + uVar7 * 0xc); puVar5 = (undefined4 *)(iVar2 + local_18); if (puVar5 != puVar1) { uVar3 = *puVar5; *(undefined4 *)(local_18 + iVar2) = *puVar1; *puVar1 = uVar3; uVar3 = *(undefined4 *)(local_18 + 4 + iVar2); *(undefined4 *)(local_18 + 4 + iVar2) = puVar1[1]; puVar1[1] = uVar3; uVar3 = *(undefined4 *)(local_18 + 8 + iVar2); *(undefined4 *)(local_18 + 8 + iVar2) = puVar1[2]; puVar1[2] = uVar3; puVar5 = puVar1; } local_14 = local_14 + -1; local_18 = local_18 + -0xc; uVar8 = uVar8 - 1; } while (0 < local_14); } return puVar5; } //@@ 00833420 Ambush::StartChallenge /* DB: closes doors unless Door Stop, plays challenge/bossrush music, room types 11/17 prototype: REPENTOGON */ void __thiscall Ambush::StartChallenge(Ambush *this) { GridEntity_Door *this_00; int iVar1; int iVar2; Entity_Player *this_01; int iVar3; uint uVar4; undefined4 uVar5; void *pvVar6; Game *pGVar7; int iVar8; if (((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 3 & 1) == 0) && (this->_isActive == 0) ) { this->_isActive = 1; *(undefined4 *)(this + 1) = 0x1e; this->_currentWave = 0; shuffle_waves(); this_01 = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x7c); if (this_01 == (Entity_Player *)0x0) { iVar3 = 0; } else { iVar3 = Entity_Player::GetTrinketMultiplier(this_01,0x7c); } iVar8 = 0x724; uVar4 = 0; pGVar7 = g_game; do { uVar4 = uVar4 + 1; if (uVar4 < 9) { pvVar6 = pGVar7->_room; this_00 = *(GridEntity_Door **)(iVar8 + (int)pvVar6); if (((this_00 != (GridEntity_Door *)0x0) && ((pGVar7->_enterDoor != this_00->_slot || (((iVar3 < 2 || (*(int *)((int)pvVar6 + 8) != 0x11)) && ((iVar3 < 3 || (*(int *)((int)pvVar6 + 8) != 0xb)))))))) && ((this_00->_desc)._state != 1)) { (this_00->_desc)._state = 1; GridEntity_Door::UpdateAnimation(this_00); iVar1 = this_00->_currentRoomType; if (((((iVar1 == 7) || (iVar2 = this_00->_targetRoomType, iVar2 == 7)) || (iVar1 == 8)) || ((iVar2 == 8 || (iVar1 == 0x1d)))) || (pGVar7 = g_game, iVar2 == 0x1d)) { std::string::assign((this_00->_openAnimation)._buf,s_Open,4); pGVar7 = g_game; } } } iVar8 = iVar8 + 4; } while (iVar8 < 0x744); Music::Play((Music *)&g_manager->_musicManager,(*(int *)((int)pGVar7->_room + 8) == 0x11) + 0x26 ,(g_manager->_optionsConfig)._musicVolume); pGVar7 = g_game; iVar3 = *(int *)((int)g_game->_room + 4); uVar5 = 0; if (iVar3 != 0) { uVar5 = *(undefined4 *)(iVar3 + 0x5c); } *(undefined4 *)&this[1].field_0x4 = uVar5; *(undefined4 *)&this[1].field_0x8 = 5; this[1]._bossRushWaves._begin = (void *)0x9; this[1]._bossRushWaves._end = &DAT_00000007; iVar3 = *(int *)((int)pGVar7->_room + 4); pvVar6 = (void *)0x0; if (iVar3 != 0) { pvVar6 = *(void **)(iVar3 + 0x5c); } this[1]._bossRushWaves._capacity = pvVar6; this[1]._maxWaves = 7; *(undefined4 *)&this[1].field_0x1c = 0x11; *(undefined4 *)&this[1]._isActive = 0x15; } return; } //@@ 00833600 Ambush::SpawnWave /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix65/66] __thiscall void Ambush::SpawnWave(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Ambush::SpawnWave(Ambush *this) { code *pcVar1; int iVar2; uint uVar3; void *pvVar4; undefined8 *pickedEntry; uint uVar5; undefined4 *playerSlot; int gridX; Entity *entryType; uint *puVar6; short *spawnEntry; PlayerManager *playerManager; uint local_90; Vector local_8c; int local_84; uint *entries; uint *entriesEnd; uint *local_78; Vector local_74; uint *entriesCapacity; Entity *local_68; uint local_64; uint *local_60; Room *room; uint *local_58; Game *local_54; uint newEntry; undefined8 uStack_4c; uint uStack_44; undefined8 entry; uint local_38; int difficultyTable [5]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; Manager *manager; undefined2 variant; local_14 = 0xffffffff; puStack_18 = &LAB_00b021dd; local_1c = ExceptionList; puStack_20 = (undefined1 *)(difficultyTable + 0xc); difficultyTable[4] = __security_cookie ^ (uint)(difficultyTable + 9); ExceptionList = &local_1c; difficultyTable[0] = 1; difficultyTable[1] = 5; difficultyTable[2] = 10; difficultyTable[3] = 0xf; local_54 = g_game; room = g_game->_room; iVar2 = this->_currentWave - (uint)(g_game->_difficulty != 1); if (3 < iVar2) { iVar2 = 3; } local_84 = difficultyTable[iVar2]; if (g_game->_challenge == 0x2c) { uVar3 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); local_58 = (uint *)RoomConfig::GetStageID(local_54->_stage,uVar3,-1); local_54 = g_game; } else if (g_game->_currentDimensionIdx == 2) { local_58 = (uint *)&DAT_00000023; } else { local_58 = (uint *)RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); } local_8c.y = (float)(0xb - (uint)(*(int *)(*(int *)((int)room->_descriptor + 0x10) + 0x10) != 1)); puVar6 = (uint *)0x0; local_60 = (uint *)0x0; entries = (uint *)0x0; entriesEnd = (uint *)0x0; entriesCapacity = (uint *)0x0; local_78 = (uint *)0x0; local_14 = 0; local_64 = 0; local_68 = (Entity *)0x3e8; do { if (local_60 != puVar6) { LAB_00833972: local_58 = local_60 + 1; do { puVar6 = local_58; local_68 = (Entity *)local_58[-1]; local_8c.x = (float)((int)local_68 % room->_gridWidth) * 40.0 + 40.0; local_8c.y = (float)((int)local_68 / room->_gridWidth) * 40.0 + 120.0; Room::FindFreeTilePosition(room,&local_74,&local_8c,0.0); pvVar4 = this[1]._bossRushWaves._capacity; if (*puVar6 - 10 < 0x3de) { if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } puVar6 = local_58; uVar3 = (uint)pvVar4 >> ((byte)this[1]._maxWaves & 0x1f) ^ (uint)pvVar4; uVar3 = uVar3 << ((byte)*(undefined4 *)&this[1].field_0x1c & 0x1f) ^ uVar3; pvVar4 = (void *)(uVar3 >> ((byte)*(undefined4 *)&this[1]._isActive & 0x1f) ^ uVar3); this[1]._bossRushWaves._capacity = pvVar4; variant = (undefined2)local_58[1]; iVar2 = spawn_enemy_spawner_effect (*local_58,variant,&local_74,variant,0, *(undefined2 *)((int)local_58 + 6),pvVar4,variant,local_68); local_54 = g_game; if ((((g_game != (Game *)0x0) && (1 < *(int *)&g_game->_deathmatchManager)) && (*puVar6 == 1)) || (*puVar6 - 10 < 0x3de)) { *(uint *)(iVar2 + 0x16c) = *(uint *)(iVar2 + 0x16c) | 0x80; *(undefined4 *)(iVar2 + 0x168) = *(undefined4 *)(iVar2 + 0x168); } } else { if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pvVar4 = this[1]._bossRushWaves._capacity; local_54 = g_game; if (pvVar4 == (void *)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } puVar6 = local_58; uVar3 = (uint)pvVar4 >> ((byte)this[1]._maxWaves & 0x1f) ^ (uint)pvVar4; uVar3 = uVar3 << ((byte)*(undefined4 *)&this[1].field_0x1c & 0x1f) ^ uVar3; pvVar4 = (void *)(uVar3 >> ((byte)*(undefined4 *)&this[1]._isActive & 0x1f) ^ uVar3); this[1]._bossRushWaves._capacity = pvVar4; local_68 = Game::Spawn(local_54,*local_58,(uint)(ushort)local_58[1],&local_74, &g_vectorZero,(Entity *)0x0,(uint)*(ushort *)((int)local_58 + 6), (uint)pvVar4); if (local_68->_type == 1000) { (**(code **)(*(int *)local_68 + 0xc))(); } local_68->_spawnGridIndex = puVar6[-1]; local_54 = g_game; } local_58 = puVar6 + 4; } while (puVar6 + 3 != entriesEnd); LAB_00833b32: manager = g_manager; local_64 = 0x367; seed_fart_sound_override((int *)&local_64); SoundEffects::Play(&manager->_sfxManager,local_64,1.0,2,0,1.0,0.0); uVar3 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar4 = (playerManager->_playerList)._end; if ((int)pvVar4 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (uVar3 < (uint)((int)pvVar4 - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar3; } Entity_Player::spawn_locusts((Entity_Player *)*playerSlot); uVar3 = uVar3 + 1; playerManager = &g_game->_playerManager; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } if (local_60 != (uint *)0x0) { uVar3 = (int)entriesCapacity - (int)local_60 & 0xfffffff0; puVar6 = local_60; if (0xfff < uVar3) { puVar6 = (uint *)local_60[-1]; uVar3 = uVar3 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_60 + (-4 - (int)puVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar6,uVar3); } ExceptionList = local_1c; return; } local_54 = (Game *)&local_54->_roomConfig; local_90 = 0; local_74.y = (float)Room::GetRoomShape(room); pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = (uint)pvVar4 >> ((byte)this[1]._maxWaves & 0x1f) ^ (uint)pvVar4; uVar3 = uVar3 << ((byte)*(undefined4 *)&this[1].field_0x1c & 0x1f) ^ uVar3; pvVar4 = (void *)(uVar3 >> ((byte)*(undefined4 *)&this[1]._isActive & 0x1f) ^ uVar3); this[1]._bossRushWaves._capacity = pvVar4; local_54 = (Game *)RoomConfig::GetRandomRoom ((RoomConfig *)local_54,(uint)pvVar4,1,(int)local_58,0xb, (int)local_74.y,0,-1,local_84,local_84,&local_90,(uint)local_8c.y, -1); if (local_54 == (Game *)0x0) { if (local_58 == (uint *)0x0) { KAGE_LogMessage(0x10,(byte *)"No enemy wave found for ambush (difficulty: %d)\n"); goto LAB_008337d3; } local_58 = (uint *)0x0; } else { LAB_008337d3: local_74.y = 0.0; if (*(short *)((int)local_54 + 0x44) != 0) { local_60 = (uint *)0x0; do { spawnEntry = (short *)((int)*(void **)((int)local_54 + 0x40) + (int)local_60); pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = (uint)pvVar4 >> ((byte)this[1]._maxWaves & 0x1f) ^ (uint)pvVar4; uVar3 = uVar3 << ((byte)*(undefined4 *)&this[1].field_0x1c & 0x1f) ^ uVar3; pvVar4 = (void *)(uVar3 >> ((byte)*(undefined4 *)&this[1]._isActive & 0x1f) ^ uVar3); this[1]._bossRushWaves._capacity = pvVar4; pickedEntry = Spawn::PickEntry(spawnEntry, (float)((double)(int)pvVar4 + __uint_to_double_fixup[-((int)pvVar4 >> 0x1f)]) * 2.3283062e-10); entry = *pickedEntry; local_38 = *(uint *)(pickedEntry + 1); iVar2 = spawnEntry[1] + 1; gridX = *spawnEntry + 1; if ((((gridX < 0) || (room->_gridWidth <= gridX)) || (iVar2 < 0)) || (room->_gridHeight <= iVar2)) { uVar3 = 0xffffffff; } else { uVar3 = room->_gridWidth * iVar2 + gridX; } pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pvVar4 = this[1]._bossRushWaves._capacity; if (pvVar4 == (void *)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar5 = (uint)pvVar4 >> ((byte)this[1]._maxWaves & 0x1f) ^ (uint)pvVar4; uVar5 = uVar5 << ((byte)*(undefined4 *)&this[1].field_0x1c & 0x1f) ^ uVar5; pvVar4 = (void *)(uVar5 >> ((byte)*(undefined4 *)&this[1]._isActive & 0x1f) ^ uVar5); this[1]._bossRushWaves._capacity = pvVar4; Room::TransformEntry(room,&entry,uVar3,(uint)pvVar4); if ((undefined1 *)((int)&((Entity *)entry)[-1]._luaBridgeRef + 3U) < (undefined1 *)0x3e7) { entryType = (Entity *)entry; if ((Entity *)entry == (Entity *)0x3e7) { entryType = local_68; } entry = CONCAT44(entry._4_4_,entryType); uStack_4c = entry; uStack_44 = local_38; newEntry = uVar3; if (entriesEnd == entriesCapacity) { std::vector::_Emplace_reallocate(entriesEnd,&newEntry); entriesCapacity = local_78; } else { *entriesEnd = uVar3; entriesEnd[1] = (uint)entryType; entriesEnd[2] = entry._4_4_; entriesEnd[3] = local_38; entriesEnd = entriesEnd + 4; } } local_74.y = (float)((int)local_74.y + 1); local_60 = (uint *)((int)local_60 + 0x10); } while ((uint)local_74.y < (uint)(ushort)*(short *)((int)local_54 + 0x44)); local_60 = entries; puVar6 = entriesEnd; } } local_64 = local_64 + 1; if (9 < local_64) { local_54 = g_game; if (local_60 == puVar6) goto LAB_00833b32; goto LAB_00833972; } local_54 = g_game; } while( true ); } //@@ 00833c40 Ambush::SpawnBossrushWave /* WARNING: Removing unreachable block (ram,0x008342f2) */ /* WARNING: Removing unreachable block (ram,0x00833d0a) */ /* WARNING: Removing unreachable block (ram,0x00833d40) */ /* WARNING: Removing unreachable block (ram,0x00833de7) */ /* WARNING: Removing unreachable block (ram,0x00833def) */ /* WARNING: Removing unreachable block (ram,0x00833dd2) */ /* WARNING: Removing unreachable block (ram,0x00833e02) */ /* WARNING: Removing unreachable block (ram,0x00833e11) */ /* WARNING: Removing unreachable block (ram,0x00833e53) */ /* WARNING: Removing unreachable block (ram,0x00833ebb) */ /* WARNING: Removing unreachable block (ram,0x00833f52) */ /* WARNING: Removing unreachable block (ram,0x00833f57) */ /* WARNING: Removing unreachable block (ram,0x00833f17) */ /* WARNING: Removing unreachable block (ram,0x00833f90) */ /* WARNING: Removing unreachable block (ram,0x00833f95) */ /* WARNING: Removing unreachable block (ram,0x00833f9e) */ /* WARNING: Removing unreachable block (ram,0x00833fb5) */ /* WARNING: Removing unreachable block (ram,0x00833fff) */ /* WARNING: Removing unreachable block (ram,0x00834002) */ /* WARNING: Removing unreachable block (ram,0x0083400b) */ /* WARNING: Removing unreachable block (ram,0x00834010) */ /* WARNING: Removing unreachable block (ram,0x0083405e) */ /* WARNING: Removing unreachable block (ram,0x0083407a) */ /* WARNING: Removing unreachable block (ram,0x00834094) */ /* WARNING: Removing unreachable block (ram,0x008340c6) */ /* WARNING: Removing unreachable block (ram,0x008340e0) */ /* WARNING: Removing unreachable block (ram,0x008340f1) */ /* WARNING: Removing unreachable block (ram,0x00834100) */ /* WARNING: Removing unreachable block (ram,0x00834145) */ /* WARNING: Removing unreachable block (ram,0x0083414c) */ /* WARNING: Removing unreachable block (ram,0x00834150) */ /* WARNING: Removing unreachable block (ram,0x0083415c) */ /* WARNING: Removing unreachable block (ram,0x00834155) */ /* WARNING: Removing unreachable block (ram,0x0083415f) */ /* WARNING: Removing unreachable block (ram,0x008341bc) */ /* WARNING: Removing unreachable block (ram,0x008341c4) */ /* WARNING: Removing unreachable block (ram,0x00834201) */ /* WARNING: Removing unreachable block (ram,0x00834213) */ /* WARNING: Removing unreachable block (ram,0x00834218) */ /* WARNING: Removing unreachable block (ram,0x0083422a) */ /* WARNING: Removing unreachable block (ram,0x0083422f) */ /* WARNING: Removing unreachable block (ram,0x00834242) */ /* WARNING: Removing unreachable block (ram,0x00834317) */ /* WARNING: Removing unreachable block (ram,0x00834327) */ /* WARNING: Removing unreachable block (ram,0x0083432d) */ /* ZHL [exact] __thiscall void Ambush::SpawnBossrushWave(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Ambush::SpawnBossrushWave(Ambush *this) { int iVar1; Manager *pMVar2; uint uVar3; undefined4 *playerSlot; int iVar4; void *pvVar5; int iVar6; PlayerManager *playerManager; Vector leftCopyPos; Vector rightCopyPos; Vector bodySpawnPos; Vector headSpawnPos; undefined4 local_38; int local_20 [4]; void *local_10; undefined1 *puStack_c; int local_8; void **wavesEnd; puStack_c = &LAB_00b0221d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_20 + 7); ExceptionList = &local_10; iVar6 = 0; local_8 = 0; if (0 < *(int *)&this->field_0x1c) { do { iVar4 = (int)(this->_bossRushWaves)._end - (int)(this->_bossRushWaves)._begin; iVar1 = iVar4 >> 0x1f; if (iVar4 / 0xc + iVar1 == iVar1) break; pvVar5 = (this->_bossRushWaves)._end; std::vector<12byte>::insert_range (0,*(undefined4 *)((int)pvVar5 + -0xc),*(undefined4 *)((int)pvVar5 + -8),local_38); std::vector<12byte>::_Tidy(uVar3); wavesEnd = &(this->_bossRushWaves)._end; *wavesEnd = (void *)((int)*wavesEnd + -0xc); iVar6 = iVar6 + 1; } while (iVar6 < *(int *)&this->field_0x1c); } local_20[0] = 0; KAGE_LogMessage(0x10,(byte *)"Wave has no entries!"); pMVar2 = g_manager; local_20[0] = 0x367; seed_fart_sound_override(local_20); SoundEffects::Play(&pMVar2->_sfxManager,local_20[0],1.0,2,0,1.0,0.0); uVar3 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar5 = (playerManager->_playerList)._end; if ((int)pvVar5 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (uVar3 < (uint)((int)pvVar5 - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar3; } Entity_Player::spawn_locusts((Entity_Player *)*playerSlot); uVar3 = uVar3 + 1; playerManager = &g_game->_playerManager; } while (uVar3 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } ExceptionList = local_10; return; } //@@ 00834350 Ambush::Update /* DB: called from Room::Update when roomType is challenge(0xb)/boss rush(0x11) and Game._ambush.active; this=Ambush (+0x18 maxBossWaves, +0x24 currentWave, +0xc/+0x10 wave vector, +0x28 countdown); Ambush::SpawnWave/SpawnBossrushWave, Room::SpawnClearAward, MusicManager::Crossfade */ void Ambush::Update(void) { int iVar1; int iVar2; Entity_Player *player; Ambush *in_ECX; int iVar3; int iVar4; int iVar5; uint playerIndex; void *local_1c; int tempEffect [3]; undefined4 local_c; void *collectibles; Game *game; Manager *manager; uint *roomFlags; game = g_game; iVar1 = *(int *)((int)g_game->_room + 8); if (iVar1 == 0x11) { iVar3 = (int)(in_ECX->_bossRushWaves)._end - (int)(in_ECX->_bossRushWaves)._begin; iVar4 = in_ECX->_maxWaves; iVar2 = iVar3 >> 0x1f; if (iVar3 / 0xc + iVar2 == iVar2) { in_ECX->_maxWaves = in_ECX->_currentWave; } } else { iVar4 = (*(int *)(*(int *)(*(int *)((int)g_game->_room + 4) + 0x10) + 0x10) != 1) + 2; } iVar2 = *(int *)(in_ECX + 1); if (0 < iVar2) { local_1c = game->_room; iVar5 = *(int *)((int)local_1c + 0x12c4) + *(int *)((int)local_1c + 0x12c0); iVar3 = 0; if (0 < iVar5) { iVar3 = iVar5; } if ((iVar3 != 0) || (iVar1 == 0x11)) { iVar5 = *(int *)((int)local_1c + 0x12cc) + *(int *)((int)local_1c + 0x12c8); iVar3 = 0; if (0 < iVar5) { iVar3 = iVar5; } if (0 < iVar3) { return; } if (iVar1 != 0x11) { return; } } if (((iVar2 == 0x1e) && (0 < in_ECX->_currentWave)) && (in_ECX->_currentWave < iVar4)) { PlayerManager::trigger_room_clear(&g_game->_playerManager); if (iVar1 == 0x11) { PlayerManager::trigger_room_clear(&g_game->_playerManager); } playerIndex = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,playerIndex); collectibles = (g_manager->_itemConfig)._collectibles._begin; if ((0x898 < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)collectibles & 0xfffffffcU)) && (iVar1 = *(int *)((int)collectibles + 0x898), iVar1 != 0)) { tempEffect[2] = *(undefined4 *)(iVar1 + 0x78); tempEffect[1] = 0; local_c = 0; tempEffect[0] = iVar1; TemporaryEffects::RemoveEffect(&player->_temporaryeffects,tempEffect,1); } playerIndex = playerIndex + 1; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); } RNG::Next((RNG *)&in_ECX[1].field_0x4); iVar2 = *(int *)(in_ECX + 1); } *(int *)(in_ECX + 1) = iVar2 + -1; return; } if (iVar4 <= in_ECX->_currentWave) { in_ECX->_isActive = 0; roomFlags = (uint *)(*(int *)((int)game->_room + 4) + 0x44); *roomFlags = *roomFlags | 8; iVar4 = *(int *)((int)game->_room + 4); if ((iVar4 == 0) || (*(int *)(iVar4 + 0x10) == 0)) { iVar2 = 1; } else { iVar2 = *(int *)(*(int *)(iVar4 + 0x10) + 0x48); } ScoreSheet::add_cleared_room (&game->_scoreSheet,*(int *)((int)game->_room + 8),iVar2,1, (byte)(*(uint *)(iVar4 + 0x44) >> 10) & 1); iVar4 = 0x5c; if (*(int *)((int)g_game->_room + 8) == 0x11) { iVar4 = 0x28; } MusicManager::Crossfade(&g_manager->_musicManager,iVar4,0.08); if (0x25 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60) { (g_manager->_musicManager)._queuedMusicID = 0x25; } Room::SpawnClearAward(); PlayerManager::trigger_room_clear(&g_game->_playerManager); if (iVar1 == 0x11) { PlayerManager::trigger_room_clear(&g_game->_playerManager); } manager = g_manager; local_1c = (void *)0x24; roomFlags = (uint *)(*(int *)((int)g_game->_room + 4) + 0x44); *roomFlags = *roomFlags | 1; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&manager->_sfxManager,(int)local_1c,1.0,2,0,1.0,0.0); return; } *(undefined4 *)(in_ECX + 1) = 0x1e; in_ECX->_currentWave = in_ECX->_currentWave + 1; if (iVar1 == 0x11) { SpawnBossrushWave(in_ECX); return; } SpawnWave(in_ECX); return; } //@@ 00834680 Game::LoadBossRushXml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Game::LoadConfigXmls callee: FileSystem::Open, root "bossrush", chunks/numWaves/spawnsPerWave/enemy/variant/count */ 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 ^ (uint)(xmlPool + 0x1002c); ExceptionList = &local_10; file = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (file != (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; rapidxml::xml_document::parse(xmlDoc,fileBuffer); xmlNode = xml_node::first_node(xmlDoc,(byte *)"bossrush",iVar2,(byte)pbVar6); bVar10 = (byte)pbVar6; attr = *(undefined4 **)((int)xmlNode + 0x20); if (attr != (undefined4 *)0x0) { do { pbVar4 = (byte *)*attr; pcVar5 = "numWaves"; pbVar3 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar3 = pbVar4; } do { bVar10 = *pbVar3; isLess = bVar10 < (byte)*pcVar5; if (bVar10 != *pcVar5) { LAB_008347b6: uVar1 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } iVar2 = 0x8347d3; iVar8 = atoi((char *)pbVar6); in_ECX[6] = iVar8; } else { pcVar5 = "spawnsPerWave"; pbVar3 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar3 = pbVar4; } do { bVar10 = *pbVar3; isLess = bVar10 < (byte)*pcVar5; if (bVar10 != *pcVar5) { LAB_00834807: uVar1 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } iVar2 = 0x834824; iVar8 = atoi((char *)pbVar6); in_ECX[7] = iVar8; } } bVar10 = (byte)pbVar6; } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); } xmlNode = xml_node::first_node(xmlNode,(byte *)&DAT_00b65804,iVar2,bVar10); if (xmlNode != (void *)0x0) { LAB_00834860: waveSpawnsBegin = (void *)0x0; waveSpawnsEnd = (undefined8 *)0x0; waveSpawnsCapacity = (undefined8 *)0x0; local_8 = CONCAT31(local_8._1_3_,1); pcVar5 = "enemy"; do { pcVar9 = pcVar5; pcVar5 = pcVar9 + 1; } while (*pcVar5 != '\0'); enemyNode = *(undefined4 **)((int)xmlNode + 0x18); if (enemyNode != (undefined4 *)0x0) { do { pbVar6 = (byte *)*enemyNode; if (pbVar6 == (byte *)0x0) { pcVar5 = (char *)0x0; pbVar6 = &g_xmlNullStr; } else { pcVar5 = (char *)enemyNode[2]; } if (pcVar5 == pcVar9 + -0xb681ff) { pbVar4 = pbVar6 + (int)pcVar5; if (pbVar4 <= pbVar6) goto LAB_008348e0; iVar2 = (int)&DAT_00b68200 - (int)pbVar6; while (*pbVar6 == pbVar6[iVar2]) { pbVar6 = pbVar6 + 1; if (pbVar4 <= pbVar6) goto LAB_008348e0; } } enemyNode = (undefined4 *)enemyNode[0xb]; } while (enemyNode != (undefined4 *)0x0); enemyNode = (undefined4 *)0x0; } goto LAB_00834b46; } LAB_00834bf5: local_8 = 2; xml_memory_pool::clear(xmlPool); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (fileBuffer != (byte *)0x0) { uVar1 = *(uint *)(fileBuffer + -4); oldAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)oldAllocatedBytes < uVar1); free(fileBuffer + -4); } } ExceptionList = local_10; return; LAB_008348e0: do { attr = (undefined4 *)enemyNode[8]; enemyCount = 1; enemyType = 0; enemyVariant = 0; enemyChunks = 1; if (attr == (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); *(int *)(waveSpawnsEnd + 1) = iVar2; waveSpawnsEnd = (undefined8 *)((int)waveSpawnsEnd + 0xc); } iVar8 = iVar8 + -1; } while (iVar8 != 0); } else { do { pbVar6 = (byte *)*attr; pbVar3 = &DAT_00b69a0c; pbVar4 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; } do { bVar10 = *pbVar4; isLess = bVar10 < *pbVar3; if (bVar10 != *pbVar3) { LAB_0083495f: uVar1 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } enemyType = atoi((char *)pbVar6); } else { pcVar5 = "variant"; pbVar4 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; } do { bVar10 = *pbVar4; isLess = bVar10 < (byte)*pcVar5; if (bVar10 != *pcVar5) { LAB_00834a10: uVar1 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } enemyVariant = atoi((char *)pbVar6); } else { pcVar5 = "chunks"; pbVar4 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; } do { bVar10 = *pbVar4; isLess = bVar10 < (byte)*pcVar5; if (bVar10 != *pcVar5) { LAB_00834a70: uVar1 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } enemyChunks = atoi((char *)pbVar6); } else { pcVar5 = "count"; pbVar4 = &g_xmlNullStr; if (pbVar6 != (byte *)0x0) { pbVar4 = pbVar6; } do { bVar10 = *pbVar4; isLess = bVar10 < (byte)*pcVar5; if (bVar10 != *pcVar5) { LAB_00834ad0: uVar1 = -(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 ((byte *)attr[1] != (byte *)0x0) { pbVar6 = (byte *)attr[1]; } enemyCount = atoi((char *)pbVar6); } } } } } while ((attr[4] != 0) && (attr = (undefined4 *)attr[6], attr != (undefined4 *)0x0)); if (0 < enemyCount) goto LAB_008349b0; } enemyNode = (undefined4 *)enemyNode[0xb]; } while (enemyNode != (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 = (((int)waveSpawnsCapacity - (int)waveSpawnsBegin) / 0xc) * 0xc; ptr = waveSpawnsBegin; if (0xfff < uVar1) { ptr = *(void **)((int)waveSpawnsBegin + -4); uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)waveSpawnsBegin + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar1); waveSpawnsBegin = (void *)0x0; waveSpawnsEnd = (undefined8 *)0x0; waveSpawnsCapacity = (undefined8 *)0x0; } xmlNode = *(void **)((int)xmlNode + 0x2c); if (xmlNode == (void *)0x0) goto LAB_00834bf5; goto LAB_00834860; } //@@ 00834c60 FUN_00834c60 undefined8 * FUN_00834c60(undefined8 *param_1,undefined8 *param_2) { uint uVar1; undefined8 *puVar2; uint uVar3; int iVar4; int iVar5; undefined8 *puVar6; undefined8 *puVar7; int *in_ECX; undefined8 *puVar8; uint uVar9; undefined8 *puVar10; iVar4 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0xc; if (iVar5 == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar5 + 1; uVar3 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar3 >> 1) < uVar3) { uVar9 = 0x15555555; } else { uVar3 = (uVar3 >> 1) + uVar3; uVar9 = uVar1; if (uVar1 <= uVar3) { uVar9 = uVar3; } if (0x15555555 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = std::_Allocate(uVar9 * 0xc); puVar2 = (undefined8 *)((int)puVar6 + (((int)param_1 - iVar4) / 0xc) * 0xc); *puVar2 = *param_2; *(undefined4 *)(puVar2 + 1) = *(undefined4 *)(param_2 + 1); puVar10 = (undefined8 *)in_ECX[1]; puVar7 = (undefined8 *)*in_ECX; puVar8 = puVar6; if (param_1 == puVar10) { for (; puVar7 != puVar10; puVar7 = (undefined8 *)((int)puVar7 + 0xc)) { *puVar8 = *puVar7; *(undefined4 *)(puVar8 + 1) = *(undefined4 *)(puVar7 + 1); puVar8 = (undefined8 *)((int)puVar8 + 0xc); } } else { if (puVar7 != param_1) { do { *puVar8 = *puVar7; puVar10 = puVar7 + 1; puVar7 = (undefined8 *)((int)puVar7 + 0xc); *(undefined4 *)(puVar8 + 1) = *(undefined4 *)puVar10; puVar8 = (undefined8 *)((int)puVar8 + 0xc); } while (puVar7 != param_1); puVar10 = (undefined8 *)in_ECX[1]; } if (param_1 != puVar10) { puVar7 = puVar2; do { *(undefined8 *)((int)puVar7 + 0xc) = *param_1; puVar8 = param_1 + 1; param_1 = (undefined8 *)((int)param_1 + 0xc); *(undefined4 *)((int)puVar7 + 0x14) = *(undefined4 *)puVar8; puVar7 = (undefined8 *)((int)puVar7 + 0xc); } while (param_1 != puVar10); } } FUN_00834fa0(puVar6,uVar1,uVar9); return puVar2; } //@@ 00834dc0 std::vector<12byte>::_Emplace_reallocate /* DB: growth/max 0x15555555 by /0xc, element built by FUN_008350d0; caller Game::LoadBossRushXml */ void * std::vector<12byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { void *pvVar1; int iVar2; void *pvVar3; void *pvVar4; int *in_ECX; uint uVar5; uint uVar6; void *pvVar7; int iVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02290; local_10 = ExceptionList; ExceptionList = &local_10; iVar8 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0xc; if (iVar2 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar6 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar6 >> 1) < uVar6) { uVar5 = 0x15555555; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar5 = iVar2 + 1U; if (iVar2 + 1U <= uVar6) { uVar5 = uVar6; } if (0x15555555 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = _Allocate(uVar5 * 0xc); local_8 = 0; pvVar1 = (void *)((int)pvVar3 + ((param_1 - iVar8) / 0xc) * 0xc); FUN_008350d0(param_2); iVar8 = *in_ECX; pvVar4 = pvVar3; if (param_1 != in_ECX[1]) { FUN_008354f0(pvVar3,iVar8); pvVar4 = (void *)((int)pvVar1 + 0xc); } FUN_008354f0(pvVar4,iVar8); pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { pvVar7 = (void *)in_ECX[1]; if (pvVar4 != pvVar7) { do { _Tidy(); pvVar4 = (void *)((int)pvVar4 + 0xc); } while (pvVar4 != pvVar7); pvVar4 = (void *)*in_ECX; } uVar6 = ((in_ECX[2] - (int)pvVar4) / 0xc) * 0xc; pvVar7 = pvVar4; if (0xfff < uVar6) { pvVar7 = *(void **)((int)pvVar4 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar6); } *in_ECX = (int)pvVar3; in_ECX[1] = (int)((int)pvVar3 + (iVar2 * 3 + 3) * 4); in_ECX[2] = (int)(uVar5 * 0xc + (int)pvVar3); ExceptionList = local_10; return pvVar1; } //@@ 00834f6f Catch_All@00834f6f void Catch_All_00834f6f(void) { int unaff_EBP; FUN_00709090(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x24)); deallocate(*(void **)(unaff_EBP + -0x18),*(uint *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00834fa0 FUN_00834fa0 void FUN_00834fa0(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0xc; in_ECX[2] = param_1 + param_3 * 0xc; return; } //@@ 00835020 FUN_00835020 uint FUN_00835020(uint param_1) { uint uVar1; int *in_ECX; uVar1 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar1 >> 1) < uVar1) { return 0x15555555; } uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } return uVar1; } //@@ 00835070 FUN_00835070 void FUN_00835070(undefined8 *param_1,undefined8 *param_2,int param_3) { if (param_1 != param_2) { param_3 = param_3 - (int)param_1; do { *(undefined8 *)(param_3 + (int)param_1) = *param_1; *(undefined4 *)(param_3 + 8 + (int)param_1) = *(undefined4 *)(param_1 + 1); param_1 = (undefined8 *)((int)param_1 + 0xc); } while (param_1 != param_2); } return; } //@@ 008350a0 FUN_008350a0 void FUN_008350a0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3) { for (; param_1 != param_2; param_1 = (undefined8 *)((int)param_1 + 0xc)) { *param_3 = *param_1; *(undefined4 *)(param_3 + 1) = *(undefined4 *)(param_1 + 1); param_3 = (undefined8 *)((int)param_3 + 0xc); } return; } //@@ 008350d0 FUN_008350d0 void FUN_008350d0(undefined4 *param_1) { undefined8 *puVar1; undefined8 *puVar2; undefined8 *puVar3; undefined4 *in_ECX; undefined8 *puVar4; uint uVar5; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; puVar4 = (undefined8 *)*param_1; puVar2 = (undefined8 *)param_1[1]; if (puVar4 != puVar2) { uVar5 = ((int)puVar2 - (int)puVar4) / 0xc; if (0x15555555 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar5 = uVar5 * 0xc; puVar3 = std::_Allocate(uVar5); *in_ECX = puVar3; in_ECX[1] = puVar3; in_ECX[2] = uVar5 + (int)puVar3; do { *puVar3 = *puVar4; puVar1 = puVar4 + 1; puVar4 = (undefined8 *)((int)puVar4 + 0xc); *(undefined4 *)(puVar3 + 1) = *(undefined4 *)puVar1; puVar3 = (undefined8 *)((int)puVar3 + 0xc); } while (puVar4 != puVar2); in_ECX[1] = puVar3; } return; } //@@ 00835160 std::vector<12byte>::insert_range /* DB: insert(where, first, last) with /0xc and max 0x15555555, reallocates via FUN_00835020/_Allocate when short of capacity; caller Ambush::SpawnBossrushWave */ void std::vector<12byte>::insert_range(void *param_1,int param_2,int param_3) { int iVar1; void *pvVar2; uint uVar3; int iVar4; uint uVar5; void *pvVar6; int iVar7; int *in_ECX; size_t _Size; iVar7 = *in_ECX; uVar3 = (param_3 - param_2) / 0xc; pvVar2 = (void *)in_ECX[1]; if (uVar3 != 0) { if ((uint)((in_ECX[2] - (int)pvVar2) / 0xc) < uVar3) { iVar1 = ((int)pvVar2 - iVar7) / 0xc; if (0x15555555U - iVar1 < uVar3) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar1 = iVar1 + uVar3; uVar5 = FUN_00835020(iVar1); if (0x15555555 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar6 = _Allocate(uVar5 * 0xc); iVar4 = ((int)param_1 - iVar7) / 0xc; FUN_008350a0(param_2,param_3,(void *)((int)pvVar6 + iVar4 * 0xc)); if ((uVar3 == 1) && (param_1 == pvVar2)) { FUN_00835070(iVar7,pvVar2,pvVar6); } else { FUN_008350a0(iVar7,param_1,pvVar6); FUN_008350a0(param_1,pvVar2,(void *)((int)pvVar6 + (iVar4 + uVar3) * 0xc)); } FUN_00834fa0(pvVar6,iVar1,uVar5); return; } if (uVar3 < (uint)(((int)pvVar2 - (int)param_1) / 0xc)) { pvVar6 = (void *)((int)pvVar2 + uVar3 * -0xc); iVar7 = FUN_008350a0(pvVar6,pvVar2,pvVar2); _Size = (int)pvVar6 - (int)param_1; in_ECX[1] = iVar7; memmove((void *)((int)pvVar2 - _Size),param_1,_Size); } else { iVar7 = FUN_008350a0(param_1,pvVar2,(void *)(uVar3 * 0xc + (int)param_1)); in_ECX[1] = iVar7; } FUN_008350a0(param_2,param_3,param_1); } return; } //@@ 00835300 std::vector>::assign /* DB: range assign of 12-byte elements that are themselves vectors (shrink path std::vector<12byte>::_Tidy on the tail, max 0x15555555); first call of Ambush::shuffle_waves (copies the wave list) */ void std::vector>::assign(int param_1,int param_2) { void *pvVar1; uint uVar2; uint uVar3; uint uVar4; int *in_ECX; void *pvVar5; int iVar6; void *pvVar7; uint uVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b022bd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar5 = (void *)*in_ECX; uVar2 = (param_2 - param_1) / 0xc; pvVar1 = (void *)in_ECX[1]; uVar4 = ((int)pvVar1 - (int)pvVar5) / 0xc; if (uVar2 <= uVar4) { FUN_00835580(pvVar5,uVar3); pvVar1 = (void *)in_ECX[1]; pvVar5 = (void *)((int)pvVar5 + uVar2 * 0xc); for (pvVar7 = pvVar5; pvVar7 != pvVar1; pvVar7 = (void *)((int)pvVar7 + 0xc)) { vector<12byte>::_Tidy(); } in_ECX[1] = (int)pvVar5; ExceptionList = local_10; return; } uVar8 = (in_ECX[2] - (int)pvVar5) / 0xc; if (uVar8 < uVar2) { if (0x15555555 < uVar2) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x15555555 - (uVar8 >> 1) < uVar8) { uVar8 = 0x15555555; } else { uVar8 = uVar8 + (uVar8 >> 1); if (uVar8 < uVar2) { uVar8 = uVar2; } } if (pvVar5 != (void *)0x0) { if (pvVar5 != pvVar1) { do { vector<12byte>::_Tidy(); pvVar5 = (void *)((int)pvVar5 + 0xc); } while (pvVar5 != pvVar1); pvVar5 = (void *)*in_ECX; } deallocate(pvVar5,(in_ECX[2] - (int)pvVar5) / 0xc); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x15555555 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar5 = _Allocate(uVar8 * 0xc); *in_ECX = (int)pvVar5; in_ECX[1] = (int)pvVar5; in_ECX[2] = (int)(uVar8 * 0xc + (int)pvVar5); uVar4 = 0; } param_1 = param_1 + uVar4 * 0xc; FUN_00835580(pvVar5,uVar3); iVar6 = in_ECX[1]; local_8 = 0; for (; param_1 != param_2; param_1 = param_1 + 0xc) { FUN_008350d0(param_1); iVar6 = iVar6 + 0xc; } in_ECX[1] = iVar6; ExceptionList = local_10; return; } //@@ 008354f0 FUN_008354f0 undefined4 * FUN_008354f0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 1; do { uVar2 = *puVar5; uVar3 = puVar5[1]; uVar4 = puVar5[-1]; puVar5[1] = 0; *puVar5 = 0; puVar5[-1] = 0; *(undefined4 *)((int)param_1 + (-0xc - (int)in_ECX) + (int)(puVar5 + 3)) = uVar2; puVar1 = puVar5 + 2; *puVar6 = uVar4; puVar6[2] = uVar3; puVar6 = puVar6 + 3; puVar5 = puVar5 + 3; } while (puVar1 != in_EDX); } return puVar6; } //@@ 00835550 FUN_00835550 void FUN_00835550(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; for (iVar2 = *in_ECX; iVar2 != iVar1; iVar2 = iVar2 + 0xc) { std::vector<12byte>::_Tidy(); } return; } //@@ 00835580 FUN_00835580 int * FUN_00835580(int *param_1) { void *_Src; int *in_ECX; size_t _Size; int *in_EDX; void *_Dst; if (in_ECX == in_EDX) { return param_1; } do { if (param_1 != in_ECX) { _Src = (void *)*in_ECX; _Size = in_ECX[1] - (int)_Src; _Dst = (void *)*param_1; if ((uint)((param_1[2] - (int)_Dst) / 0xc) < (uint)((int)_Size / 0xc)) { FUN_006a0dc0((int)_Size / 0xc); _Dst = (void *)*param_1; } memmove(_Dst,_Src,_Size); param_1[1] = _Size + (int)_Dst; } in_ECX = in_ECX + 3; param_1 = param_1 + 3; } while (in_ECX != in_EDX); return param_1; } //@@ 00835620 input_config_save_xml_node /* DB: ? from input_configs_save: allocates a rapidxml node (FUN_00416510(0x1c)) with "Name" attribute and "%s-%u" formatted values, appends children */ void input_config_save_xml_node(undefined4 param_1,int param_2,byte *param_3) { char cVar1; byte bVar2; char *pcVar3; byte *pbVar4; byte *pbVar5; undefined4 *puVar6; byte *pbVar7; undefined4 *in_ECX; char *pcVar9; char *pcVar8; byte *pbVar10; uint local_c; uint local_8; pcVar3 = (char *)*in_ECX; puVar6 = (undefined4 *)FUN_00416510(0x1c); pbVar4 = param_3; *puVar6 = 0; puVar6[1] = 0; puVar6[4] = 0; pcVar8 = "Name"; do { pcVar9 = pcVar8; pcVar8 = pcVar9 + 1; } while (*pcVar8 != '\0'); *puVar6 = &DAT_00b1b350; puVar6[2] = pcVar9 + -0xb1b34f; if (pcVar3 != (char *)0x0) { cVar1 = *pcVar3; pcVar8 = pcVar3; while (cVar1 != '\0') { pcVar8 = pcVar8 + 1; cVar1 = *pcVar8; } puVar6[1] = pcVar3; puVar6[3] = (int)pcVar8 - (int)pcVar3; } if (*(int *)(param_2 + 0x20) == 0) { puVar6[5] = 0; *(undefined4 **)(param_2 + 0x20) = puVar6; } else { puVar6[5] = *(undefined4 *)(param_2 + 0x24); *(undefined4 **)(*(int *)(param_2 + 0x24) + 0x18) = puVar6; } *(undefined4 **)(param_2 + 0x24) = puVar6; puVar6[4] = param_2; puVar6[6] = 0; local_8 = 0; do { local_c = 0; do { param_3 = operator_new_tracked(0x80); puVar6 = *(undefined4 **)(pbVar4 + 4); if (puVar6 == *(undefined4 **)(pbVar4 + 8)) { std::vector::_Emplace_reallocate(puVar6,¶m_3); } else { *puVar6 = param_3; *(int *)(pbVar4 + 4) = *(int *)(pbVar4 + 4) + 4; } pbVar7 = param_3; FUN_0084d740(); sprintf(pbVar7,(byte *)"%s-%u"); param_3 = operator_new_tracked(0x10); puVar6 = *(undefined4 **)(pbVar4 + 4); if (puVar6 == *(undefined4 **)(pbVar4 + 8)) { std::vector::_Emplace_reallocate(puVar6,¶m_3); } else { *puVar6 = param_3; *(int *)(pbVar4 + 4) = *(int *)(pbVar4 + 4) + 4; } pbVar5 = param_3; sprintf(param_3,s__d); puVar6 = (undefined4 *)FUN_00416510(0x1c); *puVar6 = 0; puVar6[1] = 0; puVar6[4] = 0; if (pbVar7 != (byte *)0x0) { bVar2 = *pbVar7; pbVar10 = pbVar7; while (bVar2 != 0) { pbVar10 = pbVar10 + 1; bVar2 = *pbVar10; } *puVar6 = pbVar7; puVar6[2] = (int)pbVar10 - (int)pbVar7; } if (pbVar5 != (byte *)0x0) { bVar2 = *pbVar5; pbVar7 = pbVar5; while (bVar2 != 0) { pbVar7 = pbVar7 + 1; bVar2 = *pbVar7; } puVar6[1] = pbVar5; puVar6[3] = (int)pbVar7 - (int)pbVar5; } if (*(int *)(param_2 + 0x20) == 0) { puVar6[5] = 0; *(undefined4 **)(param_2 + 0x20) = puVar6; } else { puVar6[5] = *(undefined4 *)(param_2 + 0x24); *(undefined4 **)(*(int *)(param_2 + 0x24) + 0x18) = puVar6; } local_c = local_c + 1; *(undefined4 **)(param_2 + 0x24) = puVar6; puVar6[4] = param_2; puVar6[6] = 0; } while (local_c < 2); local_8 = local_8 + 1; } while (local_8 < 0x20); return; } //@@ 00835820 input_config_load_xml_node /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from input_configs_load: walks a config node's attributes/children, "Keyboard" device, maps action names ("Unknown action (%s) found while loading button config", "Unknown action slot (%d)...", "ActionId is out of range") */ void input_config_load_xml_node(int param_1) { byte bVar1; undefined4 *puVar2; qword qVar3; void **ppvVar4; uint uVar5; byte *pbVar6; uint uVar7; char *pcVar8; int iVar9; int iVar10; int *in_ECX; byte *pbVar11; byte *pbVar12; qword *pqVar13; int *piVar14; uint uVar15; bool bVar16; uint local_48; int local_44 [4]; int local_34 [4]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; puStack_20 = (undefined1 *)(local_34 + 0xc); local_14 = 0xffffffff; puStack_18 = &LAB_00b022e0; uVar5 = __security_cookie ^ (uint)(local_34 + 9); puVar2 = *(undefined4 **)(param_1 + 0x20); local_24 = uVar5; ppvVar4 = &local_1c; local_1c = ExceptionList; do { ExceptionList = ppvVar4; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_1c; return; } pbVar12 = (byte *)*puVar2; pbVar11 = &DAT_00b1b350; pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } do { bVar1 = *pbVar6; bVar16 = bVar1 < *pbVar11; if (bVar1 != *pbVar11) { LAB_008358a3: uVar7 = -(uint)bVar16 | 1; goto LAB_008358a8; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar16 = bVar1 < pbVar11[1]; if (bVar1 != pbVar11[1]) goto LAB_008358a3; pbVar6 = pbVar6 + 2; pbVar11 = pbVar11 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_008358a8: if (uVar7 == 0) { iVar9 = *in_ECX; if (iVar9 != 0) { if (g_mainHeap == (void *)0x0) { pqVar13 = &g_allocatedBytesNoHeap; } else { pqVar13 = (qword *)((int)g_mainHeap + 0x30); } uVar7 = *(uint *)(iVar9 + -4); qVar3 = *pqVar13; *(uint *)pqVar13 = (uint)*pqVar13 - uVar7; *(uint *)((int)pqVar13 + 4) = *(uint *)((int)pqVar13 + 4) - (uint)((uint)qVar3 < uVar7); free((void *)(iVar9 + -4)); local_14 = 0xffffffff; } pbVar12 = &g_xmlNullStr; if ((byte *)puVar2[1] != (byte *)0x0) { pbVar12 = (byte *)puVar2[1]; } pbVar6 = pbVar12 + 1; do { bVar1 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar1 != 0); pcVar8 = tracked_alloc(0,(void *)0x0,ZEXT48(pbVar12 + (1 - (int)pbVar6))); *in_ECX = (int)pcVar8; pbVar12 = (byte *)puVar2[1]; if (pbVar12 == (byte *)0x0) { pbVar12 = &g_xmlNullStr; do { pbVar6 = pbVar12; pbVar12 = pbVar6 + 1; } while (*pbVar6 != 0); pbVar6 = pbVar6 + -0xc71640; pbVar12 = &g_xmlNullStr; } else { pbVar6 = pbVar12; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); pbVar6 = pbVar6 + -(int)(pbVar12 + 1); } strncpy(pcVar8,(char *)pbVar12,(size_t)(pbVar6 + 1)); pbVar12 = (byte *)*in_ECX; pcVar8 = "Keyboard"; do { bVar1 = *pbVar12; bVar16 = bVar1 < (byte)*pcVar8; if (bVar1 != *pcVar8) { LAB_00835990: uVar7 = -(uint)bVar16 | 1; goto LAB_00835995; } if (bVar1 == 0) break; bVar1 = pbVar12[1]; bVar16 = bVar1 < (byte)pcVar8[1]; if (bVar1 != pcVar8[1]) goto LAB_00835990; pbVar12 = pbVar12 + 2; pcVar8 = pcVar8 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_00835995: piVar14 = in_ECX + 1; uVar15 = 0; if (uVar7 == 0) { local_48 = 0; do { if ((uint)(DAT_00c799fc - DAT_00c799f8 >> 4) <= uVar15) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); } local_34[0] = *(int *)(local_48 + DAT_00c799f8); local_34[1] = *(undefined4 *)(local_48 + 4 + DAT_00c799f8); local_34[2] = *(undefined4 *)(local_48 + 8 + DAT_00c799f8); iVar9 = local_48 + 0xc; local_48 = local_48 + 0x10; local_34[3] = *(undefined4 *)(iVar9 + DAT_00c799f8); iVar9 = local_34[uVar15]; uVar15 = uVar15 + 1; *piVar14 = iVar9; piVar14[1] = iVar9; piVar14 = piVar14 + 2; } while (local_48 < 0x200); } else { local_48 = 0; do { if ((uint)(DAT_00c799ec - DAT_00c799e8 >> 4) <= uVar15) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); } local_44[0] = *(int *)(local_48 + DAT_00c799e8); local_44[1] = *(undefined4 *)(local_48 + 4 + DAT_00c799e8); local_44[2] = *(undefined4 *)(local_48 + 8 + DAT_00c799e8); iVar9 = local_48 + 0xc; local_48 = local_48 + 0x10; local_44[3] = *(undefined4 *)(iVar9 + DAT_00c799e8); iVar9 = local_44[uVar15]; uVar15 = uVar15 + 1; *piVar14 = iVar9; piVar14[1] = iVar9; piVar14 = piVar14 + 2; } while (local_48 < 0x200); } } else { pbVar6 = &g_xmlNullStr; if (pbVar12 != (byte *)0x0) { pbVar6 = pbVar12; } pcVar8 = strchr((char *)pbVar6,0x2d); if (pcVar8 != (char *)0x0) { *pcVar8 = '\0'; if ((byte)(*pbVar6 - 0x30) < 10) { uVar7 = atoi((char *)pbVar6); LAB_00835ab2: if (uVar7 != 0x20) { iVar9 = atoi(pcVar8 + 1); if (iVar9 < 2) { pbVar12 = &g_xmlNullStr; if ((byte *)puVar2[1] != (byte *)0x0) { pbVar12 = (byte *)puVar2[1]; } iVar10 = atoi((char *)pbVar12); in_ECX[iVar9 + uVar7 * 2 + 1] = iVar10; } else { KAGE_LogMessage(8,(byte *) "Unknown action slot (%d) found while loading button config\n"); } goto LAB_00835b5a; } } else { uVar7 = 0; do { pbVar11 = (byte *)FUN_0084d740(uVar5); pbVar12 = pbVar6; do { bVar1 = *pbVar12; bVar16 = bVar1 < *pbVar11; if (bVar1 != *pbVar11) { LAB_00835b00: uVar15 = -(uint)bVar16 | 1; goto LAB_00835b05; } if (bVar1 == 0) break; bVar1 = pbVar12[1]; bVar16 = bVar1 < pbVar11[1]; if (bVar1 != pbVar11[1]) goto LAB_00835b00; pbVar12 = pbVar12 + 2; pbVar11 = pbVar11 + 2; } while (bVar1 != 0); uVar15 = 0; LAB_00835b05: if (uVar15 == 0) goto LAB_00835ab2; uVar7 = uVar7 + 1; } while (uVar7 < 0x21); } KAGE_LogMessage(8,(byte *)"Unknown action (%s) found while loading button config\n"); } } LAB_00835b5a: if (puVar2[4] == 0) { ExceptionList = local_1c; return; } puVar2 = (undefined4 *)puVar2[6]; ppvVar4 = ExceptionList; } while( true ); } //@@ 00835ba0 FUN_00835ba0 void FUN_00835ba0(int param_1) { undefined4 *puVar1; undefined4 uVar2; char cVar3; uint uVar4; int iVar5; int iVar6; uint uVar7; int iVar8; uint uVar9; int local_24; int *local_20; int local_1c; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0231d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; InputManager::get_device(&PTR_vftable_00c57b18,&local_24,param_1); local_8 = 0; if (local_24 != 0) { uVar9 = 0; uVar7 = 0; iVar5 = local_1c + 4; iVar8 = local_24; local_18 = iVar5; do { iVar6 = *(int *)(iVar8 + 0x10); if ((uint)(*(int *)(iVar8 + 0x14) - iVar6 >> 4) <= uVar9) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar6 = *(int *)(iVar8 + 0x10); iVar5 = local_18; iVar8 = local_24; } puVar1 = (undefined4 *)(uVar7 + iVar6); uVar2 = *(undefined4 *)(uVar7 + 4 + iVar6); uVar7 = uVar7 + 0x10; *(undefined4 *)(iVar5 + uVar9 * 8) = *puVar1; *(undefined4 *)(local_1c + 8 + uVar9 * 8) = uVar2; uVar9 = uVar9 + 1; } while (uVar7 < 0x200); } local_8 = 1; if (local_20 != (int *)0x0) { cVar3 = (**(code **)(*local_20 + 0xc))(uVar4); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_24); } } ExceptionList = local_10; return; } //@@ 00835c90 KeyConfigs::apply_to_device /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (deviceId), ECX=saved key-config list (name + 0x20 action x 2 bindings): skips NetInputDevice, matches the device name (vtable +0xc) and copies its bindings into the device action table ("ActionId is out of range"), else adds a new entry (008367e0); Manager::Init per device and 0095b290 */ void KeyConfigs::apply_to_device(int param_1) { byte bVar1; undefined4 uVar2; int iVar3; char cVar4; uint uVar5; int iVar6; byte *pbVar7; char *pcVar8; char *pcVar9; char *pcVar10; undefined4 *in_ECX; undefined4 *puVar11; char **ppcVar12; byte *pbVar13; bool bVar14; uint local_130; int local_12c; int *local_128; int *local_124; int *local_120; uint local_11c; char *local_118 [65]; uint local_14; void *local_10; undefined1 *puStack_c; char *local_8; local_8 = (char *)0xffffffff; puStack_c = &LAB_00b0235b; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_118 + 0x45); ExceptionList = &local_10; local_14 = uVar5; InputManager::get_device(&PTR_vftable_00c57b18,&local_124,param_1); local_8 = (char *)0x0; if (local_124 != (int *)0x0) { iVar6 = __RTDynamicCast(local_124,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0,uVar5); if (iVar6 == 0) { puVar11 = (undefined4 *)*in_ECX; if (puVar11 != (undefined4 *)in_ECX[1]) { do { pbVar13 = (byte *)*puVar11; pbVar7 = (byte *)(**(code **)(*local_124 + 0xc))(); do { bVar1 = *pbVar7; bVar14 = bVar1 < *pbVar13; if (bVar1 != *pbVar13) { LAB_00835d40: uVar5 = -(uint)bVar14 | 1; goto LAB_00835d45; } if (bVar1 == 0) break; bVar1 = pbVar7[1]; bVar14 = bVar1 < pbVar13[1]; if (bVar1 != pbVar13[1]) goto LAB_00835d40; pbVar7 = pbVar7 + 2; pbVar13 = pbVar13 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00835d45: if (uVar5 == 0) { InputManager::get_device(&PTR_vftable_00c57b18,&local_12c,param_1); local_8 = (char *)CONCAT31(local_8._1_3_,1); if (local_12c == 0) { local_8 = (char *)CONCAT31(local_8._1_3_,2); if (local_128 != (int *)0x0) { cVar4 = (**(code **)(*local_128 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_12c); } } } else { local_11c = 0; local_130 = 0; puVar11 = puVar11 + 1; do { uVar5 = 0; do { iVar3 = local_12c; uVar2 = *puVar11; iVar6 = *(int *)(local_12c + 0x10); if ((uint)(*(int *)(local_12c + 0x14) - iVar6 >> 4) <= local_11c) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar6 = *(int *)(iVar3 + 0x10); } puVar11 = puVar11 + 1; *(undefined4 *)(local_130 + iVar6 + uVar5) = uVar2; uVar5 = uVar5 + 4; } while (uVar5 < 8); local_11c = local_11c + 1; local_130 = local_130 + 0x10; } while (local_130 < 0x200); local_8 = (char *)CONCAT31(local_8._1_3_,3); if (local_128 != (int *)0x0) { cVar4 = (**(code **)(*local_128 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_12c); } } } goto LAB_00835f18; } puVar11 = puVar11 + 0x41; } while (puVar11 != (undefined4 *)in_ECX[1]); } ppcVar12 = local_118; for (iVar6 = 0x40; ppcVar12 = ppcVar12 + 1, iVar6 != 0; iVar6 = iVar6 + -1) { *ppcVar12 = (char *)0xffffffff; } pcVar8 = (char *)(**(code **)(*local_124 + 0xc))(); pcVar10 = pcVar8 + 1; do { cVar4 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar4 != '\0'); pcVar8 = operator_new_tracked((uint)(pcVar8 + (1 - (int)pcVar10))); local_118[0] = pcVar8; pcVar9 = (char *)(**(code **)(*local_124 + 0xc))(); pcVar10 = pcVar9 + 1; do { cVar4 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar4 != '\0'); pcVar9 = pcVar9 + (1 - (int)pcVar10); pcVar10 = (char *)(**(code **)(*local_124 + 0xc))(); strncpy(pcVar8,pcVar10,(size_t)pcVar9); FUN_00835ba0(param_1); puVar11 = (undefined4 *)in_ECX[1]; if (puVar11 == (undefined4 *)in_ECX[2]) { FUN_008367e0(puVar11,local_118); } else { ppcVar12 = local_118; for (iVar6 = 0x41; iVar6 != 0; iVar6 = iVar6 + -1) { *puVar11 = *ppcVar12; ppcVar12 = ppcVar12 + 1; puVar11 = puVar11 + 1; } in_ECX[1] = in_ECX[1] + 0x104; } } } LAB_00835f18: local_8 = (char *)0x4; if (local_120 != (int *)0x0) { cVar4 = (**(code **)(*local_120 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_124); } } ExceptionList = local_10; return; } //@@ 00835f70 input_configs_load /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? opens "%s/inputconfigs.dat" (g_userDataDir) via SaveDataManager::open_file_read, rapidxml parse, "KeyConfigs" node, game names "Binding of Isaac Repentance+"/"Afterbirth+"; called once from Manager::Init */ void input_configs_load(void) { qword qVar1; uint uVar2; int *piVar3; byte *pbVar4; byte *******pppppppbVar5; int iVar6; void *pvVar7; byte bVar8; int in_ECX; byte *pbVar9; int iVar10; byte *******pppppppbVar11; qword *pqVar12; uint uVar13; undefined4 *puVar14; byte *******pppppppbVar15; undefined4 *puVar16; bool bVar17; undefined1 auStack_1058c [48]; undefined1 auStack_1055c [65556]; undefined4 local_548 [65]; byte *local_444; undefined4 local_434; undefined4 local_430; byte *******local_42c [4]; int *local_41c; uint local_418; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b023b6; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; local_14 = uVar2; sprintf(local_414,(byte *)"%s/inputconfigs.dat"); piVar3 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,local_414); if (piVar3 == (int *)0x0) { pbVar9 = local_414; local_41c = piVar3; local_418 = 0xf; local_42c[0] = (byte *******)0x0; do { bVar8 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar8 != 0); std::string::assign((char *)local_42c,local_414,(int)pbVar9 - (int)(local_414 + 1)); local_8 = 0; pbVar9 = std::_Allocate(0x20); local_434 = 0x1c; local_430 = 0x1f; local_444 = pbVar9; pbVar9[0] = 'B'; pbVar9[1] = 'i'; pbVar9[2] = 'n'; pbVar9[3] = 'd'; pbVar9[4] = 'i'; pbVar9[5] = 'n'; pbVar9[6] = 'g'; pbVar9[7] = ' '; pbVar9[8] = 'o'; pbVar9[9] = 'f'; pbVar9[10] = ' '; pbVar9[0xb] = 'I'; pbVar9[0xc] = 's'; pbVar9[0xd] = 'a'; pbVar9[0xe] = 'a'; pbVar9[0xf] = 'c'; pbVar9[0x10] = 0x20; pbVar9[0x11] = 0x52; pbVar9[0x12] = 0x65; pbVar9[0x13] = 0x70; pbVar9[0x14] = 0x65; pbVar9[0x15] = 0x6e; pbVar9[0x16] = 0x74; pbVar9[0x17] = 0x61; pbVar9[0x18] = 'n'; pbVar9[0x19] = 'c'; pbVar9[0x1a] = 'e'; pbVar9[0x1b] = '+'; pbVar9[0x1c] = 0; local_8 = CONCAT31(local_8._1_3_,1); pppppppbVar5 = (byte *******)local_42c; if (0xf < local_418) { pppppppbVar5 = local_42c[0]; } if ((int *)0x1b < local_41c) { piVar3 = (int *)0xffffffff; if (local_41c + -7 != (int *)0xffffffff) { piVar3 = local_41c + -7; } pppppppbVar15 = (byte *******)((int)piVar3 + (int)pppppppbVar5); do { if (*(byte *)pppppppbVar15 == *pbVar9) { uVar13 = 0x18; pbVar4 = pbVar9; pppppppbVar11 = pppppppbVar15; do { if (*pppppppbVar11 != *(byte *******)pbVar4) { bVar8 = (byte)*pppppppbVar11; bVar17 = bVar8 < *pbVar4; if ((((bVar8 == *pbVar4) && (bVar17 = *(byte *)((int)pppppppbVar11 + 1) < pbVar4[1], *(byte *)((int)pppppppbVar11 + 1) == pbVar4[1])) && (bVar17 = *(byte *)((int)pppppppbVar11 + 2) < pbVar4[2], *(byte *)((int)pppppppbVar11 + 2) == pbVar4[2])) && (bVar17 = *(byte *)((int)pppppppbVar11 + 3) < pbVar4[3], *(byte *)((int)pppppppbVar11 + 3) == pbVar4[3])) { uVar13 = 0; } else { uVar13 = -(uint)bVar17 | 1; } goto LAB_008360fc; } pppppppbVar11 = pppppppbVar11 + 1; pbVar4 = pbVar4 + 4; bVar17 = 3 < uVar13; uVar13 = uVar13 - 4; } while (bVar17); uVar13 = 0; LAB_008360fc: if (uVar13 == 0) { if ((int)pppppppbVar15 - (int)pppppppbVar5 != 0xffffffff) { std::string::replace ((char *)local_42c,(int)pppppppbVar15 - (int)pppppppbVar5,0x1c, (byte *)"Binding of Isaac Afterbirth+",0x1c); } break; } } if (pppppppbVar15 == pppppppbVar5) break; pppppppbVar15 = (byte *******)((int)pppppppbVar15 + -1); } while( true ); } pppppppbVar5 = (byte *******)local_42c; if (0xf < local_418) { pppppppbVar5 = local_42c[0]; } piVar3 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)pppppppbVar5); operator_delete(pbVar9,0x20); if (piVar3 == (int *)0x0) { if (local_418 < 0x10) { ExceptionList = local_10; return; } uVar2 = local_418 + 1; pppppppbVar5 = local_42c[0]; if (0xfff < uVar2) { pppppppbVar5 = (byte *******)local_42c[0][-1]; uVar2 = local_418 + 0x24; if ((byte *)0x1f < (byte *)((int)local_42c[0] + (-4 - (int)pppppppbVar5))) { LAB_008361e0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar5,uVar2); ExceptionList = local_10; return; } local_8 = 0xffffffff; if (0xf < local_418) { uVar13 = local_418 + 1; pppppppbVar5 = local_42c[0]; if (0xfff < uVar13) { pppppppbVar5 = (byte *******)local_42c[0][-1]; uVar13 = local_418 + 0x24; if ((byte *)0x1f < (byte *)((int)local_42c[0] + (-4 - (int)pppppppbVar5))) goto LAB_008361e0; } operator_delete(pppppppbVar5,uVar13); } local_41c = (int *)0x0; local_418 = 0xf; local_42c[0] = (byte *******)((uint)local_42c[0] & 0xffffff00); } iVar6 = (**(code **)(*piVar3 + 4))(uVar2); pbVar4 = operator_new_tracked(iVar6 + 1); (**(code **)(*piVar3 + 0x14))(pbVar4,1,iVar6); pbVar4[iVar6] = 0; (**(code **)*piVar3)(1); FUN_00413b90(); local_8 = 2; iVar6 = 0x836269; pbVar9 = pbVar4; rapidxml::xml_document::parse(auStack_1058c,pbVar4); pvVar7 = xml_node::first_node(auStack_1058c,(byte *)"KeyConfigs",iVar6,(byte)pbVar9); if (pvVar7 != (void *)0x0) { for (iVar6 = *(int *)((int)pvVar7 + 0x18); iVar6 != 0; iVar6 = *(int *)(iVar6 + 0x2c)) { local_548[0] = 0; puVar16 = local_548; for (iVar10 = 0x40; puVar16 = puVar16 + 1, iVar10 != 0; iVar10 = iVar10 + -1) { *puVar16 = 0xffffffff; } input_config_load_xml_node(iVar6); puVar16 = *(undefined4 **)(in_ECX + 4); if (puVar16 == *(undefined4 **)(in_ECX + 8)) { FUN_008367e0(puVar16,local_548); } else { puVar14 = local_548; for (iVar10 = 0x41; iVar10 != 0; iVar10 = iVar10 + -1) { *puVar16 = *puVar14; puVar14 = puVar14 + 1; puVar16 = puVar16 + 1; } *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x104; } } } local_8 = 3; xml_memory_pool::clear(auStack_1055c); if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } if (pbVar4 != (byte *)0x0) { uVar2 = *(uint *)(pbVar4 + -4); qVar1 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar2; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar1 < uVar2); free(pbVar4 + -4); } ExceptionList = local_10; return; } //@@ 00836370 input_configs_save /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? writes "%s/inputconfigs.dat" via SaveDataManager::open_file_write, rapidxml "KeyConfigs"/"Controller" nodes; counterpart of input_configs_load 00835f70; called from Manager::apply_device_key_config (DB note: "else defaults (FUN_00836370)") */ void input_configs_save(void) { qword qVar1; uint uVar2; int *piVar3; undefined4 *puVar4; char *pcVar6; char *pcVar5; undefined4 *puVar7; byte *out; int *in_ECX; qword *pqVar8; int iVar9; undefined4 *puVar10; undefined4 *puStack_10470; undefined4 *puStack_1046c; int iStack_10468; int iStack_10464; byte *pbStack_10460; undefined1 auStack_1045c [24]; undefined4 *puStack_10444; undefined4 *puStack_10440; undefined1 auStack_1042c [65560]; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b023fb; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; pbStack_10460 = (byte *)in_ECX; local_14 = uVar2; sprintf(local_414,(byte *)"%s/inputconfigs.dat"); piVar3 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_414,0); if (piVar3 != (int *)0x0) { FUN_00413b90(uVar2); puStack_10470 = (undefined4 *)0x0; puStack_1046c = (undefined4 *)0x0; iStack_10464 = 0; iStack_10468 = 0; local_8 = 1; puVar4 = (undefined4 *)FUN_00416510(0x30); *puVar4 = 0; puVar4[1] = 0; puVar4[4] = 0; puVar4[5] = 1; puVar4[6] = 0; puVar4[8] = 0; pcVar5 = "KeyConfigs"; do { pcVar6 = pcVar5; pcVar5 = pcVar6 + 1; } while (*pcVar5 != '\0'); *puVar4 = "KeyConfigs"; puVar4[2] = pcVar6 + -0xb6d05b; iVar9 = *in_ECX; puVar7 = (undefined4 *)0x0; if (iVar9 != *(int *)((int)pbStack_10460 + 4)) { do { puVar7 = (undefined4 *)FUN_00416510(0x30); *puVar7 = 0; puVar7[1] = 0; puVar7[4] = 0; puVar7[5] = 1; puVar7[6] = 0; puVar7[8] = 0; pcVar5 = "Controller"; do { pcVar6 = pcVar5; pcVar5 = pcVar6 + 1; } while (*pcVar5 != '\0'); *puVar7 = "Controller"; puVar7[2] = pcVar6 + -0xb6d04f; input_config_save_xml_node(auStack_1045c,puVar7,&puStack_10470); if (puVar4[6] == 0) { puVar7[10] = 0; puVar4[6] = puVar7; } else { puVar7[10] = puVar4[7]; *(undefined4 **)(puVar4[7] + 0x2c) = puVar7; } iVar9 = iVar9 + 0x104; puVar4[7] = puVar7; puVar7[4] = puVar4; puVar7[0xb] = 0; } while (iVar9 != *(int *)((int)pbStack_10460 + 4)); iStack_10464 = iStack_10468; puVar7 = puStack_10470; } if (puStack_10444 == (undefined4 *)0x0) { puVar4[10] = 0; puStack_10444 = puVar4; } else { puVar4[10] = puStack_10440; *(undefined4 **)((int)puStack_10440 + 0x2c) = puVar4; } puVar4[4] = auStack_1045c; puVar4[0xb] = 0; puStack_10440 = puVar4; out = operator_new_tracked(0x10000); pbStack_10460 = rapidxml::internal::print_node(out,auStack_1045c,0,0); puVar4 = puStack_1046c; *pbStack_10460 = 0; puVar10 = puVar7; if (puVar7 != puStack_1046c) { do { operator_delete((void *)*puVar10,1); puVar10 = puVar10 + 1; } while (puVar10 != puVar4); } (**(code **)(*piVar3 + 0x1c))(out,1,(int)pbStack_10460 - (int)out); (**(code **)*piVar3)(1); if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } if (out != (byte *)0x0) { uVar2 = *(uint *)(out + -4); qVar1 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar2; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar1 < uVar2); free(out + -4); } local_8 = local_8 & 0xffffff00; if (puVar7 != (undefined4 *)0x0) { uVar2 = (iStack_10464 - (int)puVar7 >> 2) * 4; puVar4 = puVar7; if (0xfff < uVar2) { puVar4 = (undefined4 *)puVar7[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)puVar7 + (-4 - (int)puVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar4,uVar2); } local_8 = 3; xml_memory_pool::clear(auStack_1042c); } ExceptionList = local_10; return; } //@@ 00836690 std::vector<260byte>::~vector /* DB: ? frees the KAGE-heap buffer at +0 of each 0x104-byte element (g_mainHeap accounting + free) then the storage via 00836770; called from Manager::destructor */ void std::vector<260byte>::~vector(void) { int iVar1; uint uVar2; qword qVar3; uint uVar4; qword *pqVar5; int *in_ECX; int iVar6; int iVar7; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b02430; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar6 = *in_ECX; local_14 = 0; iVar7 = in_ECX[1] - iVar6 >> 0x1f; if ((in_ECX[1] - iVar6) / 0x104 + iVar7 != iVar7) { iVar7 = 0; do { iVar1 = *(int *)(iVar7 + iVar6); if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); *(undefined4 *)(iVar7 + iVar6) = 0; } iVar6 = *in_ECX; local_14 = local_14 + 1; iVar7 = iVar7 + 0x104; } while (local_14 < (uint)((in_ECX[1] - iVar6) / 0x104)); } FUN_00836770(uVar4); ExceptionList = local_10; return; } //@@ 00836770 FUN_00836770 void FUN_00836770(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 0x104) * 0x104; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008367e0 FUN_008367e0 undefined4 * FUN_008367e0(undefined4 *param_1,undefined4 *param_2) { uint uVar1; void *pvVar2; int iVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; int *in_ECX; uint uVar9; int iVar10; uint uVar11; undefined4 *puVar12; undefined4 *puVar13; void *ptr; undefined4 *puVar14; undefined4 *puVar15; iVar10 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x104; if (iVar3 == 0xfc0fc0) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar11 = (in_ECX[2] - *in_ECX) / 0x104; if (0xfc0fc0 - (uVar11 >> 1) < uVar11) { uVar9 = 0xfc0fc0; } else { uVar11 = (uVar11 >> 1) + uVar11; uVar9 = uVar1; if (uVar1 <= uVar11) { uVar9 = uVar11; } if (0xfc0fc0 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = std::_Allocate(uVar9 * 0x104); puVar7 = puVar6 + (((int)param_1 - iVar10) / 0x104) * 0x41; puVar14 = puVar7; for (iVar10 = 0x41; iVar10 != 0; iVar10 = iVar10 + -1) { *puVar14 = *param_2; param_2 = param_2 + 1; puVar14 = puVar14 + 1; } puVar14 = (undefined4 *)in_ECX[1]; puVar4 = (undefined4 *)*in_ECX; puVar5 = puVar6; if (param_1 == puVar14) { while (puVar4 != puVar14) { puVar8 = puVar4 + 0x41; puVar12 = puVar5 + 0x41; iVar10 = 0x41; puVar13 = puVar4; puVar15 = puVar5; while( true ) { puVar4 = puVar8; puVar5 = puVar12; if (iVar10 == 0) break; *puVar15 = *puVar13; iVar10 = iVar10 + -1; puVar13 = puVar13 + 1; puVar15 = puVar15 + 1; } } } else { FUN_00836a50((undefined4 *)*in_ECX,param_1,puVar6); FUN_00836a50(param_1,in_ECX[1],puVar7 + 0x41); } pvVar2 = (void *)*in_ECX; if (pvVar2 != (void *)0x0) { uVar11 = ((in_ECX[2] - (int)pvVar2) / 0x104) * 0x104; ptr = pvVar2; if (0xfff < uVar11) { ptr = *(void **)((int)pvVar2 + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar11); } *in_ECX = (int)puVar6; in_ECX[1] = (int)(puVar6 + uVar1 * 0x41); in_ECX[2] = (int)(puVar6 + uVar9 * 0x41); return puVar7; } //@@ 00836980 FUN_00836980 uint FUN_00836980(undefined4 param_1,byte *param_2,uint param_3) { uint uVar1; byte *pbVar2; byte *pbVar3; uint uVar4; byte *in_ECX; uint in_EDX; int iVar6; byte *pbVar5; bool bVar7; if (param_3 == 0) { uVar4 = 0xffffffff; if (in_EDX != 0xffffffff) { uVar4 = in_EDX; } return uVar4; } if (in_EDX < param_3) { return 0xffffffff; } iVar6 = -1; if (in_EDX - param_3 != -1) { iVar6 = in_EDX - param_3; } pbVar5 = in_ECX + iVar6; do { pbVar2 = pbVar5; pbVar3 = param_2; uVar4 = param_3; if (*pbVar5 == *param_2) { while (uVar1 = uVar4 - 4, 3 < uVar4) { if (*(int *)pbVar2 != *(int *)pbVar3) goto LAB_008369e6; pbVar2 = pbVar2 + 4; pbVar3 = pbVar3 + 4; uVar4 = uVar1; } if (uVar1 == 0xfffffffc) { LAB_00836a1a: uVar4 = 0; } else { LAB_008369e6: bVar7 = *pbVar2 < *pbVar3; if ((*pbVar2 == *pbVar3) && ((uVar1 == 0xfffffffd || ((bVar7 = pbVar2[1] < pbVar3[1], pbVar2[1] == pbVar3[1] && ((uVar1 == 0xfffffffe || ((bVar7 = pbVar2[2] < pbVar3[2], pbVar2[2] == pbVar3[2] && ((uVar1 == 0xffffffff || (bVar7 = pbVar2[3] < pbVar3[3], pbVar2[3] == pbVar3[3])))))) )))))) goto LAB_00836a1a; uVar4 = -(uint)bVar7 | 1; } if (uVar4 == 0) { return (int)pbVar5 - (int)in_ECX; } } if (pbVar5 == in_ECX) { return 0xffffffff; } pbVar5 = pbVar5 + -1; } while( true ); } //@@ 00836a50 FUN_00836a50 void FUN_00836a50(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; undefined4 *puVar4; undefined4 *puVar5; while (param_1 != param_2) { puVar3 = param_1 + 0x41; puVar1 = param_3 + 0x41; puVar4 = param_1; puVar5 = param_3; for (iVar2 = 0x41; param_1 = puVar3, param_3 = puVar1, iVar2 != 0; iVar2 = iVar2 + -1) { *puVar5 = *puVar4; puVar4 = puVar4 + 1; puVar5 = puVar5 + 1; } } return; } //@@ 00836a90 rapidxml::internal::print_node /* DB: rapidxml print: switch on node type (EDX+0x14): 0 document -> print_children, 1 element, 2 data, 3 cdata writes "': builtin_strncpy(param_2,">",4); param_2 = param_2 + 3; } } in_ECX = in_ECX + 1; param_2 = param_2 + 1; } while( true ); } //@@ 00837010 FUN_00837010 void FUN_00837010(size_t param_1) { malloc(param_1); return; } //@@ 00837030 FUN_00837030 void FUN_00837030(void *param_1) { free(param_1); return; } //@@ 00837050 FUN_00837050 undefined * FUN_00837050(void) { return &DAT_00c7f488; } //@@ 00837060 FUN_00837060 void FUN_00837060(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_00837050(); __stdio_common_vsscanf(*puVar1,puVar1[1]); return; } //@@ 00837090 FUN_00837090 void FUN_00837090(void) { FUN_00837060(); return; } //@@ 008370b0 FUN_008370b0 void FUN_008370b0(void) { float in_XMM0_Da; floor((double)in_XMM0_Da); return; } //@@ 008370f0 FUN_008370f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008370f0(void) { ANM2 *in_ECX; undefined1 ptr [4]; uint size; undefined1 local_3c [4]; KColor local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00af84fd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; local_38._alpha = 0.0; local_38._unk = 0xf; local_3c[0] = '\0'; local_3c[1] = '\0'; local_3c[2] = '\0'; local_3c[3] = '\0'; local_3c = (undefined1 [4])std::_Allocate(0x20); local_38._alpha = 3.36312e-44; local_38._unk = 0x1f; builtin_strncpy((char *)local_3c,"gfx/ui/GenericPopup.anm2",0x19); local_14 = 0; ANM2::Load(in_ECX,(std_string *)local_3c,1); if (0xf < (uint)local_38._unk) { size = local_38._unk + 1; ptr = local_3c; if (0xfff < size) { ptr = *(undefined1 (*) [4])((int)local_3c + -4); size = local_38._unk + 0x24; if ((char *)0x1f < (char *)((int)local_3c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,size); } KColor::SetFromARGB(&local_38,0xff362f2d); *(float *)in_ECX[1]._filename._buf = local_38._red; *(float *)(in_ECX[1]._filename._buf + 4) = local_38._green; *(float *)(in_ECX[1]._filename._buf + 8) = local_38._blue; *(float *)(in_ECX[1]._filename._buf + 0xc) = local_38._alpha; in_ECX[1]._filename._size = local_38._unk; ExceptionList = local_1c; return; } //@@ 00837210 ANM2::update_appear_then_idle /* DB: ? ECX ANM2: Update both anim states, when "Appear" finishes plays Idle; NetplayManager::Update, LobbyPasswordPrompt::Update prototype: db/protos.zhl */ void __thiscall ANM2::update_appear_then_idle(ANM2 *this) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; char *pcVar5; byte *pbVar6; bool bVar7; if (this->_loaded != 0) { AnimationState::Update(&this->_animState); AnimationState::Update(&this->_overlayAnimState); } pbVar1 = (this->_animState)._animData; if ((pbVar1 != (byte *)0x0) && ((this->_animState)._isPlaying == 0)) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Appear"; do { bVar2 = *pbVar3; bVar7 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_00837272: uVar4 = -(uint)bVar7 | 1; goto LAB_00837277; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_00837272; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00837277: if (uVar4 == 0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar6 = s_Idle; do { bVar2 = *pbVar3; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_008372b0: uVar4 = -(uint)bVar7 | 1; goto LAB_008372b5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_008372b0; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008372b5: if ((uVar4 != 0) || (pbVar1[0x34] != 0)) { bVar2 = SetAnimation(this,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&this->_animState); (this->_animState)._isPlaying = 1; } } } } return; } //@@ 008372e0 GenericPopup::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void GenericPopup::Render(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GenericPopup::Render(GenericPopup *this) { byte bVar1; GenericPopup GVar2; int iVar3; AnimationState *this_00; byte *pbVar4; int iVar5; GenericPopup *pGVar6; bool bVar7; float y; float fVar8; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; Font *local_24; float local_20; Vector local_1c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0245d; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((this[0xd] != (GenericPopup)0x0) && (*(char *)(this + 0x11) != '\0')) { local_24 = &g_manager->_font2_TeamMeatEx12; local_1c.x = (g_screenWidth - 480.0) * 0.5; local_1c.y = (g_screenHeight - 270.0) * 0.5; if (this[0x42].field_0x1 != '\0') { if (*(char *)(this + 0x1c) == '\0') { AnimationState::Render((AnimationState *)(this + 0xc),&local_1c,&g_vectorZero,&g_vectorZero) ; this_00 = (AnimationState *)(this + 0x14); } else { AnimationState::Render ((AnimationState *)(this + 0x14),&local_1c,&g_vectorZero,&g_vectorZero); this_00 = (AnimationState *)(this + 0xc); } AnimationState::Render(this_00,&local_1c,&g_vectorZero,&g_vectorZero); } GVar2 = this[0xd]; if ((GVar2 != (GenericPopup)0x0) && (*(char *)(this + 0x11) != '\0')) { if (0xf < *(uint *)((int)GVar2 + 0x14)) { GVar2 = *(GenericPopup *)GVar2; } pbVar4 = s_Idle; do { bVar1 = *(byte *)GVar2; bVar7 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_00837400: local_1c.x = (float)(-(uint)bVar7 | 1); goto LAB_00837405; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)GVar2 + 1); bVar7 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_00837400; GVar2 = (GenericPopup)((int)GVar2 + 2); pbVar4 = pbVar4 + 2; } while (bVar1 != 0); local_1c.x = 0.0; LAB_00837405: if (local_1c.x == 0.0) { local_20 = -32.0; pGVar6 = this + 0x4a; iVar5 = 0; local_1c.y = 18.0; do { fVar8 = 0.5; if (*pGVar6 != (GenericPopup)0x0) { local_40 = 0; local_3c = 0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_8 = 0; y = g_screenHeight * 0.5 + (&local_20)[iVar5]; iVar3 = Font::get_string_width_utf16(local_24,(short *)*pGVar6,-1); Font::draw_string_wide_unscaled (local_24,(short *)*pGVar6, g_screenWidth * fVar8 - (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * fVar8,y, (KColor *)(this + 0x45),&local_40); } iVar5 = iVar5 + 1; pGVar6 = pGVar6 + 1; } while (iVar5 < 3); } } } ExceptionList = local_10; return; } //@@ 00837510 FUN_00837510 void FUN_00837510(void) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; ANM2 *in_ECX; char *pcVar5; bool bVar6; pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Appear"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_00837550: uVar4 = -(uint)bVar6 | 1; goto LAB_00837555; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_00837550; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00837555: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((in_ECX->_animState)._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(in_ECX,(byte *)"Appear",1); if (bVar2 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } return; } //@@ 00837590 FUN_00837590 void FUN_00837590(void) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; ANM2 *in_ECX; char *pcVar5; bool bVar6; pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Dissapear"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_008375d0: uVar4 = -(uint)bVar6 | 1; goto LAB_008375d5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_008375d0; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008375d5: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((in_ECX->_animState)._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(in_ECX,(byte *)"Dissapear",1); if (bVar2 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } return; } //@@ 00837610 FUN_00837610 uint FUN_00837610(void) { byte bVar1; byte *pbVar2; int in_ECX; byte *pbVar3; bool bVar4; pbVar2 = *(byte **)(in_ECX + 0x34); if ((pbVar2 != (byte *)0x0) && (*(char *)(in_ECX + 0x44) != '\0')) { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pbVar3 = s_Idle; do { bVar1 = *pbVar2; bVar4 = bVar1 < *pbVar3; if (bVar1 != *pbVar3) { LAB_00837650: pbVar2 = (byte *)(-(uint)bVar4 | 1); goto LAB_00837655; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar4 = bVar1 < pbVar3[1]; if (bVar1 != pbVar3[1]) goto LAB_00837650; pbVar2 = pbVar2 + 2; pbVar3 = pbVar3 + 2; } while (bVar1 != 0); pbVar2 = (byte *)0x0; LAB_00837655: if (pbVar2 == (byte *)0x0) { return 1; } } return (uint)pbVar2 & 0xffffff00; } //@@ 00837660 FUN_00837660 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00837660(uint param_1) { uint uVar1; uint uVar2; byte *text; qword qVar3; short *psVar4; LayerState *pLVar5; ANM2 *in_ECX; qword *pqVar6; uint *puVar7; int iVar8; uint local_20; byte *local_1c; byte *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02490; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar7 = &in_ECX[1]._filename._capacity; iVar8 = 0; local_20 = param_1; local_1c = &s_empty; local_18 = &s_empty; do { uVar1 = *puVar7; if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } if (uVar1 != 0) { uVar2 = *(uint *)(uVar1 - 4); qVar3 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar2; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(uVar1 - 4)); } local_8 = 0xffffffff; text = (byte *)(&local_20)[iVar8]; *puVar7 = 0; if (text != (byte *)0x0) { psVar4 = utf8_to_utf16_alloc(text); *puVar7 = (uint)psVar4; } iVar8 = iVar8 + 1; puVar7 = puVar7 + 1; } while (iVar8 < 3); pLVar5 = ANM2::GetLayer(in_ECX,(byte *)0x2); pLVar5->_visible = 0; ExceptionList = local_10; return; } //@@ 00837740 FUN_00837740 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00837740(void) { uint uVar1; qword qVar2; byte bVar3; void *pvVar4; byte ****ppppbVar5; LayerState *pLVar6; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte unk; ANM2 *in_ECX; byte ****a; uint uVar7; qword *pqVar8; uint *puVar9; byte ****ppppbVar10; byte ****ppppbVar11; uint uVar12; byte ****local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; byte ***local_8; puStack_c = &LAB_00b024cd; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; puVar9 = &in_ECX[1]._filename._capacity; uVar12 = 3; pvVar4 = g_mainHeap; do { local_8 = (byte ***)0xffffffff; uVar7 = *puVar9; pqVar8 = (qword *)((int)pvVar4 + 0x30); if (pvVar4 == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } if (uVar7 != 0) { uVar1 = *(uint *)(uVar7 - 4); qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar1; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar2 < uVar1); free((void *)(uVar7 - 4)); pvVar4 = g_mainHeap; } local_8 = (byte ***)0xffffffff; *puVar9 = 0; puVar9 = puVar9 + 1; uVar12 = uVar12 - 1; } while (uVar12 != 0); local_1c = 0xf; local_30[0] = (byte ****)0x0; local_20 = uVar12; std::string::assign((char *)local_30,(byte *)"gfx/ui/Popup_DailyRunConnectionFailure.png",0x2a); uVar12 = local_1c; ppppbVar10 = local_30[0]; local_8 = (byte ***)0x1; if (in_ECX->_layerCount < 3) { unk = extraout_CL; } else { pvVar4 = in_ECX->_layerState; ppppbVar11 = (byte ****)((int)pvVar4 + 0x148); ppppbVar5 = ppppbVar11; if (0xf < *(uint *)((int)pvVar4 + 0x15c)) { ppppbVar5 = (byte ****)*ppppbVar11; } a = (byte ****)local_30; if (0xf < local_1c) { a = local_30[0]; } bVar3 = str_eq((byte *)a,local_20,(byte *)ppppbVar5,*(uint *)((int)pvVar4 + 0x158)); unk = extraout_CL_00; if (bVar3 == 0) { if ((byte *****)ppppbVar11 == local_30) { *(undefined1 *)((int)pvVar4 + 0x170) = 0; } else { ppppbVar5 = (byte ****)local_30; if (0xf < uVar12) { ppppbVar5 = ppppbVar10; } std::string::assign((char *)ppppbVar11,(byte *)ppppbVar5,local_20); *(undefined1 *)((int)in_ECX->_layerState + 0x170) = 0; uVar12 = local_1c; ppppbVar10 = local_30[0]; unk = extraout_CL_01; } } } local_8 = (byte ***)0xffffffff; if (0xf < uVar12) { uVar7 = uVar12 + 1; ppppbVar11 = ppppbVar10; if (0xfff < uVar7) { ppppbVar11 = (byte ****)ppppbVar10[-1]; uVar7 = uVar12 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbVar10 + (-4 - (int)ppppbVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar11,uVar7); unk = extraout_CL_02; } ANM2::LoadGraphics(in_ECX,unk); pLVar6 = ANM2::GetLayer(in_ECX,(byte *)0x2); pLVar6->_visible = 1; ExceptionList = local_10; return; } //@@ 008378e0 GenericPrompt::Initialize /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void GenericPrompt::Initialize(bool SmallPrompt); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall GenericPrompt::Initialize(GenericPrompt *this,byte SmallPrompt) { char *ptr; uint size; std_string local_54; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b02515; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; if (SmallPrompt == 0) { local_54._size = 0; local_54._capacity = 0xf; local_54._buf[0] = '\0'; local_54._buf[1] = '\0'; local_54._buf[2] = '\0'; local_54._buf[3] = '\0'; local_54._buf._0_4_ = std::_Allocate(0x20); local_54._size = 0x18; local_54._capacity = 0x1f; builtin_strncpy((char *)local_54._buf._0_4_,"gfx/ui/Prompt_YesNo.anm2",0x19); local_14 = 1; ANM2::Load(&this->_sprite,&local_54,1); if (local_54._capacity < 0x10) goto LAB_00837a6d; size = local_54._capacity + 1; ptr = (char *)local_54._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_54._buf._0_4_ + -4); size = local_54._capacity + 0x24; if ((char *)0x1f < (char *)(local_54._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x1e; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/Prompt_YesNo_Small.anm2",0x1f); local_14 = 0; ANM2::Load(&this->_sprite,&local_3c,1); if (local_3c._capacity < 0x10) goto LAB_00837a6d; size = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } operator_delete(ptr,size); LAB_00837a6d: *(undefined4 *)&this->field_0x12c = 0; *(undefined4 *)&this->field_0x128 = 0; this->_isOnlineVote = 0; ExceptionList = local_1c; return; } //@@ 00837ab0 GenericPrompt::Update /* ZHL [exact] __thiscall void GenericPrompt::Update(bool processInput); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall GenericPrompt::Update(GenericPrompt *this,byte processInput) { byte *pbVar1; int iVar2; void *pvVar3; int layerId; byte bVar4; byte *pbVar5; uint uVar6; char *pcVar7; byte *pbVar8; bool bVar9; if (processInput != 0) { handle_input(); } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } pbVar1 = (this->_sprite)._animState._animData; if ((pbVar1 != (byte *)0x0) && ((this->_sprite)._animState._isPlaying == 0)) { pbVar5 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar5 = *(byte **)pbVar1; } pcVar7 = "Appear"; do { bVar4 = *pbVar5; bVar9 = bVar4 < (byte)*pcVar7; if (bVar4 != *pcVar7) { LAB_00837b22: uVar6 = -(uint)bVar9 | 1; goto LAB_00837b27; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar9 = bVar4 < (byte)pcVar7[1]; if (bVar4 != pcVar7[1]) goto LAB_00837b22; pbVar5 = pbVar5 + 2; pcVar7 = pcVar7 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00837b27: if (uVar6 == 0) { pbVar5 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar5 = *(byte **)pbVar1; } pbVar8 = s_Idle; do { bVar4 = *pbVar5; bVar9 = bVar4 < *pbVar8; if (bVar4 != *pbVar8) { LAB_00837b60: uVar6 = -(uint)bVar9 | 1; goto LAB_00837b65; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar9 = bVar4 < pbVar8[1]; if (bVar4 != pbVar8[1]) goto LAB_00837b60; pbVar5 = pbVar5 + 2; pbVar8 = pbVar8 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_00837b65: if (((uVar6 != 0) || (pbVar1[0x34] != 0)) && (bVar4 = ANM2::SetAnimation(&this->_sprite,s_Idle,1), bVar4 != 0)) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } iVar2 = *(int *)&this->field_0x128; if ((this->_sprite)._animState._animData != (void *)0x0) { if ((*(int *)((int)(this->_sprite)._animState._animation + 0x80) < 2) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_sprite)._animState._animation + 0x80) < 2)) { return; } pvVar3 = (this->_sprite)._animState._animData; layerId = *(int *)((int)pvVar3 + 0x3c); if (((pvVar3 == (void *)0x0) || (layerId < 0)) || (*(int *)((int)pvVar3 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_sprite)._animState._layerFrames + layerId * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,layerId,(float)iVar2); } return; } //@@ 00837c10 GenericPrompt::Render /* ZHL [exact] __thiscall void GenericPrompt::Render(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GenericPrompt::Render(GenericPrompt *this) { KColor color; Font *this_00; float *pfVar1; int iVar2; int iVar3; void *glyphRun; AnimationState *this_01; undefined4 *puVar4; float fVar5; float fVar6; Font *pFVar7; float fVar8; float fVar9; float fVar10; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; KColor local_60; undefined1 local_4c [16]; Vector local_3c; Vector local_34; float local_2c; GenericPrompt *local_28; float local_24; float local_20; float local_1c; Font *local_18; Font *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0255d; local_10 = ExceptionList; ExceptionList = &local_10; if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { local_34.x = g_screenWidth * 0.5; local_18 = &g_manager->_font3_TeamMeatEx16; local_14 = &g_manager->_font2_TeamMeatEx12; local_34.y = g_screenHeight * 0.5; local_28 = this; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_34,&g_vectorZero,&g_vectorZero); this_01 = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero); this_01 = &(this->_sprite)._animState; } AnimationState::Render(this_01,&local_34,&g_vectorZero,&g_vectorZero); } if ((this->_sprite)._animState._animData != (void *)0x0) { pfVar1 = AnimationState::GetNullFrame(&(this->_sprite)._animState,(byte *)"TextTop"); if (pfVar1 != (float *)0x0) { KColor::SetFromARGB(&local_60,0xff362f2d); this_00 = local_18; fVar10 = *pfVar1; puVar4 = (undefined4 *)&this->field_0x114; fVar6 = pfVar1[1]; local_20 = 2.8026e-45; local_24 = fVar10; local_1c = fVar6; do { if ((short *)*puVar4 == (short *)0x0) { pFVar7 = (Font *)pfVar1[5]; } else { local_7c = 0; local_78 = 0xffff; local_74 = 0; local_70 = 0x3f800000; local_6c = 0xffffffff; local_68 = 0; local_64 = 0; local_8 = 0; fVar9 = 0.5; fVar5 = pfVar1[5]; fVar8 = pfVar1[4]; fVar6 = g_screenHeight * 0.5 + fVar6; iVar2 = Font::get_string_width_utf16(this_00,(short *)*puVar4,-1); Font::draw_string_wide (this_00,(short *)*puVar4, (g_screenWidth * fVar9 + fVar10) - (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * fVar9 * pfVar1[4],fVar6,fVar8,fVar5,&local_60,&local_7c); pFVar7 = (Font *)pfVar1[5]; fVar6 = local_1c + (float)pFVar7 * 17.0; fVar10 = local_24; local_1c = fVar6; } puVar4 = puVar4 + 1; local_20 = (float)((int)local_20 + -1); local_18 = pFVar7; } while (local_20 != 0.0); puVar4 = (undefined4 *)&local_28->field_0x11c; iVar2 = 3; fVar6 = (float)pFVar7 * 12.0 + fVar6; local_20 = fVar6; do { if ((short *)*puVar4 != (short *)0x0) { local_7c = 0; local_78 = 0xffff; local_74 = 0; local_70 = 0x3f800000; local_6c = 0xffffffff; local_68 = 0; local_64 = 0; local_8 = 1; fVar8 = 0.5; fVar5 = pfVar1[4]; local_1c = g_screenHeight * 0.5 + fVar6; local_28 = (GenericPrompt *)fVar5; iVar3 = Font::get_string_width_utf16(local_14,(short *)*puVar4,-1); local_2c = (g_screenWidth * fVar8 + fVar10) - (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * fVar8 * pfVar1[4]; local_3c.x = fVar5; local_3c.y = (float)pFVar7; glyphRun = Font::layout_glyphs(local_14,local_4c,(byte *)*puVar4,&local_7c,&local_3c); local_8 = CONCAT31(local_8._1_3_,2); color._green = local_60._green; color._red = local_60._red; color._blue = local_60._blue; color._alpha = local_60._alpha; color._unk = local_60._unk; Font::draw_glyph_run (local_14,local_2c,local_1c,glyphRun,(float)local_28,(float)local_18,color, &local_7c); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); pFVar7 = (Font *)pfVar1[5]; fVar6 = local_20 + (float)pFVar7 * 13.0; local_20 = fVar6; local_18 = pFVar7; } puVar4 = puVar4 + 1; iVar2 = iVar2 + -1; fVar10 = local_24; } while (iVar2 != 0); } } } ExceptionList = local_10; return; } //@@ 00837fe0 GenericPrompt::handle_input /* DB: ? ECX=GenericPrompt: actions 0x14/0x15 toggle the yes/no selection (+0x128); ACTION_MENUCONFIRM (0xe) while the sprite plays "Idle" stores the answer (+0x12c = 1 or 2) and either sends it as an online vote (online_vote_send, when +0x130) or calls GenericPrompt::Disappear; uses the netplay local controller when online; callers GenericPrompt::Update and Manager::update_ingame_input */ void GenericPrompt::handle_input(void) { char cVar1; byte bVar2; int iVar3; byte *pbVar4; uint uVar5; ANM2 *in_ECX; byte *pbVar6; int controllerId; bool bVar7; controllerId = -1; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar3 = FUN_0090b070(); if ((iVar3 != 0) && (*(int *)(iVar3 + 0x378) != 0)) { controllerId = *(int *)(*(int *)(iVar3 + 0x378) + 0xc); } } bVar2 = input_is_action_triggered(g_manager,0x14,controllerId,(Entity *)0x0,0); if (bVar2 == 0) { bVar2 = input_is_action_triggered(g_manager,0x15,controllerId,(Entity *)0x0,0); if (bVar2 == 0) goto LAB_0083804d; } in_ECX[1]._filename._capacity = in_ECX[1]._filename._capacity - 1 & 1; LAB_0083804d: bVar2 = input_is_action_triggered(g_manager,0xe,controllerId,(Entity *)0x0,0); if (((bVar2 != 0) && (pbVar4 = (in_ECX->_animState)._animData, pbVar4 != (byte *)0x0)) && ((in_ECX->_animState)._isPlaying != 0)) { if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pbVar6 = s_Idle; do { bVar2 = *pbVar4; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_008380a0: uVar5 = -(uint)bVar7 | 1; goto LAB_008380a5; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_008380a0; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_008380a5: if (uVar5 == 0) { uVar5 = in_ECX[1]._filename._capacity; cVar1 = in_ECX[1]._animDefaultName._buf[4]; *(uint *)in_ECX[1]._animDefaultName._buf = 2 - (uint)(uVar5 != 0); if (cVar1 != '\0') { online_vote_send((uint)(uVar5 == 0)); return; } Disappear(in_ECX); } } return; } //@@ 008380f0 GenericPrompt::Show /* ZHL [exact] __thiscall void GenericPrompt::Show(bool UNK); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall GenericPrompt::Show(GenericPrompt *this,byte UNK) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; char *pcVar5; bool bVar6; *(undefined4 *)&this->field_0x12c = 0; *(undefined4 *)&this->field_0x128 = 0; pbVar1 = (this->_sprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Appear"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_00838142: uVar4 = -(uint)bVar6 | 1; goto LAB_00838147; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_00838142; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00838147: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00838173; } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"Appear",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00838173: this->_isOnlineVote = UNK; return; } //@@ 00838190 GenericPrompt::Disappear /* ZHL [exact] static cleanup void GenericPrompt::Disappear(ANM2 * anm2); prototype: REPENTOGON */ void __cdecl GenericPrompt::Disappear(ANM2 *anm2) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; char *pcVar5; bool bVar6; pbVar1 = (anm2->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "Dissappear"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_008381d0: uVar4 = -(uint)bVar6 | 1; goto LAB_008381d5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_008381d0; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008381d5: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { return; } if ((anm2->_animState)._isPlaying != 0) { return; } } } bVar2 = ANM2::SetAnimation(anm2,(byte *)"Dissappear",1); if (bVar2 != 0) { AnimationState::Rewind(&anm2->_animState); (anm2->_animState)._isPlaying = 1; } return; } //@@ 00838210 is_screen_transition_active /* DB: ? 0x34!=0 && byte 0x44; Game::Update/IsPaused */ undefined1 is_screen_transition_active(void) { int in_ECX; if ((*(int *)(in_ECX + 0x34) == 0) || (*(char *)(in_ECX + 0x44) == '\0')) { return 0; } return 1; } //@@ 00838230 FUN_00838230 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00838230(ANM2 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { int iVar1; uint uVar2; ANM2 *text; qword qVar3; short *psVar4; LayerState *pLVar5; ANM2 *in_ECX; qword *pqVar6; ANM2 *pAVar7; char *pcVar8; int iVar9; ANM2 *local_2c [6]; uint local_14; void *local_10; undefined1 *puStack_c; ANM2 *local_8; local_8 = (ANM2 *)0xffffffff; puStack_c = &LAB_00b02580; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_2c[4] = (ANM2 *)param_4; pAVar7 = in_ECX + 1; local_2c[5] = (ANM2 *)param_5; iVar9 = 0; local_2c[0] = param_1; local_2c[1] = (ANM2 *)param_2; local_2c[3] = (ANM2 *)param_3; local_2c[2] = in_ECX; do { iVar1 = *(int *)(pAVar7->_filename)._buf; pqVar6 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } if (iVar1 != 0) { uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar2; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); } local_8 = (ANM2 *)0xffffffff; text = local_2c[iVar9]; (pAVar7->_filename)._buf[0] = '\0'; (pAVar7->_filename)._buf[1] = '\0'; (pAVar7->_filename)._buf[2] = '\0'; (pAVar7->_filename)._buf[3] = '\0'; if (text != (ANM2 *)0x0) { psVar4 = utf8_to_utf16_alloc((byte *)text); *(short **)(pAVar7->_filename)._buf = psVar4; } iVar9 = iVar9 + 1; pAVar7 = (ANM2 *)((pAVar7->_filename)._buf + 4); } while (iVar9 < 2); iVar9 = 0; pcVar8 = local_2c[2][1]._filename._buf + 8; do { iVar1 = *(int *)pcVar8; pqVar6 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } if (iVar1 != 0) { uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar2; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); } local_8 = (ANM2 *)0xffffffff; pAVar7 = local_2c[iVar9 + 3]; pcVar8[0] = '\0'; pcVar8[1] = '\0'; pcVar8[2] = '\0'; pcVar8[3] = '\0'; if (pAVar7 != (ANM2 *)0x0) { psVar4 = utf8_to_utf16_alloc((byte *)pAVar7); *(short **)pcVar8 = psVar4; } iVar9 = iVar9 + 1; pcVar8 = pcVar8 + 4; } while (iVar9 < 3); if (2 < (uint)local_2c[2]->_layerCount) { pLVar5 = ANM2::GetLayer(local_2c[2],(byte *)0x2); pLVar5->_visible = 0; } ExceptionList = local_10; return; } //@@ 00838380 VictoryRunPrompt::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Prompt_VictoryRun.png, LoadConfigXmls */ void VictoryRunPrompt::Load(void) { int iVar1; uint uVar2; qword qVar3; byte bVar4; void *pvVar5; byte *****pppppbVar6; LayerState *pLVar7; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte unk; ANM2 *in_ECX; byte *****a; qword *pqVar8; char *pcVar9; byte *****pppppbVar10; byte *****pppppbVar11; uint uVar12; byte *****local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; byte ****local_8; puStack_c = &LAB_00b024cd; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; pcVar9 = in_ECX[1]._filename._buf + 8; uVar12 = 3; pvVar5 = g_mainHeap; do { local_8 = (byte ****)0xffffffff; iVar1 = *(int *)pcVar9; pqVar8 = (qword *)((int)pvVar5 + 0x30); if (pvVar5 == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } if (iVar1 != 0) { uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar2; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); pvVar5 = g_mainHeap; } local_8 = (byte ****)0xffffffff; pcVar9[0] = '\0'; pcVar9[1] = '\0'; pcVar9[2] = '\0'; pcVar9[3] = '\0'; pcVar9 = pcVar9 + 4; uVar12 = uVar12 - 1; } while (uVar12 != 0); local_1c = 0xf; local_30[0] = (byte *****)0x0; local_20 = uVar12; std::string::assign((char *)local_30,(byte *)"gfx/ui/Prompt_VictoryRun.png",0x1c); pppppbVar10 = local_30[0]; local_8 = (byte ****)0x1; if (in_ECX->_layerCount < 3) { unk = extraout_CL; } else { pvVar5 = in_ECX->_layerState; pppppbVar11 = (byte *****)((int)pvVar5 + 0x148); pppppbVar6 = pppppbVar11; if (0xf < *(uint *)((int)pvVar5 + 0x15c)) { pppppbVar6 = (byte *****)*pppppbVar11; } a = (byte *****)local_30; if (0xf < local_1c) { a = local_30[0]; } bVar4 = str_eq((byte *)a,local_20,(byte *)pppppbVar6,*(uint *)((int)pvVar5 + 0x158)); unk = extraout_CL_00; if (bVar4 == 0) { if ((byte ******)pppppbVar11 == local_30) { *(undefined1 *)((int)pvVar5 + 0x170) = 0; } else { pppppbVar6 = (byte *****)local_30; if (0xf < local_1c) { pppppbVar6 = pppppbVar10; } std::string::assign((char *)pppppbVar11,(byte *)pppppbVar6,local_20); *(undefined1 *)((int)in_ECX->_layerState + 0x170) = 0; pppppbVar10 = local_30[0]; unk = extraout_CL_01; } } } local_8 = (byte ****)0xffffffff; if (0xf < local_1c) { uVar12 = local_1c + 1; pppppbVar11 = pppppbVar10; if (0xfff < uVar12) { pppppbVar11 = (byte *****)pppppbVar10[-1]; uVar12 = local_1c + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar10 + (-4 - (int)pppppbVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar11,uVar12); unk = extraout_CL_02; } ANM2::LoadGraphics(in_ECX,unk); if (2 < (uint)in_ECX->_layerCount) { pLVar7 = ANM2::GetLayer(in_ECX,(byte *)0x2); pLVar7->_visible = 1; } ExceptionList = local_10; return; } //@@ 00838520 GridEntity_Statue::Update /* ZHL [exact] void Update(); */ void __thiscall GridEntity_Statue::Update(GridEntity_Statue *this) { int iVar1; if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } iVar1 = (this->_desc)._state; if (iVar1 == 1) { this->_collisionClass = 3; return; } if (iVar1 == 2) { this->_collisionClass = 0; } return; } //@@ 00838560 GridEntity_Statue::Destroy /* ZHL [vtable slot 5] */ undefined4 __thiscall GridEntity_Statue::Destroy(GridEntity_Statue *this) { int iVar1; code *pcVar2; char cVar3; Entity_Player *keyPieceOwner; int *listNode; undefined4 uVar4; Entity *angel; Manager *pMVar5; byte rngShift3; int *piVar6; uint uVar7; int iVar8; Game *game; bool isUrielSpawned; bool isGabrielUnspawned; Vector local_24; Vector local_1c; void *statueRoom; GridEntity_Statue *statue; undefined4 local_c; char local_8; char isSpawnUriel; undefined1 isKeyPiece2Owned; char isUrielPresent; undefined1 *descriptorFlags; GridEntity_Statue *destroyedStatue; GridEntity_Door *door; bool isGabrielPresent; bool isKeyPiece1Pedestal; bool isKeyPiece2Pedestal; void *room; int targetRoomType; local_24.y = (float)(this->_desc)._spawnSeed; local_c = 7; if (((this->_desc)._state != 1) || ((this->_desc)._variant != 1)) { return 0; } if (((g_manager->_persistentGameData)._achievements[0x9b] != 0) || (((pMVar5 = g_manager, g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { room = g_game->_room; statueRoom = room; statue = this; keyPieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xee,(RNG **)&g_game->_playerManager,1); local_8 = keyPieceOwner != (Entity_Player *)0x0; keyPieceOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xef,(RNG **)&g_game->_playerManager,1); isKeyPiece2Owned = keyPieceOwner != (Entity_Player *)0x0; iVar8 = *(int *)((int)room + 0x1264); isKeyPiece2Pedestal = false; isKeyPiece1Pedestal = false; if (iVar8 == 0) { isGabrielPresent = false; isUrielPresent = '\0'; isKeyPiece1Pedestal = false; isKeyPiece2Pedestal = false; } else { piVar6 = *(int **)((int)room + 0x125c); do { iVar1 = *piVar6; if ((*(int *)(iVar1 + 0x28) == 5) && (*(int *)(iVar1 + 0x2c) == 100)) { if (*(int *)(iVar1 + 0x30) == 0xee) { isKeyPiece1Pedestal = true; } else if (*(int *)(iVar1 + 0x30) == 0xef) { isKeyPiece2Pedestal = true; } } piVar6 = piVar6 + 1; iVar8 = iVar8 + -1; } while (iVar8 != 0); isUrielPresent = '\0'; isGabrielPresent = false; uVar7 = 0; do { iVar8 = *(int *)(*(int *)(*(int *)((int)statueRoom + 0x125c) + uVar7 * 4) + 0x28); if (iVar8 == 0x10f) { isUrielPresent = '\x01'; } else if (iVar8 == 0x110) { isGabrielPresent = true; } uVar7 = uVar7 + 1; } while (uVar7 < *(uint *)((int)statueRoom + 0x1264)); this = statue; } piVar6 = *(int **)((int)g_game->_room + 0x7300); listNode = (int *)*piVar6; if (listNode != piVar6) { do { if (listNode[4] == 0x10f) { isUrielPresent = '\x01'; } else if (listNode[4] == 0x110) { isGabrielPresent = true; } listNode = (int *)*listNode; } while (listNode != piVar6); this = statue; } local_1c.y = *(float *)((int)&g_game->_gameStateFlags + 4); isUrielSpawned = (g_game->_gameStateFlags & 0x2000000) != 0; isGabrielUnspawned = (g_game->_gameStateFlags & 0x4000000) == 0; if ((((!isUrielSpawned) && (!isGabrielUnspawned)) || ((isGabrielPresent && (isUrielPresent == '\0')))) || ((((!isKeyPiece1Pedestal && (local_8 == '\0')) && ((bool)isKeyPiece2Owned)) && (isUrielPresent == '\0')))) { isSpawnUriel = '\x01'; } else { isSpawnUriel = '\0'; } if ((((isUrielSpawned) && (isGabrielUnspawned)) || ((isUrielPresent != '\0' && (!isGabrielPresent)))) || ((((!isKeyPiece2Pedestal && (!(bool)isKeyPiece2Owned)) && (local_8 != '\0')) && (!isGabrielPresent)))) { local_8 = '\x01'; } else { local_8 = '\0'; } if (local_24.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar7 = (uint)local_24.y >> 5 ^ (uint)local_24.y; uVar7 = uVar7 << 9 ^ uVar7; rngShift3 = (byte)local_c; uVar7 = uVar7 >> (rngShift3 & 0x1f) ^ uVar7; if ((((uVar7 & 1) == 0) && (local_8 == '\0')) || (isSpawnUriel != '\0')) { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar7 = uVar7 >> 5 ^ uVar7; uVar7 = uVar7 << 9 ^ uVar7; iVar8 = *(int *)((int)g_game->_room + 0xc); local_24.x = (float)(this->_gridIndex % iVar8) * 40.0 + 40.0; local_24.y = (float)(this->_gridIndex / iVar8) * 40.0 + 120.0; angel = Game::Spawn(g_game,0x10f,0,&local_24,&g_vectorZero,(Entity *)0x0,0, uVar7 >> (rngShift3 & 0x1f) ^ uVar7); game = g_game; uVar4 = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x2000000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar4; } else { if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); uVar4 = (*pcVar2)(); return uVar4; } uVar7 = uVar7 >> 5 ^ uVar7; uVar7 = uVar7 << 9 ^ uVar7; iVar8 = *(int *)((int)g_game->_room + 0xc); local_1c.x = (float)(this->_gridIndex % iVar8) * 40.0 + 40.0; local_1c.y = (float)(this->_gridIndex / iVar8) * 40.0 + 120.0; angel = Game::Spawn(g_game,0x110,0,&local_1c,&g_vectorZero,(Entity *)0x0,0, uVar7 >> (rngShift3 & 0x1f) ^ uVar7); game = g_game; uVar4 = *(undefined4 *)((int)&g_game->_gameStateFlags + 4); *(uint *)&g_game->_gameStateFlags = (uint)g_game->_gameStateFlags | 0x4000000; *(undefined4 *)((int)&game->_gameStateFlags + 4) = uVar4; } room = game->_room; cVar3 = (**(code **)(*(int *)angel + 0x48))(); if ((cVar3 != '\0') && (angel->_type != 0x362)) { piVar6 = (int *)((int)room + 0x12c0); *piVar6 = *piVar6 + 1; cVar3 = (**(code **)(*(int *)angel + 0x4c))(); if (cVar3 != '\0') { piVar6 = (int *)((int)room + 0x12c8); *piVar6 = *piVar6 + 1; } } (**(code **)(*(int *)angel + 0xc))(); if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { iVar8 = 0x29; } else { iVar8 = 9; if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 6 & 1) != 0) { iVar8 = 0x1a; } } MusicManager::Crossfade(&g_manager->_musicManager,iVar8,0.08); destroyedStatue = statue; if (*(int **)(statue + 1) != (int *)0x0) { (**(code **)(**(int **)(statue + 1) + 0x28))(); *(undefined4 *)(destroyedStatue + 1) = 0; } if ((uint)destroyedStatue->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + destroyedStatue->_gridIndex * 4 + 0x76c) = 0; } (destroyedStatue->_desc)._state = 2; uVar7 = 0; iVar8 = 0x724; do { uVar7 = uVar7 + 1; if (((uVar7 < 9) && (door = *(GridEntity_Door **)(iVar8 + (int)g_game->_room), door != (GridEntity_Door *)0x0) ) && ((door->_desc)._state != 1)) { (door->_desc)._state = 1; GridEntity_Door::UpdateAnimation(door); iVar1 = door->_currentRoomType; if ((((iVar1 == 7) || (targetRoomType = door->_targetRoomType, targetRoomType == 7)) || ((iVar1 == 8 || ((targetRoomType == 8 || (iVar1 == 0x1d)))))) || (targetRoomType == 0x1d)) { std::string::assign((door->_openAnimation)._buf,s_Open,4); } } iVar8 = iVar8 + 4; } while (iVar8 < 0x744); pMVar5 = *(Manager **)((int)g_game->_room + 4); descriptorFlags = &(pMVar5->_persistentGameData).field_0x30; *(uint *)descriptorFlags = *(uint *)descriptorFlags & 0xfffffffe; } return CONCAT31((int3)((uint)pMVar5 >> 8),1); } //@@ 00838ae0 GridEntity_Statue::BeginBatches /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Statue::BeginBatches(GridEntity_Statue *this) { uint seed; int iVar1; Entity *pEVar2; undefined4 uVar3; int iVar4; uint variant; Vector local_10; iVar1 = (this->_desc)._state; if (iVar1 < 1) { (this->_desc)._state = 1; } else if (iVar1 != 1) goto LAB_00838bf3; iVar1 = (this->_desc)._variant; if (iVar1 == 0) { seed = Random(); iVar1 = *(int *)((int)g_game->_room + 0xc); iVar4 = this->_gridIndex % iVar1; iVar1 = this->_gridIndex / iVar1; variant = 6; } else { if (iVar1 != 1) goto LAB_00838bf3; seed = Random(); iVar1 = *(int *)((int)g_game->_room + 0xc); iVar4 = this->_gridIndex % iVar1; iVar1 = this->_gridIndex / iVar1; variant = 9; } local_10.x = (float)iVar4 * 40.0 + 40.0; local_10.y = (float)iVar1 * 40.0 + 120.0; pEVar2 = Game::SpawnEx(g_game,1000,variant,&local_10,&g_vectorZero,(Entity *)0x0,0,seed,0); *(Entity **)(this + 1) = pEVar2; LAB_00838bf3: if ((uint)this->_gridIndex < 0x1c0) { uVar3 = 0; if ((this->_desc)._state == 1) { uVar3 = 1000; } *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = uVar3; } return; } //@@ 00838c30 GridEntity_Teleporter::Update /* ZHL [vtable slot 2] */ void __thiscall GridEntity_Teleporter::Update(GridEntity_Teleporter *this) { byte bVar1; undefined1 auVar2 [16]; int iVar3; byte *curAnimChar; uint uVar4; Entity_Player *player; Vector *destPos; char *wantAnimChar; int cellsScanned; bool bVar5; int in_stack_ffffffc8; undefined1 auVar6 [12]; undefined1 in_stack_ffffffd0 [16]; undefined1 auVar7 [16]; undefined1 auVar8 [16]; undefined1 auVar9 [16]; undefined1 auVar10 [16]; undefined1 auVar11 [16]; Vector local_10; GridEntity *otherTeleporter; auVar6 = in_stack_ffffffd0._0_12_; iVar3 = (this->_desc)._state; if (iVar3 == 1) { iVar3 = FUN_00839070(); if (iVar3 == 0) { (this->_desc)._state = 0; } goto LAB_00838e61; } curAnimChar = (this->_sprite)._animState._animData; if (iVar3 == 2) { if ((curAnimChar != (byte *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } wantAnimChar = "TurnOff"; do { bVar1 = *curAnimChar; bVar5 = bVar1 < (byte)*wantAnimChar; if (bVar1 != *wantAnimChar) { LAB_00838ca0: uVar4 = -(uint)bVar5 | 1; goto LAB_00838ca5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar5 = bVar1 < (byte)wantAnimChar[1]; if (bVar1 != wantAnimChar[1]) goto LAB_00838ca0; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_00838ca5: if (uVar4 == 0) goto LAB_00838e61; } ANM2::Play(&this->_sprite,(byte *)"IdleOff",0); goto LAB_00838e61; } if ((curAnimChar == (byte *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { LAB_00838d09: auVar7._8_4_ = "IdleOn"; auVar7._0_8_ = 0x838d1800000000; auVar7._12_4_ = 0; ANM2::Play(&this->_sprite,(byte *)"IdleOn",0); auVar6 = auVar7._0_12_; } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } wantAnimChar = "TurnOn"; do { bVar1 = *curAnimChar; bVar5 = bVar1 < (byte)*wantAnimChar; if (bVar1 != *wantAnimChar) { LAB_00838d00: uVar4 = -(uint)bVar5 | 1; goto LAB_00838d05; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar5 = bVar1 < (byte)wantAnimChar[1]; if (bVar1 != wantAnimChar[1]) goto LAB_00838d00; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar1 != 0); uVar4 = 0; LAB_00838d05: if (uVar4 != 0) goto LAB_00838d09; } auVar8._12_4_ = 0x838d1f; auVar8._0_12_ = auVar6; player = (Entity_Player *)FUN_00839070(); if (player != (Entity_Player *)0x0) { uVar4 = this->_gridIndex; local_10.x = (float)g_game->_room; cellsScanned = 0; iVar3 = *(int *)((int)local_10.x + 0x10) * *(int *)((int)local_10.x + 0xc); auVar9._0_8_ = auVar8._0_8_; if (0 < iVar3 + -2) { do { uVar4 = (int)(uVar4 + 1) % iVar3; if ((((uVar4 < 0x1c0) && (otherTeleporter = *(GridEntity **)((int)local_10.x + uVar4 * 4 + 0x24), otherTeleporter != (GridEntity *)0x0)) && ((otherTeleporter->_desc)._type == 0x17)) && ((otherTeleporter->_desc)._variant == (this->_desc)._variant)) { auVar9._8_4_ = 1; auVar9._12_4_ = 1; auVar10._8_8_ = auVar9._8_8_; auVar10._4_4_ = &local_10; auVar10._0_4_ = 0x838dba; destPos = GridEntity::Position(otherTeleporter,&local_10); Entity_Player::Teleport(player,destPos,auVar10[8],auVar10[0xc]); destPos = GridEntity::Position(otherTeleporter,&local_10); Game::DamageRadius(destPos,(Entity *)player,4,0,in_stack_ffffffc8,50.0,g_tearFlagsNone, 40.0,30.0); if ((otherTeleporter->_desc)._state == 0) { (otherTeleporter->_desc)._state = 1; } goto LAB_00838e61; } cellsScanned = cellsScanned + 1; } while (cellsScanned < iVar3 + -2); } iVar3 = *(int *)((int)local_10.x + 8); if ((iVar3 == 0x19) || (iVar3 == 0x1a)) { auVar11._8_4_ = &this->_rng; auVar11._0_8_ = auVar9._0_8_; auVar11._12_4_ = 1; auVar2._8_8_ = 0; auVar2._0_8_ = auVar11._8_8_; iVar3 = Level::QueryRoomTypeIndex((iVar3 == 0x19) + '\x19',SUB1612(auVar2 << 0x40,4)); if (-1 < iVar3) { Game::StartRoomTransition(g_game,iVar3,-1,3,player,-1); *(int *)&(g_game->_roomTransition).field_0x20 = (this->_desc)._variant + 1; } } else { (this->_desc)._state = 2; } } LAB_00838e61: if ((uint)this->_gridIndex < 0x1c0) { *(undefined4 *)((int)g_game->_room + this->_gridIndex * 4 + 0x76c) = 999; } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } //@@ 00838eb0 GridEntity_Teleporter::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Teleporter::BeginBatches(GridEntity_Teleporter *this) { byte *pbVar1; Game *pGVar2; byte bVar3; uint uVar4; undefined **ppuVar5; byte *pbVar6; void *ptr; char *pcVar7; bool bVar8; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar2 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00af6ebd; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&local_2c + 0x28U; ExceptionList = &local_10; if (g_game->_challenge == 0x2c) { uVar4 = Level::GetRoomStageType((Level *)g_game,g_game->_currentRoomIdx); LAB_00838f10: uVar4 = RoomConfig::GetStageID(pGVar2->_stage,uVar4,-1); } else { if (g_game->_currentDimensionIdx != 2) { uVar4 = g_game->_stageType; goto LAB_00838f10; } uVar4 = 0x23; } ppuVar5 = &PTR_s_gfx_grid_grid_teleporter_gehenna_00c5c470; local_2c._size = 0; if (uVar4 != 0x20) { ppuVar5 = &PTR_s_gfx_grid_grid_teleporter_anm2_00c5c454; } local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; pbVar1 = ppuVar5[(this->_desc)._variant]; pbVar6 = pbVar1; do { bVar3 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar3 != 0); std::string::assign(local_2c._buf,pbVar1,(int)pbVar6 - (int)(pbVar1 + 1)); local_8 = 0; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar4 = local_2c._capacity + 1; ptr = (void *)local_2c._buf._0_4_; if (0xfff < uVar4) { ptr = *(void **)(local_2c._buf._0_4_ + -4); uVar4 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } pbVar1 = (this->_sprite)._animState._animData; local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = local_2c._buf._0_4_ & 0xffffff00; if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IdleOn"; do { bVar3 = *pbVar6; bVar8 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_00839000: uVar4 = -(uint)bVar8 | 1; goto LAB_00839005; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar8 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_00839000; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00839005: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00839038; } bVar3 = ANM2::SetAnimation(&this->_sprite,(byte *)"IdleOn",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00839038: *(undefined1 *)((int)g_game->_room + 0x11f5) = 0; ExceptionList = local_10; return; } //@@ 00839070 FUN_00839070 int FUN_00839070(void) { int iVar1; int iVar2; int iVar3; int in_ECX; void *pvVar4; Game *pGVar5; PlayerManager *pPVar6; int *piVar7; uint uVar8; float fVar9; float fVar10; iVar1 = *(int *)(in_ECX + 0x24); pPVar6 = &g_game->_playerManager; uVar8 = 0; iVar2 = *(int *)((int)g_game->_room + 0xc); pGVar5 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2 != 0) { do { pvVar4 = (pPVar6->_playerList)._end; if ((int)pvVar4 - (int)(pPVar6->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (pPVar6->_playerList)._end; pGVar5 = g_game; } piVar7 = (pPVar6->_playerList)._begin; if (uVar8 < (uint)((int)pvVar4 - (int)piVar7 >> 2)) { piVar7 = piVar7 + uVar8; } iVar3 = *piVar7; if ((*(int *)(iVar3 + 0x2c) == 0) && (((0 < *(int *)(iVar3 + 0x184) || (0 < *(int *)(iVar3 + 0x188))) && (fVar10 = ((float)(iVar1 % iVar2) * 40.0 + 40.0) - *(float *)(iVar3 + 0x33c), fVar9 = ((float)(iVar1 / iVar2) * 40.0 + 120.0) - *(float *)(iVar3 + 0x340), fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10), fVar9 < 21.0)))) { return iVar3; } pPVar6 = &pGVar5->_playerManager; uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)(pGVar5->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2)); } return 0; } //@@ 008391a0 FUN_008391a0 void FUN_008391a0(void) { Manager *pMVar1; void *pvVar2; std_string *ANM2Path; undefined4 *in_ECX; undefined4 local_60 [11]; undefined1 local_34 [8]; void *local_2c; undefined4 local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00b025c8; local_1c = ExceptionList; ExceptionList = &local_1c; *in_ECX = 0; in_ECX[1] = 0; pvVar2 = operator_new(0x28); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *in_ECX = pvVar2; local_14 = 0; in_ECX[2] = 0; ANM2::constructor((ANM2 *)(in_ECX + 3)); pMVar1 = g_manager; local_14 = CONCAT31(local_14._1_3_,1); in_ECX[2] = *in_ECX; local_24 = 0x100000; _Find_lower_bound<>(local_34,&local_24); if ((*(char *)((int)local_2c + 0xd) == '\0') && (*(uint *)((int)local_2c + 0x10) < 0x100001)) { pvVar2 = (pMVar1->_entityConfig)._entities._head; } else { local_2c = (pMVar1->_entityConfig)._entities._head; pvVar2 = local_2c; } ANM2Path = (std_string *)((int)local_2c + 0x8c); if (local_2c == pvVar2) { ANM2Path = (std_string *)0x74; } ANM2::Load((ANM2 *)(in_ECX + 3),ANM2Path,1); if (in_ECX + 0x2d != local_60) { in_ECX[0x2d] = 0x3f800000; in_ECX[0x2e] = 0x3f800000; in_ECX[0x2f] = 0x3f800000; in_ECX[0x30] = 0x3f000000; *(undefined8 *)(in_ECX + 0x35) = 0; in_ECX[0x31] = 0x3f000000; in_ECX[0x32] = 0x3f000000; in_ECX[0x33] = 0x3f000000; in_ECX[0x34] = 0x3f800000; in_ECX[0x37] = 0; } in_ECX[0x48] = 0; ExceptionList = local_1c; return; } //@@ 00839300 sprite_member_at_0xc_destroy /* DB: ? dtor of a struct with an ANM2/Sprite at +0xc (ANM2::Reset, AnimationState dtors +0x3c/+0x5c, 2 strings) followed by FUN_00839960; unwind-only callers */ void sprite_member_at_0xc_destroy(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0xc)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x24)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xc)); FUN_00839960(); ExceptionList = local_10; return; } //@@ 00839380 list_anm2_state_assign /* DB: ? operator= for a 0x124-byte struct {std::list, list iterator +8, ANM2 +0xc, float +0x120}: copies the list, re-finds the iterator position, ANM2 copy+swap, copies +0x120; Entity_Player::room_exit copies player+0x1b34 into +0x1c58 when +0x1c54 > +0x1d78 */ void list_anm2_state_assign(int *param_1) { int *piVar1; int *piVar2; int *piVar3; uint uVar4; qword qVar5; int *in_ECX; int *piVar6; ANM2 *this; qword *pqVar7; ANM2 local_12c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5f50; local_10 = ExceptionList; ExceptionList = &local_10; if (in_ECX != param_1) { local_14 = local_14 & 0xffffff00; FUN_008399a0(param_1,local_14); } piVar1 = (int *)*param_1; piVar2 = (int *)param_1[2]; piVar6 = (int *)*in_ECX; piVar3 = (int *)*piVar1; if (piVar2 == piVar3) { in_ECX[2] = *piVar6; } else if (piVar2 == piVar1) { LAB_008393f0: in_ECX[2] = (int)piVar6; } else { piVar6 = (int *)*piVar6; for (; piVar3 != piVar1; piVar3 = (int *)*piVar3) { if (piVar3 == piVar2) goto LAB_008393f0; piVar6 = (int *)*piVar6; } } ANM2::ANM2(&local_12c,(ANM2 *)(param_1 + 3)); Isaac::SwapANM2((ANM2 *)(in_ECX + 3),&local_12c); local_8 = 0; ANM2::Reset(this); if (local_12c._overlayAnimState._layerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)((int)local_12c._overlayAnimState._layerFrames + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)((int)local_12c._overlayAnimState._layerFrames + -4)); local_12c._overlayAnimState._layerFrames = (void *)0x0; } if (local_12c._overlayAnimState._nullLayerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)((int)local_12c._overlayAnimState._nullLayerFrames + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)((int)local_12c._overlayAnimState._nullLayerFrames + -4)); local_12c._overlayAnimState._nullLayerFrames = (void *)0x0; } if (local_12c._animState._layerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)((int)local_12c._animState._layerFrames + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)((int)local_12c._animState._layerFrames + -4)); local_12c._animState._layerFrames = (void *)0x0; } if (local_12c._animState._nullLayerFrames != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)((int)local_12c._animState._nullLayerFrames + -4); qVar5 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar4; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)((int)local_12c._animState._nullLayerFrames + -4)); local_12c._animState._nullLayerFrames = (void *)0x0; } std::string::_Tidy_deallocate(local_12c._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_12c); in_ECX[0x48] = param_1[0x48]; ExceptionList = local_10; return; } //@@ 00839550 HallucinationOverlay::Render /* DB: ? ECX=struct with entry vector (+0/+8, entries with x +8 and frames +0x18/+0x20) and ANM2 at +0xc: renders 1-2 frames at HUD-scaled screen positions (338 px HUD width); only from Entity_Player::Render when player+0x1c5c set and g_game->_hallucinationTimer>0 */ void HallucinationOverlay::Render(float *param_1) { int iVar1; int *in_ECX; float fVar2; double dVar3; double dVar4; Vector local_48 [8]; if ((in_ECX[2] != *in_ECX) && (-1 < *(int *)(in_ECX[2] + 0x18))) { FUN_0040a400(); if (in_ECX[0x10] != 0) { AnimationState::SetFrameFloat ((AnimationState *)(in_ECX + 0xf),(float)*(int *)(in_ECX[2] + 0x1c)); } iVar1 = in_ECX[2]; fVar2 = g_displayPixelRatio * g_screenPointScale; dVar3 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (*(float *)(iVar1 + 8) - 60.0) * 0.65) * fVar2 + 0.5)); local_48[0].x = (float)dVar3 / fVar2; dVar3 = floor((double)(((g_screenHeight - 182.0) * 0.5 + (*(float *)(iVar1 + 0xc) - 140.0) * 0.65) * fVar2 + 0.5)); local_48[0].x = local_48[0].x + *param_1; local_48[0].y = (float)dVar3 / fVar2 + param_1[1]; ANM2::Render((ANM2 *)(in_ECX + 3),local_48,&g_vectorZero,&g_vectorZero); if (-1 < *(int *)(in_ECX[2] + 0x20)) { FUN_0040a400(); if (in_ECX[0x10] != 0) { AnimationState::SetFrameFloat ((AnimationState *)(in_ECX + 0xf),(float)*(int *)(in_ECX[2] + 0x24)); } iVar1 = in_ECX[2]; fVar2 = g_displayPixelRatio * g_screenPointScale; local_48[0].x = ((g_screenWidth - 338.0) * 0.5 + (*(float *)(iVar1 + 8) - 60.0) * 0.65) * fVar2 + 0.5; dVar3 = floor((double)local_48[0].x); local_48[0].x = ((*(float *)(iVar1 + 0xc) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar2 + 0.5 ; dVar4 = floor((double)local_48[0].x); local_48[0].x = (float)dVar3 / fVar2 + *param_1; local_48[0].y = (float)dVar4 / fVar2 + param_1[1]; ANM2::Render((ANM2 *)(in_ECX + 3),local_48,&g_vectorZero,&g_vectorZero); } } return; } //@@ 00839830 FUN_00839830 void FUN_00839830(void) { int *in_ECX; if ((int *)in_ECX[2] != (int *)*in_ECX) { in_ECX[2] = *(int *)in_ECX[2]; } return; } //@@ 00839840 FUN_00839840 void FUN_00839840(float *param_1) { int iVar1; undefined4 *puVar2; uint uVar3; float fVar4; int *piVar5; int *in_ECX; float fVar6; float fVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b025fd; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; if (in_ECX[1] != 0) { fVar6 = param_1[1] - *(float *)(*(int *)(iVar1 + 4) + 0xc); fVar7 = *param_1 - *(float *)(*(int *)(iVar1 + 4) + 8); fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); in_ECX[0x48] = (int)(fVar6 + (float)in_ECX[0x48]); if (in_ECX[1] == 0x6666666) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } } local_8 = 0; piVar5 = operator_new(0x28); fVar6 = param_1[1]; fVar7 = param_1[2]; fVar4 = param_1[3]; piVar5[2] = (int)*param_1; piVar5[3] = (int)fVar6; piVar5[4] = (int)fVar7; piVar5[5] = (int)fVar4; fVar6 = param_1[5]; fVar7 = param_1[6]; fVar4 = param_1[7]; piVar5[6] = (int)param_1[4]; piVar5[7] = (int)fVar6; piVar5[8] = (int)fVar7; piVar5[9] = (int)fVar4; in_ECX[1] = in_ECX[1] + 1; puVar2 = *(undefined4 **)(iVar1 + 4); *piVar5 = iVar1; piVar5[1] = (int)puVar2; *(int **)(iVar1 + 4) = piVar5; *puVar2 = piVar5; uVar3 = in_ECX[1]; while (900 < uVar3) { if ((int *)in_ECX[2] == *(int **)*in_ECX) { in_ECX[2] = *(int *)in_ECX[2]; } piVar5 = *(int **)*in_ECX; iVar1 = *piVar5; in_ECX[1] = in_ECX[1] + -1; *(int *)piVar5[1] = iVar1; *(int *)(iVar1 + 4) = piVar5[1]; operator_delete(piVar5,0x28); uVar3 = in_ECX[1]; } ExceptionList = local_10; return; } //@@ 00839960 FUN_00839960 void FUN_00839960(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0x28); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x28); return; } //@@ 008399a0 FUN_008399a0 void FUN_008399a0(int *param_1) { undefined4 *puVar1; int iVar2; int *piVar3; int iVar4; int iVar5; void *pvVar6; int *piVar7; int *in_ECX; int iVar8; int *ptr; undefined4 *puVar9; int *local_38; int *local_34; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pvVar6 = ExceptionList; local_14 = 0xffffffff; puStack_18 = &LAB_00b02635; local_1c = ExceptionList; ExceptionList = &local_1c; piVar7 = (int *)*in_ECX; puVar1 = (undefined4 *)*param_1; ptr = (int *)*piVar7; puVar9 = (undefined4 *)*puVar1; if (ptr != piVar7) { do { if (puVar9 == puVar1) { if (ptr == piVar7) { ExceptionList = pvVar6; return; } piVar3 = (int *)ptr[1]; iVar8 = 0; *piVar3 = (int)piVar7; piVar7[1] = (int)piVar3; do { piVar3 = (int *)*ptr; operator_delete(ptr,0x28); iVar8 = iVar8 + 1; ptr = piVar3; } while (piVar3 != piVar7); in_ECX[1] = in_ECX[1] - iVar8; ExceptionList = local_1c; return; } ptr[2] = puVar9[2]; ptr[3] = puVar9[3]; ptr[4] = puVar9[4]; ptr[5] = puVar9[5]; ptr[6] = puVar9[6]; ptr[7] = puVar9[7]; ptr[8] = puVar9[8]; ptr[9] = puVar9[9]; ptr = (int *)*ptr; puVar9 = (undefined4 *)*puVar9; } while (ptr != piVar7); } iVar8 = 0; if (puVar9 != puVar1) { local_14 = 1; local_34 = operator_new(0x28); iVar8 = puVar9[3]; iVar2 = puVar9[4]; iVar4 = puVar9[5]; local_34[2] = puVar9[2]; local_34[3] = iVar8; local_34[4] = iVar2; local_34[5] = iVar4; iVar8 = 1; iVar2 = puVar9[7]; iVar4 = puVar9[8]; iVar5 = puVar9[9]; local_34[6] = puVar9[6]; local_34[7] = iVar2; local_34[8] = iVar4; local_34[9] = iVar5; local_38 = local_34; for (puVar9 = (undefined4 *)*puVar9; puVar9 != puVar1; puVar9 = (undefined4 *)*puVar9) { piVar7 = operator_new(0x28); iVar2 = puVar9[3]; iVar4 = puVar9[4]; iVar5 = puVar9[5]; piVar7[2] = puVar9[2]; piVar7[3] = iVar2; piVar7[4] = iVar4; piVar7[5] = iVar5; iVar8 = iVar8 + 1; iVar2 = puVar9[7]; iVar4 = puVar9[8]; iVar5 = puVar9[9]; piVar7[6] = puVar9[6]; piVar7[7] = iVar2; piVar7[8] = iVar4; piVar7[9] = iVar5; *local_38 = (int)piVar7; piVar7[1] = (int)local_38; local_38 = piVar7; } } iVar2 = *in_ECX; if (iVar8 != 0) { puVar1 = *(undefined4 **)(iVar2 + 4); local_34[1] = (int)puVar1; *puVar1 = local_34; *local_38 = iVar2; *(int **)(iVar2 + 4) = local_38; in_ECX[1] = in_ECX[1] + iVar8; } ExceptionList = local_1c; return; } //@@ 00839b40 FUN_00839b40 void FUN_00839b40(void) { undefined4 *puVar1; undefined4 *ptr; int in_ECX; if (*(int *)(in_ECX + 4) != 0) { *(undefined4 *)(*(int *)(in_ECX + 0xc) + 4) = 0; **(undefined4 **)(in_ECX + 8) = 0; ptr = *(undefined4 **)(in_ECX + 0xc); while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; operator_delete(ptr,0x28); ptr = puVar1; } } return; } //@@ 00839b80 BeastArena::init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? no Ghidra function; called by Room::Init with ECX=Room+0x776c: active if stage 35 type 16, loads gfx/backdrop/hell/background.anm2, zeroes scroll (beast.md) */ void BeastArena::init(void) { int *piVar1; byte bVar2; LayerState *pLVar3; byte extraout_CL; byte extraout_CL_00; int *in_ECX; char *ptr; int iVar4; uint uVar5; byte *pbVar6; ANM2 *pAVar7; int iVar8; int *unaff_FS_OFFSET; std_string sStack_3c; uint uStack_24; int iStack_20; int iStack_1c; undefined1 *puStack_18; undefined4 uStack_14; iStack_20 = (int)register0x00000010 + -4; uStack_14 = 0xffffffff; puStack_18 = &LAB_00af18ad; iStack_1c = *unaff_FS_OFFSET; uStack_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; *unaff_FS_OFFSET = (int)&iStack_1c; piVar1 = *(int **)(*(int *)(*in_ECX + 4) + 0x10); if (((piVar1 == (int *)0x0) || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) { *(undefined1 *)(in_ECX + 0x46) = 0; } else { *(undefined1 *)(in_ECX + 0x46) = 1; iVar4 = (int)register0x00000010 + -4; if (*(char *)((int)in_ECX + 0x10d) == '\0') { sStack_3c._size = 0; sStack_3c._capacity = 0xf; sStack_3c._buf[0] = '\0'; sStack_3c._buf[1] = '\0'; sStack_3c._buf[2] = '\0'; sStack_3c._buf[3] = '\0'; sStack_3c._buf._0_4_ = std::_Allocate(0x30); sStack_3c._size = 0x21; sStack_3c._capacity = 0x2f; builtin_strncpy((char *)sStack_3c._buf._0_4_,"gfx/backdrop/hell/background.anm2",0x22); uStack_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 1),&sStack_3c,0); uStack_14 = 0xffffffff; bVar2 = extraout_CL; if (0xf < sStack_3c._capacity) { uVar5 = sStack_3c._capacity + 1; ptr = (char *)sStack_3c._buf._0_4_; if (0xfff < uVar5) { ptr = *(char **)(sStack_3c._buf._0_4_ + -4); uVar5 = sStack_3c._capacity + 0x24; if ((char *)0x1f < (char *)(sStack_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); bVar2 = extraout_CL_00; } in_ECX[0x45] = in_ECX[0x45] | 0x200; ANM2::LoadGraphics((ANM2 *)(in_ECX + 1),bVar2); pbVar6 = (byte *)(in_ECX + 7); if (0xf < (uint)in_ECX[0xc]) { pbVar6 = *(byte **)pbVar6; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 1),pbVar6,1); iVar4 = iStack_20; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0xd)); *(undefined1 *)(in_ECX + 0x12) = 1; iVar4 = iStack_20; } } iStack_20 = iVar4; pbVar6 = (byte *)0x0; if (in_ECX[0x21] != 0) { do { pLVar3 = ANM2::GetLayer((ANM2 *)(in_ECX + 1),pbVar6); pbVar6 = pbVar6 + 1; pLVar3->_wrapSMode = 0; pLVar3->_wrapTMode = 1; } while (pbVar6 < (byte *)in_ECX[0x21]); } pAVar7 = (ANM2 *)(in_ECX + 1); pLVar3 = ANM2::GetLayer(pAVar7,(byte *)0x0); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,(byte *)0x1); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,(byte *)0x2); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,(byte *)0x3); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,&DAT_00000004); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,&DAT_00000005); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,&DAT_00000006); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,&DAT_00000007); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; uVar5 = g_graphicsManager_flags; pLVar3 = ANM2::GetLayer(pAVar7,&DAT_00000008); iVar8 = 1; iVar4 = 1; if ((uVar5 & 4) == 0) { iVar4 = 6; } pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = iVar4; pLVar3->_blendMode[2] = 7; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 7; pAVar7 = (ANM2 *)(in_ECX + 1); pLVar3 = ANM2::GetLayer(pAVar7,&DAT_00000009); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,(byte *)0xa); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,&DAT_0000000b); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; pLVar3 = ANM2::GetLayer(pAVar7,(byte *)0xc); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 1; pLVar3->_blendMode[2] = 0; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 0; uVar5 = g_graphicsManager_flags; pLVar3 = ANM2::GetLayer((ANM2 *)(in_ECX + 1),&DAT_0000000d); if ((uVar5 & 4) == 0) { iVar8 = 6; } pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = iVar8; pLVar3->_blendMode[2] = 1; pLVar3->_blendMode[3] = 1; pLVar3->_blendMode[4] = 1; pLVar3 = ANM2::GetLayer((ANM2 *)(in_ECX + 1),&DAT_0000000e); pLVar3->_blendMode[0] = 0; pLVar3->_blendMode[1] = 0; pLVar3->_blendMode[2] = 2; pLVar3->_blendMode[3] = 0; pLVar3->_blendMode[4] = 2; in_ECX[0x47] = 0; in_ECX[0x48] = 0; in_ECX[0x49] = 0; } *unaff_FS_OFFSET = iStack_1c; return; } //@@ 0083a080 BeastArena::update /* DB: this=Room+0x776c, called at the end of Room::Update: anim, scroll pos += speed (+0x120), shifts non-player/familiar entity x by speed (beast.md) */ void BeastArena::update(void) { int iVar1; Entity *this; int iVar2; int *in_ECX; uint uVar3; float fVar4; if ((char)in_ECX[0x46] != '\0') { if (*(char *)((int)in_ECX + 0x10d) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0xd)); AnimationState::Update((AnimationState *)(in_ECX + 0x15)); } uVar3 = 0; iVar1 = *in_ECX; in_ECX[0x47] = (int)((float)in_ECX[0x48] + (float)in_ECX[0x49]); in_ECX[0x49] = (int)((float)in_ECX[0x48] + (float)in_ECX[0x49]); if (*(int *)(iVar1 + 0x1264) != 0) { do { this = *(Entity **)(*(int *)(iVar1 + 0x125c) + uVar3 * 4); iVar2 = this->_type; if (iVar2 == 1) { LAB_0083a185: Entity::PlayerCollideWithGrid(this,0); } else { if (iVar2 != 3) { fVar4 = (float)in_ECX[0x48]; if (this->_sortingLayer == 0) { fVar4 = fVar4 * 0.1; } (this->_pos).x = fVar4 + (this->_pos).x; (this->_pos).y = (this->_pos).y + 0.0; if ((iVar2 == 0x3b7) && (this->_variant == 1)) { (this->_targetPosition).x = (float)in_ECX[0x48] + (this->_targetPosition).x; (this->_targetPosition).y = (this->_targetPosition).y + 0.0; } } if (iVar2 == 1) goto LAB_0083a185; } uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)(iVar1 + 0x1264)); } } return; } //@@ 0083a1b0 BeastArena::render_light /* DB: this=Room+0x776c, from Room::render_lighting: draws anm2 layer 16 (light, hell_overlay.png) full screen (beast.md) */ void BeastArena::render_light(void) { int iVar1; char cVar2; uint uVar3; LayerState *this; int *in_ECX; KColor *color; int unused; undefined1 local_d4 [112]; undefined1 local_64 [36]; KColor local_40; float local_2c; int *local_28; int *local_24; Vector local_20; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0266d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_64 + 0x60); ExceptionList = &local_10; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; iVar1 = *in_ECX; local_2c = (((*(float *)(iVar1 + 0x6ae8) - *(float *)(iVar1 + 0x6ae0)) + 52.0) - 480.0) * 0.5 + *(float *)(iVar1 + 0x11fc) + *(float *)(iVar1 + 0x1204) + (g_game->_screenShakeOffset).x + 26.0; local_20.y = (((*(float *)(iVar1 + 0x6aec) - *(float *)(iVar1 + 0x6ae4)) + 52.0) - 270.0) * 0.5 + *(float *)(iVar1 + 0x1200) + *(float *)(iVar1 + 0x1208) + (g_game->_screenShakeOffset).y + 26.0; this = ANM2::GetLayer((ANM2 *)(in_ECX + 1),(byte *)0x10); LayerState::GetTexture(this,&local_28); local_8 = 0; if (local_28 != (int *)0x0) { KColor::SetFromARGB(&local_40,0xffffffff); local_18.x = g_screenWidth; local_18.y = g_screenHeight; render_quad_set_rect(local_d4,&g_vectorZero,&local_18,color); local_20.x = DAT_00c5d170 - local_2c; local_18.x = g_screenWidth; local_18.y = g_screenHeight; local_20.y = DAT_00c5d174 - local_20.y; quad_set_rect(local_64,&local_20,&local_18,unused); (**(code **)(*local_28 + 0x14))(local_64,local_d4,g_drawRectUnset); } local_8 = 1; if (local_24 != (int *)0x0) { cVar2 = (**(code **)(*local_24 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_28); } } ExceptionList = local_10; return; } //@@ 0083a3d0 render_beast_arena_background /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Room::Render only when Room+0x1d18 _backdropType == 0x39 (57 DUNGEON_BEAST); ECX struct holds the Room at [0] (reads Room+0x6ae0 bounds, +0x11fc camera), full-screen render_quad_set_rect with KAGE_ColorTextureShader, "Shader stack empty" */ void render_beast_arena_background(float param_1) { byte *layerName; Game *pGVar1; int *piVar2; char cVar3; LayerState *pLVar4; void *pvVar5; int iVar6; undefined4 *puVar7; int *in_ECX; KColor *color; KColor *color_00; KColor *color_01; KColor *color_02; KColor *color_03; float *pfVar8; float fVar9; float fVar10; float fVar11; float top; uint uVar12; undefined1 *puVar13; KColor *pKVar14; undefined1 local_1d0 [112]; undefined1 local_160 [116]; float local_ec; uint local_e8; float local_e4; uint local_e0; float local_dc; float local_d8; float local_d4; float local_d0; undefined1 local_cc; KColor local_c8; float local_b4; float local_b0; Color local_ac; Vector local_80; uint local_78; int *local_74; ColorMod local_70; float local_44; int *local_40; int *local_3c; KColor local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pGVar1 = g_game; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0269d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; if ((char)in_ECX[0x46] != '\0') { iVar6 = *in_ECX; local_b0 = (float)in_ECX[0x47]; local_44 = (((*(float *)(iVar6 + 0x6ae8) - *(float *)(iVar6 + 0x6ae0)) + 52.0) - 480.0) * 0.5 + *(float *)(iVar6 + 0x1204) + *(float *)(iVar6 + 0x11fc) + (g_game->_screenShakeOffset).x + 26.0; local_b4 = (((*(float *)(iVar6 + 0x6aec) - *(float *)(iVar6 + 0x6ae4)) + 52.0) - 270.0) * 0.5 + *(float *)(iVar6 + 0x1200) + *(float *)(iVar6 + 0x1208) + (g_game->_screenShakeOffset).y + 26.0; local_74 = in_ECX; puVar13 = (undefined1 *)((int)register0x00000010 + -4); if (param_1 == 0.0) { set_blend_mode(&DAT_00c798e0,0); local_38._red = 1.0 - pGVar1->_darknessStrength * pGVar1->_darknessModifier; local_38._unk = (int)param_1; local_38._green = param_1; local_38._blue = param_1; local_38._alpha = 1.0; local_80.x = g_screenWidth; local_80.y = g_screenHeight; render_quad_set_rect(local_160,&g_vectorZero,&local_80,&local_38); render_color_shader_pass(local_160); puVar13 = puStack_20; } puStack_20 = puVar13; shader_push((byte *)"KAGE_ColorTextureShader"); local_78 = 0; local_80.y = (float)(&DAT_00b6d7c0 + (int)param_1 * 0x28); do { piVar2 = local_74; layerName = *(byte **)local_80.y; if ((int)layerName < 0) break; pLVar4 = ANM2::GetLayer((ANM2 *)(local_74 + 1),layerName); g_graphicsManager_blendMode[0] = pLVar4->_blendMode[0]; g_graphicsManager_blendMode[1] = pLVar4->_blendMode[1]; g_graphicsManager_blendMode[2] = pLVar4->_blendMode[2]; g_graphicsManager_blendMode[3] = pLVar4->_blendMode[3]; g_graphicsManager_blendMode[4] = pLVar4->_blendMode[4]; pLVar4 = ANM2::GetLayer((ANM2 *)(piVar2 + 1),layerName); LayerState::GetTexture(pLVar4,&local_40); local_14 = 0; pvVar5 = AnimationState::GetLayerFrame((AnimationState *)(piVar2 + 0xd),(int)layerName); if (local_40 == (int *)0x0) { local_14 = 1; if (local_3c == (int *)0x0) { ExceptionList = local_1c; return; } cVar3 = (**(code **)(*local_3c + 0xc))(); if (cVar3 == '\0') { ExceptionList = local_1c; return; } if (g_imageReleaseFn == (void *)0x0) { ExceptionList = local_1c; return; } (*g_imageReleaseFn)(&local_40); ExceptionList = local_1c; return; } local_ac._tint[0] = *(float *)((int)pvVar5 + 0x30); local_ac._tint[1] = *(float *)((int)pvVar5 + 0x34); local_ac._tint[2] = *(float *)((int)pvVar5 + 0x38); local_ac._tint[3] = *(float *)((int)pvVar5 + 0x3c); local_ac._offset[2] = *(float *)((int)pvVar5 + 0x58); local_ac._colorize[0] = *(float *)((int)pvVar5 + 0x40); local_ac._colorize[1] = *(float *)((int)pvVar5 + 0x44); local_ac._colorize[2] = *(float *)((int)pvVar5 + 0x48); local_ac._colorize[3] = *(float *)((int)pvVar5 + 0x4c); local_70._offset[0] = 0.0; local_70._offset[1] = 0.0; local_ac._offset._0_8_ = *(undefined8 *)((int)pvVar5 + 0x50); local_70._offset[2] = 0.0; local_70._colorize[0] = 0.0; local_70._colorize[1] = 0.0; local_70._colorize[2] = 0.0; local_70._colorize[3] = 0.0; local_70._tint[3] = 1.0; local_70._tint[0] = 1.0 - g_game->_darknessStrength * g_game->_darknessModifier * *(float *)(&DAT_00b6d8a0 + (int)layerName * 4); local_70._tint[1] = local_70._tint[0]; local_70._tint[2] = local_70._tint[0]; Color::__mul(&local_ac,&local_70); uVar12 = 0x80000000; fVar11 = -local_b0 * *(float *)(&DAT_00b6d860 + (int)layerName * 4); top = ((local_b4 + 270.0 + *(float *)((int)pvVar5 + 0x14)) - *(float *)((int)pvVar5 + 0x24)) - 26.0; if (top < g_screenHeight) { if ((layerName == &DAT_00000009) || (layerName == &DAT_0000000b)) { KColor::SetFromARGB(&local_38,0xffffffff); render_quad_set_uniform_color (local_160,0.0,top,g_screenWidth,top + *(float *)((int)pvVar5 + 0xc),color_03); local_70._colorize[1] = *(float *)((int)pvVar5 + 4); local_70._offset[1] = local_70._colorize[1] + *(float *)((int)pvVar5 + 0xc); LAB_0083a963: pKVar14 = &local_38; local_70._offset[2] = (float)CONCAT31(local_70._offset[2]._1_3_,1); local_70._tint[2] = fVar11 - local_44; puVar13 = local_160; local_70._colorize[0] = (fVar11 + g_screenWidth) - local_44; pfVar8 = local_70._tint + 2; iVar6 = *local_40; local_38._unk = 0; local_38._red = local_ac._tint[0]; local_38._green = local_ac._tint[1]; local_38._blue = local_ac._tint[2]; local_38._alpha = local_ac._tint[3]; local_70._tint[3] = local_70._colorize[1]; local_70._colorize[2] = local_70._tint[2]; local_70._colorize[3] = local_70._offset[1]; local_70._offset[0] = local_70._colorize[0]; } else { if ((layerName == (byte *)0xa) || (layerName == (byte *)0xc)) { fVar10 = g_screenHeight; KColor::SetFromARGB(&local_38,0xffffffff); render_quad_set_uniform_color(local_160,0.0,top,g_screenWidth,fVar10,color_02); local_70._offset[1] = g_screenHeight - top; local_70._colorize[1] = 0.0; goto LAB_0083a963; } if (layerName == &DAT_0000000d) { fVar9 = top + 292.0; fVar10 = g_screenHeight; KColor::SetFromARGB(&local_38,0xffffffff); render_quad_set_uniform_color(local_160,0.0,fVar9,g_screenWidth,fVar10,color); local_70._offset[1] = g_screenHeight - top; local_70._colorize[1] = 292.0; goto LAB_0083a963; } if ((layerName == (byte *)0x0) || (layerName == (byte *)0x3)) { fVar9 = top + 69.0; fVar10 = g_screenHeight; KColor::SetFromARGB(&local_38,0xffffffff); render_quad_set_uniform_color(local_160,0.0,fVar9,g_screenWidth,fVar10,color_01); local_70._offset[1] = g_screenHeight - top; local_70._colorize[1] = 69.0; goto LAB_0083a963; } fVar10 = g_screenHeight; KColor::SetFromARGB(&local_c8,0xffffffff); render_quad_set_uniform_color(local_1d0,0.0,0.0,g_screenWidth,fVar10,color_00); pKVar14 = &local_c8; local_d8 = g_screenHeight - top; local_cc = 1; local_ec = fVar11 - local_44; local_e8 = (uint)top ^ uVar12; local_e4 = (fVar11 + g_screenWidth) - local_44; puVar13 = local_1d0; pfVar8 = &local_ec; iVar6 = *local_40; local_c8._unk = 0; local_c8._red = local_ac._tint[0]; local_c8._green = local_ac._tint[1]; local_c8._blue = local_ac._tint[2]; local_c8._alpha = local_ac._tint[3]; local_e0 = local_e8; local_dc = local_ec; local_d4 = local_e4; local_d0 = local_d8; } (**(code **)(iVar6 + 0x14))(pfVar8,puVar13,pKVar14); local_14 = 3; } else { local_14 = 2; } if (((local_3c != (int *)0x0) && (cVar3 = (**(code **)(*local_3c + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_40); } local_14 = 0xffffffff; local_78 = local_78 + 1; local_80.y = (float)((int)local_80.y + 4); } while (local_78 < 10); if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } uVar12 = g_shaderStackSize; puVar7 = (undefined4 *)FUN_00684fc0(); g_shaderStackSize = uVar12 - 1; g_currentShader = (void *)*puVar7; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; if (((byte)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; } ExceptionList = local_1c; return; } //@@ 0083aae0 FUN_0083aae0 void FUN_0083aae0(undefined1 param_1,int *param_2,undefined4 *param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; char cVar4; uint uVar5; void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0e8d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; KAGE::SmartPointer::operator_assign(in_ECX,¶m_1); uVar1 = param_3[1]; uVar2 = param_3[2]; uVar3 = param_3[3]; *(undefined4 *)((int)in_ECX + 8) = *param_3; *(undefined4 *)((int)in_ECX + 0xc) = uVar1; *(undefined4 *)((int)in_ECX + 0x10) = uVar2; *(undefined4 *)((int)in_ECX + 0x14) = uVar3; *(undefined8 *)((int)in_ECX + 0x18) = *(undefined8 *)(param_3 + 4); *(undefined4 *)((int)in_ECX + 0x20) = param_3[6]; local_8 = 1; if (param_2 != (int *)0x0) { cVar4 = (**(code **)(*param_2 + 0xc))(uVar5); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(¶m_1); } } ExceptionList = local_10; return; } //@@ 0083ab80 Entity_Player::GetModelingClayEffect /* ZHL [lua] Lua binding EntityPlayer:GetModelingClayEffect */ int __thiscall Entity_Player::GetModelingClayEffect(Entity_Player *this) { return this->_modelingClayEffect; } //@@ 0083abb0 text_image_cache_clear /* DB: ? for two 0x14-byte records at ECX+4.. resets every 0x28-byte entry's KAGE::SmartPointer, clears the vector and its byte flag, then clears byte +0x28; callers HUD::constructor, mark_all_slots_dirty, 009a19a0, 009a27d0 prototype: db/protos.zhl */ void __thiscall text_image_cache_clear(void *this) { void *pvVar1; void *extraout_ECX; void *extraout_ECX_00; int iVar2; int iVar3; int *piVar4; iVar2 = 2; piVar4 = (int *)((int)this + 0xc); pvVar1 = this; do { iVar3 = piVar4[-1]; if (iVar3 != *piVar4) { do { KAGE::SmartPointer::reset((void *)(iVar3 + 4),(void *)0x0); iVar3 = iVar3 + 0x28; pvVar1 = extraout_ECX; } while (iVar3 != *piVar4); } FUN_00709300(pvVar1); *piVar4 = piVar4[-1]; *(undefined1 *)(piVar4 + -2) = 0; piVar4[-3] = 0; piVar4 = piVar4 + 5; iVar2 = iVar2 + -1; pvVar1 = extraout_ECX_00; } while (iVar2 != 0); *(undefined1 *)((int)this + 0x28) = 0; return; } //@@ 0083ac20 HUD::render_extra_hud /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from HUD::Render under Minimap::GetDisplayedSize with bool mini (icon size 32 or 16, 2 or 1 columns); iterates two vectors (+8/+0xc, +0x1c/+0x20, stride 0x28) of collected item ids, special-cases 0x279 (Dogma), render_quad_set_rect + render_color_shader_pass */ void __thiscall HUD::render_extra_hud(HUD *this,float *param_2,byte param_3) { char cVar1; uint uVar2; uint secondListRows; void *quad; undefined *shader; Vector *position; undefined4 *extraout_EAX; undefined1 *iconQuad; int iVar3; undefined4 *copySrc; undefined4 *copyDst; float itemY; float itemX; float fVar4; float cachedBottomY; float cachedOriginY; double dVar5; undefined1 auStackY_350 [128]; Vector *size; uint *imageRefCount; KColor *color; undefined1 auStack_2b8 [8]; float listX; float iconSize; float originY; uint *local_2a4; Vector local_2a0; uint local_298; float bottomY; Vector local_290; int itemIndex; int listIndex; KColor quadColor [2]; KColor whiteColor; Vector smallIconSize; Vector smallIconPos; Vector bigIconSize; Vector bigIconPos; SourceQuad sourceQuad; undefined4 colorQuad [28]; undefined1 backdropQuad [112]; undefined1 smallIconQuad [112]; undefined1 bigIconQuad [112]; ColorMod shaderColor; uint local_14; uint *itemEntry; int *itemImage; byte shaderFlags; local_14 = __security_cookie ^ (uint)auStack_2b8; originY = param_2[1]; listX = *param_2; iconSize = 16.0; if (param_3 == 0) { iconSize = (float)&DAT_42000000; } uVar2 = (uint)param_3 * 2 + 2; local_2a0.x = (((1.0 - (g_manager->_optionsConfig)._hudOffset) * 14.0 + (g_screenHeight - 64.0)) - originY) / iconSize; local_298 = uVar2; dVar5 = ceil((double)local_2a0.x); bottomY = (float)dVar5 * iconSize + originY; if (originY < bottomY) { if (*(int *)(this->_playerHUD + 0x14) != 0) { listX = listX - 2.0; local_298 = uVar2 >> 1; uVar2 = ((*(int *)(this->_playerHUD + 0xc) - *(int *)(this->_playerHUD + 8)) / 0x28 - 1U) / local_298; secondListRows = ((*(int *)(this->_playerHUD + 0x20) - *(int *)(this->_playerHUD + 0x1c)) / 0x28 - 1U) / local_298; if ((int)(uVar2 + 1) < (int)(secondListRows + 1)) { uVar2 = secondListRows; } iVar3 = uVar2 + 1; if (0 < iVar3) { quadColor[0]._unk = 0; local_290.x = 1.0; local_2a0.y = originY; quadColor[0]._red = 0.5019608; quadColor[0]._green = 0.5019608; quadColor[0]._blue = 0.5019608; quadColor[0]._alpha = 0.5019608; if ((int)dVar5 < iVar3) { iVar3 = (int)dVar5; } local_290.y = (float)iVar3 * iconSize; local_2a0.x = listX + 32.0; render_quad_set_rect(backdropQuad,&local_2a0,&local_290,quadColor); render_color_shader_pass(quad); } } local_2a0.x = (float)(this->_playerHUD + 0xc); listIndex = 0; fVar4 = iconSize; cachedBottomY = bottomY; cachedOriginY = originY; do { if (*(int *)((HUD *)((int)local_2a0.x + -0xc))->_playerHUD == 0) break; local_2a4 = *(uint **)((int)local_2a0.x + -4); itemIndex = 0; if (local_2a4 != *(uint **)local_2a0.x) { do { quadColor[0]._unk = 0; quadColor[0]._red = 1.0; quadColor[0]._green = 1.0; quadColor[0]._blue = 1.0; quadColor[0]._alpha = 0.5; itemY = (float)(itemIndex / (int)local_298) * fVar4 + cachedOriginY; itemX = (float)(itemIndex % (int)local_298) * fVar4 + listX; if (cachedBottomY <= itemY) break; uVar2 = *local_2a4; shaderColor._offset[0] = 0.0; shaderColor._offset[1] = 0.0; shaderColor._offset[2] = 0.0; shaderColor._tint[0] = 1.0; shaderColor._tint[1] = 1.0; shaderColor._tint[2] = 1.0; shaderColor._tint[3] = 1.0; shaderColor._colorize[0] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._colorize[2] = 0.0; shaderColor._colorize[3] = 0.0; if (uVar2 == 0x279) { shader = &DAT_00c791b8; shaderFlags = DAT_00c791bc; LAB_0083aeee: if ((shaderFlags & 1) == 0) { shader = g_currentShader; } uVar2 = g_manager->_framecount / 2 & 0x800000ff; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xffffff00) + 1; } shaderColor._colorize[3] = (float)(int)uVar2 * 0.00390625; g_currentShader = shader; } else { if ((0 < (int)uVar2) && ((uVar2 & 0x88000) == 0x88000)) { shader = &DAT_00c79208; shaderFlags = DAT_00c7920c; goto LAB_0083aeee; } shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } g_currentShader = shader; } sourceQuad._topLeft.x = g_vectorZero.x; if (((char)local_2a4[4] != '\0') && (local_2a4[5] == 0x14)) { sourceQuad._topLeft.x = g_vectorZero.x + (float)(3 - *(int *)(*(int *)((HUD *)((int)local_2a0.x + -0xc))->_playerHUD + 0x1394)) * 32.0; } sourceQuad._topRight.y = g_vectorZero.y; sourceQuad._topRight.x = sourceQuad._topLeft.x + 32.0; sourceQuad._topLeft.y = g_vectorZero.y; sourceQuad._bottomLeft.y = g_vectorZero.y + 32.0; sourceQuad._coordinateSpace._0_1_ = 1; whiteColor._unk = 0; whiteColor._red = 1.0; whiteColor._green = 1.0; whiteColor._blue = 1.0; whiteColor._alpha = 1.0; sourceQuad._bottomLeft.x = sourceQuad._topLeft.x; sourceQuad._bottomRight.x = sourceQuad._topRight.x; sourceQuad._bottomRight.y = sourceQuad._bottomLeft.y; ColorQuad::ColorQuad(colorQuad,&whiteColor); whiteColor._unk = 0; whiteColor._red = 1.0; whiteColor._green = 1.0; whiteColor._blue = 1.0; whiteColor._alpha = 1.0; itemX = itemX + (g_game->_screenShakeOffset).x; itemY = itemY + (g_game->_screenShakeOffset).y; color = &whiteColor; if (param_3 == 0) { size = &bigIconSize; bigIconSize.x = (float)&DAT_42000000; bigIconSize.y = (float)&DAT_42000000; position = &bigIconPos; iconQuad = bigIconQuad; bigIconPos.x = itemX; bigIconPos.y = itemY; } else { size = &smallIconSize; smallIconSize.x = 16.0; smallIconSize.y = 16.0; position = &smallIconPos; iconQuad = smallIconQuad; smallIconPos.x = itemX; smallIconPos.y = itemY; } render_quad_set_rect(iconQuad,position,size,color); itemEntry = local_2a4; copySrc = extraout_EAX; copyDst = colorQuad; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *copyDst = *copySrc; copySrc = copySrc + 1; copyDst = copyDst + 1; } if (local_2a4[1] == 0) { if ((int)*local_2a4 < 0) { local_290.x = (float)(auStackY_350 + 0x88); KAGE::SmartPointer::operator_assign (auStackY_350 + 0x88,&(g_game->_proceduralItemManager)._renderTarget); apply_sprite_shader_params(&shaderColor,1,size,color); GlitchedCollectibleGfx::render_item (&g_game->_proceduralItemManager,*itemEntry,&sourceQuad,colorQuad,quadColor) ; goto LAB_0083b1fb; } } else { if ((char)local_2a4[4] != '\0') { if ((local_2a4[5] & 0x7fff) == 0x4b) { quadColor[0]._red = 0.5176471; quadColor[0]._green = 0.101960786; quadColor[0]._blue = 0.101960786; quadColor[0]._alpha = 0.5019608; quadColor[0]._unk = 0; } else if ((local_2a4[5] & 0x7fff) == 0xa6) { shaderColor._colorize[0] = 0.5976471; shaderColor._colorize[1] = 0.33411765; shaderColor._colorize[2] = 0.31058824; shaderColor._colorize[3] = 1.0; } } iconQuad = (undefined1 *)0x0; imageRefCount = (uint *)0x0; itemImage = (int *)local_2a4[2]; local_290.x = (float)local_2a4[1]; local_2a4 = (uint *)itemImage; if (itemImage != (int *)0x0) { cVar1 = (**(code **)(*itemImage + 4))(); if (cVar1 != '\0') { if (imageRefCount != (uint *)0x0) { cVar1 = (**(code **)(*imageRefCount + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStackY_350 + 0x88); } } iconQuad = (undefined1 *)local_290.x; imageRefCount = local_2a4; } } apply_sprite_shader_params(&shaderColor,1,iconQuad,imageRefCount); (**(code **)(*(int *)itemEntry[1] + 0x14))(&sourceQuad); LAB_0083b1fb: fVar4 = iconSize; cachedBottomY = bottomY; cachedOriginY = originY; } local_2a4 = itemEntry + 10; itemIndex = itemIndex + 1; } while (local_2a4 != *(uint **)local_2a0.x); } listX = listX + 33.0; local_2a0.x = (float)((int)local_2a0.x + 0x14); listIndex = listIndex + 1; } while (listIndex < 2); shader_cache_find((int)local_2a0.x); } return; } //@@ 0083b280 HUD::rebuild_player_item_icons /* DB: ? thiscall (hudIdx<2, bool rebuild): for _playerHUD[idx] (0x14 stride) clears its icon vector then walks the player's collectible history (player +0x1dec..+0x1df0, 0x1c entries, backwards) resolving collectibles/trinkets (0x8000 golden, trinket 0x4b seeded random) to ItemConfig and SmartPointer images; HUD::update_player_hud_slots, HUD::PostUpdate prototype: db/protos.zhl, confirmed by RET 8 */ void HUD::rebuild_player_item_icons(void *iconCaches,uint playerIdx,byte isRebuild) { char cVar1; RoomDescriptor *room; uint seed; void *pvVar2; std_string *path; int *piVar3; undefined4 *iconIt; int historyIt; uint trinketId; int *cacheKey; undefined4 uStack_160; int *local_140; int *local_11c; int *local_f8; undefined1 local_d4 [4]; int *local_d0; undefined4 local_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 local_bc; undefined4 uStack_b8; undefined4 local_b4; int local_b0; undefined1 local_ac [4]; int *local_a8; undefined4 local_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 local_94; undefined4 uStack_90; undefined4 local_8c; int local_88; undefined1 local_84 [4]; int *local_80; undefined4 local_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 local_6c; undefined4 uStack_68; undefined4 local_64; int *playerHud; undefined4 local_58; undefined1 local_54 [4]; int *local_50; int image; int *local_48; int *icons; int *oldImagesHead; int *local_38; int *local_34; int *local_30; ItemConfig_Item *itemConfig; uint *historyEntry; char isTrinket; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; puStack_20 = local_54 + 0x50; local_14 = 0xffffffff; puStack_18 = &LAB_00b0272c; local_1c = ExceptionList; ExceptionList = &local_1c; if (playerIdx < 2) { piVar3 = (int *)((int)iconCaches + playerIdx * 0x14); local_38 = (int *)*piVar3; if (local_38 != (int *)0x0) { if (isRebuild == 0) { *(undefined1 *)(piVar3 + 1) = 1; } else { playerHud = piVar3; FUN_0083bf50(); icons = piVar3 + 2; local_14 = 0; iconIt = (undefined4 *)*icons; if (iconIt != (undefined4 *)piVar3[3]) { do { if (iconIt[1] != 0) { local_58 = *iconIt; KAGE::SmartPointer::operator_assign(local_54,iconIt + 1); local_14._0_1_ = 1; uStack_160 = 0x83b33b; FUN_0083c320(); local_14._0_1_ = 2; if (((local_50 != (int *)0x0) && (cVar1 = (**(code **)(*local_50 + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14 = (uint)local_14._1_3_ << 8; } iconIt = iconIt + 10; } while (iconIt != (undefined4 *)piVar3[3]); } FUN_00709300(); piVar3[3] = piVar3[2]; historyIt = *(int *)((int)local_38 + 0x1df0); if (historyIt != *(int *)((int)local_38 + 0x1dec)) { historyEntry = (uint *)(historyIt + -0x14); do { isTrinket = (char)historyEntry[-1]; if (isTrinket == '\0') { local_30 = (int *)*historyEntry; LAB_0083b473: trinketId = 0; itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_30); piVar3 = local_30; } else { trinketId = *historyEntry; piVar3 = (int *)0x0; if ((trinketId & 0x7fff) == 0x4b) { uStack_160 = 0x83b3d1; room = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); seed = room->SpawnSeed; if (seed != 0) { seed = seed >> 2 ^ seed; seed = seed << 7 ^ seed; trinketId = (seed >> 0x19 ^ seed) % 0xbd + 1 | *historyEntry & 0x8000; } piVar3 = (int *)0x0; } else if ((trinketId & 0x7fff) == 0xa6) { piVar3 = *(int **)((int)local_38 + 0x1fb8); local_30 = piVar3; if (piVar3 != (int *)0x0) { isTrinket = '\0'; goto LAB_0083b473; } } local_34 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(trinketId & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)local_34 >> 2) { itemConfig = (ItemConfig_Item *)local_34[trinketId & 0x7fff]; } else { itemConfig = (ItemConfig_Item *)0x0; } } if ((itemConfig != (ItemConfig_Item *)0x0) && (itemConfig->type != 3)) { if (itemConfig->id < 0) { KAGE::SmartPointer::SmartPointer(&uStack_160,(void *)0x0); pvVar2 = (void *)FUN_0083aae0(); local_14._0_1_ = 3; local_88 = itemConfig->id; KAGE::SmartPointer::operator_assign(local_84,pvVar2); local_7c = *(undefined4 *)((int)pvVar2 + 8); uStack_78 = *(undefined4 *)((int)pvVar2 + 0xc); uStack_74 = *(undefined4 *)((int)pvVar2 + 0x10); uStack_70 = *(undefined4 *)((int)pvVar2 + 0x14); local_6c = *(undefined4 *)((int)pvVar2 + 0x18); uStack_68 = *(undefined4 *)((int)pvVar2 + 0x1c); local_64 = *(undefined4 *)((int)pvVar2 + 0x20); local_14._0_1_ = 4; FUN_0083bf90(); local_14._0_1_ = 5; if (((local_80 != (int *)0x0) && (cVar1 = (**(code **)(*local_80 + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 6; if (local_f8 != (int *)0x0) { cVar1 = (**(code **)(*local_f8 + 0xc))(); joined_r0x0083b790: if ((cVar1 != '\0') && (g_imageReleaseFn != (code *)0x0)) { (*g_imageReleaseFn)(); } } } else { cacheKey = (int *)(trinketId | 0x80000); if (isTrinket == '\0') { cacheKey = piVar3; } uStack_160 = 0x83b587; local_34 = cacheKey; std::set::find_node(); if ((*(char *)((int)local_50 + 0xd) != '\0') || (local_30 = local_50, (int)cacheKey < local_50[4])) { local_30 = oldImagesHead; } if (local_30 != oldImagesHead) { KAGE::SmartPointer::operator_assign(&uStack_160,local_30 + 5); pvVar2 = (void *)FUN_0083aae0(); local_14._0_1_ = 7; local_b0 = local_30[4]; KAGE::SmartPointer::operator_assign(local_ac,pvVar2); local_a4 = *(undefined4 *)((int)pvVar2 + 8); uStack_a0 = *(undefined4 *)((int)pvVar2 + 0xc); uStack_9c = *(undefined4 *)((int)pvVar2 + 0x10); uStack_98 = *(undefined4 *)((int)pvVar2 + 0x14); local_94 = *(undefined4 *)((int)pvVar2 + 0x18); uStack_90 = *(undefined4 *)((int)pvVar2 + 0x1c); local_8c = *(undefined4 *)((int)pvVar2 + 0x20); local_14._0_1_ = 8; FUN_0083bf90(); local_14._0_1_ = 9; if (((local_a8 != (int *)0x0) && (cVar1 = (**(code **)(*local_a8 + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 10; if (((local_11c != (int *)0x0) && (cVar1 = (**(code **)(*local_11c + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14 = (uint)local_14._1_3_ << 8; uStack_160 = 0x83b686; FUN_00414d60(); goto LAB_0083b7a8; } path = &itemConfig->gfxFilename; if (0xf < (itemConfig->gfxFilename)._capacity) { path = *(std_string **)path->_buf; } uStack_160 = 0x83b6a3; Manager::LoadImage(&image,(byte *)path); local_14._0_1_ = 0xb; if (image != 0) { KAGE::SmartPointer::operator_assign(&uStack_160,&image); pvVar2 = (void *)FUN_0083aae0(); local_14._0_1_ = 0xc; KAGE::SmartPointer::operator_assign(local_d4,pvVar2); local_cc = *(undefined4 *)((int)pvVar2 + 8); uStack_c8 = *(undefined4 *)((int)pvVar2 + 0xc); uStack_c4 = *(undefined4 *)((int)pvVar2 + 0x10); uStack_c0 = *(undefined4 *)((int)pvVar2 + 0x14); local_bc = *(undefined4 *)((int)pvVar2 + 0x18); uStack_b8 = *(undefined4 *)((int)pvVar2 + 0x1c); local_b4 = *(undefined4 *)((int)pvVar2 + 0x20); local_14._0_1_ = 0xd; FUN_0083bf90(); local_14._0_1_ = 0xe; if (((local_d0 != (int *)0x0) && (cVar1 = (**(code **)(*local_d0 + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 0xf; if (((local_140 != (int *)0x0) && (cVar1 = (**(code **)(*local_140 + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_14._0_1_ = 0x10; if (local_48 != (int *)0x0) { cVar1 = (**(code **)(*local_48 + 0xc))(); goto joined_r0x0083b790; } } local_14 = (uint)local_14._1_3_ << 8; } LAB_0083b7a8: historyIt = historyIt + -0x1c; historyEntry = historyEntry + -7; } while (historyIt != *(int *)((int)local_38 + 0x1dec)); piVar3 = playerHud; } local_38 = (int *)*oldImagesHead; if (local_38 != oldImagesHead) { do { KAGE::SmartPointer::reset(local_38 + 5,(void *)0x0); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_38); } while (local_38 != oldImagesHead); } *(undefined1 *)(piVar3 + 1) = 0; uStack_160 = 0x83b800; std::map::_Erase_tree(); uStack_160 = 0x83b80a; operator_delete(oldImagesHead,0x1c); } } } ExceptionList = local_1c; return; } //@@ 0083b830 FUN_0083b830 void FUN_0083b830(void) { int *in_ECX; std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x1c); return; } //@@ 0083b850 HUD::update_player_hud_slots /* WARNING: Type propagation algorithm not settling */ /* DB: ? thiscall HUD: for the player HUD slots (from +0x14), drops a slot whose player no longer resolves (FUN_0083bbc0 < 0) and shifts the following slots down; logs "PlayerManager::GetPlayer() : There are no players!"; callers HUD::PostUpdate, mark_all_slots_dirty */ void __thiscall HUD::update_player_hud_slots(HUD *this,byte param_2) { void *pvVar1; char isLastRef; int iVar2; byte *pbVar3; uint uVar4; int *piVar5; uint hudSlot; void *pvVar6; int *ptr; HUD *pHVar7; PlayerManager *playerManager; byte *entry; byte isRebuild; void *movedImagesBegin; void *movedImagesEnd; int local_34; uint slotIndex; HUD *slotEntry; uint shiftIndex; int movedImagesCapacity; void *local_20; byte *local_1c; HUD *hud; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *imagesBegin; local_8 = 0xffffffff; puStack_c = &LAB_00b02750; local_10 = ExceptionList; ExceptionList = &local_10; slotEntry = (HUD *)(this->_playerHUD + 0x14); slotIndex = 2; hud = this; do { pHVar7 = slotEntry; uVar4 = slotIndex; if (*(int *)slotEntry->_playerHUD != 0) { iVar2 = FUN_0083bbc0(*(int *)slotEntry->_playerHUD); if (iVar2 < 0) { *(int *)pHVar7->_playerHUD = 0; shiftIndex = uVar4; if (uVar4 < 2) { local_1c = pHVar7->_playerHUD + 0x10; do { entry = local_1c; local_11 = local_1c[-0xc]; pbVar3 = local_1c + 0xc; iVar2 = *(int *)((HUD *)(local_1c + -0x10))->_playerHUD; local_34 = *(int *)local_1c; local_1c[0] = 0; local_1c[1] = 0; local_1c[2] = 0; local_1c[3] = 0; pvVar6 = *(void **)(local_1c + -4); local_1c[-0xffffffff00000004] = 0; local_1c[-0xffffffff00000003] = 0; local_1c[-0xffffffff00000002] = 0; local_1c[-0xffffffff00000001] = 0; imagesBegin = *(void **)(local_1c + -8); local_1c[-0xffffffff00000008] = 0; local_1c[-0xffffffff00000007] = 0; local_1c[-0xffffffff00000006] = 0; local_1c[-0xffffffff00000005] = 0; *(int *)((HUD *)(local_1c + -0x10))->_playerHUD = *(int *)(local_1c + 4); local_1c[-0xc] = local_1c[8]; if (local_1c + -8 != pbVar3) { *(int *)(local_1c + -8) = *(int *)pbVar3; *(int *)(local_1c + -4) = *(int *)(local_1c + 0x10); *(int *)local_1c = *(int *)(local_1c + 0x14); pbVar3[0] = 0; pbVar3[1] = 0; pbVar3[2] = 0; pbVar3[3] = 0; local_1c[0x10] = 0; local_1c[0x11] = 0; local_1c[0x12] = 0; local_1c[0x13] = 0; local_1c[0x14] = 0; local_1c[0x15] = 0; local_1c[0x16] = 0; local_1c[0x17] = 0; } local_1c[8] = local_11; *(int *)(local_1c + 4) = iVar2; movedImagesBegin = imagesBegin; movedImagesEnd = pvVar6; movedImagesCapacity = local_34; local_20 = pvVar6; if ((void **)(local_1c + 0xc) == &movedImagesBegin) { if (imagesBegin != (void *)0x0) { if (imagesBegin != pvVar6) { iVar2 = (int)imagesBegin + 4; do { local_8 = 2; if (((*(int **)(iVar2 + 4) != (int *)0x0) && (isLastRef = (**(code **)(**(int **)(iVar2 + 4) + 0xc))(), isLastRef != '\0' )) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(iVar2); } local_8 = 0xffffffff; pvVar1 = (void *)(iVar2 + 0x24); iVar2 = iVar2 + 0x28; } while (pvVar1 != pvVar6); } entry = local_1c; uVar4 = ((movedImagesCapacity - (int)imagesBegin) / 0x28) * 0x28; pvVar6 = imagesBegin; if (0xfff < uVar4) { pvVar6 = *(void **)((int)imagesBegin + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)imagesBegin + (-4 - (int)pvVar6))) goto LAB_0083bba5; } operator_delete(pvVar6,uVar4); goto LAB_0083ba90; } } else { piVar5 = *(int **)(local_1c + 0xc); if (piVar5 != (int *)0x0) { pbVar3 = *(byte **)(local_1c + 0x10); local_1c = pbVar3; if ((byte *)piVar5 != pbVar3) { do { local_8 = 1; if ((int *)piVar5[2] != (int *)0x0) { isLastRef = (**(code **)(*(int *)piVar5[2] + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(piVar5 + 1); } pbVar3 = local_1c; } piVar5 = piVar5 + 10; local_8 = 0xffffffff; } while ((byte *)piVar5 != pbVar3); piVar5 = *(int **)(entry + 0xc); } uVar4 = ((*(int *)(entry + 0x14) - (int)piVar5) / 0x28) * 0x28; ptr = piVar5; if (0xfff < uVar4) { ptr = (int *)piVar5[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)piVar5 + (-4 - (int)ptr))) { LAB_0083bba5: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } *(void **)(entry + 0x10) = local_20; *(void **)(entry + 0xc) = imagesBegin; *(int *)(entry + 0x14) = movedImagesCapacity; LAB_0083ba90: local_34 = 0; movedImagesEnd = (void *)0x0; movedImagesBegin = (void *)0x0; local_1c = entry; } local_1c = local_1c + 0x14; shiftIndex = shiftIndex + 1; uVar4 = slotIndex; pHVar7 = slotEntry; } while ((int)shiftIndex < 2); } } } slotIndex = uVar4 - 1; slotEntry = (HUD *)&pHVar7[0xffffffff].field_0x5c44; if ((int)slotIndex < 1) { uVar4 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; if ((int)pvVar6 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (playerManager->_playerList)._end; } piVar5 = (playerManager->_playerList)._begin; if (uVar4 < (uint)((int)pvVar6 - (int)piVar5 >> 2)) { piVar5 = piVar5 + uVar4; } iVar2 = *piVar5; isRebuild = param_2; hudSlot = FUN_0083bbc0(iVar2); rebuild_player_item_icons(hud,hudSlot,isRebuild); if ((((*(int *)(iVar2 + 0x1e6c) != 0) && ((*(int *)(iVar2 + 0x13c0) == 0x1d || (*(int *)(iVar2 + 0x13c0) == 0x26)))) && (hudSlot = FUN_0083bbc0(*(int *)(iVar2 + 0x1e6c)), hudSlot < 2)) && (*(int *)(hud->_playerHUD + hudSlot * 0x14) != 0)) { hud->_playerHUD[hudSlot * 0x14 + 4] = 1; } uVar4 = uVar4 + 1; playerManager = &g_game->_playerManager; } while (uVar4 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } ExceptionList = local_10; return; } } while( true ); } //@@ 0083bbc0 FUN_0083bbc0 int FUN_0083bbc0(int param_1) { byte bVar1; int iVar2; int *in_ECX; int iVar3; int *piVar4; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(param_1 + 0x1618)), bVar1 == 0)) { return -1; } if (((*(int *)(param_1 + 0x2c) != 0) || (*(int *)(param_1 + 0x3bc) != 0)) || (*(int *)(param_1 + 0x13c0) == 0x28)) { return -1; } iVar2 = -1; iVar3 = 0; piVar4 = in_ECX; do { if (*piVar4 == param_1) { return iVar3; } if ((*piVar4 == 0) && (iVar2 < 0)) { iVar2 = iVar3; } iVar3 = iVar3 + 1; piVar4 = piVar4 + 5; } while (iVar3 < 2); if (-1 < iVar2) { in_ECX[iVar2 * 5] = param_1; } return iVar2; } //@@ 0083bc50 PlayerManager::remove_coplayer_slot /* DB: ? called from PlayerManager::RemoveCoPlayer with the player; ECX = 5-dword slot array at Manager+0x1da04: finds the slot whose [0]==player, zeroes it and shifts the rest down */ void PlayerManager::remove_coplayer_slot(int param_1) { char isLastRef; uint uVar1; int iVar2; uint uVar3; int *in_ECX; int *piVar4; void *pvVar5; void *pvVar6; int *entry; int local_30 [3]; int swappedPlayer; int *slotCursor; int imagesCapacity; void *imagesEnd; int slotIndex; void *local_10; undefined1 *puStack_c; int local_8; void *imagesBegin; pvVar5 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00b02770; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_30 + 0xb); iVar2 = 0; piVar4 = in_ECX; while (slotIndex = iVar2 + 1, *piVar4 != param_1) { piVar4 = piVar4 + 5; iVar2 = slotIndex; if (1 < slotIndex) { return; } } ExceptionList = &local_10; in_ECX[iVar2 * 5] = 0; if (1 < slotIndex) { ExceptionList = pvVar5; return; } slotCursor = in_ECX + slotIndex * 5 + -1; do { entry = slotCursor; swappedPlayer = slotCursor[-4]; piVar4 = slotCursor + 3; iVar2 = slotCursor[-3]; imagesCapacity = *slotCursor; *slotCursor = 0; pvVar5 = (void *)slotCursor[-1]; slotCursor[-1] = 0; imagesBegin = (void *)slotCursor[-2]; slotCursor[-2] = 0; slotCursor[-4] = slotCursor[1]; *(char *)(slotCursor + -3) = (char)slotCursor[2]; if (slotCursor + -2 != piVar4) { slotCursor[-2] = *piVar4; slotCursor[-1] = slotCursor[4]; *slotCursor = slotCursor[5]; *piVar4 = 0; slotCursor[4] = 0; slotCursor[5] = 0; } slotCursor[1] = swappedPlayer; *(char *)(slotCursor + 2) = (char)iVar2; imagesEnd = pvVar5; if (slotCursor + 3 == local_30) { iVar2 = slotIndex; if (imagesBegin != (void *)0x0) { if (imagesBegin != pvVar5) { iVar2 = (int)imagesBegin + 4; do { local_8 = 2; if (((*(int **)(iVar2 + 4) != (int *)0x0) && (isLastRef = (**(code **)(**(int **)(iVar2 + 4) + 0xc))(uVar1), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(iVar2); } local_8 = 0xffffffff; pvVar6 = (void *)(iVar2 + 0x24); iVar2 = iVar2 + 0x28; } while (pvVar6 != pvVar5); } iVar2 = slotIndex; entry = slotCursor; uVar3 = ((imagesCapacity - (int)imagesBegin) / 0x28) * 0x28; pvVar5 = imagesBegin; if (0xfff < uVar3) { pvVar5 = *(void **)((int)imagesBegin + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)imagesBegin + (-4 - (int)pvVar5))) goto LAB_0083beb7; } operator_delete(pvVar5,uVar3); } } else { pvVar5 = (void *)slotCursor[3]; if (pvVar5 != (void *)0x0) { pvVar6 = (void *)slotCursor[4]; if (pvVar5 != pvVar6) { do { local_8 = 1; if (((*(int **)((int)pvVar5 + 8) != (int *)0x0) && (isLastRef = (**(code **)(**(int **)((int)pvVar5 + 8) + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)pvVar5 + 4); } pvVar5 = (void *)((int)pvVar5 + 0x28); local_8 = 0xffffffff; } while (pvVar5 != pvVar6); pvVar5 = (void *)entry[3]; } uVar3 = ((entry[5] - (int)pvVar5) / 0x28) * 0x28; pvVar6 = pvVar5; if (0xfff < uVar3) { pvVar6 = *(void **)((int)pvVar5 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)pvVar6))) { LAB_0083beb7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar3); } entry[4] = (int)imagesEnd; entry[3] = (int)imagesBegin; entry[5] = imagesCapacity; iVar2 = slotIndex; } slotIndex = iVar2 + 1; slotCursor = entry + 5; if (1 < slotIndex) { ExceptionList = local_10; return; } } while( true ); } //@@ 0083bed0 FUN_0083bed0 void FUN_0083bed0(int param_1,int param_2) { int iVar1; uint uVar2; int *in_ECX; uVar2 = 0; do { if (*in_ECX == param_1) { *in_ECX = param_2; iVar1 = param_2; joined_r0x0083bf1a: if ((uVar2 < 2) && (iVar1 != 0)) { *(undefined1 *)(in_ECX + 1) = 1; } } else if (*in_ECX == param_2) { *in_ECX = param_1; iVar1 = param_1; goto joined_r0x0083bf1a; } uVar2 = uVar2 + 1; in_ECX = in_ECX + 5; if (1 < uVar2) { return; } } while( true ); } //@@ 0083bf50 FUN_0083bf50 void FUN_0083bf50(void) { void *pvVar1; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x1c); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *in_ECX = pvVar1; return; } //@@ 0083bf90 FUN_0083bf90 void FUN_0083bf90(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<40byte>::_Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; KAGE::SmartPointer::operator_assign(puVar1 + 1,param_1 + 1); uVar2 = param_1[4]; uVar3 = param_1[5]; uVar4 = param_1[6]; puVar1[3] = param_1[3]; puVar1[4] = uVar2; puVar1[5] = uVar3; puVar1[6] = uVar4; *(undefined8 *)(puVar1 + 7) = *(undefined8 *)(param_1 + 7); puVar1[9] = param_1[9]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x28; return; } //@@ 0083bff0 std::vector<40byte>::_Emplace_reallocate /* DB: MSVC vector growth for 0x28-byte elements: max_size 0x6666666, std::_Xlen, 1.5x capacity, std::_Allocate, copy-constructs the inserted element (KAGE::SmartPointer::operator_assign members) and moves the old range; caller push_back 0083bf90 */ undefined4 * std::vector<40byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; void *pvVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; uint uVar9; undefined4 *puVar10; int *in_ECX; uint uVar11; undefined4 *puVar12; undefined4 *puVar13; void *ptr; uint local_2c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b027bd; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0x28; if (iVar5 == 0x6666666) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar9 = iVar5 + 1; uVar11 = (in_ECX[2] - *in_ECX) / 0x28; if (0x6666666 - (uVar11 >> 1) < uVar11) { local_2c = 0x6666666; } else { uVar11 = (uVar11 >> 1) + uVar11; local_2c = uVar9; if (uVar9 <= uVar11) { local_2c = uVar11; } if (0x6666666 < local_2c) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar10 = _Allocate(local_2c * 0x28); local_8 = 0; puVar1 = puVar10 + (((int)param_1 - iVar2) / 0x28) * 10; *puVar1 = *param_2; KAGE::SmartPointer::operator_assign(puVar1 + 1,param_2 + 1); uVar6 = param_2[4]; uVar7 = param_2[5]; uVar8 = param_2[6]; puVar1[3] = param_2[3]; puVar1[4] = uVar6; puVar1[5] = uVar7; puVar1[6] = uVar8; *(undefined8 *)(puVar1 + 7) = *(undefined8 *)(param_2 + 7); puVar1[9] = param_2[9]; puVar3 = (undefined4 *)in_ECX[1]; puVar13 = (undefined4 *)*in_ECX; if (param_1 == puVar3) { local_8 = CONCAT31(local_8._1_3_,1); puVar12 = puVar10; for (; puVar13 != puVar3; puVar13 = puVar13 + 10) { *puVar12 = *puVar13; KAGE::SmartPointer::operator_assign(puVar12 + 1,puVar13 + 1); uVar6 = puVar13[4]; uVar7 = puVar13[5]; uVar8 = puVar13[6]; puVar12[3] = puVar13[3]; puVar12[4] = uVar6; puVar12[5] = uVar7; puVar12[6] = uVar8; *(undefined8 *)(puVar12 + 7) = *(undefined8 *)(puVar13 + 7); puVar12[9] = puVar13[9]; puVar12 = puVar12 + 10; } FUN_00709300(puVar3); } else { FUN_0083c270(puVar13,param_1,puVar10); FUN_0083c270(param_1,in_ECX[1],puVar1 + 10); } if (*in_ECX != 0) { FUN_00709300(*in_ECX); pvVar4 = (void *)*in_ECX; uVar11 = ((in_ECX[2] - (int)pvVar4) / 0x28) * 0x28; ptr = pvVar4; if (0xfff < uVar11) { ptr = *(void **)((int)pvVar4 + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar11); } *in_ECX = (int)puVar10; in_ECX[1] = (int)(puVar10 + uVar9 * 10); in_ECX[2] = (int)(puVar10 + local_2c * 10); ExceptionList = local_10; return puVar1; } //@@ 0083c241 Catch_All@0083c241 void Catch_All_0083c241(void) { int unaff_EBP; FUN_00709010(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x30)); deallocate(*(void **)(unaff_EBP + -0x14),*(uint *)(unaff_EBP + -0x2c)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0083c270 FUN_0083c270 undefined4 * FUN_0083c270(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; void **ppvVar4; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b027ed; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar4 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar4, param_1 != param_2; param_1 = param_1 + 10) { *param_3 = *param_1; KAGE::SmartPointer::operator_assign(param_3 + 1,param_1 + 1); uVar1 = param_1[4]; uVar2 = param_1[5]; uVar3 = param_1[6]; param_3[3] = param_1[3]; param_3[4] = uVar1; param_3[5] = uVar2; param_3[6] = uVar3; *(undefined8 *)(param_3 + 7) = *(undefined8 *)(param_1 + 7); param_3[9] = param_1[9]; ppvVar4 = ExceptionList; param_3 = param_3 + 10; } FUN_00709300(param_1,uVar5); ExceptionList = local_10; return param_3; } //@@ 0083c320 FUN_0083c320 void FUN_0083c320(int *param_1,int *param_2) { undefined8 uVar1; undefined4 uVar2; uint uVar3; undefined8 *puVar4; undefined4 *newNode; void *pvVar5; undefined4 *in_ECX; undefined1 uVar6; void *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02825; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined8 *)std::set::find_node(local_1c,param_2); pvVar5 = *(void **)(puVar4 + 1); uVar1 = *puVar4; if ((*(char *)((int)pvVar5 + 0xd) == '\0') && (*(int *)((int)pvVar5 + 0x10) <= *param_2)) { uVar6 = 0; } else { if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } uVar2 = *in_ECX; local_8 = 0; local_14 = (undefined4 *)0x0; newNode = operator_new(0x1c); local_8 = 1; newNode[4] = *param_2; local_14 = newNode; KAGE::SmartPointer::operator_assign(newNode + 5,param_2 + 1); iStack_24 = (int)((ulonglong)uVar1 >> 0x20); *newNode = uVar2; local_28 = (void *)uVar1; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; pvVar5 = std::_Tree::_Insert_node(in_ECX,local_28,iStack_24,newNode); uVar6 = 1; } *param_1 = (int)pvVar5; *(undefined1 *)(param_1 + 1) = uVar6; ExceptionList = local_10; return; } //@@ 0083c400 FUN_0083c400 void FUN_0083c400(void) { char cVar1; void *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)((int)in_EDX + 0x18) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)in_EDX + 0x18) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)in_EDX + 0x14); } } operator_delete(in_EDX,0x1c); ExceptionList = local_10; return; } //@@ 0083c480 FUN_0083c480 void FUN_0083c480(void) { FUN_00709300(); return; } //@@ 0083c490 ItemPool::IsPillIdentified /* ZHL [exact] __thiscall bool ItemPool::IsPillIdentified(uint32_t pillColor); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall ItemPool::IsPillIdentified(ItemPool *this,uint pillColor) { uint uVar1; uint uVar2; uVar2 = -(uint)((pillColor & 0x7ff) != 0) & pillColor & 0x7ff; uVar1 = 0xe; if (uVar2 < 0xe) { uVar1 = uVar2; } return *(byte *)((int)&this[1]._pools[1]._poolList._begin + uVar1); } //@@ 0083c4c0 FUN_0083c4c0 void FUN_0083c4c0(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02850; local_10 = ExceptionList; ExceptionList = &local_10; RichText::~RichText((void *)(in_ECX + 900)); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x264)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x2b4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x294)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x27c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x264)); SharedPtrPair::~SharedPtrPair((void *)(in_ECX + 0x238)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x124)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x174)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x154)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x13c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x124)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x10)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x60)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x40)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x28)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); local_8 = 3; if (*(int **)(in_ECX + 0xc) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0xc) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 8); } } ExceptionList = local_10; return; } //@@ 0083c5f0 HUD::load_item_info_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX = HUD+0x5c80 (FUN_009a1970: HUD::LoadGraphics, FUN_009a19a0, then LEA ECX,[ESI+0x5c80]; same object as HUD::update_item_info 0083c8d0): loads font/TeamMeatEx/TeamMeatEx12.fnt, gfx/ui/ui_charge_icons.anm2 "ChargeIcon", gfx/ui/minimap_icons.anm2 */ void __thiscall HUD::load_item_info_graphics(HUD *this) { byte bVar1; byte *currentAnimName; char *pcVar2; uint uVar3; bool isLess; std_string chargeIconsPath; std_string resourcePath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *currentAnim; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0288d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; resourcePath._buf._0_4_ = std::_Allocate(0x30); resourcePath._size = 0x20; resourcePath._capacity = 0x2f; builtin_strncpy((char *)resourcePath._buf._0_4_,"font/TeamMeatEx/TeamMeatEx12.fnt",0x21); local_14 = 0; RichText::load_font(&resourcePath); local_14 = 0xffffffff; if (0xf < resourcePath._capacity) { uVar3 = resourcePath._capacity + 1; pcVar2 = (char *)resourcePath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(resourcePath._buf._0_4_ + -4); uVar3 = resourcePath._capacity + 0x24; if ((char *)0x1f < (char *)(resourcePath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } this->_playerHUD[0x3ec] = 0x66; this->_playerHUD[0x3ed] = 0x66; this->_playerHUD[0x3ee] = 0x66; this->_playerHUD[0x3ef] = 0x3f; ANM2::Reset((ANM2 *)(this->_playerHUD + 0x10)); chargeIconsPath._size = 0; chargeIconsPath._capacity = 0xf; chargeIconsPath._buf[0] = '\0'; chargeIconsPath._buf[1] = '\0'; chargeIconsPath._buf[2] = '\0'; chargeIconsPath._buf[3] = '\0'; chargeIconsPath._buf._0_4_ = std::_Allocate(0x20); chargeIconsPath._size = 0x1b; chargeIconsPath._capacity = 0x1f; builtin_strncpy((char *)chargeIconsPath._buf._0_4_,"gfx/ui/ui_charge_icons.anm2",0x1c); local_14 = 1; ANM2::Load((ANM2 *)(this->_playerHUD + 0x124),&chargeIconsPath,1); local_14 = 0xffffffff; if (0xf < chargeIconsPath._capacity) { uVar3 = chargeIconsPath._capacity + 1; pcVar2 = (char *)chargeIconsPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(chargeIconsPath._buf._0_4_ + -4); uVar3 = chargeIconsPath._capacity + 0x24; if ((char *)0x1f < (char *)(chargeIconsPath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } currentAnim = *(byte **)(this->_playerHUD + 0x158); if (currentAnim != (byte *)0x0) { currentAnimName = currentAnim; if (0xf < *(uint *)(currentAnim + 0x14)) { currentAnimName = *(byte **)currentAnim; } pcVar2 = "ChargeIcon"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_0083c7c0: uVar3 = -(uint)isLess | 1; goto LAB_0083c7c5; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_0083c7c0; currentAnimName = currentAnimName + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0083c7c5: if ((uVar3 == 0) && ((currentAnim[0x34] == 0 || (this->_playerHUD[0x168] != 0)))) goto LAB_0083c7f1; } bVar1 = ANM2::SetAnimation((ANM2 *)(this->_playerHUD + 0x124),(byte *)"ChargeIcon",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this->_playerHUD + 0x154)); this->_playerHUD[0x168] = 1; } LAB_0083c7f1: resourcePath._size = 0; resourcePath._capacity = 0xf; this->_playerHUD[0x260] = 0; this->_playerHUD[0x261] = 0; this->_playerHUD[0x262] = 0x80; this->_playerHUD[0x263] = 0x40; resourcePath._buf[0] = '\0'; resourcePath._buf[1] = '\0'; resourcePath._buf[2] = '\0'; resourcePath._buf[3] = '\0'; resourcePath._buf._0_4_ = std::_Allocate(0x20); resourcePath._size = 0x19; resourcePath._capacity = 0x1f; builtin_strncpy((char *)resourcePath._buf._0_4_,"gfx/ui/minimap_icons.anm2",0x1a); local_14 = 2; ANM2::Load((ANM2 *)(this->_playerHUD + 0x264),&resourcePath,1); if (0xf < resourcePath._capacity) { uVar3 = resourcePath._capacity + 1; pcVar2 = (char *)resourcePath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(resourcePath._buf._0_4_ + -4); uVar3 = resourcePath._capacity + 0x24; if ((char *)0x1f < (char *)(resourcePath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } ExceptionList = local_1c; return; } //@@ 0083c8d0 HUD::update_item_info /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called last in HUD::Update; item description panel: "##GAME###ITEM_INFO_UNIDENTIFIED", "Spins down into _netplayManager == *(NetplayManager *)(g_manager + 1)) { gameData = &g_manager->_persistentGameData; } local_24 = uVar6; if (((gameData->_achievements[0x281] == 0) && (((ppvVar3 = spindownText + 0x14, g_manager->_state != 2 || (ppvVar3 = spindownText + 0x14, g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (ppvVar3 = spindownText + 0x14, g_game->_isDebug == 0)))))) || (((ppvVar3 = spindownText + 0x14, g_game->_challenge == 0x20 || (ppvVar3 = spindownText + 0x14, (g_manager->_optionsConfig)._itemInfoDisplayEnabled == 0)) || (ppvVar3 = spindownText + 0x14, (*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0) ))) goto LAB_0083d192; local_f0 = in_ECX; local_dc = PlayerManager::get_first_local_main_player(&g_game->_playerManager); pEVar14 = extraout_ECX; if (local_dc == (Entity_Player *)0x0) goto LAB_0083d199; i = 0; local_e0 = (Entity_Pickup *)0x0; local_ec.y = 10000.0; pvVar11 = g_game->_room; ppvVar3 = (void **)puStack_20; if (*(int *)((int)pvVar11 + 0x1264) != 0) { do { iVar7 = *(int *)((int)pvVar11 + 0x125c); iVar2 = *(int *)(iVar7 + i * 4); if (*(int *)(iVar2 + 0x28) == 5) { pickupVariant = *(int *)(iVar2 + 0x2c); if (pickupVariant == 100) { LAB_0083ca27: layer = ANM2::GetLayer((ANM2 *)(iVar2 + 0x48),(byte *)0x1); tmpCStr = &layer->_spriteSheetPath; if (0xf < (layer->_spriteSheetPath)._capacity) { tmpCStr = *(std_string **)tmpCStr->_buf; } bVar4 = str_eq((byte *)tmpCStr,(layer->_spriteSheetPath)._size, (byte *)"gfx/Items/Collectibles/questionmark.png",0x27); if ((bVar4 == 0) && (iVar7 = *(int *)((int)pvVar11 + 0x125c), *(int *)(*(int *)(iVar7 + i * 4) + 0x30) != 0 )) { LAB_0083ca61: pEVar14 = *(Entity_Pickup **)(iVar7 + i * 4); fVar15 = (local_dc->_pos).x - (pEVar14->_pos).x; fVar16 = (local_dc->_pos).y - (pEVar14->_pos).y; fVar15 = fVar16 * fVar16 + fVar15 * fVar15; if (fVar15 < local_ec.y) { local_ec.y = fVar15; local_e0 = pEVar14; } } } else if (((pickupVariant == 0x15e) || (pickupVariant == 0x46)) || (pickupVariant == 300)) { if (pickupVariant == 100) goto LAB_0083ca27; goto LAB_0083ca61; } } nearestPickup = local_e0; in_ECX = local_f0; i = i + 1; } while (i < *(uint *)((int)pvVar11 + 0x1264)); ppvVar3 = (void **)puStack_20; if ((local_e0 != (Entity_Pickup *)0x0) && (local_e0->_subtype != 0)) { iVar7 = ItemPool::GetPillEffect(&g_game->_itemPool,local_e0->_subtype,local_dc); pEVar14 = *(Entity_Pickup **)in_ECX; if ((pEVar14 == (Entity_Pickup *)0x0) || (nearestPickup != pEVar14)) { LAB_0083cb4f: *(Entity_Pickup **)in_ECX = nearestPickup; manager = g_manager; iVar7 = nearestPickup->_variant; if (iVar7 == 100) { uVar8 = FUN_0084f640(); *(undefined4 *)&in_ECX->field_0x4 = uVar8; StatsPanel::set(local_dc,0); iVar7 = *(int *)&in_ECX->field_0x4; FUN_00856840(); *(undefined4 *)(iVar7 + 0x3c) = *(undefined4 *)(iVar7 + 0x38); bVar4 = Entity_Player::HasCollectible(local_dc,0x2d3,0); pEVar14 = local_e0; if ((bVar4 != 0) && (local_e0->_optionsPickupIndex == 0)) { bVar4 = Entity_Pickup::CanReroll(local_e0); if (bVar4 != 0) { iVar7 = pEVar14->_subtype; bVar4 = Entity_Player::HasCollectible(local_dc,0x164,0); local_dc = (Entity_Player *)0x1; if (bVar4 != 0) { local_dc = (Entity_Player *)0x2; } local_ec.y = 0.0; LAB_0083cc10: pEVar12 = local_dc; LAB_0083cc16: iVar7 = iVar7 + -1; if (iVar7 < 1) goto LAB_0083cc50; pIVar9 = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar7); if (pIVar9 != (ItemConfig_Item *)0x0) goto code_r0x0083cc39; goto LAB_0083cc10; } } LAB_0083ced0: pIVar9 = ItemConfig::GetCollectible(&g_manager->_itemConfig,pEVar14->_subtype); if (pIVar9 != (ItemConfig_Item *)0x0) { tmpCStr = &pIVar9->gfxFilename; if (0xf < (pIVar9->gfxFilename)._capacity) { tmpCStr = *(std_string **)tmpCStr->_buf; } pvVar11 = Manager::LoadImage(&local_f8,(byte *)tmpCStr); local_14 = (void *)0x5; goto LAB_0083cf7d; } LAB_0083cfa5: KAGE::SmartPointer::reset(&in_ECX->_damageEvents,(void *)0x0); ANM2::Reset((ANM2 *)&(in_ECX->_damageEvents)._capacity); pEVar14 = extraout_ECX_01; } else if (iVar7 == 0x15e) { uVar8 = FUN_0084f680(); *(undefined4 *)&in_ECX->field_0x4 = uVar8; StatsPanel::set(local_dc,(uint)nearestPickup->_subtype >> 0xf & 1); pIVar9 = ItemConfig::GetTrinket(&g_manager->_itemConfig,nearestPickup->_subtype); if (pIVar9 == (ItemConfig_Item *)0x0) goto LAB_0083cfa5; tmpCStr = &pIVar9->gfxFilename; if (0xf < (pIVar9->gfxFilename)._capacity) { tmpCStr = *(std_string **)tmpCStr->_buf; } pvVar11 = Manager::LoadImage(&local_f8,(byte *)tmpCStr); local_14 = (void *)0x6; LAB_0083cf7d: KAGE::SmartPointer::operator_assign(&in_ECX->_damageEvents,pvVar11); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; FUN_0040c440(); ANM2::Reset((ANM2 *)&(in_ECX->_damageEvents)._capacity); pEVar14 = extraout_ECX_00; } else if (iVar7 == 0x46) { ItemPool::GetPillEffect(&g_game->_itemPool,nearestPickup->_subtype,local_dc); manager = g_manager; uVar8 = FUN_0084f6e0(); *(undefined4 *)&in_ECX->field_0x4 = uVar8; entityConfig = EntityConfig::GetEntity(&manager->_entityConfig,5,0x46,local_e0->_subtype); if (entityConfig == (EntityConfig_Entity *)0x0) { LAB_0083d11f: ANM2::Reset((ANM2 *)&(in_ECX->_damageEvents)._capacity); } else { tmpCStr = &entityConfig->anm2Path; if (0xf < (entityConfig->anm2Path)._capacity) { tmpCStr = *(std_string **)tmpCStr->_buf; } std::string::string_from_cstr(tmpString._buf,(byte *)tmpCStr); local_14 = (void *)0x7; LAB_0083d02f: ANM2::Load((ANM2 *)&(in_ECX->_damageEvents)._capacity,&tmpString,1); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; pvVar11 = (void *)tmpString._buf._0_4_; if (0xfff < uVar6) { pvVar11 = *(void **)(tmpString._buf._0_4_ + -4); uVar6 = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar6); } ANM2::Play((ANM2 *)&(in_ECX->_damageEvents)._capacity,s_Idle,0); } KAGE::SmartPointer::reset(&in_ECX->_damageEvents,(void *)0x0); pEVar14 = extraout_ECX_03; } else if (iVar7 == 300) { uVar8 = FUN_0084f740(); *(undefined4 *)&in_ECX->field_0x4 = uVar8; card = ItemConfig::GetCard(&manager->_itemConfig,local_e0->_subtype); if (card != (ItemConfig_Card *)0x0) { entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,5,300,card->pickupSubtype); if (entityConfig == (EntityConfig_Entity *)0x0) goto LAB_0083d11f; tmpCStr = &entityConfig->anm2Path; if (0xf < (entityConfig->anm2Path)._capacity) { tmpCStr = *(std_string **)tmpCStr->_buf; } std::string::string_from_cstr(tmpString._buf,(byte *)tmpCStr); local_14 = (void *)0x8; goto LAB_0083d02f; } *(undefined4 *)&in_ECX->field_0x4 = 0; *(int *)in_ECX = 0; pEVar14 = extraout_ECX_02; } pfVar13 = &(in_ECX->_sizeMulti).y; if ((in_ECX->_sizeMulti).y != -NAN) { local_e4 = -NAN; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0,(int *)pfVar13,(int *)&local_e4); *pfVar13 = -NAN; pEVar14 = extraout_ECX_04; } } else { pEVar14 = (Entity_Pickup *)nearestPickup->_variant; if (pEVar14 == (Entity_Pickup *)0x64) { pEVar14 = *(Entity_Pickup **)&in_ECX->field_0x4; if (nearestPickup->_subtype == *(int *)&pEVar14->field_0x4) goto LAB_0083d16f; goto LAB_0083cb4f; } if (pEVar14 == (Entity_Pickup *)0x15e) { pEVar14 = *(Entity_Pickup **)&in_ECX->field_0x4; if ((nearestPickup->_subtype & 0x7fffU) != *(uint *)&pEVar14->field_0x4) goto LAB_0083cb4f; } else if ((pEVar14 == (Entity_Pickup *)0x46) && (iVar7 != *(int *)(*(int *)&in_ECX->field_0x4 + 4))) goto LAB_0083cb4f; } LAB_0083d16f: local_f0 = *(Entity_Pickup **)&in_ECX->field_0x4; if (local_f0 != (Entity_Pickup *)0x0) { cVar5 = FUN_0083d7c0(); local_f0->field_0x44 = cVar5 == '\0'; pEVar14 = local_f0; } goto LAB_0083d199; } } LAB_0083d192: puStack_20 = (undefined1 *)ppvVar3; FUN_0083d6e0(uVar6); pEVar14 = extraout_ECX_05; LAB_0083d199: local_f0 = (Entity_Pickup *)&DAT_bf800000; if ((*(int *)in_ECX != 0) && ((in_ECX->_sizeMulti).y == -NAN)) { FUN_00840250(&local_f8,pEVar14); local_ec.x = local_f8 + 0.0; local_ec.y = local_f4 - 12.0; MessagePopup::MessagePopup (popup,&g_manager->_font1_TeamMeatEx10,(void *)0x0,(void *)0x0,&local_ec); local_14 = (void *)0x9; local_194 = 150.0 / DAT_00c7997c; popup[0] = popup[0] & 0xf8; local_18c = 2; local_188 = 0x40c00000; local_1a8 = 1; local_184 = 1; local_170 = 0; local_14c = FUN_00840370; local_180 = 0; uStack_17c = 0; uStack_178 = 0; uStack_174 = 0x3f19999a; cVar5 = FUN_0083d760(); if (cVar5 == '\0') { local_1b8 = 0x41200000; local_1b4 = 0x40c00000; KColor::SetFromARGB(&local_10c,0xffffffff); local_ec.y = 1.4013e-45; FUN_009c2700(&DAT_00b6d12c,&g_vectorZero,&local_ec.y,extraout_ECX_06); KColor::SetFromARGB(&local_10c,0xffffffff); local_ec.y = 1.4013e-45; FUN_009c2700("##GAME###ITEM_INFO_UNIDENTIFIED",&g_vectorZero,&local_ec.y,extraout_ECX_07); local_1a4 = &DAT_bf800000; local_1a0 = &DAT_bf800000; } fVar15 = (float)PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,popup); (in_ECX->_sizeMulti).y = fVar15; in_ECX->_mass = local_f8; in_ECX->_health = local_f4; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; FUN_00420710(); } if (((in_ECX->_sizeMulti).y != -NAN) && (pEVar12 = (Entity_Player *)FUN_009c3940(), pEVar12 != (Entity_Player *)0x0)) { local_dc = pEVar12; player = PlayerManager::get_first_local_main_player(&g_game->_playerManager); local_f4 = 0.0; if (player == (Entity_Player *)0x0) { fVar15 = 0.0; fVar16 = 0.0; } else { local_ec.y = g_displayPixelRatio * g_screenPointScale; pvVar11 = g_game->_room; local_e4 = ((g_screenWidth - 338.0) * 0.5 + ((player->_pos).x - 60.0) * 0.65) * local_ec.y + 0.5; dVar17 = floor((double)local_e4); pEVar12 = local_dc; local_f4 = (float)dVar17 / local_ec.y + *(float *)((int)pvVar11 + 0x1204); local_e4 = DAT_00c7997c; if (local_f4 <= DAT_00c7997c * 0.5) { local_ec.y = -90.0; } else { local_ec.y = 65.0; local_f0 = (Entity_Pickup *)0x3f800000; } local_e0 = DAT_00c79980; pfVar13 = (float *)Popup::get_size(); fVar15 = (local_ec.y - local_e4 * (float)local_f0 * 0.5) + (float)local_f0 * *pfVar13 * 0.5; fVar16 = (0.0 - (float)local_e0 * 0.5) + pfVar13[1] * 0.5 + 60.0; } fVar1 = *(float *)((int)pEVar12 + 0x48); if (((fVar1 < 0.0) && (local_f4 < DAT_00c7997c * 0.5 - 20.0)) || ((0.0 < fVar1 && (DAT_00c7997c * 0.5 + 20.0 < local_f4)))) { local_ec.y = (float)g_manager; local_f0 = (Entity_Pickup *)0xffffffff; if ((in_ECX->_sizeMulti).y != -NAN) { local_f4 = fVar1; (**(code **)(*(int *)&g_manager[1]._gamestate.field_0xcf8 + 0xc))(); pfVar13 = (float *)0x0; popupListHead = *(int **)&(((Manager *)((int)local_ec.y + 0x4b3dc))->_gamestate).field_0xcf0 ; popupNode = (int *)*popupListHead; if (popupNode != popupListHead) { while (pfVar13 = (float *)popupNode[2], *pfVar13 != (in_ECX->_sizeMulti).y) { popupNode = (int *)*popupNode; if (popupNode == popupListHead) { (**(code **)(*(int *)&(((Manager *)((int)local_ec.y + 0x4b3dc))->_gamestate). field_0xcf8 + 0x10))(); (in_ECX->_sizeMulti).y = -NAN; ExceptionList = local_1c; return; } } } (**(code **)(*(int *)&(((Manager *)((int)local_ec.y + 0x4b3dc))->_gamestate).field_0xcf8 + 0x10))(); if ((pfVar13 != (float *)0x0) && ((int)pfVar13[1] < 3)) { elapsedMs = Popup::get_elapsed_ms(pfVar13); if (((int)((ulonglong)elapsedMs >> 0x20) == 0) && ((uint)(float)elapsedMs < (uint)pfVar13[0x15])) { pfVar13[6] = (float)local_f0; (in_ECX->_sizeMulti).y = -NAN; ExceptionList = local_1c; return; } pfVar13[6] = -1.6947395e+38; if ((code *)pfVar13[0x28] != (code *)0x0) { (*(code *)pfVar13[0x28])(&local_f0); } Popup::set_state(pfVar13,3); } } (in_ECX->_sizeMulti).y = -NAN; } else { *(float *)((int)pEVar12 + 0x48) = fVar15; *(float *)((int)pEVar12 + 0x4c) = fVar16; } } ExceptionList = local_1c; return; code_r0x0083cc39: bVar4 = Item::IsAvailable(pIVar9,3); pEVar12 = local_dc; if (bVar4 == 0) goto LAB_0083cc16; LAB_0083cc50: local_ec.y = (float)((int)local_ec.y + 1); if ((int)local_ec.y < (int)pEVar12) goto LAB_0083cc16; if (0 < iVar7) { iVar2 = *(int *)&in_ECX->field_0x4; tmpCStr = int_to_string(&tmpString,iVar7); local_14 = (void *)0x0; prefixText[0] = std::_Allocate(0x30); local_5c = 0x2f; local_58 = 0x2f; builtin_strncpy(prefixText[0],"Spins down into ::_Emplace_reallocate(pvVar11,infoText); } else { InfoDisplayEntry::copy_constructor(pvVar11,infoText); *(int *)(iVar2 + 0x3c) = *(int *)(iVar2 + 0x3c) + 0x68; } FID_conflict__Tidy(local_84); FID_conflict__Tidy(local_90); FID_conflict__Tidy(local_9c); FID_conflict__Tidy(local_a8); FID_conflict__Tidy(local_b4); FID_conflict__Tidy(local_c0); std::string::_Tidy_deallocate(infoText); local_14._0_1_ = 2; if (0xf < (uint)local_10c._unk) { uVar6 = local_10c._unk + 1; pppppppbVar10 = local_110; if (0xfff < uVar6) { pppppppbVar10 = (byte *******)local_110[-1]; uVar6 = local_10c._unk + 0x24; if ((byte *)0x1f < (byte *)((int)local_110 + (-4 - (int)pppppppbVar10))) goto LAB_0083cea2; } operator_delete(pppppppbVar10,uVar6); } local_14._0_1_ = 1; local_10c._alpha = 0.0; local_10c._unk = 0xf; local_110 = (byte *******)((uint)local_110 & 0xffffff00); if (0xf < local_40) { uVar6 = local_40 + 1; pvVar11 = spindownText[0]; if (0xfff < uVar6) { pvVar11 = *(void **)((int)spindownText[0] + -4); uVar6 = local_40 + 0x24; if (0x1f < (uint)((int)spindownText[0] + (-4 - (int)pvVar11))) goto LAB_0083cea2; } operator_delete(pvVar11,uVar6); } local_14._0_1_ = 0; local_44 = 0; local_40 = 0xf; spindownText[0] = (void *)((uint)spindownText[0] & 0xffffff00); if (0xf < local_58) { uVar6 = local_58 + 1; ptr = prefixText[0]; if (0xfff < uVar6) { ptr = *(char **)(prefixText[0] + -4); uVar6 = local_58 + 0x24; if ((char *)0x1f < prefixText[0] + (-4 - (int)ptr)) goto LAB_0083cea2; } operator_delete(ptr,uVar6); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; pvVar11 = (void *)tmpString._buf._0_4_; if (0xfff < uVar6) { pvVar11 = *(void **)(tmpString._buf._0_4_ + -4); uVar6 = tmpString._capacity + 0x24; if (0x1f < (uint)(tmpString._buf._0_4_ + (-4 - (int)pvVar11))) { LAB_0083cea2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar6); } tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = tmpString._buf._0_4_ & 0xffffff00; in_ECX = local_f0; } pEVar14 = local_e0; goto LAB_0083ced0; } //@@ 0083d6e0 FUN_0083d6e0 void FUN_0083d6e0(void) { int iVar1; int iVar2; Manager *pMVar3; undefined4 *in_ECX; int local_8; KAGE::SmartPointer::reset(in_ECX + 2,(void *)0x0); pMVar3 = g_manager; in_ECX[1] = 0; *in_ECX = 0; local_8 = -1; PopupManager::close(&pMVar3[1]._gamestate.field_0xcf0,in_ECX + 0xde,&local_8); in_ECX[0xde] = -1; iVar1 = in_ECX[0xfa]; if (iVar1 != 0) { iVar2 = *(int *)(iVar1 + 0x120); std::map::_Erase_tree(iVar1 + 0x120,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)(iVar1 + 0x124) = 0; } return; } //@@ 0083d760 FUN_0083d760 undefined1 FUN_0083d760(int param_1) { int iVar1; PersistentGameData *pPVar2; iVar1 = *(int *)(param_1 + 0x30); if (0 < iVar1) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pPVar2 = &g_manager->_persistentGameData; } else { pPVar2 = (PersistentGameData *)(g_manager[1]._persistentGameData._achievements + 0xc); } if (((*(int *)(param_1 + 0x2c) == 100) && (iVar1 < 0x2dd)) && (*(char *)((int)pPVar2->_eventCounters + iVar1 + 0x82c) == '\0')) { return 0; } } return 1; } //@@ 0083d7c0 FUN_0083d7c0 undefined1 FUN_0083d7c0(int param_1) { byte bVar1; char cVar2; uint uVar3; Entity_Player *this; uint uVar4; undefined4 local_10; undefined4 local_c; uVar3 = *(uint *)(param_1 + 0x30); if (0 < (int)uVar3) { if (*(int *)(param_1 + 0x2c) == 0x46) { uVar4 = -(uint)((uVar3 & 0x7ff) != 0) & uVar3 & 0x7ff; uVar3 = 0xe; if (uVar4 < 0xe) { uVar3 = uVar4; } return *(undefined1 *)((int)(&g_game->_itemPool + 1) + uVar3 + 0x3c); } if (*(int *)(param_1 + 0x2c) == 300) { if (((((((*(int *)(param_1 + 0x534) != 0) && (uVar3 != 0x2b)) && (uVar3 != 0x2d)) && ((uVar3 != 0x2f && (uVar3 != 0x33)))) && ((uVar3 != 0x50 && ((uVar3 != 0x32 && (uVar3 != 0x31)))))) && (uVar3 != 0x4e)) && ((uVar3 != 0x29 && ((uVar3 < 0x51 || (0x61 < uVar3)))))) { return 0; } this = PlayerManager::get_first_local_main_player(&g_game->_playerManager); bVar1 = Entity::IsFlying((Entity *)this); if (bVar1 == 0) { local_c = *(undefined4 *)(param_1 + 0x340); local_10 = *(undefined4 *)(param_1 + 0x33c); cVar2 = FUN_00823be0(&local_10,this,1); if (cVar2 == '\0') { return 0; } } } } return 1; } //@@ 0083d8c0 item_pool_icons_render /* DB: ? args (Vector* pos, Color*), this has ItemConfig_Item* at +4: ItemPool::GetItemPoolsForCollectible then renders IconShop/IconTreasureRoom/IconDevilRoom/... anims (ItemPoolChests), greed-mode pool filter; called from 0083eae0 PlayerHUD::render_pocket_item_info void item_pool_icons_render(float *param_1,undefined4 *param_2) { byte *pbVar1; Game *pGVar2; byte bVar3; int iVar4; uint uVar5; byte *pbVar6; int in_ECX; char *pcVar7; AnimationState *this; int *piVar8; int *piVar9; bool bVar10; float frame; undefined4 local_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 local_48; undefined4 uStack_44; undefined4 local_40; int *local_3c; int *local_38; int local_34; Vector local_30; ANM2 *local_28; int local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b0295d; local_1c = ExceptionList; ExceptionList = &local_1c; local_3c = (int *)0x0; local_34 = 0; local_14 = 0; local_38 = (int *)0x0; local_24 = in_ECX; ItemPool::GetItemPoolsForCollectible (&g_game->_itemPool,*(int *)(*(int *)(in_ECX + 4) + 4),&local_3c); pGVar2 = g_game; piVar8 = local_38; piVar9 = local_3c; if (local_3c != local_38) { do { if ((pGVar2->_difficulty == 2) || (pGVar2->_difficulty == 3)) { iVar4 = *piVar9; if ((iVar4 != 0) && (((((iVar4 != 0x10 && (iVar4 != 0x12)) && (iVar4 != 0x11)) && ((iVar4 != 0x14 && (iVar4 != 0x13)))) && (iVar4 != 0x16)))) { bVar10 = iVar4 == 0x15; goto LAB_0083d9d5; } LAB_0083da29: piVar9 = piVar9 + 1; } else { iVar4 = *piVar9; if ((((iVar4 == 0) || (iVar4 == 1)) || ((iVar4 == 2 || (((iVar4 == 4 || (iVar4 == 3)) || (iVar4 == 5)))))) || ((iVar4 == 6 || (iVar4 == 0xc)))) goto LAB_0083da29; bVar10 = iVar4 == 0x1a; LAB_0083d9d5: if ((((bVar10) || (iVar4 == 8)) || ((iVar4 == 9 || (((iVar4 == 0x1d || (iVar4 == 10)) || (iVar4 == 0xb)))))) || (((iVar4 == 0xd || (iVar4 == 0xe)) || ((iVar4 == 0x19 || (((iVar4 == 0x1e || (iVar4 == 0x18)) || (iVar4 == 0x17)))))))) goto LAB_0083da29; memmove(piVar9,piVar9 + 1,(int)piVar8 - (int)(piVar9 + 1)); piVar8 = local_38 + -1; local_38 = piVar8; } } while (piVar9 != piVar8); } local_30.x = *param_1; local_30.y = param_1[1]; uVar5 = (int)piVar8 - (int)local_3c >> 2; if (1 < uVar5) { local_30.x = local_30.x - ((float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)piVar8 - (int)local_3c >> 0x1f)]) - 1.0) * 16.0 * 0.5; } if (local_3c != piVar8) { iVar4 = local_24; piVar9 = local_3c; do { switch(*piVar9) { case 0: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconTreasureRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083db11: uVar5 = -(uint)bVar10 | 1; goto LAB_0083db16; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083db11; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083db16: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(iVar4 + 0x2a8) != '\0')))) goto LAB_0083dec6; } pcVar7 = "IconTreasureRoom"; break; case 1: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconShop"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083dba0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083dba5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083dba0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083dba5: if (uVar5 == 0) { if ((pbVar1[0x34] == 0) || (*(char *)(iVar4 + 0x2a8) != '\0')) goto LAB_0083dec6; pcVar7 = "IconShop"; break; } } pcVar7 = "IconShop"; break; case 2: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBoss"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083dc18: uVar5 = -(uint)bVar10 | 1; goto LAB_0083dc1d; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083dc18; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083dc1d: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconBoss"; break; } goto LAB_0083dec6; } } pcVar7 = "IconBoss"; break; case 3: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconDevilRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083dc90: uVar5 = -(uint)bVar10 | 1; goto LAB_0083dc95; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083dc90; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083dc95: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconDevilRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconDevilRoom"; break; case 4: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconAngelRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083dd08: uVar5 = -(uint)bVar10 | 1; goto LAB_0083dd0d; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083dd08; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083dd0d: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconAngelRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconAngelRoom"; break; case 5: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconSecretRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083dd80: uVar5 = -(uint)bVar10 | 1; goto LAB_0083dd85; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083dd80; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083dd85: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconSecretRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconSecretRoom"; break; case 6: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconLibrary"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083ddf8: uVar5 = -(uint)bVar10 | 1; goto LAB_0083ddfd; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083ddf8; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083ddfd: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconLibrary"; break; } goto LAB_0083dec6; } } pcVar7 = "IconLibrary"; break; default: goto switchD_0083dacb_caseD_7; case 8: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083de8b: pcVar7 = "ItemPoolChests"; goto LAB_0083de92; } pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "ItemPoolChests"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083de70: uVar5 = -(uint)bVar10 | 1; goto LAB_0083de75; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083de70; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083de75: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083de8b; goto LAB_0083dea9; case 9: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083dfb2: bVar3 = ANM2::SetAnimation(local_28,(byte *)"ItemPoolChests",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "ItemPoolChests"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083df97: uVar5 = -(uint)bVar10 | 1; goto LAB_0083df9c; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083df97; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083df9c: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083dfb2; } if (*(int *)(local_24 + 0x298) == 0) goto LAB_0083dec6; frame = 1.0; goto LAB_0083debe; case 10: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e05f: pcVar7 = "IconBeggar"; } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBeggar"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e035: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e03a; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e035; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e03a: if (uVar5 != 0) goto LAB_0083e05f; if ((pbVar1[0x34] == 0) || (*(char *)(iVar4 + 0x2a8) != '\0')) goto LAB_0083dea9; pcVar7 = "IconBeggar"; } LAB_0083de92: local_28 = (ANM2 *)(iVar4 + 0x264); bVar3 = ANM2::SetAnimation(local_28,(byte *)pcVar7,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } LAB_0083dea9: if (*(int *)(local_24 + 0x298) != 0) { frame = 0.0; LAB_0083debe: AnimationState::SetFrameFloat((AnimationState *)(local_24 + 0x294),frame); } goto LAB_0083dec6; case 0xb: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e0cb: bVar3 = ANM2::SetAnimation(local_28,(byte *)"IconBeggar",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBeggar"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e0b0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e0b5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e0b0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e0b5: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e0cb; } if (*(int *)(local_24 + 0x298) != 0) { frame = 2.0; goto LAB_0083debe; } goto LAB_0083dec6; case 0xc: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconCurseRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e148: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e14d; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e148; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e14d: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconCurseRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconCurseRoom"; break; case 0xd: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e1db: bVar3 = ANM2::SetAnimation(local_28,(byte *)"IconBeggar",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBeggar"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e1c0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e1c5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e1c0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e1c5: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e1db; } if (*(int *)(local_24 + 0x298) != 0) { frame = 3.0; goto LAB_0083debe; } goto LAB_0083dec6; case 0xe: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e270: bVar3 = ANM2::SetAnimation(local_28,(byte *)"IconBeggar",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBeggar"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e255: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e25a; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e255; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e25a: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e270; } iVar4 = *(int *)(local_24 + 0x298); goto joined_r0x0083e6bb; case 0x10: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconTreasureRoomGreed"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e2f0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e2f5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e2f0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e2f5: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconTreasureRoomGreed"; break; } goto LAB_0083dec6; } } pcVar7 = "IconTreasureRoomGreed"; break; case 0x11: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBoss"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e370: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e375; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e370; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e375: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconBoss"; break; } goto LAB_0083dec6; } } pcVar7 = "IconBoss"; break; case 0x12: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconShop"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e3f0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e3f5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e3f0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e3f5: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconShop"; break; } goto LAB_0083dec6; } } pcVar7 = "IconShop"; break; case 0x13: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconDevilRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e470: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e475; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e470; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e475: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconDevilRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconDevilRoom"; break; case 0x14: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconAngelRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e4f0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e4f5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e4f0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e4f5: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconAngelRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconAngelRoom"; break; case 0x15: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconCurseRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e570: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e575; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e570; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e575: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconCurseRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconCurseRoom"; break; case 0x16: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconSecretRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e5f0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e5f5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e5f0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e5f5: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconSecretRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconSecretRoom"; break; case 0x17: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e68b: bVar3 = ANM2::SetAnimation(local_28,(byte *)"IconSlot",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconSlot"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e670: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e675; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e670; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e675: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e68b; } iVar4 = *(int *)(local_24 + 0x298); joined_r0x0083e6bb: frame = 5.0; if (iVar4 == 0) goto LAB_0083dec6; goto LAB_0083debe; case 0x18: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconUltraSecretRoom"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e710: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e715; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e710; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e715: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconUltraSecretRoom"; break; } goto LAB_0083dec6; } } pcVar7 = "IconUltraSecretRoom"; break; case 0x19: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e7ab: bVar3 = ANM2::SetAnimation(local_28,(byte *)"IconBeggar",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBeggar"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e790: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e795; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e790; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e795: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e7ab; } if (*(int *)(local_24 + 0x298) != 0) { frame = 4.0; goto LAB_0083debe; } goto LAB_0083dec6; case 0x1a: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 != (byte *)0x0) { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconPlanetarium"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e830: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e835; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e830; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e835: if (uVar5 == 0) { if ((pbVar1[0x34] != 0) && (*(char *)(iVar4 + 0x2a8) == '\0')) { pcVar7 = "IconPlanetarium"; break; } goto LAB_0083dec6; } } pcVar7 = "IconPlanetarium"; break; case 0x1d: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e8cb: bVar3 = ANM2::SetAnimation(local_28,(byte *)"ItemPoolChests",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "ItemPoolChests"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e8b0: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e8b5; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e8b0; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e8b5: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e8cb; } if (*(int *)(local_24 + 0x298) != 0) { frame = 2.0; goto LAB_0083debe; } goto LAB_0083dec6; case 0x1e: local_28 = (ANM2 *)(iVar4 + 0x264); pbVar1 = *(byte **)(iVar4 + 0x298); if (pbVar1 == (byte *)0x0) { LAB_0083e96b: bVar3 = ANM2::SetAnimation(local_28,(byte *)"IconBeggar",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pcVar7 = "IconBeggar"; do { bVar3 = *pbVar6; bVar10 = bVar3 < (byte)*pcVar7; if (bVar3 != *pcVar7) { LAB_0083e950: uVar5 = -(uint)bVar10 | 1; goto LAB_0083e955; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; bVar10 = bVar3 < (byte)pcVar7[1]; if (bVar3 != pcVar7[1]) goto LAB_0083e950; pbVar6 = pbVar6 + 2; pcVar7 = pcVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0083e955: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(iVar4 + 0x2a8) == '\0')))) goto LAB_0083e96b; } if (*(int *)(local_24 + 0x298) != 0) { frame = 1.0; goto LAB_0083debe; } goto LAB_0083dec6; } local_28 = (ANM2 *)(iVar4 + 0x264); bVar3 = ANM2::SetAnimation(local_28,(byte *)pcVar7,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(iVar4 + 0x294)); *(undefined1 *)(iVar4 + 0x2a8) = 1; } LAB_0083dec6: iVar4 = local_24; piVar8 = local_38; switchD_0083dacb_caseD_7: local_48 = 0; uStack_44 = 0; local_40 = 0; local_68 = *param_2; uStack_64 = param_2[1]; uStack_60 = param_2[2]; uStack_5c = param_2[3]; if ((undefined4 *)(iVar4 + 0x30c) != &local_68) { *(undefined4 *)(iVar4 + 0x31c) = 0; *(undefined4 *)(iVar4 + 800) = 0; *(undefined4 *)(iVar4 + 0x324) = 0; *(undefined4 *)(iVar4 + 0x328) = 0; *(undefined4 *)(iVar4 + 0x30c) = local_68; *(undefined4 *)(iVar4 + 0x310) = uStack_64; *(undefined4 *)(iVar4 + 0x314) = uStack_60; *(undefined4 *)(iVar4 + 0x318) = uStack_5c; *(undefined8 *)(iVar4 + 0x32c) = 0; *(undefined4 *)(iVar4 + 0x334) = 0; } if (*(char *)(iVar4 + 0x36d) != '\0') { this = (AnimationState *)(iVar4 + 0x294); if (*(char *)(iVar4 + 0x2d4) == '\0') { AnimationState::Render(this,&local_30,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(local_24 + 0x2b4); } else { AnimationState::Render ((AnimationState *)(iVar4 + 0x2b4),&local_30,&g_vectorZero,&g_vectorZero); } AnimationState::Render(this,&local_30,&g_vectorZero,&g_vectorZero); iVar4 = local_24; piVar8 = local_38; } piVar9 = piVar9 + 1; local_30.x = local_30.x + 16.0; } while (piVar9 != piVar8); } if (local_3c != (int *)0x0) { uVar5 = local_34 - (int)local_3c & 0xfffffffc; piVar8 = local_3c; if (0xfff < uVar5) { piVar8 = (int *)local_3c[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_3c + (-4 - (int)piVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar8,uVar5); } ExceptionList = local_1c; return; } //@@ 0083eae0 PlayerHUD::render_pocket_item_info /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? #ITEM_INFO_UNIDENTIFIED_CARD/PILL/RUNE strings; ZHL called it RenderHearts */ void PlayerHUD::render_pocket_item_info (Entity_Player *param_1,float *param_2,code *param_3,int param_4) { float fVar1; code *pcVar2; char cVar3; byte bVar4; float *extraout_EAX; ColorMod *color; ItemConfig_Item *collectibleConfig; byte *pbVar5; int iVar6; byte *formName; undefined4 *puVar7; undefined4 *******pppppppuVar8; float *poolEntry; int *in_ECX; KColor *color_00; ColorMod *color_01; ColorMod *color_02; uint *formNameKey; int *extraout_EDX; void *other; uint uVar9; int iVar10; int *infoItem; Entity_Player *poolIdIt; Entity_Player *pEVar11; bool bVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; char *formName; void *pvVar19; void *imageRefCount; undefined1 auStack_22a [2]; undefined1 local_21c [112]; float tintedGreen; float tintedRed; KColor textColor; Vector local_190; float *box; Vector textPos; float local_17c; float local_178; uint *local_174; float local_170; float fStack_16c; float fStack_168; float fStack_164; float local_160; float boxWidth; Entity_Player *local_158; Entity_Player *poolIdsBegin; Vector local_150; float lineY; Vector local_144; code *lineCallback; Vector local_138; uint *local_130; int outSize; char local_125; void *formPartialText [4]; undefined4 local_114; uint local_110; void *formGoalText [4]; undefined4 local_fc; uint local_f8; void *formCountText [4]; undefined4 local_e4; uint local_e0; undefined4 *******formLineText [4]; undefined4 local_cc; uint local_c8; Color local_c4; undefined4 local_90; undefined4 uStack_8c; undefined1 *puStack_88; void *pvStack_84; undefined4 local_80; undefined1 *puStack_7c; undefined1 *puStack_78; undefined8 uStack_74; void *formNameText; undefined4 local_68; undefined4 local_64; undefined4 local_60; float local_5c; uint local_58; KColor local_54; byte local_3f [3]; KColor local_3c; byte local_27 [3]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_27 + 0x23; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b029d7; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_27 + 0x17); lineCallback = param_3; box = param_2; outSize = param_4; if (in_ECX[1] == 0) { return; } ExceptionList = &local_1c; local_138.y = (float)in_ECX; cVar3 = FUN_0083d760(); if (cVar3 == '\0') { ExceptionList = local_1c; return; } local_158 = PlayerManager::get_first_local_main_player(&g_game->_playerManager); local_174 = (uint *)param_2[4]; fVar13 = param_2[5]; fVar17 = param_2[6]; fVar18 = param_2[7]; fVar16 = param_2[8]; fVar15 = *param_2; fVar14 = param_2[1]; fVar1 = param_2[9]; boxWidth = box[10]; pvVar19 = (void *)0x83ec19; textColor._red = fVar13; textColor._green = fVar17; textColor._blue = fVar18; textColor._alpha = fVar16; textColor._unk = (int)fVar1; textPos.x = fVar15; textPos.y = fVar14; local_170 = fVar13; fStack_16c = fVar17; fStack_168 = fVar18; fStack_164 = fVar16; local_160 = fVar1; KColor::SetFromARGB(&local_54,0xff1199b1); local_144.y = fVar16 * extraout_EAX[3]; tintedRed = fVar13 * *extraout_EAX; tintedGreen = fVar17 * extraout_EAX[1]; local_190.y = fVar18 * extraout_EAX[2]; local_170 = textColor._red; fStack_16c = textColor._green; fStack_168 = textColor._blue; fStack_164 = textColor._alpha; local_17c = fVar15; local_178 = fVar14; local_160 = fVar1; if (param_1 == (Entity_Player *)0x1) { if (in_ECX[2] == 0) { if (*(char *)((int)in_ECX + 0x119) != '\0') { local_58 = 0; local_68 = 0x3f800000; local_64 = 0x3f800000; local_60 = 0x3f800000; local_5c = fVar16; Color::Color(); Sprite::SetColor((Sprite *)(in_ECX + 4),color_01); local_138.x = textPos.x + 16.0; local_138.y = textPos.y + 24.0; ANM2::Render((ANM2 *)(in_ECX + 4),&local_138,&g_vectorZero,&g_vectorZero); } } else { FUN_00682260(); iVar6 = *(int *)(*extraout_EDX + 0x14); iVar10 = *(int *)(*extraout_EDX + 0x10); puStack_7c = (undefined1 *)(float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]); uStack_74 = CONCAT35(uStack_74._5_3_,0x100000000); uStack_74 = CONCAT44(uStack_74._4_4_,puStack_7c); puStack_78 = (undefined1 *)(float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) ; if ((*(int *)in_ECX[1] == 1) && (((int *)in_ECX[1])[1] == 0x14)) { local_c4._tint[2] = 0.0; local_c4._colorize[1] = 0.0; local_c4._tint[3] = 0.0; local_c4._colorize[0] = (float)&DAT_42000000; local_c4._colorize[2] = 0.0; local_c4._offset[0] = (float)&DAT_42000000; local_c4._offset[1] = (float)&DAT_42000000; local_c4._colorize[3] = (float)&DAT_42000000; local_c4._offset[2] = (float)CONCAT31(local_c4._offset[2]._1_3_,1); puStack_7c = &DAT_42000000; puStack_78 = &DAT_42000000; uStack_74 = CONCAT44(local_c4._offset[2],&DAT_42000000); } local_80 = 0; pvStack_84 = (void *)0x0; uStack_8c = 0; local_90 = 0; imageRefCount = (void *)0x83ed8c; puStack_88 = puStack_78; Color::Color(&local_c4); KAGE::SmartPointer::operator_assign(auStack_22a + -10,other); apply_sprite_shader_params(color,1,pvVar19,imageRefCount); local_58 = 0; local_68 = 0x3f800000; local_64 = 0x3f800000; pcVar2 = *(code **)(*(int *)in_ECX[2] + 0x14); local_60 = 0x3f800000; local_5c = fStack_164; KColor::SetFromARGB(&local_3c,0xffffffff); local_150.x = (float)&DAT_42000000; local_150.y = (float)&DAT_42000000; render_quad_set_rect(local_21c,&textPos,&local_150,color_00); (*pcVar2)(&local_90); in_ECX = (int *)local_138.y; } } local_174 = (uint *)0x3f200000; textPos.y = textPos.y + 8.0; infoItem = (int *)in_ECX[1]; textPos.x = textPos.x + 34.0; local_150.y = (float)infoItem[1]; lineY = textPos.y; local_138.y = textPos.x; local_130 = local_174; collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_150.y); if ((((*infoItem == 0) && (collectibleConfig != (ItemConfig_Item *)0x0)) && (collectibleConfig->type == 3)) && (param_1 == (Entity_Player *)0x1)) { local_138.y = box[1] + 18.0; local_138.x = ((float)((double)(int)box[10] + __uint_to_double_fixup[-((int)box[10] >> 0x1f)]) - 10.0) + *box; set_active_charge_frame(); local_58 = 0; local_68 = 0x3f800000; local_64 = 0x3f800000; local_60 = 0x3f800000; local_5c = fStack_164; Color::Color(); Sprite::SetColor((Sprite *)(in_ECX + 0x49),color_02); ANM2::Render((ANM2 *)(in_ECX + 0x49),&local_138,&g_vectorZero,&g_vectorZero); infoItem = (int *)in_ECX[1]; local_130 = local_174; lineY = textPos.y; } if ((char)infoItem[0x11] == '\0') { pbVar5 = (byte *)(infoItem + 2); local_150.y = (float)(in_ECX + 0xe1); if (0xf < (uint)infoItem[7]) { pbVar5 = *(byte **)pbVar5; } iVar6 = __ftoui3(); Font::measure_rich_text ((Font *)(in_ECX + 0xe1),&local_138,pbVar5,(int)boxWidth - iVar6,(float)local_130); iVar6 = outSize; puVar7 = (undefined4 *)(in_ECX[1] + 8); fVar13 = local_138.y / ((float)*(ushort *)(in_ECX + 0xec) * (float)local_174) - 1.0; if (fVar13 <= 0.0) { fVar13 = 0.0; } textPos.y = textPos.y - fVar13 * (float)*(ushort *)(in_ECX + 0xec) * (float)local_174 * 0.4; if (0xf < *(uint *)(in_ECX[1] + 0x1c)) { puVar7 = (undefined4 *)*puVar7; } (*lineCallback)(puVar7); if (param_1 != (Entity_Player *)0x0) goto LAB_0083f2c9; *(float *)(iVar6 + 0xc) = *(float *)(iVar6 + 0xc) + 23.0; } else if (*infoItem == 2) { pbVar5 = string_table_translate(&g_manager->_stringTable,(byte *)"#ITEM_INFO_UNIDENTIFIED_PILL") ; (*lineCallback)(pbVar5); } else if (*infoItem == 3) { iVar6 = infoItem[1]; if (iVar6 < 0x17) { LAB_0083f0a0: formName = "#ITEM_INFO_UNIDENTIFIED_TAROT_CARD"; LAB_0083f0b2: pbVar5 = string_table_translate(&g_manager->_stringTable,(byte *)formName); (*lineCallback)(pbVar5); } else if (iVar6 < 0x20) { pbVar5 = string_table_translate (&g_manager->_stringTable,(byte *)"#ITEM_INFO_UNIDENTIFIED_PLAYING_CARD"); (*lineCallback)(pbVar5); } else if (iVar6 < 0x2a) { pbVar5 = string_table_translate (&g_manager->_stringTable,(byte *)"#ITEM_INFO_UNIDENTIFIED_RUNE"); (*lineCallback)(pbVar5); } else if (iVar6 < 0x37) { pbVar5 = string_table_translate (&g_manager->_stringTable,(byte *)"#ITEM_INFO_UNIDENTIFIED_CARD"); (*lineCallback)(pbVar5); } else { if (iVar6 < 0x4e) goto LAB_0083f0a0; if (iVar6 < 0x51) { formName = "#ITEM_INFO_UNIDENTIFIED_CARD"; goto LAB_0083f0b2; } } } else { (*lineCallback)(&DAT_00b6d12c); } local_150.y = (float)(in_ECX + 0xe1); LAB_0083f2c9: fVar13 = lineY + 24.0; infoItem = (int *)in_ECX[1]; textPos.x = *box + 16.0; local_174 = (uint *)0x3f000000; textPos.y = fVar13; lineY = fVar13; if ((char)infoItem[0x11] == '\0') { local_170 = tintedRed; fStack_16c = tintedGreen; fStack_168 = local_190.y; fStack_164 = local_144.y; local_160 = 0.0; local_138.y = 0.0; if ((int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2 != 0) { do { if (-1 < (int)local_138.y) { pvVar19 = (g_manager->_itemConfig)._playerForms._begin; if ((int)local_138.y < (int)(g_manager->_itemConfig)._playerForms._end - (int)pvVar19 >> 2 ) { local_130 = *(uint **)((int)pvVar19 + (int)local_138.y * 4); if (local_130 != (uint *)0x0) { local_125 = '\0'; if (local_130[2] == 0 && local_130[3] == 0) { if (*local_130 == 0xf) { infoItem = (int *)in_ECX[1]; if (*infoItem == 0) { if ((infoItem[1] == 0x23) || (infoItem[1] == 0x106)) goto LAB_0083f4c8; } else if ((*infoItem == 1) && (infoItem[1] == 0x30)) { LAB_0083f4c8: cVar3 = '\x01'; goto LAB_0083f460; } } LAB_0083f45a: cVar3 = local_125; } else { if (*(int *)in_ECX[1] == 0) { cVar3 = FUN_0072fe80(); } else { if (*(int *)in_ECX[1] != 1) goto LAB_0083f45a; cVar3 = FUN_0072fec0(); } if (cVar3 == '\0') goto LAB_0083f45a; cVar3 = '\x01'; } LAB_0083f460: if (cVar3 != '\0') { if (*local_130 < 0x10) { iVar6 = local_158->_playerForms[*local_130]; } else { iVar6 = 0; } iVar10 = 3; if (iVar6 < 3) { iVar10 = iVar6; } pbVar5 = (byte *)FUN_00840510(); local_fc = 0; local_f8 = 0xf; formGoalText[0] = (void *)0x0; if (pbVar5 != local_27) { std::string::assign((char *)formGoalText,pbVar5,(int)local_27 - (int)pbVar5); } local_14 = 0; if (iVar10 < 0) { iVar6 = FUN_00840510(); *(undefined1 *)(iVar6 + -1) = 0x2d; pbVar5 = (byte *)(iVar6 + -1); } else { pbVar5 = (byte *)FUN_00840510(); } local_e4 = 0; local_e0 = 0xf; formCountText[0] = (void *)0x0; if (pbVar5 != local_3f) { std::string::assign((char *)formCountText,pbVar5,(int)local_3f - (int)pbVar5); } local_14._0_1_ = 1; formNameKey = local_130 + 4; if (0xf < local_130[9]) { formNameKey = (uint *)*formNameKey; } formName = string_table_translate(&g_manager->_stringTable,(byte *)formNameKey); local_5c = 0.0; local_58 = 0xf; formNameText = (void *)0x0; pbVar5 = formName; do { bVar4 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar4 != 0); std::string::assign((char *)&formNameText,formName,(int)pbVar5 - (int)(formName + 1) ); local_14._0_1_ = 2; puVar7 = std::string::append((char *)&formNameText,&DAT_00b6db20,2); pvStack_84 = (void *)*puVar7; local_80 = puVar7[1]; puStack_7c = (undefined1 *)puVar7[2]; puStack_78 = (undefined1 *)puVar7[3]; uStack_74 = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; local_14._0_1_ = 3; std::string::concat_move ((char *)formPartialText,(int)local_144.y,&pvStack_84,formCountText); local_14._0_1_ = 4; puVar7 = std::string::append((char *)formPartialText,(byte *)&DAT_00b6db28,1); local_c4._colorize[1] = (float)*puVar7; local_c4._colorize[2] = (float)puVar7[1]; local_c4._colorize[3] = (float)puVar7[2]; local_c4._offset[0] = (float)puVar7[3]; local_c4._offset[1] = (float)puVar7[4]; local_c4._offset[2] = (float)puVar7[5]; puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; local_14._0_1_ = 5; std::string::concat_move ((char *)formLineText,(int)local_144.y,local_c4._colorize + 1,formGoalText ); local_14._0_1_ = 7; if (0xf < (uint)local_c4._offset[2]) { uVar9 = (int)local_c4._offset[2] + 1; pvVar19 = (void *)local_c4._colorize[1]; if (0xfff < uVar9) { pvVar19 = *(void **)((int)local_c4._colorize[1] + -4); uVar9 = (int)local_c4._offset[2] + 0x24; if (0x1f < (uint)((int)local_c4._colorize[1] + (-4 - (int)pvVar19))) goto LAB_0083ff46; } operator_delete(pvVar19,uVar9); } local_14._0_1_ = 8; if (0xf < local_110) { uVar9 = local_110 + 1; pvVar19 = formPartialText[0]; if (0xfff < uVar9) { pvVar19 = *(void **)((int)formPartialText[0] + -4); uVar9 = local_110 + 0x24; if (0x1f < (uint)((int)formPartialText[0] + (-4 - (int)pvVar19))) goto LAB_0083ff46; } operator_delete(pvVar19,uVar9); } local_114 = 0; local_110 = 0xf; formPartialText[0] = (void *)((uint)formPartialText[0] & 0xffffff00); local_14._0_1_ = 9; if (0xf < uStack_74._4_4_) { uVar9 = uStack_74._4_4_ + 1; pvVar19 = pvStack_84; if (0xfff < uVar9) { pvVar19 = *(void **)((int)pvStack_84 + -4); uVar9 = uStack_74._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_84 + (-4 - (int)pvVar19))) goto LAB_0083ff46; } operator_delete(pvVar19,uVar9); } local_14._0_1_ = 10; if (0xf < local_58) { uVar9 = local_58 + 1; pvVar19 = formNameText; if (0xfff < uVar9) { pvVar19 = *(void **)((int)formNameText + -4); uVar9 = local_58 + 0x24; if (0x1f < (uint)((int)formNameText + (-4 - (int)pvVar19))) goto LAB_0083ff46; } operator_delete(pvVar19,uVar9); } local_5c = 0.0; local_58 = 0xf; formNameText = (void *)((uint)formNameText & 0xffffff00); local_14._0_1_ = 0xb; if (0xf < local_e0) { uVar9 = local_e0 + 1; pvVar19 = formCountText[0]; if (0xfff < uVar9) { pvVar19 = *(void **)((int)formCountText[0] + -4); uVar9 = local_e0 + 0x24; if (0x1f < (uint)((int)formCountText[0] + (-4 - (int)pvVar19))) goto LAB_0083ff46; } operator_delete(pvVar19,uVar9); } local_14._0_1_ = 0xc; if (0xf < local_f8) { uVar9 = local_f8 + 1; pvVar19 = formGoalText[0]; if (0xfff < uVar9) { pvVar19 = *(void **)((int)formGoalText[0] + -4); uVar9 = local_f8 + 0x24; if (0x1f < (uint)((int)formGoalText[0] + (-4 - (int)pvVar19))) goto LAB_0083ff46; } operator_delete(pvVar19,uVar9); } if (param_1 == (Entity_Player *)0x1) { local_144.x = textPos.x - 10.0; local_144.y = textPos.y + 0.0; rich_text_render(in_ECX + 0xe1,&local_190,&DAT_00b6db24,&local_144,&textColor,0.5, -1); } pppppppuVar8 = formLineText; if (0xf < local_c8) { pppppppuVar8 = formLineText[0]; } (*lineCallback)(pppppppuVar8); textPos.y = textPos.y + 2.0; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; lineY = textPos.y; if (0xf < local_c8) { uVar9 = local_c8 + 1; pppppppuVar8 = formLineText[0]; if (0xfff < uVar9) { pppppppuVar8 = (undefined4 *******)formLineText[0][-1]; uVar9 = local_c8 + 0x24; if (0x1f < (uint)((int)formLineText[0] + (-4 - (int)pppppppuVar8))) goto LAB_0083ff46; } operator_delete(pppppppuVar8,uVar9); lineY = textPos.y; } local_cc = 0; local_c8 = 0xf; formLineText[0] = (undefined4 *******)((uint)formLineText[0] & 0xffffff00); textPos.y = lineY; } fVar13 = lineY; } } } local_138.y = (float)((int)local_138.y + 1); } while ((uint)local_138.y < (undefined4 *) ((int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2)); infoItem = (int *)in_ECX[1]; } local_160 = (float)textColor._unk; local_170 = textColor._red; fStack_16c = textColor._green; fStack_168 = textColor._blue; fStack_164 = textColor._alpha; local_138.y = 0.0; iVar6 = infoItem[0xf] - infoItem[0xe] >> 0x1f; if ((infoItem[0xf] - infoItem[0xe]) / 0x68 + iVar6 != iVar6) { local_130 = (uint *)0x0; do { puVar7 = (undefined4 *)(infoItem[0xe] + (int)local_130); if (param_1 == (Entity_Player *)0x1) { local_144.x = textPos.x - 10.0; local_144.y = fVar13 + 0.0; rich_text_render((void *)local_150.y,&local_190,&DAT_00b6db24,&local_144,&textColor,0.5,-1 ); } if (0xf < (uint)puVar7[5]) { puVar7 = (undefined4 *)*puVar7; } (*lineCallback)(puVar7); fVar13 = textPos.y + 2.0; infoItem = (int *)in_ECX[1]; local_138.y = (float)((int)local_138.y + 1); local_130 = local_130 + 0x1a; textPos.y = fVar13; } while ((uint)local_138.y < (uint)((infoItem[0xf] - infoItem[0xe]) / 0x68)); lineY = fVar13; } local_160 = (float)textColor._unk; local_170 = textColor._red; fStack_16c = textColor._green; fStack_168 = textColor._blue; fStack_164 = textColor._alpha; local_138.y = 0.0; iVar6 = infoItem[9] - infoItem[8] >> 0x1f; if ((infoItem[9] - infoItem[8]) / 0x68 + iVar6 != iVar6) { local_130 = (uint *)0x0; do { puVar7 = (undefined4 *)(infoItem[8] + (int)local_130); if (param_1 == (Entity_Player *)0x1) { local_144.x = textPos.x - 10.0; local_144.y = fVar13 + 0.0; rich_text_render((void *)local_150.y,&local_190,&DAT_00b6db24,&local_144,&textColor,0.5,-1 ); } if (0xf < (uint)puVar7[5]) { puVar7 = (undefined4 *)*puVar7; } (*lineCallback)(puVar7); fVar13 = textPos.y + 2.0; infoItem = (int *)in_ECX[1]; local_138.y = (float)((int)local_138.y + 1); local_130 = local_130 + 0x1a; textPos.y = fVar13; } while ((uint)local_138.y < (uint)((infoItem[9] - infoItem[8]) / 0x68)); lineY = fVar13; } local_160 = (float)textColor._unk; local_170 = textColor._red; fStack_16c = textColor._green; fStack_168 = textColor._blue; fStack_164 = textColor._alpha; local_150.y = 0.0; iVar6 = infoItem[0xc] - infoItem[0xb] >> 0x1f; if ((infoItem[0xc] - infoItem[0xb]) / 0x68 + iVar6 == iVar6) { fVar13 = lineY; } else { local_138.y = 0.0; do { bVar4 = InfoDisplayItem::is_line_visible (infoItem,(int)local_150.y,local_158,*(uint *)(*in_ECX + 0x30)); if (bVar4 != 0) { if (param_1 == (Entity_Player *)0x1) { local_144.x = textPos.x - 10.0; local_144.y = textPos.y + 0.0; rich_text_render(in_ECX + 0xe1,&local_190,&DAT_00b6db24,&local_144,&textColor,0.5,-1); } puVar7 = (undefined4 *)(*(int *)(in_ECX[1] + 0x2c) + (int)local_138.y); if (0xf < (uint)puVar7[5]) { puVar7 = (undefined4 *)*puVar7; } (*lineCallback)(puVar7); textPos.y = textPos.y + 2.0; } infoItem = (int *)in_ECX[1]; local_150.y = (float)((int)local_150.y + 1); local_138.y = (float)((int)local_138.y + 0x68); fVar13 = textPos.y; } while ((uint)local_150.y < (uint)((infoItem[0xc] - infoItem[0xb]) / 0x68)); } if (*infoItem == 0) { if (param_1 == (Entity_Player *)0x0) { poolIdsBegin = param_1; local_158 = (Entity_Player *)0x0; local_150.y = 0.0; local_14._0_1_ = 0xd; local_14._1_3_ = 0; pEVar11 = (Entity_Player *)0x0; local_144.y = (float)infoItem[1]; fVar13 = 0.0; local_138.y = (float)&(g_game->_itemPool)._pools[0]._poolList._end; local_150.x = 0.0; do { poolEntry = ((std_vector *)((int)local_138.y + -4))->_begin; while( true ) { if (poolEntry == *(float **)local_138.y) break; if (*poolEntry == local_144.y) { local_190.y = fVar13; if (pEVar11 == local_158) { std::vector<4byte>::_Emplace_reallocate(); local_158 = (Entity_Player *)local_150.y; pEVar11 = (Entity_Player *)local_150.x; } else { *(float *)pEVar11 = fVar13; local_150.x = (float)&pEVar11->field_0x4; pEVar11 = (Entity_Player *)local_150.x; } break; } poolEntry = poolEntry + 6; } fVar13 = (float)((int)fVar13 + 1); local_138.y = (float)((int)local_138.y + 0x34); } while ((uint)fVar13 < 0x1f); poolIdIt = poolIdsBegin; if (poolIdsBegin != pEVar11) { do { if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { fVar13 = *(float *)poolIdIt; if (((fVar13 != 0.0) && (((fVar13 != 2.24208e-44 && (fVar13 != 2.52234e-44)) && (fVar13 != 2.38221e-44)))) && (((fVar13 != 2.8026e-44 && (fVar13 != 2.66247e-44)) && (fVar13 != 3.08286e-44))) ) { bVar12 = fVar13 == 2.94273e-44; goto LAB_0083fe96; } LAB_0083fee6: poolIdIt = (Entity_Player *)&poolIdIt->field_0x4; } else { fVar13 = *(float *)poolIdIt; if ((((fVar13 == 0.0) || (fVar13 == 1.4013e-45)) || ((fVar13 == 2.8026e-45 || (((fVar13 == 5.60519e-45 || (fVar13 == 4.2039e-45)) || (fVar13 == 7.00649e-45)))) )) || ((fVar13 == 8.40779e-45 || (fVar13 == 1.68156e-44)))) goto LAB_0083fee6; bVar12 = fVar13 == 3.64338e-44; LAB_0083fe96: if (((((bVar12) || (fVar13 == 1.12104e-44)) || ((fVar13 == 1.26117e-44 || ((((fVar13 == 4.06377e-44 || (fVar13 == 1.4013e-44)) || (fVar13 == 1.54143e-44)) || ((fVar13 == 1.82169e-44 || (fVar13 == 1.96182e-44)))))))) || (fVar13 == 3.50325e-44)) || (((fVar13 == 4.2039e-44 || (fVar13 == 3.36312e-44)) || (fVar13 == 3.22299e-44)))) goto LAB_0083fee6; memmove(poolIdIt,&poolIdIt->field_0x4,(int)pEVar11 - (int)&poolIdIt->field_0x4); pEVar11 = (Entity_Player *)&pEVar11[-1]._replacedPlayer; } } while (poolIdIt != pEVar11); } if (((int)pEVar11 - (int)poolIdsBegin & 0xfffffffcU) != 0) { *(float *)(outSize + 0x10) = *(float *)(outSize + 0x10) + 12.0; } if (poolIdsBegin != (Entity_Player *)0x0) { uVar9 = (int)local_158 - (int)poolIdsBegin & 0xfffffffc; pEVar11 = poolIdsBegin; if (0xfff < uVar9) { pEVar11 = poolIdsBegin[-1]._replacedPlayer; uVar9 = uVar9 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)poolIdsBegin + (-4 - (int)pEVar11))) { LAB_0083ff46: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar11,uVar9); } } else if (param_1 == (Entity_Player *)0x1) { local_5c = fStack_164; textPos.y = fVar13 + 4.0; textPos.x = *box; local_58 = 0; local_68 = 0x3f800000; local_64 = 0x3f800000; local_60 = 0x3f800000; local_144.x = (float)((double)(int)boxWidth + __uint_to_double_fixup[-((int)boxWidth >> 0x1f)]) * 0.5 + textPos.x; local_144.y = textPos.y + 0.0; item_pool_icons_render(); } } } else { if (param_1 == (Entity_Player *)0x1) { local_144.x = textPos.x - 10.0; local_144.y = fVar13 + 0.0; rich_text_render(in_ECX + 0xe1,&local_190,&DAT_00b6db24,&local_144,&textColor,0.5,-1); } (*lineCallback)(&DAT_00b6d12c); } ExceptionList = local_1c; return; } //@@ 00840030 PlayerHUD::set_active_charge_frame /* DB: ? ECX=PlayerHUD (AnimationState +0x154): from PlayerHUD::render_pocket_item_info; special-cases collectible 711 Flip for Tainted Lazarus (player type 29/38) and 286/263/348/489/147, else ItemConfig::GetCollectible active (type 3) chargeType 0/1/2 -> AnimationState::SetFrameFloat of the charge bar */ void PlayerHUD::set_active_charge_frame(int param_1,int param_2) { int iVar1; ItemConfig_Item *pIVar2; int in_ECX; if (param_1 == 0x2c7) { if ((*(int *)(param_2 + 0x13c0) == 0x1d) || (*(int *)(param_2 + 0x13c0) == 0x26)) goto LAB_00840055; } else if ((((param_1 == 0x11e) || (param_1 == 0x107)) || (param_1 == 0x15c)) || ((param_1 == 0x1e9 || (param_1 == 0x93)))) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),8.0); return; } pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_1); if (pIVar2 == (ItemConfig_Item *)0x0) { return; } if (pIVar2->type != 3) { return; } if (pIVar2->chargeType != 0) { if (pIVar2->chargeType != 1) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),7.0); return; } if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),6.0); return; } iVar1 = pIVar2->maxCharges; if (iVar1 == 0xc) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),5.0); return; } if (iVar1 == 6) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),4.0); return; } if (iVar1 != 4) { if (iVar1 == 3) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),2.0); return; } if (iVar1 == 2) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),1.0); return; } if (iVar1 != 1) { if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),7.0); return; } if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),0.0); return; } LAB_00840055: if (*(int *)(in_ECX + 0x158) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x154),3.0); return; } //@@ 00840250 FUN_00840250 void FUN_00840250(undefined4 *param_1) { undefined1 local_48 [4]; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; KColor local_20; undefined4 local_c; local_30 = 0; local_34 = 0; local_28 = 0; local_2c = 0; local_24 = 0x3f800000; KColor::SetFromARGB(&local_20,0xffffffff); local_c = 0x86; local_40 = 0; local_44 = 0; local_38 = 0; local_3c = 0; PlayerHUD::render_pocket_item_info(0,&local_34,FUN_008402f0,local_48); *param_1 = local_3c; param_1[1] = local_38; return; } //@@ 008402f0 FUN_008402f0 void FUN_008402f0(byte *param_1,float *param_2,int *param_3) { int iVar1; float fVar2; Vector local_10; iVar1 = __ftoui3(); Font::measure_rich_text ((Font *)(*param_3 + 900),&local_10,param_1,(int)param_2[10] - iVar1,param_2[4]); fVar2 = (float)param_3[3]; if ((float)param_3[3] <= local_10.x + *param_2) { fVar2 = local_10.x + *param_2; } param_3[3] = (int)fVar2; fVar2 = (float)param_3[4]; if ((float)param_3[4] <= local_10.y + param_2[1]) { fVar2 = local_10.y + param_2[1]; } param_3[4] = (int)fVar2; param_2[1] = local_10.y + param_2[1]; return; } //@@ 00840370 FUN_00840370 void FUN_00840370(int param_1,undefined4 param_2) { float *pfVar1; float10 fVar2; float fVar3; float fVar4; float local_4c; float afStack_48 [3]; float local_3c; float fStack_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; KColor local_20; undefined4 local_c; local_30 = 0; local_34 = 0; local_28 = 0; local_2c = 0; local_24 = 0x3f800000; KColor::SetFromARGB(&local_20,0xffffffff); local_c = 0xffffffff; pfVar1 = (float *)FUN_009c06a0(&local_3c); (**(code **)(*(int *)(param_1 + 200) + 8))(&local_4c); (**(code **)(*(int *)(param_1 + 0xf0) + 8))(afStack_48); fVar3 = local_4c * *(float *)(param_1 + 0x40); FUN_008370b0(); fVar4 = afStack_48[0] * *(float *)(param_1 + 0x44); FUN_008370b0(); local_3c = (*pfVar1 - fVar3 * 0.5) - 4.0; fStack_38 = (pfVar1[1] - fVar4 * 0.5) - 6.0; local_20._alpha = (float)__ftoui3(); fVar2 = (float10)(**(code **)(*(int *)(param_1 + 0x118) + 8))(); local_20._green = (float)fVar2; PlayerHUD::render_pocket_item_info(1,&local_3c,FUN_008404a0,param_2); return; } //@@ 008404a0 FUN_008404a0 void FUN_008404a0(byte *param_1,Vector *param_2,int param_3) { float fVar1; int iVar2; int iVar3; Vector local_10; iVar2 = __ftoui3(); fVar1 = param_2[5].x; iVar3 = __ftoui3(); rich_text_render((void *)(param_3 + 900),&local_10,param_1,param_2,(KColor *)¶m_2[2].y, param_2[2].x,(iVar2 + (int)fVar1) - iVar3); param_2->y = local_10.y + param_2->y; return; } //@@ 00840510 FUN_00840510 char * FUN_00840510(void) { char *in_ECX; uint in_EDX; uint uVar1; do { in_ECX = in_ECX + -1; uVar1 = in_EDX / 10; *in_ECX = (char)in_EDX + (char)uVar1 * -10 + '0'; in_EDX = uVar1; } while (uVar1 != 0); return in_ECX; } //@@ 00840540 int_to_string /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: std::string from the int in EDX: formats digits into a stack buffer (FUN_00840510), prepends '-' when negative, assigns into the out string (ECX); HUD::update_item_info, InfoDisplay::describe_pickup_stats prototype: db/protos.zhl */ std_string * __fastcall int_to_string(std_string *outString,int value) { int iVar1; byte *text; byte local_b [3]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_b + 7); if (value < 0) { iVar1 = FUN_00840510(); text = (byte *)(iVar1 + -1); *text = 0x2d; } else { text = (byte *)FUN_00840510(); } outString->_buf[0] = '\0'; outString->_buf[1] = '\0'; outString->_buf[2] = '\0'; outString->_buf[3] = '\0'; outString->_size = 0; outString->_capacity = 0xf; outString->_buf[0] = '\0'; if (text != local_b) { std::string::assign(outString->_buf,text,(int)local_b - (int)text); } return outString; } //@@ 008405b0 FUN_008405b0 void FUN_008405b0(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02a39; local_10 = ExceptionList; ExceptionList = &local_10; in_ECX[2] = 0x1000100; in_ECX[4] = 0; in_ECX[3] = 0; in_ECX[5] = 0x3f800000; in_ECX[6] = 0; in_ECX[7] = 0; local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 8)); local_8._0_1_ = 1; KColor::SetFromARGB((KColor *)(in_ECX + 0x4d),0xff000000); KColor::SetFromARGB((KColor *)(in_ECX + 0x52),0xffffffff); Font::Font((Font *)(in_ECX + 0x57)); local_8 = CONCAT31(local_8._1_3_,2); Font::Font((Font *)(in_ECX + 0x6a)); *in_ECX = 0; in_ECX[1] = 0; ExceptionList = local_10; return; } //@@ 00840670 HUD_Message::~HUD_Message /* DB: HUD::constructor _eh_vector_constructor_iterator_(+0x3ed0, 500, 6, 008405b0, this) and (+0x4a88, 500, 4); HUD_Message::Show runs on those arrays; ANM2 +0x20, Fonts +0x15c/+0x1a8, render target +0x18 */ void HUD_Message::~HUD_Message(void) { ANM2 *this; HUD_Message *pHVar1; char cVar2; HUD_Message *in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02a60; local_10 = ExceptionList; ExceptionList = &local_10; free_text_buffers(in_ECX); this = (ANM2 *)(in_ECX + 8); ANM2::Reset(this); KAGE::SmartPointer::reset(extraout_ECX); *(undefined1 *)(in_ECX + 2) = 0; Font::Unload((Font *)(in_ECX + 0x6a)); pHVar1 = in_ECX + 0x7a; FID_conflict__Erase_tree_>_> (pHVar1,(fuzzer_allocator_> *)pHVar1, *(_Tree_node **)((int)in_ECX[0x7a] + 4)); operator_delete((void *)*pHVar1,0x18); FUN_004b3950(); Font::Unload((Font *)(in_ECX + 0x57)); pHVar1 = in_ECX + 0x67; FID_conflict__Erase_tree_>_> (pHVar1,(fuzzer_allocator_> *)pHVar1, *(_Tree_node **)((int)in_ECX[0x67] + 4)); operator_delete((void *)*pHVar1,0x18); FUN_004b3950(); local_8 = 0; ANM2::Reset(this); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x1c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x14)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xe)); std::string::_Tidy_deallocate((char *)this); local_8 = 1; if (in_ECX[7] != (HUD_Message)0x0) { cVar2 = (**(code **)(*(int *)in_ECX[7] + 0xc))(); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 6); } } ExceptionList = local_10; return; } //@@ 008407a0 HUD_Message::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads gfx/ui/ui_streak.anm2, fonts font/MPlus_12b.fnt / font/KR_Font14.fnt (ModManager::TryRedirectPath, Font::Load), "HUD_Message Text Surface" render surface; HUD::LoadGraphics calls it once then 6 more times (one per HUD_Message) */ void HUD_Message::load_graphics(void) { char isLastRef; void *renderTarget; byte *extraout_EAX; byte *extraout_EAX_00; byte *fontPath; HUD_Message *in_ECX; KColor *clearColor; char *freeBlock; uint freeSize; undefined1 tmpRenderTarget [4]; int *renderTargetRefCount; char *krFontPath [4]; uint krFontPathSize; uint krFontPathCapacity; char *local_54 [4]; uint local_44; uint local_40; undefined1 local_3c [16]; uint local_2c; uint local_28; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00b02ab5; local_1c = ExceptionList; securityCookie = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; local_2c = 0; local_28 = 0xf; local_3c[0] = '\0'; local_3c[1] = '\0'; local_3c[2] = '\0'; local_3c[3] = '\0'; local_3c._0_4_ = std::_Allocate(0x20); local_2c = 0x15; local_28 = 0x1f; builtin_strncpy((char *)local_3c._0_4_,"gfx/ui/ui_streak.anm2",0x16); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 8),(std_string *)local_3c,1); local_14 = 0xffffffff; if (0xf < local_28) { freeSize = local_28 + 1; freeBlock = (char *)local_3c._0_4_; if (0xfff < freeSize) { freeBlock = *(char **)(local_3c._0_4_ + -4); freeSize = local_28 + 0x24; if ((char *)0x1f < (char *)(local_3c._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } KColor::SetFromARGB((KColor *)(local_3c + 4),0); renderTarget = KAGE_Graphics::create_render_target (tmpRenderTarget,400,0x80,(byte *)"HUD_Message Text Surface",clearColor); local_14 = 1; shared_ptr::operator_assign(in_ECX + 6,renderTarget); local_14 = 2; if (renderTargetRefCount != (int *)0x0) { isLastRef = (**(code **)(*renderTargetRefCount + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(tmpRenderTarget); } } manager = g_manager; local_14 = 0xffffffff; local_54[0] = std::_Allocate(0x20); local_44 = 0x12; local_40 = 0x1f; builtin_strncpy(local_54[0],"font/MPlus_12b.fnt",0x13); local_14 = 3; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)local_3c,(std_string *)local_54); local_14._0_1_ = 4; fontPath = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { fontPath = *(byte **)extraout_EAX; } Font::Load((Font *)(in_ECX + 0x57),fontPath,0); local_14 = CONCAT31(local_14._1_3_,3); if (0xf < local_28) { freeSize = local_28 + 1; freeBlock = (char *)local_3c._0_4_; if (0xfff < freeSize) { freeBlock = *(char **)(local_3c._0_4_ + -4); freeSize = local_28 + 0x24; if ((char *)0x1f < (char *)(local_3c._0_4_ + (-4 - (int)freeBlock))) goto LAB_008409ce; } operator_delete(freeBlock,freeSize); } local_14 = 0xffffffff; local_2c = 0; local_28 = 0xf; local_3c._0_4_ = local_3c._0_4_ & 0xffffff00; if (0xf < local_40) { freeSize = local_40 + 1; freeBlock = local_54[0]; if (0xfff < freeSize) { freeBlock = *(char **)(local_54[0] + -4); freeSize = local_40 + 0x24; if ((char *)0x1f < local_54[0] + (-4 - (int)freeBlock)) { LAB_008409ce: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; krFontPath[0] = std::_Allocate(0x20); krFontPathSize = 0x12; krFontPathCapacity = 0x1f; builtin_strncpy(krFontPath[0],"font/KR_Font14.fnt",0x13); local_14 = 5; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)local_54,(std_string *)krFontPath) ; local_14 = CONCAT31(local_14._1_3_,6); fontPath = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { fontPath = *(byte **)extraout_EAX_00; } Font::Load((Font *)(in_ECX + 0x6a),fontPath,0); if (0xf < local_40) { freeSize = local_40 + 1; freeBlock = local_54[0]; if (0xfff < freeSize) { freeBlock = *(char **)(local_54[0] + -4); freeSize = local_40 + 0x24; if ((char *)0x1f < local_54[0] + (-4 - (int)freeBlock)) goto LAB_00840ab4; } operator_delete(freeBlock,freeSize); } local_44 = 0; local_40 = 0xf; local_54[0] = (char *)((uint)local_54[0] & 0xffffff00); if (0xf < krFontPathCapacity) { freeSize = krFontPathCapacity + 1; freeBlock = krFontPath[0]; if (0xfff < freeSize) { freeBlock = *(char **)(krFontPath[0] + -4); freeSize = krFontPathCapacity + 0x24; if ((char *)0x1f < krFontPath[0] + (-4 - (int)freeBlock)) { LAB_00840ab4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } in_ECX[3] = (HUD_Message)0x0; in_ECX[4] = (HUD_Message)0x0; in_ECX[5] = (HUD_Message)0x3f800000; free_text_buffers(in_ECX); ExceptionList = local_1c; return; } //@@ 00840b00 HUD_Message::Show /* DB: string "HUD_Message::Show() recieved NULL messageText"; text_out, sets title/subtitle (FUN_00841000 0/1), plays "TextIn" (or alt), layer 1 visible = param_4, UpdateTextImage; Level::ShowName, HUD::ShowItemText, PlayerHUD::show_pill_name prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall HUD_Message::Show(HUD_Message *this,byte *title,byte *subtitle,byte autoHide,byte isCurseDisplay) { byte bVar1; short *text; char *anim; LayerState *pLVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02ae0; local_10 = ExceptionList; ExceptionList = &local_10; if (title == (byte *)0x0) { KAGE_LogMessage(8,(byte *) "HUD_Message::Show() recieved NULL messageText (This will have no effect) \n") ; ExceptionList = local_10; return; } text = utf8_to_utf16_alloc(title); if (subtitle == (byte *)0x0) { title = (byte *)0x0; } else { title = (byte *)utf8_to_utf16_alloc(subtitle); } if (text == (short *)0x0) { KAGE_LogMessage(8,(byte *) "HUD_Message::Show() recieved NULL messageText (This will have no effect) \n") ; } else { text_out(this); set_text_line(this,text,0); if (title != (byte *)0x0) { set_text_line(this,(short *)title,1); } this[2].field_0x2 = isCurseDisplay; anim = &DAT_00b1c208; if (autoHide == 0) { anim = "TextIn"; } this[2].field_0x1 = autoHide; bVar1 = ANM2::SetAnimation((ANM2 *)(this + 8),(byte *)anim,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x14)); *(undefined1 *)(this + 0x19) = 1; } bVar1 = this[2].field_0x2; pLVar2 = ANM2::GetLayer((ANM2 *)(this + 8),(byte *)0x1); pLVar2->_visible = bVar1; UpdateTextImage(this); *(undefined1 *)(this + 2) = 1; } local_8 = 0; tracked_alloc(1,text,0); local_8 = 1; tracked_alloc(1,title,0); ExceptionList = local_10; return; } //@@ 00840c60 HUD_Message::text_out /* ZHL [exact] __thiscall void HUD_Message::text_out(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall HUD_Message::text_out(HUD_Message *this) { byte bVar1; byte *pbVar2; uint uVar3; char *pcVar4; bool bVar5; if (*(char *)(this + 2) != '\0') { if ((this[0x15] != (HUD_Message)0x0) && (*(char *)(this + 0x19) != '\0')) { pbVar2 = *(byte **)(this + 0x15); if ((HUD_Message)pbVar2 == (HUD_Message)0x0) { pbVar2 = &s_empty; } else if (0xf < *(uint *)((int)pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pcVar4 = "TextOut"; do { bVar1 = *pbVar2; bVar5 = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_00840cb0: uVar3 = -(uint)bVar5 | 1; goto LAB_00840cb5; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)pbVar2 + 1); bVar5 = bVar1 < (byte)pcVar4[1]; if (bVar1 != pcVar4[1]) goto LAB_00840cb0; pbVar2 = (byte *)((int)pbVar2 + 2); pcVar4 = pcVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00840cb5: if (uVar3 == 0) { return; } } bVar1 = ANM2::SetAnimation((ANM2 *)(this + 8),(byte *)"TextOut",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x14)); *(undefined1 *)(this + 0x19) = 1; } } return; } //@@ 00840ce0 FUN_00840ce0 void FUN_00840ce0(void) { byte bVar1; HUD_Message HVar2; uint uVar3; byte *pbVar4; HUD_Message *in_ECX; char *pcVar5; byte *pbVar6; bool bVar7; if (*(char *)(in_ECX + 2) == '\0') { return; } if (in_ECX[0x4a].field_0x1 != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x14)); AnimationState::Update((AnimationState *)(in_ECX + 0x1c)); } if ((in_ECX[0x15] != (HUD_Message)0x0) && (*(char *)(in_ECX + 0x19) == '\0')) { HVar2 = in_ECX[0x15]; if (0xf < *(uint *)((int)HVar2 + 0x14)) { HVar2 = *(HUD_Message *)HVar2; } pcVar5 = "TextIn"; do { bVar1 = *(byte *)HVar2; bVar7 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_00840d42: uVar3 = -(uint)bVar7 | 1; goto LAB_00840d47; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)HVar2 + 1); bVar7 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_00840d42; HVar2 = (HUD_Message)((int)HVar2 + 2); pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00840d47: if (uVar3 == 0) { ANM2::Play((ANM2 *)(in_ECX + 8),(byte *)"TextStay",0); return; } } HVar2 = in_ECX[0x15]; if ((HVar2 != (HUD_Message)0x0) && (*(char *)(in_ECX + 0x19) == '\0')) { if (0xf < *(uint *)((int)HVar2 + 0x14)) { HVar2 = *(HUD_Message *)HVar2; } pcVar5 = "TextOut"; do { bVar1 = *(byte *)HVar2; bVar7 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_00840d95: uVar3 = -(uint)bVar7 | 1; goto LAB_00840d9a; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)HVar2 + 1); bVar7 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_00840d95; HVar2 = (HUD_Message)((int)HVar2 + 2); pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00840d9a: if (uVar3 == 0) goto LAB_00840dee; } if (in_ECX[0x15] == (HUD_Message)0x0) { return; } if (*(char *)(in_ECX + 0x19) != '\0') { return; } pbVar4 = *(byte **)(in_ECX + 0x15); if ((HUD_Message)pbVar4 == (HUD_Message)0x0) { pbVar4 = &s_empty; } else if (0xf < *(uint *)((int)pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pbVar6 = &DAT_00b1c208; do { bVar1 = *pbVar4; bVar7 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_00840de5: uVar3 = -(uint)bVar7 | 1; goto LAB_00840dea; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)pbVar4 + 1); bVar7 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_00840de5; pbVar4 = (byte *)((int)pbVar4 + 2); pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00840dea: if (uVar3 != 0) { return; } LAB_00840dee: if (*(char *)(in_ECX + 2) != '\0') { HUD_Message::free_text_buffers(in_ECX); *(undefined1 *)(in_ECX + 2) = 0; } return; } //@@ 00840e10 FUN_00840e10 void FUN_00840e10(float param_1,undefined4 param_2) { Vector *position; float fVar1; int iVar2; int iVar3; float *pfVar4; int in_ECX; KColor *color; undefined4 in_XMM1_Da; undefined1 local_9c [116]; KColor local_28; Vector local_14; Vector local_c; position = (Vector *)(in_ECX + 0xc); position->x = param_1; *(undefined4 *)(in_ECX + 0x10) = param_2; *(undefined4 *)(in_ECX + 0x14) = in_XMM1_Da; if (*(char *)(in_ECX + 8) != '\0') { *(undefined4 *)(in_ECX + 0xbc) = in_XMM1_Da; *(undefined4 *)(in_ECX + 0xc0) = in_XMM1_Da; ANM2::Render((ANM2 *)(in_ECX + 0x20),position,&g_vectorZero,&g_vectorZero); if (*(int *)(in_ECX + 0x54) != 0) { pfVar4 = AnimationState::GetNullFrameById((AnimationState *)(in_ECX + 0x50),0); if (pfVar4 != (float *)0x0) { fVar1 = *(float *)(in_ECX + 0x14); iVar2 = *(int *)(*(int *)(in_ECX + 0x18) + 0x10); iVar3 = *(int *)(*(int *)(in_ECX + 0x18) + 0x14); local_c.x = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * pfVar4[4] * fVar1; local_c.y = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * pfVar4[5] * fVar1; local_14.x = ((*pfVar4 + position->x) - local_c.x * 0.5) + (g_game->_screenShakeOffset).x; local_14.y = ((*(float *)(in_ECX + 0x10) + pfVar4[1]) - fVar1 * 9.0) + (g_game->_screenShakeOffset).y; KColor::SetFromARGB(&local_28,0xffffffff); render_quad_set_rect(local_9c,&local_14,&local_c,color); (**(code **)(**(int **)(in_ECX + 0x18) + 0x1c))(local_9c,g_drawRectUnset); } } } return; } //@@ 00840f70 HUD_Message::free_text_buffers /* DB: ? frees the two tracked-heap buffers at ECX[0..1] and nulls them; HUD_Message::~HUD_Message, HUD::render_streak_texts, HUD::unload_graphics prototype: db/protos.zhl */ void __thiscall HUD_Message::free_text_buffers(HUD_Message *this) { HUD_Message HVar1; uint uVar2; qword qVar3; qword *pqVar4; int iVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = 0; do { HVar1 = this[iVar5]; if (HVar1 != (HUD_Message)0x0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)HVar1 + -4); qVar3 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)((int)HVar1 + -4)); this[iVar5] = (HUD_Message)0x0; } iVar5 = iVar5 + 1; } while (iVar5 < 2); ExceptionList = local_10; return; } //@@ 00841000 HUD_Message::set_text_line /* DB: (utf16Text, lineIdx): frees the old wide string in slot ECX[lineIdx] and stores a tracked_alloc copy of the UTF-16 text; HUD_Message::Show sets title/subtitle with lines 0/1, also HUD::ShowItemText and HUD::ShowStackedItemTextCustomUTF16 prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall HUD_Message::set_text_line(HUD_Message *this,short *text,int lineIndex) { uint uVar1; short sVar2; longlong lVar3; short *psVar4; HUD_Message _Dst; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02b00; local_10 = ExceptionList; ExceptionList = &local_10; if (this[lineIndex] != (HUD_Message)0x0) { local_8 = 0; tracked_alloc(1,(void *)this[lineIndex],0); this[lineIndex] = (HUD_Message)0x0; } local_8 = 0xffffffff; psVar4 = text; do { sVar2 = *psVar4; psVar4 = psVar4 + 1; } while (sVar2 != 0); uVar1 = ((int)psVar4 - (int)(text + 1) >> 1) + 1; lVar3 = (ulonglong)uVar1 * 2; _Dst = (HUD_Message) tracked_alloc(0,(void *)0x0, (ulonglong)(-(uint)((int)((ulonglong)lVar3 >> 0x20) != 0) | (uint)lVar3)); this[lineIndex] = _Dst; memcpy((void *)_Dst,text,uVar1 * 2); ExceptionList = local_10; return; } //@@ 008410c0 HUD_Message::UpdateTextImage /* ZHL [exact] __thiscall void HUD_Message::UpdateTextImage(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall HUD_Message::UpdateTextImage(HUD_Message *this) { char cVar1; undefined4 *targetStackEntry; uint uVar2; int unused; int unused_00; float fVar3; float textY; undefined4 drawSettings; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; KColor textColor; undefined8 local_1c; Font *subtitleFont; void *local_10; undefined1 *puStack_c; undefined4 local_8; HUD_Message text; Font *titleFont; local_8 = 0xffffffff; puStack_c = &LAB_00b02b35; local_10 = ExceptionList; ExceptionList = &local_10; titleFont = &g_manager->_font7_Upheaval; if (this[2].field_0x2 == '\0') { subtitleFont = &g_manager->_font9_PFTempestaSevenCondensedAgain; } else { subtitleFont = &g_manager->_font1_TeamMeatEx10; } local_1c = 0; std::vector::resize(&local_1c); targetStackEntry = std::deque::back(); if ((byte *)(targetStackEntry + 1) != (byte *)0x0) { *(byte *)(targetStackEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *targetStackEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)this[6],0); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; text = *this; fVar3 = (float)(*(uint *)((int)this[6] + 0x10) >> 1) + 0.0; local_1c = CONCAT44(fVar3,(undefined4)local_1c); if (text != (HUD_Message)0x0) { if (*(short *)text == 1) { KColor::SetFromARGB(&textColor,0xffffffff); if ((*(char *)(this + 0x57) == '\0') && (*(char *)(this + 0x6a) == '\0')) { textY = 0.0; } else { textY = 2.0; } render_text_image(titleFont,(short *)((int)text + 2),fVar3,textY,&textColor,unused); } else { uVar2 = Font::get_string_width_utf16(titleFont,(short *)text,-1); drawSettings = 0; local_48 = 0xffff; local_44 = 0; local_40 = 0x3f800000; local_3c = 0xffffffff; local_38 = 0; local_34 = 0; fVar3 = fVar3 - ((float)(uVar2 >> 1) + 0.0); local_8 = 0; KColor::SetFromARGB(&textColor,0xffffffff); if ((*(char *)(this + 0x57) == '\0') && (*(char *)(this + 0x6a) == '\0')) { textY = 0.0; } else { textY = 2.0; } Font::draw_string_wide_unscaled(titleFont,(short *)*this,fVar3,textY,&textColor,&drawSettings) ; local_8 = 0xffffffff; } fVar3 = local_1c._4_4_; } text = this[1]; if (text != (HUD_Message)0x0) { cVar1 = this[2].field_0x2; uVar2 = 0xffffffff; if (cVar1 != '\0') { uVar2 = 0xff000000; } KColor::SetFromARGB(&textColor,uVar2); textY = 18.0; if (cVar1 != '\0') { textY = 26.0; } if (*(short *)text == 1) { render_text_image(subtitleFont,(short *)((int)text + 2),fVar3,textY,&textColor,unused_00); } else { uVar2 = Font::get_string_width_utf16(subtitleFont,(short *)text,-1); drawSettings = 0; local_48 = 0xffff; local_44 = 0; local_40 = 0x3f800000; local_3c = 0xffffffff; local_38 = 0; local_34 = 0; local_8 = 1; Font::draw_string_wide_unscaled (subtitleFont,(short *)this[1],fVar3 - ((float)(uVar2 >> 1) + 0.0),textY,&textColor, &drawSettings); local_8 = 0xffffffff; } } _glfw_context_reset(1); pop_render_target(); ExceptionList = local_10; return; } //@@ 008413a0 HUD_Message::render_text_image /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? called twice from HUD_Message::UpdateTextImage with (utf8 str, wide str, size, out); lays out glyphs (00a1c480), renders into the layer texture with KAGE_ColorShader (Exposure/Gamma uniforms), render_quad_set_rect prototype: db/protos.zhl, confirmed by RET 20 */ void HUD_Message::render_text_image(Font *font,short *text,float x,float y,KColor *color,int unused) { byte isFontLoaded; char cVar1; int iVar2; void *pvVar3; uint uVar4; LayerState *pLVar5; undefined *shader; ushort ch; int unused_00; int unused_01; uint uVar6; double dVar7; int *image; int *imageRefCount; undefined1 auStack_182 [2]; undefined1 quad [44]; float local_14c; float local_138; float local_124; float local_110; void *local_100; undefined1 local_fc [16]; float local_ec; float local_e8; float local_e4; float local_e0; float local_dc; float local_d8; float local_d4; float local_d0; undefined1 local_cc; Vector quadSize; undefined1 local_c0 [4]; int *local_bc; undefined1 local_b8 [4]; int *local_b4; undefined1 local_b0 [4]; int *local_ac; undefined1 local_a8 [4]; int *local_a4; undefined1 local_a0 [4]; int *local_9c; Vector local_94; undefined1 local_8c [4]; int *local_88; undefined1 local_84 [4]; int *local_80; undefined1 local_7c [4]; int *local_78; ushort *charPtr; int *charBuf; int *local_6c; int *local_64; int *textureRef; int *local_5c; ushort *local_58; int *local_54; undefined1 local_50 [28]; float fStack_34; float fStack_30; float fStack_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00b02bcf; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; charPtr = (ushort *)text; local_54 = (int *)0x0; charBuf = (int *)(uint)(ushort)*text; if (*text != 0) { isFontLoaded = font->_isLoaded; local_58 = (ushort *)text; local_5c = charBuf; do { if (isFontLoaded == 0) { LAB_00841470: iVar2 = 8; } else { local_6c = charBuf; _Find_lower_bound<>(); if ((*(char *)((int)local_94.y + 0xd) != '\0') || (pvVar3 = (void *)local_94.y, ((uint)charBuf & 0xffff) < *(uint *)((int)local_94.y + 0x10))) { pvVar3 = (font->_charsBlock)._head; } if (pvVar3 == (font->_charsBlock)._head) { iVar2 = font->_missingCharacter; } else { iVar2 = *(int *)((int)pvVar3 + 0x14); } if ((iVar2 == -1) || (iVar2 = (int)*(short *)((int)font->_chars + iVar2 * 0x14 + 0x10), iVar2 == 0)) goto LAB_00841470; } local_58 = local_58 + 1; local_54 = (int *)((int)local_54 + iVar2); charBuf = (int *)(uint)*local_58; isFontLoaded = font->_isLoaded; } while (*local_58 != 0); local_6c = (int *)((uint)local_5c & 0xffff); local_58 = (ushort *)(x - ((float)((uint)local_54 >> 1) + 0.0)); charBuf = (int *)0x0; do { if (font->_isLoaded == 0) { LAB_008415fb: ch = *charPtr; LAB_00841601: local_6c = (int *)0x8; local_64 = (int *)0x0; textureRef = (int *)0x0; uVar4 = ch + 1; local_14 = 0; uVar6 = uVar4 >> 5 ^ uVar4; local_5c = (int *)((uVar4 >> 0xc ^ uVar6) & 7); local_54 = (int *)((uVar6 >> 8 ^ uVar6) & 0xffff); switch(local_5c) { case (int *)0x0: pLVar5 = ANM2::GetLayer(&(g_game->_hud)._heartsSprite,(byte *)0x0); pvVar3 = LayerState::GetTexture(pLVar5,local_a0); local_14._0_1_ = 1; KAGE::SmartPointer::operator_assign(&local_64,pvVar3); local_14._0_1_ = 2; if (local_9c != (int *)0x0) { cVar1 = (**(code **)(*local_9c + 0xc))(); pvVar3 = g_imageReleaseFn; joined_r0x00841934: if ((cVar1 != '\0') && (pvVar3 != (code *)0x0)) { (*pvVar3)(); } } break; case (int *)0x1: pLVar5 = ANM2::GetLayer(&(g_game->_hud)._chargeBarSprite,(byte *)0x0); pvVar3 = LayerState::GetTexture(pLVar5,local_a8); local_14._0_1_ = 3; KAGE::SmartPointer::operator_assign(&local_64,pvVar3); local_14._0_1_ = 4; if (local_a4 != (int *)0x0) { cVar1 = (**(code **)(*local_a4 + 0xc))(); pvVar3 = g_imageReleaseFn; goto joined_r0x00841934; } break; case (int *)0x2: pLVar5 = ANM2::GetLayer(&(g_game->_hud)._pickupHUDSprite,(byte *)0x0); pvVar3 = LayerState::GetTexture(pLVar5,local_b0); local_14._0_1_ = 5; KAGE::SmartPointer::operator_assign(&local_64,pvVar3); local_14._0_1_ = 6; if (local_ac != (int *)0x0) { cVar1 = (**(code **)(*local_ac + 0xc))(); pvVar3 = g_imageReleaseFn; goto joined_r0x00841934; } break; case (int *)0x3: pLVar5 = ANM2::GetLayer(&(g_game->_hud)._cardsPillsSprite,(byte *)0x0); pvVar3 = LayerState::GetTexture(pLVar5,local_b8); local_14._0_1_ = 7; KAGE::SmartPointer::operator_assign(&local_64,pvVar3); local_14._0_1_ = 8; if (local_b4 != (int *)0x0) { cVar1 = (**(code **)(*local_b4 + 0xc))(); pvVar3 = g_imageReleaseFn; goto joined_r0x00841934; } break; case (int *)0x4: shared_ptr::assign(local_7c,(void *)((int)g_game->_room + 0x1bc8)); local_14._0_1_ = 9; KAGE::SmartPointer::operator_assign(&local_64,local_7c); local_14._0_1_ = 10; if (local_78 != (int *)0x0) { cVar1 = (**(code **)(*local_78 + 0xc))(); pvVar3 = g_renderTargetReleaseFn; goto joined_r0x00841934; } break; case (int *)0x5: shared_ptr::assign(local_84,(void *)((int)g_game->_room + 0x1bd0)); local_14._0_1_ = 0xb; KAGE::SmartPointer::operator_assign(&local_64,local_84); local_14._0_1_ = 0xc; if (local_80 != (int *)0x0) { cVar1 = (**(code **)(*local_80 + 0xc))(); pvVar3 = g_renderTargetReleaseFn; goto joined_r0x00841934; } break; case (int *)0x6: pLVar5 = ANM2::GetLayer(&(g_game->_hud)._statsSprite,(byte *)0x0); pvVar3 = LayerState::GetTexture(pLVar5,local_c0); local_14._0_1_ = 0xd; KAGE::SmartPointer::operator_assign(&local_64,pvVar3); local_14._0_1_ = 0xe; if (local_bc != (int *)0x0) { cVar1 = (**(code **)(*local_bc + 0xc))(); pvVar3 = g_imageReleaseFn; goto joined_r0x00841934; } break; case (int *)0x7: KAGE::SmartPointer::operator_assign(local_8c,&DAT_00c798a8); local_14._0_1_ = 0xf; KAGE::SmartPointer::operator_assign(&local_64,local_8c); local_14._0_1_ = 0x10; if (local_88 != (int *)0x0) { cVar1 = (**(code **)(*local_88 + 0xc))(); pvVar3 = g_imageReleaseFn; goto joined_r0x00841934; } } local_14 = (uint)local_14._1_3_ << 8; if (local_64 != (int *)0x0) { uVar4 = (uint)local_64[4] >> 3; local_cc = 1; local_28 = 0.0; quadSize.x = 8.0; quadSize.y = 16.0; iVar2 = (int)local_54 % (int)(((uint)local_64[5] >> 4) * uVar4); local_94.x = (float)local_58; local_e8 = (float)(iVar2 / (int)uVar4) * 16.0; local_d8 = local_e8 + 16.0; local_ec = (float)(iVar2 % (int)uVar4) * 8.0; local_e4 = local_ec + 8.0; local_50._24_4_ = 1.0; fStack_34 = 1.0; fStack_30 = 1.0; fStack_2c = 1.0; local_94.y = y; local_e0 = local_e8; local_dc = local_ec; local_d4 = local_e4; local_d0 = local_d8; render_quad_set_rect(quad,&local_94,&quadSize,(KColor *)(local_50 + 0x18)); if (local_5c == (int *)&DAT_00000007) { if ((g_manager->_optionsConfig)._enableColorCorrection == 0) { if ((local_14c + local_138 + local_124 + local_110) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); FUN_00a11080(); pvVar3 = kage_graphics_flush((void *)0x0); render_quad_draw(pvVar3,local_50 + 8,quad,1,unused_01); FUN_00a14200(); } goto LAB_00841bda; } local_5c = (int *)0x3f800000; shader = &DAT_00c79398; if ((DAT_00c7939c & 1) == 0) { shader = g_currentShader; } local_54 = (int *)0x3f800000; g_currentShader = shader; Shader::set_uniform(shader,(byte *)"Exposure",8,&local_5c,(int)shader); Shader::set_uniform(g_currentShader,(byte *)"Gamma",8,&local_54,unused_00); } else { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; fStack_30 = 0.0; fStack_2c = 0.0; image = (int *)0x0; imageRefCount = (int *)0x0; local_28 = 0.0; local_5c = textureRef; local_54 = local_64; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; local_50._24_4_ = 0.0; fStack_34 = 0.0; g_currentShader = shader; if (textureRef != (int *)0x0) { cVar1 = (**(code **)(*textureRef + 4))(); if (cVar1 != '\0') { if (((imageRefCount != (int *)0x0) && (cVar1 = (**(code **)(*imageRefCount + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStack_182 + -10); } image = local_54; imageRefCount = local_5c; } } apply_sprite_shader_params((ColorMod *)local_50,1,image,imageRefCount); } (**(code **)(*local_64 + 0x14))(&local_ec); } LAB_00841bda: local_14 = 0x11; if (((textureRef != (int *)0x0) && (cVar1 = (**(code **)(*textureRef + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } else { local_5c = local_6c; _Find_lower_bound<>(); if ((*(char *)((int)local_100 + 0xd) != '\0') || (pvVar3 = local_100, ((uint)local_6c & 0xffff) < *(uint *)((int)local_100 + 0x10))) { pvVar3 = (font->_charsBlock)._head; } if (pvVar3 == (font->_charsBlock)._head) { iVar2 = font->_missingCharacter; } else { iVar2 = *(int *)((int)pvVar3 + 0x14); } if (iVar2 == -1) goto LAB_008415fb; local_6c = (int *)(int)*(short *)((int)font->_chars + iVar2 * 0x14 + 0x10); ch = *charPtr; if (local_6c == (int *)0x0) goto LAB_00841601; charBuf = (int *)(uint)ch; local_50._16_4_ = 0.0; local_50._20_4_ = 9.18341e-41; local_50._24_4_ = 0.0; fStack_34 = 1.0; fStack_30 = -NAN; fStack_2c = 0.0; local_28 = 0.0; local_14 = 0x12; pvVar3 = Font::layout_glyphs(font,local_fc,(byte *)&charBuf,local_50 + 0x10,&g_vectorOne); local_14 = CONCAT31(local_14._1_3_,0x13); Font::draw_glyph_run(font,(float)local_58,y,pvVar3,1.0,1.0,*color,local_50 + 0x10); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); } local_14 = 0xffffffff; iVar2 = (int)local_6c >> 0x1f; dVar7 = (double)(int)local_6c; charPtr = charPtr + 1; local_6c = (int *)(uint)*charPtr; local_58 = (ushort *)((float)(dVar7 + __uint_to_double_fixup[-iVar2]) + (float)local_58); } while (*charPtr != 0); } ExceptionList = local_1c; return; } //@@ 00841ca0 Entity_Player::GetJarFlies /* ZHL [lua] Lua binding EntityPlayer:GetJarFlies */ int __thiscall Entity_Player::GetJarFlies(Entity_Player *this) { return this->_jarFlies; } //@@ 00841cb0 Entity_Player::GetActiveSubCharge /* ZHL [exact] __thiscall int Entity_Player::GetActiveSubCharge(int slot); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Entity_Player::GetActiveSubCharge(Entity_Player *this,int slot) { if ((uint)slot < 4) { return this->_activeDesc[slot]._subCharge; } return 0; } //@@ 00841cd0 Entity_Player::GetPoopSpell /* ZHL [lua] Lua binding EntityPlayer:GetPoopSpell */ undefined1 Entity_Player::GetPoopSpell(uint param_1) { int in_ECX; if (param_1 < 6) { return *(undefined1 *)(param_1 + 0x1f58 + in_ECX); } return 0; } //@@ 00841cf0 PlayerHUD::reset /* DB: ECX = HUD::_playerHUD entry: clears 0x18 16-byte slots (s_empty strings), SmartPointer::reset loops, vector at +0x6a0 cleared, *this (player) = 0; HUD::AssignPlayerHUDs calls it when slot player != 0, also PlayerHUD dtor 006efde0 and HUD::unload_graphics prototype: db/protos.zhl */ void __thiscall PlayerHUD::reset(PlayerHUD *this) { undefined1 *puVar1; int iVar2; undefined4 *extraout_ECX; undefined4 *extraout_ECX_00; undefined4 *this_00; int iVar3; void *this_01; int *piVar4; puVar1 = &this->field_0x11; iVar2 = 0x18; do { iVar3 = iVar2; *(undefined4 *)(puVar1 + -1) = 0; *(byte **)(puVar1 + 7) = &s_empty; *(byte **)(puVar1 + 0xb) = &s_empty; puVar1[3] = 0; iVar2 = iVar3 + -1; puVar1 = puVar1 + 0x10; } while (iVar2 != 0); this_01 = &this->field_0x208; this->_lastHeartFlash = 0; this->_redHeartFlashCountdown = 0; this->_soulHeartFlashCountdown = 0; iVar3 = iVar3 + 1; this->_goldHeartFlashCountdown = 0; do { *(undefined4 *)((int)this_01 + -8) = 0; *(undefined4 *)((int)this_01 + -4) = 0; KAGE::SmartPointer::reset(this_01,(void *)0x0); this_01 = (void *)((int)this_01 + 0x18); iVar3 = iVar3 + -1; } while (iVar3 != 0); piVar4 = &this->_activeItem[1]._bookItemId; iVar2 = 4; do { piVar4[-6] = 0; piVar4[-5] = 0; *piVar4 = 0; if (piVar4[-4] != 0) { KAGE::SmartPointer::reset(piVar4 + -4,(void *)0x0); } this_00 = piVar4 + -2; if (piVar4[-2] != 0) { KAGE::SmartPointer::reset(this_00,(void *)0x0); this_00 = extraout_ECX; } piVar4 = piVar4 + 7; iVar2 = iVar2 + -1; } while (iVar2 != 0); iVar2 = *(int *)&this->field_0x6a0; if (iVar2 != *(int *)&this->field_0x6a4) { do { KAGE::SmartPointer::reset((void *)(iVar2 + 4),(void *)0x0); iVar2 = iVar2 + 0xc; this_00 = extraout_ECX_00; } while (iVar2 != *(int *)&this->field_0x6a4); } FUN_00709380(this_00); *(undefined4 *)&this->field_0x6a4 = *(undefined4 *)&this->field_0x6a0; *(undefined2 *)&this->field_0x6ac = 0; KAGE::SmartPointer::reset(this + 1,(void *)0x0); KAGE::SmartPointer::reset(&this[1].field_0x1c,(void *)0x0); this->_player = (void *)0x0; return; } //@@ 00841e20 PlayerHUD::UpdateHearts /* ZHL [exact] __thiscall void PlayerHUD::UpdateHearts(PlayerHUDHeart* heart, int unkInt, Entity_Player* player); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall PlayerHUD::UpdateHearts(PlayerHUD *this,void *heart,int unkInt,Entity_Player *player) { byte bVar1; int iVar2; int healthType; undefined2 *redSlot; int healthType; uint parity; char *pcVar4; undefined1 isTemporary; byte flashType; Entity_Player *this_00; undefined4 *brokenSlot; int iVar5; int extraout_EDX; uint soulHalf; undefined1 *heartSlot; int iVar6; int filledHearts; int soulSlotIndex; int eternalHeartSlot; uint boneMaskBit; uint soulHalfSaved; int soulHeartsLeft; int redHeartsLeft; int rottenHeartsLeft; char isTaintedMaggy; iVar6 = 0; iVar2 = (player->_maxHearts + 1) / 2; rottenHeartsLeft = player->_rottenHearts; filledHearts = 0; iVar5 = player->_brokenHearts; redHeartsLeft = player->_redHearts + rottenHeartsLeft * -2; healthType = Entity_Player::GetHealthType(player); if (healthType != 2) { if ((*(int *)(extraout_EDX + 0x13c0) != 0x16) || (isTaintedMaggy = '\x01', *(int *)(extraout_EDX + 0x1ef4) < 1)) { isTaintedMaggy = '\0'; } bVar1 = Entity_Player::HasCollectible(this_00,0x26b,0); if (0 < iVar2) { redSlot = (undefined2 *)((int)heart + 2); do { if (unkInt <= iVar6) break; *(undefined1 *)(redSlot + -1) = 1; if ((isTaintedMaggy == '\0') || (iVar6 < (int)((uint)(bVar1 != 0) * 2 + 4 >> 1))) { isTemporary = 0; } else { isTemporary = 1; } *(undefined1 *)((int)redSlot + 1) = isTemporary; if (redHeartsLeft < 1) { if (rottenHeartsLeft < 1) { *redSlot = 0; pcVar4 = "EmptyHeart"; if (healthType == 3) { pcVar4 = "CoinEmpty"; } *(char **)(redSlot + 3) = pcVar4; *(undefined1 *)(redSlot + 1) = 0; } else { filledHearts = filledHearts + 1; *(undefined1 *)redSlot = 1; *(char **)(redSlot + 3) = "RottenHeartFull"; rottenHeartsLeft = rottenHeartsLeft + -1; *(byte *)(redSlot + 1) = ((char)this->_redHeartFlashCountdown < '\x01') - 1U & 5; } } else { filledHearts = filledHearts + 1; *(undefined1 *)redSlot = 1; if (healthType == 3) { pcVar4 = "CoinHeartFull"; if (redHeartsLeft < 2) { pcVar4 = "CoinHeartHalf"; } *(char **)(redSlot + 3) = pcVar4; flashType = ((char)this->_redHeartFlashCountdown < '\x01') - 1U & 4; } else { pcVar4 = "RedHeartFull"; if (redHeartsLeft < 2) { pcVar4 = "RedHeartHalf"; } *(char **)(redSlot + 3) = pcVar4; flashType = '\0' < (char)this->_redHeartFlashCountdown; } *(byte *)(redSlot + 1) = flashType; redHeartsLeft = redHeartsLeft + -2; if (redHeartsLeft < 0) { redHeartsLeft = 0; } } iVar6 = iVar6 + 1; redSlot = redSlot + 8; } while (iVar6 < iVar2); } eternalHeartSlot = iVar6 + -1; soulSlotIndex = 0; if (eternalHeartSlot < 0) { eternalHeartSlot = 0; } soulHeartsLeft = player->_soulHearts; soulHalf = 1; iVar2 = (soulHeartsLeft + 1) / 2 + player->_boneHearts; soulHalfSaved = 1; if (0 < iVar2) { boneMaskBit = 1; do { if (unkInt <= iVar6) break; filledHearts = filledHearts + 1; heartSlot = (undefined1 *)(iVar6 * 0x10 + (int)heart); heartSlot[3] = isTaintedMaggy; *heartSlot = 1; heartSlot[2] = 1; if ((player->_boneHearts < 1) || ((player->_boneHeartsMask & boneMaskBit) == 0)) { if ((player->_soulHearts < (int)soulHalf) || ((int)soulHalf < 1)) { LAB_00842107: soulHalfSaved = soulHalf; pcVar4 = "BlueHeartFull"; if (soulHeartsLeft < 2) { pcVar4 = "BlueHeartHalf"; } *(char **)(heartSlot + 8) = pcVar4; bVar1 = ((char)this->_soulHeartFlashCountdown < '\x01') - 1U & 2; } else { parity = soulHalf & 0x80000001; if ((int)parity < 0) { parity = (parity - 1 | 0xfffffffe) + 1; } if (parity != 1) goto LAB_00842107; if ((player->_blackHearts & 1 << ((byte)((int)(soulHalf - 1) / 2) & 0x1f)) == 0) { soulHalf = soulHalfSaved; goto LAB_00842107; } pcVar4 = "BlackHeartFull"; if (soulHeartsLeft < 2) { pcVar4 = "BlackHeartHalf"; } *(char **)(heartSlot + 8) = pcVar4; bVar1 = ((char)this->_soulHeartFlashCountdown < '\x01') - 1U & 3; } heartSlot[4] = bVar1; soulHeartsLeft = soulHeartsLeft + -2; if (soulHeartsLeft < 0) { soulHeartsLeft = 0; } soulHalf = soulHalfSaved + 2; soulHalfSaved = soulHalf; } else { if (redHeartsLeft < 1) { if (rottenHeartsLeft < 1) { *(char **)(heartSlot + 8) = "BoneHeartEmpty"; bVar1 = 0; } else { rottenHeartsLeft = rottenHeartsLeft + -1; *(char **)(heartSlot + 8) = "RottenBoneHeartFull"; bVar1 = ((char)this->_redHeartFlashCountdown < '\x01') - 1U & 5; } } else { pcVar4 = "BoneHeartFull"; if (redHeartsLeft < 2) { pcVar4 = "BoneHeartHalf"; } *(char **)(heartSlot + 8) = pcVar4; bVar1 = '\0' < (char)this->_redHeartFlashCountdown; } heartSlot[4] = bVar1; healthType = iVar6; if (redHeartsLeft < 1) { healthType = eternalHeartSlot; } redHeartsLeft = redHeartsLeft + -2; if (redHeartsLeft < 0) { redHeartsLeft = 0; } eternalHeartSlot = healthType; } iVar6 = iVar6 + 1; soulSlotIndex = soulSlotIndex + 1; boneMaskBit = boneMaskBit << 1 | (uint)((int)boneMaskBit < 0); } while (soulSlotIndex < iVar2); } if (0 < player->_eternalHearts) { *(char **)((int)heart + eternalHeartSlot * 0x10 + 0xc) = "WhiteHeartOverlay"; *(undefined1 *)((int)heart + eternalHeartSlot * 0x10 + 1) = 1; *(undefined1 *)((int)heart + eternalHeartSlot * 0x10 + 4) = 0; } iVar2 = 0; if (0 < iVar5) { brokenSlot = (undefined4 *)((int)heart + iVar6 * 0x10 + 8); do { if (unkInt <= iVar6) goto LAB_008421f0; *(undefined1 *)(brokenSlot + -2) = 1; pcVar4 = "BrokenHeart"; if (healthType == 3) { pcVar4 = "BrokenCoinHeart"; } iVar6 = iVar6 + 1; *(undefined1 *)((int)brokenSlot + -6) = 0; iVar2 = iVar2 + 1; *brokenSlot = pcVar4; *(undefined1 *)(brokenSlot + -1) = 0; brokenSlot = brokenSlot + 4; } while (iVar2 < iVar5); } if (iVar6 < unkInt) { heartSlot = (undefined1 *)(iVar6 * 0x10 + (int)heart); iVar6 = unkInt - iVar6; do { *heartSlot = 0; heartSlot = heartSlot + 0x10; iVar6 = iVar6 + -1; } while (iVar6 != 0); } LAB_008421f0: iVar5 = 0; filledHearts = filledHearts - player->_goldenHearts; if (0 < unkInt) { pcVar4 = (char *)((int)heart + 2); do { if (filledHearts < 1) { return; } if ((pcVar4[-2] != '\0') && (*pcVar4 != '\0')) { *pcVar4 = '\0'; filledHearts = filledHearts + -1; } iVar5 = iVar5 + 1; pcVar4 = pcVar4 + 0x10; } while (iVar5 < unkInt); } } return; } //@@ 00842230 PlayerHUD::Update /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: zhl PlayerHUD::Update; loads gfx/ui/hud_*.png active item overrides, Costume pngs; called from HUD::PostUpdate prototype: REPENTOGON */ void __thiscall PlayerHUD::Update(PlayerHUD *this) { PlayerHUD *pPVar1; byte bVar2; char cVar3; undefined1 *heartSlotFlag; void *pvVar4; undefined4 *puVar5; undefined4 *assignedImage; RoomDescriptor *currentRoom; uint roomSeed; byte *gfxPath; EntityConfig_Entity *pocketEntityConfig; int *piVar6; std_string *path; ItemConfig_Item *craftingItem; int iVar7; char *srcPath; char *srcCursor; Entity_Player *pixelX; PlayerHUD *extraout_ECX; PlayerHUD *pPVar8; Entity_Player *extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 uVar9; Entity_Player *extraout_ECX_03; Entity_Player *extraout_ECX_04; Entity_Player *extraout_ECX_05; Entity_Player *extraout_ECX_06; int iVar10; Entity_Player *pEVar11; void *pvVar12; uint uVar13; Entity_Player *pEVar14; uint modelingClayItem; Entity_Player *pEVar15; bool bVar16; float dropHoldFade; undefined1 virtuesBelialImage [4]; int *virtuesBelialImageRef; undefined1 virtuesBelialImageCopy [4]; int *virtuesBelialImageCopyRef; undefined1 belialImage [4]; int *belialImageRef; undefined1 belialImageCopy [4]; int *belialImageCopyRef; undefined1 virtuesImage [4]; int *virtuesImageRef; undefined1 virtuesImageCopy [4]; int *virtuesImageCopyRef; undefined1 loadedImage [4]; int *loadedImageRef; undefined1 loadedImageCopy [4]; int *loadedImageCopyRef; undefined1 findResult [8]; Entity_Player *foundNode; void *local_149c; undefined1 local_1498 [4]; int *local_1494; undefined4 local_1490; int emptySlotImage; int *emptySlotImageRef; void *local_1484; undefined1 local_1480 [4]; int *local_147c; Entity_Player *local_1478; int local_1474; int *local_1470; void *local_146c; int local_1468; int *local_1464; Entity_Player *cachedImages; undefined4 cachedImageCount; int tmpImage; int *tmpImageRef; Entity_Player *local_1450; Entity_Player *cachedCardImages; int *local_1448; Entity_Player *player; PlayerHUD *hud; undefined1 craftingImage [4]; Entity_Player *local_1438; Entity_Player *local_1434; Entity_Player *local_1430; char isHudDirty; char trinketPixels [4096]; byte hudGfxPath [16]; undefined8 local_418; undefined4 uStack_410; int iStack_40c; uint local_408; char acStack_404 [12]; undefined4 local_3f8; undefined2 local_3f4; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int eternalHearts; Game *game; Manager *manager; int redHearts; undefined4 swapTmp; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b02cec; local_1c = ExceptionList; stackCookie = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; pEVar11 = this->_player; heartSlotFlag = &this->field_0x11; iVar7 = 0x18; do { *heartSlotFlag = 0; heartSlotFlag = heartSlotFlag + 0x10; iVar7 = iVar7 + -1; } while (iVar7 != 0); player = pEVar11; hud = this; if ((pEVar11->_subPlayer == 0) || (((pEVar11->_playerType != 0x10 && (pEVar11->_playerType != 0x11)) || (pEVar11->_parent != (EntityPtr)0x0)))) { iVar7 = 0x18; iVar10 = 0x10; pEVar14 = pEVar11; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } else { UpdateHearts(this,&this->field_0x10,6,pEVar11); iVar7 = 6; iVar10 = 0x70; pEVar14 = (Entity_Player *)pEVar11->_subPlayer; } UpdateHearts(this,(void *)((int)&((PlayerHUD *)(this->_activeItem + -0x14))->_player + iVar10), iVar7,pEVar14); iVar7 = pEVar11->_boneHearts; iVar10 = pEVar11->_soulHearts; eternalHearts = pEVar11->_eternalHearts; redHearts = pEVar11->_redHearts; this->_lastHeartFlash = 0; if (iVar7 + iVar10 + eternalHearts + redHearts == 1) { if ((pEVar11->_temporaryeffects)._disabled == 0) { for (piVar6 = (pEVar11->_temporaryeffects)._effects._begin; piVar6 != (pEVar11->_temporaryeffects)._effects._end; piVar6 = piVar6 + 4) { iVar7 = *(int *)*piVar6; if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) && (((int *)*piVar6)[1] == 0x139)) { if (piVar6[1] != 0) goto LAB_00842394; break; } } } iVar7 = g_game->_frameCount % 0x2d; if (iVar7 < 10) { this->_lastHeartFlash = (short)(((9 - iVar7) * 0xff) / 9); } } LAB_00842394: isHudDirty = '\0'; local_1434 = (Entity_Player *)0x0; do { pEVar11 = player; local_1448 = (int *)((int)local_1434 * 7); iVar7 = *(int *)((int)this->_activeItem + (int)local_1434 * 0x1c + 0x18); if (-1 < iVar7) { isHudDirty = '\x01'; *(int *)((int)this->_activeItem + (int)local_1434 * 0x1c + 0x18) = iVar7 + -1; } local_1430 = (Entity_Player *)0x0; uVar13 = player->_activeDesc[(int)local_1434]._item; if (local_1434 == (Entity_Player *)0x0) { bVar2 = Entity_Player::HasCollectible(player,0x248,0); if ((bVar2 != 0) && (uVar13 != 0x248)) { local_1430 = (Entity_Player *)0x248; } iVar7 = pEVar11->_playerType; if ((((iVar7 == 3) || (iVar7 == 0xc)) && (bVar2 = Entity_Player::HasCollectible(pEVar11,0x26b,0), bVar2 != 0)) && ((uVar13 != 0x3b && (bVar16 = local_1430 == (Entity_Player *)0x248, local_1430 = (Entity_Player *)0x22, bVar16 )))) { local_1430 = (Entity_Player *)0x3b; } } manager = g_manager; game = g_game; if (uVar13 != *(uint *)(&hud->_activeItem[0].field_0x0 + (int)local_1448 * 4)) { *(uint *)(&hud->_activeItem[0].field_0x0 + (int)local_1448 * 4) = uVar13; if (game == (Game *)0x0) { if (-1 < (int)uVar13) goto LAB_008424db; LAB_008424f5: iVar7 = 0; } else if ((int)uVar13 < 0) { if ((-1 < (int)uVar13) || (pvVar4 = (game->_proceduralItemManager)._proceduralItems._begin, (int)(game->_proceduralItemManager)._proceduralItems._end - (int)pvVar4 >> 2 <= (int)~uVar13)) goto LAB_008424f5; iVar7 = **(int **)((int)pvVar4 + ~uVar13 * 4); } else { LAB_008424db: pvVar4 = (manager->_itemConfig)._collectibles._begin; if ((int)(manager->_itemConfig)._collectibles._end - (int)pvVar4 >> 2 <= (int)uVar13) goto LAB_008424f5; iVar7 = *(int *)((int)pvVar4 + uVar13 * 4); } local_1438 = (Entity_Player *)(&hud->_activeItem[0].field_0x8 + (int)local_1448 * 4); KAGE::SmartPointer::reset(local_1438,(void *)0x0); if (iVar7 != 0) { if ((int)uVar13 < 0x123) { if (uVar13 == 0x122) { local_3f8._0_1_ = 'r'; local_3f8._1_1_ = '.'; local_3f8._2_1_ = 'p'; local_3f8._3_1_ = 'n'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'c'; hudGfxPath[5] = 'h'; hudGfxPath[6] = 'a'; hudGfxPath[7] = 'r'; hudGfxPath[8] = 'a'; hudGfxPath[9] = 'c'; hudGfxPath[10] = 't'; hudGfxPath[0xb] = 'e'; hudGfxPath[0xc] = 'r'; hudGfxPath[0xd] = 's'; hudGfxPath[0xe] = '/'; hudGfxPath[0xf] = 'c'; local_3f4 = 0x67; local_418 = 0x2f73656d7574736f; uStack_410._0_1_ = 'C'; uStack_410._1_1_ = 'o'; uStack_410._2_1_ = 's'; uStack_410._3_1_ = 't'; iStack_40c._0_1_ = 'u'; iStack_40c._1_1_ = 'm'; iStack_40c._2_1_ = 'e'; iStack_40c._3_1_ = '_'; local_408._0_1_ = 'R'; local_408._1_1_ = 'e'; local_408._2_1_ = 'b'; local_408._3_1_ = 'i'; builtin_strncpy(acStack_404,"rth_90_TheJa",0xc); } else { if ((((uVar13 != 0x23) || (player->_hasCurseMistEffect != 0)) || (player->_isCoopGhost != 0)) || ((player->_playerForms[0xf] < 3 || (player->_activeDesc[(int)local_1434]._varData != 1)))) goto switchD_00842623_caseD_147; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'N'; hudGfxPath[0xc] = 'e'; hudGfxPath[0xd] = 'c'; hudGfxPath[0xe] = 'r'; hudGfxPath[0xf] = 'o'; local_408 = CONCAT13(local_408._3_1_,0x676e); local_418 = 0x506e6f63696d6f6e; uStack_410._0_1_ = 'o'; uStack_410._1_1_ = 'w'; uStack_410._2_1_ = 'e'; uStack_410._3_1_ = 'r'; iStack_40c._0_1_ = 'e'; iStack_40c._1_1_ = 'd'; iStack_40c._2_1_ = '.'; iStack_40c._3_1_ = 'p'; } } else if ((int)uVar13 < 0x1db) { if (uVar13 == 0x1da) { local_408 = local_408 & 0xffffff00; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'B'; hudGfxPath[0xc] = 'r'; hudGfxPath[0xd] = 'o'; hudGfxPath[0xe] = 'k'; hudGfxPath[0xf] = 'e'; local_418 = 0x61437373616c476e; uStack_410._0_1_ = 'n'; uStack_410._1_1_ = 'n'; uStack_410._2_1_ = 'o'; uStack_410._3_1_ = 'n'; iStack_40c._0_1_ = '.'; iStack_40c._1_1_ = 'p'; iStack_40c._2_1_ = 'n'; iStack_40c._3_1_ = 'g'; } else { switch(uVar13) { case 0x146: uStack_410._0_1_ = 'p'; uStack_410._1_1_ = 'n'; uStack_410._2_1_ = 'g'; uStack_410._3_1_ = '\0'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'B'; hudGfxPath[0xc] = 'r'; hudGfxPath[0xd] = 'e'; hudGfxPath[0xe] = 'a'; hudGfxPath[0xf] = 't'; local_418 = 0x2e6566694c664f68; break; default: goto switchD_00842623_caseD_147; case 0x160: hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'G'; hudGfxPath[0xc] = 'l'; hudGfxPath[0xd] = 'a'; hudGfxPath[0xe] = 's'; hudGfxPath[0xf] = 's'; uStack_410._0_1_ = 'n'; uStack_410._1_1_ = 'g'; uStack_410._2_1_ = '\0'; local_418 = 0x702e6e6f6e6e6143; break; case 0x1a6: hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'G'; hudGfxPath[0xc] = 'l'; hudGfxPath[0xd] = 'o'; hudGfxPath[0xe] = 'w'; hudGfxPath[0xf] = 'i'; local_418 = 0x6c4772756f48676e; uStack_410._0_1_ = 'a'; uStack_410._1_1_ = 's'; uStack_410._2_1_ = 's'; uStack_410._3_1_ = '.'; iStack_40c._0_1_ = 'p'; iStack_40c._1_1_ = 'n'; iStack_40c._2_1_ = 'g'; iStack_40c._3_1_ = '\0'; break; case 0x1b2: hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'c'; hudGfxPath[5] = 'h'; hudGfxPath[6] = 'a'; hudGfxPath[7] = 'r'; hudGfxPath[8] = 'a'; hudGfxPath[9] = 'c'; hudGfxPath[10] = 't'; hudGfxPath[0xb] = 'e'; hudGfxPath[0xc] = 'r'; hudGfxPath[0xd] = 's'; hudGfxPath[0xe] = '/'; hudGfxPath[0xf] = 'c'; local_3f8._0_1_ = 'n'; local_3f8._1_1_ = 'g'; local_3f8._2_1_ = '\0'; local_418 = 0x2f73656d7574736f; uStack_410._0_1_ = 'C'; uStack_410._1_1_ = 'o'; uStack_410._2_1_ = 's'; uStack_410._3_1_ = 't'; iStack_40c._0_1_ = 'u'; iStack_40c._1_1_ = 'm'; iStack_40c._2_1_ = 'e'; iStack_40c._3_1_ = '_'; local_408._0_1_ = '4'; local_408._1_1_ = '3'; local_408._2_1_ = '4'; local_408._3_1_ = '_'; builtin_strncpy(acStack_404,"JarOfFlies.p",0xc); } } } else { switch(uVar13) { case 0x1df: hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'S'; hudGfxPath[0xc] = 'm'; hudGfxPath[0xd] = 'e'; hudGfxPath[0xe] = 'l'; hudGfxPath[0xf] = 't'; local_418 = CONCAT17(local_418._7_1_,0x676e702e7265); break; default: switchD_00842623_caseD_147: srcPath = (char *)(iVar7 + 0x38); if (0xf < *(uint *)(iVar7 + 0x4c)) { srcPath = *(char **)srcPath; } srcCursor = srcPath; do { cVar3 = *srcCursor; srcCursor = srcCursor + 1; srcCursor[(int)(trinketPixels + (0xfff - (int)srcPath))] = cVar3; } while (cVar3 != '\0'); break; case 0x1e3: hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'M'; hudGfxPath[0xc] = 'a'; hudGfxPath[0xd] = 'm'; hudGfxPath[0xe] = 'a'; hudGfxPath[0xf] = 'M'; local_418 = 0x676e702e616765; break; case 0x1e9: local_3f8._0_1_ = 'g'; local_3f8._1_1_ = '\0'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'c'; hudGfxPath[5] = 'h'; hudGfxPath[6] = 'a'; hudGfxPath[7] = 'r'; hudGfxPath[8] = 'a'; hudGfxPath[9] = 'c'; hudGfxPath[10] = 't'; hudGfxPath[0xb] = 'e'; hudGfxPath[0xc] = 'r'; hudGfxPath[0xd] = 's'; hudGfxPath[0xe] = '/'; hudGfxPath[0xf] = 'c'; local_418 = 0x2f73656d7574736f; uStack_410._0_1_ = 'C'; uStack_410._1_1_ = 'o'; uStack_410._2_1_ = 's'; uStack_410._3_1_ = 't'; iStack_40c._0_1_ = 'u'; iStack_40c._1_1_ = 'm'; iStack_40c._2_1_ = 'e'; iStack_40c._3_1_ = '_'; local_408._0_1_ = '4'; local_408._1_1_ = '8'; local_408._2_1_ = '9'; local_408._3_1_ = '_'; builtin_strncpy(acStack_404,"DInfinity.pn",0xc); break; case 0x20b: local_3f8._0_1_ = 'g'; local_3f8._1_1_ = '\0'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'c'; hudGfxPath[5] = 'h'; hudGfxPath[6] = 'a'; hudGfxPath[7] = 'r'; hudGfxPath[8] = 'a'; hudGfxPath[9] = 'c'; hudGfxPath[10] = 't'; hudGfxPath[0xb] = 'e'; hudGfxPath[0xc] = 'r'; hudGfxPath[0xd] = 's'; hudGfxPath[0xe] = '/'; hudGfxPath[0xf] = 'c'; local_418 = 0x2f73656d7574736f; uStack_410._0_1_ = 'c'; uStack_410._1_1_ = 'o'; uStack_410._2_1_ = 's'; uStack_410._3_1_ = 't'; iStack_40c._0_1_ = 'u'; iStack_40c._1_1_ = 'm'; iStack_40c._2_1_ = 'e'; iStack_40c._3_1_ = '_'; local_408._0_1_ = '5'; local_408._1_1_ = '2'; local_408._2_1_ = '3'; local_408._3_1_ = '_'; builtin_strncpy(acStack_404,"movingbox.pn",0xc); break; case 0x280: if (((player->_playerType == 3) || (player->_playerType == 0xc)) && (bVar2 = Entity_Player::HasCollectible(player,0x26b,0), bVar2 != 0)) { bVar16 = true; } else { bVar16 = false; } srcPath = "gfx/ui/hud_UrnOfSouls_belial.png"; if (!bVar16) { srcPath = "gfx/ui/hud_UrnOfSouls.png"; } srcCursor = srcPath; do { cVar3 = *srcCursor; srcCursor = srcCursor + 1; srcCursor[(int)(trinketPixels + (0xfff - (int)srcPath))] = cVar3; } while (cVar3 != '\0'); break; case 0x2ad: uStack_410._0_1_ = 'g'; uStack_410._1_1_ = '\0'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'J'; hudGfxPath[0xc] = 'a'; hudGfxPath[0xd] = 'r'; hudGfxPath[0xe] = 'O'; hudGfxPath[0xf] = 'f'; local_418 = 0x6e702e7370736957; break; case 0x2c6: if (local_1434 == (Entity_Player *)0x2) { srcPath = (char *)(iVar7 + 0x38); if (0xf < *(uint *)(iVar7 + 0x4c)) { srcPath = *(char **)srcPath; } srcCursor = srcPath; do { cVar3 = *srcCursor; srcCursor = srcCursor + 1; srcCursor[(int)(trinketPixels + (0xfff - (int)srcPath))] = cVar3; } while (cVar3 != '\0'); } else { uStack_410._0_1_ = '.'; uStack_410._1_1_ = 'p'; uStack_410._2_1_ = 'n'; uStack_410._3_1_ = 'g'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'B'; hudGfxPath[0xc] = 'a'; hudGfxPath[0xd] = 'g'; hudGfxPath[0xe] = 'O'; hudGfxPath[0xf] = 'f'; iStack_40c = (uint)iStack_40c._1_3_ << 8; local_418 = 0x676e697466617243; } break; case 0x2c7: local_418 = CONCAT44(local_418._4_4_,0x676e70); hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'F'; hudGfxPath[0xc] = 'l'; hudGfxPath[0xd] = 'i'; hudGfxPath[0xe] = 'p'; hudGfxPath[0xf] = '.'; break; case 0x2d0: uStack_410._0_1_ = '.'; uStack_410._1_1_ = 'p'; uStack_410._2_1_ = 'n'; uStack_410._3_1_ = 'g'; hudGfxPath[0] = 'g'; hudGfxPath[1] = 'f'; hudGfxPath[2] = 'x'; hudGfxPath[3] = '/'; hudGfxPath[4] = 'u'; hudGfxPath[5] = 'i'; hudGfxPath[6] = '/'; hudGfxPath[7] = 'h'; hudGfxPath[8] = 'u'; hudGfxPath[9] = 'd'; hudGfxPath[10] = '_'; hudGfxPath[0xb] = 'E'; hudGfxPath[0xc] = 'v'; hudGfxPath[0xd] = 'e'; hudGfxPath[0xe] = 'r'; hudGfxPath[0xf] = 'y'; iStack_40c = (uint)iStack_40c._1_3_ << 8; local_418 = 0x72614a676e696874; } } pvVar4 = Manager::LoadImage(loadedImage,hudGfxPath); local_14 = 0; puVar5 = KAGE::SmartPointer::operator_assign(loadedImageCopy,pvVar4); uVar9 = puVar5[1]; puVar5[1] = *(undefined4 *)&local_1438->field_0x4; *(undefined4 *)&local_1438->field_0x4 = uVar9; uVar9 = *puVar5; *puVar5 = *(undefined4 *)local_1438; *(undefined4 *)local_1438 = uVar9; local_14 = CONCAT31(local_14._1_3_,1); if (((loadedImageCopyRef != (int *)0x0) && (cVar3 = (**(code **)(*loadedImageCopyRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImageCopy); } local_14 = 2; if (((loadedImageRef != (int *)0x0) && (cVar3 = (**(code **)(*loadedImageRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImage); } local_14 = 0xffffffff; } isHudDirty = '\x01'; } pPVar8 = hud; piVar6 = local_1448; if (local_1430 != (Entity_Player *)(&hud->_activeItem[0]._bookItemId)[(int)local_1448]) { (&hud->_activeItem[0]._bookItemId)[(int)local_1448] = (int)local_1430; puVar5 = &hud->_activeItem[0]._bookImage + (int)local_1448; if (local_1430 == (Entity_Player *)0x248) { pvVar4 = Manager::LoadImage(virtuesImage,(byte *)"gfx/ui/hud_BookOfVirtues.png"); local_14 = 3; assignedImage = KAGE::SmartPointer::operator_assign(virtuesImageCopy,pvVar4); uVar9 = assignedImage[1]; assignedImage[1] = *(undefined4 *)(&pPVar8->_activeItem[1].field_0x0 + (int)piVar6 * 4); swapTmp = *puVar5; *(undefined4 *)(&pPVar8->_activeItem[1].field_0x0 + (int)piVar6 * 4) = uVar9; uVar9 = *assignedImage; *assignedImage = swapTmp; *puVar5 = uVar9; local_14 = CONCAT31(local_14._1_3_,4); if (((virtuesImageCopyRef != (int *)0x0) && (cVar3 = (**(code **)(*virtuesImageCopyRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(virtuesImageCopy); } local_14 = 5; if (((virtuesImageRef == (int *)0x0) || (cVar3 = (**(code **)(*virtuesImageRef + 0xc))(), cVar3 == '\0')) || (g_imageReleaseFn == (void *)0x0)) goto LAB_00842c73; (*g_imageReleaseFn)(virtuesImage); local_14 = 0xffffffff; } else if (local_1430 == (Entity_Player *)0x22) { pvVar4 = Manager::LoadImage(belialImage,(byte *)"gfx/ui/hud_BookOfBelial.png"); local_14 = 6; assignedImage = KAGE::SmartPointer::operator_assign(belialImageCopy,pvVar4); uVar9 = assignedImage[1]; assignedImage[1] = *(undefined4 *)(&pPVar8->_activeItem[1].field_0x0 + (int)piVar6 * 4); swapTmp = *puVar5; *(undefined4 *)(&pPVar8->_activeItem[1].field_0x0 + (int)piVar6 * 4) = uVar9; uVar9 = *assignedImage; *assignedImage = swapTmp; *puVar5 = uVar9; local_14 = CONCAT31(local_14._1_3_,7); if (((belialImageCopyRef != (int *)0x0) && (cVar3 = (**(code **)(*belialImageCopyRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(belialImageCopy); } local_14 = 8; if (((belialImageRef == (int *)0x0) || (cVar3 = (**(code **)(*belialImageRef + 0xc))(), cVar3 == '\0')) || (g_imageReleaseFn == (void *)0x0)) goto LAB_00842c73; (*g_imageReleaseFn)(belialImage); local_14 = 0xffffffff; } else if (local_1430 == (Entity_Player *)0x3b) { pvVar4 = Manager::LoadImage(virtuesBelialImage, (byte *)"gfx/ui/hud_BookOfVirtuesWithBelial.png"); local_14 = 9; assignedImage = KAGE::SmartPointer::operator_assign(virtuesBelialImageCopy,pvVar4); uVar9 = assignedImage[1]; assignedImage[1] = *(undefined4 *)(&pPVar8->_activeItem[1].field_0x0 + (int)piVar6 * 4); swapTmp = *puVar5; *(undefined4 *)(&pPVar8->_activeItem[1].field_0x0 + (int)piVar6 * 4) = uVar9; uVar9 = *assignedImage; *assignedImage = swapTmp; *puVar5 = uVar9; local_14 = CONCAT31(local_14._1_3_,10); if (((virtuesBelialImageCopyRef != (int *)0x0) && (cVar3 = (**(code **)(*virtuesBelialImageCopyRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(virtuesBelialImageCopy); } local_14 = 0xb; if (((virtuesBelialImageRef != (int *)0x0) && (cVar3 = (**(code **)(*virtuesBelialImageRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(virtuesBelialImage); } LAB_00842c73: local_14 = 0xffffffff; } else { KAGE::SmartPointer::reset(puVar5,(void *)0x0); } isHudDirty = '\x01'; } local_1434 = (Entity_Player *)(&local_1434->field_0x0 + 1); this = hud; } while (local_1434 < (Entity_Player *)0x4); local_1430 = (Entity_Player *)&hud->field_0x204; local_1448 = player->_trinketsID; local_1434 = (Entity_Player *)0x0; do { uVar13 = *local_1448 & 0x7fff; if (*(uint *)((int)local_1430 + -4) == 0xa6) { modelingClayItem = player->_modelingClayEffect; } else { modelingClayItem = 0; } if (uVar13 == 0x4b) { currentRoom = Level::GetRoomByIdx((Level *)g_game,g_game->_currentRoomIdx,-1); roomSeed = currentRoom->SpawnSeed; if (roomSeed != 0) { roomSeed = roomSeed >> 2 ^ roomSeed; roomSeed = roomSeed << 7 ^ roomSeed; uVar13 = (roomSeed >> 0x19 ^ roomSeed) % 0xbd + 1; } } if ((uVar13 != *(uint *)((int)local_1430 + -4)) || (modelingClayItem != *(uint *)local_1430)) { *(uint *)((int)local_1430 + -4) = uVar13; *(uint *)local_1430 = modelingClayItem; if (modelingClayItem == 0) { pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if ((int)uVar13 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 >> 2) { iVar7 = *(int *)((int)pvVar4 + uVar13 * 4); goto LAB_00842de7; } } else { if (g_game == (Game *)0x0) { if (-1 < (int)modelingClayItem) goto LAB_00842da2; } else if ((int)modelingClayItem < 0) { if (((int)modelingClayItem < 0) && (pvVar4 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~modelingClayItem < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar4 >> 2)) { iVar7 = **(int **)((int)pvVar4 + ~modelingClayItem * 4); goto LAB_00842de7; } } else { LAB_00842da2: pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((int)modelingClayItem < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 >> 2) { iVar7 = *(int *)((int)pvVar4 + modelingClayItem * 4); goto LAB_00842de7; } } iVar7 = 0; LAB_00842de7: if (iVar7 != 0) { gfxPath = (byte *)(iVar7 + 0x38); if (0xf < *(uint *)(iVar7 + 0x4c)) { gfxPath = *(byte **)gfxPath; } pvVar4 = Manager::LoadImage(&tmpImage,gfxPath); pEVar11 = local_1430; local_14 = 0xc; KAGE::SmartPointer::operator_assign((uint *)((int)local_1430 + 4),pvVar4); local_14 = 0xd; if (((tmpImageRef != (int *)0x0) && (cVar3 = (**(code **)(*tmpImageRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&tmpImage); } local_14 = 0xffffffff; if (*(int **)((int)pEVar11 + 4) != (int *)0x0) { pEVar15 = (Entity_Player *)0x0; local_1438 = (Entity_Player *)0x20; pEVar14 = (Entity_Player *)0x0; local_1450 = (Entity_Player *)0x20; (**(code **)(**(int **)((int)pEVar11 + 4) + 0x30))(0,0,0x20,0x20,trinketPixels); pEVar11 = (Entity_Player *)0x0; do { pixelX = (Entity_Player *)0x0; do { if (trinketPixels[(int)&pixelX->field_0x1 * (int)pEVar11 * 4] != '\0') { if (pixelX < local_1438) { local_1438 = pixelX; } if (pEVar14 < pixelX) { pEVar14 = pixelX; } if (pEVar11 < local_1450) { local_1450 = pEVar11; } if (pEVar15 < pEVar11) { pEVar15 = pEVar11; } } pixelX = (Entity_Player *)&pixelX->field_0x1; } while (pixelX < (undefined1 *)0x20); pEVar11 = (Entity_Player *)(&pEVar11->field_0x0 + 1); } while (pEVar11 < (Entity_Player *)0x20); iVar10 = (int)(&(local_1450->_sprite)._filename + -3) + ((uint)((int)pEVar15 - (int)local_1450) >> 1); iVar7 = (int)(&(local_1438->_sprite)._filename + -3) + ((uint)((int)pEVar14 - (int)local_1438) >> 1); *(float *)((int)local_1430 + 0xc) = (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]); *(float *)((int)local_1430 + 0x10) = (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]); } } } isHudDirty = '\x01'; HUD::mark_all_slots_dirty(&g_game->_hud,0,0); } local_1434 = (Entity_Player *)(&local_1434->field_0x0 + 1); local_1448 = local_1448 + 1; local_1430 = (Entity_Player *)((int)local_1430 + 0x18); } while (local_1434 < (Entity_Player *)0x2); local_1450 = (Entity_Player *)0x0; do { pEVar11 = local_1450; local_1430 = (Entity_Player *)((int)local_1450 * 0x11c); pEVar14 = local_1450; if ((int)local_1450 < 1) { pEVar14 = (Entity_Player *)0x0; } pEVar15 = (Entity_Player *)0x3; if ((int)pEVar14 < 3) { pEVar15 = pEVar14; } local_1438 = (Entity_Player *)player->_pocketSlots[(int)pEVar15 * 2 + 1]; if ((int)local_1450 < 1) { local_1434 = (Entity_Player *)0x0; } else { local_1434 = local_1450; if (2 < (int)local_1450) { local_1434 = (Entity_Player *)0x3; } } iVar7 = 0; if (local_1438 == (Entity_Player *)0x1) { if (-1 < player->_pocketSlots[(int)local_1434 * 2]) { local_1448 = (g_manager->_itemConfig)._cards._begin; if (player->_pocketSlots[(int)local_1434 * 2] < (int)(g_manager->_itemConfig)._cards._end - (int)local_1448 >> 2) { if (local_1448[player->_pocketSlots[(int)local_1434 * 2]] != 0) { iVar7 = *(int *)(local_1448[player->_pocketSlots[(int)local_1434 * 2]] + 0x54); } } } } else if (local_1438 == (Entity_Player *)0x0) { iVar7 = player->_pocketSlots[(int)local_1434 * 2]; } if ((local_1438 != *(Entity_Player **)((int)&local_1430->_fearCountdown + (int)hud)) || (pEVar14 = local_1438, iVar7 != *(int *)((int)&local_1430->_burnCountdown + (int)hud))) { pocketEntityConfig = (EntityConfig_Entity *)0x0; if (local_1438 == (Entity_Player *)0x1) { if (iVar7 != 0) { iVar10 = 300; goto LAB_008430a9; } } else if ((local_1438 == (Entity_Player *)0x0) && (iVar7 != 0)) { iVar10 = 0x46; LAB_008430a9: pocketEntityConfig = EntityConfig::GetEntity(&g_manager->_entityConfig,5,iVar10,iVar7); } if (pocketEntityConfig == (EntityConfig_Entity *)0x0) { ANM2::Reset((ANM2 *)(&hud->field_0x238 + (int)local_1430)); } else { ANM2::Load((ANM2 *)(&hud->field_0x238 + (int)local_1430),&pocketEntityConfig->anm2Path,1); } *(Entity_Player **)((int)&local_1430->_fearCountdown + (int)hud) = local_1438; *(int *)((int)&local_1430->_burnCountdown + (int)hud) = iVar7; pEVar14 = local_1430; } pPVar8 = hud; local_1450 = (Entity_Player *)((int)&pEVar11->field_0x0 + 1); } while (local_1450 < (Entity_Player *)&DAT_00000004); if (hud->field_0x6ac != '\0') { if (player->_playerType == 0x15) { cachedImages = (Entity_Player *)0x0; cachedImageCount = 0; cachedImages = operator_new(0x1c); pPVar1 = hud; *(Entity_Player **)cachedImages = cachedImages; *(Entity_Player **)&cachedImages->field_0x4 = cachedImages; (cachedImages->_damageEvents)._begin = cachedImages; *(undefined2 *)&(cachedImages->_damageEvents)._end = 0x101; local_1438 = (Entity_Player *)&pPVar8->field_0x6a0; local_14 = 0xe; iVar7 = *(int *)local_1438; pPVar8 = hud; if (iVar7 != *(int *)&hud->field_0x6a4) { do { FUN_0083c320(&tmpImage,iVar7); iVar7 = iVar7 + 0xc; } while (iVar7 != *(int *)&pPVar1->field_0x6a4); pPVar8 = extraout_ECX; } pEVar11 = local_1438; FUN_00709380(pPVar8); *(int *)&pEVar11->field_0x4 = *(int *)pEVar11; local_1450 = (Entity_Player *)0x0; do { iVar7 = player->_inventory[(int)local_1450]; if (iVar7 < 0) { local_1490 = 0; KAGE::SmartPointer::SmartPointer(&emptySlotImage,(void *)0x0); local_14 = CONCAT31(local_14._1_3_,0xf); puVar5 = *(undefined4 **)&pEVar11->field_0x4; if (puVar5 == (pEVar11->_damageEvents)._begin) { std::vector<12byte>::_Emplace_reallocate(puVar5,&local_1490); } else { *puVar5 = local_1490; KAGE::SmartPointer::operator_assign(puVar5 + 1,&emptySlotImage); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x10; if (((emptySlotImageRef != (int *)0x0) && (cVar3 = (**(code **)(*emptySlotImageRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { piVar6 = &emptySlotImage; goto LAB_008435e3; } goto LAB_008435e9; } local_1448 = (int *)(iVar7 * 7); local_1430 = (player->_history)._historyItems._begin; pEVar14 = *(Entity_Player **)((int)&(local_1430->_sprite)._filename + iVar7 * 0x1c + -0x40); if (g_game == (Game *)0x0) { if (-1 < (int)pEVar14) goto LAB_008432df; } else { if ((int)pEVar14 < 0) { if (((int)pEVar14 < 0) && (pvVar4 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)pEVar14 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar4 >> 2)) { local_1438 = (Entity_Player *)**(undefined4 **)((int)pvVar4 + ~(uint)pEVar14 * 4); } else { local_1438 = (Entity_Player *)0x0; } } else { LAB_008432df: pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 >> 2 <= (int)pEVar14) goto LAB_008435ed; local_1438 = *(Entity_Player **)((int)pvVar4 + (int)pEVar14 * 4); } if ((local_1438 != (Entity_Player *)0x0) && (*(int *)local_1438 != 3)) { local_1434 = pEVar14; std::set::find_node(findResult,&local_1434); if ((*(char *)((int)&(foundNode->_damageEvents)._end + 1) == '\0') && ((pvVar4 = (foundNode->_damageEvents)._capacity, (int)pvVar4 <= (int)pEVar14 && (foundNode != cachedImages)))) { local_146c = pvVar4; KAGE::SmartPointer::operator_assign(&local_1468,&foundNode->_pendingDamage); local_14 = CONCAT31(local_14._1_3_,0x11); piVar6 = *(int **)&pEVar11->field_0x4; if (piVar6 == (pEVar11->_damageEvents)._begin) { std::vector<12byte>::_Emplace_reallocate(piVar6,&local_146c); } else { *piVar6 = (int)local_146c; KAGE::SmartPointer::operator_assign(piVar6 + 1,&local_1468); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x12; if (((local_1464 != (int *)0x0) && (cVar3 = (**(code **)(*local_1464 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_1468); } pvVar4 = std_tree_extract(&cachedImages,foundNode); local_14._0_1_ = 0x13; if (((*(int **)((int)pvVar4 + 0x18) != (int *)0x0) && (cVar3 = (**(code **)(**(int **)((int)pvVar4 + 0x18) + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)pvVar4 + 0x14); } local_14 = CONCAT31(local_14._1_3_,0xe); operator_delete(pvVar4,0x1c); } else { if ((int)pEVar14 < 0) { local_1478 = pEVar14; KAGE::SmartPointer::SmartPointer(&local_1474,(void *)0x0); local_14 = CONCAT31(local_14._1_3_,0x14); puVar5 = *(undefined4 **)&pEVar11->field_0x4; if (puVar5 == (pEVar11->_damageEvents)._begin) { std::vector<12byte>::_Emplace_reallocate(puVar5,&local_1478); } else { *puVar5 = local_1478; KAGE::SmartPointer::operator_assign(puVar5 + 1,&local_1474); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x15; if (((local_1470 != (int *)0x0) && (cVar3 = (**(code **)(*local_1470 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { piVar6 = &local_1474; goto LAB_008435e3; } } else { piVar6 = &local_1438->_spawnerVariant; if (0xf < *(uint *)((local_1438->_sprite)._filename._buf + 4)) { piVar6 = (int *)*piVar6; } Manager::LoadImage(&tmpImage,(byte *)piVar6); local_14._0_1_ = 0x16; if (tmpImage != 0) { local_149c = *(void **)((local_1430->_sprite)._filename._buf + (int)local_1448 * 4 + -0x40); KAGE::SmartPointer::operator_assign(local_1498,&tmpImage); local_14._0_1_ = 0x17; local_1484 = local_149c; KAGE::SmartPointer::operator_assign(local_1480,local_1498); local_14 = CONCAT31(local_14._1_3_,0x18); piVar6 = *(int **)&pEVar11->field_0x4; if (piVar6 == (pEVar11->_damageEvents)._begin) { std::vector<12byte>::_Emplace_reallocate(piVar6,&local_1484); } else { *piVar6 = (int)local_1484; KAGE::SmartPointer::operator_assign(piVar6 + 1,local_1480); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x19; if (((local_147c != (int *)0x0) && (cVar3 = (**(code **)(*local_147c + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_1480); } local_14._0_1_ = 0x1a; if (((local_1494 != (int *)0x0) && (cVar3 = (**(code **)(*local_1494 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_1498); } } local_14._0_1_ = 0x1b; if (((tmpImageRef != (int *)0x0) && (cVar3 = (**(code **)(*tmpImageRef + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { piVar6 = &tmpImage; LAB_008435e3: (*g_imageReleaseFn)(piVar6); } } LAB_008435e9: local_14 = CONCAT31(local_14._1_3_,0xe); } } } LAB_008435ed: local_1450 = (Entity_Player *)((int)&local_1450->field_0x0 + 1); } while (local_1450 < (Entity_Player *)0x10); local_1438 = *(Entity_Player **)cachedImages; if (local_1438 != cachedImages) { do { KAGE::SmartPointer::reset(&local_1438->_pendingDamage,(void *)0x0); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1438); } while (local_1438 != cachedImages); } local_14 = 0xffffffff; std::map::_Erase_tree (&cachedImages,*(undefined4 *)&cachedImages->field_0x4); operator_delete(cachedImages,0x1c); pEVar14 = extraout_ECX_00; } else if ((g_game->_challenge == 0x2b) && ((int)(player->_itemCards)._end - (int)(player->_itemCards)._begin >> 2 != 0)) { cachedCardImages = (Entity_Player *)0x0; local_1448 = (int *)0x0; cachedCardImages = operator_new(0x1c); pPVar1 = hud; *(Entity_Player **)cachedCardImages = cachedCardImages; *(Entity_Player **)&cachedCardImages->field_0x4 = cachedCardImages; (cachedCardImages->_damageEvents)._begin = cachedCardImages; *(undefined2 *)&(cachedCardImages->_damageEvents)._end = 0x101; local_1438 = (Entity_Player *)&pPVar8->field_0x6a0; local_14 = 0x1c; iVar7 = *(int *)local_1438; uVar9 = extraout_ECX_01; if (iVar7 != *(int *)&hud->field_0x6a4) { do { FUN_0083c320(&tmpImage,iVar7); iVar7 = iVar7 + 0xc; } while (iVar7 != *(int *)&pPVar1->field_0x6a4); uVar9 = extraout_ECX_02; } pEVar11 = local_1438; FUN_00709380(uVar9); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x0; uVar13 = 0; pvVar4 = (player->_itemCards)._end; pvVar12 = (player->_itemCards)._begin; if ((int)pvVar4 - (int)pvVar12 >> 2 != 0) { do { if ((uVar13 < (uint)((int)pvVar4 - (int)pvVar12 >> 2)) && (local_1438 = *(Entity_Player **)((int)pvVar12 + uVar13 * 4), local_1438 != (Entity_Player *)0x0)) { local_1434 = (Entity_Player *) ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_1438); local_1450 = local_1438; std::set::find_node(findResult,&local_1450); if ((*(char *)((int)&(foundNode->_damageEvents)._end + 1) == '\0') && ((pvVar4 = (foundNode->_damageEvents)._capacity, (int)pvVar4 <= (int)local_1438 && (foundNode != cachedCardImages)))) { local_1484 = pvVar4; KAGE::SmartPointer::operator_assign(local_1480,&foundNode->_pendingDamage); local_14 = CONCAT31(local_14._1_3_,0x1f); piVar6 = *(int **)&pEVar11->field_0x4; if (piVar6 == *(int **)((std_string *)&pEVar11->_damageEvents)->_buf) { std::vector<12byte>::_Emplace_reallocate(piVar6,&local_1484); } else { *piVar6 = (int)local_1484; KAGE::SmartPointer::operator_assign(piVar6 + 1,local_1480); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x20; if (((local_147c != (int *)0x0) && (cVar3 = (**(code **)(*local_147c + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_1480); } local_14 = CONCAT31(local_14._1_3_,0x1c); std_tree_extract(&cachedCardImages,foundNode); FUN_0083c400(); } else { if ((int)*(Entity_Player **)&local_1434->field_0x4 < 0) { local_1478 = *(Entity_Player **)&local_1434->field_0x4; KAGE::SmartPointer::SmartPointer(&local_1474,(void *)0x0); local_14 = CONCAT31(local_14._1_3_,0x21); puVar5 = *(undefined4 **)&pEVar11->field_0x4; if (puVar5 == *(undefined4 **)((std_string *)&pEVar11->_damageEvents)->_buf) { std::vector<12byte>::_Emplace_reallocate(puVar5,&local_1478); } else { *puVar5 = local_1478; KAGE::SmartPointer::operator_assign(puVar5 + 1,&local_1474); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x22; if (((local_1470 != (int *)0x0) && (cVar3 = (**(code **)(*local_1470 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { piVar6 = &local_1474; goto LAB_00843a36; } goto LAB_00843a3c; } path = (std_string *)&local_1434->_spawnerVariant; if (0xf < *(uint *)((int)(local_1434->_sprite)._filename._buf + 4)) { path = *(std_string **)path->_buf; } Manager::LoadImage(&tmpImage,(byte *)path); local_14._0_1_ = 0x23; if (tmpImage != 0) { pvVar4 = (player->_itemCards)._begin; if (uVar13 < (uint)((int)(player->_itemCards)._end - (int)pvVar4 >> 2)) { local_1438 = *(Entity_Player **)((int)pvVar4 + uVar13 * 4); } else { local_1438 = (Entity_Player *)0x0; } FUN_0084bef0(&local_1438,&tmpImage); local_14._0_1_ = 0x24; FUN_0084bc00(&local_1490); local_14._0_1_ = 0x25; FUN_0084bbc0(&local_149c); FUN_007098c0(); FUN_007098c0(); } local_14 = CONCAT31(local_14._1_3_,0x1c); FUN_0040c440(); } } else { local_146c = (void *)0x0; KAGE::SmartPointer::SmartPointer(&local_1468,(void *)0x0); local_14 = CONCAT31(local_14._1_3_,0x1d); piVar6 = *(int **)&pEVar11->field_0x4; if (piVar6 == *(int **)((std_string *)&pEVar11->_damageEvents)->_buf) { std::vector<12byte>::_Emplace_reallocate(piVar6,&local_146c); } else { *piVar6 = (int)local_146c; KAGE::SmartPointer::operator_assign(piVar6 + 1,&local_1468); *(int *)&pEVar11->field_0x4 = *(int *)&pEVar11->field_0x4 + 0xc; } local_14._0_1_ = 0x1e; if (((local_1464 != (int *)0x0) && (cVar3 = (**(code **)(*local_1464 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { piVar6 = &local_1468; LAB_00843a36: (*g_imageReleaseFn)(piVar6); } LAB_00843a3c: local_14 = CONCAT31(local_14._1_3_,0x1c); } uVar13 = uVar13 + 1; pvVar4 = (player->_itemCards)._end; pvVar12 = (player->_itemCards)._begin; } while (uVar13 < (uint)((int)pvVar4 - (int)pvVar12 >> 2)); } local_1438 = *(Entity_Player **)cachedCardImages; if (local_1438 != cachedCardImages) { do { KAGE::SmartPointer::reset(&local_1438->_pendingDamage,(void *)0x0); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1438); } while (local_1438 != cachedCardImages); } local_14 = 0xffffffff; FUN_0083b830(); pEVar14 = extraout_ECX_03; } else { local_1438 = (Entity_Player *)&hud->field_0x6a0; iVar7 = *(int *)local_1438; pEVar14 = player; if (iVar7 != *(int *)&hud->field_0x6a4) { do { KAGE::SmartPointer::reset((void *)(iVar7 + 4),(void *)0x0); iVar7 = iVar7 + 0xc; } while (iVar7 != *(int *)&pPVar8->field_0x6a4); FUN_0084bba0(); pEVar14 = extraout_ECX_04; } } hud->field_0x6ac = 0; } pPVar8 = hud; if (hud->_isCraftingItemDirty != 0) { craftingItem = ItemConfig::GetCollectible (&g_manager->_itemConfig,*(int *)((int)hud->_player + 0x1f4c)); pPVar8 = pPVar8 + 1; KAGE::SmartPointer::reset(pPVar8,(void *)0x0); pEVar14 = extraout_ECX_05; if (craftingItem != (ItemConfig_Item *)0x0) { uVar13 = Level::GetCurses((Level *)g_game); if ((uVar13 & 0x40) == 0) { gfxPath = std::string::c_str((craftingItem->gfxFilename)._buf); pvVar4 = Manager::LoadImage(craftingImage,gfxPath); local_14 = 0x27; KAGE::SmartPointer::operator_assign(pPVar8,pvVar4); } else { pvVar4 = Manager::LoadImage(&tmpImage,(byte *)"gfx/Items/Collectibles/questionmark.png"); local_14 = 0x26; KAGE::SmartPointer::operator_assign(pPVar8,pvVar4); } local_14 = 0xffffffff; FUN_0040c440(); pEVar14 = extraout_ECX_06; } hud->_isCraftingItemDirty = 0; } pPVar8 = hud; bVar2 = input_is_action_pressed (0xb,(int)hud->_player[5]._color._offset[1],hud->_player,(int)pEVar14); if (bVar2 == 0) { dropHoldFade = *(float *)&pPVar8[1]._playerHudIndex - 0.25; if (dropHoldFade <= 0.0) { dropHoldFade = 0.0; } } else { dropHoldFade = *(float *)&pPVar8[1]._playerHudIndex + 0.25; if (1.0 <= dropHoldFade) { dropHoldFade = 1.0; } } bVar2 = pPVar8->_redHeartFlashCountdown; *(float *)&pPVar8[1]._playerHudIndex = dropHoldFade; if ('\0' < (char)bVar2) { pPVar8->_redHeartFlashCountdown = bVar2 - 1; } if ('\0' < (char)pPVar8->_soulHeartFlashCountdown) { pPVar8->_soulHeartFlashCountdown = pPVar8->_soulHeartFlashCountdown - 1; } if ('\0' < (char)pPVar8->_goldHeartFlashCountdown) { pPVar8->_goldHeartFlashCountdown = pPVar8->_goldHeartFlashCountdown - 1; } if (isHudDirty != '\0') { FUN_009a6110(1); } ExceptionList = local_1c; return; } //@@ 00843df0 PlayerHUD::RenderHearts /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ui_hearts.png, CurseHeart, HolyMantle*; ZHL had put the name on 0083eae0 prototype: REPENTOGON, confirmed by RET 24 */ void __thiscall PlayerHUD::RenderHearts (PlayerHUD *this,Vector *unk,ANM2 *sprite,int playerHudLayout,float scale,Vector pos) { Vector pos_00; Vector scale_00; Vector position; byte bVar1; uint forcedCurses; uint preventedCurses; int iVar2; float colorOffsetB; ColorMod *spriteColor; void *mantleEffect; uint uVar3; FontSettings *settings; KColor *color; undefined4 extraout_EAX; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; char *freeBlock; KColor *fromColor; Entity_Player *extraout_ECX; AnimationState *lastAnimState; ColorMod *color_00; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; uint uVar4; ANM2 *renderSprite; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float heartColor; float fStack_1f0; float fStack_1ec; float fStack_1e8; Color goldOverlayColor; undefined4 overlayColor; undefined4 uStack_198; undefined4 uStack_194; float fStack_190; undefined4 local_17c; undefined4 uStack_178; undefined4 local_174; undefined4 overlayFlashColor; undefined4 uStack_16c; undefined4 uStack_168; float fStack_164; float local_150; undefined4 uStack_14c; undefined4 local_148; undefined4 heartAlphaColor; undefined4 uStack_140; undefined4 uStack_13c; float fStack_138; undefined4 local_124; undefined4 uStack_120; undefined4 local_11c; undefined4 heartFlashColor; undefined4 uStack_114; undefined4 uStack_110; float fStack_10c; float local_f8; undefined4 uStack_f4; undefined4 local_f0; Vector *outSize; int heartSlotCount; Vector local_e4; float local_dc; ANM2 *spriteCopy; Vector local_d4; uint slot; float local_c8; Entity_Player *player; Vector renderPos; uint local_b8; float heartSpacingY; uint maxColumn; float local_ac; float heartSpacingX; PlayerHUD *self; char isCompactHud; byte local_9e; char isFlipped; undefined1 local_9c [8]; float local_94; float local_90; float fStack_8c; float fStack_88; float fStack_84; float local_80; float local_7c; float local_78; float local_74; undefined1 local_70 [24]; KColor KStack_58; FontSettings local_40 [2]; KColor local_38; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; FontSettings local_14; Game *game; ANM2 *heartSprite; PlayerHUD *hud; ushort hudIndex; bool isMultipleMantles; Manager *manager; Entity_Player *playerRef; puStack_20 = (undefined1 *)(local_40 + 0xf); local_14 = (FontSettings)0xffffffff; puStack_18 = &LAB_00b02d45; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_40 + 0xc); ExceptionList = &local_1c; spriteCopy = sprite; outSize = unk; self = this; if (g_game->_currentRoomIdx == -0x13) { renderPos.y = pos.y - 6.0; renderPos.x = pos.x - 4.0; position.y = renderPos.y; position.x = renderPos.x; puStack_20 = (undefined1 *)(local_40 + 0xf); render_deathmatch_health_bar(this,unk,position); ExceptionList = local_1c; return; } heartSpacingX = 12.0; heartSpacingY = 10.0; if ((((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (1 < *(int *)&g_game->_deathmatchManager)) || ((g_manager->_optionsConfig)._onlineHud != 1)) || ((hudIndex = this->_playerHudIndex, hudIndex == 0 || (hudIndex == 4)))) { hudIndex = this->_playerHudIndex; isCompactHud = '\0'; } else { isCompactHud = '\x01'; } local_d4.y = (float)(uint)hudIndex; if (((short)hudIndex < 4) || (isFlipped = '\x01', playerHudLayout != 1)) { isFlipped = '\0'; } if (isCompactHud == '\0') { local_70._20_4_ = std::_Allocate(0x20); KStack_58._alpha = 2.8026e-44; KStack_58._unk = 0x1f; builtin_strncpy((char *)local_70._20_4_,"gfx/ui/ui_hearts.png",0x15); local_14 = (FontSettings)0x1; local_9e = Sprite::ReplaceSpritesheet((Sprite *)sprite,0,(std_string *)(local_70 + 0x14)); local_14 = (FontSettings)0xffffffff; bVar1 = extraout_CL_01; if (0xf < (uint)KStack_58._unk) { uVar4 = KStack_58._unk + 1; freeBlock = (char *)local_70._20_4_; if (0xfff < uVar4) { freeBlock = *(char **)(local_70._20_4_ + -4); uVar4 = KStack_58._unk + 0x24; if ((char *)0x1f < (char *)(local_70._20_4_ + (-4 - (int)freeBlock))) goto LAB_00844077; } operator_delete(freeBlock,uVar4); bVar1 = extraout_CL_02; } if (local_9e != 0) { ANM2::LoadGraphics(sprite,bVar1); } } else { puStack_20 = (undefined1 *)(local_40 + 0xf); local_70._20_4_ = std::_Allocate(0x20); KStack_58._alpha = 3.64338e-44; KStack_58._unk = 0x1f; builtin_strncpy((char *)local_70._20_4_,"gfx/ui/ui_hearts_small.png",0x1b); local_14 = (FontSettings)0x0; local_9e = Sprite::ReplaceSpritesheet((Sprite *)sprite,0,(std_string *)(local_70 + 0x14)); local_14 = (FontSettings)0xffffffff; bVar1 = extraout_CL; if (0xf < (uint)KStack_58._unk) { uVar4 = KStack_58._unk + 1; freeBlock = (char *)local_70._20_4_; if (0xfff < uVar4) { freeBlock = *(char **)(local_70._20_4_ + -4); uVar4 = KStack_58._unk + 0x24; if ((char *)0x1f < (char *)(local_70._20_4_ + (-4 - (int)freeBlock))) { LAB_00844077: local_14 = (FontSettings)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); bVar1 = extraout_CL_00; } if (local_9e != 0) { ANM2::LoadGraphics(sprite,bVar1); } heartSpacingX = 8.0; heartSpacingY = 6.0; } fVar5 = 8.0; player = this->_player; if ((player == (Entity_Player *)0x0) || (player->_isCoopGhost != 0)) { outSize->x = heartSpacingX * scale; outSize->y = heartSpacingY * scale; ExceptionList = local_1c; return; } local_c8 = 0.0; if (playerHudLayout == 3) { if (3 < local_d4.y._0_2_) { fVar9 = pos.x + 0.0; pos.y = pos.y + 34.0; if (isCompactHud != '\0') { pos.y = pos.y - 4.0; } fVar7 = pos.y; pos.x = fVar9; KColor::SetFromARGB(&local_38,0xffffffff); local_e4.y = fVar7 - 12.0; renderPos.x = fVar9 + 45.0; local_e4.x = fVar9 - fVar5; renderPos.y = local_e4.y; render_color_quad(&local_e4,&renderPos,fromColor,fromColor,1.0); } isCompactHud = '\x01'; } game = g_game; fVar5 = scale * g_vectorOne.y; (sprite->_scale).x = scale * g_vectorOne.x; (sprite->_scale).y = fVar5; uVar4 = game->_debugCurses; uVar3 = game->_curses; fVar5 = scale; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); renderSprite = spriteCopy; if ((~preventedCurses & (forcedCurses | uVar4 | uVar3) & 8) != 0) { ANM2::SetFrame(spriteCopy,(std_string *)"CurseHeart",0); ANM2::Render(renderSprite,&pos,&g_vectorZero,&g_vectorZero); (renderSprite->_scale).x = g_vectorOne.x; (renderSprite->_scale).y = g_vectorOne.y; outSize->x = heartSpacingX * scale; outSize->y = heartSpacingY * scale; ExceptionList = local_1c; return; } maxColumn = 0xffffffff; local_ac = 0.0; heartSlotCount = 0; local_9e = Entity_Player::HasInstantDeathCurse(player); renderSprite = spriteCopy; if (isFlipped != '\0') { spriteCopy->_flipX = 1; } iVar2 = Entity_Player::GetHealthType(player); playerRef = extraout_ECX; uVar4 = 0xffffffff; if (iVar2 != 2) { slot = 0x17; playerRef = extraout_ECX; do { hud = self; heartSprite = spriteCopy; local_b8 = 0xff; if (((5 < slot) && ((playerRef->_playerType == 0x10 || (playerRef->_playerType == 0x11)))) || (local_9e != 0)) { local_b8 = 0x50; } local_d4.y = (float)(slot * 0x10); if (*(char *)((int)self->_activeItem + ((int)local_d4.y - 0x180U)) != '\0') { local_dc = (float)(slot % 6); fVar9 = (float)(slot / 6); uVar4 = (uint)local_dc; if ((int)local_dc <= (int)maxColumn) { uVar4 = maxColumn; } local_e4.y = fVar9; if ((int)fVar9 <= (int)local_ac) { local_e4.y = local_ac; } fVar7 = heartSpacingX; if (isFlipped != '\0') { fVar7 = -heartSpacingX; } renderPos.y = (float)(int)fVar9 * heartSpacingY * fVar5 + pos.y; renderPos.x = (float)(int)local_dc * fVar7 * fVar5 + pos.x; maxColumn = uVar4; bVar1 = ANM2::SetAnimation(spriteCopy, *(byte **)((int)self->_activeItem + ((int)local_d4.y - 0x178U)),1 ); if (((bVar1 != 0) && ((heartSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&heartSprite->_animState,0.0), (heartSprite->_animState)._animData != (void *)0x0)) { (heartSprite->_animState)._isPlaying = 0; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c82680) && (_Init_thread_header(&DAT_00c82680), DAT_00c82680 == -1)) { _DAT_00c826a8 = 0x3f008081; _DAT_00c82698 = 0; uRam00c8269c = 0; uRam00c826a0 = 0; uRam00c826a4 = 0; _DAT_00c82688 = 0x3f800000; uRam00c8268c = 0x3f800000; uRam00c82690 = 0x3f800000; uRam00c82694 = 0x3f800000; _DAT_00c826ac = 0; _DAT_00c826b0 = 0; _DAT_00c826c4 = 0; uRam00c826c8 = 0; uRam00c826cc = 0; uRam00c826d0 = 0; _DAT_00c826d4 = 0x3e48c8ca; _DAT_00c826b4 = 0x3f800000; uRam00c826b8 = 0x3f800000; uRam00c826bc = 0x3f800000; uRam00c826c0 = 0x3f800000; _DAT_00c826d8 = 0x3e8c8c8d; _DAT_00c826dc = 0x3eb4b4b5; _DAT_00c826f0 = 0; uRam00c826f4 = 0; uRam00c826f8 = 0; uRam00c826fc = 0; _DAT_00c82700 = 0x3ea0a0a1; _DAT_00c826e0 = 0x3f800000; uRam00c826e4 = 0x3f800000; uRam00c826e8 = 0x3f800000; uRam00c826ec = 0x3f800000; _DAT_00c82704 = 0x3dd0d0d2; _DAT_00c82708 = 0x3dd0d0d2; _DAT_00c8271c = 0; uRam00c82720 = 0; uRam00c82724 = 0; uRam00c82728 = 0; DAT_00c8272c._0_4_ = 0x3f008081; _DAT_00c8270c = 0x3f800000; uRam00c82710 = 0x3f800000; uRam00c82714 = 0x3f800000; uRam00c82718 = 0x3f800000; DAT_00c8272c._4_4_ = 0x3ec8c8ca; DAT_00c82734 = 0x3da0a0a1; _DAT_00c82748 = 0; uRam00c8274c = 0; uRam00c82750 = 0; uRam00c82754 = 0; _DAT_00c82758 = 0x3e70f0f2; _DAT_00c82738 = 0x3f800000; uRam00c8273c = 0x3f800000; uRam00c82740 = 0x3f800000; uRam00c82744 = 0x3f800000; _DAT_00c8275c = 0x3f008081; _DAT_00c82760 = 0; _Init_thread_footer(&DAT_00c82680); } uVar4 = (uint)*(byte *)((int)(hud->_activeItem + -0x13) + (int)local_d4.y); if ((hud->_goldHeartFlashCountdown == 0) || (*(char *)((int)hud->_activeItem + ((int)local_d4.y - 0x17eU)) == '\0')) { if (uVar4 != 0) goto LAB_00844425; spriteColor = &heartSprite->_color; fVar5 = 0.0; fVar9 = 0.0; fVar7 = 0.0; fVar8 = 0.0; fVar6 = (float)(int)local_b8 * 0.003921569; if (slot != 0) { heartAlphaColor = 0x3f800000; uStack_140 = 0x3f800000; uStack_13c = 0x3f800000; local_124 = 0; uStack_120 = 0; local_11c = 0; fStack_138 = fVar6; if (spriteColor == (ColorMod *)&heartAlphaColor) goto LAB_008445e0; colorOffsetB = 0.0; spriteColor->_tint[0] = 1.0; (heartSprite->_color)._tint[1] = 1.0; (heartSprite->_color)._tint[2] = 1.0; (heartSprite->_color)._tint[3] = fVar6; (heartSprite->_color)._offset[0] = 0.0; (heartSprite->_color)._offset[1] = 0.0; goto LAB_008445d9; } heartFlashColor = 0x3f800000; uStack_114 = 0x3f800000; uStack_110 = 0x3f800000; uStack_f4 = 0; local_f0 = 0; local_f8 = (float)(int)self->_lastHeartFlash * 0.003921569; if (spriteColor != (ColorMod *)&heartFlashColor) { (heartSprite->_color)._colorize[0] = 0.0; (heartSprite->_color)._colorize[1] = 0.0; (heartSprite->_color)._colorize[2] = 0.0; (heartSprite->_color)._colorize[3] = 0.0; spriteColor->_tint[0] = 1.0; (heartSprite->_color)._tint[1] = 1.0; (heartSprite->_color)._tint[2] = 1.0; (heartSprite->_color)._tint[3] = fVar6; (heartSprite->_color)._offset[0] = local_f8; (heartSprite->_color)._offset[1] = 0.0; (heartSprite->_color)._offset[2] = 0.0; } fStack_10c = fVar6; } else { uVar4 = 4; LAB_00844425: iVar2 = uVar4 * 0x2c; heartColor = *(float *)(&DAT_00c8265c + iVar2); fStack_1f0 = (float)(&DAT_00c82660)[uVar4 * 0xb]; fStack_1ec = (float)(&DAT_00c82664)[uVar4 * 0xb]; fVar5 = *(float *)(&DAT_00c8266c + iVar2); fVar9 = (float)(&DAT_00c82670)[uVar4 * 0xb]; fVar7 = (float)(&DAT_00c82674)[uVar4 * 0xb]; fVar8 = (float)(&DAT_00c82678)[uVar4 * 0xb]; fStack_1e8 = (float)(int)local_b8 / 255.0; colorOffsetB = *(float *)(&DAT_00c82684 + iVar2); if (&heartSprite->_color != (ColorMod *)&heartColor) { *(undefined8 *)(heartSprite->_color)._offset = *(undefined8 *)(&DAT_00c8267c + uVar4 * 0xb); (heartSprite->_color)._tint[0] = heartColor; (heartSprite->_color)._tint[1] = fStack_1f0; (heartSprite->_color)._tint[2] = fStack_1ec; (heartSprite->_color)._tint[3] = fStack_1e8; LAB_008445d9: (heartSprite->_color)._offset[2] = colorOffsetB; (heartSprite->_color)._colorize[0] = fVar5; (heartSprite->_color)._colorize[1] = fVar9; (heartSprite->_color)._colorize[2] = fVar7; (heartSprite->_color)._colorize[3] = fVar8; } } LAB_008445e0: local_ac = (float)(int)local_b8; spriteColor = &heartSprite->_color; if (*(char *)((int)self->_activeItem + ((int)local_d4.y - 0x17dU)) != '\0') { fVar5 = sin(((float)g_game->_frameCount * 3.1415927) / 30.0); KStack_58._unk = (int)(heartSprite->_color)._offset[2]; local_78 = 0.0; fVar5 = fVar5 * 0.5 + 0.5; local_74 = 0.0; local_7c = fVar5 * 0.1; local_9c._0_4_ = fVar5 * 0.3 + 0.5; local_90 = 1.0; fStack_8c = 1.0; fStack_88 = 1.0; fStack_84 = 1.0; local_80 = 0.6 - local_7c; local_70._0_4_ = spriteColor->_tint[0]; local_70._4_4_ = (heartSprite->_color)._tint[1]; local_70._8_4_ = (heartSprite->_color)._tint[2]; local_70._12_4_ = (heartSprite->_color)._tint[3]; local_70._16_4_ = (heartSprite->_color)._colorize[0]; local_70._20_4_ = (heartSprite->_color)._colorize[1]; KStack_58._red = (heartSprite->_color)._colorize[2]; KStack_58._green = (heartSprite->_color)._colorize[3]; KStack_58._blue = (heartSprite->_color)._offset[0]; KStack_58._alpha = (heartSprite->_color)._offset[1]; local_9c._4_4_ = local_9c._0_4_; local_94 = (float)local_9c._0_4_; Color::__mul((Color *)local_70,(ColorMod *)local_9c); if (spriteColor != (ColorMod *)local_9c) { spriteColor->_tint[0] = (float)local_70._0_4_; (heartSprite->_color)._tint[1] = (float)local_70._4_4_; (heartSprite->_color)._tint[2] = (float)local_70._8_4_; (heartSprite->_color)._tint[3] = (float)local_70._12_4_; (heartSprite->_color)._colorize[0] = (float)local_70._16_4_; (heartSprite->_color)._colorize[1] = (float)local_70._20_4_; (heartSprite->_color)._colorize[2] = KStack_58._red; (heartSprite->_color)._colorize[3] = KStack_58._green; (heartSprite->_color)._offset[0] = KStack_58._blue; (heartSprite->_color)._offset[1] = KStack_58._alpha; (heartSprite->_color)._offset[2] = (float)KStack_58._unk; } } if (heartSprite->_loaded != 0) { if (heartSprite->_overlayRenderFirst == 0) { AnimationState::Render(&heartSprite->_animState,&renderPos,&g_vectorZero,&g_vectorZero); lastAnimState = &heartSprite->_overlayAnimState; } else { AnimationState::Render (&heartSprite->_overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); lastAnimState = &heartSprite->_animState; } AnimationState::Render(lastAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } if (*(char *)((int)self->_activeItem + ((int)local_d4.y - 0x17fU)) != '\0') { bVar1 = ANM2::SetAnimation(heartSprite, *(byte **)((int)self->_activeItem + ((int)local_d4.y - 0x174U)) ,1); if (((bVar1 != 0) && ((heartSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&heartSprite->_animState,0.0), (heartSprite->_animState)._animData != (void *)0x0)) { (heartSprite->_animState)._isPlaying = 0; } fVar5 = local_ac * 0.003921569; if (slot == 0) { overlayFlashColor = 0x3f800000; uStack_16c = 0x3f800000; uStack_168 = 0x3f800000; uStack_14c = 0; local_148 = 0; fVar9 = (float)(int)self->_lastHeartFlash * 0.003921569; fStack_164 = fVar5; local_150 = fVar9; if (spriteColor != (ColorMod *)&overlayFlashColor) { spriteColor->_tint[0] = 1.0; (heartSprite->_color)._tint[1] = 1.0; (heartSprite->_color)._tint[2] = 1.0; (heartSprite->_color)._tint[3] = fVar5; goto LAB_00844877; } } else { overlayColor = 0x3f800000; uStack_198 = 0x3f800000; uStack_194 = 0x3f800000; local_17c = 0; uStack_178 = 0; local_174 = 0; fStack_190 = fVar5; if (spriteColor != (ColorMod *)&overlayColor) { spriteColor->_tint[0] = 1.0; (heartSprite->_color)._tint[1] = 1.0; (heartSprite->_color)._tint[2] = 1.0; (heartSprite->_color)._tint[3] = fVar5; fVar9 = 0.0; LAB_00844877: (heartSprite->_color)._offset[0] = fVar9; (heartSprite->_color)._offset[1] = 0.0; (heartSprite->_color)._offset[2] = 0.0; (heartSprite->_color)._colorize[0] = 0.0; (heartSprite->_color)._colorize[1] = 0.0; (heartSprite->_color)._colorize[2] = 0.0; (heartSprite->_color)._colorize[3] = 0.0; } } if (*(char *)((int)self->_activeItem + ((int)local_d4.y - 0x17dU)) != '\0') { fVar5 = sin(((float)g_game->_frameCount * 3.1415927) / 30.0); KStack_58._unk = (int)(heartSprite->_color)._offset[2]; local_78 = 0.0; fVar5 = fVar5 * 0.5 + 0.5; local_74 = 0.0; local_7c = fVar5 * 0.1; local_9c._0_4_ = fVar5 * 0.3 + 0.5; local_90 = 1.0; fStack_8c = 1.0; fStack_88 = 1.0; fStack_84 = 1.0; local_80 = 0.6 - local_7c; local_70._0_4_ = spriteColor->_tint[0]; local_70._4_4_ = (heartSprite->_color)._tint[1]; local_70._8_4_ = (heartSprite->_color)._tint[2]; local_70._12_4_ = (heartSprite->_color)._tint[3]; local_70._16_4_ = (heartSprite->_color)._colorize[0]; local_70._20_4_ = (heartSprite->_color)._colorize[1]; KStack_58._red = (heartSprite->_color)._colorize[2]; KStack_58._green = (heartSprite->_color)._colorize[3]; KStack_58._blue = (heartSprite->_color)._offset[0]; KStack_58._alpha = (heartSprite->_color)._offset[1]; local_9c._4_4_ = local_9c._0_4_; local_94 = (float)local_9c._0_4_; Color::__mul((Color *)local_70,(ColorMod *)local_9c); if (spriteColor != (ColorMod *)local_9c) { spriteColor->_tint[0] = (float)local_70._0_4_; (heartSprite->_color)._tint[1] = (float)local_70._4_4_; (heartSprite->_color)._tint[2] = (float)local_70._8_4_; (heartSprite->_color)._tint[3] = (float)local_70._12_4_; (heartSprite->_color)._colorize[0] = (float)local_70._16_4_; (heartSprite->_color)._colorize[1] = (float)local_70._20_4_; (heartSprite->_color)._colorize[2] = KStack_58._red; (heartSprite->_color)._colorize[3] = KStack_58._green; (heartSprite->_color)._offset[0] = KStack_58._blue; (heartSprite->_color)._offset[1] = KStack_58._alpha; (heartSprite->_color)._offset[2] = (float)KStack_58._unk; } } ANM2::Render(heartSprite,&renderPos,&g_vectorZero,&g_vectorZero); } if ((heartSlotCount == 0) && (local_b8 == 0xff)) { heartSlotCount = slot + 1; } local_ac = local_e4.y; renderSprite = heartSprite; fVar5 = scale; } hud = self; slot = slot - 1; playerRef = player; } while (-1 < (int)slot); ANM2::SetFrame(renderSprite,(std_string *)"GoldHeartOverlay",0); if ((player->_playerType == 0x10) || (player->_playerType == 0x11)) { iVar2 = 0x50; } else { iVar2 = 0xff; } spriteColor = ColorParams::set_from_bytes((ColorParams *)local_9c,0xff,0xff,0xff,iVar2,0,0,0); Sprite::SetColor((Sprite *)renderSprite,spriteColor); local_b8 = 0x17; do { if (local_b8 == 5) { Color::Reset(&goldOverlayColor); goldOverlayColor._offset[0] = 0.0; goldOverlayColor._offset[1] = 0.0; goldOverlayColor._offset[2] = 0.0; if (&renderSprite->_color != (ColorMod *)&goldOverlayColor) { (renderSprite->_color)._tint[0] = 1.0; (renderSprite->_color)._tint[1] = 1.0; (renderSprite->_color)._tint[2] = 1.0; (renderSprite->_color)._tint[3] = 1.0; (renderSprite->_color)._colorize[0] = goldOverlayColor._colorize[0]; (renderSprite->_color)._colorize[1] = goldOverlayColor._colorize[1]; (renderSprite->_color)._colorize[2] = goldOverlayColor._colorize[2]; (renderSprite->_color)._colorize[3] = goldOverlayColor._colorize[3]; (renderSprite->_color)._offset[0] = 0.0; (renderSprite->_color)._offset[1] = 0.0; (renderSprite->_color)._offset[2] = 0.0; } } if ((*(char *)((int)hud->_activeItem + local_b8 * 0x10 + -0x180) != '\0') && (*(char *)((int)hud->_activeItem + local_b8 * 0x10 + -0x17e) != '\0')) { fVar5 = heartSpacingX; if (isFlipped != '\0') { fVar5 = -heartSpacingX; } renderPos.y = (float)(local_b8 / 6) * heartSpacingY * scale + pos.y; renderPos.x = pos.x + (float)(local_b8 % 6) * fVar5 * scale; ANM2::Render(renderSprite,&renderPos,&g_vectorZero,&g_vectorZero); } local_b8 = local_b8 - 1; } while (-1 < (int)local_b8); playerRef = player; uVar4 = maxColumn; } local_9e = '\0'; if ((((playerRef->_temporaryeffects)._disabled == 0) && (mantleEffect = TemporaryEffects::GetCollectibleEffect(&playerRef->_temporaryeffects,0x139), mantleEffect != (void *)0x0)) && (local_d4.y = *(float *)((int)mantleEffect + 4), 0 < (int)local_d4.y)) { local_38._red = 0.0; local_38._green = 0.0; iVar2 = FUN_007dafb0(); if (iVar2 != 0) { local_38._red = 1.6794377e-38; } uVar4 = (uint)(iVar2 != 0); uVar3 = FUN_007dafb0(); if (1 < uVar3) { local_40[uVar4 + 2] = (FontSettings)"HolyMantleWoodenCross"; uVar4 = uVar4 + 1; } local_e4.y = (float)self->_player; bVar1 = TemporaryEffects::HasCollectibleEffect (&((Entity_Player *)local_e4.y)->_temporaryeffects,0x217); if (bVar1 != 0) { local_40[uVar4 + 2] = (FontSettings)"HolyMantleBlanket"; uVar4 = uVar4 + 1; } bVar1 = Entity_Player::HasCollectible((Entity_Player *)local_e4.y,0x139,0); if ((bVar1 != 0) && (*(char *)((int)self->_player + 0x13b4) == '\0')) { local_40[uVar4 + 2] = (FontSettings)"HolyMantle"; uVar4 = uVar4 + 1; } bVar1 = TemporaryEffects::HasNullEffect((TemporaryEffects *)((int)self->_player + 0x1508),0x2e); if (bVar1 != 0) { local_40[uVar4 + 2] = (FontSettings)"HolyMantleHolyCard"; uVar4 = uVar4 + 1; } for (; ((int)uVar4 < (int)local_d4.y && (uVar4 < 5)); uVar4 = uVar4 + 1) { local_40[uVar4 + 2] = (FontSettings)"HolyMantle"; } if ((player->_playerType == 0x10) || (player->_playerType == 0x11)) { iVar2 = 5; } else { iVar2 = Entity_Player::GetHeartLimit(player,0); iVar2 = iVar2 / 2; if (iVar2 < 0xc) { iVar2 = 0xc; } iVar2 = iVar2 + -1; } if (iVar2 < heartSlotCount) { local_c8 = heartSpacingX; if (isFlipped != '\0') { local_c8 = -heartSpacingX; } local_9e = '\x01'; } else { iVar2 = heartSlotCount; } uVar3 = iVar2 % 6; uVar4 = maxColumn; if ((int)maxColumn < (int)uVar3) { uVar4 = uVar3; } fVar5 = heartSpacingX; if (isFlipped != '\0') { fVar5 = -heartSpacingX; } fVar9 = (float)(iVar2 / 6) * heartSpacingY * scale + pos.y; local_e4.y = ((float)(int)uVar3 * fVar5 + local_c8) * scale + pos.x; isMultipleMantles = 1 < (int)local_d4.y; local_d4.x = local_e4.y; local_d4.y = fVar9; local_c8 = fVar9; maxColumn = uVar4; if ((isMultipleMantles) && ((std_string *)local_38._green != (std_string *)0x0)) { Color::operator_assign((Color *)local_9c,&((Sprite *)renderSprite)->_color); local_90 = 0.5; Sprite::SetColor((Sprite *)renderSprite,color_00); ANM2::SetFrame(renderSprite,(std_string *)local_38._green,0); if (isFlipped == '\0') { fVar5 = 6.0; } else { fVar5 = -6.0; } renderPos.x = fVar5 * scale + local_e4.y; renderPos.y = local_c8 + scale * -4.0; ANM2::Render(renderSprite,&renderPos,&g_vectorZero,&g_vectorZero); KColor::SetFromARGB(&KStack_58,0xffffffff); spriteColor = (ColorMod *)Color::Color(extraout_ECX_00); Sprite::SetColor((Sprite *)renderSprite,spriteColor); } if ((std_string *)local_38._red != (std_string *)0x0) { ANM2::SetFrame(renderSprite,(std_string *)local_38._red,0); ANM2::Render(renderSprite,&local_d4,&g_vectorZero,&g_vectorZero); } } if (isFlipped != '\0') { ((Sprite *)renderSprite)->_flipX = 0; } local_e4.y = (float)Entity_Player::GetExtraLives(player); fVar5 = local_ac; if ((int)local_e4.y < 1) goto LAB_008450ef; fVar9 = heartSpacingX; if (isFlipped != '\0') { fVar9 = -heartSpacingX; } local_d4.y = (float)(int)local_ac * heartSpacingY * scale + pos.y; local_dc = (g_game->_screenShakeOffset).y; local_c8 = pos.x + (float)(int)uVar4 * fVar9 * scale + (g_game->_screenShakeOffset).x; Entity_Player::HasCollectible(player,0xd4,0); sprintf_s((byte *)&local_90,0x20,(byte *)"x%d%s"); manager = g_manager; fVar5 = (-8.0 - (float)(int)fVar5 * 6.0) + local_d4.y + local_dc; if (isFlipped == '\0') { fVar9 = local_c8 + 10.0; if (local_9e == '\0') { if (isCompactHud != '\0') goto LAB_00845062; } else if (isCompactHud == '\0') { fVar9 = fVar9 + heartSpacingX; } else { LAB_00845062: fVar9 = fVar9 - 5.0; } } else { iVar2 = Font::get_string_width_n (&g_manager->_font6_PFTempestaSevenCondensed,(byte *)&local_90,-1); fVar9 = (-10.0 - (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])) + local_c8; if (local_9e == '\0') { if (isCompactHud != '\0') goto LAB_00845023; } else if (isCompactHud == '\0') { fVar9 = fVar9 - heartSpacingX; } else { LAB_00845023: fVar9 = fVar9 + 5.0; } } if (scale == 1.0) { FontSettings::constructor(local_40); local_14 = (FontSettings)0x3; KColor::SetFromARGB(&KStack_58,0xffffffff); Font::DrawString(&local_90,extraout_ECX_01,extraout_EAX); } else { fVar7 = scale; FontSettings::constructor(local_40); local_14 = (FontSettings)0x2; KColor::SetFromARGB(&KStack_58,0xffffffff); pos_00.y = fVar5; pos_00.x = fVar9; scale_00.y = fVar7; scale_00.x = fVar7; Font::DrawString(&manager->_font6_PFTempestaSevenCondensed,(byte *)&local_90,pos_00,scale_00, color,settings); } LAB_008450ef: (spriteCopy->_scale).x = g_vectorOne.x; (spriteCopy->_scale).y = g_vectorOne.y; outSize->x = ((float)(int)maxColumn * heartSpacingX + heartSpacingX) * scale; outSize->y = ((float)(int)local_ac * heartSpacingY + heartSpacingY + 2.0) * scale; ExceptionList = local_1c; return; } //@@ 008452f0 FUN_008452f0 void FUN_008452f0(SourceQuad *param_1,void *param_2,ColorMod *param_3) { undefined *puVar1; int *in_ECX; int *other; undefined1 auStackY_b8 [128]; void *in_stack_ffffffd0; void *in_stack_ffffffd4; float local_1c; float fStack_18; float fStack_14; float fStack_10; undefined4 local_c; undefined1 *local_8; puVar1 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar1 = g_currentShader; } g_currentShader = puVar1; if (*in_ECX < 0) { local_8 = auStackY_b8 + 0x88; KAGE::SmartPointer::operator_assign (auStackY_b8 + 0x88,&(g_game->_proceduralItemManager)._renderTarget); apply_sprite_shader_params(param_3,1,in_stack_ffffffd0,in_stack_ffffffd4); local_1c = param_3->_tint[0]; fStack_18 = param_3->_tint[1]; fStack_14 = param_3->_tint[2]; fStack_10 = param_3->_tint[3]; local_c = 0; GlitchedCollectibleGfx::render_item (&g_game->_proceduralItemManager,*in_ECX,param_1,param_2,&local_1c); return; } other = in_ECX + 2; if (*other != 0) { KAGE::SmartPointer::operator_assign(auStackY_b8 + 0x88,other); apply_sprite_shader_params(param_3,1,in_stack_ffffffd0,in_stack_ffffffd4); local_1c = param_3->_tint[0]; fStack_18 = param_3->_tint[1]; fStack_14 = param_3->_tint[2]; fStack_10 = param_3->_tint[3]; local_c = 0; (**(code **)(*(int *)*other + 0x14))(param_1); } return; } //@@ 008453c0 PlayerHUD::RenderActiveItem /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (slot, ANM2*, layout, size, alpha): BarEmpty/BarFull/BarOverlayN charge bar layers, GetTotalActiveCharge/GetActiveMaxCharge, ItemConfig::GetCollectible, HasPlayerForm; zhl sig missed prototype: REPENTOGON, confirmed by RET 24 */ void __thiscall PlayerHUD::RenderActiveItem (PlayerHUD *this,uint activeSlot,Vector *pos,int playerHudLayout,float size,float alpha, byte unused) { byte bVar1; byte bVar2; int iVar3; undefined *shader; int iVar4; undefined4 *shader; float *extraout_EAX; float *extraout_EAX_00; float *extraout_EAX_01; void *pvVar6; uint uVar7; ColorMod *color; ColorMod *color_00; ColorMod *color_01; ColorMod *color_02; PlayerHUD *extraout_ECX; KColor *color_03; int unused_00; KColor *color_04; int extraout_ECX_00; int extraout_ECX_01; KColor *color_05; int extraout_ECX_02; KColor *color_06; PlayerHUD *extraout_ECX_03; PlayerHUD *extraout_ECX_04; Manager *pMVar8; undefined1 *extraout_EDX; float *pfVar9; PlayerHUD *pPVar10; float *pfVar11; char *barOverlayAnim; bool bVar12; float fVar13; undefined1 auVar14 [12]; undefined1 auVar15 [12]; float fVar16; undefined1 *puVar17; float fVar18; float fVar19; float fVar20; undefined8 uVar21; double dVar22; undefined1 auStackY_2f0 [128]; Vector *pVVar23; KColor *pKVar24; undefined1 local_254 [112]; undefined4 local_1e4; undefined4 uStack_1e0; undefined4 uStack_1dc; undefined4 uStack_1d8; undefined4 local_1d4; undefined4 uStack_1d0; undefined4 uStack_1cc; undefined4 uStack_1c8; undefined4 local_1c4; undefined4 local_1c0; undefined4 uStack_1bc; undefined4 uStack_1b8; undefined4 uStack_1b4; undefined4 local_1b0; undefined4 uStack_1ac; undefined4 uStack_1a8; undefined4 uStack_1a4; undefined4 local_1a0; float partialCharge; float local_198 [4]; float local_188; float local_184; float local_180; float local_17c; Vector local_124; ItemConfig_Item *itemConfig; float iconSize; float local_114; Vector iconFrameSize; Vector local_108; int soulCharge; int bloodCharge; ANM2 *chargeBar; int subCharge; KColor quadColor; int slotDescOffset; float local_d8; undefined1 *itemId; float scale; float local_cc; float local_c8; undefined1 *local_c4; float iconOffsetY; float iconOffsetX; Vector local_b8; float barOffsetY; float posX; PlayerHUD *local_a8; int slotDwordIndex; int maxCharge; float local_9c; Vector local_98; float local_90; float local_8c; Entity_Player *hudPlayer; PlayerHUD *hud; char isSmallHud; void *local_7c; Vector local_78; char isOutlineGlow; undefined1 local_6c [12]; float fStack_60; float local_5c; float fStack_58; float fStack_54; float fStack_50; float local_4c; float local_48; float local_44; ColorMod tmpColor; float local_14; Entity_Player *player; local_14 = (float)(__security_cookie ^ (uint)((&tmpColor)[1]._tint + 1)); player = this->_player; local_90 = (float)activeSlot; local_b8.y = (float)pos; if (player == (Entity_Player *)0x0) { return; } if (player->_isCoopGhost != 0) { return; } pMVar8 = g_manager; hudPlayer = player; hud = this; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_00845448: isSmallHud = '\0'; } else { uVar21 = FUN_009a84c0(); pMVar8 = (Manager *)((ulonglong)uVar21 >> 0x20); this = extraout_ECX; if ((int)uVar21 != 1) goto LAB_00845448; this = hud; if ((hud->_playerHudIndex == 0) || (isSmallHud = '\x01', hud->_playerHudIndex == 4)) goto LAB_00845448; } if (3 < activeSlot) goto LAB_00846e5f; this = (PlayerHUD *)0x388c; puVar17 = (undefined1 *)player->_activeDesc[activeSlot]._item; if (isSmallHud == '\0') { this = (PlayerHUD *)0x3778; } local_a8 = (PlayerHUD *)((int)hud->_HUD + (int)this); local_c4 = puVar17; if (puVar17 == (undefined1 *)0x0) goto LAB_00846e5f; itemConfig = ItemConfig::GetCollectible(&pMVar8->_itemConfig,(int)puVar17); local_8c = (float)player->_activeDesc[(int)local_90]._charge; local_9c = (float)player->_activeDesc[(int)local_90]._batteryCharge; maxCharge = Entity_Player::GetActiveMaxCharge(player,(int)local_90); subCharge = player->_activeDesc[(int)local_90]._subCharge; if (player->_playerType == 0x12) { soulCharge = player->_effectiveSoulCharge; LAB_00845502: bloodCharge = 0; } else { soulCharge = 0; if (player->_playerType != 0x24) goto LAB_00845502; bloodCharge = player->_effectiveBloodCharge; } slotDescOffset = (int)local_90 * 0x20; partialCharge = (float)player->_activeDesc[(int)local_90]._partialCharge; uVar21 = FUN_007308d0(); local_d8 = (float)uVar21; if ((g_game->_challenge == 0x2c) && (puVar17 == (undefined1 *)0x244)) { maxCharge = *(int *)((int)&player->_activeDesc[0]._varData + (int)((ulonglong)uVar21 >> 0x20)); iVar3 = TemporaryEffects::GetNullEffectNum(&player->_temporaryeffects,0x6d); local_9c = 0.0; subCharge = 0; local_d8 = 2.8026e-45; local_8c = 0.0; if (0 < maxCharge - iVar3) { local_8c = (float)(maxCharge - iVar3); } } slotDwordIndex = (int)local_90 * 7; posX = (float)*(void **)local_b8.y; local_7c = *(void **)((int)local_b8.y + 4); if (1 < *(int *)&g_game->_deathmatchManager) { posX = posX - 12.0; } iconFrameSize.x = (float)&DAT_42000000; iconFrameSize.y = (float)&DAT_42000000; if (local_90 == 1.4013e-45) { scale = 0.5; } else { scale = 1.0; } scale = scale * size; barOffsetY = 3.0; if ((*(int *)((int)hud->_activeItem + (int)local_90 * 0x1c + 8) == 0) && (*(int *)((int)hud->_activeItem + (int)local_90 * 0x1c + 0x10) == 0)) { itemId = local_c4; chargeBar = (ANM2 *)local_a8; this = local_a8; pPVar10 = local_a8; if (*(int *)((int)hud->_activeItem + (int)local_90 * 0x1c) < 0) goto LAB_008456d5; goto LAB_008465f5; } LAB_008456d5: local_c8 = (g_game->_screenShakeOffset).x; local_cc = (g_game->_screenShakeOffset).y; shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_78.x = g_vectorZero.x; local_b8.y = g_vectorZero.y; local_78.y = g_vectorZero.y; g_currentShader = shader; FUN_00a11080(); FUN_00a11080(); KColor::SetFromARGB(&quadColor,0xffffffff); ColorQuad::ColorQuad(local_198,color_03); iconOffsetX = 0.0; iconOffsetY = -7.0; if (maxCharge < 1) { LAB_008457b5: isOutlineGlow = '\0'; } else { player = hud->_player; iVar3 = Entity_Player::GetActiveMaxCharge(player,(int)local_90); iVar4 = Entity_Player::GetTotalActiveCharge(player,(int)local_90); if ((iVar4 < iVar3) || (isOutlineGlow = '\x01', alpha < 1.0)) goto LAB_008457b5; } if ((int)local_c4 < 0x281) { if (local_c4 == (undefined1 *)0x280) { iVar3 = hudPlayer->_urnSouls; if (0x14 < iVar3) { iVar3 = 0x14; } pvVar6 = hudPlayer->_weapons[0]; local_78.x = (float)iVar3 * 32.0; if (pvVar6 == (void *)0x0) { if (hudPlayer->_weapons[1] != (void *)0x0) { pvVar6 = hudPlayer->_weapons[1]; goto LAB_0084599d; } } else { LAB_0084599d: if (*(int *)((int)pvVar6 + 0x30) == 0xc) { local_78.y = local_b8.y + 32.0; } } iconOffsetX = (float)&DAT_bf800000; iconOffsetY = -8.0; goto LAB_00845b82; } switch(local_c4) { case (undefined1 *)0x122: local_b8.y = (float)hudPlayer->_jarHearts * 0.5; dVar22 = ceil((double)local_b8.y); local_b8.y = (float)dVar22; iVar4 = (int)dVar22; if (10 < iVar4) { iVar4 = 10; } goto LAB_00845864; default: goto switchD_008457ef_caseD_123; case (undefined1 *)0x1a6: iVar3 = 3 - *(int *)((int)&hudPlayer->_activeDesc[0]._varData + slotDescOffset); iVar4 = 7; if (iVar3 < 7) { iVar4 = iVar3; } iVar3 = 0; if (0 < iVar4) { iVar3 = iVar4; } break; case (undefined1 *)0x1b2: iVar3 = hudPlayer->_jarFlies; if (0x14 < iVar3) { iVar3 = 0x14; } iVar4 = iVar3 % 0xb; local_78.y = (float)(iVar3 / 0xb) * 32.0; LAB_00845864: local_78.x = (float)iVar4 * 32.0; iconOffsetX = -5.0; iconOffsetY = -10.0; goto LAB_00845b82; case (undefined1 *)0x1e9: iVar3 = (int)*(short *)((int)&hudPlayer->_activeDesc[0]._varData + slotDescOffset + 2); break; case (undefined1 *)0x20b: if ((hudPlayer->_movingBoxContents)._begin != (hudPlayer->_movingBoxContents)._end) { local_78.x = (float)&DAT_42000000; } goto LAB_00845b82; } LAB_00845919: local_78.x = (float)iVar3 * 32.0; } else { switch(local_c4) { case (undefined1 *)0x2ad: iconOffsetX = (float)&DAT_bf800000; iVar3 = *(int *)((int)&hudPlayer->_activeDesc[0]._varData + slotDescOffset); if (0xc < iVar3) { iVar3 = 0xc; } local_78.x = (float)iVar3 * 32.0; iconOffsetY = -8.0; break; case (undefined1 *)0x2c6: if (local_90 == 2.8026e-45) goto switchD_008457ef_caseD_123; bVar12 = hudPlayer->_bagOfCraftingContent[0] != 0; bVar2 = bVar12 + 1; if (hudPlayer->_bagOfCraftingContent[1] == 0) { bVar2 = bVar12; } bVar1 = bVar2 + 1; if (hudPlayer->_bagOfCraftingContent[2] == 0) { bVar1 = bVar2; } bVar2 = bVar1 + 1; if (hudPlayer->_bagOfCraftingContent[3] == 0) { bVar2 = bVar1; } bVar1 = bVar2 + 1; if (hudPlayer->_bagOfCraftingContent[4] == 0) { bVar1 = bVar2; } bVar2 = bVar1 + 1; if (hudPlayer->_bagOfCraftingContent[5] == 0) { bVar2 = bVar1; } bVar1 = bVar2 + 1; if (hudPlayer->_bagOfCraftingContent[6] == 0) { bVar1 = bVar2; } bVar2 = bVar1 + 1; if (hudPlayer->_bagOfCraftingContent[7] == 0) { bVar2 = bVar1; } isOutlineGlow = bVar2 == 8; local_78.x = (float)bVar2 * 32.0; break; case (undefined1 *)0x2c7: if (hudPlayer->_playerType == 0x26) { local_78.x = (float)&DAT_42000000; } else { local_78.x = 0.0; } break; case (undefined1 *)0x2cb: if (*(int *)((int)&hudPlayer->_activeDesc[0]._varData + slotDescOffset) != 0) { fVar16 = scale * g_vectorOne.y; pvVar6 = hud->_HUD; *(float *)((int)pvVar6 + 0x58b4) = scale * g_vectorOne.x; *(float *)((int)pvVar6 + 0x58b8) = fVar16; ANM2::SetFrame((ANM2 *)((int)hud->_HUD + 0x5818),(std_string *)"IdleSmall", *(int *)((int)&hudPlayer->_activeDesc[0]._varData + slotDescOffset)); pPVar10 = hud; local_108.x = scale * 16.0 + posX; local_108.y = scale * 21.0 + (float)local_7c; Sprite::RenderLayer((Sprite *)((int)hud->_HUD + 0x5818),1,&local_108,&g_vectorZero, &g_vectorZero); pvVar6 = pPVar10->_HUD; *(float *)((int)pvVar6 + 0x58b4) = g_vectorOne.x; *(float *)((int)pvVar6 + 0x58b8) = g_vectorOne.y; } default: switchD_008457ef_caseD_123: break; case (undefined1 *)0x2d0: iVar4 = soulCharge + bloodCharge + (int)local_9c + (int)local_8c; iVar3 = 0xc; if (iVar4 < 0xc) { iVar3 = iVar4; } iVar3 = iVar3 + 1; goto LAB_00845919; } } LAB_00845b82: puVar17 = &DAT_42000000; if ((&hud->_activeItem[0]._bookImage)[slotDwordIndex] != 0) { posX = posX + 0.0; local_7c = (void *)((float)local_7c + 3.0); } shader = quad_set_rect(local_6c + 8,&local_78,&iconFrameSize,slotDwordIndex); local_1c0 = *shader; uStack_1bc = shader[1]; uStack_1b8 = shader[2]; uStack_1b4 = shader[3]; local_1b0 = shader[4]; uStack_1ac = shader[5]; uStack_1a8 = shader[6]; uStack_1a4 = shader[7]; local_1a0 = shader[8]; shader = quad_set_rect(local_6c + 8,&g_vectorZero,&iconFrameSize,unused_00); local_1e4 = *shader; uStack_1e0 = shader[1]; uStack_1dc = shader[2]; uStack_1d8 = shader[3]; local_1d4 = shader[4]; uStack_1d0 = shader[5]; uStack_1cc = shader[6]; uStack_1c8 = shader[7]; local_1c4 = shader[8]; local_5c = 0.0; fStack_58 = 0.0; fStack_54 = 0.0; fStack_50 = 0.0; local_6c._0_4_ = 0.0; fStack_60 = alpha * 0.3; local_6c._4_4_ = 0.0; local_6c._8_4_ = 0.0; local_4c = 0.0; local_48 = 0.0; local_44 = 0.0; KColor::SetFromARGB(&quadColor,0xffffffff); iconSize = scale * (float)puVar17; pVVar23 = &local_108; local_b8.x = scale + scale + posX + local_c8; local_b8.y = (float)local_7c + scale + scale + local_cc; local_108.x = iconSize; local_108.y = iconSize; pKVar24 = color_04; render_quad_set_rect(local_254,&local_b8,pVVar23,color_04); iVar3 = slotDwordIndex; pfVar9 = extraout_EAX; pfVar11 = local_198; for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) { *pfVar11 = *pfVar9; pfVar9 = pfVar9 + 1; pfVar11 = pfVar11 + 1; } shader = &hud->_activeItem[0]._bookImage + iVar3; if ((&hud->_activeItem[0]._bookImage)[iVar3] != 0) { KAGE::SmartPointer::operator_assign(auStackY_2f0 + 0x88,shader); apply_sprite_shader_params((ColorMod *)local_6c,1,pVVar23,pKVar24); quadColor._unk = 0; quadColor._red = (float)local_6c._0_4_; quadColor._green = (float)local_6c._4_4_; quadColor._blue = (float)local_6c._8_4_; quadColor._alpha = fStack_60; (**(code **)(*(int *)*shader + 0x14))(&local_1e4); local_198[0] = iconOffsetX + local_198[0]; local_198[1] = iconOffsetY + local_198[1]; local_198[2] = iconOffsetX + local_198[2]; local_198[3] = iconOffsetY + local_198[3]; local_188 = iconOffsetX + local_188; local_184 = iconOffsetY + local_184; local_180 = iconOffsetX + local_180; local_17c = iconOffsetY + local_17c; } FUN_008452f0(&local_1c0); pPVar10 = local_a8; itemId = local_c4; local_b8.y = (float)local_a8; chargeBar = (ANM2 *)local_a8; iVar3 = extraout_ECX_00; if (isOutlineGlow != '\0') { SourceQuad::SourceQuad((SourceQuad *)(local_6c + 8),&local_1c0); isOutlineGlow = '\x01'; if ((extraout_EDX == (undefined1 *)0x2ad) || (extraout_EDX == (undefined1 *)0x1a6)) { local_6c._8_4_ = (float)local_6c._8_4_ + 0.0; fStack_60 = fStack_60 + 32.0; local_5c = local_5c + 0.0; fStack_58 = fStack_58 + 32.0; fStack_54 = fStack_54 + 0.0; fStack_50 = fStack_50 + 32.0; local_4c = local_4c + 0.0; local_48 = local_48 + 32.0; } else if (extraout_EDX == (undefined1 *)0x2d0) { fVar16 = -(float)local_6c._8_4_; local_6c._8_4_ = fVar16 + (float)local_6c._8_4_; fStack_60 = fStack_60 + 0.0; local_5c = local_5c + fVar16; fStack_58 = fStack_58 + 0.0; fStack_54 = fStack_54 + fVar16; fStack_50 = fStack_50 + 0.0; local_4c = local_4c + fVar16; local_48 = local_48 + 0.0; } else if ((extraout_EDX == (undefined1 *)0x160) || (extraout_EDX == (undefined1 *)0x1da)) { local_6c._8_4_ = (float)local_6c._8_4_ + 32.0; fStack_60 = fStack_60 + 0.0; local_5c = local_5c + 32.0; fStack_58 = fStack_58 + 0.0; fStack_54 = fStack_54 + 32.0; fStack_50 = fStack_50 + 0.0; local_4c = local_4c + 32.0; local_48 = local_48 + 0.0; } else if (extraout_EDX == (undefined1 *)0x146) { isOutlineGlow = '\0'; } local_a8 = (PlayerHUD *)&DAT_bf800000; local_b8.y = (float)pPVar10; chargeBar = (ANM2 *)pPVar10; iVar3 = extraout_ECX_01; itemId = extraout_EDX; do { fVar16 = ABS((float)local_a8); local_c4 = &DAT_bf800000; local_114 = fVar16; do { puVar17 = local_c4; if (fVar16 != ABS((float)local_c4)) { tmpColor._tint[0] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[1] = 0.0; tmpColor._tint[2] = 0.0; tmpColor._tint[3] = alpha; tmpColor._offset[0] = 1.0; tmpColor._offset[1] = 1.0; tmpColor._offset[2] = 1.0; pPVar10 = local_a8; KColor::SetFromARGB(&quadColor,0xffffffff); local_124.x = iconSize; local_124.y = iconSize; pVVar23 = &local_124; local_98.x = (posX - (float)pPVar10 * scale) + local_c8; local_98.y = ((float)local_7c - (float)puVar17 * scale) + local_cc; pKVar24 = color_05; render_quad_set_rect(local_254,&local_98,pVVar23,color_05); pfVar9 = extraout_EAX_00; pfVar11 = local_198; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *pfVar11 = *pfVar9; pfVar9 = pfVar9 + 1; pfVar11 = pfVar11 + 1; } shader = &hud->_activeItem[0]._bookImage + slotDwordIndex; if ((&hud->_activeItem[0]._bookImage)[slotDwordIndex] != 0) { KAGE::SmartPointer::operator_assign(auStackY_2f0 + 0x88,shader); apply_sprite_shader_params(&tmpColor,1,pVVar23,pKVar24); quadColor._unk = 0; quadColor._red = tmpColor._tint[0]; quadColor._green = tmpColor._tint[1]; quadColor._blue = tmpColor._tint[2]; quadColor._alpha = tmpColor._tint[3]; (**(code **)(*(int *)*shader + 0x14))(&local_1e4); local_198[0] = iconOffsetX + local_198[0]; local_198[1] = iconOffsetY + local_198[1]; local_198[2] = iconOffsetX + local_198[2]; local_198[3] = iconOffsetY + local_198[3]; local_188 = iconOffsetX + local_188; local_184 = iconOffsetY + local_184; local_180 = iconOffsetX + local_180; local_17c = iconOffsetY + local_17c; puVar17 = local_c4; } iVar3 = slotDwordIndex; if (isOutlineGlow != '\0') { FUN_008452f0(local_6c + 8); iVar3 = extraout_ECX_02; puVar17 = local_c4; } fVar16 = local_114; } local_c4 = (undefined1 *)((float)puVar17 + 1.0); } while ((float)local_c4 <= 1.0); local_a8 = (PlayerHUD *)((float)local_a8 + 1.0); } while ((float)local_a8 <= 1.0); } if ((itemId == (undefined1 *)0x146) || (itemId == (undefined1 *)0x1df)) { if ((maxCharge < 1) || (local_78.x = (float)&DAT_42000000, local_8c != (float)maxCharge)) { LAB_008463cc: local_78.x = 0.0; } LAB_008463d3: shader = quad_set_rect(local_6c + 8,&local_78,&iconFrameSize,iVar3); local_1c0 = *shader; uStack_1bc = shader[1]; uStack_1b8 = shader[2]; uStack_1b4 = shader[3]; local_1b0 = shader[4]; uStack_1ac = shader[5]; uStack_1a8 = shader[6]; uStack_1a4 = shader[7]; local_1a0 = shader[8]; } else if (itemId == (undefined1 *)0x1e3) { local_78.x = (float)&DAT_42000000; if (hudPlayer->_hasGoldenBomb == 0) goto LAB_008463cc; goto LAB_008463d3; } tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = alpha; KColor::SetFromARGB(&quadColor,0xffffffff); local_98.x = iconSize; local_98.y = iconSize; local_124.x = local_c8 + posX; pVVar23 = &local_98; local_124.y = local_cc + (float)local_7c; pKVar24 = color_06; render_quad_set_rect(local_254,&local_124,pVVar23,color_06); pfVar9 = extraout_EAX_01; pfVar11 = local_198; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *pfVar11 = *pfVar9; pfVar9 = pfVar9 + 1; pfVar11 = pfVar11 + 1; } shader = &hud->_activeItem[0]._bookImage + slotDwordIndex; if ((&hud->_activeItem[0]._bookImage)[slotDwordIndex] != 0) { KAGE::SmartPointer::operator_assign(auStackY_2f0 + 0x88,shader); apply_sprite_shader_params(&tmpColor,1,pVVar23,pKVar24); quadColor._unk = 0; quadColor._red = tmpColor._tint[0]; quadColor._green = tmpColor._tint[1]; quadColor._blue = tmpColor._tint[2]; quadColor._alpha = tmpColor._tint[3]; (**(code **)(*(int *)*shader + 0x14))(&local_1e4); local_198[0] = iconOffsetX + local_198[0]; local_198[1] = iconOffsetY + local_198[1]; local_198[2] = iconOffsetX + local_198[2]; local_198[3] = iconOffsetY + local_198[3]; local_188 = iconOffsetX + local_188; local_180 = iconOffsetX + local_180; local_184 = iconOffsetY + local_184; local_17c = iconOffsetY + local_17c; } FUN_008452f0(&local_1c0); this = extraout_ECX_03; pPVar10 = (PlayerHUD *)local_b8.y; LAB_008465f5: fVar16 = local_90; if (maxCharge < 1) goto LAB_00846e5f; fVar18 = (float)maxCharge; fVar20 = (float)(int)local_8c; if (subCharge == 0) { local_90 = fVar20 / fVar18; } else { local_90 = (float)subCharge / (fVar18 * 450.0); } fVar19 = (float)(int)local_9c; fVar13 = fVar19 / fVar18; local_c8 = 1.0; if (fVar13 <= 1.0) { local_c8 = fVar13; } if (local_d8 == 0.0) { fVar13 = (float)(soulCharge + (int)local_8c) / fVar18; local_9c = 1.0; if (fVar13 <= 1.0) { local_9c = fVar13; } fVar13 = (float)(bloodCharge + (int)local_8c) / fVar18; local_8c = 1.0; if (fVar13 <= 1.0) { local_8c = fVar13; } } else if (local_d8 == 1.4013e-45) { if (soulCharge < 1) { local_9c = 0.0; } else { local_9c = 1.0; } if (bloodCharge < 1) { local_8c = 0.0; } else { local_8c = 1.0; } } else { local_8c = 0.0; local_9c = 0.0; } auVar14 = ZEXT812(0x3f800000); fVar20 = (fVar20 + partialCharge) / fVar18; if (fVar20 <= auVar14._0_4_) { auVar14._4_8_ = auVar14._4_8_; auVar14._0_4_ = fVar20; } local_d8 = auVar14._0_4_; if (local_d8 <= local_90) { auVar15 = ZEXT812(0x3f800000); fVar18 = (fVar19 + partialCharge) / fVar18; if (fVar18 <= auVar15._0_4_) { auVar15._4_8_ = auVar15._4_8_; auVar15._0_4_ = fVar18; } local_cc = auVar15._0_4_; } else { local_cc = 0.0; } local_a8 = (PlayerHUD *)0x0; if ((itemId == (undefined1 *)0x2c0) && (pvVar6 = TemporaryEffects::GetCollectibleEffect ((TemporaryEffects *)((int)hud->_player + 0x1508),0x2c0), pvVar6 != (void *)0x0)) { local_a8 = (PlayerHUD *)((float)*(int *)((int)pvVar6 + 8) / (float)itemConfig->maxCooldown); } if ((hud->_playerHudIndex < 4) || (playerHudLayout != 1)) { bVar12 = false; } else { bVar12 = true; } if (fVar16 == 1.4013e-45) { if (bVar12) { fVar16 = 38.0; } else { fVar16 = -2.0; } } else if (bVar12) { fVar16 = 0.0; } else { fVar16 = 34.0; } local_78.x = fVar16 * scale + posX; local_78.y = scale * 17.0 + (float)local_7c; local_7c = (void *)0x41b80000; if (isSmallHud != '\0') { local_78.y = local_78.y + 4.0; barOffsetY = 1.0; local_7c = (void *)0x41400000; } switch(maxCharge) { case 2: barOverlayAnim = "BarOverlay2"; break; case 3: barOverlayAnim = "BarOverlay3"; break; case 4: barOverlayAnim = "BarOverlay4"; break; case 5: barOverlayAnim = "BarOverlay5"; break; case 6: barOverlayAnim = "BarOverlay6"; break; default: barOverlayAnim = "BarOverlay1"; break; case 8: barOverlayAnim = "BarOverlay8"; break; case 0xc: barOverlayAnim = "BarOverlay12"; } fVar16 = scale * g_vectorOne.y; *(float *)&pPVar10->field_0x9c = scale * g_vectorOne.x; *(float *)&pPVar10->field_0xa0 = fVar16; bVar2 = ANM2::SetAnimation((ANM2 *)pPVar10,(byte *)"BarEmpty",1); if (((bVar2 != 0) && (*(int *)&pPVar10->field_0x34 != 0)) && (AnimationState::SetFrameFloat((AnimationState *)&pPVar10->field_0x30,0.0), (chargeBar->_animState)._animData != (void *)0x0)) { pPVar10->field_0x44 = 0; } *(float *)&pPVar10->field_0xb4 = alpha; ANM2::Render((ANM2 *)pPVar10,&local_78,&g_vectorZero,&g_vectorZero); uVar7 = (&hud->_activeItem[1]._bookItemId)[slotDwordIndex]; if ((int)uVar7 < 0) { LAB_0084692a: bVar2 = ANM2::SetAnimation((ANM2 *)pPVar10,(byte *)"BarFull",1); if (((bVar2 != 0) && (*(int *)&pPVar10->field_0x34 != 0)) && (AnimationState::SetFrameFloat((AnimationState *)&pPVar10->field_0x30,0.0), (chargeBar->_animState)._animData != (void *)0x0)) { pPVar10->field_0x44 = 0; } if (local_90 < local_9c) { tmpColor._tint[3] = alpha; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._colorize[0] = 0.6; tmpColor._colorize[1] = 0.85; tmpColor._colorize[2] = 1.2; tmpColor._colorize[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); local_98.x = 0.0; local_98.y = (1.0 - local_9c) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); Color::Color((Color *)&tmpColor); Sprite::SetColor((Sprite *)pPVar10,color); } if (local_90 < local_8c) { tmpColor._tint[3] = alpha; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._colorize[0] = 1.0; tmpColor._colorize[1] = 0.2; tmpColor._colorize[2] = 0.2; tmpColor._colorize[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); local_98.x = 0.0; local_98.y = (1.0 - local_8c) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); Color::Color((Color *)&tmpColor); Sprite::SetColor((Sprite *)pPVar10,color_00); } if (local_90 < local_d8) { tmpColor._offset[0] = 0.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[3] = alpha * 0.5; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); local_98.x = 0.0; local_98.y = (1.0 - local_d8) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); Color::Color((Color *)&tmpColor); Sprite::SetColor((Sprite *)pPVar10,color_01); } if (((itemId == (undefined1 *)0x23) && (bVar2 = Entity_Player::HasPlayerForm(hudPlayer,0xf), bVar2 != 0)) && (*(int *)((int)&hudPlayer->_activeDesc[0]._varData + slotDescOffset) == 1)) { tmpColor._tint[3] = alpha; tmpColor._tint[0] = 0.6; tmpColor._tint[1] = 0.6; tmpColor._tint[2] = 0.6; tmpColor._colorize[0] = 1.2; tmpColor._colorize[1] = 0.6; tmpColor._colorize[2] = 1.2; tmpColor._colorize[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); } local_98.x = 0.0; local_98.y = (1.0 - local_90) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); if (local_c8 < local_cc) { tmpColor._tint[0] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[3] = alpha * 0.5; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._offset[0] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); local_98.x = 0.0; local_98.y = (1.0 - local_cc) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); } if (0.0 < local_c8) { tmpColor._tint[0] = 1.0; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; tmpColor._colorize[2] = 0.0; tmpColor._colorize[3] = 0.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._tint[3] = alpha; tmpColor._offset[0] = 1.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); local_98.x = 0.0; local_98.y = (1.0 - local_c8) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); } if (0.0 < (float)local_a8) { tmpColor._tint[3] = alpha; tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; tmpColor._tint[2] = 1.0; tmpColor._colorize[0] = 1.2; tmpColor._colorize[1] = 1.2; tmpColor._colorize[2] = 1.2; tmpColor._colorize[3] = 1.0; tmpColor._offset[0] = 0.0; tmpColor._offset[1] = 0.0; tmpColor._offset[2] = 0.0; Sprite::SetColor((Sprite *)pPVar10,&tmpColor); local_98.x = 0.0; local_98.y = (1.0 - (float)local_a8) * (float)local_7c + barOffsetY; ANM2::Render((ANM2 *)pPVar10,&local_78,&local_98,&g_vectorZero); } Color::Color((Color *)&tmpColor); Sprite::SetColor((Sprite *)pPVar10,color_02); } else { uVar7 = uVar7 & 0x80000001; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffe) + 1; } if (uVar7 == 1) goto LAB_0084692a; } ANM2::SetFrame((ANM2 *)pPVar10,(std_string *)barOverlayAnim,0); *(float *)&pPVar10->field_0xb4 = alpha; ANM2::Render((ANM2 *)pPVar10,&local_78,&g_vectorZero,&g_vectorZero); this = extraout_ECX_04; LAB_00846e5f: shader_cache_find((int)this); return; } //@@ 00846ff0 PlayerHUD::RenderTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (TrinketSlot, Vector* pos, float unused, float scale, bool) as REPENTOGON: slot < 2 reads Entity_Player _trinketsID (+0x16c0) masking 0x7fff (id 75 TRINKET_ERROR tint) and 0x8000 golden shimmer shader; screen-shake offset; HUD::render_player_hud calls it per trinket slot prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall PlayerHUD::RenderTrinket (PlayerHUD *this,uint TrinketSlot,Vector *pos,float unused,float scale,byte unk) { void *pvVar1; undefined *puVar2; uint uVar3; PlayerHUD *extraout_ECX; float local_48; float local_44; float local_40; float local_3c; Color local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); pvVar1 = this->_player; if ((*(int *)((int)this->_activeItem + TrinketSlot * 0x18 + 0x70) == 0) || (*(int *)((int)this->_activeItem + TrinketSlot * 0x18 + 0x78) == 0)) goto LAB_008471a0; local_40 = pos->x + (g_game->_screenShakeOffset).x; local_3c = (g_game->_screenShakeOffset).y + pos->y; if (unk != 0) { local_40 = local_40 - scale * *(float *)((int)this->_activeItem + TrinketSlot * 0x18 + 0x80); local_3c = local_3c - scale * *(float *)((int)this->_activeItem + TrinketSlot * 0x18 + 0x84); } local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; puVar2 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar2 = g_currentShader; } local_38._tint[0] = 0.0; local_38._tint[1] = 0.0; local_38._tint[2] = 0.0; local_38._tint[3] = 0.3; local_38._offset[2] = 0.0; local_48 = scale + scale + local_40; local_44 = scale + scale + local_3c; g_currentShader = puVar2; FUN_0084bab0(&local_48,&local_38,pvVar1); Color::Color(&local_38); local_38._tint[3] = 1.0; if (TrinketSlot < 2) { if ((*(uint *)((int)pvVar1 + TrinketSlot * 4 + 0x16c0) & 0x7fff) == 0x4b) { local_38._tint[0] = 0.5176471; local_38._tint[1] = 0.10196079; local_38._tint[2] = 0.10196079; } if ((*(uint *)((int)pvVar1 + TrinketSlot * 4 + 0x16c0) & 0x8000) == 0) goto LAB_0084717a; puVar2 = &DAT_00c79208; if ((DAT_00c7920c & 1) == 0) { puVar2 = g_currentShader; } uVar3 = g_game->_frameCount & 0x800000ff; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xffffff00) + 1; } local_38._colorize[3] = (float)(int)uVar3 * 0.00390625; g_currentShader = puVar2; } else { LAB_0084717a: if (*(int *)((int)this->_activeItem + TrinketSlot * 0x18 + 0x74) != 0) { local_38._colorize[0] = 0.5976471; local_38._colorize[1] = 0.33411765; local_38._colorize[2] = 0.31058824; local_38._colorize[3] = 1.0; } } FUN_0084bab0(&local_40,&local_38,pvVar1); this = extraout_ECX; LAB_008471a0: shader_cache_find((int)this); return; } //@@ 008471c0 PlayerHUD::RenderPocketItems /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: font[0]=player font[1]=HUD; PocketItems/CardFronts/HUDSmall anims, #QUESTION_MARKS_NAME via PocketItemConfig::GetName and ItemPool::GetPillEffect, string_scramble_seeded; REPENTOGON asm RenderPocketItemPillIdentifiedCheck lives here */ void __thiscall PlayerHUD::RenderPocketItems(void) { char cVar1; byte bVar2; uint uVar3; void *pvVar4; NetplayManager netPeer; std_string *tmpString; byte *pbVar5; char *unknownName; float *extraout_EAX; undefined4 *scrambledName; void *in_ECX; int slot; ANM2 *extraout_ECX; ANM2 *extraout_ECX_00; ANM2 *pAVar6; ANM2 *extraout_ECX_01; ANM2 *pAVar7; ANM2 *extraout_ECX_02; int unused; byte *pbVar8; uint uVar9; int iVar10; PlayerHUD *playerHud; uint uVar11; Font *font; float fVar12; float fVar13; float fVar14; float fVar15; float in_XMM3_Da; float *in_stack_00000004; char *in_stack_00000008; float in_stack_0000000c; char acStackY_2b0 [128]; undefined1 *in_stack_fffffdd4; Vector *in_stack_fffffdd8; char *in_stack_fffffddc; Vector *pVVar16; Color glowColor; undefined4 local_1dc; KColor local_1d8; Vector activeItemPos; float alpha; float cardOffsetX; PlayerHUD *local_1b4; Vector pocketPos; ANM2 *local_1a8; ANM2 *cardSprite; float textOffsetY; char isSecondaryTwin; char isCustomCardSprite; ANM2 *local_198; undefined1 *local_194; Vector local_190; float posY; float posX; float scale; char isCardFrontShown; Entity_Player *local_178; ItemConfig_Item *local_174; byte local_16e; byte local_16d; void *cardGfxPath [4]; undefined4 cardGfxPathSize; uint cardGfxPathCapacity; undefined1 local_154 [24]; float local_13c; float local_138; float local_134; float local_130; float local_12c; void *tmpName [4]; uint tmpNameSize; uint tmpNameCapacity; std_string itemName; short wideName [106]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; Entity_Player *owner; ItemConfig_Item *pocketItemConfig; int twinPlayer; puStack_20 = (undefined1 *)(wideName + 0x7a); local_14 = 0xffffffff; puStack_18 = &LAB_00b02db8; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(wideName + 0x74); ExceptionList = &local_1c; local_1dc = 0; local_178 = *(Entity_Player **)in_ECX; fVar13 = *in_stack_00000004; fVar15 = in_stack_00000004[1]; alpha = in_stack_0000000c; scale = in_XMM3_Da; if (in_XMM3_Da < 0.0) { scale = -in_XMM3_Da; } iVar10 = *(int *)((int)in_ECX + 4); cardSprite = (ANM2 *)(iVar10 + 0x3bc8); fVar12 = scale * g_vectorOne.y; *(float *)(iVar10 + 0x3c64) = scale * g_vectorOne.x; *(float *)(iVar10 + 0x3c7c) = in_stack_0000000c; *(float *)(iVar10 + 0x3c68) = fVar12; fVar12 = scale * g_vectorOne.y; *(float *)((int)in_ECX + 0x2d4) = scale * g_vectorOne.x; *(float *)((int)in_ECX + 0x2d8) = fVar12; *(float *)((int)in_ECX + 0x2ec) = in_stack_0000000c; fVar12 = scale * g_vectorOne.y; *(float *)((int)in_ECX + 0x3f0) = scale * g_vectorOne.x; *(float *)((int)in_ECX + 0x3f4) = fVar12; *(float *)((int)in_ECX + 0x408) = in_stack_0000000c; fVar12 = scale * g_vectorOne.y; *(float *)((int)in_ECX + 0x50c) = scale * g_vectorOne.x; *(float *)((int)in_ECX + 0x510) = fVar12; *(float *)((int)in_ECX + 0x524) = in_stack_0000000c; fVar12 = scale * g_vectorOne.y; *(float *)((int)in_ECX + 0x628) = scale * g_vectorOne.x; *(float *)((int)in_ECX + 0x62c) = fVar12; *(float *)((int)in_ECX + 0x640) = in_stack_0000000c; iVar10 = *(int *)in_ECX; twinPlayer = *(int *)(iVar10 + 0x1e68); if ((((twinPlayer == 0) || (*(int *)(twinPlayer + 0x161c) == -1)) || (*(int *)(iVar10 + 0x161c) <= *(int *)(twinPlayer + 0x161c))) || (isSecondaryTwin = '\x01', twinPlayer == iVar10)) { isSecondaryTwin = '\0'; } textOffsetY = -8.0; local_1b4 = in_ECX; posY = fVar15; posX = fVar13; if (in_stack_00000008 == (char *)0x0) { iVar10 = 3; fVar12 = scale; do { twinPlayer = iVar10; if (iVar10 < 1) { twinPlayer = 0; } slot = 3; if (twinPlayer < 3) { slot = twinPlayer; } if (local_178->_pocketSlots[slot * 2] != 0) { twinPlayer = local_178->_pocketSlots[slot * 2 + 1]; local_198 = (ANM2 *)(-6.0 - (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * 10.0 * fVar12); if ((twinPlayer == 1) || (twinPlayer == 0)) { local_194 = (undefined1 *)(iVar10 * 0x11c); bVar2 = ANM2::SetAnimation((ANM2 *)((int)in_ECX + (int)local_194 + 0x238), (byte *)"HUDSmall",1); if ((bVar2 != 0) && ((*(int *)((int)in_ECX + (int)local_194 + 0x26c) != 0 && (AnimationState::SetFrameFloat ((AnimationState *)((int)in_ECX + (int)local_194 + 0x268),0.0), *(int *)((int)in_ECX + (int)local_194 + 0x26c) != 0)))) { *(undefined1 *)((int)in_ECX + (int)local_194 + 0x27c) = 0; } local_190.x = posX + 4.0; local_190.y = posY + (float)local_198; if (*(char *)((int)local_194 + 0x341 + (int)in_ECX) != '\0') { local_198 = (ANM2 *)((int)local_194 + 0x268 + (int)in_ECX); local_1a8 = (ANM2 *)((int)local_194 + 0x288 + (int)in_ECX); if (*(char *)((int)local_194 + 0x2a8 + (int)in_ECX) == '\0') { AnimationState::Render ((AnimationState *)local_198,&local_190,&g_vectorZero,&g_vectorZero); pAVar6 = local_1a8; } else { AnimationState::Render ((AnimationState *)local_1a8,&local_190,&g_vectorZero,&g_vectorZero); pAVar6 = local_198; } in_stack_fffffddc = (char *)0x8477f2; AnimationState::Render((AnimationState *)pAVar6,&local_190,&g_vectorZero,&g_vectorZero); } } else { if (twinPlayer != 2) goto LAB_00847812; in_stack_fffffdd8 = &pocketPos; in_stack_fffffdd4 = (undefined1 *)(local_178->_pocketSlots[slot * 2] + -1); pocketPos.y = fVar15 + (float)local_198 + fVar12 * -8.0; pocketPos.x = fVar13 + 4.0 + fVar12 * -12.0; in_stack_fffffddc = (char *)0x0; RenderActiveItem(in_ECX,(uint)in_stack_fffffdd4,in_stack_fffffdd8,0,fVar12 * 0.5,alpha,0); } fVar12 = scale; fVar13 = posX; fVar15 = posY; } LAB_00847812: iVar10 = iVar10 + -1; } while (iVar10 != 0); } else { uVar11 = 1; fVar12 = scale; puStack_20 = (undefined1 *)(wideName + 0x7a); do { uVar3 = uVar11; if ((int)uVar11 < 1) { uVar3 = 0; } uVar9 = 3; if ((int)uVar3 < 3) { uVar9 = uVar3; } if (local_178->_pocketSlots[uVar9 * 2] != 0) { local_1a8 = (ANM2 *)(fVar12 * 12.0); iVar10 = local_178->_pocketSlots[uVar9 * 2 + 1]; local_198 = (ANM2 *)((float)((double)(int)uVar11 + __uint_to_double_fixup[-((int)uVar11 >> 0x1f)]) * 8.0 * fVar12 - 2.0); if ((iVar10 == 1) || (iVar10 == 0)) { local_194 = (undefined1 *)(uVar11 * 0x11c); bVar2 = ANM2::SetAnimation((ANM2 *)((int)in_ECX + (int)local_194 + 0x238), (byte *)"HUDSmall",1); if ((bVar2 != 0) && ((*(int *)((int)in_ECX + (int)local_194 + 0x26c) != 0 && (AnimationState::SetFrameFloat ((AnimationState *)((int)in_ECX + (int)local_194 + 0x268),0.0), *(int *)((int)in_ECX + (int)local_194 + 0x26c) != 0)))) { *(undefined1 *)((int)in_ECX + (int)local_194 + 0x27c) = 0; } local_190.x = posX + (float)local_198; local_190.y = posY + (float)local_1a8; if (*(char *)((int)local_194 + 0x341 + (int)in_ECX) != '\0') { local_198 = (ANM2 *)((int)local_194 + 0x268 + (int)in_ECX); local_1a8 = (ANM2 *)((int)local_194 + 0x288 + (int)in_ECX); if (*(char *)((int)local_194 + 0x2a8 + (int)in_ECX) == '\0') { AnimationState::Render ((AnimationState *)local_198,&local_190,&g_vectorZero,&g_vectorZero); pAVar6 = local_1a8; } else { AnimationState::Render ((AnimationState *)local_1a8,&local_190,&g_vectorZero,&g_vectorZero); pAVar6 = local_198; } in_stack_fffffddc = (char *)0x8475ba; AnimationState::Render((AnimationState *)pAVar6,&local_190,&g_vectorZero,&g_vectorZero); } } else { if (iVar10 != 2) goto LAB_008475da; in_stack_fffffdd8 = &activeItemPos; in_stack_fffffdd4 = (undefined1 *)(local_178->_pocketSlots[uVar9 * 2] + -1); activeItemPos.x = fVar13 + (float)local_198 + fVar12 * -4.0; activeItemPos.y = fVar15 + (float)local_1a8 + fVar12 * -8.0; in_stack_fffffddc = in_stack_00000008; RenderActiveItem(in_ECX,(uint)in_stack_fffffdd4,in_stack_fffffdd8,(int)in_stack_00000008, fVar12 * 0.5,alpha,0); } fVar12 = scale; fVar13 = posX; fVar15 = posY; } LAB_008475da: uVar11 = uVar11 + 1; } while (uVar11 < 4); } playerHud = local_1b4; manager = g_manager; local_16d = 1; itemName._size = 0; itemName._capacity = 0xf; itemName._buf._0_4_ = (byte *)0x0; cardGfxPathSize = 0; cardGfxPathCapacity = 0xf; cardGfxPath[0] = (void *)0x0; local_14 = 1; local_194 = (undefined1 *)0xffffffff; local_1a8 = (ANM2 *)((uint)local_1a8 & 0xffffff00); iVar10 = local_178->_pocketSlots[1]; isCustomCardSprite = '\0'; isCardFrontShown = '\0'; cardOffsetX = 0.0; if (iVar10 == 1) { iVar10 = local_178->_pocketSlots[0]; if (iVar10 == 0) goto LAB_0084814e; if ((iVar10 < 0) || (pvVar4 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar4 >> 2 <= iVar10)) { local_174 = (ItemConfig_Item *)0x0; } else { local_174 = *(ItemConfig_Item **)((int)pvVar4 + iVar10 * 4); } local_198 = (ANM2 *)&(g_game->_seedEffects)._seedEffects; local_190.y = 4.2039e-44; std::set::find_node(); if ((*(char *)(local_1d8._unk + 0xd) == '\0') && (*(int *)(local_1d8._unk + 0x10) < 0x1f)) { pvVar4 = (void *)local_1d8._unk; } else { pvVar4 = *(void **)(local_198->_filename)._buf; } pAVar6 = local_198; if (pvVar4 == *(void **)(local_198->_filename)._buf) { if (iVar10 < 0x62) { bVar2 = ANM2::SetAnimation(cardSprite,(byte *)"CardFronts",1); pAVar6 = extraout_ECX; if ((bVar2 != 0) && (pAVar6 = cardSprite, (cardSprite->_animState)._animData != (void *)0x0) ) { AnimationState::SetFrameFloat(&cardSprite->_animState,(float)iVar10); pAVar6 = cardSprite; if ((cardSprite->_animState)._animData != (void *)0x0) { (cardSprite->_animState)._isPlaying = 0; } } uVar11 = 0; if (cardSprite->_layerCount != 0) { local_190.y = (float)&cardSprite->_animState; do { pvVar4 = AnimationState::GetLayerFrame((AnimationState *)local_190.y,uVar11); pAVar6 = extraout_ECX_00; if ((pvVar4 != (void *)0x0) && (*(char *)((int)pvVar4 + 0x2c) != '\0')) { isCardFrontShown = '\x01'; cardOffsetX = -3.0; break; } uVar11 = uVar11 + 1; } while (uVar11 < (uint)cardSprite->_layerCount); } } else { cardOffsetX = -3.0; isCardFrontShown = '\x01'; isCustomCardSprite = (local_174->gfxFilename)._size != 0; } } playerHud = local_1b4; if (local_174 == (ItemConfig_Item *)0x0) goto LAB_00848147; netPeer = g_manager->_netplayManager; if (netPeer != *(NetplayManager *)(g_manager + 1)) { pAVar6 = (ANM2 *)0x0; local_190.y = (float)((int)*(NetplayManager *)(g_manager + 1) - (int)netPeer >> 2); if ((ANM2 *)local_190.y != (ANM2 *)0x0) { do { in_ECX = playerHud; if (*(int *)(*(int *)netPeer + 0xc) == local_178->_controllerIndex) { cVar1 = (**(code **)(*(int *)(*(int *)netPeer + 0x370) + 0x14))(); pAVar6 = extraout_ECX_01; if (cVar1 == '\0') goto LAB_00847abc; break; } pAVar6 = (ANM2 *)((int)(pAVar6->_filename)._buf + 1); netPeer = (NetplayManager)((int)netPeer + 4); } while (pAVar6 < (uint)local_190.y); } } in_stack_fffffddc = (char *)0xd; in_stack_fffffdd8 = (Vector *)0x847ab4; bVar2 = input_is_action_pressed(0xd,local_178->_controllerIndex,(Entity *)0x0,(int)pAVar6); playerHud = in_ECX; if (bVar2 == 0) { LAB_00847abc: tmpString = PocketItemConfig::GetName(local_174,(std_string *)tmpName,0x14); in_ECX = playerHud; if (&itemName != tmpString) { if (0xf < itemName._capacity) { uVar11 = itemName._capacity + 1; pbVar8 = (byte *)itemName._buf._0_4_; if (0xfff < uVar11) { pbVar8 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); pbVar5 = (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar8)); goto joined_r0x00847bdc; } goto LAB_00847b08; } goto LAB_00847b12; } } else { tmpString = (std_string *)ItemConfig_Card::get_display_desc((ItemConfig_Card *)local_174); if (&itemName != tmpString) { if (0xf < itemName._capacity) { uVar11 = itemName._capacity + 1; pbVar8 = (byte *)itemName._buf._0_4_; if (0xfff < uVar11) { pbVar8 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); pbVar5 = (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar8)); joined_r0x00847bdc: uVar11 = itemName._capacity + 0x24; if ((byte *)0x1f < pbVar5) goto LAB_00847b85; } LAB_00847b08: operator_delete(pbVar8,uVar11); } LAB_00847b12: itemName._buf._0_4_ = *(undefined4 *)tmpString->_buf; itemName._buf._4_4_ = *(undefined4 *)(tmpString->_buf + 4); itemName._buf._8_4_ = *(undefined4 *)(tmpString->_buf + 8); itemName._buf._12_4_ = *(undefined4 *)(tmpString->_buf + 0xc); itemName._size = tmpString->_size; itemName._capacity = tmpString->_capacity; tmpString->_size = 0; tmpString->_capacity = 0xf; tmpString->_buf[0] = '\0'; } } if (0xf < tmpNameCapacity) { uVar11 = tmpNameCapacity + 1; pvVar4 = tmpName[0]; if (0xfff < uVar11) { pvVar4 = *(void **)((int)tmpName[0] + -4); uVar11 = tmpNameCapacity + 0x24; if (0x1f < (uint)((int)tmpName[0] + (-4 - (int)pvVar4))) goto LAB_00847b85; } operator_delete(pvVar4,uVar11); } pocketItemConfig = local_174; tmpName[0] = (void *)((uint)tmpName[0] & 0xffffff00); tmpNameCapacity = 0xf; tmpNameSize = 0; tmpString = &local_174->gfxFilename; if ((std_string *)cardGfxPath != tmpString) { if (0xf < (local_174->gfxFilename)._capacity) { tmpString = *(std_string **)tmpString->_buf; } std::string::assign((char *)cardGfxPath,(byte *)tmpString,(local_174->gfxFilename)._size); } if ((pocketItemConfig->addMaxhearts == 0) || (pocketItemConfig->addMaxhearts == 5)) { bVar2 = Entity_Player::HasCollectible(local_178,0x1c3,0); local_1a8 = (ANM2 *)((uint)local_1a8 & 0xff); if (bVar2 != 0) { local_1a8 = (ANM2 *)0x1; } } LAB_00848147: local_16d = 0; } else if (iVar10 == 0) { if (local_178->_pocketSlots[0] != 0) { uVar9 = local_178->_pocketSlots[0] & 0x7ff; local_190.y = (float)&g_game->_itemPool; uVar3 = -(uint)(uVar9 != 0) & uVar9; uVar11 = 0xe; if (uVar3 < 0xe) { uVar11 = uVar3; } if (((undefined1 *)((int)local_190.y + 0x7a4))[uVar11 + 0x3c] == '\0') { local_16d = 0; in_stack_fffffddc = "PocketItems"; in_stack_fffffdd8 = (Vector *)0x847e1e; StringTable::get_string (&g_manager->_stringTable,(byte *)"PocketItems",*(int *)&g_manager->_stringTable, (byte *)0xb67da9,&local_16d); if (local_16d == 0) { local_16e = 0; in_stack_fffffddc = "PocketItems"; in_stack_fffffdd8 = (Vector *)0x847e50; unknownName = (char *)StringTable::get_string (&manager->_stringTable,(byte *)"PocketItems", *(int *)&manager->_stringTable,(byte *)0xb67da9, &local_16e); } else { unknownName = "#QUESTION_MARKS_NAME"; } pbVar8 = (byte *)unknownName; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(itemName._buf,(byte *)unknownName,(int)pbVar8 - (int)(unknownName + 1)); } else { iVar10 = ItemPool::GetPillEffect((ItemPool *)local_190.y,uVar9,local_178); if (((-1 < iVar10) && (pvVar4 = (manager->_itemConfig)._pillEffects._begin, iVar10 < (int)(manager->_itemConfig)._pillEffects._end - (int)pvVar4 >> 2)) && (pvVar4 = *(void **)((int)pvVar4 + iVar10 * 4), pvVar4 != (void *)0x0)) { tmpString = PocketItemConfig::GetName(pvVar4,(std_string *)tmpName,0x14); if (&itemName != tmpString) { if (0xf < itemName._capacity) { uVar11 = itemName._capacity + 1; pbVar8 = (byte *)itemName._buf._0_4_; if (0xfff < uVar11) { pbVar8 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); uVar11 = itemName._capacity + 0x24; if ((byte *)0x1f < (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar8))) goto LAB_00847b85; } operator_delete(pbVar8,uVar11); } itemName._buf._0_4_ = *(undefined4 *)tmpString->_buf; itemName._buf._4_4_ = *(undefined4 *)(tmpString->_buf + 4); itemName._buf._8_4_ = *(undefined4 *)(tmpString->_buf + 8); itemName._buf._12_4_ = *(undefined4 *)(tmpString->_buf + 0xc); itemName._size = tmpString->_size; itemName._capacity = tmpString->_capacity; tmpString->_size = 0; tmpString->_capacity = 0xf; tmpString->_buf[0] = '\0'; } if (0xf < tmpNameCapacity) { uVar11 = tmpNameCapacity + 1; pvVar4 = tmpName[0]; if (0xfff < uVar11) { pvVar4 = *(void **)((int)tmpName[0] + -4); uVar11 = tmpNameCapacity + 0x24; if (0x1f < (uint)((int)tmpName[0] + (-4 - (int)pvVar4))) goto LAB_00847b85; } operator_delete(pvVar4,uVar11); } tmpNameSize = 0; tmpNameCapacity = 0xf; tmpName[0] = (void *)((uint)tmpName[0] & 0xffffff00); } } goto LAB_00848147; } } else if ((iVar10 == 2) && (iVar10 = local_178->_pocketSlots[0], iVar10 != 0)) { if (iVar10 - 1U < 4) { pAVar6 = *(ANM2 **)((iVar10 + 0xab) * 0x20 + *(int *)in_ECX); } else { pAVar6 = (ANM2 *)0x0; } if (g_game == (Game *)0x0) { if (-1 < (int)pAVar6) goto LAB_00847eed; } else { if ((int)pAVar6 < 0) { pAVar7 = (ANM2 *)~(uint)pAVar6; if (((int)pAVar6 < 0) && (pvVar4 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)pAVar7 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar4 >> 2)) { local_174 = (ItemConfig_Item *)**(uint **)((int)pvVar4 + (int)pAVar7 * 4); pAVar6 = pAVar7; } else { local_174 = (ItemConfig_Item *)0x0; pAVar6 = pAVar7; } } else { LAB_00847eed: pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 >> 2 <= (int)pAVar6) goto LAB_0084814e; local_174 = *(ItemConfig_Item **)((int)pvVar4 + (int)pAVar6 * 4); } if (local_174 != (ItemConfig_Item *)0x0) { netPeer = g_manager->_netplayManager; if (netPeer != *(NetplayManager *)(g_manager + 1)) { pAVar6 = (ANM2 *)0x0; local_190.y = (float)((int)*(NetplayManager *)(g_manager + 1) - (int)netPeer >> 2); if ((ANM2 *)local_190.y != (ANM2 *)0x0) { do { if (*(int *)(*(int *)netPeer + 0xc) == local_178->_controllerIndex) { cVar1 = (**(code **)(*(int *)(*(int *)netPeer + 0x370) + 0x14))(); pAVar6 = extraout_ECX_02; if (cVar1 == '\0') goto LAB_00847f9e; break; } pAVar6 = (ANM2 *)((int)(pAVar6->_filename)._buf + 1); netPeer = (NetplayManager)((int)netPeer + 4); } while (pAVar6 < (uint)local_190.y); in_ECX = playerHud; } } pocketItemConfig = local_174; in_stack_fffffddc = (char *)0xd; in_stack_fffffdd8 = (Vector *)0x847f9a; bVar2 = input_is_action_pressed(0xd,local_178->_controllerIndex,(Entity *)0x0,(int)pAVar6); playerHud = in_ECX; if (bVar2 == 0) { LAB_00847f9e: tmpString = ItemConfig_Item::GetLocalizedName(local_174,(std_string *)tmpName,0x14); local_174 = (ItemConfig_Item *)0x2; in_ECX = playerHud; } else { tmpString = ItemConfig_Item::get_localized_description (pocketItemConfig,(std_string *)(local_154 + 0x14),unused); local_14 = CONCAT31(local_14._1_3_,2); local_174 = (ItemConfig_Item *)0x1; } if (&itemName != tmpString) { if (0xf < itemName._capacity) { uVar11 = itemName._capacity + 1; pbVar8 = (byte *)itemName._buf._0_4_; if (0xfff < uVar11) { pbVar8 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); uVar11 = itemName._capacity + 0x24; if ((byte *)0x1f < (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar8))) goto LAB_00847b85; } operator_delete(pbVar8,uVar11); } itemName._buf._0_4_ = *(undefined4 *)tmpString->_buf; itemName._buf._4_4_ = *(undefined4 *)(tmpString->_buf + 4); itemName._buf._8_4_ = *(undefined4 *)(tmpString->_buf + 8); itemName._buf._12_4_ = *(undefined4 *)(tmpString->_buf + 0xc); itemName._size = tmpString->_size; itemName._capacity = tmpString->_capacity; tmpString->_size = 0; tmpString->_capacity = 0xf; tmpString->_buf[0] = '\0'; } if (((uint)local_174 & 2) != 0) { local_174 = (ItemConfig_Item *)((uint)local_174 & 0xfffffffd); if (0xf < tmpNameCapacity) { uVar11 = tmpNameCapacity + 1; pvVar4 = tmpName[0]; if (0xfff < uVar11) { pvVar4 = *(void **)((int)tmpName[0] + -4); uVar11 = tmpNameCapacity + 0x24; if (0x1f < (uint)((int)tmpName[0] + (-4 - (int)pvVar4))) goto LAB_00847b85; } operator_delete(pvVar4,uVar11); } tmpNameSize = 0; tmpNameCapacity = 0xf; tmpName[0] = (void *)((uint)tmpName[0] & 0xffffff00); } local_14 = 1; if (((uint)local_174 & 1) != 0) { if (0xf < (uint)local_12c) { uVar11 = (int)local_12c + 1; pvVar4 = (void *)local_154._20_4_; if (0xfff < uVar11) { pvVar4 = *(void **)(local_154._20_4_ + -4); uVar11 = (int)local_12c + 0x24; if (0x1f < (uint)(local_154._20_4_ + (-4 - (int)pvVar4))) goto LAB_00847b85; } operator_delete(pvVar4,uVar11); } local_130 = 0.0; local_12c = 2.10195e-44; local_154._20_4_ = local_154._20_4_ & 0xffffff00; } local_194 = (undefined1 *)(local_178->_pocketSlots[0] + -1); goto LAB_00848147; } } } LAB_0084814e: game = g_game; local_190.y = (float)&DAT_0000001d; std::set::find_node(); if ((*(char *)(local_1d8._unk + 0xd) != '\0') || (pvVar4 = (void *)local_1d8._unk, 0x1d < *(int *)(local_1d8._unk + 0x10))) { pvVar4 = (game->_seedEffects)._seedEffects; } if ((pvVar4 == (game->_seedEffects)._seedEffects) || (local_178->_pocketSlots[1] != 0)) { local_190.y = 4.2039e-44; pVVar16 = (Vector *)0x8481c9; std::set::find_node(); if ((*(char *)(local_1d8._unk + 0xd) == '\0') && (((*(int *)(local_1d8._unk + 0x10) < 0x1f && ((void *)local_1d8._unk != (game->_seedEffects)._seedEffects)) && (local_178->_pocketSlots[1] == 1)))) goto LAB_00848202; } else { LAB_00848202: manager = g_manager; local_16e = 0; in_stack_fffffddc = "PocketItems"; in_stack_fffffdd8 = (Vector *)0x848231; StringTable::get_string (&g_manager->_stringTable,(byte *)"PocketItems",*(int *)&g_manager->_stringTable, (byte *)0xb67da9,&local_16e); if (local_16e == 0) { local_16e = 0; in_stack_fffffddc = "PocketItems"; in_stack_fffffdd8 = (Vector *)0x848263; unknownName = (char *)StringTable::get_string (&manager->_stringTable,(byte *)"PocketItems", *(int *)&manager->_stringTable,(byte *)0xb67da9,&local_16e); } else { unknownName = "#QUESTION_MARKS_NAME"; } pbVar8 = (byte *)unknownName; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); pVVar16 = (Vector *)0x848287; std::string::assign(itemName._buf,(byte *)unknownName,(int)pbVar8 - (int)(unknownName + 1)); } owner = local_178; if (local_16d == 0) { local_174 = (ItemConfig_Item *)0xc1800000; if (in_stack_00000008 != (char *)0x0) { cardOffsetX = 0.0; local_174 = (ItemConfig_Item *)0x41500000; } if (local_194 == (undefined1 *)0xffffffff) { if (isCardFrontShown == '\0') { textOffsetY = -10.0; if (((PlayerHUD *)in_ECX)->field_0x341 != '\0') { bVar2 = ANM2::SetAnimation((ANM2 *)&((PlayerHUD *)in_ECX)->field_0x238,&DAT_00b6b338,1); if (((bVar2 != 0) && (*(int *)&((PlayerHUD *)in_ECX)->field_0x26c != 0)) && (AnimationState::SetFrameFloat ((AnimationState *)&((PlayerHUD *)in_ECX)->field_0x268,0.0), *(int *)&((PlayerHUD *)in_ECX)->field_0x26c != 0)) { ((PlayerHUD *)in_ECX)->field_0x27c = 0; } pVVar16 = &pocketPos; pocketPos.x = posX + cardOffsetX; pocketPos.y = posY + 0.0; in_stack_fffffddc = (char *)0x84880b; ANM2::Render((ANM2 *)&((PlayerHUD *)in_ECX)->field_0x238,pVVar16,&g_vectorZero, &g_vectorZero); } } else { if ((char)local_1a8 != '\0') { local_1b4 = (PlayerHUD *)((float)g_game->_frameCount * 0.2); fVar13 = sin((float)local_1b4 + 0.5); local_190.y = fVar13 * 0.17 + 0.17; fVar13 = sin((float)local_1b4 + 0.25); local_198 = (ANM2 *)(fVar13 * 0.1 + 0.1); fVar13 = sin((float)local_1b4 + 0.0); local_1b4 = (PlayerHUD *)(fVar13 * 0.25 + 0.25); Color::Reset(&glowColor); glowColor._tint[3] = alpha; glowColor._offset[0] = local_190.y; glowColor._offset[1] = (float)local_198; glowColor._tint[0] = 1.0; glowColor._tint[1] = 1.0; glowColor._tint[2] = 1.0; glowColor._offset[2] = (float)local_1b4; if (&cardSprite->_color != (ColorMod *)&glowColor) { (cardSprite->_color)._tint[0] = 1.0; (cardSprite->_color)._tint[1] = 1.0; (cardSprite->_color)._tint[2] = 1.0; (cardSprite->_color)._tint[3] = alpha; (cardSprite->_color)._colorize[0] = glowColor._colorize[0]; (cardSprite->_color)._colorize[1] = glowColor._colorize[1]; (cardSprite->_color)._colorize[2] = glowColor._colorize[2]; (cardSprite->_color)._colorize[3] = glowColor._colorize[3]; *(ulonglong *)(cardSprite->_color)._offset = CONCAT44(local_198,local_190.y); (cardSprite->_color)._offset[2] = (float)local_1b4; } } pocketPos.x = posX + cardOffsetX; pocketPos.y = posY + 0.0; if (isCustomCardSprite == '\0') { pAVar6 = cardSprite; LAB_00848726: pVVar16 = &pocketPos; in_stack_fffffddc = (char *)0x84872b; ANM2::Render(pAVar6,pVVar16,&g_vectorZero,&g_vectorZero); } else { iVar10 = owner->_pocketSlots[0]; if (((-1 < iVar10) && (pvVar4 = (g_manager->_itemConfig)._cards._begin, iVar10 < (int)(g_manager->_itemConfig)._cards._end - (int)pvVar4 >> 2)) && ((iVar10 = *(int *)((int)pvVar4 + iVar10 * 4), iVar10 != 0 && (*(ANM2 **)(iVar10 + 0x6c) != (ANM2 *)0x0)))) { pbVar8 = (byte *)(iVar10 + 0x38); if (0xf < *(uint *)(iVar10 + 0x4c)) { pbVar8 = *(byte **)pbVar8; } ANM2::Play(*(ANM2 **)(iVar10 + 0x6c),pbVar8,0); pAVar6 = *(ANM2 **)(iVar10 + 0x6c); goto LAB_00848726; } } Color::Color((Color *)local_154); if (&cardSprite->_color != (ColorMod *)extraout_EAX) { fVar13 = extraout_EAX[1]; fVar15 = extraout_EAX[2]; fVar12 = extraout_EAX[3]; (cardSprite->_color)._tint[0] = *extraout_EAX; (cardSprite->_color)._tint[1] = fVar13; (cardSprite->_color)._tint[2] = fVar15; (cardSprite->_color)._tint[3] = fVar12; fVar13 = extraout_EAX[5]; fVar15 = extraout_EAX[6]; fVar12 = extraout_EAX[7]; (cardSprite->_color)._colorize[0] = extraout_EAX[4]; (cardSprite->_color)._colorize[1] = fVar13; (cardSprite->_color)._colorize[2] = fVar15; (cardSprite->_color)._colorize[3] = fVar12; *(undefined8 *)(cardSprite->_color)._offset = *(undefined8 *)(extraout_EAX + 8); (cardSprite->_color)._offset[2] = extraout_EAX[10]; } textOffsetY = -10.0; } } else { in_stack_fffffdd4 = local_194; pVVar16 = (Vector *)scale; if (in_stack_00000008 == (char *)0x0) { local_174 = (ItemConfig_Item *)((float)local_174 - 4.0); pocketPos.x = (posX + cardOffsetX) - 24.0; pocketPos.y = (posY + 0.0) - 18.0; in_stack_fffffdd8 = &pocketPos; in_stack_fffffddc = (char *)0x0; RenderActiveItem(in_ECX,(uint)local_194,in_stack_fffffdd8,0,scale,alpha,0); textOffsetY = -10.0; if ((local_194 < &DAT_00000004) && (*(int *)((int)(local_194 + 0xac) * 0x20 + (int)((PlayerHUD *)in_ECX)->_player) == 0x2c6) ) { pbVar8 = (byte *)&itemName; if (0xf < itemName._capacity) { pbVar8 = (byte *)itemName._buf._0_4_; } itemName._16_8_ = (ulonglong)itemName._capacity << 0x20; activeItemPos.y = scale * -3.0 + posY; *pbVar8 = 0; activeItemPos.x = ((float)local_174 - 14.0) * scale + posX; RenderCraftingTable(in_ECX,&activeItemPos,scale); } } else { local_174 = (ItemConfig_Item *)((float)local_174 + 6.0); pocketPos.x = (posX + cardOffsetX) - 9.0; pocketPos.y = (posY + 0.0) - 8.0; in_stack_fffffdd8 = &pocketPos; in_stack_fffffddc = in_stack_00000008; RenderActiveItem(in_ECX,(uint)local_194,in_stack_fffffdd8,(int)in_stack_00000008,scale,alpha ,0); if ((local_194 < &DAT_00000004) && (*(int *)((int)(local_194 + 0xac) * 0x20 + (int)((PlayerHUD *)in_ECX)->_player) == 0x2c6) ) { pbVar8 = (byte *)&itemName; if (0xf < itemName._capacity) { pbVar8 = (byte *)itemName._buf._0_4_; } itemName._16_8_ = (ulonglong)itemName._capacity << 0x20; activeItemPos.y = scale * 27.0 + posY; *pbVar8 = 0; activeItemPos.x = ((float)local_174 + 50.0) * scale + posX; RenderCraftingTable(in_ECX,&activeItemPos,scale); } } } if (itemName._size != 0) { uVar3 = 9; uVar11 = 0x848835; bVar2 = Game::IsInTimedSet(g_game,9); if (bVar2 != 0) { std::string::string(acStackY_2b0 + 0x84,&itemName); scrambledName = string_scramble_seeded (local_154 + 0x14,in_stack_fffffdd4,(int)in_stack_fffffdd8, (int)in_stack_fffffddc,(int)pVVar16,uVar11,uVar3); if (&itemName != (std_string *)scrambledName) { if (0xf < itemName._capacity) { uVar11 = itemName._capacity + 1; pbVar8 = (byte *)itemName._buf._0_4_; if (0xfff < uVar11) { pbVar8 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); uVar11 = itemName._capacity + 0x24; if ((byte *)0x1f < (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar8))) goto LAB_00847b85; } operator_delete(pbVar8,uVar11); } itemName._buf._0_4_ = *scrambledName; itemName._buf._4_4_ = scrambledName[1]; itemName._buf._8_4_ = scrambledName[2]; itemName._buf._12_4_ = scrambledName[3]; itemName._16_8_ = *(undefined8 *)(scrambledName + 4); scrambledName[4] = 0; scrambledName[5] = 0xf; *(undefined1 *)scrambledName = 0; } std::string::_Tidy_deallocate(local_154 + 0x14); } pbVar8 = (byte *)&itemName; if ((itemName._capacity < 0x10) || (pbVar8 = (byte *)itemName._buf._0_4_, (byte *)itemName._buf._0_4_ != (byte *)0x0)) { pbVar5 = pbVar8; do { bVar2 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar2 != 0); iVar10 = (int)pbVar5 - (int)(pbVar8 + 1); } else { iVar10 = 0; } text_convert_encoding(pbVar8,iVar10,0,wideName,0x65,1); font = &g_manager->_font9_PFTempestaSevenCondensedAgain; fVar15 = posX + (float)local_174 * scale; fVar12 = posY + textOffsetY * scale; fVar13 = scale; if (in_stack_00000008 == (char *)0x0) { iVar10 = Font::get_string_width_utf16(font,wideName,-1); fVar14 = (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * fVar13; LAB_008489ef: fVar15 = fVar15 - fVar14; } else if ((in_stack_00000008 == (char *)0x1) && (isSecondaryTwin != '\0')) { iVar10 = Font::get_string_width_utf16(font,wideName,-1); fVar14 = (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * fVar13 + 12.0 ; goto LAB_008489ef; } local_154._16_4_ = 0.0; local_154._20_4_ = (void *)0xffff; local_13c = 0.0; local_138 = 1.0; local_134 = -NAN; local_130 = 0.0; local_12c = 0.0; local_14 = CONCAT31(local_14._1_3_,3); local_1d8._unk = 0; local_1d8._red = 1.0; local_1d8._green = 1.0; local_1d8._blue = 1.0; local_1d8._alpha = alpha; Font::draw_string_wide (font,wideName,fVar15 + (g_game->_screenShakeOffset).x, fVar12 + (g_game->_screenShakeOffset).y,fVar13,fVar13,&local_1d8,local_154 + 0x10); } } (cardSprite->_scale).x = g_vectorOne.x; (cardSprite->_scale).y = g_vectorOne.y; *(float *)&((PlayerHUD *)in_ECX)->field_0x2d4 = g_vectorOne.x; *(float *)&((PlayerHUD *)in_ECX)->field_0x2d8 = g_vectorOne.y; *(undefined4 *)&((PlayerHUD *)in_ECX)->field_0x2ec = 0x3f800000; *(float *)&((PlayerHUD *)in_ECX)->field_0x3f0 = g_vectorOne.x; *(float *)&((PlayerHUD *)in_ECX)->field_0x3f4 = g_vectorOne.y; *(undefined4 *)&((PlayerHUD *)in_ECX)->field_0x408 = 0x3f800000; *(float *)&((PlayerHUD *)in_ECX)->field_0x50c = g_vectorOne.x; *(float *)&((PlayerHUD *)in_ECX)->field_0x510 = g_vectorOne.y; *(undefined4 *)&((PlayerHUD *)in_ECX)->field_0x524 = 0x3f800000; *(float *)&((PlayerHUD *)in_ECX)->field_0x628 = g_vectorOne.x; *(float *)&((PlayerHUD *)in_ECX)->field_0x62c = g_vectorOne.y; *(undefined4 *)&((PlayerHUD *)in_ECX)->field_0x640 = 0x3f800000; if (0xf < cardGfxPathCapacity) { uVar11 = cardGfxPathCapacity + 1; pvVar4 = cardGfxPath[0]; if (0xfff < uVar11) { pvVar4 = *(void **)((int)cardGfxPath[0] + -4); uVar11 = cardGfxPathCapacity + 0x24; if (0x1f < (uint)((int)cardGfxPath[0] + (-4 - (int)pvVar4))) goto LAB_00847b85; } operator_delete(pvVar4,uVar11); } if (0xf < itemName._capacity) { uVar11 = itemName._capacity + 1; pbVar8 = (byte *)itemName._buf._0_4_; if (0xfff < uVar11) { pbVar8 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); uVar11 = itemName._capacity + 0x24; if ((byte *)0x1f < (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar8))) { LAB_00847b85: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar8,uVar11); } ExceptionList = local_1c; return; } //@@ 00848c20 collectible_icon_render /* DB: ? (ECX = item id, EDX, pos, color, image, imageRef): for negative (glitched) ids binds Game+0x67764 (ProceduralItemManager render target) and draws via 009e0240, otherwise draws the given image with apply_sprite_shader_params; releases the image ref; callers PlayerHUD::render_inventory and PlayerHUD::RenderCraftingTable */ void collectible_icon_render(void *param_1,ColorMod *param_2,int *param_3,int *param_4) { char cVar1; int in_ECX; SourceQuad *in_EDX; void *in_stack_ffffffbc; void *in_stack_ffffffc0; undefined1 auStack_3a [2]; float local_28; float fStack_24; float fStack_20; float fStack_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02dfd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (in_ECX < 0) { local_14 = auStack_3a + -10; KAGE::SmartPointer::operator_assign (auStack_3a + -10,&(g_game->_proceduralItemManager)._renderTarget); apply_sprite_shader_params(param_2,1,in_stack_ffffffbc,in_stack_ffffffc0); local_28 = param_2->_tint[0]; fStack_24 = param_2->_tint[1]; fStack_20 = param_2->_tint[2]; fStack_1c = param_2->_tint[3]; local_18 = 0; GlitchedCollectibleGfx::render_item (&g_game->_proceduralItemManager,in_ECX,in_EDX,param_1,&local_28); } else if (param_3 != (int *)0x0) { KAGE::SmartPointer::operator_assign(auStack_3a + -10,¶m_3); apply_sprite_shader_params(param_2,1,in_stack_ffffffbc,in_stack_ffffffc0); local_28 = param_2->_tint[0]; fStack_24 = param_2->_tint[1]; fStack_20 = param_2->_tint[2]; fStack_1c = param_2->_tint[3]; local_18 = 0; (**(code **)(*param_3 + 0x14))(); } local_8 = 1; if (param_4 != (int *)0x0) { cVar1 = (**(code **)(*param_4 + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00848d20 PlayerHUD::render_inventory /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Tainted Isaac's inventory slots (max/2 columns, 12 px, ui_inventory Dot/Select) (characters_9.md) */ void __thiscall PlayerHUD::render_inventory(void) { byte isHasBirthright; char cVar1; float *extraout_EAX; LayerState *dotLayer; void *in_ECX; int iVar2; int iVar3; int iVar4; float *pfVar5; float *pfVar6; float fVar7; float fVar8; float in_XMM2_Da; float *in_stack_00000004; undefined1 auStackY_284 [128]; int *piVar9; ANM2 *pAVar10; undefined1 outlineQuad [112]; float iconQuad [6]; float local_158; float local_154; KColor quadColor; float local_ec; float local_e8; float local_e4; float local_e0; float local_dc; float local_d8; float local_d4; float local_d0; undefined1 local_cc; Vector outlinePos; Vector outlineSize; Vector iconPos; Vector iconQuadSize; uint local_a8; int itemCount; uint slotCount; void *playerHud; Vector selectPos; Vector dotPos; int *local_88; float scale; int local_80; undefined4 local_7c; float iconSize; float slotY; float slotX; int *local_6c; float local_68; undefined4 iconColor; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 shadowColor; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); iVar4 = (*(int *)((int)in_ECX + 0x6a4) - *(int *)((int)in_ECX + 0x6a0)) / 0xc; itemCount = iVar4; playerHud = in_ECX; scale = in_XMM2_Da; isHasBirthright = Entity_Player::HasCollectible(*(Entity_Player **)in_ECX,0x26b,0); iVar2 = *(int *)((int)in_ECX + 4); fVar7 = scale * g_vectorOne.x; slotCount = (uint)(isHasBirthright != 0) * 4 + 8; iconSize = scale * 32.0; local_a8 = slotCount >> 1; *(float *)(iVar2 + 0x5690) = scale * g_vectorOne.y; *(float *)(iVar2 + 0x568c) = fVar7; local_68 = 0.0; do { fVar7 = local_68; slotX = (float)((int)local_68 % (int)local_a8) * 12.0 * scale + *in_stack_00000004; slotY = (float)((int)local_68 / (int)local_a8) * 12.0 * scale + in_stack_00000004[1]; if (((int)local_68 < iVar4) && ((local_80 = *(int *)((int)in_ECX + 0x6a0), *(int *)(local_80 + 4 + (int)local_68 * 0xc) != 0 || (*(int *)(local_80 + (int)local_68 * 0xc) < 0)))) { if ((DAT_00c7911c & 1) != 0) { g_currentShader = &g_shaders; local_80 = *(int *)((int)in_ECX + 0x6a0); } iVar2 = local_80; local_dc = g_vectorZero.x; local_ec = g_vectorZero.x; local_e4 = g_vectorZero.x + 32.0; local_e0 = g_vectorZero.y; local_e8 = g_vectorZero.y; local_d8 = g_vectorZero.y + 32.0; local_cc = 1; local_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; local_18 = 0; shadowColor = 0; uStack_34 = 0; uStack_30 = 0; uStack_2c = 0x3e99999a; local_14 = 0; quadColor._red = 1.0; quadColor._green = 1.0; quadColor._blue = 1.0; quadColor._alpha = 1.0; local_10 = 0; iconQuadSize.x = iconSize * 0.5; quadColor._unk = 0; iconPos.x = slotX + (g_game->_screenShakeOffset).x + scale; iconPos.y = slotY + (g_game->_screenShakeOffset).y + scale; local_d4 = local_e4; local_d0 = local_d8; iconQuadSize.y = iconQuadSize.x; local_6c = (int *)iconQuadSize.x; render_quad_set_rect(iconQuad,&iconPos,&iconQuadSize,&quadColor); local_7c = *(undefined4 *)(*(int *)((int)in_ECX + 0x6a0) + (int)fVar7 * 0xc); piVar9 = (int *)0x0; local_88 = *(int **)(iVar2 + 8 + (int)fVar7 * 0xc); if ((((local_88 != (int *)0x0) && (cVar1 = (**(code **)(*local_88 + 4))(), cVar1 != '\0')) && (piVar9 != (int *)0x0)) && ((cVar1 = (**(code **)(*piVar9 + 0xc))(), cVar1 != '\0' && (g_imageReleaseFn != (void *)0x0)))) { (*g_imageReleaseFn)(auStackY_284 + 0x8c); } collectible_icon_render(iconQuad,&shadowColor); iconColor = 0x3f800000; uStack_60 = 0x3f800000; uStack_5c = 0x3f800000; uStack_58 = 0x3f800000; local_44 = 0; local_40 = 0; local_54 = 0; uStack_50 = 0; uStack_4c = 0; uStack_48 = 0; local_3c = 0; quadColor._red = 1.0; quadColor._green = 1.0; quadColor._blue = 1.0; quadColor._alpha = 1.0; quadColor._unk = 0; outlineSize.x = (float)local_6c; outlineSize.y = (float)local_6c; outlinePos.x = slotX + (g_game->_screenShakeOffset).x; outlinePos.y = slotY + (g_game->_screenShakeOffset).y; render_quad_set_rect(outlineQuad,&outlinePos,&outlineSize,&quadColor); pfVar5 = extraout_EAX; pfVar6 = iconQuad; for (iVar2 = 0x1c; in_ECX = playerHud, iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar6 = *pfVar5; pfVar5 = pfVar5 + 1; pfVar6 = pfVar6 + 1; } local_7c = *(undefined4 *)(*(int *)((int)playerHud + 0x6a0) + (int)fVar7 * 0xc); piVar9 = (int *)0x0; local_6c = *(int **)(local_80 + 8 + (int)fVar7 * 0xc); if (((local_6c != (int *)0x0) && (cVar1 = (**(code **)(*local_6c + 4))(), cVar1 != '\0')) && ((piVar9 != (int *)0x0 && ((cVar1 = (**(code **)(*piVar9 + 0xc))(), cVar1 != '\0' && (g_imageReleaseFn != (void *)0x0)))))) { (*g_imageReleaseFn)(auStackY_284 + 0x8c); } collectible_icon_render(iconQuad,&iconColor); fVar7 = *(float *)((int)in_ECX + 0x6bc); if (iconQuad[0] <= *(float *)((int)in_ECX + 0x6bc)) { fVar7 = iconQuad[0]; } fVar8 = *(float *)((int)in_ECX + 0x6c0); if (iconQuad[1] <= *(float *)((int)in_ECX + 0x6c0)) { fVar8 = iconQuad[1]; } *(float *)((int)in_ECX + 0x6bc) = fVar7; *(float *)((int)in_ECX + 0x6c0) = fVar8; fVar7 = *(float *)((int)in_ECX + 0x6c4); if (*(float *)((int)in_ECX + 0x6c4) <= iconQuad[0]) { fVar7 = iconQuad[0]; } fVar8 = *(float *)((int)in_ECX + 0x6c8); if (*(float *)((int)in_ECX + 0x6c8) <= iconQuad[1]) { fVar8 = iconQuad[1]; } *(float *)((int)in_ECX + 0x6c4) = fVar7; *(float *)((int)in_ECX + 0x6c8) = fVar8; fVar7 = *(float *)((int)in_ECX + 0x6bc); if (local_158 <= *(float *)((int)in_ECX + 0x6bc)) { fVar7 = local_158; } fVar8 = *(float *)((int)in_ECX + 0x6c0); if (local_154 <= *(float *)((int)in_ECX + 0x6c0)) { fVar8 = local_154; } *(float *)((int)in_ECX + 0x6bc) = fVar7; *(float *)((int)in_ECX + 0x6c0) = fVar8; fVar7 = *(float *)((int)in_ECX + 0x6c4); if (*(float *)((int)in_ECX + 0x6c4) <= local_158) { fVar7 = local_158; } fVar8 = *(float *)((int)in_ECX + 0x6c8); if (*(float *)((int)in_ECX + 0x6c8) <= local_154) { fVar8 = local_154; } *(float *)((int)in_ECX + 0x6c4) = fVar7; *(float *)((int)in_ECX + 0x6c8) = fVar8; fVar7 = local_68; fVar8 = iconSize * 0.25; } else { dotLayer = ANM2::GetLayer((ANM2 *)(*(int *)((int)in_ECX + 4) + 22000),(byte *)0x0); local_68 = iconSize * 0.25; (dotLayer->_color)._tint[3] = 0.5; iVar2 = *(int *)((int)in_ECX + 4); dotPos.x = local_68 + slotX; dotPos.y = local_68 + slotY; fVar8 = local_68; if (*(char *)(iVar2 + 0x56f9) != '\0') { if (*(char *)(iVar2 + 0x5660) == '\0') { iVar4 = *(int *)(iVar2 + 0x5624); if (((iVar4 != 0) && (0 < (*(ANM2 **)(iVar2 + 0x5620))->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x38), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar4 + 0x18)),&dotPos, *(int *)(*(int *)(iVar2 + 0x5628) + iVar3 * 4),&g_vectorZero,&g_vectorZero, *(ANM2 **)(iVar2 + 0x5620)); } iVar4 = *(int *)(iVar2 + 0x5644); fVar8 = local_68; if (((iVar4 != 0) && (pAVar10 = *(ANM2 **)(iVar2 + 0x5640), 0 < pAVar10->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x38), -1 < iVar3)) { iVar2 = *(int *)(iVar2 + 0x5648); goto LAB_00849353; } } else { iVar4 = *(int *)(iVar2 + 0x5644); if (((iVar4 != 0) && (0 < (*(ANM2 **)(iVar2 + 0x5640))->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x38), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar4 + 0x18)),&dotPos, *(int *)(*(int *)(iVar2 + 0x5648) + iVar3 * 4),&g_vectorZero,&g_vectorZero, *(ANM2 **)(iVar2 + 0x5640)); } iVar4 = *(int *)(iVar2 + 0x5624); if (((iVar4 != 0) && (pAVar10 = *(ANM2 **)(iVar2 + 0x5620), 0 < pAVar10->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x38), -1 < iVar3)) { iVar2 = *(int *)(iVar2 + 0x5628); LAB_00849353: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar4 + 0x18)),&dotPos, *(int *)(iVar2 + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar10); } fVar8 = local_68; } } } if (fVar7 == 0.0) { iVar2 = *(int *)((int)in_ECX + 4); selectPos.x = fVar8 + slotX; selectPos.y = slotY + fVar8; if (*(char *)(iVar2 + 0x56f9) != '\0') { if (*(char *)(iVar2 + 0x5660) == '\0') { iVar4 = *(int *)(iVar2 + 0x5624); if (((iVar4 != 0) && (1 < (*(ANM2 **)(iVar2 + 0x5620))->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x3c), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar4 + 0x18)),&selectPos, *(int *)(*(int *)(iVar2 + 0x5628) + iVar3 * 4),&g_vectorZero,&g_vectorZero, *(ANM2 **)(iVar2 + 0x5620)); } iVar4 = *(int *)(iVar2 + 0x5644); if (((iVar4 != 0) && (pAVar10 = *(ANM2 **)(iVar2 + 0x5640), 1 < pAVar10->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x3c), -1 < iVar3)) { iVar2 = *(int *)(iVar2 + 0x5648); goto LAB_0084949f; } } else { iVar4 = *(int *)(iVar2 + 0x5644); if (((iVar4 != 0) && (1 < (*(ANM2 **)(iVar2 + 0x5640))->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x3c), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar4 + 0x18)),&selectPos, *(int *)(*(int *)(iVar2 + 0x5648) + iVar3 * 4),&g_vectorZero,&g_vectorZero, *(ANM2 **)(iVar2 + 0x5640)); } iVar4 = *(int *)(iVar2 + 0x5624); if (((iVar4 != 0) && (pAVar10 = *(ANM2 **)(iVar2 + 0x5620), 1 < pAVar10->_layerCount)) && (iVar3 = *(int *)(iVar4 + 0x3c), -1 < iVar3)) { iVar2 = *(int *)(iVar2 + 0x5628); LAB_0084949f: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar4 + 0x18)),&selectPos, *(int *)(iVar2 + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar10); } } } } local_68 = (float)((int)fVar7 + 1); iVar4 = itemCount; if ((int)slotCount <= (int)local_68) { shader_cache_find(local_a8); return; } } while( true ); } //@@ 00849510 PlayerHUD::RenderCraftingTable /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON PlayerHUD::RenderCraftingTable(Vector* pos, float scale): "Result" anim, Game._challenge==43 Cantripped shows min(GetCollectibleNum(251 Starter Deck)+3,20) slots; called once from RenderPocketItems prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PlayerHUD::RenderCraftingTable(PlayerHUD *this,Vector *pos,float scale) { float fVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; byte bVar5; int iVar6; float *extraout_EAX; undefined *shader; float *extraout_EAX_00; float *extraout_EAX_01; ColorMod *color; undefined4 *extraout_EAX_02; undefined1 *extraout_ECX; KColor *color_00; KColor *color_01; undefined1 *extraout_ECX_00; undefined1 *extraout_ECX_01; undefined1 *extraout_ECX_02; KColor *color_02; KColor *color_03; undefined1 *extraout_ECX_03; undefined1 *extraout_ECX_04; undefined1 *extraout_ECX_05; AnimationState *secondAnimState; undefined1 *extraout_ECX_06; int unused; KColor *color_04; KColor *color_05; undefined1 *unusedArg; ANM2 *pAVar7; void *pvVar8; PlayerHUD *pPVar9; float *quadSrc; float *quadDst; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; undefined1 *puVar15; undefined1 auStackY_2f8 [128]; Vector *pVVar16; KColor *imageRefCount; undefined1 local_254 [112]; undefined4 local_1e4 [8]; undefined4 local_1c4; undefined4 uStack_1c0; undefined4 local_1bc; undefined4 local_1b8 [8]; undefined4 local_198; undefined4 uStack_194; undefined4 local_190; undefined4 local_18c [8]; undefined4 local_16c; undefined4 uStack_168; undefined4 local_164; float quad [6]; float local_148; float local_144; Vector iconSize; Vector shadowPos; Vector shadowSize; float local_d4; float local_d0; float local_cc; float local_c8; float local_c4; float local_c0; float local_bc; float local_b8; undefined1 local_b4; KColor quadColor; float local_9c; float local_98; PlayerHUD *local_94; undefined1 *hud; Vector renderPos; Vector bagSlotPos; ANM2 *local_7c; Vector local_78; PlayerHUD *local_70; float local_6c; Vector *savedPos; ColorMod shadowColor; Color local_38; uint local_c; undefined1 auStack_8 [4]; int *craftSlots; Game *game; ColorMod *spriteColor; local_c = __security_cookie ^ (uint)(auStack_8 + 4); savedPos = pos; puVar15 = this->_HUD; fVar10 = scale * g_vectorOne.y; *(float *)(puVar15 + 0x57a0) = scale * g_vectorOne.x; game = g_game; pAVar7 = (ANM2 *)(puVar15 + 0x5704); *(float *)(puVar15 + 0x57a4) = fVar10; local_94 = this; hud = puVar15; local_7c = pAVar7; local_6c = scale; if (game->_challenge == 0x2b) { iVar6 = Entity_Player::GetCollectibleNum(this->_player,0xfb,0); unusedArg = extraout_ECX; pPVar9 = (PlayerHUD *)&DAT_00000014; if (iVar6 + 3 < 0x14) { pPVar9 = (PlayerHUD *)(iVar6 + 3); } LAB_0084959e: pPVar9 = (PlayerHUD *)((int)pPVar9 + -1); local_70 = pPVar9; if (-1 < (int)pPVar9) { puVar15 = &DAT_42000000; if (pPVar9 == (PlayerHUD *)0x0) { craftSlots = *(int **)&this->field_0x6a0; if (((*(int *)&this->field_0x6a4 - (int)craftSlots) / 0xc < 1) || ((local_7c = (ANM2 *)(craftSlots + 1), craftSlots[1] == 0 && (-1 < *craftSlots)))) { bVar5 = ANM2::SetAnimation(pAVar7,(byte *)"Result",1); unusedArg = extraout_ECX_04; if ((bVar5 != 0) && ((pAVar7->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&pAVar7->_animState,1.0); unusedArg = extraout_ECX_05; if (*(int *)(hud + 0x5738) != 0) { (pAVar7->_animState)._isPlaying = 0; } } pVVar16 = savedPos; spriteColor = &pAVar7->_color; local_16c = 0; uStack_168 = 0; local_164 = 0; if (spriteColor != (ColorMod *)local_18c) { (pAVar7->_color)._colorize[0] = 0.0; (pAVar7->_color)._colorize[1] = 0.0; (pAVar7->_color)._colorize[2] = 0.0; (pAVar7->_color)._colorize[3] = 0.0; (pAVar7->_color)._offset[0] = 0.0; (pAVar7->_color)._offset[1] = 0.0; spriteColor->_tint[0] = 1.0; (pAVar7->_color)._tint[1] = 1.0; (pAVar7->_color)._tint[2] = 1.0; (pAVar7->_color)._tint[3] = 0.5; (pAVar7->_color)._offset[2] = 0.0; } if (pAVar7->_loaded != 0) { if (pAVar7->_overlayRenderFirst == 0) { AnimationState::Render(&pAVar7->_animState,savedPos,&g_vectorZero,&g_vectorZero); secondAnimState = &pAVar7->_overlayAnimState; } else { AnimationState::Render (&pAVar7->_overlayAnimState,savedPos,&g_vectorZero,&g_vectorZero); secondAnimState = &pAVar7->_animState; } AnimationState::Render(secondAnimState,pVVar16,&g_vectorZero,&g_vectorZero); unusedArg = extraout_ECX_06; } local_198 = 0; uStack_194 = 0; local_190 = 0; if (spriteColor != (ColorMod *)local_1b8) { spriteColor->_tint[0] = 1.0; (pAVar7->_color)._tint[1] = 1.0; (pAVar7->_color)._tint[2] = 1.0; (pAVar7->_color)._tint[3] = 1.0; (pAVar7->_color)._offset[0] = 0.0; (pAVar7->_color)._offset[1] = 0.0; (pAVar7->_color)._colorize[0] = 0.0; (pAVar7->_color)._colorize[1] = 0.0; (pAVar7->_color)._colorize[2] = 0.0; (pAVar7->_color)._colorize[3] = 0.0; (pAVar7->_color)._offset[2] = 0.0; } } else { bVar5 = ANM2::SetAnimation(pAVar7,(byte *)"Result",1); if ((bVar5 != 0) && ((pAVar7->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&pAVar7->_animState,1.0); if ((pAVar7->_animState)._animData != (void *)0x0) { (pAVar7->_animState)._isPlaying = 0; } } pVVar16 = savedPos; if (pAVar7->_loaded != 0) { if (pAVar7->_overlayRenderFirst == 0) { AnimationState::Render(&pAVar7->_animState,savedPos,&g_vectorZero,&g_vectorZero); secondAnimState = &pAVar7->_overlayAnimState; } else { AnimationState::Render (&pAVar7->_overlayAnimState,savedPos,&g_vectorZero,&g_vectorZero); secondAnimState = &pAVar7->_animState; } AnimationState::Render(secondAnimState,pVVar16,&g_vectorZero,&g_vectorZero); } puVar15 = &DAT_42000000; local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; renderPos.x = (pVVar16->x + (g_game->_screenShakeOffset).x) - 16.0; local_38._offset[2] = 0.0; local_c8 = g_vectorZero.y; shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_d0 = g_vectorZero.y; local_c0 = g_vectorZero.y + 32.0; renderPos.y = (pVVar16->y + (g_game->_screenShakeOffset).y) - 16.0; local_b4 = 1; local_c4 = g_vectorZero.x; local_d4 = g_vectorZero.x; local_cc = g_vectorZero.x + 32.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; local_38._tint[0] = 0.0; local_38._tint[1] = 0.0; local_38._tint[2] = 0.0; local_38._tint[3] = 0.3; g_currentShader = shader; local_bc = local_cc; local_b8 = local_c0; KColor::SetFromARGB(&quadColor,0xffffffff); local_78.x = local_6c * (float)puVar15; local_78.y = local_78.x; local_6c = local_78.x; render_quad_set_rect(quad,&renderPos,&local_78,color_02); pAVar7 = local_7c; KAGE::SmartPointer::operator_assign(auStackY_2f8 + 0x90,local_7c); collectible_icon_render(); local_38._offset[0] = 0.0; local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; KColor::SetFromARGB(&quadColor,0xffffffff); local_78.x = local_6c; local_78.y = local_6c; render_quad_set_rect(local_254,&renderPos,&local_78,color_03); quadSrc = extraout_EAX_00; quadDst = quad; for (iVar6 = 0x1c; pPVar9 = local_94, iVar6 != 0; iVar6 = iVar6 + -1) { *quadDst = *quadSrc; quadSrc = quadSrc + 1; quadDst = quadDst + 1; } KAGE::SmartPointer::operator_assign(auStackY_2f8 + 0x90,pAVar7); collectible_icon_render(); fVar10 = *(float *)&pPVar9[1]._redHeartFlashCountdown; if (quad[0] <= *(float *)&pPVar9[1]._redHeartFlashCountdown) { fVar10 = quad[0]; } fVar11 = *(float *)&pPVar9[1].field_0x10; if (quad[1] <= *(float *)&pPVar9[1].field_0x10) { fVar11 = quad[1]; } *(float *)&pPVar9[1]._redHeartFlashCountdown = fVar10; *(float *)&pPVar9[1].field_0x10 = fVar11; fVar10 = *(float *)&pPVar9[1].field_0x14; if (*(float *)&pPVar9[1].field_0x14 <= quad[0]) { fVar10 = quad[0]; } fVar11 = *(float *)&pPVar9[1].field_0x18; if (*(float *)&pPVar9[1].field_0x18 <= quad[1]) { fVar11 = quad[1]; } *(float *)&pPVar9[1].field_0x14 = fVar10; *(float *)&pPVar9[1].field_0x18 = fVar11; fVar10 = *(float *)&pPVar9[1]._redHeartFlashCountdown; if (local_148 <= *(float *)&pPVar9[1]._redHeartFlashCountdown) { fVar10 = local_148; } fVar11 = *(float *)&pPVar9[1].field_0x10; if (local_144 <= *(float *)&pPVar9[1].field_0x10) { fVar11 = local_144; } *(float *)&pPVar9[1]._redHeartFlashCountdown = fVar10; *(float *)&pPVar9[1].field_0x10 = fVar11; fVar10 = *(float *)&pPVar9[1].field_0x14; if (*(float *)&pPVar9[1].field_0x14 <= local_148) { fVar10 = local_148; } fVar11 = *(float *)&pPVar9[1].field_0x18; if (*(float *)&pPVar9[1].field_0x18 <= local_144) { fVar11 = local_144; } *(float *)&pPVar9[1].field_0x14 = fVar10; *(float *)&pPVar9[1].field_0x18 = fVar11; unusedArg = extraout_ECX_03; } goto LAB_0084a3b9; } if ((int)pPVar9 < (*(int *)&this->field_0x6a4 - *(int *)&this->field_0x6a0) / 0xc) { iVar6 = *(int *)&this->field_0x6a0; local_98 = (float)((int)pPVar9 * 0xc); if ((*(int *)(iVar6 + 4 + (int)local_98) != 0) || (*(int *)(iVar6 + (int)local_98) < 0)) { if ((DAT_00c7911c & 1) != 0) { g_currentShader = &g_shaders; iVar6 = *(int *)&this->field_0x6a0; } pvVar8 = (void *)(iVar6 + 4 + (int)local_98); local_c4 = g_vectorZero.x; local_d4 = g_vectorZero.x; local_cc = g_vectorZero.x + 32.0; local_c8 = g_vectorZero.y; local_d0 = g_vectorZero.y; local_c0 = g_vectorZero.y + 32.0; local_b4 = 1; shadowColor._offset[0] = 0.0; shadowColor._offset[1] = 0.0; shadowColor._offset[2] = 0.0; fVar13 = (-26.0 - (float)((int)local_98 + -0xc)) * local_6c + (g_game->_screenShakeOffset).x + savedPos->x; fVar11 = savedPos->y + (g_game->_screenShakeOffset).y + local_6c * -6.0; shadowColor._colorize[0] = 0.0; shadowColor._colorize[1] = 0.0; shadowColor._colorize[2] = 0.0; shadowColor._colorize[3] = 0.0; shadowColor._tint[0] = 0.0; shadowColor._tint[1] = 0.0; shadowColor._tint[2] = 0.0; shadowColor._tint[3] = 0.3; fVar10 = local_6c; local_bc = local_cc; local_b8 = local_c0; local_78.x = fVar13; local_78.y = fVar11; KColor::SetFromARGB(&quadColor,0xffffffff); shadowPos.x = fVar13 + fVar10; shadowPos.y = fVar11 + fVar10; shadowSize.x = fVar10 * (float)puVar15 * 0.5; shadowSize.y = shadowSize.x; local_9c = shadowSize.x; render_quad_set_rect(quad,&shadowPos,&shadowSize,color_00); KAGE::SmartPointer::operator_assign(auStackY_2f8 + 0x90,pvVar8); collectible_icon_render(); local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; KColor::SetFromARGB(&quadColor,0xffffffff); iconSize.x = local_9c; iconSize.y = local_9c; render_quad_set_rect(local_254,&local_78,&iconSize,color_01); quadSrc = extraout_EAX; quadDst = quad; for (iVar6 = 0x1c; this = local_94, iVar6 != 0; iVar6 = iVar6 + -1) { *quadDst = *quadSrc; quadSrc = quadSrc + 1; quadDst = quadDst + 1; } KAGE::SmartPointer::operator_assign(auStackY_2f8 + 0x90,pvVar8); collectible_icon_render(); fVar10 = *(float *)&this[1]._redHeartFlashCountdown; if (quad[0] <= *(float *)&this[1]._redHeartFlashCountdown) { fVar10 = quad[0]; } fVar11 = *(float *)&this[1].field_0x10; if (quad[1] <= *(float *)&this[1].field_0x10) { fVar11 = quad[1]; } *(float *)&this[1]._redHeartFlashCountdown = fVar10; *(float *)&this[1].field_0x10 = fVar11; fVar10 = *(float *)&this[1].field_0x14; if (*(float *)&this[1].field_0x14 <= quad[0]) { fVar10 = quad[0]; } fVar11 = *(float *)&this[1].field_0x18; if (*(float *)&this[1].field_0x18 <= quad[1]) { fVar11 = quad[1]; } *(float *)&this[1].field_0x14 = fVar10; *(float *)&this[1].field_0x18 = fVar11; fVar10 = *(float *)&this[1]._redHeartFlashCountdown; if (local_148 <= *(float *)&this[1]._redHeartFlashCountdown) { fVar10 = local_148; } fVar11 = *(float *)&this[1].field_0x10; if (local_144 <= *(float *)&this[1].field_0x10) { fVar11 = local_144; } *(float *)&this[1]._redHeartFlashCountdown = fVar10; *(float *)&this[1].field_0x10 = fVar11; fVar10 = *(float *)&this[1].field_0x14; if (*(float *)&this[1].field_0x14 <= local_148) { fVar10 = local_148; } fVar11 = *(float *)&this[1].field_0x18; if (*(float *)&this[1].field_0x18 <= local_144) { fVar11 = local_144; } *(float *)&this[1].field_0x14 = fVar10; *(float *)&this[1].field_0x18 = fVar11; unusedArg = extraout_ECX_00; pAVar7 = local_7c; pPVar9 = local_70; goto LAB_0084959e; } } renderPos.y = local_6c + local_6c + savedPos->y; renderPos.x = ((-26.0 - (float)((int)pPVar9 * 0xc + -0xc)) + 8.0) * local_6c + savedPos->x; bVar5 = ANM2::SetAnimation(pAVar7,s_Idle,1); unusedArg = extraout_ECX_01; if ((bVar5 != 0) && (unusedArg = extraout_ECX_01, (pAVar7->_animState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&pAVar7->_animState,0.0); unusedArg = hud; if (*(int *)(hud + 0x5738) != 0) { (pAVar7->_animState)._isPlaying = 0; } } if (pAVar7->_loaded != 0) { if (pAVar7->_overlayRenderFirst == 0) { AnimationState::Render(&pAVar7->_animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &pAVar7->_overlayAnimState; } else { AnimationState::Render(&pAVar7->_overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &pAVar7->_animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); unusedArg = extraout_ECX_02; } goto LAB_0084959e; } } else { local_70 = this + 1; if (this[1]._player == (void *)0x0) { bVar5 = ANM2::SetAnimation(pAVar7,(byte *)"Result",1); if ((bVar5 != 0) && (*(int *)(puVar15 + 0x5738) != 0)) { AnimationState::SetFrameFloat((AnimationState *)(puVar15 + 0x5734),0.0); if (*(int *)(hud + 0x5738) != 0) { puVar15[0x5748] = 0; } } local_1c4 = 0; uStack_1c0 = 0; local_1bc = 0; if ((undefined4 *)(puVar15 + 0x57ac) != local_1e4) { *(undefined4 *)(puVar15 + 0x57bc) = 0; *(undefined4 *)(puVar15 + 0x57c0) = 0; *(undefined4 *)(puVar15 + 0x57c4) = 0; *(undefined4 *)(puVar15 + 0x57c8) = 0; *(undefined8 *)(puVar15 + 0x57cc) = 0; *(undefined4 *)(puVar15 + 0x57ac) = 0x3f800000; *(undefined4 *)(puVar15 + 0x57b0) = 0x3f800000; *(undefined4 *)(puVar15 + 0x57b4) = 0x3f800000; *(undefined4 *)(puVar15 + 0x57b8) = 0x3f000000; *(undefined4 *)(puVar15 + 0x57d4) = 0; } ANM2::Render(pAVar7,pos,&g_vectorZero,&g_vectorZero); Color::Color(&local_38); if ((undefined4 *)(puVar15 + 0x57ac) != extraout_EAX_02) { uVar2 = extraout_EAX_02[1]; uVar3 = extraout_EAX_02[2]; uVar4 = extraout_EAX_02[3]; *(undefined4 *)(puVar15 + 0x57ac) = *extraout_EAX_02; *(undefined4 *)(puVar15 + 0x57b0) = uVar2; *(undefined4 *)(puVar15 + 0x57b4) = uVar3; *(undefined4 *)(puVar15 + 0x57b8) = uVar4; uVar2 = extraout_EAX_02[5]; uVar3 = extraout_EAX_02[6]; uVar4 = extraout_EAX_02[7]; *(undefined4 *)(puVar15 + 0x57bc) = extraout_EAX_02[4]; *(undefined4 *)(puVar15 + 0x57c0) = uVar2; *(undefined4 *)(puVar15 + 0x57c4) = uVar3; *(undefined4 *)(puVar15 + 0x57c8) = uVar4; *(undefined8 *)(puVar15 + 0x57cc) = *(undefined8 *)(extraout_EAX_02 + 8); *(undefined4 *)(puVar15 + 0x57d4) = extraout_EAX_02[10]; } } else { bVar5 = ANM2::SetAnimation(pAVar7,(byte *)"Result",1); if ((bVar5 != 0) && (*(int *)(puVar15 + 0x5738) != 0)) { AnimationState::SetFrameFloat((AnimationState *)(puVar15 + 0x5734),0.0); if (*(int *)(hud + 0x5738) != 0) { puVar15[0x5748] = 0; } } ANM2::Render(pAVar7,pos,&g_vectorZero,&g_vectorZero); local_78.x = (float)&DAT_42000000; local_78.y = (float)&DAT_42000000; renderPos.x = (pos->x + (g_game->_screenShakeOffset).x) - local_6c * 16.0; shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } renderPos.y = (pos->y + (g_game->_screenShakeOffset).y) - local_6c * 16.0; g_currentShader = shader; quad_set_rect(&local_d4,&g_vectorZero,&local_78,unused); shadowColor._offset[0] = 0.0; shadowColor._colorize[0] = 0.0; shadowColor._colorize[1] = 0.0; shadowColor._colorize[2] = 0.0; shadowColor._colorize[3] = 0.0; shadowColor._offset[1] = 0.0; shadowColor._tint[0] = 0.0; shadowColor._tint[1] = 0.0; shadowColor._tint[2] = 0.0; shadowColor._tint[3] = 0.3; shadowColor._offset[2] = 0.0; KColor::SetFromARGB(&quadColor,0xffffffff); local_7c = (ANM2 *)(local_6c * 32.0); pVVar16 = &local_78; imageRefCount = color_04; local_78.x = (float)local_7c; local_78.y = (float)local_7c; render_quad_set_rect(quad,&renderPos,pVVar16,color_04); pPVar9 = local_70; KAGE::SmartPointer::operator_assign(auStackY_2f8 + 0x90,local_70); apply_sprite_shader_params(&shadowColor,1,pVVar16,imageRefCount); quadColor._unk = 0; quadColor._red = shadowColor._tint[0]; quadColor._green = shadowColor._tint[1]; quadColor._blue = shadowColor._tint[2]; quadColor._alpha = shadowColor._tint[3]; (**(code **)(*(int *)pPVar9->_player + 0x14))(); KColor::SetFromARGB(&quadColor,0xffffffff); pVVar16 = &local_78; local_78.x = (float)local_7c; local_78.y = (float)local_7c; render_quad_set_rect(local_254,&renderPos,pVVar16,color_05); quadSrc = extraout_EAX_01; quadDst = quad; for (iVar6 = 0x1c; iVar6 != 0; iVar6 = iVar6 + -1) { *quadDst = *quadSrc; quadSrc = quadSrc + 1; quadDst = quadDst + 1; } pvVar8 = (void *)0x84a06a; Color::Color(&local_38); pPVar9 = local_70; KAGE::SmartPointer::operator_assign(auStackY_2f8 + 0x84,local_70); apply_sprite_shader_params(color,1,pVVar16,pvVar8); (**(code **)(*(int *)pPVar9->_player + 0x14))(&local_d4); pos = savedPos; this = local_94; } local_70 = (PlayerHUD *)0x0; local_94 = (PlayerHUD *)(local_6c * 8.0); do { iVar6 = ((uint)local_70 >> 2) * 0xc; local_9c = (((float)(((uint)local_70 & 3) * 0xc) + 0.0) - 64.0) * local_6c + pos->x; local_7c = (ANM2 *)(uint)*(byte *)((int)local_70 + (int)this->_player + 0x1f44); local_98 = ((float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]) - 6.0) * local_6c + pos->y; bagSlotPos.x = local_9c; bagSlotPos.y = local_98; bVar5 = ANM2::SetAnimation(pAVar7,s_Idle,1); if ((bVar5 != 0) && (*(int *)(puVar15 + 0x5738) != 0)) { AnimationState::SetFrameFloat((AnimationState *)(puVar15 + 0x5734),(float)(int)local_7c); if (*(int *)(hud + 0x5738) != 0) { puVar15[0x5748] = 0; } } if (puVar15[0x580d] == '\0') { fVar10 = local_9c; fVar11 = local_98; } else if (puVar15[0x5774] == '\0') { AnimationState::Render ((AnimationState *)(puVar15 + 0x5734),&bagSlotPos,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(puVar15 + 0x5754),&bagSlotPos,&g_vectorZero,&g_vectorZero); fVar10 = bagSlotPos.x; fVar11 = bagSlotPos.y; } else { AnimationState::Render ((AnimationState *)(puVar15 + 0x5754),&bagSlotPos,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(puVar15 + 0x5734),&bagSlotPos,&g_vectorZero,&g_vectorZero); fVar10 = bagSlotPos.x; fVar11 = bagSlotPos.y; } fVar12 = fVar10 - (float)local_94; fVar14 = fVar11 - (float)local_94; unusedArg = (undefined1 *)((int)local_70 + 1); fVar13 = *(float *)&this[1]._redHeartFlashCountdown; if (fVar12 <= *(float *)&this[1]._redHeartFlashCountdown) { fVar13 = fVar12; } fVar1 = *(float *)&this[1].field_0x10; if (fVar14 <= *(float *)&this[1].field_0x10) { fVar1 = fVar14; } *(float *)&this[1]._redHeartFlashCountdown = fVar13; *(float *)&this[1].field_0x10 = fVar1; fVar13 = *(float *)&this[1].field_0x14; if (*(float *)&this[1].field_0x14 <= fVar12) { fVar13 = fVar12; } fVar12 = *(float *)&this[1].field_0x18; if (*(float *)&this[1].field_0x18 <= fVar14) { fVar12 = fVar14; } fVar10 = (float)local_94 + fVar10; fVar11 = (float)local_94 + fVar11; *(float *)&this[1].field_0x14 = fVar13; *(float *)&this[1].field_0x18 = fVar12; fVar13 = *(float *)&this[1]._redHeartFlashCountdown; if (fVar10 <= *(float *)&this[1]._redHeartFlashCountdown) { fVar13 = fVar10; } fVar12 = *(float *)&this[1].field_0x10; if (fVar11 <= *(float *)&this[1].field_0x10) { fVar12 = fVar11; } *(float *)&this[1]._redHeartFlashCountdown = fVar13; *(float *)&this[1].field_0x10 = fVar12; fVar13 = *(float *)&this[1].field_0x14; if (*(float *)&this[1].field_0x14 <= fVar10) { fVar13 = fVar10; } fVar10 = *(float *)&this[1].field_0x18; if (*(float *)&this[1].field_0x18 <= fVar11) { fVar10 = fVar11; } *(float *)&this[1].field_0x14 = fVar13; *(float *)&this[1].field_0x18 = fVar10; local_70 = (PlayerHUD *)unusedArg; } while (unusedArg < &DAT_00000008); } LAB_0084a3b9: shader_cache_find((int)unusedArg); return; } //@@ 0084a3e0 PlayerHUD::RenderSpellQueue /* ZHL [exact] __thiscall void PlayerHUD::RenderSpellQueue(Vector* pos, float scale); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PlayerHUD::RenderSpellQueue(PlayerHUD *this,Vector *pos,float scale) { byte isAnimSet; int layerFrames; int layerId; int animData; byte spellFrame; uint slot; float scaleY; undefined4 slotAlpha; Vector renderPos; int spellCount; PlayerHUD *playerHud; float offsetY; float scaleCopy; void *hudCopy; float bigSlotOffset; float slotY; float slotX; void *hud; ANM2 *layerAnm2; void *player; hud = this->_HUD; scaleY = scale * g_vectorOne.y; offsetY = scale * 0.0; *(float *)((int)hud + 0x58b4) = scale * g_vectorOne.x; player = this->_player; bigSlotOffset = scale * 8.0; *(float *)((int)hud + 0x58b8) = scaleY; slot = 5; spellCount = *(int *)((int)player + 0x1f54); playerHud = this; scaleCopy = scale; hudCopy = hud; do { slotY = offsetY + pos->y; slotX = (float)(int)slot * 12.0 * scaleCopy + pos->x; if ((int)slot < spellCount) { slotAlpha = 0x3f800000; } else { slotAlpha = 0x3dcccccd; } *(undefined4 *)((int)hud + 0x58cc) = slotAlpha; if (slot == 0) { spellFrame = *(byte *)((int)playerHud->_player + 0x1f58); isAnimSet = ANM2::SetAnimation((ANM2 *)((int)hud + 0x5818),s_Idle,1); if (((isAnimSet != 0) && (*(int *)((int)hud + 0x584c) != 0)) && (AnimationState::SetFrameFloat((AnimationState *)((int)hud + 0x5848),(float)spellFrame), *(int *)((int)hud + 0x584c) != 0)) { *(undefined1 *)((int)hud + 0x585c) = 0; } renderPos.x = slotX + bigSlotOffset; renderPos.y = slotY + bigSlotOffset; slotY = renderPos.y; slotX = renderPos.x; if (*(char *)((int)hud + 0x5921) != '\0') { if (*(char *)((int)hud + 0x5888) == '\0') { animData = *(int *)((int)hud + 0x584c); if (((animData != 0) && (0 < (*(ANM2 **)((int)hud + 0x5848))->_layerCount)) && (layerId = *(int *)(animData + 0x38), -1 < layerId)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(*(int *)((int)hud + 0x5850) + layerId * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)((int)hud + 0x5848)); } animData = *(int *)((int)hud + 0x586c); if (((animData != 0) && (layerAnm2 = *(ANM2 **)((int)hud + 0x5868), 0 < layerAnm2->_layerCount)) && (layerId = *(int *)(animData + 0x38), -1 < layerId)) { layerFrames = *(int *)((int)hud + 0x5870); goto LAB_0084a744; } } else { animData = *(int *)((int)hud + 0x586c); if (((animData != 0) && (0 < (*(ANM2 **)((int)hud + 0x5868))->_layerCount)) && (layerId = *(int *)(animData + 0x38), -1 < layerId)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(*(int *)((int)hud + 0x5870) + layerId * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)((int)hud + 0x5868)); } animData = *(int *)((int)hud + 0x584c); if (((animData != 0) && (layerAnm2 = *(ANM2 **)((int)hud + 0x5848), 0 < layerAnm2->_layerCount)) && (layerId = *(int *)(animData + 0x38), -1 < layerId)) { layerFrames = *(int *)((int)hud + 0x5850); LAB_0084a744: AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(layerFrames + layerId * 4),&g_vectorZero,&g_vectorZero,layerAnm2); } } } renderPos.x = slotX; renderPos.y = slotY; if (*(char *)((int)hud + 0x5921) == '\0') break; if (*(char *)((int)hud + 0x5888) == '\0') { animData = *(int *)((int)hud + 0x584c); if (((animData != 0) && (1 < (*(ANM2 **)((int)hud + 0x5848))->_layerCount)) && (layerId = *(int *)(animData + 0x3c), -1 < layerId)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(*(int *)((int)hud + 0x5850) + layerId * 4),&g_vectorZero,&g_vectorZero ,*(ANM2 **)((int)hud + 0x5848)); } animData = *(int *)((int)hud + 0x586c); if (((animData == 0) || (layerAnm2 = *(ANM2 **)((int)hud + 0x5868), layerAnm2->_layerCount < 2)) || (layerId = *(int *)(animData + 0x3c), layerId < 0)) break; layerFrames = *(int *)((int)hud + 0x5870); } else { animData = *(int *)((int)hud + 0x586c); if (((animData != 0) && (1 < (*(ANM2 **)((int)hud + 0x5868))->_layerCount)) && (layerId = *(int *)(animData + 0x3c), -1 < layerId)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(*(int *)((int)hud + 0x5870) + layerId * 4),&g_vectorZero,&g_vectorZero ,*(ANM2 **)((int)hud + 0x5868)); } animData = *(int *)((int)hud + 0x584c); if (((animData == 0) || (layerAnm2 = *(ANM2 **)((int)hud + 0x5848), layerAnm2->_layerCount < 2)) || (layerId = *(int *)(animData + 0x3c), layerId < 0)) break; layerFrames = *(int *)((int)hud + 0x5850); } AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(layerFrames + layerId * 4),&g_vectorZero,&g_vectorZero,layerAnm2); break; } if (slot < 6) { spellFrame = *(byte *)((int)playerHud->_player + slot + 0x1f58); } else { spellFrame = 0; } isAnimSet = ANM2::SetAnimation((ANM2 *)((int)hud + 0x5818),(byte *)"IdleSmall",1); if (((isAnimSet != 0) && (*(int *)((int)hud + 0x584c) != 0)) && (AnimationState::SetFrameFloat((AnimationState *)((int)hud + 0x5848),(float)spellFrame), *(int *)((int)hudCopy + 0x584c) != 0)) { *(undefined1 *)((int)hud + 0x585c) = 0; } renderPos.x = slotX + bigSlotOffset; renderPos.y = slotY + bigSlotOffset; if (*(char *)((int)hud + 0x5921) != '\0') { if (*(char *)((int)hud + 0x5888) == '\0') { animData = *(int *)((int)hud + 0x584c); if (((animData != 0) && (1 < (*(ANM2 **)((int)hud + 0x5848))->_layerCount)) && (layerId = *(int *)(animData + 0x3c), -1 < layerId)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(*(int *)((int)hud + 0x5850) + layerId * 4),&g_vectorZero,&g_vectorZero ,*(ANM2 **)((int)hud + 0x5848)); } animData = *(int *)((int)hud + 0x586c); if (((animData != 0) && (layerAnm2 = *(ANM2 **)((int)hud + 0x5868), 1 < layerAnm2->_layerCount)) && (layerId = *(int *)(animData + 0x3c), -1 < layerId)) { layerFrames = *(int *)((int)hud + 0x5870); goto LAB_0084a5d9; } } else { animData = *(int *)((int)hud + 0x586c); if (((animData != 0) && (1 < (*(ANM2 **)((int)hud + 0x5868))->_layerCount)) && (layerId = *(int *)(animData + 0x3c), -1 < layerId)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(*(int *)((int)hud + 0x5870) + layerId * 4),&g_vectorZero,&g_vectorZero ,*(ANM2 **)((int)hud + 0x5868)); } animData = *(int *)((int)hud + 0x584c); if (((animData != 0) && (layerAnm2 = *(ANM2 **)((int)hud + 0x5848), 1 < layerAnm2->_layerCount)) && (layerId = *(int *)(animData + 0x3c), -1 < layerId)) { layerFrames = *(int *)((int)hud + 0x5850); LAB_0084a5d9: AnimationLayer::RenderFrame ((AnimationLayer *)(layerId * 0x10 + *(int *)(animData + 0x18)),&renderPos, *(int *)(layerFrames + layerId * 4),&g_vectorZero,&g_vectorZero,layerAnm2); } } } slot = slot - 1; } while (-1 < (int)slot); *(undefined4 *)((int)hud + 0x58cc) = 0x3f800000; return; } //@@ 0084a870 FUN_0084a870 void FUN_0084a870(float *param_1) { Vector pos; int iVar1; PlayerHUD *in_ECX; int iVar2; uint uVar3; PlayerHUD *pPVar4; int local_1c; Vector local_10; iVar2 = 0; local_1c = 0; uVar3 = 0; pPVar4 = in_ECX; do { pPVar4 = (PlayerHUD *)&pPVar4->field_0x10; if (*(char *)pPVar4 != '\0') { iVar1 = (int)uVar3 % 6; if ((int)uVar3 % 6 <= iVar2) { iVar1 = iVar2; } iVar2 = iVar1; if (local_1c < (int)uVar3 / 6) { local_1c = (int)uVar3 / 6; } } uVar3 = uVar3 + 1; } while (uVar3 < 0x18); pos.y = param_1[1] + 0.0; pos.x = *param_1 - (float)iVar2 * 5.0; PlayerHUD::RenderHearts(in_ECX,&local_10,(ANM2 *)((int)in_ECX->_HUD + 0x39a0),0,1.0,pos); return; } //@@ 0084a920 render_health_bar_segment /* DB: ? (rect*, ..., width, ...) with EDX=bar state: draws one segment with render_quad_set_uniform_color/KColor::SetFromARGB, returns bool; from PlayerHUD::render_deathmatch_health_bar */ bool render_health_bar_segment (int *param_1,undefined4 param_2,float param_3,undefined4 param_4,undefined4 param_5, int param_6,int *param_7,int *param_8) { int iVar1; int iVar2; char cVar3; uint uVar4; int *piVar5; float *in_ECX; KColor *color; KColor *color_00; KColor *color_01; int *in_EDX; int *piVar6; float fVar7; float fVar8; float fVar9; float local_9c [2]; float local_94; KColor local_28; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar6 = param_1; puStack_c = &LAB_00b02e2d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; iVar1 = *in_EDX; piVar5 = in_EDX; if (*param_1 < iVar1) { piVar5 = param_1; } iVar2 = *piVar5; if (iVar2 < 0x11) { *in_EDX = iVar1 - iVar2; *param_1 = *param_1 - iVar2; fVar7 = (float)iVar2 * 1.2; local_14 = fVar7; if (fVar7 <= 0.0) { param_3 = (float)((double)(int)param_3 + __uint_to_double_fixup[-((int)param_3 >> 0x1f)]); param_1 = (int *)(float)((double)param_6 + __uint_to_double_fixup[-(param_6 >> 0x1f)]); goto LAB_0084aa92; } } else { *in_EDX = iVar1 + -0x10; *param_1 = *param_1 + -0x10; local_14 = 19.2; } KColor::SetFromARGB(&local_28,0xffffffff); param_1 = (int *)(float)((double)param_6 + __uint_to_double_fixup[-(param_6 >> 0x1f)]); param_3 = (float)((double)(int)param_3 + __uint_to_double_fixup[-((int)param_3 >> 0x1f)]); render_quad_set_uniform_color (local_9c,*in_ECX,in_ECX[1],*in_ECX + param_3,in_ECX[1] + (float)param_1,color); (**(code **)(*param_7 + 0x14))(param_2,local_9c,g_drawRectUnset); fVar7 = local_14 - param_3; *in_ECX = param_3 + *in_ECX; LAB_0084aa92: if (param_3 < fVar7) { fVar8 = param_3; fVar9 = (float)param_1; KColor::SetFromARGB(&local_28,0xffffffff); render_quad_set_uniform_color (local_9c,*in_ECX,in_ECX[1],(fVar7 - fVar8) + *in_ECX,in_ECX[1] + fVar9,color_00); (**(code **)(*param_7 + 0x14))(param_4,local_9c,g_drawRectUnset); *in_ECX = (local_94 - local_9c[0]) + *in_ECX; fVar7 = param_3; } if (0.0 < fVar7) { fVar7 = param_3; KColor::SetFromARGB(&local_28,0xffffffff); render_quad_set_uniform_color (local_9c,*in_ECX,in_ECX[1],*in_ECX + fVar7,in_ECX[1] + (float)param_1,color_01); (**(code **)(*param_7 + 0x14))(param_2,local_9c,g_drawRectUnset); *in_ECX = param_3 + *in_ECX; } if (*in_EDX < *piVar6) { piVar6 = in_EDX; } iVar1 = *piVar6; local_8 = 1; if (param_8 != (int *)0x0) { cVar3 = (**(code **)(*param_8 + 0xc))(uVar4); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(¶m_7); } } ExceptionList = local_10; return iVar1 == 0; } //@@ 0084abc0 FUN_0084abc0 void FUN_0084abc0(undefined4 *param_1,float *param_2,undefined4 *param_3,undefined4 *param_4) { float fVar1; float fVar2; int iVar3; undefined4 uVar4; undefined4 in_ECX; float *in_EDX; float fVar5; float local_8; switch(in_ECX) { case 2: iVar3 = 2; break; case 3: iVar3 = 4; break; default: KAGE_LogMessage(0x10,(byte *)"Unknown heart type\n"); case 1: iVar3 = 0; break; case 6: iVar3 = 0xc; break; case 7: iVar3 = 6; break; case 0xb: iVar3 = 10; break; case 0xc: iVar3 = 8; } fVar1 = (float)iVar3 + 0.0; local_8 = (float)CONCAT31(local_8._1_3_,1); fVar2 = local_8; local_8 = (float)CONCAT31(local_8._1_3_,1); fVar5 = fVar1 + 1.0; *in_EDX = fVar1; in_EDX[1] = 0.0; in_EDX[2] = fVar5; in_EDX[3] = 0.0; in_EDX[4] = fVar1; in_EDX[5] = 8.0; in_EDX[6] = fVar5; in_EDX[7] = 8.0; in_EDX[8] = fVar2; *param_2 = fVar5; param_2[1] = 0.0; param_2[2] = fVar1 + 2.0; param_2[3] = 0.0; param_2[4] = fVar5; param_2[5] = 8.0; param_2[6] = fVar1 + 2.0; param_2[7] = 8.0; param_2[8] = local_8; *param_1 = 2; uVar4 = __ftoui3(); *param_3 = uVar4; uVar4 = __ftoui3(); *param_4 = uVar4; return; } //@@ 0084ad40 PlayerHUD::render_deathmatch_health_bar /* WARNING: Removing unreachable block (ram,0x0084b96e) */ /* WARNING: Removing unreachable block (ram,0x0084af8e) */ /* WARNING: Removing unreachable block (ram,0x0084b980) */ /* WARNING: Removing unreachable block (ram,0x0084b990) */ /* WARNING: Variable defined which should be unmapped: outSize */ /* DB: ? called from hearts render 00843df0 PlayerHUD::RenderHearts when Game current room idx (+0x18304) == -0x13 ROOM_DEATHMATCH_IDX; this=PlayerHUD (player at [0], skip if player+0x20a9), Manager::LoadImage gfx/ui/ui_isaachealthbar.png, sums red/soul/black/golden/bone/rotten hearts (0x1340,0x134c,0x1350,0x194c,0x1d88,0x1da4) capped 0x50 prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall PlayerHUD::render_deathmatch_health_bar(PlayerHUD *this,Vector *outSize,Vector position) { undefined1 *this_00; float *pfVar1; undefined1 *puVar2; char cVar3; void *pvVar4; float fVar5; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar6; undefined4 extraout_ECX_02; int iVar7; uint allocSize; float fVar8; float *pfVar9; float *pfVar10; int *piVar11; double dVar12; undefined1 auStack_182 [2]; undefined1 quad [116]; Vector rowEndPos; undefined4 segmentParams; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined4 local_ec; undefined4 uStack_e8; undefined4 uStack_e4; undefined4 uStack_e0; int local_dc; undefined4 segmentRect; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 local_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; int local_b8; float barHearts; float overflowHearts; float *tickPoints; float *tickPointsEnd; float *tickPointsCapacity; float firstRowStartX; float local_9c; float *remainingHearts; void *rowEnds; float *rowEndsEnd; float *rowEndsCapacity; Vector scratchPos; float *rowStartsEnd; undefined4 local_64; float local_60; int *local_5c; int *local_58; int segmentHeight; float segmentHearts; undefined4 local_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; KColor local_3c; float *local_28; char isRowStart; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; code *drawFn; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b02e7b; local_1c = ExceptionList; ExceptionList = &local_1c; if (*(char *)((int)this->_player + 0x20a9) == '\0') { this_00 = &this[1].field_0x24; puVar2 = (undefined1 *)((int)register0x00000010 + -4); if (*(int *)&this[1].field_0x24 == 0) { pvVar4 = Manager::LoadImage(&local_60,(byte *)"gfx/ui/ui_isaachealthbar.png"); local_14 = 0; KAGE::SmartPointer::operator_assign(this_00,pvVar4); local_14 = 1; if (((local_5c != (int *)0x0) && (cVar3 = (**(code **)(*local_5c + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } puVar2 = puStack_20; if (*(int *)this_00 == 0) goto LAB_0084b9dd; } puStack_20 = puVar2; local_14 = 0xffffffff; iVar7 = *(int *)ThreadLocalStoragePointer; if ((*(int *)(iVar7 + 0xc) < DAT_00c82764) && (_Init_thread_header(), DAT_00c82764 == -1)) { DAT_00c82768 = __ftoui3(); _Init_thread_footer(); } if ((*(int *)(iVar7 + 0xc) < DAT_00c8276c) && (_Init_thread_header(), DAT_00c8276c == -1)) { DAT_00c82770 = __ftoui3(); _Init_thread_footer(); } pvVar4 = this->_player; tickPoints = (float *)0x0; tickPointsEnd = (float *)0x0; tickPointsCapacity = (float *)0x0; overflowHearts = (float)(*(int *)((int)pvVar4 + 0x1da4) + *(int *)((int)pvVar4 + 0x1d88) + *(int *)((int)pvVar4 + 0x194c) + *(int *)((int)pvVar4 + 0x1350) + *(int *)((int)pvVar4 + 0x134c) + *(int *)((int)pvVar4 + 0x1340)); barHearts = overflowHearts; if (0x50 < (uint)overflowHearts) { barHearts = 1.12104e-43; } overflowHearts = (float)((int)overflowHearts - (int)barHearts); rowEnds = (void *)0x0; rowEndsEnd = (float *)0x0; rowEndsCapacity = (float *)0x0; local_14 = 4; remainingHearts = &barHearts; fVar8 = *(float *)((int)pvVar4 + 0x1344); local_28 = (float *)0x0; segmentHearts = fVar8; FUN_00a11080(); FUN_00a11080(); local_60 = position.x; local_58 = (int *)position.y; local_5c = (int *)position.y; isRowStart = 0 < (int)fVar8; FUN_0084abc0(&local_64,&segmentParams); std::vector<8byte>::_Reallocate_exactly(); std::vector<8byte>::_Reallocate_exactly(); std::vector<8byte>::_Reallocate_exactly(); firstRowStartX = position.x - 2.0; local_9c = (float)local_58 - 2.0; std::vector::_Emplace_reallocate(); rowStartsEnd = (float *)0x0; pfVar10 = (float *)0x0; pfVar9 = rowStartsEnd; do { dVar12 = floor((double)local_60); local_58 = (int *)(float)dVar12; dVar12 = floor((double)(float)local_5c); local_5c = (int *)(float)dVar12; local_60 = (float)local_58; fVar5 = fVar8; if ((int)*remainingHearts < (int)fVar8) { fVar5 = *remainingHearts; } if (0.0 < (float)(int)fVar5) { if (isRowStart == '\0') { if (tickPointsEnd == tickPointsCapacity) { std::vector::_Emplace_reallocate(); local_58 = (int *)local_60; } else { *tickPointsEnd = (float)local_58; tickPointsEnd[1] = (float)local_5c; tickPointsEnd = tickPointsEnd + 2; } local_60 = (float)local_58 + 1.0; } isRowStart = '\0'; } piVar11 = (int *)0x0; local_58 = *(int **)&this[1].field_0x28; uVar6 = 0; local_9c = fVar8; if ((((local_58 != (int *)0x0) && (cVar3 = (**(code **)(*local_58 + 4))(), uVar6 = extraout_ECX, cVar3 != '\0')) && (uVar6 = 0, piVar11 != (int *)0x0)) && ((cVar3 = (**(code **)(*piVar11 + 0xc))(), uVar6 = extraout_ECX_00, cVar3 != '\0' && (g_imageReleaseFn != (void *)0x0)))) { (*g_imageReleaseFn)(auStack_182 + -10); uVar6 = extraout_ECX_01; } pfVar1 = remainingHearts; cVar3 = render_health_bar_segment (remainingHearts,&segmentRect,local_64,&segmentParams,uVar6,segmentHeight); if (cVar3 == '\0') { fVar8 = segmentHearts; goto LAB_0084b626; } if (*pfVar1 == 0.0) { if ((int)overflowHearts < 1) break; remainingHearts = &overflowHearts; rowEndPos.x = local_60 - 1.0; rowEndPos.y = (float)local_5c - 2.0; if (rowEndsEnd == rowEndsCapacity) { std::vector::_Emplace_reallocate(); } else { *rowEndsEnd = rowEndPos.x; rowEndsEnd[1] = rowEndPos.y; rowEndsEnd = rowEndsEnd + 2; } local_60 = position.x + 0.0; local_5c = (int *)(position.y + 13.0); isRowStart = '\x01'; scratchPos.x = local_60 - 2.0; scratchPos.y = (float)local_5c - 2.0; if (pfVar9 == (float *)0x0) { std::vector::_Emplace_reallocate(); pfVar9 = rowStartsEnd; } else { *pfVar9 = scratchPos.x; pfVar9[1] = scratchPos.y; rowStartsEnd = pfVar9 + 2; pfVar9 = rowStartsEnd; } } fVar8 = segmentHearts; if (segmentHearts != 0.0) goto switchD_0084b1ed_default; local_28 = (float *)((int)local_28 + 1); switch(pfVar10) { case (float *)0x0: FUN_0084abc0(&local_64,&segmentParams); fVar8 = (float)(*(int *)((int)this->_player + 0x1340) - *(int *)((int)this->_player + 0x1344)); fVar5 = (float)(0x10 - (int)local_9c); local_9c = fVar8; if ((int)fVar5 < (int)fVar8) { local_9c = fVar5; } segmentHearts = fVar8; if (local_9c != 0.0) { fVar8 = (float)((int)fVar8 - (int)local_9c); segmentHearts = fVar8; KAGE::SmartPointer::operator_assign(auStack_182 + -10,this_00); render_health_bar_segment (remainingHearts,&segmentRect,local_64,&segmentParams,extraout_ECX_02, segmentHeight); } goto LAB_0084b626; case (float *)0x1: FUN_0084abc0(&local_64,&segmentParams); fVar8 = *(float *)((int)this->_player + 0x134c); segmentHearts = fVar8; LAB_0084b626: break; case (float *)0x2: segmentRect = 0x40c00000; uStack_d4 = 0; uStack_d0 = 0x40e00000; uStack_cc = 0; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_b8 = local_3c._unk; local_c8 = 0x40c00000; uStack_c4 = 0x41000000; uStack_c0 = 0x40e00000; uStack_bc = 0x41000000; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_dc = local_3c._unk; local_4c = 0x40e00000; uStack_40 = 0; uStack_48 = 0; uStack_44 = 0x41000000; local_3c._red = 7.0; local_3c._blue = 8.0; segmentParams = 0x40e00000; uStack_f8 = 0; uStack_f4 = 0x41000000; uStack_f0 = 0; local_3c._alpha = 8.0; local_3c._green = 8.0; local_64 = 2; segmentHeight = 8; local_ec = 0x40e00000; uStack_e8 = 0x41000000; uStack_e4 = 0x41000000; uStack_e0 = 0x41000000; fVar8 = *(float *)((int)this->_player + 0x194c); segmentHearts = fVar8; break; case (float *)0x3: segmentRect = 0x41000000; uStack_d4 = 0; uStack_d0 = 0x41100000; uStack_cc = 0; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_b8 = local_3c._unk; local_c8 = 0x41000000; uStack_c4 = 0x41000000; uStack_c0 = 0x41100000; uStack_bc = 0x41000000; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_dc = local_3c._unk; local_4c = 0x41100000; uStack_40 = 0; uStack_48 = 0; uStack_44 = 0x41200000; local_3c._red = 9.0; local_3c._blue = 10.0; segmentParams = 0x41100000; uStack_f8 = 0; uStack_f4 = 0x41200000; uStack_f0 = 0; local_3c._alpha = 8.0; local_3c._green = 8.0; local_64 = 2; segmentHeight = 8; local_ec = 0x41100000; uStack_e8 = 0x41000000; uStack_e4 = 0x41200000; uStack_e0 = 0x41000000; fVar8 = *(float *)((int)this->_player + 0x1da4); segmentHearts = fVar8; break; case (float *)0x4: segmentRect = 0x41200000; uStack_d4 = 0; uStack_d0 = 0x41300000; uStack_cc = 0; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_b8 = local_3c._unk; local_c8 = 0x41200000; uStack_c4 = 0x41000000; uStack_c0 = 0x41300000; uStack_bc = 0x41000000; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_dc = local_3c._unk; local_4c = 0x41300000; uStack_40 = 0; uStack_48 = 0; uStack_44 = 0x41400000; local_3c._red = 11.0; local_3c._blue = 12.0; segmentParams = 0x41300000; uStack_f8 = 0; uStack_f4 = 0x41400000; uStack_f0 = 0; local_3c._alpha = 8.0; local_3c._green = 8.0; local_64 = 2; segmentHeight = 8; local_ec = 0x41300000; uStack_e8 = 0x41000000; uStack_e4 = 0x41400000; uStack_e0 = 0x41000000; fVar8 = *(float *)((int)this->_player + 0x1d88); segmentHearts = fVar8; break; case (float *)0x5: segmentRect = 0x41400000; uStack_d4 = 0; uStack_d0 = 0x41500000; uStack_cc = 0; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_b8 = local_3c._unk; local_c8 = 0x41400000; uStack_c4 = 0x41000000; uStack_c0 = 0x41500000; uStack_bc = 0x41000000; local_3c._unk = CONCAT31(local_3c._unk._1_3_,1); local_dc = local_3c._unk; local_4c = 0x41500000; uStack_40 = 0; uStack_48 = 0; uStack_44 = 0x41600000; local_3c._red = 13.0; local_3c._blue = 14.0; segmentParams = 0x41500000; uStack_f8 = 0; uStack_f4 = 0x41600000; uStack_f0 = 0; local_3c._alpha = 8.0; local_3c._green = 8.0; local_64 = 2; segmentHeight = 8; local_ec = 0x41500000; uStack_e8 = 0x41000000; uStack_e4 = 0x41600000; uStack_e0 = 0x41000000; fVar8 = *(float *)((int)this->_player + 0x1350); segmentHearts = fVar8; } switchD_0084b1ed_default: pfVar10 = local_28; } while (local_28 < &DAT_00000007); piVar11 = (int *)((int)pfVar9 >> 3); local_58 = piVar11; if ((uint)((int)rowEndsEnd - (int)rowEnds >> 3) < piVar11) { scratchPos.x = local_60 - 1.0; scratchPos.y = (float)local_5c - 2.0; if (rowEndsEnd == rowEndsCapacity) { std::vector::_Emplace_reallocate(); } else { *rowEndsEnd = scratchPos.x; rowEndsEnd[1] = scratchPos.y; rowEndsEnd = rowEndsEnd + 2; } } pfVar10 = tickPointsEnd; if (tickPoints != tickPointsEnd) { local_9c = (float)((double)segmentHeight + __uint_to_double_fixup[-(segmentHeight >> 0x1f)]); pfVar9 = tickPoints; do { local_3c._red = 1.0; local_3c._green = 1.0; local_3c._blue = 1.0; local_3c._alpha = 1.0; local_3c._unk = 0; render_quad_set_uniform_color (quad,*pfVar9,pfVar9[1],*pfVar9 + 1.0,pfVar9[1] + local_9c,&local_3c); (**(code **)(**(int **)this_00 + 0x14))(&DAT_00c5d22c); pfVar9 = pfVar9 + 2; } while (pfVar9 != pfVar10); piVar11 = local_58; } pvVar4 = rowEnds; if (piVar11 != (int *)0x0) { local_28 = (float *)0x0; do { local_3c._unk = 0; local_3c._red = 1.0; local_3c._green = 1.0; local_3c._blue = 1.0; local_3c._alpha = 1.0; (**(code **)(**(int **)this_00 + 0x18))(&DAT_00c5d1c0); pfVar10 = (float *)((int)local_28 + (int)pvVar4); local_3c._unk = 0; local_3c._red = 1.0; local_3c._green = 1.0; local_3c._blue = 1.0; local_3c._alpha = 1.0; (**(code **)(**(int **)this_00 + 0x18))(&DAT_00c5d208,pfVar10,&local_3c); local_3c._red = 1.0; local_3c._green = 1.0; local_3c._blue = 1.0; local_3c._alpha = 1.0; local_3c._unk = 0; render_quad_set_uniform_color (quad,(float)((double)DAT_00c82768 + __uint_to_double_fixup[-(DAT_00c82768 >> 0x1f)]) + *local_28, local_28[1],*pfVar10, (float)((double)DAT_00c82770 + __uint_to_double_fixup[-(DAT_00c82770 >> 0x1f)]) + *(float *)((int)pvVar4 + 4 + (int)local_28),&local_3c); (**(code **)(**(int **)this_00 + 0x14))(&DAT_00c5d1e4,quad,g_drawRectUnset); local_28 = local_28 + 2; piVar11 = (int *)((int)piVar11 - 1); } while (piVar11 != (int *)0x0); } local_3c._red = 1.0; local_3c._green = 1.0; local_3c._blue = 1.0; local_3c._alpha = 1.0; scratchPos.x = position.x - 14.0; local_3c._unk = 0; scratchPos.y = position.y + 0.0; (**(code **)(**(int **)this_00 + 0x18))(&DAT_00c5d178); iVar7 = 0; piVar11 = (int *)&(g_game->_playerManager).field_0x60; drawFn = *(code **)(**(int **)this_00 + 0x18); do { if (*piVar11 == *(int *)((int)this->_player + 0x1618)) goto LAB_0084b8e2; iVar7 = iVar7 + 1; piVar11 = piVar11 + 1; } while (iVar7 < 4); iVar7 = 5; LAB_0084b8e2: PlayerManager::GetPlayerColorValue(&local_3c,iVar7); scratchPos.x = position.x - 16.0; scratchPos.y = position.y - 2.0; (*drawFn)(&DAT_00c5d19c,&scratchPos,&local_3c); outSize->x = 46.0; outSize->y = 17.0; if (rowEnds != (void *)0x0) { allocSize = (int)rowEndsCapacity - (int)rowEnds & 0xfffffff8; pvVar4 = rowEnds; if (0xfff < allocSize) { pvVar4 = *(void **)((int)rowEnds + -4); allocSize = allocSize + 0x23; if (0x1f < (uint)((int)rowEnds + (-4 - (int)pvVar4))) goto LAB_0084b9c9; } operator_delete(pvVar4,allocSize); } if (tickPoints != (float *)0x0) { allocSize = (int)tickPointsCapacity - (int)tickPoints & 0xfffffff8; pfVar10 = tickPoints; if (0xfff < allocSize) { pfVar10 = (float *)tickPoints[-1]; allocSize = allocSize + 0x23; if (0x1f < (uint)((int)tickPoints + (-4 - (int)pfVar10))) { LAB_0084b9c9: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pfVar10,allocSize); } } else { LAB_0084b9dd: fVar8 = g_vectorZero.y; outSize->x = g_vectorZero.x; outSize->y = fVar8; } ExceptionList = local_1c; return outSize; } //@@ 0084bab0 FUN_0084bab0 void FUN_0084bab0(Vector *param_1,ColorMod *param_2,int param_3) { int *in_ECX; KColor *color; float in_XMM2_Da; undefined1 *puVar1; undefined1 auStackY_14c [128]; Vector *size; KColor *imageRefCount; undefined1 local_b8 [112]; float local_48; float local_44; float local_40; float local_3c; float local_38; float local_34; float local_30; float local_2c; undefined1 local_28; Vector local_24; KColor local_1c; puVar1 = &DAT_42000000; local_48 = g_vectorZero.x; if (*in_ECX == 0x14) { local_48 = g_vectorZero.x + (float)(3 - *(int *)(param_3 + 0x1394)) * 32.0; } local_40 = local_48 + 32.0; local_3c = g_vectorZero.y; local_44 = g_vectorZero.y; local_34 = g_vectorZero.y + 32.0; local_28 = 1; local_38 = local_48; local_30 = local_40; local_2c = local_34; KColor::SetFromARGB(&local_1c,0xffffffff); local_24.x = in_XMM2_Da * (float)puVar1; size = &local_24; imageRefCount = color; local_24.y = local_24.x; render_quad_set_rect(local_b8,param_1,size,color); KAGE::SmartPointer::operator_assign(auStackY_14c + 0x84,in_ECX + 2); apply_sprite_shader_params(param_2,1,size,imageRefCount); local_1c._red = param_2->_tint[0]; local_1c._green = param_2->_tint[1]; local_1c._blue = param_2->_tint[2]; local_1c._alpha = param_2->_tint[3]; local_1c._unk = 0; (**(code **)(*(int *)in_ECX[2] + 0x14))(&local_48); return; } //@@ 0084bba0 FUN_0084bba0 void FUN_0084bba0(void) { undefined4 *in_ECX; FUN_00709380(); in_ECX[1] = *in_ECX; return; } //@@ 0084bbc0 FUN_0084bbc0 void FUN_0084bbc0(undefined4 *param_1) { undefined4 *puVar1; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<12byte>::_Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; KAGE::SmartPointer::operator_assign(puVar1 + 1,param_1 + 1); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0xc; return; } //@@ 0084bc00 FUN_0084bc00 void FUN_0084bc00(undefined4 *param_1) { undefined4 *in_ECX; *in_ECX = *param_1; KAGE::SmartPointer::operator_assign(in_ECX + 1,param_1 + 1); return; } //@@ 0084bc30 std::vector<12byte>::_Emplace_reallocate /* DB: vector grow (max 0x15555555 = 2^32/12) of {int, KAGE::SmartPointer} elements; three times from PlayerHUD::Update when the vector is full */ undefined4 * std::vector<12byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; int iVar3; undefined4 *puVar4; void *pvVar5; int iVar6; undefined4 *puVar7; int *in_ECX; uint uVar8; undefined4 *puVar9; undefined4 *puVar10; void *ptr; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02ead; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *in_ECX; iVar6 = (in_ECX[1] - *in_ECX) / 0xc; if (iVar6 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar6 + 1; uVar8 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar8 >> 1) < uVar8) { local_20 = 0x15555555; } else { uVar8 = (uVar8 >> 1) + uVar8; local_20 = uVar1; if (uVar1 <= uVar8) { local_20 = uVar8; } if (0x15555555 < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = _Allocate(local_20 * 0xc); local_8 = 0; puVar2 = puVar7 + (((int)param_1 - iVar3) / 0xc) * 3; *puVar2 = *param_2; KAGE::SmartPointer::operator_assign(puVar2 + 1,param_2 + 1); puVar4 = (undefined4 *)in_ECX[1]; puVar10 = (undefined4 *)*in_ECX; if (param_1 == puVar4) { local_8 = CONCAT31(local_8._1_3_,1); puVar9 = puVar7; for (; puVar10 != puVar4; puVar10 = puVar10 + 3) { *puVar9 = *puVar10; KAGE::SmartPointer::operator_assign(puVar9 + 1,puVar10 + 1); puVar9 = puVar9 + 3; } FUN_00709380(puVar4); } else { FUN_0084be60(puVar10,param_1,puVar7); FUN_0084be60(param_1,in_ECX[1],puVar2 + 3); } if (*in_ECX != 0) { FUN_00709380(*in_ECX); pvVar5 = (void *)*in_ECX; uVar8 = ((in_ECX[2] - (int)pvVar5) / 0xc) * 0xc; ptr = pvVar5; if (0xfff < uVar8) { ptr = *(void **)((int)pvVar5 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar8); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + uVar1 * 3); in_ECX[2] = (int)(puVar7 + local_20 * 3); ExceptionList = local_10; return puVar2; } //@@ 0084be32 Catch_All@0084be32 void Catch_All_0084be32(void) { int unaff_EBP; FUN_00709070(*(undefined4 *)(unaff_EBP + -0x18),*(undefined4 *)(unaff_EBP + -0x2c)); deallocate(*(void **)(unaff_EBP + -0x14),*(uint *)(unaff_EBP + -0x28)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0084be60 FUN_0084be60 undefined4 * FUN_0084be60(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02edd; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 3) { *param_3 = *param_1; KAGE::SmartPointer::operator_assign(param_3 + 1,param_1 + 1); param_3 = param_3 + 3; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_00709380(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 0084bef0 FUN_0084bef0 void FUN_0084bef0(undefined4 *param_1,void *param_2) { undefined4 *in_ECX; *in_ECX = *param_1; KAGE::SmartPointer::operator_assign(in_ECX + 1,param_2); return; } //@@ 0084bf20 FUN_0084bf20 void FUN_0084bf20(void) { FUN_00709380(); return; } //@@ 0084bf30 FUN_0084bf30 uint FUN_0084bf30(Entity_Player *param_1) { byte bVar1; uint uVar2; int in_ECX; int *piVar3; uint uVar4; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,param_1->_controllerIndex), bVar1 == 0)) { return 0xffffffff; } if ((((param_1->_variant != 0) || (param_1->_parent != (EntityPtr)0x0)) || (param_1->_playerType == 0x28)) || (bVar1 = Entity_Player::IsHologram(param_1), bVar1 != 0)) { return 0xffffffff; } uVar4 = 0xffffffff; piVar3 = (int *)(in_ECX + 0x114); uVar2 = 0; do { if ((Entity_Player *)*piVar3 == param_1) { return uVar2; } if (((Entity_Player *)*piVar3 == (Entity_Player *)0x0) && ((int)uVar4 < 0)) { uVar4 = uVar2; } uVar2 = uVar2 + 1; piVar3 = piVar3 + 0x33; } while (uVar2 < 2); if (-1 < (int)uVar4) { *(Entity_Player **)(uVar4 * 0xcc + 0x114 + in_ECX) = param_1; } return uVar4; } //@@ 0084bfd0 text_image_cache_reset /* DB: ? ECX = HUD+0x5c54 (same object as text_image_cache_clear, tail-called after it in HUD::unload_graphics): for two 0xcc-byte records at +0x128 zeroes the fields and sets four floats to 0.1 prototype: db/protos.zhl */ void __thiscall text_image_cache_reset(void *this) { undefined4 *puVar1; int iVar2; iVar2 = 2; puVar1 = (undefined4 *)((int)this + 0x128); do { puVar1[-5] = 0; puVar1[-4] = 0; puVar1[1] = 0; puVar1[-3] = 0; *puVar1 = 0; puVar1[-2] = 0; puVar1[2] = 0; puVar1[5] = 0; puVar1[3] = 0; puVar1[6] = 0; puVar1[7] = 0; puVar1[10] = 0; puVar1[8] = 0; puVar1[0xb] = 0; puVar1[0xc] = 0; puVar1[0xf] = 0; puVar1[0xd] = 0; puVar1[0x10] = 0; puVar1[0x11] = 0; puVar1[0x14] = 0; puVar1[0x12] = 0; puVar1[0x15] = 0; puVar1[0x16] = 0; puVar1[0x19] = 0; puVar1[0x17] = 0; puVar1[0x1a] = 0; puVar1[0x1b] = 0; puVar1[0x1e] = 0; puVar1[0x1c] = 0; puVar1[0x1f] = 0; puVar1[0x20] = 0; puVar1[0x23] = 0; puVar1[0x21] = 0; puVar1[0x24] = 0; puVar1[0x25] = 0; puVar1[0x28] = 0; puVar1[0x26] = 0; puVar1[0x29] = 0; puVar1[0x2a] = 0; puVar1[0x2d] = 0; puVar1[0x2b] = 0; puVar1[0x1d] = 0x3dcccccd; puVar1[0x22] = 0x3dcccccd; puVar1[0x27] = 0x3dcccccd; puVar1[0x2c] = 0x3dcccccd; iVar2 = iVar2 + -1; puVar1 = puVar1 + 0x33; } while (iVar2 != 0); *(undefined1 *)((int)this + 0x2ac) = 0; return; } //@@ 0084c170 FUN_0084c170 void FUN_0084c170(void) { Game *pGVar1; Entity_Player *pEVar2; undefined4 *puVar3; int iVar4; StatHUD *pSVar5; StatHUD *in_ECX; void *pvVar6; uint uVar7; PlayerManager *pPVar8; uint uVar9; uint flags; if ((g_manager->_optionsConfig)._enableFoundHUD != 0) { pEVar2 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1f2,(RNG **)&g_game->_playerManager,1); pGVar1 = g_game; pPVar8 = &g_game->_playerManager; *(bool *)(in_ECX + 0xab) = pEVar2 != (Entity_Player *)0x0; uVar9 = 0; if ((int)(pGVar1->_playerManager)._playerList._end - (int)(pPVar8->_playerList)._begin >> 2 != 0 ) { do { pvVar6 = (pPVar8->_playerList)._end; if ((int)pvVar6 - (int)(pPVar8->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (pPVar8->_playerList)._end; } puVar3 = (pPVar8->_playerList)._begin; uVar7 = (int)pvVar6 - (int)puVar3 >> 2; if (uVar9 < uVar7) { puVar3 = puVar3 + uVar9; } flags = 0xfffffeff; iVar4 = FUN_0084bf30(*puVar3); StatHUD::RecomputeStats(in_ECX,iVar4,flags,(byte)uVar7); uVar9 = uVar9 + 1; pPVar8 = &g_game->_playerManager; } while (uVar9 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar8->_playerList)._begin >> 2)); } pSVar5 = in_ECX + 0x4f; iVar4 = 2; do { if (0 < (int)pSVar5[-5]) { pSVar5[-5] = (StatHUD)((int)pSVar5[-5] + -1); } if (0 < (int)*pSVar5) { *pSVar5 = (StatHUD)((int)*pSVar5 + -1); } if (0 < (int)pSVar5[5]) { pSVar5[5] = (StatHUD)((int)pSVar5[5] + -1); } if (0 < (int)pSVar5[10]) { pSVar5[10] = (StatHUD)((int)pSVar5[10] + -1); } if (0 < (int)pSVar5[0xf]) { pSVar5[0xf] = (StatHUD)((int)pSVar5[0xf] + -1); } if (0 < (int)pSVar5[0x14]) { pSVar5[0x14] = (StatHUD)((int)pSVar5[0x14] + -1); } if (0 < (int)pSVar5[0x19]) { pSVar5[0x19] = (StatHUD)((int)pSVar5[0x19] + -1); } if (0 < (int)pSVar5[0x1e]) { pSVar5[0x1e] = (StatHUD)((int)pSVar5[0x1e] + -1); } if (0 < (int)pSVar5[0x23]) { pSVar5[0x23] = (StatHUD)((int)pSVar5[0x23] + -1); } if (0 < (int)pSVar5[0x28]) { pSVar5[0x28] = (StatHUD)((int)pSVar5[0x28] + -1); } pSVar5 = pSVar5 + 0x33; iVar4 = iVar4 + -1; } while (iVar4 != 0); } return; } //@@ 0084c2c0 StatHUD::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: HUD::Render calls it with a position; per-player slots at this+0x114 (stride 0xcc), "%.1f%%"/"+%.2f" stat strings, Font::DrawString */ void StatHUD::Render(float *param_1) { int iVar1; KColor color; byte bVar2; char *pcVar3; void *glyphs; int in_ECX; AnimationState *pAVar4; char *pcVar5; int *piVar6; byte *pbVar7; char cVar8; int *piVar9; uint uVar10; uint uVar11; undefined1 auVar12 [16]; float fVar13; float fVar14; float fVar15; undefined1 local_bc [16]; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; undefined4 local_94; float local_90; float local_8c; float local_88; float local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; float local_6c; undefined4 local_68; float local_64; float local_60; undefined1 *local_5c; uint local_58; float local_54; Font *local_50; float local_4c; undefined4 local_48; int local_44; float local_40; Vector local_3c; char local_31; byte local_30 [24]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02f23; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; if (((g_manager->_optionsConfig)._enableFoundHUD != 0) && ((*(int *)(in_ECX + 0x114) != 0 || (*(int *)(in_ECX + 0x1e0) != 0)))) { fVar13 = 12.0; local_50 = &g_manager->_font8_LuaMiniOutlined; cVar8 = *(char *)(in_ECX + 0x2ac); local_40 = 12.0; local_5c = &DAT_bf800000; local_84 = param_1[1]; if ((*(int *)(in_ECX + 0x114) != 0) && (*(int *)(in_ECX + 0x1e0) != 0)) { fVar13 = 14.0; local_5c = (undefined1 *)0xc0a00000; local_40 = 14.0; } local_88 = *param_1; uVar10 = 0; local_44 = in_ECX; local_3c.x = local_88; local_3c.y = local_84; local_31 = cVar8; do { if ((uVar10 != 8) && (uVar10 != 9)) { if ((uVar10 == 6) && (cVar8 != '\0')) { if (*(int *)(in_ECX + 0x34) != 0) { AnimationState::AdvancePosition ((AnimationState *)(in_ECX + 0x30), *(int *)(*(int *)(in_ECX + 0x34) + 0x30) + -1); } *(undefined4 *)(in_ECX + 0xb4) = 0x3f000000; if (*(char *)(in_ECX + 0x109) != '\0') { if (*(char *)(in_ECX + 0x70) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x30),&local_3c,&g_vectorZero,&g_vectorZero); pAVar4 = (AnimationState *)(in_ECX + 0x50); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x50),&local_3c,&g_vectorZero,&g_vectorZero); pAVar4 = (AnimationState *)(in_ECX + 0x30); } AnimationState::Render(pAVar4,&local_3c,&g_vectorZero,&g_vectorZero); } uVar10 = 7; } else { if (*(int *)(in_ECX + 0x34) != 0) { AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x30),(float)(int)uVar10); } *(undefined4 *)(in_ECX + 0xb4) = 0x3f000000; if (*(char *)(in_ECX + 0x109) != '\0') { if (*(char *)(local_44 + 0x70) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x30),&local_3c,&g_vectorZero,&g_vectorZero); pAVar4 = (AnimationState *)(in_ECX + 0x50); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x50),&local_3c,&g_vectorZero,&g_vectorZero); pAVar4 = (AnimationState *)(in_ECX + 0x30); } AnimationState::Render(pAVar4,&local_3c,&g_vectorZero,&g_vectorZero); in_ECX = local_44; } } local_3c.y = local_3c.y + local_40; fVar13 = local_40; cVar8 = local_31; } uVar10 = uVar10 + 1; } while (uVar10 < 10); local_58 = 0; do { piVar9 = (int *)(in_ECX + 0x114 + local_58 * 0xcc); if (*piVar9 == 0) { ExceptionList = local_10; return; } uVar11 = 0; auVar12 = ZEXT416((uint)local_84); local_54 = local_84; fVar15 = (float)((double)(int)local_58 + __uint_to_double_fixup[-((int)local_58 >> 0x1f)]); fVar14 = fVar15 * 4.0 + local_88; uVar10 = local_58; local_90 = fVar15; local_8c = fVar14; do { if (((uVar11 != 8) && (uVar11 != 9)) && ((uVar11 != 7 || (cVar8 == '\0')))) { if (((uVar11 == 6) || (uVar11 == 7)) || ((uVar11 == 0 && ((*(int *)(*piVar9 + 0x13c0) == 0x13 || (*(int *)(*piVar9 + 0x13c0) == 0x14)))))) { if (uVar10 == 0) goto LAB_0084c580; } else { auVar12 = ZEXT416((uint)(fVar15 * 7.0 + (float)local_5c + auVar12._0_4_)); LAB_0084c580: local_30[0x14] = 0; local_30[0x15] = 0; local_30[0x16] = 0; local_30[0x17] = 0; local_30[8] = 0; local_30[9] = 0; local_30[10] = 0; local_30[0xb] = 0; local_64 = auVar12._0_4_ + (g_game->_screenShakeOffset).y + 1.0; local_60 = fVar14 + (g_game->_screenShakeOffset).x + 16.0; local_30[0xc] = 0; local_30[0xd] = 0; local_30[0xe] = 0; local_30[0xf] = 0; local_30[0x10] = 0; local_30[0x11] = 0; local_30[0x12] = 0; local_30[0x13] = 0; local_30[0] = 0; local_30[1] = 0; local_30[2] = 0; local_30[3] = 0; local_30[4] = 0; local_30[5] = 0; local_30[6] = 0; local_30[7] = 0; if (uVar11 == 6) { bVar2 = Entity_Player::HasTrinket((Entity_Player *)*piVar9,7,0); if (bVar2 == 0) { LAB_0084c6ec: sprintf_s(local_30 + 0xc,0xc,(byte *)"%.1f%%"); pcVar3 = "+%.1f%%"; pcVar5 = "%.1f%%"; goto LAB_0084c717; } pbVar7 = local_30 + 0xc; pcVar3 = "%.1f%%"; LAB_0084c735: sprintf_s(pbVar7,0xc,(byte *)pcVar3); } else { if (uVar11 != 7) { sprintf_s(local_30 + 0xc,0xc,&DAT_00b67750); pcVar3 = "+%.2f"; pcVar5 = &DAT_00b67750; LAB_0084c717: if ((float)piVar9[uVar11 * 5 + 2] <= 0.0) { pcVar3 = pcVar5; } pbVar7 = local_30; goto LAB_0084c735; } bVar2 = Entity_Player::HasTrinket((Entity_Player *)*piVar9,7,0); if (bVar2 == 0) goto LAB_0084c6ec; local_48 = 0x42c80000; local_4c = (float)piVar9[0x1f] + (float)piVar9[0x24]; sprintf_s(local_30 + 0xc,0xc,(byte *)"%.1f%%"); pcVar3 = "+%.1f%%"; if ((float)piVar9[0x20] + (float)piVar9[0x25] <= 0.0) { pcVar3 = "%.1f%%"; } sprintf_s(local_30,0xc,(byte *)pcVar3); piVar6 = piVar9 + 0x28; if (piVar9[0x28] < piVar9[0x23]) { piVar6 = piVar9 + 0x23; } piVar9[0x28] = *piVar6; } if (local_58 == 0) { local_4c = 1.0; } else { local_4c = 0.8; } local_80 = 0; local_7c = 0xffff; local_78 = 0; local_74 = 0x3f800000; local_70 = 0xffffffff; local_6c = 0.0; local_68 = 0; local_8 = 0; local_48 = local_4c; glyphs = Font::measure_string(local_50,local_bc,local_30 + 0xc,&local_80,&g_vectorOne); local_8 = CONCAT31(local_8._1_3_,1); color._green = (float)local_48; color._red = 1.0; color._blue = local_4c; color._alpha = 0.5; color._unk = 0; Font::render_glyph_quads(local_50,glyphs,local_60,local_64,1.0,1.0,color,&local_80); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); pbVar7 = local_30; local_8 = 0xffffffff; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); if ((pbVar7 != local_30 + 1) && (iVar1 = piVar9[uVar11 * 5 + 5], 0 < iVar1)) { local_6c = 1.0; if (iVar1 < 0x88) { if (iVar1 < 0x1e) { local_6c = ((float)iVar1 - 0.0) / 30.0; } } else { local_6c = ((float)iVar1 - 150.0) / -15.0; } local_6c = local_6c * 0.5; if ((float)piVar9[uVar11 * 5 + 2] < 0.0) { local_74 = 0x3cf5c28f; local_78 = 0x3f666666; } else { local_74 = 0x3f666666; local_78 = 0x3cf5c28f; } local_70 = 0x3cf5c28f; local_68 = 0; local_ac = 0; local_a8 = 0xffff; local_a4 = 0; local_a0 = 0x3f800000; local_9c = 0xffffffff; local_98 = 0; local_94 = 0; local_8 = 2; Font::DrawString(local_30,&local_78,&local_ac); } local_8 = 0xffffffff; auVar12 = ZEXT416((uint)local_54); uVar10 = local_58; fVar13 = local_40; fVar14 = local_8c; fVar15 = local_90; } auVar12._0_4_ = auVar12._0_4_ + fVar13; local_54 = auVar12._0_4_; } uVar11 = uVar11 + 1; cVar8 = local_31; } while (uVar11 < 10); local_58 = uVar10 + 1; in_ECX = local_44; } while (local_58 < 2); } ExceptionList = local_10; return; } //@@ 0084ca00 StatHUD::RecomputeStats /* ZHL [exact] __thiscall void StatHUD::RecomputeStats(int playerId, unsigned int flags,bool unk); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall StatHUD::RecomputeStats(StatHUD *this,int playerId,uint flags,byte unk) { int iVar1; undefined4 uVar2; if ((-1 < playerId) && (this[playerId * 0x33 + 0x45] != (StatHUD)0x0)) { iVar1 = g_game->_frameCount - *(int *)((int)this[playerId * 0x33 + 0x45] + 0x328); uVar2 = CONCAT31((int3)((uint)iVar1 >> 8),1 < iVar1); if ((flags & 1) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 2) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 4) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 8) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 0x10) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 0x20) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 0xc0) != 0) { Room::GetDevilRoomChance(g_game->_room); Level::CanSpawnDevilRoom((Level *)g_game); get_angel_room_chance(); if (*(char *)(this + 0xab) == '\0') { FUN_0084d6b0(uVar2); } else { FUN_0084d6b0(uVar2); } FUN_0084d6b0(uVar2); } if ((flags & 0x100) != 0) { FUN_0084d6b0(uVar2); } if ((flags & 0x200) != 0) { FUN_0084d6b0(uVar2); } } return; } //@@ 0084cc40 StatHUD::update_player /* DB: ? (oldPlayer, newPlayer): finds the slot whose player == param1 (this+0x114, stride 0xcc), stores the new player's stats (0x1568 damage, 0x1460/0x1470/0x1480 speed/range...) with lerp fields; CanSpawnDevilRoom/GetDevilRoomChance for the deal chance line */ void StatHUD::update_player(StatHUD param_1,StatHUD param_2) { bool bVar1; Game *pGVar2; byte bVar3; StatHUD SVar4; StatHUD SVar5; StatHUD *in_ECX; StatHUD *pSVar6; StatHUD *pSVar7; float fVar8; StatHUD SVar9; StatHUD local_24; uint local_20; StatHUD *local_1c; StatHUD local_18; local_24 = (StatHUD)0x87; local_20 = 0; do { if (in_ECX[local_20 * 0x33 + 0x45] == param_1) { in_ECX[local_20 * 0x33 + 0x45] = param_2; if ((-1 < (int)local_20) && (param_2 != (StatHUD)0x0)) { if (g_game->_frameCount - *(int *)((int)param_2 + 0x328) < 2) { SVar4 = in_ECX[local_20 * 0x33 + 0x46]; pSVar6 = in_ECX + local_20 * 0x33 + 0x5f; in_ECX[local_20 * 0x33 + 0x46] = *(StatHUD *)((int)param_2 + 0x1568); in_ECX[local_20 * 0x33 + 0x48] = SVar4; in_ECX[local_20 * 0x33 + 0x47] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x4a] = (StatHUD)0x0; fVar8 = *(float *)((int)param_2 + 0x1460); in_ECX[local_20 * 0x33 + 0x4d] = in_ECX[local_20 * 0x33 + 0x4b]; in_ECX[local_20 * 0x33 + 0x4c] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x4f] = (StatHUD)0x0; bVar1 = false; in_ECX[local_20 * 0x33 + 0x4b] = (StatHUD)(30.0 / (fVar8 + 1.0)); SVar4 = in_ECX[local_20 * 0x33 + 0x50]; in_ECX[local_20 * 0x33 + 0x50] = *(StatHUD *)((int)param_2 + 0x1470); in_ECX[local_20 * 0x33 + 0x52] = SVar4; in_ECX[local_20 * 0x33 + 0x51] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x54] = (StatHUD)0x0; fVar8 = *(float *)((int)param_2 + 0x1480); in_ECX[local_20 * 0x33 + 0x57] = in_ECX[local_20 * 0x33 + 0x55]; in_ECX[local_20 * 0x33 + 0x56] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x59] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x55] = (StatHUD)(fVar8 / 40.0); SVar4 = *(StatHUD *)((int)param_2 + 0x1464); in_ECX[local_20 * 0x33 + 0x5c] = in_ECX[local_20 * 0x33 + 0x5a]; in_ECX[local_20 * 0x33 + 0x5b] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x5e] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x5a] = SVar4; SVar9 = *(StatHUD *)((int)param_2 + 0x156c); pSVar6[2] = *pSVar6; pSVar6[1] = (StatHUD)0x0; pSVar6[4] = (StatHUD)0x0; } else { SVar4 = *(StatHUD *)((int)param_2 + 0x1568); SVar9 = in_ECX[local_20 * 0x33 + 0x46]; if ((float)SVar4 == (float)SVar9) { LAB_0084cec8: in_ECX[local_20 * 0x33 + 0x46] = SVar4; pSVar6 = in_ECX + local_20 * 0x33 + 0x4b; fVar8 = *(float *)((int)in_ECX[local_20 * 0x33 + 0x45] + 0x1460); SVar4 = *pSVar6; } else { SVar5 = in_ECX[local_20 * 0x33 + 0x4a]; if (0x1e < (int)SVar5) { if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } in_ECX[local_20 * 0x33 + 0x4a] = SVar5; in_ECX[local_20 * 0x33 + 0x47] = (StatHUD)((float)SVar4 - (float)in_ECX[local_20 * 0x33 + 0x48]); goto LAB_0084cec8; } in_ECX[local_20 * 0x33 + 0x48] = SVar9; in_ECX[local_20 * 0x33 + 0x47] = (StatHUD)((float)SVar4 - (float)SVar9); if ((float)in_ECX[local_20 * 0x33 + 0x49] <= ABS((float)SVar4 - (float)SVar9)) { in_ECX[local_20 * 0x33 + 0x4a] = (StatHUD)0x96; } in_ECX[local_20 * 0x33 + 0x46] = SVar4; fVar8 = *(float *)((int)param_2 + 0x1460); pSVar6 = in_ECX + local_20 * 0x33 + 0x4b; SVar4 = *pSVar6; } SVar9 = (StatHUD)(30.0 / (fVar8 + 1.0)); if ((float)SVar9 == (float)SVar4) { *pSVar6 = SVar9; LAB_0084cf67: pSVar7 = in_ECX + local_20 * 0x33 + 0x50; SVar4 = *pSVar7; } else { SVar5 = pSVar6[4]; if (0x1e < (int)SVar5) { pSVar6[1] = (StatHUD)((float)SVar9 - (float)pSVar6[2]); if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } pSVar6[4] = SVar5; *pSVar6 = SVar9; goto LAB_0084cf67; } pSVar6[2] = SVar4; pSVar6[1] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)pSVar6[3] <= ABS((float)SVar9 - (float)SVar4)) { pSVar6[4] = (StatHUD)0x96; } pSVar7 = in_ECX + local_20 * 0x33 + 0x50; *pSVar6 = SVar9; SVar4 = *pSVar7; } SVar9 = *(StatHUD *)((int)in_ECX[local_20 * 0x33 + 0x45] + 0x1470); if ((float)SVar9 == (float)SVar4) { *pSVar7 = SVar9; LAB_0084cff2: pSVar6 = in_ECX + local_20 * 0x33 + 0x55; SVar4 = *pSVar6; } else { SVar5 = pSVar7[4]; if (0x1e < (int)SVar5) { pSVar7[1] = (StatHUD)((float)SVar9 - (float)pSVar7[2]); if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } pSVar7[4] = SVar5; *pSVar7 = SVar9; goto LAB_0084cff2; } pSVar7[2] = SVar4; pSVar7[1] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)pSVar7[3] <= ABS((float)SVar9 - (float)SVar4)) { pSVar7[4] = (StatHUD)0x96; } pSVar6 = in_ECX + local_20 * 0x33 + 0x55; *pSVar7 = SVar9; SVar4 = *pSVar6; } SVar9 = (StatHUD)(*(float *)((int)in_ECX[local_20 * 0x33 + 0x45] + 0x1480) / 40.0); if ((float)SVar9 == (float)SVar4) { *pSVar6 = SVar9; LAB_0084d081: pSVar7 = in_ECX + local_20 * 0x33 + 0x5a; SVar4 = *pSVar7; } else { SVar5 = pSVar6[4]; if (0x1e < (int)SVar5) { pSVar6[1] = (StatHUD)((float)SVar9 - (float)pSVar6[2]); if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } pSVar6[4] = SVar5; *pSVar6 = SVar9; goto LAB_0084d081; } pSVar6[2] = SVar4; pSVar6[1] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)pSVar6[3] <= ABS((float)SVar9 - (float)SVar4)) { pSVar6[4] = (StatHUD)0x96; } pSVar7 = in_ECX + local_20 * 0x33 + 0x5a; *pSVar6 = SVar9; SVar4 = *pSVar7; } SVar9 = *(StatHUD *)((int)in_ECX[local_20 * 0x33 + 0x45] + 0x1464); if ((float)SVar9 == (float)SVar4) { *pSVar7 = SVar9; LAB_0084d10c: pSVar6 = in_ECX + local_20 * 0x33 + 0x5f; SVar4 = *pSVar6; } else { SVar5 = pSVar7[4]; if (0x1e < (int)SVar5) { pSVar7[1] = (StatHUD)((float)SVar9 - (float)pSVar7[2]); if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } pSVar7[4] = SVar5; *pSVar7 = SVar9; goto LAB_0084d10c; } pSVar7[2] = SVar4; pSVar7[1] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)pSVar7[3] <= ABS((float)SVar9 - (float)SVar4)) { pSVar7[4] = (StatHUD)0x96; } pSVar6 = in_ECX + local_20 * 0x33 + 0x5f; *pSVar7 = SVar9; SVar4 = *pSVar6; } bVar1 = true; SVar9 = *(StatHUD *)((int)in_ECX[local_20 * 0x33 + 0x45] + 0x156c); if ((float)SVar9 != (float)SVar4) { SVar5 = pSVar6[4]; if ((int)SVar5 < 0x1f) { pSVar6[2] = SVar4; pSVar6[1] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)pSVar6[3] <= ABS((float)SVar9 - (float)SVar4)) { pSVar6[4] = (StatHUD)0x96; } } else { pSVar6[1] = (StatHUD)((float)SVar9 - (float)pSVar6[2]); if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } pSVar6[4] = SVar5; } bVar1 = true; } } pGVar2 = g_game; *pSVar6 = SVar9; local_18 = (StatHUD)Room::GetDevilRoomChance(pGVar2->_room); if ((float)local_18 <= 0.0) { local_18 = (StatHUD)0x0; } if (1.0 <= (float)local_18) { local_18 = (StatHUD)0x3f800000; } bVar3 = Level::CanSpawnDevilRoom((Level *)g_game); if (bVar3 == 0) { local_18 = (StatHUD)0x0; } fVar8 = get_angel_room_chance(); if (*(char *)(in_ECX + 0xab) == '\0') { SVar4 = in_ECX[local_20 * 0x33 + 100]; SVar9 = (StatHUD)((1.0 - fVar8) * (float)local_18 * 100.0); if (!bVar1) { in_ECX[local_20 * 0x33 + 0x66] = SVar4; in_ECX[local_20 * 0x33 + 100] = SVar9; local_18 = (StatHUD)((float)local_18 * fVar8 * 100.0); goto LAB_0084d33e; } if ((float)SVar9 == (float)SVar4) { LAB_0084d460: local_1c = in_ECX + local_20 * 0x33 + 0x69; in_ECX[local_20 * 0x33 + 100] = SVar9; SVar4 = *local_1c; } else { SVar5 = in_ECX[local_20 * 0x33 + 0x68]; if (0x1e < (int)SVar5) { if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } in_ECX[local_20 * 0x33 + 0x68] = SVar5; in_ECX[local_20 * 0x33 + 0x65] = (StatHUD)((float)SVar9 - (float)in_ECX[local_20 * 0x33 + 0x66]); goto LAB_0084d460; } in_ECX[local_20 * 0x33 + 0x66] = SVar4; in_ECX[local_20 * 0x33 + 0x65] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)in_ECX[local_20 * 0x33 + 0x67] <= ABS((float)SVar9 - (float)SVar4)) { in_ECX[local_20 * 0x33 + 0x68] = (StatHUD)0x96; } local_1c = in_ECX + local_20 * 0x33 + 0x69; in_ECX[local_20 * 0x33 + 100] = SVar9; SVar4 = *local_1c; } local_18 = (StatHUD)((float)local_18 * fVar8 * 100.0); if ((float)local_18 == (float)SVar4) goto LAB_0084d4c3; LAB_0084d484: if ((int)local_1c[4] < 0x1f) { local_1c[2] = SVar4; local_1c[1] = (StatHUD)((float)local_18 - (float)SVar4); if ((float)local_1c[3] <= ABS((float)local_18 - (float)SVar4)) { local_1c[4] = (StatHUD)0x96; } } else { local_1c[1] = (StatHUD)((float)local_18 - (float)local_1c[2]); SVar4 = local_1c[4]; if ((int)local_1c[4] < 0x87) { SVar4 = local_24; } local_1c[4] = SVar4; } } else { SVar4 = in_ECX[local_20 * 0x33 + 100]; local_18 = (StatHUD)((float)local_18 * 100.0); if (bVar1) { if ((float)local_18 == (float)SVar4) { LAB_0084d2d1: local_1c = in_ECX + local_20 * 0x33 + 0x69; in_ECX[local_20 * 0x33 + 100] = local_18; SVar4 = *local_1c; } else { SVar9 = in_ECX[local_20 * 0x33 + 0x68]; if (0x1e < (int)SVar9) { if ((int)SVar9 < 0x87) { SVar9 = (StatHUD)0x87; } in_ECX[local_20 * 0x33 + 0x68] = SVar9; in_ECX[local_20 * 0x33 + 0x65] = (StatHUD)((float)local_18 - (float)in_ECX[local_20 * 0x33 + 0x66]); goto LAB_0084d2d1; } in_ECX[local_20 * 0x33 + 0x66] = SVar4; in_ECX[local_20 * 0x33 + 0x65] = (StatHUD)((float)local_18 - (float)SVar4); if ((float)in_ECX[local_20 * 0x33 + 0x67] <= ABS((float)local_18 - (float)SVar4)) { in_ECX[local_20 * 0x33 + 0x68] = (StatHUD)0x96; } in_ECX[local_20 * 0x33 + 100] = local_18; local_1c = in_ECX + local_20 * 0x33 + 0x69; SVar4 = *local_1c; } if ((float)local_18 != (float)SVar4) goto LAB_0084d484; } else { in_ECX[local_20 * 0x33 + 0x66] = SVar4; in_ECX[local_20 * 0x33 + 100] = local_18; LAB_0084d33e: local_1c = in_ECX + local_20 * 0x33 + 0x69; in_ECX[local_20 * 0x33 + 0x68] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x65] = (StatHUD)0x0; local_1c[2] = *local_1c; local_1c[1] = (StatHUD)0x0; local_1c[4] = (StatHUD)0x0; } } LAB_0084d4c3: *local_1c = local_18; pGVar2 = g_game; SVar4 = in_ECX[local_20 * 0x33 + 0x6e]; if (bVar1) { if ((float)SVar4 == 0.0) { LAB_0084d5c7: in_ECX[local_20 * 0x33 + 0x6e] = (StatHUD)0x0; pSVar6 = in_ECX + local_20 * 0x33 + 0x73; SVar4 = *pSVar6; } else { SVar9 = in_ECX[local_20 * 0x33 + 0x72]; if (0x1e < (int)SVar9) { if ((int)SVar9 < 0x87) { SVar9 = (StatHUD)0x87; } in_ECX[local_20 * 0x33 + 0x72] = SVar9; in_ECX[local_20 * 0x33 + 0x6f] = (StatHUD)(0.0 - (float)in_ECX[local_20 * 0x33 + 0x70]); goto LAB_0084d5c7; } in_ECX[local_20 * 0x33 + 0x70] = SVar4; in_ECX[local_20 * 0x33 + 0x6f] = (StatHUD)(0.0 - (float)SVar4); if ((float)in_ECX[local_20 * 0x33 + 0x71] <= ABS(0.0 - (float)SVar4)) { in_ECX[local_20 * 0x33 + 0x72] = (StatHUD)0x96; } in_ECX[local_20 * 0x33 + 0x6e] = (StatHUD)0x0; pSVar6 = in_ECX + local_20 * 0x33 + 0x73; SVar4 = *pSVar6; } SVar9 = (StatHUD)((g_game->_itemPool)._unkFloat674 * 100.0); if ((float)SVar9 != (float)SVar4) { SVar5 = pSVar6[4]; if ((int)SVar5 < 0x1f) { pSVar6[2] = SVar4; pSVar6[1] = (StatHUD)((float)SVar9 - (float)SVar4); if ((float)pSVar6[3] <= ABS((float)SVar9 - (float)SVar4)) { pSVar6[4] = (StatHUD)0x96; *pSVar6 = SVar9; goto LAB_0084d698; } } else { pSVar6[1] = (StatHUD)((float)SVar9 - (float)pSVar6[2]); if ((int)SVar5 < 0x87) { SVar5 = (StatHUD)0x87; } pSVar6[4] = SVar5; } } *pSVar6 = SVar9; } else { pSVar6 = in_ECX + local_20 * 0x33 + 0x73; in_ECX[local_20 * 0x33 + 0x70] = SVar4; in_ECX[local_20 * 0x33 + 0x6f] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x72] = (StatHUD)0x0; in_ECX[local_20 * 0x33 + 0x6e] = (StatHUD)0x0; fVar8 = (pGVar2->_itemPool)._unkFloat674; pSVar6[2] = *pSVar6; pSVar6[1] = (StatHUD)0x0; pSVar6[4] = (StatHUD)0x0; *pSVar6 = (StatHUD)(fVar8 * 100.0); } } } else if (in_ECX[local_20 * 0x33 + 0x45] == param_2) { in_ECX[local_20 * 0x33 + 0x45] = param_1; RecomputeStats(in_ECX,local_20,0xffffffff,(byte)local_20); } LAB_0084d698: local_20 = local_20 + 1; if (1 < local_20) { return; } } while( true ); } //@@ 0084d6b0 FUN_0084d6b0 void FUN_0084d6b0(char param_1) { float *pfVar1; float fVar2; float *pfVar3; float *in_ECX; float in_XMM1_Da; fVar2 = *in_ECX; if (param_1 == '\0') { in_ECX[2] = fVar2; in_ECX[1] = 0.0; in_ECX[4] = 0.0; *in_ECX = in_XMM1_Da; return; } if (in_XMM1_Da != fVar2) { pfVar1 = in_ECX + 4; if ((int)in_ECX[4] < 0x1f) { in_ECX[2] = fVar2; in_ECX[1] = in_XMM1_Da - fVar2; if (in_ECX[3] <= ABS(in_XMM1_Da - fVar2)) { *pfVar1 = 2.10195e-43; *in_ECX = in_XMM1_Da; return; } } else { pfVar3 = (float *)¶m_1; if (0x86 < (int)*pfVar1) { pfVar3 = pfVar1; } _param_1 = 1.89175e-43; in_ECX[1] = in_XMM1_Da - in_ECX[2]; *pfVar1 = *pfVar3; } } *in_ECX = in_XMM1_Da; return; } //@@ 0084d740 FUN_0084d740 byte * FUN_0084d740(void) { undefined4 in_ECX; switch(in_ECX) { case 0: return &DAT_00b1cdf0; case 1: return (byte *)"Right"; case 2: return (byte *)&DAT_00b1cde4; case 3: return &DAT_00b1cddc; case 4: return (byte *)"ShootLeft"; case 5: return (byte *)"ShootRight"; case 6: return (byte *)"ShootUp"; case 7: return (byte *)"ShootDown"; case 8: return &DAT_00b1ce1c; case 9: return &DAT_00b67800; case 10: return (byte *)"PillCard"; case 0xb: return &DAT_00b63f64; case 0xc: return (byte *)"Pause"; case 0xd: return &DAT_00b6d530; case 0xe: return (byte *)"MenuConfirm"; case 0xf: return (byte *)"MenuBack"; case 0x10: return (byte *)"FullScreen"; case 0x11: return &DAT_00b6e1ac; case 0x12: return (byte *)"Restart"; case 0x13: return (byte *)"JoinMultiplayer"; case 0x14: return (byte *)"MenuLeft"; case 0x15: return (byte *)"MenuRight"; case 0x16: return (byte *)"MenuUp"; case 0x17: return (byte *)"MenuDown"; case 0x18: return (byte *)"MenuLB"; case 0x19: return (byte *)"MenuRB"; case 0x1a: return (byte *)"MenuLT"; case 0x1b: return (byte *)"MenuRT"; case 0x1c: return (byte *)"MenuTab"; case 0x1d: return (byte *)"MenuEx"; case 0x1e: return (byte *)"EmoteMenu"; case 0x1f: return (byte *)"ToggleDescriptions"; default: KAGE_LogMessage(0x10,(byte *)"Unknown action specified\n"); return &s_empty; } } //@@ 0084d8b0 segment_intersect /* DB: line segment p1(XMM0,XMM1)-p2(XMM2,XMM3) vs q1(param_1,param_2)-q2(param_3,param_4): denominator cross product, |d|>1e-5, both t,u in [0,1]; writes the hit x to *ECX and y to *EDX when non-null and returns 1; Entity_Laser::update_laser uses the result to clip _endPoint */ undefined1 segment_intersect(float param_1,float param_2,float param_3,float param_4) { float *in_ECX; float *in_EDX; float in_XMM0_Da; float in_XMM1_Da; float fVar1; float in_XMM2_Da; float fVar2; float in_XMM3_Da; fVar1 = (param_2 - param_4) * (in_XMM0_Da - in_XMM2_Da) - (param_1 - param_3) * (in_XMM1_Da - in_XMM3_Da); if (1e-05 < ABS(fVar1)) { fVar2 = -((in_XMM1_Da - param_2) * (in_XMM0_Da - in_XMM2_Da) - (in_XMM0_Da - param_1) * (in_XMM1_Da - in_XMM3_Da)) / fVar1; fVar1 = ((in_XMM0_Da - param_1) * (param_2 - param_4) - (in_XMM1_Da - param_2) * (param_1 - param_3)) / fVar1; if ((((0.0 <= fVar2) && (fVar2 <= 1.0)) && (0.0 <= fVar1)) && (fVar1 <= 1.0)) { if (in_ECX != (float *)0x0) { if (fVar1 <= fVar2) { param_1 = (param_3 - param_1) * fVar2 + param_1; } else { param_1 = (in_XMM2_Da - in_XMM0_Da) * fVar1 + in_XMM0_Da; } *in_ECX = param_1; } if (in_EDX != (float *)0x0) { if (fVar2 < fVar1) { *in_EDX = (in_XMM3_Da - in_XMM1_Da) * fVar1 + in_XMM1_Da; return 1; } *in_EDX = (param_4 - param_2) * fVar2 + param_2; } return 1; } } return 0; } //@@ 0084da20 InfoDisplayText::constructor /* DB: ? zeroes an empty std::string at +0 (size +0x10, cap 0xf) and dwords +0x18..+0x64; callers HUD::update_item_info, InfoDisplay::describe_pickup_stats and the InfoDisplay XML parsers prototype: db/protos.zhl */ void * __thiscall InfoDisplayText::constructor(void *this) { *(undefined4 *)this = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0xf; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 0; *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 0; *(undefined4 *)((int)this + 0x38) = 0; *(undefined4 *)((int)this + 0x3c) = 0; *(undefined4 *)((int)this + 0x40) = 0; *(undefined4 *)((int)this + 0x44) = 0; *(undefined4 *)((int)this + 0x48) = 0; *(undefined4 *)((int)this + 0x4c) = 0; *(undefined4 *)((int)this + 0x50) = 0; *(undefined4 *)((int)this + 0x54) = 0; *(undefined4 *)((int)this + 0x58) = 0; *(undefined4 *)((int)this + 0x5c) = 0; *(undefined4 *)((int)this + 0x60) = 0; *(undefined4 *)((int)this + 100) = 0; return this; } //@@ 0084dad0 InfoDisplayEntry::InfoDisplayEntry /* DB: ? ctor: zeroes a vector at +0, empty std::string at +8 (cap 0xf), more zeroed vectors to +0x44, then FUN_006efa40 inits 10 x {0,0,0,0.01f,0} records; built per in InfoDisplay::load_collectibles_xml / info_display_xml_parse_trinkets before the push, and once in Manager::constructor prototype: db/protos.zhl */ void * __thiscall InfoDisplayEntry::InfoDisplayEntry(void *this) { uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02f81; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x1c) = 0xf; *(undefined1 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 0; *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 0; *(undefined4 *)((int)this + 0x38) = 0; *(undefined4 *)((int)this + 0x3c) = 0; *(undefined4 *)((int)this + 0x40) = 0; local_8 = 3; *(undefined1 *)((int)this + 0x44) = 0; FUN_006efa40(uVar1); ExceptionList = local_10; return this; } //@@ 0084db90 FUN_0084db90 void FUN_0084db90(void) { int in_ECX; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); return; } //@@ 0084dbc0 FUN_0084dbc0 void FUN_0084dbc0(void) { char *in_ECX; FID_conflict__Tidy(in_ECX + 0x54); FID_conflict__Tidy(in_ECX + 0x48); FID_conflict__Tidy(in_ECX + 0x3c); FID_conflict__Tidy(in_ECX + 0x30); FID_conflict__Tidy(in_ECX + 0x24); FID_conflict__Tidy(in_ECX + 0x18); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 0084dc00 StatsPanel::add_stat_line /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called 4x from each StatsPanel::set (lines Speed/Tears/Damage/Range/Shot Speed); formats the delta as '+%.2f' (green) or '%.2f' (red), InfoDisplayText::constructor, pushes a 104-byte InfoDisplayEntry into the vector at +0x20 */ void StatsPanel::add_stat_line(void) { byte bVar1; char *format; void **ppvVar2; int in_ECX; byte *pbVar3; void *pvVar4; uint uVar5; float in_XMM1_Da; void *local_1c0; void *pvStack_1bc; void *pvStack_1b8; void *pvStack_1b4; undefined8 local_1b0; undefined1 local_1a8 [12]; undefined1 local_19c [12]; undefined1 local_190 [12]; undefined1 local_184 [12]; undefined1 local_178 [12]; undefined1 local_16c [20]; void *local_158; undefined4 local_148; uint local_144; void *local_140 [4]; undefined4 local_130; uint local_12c; byte local_128 [260]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_128 + 0x124; local_14 = 0xffffffff; puStack_18 = &LAB_00b02fbb; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_128 + 0x118); ExceptionList = &local_1c; if (in_XMM1_Da != 0.0) { format = "+%.2f"; if (in_XMM1_Da < 0.0) { format = "%.2f"; } sprintf_s(local_128,0x100,(byte *)format); InfoDisplayText::constructor(&local_1c0); local_14 = 0; pbVar3 = local_128; local_130 = 0; local_12c = 0xf; local_140[0] = (void *)0x0; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign((char *)local_140,local_128,(int)pbVar3 - (int)(local_128 + 1)); local_14 = CONCAT31(local_14._1_3_,1); ppvVar2 = (void **)FUN_00651d50(); if (&local_1c0 != ppvVar2) { std::string::_Tidy_deallocate((char *)&local_1c0); local_1c0 = *ppvVar2; pvStack_1bc = ppvVar2[1]; pvStack_1b8 = ppvVar2[2]; pvStack_1b4 = ppvVar2[3]; local_1b0 = *(undefined8 *)(ppvVar2 + 4); ppvVar2[4] = (void *)0x0; ppvVar2[5] = (void *)0xf; *(char *)ppvVar2 = '\0'; } if (0xf < local_144) { uVar5 = local_144 + 1; pvVar4 = local_158; if (0xfff < uVar5) { pvVar4 = *(void **)((int)local_158 + -4); uVar5 = local_144 + 0x24; if (0x1f < (uint)((int)local_158 + (-4 - (int)pvVar4))) goto LAB_0084ddc1; } operator_delete(pvVar4,uVar5); } local_14 = local_14 & 0xffffff00; local_148 = 0; local_144 = 0xf; local_158 = (void *)((uint)local_158 & 0xffffff00); if (0xf < local_12c) { uVar5 = local_12c + 1; pvVar4 = local_140[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)local_140[0] + -4); uVar5 = local_12c + 0x24; if (0x1f < (uint)((int)local_140[0] + (-4 - (int)pvVar4))) { LAB_0084ddc1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } pvVar4 = *(void **)(in_ECX + 0x24); if (pvVar4 == *(void **)(in_ECX + 0x28)) { std::vector<104byte>::_Emplace_reallocate(pvVar4,&local_1c0); } else { InfoDisplayEntry::copy_constructor(pvVar4,&local_1c0); *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 0x68; } FID_conflict__Tidy(local_16c); FID_conflict__Tidy(local_178); FID_conflict__Tidy(local_184); FID_conflict__Tidy(local_190); FID_conflict__Tidy(local_19c); FID_conflict__Tidy(local_1a8); if (0xf < local_1b0._4_4_) { uVar5 = local_1b0._4_4_ + 1; pvVar4 = local_1c0; if (0xfff < uVar5) { pvVar4 = *(void **)((int)local_1c0 + -4); uVar5 = local_1b0._4_4_ + 0x24; if (0x1f < (uint)((int)local_1c0 + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } } ExceptionList = local_1c; return; } //@@ 0084dea0 StatsPanel::set /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? twin of 0084e200 StatsPanel::set body: +4 enabled, mode +0 -> FUN_0084ea90/FUN_0084eb10, arg stored at +0x48, stat lines " Speed"/" Tears"/" Damage"/" Range"/" Shot Speed" via FUN_0084dc00); called from HUD::update_item_info */ void StatsPanel::set(int param_1,undefined4 param_2) { uint uVar1; int *in_ECX; int *extraout_ECX; int *extraout_ECX_00; int *piVar2; void *pvVar3; undefined8 local_2c; undefined2 local_24; undefined1 local_22; undefined1 local_21; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03025; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX[1] != 0) { in_ECX[0x12] = param_1; local_14 = uVar1; if (*in_ECX == 0) { FUN_0084ea90(1); piVar2 = extraout_ECX; } else { piVar2 = in_ECX; if (*in_ECX == 1) { FUN_0084eb10(1,param_2); piVar2 = extraout_ECX_00; } } FUN_00856840(piVar2,uVar1); in_ECX[9] = in_ECX[8]; local_18 = 0xf; local_1c = 6; local_2c = CONCAT17(local_2c._7_1_,0x646565705320); local_8 = 0; add_stat_line(&local_2c); local_8 = 0xffffffff; if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = (void *)local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)(void *)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)local_2c + (-4 - (int)pvVar3))) goto LAB_0084e1d4; } operator_delete(pvVar3,uVar1); } local_18 = 0xf; local_1c = 6; local_2c = CONCAT17(local_2c._7_1_,0x737261655420); local_8 = 1; add_stat_line(&local_2c); local_8 = 0xffffffff; if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = (void *)local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)(void *)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)local_2c + (-4 - (int)pvVar3))) goto LAB_0084e1d4; } operator_delete(pvVar3,uVar1); } local_18 = 0xf; local_1c = 7; local_2c = 0x6567616d614420; local_8 = 2; add_stat_line(&local_2c); local_8 = 0xffffffff; if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = (void *)local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)(void *)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)local_2c + (-4 - (int)pvVar3))) goto LAB_0084e1d4; } operator_delete(pvVar3,uVar1); } local_18 = 0xf; local_1c = 6; local_2c = CONCAT17(local_2c._7_1_,0x65676e615220); local_8 = 3; add_stat_line(&local_2c); local_8 = 0xffffffff; if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = (void *)local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)(void *)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)local_2c + (-4 - (int)pvVar3))) goto LAB_0084e1d4; } operator_delete(pvVar3,uVar1); } local_24 = 0x6565; local_18 = 0xf; local_1c = 0xb; local_2c = 0x705320746f685320; local_22 = 100; local_21 = 0; local_8 = 4; add_stat_line(&local_2c); local_8 = 0xffffffff; if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = (void *)local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)(void *)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)local_2c + (-4 - (int)pvVar3))) goto LAB_0084e1d4; } operator_delete(pvVar3,uVar1); } local_18 = 0xf; local_1c = 5; local_2c = CONCAT26(local_2c._6_2_,0x6b63754c20); local_8 = 5; add_stat_line(&local_2c); if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = (void *)local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)(void *)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)(void *)local_2c + (-4 - (int)pvVar3))) { LAB_0084e1d4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar1); } } ExceptionList = local_10; return; } //@@ 0084e200 StatsPanel::set /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=panel (+4 enabled, +0 mode 0/1 -> FUN_0084ea90/FUN_0084eb10), stores arg at +0x48, rebuilds stat lines " Speed"," Tears"," Damage"," Range"," Shot Speed" via FUN_0084dc00; from PauseScreen::update_items_page and 008d3360 PauseScreen::update_items_menu void StatsPanel::set(int param_1,undefined4 param_2) { undefined1 *puVar1; uint uVar2; int *in_ECX; int *extraout_ECX; int *extraout_ECX_00; int *piVar3; void *pvVar4; undefined8 local_3c; undefined2 local_34; undefined1 local_32; undefined1 local_31; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b03085; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; if (in_ECX[1] != 0) { in_ECX[0x12] = param_1; local_24 = uVar2; if (*in_ECX == 0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); FUN_0084ea90(0); piVar3 = extraout_ECX; puVar1 = puStack_20; } else { piVar3 = in_ECX; puVar1 = (undefined1 *)((int)register0x00000010 + -4); if (*in_ECX == 1) { FUN_0084eb10(0,param_2); piVar3 = extraout_ECX_00; puVar1 = puStack_20; } } puStack_20 = puVar1; FUN_00856840(piVar3,uVar2); in_ECX[9] = in_ECX[8]; local_28 = 0xf; local_2c = 6; local_3c = CONCAT17(local_3c._7_1_,0x646565705320); local_14 = 0; add_stat_line(&local_3c); local_14 = 0xffffffff; if (0xf < local_28) { uVar2 = local_28 + 1; pvVar4 = (void *)local_3c; if (0xfff < uVar2) { pvVar4 = *(void **)((int)(void *)local_3c + -4); uVar2 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar4))) goto LAB_0084e572; } operator_delete(pvVar4,uVar2); } local_28 = 0xf; local_2c = 6; local_3c = CONCAT17(local_3c._7_1_,0x737261655420); local_14 = 1; add_stat_line(&local_3c); local_14 = 0xffffffff; if (0xf < local_28) { uVar2 = local_28 + 1; pvVar4 = (void *)local_3c; if (0xfff < uVar2) { pvVar4 = *(void **)((int)(void *)local_3c + -4); uVar2 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar4))) goto LAB_0084e572; } operator_delete(pvVar4,uVar2); } local_28 = 0xf; local_2c = 7; local_3c = 0x6567616d614420; local_14 = 2; add_stat_line(&local_3c); local_14 = 0xffffffff; if (0xf < local_28) { uVar2 = local_28 + 1; pvVar4 = (void *)local_3c; if (0xfff < uVar2) { pvVar4 = *(void **)((int)(void *)local_3c + -4); uVar2 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar4))) goto LAB_0084e572; } operator_delete(pvVar4,uVar2); } local_28 = 0xf; local_2c = 6; local_3c = CONCAT17(local_3c._7_1_,0x65676e615220); local_14 = 3; add_stat_line(&local_3c); local_14 = 0xffffffff; if (0xf < local_28) { uVar2 = local_28 + 1; pvVar4 = (void *)local_3c; if (0xfff < uVar2) { pvVar4 = *(void **)((int)(void *)local_3c + -4); uVar2 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar4))) goto LAB_0084e572; } operator_delete(pvVar4,uVar2); } local_34 = 0x6565; local_28 = 0xf; local_2c = 0xb; local_3c = 0x705320746f685320; local_32 = 100; local_31 = 0; local_14 = 4; add_stat_line(&local_3c); local_14 = 0xffffffff; if (0xf < local_28) { uVar2 = local_28 + 1; pvVar4 = (void *)local_3c; if (0xfff < uVar2) { pvVar4 = *(void **)((int)(void *)local_3c + -4); uVar2 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar4))) goto LAB_0084e572; } operator_delete(pvVar4,uVar2); } local_28 = 0xf; local_2c = 5; local_3c = CONCAT26(local_3c._6_2_,0x6b63754c20); local_14 = 5; add_stat_line(&local_3c); if (0xf < local_28) { uVar2 = local_28 + 1; pvVar4 = (void *)local_3c; if (0xfff < uVar2) { pvVar4 = *(void **)((int)(void *)local_3c + -4); uVar2 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar4))) { LAB_0084e572: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } } ExceptionList = local_1c; return; } //@@ 0084e5b0 InfoDisplayItem::is_line_visible /* DB: (lineIndex, player, flags) over the item's 0x68-byte description lines (ECX+0x2c vector): player-type include/exclude lists (+0x18/+0x24 vs _playerType), required/excluded collectibles (HasCollectible) and trinkets (HasTrinket), achievement gate +0x60 (Manager+0x4c flags, < 0x282), then a mode/flag check; PlayerHUD::render_pocket_item_info, render_item_info_text prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall InfoDisplayItem::is_line_visible(void *this,int lineIndex,Entity_Player *player,uint flags) { byte bVar1; int *piVar2; uint uVar3; int iVar4; uint uVar5; int iVar6; if ((uint)lineIndex < (uint)((*(int *)((int)this + 0x30) - *(int *)((int)this + 0x2c)) / 0x68)) { if (*(int *)((int)this + 4) == 0) { return 1; } uVar3 = 0; iVar6 = lineIndex * 0x68 + *(int *)((int)this + 0x2c); piVar2 = *(int **)(iVar6 + 0x18); uVar5 = *(int *)(iVar6 + 0x1c) - (int)piVar2 >> 2; if (uVar5 != 0) { do { if (*piVar2 == player->_playerType) goto LAB_0084e62d; uVar3 = uVar3 + 1; piVar2 = piVar2 + 1; } while (uVar3 < uVar5); if (uVar5 != 0) { return 0; } } LAB_0084e62d: uVar3 = 0; piVar2 = *(int **)(iVar6 + 0x24); uVar5 = *(int *)(iVar6 + 0x28) - (int)piVar2 >> 2; if (uVar5 != 0) { do { if (*piVar2 == player->_playerType) { return 0; } uVar3 = uVar3 + 1; piVar2 = piVar2 + 1; } while (uVar3 < uVar5); } uVar3 = 0; iVar4 = *(int *)(iVar6 + 0x30); if (*(int *)(iVar6 + 0x34) - iVar4 >> 2 != 0) { do { bVar1 = Entity_Player::HasCollectible(player,*(int *)(iVar4 + uVar3 * 4),0); if (bVar1 == 0) { return 0; } uVar3 = uVar3 + 1; iVar4 = *(int *)(iVar6 + 0x30); } while (uVar3 < (uint)(*(int *)(iVar6 + 0x34) - iVar4 >> 2)); } uVar3 = 0; iVar4 = *(int *)(iVar6 + 0x3c); if (*(int *)(iVar6 + 0x40) - iVar4 >> 2 != 0) { do { bVar1 = Entity_Player::HasCollectible(player,*(int *)(iVar4 + uVar3 * 4),0); if (bVar1 != 0) { return 0; } uVar3 = uVar3 + 1; iVar4 = *(int *)(iVar6 + 0x3c); } while (uVar3 < (uint)(*(int *)(iVar6 + 0x40) - iVar4 >> 2)); } uVar3 = 0; iVar4 = *(int *)(iVar6 + 0x48); if (*(int *)(iVar6 + 0x4c) - iVar4 >> 2 != 0) { do { bVar1 = Entity_Player::HasTrinket(player,*(uint *)(iVar4 + uVar3 * 4),0); if (bVar1 == 0) { return 0; } uVar3 = uVar3 + 1; iVar4 = *(int *)(iVar6 + 0x48); } while (uVar3 < (uint)(*(int *)(iVar6 + 0x4c) - iVar4 >> 2)); } uVar3 = 0; iVar4 = *(int *)(iVar6 + 0x54); if (*(int *)(iVar6 + 0x58) - iVar4 >> 2 != 0) { do { bVar1 = Entity_Player::HasTrinket(player,*(uint *)(iVar4 + uVar3 * 4),0); if (bVar1 != 0) { return 0; } uVar3 = uVar3 + 1; iVar4 = *(int *)(iVar6 + 0x54); } while (uVar3 < (uint)(*(int *)(iVar6 + 0x58) - iVar4 >> 2)); } uVar3 = *(uint *)(iVar6 + 0x60); if ((uVar3 == 0) || ((uVar3 != 0xfffffffe && (((int)uVar3 < 0 || ((uVar3 < 0x282 && (((g_manager->_persistentGameData)._achievements[uVar3] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))))))) { iVar6 = *(int *)(iVar6 + 100); if (iVar6 == 0) { return 1; } iVar4 = *(int *)this; if (iVar4 == 0) { return 1; } if (iVar4 == 1) { if (iVar6 == 1) { return (byte)(flags >> 0xf) & 1; } if (iVar6 == 2) { return ~(byte)(flags >> 0xf) & 1; } return 1; } if (iVar4 == 2) { bVar1 = (byte)(flags >> 0xb); if (iVar6 != 1) { if (iVar6 != 2) { return 1; } bVar1 = ~bVar1; } return bVar1 & 1; } if (iVar4 != 3) { return 1; } if (iVar6 != 1) { return 1; } if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { return 1; } } } return 0; } //@@ 0084e820 FUN_0084e820 int FUN_0084e820(Entity_Player *param_1,uint param_2) { int iVar1; void *pvVar2; void *pvVar3; int *piVar4; char cVar5; byte bVar6; int *in_ECX; int iVar7; uint uVar8; int local_c; iVar1 = in_ECX[1]; if (iVar1 == 0) { return (in_ECX[0xc] - in_ECX[0xb]) / 0x68; } iVar7 = 0; uVar8 = 0; local_c = 0; pvVar2 = (g_manager->_itemConfig)._playerForms._end; pvVar3 = (g_manager->_itemConfig)._playerForms._begin; if ((int)pvVar2 - (int)pvVar3 >> 2 != 0) { do { if (((-1 < (int)uVar8) && ((int)uVar8 < (int)pvVar2 - (int)pvVar3 >> 2)) && (piVar4 = *(int **)((int)pvVar3 + uVar8 * 4), piVar4 != (int *)0x0)) { if (piVar4[2] == 0 && piVar4[3] == 0) { if (*piVar4 == 0xf) { if (*in_ECX == 0) { if ((iVar1 == 0x23) || (iVar1 == 0x106)) { LAB_0084e8f3: local_c = iVar7 + 1; iVar7 = local_c; } } else if ((*in_ECX == 1) && (iVar1 == 0x30)) goto LAB_0084e8f3; } } else { if (*in_ECX == 0) { cVar5 = FUN_0072fe80(piVar4[2],piVar4[3]); } else { if (*in_ECX != 1) goto LAB_0084e8fa; cVar5 = FUN_0072fec0(piVar4[2],piVar4[3]); } iVar7 = local_c; if (cVar5 != '\0') { goto LAB_0084e8f3; } } } LAB_0084e8fa: uVar8 = uVar8 + 1; } while (uVar8 < (uint)((int)pvVar2 - (int)pvVar3 >> 2)); } iVar1 = (in_ECX[9] - in_ECX[8]) / 0x68; iVar7 = iVar1 + local_c; if (iVar1 == 0) { iVar7 = local_c; } uVar8 = 0; iVar1 = in_ECX[0xc] - in_ECX[0xb] >> 0x1f; if ((in_ECX[0xc] - in_ECX[0xb]) / 0x68 + iVar1 != iVar1) { do { bVar6 = InfoDisplayItem::is_line_visible(in_ECX,uVar8,param_1,param_2); if (bVar6 != 0) { iVar7 = iVar7 + 1; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)((in_ECX[0xc] - in_ECX[0xb]) / 0x68)); } return iVar7; } //@@ 0084e9d0 FUN_0084e9d0 void FUN_0084e9d0(undefined4 param_1) { int in_ECX; if (*(int *)(in_ECX + 0x48) != 0) { FUN_0084d6b0(param_1); FUN_0084d6b0(param_1); FUN_0084d6b0(param_1); FUN_0084d6b0(param_1); FUN_0084d6b0(param_1); FUN_0084d6b0(param_1); } return; } //@@ 0084ea90 FUN_0084ea90 void FUN_0084ea90(undefined1 param_1) { uint *puVar1; int iVar2; int in_ECX; if (*(int *)(in_ECX + 0x48) != 0) { FUN_0084e9d0(0); iVar2 = *(int *)(in_ECX + 0x48); *(undefined4 *)(iVar2 + 0x2ef4) = *(undefined4 *)(in_ECX + 4); *(undefined1 *)(iVar2 + 0x2ef0) = param_1; puVar1 = (uint *)(*(int *)(in_ECX + 0x48) + 0x1574); *puVar1 = *puVar1 | 0x41f; Entity_Player::EvaluateItems(); FUN_0084e9d0(1); iVar2 = *(int *)(in_ECX + 0x48); *(undefined4 *)(iVar2 + 0x2ef4) = 0; *(undefined1 *)(iVar2 + 0x2ef0) = 1; puVar1 = (uint *)(*(int *)(in_ECX + 0x48) + 0x1574); *puVar1 = *puVar1 | 0x41f; Entity_Player::EvaluateItems(); } return; } //@@ 0084eb10 FUN_0084eb10 void FUN_0084eb10(undefined1 param_1,int param_2) { uint *puVar1; int iVar2; uint uVar3; int in_ECX; if (*(int *)(in_ECX + 0x48) != 0) { FUN_0084e9d0(0); iVar2 = *(int *)(in_ECX + 0x48); uVar3 = *(uint *)(in_ECX + 4) | 0x8000; if (param_2 != 1) { uVar3 = *(uint *)(in_ECX + 4); } *(uint *)(iVar2 + 0x2ef8) = uVar3; *(undefined1 *)(iVar2 + 0x2ef0) = param_1; puVar1 = (uint *)(*(int *)(in_ECX + 0x48) + 0x1574); *puVar1 = *puVar1 | 0x41f; Entity_Player::EvaluateItems(); FUN_0084e9d0(1); iVar2 = *(int *)(in_ECX + 0x48); *(undefined4 *)(iVar2 + 0x2ef8) = 0; *(undefined1 *)(iVar2 + 0x2ef0) = 1; puVar1 = (uint *)(*(int *)(in_ECX + 0x48) + 0x1574); *puVar1 = *puVar1 | 0x41f; Entity_Player::EvaluateItems(); } return; } //@@ 0084eba0 InfoDisplay::load_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (path, mod): info_display.xml root nodes "collectibles"/"trinkets"/"pills"/"cards" (InfoDisplay::load_collectibles_xml, InfoDisplayConfig::parse_item_node); when not a mod clears the std::map trees at ECX+0/+0x18 first and walks glitched ids via Game _proceduralItemManager (+0x67758); callers Manager::load_configs and ModManager::LoadModContent */ void InfoDisplay::load_xml(byte *param_1,int param_2) { undefined4 *puVar1; qword qVar2; uint uVar3; void *pvVar4; byte *pbVar5; int *piVar6; int iVar7; byte *text; void *pvVar8; int *in_ECX; uint uVar9; qword *pqVar10; Game *pGVar11; uint uVar12; uint uVar13; byte isCaseSensitive; undefined4 *puVar14; byte *pbVar15; undefined1 auStack_1028c [48]; undefined1 auStack_1025c [65560]; undefined4 local_244; undefined4 local_240; byte local_23c [272]; undefined4 local_12c; undefined4 local_128; byte local_124 [272]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b030d6; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_124 + 0x120); ExceptionList = &local_10; uVar9 = -(uint)(param_2 != 0) & param_2 + 0xecU; local_14 = uVar3; if (param_2 == 0) { iVar7 = in_ECX[6]; piVar6 = in_ECX + 6; std::map::_Erase_tree(piVar6,*(undefined4 *)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; in_ECX[7] = 0; iVar7 = *in_ECX; std::map::_Erase_tree(in_ECX,*(undefined4 *)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; uVar12 = 0; in_ECX[1] = 0; uVar13 = 0; pGVar11 = g_game; do { if (pGVar11 == (Game *)0x0) { if (-1 < (int)uVar12) goto LAB_0084ec8b; } else { if ((int)uVar12 < 0) { if (((int)uVar12 < 0) && (pvVar4 = (pGVar11->_proceduralItemManager)._proceduralItems._begin, (int)~uVar12 < (int)(pGVar11->_proceduralItemManager)._proceduralItems._end - (int)pvVar4 >> 2)) { iVar7 = **(int **)((int)pvVar4 + (-4 - uVar13)); } else { iVar7 = 0; } } else { LAB_0084ec8b: pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 >> 2 <= (int)uVar12) goto LAB_0084ecbb; iVar7 = *(int *)(uVar13 + (int)pvVar4); } if (iVar7 != 0) { add_item_entry(iVar7,0); pGVar11 = g_game; } } LAB_0084ecbb: uVar13 = uVar13 + 4; uVar12 = uVar12 + 1; } while (uVar13 < 0xb74); iVar7 = in_ECX[2]; std::map::_Erase_tree(in_ECX + 2,*(undefined4 *)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; uVar12 = 0; in_ECX[3] = 0; do { pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(uVar12 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 >> 2) && (iVar7 = *(int *)((int)pvVar4 + (uVar12 & 0x7fff) * 4), iVar7 != 0)) { add_item_entry(iVar7,0); } uVar12 = uVar12 + 1; } while (uVar12 < 0xbe); iVar7 = *piVar6; std::map::_Erase_tree(piVar6,*(undefined4 *)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; uVar12 = 0; in_ECX[7] = 0; do { if (((-1 < (int)uVar12) && (pvVar4 = (g_manager->_itemConfig)._cards._begin, (int)uVar12 < (int)(g_manager->_itemConfig)._cards._end - (int)pvVar4 >> 2)) && (puVar1 = *(undefined4 **)((int)pvVar4 + uVar12 * 4), puVar1 != (undefined4 *)0x0)) { InfoDisplayEntry::InfoDisplayEntry(&local_12c); local_8 = 0; local_128 = *puVar1; pbVar5 = (byte *)(puVar1 + 2); local_12c = 0; if (local_124 != pbVar5) { if (0xf < (uint)puVar1[7]) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)local_124,pbVar5,puVar1[6]); } puVar14 = &local_12c; pvVar4 = (void *)FUN_00856100(puVar1); InfoDisplayEntry::operator_assign(pvVar4,puVar14); local_8 = 0xffffffff; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)local_124); } uVar12 = uVar12 + 1; } while (uVar12 < 0x62); iVar7 = in_ECX[4]; std::map::_Erase_tree(in_ECX + 4,*(undefined4 *)(iVar7 + 4)); *(int *)(iVar7 + 4) = iVar7; *(int *)iVar7 = iVar7; *(int *)(iVar7 + 8) = iVar7; uVar12 = 0; in_ECX[5] = 0; do { if (((-1 < (int)uVar12) && (pvVar4 = (g_manager->_itemConfig)._pillEffects._begin, (int)uVar12 < (int)(g_manager->_itemConfig)._pillEffects._end - (int)pvVar4 >> 2)) && (puVar1 = *(undefined4 **)((int)pvVar4 + uVar12 * 4), puVar1 != (undefined4 *)0x0)) { InfoDisplayEntry::InfoDisplayEntry(&local_244); local_8 = 2; local_240 = *puVar1; pbVar5 = (byte *)(puVar1 + 2); local_244 = 2; if (local_23c != pbVar5) { if (0xf < (uint)puVar1[7]) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)local_23c,pbVar5,puVar1[6]); } puVar14 = &local_244; pvVar4 = (void *)FUN_00856100(puVar1); InfoDisplayEntry::operator_assign(pvVar4,puVar14); local_8 = 0xffffffff; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)local_23c); } uVar12 = uVar12 + 1; } while (uVar12 < 0x32); } piVar6 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar6 != (int *)0x0) { iVar7 = (**(code **)(*piVar6 + 4))(uVar3); text = operator_new_tracked(iVar7 + 1); (**(code **)(*piVar6 + 0x14))(text,1,iVar7); text[iVar7] = 0; (**(code **)*piVar6)(1); FUN_00413b90(); local_8 = 4; pvVar4 = (void *)0x84ef9b; pbVar15 = text; rapidxml::xml_document::parse(auStack_1028c,text); pbVar5 = g_xmlParseError; isCaseSensitive = (byte)pbVar15; g_xmlParseError = (byte *)0x0; if (pbVar5 == (byte *)0x0) { pvVar8 = xml_node::first_node (auStack_1028c,(byte *)"collectibles",(int)pvVar4,isCaseSensitive); if (pvVar8 != (void *)0x0) { uVar3 = uVar9; load_collectibles_xml(pvVar8,uVar9); isCaseSensitive = (byte)uVar3; pvVar4 = pvVar8; } pvVar8 = xml_node::first_node(auStack_1028c,(byte *)"trinkets",(int)pvVar4,isCaseSensitive); if (pvVar8 != (void *)0x0) { info_display_xml_parse_trinkets(pvVar8,uVar9); isCaseSensitive = (byte)uVar9; pvVar4 = pvVar8; } pvVar8 = xml_node::first_node(auStack_1028c,(byte *)"pills",(int)pvVar4,isCaseSensitive); if (pvVar8 != (void *)0x0) { pvVar4 = (void *)0x84f017; info_display_xml_parse_pills(pvVar8); isCaseSensitive = (byte)pvVar8; } pvVar4 = xml_node::first_node(auStack_1028c,(byte *)"cards",(int)pvVar4,isCaseSensitive); if (pvVar4 != (void *)0x0) { InfoDisplayConfig::parse_item_node(pvVar4); } } if (text != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(text + -4); qVar2 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar3; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar2 < uVar3); free(text + -4); } local_8 = 6; xml_memory_pool::clear(auStack_1025c); } ExceptionList = local_10; return; } //@@ 0084f0a0 InfoDisplay::add_item_entry /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (ItemConfig_Item*, bool withText): builds InfoDisplayEntry (describe_pickup_stats, InfoDisplayText with the item description) and stores it in the per-id map (FUN_00856100 = map subscript); InfoDisplay::load_xml, glitched_collectible_render_gfx */ void InfoDisplay::add_item_entry(ItemConfig_Item *param_1,char param_2) { int *piVar1; void *pvVar2; undefined1 *extraout_ECX; undefined1 *extraout_ECX_00; char *this; std_string *psVar3; undefined4 *puVar4; undefined4 local_314; int local_310; char local_30c [40]; void *local_2e4; void *local_2e0; undefined4 local_1fc; int local_1f8; char local_1f4 [40]; void *local_1cc; void *local_1c8; char local_e4 [104]; char local_7c [104]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0312e; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_7c + 0x78); ExceptionList = &local_10; if (param_1 != (ItemConfig_Item *)0x0) { piVar1 = ¶m_1->id; if (param_1->type == 2) { InfoDisplayEntry::InfoDisplayEntry(&local_1fc); local_8 = 0; local_1f8 = *piVar1; local_1fc = 1; describe_pickup_stats(param_1,&local_1fc); if ((param_2 != '\0') && ((param_1->desc)._size != 0)) { InfoDisplayText::constructor(local_7c); psVar3 = ¶m_1->desc; local_8 = CONCAT31(local_8._1_3_,1); if ((std_string *)extraout_ECX != psVar3) { if (0xf < (param_1->desc)._capacity) { psVar3 = *(std_string **)psVar3->_buf; } std::string::assign(local_7c,(byte *)psVar3,(param_1->desc)._size); } if (local_1cc == local_1c8) { std::vector<104byte>::_Emplace_reallocate(local_1cc,local_7c); } else { InfoDisplayEntry::copy_constructor(local_1cc,local_7c); local_1cc = (void *)((int)local_1cc + 0x68); } local_8 = local_8 & 0xffffff00; FUN_0084dbc0(); } puVar4 = &local_1fc; pvVar2 = (void *)FUN_00856100(piVar1); InfoDisplayEntry::operator_assign(pvVar2,puVar4); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); this = local_1f4; } else { InfoDisplayEntry::InfoDisplayEntry(&local_314); local_8 = 2; local_310 = *piVar1; local_314 = 0; describe_pickup_stats(param_1,&local_314); if ((param_2 != '\0') && ((param_1->desc)._size != 0)) { InfoDisplayText::constructor(local_e4); psVar3 = ¶m_1->desc; local_8 = CONCAT31(local_8._1_3_,3); if ((std_string *)extraout_ECX_00 != psVar3) { if (0xf < (param_1->desc)._capacity) { psVar3 = *(std_string **)psVar3->_buf; } std::string::assign(local_e4,(byte *)psVar3,(param_1->desc)._size); } if (local_2e4 == local_2e0) { std::vector<104byte>::_Emplace_reallocate(local_2e4,local_e4); } else { InfoDisplayEntry::copy_constructor(local_2e4,local_e4); local_2e4 = (void *)((int)local_2e4 + 0x68); } local_8 = CONCAT31(local_8._1_3_,2); FUN_0084dbc0(); } puVar4 = &local_314; pvVar2 = (void *)FUN_00856100(piVar1); InfoDisplayEntry::operator_assign(pvVar2,puVar4); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); this = local_30c; } std::string::_Tidy_deallocate(this); } ExceptionList = local_10; return; } //@@ 0084f2e0 InfoDisplayEntry::operator_assign /* DB: ? copy-assign: 2 dwords, std::string at +8, three vectors (+0x20,+0x2c,+0x38 via FUN_008569a0), a byte at +0x44, then 0x33 dwords; used by InfoDisplay XML parsers (collectibles/trinkets/pills) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall InfoDisplayEntry::operator_assign(void *this,void *other) { byte *text; int iVar1; undefined4 *puVar2; undefined4 *puVar3; *(undefined4 *)this = *(undefined4 *)other; *(undefined4 *)((int)this + 4) = *(undefined4 *)((int)other + 4); text = (byte *)((int)other + 8); if ((byte *)((int)this + 8) != text) { if (0xf < *(uint *)((int)other + 0x1c)) { text = *(byte **)text; } std::string::assign((char *)((int)this + 8),text,*(uint *)((int)other + 0x18)); } if ((undefined4 *)((int)this + 0x20) != (undefined4 *)((int)other + 0x20)) { std::vector<104byte>::assign (*(undefined4 *)((int)other + 0x20),*(undefined4 *)((int)other + 0x24),other); } if ((undefined4 *)((int)this + 0x2c) != (undefined4 *)((int)other + 0x2c)) { std::vector<104byte>::assign (*(undefined4 *)((int)other + 0x2c),*(undefined4 *)((int)other + 0x30),other); } if ((undefined4 *)((int)this + 0x38) != (undefined4 *)((int)other + 0x38)) { std::vector<104byte>::assign (*(undefined4 *)((int)other + 0x38),*(undefined4 *)((int)other + 0x3c),other); } *(undefined1 *)((int)this + 0x44) = *(undefined1 *)((int)other + 0x44); puVar2 = (undefined4 *)((int)other + 0x48); puVar3 = (undefined4 *)((int)this + 0x48); for (iVar1 = 0x33; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } return this; } //@@ 0084f380 FUN_0084f380 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0084f380(undefined4 *param_1,char param_2) { byte *pbVar1; void *this; byte *extraout_ECX; undefined4 *other; undefined4 local_194; undefined4 local_190; byte local_18c [40]; void *local_164; void *local_160; char local_7c [104]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03178; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_7c + 0x78); ExceptionList = &local_10; if (param_1 != (undefined4 *)0x0) { InfoDisplayEntry::InfoDisplayEntry(&local_194); local_8 = 0; local_190 = *param_1; pbVar1 = (byte *)(param_1 + 2); local_194 = 0; if (local_18c != pbVar1) { if (0xf < (uint)param_1[7]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)local_18c,pbVar1,param_1[6]); } if ((param_2 != '\0') && (param_1[0xc] != 0)) { InfoDisplayText::constructor(local_7c); pbVar1 = (byte *)(param_1 + 8); local_8 = CONCAT31(local_8._1_3_,1); if (extraout_ECX != pbVar1) { if (0xf < (uint)param_1[0xd]) { pbVar1 = *(byte **)pbVar1; } std::string::assign(local_7c,pbVar1,param_1[0xc]); } if (local_164 == local_160) { std::vector<104byte>::_Emplace_reallocate(local_164,local_7c); } else { InfoDisplayEntry::copy_constructor(local_164,local_7c); local_164 = (void *)((int)local_164 + 0x68); } local_8 = local_8 & 0xffffff00; FUN_0084dbc0(); } other = &local_194; this = (void *)FUN_00856100(param_1); InfoDisplayEntry::operator_assign(this,other); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)local_18c); } ExceptionList = local_10; return; } //@@ 0084f4e0 FUN_0084f4e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0084f4e0(undefined4 *param_1,char param_2) { byte *pbVar1; void *this; byte *extraout_ECX; undefined4 *other; undefined4 local_194; undefined4 local_190; byte local_18c [40]; void *local_164; void *local_160; char local_7c [104]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03178; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_7c + 0x78); ExceptionList = &local_10; if (param_1 != (undefined4 *)0x0) { InfoDisplayEntry::InfoDisplayEntry(&local_194); local_8 = 0; local_190 = *param_1; pbVar1 = (byte *)(param_1 + 2); local_194 = 2; if (local_18c != pbVar1) { if (0xf < (uint)param_1[7]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)local_18c,pbVar1,param_1[6]); } if ((param_2 != '\0') && (param_1[0xc] != 0)) { InfoDisplayText::constructor(local_7c); pbVar1 = (byte *)(param_1 + 8); local_8 = CONCAT31(local_8._1_3_,1); if (extraout_ECX != pbVar1) { if (0xf < (uint)param_1[0xd]) { pbVar1 = *(byte **)pbVar1; } std::string::assign(local_7c,pbVar1,param_1[0xc]); } if (local_164 == local_160) { std::vector<104byte>::_Emplace_reallocate(local_164,local_7c); } else { InfoDisplayEntry::copy_constructor(local_164,local_7c); local_164 = (void *)((int)local_164 + 0x68); } local_8 = local_8 & 0xffffff00; FUN_0084dbc0(); } other = &local_194; this = (void *)FUN_00856100(param_1); InfoDisplayEntry::operator_assign(this,other); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)local_18c); } ExceptionList = local_10; return; } //@@ 0084f640 FUN_0084f640 int * FUN_0084f640(int param_1) { int *piVar1; int *in_ECX; undefined1 local_10 [8]; int local_8; std::set::find_node(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) != '\0') || (param_1 < *(int *)(local_8 + 0x10))) || (piVar1 = (int *)(local_8 + 0x14), local_8 == *in_ECX)) { piVar1 = in_ECX + 8; } return piVar1; } //@@ 0084f680 FUN_0084f680 int FUN_0084f680(uint param_1) { int in_ECX; uint uVar1; undefined1 local_10 [8]; int local_8; uVar1 = param_1 & 0xffff7fff; param_1 = uVar1; std::set::find_node(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) == '\0') && (*(int *)(local_8 + 0x10) <= (int)uVar1)) && (local_8 != *(int *)(in_ECX + 8))) { return local_8 + 0x14; } return in_ECX + 0x20; } //@@ 0084f6e0 FUN_0084f6e0 int FUN_0084f6e0(uint param_1) { int in_ECX; uint uVar1; undefined1 local_10 [8]; int local_8; uVar1 = param_1 & 0xfffff7ff; param_1 = uVar1; std::set::find_node(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) == '\0') && (*(int *)(local_8 + 0x10) <= (int)uVar1)) && (local_8 != *(int *)(in_ECX + 0x10))) { return local_8 + 0x14; } return in_ECX + 0x20; } //@@ 0084f740 FUN_0084f740 int FUN_0084f740(int param_1) { int iVar1; int in_ECX; undefined1 local_10 [8]; int local_8; std::set::find_node(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) != '\0') || (param_1 < *(int *)(local_8 + 0x10))) || (iVar1 = local_8 + 0x14, local_8 == *(int *)(in_ECX + 0x18))) { iVar1 = in_ECX + 0x20; } return iVar1; } //@@ 0084f780 InfoDisplay::describe_pickup_stats /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? builds description lines (" red heart", "Heals all red hearts", " soul heart", " black heart", " coin", " bomb", "empty red health") into a vector of 0x68-byte entries from a stats struct (+0x58..+0x6c); callers 0084f0a0 InfoDisplay::add_item_entry entry parser: achievement/collectible/info/notcollectible/player attrs), 00850480, 00851b20 prototype: db/protos.zhl, confirmed by RET 8 */ void InfoDisplay::describe_pickup_stats(ItemConfig_Item *item,void *outEntry) { undefined8 uVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; char *pcVar5; std_string *psVar6; undefined4 *puVar7; uint uVar8; undefined4 uVar9; int iVar10; char *this; void *pvVar11; uint uVar12; int value; int value_00; undefined4 local_228; undefined4 uStack_224; undefined4 uStack_220; undefined4 uStack_21c; undefined8 local_218; undefined4 local_1c0; undefined4 uStack_1bc; undefined4 uStack_1b8; undefined4 uStack_1b4; undefined8 local_1b0; undefined4 local_158; undefined4 uStack_154; undefined4 uStack_150; undefined4 uStack_14c; undefined8 local_148; std_string local_f0; char local_d8 [104]; void *local_70 [5]; uint local_5c; void *local_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined8 local_48; void *local_3c; char acStack_38 [4]; char acStack_34 [4]; char acStack_30 [4]; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_d8 + 0xd4; local_14 = 0xffffffff; puStack_18 = &LAB_00b03290; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_d8 + 200); if (item == (ItemConfig_Item *)0x0) { return; } iVar10 = *(int *)((int)outEntry + 0x30) - *(int *)((int)outEntry + 0x2c); ExceptionList = &local_1c; pcVar5 = local_d8 + 0xd4; if (iVar10 / 0x68 + (iVar10 >> 0x1f) != iVar10 >> 0x1f) { FUN_00856840(iVar10,local_24); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x2c); pcVar5 = puStack_20; } puStack_20 = pcVar5; psVar6 = ItemConfig_Item::GetLocalizedName(item,(std_string *)&local_3c,0x14); if ((std_string *)((int)outEntry + 8) != psVar6) { std::string::_Tidy_deallocate((char *)((int)outEntry + 8)); uVar9 = *(undefined4 *)(psVar6->_buf + 4); uVar3 = *(undefined4 *)(psVar6->_buf + 8); uVar4 = *(undefined4 *)(psVar6->_buf + 0xc); *(undefined4 *)((int)outEntry + 8) = *(undefined4 *)psVar6->_buf; *(undefined4 *)((int)outEntry + 0xc) = uVar9; *(undefined4 *)((int)outEntry + 0x10) = uVar3; *(undefined4 *)((int)outEntry + 0x14) = uVar4; *(undefined8 *)((int)outEntry + 0x18) = *(undefined8 *)&psVar6->_size; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; } if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar12); } iVar10 = item->addMaxhearts >> 1; if (0 < iVar10) { InfoDisplayText::constructor(local_d8); local_14 = 0; if (item->addHearts < item->addMaxhearts) { psVar6 = int_to_string((std_string *)local_70,value); local_14._0_1_ = 3; psVar6 = std_string_insert(psVar6,0,&DAT_00b6d15c,1); local_58 = *(void **)psVar6->_buf; uStack_54 = *(undefined4 *)(psVar6->_buf + 4); uStack_50 = *(undefined4 *)(psVar6->_buf + 8); uStack_4c = *(undefined4 *)(psVar6->_buf + 0xc); local_48._0_4_ = psVar6->_size; local_48._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 4; puVar7 = std::string::append((char *)&local_58,(byte *)" empty red health",0x11); local_3c = (void *)*puVar7; acStack_38 = (char [4])puVar7[1]; acStack_34 = (char [4])puVar7[2]; acStack_30 = (char [4])puVar7[3]; local_2c = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; FUN_004215a0((std_string *)&local_3c); if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 3; if (0xf < local_48._4_4_) { uVar12 = local_48._4_4_ + 1; pvVar11 = local_58; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_58 + -4); uVar8 = (int)local_58 + (-4 - (int)pvVar11); goto joined_r0x0084fb02; } goto LAB_0084f9b2; } } else { psVar6 = int_to_string((std_string *)local_70,value); local_14._0_1_ = 1; psVar6 = std_string_insert(psVar6,0,&DAT_00b6d15c,1); local_58 = *(void **)psVar6->_buf; uStack_54 = *(undefined4 *)(psVar6->_buf + 4); uStack_50 = *(undefined4 *)(psVar6->_buf + 8); uStack_4c = *(undefined4 *)(psVar6->_buf + 0xc); local_48._0_4_ = psVar6->_size; local_48._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 2; puVar7 = std::string::append((char *)&local_58,(byte *)" health",7); local_3c = (void *)*puVar7; acStack_38 = (char [4])puVar7[1]; acStack_34 = (char [4])puVar7[2]; acStack_30 = (char [4])puVar7[3]; local_2c = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; FUN_004215a0((std_string *)&local_3c); if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 1; if (0xf < local_48._4_4_) { uVar12 = local_48._4_4_ + 1; pvVar11 = local_58; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_58 + -4); uVar8 = (int)local_58 + (-4 - (int)pvVar11); joined_r0x0084fb02: uVar12 = local_48._4_4_ + 0x24; if (0x1f < uVar8) goto LAB_0084fa04; } LAB_0084f9b2: operator_delete(pvVar11,uVar12); } } local_14._0_1_ = 0; local_48 = 0xf00000000; local_58 = (void *)((uint)local_58 & 0xffffff00); if (0xf < local_5c) { uVar12 = local_5c + 1; pvVar11 = local_70[0]; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_70[0] + -4); uVar12 = local_5c + 0x24; if (0x1f < (uint)((int)local_70[0] + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,local_d8); } else { InfoDisplayEntry::copy_constructor(pvVar11,local_d8); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } local_14 = 0xffffffff; FUN_0084dbc0(); } iVar2 = item->addHearts; if (0 < iVar2) { if (iVar2 < 0x18) { iVar10 = (iVar2 >> 1) - iVar10; if (iVar10 < 1) goto LAB_0084fd11; InfoDisplayText::constructor(local_d8); local_14 = 6; psVar6 = int_to_string((std_string *)local_70,value_00); local_14._0_1_ = 7; FUN_00856390(psVar6); local_14._0_1_ = 8; uVar9 = FUN_0060c790(" red heart"); FUN_004215a0(uVar9); if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 7; local_2c._0_4_ = 0; local_2c._4_4_ = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_48._4_4_) { uVar12 = local_48._4_4_ + 1; pvVar11 = local_58; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_58 + -4); uVar12 = local_48._4_4_ + 0x24; if (0x1f < (uint)((int)local_58 + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 6; local_48 = 0xf00000000; local_58 = (void *)((uint)local_58 & 0xffffff00); if (0xf < local_5c) { uVar12 = local_5c + 1; pvVar11 = local_70[0]; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_70[0] + -4); uVar12 = local_5c + 0x24; if (0x1f < (uint)((int)local_70[0] + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } if (iVar10 != 1) { std::string::append(local_d8,&DAT_00b6614c,1); } FUN_00856280(local_d8); } else { InfoDisplayText::constructor(local_d8); local_14 = 5; std::string::assign(this,(byte *)"Heals all red hearts",0x14); pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,local_d8); } else { InfoDisplayEntry::copy_constructor(pvVar11,local_d8); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } } local_14 = 0xffffffff; FUN_0084dbc0(); } LAB_0084fd11: if (0 < item->addSoulHearts) { InfoDisplayText::constructor(&local_158); local_14 = 9; psVar6 = int_to_string((std_string *)local_70,item->addSoulHearts / 2); local_14._0_1_ = 10; psVar6 = std_string_insert(psVar6,0,&DAT_00b6d15c,1); local_3c = *(void **)psVar6->_buf; acStack_38 = *(char (*) [4])(psVar6->_buf + 4); acStack_34 = *(char (*) [4])(psVar6->_buf + 8); acStack_30 = *(char (*) [4])(psVar6->_buf + 0xc); local_2c._0_4_ = psVar6->_size; local_2c._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 0xb; puVar7 = std::string::append((char *)&local_3c,(byte *)" soul heart",0xb); uStack_50 = *puVar7; uStack_4c = puVar7[1]; local_48 = *(undefined8 *)(puVar7 + 2); uVar1 = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; std::string::_Tidy_deallocate((char *)&local_158); local_158 = uStack_50; uStack_154 = uStack_4c; uStack_150 = (undefined4)local_48; uStack_14c = local_48._4_4_; local_14._0_1_ = 10; local_148 = uVar1; if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 9; local_2c._0_4_ = 0; local_2c._4_4_ = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_5c) { uVar12 = local_5c + 1; pvVar11 = local_70[0]; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_70[0] + -4); uVar12 = local_5c + 0x24; if (0x1f < (uint)((int)local_70[0] + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } if (item->addSoulHearts != 2) { std::string::append((char *)&local_158,&DAT_00b6614c,1); } pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,&local_158); } else { InfoDisplayEntry::copy_constructor(pvVar11,&local_158); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } local_14 = 0xffffffff; FUN_0084dbc0(); } if (0 < item->addBlackHearts) { InfoDisplayText::constructor(&local_1c0); local_14 = 0xc; psVar6 = int_to_string((std_string *)local_70,item->addBlackHearts / 2); local_14._0_1_ = 0xd; psVar6 = std_string_insert(psVar6,0,&DAT_00b6d15c,1); local_3c = *(void **)psVar6->_buf; acStack_38 = *(char (*) [4])(psVar6->_buf + 4); acStack_34 = *(char (*) [4])(psVar6->_buf + 8); acStack_30 = *(char (*) [4])(psVar6->_buf + 0xc); local_2c._0_4_ = psVar6->_size; local_2c._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 0xe; puVar7 = std::string::append((char *)&local_3c,(byte *)" black heart",0xc); uStack_50 = *puVar7; uStack_4c = puVar7[1]; local_48 = *(undefined8 *)(puVar7 + 2); uVar1 = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; std::string::_Tidy_deallocate((char *)&local_1c0); local_1c0 = uStack_50; uStack_1bc = uStack_4c; uStack_1b8 = (undefined4)local_48; uStack_1b4 = local_48._4_4_; local_14._0_1_ = 0xd; local_1b0 = uVar1; if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 0xc; local_2c._0_4_ = 0; local_2c._4_4_ = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_5c) { uVar12 = local_5c + 1; pvVar11 = local_70[0]; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_70[0] + -4); uVar12 = local_5c + 0x24; if (0x1f < (uint)((int)local_70[0] + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } if (item->addBlackHearts != 2) { std::string::append((char *)&local_1c0,&DAT_00b6614c,1); } pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,&local_1c0); } else { InfoDisplayEntry::copy_constructor(pvVar11,&local_1c0); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } local_14 = 0xffffffff; FUN_0084dbc0(); } if (0 < item->addBombs) { InfoDisplayText::constructor(&local_228); local_14 = 0xf; psVar6 = int_to_string((std_string *)local_70,item->addBombs); local_14._0_1_ = 0x10; psVar6 = std_string_insert(psVar6,0,&DAT_00b6d15c,1); local_3c = *(void **)psVar6->_buf; acStack_38 = *(char (*) [4])(psVar6->_buf + 4); acStack_34 = *(char (*) [4])(psVar6->_buf + 8); acStack_30 = *(char (*) [4])(psVar6->_buf + 0xc); local_2c._0_4_ = psVar6->_size; local_2c._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 0x11; puVar7 = std::string::append((char *)&local_3c,(byte *)" bomb",5); uStack_50 = *puVar7; uStack_4c = puVar7[1]; local_48 = *(undefined8 *)(puVar7 + 2); uVar1 = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; std::string::_Tidy_deallocate((char *)&local_228); local_228 = uStack_50; uStack_224 = uStack_4c; uStack_220 = (undefined4)local_48; uStack_21c = local_48._4_4_; local_14._0_1_ = 0x10; local_218 = uVar1; if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 0xf; local_2c._0_4_ = 0; local_2c._4_4_ = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_5c) { uVar12 = local_5c + 1; pvVar11 = local_70[0]; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_70[0] + -4); uVar12 = local_5c + 0x24; if (0x1f < (uint)((int)local_70[0] + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } if (1 < item->addBombs) { std::string::append((char *)&local_228,&DAT_00b6614c,1); } pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,&local_228); } else { InfoDisplayEntry::copy_constructor(pvVar11,&local_228); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } local_14 = 0xffffffff; FUN_0084dbc0(); } if (0 < item->addKeys) { InfoDisplayText::constructor(local_d8); local_14 = 0x12; psVar6 = int_to_string((std_string *)local_70,item->addKeys); local_14._0_1_ = 0x13; psVar6 = std_string_insert(psVar6,0,&DAT_00b6d15c,1); local_3c = *(void **)psVar6->_buf; acStack_38 = *(char (*) [4])(psVar6->_buf + 4); acStack_34 = *(char (*) [4])(psVar6->_buf + 8); acStack_30 = *(char (*) [4])(psVar6->_buf + 0xc); local_2c._0_4_ = psVar6->_size; local_2c._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 0x14; puVar7 = std::string::append((char *)&local_3c,&DAT_00b6e3ac,4); local_58 = (void *)*puVar7; uStack_54 = puVar7[1]; uStack_50 = puVar7[2]; uStack_4c = puVar7[3]; local_48 = *(undefined8 *)(puVar7 + 4); puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; FUN_004215a0(&local_58); if (0xf < local_48._4_4_) { uVar12 = local_48._4_4_ + 1; pvVar11 = local_58; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_58 + -4); uVar12 = local_48._4_4_ + 0x24; if (0x1f < (uint)((int)local_58 + (-4 - (int)pvVar11))) goto LAB_0084fa04; } operator_delete(pvVar11,uVar12); } local_14._0_1_ = 0x13; if (0xf < local_2c._4_4_) { uVar12 = local_2c._4_4_ + 1; pvVar11 = local_3c; if (0xfff < uVar12) { pvVar11 = *(void **)((int)local_3c + -4); uVar12 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar11))) { LAB_0084fa04: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar12); } local_2c._0_4_ = 0; local_2c._4_4_ = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); local_14 = CONCAT31(local_14._1_3_,0x12); std::string::_Tidy_deallocate((char *)local_70); if (1 < item->addKeys) { std::string::append(local_d8,&DAT_00b6614c,1); } pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,local_d8); } else { InfoDisplayEntry::copy_constructor(pvVar11,local_d8); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } local_14 = 0xffffffff; FUN_0084dbc0(); } if (0 < item->addCoins) { InfoDisplayText::constructor(local_d8); local_14 = 0x15; psVar6 = int_to_string(&local_f0,item->addCoins); local_14._0_1_ = 0x16; FUN_00856390(psVar6); local_14._0_1_ = 0x17; uVar9 = FUN_0060c790(" coin"); FUN_004215a0(uVar9); std::string::_Tidy_deallocate((char *)local_70); std::string::_Tidy_deallocate((char *)&local_58); local_14 = CONCAT31(local_14._1_3_,0x15); std::string::_Tidy_deallocate(local_f0._buf); if (1 < item->addCoins) { std::string::append(local_d8,&DAT_00b6614c,1); } pvVar11 = *(void **)((int)outEntry + 0x30); if (pvVar11 == *(void **)((int)outEntry + 0x34)) { std::vector<104byte>::_Emplace_reallocate(pvVar11,local_d8); } else { InfoDisplayEntry::copy_constructor(pvVar11,local_d8); *(int *)((int)outEntry + 0x30) = *(int *)((int)outEntry + 0x30) + 0x68; } FUN_0084dbc0(); } ExceptionList = local_1c; return; } //@@ 00850480 InfoDisplay::load_collectibles_xml /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? info_display.xml 'collectibles' node (caller 0084eba0 InfoDisplay::load_xml collectibles/trinkets/pills/cards); collectible id/info/text with player/notplayer/collectible/trinket/achievement conditions */ void InfoDisplay::load_collectibles_xml(void *param_1,int *param_2) { byte bVar1; Game *pGVar2; Manager *pMVar3; int *piVar4; byte *pbVar5; int *piVar6; void *pvVar7; void *pvVar8; ItemConfig_Item *item; int *piVar9; char *pcVar10; byte *pbVar11; uint uVar12; int iVar13; uint uVar14; byte *pbVar15; char *pcVar16; undefined4 *puVar17; int in_stack_fffffdc4; byte in_stack_fffffdc8; undefined1 local_220 [8]; int local_218; undefined4 *local_214; int *local_20c; int *local_208; int local_204; int *local_200; int *local_1fc; int local_1f8; int *local_1f4; int *local_1f0; int local_1ec; int *local_1e8; int *local_1e4; int local_1e0; void *local_1dc; char *local_1d8; char *local_1d4; int local_1d0; char *local_1cc; char *local_1c8; int local_1c4; int *local_1c0; int *local_1bc; uint local_1b8; undefined4 *local_1b4; int *local_1b0; undefined1 local_1ac [8]; char local_1a4 [272]; void *local_94 [4]; undefined4 local_84; uint local_80; void *local_7c; undefined4 *puStack_78; undefined4 *puStack_74; void *pvStack_70; undefined4 *local_6c; undefined4 *puStack_68; void *pvStack_64; undefined4 *puStack_60; undefined4 *local_5c; void *pvStack_58; undefined4 *puStack_54; undefined4 *puStack_50; void *local_4c; undefined4 *puStack_48; undefined4 *puStack_44; void *pvStack_40; undefined4 *local_3c; undefined4 *puStack_38; int iStack_34; int iStack_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00b0334d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_1dc = xml_node::first_node (param_1,(byte *)"collectible",in_stack_fffffdc4,in_stack_fffffdc8); do { if (local_1dc == (void *)0x0) { ExceptionList = local_10; return; } pbVar15 = s_id; do { pbVar11 = pbVar15; pbVar15 = pbVar11 + 1; } while (*pbVar15 != 0); for (puVar17 = *(undefined4 **)((int)local_1dc + 0x20); puVar17 != (undefined4 *)0x0; puVar17 = (undefined4 *)puVar17[6]) { pbVar15 = (byte *)*puVar17; if (pbVar15 == (byte *)0x0) { pbVar5 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar5 = (byte *)puVar17[2]; } if (pbVar5 == pbVar11 + -0xb1bfef) { pbVar5 = pbVar5 + (int)pbVar15; if (pbVar5 <= pbVar15) goto LAB_0085052e; iVar13 = (int)s_id - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar5 <= pbVar15) goto LAB_0085052e; } } } puVar17 = (undefined4 *)0x0; LAB_0085052e: pbVar15 = &g_xmlNullStr; if ((byte *)puVar17[1] != (byte *)0x0) { pbVar15 = (byte *)puVar17[1]; } piVar6 = (int *)atoi((char *)pbVar15); local_1b0 = piVar6; if (param_2 == (int *)0x0) { LAB_0085058d: local_1c0 = piVar6; pvVar7 = InfoDisplayEntry::InfoDisplayEntry(local_1ac); local_8 = (void *)0x0; pvVar8 = (void *)FUN_00856100(&local_1c0); InfoDisplayEntry::operator_assign(pvVar8,pvVar7); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate(local_1a4); local_214 = (undefined4 *)FUN_00856100(&local_1c0); pMVar3 = g_manager; pGVar2 = g_game; *local_214 = 0; local_214[1] = local_1c0; if (pGVar2 == (Game *)0x0) { if (-1 < (int)local_1c0) goto LAB_00850660; } else { if ((int)local_1c0 < 0) { if (((int)local_1c0 < 0) && (pvVar7 = (pGVar2->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)local_1c0 < (int)(pGVar2->_proceduralItemManager)._proceduralItems._end - (int)pvVar7 >> 2)) { item = (ItemConfig_Item *)**(undefined4 **)((int)pvVar7 + ~(uint)local_1c0 * 4); } else { item = (ItemConfig_Item *)0x0; } } else { LAB_00850660: pvVar7 = (pMVar3->_itemConfig)._collectibles._begin; if ((int)(pMVar3->_itemConfig)._collectibles._end - (int)pvVar7 >> 2 <= (int)local_1c0) goto LAB_00851abd; item = *(ItemConfig_Item **)((int)pvVar7 + (int)local_1c0 * 4); } if (item != (ItemConfig_Item *)0x0) { describe_pickup_stats(item,local_214); pcVar16 = "info"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); for (local_1b4 = *(undefined4 **)((int)local_1dc + 0x18); local_1b4 != (undefined4 *)0x0; local_1b4 = (undefined4 *)local_1b4[0xb]) { pbVar15 = (byte *)*local_1b4; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b4[2]; } if (pcVar16 == pcVar10 + -0xb6d1e3) { pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar11 <= pbVar15) goto joined_r0x00850705; iVar13 = (int)&DAT_00b6d1e4 - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto joined_r0x00850705; } } } local_1b4 = (undefined4 *)0x0; joined_r0x00850705: if (local_1b4 != (undefined4 *)0x0) { local_84 = 0; local_80 = 0xf; local_94[0] = (void *)0x0; local_7c = (void *)0x0; puStack_78 = (undefined4 *)0x0; puStack_74 = (undefined4 *)0x0; pvStack_70 = (void *)0x0; local_6c = (undefined4 *)0x0; puStack_68 = (undefined4 *)0x0; pvStack_64 = (void *)0x0; puStack_60 = (undefined4 *)0x0; local_5c = (undefined4 *)0x0; pvStack_58 = (void *)0x0; puStack_54 = (undefined4 *)0x0; puStack_50 = (undefined4 *)0x0; local_4c = (void *)0x0; puStack_48 = (undefined4 *)0x0; puStack_44 = (undefined4 *)0x0; pvStack_40 = (void *)0x0; local_3c = (undefined4 *)0x0; puStack_38 = (undefined4 *)0x0; iStack_34 = 0; iStack_30 = 0; local_8._0_1_ = 1; local_8._1_3_ = 0; pcVar16 = "text"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); for (puVar17 = (undefined4 *)local_1b4[8]; puVar17 != (undefined4 *)0x0; puVar17 = (undefined4 *)puVar17[6]) { pbVar15 = (byte *)*puVar17; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)puVar17[2]; } if (pcVar16 == pcVar10 + -0xb6e37b) { pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar11 <= pbVar15) goto LAB_008507a7; iVar13 = (int)&DAT_00b6e37c - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_008507a7; } } } puVar17 = (undefined4 *)0x0; LAB_008507a7: pbVar15 = &g_xmlNullStr; if ((byte *)puVar17[1] != (byte *)0x0) { pbVar15 = (byte *)puVar17[1]; } pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_94,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); pcVar16 = "player"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00850803: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb66eeb) break; pbVar11 = pbVar15 + (int)pcVar16; if (pbVar15 < pbVar11) { iVar13 = (int)"player" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00850833; } break; } LAB_00850833: local_1e8 = (int *)0x0; local_1e4 = (int *)0x0; local_1e0 = 0; local_8._0_1_ = 2; pcVar16 = "player"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb66eeb) break; LAB_008508c0: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_008508cd: local_1c = 0; pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 3; string_split(&local_1e8); local_8._0_1_ = 2; if (0xf < local_18) { uVar14 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar14 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_00851b02; } operator_delete(pvVar7,uVar14); } uVar14 = 0; local_1bc = local_1e8; local_1b8 = ((int)local_1e4 - (int)local_1e8) / 0x18; piVar6 = local_1e8; if (local_1b8 != 0) { do { puVar17 = puStack_78; piVar9 = piVar6; if (0xf < (uint)piVar6[5]) { piVar9 = (int *)*piVar6; } local_1b0 = (int *)atoi((char *)piVar9); if (puVar17 == puStack_74) { std::vector::_Emplace_reallocate(puVar17,&local_1b0); } else { *puVar17 = local_1b0; puStack_78 = puVar17 + 1; } uVar14 = uVar14 + 1; piVar6 = piVar6 + 6; } while (uVar14 < local_1b8); } piVar4 = local_1bc; piVar9 = local_1e4; local_8._0_1_ = 1; piVar6 = local_1bc; if (local_1bc != (int *)0x0) { for (; piVar6 != piVar9; piVar6 = piVar6 + 6) { uVar14 = piVar6[5]; if (0xf < uVar14) { pvVar7 = (void *)*piVar6; uVar12 = uVar14 + 1; pvVar8 = pvVar7; if (0xfff < uVar12) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00851b02; } operator_delete(pvVar8,uVar12); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar14 = ((local_1e0 - (int)piVar4) / 0x18) * 0x18; piVar6 = piVar4; if (0xfff < uVar14) { piVar6 = (int *)piVar4[-1]; uVar14 = uVar14 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar4 + (-4 - (int)piVar6))) goto LAB_00851b02; } operator_delete(piVar6,uVar14); local_1e8 = (int *)0x0; local_1e4 = (int *)0x0; local_1e0 = 0; } goto LAB_00850aac; } } pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"player" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_008508cd; } goto LAB_008508c0; } goto LAB_008508cd; } LAB_00850aac: pcVar16 = "notplayer"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00850ad0: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb6e383) goto LAB_00850b4b; pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"notplayer" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00850b00; } goto LAB_00850b4b; } LAB_00850b00: local_1f4 = (int *)0x0; local_1f0 = (int *)0x0; local_1ec = 0; local_8._0_1_ = 4; pcVar16 = "notplayer"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb6e383) break; LAB_00850b8e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_00850b9b: local_1c = 0; pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 5; string_split(&local_1f4); local_8._0_1_ = 4; if (0xf < local_18) { uVar14 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar14 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_00851b02; } operator_delete(pvVar7,uVar14); } uVar14 = 0; local_1b0 = local_1f4; local_1b8 = ((int)local_1f0 - (int)local_1f4) / 0x18; piVar6 = local_1f4; if (local_1b8 != 0) { do { puVar17 = local_6c; piVar9 = piVar6; if (0xf < (uint)piVar6[5]) { piVar9 = (int *)*piVar6; } local_1bc = (int *)atoi((char *)piVar9); if (puVar17 == puStack_68) { std::vector::_Emplace_reallocate(puVar17,&local_1bc); } else { *puVar17 = local_1bc; local_6c = puVar17 + 1; } uVar14 = uVar14 + 1; piVar6 = piVar6 + 6; } while (uVar14 < local_1b8); } piVar4 = local_1b0; piVar9 = local_1f0; local_8._0_1_ = 1; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { for (; piVar6 != piVar9; piVar6 = piVar6 + 6) { uVar14 = piVar6[5]; if (0xf < uVar14) { pvVar7 = (void *)*piVar6; uVar12 = uVar14 + 1; pvVar8 = pvVar7; if (0xfff < uVar12) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00851b02; } operator_delete(pvVar8,uVar12); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar14 = ((local_1ec - (int)piVar4) / 0x18) * 0x18; piVar6 = piVar4; if (0xfff < uVar14) { piVar6 = (int *)piVar4[-1]; uVar14 = uVar14 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar4 + (-4 - (int)piVar6))) goto LAB_00851b02; } operator_delete(piVar6,uVar14); local_1f4 = (int *)0x0; local_1f0 = (int *)0x0; local_1ec = 0; } goto LAB_00850d7c; } } pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"notplayer" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00850b9b; } goto LAB_00850b8e; } goto LAB_00850b9b; } LAB_00850d7c: pcVar16 = "collectible"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00850da0: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb6e397) goto LAB_00850e1b; pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"collectible" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00850dd0; } goto LAB_00850e1b; } LAB_00850dd0: local_200 = (int *)0x0; local_1fc = (int *)0x0; local_1f8 = 0; local_8._0_1_ = 6; pcVar16 = "collectible"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb6e397) break; LAB_00850e5e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_00850e6b: local_1c = 0; pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 7; string_split(&local_200); local_8._0_1_ = 6; if (0xf < local_18) { uVar14 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar14 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_00851b02; } operator_delete(pvVar7,uVar14); } uVar14 = 0; local_1b0 = local_200; local_1b8 = ((int)local_1fc - (int)local_200) / 0x18; piVar6 = local_200; if (local_1b8 != 0) { do { puVar17 = puStack_60; piVar9 = piVar6; if (0xf < (uint)piVar6[5]) { piVar9 = (int *)*piVar6; } local_1bc = (int *)atoi((char *)piVar9); if (puVar17 == local_5c) { std::vector::_Emplace_reallocate(puVar17,&local_1bc); } else { *puVar17 = local_1bc; puStack_60 = puVar17 + 1; } uVar14 = uVar14 + 1; piVar6 = piVar6 + 6; } while (uVar14 < local_1b8); } piVar4 = local_1b0; piVar9 = local_1fc; local_8._0_1_ = 1; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { for (; piVar6 != piVar9; piVar6 = piVar6 + 6) { uVar14 = piVar6[5]; if (0xf < uVar14) { pvVar7 = (void *)*piVar6; uVar12 = uVar14 + 1; pvVar8 = pvVar7; if (0xfff < uVar12) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00851b02; } operator_delete(pvVar8,uVar12); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar14 = ((local_1f8 - (int)piVar4) / 0x18) * 0x18; piVar6 = piVar4; if (0xfff < uVar14) { piVar6 = (int *)piVar4[-1]; uVar14 = uVar14 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar4 + (-4 - (int)piVar6))) goto LAB_00851b02; } operator_delete(piVar6,uVar14); local_200 = (int *)0x0; local_1fc = (int *)0x0; local_1f8 = 0; } goto LAB_0085104c; } } pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"collectible" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00850e6b; } goto LAB_00850e5e; } goto LAB_00850e6b; } LAB_0085104c: pcVar16 = "notcollectible"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00851070: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb6e35f) goto LAB_008510eb; pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"notcollectible" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_008510a0; } goto LAB_008510eb; } LAB_008510a0: local_20c = (int *)0x0; local_208 = (int *)0x0; local_204 = 0; local_8._0_1_ = 8; pcVar16 = "notcollectible"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb6e35f) break; LAB_0085112e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_0085113b: local_1c = 0; pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 9; string_split(&local_20c); local_8._0_1_ = 8; if (0xf < local_18) { uVar14 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar14 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_00851b02; } operator_delete(pvVar7,uVar14); } uVar14 = 0; local_1b0 = local_20c; local_1b8 = ((int)local_208 - (int)local_20c) / 0x18; piVar6 = local_20c; if (local_1b8 != 0) { do { puVar17 = puStack_54; piVar9 = piVar6; if (0xf < (uint)piVar6[5]) { piVar9 = (int *)*piVar6; } local_1bc = (int *)atoi((char *)piVar9); if (puVar17 == puStack_50) { std::vector::_Emplace_reallocate(puVar17,&local_1bc); } else { *puVar17 = local_1bc; puStack_54 = puVar17 + 1; } uVar14 = uVar14 + 1; piVar6 = piVar6 + 6; } while (uVar14 < local_1b8); } piVar4 = local_1b0; piVar9 = local_208; local_8._0_1_ = 1; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { for (; piVar6 != piVar9; piVar6 = piVar6 + 6) { uVar14 = piVar6[5]; if (0xf < uVar14) { pvVar7 = (void *)*piVar6; uVar12 = uVar14 + 1; pvVar8 = pvVar7; if (0xfff < uVar12) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00851b02; } operator_delete(pvVar8,uVar12); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar14 = ((local_204 - (int)piVar4) / 0x18) * 0x18; piVar6 = piVar4; if (0xfff < uVar14) { piVar6 = (int *)piVar4[-1]; uVar14 = uVar14 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar4 + (-4 - (int)piVar6))) goto LAB_00851b02; } operator_delete(piVar6,uVar14); local_20c = (int *)0x0; local_208 = (int *)0x0; local_204 = 0; } goto LAB_0085131c; } } pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"notcollectible" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_0085113b; } goto LAB_0085112e; } goto LAB_0085113b; } LAB_0085131c: pcVar16 = "trinket"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00851340: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb66fcf) goto LAB_008513bb; pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"trinket" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00851370; } goto LAB_008513bb; } LAB_00851370: local_1cc = (char *)0x0; local_1c8 = (char *)0x0; local_1c4 = 0; local_8._0_1_ = 10; pcVar16 = "trinket"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb66fcf) break; LAB_008513fe: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_0085140b: local_1c = 0; pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 0xb; string_split(&local_1cc); local_8._0_1_ = 10; if (0xf < local_18) { uVar14 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar14 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_00851b02; } operator_delete(pvVar7,uVar14); } uVar14 = 0; local_1b8 = ((int)local_1c8 - (int)local_1cc) / 0x18; if (local_1b8 != 0) { pcVar16 = local_1cc; do { puVar17 = puStack_48; pcVar10 = pcVar16; if (0xf < *(uint *)(pcVar16 + 0x14)) { pcVar10 = *(char **)pcVar16; } local_1bc = (int *)atoi(pcVar10); if (puVar17 == puStack_44) { std::vector::_Emplace_reallocate(puVar17,&local_1bc); } else { *puVar17 = local_1bc; puStack_48 = puVar17 + 1; } uVar14 = uVar14 + 1; pcVar16 = pcVar16 + 0x18; } while (uVar14 < local_1b8); } pcVar10 = local_1c8; local_8._0_1_ = 1; pcVar16 = local_1cc; if (local_1cc != (char *)0x0) { for (; pcVar16 != pcVar10; pcVar16 = pcVar16 + 0x18) { std::string::_Tidy_deallocate(pcVar16); } deallocate(local_1cc,(local_1c4 - (int)local_1cc) / 0x18); local_1cc = (char *)0x0; local_1c8 = (char *)0x0; local_1c4 = 0; } goto LAB_00851588; } } pbVar11 = pbVar15 + (int)pcVar16; if (pbVar15 < pbVar11) { iVar13 = (int)"trinket" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_0085140b; } goto LAB_008513fe; } goto LAB_0085140b; } LAB_00851588: pcVar16 = "nottrinket"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_008515b0: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb6e36f) goto LAB_0085162b; pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"nottrinket" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_008515e0; } goto LAB_0085162b; } LAB_008515e0: local_1d8 = (char *)0x0; local_1d4 = (char *)0x0; local_1d0 = 0; local_8._0_1_ = 0xc; pcVar16 = "nottrinket"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb6e36f) break; LAB_0085166e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_0085167b: local_1c = 0; pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar11 = pbVar15; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar15,(int)pbVar11 - (int)(pbVar15 + 1)); local_8._0_1_ = 0xd; string_split(&local_1d8); local_8._0_1_ = 0xc; if (0xf < local_18) { uVar14 = local_18 + 1; pvVar7 = local_2c[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_2c[0] + -4); uVar14 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar7))) goto LAB_00851b02; } operator_delete(pvVar7,uVar14); } uVar14 = 0; local_1b8 = ((int)local_1d4 - (int)local_1d8) / 0x18; if (local_1b8 != 0) { pcVar16 = local_1d8; do { puVar17 = local_3c; pcVar10 = pcVar16; if (0xf < *(uint *)(pcVar16 + 0x14)) { pcVar10 = *(char **)pcVar16; } local_1bc = (int *)atoi(pcVar10); if (puVar17 == puStack_38) { std::vector::_Emplace_reallocate(puVar17,&local_1bc); } else { *puVar17 = local_1bc; local_3c = puVar17 + 1; } uVar14 = uVar14 + 1; pcVar16 = pcVar16 + 0x18; } while (uVar14 < local_1b8); } pcVar10 = local_1d4; local_8._0_1_ = 1; pcVar16 = local_1d8; if (local_1d8 != (char *)0x0) { for (; pcVar16 != pcVar10; pcVar16 = pcVar16 + 0x18) { std::string::_Tidy_deallocate(pcVar16); } deallocate(local_1d8,(local_1d0 - (int)local_1d8) / 0x18); local_1d8 = (char *)0x0; local_1d4 = (char *)0x0; local_1d0 = 0; } goto LAB_008517f8; } } pbVar11 = pbVar15 + (int)pcVar16; if (pbVar15 < pbVar11) { iVar13 = (int)"nottrinket" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_0085167b; } goto LAB_0085166e; } goto LAB_0085167b; } LAB_008517f8: pcVar16 = "achievement"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00851820: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb66fab) goto LAB_00851872; pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"achievement" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00851850; } goto LAB_00851872; } LAB_00851850: pcVar16 = "achievement"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb66fab) break; LAB_008518ae: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_008518bb: pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } iStack_34 = atoi((char *)pbVar15); goto LAB_008518db; } } pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)"achievement" - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_008518bb; } goto LAB_008518ae; } goto LAB_008518bb; } LAB_008518db: pcVar16 = "tag"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar6 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00851900: pbVar15 = (byte *)*piVar6; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)piVar6[2]; } if (pcVar16 != pcVar10 + -0xb6e3b3) goto LAB_00851952; pbVar11 = pbVar15 + (int)pcVar16; if (pbVar15 < pbVar11) { iVar13 = (int)&DAT_00b6e3b4 - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_00851930; } goto LAB_00851952; } LAB_00851930: pcVar16 = "tag"; do { pcVar10 = pcVar16; pcVar16 = pcVar10 + 1; } while (*pcVar16 != '\0'); while( true ) { pbVar15 = (byte *)*local_1b0; if (pbVar15 == (byte *)0x0) { pcVar16 = (char *)0x0; pbVar15 = &g_xmlNullStr; } else { pcVar16 = (char *)local_1b0[2]; } if (pcVar16 == pcVar10 + -0xb6e3b3) break; LAB_0085198e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_0085199b: pbVar15 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar15 = (byte *)local_1b0[1]; } iStack_30 = atoi((char *)pbVar15); goto LAB_008519b5; } } pbVar11 = (byte *)(pcVar16 + (int)pbVar15); if (pbVar15 < pbVar11) { iVar13 = (int)&DAT_00b6e3b4 - (int)pbVar15; while (*pbVar15 == pbVar15[iVar13]) { pbVar15 = pbVar15 + 1; if (pbVar11 <= pbVar15) goto LAB_0085199b; } goto LAB_0085198e; } goto LAB_0085199b; } LAB_008519b5: puVar17 = local_214; pvVar7 = (void *)local_214[0xc]; if (pvVar7 == (void *)local_214[0xd]) { std::vector<104byte>::_Emplace_reallocate(pvVar7,local_94); } else { InfoDisplayEntry::copy_constructor(pvVar7,local_94); puVar17[0xc] = puVar17[0xc] + 0x68; } local_1b4 = (undefined4 *)local_1b4[0xb]; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (pvStack_40 != (void *)0x0) { deallocate(pvStack_40,(int)puStack_38 - (int)pvStack_40 >> 2); } if (local_4c != (void *)0x0) { deallocate(local_4c,(int)puStack_44 - (int)local_4c >> 2); } if (pvStack_58 != (void *)0x0) { deallocate(pvStack_58,(int)puStack_50 - (int)pvStack_58 >> 2); } if (pvStack_64 != (void *)0x0) { deallocate(pvStack_64,(int)local_5c - (int)pvStack_64 >> 2); } if (pvStack_70 != (void *)0x0) { deallocate(pvStack_70,(int)puStack_68 - (int)pvStack_70 >> 2); } if (local_7c != (void *)0x0) { deallocate(local_7c,(int)puStack_74 - (int)local_7c >> 2); } if (0xf < local_80) { uVar14 = local_80 + 1; pvVar7 = local_94[0]; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_94[0] + -4); uVar14 = local_80 + 0x24; if (0x1f < (uint)((int)local_94[0] + (-4 - (int)pvVar7))) { LAB_00851b02: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar14); } goto joined_r0x00850705; } goto LAB_00851acb; } } LAB_00851abd: std::map::erase(&local_1c0); } else { std::set::find_node(local_220,&local_1b0); if (((*(char *)(local_218 + 0xd) == '\0') && (*(int *)(local_218 + 0x10) <= (int)piVar6)) && (local_218 != *param_2)) { piVar6 = *(int **)(local_218 + 0x14); goto LAB_0085058d; } } LAB_00851acb: local_1dc = *(void **)((int)local_1dc + 0x2c); } while( true ); piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_00850aac; goto LAB_00850803; LAB_00850b4b: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_00850d7c; goto LAB_00850ad0; LAB_00850e1b: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_0085104c; goto LAB_00850da0; LAB_008510eb: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_0085131c; goto LAB_00851070; LAB_008513bb: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_00851588; goto LAB_00851340; LAB_0085162b: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_008517f8; goto LAB_008515b0; LAB_00851872: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_008518db; goto LAB_00851820; LAB_00851952: piVar6 = (int *)piVar6[6]; if (piVar6 == (int *)0x0) goto LAB_008519b5; goto LAB_00851900; } //@@ 00851b20 info_display_xml_parse_trinkets /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from info_display.xml loader 0084eba0 InfoDisplay::load_xml first_node("trinkets"); reads id/tag/text/info/achievement/notplayer/nottrinket attrs */ void info_display_xml_parse_trinkets(void *param_1,int param_2) { byte bVar1; ItemConfig_Item *item; Manager *pMVar2; int *piVar3; byte *pbVar4; int *piVar5; void *pvVar6; void *pvVar7; int *piVar8; char *pcVar9; byte *pbVar10; uint uVar11; int iVar12; uint uVar13; byte *pbVar14; char *pcVar15; undefined4 *puVar16; int in_stack_fffffdc4; byte in_stack_fffffdc8; undefined1 local_220 [8]; int local_218; undefined4 *local_214; int *local_20c; int *local_208; int local_204; int *local_200; int *local_1fc; int local_1f8; int *local_1f4; int *local_1f0; int local_1ec; int *local_1e8; int *local_1e4; int local_1e0; void *local_1dc; char *local_1d8; char *local_1d4; int local_1d0; char *local_1cc; char *local_1c8; int local_1c4; uint local_1c0; int *local_1bc; uint local_1b8; undefined4 *local_1b4; int *local_1b0; undefined1 local_1ac [8]; char local_1a4 [272]; void *local_94 [4]; undefined4 local_84; uint local_80; void *local_7c; undefined4 *puStack_78; undefined4 *puStack_74; void *pvStack_70; undefined4 *local_6c; undefined4 *puStack_68; void *pvStack_64; undefined4 *puStack_60; undefined4 *local_5c; void *pvStack_58; undefined4 *puStack_54; undefined4 *puStack_50; void *local_4c; undefined4 *puStack_48; undefined4 *puStack_44; void *pvStack_40; undefined4 *local_3c; undefined4 *puStack_38; int iStack_34; int iStack_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00b0334d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_1dc = xml_node::first_node(param_1,(byte *)"trinket",in_stack_fffffdc4,in_stack_fffffdc8); do { if (local_1dc == (void *)0x0) { ExceptionList = local_10; return; } pbVar14 = s_id; do { pbVar10 = pbVar14; pbVar14 = pbVar10 + 1; } while (*pbVar14 != 0); for (puVar16 = *(undefined4 **)((int)local_1dc + 0x20); puVar16 != (undefined4 *)0x0; puVar16 = (undefined4 *)puVar16[6]) { pbVar14 = (byte *)*puVar16; if (pbVar14 == (byte *)0x0) { pbVar4 = (byte *)0x0; pbVar14 = &g_xmlNullStr; } else { pbVar4 = (byte *)puVar16[2]; } if (pbVar4 == pbVar10 + -0xb1bfef) { pbVar4 = pbVar4 + (int)pbVar14; if (pbVar4 <= pbVar14) goto LAB_00851bce; iVar12 = (int)s_id - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar4 <= pbVar14) goto LAB_00851bce; } } } puVar16 = (undefined4 *)0x0; LAB_00851bce: pbVar14 = &g_xmlNullStr; if ((byte *)puVar16[1] != (byte *)0x0) { pbVar14 = (byte *)puVar16[1]; } piVar5 = (int *)atoi((char *)pbVar14); local_1b0 = piVar5; if (param_2 == 0) { LAB_00851c2a: local_1c0 = (uint)piVar5 & 0xffff7fff; pvVar6 = InfoDisplayEntry::InfoDisplayEntry(local_1ac); local_8 = (void *)0x0; pvVar7 = (void *)FUN_00856100(&local_1c0); InfoDisplayEntry::operator_assign(pvVar7,pvVar6); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate(local_1a4); local_214 = (undefined4 *)FUN_00856100(&local_1c0); pMVar2 = g_manager; *local_214 = 1; local_214[1] = local_1c0; pvVar6 = (pMVar2->_itemConfig)._trinkets._begin; if (((int)(local_1c0 & 0x7fff) < (int)(pMVar2->_itemConfig)._trinkets._end - (int)pvVar6 >> 2) && (item = *(ItemConfig_Item **)((int)pvVar6 + (local_1c0 & 0x7fff) * 4), item != (ItemConfig_Item *)0x0)) { InfoDisplay::describe_pickup_stats(item,local_214); pcVar15 = "info"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); for (local_1b4 = *(undefined4 **)((int)local_1dc + 0x18); local_1b4 != (undefined4 *)0x0; local_1b4 = (undefined4 *)local_1b4[0xb]) { pbVar14 = (byte *)*local_1b4; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b4[2]; } if (pcVar15 == pcVar9 + -0xb6d1e3) { pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar10 <= pbVar14) goto joined_r0x00851d75; iVar12 = (int)&DAT_00b6d1e4 - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto joined_r0x00851d75; } } } local_1b4 = (undefined4 *)0x0; joined_r0x00851d75: if (local_1b4 != (undefined4 *)0x0) { local_84 = 0; local_80 = 0xf; local_94[0] = (void *)0x0; local_7c = (void *)0x0; puStack_78 = (undefined4 *)0x0; puStack_74 = (undefined4 *)0x0; pvStack_70 = (void *)0x0; local_6c = (undefined4 *)0x0; puStack_68 = (undefined4 *)0x0; pvStack_64 = (void *)0x0; puStack_60 = (undefined4 *)0x0; local_5c = (undefined4 *)0x0; pvStack_58 = (void *)0x0; puStack_54 = (undefined4 *)0x0; puStack_50 = (undefined4 *)0x0; local_4c = (void *)0x0; puStack_48 = (undefined4 *)0x0; puStack_44 = (undefined4 *)0x0; pvStack_40 = (void *)0x0; local_3c = (undefined4 *)0x0; puStack_38 = (undefined4 *)0x0; iStack_34 = 0; iStack_30 = 0; local_8._0_1_ = 1; local_8._1_3_ = 0; pcVar15 = "text"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); for (puVar16 = (undefined4 *)local_1b4[8]; puVar16 != (undefined4 *)0x0; puVar16 = (undefined4 *)puVar16[6]) { pbVar14 = (byte *)*puVar16; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)puVar16[2]; } if (pcVar15 == pcVar9 + -0xb6e37b) { pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar10 <= pbVar14) goto LAB_00851e17; iVar12 = (int)&DAT_00b6e37c - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00851e17; } } } puVar16 = (undefined4 *)0x0; LAB_00851e17: pbVar14 = &g_xmlNullStr; if ((byte *)puVar16[1] != (byte *)0x0) { pbVar14 = (byte *)puVar16[1]; } pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_94,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); pcVar15 = "player"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00851e73: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb66eeb) break; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"player" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00851ea3; } break; } LAB_00851ea3: local_1e8 = (int *)0x0; local_1e4 = (int *)0x0; local_1e0 = 0; local_8._0_1_ = 2; pcVar15 = "player"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb66eeb) break; LAB_00851f30: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_00851f3d: local_1c = 0; pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); local_8._0_1_ = 3; string_split(&local_1e8); local_8._0_1_ = 2; if (0xf < local_18) { uVar13 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar13 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) goto LAB_00853172; } operator_delete(pvVar6,uVar13); } uVar13 = 0; local_1bc = local_1e8; local_1b8 = ((int)local_1e4 - (int)local_1e8) / 0x18; piVar5 = local_1e8; if (local_1b8 != 0) { do { puVar16 = puStack_78; piVar8 = piVar5; if (0xf < (uint)piVar5[5]) { piVar8 = (int *)*piVar5; } local_1b0 = (int *)atoi((char *)piVar8); if (puVar16 == puStack_74) { std::vector::_Emplace_reallocate(puVar16,&local_1b0); } else { *puVar16 = local_1b0; puStack_78 = puVar16 + 1; } uVar13 = uVar13 + 1; piVar5 = piVar5 + 6; } while (uVar13 < local_1b8); } piVar3 = local_1bc; piVar8 = local_1e4; local_8._0_1_ = 1; piVar5 = local_1bc; if (local_1bc != (int *)0x0) { for (; piVar5 != piVar8; piVar5 = piVar5 + 6) { uVar13 = piVar5[5]; if (0xf < uVar13) { pvVar6 = (void *)*piVar5; uVar11 = uVar13 + 1; pvVar7 = pvVar6; if (0xfff < uVar11) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar11 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) goto LAB_00853172; } operator_delete(pvVar7,uVar11); } piVar5[4] = 0; piVar5[5] = 0xf; *(undefined1 *)piVar5 = 0; } uVar13 = ((local_1e0 - (int)piVar3) / 0x18) * 0x18; piVar5 = piVar3; if (0xfff < uVar13) { piVar5 = (int *)piVar3[-1]; uVar13 = uVar13 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar3 + (-4 - (int)piVar5))) goto LAB_00853172; } operator_delete(piVar5,uVar13); local_1e8 = (int *)0x0; local_1e4 = (int *)0x0; local_1e0 = 0; } goto LAB_0085211c; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"player" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00851f3d; } goto LAB_00851f30; } goto LAB_00851f3d; } LAB_0085211c: pcVar15 = "notplayer"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00852140: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb6e383) goto LAB_008521bb; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"notplayer" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852170; } goto LAB_008521bb; } LAB_00852170: local_1f4 = (int *)0x0; local_1f0 = (int *)0x0; local_1ec = 0; local_8._0_1_ = 4; pcVar15 = "notplayer"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb6e383) break; LAB_008521fe: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_0085220b: local_1c = 0; pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); local_8._0_1_ = 5; string_split(&local_1f4); local_8._0_1_ = 4; if (0xf < local_18) { uVar13 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar13 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) goto LAB_00853172; } operator_delete(pvVar6,uVar13); } uVar13 = 0; local_1b0 = local_1f4; local_1b8 = ((int)local_1f0 - (int)local_1f4) / 0x18; piVar5 = local_1f4; if (local_1b8 != 0) { do { puVar16 = local_6c; piVar8 = piVar5; if (0xf < (uint)piVar5[5]) { piVar8 = (int *)*piVar5; } local_1bc = (int *)atoi((char *)piVar8); if (puVar16 == puStack_68) { std::vector::_Emplace_reallocate(puVar16,&local_1bc); } else { *puVar16 = local_1bc; local_6c = puVar16 + 1; } uVar13 = uVar13 + 1; piVar5 = piVar5 + 6; } while (uVar13 < local_1b8); } piVar3 = local_1b0; piVar8 = local_1f0; local_8._0_1_ = 1; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { for (; piVar5 != piVar8; piVar5 = piVar5 + 6) { uVar13 = piVar5[5]; if (0xf < uVar13) { pvVar6 = (void *)*piVar5; uVar11 = uVar13 + 1; pvVar7 = pvVar6; if (0xfff < uVar11) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar11 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) goto LAB_00853172; } operator_delete(pvVar7,uVar11); } piVar5[4] = 0; piVar5[5] = 0xf; *(undefined1 *)piVar5 = 0; } uVar13 = ((local_1ec - (int)piVar3) / 0x18) * 0x18; piVar5 = piVar3; if (0xfff < uVar13) { piVar5 = (int *)piVar3[-1]; uVar13 = uVar13 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar3 + (-4 - (int)piVar5))) goto LAB_00853172; } operator_delete(piVar5,uVar13); local_1f4 = (int *)0x0; local_1f0 = (int *)0x0; local_1ec = 0; } goto LAB_008523ec; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"notplayer" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_0085220b; } goto LAB_008521fe; } goto LAB_0085220b; } LAB_008523ec: pcVar15 = "collectible"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00852410: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb6e397) goto LAB_0085248b; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"collectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852440; } goto LAB_0085248b; } LAB_00852440: local_200 = (int *)0x0; local_1fc = (int *)0x0; local_1f8 = 0; local_8._0_1_ = 6; pcVar15 = "collectible"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb6e397) break; LAB_008524ce: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_008524db: local_1c = 0; pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); local_8._0_1_ = 7; string_split(&local_200); local_8._0_1_ = 6; if (0xf < local_18) { uVar13 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar13 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) goto LAB_00853172; } operator_delete(pvVar6,uVar13); } uVar13 = 0; local_1b0 = local_200; local_1b8 = ((int)local_1fc - (int)local_200) / 0x18; piVar5 = local_200; if (local_1b8 != 0) { do { puVar16 = puStack_60; piVar8 = piVar5; if (0xf < (uint)piVar5[5]) { piVar8 = (int *)*piVar5; } local_1bc = (int *)atoi((char *)piVar8); if (puVar16 == local_5c) { std::vector::_Emplace_reallocate(puVar16,&local_1bc); } else { *puVar16 = local_1bc; puStack_60 = puVar16 + 1; } uVar13 = uVar13 + 1; piVar5 = piVar5 + 6; } while (uVar13 < local_1b8); } piVar3 = local_1b0; piVar8 = local_1fc; local_8._0_1_ = 1; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { for (; piVar5 != piVar8; piVar5 = piVar5 + 6) { uVar13 = piVar5[5]; if (0xf < uVar13) { pvVar6 = (void *)*piVar5; uVar11 = uVar13 + 1; pvVar7 = pvVar6; if (0xfff < uVar11) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar11 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) goto LAB_00853172; } operator_delete(pvVar7,uVar11); } piVar5[4] = 0; piVar5[5] = 0xf; *(undefined1 *)piVar5 = 0; } uVar13 = ((local_1f8 - (int)piVar3) / 0x18) * 0x18; piVar5 = piVar3; if (0xfff < uVar13) { piVar5 = (int *)piVar3[-1]; uVar13 = uVar13 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar3 + (-4 - (int)piVar5))) goto LAB_00853172; } operator_delete(piVar5,uVar13); local_200 = (int *)0x0; local_1fc = (int *)0x0; local_1f8 = 0; } goto LAB_008526bc; } } pbVar10 = pbVar14 + (int)pcVar15; if (pbVar14 < pbVar10) { iVar12 = (int)"collectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_008524db; } goto LAB_008524ce; } goto LAB_008524db; } LAB_008526bc: pcVar15 = "notcollectible"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_008526e0: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb6e35f) goto LAB_0085275b; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"notcollectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852710; } goto LAB_0085275b; } LAB_00852710: local_20c = (int *)0x0; local_208 = (int *)0x0; local_204 = 0; local_8._0_1_ = 8; pcVar15 = "notcollectible"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb6e35f) break; LAB_0085279e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_008527ab: local_1c = 0; pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); local_8._0_1_ = 9; string_split(&local_20c); local_8._0_1_ = 8; if (0xf < local_18) { uVar13 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar13 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) goto LAB_00853172; } operator_delete(pvVar6,uVar13); } uVar13 = 0; local_1b0 = local_20c; local_1b8 = ((int)local_208 - (int)local_20c) / 0x18; piVar5 = local_20c; if (local_1b8 != 0) { do { puVar16 = puStack_54; piVar8 = piVar5; if (0xf < (uint)piVar5[5]) { piVar8 = (int *)*piVar5; } local_1bc = (int *)atoi((char *)piVar8); if (puVar16 == puStack_50) { std::vector::_Emplace_reallocate(puVar16,&local_1bc); } else { *puVar16 = local_1bc; puStack_54 = puVar16 + 1; } uVar13 = uVar13 + 1; piVar5 = piVar5 + 6; } while (uVar13 < local_1b8); } piVar3 = local_1b0; piVar8 = local_208; local_8._0_1_ = 1; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { for (; piVar5 != piVar8; piVar5 = piVar5 + 6) { uVar13 = piVar5[5]; if (0xf < uVar13) { pvVar6 = (void *)*piVar5; uVar11 = uVar13 + 1; pvVar7 = pvVar6; if (0xfff < uVar11) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar11 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) goto LAB_00853172; } operator_delete(pvVar7,uVar11); } piVar5[4] = 0; piVar5[5] = 0xf; *(undefined1 *)piVar5 = 0; } uVar13 = ((local_204 - (int)piVar3) / 0x18) * 0x18; piVar5 = piVar3; if (0xfff < uVar13) { piVar5 = (int *)piVar3[-1]; uVar13 = uVar13 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar3 + (-4 - (int)piVar5))) goto LAB_00853172; } operator_delete(piVar5,uVar13); local_20c = (int *)0x0; local_208 = (int *)0x0; local_204 = 0; } goto LAB_0085298c; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"notcollectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_008527ab; } goto LAB_0085279e; } goto LAB_008527ab; } LAB_0085298c: pcVar15 = "trinket"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_008529b0: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb66fcf) goto LAB_00852a2b; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"trinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_008529e0; } goto LAB_00852a2b; } LAB_008529e0: local_1cc = (char *)0x0; local_1c8 = (char *)0x0; local_1c4 = 0; local_8._0_1_ = 10; pcVar15 = "trinket"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb66fcf) break; LAB_00852a6e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_00852a7b: local_1c = 0; pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); local_8._0_1_ = 0xb; string_split(&local_1cc); local_8._0_1_ = 10; if (0xf < local_18) { uVar13 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar13 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) goto LAB_00853172; } operator_delete(pvVar6,uVar13); } uVar13 = 0; local_1b8 = ((int)local_1c8 - (int)local_1cc) / 0x18; if (local_1b8 != 0) { pcVar15 = local_1cc; do { puVar16 = puStack_48; pcVar9 = pcVar15; if (0xf < *(uint *)(pcVar15 + 0x14)) { pcVar9 = *(char **)pcVar15; } local_1bc = (int *)atoi(pcVar9); if (puVar16 == puStack_44) { std::vector::_Emplace_reallocate(puVar16,&local_1bc); } else { *puVar16 = local_1bc; puStack_48 = puVar16 + 1; } uVar13 = uVar13 + 1; pcVar15 = pcVar15 + 0x18; } while (uVar13 < local_1b8); } pcVar9 = local_1c8; local_8._0_1_ = 1; pcVar15 = local_1cc; if (local_1cc != (char *)0x0) { for (; pcVar15 != pcVar9; pcVar15 = pcVar15 + 0x18) { std::string::_Tidy_deallocate(pcVar15); } deallocate(local_1cc,(local_1c4 - (int)local_1cc) / 0x18); local_1cc = (char *)0x0; local_1c8 = (char *)0x0; local_1c4 = 0; } goto LAB_00852bf8; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"trinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852a7b; } goto LAB_00852a6e; } goto LAB_00852a7b; } LAB_00852bf8: pcVar15 = "nottrinket"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00852c20: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb6e36f) goto LAB_00852c9b; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"nottrinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852c50; } goto LAB_00852c9b; } LAB_00852c50: local_1d8 = (char *)0x0; local_1d4 = (char *)0x0; local_1d0 = 0; local_8._0_1_ = 0xc; pcVar15 = "nottrinket"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb6e36f) break; LAB_00852cde: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_00852ceb: local_1c = 0; pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } local_18 = 0xf; local_2c[0] = (void *)0x0; pbVar10 = pbVar14; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); local_8._0_1_ = 0xd; string_split(&local_1d8); local_8._0_1_ = 0xc; if (0xf < local_18) { uVar13 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar13 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) goto LAB_00853172; } operator_delete(pvVar6,uVar13); } uVar13 = 0; local_1b8 = ((int)local_1d4 - (int)local_1d8) / 0x18; if (local_1b8 != 0) { pcVar15 = local_1d8; do { puVar16 = local_3c; pcVar9 = pcVar15; if (0xf < *(uint *)(pcVar15 + 0x14)) { pcVar9 = *(char **)pcVar15; } local_1bc = (int *)atoi(pcVar9); if (puVar16 == puStack_38) { std::vector::_Emplace_reallocate(puVar16,&local_1bc); } else { *puVar16 = local_1bc; local_3c = puVar16 + 1; } uVar13 = uVar13 + 1; pcVar15 = pcVar15 + 0x18; } while (uVar13 < local_1b8); } pcVar9 = local_1d4; local_8._0_1_ = 1; pcVar15 = local_1d8; if (local_1d8 != (char *)0x0) { for (; pcVar15 != pcVar9; pcVar15 = pcVar15 + 0x18) { std::string::_Tidy_deallocate(pcVar15); } deallocate(local_1d8,(local_1d0 - (int)local_1d8) / 0x18); local_1d8 = (char *)0x0; local_1d4 = (char *)0x0; local_1d0 = 0; } goto LAB_00852e68; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"nottrinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852ceb; } goto LAB_00852cde; } goto LAB_00852ceb; } LAB_00852e68: pcVar15 = "achievement"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00852e90: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb66fab) goto LAB_00852ee2; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"achievement" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852ec0; } goto LAB_00852ee2; } LAB_00852ec0: pcVar15 = "achievement"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb66fab) break; LAB_00852f1e: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_00852f2b: pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } iStack_34 = atoi((char *)pbVar14); goto LAB_00852f4b; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)"achievement" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852f2b; } goto LAB_00852f1e; } goto LAB_00852f2b; } LAB_00852f4b: pcVar15 = "tag"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); local_1b0 = (int *)local_1b4[8]; piVar5 = local_1b0; if (local_1b0 != (int *)0x0) { LAB_00852f70: pbVar14 = (byte *)*piVar5; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)piVar5[2]; } if (pcVar15 != pcVar9 + -0xb6e3b3) goto LAB_00852fc2; pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)&DAT_00b6e3b4 - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_00852fa0; } goto LAB_00852fc2; } LAB_00852fa0: pcVar15 = "tag"; do { pcVar9 = pcVar15; pcVar15 = pcVar9 + 1; } while (*pcVar15 != '\0'); while( true ) { pbVar14 = (byte *)*local_1b0; if (pbVar14 == (byte *)0x0) { pcVar15 = (char *)0x0; pbVar14 = &g_xmlNullStr; } else { pcVar15 = (char *)local_1b0[2]; } if (pcVar15 == pcVar9 + -0xb6e3b3) break; LAB_00852ffe: local_1b0 = (int *)local_1b0[6]; if (local_1b0 == (int *)0x0) { LAB_0085300b: pbVar14 = &g_xmlNullStr; if ((byte *)local_1b0[1] != (byte *)0x0) { pbVar14 = (byte *)local_1b0[1]; } iStack_30 = atoi((char *)pbVar14); goto LAB_00853025; } } pbVar10 = (byte *)(pcVar15 + (int)pbVar14); if (pbVar14 < pbVar10) { iVar12 = (int)&DAT_00b6e3b4 - (int)pbVar14; while (*pbVar14 == pbVar14[iVar12]) { pbVar14 = pbVar14 + 1; if (pbVar10 <= pbVar14) goto LAB_0085300b; } goto LAB_00852ffe; } goto LAB_0085300b; } LAB_00853025: puVar16 = local_214; pvVar6 = (void *)local_214[0xc]; if (pvVar6 == (void *)local_214[0xd]) { std::vector<104byte>::_Emplace_reallocate(pvVar6,local_94); } else { InfoDisplayEntry::copy_constructor(pvVar6,local_94); puVar16[0xc] = puVar16[0xc] + 0x68; } local_1b4 = (undefined4 *)local_1b4[0xb]; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (pvStack_40 != (void *)0x0) { deallocate(pvStack_40,(int)puStack_38 - (int)pvStack_40 >> 2); } if (local_4c != (void *)0x0) { deallocate(local_4c,(int)puStack_44 - (int)local_4c >> 2); } if (pvStack_58 != (void *)0x0) { deallocate(pvStack_58,(int)puStack_50 - (int)pvStack_58 >> 2); } if (pvStack_64 != (void *)0x0) { deallocate(pvStack_64,(int)local_5c - (int)pvStack_64 >> 2); } if (pvStack_70 != (void *)0x0) { deallocate(pvStack_70,(int)puStack_68 - (int)pvStack_70 >> 2); } if (local_7c != (void *)0x0) { deallocate(local_7c,(int)puStack_74 - (int)local_7c >> 2); } if (0xf < local_80) { uVar13 = local_80 + 1; pvVar6 = local_94[0]; if (0xfff < uVar13) { pvVar6 = *(void **)((int)local_94[0] + -4); uVar13 = local_80 + 0x24; if (0x1f < (uint)((int)local_94[0] + (-4 - (int)pvVar6))) { LAB_00853172: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar13); } goto joined_r0x00851d75; } } else { std::map::erase(&local_1c0); } } else { std::set::find_node(local_220,&local_1b0); if ((*(char *)(local_218 + 0xd) != '\0') || (iVar12 = local_218, (int)piVar5 < *(int *)(local_218 + 0x10))) { iVar12 = *(int *)(param_2 + 8); } if (iVar12 != *(int *)(param_2 + 8)) { piVar5 = *(int **)(iVar12 + 0x14); goto LAB_00851c2a; } } local_1dc = *(void **)((int)local_1dc + 0x2c); } while( true ); piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_0085211c; goto LAB_00851e73; LAB_008521bb: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_008523ec; goto LAB_00852140; LAB_0085248b: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_008526bc; goto LAB_00852410; LAB_0085275b: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_0085298c; goto LAB_008526e0; LAB_00852a2b: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_00852bf8; goto LAB_008529b0; LAB_00852c9b: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_00852e68; goto LAB_00852c20; LAB_00852ee2: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_00852f4b; goto LAB_00852e90; LAB_00852fc2: piVar5 = (int *)piVar5[6]; if (piVar5 == (int *)0x0) goto LAB_00853025; goto LAB_00852f70; } //@@ 00853180 info_display_xml_parse_pills /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? same loader, called with first_node("pills"); same attribute set, this+0x10 table */ void info_display_xml_parse_pills(void *param_1) { byte *pbVar1; byte bVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; Manager *pMVar6; void *pvVar7; void *pvVar8; undefined4 *puVar9; std_string *psVar10; int *piVar11; char *pcVar12; int *piVar13; int in_ECX; byte *pbVar14; uint uVar15; byte *pbVar16; int iVar17; uint uVar18; int *piVar19; std_string *this; char *pcVar20; undefined4 *puVar21; int in_stack_fffffdbc; byte in_stack_fffffdc0; int *local_228; int *local_224; int local_220; int *local_21c; int *local_218; int local_214; int *local_210; int *local_20c; int local_208; int *local_204; int *local_200; int local_1fc; void *local_1f8; char *local_1f4; char *local_1f0; int local_1ec; char *local_1e8; char *local_1e4; int local_1e0; int local_1dc; uint local_1d8; int *local_1d4; byte *local_1d0; int *local_1cc; undefined4 *local_1c8; byte *local_1c4; undefined1 local_1c0 [8]; char local_1b8 [272]; void *local_a8 [4]; undefined4 local_98; uint local_94; void *local_90; undefined4 *puStack_8c; undefined4 *puStack_88; void *pvStack_84; undefined4 *local_80; undefined4 *puStack_7c; void *pvStack_78; undefined4 *puStack_74; undefined4 *local_70; void *pvStack_6c; undefined4 *puStack_68; undefined4 *puStack_64; void *local_60; undefined4 *puStack_5c; undefined4 *puStack_58; void *pvStack_54; undefined4 *local_50; undefined4 *puStack_4c; int iStack_48; int iStack_44; std_string local_3c; uint local_24; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ppvStack_20 = (void **)((int)&local_3c + 0x38); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b0340d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&local_3c + 0x2cU; ExceptionList = &local_1c; local_1f8 = xml_node::first_node(param_1,&DAT_00b66fc0,in_stack_fffffdbc,in_stack_fffffdc0); if (local_1f8 != (void *)0x0) { local_1dc = in_ECX + 0x10; do { pbVar16 = s_id; do { local_1c4 = pbVar16; pbVar16 = local_1c4 + 1; } while (*pbVar16 != 0); local_1c4 = local_1c4 + -0xb1bfef; for (puVar9 = *(undefined4 **)((int)local_1f8 + 0x20); puVar9 != (undefined4 *)0x0; puVar9 = (undefined4 *)puVar9[6]) { pbVar16 = (byte *)*puVar9; if (pbVar16 == (byte *)0x0) { pbVar14 = (byte *)0x0; pbVar16 = &g_xmlNullStr; } else { pbVar14 = (byte *)puVar9[2]; } if (pbVar14 == local_1c4) { pbVar14 = pbVar14 + (int)pbVar16; if (pbVar14 <= pbVar16) goto LAB_0085325d; iVar17 = (int)s_id - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_0085325d; } } } puVar9 = (undefined4 *)0x0; LAB_0085325d: pbVar16 = &g_xmlNullStr; if ((byte *)puVar9[1] != (byte *)0x0) { pbVar16 = (byte *)puVar9[1]; } local_1d8 = atoi((char *)pbVar16); local_1d8 = local_1d8 & 0xfffff7ff; pvVar7 = InfoDisplayEntry::InfoDisplayEntry(local_1c0); local_14 = 0; pvVar8 = (void *)FUN_00856100(&local_1d8); InfoDisplayEntry::operator_assign(pvVar8,pvVar7); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate(local_1b8); puVar9 = (undefined4 *)FUN_00856100(&local_1d8); pMVar6 = g_manager; *puVar9 = 2; puVar9[1] = local_1d8; if (((int)local_1d8 < 0) || (pvVar7 = (pMVar6->_itemConfig)._pillEffects._begin, (int)(pMVar6->_itemConfig)._pillEffects._end - (int)pvVar7 >> 2 <= (int)local_1d8)) { pvVar7 = (void *)0x0; } else { pvVar7 = *(void **)((int)pvVar7 + local_1d8 * 4); } if (pvVar7 == (void *)0x0) { std::map::erase(&local_1d8); } else { psVar10 = PocketItemConfig::GetName(pvVar7,&local_3c,0x14); this = (std_string *)(puVar9 + 2); if (this != psVar10) { std::string::_Tidy_deallocate((char *)this); uVar3 = *(undefined4 *)(psVar10->_buf + 4); uVar4 = *(undefined4 *)(psVar10->_buf + 8); uVar5 = *(undefined4 *)(psVar10->_buf + 0xc); *(undefined4 *)this->_buf = *(undefined4 *)psVar10->_buf; puVar9[3] = uVar3; puVar9[4] = uVar4; puVar9[5] = uVar5; uVar18 = psVar10->_capacity; puVar9[6] = psVar10->_size; puVar9[7] = uVar18; psVar10->_size = 0; psVar10->_capacity = 0xf; psVar10->_buf[0] = '\0'; } if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) { LAB_00854937: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar18); } pcVar20 = "info"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); for (local_1c8 = *(undefined4 **)((int)local_1f8 + 0x18); local_1c8 != (undefined4 *)0x0; local_1c8 = (undefined4 *)local_1c8[0xb]) { pbVar16 = (byte *)*local_1c8; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = (char *)local_1c8[2]; } if (pcVar20 == pcVar12 + -0xb6d1e3) { pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar14 <= pbVar16) goto LAB_0085341f; iVar17 = (int)&DAT_00b6d1e4 - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_0085341f; } } } local_1c8 = (undefined4 *)0x0; LAB_0085341f: if (local_1c8 != (undefined4 *)0x0) { puVar21 = local_1c8; do { local_98 = 0; local_94 = 0xf; local_a8[0] = (void *)0x0; local_90 = (void *)0x0; puStack_8c = (undefined4 *)0x0; puStack_88 = (undefined4 *)0x0; pvStack_84 = (void *)0x0; local_80 = (undefined4 *)0x0; puStack_7c = (undefined4 *)0x0; pvStack_78 = (void *)0x0; puStack_74 = (undefined4 *)0x0; local_70 = (undefined4 *)0x0; pvStack_6c = (void *)0x0; puStack_68 = (undefined4 *)0x0; puStack_64 = (undefined4 *)0x0; local_60 = (void *)0x0; puStack_5c = (undefined4 *)0x0; puStack_58 = (undefined4 *)0x0; pvStack_54 = (void *)0x0; local_50 = (undefined4 *)0x0; puStack_4c = (undefined4 *)0x0; iStack_48 = 0; iStack_44 = 0; local_14._0_1_ = 1; local_14._1_3_ = 0; pcVar20 = "text"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)(pcVar12 + -0xb6e37b); for (puVar21 = (undefined4 *)puVar21[8]; puVar21 != (undefined4 *)0x0; puVar21 = (undefined4 *)puVar21[6]) { pbVar16 = (byte *)*puVar21; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = (char *)puVar21[2]; } if ((byte *)pcVar20 == local_1c4) { pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar14 <= pbVar16) goto LAB_008534d2; iVar17 = (int)&DAT_00b6e37c - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008534d2; } } } puVar21 = (undefined4 *)0x0; LAB_008534d2: pbVar16 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar16 = (byte *)puVar21[1]; } pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign((char *)local_a8,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); pcVar20 = "player"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1d4 = (int *)(pcVar12 + -0xb66eeb); local_1c4 = (byte *)local_1c8[8]; pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00853530: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1d4) goto LAB_008535b1; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"player" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00853560; } goto LAB_008535b1; } LAB_00853560: local_204 = (int *)0x0; local_200 = (int *)0x0; local_1fc = 0; local_14._0_1_ = 2; pcVar20 = "player"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb66eeb) break; LAB_008535fa: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00853607: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 3; string_split(&local_204); local_14._0_1_ = 2; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_200 - (int)local_204) / 0x18); local_1cc = local_204; if (local_1d0 != (byte *)0x0) { piVar13 = local_204; do { puVar21 = puStack_8c; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1d4 = (int *)atoi((char *)piVar11); if (puVar21 == puStack_88) { std::vector::_Emplace_reallocate(puVar21,&local_1d4); } else { *puVar21 = local_1d4; puStack_8c = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1cc; local_14._0_1_ = 1; if (local_1cc != (int *)0x0) { piVar11 = local_200; piVar19 = local_1cc; if (local_1cc != local_200) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00854937; } operator_delete(pvVar8,uVar15); piVar11 = local_200; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_1fc - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_00854937; } operator_delete(piVar11,uVar18); local_204 = (int *)0x0; local_200 = (int *)0x0; local_1fc = 0; } goto LAB_008537fe; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"player" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00853607; } goto LAB_008535fa; } goto LAB_00853607; } LAB_008537fe: pcVar20 = "notplayer"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e383); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00853826: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_008538a6; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"notplayer" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_0085385c; } goto LAB_008538a6; } LAB_0085385c: local_210 = (int *)0x0; local_20c = (int *)0x0; local_208 = 0; local_14._0_1_ = 4; pcVar20 = "notplayer"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e383) break; LAB_008538ea: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_008538f7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 5; string_split(&local_210); local_14._0_1_ = 4; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_20c - (int)local_210) / 0x18); local_1d4 = local_210; if (local_1d0 != (byte *)0x0) { piVar13 = local_210; do { puVar21 = local_80; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1cc = (int *)atoi((char *)piVar11); if (puVar21 == puStack_7c) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; local_80 = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1d4; local_14._0_1_ = 1; if (local_1d4 != (int *)0x0) { piVar11 = local_20c; piVar19 = local_1d4; if (local_1d4 != local_20c) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00854937; } operator_delete(pvVar8,uVar15); piVar11 = local_20c; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_208 - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_00854937; } operator_delete(piVar11,uVar18); local_210 = (int *)0x0; local_20c = (int *)0x0; local_208 = 0; } goto LAB_00853aee; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"notplayer" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008538f7; } goto LAB_008538ea; } goto LAB_008538f7; } LAB_00853aee: pcVar20 = "collectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e397); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00853b16: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00853b96; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"collectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00853b4c; } goto LAB_00853b96; } LAB_00853b4c: local_21c = (int *)0x0; local_218 = (int *)0x0; local_214 = 0; local_14._0_1_ = 6; pcVar20 = "collectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e397) break; LAB_00853bda: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00853be7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 7; string_split(&local_21c); local_14._0_1_ = 6; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_218 - (int)local_21c) / 0x18); local_1d4 = local_21c; if (local_1d0 != (byte *)0x0) { piVar13 = local_21c; do { puVar21 = puStack_74; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1cc = (int *)atoi((char *)piVar11); if (puVar21 == local_70) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; puStack_74 = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1d4; local_14._0_1_ = 1; if (local_1d4 != (int *)0x0) { piVar11 = local_218; piVar19 = local_1d4; if (local_1d4 != local_218) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00854937; } operator_delete(pvVar8,uVar15); piVar11 = local_218; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_214 - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_00854937; } operator_delete(piVar11,uVar18); local_21c = (int *)0x0; local_218 = (int *)0x0; local_214 = 0; } goto LAB_00853dde; } } pbVar14 = pbVar16 + (int)pcVar20; if (pbVar16 < pbVar14) { iVar17 = (int)"collectible" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00853be7; } goto LAB_00853bda; } goto LAB_00853be7; } LAB_00853dde: pcVar20 = "notcollectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e35f); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00853e06: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00853e86; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"notcollectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00853e3c; } goto LAB_00853e86; } LAB_00853e3c: local_228 = (int *)0x0; local_224 = (int *)0x0; local_220 = 0; local_14._0_1_ = 8; pcVar20 = "notcollectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e35f) break; LAB_00853eca: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00853ed7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 9; string_split(&local_228); local_14._0_1_ = 8; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_224 - (int)local_228) / 0x18); local_1d4 = local_228; if (local_1d0 != (byte *)0x0) { piVar13 = local_228; do { puVar21 = puStack_68; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1cc = (int *)atoi((char *)piVar11); if (puVar21 == puStack_64) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; puStack_68 = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1d4; local_14._0_1_ = 1; if (local_1d4 != (int *)0x0) { piVar11 = local_224; piVar19 = local_1d4; if (local_1d4 != local_224) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_00854937; } operator_delete(pvVar8,uVar15); piVar11 = local_224; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_220 - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_00854937; } operator_delete(piVar11,uVar18); local_228 = (int *)0x0; local_224 = (int *)0x0; local_220 = 0; } goto LAB_008540d1; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"notcollectible" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00853ed7; } goto LAB_00853eca; } goto LAB_00853ed7; } LAB_008540d1: pcVar20 = "trinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb66fcf); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00854100: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00854183; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"trinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00854134; } goto LAB_00854183; } LAB_00854134: local_1e8 = (char *)0x0; local_1e4 = (char *)0x0; local_1e0 = 0; local_14._0_1_ = 10; pcVar20 = "trinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb66fcf) break; LAB_008541ca: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_008541d7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 0xb; string_split(&local_1e8); local_14._0_1_ = 10; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_1e4 - (int)local_1e8) / 0x18); if (local_1d0 != (byte *)0x0) { pcVar20 = local_1e8; do { puVar21 = puStack_5c; pcVar12 = pcVar20; if (0xf < *(uint *)(pcVar20 + 0x14)) { pcVar12 = *(char **)pcVar20; } local_1cc = (int *)atoi(pcVar12); if (puVar21 == puStack_58) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; puStack_5c = puVar21 + 1; } pcVar20 = pcVar20 + 0x18; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } pcVar12 = local_1e4; local_14._0_1_ = 1; pcVar20 = local_1e8; if (local_1e8 != (char *)0x0) { for (; pcVar20 != pcVar12; pcVar20 = pcVar20 + 0x18) { std::string::_Tidy_deallocate(pcVar20); } deallocate(local_1e8,(local_1e0 - (int)local_1e8) / 0x18); local_1e8 = (char *)0x0; local_1e4 = (char *)0x0; local_1e0 = 0; } goto LAB_00854369; } } pbVar14 = pbVar16 + (int)pcVar20; if (pbVar16 < pbVar14) { iVar17 = (int)"trinket" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008541d7; } goto LAB_008541ca; } goto LAB_008541d7; } LAB_00854369: pcVar20 = "nottrinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e36f); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00854393: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00854416; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"nottrinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_008543cc; } goto LAB_00854416; } LAB_008543cc: local_1f4 = (char *)0x0; local_1f0 = (char *)0x0; local_1ec = 0; local_14._0_1_ = 0xc; pcVar20 = "nottrinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e36f) break; LAB_0085445a: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00854467: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 0xd; string_split(&local_1f4); local_14._0_1_ = 0xc; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_1f0 - (int)local_1f4) / 0x18); if (local_1d0 != (byte *)0x0) { pcVar20 = local_1f4; do { puVar21 = local_50; pcVar12 = pcVar20; if (0xf < *(uint *)(pcVar20 + 0x14)) { pcVar12 = *(char **)pcVar20; } local_1cc = (int *)atoi(pcVar12); if (puVar21 == puStack_4c) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; local_50 = puVar21 + 1; } pcVar20 = pcVar20 + 0x18; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } pcVar12 = local_1f0; local_14._0_1_ = 1; pcVar20 = local_1f4; if (local_1f4 != (char *)0x0) { for (; pcVar20 != pcVar12; pcVar20 = pcVar20 + 0x18) { std::string::_Tidy_deallocate(pcVar20); } deallocate(local_1f4,(local_1ec - (int)local_1f4) / 0x18); local_1f4 = (char *)0x0; local_1f0 = (char *)0x0; local_1ec = 0; } goto LAB_008545f9; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"nottrinket" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00854467; } goto LAB_0085445a; } goto LAB_00854467; } LAB_008545f9: pcVar20 = "achievement"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb66fab); puVar21 = (undefined4 *)local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00854623: pbVar16 = (byte *)*puVar21; if (pbVar16 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar16 = &g_xmlNullStr; } else { piVar13 = (int *)puVar21[2]; } if (piVar13 != local_1cc) goto LAB_00854681; pbVar14 = pbVar16 + (int)piVar13; if (pbVar16 < pbVar14) { iVar17 = (int)"achievement" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00854653; } goto LAB_00854681; } LAB_00854653: pcVar20 = "achievement"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)((int)local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb66fab) break; LAB_008546c0: local_1c4 = *(byte **)((int)local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_008546cd: pbVar16 = &g_xmlNullStr; if (*(byte **)((int)local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)((int)local_1c4 + 4); } iStack_48 = atoi((char *)pbVar16); goto LAB_008546ed; } } pbVar14 = pbVar16 + (int)pcVar20; if (pbVar16 < pbVar14) { iVar17 = (int)"achievement" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008546cd; } goto LAB_008546c0; } goto LAB_008546cd; } LAB_008546ed: pcVar20 = "tag"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e3b3); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00854715: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00854774; pbVar1 = pbVar14 + (int)piVar13; if (pbVar14 < pbVar1) { iVar17 = (int)&DAT_00b6e3b4 - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_0085474c; } goto LAB_00854774; } LAB_0085474c: pcVar20 = "tag"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e3b3) break; LAB_008547ba: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_008547c7: pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } iStack_44 = atoi((char *)pbVar16); goto LAB_008547e1; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)&DAT_00b6e3b4 - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008547c7; } goto LAB_008547ba; } goto LAB_008547c7; } LAB_008547e1: pvVar7 = (void *)puVar9[0xc]; if (pvVar7 == (void *)puVar9[0xd]) { std::vector<104byte>::_Emplace_reallocate(pvVar7,local_a8); } else { InfoDisplayEntry::copy_constructor(pvVar7,local_a8); puVar9[0xc] = puVar9[0xc] + 0x68; } puVar21 = (undefined4 *)local_1c8[0xb]; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_1c8 = puVar21; if (pvStack_54 != (void *)0x0) { deallocate(pvStack_54,(int)puStack_4c - (int)pvStack_54 >> 2); } if (local_60 != (void *)0x0) { deallocate(local_60,(int)puStack_58 - (int)local_60 >> 2); } if (pvStack_6c != (void *)0x0) { deallocate(pvStack_6c,(int)puStack_64 - (int)pvStack_6c >> 2); } if (pvStack_78 != (void *)0x0) { deallocate(pvStack_78,(int)local_70 - (int)pvStack_78 >> 2); } if (pvStack_84 != (void *)0x0) { deallocate(pvStack_84,(int)puStack_7c - (int)pvStack_84 >> 2); } if (local_90 != (void *)0x0) { deallocate(local_90,(int)puStack_88 - (int)local_90 >> 2); } if (0xf < local_94) { uVar18 = local_94 + 1; pvVar7 = local_a8[0]; if (0xfff < uVar18) { pvVar7 = *(void **)((int)local_a8[0] + -4); uVar18 = local_94 + 0x24; if (0x1f < (uint)((int)local_a8[0] + (-4 - (int)pvVar7))) goto LAB_00854937; } operator_delete(pvVar7,uVar18); } } while (puVar21 != (undefined4 *)0x0); } } local_1f8 = *(void **)((int)local_1f8 + 0x2c); } while (local_1f8 != (void *)0x0); } ExceptionList = local_1c; return; LAB_008535b1: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_008537fe; goto LAB_00853530; LAB_008538a6: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00853aee; goto LAB_00853826; LAB_00853b96: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00853dde; goto LAB_00853b16; LAB_00853e86: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_008540d1; goto LAB_00853e06; LAB_00854183: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00854369; goto LAB_00854100; LAB_00854416: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_008545f9; goto LAB_00854393; LAB_00854681: puVar21 = (undefined4 *)puVar21[6]; if (puVar21 == (undefined4 *)0x0) goto LAB_008546ed; goto LAB_00854623; LAB_00854774: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_008547e1; goto LAB_00854715; } //@@ 00854940 InfoDisplayConfig::parse_item_node /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? parses info_display.xml item nodes: id/info/text with player/notplayer/collectible/notcollectible/trinket/nottrinket/achievement/tag conditions; caller 0084eba0 InfoDisplay::load_xml cards/collectibles/pills/trinkets groups, ECX=Manager+0x2a530 */ void InfoDisplayConfig::parse_item_node(void *param_1) { byte *pbVar1; byte bVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; Manager *pMVar6; void *pvVar7; void *pvVar8; undefined4 *puVar9; std_string *psVar10; int *piVar11; char *pcVar12; int *piVar13; int in_ECX; byte *pbVar14; uint uVar15; byte *pbVar16; int iVar17; uint uVar18; int *piVar19; std_string *this; char *pcVar20; undefined4 *puVar21; int in_stack_fffffdbc; byte in_stack_fffffdc0; int *local_228; int *local_224; int local_220; int *local_21c; int *local_218; int local_214; int *local_210; int *local_20c; int local_208; int *local_204; int *local_200; int local_1fc; void *local_1f8; char *local_1f4; char *local_1f0; int local_1ec; char *local_1e8; char *local_1e4; int local_1e0; int local_1dc; int local_1d8; int *local_1d4; byte *local_1d0; int *local_1cc; undefined4 *local_1c8; byte *local_1c4; undefined1 local_1c0 [8]; char local_1b8 [272]; void *local_a8 [4]; undefined4 local_98; uint local_94; void *local_90; undefined4 *puStack_8c; undefined4 *puStack_88; void *pvStack_84; undefined4 *local_80; undefined4 *puStack_7c; void *pvStack_78; undefined4 *puStack_74; undefined4 *local_70; void *pvStack_6c; undefined4 *puStack_68; undefined4 *puStack_64; void *local_60; undefined4 *puStack_5c; undefined4 *puStack_58; void *pvStack_54; undefined4 *local_50; undefined4 *puStack_4c; int iStack_48; int iStack_44; std_string local_3c; uint local_24; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ppvStack_20 = (void **)((int)&local_3c + 0x38); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b0340d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&local_3c + 0x2cU; ExceptionList = &local_1c; local_1f8 = xml_node::first_node (param_1,(byte *)&DAT_00b66f60,in_stack_fffffdbc,in_stack_fffffdc0); if (local_1f8 != (void *)0x0) { local_1dc = in_ECX + 0x18; do { pbVar16 = s_id; do { local_1c4 = pbVar16; pbVar16 = local_1c4 + 1; } while (*pbVar16 != 0); local_1c4 = local_1c4 + -0xb1bfef; for (puVar9 = *(undefined4 **)((int)local_1f8 + 0x20); puVar9 != (undefined4 *)0x0; puVar9 = (undefined4 *)puVar9[6]) { pbVar16 = (byte *)*puVar9; if (pbVar16 == (byte *)0x0) { pbVar14 = (byte *)0x0; pbVar16 = &g_xmlNullStr; } else { pbVar14 = (byte *)puVar9[2]; } if (pbVar14 == local_1c4) { pbVar14 = pbVar14 + (int)pbVar16; if (pbVar14 <= pbVar16) goto LAB_00854a1d; iVar17 = (int)s_id - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00854a1d; } } } puVar9 = (undefined4 *)0x0; LAB_00854a1d: pbVar16 = &g_xmlNullStr; if ((byte *)puVar9[1] != (byte *)0x0) { pbVar16 = (byte *)puVar9[1]; } local_1d8 = atoi((char *)pbVar16); pvVar7 = InfoDisplayEntry::InfoDisplayEntry(local_1c0); local_14 = 0; pvVar8 = (void *)FUN_00856100(&local_1d8); InfoDisplayEntry::operator_assign(pvVar8,pvVar7); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate(local_1b8); puVar9 = (undefined4 *)FUN_00856100(&local_1d8); pMVar6 = g_manager; *puVar9 = 3; puVar9[1] = local_1d8; if ((local_1d8 < 0) || (pvVar7 = (pMVar6->_itemConfig)._cards._begin, (int)(pMVar6->_itemConfig)._cards._end - (int)pvVar7 >> 2 <= local_1d8)) { pvVar7 = (void *)0x0; } else { pvVar7 = *(void **)((int)pvVar7 + local_1d8 * 4); } if (pvVar7 == (void *)0x0) { std::map::erase(&local_1d8); } else { psVar10 = PocketItemConfig::GetName(pvVar7,&local_3c,0x14); this = (std_string *)(puVar9 + 2); if (this != psVar10) { std::string::_Tidy_deallocate((char *)this); uVar3 = *(undefined4 *)(psVar10->_buf + 4); uVar4 = *(undefined4 *)(psVar10->_buf + 8); uVar5 = *(undefined4 *)(psVar10->_buf + 0xc); *(undefined4 *)this->_buf = *(undefined4 *)psVar10->_buf; puVar9[3] = uVar3; puVar9[4] = uVar4; puVar9[5] = uVar5; uVar18 = psVar10->_capacity; puVar9[6] = psVar10->_size; puVar9[7] = uVar18; psVar10->_size = 0; psVar10->_capacity = 0xf; psVar10->_buf[0] = '\0'; } if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) { LAB_008560f7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar18); } pcVar20 = "info"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); for (local_1c8 = *(undefined4 **)((int)local_1f8 + 0x18); local_1c8 != (undefined4 *)0x0; local_1c8 = (undefined4 *)local_1c8[0xb]) { pbVar16 = (byte *)*local_1c8; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = (char *)local_1c8[2]; } if (pcVar20 == pcVar12 + -0xb6d1e3) { pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar14 <= pbVar16) goto LAB_00854bd4; iVar17 = (int)&DAT_00b6d1e4 - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00854bd4; } } } local_1c8 = (undefined4 *)0x0; LAB_00854bd4: if (local_1c8 != (undefined4 *)0x0) { puVar21 = local_1c8; do { local_98 = 0; local_94 = 0xf; local_a8[0] = (void *)0x0; local_90 = (void *)0x0; puStack_8c = (undefined4 *)0x0; puStack_88 = (undefined4 *)0x0; pvStack_84 = (void *)0x0; local_80 = (undefined4 *)0x0; puStack_7c = (undefined4 *)0x0; pvStack_78 = (void *)0x0; puStack_74 = (undefined4 *)0x0; local_70 = (undefined4 *)0x0; pvStack_6c = (void *)0x0; puStack_68 = (undefined4 *)0x0; puStack_64 = (undefined4 *)0x0; local_60 = (void *)0x0; puStack_5c = (undefined4 *)0x0; puStack_58 = (undefined4 *)0x0; pvStack_54 = (void *)0x0; local_50 = (undefined4 *)0x0; puStack_4c = (undefined4 *)0x0; iStack_48 = 0; iStack_44 = 0; local_14._0_1_ = 1; local_14._1_3_ = 0; pcVar20 = "text"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)(pcVar12 + -0xb6e37b); for (puVar21 = (undefined4 *)puVar21[8]; puVar21 != (undefined4 *)0x0; puVar21 = (undefined4 *)puVar21[6]) { pbVar16 = (byte *)*puVar21; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = (char *)puVar21[2]; } if ((byte *)pcVar20 == local_1c4) { pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar14 <= pbVar16) goto LAB_00854c91; iVar17 = (int)&DAT_00b6e37c - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00854c91; } } } puVar21 = (undefined4 *)0x0; LAB_00854c91: pbVar16 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar16 = (byte *)puVar21[1]; } pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign((char *)local_a8,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); pcVar20 = "player"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1d4 = (int *)(pcVar12 + -0xb66eeb); local_1c4 = (byte *)local_1c8[8]; pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00854cf0: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1d4) goto LAB_00854d71; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"player" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00854d20; } goto LAB_00854d71; } LAB_00854d20: local_204 = (int *)0x0; local_200 = (int *)0x0; local_1fc = 0; local_14._0_1_ = 2; pcVar20 = "player"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb66eeb) break; LAB_00854dba: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00854dc7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 3; string_split(&local_204); local_14._0_1_ = 2; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_200 - (int)local_204) / 0x18); local_1cc = local_204; if (local_1d0 != (byte *)0x0) { piVar13 = local_204; do { puVar21 = puStack_8c; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1d4 = (int *)atoi((char *)piVar11); if (puVar21 == puStack_88) { std::vector::_Emplace_reallocate(puVar21,&local_1d4); } else { *puVar21 = local_1d4; puStack_8c = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1cc; local_14._0_1_ = 1; if (local_1cc != (int *)0x0) { piVar11 = local_200; piVar19 = local_1cc; if (local_1cc != local_200) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_008560f7; } operator_delete(pvVar8,uVar15); piVar11 = local_200; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_1fc - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_008560f7; } operator_delete(piVar11,uVar18); local_204 = (int *)0x0; local_200 = (int *)0x0; local_1fc = 0; } goto LAB_00854fbe; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"player" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00854dc7; } goto LAB_00854dba; } goto LAB_00854dc7; } LAB_00854fbe: pcVar20 = "notplayer"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e383); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00854fe6: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00855066; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"notplayer" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_0085501c; } goto LAB_00855066; } LAB_0085501c: local_210 = (int *)0x0; local_20c = (int *)0x0; local_208 = 0; local_14._0_1_ = 4; pcVar20 = "notplayer"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e383) break; LAB_008550aa: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_008550b7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 5; string_split(&local_210); local_14._0_1_ = 4; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_20c - (int)local_210) / 0x18); local_1d4 = local_210; if (local_1d0 != (byte *)0x0) { piVar13 = local_210; do { puVar21 = local_80; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1cc = (int *)atoi((char *)piVar11); if (puVar21 == puStack_7c) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; local_80 = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1d4; local_14._0_1_ = 1; if (local_1d4 != (int *)0x0) { piVar11 = local_20c; piVar19 = local_1d4; if (local_1d4 != local_20c) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_008560f7; } operator_delete(pvVar8,uVar15); piVar11 = local_20c; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_208 - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_008560f7; } operator_delete(piVar11,uVar18); local_210 = (int *)0x0; local_20c = (int *)0x0; local_208 = 0; } goto LAB_008552ae; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"notplayer" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008550b7; } goto LAB_008550aa; } goto LAB_008550b7; } LAB_008552ae: pcVar20 = "collectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e397); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_008552d6: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00855356; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"collectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_0085530c; } goto LAB_00855356; } LAB_0085530c: local_21c = (int *)0x0; local_218 = (int *)0x0; local_214 = 0; local_14._0_1_ = 6; pcVar20 = "collectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e397) break; LAB_0085539a: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_008553a7: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 7; string_split(&local_21c); local_14._0_1_ = 6; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_218 - (int)local_21c) / 0x18); local_1d4 = local_21c; if (local_1d0 != (byte *)0x0) { piVar13 = local_21c; do { puVar21 = puStack_74; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1cc = (int *)atoi((char *)piVar11); if (puVar21 == local_70) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; puStack_74 = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1d4; local_14._0_1_ = 1; if (local_1d4 != (int *)0x0) { piVar11 = local_218; piVar19 = local_1d4; if (local_1d4 != local_218) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_008560f7; } operator_delete(pvVar8,uVar15); piVar11 = local_218; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_214 - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_008560f7; } operator_delete(piVar11,uVar18); local_21c = (int *)0x0; local_218 = (int *)0x0; local_214 = 0; } goto LAB_0085559e; } } pbVar14 = pbVar16 + (int)pcVar20; if (pbVar16 < pbVar14) { iVar17 = (int)"collectible" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_008553a7; } goto LAB_0085539a; } goto LAB_008553a7; } LAB_0085559e: pcVar20 = "notcollectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e35f); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_008555c6: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00855646; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"notcollectible" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_008555fc; } goto LAB_00855646; } LAB_008555fc: local_228 = (int *)0x0; local_224 = (int *)0x0; local_220 = 0; local_14._0_1_ = 8; pcVar20 = "notcollectible"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e35f) break; LAB_0085568a: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00855697: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 9; string_split(&local_228); local_14._0_1_ = 8; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_224 - (int)local_228) / 0x18); local_1d4 = local_228; if (local_1d0 != (byte *)0x0) { piVar13 = local_228; do { puVar21 = puStack_68; piVar11 = piVar13; if (0xf < (uint)piVar13[5]) { piVar11 = (int *)*piVar13; } local_1cc = (int *)atoi((char *)piVar11); if (puVar21 == puStack_64) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; puStack_68 = puVar21 + 1; } piVar13 = piVar13 + 6; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } piVar13 = local_1d4; local_14._0_1_ = 1; if (local_1d4 != (int *)0x0) { piVar11 = local_224; piVar19 = local_1d4; if (local_1d4 != local_224) { do { uVar18 = piVar19[5]; if (0xf < uVar18) { pvVar7 = (void *)*piVar19; uVar15 = uVar18 + 1; pvVar8 = pvVar7; if (0xfff < uVar15) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar15 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) goto LAB_008560f7; } operator_delete(pvVar8,uVar15); piVar11 = local_224; } piVar19[4] = 0; piVar19[5] = 0xf; *(char *)piVar19 = '\0'; piVar19 = piVar19 + 6; } while (piVar19 != piVar11); } uVar18 = ((local_220 - (int)piVar13) / 0x18) * 0x18; piVar11 = piVar13; if (0xfff < uVar18) { piVar11 = (int *)piVar13[-1]; uVar18 = uVar18 + 0x23; if ((char *)0x1f < (char *)((int)piVar13 + (-4 - (int)piVar11))) goto LAB_008560f7; } operator_delete(piVar11,uVar18); local_228 = (int *)0x0; local_224 = (int *)0x0; local_220 = 0; } goto LAB_00855891; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"notcollectible" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00855697; } goto LAB_0085568a; } goto LAB_00855697; } LAB_00855891: pcVar20 = "trinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb66fcf); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_008558c0: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00855943; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"trinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_008558f4; } goto LAB_00855943; } LAB_008558f4: local_1e8 = (char *)0x0; local_1e4 = (char *)0x0; local_1e0 = 0; local_14._0_1_ = 10; pcVar20 = "trinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb66fcf) break; LAB_0085598a: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00855997: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 0xb; string_split(&local_1e8); local_14._0_1_ = 10; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_1e4 - (int)local_1e8) / 0x18); if (local_1d0 != (byte *)0x0) { pcVar20 = local_1e8; do { puVar21 = puStack_5c; pcVar12 = pcVar20; if (0xf < *(uint *)(pcVar20 + 0x14)) { pcVar12 = *(char **)pcVar20; } local_1cc = (int *)atoi(pcVar12); if (puVar21 == puStack_58) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; puStack_5c = puVar21 + 1; } pcVar20 = pcVar20 + 0x18; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } pcVar12 = local_1e4; local_14._0_1_ = 1; pcVar20 = local_1e8; if (local_1e8 != (char *)0x0) { for (; pcVar20 != pcVar12; pcVar20 = pcVar20 + 0x18) { std::string::_Tidy_deallocate(pcVar20); } deallocate(local_1e8,(local_1e0 - (int)local_1e8) / 0x18); local_1e8 = (char *)0x0; local_1e4 = (char *)0x0; local_1e0 = 0; } goto LAB_00855b29; } } pbVar14 = pbVar16 + (int)pcVar20; if (pbVar16 < pbVar14) { iVar17 = (int)"trinket" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00855997; } goto LAB_0085598a; } goto LAB_00855997; } LAB_00855b29: pcVar20 = "nottrinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e36f); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00855b53: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00855bd6; pbVar1 = (byte *)((int)piVar13 + (int)pbVar14); if (pbVar14 < pbVar1) { iVar17 = (int)"nottrinket" - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00855b8c; } goto LAB_00855bd6; } LAB_00855b8c: local_1f4 = (char *)0x0; local_1f0 = (char *)0x0; local_1ec = 0; local_14._0_1_ = 0xc; pcVar20 = "nottrinket"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e36f) break; LAB_00855c1a: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00855c27: local_3c._size = 0; pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar14 = pbVar16; do { bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar2 != 0); std::string::assign(local_3c._buf,pbVar16,(int)pbVar14 - (int)(pbVar16 + 1)); local_14._0_1_ = 0xd; string_split(&local_1f4); local_14._0_1_ = 0xc; if (0xf < local_3c._capacity) { uVar18 = local_3c._capacity + 1; pvVar7 = (void *)local_3c._buf._0_4_; if (0xfff < uVar18) { pvVar7 = *(void **)(local_3c._buf._0_4_ + -4); uVar18 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } local_1c4 = (byte *)0x0; local_1d0 = (byte *)(((int)local_1f0 - (int)local_1f4) / 0x18); if (local_1d0 != (byte *)0x0) { pcVar20 = local_1f4; do { puVar21 = local_50; pcVar12 = pcVar20; if (0xf < *(uint *)(pcVar20 + 0x14)) { pcVar12 = *(char **)pcVar20; } local_1cc = (int *)atoi(pcVar12); if (puVar21 == puStack_4c) { std::vector::_Emplace_reallocate(puVar21,&local_1cc); } else { *puVar21 = local_1cc; local_50 = puVar21 + 1; } pcVar20 = pcVar20 + 0x18; local_1c4 = local_1c4 + 1; } while (local_1c4 < local_1d0); } pcVar12 = local_1f0; local_14._0_1_ = 1; pcVar20 = local_1f4; if (local_1f4 != (char *)0x0) { for (; pcVar20 != pcVar12; pcVar20 = pcVar20 + 0x18) { std::string::_Tidy_deallocate(pcVar20); } deallocate(local_1f4,(local_1ec - (int)local_1f4) / 0x18); local_1f4 = (char *)0x0; local_1f0 = (char *)0x0; local_1ec = 0; } goto LAB_00855db9; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)"nottrinket" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00855c27; } goto LAB_00855c1a; } goto LAB_00855c27; } LAB_00855db9: pcVar20 = "achievement"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb66fab); puVar21 = (undefined4 *)local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00855de3: pbVar16 = (byte *)*puVar21; if (pbVar16 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar16 = &g_xmlNullStr; } else { piVar13 = (int *)puVar21[2]; } if (piVar13 != local_1cc) goto LAB_00855e41; pbVar14 = pbVar16 + (int)piVar13; if (pbVar16 < pbVar14) { iVar17 = (int)"achievement" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00855e13; } goto LAB_00855e41; } LAB_00855e13: pcVar20 = "achievement"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)((int)local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb66fab) break; LAB_00855e80: local_1c4 = *(byte **)((int)local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00855e8d: pbVar16 = &g_xmlNullStr; if (*(byte **)((int)local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)((int)local_1c4 + 4); } iStack_48 = atoi((char *)pbVar16); goto LAB_00855ead; } } pbVar14 = pbVar16 + (int)pcVar20; if (pbVar16 < pbVar14) { iVar17 = (int)"achievement" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00855e8d; } goto LAB_00855e80; } goto LAB_00855e8d; } LAB_00855ead: pcVar20 = "tag"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); local_1c4 = (byte *)local_1c8[8]; local_1cc = (int *)(pcVar12 + -0xb6e3b3); pbVar16 = local_1c4; if (local_1c4 != (byte *)0x0) { LAB_00855ed5: pbVar14 = *(byte **)pbVar16; if (pbVar14 == (byte *)0x0) { piVar13 = (int *)0x0; pbVar14 = &g_xmlNullStr; } else { piVar13 = *(int **)(pbVar16 + 8); } if (piVar13 != local_1cc) goto LAB_00855f34; pbVar1 = pbVar14 + (int)piVar13; if (pbVar14 < pbVar1) { iVar17 = (int)&DAT_00b6e3b4 - (int)pbVar14; while (*pbVar14 == pbVar14[iVar17]) { pbVar14 = pbVar14 + 1; if (pbVar1 <= pbVar14) goto LAB_00855f0c; } goto LAB_00855f34; } LAB_00855f0c: pcVar20 = "tag"; do { pcVar12 = pcVar20; pcVar20 = pcVar12 + 1; } while (*pcVar20 != '\0'); while( true ) { pbVar16 = *(byte **)local_1c4; if (pbVar16 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar16 = &g_xmlNullStr; } else { pcVar20 = *(char **)(local_1c4 + 8); } if (pcVar20 == pcVar12 + -0xb6e3b3) break; LAB_00855f7a: local_1c4 = *(byte **)(local_1c4 + 0x18); if (local_1c4 == (byte *)0x0) { LAB_00855f87: pbVar16 = &g_xmlNullStr; if (*(byte **)(local_1c4 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(local_1c4 + 4); } iStack_44 = atoi((char *)pbVar16); goto LAB_00855fa1; } } pbVar14 = (byte *)(pcVar20 + (int)pbVar16); if (pbVar16 < pbVar14) { iVar17 = (int)&DAT_00b6e3b4 - (int)pbVar16; while (*pbVar16 == pbVar16[iVar17]) { pbVar16 = pbVar16 + 1; if (pbVar14 <= pbVar16) goto LAB_00855f87; } goto LAB_00855f7a; } goto LAB_00855f87; } LAB_00855fa1: pvVar7 = (void *)puVar9[0xc]; if (pvVar7 == (void *)puVar9[0xd]) { std::vector<104byte>::_Emplace_reallocate(pvVar7,local_a8); } else { InfoDisplayEntry::copy_constructor(pvVar7,local_a8); puVar9[0xc] = puVar9[0xc] + 0x68; } puVar21 = (undefined4 *)local_1c8[0xb]; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_1c8 = puVar21; if (pvStack_54 != (void *)0x0) { deallocate(pvStack_54,(int)puStack_4c - (int)pvStack_54 >> 2); } if (local_60 != (void *)0x0) { deallocate(local_60,(int)puStack_58 - (int)local_60 >> 2); } if (pvStack_6c != (void *)0x0) { deallocate(pvStack_6c,(int)puStack_64 - (int)pvStack_6c >> 2); } if (pvStack_78 != (void *)0x0) { deallocate(pvStack_78,(int)local_70 - (int)pvStack_78 >> 2); } if (pvStack_84 != (void *)0x0) { deallocate(pvStack_84,(int)puStack_7c - (int)pvStack_84 >> 2); } if (local_90 != (void *)0x0) { deallocate(local_90,(int)puStack_88 - (int)local_90 >> 2); } if (0xf < local_94) { uVar18 = local_94 + 1; pvVar7 = local_a8[0]; if (0xfff < uVar18) { pvVar7 = *(void **)((int)local_a8[0] + -4); uVar18 = local_94 + 0x24; if (0x1f < (uint)((int)local_a8[0] + (-4 - (int)pvVar7))) goto LAB_008560f7; } operator_delete(pvVar7,uVar18); } } while (puVar21 != (undefined4 *)0x0); } } local_1f8 = *(void **)((int)local_1f8 + 0x2c); } while (local_1f8 != (void *)0x0); } ExceptionList = local_1c; return; LAB_00854d71: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00854fbe; goto LAB_00854cf0; LAB_00855066: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_008552ae; goto LAB_00854fe6; LAB_00855356: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_0085559e; goto LAB_008552d6; LAB_00855646: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00855891; goto LAB_008555c6; LAB_00855943: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00855b29; goto LAB_008558c0; LAB_00855bd6: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00855db9; goto LAB_00855b53; LAB_00855e41: puVar21 = (undefined4 *)puVar21[6]; if (puVar21 == (undefined4 *)0x0) goto LAB_00855ead; goto LAB_00855de3; LAB_00855f34: pbVar16 = *(byte **)(pbVar16 + 0x18); if (pbVar16 == (byte *)0x0) goto LAB_00855fa1; goto LAB_00855ed5; } //@@ 00856100 FUN_00856100 int FUN_00856100(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_00856400(local_10,param_1); return *piVar1 + 0x14; } //@@ 00856120 std::map::erase /* DB: ? erase(key): equal_range over the red-black tree on int key at node+0x10, then erases the range (node value holds std::strings: _Tidy_deallocate), returns count; InfoDisplay xml loaders replace an existing id */ int std::map::erase(int *param_1) { char cVar1; int *piVar2; int *piVar3; int *piVar4; void *ptr; undefined4 *in_ECX; int *piVar5; int iVar6; int *piVar7; int *piVar8; int local_10; piVar2 = (int *)*in_ECX; piVar4 = (int *)piVar2[1]; piVar7 = piVar2; piVar8 = piVar2; if (*(char *)((int)piVar4 + 0xd) == '\0') { piVar3 = piVar4; do { if (piVar3[4] < *param_1) { piVar5 = (int *)piVar3[2]; } else { if ((*(char *)((int)piVar8 + 0xd) != '\0') && (*param_1 < piVar3[4])) { piVar8 = piVar3; } piVar5 = (int *)*piVar3; piVar7 = piVar3; } piVar3 = piVar5; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar4 = (int *)*piVar8; } if (*(char *)((int)piVar4 + 0xd) == '\0') { do { if (*param_1 < piVar4[4]) { piVar3 = (int *)*piVar4; piVar8 = piVar4; } else { piVar3 = (int *)piVar4[2]; } piVar4 = piVar3; } while (*(char *)((int)piVar3 + 0xd) == '\0'); } iVar6 = 0; local_10 = 0; piVar4 = piVar7; if (piVar7 != piVar8) { do { piVar3 = (int *)piVar4[2]; iVar6 = iVar6 + 1; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; while ((piVar4 = piVar5, cVar1 == '\0' && (piVar3 == (int *)piVar4[2]))) { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; } } } while (piVar4 != piVar8); local_10 = iVar6; } param_1 = piVar7; if ((piVar7 == (int *)*piVar2) && (*(char *)((int)piVar8 + 0xd) != '\0')) { _Erase_tree(in_ECX,piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar7 != piVar8) { do { piVar2 = param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); vector::_Tidy(); vector::_Tidy(); vector::_Tidy(); string::_Tidy_deallocate((char *)((int)ptr + 0x1c)); operator_delete(ptr,0x128); } while (param_1 != piVar8); return local_10; } return local_10; } //@@ 00856280 FUN_00856280 void FUN_00856280(void *param_1) { void *this; int in_ECX; this = *(void **)(in_ECX + 4); if (this == *(void **)(in_ECX + 8)) { std::vector<104byte>::_Emplace_reallocate(this,param_1); return; } InfoDisplayEntry::copy_constructor(this,param_1); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x68; return; } //@@ 008562b0 std::vector::_Tidy /* DB: destroys elements (FUN_00856840) and frees storage with stride 0x68 (matches 008568a0 InfoDisplayEntry::copy_constructor ctor size); InfoDisplay xml loaders */ void std::vector::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00856840(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x68) * 0x68; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00856330 FUN_00856330 void FUN_00856330(void) { FUN_00856840(); return; } //@@ 00856350 FUN_00856350 void FUN_00856350(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x68; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 00856390 FUN_00856390 void FUN_00856390(void *param_1) { byte bVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; byte *pbVar5; std_string *psVar6; undefined4 *in_ECX; byte *in_EDX; pbVar5 = in_EDX; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); psVar6 = std_string_insert(param_1,0,in_EDX,(int)pbVar5 - (int)(in_EDX + 1)); *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar2 = *(undefined4 *)(psVar6->_buf + 4); uVar3 = *(undefined4 *)(psVar6->_buf + 8); uVar4 = *(undefined4 *)(psVar6->_buf + 0xc); *in_ECX = *(undefined4 *)psVar6->_buf; in_ECX[1] = uVar2; in_ECX[2] = uVar3; in_ECX[3] = uVar4; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)&psVar6->_size; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; return; } //@@ 00856400 FUN_00856400 void FUN_00856400(int *param_1,int *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03455; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; std::set::find_node(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(int *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xdd67c8) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = (int *)0x0; piVar6 = operator_new(0x128); local_8 = 1; piVar6[4] = *param_2; local_14 = piVar6; InfoDisplayEntry::InfoDisplayEntry(piVar6 + 5); *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_00856552: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_00856552; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 008565e0 std::map::_Erase_tree /* DB: recursive _Erase_tree: right subtree, then 3 vector::_Tidy + string, delete 0x128 node; InfoDisplay::~InfoDisplay, InfoDisplay::load_xml, std::map::erase */ void std::map::_Erase_tree(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { _Erase_tree(param_1,param_2[2]); piVar2 = (int *)*param_2; vector::_Tidy(); vector::_Tidy(); vector::_Tidy(); string::_Tidy_deallocate((char *)(param_2 + 7)); operator_delete(param_2,0x128); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00856650 std::vector<104byte>::_Emplace_reallocate /* DB: element size 0x68, max 0x2762762, grows x1.5, _Xlen; InfoDisplay xml loaders push entries */ void * std::vector<104byte>::_Emplace_reallocate(int param_1,void *param_2) { uint uVar1; int iVar2; void *pvVar3; void *pvVar4; int *in_ECX; uint uVar5; void *this; int extraout_ECX; uint uVar6; int iVar7; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03480; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar7 = (in_ECX[1] - *in_ECX) / 0x68; if (iVar7 == 0x2762762) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar7 + 1; uVar6 = (in_ECX[2] - *in_ECX) / 0x68; if (0x2762762 - (uVar6 >> 1) < uVar6) { uVar5 = 0x2762762; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar5 = uVar1; if (uVar1 <= uVar6) { uVar5 = uVar6; } if (0x2762762 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = _Allocate(uVar5 * 0x68); local_8 = 0; this = (void *)(((param_1 - iVar2) / 0x68) * 0x68 + (int)pvVar4); InfoDisplayEntry::copy_constructor(this,param_2); iVar2 = in_ECX[1]; iVar7 = *in_ECX; if (param_1 == iVar2) { for (; iVar7 != iVar2; iVar7 = iVar7 + 0x68) { FUN_00856e10(iVar7); param_1 = extraout_ECX; } FUN_00856840(param_1); } else { FUN_00856960(iVar7,param_1,pvVar4); FUN_00856960(param_1,in_ECX[1],(int)this + 0x68); } if (*in_ECX != 0) { FUN_00856840(*in_ECX); pvVar3 = (void *)*in_ECX; uVar6 = ((in_ECX[2] - (int)pvVar3) / 0x68) * 0x68; ptr = pvVar3; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar3 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } *in_ECX = (int)pvVar4; in_ECX[1] = (int)(uVar1 * 0x68 + (int)pvVar4); in_ECX[2] = (int)(uVar5 * 0x68 + (int)pvVar4); ExceptionList = local_10; return this; } //@@ 0085680b Catch_All@0085680b void Catch_All_0085680b(void) { int unaff_EBP; FUN_00856330(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x28)); FUN_00856350(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00856840 FUN_00856840 void FUN_00856840(void) { int iVar1; int in_ECX; int in_EDX; void *this; if (in_ECX != in_EDX) { this = (void *)(in_ECX + 0x48); do { FID_conflict__Tidy((void *)((int)this + 0xc)); FID_conflict__Tidy(this); FID_conflict__Tidy((void *)((int)this + -0xc)); FID_conflict__Tidy((void *)((int)this + -0x18)); FID_conflict__Tidy((void *)((int)this + -0x24)); FID_conflict__Tidy((void *)((int)this + -0x30)); std::string::_Tidy_deallocate((char *)((int)this + -0x48)); iVar1 = (int)this + 0x20; this = (void *)((int)this + 0x68); } while (iVar1 != in_EDX); } return; } //@@ 008568a0 InfoDisplayEntry::copy_constructor /* DB: ? copy ctor: std::string at +0 then six std::vector at +0x18..+0x54 and two ints +0x60/+0x64; used by InfoDisplay xml loaders (collectibles/trinkets/pills) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall InfoDisplayEntry::copy_constructor(void *this,void *other) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b034e4; local_10 = ExceptionList; ExceptionList = &local_10; std::string::string(this,other); local_8 = 0; std::vector::copy_constructor((int)other + 0x18); local_8._0_1_ = 1; std::vector::copy_constructor((int)other + 0x24); local_8._0_1_ = 2; std::vector::copy_constructor((int)other + 0x30); local_8._0_1_ = 3; std::vector::copy_constructor((int)other + 0x3c); local_8._0_1_ = 4; std::vector::copy_constructor((int)other + 0x48); local_8 = CONCAT31(local_8._1_3_,5); std::vector::copy_constructor((int)other + 0x54); *(undefined4 *)((int)this + 0x60) = *(undefined4 *)((int)other + 0x60); *(undefined4 *)((int)this + 100) = *(undefined4 *)((int)other + 100); ExceptionList = local_10; return; } //@@ 00856960 FUN_00856960 int FUN_00856960(int param_1,int param_2,int param_3) { undefined4 in_ECX; undefined4 extraout_ECX; for (; param_1 != param_2; param_1 = param_1 + 0x68) { FUN_00856e10(param_1); param_3 = param_3 + 0x68; in_ECX = extraout_ECX; } FUN_00856840(in_ECX); return param_3; } //@@ 008569a0 std::vector<104byte>::assign /* DB: range assign of 0x68-byte elements (max 0x2762762; shrink path FUN_00856ba0 copy + FUN_00856840 destroy tail); three times from InfoDisplayEntry::operator_assign for its vectors at +0x20/+0x2c/+0x38 */ void std::vector<104byte>::assign(int param_1,void *param_2) { uint uVar1; uint uVar2; void *pvVar3; uint uVar4; int *in_ECX; uint uVar5; void *pvVar6; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0351d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar3 = (void *)*in_ECX; uVar5 = ((int)param_2 - param_1) / 0x68; uVar4 = (in_ECX[1] - (int)pvVar3) / 0x68; if (uVar5 <= uVar4) { copy<104byte>(pvVar3,uVar2); FUN_00856840(); in_ECX[1] = (int)(uVar5 * 0x68 + (int)pvVar3); ExceptionList = local_10; return; } uVar1 = (in_ECX[2] - (int)pvVar3) / 0x68; if (uVar1 < uVar5) { if (0x2762762 < uVar5) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x2762762 - (uVar1 >> 1) < uVar1) { local_14 = 0x2762762; } else { local_14 = (uVar1 >> 1) + uVar1; if (local_14 < uVar5) { local_14 = uVar5; } } if (pvVar3 != (void *)0x0) { FUN_00856840(uVar1); pvVar3 = (void *)*in_ECX; uVar5 = ((in_ECX[2] - (int)pvVar3) / 0x68) * 0x68; pvVar6 = pvVar3; if (0xfff < uVar5) { pvVar6 = *(void **)((int)pvVar3 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar5); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x2762762 < local_14) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar3 = _Allocate(local_14 * 0x68); *in_ECX = (int)pvVar3; in_ECX[1] = (int)pvVar3; in_ECX[2] = (int)(local_14 * 0x68 + (int)pvVar3); uVar4 = 0; } pvVar6 = (void *)(uVar4 * 0x68 + param_1); copy<104byte>(pvVar3,uVar2); pvVar3 = (void *)in_ECX[1]; local_8 = 0; for (; pvVar6 != param_2; pvVar6 = (void *)((int)pvVar6 + 0x68)) { InfoDisplayEntry::copy_constructor(pvVar3,pvVar6); pvVar3 = (void *)((int)pvVar3 + 0x68); } in_ECX[1] = (int)pvVar3; ExceptionList = local_10; return; } //@@ 00856b90 FUN_00856b90 void FUN_00856b90(void) { FUN_00856840(); return; } //@@ 00856ba0 std::copy<104byte> /* DB: element-wise copy-assign loop over 0x68-byte elements (std::string::assign at +0, vector reserve_clear+memmove at +0x18..); called by std::vector<104byte>::assign (0x8569a0, from InfoDisplayEntry::operator_assign) */ byte * std::copy<104byte>(byte *param_1) { void *pvVar1; int iVar2; byte *pbVar3; byte *in_ECX; byte *in_EDX; byte *this; size_t sVar4; byte *pbVar5; byte *pbVar6; if (in_ECX == in_EDX) { return param_1; } pbVar6 = in_ECX + 0x28; pbVar5 = param_1 + 0x20; iVar2 = -0x20 - (int)param_1; this = param_1; do { pbVar3 = pbVar5 + (int)(in_ECX + iVar2); if (this != pbVar3) { if (0xf < *(uint *)(pbVar6 + -0x14)) { pbVar3 = *(byte **)pbVar3; } string::assign((char *)this,pbVar3,*(uint *)(pbVar6 + -0x18)); } if (pbVar5 != pbVar6 + -8) { pvVar1 = *(void **)(pbVar6 + -0x10); param_1 = *(byte **)(pbVar5 + -8); sVar4 = *(int *)(pbVar6 + -0xc) - (int)pvVar1; if ((uint)(*(int *)pbVar5 - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)(pbVar5 + -8); } memmove(param_1,pvVar1,sVar4); *(size_t *)(pbVar5 + -4) = (int)param_1 + sVar4; } pbVar3 = pbVar5 + 4; if (pbVar3 != pbVar6 + -4) { pvVar1 = *(void **)(pbVar6 + -4); sVar4 = *(int *)pbVar6 - (int)pvVar1; param_1 = *(byte **)pbVar3; if ((uint)(*(int *)(pbVar5 + 0xc) - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)pbVar3; } memmove(param_1,pvVar1,sVar4); *(size_t *)(pbVar5 + 8) = (int)param_1 + sVar4; } pbVar3 = pbVar5 + 0x10; if (pbVar3 != pbVar6 + 8) { pvVar1 = *(void **)(pbVar6 + 8); sVar4 = *(int *)(pbVar6 + 0xc) - (int)pvVar1; param_1 = *(byte **)pbVar3; if ((uint)(*(int *)(pbVar5 + 0x18) - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)pbVar3; } memmove(param_1,pvVar1,sVar4); *(size_t *)(pbVar5 + 0x14) = (int)param_1 + sVar4; } pbVar3 = pbVar5 + 0x1c; if (pbVar3 != pbVar6 + 0x14) { pvVar1 = *(void **)(pbVar6 + 0x14); sVar4 = *(int *)(pbVar6 + 0x18) - (int)pvVar1; param_1 = *(byte **)pbVar3; if ((uint)(*(int *)(pbVar5 + 0x24) - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)pbVar3; } memmove(param_1,pvVar1,sVar4); *(size_t *)(pbVar5 + 0x20) = (int)param_1 + sVar4; } pbVar3 = pbVar5 + 0x28; if (pbVar3 != pbVar6 + 0x20) { pvVar1 = *(void **)(pbVar6 + 0x20); sVar4 = *(int *)(pbVar6 + 0x24) - (int)pvVar1; param_1 = *(byte **)pbVar3; if ((uint)(*(int *)(pbVar5 + 0x30) - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)pbVar3; } memmove(param_1,pvVar1,sVar4); *(size_t *)(pbVar5 + 0x2c) = (int)param_1 + sVar4; } pbVar3 = pbVar5 + 0x34; if (pbVar3 != pbVar6 + 0x2c) { pvVar1 = *(void **)(pbVar6 + 0x2c); sVar4 = *(int *)(pbVar6 + 0x30) - (int)pvVar1; param_1 = *(byte **)pbVar3; if ((uint)(*(int *)(pbVar5 + 0x3c) - (int)param_1 >> 2) < (uint)((int)sVar4 >> 2)) { vector::reserve_clear((int)sVar4 >> 2); param_1 = *(byte **)pbVar3; } memmove(param_1,pvVar1,sVar4); *(size_t *)(pbVar5 + 0x38) = (int)param_1 + sVar4; } *(int *)(pbVar5 + 0x40) = *(int *)(pbVar6 + 0x38); this = this + 0x68; pbVar3 = pbVar6 + 0x3c; pbVar6 = pbVar6 + 0x68; *(int *)(pbVar5 + 0x44) = *(int *)pbVar3; pbVar5 = pbVar5 + 0x68; } while (pbVar5 + (int)(in_ECX + iVar2) != in_EDX); return this; } //@@ 00856e10 FUN_00856e10 void FUN_00856e10(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; uVar1 = param_1[8]; uVar2 = param_1[7]; uVar3 = param_1[6]; param_1[8] = 0; param_1[7] = 0; param_1[6] = 0; in_ECX[6] = uVar3; in_ECX[7] = uVar2; in_ECX[8] = uVar1; uVar1 = param_1[0xb]; uVar2 = param_1[10]; uVar3 = param_1[9]; param_1[0xb] = 0; param_1[10] = 0; param_1[9] = 0; in_ECX[9] = uVar3; in_ECX[10] = uVar2; in_ECX[0xb] = uVar1; uVar1 = param_1[0xe]; uVar2 = param_1[0xd]; uVar3 = param_1[0xc]; param_1[0xe] = 0; param_1[0xd] = 0; param_1[0xc] = 0; in_ECX[0xc] = uVar3; in_ECX[0xd] = uVar2; in_ECX[0xe] = uVar1; uVar1 = param_1[0x11]; uVar2 = param_1[0x10]; uVar3 = param_1[0xf]; param_1[0x11] = 0; param_1[0x10] = 0; param_1[0xf] = 0; in_ECX[0xf] = uVar3; in_ECX[0x10] = uVar2; in_ECX[0x11] = uVar1; uVar1 = param_1[0x14]; uVar2 = param_1[0x13]; uVar3 = param_1[0x12]; param_1[0x14] = 0; param_1[0x13] = 0; param_1[0x12] = 0; in_ECX[0x12] = uVar3; in_ECX[0x13] = uVar2; in_ECX[0x14] = uVar1; uVar1 = param_1[0x15]; uVar2 = param_1[0x17]; uVar3 = param_1[0x16]; param_1[0x17] = 0; param_1[0x16] = 0; param_1[0x15] = 0; in_ECX[0x15] = uVar1; in_ECX[0x16] = uVar3; in_ECX[0x17] = uVar2; in_ECX[0x18] = param_1[0x18]; in_ECX[0x19] = param_1[0x19]; return; } //@@ 00856f50 FUN_00856f50 int FUN_00856f50(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 8); uVar2 = (uint3)((uint)iVar1 >> 8); if ((iVar1 == 2) || (iVar1 == 0)) { return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 00856f70 Leaderboard::constructor /* DB: Game::constructor calls it at state 0x1c right after zeroing Game+0x1d64c, i.e. at Game+0x1d650 = _leaderboard (src/structs.hpp), just before HUD::constructor; builds ANM2s at +0x10/+0x124, ChallengeParams, ChallengeParam::Reset, ScoreSheet::ScoreSheet; MenuManager::constructor builds its own */ void Leaderboard::constructor(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0355e; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 4) = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x10)); local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x124)); local_8 = CONCAT31(local_8._1_3_,1); *(undefined4 *)(in_ECX + 0x238) = 0; *(undefined4 *)(in_ECX + 0x23c) = 0; *(undefined4 *)(in_ECX + 0x240) = 0; *(undefined4 *)(in_ECX + 0x244) = 0; *(undefined4 *)(in_ECX + 0x248) = 0; ChallengeParams::ChallengeParams((void *)(in_ECX + 0x268)); *(undefined4 *)(in_ECX + 600) = 0; *(undefined4 *)(in_ECX + 0x25c) = 0; *(undefined4 *)(in_ECX + 0x264) = 0; *(undefined1 *)(in_ECX + 0x260) = 0; ChallengeParam::Reset((ChallengeParam *)(in_ECX + 0x268)); ScoreSheet::ScoreSheet((ScoreSheet *)(in_ECX + 0x30c)); *(undefined2 *)(in_ECX + 0x3a8) = 0; ExceptionList = local_10; return; } //@@ 00857050 Leaderboard::~Leaderboard /* DB: inverse of 00856f70: frees the 0x28-byte element array at +0x248, four vectors, 004269f0, and resets ANM2s at +0x124/+0x10; Game::~Game destroys it right before HUD's position in reverse ctor order; 008cf510 (MenuManager side) prototype: db/protos.zhl */ void __thiscall Leaderboard::~Leaderboard(Leaderboard *this) { uint *ptr; void *pvVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03580; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE::System::LeaderboardManager::release_result(-1); pvVar1 = *(void **)(this + 0x49); this[0x48]._state = 0; *(undefined4 *)(this + 0x48) = 0; this[0x47]._state = 0; *(undefined4 *)(this + 0x47) = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0x28,*ptr,FUN_00a51500); operator_delete(ptr,*ptr * 0x28 + 4); *(undefined4 *)(this + 0x49) = 0; } std::vector<12byte>::_Tidy(uVar2); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); FUN_004269f0(); local_8 = 2; ANM2::Reset((ANM2 *)&this[0x24]._state); AnimationState::~AnimationState((AnimationState *)&this[0x2e]._state); AnimationState::~AnimationState((AnimationState *)&this[0x2a]._state); std::string::_Tidy_deallocate((char *)&this[0x27]._state); std::string::_Tidy_deallocate((char *)&this[0x24]._state); local_8 = 3; ANM2::Reset((ANM2 *)(this + 2)); AnimationState::~AnimationState((AnimationState *)(this + 0xc)); AnimationState::~AnimationState((AnimationState *)(this + 8)); std::string::_Tidy_deallocate((char *)(this + 5)); std::string::_Tidy_deallocate((char *)(this + 2)); ExceptionList = local_10; return; } //@@ 008571b0 FUN_008571b0 int * FUN_008571b0(void) { int *ptr; void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b035a0; local_10 = ExceptionList; ExceptionList = &local_10; ptr = (int *)((int)in_ECX + -4); _eh_vector_destructor_iterator_(in_ECX,0x28,*(uint *)((int)in_ECX + -4),FUN_00a51500); operator_delete(ptr,*ptr * 0x28 + 4); ExceptionList = local_10; return ptr; } //@@ 00857220 ScoreSheet::LoadAnm2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads ScoreMenu/LeaderboardMenu anm2 in LoadConfigXmls */ void ScoreSheet::LoadAnm2(void) { undefined4 *in_ECX; char *pcVar1; uint uVar2; std_string local_54; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b035d5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x15; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/ScoreMenu.anm2",0x16); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 4),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar2 = local_3c._capacity + 1; pcVar1 = (char *)local_3c._buf._0_4_; if (0xfff < uVar2) { pcVar1 = *(char **)(local_3c._buf._0_4_ + -4); uVar2 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,uVar2); } local_54._size = 0; local_54._capacity = 0xf; local_54._buf[0] = '\0'; local_54._buf[1] = '\0'; local_54._buf[2] = '\0'; local_54._buf[3] = '\0'; local_54._buf._0_4_ = std::_Allocate(0x20); local_54._size = 0x1b; local_54._capacity = 0x1f; builtin_strncpy((char *)local_54._buf._0_4_,"gfx/ui/LeaderboardMenu.anm2",0x1c); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x49),&local_54,1); if (0xf < local_54._capacity) { uVar2 = local_54._capacity + 1; pcVar1 = (char *)local_54._buf._0_4_; if (0xfff < uVar2) { pcVar1 = *(char **)(local_54._buf._0_4_ + -4); uVar2 = local_54._capacity + 0x24; if ((char *)0x1f < (char *)(local_54._buf._0_4_ + (-4 - (int)pcVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,uVar2); } *(undefined1 *)(in_ECX + 0xec) = 0; *in_ECX = 1; in_ECX[1] = 0; *(undefined2 *)(in_ECX + 0xea) = 0; ExceptionList = local_1c; return; } //@@ 00857400 FUN_00857400 undefined4 FUN_00857400(void) { int in_ECX; switch(*(undefined4 *)(in_ECX + 8)) { case 0: return *(undefined4 *)(in_ECX + 0x238); case 1: return *(undefined4 *)(in_ECX + 0x23c); case 2: return *(undefined4 *)(in_ECX + 0x240); case 3: return *(undefined4 *)(in_ECX + 0x244); default: KAGE_LogMessage(8,(byte *)"Invalid leaderboard type \n"); return 0; } } //@@ 00857450 Leaderboard::Update /* DB: this=Game._leaderboard (0x1d5f8): returns when _displayState (+4)==0; Appear/DisplayRankStart/DisplayRank/Loading anims; called from Game::Update when Game+0x1d654 != 0 and from the daily menu 008cf610 Menu_DailyChallenge::Update void Leaderboard::Update(void) { char cVar1; Manager *pMVar2; byte bVar3; uint uVar4; byte *pbVar5; int *in_ECX; char *pcVar6; int iVar7; bool bVar8; iVar7 = in_ECX[1]; if (iVar7 == 0) { return; } uVar4 = g_manager->_framecount & 0x80000001; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffe) + 1; } if (uVar4 == 1) { return; } if (*in_ECX == 0) { if (*(char *)((int)in_ECX + 0x119) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x10)); AnimationState::Update((AnimationState *)(in_ECX + 0x18)); iVar7 = in_ECX[1]; } if ((iVar7 == 1) && ((in_ECX[0x11] == 0 || ((char)in_ECX[0x15] == '\0')))) { ANM2::Play((ANM2 *)(in_ECX + 4),(byte *)"Loading",0); in_ECX[1] = 2; iVar7 = 2; } bVar3 = ANM2::IsPlaying((ANM2 *)(in_ECX + 4),(byte *)"Loading"); if (((bVar3 != 0) && ((char)in_ECX[0xe7] != '\0')) && (*(char *)((int)in_ECX + 0x39d) != '\0')) { ANM2::Play((ANM2 *)(in_ECX + 4),(byte *)"DisplayRankStart",0); in_ECX[1] = 3; iVar7 = 3; } if ((in_ECX[0x11] != 0) && ((char)in_ECX[0x15] == '\0')) { pbVar5 = (byte *)in_ECX[0x11]; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pcVar6 = "DisplayRankStart"; do { bVar3 = *pbVar5; bVar8 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_00857630: uVar4 = -(uint)bVar8 | 1; goto LAB_00857635; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar8 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_00857630; pbVar5 = pbVar5 + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00857635: if (uVar4 == 0) { ANM2::Play((ANM2 *)(in_ECX + 4),(byte *)"DisplayRank",0); iVar7 = in_ECX[1]; } } if ((iVar7 == 4) && ((in_ECX[0x11] == 0 || ((char)in_ECX[0x15] == '\0')))) { *in_ECX = 1; in_ECX[1] = 1; ANM2::Play((ANM2 *)(in_ECX + 0x49),(byte *)"Appear",0); } if ((char)in_ECX[0xec] == '\0') goto LAB_0085769c; if (in_ECX[0x11] != 0) { cVar1 = (char)in_ECX[0x15]; goto LAB_0085768c; } } else { if (*in_ECX != 1) goto LAB_0085769c; if (*(char *)((int)in_ECX + 0x22d) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x55)); AnimationState::Update((AnimationState *)(in_ECX + 0x5d)); iVar7 = in_ECX[1]; } if (iVar7 == 1) { if ((in_ECX[0x56] == 0) || ((char)in_ECX[0x5a] == '\0')) { in_ECX[1] = 2; ANM2::Play((ANM2 *)(in_ECX + 0x49),(byte *)"Loading",0); iVar7 = in_ECX[1]; goto LAB_008574e8; } } else { LAB_008574e8: if (iVar7 == 2) { if (in_ECX[0x92] == 0) goto LAB_00857530; in_ECX[1] = 3; ANM2::Play((ANM2 *)(in_ECX + 0x49),s_Idle,0); iVar7 = in_ECX[1]; } if ((iVar7 == 4) && ((in_ECX[0x56] == 0 || ((char)in_ECX[0x5a] == '\0')))) { in_ECX[1] = 0; } } LAB_00857530: if ((char)in_ECX[0xec] == '\0') goto LAB_0085769c; if (in_ECX[0x56] != 0) { cVar1 = (char)in_ECX[0x5a]; LAB_0085768c: if (cVar1 != '\0') goto LAB_0085769c; } } *(undefined1 *)(in_ECX + 0xec) = 0; in_ECX[1] = 0; LAB_0085769c: pMVar2 = g_manager; (g_manager->_popupButtons)._buttons[0]._isVisible = 0; (pMVar2->_popupButtons)._buttons[1]._isVisible = 0; return; } //@@ 008576c0 Leaderboard::update_input /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX Leaderboard (same fields as Leaderboard::Update 00857450: +4 display state, ANM2 +0x10): "Dissapear" on close, cycles leaderboard kind (+8, &3) and filter (+0xc) with Leaderboard::get_leaderboard; Manager::update_ingame_input, daily menu 008cf610 Menu_DailyChallenge::Update void Leaderboard::update_input(void) { undefined4 uVar1; Game *pGVar2; char cVar3; uint uVar4; Leaderboard *in_ECX; int iVar5; int iVar6; ANM2 *this; char *anim; KColor local_74 [2]; undefined4 local_4c; undefined4 local_48; uint local_44; int iStack_40; undefined4 uStack_3c; undefined4 uStack_38; int local_34; int iStack_30; int iStack_2c; int iStack_28; int local_24; int iStack_20; int iStack_1c; int iStack_18; int local_14; float local_8; local_8 = (float)(__security_cookie ^ (uint)&local_74[5]._alpha); if (in_ECX->_state != 0) { if (*(int *)in_ECX == 0) { if (((char)in_ECX[0x73]._state != '\0') && (*(char *)((int)&in_ECX[0x73]._state + 1) != '\0')) { local_48 = 0xe; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if (cVar3 != '\0') { in_ECX->_state = 4; ANM2::Play((ANM2 *)(in_ECX + 2),(byte *)"Dissapear",0); if ((*(int *)(in_ECX + 1) == 0) || (*(int *)(in_ECX + 1) == 1)) { iVar5 = 0; } else { iVar5 = 2; } get_leaderboard(in_ECX,iVar5,2); } } local_48 = 0xf; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if (cVar3 == '\0') { return; } if ((g_game != (Game *)0x0) && (g_manager->_state == 2)) goto LAB_00857bd6; anim = "Dissapear"; this = (ANM2 *)(in_ECX + 2); } else { if (*(int *)in_ECX != 1) { return; } local_4c = 0xe; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_4c,0,0); if (cVar3 == '\0') { local_48 = 0xf; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if (cVar3 == '\0') { if (*(int *)(in_ECX + 0x49) == 0) { return; } local_48 = 0x18; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if (cVar3 != '\0') { uVar4 = *(int *)(in_ECX + 1) + 1U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } iVar5 = in_ECX[1]._state; *(uint *)(in_ECX + 1) = uVar4; get_leaderboard(in_ECX,uVar4,iVar5); return; } local_48 = 0x19; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if (cVar3 != '\0') { iVar5 = in_ECX[1]._state; if (iVar5 == 0) { in_ECX[1]._state = 2; iVar5 = 2; } else { if (iVar5 == 1) { in_ECX[1]._state = 0; uVar1 = *(undefined4 *)(in_ECX + 1); in_ECX[0x75]._state = -1; download_entries(uVar1,0); return; } if (iVar5 == 2) { in_ECX[1]._state = 1; uVar1 = *(undefined4 *)(in_ECX + 1); in_ECX[0x75]._state = -1; download_entries(uVar1,1); return; } } uVar1 = *(undefined4 *)(in_ECX + 1); in_ECX[0x75]._state = -1; download_entries(uVar1,iVar5); return; } local_48 = 0x14; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if ((cVar3 != '\0') && (cVar3 = date_is_within_week(), cVar3 != '\0')) { DateTime::set_from_yyyymmdd(&local_44,*(int *)(in_ECX + 0x4a)); local_44 = local_44 | 2; iStack_28 = iStack_28 + -1; uVar4 = date_to_yyyymmdd((byte)local_44,iStack_40,CONCAT44(uStack_38,uStack_3c),local_34 ,iStack_30,iStack_2c,iStack_28,local_24,iStack_20,iStack_1c, iStack_18,local_14); *(uint *)(in_ECX + 0x4a) = uVar4; DailyChallenge::Init((DailyChallenge *)(in_ECX + 0x4b),uVar4); FUN_0085a8b0(); get_leaderboard(in_ECX,*(int *)(in_ECX + 1),in_ECX[1]._state); return; } local_48 = 0x15; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if ((cVar3 != '\0') && (cVar3 = date_is_after(), cVar3 != '\0')) { DateTime::set_from_yyyymmdd(&local_44,*(int *)(in_ECX + 0x4a)); local_44 = local_44 | 2; iStack_28 = iStack_28 + 1; uVar4 = date_to_yyyymmdd((byte)local_44,iStack_40,CONCAT44(uStack_38,uStack_3c),local_34 ,iStack_30,iStack_2c,iStack_28,local_24,iStack_20,iStack_1c, iStack_18,local_14); *(uint *)(in_ECX + 0x4a) = uVar4; DailyChallenge::Init((DailyChallenge *)(in_ECX + 0x4b),uVar4); FUN_0085a8b0(); get_leaderboard(in_ECX,*(int *)(in_ECX + 1),in_ECX[1]._state); return; } local_48 = 0x16; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_48,0,0); if ((cVar3 == '\0') || (in_ECX[0x75]._state < 1)) { local_48 = 0x17; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&local_48,0,0); if (cVar3 == '\0') { return; } iVar5 = FUN_00857400(); if (iVar5 == 0) { iVar5 = 0; } else if (in_ECX[1]._state == 1) { iVar5 = in_ECX[0x49]._state + -10; } else { uVar4 = FUN_00857400(); iVar5 = KAGE::System::LeaderboardManager::get_result(uVar4); iVar5 = *(int *)(iVar5 + 0xc) + -10; } if (iVar5 <= in_ECX[0x75]._state) { return; } iVar6 = in_ECX[0x75]._state + 10; iVar5 = FUN_00857400(); if (iVar5 == 0) { iVar5 = 0; } else if (in_ECX[1]._state == 1) { iVar5 = in_ECX[0x49]._state + -10; } else { uVar4 = FUN_00857400(); iVar5 = KAGE::System::LeaderboardManager::get_result(uVar4); iVar5 = *(int *)(iVar5 + 0xc) + -10; } if (iVar6 < iVar5) { iVar5 = iVar6; } } else { iVar6 = in_ECX[0x75]._state + -10; iVar5 = 0; if (0 < iVar6) { iVar5 = iVar6; } } in_ECX[0x75]._state = iVar5; download_entries(*(undefined4 *)(in_ECX + 1),in_ECX[1]._state); return; } } if ((g_game != (Game *)0x0) && (g_manager->_state == 2)) { LAB_00857bd6: pGVar2 = g_game; KColor::SetFromARGB(local_74,0xff000000); pGVar2->_fadeSpeed = 0.08; (pGVar2->_fadeOutColor)._red = local_74[0]._red; (pGVar2->_fadeOutColor)._green = local_74[0]._green; (pGVar2->_fadeOutColor)._blue = local_74[0]._blue; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha; (pGVar2->_fadeOutColor)._unk = 0; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08; pGVar2->_fadeOutTarget = 2; return; } anim = "Dissappear"; this = (ANM2 *)&in_ECX[0x24]._state; } in_ECX->_state = 4; ANM2::Play(this,(byte *)anim,0); *(undefined1 *)(in_ECX + 0x76) = 1; } return; } //@@ 00857c90 date_is_within_week /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? two DateTime::set_from_yyyymmdd, _mkgmtime64/_gmtime64 normalize, returns (dayOfYear(b) + year wrap 365/366 - dayOfYear(a)) < 7; twin 00857e40 date_is_after > 0; callers Leaderboard::render_scores, 008576c0 Leaderboard::update_input undefined4 date_is_within_week(void) { short sVar1; short sVar2; tm *ptVar3; int iVar4; uint uVar5; int in_ECX; uint uVar6; bool bVar7; int local_80; byte local_7c [8]; __time64_t local_74; tm local_6c; byte local_44 [8]; __time64_t local_3c; tm local_34; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_44 + 0x40); DateTime::set_from_yyyymmdd(local_44,*(int *)(in_ECX + 0x250)); DateTime::set_from_yyyymmdd(local_7c,*(int *)(in_ECX + 0x254)); if ((local_44[0] & 2) != 0) { local_3c = _mkgmtime64(&local_34); } if ((local_44[0] & 3) != 0) { ptVar3 = _gmtime64(&local_3c); local_34.tm_sec = ptVar3->tm_sec; local_34.tm_min = ptVar3->tm_min; local_34.tm_hour = ptVar3->tm_hour; local_34.tm_mday = ptVar3->tm_mday; local_34.tm_mon = ptVar3->tm_mon; local_34.tm_year = ptVar3->tm_year; local_34.tm_wday = ptVar3->tm_wday; local_34.tm_yday = ptVar3->tm_yday; local_34.tm_isdst = ptVar3->tm_isdst; } sVar1 = (short)local_34.tm_yday; local_44[0] = local_44[0] & 0xfc; if ((local_7c[0] & 2) != 0) { local_74 = _mkgmtime64(&local_6c); } if ((local_7c[0] & 3) == 0) { sVar2 = (short)local_6c.tm_yday; } else { ptVar3 = _gmtime64(&local_74); local_6c.tm_sec = ptVar3->tm_sec; local_6c.tm_min = ptVar3->tm_min; local_6c.tm_hour = ptVar3->tm_hour; local_6c.tm_mday = ptVar3->tm_mday; local_6c.tm_mon._0_2_ = (undefined2)ptVar3->tm_mon; local_6c.tm_mon._2_2_ = *(undefined2 *)((int)&ptVar3->tm_mon + 2); local_6c.tm_year = ptVar3->tm_year; local_6c.tm_wday._0_2_ = (undefined2)ptVar3->tm_wday; local_6c.tm_wday._2_2_ = *(undefined2 *)((int)&ptVar3->tm_wday + 2); sVar2 = (short)ptVar3->tm_yday; local_6c.tm_yday = ptVar3->tm_yday; local_6c.tm_isdst = ptVar3->tm_isdst; } local_80 = (int)(short)(sVar2 + 1); local_7c[0] = local_7c[0] & 0xfc; sVar2 = (short)local_6c.tm_year; if ((local_44[0] & 2) != 0) { local_3c = _mkgmtime64(&local_34); } if ((local_44[0] & 3) != 0) { ptVar3 = _gmtime64(&local_3c); local_34.tm_year = ptVar3->tm_year; } iVar4 = (int)(short)(sVar2 + 0x76c); if (iVar4 == (short)((short)local_34.tm_year + 0x76c) + 1) { uVar6 = (uint)(short)((short)local_34.tm_year + 0x76c); uVar5 = uVar6 & 0x80000003; bVar7 = uVar5 == 0; if ((int)uVar5 < 0) { bVar7 = (uVar5 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar7) { if (((int)uVar6 % 100 != 0) || (iVar4 = 0x16d, (int)uVar6 % 400 == 0)) { iVar4 = 0x16e; } } else { iVar4 = 0x16d; } local_80 = local_80 + iVar4; } return CONCAT31((int3)((uint)iVar4 >> 8),local_80 - (short)(sVar1 + 1) < 7); } //@@ 00857e40 date_is_after /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? twin of 00857c90 date_is_within_week code) returning dayOfYear(b) + year wrap - dayOfYear(a) > 0; callers Leaderboard::render_scores, 008576c0 Leaderboard::update_input undefined4 date_is_after(void) { short sVar1; short sVar2; tm *ptVar3; int iVar4; uint uVar5; int in_ECX; uint uVar6; bool bVar7; int local_80; byte local_7c [8]; __time64_t local_74; tm local_6c; byte local_44 [8]; __time64_t local_3c; tm local_34; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_44 + 0x40); DateTime::set_from_yyyymmdd(local_44,*(int *)(in_ECX + 0x250)); DateTime::set_from_yyyymmdd(local_7c,*(int *)(in_ECX + 0x254)); if ((local_44[0] & 2) != 0) { local_3c = _mkgmtime64(&local_34); } if ((local_44[0] & 3) != 0) { ptVar3 = _gmtime64(&local_3c); local_34.tm_sec = ptVar3->tm_sec; local_34.tm_min = ptVar3->tm_min; local_34.tm_hour = ptVar3->tm_hour; local_34.tm_mday = ptVar3->tm_mday; local_34.tm_mon = ptVar3->tm_mon; local_34.tm_year = ptVar3->tm_year; local_34.tm_wday = ptVar3->tm_wday; local_34.tm_yday = ptVar3->tm_yday; local_34.tm_isdst = ptVar3->tm_isdst; } sVar1 = (short)local_34.tm_yday; local_44[0] = local_44[0] & 0xfc; if ((local_7c[0] & 2) != 0) { local_74 = _mkgmtime64(&local_6c); } if ((local_7c[0] & 3) == 0) { sVar2 = (short)local_6c.tm_yday; } else { ptVar3 = _gmtime64(&local_74); local_6c.tm_sec = ptVar3->tm_sec; local_6c.tm_min = ptVar3->tm_min; local_6c.tm_hour = ptVar3->tm_hour; local_6c.tm_mday = ptVar3->tm_mday; local_6c.tm_mon._0_2_ = (undefined2)ptVar3->tm_mon; local_6c.tm_mon._2_2_ = *(undefined2 *)((int)&ptVar3->tm_mon + 2); local_6c.tm_year = ptVar3->tm_year; local_6c.tm_wday._0_2_ = (undefined2)ptVar3->tm_wday; local_6c.tm_wday._2_2_ = *(undefined2 *)((int)&ptVar3->tm_wday + 2); sVar2 = (short)ptVar3->tm_yday; local_6c.tm_yday = ptVar3->tm_yday; local_6c.tm_isdst = ptVar3->tm_isdst; } local_80 = (int)(short)(sVar2 + 1); local_7c[0] = local_7c[0] & 0xfc; sVar2 = (short)local_6c.tm_year; if ((local_44[0] & 2) != 0) { local_3c = _mkgmtime64(&local_34); } if ((local_44[0] & 3) != 0) { ptVar3 = _gmtime64(&local_3c); local_34.tm_year = ptVar3->tm_year; } iVar4 = (int)(short)(sVar2 + 0x76c); if (iVar4 == (short)((short)local_34.tm_year + 0x76c) + 1) { uVar6 = (uint)(short)((short)local_34.tm_year + 0x76c); uVar5 = uVar6 & 0x80000003; bVar7 = uVar5 == 0; if ((int)uVar5 < 0) { bVar7 = (uVar5 - 1 | 0xfffffffc) == 0xffffffff; } if (bVar7) { if (((int)uVar6 % 100 != 0) || (iVar4 = 0x16d, (int)uVar6 % 400 == 0)) { iVar4 = 0x16e; } } else { iVar4 = 0x16d; } local_80 = local_80 + iVar4; } return CONCAT31((int3)((uint)iVar4 >> 8),0 < local_80 - (short)(sVar1 + 1)); } //@@ 00857ff0 FUN_00857ff0 uint FUN_00857ff0(void) { int iVar1; uint handle; int in_ECX; iVar1 = FUN_00857400(); if (iVar1 == 0) { return (uint)(*(int *)(in_ECX + 0x3ac) < 0); } if (*(int *)(in_ECX + 0xc) == 1) { iVar1 = *(int *)(in_ECX + 0x24c) + -10; return CONCAT31((int3)((uint)iVar1 >> 8),*(int *)(in_ECX + 0x3ac) < iVar1); } handle = FUN_00857400(); iVar1 = KAGE::System::LeaderboardManager::get_result(handle); iVar1 = *(int *)(iVar1 + 0xc) + -10; return CONCAT31((int3)((uint)iVar1 >> 8),*(int *)(in_ECX + 0x3ac) < iVar1); } //@@ 00858050 Leaderboard::Render /* DB: ? thiscall: when active (+4) dims the screen with a 0.3 grey / 0.5 alpha KAGE_ColorShader quad, then mode (+0) 0 -> Leaderboard::render_daily_score_breakdown, 1 -> Leaderboard::render_scores; callers Game::Render, MenuManager::Render */ void Leaderboard::Render(void) { int *in_ECX; KColor local_8c; undefined1 local_78 [116]; if (in_ECX[1] != 0) { local_8c._red = 0.3; local_8c._green = 0.3; local_8c._blue = 0.3; local_8c._alpha = 0.5; local_8c._unk = 0; render_quad_set_uniform_color(local_78,0.0,0.0,g_screenWidth,g_screenHeight,&local_8c); render_color_shader_pass(local_78); if (*in_ECX == 0) { render_daily_score_breakdown(); } else if (*in_ECX == 1) { render_scores(); return; } } return; } //@@ 008580e0 Leaderboard::Show /* ZHL [exact] __thiscall void Leaderboard::Show(unsigned int Date, ScoreSheet* ScoreSheet, bool SubmitScore, bool Group ); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall Leaderboard::Show(Leaderboard *this,uint Date,ScoreSheet *ScoreSheet,byte SubmitScore,byte Group) { byte *pbVar1; Manager *pMVar2; byte bVar3; byte *pbVar4; uint uVar5; char *pcVar6; bool bVar7; this[0x74]._state = 0; *(undefined4 *)(this + 0x74) = 0; *(undefined4 *)this = 0; this->_state = 1; pbVar1 = (byte *)this[8]._state; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pcVar6 = "Appear"; do { bVar3 = *pbVar4; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_00858140: uVar5 = -(uint)bVar7 | 1; goto LAB_00858145; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_00858140; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00858145: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((char)this[10]._state != '\0')))) goto LAB_00858172; } bVar3 = ANM2::SetAnimation((ANM2 *)(this + 2),(byte *)"Appear",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 8)); *(undefined1 *)&this[10]._state = 1; } LAB_00858172: this[0x4a]._state = Date; *(uint *)(this + 0x4a) = Date; DailyChallenge::Init((DailyChallenge *)(this + 0x4b),Date); KAGE::System::LeaderboardManager::release_result(*(int *)(this + 0x47)); KAGE::System::LeaderboardManager::release_result(this[0x47]._state); KAGE::System::LeaderboardManager::release_result(*(int *)(this + 0x48)); KAGE::System::LeaderboardManager::release_result(this[0x48]._state); this[0x48]._state = 0; *(undefined4 *)(this + 0x48) = 0; this[0x47]._state = 0; *(undefined4 *)(this + 0x47) = 0; this[0x61]._state = (int)*ScoreSheet; *(ScoreSheet *)(this + 0x62) = ScoreSheet[1]; this[0x62]._state = (int)ScoreSheet[2]; *(ScoreSheet *)(this + 99) = ScoreSheet[3]; this[99]._state = (int)ScoreSheet[4]; *(ScoreSheet *)(this + 100) = ScoreSheet[5]; this[100]._state = (int)ScoreSheet[6]; *(ScoreSheet *)(this + 0x65) = ScoreSheet[7]; this[0x65]._state = (int)ScoreSheet[8]; *(ScoreSheet *)(this + 0x66) = ScoreSheet[9]; this[0x66]._state = (int)ScoreSheet[10]; *(ScoreSheet *)(this + 0x67) = ScoreSheet[0xb]; this[0x67]._state = (int)ScoreSheet[0xc]; *(ScoreSheet *)(this + 0x68) = ScoreSheet[0xd]; this[0x68]._state = (int)ScoreSheet[0xe]; *(ScoreSheet *)(this + 0x69) = ScoreSheet[0xf]; std::vector<12byte>::operator_assign(ScoreSheet + 0x10); *(ScoreSheet *)(this + 0x6b) = ScoreSheet[0x13]; this[0x6b]._state = (int)ScoreSheet[0x14]; *(ScoreSheet *)(this + 0x6c) = ScoreSheet[0x15]; this[0x6c]._state = (int)ScoreSheet[0x16]; std::vector<12byte>::operator_assign(ScoreSheet + 0x17); std::vector<12byte>::operator_assign(ScoreSheet + 0x1a); *(ScoreSheet *)(this + 0x70) = ScoreSheet[0x1d]; this[0x70]._state = (int)ScoreSheet[0x1e]; std::vector<12byte>::operator_assign(ScoreSheet + 0x1f); *(undefined1 *)&this[0x72]._state = *(undefined1 *)(ScoreSheet + 0x22); *(ScoreSheet *)(this + 0x73) = ScoreSheet[0x23]; pMVar2 = g_manager; bVar7 = SubmitScore == 0; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (pMVar2->_popupButtons)._buttons[0]._slideOffset = 96.0; (pMVar2->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; (pMVar2->_popupButtons)._buttons[1]._slideOffset = 96.0; if (bVar7) { *(undefined4 *)(this + 0x74) = 0; this[0x74]._state = 0; } *(bool *)&this[0x73]._state = bVar7; *(bool *)((int)&this[0x73]._state + 1) = bVar7; get_leaderboard(this,(uint)Group * 2,2); return; } //@@ 00858370 FUN_00858370 int FUN_00858370(void) { int iVar1; Entity_Player *pEVar2; if ((g_menuManager != (MenuManager *)0x0) && (g_manager->_state == 1)) { return g_menuControllerIndex; } if ((g_game == (Game *)0x0) || (g_manager->_state != 2)) { return 0; } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pEVar2 = Game::GetPlayer(g_game,0); return pEVar2->_controllerIndex; } iVar1 = FUN_0090b070(); if (*(int *)(iVar1 + 0x378) == 0) { return -0x21524111; } return *(int *)(*(int *)(iVar1 + 0x378) + 0xc); } //@@ 008583e0 Leaderboard::get_leaderboard /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Leaderboard::get_leaderboard(int RankingState, int LiveSelectionState); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Leaderboard::get_leaderboard(Leaderboard *this,int RankingState,int LiveSelectionState) { uint *ptr; int iVar1; byte *pbVar2; void *pvVar3; uint uVar4; void *local_44 [5]; uint local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; puStack_c = &LAB_00b03615; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; this[1]._state = LiveSelectionState; pvVar3 = *(void **)(this + 0x49); *(int *)(this + 1) = RankingState; this[0x75]._state = -1; if (pvVar3 != (void *)0x0) { ptr = (uint *)((int)pvVar3 + -4); local_8 = (void *)0x0; _eh_vector_destructor_iterator_(pvVar3,0x28,*ptr,FUN_00a51500); operator_delete(ptr,*ptr * 0x28 + 4); RankingState = *(int *)(this + 1); } local_8 = (void *)0xffffffff; *(undefined4 *)(this + 0x49) = 0; this[0x49]._state = -1; if (RankingState == 0) { iVar1 = *(int *)(this + 0x47); joined_r0x008584dd: if (iVar1 == 0) { pbVar2 = leaderboard_name_format(local_44,*(int *)(this + 0x4a),RankingState,RankingState); local_8 = (void *)0x2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } leaderboard_find_async(pbVar2,0,FUN_0085a8f0,this); local_8 = (void *)0xffffffff; if (0xf < local_30) { uVar4 = local_30 + 1; pvVar3 = local_44[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_44[0] + -4); uVar4 = local_30 + 0x24; if (0x1f < (uint)((int)local_44[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } goto LAB_00858490; } } else { if (RankingState == 2) { iVar1 = *(int *)(this + 0x48); goto joined_r0x008584dd; } if (RankingState == 1) { iVar1 = this[0x47]._state; joined_r0x00858578: if (iVar1 == 0) { pbVar2 = leaderboard_name_format(local_2c,*(int *)(this + 0x4a),RankingState,RankingState); local_8 = (void *)0x3; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } leaderboard_find_async(pbVar2,1,FUN_0085a9d0,this); local_8 = (void *)0xffffffff; if (0xf < local_18) { uVar4 = local_18 + 1; pvVar3 = local_2c[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_2c[0] + -4); uVar4 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)((uint)local_2c[0] & 0xffffff00); goto LAB_00858490; } } else if (RankingState == 3) { iVar1 = this[0x48]._state; goto joined_r0x00858578; } } download_entries(RankingState,this[1]._state); LAB_00858490: if ((*(int *)this == 1) && (this->_state == 3)) { this->_state = 2; ANM2::Play((ANM2 *)&this[0x24]._state,(byte *)"Loading",0); } ExceptionList = local_10; return; } //@@ 00858610 Leaderboard::download_entries /* DB: ? ECX=Leaderboard: frees the 0x28-stride entry array (+0x248), stores board (+8) and scope (+0xc), requests rows rank+1..rank+10 (FUN_00a51bb0); log "Attempting to download entries from leaderboard that hasn't been downloaded"; from Leaderboard::get_leaderboard and the leaderboard update */ void Leaderboard::download_entries(int param_1,int param_2) { uint *ptr; void *pvVar1; qword qVar2; uint uVar3; undefined4 uVar4; int iVar5; undefined4 *puVar6; undefined4 uVar7; int *in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; qword *pqVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03640; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar1 = (void *)in_ECX[0x92]; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0x28,*ptr,FUN_00a51500); operator_delete(ptr,*ptr * 0x28 + 4); } local_8 = 0xffffffff; in_ECX[2] = param_1; in_ECX[3] = param_2; in_ECX[0x92] = 0; in_ECX[0x93] = -1; *(undefined1 *)((int)in_ECX + 0x3aa) = 0; DAT_00c5ab40 = 0x48; iVar5 = in_ECX[3]; if (iVar5 == 0) { iVar5 = in_ECX[0xeb]; if (iVar5 == -1) { in_ECX[0xeb] = 0; iVar5 = 0; } uVar4 = FUN_00857400(uVar3); uVar7 = extraout_ECX_00; LAB_0085881b: FUN_00a51bb0(uVar4,iVar5 + 1,iVar5 + 10,uVar7,in_ECX); } else { if (iVar5 == 1) { uVar7 = FUN_00857400(uVar3); iVar5 = FUN_00a51d10(uVar7); if (iVar5 == 0) { KAGE_LogMessage(4,(byte *) "Attempting to download entries from leaderboard that hasn\'t been downloaded\n" ); goto LAB_0085882b; } if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } puVar6 = malloc(0xb4); if (puVar6 == (undefined4 *)0x0) { LAB_0085875f: FUN_00a23200(0x7fcb9dd6); } else { qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 + 0xb4; *puVar6 = 0xb4; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) + (uint)(0xffffff4b < (uint)qVar2); if (puVar6 != (undefined4 *)0xfffffffc) { uVar7 = FUN_00a51570(5,uVar7,0,0,0,0,FUN_0085ab90,in_ECX); FUN_00a52100(uVar7); goto LAB_0085882b; } } } else { if (iVar5 != 2) goto LAB_0085882b; iVar5 = in_ECX[0xeb]; uVar4 = FUN_00857400(uVar3); uVar7 = extraout_ECX; if (iVar5 != -1) goto LAB_0085881b; iVar5 = FUN_00a51d10(uVar4); if (iVar5 == 0) { KAGE_LogMessage(4,(byte *) "Attempting to download entries from leaderboard that hasn\'t been downloaded\n" ); goto LAB_0085882b; } if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } puVar6 = malloc(0xb4); if (puVar6 == (undefined4 *)0x0) goto LAB_0085875f; qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 + 0xb4; *puVar6 = 0xb4; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) + (uint)(0xffffff4b < (uint)qVar2); if (puVar6 != (undefined4 *)0xfffffffc) { uVar7 = FUN_00a51570(4,uVar4,9,0,0,0,FUN_0085ab90,in_ECX); FUN_00a52100(uVar7); goto LAB_0085882b; } } FUN_00a52100(0); } LAB_0085882b: if ((*in_ECX == 1) && (in_ECX[1] == 3)) { in_ECX[1] = 2; ANM2::Play((ANM2 *)(in_ECX + 0x49),(byte *)"Loading",0); } ExceptionList = local_10; return; } //@@ 00858870 FUN_00858870 undefined * FUN_00858870(int param_1) { int iVar1; iVar1 = param_1 % 100; if (((iVar1 != 0xb) && (iVar1 != 0xc)) && (iVar1 != 0xd)) { param_1 = param_1 % 10; if (param_1 == 1) { return &DAT_00b6e4cc; } if (param_1 == 2) { return &DAT_00b6e4c0; } if (param_1 == 3) { return &DAT_00b6e4c4; } } return &DAT_00b6e4c8; } //@@ 008588f0 Leaderboard::render_daily_score_breakdown /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: draws #DAILY_RUN_*_BONUS/_PENALTY/_TOTAL lines and %d:%02d:%02d time with Font::DrawString; in the Leaderboard block (Leaderboard::Show 0x8580e0), caller 0x858050 is reached from Game::Render and the menu renderer */ void Leaderboard::render_daily_score_breakdown(void) { undefined4 uVar1; int iVar2; float *pfVar3; byte *pbVar4; undefined4 extraout_EAX; float *pfVar5; undefined4 extraout_EAX_00; int in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; FontSettings local_e4 [7]; KColor local_c8; Font *local_b4; float local_b0; float local_ac; float local_a8; Vector local_a4; byte local_9c [76]; byte local_50 [32]; undefined4 local_30; undefined4 local_2c; undefined4 local_28; byte local_24 [16]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0368b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; local_a8 = (g_screenWidth - 480.0) * 0.5; local_ac = (g_screenHeight - 270.0) * 0.5; local_a4.x = local_a8; local_a4.y = local_ac; if (*(char *)(in_ECX + 0x119) != '\0') { if (*(char *)(in_ECX + 0x80) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x40),&local_a4,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(in_ECX + 0x60),&local_a4,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x60),&local_a4,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(in_ECX + 0x40),&local_a4,&g_vectorZero,&g_vectorZero); } } local_b4 = &g_manager->_font2_TeamMeatEx12; local_ac = local_a4.y; local_a8 = local_a4.x; if ((*(int *)(in_ECX + 0x44) != 0) && (pfVar3 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x40),&DAT_00b1c208), pfVar3 != (float *)0x0)) { local_a4.x = local_a8 + *pfVar3; local_a4.y = local_ac + pfVar3[1]; uVar1 = *(undefined4 *)(in_ECX + 0x30c); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_STAGE_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,uVar1); uVar1 = *(undefined4 *)(in_ECX + 0x330); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_EXPLORATION_BONUS") ; leaderboard_render_label_value(&local_a4,pbVar4,uVar1); uVar1 = *(undefined4 *)(in_ECX + 0x310); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_SCHWAG_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,uVar1); iVar2 = *(int *)(in_ECX + 0x314); if (0 < iVar2) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_???_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 0x318); if (0 < iVar2) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_LAMB_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 800); if (0 < iVar2) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_MOTHER_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 0x324); if (0 < iVar2) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_DELIRIUM_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 0x328); if (0 < iVar2) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_BEAST_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 0x32c); if (0 < iVar2) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_RUSH_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 0x31c); if (0 < iVar2) { pbVar4 = string_table_translate (&g_manager->_stringTable,(byte *)"#DAILY_RUN_MEGA_SATAN_BONUS"); leaderboard_render_label_value(&local_a4,pbVar4,iVar2); } iVar2 = *(int *)(in_ECX + 0x334); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_DAMAGE_PENALTY"); leaderboard_render_label_value(&local_a4,pbVar4,-iVar2); iVar2 = *(int *)(in_ECX + 0x338); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_TIME_PENALTY"); leaderboard_render_label_value(&local_a4,pbVar4,-iVar2); iVar2 = *(int *)(in_ECX + 0x33c); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_ITEM_PENALTY"); leaderboard_render_label_value(&local_a4,pbVar4,-iVar2); local_a4.y = local_a4.y + 10.0; uVar1 = *(undefined4 *)(in_ECX + 0x340); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_TOTAL"); leaderboard_render_label_value(&local_a4,pbVar4,uVar1); local_b0 = local_a4.y + 10.0; if (0 < *(int *)(in_ECX + 0x344)) { pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#DAILY_RUN_FINISH_TIME"); sprintf_s(local_9c,0x48,pbVar4); local_30 = 0; local_2c = 0xffff; local_28 = 0; local_24[0] = 0; local_24[1] = 0; local_24[2] = 0x80; local_24[3] = 0x3f; local_24[4] = 0xff; local_24[5] = 0xff; local_24[6] = 0xff; local_24[7] = 0xff; local_24[8] = 0; local_24[9] = 0; local_24[10] = 0; local_24[0xb] = 0; local_24[0xc] = 0; local_24[0xd] = 0; local_24[0xe] = 0; local_24[0xf] = 0; local_8 = 0; KColor::SetFromARGB(&local_c8,0xff362f2d); Font::DrawString(local_9c,extraout_ECX,&local_30); sprintf_s(local_50,0x20,(byte *)"%d:%02d:%02d"); Font::get_string_width_n(local_b4,local_50,-1); local_30 = 0; local_2c = 0xffff; local_28 = 0; local_24[0] = 0; local_24[1] = 0; local_24[2] = 0x80; local_24[3] = 0x3f; local_24[4] = 0xff; local_24[5] = 0xff; local_24[6] = 0xff; local_24[7] = 0xff; local_24[8] = 0; local_24[9] = 0; local_24[10] = 0; local_24[0xb] = 0; local_24[0xc] = 0; local_24[0xd] = 0; local_24[0xe] = 0; local_24[0xf] = 0; local_8 = 1; KColor::SetFromARGB(&local_c8,0xff362f2d); Font::DrawString(local_50,extraout_ECX_00,&local_30); local_8 = 0xffffffff; } } if ((*(char *)(in_ECX + 0x39c) != '\0') && (*(char *)(in_ECX + 0x39d) != '\0')) { if (*(int *)(in_ECX + 0x44) == 0) { pfVar3 = (float *)0x0; } else { pfVar3 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x40),(byte *)"ScoreRank"); if (pfVar3 != (float *)0x0) { local_b0 = local_a8 + *pfVar3; local_a4.y = local_ac + pfVar3[1]; if (*(int *)(in_ECX + 0x3a0) < 1) { sprintf_s(local_24,0x10,&DAT_00b6d4cc); } else { FUN_00858870(*(int *)(in_ECX + 0x3a0)); sprintf_s(local_24,0x10,&DAT_00b6e6e8); } Font::get_string_width_n(local_b4,local_24,-1); KColor::SetFromARGB(&local_c8,0xff362f2d); local_c8._alpha = pfVar3[9]; FontSettings::constructor(local_e4); local_8 = 2; Font::DrawString(local_24,&local_c8,extraout_EAX); local_8 = 0xffffffff; } } if ((*(int *)(in_ECX + 0x44) != 0) && (pfVar5 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x40),(byte *)"TimeRank"), pfVar5 != (float *)0x0)) { local_a8 = local_a8 + *pfVar5; local_ac = local_ac + pfVar5[1]; if (*(int *)(in_ECX + 0x3a4) < 1) { sprintf_s(local_24,0x10,&DAT_00b6d4cc); } else { FUN_00858870(*(int *)(in_ECX + 0x3a4)); sprintf_s(local_24,0x10,&DAT_00b6e6e8); } Font::get_string_width_n(local_b4,local_24,-1); KColor::SetFromARGB(&local_c8,0xff362f2d); local_c8._alpha = pfVar3[9]; FontSettings::constructor(local_e4); local_8 = 3; Font::DrawString(local_24,&local_c8,extraout_EAX_00); } } ExceptionList = local_10; return; } //@@ 00859100 leaderboard_render_label_value /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? sprintf "%d" of param_3, Font::DrawString of the label and of the number right-aligned (get_string_width_n) in color 0xff362f2d, then advances pos.y by 15; caller Leaderboard::render_daily_score_breakdown */ void leaderboard_render_label_value(int param_1,undefined4 param_2) { undefined4 extraout_ECX; undefined4 extraout_ECX_00; Font *this; KColor local_58; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; byte local_28 [16]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b036d5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; sprintf_s(local_28,0x10,s__d); this = &g_manager->_font2_TeamMeatEx12; local_44 = 0; local_40 = 0xffff; local_3c = 0; local_38 = 0x3f800000; local_34 = 0xffffffff; local_30 = 0; local_2c = 0; local_8 = 0; KColor::SetFromARGB(&local_58,0xff362f2d); Font::DrawString(param_2,extraout_ECX,&local_44); Font::get_string_width_n(this,local_28,-1); local_44 = 0; local_40 = 0xffff; local_3c = 0; local_38 = 0x3f800000; local_34 = 0xffffffff; local_30 = 0; local_2c = 0; local_8 = 1; KColor::SetFromARGB(&local_58,0xff362f2d); Font::DrawString(local_28,extraout_ECX_00,&local_44); *(float *)(param_1 + 4) = *(float *)(param_1 + 4) + 15.0; ExceptionList = local_10; return; } //@@ 00859290 Leaderboard::render_scores /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Leaderboard state 1 render (TextGlobal/TextFriends/TextMine, SoloScore, "Lv%2d %d:%02d:%02d", #LEADERBOARD_NO_ENTRIES), from FUN_00858050 state switch */ void Leaderboard::render_scores(void) { ANM2 *this; ScoreSheet *pSVar1; ScoreSheet SVar2; KColor color; Vector pos; Vector pos_00; undefined1 *puVar3; byte ****ppppbVar4; short *psVar5; char cVar6; byte bVar7; LayerState *pLVar8; float *pfVar9; tm *ptVar10; byte *pbVar11; short *psVar12; undefined *puVar13; void *settings; int *in_ECX; byte ****ppppbVar14; uint uVar15; AnimationState *pAVar16; byte **ppbVar17; int *piVar18; KColor *color_00; int extraout_ECX; int extraout_ECX_00; KColor *color_01; int iVar19; byte *pbVar20; int iVar21; void *pvVar22; float fVar23; double dVar24; KColor *imageRefCount; char *text; undefined1 auStack_64a [2]; undefined1 local_640 [112]; undefined1 local_5d0 [16]; Vector local_5c0; FontSettings local_5b8 [2]; KColor local_5b0; float local_59c; float local_598; float fStack_594; float fStack_590; float fStack_58c; float local_588; int *local_584; int *local_580; int local_57c; int *local_578; undefined4 *local_574; int *local_570; int *local_56c; float local_568; void *local_564; int local_560; float *local_55c; float local_558; ScoreSheet local_554; Vector local_550; float local_548; float local_544; float local_540; Font *local_53c; byte *local_538; undefined1 *local_534; bool local_52d; byte *local_52c; byte local_526; bool local_525; undefined4 local_524; byte ****local_520; KColor local_51c; undefined4 local_508; undefined4 uStack_504; undefined4 uStack_500; undefined4 uStack_4fc; undefined2 local_4f8; undefined1 local_4f0 [8]; tm tStack_4e8; undefined4 local_4c4; short local_4c0 [440]; ScoreSheet local_150; ScoreSheet local_14c; ScoreSheet local_148; ScoreSheet local_144; ScoreSheet local_140; int local_13c; int local_138; undefined4 local_134; ScoreSheet local_130; ScoreSheet local_12c; ScoreSheet local_128; ScoreSheet local_124; ScoreSheet local_120; ScoreSheet local_118; ScoreSheet local_114; int local_104; int local_f8; ScoreSheet local_c4; byte local_c0 [72]; byte local_78 [32]; short sStack_58; short local_56 [19]; byte local_30 [12]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00b037a1; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_30 + 0x20); ExceptionList = &local_1c; local_538 = (byte *)0x0; local_56c = in_ECX; if ((void *)in_ECX[0x56] == (void *)0x0) { local_520 = (byte ****)0x0; local_51c._alpha = 0.0; local_51c._unk = 0xf; puStack_20 = local_30 + 0x2c; } else { std::string::string((char *)&local_520,(void *)in_ECX[0x56]); } ppppbVar4 = local_520; local_534 = &DAT_00000004; ppppbVar14 = (byte ****)&local_520; if (0xf < (uint)local_51c._unk) { ppppbVar14 = local_520; } local_526 = str_eq((byte *)ppppbVar14,(uint)local_51c._alpha,s_Idle,4); if (0xf < (uint)local_51c._unk) { uVar15 = local_51c._unk + 1; ppppbVar14 = ppppbVar4; if (0xfff < uVar15) { ppppbVar14 = (byte ****)ppppbVar4[-1]; uVar15 = local_51c._unk + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbVar4 + (-4 - (int)ppppbVar14))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar14,uVar15); } if (local_526 != 0) { this = (ANM2 *)(in_ECX + 0x49); pLVar8 = ANM2::GetLayer(this,(byte *)"TextGlobal"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,in_ECX[3]); } pLVar8 = ANM2::GetLayer(this,(byte *)"TextFriends"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,in_ECX[3]); } pLVar8 = ANM2::GetLayer(this,(byte *)"TextMine"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,in_ECX[3]); } local_52c = (byte *)(uint)(*in_ECX != 0); pLVar8 = ANM2::GetLayer(this,(byte *)"TextScore"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } local_52c = (byte *)(uint)(*in_ECX != 0); pLVar8 = ANM2::GetLayer(this,(byte *)"TextTime"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } cVar6 = date_is_within_week(); local_52c = (byte *)(uint)(cVar6 == '\0'); pLVar8 = ANM2::GetLayer(this,(byte *)"LeftArrow"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } cVar6 = date_is_after(); local_52c = (byte *)(uint)(cVar6 == '\0'); pLVar8 = ANM2::GetLayer(this,(byte *)"RightArrow"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } local_52c = (byte *)(uint)(in_ECX[0xeb] < 1); pLVar8 = ANM2::GetLayer(this,(byte *)"UpArrow"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } cVar6 = FUN_00857ff0(); local_52c = (byte *)(uint)(cVar6 == '\0'); pLVar8 = ANM2::GetLayer(this,(byte *)"DownArrow"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } local_52c = (byte *)(uint)(in_ECX[2] != 0); pLVar8 = ANM2::GetLayer(this,(byte *)"SoloScore"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } if ((in_ECX[2] == 0) || (local_548 = 1.4013e-45, in_ECX[2] != 1)) { local_548 = 0.0; } pLVar8 = ANM2::GetLayer(this,(byte *)"SoloTime"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_548); } local_52c = (byte *)0x2; if (in_ECX[2] != 2) { local_52c = (byte *)0x0; } pLVar8 = ANM2::GetLayer(this,(byte *)"GroupScore"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_52c); } if ((in_ECX[2] == 2) || (local_548 = 4.2039e-45, in_ECX[2] != 3)) { local_548 = 0.0; } pLVar8 = ANM2::GetLayer(this,(byte *)"GroupTime"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar8->_layerData,(int)local_548); } } pLVar8 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x49),(byte *)"Character"); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(in_ECX + 0x49),*(int *)pLVar8->_layerData,in_ECX[0xab]); } local_52c = (byte *)0x7; iVar21 = 0; if (in_ECX[0xb6] == 1) { iVar21 = 7; } if ((char)in_ECX[0xb7] == '\0') { switch(in_ECX[0xaa]) { case 6: break; default: iVar21 = 0; break; case 8: iVar21 = iVar21 + 1; break; case 10: iVar21 = iVar21 + (3 - (uint)(in_ECX[0xba] != 1)); break; case 0xb: iVar21 = iVar21 + (5 - (uint)(in_ECX[0xba] != 1)); } } else { iVar21 = iVar21 + 6; } pLVar8 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x49),&DAT_00b6e4a8); if (pLVar8 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(in_ECX + 0x49),*(int *)pLVar8->_layerData,iVar21); } iVar21 = FUN_00858370(); local_526 = iVar21 != 0; local_525 = iVar21 == 0; pLVar8 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x49),(byte *)"LeftButton"); pLVar8->_visible = local_525; pLVar8 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x49),(byte *)"RightButton"); pLVar8->_visible = local_525; local_558 = (g_screenWidth - 480.0) * 0.5; local_550.y = (g_screenHeight - 270.0) * 0.5; local_550.x = local_558; local_540 = local_550.y; if (*(char *)((int)in_ECX + 0x22d) != '\0') { if ((char)in_ECX[0x65] == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x55),&local_550,&g_vectorZero,&g_vectorZero); pAVar16 = (AnimationState *)(in_ECX + 0x5d); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x5d),&local_550,&g_vectorZero,&g_vectorZero); pAVar16 = (AnimationState *)(in_ECX + 0x55); } AnimationState::Render(pAVar16,&local_550,&g_vectorZero,&g_vectorZero); local_540 = local_550.y; } local_53c = &g_manager->_font2_TeamMeatEx12; local_558 = local_550.x; local_550.y = local_540; if ((local_526 != '\0') && (in_ECX[0x56] != 0)) { pfVar9 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x55),(byte *)"LeftTrigger"); if (pfVar9 != (float *)0x0) { local_550.x = local_558 + *pfVar9; local_550.y = local_540 + pfVar9[1]; iVar21 = FUN_00858370(); pos.y = local_550.y; pos.x = local_550.x; render_input_button_icon (iVar21,0x18,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos); } if ((in_ECX[0x56] != 0) && (pfVar9 = AnimationState::GetNullFrame ((AnimationState *)(in_ECX + 0x55),(byte *)"RightTrigger"), pfVar9 != (float *)0x0)) { local_550.x = local_558 + *pfVar9; local_550.y = local_540 + pfVar9[1]; iVar21 = FUN_00858370(); pos_00.y = local_550.y; pos_00.x = local_550.x; render_input_button_icon (iVar21,0x19,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_00); } } *(undefined1 *)((int)in_ECX + 0x3aa) = 0; pAVar16 = (AnimationState *)(in_ECX + 0x55); if (in_ECX[0x56] != 0) { pfVar9 = AnimationState::GetNullFrame(pAVar16,&DAT_00b6e3ec); if (pfVar9 != (float *)0x0) { local_52c = (byte *)(local_558 + *pfVar9 + 0.0); local_564 = (void *)((local_540 + pfVar9[1]) - 7.0); DateTime::set_from_yyyymmdd(&local_4f8,in_ECX[0x94]); if ((local_4f8 & 2) != 0) { local_4f0 = (undefined1 [8])_mkgmtime64(&tStack_4e8); } bVar7 = (byte)local_4f8; if (((byte)local_4f8 & 3) != 0) { ptVar10 = _gmtime64((__time64_t *)local_4f0); tStack_4e8.tm_sec = ptVar10->tm_sec; tStack_4e8.tm_min = ptVar10->tm_min; tStack_4e8.tm_hour = ptVar10->tm_hour; tStack_4e8.tm_mday = ptVar10->tm_mday; tStack_4e8.tm_mon = ptVar10->tm_mon; tStack_4e8.tm_year = ptVar10->tm_year; tStack_4e8.tm_wday = ptVar10->tm_wday; tStack_4e8.tm_yday = ptVar10->tm_yday; tStack_4e8.tm_isdst = ptVar10->tm_isdst; bVar7 = (byte)local_4f8; } local_4f8 = CONCAT11(local_4f8._1_1_,bVar7) & 0xfffc; strftime((char *)local_c0,0x48,"%a, %m/%d/%Y",&tStack_4e8); Font::get_string_width_n(local_53c,local_c0,-1); local_524 = 0; local_520 = (byte ****)0xffff; local_51c._red = 0.0; local_51c._green = 1.0; local_51c._blue = -NAN; local_51c._alpha = 0.0; local_51c._unk = 0; local_14 = 0; KColor::SetFromARGB(&local_5b0,0xff362f2d); Font::DrawString(local_c0); local_14 = 0xffffffff; } if (in_ECX[0x56] != 0) { local_55c = AnimationState::GetNullFrame(pAVar16,(byte *)"ScoresLeft"); if (in_ECX[0x56] == 0) { local_564 = (void *)0x0; } else { local_564 = AnimationState::GetNullFrame(pAVar16,(byte *)"ScoresRight"); } goto LAB_00859cda; } } local_564 = (void *)0x0; local_55c = (float *)0x0; LAB_00859cda: if ((local_55c != (float *)0x0) && (local_564 != (void *)0x0)) { pbVar11 = (byte *)in_ECX[0x93]; if ((int)pbVar11 < 1) { if (pbVar11 == (byte *)0x0) { local_540 = (local_540 + local_55c[1]) - 7.0; local_56c = (int *)(g_screenWidth * 0.5); if (in_ECX[3] == 2) { text = "#LEADERBOARD_SELF_NO_EXIST"; } else { text = "#LEADERBOARD_NO_ENTRIES"; } pbVar11 = string_table_translate(&g_manager->_stringTable,(byte *)text); sprintf_s(local_c0,0x48,pbVar11); pbVar11 = local_c0; do { bVar7 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar7 != 0); text_convert_encoding(local_c0,(int)pbVar11 - (int)(local_c0 + 1),0,local_4c0,0x200,1); iVar21 = Font::get_string_width_utf16(local_53c,local_4c0,-1); fVar23 = (float)((double)iVar21 + __uint_to_double_fixup[-(iVar21 >> 0x1f)]) * 0.5; FontSettings::constructor(local_5b8); local_14 = 0xc; KColor::SetFromARGB(&local_51c,0xff362f2d); Font::draw_string_wide_unscaled (local_53c,local_4c0,(float)local_56c - fVar23,local_540,color_01,settings); } } else if (in_ECX[0x92] != 0) { local_538 = (byte *)0x0; if (in_ECX[3] == 1) { local_538 = (byte *)in_ECX[0xeb]; local_52c = local_538 + 10; ppbVar17 = &local_52c; if ((int)pbVar11 < (int)(local_538 + 10)) { ppbVar17 = (byte **)(in_ECX + 0x93); } pbVar11 = *ppbVar17; } local_548 = local_558 + *local_55c; local_52c = pbVar11 + -(int)local_538; local_544 = local_540 + local_55c[1]; local_554 = (ScoreSheet)((float)(int)local_52c * -7.5); dVar24 = floor((double)(float)local_554); local_554 = (ScoreSheet)(float)dVar24; local_548 = local_548 + 0.0; local_544 = local_544 + (float)local_554; if ((int)local_538 < (int)pbVar11) { local_59c = local_548 + 55.0; local_560 = (int)local_538 * 0x28; local_568 = local_548 + 75.0; do { iVar21 = local_560; ScoreSheet::ScoreSheet(&local_150); local_14 = 1; piVar18 = (int *)(in_ECX[0x92] + iVar21); local_554 = local_c4; local_52d = true; local_525 = true; if (0x47 < (uint)piVar18[5]) { pSVar1 = (ScoreSheet *)piVar18[4]; local_508 = 0; uStack_504 = 0; uStack_500 = 0; uStack_4fc = 0; local_4f8 = 0; local_150 = *pSVar1; local_14c = pSVar1[1]; local_148 = pSVar1[2]; local_144 = pSVar1[3]; SVar2 = pSVar1[0xe]; tStack_4e8._16_8_ = *(undefined8 *)(pSVar1 + 0xc); local_140 = pSVar1[4]; local_130 = pSVar1[5]; local_12c = pSVar1[6]; local_128 = pSVar1[7]; local_124 = pSVar1[8]; local_120 = pSVar1[9]; local_118 = pSVar1[10]; local_114 = pSVar1[0xb]; local_104 = tStack_4e8.tm_mon; local_f8 = tStack_4e8.tm_year; if (0x10900f7 < (uint)SVar2) { local_138 = tStack_4e8.tm_yday; local_13c = tStack_4e8.tm_isdst; local_134 = local_4c4; } local_52d = tStack_4e8.tm_year != 1; local_525 = (int)local_c4 < (int)SVar2; local_c4 = SVar2; } cVar6 = (**(code **)(*piVar18 + 0x14))(); if (cVar6 == '\0') { if (local_525 == false) { uVar15 = 0xff7a1818; if (local_52d != false) { uVar15 = 0xff362f2d; } } else { uVar15 = 0x7f362f2d; } } else { uVar15 = 0xffb8860b; } KColor::SetFromARGB(&local_5b0,uVar15); local_588 = (float)local_5b0._unk; local_554 = (ScoreSheet)local_5b0._unk; local_598 = local_5b0._red; fStack_594 = local_5b0._green; fStack_590 = local_5b0._blue; fStack_58c = local_5b0._alpha; sprintf_s(local_30,10,&DAT_00b6e800); pbVar11 = (byte *)(**(code **)(*(int *)(in_ECX[0x92] + iVar21) + 4))(); if (pbVar11 == (byte *)0x0) { iVar19 = 0; } else { local_538 = pbVar11 + 1; pbVar20 = pbVar11; do { bVar7 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar7 != 0); iVar19 = (int)pbVar20 - (int)local_538; } text_convert_encoding(pbVar11,iVar19,0,&sStack_58,0x13,1); iVar19 = 0; psVar5 = &sStack_58; if (sStack_58 != 0) { do { psVar12 = psVar5; iVar19 = iVar19 + 1; psVar5 = psVar12 + 1; } while (psVar12[1] != 0); if (0x10 < iVar19) { psVar12[-0xffffffff00000001] = 0x2e; psVar12[0] = 0x2e; } } iVar19 = *(int *)(in_ECX[0x92] + 4 + iVar21); if ((iVar19 == 0) || (piVar18 = (int *)(iVar19 + 0x14), *piVar18 == 0)) { piVar18 = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&local_57c,piVar18); local_14 = CONCAT31(local_14._1_3_,2); local_538 = (byte *)((uint)local_534 | 9); local_534 = local_538; if (local_57c == 0) { LAB_0085a121: local_526 = '\0'; } else { iVar19 = *(int *)(in_ECX[0x92] + 4 + iVar21); if ((iVar19 == 0) || (piVar18 = (int *)(iVar19 + 0x14), *piVar18 == 0)) { piVar18 = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&local_574,piVar18); local_14 = 3; local_538 = (byte *)((uint)local_534 | 0x12); local_534 = local_538; cVar6 = (**(code **)*local_574)(); local_526 = '\x01'; if (cVar6 == '\0') goto LAB_0085a121; } if (((uint)local_534 & 2) != 0) { local_538 = (byte *)((uint)local_534 & 0xfffffffd); local_14 = 4; local_534 = local_538; if (((local_570 != (int *)0x0) && (cVar6 = (**(code **)(*local_570 + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_14._1_3_ = 0; if (((uint)local_534 & 1) != 0) { local_534 = (undefined1 *)((uint)local_534 & 0xfffffffe); local_14 = 5; if (((local_578 != (int *)0x0) && (cVar6 = (**(code **)(*local_578 + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_14._0_1_ = 1; if (local_526 != '\0') { KColor::SetFromARGB(&local_51c,0xffffffff); pvVar22 = (void *)(local_544 + 2.0 + 16.0); imageRefCount = color_00; render_quad_set_uniform_color (local_640,local_548 + 57.0,local_544 + 2.0,local_548 + 57.0 + 16.0, (float)pvVar22,color_00); puVar13 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar13 = g_currentShader; } local_4f0._4_4_ = 0x3f800000; tStack_4e8.tm_sec = 0x3f800000; tStack_4e8.tm_min = 0x3f800000; tStack_4e8.tm_hour = 0x3f800000; tStack_4e8.tm_yday = 0; tStack_4e8.tm_mday = 0; tStack_4e8.tm_mon = 0; tStack_4e8.tm_year = 0; tStack_4e8.tm_wday = 0; tStack_4e8.tm_isdst = 0; local_4c4 = 0; if (local_52d == false) { tStack_4e8.tm_mday = 0x3f800000; tStack_4e8.tm_mon = 0x3f800000; tStack_4e8.tm_year = 0x3f800000; tStack_4e8.tm_wday = 0x3f800000; } local_5b0._unk = 0; local_5b0._red = 1.0; local_5b0._green = 1.0; local_5b0._blue = 1.0; local_5b0._alpha = 1.0; if (local_525 != false) { local_5b0._alpha = 0.5; } local_538 = auStack_64a + -10; iVar21 = *(int *)(in_ECX[0x92] + 4 + iVar21); if ((iVar21 == 0) || (piVar18 = (int *)(iVar21 + 0x14), *piVar18 == 0)) { piVar18 = (int *)&DAT_00c799d8; } g_currentShader = puVar13; KAGE::SmartPointer::operator_assign(auStack_64a + -10,piVar18); puVar3 = local_534; apply_sprite_shader_params((ColorMod *)(local_4f0 + 4),1,pvVar22,imageRefCount); iVar21 = *(int *)(in_ECX[0x92] + local_560 + 4); if ((iVar21 == 0) || (piVar18 = (int *)(iVar21 + 0x14), *piVar18 == 0)) { piVar18 = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&local_584,piVar18); local_534 = (undefined1 *)((uint)puVar3 | 0x60); local_14._0_1_ = 6; (**(code **)(*local_584 + 0x1c))(); local_14._0_1_ = 7; iVar21 = 0; if (local_580 != (int *)0x0) { cVar6 = (**(code **)(*local_580 + 0xc))(); iVar21 = extraout_ECX; if ((cVar6 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); iVar21 = extraout_ECX_00; } } local_14._0_1_ = 1; shader_cache_find(iVar21); iVar21 = local_560; } local_524 = 0; local_520 = (byte ****)0xffff; local_51c._red = 0.0; local_51c._green = 1.0; local_51c._blue = -NAN; local_51c._alpha = 0.0; local_51c._unk = 0; local_14._0_1_ = 8; Font::get_string_width_n(local_53c,local_30,-1); Font::DrawString(local_30); iVar19 = Font::get_string_width_utf16(local_53c,&sStack_58,-1); local_524 = 0; local_520 = (byte ****)0xffff; local_51c._red = 0.0; local_51c._green = 1.0; local_51c._blue = -NAN; local_51c._alpha = 0.0; local_51c._unk = 0; local_5c0.x = (float)(160.0 / (float)iVar19); if (160.0 / (float)iVar19 <= 0.0) { local_5c0.x = (float)(byte *)0x0; } if (1.0 <= local_5c0.x) { local_5c0.x = 1.0; } local_14._0_1_ = 9; local_5c0.y = local_5c0.x; local_538 = (byte *)local_5c0.x; pvVar22 = Font::layout_glyphs(local_53c,local_5d0,(byte *)&sStack_58,&local_524,&local_5c0 ); local_14 = CONCAT31(local_14._1_3_,10); color._green = fStack_594; color._red = local_598; color._blue = fStack_590; color._alpha = fStack_58c; color._unk = (int)local_554; Font::draw_glyph_run (local_53c,local_568,local_544,pvVar22,(float)local_538,(float)local_538,color, &local_524); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); cVar6 = FUN_00856f50(); if (cVar6 == '\0') { sprintf_s(local_78,0x20,(byte *)"Lv%2d %d:%02d:%02d"); in_ECX = local_56c; iVar21 = local_560; } else { sprintf_s(local_78,0x20,s__d); } Font::get_string_width_n(local_53c,local_78,-1); local_524 = 0; local_520 = (byte ****)0xffff; local_51c._red = 0.0; local_51c._green = 1.0; local_51c._blue = -NAN; local_51c._alpha = 0.0; local_51c._unk = 0; local_14._0_1_ = 0xb; Font::DrawString(local_78); local_14 = CONCAT31(local_14._1_3_,1); local_544 = local_544 + 15.0; cVar6 = (**(code **)(*(int *)(in_ECX[0x92] + iVar21) + 0x14))(); if (cVar6 != '\0') { *(undefined1 *)((int)in_ECX + 0x3aa) = 1; fVar23 = local_544 - (local_540 + local_55c[1] + 7.0); pLVar8 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x49),&DAT_00b6e4bc); (pLVar8->_pos).y = fVar23; } local_14 = 0xffffffff; std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); local_560 = iVar21 + 0x28; local_52c = local_52c + -1; } while (local_52c != (byte *)0x0); } } } ExceptionList = local_1c; return; } //@@ 0085a8b0 FUN_0085a8b0 void FUN_0085a8b0(void) { int in_ECX; KAGE::System::LeaderboardManager::release_result(-1); *(undefined4 *)(in_ECX + 0x244) = 0; *(undefined4 *)(in_ECX + 0x240) = 0; *(undefined4 *)(in_ECX + 0x23c) = 0; *(undefined4 *)(in_ECX + 0x238) = 0; return; } //@@ 0085a8f0 FUN_0085a8f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0085a8f0(int *param_1,int *param_2) { int iVar1; int iStack_50; int iStack_4c; int iStack_48; int iStack_44; undefined2 uStack_40; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; KAGE_LogMessage(1,(byte *)"Leaderboard::OnScoreLeaderboardFound() callback called\n"); iVar1 = param_2[2]; if ((iVar1 == 0) || (iVar1 == 1)) { param_2[0x8e] = *param_1; } else { param_2[0x90] = *param_1; } if (*param_2 == 0) { if ((char)param_2[0xe7] == '\0') { iStack_50 = param_2[0xc3]; iStack_4c = param_2[0xc4]; iStack_48 = param_2[0xc5]; iStack_44 = param_2[0xc6]; uStack_40 = (undefined2)param_2[199]; DAT_00c5ab40 = 0x48; FUN_00a51aa0(*param_1,param_2[0xd0],&iStack_50,FUN_0085aad0,param_2); return; } } else if (*param_2 == 1) { Leaderboard::download_entries(iVar1,param_2[3]); } return; } //@@ 0085a9d0 FUN_0085a9d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0085a9d0(int *param_1,int *param_2) { int iVar1; int iStack_50; int iStack_4c; int iStack_48; int iStack_44; undefined2 uStack_40; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; KAGE_LogMessage(1,(byte *)"Leaderboard::OnTimeLeaderboardFound() callback called\n"); iVar1 = param_2[2]; if ((iVar1 == 0) || (iVar1 == 1)) { param_2[0x8f] = *param_1; } else { param_2[0x91] = *param_1; } if (*param_2 == 0) { if (*(char *)((int)param_2 + 0x39d) == '\0') { iStack_50 = param_2[0xc3]; iStack_4c = param_2[0xc4]; iStack_48 = param_2[0xc5]; iStack_44 = param_2[0xc6]; uStack_40 = (undefined2)param_2[199]; DAT_00c5ab40 = 0x48; FUN_00a51aa0(*param_1,(0x7f - param_2[0xd1]) * 0x1000000 | param_2[0xd6],&iStack_50, FUN_0085ab50,param_2); return; } } else if (*param_2 == 1) { Leaderboard::download_entries(iVar1,param_2[3]); } return; } //@@ 0085aad0 FUN_0085aad0 void FUN_0085aad0(int param_1,Leaderboard *param_2) { int iVar1; undefined4 uVar2; KAGE_LogMessage(1,(byte *)"Leaderboard::OnScoreUploaded() callback called\n"); if (param_1 == 0) { uVar2 = 0; } else { uVar2 = *(undefined4 *)(param_1 + 8); } iVar1 = *(int *)param_2; *(undefined4 *)(param_2 + 0x74) = uVar2; *(bool *)¶m_2[0x73]._state = param_1 != 0; if (iVar1 == 0) { if (0 < param_2[0x68]._state) { if ((*(int *)(param_2 + 1) == 0) || (iVar1 = 3, *(int *)(param_2 + 1) == 1)) { iVar1 = 1; } Leaderboard::get_leaderboard(param_2,iVar1,2); return; } param_2[0x74]._state = -1; *(bool *)((int)¶m_2[0x73]._state + 1) = param_1 != 0; } return; } //@@ 0085ab50 FUN_0085ab50 void FUN_0085ab50(int param_1,int param_2) { undefined4 uVar1; KAGE_LogMessage(1,(byte *)"Leaderboard::OnTimeUploaded() callback called\n"); if (param_1 == 0) { uVar1 = 0; } else { uVar1 = *(undefined4 *)(param_1 + 8); } *(undefined4 *)(param_2 + 0x3a4) = uVar1; *(bool *)(param_2 + 0x39d) = param_1 != 0; return; } //@@ 0085ab90 FUN_0085ab90 void FUN_0085ab90(int param_1,int param_2) { int iVar1; int iVar2; char cVar3; uint uVar4; int *piVar5; int iVar6; int iVar7; int iVar8; int iVar9; bool bVar10; int *piStack_20; int *piStack_1c; int iStack_18; int *piStack_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; iVar2 = param_2; uStack_8 = 0xffffffff; puStack_c = &LAB_00b037dd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Leaderboard::OnScoresDownloaded() callback called\n"); if ((*(int *)(param_1 + 8) == 0) && (*(int *)(param_2 + 0x3ac) < 0)) { if ((*(int *)(param_2 + 0xc) == 2) && (*(char *)(param_2 + 0x3a8) != '\0')) { Leaderboard::download_entries(*(undefined4 *)(param_2 + 8),1); *(undefined1 *)(param_2 + 0x3a8) = 0; ExceptionList = local_10; return; } if ((*(int *)(param_2 + 0xc) == 1) && (*(char *)(param_2 + 0x3a9) != '\0')) { Leaderboard::download_entries(*(undefined4 *)(param_2 + 8),0); *(undefined1 *)(param_2 + 0x3a9) = 0; ExceptionList = local_10; return; } } *(undefined2 *)(param_2 + 0x3a8) = 0; iVar8 = *(int *)(param_1 + 4); *(int *)(param_2 + 0x248) = iVar8; iVar6 = *(int *)(param_1 + 8); *(int *)(param_2 + 0x24c) = iVar6; if (*(int *)(param_2 + 0xc) == 1) { iVar8 = *(int *)(param_2 + 0x3ac); if (iVar8 < 0) { if (0 < iVar6) { iVar7 = 0; iVar9 = -5; do { cVar3 = (**(code **)(*(int *)(*(int *)(param_2 + 0x248) + iVar7) + 0x14))(uVar4); if (cVar3 == '\0') { iVar8 = *(int *)(param_2 + 0x3ac); } else { iVar8 = 0; if (0 < iVar9) { iVar8 = iVar9; } *(int *)(param_2 + 0x3ac) = iVar8; } iVar6 = *(int *)(param_2 + 0x24c); iVar7 = iVar7 + 0x28; iVar1 = iVar9 + 6; iVar9 = iVar9 + 1; } while (iVar1 < iVar6); } if (iVar8 < 0) { *(undefined4 *)(param_2 + 0x3ac) = 0; } } if (iVar6 < 1) { ExceptionList = local_10; return; } } else { *(undefined4 *)(param_2 + 0x3ac) = 0xffffffff; if (iVar6 < 1) { ExceptionList = local_10; return; } *(int *)(param_2 + 0x3ac) = *(int *)(iVar8 + 8) + -1; } iVar8 = 0; param_2 = 0; do { iVar6 = *(int *)(*(int *)(iVar2 + 0x248) + 4 + iVar8); if ((iVar6 == 0) || (piVar5 = (int *)(iVar6 + 0x14), *piVar5 == 0)) { piVar5 = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&iStack_18,piVar5); bVar10 = iStack_18 != 0; uStack_8 = 0; if (((piStack_14 != (int *)0x0) && (cVar3 = (**(code **)(*piStack_14 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&iStack_18); } uStack_8 = 0xffffffff; if (bVar10) { iVar6 = *(int *)(*(int *)(iVar2 + 0x248) + 4 + iVar8); if ((iVar6 == 0) || (piVar5 = (int *)(iVar6 + 0x14), *piVar5 == 0)) { piVar5 = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&piStack_20,piVar5); piVar5 = piStack_20; uStack_8 = 1; if ((piStack_20[0xc] != 1) || (piStack_20[0xd] != 1)) { (**(code **)(*piStack_20 + 0x44))(1,1); piVar5[0xc] = 1; piVar5[0xd] = 1; } uStack_8 = 2; if (((piStack_1c != (int *)0x0) && (cVar3 = (**(code **)(*piStack_1c + 0xc))(), cVar3 != '\0') ) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&piStack_20); } } uStack_8 = 0xffffffff; iVar8 = iVar8 + 0x28; param_2 = param_2 + 1; } while (param_2 < *(int *)(iVar2 + 0x24c)); ExceptionList = local_10; return; } //@@ 0085ae10 FUN_0085ae10 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0085ae10(undefined4 *param_1,int param_2) { char cVar1; ScoreSheet local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined2 local_44; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if ((param_1 != (undefined4 *)0x0) && (param_2 != 0)) { local_54 = g_game->_scoreSheet; uStack_50 = *(undefined4 *)&g_game->field_0x266e8; uStack_4c = *(undefined4 *)&g_game->field_0x266ec; uStack_48 = *(undefined4 *)&g_game->field_0x266f0; local_44 = (undefined2)*(undefined4 *)&g_game->field_0x266f4; DAT_00c5ab40 = 0x48; cVar1 = FUN_00a51aa0(*param_1,*(undefined4 *)&g_game->field_0x26718,&local_54,0,param_2); if (cVar1 == '\0') { KAGE_LogMessage(1,(byte *)"BAD THING \n"); } } return; } //@@ 0085aeb0 date_to_yyyymmdd /* DB: (flags, ?, time64, tm fields...): with flag 2 _mkgmtime64(tm), with flags 1/2 _gmtime64; returns (year+1900)*10000 + (mon+1)*100 + mday; callers holiday_get_current, Menu_OnlineLobby::Update (daily), 008576c0, 00958c40 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl date_to_yyyymmdd(byte flags,int unknown,longlong time,int tmSec,int tmMin,int tmHour,int tmMday, int tmMon,int tmYear,int tmWday,int tmYday,int tmIsdst) { short sVar1; tm *ptVar2; char cVar3; if ((flags & 2) != 0) { time = _mkgmtime64((tm *)&tmSec); } if ((flags & 3) == 0) { sVar1 = (short)tmYear; cVar3 = (char)tmMon; } else { ptVar2 = _gmtime64(&time); tmMday = ptVar2->tm_mday; cVar3 = (char)ptVar2->tm_mon; sVar1 = (short)ptVar2->tm_year; } return ((short)(sVar1 + 0x76c) * 100 + (int)(char)(cVar3 + '\x01')) * 100 + (int)(char)tmMday; } //@@ 0085af30 DateTime::set_from_yyyymmdd /* DB: ? EDX = date as YYYYMMDD: zeroes the struct, flags |= 2, writes tm-style day (+0x1c = %100), month-1 (+0x20), year-1900 (+0x24, -0x76c); DailyChallenge::Init, holiday_get_current, Leaderboard::render_scores prototype: db/protos.zhl */ void __fastcall DateTime::set_from_yyyymmdd(void *dateTime,int yyyymmdd) { *(undefined1 *)dateTime = 0; *(undefined4 *)((int)dateTime + 8) = 0; *(undefined4 *)((int)dateTime + 0xc) = 0; *(undefined4 *)((int)dateTime + 0x10) = 0; *(undefined4 *)((int)dateTime + 0x14) = 0; *(undefined4 *)((int)dateTime + 0x18) = 0; *(undefined4 *)((int)dateTime + 0x28) = 0; *(undefined4 *)((int)dateTime + 0x2c) = 0; *(undefined4 *)((int)dateTime + 0x30) = 0; *(byte *)dateTime = *(byte *)dateTime | 2; *(uint *)((int)dateTime + 0x20) = ((uint)yyyymmdd % 10000) / 100 - 1; *(uint *)((int)dateTime + 0x1c) = ((uint)yyyymmdd % 10000) % 100; *(uint *)((int)dateTime + 0x24) = (uint)yyyymmdd / 10000 - 0x76c; return; } //@@ 0085afb0 leaderboard_name_format /* DB: (outStr, kind): sprintf_s "%d_scores_solo_R+" / "%d_times_solo_R+" / "%d_scores_coop_R+" / "%d_times_coop_R+" for kind 0..3 into a static buffer and assigns it to the out std::string (ECX); callers Leaderboard::get_leaderboard, Game::StartStageTransition, 008d0940, 009c5f90 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl leaderboard_name_format(void *outName,int dailyChallengeDate,int unused,int kind) { char *pcVar1; char *pcVar2; switch(kind) { case 0: pcVar2 = "%d_scores_solo_R+"; break; case 1: pcVar2 = "%d_times_solo_R+"; break; case 2: pcVar2 = "%d_scores_coop_R+"; break; case 3: pcVar2 = "%d_times_coop_R+"; break; default: goto switchD_0085afc2_default; } sprintf_s(&DAT_00c7f490,0x20,(byte *)pcVar2); switchD_0085afc2_default: *(undefined4 *)outName = 0; *(undefined4 *)((int)outName + 0x10) = 0; *(undefined4 *)((int)outName + 0x14) = 0xf; *(undefined1 *)outName = 0; pcVar2 = &DAT_00c7f490; do { pcVar1 = pcVar2; pcVar2 = pcVar1 + 1; } while (*pcVar1 != '\0'); std::string::assign(outName,&DAT_00c7f490,(uint)(pcVar1 + -0xc7f490)); return outName; } //@@ 0085b050 LobbySettings::reset /* DB: ? zeroes +0..+8, max players +0xc = 4, public byte +0x10 = 1, clears two std::strings (+0x18, +0x30) and a vector (+0x48), and when this is Manager+0x4b0d8 and MenuManager exists re-runs Menu_OnlineLobby::init_lobby_view; Manager::constructor, online_lobby_join prototype: db/protos.zhl */ void __thiscall LobbySettings::reset(LobbySettings *this) { MenuManager *pMVar1; std_string *psVar2; std_string *psVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03826; local_10 = ExceptionList; ExceptionList = &local_10; (this->_seed)._buf[0] = '\0'; (this->_seed)._buf[1] = '\0'; (this->_seed)._buf[2] = '\0'; (this->_seed)._buf[3] = '\0'; (this->_seed)._size = 0; (this->_seed)._capacity = 0xf; (this->_seed)._buf[0] = '\0'; (this->_password)._buf[0] = '\0'; (this->_password)._buf[1] = '\0'; (this->_password)._buf[2] = '\0'; (this->_password)._buf[3] = '\0'; (this->_password)._size = 0; (this->_password)._capacity = 0xf; (this->_password)._buf[0] = '\0'; *(undefined4 *)(this + 1) = 0; this[1]._gameMode = 0; this[1]._challenge = 0; local_8 = 2; psVar3 = &this->_seed; *(undefined4 *)this = 0; this->_gameMode = 0; this->_challenge = 0; this->_maxPlayers = 4; this->field_0x10 = 1; *(undefined4 *)&this->field_0x14 = 0; if (0xf < (this->_seed)._capacity) { psVar3 = *(std_string **)(this->_seed)._buf; } (this->_seed)._size = 0; psVar2 = &this->_password; psVar3->_buf[0] = '\0'; if (0xf < (this->_password)._capacity) { psVar2 = *(std_string **)(this->_password)._buf; } (this->_password)._size = 0; psVar2->_buf[0] = '\0'; pMVar1 = g_menuManager; this[1]._gameMode = *(int *)(this + 1); if ((pMVar1 != (MenuManager *)0x0) && (this == &g_manager->_lobbySettings)) { Menu_OnlineLobby::init_lobby_view(&pMVar1->field_0xdce8); } ExceptionList = local_10; return; } //@@ 0085b160 FUN_0085b160 void FUN_0085b160(undefined4 param_1,undefined1 param_2,int *param_3) { char cVar1; Menu_Save *in_ECX; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_1e [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03889; local_10 = ExceptionList; ExceptionList = &local_10; in_ECX[6] = (Menu_Save)0x0; in_ECX[10] = (Menu_Save)0x0; in_ECX[0xb] = (Menu_Save)0xf; *(undefined1 *)(in_ECX + 6) = 0; in_ECX[0xc] = (Menu_Save)0x0; in_ECX[0x10] = (Menu_Save)0x0; in_ECX[0x11] = (Menu_Save)0xf; *(undefined1 *)(in_ECX + 0xc) = 0; in_ECX[0x12] = (Menu_Save)0x0; in_ECX[0x13] = (Menu_Save)0x0; in_ECX[0x14] = (Menu_Save)0x0; *(undefined1 *)(in_ECX + 4) = 1; lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_8 = 4; std::shared_ptr::assign(auStack_1e + -10,¶m_2); local_8 = CONCAT31(local_8._1_3_,3); Menu_Save::select_save_slot(in_ECX,lobbyHandleVtable,lobby,lobbyRefCount); local_8 = 5; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 0085b260 FUN_0085b260 void FUN_0085b260(void) { int in_ECX; std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x30)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x18)); return; } //@@ 0085b280 LobbySettings::reset /* DB: zeroes +0..+8, max players +0xc = 4, public byte +0x10 = 1, clears the strings at +0x18/+0x30 (size 0, keep capacity) and the vector +0x48 (end = begin), then Menu_OnlineLobby::init_lobby_view when this is Manager+0x4b0d8; 0085b050 LobbySettings::reset named LobbySettings::reset) first constructs the strings (cap 0xf) and the vector, i.e. it is the constructor prototype: db/protos.zhl */ void __thiscall LobbySettings::reset(LobbySettings *this) { MenuManager *pMVar1; std_string *psVar2; *(undefined4 *)this = 0; psVar2 = &this->_seed; this->_gameMode = 0; this->_challenge = 0; this->_maxPlayers = 4; this->field_0x10 = 1; *(undefined4 *)&this->field_0x14 = 0; if (0xf < (this->_seed)._capacity) { psVar2 = *(std_string **)(this->_seed)._buf; } (this->_seed)._size = 0; psVar2->_buf[0] = '\0'; psVar2 = &this->_password; if (0xf < (this->_password)._capacity) { psVar2 = *(std_string **)(this->_password)._buf; } (this->_password)._size = 0; psVar2->_buf[0] = '\0'; pMVar1 = g_menuManager; this[1]._gameMode = *(int *)(this + 1); if ((pMVar1 != (MenuManager *)0x0) && (this == &g_manager->_lobbySettings)) { Menu_OnlineLobby::init_lobby_view(&pMVar1->field_0xdce8); } return; } //@@ 0085b300 Menu_Save::select_save_slot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Menu_Save::select_save_slot(uint32_t slot); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Menu_Save::select_save_slot(Menu_Save *this,void *lobbyHandleVtable,void *lobby,void *lobbyRefCount) { char cVar1; int iVar2; Menu_Save MVar3; byte *attrValue; void *ptr; byte *attrEnd; uint size; void *pvVar4; int *piVar5; uint uVar6; int *piVar7; undefined8 bannedUserId; undefined8 bannedUserIdCopy; int *tokenArray; uint tokenCount; int *errnoPtr; int *parseEnd; uint local_b4; int bannedChunkIndex; Menu_Save *settings; int *tokensBegin; int *tokensEnd; int tokensCapEnd; uint local_9c; void *bannedText [4]; int bannedTextSize; uint bannedTextCapacity; byte attrKey [104]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte ch; int *tokensEndCopy; puStack_c = &LAB_00b038ea; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(attrKey + 0x7c); ExceptionList = &local_10; uVar6 = 0; local_b4 = 0; local_8 = 0; settings = this; if (lobby == (void *)0x0) { iVar2 = 0; } else { iVar2 = (**(code **)(*(int *)lobby + 0x3c))(local_18); } MVar3._1_3_ = 0; MVar3._0_1_ = iVar2 != 3; *this = MVar3; if (lobby == (void *)0x0) { MVar3 = (Menu_Save)0x0; } else { MVar3 = (Menu_Save)(**(code **)(*(int *)lobby + 0x1c))(); } this[3] = MVar3; if (lobby == (void *)0x0) { MVar3 = (Menu_Save)0x0; } else { MVar3 = (Menu_Save)(**(code **)(*(int *)lobby + 0x30))("lobby_mode"); } this[1] = MVar3; if (lobby == (void *)0x0) { MVar3 = (Menu_Save)0x0; } else { MVar3 = (Menu_Save)(**(code **)(*(int *)lobby + 0x30))("lobby_tag"); } this[5] = MVar3; if (lobby == (void *)0x0) { MVar3 = (Menu_Save)0x0; } else { MVar3 = (Menu_Save)(**(code **)(*(int *)lobby + 0x30))("lobby_challenge"); } this[2] = MVar3; if (lobby == (void *)0x0) { attrValue = (byte *)0x0; } else { attrValue = (byte *)(**(code **)(*(int *)lobby + 0x2c))("lobby_seed"); } attrEnd = attrValue; do { ch = *attrEnd; attrEnd = attrEnd + 1; } while (ch != 0); std::string::assign((char *)(this + 6),attrValue,(int)attrEnd - (int)(attrValue + 1)); if (lobby == (void *)0x0) { attrValue = (byte *)0x0; } else { attrValue = (byte *)(**(code **)(*(int *)lobby + 0x2c))("lobby_password"); } attrEnd = attrValue; do { ch = *attrEnd; attrEnd = attrEnd + 1; } while (ch != 0); std::string::assign((char *)(this + 0xc),attrValue,(int)attrEnd - (int)(attrValue + 1)); this[0x13] = this[0x12]; bannedChunkIndex = 0; if (lobby == (void *)0x0) { attrValue = (byte *)0x0; } else { attrValue = (byte *)(**(code **)(*(int *)lobby + 0x2c))("lobby_banned"); } bannedTextSize = 0; bannedTextCapacity = 0xf; bannedText[0] = (void *)0x0; attrEnd = attrValue; do { ch = *attrEnd; attrEnd = attrEnd + 1; } while (ch != 0); std::string::assign((char *)bannedText,attrValue,(int)attrEnd - (int)(attrValue + 1)); if (bannedTextSize != 0) { while( true ) { local_8 = CONCAT31(local_8._1_3_,2); local_b4 = uVar6 | 1; tokensBegin = (int *)0x0; tokensEnd = (int *)0x0; tokensCapEnd = 0; local_9c = local_b4; string_split(&tokensBegin); tokenArray = tokensBegin; uVar6 = 0; tokenCount = ((int)tokensEnd - (int)tokensBegin) / 0x18; if (tokenCount != 0) { piVar5 = tokensBegin; do { errnoPtr = _errno(); piVar7 = piVar5; if (0xf < (uint)piVar5[5]) { piVar7 = (int *)*piVar5; } *errnoPtr = 0; bannedUserId = strtoull(piVar7,&parseEnd,10); if (piVar7 == parseEnd) { std::_Xinvalid_argument("invalid stoull argument"); goto LAB_0085b6fb; } if (*errnoPtr == 0x22) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("stoull argument out of range"); } MVar3 = settings[0x13]; bannedUserIdCopy = bannedUserId; if (MVar3 == settings[0x14]) { std::vector<8byte>::_Emplace_reallocate(MVar3,&bannedUserIdCopy); } else { *(undefined8 *)MVar3 = bannedUserId; settings[0x13] = (Menu_Save)((int)settings[0x13] + 8); } uVar6 = uVar6 + 1; piVar5 = piVar5 + 6; } while (uVar6 < tokenCount); } piVar5 = tokenArray; bannedChunkIndex = bannedChunkIndex + 1; sprintf_s(attrKey,100,&DAT_00b69520); if (lobby == (void *)0x0) { attrValue = (byte *)0x0; } else { attrValue = (byte *)(**(code **)(*(int *)lobby + 0x2c))(attrKey); } attrEnd = attrValue; do { ch = *attrEnd; attrEnd = attrEnd + 1; } while (ch != 0); std::string::assign((char *)bannedText,attrValue,(int)attrEnd - (int)(attrValue + 1)); tokensEndCopy = tokensEnd; local_9c = local_9c & 0xfffffffe; local_8 = CONCAT31(local_8._1_3_,1); piVar7 = piVar5; if (piVar5 != (int *)0x0) { for (; piVar7 != tokensEndCopy; piVar7 = piVar7 + 6) { uVar6 = piVar7[5]; if (0xf < uVar6) { pvVar4 = (void *)*piVar7; size = uVar6 + 1; ptr = pvVar4; if (0xfff < size) { ptr = *(void **)((int)pvVar4 + -4); size = uVar6 + 0x24; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) goto LAB_0085b728; } operator_delete(ptr,size); } piVar7[4] = 0; piVar7[5] = 0xf; *(undefined1 *)piVar7 = 0; } uVar6 = ((tokensCapEnd - (int)piVar5) / 0x18) * 0x18; piVar7 = piVar5; if (0xfff < uVar6) { piVar7 = (int *)piVar5[-1]; uVar6 = uVar6 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar5 + (-4 - (int)piVar7))) goto LAB_0085b728; } operator_delete(piVar7,uVar6); tokensBegin = (int *)0x0; tokensEnd = (int *)0x0; tokensCapEnd = 0; } if (bannedTextSize == 0) break; uVar6 = local_9c; } } LAB_0085b6fb: local_8 = local_8 & 0xffffff00; if (0xf < bannedTextCapacity) { uVar6 = bannedTextCapacity + 1; pvVar4 = bannedText[0]; if (0xfff < uVar6) { pvVar4 = *(void **)((int)bannedText[0] + -4); uVar6 = bannedTextCapacity + 0x24; if (0x1f < (uint)((int)bannedText[0] + (-4 - (int)pvVar4))) { LAB_0085b728: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar6); } local_8 = 3; if (lobbyRefCount != (void *)0x0) { cVar1 = (**(code **)(*(int *)lobbyRefCount + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobby); } } ExceptionList = local_10; return; } //@@ 0085b790 FUN_0085b790 void FUN_0085b790(void) { char *this; char cVar1; uint uVar2; char *pcVar3; uint in_ECX; int iVar4; undefined4 local_8; this = (char *)(in_ECX + 0x30); local_8 = in_ECX & 0xffff0000; pcVar3 = this; if (0xf < *(uint *)(in_ECX + 0x44)) { pcVar3 = *(char **)this; } *(undefined4 *)(in_ECX + 0x40) = 0; iVar4 = 8; *pcVar3 = '\0'; do { uVar2 = Random(); local_8 = CONCAT31(local_8._1_3_,"wasd8456"[uVar2 & 7]); pcVar3 = (char *)&local_8; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); std::string::append(this,(byte *)&local_8,(int)pcVar3 - ((int)&local_8 + 1)); iVar4 = iVar4 + -1; } while (iVar4 != 0); return; } //@@ 0085b7f0 lobby_password_render /* DB: ? (ECX = password std::string, EDX = position): draws 8 password slots in two rows of 4 (second row +16 px), a glyph per entered character (size at ECX+0x10) and placeholders for empty slots via Font::DrawString in color 0xff362f2d; both Menu_OnlineLobby::Render variants call it at the "Password Position"/"PasswordPosition" null frame, also 0090b900 NetplayManager::Render 009b8990 prototype: db/protos.zhl */ void __fastcall lobby_password_render(void *password,Vector *position,float scale) { Manager *pMVar1; void *pvVar2; KColor *color; KColor *color_00; KColor *color_01; KColor *color_02; KColor *color_03; KColor *color_04; KColor *color_05; KColor *color_06; uint uVar3; float fVar4; float fVar5; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; KColor local_40; Vector local_2c; Vector local_24; float local_1c; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0396d; local_10 = ExceptionList; ExceptionList = &local_10; fVar4 = position->x; uVar3 = 0; fVar5 = position->y; local_2c.x = scale; local_2c.y = scale; local_24.y = fVar5; local_1c = fVar4; local_18 = fVar5; local_14 = fVar4; do { pMVar1 = g_manager; if (uVar3 == 4) { fVar5 = fVar5 + 16.0; local_24.y = fVar5; local_18 = fVar5; local_14 = fVar4; } local_24.x = local_14; if (*(uint *)((int)password + 0x10) <= uVar3) { local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 8; local_40._unk = 0; local_40._red = 0.21176471; local_40._green = 0.18431373; local_40._blue = 0.1764706; local_40._alpha = 1.0; Font::DrawStringScaled (&g_manager->_font3_TeamMeatEx16,&DAT_00b6d4f8,&local_24,&local_40,&local_5c); goto LAB_0085bc8a; } pvVar2 = password; if (0xf < *(uint *)((int)password + 0x14)) { pvVar2 = *(void **)password; } switch(*(undefined1 *)((int)pvVar2 + uVar3)) { case 0x34: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 5; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6e90c,&local_24,&local_2c,color_04, &local_5c); break; case 0x35: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 6; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6e900,&local_24,&local_2c,color_05, &local_5c); break; case 0x36: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 7; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6e904,&local_24,&local_2c,color_06, &local_5c); break; default: goto switchD_0085b8a2_caseD_37; case 0x38: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 4; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6e908,&local_24,&local_2c,color_03, &local_5c); break; case 0x61: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 2; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6d17c,&local_24,&local_2c,color_01, &local_5c); break; case 100: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 3; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6a728,&local_24,&local_2c,color_02, &local_5c); break; case 0x73: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 1; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6e914,&local_24,&local_2c,color_00, &local_5c); break; case 0x77: local_5c = 0; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_8 = 0; KColor::SetFromARGB(&local_40,0xff362f2d); Font::DrawString(&pMVar1->_font3_TeamMeatEx16,&DAT_00b6e910,&local_24,&local_2c,color, &local_5c); } LAB_0085bc8a: fVar4 = local_1c; fVar5 = local_18; switchD_0085b8a2_caseD_37: local_14 = local_14 + 16.0; uVar3 = uVar3 + 1; if (7 < uVar3) { ExceptionList = local_10; return; } } while( true ); } //@@ 0085bd40 FUN_0085bd40 undefined1 FUN_0085bd40(undefined4 param_1,int *param_2,int *param_3) { char cVar1; int iVar2; undefined1 *puVar3; int in_ECX; undefined1 uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0399d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (param_2 == (int *)0x0) { iVar2 = 0; } else { iVar2 = (**(code **)(*param_2 + 0x1c))(__security_cookie ^ (int)register0x00000010 - 4U); } if (*(char *)(iVar2 + 0xe + in_ECX) != '\0') { if (param_2 == (int *)0x0) { puVar3 = (undefined1 *)0x0; } else { puVar3 = (undefined1 *)(**(code **)(*param_2 + 0x30))("lobby_mode"); } if ((puVar3[in_ECX + 4] != '\0') && ((*(int *)&g_manager->_lobbySettings != 2 || (puVar3 == &DAT_00000005)))) { if (param_2 == (int *)0x0) { LAB_0085bdf0: iVar2 = 0; } else { iVar2 = (**(code **)(*param_2 + 0x30))("lobby_tag"); if (((iVar2 != 0) && (*(char *)(in_ECX + 10) == '\0')) && (*(char *)(iVar2 + 10 + in_ECX) == '\0')) goto LAB_0085be18; if (param_2 == (int *)0x0) goto LAB_0085bdf0; iVar2 = (**(code **)(*param_2 + 0x30))("current_stage"); } if (((*(char *)(in_ECX + 0x13) != '\0') || (iVar2 != 0)) && (((*(char *)(in_ECX + 0x14) != '\0' && (*(int *)&g_manager->_lobbySettings != 2)) || (iVar2 < 1)))) { uVar4 = 1; goto LAB_0085be1a; } } } LAB_0085be18: uVar4 = 0; LAB_0085be1a: local_8 = 1; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(¶m_2); } } ExceptionList = local_10; return uVar4; } //@@ 0085be70 FUN_0085be70 void FUN_0085be70(void) { int *piVar1; undefined4 *in_ECX; undefined4 *local_8; local_8 = in_ECX; piVar1 = _errno(); if (0xf < (uint)in_ECX[5]) { in_ECX = (undefined4 *)*in_ECX; } *piVar1 = 0; strtoull(in_ECX,&local_8,10); if (in_ECX == local_8) { std::_Xinvalid_argument("invalid stoull argument"); } if (*piVar1 == 0x22) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("stoull argument out of range"); } return; } //@@ 0085bed0 EntitySpawner::Spawn /* DB: advances RNG then Game::Spawn with stored type/variant; shopkeeper/fireplace/chest loot prototype: db/protos.zhl, confirmed by RET 12 */ Entity * __thiscall EntitySpawner::Spawn(void *this,Vector *position,Vector *velocity,Entity *spawner) { uint *puVar1; code *pcVar2; Entity *pEVar3; uint uVar4; puVar1 = *(uint **)((int)this + 0x10); if (puVar1 == (uint *)0x0) { uVar4 = *(uint *)((int)this + 0xc); } else { uVar4 = *puVar1; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = *puVar1; if (uVar4 == 0) { pcVar2 = (code *)swi(3); pEVar3 = (Entity *)(*pcVar2)(); return pEVar3; } } uVar4 = uVar4 >> ((byte)puVar1[1] & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)puVar1[2] & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)puVar1[3] & 0x1f) ^ uVar4; *puVar1 = uVar4; } pEVar3 = Game::Spawn(g_game,*(uint *)this,*(uint *)((int)this + 4),position,velocity,spawner, *(uint *)((int)this + 8),uVar4); return pEVar3; } //@@ 0085bf50 FUN_0085bf50 void FUN_0085bf50(undefined4 param_1) { undefined4 *in_ECX; undefined4 local_c; undefined1 local_8; local_c = param_1; local_8 = 1; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(&local_c,in_ECX + 1); *in_ECX = std::logic_error::vftable; return; } //@@ 0085bf90 FUN_0085bf90 void FUN_0085bf90(void) { lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0085bfd0 FUN_0085bfd0 void FUN_0085bfd0(void) { lua_pushinteger(); return; } //@@ 0085bff0 FUN_0085bff0 void FUN_0085bff0(void) { lua_pushinteger(); return; } //@@ 0085c010 FUN_0085c010 void FUN_0085c010(void) { lua_pushinteger(); return; } //@@ 0085c030 FUN_0085c030 void FUN_0085c030(void) { lua_pushinteger(); return; } //@@ 0085c050 FUN_0085c050 void FUN_0085c050(void) { lua_pushnumber(); return; } //@@ 0085c080 FUN_0085c080 void FUN_0085c080(undefined4 param_1) { byte bVar1; uint uVar2; int iVar3; byte *pbVar4; undefined8 *puVar5; undefined4 *in_ECX; byte *text; undefined4 *_Dst; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b039d8; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined8 *)(in_ECX + 1) = 0; *in_ECX = luabridge::LuaException::vftable; in_ECX[3] = param_1; in_ECX[4] = 0; in_ECX[8] = 0; in_ECX[9] = 0xf; *(undefined1 *)(in_ECX + 4) = 0; local_8 = 1; iVar3 = lua_gettop(param_1,uVar2); if (iVar3 < 1) { uVar2 = in_ECX[9]; if (uVar2 < 0xd) { if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar6 = 0x7fffffff; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar6 = 0xf; if (0xf < uVar2) { uVar6 = uVar2; } } puVar5 = std::_Allocate(uVar6 + 1); in_ECX[8] = 0xd; in_ECX[9] = uVar6; *puVar5 = 0x20676e697373696d; builtin_strncpy((char *)(puVar5 + 1),"erro",4); *(undefined1 *)((int)puVar5 + 0xc) = 0x72; *(undefined1 *)((int)puVar5 + 0xd) = 0; in_ECX[4] = puVar5; } else { _Dst = in_ECX + 4; if (0xf < uVar2) { _Dst = (undefined4 *)in_ECX[4]; } in_ECX[8] = 0xd; memmove(_Dst,"missing error",0xd); *(undefined1 *)((int)_Dst + 0xd) = 0; } } else { pbVar4 = (byte *)lua_tolstring(in_ECX[3],0xffffffff,0); text = &s_empty; if (pbVar4 != (byte *)0x0) { text = pbVar4; } pbVar4 = text; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 4),text,(int)pbVar4 - (int)(text + 1)); } ExceptionList = local_10; return; } //@@ 0085c1d0 FUN_0085c1d0 void FUN_0085c1d0(void) { undefined4 *in_ECX; *in_ECX = luabridge::LuaException::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 4)); *in_ECX = std::exception::vftable; __std_exception_destroy(in_ECX + 1); return; } //@@ 0085c200 FUN_0085c200 int * FUN_0085c200(void) { int *piVar1; int in_ECX; piVar1 = (int *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x24)) { piVar1 = (int *)*piVar1; } return piVar1; } //@@ 0085c210 FUN_0085c210 void FUN_0085c210(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::LuaException::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 4)); *in_ECX = std::exception::vftable; __std_exception_destroy(in_ECX + 1); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x28); } return; } //@@ 0085c250 FUN_0085c250 void FUN_0085c250(void) { undefined4 *in_ECX; lua_settop(*in_ECX,~in_ECX[1]); return; } //@@ 0085c270 FUN_0085c270 void FUN_0085c270(undefined4 param_1) { int in_ECX; lua_rawgeti(param_1,0xfff0b9d8,*(int *)(in_ECX + 4),*(int *)(in_ECX + 4) >> 0x1f); lua_rawgeti(param_1,0xfff0b9d8,*(int *)(in_ECX + 8),*(int *)(in_ECX + 8) >> 0x1f); lua_gettable(param_1,0xfffffffe); lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); return; } //@@ 0085c2d0 FUN_0085c2d0 bool FUN_0085c2d0(void) { int iVar1; undefined4 *in_ECX; FUN_0085c270(*in_ECX); iVar1 = lua_type(*in_ECX,0xffffffff); lua_settop(*in_ECX,0xfffffffe); return iVar1 == 0; } //@@ 0085c300 FUN_0085c300 bool FUN_0085c300(void) { int iVar1; undefined4 *in_ECX; if (in_ECX[1] == -1) { return true; } LuaRef::push(in_ECX,(void *)*in_ECX); iVar1 = lua_type(*in_ECX,0xffffffff); lua_settop(*in_ECX,0xfffffffe); return iVar1 == 0; } //@@ 0085c340 FUN_0085c340 bool FUN_0085c340(void) { int iVar1; undefined4 *in_ECX; if (in_ECX[1] == -1) { return false; } LuaRef::push(in_ECX,(void *)*in_ECX); iVar1 = lua_type(*in_ECX,0xffffffff); lua_settop(*in_ECX,0xfffffffe); return iVar1 == 5; } //@@ 0085c390 FUN_0085c390 undefined1 FUN_0085c390(void) { if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c7f4b4) { _Init_thread_header(&DAT_00c7f4b4); if (DAT_00c7f4b4 == -1) { DAT_00c7f4b0 = 1; _Init_thread_footer(&DAT_00c7f4b4); } } return DAT_00c7f4b0; } //@@ 0085c3e0 FUN_0085c3e0 undefined4 FUN_0085c3e0(void) { int iVar1; undefined4 uVar2; int local_8; lua_absindex(); local_8 = 0; lua_rawgetp(); iVar1 = lua_isuserdata(); if (iVar1 != 0) { lua_getmetatable(); lua_rawgetp(); iVar1 = lua_type(); if (iVar1 == 1) { lua_settop(); iVar1 = lua_rawequal(); if (iVar1 != 0) { lua_settop(); uVar2 = lua_touserdata(); return uVar2; } lua_absindex(); lua_pushstring(); lua_rawget(); iVar1 = lua_rawequal(); if (iVar1 != 0) { lua_settop(); uVar2 = lua_touserdata(); return uVar2; } lua_absindex(); lua_pushstring(); lua_rawget(); lua_rotate(); lua_settop(); local_8 = lua_tolstring(); } else { lua_settop(); } } lua_absindex(); lua_pushstring(); lua_rawget(); lua_tolstring(); if (local_8 == 0) { lua_type(); lua_typename(); } lua_pushfstring(); luaL_argerror(); return 0; } //@@ 0085c590 luabridge::Userdata::getClass /* DB: luabridge type check: strings "%s expected, got %s", "__const", "__parent", "__type", "cannot be const"; walks the metatable __parent chain comparing to the class key, honoring const-ness (param_2); called by every Lua binding argument check (Isaac::FindInRadius, HUD::ShowItemText ...) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl luabridge::Userdata::getClass(void *luaState,int index,void *registryClassKey,byte isCanBeConst) { int iVar1; undefined4 uVar2; void *pvVar3; undefined4 uVar4; int iVar5; iVar5 = 0; lua_rawgetp(luaState,0xfff0b9d8,registryClassKey); iVar1 = lua_isuserdata(luaState,index); if (iVar1 != 0) { lua_getmetatable(luaState,index); lua_rawgetp(luaState,0xffffffff,&DAT_00c7f4b8); iVar1 = lua_type(luaState,0xffffffff); if (iVar1 == 1) { lua_settop(luaState,0xfffffffe); uVar2 = lua_absindex(luaState,0xffffffff); lua_pushstring(luaState,"__const"); lua_rawget(luaState,uVar2); iVar1 = lua_type(luaState,0xffffffff); lua_settop(luaState,0xfffffffe); if (iVar1 == 0) { uVar2 = lua_absindex(luaState,0xfffffffe); lua_pushstring(luaState,"__const"); lua_rawget(luaState,uVar2); lua_copy(luaState,0xffffffff,0xfffffffd); lua_settop(luaState,0xfffffffe); } while( true ) { while (iVar5 = lua_rawequal(luaState,0xffffffff,0xfffffffe), iVar5 != 0) { lua_settop(luaState,0xfffffffd); if ((iVar1 != 0) || (isCanBeConst != 0)) { pvVar3 = (void *)lua_touserdata(luaState,index); return pvVar3; } luaL_argerror(luaState,index,"cannot be const"); } uVar2 = lua_absindex(luaState,0xffffffff); lua_pushstring(luaState,"__parent"); lua_rawget(luaState,uVar2); iVar5 = lua_type(luaState,0xffffffff); if (iVar5 == 0) break; lua_rotate(luaState,0xfffffffe,0xffffffff); lua_settop(luaState,0xfffffffe); } lua_rotate(luaState,0xffffffff,0xffffffff); lua_settop(luaState,0xfffffffe); uVar2 = lua_absindex(luaState,0xffffffff); lua_pushstring(luaState,"__type"); lua_rawget(luaState,uVar2); lua_rotate(luaState,0xfffffffd,1); lua_settop(luaState,0xfffffffe); iVar5 = lua_tolstring(luaState,0xfffffffe,0); } else { lua_settop(luaState,0xfffffffd); } } uVar2 = lua_absindex(luaState,0xffffffff); lua_pushstring(luaState,"__type"); lua_rawget(luaState,uVar2); uVar2 = lua_tolstring(luaState,0xffffffff,0); if (iVar5 == 0) { uVar4 = lua_type(luaState,index); iVar5 = lua_typename(luaState,uVar4); } uVar2 = lua_pushfstring(luaState,"%s expected, got %s",uVar2,iVar5); luaL_argerror(luaState,index,uVar2); return (void *)0x0; } //@@ 0085c7e0 FUN_0085c7e0 void FUN_0085c7e0(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,8); } return; } //@@ 0085c810 FUN_0085c810 undefined4 FUN_0085c810(undefined4 param_1) { int iVar1; undefined4 uVar2; lua_getmetatable(param_1,1); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); iVar1 = lua_type(param_1,0xffffffff); while (iVar1 == 0) { lua_settop(param_1,0xfffffffe); uVar2 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__propget"); lua_rawget(param_1,uVar2); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); iVar1 = lua_iscfunction(param_1,0xffffffff); if (iVar1 != 0) { lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); lua_pushvalue(param_1,1); lua_callk(param_1,1,1,0,0); return 1; } lua_settop(param_1,0xfffffffe); uVar2 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__parent"); lua_rawget(param_1,uVar2); iVar1 = lua_type(param_1,0xffffffff); if (iVar1 != 5) break; lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); iVar1 = lua_type(param_1,0xffffffff); } lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); return 1; } //@@ 0085c970 FUN_0085c970 undefined4 FUN_0085c970(undefined4 param_1) { undefined4 uVar1; int iVar2; lua_getmetatable(param_1,1); uVar1 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__propset"); lua_rawget(param_1,uVar1); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); iVar2 = lua_iscfunction(param_1,0xffffffff); while (iVar2 == 0) { lua_settop(param_1,0xfffffffe); uVar1 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__parent"); lua_rawget(param_1,uVar1); iVar2 = lua_type(param_1,0xffffffff); if (iVar2 == 5) { lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); } else { lua_settop(param_1,0xfffffffd); uVar1 = lua_tolstring(param_1,2,0); luaL_error(param_1,"no writable variable \'%s\'",uVar1); } uVar1 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__propset"); lua_rawget(param_1,uVar1); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); iVar2 = lua_iscfunction(param_1,0xffffffff); } lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); lua_pushvalue(param_1,3); lua_callk(param_1,1,0,0,0); return 0; } //@@ 0085cad0 luabridge::CFunc::readOnlyError /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: lua_CFunction pushed for setter-less properties (00896986.. push 0x85cad0): lua_tostring(upvalue) + "' is read-only" then luaL_error */ undefined4 luabridge::CFunc::readOnlyError(undefined4 param_1) { undefined8 uVar1; int iVar2; int iVar3; int iVar4; undefined4 uVar5; char *this; int *piVar6; byte ****ppppbVar7; byte ****ptr; void *pvVar8; uint uVar9; undefined8 local_64; int iStack_60; void *local_5c [5]; uint local_48; void *local_44; undefined4 local_34; uint local_30; byte ****local_2c; int iStack_28; int iStack_24; int iStack_20; undefined8 local_1c; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; puStack_c = &LAB_00b03a1d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_5c + 0x16); ExceptionList = &local_10; local_1c = 0xf00000000; local_2c = (byte ****)0x0; local_8 = (void *)0x0; uVar5 = lua_tolstring(param_1,0xfff0b9d7,0,local_14); if ((std_string *)(0x7fffffff - (uint)local_1c) == (std_string *)0x0) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar7 = (byte ****)&local_2c; if (0xf < local_1c._4_4_) { ppppbVar7 = local_2c; } std::string::concat((char *)local_5c,iStack_60,(std_string *)(0x7fffffff - (uint)local_1c), (byte *)ppppbVar7,(uint)local_1c,&DAT_00b6ea34,1); local_8._0_1_ = 1; this = (char *)FUN_0060c790(uVar5); local_8 = (void *)CONCAT31(local_8._1_3_,2); piVar6 = std::string::append(this,(byte *)"\' is read-only",0xe); ppppbVar7 = (byte ****)*piVar6; iVar2 = piVar6[1]; iVar3 = piVar6[2]; iVar4 = piVar6[3]; uVar1 = *(undefined8 *)(piVar6 + 4); piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; if (0xf < local_1c._4_4_) { uVar9 = local_1c._4_4_ + 1; ptr = local_2c; if (0xfff < uVar9) { ptr = (byte ****)local_2c[-1]; uVar9 = local_1c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)ptr))) goto LAB_0085cc58; } operator_delete(ptr,uVar9); } local_2c = ppppbVar7; iStack_28 = iVar2; iStack_24 = iVar3; iStack_20 = iVar4; local_1c = uVar1; if (0xf < local_30) { uVar9 = local_30 + 1; pvVar8 = local_44; if (0xfff < uVar9) { pvVar8 = *(void **)((int)local_44 + -4); uVar9 = local_30 + 0x24; if (0x1f < (uint)((int)local_44 + (-4 - (int)pvVar8))) goto LAB_0085cc58; } operator_delete(pvVar8,uVar9); } local_34 = 0; local_30 = 0xf; local_44 = (void *)((uint)local_44 & 0xffffff00); if (0xf < local_48) { uVar9 = local_48 + 1; pvVar8 = local_5c[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)local_5c[0] + -4); uVar9 = local_48 + 0x24; if (0x1f < (uint)((int)local_5c[0] + (-4 - (int)pvVar8))) { LAB_0085cc58: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar9); } ppppbVar7 = (byte ****)&local_2c; if (0xf < local_1c._4_4_) { ppppbVar7 = local_2c; } uVar5 = luaL_error(param_1,ppppbVar7); if (0xf < local_1c._4_4_) { uVar9 = local_1c._4_4_ + 1; ppppbVar7 = local_2c; if (0xfff < uVar9) { ppppbVar7 = (byte ****)local_2c[-1]; uVar9 = local_1c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)ppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar7,uVar9); } ExceptionList = local_10; return uVar5; } //@@ 0085cce0 FUN_0085cce0 void FUN_0085cce0(uint param_1) { int iVar1; undefined4 *in_ECX; undefined1 local_10 [12]; if ((int)param_1 <= (int)in_ECX[1]) { iVar1 = lua_gettop(*in_ECX); if ((int)param_1 <= iVar1) { lua_settop(*in_ECX,~param_1); in_ECX[1] = in_ECX[1] - param_1; return; } } FUN_0085bf50("invalid stack"); /* WARNING: Subroutine does not return */ _CxxThrowException(local_10,(ThrowInfo *)&DAT_00bd5c30); } //@@ 0085cd40 FUN_0085cd40 undefined4 FUN_0085cd40(undefined4 param_1) { int iVar1; undefined4 uVar2; code *pcVar3; char *pcVar4; undefined1 local_10 [12]; lua_getmetatable(param_1,1); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); iVar1 = lua_iscfunction(param_1,0xffffffff); if (iVar1 == 0) { pcVar3 = lua_type_exref; do { iVar1 = (*pcVar3)(param_1,0xffffffff); if (iVar1 != 0) { LAB_0085ceb0: lua_settop(param_1,0xfffffffd); pcVar4 = "not a cfunction"; LAB_0085cf10: FUN_0085bf50(pcVar4); /* WARNING: Subroutine does not return */ _CxxThrowException(local_10,(ThrowInfo *)&DAT_00bd5c30); } lua_settop(param_1,0xfffffffe); uVar2 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__propget"); lua_rawget(param_1,uVar2); iVar1 = lua_type(param_1,0xffffffff); if (iVar1 != 5) { lua_settop(param_1,0xfffffffd); pcVar4 = "missing __propget table"; goto LAB_0085cf10; } lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); iVar1 = lua_iscfunction(param_1,0xffffffff); if (iVar1 != 0) { lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); lua_pushvalue(param_1,1); lua_callk(param_1,1,1,0,0); return 1; } iVar1 = lua_type(param_1); if (iVar1 != 0) goto LAB_0085ceb0; lua_settop(param_1,0xfffffffe); uVar2 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__parent"); lua_rawget(param_1,uVar2); pcVar3 = lua_type_exref; iVar1 = lua_type(param_1,0xffffffff); if (iVar1 != 5) { iVar1 = lua_type(param_1,0xffffffff); if (iVar1 == 0) { return 1; } lua_settop(param_1,0xfffffffd); pcVar4 = "__parent is not a table"; goto LAB_0085cf10; } lua_rotate(param_1,0xfffffffe); lua_settop(param_1,0xfffffffe); lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); iVar1 = lua_iscfunction(param_1,0xffffffff); } while (iVar1 == 0); } lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); return 1; } //@@ 0085cf30 FUN_0085cf30 undefined4 FUN_0085cf30(undefined4 param_1) { undefined4 uVar1; int iVar2; lua_getmetatable(param_1,1); do { uVar1 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__propset"); lua_rawget(param_1,uVar1); iVar2 = lua_type(param_1,0xffffffff); if (iVar2 != 0) { lua_pushvalue(param_1,2); lua_rawget(param_1,0xfffffffe); iVar2 = lua_type(param_1,0xffffffff); if (iVar2 != 0) { lua_pushvalue(param_1,1); lua_pushvalue(param_1,3); lua_callk(param_1,2,0,0,0); return 0; } lua_settop(param_1,0xfffffffe); } lua_settop(param_1,0xfffffffe); uVar1 = lua_absindex(param_1,0xffffffff); lua_pushstring(param_1,"__parent"); lua_rawget(param_1,uVar1); iVar2 = lua_type(param_1,0xffffffff); if (iVar2 == 0) { uVar1 = lua_tolstring(param_1,2,0); luaL_error(param_1,"no member named \'%s\'",uVar1); } lua_rotate(param_1,0xfffffffe,0xffffffff); lua_settop(param_1,0xfffffffe); } while( true ); } //@@ 0085d040 luabridge::Namespace::ClassBase::createConstTable /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0085d144) */ /* WARNING: Removing unreachable block (ram,0x0085d152) */ /* WARNING: Removing unreachable block (ram,0x0085d168) */ /* DB: LuaBridge Namespace.h: strings "const " + name, "__type", "__index", "__newindex", "__metatable", "__propget"; called first by every luabridge::Namespace::Class::Class (66 callers, e.g. Class 008a0740) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall luabridge::Namespace::ClassBase::createConstTable(void *this,byte *name) { undefined4 uVar1; char cVar2; undefined4 *puVar3; undefined4 uVar4; void *ptr; uint size; void *local_48; uint local_34; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af556d; local_10 = ExceptionList; ExceptionList = &local_10; lua_createtable(*(undefined4 *)this,0,0,__security_cookie ^ (int)register0x00000010 - 4U); lua_pushvalue(*(undefined4 *)this,0xffffffff); lua_setmetatable(*(undefined4 *)this,0xfffffffe); lua_pushboolean(*(undefined4 *)this,1); lua_rawsetp(*(undefined4 *)this,0xfffffffe,&DAT_00c7f4b8); local_8 = 0; puVar3 = (undefined4 *)FUN_0060c790(name); if (0xf < (uint)puVar3[5]) { puVar3 = (undefined4 *)*puVar3; } lua_pushstring(*(undefined4 *)this,puVar3); if (0xf < local_34) { size = local_34 + 1; ptr = local_48; if (0xfff < size) { ptr = *(void **)((int)local_48 + -4); size = local_34 + 0x24; if (0x1f < (uint)((int)local_48 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } uVar1 = *(undefined4 *)this; uVar4 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__type"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar4); lua_pushcclosure(*(undefined4 *)this,FUN_0085cd40,0); uVar1 = *(undefined4 *)this; uVar4 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__index"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar4); lua_pushcclosure(*(undefined4 *)this,FUN_0085cf30,0); uVar1 = *(undefined4 *)this; uVar4 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__newindex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar4); lua_createtable(*(undefined4 *)this,0,0); uVar1 = *(undefined4 *)this; uVar4 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar4); cVar2 = FUN_0085c390(); if (cVar2 != '\0') { lua_pushnil(*(undefined4 *)this); uVar1 = *(undefined4 *)this; uVar4 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__metatable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar4); } ExceptionList = local_10; return; } //@@ 0085d2c0 luabridge::Namespace::ClassBase::createClassTable /* DB: LuaBridge Namespace.h: strings "__class", "__const", "__index", "__newindex", "__metatable", "__propget", "__propset", "__type"; called by every luabridge::Namespace::Class::Class right after createConstTable prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall luabridge::Namespace::ClassBase::createClassTable(void *this,byte *name) { undefined4 uVar1; char cVar2; undefined4 uVar3; lua_createtable(*(undefined4 *)this,0,0); lua_pushvalue(*(undefined4 *)this,0xffffffff); lua_setmetatable(*(undefined4 *)this,0xfffffffe); lua_pushboolean(*(undefined4 *)this,1); lua_rawsetp(*(undefined4 *)this,0xfffffffe,&DAT_00c7f4b8); lua_pushstring(*(undefined4 *)this,name); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__type"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushcclosure(*(undefined4 *)this,FUN_0085cd40,0); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__index"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushcclosure(*(undefined4 *)this,FUN_0085cf30,0); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__newindex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_createtable(*(undefined4 *)this,0,0); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_createtable(*(undefined4 *)this,0,0); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*(undefined4 *)this,0xfffffffe); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__const"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*(undefined4 *)this,0xffffffff); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"__class"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); cVar2 = FUN_0085c390(); if (cVar2 != '\0') { lua_pushnil(*(undefined4 *)this); uVar1 = *(undefined4 *)this; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__metatable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); } return; } //@@ 0085d500 FUN_0085d500 void FUN_0085d500(undefined4 param_1) { undefined4 uVar1; char cVar2; undefined4 uVar3; undefined4 *in_ECX; lua_createtable(*in_ECX,0,0); lua_createtable(*in_ECX,0,0); lua_pushvalue(*in_ECX,0xffffffff); lua_setmetatable(*in_ECX,0xfffffffd); lua_rotate(*in_ECX,0xfffffffe,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushcclosure(*in_ECX,FUN_0085c810,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__index"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushcclosure(*in_ECX,FUN_0085c970,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__newindex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_createtable(*in_ECX,0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_createtable(*in_ECX,0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xfffffffe); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__class"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); cVar2 = FUN_0085c390(); if (cVar2 != '\0') { lua_pushnil(*in_ECX); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__metatable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); } return; } //@@ 0085d6f0 FUN_0085d6f0 void FUN_0085d6f0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; FUN_0085cce0(*(undefined4 *)(in_ECX + 4)); ExceptionList = local_10; return; } //@@ 0085d730 FUN_0085d730 undefined4 * FUN_0085d730(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; int iVar3; undefined4 *in_ECX; *in_ECX = *param_2; in_ECX[1] = 0; in_ECX[1] = param_2[1] + 1; param_2[1] = 0; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,param_1); lua_rawget(uVar1,uVar2); iVar3 = lua_type(*in_ECX,0xffffffff); if (iVar3 == 0) { lua_settop(*in_ECX,0xfffffffe); lua_createtable(*in_ECX,0,0); lua_pushvalue(*in_ECX,0xffffffff); lua_setmetatable(*in_ECX,0xfffffffe); lua_pushcclosure(*in_ECX,FUN_0085c810,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__index"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0085c970,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__newindex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_createtable(*in_ECX,0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_createtable(*in_ECX,0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } return in_ECX; } //@@ 0085d910 FUN_0085d910 void FUN_0085d910(undefined4 *param_1) { int iVar1; undefined4 *in_ECX; undefined1 local_10 [12]; *in_ECX = *param_1; in_ECX[1] = 0; in_ECX[1] = param_1[1] + -3; param_1[1] = 3; iVar1 = lua_gettop(*param_1); if (iVar1 < 3) { FUN_0085bf50("invalid stack"); /* WARNING: Subroutine does not return */ _CxxThrowException(local_10,(ThrowInfo *)&DAT_00bd5c30); } lua_settop(*param_1,0xfffffffc); param_1[1] = param_1[1] + -3; return; } //@@ 0085d980 luabridge::Namespace::~Namespace /* DB: pops m_stackSize (ECX+4) from lua_State (ECX+0) via lua_settop, throws logic_error "invalid stack" if lua_gettop < count; 74 callers in LuaEngine::RegisterAPI and its register sub-functions (end of each beginNamespace/beginClass chain); identical code to ClassBase::~ClassBase (ICF) prototype: db/protos.zhl */ void __thiscall luabridge::Namespace::~Namespace(void *this) { uint uVar1; int iVar2; undefined1 local_1c [12]; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b03a50; local_10 = ExceptionList; ExceptionList = &local_10; uVar1 = *(uint *)((int)this + 4); iVar2 = lua_gettop(*(undefined4 *)this,__security_cookie ^ (uint)(local_1c + 0x18)); if (iVar2 < (int)uVar1) { FUN_0085bf50("invalid stack"); /* WARNING: Subroutine does not return */ _CxxThrowException(local_1c,(ThrowInfo *)&DAT_00bd5c30); } lua_settop(*(undefined4 *)this,~uVar1); *(int *)((int)this + 4) = *(int *)((int)this + 4) - uVar1; ExceptionList = local_10; return; } //@@ 0085da00 FUN_0085da00 undefined4 FUN_0085da00(undefined4 param_1,undefined4 param_2) { undefined4 in_ECX; FUN_0085d730(param_2,in_ECX); return param_1; } //@@ 0085da20 FUN_0085da20 void FUN_0085da20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,param_2,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return; } //@@ 0085da70 FUN_0085da70 void FUN_0085da70(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = std::logic_error::vftable; return; } //@@ 0085dab0 FUN_0085dab0 void FUN_0085dab0(void) { undefined4 *in_ECX; undefined4 in_EDX; *in_ECX = in_EDX; in_ECX[1] = 0; lua_getglobal(); in_ECX[1] = in_ECX[1] + 1; return; } //@@ 0085dae0 FUN_0085dae0 void FUN_0085dae0(uint *param_1) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint *in_ECX; uint *in_EDX; uVar1 = *in_EDX; uVar2 = *param_1; uVar3 = in_EDX[2]; uVar4 = param_1[2]; in_ECX[1] = in_EDX[1] ^ param_1[1]; uVar5 = in_EDX[3]; uVar6 = param_1[3]; *in_ECX = uVar1 ^ uVar2; in_ECX[3] = uVar5 ^ uVar6; in_ECX[2] = uVar3 ^ uVar4; return; } //@@ 0085db20 Sprite::GetAnimation /* ZHL [lua] Lua binding Sprite:GetAnimation */ char * __thiscall Sprite::GetAnimation(Sprite *this,char *param_2) { void *other; other = (this->_animState)._animData; if (other == (void *)0x0) { param_2[0] = '\0'; param_2[1] = '\0'; param_2[2] = '\0'; param_2[3] = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; param_2[0x14] = '\x0f'; param_2[0x15] = '\0'; param_2[0x16] = '\0'; param_2[0x17] = '\0'; *param_2 = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; *param_2 = '\0'; return param_2; } std::string::string(param_2,other); return param_2; } //@@ 0085db70 Sprite::GetOverlayAnimation /* ZHL [lua] Lua binding Sprite:GetOverlayAnimation */ char * __thiscall Sprite::GetOverlayAnimation(Sprite *this,char *param_2) { void *other; other = (this->_overlayAnimState)._animData; if (other == (void *)0x0) { param_2[0] = '\0'; param_2[1] = '\0'; param_2[2] = '\0'; param_2[3] = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; param_2[0x14] = '\x0f'; param_2[0x15] = '\0'; param_2[0x16] = '\0'; param_2[0x17] = '\0'; *param_2 = '\0'; param_2[0x10] = '\0'; param_2[0x11] = '\0'; param_2[0x12] = '\0'; param_2[0x13] = '\0'; *param_2 = '\0'; return param_2; } std::string::string(param_2,other); return param_2; } //@@ 0085dbc0 Item::Costume /* ZHL [lua] Lua binding Item:Costume */ int Item::Costume(void) { int in_ECX; return in_ECX + 0x80; } //@@ 0085dbd0 Config::ShouldAddCostumeOnPickup /* ZHL [lua] Lua binding Config:ShouldAddCostumeOnPickup */ undefined4 Config::ShouldAddCostumeOnPickup(int param_1) { if ((param_1 == 0) || (*(char *)(param_1 + 0xb2) == '\0')) { return 0; } return 1; } //@@ 0085dbf0 FUN_0085dbf0 void FUN_0085dbf0(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x20) | 2; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x20) & 0xfffffffd; } *(uint *)(in_ECX + 0x20) = uVar1; return; } //@@ 0085dc10 FUN_0085dc10 void FUN_0085dc10(char param_1) { int in_ECX; uint uVar1; uVar1 = *(uint *)(in_ECX + 0x20) | 1; if (param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 0x20) & 0xfffffffe; } *(uint *)(in_ECX + 0x20) = uVar1; return; } //@@ 0085dc30 Entity::Kill /* ZHL [lua] Lua binding Entity:Kill */ void __thiscall Entity::Kill(Entity *this) { undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; float local_1c; float local_18; float local_14; float local_10; undefined4 local_c; undefined4 local_8; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = 0; local_1c = g_vectorZero.x; local_18 = g_vectorZero.y; local_14 = g_vectorZero.x; local_10 = g_vectorZero.y; local_c = 0; local_8 = 0; (**(code **)(*(int *)this + 0x24))(&local_2c); return; } //@@ 0085dca0 Entity::FlipX /* ZHL [lua] Lua binding Entity:FlipX */ byte __thiscall Entity::FlipX(Entity *this) { return (this->_sprite)._flipX; } //@@ 0085dcb0 Entity::SetSpriteFrame /* ZHL [lua] Lua binding Entity:SetSpriteFrame */ void __thiscall Entity::SetSpriteFrame(Entity *this,byte *param_2,int param_3) { byte bVar1; if (0xf < *(uint *)(param_2 + 0x14)) { param_2 = *(byte **)param_2; } bVar1 = ANM2::SetAnimation(&this->_sprite,param_2,1); if ((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)param_3); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } return; } //@@ 0085dd00 Entity::SetSpriteOverlayFrame /* ZHL [lua] Lua binding Entity:SetSpriteOverlayFrame */ void __thiscall Entity::SetSpriteOverlayFrame(Entity *this,byte *param_2,int param_3) { byte bVar1; if (0xf < *(uint *)(param_2 + 0x14)) { param_2 = *(byte **)param_2; } bVar1 = ANM2::SetOverlayAnimation(&this->_sprite,param_2,1); if ((bVar1 != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)param_3); } return; } //@@ 0085dd40 Entity::SizeMulti /* ZHL [lua] Lua binding Entity:SizeMulti */ void __thiscall Entity::SizeMulti(Entity *this,float *param_2) { float fVar1; fVar1 = (this->_sizeMulti).y; *param_2 = (this->_sizeMulti).x; param_2[1] = fVar1; return; } //@@ 0085dd60 Entity_Tear::BaseDamage /* ZHL [lua] Lua binding EntityTear:BaseDamage */ float10 __thiscall Entity_Tear::BaseDamage(Entity_Tear *this) { return (float10)this->_baseDamage; } //@@ 0085dd70 Entity_Tear::SetParentOffset /* ZHL [lua] Lua binding EntityTear:SetParentOffset */ void __thiscall Entity_Tear::SetParentOffset(Entity_Tear *this,float *param_2) { (this->_parentOffset).x = *param_2; (this->_parentOffset).y = param_2[1]; return; } //@@ 0085dd90 Entity_Tear::PosDisplacement /* ZHL [lua] Lua binding EntityTear:PosDisplacement */ Vector * __thiscall Entity_Tear::PosDisplacement(Entity_Tear *this) { return &this->_posDisplacement; } //@@ 0085dda0 GridEntity::GetRNG /* ZHL [lua] Lua binding GridEntity:GetRNG */ RNG * __thiscall GridEntity::GetRNG(GridEntity *this) { return &this->_rng; } //@@ 0085ddb0 GridEntity::Hurt /* ZHL [lua] Lua binding GridEntity:Hurt */ void GridEntity::Hurt(undefined4 param_1) { int *in_ECX; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; (**(code **)(*in_ECX + 0x10))(param_1,&local_30); return; } //@@ 0085de20 GridEntity::Destroy /* ZHL [lua] Lua binding GridEntity:Destroy */ void GridEntity::Destroy(undefined4 param_1) { int *in_ECX; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_18; float local_14; undefined4 local_10; undefined4 local_c; local_30 = 0; local_2c = 0; local_28 = 0; local_24 = 0; local_20 = g_vectorZero.x; local_1c = g_vectorZero.y; local_18 = g_vectorZero.x; local_14 = g_vectorZero.y; local_10 = 0; local_c = 0; (**(code **)(*in_ECX + 0x14))(param_1,&local_30); return; } //@@ 0085de90 Entity_Knife::TearFlags /* ZHL [lua] Lua binding EntityKnife:TearFlags */ void __thiscall Entity_Knife::TearFlags(Entity_Knife *this,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; qword qVar3; uVar1 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); qVar3 = (this->_tearFlags)._h; uVar2 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); *param_2 = (int)(this->_tearFlags)._l; param_2[1] = uVar1; param_2[2] = (int)qVar3; param_2[3] = uVar2; return; } //@@ 0085deb0 Entity_Knife::GetKnifeDistance /* ZHL [lua] Lua binding EntityKnife:GetKnifeDistance */ float10 __thiscall Entity_Knife::GetKnifeDistance(Entity_Knife *this) { return (float10)this->_knifeDistance; } //@@ 0085dec0 Entity_Knife::RotationOffset /* ZHL [lua] Lua binding EntityKnife:RotationOffset */ float10 __thiscall Entity_Knife::RotationOffset(Entity_Knife *this) { return (float10)this->_rotationOffset; } //@@ 0085ded0 FUN_0085ded0 undefined4 * FUN_0085ded0(undefined4 *param_1) { undefined8 *puVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; uint uVar6; void *pvVar7; undefined4 *puVar8; undefined4 *in_ECX; uint uVar9; undefined4 *puVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03a96; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_1; uVar2 = param_1[2]; in_ECX[1] = param_1[1]; in_ECX[2] = uVar2; uVar2 = param_1[4]; in_ECX[3] = param_1[3]; in_ECX[4] = uVar2; in_ECX[5] = param_1[5]; in_ECX[6] = param_1[6]; FUN_0042f1a0(param_1 + 7); local_8 = 0; FUN_0042f1a0(param_1 + 10); local_8._0_1_ = 1; FUN_0042f1a0(param_1 + 0xd); local_8 = CONCAT31(local_8._1_3_,2); in_ECX[0x10] = param_1[0x10]; in_ECX[0x11] = param_1[0x11]; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; puVar3 = (undefined4 *)param_1[0x13]; puVar10 = (undefined4 *)param_1[0x12]; if (puVar10 != puVar3) { uVar9 = ((int)puVar3 - (int)puVar10) / 0x18; if (0xaaaaaaa < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar6); } uVar9 = uVar9 * 0x18; pvVar7 = std::_Allocate(uVar9); in_ECX[0x12] = pvVar7; in_ECX[0x13] = pvVar7; in_ECX[0x14] = (void *)((int)pvVar7 + uVar9); puVar8 = (undefined4 *)in_ECX[0x12]; do { uVar2 = puVar10[1]; uVar4 = puVar10[2]; uVar5 = puVar10[3]; *puVar8 = *puVar10; puVar8[1] = uVar2; puVar8[2] = uVar4; puVar8[3] = uVar5; puVar1 = (undefined8 *)(puVar10 + 4); puVar10 = puVar10 + 6; *(undefined8 *)(puVar8 + 4) = *puVar1; puVar8 = puVar8 + 6; } while (puVar10 != puVar3); in_ECX[0x13] = puVar8; } ExceptionList = local_10; return in_ECX; } //@@ 0085e000 HomingLaser::operator_assign /* DB: copy-assign: 7 dwords, three vectors (+0x1c/+0x28/+0x34 via 008c2a70), 2 dwords, a vector at +0x48 (008c2910); Entity_Knife::UpdateHomingPath copies knife+0x468 (_homingLaser, db/fields.tsv) with it, also Entity_Knife::Update and 008c0140 (Lua getter copy) prototype: db/protos.zhl, confirmed by RET 4 */ HomingLaser * __thiscall HomingLaser::operator_assign(HomingLaser *this,HomingLaser *other) { *(undefined4 *)this = *(undefined4 *)other; *(undefined4 *)&this->field_0x4 = *(undefined4 *)&other->field_0x4; *(undefined4 *)&this->field_0x8 = *(undefined4 *)&other->field_0x8; *(undefined4 *)&this->field_0xc = *(undefined4 *)&other->field_0xc; *(undefined4 *)&this->field_0x10 = *(undefined4 *)&other->field_0x10; *(undefined4 *)&this->field_0x14 = *(undefined4 *)&other->field_0x14; *(undefined4 *)&this->field_0x18 = *(undefined4 *)&other->field_0x18; if (&this->_samples != &other->_samples) { std::vector::assign((other->_samples)._begin,(other->_samples)._end,other); } if (&this->_nonOptimizedSamples != &other->_nonOptimizedSamples) { std::vector::assign ((other->_nonOptimizedSamples)._begin,(other->_nonOptimizedSamples)._end,other); } if (&this->field_0x34 != &other->field_0x34) { std::vector::assign (*(undefined4 *)&other->field_0x34,*(undefined4 *)&other->field_0x38,other); } *(undefined4 *)&this->field_0x40 = *(undefined4 *)&other->field_0x40; this->_totalLength = other->_totalLength; if (&this->_bezier != &other->_bezier) { FUN_008c2910((other->_bezier)._begin,(other->_bezier)._end,other); } return this; } //@@ 0085e0b0 GridEntity_Door::GetSpriteOffset /* ZHL [lua] Lua binding GridEntityDoor:GetSpriteOffset */ Vector * __thiscall GridEntity_Door::GetSpriteOffset(GridEntity_Door *this) { return &(this->_sprite)._offset; } //@@ 0085e0c0 EntityList::Get /* ZHL [lua] Lua binding EntityList:Get */ undefined4 EntityList::Get(uint param_1) { uint uVar1; int in_ECX; uVar1 = *(int *)(in_ECX + 0xc) - 1; param_1 = -(uint)(param_1 != 0) & param_1; if (param_1 < uVar1) { uVar1 = param_1; } return *(undefined4 *)(*(int *)(in_ECX + 4) + uVar1 * 4); } //@@ 0085e0f0 Room::KeepDoorsClosed /* ZHL [lua] Lua binding Room:KeepDoorsClosed */ void __thiscall Room::KeepDoorsClosed(Room *this) { this->_roomClearDelay = 10; return; } //@@ 0085e100 Room::GetAwardSeed /* ZHL [lua] Lua binding Room:GetAwardSeed */ undefined4 Room::GetAwardSeed(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return 0; } return *(undefined4 *)(*(int *)(in_ECX + 4) + 0x60); } //@@ 0085e110 Room::GetShopLevel /* ZHL [lua] Lua binding Room:GetShopLevel */ int __thiscall Room::GetShopLevel(Room *this) { return this->_shopLevel; } //@@ 0085e120 Room::GetRenderMode /* ZHL [lua] Lua binding Room:GetRenderMode */ int __thiscall Room::GetRenderMode(Room *this) { return (this->_entityList)._renderMode; } //@@ 0085e130 Room::GetEnemyDamageInflicted /* ZHL [lua] Lua binding Room:GetEnemyDamageInflicted */ float10 Room::GetEnemyDamageInflicted(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x12d4); } //@@ 0085e140 Level::DungeonReturnPosition /* ZHL [lua] Lua binding Level:DungeonReturnPosition */ void __thiscall Level::DungeonReturnPosition(Level *this,float *param_2) { float fVar1; fVar1 = (this->_dungeonReturnPosition).y; *param_2 = (this->_dungeonReturnPosition).x; param_2[1] = fVar1; return; } //@@ 0085e160 Level::HasBossChallenge /* ZHL [lua] Lua binding Level:HasBossChallenge */ undefined1 Level::HasBossChallenge(void) { int in_ECX; return *(undefined1 *)(in_ECX + 8); } //@@ 0085e170 Level::GetCanSeeEverything /* ZHL [lua] Lua binding Level:GetCanSeeEverything */ byte __thiscall Level::GetCanSeeEverything(Level *this) { return this->_isCanSeeEverything; } //@@ 0085e180 Seeds::ClearStartSeed /* ZHL [lua] Lua binding Seeds:ClearStartSeed */ void Seeds::ClearStartSeed(void) { int in_ECX; *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 0085e190 Seeds::RemoveSeedEffect /* ZHL [lua] Lua binding Seeds:RemoveSeedEffect */ void __thiscall Seeds::RemoveSeedEffect(Seeds *this,int param_2) { std_set_int_erase_key(&this->_seedEffects,¶m_2); return; } //@@ 0085e1b0 Seeds::CountSeedEffects /* ZHL [lua] Lua binding Seeds:CountSeedEffects */ int __thiscall Seeds::CountSeedEffects(Seeds *this) { return this->_seedEffectsCount; } //@@ 0085e1c0 HUD::IsVisible /* ZHL [lua] Lua binding HUD:IsVisible */ byte __thiscall HUD::IsVisible(HUD *this) { return this->_isVisible; } //@@ 0085e1d0 FUN_0085e1d0 void FUN_0085e1d0(char param_1) { int in_ECX; byte bVar1; bVar1 = *(byte *)(in_ECX + 8) | 1; if (param_1 == '\0') { bVar1 = *(byte *)(in_ECX + 8) & 0xfe; } *(byte *)(in_ECX + 8) = bVar1; return; } //@@ 0085e200 Entity_Player::HasFullHeartsAndSoulHearts /* ZHL [lua] Lua binding EntityPlayer:HasFullHeartsAndSoulHearts */ undefined4 __thiscall Entity_Player::HasFullHeartsAndSoulHearts(Entity_Player *this) { int iVar1; iVar1 = this->_soulHearts + this->_redHearts; return CONCAT31((int3)((uint)iVar1 >> 8),this->_maxHearts <= iVar1); } //@@ 0085e220 Entity_Player::GetMovementVector /* ZHL [lua] Lua binding EntityPlayer:GetMovementVector */ Vector * __thiscall Entity_Player::GetMovementVector(Entity_Player *this) { return &this->_movementVector; } //@@ 0085e230 Entity_Player::GetRecentMovementVector /* ZHL [lua] Lua binding EntityPlayer:GetRecentMovementVector */ Vector * __thiscall Entity_Player::GetRecentMovementVector(Entity_Player *this) { return &this->_recentMovementVector; } //@@ 0085e240 Entity_Player::GetTearRangeModifier /* ZHL [lua] Lua binding EntityPlayer:GetTearRangeModifier */ int __thiscall Entity_Player::GetTearRangeModifier(Entity_Player *this) { return this->_tearRangeModifier; } //@@ 0085e250 Entity_Player::ControlsCooldown /* ZHL [lua] Lua binding EntityPlayer:ControlsCooldown */ int __thiscall Entity_Player::ControlsCooldown(Entity_Player *this) { return this->_controlsCooldown; } //@@ 0085e260 Entity_Player::AddControlsCooldown /* ZHL [lua] Lua binding EntityPlayer:AddControlsCooldown */ void __thiscall Entity_Player::AddControlsCooldown(Entity_Player *this,int param_2) { this->_controlsCooldown = this->_controlsCooldown + param_2; return; } //@@ 0085e270 Entity_Player::GetLastDamageSource /* ZHL [lua] Lua binding EntityPlayer:GetLastDamageSource */ EntityRef * __thiscall Entity_Player::GetLastDamageSource(Entity_Player *this) { return &this->_lastDamageSource; } //@@ 0085e280 Entity_Player::GetLastDamageFlags /* ZHL [lua] Lua binding EntityPlayer:GetLastDamageFlags */ qword __thiscall Entity_Player::GetLastDamageFlags(Entity_Player *this) { return this->_lastDamageFlags; } //@@ 0085e290 Entity_Player::GetTotalDamageTaken /* ZHL [lua] Lua binding EntityPlayer:GetTotalDamageTaken */ int __thiscall Entity_Player::GetTotalDamageTaken(Entity_Player *this) { return this->_totalDamageTaken; } //@@ 0085e2a0 FUN_0085e2a0 void FUN_0085e2a0(undefined4 *param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x14f0) = *param_1; *(undefined4 *)(in_ECX + 0x14f4) = param_1[1]; return; } //@@ 0085e2c0 Entity_Player::GetLastActionTriggers /* ZHL [lua] Lua binding EntityPlayer:GetLastActionTriggers */ int __thiscall Entity_Player::GetLastActionTriggers(Entity_Player *this) { return this->_lastActionTriggers; } //@@ 0085e2d0 Entity_Player::GetBodyColor /* ZHL [lua] Lua binding EntityPlayer:GetBodyColor */ int __thiscall Entity_Player::GetBodyColor(Entity_Player *this) { return this->_bodyColor; } //@@ 0085e2e0 Entity_Player::GetHeadColor /* ZHL [lua] Lua binding EntityPlayer:GetHeadColor */ int __thiscall Entity_Player::GetHeadColor(Entity_Player *this) { return this->_headColor; } //@@ 0085e2f0 Entity_Player::GetNumGigaBombs /* ZHL [lua] Lua binding EntityPlayer:GetNumGigaBombs */ int __thiscall Entity_Player::GetNumGigaBombs(Entity_Player *this) { return this->_numGigaBombs; } //@@ 0085e300 Entity_Projectile::Acceleration /* ZHL [lua] Lua binding EntityProjectile:Acceleration */ float10 __thiscall Entity_Projectile::Acceleration(Entity_Projectile *this) { return (float10)this->_acceleration; } //@@ 0085e310 Entity_Projectile::ChangeFlags /* ZHL [lua] Lua binding EntityProjectile:ChangeFlags */ qword __thiscall Entity_Projectile::ChangeFlags(Entity_Projectile *this) { return this->_changeFlags; } //@@ 0085e320 Entity_Projectile::AddScale /* ZHL [lua] Lua binding EntityProjectile:AddScale */ void __thiscall Entity_Projectile::AddScale(Entity_Projectile *this,float param_2) { this->_scale = param_2 + this->_scale; return; } //@@ 0085e340 FUN_0085e340 void FUN_0085e340(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x41c) = param_1; return; } //@@ 0085e360 Entity_Projectile::Damage /* ZHL [lua] Lua binding EntityProjectile:Damage */ float10 __thiscall Entity_Projectile::Damage(Entity_Projectile *this) { return (float10)this->_damage; } //@@ 0085e370 Game::GetNumEncounteredBosses /* ZHL [lua] Lua binding Game:GetNumEncounteredBosses */ int __thiscall Game::GetNumEncounteredBosses(Game *this) { return *(int *)(this->_encounteredBosses + 4) - *(int *)this->_encounteredBosses >> 3; } //@@ 0085e380 Game::GetScreenShakeCountdown /* ZHL [lua] Lua binding Game:GetScreenShakeCountdown */ int * __thiscall Game::GetScreenShakeCountdown(Game *this) { return &this->_screenShakeTimer; } //@@ 0085e390 Game::UpdateStrangeAttractor /* ZHL [lua] Lua binding Game:UpdateStrangeAttractor */ void Game::UpdateStrangeAttractor(Vector *param_1,float param_2,float param_3) { Game *in_ECX; AttractEntities(in_ECX,param_1,(void *)0x0,(void *)0x0,param_2,param_3); return; } //@@ 0085e3b0 FUN_0085e3b0 void FUN_0085e3b0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x26504) = param_1; return; } //@@ 0085e3c0 Game::AddStageWithoutHeartsPicked /* ZHL [lua] Lua binding Game:AddStageWithoutHeartsPicked */ void __thiscall Game::AddStageWithoutHeartsPicked(Game *this) { this->_stagesWithoutHeartsPicked = this->_stagesWithoutHeartsPicked + 1; return; } //@@ 0085e3d0 Game::ClearStagesWithoutHeartsPicked /* ZHL [lua] Lua binding Game:ClearStagesWithoutHeartsPicked */ void __thiscall Game::ClearStagesWithoutHeartsPicked(Game *this) { this->_stagesWithoutHeartsPicked = 0; return; } //@@ 0085e3e0 Game::GetStagesWithoutHeartsPicked /* ZHL [lua] Lua binding Game:GetStagesWithoutHeartsPicked */ int __thiscall Game::GetStagesWithoutHeartsPicked(Game *this) { return this->_stagesWithoutHeartsPicked; } //@@ 0085e3f0 Game::AddStageWithoutDamage /* ZHL [lua] Lua binding Game:AddStageWithoutDamage */ void __thiscall Game::AddStageWithoutDamage(Game *this) { this->_stagesWithoutDamage = this->_stagesWithoutDamage + 1; return; } //@@ 0085e400 Game::ClearStagesWithoutDamage /* ZHL [lua] Lua binding Game:ClearStagesWithoutDamage */ void __thiscall Game::ClearStagesWithoutDamage(Game *this) { this->_stagesWithoutDamage = 0; return; } //@@ 0085e410 MusicManager::Enable /* ZHL [lua] Lua binding MusicManager:Enable */ void __thiscall MusicManager::Enable(MusicManager *this) { this->_isEnabled = 1; return; } //@@ 0085e420 MusicManager::Disable /* ZHL [lua] Lua binding MusicManager:Disable */ void __thiscall MusicManager::Disable(MusicManager *this) { this->_isEnabled = 0; return; } //@@ 0085e430 MusicManager::IsEnabled /* ZHL [lua] Lua binding MusicManager:IsEnabled */ byte __thiscall MusicManager::IsEnabled(MusicManager *this) { return this->_isEnabled; } //@@ 0085e440 Entity_Pickup::Wait /* ZHL [lua] Lua binding EntityPickup:Wait */ int __thiscall Entity_Pickup::Wait(Entity_Pickup *this) { return this->_wait; } //@@ 0085e450 Font::EnableAutoWrap /* DB: Lua Font table */ void __thiscall Font::EnableAutoWrap(Font *this,undefined2 param_2) { this->_stretchH = 1; this->_aa = 0; this->_paddingUp = 0; this->_infoBitField = (undefined1)param_2; this->_charSet = param_2._1_1_; this->_paddingRight = 0; this->_paddingDown = 0; this->_paddingLeft = 0x80; this->_spacingHoriz = 0x3f; return; } //@@ 0085e470 Font::Load /* DB: Lua Font table */ void Font::Load(byte *param_1) { Font *in_ECX; Load(in_ECX,param_1,0); return; } //@@ 0085e490 BitSet128::__tostring /* ZHL [lua] Lua binding BitSet128:__tostring */ undefined * BitSet128::__tostring(void) { sprintf_s(&DAT_00c82778,0x100,(byte *)"BitSet128: %016llx%016llx"); return &DAT_00c82778; } //@@ 0085e4d0 BitSet128::__band /* ZHL [lua] Lua binding BitSet128:__band */ undefined4 BitSet128::__band(BitSet128 *param_1,BitSet128 *param_2) { BitSet128 *in_ECX; undefined4 extraout_ECX; operator_and(param_1,in_ECX,param_2); return extraout_ECX; } //@@ 0085e4f0 BitSet128::__bor /* ZHL [lua] Lua binding BitSet128:__bor */ undefined4 BitSet128::__bor(BitSet128 *param_1,BitSet128 *param_2) { BitSet128 *in_ECX; undefined4 extraout_ECX; operator_or(param_1,in_ECX,param_2); return extraout_ECX; } //@@ 0085e510 BitSet128::__bxor /* ZHL [lua] Lua binding BitSet128:__bxor */ undefined4 BitSet128::__bxor(undefined4 param_1,undefined4 param_2) { undefined4 extraout_ECX; FUN_0085dae0(param_2); return extraout_ECX; } //@@ 0085e530 BitSet128::__eq /* ZHL [lua] Lua binding BitSet128:__eq */ uint BitSet128::__eq(uint *param_1) { uint uVar1; uint *in_ECX; uVar1 = *in_ECX; if ((((uVar1 == *param_1) && (uVar1 = in_ECX[1], uVar1 == param_1[1])) && (uVar1 = in_ECX[2], uVar1 == param_1[2])) && (uVar1 = in_ECX[3], uVar1 == param_1[3])) { return CONCAT31((int3)(uVar1 >> 8),1); } return uVar1 & 0xffffff00; } //@@ 0085e560 BitSet128::Get /* ZHL [lua] Lua binding BitSet128:Get */ int BitSet128::Get(uint param_1) { uint uVar1; uint3 uVar2; uint *in_ECX; uint uVar3; bool bVar4; if ((int)param_1 < 0x40) { uVar3 = 1 << (param_1 & 0x1f); uVar1 = 0; if (0x1f < param_1) { uVar1 = uVar3; } uVar3 = uVar3 ^ uVar1; if (0x3f < param_1) { uVar1 = uVar3; } param_1 = uVar1 & in_ECX[1]; bVar4 = (uVar3 & *in_ECX) == 0 && param_1 == 0; } else { param_1 = param_1 - 0x40; uVar3 = 1 << (param_1 & 0x1f); uVar1 = 0; if (0x1f < param_1) { uVar1 = uVar3; } uVar3 = uVar3 ^ uVar1; if (0x3f < param_1) { uVar1 = uVar3; } bVar4 = (uVar3 & in_ECX[2]) == 0 && (uVar1 & in_ECX[3]) == 0; } uVar2 = (uint3)(param_1 >> 8); if (bVar4) { return (uint)uVar2 << 8; } return CONCAT31(uVar2,1); } //@@ 0085e5c0 BitSet128::Set /* ZHL [lua] Lua binding BitSet128:Set */ void BitSet128::Set(uint param_1,char param_2) { uint *in_ECX; uint uVar1; uint uVar2; if (param_2 != '\0') { FUN_0060cc30(param_1); return; } if (0x3f < param_1) { param_1 = param_1 - 0x40; uVar1 = 1 << (param_1 & 0x1f); uVar2 = 0; if (0x1f < param_1) { uVar2 = uVar1; } uVar1 = uVar1 ^ uVar2; if (0x3f < param_1) { uVar2 = uVar1; } in_ECX[2] = in_ECX[2] & ~uVar1; in_ECX[3] = in_ECX[3] & ~uVar2; return; } uVar1 = 1 << (param_1 & 0x1f); uVar2 = 0; if (0x1f < param_1) { uVar2 = uVar1; } uVar1 = uVar1 ^ uVar2; if (0x3f < param_1) { uVar2 = uVar1; } *in_ECX = *in_ECX & ~uVar1; in_ECX[1] = in_ECX[1] & ~uVar2; return; } //@@ 0085e630 Vector::__tostring /* ZHL [lua] Lua binding Vector:__tostring */ undefined * Vector::__tostring(void) { sprintf_s(&DAT_00c82878,0x100,(byte *)"%g %g"); return &DAT_00c82878; } //@@ 0085e680 Entity::IsVulnerableEnemy_lua /* DB: Lua glue; the logic is 006ac560 Entity::IsVulnerableEnemy undefined4 Entity::IsVulnerableEnemy_lua(void *param_1) { byte bVar1; int iVar2; int iVar3; Entity *source; void *local_20; int local_1c; Entity *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03acd; local_10 = ExceptionList; ExceptionList = &local_10; lua_pushvalue(param_1,2,__security_cookie ^ (int)register0x00000010 - 4U); local_20 = param_1; iVar2 = luaL_ref(param_1,0xfff0b9d8); local_8 = 0; local_1c = iVar2; if (iVar2 != -1) { LuaRef::push(&local_20,param_1); iVar3 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar3 != 0) { source = (Entity *)luabridge::LuaRef::cast(); goto LAB_0085e70a; } } source = (Entity *)0x0; LAB_0085e70a: bVar1 = IsVulnerableEnemy(local_18,source); lua_pushboolean(param_1,bVar1); luaL_unref(param_1,0xfff0b9d8,iVar2); ExceptionList = local_10; return 1; } //@@ 0085e750 HUD::ShowItemText /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding HUD:ShowItemText */ undefined4 HUD::ShowItemText(void *param_1) { char cVar1; int iVar2; undefined4 uVar3; byte *title; uint uVar4; int luaType; void *pvVar5; HUD *in_ECX; HUD *messageSlot; uint uVar6; code *unrefFn; void *arg4Ref; undefined4 arg4RefId; void *arg2Ref; int arg2RefId; void *arg3Ref; int arg3RefId; void *arg5Ref; ItemConfig_Item *local_60; HUD *local_5c; void *local_58; int local_54; uint refCleanupFlags; char local_49; void *descriptionText [4]; undefined4 descriptionTextSize; uint descriptionTextCapacity; void *titleText [4]; undefined4 titleTextSize; uint titleTextCapacity; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b03b3f; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(titleText + 0xb); ExceptionList = &local_10; refCleanupFlags = 0; local_5c = in_ECX; lua_pushvalue(param_1,2,local_18); arg2Ref = param_1; arg2RefId = luaL_ref(param_1,0xfff0b9d8); local_8 = (void *)0x0; lua_pushvalue(param_1,3); arg3Ref = param_1; arg3RefId = luaL_ref(param_1,0xfff0b9d8); local_8._0_1_ = 1; if (arg2RefId == -1) { LAB_0085e7ff: if (arg3RefId != -1) { LuaRef::push(&arg3Ref,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 4) goto LAB_0085e82e; } LuaRef::push(&arg2Ref,param_1); iVar2 = lua_gettop(param_1); luaType = lua_type(param_1,iVar2); if (luaType == 0) { local_5c = (HUD *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,iVar2,&g_luaClassKeyEntityPlayer,0); local_5c = *(HUD **)((int)pvVar5 + 4); } lua_settop(param_1,0xfffffffe); LuaRef::push(&arg3Ref,param_1); local_54 = lua_gettop(param_1); iVar2 = lua_type(param_1,local_54); local_60 = (ItemConfig_Item *)0x0; if (iVar2 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,local_54,&g_luaClassKeyItem,1); local_60 = *(ItemConfig_Item **)((int)pvVar5 + 4); } lua_settop(param_1,0xfffffffe); lua_pushvalue(param_1,4); arg4Ref = param_1; arg4RefId = luaL_ref(param_1,0xfff0b9d8); refCleanupFlags = 0x10; cVar1 = FUN_0085c300(); if (cVar1 == '\0') { lua_pushvalue(param_1,4); local_58 = param_1; local_54 = luaL_ref(param_1,0xfff0b9d8); refCleanupFlags = 0x30; cVar1 = FUN_00872820(); pvVar5 = param_1; if (cVar1 == '\x01') goto LAB_0085ebfd; local_49 = '\0'; } else { pvVar5 = local_58; LAB_0085ebfd: local_49 = '\x01'; } unrefFn = luaL_unref_exref; if ((refCleanupFlags & 0x20) != 0) { refCleanupFlags = refCleanupFlags & 0xffffffdf; luaL_unref(pvVar5,0xfff0b9d8,local_54); } if ((refCleanupFlags & 0x10) != 0) { luaL_unref(param_1,0xfff0b9d8,arg4RefId); } if (local_49 != '\0') { FUN_009a3560(); } if ((local_5c != (HUD *)0x0) && (local_60 != (ItemConfig_Item *)0x0)) { ShowItemText(in_ECX,(Entity_Player *)local_5c,local_60); } goto LAB_0085ec63; } LuaRef::push(&arg2Ref,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 != 4) goto LAB_0085e7ff; LAB_0085e82e: lua_pushvalue(param_1,5); arg5Ref = param_1; local_60 = (ItemConfig_Item *)luaL_ref(param_1,0xfff0b9d8); uVar6 = 1; refCleanupFlags = 1; if (local_60 == (ItemConfig_Item *)0xffffffff) { LAB_0085e8d4: local_49 = '\x01'; } else { LuaRef::push(&arg5Ref,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 0) goto LAB_0085e8d4; lua_pushvalue(param_1,5); local_58 = param_1; local_54 = luaL_ref(param_1,0xfff0b9d8); uVar6 = 3; refCleanupFlags = 3; LuaRef::push(&local_58,param_1); uVar3 = lua_gettop(param_1); iVar2 = lua_toboolean(param_1,uVar3); lua_settop(param_1,0xfffffffe); local_49 = '\0'; if (iVar2 != 0) goto LAB_0085e8d4; } if ((uVar6 & 2) != 0) { uVar6 = uVar6 & 0xfffffffd; refCleanupFlags = uVar6; luaL_unref(local_58,0xfff0b9d8,local_54); } if ((uVar6 & 1) != 0) { uVar6 = uVar6 & 0xfffffffe; refCleanupFlags = uVar6; luaL_unref(param_1,0xfff0b9d8,local_60); } if (local_49 != '\0') { FUN_009a3560(); } lua_pushvalue(param_1,4); arg4Ref = param_1; arg4RefId = luaL_ref(param_1,0xfff0b9d8); local_8._0_1_ = 2; LuaRef::push(&arg4Ref,param_1); uVar3 = lua_gettop(param_1); iVar2 = lua_toboolean(param_1,uVar3); local_54 = CONCAT31(local_54._1_3_,iVar2 != 0); lua_settop(param_1,0xfffffffe); if (arg3RefId == -1) { LAB_0085e9c1: local_60 = (ItemConfig_Item *)&s_empty; } else { LuaRef::push(&arg3Ref,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 0) goto LAB_0085e9c1; local_60 = (ItemConfig_Item *)FUN_00872860(descriptionText); local_8._0_1_ = 3; uVar6 = uVar6 | 4; refCleanupFlags = uVar6; if (0xf < *(uint *)((local_60->name)._buf + 0xc)) { local_60 = (ItemConfig_Item *)local_60->type; } } if (arg2RefId == -1) { LAB_0085ea17: title = &s_empty; } else { LuaRef::push(&arg2Ref,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 0) goto LAB_0085ea17; title = (byte *)FUN_00872860(titleText); local_8._0_1_ = 4; local_8._1_3_ = 0; uVar6 = uVar6 | 8; refCleanupFlags = uVar6; if (0xf < *(uint *)(title + 0x14)) { title = *(byte **)title; } } uVar4 = 0; messageSlot = local_5c; do { if (*(char *)(messageSlot->_messageStack + 2) == '\0') { HUD_Message::Show(messageSlot->_messageStack,title,(byte *)local_60,1,(byte)local_54); break; } uVar4 = uVar4 + 1; messageSlot = (HUD *)(messageSlot->_playerHUD + 500); } while (uVar4 < 6); if ((uVar6 & 8) != 0) { uVar6 = uVar6 & 0xfffffff7; if (0xf < titleTextCapacity) { uVar4 = titleTextCapacity + 1; pvVar5 = titleText[0]; if (0xfff < uVar4) { pvVar5 = *(void **)((int)titleText[0] + -4); uVar4 = titleTextCapacity + 0x24; if (0x1f < (uint)((int)titleText[0] + (-4 - (int)pvVar5))) goto LAB_0085eac1; } operator_delete(pvVar5,uVar4); } titleTextSize = 0; titleTextCapacity = 0xf; titleText[0] = (void *)((uint)titleText[0] & 0xffffff00); } if ((uVar6 & 4) != 0) { if (0xf < descriptionTextCapacity) { uVar6 = descriptionTextCapacity + 1; pvVar5 = descriptionText[0]; if (0xfff < uVar6) { pvVar5 = *(void **)((int)descriptionText[0] + -4); uVar6 = descriptionTextCapacity + 0x24; if (0x1f < (uint)((int)descriptionText[0] + (-4 - (int)pvVar5))) { LAB_0085eac1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar6); } descriptionTextSize = 0; descriptionTextCapacity = 0xf; descriptionText[0] = (void *)((uint)descriptionText[0] & 0xffffff00); } unrefFn = luaL_unref_exref; luaL_unref(param_1,0xfff0b9d8,arg4RefId); LAB_0085ec63: (*unrefFn)(param_1,0xfff0b9d8,arg3RefId); (*unrefFn)(param_1,0xfff0b9d8,arg2RefId); ExceptionList = local_10; return 0; } //@@ 0085eca0 HUD::ShowFortuneText /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding HUD:ShowFortuneText */ undefined4 HUD::ShowFortuneText(void *param_1) { uint uVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; byte *text; undefined4 *puVar5; void *pvStack_5c; int iStack_58; HUD *pHStack_54; uint uStack_50; int iStack_4c; undefined4 *puStack_48; undefined4 *puStack_44; int iStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &DAT_00b03b9d; pvStack_1c = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &pvStack_1c; puStack_44 = (undefined4 *)0x0; iStack_40 = 0; uStack_24 = uVar1; puStack_44 = operator_new(0x20); *puStack_44 = puStack_44; puStack_44[1] = puStack_44; uStack_14 = 0; iStack_4c = 2; pvStack_5c = param_1; do { lua_pushvalue(param_1,iStack_4c,uVar1); iVar2 = luaL_ref(param_1,0xfff0b9d8); iStack_58 = iVar2; if (iVar2 == -1) { puVar3 = (undefined4 *)0x0; } else { LuaRef::push(&pvStack_5c,param_1); puStack_48 = (undefined4 *)lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); puVar3 = puStack_48; } if (puVar3 != (undefined4 *)&DAT_00000004) { uStack_14 = (uint)uStack_14._1_3_ << 8; luaL_unref(param_1,0xfff0b9d8,iVar2); break; } uStack_14._0_1_ = 2; LuaRef::push(&pvStack_5c,param_1); uVar4 = lua_gettop(param_1); text = (byte *)luaL_checklstring(param_1,uVar4,&uStack_50); uStack_2c = 0; uStack_28 = 0xf; uStack_3c = 0; std::string::assign((char *)&uStack_3c,text,uStack_50); lua_settop(param_1,0xfffffffe); uStack_14 = CONCAT31(uStack_14._1_3_,3); puStack_48 = puStack_44; if (iStack_40 == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } uStack_14._0_1_ = 4; puVar5 = operator_new(0x20); puVar5[6] = 0; puVar5[7] = 0; puVar5[2] = uStack_3c; puVar5[3] = uStack_38; puVar5[4] = uStack_34; puVar5[5] = uStack_30; *(ulonglong *)(puVar5 + 6) = CONCAT44(uStack_28,uStack_2c); iStack_40 = iStack_40 + 1; puVar3 = (undefined4 *)puStack_48[1]; *puVar5 = puStack_48; puVar5[1] = puVar3; puStack_48[1] = puVar5; *puVar3 = puVar5; uStack_14 = (uint)uStack_14._1_3_ << 8; luaL_unref(param_1,0xfff0b9d8,iVar2); iStack_4c = iStack_4c + 1; } while (iStack_4c < 0x22); render_fortune_text(pHStack_54,&puStack_44); *(undefined4 *)puStack_44[1] = 0; puVar3 = (undefined4 *)*puStack_44; while (puVar3 != (undefined4 *)0x0) { puVar5 = (undefined4 *)*puVar3; std::string::_Tidy_deallocate((char *)(puVar3 + 2)); operator_delete(puVar3,0x20); puVar3 = puVar5; } operator_delete(puStack_44,0x20); ExceptionList = pvStack_1c; return 0; } //@@ 0085ef00 FUN_0085ef00 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0085ef00(void) { byte bVar1; byte *text; byte *text_00; byte *pbVar2; void *ptr; char *in_EDX; uint size; void *local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af18ad; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; text = operator_new_tracked(0x12d); strncpy((char *)text,in_EDX,300); lua_getglobal(); lua_getfield(); text_00 = (byte *)lua_tolstring(); local_20 = 0; local_1c = 0xf; local_30[0] = (void *)0x0; pbVar2 = text_00; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign((char *)local_30,text_00,(int)pbVar2 - (int)(text_00 + 1)); local_8 = (void *)0x0; std::string::append((char *)local_30,&DAT_00b6ebc8,1); pbVar2 = text; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::append((char *)local_30,text,(int)pbVar2 - (int)(text + 1)); lua_settop(); lua_pushstring(); lua_setfield(); lua_settop(); if (0xf < local_1c) { size = local_1c + 1; ptr = local_30[0]; if (0xfff < size) { ptr = *(void **)((int)local_30[0] + -4); size = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 0085f080 FUN_0085f080 void FUN_0085f080(void) { uint length; char *in_ECX; byte *data; byte *in_EDX; data = in_EDX; if (0xf < *(uint *)(in_EDX + 0x14)) { data = *(byte **)in_EDX; } length = std::string::find_last_of(data,*(uint *)(in_EDX + 0x10),0xffffffff,&DAT_00b6ac04,2); in_ECX[0] = '\0'; in_ECX[1] = '\0'; in_ECX[2] = '\0'; in_ECX[3] = '\0'; in_ECX[0x10] = '\0'; in_ECX[0x11] = '\0'; in_ECX[0x12] = '\0'; in_ECX[0x13] = '\0'; in_ECX[0x14] = '\x0f'; in_ECX[0x15] = '\0'; in_ECX[0x16] = '\0'; in_ECX[0x17] = '\0'; *in_ECX = '\0'; if (*(uint *)(in_EDX + 0x10) < length) { length = *(uint *)(in_EDX + 0x10); } if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } std::string::assign(in_ECX,in_EDX,length); return; } //@@ 0085f0f0 lua_searcher_resources_scripts /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: Lua package searcher: appends ".lua", tries "resources/scripts/" path, builds "\n\tno file" message; called by FUN_0085fcc0 ("error loading module") */ void lua_searcher_resources_scripts(byte *param_1) { undefined8 uVar1; byte bVar2; uint uVar3; uint uVar4; char *pcVar5; undefined4 *puVar6; FILE *pFVar7; int iVar8; char *******pppppppcVar9; int *piVar10; undefined4 *******pppppppuVar11; char *in_ECX; byte *pbVar12; byte *pbVar13; void *pvVar14; int in_EDX; byte *******pppppppbVar15; uint *puVar17; byte *******pppppppbVar16; undefined1 *puVar18; bool bVar19; byte *******local_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; std_string *local_ec; uint uStack_e8; undefined4 *******local_e4; int iStack_e0; int iStack_dc; int iStack_d8; undefined8 local_d4; void *local_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined8 local_bc; char *******local_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined8 local_a4; void *local_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined8 local_8c; ulonglong local_84; undefined2 local_7c; undefined1 local_7a; undefined1 local_79; undefined4 local_74; uint local_70; byte *******local_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined8 local_5c; byte *******local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined8 local_44; byte *******local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; std_string *local_2c; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b03c4a; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_2c = (std_string *)0x0; uStack_28 = 0xf; local_3c = (byte *******)0x0; pbVar12 = param_1; do { bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar2 != 0); local_24 = uVar3; std::string::assign((char *)&local_3c,param_1,(int)pbVar12 - (int)(param_1 + 1)); local_14._0_1_ = 0; local_14._1_3_ = 0; pppppppbVar15 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar15 = local_3c; } if ((std_string *)0x3 < local_2c) { puVar17 = (uint *)0xffffffff; if (&local_2c[-1]._capacity != (uint *)0xffffffff) { puVar17 = &local_2c[-1]._capacity; } pppppppbVar16 = (byte *******)((int)puVar17 + (int)pppppppbVar15); while( true ) { if (*(byte *)pppppppbVar16 == 0x2e) { if ((*pppppppbVar16 == (byte ******)0x61756c2e) || ((((bVar2 = (byte)*pppppppbVar16, bVar19 = bVar2 < 0x2e, bVar2 == 0x2e && (bVar19 = *(byte *)((int)pppppppbVar16 + 1) < 0x6c, *(byte *)((int)pppppppbVar16 + 1) == 0x6c)) && (bVar19 = *(byte *)((int)pppppppbVar16 + 2) < 0x75, *(byte *)((int)pppppppbVar16 + 2) == 0x75)) && (bVar19 = *(byte *)((int)pppppppbVar16 + 3) < 0x61, *(byte *)((int)pppppppbVar16 + 3) == 0x61)))) { uVar4 = 0; } else { uVar4 = -(uint)bVar19 | 1; } if (uVar4 == 0) { puVar18 = (undefined1 *)((int)pppppppbVar16 - (int)pppppppbVar15); goto LAB_0085f203; } } if (pppppppbVar16 == pppppppbVar15) break; pppppppbVar16 = (byte *******)((int)pppppppbVar16 + -1); } } puVar18 = (undefined1 *)0xffffffff; LAB_0085f203: pppppppbVar15 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar15 = local_3c; } pppppppbVar15 = (byte *******)((int)pppppppbVar15 + (int)local_2c); pppppppbVar16 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar16 = local_3c; } for (; pppppppbVar16 != pppppppbVar15; pppppppbVar16 = (byte *******)((int)pppppppbVar16 + 1)) { if (*(byte *)pppppppbVar16 == 0x2e) { *(byte *)pppppppbVar16 = 0x2f; } } if (((puVar18 == (undefined1 *)0xffffffff) || (local_2c < (std_string *)&DAT_00000005)) || ((uint *)puVar18 != &local_2c[-1]._capacity)) { if (0x7fffffffU - (int)local_2c < 4) { /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar3); } pppppppbVar15 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar15 = local_3c; } std::string::concat((char *)&local_fc,in_EDX,local_2c,(byte *)pppppppbVar15,(uint)local_2c, (byte *)&DAT_00b6ec04,4); if (0xf < uStack_28) { uVar3 = uStack_28 + 1; pppppppbVar15 = local_3c; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_3c[-1]; uVar3 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)pppppppbVar15))) goto LAB_0085fcb2; } operator_delete(pppppppbVar15,uVar3); } local_3c = local_fc; uStack_38 = uStack_f8; uStack_34 = uStack_f4; uStack_30 = uStack_f0; local_2c = local_ec; uStack_28 = uStack_e8; } else { pppppppbVar15 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar15 = local_3c; } *(byte *)((int)(pppppppbVar15 + -1) + (int)local_2c) = 0x2e; } local_74 = 0; local_70 = 0xf; local_84 = local_84 & 0xffffffff00000000; pcVar5 = std::_Allocate(0x20); local_74 = 0x12; local_70 = 0x1f; builtin_strncpy(pcVar5,"resources/scripts/",0x13); local_84 = CONCAT44(local_84._4_4_,pcVar5); local_14._0_1_ = 1; pppppppbVar15 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar15 = local_3c; } puVar6 = std::string::append((char *)&local_84,(byte *)pppppppbVar15,(uint)local_2c); local_6c = (byte *******)*puVar6; uStack_68 = puVar6[1]; uStack_64 = puVar6[2]; uStack_60 = puVar6[3]; local_5c = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 3; if (0xf < local_70) { uVar3 = local_70 + 1; pvVar14 = (void *)local_84; if (0xfff < uVar3) { pvVar14 = *(void **)((int)(void *)local_84 + -4); uVar3 = local_70 + 0x24; if (0x1f < (uint)((int)(void *)local_84 + (-4 - (int)pvVar14))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar14,uVar3); } pppppppbVar15 = (byte *******)&local_6c; if (0xf < local_5c._4_4_) { pppppppbVar15 = local_6c; } local_74 = 0; local_70 = 0xf; local_84 = local_84 & 0xffffffffffffff00; pFVar7 = fopen((char *)pppppppbVar15,"r"); if (pFVar7 == (FILE *)0x0) { pcVar5 = (char *)FUN_0085f080(); local_14._0_1_ = 4; puVar6 = std::string::append(pcVar5,(byte *)&DAT_00b6db28,1); local_9c = (void *)*puVar6; uStack_98 = puVar6[1]; uStack_94 = puVar6[2]; uStack_90 = puVar6[3]; local_8c = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 5; pppppppbVar15 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar15 = local_3c; } puVar6 = std::string::append((char *)&local_9c,(byte *)pppppppbVar15,(uint)local_2c); local_54 = (byte *******)*puVar6; uStack_50 = puVar6[1]; uStack_4c = puVar6[2]; uStack_48 = puVar6[3]; local_44 = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 7; if (0xf < local_8c._4_4_) { uVar3 = local_8c._4_4_ + 1; pvVar14 = local_9c; if (0xfff < uVar3) { pvVar14 = *(void **)((int)local_9c + -4); uVar3 = local_8c._4_4_ + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar14))) goto LAB_0085f5b2; } operator_delete(pvVar14,uVar3); } local_8c = 0xf00000000; local_9c = (void *)((uint)local_9c & 0xffffff00); local_14._0_1_ = 8; if (0xf < uStack_e8) { uVar3 = uStack_e8 + 1; pppppppbVar15 = local_fc; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_fc[-1]; uVar3 = uStack_e8 + 0x24; if ((byte *)0x1f < (byte *)((int)local_fc + (-4 - (int)pppppppbVar15))) { LAB_0085f5b2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar15,uVar3); } pppppppbVar15 = (byte *******)&local_54; if (0xf < local_44._4_4_) { pppppppbVar15 = local_54; } local_ec = (std_string *)0x0; uStack_e8 = 0xf; local_fc = (byte *******)((uint)local_fc & 0xffffff00); pFVar7 = fopen((char *)pppppppbVar15,"r"); if (pFVar7 != (FILE *)0x0) { fclose(pFVar7); pppppppbVar15 = local_54; in_ECX[0] = '\0'; in_ECX[1] = '\0'; in_ECX[2] = '\0'; in_ECX[3] = '\0'; in_ECX[0x10] = '\0'; in_ECX[0x11] = '\0'; in_ECX[0x12] = '\0'; in_ECX[0x13] = '\0'; in_ECX[0x14] = '\0'; in_ECX[0x15] = '\0'; in_ECX[0x16] = '\0'; in_ECX[0x17] = '\0'; local_54 = (byte *******)((uint)local_54 & 0xffffff00); *(byte ********)in_ECX = pppppppbVar15; *(undefined4 *)(in_ECX + 4) = uStack_50; *(undefined4 *)(in_ECX + 8) = uStack_4c; *(undefined4 *)(in_ECX + 0xc) = uStack_48; *(undefined8 *)(in_ECX + 0x10) = local_44; local_44 = 0xf00000000; if (0xf < local_5c._4_4_) { uVar3 = local_5c._4_4_ + 1; pppppppbVar15 = local_6c; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_6c[-1]; uVar3 = local_5c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c + (-4 - (int)pppppppbVar15))) goto LAB_0085fcb2; } operator_delete(pppppppbVar15,uVar3); } goto LAB_0085f41c; } local_bc = 0xf00000000; local_cc = (void *)0x0; pbVar12 = g_modsDirectory; do { pbVar13 = pbVar12; pbVar12 = pbVar13 + 1; } while (*pbVar13 != 0); std::string::assign((char *)&local_cc,g_modsDirectory,(uint)(pbVar13 + -0xc72e28)); local_14._0_1_ = 9; pppppppbVar15 = (byte *******)&local_54; if (0xf < local_44._4_4_) { pppppppbVar15 = local_54; } puVar6 = std::string::append((char *)&local_cc,(byte *)pppppppbVar15,(uint)local_44); local_b4 = (char *******)*puVar6; uStack_b0 = puVar6[1]; uStack_ac = puVar6[2]; uStack_a8 = puVar6[3]; uVar1 = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_a4._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); pppppppcVar9 = (char *******)&local_b4; if (0xf < local_a4._4_4_) { pppppppcVar9 = local_b4; } local_a4 = uVar1; pFVar7 = fopen((char *)pppppppcVar9,"r"); if (pFVar7 != (FILE *)0x0) { fclose(pFVar7); } if (0xf < local_a4._4_4_) { uVar3 = local_a4._4_4_ + 1; pppppppcVar9 = local_b4; if (0xfff < uVar3) { pppppppcVar9 = (char *******)local_b4[-1]; uVar3 = local_a4._4_4_ + 0x24; if ((char *)0x1f < (char *)((int)local_b4 + (-4 - (int)pppppppcVar9))) goto LAB_0085f7c0; } operator_delete(pppppppcVar9,uVar3); } local_14._0_1_ = 8; local_a4 = 0xf00000000; local_b4 = (char *******)((uint)local_b4 & 0xffffff00); if (0xf < local_bc._4_4_) { uVar3 = local_bc._4_4_ + 1; pvVar14 = local_cc; if (0xfff < uVar3) { pvVar14 = *(void **)((int)local_cc + -4); uVar3 = local_bc._4_4_ + 0x24; if (0x1f < (uint)((int)local_cc + (-4 - (int)pvVar14))) { LAB_0085f7c0: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar14,uVar3); } if (pFVar7 != (FILE *)0x0) { FUN_00417100(&local_54); if (0xf < local_44._4_4_) { uVar3 = local_44._4_4_ + 1; pppppppbVar15 = local_54; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_54[-1]; uVar3 = local_44._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)pppppppbVar15))) goto LAB_0085fcb2; } operator_delete(pppppppbVar15,uVar3); } local_44 = 0xf00000000; local_54 = (byte *******)((uint)local_54 & 0xffffff00); if (0xf < local_5c._4_4_) { uVar3 = local_5c._4_4_ + 1; pppppppbVar15 = local_6c; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_6c[-1]; uVar3 = local_5c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c + (-4 - (int)pppppppbVar15))) goto LAB_0085fcb2; } operator_delete(pppppppbVar15,uVar3); } goto LAB_0085f41c; } local_7c = 0x2065; local_70 = 0xf; local_74 = 0xb; local_84 = 0x6c6966206f6e090a; local_7a = 0x27; local_79 = 0; local_14._0_1_ = 10; pppppppbVar15 = (byte *******)&local_6c; if (0xf < local_5c._4_4_) { pppppppbVar15 = local_6c; } puVar6 = std::string::append((char *)&local_84,(byte *)pppppppbVar15,(uint)local_5c); local_b4 = (char *******)*puVar6; uStack_b0 = puVar6[1]; uStack_ac = puVar6[2]; uStack_a8 = puVar6[3]; local_a4 = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 0xb; puVar6 = std::string::append((char *)&local_b4,(byte *)"\'\n\tno file \'",0xc); local_cc = (void *)*puVar6; uStack_c8 = puVar6[1]; uStack_c4 = puVar6[2]; uStack_c0 = puVar6[3]; local_bc = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 0xc; pppppppbVar15 = (byte *******)&local_54; if (0xf < local_44._4_4_) { pppppppbVar15 = local_54; } puVar6 = std::string::append((char *)&local_cc,(byte *)pppppppbVar15,(uint)local_44); local_9c = (void *)*puVar6; uStack_98 = puVar6[1]; uStack_94 = puVar6[2]; uStack_90 = puVar6[3]; local_8c = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 0xd; piVar10 = std::string::append((char *)&local_9c,&DAT_00b6ea34,1); local_e4 = (undefined4 *******)*piVar10; iStack_e0 = piVar10[1]; iStack_dc = piVar10[2]; iStack_d8 = piVar10[3]; local_d4 = *(undefined8 *)(piVar10 + 4); piVar10[4] = 0; piVar10[5] = 0xf; *(undefined1 *)piVar10 = 0; local_14._0_1_ = 0xf; if (0xf < local_8c._4_4_) { uVar3 = local_8c._4_4_ + 1; pvVar14 = local_9c; if (0xfff < uVar3) { pvVar14 = *(void **)((int)local_9c + -4); uVar3 = local_8c._4_4_ + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar14))) goto LAB_0085fb38; } operator_delete(pvVar14,uVar3); } local_8c = 0xf00000000; local_9c = (void *)((uint)local_9c & 0xffffff00); local_14._0_1_ = 0x10; if (0xf < local_bc._4_4_) { uVar3 = local_bc._4_4_ + 1; pvVar14 = local_cc; if (0xfff < uVar3) { pvVar14 = *(void **)((int)local_cc + -4); uVar3 = local_bc._4_4_ + 0x24; if (0x1f < (uint)((int)local_cc + (-4 - (int)pvVar14))) goto LAB_0085fb38; } operator_delete(pvVar14,uVar3); } local_bc = 0xf00000000; local_cc = (void *)((uint)local_cc & 0xffffff00); local_14._0_1_ = 0x11; if (0xf < local_a4._4_4_) { uVar3 = local_a4._4_4_ + 1; pppppppcVar9 = local_b4; if (0xfff < uVar3) { pppppppcVar9 = (char *******)local_b4[-1]; uVar3 = local_a4._4_4_ + 0x24; if ((char *)0x1f < (char *)((int)local_b4 + (-4 - (int)pppppppcVar9))) goto LAB_0085fb38; } operator_delete(pppppppcVar9,uVar3); } local_a4 = 0xf00000000; local_b4 = (char *******)((uint)local_b4 & 0xffffff00); local_14._0_1_ = 0x12; if (0xf < local_70) { uVar3 = local_70 + 1; pvVar14 = (void *)local_84; if (0xfff < uVar3) { pvVar14 = *(void **)((int)(void *)local_84 + -4); uVar3 = local_70 + 0x24; if (0x1f < (uint)((int)(void *)local_84 + (-4 - (int)pvVar14))) { LAB_0085fb38: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar14,uVar3); } local_74 = 0; pppppppuVar11 = &local_e4; if (0xf < local_d4._4_4_) { pppppppuVar11 = local_e4; } local_70 = 0xf; local_84 = local_84 & 0xffffffffffffff00; lua_pushstring(in_EDX,pppppppuVar11); in_ECX[0] = '\0'; in_ECX[1] = '\0'; in_ECX[2] = '\0'; in_ECX[3] = '\0'; in_ECX[0x10] = '\0'; in_ECX[0x11] = '\0'; in_ECX[0x12] = '\0'; in_ECX[0x13] = '\0'; in_ECX[0x14] = '\x0f'; in_ECX[0x15] = '\0'; in_ECX[0x16] = '\0'; in_ECX[0x17] = '\0'; *in_ECX = '\0'; std::string::assign(in_ECX,&s_empty,0); if (0xf < local_d4._4_4_) { uVar3 = local_d4._4_4_ + 1; pppppppuVar11 = local_e4; if (0xfff < uVar3) { pppppppuVar11 = (undefined4 *******)local_e4[-1]; uVar3 = local_d4._4_4_ + 0x24; if (0x1f < (uint)((int)local_e4 + (-4 - (int)pppppppuVar11))) goto LAB_0085fcb2; } operator_delete(pppppppuVar11,uVar3); } local_d4 = 0xf00000000; local_e4 = (undefined4 *******)((uint)local_e4 & 0xffffff00); if (0xf < local_44._4_4_) { uVar3 = local_44._4_4_ + 1; pppppppbVar15 = local_54; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_54[-1]; uVar3 = local_44._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)pppppppbVar15))) goto LAB_0085fcb2; } operator_delete(pppppppbVar15,uVar3); } local_44 = 0xf00000000; local_54 = (byte *******)((uint)local_54 & 0xffffff00); if (0xf < local_5c._4_4_) { uVar3 = local_5c._4_4_ + 1; pppppppbVar15 = local_6c; if (0xfff < uVar3) { pppppppbVar15 = (byte *******)local_6c[-1]; uVar3 = local_5c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c + (-4 - (int)pppppppbVar15))) goto LAB_0085fcb2; } operator_delete(pppppppbVar15,uVar3); } local_6c = (byte *******)((uint)local_6c & 0xffffff00); if (uStack_28 < 0x10) { ExceptionList = local_1c; return; } uVar3 = uStack_28 + 1; pppppppbVar15 = local_3c; if (uVar3 < 0x1000) goto LAB_0085f458; pppppppbVar15 = (byte *******)local_3c[-1]; iVar8 = (int)local_3c - (int)pppppppbVar15; } else { fclose(pFVar7); in_ECX[0] = '\0'; in_ECX[1] = '\0'; in_ECX[2] = '\0'; in_ECX[3] = '\0'; in_ECX[0x10] = '\0'; in_ECX[0x11] = '\0'; in_ECX[0x12] = '\0'; in_ECX[0x13] = '\0'; in_ECX[0x14] = '\0'; in_ECX[0x15] = '\0'; in_ECX[0x16] = '\0'; in_ECX[0x17] = '\0'; *(byte ********)in_ECX = local_6c; *(undefined4 *)(in_ECX + 4) = uStack_68; *(undefined4 *)(in_ECX + 8) = uStack_64; *(undefined4 *)(in_ECX + 0xc) = uStack_60; *(undefined8 *)(in_ECX + 0x10) = local_5c; LAB_0085f41c: local_6c = (byte *******)((uint)local_6c & 0xffffff00); if (uStack_28 < 0x10) { ExceptionList = local_1c; return; } uVar3 = uStack_28 + 1; pppppppbVar15 = local_3c; if (uVar3 < 0x1000) goto LAB_0085f458; pppppppbVar15 = (byte *******)local_3c[-1]; iVar8 = (int)local_3c - (int)pppppppbVar15; } local_5c = 0xf00000000; uVar3 = uStack_28 + 0x24; if (0x1f < iVar8 - 4U) { LAB_0085fcb2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_0085f458: local_5c = 0xf00000000; operator_delete(pppppppbVar15,uVar3); ExceptionList = local_1c; return; } //@@ 0085fcc0 FUN_0085fcc0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_0085fcc0(void) { uint uVar1; undefined4 uVar2; undefined4 ****ppppuVar3; int iVar4; undefined4 uVar5; undefined4 in_ECX; undefined4 ****ptr; void *ptr_00; void *local_54; uint local_40; undefined4 ****local_3c; undefined4 ***pppuStack_38; undefined4 ***pppuStack_34; undefined4 ***pppuStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00af556d; local_1c = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_2c = 0xf00000000; local_3c = (undefined4 ****)0x0; local_14 = 0; local_24 = uVar1; uVar2 = luaL_checklstring(); ppppuVar3 = (undefined4 ****)lua_searcher_resources_scripts(uVar2,uVar1); if (&local_3c != (undefined4 *****)ppppuVar3) { if (0xf < local_2c._4_4_) { uVar1 = local_2c._4_4_ + 1; ptr = local_3c; if (0xfff < uVar1) { ptr = (undefined4 ****)local_3c[-1]; uVar1 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)ptr))) goto LAB_0085fdd2; } operator_delete(ptr,uVar1); } local_3c = (undefined4 ****)*ppppuVar3; pppuStack_38 = ppppuVar3[1]; pppuStack_34 = ppppuVar3[2]; pppuStack_30 = ppppuVar3[3]; local_2c = *(undefined8 *)(ppppuVar3 + 4); ppppuVar3[4] = (undefined4 ***)0x0; ppppuVar3[5] = (undefined4 ***)0xf; *(undefined1 *)ppppuVar3 = 0; } if (0xf < local_40) { uVar1 = local_40 + 1; ptr_00 = local_54; if (0xfff < uVar1) { ptr_00 = *(void **)((int)local_54 + -4); uVar1 = local_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)ptr_00))) { LAB_0085fdd2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,uVar1); } if ((int)local_2c == 0) { uVar2 = 1; } else { ppppuVar3 = &local_3c; if (0xf < local_2c._4_4_) { ppppuVar3 = local_3c; } iVar4 = luaL_loadfilex(); if (iVar4 == 0) { lua_pushstring(); uVar2 = 2; } else { uVar2 = lua_tolstring(); uVar5 = lua_tolstring(in_ECX,1,0); uVar2 = luaL_error(in_ECX,"error loading module \'%s\' from file \'%s\':\n\t%s",uVar5, ppppuVar3,uVar2); } } if (0xf < local_2c._4_4_) { uVar1 = local_2c._4_4_ + 1; ppppuVar3 = local_3c; if (0xfff < uVar1) { ppppuVar3 = (undefined4 ****)local_3c[-1]; uVar1 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)ppppuVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar3,uVar1); } ExceptionList = local_1c; return uVar2; } //@@ 0085fec0 FUN_0085fec0 undefined4 FUN_0085fec0(undefined4 param_1) { undefined4 uVar1; int iVar2; undefined4 uVar3; uVar1 = luaL_checklstring(param_1,1,0); lua_settop(param_1,1); lua_getfield(param_1,0xfff0b9d8,"_LOADED"); lua_getfield(param_1,2,uVar1); iVar2 = lua_toboolean(param_1,0xffffffff); if (iVar2 == 0) { lua_settop(param_1,0xfffffffe); FUN_0085fcc0(); iVar2 = lua_type(param_1,0xfffffffe); if (iVar2 != 6) { iVar2 = lua_isstring(param_1,0xffffffff); if (iVar2 == 0) { lua_settop(param_1,0xfffffffe); luaL_error(param_1,"module \'%s\' not found",uVar1); } else { uVar3 = lua_tolstring(param_1,0xffffffff,0); luaL_error(param_1,"module \'%s\' not found:%s",uVar1,uVar3); } } lua_pushstring(param_1,uVar1); lua_rotate(param_1,0xfffffffe,1); lua_callk(param_1,2,1,0,0); iVar2 = lua_type(param_1,0xffffffff); if (iVar2 != 0) { lua_setfield(param_1,2,uVar1); } iVar2 = lua_getfield(param_1,2,uVar1); if (iVar2 == 0) { lua_pushboolean(param_1,1); lua_pushvalue(param_1,0xffffffff); lua_setfield(param_1,2,uVar1); } } return 1; } //@@ 008601f0 FUN_008601f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008601f0(undefined4 param_1) { byte bVar1; int iVar2; byte *text; byte *pbVar3; void *pvVar4; uint uVar5; void *local_48 [4]; uint local_38; uint local_34; void *local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afa6c5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_48 + 0x11); ExceptionList = &local_10; if (g_game != (Game *)0x0) { iVar2 = lua_gettop(param_1,local_18); lua_getglobal(param_1,"tostring"); local_20 = 0; local_1c = 0xf; local_30[0] = (void *)0x0; uVar5 = 1; local_8 = (void *)0x0; if (0 < iVar2) { do { lua_pushvalue(param_1,0xffffffff); lua_pushvalue(param_1,uVar5); lua_callk(param_1,1,1,0,0); if (1 < uVar5) { std::string::append((char *)local_30,&DAT_00b656ec,1); } text = (byte *)lua_tolstring(param_1,0xffffffff,0); if (text != (byte *)0x0) { pbVar3 = text; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::append((char *)local_30,text,(int)pbVar3 - (int)(text + 1)); } lua_settop(param_1,0xfffffffe); uVar5 = uVar5 + 1; } while ((int)uVar5 <= iVar2); } Console::Print(&g_game->_console,(std_string *)local_30,0xffd3d3d3,0x96); local_34 = 0xf; local_38 = 1; local_48[0] = (void *)0xa; local_8 = (void *)CONCAT31(local_8._1_3_,1); Console::Print(&g_game->_console,(std_string *)local_48,0xffd3d3d3,0x96); if (0xf < local_34) { uVar5 = local_34 + 1; pvVar4 = local_48[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)local_48[0] + -4); uVar5 = local_34 + 0x24; if (0x1f < (uint)((int)local_48[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } if (0xf < local_1c) { uVar5 = local_1c + 1; pvVar4 = local_30[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)local_30[0] + -4); uVar5 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } } ExceptionList = local_10; return 0; } //@@ 008603d0 FUN_008603d0 undefined4 FUN_008603d0(undefined4 param_1) { int iVar1; undefined4 uVar2; iVar1 = lua_isuserdata(param_1,1); if (iVar1 == 0) { lua_settop(param_1,0xfffffffe); uVar2 = luaL_error(param_1,"The parameter is not an user data!"); return uVar2; } iVar1 = lua_touserdata(param_1,1); lua_pushinteger(param_1,*(uint *)((int)g_luaEngine + 0x20) ^ *(uint *)(iVar1 + 4),0); return 1; } //@@ 00860440 FUN_00860440 undefined4 FUN_00860440(undefined4 param_1,undefined4 param_2,undefined4 param_3,int param_4) { undefined4 uVar1; if (param_4 == 0) { FUN_00ae7470(param_2); return 0; } uVar1 = FUN_00ae74f0(param_1,param_2,param_4); return uVar1; } //@@ 00860470 FUN_00860470 undefined4 FUN_00860470(undefined4 param_1) { undefined4 uVar1; undefined4 uVar2; FILE *_File; uVar1 = lua_tolstring(param_1,0xffffffff,0); uVar2 = __acrt_iob_func(2); FUN_008c5d50(uVar2,"PANIC: unprotected error in call to Lua API (%s)\n",uVar1); _File = (FILE *)__acrt_iob_func(2); fflush(_File); return 0; } //@@ 008604c0 LuaEngine::Init /* DB: REPENTOGON LuaEngine::Init(bool Debug): lua_newstate seeded from GetTimeNs, "Running Lua in debug mode...", resources/scripts/enums.lua + main.lua, _RunCallback/_UnloadMod globals, LuaEngine::RegisterAPI; called from IsaacStartup right after g_luaEngine is set prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall LuaEngine::Init(LuaEngine *this,byte Debug) { LuaEngine LVar1; ulonglong uVar2; longlong lVar3; qword qVar4; void *pvVar5; undefined *puVar6; undefined4 *puVar7; LuaEngine LVar8; undefined4 uVar9; uint uVar10; uint uVar11; uint uVar12; undefined **ppuVar13; qword *pqVar14; ulonglong uVar15; LuaEngine local_30; uVar15 = GetTimeNs(); uVar11 = (uint)(uVar15 >> 0x20); uVar2 = (ulonglong)uVar11 * 0xd7b634db + ((uVar15 & 0xffffffff) * 0xd7b634db >> 0x20); uVar12 = (uint)(uVar2 >> 0x20); uVar10 = (uint)((uVar15 & 0xffffffff) * 0x431bde82 + (uVar2 & 0xffffffff) >> 0x20); lVar3 = (ulonglong)uVar11 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar12,uVar10),uVar12 + uVar10); uVar10 = (uint)lVar3 >> 0x12 | (int)((ulonglong)lVar3 >> 0x20) * 0x4000; uVar10 = uVar10 ^ uVar10 >> 4; uVar10 = (uVar10 ^ 0xdeadbeef) + uVar10 * 0x20; this[8] = (LuaEngine)(uVar10 >> 0xb ^ uVar10); if (DAT_00c7168c == 0) { local_30 = (LuaEngine)luaL_newstate(); this[6] = local_30; } else { local_30 = (LuaEngine)lua_newstate(FUN_00860440,DAT_00c7168c); this[6] = local_30; if (local_30 != (LuaEngine)0x0) { lua_atpanic(local_30,FUN_00860470); local_30 = this[6]; } } if (Debug == 0) { puVar6 = &DAT_00ae597d; ppuVar13 = &PTR_DAT_00b23eb0; do { luaL_requiref(local_30,*ppuVar13,puVar6,1); lua_settop(local_30,0xfffffffe); puVar6 = ppuVar13[3]; ppuVar13 = ppuVar13 + 2; } while (puVar6 != (undefined *)0x0); } else { KAGE_LogMessage(4,(byte *)"Running Lua in debug mode...\n"); luaL_openlibs(this[6]); FUN_0085ef00(1); FUN_0085ef00(0); LVar8 = this[6]; lua_pushboolean(LVar8,1); lua_setglobal(LVar8,"_LUADEBUG"); } *(byte *)(this + 7) = Debug; RegisterAPI(); FUN_0086e5e0("resources/scripts/enums.lua"); FUN_0086e5e0("resources/scripts/main.lua"); if (g_mainHeap == (void *)0x0) { pqVar14 = &g_allocatedBytesNoHeap; } else { pqVar14 = (qword *)((int)g_mainHeap + 0x30); } puVar7 = malloc(0xc); if (puVar7 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); LAB_00860699: LVar8 = (LuaEngine)0x0; } else { qVar4 = *pqVar14; *(uint *)pqVar14 = (uint)*pqVar14 + 0xc; *puVar7 = 0xc; *(uint *)((int)pqVar14 + 4) = *(uint *)((int)pqVar14 + 4) + (uint)(0xfffffff3 < (uint)qVar4); LVar8 = (LuaEngine)(puVar7 + 1); if (LVar8 == (LuaEngine)0x0) goto LAB_00860699; LVar1 = this[6]; lua_getglobal(LVar1,"_RunCallback"); *(LuaEngine *)LVar8 = LVar1; uVar9 = luaL_ref(LVar1,0xfff0b9d8); puVar7[2] = uVar9; } pvVar5 = g_mainHeap; this[4] = LVar8; if (pvVar5 == (void *)0x0) { pqVar14 = &g_allocatedBytesNoHeap; } else { pqVar14 = (qword *)((int)pvVar5 + 0x30); } puVar7 = malloc(0xc); if (puVar7 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar4 = *pqVar14; *(uint *)pqVar14 = (uint)*pqVar14 + 0xc; *puVar7 = 0xc; *(uint *)((int)pqVar14 + 4) = *(uint *)((int)pqVar14 + 4) + (uint)(0xfffffff3 < (uint)qVar4); LVar8 = (LuaEngine)(puVar7 + 1); if (LVar8 != (LuaEngine)0x0) { LVar1 = this[6]; lua_getglobal(LVar1,"_UnloadMod"); *(LuaEngine *)LVar8 = LVar1; uVar9 = luaL_ref(LVar1,0xfff0b9d8); puVar7[2] = uVar9; goto LAB_00860712; } } LVar8 = (LuaEngine)0x0; LAB_00860712: LVar1 = this[6]; this[5] = LVar8; lua_pushnil(LVar1); lua_setglobal(LVar1,"_RunCallback"); LVar8 = this[6]; lua_pushnil(LVar8); lua_setglobal(LVar8,"_UnloadMod"); return; } //@@ 008607a0 FUN_008607a0 void FUN_008607a0(void) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03c80; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 2) != 0) { local_8 = 0; FUN_00872980(&local_1c,g_luaEngine); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00860826 Catch@00860826 undefined4 Catch_00860826(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostUpdate\" failed: %s\n",uVar2); } return 0x860814; } //@@ 00860880 FUN_00860880 void FUN_00860880(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03ca0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x8000000) != 0) { local_8 = 0; FUN_00872a20(&local_1c,*(undefined4 *)(param_1 + 0x28),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086090e Catch@0086090e undefined4 Catch_0086090e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostNPCInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostNPCInit\" failed: %s\n",uVar2); } return 0x8608fa; } //@@ 00860960 FUN_00860960 bool FUN_00860960(int param_1) { int iVar1; undefined4 uVar2; int iVar3; uint uStack_40; void *local_20; int local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03cc0; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 8) & 0x20) != 0) { local_8 = 0; FUN_00872a20(&local_20,*(undefined4 *)(param_1 + 0x28),param_1); iVar3 = local_1c; if (local_1c != -1) { LuaRef::push(&local_20,local_20); iVar1 = lua_type(local_20,0xffffffff); lua_settop(local_20,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_20,local_20); uVar2 = lua_gettop(local_20); iVar3 = lua_toboolean(local_20,uVar2); lua_settop(local_20,0xfffffffe); luaL_unref(local_20,0xfff0b9d8,local_1c); ExceptionList = local_10; return iVar3 != 0; } } luaL_unref(local_20,0xfff0b9d8,iVar3); } ExceptionList = local_10; return false; } //@@ 00860a70 Catch@00860a70 undefined4 Catch_00860a70(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreNPCUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreNPCUpdate\" failed: %s\n",uVar2); } return 0x860a5a; } //@@ 00860ac0 NpcHelper::default_case_lua_callback /* DB: the NPC dispatcher's default block (006c41af, types with no native AI: 37, 70, 95, 103-109, 842 Nightwatch...) calls it when +0xb74 is clear; it only runs a Lua ref (FUN_00872a20 + luaL_unref) when the mod-callback flag is set (pass6_h5) */ void __fastcall NpcHelper::default_case_lua_callback(Entity_NPC *npc) { int in_stack_00000004; uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03ce0; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 1) != 0) { local_8 = 0; FUN_00872a20(&local_20,*(undefined4 *)(in_stack_00000004 + 0x28),in_stack_00000004); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 00860b4b Catch@00860b4b undefined4 Catch_00860b4b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostNPCUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostNPCUpdate\" failed: %s\n",uVar2); } return 0x860b37; } //@@ 00860ba0 FUN_00860ba0 void FUN_00860ba0(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03d00; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x10000000) != 0) { local_8 = 0; FUN_00872b10(&local_1c,*(undefined4 *)(param_1 + 0x28),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00860c36 Catch@00860c36 undefined4 Catch_00860c36(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostNPCRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostNPCRender\" failed: %s\n",uVar2); } return 0x860c22; } //@@ 00860c90 FUN_00860c90 void FUN_00860c90(int param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03d20; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x20000000) != 0) { local_8 = 0; FUN_00872a20(&local_20,*(undefined4 *)(param_1 + 0x28),param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 00860d1e Catch@00860d1e undefined4 Catch_00860d1e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostNPCDeath\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostNPCDeath\" failed: %s\n",uVar2); } return 0x860d0a; } //@@ 00860d70 LuaEngine::PreNPCCollision /* ZHL [exact] __thiscall int LuaEngine::PreNPCCollision(Entity_NPC* npc, Entity* collider, bool low); prototype: REPENTOGON, confirmed by RET 12 */ int __thiscall LuaEngine::PreNPCCollision(LuaEngine *this,Entity_NPC *npc,Entity *collider,byte low) { int iVar1; undefined4 uVar2; undefined3 in_stack_0000000d; uint uStack_3c; void *local_1c; int local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03d40; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x40000000) != 0) { local_8 = 0; FUN_00872c60(&local_1c,npc->_type,npc,collider,_low); if (local_18 != -1) { LuaRef::push(&local_1c,local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_1c,local_1c); uVar2 = lua_gettop(local_1c); iVar1 = lua_toboolean(local_1c,uVar2); lua_settop(local_1c,0xfffffffe); luaL_unref(local_1c,0xfff0b9d8,local_18); if (iVar1 == 0) { ExceptionList = local_10; return -1; } ExceptionList = local_10; return 1; } } luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return 0; } //@@ 00860ea3 Catch@00860ea3 undefined4 Catch_00860ea3(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreNPCCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreNPCCollision\" failed: %s\n",uVar2); } return 0x860e8d; } //@@ 00860f00 FUN_00860f00 void FUN_00860f00(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03d60; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 0x40) != 0) { local_8 = 0; FUN_00872da0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00860f8b Catch@00860f8b undefined4 Catch_00860f8b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostFamiliarUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostFamiliarUpdate\" failed: %s\n",uVar2); } return 0x860f77; } //@@ 00860fe0 FUN_00860fe0 void FUN_00860fe0(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03d80; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x2000000) != 0) { local_8 = 0; FUN_00872e90(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00861076 Catch@00861076 undefined4 Catch_00861076(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostFamiliarRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostFamiliarRender\" failed: %s\n",uVar2); } return 0x861062; } //@@ 008610d0 LuaEngine::PreFamiliarCollision /* ZHL [exact] __thiscall int LuaEngine::PreFamiliarCollision(Entity_Familiar* familiar, Entity* collider, bool low); */ undefined4 __thiscall LuaEngine::PreFamiliarCollision(undefined4 param_1,undefined4 param_2,int param_3) { void *luaState; undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined1 auStack_60 [4]; undefined4 uStack_5c; void *pvStack_58; undefined4 uStack_54; undefined4 uStack_50; void *pvStack_4c; undefined4 uStack_48; byte *pbStack_44; void *pvStack_40; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03da0; local_10 = ExceptionList; if ((**(uint **)g_luaEngine & 0x4000000) == 0) { return 0; } local_8 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); pvStack_40 = (void *)0x861126; ExceptionList = &local_10; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); pbStack_44 = (byte *)0x861146; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntityFamiliar; uStack_48 = 0xfff0b9d8; puVar1[1] = param_2; *puVar1 = luabridge::UserdataPtr::vftable; uStack_50 = 0x861162; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x86116e; pvStack_40 = luaState; lua_setmetatable(); if (param_3 == 0) { pvStack_40 = (void *)0x8611ad; lua_pushnil(); } else { pbStack_44 = (byte *)0x86117c; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntity; uStack_48 = 0xfff0b9d8; *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = param_3; uStack_50 = 0x861195; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x8611a1; pvStack_40 = luaState; lua_setmetatable(); } pbStack_44 = (byte *)0x8611bc; pvStack_40 = luaState; lua_pushboolean(); pbStack_44 = (byte *)0x0; uStack_48 = 0; pvStack_4c = (void *)0x0; uStack_50 = 1; uStack_54 = 5; uStack_5c = 0x8611cd; pvStack_58 = luaState; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(luaState,auStack_60); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar3 = FUN_00861225(); return uVar3; } //@@ 008611da Catch@008611da undefined4 Catch_008611da(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreFamiliarCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreFamiliarCollision\" failed: %s\n",uVar2); } return 0x8612f8; } //@@ 00861225 FUN_00861225 undefined4 FUN_00861225(void) { int iVar1; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x1c) = unaff_EDI; iVar1 = luaL_ref(); *(int *)(unaff_EBP + -0x18) = iVar1; lua_settop(); if (iVar1 != -1) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); iVar1 = lua_type(); lua_settop(); if (iVar1 != 0) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); lua_gettop(); iVar1 = lua_toboolean(); lua_settop(); luaL_unref(); if (iVar1 == 0) { ExceptionList = *(void **)(unaff_EBP + -0xc); return 0xffffffff; } ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } } luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } //@@ 0086130e FUN_0086130e void FUN_0086130e(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00861330 FUN_00861330 void FUN_00861330(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03dc0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x400000) != 0) { local_8 = 0; FUN_00872ff0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 008613bf Catch@008613bf undefined4 Catch_008613bf(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostEffectInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostEffectInit\" failed: %s\n",uVar2); } return 0x8613ab; } //@@ 00861410 FUN_00861410 void FUN_00861410(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03de0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x800000) != 0) { local_8 = 0; FUN_00872ff0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086149f Catch@0086149f undefined4 Catch_0086149f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostEffectUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostEffectUpdate\" failed: %s\n",uVar2); } return 0x86148b; } //@@ 008614f0 FUN_008614f0 void FUN_008614f0(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03e00; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x1000000) != 0) { local_8 = 0; FUN_008730e0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00861587 Catch@00861587 undefined4 Catch_00861587(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostEffectRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostEffectRender\" failed: %s\n",uVar2); } return 0x861573; } //@@ 008615e0 FUN_008615e0 void FUN_008615e0(int param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03e20; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x8000) != 0) { local_8 = 0; FUN_00873230(&local_20,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 0086166f Catch@0086166f undefined4 Catch_0086166f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostLaserInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostLaserInit\" failed: %s\n",uVar2); } return 0x86165b; } //@@ 008616c0 FUN_008616c0 void FUN_008616c0(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03e40; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x10000) != 0) { local_8 = 0; FUN_00873230(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086174f Catch@0086174f undefined4 Catch_0086174f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostLaserUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostLaserUpdate\" failed: %s\n",uVar2); } return 0x86173b; } //@@ 008617a0 FUN_008617a0 void FUN_008617a0(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03e60; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x20000) != 0) { local_8 = 0; FUN_00873320(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00861837 Catch@00861837 undefined4 Catch_00861837(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostLaserRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostLaserRender\" failed: %s\n",uVar2); } return 0x861823; } //@@ 00861890 LuaEngine::PostKnifeInit /* ZHL [exact] static __stdcall void LuaEngine::PostKnifeInit(Entity_Knife* knife); prototype: REPENTOGON, confirmed by RET 4 */ void LuaEngine::PostKnifeInit(Entity_Knife *knife) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03e80; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x40000) != 0) { local_8 = 0; FUN_00873470(&local_1c,knife->_subtype,knife); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086191f Catch@0086191f undefined4 Catch_0086191f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostKnifeInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostKnifeInit\" failed: %s\n",uVar2); } return 0x86190b; } //@@ 00861970 FUN_00861970 void FUN_00861970(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03ea0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x80000) != 0) { local_8 = 0; FUN_00873470(&local_1c,*(undefined4 *)(param_1 + 0x30),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 008619ff Catch@008619ff undefined4 Catch_008619ff(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostKnifeUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostKnifeUpdate\" failed: %s\n",uVar2); } return 0x8619eb; } //@@ 00861a50 FUN_00861a50 void FUN_00861a50(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; void *luaState; undefined4 *puVar3; int iVar4; undefined1 auStack_78 [4]; undefined4 uStack_74; void *pvStack_70; void *pvStack_6c; undefined4 uStack_68; byte *pbStack_64; void *pvStack_60; undefined *puStack_5c; void *pvStack_58; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b03ec0; local_1c = ExceptionList; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x100000) == 0) { return; } local_14 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); uVar1 = *param_2; uVar2 = param_2[1]; pvStack_58 = (void *)0x861ad4; ExceptionList = &local_1c; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); puStack_5c = (undefined *)0x861af4; pvStack_58 = luaState; puVar3 = (undefined4 *)lua_newuserdata(); puStack_5c = &DAT_00c829e0; pvStack_60 = (void *)0xfff0b9d8; *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = param_1; uStack_68 = 0x861b11; pbStack_64 = luaState; lua_rawgetp(); puStack_5c = (undefined *)0x861b1f; pvStack_58 = luaState; lua_setmetatable(); puStack_5c = (undefined *)0x10; pbStack_64 = (byte *)0x861b26; pvStack_60 = luaState; puVar3 = (undefined4 *)lua_newuserdata(); pbStack_64 = &g_luaClassKeyVector; uStack_68 = 0xfff0b9d8; *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; pvStack_70 = (void *)0x861b47; pvStack_6c = luaState; lua_rawgetp(); puStack_5c = (undefined *)0x861b51; pvStack_58 = luaState; lua_setmetatable(); puVar3 = (undefined4 *)puVar3[1]; puStack_5c = (undefined *)0x0; pvStack_60 = (void *)0x0; pbStack_64 = (byte *)0x0; uStack_68 = 1; *puVar3 = uVar1; pvStack_6c = (void *)0x4; puVar3[1] = uVar2; uStack_74 = 0x861b7b; pvStack_70 = luaState; iVar4 = lua_pcallk(); if (iVar4 != 0) { FUN_0085c080(luaState,auStack_78); /* WARNING: Subroutine does not return */ FUN_008727d0(); } FUN_00861bda(); return; } //@@ 00861b88 Catch@00861b88 undefined4 Catch_00861b88(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x30); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostKnifeRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostKnifeRender\" failed: %s\n",uVar2); } return 0x861c0a; } //@@ 00861bda FUN_00861bda void FUN_00861bda(void) { int unaff_EBP; lua_pushvalue(); luaL_ref(); lua_settop(); luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00861c23 FUN_00861c23 void FUN_00861c23(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00861c40 LuaEngine::PreKnifeCollision /* ZHL [exact] __thiscall int LuaEngine::PreKnifeCollision(Entity_Knife* knife, Entity* collider, bool low); */ undefined4 __thiscall LuaEngine::PreKnifeCollision(undefined4 param_1,undefined4 param_2,int param_3) { void *luaState; undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined1 auStack_60 [4]; undefined4 uStack_5c; void *pvStack_58; undefined4 uStack_54; undefined4 uStack_50; void *pvStack_4c; undefined4 uStack_48; byte *pbStack_44; void *pvStack_40; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03ee0; local_10 = ExceptionList; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x200000) == 0) { return 0; } local_8 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); pvStack_40 = (void *)0x861c97; ExceptionList = &local_10; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); pbStack_44 = (byte *)0x861cb7; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &DAT_00c829e0; uStack_48 = 0xfff0b9d8; puVar1[1] = param_2; *puVar1 = luabridge::UserdataPtr::vftable; uStack_50 = 0x861cd3; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x861cdf; pvStack_40 = luaState; lua_setmetatable(); if (param_3 == 0) { pvStack_40 = (void *)0x861d1e; lua_pushnil(); } else { pbStack_44 = (byte *)0x861ced; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntity; uStack_48 = 0xfff0b9d8; *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = param_3; uStack_50 = 0x861d06; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x861d12; pvStack_40 = luaState; lua_setmetatable(); } pbStack_44 = (byte *)0x861d2d; pvStack_40 = luaState; lua_pushboolean(); pbStack_44 = (byte *)0x0; uStack_48 = 0; pvStack_4c = (void *)0x0; uStack_50 = 1; uStack_54 = 5; uStack_5c = 0x861d3e; pvStack_58 = luaState; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(luaState,auStack_60); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar3 = FUN_00861d96(); return uVar3; } //@@ 00861d4b Catch@00861d4b undefined4 Catch_00861d4b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreKnifeCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreKnifeCollision\" failed: %s\n",uVar2); } return 0x861e69; } //@@ 00861d96 FUN_00861d96 undefined4 FUN_00861d96(void) { int iVar1; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x1c) = unaff_EDI; iVar1 = luaL_ref(); *(int *)(unaff_EBP + -0x18) = iVar1; lua_settop(); if (iVar1 != -1) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); iVar1 = lua_type(); lua_settop(); if (iVar1 != 0) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); lua_gettop(); iVar1 = lua_toboolean(); lua_settop(); luaL_unref(); if (iVar1 == 0) { ExceptionList = *(void **)(unaff_EBP + -0xc); return 0xffffffff; } ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } } luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } //@@ 00861e7f FUN_00861e7f void FUN_00861e7f(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00861ea0 FUN_00861ea0 void FUN_00861ea0(int param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03f00; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x2000000) != 0) { local_8 = 0; FUN_00873560(&local_20,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 00861f2f Catch@00861f2f undefined4 Catch_00861f2f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostBombInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostBombInit\" failed: %s\n",uVar2); } return 0x861f1b; } //@@ 00861f80 FUN_00861f80 void FUN_00861f80(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03f20; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x4000000) != 0) { local_8 = 0; FUN_00873560(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086200f Catch@0086200f undefined4 Catch_0086200f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostBombUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostBombUpdate\" failed: %s\n",uVar2); } return 0x861ffb; } //@@ 00862060 FUN_00862060 void FUN_00862060(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; void *luaState; undefined4 *puVar3; int iVar4; undefined1 auStack_78 [4]; undefined4 uStack_74; void *pvStack_70; void *pvStack_6c; undefined4 uStack_68; byte *pbStack_64; void *pvStack_60; undefined *puStack_5c; void *pvStack_58; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b03f40; local_1c = ExceptionList; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x8000000) == 0) { return; } local_14 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); uVar1 = *param_2; uVar2 = param_2[1]; pvStack_58 = (void *)0x8620e4; ExceptionList = &local_1c; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); puStack_5c = (undefined *)0x862104; pvStack_58 = luaState; puVar3 = (undefined4 *)lua_newuserdata(); puStack_5c = &DAT_00c829da; pvStack_60 = (void *)0xfff0b9d8; *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = param_1; uStack_68 = 0x862121; pbStack_64 = luaState; lua_rawgetp(); puStack_5c = (undefined *)0x86212f; pvStack_58 = luaState; lua_setmetatable(); puStack_5c = (undefined *)0x10; pbStack_64 = (byte *)0x862136; pvStack_60 = luaState; puVar3 = (undefined4 *)lua_newuserdata(); pbStack_64 = &g_luaClassKeyVector; uStack_68 = 0xfff0b9d8; *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; pvStack_70 = (void *)0x862157; pvStack_6c = luaState; lua_rawgetp(); puStack_5c = (undefined *)0x862161; pvStack_58 = luaState; lua_setmetatable(); puVar3 = (undefined4 *)puVar3[1]; puStack_5c = (undefined *)0x0; pvStack_60 = (void *)0x0; pbStack_64 = (byte *)0x0; uStack_68 = 1; *puVar3 = uVar1; pvStack_6c = (void *)0x4; puVar3[1] = uVar2; uStack_74 = 0x86218b; pvStack_70 = luaState; iVar4 = lua_pcallk(); if (iVar4 != 0) { FUN_0085c080(luaState,auStack_78); /* WARNING: Subroutine does not return */ FUN_008727d0(); } FUN_008621ea(); return; } //@@ 00862198 Catch@00862198 undefined4 Catch_00862198(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x30); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostBombRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostBombRender\" failed: %s\n",uVar2); } return 0x86221a; } //@@ 008621ea FUN_008621ea void FUN_008621ea(void) { int unaff_EBP; lua_pushvalue(); luaL_ref(); lua_settop(); luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00862233 FUN_00862233 void FUN_00862233(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00862250 LuaEngine::PreBombCollision /* ZHL [exact] __thiscall int LuaEngine::PreBombCollision(Entity_Bomb* bomb, Entity* collider, bool low); */ undefined4 __thiscall LuaEngine::PreBombCollision(undefined4 param_1,undefined4 param_2,int param_3) { void *luaState; undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined1 auStack_60 [4]; undefined4 uStack_5c; void *pvStack_58; undefined4 uStack_54; undefined4 uStack_50; void *pvStack_4c; undefined4 uStack_48; byte *pbStack_44; void *pvStack_40; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03f60; local_10 = ExceptionList; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x10000000) == 0) { return 0; } local_8 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); pvStack_40 = (void *)0x8622a7; ExceptionList = &local_10; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); pbStack_44 = (byte *)0x8622c7; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &DAT_00c829da; uStack_48 = 0xfff0b9d8; puVar1[1] = param_2; *puVar1 = luabridge::UserdataPtr::vftable; uStack_50 = 0x8622e3; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x8622ef; pvStack_40 = luaState; lua_setmetatable(); if (param_3 == 0) { pvStack_40 = (void *)0x86232e; lua_pushnil(); } else { pbStack_44 = (byte *)0x8622fd; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntity; uStack_48 = 0xfff0b9d8; *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = param_3; uStack_50 = 0x862316; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x862322; pvStack_40 = luaState; lua_setmetatable(); } pbStack_44 = (byte *)0x86233d; pvStack_40 = luaState; lua_pushboolean(); pbStack_44 = (byte *)0x0; uStack_48 = 0; pvStack_4c = (void *)0x0; uStack_50 = 1; uStack_54 = 5; uStack_5c = 0x86234e; pvStack_58 = luaState; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(luaState,auStack_60); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar3 = FUN_008623a6(); return uVar3; } //@@ 0086235b Catch@0086235b undefined4 Catch_0086235b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreBombCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreBombCollision\" failed: %s\n",uVar2); } return 0x862479; } //@@ 008623a6 FUN_008623a6 undefined4 FUN_008623a6(void) { int iVar1; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x1c) = unaff_EDI; iVar1 = luaL_ref(); *(int *)(unaff_EBP + -0x18) = iVar1; lua_settop(); if (iVar1 != -1) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); iVar1 = lua_type(); lua_settop(); if (iVar1 != 0) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); lua_gettop(); iVar1 = lua_toboolean(); lua_settop(); luaL_unref(); if (iVar1 == 0) { ExceptionList = *(void **)(unaff_EBP + -0xc); return 0xffffffff; } ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } } luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } //@@ 0086248f FUN_0086248f void FUN_0086248f(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 008624b0 FUN_008624b0 void FUN_008624b0(int param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03f80; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x800) != 0) { local_8 = 0; FUN_00873650(&local_20,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 0086253f Catch@0086253f undefined4 Catch_0086253f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostProjectileInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostProjectileInit\" failed: %s\n",uVar2); } return 0x86252b; } //@@ 00862590 FUN_00862590 void FUN_00862590(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03fa0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x1000) != 0) { local_8 = 0; FUN_00873650(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086261f Catch@0086261f undefined4 Catch_0086261f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostProjectileUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostProjectileUpdate\" failed: %s\n",uVar2); } return 0x86260b; } //@@ 00862670 FUN_00862670 void FUN_00862670(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03fc0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x2000) != 0) { local_8 = 0; FUN_00873740(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00862707 Catch@00862707 undefined4 Catch_00862707(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostProjectileRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostProjectileRender\" failed: %s\n",uVar2); } return 0x8626f3; } //@@ 00862760 LuaEngine::PreProjectileCollision /* ZHL [exact] __thiscall int LuaEngine::PreProjectileCollision(Entity_Projectile* proj, Entity* collider, bool low); */ undefined4 __thiscall LuaEngine::PreProjectileCollision(undefined4 param_1,undefined4 param_2,int param_3) { void *luaState; undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined1 auStack_60 [4]; undefined4 uStack_5c; void *pvStack_58; undefined4 uStack_54; undefined4 uStack_50; void *pvStack_4c; undefined4 uStack_48; byte *pbStack_44; void *pvStack_40; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b03fe0; local_10 = ExceptionList; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x4000) == 0) { return 0; } local_8 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); pvStack_40 = (void *)0x8627b7; ExceptionList = &local_10; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); pbStack_44 = (byte *)0x8627d7; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &DAT_00c829d4; uStack_48 = 0xfff0b9d8; puVar1[1] = param_2; *puVar1 = luabridge::UserdataPtr::vftable; uStack_50 = 0x8627f3; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x8627ff; pvStack_40 = luaState; lua_setmetatable(); if (param_3 == 0) { pvStack_40 = (void *)0x86283e; lua_pushnil(); } else { pbStack_44 = (byte *)0x86280d; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntity; uStack_48 = 0xfff0b9d8; *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = param_3; uStack_50 = 0x862826; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x862832; pvStack_40 = luaState; lua_setmetatable(); } pbStack_44 = (byte *)0x86284d; pvStack_40 = luaState; lua_pushboolean(); pbStack_44 = (byte *)0x0; uStack_48 = 0; pvStack_4c = (void *)0x0; uStack_50 = 1; uStack_54 = 5; uStack_5c = 0x86285e; pvStack_58 = luaState; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(luaState,auStack_60); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar3 = FUN_008628b6(); return uVar3; } //@@ 0086286b Catch@0086286b undefined4 Catch_0086286b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreProjectileCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreProjectileCollision\" failed: %s\n",uVar2); } return 0x862989; } //@@ 008628b6 FUN_008628b6 undefined4 FUN_008628b6(void) { int iVar1; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x1c) = unaff_EDI; iVar1 = luaL_ref(); *(int *)(unaff_EBP + -0x18) = iVar1; lua_settop(); if (iVar1 != -1) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); iVar1 = lua_type(); lua_settop(); if (iVar1 != 0) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); lua_gettop(); iVar1 = lua_toboolean(); lua_settop(); luaL_unref(); if (iVar1 == 0) { ExceptionList = *(void **)(unaff_EBP + -0xc); return 0xffffffff; } ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } } luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } //@@ 0086299f FUN_0086299f void FUN_0086299f(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 008629c0 FUN_008629c0 void FUN_008629c0(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04000; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 4) & 0x80) != 0) { local_8 = 0; FUN_00873890(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00862a4c Catch@00862a4c undefined4 Catch_00862a4c(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostTearInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostTearInit\" failed: %s\n",uVar2); } return 0x862a38; } //@@ 00862aa0 FUN_00862aa0 void FUN_00862aa0(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04020; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x100) != 0) { local_8 = 0; FUN_00873890(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00862b2f Catch@00862b2f undefined4 Catch_00862b2f(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostTearUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostTearUpdate\" failed: %s\n",uVar2); } return 0x862b1b; } //@@ 00862b80 FUN_00862b80 void FUN_00862b80(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; void *luaState; undefined4 *puVar3; int iVar4; undefined1 auStack_78 [4]; undefined4 uStack_74; void *pvStack_70; void *pvStack_6c; undefined4 uStack_68; byte *pbStack_64; void *pvStack_60; byte *pbStack_5c; void *pvStack_58; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b04040; local_1c = ExceptionList; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x200) == 0) { return; } local_14 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); uVar1 = *param_2; uVar2 = param_2[1]; pvStack_58 = (void *)0x862c04; ExceptionList = &local_1c; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); pbStack_5c = (byte *)0x862c24; pvStack_58 = luaState; puVar3 = (undefined4 *)lua_newuserdata(); pbStack_5c = &g_luaClassKeyEntityTear; pvStack_60 = (void *)0xfff0b9d8; *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = param_1; uStack_68 = 0x862c41; pbStack_64 = luaState; lua_rawgetp(); pbStack_5c = (byte *)0x862c4f; pvStack_58 = luaState; lua_setmetatable(); pbStack_5c = (byte *)0x10; pbStack_64 = (byte *)0x862c56; pvStack_60 = luaState; puVar3 = (undefined4 *)lua_newuserdata(); pbStack_64 = &g_luaClassKeyVector; uStack_68 = 0xfff0b9d8; *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; pvStack_70 = (void *)0x862c77; pvStack_6c = luaState; lua_rawgetp(); pbStack_5c = (byte *)0x862c81; pvStack_58 = luaState; lua_setmetatable(); puVar3 = (undefined4 *)puVar3[1]; pbStack_5c = (byte *)0x0; pvStack_60 = (void *)0x0; pbStack_64 = (byte *)0x0; uStack_68 = 1; *puVar3 = uVar1; pvStack_6c = (void *)0x4; puVar3[1] = uVar2; uStack_74 = 0x862cab; pvStack_70 = luaState; iVar4 = lua_pcallk(); if (iVar4 != 0) { FUN_0085c080(luaState,auStack_78); /* WARNING: Subroutine does not return */ FUN_008727d0(); } FUN_00862d0a(); return; } //@@ 00862cb8 Catch@00862cb8 undefined4 Catch_00862cb8(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x30); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostTearRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostTearRender\" failed: %s\n",uVar2); } return 0x862d3a; } //@@ 00862d0a FUN_00862d0a void FUN_00862d0a(void) { int unaff_EBP; lua_pushvalue(); luaL_ref(); lua_settop(); luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00862d53 FUN_00862d53 void FUN_00862d53(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00862d70 LuaEngine::PreTearCollision /* ZHL [exact] __thiscall int LuaEngine::PreTearCollision(Entity_Tear* tear, Entity* collider, bool low); prototype: REPENTOGON, confirmed by RET 12 */ int __thiscall LuaEngine::PreTearCollision(LuaEngine *this,Entity_Tear *tear,Entity *collider,byte low) { int iVar1; undefined4 uVar2; undefined3 in_stack_0000000d; uint uStack_3c; void *local_1c; int local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04060; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x400) != 0) { local_8 = 0; FUN_00873980(&local_1c,tear->_variant,tear,collider,_low); if (local_18 != -1) { LuaRef::push(&local_1c,local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_1c,local_1c); uVar2 = lua_gettop(local_1c); iVar1 = lua_toboolean(local_1c,uVar2); lua_settop(local_1c,0xfffffffe); luaL_unref(local_1c,0xfff0b9d8,local_18); if (iVar1 == 0) { ExceptionList = local_10; return -1; } ExceptionList = local_10; return 1; } } luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return 0; } //@@ 00862ea4 Catch@00862ea4 undefined4 Catch_00862ea4(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreTearCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreTearCollision\" failed: %s\n",uVar2); } return 0x862e8e; } //@@ 00862f00 FUN_00862f00 void FUN_00862f00(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04080; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 4) & 4) != 0) { local_8 = 0; FUN_00873ac0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00862f8c Catch@00862f8c undefined4 Catch_00862f8c(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPickupInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPickupInit\" failed: %s\n",uVar2); } return 0x862f78; } //@@ 00862fe0 FUN_00862fe0 void FUN_00862fe0(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b040a0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 4) & 8) != 0) { local_8 = 0; FUN_00873ac0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086306c Catch@0086306c undefined4 Catch_0086306c(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPickupUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPickupUpdate\" failed: %s\n",uVar2); } return 0x863058; } //@@ 008630c0 FUN_008630c0 void FUN_008630c0(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b040c0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 4) & 0x10) != 0) { local_8 = 0; FUN_00873bb0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00863154 Catch@00863154 undefined4 Catch_00863154(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPickupRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPickupRender\" failed: %s\n",uVar2); } return 0x863140; } //@@ 008631b0 LuaEngine::PrePickupCollision /* ZHL [exact] __thiscall int LuaEngine::PrePickupCollision(Entity_Pickup* pickup, Entity* collider, bool low); prototype: REPENTOGON, confirmed by RET 12 */ int __thiscall LuaEngine::PrePickupCollision(LuaEngine *this,Entity_Pickup *pickup,Entity *collider,byte low) { int iVar1; undefined4 uVar2; undefined3 in_stack_0000000d; uint uStack_3c; void *local_1c; int local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b040e0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 4) & 0x40) != 0) { local_8 = 0; FUN_00873d00(&local_1c,pickup->_variant,pickup,collider,_low); if (local_18 != -1) { LuaRef::push(&local_1c,local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_1c,local_1c); uVar2 = lua_gettop(local_1c); iVar1 = lua_toboolean(local_1c,uVar2); lua_settop(local_1c,0xfffffffe); luaL_unref(local_1c,0xfff0b9d8,local_18); if (iVar1 == 0) { ExceptionList = local_10; return -1; } ExceptionList = local_10; return 1; } } luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return 0; } //@@ 008632e1 Catch@008632e1 undefined4 Catch_008632e1(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PrePickupCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PrePickupCollision\" failed: %s\n",uVar2); } return 0x8632cb; } //@@ 00863340 lua_callback_run_post_pickup_selection /* DB: ? from Entity_Pickup::Init with (pickup, &variant, &subtype): returns early unless the Lua engine has the callback flag 0x20, calls the mod callback and when it returns a table (lua_type 5) casts its two ints back into variant/subtype (MC_POST_PICKUP_SELECTION behaviour) */ void lua_callback_run_post_pickup_selection (undefined4 param_1,undefined4 *param_2,undefined4 *param_3) { int iVar1; undefined4 uVar2; undefined4 uVar3; code *pcVar4; uint uStack_48; void *local_1c; int local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04100; local_10 = ExceptionList; uStack_48 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_48; if ((*(byte *)(*(int *)g_luaEngine + 4) & 0x20) == 0) { return; } local_8 = 0; ExceptionList = &local_10; FUN_00873e40(&local_1c,g_luaEngine,param_1,*param_2,*param_3); if (local_18 != -1) { LuaRef::push(&local_1c,local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); if (iVar1 == 5) { FUN_0085bfd0(); uVar2 = luaL_ref(local_1c,0xfff0b9d8); FUN_0085c270(local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); luaL_unref(local_1c,0xfff0b9d8,uVar2); if (iVar1 != 0) { FUN_0085bfd0(); uVar2 = luaL_ref(local_1c,0xfff0b9d8); uVar3 = luabridge::LuaRef::Proxy::cast(); *param_2 = uVar3; luaL_unref(local_1c,0xfff0b9d8,uVar2); } FUN_0085bfd0(); uVar2 = luaL_ref(local_1c,0xfff0b9d8); FUN_0085c270(local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); pcVar4 = luaL_unref_exref; luaL_unref(local_1c,0xfff0b9d8,uVar2); if (iVar1 != 0) { FUN_0085bfd0(); uVar2 = luaL_ref(local_1c,0xfff0b9d8); uVar3 = luabridge::LuaRef::Proxy::cast(); *param_3 = uVar3; luaL_unref(local_1c,0xfff0b9d8,uVar2); } goto LAB_00863529; } } pcVar4 = luaL_unref_exref; LAB_00863529: (*pcVar4)(local_1c,0xfff0b9d8,local_18); ExceptionList = local_10; return; } //@@ 0086354b Catch@0086354b undefined4 Catch_0086354b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPickupSelection\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPickupSelection\" failed: %s\n",uVar2); } return 0x863537; } //@@ 008635a0 FUN_008635a0 void FUN_008635a0(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04120; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 0x80) != 0) { local_8 = 0; FUN_00872da0(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 0086362b Catch@0086362b undefined4 Catch_0086362b(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostFamiliarInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostFamiliarInit\" failed: %s\n",uVar2); } return 0x863617; } //@@ 00863680 LuaEngine::PostRender /* ZHL [exact] static __stdcall void LuaEngine::PostRender(); prototype: REPENTOGON, confirmed by RET 0 */ void LuaEngine::PostRender(void) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04140; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 4) != 0) { local_8 = 0; FUN_00872980(&local_1c,g_luaEngine); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00863706 Catch@00863706 undefined4 Catch_00863706(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostRender\" failed: %s\n",uVar2); } return 0x8636f4; } //@@ 00863760 LuaEngine::PreUseItem /* ZHL [exact] __thiscall bool LuaEngine::PreUseItem(int collectibleType, RNG* rng, Entity_Player* player, unsigned int useFlags, int activeSlot, int customVarData); prototype: REPENTOGON, confirmed by RET 24 */ byte __thiscall LuaEngine::PreUseItem (LuaEngine *this,int collectibleType,RNG *rng,Entity_Player *player,uint useFlags, int activeSlot,int customVarData) { int iVar1; undefined4 uVar2; int iVar3; uint uStack_3c; void *local_1c; int local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04160; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x800000) != 0) { local_8 = 0; LuaCallbackCaller::CallUseItem (&local_1c,g_luaEngine,collectibleType,rng,player,useFlags,activeSlot,customVarData); iVar3 = local_18; if (local_18 != -1) { LuaRef::push(&local_1c,local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_1c,local_1c); uVar2 = lua_gettop(local_1c); iVar3 = lua_toboolean(local_1c,uVar2); lua_settop(local_1c,0xfffffffe); luaL_unref(local_1c,0xfff0b9d8,local_18); ExceptionList = local_10; return iVar3 != 0; } } luaL_unref(local_1c,0xfff0b9d8,iVar3); } ExceptionList = local_10; return 0; } //@@ 00863879 Catch@00863879 undefined4 Catch_00863879(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreUseItem\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreUseItem\" failed: %s\n",uVar2); } return 0x863863; } //@@ 008638d0 LuaEngine::UseItem /* ZHL [exact] __thiscall bool LuaEngine::UseItem(int collectibleType, RNG* rng, Entity_Player* player, unsigned int useFlags, int activeSlot, int customVarData, short* resultFlags); prototype: REPENTOGON, confirmed by RET 28 */ byte __thiscall LuaEngine::UseItem(LuaEngine *this,int collectibleType,RNG *rng,Entity_Player *player,uint useFlags, int activeSlot,int customVarData,short *resultFlags) { char cVar1; undefined1 uVar2; int iVar3; undefined4 uVar4; int iVar5; uint uStack_4c; void *local_20; int local_1c; undefined1 local_16; byte local_15; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04180; local_10 = ExceptionList; uStack_4c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_4c; ExceptionList = &local_10; local_15 = 0; local_16 = 0; if ((**(byte **)g_luaEngine & 8) != 0) { local_8 = 0; LuaCallbackCaller::CallUseItem (&local_20,g_luaEngine,collectibleType,rng,player,useFlags,activeSlot,customVarData); iVar5 = local_1c; if (local_1c != -1) { LuaRef::push(&local_20,local_20); iVar3 = lua_type(local_20,0xffffffff); lua_settop(local_20,0xfffffffe); if (iVar3 != 0) { cVar1 = FUN_0085c340(); if (cVar1 == '\0') { local_15 = FUN_00872820(); } else { lua_pushstring(local_20,"Discharge"); uVar4 = luaL_ref(local_20,0xfff0b9d8); cVar1 = FUN_0085c2d0(); luaL_unref(local_20,0xfff0b9d8,uVar4); if (cVar1 == '\0') { lua_pushstring(local_20,"Discharge"); uVar4 = luaL_ref(local_20,0xfff0b9d8); uVar2 = FUN_008bb130(); *(undefined1 *)resultFlags = uVar2; luaL_unref(local_20,0xfff0b9d8,uVar4); } lua_pushstring(local_20,"Remove"); uVar4 = luaL_ref(local_20,0xfff0b9d8); cVar1 = FUN_0085c2d0(); luaL_unref(local_20,0xfff0b9d8,uVar4); if (cVar1 == '\0') { lua_pushstring(local_20,"Remove"); uVar4 = luaL_ref(local_20,0xfff0b9d8); uVar2 = FUN_008bb130(); *(undefined1 *)((int)resultFlags + 1) = uVar2; luaL_unref(local_20,0xfff0b9d8,uVar4); } lua_pushstring(local_20,"ShowAnim"); uVar4 = luaL_ref(local_20,0xfff0b9d8); cVar1 = FUN_0085c2d0(); luaL_unref(local_20,0xfff0b9d8,uVar4); if (cVar1 == '\0') { lua_pushstring(local_20,"ShowAnim"); uVar4 = luaL_ref(local_20,0xfff0b9d8); local_15 = FUN_008bb130(); luaL_unref(local_20,0xfff0b9d8,uVar4); } iVar5 = local_1c; } } } luaL_unref(local_20,0xfff0b9d8,iVar5); } ExceptionList = local_10; return local_15; } //@@ 00863b6a Catch@00863b6a undefined * Catch_00863b6a(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostUseItem\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostUseItem\" failed: %s\n",uVar2); } return &UNK_00863bb5; } //@@ 00863be0 FUN_00863be0 void FUN_00863be0(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b041a0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 0x10) != 0) { local_8 = 0; FUN_00874120(&local_1c,*(undefined4 *)(param_1 + 0x13c0),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00863c6e Catch@00863c6e undefined4 Catch_00863c6e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPlayerEffectUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPlayerEffectUpdate\" failed: %s\n",uVar2); } return 0x863c5a; } //@@ 00863cc0 FUN_00863cc0 void FUN_00863cc0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b041c0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(byte **)g_luaEngine & 0x20) != 0) { local_8 = 0; FUN_00874210(&local_1c,g_luaEngine,param_1,param_2,param_3); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00863d4e Catch@00863d4e undefined4 Catch_00863d4e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostUseCard\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostUseCard\" failed: %s\n",uVar2); } return 0x863d3a; } //@@ 00863da0 LuaEngine::UsePill /* ZHL [exact] __thiscall void LuaEngine::UsePill(int pillEffect, Entity_Player* player, unsigned int useFlags); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall LuaEngine::UsePill(LuaEngine *this,int pillEffect,Entity_Player *player,uint useFlags) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b041e0; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x400) != 0) { local_8 = 0; FUN_00874210(&local_20,g_luaEngine,pillEffect,player,useFlags); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 00863e31 Catch@00863e31 undefined4 Catch_00863e31(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostUsePillEffect\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostUsePillEffect\" failed: %s\n",uVar2); } return 0x863e1d; } //@@ 00863e90 LuaEngine::EvaluateItems /* ZHL [exact] __thiscall void LuaEngine::EvaluateItems(Entity_Player *player, int cacheFlag); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall LuaEngine::EvaluateItems(LuaEngine *this,Entity_Player *player,int cacheFlag) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04200; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x100) != 0) { local_8 = 0; FUN_00874310(&local_1c,g_luaEngine,player,cacheFlag); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00863f1e Catch@00863f1e undefined4 Catch_00863f1e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostEvaluateItems\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostEvaluateItems\" failed: %s\n",uVar2); } return 0x863f0a; } //@@ 00863f70 lua_callback_run_post_fire_tear /* DB: if callback mask word +4 bit 29 (callback 61 = MC_POST_FIRE_TEAR) is set on *g_luaEngine runs it with the tear (FUN_00873890) and unrefs the result; callers Entity_Player::FireTear and fire_fetus_tear */ void lua_callback_run_post_fire_tear(undefined4 param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04220; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x20000000) != 0) { local_8 = 0; FUN_00873890(&local_20,g_luaEngine,param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 00863fff Catch@00863fff undefined4 Catch_00863fff(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostFireTear\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostFireTear\" failed: %s\n",uVar2); } return 0x863feb; } //@@ 00864050 LuaEngine::PostPlayerInit /* ZHL [exact] static __stdcall void LuaEngine::PostPlayerInit(Entity_Player* player); prototype: REPENTOGON, confirmed by RET 4 */ void LuaEngine::PostPlayerInit(Entity_Player *player) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04240; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x200) != 0) { local_8 = 0; FUN_00874120(&local_1c,player->_variant,player); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 008640de Catch@008640de undefined4 Catch_008640de(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPlayerInit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPlayerInit\" failed: %s\n",uVar2); } return 0x8640ca; } //@@ 00864130 FUN_00864130 void FUN_00864130(int param_1) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04260; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if (**(int **)g_luaEngine < 0) { local_8 = 0; FUN_00874120(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 008641bb Catch@008641bb undefined4 Catch_008641bb(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPlayerUpdate\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPlayerUpdate\" failed: %s\n",uVar2); } return 0x8641a7; } //@@ 00864210 FUN_00864210 void FUN_00864210(int param_1,undefined4 *param_2) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04280; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((*(byte *)(*(int *)g_luaEngine + 4) & 1) != 0) { local_8 = 0; FUN_00874400(&local_1c,*(undefined4 *)(param_1 + 0x2c),param_1,*param_2,param_2[1]); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 008642a4 Catch@008642a4 undefined4 Catch_008642a4(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostPlayerRender\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostPlayerRender\" failed: %s\n",uVar2); } return 0x864290; } //@@ 00864300 LuaEngine::PrePlayerCollide /* ZHL [exact] __thiscall int LuaEngine::PrePlayerCollide(Entity_Player* player, Entity* collider, bool low); */ undefined4 __thiscall LuaEngine::PrePlayerCollide(undefined4 param_1,undefined4 param_2,int param_3) { void *luaState; undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined1 auStack_60 [4]; undefined4 uStack_5c; void *pvStack_58; undefined4 uStack_54; undefined4 uStack_50; void *pvStack_4c; undefined4 uStack_48; byte *pbStack_44; void *pvStack_40; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b042a0; local_10 = ExceptionList; if ((*(byte *)(*(int *)g_luaEngine + 4) & 2) == 0) { return 0; } local_8 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); pvStack_40 = (void *)0x864354; ExceptionList = &local_10; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); pbStack_44 = (byte *)0x864374; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntityPlayer; uStack_48 = 0xfff0b9d8; puVar1[1] = param_2; *puVar1 = luabridge::UserdataPtr::vftable; uStack_50 = 0x864390; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x86439c; pvStack_40 = luaState; lua_setmetatable(); if (param_3 == 0) { pvStack_40 = (void *)0x8643db; lua_pushnil(); } else { pbStack_44 = (byte *)0x8643aa; pvStack_40 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_44 = &g_luaClassKeyEntity; uStack_48 = 0xfff0b9d8; *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = param_3; uStack_50 = 0x8643c3; pvStack_4c = luaState; lua_rawgetp(); pbStack_44 = (byte *)0x8643cf; pvStack_40 = luaState; lua_setmetatable(); } pbStack_44 = (byte *)0x8643ea; pvStack_40 = luaState; lua_pushboolean(); pbStack_44 = (byte *)0x0; uStack_48 = 0; pvStack_4c = (void *)0x0; uStack_50 = 1; uStack_54 = 5; uStack_5c = 0x8643fb; pvStack_58 = luaState; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(luaState,auStack_60); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar3 = FUN_00864453(); return uVar3; } //@@ 00864408 Catch@00864408 undefined4 Catch_00864408(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PrePlayerCollision\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PrePlayerCollision\" failed: %s\n",uVar2); } return 0x864526; } //@@ 00864453 FUN_00864453 undefined4 FUN_00864453(void) { int iVar1; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x1c) = unaff_EDI; iVar1 = luaL_ref(); *(int *)(unaff_EBP + -0x18) = iVar1; lua_settop(); if (iVar1 != -1) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); iVar1 = lua_type(); lua_settop(); if (iVar1 != 0) { LuaRef::push((void *)(unaff_EBP + -0x1c),unaff_EDI); lua_gettop(); iVar1 = lua_toboolean(); lua_settop(); luaL_unref(); if (iVar1 == 0) { ExceptionList = *(void **)(unaff_EBP + -0xc); return 0xffffffff; } ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } } luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } //@@ 0086453c FUN_0086453c void FUN_0086453c(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00864560 LuaEngine::EntityTakeDamage /* ZHL [exact] __thiscall bool LuaEngine::EntityTakeDamage(Entity* entity, float damage, unsigned long long damageFlags, EntityRef* source, int damageCountdown); prototype: REPENTOGON, confirmed by RET 20 */ byte __thiscall LuaEngine::EntityTakeDamage (LuaEngine *this,Entity *entity,float damage,ulonglong damageFlags,EntityRef *source, int damageCountdown) { void *luaState; int iVar1; undefined4 uVar2; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b042c0; local_10 = ExceptionList; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x800) != 0) { local_8 = 0; FUN_00874550(&damageFlags,entity->_type,entity,damage,damageFlags,source,damageCountdown); iVar3 = damageFlags._4_4_; luaState = (void *)damageFlags; if (damageFlags._4_4_ != -1) { LuaRef::push(&damageFlags,(void *)damageFlags); iVar1 = lua_type(luaState,0xffffffff); lua_settop(luaState,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&damageFlags,luaState); uVar2 = lua_gettop(luaState); iVar3 = lua_toboolean(luaState,uVar2); lua_settop(luaState,0xfffffffe); luaL_unref(luaState,0xfff0b9d8,damageFlags._4_4_); ExceptionList = local_10; return iVar3 != 0; } } luaL_unref(luaState,0xfff0b9d8,iVar3); } ExceptionList = local_10; return 1; } //@@ 00864682 Catch@00864682 undefined4 Catch_00864682(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreEntityTakeDamage\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreEntityTakeDamage\" failed: %s\n",uVar2); } return 0x86466c; } //@@ 008646e0 lua_callback_run_pre_entity_spawn /* DB: args type,variant,pos,vel,spawner,subtype,seed; returns table override prototype: db/protos.zhl, confirmed by RET 28 */ void lua_callback_run_pre_entity_spawn (int *type,int *variant,Vector *position,Vector *velocity,Entity *spawner, int *subType,uint *seed) { int iVar1; undefined4 uVar2; uint uVar3; void *pvVar4; uint uStack_58; void *local_30; int local_2c; undefined1 *puStack_24; undefined1 *local_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_24 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b042e0; local_1c = ExceptionList; uStack_58 = __security_cookie ^ (int)register0x00000010 - 0x10U; local_20 = (undefined1 *)&uStack_58; ExceptionList = &local_1c; if ((**(uint **)g_luaEngine & 0x1000000) != 0) { local_14 = 0; luabridge::LuaRef::call (&local_30,g_luaEngine,*type,*variant,*subType,spawner,*seed,position->x,position->y, velocity->x,velocity->y); pvVar4 = local_30; if (local_2c != -1) { LuaRef::push(&local_30,local_30); iVar1 = lua_type(pvVar4,0xffffffff); lua_settop(pvVar4,0xfffffffe); if (iVar1 == 5) { FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); pvVar4 = local_30; FUN_0085c270(local_30); iVar1 = lua_type(pvVar4,0xffffffff); lua_settop(local_30,0xfffffffe); pvVar4 = local_30; luaL_unref(local_30,0xfff0b9d8,uVar2); if (iVar1 != 0) { FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); iVar1 = luabridge::LuaRef::Proxy::cast(); *type = iVar1; luaL_unref(pvVar4,0xfff0b9d8,uVar2); } FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); pvVar4 = local_30; FUN_0085c270(local_30); iVar1 = lua_type(pvVar4,0xffffffff); lua_settop(local_30,0xfffffffe); pvVar4 = local_30; luaL_unref(local_30,0xfff0b9d8,uVar2); if (iVar1 != 0) { FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); iVar1 = luabridge::LuaRef::Proxy::cast(); *variant = iVar1; luaL_unref(pvVar4,0xfff0b9d8,uVar2); } FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); pvVar4 = local_30; FUN_0085c270(local_30); iVar1 = lua_type(pvVar4,0xffffffff); lua_settop(local_30,0xfffffffe); pvVar4 = local_30; luaL_unref(local_30,0xfff0b9d8,uVar2); if (iVar1 != 0) { FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); iVar1 = luabridge::LuaRef::Proxy::cast(); *subType = iVar1; luaL_unref(pvVar4,0xfff0b9d8,uVar2); } FUN_0085bfd0(); uVar2 = luaL_ref(pvVar4,0xfff0b9d8); pvVar4 = local_30; FUN_0085c270(local_30); iVar1 = lua_type(pvVar4,0xffffffff); lua_settop(local_30,0xfffffffe); luaL_unref(local_30,0xfff0b9d8,uVar2); pvVar4 = local_30; if (iVar1 != 0) { FUN_0085bfd0(); uVar2 = luaL_ref(local_30,0xfff0b9d8); uVar3 = luabridge::LuaRef::Proxy::cast(); *seed = uVar3; luaL_unref(local_30,0xfff0b9d8,uVar2); } } } luaL_unref(pvVar4,0xfff0b9d8,local_2c); } ExceptionList = local_1c; return; } //@@ 00864a6a Catch@00864a6a undefined * Catch_00864a6a(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x24); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreEntitySpawn\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreEntitySpawn\" failed: %s\n",uVar2); } return &UNK_00864abc; } //@@ 00864ae0 FUN_00864ae0 undefined4 FUN_00864ae0(undefined4 param_1) { int iVar1; undefined4 uVar2; uint uStack_40; void *local_20; int local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04300; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x1000) != 0) { local_8 = 0; FUN_00874860(&local_20,g_luaEngine,param_1); if (local_1c != -1) { LuaRef::push(&local_20,local_20); iVar1 = lua_type(local_20,0xffffffff); lua_settop(local_20,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_20,local_20); uVar2 = lua_gettop(local_20); param_1 = luaL_checkinteger(local_20,uVar2); lua_settop(local_20,0xfffffffe); } } luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return param_1; } //@@ 00864bb8 Catch@00864bb8 undefined * Catch_00864bb8(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostCurseEval\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostCurseEval\" failed: %s\n",uVar2); } return &UNK_00864c03; } //@@ 00864c30 lua_run_input_action_callback /* DB: if the callback mask (*g_luaEngine & 0x2000) has MC_INPUT_ACTION, calls LuaCallbackCaller::CallInputAction(entity,hook,action), and if the Lua return is non-nil writes its boolean to *param_4 and returns 1 (override); callers input_is_action_pressed/triggered, Console::Update prototype: db/protos.zhl, confirmed by RET 16 */ byte lua_run_input_action_callback(Entity *entity,int hook,int action,byte *outValue) { int iVar1; undefined4 uVar2; byte bVar3; uint uStack_44; void *local_20; int local_1c; undefined1 local_15; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04320; local_10 = ExceptionList; uStack_44 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_44; ExceptionList = &local_10; bVar3 = 0; local_15 = 0; if ((**(uint **)g_luaEngine & 0x2000) != 0) { local_8 = 0; LuaCallbackCaller::CallInputAction(&local_20,g_luaEngine,entity,hook,action); bVar3 = 0; if (local_1c != -1) { LuaRef::push(&local_20,local_20); iVar1 = lua_type(local_20,0xffffffff); lua_settop(local_20,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_20,local_20); uVar2 = lua_gettop(local_20); iVar1 = lua_toboolean(local_20,uVar2); bVar3 = 1; lua_settop(local_20,0xfffffffe); *outValue = iVar1 != 0; } } luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return bVar3; } //@@ 00864d16 Catch@00864d16 undefined * Catch_00864d16(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreActionHookB\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreActionHookB\" failed: %s\n",uVar2); } return &UNK_00864d61; } //@@ 00864d80 FUN_00864d80 undefined1 FUN_00864d80(undefined4 param_1,undefined4 param_2,undefined4 param_3,float *param_4) { int iVar1; undefined4 uVar2; undefined1 uVar3; float10 fVar4; uint uStack_44; void *local_20; int local_1c; undefined1 local_15; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04340; local_10 = ExceptionList; uStack_44 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_44; ExceptionList = &local_10; uVar3 = 0; local_15 = 0; if ((**(uint **)g_luaEngine & 0x2000) != 0) { local_8 = 0; LuaCallbackCaller::CallInputAction(&local_20,g_luaEngine,param_1,2,param_3); uVar3 = 0; if (local_1c != -1) { LuaRef::push(&local_20,local_20); iVar1 = lua_type(local_20,0xffffffff); lua_settop(local_20,0xfffffffe); if (iVar1 != 0) { uVar3 = 1; LuaRef::push(&local_20,local_20); uVar2 = lua_gettop(local_20); fVar4 = (float10)luaL_checknumber(local_20,uVar2); lua_settop(local_20,0xfffffffe); *param_4 = (float)fVar4; } } luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return uVar3; } //@@ 00864e6d Catch@00864e6d undefined * Catch_00864e6d(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreActionHookF\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreActionHookF\" failed: %s\n",uVar2); } return &UNK_00864eb8; } //@@ 00864ee0 LuaEngine::PostGameStart /* ZHL [exact] static __stdcall void LuaEngine::PostGameStart(unsigned int state); prototype: REPENTOGON, confirmed by RET 4 */ void LuaEngine::PostGameStart(uint state) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04360; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x8000) != 0) { local_8 = 0; FUN_00874a10(&local_20,g_luaEngine,state); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 00864f6e Catch@00864f6e undefined4 Catch_00864f6e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostGameStart\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostGameStart\" failed: %s\n",uVar2); } return 0x864f5a; } //@@ 00864fc0 FUN_00864fc0 void FUN_00864fc0(undefined4 param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04380; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x10000) != 0) { local_8 = 0; FUN_00874a10(&local_20,g_luaEngine,param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 0086504e Catch@0086504e undefined4 Catch_0086504e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostGameEnd\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostGameEnd\" failed: %s\n",uVar2); } return 0x86503a; } //@@ 008650a0 FUN_008650a0 void FUN_008650a0(undefined4 param_1) { uint uStack_40; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b043a0; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x20000) != 0) { local_8 = 0; FUN_00874a10(&local_20,g_luaEngine,param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 0086512e Catch@0086512e undefined4 Catch_0086512e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreGameExit\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreGameExit\" failed: %s\n",uVar2); } return 0x86511a; } //@@ 00865180 FUN_00865180 void FUN_00865180(void) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b043c0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x80000) != 0) { local_8 = 0; FUN_00872980(&local_1c,g_luaEngine); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 00865209 Catch@00865209 undefined4 Catch_00865209(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostRoomLoad\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostRoomLoad\" failed: %s\n",uVar2); } return 0x8651f7; } //@@ 00865260 FUN_00865260 void FUN_00865260(void) { uint uStack_3c; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b043e0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x40000) != 0) { local_8 = 0; FUN_00872980(&local_1c,g_luaEngine); luaL_unref(local_1c,0xfff0b9d8,local_18); } ExceptionList = local_10; return; } //@@ 008652e9 Catch@008652e9 undefined4 Catch_008652e9(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostLevelLoad\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostLevelLoad\" failed: %s\n",uVar2); } return 0x8652d7; } //@@ 00865340 lua_callback_run_get_card /* DB: MC_GET_CARD-style: (rng,card,playing,runes,onlyRunes) after ItemPool::GetCard, returns int override prototype: db/protos.zhl, confirmed by RET 20 */ int lua_callback_run_get_card(RNG *rng,int card,byte isPlaying,byte isRunes,byte isOnlyRunes) { int iVar1; undefined4 uVar2; undefined3 in_stack_0000000d; undefined3 in_stack_00000011; undefined3 in_stack_00000015; uint uStack_40; void *local_20; int local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04400; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; if ((**(uint **)g_luaEngine & 0x100000) != 0) { local_8 = 0; FUN_00874ac0(&local_20,g_luaEngine,rng,card,_isPlaying,_isRunes,_isOnlyRunes); if (local_1c != -1) { LuaRef::push(&local_20,local_20); iVar1 = lua_type(local_20,0xffffffff); lua_settop(local_20,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_20,local_20); uVar2 = lua_gettop(local_20); card = luaL_checkinteger(local_20,uVar2); lua_settop(local_20,0xfffffffe); } } luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return card; } //@@ 00865424 Catch@00865424 undefined * Catch_00865424(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"GetCard\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"GetCard\" failed: %s\n",uVar2); } return &UNK_0086546f; } //@@ 00865490 lua_callback_run_get_shader_params /* DB: callback bit 0x200000 (21 MC_GET_SHADER_PARAMS) of the LuaEngine mask: runs the callback with the shader name string and returns the result as a table LuaRef (lua_type 5); caller Game::render_mod_shaders */ undefined4 * lua_callback_run_get_shader_params(undefined4 *param_1,void *param_2) { uint *puVar1; undefined4 *this; int iVar2; undefined4 uVar3; undefined4 extraout_ECX; int iVar4; void *luaState; char acStack_5c [4]; void *pvStack_58; void *pvStack_54; void *pvStack_50; void *pvStack_4c; uint uStack_44; void *local_28; int local_24; undefined4 local_1c; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0442d; local_10 = ExceptionList; uStack_44 = __security_cookie ^ (uint)(acStack_5c + 0x58); local_14 = (undefined1 *)&uStack_44; ExceptionList = &local_10; iVar4 = -1; local_24 = -1; luaState = *(void **)((int)g_luaEngine + 0x18); local_8 = 0; local_28 = luaState; puVar1 = &uStack_44; if ((**(uint **)g_luaEngine & 0x200000) != 0) { local_8 = 1; std::string::string(acStack_5c,param_2); this = (undefined4 *)FUN_00874bd0(&local_1c,extraout_ECX); pvStack_4c = (void *)0xfff0b9d8; pvStack_54 = (void *)0x865522; pvStack_50 = luaState; luaL_unref(); pvStack_4c = (void *)0x86552d; LuaRef::push(this,luaState); luaState = (void *)*this; pvStack_50 = (void *)0x86553e; pvStack_4c = luaState; local_28 = luaState; iVar4 = luaL_ref(); pvStack_50 = (void *)local_18; pvStack_54 = (void *)0xfff0b9d8; pvStack_58 = (void *)local_1c; acStack_5c[0] = 'P'; acStack_5c[1] = 'U'; acStack_5c[2] = -0x7a; acStack_5c[3] = '\0'; local_24 = iVar4; luaL_unref(); puVar1 = (uint *)local_14; if (iVar4 != -1) { pvStack_4c = (void *)0x865565; LuaRef::push(&local_28,luaState); pvStack_50 = (void *)0x86556e; pvStack_4c = luaState; iVar2 = lua_type(); pvStack_50 = (void *)0xfffffffe; pvStack_58 = (void *)0x865579; pvStack_54 = luaState; lua_settop(); puVar1 = (uint *)local_14; if (iVar2 == 5) { *param_1 = luaState; pvStack_4c = (void *)0x865593; LuaRef::push(&local_28,luaState); pvStack_50 = (void *)0x86559f; pvStack_4c = luaState; uVar3 = luaL_ref(); pvStack_54 = (void *)0xfff0b9d8; param_1[1] = uVar3; acStack_5c[0] = -0x51; acStack_5c[1] = 'U'; acStack_5c[2] = -0x7a; acStack_5c[3] = '\0'; pvStack_58 = luaState; pvStack_50 = (void *)iVar4; luaL_unref(); ExceptionList = local_10; return param_1; } } } local_14 = (undefined1 *)puVar1; *param_1 = luaState; if (iVar4 == -1) { uVar3 = 0xffffffff; } else { pvStack_4c = (void *)0x86561b; LuaRef::push(&local_28,luaState); pvStack_50 = (void *)0x865627; pvStack_4c = luaState; uVar3 = luaL_ref(); } pvStack_4c = (void *)0xfff0b9d8; param_1[1] = uVar3; pvStack_54 = (void *)0x86563f; pvStack_50 = luaState; luaL_unref(); ExceptionList = local_10; return param_1; } //@@ 008655b7 Catch@008655b7 undefined * Catch_008655b7(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"GetShaderParams\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"GetShaderParams\" failed: %s\n",uVar2); } return &UNK_00865602; } //@@ 00865660 FUN_00865660 char * FUN_00865660(char *param_1,undefined4 *param_2) { undefined4 *puVar1; byte bVar2; void *pvVar3; uint uVar4; int iVar5; byte *pbVar6; byte *pbVar7; code *pcVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar3 = g_luaEngine; puStack_c = &LAB_00b0446e; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; local_8 = 0; puVar1 = param_2 + 4; if (0xf < (uint)param_2[5]) { param_2 = (undefined4 *)*param_2; } iVar5 = luaL_loadbufferx(*(undefined4 *)((int)pvVar3 + 0x18),param_2,*puVar1,&DAT_00b6ff54,0,uVar4 ); if (iVar5 == 0) { iVar5 = lua_pcallk(*(undefined4 *)((int)pvVar3 + 0x18),0,1,0,0,0); if (iVar5 == 0) { iVar5 = lua_type(*(undefined4 *)((int)pvVar3 + 0x18),0xffffffff); if (iVar5 != 0) { pbVar6 = (byte *)luaL_tolstring(*(undefined4 *)((int)pvVar3 + 0x18),0xffffffff,0); pbVar7 = pbVar6; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); std::string::assign(param_1,pbVar6,(int)pbVar7 - (int)(pbVar6 + 1)); } pcVar8 = lua_settop_exref; goto LAB_00865798; } pbVar6 = (byte *)lua_tolstring(*(undefined4 *)((int)pvVar3 + 0x18),0xffffffff,0); pbVar7 = pbVar6; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); } else { pbVar6 = (byte *)lua_tolstring(*(undefined4 *)((int)pvVar3 + 0x18),0xffffffff); pbVar7 = pbVar6; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); } std::string::assign(param_1,pbVar6,(int)pbVar7 - (int)(pbVar6 + 1)); pcVar8 = lua_settop_exref; lua_settop(*(undefined4 *)((int)pvVar3 + 0x18),0xfffffffe); LAB_00865798: (*pcVar8)(*(undefined4 *)((int)pvVar3 + 0x18),0); ExceptionList = local_10; return param_1; } //@@ 008657c0 FUN_008657c0 void FUN_008657c0(void) { int iVar1; bool bVar2; bool bVar3; void *pvVar4; int iVar5; int iVar6; int iVar7; pvVar4 = g_luaEngine; iVar5 = lua_gc(*(undefined4 *)((int)g_luaEngine + 0x18),3,0); iVar6 = *(int *)((int)pvVar4 + 0x58); if (*(int *)((int)pvVar4 + 0x58) < 0) { iVar6 = iVar5; } iVar7 = 0; *(int *)((int)pvVar4 + (*(int *)((int)pvVar4 + 0x50) % 10) * 4 + 0x28) = iVar5 - iVar6; iVar6 = *(int *)((int)pvVar4 + 0x50) + 1; *(int *)((int)pvVar4 + 0x58) = iVar5; iVar5 = 0; *(int *)((int)pvVar4 + 0x50) = iVar6; bVar3 = true; do { iVar1 = *(int *)((int)pvVar4 + ((iVar6 + iVar5) % 10) * 4 + 0x28); iVar7 = iVar7 + iVar1; bVar2 = false; if (-1 < iVar1) { bVar2 = bVar3; } iVar5 = iVar5 + 1; bVar3 = bVar2; } while (iVar5 < 10); if ((bVar2) && (0 < iVar7)) { *(undefined4 *)((int)pvVar4 + 0x54) = 600; iVar6 = *(int *)((int)pvVar4 + 0x24) + iVar7 / 10; iVar5 = 10000; if (iVar6 < 10000) { iVar5 = iVar6; } } else { if (0 < *(int *)((int)pvVar4 + 0x54)) { *(int *)((int)pvVar4 + 0x54) = *(int *)((int)pvVar4 + 0x54) + -1; iVar6 = *(int *)((int)pvVar4 + 0x24); goto LAB_008658aa; } iVar6 = *(int *)((int)pvVar4 + 0x24) / 100; if (iVar6 < 10) { iVar6 = 10; } iVar5 = *(int *)((int)pvVar4 + 0x24) - iVar6; } iVar6 = 0x32; if (0x32 < iVar5) { iVar6 = iVar5; } *(int *)((int)pvVar4 + 0x24) = iVar6; LAB_008658aa: lua_gc(*(undefined4 *)((int)pvVar4 + 0x18),5,iVar6); return; } //@@ 008658c0 FUN_008658c0 undefined4 FUN_008658c0(undefined4 param_1,undefined4 *param_2) { void *luaState; undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *puVar4; int iVar5; undefined4 uVar6; undefined1 auStack_78 [4]; undefined4 uStack_74; void *pvStack_70; undefined4 uStack_6c; undefined4 uStack_68; void *pvStack_64; undefined4 uStack_60; undefined *puStack_5c; void *pvStack_58; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b04490; local_1c = ExceptionList; if ((*(byte *)(*(int *)g_luaEngine + 8) & 4) == 0) { return 0; } local_14 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); uVar6 = *param_2; uVar1 = param_2[1]; uVar2 = param_2[2]; uVar3 = param_2[3]; pvStack_58 = (void *)0x86592d; ExceptionList = &local_1c; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); FUN_0085bfd0(); puStack_5c = (undefined *)0x865954; pvStack_58 = luaState; puVar4 = (undefined4 *)lua_newuserdata(); puStack_5c = &DAT_00c82995; uStack_60 = 0xfff0b9d8; *puVar4 = luabridge::UserdataValue::vftable; puVar4[1] = puVar4 + 2; uStack_68 = 0x865973; pvStack_64 = luaState; lua_rawgetp(); puStack_5c = (undefined *)0x86597f; pvStack_58 = luaState; lua_setmetatable(); puVar4 = (undefined4 *)puVar4[1]; puStack_5c = (undefined *)0x0; uStack_60 = 0; pvStack_64 = (void *)0x0; uStack_68 = 1; uStack_6c = 4; *puVar4 = uVar6; puVar4[1] = uVar1; puVar4[2] = uVar2; puVar4[3] = uVar3; uStack_74 = 0x86599a; pvStack_70 = luaState; iVar5 = lua_pcallk(); if (iVar5 != 0) { FUN_0085c080(luaState,auStack_78); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar6 = FUN_00865a04(); return uVar6; } //@@ 008659a7 Catch@008659a7 undefined * Catch_008659a7(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x34); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"GetTrinket\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"GetTrinket\" failed: %s\n",uVar2); } return &UNK_008659f9; } //@@ 00865a04 FUN_00865a04 undefined4 FUN_00865a04(void) { int iVar1; undefined4 uVar2; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x28) = unaff_EDI; iVar1 = luaL_ref(); *(int *)(unaff_EBP + -0x24) = iVar1; lua_settop(); if (iVar1 != -1) { LuaRef::push((void *)(unaff_EBP + -0x28),unaff_EDI); iVar1 = lua_type(); lua_settop(); if (iVar1 != 0) { LuaRef::push((void *)(unaff_EBP + -0x28),unaff_EDI); lua_gettop(); uVar2 = luaL_checkinteger(); lua_settop(); goto LAB_00865a83; } } uVar2 = 0; LAB_00865a83: luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return uVar2; } //@@ 00865aad FUN_00865aad void FUN_00865aad(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00865ad0 LuaEngine::GetPillEffect /* ZHL [exact] static __stdcall int LuaEngine::GetPillEffect(int pillEffect, int pillColor); */ undefined4 LuaEngine::GetPillEffect(void) { void *luaState; int iVar1; undefined4 uVar2; undefined1 auStack_5c [12]; undefined4 uStack_50; void *pvStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b044b0; local_10 = ExceptionList; if ((*(byte *)(*(int *)g_luaEngine + 8) & 2) == 0) { return 0xffffffff; } local_8 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); uStack_3c = 0x865b24; ExceptionList = &local_10; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); FUN_0085bfd0(); FUN_0085bfd0(); uStack_3c = 0; uStack_40 = 0; uStack_44 = 1; uStack_48 = 4; uStack_50 = 0x865b5c; pvStack_4c = luaState; iVar1 = lua_pcallk(); if (iVar1 != 0) { FUN_0085c080(luaState,auStack_5c); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar2 = FUN_00865bbc(); return uVar2; } //@@ 00865b69 Catch@00865b69 undefined * Catch_00865b69(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"GetPillEffect\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"GetPillEffect\" failed: %s\n",uVar2); } return &UNK_00865bb4; } //@@ 00865bbc FUN_00865bbc undefined4 FUN_00865bbc(void) { undefined4 uVar1; int iVar2; undefined4 unaff_EBX; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x18) = unaff_EDI; uVar1 = luaL_ref(); *(undefined4 *)(unaff_EBP + -0x14) = uVar1; lua_settop(); if (*(int *)(unaff_EBP + -0x14) != -1) { LuaRef::push((void *)(unaff_EBP + -0x18),unaff_EDI); iVar2 = lua_type(); lua_settop(); if (iVar2 != 0) { LuaRef::push((void *)(unaff_EBP + -0x18),unaff_EDI); lua_gettop(); unaff_EBX = luaL_checkinteger(); lua_settop(); } } luaL_unref(); ExceptionList = *(void **)(unaff_EBP + -0xc); return unaff_EBX; } //@@ 00865c61 FUN_00865c61 void FUN_00865c61(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00865c80 FUN_00865c80 undefined4 FUN_00865c80(undefined4 param_1,undefined4 param_2) { int iVar1; undefined4 uVar2; uint uStack_44; void *local_24; int local_20; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b044d0; local_10 = ExceptionList; uStack_44 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_44; ExceptionList = &local_10; uVar2 = 0; local_18 = 0; if ((*(byte *)(*(int *)g_luaEngine + 8) & 1) != 0) { local_8 = 0; FUN_00874d20(&local_24,g_luaEngine,param_2); if (local_20 != -1) { LuaRef::push(&local_24,local_24); iVar1 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_24,local_24); uVar2 = lua_gettop(local_24); uVar2 = luaL_checkinteger(local_24,uVar2); lua_settop(local_24,0xfffffffe); } } luaL_unref(local_24,0xfff0b9d8,local_20); } ExceptionList = local_10; return uVar2; } //@@ 00865d53 Catch@00865d53 undefined * Catch_00865d53(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x18); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"GetPill\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"GetPill\" failed: %s\n",uVar2); } return &UNK_00865d9e; } //@@ 00865dc0 FUN_00865dc0 undefined4 FUN_00865dc0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int iVar1; undefined4 uVar2; uint uStack_40; void *local_24; int local_20; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b044f0; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; uVar2 = 0; local_18 = 0; if ((*(uint *)(*(int *)g_luaEngine + 4) & 0x40000000) != 0) { local_8 = 0; FUN_00874dd0(&local_24,g_luaEngine,param_1,param_2,param_3); if (local_20 != -1) { LuaRef::push(&local_24,local_24); iVar1 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_24,local_24); uVar2 = lua_gettop(local_24); uVar2 = luaL_checkinteger(local_24,uVar2); lua_settop(local_24,0xfffffffe); } } luaL_unref(local_24,0xfff0b9d8,local_20); } ExceptionList = local_10; return uVar2; } //@@ 00865e99 Catch@00865e99 undefined * Catch_00865e99(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x18); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreGetCollectible\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreGetCollectible\" failed: %s\n",uVar2); } return &UNK_00865ee4; } //@@ 00865f10 FUN_00865f10 undefined4 FUN_00865f10(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int iVar1; undefined4 uVar2; uint uStack_40; void *local_24; int local_20; undefined4 local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04510; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; uVar2 = 0; local_18 = 0; if (*(int *)(*(int *)g_luaEngine + 4) < 0) { local_8 = 0; FUN_00874e90(&local_24,g_luaEngine,param_1,param_2,param_3,param_4); if (local_20 != -1) { LuaRef::push(&local_24,local_24); iVar1 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_24,local_24); uVar2 = lua_gettop(local_24); uVar2 = luaL_checkinteger(local_24,uVar2); lua_settop(local_24,0xfffffffe); } } luaL_unref(local_24,0xfff0b9d8,local_20); } ExceptionList = local_10; return uVar2; } //@@ 00865fe8 Catch@00865fe8 undefined * Catch_00865fe8(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x18); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostGetCollectible\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostGetCollectible\" failed: %s\n",uVar2); } return &UNK_00866033; } //@@ 00866060 Entity::ReleaseLuaRef /* DB: luaL_unref of entity's lua object on remove when lua enabled */ void Entity::ReleaseLuaRef(Entity *param_1) { uint uStack_40; undefined4 local_30; undefined4 local_2c; int local_28; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04530; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; local_2c = 0x43; local_30 = *(undefined4 *)((int)g_luaEngine + 0x10); local_28 = param_1->_type; if ((*(byte *)(*(int *)g_luaEngine + 8) & 8) != 0) { local_8 = 0; lua_callback_run_entity(&local_30,&local_20,local_28,param_1); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 008660ec Catch@008660ec undefined4 Catch_008660ec(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostEntityRemove\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostEntityRemove\" failed: %s\n",uVar2); } return 0x8660d8; } //@@ 00866140 LuaEngine::PostEntityKill /* ZHL [exact] static __stdcall void LuaEngine::PostEntityKill(Entity* ent); prototype: REPENTOGON, confirmed by RET 4 */ void LuaEngine::PostEntityKill(Entity *ent) { uint uStack_40; undefined4 local_30; undefined4 local_2c; int local_28; undefined4 local_20; undefined4 local_1c; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04550; local_10 = ExceptionList; uStack_40 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_40; ExceptionList = &local_10; local_2c = 0x44; local_30 = *(undefined4 *)((int)g_luaEngine + 0x10); local_28 = ent->_type; if ((*(byte *)(*(int *)g_luaEngine + 8) & 0x10) != 0) { local_8 = 0; lua_callback_run_entity(&local_30,&local_20,local_28,ent); luaL_unref(local_20,0xfff0b9d8,local_1c); } ExceptionList = local_10; return; } //@@ 008661cc Catch@008661cc undefined4 Catch_008661cc(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x20); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PostEntityKill\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PostEntityKill\" failed: %s\n",uVar2); } return 0x8661b8; } //@@ 00866220 FUN_00866220 uint FUN_00866220(undefined4 *param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; void *luaState; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 *puVar7; int iVar8; uint uVar9; byte *pbStack_90; void *pvStack_8c; undefined4 uStack_88; void *pvStack_84; undefined4 uStack_80; void *pvStack_7c; undefined4 uStack_78; undefined *puStack_74; void *pvStack_70; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b04570; local_1c = ExceptionList; if ((*(byte *)(*(int *)g_luaEngine + 8) & 0x40) == 0) { return (uint)(*(int *)g_luaEngine + 8) & 0xffffff00; } local_14 = 0; luaState = (void *)**(undefined4 **)((int)g_luaEngine + 0x10); uVar1 = *param_2; uVar2 = param_2[1]; uVar3 = *param_1; uVar4 = param_1[1]; uVar5 = param_1[2]; uVar6 = param_1[3]; pvStack_70 = (void *)0x8662a7; ExceptionList = &local_1c; LuaRef::push(*(undefined4 **)((int)g_luaEngine + 0x10),luaState); FUN_0085bfd0(); FUN_0085bfd0(); puStack_74 = (undefined *)0x8662c6; pvStack_70 = luaState; puVar7 = (undefined4 *)lua_newuserdata(); puStack_74 = &DAT_00c82995; uStack_78 = 0xfff0b9d8; *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; uStack_80 = 0x8662e5; pvStack_7c = luaState; lua_rawgetp(); uStack_80 = 0xfffffffe; uStack_88 = 0x8662f0; pvStack_84 = luaState; lua_setmetatable(); puVar7 = (undefined4 *)puVar7[1]; uStack_88 = 0x10; *puVar7 = uVar3; puVar7[1] = uVar4; puVar7[2] = uVar5; puVar7[3] = uVar6; pbStack_90 = (byte *)0x866305; pvStack_8c = luaState; puVar7 = (undefined4 *)lua_newuserdata(); pbStack_90 = &g_luaClassKeyVector; *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(luaState,0xfff0b9d8); lua_setmetatable(luaState,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; *puVar7 = uVar1; puVar7[1] = uVar2; iVar8 = lua_pcallk(luaState,4,1,0,0,0); if (iVar8 != 0) { FUN_0085c080(luaState,&pbStack_90); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar9 = FUN_008663b6(); return uVar9; } //@@ 00866364 Catch@00866364 undefined4 Catch_00866364(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x34); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreRoomRewardSpawn\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreRoomRewardSpawn\" failed: %s\n",uVar2); } return 0x866459; } //@@ 008663b6 FUN_008663b6 undefined1 FUN_008663b6(void) { undefined1 uVar1; int iVar2; int unaff_EBP; void *unaff_EDI; lua_pushvalue(); *(void **)(unaff_EBP + -0x30) = unaff_EDI; iVar2 = luaL_ref(); *(int *)(unaff_EBP + -0x2c) = iVar2; lua_settop(); if (iVar2 != -1) { LuaRef::push((void *)(unaff_EBP + -0x30),unaff_EDI); iVar2 = lua_type(); lua_settop(); if (iVar2 != 0) { LuaRef::push((void *)(unaff_EBP + -0x30),unaff_EDI); lua_gettop(); iVar2 = lua_toboolean(); *(bool *)(unaff_EBP + -0x19) = iVar2 != 0; lua_settop(); luaL_unref(); uVar1 = *(undefined1 *)(unaff_EBP + -0x19); goto LAB_0086645e; } } luaL_unref(); uVar1 = 0; LAB_0086645e: ExceptionList = *(void **)(unaff_EBP + -0xc); return uVar1; } //@@ 00866474 FUN_00866474 void FUN_00866474(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00866490 LuaEngine::Callback_PreEntitySpawn /* ZHL [prefix49/56] static __stdcall void LuaEngine::Callback_PreEntitySpawn(int* type, int* variant, Vector* position, Vector* velocity, Entity* spawner, int* subType, uint32_t* seed); */ undefined1 LuaEngine::Callback_PreEntitySpawn (undefined4 *param_1,undefined2 *param_2,undefined2 *param_3,undefined4 param_4, undefined4 param_5) { undefined2 uVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; code *pcVar5; uint uStack_50; void *local_24; int local_20; undefined1 local_1a; undefined1 local_19; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04590; local_10 = ExceptionList; uStack_50 = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_50; local_19 = 0; local_1a = 0; if ((*(byte *)(*(int *)g_luaEngine + 8) & 0x80) == 0) { return 0; } local_8 = 0; ExceptionList = &local_10; FUN_00875050(&local_24,*param_3,*param_1,*param_2,*param_3,param_4,param_5); if (local_20 != -1) { LuaRef::push(&local_24,local_24); iVar2 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); if (iVar2 == 5) { FUN_0085bfd0(); uVar3 = luaL_ref(local_24,0xfff0b9d8); FUN_0085c270(local_24); iVar2 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); luaL_unref(local_24,0xfff0b9d8,uVar3); if (iVar2 != 0) { FUN_0085bfd0(); uVar3 = luaL_ref(local_24,0xfff0b9d8); uVar4 = luabridge::LuaRef::Proxy::cast(); *param_1 = uVar4; luaL_unref(local_24,0xfff0b9d8,uVar3); local_19 = 1; } FUN_0085bfd0(); uVar3 = luaL_ref(local_24,0xfff0b9d8); FUN_0085c270(local_24); iVar2 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); luaL_unref(local_24,0xfff0b9d8,uVar3); if (iVar2 != 0) { FUN_0085bfd0(); uVar3 = luaL_ref(local_24,0xfff0b9d8); uVar1 = luabridge::LuaRef::Proxy::cast(); *param_2 = uVar1; luaL_unref(local_24,0xfff0b9d8,uVar3); local_19 = 1; } FUN_0085bfd0(); uVar3 = luaL_ref(local_24,0xfff0b9d8); FUN_0085c270(local_24); iVar2 = lua_type(local_24,0xffffffff); lua_settop(local_24,0xfffffffe); pcVar5 = luaL_unref_exref; luaL_unref(local_24,0xfff0b9d8,uVar3); if (iVar2 != 0) { FUN_0085bfd0(); uVar3 = luaL_ref(local_24,0xfff0b9d8); uVar1 = luabridge::LuaRef::Proxy::cast(); *param_3 = uVar1; luaL_unref(local_24,0xfff0b9d8,uVar3); local_19 = 1; } goto LAB_00866739; } } pcVar5 = luaL_unref_exref; LAB_00866739: (*pcVar5)(local_24,0xfff0b9d8,local_20); ExceptionList = local_10; return local_19; } //@@ 0086675e Catch@0086675e undefined * Catch_0086675e(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x24); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreRoomEntitySpawn\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreRoomEntitySpawn\" failed: %s\n",uVar2); } return &UNK_008667a9; } //@@ 008667d0 FUN_008667d0 bool FUN_008667d0(Entity *param_1) { int iVar1; undefined4 uVar2; int iVar3; uint uStack_3c; undefined4 local_2c; undefined4 local_28; int local_24; void *local_1c; int local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b045b0; local_10 = ExceptionList; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_14 = (undefined1 *)&uStack_3c; ExceptionList = &local_10; local_28 = 0x48; local_2c = *(undefined4 *)((int)g_luaEngine + 0x10); local_24 = param_1->_type; if ((*(uint *)(*(int *)g_luaEngine + 8) & 0x100) != 0) { local_8 = 0; lua_callback_run_entity(&local_2c,&local_1c,local_24,param_1); iVar3 = local_18; if (local_18 != -1) { LuaRef::push(&local_1c,local_1c); iVar1 = lua_type(local_1c,0xffffffff); lua_settop(local_1c,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&local_1c,local_1c); uVar2 = lua_gettop(local_1c); iVar3 = lua_toboolean(local_1c,uVar2); lua_settop(local_1c,0xfffffffe); luaL_unref(local_1c,0xfff0b9d8,local_18); ExceptionList = local_10; return iVar3 != 0; } } luaL_unref(local_1c,0xfff0b9d8,iVar3); } ExceptionList = local_10; return false; } //@@ 008668e0 Catch@008668e0 undefined4 Catch_008668e0(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; Console *pCVar3; piVar1 = *(int **)(unaff_EBP + -0x1c); (**(code **)(*piVar1 + 4))(); KAGE_LogMessage(1,(byte *)"Error in \"PreEntityDevolve\" call: %s\n"); if (g_game != (Game *)0x0) { pCVar3 = &g_game->_console; uVar2 = (**(code **)(*piVar1 + 4))(); FUN_00693180(pCVar3,0xfff08080,"\"PreEntityDevolve\" failed: %s\n",uVar2); } return 0x8668ca; } //@@ 00866960 LuaEngine::RegisterAPI /* DB: registers the Lua API (LUA_REG in build.sh; references "UseActiveItem" etc.) */ void LuaEngine::RegisterAPI(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 *puVar3; int in_ECX; undefined1 local_150 [8]; undefined1 local_148 [8]; undefined1 local_140 [8]; undefined1 local_138 [8]; undefined1 local_130 [8]; undefined1 local_128 [8]; undefined1 local_120 [8]; undefined1 local_118 [8]; undefined1 local_110 [8]; undefined1 local_108 [8]; undefined1 local_100 [8]; undefined1 local_f8 [8]; undefined1 local_f0 [8]; undefined1 local_e8 [8]; undefined1 local_e0 [8]; undefined1 local_d8 [8]; undefined1 local_d0 [8]; undefined1 local_c8 [8]; undefined1 local_c0 [8]; undefined1 local_b8 [8]; undefined1 local_b0 [8]; undefined1 local_a8 [8]; undefined1 local_a0 [8]; undefined1 local_98 [8]; undefined1 local_90 [4]; undefined4 local_8c; undefined1 local_88 [8]; undefined1 local_80 [8]; undefined1 local_78 [8]; undefined1 local_70 [8]; undefined1 local_68 [8]; undefined1 local_60 [8]; undefined1 local_58 [8]; undefined1 local_50 [4]; undefined4 local_4c; undefined1 local_48 [4]; undefined4 local_44; undefined1 local_40 [8]; undefined1 local_38 [8]; undefined1 local_30 [4]; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04a88; local_10 = ExceptionList; ExceptionList = &local_10; uVar1 = FUN_0085dab0(__security_cookie ^ (uint)(local_30 + 0x2c)); local_8 = 0; luabridge::Namespace::Class::Class("EntityPtr",uVar1); local_8._0_1_ = 1; lua_pushcclosure(local_20,FUN_008bb1c0,0); FUN_0085bf90("__call"); FUN_008a06a0(EntityPtr::SetReference); uVar1 = FUN_00875130(&DAT_00b701d8,EntityPtr::Ref); FUN_0085d910(uVar1); local_8._0_1_ = 2; FUN_0085cce0(local_4c); local_8 = CONCAT31(local_8._1_3_,3); FUN_0085cce0(local_1c); local_8 = 4; FUN_0085cce0(local_44); local_8 = 0xffffffff; uVar1 = FUN_0085dab0(); local_8 = 5; luabridge::Namespace::Class::Class("Vector",uVar1); local_8._0_1_ = 6; lua_pushcclosure(local_18,FUN_008bb260,0); FUN_0085bf90("__call"); FUN_008a05a0(Vector::Normalize); FUN_008a0500(Vector::Normalized); FUN_008a0460(Vector::Dot); FUN_008a0460(Vector::Cross); FUN_008a0400(Vector::Lerp); FUN_008a0460(Vector::Distance); FUN_008a0460(Vector::DistanceSquared); FUN_008a0360(Vector::Rotated); puVar2 = (undefined4 *)lua_newuserdata(local_18,4); *puVar2 = Vector::FromAngle; lua_pushcclosure(local_18,FUN_008a02c0,1); FUN_0085bf90("FromAngle"); FUN_008a0220(Vector::GetAngleDegrees); FUN_008a01c0(Vector::Resize); FUN_008a0360(Vector::Resized); FUN_008a0160(Vector::Clamp); FUN_008a00c0(Vector::Clamped); FUN_008a0220(Vector::Length); FUN_008a0220(Vector::LengthSquared); FUN_008a0020(Vector::__add); FUN_008a0020(Vector::__sub); FUN_0089ff80(Vector::__mul); FUN_0089ff80(Vector::__div); FUN_008a0500(Vector::__unm); FUN_0089fee0(Vector::__tostring); FUN_00875230(&DAT_00b6a748,0,1); uVar1 = FUN_00875230(&DAT_00b6d134,4,1); FUN_0085d910(uVar1); local_8._0_1_ = 7; FUN_0085cce0(local_4c); local_8 = CONCAT31(local_8._1_3_,8); FUN_0085cce0(local_14); local_8 = 9; FUN_0085cce0(local_44); local_8 = 0xffffffff; uVar1 = FUN_0085dab0(); local_8 = 10; luabridge::Namespace::Class::Class("KColor",uVar1); local_8._0_1_ = 0xb; lua_pushcclosure(local_28,FUN_008bb3b0,0); FUN_0085bf90("__call"); FUN_008753a0("Alpha",0xc,1); FUN_008753a0(&DAT_00b633c4,0,1); FUN_008753a0("Green",4,1); uVar1 = FUN_008753a0(&DAT_00b634c0,8,1); FUN_0085d910(uVar1); local_8._0_1_ = 0xc; luabridge::Namespace::Class::Class("FontRenderSettings",local_50); local_8._0_1_ = 0xd; lua_pushcclosure(local_18,FUN_008bb4f0,0); FUN_0085bf90("__call"); FUN_0089fe80(Font::SetAlignment); FUN_0089fde0(EntityPtr::Ref); FUN_0089fd80(Font::SetMaxCharacters); FUN_0089fce0(Font::GetMaxCharacters); FUN_0089fd80(Font::EnableAutoWrap); FUN_0089fc40(Font::IsAutoWrapEnabled); FUN_0089fd80(Font::EnableTruncation); FUN_0089fc40(Font::IsTruncationEnabled); FUN_0089fbe0(Font::SetLineHeightModifier); FUN_0089fb40(Color::A); FUN_0089fae0(Font::SetMissingCharacterOverride); FUN_0089fa40(Room::GetGridHeight); FUN_0085d910(&local_18); local_8._0_1_ = 0xe; luabridge::Namespace::Class::Class(&DAT_00b70424,local_48); local_8._0_1_ = 0xf; lua_pushcclosure(local_20,FUN_008bb570,0); FUN_0085bf90("__call"); FUN_0089f9e0(Font::Load); FUN_0089f980(Font::Unload); FUN_0089f8e0(Room::IsInitialized); FUN_0089f840(Font::GetCharacterWidth); FUN_0089f7a0(Font::GetStringWidth); FUN_0089f700(Font::GetLineHeight); FUN_0089f700(Font::GetBaselineHeight); FUN_0089f660(Font::DrawString); FUN_0089f600(Font::SetMissingCharacter); FUN_0085d910(&local_20); local_8._0_1_ = 0x10; FUN_0085cce0(local_8c); local_8._0_1_ = 0x11; FUN_0085cce0(local_1c); local_8._0_1_ = 0x12; FUN_0085cce0(local_44); local_8._0_1_ = 0x13; FUN_0085cce0(local_14); local_8._0_1_ = 0x14; FUN_0085cce0(local_4c); local_8 = CONCAT31(local_8._1_3_,0x15); FUN_0085cce0(local_24); local_8 = 0x16; FUN_0085cce0(local_2c); local_8 = 0xffffffff; uVar1 = FUN_0085dab0(); local_8 = 0x17; luabridge::Namespace::Class::Class("Color",uVar1); local_8._0_1_ = 0x18; lua_pushcclosure(local_28,FUN_008bb5c0,0); FUN_0085bf90("__call"); FUN_00875510(&DAT_00b70450,Color::R,FUN_005cd370); FUN_00875510(&DAT_00b70434,Color::G,FUN_005cd380); FUN_00875510(&DAT_00b6d178,Color::B,FUN_005cd3a0); FUN_00875510(&DAT_00b6d17c,Color::A,Font::SetLineHeightModifier); FUN_00875510(&DAT_00b70438,Color::RO,FUN_005cd3d0); FUN_00875510(&DAT_00b7042c,Color::GO,FUN_005cd3f0); puVar2 = (undefined4 *)FUN_00875510(&DAT_00b70430,Color::BO,FUN_005cd410); FUN_0089f4a0(Color::Reset); FUN_0089f440(Color::SetTint); FUN_0089f440(Color::SetColorize); FUN_0089f3e0(Color::SetOffset); puVar3 = (undefined4 *)lua_newuserdata(*puVar2,4); *puVar3 = Color::Lerp; lua_pushcclosure(*puVar2,FUN_0089f2b0,1); FUN_0085bf90(&DAT_00b70244); FUN_0089f250(Color::__mul); FUN_0085d910(puVar2); local_8._0_1_ = 0x19; FUN_0085cce0(local_2c); local_8 = CONCAT31(local_8._1_3_,0x1a); FUN_0085cce0(local_24); local_8 = 0x1b; FUN_0085cce0(local_8c); local_8 = 0xffffffff; uVar1 = FUN_0085dab0(); local_8 = 0x1c; luabridge::Namespace::Class::Class("Sprite",uVar1); local_8._0_1_ = 0x1d; lua_pushcclosure(local_18,FUN_008bb720,0); FUN_0085bf90("__call"); FUN_0089f1b0(Sprite::IsFinished); FUN_0089f150(Sprite::Play); FUN_0089f0f0(ANM2::SetFrame); FUN_0089f090(Sprite::SetFrame_1); FUN_0089f030(ANM2::Reset); FUN_0089f030(ANM2::Update); FUN_0089efd0(ANM2::Render); FUN_0089ef70(Sprite::RenderLayer); FUN_0089f150(ANM2::Load); FUN_0089f030(ANM2::Reload); FUN_0089ef10(Sprite::ReplaceSpritesheet); FUN_0089f030(Sprite::LoadGraphics); FUN_0089ee70(Sprite::IsLoaded); FUN_0089edd0(Sprite::GetFilename); FUN_0089ed70(Sprite::PlayRandom); FUN_0089f030(Sprite::Stop); FUN_0089ed10(Sprite::SetAnimation); FUN_0089ec70(ANM2::GetFrame); FUN_0089f030(Sprite::SetLastFrame); FUN_0089f1b0(Sprite::IsPlaying); FUN_0089ec10(ANM2::SetLayerFrame); FUN_0089f150(Sprite::PlayOverlay); FUN_0089ed10(Sprite::SetOverlayAnimation); FUN_0089ebb0(Sprite::SetOverlayRenderPriority); FUN_0089f0f0(Sprite::SetOverlayFrame); FUN_0089eb50(Sprite::GetOverlayFrame); FUN_0089f030(Sprite::RemoveOverlay); FUN_0089f1b0(Sprite::IsOverlayPlaying); FUN_0089f1b0(Sprite::IsOverlayFinished); FUN_0089f1b0(Sprite::IsEventTriggered); FUN_0089f1b0(Sprite::WasEventTriggered); FUN_0089eab0(Sprite::GetLayerCount); FUN_0089ea10(Sprite::GetDefaultAnimationName); FUN_00875680("Offset",Sprite::Offset,Sprite::set_offset); FUN_00875680("Scale",Sprite::Scale,Sprite::SetScale); FUN_008757f0("Rotation",Sprite::Rotation,Sprite::SetRotation); luabridge::Namespace::Class::addProperty_Color("Color",Sprite::Color,Sprite::SetColor); FUN_0089e610(Sprite::GetTexel); FUN_00875ae0("FlipX",Sprite::FlipX,Sprite::set_flip_x); FUN_00875ae0("FlipY",Sprite::FlipY,set_byte_0x101); uVar1 = FUN_008757f0("PlaybackSpeed",Sprite::PlaybackSpeed,set_PlaybackSpeed); FUN_0089ea10(Sprite::GetDefaultAnimationName); FUN_0089edd0(Sprite::GetAnimation); FUN_0089edd0(Sprite::GetOverlayAnimation); FUN_0085d910(uVar1); local_8._0_1_ = 0x1e; FUN_0085cce0(local_2c); local_8 = CONCAT31(local_8._1_3_,0x1f); FUN_0085cce0(local_14); local_8 = 0x20; FUN_0085cce0(local_8c); local_8 = 0xffffffff; uVar1 = FUN_0085dab0(); local_8 = 0x21; luabridge::Namespace::Class::Class("EntityRef",uVar1); local_8 = CONCAT31(local_8._1_3_,0x22); lua_pushcclosure(local_28,FUN_008bb770,0); FUN_0085bf90("__call"); luabridge::Namespace::Class::addData_Type(&DAT_00b6d1a4,0,1); FUN_00875dd0("Variant",4,1); luabridge::Namespace::Class::addData_SpawnerType("SpawnerType",8,1); FUN_00875dd0("SpawnerVariant",0xc,1); luabridge::Namespace::Class::addData_Position("Position",0x10,1); FUN_00876240("IsCharmed",EntityRef::IsCharmed,FUN_0085dc10); FUN_00876240("IsFriendly",EntityRef::IsFriendly,FUN_0085dbf0); luabridge::Namespace::Class::addData_Entity("Entity",0x24,1); FUN_00872510(local_30); luabridge::Namespace::~Namespace(local_30); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_c0); FUN_0085dab0(); local_8 = 0x23; FUN_00876530(local_30,&DAT_00b70764); local_8 = CONCAT31(local_8._1_3_,0x24); FUN_00876550(); FUN_008765a0("GetSeed",EntityPtr::Ref); FUN_00876650("SetSeed",RNG::SetSeed); FUN_008766b0("RandomInt",RNG::RandomInt); FUN_00876710("RandomFloat",RNG::RandomFloat); FUN_00876770(&DAT_00b61210,RNG::Next); FUN_00872510(local_c0); luabridge::Namespace::~Namespace(local_c0); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_c8); FUN_0085dab0(); local_8 = 0x25; FUN_008767d0(local_c0,"ProjectileParams"); local_8 = CONCAT31(local_8._1_3_,0x26); FUN_008767f0(); luabridge::Namespace::Class::addData_GridCollision("GridCollision",0,1); FUN_008769c0("HeightModifier",4,1); FUN_008769c0("FallingSpeedModifier",8,1); FUN_008769c0("FallingAccelModifier",0xc,1); FUN_008769c0("VelocityMulti",0x10,1); FUN_008769c0("Scale",0x14,1); FUN_008769c0("CircleAngle",0x18,1); FUN_008769c0("HomingStrength",0x1c,1); FUN_008769c0("CurvingStrength",0x20,1); FUN_008769c0("Acceleration",0x24,1); FUN_008769c0("Spread",0x28,1); luabridge::Namespace::Class::addData_Color("Color",0x2c,1); FUN_00876cb0("BulletFlags",0x58,1); FUN_00876e20("PositionOffset",0x60,1); FUN_00876e20("TargetPosition",0x68,1); FUN_00876e20("FireDirectionLimit",0x70,1); FUN_008769c0("DotProductLimit",0x78,1); FUN_00876f90("WiggleFrameOffset",0x7c,1); FUN_00876cb0("ChangeFlags",0x80,1); FUN_008769c0("ChangeVelocity",0x88,1); FUN_00876f90("ChangeTimeout",0x8c,1); FUN_008769c0("DepthOffset",0x90,1); FUN_00876f90("Variant",0x94,1); FUN_00872510(local_c8); luabridge::Namespace::~Namespace(local_c8); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_70); FUN_0085dab0(); local_8 = 0x27; FUN_00877100(local_c8,"BitSet128"); local_8 = CONCAT31(local_8._1_3_,0x28); FUN_00877120(); FUN_00877170("__band",BitSet128::__band); FUN_00877170("__bor",BitSet128::__bor); FUN_00877170("__bxor",BitSet128::__bxor); FUN_008771d0("__bnot",BitSet128::__bnot); FUN_00877280(&DAT_00b7087c,BitSet128::__eq); FUN_00877330("__tostring",BitSet128::__tostring); FUN_008773e0(s_Get,BitSet128::Get); FUN_00877490(&DAT_00b70924,BitSet128::Set); FUN_008774f0(&DAT_00b669b4,0,1); FUN_008774f0(&DAT_00b70910,8,1); FUN_00872510(local_70); luabridge::Namespace::~Namespace(local_70); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_78); FUN_0085dab0(); local_8 = 0x29; FUN_00877660(local_70,"PathFinder"); local_8 = CONCAT31(local_8._1_3_,0x2a); FUN_00877680("Reset",PathFinder::Reset); FUN_008776e0("MoveRandomly",PathFinder::MoveRandomly); FUN_00877740("MoveRandomlyBoss",PathFinder::MoveRandomlyBoss); FUN_008777a0("MoveRandomlyAxisAligned",PathFinder::MoveRandomlyAxisAligned); FUN_00877800("FindGridPath",PathFinder::FindGridPath); FUN_00877860("HasPathToPos",NPCAI_Pathfinder::HasPathToPos); FUN_00877910("HasDirectPath",PathFinder::HasDirectPath); FUN_00877970("EvadeTarget",PathFinder::EvadeTarget); FUN_008779d0("GetEvadeMovementCountdown",PathFinder::GetEvadeMovementCountdown); FUN_00877680("ResetMovementTarget",NPCAI_Pathfinder::ResetMovementTarget); FUN_00877680("UpdateGridIndex",PathFinder::UpdateGridIndex); FUN_00877a30("GetGridIndex",PathFinder::GetGridIndex); FUN_00877740("SetCanCrushRocks",PathFinder::SetCanCrushRocks); FUN_00872510(local_78); luabridge::Namespace::~Namespace(local_78); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_80); FUN_0085dab0(); local_8 = 0x2b; FUN_0085da00(local_70,"ItemConfig"); local_8._0_1_ = 0x2c; FUN_00877ae0(local_78,&DAT_00b70a1c); local_8 = CONCAT31(local_8._1_3_,0x2d); FUN_00877b00(&DAT_00b6d1bc,0,1); FUN_00877b00("AchievementID",4,1); FUN_00877c70(&DAT_00b1b350,8,1); FUN_00877c70("Description",0x20,1); FUN_00877c70("HudAnim",0x38,1); luabridge::Namespace::Class::addData_GreedModeAllowed("GreedModeAllowed",0x50,1); luabridge::Namespace::Class::addData_PickupSubtype("PickupSubtype",0x54,1); luabridge::Namespace::Class::addData_CardType("CardType",0x58,1); luabridge::Namespace::Class::addData_AnnouncerVoice("AnnouncerVoice",0x5c,1); FUN_00877b00("AnnouncerDelay",0x60,1); FUN_00877b00("MimicCharge",100,1); FUN_008783f0("IsCard",Card::IsCard); FUN_008783f0("IsRune",Card::IsRune); FUN_008783f0("IsAvailable",Card::IsAvailable); FUN_00872510(local_80); luabridge::Namespace::~Namespace(local_80); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_70); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_88); FUN_0085dab0(); local_8 = 0x2e; FUN_0085da00(local_78,"ItemConfig"); local_8._0_1_ = 0x2f; FUN_00878490(local_80,"PillEffect"); local_8 = CONCAT31(local_8._1_3_,0x30); FUN_008784b0(&DAT_00b6d1bc,0,1); FUN_008784b0("AchievementID",4,1); luabridge::Namespace::Class::addData_Name(&DAT_00b1b350,8,1); luabridge::Namespace::Class::addData_GreedModeAllowed("GreedModeAllowed",0x38,1); FUN_00878920("AnnouncerVoice",0x3c,1); FUN_00878920("AnnouncerVoiceSuper",0x40,1); FUN_008784b0("AnnouncerDelay",0x44,1); FUN_008784b0("MimicCharge",0x48,1); FUN_00878a90("EffectClass",0x4c,1); FUN_00878a90("EffectSubClass",0x4d,1); FUN_00878c00("IsAvailable",PillEffect::IsAvailable); FUN_00872510(local_88); luabridge::Namespace::~Namespace(local_88); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_78); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_58); FUN_0085dab0(); local_8 = 0x31; FUN_0085da00(local_80,"ItemConfig"); local_8._0_1_ = 0x32; FUN_00878cb0(local_88,&DAT_00b67800); local_8 = CONCAT31(local_8._1_3_,0x33); FUN_00878cd0("IsCollectible",Item::IsCollectible); FUN_00878cd0("IsTrinket",Item::IsTrinket); FUN_00878cd0("IsNull",Item::IsNull); FUN_00878d70(&DAT_00b6d1a4,0,1); FUN_00878d70(&DAT_00b6d1bc,4,1); FUN_00878ee0(&DAT_00b1b350,8,1); FUN_00878ee0("Description",0x20,1); FUN_00878ee0("GfxFileName",0x38,1); FUN_00878d70("AchievementID",0x50,1); luabridge::Namespace::Class::addData_CacheFlags("CacheFlags",0x54,1); FUN_00878d70("AddMaxHearts",0x58,1); FUN_00878d70("AddHearts",0x5c,1); FUN_00878d70("AddSoulHearts",0x60,1); FUN_00878d70("AddBlackHearts",100,1); FUN_00878d70("AddBombs",0x68,1); FUN_00878d70("AddKeys",0x6c,1); FUN_00878d70("AddCoins",0x70,1); FUN_00878d70("MaxCharges",0x74,1); FUN_00878d70("MaxCooldown",0x78,1); FUN_008791d0("Special",0xb0,1); FUN_00879340("DevilPrice",0x7c,1); FUN_008794b0("Costume",Item::Costume); FUN_00878d70("InitCharge",200,1); luabridge::Namespace::Class::addData_ChargeType("ChargeType",0xac,1); FUN_00879340("ShopPrice",0x7e,1); FUN_008791d0("PassiveCache",0xb1,1); FUN_008791d0("AddCostumeOnPickup",0xb2,1); FUN_008791d0("Hidden",0xb3,1); FUN_008791d0("PersistentEffect",0xb4,1); FUN_008791d0("ClearEffectsOnRemove",0xb5,1); luabridge::Namespace::Class::addData_Tags(&DAT_00b70c1c,0xb8,1); FUN_00878d70("Quality",0xc0,1); FUN_00878d70("CraftingQuality",0xc4,1); FUN_008798b0("HasTags",Item::HasTags); FUN_00879960("IsAvailable",Item::IsAvailable); FUN_00872510(local_58); luabridge::Namespace::~Namespace(local_58); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_80); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_98); FUN_0085dab0(); local_8 = 0x34; FUN_0085da00(local_88,"ItemConfig"); local_8._0_1_ = 0x35; FUN_00879a10(local_58,"Costume"); local_8 = CONCAT31(local_8._1_3_,0x36); FUN_00879a30(&DAT_00b6d1bc,0,1); luabridge::Namespace::Class::addData_Anm2Path("Anm2Path",4,1); FUN_00879a30("Priority",0x1c,1); FUN_00879d20("HasOverlay",0x20,1); FUN_00879d20("IsFlying",0x21,1); FUN_00879d20("HasSkinAlt",0x22,1); luabridge::Namespace::Class::addData_SkinColor("SkinColor",0x24,1); FUN_00879d20("OverwriteColor",0x28,1); FUN_00872510(local_98); luabridge::Namespace::~Namespace(local_98); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_88); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_a0); lua_register_CardConfigList("CardConfigList"); lua_register_PillConfigList("PillConfigList"); lua_register_ItemConfigList("ItemConfigList"); lua_register_CostumeConfigList("CostumeConfigList"); FUN_0085dab0(); local_8 = 0x37; FUN_0085da00(local_58,"ItemConfig"); local_8._0_1_ = 0x38; FUN_0087ac50(local_98,"Config"); local_8 = CONCAT31(local_8._1_3_,0x39); FUN_0087ac70("IsValidCollectible",ItemConfig::IsValidCollectible); FUN_0087acd0("GetCollectible",ItemConfig::GetCollectible); FUN_0087acd0("GetTrinket",ItemConfig::GetTrinket); FUN_0087acd0("GetNullItem",Config::GetNullItem); FUN_0087ad70("ShouldAddCostumeOnPickup",Config::ShouldAddCostumeOnPickup); FUN_0087add0("GetCard",ItemConfig::GetCard); FUN_0087ae80("GetPillEffect",Config::GetPillEffect); FUN_0087af30("GetCollectibles",Config::GetCollectibles); FUN_0087af30("GetTrinkets",Config::GetTrinkets); FUN_0087af30("GetNullItems",Sprite::GetDefaultAnimationName); FUN_0087afd0("GetCards",Config::GetCards); FUN_0087b080("GetPillEffects",Config::GetPillEffects); FUN_00872510(local_a0); luabridge::Namespace::~Namespace(local_a0); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_58); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_a8); FUN_0085dab0(); local_8 = 0x3a; FUN_0087b130(local_a0,"TearParams"); local_8 = CONCAT31(local_8._1_3_,0x3b); FUN_0087b150("TearVariant",0,1); FUN_0087b150("BombVariant",4,1); luabridge::Namespace::Class::addData_TearColor("TearColor",8,1); luabridge::Namespace::Class::addData_TearFlags("TearFlags",0x38,1); FUN_0087b5c0("TearDamage",0x48,1); FUN_0087b5c0("TearScale",0x4c,1); FUN_0087b5c0("TearHeight",0x50,1); FUN_00872510(local_a8); luabridge::Namespace::~Namespace(local_a8); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_68); FUN_0085dab0(); local_8 = 0x3c; FUN_0087b730(local_a8,"QueueItemData"); local_8 = CONCAT31(local_8._1_3_,0x3d); luabridge::Namespace::Class::addData_Item(&DAT_00b67800,0,1); luabridge::Namespace::Class::addData_Charge("Charge",4,1); luabridge::Namespace::Class::addProperty_Touched ("Touched",QueueItemData::Touched,FUN_0085e1d0); FUN_00872510(local_68); luabridge::Namespace::~Namespace(local_68); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_40); lua_register_VectorList("VectorList"); FUN_0085dab0(); local_8 = 0x3e; FUN_0087bee0(local_68,"TemporaryEffect"); local_8 = CONCAT31(local_8._1_3_,0x3f); luabridge::Namespace::Class::addData_Item(&DAT_00b67800,0,1); FUN_0087c090("Count",4,1); FUN_0087c090("Cooldown",8,1); FUN_00872510(local_40); luabridge::Namespace::~Namespace(local_40); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_38); lua_register_EffectList("EffectList"); FUN_0085dab0(); local_8 = 0x40; FUN_0087c510(local_40,"TemporaryEffects"); local_8 = CONCAT31(local_8._1_3_,0x41); FUN_0087c530("AddCollectibleEffect",TemporaryEffects::AddCollectibleEffect); FUN_0087c590("AddTrinketEffect",TemporaryEffects::AddTrinketEffect); FUN_0087c5f0("AddNullEffect",TemporaryEffects::AddNullEffect); FUN_0087c650("RemoveCollectibleEffect",TemporaryEffects::RemoveCollectibleEffect); FUN_0087c6b0("RemoveTrinketEffect",TemporaryEffects::RemoveTrinketEffect); FUN_0087c710("RemoveNullEffect",TemporaryEffects::RemoveNullEffect); FUN_0087c770("HasCollectibleEffect",TemporaryEffects::HasCollectibleEffect); FUN_0087c820("HasTrinketEffect",TemporaryEffects::HasTrinketEffect); FUN_0087c8d0("HasNullEffect",TemporaryEffects::HasNullEffect); FUN_0087c980("GetCollectibleEffect",TemporaryEffects::GetCollectibleEffect); FUN_0087ca30("GetTrinketEffect",TemporaryEffects::GetTrinketEffect); FUN_0087cae0("GetNullEffect",TemporaryEffects::GetNullEffect); FUN_0087cb90("GetCollectibleEffectNum",TemporaryEffects::GetCollectibleEffectNum); FUN_0087cc40("GetTrinketEffectNum",TemporaryEffects::GetTrinketEffectNum); FUN_0087ccf0("GetNullEffectNum",TemporaryEffects::GetNullEffectNum); FUN_0087cda0("ClearEffects",TemporaryEffects::ClearEffects); FUN_0087ce00("GetEffectsList",TemporaryEffects::GetEffectsList); FUN_00872510(local_38); luabridge::Namespace::~Namespace(local_38); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_60); FUN_0085dab0(); local_8 = 0x42; FUN_0085da00(local_40,"CppContainer"); local_8._0_1_ = 0x43; FUN_0087ce60(local_38,"EntityList"); local_8 = CONCAT31(local_8._1_3_,0x44); FUN_0087ce80(s_Size,EntityList::Size); FUN_0087cfb0("__len",EntityList::Size); FUN_0087d060(s_Get,EntityList::Get); FUN_00872510(local_60); luabridge::Namespace::~Namespace(local_60); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_40); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_b0); FUN_0085dab0(); local_8 = 0x45; FUN_0085da00(local_68,"PlayerTypes"); local_8._0_1_ = 0x46; FUN_0087d110(local_40,"PosVel"); local_8._0_1_ = 0x47; FUN_0087d130("Position",0,1); FUN_0087d130("Velocity",8,1); FUN_00872510(local_38); local_8._0_1_ = 0x48; FUN_0087d2a0(local_60,"ActiveItemDesc"); local_8 = CONCAT31(local_8._1_3_,0x49); FUN_0087d2c0(&DAT_00b67800,0,1); FUN_0087d2c0("Charge",8,1); FUN_0087d2c0("BatteryCharge",0xc,1); FUN_0087d2c0("SubCharge",0x10,1); FUN_0087d2c0("TimedRechargeCooldown",0x14,1); luabridge::Namespace::Class::addData_PartialCharge("PartialCharge",0x18,1); FUN_0087d2c0("VarData",0x1c,1); FUN_00872510(local_b0); luabridge::Namespace::~Namespace(local_b0); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_38); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_68); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_b8); FUN_0085dab0(); local_8 = 0x4a; FUN_0087d5b0(&local_20,"Entity"); local_8._0_1_ = 0x4b; luabridge::Namespace::Class::addData_Friction("Friction",0x36c,1); FUN_0087d750("GetData",Entity::GetData); FUN_0087d7b0("Position",Entity::Position,Entity::SetPosition); FUN_0087d7b0("Velocity",Entity::Velocity,Entity::SetVelocity); luabridge::Namespace::Class::addProperty_Color("Color",Entity::Color,FUN_00871f70); FUN_0087daa0("Update",Entity::Update); FUN_0087db00("Render",Entity::Render); FUN_0087db60("RenderShadowLayer",Entity::RenderShadowLayer); FUN_0087daa0("PostRender",Entity::PostRender); FUN_0087dbc0("TakeDamage",Entity::TakeDamage); FUN_0087dc20("HasMortalDamage",Entity::HasMortalDamage); FUN_0087daa0(&DAT_00b71018,Entity::Kill); FUN_0087dc80("KillWithSource",Entity::KillWithSource); FUN_0087daa0(&DAT_00b60f6c,Entity::Die); FUN_0087daa0("Remove",Entity::Remove); FUN_0087daa0("BloodExplode",Entity::BloodExplode); FUN_0087dce0(&DAT_00b6d1a4,Entity::Type); FUN_0087ddd0("Variant",Entity::Variant,FUN_006a8180); FUN_0087ddd0("SubType",Entity::SubType,FUN_00435cd0); FUN_0087df50("SpawnerType",Entity::SpawnerType,FUN_004316b0); FUN_0087ddd0("SpawnerVariant",Entity::SpawnerVariant,FUN_004b7070); FUN_0087e0c0("AddVelocity",Entity::AddVelocity_divided); FUN_0087e120("MultiplyFriction",Entity::MultiplyFriction); FUN_0087e180("SetColor",GridEntity::Destroy); FUN_0087e1e0("GetColor",Entity::GetColor); luabridge::Namespace::Class::addProperty_SplatColor ("SplatColor",Entity::SplatColor,Color::assign); FUN_0087e410("Visible",Entity::Visible,FUN_0044bf90); FUN_0087e580("PositionOffset",Entity::PositionOffset,Entity::SetPositionOffset); FUN_0087df50("RenderZOffset",Entity::RenderZOffset,FUN_00440e90); luabridge::Namespace::Class::addProperty_SortingLayer ("SortingLayer",Entity::SortingLayer,FUN_00565dd0); FUN_0087e410("FlipX",Entity::FlipX,FUN_00440ea0); FUN_0087e580("SpriteOffset",Entity::SpriteOffset,FUN_004563c0); FUN_0087e580("SpriteScale",Entity::SpriteScale,Entity::SetSpriteScale); FUN_0087e870("SetSpriteFrame",Entity::SetSpriteFrame); FUN_0087e8d0("SpriteRotation",Entity::SpriteRotation,FUN_0043eea0); FUN_0087e870("SetSpriteOverlayFrame",Entity::SetSpriteOverlayFrame); luabridge::Namespace::Class::addProperty_Size(s_Size,Entity::Size,FUN_00871fa0); FUN_0087ebc0("SetSize",Entity::SetSize); FUN_0087d7b0("SizeMulti",Entity::SizeMulti,FUN_004563e0); FUN_0087e8d0(&DAT_00b711bc,Entity::Mass,set_field_0x37c); FUN_0087e8d0("MaxHitPoints",Entity::MaxHitPoints,FUN_00435d40); FUN_0087e8d0("HitPoints",Entity::HitPoints,Entity::SetField380); FUN_0087ec20("Index",PathFinder::GetGridIndex); luabridge::Namespace::Class::addProperty_TargetPosition ("TargetPosition",Entity::TargetPosition,Entity::SetTargetPosition); FUN_0087df50("GridCollisionClass",Entity::GridCollisionClass,FUN_0044bfa0); FUN_0087df50("EntityCollisionClass",Entity::EntityCollisionClass,FUN_00435d90); FUN_0087e8d0("CollisionDamage",Entity::CollisionDamage,&LAB_008c5ce3); FUN_0087ee90("CollidesWithGrid",Entity::CollidesWithGrid); FUN_0087dce0("SpawnGridIndex",Entity::SpawnGridIndex); FUN_0087ee90("IsEnemy",Entity::IsEnemy); FUN_0087ef30("IsActiveEnemy",Entity::IsActiveEnemy); FUN_00872590("IsVulnerableEnemy",Entity::IsVulnerableEnemy_lua); FUN_0087ee90("IsFlying",Entity::IsFlying); FUN_0087efe0("AddEntityFlags",Entity::AddEntityFlags); FUN_0087efe0("ClearEntityFlags",Entity::ClearEntityFlags); FUN_0087f040("GetEntityFlags",Entity::GetEntityFlags); FUN_0087f0f0("HasEntityFlags",Entity::HasEntityFlags); FUN_0087dc20("HasFullHealth",Entity::HasFullHealth); FUN_0087e120("AddHealth",Entity::AddHealth); FUN_0087f1a0("AddPoison",Entity::AddPoison); FUN_0087f200("AddFreeze",Entity::AddFreeze); FUN_0087f260("AddSlowing",Entity::AddSlowing); FUN_0087f2c0("AddCharmed",Entity::AddCharmed); FUN_0087f200("AddConfusion",Entity::AddConfusion); FUN_0087f200("AddMidasFreeze",Entity::AddMidasFreeze); FUN_0087f200("AddFear",Entity::AddFear); FUN_0087f1a0("AddBurn",Entity::AddBurn); FUN_0087f2c0("AddShrink",Entity::AddShrink); FUN_0087daa0("RemoveStatusEffects",Entity::RemoveStatusEffects); FUN_0087ee90("Exists",Entity::Exists); FUN_0087ee90("IsDead",Entity::IsDead); FUN_0087ee90("IsVisible",Entity::Visible); FUN_0087ee90("IsInvincible",Entity::IsInvincible); FUN_0087ee90("CanShutDoors",Entity::CanShutDoors); FUN_0087ee90("IsBoss",Entity::IsBoss); FUN_0087f320("GetBossID",Entity::GetBossID); FUN_0087f3d0("Parent",Entity::Parent,Entity::SetParent); FUN_0087f3d0("Child",Entity::Child,Entity::SetChild); FUN_0087f3d0("Target",Entity::Target,Entity::SetTarget); FUN_0087f3d0("SpawnerEntity",Entity::SpawnerEntity,Entity::SetSpawnerEntity); FUN_0087f540("GetLastParent",Entity::GetLastParent); FUN_0087f540("GetLastChild",Entity::GetLastChild); FUN_0087f5a0("HasCommonParentWithEntity",Entity::HasCommonParentWithEntity); FUN_0087dce0("FrameCount",Entity::FrameCount); FUN_0087f600("IsFrame",Entity::IsFrame); FUN_0087ec20("InitSeed",Entity::InitSeed); FUN_0087ec20("DropSeed",Entity::DropSeed); FUN_0087f6b0("GetDropRNG",Entity::GetDropRNG); FUN_0087f710("GetSprite",Entity::GetSprite); FUN_0087e8d0("DepthOffset",Entity::DepthOffset,set_field_358); FUN_0087f770("ToPlayer"); FUN_0087f810("ToEffect"); FUN_0087f8b0("ToNPC"); FUN_0087f950("ToPickup"); FUN_0087f9f0("ToFamiliar"); FUN_0087fa90("ToBomb"); FUN_0087fb30("ToKnife"); FUN_0087fbd0("ToLaser"); FUN_0087fc70("ToTear"); FUN_0087fd10("ToProjectile"); FUN_00872510(&local_28); local_8._0_1_ = 0x4c; FUN_0087fdb0(local_48,"EntityTear"); local_8._0_1_ = 0x4d; FUN_0087fdd0("Height",Entity_Tear::Height,Entity_Projectile::SetHeight); FUN_0087fdd0("FallingSpeed",Entity_Tear::FallingSpeed,FUN_00444c70); FUN_0087fdd0("FallingAcceleration",Entity_Tear::FallingAcceleration, Entity_Projectile::set_falling_accel); FUN_0087fdd0("Scale",Entity_Tear::Scale,Entity_Tear::SetScale); luabridge::Namespace::Class::addProperty_TearFlags ("TearFlags",Entity_Tear::TearFlags,Entity_Tear::SetTearFlags); FUN_008800c0("TearIndex",Entity_Tear::TearIndex); FUN_0087fdd0("Rotation",Entity_Tear::Rotation,FUN_004aadb0); FUN_008801c0("SetKnockbackMultiplier",Entity_Tear::SetKnockbackMultiplier); FUN_00880220("SetWaitFrames",Entity_Tear::SetWaitFrames); FUN_008801c0("SetDeadEyeIntensity",Entity_Tear::SetDeadEyeIntensity); FUN_00880220("ChangeVariant",Entity_Tear::ChangeVariant); FUN_00880280("SetParentOffset",Entity_Tear::SetParentOffset); FUN_008802e0("ResetSpriteScale",Entity_Tear::ResetSpriteScale); FUN_00880340("HomingFriction",0x41c,1); FUN_008804b0("BaseScale",Entity_Tear::BaseScale); FUN_008805a0("WaitFrames",0x438,1); FUN_00880710("ContinueVelocity",0x43c,1); FUN_008804b0("BaseDamage",Entity_Tear::BaseDamage); FUN_00880340("KnockbackMultiplier",0x460,1); luabridge::Namespace::Class::addData_StickTarget("StickTarget",0x478,1); FUN_00880710("StickDiff",0x47c,1); FUN_008805a0("StickTimer",0x484,1); luabridge::Namespace::Class::addData_CanTriggerStreakEnd ("CanTriggerStreakEnd",0x7e8,1); FUN_00880b80("PosDisplacement",Entity_Tear::PosDisplacement); FUN_00880710("ParentOffset",0x7f4,1); FUN_00872510(local_50); local_8._0_1_ = 0x4e; FUN_00880c80(local_90,"EntityPlayer"); local_8._0_1_ = 0x4f; FUN_00880ca0("RenderGlow",Entity_Player::RenderGlow); FUN_00880ca0("RenderBody",Entity_Player::RenderBody); FUN_00880ca0("RenderHead",Entity_Player::RenderHead); FUN_00880ca0("RenderTop",Entity_Player::RenderTop); FUN_00880d00("GetName",Entity_Player::GetName); FUN_00880db0("AddMaxHearts",Entity_Player::AddMaxHearts); FUN_00880e10("HasFullHearts",Entity_Player::HasFullHearts); FUN_00880e10("HasFullHeartsAndSoulHearts",Entity_Player::HasFullHeartsAndSoulHearts); FUN_00880e70("AddHearts",Entity_Player::AddHearts); FUN_00880ed0("AddEternalHearts",Entity_Player::AddEternalHearts); FUN_00880db0("AddSoulHearts",Entity_Player::AddSoulHearts); FUN_00880ed0("AddBlackHearts",Entity_Player::AddBlackHearts); FUN_00880ed0("RemoveBlackHeart",Entity_Player::RemoveBlackHeart); FUN_00880f30("IsBlackHeart",Entity_Player::IsBlackHeart); FUN_00880ed0("AddJarHearts",Entity_Player::AddJarHearts); FUN_00880f90("GetJarHearts",Entity_Player::GetJarHearts); FUN_00880ed0("AddJarFlies",Entity_Player::AddJarFlies); FUN_00880ff0("GetJarFlies",Entity_Player::GetJarFlies); FUN_00880ed0("AddCoins",Entity_Player::AddCoins); FUN_00880ed0("AddBombs",Entity_Player::AddBombs); FUN_00880ed0("AddKeys",Entity_Player::AddKeys); FUN_00881090("AddGoldenKey",Entity_Player::AddGoldenKey); FUN_00881090("RemoveGoldenKey",Entity_Player::RemoveGoldenKey); FUN_00881090("AddGoldenBomb",Entity_Player::AddGoldenBomb); FUN_00881090("RemoveGoldenBomb",Entity_Player::RemoveGoldenBomb); FUN_00880db0("AddGoldenHearts",Entity_Player::AddGoldenHearts); FUN_008810f0("AddBlueSpider",Entity_Player::AddBlueSpider); FUN_00881150("ThrowBlueSpider",Entity_Player::ThrowBlueSpider); FUN_00881090("RemoveBlueSpider",Entity_Player::RemoveBlueSpider); FUN_008811b0("AddBlueFlies",Entity_Player::AddBlueFlies); FUN_00881090("RemoveBlueFly",Entity_Player::RemoveBlueFly); FUN_00881090("AddPrettyFly",Entity_Player::AddPrettyFly); FUN_00880e10("TryUseKey",Entity_Player::TryUseKey); FUN_00881210("AddCostume",Entity_Player::AddCostume); FUN_00880ed0("AddNullCostume",Entity_Player::AddNullCostume); FUN_00881270("RemoveCostume",Entity_Player::RemoveCostume); FUN_00881090("RemoveSkinCostume",Entity_Player::RemoveSkinCostume); FUN_00881090("ClearCostumes",Entity_Player::ClearCostumes); FUN_008812d0("QueueItem",Entity_Player::QueueItem); FUN_00880e10("FlushQueueItem",Entity_Player::FlushQueueItem); FUN_00880e10("IsItemQueueEmpty",Entity_Player::IsItemQueueEmpty); FUN_00881330("AddCollectible",Entity_Player::AddCollectible); FUN_00881390("GetCollectibleCount",Entity_Player::GetCollectibleCount); FUN_00880db0("AddTrinket",Entity_Player::AddTrinket); FUN_00880f30("TryRemoveTrinket",Entity_Player::TryRemoveTrinket); FUN_00881430("DropTrinket",Entity_Player::DropTrinket); FUN_00881390("GetMaxTrinkets",Entity_Player::GetMaxTrinkets); FUN_00881390("GetMaxPocketItems",Entity_Player::GetMaxPocketItems); FUN_00881490("DropPocketItem",Entity_Player::DropPocketItem); FUN_008814f0("RemoveCollectible",Entity_Player::RemoveCollectible); FUN_00881090("ClearTemporaryEffects",Entity_Player::ClearTemporaryEffects); FUN_00880ed0("DonateLuck",Entity_Player::DonateLuck); FUN_00880e10("CanPickBlackHearts",Entity_Player::CanPickBlackHearts); FUN_00880e10("CanPickGoldenHearts",Entity_Player::CanPickGoldenHearts); FUN_00881550("GetActiveItem",Entity_Player::GetBatteryCharge); FUN_00881550("GetActiveCharge",Entity_Player::GetActiveItem); FUN_00881550("GetBatteryCharge",Entity_Player::GetBatteryCharge); FUN_00881550("GetActiveSubCharge",Entity_Player::GetActiveSubCharge); FUN_008815f0("SetActiveCharge",Entity_Player::SetActiveCharge); FUN_00880db0("DischargeActiveItem",Entity_Player::DischargeActiveItem); FUN_00881650("NeedsCharge",Entity_Player::NeedsCharge); FUN_008816f0("FullCharge",Entity_Player::FullCharge); FUN_00881750("GetPocketItem",Entity_Player::GetPocketItem); FUN_00880ed0("AddCard",Entity_Player::AddCard); FUN_00880ed0("AddPill",Entity_Player::AddPill); FUN_00881550("GetCard",Entity_Player::GetCard); FUN_00881550("GetPill",Entity_Player::GetPill); FUN_008815f0("SetCard",Entity_Player::SetCard); FUN_008815f0("SetPill",Entity_Player::SetPill); FUN_00881800("HasCollectible",Entity_Player::HasCollectible); FUN_008818a0("GetCollectibleNum",Entity_Player::GetCollectibleNum); FUN_00881800("HasTrinket",Entity_Player::HasTrinket); FUN_00881650("HasPlayerForm",Entity_Player::HasPlayerForm); FUN_00881650("CanAddCollectible",Entity_Player::CanAddCollectible); FUN_00880f30("TryHoldTrinket",Entity_Player::TryHoldTrinket); FUN_00881090("SetFullHearts",Entity_Player::SetFullHearts); luabridge::Namespace::Class::addProperty_TearsOffset ("TearsOffset",Entity_Player::TearsOffset,FUN_007792f0); FUN_00880ed0("AddCacheFlags",Entity_Player::AddCacheFlags); FUN_00881090("EvaluateItems",Entity_Player::EvaluateItems); FUN_00881090("RespawnFamiliars",Entity_Player::RespawnFamiliars); FUN_00881ad0("GetNPCTarget",Entity_Player::GetNPCTarget); FUN_00880ff0("GetMovementDirection",Entity_Player::GetMovementDirection); FUN_00880ff0("GetFireDirection",Entity_Player::GetFireDirection); FUN_00880ff0("GetHeadDirection",Entity_Player::GetHeadDirection); FUN_00881b30("GetAimDirection",Entity_Player::GetAimDirection); FUN_00881b30("GetMovementVector",Entity_Player::GetMovementVector); FUN_00881b30("GetRecentMovementVector",Entity_Player::GetRecentMovementVector); FUN_00881bd0("GetMovementJoystick",Entity_Player::GetMovementJoystick); FUN_00881bd0("GetShootingJoystick",Entity_Player::GetShootingJoystick); FUN_00881c30("AreOpposingShootDirectionsPressed",Entity_Player::AreOpposingShootDirectionsPressed) ; FUN_00881b30("GetLastDirection",Entity_Player::GetLastDirection); FUN_00881b30("GetVelocityBeforeUpdate",Entity_Player::GetVelocityBeforeUpdate); FUN_00881cd0("GetSmoothBodyRotation",Entity_Player::GetSmoothBodyRotation); FUN_00881cd0("GetTearPoisonDamage",Entity_Player::GetTearPoisonDamage); FUN_00881d70("GetBombFlags",Entity_Player::GetBombFlags); FUN_00881e20("GetBombVariant",Entity_Player::GetBombVariant); FUN_00881ed0("GetTearHitParams",Entity_Player::GetTearHitParams); FUN_00880ff0("GetHearts",Entity_Player::GetHearts); FUN_00880ff0("GetMaxHearts",Entity_Player::GetMaxHearts); FUN_00880ff0("GetSoulHearts",Entity_Player::GetSoulHearts); FUN_00880ff0("GetBlackHearts",Entity_Player::GetBlackHearts); FUN_00880ff0("GetEternalHearts",Entity_Player::GetEternalHearts); FUN_00880ff0("GetExtraLives",Entity_Player::GetExtraLives); FUN_00880ff0("GetNumBombs",Entity_Player::GetNumBombs); FUN_00880ff0("GetNumKeys",Entity_Player::GetNumKeys); FUN_00881c30("HasGoldenKey",Entity_Player::HasGoldenKey); FUN_00881c30("HasGoldenBomb",Entity_Player::HasGoldenBomb); FUN_00880ff0("GetGoldenHearts",Entity_Player::GetGoldenHearts); FUN_00880ff0("GetNumCoins",Entity_Player::GetNumCoins); FUN_00880ff0("GetPlayerType",Entity_Player::GetPlayerType); FUN_00881550("GetTrinket",Entity_Player::GetTrinket); FUN_00880ff0("GetNumBlueFlies",Entity_Player::GetNumBlueFlies); FUN_00880ff0("GetNumBlueSpiders",Entity_Player::GetNumBlueSpiders); FUN_00880ff0("GetItemState",Entity_Player::GetItemState); FUN_00881f30("UseActiveItem",Entity_Player::UseActiveItem); FUN_00880ff0("GetTearRangeModifier",Entity_Player::GetTearRangeModifier); FUN_00881fb0("GetTrinketMultiplier",Entity_Player::GetTrinketMultiplier); FUN_00882060("GetEffects",Entity_Player::GetEffects); FUN_00881650("HasWeaponType",Entity_Player::HasWeaponType); FUN_00881ad0("GetActiveWeaponEntity",Entity_Player::GetActiveWeaponEntity); FUN_008820c0("GetTractorBeam",Entity_Player::GetTractorBeam); FUN_00881c30("CanPickupItem",Entity_Player::CanPickupItem); FUN_00881c30("IsHoldingItem",Entity_Player::IsHoldingItem); FUN_00881c30("IsHeldItemVisible",Entity_Player::IsHeldItemVisible); FUN_00881090("Revive",Entity_Player::Revive); FUN_00882170("TryRemoveCollectibleCostume",Entity_Player::TryRemoveCollectibleCostume); FUN_008821d0("TryRemoveTrinketCostume",Entity_Player::TryRemoveTrinketCostume); FUN_00882230("TryRemoveNullCostume",Entity_Player::TryRemoveNullCostume); FUN_00882290("AnimateCollectible",Entity_Player::AnimateCollectible); FUN_008822f0("AnimateTrinket",Entity_Player::AnimateTrinket); FUN_00882350("AnimateCard",Entity_Player::AnimateCard); FUN_008823b0("AnimatePill",Entity_Player::AnimatePill); FUN_00882410("AnimatePickup",Entity_Player::AnimatePickup); FUN_00881090("AnimateTrapdoor",Entity_Player::AnimateTrapdoor); FUN_00881090("AnimateLightTravel",Entity_Player::AnimateLightTravel); FUN_00881090("AnimateAppear",Entity_Player::AnimateAppear); FUN_00882470("AnimateTeleport",Entity_Player::AnimateTeleport); FUN_00881090("AnimateHappy",Entity_Player::AnimateHappy); FUN_00881090("AnimateSad",Entity_Player::AnimateSad); FUN_00882470("AnimatePitfallIn",Entity_Player::AnimatePitfallIn); FUN_00881090("AnimatePitfallOut",Entity_Player::AnimatePitfallOut); FUN_00881c30("IsExtraAnimationFinished",Entity_Player::IsExtraAnimationFinished); FUN_00881090("StopExtraAnimation",Entity_Player::StopExtraAnimation); luabridge::Namespace::Class::addProperty_ControlsEnabled ("ControlsEnabled",Entity_Player::ControlsEnabled,FUN_005b17a0); luabridge::Namespace::Class::addProperty_ControlsCooldown ("ControlsCooldown",Entity_Player::ControlsCooldown,FUN_005b17b0); FUN_00880ed0("AddControlsCooldown",Entity_Player::AddControlsCooldown); FUN_008827d0("PlayExtraAnimation",Entity_Player::PlayExtraAnimation); FUN_008827d0("QueueExtraAnimation",Entity_Player::QueueExtraAnimation); FUN_00880ff0("GetDamageCooldown",Entity_Player::GetDamageCooldown); FUN_00881090("ResetDamageCooldown",Entity_Player::ResetDamageCooldown); FUN_00880ed0("SetMinDamageCooldown",Entity_Player::SetMinDamageCooldown); FUN_00880e10("AreControlsEnabled",Entity_Player::AreControlsEnabled); FUN_008815f0("UseCard",Entity_Player::UseCard); FUN_00882830("UsePill",Entity_Player::UsePill); FUN_00882890("HasInvincibility",Entity_Player::HasInvincibility); FUN_00880ed0("SetShootingCooldown",Entity_Player::SetShootingCooldown); FUN_008828f0("FireDelayedBrimstone",Entity_Player::FireDelayedBrimstone); FUN_00882950("GetLastDamageSource",Entity_Player::GetLastDamageSource); FUN_00882a00("GetLastDamageFlags",Entity_Player::GetLastDamageFlags); FUN_00881390("GetTotalDamageTaken",Entity_Player::GetTotalDamageTaken); FUN_00882ab0("FireTear",Entity_Player::FireTear); FUN_00882b10("FireBomb",Entity_Player::FireBomb); FUN_00882b70("FireBrimstone",Entity_Player::FireBrimstone); FUN_00882bd0("FireTechLaser",Entity_Player::FireTechLaser); FUN_00882c30("FireTechXLaser",Entity_Player::FireTechXLaser); FUN_00882c90("FireKnife",Entity_Player::FireKnife); FUN_00880ff0("GetBabySkin",Entity_Player::GetBabySkin); FUN_00881c30("CanShoot",Entity_Player::CanShoot); FUN_00881c30("IsP2Appearing",Entity_Player::IsP2Appearing); FUN_00880e10("IsFullSpriteRendering",Entity_Player::IsFullSpriteRendering); FUN_00882cf0("GetCollectibleRNG",Entity_Player::GetCollectibleRNG); FUN_00882cf0("GetTrinketRNG",Entity_Player::GetTrinketRNG); FUN_00882cf0("GetPillRNG",Entity_Player::GetPillRNG); FUN_00882cf0("GetCardRNG",Entity_Player::GetCardRNG); FUN_00881090("AddDeadEyeCharge",Entity_Player::AddDeadEyeCharge); FUN_00881090("ClearDeadEyeCharge",Entity_Player::ClearDeadEyeCharge); FUN_00880ff0("GetZodiacEffect",Entity_Player::GetZodiacEffect); luabridge::Namespace::Class::addProperty_FriendBallEnemy ("FriendBallEnemy",Entity_Player::FriendBallEnemy,FUN_005cd7a0); FUN_00882ed0("IsPosInSpotLight",Entity_Player::IsPosInSpotLight); FUN_00882f30("GetMultiShotParams",Entity_Player::GetMultiShotParams); FUN_00882f90("GetMultiShotPositionVelocity",Entity_Player::GetMultiShotPositionVelocity); FUN_00882ff0("GetFlyingOffset",Entity_Player::GetFlyingOffset); luabridge::Namespace::Class::addProperty_SpriteScale ("SpriteScale",Entity_Player::SpriteScale,FUN_0085e2a0); FUN_00880e10("WillPlayerRevive",Entity_Player::WillPlayerRevive); FUN_00880ff0("GetLastActionTriggers",Entity_Player::GetLastActionTriggers); FUN_00881cd0("GetGreedDonationBreakChance",Entity_Player::GetGreedDonationBreakChance); FUN_00883220("ControllerIndex",Entity_Player::ControllerIndex); FUN_00881bd0("GetMovementInput",Entity_Player::GetMovementJoystick); FUN_00881bd0("GetShootingInput",Entity_Player::GetShootingJoystick); FUN_00880e10("HasTimedItem",Entity_Player::HasTimedItem); FUN_00881090("InitBabySkin",Entity_Player::InitBabySkin); FUN_00880e10("CanTurnHead",Entity_Player::CanTurnHead); FUN_00883320("CheckFamiliar",Entity_Player::CheckFamiliar); FUN_00881090("UpdateCanShoot",Entity_Player::UpdateCanShoot); FUN_00883380("GetLaserOffset",Entity_Player::GetLaserOffset); FUN_00883430("GetTearMovementInheritance",Entity_Player::GetTearMovementInheritance); FUN_008834e0("GetCostumeNullPos",Entity_Player::GetCostumeNullPos); FUN_00883590("ReplaceCostumeSprite",Entity_Player::ReplaceCostumeSprite); FUN_00880ed0("AddPlayerFormCostume",Entity_Player::AddPlayerFormCostume); FUN_00881090("ResetItemState",Entity_Player::ResetItemState); FUN_008835f0("SpawnMawOfVoid",Entity_Player::SpawnMawOfVoid); FUN_00881090("AddDollarBillEffect",Entity_Player::AddDollarBillEffect); FUN_00883650("ShootRedCandle",Entity_Player::ShootRedCandle); FUN_00880ca0("DoZitEffect",Entity_Player::DoZitEffect); FUN_00881090("SwapActiveItems",Entity_Player::SwapActiveItems); FUN_00880ed0("AddBoneHearts",Entity_Player::AddBoneHearts); FUN_00880ff0("GetBoneHearts",Entity_Player::GetBoneHearts); FUN_00881650("IsBoneHeart",Entity_Player::IsBoneHeart); FUN_00880ff0("GetEffectiveMaxHearts",Entity_Player::GetEffectiveMaxHearts); FUN_008836b0("GetHeartLimit",Entity_Player::GetHeartLimit); FUN_00880e10("CanPickRedHearts",Entity_Player::CanPickRedHearts); FUN_00880e10("CanPickSoulHearts",Entity_Player::CanPickSoulHearts); FUN_00880e10("CanPickBoneHearts",Entity_Player::CanPickBoneHearts); FUN_00881c30("IsSubPlayer",Entity_Player::IsSubPlayer); FUN_00883760("GetSubPlayer",Entity_Player::GetSubPlayer); luabridge::Namespace::Class::addProperty_FireDelay ("FireDelay",Entity_Player::FireDelay,FUN_00782ab0); FUN_00883940("MaxFireDelay",0x1460,1); FUN_00883940("ShotSpeed",0x1464,1); FUN_00883940("Damage",0x1470,1); FUN_00883940("TearHeight",0x1474,1); FUN_00883940("TearFallingSpeed",0x1478,1); FUN_00883940("TearFallingAcceleration",0x147c,1); FUN_00883940("TearRange",0x1480,1); FUN_00883940("MoveSpeed",0x1568,1); luabridge::Namespace::Class::addData_TearFlags("TearFlags",0x1488,1); FUN_00883c30("TearColor",0x1498,1); FUN_00883c30("LaserColor",0x14c4,1); luabridge::Namespace::Class::addData_CanFly("CanFly",0x1570,1); FUN_00883940(&DAT_00b723ac,0x156c,1); luabridge::Namespace::Class::addData_BabySkin("BabySkin",0x1aec,1); luabridge::Namespace::Class::addData_QueuedItem("QueuedItem",0x17c4,1); FUN_00884240("ItemHoldCooldown",0x1884,1); FUN_00884240("HeadFrameDelay",0x1338,1); FUN_008843b0("ChangePlayerType",Entity_Player::ChangePlayerType); FUN_00880ed0("AddBrokenHearts",Entity_Player::AddBrokenHearts); FUN_00880ff0("GetBrokenHearts",Entity_Player::GetBrokenHearts); FUN_00880db0("AddRottenHearts",Entity_Player::AddRottenHearts); FUN_00880ff0("GetRottenHearts",Entity_Player::GetRottenHearts); FUN_00880ed0("AddSoulCharge",Entity_Player::AddSoulCharge); FUN_00880ff0("GetSoulCharge",Entity_Player::GetSoulCharge); FUN_00880ff0("GetEffectiveSoulCharge",Entity_Player::GetEffectiveSoulCharge); FUN_00880ed0("SetSoulCharge",Entity_Player::SetSoulCharge); FUN_00880ed0("AddBloodCharge",Entity_Player::AddBloodCharge); FUN_00880ff0("GetBloodCharge",Entity_Player::GetBloodCharge); FUN_00880ff0("GetEffectiveBloodCharge",Entity_Player::GetEffectiveBloodCharge); FUN_00880ed0("SetBloodCharge",Entity_Player::SetBloodCharge); FUN_00880e10("CanPickRottenHearts",Entity_Player::CanPickRottenHearts); FUN_00883760("GetMainTwin",Entity_Player::GetMainTwin); FUN_00883760("GetOtherTwin",Entity_Player::GetOtherTwin); FUN_00884410("TryHoldEntity",Entity_Player::TryHoldEntity); FUN_008810f0("ThrowHeldEntity",Entity_Player::ThrowHeldEntity); FUN_00884470("AddMinisaac",Entity_Player::AddMinisaac); FUN_008844d0("AddFriendlyDip",Entity_Player::AddFriendlyDip); FUN_00884530("ThrowFriendlyDip",Entity_Player::ThrowFriendlyDip); FUN_00884590("AddWisp",Entity_Player::AddWisp); FUN_008845f0("AddItemWisp",Entity_Player::AddItemWisp); FUN_00884650("AddSwarmFlyOrbital",Entity_Player::AddSwarmFlyOrbital); FUN_008846b0("TriggerBookOfVirtues",Entity_Player::TriggerBookOfVirtues); FUN_00880ff0("GetNumGigaBombs",Entity_Player::GetNumGigaBombs); FUN_00880ed0("AddGigaBombs",Entity_Player::AddGigaBombs); FUN_00884710("SetPocketActiveItem",Entity_Player::SetPocketActiveItem); FUN_00884770("GetModelingClayEffect",Entity_Player::GetModelingClayEffect); FUN_00881090("AddCurseMistEffect",Entity_Player::AddCurseMistEffect); FUN_00881090("RemoveCurseMistEffect",Entity_Player::RemoveCurseMistEffect); FUN_00881c30("HasCurseMistEffect",Entity_Player::HasCurseMistEffect); FUN_00881c30("IsCoopGhost",Entity_Player::IsCoopGhost); FUN_00884820("UsePoopSpell",Entity_Player::UsePoopSpell); FUN_00880ff0("GetMaxPoopMana",Entity_Player::GetMaxPoopMana); FUN_00880ed0("AddPoopMana",Entity_Player::AddPoopMana); FUN_00880ff0("GetPoopMana",Entity_Player::GetPoopMana); FUN_00884880("GetPoopSpell",Entity_Player::GetPoopSpell); FUN_00880f90("GetBodyColor",Entity_Player::GetBodyColor); FUN_00880f90("GetHeadColor",Entity_Player::GetHeadColor); FUN_00884240("SamsonBerserkCharge",0x209c,1); FUN_00883940("IBSCharge",0x20a0,1); FUN_00872510(local_30); local_8._0_1_ = 0x50; FUN_00884930(local_c0,"EntityPickup"); local_8._0_1_ = 0x51; FUN_00884950("Morph",Entity_Pickup::Morph); FUN_008849b0("Charge",Entity_Pickup::Charge,FUN_005b1920); FUN_00884b20("IsShopItem",Entity_Pickup::IsShopItem); FUN_008849b0("Price",Entity_Pickup::Price,Entity_Pickup::update_price_sprite); FUN_00884bc0("GetCoinValue",Entity_Pickup::GetCoinValue); FUN_008849b0("Timeout",Entity_Pickup::Timeout,FUN_0060d1f0); FUN_00884c70("Touched",Entity_Pickup::Touched,FUN_005b1950); FUN_008849b0("ShopItemId",Entity_Pickup::ShopItemId,FUN_007e93d0); FUN_008849b0("OptionsPickupIndex",Entity_Pickup::OptionsPickupIndex,FUN_005b1970); FUN_008849b0(&DAT_00b72764,Entity_Pickup::Wait,FUN_00436210); FUN_00884de0("PlayDropSound",Entity_Pickup::PlayDropSound); FUN_00884de0("PlayPickupSound",Entity_Pickup::PlayPickupSound); FUN_00884b20("CanReroll",Entity_Pickup::CanReroll); FUN_00884de0("AppearFast",Entity_Pickup::AppearFast); FUN_00884e40("TryOpenChest",Entity_Pickup::TryOpenChest); FUN_00884c70("AutoUpdatePrice",Entity_Pickup::AutoUpdatePrice,FUN_0071df70); luabridge::Namespace::Class::addData_State("State",0x584,1); FUN_00872510(local_c8); local_8._0_1_ = 0x52; FUN_00885020(local_70,"EntityEffect"); local_8._0_1_ = 0x53; FUN_00885040("SetTimeout",Entity_Effect::SetTimeout); FUN_008850a0("Rotation",Entity_Effect::Rotation,Entity_Effect::set_rotation); FUN_00885210("FollowParent",Entity_Effect::FollowParent); FUN_00885040("SetDamageSource",Entity_Effect::SetDamageSource); FUN_008850a0("Scale",Entity_Effect::Scale,FUN_00435ed0); FUN_00885270("SetRadii",Entity_Effect::SetRadii); FUN_008850a0("FallingSpeed",Entity_Tear::FallingSpeed,FUN_00444c70); FUN_008850a0("FallingAcceleration",Entity_Tear::FallingAcceleration, Entity_Projectile::set_falling_accel); FUN_008852d0("IsPlayerCreep",Entity_Effect::IsPlayerCreep); FUN_00885330("m_Height",0x410,1); FUN_008854a0("State",0x450,1); FUN_00885330("MinRadius",0x454,1); FUN_00885330("MaxRadius",0x458,1); FUN_008854a0("Timeout",0x45c,1); FUN_008854a0("LifeSpan",0x460,1); luabridge::Namespace::Class::addData_IsFollowing("IsFollowing",0x464,1); luabridge::Namespace::Class::addData_ParentOffset("ParentOffset",0x468,1); FUN_008854a0("DamageSource",0x470,1); FUN_00872510(local_78); local_8._0_1_ = 0x54; FUN_00885910(local_80,"EntityFamiliar"); local_8._0_1_ = 0x55; FUN_00885930("AddCoins",Entity_Familiar::AddCoins); FUN_00885930("AddHearts",Entity_Familiar::AddHearts); FUN_00885930("AddKeys",Entity_Familiar::AddKeys); luabridge::Namespace::Class::addProperty_Player ("Player",Entity_Familiar::Player,Entity_Familiar::set_player); FUN_00885b10("Coins",Entity_Familiar::Coins,FUN_0060d0d0); FUN_00885b10("Hearts",Entity_Familiar::Hearts,FUN_0060d0f0); FUN_00885b10(&DAT_00b728bc,Entity_Familiar::Keys,FUN_005b18d0); FUN_00885c80("PickEnemyTarget",Entity_Familiar::PickEnemyTarget); FUN_00885ce0("FollowParent",Entity_Familiar::FollowParent); FUN_00885d40("FollowPosition",Entity_Familiar::FollowPosition); FUN_00885da0("GetOrbitPosition",Entity_Familiar::GetOrbitPosition); FUN_00885ce0("Shoot",Entity_Familiar::Shoot); FUN_00885e00("FireProjectile",Entity_Familiar::FireProjectile); FUN_00885930("PlayChargeAnim",Entity_Familiar::PlayChargeAnim); FUN_00885930("PlayShootAnim",Entity_Familiar::PlayShootAnim); FUN_00885930("PlayFloatAnim",Entity_Familiar::PlayFloatAnim); FUN_00885930("MoveDelayed",Entity_Familiar::MoveDelayed); FUN_00885e60("MoveDiagonally",Entity_Familiar::MoveDiagonally); FUN_00885ec0("RecalculateOrbitOffset",Entity_Familiar::RecalculateOrbitOffset); FUN_00885ce0("AddToFollowers",Entity_Familiar::AddToFollowers); FUN_00885ce0("AddToDelayed",Entity_Familiar::AddToDelayed); FUN_00885930("AddToOrbit",Entity_Familiar::AddToOrbit); FUN_00885ce0("RemoveFromFollowers",Entity_Familiar::RemoveFromFollowers); FUN_00885ce0("RemoveFromDelayed",Entity_Familiar::RemoveFromDelayed); FUN_00885ce0("RemoveFromOrbit",Entity_Familiar::RemoveFromOrbit); FUN_00885f20("GetOrbitDistance",Entity_Familiar::GetOrbitDistance); FUN_00885f80("FireCooldown",0xd4c,1); FUN_00885f80("HeadFrameDelay",0xd50,1); FUN_00885f80("MoveDirection",0xd54,1); FUN_00885f80("ShootDirection",0xd58,1); FUN_00885f80("LastDirection",0xd5c,1); FUN_008860f0("OrbitAngleOffset",0xd60,1); luabridge::Namespace::Class::addData_OrbitDistance("OrbitDistance",0xd64,1); FUN_008860f0("OrbitSpeed",0xd6c,1); FUN_00885f80("OrbitLayer",0xd70,1); FUN_00885f80("State",0xd88,1); FUN_00885f80("RoomClearCount",0xd8c,1); FUN_008863e0("IsDelayed",0xd75,1); FUN_008863e0("IsFollower",0xd74,1); FUN_00872510(local_88); local_8._0_1_ = 0x56; FUN_00886550(local_58,"EntityProjectile"); local_8._0_1_ = 0x57; FUN_00886570("Height",Entity_Tear::Height,FUN_00450880); FUN_008866e0("AddHeight",Entity_Projectile::AddHeight); FUN_00886570("FallingSpeed",Entity_Tear::FallingSpeed,FUN_00444c70); FUN_008866e0("AddFallingSpeed",Entity_Projectile::AddFallingSpeed); FUN_00886570("FallingAccel",Entity_Tear::FallingAcceleration,Entity_Projectile::set_falling_accel) ; FUN_008866e0("AddFallingAccel",Entity_Projectile::AddFallingAccel); FUN_00886570("HomingStrength",Entity_Tear::BaseScale,FUN_00565de0); FUN_00886570("CurvingStrength",Entity_Projectile::CurvingStrength,FUN_004aad50); FUN_00886570("Acceleration",Entity_Projectile::Acceleration,FUN_004aad70); FUN_00886740("WiggleFrameOffset",Entity_Projectile::WiggleFrameOffset,FUN_00444cb0); FUN_008868b0("AddChangeFlags",Entity_Projectile::AddChangeFlags); FUN_00886910("ChangeFlags",Entity_Projectile::ChangeFlags,FUN_004aad90); FUN_00886570("ChangeVelocity",Entity_Tear::Rotation,FUN_004aadb0); FUN_00886740("ChangeTimeout",Entity_Projectile::ChangeTimeout,FUN_004aadd0); FUN_00886570("Scale",Entity_Tear::Scale,FUN_004508a0); FUN_008866e0("AddScale",Entity_Projectile::AddScale); FUN_008868b0("AddProjectileFlags",Entity_Projectile::AddProjectileFlags); FUN_00886910("ProjectileFlags",Entity_Projectile::ProjectileFlags, Entity_Projectile::set_projectile_flags); FUN_00886570("DepthOffset",Entity::DepthOffset,set_field_358); FUN_00886570("Damage",Entity_Projectile::Damage,FUN_0085e340); FUN_00872510(local_98); local_8._0_1_ = 0x58; FUN_00886a80(local_a0,"EntityNPC"); local_8._0_1_ = 0x59; FUN_00886aa0("Morph",Entity_NPC::Morph); FUN_00886b00("KillUnique",Entity_NPC::KillUnique); luabridge::Namespace::Class::addProperty_CanShutDoors ("CanShutDoors",Entity::CanShutDoors,Entity::SetVisibleFlag); FUN_00886ce0("IsBoss",Entity::IsBoss); FUN_00886d80("ThrowSpider",Entity_NPC::ThrowSpider); FUN_00886de0("GetPlayerTarget",Entity_NPC::GetPlayerTarget); FUN_00886e40("CalcTargetPosition",Entity_NPC::CalcTargetPosition); FUN_00886ea0("GetBossColorIdx",Entity_NPC::GetBossColorIdx); FUN_00886ea0("GetChampionColorIdx",Entity_NPC::GetChampionColorIdx); FUN_00886b00("ResetPathFinderTarget",Entity_NPC::ResetPathFinderTarget); FUN_00886f40("CanBeDamagedFromVelocity",Entity_NPC::CanBeDamagedFromVelocity); FUN_00886ce0("CanReroll",Entity_NPC::CanReroll); luabridge::Namespace::Class::addProperty_Scale ("Scale",Entity_NPC::Scale,Entity_NPC::SetScale); FUN_00886ce0("IsChampion",Entity_NPC::IsChampion); FUN_00887170("MakeChampion",Entity_NPC::MakeChampion); FUN_008871d0("PlaySound",Entity_NPC::PlaySound); FUN_00887230("MakeSplat",Entity_NPC::MakeSplat); FUN_00886ea0("GetAliveEnemyCount",Entity_NPC::GetAliveEnemyCount); FUN_00887290("FireProjectiles",Entity_NPC::FireProjectiles); FUN_008872f0("FireBossProjectiles",Entity_NPC::FireBossProjectiles); FUN_00887350("AnimWalkFrame",Entity_NPC::AnimWalkFrame); FUN_008873b0("QueryNPCsType",Entity_NPC::QueryNPCsType); FUN_00887460("QueryNPCsSpawnerType",Entity_NPC::QueryNPCsSpawnerType); FUN_00887510("QueryNPCsGroup",Entity_NPC::QueryNPCsGroup); FUN_00887570("ParentNPC",Entity_NPC::ParentNPC); FUN_00887570("ChildNPC",Entity_NPC::ChildNPC); luabridge::Namespace::Class::addProperty_EntityRef ("EntityRef",Entity_NPC::EntityRef,Entity_NPC::SetRef_bec); FUN_008877e0("StateFrame",0x410,1); luabridge::Namespace::Class::addData_Pathfinder("Pathfinder",0x414,1); luabridge::Namespace::Class::addData_State("State",0xb64,1); FUN_008877e0("ProjectileCooldown",0xba0,1); FUN_008877e0("ProjectileDelay",0xba4,1); FUN_00887c50(&DAT_00b72c8c,0xbb0,1); FUN_00887c50(&DAT_00b72c74,3000,1); FUN_008877e0(&DAT_00b72c78,0xbc0,1); FUN_008877e0(&DAT_00b72c64,0xbc4,1); FUN_008877e0("GroupIdx",0xc7c,1); FUN_00872510(local_a8); local_8._0_1_ = 0x5a; FUN_00887dc0(local_68,"EntityBomb"); local_8._0_1_ = 0x5b; luabridge::Namespace::Class::addProperty_Flags ("Flags",Entity_Bomb::Flags,FUN_006a6910); luabridge::Namespace::Class::addProperty_IsFetus ("IsFetus",Entity_Bomb::IsFetus,FUN_0060cdb0); FUN_008880f0("ExplosionDamage",Entity_Tear::FallingAcceleration, Entity_Projectile::set_falling_accel); FUN_00888260("SetExplosionCountdown",Entity_Bomb::SetExplosionCountdown); FUN_008880f0("RadiusMultiplier",Entity_Bomb::RadiusMultiplier,FUN_00435e70); FUN_00872510(local_40); local_8._0_1_ = 0x5c; FUN_008882c0(local_38,"EntityLaser"); local_8._0_1_ = 0x5d; FUN_008882e0("ShootAngle",Entity_Laser::ShootAngle); luabridge::Namespace::Class::addProperty_TearFlags ("TearFlags",Entity_Tear::TearFlags,FUN_00456830); FUN_008884c0("Angle",Entity_Projectile::Damage,Entity_NPC::SetAimAngle); FUN_00888630("SetTimeout",Entity_Laser::SetTimeout); FUN_00888690("SetActiveRotation",Entity_Laser::SetActiveRotation); FUN_008886f0("GetRenderZ",Entity_Laser::GetRenderZ); FUN_008887a0("GetEndPoint",Entity_Laser::GetEndPoint); FUN_00888850("IsSampleLaser",Entity_Laser::IsSampleLaser); FUN_008888f0("GetSamples",Entity_Laser::GetSamples); FUN_008888f0("GetNonOptimizedSamples",Entity_Laser::GetNonOptimizedSamples); FUN_00888950("SetOneHit",Entity_Laser::SetOneHit); FUN_00888630("SetHomingType",Entity_Laser::SetHomingType); FUN_008889b0("SetMaxDistance",Entity_Laser::SetMaxDistance); FUN_008884c0("Radius",Entity_Laser::Radius,FUN_0060ce80); FUN_00888850("IsCircleLaser",Entity_Laser::IsCircleLaser); FUN_008889b0("SetBlackHpDropChance",Entity_Laser::SetBlackHpDropChance); FUN_00888950("SetMultidimensionalTouched",Entity_Laser::SetMultidimensionalTouched); FUN_00888a10("CalculateEndPoint",Entity_Laser::CalculateEndPoint); FUN_00888a70("ParentOffset",0x410,1); FUN_00888be0("StartAngleDegrees",0x418,1); FUN_00888be0("AngleDegrees",0x41c,1); FUN_00888be0("LastAngleDegrees",0x420,1); luabridge::Namespace::Class::addData_TearFlags("TearFlags",0x428,1); luabridge::Namespace::Class::addData_Timeout("Timeout",0x458,1); FUN_00889050("FirstUpdate",0x45c,1); luabridge::Namespace::Class::addData_SampleLaser("SampleLaser",0x45d,1); FUN_00889050("Shrink",0x45e,1); FUN_00888be0("LaserLength",0x460,1); luabridge::Namespace::Class::addData_HomingLaser("HomingLaser",0x464,1); FUN_00888be0("CurveStrength",0x4b8,1); FUN_00888be0("Radius",0x4bc,1); FUN_00889050("IsActiveRotating",0x4c0,1); luabridge::Namespace::Class::addData_RotationDelay("RotationDelay",0x4c4,1); FUN_00888be0("RotationDegrees",0x4c8,1); FUN_00888be0("RotationSpd",0x4cc,1); FUN_00888be0("MaxDistance",0x4d0,1); luabridge::Namespace::Class::addData_HomingType("HomingType",0x4d4,1); FUN_00888a70("EndPoint",0x4d8,1); FUN_00889050("DisableFollowParent",0x4e4,1); luabridge::Namespace::Class::addData_BounceLaser("BounceLaser",0x4e8,1); FUN_00888be0("BlackHpDropChance",0x4f4,1); FUN_00889050("OneHit",0x515,1); FUN_00889050("GridHit",0x516,1); FUN_00872510(local_60); local_8._0_1_ = 0x5e; FUN_00889940(local_b0,"EntityKnife"); local_8 = CONCAT31(local_8._1_3_,0x5f); luabridge::Namespace::Class::addProperty_TearFlags ("TearFlags",Entity_Knife::TearFlags,FUN_005cd5c0); FUN_00889ae0("Rotation",Entity_Knife::Rotation,FUN_005b15d0); FUN_00889c50("GetRenderZ",Entity_Laser::GetRenderZ); FUN_00889d00("Shoot",Entity_Knife::Shoot); FUN_00889d60("IsFlying",Entity_Knife::IsFlying); FUN_00889e10("GetKnifeDistance",Entity_Knife::GetKnifeDistance); FUN_00889e10("GetKnifeVelocity",Entity_Knife::GetKnifeVelocity); FUN_00889ae0("RotationOffset",Entity_Knife::RotationOffset,FUN_0060cf20); FUN_00889eb0("SetPathFollowSpeed",Entity_Knife::SetPathFollowSpeed); FUN_00889f10("Reset",Entity_Knife::Reset); FUN_00889f70("Scale",0x430,1); FUN_00889f70("RotationOffset",0x43c,1); FUN_00889f70("MaxDistance",0x45c,1); FUN_00889f70("Charge",0x460,1); FUN_00889f70("PathOffset",0x4c4,1); FUN_00889f70("PathFollowSpeed",0x4c8,1); FUN_00872510(local_b8); luabridge::Namespace::~Namespace(local_b8); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_60); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_40); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_a8); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_98); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_88); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_78); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_c8); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_30); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_50); FUN_0086e4d0(); luabridge::Namespace::~Namespace(&local_28); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_d0); FUN_0085dab0(); local_8 = 0x60; FUN_0088a0e0(local_b8,"GridEntityDesc"); local_8 = CONCAT31(local_8._1_3_,0x61); FUN_0088a100(&DAT_00b6d1a4,0,1); FUN_0088a270("Variant",4,1); FUN_0088a100("State",8,1); FUN_0088a100("SpawnCount",0xc,1); FUN_0088a270("SpawnSeed",0x10,1); FUN_0088a100("VarData",0x14,1); luabridge::Namespace::Class::addData_Initialized("Initialized",0x18,1); FUN_0088a270("VariableSeed",0x1c,1); FUN_00872510(local_d0); luabridge::Namespace::~Namespace(local_d0); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_d8); FUN_0085dab0(); local_8 = 0x62; FUN_0088a560(local_70,"GridEntity"); local_8._0_1_ = 99; FUN_0088a580("Position",GridEntity::Position); FUN_0088a680("SetType",GridEntity::SetType); FUN_0088a6e0("SetVariant",GridEntity::SetVariant); luabridge::Namespace::Class::addProperty_State("State",EntityList::Size,FUN_00665b70); FUN_0088a6e0(&DAT_00b63a04,GridEntity::Init); FUN_0088a8c0("PostInit",GridEntity::PostInit); FUN_0088a8c0("Update",GridEntity::Update); FUN_0088a920("Render",Entity::Update); FUN_0088a980(&DAT_00b73098,GridEntity::Hurt); FUN_0088a9e0("HurtWithSource",GridEntity::HurtWithSource); FUN_0088aa40("Destroy",GridEntity::Destroy); FUN_0088aaa0("DestroyWithSource",Entity::Render); FUN_0088ab00("GetType",GridEntity::GetType); FUN_0088ab60("GetVariant",GridEntity::GetVariant); FUN_0088ab60("GetGridIndex",GridEntity::GetGridIndex); FUN_0088abc0("GetSaveState",TemporaryEffects::GetEffectsList); luabridge::Namespace::Class::addProperty_VarData ("VarData",GridEntity::VarData,FUN_00718ed0); luabridge::Namespace::Class::addData_Desc(&DAT_00b730d4,4,1); luabridge::Namespace::Class::addData_CollisionClass("CollisionClass",0x3c,1); FUN_0088b0c0("GetRNG",GridEntity::GetRNG); FUN_0088b120("GetSprite",GridEntity::GetSprite); FUN_0088b180("ToDoor"); FUN_0088b220("ToPit"); FUN_0088b2c0("ToPoop"); FUN_0088b360("ToRock"); FUN_0088b400("ToPressurePlate"); FUN_0088b4a0("ToSpikes"); FUN_0088b540("ToTNT"); FUN_00872510(local_78); local_8._0_1_ = 100; FUN_0088b5e0(local_80,"GridEntityDoor"); local_8._0_1_ = 0x65; FUN_0088b600("Direction",GridEntity_Door::Direction,FUN_00711530); FUN_0088b600("TargetRoomIndex",GridEntity_Door::TargetRoomIndex,FUN_00738150); FUN_0088b770("SetRoomTypes",GridEntity_Door::SetRoomTypes); FUN_0088b600(&DAT_00b731c4,GridEntity_Door::Slot,FUN_00738160); FUN_0088b7d0(s_Open,GridEntity_Door::Open); FUN_0088b830("Close",GridEntity_Door::Close); FUN_0088b7d0(&DAT_00b731cc,GridEntity_Door::Bar); FUN_0088b7d0("SpawnDust",GridEntity_Door::SpawnDust); FUN_0088b890("CanBlowOpen",GridEntity_Door::CanBlowOpen); FUN_0088b8f0("TryBlowOpen",GridEntity_Door::TryBlowOpen); FUN_0088b950("TryUnlock",GridEntity_Door::TryUnlock); FUN_0088b9b0("IsOpen",GridEntity_Door::IsOpen); FUN_0088b9b0("IsKeyFamiliarTarget",GridEntity_Door::IsKeyFamiliarTarget); FUN_0088b830("SetLocked",GridEntity_Door::SetLocked); FUN_0088b9b0("IsLocked",GridEntity_Door::IsLocked); FUN_0088b9b0("IsBusted",GridEntity_Door::IsBusted); FUN_0088ba50("IsRoomType",GridEntity_Door::IsRoomType); FUN_0088b9b0("IsTargetRoomArcade",GridEntity_Door::IsTargetRoomArcade); FUN_0088bb00("GetSpriteOffset",GridEntity_Door::GetSpriteOffset); luabridge::Namespace::Class::addData("CurrentRoomType",0x15c,1); luabridge::Namespace::Class::addData("TargetRoomType",0x160,1); luabridge::Namespace::Class::addData("Direction",0x164,1); luabridge::Namespace::Class::addData_ExtraSprite("ExtraSprite",0x27c,1); luabridge::Namespace::Class::addData("ExtraVisible",0x390,1); luabridge::Namespace::Class::addData("Busted",0x391,1); luabridge::Namespace::Class::addData("TargetRoomIndex",0x394,1); luabridge::Namespace::Class::addData_PreviousState("PreviousState",0x398,1); luabridge::Namespace::Class::addData_PreviousVariant("PreviousVariant",0x39c,1); luabridge::Namespace::Class::addData("OpenAnimation",0x3a4,1); luabridge::Namespace::Class::addData("CloseAnimation",0x3bc,1); luabridge::Namespace::Class::addData("LockedAnimation",0x3d4,1); luabridge::Namespace::Class::addData("OpenLockedAnimation",0x3ec,1); FUN_00872510(local_88); local_8._0_1_ = 0x66; FUN_0088c440(local_58,"GridEntityPoop"); local_8._0_1_ = 0x67; FUN_0088c460("RespawnRedPoop",GridEntity_Poop::RespawnRedPoop); FUN_0088c460("ReduceSpawnRate",GridEntity_Poop::ReduceSpawnRate); luabridge::Namespace::Class::addData_ReviveTimer("ReviveTimer",0x154,1); luabridge::Namespace::Class::addData_StateAnimation("StateAnimation",0x158,1); luabridge::Namespace::Class::addData_UnderPlayer("UnderPlayer",0x170,1); FUN_00872510(local_98); local_8._0_1_ = 0x68; FUN_0088c940(local_a0,"GridEntityPit"); local_8._0_1_ = 0x69; FUN_0088c960("MakeBridge",GridEntity_Pit::MakeBridge); FUN_0088c9c0("SetLadder",GridEntity_Pit::SetLadder); FUN_0088ca20("UpdateCollision",GridEntity_Pit::UpdateCollision); luabridge::Class::addData_HasLadder("HasLadder",0x154,1); FUN_00872510(local_a8); local_8._0_1_ = 0x6a; FUN_0088cc00(local_68,"GridEntityRock"); local_8._0_1_ = 0x6b; FUN_0088cc20("GetRubbleAnim",GridEntity_Rock::GetRubbleAnim); FUN_0088ccd0("SetBigRockFrame",GridEntity_Rock::SetBigRockFrame); FUN_0088cd30("GetBigRockFrame",GridEntity_Rock::GetBigRockFrame); FUN_0088cde0("UpdateAnimFrame",GridEntity_Rock::UpdateAnimFrame); luabridge::Namespace::Class::addData(&DAT_00b7343c,0x154,1); luabridge::Namespace::Class::addData("RubbleAnim",0x16c,1); luabridge::Class::addData_FrameCnt("FrameCnt",400,1); FUN_00872510(local_40); local_8._0_1_ = 0x6c; FUN_0088d130(local_38,"GridEntityTNT"); local_8._0_1_ = 0x6d; luabridge::Class::addData_FrameCnt("FrameCnt",0x154,1); FUN_00872510(local_60); local_8._0_1_ = 0x6e; FUN_0088d2d0(local_b0,"GridEntityPressurePlate"); local_8._0_1_ = 0x6f; FUN_0088d2f0("Reward",GridEntity_PressurePlate::Reward); luabridge::Class::addData_TimerPlate("TimerPlate",0x154,1); luabridge::Class::addData_NextGreedAnimation ("NextGreedAnimation",0x268,1); luabridge::Class::addData_GreedModeRNG("GreedModeRNG",0x26c,1); FUN_00872510(local_b8); local_8._0_1_ = 0x70; FUN_0088d7d0(local_d0,"GridEntitySpikes"); local_8 = CONCAT31(local_8._1_3_,0x71); luabridge::Class::addData_Timeout("Timeout",0x154,1); FUN_00872510(local_d8); luabridge::Namespace::~Namespace(local_d8); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_b8); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_60); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_40); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_a8); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_98); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_88); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_78); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_e0); lua_register_RoomConfigEntries("RoomConfigEntries"); lua_register_RoomConfigSpawns("RoomConfigSpawns"); FUN_0085dab0(); local_8 = 0x72; FUN_0085da00(local_38,"RoomConfig"); local_8._0_1_ = 0x73; FUN_0088def0(local_60,"Entry"); local_8._0_1_ = 0x74; luabridge::Class::addData_Type(&DAT_00b6d1a4,0,1); luabridge::Namespace::Class::addData("Variant",4,1); luabridge::Namespace::Class::addData("Subtype",6,1); luabridge::Class::addData_Weight("Weight",8,1); FUN_00872510(local_b0); local_8._0_1_ = 0x75; FUN_0088e380(local_b8,s_Spawn); local_8._0_1_ = 0x76; FUN_0088e3a0("PickEntry",Spawn::PickEntry); luabridge::Namespace::Class::addData(&DAT_00b6a748,0,1); luabridge::Namespace::Class::addData(&DAT_00b6d134,2,1); FUN_0088e5c0("Entries",Spawn::Entries); luabridge::Class::addData_EntryCount("EntryCount",8,1); luabridge::Class::addData_SumWeights("SumWeights",0xc,1); FUN_00872510(local_d0); local_8._0_1_ = 0x77; FUN_0088e9c0(local_d8,&DAT_00b734f0); local_8 = CONCAT31(local_8._1_3_,0x78); FUN_0088e9e0("StageID",0,0); FUN_0088e9e0(&DAT_00b6d1a4,8,0); FUN_0088ead0("Variant",0xc,0); FUN_0088ead0("OriginalVariant",0x58,0); FUN_0088ebc0(&DAT_00b734e0,4,0); FUN_0088ead0("Subtype",0x10,0); FUN_0088ecc0(&DAT_00b1b350,0x14,0); FUN_0088e9e0("Difficulty",0x2c,0); FUN_0088edc0("InitialWeight",0x30,0); FUN_0088edc0("Weight",0x34,0); FUN_0088eeb0("Doors",Room::Doors); FUN_0088efb0("Spawns",Room::Spawns); FUN_0088f0b0("SpawnCount",0x44,0); FUN_0088f1b0("Width",0x46,0); FUN_0088f1b0("Height",0x47,0); FUN_0088e9e0("Shape",0x48,0); FUN_00872510(local_e0); luabridge::Namespace::~Namespace(local_e0); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_d0); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_b0); FUN_0086e4d0(); luabridge::Namespace::~Namespace(local_38); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_e8); FUN_0085dab0(); local_8 = 0x79; FUN_0088f2a0(local_e0,"RoomDescriptor"); local_8 = CONCAT31(local_8._1_3_,0x7a); luabridge::Namespace::Class::addData("GridIndex",0,1); luabridge::Namespace::Class::addData("SafeGridIndex",4,1); luabridge::Namespace::Class::addData("ListIndex",8,1); luabridge::Namespace::Class::addData(&DAT_00b7365c,0x10,1); luabridge::Namespace::Class::addData("OverrideData",0x14,1); luabridge::Class::addData_AllowedDoors("AllowedDoors",0x18,1); luabridge::Namespace::Class::addData("DisplayFlags",0x3c,1); luabridge::Namespace::Class::addData("Flags",0x44,1); luabridge::Namespace::Class::addData("VisitedCount",0x40,1); luabridge::Namespace::Class::addProperty ("Clear",RoomDescriptor::Clear,FUN_004aae30); luabridge::Class::addData_ClearCount("ClearCount",0x4a,1); luabridge::Namespace::Class::addProperty ("PressurePlatesTriggered",RoomDescriptor::PressurePlatesTriggered,FUN_007e9150); luabridge::Namespace::Class::addProperty ("SacrificeDone",RoomDescriptor::SacrificeDone,FUN_004aae50); luabridge::Namespace::Class::addProperty ("ChallengeDone",RoomDescriptor::ChallengeDone,FUN_008332a0); luabridge::Namespace::Class::addProperty ("SurpriseMiniboss",RoomDescriptor::SurpriseMiniboss,FUN_00738190); luabridge::Namespace::Class::addProperty ("HasWater",RoomDescriptor::HasWater,FUN_007e9170); luabridge::Namespace::Class::addProperty ("NoReward",RoomDescriptor::NoReward,FUN_005b1690); luabridge::Namespace::Class::addData("PoopCount",0x50,1); luabridge::Namespace::Class::addData("PitsCount",0x54,1); luabridge::Namespace::Class::addData("DecorationSeed",0x58,1); luabridge::Namespace::Class::addData("SpawnSeed",0x5c,1); luabridge::Namespace::Class::addData("AwardSeed",0x60,1); luabridge::Namespace::Class::addData("ShopItemIdx",0xac,1); luabridge::Namespace::Class::addData("ShopItemDiscountIdx",0xae,1); luabridge::Namespace::Class::addData("DeliriumDistance",0xb0,1); FUN_00872510(local_e8); luabridge::Namespace::~Namespace(local_e8); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_f0); FUN_0085dab0(); local_8 = 0x7b; FUN_0088fcf0(local_e8,&DAT_00b734f0); local_8 = CONCAT31(local_8._1_3_,0x7c); FUN_0088fd10("GetBackdropType",Room::GetBackdropType); FUN_0088fdb0("Update",Room::Update); FUN_0088fdb0("Render",Room::Render); FUN_0088fe10("IsInitialized",Room::IsInitialized); FUN_0088fe70("GetGridCollision",Room::GetGridCollision); FUN_0088feb0("GetGridCollisionAtPos",Room::GetGridCollisionAtPos); FUN_0088ff60("GetDoor",Room::GetDoor); FUN_0088ffc0("GetDoorSlotPosition",Room::GetDoorSlotPosition); FUN_00890060("IsDoorSlotAllowed",Room::IsDoorSlotAllowed); FUN_00890110("RemoveDoor",Room::RemoveDoor); FUN_0088fdb0("KeepDoorsClosed",Room::KeepDoorsClosed); FUN_0088fd10("GetType",GridEntity::GetVariant); FUN_00890170("GetDecorationSeed",Room::GetDecorationSeed); FUN_00890170("GetSpawnSeed",Room::GetSpawnSeed); FUN_00890170("GetAwardSeed",Room::GetAwardSeed); FUN_0088fd10("GetRoomShape",Room::GetRoomShape); FUN_0088fd10("GetRoomConfigStage",Room::GetRoomConfigStage); FUN_0088fe90("GetGridPath",Room::GetGridPath); FUN_00890210("GetGridPathFromPos",Room::GetGridPathFromPos); FUN_008902b0("SetGridPath",Room::SetGridPath); FUN_008902b0("DamageGrid",Room::DamageGrid); FUN_00890310("DamageGridWithSource",Room::DamageGridWithSource); FUN_00890370("DestroyGrid",Room::DestroyGrid); FUN_008903d0("DestroyGridWithSource",Room::DestroyGridWithSource); FUN_00890430("CheckLine",Room::CheckLine); FUN_008904e0("GetLaserTarget",Room::GetLaserTarget); FUN_00890590("GetGridEntity",Room::GetGridEntity); FUN_00890640("GetGridEntityFromPos",Room::GetGridEntityFromPos); FUN_0088fd10("GetGridWidth",EntityList::Size); FUN_0088fd10("GetGridHeight",Room::GetGridHeight); FUN_0088fd10("GetGridSize",Room::GetGridSize); FUN_008906f0("IsClear",Room::IsClear); FUN_00890790("SetClear",Room::SetClear); FUN_008907f0("FindFreePickupSpawnPosition",Room::FindFreePickupSpawnPosition); FUN_008908a0("FindFreeTilePosition",Room::FindFreeTilePosition); FUN_00890210("GetGridIndex",Room::GetGridIndex); FUN_00890210("GetClampedGridIndex",Room::GetClampedGridIndex); FUN_0088ffc0("GetGridPosition",Room::GetGridPosition); FUN_008908a0("GetClampedPosition",Room::GetClampedPosition); FUN_00890940("IsPositionInRoom",Room::IsPositionInRoom); FUN_008908a0("ScreenWrapPosition",Room::ScreenWrapPosition); FUN_008906f0("IsLShapedRoom",Room::IsLShapedRoom); FUN_008909f0("GetLRoomAreaDesc",Room::GetLRoomAreaDesc); FUN_00890aa0("GetLRoomTileDesc",Room::GetLRoomTileDesc); FUN_00890b50("GetTopLeftPos",Room::GetTopLeftPos); FUN_00890b50("GetBottomRightPos",Room::GetBottomRightPos); FUN_00890bf0("GetCenterPos",Room::GetCenterPos); FUN_00890c90("SpawnGridEntity",Room::SpawnGridEntity); FUN_00890cf0("RemoveGridEntity",Room::RemoveGridEntity); FUN_00890d50("GetFrameCount",Room::GetFrameCount); FUN_00890db0("GetEntities",Room::GetEntities); FUN_00890d50("GetAliveEnemiesCount",Room::GetAliveEnemiesCount); FUN_00890d50("GetAliveBossesCount",Room::GetAliveBossesCount); FUN_0088fd10("GetBossID",Room::GetBossID); FUN_0088fd10("GetSecondBossID",Room::GetSecondBossID); FUN_00890790("SetSacrificeDone",Room::SetSacrificeDone); FUN_008906f0("IsSacrificeDone",Room::IsSacrificeDone); FUN_008906f0("IsAmbushDone",Room::IsAmbushDone); FUN_00890790("SetAmbushDone",Room::SetAmbushDone); FUN_008906f0("IsAmbushActive",Room::IsAmbushActive); FUN_0088fdb0("ShopRestockPartial",Room::ShopRestockPartial); FUN_0088fdb0("ShopRestockFull",Room::ShopRestockFull); FUN_00890e10("ShopReshuffle",Room::ShopReshuffle); FUN_00890e70("TrySpawnDevilRoomDoor",Room::TrySpawnDevilRoomDoor); FUN_00890ed0("GetDevilRoomChance",Room::GetDevilRoomChance); FUN_00890e70("TrySpawnBossRushDoor",Room::TrySpawnBossRushDoor); FUN_00890f30("TrySpawnMegaSatanRoomDoor",Room::TrySpawnMegaSatanRoomDoor); FUN_00890f90("TrySpawnBlueWombDoor",Room::TrySpawnBlueWombDoor); FUN_00890f30("TrySpawnTheVoidDoor",Room::TrySpawnTheVoidDoor); FUN_0088fdb0("PlayMusic",Room::PlayMusic); FUN_0088fdb0("SetRedHeartDamage",Room::SetRedHeartDamage); FUN_008906f0("GetRedHeartDamage",Room::GetRedHeartDamage); FUN_0088fd10("GetBrokenWatchState",Room::GetBrokenWatchState); FUN_00890110("SetBrokenWatchState",Room::SetBrokenWatchState); FUN_008906f0("IsFirstVisit",Room::IsFirstVisit); FUN_00890b50("GetRenderSurfaceTopLeft",Room::GetRenderSurfaceTopLeft); FUN_00890b50("GetRenderScrollOffset",Room::GetRenderScrollOffset); FUN_008906f0("HasWaterPits",Room::HasWaterPits); FUN_00890ff0("GetSeededCollectible",Room::GetSeededCollectible); FUN_0088fd10("GetShopLevel",Room::GetShopLevel); FUN_0088fdb0("SetCardAgainstHumanity",Room::SetCardAgainstHumanity); FUN_00891050("EmitBloodFromWalls",Room::EmitBloodFromWalls); FUN_0088fdb0("SpawnClearAward",Room::SpawnClearAward); FUN_00890ed0("GetLightingAlpha",Room::GetLightingAlpha); FUN_008910b0("TryMakeBridge",Room::TryMakeBridge); FUN_0088fd10("GetDungeonRockIdx",Room::GetDungeonRockIdx); FUN_0088fd10("GetTintedRockIdx",Room::GetTintedRockIdx); FUN_0088fe10("HasSlowDown",Room::HasSlowDown); FUN_00890110("SetSlowDown",Room::SetSlowDown); FUN_00891110("GetRandomPosition",Room::GetRandomPosition); FUN_00891170("GetRandomTileIndex",Room::GetRandomTileIndex); FUN_0088fdb0("RespawnEnemies",Room::RespawnEnemies); FUN_0088fe10("HasWater",Room::HasWater); FUN_008906f0("HasTriggerPressurePlates",Room::HasTriggerPressurePlates); FUN_008906f0("IsCurrentRoomLastBoss",Room::IsCurrentRoomLastBoss); FUN_008906f0("IsFirstEnemyDead",Room::IsFirstEnemyDead); FUN_00890790("SetFirstEnemyDead",Room::SetFirstEnemyDead); FUN_008911d0("MamaMegaExplosion",Room::MamaMegaExplosion); FUN_0088fd10("GetDeliriumDistance",Room::GetDeliriumDistance); FUN_0088fdb0("TurnGold",Room::TurnGold); FUN_00891230("SetFloorColor",Room::SetFloorColor); FUN_00891230("SetWallColor",Room::SetWallColor); FUN_00891290("WorldToScreenPosition",Room::WorldToScreenPosition); FUN_00890e70("TrySpawnSecretExit",Room::TrySpawnSecretExit); FUN_00890f30("TrySpawnSecretShop",Room::TrySpawnSecretShop); FUN_0088fe10("TrySpawnSpecialQuestDoor",Room::TrySpawnSpecialQuestDoor); FUN_00890790("TriggerClear",Room::TriggerClear); FUN_008906f0("HasLava",Room::HasLava); FUN_00891340("GetLavaIntensity",Room::GetLavaIntensity); FUN_0088fdb0("StopRain",Room::StopRain); FUN_00890bf0("GetWaterCurrent",Room::GetWaterCurrent); FUN_0088fdb0("InvalidatePickupVision",Room::InvalidatePickupVision); FUN_008906f0("IsMirrorWorld",Room::IsMirrorWorld); FUN_008906f0("HasCurseMist",Room::HasCurseMist); FUN_008913e0("GetRenderMode",Room::GetRenderMode); FUN_00891340("GetEnemyDamageInflicted",Room::GetEnemyDamageInflicted); FUN_00872510(local_f0); luabridge::Namespace::~Namespace(local_f0); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_f8); lua_register_RoomDescriptor_array("RoomDescriptor"); lua_register_intValues("intValues"); FUN_0085dab0(); local_8 = 0x7d; FUN_00891a10(local_f0,"Level"); local_8 = CONCAT31(local_8._1_3_,0x7e); FUN_00891a30("Update",Level::Update); FUN_00891a90("SetStage",Level::SetStage); FUN_00891a30("SetNextStage",Level::SetNextStage); FUN_00891af0("GetName",Level::GetName); FUN_00891b50("CanStageHaveCurseOfLabyrinth",Level::CanStageHaveCurseOfLabyrinth); FUN_00891af0("GetCurseName",Level::GetCurseName); FUN_00891bb0("ShowName",Level::ShowName); FUN_00891c10("GetStateFlag",Level::GetStateFlag); FUN_00891cb0("SetStateFlag",Level::SetStateFlag); FUN_00891d10("GetCurrentRoom",Level::GetCurrentRoom); FUN_00891d70("GetPreviousRoomIndex",Level::GetPreviousRoomIndex); FUN_00891d70("GetCurrentRoomIndex",Level::GetCurrentRoomIndex); FUN_00891d70("GetRoomCount",Level::GetRoomCount); FUN_00891e10("GetRandomRoomIndex",Level::GetRandomRoomIndex); FUN_00891d70("GetNonCompleteRoomIndex",Level::GetNonCompleteRoomIndex); FUN_00891ec0("GetRoomByIdx",Level::GetRoomByIdx); FUN_00891f20("GetCurrentRoomDesc",Game::GetCurrentRoomDesc); FUN_00891f20("GetLastRoomDesc",Level::GetLastRoomDesc); FUN_00891fb0("GetRooms",Level::GetRooms); FUN_00891d70("GetStartingRoomIndex",Level::GetStartingRoomIndex); FUN_00892060("QueryRoomTypeIndex",Level::QueryRoomTypeIndex); FUN_00891d70("GetLastBossRoomListIndex",Level::GetLastBossRoomListIndex); FUN_00891c10("CanOpenChallengeRoom",Level::CanOpenChallengeRoom); luabridge::Namespace::Class::addProperty("EnterDoor",Level::EnterDoor,FUN_0057be30); luabridge::Namespace::Class::addProperty("LeaveDoor",Level::LeaveDoor,FUN_00428ae0); FUN_00892230("GetEnterPosition",Level::GetEnterPosition); luabridge::Class::addProperty_DungeonReturnPosition ("DungeonReturnPosition",Level::DungeonReturnPosition,FUN_0057be60); luabridge::Namespace::Class::addProperty ("DungeonReturnRoomIndex",Level::DungeonReturnRoomIndex,FUN_0057be90); FUN_00891a90("ChangeRoom",Level::ChangeRoom); FUN_00892460("ForceHorsemanBoss",Level::ForceHorsemanBoss); FUN_008924c0("GetStage",EntityPtr::Ref); FUN_00891d70("GetCurses",Level::GetCurses); FUN_00892520("IsAltStage",Level::IsAltStage); FUN_00891d70("GetStageType",GridEntity::GetType); FUN_00892520("HasBossChallenge",Level::HasBossChallenge); FUN_00892520("IsDevilRoomDisabled",Level::IsDevilRoomDisabled); FUN_00891a30("DisableDevilRoom",Level::DisableDevilRoom); FUN_00891a30("UpdateVisibility",Game::UpdateVisibility); FUN_00891a30("ApplyMapEffect",Level::ApplyMapEffect); FUN_00891a30("ApplyBlueMapEffect",Level::ApplyBlueMapEffect); FUN_00891bb0("ApplyCompassEffect",Level::ApplyCompassEffect); FUN_00891a30("RemoveCompassEffect",Level::RemoveCompassEffect); FUN_00891a30("ShowMap",Level::ShowMap); FUN_00891a30("SetHeartPicked",Level::SetHeartPicked); FUN_00892520("GetHeartPicked",Level::GetHeartPicked); FUN_00892520("GetCanSeeEverything",Level::GetCanSeeEverything); FUN_00891bb0("SetCanSeeEverything",Level::SetCanSeeEverything); FUN_00891cb0("AddCurse",Level::AddCurse); FUN_008925c0("RemoveCurses",Level::RemoveCurses); FUN_00892620("GetDungeonPlacementSeed",Level::GetDungeonPlacementSeed); FUN_008926d0("GetDevilAngelRoomRNG",Level::GetDevilAngelRoomRNG); FUN_00892730("CanSpawnDevilRoom",Level::CanSpawnDevilRoom); FUN_00892790("InitializeDevilAngelRoom",Level::InitializeDevilAngelRoom); FUN_00891a90("UncoverHiddenDoor",Level::UncoverHiddenDoor); luabridge::Class::addProperty_GreedModeWave ("GreedModeWave",Level::GreedModeWave,FUN_00753800); FUN_00891a30("SetRedHeartDamage",Level::SetRedHeartDamage); FUN_00892520("IsNextStageAvailable",Level::IsNextStageAvailable); FUN_00891d70("GetAbsoluteStage",Level::GetAbsoluteStage); FUN_00892970("AddAngelRoomChance",Level::AddAngelRoomChance); FUN_008929d0("GetAngelRoomChance",Level::GetAngelRoomChance); FUN_00892a80("MakeRedRoomDoor",Level::MakeRedRoomDoor); FUN_00892ae0("GetPlanetariumChance",Game::GetPlanetariumChance); FUN_00892520("IsAscent",Level::IsAscent); FUN_00892520("IsPreAscent",Level::IsPreAscent); FUN_00872510(local_f8); luabridge::Namespace::~Namespace(local_f8); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_100); FUN_0085dab0(); local_8 = 0x7f; FUN_00892b40(local_f8,"Seeds"); local_8 = CONCAT31(local_8._1_3_,0x80); FUN_00892b60("SetStartSeed",Seeds::SetStartSeed); FUN_00892bc0("ClearStartSeed",Seeds::ClearStartSeed); FUN_00892c20("IsCustomRun",Room::IsInitialized); FUN_00892cc0("Restart",Seeds::Restart); FUN_00892bc0("Reset",Seeds::Reset); FUN_00892c20("IsInitialized",Level::IsAltStage); FUN_00892d20("GetStartSeed",Seeds::GetStartSeed); FUN_00892dc0("GetStartSeedString",Seeds::GetStartSeedString); FUN_00892e70("GetNextSeed",Seeds::GetNextSeed); FUN_00892ed0("GetStageSeed",Seeds::GetStageSeed); FUN_00892d20("GetPlayerInitSeed",Seeds::GetPlayerInitSeed); FUN_00892cc0("ForgetStageSeed",Seeds::ForgetStageSeed); FUN_00892f80("String2Seed",Seeds::String2Seed); FUN_00892fe0("Seed2String",Seeds::Seed2String); FUN_00893040("IsStringValidSeed",Seeds::IsStringValidSeed); FUN_008930a0("GetSeedEffect",Seeds::GetSeedEffect); FUN_00893100("HasSeedEffect",Seeds::HasSeedEffect); FUN_00892cc0("AddSeedEffect",Seeds::AddSeedEffect); FUN_00892cc0("RemoveSeedEffect",Seeds::RemoveSeedEffect); FUN_00892cc0("RemoveBlockingSeedEffects",Seeds::RemoveBlockingSeedEffects); FUN_00892bc0("ClearSeedEffects",Seeds::ClearSeedEffects); FUN_00893040("IsSpecialSeed",Seeds::IsSpecialSeed); FUN_008931b0("CanAddSeedEffect",Seeds::CanAddSeedEffect); FUN_00892d20("CountSeedEffects",Seeds::CountSeedEffects); FUN_00893210("IsSeedComboBanned",Seeds::IsSeedComboBanned); FUN_00893270("InitSeedInfo",Seeds::InitSeedInfo); FUN_008932d0("CountUnlockedSeedEffects",Seeds::CountUnlockedSeedEffects); FUN_00872510(local_100); luabridge::Namespace::~Namespace(local_100); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_108); FUN_0085dab0(); local_8 = 0x81; FUN_00893330(local_100,"ItemPool"); local_8 = CONCAT31(local_8._1_3_,0x82); FUN_00893350("GetCollectible",ItemPool::GetCollectible); FUN_008933b0("RemoveCollectible",ItemPool::RemoveCollectible); FUN_00893410("RemoveTrinket",ItemPool::RemoveTrinket); FUN_00893470("ResetTrinkets",ItemPool::ResetTrinkets); FUN_008934d0("GetTrinket",ItemPool::GetTrinket); FUN_00893530("GetCard",ItemPool::GetCard); FUN_008935e0("GetPill",ItemPool::GetPill); FUN_00893690("GetPillEffect",ItemPool::GetPillEffect); FUN_008936f0("IdentifyPill",ItemPool::IdentifyPill); FUN_00893750("IsPillIdentified",ItemPool::IsPillIdentified); FUN_00893800("ForceAddPillEffect",ItemPool::ForceAddPillEffect); FUN_00893860("GetLastPool",ItemPool::GetLastPool); FUN_00893910("GetPoolForRoom",ItemPool::GetPoolForRoom); FUN_00893470("ResetRoomBlacklist",ItemPool::ResetRoomBlacklist); FUN_008936f0("AddRoomBlacklist",ItemPool::AddRoomBlacklist); FUN_008939c0("AddBibleUpgrade",ItemPool::AddBibleUpgrade); FUN_00872510(local_108); luabridge::Namespace::~Namespace(local_108); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_110); FUN_0085dab0(); local_8 = 0x83; FUN_00893a20(local_108,&DAT_00b6b338); local_8 = CONCAT31(local_8._1_3_,0x84); FUN_00893a40("FlashChargeBar",HUD::FlashChargeBar); FUN_00893a40("InvalidateActiveItem",HUD::InvalidateActiveItem); FUN_00893aa0("InvalidateCraftingItem",HUD::InvalidateCraftingItem); FUN_00893b00("IsVisible",HUD::IsVisible); FUN_00893bb0("SetVisible",HUD::SetVisible); FUN_00872530("ShowItemText",HUD::ShowItemText); FUN_00872530("ShowFortuneText",HUD::ShowFortuneText); FUN_00893c10("AssignPlayerHUDs",HUD::AssignPlayerHUDs); FUN_00893c10("Update",HUD::Update); FUN_00893c10("PostUpdate",HUD::PostUpdate); FUN_00893c10("Render",HUD::Render); FUN_00872510(local_110); luabridge::Namespace::~Namespace(local_110); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_118); FUN_0085dab0(); local_8 = 0x85; FUN_00893c70(local_110,&DAT_00b74634); local_8 = CONCAT31(local_8._1_3_,0x86); FUN_00893c90("Update",Game::Update); FUN_00893c90("Render",Game::Render); FUN_00893cf0("IsPaused",Game::IsPaused); FUN_00893d90(s_Spawn,Game::Spawn); FUN_00893df0("SpawnEntityDesc",Game::SpawnEntityDesc); FUN_00893e50("BombDamage",Game::BombDamage); FUN_00893eb0("BombExplosionEffects",Game::BombExplosionEffects); FUN_00893f10("BombTearflagEffects",Game::BombTearflagEffects); FUN_00893f70(&DAT_00b1deb4,Game::Fart); FUN_00893fe0("CharmFart",Game::CharmFart); FUN_00894040("ButterBeanFart",Game::ButterBeanFart); FUN_008940a0("RerollEnemy",Game::RerollEnemy); FUN_00894100("SpawnParticles",Game::SpawnParticles); FUN_00894160("GetFont",Game::GetFont); FUN_008941c0("GetLevel",Config::GetCollectibles); FUN_00894220("GetRoom",Level::GetCurrentRoom); FUN_00894280("GetPlayer",Game::GetPlayer); FUN_008942e0("GetNearestPlayer",Game::GetNearestPlayer); FUN_00894340("GetRandomPlayer",Game::GetRandomPlayer); FUN_008943a0("GetNumPlayers",Game::GetNumPlayers); FUN_00894440("GetItemPool",Game::GetItemPool); FUN_008944a0("GetItemOverlay",Game::GetItemOverlay); FUN_00894500("GetHUD",Game::GetHUD); FUN_00894560("GetSeeds",Game::GetSeeds); FUN_008945c0(&DAT_00b1c00c,Game::End); FUN_00893c90("ShowFortune",Game::ShowFortune); FUN_00893c90("ShowRule",Game::ShowRule); FUN_00894620("StartRoomTransition",Game::StartRoomTransition); FUN_00894680("ChangeRoom",Game::ChangeRoom); FUN_008946e0("StartStageTransition",Game::StartStageTransition); FUN_00894740("MoveToRandomRoom",Game::MoveToRandomRoom); FUN_008947a0("GetFrameCount",Game::GetFrameCount); FUN_00894840("GetStateFlag",Game::GetStateFlag); FUN_008948f0("SetStateFlag",Game::SetStateFlag); luabridge::Namespace::Class::addProperty ("BossRushParTime",Game::BossRushParTime,FUN_00738390); luabridge::Namespace::Class::addProperty ("BlueWombParTime",Game::BlueWombParTime,FUN_0085e3b0); FUN_008945c0("SetLastDevilRoomStage",Game::SetLastDevilRoomStage); FUN_00894ac0("GetLastDevilRoomStage",Game::GetLastDevilRoomStage); FUN_00893c90("AddTreasureRoomsVisited",Game::AddTreasureRoomsVisited); FUN_008947a0("GetTreasureRoomVisitCount",Game::GetTreasureRoomVisitCount); FUN_00893c90("AddStageWithoutHeartsPicked",Game::AddStageWithoutHeartsPicked); FUN_00893c90("ClearStagesWithoutHeartsPicked",Game::ClearStagesWithoutHeartsPicked); FUN_008947a0("GetStagesWithoutHeartsPicked",Game::GetStagesWithoutHeartsPicked); FUN_00893c90("AddStageWithoutDamage",Game::AddStageWithoutDamage); FUN_00893c90("ClearStagesWithoutDamage",Game::ClearStagesWithoutDamage); FUN_008947a0("GetStagesWithoutDamage",Game::GetStagesWithoutDamage); FUN_00893c90("AddDevilRoomDeal",Game::AddDevilRoomDeal); FUN_008945c0("DonateGreed",Game::DonateGreed); FUN_008945c0("DonateAngel",Game::DonateAngel); FUN_008947a0("GetDevilRoomDeals",Game::GetDevilRoomDeals); FUN_008947a0("GetDonationModGreed",Game::GetDonationModGreed); FUN_008947a0("GetDonationModAngel",Game::GetDonationModAngel); FUN_00893c90("ClearDonationModGreed",Game::ClearDonationModGreed); FUN_00893c90("ClearDonationModAngel",Game::ClearDonationModAngel); FUN_008945c0("SetLastLevelWithDamage",Game::SetLastLevelWithDamage); FUN_00894ac0("GetLastLevelWithDamage",Game::GetLastLevelWithDamage); FUN_00894b60("AddEncounteredBoss",Game::AddEncounteredBoss); FUN_00894bc0("GetNumEncounteredBosses",Game::GetNumEncounteredBosses); FUN_00894c20("HasEncounteredBoss",Game::HasEncounteredBoss); FUN_008943a0("GetGreedWavesNum",Game::GetGreedWavesNum); FUN_008943a0("GetGreedBossWaveNum",Game::GetGreedBossWaveNum); FUN_008945c0("SetLastLevelWithoutHalfHp",Game::SetLastLevelWithoutHalfHp); FUN_00894ac0("GetLastLevelWithoutHalfHp",Game::GetLastLevelWithoutHalfHp); FUN_008945c0("ShakeScreen",Game::ShakeScreen); luabridge::Class::addProperty_ScreenShakeOffset ("ScreenShakeOffset",Game::ScreenShakeOffset,FUN_007e92e0); FUN_00894e00("GetScreenShakeCountdown",Game::GetScreenShakeCountdown); FUN_00894eb0("Darken",Game::Darken); FUN_00894f10("GetDarknessModifier",Game::GetDarknessModifier); FUN_00894f10("GetTargetDarkness",Game::GetTargetDarkness); luabridge::Namespace::Class::addProperty("Challenge",Game::Challenge,FUN_007068f0); FUN_00894f70("Difficulty",Game::Difficulty); FUN_008947a0("GetVictoryLap",Game::GetVictoryLap); FUN_00893c90("NextVictoryLap",Game::NextVictoryLap); FUN_00893cf0("IsGreedMode",Game::IsGreedMode); FUN_00893c90("RerollLevelCollectibles",Game::RerollLevelCollectibles); FUN_00895070("RerollLevelPickups",Game::RerollLevelPickups); FUN_00893c90("FinishChallenge",Game::FinishChallenge); FUN_008945c0("AddPixelation",Game::AddPixelation); FUN_00894680("ShowHallucination",Game::ShowHallucination); FUN_00893cf0("HasHallucination",Game::HasHallucination); FUN_008950d0("UpdateStrangeAttractor",Game::UpdateStrangeAttractor); FUN_00895130("GetAmbush",Game::GetAmbush); FUN_00895190("Fadein",Game::Fadein); FUN_008951f0("Fadeout",Game::Fadeout); FUN_00895250("MakeShockwave",Game::MakeShockwave); luabridge::Class::addData_TimeCounter("TimeCounter",0x264fc,1); FUN_00872510(local_118); luabridge::Namespace::~Namespace(local_118); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_120); FUN_0085dab0(); local_8 = 0x87; FUN_00895430(local_118,"SFXManager"); local_8 = CONCAT31(local_8._1_3_,0x88); FUN_00895450(&DAT_00b70498,SoundEffects::Play); FUN_008954b0("AdjustVolume",SFXManager::AdjustVolume); FUN_008954b0("AdjustPitch",SFXManager::AdjustPitch); FUN_00895510(&DAT_00b1d6f4,SFXManager::Stop); FUN_00895570("StopLoopingSounds",SFXManager::StopLoopingSounds); FUN_00895510("Preload",SFXManager::Preload); FUN_008955d0("IsPlaying",SFXManager::IsPlaying); FUN_00895630("SetAmbientSound",SFXManager::SetAmbientSound); FUN_00895690("GetAmbientSoundVolume",SFXManager::GetAmbientSoundVolume); FUN_00872510(local_120); luabridge::Namespace::~Namespace(local_120); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_128); FUN_0085dab0(); local_8 = 0x89; FUN_008956f0(local_120,"MusicManager"); local_8 = CONCAT31(local_8._1_3_,0x8a); FUN_00895710(&DAT_00b70498,Music::Play); FUN_008957d0("Fadein",Music::Fadein); FUN_00895770("Crossfade",MusicManager::Crossfade); FUN_00895830("Queue",MusicManager::Queue); FUN_00895890("Fadeout",Music::Fadeout); FUN_008958f0("Pause",Music::Pause); FUN_008958f0("Resume",Music::Resume); FUN_00895950("EnableLayer",MusicManager::EnableLayer); FUN_00895830("DisableLayer",Music::DisableLayer); FUN_008959b0("IsLayerEnabled",Music::IsLayerEnabled); FUN_008958f0("Enable",MusicManager::Enable); FUN_008958f0("Disable",MusicManager::Disable); FUN_00895a60("IsEnabled",MusicManager::IsEnabled); FUN_00895890("PitchSlide",MusicManager::PitchSlide); FUN_008958f0("ResetPitch",Music::ResetPitch); FUN_00895b10("VolumeSlide",Music::VolumeSlide); FUN_008958f0("UpdateVolume",Music::UpdateVolume); FUN_00895b70("GetCurrentMusicID",MusicManager::GetCurrentMusicID); FUN_00895b70("GetQueuedMusicID",MusicManager::GetQueuedMusicID); FUN_00872510(local_128); luabridge::Namespace::~Namespace(local_128); FUN_0086e4d0(); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_130); FUN_0085dab0(); local_8 = 0x8b; FUN_00895c10("Random",MusicManager::Random); FUN_00895c70("RandomVector",MusicManager::RandomVector); FUN_00895cd0("Game_0",MusicManager::Game_0); FUN_00895d30("SFXManager",MusicManager::SFXManager); FUN_00895d90("MusicManager",MusicManager::MusicManager); FUN_0085da00(local_130,"Isaac"); local_8 = CONCAT31(local_8._1_3_,0x8c); FUN_00895df0("DebugString",Isaac::DebugString); FUN_0085da20("GetPlayer",Isaac::GetPlayer); FUN_00895e50("GetFrameCount",Isaac::GetFrameCount); FUN_00895eb0(s_Spawn,Isaac::Spawn); FUN_00895f10("GridSpawn",Isaac::GridSpawn); FUN_00895f70("RenderText",Isaac::RenderText); FUN_00895fd0("RenderScaledText",Isaac::RenderScaledText); FUN_00896030("GetTextWidth",Isaac::GetTextWidth); FUN_00895c70("GetRandomPosition",Isaac::GetRandomPosition); FUN_00896090("GetFreeNearPosition",Isaac::GetFreeNearPosition); FUN_008960f0("Explode",Isaac::Explode); FUN_00896150("AddPillEffectToPool",Isaac::AddPillEffectToPool); FUN_008961b0("GetRoomEntities",Isaac::GetRoomEntities); FUN_00895e50("GetChallenge",Isaac::GetChallenge); FUN_00896210("GetEntityTypeByName",Isaac::GetEntityTypeByName); FUN_00896210("GetEntityVariantByName",Isaac::GetEntityVariantByName); FUN_00896210("GetItemIdByName",Isaac_GetItemIdByName); FUN_00896270("GetPlayerTypeByName",Isaac::GetPlayerTypeByName); FUN_00896210("GetCardIdByName",Isaac::GetCardIdByName); FUN_00896210("GetPillEffectByName",Isaac::GetPillEffectByName); FUN_00896210("GetTrinketIdByName",Isaac::GetTrinketIdByName); FUN_00896210("GetChallengeIdByName",Isaac::GetChallengeIdByName); FUN_00896210("GetCostumeIdByPath",Isaac::GetCostumeIdByPath); FUN_00896210("GetCurseIdByName",Isaac::GetCurseIdByName); FUN_00896210("GetSoundIdByName",Isaac::GetSoundIdByName); FUN_00896210("GetMusicIdByName",Isaac::GetMusicIdByName); FUN_00895c10("GetTime",Isaac::GetTime); FUN_008962d0("ExecuteCommand",Isaac::ExecuteCommand); FUN_00895df0("ConsoleOutput",Isaac::ConsoleOutput); FUN_00896330("GetItemConfig",Isaac::GetItemConfig); FUN_0085da20("FindInRadius",Isaac::FindInRadius); FUN_0085da20("FindByType",Isaac::FindByType); FUN_0085da20("CountEntities",Isaac::CountEntities); FUN_00895e50("CountBosses",Isaac::CountBosses); FUN_00895e50("CountEnemies",Isaac::CountEnemies); FUN_00896390("RegisterMod",Isaac::RegisterMod); FUN_008963f0("SetBuiltInCallbackState",Isaac::SetBuiltInCallbackState); FUN_00896450("GetBuiltInCallbackState",Isaac::GetBuiltInCallbackState); FUN_008964b0("SaveModData",Isaac::SaveModData); FUN_00896510("LoadModData",Isaac::LoadModData); FUN_00896570("HasModData",Isaac::HasModData); FUN_008965d0("RemoveModData",Isaac::RemoveModData); FUN_00896630("ScreenToWorld",Isaac::ScreenToWorld); FUN_00896630("WorldToScreen",Isaac::WorldToScreen); FUN_00896630("WorldToScreenDistance",Isaac::WorldToScreenDistance); FUN_00896630("WorldToRenderPosition",Isaac::WorldToRenderPosition); FUN_00896630("ScreenToWorldDistance",Isaac::ScreenToWorldDistance); FUN_00896690("GetScreenWidth",Isaac::GetScreenWidth); FUN_00896690("GetScreenHeight",Isaac::GetScreenHeight); FUN_00896690("GetScreenPointScale",Isaac::GetScreenPointScale); luabridge::Namespace::~Namespace(local_130); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_138); FUN_0085dab0(); local_8 = 0x8d; FUN_0085da00(local_138,"Input"); local_8 = CONCAT31(local_8._1_3_,0x8e); FUN_008966f0("IsButtonTriggered",Input::IsButtonTriggered); FUN_008966f0("IsButtonPressed",Input::IsButtonPressed); FUN_00896750("GetButtonValue",Input::GetButtonValue); FUN_008966f0("IsActionTriggered",Input::IsActionTriggered); FUN_008966f0("IsActionPressed",Input::IsActionPressed); FUN_00896750("GetActionValue",Input::GetActionValue); FUN_00896450("IsMouseBtnPressed",Input::IsMouseBtnPressed); FUN_008967b0("GetMousePosition",Input::GetMousePosition); luabridge::Namespace::~Namespace(local_138); local_8 = 0xffffffff; luabridge::Namespace::~Namespace(local_140); FUN_0085dab0(); local_8 = 0x8f; FUN_0085da00(local_148,"Options"); local_8 = CONCAT31(local_8._1_3_,0x90); FUN_008968b0("MusicVolume",Options::MusicVolume,FUN_00896820); FUN_008968b0("SFXVolume",Options::SFXVolume,FUN_008969f0); FUN_008968b0("MapOpacity",Options::MapOpacity,FUN_00896a60); FUN_00896ae0("Fullscreen",Options::Fullscreen,FUN_00896ac0); FUN_00896ae0("Filter",Options::Filter,FUN_00896c20); FUN_008968b0("Gamma",Options::Gamma,FUN_00896c50); FUN_00896cf0("DisplayPopups",Options::DisplayPopups,FUN_00896cb0); FUN_00896cf0("CameraStyle",Options::CameraStyle,FUN_00896e30); FUN_00896cf0("ExtraHUDStyle",Options::ExtraHUDStyle,FUN_00896e80); FUN_008968b0("HUDOffset",Options::HUDOffset,FUN_00896ed0); FUN_00896ae0("FoundHUD",Options::FoundHUD,FUN_00896f30); FUN_00896ae0("RumbleEnabled",Options::RumbleEnabled,FUN_00896f60); FUN_00896ae0("ChargeBars",Options::ChargeBars,FUN_00896f90); FUN_00896ae0("BulletVisibility",Options::BulletVisibility,FUN_00896fc0); FUN_00896ae0("VSync",Options::VSync,FUN_00896ff0); FUN_00896ae0("PauseOnFocusLost",Options::PauseOnFocusLost,FUN_00897020); FUN_00896ae0("MouseControl",Options::MouseControl,FUN_00897050); FUN_00896cf0("AnnouncerVoiceMode",Options::AnnouncerVoiceMode,FUN_00897090); FUN_00897120("MaxScale",Options::MaxScale,FUN_008970e0); FUN_00897120("MaxRenderScale",Options::MaxRenderScale,FUN_00897260); FUN_00897120("ConsoleFont",Options::ConsoleFont,FUN_008972b0); FUN_00896ae0("FadedConsoleDisplay",Options::FadedConsoleDisplay,FUN_008972e0); FUN_00896ae0("SaveCommandHistory",Options::SaveCommandHistory,FUN_00897310); FUN_00896ae0("UseBorderlessFullscreen",Options::UseBorderlessFullscreen,FUN_00897340); FUN_00896ae0("DebugConsoleEnabled",Options::DebugConsoleEnabled,FUN_00897370); FUN_00896cf0("JacobEsauControls",Options::JacobEsauControls,FUN_008973a0); FUN_008973e0("Language",Options::Language,0); luabridge::Namespace::~Namespace(local_148); luabridge::Namespace::~Namespace(local_150); lua_pushcclosure(*(undefined4 *)(in_ECX + 0x18),FUN_008603d0,0); lua_setglobal(*(undefined4 *)(in_ECX + 0x18),"GetPtrHash"); if (*(char *)(in_ECX + 0x1c) == '\0') { lua_pushcclosure(*(undefined4 *)(in_ECX + 0x18),FUN_0085fec0,0); lua_setglobal(*(undefined4 *)(in_ECX + 0x18),"require"); } lua_pushcclosure(*(undefined4 *)(in_ECX + 0x18),&LAB_00860000,0); lua_setglobal(*(undefined4 *)(in_ECX + 0x18),"include"); lua_pushcclosure(*(undefined4 *)(in_ECX + 0x18),FUN_008601f0,0); lua_setglobal(*(undefined4 *)(in_ECX + 0x18),"print"); ExceptionList = local_10; return; } //@@ 0086e4d0 FUN_0086e4d0 void FUN_0086e4d0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11c0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; FUN_0085cce0(*(undefined4 *)(in_ECX + 4)); ExceptionList = local_10; return; } //@@ 0086e520 LuaEngine::destroy /* ZHL [exact] __thiscall void LuaEngine::destroy(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall LuaEngine::destroy(LuaEngine *this) { LuaEngine LVar1; int *piVar2; piVar2 = (int *)*DAT_00c7985c; if (piVar2 != DAT_00c7985c) { do { FUN_00870e00(piVar2 + 2); piVar2 = (int *)*piVar2; } while (piVar2 != DAT_00c7985c); } FUN_008975d0(); *DAT_00c7985c = (int)DAT_00c7985c; DAT_00c7985c[1] = (int)DAT_00c7985c; DAT_00c79860 = 0; LVar1 = this[4]; if (LVar1 != (LuaEngine)0x0) { luaL_unref(*(undefined4 *)LVar1,0xfff0b9d8,*(undefined4 *)((int)LVar1 + 4)); operator_delete((void *)LVar1,8); this[4] = (LuaEngine)0x0; } LVar1 = this[5]; if (LVar1 != (LuaEngine)0x0) { luaL_unref(*(undefined4 *)LVar1,0xfff0b9d8,*(undefined4 *)((int)LVar1 + 4)); operator_delete((void *)LVar1,8); this[5] = (LuaEngine)0x0; } lua_close(this[6]); this[6] = (LuaEngine)0x0; return; } //@@ 0086e5e0 FUN_0086e5e0 undefined1 FUN_0086e5e0(char *param_1) { qword qVar1; undefined1 uVar2; undefined4 *puVar3; FILE *_File; char *_Dest; qword *pqVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x131); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); _Dest = (char *)0x0; } else { *puVar3 = 0x131; _Dest = (char *)(puVar3 + 1); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 0x131; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xfffffece < (uint)qVar1); } strncpy(_Dest,param_1,300); _File = fopen(_Dest,"r"); if (_File != (FILE *)0x0) { fclose(_File); } uVar2 = FUN_0086e6c0(_Dest); local_8 = 0; tracked_alloc(1,_Dest,0); ExceptionList = local_10; return uVar2; } //@@ 0086e6c0 FUN_0086e6c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined1 FUN_0086e6c0(byte *param_1) { undefined4 uVar1; bool bVar2; byte bVar3; uint uVar4; byte *pbVar5; uint length; undefined4 *puVar6; int *piVar7; undefined4 *******pppppppuVar8; int iVar9; Console *this; char *this_00; std_string *psVar10; int in_ECX; byte *a; byte *pbVar11; void *pvVar12; byte *******pppppppbVar13; int *piVar14; undefined1 uStack_a1; undefined4 *******pppppppuStack_a0; int iStack_9c; int iStack_98; int iStack_94; undefined8 uStack_90; byte *******apppppppbStack_88 [4]; uint uStack_78; uint uStack_74; void *pvStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined8 uStack_60; std_string *psStack_54; char acStack_50 [4]; char acStack_4c [4]; char acStack_48 [4]; undefined8 uStack_44; std_string sStack_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = acStack_48 + 0x44; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b04af8; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(acStack_48 + 0x38); ExceptionList = &local_1c; local_24 = uVar4; KAGE_LogMessage(1,(byte *)"Running Lua Script: %s\n"); piVar7 = (int *)*DAT_00c7985c; if ((int *)*DAT_00c7985c != DAT_00c7985c) { do { pbVar11 = (byte *)(piVar7 + 2); pbVar5 = param_1; do { bVar3 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar3 != 0); a = pbVar11; if (0xf < (uint)piVar7[7]) { a = *(byte **)pbVar11; } bVar3 = str_eq(a,piVar7[6],param_1,(int)pbVar5 - (int)(param_1 + 1)); if (bVar3 == 0) { piVar14 = (int *)*piVar7; } else { FUN_00870e00(pbVar11); piVar14 = (int *)*piVar7; *(int **)piVar7[1] = piVar14; *(int *)(*piVar7 + 4) = piVar7[1]; DAT_00c79860 = DAT_00c79860 + -1; std::string::_Tidy_deallocate((char *)(piVar7 + 0xe)); std::string::_Tidy_deallocate((char *)(piVar7 + 8)); std::string::_Tidy_deallocate((char *)(piVar7 + 2)); operator_delete(piVar7,0x58); } piVar7 = piVar14; } while (piVar14 != DAT_00c7985c); } uStack_44._0_4_ = 0; uStack_44._4_4_ = 0xf; psStack_54 = (std_string *)0x0; uStack_14._0_1_ = 0; uStack_14._1_3_ = 0; if (*(char *)(in_ECX + 0x1c) != '\0') { uVar1 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(uVar1,"package",uVar4); lua_getfield(uVar1,0xffffffff,&DAT_00b66e0c); pbVar5 = (byte *)lua_tolstring(uVar1,0xffffffff,0); sStack_3c._buf._0_4_ = (std_string *)0x0; sStack_3c._size = 0; sStack_3c._capacity = 0xf; pbVar11 = pbVar5; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); std::string::assign(sStack_3c._buf,pbVar5,(int)pbVar11 - (int)(pbVar5 + 1)); lua_settop(uVar1,0xfffffffe); if (0xf < uStack_44._4_4_) { uVar4 = uStack_44._4_4_ + 1; psVar10 = psStack_54; if (0xfff < uVar4) { psVar10 = (std_string *)psStack_54[-1]._capacity; uVar4 = uStack_44._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)psStack_54 + (-4 - (int)psVar10))) goto LAB_0086eb09; } operator_delete(psVar10,uVar4); } uStack_78 = 0; psStack_54 = (std_string *)sStack_3c._buf._0_4_; acStack_50[0] = sStack_3c._buf[4]; acStack_50[1] = sStack_3c._buf[5]; acStack_50[2] = sStack_3c._buf[6]; acStack_50[3] = sStack_3c._buf[7]; acStack_4c[0] = sStack_3c._buf[8]; acStack_4c[1] = sStack_3c._buf[9]; acStack_4c[2] = sStack_3c._buf[10]; acStack_4c[3] = sStack_3c._buf[0xb]; acStack_48[0] = sStack_3c._buf[0xc]; acStack_48[1] = sStack_3c._buf[0xd]; acStack_48[2] = sStack_3c._buf[0xe]; acStack_48[3] = sStack_3c._buf[0xf]; uStack_74 = 0xf; uStack_44._0_4_ = sStack_3c._size; uStack_44._4_4_ = sStack_3c._capacity; apppppppbStack_88[0] = (byte *******)0x0; pbVar11 = param_1; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); std::string::assign((char *)apppppppbStack_88,param_1,(int)pbVar11 - (int)(param_1 + 1)); uVar4 = uStack_78; uStack_14._0_1_ = 1; pppppppbVar13 = (byte *******)apppppppbStack_88; if (0xf < uStack_74) { pppppppbVar13 = apppppppbStack_88[0]; } length = std::string::find_last_of((byte *)pppppppbVar13,uStack_78,0xffffffff,&DAT_00b6ac04,2); sStack_3c._size = 0; sStack_3c._capacity = 0xf; if (uVar4 < length) { length = uVar4; } sStack_3c._buf._0_4_ = (std_string *)0x0; pppppppbVar13 = (byte *******)apppppppbStack_88; if (0xf < uStack_74) { pppppppbVar13 = apppppppbStack_88[0]; } std::string::assign(sStack_3c._buf,(byte *)pppppppbVar13,length); uStack_14._0_1_ = 2; puVar6 = std::string::append(sStack_3c._buf,&UNK_00b75324,7); pvStack_70 = (void *)*puVar6; uStack_6c = puVar6[1]; uStack_68 = puVar6[2]; uStack_64 = puVar6[3]; uStack_60 = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; uStack_14._0_1_ = 3; psVar10 = (std_string *)&psStack_54; if (0xf < uStack_44._4_4_) { psVar10 = psStack_54; } piVar7 = std::string::append((char *)&pvStack_70,(byte *)psVar10,(uint)uStack_44); pppppppuStack_a0 = (undefined4 *******)*piVar7; iStack_9c = piVar7[1]; iStack_98 = piVar7[2]; iStack_94 = piVar7[3]; uStack_90 = *(undefined8 *)(piVar7 + 4); piVar7[4] = 0; piVar7[5] = 0xf; *(undefined1 *)piVar7 = 0; uStack_14._0_1_ = 2; if (0xf < uStack_60._4_4_) { uVar4 = uStack_60._4_4_ + 1; pvVar12 = pvStack_70; if (0xfff < uVar4) { pvVar12 = *(void **)((int)pvStack_70 + -4); uVar4 = uStack_60._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_70 + (-4 - (int)pvVar12))) goto LAB_0086ea85; } operator_delete(pvVar12,uVar4); } uStack_14._0_1_ = 1; uStack_60 = 0xf00000000; pvStack_70 = (void *)((uint)pvStack_70 & 0xffffff00); if (0xf < sStack_3c._capacity) { uVar4 = sStack_3c._capacity + 1; psVar10 = (std_string *)sStack_3c._buf._0_4_; if (0xfff < uVar4) { psVar10 = (std_string *)((std_string *)(sStack_3c._buf._0_4_ + -0x18))->_capacity; uVar4 = sStack_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(sStack_3c._buf._0_4_ + (-4 - (int)psVar10))) goto LAB_0086ea85; } operator_delete(psVar10,uVar4); } uStack_14._0_1_ = 0; sStack_3c._size = 0; sStack_3c._capacity = 0xf; sStack_3c._buf._0_4_ = sStack_3c._buf._0_4_ & 0xffffff00; if (0xf < uStack_74) { uVar4 = uStack_74 + 1; pppppppbVar13 = apppppppbStack_88[0]; if (0xfff < uVar4) { pppppppbVar13 = (byte *******)apppppppbStack_88[0][-1]; uVar4 = uStack_74 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppppbStack_88[0] + (-4 - (int)pppppppbVar13))) { LAB_0086ea85: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar13,uVar4); } uVar1 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(uVar1,"package"); pppppppuVar8 = &pppppppuStack_a0; if (0xf < uStack_90._4_4_) { pppppppuVar8 = pppppppuStack_a0; } lua_pushstring(uVar1,pppppppuVar8); lua_setfield(uVar1,0xfffffffe,&DAT_00b66e0c); lua_settop(uVar1,0xfffffffe); if (0xf < uStack_90._4_4_) { uVar4 = uStack_90._4_4_ + 1; pppppppuVar8 = pppppppuStack_a0; if (0xfff < uVar4) { pppppppuVar8 = (undefined4 *******)pppppppuStack_a0[-1]; uVar4 = uStack_90._4_4_ + 0x24; if (0x1f < (uint)((int)pppppppuStack_a0 + (-4 - (int)pppppppuVar8))) { LAB_0086eb09: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar8,uVar4); } } pbVar11 = param_1; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); std::string::assign((char *)&DAT_00c35e00,param_1,(int)pbVar11 - (int)(param_1 + 1)); _DAT_00bf942c = -1; iVar9 = luaL_loadfilex(*(undefined4 *)(in_ECX + 0x18),param_1,0); if (iVar9 == 0) { iVar9 = lua_pcallk(*(undefined4 *)(in_ECX + 0x18),0,0xffffffff,0,0,0); bVar2 = false; if (iVar9 == 0) goto LAB_0086eb8c; } bVar2 = true; LAB_0086eb8c: if (*(char *)(in_ECX + 0x1c) != '\0') { uVar1 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(uVar1,"package"); psVar10 = (std_string *)&psStack_54; if (0xf < uStack_44._4_4_) { psVar10 = psStack_54; } lua_pushstring(uVar1,psVar10); lua_setfield(uVar1,0xfffffffe,&DAT_00b66e0c); lua_settop(uVar1,0xfffffffe); } if (bVar2) { iVar9 = lua_gettop(*(undefined4 *)(in_ECX + 0x18)); if (0 < iVar9) { iVar9 = lua_type(*(undefined4 *)(in_ECX + 0x18),0xffffffff); if (iVar9 == 4) { pbVar11 = (byte *)lua_tolstring(*(undefined4 *)(in_ECX + 0x18),0xffffffff,0); KAGE_LogMessage(1,(byte *)"ERR: %s\n"); if (g_game != (Game *)0x0) { this = &g_game->_console; sStack_3c._size = 0; sStack_3c._capacity = 0xf; sStack_3c._buf._0_4_ = (std_string *)0x0; pbVar5 = pbVar11; do { bVar3 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar3 != 0); std::string::assign(sStack_3c._buf,pbVar11,(int)pbVar5 - (int)(pbVar11 + 1)); uStack_14._0_1_ = 4; Console::PrintError(this,&sStack_3c); uStack_14._0_1_ = 0; if (0xf < sStack_3c._capacity) { uVar4 = sStack_3c._capacity + 1; psVar10 = (std_string *)sStack_3c._buf._0_4_; if (0xfff < uVar4) { psVar10 = (std_string *)((std_string *)(sStack_3c._buf._0_4_ + 0xffffffe8))->_capacity ; uVar4 = sStack_3c._capacity + 0x24; if (0x1f < (uint)(sStack_3c._buf._0_4_ + (-4 - (int)psVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar10,uVar4); } sStack_3c._size = 0; sStack_3c._capacity = 0xf; sStack_3c._buf._0_4_ = sStack_3c._buf._0_4_ & 0xffffff00; } } lua_settop(*(undefined4 *)(in_ECX + 0x18),0); } KAGE_LogMessage(1,(byte *)"There was an error running the lua file: %s\n"); iVar9 = _DAT_00bf942c; std::string::string((char *)&pvStack_70,&DAT_00c35e00); uStack_14._0_1_ = 5; if ((iVar9 != -1) && (iVar9 != 1)) { KAGE_LogMessage(1,(byte *) "The error might be from compatibility issue, please update the mod!\n"); this_00 = (char *)FUN_0085f080(); uStack_14._0_1_ = 6; puVar6 = std::string::append(this_00,(byte *)"/update.it",10); sStack_3c._buf._0_4_ = *puVar6; sStack_3c._buf._4_4_ = puVar6[1]; sStack_3c._buf._8_4_ = puVar6[2]; sStack_3c._buf._12_4_ = puVar6[3]; sStack_3c._16_8_ = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; uStack_14._0_1_ = 8; if (0xf < uStack_90._4_4_) { uVar4 = uStack_90._4_4_ + 1; pppppppuVar8 = pppppppuStack_a0; if (0xfff < uVar4) { pppppppuVar8 = (undefined4 *******)pppppppuStack_a0[-1]; uVar4 = uStack_90._4_4_ + 0x24; if (0x1f < (uint)((int)pppppppuStack_a0 + (-4 - (int)pppppppuVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppuVar8,uVar4); } psVar10 = &sStack_3c; if (0xf < sStack_3c._capacity) { psVar10 = (std_string *)sStack_3c._buf._0_4_; } uStack_90 = 0xf00000000; pppppppuStack_a0 = (undefined4 *******)((uint)pppppppuStack_a0 & 0xffffff00); piVar7 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)psVar10,0); if (piVar7 != (int *)0x0) { (**(code **)(*piVar7 + 0x34))(); } if (0xf < sStack_3c._capacity) { uVar4 = sStack_3c._capacity + 1; psVar10 = (std_string *)sStack_3c._buf._0_4_; if (0xfff < uVar4) { psVar10 = (std_string *)((std_string *)(sStack_3c._buf._0_4_ + -0x18))->_capacity; uVar4 = sStack_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(sStack_3c._buf._0_4_ + (-4 - (int)psVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar10,uVar4); } } if (0xf < uStack_60._4_4_) { uVar4 = uStack_60._4_4_ + 1; pvVar12 = pvStack_70; if (0xfff < uVar4) { pvVar12 = *(void **)((int)pvStack_70 + -4); uVar4 = uStack_60._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_70 + (-4 - (int)pvVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar4); } uStack_a1 = 0; } else { lua_gc(*(undefined4 *)(in_ECX + 0x18),2,0); lua_gc(*(undefined4 *)(in_ECX + 0x18),4,0); lua_gc(*(undefined4 *)(in_ECX + 0x18),3,0); KAGE_LogMessage(1,(byte *)"Lua mem usage: %d KB and %d bytes\n"); uStack_a1 = 1; } if (0xf < uStack_44._4_4_) { uVar4 = uStack_44._4_4_ + 1; psVar10 = psStack_54; if (0xfff < uVar4) { psVar10 = (std_string *)psStack_54[-1]._capacity; uVar4 = uStack_44._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)psStack_54 + (-4 - (int)psVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar10,uVar4); } ExceptionList = local_1c; return uStack_a1; } //@@ 0086ef30 Isaac::DebugString /* ZHL [lua] Lua binding Isaac:DebugString */ void Isaac::DebugString(void) { KAGE_LogMessage(1,(byte *)"Lua Debug: %s\n"); return; } //@@ 0086ef50 Isaac::GetPlayer /* ZHL [lua] Lua binding Isaac:GetPlayer */ undefined4 Isaac::GetPlayer(void *param_1) { int iVar1; int iVar2; uint Index; Entity_Player *pEVar3; undefined4 *puVar4; undefined4 uVar5; void *local_1c; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04b3d; local_10 = ExceptionList; ExceptionList = &local_10; lua_pushvalue(param_1,1,__security_cookie ^ (int)register0x00000010 - 4U); local_1c = param_1; iVar1 = luaL_ref(param_1,0xfff0b9d8); local_8 = 0; local_18 = iVar1; if ((g_game == (Game *)0x0) || ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0)) { uVar5 = 0; goto LAB_0086f060; } if (iVar1 == -1) { LAB_0086f006: Index = 0; } else { LuaRef::push(&local_1c,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 0) goto LAB_0086f006; Index = FUN_00897500(); } pEVar3 = Game::GetPlayer(g_game,Index); if (pEVar3 == (Entity_Player *)0x0) { lua_pushnil(param_1); uVar5 = 1; } else { puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = pEVar3; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); uVar5 = 1; } LAB_0086f060: luaL_unref(param_1,0xfff0b9d8,iVar1); ExceptionList = local_10; return uVar5; } //@@ 0086f090 Isaac::GetFrameCount /* ZHL [lua] Lua binding Isaac:GetFrameCount */ int Isaac::GetFrameCount(void) { return g_manager->_framecount; } //@@ 0086f0a0 Isaac::Spawn /* ZHL [lua] Lua binding Isaac:Spawn */ void Isaac::Spawn(uint param_1,uint param_2,uint param_3,Vector *param_4,Vector *param_5, Entity *param_6) { uint seed; seed = ::Random(); Game::Spawn(g_game,param_1,param_2,param_4,param_5,param_6,param_3,seed); return; } //@@ 0086f0d0 Isaac::GridSpawn /* ZHL [lua] Lua binding Isaac:GridSpawn */ undefined4 Isaac::GridSpawn(uint param_1,uint param_2,float *param_3,char param_4) { Room *this; int iVar1; uint uVar2; int iVar3; uint GridIndex; this = g_game->_room; iVar3 = (int)((*param_3 - 40.0) / 40.0 + 0.5); if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) || (iVar1 = (int)((param_3[1] - 120.0) / 40.0 + 0.5), iVar1 < 0)) || (this->_gridHeight <= iVar1) ) { GridIndex = 0xffffffff; } else { GridIndex = this->_gridWidth * iVar1 + iVar3; if (GridIndex < 0x1c0) { if (((this->_gridEntities[GridIndex] == (void *)0x0) || (iVar3 = *(int *)((int)this->_gridEntities[GridIndex] + 4), iVar3 == 1)) || ((iVar3 == 10 || (param_4 != '\0')))) { uVar2 = ::Random(); Room::SpawnGridEntity(this,GridIndex,param_1,param_2,uVar2,0); return *(undefined4 *)((int)g_game->_room + GridIndex * 4 + 0x24); } return 0; } } uVar2 = ::Random(); Room::SpawnGridEntity(this,GridIndex,param_1,param_2,uVar2,0); return 0; } //@@ 0086f1b0 Isaac::RenderText /* ZHL [lua] Lua binding Isaac:RenderText */ void Isaac::RenderText(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04b6d; local_10 = ExceptionList; ExceptionList = &local_10; local_40 = 0; local_3c = 0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_8 = 0; local_24 = param_4; local_20 = param_5; local_1c = param_6; local_14 = 0; local_18 = param_7; if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } Font::DrawString(param_1,&local_24,&local_40); ExceptionList = local_10; return; } //@@ 0086f280 Isaac::RenderScaledText /* ZHL [lua] Lua binding Isaac:RenderScaledText */ void Isaac::RenderScaledText (byte *param_1,float param_2,float param_3,float param_4,float param_5,float param_6, float param_7,float param_8,float param_9) { Vector pos; Vector scale; FontSettings local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; KColor local_24; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04b6d; local_10 = ExceptionList; ExceptionList = &local_10; local_40 = (FontSettings)0x0; local_3c = 0xffff; local_38 = 0; local_34 = 0x3f800000; local_30 = 0xffffffff; local_2c = 0; local_28 = 0; local_8 = 0; local_24._red = param_6; local_24._green = param_7; local_24._blue = param_8; local_24._unk = 0; local_24._alpha = param_9; if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } pos.y = param_3; pos.x = param_2; scale.y = param_5; scale.x = param_4; Font::DrawString(&g_manager->_font5_terminus8,param_1,pos,scale,&local_24,&local_40); ExceptionList = local_10; return; } //@@ 0086f370 Isaac::GetTextWidth /* ZHL [lua] Lua binding Isaac:GetTextWidth */ void Isaac::GetTextWidth(byte *param_1) { if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } Font::get_string_width_n(&g_manager->_font5_terminus8,param_1,-1); return; } //@@ 0086f3a0 Isaac::GetRandomPosition /* ZHL [lua] Lua binding Isaac:GetRandomPosition */ Vector * Isaac::GetRandomPosition(Vector *param_1) { Room::GetRandomPosition(g_game->_room,param_1,0.0); return param_1; } //@@ 0086f3d0 Isaac::GetFreeNearPosition /* ZHL [lua] Lua binding Isaac:GetFreeNearPosition */ Vector * Isaac::GetFreeNearPosition(Vector *param_1,Vector *param_2,float param_3) { Room::FindFreePickupSpawnPosition(g_game->_room,param_1,param_2,param_3,0,0,0); return param_1; } //@@ 0086f400 Isaac::Explode /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Isaac:Explode */ void Isaac::Explode(Vector *param_1,Entity *param_2,float param_3) { ColorMod local_38; uint local_c; local_c = __security_cookie ^ (uint)&local_38; local_38._tint[0] = 1.0; local_38._tint[1] = 1.0; local_38._tint[2] = 1.0; local_38._tint[3] = 1.0; local_38._offset[0] = 0.0; local_38._offset[1] = 0.0; local_38._offset[2] = 0.0; local_38._colorize[0] = 0.0; local_38._colorize[1] = 0.0; local_38._colorize[2] = 0.0; local_38._colorize[3] = 0.0; Game::BombExplosionEffects (g_game,param_1,param_3,(BitSet128)ZEXT816(0),&local_38,param_2,1.0,1,4,0); return; } //@@ 0086f4b0 Isaac::SetBuiltInCallbackState /* ZHL [exact] static __cdecl void Isaac::SetBuiltInCallbackState(int callbackid, bool enabled); prototype: REPENTOGON, confirmed by RET 0 */ void __cdecl Isaac::SetBuiltInCallbackState(int callbackid,byte enabled) { uint *puVar1; if ((uint)callbackid < 0x4a) { puVar1 = (uint *)(*(int *)g_luaEngine + ((uint)callbackid >> 5) * 4); if (enabled != 0) { *puVar1 = *puVar1 | 1 << (callbackid & 0x1fU); return; } *puVar1 = *puVar1 & ~(1 << (callbackid & 0x1fU)); } return; } //@@ 0086f4f0 Isaac::GetBuiltInCallbackState /* ZHL [exact] static __cdecl bool Isaac::GetBuiltInCallbackState(int callbackid); prototype: REPENTOGON, confirmed by RET 0 */ byte __cdecl Isaac::GetBuiltInCallbackState(int callbackid) { if ((uint)callbackid < 0x4a) { return (*(uint *)(*(int *)g_luaEngine + ((uint)callbackid >> 5) * 4) & 1 << ((byte)callbackid & 0x1f)) != 0; } return 0; } //@@ 0086f520 Isaac::GetEntityTypeByName /* ZHL [lua] Lua binding Isaac:GetEntityTypeByName */ int Isaac::GetEntityTypeByName(byte *param_1) { int *piVar1; int *piVar2; byte bVar3; byte *b; byte *a; int *local_c; int *local_8; piVar1 = (g_manager->_entityConfig)._entities._head; piVar2 = (int *)*piVar1; while( true ) { if (piVar1 == piVar2) { return 0; } local_c = piVar1; local_8 = piVar1; std::_Tree_iterator::operator_decrement(&local_8); a = (byte *)(local_8 + 9); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } if (0xf < (uint)local_8[0xe]) { a = *(byte **)a; } bVar3 = str_eq(a,local_8[0xd],b,*(uint *)(param_1 + 0x10)); if (bVar3 != 0) break; std::_Tree_iterator::operator_decrement(&local_c); piVar1 = local_c; } local_c = piVar1; std::_Tree_iterator::operator_decrement(&local_c); return local_c[6]; } //@@ 0086f5b0 Isaac::GetEntityVariantByName /* ZHL [lua] Lua binding Isaac:GetEntityVariantByName */ int Isaac::GetEntityVariantByName(byte *param_1) { int *piVar1; int *piVar2; byte bVar3; byte *b; byte *a; int *local_c; int *local_8; piVar1 = (g_manager->_entityConfig)._entities._head; piVar2 = (int *)*piVar1; while( true ) { if (piVar1 == piVar2) { return -1; } local_c = piVar1; local_8 = piVar1; std::_Tree_iterator::operator_decrement(&local_8); a = (byte *)(local_8 + 9); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } if (0xf < (uint)local_8[0xe]) { a = *(byte **)a; } bVar3 = str_eq(a,local_8[0xd],b,*(uint *)(param_1 + 0x10)); if (bVar3 != 0) break; std::_Tree_iterator::operator_decrement(&local_c); piVar1 = local_c; } local_c = piVar1; std::_Tree_iterator::operator_decrement(&local_c); return local_c[7]; } //@@ 0086f640 LuaEngine::Isaac_GetItemIdByName /* ZHL [exact] static __cdecl int LuaEngine::Isaac_GetItemIdByName(std_string * name); prototype: REPENTOGON, confirmed by RET 0 */ int __cdecl LuaEngine::Isaac_GetItemIdByName(std_string *name) { uint *puVar1; void *pvVar2; byte *b; int iVar3; undefined1 local_1c [8]; void *local_14; void *local_10 [3]; FUN_00737b30(&(g_manager->_itemConfig)._collectibleNameMap); std::map::_Find_lower_bound(local_1c,name); pvVar2 = local_10[0]; if (*(char *)((int)local_14 + 0xd) == '\0') { b = (byte *)((int)local_14 + 0x10); if (0xf < *(uint *)((int)local_14 + 0x24)) { b = *(byte **)b; } puVar1 = &name->_size; if (0xf < name->_capacity) { name = *(std_string **)name->_buf; } iVar3 = string_compare((byte *)name,*puVar1,b,*(uint *)((int)local_14 + 0x20)); if ((-1 < iVar3) && (local_14 != pvVar2)) { iVar3 = *(int *)((int)local_14 + 0x28); goto LAB_0086f6ad; } } iVar3 = -1; LAB_0086f6ad: FUN_004235c0(local_10,*(undefined4 *)((int)pvVar2 + 4)); operator_delete(local_10[0],0x2c); return iVar3; } //@@ 0086f6e0 Isaac::GetTrinketIdByName /* ZHL [lua] Lua binding Isaac:GetTrinketIdByName */ undefined4 Isaac::GetTrinketIdByName(byte *param_1) { void *pvVar1; int iVar2; byte bVar3; byte *a; byte *b; void *pvVar4; pvVar4 = (g_manager->_itemConfig)._trinkets._end; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; do { do { if (pvVar4 == pvVar1) { return 0xffffffff; } iVar2 = *(int *)((int)pvVar4 + -4); pvVar4 = (void *)((int)pvVar4 + -4); } while (iVar2 == 0); a = (byte *)(iVar2 + 8); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } if (0xf < *(uint *)(iVar2 + 0x1c)) { a = *(byte **)a; } bVar3 = str_eq(a,*(uint *)(iVar2 + 0x18),b,*(uint *)(param_1 + 0x10)); } while (bVar3 == 0); return *(undefined4 *)(iVar2 + 4); } //@@ 0086f760 Isaac::GetPlayerTypeByName /* ZHL [lua] Lua binding Isaac:GetPlayerTypeByName */ undefined4 Isaac::GetPlayerTypeByName(byte *param_1,char param_2) { void *pvVar1; byte bVar2; byte *b; char cVar3; byte *a; void *pvVar4; pvVar4 = (g_manager->_entityConfig)._players._end; pvVar1 = (g_manager->_entityConfig)._players._begin; do { if (pvVar4 == pvVar1) { return 0xffffffff; } b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } a = (byte *)((int)pvVar4 + -0x144); if (0xf < *(uint *)((int)pvVar4 + -0x130)) { a = *(byte **)a; } bVar2 = str_eq(a,*(uint *)((int)pvVar4 + -0x134),b,*(uint *)(param_1 + 0x10)); if (bVar2 != 0) { if ((*(int *)((int)pvVar4 + -0x2c) == 0) && ((*(int *)((int)pvVar4 + -0x148) < 0x15 || (0x28 < *(int *)((int)pvVar4 + -0x148))))) { cVar3 = '\0'; } else { cVar3 = '\x01'; } if (param_2 == cVar3) { return *(undefined4 *)((int)pvVar4 + -0x148); } } pvVar4 = (void *)((int)pvVar4 + -0x148); } while( true ); } //@@ 0086f800 Isaac::GetCardIdByName /* ZHL [lua] Lua binding Isaac:GetCardIdByName */ undefined4 Isaac::GetCardIdByName(byte *param_1) { void *pvVar1; undefined4 *puVar2; byte bVar3; byte *a; byte *b; void *pvVar4; pvVar4 = (g_manager->_itemConfig)._cards._end; pvVar1 = (g_manager->_itemConfig)._cards._begin; do { do { if (pvVar4 == pvVar1) { return 0xffffffff; } puVar2 = *(undefined4 **)((int)pvVar4 + -4); pvVar4 = (void *)((int)pvVar4 + -4); } while (puVar2 == (undefined4 *)0x0); a = (byte *)(puVar2 + 0xe); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } if (0xf < (uint)puVar2[0x13]) { a = *(byte **)a; } bVar3 = str_eq(a,puVar2[0x12],b,*(uint *)(param_1 + 0x10)); } while (bVar3 == 0); return *puVar2; } //@@ 0086f880 Isaac::GetPillEffectByName /* ZHL [lua] Lua binding Isaac:GetPillEffectByName */ undefined4 Isaac::GetPillEffectByName(byte *param_1) { void *pvVar1; undefined4 *puVar2; byte bVar3; byte *a; byte *b; void *pvVar4; pvVar4 = (g_manager->_itemConfig)._pillEffects._end; pvVar1 = (g_manager->_itemConfig)._pillEffects._begin; do { do { if (pvVar4 == pvVar1) { return 0xffffffff; } puVar2 = *(undefined4 **)((int)pvVar4 + -4); pvVar4 = (void *)((int)pvVar4 + -4); } while (puVar2 == (undefined4 *)0x0); a = (byte *)(puVar2 + 2); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } if (0xf < (uint)puVar2[7]) { a = *(byte **)a; } bVar3 = str_eq(a,puVar2[6],b,*(uint *)(param_1 + 0x10)); } while (bVar3 == 0); return *puVar2; } //@@ 0086f900 Isaac::GetChallengeIdByName /* ZHL [lua] Lua binding Isaac:GetChallengeIdByName */ int Isaac::GetChallengeIdByName(byte *param_1) { int iVar1; byte bVar2; byte *b; byte *a; byte *pbVar3; int iVar4; pbVar3 = (g_manager->_challengeParams)._begin; iVar4 = 0; iVar1 = ((int)(g_manager->_challengeParams)._end - (int)pbVar3) / 0xa4; if (0 < iVar1) { do { b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } a = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { a = *(byte **)pbVar3; } bVar2 = str_eq(a,*(uint *)(pbVar3 + 0x10),b,*(uint *)(param_1 + 0x10)); if (bVar2 != 0) { return iVar4; } iVar4 = iVar4 + 1; pbVar3 = pbVar3 + 0xa4; } while (iVar4 < iVar1); } return -1; } //@@ 0086f980 Isaac::GetCostumeIdByPath /* ZHL [lua] Lua binding Isaac:GetCostumeIdByPath */ undefined4 Isaac::GetCostumeIdByPath(byte *param_1) { int *piVar1; int iVar2; byte bVar3; byte *b; byte *a; int *piVar4; piVar4 = (g_manager->_itemConfig)._nullItems._end; piVar1 = (g_manager->_itemConfig)._nullItems._begin; do { if (piVar4 == piVar1) { return 0xffffffff; } iVar2 = piVar4[-1]; piVar4 = piVar4 + -1; a = (byte *)(iVar2 + 0x84); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } if (0xf < *(uint *)(iVar2 + 0x98)) { a = *(byte **)a; } bVar3 = str_eq(a,*(uint *)(iVar2 + 0x94),b,*(uint *)(param_1 + 0x10)); } while (bVar3 == 0); return *(undefined4 *)(*piVar4 + 4); } //@@ 0086f9f0 Isaac::GetCurseIdByName /* ZHL [lua] Lua binding Isaac:GetCurseIdByName */ undefined4 Isaac::GetCurseIdByName(byte *param_1) { uint *puVar1; undefined4 *puVar2; byte bVar3; byte *b; byte *a; undefined4 *puVar4; puVar4 = (g_game->_roomConfig)._curses._end; puVar2 = (g_game->_roomConfig)._curses._begin; do { if (puVar4 == puVar2) { return 0xffffffff; } b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } a = (byte *)(puVar4 + -6); puVar1 = puVar4 + -2; if (0xf < (uint)puVar4[-1]) { a = *(byte **)a; } puVar4 = puVar4 + -7; bVar3 = str_eq(a,*puVar1,b,*(uint *)(param_1 + 0x10)); } while (bVar3 == 0); return *puVar4; } //@@ 0086fa50 Isaac::GetMusicIdByName /* ZHL [lua] Lua binding Isaac:GetMusicIdByName */ undefined4 Isaac::GetMusicIdByName(byte *param_1) { uint *puVar1; undefined4 *puVar2; byte bVar3; byte *b; byte *a; undefined4 *puVar4; puVar4 = (g_manager->_musicManager)._entries._end; puVar2 = (g_manager->_musicManager)._entries._begin; do { if (puVar4 == puVar2) { return 0xffffffff; } b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } a = (byte *)(puVar4 + -0x17); puVar1 = puVar4 + -0x13; if (0xf < (uint)puVar4[-0x12]) { a = *(byte **)a; } puVar4 = puVar4 + -0x18; bVar3 = str_eq(a,*puVar1,b,*(uint *)(param_1 + 0x10)); } while (bVar3 == 0); return *puVar4; } //@@ 0086fab0 Isaac::GetSoundIdByName /* ZHL [lua] Lua binding Isaac:GetSoundIdByName */ undefined4 Isaac::GetSoundIdByName(byte *param_1) { void *pvVar1; byte bVar2; byte *b; byte *a; void *pvVar3; pvVar3 = (g_manager->_sfxManager)._sounds._end; pvVar1 = (g_manager->_sfxManager)._sounds._begin; while( true ) { if (pvVar3 == pvVar1) { return 0xffffffff; } b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } a = (byte *)((int)pvVar3 + -0x18); if (0xf < *(uint *)((int)pvVar3 + -4)) { a = *(byte **)a; } bVar2 = str_eq(a,*(uint *)((int)pvVar3 + -8),b,*(uint *)(param_1 + 0x10)); if (bVar2 != 0) break; pvVar3 = (void *)((int)pvVar3 + -0x1b8); } return *(undefined4 *)((int)pvVar3 + -0x1c); } //@@ 0086fb20 Isaac::GetRoomEntities /* ZHL [lua] Lua binding Isaac:GetRoomEntities prototype: REPENTOGON, confirmed by RET 0 */ void * __cdecl Isaac::GetRoomEntities(void *unk) { int iVar1; uint uVar2; int iVar3; undefined4 uVar4; undefined4 *puVar5; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b04b90; local_10 = ExceptionList; ExceptionList = &local_10; uVar4 = *(undefined4 *)((int)g_luaEngine + 0x18); lua_createtable(uVar4,0,0,__security_cookie ^ (int)register0x00000010 - 4U); *(undefined4 *)unk = uVar4; uVar4 = luaL_ref(uVar4,0xfff0b9d8); *(undefined4 *)((int)unk + 4) = uVar4; uVar6 = 0; iVar1 = *(int *)((int)g_game->_room + 0x125c); uVar2 = *(uint *)((int)g_game->_room + 0x1264); if (uVar2 != 0) { do { iVar3 = *(int *)(iVar1 + uVar6 * 4); LuaRef::push(unk,*(void **)unk); uVar4 = *(undefined4 *)unk; if (iVar3 == 0) { lua_pushnil(uVar4); } else { puVar5 = (undefined4 *)lua_newuserdata(uVar4,8); *puVar5 = luabridge::UserdataPtr::vftable; puVar5[1] = iVar3; lua_rawgetp(uVar4,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(uVar4,0xfffffffe); } luaL_ref(*(undefined4 *)unk,0xfffffffe); lua_settop(*(undefined4 *)unk,0xfffffffe); uVar6 = uVar6 + 1; } while (uVar6 < uVar2); } ExceptionList = local_10; return unk; } //@@ 0086fc30 Isaac::GetChallenge /* ZHL [lua] Lua binding Isaac:GetChallenge */ int Isaac::GetChallenge(void) { return g_game->_challenge; } //@@ 0086fc40 Isaac::AddPillEffectToPool /* ZHL [lua] Lua binding Isaac:AddPillEffectToPool */ void Isaac::AddPillEffectToPool(int param_1) { ItemPool::ForceAddPillEffect(&g_game->_itemPool,param_1); return; } //@@ 0086fc60 MusicManager::Game_0 /* ZHL [lua] Lua binding MusicManager:Game_0 */ Game * MusicManager::Game_0(void) { return g_game; } //@@ 0086fc70 Input::IsButtonTriggered /* ZHL [lua] Lua binding Input:IsButtonTriggered */ void Input::IsButtonTriggered(undefined4 param_1,undefined4 param_2) { (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a207d0,¶m_1,0,0); return; } //@@ 0086fca0 Input::IsButtonPressed /* ZHL [lua] Lua binding Input:IsButtonPressed */ void Input::IsButtonPressed(undefined4 param_1,undefined4 param_2) { (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a20730,¶m_1,0,0); return; } //@@ 0086fcd0 Input::GetButtonValue /* ZHL [lua] Lua binding Input:GetButtonValue */ float10 Input::GetButtonValue(float param_1,undefined4 param_2) { undefined4 local_8; local_8 = param_1; param_1 = 0.0; (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a20880,&local_8,¶m_1,0); return (float10)param_1; } //@@ 0086fd10 Input::IsActionTriggered /* ZHL [lua] Lua binding Input:IsActionTriggered */ void Input::IsActionTriggered(undefined4 param_1,undefined4 param_2) { (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a209e0,¶m_1,0,0); return; } //@@ 0086fd40 Input::IsActionPressed /* ZHL [lua] Lua binding Input:IsActionPressed */ void Input::IsActionPressed(undefined4 param_1,undefined4 param_2) { (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a20940,¶m_1,0,0); return; } //@@ 0086fd70 Input::GetActionValue /* ZHL [lua] Lua binding Input:GetActionValue */ float10 Input::GetActionValue(float param_1,undefined4 param_2) { undefined4 local_8; local_8 = param_1; param_1 = 0.0; (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a20ab0,&local_8,¶m_1,0); return (float10)param_1; } //@@ 0086fdb0 Input::IsMouseBtnPressed /* ZHL [lua] Lua binding Input:IsMouseBtnPressed */ undefined4 Input::IsMouseBtnPressed(uint param_1) { char cVar1; void *pvVar2; pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x2f9); } if (_glfw == 0) { _glfwInputError(0x10001,0); return 0; } if (7 < param_1) { _glfwInputError(0x10003,"Invalid mouse button %i",param_1); return 0; } cVar1 = *(char *)((int)pvVar2 + param_1 + 0x74); if (cVar1 == '\x03') { *(undefined1 *)((int)pvVar2 + param_1 + 0x74) = 0; return 1; } return CONCAT31((int3)((uint)(int)cVar1 >> 8),cVar1 == 1); } //@@ 0086fe50 Input::GetMousePosition /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding Input:GetMousePosition */ float * Input::GetMousePosition(float *param_1,char param_2) { float fVar1; void *pvVar2; float fVar3; float fVar4; double local_18; double local_10; pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x310); } local_18 = 0.0; local_10 = 0.0; if (_glfw == 0) { _glfwInputError(0x10001,0); } else if (*(int *)((int)pvVar2 + 0x70) == 0x34003) { local_18 = *(double *)((int)pvVar2 + 0x1e0); local_10 = *(double *)((int)pvVar2 + 0x1e8); } else { (*DAT_00c736a0)(pvVar2,&local_18,&local_10); } *param_1 = (float)local_18; param_1[1] = (float)local_10; if (param_2 != '\0') { fVar4 = (float)local_10 / _DAT_00bf9420; fVar1 = *(float *)((int)g_game->_room + 0x1208); fVar3 = g_screenHeight - 182.0; *param_1 = (((float)local_18 / _DAT_00bf9420 - *(float *)((int)g_game->_room + 0x1204)) - (g_screenWidth - 338.0) * 0.5) / 0.65 + 60.0; param_1[1] = ((fVar4 - fVar1) - fVar3 * 0.5) / 0.65 + 140.0; } return param_1; } //@@ 0086ffa0 Isaac::GetTime /* ZHL [lua] Lua binding Isaac:GetTime */ uint Isaac::GetTime(void) { longlong lVar1; longlong lVar2; uint uVar3; ulonglong uVar4; uVar4 = GetTimeNs(); uVar3 = (uint)(uVar4 >> 0x20); lVar1 = (uVar4 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar3 * 0xd7b634db + ((uVar4 & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar3 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); return (uint)lVar1 >> 0x12 | (int)((ulonglong)lVar1 >> 0x20) * 0x4000; } //@@ 00870020 Isaac::ExecuteCommand /* ZHL [lua] Lua binding Isaac:ExecuteCommand */ undefined4 * Isaac::ExecuteCommand(undefined4 *param_1,undefined4 param_2) { uint uVar1; Game *pGVar2; uint uVar3; undefined4 *puVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar2 = g_game; puStack_c = &LAB_00b04bce; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (g_game == (Game *)0x0) { *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; param_1[4] = 0; *(undefined1 *)param_1 = 0; } else { local_8 = 0; *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; pGVar2[1]._roomList[1]._doors[6] = (int)param_1; Console::RunCommand(param_2,0,0,uVar3); pGVar2[1]._roomList[1]._doors[6] = 0; uVar3 = param_1[4]; if (uVar3 != 0) { puVar4 = param_1; if (0xf < (uint)param_1[5]) { puVar4 = (undefined4 *)*param_1; } if (*(char *)((uVar3 - 1) + (int)puVar4) == '\n') { uVar1 = uVar3 - 1; if (uVar3 < uVar1) { /* WARNING: Subroutine does not return */ FUN_00499950(); } puVar4 = param_1; if (0xf < (uint)param_1[5]) { puVar4 = (undefined4 *)*param_1; } param_1[4] = uVar1; *(undefined1 *)((int)puVar4 + uVar1) = 0; ExceptionList = local_10; return param_1; } } } ExceptionList = local_10; return param_1; } //@@ 00870130 Isaac::ConsoleOutput /* ZHL [lua] Lua binding Isaac:ConsoleOutput */ void Isaac::ConsoleOutput(std_string *param_1) { if (g_game != (Game *)0x0) { Console::Print(&g_game->_console,param_1,0xffd3d3d3,0x96); } return; } //@@ 00870160 Isaac::ScreenToWorld /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding Isaac:ScreenToWorld */ void Isaac::ScreenToWorld(float *param_1,float *param_2) { float fVar1; float fVar2; float fVar3; if (g_game == (Game *)0x0) { fVar1 = param_2[1]; *param_1 = *param_2; param_1[1] = fVar1; return; } fVar3 = param_2[1] / _DAT_00bf9420; fVar1 = *(float *)((int)g_game->_room + 0x1208); fVar2 = g_screenHeight - 182.0; *param_1 = ((*param_2 / _DAT_00bf9420 - *(float *)((int)g_game->_room + 0x1204)) - (g_screenWidth - 338.0) * 0.5) / 0.65 + 60.0; param_1[1] = ((fVar3 - fVar1) - fVar2 * 0.5) / 0.65 + 140.0; return; } //@@ 00870220 Isaac::WorldToScreen /* ZHL [lua] Lua binding Isaac:WorldToScreen */ void Isaac::WorldToScreen(float *param_1,float *param_2) { float fVar1; float fVar2; void *pvVar3; float fVar4; double dVar5; double dVar6; if (g_game == (Game *)0x0) { fVar2 = param_2[1]; *param_1 = *param_2; param_1[1] = fVar2; return; } fVar4 = g_displayPixelRatio * g_screenPointScale; pvVar3 = g_game->_room; dVar5 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (*param_2 - 60.0) * 0.65) * fVar4 + 0.5)); dVar6 = floor((double)(((g_screenHeight - 182.0) * 0.5 + (param_2[1] - 140.0) * 0.65) * fVar4 + 0.5)); fVar2 = *(float *)((int)pvVar3 + 0x1208); fVar1 = (g_game->_screenShakeOffset).y; *param_1 = (float)dVar5 / fVar4 + *(float *)((int)pvVar3 + 0x1204) + (g_game->_screenShakeOffset).x; param_1[1] = (float)dVar6 / fVar4 + fVar2 + fVar1; return; } //@@ 00870390 Isaac::WorldToScreenDistance /* ZHL [lua] Lua binding Isaac:WorldToScreenDistance */ void Isaac::WorldToScreenDistance(float *param_1,float *param_2) { *param_1 = *param_2 * 0.65; param_1[1] = param_2[1] * 0.65; return; } //@@ 008703c0 Isaac::WorldToRenderPosition /* ZHL [lua] Lua binding Isaac:WorldToRenderPosition */ float * Isaac::WorldToRenderPosition(float *param_1,float *param_2) { float fVar1; float fVar2; double dVar3; fVar2 = g_displayPixelRatio * g_screenPointScale; dVar3 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (*param_2 - 60.0) * 0.65) * fVar2 + 0.5)); fVar1 = g_screenHeight - 182.0; *param_1 = (float)dVar3 / fVar2; dVar3 = floor((double)((fVar1 * 0.5 + (param_2[1] - 140.0) * 0.65) * fVar2 + 0.5)); param_1[1] = (float)dVar3 / fVar2; return param_1; } //@@ 008704c0 Isaac::ScreenToWorldDistance /* ZHL [lua] Lua binding Isaac:ScreenToWorldDistance */ void Isaac::ScreenToWorldDistance(float *param_1,float *param_2) { *param_1 = *param_2 / 0.65; param_1[1] = param_2[1] / 0.65; return; } //@@ 008704f0 Isaac::FindInRadius /* ZHL [lua] Lua binding Isaac:FindInRadius */ undefined4 Isaac::FindInRadius(void *param_1) { void *luaState; char cVar1; int iVar2; undefined4 topIndex; int argType; void *vectorUserdata; undefined4 *entityUserdata; float *posArg; uint i; float10 fVar3; EntityList_EL results; Vector position; void *partitionsRef; undefined4 partitionsRefId; void *resultTableRef; undefined4 resultTableRefId; void *positionRef; int positionRefId; void *radiusRef; int radiusRefId; EntityList *entityList; float radius; void *local_10; undefined1 *puStack_c; undefined4 local_8; luaState = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b04c15; local_10 = ExceptionList; ExceptionList = &local_10; lua_pushvalue(param_1,1,__security_cookie ^ (int)register0x00000010 - 4U); positionRef = param_1; positionRefId = luaL_ref(param_1,0xfff0b9d8); local_8 = 0; lua_pushvalue(param_1,2); radiusRef = param_1; radiusRefId = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,3); partitionsRef = param_1; partitionsRefId = luaL_ref(param_1,0xfff0b9d8); lua_createtable(param_1,0,0); resultTableRef = param_1; resultTableRefId = luaL_ref(param_1,0xfff0b9d8); local_8 = CONCAT31(local_8._1_3_,3); if ((g_game != (Game *)0x0) && (positionRefId != -1)) { LuaRef::push(&positionRef,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if ((iVar2 != 0) && (radiusRefId != -1)) { LuaRef::push(&radiusRef,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 != 0) { entityList = (EntityList *)((int)g_game->_room + 0x1218); cVar1 = FUN_0085c300(); if (cVar1 == '\0') { param_1 = (void *)FUN_00897500(); } else { param_1 = (void *)0xffffffff; } LuaRef::push(&radiusRef,luaState); topIndex = lua_gettop(luaState); fVar3 = (float10)luaL_checknumber(luaState,topIndex); radius = (float)fVar3; lua_settop(luaState,0xfffffffe); LuaRef::push(&positionRef,luaState); iVar2 = lua_gettop(luaState); argType = lua_type(luaState,iVar2); if (argType == 0) { posArg = (float *)0x0; } else { vectorUserdata = luabridge::Userdata::getClass(luaState,iVar2,&g_luaClassKeyVector,1); posArg = *(float **)((int)vectorUserdata + 4); } position.x = *posArg; position.y = posArg[1]; lua_settop(luaState,0xfffffffe); EntityList::QueryRadius(entityList,&results,&position,radius,(uint)param_1); i = 0; if (results._size != 0) { do { iVar2 = *(int *)((int)results._data + i * 4); LuaRef::push(&resultTableRef,luaState); if (iVar2 == 0) { lua_pushnil(luaState); } else { entityUserdata = (undefined4 *)lua_newuserdata(luaState,8); *entityUserdata = luabridge::UserdataPtr::vftable; entityUserdata[1] = iVar2; lua_rawgetp(luaState,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(luaState,0xfffffffe); } luaL_ref(luaState,0xfffffffe); lua_settop(luaState,0xfffffffe); i = i + 1; } while (i < (uint)results._size); } if (results._0_1_ == '\0') { local_8 = CONCAT31(local_8._1_3_,4); tracked_alloc(1,results._data,0); } } } } LuaRef::push(&resultTableRef,luaState); luaL_unref(luaState,0xfff0b9d8,resultTableRefId); luaL_unref(luaState,0xfff0b9d8,partitionsRefId); luaL_unref(luaState,0xfff0b9d8,radiusRefId); luaL_unref(luaState,0xfff0b9d8,positionRefId); ExceptionList = local_10; return 1; } //@@ 008707b0 Isaac::FindByType /* ZHL [lua] Lua binding Isaac:FindByType */ undefined4 Isaac::FindByType(void *param_1) { void *luaState; qword qVar1; undefined4 topIndex; int iVar2; undefined4 *userdata; qword *allocCounter; code *checkIntegerFn; uint topIndex; EntityList_EL results; void *typeRefState; undefined4 typeRef; void *cacheRefState; undefined4 cacheRef; void *ignoreFriendlyRefState; undefined4 ignoreFriendlyRef; void *tableRefState; undefined4 tableRef; void *variantRefState; int variantRef; void *subtypeRefState; int subtypeRef; EntityList *entityList; bool isCache; undefined3 uStack_23; bool isIgnoreFriendly; undefined3 uStack_1f; int local_1c; int subtype; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *entities; local_8 = 0xffffffff; puStack_c = &LAB_00b04c75; local_10 = ExceptionList; ExceptionList = &local_10; lua_pushvalue(param_1,1,__security_cookie ^ (int)register0x00000010 - 4U); typeRefState = param_1; typeRef = luaL_ref(param_1,0xfff0b9d8); local_8 = 0; lua_pushvalue(param_1,2); variantRefState = param_1; variantRef = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,3); subtypeRefState = param_1; subtypeRef = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,4); cacheRefState = param_1; cacheRef = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,5); ignoreFriendlyRefState = param_1; ignoreFriendlyRef = luaL_ref(param_1,0xfff0b9d8); luaState = *(void **)((int)g_luaEngine + 0x18); lua_createtable(luaState,0,0); tableRefState = luaState; tableRef = luaL_ref(luaState,0xfff0b9d8); local_8 = CONCAT31(local_8._1_3_,5); if (g_game == (Game *)0x0) goto LAB_00870aba; entityList = (EntityList *)((int)g_game->_room + 0x1218); LuaRef::push(&ignoreFriendlyRefState,param_1); topIndex = lua_gettop(param_1); iVar2 = lua_toboolean(param_1,topIndex); _isIgnoreFriendly = CONCAT31(uStack_1f,iVar2 != 0); lua_settop(param_1,0xfffffffe); LuaRef::push(&cacheRefState,param_1); topIndex = lua_gettop(param_1); iVar2 = lua_toboolean(param_1,topIndex); _isCache = CONCAT31(uStack_23,iVar2 != 0); lua_settop(param_1,0xfffffffe); if (subtypeRef == -1) { LAB_0087095c: subtype = -1; checkIntegerFn = luaL_checkinteger_exref; } else { LuaRef::push(&subtypeRefState,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 0) goto LAB_0087095c; LuaRef::push(&subtypeRefState,param_1); topIndex = lua_gettop(param_1); checkIntegerFn = luaL_checkinteger_exref; subtype = luaL_checkinteger(param_1,topIndex); lua_settop(param_1,0xfffffffe); } if (variantRef == -1) { LAB_008709c1: local_1c = -1; } else { LuaRef::push(&variantRefState,param_1); iVar2 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar2 == 0) { checkIntegerFn = luaL_checkinteger_exref; goto LAB_008709c1; } LuaRef::push(&variantRefState,param_1); topIndex = lua_gettop(param_1); checkIntegerFn = luaL_checkinteger_exref; local_1c = luaL_checkinteger(param_1,topIndex); lua_settop(param_1,0xfffffffe); } LuaRef::push(&typeRefState,param_1); topIndex = lua_gettop(param_1); iVar2 = (*checkIntegerFn)(param_1,topIndex); lua_settop(param_1,0xfffffffe); EntityList::QuerySublist (entityList,&results,iVar2,local_1c,subtype,(byte)_isCache,(byte)_isIgnoreFriendly); entities = results._data; topIndex = 0; if (results._size != 0) { do { local_1c = *(int *)((int)entities + topIndex * 4); LuaRef::push(&tableRefState,luaState); if (local_1c == 0) { lua_pushnil(luaState); } else { userdata = (undefined4 *)lua_newuserdata(luaState,8); *userdata = luabridge::UserdataPtr::vftable; userdata[1] = local_1c; lua_rawgetp(luaState,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(luaState,0xfffffffe); } luaL_ref(luaState,0xfffffffe); lua_settop(luaState,0xfffffffe); topIndex = topIndex + 1; } while (topIndex < (uint)results._size); } if (results._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (results._data != (void *)0x0) { topIndex = *(uint *)((int)results._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - topIndex; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < topIndex); free((uint *)((int)results._data + -4)); } } LAB_00870aba: LuaRef::push(&tableRefState,param_1); luaL_unref(luaState,0xfff0b9d8,tableRef); luaL_unref(param_1,0xfff0b9d8,ignoreFriendlyRef); luaL_unref(param_1,0xfff0b9d8,cacheRef); luaL_unref(param_1,0xfff0b9d8,subtypeRef); luaL_unref(param_1,0xfff0b9d8,variantRef); luaL_unref(param_1,0xfff0b9d8,typeRef); ExceptionList = local_10; return 1; } //@@ 00870b40 Isaac::CountEntities /* ZHL [lua] Lua binding Isaac:CountEntities */ undefined4 Isaac::CountEntities(void *param_1) { int iVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uStack_34; undefined4 uStack_30; void *pvStack_28; int iStack_24; void *pvStack_20; int iStack_1c; void *pvStack_18; int iStack_14; void *pvStack_10; undefined4 uStack_c; if (g_game == (Game *)0x0) { lua_pushinteger(param_1,0,0); return 1; } lua_pushvalue(param_1,1); pvStack_10 = param_1; uStack_c = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,2); pvStack_20 = param_1; iStack_1c = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,3); pvStack_28 = param_1; iStack_24 = luaL_ref(param_1,0xfff0b9d8); lua_pushvalue(param_1,4); pvStack_18 = param_1; iStack_14 = luaL_ref(param_1,0xfff0b9d8); if (iStack_14 == -1) { LAB_00870c43: uStack_34 = 0xffffffff; } else { LuaRef::push(&pvStack_18,param_1); iVar1 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar1 == 0) goto LAB_00870c43; LuaRef::push(&pvStack_18,param_1); uVar2 = lua_gettop(param_1); uStack_34 = luaL_checkinteger(param_1,uVar2); lua_settop(param_1,0xfffffffe); } if (iStack_24 == -1) { LAB_00870c9d: uStack_30 = 0xffffffff; } else { LuaRef::push(&pvStack_28,param_1); iVar1 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar1 == 0) goto LAB_00870c9d; LuaRef::push(&pvStack_28,param_1); uVar2 = lua_gettop(param_1); uStack_30 = luaL_checkinteger(param_1,uVar2); lua_settop(param_1,0xfffffffe); } if (iStack_1c != -1) { LuaRef::push(&pvStack_20,param_1); iVar1 = lua_type(param_1,0xffffffff); lua_settop(param_1,0xfffffffe); if (iVar1 != 0) { LuaRef::push(&pvStack_20,param_1); uVar2 = lua_gettop(param_1); uVar2 = luaL_checkinteger(param_1,uVar2); lua_settop(param_1,0xfffffffe); goto LAB_00870cf7; } } uVar2 = 0; LAB_00870cf7: uVar3 = luabridge::LuaRef::cast(); iVar1 = EntityList::CountEntities(uVar3,uVar2,uStack_30,uStack_34); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); luaL_unref(param_1,0xfff0b9d8,iStack_14); luaL_unref(param_1,0xfff0b9d8,iStack_24); luaL_unref(param_1,0xfff0b9d8,iStack_1c); luaL_unref(param_1,0xfff0b9d8,uStack_c); return 1; } //@@ 00870d70 Isaac::CountEnemies /* ZHL [lua] Lua binding Isaac:CountEnemies */ int Isaac::CountEnemies(void) { int iVar1; int iVar2; if (g_game == (Game *)0x0) { return 0; } iVar2 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } return iVar1; } //@@ 00870da0 Isaac::CountBosses /* ZHL [lua] Lua binding Isaac:CountBosses */ int Isaac::CountBosses(void) { int iVar1; int iVar2; if (g_game == (Game *)0x0) { return 0; } iVar2 = *(int *)((int)g_game->_room + 0x12cc) + *(int *)((int)g_game->_room + 0x12c8); iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } return iVar1; } //@@ 00870dd0 Isaac::GetScreenWidth /* ZHL [lua] Lua binding Isaac:GetScreenWidth */ float10 Isaac::GetScreenWidth(void) { return (float10)g_screenWidth; } //@@ 00870de0 Isaac::GetScreenHeight /* ZHL [lua] Lua binding Isaac:GetScreenHeight */ float10 Isaac::GetScreenHeight(void) { return (float10)g_screenHeight; } //@@ 00870df0 Isaac::GetScreenPointScale /* ZHL [lua] Lua binding Isaac:GetScreenPointScale */ float10 Isaac::GetScreenPointScale(void) { return (float10)g_screenPointScale; } //@@ 00870e00 FUN_00870e00 void FUN_00870e00(char *param_1) { undefined4 *puVar1; undefined4 *this; undefined4 uVar2; undefined4 uVar3; int iVar4; int in_ECX; undefined1 auStack_54 [12]; undefined4 uStack_48; undefined4 uStack_44; void *pvStack_40; undefined4 uStack_3c; undefined4 uStack_38; void *local_1c; undefined4 local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04cad; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = *(undefined4 **)(in_ECX + 0x14); this = *(undefined4 **)(param_1 + 0x48); local_1c = (void *)*this; local_14 = local_1c; if (this[1] == -1) { uVar3 = 0xffffffff; } else { LuaRef::push(this,local_1c); uStack_38 = 0x870e54; uVar3 = luaL_ref(); } local_8 = 0; local_18 = uVar3; LuaRef::push(puVar1,(void *)*puVar1); LuaRef::push(&local_1c,(void *)*puVar1); uVar2 = *puVar1; uStack_38 = 0; uStack_3c = 1; pvStack_40 = (void *)0x1; uStack_48 = 0x870e8f; uStack_44 = uVar2; iVar4 = lua_pcallk(); if (iVar4 != 0) { FUN_0085c080(uVar2,auStack_54); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uVar2 = *puVar1; uStack_38 = 0x870ea8; luaL_ref(); local_8 = 0xffffffff; uStack_3c = 0xfff0b9d8; pvStack_40 = local_14; uStack_44 = 0x870ec2; uStack_38 = uVar3; luaL_unref(); uStack_3c = 0x870ed4; uStack_38 = uVar2; luaL_unref(); puVar1 = *(undefined4 **)(param_1 + 0x48); if (puVar1 != (undefined4 *)0x0) { uStack_38 = *puVar1; uStack_3c = 0x870eea; luaL_unref(); uStack_38 = 0x870ef5; operator_delete(puVar1,8); } param_1[0x48] = '\0'; param_1[0x49] = '\0'; param_1[0x4a] = '\0'; param_1[0x4b] = '\0'; uStack_38 = 0x870f0d; std::string::assign(param_1,&s_empty,0); ExceptionList = local_10; return; } //@@ 00870f21 FUN_00870f21 void FUN_00870f21(void) { undefined4 unaff_ESI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_ESI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00870f40 Isaac::RegisterMod /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding Isaac:RegisterMod */ void Isaac::RegisterMod(void *param_1,int param_2,void **param_3,int param_4) { uint uVar1; undefined4 *puVar2; undefined4 luaRefId; byte **text; void **ppvVar3; int *modNode; void *blockToFree; void **text_00; void *currentModPath [4]; undefined4 currentModPathSize; uint currentModPathCapacity; void *modDirectory [4]; undefined4 modDirectorySize; uint modDirectoryCapacity; void *modName [4]; undefined4 modNameSize; uint modNameCapacity; undefined4 *modRef; int apiVersion; uint securityCookie; void *local_10; undefined1 *puStack_c; void *local_8; int modListHead; void **srcSize; int version; text_00 = param_3; puStack_c = &LAB_00b04d00; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(modName + 0xc); ExceptionList = &local_10; currentModPathCapacity = 0xf; currentModPathSize = 0; currentModPath[0] = (void *)0x0; modDirectorySize = 0; modDirectoryCapacity = 0xf; modDirectory[0] = (void *)0x0; modNameSize = 0; modNameCapacity = 0xf; modName[0] = (void *)0x0; modRef = (undefined4 *)0x0; apiVersion = 0; local_8 = (void *)0x1; securityCookie = uVar1; puVar2 = operator_new(8); if (puVar2 == (undefined4 *)0x0) { puVar2 = (undefined4 *)0x0; } else { *puVar2 = param_1; if (param_2 == -1) { puVar2[1] = 0xffffffff; } else { LuaRef::push(¶m_1,param_1); luaRefId = luaL_ref(param_1,0xfff0b9d8,uVar1); puVar2[1] = luaRefId; } } text = &DAT_00c35e00; if (0xf < DAT_00c35e14) { text = (byte **)DAT_00c35e00; } modRef = puVar2; std::string::assign((char *)currentModPath,(byte *)text,DAT_00c35e10); if (DAT_00c71698 == 0) { ppvVar3 = currentModPath; LAB_00871058: srcSize = ppvVar3 + 4; if ((void *)0xf < ppvVar3[5]) { ppvVar3 = *ppvVar3; } std::string::assign((char *)modDirectory,(byte *)ppvVar3,(uint)*srcSize); } else { ppvVar3 = (void **)(DAT_00c71698 + 0x60); if (modDirectory != ppvVar3) goto LAB_00871058; } if (modName != text_00) { ppvVar3 = text_00 + 4; if ((void *)0xf < text_00[5]) { text_00 = *text_00; } std::string::assign((char *)modName,(byte *)text_00,(uint)*ppvVar3); } version = param_4; modListHead = DAT_00c7985c; apiVersion = param_4; if (DAT_00c79860 == 0x2e8ba2e) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8._0_1_ = 2; modNode = operator_new(0x58); std::string::string((char *)(modNode + 2),currentModPath); local_8._0_1_ = 3; std::string::string((char *)(modNode + 8),modDirectory); local_8 = (void *)CONCAT31(local_8._1_3_,4); std::string::string((char *)(modNode + 0xe),modName); modNode[0x14] = (int)modRef; modNode[0x15] = apiVersion; DAT_00c79860 = DAT_00c79860 + 1; puVar2 = *(undefined4 **)(modListHead + 4); *modNode = modListHead; modNode[1] = (int)puVar2; *(int **)(modListHead + 4) = modNode; *puVar2 = modNode; _DAT_00bf942c = version; if (0xf < modNameCapacity) { uVar1 = modNameCapacity + 1; blockToFree = modName[0]; if (0xfff < uVar1) { blockToFree = *(void **)((int)modName[0] + -4); uVar1 = modNameCapacity + 0x24; if (0x1f < (uint)((int)modName[0] + (-4 - (int)blockToFree))) goto LAB_008711ae; } operator_delete(blockToFree,uVar1); } if (0xf < modDirectoryCapacity) { uVar1 = modDirectoryCapacity + 1; blockToFree = modDirectory[0]; if (0xfff < uVar1) { blockToFree = *(void **)((int)modDirectory[0] + -4); uVar1 = modDirectoryCapacity + 0x24; if (0x1f < (uint)((int)modDirectory[0] + (-4 - (int)blockToFree))) goto LAB_008711ae; } operator_delete(blockToFree,uVar1); } if (0xf < currentModPathCapacity) { uVar1 = currentModPathCapacity + 1; blockToFree = currentModPath[0]; if (0xfff < uVar1) { blockToFree = *(void **)((int)currentModPath[0] + -4); uVar1 = currentModPathCapacity + 0x24; if (0x1f < (uint)((int)currentModPath[0] + (-4 - (int)blockToFree))) { LAB_008711ae: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(blockToFree,uVar1); } luaL_unref(param_1,0xfff0b9d8,param_2); ExceptionList = local_10; return; } //@@ 008711f0 Isaac::SaveModData /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Isaac:SaveModData */ void Isaac::SaveModData(void *param_1,int param_2,undefined4 *param_3) { byte bVar1; char isOpen; uint uVar2; int iVar3; uint length; undefined4 *puVar4; byte ****ppppbVar5; int *piVar6; undefined4 *dataText; byte *pbVar7; void *pvVar8; byte *modPath; void *pvVar9; void *modDir [4]; undefined4 modDirSize; uint modDirCapacity; byte ****savePath; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined8 uStack_4c; byte saveFileName [32]; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; dataText = param_3; puStack_20 = saveFileName + 0x40; puStack_18 = &DAT_00b04d50; pvStack_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(saveFileName + 0x34); ExceptionList = &pvStack_1c; uStack_14 = 0; iVar3 = g_manager->_currentSaveSlot; if (iVar3 == 0) { iVar3 = 1; } uStack_24 = uVar2; sprintf_s(saveFileName,0x20,(byte *)"/save%d.dat"); piVar6 = (int *)*DAT_00c7985c; if (piVar6 != DAT_00c7985c) { do { pvVar8 = (void *)piVar6[0x14]; pvVar9 = param_1; if (param_2 == -1) { iVar3 = -1; } else { LuaRef::push(¶m_1,param_1); iVar3 = luaL_ref(param_1,0xfff0b9d8,pvVar9,iVar3,uVar2); } bVar1 = LuaRef::equals(pvVar8,pvVar9,iVar3); if (bVar1 != 0) { uVar2 = piVar6[0xd]; modPath = (byte *)(piVar6 + 8); pbVar7 = modPath; if (0xf < uVar2) { pbVar7 = *(byte **)modPath; } length = std::string::find_last_of(pbVar7,piVar6[0xc],0xffffffff,&DAT_00b6ac04,2); modDirSize = 0; if ((uint)piVar6[0xc] < length) { length = piVar6[0xc]; } modDirCapacity = 0xf; modDir[0] = (void *)0x0; if (0xf < uVar2) { modPath = *(byte **)modPath; } std::string::assign((char *)modDir,modPath,length); pbVar7 = saveFileName; uStack_14._0_1_ = 1; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); puVar4 = std::string::append((char *)modDir,saveFileName, (int)pbVar7 - (int)(saveFileName + 1)); savePath = (byte ****)*puVar4; uStack_58 = puVar4[1]; uStack_54 = puVar4[2]; uStack_50 = puVar4[3]; uStack_4c = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; uStack_14 = CONCAT31(uStack_14._1_3_,3); if (0xf < modDirCapacity) { uVar2 = modDirCapacity + 1; pvVar8 = modDir[0]; if (0xfff < uVar2) { pvVar8 = *(void **)((int)modDir[0] + -4); uVar2 = modDirCapacity + 0x24; if (0x1f < (uint)((int)modDir[0] + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar2); } modDirSize = 0; modDirCapacity = 0xf; modDir[0] = (void *)((uint)modDir[0] & 0xffffff00); puVar4 = operator_new(0x10); if (puVar4 != (undefined4 *)0x0) { puVar4[1] = 2; puVar4[2] = 0; *puVar4 = KAGE::Filesys::File::vftable; puVar4[3] = 0; } ppppbVar5 = (byte ****)&savePath; if (0xf < uStack_4c._4_4_) { ppppbVar5 = savePath; } piVar6 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)ppppbVar5,0); if (piVar6 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"Could not open %s for writing!\n"); if (uStack_4c._4_4_ < 0x10) break; uVar2 = uStack_4c._4_4_ + 1; ppppbVar5 = savePath; if (0xfff < uVar2) { ppppbVar5 = (byte ****)savePath[-1]; iVar3 = (int)savePath - (int)ppppbVar5; joined_r0x00871534: uVar2 = uStack_4c._4_4_ + 0x24; if (0x1f < iVar3 - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { isOpen = (**(code **)(*piVar6 + 0x30))(); if ((isOpen != '\0') && (iVar3 = _fileno((FILE *)piVar6[3]), -1 < iVar3)) { flock(iVar3,2); } puVar4 = dataText + 4; if (0xf < (uint)dataText[5]) { dataText = (undefined4 *)*dataText; } (**(code **)(*piVar6 + 0x1c))(dataText,1,*puVar4); isOpen = (**(code **)(*piVar6 + 0x30))(); if ((isOpen != '\0') && (iVar3 = _fileno((FILE *)piVar6[3]), -1 < iVar3)) { flock(iVar3,8); } (**(code **)(*piVar6 + 0x34))(); (**(code **)*piVar6)(1); if (uStack_4c._4_4_ < 0x10) break; uVar2 = uStack_4c._4_4_ + 1; ppppbVar5 = savePath; if (0xfff < uVar2) { ppppbVar5 = (byte ****)savePath[-1]; iVar3 = (int)savePath - (int)ppppbVar5; goto joined_r0x00871534; } } operator_delete(ppppbVar5,uVar2); break; } piVar6 = (int *)*piVar6; } while (piVar6 != DAT_00c7985c); } luaL_unref(param_1,0xfff0b9d8,param_2); ExceptionList = pvStack_1c; return; } //@@ 00871550 Isaac::LoadModData /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Isaac:LoadModData */ undefined4 * Isaac::LoadModData(undefined4 *param_1,void *param_2,int param_3) { qword qVar1; byte bVar2; char cVar3; uint uVar4; int iVar5; uint dirLength; undefined4 *puVar6; byte ****ppppbVar7; int *piVar8; byte *pbVar9; byte *pbVar10; void *pvVar11; qword *allocCounter; void *pvVar12; undefined4 modData; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; void *modDir [4]; undefined4 uStack_64; uint uStack_60; byte ****savePath; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined8 uStack_4c; byte saveFileName [32]; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; puStack_20 = saveFileName + 0x40; puStack_18 = &DAT_00b04da8; pvStack_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(saveFileName + 0x34); ExceptionList = &pvStack_1c; uStack_7c = 0; uStack_78 = 0xf; modData = 0; uStack_14 = 1; iVar5 = g_manager->_currentSaveSlot; if (iVar5 == 0) { iVar5 = 1; } uStack_24 = uVar4; sprintf_s(saveFileName,0x20,(byte *)"/save%d.dat"); piVar8 = (int *)*DAT_00c7985c; if (piVar8 == DAT_00c7985c) { LAB_00871913: *param_1 = 0; param_1[4] = 0; param_1[5] = 0; *param_1 = modData; param_1[1] = uStack_88; param_1[2] = uStack_84; param_1[3] = uStack_80; *(ulonglong *)(param_1 + 4) = CONCAT44(uStack_78,uStack_7c); LAB_0087193e: luaL_unref(param_2,0xfff0b9d8,param_3); ExceptionList = pvStack_1c; return param_1; } LAB_008715f3: pvVar11 = (void *)piVar8[0x14]; pvVar12 = param_2; if (param_3 == -1) { iVar5 = -1; } else { LuaRef::push(¶m_2,param_2); iVar5 = luaL_ref(param_2,0xfff0b9d8,pvVar12,iVar5,uVar4); } bVar2 = LuaRef::equals(pvVar11,pvVar12,iVar5); if (bVar2 == 0) goto code_r0x00871639; uVar4 = piVar8[0xc]; pbVar9 = (byte *)(piVar8 + 8); pbVar10 = pbVar9; if (0xf < (uint)piVar8[0xd]) { pbVar10 = *(byte **)pbVar9; } dirLength = std::string::find_last_of(pbVar10,uVar4,0xffffffff,&DAT_00b6ac04,2); uStack_64 = 0; uStack_60 = 0xf; if (uVar4 < dirLength) { dirLength = uVar4; } modDir[0] = (void *)0x0; if (0xf < (uint)piVar8[0xd]) { pbVar9 = *(byte **)pbVar9; } std::string::assign((char *)modDir,pbVar9,dirLength); pbVar10 = saveFileName; uStack_14._0_1_ = 2; do { bVar2 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar2 != 0); puVar6 = std::string::append((char *)modDir,saveFileName,(int)pbVar10 - (int)(saveFileName + 1)); savePath = (byte ****)*puVar6; uStack_58 = puVar6[1]; uStack_54 = puVar6[2]; uStack_50 = puVar6[3]; uStack_4c = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; uStack_14 = CONCAT31(uStack_14._1_3_,4); if (0xf < uStack_60) { uVar4 = uStack_60 + 1; pvVar11 = modDir[0]; if (0xfff < uVar4) { pvVar11 = *(void **)((int)modDir[0] + -4); uVar4 = uStack_60 + 0x24; if (0x1f < (uint)((int)modDir[0] + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar4); } uStack_64 = 0; ppppbVar7 = (byte ****)&savePath; if (0xf < uStack_4c._4_4_) { ppppbVar7 = savePath; } uStack_60 = 0xf; modDir[0] = (void *)((uint)modDir[0] & 0xffffff00); piVar8 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)ppppbVar7); if (piVar8 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"Could not open %s for reading!\n"); *param_1 = 0; param_1[4] = 0; param_1[5] = 0; *param_1 = modData; param_1[1] = uStack_88; param_1[2] = uStack_84; param_1[3] = uStack_80; *(ulonglong *)(param_1 + 4) = CONCAT44(uStack_78,uStack_7c); if (0xf < uStack_4c._4_4_) { uVar4 = uStack_4c._4_4_ + 1; ppppbVar7 = savePath; if (0xfff < uVar4) { ppppbVar7 = (byte ****)savePath[-1]; uVar4 = uStack_4c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)savePath + (-4 - (int)ppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar7,uVar4); } uStack_4c = 0xf00000000; savePath = (byte ****)((uint)savePath & 0xffffff00); goto LAB_0087193e; } cVar3 = (**(code **)(*piVar8 + 0x30))(); if ((cVar3 != '\0') && (iVar5 = _fileno((FILE *)piVar8[3]), -1 < iVar5)) { flock(iVar5,1); } (**(code **)(*piVar8 + 0xc))(0,2); iVar5 = (**(code **)(*piVar8 + 8))(); (**(code **)(*piVar8 + 0xc))(0,0); pbVar9 = operator_new_tracked(iVar5 + 1); pbVar9[iVar5] = 0; (**(code **)(*piVar8 + 0x14))(pbVar9,1,iVar5); pbVar10 = pbVar9; do { bVar2 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar2 != 0); std::string::assign((char *)&modData,pbVar9,(int)pbVar10 - (int)(pbVar9 + 1)); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (pbVar9 != (byte *)0x0) { uVar4 = *(uint *)(pbVar9 + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); free(pbVar9 + -4); } uStack_14 = CONCAT31(uStack_14._1_3_,4); cVar3 = (**(code **)(*piVar8 + 0x30))(); if ((cVar3 != '\0') && (iVar5 = _fileno((FILE *)piVar8[3]), -1 < iVar5)) { flock(iVar5,8); } (**(code **)(*piVar8 + 0x34))(); (**(code **)*piVar8)(1); if (0xf < uStack_4c._4_4_) { uVar4 = uStack_4c._4_4_ + 1; ppppbVar7 = savePath; if (0xfff < uVar4) { ppppbVar7 = (byte ****)savePath[-1]; uVar4 = uStack_4c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)savePath + (-4 - (int)ppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar7,uVar4); } goto LAB_00871913; code_r0x00871639: piVar8 = (int *)*piVar8; if (piVar8 == DAT_00c7985c) goto LAB_00871913; goto LAB_008715f3; } //@@ 00871980 Isaac::HasModData /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Isaac:HasModData */ bool Isaac::HasModData(void *param_1,int param_2) { byte bVar1; uint uVar2; int otherRef; uint length; undefined4 *appendedPath; byte ****ppppbVar3; byte *pbVar4; void *pvVar5; qword *heapBytes; int *modNode; byte *text; bool isHasData; byte ****savePath; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined8 uStack_64; void *modDir [4]; undefined4 modDirSize; uint modDirCapacity; byte saveFileName [32]; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; void *luaState; qword prevBytes; puStack_20 = saveFileName + 0x40; puStack_18 = &DAT_00b04e00; pvStack_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(saveFileName + 0x34); ExceptionList = &pvStack_1c; uStack_14 = 0; otherRef = g_manager->_currentSaveSlot; if (otherRef == 0) { otherRef = 1; } uStack_24 = uVar2; sprintf_s(saveFileName,0x20,(byte *)"/save%d.dat"); modNode = (int *)*DAT_00c7985c; if (modNode != DAT_00c7985c) { do { pvVar5 = (void *)modNode[0x14]; luaState = param_1; if (param_2 == -1) { otherRef = -1; } else { LuaRef::push(¶m_1,param_1); otherRef = luaL_ref(param_1,0xfff0b9d8,luaState,otherRef,uVar2); } bVar1 = LuaRef::equals(pvVar5,luaState,otherRef); if (bVar1 != 0) { uVar2 = modNode[0xd]; text = (byte *)(modNode + 8); pbVar4 = text; if (0xf < uVar2) { pbVar4 = *(byte **)text; } length = std::string::find_last_of(pbVar4,modNode[0xc],0xffffffff,&DAT_00b6ac04,2); modDirSize = 0; if ((uint)modNode[0xc] < length) { length = modNode[0xc]; } modDirCapacity = 0xf; modDir[0] = (void *)0x0; if (0xf < uVar2) { text = *(byte **)text; } std::string::assign((char *)modDir,text,length); pbVar4 = saveFileName; uStack_14._0_1_ = 1; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); appendedPath = std::string::append((char *)modDir,saveFileName, (int)pbVar4 - (int)(saveFileName + 1)); savePath = (byte ****)*appendedPath; uStack_70 = appendedPath[1]; uStack_6c = appendedPath[2]; uStack_68 = appendedPath[3]; uStack_64 = *(undefined8 *)(appendedPath + 4); appendedPath[4] = 0; appendedPath[5] = 0xf; *(undefined1 *)appendedPath = 0; uStack_14 = CONCAT31(uStack_14._1_3_,3); if (0xf < modDirCapacity) { uVar2 = modDirCapacity + 1; pvVar5 = modDir[0]; if (0xfff < uVar2) { pvVar5 = *(void **)((int)modDir[0] + -4); uVar2 = modDirCapacity + 0x24; if (0x1f < (uint)((int)modDir[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } modDirSize = 0; ppppbVar3 = (byte ****)&savePath; if (0xf < uStack_64._4_4_) { ppppbVar3 = savePath; } modDirCapacity = 0xf; modDir[0] = (void *)((uint)modDir[0] & 0xffffff00); pbVar4 = FileSystem::ResolvePath((byte *)ppppbVar3); isHasData = pbVar4 != (byte *)0x0; if (pbVar4 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { heapBytes = &g_allocatedBytesNoHeap; } else { heapBytes = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(pbVar4 + -4); prevBytes = *heapBytes; *(uint *)heapBytes = (uint)*heapBytes - uVar2; *(uint *)((int)heapBytes + 4) = *(uint *)((int)heapBytes + 4) - (uint)((uint)prevBytes < uVar2); free(pbVar4 + -4); } if (0xf < uStack_64._4_4_) { uVar2 = uStack_64._4_4_ + 1; ppppbVar3 = savePath; if (0xfff < uVar2) { ppppbVar3 = (byte ****)savePath[-1]; uVar2 = uStack_64._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)savePath + (-4 - (int)ppppbVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,uVar2); } goto LAB_00871a4a; } modNode = (int *)*modNode; } while (modNode != DAT_00c7985c); } isHasData = false; LAB_00871a4a: luaL_unref(param_1,0xfff0b9d8,param_2); ExceptionList = pvStack_1c; return isHasData; } //@@ 00871c10 Isaac::RemoveModData /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Isaac:RemoveModData */ void Isaac::RemoveModData(void *param_1,int param_2) { qword qVar1; byte bVar2; uint uVar3; int otherRef; uint length; undefined4 *appendResult; byte ****ppppbVar4; byte *pbVar5; void *pvVar6; qword *heapCounter; int *modEntry; byte *text; void *pvVar7; void *modDir [4]; undefined4 modDirSize; uint modDirCapacity; byte ****savePath; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined8 uStack_4c; byte saveFileName [32]; uint uStack_24; undefined1 *puStack_20; void *pvStack_1c; undefined *puStack_18; undefined4 uStack_14; puStack_20 = saveFileName + 0x40; puStack_18 = &DAT_00b04e50; pvStack_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(saveFileName + 0x34); ExceptionList = &pvStack_1c; uStack_14 = 0; otherRef = g_manager->_currentSaveSlot; if (otherRef == 0) { otherRef = 1; } uStack_24 = uVar3; sprintf_s(saveFileName,0x20,(byte *)"/save%d.dat"); modEntry = (int *)*DAT_00c7985c; if (modEntry != DAT_00c7985c) { do { pvVar6 = (void *)modEntry[0x14]; pvVar7 = param_1; if (param_2 == -1) { otherRef = -1; } else { LuaRef::push(¶m_1,param_1); otherRef = luaL_ref(param_1,0xfff0b9d8,pvVar7,otherRef,uVar3); } bVar2 = LuaRef::equals(pvVar6,pvVar7,otherRef); if (bVar2 != 0) { uVar3 = modEntry[0xd]; text = (byte *)(modEntry + 8); pbVar5 = text; if (0xf < uVar3) { pbVar5 = *(byte **)text; } length = std::string::find_last_of(pbVar5,modEntry[0xc],0xffffffff,&DAT_00b6ac04,2); modDirSize = 0; if ((uint)modEntry[0xc] < length) { length = modEntry[0xc]; } modDirCapacity = 0xf; modDir[0] = (void *)0x0; if (0xf < uVar3) { text = *(byte **)text; } std::string::assign((char *)modDir,text,length); pbVar5 = saveFileName; uStack_14._0_1_ = 1; do { bVar2 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar2 != 0); appendResult = std::string::append((char *)modDir,saveFileName, (int)pbVar5 - (int)(saveFileName + 1)); savePath = (byte ****)*appendResult; uStack_58 = appendResult[1]; uStack_54 = appendResult[2]; uStack_50 = appendResult[3]; uStack_4c = *(undefined8 *)(appendResult + 4); appendResult[4] = 0; appendResult[5] = 0xf; *(undefined1 *)appendResult = 0; uStack_14 = CONCAT31(uStack_14._1_3_,3); if (0xf < modDirCapacity) { uVar3 = modDirCapacity + 1; pvVar6 = modDir[0]; if (0xfff < uVar3) { pvVar6 = *(void **)((int)modDir[0] + -4); uVar3 = modDirCapacity + 0x24; if (0x1f < (uint)((int)modDir[0] + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar3); } modDirSize = 0; ppppbVar4 = (byte ****)&savePath; if (0xf < uStack_4c._4_4_) { ppppbVar4 = savePath; } modDirCapacity = 0xf; modDir[0] = (void *)((uint)modDir[0] & 0xffffff00); pbVar5 = FileSystem::ResolvePath((byte *)ppppbVar4); if (pbVar5 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(pbVar5 + -4); qVar1 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar3; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar1 < uVar3); free(pbVar5 + -4); } if (pbVar5 != (byte *)0x0) { ppppbVar4 = (byte ****)&savePath; if (0xf < uStack_4c._4_4_) { ppppbVar4 = savePath; } remove((char *)ppppbVar4); } if (0xf < uStack_4c._4_4_) { uVar3 = uStack_4c._4_4_ + 1; ppppbVar4 = savePath; if (0xfff < uVar3) { ppppbVar4 = (byte ****)savePath[-1]; uVar3 = uStack_4c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)savePath + (-4 - (int)ppppbVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar4,uVar3); } break; } modEntry = (int *)*modEntry; } while (modEntry != DAT_00c7985c); } luaL_unref(param_1,0xfff0b9d8,param_2); ExceptionList = pvStack_1c; return; } //@@ 00871eb0 FUN_00871eb0 void FUN_00871eb0(void) { char *in_ECX; std::string::_Tidy_deallocate(in_ECX + 0x30); std::string::_Tidy_deallocate(in_ECX + 0x18); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 00871ed0 Entity::Color /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Entity:Color */ undefined4 * Entity::Color(undefined4 *param_1,int param_2) { undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined8 local_14; undefined4 local_c; if (param_2 == 0) { local_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; local_14 = 0; local_c = 0; local_34 = 0; uStack_30 = 0; uStack_2c = 0; uStack_28 = 0x3f800000; } else { local_34 = *(undefined4 *)(param_2 + 0x1b8); uStack_30 = *(undefined4 *)(param_2 + 0x1bc); uStack_2c = *(undefined4 *)(param_2 + 0x1c0); uStack_28 = *(undefined4 *)(param_2 + 0x1c4); local_24 = *(undefined4 *)(param_2 + 0x1c8); uStack_20 = *(undefined4 *)(param_2 + 0x1cc); uStack_1c = *(undefined4 *)(param_2 + 0x1d0); uStack_18 = *(undefined4 *)(param_2 + 0x1d4); local_14 = *(undefined8 *)(param_2 + 0x1d8); local_c = *(undefined4 *)(param_2 + 0x1e0); } *param_1 = local_34; param_1[1] = uStack_30; param_1[2] = uStack_2c; param_1[3] = uStack_28; param_1[4] = local_24; param_1[5] = uStack_20; param_1[6] = uStack_1c; param_1[7] = uStack_18; *(undefined8 *)(param_1 + 8) = local_14; param_1[10] = local_c; return param_1; } //@@ 00871f70 FUN_00871f70 void FUN_00871f70(int *param_1,undefined4 param_2) { if (param_1 != (int *)0x0) { (**(code **)(*param_1 + 0x3c))(param_2,0xffffffff,0xff,0,1); } return; } //@@ 00871f90 Entity::Size /* ZHL [lua] Lua binding Entity:Size */ float10 Entity::Size(int param_1) { return (float10)*(float *)(param_1 + 0x370); } //@@ 00871fa0 FUN_00871fa0 void FUN_00871fa0(Entity *param_1,float param_2) { Entity::SetSize(param_1,param_2, (Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1); return; } //@@ 00872000 Spawn::Entries /* ZHL [lua] Lua binding Spawn:Entries */ void Spawn::Entries(uint *param_1,int param_2) { *param_1 = (uint)*(byte *)(param_2 + 8); param_1[1] = *(uint *)(param_2 + 4); return; } //@@ 00872020 Room::Spawns /* ZHL [lua] Lua binding Room:Spawns */ void Room::Spawns(uint *param_1,int param_2) { *param_1 = (uint)*(ushort *)(param_2 + 0x44); param_1[1] = *(uint *)(param_2 + 0x40); return; } //@@ 00872040 Room::Doors /* ZHL [lua] Lua binding Room:Doors */ undefined4 Room::Doors(int param_1) { return *(undefined4 *)(param_1 + 0x38); } //@@ 00872050 EntityPtr::SetReference /* ZHL [exact] __thiscall void EntityPtr::SetReference(Entity* entity); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall EntityPtr::SetReference(EntityPtr *this,Entity *entity) { EntityPtr *local_8; if (*this != (EntityPtr)0x0) { local_8 = this; std::multiset::erase(&local_8); } *this = (EntityPtr)entity; if (entity != (Entity *)0x0) { std::multiset::insert(this); } return; } //@@ 00872090 render_debug_lua_memory /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called at the end of Game::Render; requires the LuaEngine global (g_luaEngine, lua_State at +0x18) and Game debug flag bit 13 (flag 14 = Lua Memory Usage); draws bars with render_color_quad and a 30-frame timer at LuaEngine+0x264 */ void render_debug_lua_memory(void) { int *piVar1; KColor color; undefined4 uVar2; uint uVar3; int iVar4; void *pvVar5; KColor *fromColor; KColor *fromColor_00; KColor *fromColor_01; uint uVar6; Font *this; uint uVar7; int iVar8; float fVar9; double dVar10; undefined1 local_6c [16]; float local_5c; undefined4 local_58; undefined4 local_54; KColor local_50; float local_3c; float local_38; float local_34; Vector local_30; float local_28; Vector local_24; byte local_1c [4]; float local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar5 = g_luaEngine; local_8 = 0xffffffff; puStack_c = &LAB_00b04e95; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; piVar1 = (int *)((int)g_luaEngine + 0x18); if (((*piVar1 != 0) && (g_game != (Game *)0x0)) && (((uint)g_game->_debugFlags >> 0xd & 1) != 0)) { if (*(int *)((int)g_luaEngine + 0x264) == 0) { *(undefined4 *)((int)g_luaEngine + 0x264) = 0x1e; uVar2 = lua_gc(*piVar1,3,0,local_14); *(undefined4 *)((int)pvVar5 + *(int *)((int)pvVar5 + 0x25c) * 4 + 0x5c) = uVar2; *(int *)((int)pvVar5 + 0x25c) = *(int *)((int)pvVar5 + 0x25c) + 1; uVar7 = *(uint *)((int)pvVar5 + 0x25c); if (0x7f < uVar7) { *(undefined4 *)((int)pvVar5 + 0x25c) = 0; uVar7 = 0; } uVar3 = *(uint *)((int)pvVar5 + 0x260); if (uVar3 < 0x80) { uVar3 = uVar3 + 1; *(uint *)((int)pvVar5 + 0x260) = uVar3; } } else { uVar7 = *(uint *)((int)g_luaEngine + 0x25c); *(int *)((int)g_luaEngine + 0x264) = *(int *)((int)g_luaEngine + 0x264) + -1; uVar3 = *(uint *)((int)pvVar5 + 0x260); } uVar6 = 0; local_24.y = 0.0; local_38 = g_screenWidth - 10.0; local_34 = g_screenHeight - 10.0; local_28 = local_38 - 128.0; local_3c = local_34 - 64.0; local_24.x = local_38 + 1.0; if (uVar3 != 0) { local_24.y = 0.0; do { if (uVar7 == 0) { uVar7 = 0x7f; } else { uVar7 = uVar7 - 1; } iVar8 = *(int *)((int)pvVar5 + uVar7 * 4 + 0x5c); local_5c = local_24.x - 1.0; local_18 = local_34 - ((float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) * 64.0) / 512000.0; local_30.x = local_5c; dVar10 = ceil((double)local_18); local_30.y = (float)dVar10; local_18 = local_30.y; if (local_24.y != 0.0) { KColor::SetFromARGB(&local_50,0xffff0000); render_color_quad(&local_24,&local_30,fromColor,fromColor,1.0); } uVar6 = uVar6 + 1; local_24.y = local_18; local_24.x = local_5c; } while (uVar6 < *(uint *)((int)pvVar5 + 0x260)); } fVar9 = local_34; KColor::SetFromARGB(&local_50,0xffffffff); local_30.x = local_38; local_24.x = local_28; local_30.y = fVar9; local_24.y = fVar9; render_color_quad(&local_24,&local_30,fromColor_00,fromColor_00,1.0); KColor::SetFromARGB(&local_50,0xffffffff); local_30.y = local_34; local_30.x = local_28; local_24.x = local_28; local_24.y = local_3c; render_color_quad(&local_24,&local_30,fromColor_01,fromColor_01,1.0); iVar8 = 0; local_30.x = local_28; local_24.x = local_28 - 1.0; local_28 = local_28 - 4.0; do { local_50._unk = 0; local_3c = (g_screenHeight - 10.0) - (float)iVar8 * 32.0; local_50._red = 1.0; local_50._green = 1.0; local_50._blue = 1.0; local_50._alpha = 1.0; local_30.y = local_3c; local_24.y = local_3c; render_color_quad(&local_24,&local_30,&local_50,&local_50,1.0); FUN_008975b0(local_1c,&DAT_00b75368,iVar8 << 8); this = &g_manager->_font8_LuaMiniOutlined; local_58 = 0; local_54 = 0xffff; local_50._red = 0.0; local_50._green = 1.0; local_50._blue = -NAN; local_50._alpha = 0.0; local_50._unk = 0; local_8 = 0; iVar4 = Font::get_string_width_n(this,local_1c,-1); local_38 = local_28 - (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]); pvVar5 = Font::measure_string(this,local_6c,local_1c,&local_58,&g_vectorOne); local_8 = CONCAT31(local_8._1_3_,1); color._blue = 1.0; color._red = 1.0; color._green = 1.0; color._alpha = 1.0; color._unk = 0; Font::render_glyph_quads(this,pvVar5,local_38,local_3c - 9.0,1.0,1.0,color,&local_58); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); iVar8 = iVar8 + 1; local_8 = 0xffffffff; } while (iVar8 < 3); } ExceptionList = local_10; return; } //@@ 00872510 FUN_00872510 undefined4 FUN_00872510(undefined4 param_1) { undefined4 in_ECX; FUN_0085d910(in_ECX); return param_1; } //@@ 00872530 FUN_00872530 void FUN_00872530(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00872780,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00872590 FUN_00872590 void FUN_00872590(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity::IsVulnerableEnemy_lua; lua_pushcclosure(*in_ECX,FUN_00872730,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsVulnerableEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008725f0 std_set_int_erase_key /* DB: std::set::erase(const key&): equal_range by *param, erases the range, returns the count removed; Seeds::RemoveSeedEffect, Seeds::RemoveBlockingSeedEffects prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall std_set_int_erase_key(void *this,int *key) { char cVar1; int *piVar2; int *piVar3; int *piVar4; void *ptr; int *piVar5; int iVar6; int *piVar7; int *piVar8; int local_10; piVar2 = *(int **)this; piVar4 = (int *)piVar2[1]; piVar7 = piVar2; piVar8 = piVar2; if (*(char *)((int)piVar4 + 0xd) == '\0') { piVar3 = piVar4; do { if (piVar3[4] < *key) { piVar5 = (int *)piVar3[2]; } else { if ((*(char *)((int)piVar8 + 0xd) != '\0') && (*key < piVar3[4])) { piVar8 = piVar3; } piVar5 = (int *)*piVar3; piVar7 = piVar3; } piVar3 = piVar5; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar4 = (int *)*piVar8; } if (*(char *)((int)piVar4 + 0xd) == '\0') { do { if (*key < piVar4[4]) { piVar3 = (int *)*piVar4; piVar8 = piVar4; } else { piVar3 = (int *)piVar4[2]; } piVar4 = piVar3; } while (*(char *)((int)piVar3 + 0xd) == '\0'); } iVar6 = 0; local_10 = 0; piVar4 = piVar7; if (piVar7 != piVar8) { do { piVar3 = (int *)piVar4[2]; iVar6 = iVar6 + 1; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; while ((piVar4 = piVar5, cVar1 == '\0' && (piVar3 == (int *)piVar4[2]))) { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; } } } while (piVar4 != piVar8); local_10 = iVar6; } key = piVar7; if ((piVar7 == (int *)*piVar2) && (*(char *)((int)piVar8 + 0xd) != '\0')) { FID_conflict__Erase_tree_>_> (this,this,(_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; *(undefined4 *)((int)this + 4) = 0; } else if (piVar7 != piVar8) { do { piVar2 = key; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&key); ptr = std::_Tree::_Extract(this,piVar2); operator_delete(ptr,0x14); } while (key != piVar8); return local_10; } return local_10; } //@@ 00872730 FUN_00872730 void FUN_00872730(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(param_1); return; } //@@ 00872780 FUN_00872780 void FUN_00872780(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82978,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(param_1); return; } //@@ 008727d0 FUN_008727d0 void FUN_008727d0(undefined1 param_1) { undefined1 local_3c [40]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04ecd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_3c + 0x38); ExceptionList = &local_10; local_8 = 0; FUN_00897620(¶m_1); /* WARNING: Subroutine does not return */ _CxxThrowException(local_3c,(ThrowInfo *)&DAT_00bd5bf8); } //@@ 00872820 FUN_00872820 bool FUN_00872820(void) { void *luaState; undefined4 uVar1; int iVar2; undefined4 *in_ECX; luaState = (void *)*in_ECX; LuaRef::push(in_ECX,luaState); uVar1 = lua_gettop(*in_ECX); iVar2 = lua_toboolean(*in_ECX,uVar1); lua_settop(luaState,0xfffffffe); return iVar2 != 0; } //@@ 00872860 FUN_00872860 char * FUN_00872860(char *param_1) { void *luaState; uint uVar1; undefined4 uVar2; byte *text; undefined4 *in_ECX; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04f0d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; luaState = (void *)*in_ECX; local_8 = 0; LuaRef::push(in_ECX,luaState); uVar2 = lua_gettop(*in_ECX,uVar1); text = (byte *)luaL_checklstring(*in_ECX,uVar2,&local_14); param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; std::string::assign(param_1,text,local_14); lua_settop(luaState,0xfffffffe); ExceptionList = local_10; return param_1; } //@@ 00872910 luabridge::LuaRef::cast /* DB: ECX = LuaRef {lua_State, ref}: LuaRef::push, returns 0 for nil else luabridge::Userdata::getClass(&g_luaClassKeyEntity) object pointer; callers Isaac::CountEntities and Entity::IsVulnerableEnemy_lua */ undefined4 luabridge::LuaRef::cast(void) { void *luaState; undefined4 uVar1; int index; int iVar2; void *pvVar3; undefined4 *in_ECX; luaState = (void *)*in_ECX; ::LuaRef::push(in_ECX,luaState); index = lua_gettop(*in_ECX); pvVar3 = (void *)*in_ECX; iVar2 = lua_type(pvVar3,index); if (iVar2 == 0) { lua_settop(luaState,0xfffffffe); return 0; } pvVar3 = Userdata::getClass(pvVar3,index,&g_luaClassKeyEntity,0); uVar1 = *(undefined4 *)((int)pvVar3 + 4); lua_settop(luaState,0xfffffffe); return uVar1; } //@@ 00872980 FUN_00872980 undefined4 * FUN_00872980(undefined4 *param_1) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x8729a2; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x8729b1; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x8729bd; uStack_24 = uVar1; lua_pushinteger(); iStack_1c = 0; iStack_20 = 0; uStack_24 = 0; uStack_28 = 1; iStack_2c = 2; uStack_34 = 0x8729d1; iStack_30 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; uStack_24 = 0x8729e1; iStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x8729f2; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x8729fe; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00872a0c FUN_00872a0c void FUN_00872a0c(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00872a20 FUN_00872a20 undefined4 * FUN_00872a20(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x872a42; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x872a51; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x872a5d; pbStack_24 = (byte *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x872aa2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x872a70; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityNpc; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x872a8a; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x872a96; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x872ab6; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x872ac6; iStack_20 = uVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x872ad7; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x872ae3; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00872af1 FUN_00872af1 void FUN_00872af1(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00872b10 FUN_00872b10 int * FUN_00872b10(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x872b34; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x872b43; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x872b4f; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x872b9a; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x872b69; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyEntityNpc; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x872b82; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x872b8e; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x872bb8; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x872bd3; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x872bdf; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x872c08; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x872c18; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x872c29; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x872c35; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00872c43 FUN_00872c43 void FUN_00872c43(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00872c60 FUN_00872c60 int * FUN_00872c60(int *param_1,undefined4 param_2,int param_3,int param_4,byte param_5) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [4]; undefined4 uStack_3c; int iStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; uint uStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x872c82; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; iStack_38 = 0x872c91; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x872c9d; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x872ce4; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; pbStack_24 = (byte *)0x872cb6; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityNpc; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x872cd0; iStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x872cdc; iStack_20 = iVar1; lua_setmetatable(); } if (param_4 == 0) { iStack_20 = 0x872d25; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; pbStack_24 = (byte *)0x872cf7; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntity; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_4; iStack_30 = 0x872d11; iStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x872d1d; iStack_20 = iVar1; lua_setmetatable(); } uStack_1c = (uint)param_5; pbStack_24 = (byte *)0x872d34; iStack_20 = iVar1; lua_pushboolean(); pbStack_24 = (byte *)0x0; iStack_28 = 0; iStack_2c = 0; iStack_30 = 1; iStack_34 = 5; uStack_3c = 0x872d45; iStack_38 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; pbStack_24 = (byte *)0x872d55; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x872d66; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x872d72; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 00872d80 FUN_00872d80 void FUN_00872d80(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00872da0 FUN_00872da0 undefined4 * FUN_00872da0(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x872dc2; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x872dd1; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x872ddd; pbStack_24 = (byte *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x872e22; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x872df0; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityFamiliar; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x872e0a; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x872e16; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x872e36; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x872e46; iStack_20 = uVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x872e57; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x872e63; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00872e71 FUN_00872e71 void FUN_00872e71(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00872e90 FUN_00872e90 int * FUN_00872e90(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x872eb4; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x872ec3; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x872ecf; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x872f1a; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x872ee9; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyEntityFamiliar; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x872f02; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x872f0e; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x872f38; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x872f53; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x872f5f; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x872f88; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x872f98; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x872fa9; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x872fb5; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00872fc3 FUN_00872fc3 void FUN_00872fc3(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00872ff0 FUN_00872ff0 undefined4 * FUN_00872ff0(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined *puStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; iStack_2c = 0x873012; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873021; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x87302d; puStack_24 = (undefined *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x873072; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; puStack_24 = (undefined *)0x873040; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c829ce; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x87305a; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x873066; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; puStack_24 = (undefined *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x873086; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; puStack_24 = (undefined *)0x873096; iStack_20 = uVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x8730a7; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x8730b3; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 008730c1 FUN_008730c1 void FUN_008730c1(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 008730e0 FUN_008730e0 int * FUN_008730e0(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x873104; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x873113; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x87311f; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x87316a; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x873139; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &DAT_00c829ce; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x873152; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x87315e; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x873188; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x8731a3; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x8731af; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x8731d8; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x8731e8; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x8731f9; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x873205; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00873213 FUN_00873213 void FUN_00873213(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873230 FUN_00873230 undefined4 * FUN_00873230(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x873252; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873261; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x87326d; pbStack_24 = (byte *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x8732b2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x873280; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityLaser; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x87329a; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x8732a6; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x8732c6; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x8732d6; iStack_20 = uVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x8732e7; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x8732f3; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00873301 FUN_00873301 void FUN_00873301(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873320 FUN_00873320 int * FUN_00873320(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x873344; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x873353; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x87335f; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x8733aa; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x873379; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyEntityLaser; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x873392; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x87339e; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x8733c8; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x8733e3; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x8733ef; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x873418; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x873428; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x873439; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x873445; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00873453 FUN_00873453 void FUN_00873453(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873470 FUN_00873470 undefined4 * FUN_00873470(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined *puStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; iStack_2c = 0x873492; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x8734a1; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x8734ad; puStack_24 = (undefined *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x8734f2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; puStack_24 = (undefined *)0x8734c0; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c829e0; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x8734da; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x8734e6; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; puStack_24 = (undefined *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x873506; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; puStack_24 = (undefined *)0x873516; iStack_20 = uVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x873527; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x873533; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00873541 FUN_00873541 void FUN_00873541(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873560 FUN_00873560 undefined4 * FUN_00873560(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined *puStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; iStack_2c = 0x873582; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873591; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x87359d; puStack_24 = (undefined *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x8735e2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; puStack_24 = (undefined *)0x8735b0; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c829da; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x8735ca; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x8735d6; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; puStack_24 = (undefined *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x8735f6; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; puStack_24 = (undefined *)0x873606; iStack_20 = uVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x873617; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x873623; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00873631 FUN_00873631 void FUN_00873631(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873650 FUN_00873650 undefined4 * FUN_00873650(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined *puStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; iStack_2c = 0x873672; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873681; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x87368d; puStack_24 = (undefined *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x8736d2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; puStack_24 = (undefined *)0x8736a0; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c829d4; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x8736ba; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x8736c6; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; puStack_24 = (undefined *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x8736e6; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; puStack_24 = (undefined *)0x8736f6; iStack_20 = uVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x873707; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x873713; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00873721 FUN_00873721 void FUN_00873721(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873740 FUN_00873740 int * FUN_00873740(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x873764; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x873773; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x87377f; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x8737ca; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x873799; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &DAT_00c829d4; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x8737b2; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x8737be; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x8737e8; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x873803; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x87380f; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x873838; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x873848; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x873859; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x873865; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00873873 FUN_00873873 void FUN_00873873(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873890 FUN_00873890 undefined4 * FUN_00873890(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x8738b2; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x8738c1; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x8738cd; pbStack_24 = (byte *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x873912; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x8738e0; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityTear; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x8738fa; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x873906; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x873926; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x873936; iStack_20 = uVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x873947; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x873953; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00873961 FUN_00873961 void FUN_00873961(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873980 FUN_00873980 int * FUN_00873980(int *param_1,undefined4 param_2,int param_3,int param_4,byte param_5) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [4]; undefined4 uStack_3c; int iStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; uint uStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x8739a2; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; iStack_38 = 0x8739b1; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x8739bd; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x873a04; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; pbStack_24 = (byte *)0x8739d6; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityTear; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x8739f0; iStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x8739fc; iStack_20 = iVar1; lua_setmetatable(); } if (param_4 == 0) { iStack_20 = 0x873a45; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; pbStack_24 = (byte *)0x873a17; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntity; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_4; iStack_30 = 0x873a31; iStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x873a3d; iStack_20 = iVar1; lua_setmetatable(); } uStack_1c = (uint)param_5; pbStack_24 = (byte *)0x873a54; iStack_20 = iVar1; lua_pushboolean(); pbStack_24 = (byte *)0x0; iStack_28 = 0; iStack_2c = 0; iStack_30 = 1; iStack_34 = 5; uStack_3c = 0x873a65; iStack_38 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; pbStack_24 = (byte *)0x873a75; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x873a86; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x873a92; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 00873aa0 FUN_00873aa0 void FUN_00873aa0(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873ac0 FUN_00873ac0 undefined4 * FUN_00873ac0(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined *puStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; iStack_2c = 0x873ae2; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873af1; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x873afd; puStack_24 = (undefined *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x873b42; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; puStack_24 = (undefined *)0x873b10; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c829cb; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x873b2a; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x873b36; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; puStack_24 = (undefined *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x873b56; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; puStack_24 = (undefined *)0x873b66; iStack_20 = uVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x873b77; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x873b83; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00873b91 FUN_00873b91 void FUN_00873b91(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873bb0 FUN_00873bb0 int * FUN_00873bb0(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x873bd4; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x873be3; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x873bef; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x873c3a; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x873c09; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &DAT_00c829cb; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x873c22; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x873c2e; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x873c58; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x873c73; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x873c7f; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x873ca8; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x873cb8; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x873cc9; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x873cd5; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00873ce3 FUN_00873ce3 void FUN_00873ce3(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873d00 FUN_00873d00 int * FUN_00873d00(int *param_1,undefined4 param_2,int param_3,int param_4,byte param_5) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [4]; undefined4 uStack_3c; int iStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; uint uStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x873d22; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; iStack_38 = 0x873d31; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x873d3d; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x873d84; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; pbStack_24 = (byte *)0x873d56; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &DAT_00c829cb; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x873d70; iStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x873d7c; iStack_20 = iVar1; lua_setmetatable(); } if (param_4 == 0) { iStack_20 = 0x873dc5; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; pbStack_24 = (byte *)0x873d97; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntity; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_4; iStack_30 = 0x873db1; iStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x873dbd; iStack_20 = iVar1; lua_setmetatable(); } uStack_1c = (uint)param_5; pbStack_24 = (byte *)0x873dd4; iStack_20 = iVar1; lua_pushboolean(); pbStack_24 = (byte *)0x0; iStack_28 = 0; iStack_2c = 0; iStack_30 = 1; iStack_34 = 5; uStack_3c = 0x873de5; iStack_38 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; pbStack_24 = (byte *)0x873df5; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x873e06; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x873e12; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 00873e20 FUN_00873e20 void FUN_00873e20(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873e40 FUN_00873e40 int * FUN_00873e40(int *param_1,undefined4 param_2,int param_3,undefined4 param_4) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; undefined *puStack_24; int iStack_20; int iStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; iStack_2c = 0x873e62; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873e71; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x873e7d; puStack_24 = (undefined *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x873ec2; iStack_1c = iVar1; lua_pushnil(); } else { iStack_1c = 8; puStack_24 = (undefined *)0x873e90; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c829cb; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x873eaa; iStack_2c = iVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x873eb6; iStack_20 = iVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = param_4; iStack_28 = 0x873ecd; puStack_24 = (undefined *)iVar1; lua_pushinteger(); iStack_1c = 0x873eda; FUN_0085bff0(); iStack_1c = 0; iStack_20 = 0; puStack_24 = (undefined *)0x0; iStack_28 = 1; iStack_2c = 5; iStack_34 = 0x873eeb; iStack_30 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; puStack_24 = (undefined *)0x873efb; iStack_20 = iVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x873f0c; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x873f18; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 00873f26 FUN_00873f26 void FUN_00873f26(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00873f40 luabridge::LuaRef::Proxy::cast /* DB: ECX = {lua_State, tableRef, keyRef}: lua_rawgeti both refs, lua_gettable, then luaL_checkinteger on the value; used by lua_callback_run_pre_entity_spawn / LuaEngine::Callback_PreEntitySpawn to read the returned table's integers */ undefined4 luabridge::LuaRef::Proxy::cast(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; uVar1 = *in_ECX; lua_rawgeti(uVar1,0xfff0b9d8,in_ECX[1],(int)in_ECX[1] >> 0x1f); lua_rawgeti(uVar1,0xfff0b9d8,in_ECX[2],(int)in_ECX[2] >> 0x1f); lua_gettable(uVar1,0xfffffffe); lua_rotate(uVar1,0xfffffffe,0xffffffff); lua_settop(uVar1,0xfffffffe); uVar2 = lua_gettop(*in_ECX); uVar2 = luaL_checkinteger(*in_ECX,uVar2); lua_settop(uVar1,0xfffffffe); return uVar2; } //@@ 00873fc0 LuaCallbackCaller::CallUseItem /* DB: ? Lua callback invoker: lua_rawgeti(callback table ref), pushes callback id (+4), item id, RNG and EntityPlayer as luabridge UserdataPtr (nil if null), use flags, slot, custom var data, then pcall; only callers LuaEngine::PreUseItem / LuaEngine::UseItem; sibling of LuaCallbackCaller::CallInputAction 00874910 */ int * LuaCallbackCaller::CallUseItem (int *param_1,undefined4 param_2,int param_3,int param_4,int param_5, undefined4 param_6) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x873fe2; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x873ff1; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x873ffd; pbStack_24 = (byte *)iVar1; lua_pushinteger(); iStack_1c = param_3 >> 0x1f; iStack_20 = param_3; iStack_28 = 0x874009; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_4 == 0) { iStack_20 = 0x874050; iStack_1c = iVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x874022; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &DAT_00c82995; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_4; iStack_30 = 0x87403c; iStack_2c = iVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874048; iStack_20 = iVar1; lua_setmetatable(); } if (param_5 == 0) { iStack_20 = 0x874091; iStack_1c = iVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x874063; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityPlayer; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_5; iStack_30 = 0x87407d; iStack_2c = iVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874089; iStack_20 = iVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = param_6; iStack_28 = 0x8740a0; pbStack_24 = (byte *)iVar1; lua_pushinteger(); iStack_1c = 0x8740ad; FUN_0085bfd0(); iStack_1c = 0x8740b7; FUN_0085bfd0(); iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; iStack_28 = 1; iStack_2c = 8; iStack_34 = 0x8740c8; iStack_30 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x8740d8; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x8740e9; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x8740f5; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 00874103 FUN_00874103 void FUN_00874103(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874120 FUN_00874120 undefined4 * FUN_00874120(undefined4 *param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x874142; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874151; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x87415d; pbStack_24 = (byte *)uVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x8741a2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x874170; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityPlayer; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x87418a; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874196; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x8741b6; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x8741c6; iStack_20 = uVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x8741d7; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar4; uStack_34 = 0x8741e3; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 008741f1 FUN_008741f1 void FUN_008741f1(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874210 FUN_00874210 int * FUN_00874210(int *param_1,undefined4 param_2,int param_3,int param_4) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x874232; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874241; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x87424d; pbStack_24 = (byte *)iVar1; lua_pushinteger(); iStack_1c = param_3 >> 0x1f; iStack_20 = param_3; iStack_28 = 0x874259; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_4 == 0) { iStack_20 = 0x87429e; iStack_1c = iVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x87426c; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityPlayer; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_4; iStack_30 = 0x874286; iStack_2c = iVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874292; iStack_20 = iVar1; lua_setmetatable(); } iStack_1c = 0x8742ab; FUN_0085bff0(); iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; iStack_28 = 1; iStack_2c = 5; iStack_34 = 0x8742bc; iStack_30 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x8742cc; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x8742dd; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x8742e9; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 008742f7 FUN_008742f7 void FUN_008742f7(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874310 FUN_00874310 int * FUN_00874310(int *param_1,undefined4 param_2,int param_3) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x874332; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874341; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x87434d; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x874392; iStack_1c = iVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x874360; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntityPlayer; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x87437a; iStack_2c = iVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874386; iStack_20 = iVar1; lua_setmetatable(); } iStack_1c = 0x87439f; FUN_0085bfd0(); iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; iStack_28 = 1; iStack_2c = 4; iStack_34 = 0x8743b0; iStack_30 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x8743c0; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x8743d1; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x8743dd; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 008743eb FUN_008743eb void FUN_008743eb(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874400 FUN_00874400 int * FUN_00874400(int *param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_48 [4]; undefined4 uStack_44; int iStack_40; int iStack_3c; int iStack_38; int iStack_34; int iStack_30; byte *pbStack_2c; int iStack_28; int iStack_24; iVar1 = *(int *)*in_ECX; iStack_28 = ((int *)*in_ECX)[1]; iStack_24 = iStack_28 >> 0x1f; pbStack_2c = (byte *)0xfff0b9d8; iStack_34 = 0x874424; iStack_30 = iVar1; lua_rawgeti(); iStack_38 = in_ECX[1]; iStack_34 = iStack_38 >> 0x1f; iStack_40 = 0x874433; iStack_3c = iVar1; lua_pushinteger(); iStack_28 = in_ECX[2]; iStack_24 = iStack_28 >> 0x1f; iStack_30 = 0x87443f; pbStack_2c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_28 = 0x87448a; iStack_24 = iVar1; lua_pushnil(); } else { iStack_24 = 8; pbStack_2c = (byte *)0x874459; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyEntityPlayer; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_38 = 0x874472; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x87447e; iStack_28 = iVar1; lua_setmetatable(); } iStack_24 = 0x10; pbStack_2c = (byte *)0x8744a8; iStack_28 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_2c = &g_luaClassKeyVector; iStack_30 = 0xfff0b9d8; *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; iStack_38 = 0x8744c3; iStack_34 = iVar1; lua_rawgetp(); iStack_24 = 0xfffffffe; pbStack_2c = (byte *)0x8744cf; iStack_28 = iVar1; lua_setmetatable(); puVar2 = (undefined4 *)puVar2[1]; pbStack_2c = (byte *)0x0; iStack_30 = 0; iStack_34 = 0; iStack_38 = 1; *puVar2 = param_4; iStack_3c = 4; puVar2[1] = param_5; uStack_44 = 0x8744f8; iStack_40 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_48); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_24 = 0xffffffff; pbStack_2c = (byte *)0x874508; iStack_28 = iVar1; lua_pushvalue(); pbStack_2c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_34 = 0x874519; iStack_30 = iVar1; iVar3 = luaL_ref(); iStack_34 = 0xfffffffe; param_1[1] = iVar3; iStack_3c = 0x874525; iStack_38 = iVar1; lua_settop(); return param_1; } //@@ 00874533 FUN_00874533 void FUN_00874533(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874550 FUN_00874550 int * FUN_00874550(int *param_1,undefined4 param_2,int param_3,float param_4,undefined4 param_5, undefined4 param_6,int param_7) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_a8 [8]; undefined4 uStack_a0; int iStack_9c; int iStack_98; int iStack_94; int iStack_90; byte *pbStack_8c; undefined8 uStack_88; iVar1 = *(int *)*in_ECX; uStack_88 = (double)(longlong)((int *)*in_ECX)[1]; pbStack_8c = (byte *)0xfff0b9d8; iStack_94 = 0x874574; iStack_90 = iVar1; lua_rawgeti(); iStack_98 = in_ECX[1]; iStack_94 = iStack_98 >> 0x1f; uStack_a0 = 0x874583; iStack_9c = iVar1; lua_pushinteger(); uStack_88 = (double)(longlong)in_ECX[2]; iStack_90 = 0x87458f; pbStack_8c = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { uStack_88 = (double)CONCAT44(iVar1,0x8745d6); lua_pushnil(); } else { uStack_88 = (double)CONCAT44(8,iVar1); pbStack_8c = (byte *)0x8745a8; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_8c = &g_luaClassKeyEntity; iStack_90 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_98 = 0x8745c2; iStack_94 = iVar1; lua_rawgetp(); uStack_88 = (double)CONCAT44(0xfffffffe,iVar1); pbStack_8c = (byte *)0x8745ce; lua_setmetatable(); } uStack_88 = (double)param_4; iStack_90 = 0x8745f0; pbStack_8c = (byte *)iVar1; lua_pushnumber(); uStack_88 = (double)CONCAT44(param_6,param_5); iStack_90 = 0x874600; pbStack_8c = (byte *)iVar1; lua_pushinteger(); if (param_7 == 0) { uStack_88 = (double)CONCAT44(iVar1,0x874641); lua_pushnil(); } else { uStack_88 = (double)CONCAT44(8,iVar1); pbStack_8c = (byte *)0x874613; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_8c = &DAT_00c82991; iStack_90 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_7; iStack_98 = 0x87462d; iStack_94 = iVar1; lua_rawgetp(); uStack_88 = (double)CONCAT44(0xfffffffe,iVar1); pbStack_8c = (byte *)0x874639; lua_setmetatable(); } uStack_88 = (double)CONCAT44(0x87464e,(undefined4)uStack_88); FUN_0085bfd0(); uStack_88 = 0.0; pbStack_8c = (byte *)0x0; iStack_90 = 1; iStack_94 = 7; iStack_9c = 0x87465f; iStack_98 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_a8); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_88 = (double)CONCAT44(0xffffffff,iVar1); pbStack_8c = (byte *)0x87466f; lua_pushvalue(); pbStack_8c = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_94 = 0x874680; iStack_90 = iVar1; iVar3 = luaL_ref(); iStack_94 = 0xfffffffe; param_1[1] = iVar3; iStack_9c = 0x87468c; iStack_98 = iVar1; lua_settop(); return param_1; } //@@ 0087469a FUN_0087469a void FUN_0087469a(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 008746b0 luabridge::LuaRef::call /* DB: LuaRef::push then 3 ints (FUN_0085bfd0), 2 uints (FUN_0085bff0), two Vector UserdataValue, Entity UserdataPtr or nil, uint, lua_pcallk 9 args 1 result, returns the result as a new LuaRef; only caller lua_callback_run_pre_entity_spawn */ undefined4 * luabridge::LuaRef::call(undefined4 *param_1) { byte *luaState; undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined4 *in_ECX; int in_stack_00000018; undefined4 in_stack_00000020; undefined4 in_stack_00000024; undefined4 in_stack_00000028; undefined4 in_stack_0000002c; undefined1 auStack_38 [8]; undefined4 uStack_30; byte *pbStack_2c; byte *pbStack_28; byte *pbStack_24; byte *pbStack_20; byte *pbStack_1c; byte *pbStack_18; luaState = *(byte **)*in_ECX; pbStack_18 = (byte *)0x8746c2; ::LuaRef::push((undefined4 *)*in_ECX,luaState); FUN_0085bfd0(); FUN_0085bfd0(); FUN_0085bfd0(); FUN_0085bff0(); FUN_0085bff0(); pbStack_1c = (byte *)0x874713; pbStack_18 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_1c = &g_luaClassKeyVector; pbStack_20 = (byte *)0xfff0b9d8; *puVar1 = UserdataValue::vftable; puVar1[1] = puVar1 + 2; pbStack_28 = (byte *)0x874732; pbStack_24 = luaState; lua_rawgetp(); pbStack_1c = (byte *)0x87473e; pbStack_18 = luaState; lua_setmetatable(); puVar1 = (undefined4 *)puVar1[1]; pbStack_1c = (byte *)0x10; *puVar1 = in_stack_00000020; puVar1[1] = in_stack_00000024; pbStack_24 = (byte *)0x87476d; pbStack_20 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyVector; pbStack_28 = (byte *)0xfff0b9d8; *puVar1 = UserdataValue::vftable; puVar1[1] = puVar1 + 2; uStack_30 = 0x87478c; pbStack_2c = luaState; lua_rawgetp(); pbStack_1c = (byte *)0x874798; pbStack_18 = luaState; lua_setmetatable(); puVar1 = (undefined4 *)puVar1[1]; *puVar1 = in_stack_00000028; puVar1[1] = in_stack_0000002c; if (in_stack_00000018 == 0) { pbStack_18 = (byte *)0x8747ef; lua_pushnil(); } else { pbStack_1c = (byte *)0x8747bd; pbStack_18 = luaState; puVar1 = (undefined4 *)lua_newuserdata(); pbStack_1c = &DAT_00c82a1f; pbStack_20 = (byte *)0xfff0b9d8; *puVar1 = UserdataPtr::vftable; puVar1[1] = in_stack_00000018; pbStack_28 = (byte *)0x8747d7; pbStack_24 = luaState; lua_rawgetp(); pbStack_1c = (byte *)0x8747e3; pbStack_18 = luaState; lua_setmetatable(); } FUN_0085bff0(); pbStack_18 = (byte *)0x0; pbStack_1c = (byte *)0x0; pbStack_20 = (byte *)0x1; pbStack_24 = (byte *)0x9; pbStack_2c = (byte *)0x87480d; pbStack_28 = luaState; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(luaState,auStack_38); /* WARNING: Subroutine does not return */ FUN_008727d0(); } pbStack_1c = (byte *)0x87481d; pbStack_18 = luaState; lua_pushvalue(); pbStack_1c = (byte *)0xfff0b9d8; *param_1 = luaState; pbStack_24 = (byte *)0x87482e; pbStack_20 = luaState; uVar3 = luaL_ref(); pbStack_24 = (byte *)0xfffffffe; param_1[1] = uVar3; pbStack_2c = (byte *)0x87483a; pbStack_28 = luaState; lua_settop(); return param_1; } //@@ 00874846 FUN_00874846 void FUN_00874846(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874860 FUN_00874860 undefined4 * FUN_00874860(undefined4 *param_1) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x874882; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874891; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x87489d; uStack_24 = uVar1; lua_pushinteger(); iStack_1c = 0x8748aa; FUN_0085bfd0(); iStack_1c = 0; iStack_20 = 0; uStack_24 = 0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x8748bb; iStack_30 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; uStack_24 = 0x8748cb; iStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x8748dc; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x8748e8; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 008748f6 FUN_008748f6 void FUN_008748f6(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874910 LuaCallbackCaller::CallInputAction /* ZHL [exact] LuaCallbackCallerResult CallInputAction(LuaEngine* engine, Entity* entity, int hook, int action); */ int * LuaCallbackCaller::CallInputAction(int *param_1,undefined4 param_2,int param_3,int param_4) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; int iStack_34; int iStack_30; int iStack_2c; int iStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x874932; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874941; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x87494d; pbStack_24 = (byte *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x874992; iStack_1c = iVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x874960; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntity; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x87497a; iStack_2c = iVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874986; iStack_20 = iVar1; lua_setmetatable(); } iStack_1c = param_4 >> 0x1f; iStack_20 = param_4; iStack_28 = 0x87499e; pbStack_24 = (byte *)iVar1; lua_pushinteger(); iStack_1c = 0x8749ab; FUN_0085bff0(); iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; iStack_28 = 1; iStack_2c = 5; iStack_34 = 0x8749bc; iStack_30 = iVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(iVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x8749cc; iStack_20 = iVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *param_1 = iVar1; iStack_2c = 0x8749dd; iStack_28 = iVar1; iVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x8749e9; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 008749f7 FUN_008749f7 void FUN_008749f7(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874a10 FUN_00874a10 undefined4 * FUN_00874a10(undefined4 *param_1,undefined4 param_2,byte param_3) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [4]; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; int iStack_20; uint uStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x874a32; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874a41; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x874a4d; uStack_24 = uVar1; lua_pushinteger(); uStack_1c = (uint)param_3; uStack_24 = 0x874a5c; iStack_20 = uVar1; lua_pushboolean(); uStack_24 = 0; uStack_28 = 0; iStack_2c = 0; iStack_30 = 1; uStack_34 = 3; uStack_3c = 0x874a6d; uStack_38 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; uStack_24 = 0x874a7d; iStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x874a8e; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x874a9a; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00874aa8 FUN_00874aa8 void FUN_00874aa8(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874ac0 FUN_00874ac0 int * FUN_00874ac0(int *param_1,undefined4 param_2,int param_3,int param_4,byte param_5,byte param_6 ,byte param_7) { int iVar1; undefined4 *puVar2; int iVar3; int *in_ECX; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; int iStack_34; int iStack_30; uint uStack_2c; int iStack_28; undefined *puStack_24; int iStack_20; uint uStack_1c; iVar1 = *(int *)*in_ECX; iStack_20 = ((int *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; puStack_24 = (undefined *)0xfff0b9d8; uStack_2c = 0x874ae2; iStack_28 = iVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; uStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874af1; iStack_34 = iVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; iStack_28 = 0x874afd; puStack_24 = (undefined *)iVar1; lua_pushinteger(); if (param_3 == 0) { iStack_20 = 0x874b42; uStack_1c = iVar1; lua_pushnil(); } else { uStack_1c = 8; puStack_24 = (undefined *)0x874b10; iStack_20 = iVar1; puVar2 = (undefined4 *)lua_newuserdata(); puStack_24 = &DAT_00c82995; iStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = param_3; iStack_30 = 0x874b2a; uStack_2c = iVar1; lua_rawgetp(); uStack_1c = 0xfffffffe; puStack_24 = (undefined *)0x874b36; iStack_20 = iVar1; lua_setmetatable(); } uStack_1c = param_4 >> 0x1f; iStack_20 = param_4; iStack_28 = 0x874b4e; puStack_24 = (undefined *)iVar1; lua_pushinteger(); uStack_1c = (uint)param_5; puStack_24 = (undefined *)0x874b5f; iStack_20 = iVar1; lua_pushboolean(); puStack_24 = (undefined *)(uint)param_6; uStack_2c = 0x874b67; iStack_28 = iVar1; lua_pushboolean(); uStack_2c = (uint)param_7; iStack_34 = 0x874b6f; iStack_30 = iVar1; lua_pushboolean(); iStack_34 = 0; uStack_38 = 0; uStack_3c = 0; uStack_40 = 1; iVar3 = lua_pcallk(iVar1,7); if (iVar3 != 0) { FUN_0085c080(iVar1,&uStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; puStack_24 = (undefined *)0x874b90; iStack_20 = iVar1; lua_pushvalue(); puStack_24 = (undefined *)0xfff0b9d8; *param_1 = iVar1; uStack_2c = 0x874ba1; iStack_28 = iVar1; iVar3 = luaL_ref(); uStack_2c = 0xfffffffe; param_1[1] = iVar3; iStack_34 = 0x874bad; iStack_30 = iVar1; lua_settop(); return param_1; } //@@ 00874bbb FUN_00874bbb void FUN_00874bbb(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874bd0 FUN_00874bd0 undefined4 * FUN_00874bd0(undefined4 *param_1,undefined4 param_2,void *param_3) { int iVar1; undefined4 uVar2; undefined4 *in_ECX; void *ptr; void *pvVar3; uint uVar4; uint in_stack_00000020; undefined1 auStack_64 [12]; undefined4 uStack_58; void *pvStack_54; undefined4 uStack_50; void *pvStack_4c; void *pvStack_48; void *local_2c [5]; uint local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b04f3d; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = param_1; local_8 = 0; pvVar3 = *(void **)*in_ECX; LuaRef::push((undefined4 *)*in_ECX,pvVar3); FUN_0085bfd0(); FUN_0085bfd0(); std::string::string((char *)local_2c,¶m_3); pvStack_4c = (void *)0x874c47; pvStack_48 = pvVar3; lua_pushlstring(); if (0xf < local_18) { uVar4 = local_18 + 1; ptr = local_2c[0]; if (0xfff < uVar4) { ptr = *(void **)((int)local_2c[0] + -4); uVar4 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } pvStack_48 = (void *)0x874c7d; operator_delete(ptr,uVar4); } pvStack_48 = (void *)0x0; pvStack_4c = (void *)0x1; uStack_50 = 3; uStack_58 = 0x874c91; pvStack_54 = pvVar3; iVar1 = lua_pcallk(); if (iVar1 != 0) { FUN_0085c080(pvVar3,auStack_64); /* WARNING: Subroutine does not return */ FUN_008727d0(); } pvStack_48 = (void *)0x874ca1; lua_pushvalue(); pvStack_48 = (void *)0xfff0b9d8; *param_1 = pvVar3; uStack_50 = 0x874caf; pvStack_4c = pvVar3; uVar2 = luaL_ref(); uStack_50 = 0xfffffffe; param_1[1] = uVar2; uStack_58 = 0x874cbb; pvStack_54 = pvVar3; lua_settop(); if (0xf < in_stack_00000020) { uVar4 = in_stack_00000020 + 1; pvVar3 = param_3; if (0xfff < uVar4) { pvVar3 = *(void **)((int)param_3 + -4); uVar4 = in_stack_00000020 + 0x24; if (0x1f < (uint)((int)param_3 + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } pvStack_48 = (void *)0x874cf1; operator_delete(pvVar3,uVar4); } ExceptionList = local_10; return param_1; } //@@ 00874d0a FUN_00874d0a void FUN_00874d0a(void) { undefined4 unaff_EDI; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EDI,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874d20 FUN_00874d20 undefined4 * FUN_00874d20(undefined4 *param_1) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; int iStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = iStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x874d42; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874d51; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x874d5d; uStack_24 = uVar1; lua_pushinteger(); iStack_1c = 0x874d6a; FUN_0085bff0(); iStack_1c = 0; iStack_20 = 0; uStack_24 = 0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x874d7b; iStack_30 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; uStack_24 = 0x874d8b; iStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x874d9c; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x874da8; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00874db6 FUN_00874db6 void FUN_00874db6(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874dd0 FUN_00874dd0 undefined4 * FUN_00874dd0(undefined4 *param_1,undefined4 param_2,int param_3,byte param_4) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [4]; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; int iStack_20; uint uStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x874df2; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874e01; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x874e0d; uStack_24 = uVar1; lua_pushinteger(); uStack_1c = param_3 >> 0x1f; iStack_20 = param_3; uStack_28 = 0x874e19; uStack_24 = uVar1; lua_pushinteger(); uStack_1c = (uint)param_4; uStack_24 = 0x874e28; iStack_20 = uVar1; lua_pushboolean(); uStack_24 = 0x874e32; FUN_0085bff0(); uStack_24 = 0; uStack_28 = 0; iStack_2c = 0; iStack_30 = 1; uStack_34 = 5; uStack_3c = 0x874e43; uStack_38 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; uStack_24 = 0x874e53; iStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x874e64; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x874e70; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00874e7e FUN_00874e7e void FUN_00874e7e(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874e90 FUN_00874e90 undefined4 * FUN_00874e90(undefined4 *param_1,undefined4 param_2,int param_3,int param_4,byte param_5) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [4]; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; int iStack_20; uint uStack_1c; uVar1 = *(undefined4 *)*in_ECX; iStack_20 = ((undefined4 *)*in_ECX)[1]; uStack_1c = iStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x874eb2; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874ec1; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = in_ECX[2]; uStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x874ecd; uStack_24 = uVar1; lua_pushinteger(); uStack_1c = param_3 >> 0x1f; iStack_20 = param_3; uStack_28 = 0x874ed9; uStack_24 = uVar1; lua_pushinteger(); uStack_1c = param_4 >> 0x1f; iStack_20 = param_4; uStack_28 = 0x874ee5; uStack_24 = uVar1; lua_pushinteger(); uStack_1c = (uint)param_5; uStack_24 = 0x874ef4; iStack_20 = uVar1; lua_pushboolean(); uStack_24 = 0x874efe; FUN_0085bff0(); uStack_24 = 0; uStack_28 = 0; iStack_2c = 0; iStack_30 = 1; uStack_34 = 6; uStack_3c = 0x874f0f; uStack_38 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } uStack_1c = 0xffffffff; uStack_24 = 0x874f1f; iStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x874f30; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x874f3c; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00874f4a FUN_00874f4a void FUN_00874f4a(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00874f60 lua_callback_run_entity /* DB: (outRef, filter, entity): pushes the callback runner from the LuaEngine refs, the callback id/filter ints and the Entity as luabridge UserdataPtr (or nil), pcalls and returns the result as a new registry ref; LuaEngine::PostEntityKill uses it when callback bit 68 (MC_POST_ENTITY_KILL, word +8 bit 4) is set with (ent->_type, ent), Entity::ReleaseLuaRef for MC_POST_ENTITY_REMOVE prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall lua_callback_run_entity(void *this,void *outRef,int unusedFilter,Entity *entity) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; byte *pbStack_24; int iStack_20; int iStack_1c; uVar1 = **(undefined4 **)this; iStack_20 = (*(undefined4 **)this)[1]; iStack_1c = iStack_20 >> 0x1f; pbStack_24 = (byte *)0xfff0b9d8; iStack_2c = 0x874f82; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = *(int *)((int)this + 4); iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x874f91; uStack_34 = uVar1; lua_pushinteger(); iStack_20 = *(int *)((int)this + 8); iStack_1c = iStack_20 >> 0x1f; uStack_28 = 0x874f9d; pbStack_24 = (byte *)uVar1; lua_pushinteger(); if (entity == (Entity *)0x0) { iStack_20 = 0x874fe2; iStack_1c = uVar1; lua_pushnil(); } else { iStack_1c = 8; pbStack_24 = (byte *)0x874fb0; iStack_20 = uVar1; puVar2 = (undefined4 *)lua_newuserdata(); pbStack_24 = &g_luaClassKeyEntity; uStack_28 = 0xfff0b9d8; *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = entity; iStack_30 = 0x874fca; iStack_2c = uVar1; lua_rawgetp(); iStack_1c = 0xfffffffe; pbStack_24 = (byte *)0x874fd6; iStack_20 = uVar1; lua_setmetatable(); } iStack_1c = 0; iStack_20 = 0; pbStack_24 = (byte *)0x0; uStack_28 = 1; iStack_2c = 3; uStack_34 = 0x874ff6; iStack_30 = uVar1; iVar3 = lua_pcallk(); if (iVar3 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; pbStack_24 = (byte *)0x875006; iStack_20 = uVar1; lua_pushvalue(); pbStack_24 = (byte *)0xfff0b9d8; *(undefined4 *)outRef = uVar1; iStack_2c = 0x875017; uStack_28 = uVar1; uVar4 = luaL_ref(); iStack_2c = 0xfffffffe; *(undefined4 *)((int)outRef + 4) = uVar4; uStack_34 = 0x875023; iStack_30 = uVar1; lua_settop(); return outRef; } //@@ 00875050 FUN_00875050 undefined4 * FUN_00875050(undefined4 *param_1,undefined4 param_2,undefined4 param_3,ushort param_4,ushort param_5 ,undefined4 param_6) { undefined4 uVar1; int iVar2; undefined4 uVar3; int *in_ECX; undefined1 auStack_40 [8]; undefined4 uStack_38; undefined4 uStack_34; int iStack_30; int iStack_2c; undefined4 uStack_28; undefined4 uStack_24; uint uStack_20; int iStack_1c; uVar1 = *(undefined4 *)*in_ECX; uStack_20 = ((undefined4 *)*in_ECX)[1]; iStack_1c = (int)uStack_20 >> 0x1f; uStack_24 = 0xfff0b9d8; iStack_2c = 0x875072; uStack_28 = uVar1; lua_rawgeti(); iStack_30 = in_ECX[1]; iStack_2c = iStack_30 >> 0x1f; uStack_38 = 0x875081; uStack_34 = uVar1; lua_pushinteger(); uStack_20 = in_ECX[2]; iStack_1c = (int)uStack_20 >> 0x1f; uStack_28 = 0x87508d; uStack_24 = uVar1; lua_pushinteger(); iStack_1c = 0; uStack_20 = param_3; uStack_28 = 0x875098; uStack_24 = uVar1; lua_pushinteger(); uStack_20 = (uint)param_4; iStack_1c = 0; uStack_28 = 0x8750a5; uStack_24 = uVar1; lua_pushinteger(); uStack_20 = (uint)param_5; iStack_1c = 0; uStack_28 = 0x8750b2; uStack_24 = uVar1; lua_pushinteger(); iStack_1c = 0; uStack_20 = param_6; uStack_28 = 0x8750bd; uStack_24 = uVar1; lua_pushinteger(); iStack_1c = 0x8750ca; FUN_0085bff0(); iStack_1c = 0; uStack_20 = 0; uStack_24 = 0; uStack_28 = 1; iStack_2c = 7; uStack_34 = 0x8750db; iStack_30 = uVar1; iVar2 = lua_pcallk(); if (iVar2 != 0) { FUN_0085c080(uVar1,auStack_40); /* WARNING: Subroutine does not return */ FUN_008727d0(); } iStack_1c = 0xffffffff; uStack_24 = 0x8750eb; uStack_20 = uVar1; lua_pushvalue(); uStack_24 = 0xfff0b9d8; *param_1 = uVar1; iStack_2c = 0x8750fc; uStack_28 = uVar1; uVar3 = luaL_ref(); iStack_2c = 0xfffffffe; param_1[1] = uVar3; uStack_34 = 0x875108; iStack_30 = uVar1; lua_settop(); return param_1; } //@@ 00875116 FUN_00875116 void FUN_00875116(void) { undefined4 unaff_EBX; undefined1 auStack_28 [40]; FUN_0085c080(unaff_EBX,auStack_28); /* WARNING: Subroutine does not return */ FUN_008727d0(); } //@@ 00875130 FUN_00875130 undefined4 * FUN_00875130(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = EntityPtr::Ref; lua_pushcclosure(*in_ECX,FUN_008a0600,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b701d8); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b701d8); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 00875230 FUN_00875230 undefined4 * FUN_00875230(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bb2e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bb340,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008753a0 FUN_008753a0 undefined4 * FUN_008753a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bb420,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bb480,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875510 FUN_00875510 undefined4 * FUN_00875510(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089f590,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089f500,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875680 FUN_00875680 undefined4 * FUN_00875680(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089e970,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089e8e0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008757f0 FUN_008757f0 undefined4 * FUN_008757f0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089e870,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089e7e0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875960 luabridge::Namespace::Class::addProperty_Color /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Color" in __propget/__propset with getter Sprite::Color setter Sprite::SetColor, closures ['FUN_0089e740', 'FUN_0089e6b0']; sole caller LuaEngine::RegisterAPI line in Sprite beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Color(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Sprite::Color; lua_pushcclosure(*in_ECX,FUN_0089e740,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Sprite::SetColor; lua_pushcclosure(*in_ECX,FUN_0089e6b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875ae0 FUN_00875ae0 undefined4 * FUN_00875ae0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089e5a0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089e530,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875c50 luabridge::Namespace::Class::addData_Type /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Type" in __propget/__propset with member offset 0 (isWritable 1), closures ['FUN_008bb900', 'FUN_008bb960']; sole caller LuaEngine::RegisterAPI line in EntityRef beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Type(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bb900,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b6d1a4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b6d1a4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bb960,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b6d1a4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875dd0 FUN_00875dd0 undefined4 * FUN_00875dd0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bb9c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bb960,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00875f40 luabridge::Namespace::Class::addData_SpawnerType /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "SpawnerType" in __propget/__propset with member offset 8 (isWritable 1), closures ['FUN_008bba20', 'FUN_008bb960']; sole caller LuaEngine::RegisterAPI line in EntityRef beginClass block */ undefined4 * luabridge::Namespace::Class::addData_SpawnerType(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008bba20,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SpawnerType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SpawnerType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008bb960,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SpawnerType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008760c0 luabridge::Namespace::Class::addData_Position /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Position" in __propget/__propset with member offset 0x10 (isWritable 1), closures ['FUN_008bba80', 'FUN_008bbb20']; sole caller LuaEngine::RegisterAPI line in EntityRef beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Position(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x10; lua_pushcclosure(*in_ECX,FUN_008bba80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Position"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Position"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x10; lua_pushcclosure(*in_ECX,FUN_008bbb20,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Position"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00876240 FUN_00876240 undefined4 * FUN_00876240(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089e4c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089e450,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008763b0 luabridge::Namespace::Class::addData_Entity /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Entity" in __propget/__propset with member offset 0x24 (isWritable 1), closures ['FUN_008bbbc0', 'FUN_008bbc60']; sole caller LuaEngine::RegisterAPI line in EntityRef beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Entity(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x24; lua_pushcclosure(*in_ECX,FUN_008bbbc0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Entity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Entity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x24; lua_pushcclosure(*in_ECX,FUN_008bbc60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Entity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00876530 FUN_00876530 undefined4 FUN_00876530(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00876550 FUN_00876550 void FUN_00876550(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_008bbcf0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__call"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return; } //@@ 008765a0 FUN_008765a0 undefined4 * FUN_008765a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(uVar1,FUN_008aa0d0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00876650 FUN_00876650 void FUN_00876650(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = RNG::SetSeed; lua_pushcclosure(uVar1,FUN_008aa130,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008766b0 FUN_008766b0 void FUN_008766b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = RNG::RandomInt; lua_pushcclosure(uVar1,FUN_008aa1b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RandomInt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00876710 FUN_00876710 void FUN_00876710(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = RNG::RandomFloat; lua_pushcclosure(uVar1,FUN_008aa230,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RandomFloat"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00876770 FUN_00876770 void FUN_00876770(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = RNG::Next; lua_pushcclosure(uVar1,FUN_008aa2a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b61210); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008767d0 FUN_008767d0 undefined4 FUN_008767d0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 008767f0 FUN_008767f0 void FUN_008767f0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_008bbd60,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__call"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return; } //@@ 00876840 luabridge::Namespace::Class::addData_GridCollision /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "GridCollision" in __propget/__propset with member offset 0 (isWritable 1), closures ['FUN_008bbdb0', 'FUN_008bbe10']; sole caller LuaEngine::RegisterAPI line in ProjectileParams beginClass block */ undefined4 * luabridge::Namespace::Class::addData_GridCollision(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bbdb0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"GridCollision"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GridCollision"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bbe10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GridCollision"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008769c0 FUN_008769c0 undefined4 * FUN_008769c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bbe80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bbee0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00876b30 luabridge::Namespace::Class::addData_Color /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Color" in __propget/__propset with member offset 0x2c (isWritable 1), closures ['FUN_008bbf50', 'FUN_008bbfb0']; sole caller LuaEngine::RegisterAPI line in ProjectileParams beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Color(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x2c; lua_pushcclosure(*in_ECX,FUN_008bbf50,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x2c; lua_pushcclosure(*in_ECX,FUN_008bbfb0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00876cb0 FUN_00876cb0 undefined4 * FUN_00876cb0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc070,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc0d0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00876e20 FUN_00876e20 undefined4 * FUN_00876e20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc130,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc1d0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00876f90 FUN_00876f90 undefined4 * FUN_00876f90(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc270,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc2d0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00877100 FUN_00877100 undefined4 FUN_00877100(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00877120 FUN_00877120 void FUN_00877120(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_008bc330,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__call"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return; } //@@ 00877170 FUN_00877170 void FUN_00877170(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,&LAB_008aa300,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008771d0 FUN_008771d0 undefined4 * FUN_008771d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = BitSet128::__bnot; lua_pushcclosure(uVar1,FUN_008aa3e0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"__bnot"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"__bnot"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00877280 FUN_00877280 undefined4 * FUN_00877280(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = BitSet128::__eq; lua_pushcclosure(uVar1,&LAB_008aa480,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,&DAT_00b7087c); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b7087c); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00877330 FUN_00877330 undefined4 * FUN_00877330(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = BitSet128::__tostring; lua_pushcclosure(uVar1,FUN_008aa530,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"__tostring"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"__tostring"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008773e0 FUN_008773e0 undefined4 * FUN_008773e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = BitSet128::Get; lua_pushcclosure(uVar1,FUN_008aa5b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,s_Get); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,s_Get); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00877490 FUN_00877490 void FUN_00877490(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = BitSet128::Set; lua_pushcclosure(uVar1,FUN_008aa640,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b70924); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008774f0 FUN_008774f0 undefined4 * FUN_008774f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc3c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc420,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00877660 FUN_00877660 undefined4 FUN_00877660(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00877680 FUN_00877680 void FUN_00877680(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008aa6c0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008776e0 FUN_008776e0 void FUN_008776e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::MoveRandomly; lua_pushcclosure(uVar1,FUN_008aa710,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MoveRandomly"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00877740 FUN_00877740 void FUN_00877740(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008aa790,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008777a0 FUN_008777a0 void FUN_008777a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::MoveRandomlyAxisAligned; lua_pushcclosure(uVar1,FUN_008aa800,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MoveRandomlyAxisAligned"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00877800 FUN_00877800 void FUN_00877800(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::FindGridPath; lua_pushcclosure(uVar1,&LAB_008aa8a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FindGridPath"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00877860 FUN_00877860 undefined4 * FUN_00877860(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = NPCAI_Pathfinder::HasPathToPos; lua_pushcclosure(uVar1,FUN_008aa990,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasPathToPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasPathToPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00877910 FUN_00877910 void FUN_00877910(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::HasDirectPath; lua_pushcclosure(uVar1,FUN_008aaa50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasDirectPath"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00877970 FUN_00877970 void FUN_00877970(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::EvadeTarget; lua_pushcclosure(uVar1,FUN_008aaac0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"EvadeTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008779d0 FUN_008779d0 void FUN_008779d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::GetEvadeMovementCountdown; lua_pushcclosure(uVar1,FUN_008aab60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEvadeMovementCountdown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00877a30 FUN_00877a30 undefined4 * FUN_00877a30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PathFinder::GetGridIndex; lua_pushcclosure(uVar1,FUN_008aabc0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetGridIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetGridIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00877ae0 FUN_00877ae0 undefined4 FUN_00877ae0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00877b00 FUN_00877b00 undefined4 * FUN_00877b00(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc480,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc4e0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00877c70 FUN_00877c70 undefined4 * FUN_00877c70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc540,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc5b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00877de0 luabridge::Namespace::Class::addData_GreedModeAllowed /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "GreedModeAllowed" in __propget/__propset with member offset 0x50 (isWritable 1), closures ['FUN_008bc6c0', 'FUN_008bc720']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Card beginClass block */ undefined4 * luabridge::Namespace::Class::addData_GreedModeAllowed(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x50; lua_pushcclosure(*in_ECX,FUN_008bc6c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"GreedModeAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x50; lua_pushcclosure(*in_ECX,FUN_008bc720,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00877f70 luabridge::Namespace::Class::addData_PickupSubtype /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "PickupSubtype" in __propget/__propset with member offset 0x54 (isWritable 1), closures ['FUN_008bc790', 'FUN_008bc4e0']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Card beginClass block */ undefined4 * luabridge::Namespace::Class::addData_PickupSubtype(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x54; lua_pushcclosure(*in_ECX,FUN_008bc790,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"PickupSubtype"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PickupSubtype"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x54; lua_pushcclosure(*in_ECX,FUN_008bc4e0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PickupSubtype"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008780f0 luabridge::Namespace::Class::addData_CardType /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "CardType" in __propget/__propset with member offset 0x58 (isWritable 1), closures ['FUN_008bc7f0', 'FUN_008bc4e0']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Card beginClass block */ undefined4 * luabridge::Namespace::Class::addData_CardType(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x58; lua_pushcclosure(*in_ECX,FUN_008bc7f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"CardType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CardType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x58; lua_pushcclosure(*in_ECX,FUN_008bc4e0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CardType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00878270 luabridge::Namespace::Class::addData_AnnouncerVoice /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "AnnouncerVoice" in __propget/__propset with member offset 0x5c (isWritable 1), closures ['FUN_008bc7f0', 'FUN_008bc4e0']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Card beginClass block */ undefined4 * luabridge::Namespace::Class::addData_AnnouncerVoice(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x5c; lua_pushcclosure(*in_ECX,FUN_008bc7f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"AnnouncerVoice"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"AnnouncerVoice"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x5c; lua_pushcclosure(*in_ECX,FUN_008bc4e0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"AnnouncerVoice"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008783f0 FUN_008783f0 undefined4 * FUN_008783f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008aac20,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00878490 FUN_00878490 undefined4 FUN_00878490(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 008784b0 FUN_008784b0 undefined4 * FUN_008784b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc850,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc8b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00878620 luabridge::Namespace::Class::addData_Name /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Name" in __propget/__propset with member offset 8 (isWritable 1), closures ['FUN_008bc910', 'FUN_008bc980']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Pill beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Name(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008bc910,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b1b350); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b1b350); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008bc980,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b1b350); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008787a0 luabridge::Namespace::Class::addData_GreedModeAllowed /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "GreedModeAllowed" in __propget/__propset with member offset 0x38 (isWritable 1), closures ['FUN_008bca90', 'FUN_008bcaf0']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Pill beginClass block */ undefined4 * luabridge::Namespace::Class::addData_GreedModeAllowed(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x38; lua_pushcclosure(*in_ECX,FUN_008bca90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"GreedModeAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x38; lua_pushcclosure(*in_ECX,FUN_008bcaf0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00878920 FUN_00878920 undefined4 * FUN_00878920(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bcb60,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bc8b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00878a90 FUN_00878a90 undefined4 * FUN_00878a90(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bcbc0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bcc50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00878c00 FUN_00878c00 undefined4 * FUN_00878c00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = PillEffect::IsAvailable; lua_pushcclosure(uVar1,FUN_008aac90,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsAvailable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsAvailable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00878cb0 FUN_00878cb0 undefined4 FUN_00878cb0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00878cd0 FUN_00878cd0 undefined4 * FUN_00878cd0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008aad00,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00878d70 FUN_00878d70 undefined4 * FUN_00878d70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bccf0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bcd50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00878ee0 FUN_00878ee0 undefined4 * FUN_00878ee0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bcdb0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bce20,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00879050 luabridge::Namespace::Class::addData_CacheFlags /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "CacheFlags" in __propget/__propset with member offset 0x54 (isWritable 1), closures ['FUN_008bcf30', 'FUN_008bcd50']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Item beginClass block */ undefined4 * luabridge::Namespace::Class::addData_CacheFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x54; lua_pushcclosure(*in_ECX,FUN_008bcf30,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"CacheFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CacheFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x54; lua_pushcclosure(*in_ECX,FUN_008bcd50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CacheFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008791d0 FUN_008791d0 undefined4 * FUN_008791d0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bcf90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd000,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00879340 FUN_00879340 undefined4 * FUN_00879340(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd070,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd0d0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008794b0 FUN_008794b0 undefined4 * FUN_008794b0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Item::Costume; lua_pushcclosure(*in_ECX,FUN_0089e3b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Costume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Costume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 008795b0 luabridge::Namespace::Class::addData_ChargeType /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "ChargeType" in __propget/__propset with member offset 0xac (isWritable 1), closures ['FUN_008bd130', 'FUN_008bcd50']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Item beginClass block */ undefined4 * luabridge::Namespace::Class::addData_ChargeType(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xac; lua_pushcclosure(*in_ECX,FUN_008bd130,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ChargeType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ChargeType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xac; lua_pushcclosure(*in_ECX,FUN_008bcd50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ChargeType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00879730 luabridge::Namespace::Class::addData_Tags /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Tags" in __propget/__propset with member offset 0xb8 (isWritable 1), closures ['FUN_008bd190', 'FUN_008bd1f0']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Item beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Tags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xb8; lua_pushcclosure(*in_ECX,FUN_008bd190,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b70c1c); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b70c1c); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xb8; lua_pushcclosure(*in_ECX,FUN_008bd1f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b70c1c); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008798b0 FUN_008798b0 undefined4 * FUN_008798b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Item::HasTags; lua_pushcclosure(uVar1,FUN_008aad70,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasTags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasTags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00879960 FUN_00879960 undefined4 * FUN_00879960(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Item::IsAvailable; lua_pushcclosure(uVar1,FUN_008aae00,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsAvailable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsAvailable"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00879a10 FUN_00879a10 undefined4 FUN_00879a10(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00879a30 FUN_00879a30 undefined4 * FUN_00879a30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd250,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd2b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00879ba0 luabridge::Namespace::Class::addData_Anm2Path /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Anm2Path" in __propget/__propset with member offset 4 (isWritable 1), closures ['FUN_008bd310', 'FUN_008bd380']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Costume beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Anm2Path(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008bd310,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Anm2Path"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Anm2Path"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008bd380,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Anm2Path"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00879d20 FUN_00879d20 undefined4 * FUN_00879d20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd490,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd4f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00879e90 luabridge::Namespace::Class::addData_SkinColor /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "SkinColor" in __propget/__propset with member offset 0x24 (isWritable 1), closures ['FUN_008bd560', 'FUN_008bd5f0']; sole caller LuaEngine::RegisterAPI line in ItemConfig_Costume beginClass block */ undefined4 * luabridge::Namespace::Class::addData_SkinColor(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x24; lua_pushcclosure(*in_ECX,FUN_008bd560,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SkinColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SkinColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x24; lua_pushcclosure(*in_ECX,FUN_008bd5f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SkinColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087a010 lua_register_CardConfigList /* DB: LuaEngine::RegisterAPI calls it with "CardConfigList" (same CppContainer/__len/__propget template, 772 bytes) */ void lua_register_CardConfigList(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("Vector",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = std::vector::size; lua_pushcclosure(local_1c,FUN_008c3630,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = std::vector::size; lua_pushcclosure(uVar3,FUN_008c3630,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8080; lua_pushcclosure(uVar3,FUN_008c4e90,1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,s_Get); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8080; lua_pushcclosure(local_1c,FUN_008c4f50,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0087a320 lua_register_PillConfigList /* DB: LuaEngine::RegisterAPI calls it with "PillConfigList" (same CppContainer/__len/__propget template, 772 bytes) */ void lua_register_PillConfigList(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("Vector",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = std::vector::size; lua_pushcclosure(local_1c,FUN_008c35d0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = std::vector::size; lua_pushcclosure(uVar3,FUN_008c35d0,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8080; lua_pushcclosure(uVar3,FUN_008c5010,1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,s_Get); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8080; lua_pushcclosure(local_1c,FUN_008c50d0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0087a630 lua_register_ItemConfigList /* DB: LuaEngine::RegisterAPI calls it with "ItemConfigList" (same CppContainer/__len/__propget template, 772 bytes) */ void lua_register_ItemConfigList(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("Vector",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class>::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = std::vector::size; lua_pushcclosure(local_1c,FUN_008c3570,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = std::vector::size; lua_pushcclosure(uVar3,FUN_008c3570,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8080; lua_pushcclosure(uVar3,FUN_008c5190,1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,s_Get); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8080; lua_pushcclosure(local_1c,FUN_008c5250,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0087a940 lua_register_CostumeConfigList /* DB: LuaEngine::RegisterAPI calls it with "CostumeConfigList": luabridge "CppContainer" class, __len/__propget (element FUN_008c42f0) */ void lua_register_CostumeConfigList(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("Vector",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = &LAB_0089e390; lua_pushcclosure(local_1c,FUN_008c3510,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = &LAB_0089e390; lua_pushcclosure(uVar3,FUN_008c3510,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_0089e350; lua_pushcclosure(uVar3,FUN_008c5310,1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,s_Get); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_0089e350; lua_pushcclosure(local_1c,FUN_008c53d0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0087ac50 FUN_0087ac50 undefined4 FUN_0087ac50(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087ac70 FUN_0087ac70 void FUN_0087ac70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = ItemConfig::IsValidCollectible; lua_pushcclosure(*in_ECX,FUN_0089e300,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"IsValidCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087acd0 FUN_0087acd0 undefined4 * FUN_0087acd0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008aae80,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087ad70 FUN_0087ad70 void FUN_0087ad70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Config::ShouldAddCostumeOnPickup; lua_pushcclosure(*in_ECX,FUN_0089e290,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ShouldAddCostumeOnPickup"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087add0 FUN_0087add0 undefined4 * FUN_0087add0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemConfig::GetCard; lua_pushcclosure(uVar1,FUN_008aaf40,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCard"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCard"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087ae80 FUN_0087ae80 undefined4 * FUN_0087ae80(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Config::GetPillEffect; lua_pushcclosure(uVar1,FUN_008ab000,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetPillEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPillEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087af30 FUN_0087af30 undefined4 * FUN_0087af30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ab0c0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087afd0 FUN_0087afd0 undefined4 * FUN_0087afd0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Config::GetCards; lua_pushcclosure(uVar1,FUN_008ab160,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCards"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCards"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087b080 FUN_0087b080 undefined4 * FUN_0087b080(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Config::GetPillEffects; lua_pushcclosure(uVar1,FUN_008ab200,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetPillEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPillEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087b130 FUN_0087b130 undefined4 FUN_0087b130(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087b150 FUN_0087b150 undefined4 * FUN_0087b150(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd690,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd6f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087b2c0 luabridge::Namespace::Class::addData_TearColor /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "TearColor" in __propget/__propset with member offset 8 (isWritable 1), closures ['FUN_008bd750', 'FUN_008bd7b0']; sole caller LuaEngine::RegisterAPI line in TearParams beginClass block */ undefined4 * luabridge::Namespace::Class::addData_TearColor(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008bd750,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008bd7b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087b440 luabridge::Namespace::Class::addData_TearFlags /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "TearFlags" in __propget/__propset with member offset 0x38 (isWritable 1), closures ['FUN_008bd870', 'FUN_008bd900']; sole caller LuaEngine::RegisterAPI line in TearParams beginClass block */ undefined4 * luabridge::Namespace::Class::addData_TearFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x38; lua_pushcclosure(*in_ECX,FUN_008bd870,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x38; lua_pushcclosure(*in_ECX,FUN_008bd900,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087b5c0 FUN_0087b5c0 undefined4 * FUN_0087b5c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd990,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bd9f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087b730 FUN_0087b730 undefined4 FUN_0087b730(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087b750 luabridge::Namespace::Class::addData_Item /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Item" in __propget/__propset with member offset 0 (isWritable 1), closures ['FUN_008bda60', 'FUN_008bdb00']; sole caller LuaEngine::RegisterAPI line in QueueItemData beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Item(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bda60,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b67800); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b67800); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bdb00,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b67800); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087b8d0 luabridge::Namespace::Class::addData_Charge /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Charge" in __propget/__propset with member offset 4 (isWritable 1), closures ['FUN_008bdb90', 'FUN_008bdbf0']; sole caller LuaEngine::RegisterAPI line in QueueItemData beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Charge(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008bdb90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Charge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Charge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008bdbf0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Charge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087ba50 luabridge::Namespace::Class::addProperty_Touched /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Touched" in __propget/__propset with getter QueueItemData::Touched setter FUN_0085e1d0, closures ['FUN_0089e220', 'FUN_0089e1b0']; sole caller LuaEngine::RegisterAPI line in QueueItemData beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Touched(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = QueueItemData::Touched; lua_pushcclosure(*in_ECX,FUN_0089e220,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Touched"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Touched"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_0085e1d0; lua_pushcclosure(*in_ECX,FUN_0089e1b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Touched"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087bbd0 lua_register_VectorList /* DB: LuaEngine::RegisterAPI calls it with "VectorList": luabridge "CppContainer" class, __len/__propget, "Vector" element (FUN_008c40e0) */ void lua_register_VectorList(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("Vector",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_0042f160; lua_pushcclosure(local_1c,FUN_008c34b0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_0042f160; lua_pushcclosure(uVar3,FUN_008c34b0,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8050; lua_pushcclosure(uVar3,FUN_008c5490,1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,s_Get); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8050; lua_pushcclosure(local_1c,FUN_008c5550,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0087bee0 FUN_0087bee0 undefined4 FUN_0087bee0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087bf10 luabridge::Namespace::Class::addData_Item /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Item" in __propget/__propset with member offset 0 (isWritable 1), closures ['FUN_008bdc50', 'FUN_008bdcf0']; sole caller LuaEngine::RegisterAPI line in TemporaryEffect beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Item(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bdc50,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b67800); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b67800); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008bdcf0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b67800); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087c090 FUN_0087c090 undefined4 * FUN_0087c090(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bdd80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bdde0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087c200 lua_register_EffectList /* DB: LuaEngine::RegisterAPI calls it with "EffectList": luabridge "CppContainer" class with __len/__propget and an element getter (FUN_008c3ed0); same template as lua_register_VectorList / CardConfigList */ void lua_register_EffectList(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("Vector",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = &LAB_007dca60; lua_pushcclosure(local_1c,FUN_008c3450,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = &LAB_007dca60; lua_pushcclosure(uVar3,FUN_008c3450,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8020; lua_pushcclosure(uVar3,FUN_008c5610,1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,s_Get); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a8020; lua_pushcclosure(local_1c,FUN_008c56d0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0087c510 FUN_0087c510 undefined4 FUN_0087c510(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087c530 FUN_0087c530 void FUN_0087c530(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::AddCollectibleEffect; lua_pushcclosure(uVar1,FUN_008ab2a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddCollectibleEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087c590 FUN_0087c590 void FUN_0087c590(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::AddTrinketEffect; lua_pushcclosure(uVar1,FUN_008ab2a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddTrinketEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087c5f0 FUN_0087c5f0 void FUN_0087c5f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::AddNullEffect; lua_pushcclosure(uVar1,FUN_008ab2a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddNullEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087c650 FUN_0087c650 void FUN_0087c650(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::RemoveCollectibleEffect; lua_pushcclosure(uVar1,FUN_008ab330,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveCollectibleEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087c6b0 FUN_0087c6b0 void FUN_0087c6b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::RemoveTrinketEffect; lua_pushcclosure(uVar1,FUN_008ab330,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveTrinketEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087c710 FUN_0087c710 void FUN_0087c710(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::RemoveNullEffect; lua_pushcclosure(uVar1,FUN_008ab330,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveNullEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087c770 FUN_0087c770 undefined4 * FUN_0087c770(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::HasCollectibleEffect; lua_pushcclosure(uVar1,FUN_008ab3b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasCollectibleEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasCollectibleEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087c820 FUN_0087c820 undefined4 * FUN_0087c820(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::HasTrinketEffect; lua_pushcclosure(uVar1,FUN_008ab3b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasTrinketEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasTrinketEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087c8d0 FUN_0087c8d0 undefined4 * FUN_0087c8d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::HasNullEffect; lua_pushcclosure(uVar1,FUN_008ab3b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasNullEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasNullEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087c980 FUN_0087c980 undefined4 * FUN_0087c980(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetCollectibleEffect; lua_pushcclosure(uVar1,FUN_008ab440,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCollectibleEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCollectibleEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087ca30 FUN_0087ca30 undefined4 * FUN_0087ca30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetTrinketEffect; lua_pushcclosure(uVar1,FUN_008ab440,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetTrinketEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTrinketEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087cae0 FUN_0087cae0 undefined4 * FUN_0087cae0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetNullEffect; lua_pushcclosure(uVar1,FUN_008ab440,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetNullEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetNullEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087cb90 FUN_0087cb90 undefined4 * FUN_0087cb90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetCollectibleEffectNum; lua_pushcclosure(uVar1,FUN_008ab500,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCollectibleEffectNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCollectibleEffectNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087cc40 FUN_0087cc40 undefined4 * FUN_0087cc40(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetTrinketEffectNum; lua_pushcclosure(uVar1,FUN_008ab500,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetTrinketEffectNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTrinketEffectNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087ccf0 FUN_0087ccf0 undefined4 * FUN_0087ccf0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetNullEffectNum; lua_pushcclosure(uVar1,FUN_008ab500,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetNullEffectNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetNullEffectNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087cda0 FUN_0087cda0 void FUN_0087cda0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::ClearEffects; lua_pushcclosure(uVar1,FUN_008ab580,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ClearEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087ce00 FUN_0087ce00 void FUN_0087ce00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetEffectsList; lua_pushcclosure(uVar1,FUN_008ab5f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEffectsList"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087ce60 FUN_0087ce60 undefined4 FUN_0087ce60(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087ce80 FUN_0087ce80 undefined4 * FUN_0087ce80(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = EntityList::Size; lua_pushcclosure(*in_ECX,FUN_0089e150,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,s_Size); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s_Size); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0087cfb0 FUN_0087cfb0 undefined4 * FUN_0087cfb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = EntityList::Size; lua_pushcclosure(uVar1,FUN_0089e150,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"__len"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"__len"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087d060 FUN_0087d060 undefined4 * FUN_0087d060(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = EntityList::Get; lua_pushcclosure(uVar1,FUN_008ab690,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,s_Get); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,s_Get); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087d110 FUN_0087d110 undefined4 FUN_0087d110(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087d130 FUN_0087d130 undefined4 * FUN_0087d130(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bde40,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bdee0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087d2a0 FUN_0087d2a0 undefined4 FUN_0087d2a0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087d2c0 FUN_0087d2c0 undefined4 * FUN_0087d2c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bdf80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bdfe0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087d430 luabridge::Namespace::Class::addData_PartialCharge /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "PartialCharge" in __propget/__propset with member offset 0x18 (isWritable 1), closures ['FUN_008be040', 'FUN_008be0a0']; sole caller LuaEngine::RegisterAPI line in ActiveItemDesc beginClass block */ undefined4 * luabridge::Namespace::Class::addData_PartialCharge(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x18; lua_pushcclosure(*in_ECX,FUN_008be040,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"PartialCharge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PartialCharge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x18; lua_pushcclosure(*in_ECX,FUN_008be0a0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PartialCharge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087d5b0 FUN_0087d5b0 undefined4 FUN_0087d5b0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0087d5d0 luabridge::Namespace::Class::addData_Friction /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Friction" in __propget/__propset with member offset 0x36c (isWritable 1), closures ['FUN_008be110', 'FUN_008be170']; sole caller LuaEngine::RegisterAPI line in Entity beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Friction(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x36c; lua_pushcclosure(*in_ECX,FUN_008be110,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Friction"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Friction"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x36c; lua_pushcclosure(*in_ECX,FUN_008be170,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Friction"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087d750 FUN_0087d750 void FUN_0087d750(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::GetData; lua_pushcclosure(uVar1,FUN_008ab750,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087d7b0 FUN_0087d7b0 undefined4 * FUN_0087d7b0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089e0b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089e020,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087d920 luabridge::Namespace::Class::addProperty_Color /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Color" in __propget/__propset with getter Entity::Color setter FUN_00871f70, closures ['FUN_0089df90', 'FUN_0089def0']; sole caller LuaEngine::RegisterAPI line in Entity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Color(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::Color; lua_pushcclosure(*in_ECX,FUN_0089df90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00871f70; lua_pushcclosure(*in_ECX,FUN_0089def0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Color"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087daa0 FUN_0087daa0 void FUN_0087daa0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ab830,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087db00 FUN_0087db00 void FUN_0087db00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::Render; lua_pushcclosure(uVar1,FUN_0089e020,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Render"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087db60 FUN_0087db60 void FUN_0087db60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::RenderShadowLayer; lua_pushcclosure(uVar1,FUN_008ab880,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RenderShadowLayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087dbc0 FUN_0087dbc0 void FUN_0087dbc0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::TakeDamage; lua_pushcclosure(uVar1,FUN_008ab920,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TakeDamage"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087dc20 FUN_0087dc20 void FUN_0087dc20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008abac0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087dc80 FUN_0087dc80 void FUN_0087dc80(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::KillWithSource; lua_pushcclosure(uVar1,&LAB_008abb30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"KillWithSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087dce0 FUN_0087dce0 undefined4 * FUN_0087dce0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089de90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0087ddd0 FUN_0087ddd0 undefined4 * FUN_0087ddd0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089de30,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089dab0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087df50 FUN_0087df50 undefined4 * FUN_0087df50(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089de90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089dab0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087e0c0 FUN_0087e0c0 void FUN_0087e0c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::AddVelocity_divided; lua_pushcclosure(uVar1,FUN_008abbe0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddVelocity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087e120 FUN_0087e120 void FUN_0087e120(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089d9b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087e180 FUN_0087e180 void FUN_0087e180(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::Destroy; lua_pushcclosure(uVar1,FUN_008abc80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087e1e0 FUN_0087e1e0 undefined4 * FUN_0087e1e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::GetColor; lua_pushcclosure(uVar1,FUN_0089dd90,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087e290 luabridge::Namespace::Class::addProperty_SplatColor /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "SplatColor" in __propget/__propset with getter Entity::SplatColor setter Color::assign, closures ['FUN_0089dd90', 'FUN_0089dd00']; sole caller LuaEngine::RegisterAPI line in Entity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_SplatColor(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::SplatColor; lua_pushcclosure(*in_ECX,FUN_0089dd90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SplatColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SplatColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Color::assign; lua_pushcclosure(*in_ECX,FUN_0089dd00,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SplatColor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087e410 FUN_0087e410 undefined4 * FUN_0087e410(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089dc90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089dc20,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087e580 FUN_0087e580 undefined4 * FUN_0087e580(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089db80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089e020,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087e6f0 luabridge::Namespace::Class::addProperty_SortingLayer /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "SortingLayer" in __propget/__propset with getter Entity::SortingLayer setter FUN_00565dd0, closures ['FUN_0089db20', 'FUN_0089dab0']; sole caller LuaEngine::RegisterAPI line in Entity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_SortingLayer(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::SortingLayer; lua_pushcclosure(*in_ECX,FUN_0089db20,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SortingLayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SortingLayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00565dd0; lua_pushcclosure(*in_ECX,FUN_0089dab0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SortingLayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087e870 FUN_0087e870 void FUN_0087e870(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008abda0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087e8d0 FUN_0087e8d0 undefined4 * FUN_0087e8d0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089da40,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089d9b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087ea40 luabridge::Namespace::Class::addProperty_Size /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Size" in __propget/__propset with getter Entity::Size setter FUN_00871fa0, closures ['FUN_0089d930', 'FUN_0089d8b0']; sole caller LuaEngine::RegisterAPI line in Entity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Size(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::Size; lua_pushcclosure(*in_ECX,FUN_0089d930,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,s_Size); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s_Size); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00871fa0; lua_pushcclosure(*in_ECX,FUN_0089d8b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s_Size); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087ebc0 FUN_0087ebc0 void FUN_0087ebc0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::SetSize; lua_pushcclosure(uVar1,FUN_008abe80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetSize"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087ec20 FUN_0087ec20 undefined4 * FUN_0087ec20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089de30,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0087ed10 luabridge::Namespace::Class::addProperty_TargetPosition /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "TargetPosition" in __propget/__propset with getter Entity::TargetPosition setter Entity::SetTargetPosition, closures ['FUN_0089db80', 'FUN_0089d800']; sole caller LuaEngine::RegisterAPI line in Entity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_TargetPosition(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::TargetPosition; lua_pushcclosure(*in_ECX,FUN_0089db80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TargetPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TargetPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::SetTargetPosition; lua_pushcclosure(*in_ECX,FUN_0089d800,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TargetPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087ee90 FUN_0087ee90 undefined4 * FUN_0087ee90(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089dc90,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087ef30 FUN_0087ef30 undefined4 * FUN_0087ef30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::IsActiveEnemy; lua_pushcclosure(uVar1,FUN_008abf60,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsActiveEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsActiveEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087efe0 FUN_0087efe0 void FUN_0087efe0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008abfe0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f040 FUN_0087f040 undefined4 * FUN_0087f040(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::GetEntityFlags; lua_pushcclosure(uVar1,FUN_008ac050,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetEntityFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEntityFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087f0f0 FUN_0087f0f0 undefined4 * FUN_0087f0f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::HasEntityFlags; lua_pushcclosure(uVar1,FUN_008ac0b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasEntityFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasEntityFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087f1a0 FUN_0087f1a0 void FUN_0087f1a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,&LAB_008ac140,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f200 FUN_0087f200 void FUN_0087f200(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ac240,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f260 FUN_0087f260 void FUN_0087f260(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::AddSlowing; lua_pushcclosure(uVar1,FUN_008ac310,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddSlowing"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f2c0 FUN_0087f2c0 void FUN_0087f2c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ac4d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f320 FUN_0087f320 undefined4 * FUN_0087f320(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::GetBossID; lua_pushcclosure(uVar1,FUN_0089de90,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetBossID"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetBossID"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087f3d0 FUN_0087f3d0 undefined4 * FUN_0087f3d0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089d760,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089d6b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087f540 FUN_0087f540 void FUN_0087f540(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ac5d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f5a0 FUN_0087f5a0 void FUN_0087f5a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::HasCommonParentWithEntity; lua_pushcclosure(uVar1,FUN_008ac670,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasCommonParentWithEntity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f600 FUN_0087f600 undefined4 * FUN_0087f600(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::IsFrame; lua_pushcclosure(uVar1,FUN_008ac720,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0087f6b0 FUN_0087f6b0 void FUN_0087f6b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::GetDropRNG; lua_pushcclosure(uVar1,FUN_008ac7b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetDropRNG"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f710 FUN_0087f710 void FUN_0087f710(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::GetSprite; lua_pushcclosure(uVar1,FUN_008ac850,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSprite"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0087f770 FUN_0087f770 undefined4 * FUN_0087f770(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089d610,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089d570,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087f810 FUN_0087f810 undefined4 * FUN_0087f810(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089d4d0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089d430,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087f8b0 FUN_0087f8b0 undefined4 * FUN_0087f8b0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089d390,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToNPC"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089d2f0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToNPC"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087f950 FUN_0087f950 undefined4 * FUN_0087f950(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089d250,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToPickup"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089d1b0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToPickup"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087f9f0 FUN_0087f9f0 undefined4 * FUN_0087f9f0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089d110,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToFamiliar"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089d070,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToFamiliar"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087fa90 FUN_0087fa90 undefined4 * FUN_0087fa90(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089cfd0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToBomb"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089cf30,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToBomb"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087fb30 FUN_0087fb30 undefined4 * FUN_0087fb30(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089ce90,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToKnife"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089cdf0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToKnife"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087fbd0 FUN_0087fbd0 undefined4 * FUN_0087fbd0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089cd50,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089ccb0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087fc70 FUN_0087fc70 undefined4 * FUN_0087fc70(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089cc10,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToTear"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089cb70,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToTear"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087fd10 FUN_0087fd10 undefined4 * FUN_0087fd10(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089cad0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToProjectile"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089ca30,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToProjectile"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0087fdb0 FUN_0087fdb0 undefined4 FUN_0087fdb0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 0087fdd0 FUN_0087fdd0 undefined4 * FUN_0087fdd0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089c9c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089c930,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0087ff40 luabridge::Namespace::Class::addProperty_TearFlags /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "TearFlags" in __propget/__propset with getter Entity_Tear::TearFlags setter Entity_Tear::SetTearFlags, closures ['FUN_0089c890', 'FUN_0089c7f0']; sole caller LuaEngine::RegisterAPI line in Entity_Tear beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_TearFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Tear::TearFlags; lua_pushcclosure(*in_ECX,FUN_0089c890,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Tear::SetTearFlags; lua_pushcclosure(*in_ECX,FUN_0089c7f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008800c0 FUN_008800c0 undefined4 * FUN_008800c0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Tear::TearIndex; lua_pushcclosure(*in_ECX,FUN_0089c790,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 008801c0 FUN_008801c0 void FUN_008801c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089c930,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880220 FUN_00880220 void FUN_00880220(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ac8f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880280 FUN_00880280 void FUN_00880280(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Tear::SetParentOffset; lua_pushcclosure(uVar1,FUN_008ac960,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetParentOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008802e0 FUN_008802e0 void FUN_008802e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Tear::ResetSpriteScale; lua_pushcclosure(uVar1,FUN_008ac9f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ResetSpriteScale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880340 FUN_00880340 undefined4 * FUN_00880340(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be1e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be240,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008804b0 FUN_008804b0 undefined4 * FUN_008804b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089c9c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 008805a0 FUN_008805a0 undefined4 * FUN_008805a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be2b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be310,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00880710 FUN_00880710 undefined4 * FUN_00880710(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be370,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be410,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00880880 luabridge::Namespace::Class::addData_StickTarget /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "StickTarget" in __propget/__propset with member offset 0x478 (isWritable 1), closures ['FUN_008be4b0', 'FUN_008be550']; sole caller LuaEngine::RegisterAPI line in Entity_Tear beginClass block */ undefined4 * luabridge::Namespace::Class::addData_StickTarget(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x478; lua_pushcclosure(*in_ECX,FUN_008be4b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"StickTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"StickTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x478; lua_pushcclosure(*in_ECX,FUN_008be550,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"StickTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00880a00 luabridge::Namespace::Class::addData_CanTriggerStreakEnd /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "CanTriggerStreakEnd" in __propget/__propset with member offset 0x7e8 (isWritable 1), closures ['FUN_008be5e0', 'FUN_008be640']; sole caller LuaEngine::RegisterAPI line in Entity_Tear beginClass block */ undefined4 * luabridge::Namespace::Class::addData_CanTriggerStreakEnd(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x7e8; lua_pushcclosure(*in_ECX,FUN_008be5e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"CanTriggerStreakEnd"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CanTriggerStreakEnd"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x7e8; lua_pushcclosure(*in_ECX,FUN_008be640,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CanTriggerStreakEnd"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00880b80 FUN_00880b80 undefined4 * FUN_00880b80(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Tear::PosDisplacement; lua_pushcclosure(*in_ECX,FUN_0089c6f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"PosDisplacement"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PosDisplacement"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 00880c80 FUN_00880c80 undefined4 FUN_00880c80(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00880ca0 FUN_00880ca0 void FUN_00880ca0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089bf70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880d00 FUN_00880d00 undefined4 * FUN_00880d00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetName; lua_pushcclosure(uVar1,FUN_008aca40,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetName"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetName"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00880db0 FUN_00880db0 void FUN_00880db0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008acac0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880e10 FUN_00880e10 void FUN_00880e10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008acb40,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880e70 FUN_00880e70 void FUN_00880e70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddHearts; lua_pushcclosure(uVar1,FUN_008acbb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddHearts"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880ed0 FUN_00880ed0 void FUN_00880ed0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089c3f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880f30 FUN_00880f30 void FUN_00880f30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008acc70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880f90 FUN_00880f90 void FUN_00880f90(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008acd00,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00880ff0 FUN_00880ff0 undefined4 * FUN_00880ff0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089c460,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881090 FUN_00881090 void FUN_00881090(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008acd60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008810f0 FUN_008810f0 void FUN_008810f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008acdb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881150 FUN_00881150 void FUN_00881150(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::ThrowBlueSpider; lua_pushcclosure(uVar1,&LAB_008ace80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ThrowBlueSpider"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008811b0 FUN_008811b0 void FUN_008811b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddBlueFlies; lua_pushcclosure(uVar1,&LAB_008acfb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddBlueFlies"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881210 FUN_00881210 void FUN_00881210(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddCostume; lua_pushcclosure(uVar1,FUN_008ad0c0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddCostume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881270 FUN_00881270 void FUN_00881270(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::RemoveCostume; lua_pushcclosure(uVar1,FUN_008ad170,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveCostume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008812d0 FUN_008812d0 void FUN_008812d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::QueueItem; lua_pushcclosure(uVar1,FUN_008ad220,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"QueueItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881330 FUN_00881330 void FUN_00881330(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddCollectible; lua_pushcclosure(uVar1,&LAB_008ad2e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881390 FUN_00881390 undefined4 * FUN_00881390(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089bf10,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881430 FUN_00881430 void FUN_00881430(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::DropTrinket; lua_pushcclosure(uVar1,FUN_008ad400,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"DropTrinket"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881490 FUN_00881490 void FUN_00881490(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::DropPocketItem; lua_pushcclosure(uVar1,&LAB_008ad4f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"DropPocketItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008814f0 FUN_008814f0 void FUN_008814f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::RemoveCollectible; lua_pushcclosure(uVar1,FUN_008ad5b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881550 FUN_00881550 undefined4 * FUN_00881550(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ad660,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008815f0 FUN_008815f0 void FUN_008815f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ad6e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881650 FUN_00881650 undefined4 * FUN_00881650(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ad760,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008816f0 FUN_008816f0 void FUN_008816f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FullCharge; lua_pushcclosure(uVar1,FUN_008ad7f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FullCharge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881750 FUN_00881750 undefined4 * FUN_00881750(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetPocketItem; lua_pushcclosure(uVar1,FUN_008ad8c0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetPocketItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPocketItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881800 FUN_00881800 undefined4 * FUN_00881800(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ad980,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008818a0 FUN_008818a0 undefined4 * FUN_008818a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetCollectibleNum; lua_pushcclosure(uVar1,FUN_008ada20,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCollectibleNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCollectibleNum"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881950 luabridge::Namespace::Class::addProperty_TearsOffset /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "TearsOffset" in __propget/__propset with getter Entity_Player::TearsOffset setter FUN_007792f0, closures ['FUN_0089c650', 'FUN_0089c5a0']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_TearsOffset(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::TearsOffset; lua_pushcclosure(*in_ECX,FUN_0089c650,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearsOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearsOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_007792f0; lua_pushcclosure(*in_ECX,FUN_0089c5a0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearsOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00881ad0 FUN_00881ad0 void FUN_00881ad0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008adab0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881b30 FUN_00881b30 undefined4 * FUN_00881b30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089c650,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881bd0 FUN_00881bd0 void FUN_00881bd0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008adb50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881c30 FUN_00881c30 undefined4 * FUN_00881c30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089c530,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881cd0 FUN_00881cd0 undefined4 * FUN_00881cd0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089bea0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881d70 FUN_00881d70 undefined4 * FUN_00881d70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetBombFlags; lua_pushcclosure(uVar1,FUN_008adbf0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetBombFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetBombFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881e20 FUN_00881e20 undefined4 * FUN_00881e20(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetBombVariant; lua_pushcclosure(uVar1,&LAB_008adca0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetBombVariant"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetBombVariant"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00881ed0 FUN_00881ed0 void FUN_00881ed0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetTearHitParams; lua_pushcclosure(uVar1,FUN_008add60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTearHitParams"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881f30 FUN_00881f30 void FUN_00881f30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::UseActiveItem; lua_pushcclosure(uVar1,FUN_008adf50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"UseActiveItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00881fb0 FUN_00881fb0 undefined4 * FUN_00881fb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetTrinketMultiplier; lua_pushcclosure(uVar1,FUN_008ad660,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetTrinketMultiplier"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTrinketMultiplier"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00882060 FUN_00882060 void FUN_00882060(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetEffects; lua_pushcclosure(uVar1,FUN_008ae040,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008820c0 FUN_008820c0 undefined4 * FUN_008820c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetTractorBeam; lua_pushcclosure(uVar1,FUN_008ae0e0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetTractorBeam"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTractorBeam"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00882170 FUN_00882170 void FUN_00882170(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::TryRemoveCollectibleCostume; lua_pushcclosure(uVar1,FUN_008acac0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryRemoveCollectibleCostume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008821d0 FUN_008821d0 void FUN_008821d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::TryRemoveTrinketCostume; lua_pushcclosure(uVar1,FUN_0089c3f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryRemoveTrinketCostume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882230 FUN_00882230 void FUN_00882230(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::TryRemoveNullCostume; lua_pushcclosure(uVar1,FUN_0089c3f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryRemoveNullCostume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882290 FUN_00882290 void FUN_00882290(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AnimateCollectible; lua_pushcclosure(uVar1,FUN_008ae180,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AnimateCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008822f0 FUN_008822f0 void FUN_008822f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AnimateTrinket; lua_pushcclosure(uVar1,FUN_008ae180,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AnimateTrinket"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882350 FUN_00882350 void FUN_00882350(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AnimateCard; lua_pushcclosure(uVar1,FUN_008ae240,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AnimateCard"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008823b0 FUN_008823b0 void FUN_008823b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AnimatePill; lua_pushcclosure(uVar1,FUN_008ae240,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AnimatePill"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882410 FUN_00882410 void FUN_00882410(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AnimatePickup; lua_pushcclosure(uVar1,luabridge::CFunc::CallMember::f,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AnimatePickup"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882470 FUN_00882470 void FUN_00882470(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089c4c0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008824d0 luabridge::Namespace::Class::addProperty_ControlsEnabled /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "ControlsEnabled" in __propget/__propset with getter Entity_Player::ControlsEnabled setter FUN_005b17a0, closures ['FUN_0089c530', 'FUN_0089c4c0']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_ControlsEnabled(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::ControlsEnabled; lua_pushcclosure(*in_ECX,FUN_0089c530,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ControlsEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ControlsEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_005b17a0; lua_pushcclosure(*in_ECX,FUN_0089c4c0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ControlsEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00882650 luabridge::Namespace::Class::addProperty_ControlsCooldown /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "ControlsCooldown" in __propget/__propset with getter Entity_Player::ControlsCooldown setter FUN_005b17b0, closures ['FUN_0089c460', 'FUN_0089c3f0']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_ControlsCooldown(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::ControlsCooldown; lua_pushcclosure(*in_ECX,FUN_0089c460,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ControlsCooldown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ControlsCooldown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_005b17b0; lua_pushcclosure(*in_ECX,FUN_0089c3f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ControlsCooldown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008827d0 FUN_008827d0 void FUN_008827d0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008ae4d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882830 FUN_00882830 void FUN_00882830(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::UsePill; lua_pushcclosure(uVar1,FUN_008ae570,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"UsePill"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882890 FUN_00882890 void FUN_00882890(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::HasInvincibility; lua_pushcclosure(uVar1,FUN_008ae600,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasInvincibility"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008828f0 FUN_008828f0 void FUN_008828f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireDelayedBrimstone; lua_pushcclosure(uVar1,FUN_008ae6c0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireDelayedBrimstone"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882950 FUN_00882950 undefined4 * FUN_00882950(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetLastDamageSource; lua_pushcclosure(uVar1,FUN_008ae7b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLastDamageSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLastDamageSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00882a00 FUN_00882a00 undefined4 * FUN_00882a00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetLastDamageFlags; lua_pushcclosure(uVar1,FUN_008ae850,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLastDamageFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLastDamageFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00882ab0 FUN_00882ab0 void FUN_00882ab0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireTear; lua_pushcclosure(uVar1,FUN_008ae8b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireTear"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882b10 FUN_00882b10 void FUN_00882b10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireBomb; lua_pushcclosure(uVar1,&LAB_008aeaa0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireBomb"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882b70 FUN_00882b70 void FUN_00882b70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireBrimstone; lua_pushcclosure(uVar1,&LAB_008aebc0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireBrimstone"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882bd0 FUN_00882bd0 void FUN_00882bd0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireTechLaser; lua_pushcclosure(uVar1,luabridge::CFunc::CallMember::f,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireTechLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882c30 FUN_00882c30 void FUN_00882c30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireTechXLaser; lua_pushcclosure(uVar1,FUN_008aef50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireTechXLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882c90 FUN_00882c90 void FUN_00882c90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::FireKnife; lua_pushcclosure(uVar1,&LAB_008af110,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireKnife"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882cf0 FUN_00882cf0 void FUN_00882cf0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008af270,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882d50 luabridge::Namespace::Class::addProperty_FriendBallEnemy /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "FriendBallEnemy" in __propget/__propset with getter Entity_Player::FriendBallEnemy setter FUN_005cd7a0, closures ['FUN_0089c350']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_FriendBallEnemy(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::FriendBallEnemy; lua_pushcclosure(*in_ECX,FUN_0089c350,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"FriendBallEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FriendBallEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_005cd7a0; lua_pushcclosure(*in_ECX,&LAB_0089c2b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FriendBallEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00882ed0 FUN_00882ed0 void FUN_00882ed0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::IsPosInSpotLight; lua_pushcclosure(uVar1,FUN_008af330,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsPosInSpotLight"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882f30 FUN_00882f30 void FUN_00882f30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetMultiShotParams; lua_pushcclosure(uVar1,FUN_008af3d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetMultiShotParams"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882f90 FUN_00882f90 void FUN_00882f90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity_Player::GetMultiShotPositionVelocity; lua_pushcclosure(*in_ECX,luabridge::CFunc::CallMember ::f,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetMultiShotPositionVelocity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00882ff0 FUN_00882ff0 undefined4 * FUN_00882ff0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetFlyingOffset; lua_pushcclosure(uVar1,FUN_0089c000,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetFlyingOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetFlyingOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008830a0 luabridge::Namespace::Class::addProperty_SpriteScale /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "SpriteScale" in __propget/__propset with getter Entity_Player::SpriteScale setter FUN_0085e2a0, closures ['FUN_0089c000', 'FUN_0089bf70']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_SpriteScale(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::SpriteScale; lua_pushcclosure(*in_ECX,FUN_0089c000,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SpriteScale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SpriteScale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_0085e2a0; lua_pushcclosure(*in_ECX,FUN_0089bf70,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SpriteScale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00883220 FUN_00883220 undefined4 * FUN_00883220(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::ControllerIndex; lua_pushcclosure(*in_ECX,FUN_0089bf10,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ControllerIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ControllerIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 00883320 FUN_00883320 void FUN_00883320(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::CheckFamiliar; lua_pushcclosure(uVar1,FUN_008af4a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CheckFamiliar"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00883380 FUN_00883380 undefined4 * FUN_00883380(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetLaserOffset; lua_pushcclosure(uVar1,&LAB_008af560,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLaserOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLaserOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00883430 FUN_00883430 undefined4 * FUN_00883430(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetTearMovementInheritance; lua_pushcclosure(uVar1,FUN_008af670,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetTearMovementInheritance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTearMovementInheritance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008834e0 FUN_008834e0 undefined4 * FUN_008834e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetCostumeNullPos; lua_pushcclosure(uVar1,&LAB_008af760,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCostumeNullPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCostumeNullPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00883590 FUN_00883590 void FUN_00883590(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::ReplaceCostumeSprite; lua_pushcclosure(uVar1,FUN_008af990,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ReplaceCostumeSprite"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008835f0 FUN_008835f0 void FUN_008835f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::SpawnMawOfVoid; lua_pushcclosure(uVar1,FUN_008afb60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SpawnMawOfVoid"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00883650 FUN_00883650 void FUN_00883650(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::ShootRedCandle; lua_pushcclosure(uVar1,FUN_008afc20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ShootRedCandle"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008836b0 FUN_008836b0 undefined4 * FUN_008836b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetHeartLimit; lua_pushcclosure(uVar1,FUN_008afcf0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetHeartLimit"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetHeartLimit"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00883760 FUN_00883760 void FUN_00883760(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008afd70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008837c0 luabridge::Namespace::Class::addProperty_FireDelay /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "FireDelay" in __propget/__propset with getter Entity_Player::FireDelay setter FUN_00782ab0, closures ['FUN_0089bea0', 'FUN_0089be10']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_FireDelay(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Player::FireDelay; lua_pushcclosure(*in_ECX,FUN_0089bea0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"FireDelay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FireDelay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00782ab0; lua_pushcclosure(*in_ECX,FUN_0089be10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FireDelay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00883940 FUN_00883940 undefined4 * FUN_00883940(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be6b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be710,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00883ab0 luabridge::Namespace::Class::addData_TearFlags /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "TearFlags" in __propget/__propset with member offset 0x1488 (isWritable 1), closures ['FUN_008be780', 'FUN_008be810']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addData_TearFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x1488; lua_pushcclosure(*in_ECX,FUN_008be780,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x1488; lua_pushcclosure(*in_ECX,FUN_008be810,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00883c30 FUN_00883c30 undefined4 * FUN_00883c30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be8a0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008be900,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00883da0 luabridge::Namespace::Class::addData_CanFly /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "CanFly" in __propget/__propset with member offset 0x1570 (isWritable 1), closures ['FUN_008be9c0', 'FUN_008bea20']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addData_CanFly(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x1570; lua_pushcclosure(*in_ECX,FUN_008be9c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"CanFly"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CanFly"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x1570; lua_pushcclosure(*in_ECX,FUN_008bea20,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CanFly"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00883f40 luabridge::Namespace::Class::addData_BabySkin /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "BabySkin" in __propget/__propset with member offset 0x1aec (isWritable 1), closures ['FUN_008bea90', 'FUN_008beb20']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addData_BabySkin(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x1aec; lua_pushcclosure(*in_ECX,FUN_008bea90,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"BabySkin"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"BabySkin"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x1aec; lua_pushcclosure(*in_ECX,FUN_008beb20,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"BabySkin"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008840c0 luabridge::Namespace::Class::addData_QueuedItem /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "QueuedItem" in __propget/__propset with member offset 0x17c4 (isWritable 1), closures ['FUN_008bebc0', 'FUN_008bec60']; sole caller LuaEngine::RegisterAPI line in Entity_Player beginClass block */ undefined4 * luabridge::Namespace::Class::addData_QueuedItem(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x17c4; lua_pushcclosure(*in_ECX,FUN_008bebc0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"QueuedItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"QueuedItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x17c4; lua_pushcclosure(*in_ECX,FUN_008bec60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"QueuedItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00884240 FUN_00884240 undefined4 * FUN_00884240(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008becf0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bed50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008843b0 FUN_008843b0 void FUN_008843b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::ChangePlayerType; lua_pushcclosure(uVar1,FUN_008acac0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ChangePlayerType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884410 FUN_00884410 void FUN_00884410(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::TryHoldEntity; lua_pushcclosure(uVar1,FUN_008afe10,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryHoldEntity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884470 FUN_00884470 void FUN_00884470(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddMinisaac; lua_pushcclosure(uVar1,FUN_008afec0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddMinisaac"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008844d0 FUN_008844d0 void FUN_008844d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddFriendlyDip; lua_pushcclosure(uVar1,&LAB_008affb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddFriendlyDip"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884530 FUN_00884530 void FUN_00884530(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::ThrowFriendlyDip; lua_pushcclosure(uVar1,&LAB_008b00d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ThrowFriendlyDip"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884590 FUN_00884590 void FUN_00884590(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddWisp; lua_pushcclosure(uVar1,&LAB_008b0220,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddWisp"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008845f0 FUN_008845f0 void FUN_008845f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddItemWisp; lua_pushcclosure(uVar1,&LAB_008b0380,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddItemWisp"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884650 FUN_00884650 void FUN_00884650(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::AddSwarmFlyOrbital; lua_pushcclosure(uVar1,FUN_008b04b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddSwarmFlyOrbital"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008846b0 FUN_008846b0 void FUN_008846b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::TriggerBookOfVirtues; lua_pushcclosure(uVar1,FUN_008ad6e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TriggerBookOfVirtues"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884710 FUN_00884710 void FUN_00884710(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::SetPocketActiveItem; lua_pushcclosure(uVar1,FUN_008b0580,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetPocketActiveItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884770 FUN_00884770 undefined4 * FUN_00884770(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetModelingClayEffect; lua_pushcclosure(uVar1,FUN_0089c460,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetModelingClayEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetModelingClayEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00884820 FUN_00884820 void FUN_00884820(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::UsePoopSpell; lua_pushcclosure(uVar1,FUN_0089c3f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"UsePoopSpell"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884880 FUN_00884880 undefined4 * FUN_00884880(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Player::GetPoopSpell; lua_pushcclosure(uVar1,FUN_008ad660,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetPoopSpell"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPoopSpell"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00884930 FUN_00884930 undefined4 FUN_00884930(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00884950 FUN_00884950 void FUN_00884950(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Pickup::Morph; lua_pushcclosure(uVar1,FUN_008b0610,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Morph"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008849b0 FUN_008849b0 undefined4 * FUN_008849b0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089bdb0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089bd40,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00884b20 FUN_00884b20 undefined4 * FUN_00884b20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089bcd0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00884bc0 FUN_00884bc0 undefined4 * FUN_00884bc0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Pickup::GetCoinValue; lua_pushcclosure(uVar1,FUN_0089bdb0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCoinValue"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCoinValue"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00884c70 FUN_00884c70 undefined4 * FUN_00884c70(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089bcd0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089bc60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00884de0 FUN_00884de0 void FUN_00884de0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b06e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884e40 FUN_00884e40 void FUN_00884e40(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Pickup::TryOpenChest; lua_pushcclosure(uVar1,FUN_008b0730,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryOpenChest"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00884ea0 luabridge::Namespace::Class::addData_State /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "State" in __propget/__propset with member offset 0x584 (isWritable 1), closures ['FUN_008bedb0', 'FUN_008bee10']; sole caller LuaEngine::RegisterAPI line in Entity_Pickup beginClass block */ undefined4 * luabridge::Namespace::Class::addData_State(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x584; lua_pushcclosure(*in_ECX,FUN_008bedb0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x584; lua_pushcclosure(*in_ECX,FUN_008bee10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885020 FUN_00885020 undefined4 FUN_00885020(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00885040 FUN_00885040 void FUN_00885040(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b07e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008850a0 FUN_008850a0 undefined4 * FUN_008850a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089bbf0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089bb60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885210 FUN_00885210 void FUN_00885210(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Effect::FollowParent; lua_pushcclosure(uVar1,FUN_008b0850,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FollowParent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885270 FUN_00885270 void FUN_00885270(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Effect::SetRadii; lua_pushcclosure(uVar1,FUN_008b0900,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetRadii"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008852d0 FUN_008852d0 void FUN_008852d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity_Effect::IsPlayerCreep; lua_pushcclosure(*in_ECX,FUN_0089e300,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"IsPlayerCreep"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885330 FUN_00885330 undefined4 * FUN_00885330(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bee70,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008beed0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008854a0 FUN_008854a0 undefined4 * FUN_008854a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bef40,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008befa0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885610 luabridge::Namespace::Class::addData_IsFollowing /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "IsFollowing" in __propget/__propset with member offset 0x464 (isWritable 1), closures ['FUN_008bf000', 'FUN_008bf060']; sole caller LuaEngine::RegisterAPI line in Entity_Effect beginClass block */ undefined4 * luabridge::Namespace::Class::addData_IsFollowing(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x464; lua_pushcclosure(*in_ECX,FUN_008bf000,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"IsFollowing"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"IsFollowing"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x464; lua_pushcclosure(*in_ECX,FUN_008bf060,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"IsFollowing"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885790 luabridge::Namespace::Class::addData_ParentOffset /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "ParentOffset" in __propget/__propset with member offset 0x468 (isWritable 1), closures ['FUN_008bf0d0', 'FUN_008bf170']; sole caller LuaEngine::RegisterAPI line in Entity_Effect beginClass block */ undefined4 * luabridge::Namespace::Class::addData_ParentOffset(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x468; lua_pushcclosure(*in_ECX,FUN_008bf0d0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ParentOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ParentOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x468; lua_pushcclosure(*in_ECX,FUN_008bf170,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ParentOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885910 FUN_00885910 undefined4 FUN_00885910(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00885930 FUN_00885930 void FUN_00885930(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089b940,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885990 luabridge::Namespace::Class::addProperty_Player /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Player" in __propget/__propset with getter Entity_Familiar::Player setter Entity_Familiar::set_player, closures ['FUN_0089bac0', 'FUN_0089ba10']; sole caller LuaEngine::RegisterAPI line in Entity_Familiar beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Player(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Familiar::Player; lua_pushcclosure(*in_ECX,FUN_0089bac0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Player"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Player"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Familiar::set_player; lua_pushcclosure(*in_ECX,FUN_0089ba10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Player"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885b10 FUN_00885b10 undefined4 * FUN_00885b10(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089b9b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089b940,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00885c80 FUN_00885c80 void FUN_00885c80(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Familiar::PickEnemyTarget; lua_pushcclosure(uVar1,&LAB_008b0990,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"PickEnemyTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885ce0 FUN_00885ce0 void FUN_00885ce0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b0ad0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885d40 FUN_00885d40 void FUN_00885d40(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Familiar::FollowPosition; lua_pushcclosure(uVar1,FUN_008b0b20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FollowPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885da0 FUN_00885da0 void FUN_00885da0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Familiar::GetOrbitPosition; lua_pushcclosure(uVar1,FUN_008b0bb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetOrbitPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885e00 FUN_00885e00 void FUN_00885e00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Familiar::FireProjectile; lua_pushcclosure(uVar1,FUN_008b0c80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireProjectile"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885e60 FUN_00885e60 void FUN_00885e60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Familiar::MoveDiagonally; lua_pushcclosure(uVar1,FUN_008b0d70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MoveDiagonally"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885ec0 FUN_00885ec0 void FUN_00885ec0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Familiar::RecalculateOrbitOffset; lua_pushcclosure(uVar1,FUN_008b0e00,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RecalculateOrbitOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885f20 FUN_00885f20 void FUN_00885f20(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity_Familiar::GetOrbitDistance; lua_pushcclosure(*in_ECX,FUN_0089b8c0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetOrbitDistance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00885f80 FUN_00885f80 undefined4 * FUN_00885f80(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf210,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf270,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008860f0 FUN_008860f0 undefined4 * FUN_008860f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf2d0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf330,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00886260 luabridge::Namespace::Class::addData_OrbitDistance /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "OrbitDistance" in __propget/__propset with member offset 0xd64 (isWritable 1), closures ['FUN_008bf3a0', 'FUN_008bf440']; sole caller LuaEngine::RegisterAPI line in Entity_Familiar beginClass block */ undefined4 * luabridge::Namespace::Class::addData_OrbitDistance(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xd64; lua_pushcclosure(*in_ECX,FUN_008bf3a0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"OrbitDistance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"OrbitDistance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xd64; lua_pushcclosure(*in_ECX,FUN_008bf440,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"OrbitDistance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008863e0 FUN_008863e0 undefined4 * FUN_008863e0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf4e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf540,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00886550 FUN_00886550 undefined4 FUN_00886550(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00886570 FUN_00886570 undefined4 * FUN_00886570(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089b850,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089b7c0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008866e0 FUN_008866e0 void FUN_008866e0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089b7c0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886740 FUN_00886740 undefined4 * FUN_00886740(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089b760,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089b6f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008868b0 FUN_008868b0 void FUN_008868b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089b620,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886910 FUN_00886910 undefined4 * FUN_00886910(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089b690,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089b620,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00886a80 FUN_00886a80 undefined4 FUN_00886a80(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00886aa0 FUN_00886aa0 void FUN_00886aa0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::Morph; lua_pushcclosure(uVar1,FUN_008b0e90,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Morph"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886b00 FUN_00886b00 void FUN_00886b00(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b0f30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886b60 luabridge::Namespace::Class::addProperty_CanShutDoors /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "CanShutDoors" in __propget/__propset with getter Entity::CanShutDoors setter Entity::SetVisibleFlag, closures ['FUN_0089b5b0', 'FUN_0089b540']; sole caller LuaEngine::RegisterAPI line in Entity_NPC beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_CanShutDoors(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::CanShutDoors; lua_pushcclosure(*in_ECX,FUN_0089b5b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"CanShutDoors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CanShutDoors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity::SetVisibleFlag; lua_pushcclosure(*in_ECX,FUN_0089b540,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CanShutDoors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00886ce0 FUN_00886ce0 undefined4 * FUN_00886ce0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089b5b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00886d80 FUN_00886d80 void FUN_00886d80(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity_NPC::ThrowSpider; lua_pushcclosure(*in_ECX,FUN_0089b380,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ThrowSpider"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886de0 FUN_00886de0 void FUN_00886de0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::GetPlayerTarget; lua_pushcclosure(uVar1,FUN_008b0f80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPlayerTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886e40 FUN_00886e40 void FUN_00886e40(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::CalcTargetPosition; lua_pushcclosure(uVar1,FUN_008b1020,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CalcTargetPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00886ea0 FUN_00886ea0 undefined4 * FUN_00886ea0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b1100,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00886f40 FUN_00886f40 undefined4 * FUN_00886f40(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::CanBeDamagedFromVelocity; lua_pushcclosure(uVar1,FUN_008b1160,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"CanBeDamagedFromVelocity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CanBeDamagedFromVelocity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00886ff0 luabridge::Namespace::Class::addProperty_Scale /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Scale" in __propget/__propset with getter Entity_NPC::Scale setter Entity_NPC::SetScale, closures ['FUN_0089b310', 'FUN_0089b280']; sole caller LuaEngine::RegisterAPI line in Entity_NPC beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Scale(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_NPC::Scale; lua_pushcclosure(*in_ECX,FUN_0089b310,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Scale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Scale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_NPC::SetScale; lua_pushcclosure(*in_ECX,FUN_0089b280,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Scale"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00887170 FUN_00887170 void FUN_00887170(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::MakeChampion; lua_pushcclosure(uVar1,FUN_008b1220,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MakeChampion"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008871d0 FUN_008871d0 void FUN_008871d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::PlaySound; lua_pushcclosure(uVar1,&LAB_008b12b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"PlaySound"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00887230 FUN_00887230 void FUN_00887230(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::MakeSplat; lua_pushcclosure(uVar1,FUN_008b13b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MakeSplat"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00887290 FUN_00887290 void FUN_00887290(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::FireProjectiles; lua_pushcclosure(uVar1,FUN_008b1480,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireProjectiles"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008872f0 FUN_008872f0 void FUN_008872f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::FireBossProjectiles; lua_pushcclosure(uVar1,FUN_008b1630,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FireBossProjectiles"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00887350 FUN_00887350 void FUN_00887350(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::AnimWalkFrame; lua_pushcclosure(uVar1,FUN_008b1810,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AnimWalkFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008873b0 FUN_008873b0 undefined4 * FUN_008873b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::QueryNPCsType; lua_pushcclosure(uVar1,&LAB_008b1930,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"QueryNPCsType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"QueryNPCsType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00887460 FUN_00887460 undefined4 * FUN_00887460(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::QueryNPCsSpawnerType; lua_pushcclosure(uVar1,&LAB_008b1a20,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"QueryNPCsSpawnerType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"QueryNPCsSpawnerType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00887510 FUN_00887510 void FUN_00887510(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_NPC::QueryNPCsGroup; lua_pushcclosure(uVar1,&LAB_008b1b30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"QueryNPCsGroup"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00887570 FUN_00887570 undefined4 * FUN_00887570(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089b1e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 00887660 luabridge::Namespace::Class::addProperty_EntityRef /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "EntityRef" in __propget/__propset with getter Entity_NPC::EntityRef setter Entity_NPC::SetRef_bec, closures ['FUN_0089b140', 'FUN_0089b090']; sole caller LuaEngine::RegisterAPI line in Entity_NPC beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_EntityRef(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_NPC::EntityRef; lua_pushcclosure(*in_ECX,FUN_0089b140,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"EntityRef"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"EntityRef"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_NPC::SetRef_bec; lua_pushcclosure(*in_ECX,FUN_0089b090,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"EntityRef"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008877e0 FUN_008877e0 undefined4 * FUN_008877e0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf5b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf610,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00887950 luabridge::Namespace::Class::addData_Pathfinder /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Pathfinder" in __propget/__propset with member offset 0x414 (isWritable 1), closures ['FUN_008bf670', 'FUN_008bf700']; sole caller LuaEngine::RegisterAPI line in Entity_NPC beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Pathfinder(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x414; lua_pushcclosure(*in_ECX,FUN_008bf670,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Pathfinder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Pathfinder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x414; lua_pushcclosure(*in_ECX,CFunc::setProperty,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Pathfinder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00887ad0 luabridge::Namespace::Class::addData_State /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "State" in __propget/__propset with member offset 0xb64 (isWritable 1), closures ['FUN_008bf920', 'FUN_008bf610']; sole caller LuaEngine::RegisterAPI line in Entity_NPC beginClass block */ undefined4 * luabridge::Namespace::Class::addData_State(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xb64; lua_pushcclosure(*in_ECX,FUN_008bf920,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xb64; lua_pushcclosure(*in_ECX,FUN_008bf610,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00887c50 FUN_00887c50 undefined4 * FUN_00887c50(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bf980,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bfa20,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00887dc0 FUN_00887dc0 undefined4 FUN_00887dc0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00887de0 luabridge::Namespace::Class::addProperty_Flags /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "Flags" in __propget/__propset with getter Entity_Bomb::Flags setter FUN_006a6910, closures ['FUN_0089aff0', 'FUN_0089af50']; sole caller LuaEngine::RegisterAPI line in Entity_Bomb beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_Flags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Bomb::Flags; lua_pushcclosure(*in_ECX,FUN_0089aff0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Flags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Flags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_006a6910; lua_pushcclosure(*in_ECX,FUN_0089af50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Flags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00887f70 luabridge::Namespace::Class::addProperty_IsFetus /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "IsFetus" in __propget/__propset with getter Entity_Bomb::IsFetus setter FUN_0060cdb0, closures ['FUN_0089aee0', 'FUN_0089ae70']; sole caller LuaEngine::RegisterAPI line in Entity_Bomb beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_IsFetus(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Bomb::IsFetus; lua_pushcclosure(*in_ECX,FUN_0089aee0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"IsFetus"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"IsFetus"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_0060cdb0; lua_pushcclosure(*in_ECX,FUN_0089ae70,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"IsFetus"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008880f0 FUN_008880f0 undefined4 * FUN_008880f0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089ae00,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089ad70,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00888260 FUN_00888260 void FUN_00888260(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Bomb::SetExplosionCountdown; lua_pushcclosure(uVar1,FUN_008b1c10,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetExplosionCountdown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008882c0 FUN_008882c0 undefined4 FUN_008882c0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 008882e0 FUN_008882e0 void FUN_008882e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity_Laser::ShootAngle; lua_pushcclosure(*in_ECX,&LAB_0089ac90,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ShootAngle"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00888340 luabridge::Namespace::Class::addProperty_TearFlags /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "TearFlags" in __propget/__propset with getter Entity_Tear::TearFlags setter FUN_00456830, closures ['FUN_0089abf0', 'FUN_0089ab50']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_TearFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Tear::TearFlags; lua_pushcclosure(*in_ECX,FUN_0089abf0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00456830; lua_pushcclosure(*in_ECX,FUN_0089ab50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008884c0 FUN_008884c0 undefined4 * FUN_008884c0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089aae0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089aa50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00888630 FUN_00888630 void FUN_00888630(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b1db0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00888690 FUN_00888690 void FUN_00888690(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Laser::SetActiveRotation; lua_pushcclosure(uVar1,FUN_008b1e20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetActiveRotation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008886f0 FUN_008886f0 undefined4 * FUN_008886f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Laser::GetRenderZ; lua_pushcclosure(uVar1,FUN_008b1ef0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetRenderZ"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRenderZ"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008887a0 FUN_008887a0 undefined4 * FUN_008887a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Laser::GetEndPoint; lua_pushcclosure(uVar1,FUN_008b1f50,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetEndPoint"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEndPoint"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00888850 FUN_00888850 undefined4 * FUN_00888850(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2000,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008888f0 FUN_008888f0 void FUN_008888f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2070,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00888950 FUN_00888950 void FUN_00888950(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2110,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008889b0 FUN_008889b0 void FUN_008889b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089aa50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00888a10 FUN_00888a10 void FUN_00888a10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Entity_Laser::CalculateEndPoint; lua_pushcclosure(*in_ECX,&LAB_0089a8b0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CalculateEndPoint"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00888a70 FUN_00888a70 undefined4 * FUN_00888a70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bfac0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bfb60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00888be0 FUN_00888be0 undefined4 * FUN_00888be0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bfc00,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bfc60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00888d50 luabridge::Namespace::Class::addData_TearFlags /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "TearFlags" in __propget/__propset with member offset 0x428 (isWritable 1), closures ['FUN_008bfcd0', 'FUN_008bfd60']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_TearFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x428; lua_pushcclosure(*in_ECX,FUN_008bfcd0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x428; lua_pushcclosure(*in_ECX,FUN_008bfd60,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00888ed0 luabridge::Namespace::Class::addData_Timeout /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Timeout" in __propget/__propset with member offset 0x458 (isWritable 1), closures ['FUN_008bfdf0', 'FUN_008bfe50']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Timeout(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x458; lua_pushcclosure(*in_ECX,FUN_008bfdf0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Timeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Timeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x458; lua_pushcclosure(*in_ECX,FUN_008bfe50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Timeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00889050 FUN_00889050 undefined4 * FUN_00889050(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bfeb0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008bff10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008891c0 luabridge::Namespace::Class::addData_SampleLaser /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "SampleLaser" in __propget/__propset with member offset 0x45d (isWritable 1), closures ['FUN_008bff80', 'FUN_008c0010']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_SampleLaser(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x45d; lua_pushcclosure(*in_ECX,FUN_008bff80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SampleLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SampleLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x45d; lua_pushcclosure(*in_ECX,FUN_008c0010,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SampleLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00889340 luabridge::Namespace::Class::addData_HomingLaser /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "HomingLaser" in __propget/__propset with member offset 0x464 (isWritable 1), closures ['FUN_008c00b0', 'FUN_008c0140']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_HomingLaser(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x464; lua_pushcclosure(*in_ECX,FUN_008c00b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"HomingLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HomingLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x464; lua_pushcclosure(*in_ECX,FUN_008c0140,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HomingLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008894c0 luabridge::Namespace::Class::addData_RotationDelay /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "RotationDelay" in __propget/__propset with member offset 0x4c4 (isWritable 1), closures ['FUN_008c0230', 'FUN_008bfe50']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_RotationDelay(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4c4; lua_pushcclosure(*in_ECX,FUN_008c0230,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"RotationDelay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"RotationDelay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4c4; lua_pushcclosure(*in_ECX,FUN_008bfe50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"RotationDelay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00889640 luabridge::Namespace::Class::addData_HomingType /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "HomingType" in __propget/__propset with member offset 0x4d4 (isWritable 1), closures ['FUN_008c0290', 'FUN_008c0320']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_HomingType(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4d4; lua_pushcclosure(*in_ECX,FUN_008c0290,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"HomingType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HomingType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4d4; lua_pushcclosure(*in_ECX,FUN_008c0320,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HomingType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008897c0 luabridge::Namespace::Class::addData_BounceLaser /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "BounceLaser" in __propget/__propset with member offset 0x4e8 (isWritable 1), closures ['FUN_008c03c0', 'FUN_008c0460']; sole caller LuaEngine::RegisterAPI line in Entity_Laser beginClass block */ undefined4 * luabridge::Namespace::Class::addData_BounceLaser(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4e8; lua_pushcclosure(*in_ECX,FUN_008c03c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"BounceLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"BounceLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4e8; lua_pushcclosure(*in_ECX,FUN_008c0460,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"BounceLaser"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00889940 FUN_00889940 undefined4 FUN_00889940(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c8297b); return param_1; } //@@ 00889960 luabridge::Namespace::Class::addProperty_TearFlags /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "TearFlags" in __propget/__propset with getter Entity_Knife::TearFlags setter FUN_005cd5c0, closures ['FUN_0089a810', 'FUN_0089a770']; sole caller LuaEngine::RegisterAPI line in Entity_Knife beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_TearFlags(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Entity_Knife::TearFlags; lua_pushcclosure(*in_ECX,FUN_0089a810,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_005cd5c0; lua_pushcclosure(*in_ECX,FUN_0089a770,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TearFlags"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00889ae0 FUN_00889ae0 undefined4 * FUN_00889ae0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_0089a700,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_0089a670,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00889c50 FUN_00889c50 undefined4 * FUN_00889c50(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Laser::GetRenderZ; lua_pushcclosure(uVar1,FUN_008b2180,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetRenderZ"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRenderZ"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00889d00 FUN_00889d00 void FUN_00889d00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Knife::Shoot; lua_pushcclosure(uVar1,FUN_008b21e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Shoot"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00889d60 FUN_00889d60 undefined4 * FUN_00889d60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Knife::IsFlying; lua_pushcclosure(uVar1,FUN_008b2270,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsFlying"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsFlying"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00889e10 FUN_00889e10 undefined4 * FUN_00889e10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089a700,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00889eb0 FUN_00889eb0 void FUN_00889eb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Knife::SetPathFollowSpeed; lua_pushcclosure(uVar1,FUN_0089a670,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetPathFollowSpeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00889f10 FUN_00889f10 void FUN_00889f10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity_Knife::Reset; lua_pushcclosure(uVar1,FUN_008b22e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Reset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00889f70 FUN_00889f70 undefined4 * FUN_00889f70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c04f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0550,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088a0e0 FUN_0088a0e0 undefined4 FUN_0088a0e0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088a100 FUN_0088a100 undefined4 * FUN_0088a100(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c05c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0620,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088a270 FUN_0088a270 undefined4 * FUN_0088a270(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0680,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0620,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088a3e0 luabridge::Namespace::Class::addData_Initialized /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Initialized" in __propget/__propset with member offset 0x18 (isWritable 1), closures ['FUN_008c06e0', 'FUN_008c0740']; sole caller LuaEngine::RegisterAPI line in GridEntityDesc beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Initialized(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x18; lua_pushcclosure(*in_ECX,FUN_008c06e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Initialized"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Initialized"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x18; lua_pushcclosure(*in_ECX,FUN_008c0740,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Initialized"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088a560 FUN_0088a560 undefined4 FUN_0088a560(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088a580 FUN_0088a580 undefined4 * FUN_0088a580(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = GridEntity::Position; lua_pushcclosure(*in_ECX,FUN_0089a5d0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Position"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Position"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088a680 FUN_0088a680 void FUN_0088a680(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::SetType; lua_pushcclosure(uVar1,FUN_0089a4a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088a6e0 FUN_0088a6e0 void FUN_0088a6e0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_0089a4a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088a740 luabridge::Namespace::Class::addProperty_State /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "State" in __propget/__propset with getter EntityList::Size setter FUN_00665b70, closures ['FUN_0089a570', 'FUN_0089a4a0']; sole caller LuaEngine::RegisterAPI line in GridEntity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_State(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = EntityList::Size; lua_pushcclosure(*in_ECX,FUN_0089a570,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00665b70; lua_pushcclosure(*in_ECX,FUN_0089a4a0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"State"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088a8c0 FUN_0088a8c0 void FUN_0088a8c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2330,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088a920 FUN_0088a920 void FUN_0088a920(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::Update; lua_pushcclosure(uVar1,FUN_008b2380,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Render"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088a980 FUN_0088a980 void FUN_0088a980(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::Hurt; lua_pushcclosure(uVar1,FUN_008b2410,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b73098); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088a9e0 FUN_0088a9e0 void FUN_0088a9e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::HurtWithSource; lua_pushcclosure(uVar1,&LAB_008b24a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HurtWithSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088aa40 FUN_0088aa40 void FUN_0088aa40(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::Destroy; lua_pushcclosure(uVar1,FUN_008b25b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Destroy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088aaa0 FUN_0088aaa0 void FUN_0088aaa0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Entity::Render; lua_pushcclosure(uVar1,&LAB_008b2630,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"DestroyWithSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ab00 FUN_0088ab00 void FUN_0088ab00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::GetType; lua_pushcclosure(uVar1,FUN_008b2740,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ab60 FUN_0088ab60 void FUN_0088ab60(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b27a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088abc0 FUN_0088abc0 void FUN_0088abc0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = TemporaryEffects::GetEffectsList; lua_pushcclosure(uVar1,FUN_008b2800,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSaveState"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ac20 luabridge::Namespace::Class::addProperty_VarData /* DB: luabridge Class::addProperty instance constant-folded to one call: registers Lua property "VarData" in __propget/__propset with getter GridEntity::VarData setter FUN_00718ed0, closures ['FUN_0089a510', 'FUN_0089a4a0']; sole caller LuaEngine::RegisterAPI line in GridEntity beginClass block */ undefined4 * luabridge::Namespace::Class::addProperty_VarData(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = GridEntity::VarData; lua_pushcclosure(*in_ECX,FUN_0089a510,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"VarData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"VarData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00718ed0; lua_pushcclosure(*in_ECX,FUN_0089a4a0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"VarData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088ada0 luabridge::Namespace::Class::addData_Desc /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "Desc" in __propget/__propset with member offset 4 (isWritable 1), closures ['FUN_008c07b0', 'FUN_008c0850']; sole caller LuaEngine::RegisterAPI line in GridEntity beginClass block */ undefined4 * luabridge::Namespace::Class::addData_Desc(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008c07b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b730d4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b730d4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008c0850,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b730d4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088af40 luabridge::Namespace::Class::addData_CollisionClass /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "CollisionClass" in __propget/__propset with member offset 0x3c (isWritable 1), closures ['FUN_008c08f0', 'FUN_008c0950']; sole caller LuaEngine::RegisterAPI line in GridEntity beginClass block */ undefined4 * luabridge::Namespace::Class::addData_CollisionClass(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x3c; lua_pushcclosure(*in_ECX,FUN_008c08f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"CollisionClass"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CollisionClass"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x3c; lua_pushcclosure(*in_ECX,FUN_008c0950,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CollisionClass"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088b0c0 FUN_0088b0c0 void FUN_0088b0c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::GetRNG; lua_pushcclosure(uVar1,FUN_008b28a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRNG"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b120 FUN_0088b120 void FUN_0088b120(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity::GetSprite; lua_pushcclosure(uVar1,FUN_008b2940,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSprite"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b180 FUN_0088b180 undefined4 * FUN_0088b180(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089a400,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToDoor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089a360,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToDoor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b220 FUN_0088b220 undefined4 * FUN_0088b220(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089a2c0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToPit"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089a220,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToPit"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b2c0 FUN_0088b2c0 undefined4 * FUN_0088b2c0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089a180,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToPoop"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_0089a0e0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToPoop"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b360 FUN_0088b360 undefined4 * FUN_0088b360(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_0089a040,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToRock"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_00899fa0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToRock"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b400 FUN_0088b400 undefined4 * FUN_0088b400(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_00899ef0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToPressurePlate"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_00899e50,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToPressurePlate"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b4a0 FUN_0088b4a0 undefined4 * FUN_0088b4a0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_00899db0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToSpikes"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_00899d10,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToSpikes"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b540 FUN_0088b540 undefined4 * FUN_0088b540(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; lua_pushcclosure(*in_ECX,FUN_00899c70,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ToTNT"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_pushcclosure(*in_ECX,FUN_00899bd0,0); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ToTNT"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); return in_ECX; } //@@ 0088b5e0 FUN_0088b5e0 undefined4 FUN_0088b5e0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088b600 FUN_0088b600 undefined4 * FUN_0088b600(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_00899b70,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_00899b00,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088b770 FUN_0088b770 void FUN_0088b770(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Door::SetRoomTypes; lua_pushcclosure(uVar1,FUN_008b29e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetRoomTypes"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b7d0 FUN_0088b7d0 void FUN_0088b7d0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2a60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b830 FUN_0088b830 void FUN_0088b830(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2ab0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b890 FUN_0088b890 void FUN_0088b890(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Door::CanBlowOpen; lua_pushcclosure(uVar1,FUN_008b2b20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CanBlowOpen"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b8f0 FUN_0088b8f0 void FUN_0088b8f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Door::TryBlowOpen; lua_pushcclosure(uVar1,FUN_008b2b90,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryBlowOpen"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b950 FUN_0088b950 void FUN_0088b950(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Door::TryUnlock; lua_pushcclosure(uVar1,FUN_008b2c50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryUnlock"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088b9b0 FUN_0088b9b0 undefined4 * FUN_0088b9b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2d10,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088ba50 FUN_0088ba50 undefined4 * FUN_0088ba50(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Door::IsRoomType; lua_pushcclosure(uVar1,FUN_008b2d80,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsRoomType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsRoomType"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088bb00 FUN_0088bb00 void FUN_0088bb00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Door::GetSpriteOffset; lua_pushcclosure(uVar1,FUN_008b2e10,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSpriteOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088bb60 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c09b0', 'FUN_008c0a10']; getter uses Stack::push 0085bfd0; RegisterAPI calls it for CurrentRoomType TargetRoomType Direction TargetRoomIndex */ undefined4 * luabridge::Namespace::Class::addData(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c09b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0a10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088bcd0 luabridge::Namespace::Class::addData_ExtraSprite /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "ExtraSprite" in __propget/__propset with member offset 0x27c (isWritable 1), closures ['FUN_008c0a70', 'FUN_008c0b00']; sole caller LuaEngine::RegisterAPI line in GridEntity_Door beginClass block */ undefined4 * luabridge::Namespace::Class::addData_ExtraSprite(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x27c; lua_pushcclosure(*in_ECX,FUN_008c0a70,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ExtraSprite"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ExtraSprite"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x27c; lua_pushcclosure(*in_ECX,FUN_008c0b00,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ExtraSprite"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088be50 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c0c10', 'FUN_008c0c70']; getter pushes boolean; offsets 0x390/0x391; RegisterAPI calls it for ExtraVisible Busted */ undefined4 * luabridge::Namespace::Class::addData(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0c10,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0c70,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088bfd0 luabridge::Namespace::Class::addData_PreviousState /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "PreviousState" in __propget/__propset with member offset 0x398 (isWritable 1), closures ['FUN_008c0ce0', 'FUN_008c0d70']; sole caller LuaEngine::RegisterAPI line in GridEntity_Door beginClass block */ undefined4 * luabridge::Namespace::Class::addData_PreviousState(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x398; lua_pushcclosure(*in_ECX,FUN_008c0ce0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"PreviousState"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PreviousState"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x398; lua_pushcclosure(*in_ECX,FUN_008c0d70,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PreviousState"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088c150 luabridge::Namespace::Class::addData_PreviousVariant /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "PreviousVariant" in __propget/__propset with member offset 0x39c (isWritable 1), closures ['FUN_008c0e10', 'FUN_008c0ea0']; sole caller LuaEngine::RegisterAPI line in GridEntity_Door beginClass block */ undefined4 * luabridge::Namespace::Class::addData_PreviousVariant(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x39c; lua_pushcclosure(*in_ECX,FUN_008c0e10,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"PreviousVariant"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PreviousVariant"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x39c; lua_pushcclosure(*in_ECX,FUN_008c0ea0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"PreviousVariant"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088c2d0 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c0f40', 'FUN_008c0fb0']; getter lua_pushlstring; RegisterAPI calls it for OpenAnimation CloseAnimation LockedAnimation OpenLockedAnimation */ undefined4 * luabridge::Namespace::Class::addData (undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0f40,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c0fb0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088c440 FUN_0088c440 undefined4 FUN_0088c440(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088c460 FUN_0088c460 void FUN_0088c460(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b2eb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088c4c0 luabridge::Namespace::Class::addData_ReviveTimer /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "ReviveTimer" in __propget/__propset with member offset 0x154 (isWritable 1), closures ['FUN_008c10c0', 'FUN_008c1120']; sole caller LuaEngine::RegisterAPI line in GridEntity_Poop beginClass block */ undefined4 * luabridge::Namespace::Class::addData_ReviveTimer(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c10c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ReviveTimer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ReviveTimer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c1120,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ReviveTimer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088c640 luabridge::Namespace::Class::addData_StateAnimation /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "StateAnimation" in __propget/__propset with member offset 0x158 (isWritable 1), closures ['FUN_008c1180', 'FUN_008c11f0']; sole caller LuaEngine::RegisterAPI line in GridEntity_Poop beginClass block */ undefined4 * luabridge::Namespace::Class::addData_StateAnimation(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x158; lua_pushcclosure(*in_ECX,FUN_008c1180,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"StateAnimation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"StateAnimation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x158; lua_pushcclosure(*in_ECX,FUN_008c11f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"StateAnimation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088c7c0 luabridge::Namespace::Class::addData_UnderPlayer /* DB: luabridge Class::addData instance constant-folded to one call: registers Lua property "UnderPlayer" in __propget/__propset with member offset 0x170 (isWritable 1), closures ['FUN_008c1300', 'FUN_008c1360']; sole caller LuaEngine::RegisterAPI line in GridEntity_Poop beginClass block */ undefined4 * luabridge::Namespace::Class::addData_UnderPlayer(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x170; lua_pushcclosure(*in_ECX,FUN_008c1300,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"UnderPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"UnderPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x170; lua_pushcclosure(*in_ECX,FUN_008c1360,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"UnderPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088c940 FUN_0088c940 undefined4 FUN_0088c940(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088c960 FUN_0088c960 void FUN_0088c960(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Pit::MakeBridge; lua_pushcclosure(uVar1,FUN_008b2f00,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MakeBridge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088c9c0 FUN_0088c9c0 void FUN_0088c9c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Pit::SetLadder; lua_pushcclosure(uVar1,FUN_008b2fa0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetLadder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ca20 FUN_0088ca20 void FUN_0088ca20(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Pit::UpdateCollision; lua_pushcclosure(uVar1,FUN_008b3010,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"UpdateCollision"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ca80 luabridge::Class::addData_HasLadder /* DB: luabridge addData clone with name/offset folded: __propget/__propset closures on member +0x154 (FUN_008c13d0/008c1430); LuaEngine::RegisterAPI GridEntityPit chain ("HasLadder",0x154,1) */ undefined4 * luabridge::Class::addData_HasLadder(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c13d0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"HasLadder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HasLadder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c1430,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HasLadder"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088cc00 FUN_0088cc00 undefined4 FUN_0088cc00(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088cc20 FUN_0088cc20 undefined4 * FUN_0088cc20(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Rock::GetRubbleAnim; lua_pushcclosure(uVar1,FUN_008b3060,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetRubbleAnim"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRubbleAnim"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088ccd0 FUN_0088ccd0 void FUN_0088ccd0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Rock::SetBigRockFrame; lua_pushcclosure(uVar1,FUN_008b30e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetBigRockFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088cd30 FUN_0088cd30 undefined4 * FUN_0088cd30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Rock::GetBigRockFrame; lua_pushcclosure(uVar1,FUN_008b3150,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetBigRockFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetBigRockFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088cde0 FUN_0088cde0 void FUN_0088cde0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_Rock::UpdateAnimFrame; lua_pushcclosure(uVar1,FUN_008b31b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"UpdateAnimFrame"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ce40 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c14a0', 'FUN_008c1510']; getter lua_pushlstring; RegisterAPI calls it for &DAT_00b7343c RubbleAnim */ undefined4 * luabridge::Namespace::Class::addData (undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c14a0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c1510,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088cfb0 luabridge::Class::addData_FrameCnt /* DB: luabridge addData clone: "FrameCnt" getter/setter FUN_008c1620/008c1680 on offset 400; RegisterAPI GridEntityRock chain */ undefined4 * luabridge::Class::addData_FrameCnt(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 400; lua_pushcclosure(*in_ECX,FUN_008c1620,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"FrameCnt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FrameCnt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 400; lua_pushcclosure(*in_ECX,FUN_008c1680,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FrameCnt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088d130 FUN_0088d130 undefined4 FUN_0088d130(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088d150 luabridge::Class::addData_FrameCnt /* DB: luabridge addData clone: "FrameCnt" on +0x154 (FUN_008c16e0/008c1740); RegisterAPI GridEntityTNT chain */ undefined4 * luabridge::Class::addData_FrameCnt(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c16e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"FrameCnt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FrameCnt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c1740,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"FrameCnt"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088d2d0 FUN_0088d2d0 undefined4 FUN_0088d2d0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088d2f0 FUN_0088d2f0 void FUN_0088d2f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = GridEntity_PressurePlate::Reward; lua_pushcclosure(uVar1,FUN_008b3200,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Reward"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088d350 luabridge::Class::addData_TimerPlate /* DB: luabridge addData clone: "TimerPlate" on +0x154 (FUN_008c17a0/008c1830); RegisterAPI GridEntityPressurePlate chain */ undefined4 * luabridge::Class::addData_TimerPlate(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c17a0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TimerPlate"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TimerPlate"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c1830,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TimerPlate"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088d4d0 luabridge::Class::addData_NextGreedAnimation /* DB: luabridge addData clone: "NextGreedAnimation" on +0x268 (FUN_008c1940/008c19c0); RegisterAPI GridEntityPressurePlate chain */ undefined4 * luabridge::Class::addData_NextGreedAnimation(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x268; lua_pushcclosure(*in_ECX,FUN_008c1940,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"NextGreedAnimation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"NextGreedAnimation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x268; lua_pushcclosure(*in_ECX,FUN_008c19c0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"NextGreedAnimation"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088d650 luabridge::Class::addData_GreedModeRNG /* DB: luabridge addData clone: "GreedModeRNG" on +0x26c (FUN_008c1a50/008c1ae0); RegisterAPI GridEntityPressurePlate chain */ undefined4 * luabridge::Class::addData_GreedModeRNG(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x26c; lua_pushcclosure(*in_ECX,FUN_008c1a50,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"GreedModeRNG"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeRNG"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x26c; lua_pushcclosure(*in_ECX,FUN_008c1ae0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeRNG"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088d7d0 FUN_0088d7d0 undefined4 FUN_0088d7d0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX,&DAT_00c82979); return param_1; } //@@ 0088d7f0 luabridge::Class::addData_Timeout /* DB: luabridge addData clone: "Timeout" on +0x154 (FUN_008c1b70/008c1bd0); RegisterAPI GridEntitySpikes chain */ undefined4 * luabridge::Class::addData_Timeout(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c1b70,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Timeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Timeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x154; lua_pushcclosure(*in_ECX,FUN_008c1bd0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Timeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088d970 lua_register_RoomConfigEntries /* DB: LuaEngine::RegisterAPI calls it with "RoomConfigEntries": luabridge "ArrayProxy"/"CppContainer" with __len/__propget (element FUN_008c3cc0) */ void lua_register_RoomConfigEntries(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("ArrayProxy",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(local_1c,FUN_008c33f0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(uVar3,FUN_008c33f0,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a0720; lua_pushcclosure(local_1c,FUN_008c5790,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0088dc30 lua_register_RoomConfigSpawns /* DB: LuaEngine::RegisterAPI calls it with "RoomConfigSpawns": luabridge "ArrayProxy"/"CppContainer" with __len/__propget (element FUN_008c3ab0) */ void lua_register_RoomConfigSpawns(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("ArrayProxy",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(local_1c,FUN_008c3390,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(uVar3,FUN_008c3390,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_008a0700; lua_pushcclosure(local_1c,FUN_008c5850,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 0088def0 FUN_0088def0 undefined4 FUN_0088def0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088df10 luabridge::Class::addData_Type /* DB: luabridge addData clone: "Type" (DAT_00b6d1a4) on offset 0 (FUN_008c1c30/008c1c90); RegisterAPI RoomConfig.Entry chain */ undefined4 * luabridge::Class::addData_Type(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008c1c30,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b6d1a4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b6d1a4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0; lua_pushcclosure(*in_ECX,FUN_008c1c90,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b6d1a4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088e090 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c1cf0', 'FUN_008c1d50']; getter uses Stack::push 0085c010 (MOVZX DX); offsets 4/6; RegisterAPI calls it for Variant Subtype */ undefined4 * luabridge::Namespace::Class::addData (undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c1cf0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c1d50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088e200 luabridge::Class::addData_Weight /* DB: luabridge addData clone: "Weight" on offset 8 (FUN_008c1db0/008c1e10); RegisterAPI RoomConfig.Entry chain */ undefined4 * luabridge::Class::addData_Weight(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008c1db0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Weight"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Weight"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008c1e10,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Weight"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088e380 FUN_0088e380 undefined4 FUN_0088e380(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088e3a0 FUN_0088e3a0 undefined4 * FUN_0088e3a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Spawn::PickEntry; lua_pushcclosure(uVar1,FUN_008b3250,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"PickEntry"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"PickEntry"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088e450 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c1e80', 'FUN_008c1ee0']; getter pushes *(short*); X=0 Y=2; RegisterAPI calls it for &DAT_00b6a748 &DAT_00b6d134 */ undefined4 * luabridge::Namespace::Class::addData(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c1e80,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c1ee0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088e5c0 FUN_0088e5c0 undefined4 * FUN_0088e5c0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Spawn::Entries; lua_pushcclosure(*in_ECX,FUN_00899a50,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Entries"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Entries"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088e6c0 luabridge::Class::addData_EntryCount /* DB: luabridge addData clone: "EntryCount" on offset 8 (FUN_008c1f40/008c1fa0); RegisterAPI RoomConfig.Spawn chain */ undefined4 * luabridge::Class::addData_EntryCount(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008c1f40,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"EntryCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"EntryCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 8; lua_pushcclosure(*in_ECX,FUN_008c1fa0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"EntryCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088e840 luabridge::Class::addData_SumWeights /* DB: luabridge addData clone: "SumWeights" on offset 0xc (FUN_008c2000/008c2060); RegisterAPI RoomConfig.Spawn chain */ undefined4 * luabridge::Class::addData_SumWeights(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xc; lua_pushcclosure(*in_ECX,FUN_008c2000,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SumWeights"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SumWeights"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0xc; lua_pushcclosure(*in_ECX,FUN_008c2060,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SumWeights"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088e9c0 FUN_0088e9c0 undefined4 FUN_0088e9c0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088e9e0 FUN_0088e9e0 undefined4 * FUN_0088e9e0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c20d0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088ead0 FUN_0088ead0 undefined4 * FUN_0088ead0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2130,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088ebc0 FUN_0088ebc0 undefined4 * FUN_0088ebc0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 4; lua_pushcclosure(*in_ECX,FUN_008c2190,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b734e0); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b734e0); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088ecc0 FUN_0088ecc0 undefined4 * FUN_0088ecc0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x14; lua_pushcclosure(*in_ECX,FUN_008c2220,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,&DAT_00b1b350); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,&DAT_00b1b350); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088edc0 FUN_0088edc0 undefined4 * FUN_0088edc0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2290,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088eeb0 FUN_0088eeb0 undefined4 * FUN_0088eeb0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Room::Doors; lua_pushcclosure(*in_ECX,FUN_008999e0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Doors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Doors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088efb0 FUN_0088efb0 undefined4 * FUN_0088efb0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Room::Spawns; lua_pushcclosure(*in_ECX,FUN_00899930,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Spawns"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Spawns"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088f0b0 FUN_0088f0b0 undefined4 * FUN_0088f0b0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x44; lua_pushcclosure(*in_ECX,FUN_008c22f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"SpawnCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SpawnCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088f1b0 FUN_0088f1b0 undefined4 * FUN_0088f1b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2350,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 0088f2a0 FUN_0088f2a0 undefined4 FUN_0088f2a0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088f2c0 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c23b0', 'FUN_008c2410']; getter uses Stack::push 0085bfd0; RegisterAPI calls it for GridIndex SafeGridIndex ListIndex PitsCount DeliriumDistance */ undefined4 * luabridge::Namespace::Class::addData(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c23b0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2410,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088f430 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c2470', 'FUN_008c2510']; getter wraps UserdataPtr (nil if null); RegisterAPI calls it for &DAT_00b7365c OverrideData */ undefined4 * luabridge::Namespace::Class::addData (undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2470,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2510,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088f5a0 luabridge::Class::addData_AllowedDoors /* DB: luabridge addData clone: "AllowedDoors" on offset 0x18 (FUN_008c25a0/008c2630); RegisterAPI RoomDescriptor chain */ undefined4 * luabridge::Class::addData_AllowedDoors(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x18; lua_pushcclosure(*in_ECX,FUN_008c25a0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"AllowedDoors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"AllowedDoors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x18; lua_pushcclosure(*in_ECX,FUN_008c2630,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"AllowedDoors"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088f720 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c26d0', 'FUN_008c2410']; getter uses Stack::push 0085bff0 (high dword 0); RegisterAPI calls it for DisplayFlags Flags VisitedCount DecorationSeed SpawnSeed AwardSeed */ undefined4 * luabridge::Namespace::Class::addData (undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c26d0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2410,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088f890 luabridge::Namespace::Class::addProperty /* DB: luabridge Class::addProperty template instance (takes name param): rawget __propget/__propset, newuserdata(4*2) holds getter/setter, pushcclosure getter ['FUN_008998c0', 'FUN_00899850']; getter pushes boolean; RegisterAPI calls it for Clear PressurePlatesTriggered SacrificeDone ChallengeDone SurpriseMiniboss HasWater NoReward */ undefined4 * luabridge::Namespace::Class::addProperty (undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008998c0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_00899850,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088fa00 luabridge::Class::addData_ClearCount /* DB: luabridge addData clone: "ClearCount" on offset 0x4a (FUN_008c2730/008c2790); RegisterAPI RoomDescriptor chain */ undefined4 * luabridge::Class::addData_ClearCount(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4a; lua_pushcclosure(*in_ECX,FUN_008c2730,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ClearCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ClearCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x4a; lua_pushcclosure(*in_ECX,FUN_008c2790,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ClearCount"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088fb80 luabridge::Namespace::Class::addData /* DB: luabridge Class::addData template instance (takes name param): rawget __propget/__propset, newuserdata(4) holds member offset, pushcclosure getter ['FUN_008c27f0', 'FUN_008c2790']; getter pushes *(short*); offsets 0xac/0xae 2 apart; RegisterAPI calls it for PoopCount ShopItemIdx ShopItemDiscountIdx */ undefined4 * luabridge::Namespace::Class::addData(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c27f0,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008c2790,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 0088fcf0 FUN_0088fcf0 undefined4 FUN_0088fcf0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 0088fd10 FUN_0088fd10 undefined4 * FUN_0088fd10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b3320,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088fdb0 FUN_0088fdb0 void FUN_0088fdb0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b3380,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088fe10 FUN_0088fe10 void FUN_0088fe10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b33d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088fe70 FUN_0088fe70 void FUN_0088fe70(void) { FUN_008997b0(Room::GetGridCollision); return; } //@@ 0088fe90 FUN_0088fe90 void FUN_0088fe90(void) { FUN_008997b0(Room::GetGridPath); return; } //@@ 0088feb0 FUN_0088feb0 undefined4 * FUN_0088feb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetGridCollisionAtPos; lua_pushcclosure(uVar1,FUN_008b34c0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetGridCollisionAtPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetGridCollisionAtPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 0088ff60 FUN_0088ff60 void FUN_0088ff60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetDoor; lua_pushcclosure(uVar1,FUN_008b3580,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetDoor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 0088ffc0 FUN_0088ffc0 undefined4 * FUN_0088ffc0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b3640,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890060 FUN_00890060 undefined4 * FUN_00890060(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::IsDoorSlotAllowed; lua_pushcclosure(uVar1,FUN_008b3700,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsDoorSlotAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsDoorSlotAllowed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890110 FUN_00890110 void FUN_00890110(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b3790,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890170 FUN_00890170 undefined4 * FUN_00890170(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b3800,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890210 FUN_00890210 undefined4 * FUN_00890210(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b3860,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008902b0 FUN_008902b0 void FUN_008902b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b38f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890310 FUN_00890310 void FUN_00890310(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::DamageGridWithSource; lua_pushcclosure(uVar1,&LAB_008b3980,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"DamageGridWithSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890370 FUN_00890370 void FUN_00890370(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::DestroyGrid; lua_pushcclosure(uVar1,FUN_008b3ad0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"DestroyGrid"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008903d0 FUN_008903d0 void FUN_008903d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::DestroyGridWithSource; lua_pushcclosure(uVar1,FUN_008b3ba0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"DestroyGridWithSource"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890430 FUN_00890430 undefined4 * FUN_00890430(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::CheckLine; lua_pushcclosure(uVar1,luabridge::CFunc::CallMember::f,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"CheckLine"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CheckLine"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008904e0 FUN_008904e0 undefined4 * FUN_008904e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetLaserTarget; lua_pushcclosure(uVar1,&LAB_008b3f70,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLaserTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLaserTarget"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890590 FUN_00890590 undefined4 * FUN_00890590(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetGridEntity; lua_pushcclosure(uVar1,FUN_008b40a0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetGridEntity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetGridEntity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890640 FUN_00890640 undefined4 * FUN_00890640(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetGridEntityFromPos; lua_pushcclosure(uVar1,FUN_008b4160,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetGridEntityFromPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetGridEntityFromPos"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008906f0 FUN_008906f0 undefined4 * FUN_008906f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4230,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890790 FUN_00890790 void FUN_00890790(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b42a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008907f0 FUN_008907f0 undefined4 * FUN_008907f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::FindFreePickupSpawnPosition; lua_pushcclosure(uVar1,FUN_008b4310,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"FindFreePickupSpawnPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"FindFreePickupSpawnPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008908a0 FUN_008908a0 undefined4 * FUN_008908a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4470,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890940 FUN_00890940 undefined4 * FUN_00890940(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::IsPositionInRoom; lua_pushcclosure(uVar1,FUN_008b4570,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsPositionInRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsPositionInRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008909f0 FUN_008909f0 undefined4 * FUN_008909f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetLRoomAreaDesc; lua_pushcclosure(uVar1,FUN_008b4640,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLRoomAreaDesc"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLRoomAreaDesc"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890aa0 FUN_00890aa0 undefined4 * FUN_00890aa0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetLRoomTileDesc; lua_pushcclosure(uVar1,FUN_008b46f0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLRoomTileDesc"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLRoomTileDesc"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890b50 FUN_00890b50 undefined4 * FUN_00890b50(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b47c0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890bf0 FUN_00890bf0 undefined4 * FUN_00890bf0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4860,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00890c90 FUN_00890c90 void FUN_00890c90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::SpawnGridEntity; lua_pushcclosure(uVar1,&LAB_008b4900,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SpawnGridEntity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890cf0 FUN_00890cf0 void FUN_00890cf0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::RemoveGridEntity; lua_pushcclosure(uVar1,FUN_008b4a00,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveGridEntity"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890d50 FUN_00890d50 void FUN_00890d50(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4a90,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890db0 FUN_00890db0 void FUN_00890db0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetEntities; lua_pushcclosure(uVar1,FUN_008b4af0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEntities"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890e10 FUN_00890e10 void FUN_00890e10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::ShopReshuffle; lua_pushcclosure(uVar1,FUN_008b4b90,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ShopReshuffle"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890e70 FUN_00890e70 void FUN_00890e70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4c10,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890ed0 FUN_00890ed0 void FUN_00890ed0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4cb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890f30 FUN_00890f30 void FUN_00890f30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b4d20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890f90 FUN_00890f90 void FUN_00890f90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::TrySpawnBlueWombDoor; lua_pushcclosure(uVar1,FUN_008b4da0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TrySpawnBlueWombDoor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00890ff0 FUN_00890ff0 void FUN_00890ff0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetSeededCollectible; lua_pushcclosure(uVar1,FUN_008b4e60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSeededCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891050 FUN_00891050 void FUN_00891050(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::EmitBloodFromWalls; lua_pushcclosure(uVar1,FUN_008b4ef0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"EmitBloodFromWalls"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008910b0 FUN_008910b0 void FUN_008910b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::TryMakeBridge; lua_pushcclosure(uVar1,FUN_008b4f70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"TryMakeBridge"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891110 FUN_00891110 void FUN_00891110(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetRandomPosition; lua_pushcclosure(uVar1,FUN_008b5040,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRandomPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891170 FUN_00891170 void FUN_00891170(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetRandomTileIndex; lua_pushcclosure(uVar1,FUN_008b5120,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRandomTileIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008911d0 FUN_008911d0 void FUN_008911d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::MamaMegaExplosion; lua_pushcclosure(uVar1,&LAB_008b51a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MamaMegaExplosion"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891230 FUN_00891230 void FUN_00891230(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5280,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891290 FUN_00891290 undefined4 * FUN_00891290(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::WorldToScreenPosition; lua_pushcclosure(uVar1,FUN_008b5330,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"WorldToScreenPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"WorldToScreenPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00891340 FUN_00891340 undefined4 * FUN_00891340(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5430,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008913e0 FUN_008913e0 undefined4 * FUN_008913e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Room::GetRenderMode; lua_pushcclosure(uVar1,FUN_008b54a0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetRenderMode"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRenderMode"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00891490 lua_register_RoomDescriptor_array /* DB: LuaEngine::RegisterAPI calls it with "RoomDescriptor": luabridge "ArrayProxy"/"CppContainer" class with __len/__propget (element FUN_008c38a0), right before intValues */ void lua_register_RoomDescriptor_array(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("ArrayProxy",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class>::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(local_1c,FUN_008c3330,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(uVar3,FUN_008c3330,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_00899790; lua_pushcclosure(local_1c,FUN_008c5910,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 00891750 lua_register_intValues /* DB: LuaEngine::RegisterAPI calls it with "intValues": luabridge "ArrayProxy"/"CppContainer" class with __len/__propget (element FUN_008c3690) */ void lua_register_intValues(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; int in_ECX; undefined4 extraout_ECX; undefined1 local_3c [8]; undefined1 local_34 [8]; undefined1 local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04f85; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = *(undefined4 *)(in_ECX + 0x18); lua_getglobal(local_24,&DAT_00b6ea60,__security_cookie ^ (uint)(local_2c + 0x28)); local_20 = 1; local_8 = 0; FUN_0085d730("CppContainer",&local_24); FUN_0085d730("ArrayProxy",local_34); local_8._0_1_ = 2; luabridge::Namespace::Class::Class(extraout_ECX,local_2c); uVar3 = local_1c; local_8._0_1_ = 3; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,"__propget"); lua_rawget(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(local_1c,FUN_008c32d0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffc); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar3 = local_1c; uVar1 = lua_absindex(local_1c,0xfffffffe); lua_pushstring(uVar3,s_Size); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); lua_settop(local_1c,0xfffffffd); uVar3 = local_1c; puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(uVar3,FUN_008c32d0,1); lua_pushvalue(uVar3,0xffffffff); uVar1 = lua_absindex(uVar3,0xfffffffb); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); uVar1 = lua_absindex(uVar3,0xfffffffd); lua_pushstring(uVar3,"__len"); lua_rotate(uVar3,0xfffffffe,1); lua_rawset(uVar3,uVar1); puVar2 = (undefined4 *)lua_newuserdata(local_1c,4); *puVar2 = FUN_00899770; lua_pushcclosure(local_1c,FUN_008c59d0,1); lua_pushvalue(local_1c,0xffffffff); uVar3 = lua_absindex(local_1c,0xfffffffb); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); uVar3 = lua_absindex(local_1c,0xfffffffd); lua_pushstring(local_1c,s_Get); lua_rotate(local_1c,0xfffffffe,1); lua_rawset(local_1c,uVar3); FUN_0085d910(&local_1c); luabridge::Namespace::~Namespace(local_3c); local_8 = CONCAT31(local_8._1_3_,4); FUN_0085cce0(local_18); luabridge::Namespace::~Namespace(local_2c); luabridge::Namespace::~Namespace(local_34); luabridge::Namespace::~Namespace(&local_24); ExceptionList = local_10; return; } //@@ 00891a10 FUN_00891a10 undefined4 FUN_00891a10(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00891a30 FUN_00891a30 void FUN_00891a30(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5500,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891a90 FUN_00891a90 void FUN_00891a90(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5550,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891af0 FUN_00891af0 void FUN_00891af0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b55d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891b50 FUN_00891b50 void FUN_00891b50(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::CanStageHaveCurseOfLabyrinth; lua_pushcclosure(uVar1,FUN_008b5690,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CanStageHaveCurseOfLabyrinth"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891bb0 FUN_00891bb0 void FUN_00891bb0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5720,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891c10 FUN_00891c10 undefined4 * FUN_00891c10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5790,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00891cb0 FUN_00891cb0 void FUN_00891cb0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5820,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891d10 FUN_00891d10 void FUN_00891d10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetCurrentRoom; lua_pushcclosure(uVar1,FUN_008b58a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCurrentRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891d70 FUN_00891d70 undefined4 * FUN_00891d70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_00899710,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00891e10 FUN_00891e10 undefined4 * FUN_00891e10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetRandomRoomIndex; lua_pushcclosure(uVar1,FUN_008b5940,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetRandomRoomIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRandomRoomIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00891ec0 FUN_00891ec0 void FUN_00891ec0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetRoomByIdx; lua_pushcclosure(uVar1,FUN_008b59d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRoomByIdx"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891f20 FUN_00891f20 void FUN_00891f20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5aa0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00891fb0 FUN_00891fb0 undefined4 * FUN_00891fb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetRooms; lua_pushcclosure(uVar1,FUN_008b5b40,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetRooms"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRooms"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00892060 FUN_00892060 void FUN_00892060(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::QueryRoomTypeIndex; lua_pushcclosure(uVar1,FUN_008b5be0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"QueryRoomTypeIndex"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008920c0 luabridge::Namespace::Class::addProperty /* DB: luabridge Class::addProperty template instance (takes name param): rawget __propget/__propset, newuserdata(4*2) holds getter/setter, pushcclosure getter ['FUN_00899710', 'FUN_008994f0']; getter uses Stack::push 0085bfd0; RegisterAPI calls it for EnterDoor LeaveDoor DungeonReturnRoomIndex */ undefined4 * luabridge::Namespace::Class::addProperty (undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_00899710,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_008994f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00892230 FUN_00892230 undefined4 * FUN_00892230(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetEnterPosition; lua_pushcclosure(uVar1,FUN_00899670,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetEnterPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetEnterPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008922e0 luabridge::Class::addProperty_DungeonReturnPosition /* DB: luabridge addProperty clone: "DungeonReturnPosition" getter Level::DungeonReturnPosition (closure FUN_00899670) and setter FUN_0057be60 (closure FUN_008995c0); RegisterAPI Level chain */ undefined4 * luabridge::Class::addProperty_DungeonReturnPosition(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Level::DungeonReturnPosition; lua_pushcclosure(*in_ECX,FUN_00899670,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"DungeonReturnPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"DungeonReturnPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_0057be60; lua_pushcclosure(*in_ECX,FUN_008995c0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"DungeonReturnPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00892460 FUN_00892460 void FUN_00892460(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::ForceHorsemanBoss; lua_pushcclosure(uVar1,FUN_008b5690,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ForceHorsemanBoss"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008924c0 FUN_008924c0 void FUN_008924c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = EntityPtr::Ref; lua_pushcclosure(uVar1,FUN_008b5cf0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetStage"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892520 FUN_00892520 undefined4 * FUN_00892520(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b5d50,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008925c0 FUN_008925c0 void FUN_008925c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::RemoveCurses; lua_pushcclosure(uVar1,FUN_008994f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveCurses"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892620 FUN_00892620 undefined4 * FUN_00892620(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetDungeonPlacementSeed; lua_pushcclosure(uVar1,FUN_00899560,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetDungeonPlacementSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetDungeonPlacementSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008926d0 FUN_008926d0 void FUN_008926d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetDevilAngelRoomRNG; lua_pushcclosure(uVar1,FUN_008b5dc0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetDevilAngelRoomRNG"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892730 FUN_00892730 void FUN_00892730(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::CanSpawnDevilRoom; lua_pushcclosure(uVar1,FUN_008b5e60,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CanSpawnDevilRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892790 FUN_00892790 void FUN_00892790(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::InitializeDevilAngelRoom; lua_pushcclosure(uVar1,FUN_008b5ed0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"InitializeDevilAngelRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008927f0 luabridge::Class::addProperty_GreedModeWave /* DB: luabridge addProperty clone: "GreedModeWave" getter Level::GreedModeWave (closure FUN_00899560), setter FUN_00753800 (closure FUN_008994f0); RegisterAPI Level chain */ undefined4 * luabridge::Class::addProperty_GreedModeWave(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Level::GreedModeWave; lua_pushcclosure(*in_ECX,FUN_00899560,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"GreedModeWave"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeWave"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_00753800; lua_pushcclosure(*in_ECX,FUN_008994f0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GreedModeWave"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00892970 FUN_00892970 void FUN_00892970(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::AddAngelRoomChance; lua_pushcclosure(uVar1,FUN_008b5f50,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddAngelRoomChance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008929d0 FUN_008929d0 undefined4 * FUN_008929d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetAngelRoomChance; lua_pushcclosure(uVar1,FUN_008b5fe0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetAngelRoomChance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetAngelRoomChance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00892a80 FUN_00892a80 void FUN_00892a80(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::MakeRedRoomDoor; lua_pushcclosure(uVar1,FUN_008b6050,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MakeRedRoomDoor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892ae0 FUN_00892ae0 void FUN_00892ae0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetPlanetariumChance; lua_pushcclosure(uVar1,FUN_008b60e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPlanetariumChance"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892b40 FUN_00892b40 undefined4 FUN_00892b40(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00892b60 FUN_00892b60 void FUN_00892b60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::SetStartSeed; lua_pushcclosure(uVar1,FUN_008b6150,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetStartSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892bc0 FUN_00892bc0 void FUN_00892bc0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b6260,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892c20 FUN_00892c20 undefined4 * FUN_00892c20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b62b0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00892cc0 FUN_00892cc0 void FUN_00892cc0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b6320,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892d20 FUN_00892d20 undefined4 * FUN_00892d20(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b6390,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00892dc0 FUN_00892dc0 undefined4 * FUN_00892dc0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::GetStartSeedString; lua_pushcclosure(uVar1,FUN_008b63f0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetStartSeedString"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetStartSeedString"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00892e70 FUN_00892e70 void FUN_00892e70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::GetNextSeed; lua_pushcclosure(uVar1,FUN_008b64b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetNextSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892ed0 FUN_00892ed0 undefined4 * FUN_00892ed0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::GetStageSeed; lua_pushcclosure(uVar1,FUN_008b6510,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetStageSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetStageSeed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00892f80 FUN_00892f80 void FUN_00892f80(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Seeds::String2Seed; lua_pushcclosure(*in_ECX,FUN_00899440,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"String2Seed"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00892fe0 FUN_00892fe0 void FUN_00892fe0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Seeds::Seed2String; lua_pushcclosure(*in_ECX,FUN_00899390,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Seed2String"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893040 FUN_00893040 void FUN_00893040(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_008992e0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008930a0 FUN_008930a0 void FUN_008930a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Seeds::GetSeedEffect; lua_pushcclosure(*in_ECX,FUN_008991f0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetSeedEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893100 FUN_00893100 undefined4 * FUN_00893100(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::HasSeedEffect; lua_pushcclosure(uVar1,FUN_008b6590,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"HasSeedEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasSeedEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008931b0 FUN_008931b0 void FUN_008931b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::CanAddSeedEffect; lua_pushcclosure(uVar1,FUN_008b6620,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CanAddSeedEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893210 FUN_00893210 void FUN_00893210(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Seeds::IsSeedComboBanned; lua_pushcclosure(uVar1,FUN_008b66b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsSeedComboBanned"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893270 FUN_00893270 void FUN_00893270(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Seeds::InitSeedInfo; lua_pushcclosure(*in_ECX,FUN_008991d0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"InitSeedInfo"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008932d0 FUN_008932d0 void FUN_008932d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Seeds::CountUnlockedSeedEffects; lua_pushcclosure(*in_ECX,FUN_008991a0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"CountUnlockedSeedEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893330 FUN_00893330 undefined4 FUN_00893330(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00893350 FUN_00893350 void FUN_00893350(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetCollectible; lua_pushcclosure(uVar1,FUN_008b6740,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008933b0 FUN_008933b0 void FUN_008933b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::RemoveCollectible; lua_pushcclosure(uVar1,FUN_008b6840,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveCollectible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893410 FUN_00893410 void FUN_00893410(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::RemoveTrinket; lua_pushcclosure(uVar1,FUN_008b6910,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RemoveTrinket"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893470 FUN_00893470 void FUN_00893470(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b69a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008934d0 FUN_008934d0 void FUN_008934d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetTrinket; lua_pushcclosure(uVar1,FUN_008b69f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetTrinket"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893530 FUN_00893530 undefined4 * FUN_00893530(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetCard; lua_pushcclosure(uVar1,FUN_008b6a70,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetCard"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetCard"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008935e0 FUN_008935e0 undefined4 * FUN_008935e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetPill; lua_pushcclosure(uVar1,FUN_008b6b50,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetPill"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPill"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00893690 FUN_00893690 void FUN_00893690(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetPillEffect; lua_pushcclosure(uVar1,FUN_008b6bd0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPillEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008936f0 FUN_008936f0 void FUN_008936f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b6c80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893750 FUN_00893750 undefined4 * FUN_00893750(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::IsPillIdentified; lua_pushcclosure(uVar1,FUN_008b6cf0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsPillIdentified"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsPillIdentified"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00893800 FUN_00893800 void FUN_00893800(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::ForceAddPillEffect; lua_pushcclosure(uVar1,FUN_008b6d80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ForceAddPillEffect"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893860 FUN_00893860 undefined4 * FUN_00893860(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetLastPool; lua_pushcclosure(uVar1,FUN_008b6e00,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetLastPool"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLastPool"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00893910 FUN_00893910 undefined4 * FUN_00893910(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::GetPoolForRoom; lua_pushcclosure(uVar1,FUN_008b6e60,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetPoolForRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPoolForRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008939c0 FUN_008939c0 void FUN_008939c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = ItemPool::AddBibleUpgrade; lua_pushcclosure(uVar1,FUN_008b6ef0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddBibleUpgrade"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893a20 FUN_00893a20 undefined4 FUN_00893a20(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00893a40 FUN_00893a40 void FUN_00893a40(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b6f70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893aa0 FUN_00893aa0 void FUN_00893aa0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = HUD::InvalidateCraftingItem; lua_pushcclosure(uVar1,FUN_008b7010,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"InvalidateCraftingItem"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893b00 FUN_00893b00 undefined4 * FUN_00893b00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = HUD::IsVisible; lua_pushcclosure(uVar1,FUN_008b70c0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsVisible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsVisible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00893bb0 FUN_00893bb0 void FUN_00893bb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = HUD::SetVisible; lua_pushcclosure(uVar1,FUN_008b7130,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetVisible"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893c10 FUN_00893c10 void FUN_00893c10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b71a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893c70 FUN_00893c70 undefined4 FUN_00893c70(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00893c90 FUN_00893c90 void FUN_00893c90(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b71f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893cf0 FUN_00893cf0 undefined4 * FUN_00893cf0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b7240,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00893d90 FUN_00893d90 void FUN_00893d90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::Spawn; lua_pushcclosure(uVar1,luabridge::CFunc::CallMember::f,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,s_Spawn); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893df0 FUN_00893df0 void FUN_00893df0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::SpawnEntityDesc; lua_pushcclosure(uVar1,&LAB_008b7500,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SpawnEntityDesc"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893e50 FUN_00893e50 void FUN_00893e50(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::BombDamage; lua_pushcclosure(uVar1,luabridge::CFunc::CallMember::f,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"BombDamage"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893eb0 FUN_00893eb0 void FUN_00893eb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::BombExplosionEffects; lua_pushcclosure(uVar1,luabridge::CFunc::CallMember::f,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"BombExplosionEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893f10 FUN_00893f10 void FUN_00893f10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::BombTearflagEffects; lua_pushcclosure(uVar1,FUN_008b7b70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"BombTearflagEffects"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893f70 FUN_00893f70 void FUN_00893f70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::Fart; lua_pushcclosure(uVar1,FUN_008b7d30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b1deb4); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00893fe0 FUN_00893fe0 void FUN_00893fe0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::CharmFart; lua_pushcclosure(uVar1,&LAB_008b7eb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"CharmFart"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894040 FUN_00894040 void FUN_00894040(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::ButterBeanFart; lua_pushcclosure(uVar1,&LAB_008b7fb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"ButterBeanFart"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008940a0 FUN_008940a0 void FUN_008940a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::RerollEnemy; lua_pushcclosure(uVar1,FUN_008b80f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RerollEnemy"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894100 FUN_00894100 void FUN_00894100(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::SpawnParticles; lua_pushcclosure(uVar1,FUN_008b81b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SpawnParticles"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894160 FUN_00894160 void FUN_00894160(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetFont; lua_pushcclosure(uVar1,FUN_008b82d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetFont"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008941c0 FUN_008941c0 void FUN_008941c0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Config::GetCollectibles; lua_pushcclosure(uVar1,FUN_008b8370,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetLevel"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894220 FUN_00894220 void FUN_00894220(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Level::GetCurrentRoom; lua_pushcclosure(uVar1,FUN_008b8410,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894280 FUN_00894280 void FUN_00894280(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetPlayer; lua_pushcclosure(uVar1,FUN_008b84b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008942e0 FUN_008942e0 void FUN_008942e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetNearestPlayer; lua_pushcclosure(uVar1,FUN_008b8570,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetNearestPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894340 FUN_00894340 void FUN_00894340(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetRandomPlayer; lua_pushcclosure(uVar1,FUN_008b8640,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetRandomPlayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008943a0 FUN_008943a0 undefined4 * FUN_008943a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b8740,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00894440 FUN_00894440 void FUN_00894440(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetItemPool; lua_pushcclosure(uVar1,FUN_008b87a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetItemPool"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008944a0 FUN_008944a0 void FUN_008944a0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetItemOverlay; lua_pushcclosure(uVar1,FUN_008b8840,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetItemOverlay"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894500 FUN_00894500 void FUN_00894500(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetHUD; lua_pushcclosure(uVar1,FUN_008b88e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetHUD"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894560 FUN_00894560 void FUN_00894560(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetSeeds; lua_pushcclosure(uVar1,FUN_008b8980,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetSeeds"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008945c0 FUN_008945c0 void FUN_008945c0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008990d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894620 FUN_00894620 void FUN_00894620(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::StartRoomTransition; lua_pushcclosure(uVar1,&LAB_008b8a20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"StartRoomTransition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894680 FUN_00894680 void FUN_00894680(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b8b30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008946e0 FUN_008946e0 void FUN_008946e0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::StartStageTransition; lua_pushcclosure(uVar1,FUN_008b8bb0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"StartStageTransition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894740 FUN_00894740 void FUN_00894740(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::MoveToRandomRoom; lua_pushcclosure(uVar1,FUN_008b8c30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MoveToRandomRoom"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008947a0 FUN_008947a0 undefined4 * FUN_008947a0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_00899140,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00894840 FUN_00894840 undefined4 * FUN_00894840(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetStateFlag; lua_pushcclosure(uVar1,FUN_008b8ce0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetStateFlag"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetStateFlag"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 008948f0 FUN_008948f0 void FUN_008948f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::SetStateFlag; lua_pushcclosure(uVar1,FUN_008b8d70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetStateFlag"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894950 luabridge::Namespace::Class::addProperty /* DB: luabridge Class::addProperty template instance (takes name param): rawget __propget/__propset, newuserdata(4*2) holds getter/setter, pushcclosure getter ['FUN_00899140', 'FUN_008990d0']; getter closure uses Stack::push 0085bfd0 (CDQ); RegisterAPI calls it for BossRushParTime BlueWombParTime Challenge */ undefined4 * luabridge::Namespace::Class::addProperty (undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_00899140,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_3; lua_pushcclosure(*in_ECX,FUN_008990d0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00894ac0 FUN_00894ac0 undefined4 * FUN_00894ac0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b8df0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00894b60 FUN_00894b60 void FUN_00894b60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::AddEncounteredBoss; lua_pushcclosure(uVar1,FUN_008b8b30,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"AddEncounteredBoss"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894bc0 FUN_00894bc0 void FUN_00894bc0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetNumEncounteredBosses; lua_pushcclosure(uVar1,FUN_008b8e80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetNumEncounteredBosses"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894c20 FUN_00894c20 void FUN_00894c20(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::HasEncounteredBoss; lua_pushcclosure(uVar1,FUN_008b8ee0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"HasEncounteredBoss"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894c80 luabridge::Class::addProperty_ScreenShakeOffset /* DB: luabridge addProperty clone: "ScreenShakeOffset" getter Game::ScreenShakeOffset (closure FUN_00899030), setter FUN_007e92e0 (closure FUN_00898f80); RegisterAPI Game chain */ undefined4 * luabridge::Class::addProperty_ScreenShakeOffset(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Game::ScreenShakeOffset; lua_pushcclosure(*in_ECX,FUN_00899030,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"ScreenShakeOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ScreenShakeOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = FUN_007e92e0; lua_pushcclosure(*in_ECX,FUN_00898f80,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ScreenShakeOffset"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00894e00 FUN_00894e00 undefined4 * FUN_00894e00(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetScreenShakeCountdown; lua_pushcclosure(uVar1,FUN_008b8f70,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"GetScreenShakeCountdown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetScreenShakeCountdown"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00894eb0 FUN_00894eb0 void FUN_00894eb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::Darken; lua_pushcclosure(uVar1,FUN_008b8fe0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Darken"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894f10 FUN_00894f10 void FUN_00894f10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b9070,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00894f70 FUN_00894f70 undefined4 * FUN_00894f70(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Game::Difficulty; lua_pushcclosure(*in_ECX,FUN_00899140,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"Difficulty"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Difficulty"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); return in_ECX; } //@@ 00895070 FUN_00895070 void FUN_00895070(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::RerollLevelPickups; lua_pushcclosure(uVar1,FUN_008990d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"RerollLevelPickups"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008950d0 FUN_008950d0 void FUN_008950d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::UpdateStrangeAttractor; lua_pushcclosure(uVar1,&LAB_008b90e0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"UpdateStrangeAttractor"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895130 FUN_00895130 void FUN_00895130(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::GetAmbush; lua_pushcclosure(uVar1,FUN_008b91d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetAmbush"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895190 FUN_00895190 void FUN_00895190(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::Fadein; lua_pushcclosure(uVar1,FUN_008b9270,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Fadein"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008951f0 FUN_008951f0 void FUN_008951f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::Fadeout; lua_pushcclosure(uVar1,FUN_008b9380,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Fadeout"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895250 FUN_00895250 void FUN_00895250(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Game::MakeShockwave; lua_pushcclosure(uVar1,&LAB_008b9490,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"MakeShockwave"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008952b0 luabridge::Class::addData_TimeCounter /* DB: luabridge addData clone: "TimeCounter" on +0x264fc (FUN_008c2850/008c28b0, db/fields Game 0x264fc); RegisterAPI Game chain */ undefined4 * luabridge::Class::addData_TimeCounter(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x264fc; lua_pushcclosure(*in_ECX,FUN_008c2850,1); lua_pushvalue(*in_ECX,0xffffffff); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"TimeCounter"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TimeCounter"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffd); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = 0x264fc; lua_pushcclosure(*in_ECX,FUN_008c28b0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"TimeCounter"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00895430 FUN_00895430 undefined4 FUN_00895430(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00895450 FUN_00895450 void FUN_00895450(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = SoundEffects::Play; lua_pushcclosure(uVar1,&LAB_008b95a0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b70498); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008954b0 FUN_008954b0 void FUN_008954b0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b96d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895510 FUN_00895510 void FUN_00895510(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b9760,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895570 FUN_00895570 void FUN_00895570(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = SFXManager::StopLoopingSounds; lua_pushcclosure(uVar1,FUN_008b97d0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"StopLoopingSounds"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008955d0 FUN_008955d0 void FUN_008955d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = SFXManager::IsPlaying; lua_pushcclosure(uVar1,FUN_008b9820,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsPlaying"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895630 FUN_00895630 void FUN_00895630(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = SFXManager::SetAmbientSound; lua_pushcclosure(uVar1,FUN_008b98b0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"SetAmbientSound"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895690 FUN_00895690 void FUN_00895690(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = SFXManager::GetAmbientSoundVolume; lua_pushcclosure(uVar1,FUN_008b9950,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"GetAmbientSoundVolume"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008956f0 FUN_008956f0 undefined4 FUN_008956f0(undefined4 param_1) { undefined4 in_ECX; luabridge::Namespace::Class::Class(in_ECX,in_ECX); return param_1; } //@@ 00895710 FUN_00895710 void FUN_00895710(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Music::Play; lua_pushcclosure(uVar1,FUN_008b99f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,&DAT_00b70498); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895770 FUN_00895770 void FUN_00895770(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = MusicManager::Crossfade; lua_pushcclosure(uVar1,FUN_008b99f0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Crossfade"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008957d0 FUN_008957d0 void FUN_008957d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Music::Fadein; lua_pushcclosure(uVar1,FUN_008b9a80,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"Fadein"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895830 FUN_00895830 void FUN_00895830(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b9b20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895890 FUN_00895890 void FUN_00895890(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b9b90,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008958f0 FUN_008958f0 void FUN_008958f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b9c20,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895950 FUN_00895950 void FUN_00895950(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = MusicManager::EnableLayer; lua_pushcclosure(uVar1,FUN_008b9c70,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"EnableLayer"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008959b0 FUN_008959b0 undefined4 * FUN_008959b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Music::IsLayerEnabled; lua_pushcclosure(uVar1,FUN_008b9cf0,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsLayerEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsLayerEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00895a60 FUN_00895a60 undefined4 * FUN_00895a60(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = MusicManager::IsEnabled; lua_pushcclosure(uVar1,FUN_008b9d80,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,"IsEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"IsEnabled"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00895b10 FUN_00895b10 void FUN_00895b10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = Music::VolumeSlide; lua_pushcclosure(uVar1,FUN_008b9df0,1); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,"VolumeSlide"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895b70 FUN_00895b70 undefined4 * FUN_00895b70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(uVar1,4); *puVar2 = param_2; lua_pushcclosure(uVar1,FUN_008b9e80,1); lua_pushvalue(uVar1,0xffffffff); uVar3 = lua_absindex(uVar1,0xfffffffb); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar3 = lua_absindex(uVar1,0xfffffffd); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return in_ECX; } //@@ 00895c10 FUN_00895c10 void FUN_00895c10(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00898f50,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895c70 FUN_00895c70 void FUN_00895c70(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00898ee0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895cd0 FUN_00895cd0 void FUN_00895cd0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = MusicManager::Game_0; lua_pushcclosure(*in_ECX,FUN_00898e70,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Game_0"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895d30 FUN_00895d30 void FUN_00895d30(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = MusicManager::SFXManager; lua_pushcclosure(*in_ECX,FUN_00898e00,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SFXManager"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895d90 FUN_00895d90 void FUN_00895d90(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = MusicManager::MusicManager; lua_pushcclosure(*in_ECX,FUN_00898d90,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"MusicManager"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895df0 FUN_00895df0 void FUN_00895df0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00898cf0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895e50 FUN_00895e50 void FUN_00895e50(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_008991a0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895eb0 FUN_00895eb0 void FUN_00895eb0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::Spawn; lua_pushcclosure(*in_ECX,&LAB_00898c00,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s_Spawn); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895f10 FUN_00895f10 void FUN_00895f10(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::GridSpawn; lua_pushcclosure(*in_ECX,&LAB_00898ae0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GridSpawn"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895f70 FUN_00895f70 void FUN_00895f70(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::RenderText; lua_pushcclosure(*in_ECX,luabridge::CFunc::Call::f,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"RenderText"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00895fd0 FUN_00895fd0 void FUN_00895fd0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::RenderScaledText; lua_pushcclosure(*in_ECX,FUN_008986d0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"RenderScaledText"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896030 FUN_00896030 void FUN_00896030(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::GetTextWidth; lua_pushcclosure(*in_ECX,FUN_00899440,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetTextWidth"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896090 FUN_00896090 void FUN_00896090(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::GetFreeNearPosition; lua_pushcclosure(*in_ECX,FUN_00898600,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetFreeNearPosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008960f0 FUN_008960f0 void FUN_008960f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::Explode; lua_pushcclosure(*in_ECX,&LAB_00898530,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Explode"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896150 FUN_00896150 void FUN_00896150(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::AddPillEffectToPool; lua_pushcclosure(*in_ECX,FUN_008984e0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"AddPillEffectToPool"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008961b0 FUN_008961b0 void FUN_008961b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::GetRoomEntities; lua_pushcclosure(*in_ECX,FUN_00898490,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetRoomEntities"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896210 FUN_00896210 void FUN_00896210(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_008983e0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896270 FUN_00896270 void FUN_00896270(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::GetPlayerTypeByName; lua_pushcclosure(*in_ECX,FUN_008982a0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetPlayerTypeByName"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008962d0 FUN_008962d0 void FUN_008962d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::ExecuteCommand; lua_pushcclosure(*in_ECX,FUN_008981b0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"ExecuteCommand"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896330 FUN_00896330 void FUN_00896330(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::GetItemConfig; lua_pushcclosure(*in_ECX,FUN_00898140,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetItemConfig"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896390 FUN_00896390 void FUN_00896390(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::RegisterMod; lua_pushcclosure(*in_ECX,FUN_00897f50,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"RegisterMod"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008963f0 FUN_008963f0 void FUN_008963f0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::SetBuiltInCallbackState; lua_pushcclosure(*in_ECX,FUN_00897f00,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SetBuiltInCallbackState"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896450 FUN_00896450 void FUN_00896450(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_0089e300,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008964b0 FUN_008964b0 void FUN_008964b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::SaveModData; lua_pushcclosure(*in_ECX,FUN_00897d50,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"SaveModData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896510 FUN_00896510 void FUN_00896510(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::LoadModData; lua_pushcclosure(*in_ECX,FUN_00897c00,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"LoadModData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896570 FUN_00896570 void FUN_00896570(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::HasModData; lua_pushcclosure(*in_ECX,FUN_00897b00,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"HasModData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008965d0 FUN_008965d0 void FUN_008965d0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Isaac::RemoveModData; lua_pushcclosure(*in_ECX,FUN_00897a10,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"RemoveModData"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896630 FUN_00896630 void FUN_00896630(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00897970,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896690 FUN_00896690 void FUN_00896690(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00897930,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008966f0 FUN_008966f0 void FUN_008966f0(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_008978d0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896750 FUN_00896750 void FUN_00896750(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = param_2; lua_pushcclosure(*in_ECX,FUN_00897870,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 008967b0 FUN_008967b0 void FUN_008967b0(void) { undefined4 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; puVar2 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar2 = Input::GetMousePosition; lua_pushcclosure(*in_ECX,FUN_008977f0,1); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"GetMousePosition"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); return; } //@@ 00896810 Options::MusicVolume /* ZHL [lua] Lua binding Options:MusicVolume */ float10 Options::MusicVolume(void) { return (float10)(g_manager->_optionsConfig)._musicVolume; } //@@ 00896820 FUN_00896820 void FUN_00896820(float param_1) { Manager *pMVar1; float *pfVar2; float fVar3; float local_8; pMVar1 = g_manager; local_8 = 0.0; pfVar2 = &local_8; if (0.0 <= param_1) { pfVar2 = ¶m_1; } fVar3 = *pfVar2; if (0.01 < fVar3) { fVar3 = 0.01; } (g_manager->_optionsConfig)._musicVolume = fVar3; (pMVar1->_musicManager)._isEnabled = 0.0 < fVar3; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._volume = (pMVar1->_optionsConfig)._musicVolume; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._targetVolume = (pMVar1->_optionsConfig)._musicVolume; return; } //@@ 008968b0 FUN_008968b0 undefined4 * FUN_008968b0(undefined4 param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; int *piVar4; undefined4 *in_ECX; code *pcVar5; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_00897930,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); if (param_3 == 0) { lua_pushstring(*in_ECX,param_1); pcVar5 = luabridge::CFunc::readOnlyError; } else { piVar4 = (int *)lua_newuserdata(*in_ECX,4); pcVar5 = FUN_008977a0; *piVar4 = param_3; } lua_pushcclosure(*in_ECX,pcVar5,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 008969e0 Options::SFXVolume /* ZHL [lua] Lua binding Options:SFXVolume */ float10 Options::SFXVolume(void) { return (float10)(g_manager->_optionsConfig)._sfxVolume; } //@@ 008969f0 FUN_008969f0 void FUN_008969f0(float param_1) { Manager *pMVar1; float *pfVar2; float *pfVar3; float local_c; float local_8; pMVar1 = g_manager; local_8 = 0.0; local_c = 0.01; pfVar3 = &local_8; if (0.0 <= param_1) { pfVar3 = ¶m_1; } pfVar2 = &local_c; if (*pfVar3 <= 0.01) { pfVar2 = pfVar3; } (g_manager->_optionsConfig)._sfxVolume = *pfVar2; SoundEffects::ClearVolumeModifier(&pMVar1->_sfxManager); return; } //@@ 00896a50 Options::MapOpacity /* ZHL [lua] Lua binding Options:MapOpacity */ float10 Options::MapOpacity(void) { return (float10)(g_manager->_optionsConfig)._mapOpacity; } //@@ 00896a60 FUN_00896a60 void FUN_00896a60(float param_1) { float *pfVar1; float *pfVar2; float local_c; float local_8; local_8 = 0.0; pfVar1 = &local_8; if (0.0 <= param_1) { pfVar1 = ¶m_1; } pfVar2 = &local_c; if (*pfVar1 <= 0.01) { pfVar2 = pfVar1; } (g_manager->_optionsConfig)._mapOpacity = *pfVar2; return; } //@@ 00896ab0 Options::Fullscreen /* ZHL [lua] Lua binding Options:Fullscreen */ undefined4 Options::Fullscreen(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._isFullscreen); } //@@ 00896ac0 FUN_00896ac0 void FUN_00896ac0(byte param_1) { OptionsConfig::set_fullscreen(&g_manager->_optionsConfig,param_1); return; } //@@ 00896ae0 FUN_00896ae0 undefined4 * FUN_00896ae0(undefined4 param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; int *piVar4; undefined4 *in_ECX; code *pcVar5; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_00897770,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); if (param_3 == 0) { lua_pushstring(*in_ECX,param_1); pcVar5 = luabridge::CFunc::readOnlyError; } else { piVar4 = (int *)lua_newuserdata(*in_ECX,4); pcVar5 = FUN_00897730; *piVar4 = param_3; } lua_pushcclosure(*in_ECX,pcVar5,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00896c10 Options::Filter /* ZHL [lua] Lua binding Options:Filter */ undefined4 Options::Filter(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._filterEnabled); } //@@ 00896c20 FUN_00896c20 void FUN_00896c20(byte param_1) { (g_manager->_optionsConfig)._filterEnabled = param_1; return; } //@@ 00896c40 Options::Gamma /* ZHL [lua] Lua binding Options:Gamma */ float10 Options::Gamma(void) { return (float10)(g_manager->_optionsConfig)._gamma; } //@@ 00896c50 FUN_00896c50 void FUN_00896c50(float param_1) { float *pfVar1; float *pfVar2; float local_c; float local_8; local_8 = 0.5; pfVar1 = &local_8; if (0.5 <= param_1) { pfVar1 = ¶m_1; } pfVar2 = &local_c; if (*pfVar1 <= 1.5) { pfVar2 = pfVar1; } (g_manager->_optionsConfig)._gamma = *pfVar2; return; } //@@ 00896ca0 Options::DisplayPopups /* ZHL [lua] Lua binding Options:DisplayPopups */ int Options::DisplayPopups(void) { return (g_manager->_optionsConfig)._popupsMode; } //@@ 00896cb0 FUN_00896cb0 void FUN_00896cb0(int param_1) { int *piVar1; int *piVar2; int local_c [2]; local_c[1] = 0; piVar1 = local_c + 1; if (-1 < param_1) { piVar1 = ¶m_1; } piVar2 = local_c; if (*piVar1 < 3) { piVar2 = piVar1; } (g_manager->_optionsConfig)._popupsMode = *piVar2; return; } //@@ 00896cf0 FUN_00896cf0 undefined4 * FUN_00896cf0(undefined4 param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; int *piVar4; undefined4 *in_ECX; code *pcVar5; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_008991a0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); if (param_3 == 0) { lua_pushstring(*in_ECX,param_1); pcVar5 = luabridge::CFunc::readOnlyError; } else { piVar4 = (int *)lua_newuserdata(*in_ECX,4); pcVar5 = FUN_008976f0; *piVar4 = param_3; } lua_pushcclosure(*in_ECX,pcVar5,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00896e20 Options::CameraStyle /* ZHL [lua] Lua binding Options:CameraStyle */ int Options::CameraStyle(void) { return (g_manager->_optionsConfig)._cameraStyle; } //@@ 00896e30 FUN_00896e30 void FUN_00896e30(int param_1) { int *piVar1; int *piVar2; int local_c [2]; local_c[1] = 1; piVar1 = local_c + 1; if (0 < param_1) { piVar1 = ¶m_1; } piVar2 = local_c; if (*piVar1 < 3) { piVar2 = piVar1; } (g_manager->_optionsConfig)._cameraStyle = *piVar2; return; } //@@ 00896e70 Options::ExtraHUDStyle /* ZHL [lua] Lua binding Options:ExtraHUDStyle */ int Options::ExtraHUDStyle(void) { return (g_manager->_optionsConfig)._historyHudMode; } //@@ 00896e80 FUN_00896e80 void FUN_00896e80(int param_1) { int *piVar1; int *piVar2; int local_c [2]; local_c[1] = 0; piVar1 = local_c + 1; if (-1 < param_1) { piVar1 = ¶m_1; } piVar2 = local_c; if (*piVar1 < 3) { piVar2 = piVar1; } (g_manager->_optionsConfig)._historyHudMode = *piVar2; return; } //@@ 00896ec0 Options::HUDOffset /* ZHL [lua] Lua binding Options:HUDOffset */ float10 Options::HUDOffset(void) { return (float10)(g_manager->_optionsConfig)._hudOffset; } //@@ 00896ed0 FUN_00896ed0 void FUN_00896ed0(float param_1) { float *pfVar1; float *pfVar2; float local_c; float local_8; local_8 = 0.0; pfVar1 = &local_8; if (0.0 <= param_1) { pfVar1 = ¶m_1; } pfVar2 = &local_c; if (*pfVar1 <= 0.01) { pfVar2 = pfVar1; } (g_manager->_optionsConfig)._hudOffset = *pfVar2; return; } //@@ 00896f20 Options::FoundHUD /* ZHL [lua] Lua binding Options:FoundHUD */ undefined4 Options::FoundHUD(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableFoundHUD); } //@@ 00896f30 FUN_00896f30 void FUN_00896f30(byte param_1) { (g_manager->_optionsConfig)._enableFoundHUD = param_1; return; } //@@ 00896f50 Options::RumbleEnabled /* ZHL [lua] Lua binding Options:RumbleEnabled */ undefined4 Options::RumbleEnabled(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableRumble); } //@@ 00896f60 FUN_00896f60 void FUN_00896f60(byte param_1) { (g_manager->_optionsConfig)._enableRumble = param_1; return; } //@@ 00896f80 Options::ChargeBars /* ZHL [lua] Lua binding Options:ChargeBars */ undefined4 Options::ChargeBars(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableChargeBars); } //@@ 00896f90 FUN_00896f90 void FUN_00896f90(byte param_1) { (g_manager->_optionsConfig)._enableChargeBars = param_1; return; } //@@ 00896fb0 Options::BulletVisibility /* ZHL [lua] Lua binding Options:BulletVisibility */ undefined4 Options::BulletVisibility(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableBulletVisibility); } //@@ 00896fc0 FUN_00896fc0 void FUN_00896fc0(byte param_1) { (g_manager->_optionsConfig)._enableBulletVisibility = param_1; return; } //@@ 00896fe0 Options::VSync /* ZHL [lua] Lua binding Options:VSync */ undefined4 Options::VSync(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableVSync); } //@@ 00896ff0 FUN_00896ff0 void FUN_00896ff0(undefined4 param_1) { OptionsConfig::set_vsync(&g_manager->_optionsConfig,param_1); return; } //@@ 00897010 Options::PauseOnFocusLost /* ZHL [lua] Lua binding Options:PauseOnFocusLost */ undefined4 Options::PauseOnFocusLost(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enablePauseOnFocusLost); } //@@ 00897020 FUN_00897020 void FUN_00897020(byte param_1) { (g_manager->_optionsConfig)._enablePauseOnFocusLost = param_1; return; } //@@ 00897040 Options::MouseControl /* ZHL [lua] Lua binding Options:MouseControl */ undefined4 Options::MouseControl(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableMouseControl); } //@@ 00897050 FUN_00897050 void FUN_00897050(byte param_1) { (g_manager->_optionsConfig)._enableMouseControl = param_1; glfwSetInputMode(g_glfwWindow,param_1 + 0x34001); return; } //@@ 00897080 Options::AnnouncerVoiceMode /* ZHL [lua] Lua binding Options:AnnouncerVoiceMode */ int Options::AnnouncerVoiceMode(void) { return (g_manager->_optionsConfig)._announcerVoiceMode; } //@@ 00897090 FUN_00897090 void FUN_00897090(int param_1) { int *piVar1; int *piVar2; int local_c [2]; local_c[1] = 0; piVar1 = local_c + 1; if (-1 < param_1) { piVar1 = ¶m_1; } piVar2 = local_c; if (*piVar1 < 3) { piVar2 = piVar1; } (g_manager->_optionsConfig)._announcerVoiceMode = *piVar2; return; } //@@ 008970d0 Options::MaxScale /* ZHL [lua] Lua binding Options:MaxScale */ int Options::MaxScale(void) { return (g_manager->_optionsConfig)._maxScale; } //@@ 008970e0 FUN_008970e0 void FUN_008970e0(uint param_1) { uint *puVar1; uint *puVar2; uint local_c [2]; local_c[1] = 1; puVar1 = local_c + 1; if (param_1 != 0) { puVar1 = ¶m_1; } puVar2 = local_c; if (*puVar1 < 100) { puVar2 = puVar1; } (g_manager->_optionsConfig)._maxScale = *puVar2; return; } //@@ 00897120 FUN_00897120 undefined4 * FUN_00897120(undefined4 param_1,undefined4 param_2,int param_3) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; int *piVar4; undefined4 *in_ECX; code *pcVar5; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = param_2; lua_pushcclosure(*in_ECX,FUN_00898f50,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); if (param_3 == 0) { lua_pushstring(*in_ECX,param_1); pcVar5 = luabridge::CFunc::readOnlyError; } else { piVar4 = (int *)lua_newuserdata(*in_ECX,4); pcVar5 = FUN_008976f0; *piVar4 = param_3; } lua_pushcclosure(*in_ECX,pcVar5,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,param_1); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00897250 Options::MaxRenderScale /* ZHL [lua] Lua binding Options:MaxRenderScale */ int Options::MaxRenderScale(void) { return (g_manager->_optionsConfig)._maxRenderScale; } //@@ 00897260 FUN_00897260 void FUN_00897260(uint param_1) { uint *puVar1; uint *puVar2; uint local_c [2]; local_c[1] = 1; puVar1 = local_c + 1; if (param_1 != 0) { puVar1 = ¶m_1; } puVar2 = local_c; if (*puVar1 < 100) { puVar2 = puVar1; } (g_manager->_optionsConfig)._maxRenderScale = *puVar2; return; } //@@ 008972a0 Options::ConsoleFont /* ZHL [lua] Lua binding Options:ConsoleFont */ int Options::ConsoleFont(void) { return (g_manager->_optionsConfig)._consoleFont; } //@@ 008972b0 FUN_008972b0 void FUN_008972b0(uint param_1) { if (2 < param_1) { param_1 = 2; } (g_manager->_optionsConfig)._consoleFont = param_1; return; } //@@ 008972d0 Options::FadedConsoleDisplay /* ZHL [lua] Lua binding Options:FadedConsoleDisplay */ undefined4 Options::FadedConsoleDisplay(void) { return CONCAT31((int3)((uint)g_manager >> 8), (g_manager->_optionsConfig)._enableFadedConsoleDisplay); } //@@ 008972e0 FUN_008972e0 void FUN_008972e0(byte param_1) { (g_manager->_optionsConfig)._enableFadedConsoleDisplay = param_1; return; } //@@ 00897300 Options::SaveCommandHistory /* ZHL [lua] Lua binding Options:SaveCommandHistory */ undefined4 Options::SaveCommandHistory(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableSaveCommandHistory ); } //@@ 00897310 FUN_00897310 void FUN_00897310(byte param_1) { (g_manager->_optionsConfig)._enableSaveCommandHistory = param_1; return; } //@@ 00897330 Options::UseBorderlessFullscreen /* ZHL [lua] Lua binding Options:UseBorderlessFullscreen */ undefined4 Options::UseBorderlessFullscreen(void) { return CONCAT31((int3)((uint)g_manager >> 8), (g_manager->_optionsConfig)._enableBorderlessFullscreen == 0); } //@@ 00897340 FUN_00897340 void FUN_00897340(byte param_1) { (g_manager->_optionsConfig)._enableBorderlessFullscreen = param_1 ^ 1; return; } //@@ 00897360 Options::DebugConsoleEnabled /* ZHL [lua] Lua binding Options:DebugConsoleEnabled */ undefined4 Options::DebugConsoleEnabled(void) { return CONCAT31((int3)((uint)g_manager >> 8),(g_manager->_optionsConfig)._enableDebugConsole); } //@@ 00897370 FUN_00897370 void FUN_00897370(byte param_1) { (g_manager->_optionsConfig)._enableDebugConsole = param_1; return; } //@@ 00897390 Options::JacobEsauControls /* ZHL [lua] Lua binding Options:JacobEsauControls */ int Options::JacobEsauControls(void) { return (g_manager->_optionsConfig)._jacobEsauControls; } //@@ 008973a0 FUN_008973a0 void FUN_008973a0(int param_1) { int *piVar1; int *piVar2; int local_c [2]; local_c[1] = 0; piVar1 = local_c + 1; if (-1 < param_1) { piVar1 = ¶m_1; } piVar2 = local_c; if (*piVar1 < 2) { piVar2 = piVar1; } (g_manager->_optionsConfig)._jacobEsauControls = *piVar2; return; } //@@ 008973e0 FUN_008973e0 undefined4 * FUN_008973e0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *in_ECX; uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propget"); lua_rawget(uVar1,uVar2); puVar3 = (undefined4 *)lua_newuserdata(*in_ECX,4); *puVar3 = Options::Language; lua_pushcclosure(*in_ECX,FUN_008976a0,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Language"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__propset"); lua_rawget(uVar1,uVar2); lua_pushstring(*in_ECX,"Language"); lua_pushcclosure(*in_ECX,luabridge::CFunc::readOnlyError,1); uVar1 = *in_ECX; uVar2 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"Language"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar2); lua_settop(*in_ECX,0xfffffffe); return in_ECX; } //@@ 00897500 FUN_00897500 undefined4 FUN_00897500(void) { void *luaState; undefined4 uVar1; undefined4 *in_ECX; luaState = (void *)*in_ECX; LuaRef::push(in_ECX,luaState); uVar1 = lua_gettop(*in_ECX); uVar1 = luaL_checkinteger(*in_ECX,uVar1); lua_settop(luaState,0xfffffffe); return uVar1; } //@@ 00897540 LuaRef::equals /* DB: rawgeti self ref (ECX[0]=L, ECX[1]=ref) from the registry, pushes the other LuaRef, lua_compare(EQ), pops, luaL_unref(param_2); Isaac::HasModData/SaveModData compare mod refs prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall LuaRef::equals(void *this,void *otherState,int otherRef) { undefined4 uVar1; int iVar2; uVar1 = *(undefined4 *)this; lua_rawgeti(uVar1,0xfff0b9d8,*(int *)((int)this + 4),*(int *)((int)this + 4) >> 0x1f); push(&otherState,*(void **)this); iVar2 = lua_compare(*(undefined4 *)this,0xfffffffe,0xffffffff,0); lua_settop(uVar1,0xfffffffd); luaL_unref(otherState,0xfff0b9d8,otherRef); return iVar2 == 1; } //@@ 008975b0 FUN_008975b0 void FUN_008975b0(undefined4 param_1,undefined4 param_2) { FUN_00652a00(param_2); return; } //@@ 008975d0 FUN_008975d0 void FUN_008975d0(void) { undefined4 *puVar1; undefined4 *ptr; undefined4 *in_EDX; *(undefined4 *)in_EDX[1] = 0; ptr = (undefined4 *)*in_EDX; while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; std::string::_Tidy_deallocate((char *)(ptr + 0xe)); std::string::_Tidy_deallocate((char *)(ptr + 8)); std::string::_Tidy_deallocate((char *)(ptr + 2)); operator_delete(ptr,0x58); ptr = puVar1; } return; } //@@ 00897620 FUN_00897620 void FUN_00897620(int param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04fbd; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1,uVar1); local_8 = 0; *in_ECX = luabridge::LuaException::vftable; in_ECX[3] = *(undefined4 *)(param_1 + 0xc); std::string::string((char *)(in_ECX + 4),(void *)(param_1 + 0x10)); ExceptionList = local_10; return; } //@@ 008976a0 FUN_008976a0 undefined4 FUN_008976a0(undefined4 param_1) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = (*(code *)*puVar1)(); if (iVar2 == 0) { lua_pushnil(param_1); return 1; } lua_pushstring(param_1,iVar2); return 1; } //@@ 008976f0 FUN_008976f0 undefined4 FUN_008976f0(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar2 = luaL_checkinteger(param_1,1); (*(code *)*puVar1)(uVar2); return 0; } //@@ 00897730 FUN_00897730 undefined4 FUN_00897730(undefined4 param_1) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,1); (*(code *)*puVar1)(iVar2 != 0); return 0; } //@@ 00897770 FUN_00897770 undefined4 FUN_00897770(undefined4 param_1) { char cVar1; undefined4 *puVar2; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar2)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008977a0 FUN_008977a0 undefined4 FUN_008977a0(undefined4 param_1) { undefined4 *puVar1; float10 fVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar2 = (float10)luaL_checknumber(param_1,1); (*(code *)*puVar1)((float)fVar2); return 0; } //@@ 008977f0 FUN_008977f0 undefined4 FUN_008977f0(undefined4 param_1) { undefined4 *puVar1; int iVar2; undefined4 local_c; undefined4 local_8; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,1); local_8 = CONCAT31(local_8._1_3_,iVar2 != 0); (*(code *)*puVar1)(&local_c,local_8); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; *puVar1 = local_c; puVar1[1] = local_8; return 1; } //@@ 00897870 FUN_00897870 undefined4 FUN_00897870(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar2 = luaL_checkinteger(param_1,2); uVar3 = luaL_checkinteger(param_1,1); (*(code *)*puVar1)(uVar3,uVar2); FUN_0085c050(); return 1; } //@@ 008978d0 FUN_008978d0 undefined4 FUN_008978d0(undefined4 param_1) { char cVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); uVar4 = luaL_checkinteger(param_1,1); cVar1 = (*(code *)*puVar2)(uVar4,uVar3); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 00897930 FUN_00897930 undefined4 FUN_00897930(undefined4 param_1) { undefined4 *puVar1; float10 fVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar2 = (float10)(*(code *)*puVar1)(); FUN_0085c050((float)fVar2); return 1; } //@@ 00897970 FUN_00897970 undefined4 FUN_00897970(undefined4 param_1) { undefined4 *puVar1; undefined8 *puVar2; undefined8 local_18; undefined4 local_c; undefined4 local_8; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar2 = (undefined8 *)FUN_008baa50(); local_18 = *puVar2; (*(code *)*puVar1)(&local_c,&local_18); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; puVar1[1] = local_8; *puVar1 = local_c; return 1; } //@@ 00897a10 FUN_00897a10 undefined4 FUN_00897a10(undefined4 param_1) { undefined4 *puVar1; int iVar2; undefined4 uVar3; void *pvVar4; void *local_30; int local_2c; void *local_24; int local_20; code *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04ff5; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = (undefined4 *) lua_touserdata(param_1,0xfff0b9d7,__security_cookie ^ (int)register0x00000010 - 4U); FUN_008ba0c0(param_1); local_8 = 0; local_14 = (code *)*puVar1; local_30 = local_24; if (local_20 == -1) { iVar2 = -1; } else { LuaRef::push(&local_24,local_24); iVar2 = luaL_ref(local_24,0xfff0b9d8); } local_8 = CONCAT31(local_8._1_3_,1); pvVar4 = local_24; local_2c = iVar2; if (iVar2 == -1) { uVar3 = 0xffffffff; } else { LuaRef::push(&local_30,local_24); uVar3 = luaL_ref(local_24,0xfff0b9d8); } (*local_14)(pvVar4,uVar3); luaL_unref(local_24,0xfff0b9d8,iVar2); luaL_unref(local_24,0xfff0b9d8,local_20); ExceptionList = local_10; return 0; } //@@ 00897b00 FUN_00897b00 undefined4 FUN_00897b00(void *param_1) { char cVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; void *pvStack_48; void *local_30; int local_2c; void *local_24; int local_20; code *local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b04ff5; local_10 = ExceptionList; ExceptionList = &local_10; pvStack_48 = param_1; puVar2 = (undefined4 *)lua_touserdata(); pvStack_48 = (void *)0x897b45; FUN_008ba0c0(); local_8 = 0; local_18 = (code *)*puVar2; local_30 = local_24; if (local_20 == -1) { iVar3 = -1; } else { pvStack_48 = (void *)0x897b6c; LuaRef::push(&local_24,local_24); pvStack_48 = local_24; iVar3 = luaL_ref(); } local_14 = (undefined1 *)&pvStack_48; local_8 = CONCAT31(local_8._1_3_,1); pvStack_48 = local_24; local_2c = iVar3; if (iVar3 == -1) { uVar4 = 0xffffffff; local_14 = (undefined1 *)&pvStack_48; } else { LuaRef::push(&local_30,local_24); uVar4 = luaL_ref(local_24,0xfff0b9d8); } *(undefined4 *)(local_14 + 4) = uVar4; cVar1 = (*local_18)(); luaL_unref(local_24,0xfff0b9d8,iVar3); lua_pushboolean(param_1,cVar1 != '\0'); luaL_unref(local_24,0xfff0b9d8,local_20); ExceptionList = local_10; return 1; } //@@ 00897c00 FUN_00897c00 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00897c00(undefined4 param_1) { undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined4 ****ppppuVar4; uint size; undefined1 auStack_5a [2]; void *local_4c; int local_48; void *local_40; int local_3c; code *local_34; undefined1 *local_30; undefined4 ****local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b05035; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; puVar1 = (undefined4 *)lua_touserdata(); FUN_008ba0c0(); local_8 = (undefined4 ***)0x0; local_34 = (code *)*puVar1; local_4c = local_40; if (local_3c == -1) { iVar2 = -1; } else { LuaRef::push(&local_40,local_40); iVar2 = luaL_ref(); } local_30 = auStack_5a + -10; local_8 = (undefined4 ***)CONCAT31(local_8._1_3_,1); local_48 = iVar2; if (iVar2 == -1) { uVar3 = 0xffffffff; local_30 = auStack_5a + -10; } else { LuaRef::push(&local_4c,local_40); uVar3 = luaL_ref(local_40,0xfff0b9d8); } *(undefined4 *)(local_30 + 4) = uVar3; (*local_34)(local_2c); luaL_unref(local_40,0xfff0b9d8,iVar2); ppppuVar4 = local_2c; if (0xf < local_18) { ppppuVar4 = local_2c[0]; } lua_pushlstring(param_1,ppppuVar4,local_1c); if (0xf < local_18) { size = local_18 + 1; ppppuVar4 = local_2c[0]; if (0xfff < size) { ppppuVar4 = (undefined4 ****)local_2c[0][-1]; size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar4,size); } luaL_unref(local_40); ExceptionList = local_10; return 1; } //@@ 00897d50 FUN_00897d50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00897d50(void *param_1) { int iVar1; undefined4 uVar2; void *pvVar3; char *pcVar4; void *local_88; int local_84; char local_80 [28]; void *local_64; int local_60; code *local_5c; void **local_58; char local_54 [28]; void *local_38; int local_34; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05098; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; local_5c = (code *)lua_touserdata(param_1,0xfff0b9d7,local_14); local_58 = (void **)FUN_008ba7c0(param_1); local_8 = 0; local_64 = param_1; lua_pushvalue(param_1,1); iVar1 = luaL_ref(param_1,0xfff0b9d8); local_38 = param_1; local_60 = iVar1; if (iVar1 == -1) { local_34 = -1; } else { LuaRef::push(&local_64,param_1); local_34 = luaL_ref(param_1,0xfff0b9d8); } local_8 = CONCAT31(local_8._1_3_,2); std::string::string(local_30,local_58); luaL_unref(param_1,0xfff0b9d8,iVar1); std::string::_Tidy_deallocate(local_54); pvVar3 = local_38; local_8 = 3; local_5c = *(code **)local_5c; local_58 = &local_88; local_88 = local_38; if (local_34 == -1) { local_84 = -1; } else { LuaRef::push(&local_38,local_38); local_84 = luaL_ref(pvVar3,0xfff0b9d8); } local_8._0_1_ = 4; std::string::string(local_80,local_30); pcVar4 = local_80; local_8 = CONCAT31(local_8._1_3_,5); pvVar3 = local_88; if (local_84 == -1) { uVar2 = 0xffffffff; } else { LuaRef::push(&local_88,local_88); uVar2 = luaL_ref(local_88,0xfff0b9d8); } (*local_5c)(pvVar3,uVar2,pcVar4); std::string::_Tidy_deallocate(local_80); luaL_unref(local_88,0xfff0b9d8,local_84); std::string::_Tidy_deallocate(local_30); luaL_unref(local_38,0xfff0b9d8,local_34); ExceptionList = local_10; return 0; } //@@ 00897f00 FUN_00897f00 undefined4 FUN_00897f00(undefined4 param_1) { undefined4 *puVar1; int iVar2; undefined4 uVar3; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,2); uVar3 = luaL_checkinteger(param_1,1); (*(code *)*puVar1)(uVar3,iVar2 != 0); return 0; } //@@ 00897f50 FUN_00897f50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00897f50(void *param_1) { int iVar1; undefined4 uVar2; void *pvVar3; char *pcVar4; undefined4 uVar5; void *local_94; int local_90; char local_8c [24]; undefined4 local_74; undefined4 local_70; void *local_6c; int local_68; code *local_64; void **local_60; char local_5c [32]; void *local_3c; int local_38; char local_34 [24]; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05108; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_64 = (code *)lua_touserdata(param_1,0xfff0b9d7,local_14); local_60 = (void **)FUN_008ba5e0(param_1); local_8 = 0; local_6c = param_1; lua_pushvalue(param_1,1); iVar1 = luaL_ref(param_1,0xfff0b9d8); local_3c = param_1; local_68 = iVar1; if (iVar1 == -1) { local_38 = -1; } else { LuaRef::push(&local_6c,param_1); local_38 = luaL_ref(param_1,0xfff0b9d8); } local_8 = CONCAT31(local_8._1_3_,2); std::string::string(local_34,local_60); local_1c = *(undefined4 *)((int)local_60 + 0x18); local_18 = *(undefined4 *)((int)local_60 + 0x1c); luaL_unref(param_1,0xfff0b9d8,iVar1); std::string::_Tidy_deallocate(local_5c); pvVar3 = local_3c; local_8 = 3; local_64 = *(code **)local_64; local_60 = &local_94; local_94 = local_3c; if (local_38 == -1) { local_90 = -1; } else { LuaRef::push(&local_3c,local_3c); local_90 = luaL_ref(pvVar3,0xfff0b9d8); } local_8._0_1_ = 4; std::string::string(local_8c,local_34); local_74 = local_1c; local_70 = local_18; pcVar4 = local_8c; local_8 = CONCAT31(local_8._1_3_,5); pvVar3 = local_94; uVar5 = local_1c; if (local_90 == -1) { uVar2 = 0xffffffff; } else { LuaRef::push(&local_94,local_94); uVar2 = luaL_ref(local_94,0xfff0b9d8); } (*local_64)(pvVar3,uVar2,pcVar4,uVar5); std::string::_Tidy_deallocate(local_8c); luaL_unref(local_94,0xfff0b9d8,local_90); std::string::_Tidy_deallocate(local_34); luaL_unref(local_3c,0xfff0b9d8,local_38); ExceptionList = local_10; return 0; } //@@ 00898140 FUN_00898140 undefined4 FUN_00898140(undefined4 param_1) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = (*(code *)*puVar1)(); if (iVar2 == 0) { lua_pushnil(param_1); return 1; } puVar1 = (undefined4 *)lua_newuserdata(param_1,8); *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = iVar2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ad); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008981b0 FUN_008981b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008981b0(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; undefined4 ****ppppuVar3; uint size; char local_68 [32]; char local_48 [28]; undefined4 ****local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b05155; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); FUN_008b9ff0(param_1); local_8 = (undefined4 ***)0x0; pcVar1 = (code *)*puVar2; std::string::string(local_68,local_48); local_8 = (undefined4 ***)CONCAT31(local_8._1_3_,1); (*pcVar1)(local_2c,local_68); std::string::_Tidy_deallocate(local_68); ppppuVar3 = local_2c; if (0xf < local_18) { ppppuVar3 = local_2c[0]; } lua_pushlstring(param_1,ppppuVar3,local_1c); if (0xf < local_18) { size = local_18 + 1; ppppuVar3 = local_2c[0]; if (0xfff < size) { ppppuVar3 = (undefined4 ****)local_2c[0][-1]; size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar3,size); } std::string::_Tidy_deallocate(local_48); ExceptionList = local_10; return 1; } //@@ 008982a0 FUN_008982a0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008982a0(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; int iVar3; byte *text; void *ptr; uint size; char local_6c [24]; undefined2 local_54; uint local_50; undefined2 local_4a; char local_48 [24]; undefined4 local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0519d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); iVar3 = lua_toboolean(param_1,2); local_4a = CONCAT11(local_4a._1_1_,iVar3 != 0); text = (byte *)luaL_checklstring(param_1,1,&local_50); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,local_50); local_8 = (void *)0x0; std::string::string(local_48,local_2c); local_8 = (void *)0xffffffff; local_30 = CONCAT22(local_30._2_2_,local_4a); if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_8 = (void *)0x1; pcVar1 = (code *)*puVar2; std::string::string(local_6c,local_48); local_54 = (undefined2)local_30; local_8 = (void *)CONCAT31(local_8._1_3_,2); (*pcVar1)(local_6c,local_30); std::string::_Tidy_deallocate(local_6c); FUN_0085bfd0(); std::string::_Tidy_deallocate(local_48); ExceptionList = local_10; return 1; } //@@ 008983e0 FUN_008983e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008983e0(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; char local_50 [32]; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b051e5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); FUN_008b9ff0(param_1); local_8 = 0; pcVar1 = (code *)*puVar2; std::string::string(local_50,local_30); local_8 = CONCAT31(local_8._1_3_,1); (*pcVar1)(local_50); std::string::_Tidy_deallocate(local_50); FUN_0085bfd0(); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 00898490 FUN_00898490 undefined4 FUN_00898490(void *param_1) { undefined4 *puVar1; undefined4 local_c; undefined4 local_8; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar1)(&local_c); LuaRef::push(&local_c,param_1); luaL_unref(local_c,0xfff0b9d8,local_8); return 1; } //@@ 008984e0 FUN_008984e0 undefined4 FUN_008984e0(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; int iVar3; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar2 = luaL_checkinteger(param_1,1); iVar3 = (*(code *)*puVar1)(uVar2); lua_pushinteger(param_1,iVar3,iVar3 >> 0x1f); return 1; } //@@ 00898600 FUN_00898600 undefined4 FUN_00898600(undefined4 param_1) { float *pfVar1; undefined4 *puVar2; undefined4 *puVar3; float10 fVar4; undefined4 local_24; undefined4 local_20; float local_1c; float local_18; float local_c; float local_8; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); local_c = (float)fVar4; puVar3 = (undefined4 *)FUN_008baa50(); local_24 = *puVar3; local_20 = puVar3[1]; local_1c = local_c; local_18 = local_8; (*(code *)*puVar2)(&local_c,&local_24,local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar2[1]; pfVar1[1] = local_8; *pfVar1 = local_c; return 1; } //@@ 008986d0 FUN_008986d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008986d0(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; byte *text; void *ptr; uint size; char local_ac [24]; undefined4 local_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 local_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 local_74; uint local_70; undefined4 *local_6c; char local_68 [24]; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b05230; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_6c = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); puVar2 = (undefined4 *)FUN_008ba1e0(param_1); text = (byte *)luaL_checklstring(param_1,1,&local_70); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,local_70); local_8 = (void *)0x0; std::string::string(local_68,local_2c); local_50 = *puVar2; uStack_4c = puVar2[1]; uStack_48 = puVar2[2]; uStack_44 = puVar2[3]; local_30 = puVar2[8]; local_40 = puVar2[4]; uStack_3c = puVar2[5]; uStack_38 = puVar2[6]; uStack_34 = puVar2[7]; local_8 = (void *)0xffffffff; if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_8 = (void *)0x1; pcVar1 = (code *)*local_6c; std::string::string(local_ac,local_68); local_74 = local_30; local_94 = local_50; uStack_90 = uStack_4c; uStack_8c = uStack_48; uStack_88 = uStack_44; local_84 = local_40; uStack_80 = uStack_3c; uStack_7c = uStack_38; uStack_78 = uStack_34; local_8 = (void *)CONCAT31(local_8._1_3_,2); (*pcVar1)(local_ac,local_50,uStack_4c,uStack_48,uStack_44,local_40,uStack_3c,uStack_38,uStack_34); std::string::_Tidy_deallocate(local_ac); std::string::_Tidy_deallocate(local_68); ExceptionList = local_10; return 0; } //@@ 00898890 luabridge::CFunc::Call::f /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: lua C closure pushed by FUN_00895f70 with upvalue Isaac::RenderText and registered as "RenderText": lua_touserdata(upvalueindex 1), luaL_checknumber args 2..7, std::string from arg 1, calls the stored function pointer */ undefined4 luabridge::CFunc::Call::f(undefined4 param_1) { code *pcVar1; byte *text; void *ptr; uint size; float10 fVar2; char local_dc [24]; float local_c4; float fStack_c0; float fStack_bc; float fStack_b8; float local_b4; float fStack_b0; uint local_ac; float local_a8; float fStack_a4; float fStack_a0; float fStack_9c; float fStack_98; uint uStack_94; float local_90; float fStack_8c; float fStack_88; float fStack_84; float fStack_80; float fStack_7c; uint uStack_78; float local_74; float fStack_70; float fStack_6c; uint uStack_68; undefined4 *local_64; char local_60 [24]; float local_48; float fStack_44; float fStack_40; float fStack_3c; float local_38; float fStack_34; uint local_30; void *local_2c; float local_28; float fStack_24; float fStack_20; float fStack_1c; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05280; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_60 + 0x5c); ExceptionList = &local_10; local_64 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); fVar2 = (float10)luaL_checknumber(param_1,7); fStack_6c = (float)fVar2; fVar2 = (float10)luaL_checknumber(param_1,6); fStack_20 = (float)fVar2; fStack_1c = fStack_6c; fVar2 = (float10)luaL_checknumber(param_1,5); fStack_70 = fStack_20; fStack_6c = fStack_1c; local_74 = (float)fVar2; fVar2 = (float10)luaL_checknumber(param_1,4); local_28 = (float)fVar2; fStack_24 = local_74; fStack_20 = fStack_70; fStack_1c = fStack_6c; uStack_18 = uStack_68; fVar2 = (float10)luaL_checknumber(param_1,3); local_a8 = (float)fVar2; fStack_a4 = local_28; fStack_a0 = fStack_24; fStack_9c = fStack_20; fStack_98 = fStack_1c; uStack_94 = uStack_68; fVar2 = (float10)luaL_checknumber(param_1,2); fStack_8c = local_a8; fStack_88 = fStack_a4; fStack_84 = fStack_a0; fStack_80 = fStack_9c; local_90 = (float)fVar2; fStack_7c = fStack_98; uStack_78 = uStack_94; text = (byte *)luaL_checklstring(param_1,1,&uStack_68); fStack_1c = 0.0; uStack_18 = 0xf; local_2c = (void *)0x0; std::string::assign((char *)&local_2c,text,uStack_68); local_8 = 0; std::string::string(local_60,&local_2c); local_30 = uStack_78; local_48 = local_90; fStack_44 = fStack_8c; fStack_40 = fStack_88; fStack_3c = fStack_84; local_38 = fStack_80; fStack_34 = fStack_7c; local_8 = 0xffffffff; if (0xf < uStack_18) { size = uStack_18 + 1; ptr = local_2c; if (0xfff < size) { ptr = *(void **)((int)local_2c + -4); size = uStack_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_8 = 1; pcVar1 = (code *)*local_64; std::string::string(local_dc,local_60); local_c4 = local_48; fStack_c0 = fStack_44; fStack_bc = fStack_40; fStack_b8 = fStack_3c; local_ac = local_30; local_b4 = local_38; fStack_b0 = fStack_34; local_8 = CONCAT31(local_8._1_3_,2); (*pcVar1)(local_dc,local_48,fStack_44,fStack_40,fStack_3c,local_38,fStack_34); std::string::_Tidy_deallocate(local_dc); std::string::_Tidy_deallocate(local_60); ExceptionList = local_10; return 0; } //@@ 00898cf0 FUN_00898cf0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00898cf0(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; char local_50 [32]; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b051e5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); FUN_008b9ff0(param_1); local_8 = 0; pcVar1 = (code *)*puVar2; std::string::string(local_50,local_30); local_8 = CONCAT31(local_8._1_3_,1); (*pcVar1)(local_50); std::string::_Tidy_deallocate(local_50); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 0; } //@@ 00898d90 FUN_00898d90 undefined4 FUN_00898d90(undefined4 param_1) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = (*(code *)*puVar1)(); if (iVar2 == 0) { lua_pushnil(param_1); return 1; } puVar1 = (undefined4 *)lua_newuserdata(param_1,8); *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = iVar2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a19); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00898e00 FUN_00898e00 undefined4 FUN_00898e00(undefined4 param_1) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = (*(code *)*puVar1)(); if (iVar2 == 0) { lua_pushnil(param_1); return 1; } puVar1 = (undefined4 *)lua_newuserdata(param_1,8); *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = iVar2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a16); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00898e70 FUN_00898e70 undefined4 FUN_00898e70(undefined4 param_1) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = (*(code *)*puVar1)(); if (iVar2 == 0) { lua_pushnil(param_1); return 1; } puVar1 = (undefined4 *)lua_newuserdata(param_1,8); *puVar1 = luabridge::UserdataPtr::vftable; puVar1[1] = iVar2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyGame); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00898ee0 FUN_00898ee0 undefined4 FUN_00898ee0(undefined4 param_1) { undefined4 *puVar1; undefined4 local_c; undefined4 local_8; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar1)(&local_c); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; *puVar1 = local_c; puVar1[1] = local_8; return 1; } //@@ 00898f50 FUN_00898f50 undefined4 FUN_00898f50(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar1)(); FUN_0085bff0(); return 1; } //@@ 00898f80 FUN_00898f80 undefined4 FUN_00898f80(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1]); return 0; } //@@ 00899030 FUN_00899030 undefined4 FUN_00899030(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008990d0 FUN_008990d0 undefined4 FUN_008990d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 00899140 FUN_00899140 undefined4 FUN_00899140(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008991a0 FUN_008991a0 undefined4 FUN_008991a0(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar1)(); FUN_0085bfd0(); return 1; } //@@ 008991d0 FUN_008991d0 undefined4 FUN_008991d0(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar1)(); return 0; } //@@ 008991f0 FUN_008991f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008991f0(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; byte *text; char acStack_7c [2]; char acStack_7a [10]; undefined4 uStack_70; undefined4 uStack_6c; char local_54 [32]; undefined1 *local_34; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b052c5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; uStack_6c = param_1; uStack_70 = 0x89922a; puVar2 = (undefined4 *)lua_touserdata(); local_34 = acStack_7c + -4; text = (byte *)luaL_checklstring(param_1,1,&local_34); uStack_70 = 0; uStack_6c = 0xf; std::string::assign(acStack_7c + -4,text,(uint)local_34); FUN_008ba9c0(); local_8 = 0; pcVar1 = (code *)*puVar2; uStack_6c = 0x899283; std::string::string(local_54,local_30); local_8 = CONCAT31(local_8._1_3_,1); std::string::string(acStack_7c,local_54); (*pcVar1)(); std::string::_Tidy_deallocate(local_54); FUN_0085bfd0(); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 008992e0 FUN_008992e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008992e0(undefined4 param_1) { code *pcVar1; char cVar2; undefined4 *puVar3; char local_50 [32]; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05305; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); FUN_008b9ff0(param_1); local_8 = 0; pcVar1 = (code *)*puVar3; std::string::string(local_50,local_30); local_8 = CONCAT31(local_8._1_3_,1); cVar2 = (*pcVar1)(local_50); std::string::_Tidy_deallocate(local_50); lua_pushboolean(param_1,cVar2 != '\0'); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 00899390 FUN_00899390 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00899390(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 ****ppppuVar3; uint size; undefined1 auStack_28 [4]; undefined4 ****appppuStack_24 [4]; undefined4 uStack_14; uint uStack_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_28; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar2 = luaL_checkinteger(param_1,1); (*(code *)*puVar1)(appppuStack_24,uVar2); ppppuVar3 = appppuStack_24; if (0xf < uStack_10) { ppppuVar3 = appppuStack_24[0]; } lua_pushlstring(param_1,ppppuVar3,uStack_14); if (0xf < uStack_10) { size = uStack_10 + 1; ppppuVar3 = appppuStack_24[0]; if (0xfff < size) { ppppuVar3 = (undefined4 ****)appppuStack_24[0][-1]; size = uStack_10 + 0x24; if (0x1f < (uint)((int)appppuStack_24[0] + (-4 - (int)ppppuVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar3,size); } return 1; } //@@ 00899440 FUN_00899440 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00899440(undefined4 param_1) { code *pcVar1; undefined4 *puVar2; char local_50 [32]; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b051e5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7,local_14); FUN_008b9ff0(param_1); local_8 = 0; pcVar1 = (code *)*puVar2; std::string::string(local_50,local_30); local_8 = CONCAT31(local_8._1_3_,1); (*pcVar1)(local_50); std::string::_Tidy_deallocate(local_50); FUN_0085bff0(); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 008994f0 FUN_008994f0 undefined4 FUN_008994f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 00899560 FUN_00899560 undefined4 FUN_00899560(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008995c0 FUN_008995c0 undefined4 FUN_008995c0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1]); return 0; } //@@ 00899670 FUN_00899670 undefined4 FUN_00899670(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 00899710 FUN_00899710 undefined4 FUN_00899710(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 00899770 FUN_00899770 int FUN_00899770(uint param_1) { uint *in_ECX; if (param_1 < *in_ECX) { return in_ECX[1] + param_1 * 4; } return 0; } //@@ 00899790 FUN_00899790 int FUN_00899790(uint param_1) { uint *in_ECX; if (param_1 < *in_ECX) { return param_1 * 0xb8 + in_ECX[1]; } return 0; } //@@ 008997b0 FUN_008997b0 void FUN_008997b0(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 00899850 FUN_00899850 undefined4 FUN_00899850(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008998c0 FUN_008998c0 undefined4 FUN_008998c0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 00899930 FUN_00899930 undefined4 FUN_00899930(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; undefined4 uVar4; undefined4 uStack_10; undefined4 uStack_c; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } (*(code *)*puVar1)(&uStack_10,uVar4); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar1 = luabridge:: UserdataValue_> ::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a33); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; puVar1[1] = uStack_c; *puVar1 = uStack_10; return 1; } //@@ 008999e0 FUN_008999e0 undefined4 FUN_008999e0(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; undefined4 uVar4; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } uVar4 = (*(code *)*puVar1)(uVar4); lua_pushinteger(param_1,uVar4,0); return 1; } //@@ 00899a50 FUN_00899a50 undefined4 FUN_00899a50(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; undefined4 uVar4; undefined4 uStack_10; undefined4 uStack_c; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,1); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } (*(code *)*puVar1)(&uStack_10,uVar4); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar1 = luabridge:: UserdataValue_> ::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a36); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; puVar1[1] = uStack_c; *puVar1 = uStack_10; return 1; } //@@ 00899b00 FUN_00899b00 undefined4 FUN_00899b00(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 00899b70 FUN_00899b70 undefined4 FUN_00899b70(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 00899bd0 FUN_00899bd0 undefined4 FUN_00899bd0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_TNT::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829f1); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00899c70 FUN_00899c70 undefined4 FUN_00899c70(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_TNT::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829f2); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00899d10 FUN_00899d10 undefined4 FUN_00899d10(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Spikes::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829f7); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00899db0 FUN_00899db0 undefined4 FUN_00899db0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Spikes::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829f8); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00899e50 FUN_00899e50 undefined4 FUN_00899e50(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_PressurePlate::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829f4); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00899ef0 FUN_00899ef0 undefined4 FUN_00899ef0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_PressurePlate::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829f5); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 00899fa0 FUN_00899fa0 undefined4 FUN_00899fa0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ee); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a040 FUN_0089a040 undefined4 FUN_0089a040(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Rock::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ef); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a0e0 FUN_0089a0e0 undefined4 FUN_0089a0e0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Poop::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829e8); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a180 FUN_0089a180 undefined4 FUN_0089a180(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Poop::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829e9); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a220 FUN_0089a220 undefined4 FUN_0089a220(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829eb); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a2c0 FUN_0089a2c0 undefined4 FUN_0089a2c0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ec); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a360 FUN_0089a360 undefined4 FUN_0089a360(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829e5); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a400 FUN_0089a400 undefined4 FUN_0089a400(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor, &IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyGridEntityDoor); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089a4a0 FUN_0089a4a0 undefined4 FUN_0089a4a0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089a510 FUN_0089a510 undefined4 FUN_0089a510(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 0089a570 FUN_0089a570 undefined4 FUN_0089a570(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 0089a5d0 FUN_0089a5d0 undefined4 FUN_0089a5d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 0089a670 FUN_0089a670 undefined4 FUN_0089a670(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089a700 FUN_0089a700 undefined4 FUN_0089a700(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089a770 FUN_0089a770 undefined4 FUN_0089a770(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1],puVar4[2],puVar4[3]); return 0; } //@@ 0089a810 FUN_0089a810 undefined4 FUN_0089a810(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 uStack_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_14); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_14; puVar2[1] = uStack_10; puVar2[2] = uStack_c; puVar2[3] = uStack_8; return 1; } //@@ 0089aa50 FUN_0089aa50 undefined4 FUN_0089aa50(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089aae0 FUN_0089aae0 undefined4 FUN_0089aae0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089ab50 FUN_0089ab50 undefined4 FUN_0089ab50(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1],puVar4[2],puVar4[3]); return 0; } //@@ 0089abf0 FUN_0089abf0 undefined4 FUN_0089abf0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 uStack_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_14); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_14; puVar2[1] = uStack_10; puVar2[2] = uStack_c; puVar2[3] = uStack_8; return 1; } //@@ 0089ad70 FUN_0089ad70 undefined4 FUN_0089ad70(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089ae00 FUN_0089ae00 undefined4 FUN_0089ae00(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089ae70 FUN_0089ae70 undefined4 FUN_0089ae70(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089aee0 FUN_0089aee0 undefined4 FUN_0089aee0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089af50 FUN_0089af50 undefined4 FUN_0089af50(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1],puVar4[2],puVar4[3]); return 0; } //@@ 0089aff0 FUN_0089aff0 undefined4 FUN_0089aff0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 uStack_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_14); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_14; puVar2[1] = uStack_10; puVar2[2] = uStack_c; puVar2[3] = uStack_8; return 1; } //@@ 0089b090 FUN_0089b090 undefined4 FUN_0089b090(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 0089b140 FUN_0089b140 undefined4 FUN_0089b140(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089b1e0 FUN_0089b1e0 undefined4 FUN_0089b1e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityNpc); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089b280 FUN_0089b280 undefined4 FUN_0089b280(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089b310 FUN_0089b310 undefined4 FUN_0089b310(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089b380 FUN_0089b380 undefined4 FUN_0089b380(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 *puVar3; int iVar4; void *pvVar5; undefined4 *puVar6; undefined4 uVar7; float10 fVar8; undefined4 uStack_74; undefined4 uStack_70; float fStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined8 uStack_48; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined8 uStack_18; puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar8 = (float10)luaL_checknumber(param_1,5); iVar4 = lua_toboolean(param_1,4); uStack_70 = CONCAT31(uStack_70._1_3_,iVar4 != 0); fStack_6c = (float)fVar8; iVar4 = lua_type(param_1,3); puVar6 = (undefined4 *)0x0; if (iVar4 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uStack_50 = *puVar6; uStack_4c = puVar6[1]; uStack_48 = CONCAT44(fStack_6c,uStack_70); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { uVar7 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); uVar7 = *(undefined4 *)((int)pvVar5 + 4); } fStack_6c = (float)uStack_50; uStack_68 = uStack_4c; uStack_64 = (undefined4)uStack_48; uStack_60 = uStack_48._4_4_; uStack_5c = uStack_74; uStack_70 = uVar7; puVar6 = (undefined4 *)FUN_008baa50(); uStack_54 = uStack_5c; uStack_58 = uStack_60; uVar2 = uStack_64; uVar1 = uStack_68; uStack_30 = *puVar6; uStack_2c = puVar6[1]; uStack_28 = uStack_70; uStack_24 = fStack_6c; uStack_20 = uStack_68; uStack_1c = uStack_64; uStack_18 = CONCAT44(uStack_5c,uStack_60); uStack_68 = uStack_70; uStack_64 = fStack_6c; uStack_60 = uVar1; uStack_5c = uVar2; uStack_70 = uStack_30; fStack_6c = (float)uStack_2c; iVar4 = (*(code *)*puVar3)(&uStack_70,uVar7,uStack_50,uStack_4c,(undefined4)uStack_48, uStack_48._4_4_); if (iVar4 == 0) { lua_pushnil(param_1); return 1; } puVar6 = (undefined4 *)lua_newuserdata(param_1,8); *puVar6 = luabridge::UserdataPtr::vftable; puVar6[1] = iVar4; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityNpc); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089b540 FUN_0089b540 undefined4 FUN_0089b540(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089b5b0 FUN_0089b5b0 undefined4 FUN_0089b5b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089b620 FUN_0089b620 undefined4 FUN_0089b620(void *param_1) { int iVar1; undefined4 *puVar2; undefined8 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829d4,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089b690 FUN_0089b690 undefined4 FUN_0089b690(void *param_1) { int iVar1; undefined4 *puVar2; undefined8 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829d4,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = (*(code *)*puVar2)(); FUN_0085c030(uVar3); return 1; } //@@ 0089b6f0 FUN_0089b6f0 undefined4 FUN_0089b6f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829d4,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089b760 FUN_0089b760 undefined4 FUN_0089b760(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829d4,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 0089b7c0 FUN_0089b7c0 undefined4 FUN_0089b7c0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829d4,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089b850 FUN_0089b850 undefined4 FUN_0089b850(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829d4,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089b8c0 FUN_0089b8c0 undefined4 FUN_0089b8c0(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uStack_10; undefined4 uStack_c; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar2 = luaL_checkinteger(param_1,1); (*(code *)*puVar1)(&uStack_10,uVar2); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; *puVar1 = uStack_10; puVar1[1] = uStack_c; return 1; } //@@ 0089b940 FUN_0089b940 undefined4 FUN_0089b940(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089b9b0 FUN_0089b9b0 undefined4 FUN_0089b9b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 0089ba10 FUN_0089ba10 undefined4 FUN_0089ba10(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntityPlayer,0); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 0089bac0 FUN_0089bac0 undefined4 FUN_0089bac0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089bb60 FUN_0089bb60 undefined4 FUN_0089bb60(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089bbf0 FUN_0089bbf0 undefined4 FUN_0089bbf0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089bc60 FUN_0089bc60 undefined4 FUN_0089bc60(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089bcd0 FUN_0089bcd0 undefined4 FUN_0089bcd0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089bd40 FUN_0089bd40 undefined4 FUN_0089bd40(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089bdb0 FUN_0089bdb0 undefined4 FUN_0089bdb0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 0089be10 FUN_0089be10 undefined4 FUN_0089be10(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089bea0 FUN_0089bea0 undefined4 FUN_0089bea0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089bf10 FUN_0089bf10 undefined4 FUN_0089bf10(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 0089bf70 FUN_0089bf70 undefined4 FUN_0089bf70(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); return 0; } //@@ 0089c000 FUN_0089c000 undefined4 FUN_0089c000(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 0089c0a0 luabridge::CFunc::CallMember::f /* DB: lua_pushcclosure'd by FUN_00882f90 = addFunction(GetMultiShotPositionVelocity, 0x782160 Entity_Player::GetMultiShotPositionVelocity); reads userdata+lua args (luaL_checknumber), returns PosVel */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { undefined4 uVar1; undefined4 *puVar2; int iVar3; void *pvVar4; undefined4 uVar5; undefined4 *puVar6; float10 fVar7; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; float fStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined8 uStack_a8; float fStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_44; undefined4 uStack_40; float fStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,5); puVar6 = (undefined4 *)0x0; if (iVar3 != 0) { pvVar4 = Userdata::getClass(param_1,5,&DAT_00c82a20,1); puVar6 = *(undefined4 **)((int)pvVar4 + 4); } uStack_60 = *puVar6; uStack_5c = puVar6[1]; uStack_58 = puVar6[2]; uStack_54 = puVar6[3]; uStack_e0 = puVar6[4]; uStack_dc = puVar6[5]; uStack_d8 = puVar6[6]; uStack_d4 = puVar6[7]; uStack_b0 = puVar6[8]; fVar7 = (float10)luaL_checknumber(param_1,4); uStack_8c = uStack_60; uStack_88 = uStack_5c; uStack_84 = uStack_58; uStack_80 = uStack_54; uStack_7c = uStack_e0; uStack_78 = uStack_dc; uStack_74 = uStack_d8; uStack_70 = uStack_d4; fStack_90 = (float)fVar7; uStack_6c = uStack_b0; iVar3 = lua_type(param_1,3); puVar6 = (undefined4 *)0x0; if (iVar3 != 0) { pvVar4 = Userdata::getClass(param_1,3,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar4 + 4); } uStack_d0 = *puVar6; uStack_cc = puVar6[1]; fStack_c8 = fStack_90; uStack_c4 = uStack_8c; uStack_c0 = uStack_88; uStack_bc = uStack_84; uStack_b8 = uStack_80; uStack_b4 = uStack_7c; uStack_b0 = uStack_78; uStack_ac = uStack_74; uStack_a8 = CONCAT44(uStack_6c,uStack_70); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar4 = Userdata::getClass(param_1,2,&DAT_00c82a21,1); puVar6 = *(undefined4 **)((int)pvVar4 + 4); } uVar1 = *puVar6; uStack_44 = uStack_d0; uStack_40 = uStack_cc; fStack_3c = fStack_c8; uStack_38 = uStack_c4; uStack_34 = uStack_c0; uStack_30 = uStack_bc; uStack_2c = uStack_b8; uStack_28 = uStack_b4; uStack_24 = uStack_b0; uStack_20 = uStack_ac; uStack_1c = (undefined4)uStack_a8; uStack_18 = uStack_a8._4_4_; uVar5 = luaL_checkinteger(param_1,1); (*(code *)*puVar2)(&uStack_e0,uVar5,uVar1,uStack_d0,uStack_cc,fStack_c8,uStack_38,uStack_34, uStack_30,uStack_2c,uStack_28,uStack_24,uStack_20,uStack_1c,uStack_a8._4_4_); puVar6 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar6 = UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829bf); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; *puVar6 = uStack_e0; puVar6[1] = uStack_dc; puVar6[2] = uStack_d8; puVar6[3] = uStack_d4; return 1; } //@@ 0089c350 FUN_0089c350 undefined4 FUN_0089c350(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a28); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089c3f0 FUN_0089c3f0 undefined4 FUN_0089c3f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089c460 FUN_0089c460 undefined4 FUN_0089c460(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 0089c4c0 FUN_0089c4c0 undefined4 FUN_0089c4c0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089c530 FUN_0089c530 undefined4 FUN_0089c530(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089c5a0 FUN_0089c5a0 undefined4 FUN_0089c5a0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1]); return 0; } //@@ 0089c650 FUN_0089c650 undefined4 FUN_0089c650(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089c6f0 FUN_0089c6f0 undefined4 FUN_0089c6f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089c790 FUN_0089c790 undefined4 FUN_0089c790(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 0089c7f0 FUN_0089c7f0 undefined4 FUN_0089c7f0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1],puVar4[2],puVar4[3]); return 0; } //@@ 0089c890 FUN_0089c890 undefined4 FUN_0089c890(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 uStack_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_14); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_14; puVar2[1] = uStack_10; puVar2[2] = uStack_c; puVar2[3] = uStack_8; return 1; } //@@ 0089c930 FUN_0089c930 undefined4 FUN_0089c930(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089c9c0 FUN_0089c9c0 undefined4 FUN_0089c9c0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089ca30 FUN_0089ca30 undefined4 FUN_0089ca30(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829d3); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cad0 FUN_0089cad0 undefined4 FUN_0089cad0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Projectile::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829d4); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cb70 FUN_0089cb70 undefined4 FUN_0089cb70(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829c4); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cc10 FUN_0089cc10 undefined4 FUN_0089cc10(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityTear); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089ccb0 FUN_0089ccb0 undefined4 FUN_0089ccb0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829dc); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cd50 FUN_0089cd50 undefined4 FUN_0089cd50(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityLaser); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cdf0 FUN_0089cdf0 undefined4 FUN_0089cdf0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829df); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089ce90 FUN_0089ce90 undefined4 FUN_0089ce90(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829e0); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cf30 FUN_0089cf30 undefined4 FUN_0089cf30(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829d9); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089cfd0 FUN_0089cfd0 undefined4 FUN_0089cfd0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829da); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d070 FUN_0089d070 undefined4 FUN_0089d070(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829d0); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d110 FUN_0089d110 undefined4 FUN_0089d110(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityFamiliar); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d1b0 FUN_0089d1b0 undefined4 FUN_0089d1b0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ca); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d250 FUN_0089d250 undefined4 FUN_0089d250(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829cb); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d2f0 FUN_0089d2f0 undefined4 FUN_0089d2f0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829d6); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d390 FUN_0089d390 undefined4 FUN_0089d390(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityNpc); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d430 FUN_0089d430 undefined4 FUN_0089d430(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829cd); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d4d0 FUN_0089d4d0 undefined4 FUN_0089d4d0(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ce); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d570 FUN_0089d570 undefined4 FUN_0089d570(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829c7); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d610 FUN_0089d610 undefined4 FUN_0089d610(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); uVar3 = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar3 = *(undefined4 *)((int)pvVar2 + 4); } iVar1 = __RTDynamicCast(uVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d6b0 FUN_0089d6b0 undefined4 FUN_0089d6b0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 0089d760 FUN_0089d760 undefined4 FUN_0089d760(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089d800 FUN_0089d800 undefined4 FUN_0089d800(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1]); return 0; } //@@ 0089d8b0 FUN_0089d8b0 undefined4 FUN_0089d8b0(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; undefined4 uVar4; float10 fVar5; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar5 = (float10)luaL_checknumber(param_1,2); iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } (*(code *)*puVar1)(uVar4,(float)fVar5); return 0; } //@@ 0089d930 FUN_0089d930 undefined4 FUN_0089d930(void *param_1) { undefined4 *puVar1; int iVar2; float10 fVar3; puVar1 = (undefined4 *)lua_touserdata(param_1); iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } fVar3 = (float10)(*(code *)*puVar1)(); lua_pushnumber(param_1,(double)(float)fVar3); return 1; } //@@ 0089d9b0 FUN_0089d9b0 undefined4 FUN_0089d9b0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089da40 FUN_0089da40 undefined4 FUN_0089da40(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089dab0 FUN_0089dab0 undefined4 FUN_0089dab0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 0089db20 FUN_0089db20 undefined4 FUN_0089db20(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 0089db80 FUN_0089db80 undefined4 FUN_0089db80(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089dc20 FUN_0089dc20 undefined4 FUN_0089dc20(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089dc90 FUN_0089dc90 undefined4 FUN_0089dc90(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089dd00 FUN_0089dd00 undefined4 FUN_0089dd00(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined8 uStack_18; undefined4 uStack_10; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar3 = (undefined4 *)FUN_008ba900(); uStack_38 = *puVar3; uStack_34 = puVar3[1]; uStack_30 = puVar3[2]; uStack_2c = puVar3[3]; uStack_28 = puVar3[4]; uStack_24 = puVar3[5]; uStack_20 = puVar3[6]; uStack_1c = puVar3[7]; uStack_18 = *(undefined8 *)(puVar3 + 8); uStack_10 = puVar3[10]; (*(code *)*puVar2)(&uStack_38); return 0; } //@@ 0089dd90 FUN_0089dd90 undefined4 FUN_0089dd90(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8298b); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089de30 FUN_0089de30 undefined4 FUN_0089de30(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 0089de90 FUN_0089de90 undefined4 FUN_0089de90(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 0089def0 FUN_0089def0 undefined4 FUN_0089def0(void *param_1) { undefined4 uVar1; undefined4 *puVar2; undefined4 *puVar3; int iVar4; void *pvVar5; undefined4 uVar6; undefined4 local_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 local_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined8 local_3c; undefined4 local_34; undefined4 local_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 local_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; undefined8 local_c; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar3 = (undefined4 *)FUN_008ba900(); local_1c = *puVar3; uStack_18 = puVar3[1]; uStack_14 = puVar3[2]; uStack_10 = puVar3[3]; uVar1 = puVar3[10]; local_2c = puVar3[4]; uStack_28 = puVar3[5]; uStack_24 = puVar3[6]; uStack_20 = puVar3[7]; local_c = *(undefined8 *)(puVar3 + 8); iVar4 = lua_type(param_1,1); uVar6 = 0; if (iVar4 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); uVar6 = *(undefined4 *)((int)pvVar5 + 4); } local_5c = local_1c; uStack_58 = uStack_18; uStack_54 = uStack_14; uStack_50 = uStack_10; local_4c = local_2c; uStack_48 = uStack_28; uStack_44 = uStack_24; uStack_40 = uStack_20; local_3c = local_c; local_34 = uVar1; (*(code *)*puVar2)(uVar6,&local_5c); return 0; } //@@ 0089df90 FUN_0089df90 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_0089df90(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; undefined4 uVar4; undefined1 auStack_38 [44]; uint local_c; local_c = __security_cookie ^ (uint)auStack_38; puVar1 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } (*(code *)*puVar1)(auStack_38,uVar4); FUN_008ab7d0(); return 1; } //@@ 0089e020 FUN_0089e020 undefined4 FUN_0089e020(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); return 0; } //@@ 0089e0b0 FUN_0089e0b0 undefined4 FUN_0089e0b0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 0089e150 FUN_0089e150 undefined4 FUN_0089e150(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829bc,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 0089e1b0 FUN_0089e1b0 undefined4 FUN_0089e1b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b3,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089e220 FUN_0089e220 undefined4 FUN_0089e220(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b3,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089e290 FUN_0089e290 undefined4 FUN_0089e290(void *param_1) { char cVar1; undefined4 *puVar2; int iVar3; void *pvVar4; undefined4 uVar5; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,1); if (iVar3 == 0) { uVar5 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } cVar1 = (*(code *)*puVar2)(uVar5); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089e300 FUN_0089e300 undefined4 FUN_0089e300(undefined4 param_1) { char cVar1; undefined4 *puVar2; undefined4 uVar3; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,1); cVar1 = (*(code *)*puVar2)(uVar3); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089e350 FUN_0089e350 int FUN_0089e350(uint param_1) { int *in_ECX; if ((uint)((in_ECX[1] - *in_ECX) / 0x2c) <= param_1) { /* WARNING: Subroutine does not return */ FUN_008ba150(); } return param_1 * 0x2c + *in_ECX; } //@@ 0089e3b0 FUN_0089e3b0 undefined4 FUN_0089e3b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a9); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089e450 FUN_0089e450 undefined4 FUN_0089e450(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089e4c0 FUN_0089e4c0 undefined4 FUN_0089e4c0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089e530 FUN_0089e530 undefined4 FUN_0089e530(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 0089e5a0 FUN_0089e5a0 undefined4 FUN_0089e5a0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 0089e610 FUN_0089e610 void FUN_0089e610(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::GetTexel; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetTexel"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089e6b0 FUN_0089e6b0 undefined4 FUN_0089e6b0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined8 uStack_18; undefined4 uStack_10; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar3 = (undefined4 *)FUN_008ba900(); uStack_38 = *puVar3; uStack_34 = puVar3[1]; uStack_30 = puVar3[2]; uStack_2c = puVar3[3]; uStack_28 = puVar3[4]; uStack_24 = puVar3[5]; uStack_20 = puVar3[6]; uStack_1c = puVar3[7]; uStack_18 = *(undefined8 *)(puVar3 + 8); uStack_10 = puVar3[10]; (*(code *)*puVar2)(&uStack_38); return 0; } //@@ 0089e740 FUN_0089e740 undefined4 FUN_0089e740(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8298b); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089e7e0 FUN_0089e7e0 undefined4 FUN_0089e7e0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089e870 FUN_0089e870 undefined4 FUN_0089e870(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089e8e0 FUN_0089e8e0 undefined4 FUN_0089e8e0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); return 0; } //@@ 0089e970 FUN_0089e970 undefined4 FUN_0089e970(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 0089ea10 FUN_0089ea10 void FUN_0089ea10(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089eab0 FUN_0089eab0 void FUN_0089eab0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::GetLayerCount; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetLayerCount"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089eb50 FUN_0089eb50 void FUN_0089eb50(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::GetOverlayFrame; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089ebb0 FUN_0089ebb0 void FUN_0089ebb0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::SetOverlayRenderPriority; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089ec10 FUN_0089ec10 void FUN_0089ec10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = ANM2::SetLayerFrame; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089ec70 FUN_0089ec70 void FUN_0089ec70(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = ANM2::GetFrame; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetFrame"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089ed10 FUN_0089ed10 void FUN_0089ed10(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089ed70 FUN_0089ed70 void FUN_0089ed70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::PlayRandom; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089edd0 FUN_0089edd0 void FUN_0089edd0(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089ee70 FUN_0089ee70 void FUN_0089ee70(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::IsLoaded; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"IsLoaded"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089ef10 FUN_0089ef10 void FUN_0089ef10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::ReplaceSpritesheet; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089ef70 FUN_0089ef70 void FUN_0089ef70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::RenderLayer; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089efd0 FUN_0089efd0 void FUN_0089efd0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = ANM2::Render; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f030 FUN_0089f030 void FUN_0089f030(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f090 FUN_0089f090 void FUN_0089f090(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Sprite::SetFrame_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f0f0 FUN_0089f0f0 void FUN_0089f0f0(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f150 FUN_0089f150 void FUN_0089f150(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f1b0 FUN_0089f1b0 void FUN_0089f1b0(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089f250 FUN_0089f250 void FUN_0089f250(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Color::__mul; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f2b0 FUN_0089f2b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_0089f2b0(undefined4 param_1) { undefined4 uVar1; undefined4 *puVar2; undefined4 *puVar3; float10 fVar4; undefined1 auStack_cc [4]; float fStack_c8; undefined4 uStack_c4; undefined8 uStack_c0; undefined4 uStack_b8; undefined4 uStack_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined8 uStack_98; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined8 uStack_6c; undefined4 uStack_64; float fStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined1 auStack_38 [44]; uint local_c; local_c = __security_cookie ^ (uint)auStack_cc; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,3); fStack_c8 = (float)fVar4; puVar3 = (undefined4 *)FUN_008ba900(); uStack_58 = *puVar3; uStack_54 = puVar3[1]; uStack_50 = puVar3[2]; uStack_4c = puVar3[3]; uVar1 = puVar3[10]; uStack_48 = puVar3[4]; uStack_44 = puVar3[5]; uStack_40 = puVar3[6]; uStack_3c = puVar3[7]; uStack_c0 = *(undefined8 *)(puVar3 + 8); puVar3 = (undefined4 *)FUN_008ba900(); uStack_5c = uStack_c4; uStack_b8 = *puVar3; uStack_b4 = puVar3[1]; uStack_b0 = puVar3[2]; uStack_ac = puVar3[3]; uStack_a8 = puVar3[4]; uStack_a4 = puVar3[5]; uStack_a0 = puVar3[6]; uStack_9c = puVar3[7]; uStack_98 = *(undefined8 *)(puVar3 + 8); uStack_90 = puVar3[10]; uStack_8c = uStack_58; uStack_88 = uStack_54; uStack_84 = uStack_50; uStack_80 = uStack_4c; fStack_60 = fStack_c8; uStack_7c = uStack_48; uStack_78 = uStack_44; uStack_74 = uStack_40; uStack_70 = uStack_3c; uStack_6c = uStack_c0; uStack_64 = uVar1; (*(code *)*puVar2)(auStack_38,&uStack_b8,&uStack_8c,fStack_c8); FUN_008ab7d0(); return 1; } //@@ 0089f3e0 FUN_0089f3e0 void FUN_0089f3e0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Color::SetOffset; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f440 FUN_0089f440 void FUN_0089f440(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f4a0 FUN_0089f4a0 void FUN_0089f4a0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Color::Reset; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f500 FUN_0089f500 undefined4 FUN_0089f500(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8298c,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 0089f590 FUN_0089f590 undefined4 FUN_0089f590(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8298c,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 0089f600 FUN_0089f600 void FUN_0089f600(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::SetMissingCharacter; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f660 FUN_0089f660 void FUN_0089f660(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::DrawString; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"DrawString"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089f700 FUN_0089f700 void FUN_0089f700(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089f7a0 FUN_0089f7a0 void FUN_0089f7a0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::GetStringWidth; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetStringWidth"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089f840 FUN_0089f840 void FUN_0089f840(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::GetCharacterWidth; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetCharacterWidth"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089f8e0 FUN_0089f8e0 void FUN_0089f8e0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Room::IsInitialized; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"IsLoaded"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089f980 FUN_0089f980 void FUN_0089f980(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::Unload; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089f9e0 FUN_0089f9e0 void FUN_0089f9e0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::Load; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089fa40 FUN_0089fa40 void FUN_0089fa40(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Room::GetGridHeight; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetMissingCharacterOverride"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089fae0 FUN_0089fae0 void FUN_0089fae0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::SetMissingCharacterOverride; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089fb40 FUN_0089fb40 void FUN_0089fb40(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Color::A; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetLineHeightModifier"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089fbe0 FUN_0089fbe0 void FUN_0089fbe0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::SetLineHeightModifier; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089fc40 FUN_0089fc40 void FUN_0089fc40(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089fce0 FUN_0089fce0 void FUN_0089fce0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::GetMaxCharacters; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetMaxCharacters"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089fd80 FUN_0089fd80 void FUN_0089fd80(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089fde0 FUN_0089fde0 void FUN_0089fde0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = EntityPtr::Ref; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"GetAlignment"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089fe80 FUN_0089fe80 void FUN_0089fe80(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Font::SetAlignment; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 0089fee0 FUN_0089fee0 void FUN_0089fee0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Vector::__tostring; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"__tostring"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 0089ff80 FUN_0089ff80 void FUN_0089ff80(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a0020 FUN_008a0020 void FUN_008a0020(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a00c0 FUN_008a00c0 void FUN_008a00c0(void) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Vector::Clamped; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,"Clamped"); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a0160 FUN_008a0160 void FUN_008a0160(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Vector::Clamp; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 008a01c0 FUN_008a01c0 void FUN_008a01c0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Vector::Resize; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 008a0220 FUN_008a0220 void FUN_008a0220(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a02c0 FUN_008a02c0 undefined4 FUN_008a02c0(undefined4 param_1) { float *pfVar1; undefined4 *puVar2; float10 fVar3; float fStack_10; float fStack_c; puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,1); fStack_10 = (float)fVar3; (*(code *)*puVar2)(&fStack_10,fStack_10); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar2[1]; *pfVar1 = fStack_10; pfVar1[1] = fStack_c; return 1; } //@@ 008a0360 FUN_008a0360 void FUN_008a0360(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a0400 FUN_008a0400 void FUN_008a0400(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Vector::Lerp; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 008a0460 FUN_008a0460 void FUN_008a0460(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a0500 FUN_008a0500 void FUN_008a0500(undefined4 param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 in_ECX; undefined4 in_EDX; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = param_1; lua_pushcclosure(); lua_pushvalue(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); uVar2 = lua_absindex(in_ECX,0xfffffffd); lua_pushstring(in_ECX,in_EDX); lua_rotate(in_ECX,0xfffffffe,1); lua_rawset(in_ECX,uVar2); return; } //@@ 008a05a0 FUN_008a05a0 void FUN_008a05a0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = Vector::Normalize; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 008a0600 FUN_008a0600 undefined4 FUN_008a0600(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8297d,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008a06a0 FUN_008a06a0 void FUN_008a06a0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(); *puVar1 = EntityPtr::SetReference; lua_pushcclosure(); lua_absindex(); lua_pushstring(); lua_rotate(); lua_rawset(); return; } //@@ 008a0700 FUN_008a0700 int FUN_008a0700(uint param_1) { uint *in_ECX; if (param_1 < *in_ECX) { return param_1 * 0x10 + in_ECX[1]; } return 0; } //@@ 008a0720 FUN_008a0720 int FUN_008a0720(uint param_1) { uint *in_ECX; if (param_1 < *in_ECX) { return in_ECX[1] + param_1 * 0xc; } return 0; } //@@ 008a0740 luabridge::Namespace::Class::Class /* DB: lua_pushstring "MusicManager", createConstTable/createClassTable/createStaticTable; only caller FUN_008956f0 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"MusicManager"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"MusicManager"); lua_pushcclosure(*in_ECX,FUN_008c2bd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"MusicManager"); lua_pushcclosure(*in_ECX,FUN_008c2bd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("MusicManager"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a1a); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a19); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a18); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a0950 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes): "SFXManager", __class/__const */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"SFXManager"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"SFXManager"); lua_pushcclosure(*in_ECX,FUN_008c2bf0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"SFXManager"); lua_pushcclosure(*in_ECX,FUN_008c2bf0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("SFXManager"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a17); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a16); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a15); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a0b60 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: FUN_00893c70 thunk called by LuaEngine::RegisterAPI with DAT_00b74634 = "Game", followed by Update/Render/IsPaused/SpawnEntityDesc...; __gc FUN_008c2c10 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b74634); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b74634); lua_pushcclosure(*in_ECX,FUN_008c2c10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b74634); lua_pushcclosure(*in_ECX,FUN_008c2c10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b74634); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a14); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyGame); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a12); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a0d70 luabridge::Namespace::Class::Class /* DB: luabridge class ctor, name DAT_00b6b338 = "HUD"; from FUN_00893a20 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b6b338); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b6b338); lua_pushcclosure(*in_ECX,FUN_008c2c30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b6b338); lua_pushcclosure(*in_ECX,FUN_008c2c30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b6b338); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a1c); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82978); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a1b); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a0f80 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: name "ItemPool", __class/__const; only caller 00893330 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"ItemPool"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"ItemPool"); lua_pushcclosure(*in_ECX,FUN_008c2c50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"ItemPool"); lua_pushcclosure(*in_ECX,FUN_008c2c50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("ItemPool"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a11); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a10); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a0f); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a1190 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for Seeds */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Seeds"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Seeds"); lua_pushcclosure(*in_ECX,FUN_008c2c70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Seeds"); lua_pushcclosure(*in_ECX,FUN_008c2c70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Seeds"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a0e); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a0d); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a0c); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a13a0 luabridge::Namespace::Class::Class /* DB: lua_pushstring "Level", createConstTable/createClassTable/createStaticTable; only caller FUN_00891a10 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Level"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Level"); lua_pushcclosure(*in_ECX,FUN_008c2c90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Level"); lua_pushcclosure(*in_ECX,FUN_008c2c90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Level"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a0b); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyLevel); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a09); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a15b0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes, no name literal: name from caller): __class/__const, class key g_luaClassKeyRoom */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b734f0); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b734f0); lua_pushcclosure(*in_ECX,FUN_008c2cb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b734f0); lua_pushcclosure(*in_ECX,FUN_008c2cb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b734f0); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a08); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyRoom); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a06); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a17c0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: FUN_0088f2a0 thunk called by LuaEngine::RegisterAPI with "RoomDescriptor"; __gc FUN_008c2cd0 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"RoomDescriptor"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"RoomDescriptor"); lua_pushcclosure(*in_ECX,FUN_008c2cd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"RoomDescriptor"); lua_pushcclosure(*in_ECX,FUN_008c2cd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("RoomDescriptor"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a05); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a04); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a03); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a19d0 luabridge::Namespace::Class::Class /* DB: luabridge class ctor, name DAT_00b734f0 = "Room"; from FUN_0088e9c0 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b734f0); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b734f0); lua_pushcclosure(*in_ECX,FUN_008c2cf0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b734f0); lua_pushcclosure(*in_ECX,FUN_008c2cf0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b734f0); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a02); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a01); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a00); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a1be0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (name passed in): LuaEngine::RegisterAPI calls the wrapper 0088e380(s_Spawn) inside the "RoomConfig" namespace right before addData of Class and "PickEntry"/"Entries"; rawget of "Spawn", __gc closure FUN_008c2d10 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,s_Spawn); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,s_Spawn); lua_pushcclosure(*in_ECX,FUN_008c2d10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,s_Spawn); lua_pushcclosure(*in_ECX,FUN_008c2d10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(s_Spawn); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ff); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829fe); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829fd); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a1df0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for Entry (RoomConfig.Entry) */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Entry"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Entry"); lua_pushcclosure(*in_ECX,FUN_008c2d30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Entry"); lua_pushcclosure(*in_ECX,FUN_008c2d30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Entry"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829fc); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829fb); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829fa); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a2000 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: name "GridEntitySpikes", __class/__const/__parent; only caller 0088d7d0 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntitySpikes"); lua_pushcclosure(*in_ECX,FUN_008c2d50,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntitySpikes"); lua_pushcclosure(*in_ECX,FUN_008c2d50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntitySpikes"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f9); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f8); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f7); ExceptionList = local_10; return in_ECX; } //@@ 008a2260 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor for GridEntityPressurePlate (__class/__const/__parent) */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntityPressurePlate"); lua_pushcclosure(*in_ECX,FUN_008c2d70,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityPressurePlate"); lua_pushcclosure(*in_ECX,FUN_008c2d70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityPressurePlate"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f6); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f5); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f4); ExceptionList = local_10; return in_ECX; } //@@ 008a24c0 luabridge::Namespace::Class::Class /* DB: derived-class ctor ("__parent"): name "GridEntityTNT", createConstTable/createClassTable/createStaticTable; only caller FUN_0088d130 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntityTNT"); lua_pushcclosure(*in_ECX,FUN_008c2d90,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityTNT"); lua_pushcclosure(*in_ECX,FUN_008c2d90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityTNT"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f3); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f2); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f1); ExceptionList = local_10; return in_ECX; } //@@ 008a2720 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: "GridEntityRock", __class/__const/__parent (same shape as Class::Class 008a2260) */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntityRock"); lua_pushcclosure(*in_ECX,FUN_008c2db0,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityRock"); lua_pushcclosure(*in_ECX,FUN_008c2db0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityRock"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829f0); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ef); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ee); ExceptionList = local_10; return in_ECX; } //@@ 008a2980 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor (__parent): FUN_0088c940 thunk called by LuaEngine::RegisterAPI with "GridEntityPit" (parent key DAT_00c82979); __gc FUN_008c2dd0 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntityPit"); lua_pushcclosure(*in_ECX,FUN_008c2dd0,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityPit"); lua_pushcclosure(*in_ECX,FUN_008c2dd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityPit"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ed); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ec); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829eb); ExceptionList = local_10; return in_ECX; } //@@ 008a2be0 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor for "GridEntityPoop" (__class/__const/__parent, __gc closure FUN_008c2df0); from FUN_0088c440 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntityPoop"); lua_pushcclosure(*in_ECX,FUN_008c2df0,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityPoop"); lua_pushcclosure(*in_ECX,FUN_008c2df0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityPoop"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ea); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e9); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e8); ExceptionList = local_10; return in_ECX; } //@@ 008a2e40 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: name "GridEntityDoor", __class/__const/__parent; only caller 0088b5e0 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"GridEntityDoor"); lua_pushcclosure(*in_ECX,FUN_008c2e10,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityDoor"); lua_pushcclosure(*in_ECX,FUN_008c2e10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityDoor"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e7); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyGridEntityDoor); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e5); ExceptionList = local_10; return in_ECX; } //@@ 008a30a0 luabridge::Namespace::Class::Class /* DB: lua_pushstring "GridEntity" then rawget, createConstTable/createClassTable/createStaticTable + __gc; only caller FUN_0088a560 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"GridEntity"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"GridEntity"); lua_pushcclosure(*in_ECX,FUN_008c2e30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntity"); lua_pushcclosure(*in_ECX,FUN_008c2e30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntity"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82979); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyGridEntity); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a1d); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a32b0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes): "GridEntityDesc", __class/__const */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"GridEntityDesc"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"GridEntityDesc"); lua_pushcclosure(*in_ECX,FUN_008c2e50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"GridEntityDesc"); lua_pushcclosure(*in_ECX,FUN_008c2e50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("GridEntityDesc"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e4); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e3); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e2); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a34c0 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor for EntityKnife (__class/__const/__parent) */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityKnife"); lua_pushcclosure(*in_ECX,FUN_008c2e70,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityKnife"); lua_pushcclosure(*in_ECX,FUN_008c2e70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityKnife"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e1); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829e0); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829df); ExceptionList = local_10; return in_ECX; } //@@ 008a3720 luabridge::Namespace::Class::Class /* DB: derived-class ctor ("__parent"): name "EntityLaser", createConstTable/createClassTable/createStaticTable; only caller FUN_008882c0 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityLaser"); lua_pushcclosure(*in_ECX,FUN_008c2e90,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityLaser"); lua_pushcclosure(*in_ECX,FUN_008c2e90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityLaser"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829de); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyEntityLaser); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829dc); ExceptionList = local_10; return in_ECX; } //@@ 008a3980 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: "EntityBomb", __class/__const/__parent (same shape as Class::Class 008a34c0) */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityBomb"); lua_pushcclosure(*in_ECX,FUN_008c2eb0,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityBomb"); lua_pushcclosure(*in_ECX,FUN_008c2eb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityBomb"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829db); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829da); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d9); ExceptionList = local_10; return in_ECX; } //@@ 008a3be0 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor (__parent): FUN_00886a80 thunk called by LuaEngine::RegisterAPI with "EntityNPC"; __gc FUN_008c2ed0 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityNPC"); lua_pushcclosure(*in_ECX,FUN_008c2ed0,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityNPC"); lua_pushcclosure(*in_ECX,FUN_008c2ed0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityNPC"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d8); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyEntityNpc); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d6); ExceptionList = local_10; return in_ECX; } //@@ 008a3e40 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor for "EntityProjectile" (__class/__const/__parent, __gc closure FUN_008c2ef0); from FUN_00886550 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityProjectile"); lua_pushcclosure(*in_ECX,FUN_008c2ef0,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityProjectile"); lua_pushcclosure(*in_ECX,FUN_008c2ef0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityProjectile"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d5); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d4); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d3); ExceptionList = local_10; return in_ECX; } //@@ 008a40a0 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: name "EntityFamiliar", __class/__const/__parent tables; only caller the EntityFamiliar registration wrapper 00885910 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityFamiliar"); lua_pushcclosure(*in_ECX,FUN_008c2f10,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityFamiliar"); lua_pushcclosure(*in_ECX,FUN_008c2f10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityFamiliar"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d2); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyEntityFamiliar); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829d0); ExceptionList = local_10; return in_ECX; } //@@ 008a4300 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: name EntityEffect, sets __parent on class/const/static tables (rawgetp parent key), __gc closures */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityEffect"); lua_pushcclosure(*in_ECX,FUN_008c2f30,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityEffect"); lua_pushcclosure(*in_ECX,FUN_008c2f30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityEffect"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829cf); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ce); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829cd); ExceptionList = local_10; return in_ECX; } //@@ 008a4560 luabridge::Namespace::Class::Class /* DB: derived-class ctor (pushes "__parent"): lua_pushstring "EntityPickup", createConstTable 0085d040 luabridge::Namespace::ClassBase::createConstTable createClassTable 0085d2c0 luabridge::Namespace::ClassBase::createClassTable createStaticTable 0085d500; only caller lua_register FUN_00884930 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityPickup"); lua_pushcclosure(*in_ECX,FUN_008c2f50,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityPickup"); lua_pushcclosure(*in_ECX,FUN_008c2f50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityPickup"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829cc); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829cb); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ca); ExceptionList = local_10; return in_ECX; } //@@ 008a47c0 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor: "EntityPlayer", __class/__const/__parent with lua_rawgetp of the parent key, g_luaClassKeyEntityPlayer (same shape as Class::Class 008a4300) */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityPlayer"); lua_pushcclosure(*in_ECX,FUN_008c2f70,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityPlayer"); lua_pushcclosure(*in_ECX,FUN_008c2f70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityPlayer"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c9); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c7); ExceptionList = local_10; return in_ECX; } //@@ 008a4a20 luabridge::Namespace::Class::Class /* DB: luabridge deriveClass ctor (has __parent): FUN_0087fdb0 thunk called by LuaEngine::RegisterAPI with "EntityTear" (parent key DAT_00c8297b); creates const/class/static tables, __gc closure FUN_008c2f90 */ undefined4 * luabridge::Namespace::Class::Class (undefined4 param_1,undefined4 *param_2,undefined4 param_3) { undefined4 uVar1; uint uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0536d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; ClassBase::createConstTable(in_ECX,(byte *)"EntityTear"); lua_pushcclosure(*in_ECX,FUN_008c2f90,0,uVar2); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityTear"); lua_pushcclosure(*in_ECX,FUN_008c2f90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityTear"); lua_rawgetp(*in_ECX,0xfff0b9d8,param_3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffa); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffc); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,"__parent"); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c6); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyEntityTear); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c4); ExceptionList = local_10; return in_ECX; } //@@ 008a4c80 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: FUN_0087d5b0 thunk called by LuaEngine::RegisterAPI with "Entity"; __gc FUN_008c2fb0 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Entity"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Entity"); lua_pushcclosure(*in_ECX,FUN_008c2fb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Entity"); lua_pushcclosure(*in_ECX,FUN_008c2fb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Entity"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8297b); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyEntity); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a1f); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a4ea0 luabridge::Namespace::Class::Class /* DB: luabridge class ctor for "ActiveItemDesc"; from FUN_0087d2a0 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"ActiveItemDesc"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"ActiveItemDesc"); lua_pushcclosure(*in_ECX,FUN_008c2fd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"ActiveItemDesc"); lua_pushcclosure(*in_ECX,FUN_008c2fd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("ActiveItemDesc"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c3); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c2); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c1); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a50b0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: name "PosVel", __class/__const; only caller 0087d110 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"PosVel"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"PosVel"); lua_pushcclosure(*in_ECX,FUN_008c2ff0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"PosVel"); lua_pushcclosure(*in_ECX,FUN_008c2ff0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("PosVel"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829c0); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829bf); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829be); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a52c0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes, same as Class::Class) for EntityList */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"EntityList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"EntityList"); lua_pushcclosure(*in_ECX,FUN_008c3010,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityList"); lua_pushcclosure(*in_ECX,FUN_008c3010,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829bd); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829bc); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829bb); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a54d0 luabridge::Namespace::Class::Class /* DB: lua_pushstring "TemporaryEffects", createConstTable/createClassTable/createStaticTable; only caller FUN_0087c510 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"TemporaryEffects"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"TemporaryEffects"); lua_pushcclosure(*in_ECX,FUN_008c3030,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"TemporaryEffects"); lua_pushcclosure(*in_ECX,FUN_008c3030,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("TemporaryEffects"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ba); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b9); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b8); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a56e0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes): "TemporaryEffect", __class/__const */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"TemporaryEffect"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"TemporaryEffect"); lua_pushcclosure(*in_ECX,FUN_008c3050,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"TemporaryEffect"); lua_pushcclosure(*in_ECX,FUN_008c3050,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("TemporaryEffect"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b7); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b6); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b5); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a58f0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: FUN_0087b730 thunk called by LuaEngine::RegisterAPI with "QueueItemData"; __gc FUN_008c3070 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"QueueItemData"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"QueueItemData"); lua_pushcclosure(*in_ECX,FUN_008c3070,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"QueueItemData"); lua_pushcclosure(*in_ECX,FUN_008c3070,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("QueueItemData"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b4); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b3); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b2); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a5b00 luabridge::Namespace::Class::Class /* DB: luabridge class ctor for "TearParams"; from FUN_0087b130 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"TearParams"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"TearParams"); lua_pushcclosure(*in_ECX,FUN_008c3090,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"TearParams"); lua_pushcclosure(*in_ECX,FUN_008c3090,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("TearParams"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b1); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829b0); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829af); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a5d10 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: name "Config" (the ItemConfig namespace class whose methods are ItemConfig::GetCollectible/GetTrinket/IsValidCollectible); only caller 0087ac50 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Config"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Config"); lua_pushcclosure(*in_ECX,FUN_008c30b0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Config"); lua_pushcclosure(*in_ECX,FUN_008c30b0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Config"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ae); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ad); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ac); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a5f20 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for Costume (ItemConfig namespace), same shape as Class::Class */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Costume"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Costume"); lua_pushcclosure(*in_ECX,FUN_008c30d0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Costume"); lua_pushcclosure(*in_ECX,FUN_008c30d0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Costume"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829ab); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829aa); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a9); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6130 luabridge::Namespace::Class::Class /* DB: name string DAT_00b67800 = "Item" (ItemConfig::Item), createConstTable/createClassTable/createStaticTable; reached from LuaEngine::RegisterAPI via FUN_00878cb0 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b67800); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b67800); lua_pushcclosure(*in_ECX,FUN_008c30f0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b67800); lua_pushcclosure(*in_ECX,FUN_008c30f0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b67800); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a8); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyItem); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a6); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6340 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes): Lua name "PillEffect" (ItemConfig.PillEffect; addData Name/GreedModeAllowed are Class), __class/__const */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"PillEffect"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"PillEffect"); lua_pushcclosure(*in_ECX,FUN_008c3110,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"PillEffect"); lua_pushcclosure(*in_ECX,FUN_008c3110,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("PillEffect"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a5); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a4); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a3); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6550 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: FUN_00877ae0 thunk called by LuaEngine::RegisterAPI in namespace "ItemConfig" with name DAT_00b70a1c = "Card"; followed by AchievementID/Description/HudAnim/GreedModeAllowed properties; __gc FUN_008c3130 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b70a1c); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b70a1c); lua_pushcclosure(*in_ECX,FUN_008c3130,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b70a1c); lua_pushcclosure(*in_ECX,FUN_008c3130,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b70a1c); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a2); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a1); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c829a0); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6760 luabridge::Namespace::Class::Class /* DB: luabridge class ctor for "PathFinder"; from FUN_00877660 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"PathFinder"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"PathFinder"); lua_pushcclosure(*in_ECX,FUN_008c3150,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"PathFinder"); lua_pushcclosure(*in_ECX,FUN_008c3150,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("PathFinder"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8299f); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8299e); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8299d); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6970 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: name "BitSet128", __class/__const (522-byte beginClass shape); only caller 00877100 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"BitSet128"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"BitSet128"); lua_pushcclosure(*in_ECX,FUN_008c3170,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"BitSet128"); lua_pushcclosure(*in_ECX,FUN_008c3170,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("BitSet128"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8299c); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8299a); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6b80 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for ProjectileParams */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"ProjectileParams"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"ProjectileParams"); lua_pushcclosure(*in_ECX,FUN_008c3190,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"ProjectileParams"); lua_pushcclosure(*in_ECX,FUN_008c3190,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("ProjectileParams"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82999); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82998); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82997); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6d90 luabridge::Namespace::Class::Class /* DB: name string DAT_00b70764 = "RNG", createConstTable/createClassTable/createStaticTable; reached from LuaEngine::RegisterAPI via FUN_00876530 */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b70764); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b70764); lua_pushcclosure(*in_ECX,FUN_008c31b0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b70764); lua_pushcclosure(*in_ECX,FUN_008c31b0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b70764); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82996); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82995); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82994); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a6fa0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "EntityRef" (same body as 008a7e10, __gc FUN_008c31d0); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"EntityRef"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"EntityRef"); lua_pushcclosure(*in_ECX,FUN_008c31d0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityRef"); lua_pushcclosure(*in_ECX,FUN_008c31d0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityRef"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82993); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82992); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82991); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a71b0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "Sprite" (same body as 008a7e10); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Sprite"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Sprite"); lua_pushcclosure(*in_ECX,FUN_008c31f0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Sprite"); lua_pushcclosure(*in_ECX,FUN_008c31f0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Sprite"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82990); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeySprite); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8298e); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a73c0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "Color" (same body as 008a7e10); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Color"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Color"); lua_pushcclosure(*in_ECX,FUN_008c3210,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Color"); lua_pushcclosure(*in_ECX,FUN_008c3210,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Color"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8298d); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8298c); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8298b); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a75d0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "Font" (DAT_00b70424 = "Font"; followed by Font::Load/Unload/GetStringWidth/DrawString registrations); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,&DAT_00b70424); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,&DAT_00b70424); lua_pushcclosure(*in_ECX,FUN_008c3230,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,&DAT_00b70424); lua_pushcclosure(*in_ECX,FUN_008c3230,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500(&DAT_00b70424); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8298a); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82989); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82988); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a77e0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "FontRenderSettings" (same body as 008a7e10); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"FontRenderSettings"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"FontRenderSettings"); lua_pushcclosure(*in_ECX,FUN_008c3250,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"FontRenderSettings"); lua_pushcclosure(*in_ECX,FUN_008c3250,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("FontRenderSettings"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82987); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82986); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82985); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a79f0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "KColor" (same body as 008a7e10); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"KColor"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"KColor"); lua_pushcclosure(*in_ECX,FUN_008c3270,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"KColor"); lua_pushcclosure(*in_ECX,FUN_008c3270,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("KColor"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82984); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82983); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82982); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a7c00 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "Vector" (same body as 008a7e10); from LuaEngine::RegisterAPI */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"Vector"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"Vector"); lua_pushcclosure(*in_ECX,FUN_008c3290,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"Vector"); lua_pushcclosure(*in_ECX,FUN_008c3290,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("Vector"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82981); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&g_luaClassKeyVector); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8297f); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a7e10 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: looks up "EntityPtr" in the namespace table, else creates class/const/static tables ("__class", "__const", "__gc" closures FUN_008c32b0); from LuaEngine::RegisterAPI before EntityPtr::SetReference */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"EntityPtr"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"EntityPtr"); lua_pushcclosure(*in_ECX,FUN_008c32b0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EntityPtr"); lua_pushcclosure(*in_ECX,FUN_008c32b0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EntityPtr"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8297e); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8297d); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c8297c); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008a8020 FUN_008a8020 int FUN_008a8020(uint param_1) { int *in_ECX; if ((uint)(in_ECX[1] - *in_ECX >> 4) <= param_1) { /* WARNING: Subroutine does not return */ FUN_008ba150(); } return *in_ECX + param_1 * 0x10; } //@@ 008a8050 FUN_008a8050 int FUN_008a8050(uint param_1) { int *in_ECX; if ((uint)(in_ECX[1] - *in_ECX >> 3) <= param_1) { /* WARNING: Subroutine does not return */ FUN_008ba150(); } return *in_ECX + param_1 * 8; } //@@ 008a8080 FUN_008a8080 int FUN_008a8080(uint param_1) { int *in_ECX; if ((uint)(in_ECX[1] - *in_ECX >> 2) <= param_1) { /* WARNING: Subroutine does not return */ FUN_008ba150(); } return *in_ECX + param_1 * 4; } //@@ 008a80b0 FUN_008a80b0 void FUN_008a80b0(void) { undefined4 *in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 2)); luaL_unref(*in_ECX,0xfff0b9d8,in_ECX[1]); return; } //@@ 008a80d0 FUN_008a80d0 undefined4 FUN_008a80d0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8297d,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 008a8180 FUN_008a8180 undefined4 FUN_008a8180(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008a81d0 FUN_008a81d0 undefined4 FUN_008a81d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 008a8270 FUN_008a8270 undefined4 FUN_008a8270(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; float10 fVar5; undefined8 local_18; code *local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_18 = *puVar4; local_c = (code *)*puVar3; fVar5 = (float10)(*local_c)(&local_18); local_c = (code *)(float)fVar5; FUN_0085c050(); return 1; } //@@ 008a8310 FUN_008a8310 undefined4 FUN_008a8310(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined4 *puVar4; float10 fVar5; undefined4 local_1c; undefined4 local_18; float local_14; undefined4 local_10; undefined4 local_c; undefined2 local_6; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_c = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,0); local_c = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); local_6 = CONCAT11(local_6._1_1_,iVar1 != 0); fVar5 = (float10)luaL_checknumber(param_1,3); local_10 = CONCAT22(local_10._2_2_,local_6); local_14 = (float)fVar5; puVar4 = (undefined4 *)FUN_008baa50(); local_1c = *puVar4; local_18 = puVar4[1]; iVar1 = (*(code *)*puVar3)(&local_1c,local_14,local_10); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008a8430 FUN_008a8430 undefined4 FUN_008a8430(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; float10 fVar4; undefined4 uStack_18; undefined4 uStack_14; float afStack_10 [3]; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_14 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); uStack_14 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); afStack_10[0] = (float)fVar4; (*(code *)*puVar3)(afStack_10,afStack_10[0]); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = uStack_14; *puVar3 = uStack_18; return 1; } //@@ 008a8510 FUN_008a8510 undefined4 FUN_008a8510(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008a8580 FUN_008a8580 undefined4 FUN_008a8580(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 008a8610 FUN_008a8610 undefined4 FUN_008a8610(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba890(param_1); (*(code *)*puVar2)(local_1c,uStack_18,uStack_14,uStack_10); return 0; } //@@ 008a8680 FUN_008a8680 undefined4 FUN_008a8680(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba890(param_1); (*(code *)*puVar3)(&local_10,local_24,uStack_20,uStack_1c,uStack_18); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = local_c; *puVar3 = local_10; return 1; } //@@ 008a8740 FUN_008a8740 undefined4 FUN_008a8740(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_1c; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_1c = *puVar4; (*(code *)*puVar3)(&local_10,&local_1c); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = local_c; *puVar3 = local_10; return 1; } //@@ 008a8810 FUN_008a8810 undefined4 FUN_008a8810(void *param_1) { float *pfVar1; int iVar2; undefined4 *puVar3; float10 fVar4; float fStack_18; float fStack_14; undefined1 auStack_10 [12]; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); fStack_18 = (float)fVar4; (*(code *)*puVar3)(auStack_10,&fStack_18); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar3[1]; pfVar1[1] = fStack_14; *pfVar1 = fStack_18; return 1; } //@@ 008a88f0 FUN_008a88f0 undefined4 FUN_008a88f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } lua_pushstring(param_1,iVar1); return 1; } //@@ 008a8970 FUN_008a8970 undefined4 FUN_008a8970(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008a89e0 FUN_008a89e0 undefined4 FUN_008a89e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008a8a40 FUN_008a8a40 undefined4 FUN_008a8a40(void *param_1) { undefined2 uVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar1 = luaL_checkinteger(param_1,2); (*(code *)*puVar3)(uVar1); return 0; } //@@ 008a8ab0 FUN_008a8ab0 undefined4 FUN_008a8ab0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c010(); return 1; } //@@ 008a8b10 FUN_008a8b10 undefined4 FUN_008a8b10(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008a8b80 FUN_008a8b80 undefined4 FUN_008a8b80(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 008a8c10 FUN_008a8c10 undefined4 FUN_008a8c10(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008a8c80 FUN_008a8c80 undefined4 FUN_008a8c80(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82986,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008a8ce0 FUN_008a8ce0 undefined4 FUN_008a8ce0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } uVar3 = luaL_checklstring(param_1,2,0); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008a8d80 FUN_008a8d80 undefined4 FUN_008a8d80(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008a8dd0 FUN_008a8dd0 undefined4 FUN_008a8dd0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008a8e40 FUN_008a8e40 undefined4 FUN_008a8e40(void *param_1) { int iVar1; undefined4 *puVar2; undefined1 *puVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar3 = (undefined1 *)luaL_checklstring(param_1,2,0); (*(code *)*puVar2)(*puVar3); FUN_0085bff0(); return 1; } //@@ 008a8ec0 FUN_008a8ec0 undefined4 FUN_008a8ec0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); uVar3 = 0; if (iVar1 != 0) { uVar3 = luaL_checklstring(param_1,2,0); } uVar3 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,uVar3,0); return 1; } //@@ 008a8f60 FUN_008a8f60 undefined4 FUN_008a8f60(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008a8fc0 FUN_008a8fc0 undefined4 FUN_008a8fc0(void *param_1) { uint uVar1; int iVar2; void *pvVar3; undefined4 uVar4; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 local_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 *local_1c; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b053a8; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar2 = lua_type(param_1,1,uVar1); if (iVar2 == 0) { local_14 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,1); local_14 = *(undefined4 *)((int)pvVar3 + 4); } local_1c = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); local_18 = (undefined4 *)FUN_008baab0(param_1); iVar2 = lua_type(param_1,2,uVar1); if (iVar2 == 0) { uVar4 = 0; } else { uVar4 = luaL_checklstring(param_1,2,0); } local_50 = local_18[4]; local_4c = local_18[5]; local_48 = local_18[6]; local_44 = local_18[7]; local_40 = local_18[8]; local_3c = local_18[9]; uStack_38 = local_18[10]; uStack_34 = local_18[0xb]; uStack_30 = local_18[0xc]; local_2c = local_18[0xd]; uStack_28 = local_18[0xe]; uStack_24 = local_18[0xf]; uStack_20 = local_18[0x10]; local_8 = 1; (*(code *)*local_1c)(uVar4,*local_18,local_18[1],local_18[2],local_18[3],&local_50,&local_3c); ExceptionList = local_10; return 0; } //@@ 008a9180 FUN_008a9180 undefined4 FUN_008a9180(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82989,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008a91f0 FUN_008a91f0 undefined4 FUN_008a91f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8298c,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008a9240 FUN_008a9240 undefined4 FUN_008a9240(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8298c,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba890(param_1); (*(code *)*puVar2)(local_1c,uStack_18,uStack_14,uStack_10); return 0; } //@@ 008a92b0 FUN_008a92b0 undefined4 FUN_008a92b0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; float10 fVar4; float10 fVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8298c,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,4); fVar4 = (float10)luaL_checknumber(param_1,3); fVar5 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar5,(float)fVar4,(float)fVar3); return 0; } //@@ 008a9360 FUN_008a9360 undefined4 FUN_008a9360(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined8 uStack_18; undefined4 uStack_10; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8298c,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar3 = (undefined4 *)FUN_008ba900(); uStack_38 = *puVar3; uStack_34 = puVar3[1]; uStack_30 = puVar3[2]; uStack_2c = puVar3[3]; uStack_28 = puVar3[4]; uStack_24 = puVar3[5]; uStack_20 = puVar3[6]; uStack_1c = puVar3[7]; uStack_18 = *(undefined8 *)(puVar3 + 8); uStack_10 = puVar3[10]; iVar1 = (*(code *)*puVar2)(&uStack_38); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8298c); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008a9440 FUN_008a9440 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008a9440(void *param_1) { code *pcVar1; char cVar2; int iVar3; undefined4 *puVar4; char local_50 [32]; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05305; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; iVar3 = lua_type(param_1,1,local_14); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba7c0(param_1); local_8 = 0; pcVar1 = (code *)*puVar4; std::string::string(local_50,local_30); local_8 = CONCAT31(local_8._1_3_,1); cVar2 = (*pcVar1)(local_50); std::string::_Tidy_deallocate(local_50); lua_pushboolean(param_1,cVar2 != '\0'); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 008a9520 FUN_008a9520 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008a9520(void *param_1) { code *pcVar1; int iVar2; undefined4 *puVar3; char local_50 [24]; undefined2 local_38; char local_30 [24]; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05305; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba6d0(param_1); local_8 = 0; pcVar1 = (code *)*puVar3; std::string::string(local_50,local_30); local_38 = (undefined2)local_18; local_8 = CONCAT31(local_8._1_3_,1); (*pcVar1)(local_50,local_18); std::string::_Tidy_deallocate(local_50); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 0; } //@@ 008a95f0 FUN_008a95f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008a95f0(void *param_1) { code *pcVar1; int iVar2; undefined4 *puVar3; char local_58 [24]; undefined4 local_40; undefined4 local_3c; char local_34 [24]; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b053e5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba5e0(param_1); local_8 = 0; pcVar1 = (code *)*puVar3; std::string::string(local_58,local_34); local_40 = local_1c; local_3c = local_18; local_8 = CONCAT31(local_8._1_3_,1); (*pcVar1)(local_58,local_1c); std::string::_Tidy_deallocate(local_58); std::string::_Tidy_deallocate(local_34); ExceptionList = local_10; return 0; } //@@ 008a96d0 FUN_008a96d0 undefined4 FUN_008a96d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008a9740 FUN_008a9740 undefined4 FUN_008a9740(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008a99d0 FUN_008a99d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008a99d0(void *param_1) { code *pcVar1; char cVar2; int iVar3; undefined4 *puVar4; byte *text; void *ptr; uint size; uint local_58; undefined4 local_54; char local_50 [28]; undefined4 local_34; char local_30 [4]; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b05435; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; iVar3 = lua_type(param_1,1,local_14); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,3,&local_58); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,local_58); local_8 = (void *)0x0; std::string::string(local_50,local_2c); local_8 = (void *)0xffffffff; if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_8 = (void *)0x1; local_34 = luaL_checkinteger(param_1,2); std::string::string(local_30,local_50); std::string::_Tidy_deallocate(local_50); local_8 = (void *)0x2; pcVar1 = (code *)*puVar4; local_54 = local_34; std::string::string(local_50,local_30); local_8 = (void *)CONCAT31(local_8._1_3_,3); cVar2 = (*pcVar1)(local_54,local_50); std::string::_Tidy_deallocate(local_50); lua_pushboolean(param_1,cVar2 != '\0'); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 008a9b60 FUN_008a9b60 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008a9b60(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 ****ppppuVar3; uint size; undefined4 ****local_20 [4]; undefined4 local_10; uint local_c; undefined4 ***local_8; local_8 = (undefined4 ***)(__security_cookie ^ (uint)(local_20 + 7)); iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(local_20); ppppuVar3 = local_20; if (0xf < local_c) { ppppuVar3 = local_20[0]; } lua_pushlstring(param_1,ppppuVar3,local_10); if (0xf < local_c) { size = local_c + 1; ppppuVar3 = local_20[0]; if (0xfff < size) { ppppuVar3 = (undefined4 ****)local_20[0][-1]; size = local_c + 0x24; if (0x1f < (uint)((int)local_20[0] + (-4 - (int)ppppuVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar3,size); } return 1; } //@@ 008a9c20 FUN_008a9c20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008a9c20(void *param_1) { code *pcVar1; char cVar2; int iVar3; undefined4 *puVar4; char local_50 [24]; undefined2 local_38; char local_30 [24]; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05305; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; iVar3 = lua_type(param_1,1,local_14); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba6d0(param_1); local_8 = 0; pcVar1 = (code *)*puVar4; std::string::string(local_50,local_30); local_38 = (undefined2)local_18; local_8 = CONCAT31(local_8._1_3_,1); cVar2 = (*pcVar1)(local_50,local_18); std::string::_Tidy_deallocate(local_50); lua_pushboolean(param_1,cVar2 != '\0'); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 1; } //@@ 008a9d10 FUN_008a9d10 undefined4 FUN_008a9d10(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008a9d70 FUN_008a9d70 undefined4 FUN_008a9d70(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008a9df0 FUN_008a9df0 undefined4 FUN_008a9df0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008a9e50 FUN_008a9e50 undefined4 FUN_008a9e50(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008a9eb0 FUN_008a9eb0 undefined4 FUN_008a9eb0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar3 = (undefined4 *)(*(code *)*puVar2)(); puVar2 = puVar3 + 4; if (0xf < (uint)puVar3[5]) { puVar3 = (undefined4 *)*puVar3; } lua_pushlstring(param_1,puVar3,*puVar2); return 1; } //@@ 008a9f20 FUN_008a9f20 undefined4 FUN_008a9f20(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; void *pvVar4; undefined4 *puVar5; undefined4 unaff_ESI; float10 fVar6; undefined4 uStack_50; undefined4 uStack_48; undefined4 uStack_38; undefined4 uStack_34; undefined8 uStack_30; undefined4 uStack_24; undefined4 uStack_20; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_50 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeySprite,1); uStack_50 = *(undefined4 *)((int)pvVar4 + 4); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,5); fVar6 = (float10)luaL_checknumber(param_1,4); iVar1 = lua_type(param_1,3); puVar5 = (undefined4 *)0x0; if (iVar1 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyVector,1); puVar5 = *(undefined4 **)((int)pvVar4 + 4); } uStack_38 = *puVar5; uStack_34 = puVar5[1]; uStack_30 = CONCAT44(uVar3,(float)fVar6); iVar1 = lua_type(param_1,2); puVar5 = (undefined4 *)0x0; if (iVar1 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar5 = *(undefined4 **)((int)pvVar4 + 4); } uStack_24 = *puVar5; uStack_20 = puVar5[1]; (*(code *)*puVar2)(&uStack_38,uStack_24,uStack_20,uStack_38,uStack_34,(undefined4)uStack_30, uStack_30._4_4_); puVar5 = (undefined4 *)lua_newuserdata(param_1,0x1c); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82983); lua_setmetatable(param_1,0xfffffffe); puVar5 = (undefined4 *)puVar5[1]; *puVar5 = unaff_ESI; puVar5[1] = uStack_50; puVar5[2] = puVar2; puVar5[3] = uStack_48; puVar5[4] = (float)fVar6; return 1; } //@@ 008aa0d0 FUN_008aa0d0 undefined4 FUN_008aa0d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82995,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008aa130 FUN_008aa130 undefined4 FUN_008aa130(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82995,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008aa1b0 FUN_008aa1b0 undefined4 FUN_008aa1b0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82995,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); uVar3 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,uVar3,0); return 1; } //@@ 008aa230 FUN_008aa230 undefined4 FUN_008aa230(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82995,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008aa2a0 FUN_008aa2a0 undefined4 FUN_008aa2a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82995,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008aa3e0 FUN_008aa3e0 undefined4 FUN_008aa3e0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 uStack_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyBitSet128,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_14); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_14; puVar2[1] = uStack_10; puVar2[2] = uStack_c; puVar2[3] = uStack_8; return 1; } //@@ 008aa530 FUN_008aa530 undefined4 FUN_008aa530(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyBitSet128,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } lua_pushstring(param_1,iVar1); return 1; } //@@ 008aa5b0 FUN_008aa5b0 undefined4 FUN_008aa5b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyBitSet128,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aa640 FUN_008aa640 undefined4 FUN_008aa640(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyBitSet128,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,iVar1 != 0); return 0; } //@@ 008aa6c0 FUN_008aa6c0 undefined4 FUN_008aa6c0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008aa710 FUN_008aa710 undefined4 FUN_008aa710(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aa790 FUN_008aa790 undefined4 FUN_008aa790(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008aa800 FUN_008aa800 undefined4 FUN_008aa800(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3,iVar1 != 0); return 0; } //@@ 008aa990 FUN_008aa990 undefined4 FUN_008aa990(void *param_1) { char cVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined8 *puVar5; undefined4 local_1c; undefined8 local_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { local_c = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,1); local_c = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar2 != 0); puVar5 = (undefined8 *)FUN_008baa50(); local_18 = *puVar5; local_1c = CONCAT22(local_1c._2_2_,(undefined2)local_8); local_10 = local_1c; cVar1 = (*(code *)*puVar4)(&local_18,local_8); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aaa50 FUN_008aaa50 undefined4 FUN_008aaa50(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aaac0 FUN_008aaac0 undefined4 FUN_008aaac0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined4 local_1c; undefined8 local_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_c = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); local_c = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); puVar4 = (undefined8 *)FUN_008baa50(); local_18 = *puVar4; local_1c = CONCAT22(local_1c._2_2_,(undefined2)local_8); local_10 = local_1c; (*(code *)*puVar3)(&local_18,local_8); return 0; } //@@ 008aab60 FUN_008aab60 undefined4 FUN_008aab60(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008aabc0 FUN_008aabc0 undefined4 FUN_008aabc0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c8299e,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008aac20 FUN_008aac20 undefined4 FUN_008aac20(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aac90 FUN_008aac90 undefined4 FUN_008aac90(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aad00 FUN_008aad00 undefined4 FUN_008aad00(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aad70 FUN_008aad70 undefined4 FUN_008aad70(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined8 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aae00 FUN_008aae00 undefined4 FUN_008aae00(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008aae80 FUN_008aae80 undefined4 FUN_008aae80(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ad,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a6); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008aaf40 FUN_008aaf40 undefined4 FUN_008aaf40(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ad,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a0); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab000 FUN_008ab000 undefined4 FUN_008ab000(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ad,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a3); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab0c0 FUN_008ab0c0 undefined4 FUN_008ab0c0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ad,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a22); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab160 FUN_008ab160 undefined4 FUN_008ab160(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ad,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a23); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab200 FUN_008ab200 undefined4 FUN_008ab200(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ad,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a24); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab2a0 FUN_008ab2a0 undefined4 FUN_008ab2a0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,4); iVar1 = lua_toboolean(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,iVar1 != 0,uVar3); return 0; } //@@ 008ab330 FUN_008ab330 undefined4 FUN_008ab330(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008ab3b0 FUN_008ab3b0 undefined4 FUN_008ab3b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ab440 FUN_008ab440 undefined4 FUN_008ab440(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829b5); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab500 FUN_008ab500 undefined4 FUN_008ab500(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008ab580 FUN_008ab580 undefined4 FUN_008ab580(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008ab5f0 FUN_008ab5f0 undefined4 FUN_008ab5f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b9,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a25); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab690 FUN_008ab690 undefined4 FUN_008ab690(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829bc,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ab750 FUN_008ab750 undefined4 FUN_008ab750(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); LuaRef::push(&local_c,param_1); luaL_unref(local_c,0xfff0b9d8,local_8); return 1; } //@@ 008ab7d0 FUN_008ab7d0 void FUN_008ab7d0(void) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *puVar4; undefined4 *in_EDX; puVar4 = (undefined4 *)lua_newuserdata(); *puVar4 = luabridge::UserdataValue::vftable; puVar4[1] = puVar4 + 2; lua_rawgetp(); lua_setmetatable(); puVar4 = (undefined4 *)puVar4[1]; uVar1 = in_EDX[1]; uVar2 = in_EDX[2]; uVar3 = in_EDX[3]; *puVar4 = *in_EDX; puVar4[1] = uVar1; puVar4[2] = uVar2; puVar4[3] = uVar3; uVar1 = in_EDX[5]; uVar2 = in_EDX[6]; uVar3 = in_EDX[7]; puVar4[4] = in_EDX[4]; puVar4[5] = uVar1; puVar4[6] = uVar2; puVar4[7] = uVar3; *(undefined8 *)(puVar4 + 8) = *(undefined8 *)(in_EDX + 8); puVar4[10] = in_EDX[10]; return; } //@@ 008ab830 FUN_008ab830 undefined4 FUN_008ab830(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008ab880 FUN_008ab880 undefined4 FUN_008ab880(void *param_1) { char cVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined8 *puVar5; undefined8 local_14; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { local_8 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); local_8 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined8 *)FUN_008baa50(); local_14 = *puVar5; cVar1 = (*(code *)*puVar4)(&local_14); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ab920 FUN_008ab920 undefined4 FUN_008ab920(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; char cVar8; int iVar9; undefined4 *puVar10; undefined4 uVar11; undefined4 *puVar12; float10 fVar13; undefined8 uVar14; undefined4 uStack_e4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined4 uStack_a4; float fStack_a0; undefined8 uStack_98; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined8 uStack_78; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined8 uStack_20; undefined4 uStack_18; undefined4 uStack_14; iVar9 = lua_type(param_1,1); if (iVar9 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar10 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar11 = luaL_checkinteger(param_1,5); puVar12 = (undefined4 *)FUN_008badb0(); uStack_60 = *puVar12; uStack_5c = puVar12[1]; uStack_58 = puVar12[2]; uStack_54 = puVar12[3]; uStack_50 = puVar12[4]; uStack_4c = puVar12[5]; uStack_48 = puVar12[6]; uStack_44 = puVar12[7]; uStack_20 = *(undefined8 *)(puVar12 + 8); uStack_14 = uStack_e4; uStack_18 = uVar11; uVar14 = luaL_checkinteger(param_1,3); uVar7 = uStack_5c; uVar6 = uStack_60; uStack_d0 = uStack_58; uStack_cc = uStack_54; uStack_c8 = uStack_50; uStack_c4 = uStack_4c; uStack_c0 = uStack_48; uStack_bc = uStack_44; uStack_b8 = (undefined4)uStack_20; uStack_b4 = uStack_20._4_4_; uStack_b0 = uStack_18; uStack_ac = uStack_14; fVar13 = (float10)luaL_checknumber(param_1,2); uStack_ac = uStack_b4; uStack_b0 = uStack_b8; uVar5 = uStack_bc; uVar4 = uStack_c0; uVar3 = uStack_c4; uVar2 = uStack_c8; uVar1 = uStack_cc; uVar11 = uStack_d0; uStack_90 = uVar6; uStack_8c = uVar7; fStack_a0 = (float)fVar13; uStack_88 = uStack_d0; uStack_84 = uStack_cc; uStack_80 = uStack_c8; uStack_7c = uStack_c4; uStack_78 = CONCAT44(uStack_bc,uStack_c0); uStack_70 = uStack_b8; uStack_6c = uStack_b4; uStack_68 = uStack_18; uStack_64 = uStack_14; uStack_d0 = uVar6; uStack_cc = uVar7; uStack_c8 = uVar11; uStack_c4 = uVar1; uStack_c0 = uVar2; uStack_bc = uVar3; uStack_b8 = uVar4; uStack_b4 = uVar5; uStack_a8 = uStack_18; uStack_a4 = uStack_14; uStack_98 = uVar14; cVar8 = (*(code *)*puVar10)(fStack_a0,uVar14,&uStack_d0,uStack_18); lua_pushboolean(param_1,cVar8 != '\0'); return 1; } //@@ 008abac0 FUN_008abac0 undefined4 FUN_008abac0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008abbe0 FUN_008abbe0 undefined4 FUN_008abbe0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined4 local_1c; undefined8 local_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_c = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); local_c = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); puVar4 = (undefined8 *)FUN_008baa50(); local_18 = *puVar4; local_1c = CONCAT22(local_1c._2_2_,(undefined2)local_8); local_10 = local_1c; (*(code *)*puVar3)(&local_18,local_8); return 0; } //@@ 008abc80 FUN_008abc80 undefined4 FUN_008abc80(void *param_1) { undefined4 uVar1; int iVar2; undefined4 *puVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 *puVar7; undefined2 uStack_66; undefined1 uStack_65; undefined1 uStack_51; undefined1 uStack_50; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined8 uStack_20; undefined4 uStack_18; undefined8 uStack_14; undefined4 uStack_c; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,6); iVar4 = lua_toboolean(param_1,5); uVar5 = luaL_checkinteger(param_1,4); uVar6 = luaL_checkinteger(param_1,3); uVar1 = CONCAT13(uStack_51,CONCAT12(uStack_65,CONCAT11(iVar2 != 0,iVar4 != 0))); puVar7 = (undefined4 *)FUN_008ba900(); uStack_40 = *puVar7; uStack_3c = puVar7[1]; uStack_38 = puVar7[2]; uStack_34 = puVar7[3]; uStack_30 = puVar7[4]; uStack_2c = puVar7[5]; uStack_28 = puVar7[6]; uStack_24 = puVar7[7]; uStack_20 = *(undefined8 *)(puVar7 + 8); uStack_18 = puVar7[10]; uStack_14 = CONCAT44(uVar5,uVar6); uStack_c = uVar1; (*(code *)*puVar3)(&uStack_40,uVar6,uVar5,uVar1, CONCAT13(uStack_50,CONCAT12(uStack_51,CONCAT11(uStack_65,iVar2 != 0)))); return 0; } //@@ 008abda0 FUN_008abda0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008abda0(void *param_1) { code *pcVar1; int iVar2; undefined4 *puVar3; char local_58 [24]; undefined4 local_40; undefined4 local_3c; char local_34 [24]; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b053e5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba5e0(param_1); local_8 = 0; pcVar1 = (code *)*puVar3; std::string::string(local_58,local_34); local_40 = local_1c; local_3c = local_18; local_8 = CONCAT31(local_8._1_3_,1); (*pcVar1)(local_58,local_1c); std::string::_Tidy_deallocate(local_58); std::string::_Tidy_deallocate(local_34); ExceptionList = local_10; return 0; } //@@ 008abe80 FUN_008abe80 undefined4 FUN_008abe80(void *param_1) { undefined4 uVar1; undefined4 uVar2; int iVar3; undefined4 *puVar4; undefined4 uVar5; void *pvVar6; undefined4 *puVar7; float10 fVar8; iVar3 = lua_type(param_1,1); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar5 = luaL_checkinteger(param_1,4); iVar3 = lua_type(param_1,3); if (iVar3 == 0) { puVar7 = (undefined4 *)0x0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyVector,1); puVar7 = *(undefined4 **)((int)pvVar6 + 4); } uVar1 = *puVar7; uVar2 = puVar7[1]; fVar8 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar4)((float)fVar8,uVar1,uVar2,uVar5); return 0; } //@@ 008abf60 FUN_008abf60 undefined4 FUN_008abf60(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008abfe0 FUN_008abfe0 undefined4 FUN_008abfe0(void *param_1) { int iVar1; undefined4 *puVar2; undefined8 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008ac050 FUN_008ac050 undefined4 FUN_008ac050(void *param_1) { int iVar1; undefined4 *puVar2; undefined8 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = (*(code *)*puVar2)(); lua_pushinteger(param_1,uVar3); return 1; } //@@ 008ac0b0 FUN_008ac0b0 undefined4 FUN_008ac0b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined8 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ac240 FUN_008ac240 undefined4 FUN_008ac240(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *puVar4; undefined2 uStack_7e; undefined4 uStack_74; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); uStack_7e = CONCAT11(uStack_7e._1_1_,iVar1 != 0); uVar3 = luaL_checkinteger(param_1,3); uStack_74 = CONCAT22(uStack_74._2_2_,uStack_7e); puVar4 = (undefined4 *)FUN_008badb0(); uStack_40 = *puVar4; uStack_3c = puVar4[1]; uStack_38 = puVar4[2]; uStack_34 = puVar4[3]; uStack_30 = puVar4[4]; uStack_2c = puVar4[5]; uStack_28 = puVar4[6]; uStack_24 = puVar4[7]; uStack_50 = (undefined4)*(undefined8 *)(puVar4 + 8); uStack_4c = (undefined4)((ulonglong)*(undefined8 *)(puVar4 + 8) >> 0x20); uStack_20 = uStack_50; uStack_1c = uStack_4c; uStack_14 = uStack_74; uStack_18 = uVar3; (*(code *)*puVar2)(&uStack_40,uVar3,uStack_74); return 0; } //@@ 008ac310 FUN_008ac310 undefined4 FUN_008ac310(void *param_1) { undefined8 uVar1; undefined4 uVar2; int iVar3; undefined4 *puVar4; int iVar5; void *pvVar6; undefined4 uVar7; undefined4 *puVar8; float10 fVar9; undefined2 uStack_a2; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined8 uStack_68; undefined4 uStack_60; float fStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined8 uStack_38; undefined4 uStack_30; undefined2 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; iVar3 = lua_type(param_1,1); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_toboolean(param_1,6); uStack_a2 = CONCAT11(uStack_a2._1_1_,iVar3 != 0); iVar5 = lua_type(param_1,5); if (iVar5 == 0) { puVar8 = (undefined4 *)0x0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,5,&DAT_00c8298c,1); puVar8 = *(undefined4 **)((int)pvVar6 + 4); } uStack_28 = *puVar8; uStack_24 = puVar8[1]; uStack_20 = puVar8[2]; uStack_1c = puVar8[3]; uStack_18 = puVar8[4]; uStack_14 = puVar8[5]; uStack_10 = puVar8[6]; uStack_c = puVar8[7]; uVar1 = *(undefined8 *)(puVar8 + 8); uVar2 = puVar8[10]; fVar9 = (float10)luaL_checknumber(param_1,4); uVar7 = luaL_checkinteger(param_1,3); puVar8 = (undefined4 *)FUN_008badb0(); uStack_88 = *puVar8; uStack_84 = puVar8[1]; uStack_80 = puVar8[2]; uStack_7c = puVar8[3]; uStack_78 = puVar8[4]; uStack_74 = puVar8[5]; uStack_70 = puVar8[6]; uStack_6c = puVar8[7]; uStack_58 = uStack_28; uStack_54 = uStack_24; uStack_50 = uStack_20; uStack_4c = uStack_1c; uStack_68 = *(undefined8 *)(puVar8 + 8); uStack_2c = uStack_a2; uStack_48 = uStack_18; uStack_44 = uStack_14; uStack_40 = uStack_10; uStack_3c = uStack_c; uStack_60 = uVar7; fStack_5c = (float)fVar9; uStack_38 = uVar1; uStack_30 = uVar2; (*(code *)*puVar4)(&uStack_88,uVar7,(float)fVar9,uStack_28,uStack_24,uStack_20,uStack_1c,uStack_18 ,uStack_14,uStack_10,uStack_c,uVar1,uVar2,iVar3 != 0); return 0; } //@@ 008ac4d0 FUN_008ac4d0 undefined4 FUN_008ac4d0(void *param_1) { int iVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; undefined4 *puVar5; undefined2 uStack_85; undefined1 uStack_84; undefined1 uStack_75; undefined1 uStack_74; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,5); iVar3 = lua_toboolean(param_1,4); uVar4 = luaL_checkinteger(param_1,3); puVar5 = (undefined4 *)FUN_008badb0(); uStack_40 = *puVar5; uStack_3c = puVar5[1]; uStack_38 = puVar5[2]; uStack_34 = puVar5[3]; uStack_30 = puVar5[4]; uStack_2c = puVar5[5]; uStack_28 = puVar5[6]; uStack_24 = puVar5[7]; uStack_14 = CONCAT13(uStack_75,CONCAT12(uStack_84,CONCAT11(iVar1 != 0,iVar3 != 0))); uStack_50 = (undefined4)*(undefined8 *)(puVar5 + 8); uStack_4c = (undefined4)((ulonglong)*(undefined8 *)(puVar5 + 8) >> 0x20); uStack_20 = uStack_50; uStack_1c = uStack_4c; uStack_18 = uVar4; (*(code *)*puVar2)(&uStack_40,uVar4,uStack_14, CONCAT13(uStack_74,CONCAT12(uStack_75,CONCAT11(uStack_84,iVar1 != 0)))); return 0; } //@@ 008ac5d0 FUN_008ac5d0 undefined4 FUN_008ac5d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ac670 FUN_008ac670 undefined4 FUN_008ac670(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); uVar5 = 0; if (iVar2 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } cVar1 = (*(code *)*puVar3)(uVar5); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ac720 FUN_008ac720 undefined4 FUN_008ac720(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,3); uVar5 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar5,uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ac7b0 FUN_008ac7b0 undefined4 FUN_008ac7b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82995); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ac850 FUN_008ac850 undefined4 FUN_008ac850(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeySprite); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ac8f0 FUN_008ac8f0 undefined4 FUN_008ac8f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008ac960 FUN_008ac960 undefined4 FUN_008ac960(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); return 0; } //@@ 008ac9f0 FUN_008ac9f0 undefined4 FUN_008ac9f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008aca40 FUN_008aca40 undefined4 FUN_008aca40(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } lua_pushstring(param_1,iVar1); return 1; } //@@ 008acac0 FUN_008acac0 undefined4 FUN_008acac0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,iVar1 != 0); return 0; } //@@ 008acb40 FUN_008acb40 undefined4 FUN_008acb40(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008acbb0 FUN_008acbb0 undefined4 FUN_008acbb0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined2 uStack_1a; undefined1 auStack_18 [12]; uint uStack_c; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); uStack_1a = CONCAT11(uStack_1a._1_1_,iVar1 != 0); iVar1 = lua_toboolean(param_1,3); auStack_18._1_2_ = uStack_1a; auStack_18[0] = iVar1 != 0; uVar3 = luaL_checkinteger(param_1,2); uStack_c = CONCAT13(uStack_c._3_1_,auStack_18._0_3_); (*(code *)*puVar2)(uVar3,auStack_18._0_3_,uStack_c >> 8); return 0; } //@@ 008acc70 FUN_008acc70 undefined4 FUN_008acc70(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008acd00 FUN_008acd00 undefined4 FUN_008acd00(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008acd60 FUN_008acd60 undefined4 FUN_008acd60(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008acdb0 FUN_008acdb0 undefined4 FUN_008acdb0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; iVar1 = (*(code *)*puVar3)(&local_14); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ad0c0 FUN_008ad0c0 undefined4 FUN_008ad0c0(void *param_1) { int iVar1; undefined4 *puVar2; int iVar3; void *pvVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); iVar3 = lua_type(param_1,2); uVar5 = 0; if (iVar3 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyItem,1); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } (*(code *)*puVar2)(uVar5,iVar1 != 0); return 0; } //@@ 008ad170 FUN_008ad170 undefined4 FUN_008ad170(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyItem,1); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 008ad220 FUN_008ad220 undefined4 FUN_008ad220(void *param_1) { undefined1 uVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; void *pvVar6; undefined4 uVar7; undefined4 local_20; undefined4 uStack_1c; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,5); uVar1 = luaL_checkinteger(param_1,4); _local_20 = CONCAT44(uVar4,local_20); _local_20 = CONCAT71(stack0xffffffe1,uVar1); uVar5 = luaL_checkinteger(param_1,3); iVar2 = lua_type(param_1,2); uVar7 = 0; if (iVar2 != 0) { pvVar6 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyItem,1); uVar7 = *(undefined4 *)((int)pvVar6 + 4); } (*(code *)*puVar3)(uVar7,uVar5,local_20,uVar4); return 0; } //@@ 008ad400 FUN_008ad400 undefined4 FUN_008ad400(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined4 local_1c; undefined8 local_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_c = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_c = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); puVar4 = (undefined8 *)FUN_008baa50(); local_18 = *puVar4; local_1c = CONCAT22(local_1c._2_2_,(undefined2)local_8); local_10 = local_1c; iVar1 = (*(code *)*puVar3)(&local_18,local_8); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829cb); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ad5b0 FUN_008ad5b0 undefined4 FUN_008ad5b0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; int iVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,5); uVar3 = luaL_checkinteger(param_1,4); iVar4 = lua_toboolean(param_1,3); uVar5 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar5,iVar4 != 0,uVar3,iVar1 != 0); return 0; } //@@ 008ad660 FUN_008ad660 undefined4 FUN_008ad660(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008ad6e0 FUN_008ad6e0 undefined4 FUN_008ad6e0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008ad760 FUN_008ad760 undefined4 FUN_008ad760(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ad7f0 FUN_008ad7f0 undefined4 FUN_008ad7f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined2 uStack_1a; undefined1 auStack_18 [12]; uint uStack_c; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); uStack_1a = CONCAT11(uStack_1a._1_1_,iVar1 != 0); iVar1 = lua_toboolean(param_1,3); auStack_18._1_2_ = uStack_1a; auStack_18[0] = iVar1 != 0; uVar3 = luaL_checkinteger(param_1,2); uStack_c = CONCAT13(uStack_c._3_1_,auStack_18._0_3_); iVar1 = (*(code *)*puVar2)(uVar3,auStack_18._0_3_,uStack_c >> 8); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008ad8c0 FUN_008ad8c0 undefined4 FUN_008ad8c0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a26); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ad980 FUN_008ad980 undefined4 FUN_008ad980(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,3); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4,iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ada20 FUN_008ada20 undefined4 FUN_008ada20(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3,iVar1 != 0); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008adab0 FUN_008adab0 undefined4 FUN_008adab0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008adb50 FUN_008adb50 undefined4 FUN_008adb50(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 008adbf0 FUN_008adbf0 undefined4 FUN_008adbf0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); (*(code *)*puVar2)(&local_18,local_8); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_18; puVar2[1] = uStack_14; puVar2[2] = uStack_10; puVar2[3] = uStack_c; return 1; } //@@ 008add60 FUN_008add60 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008add60(void *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 *puVar4; float10 fVar5; float fVar6; void *local_a8; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 *puStack_9c; float fStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined8 uStack_64; undefined4 uStack_5c; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; uint local_c; local_c = __security_cookie ^ (uint)&local_a8; local_a8 = param_1; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_a0 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); uStack_a0 = *(undefined4 *)((int)pvVar2 + 4); } puStack_9c = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,5); if (iVar1 == 0) { uStack_a4 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,5,&g_luaClassKeyEntity,0); uStack_a4 = *(undefined4 *)((int)pvVar2 + 4); } uStack_84 = luaL_checkinteger(param_1,4); uStack_80 = uStack_a4; fVar5 = (float10)luaL_checknumber(local_a8,3); uStack_90 = uStack_84; uStack_8c = uStack_80; fStack_94 = (float)fVar5; uVar3 = luaL_checkinteger(local_a8,2); fVar6 = fStack_94; (*(code *)*puStack_9c)(&uStack_78,uVar3,fStack_94,uStack_90,uStack_8c); puVar4 = (undefined4 *)lua_newuserdata(fVar6,0x70); *puVar4 = luabridge::UserdataValue::vftable; puVar4[1] = puVar4 + 2; lua_rawgetp(fVar6,0xfff0b9d8,&DAT_00c829b0); lua_setmetatable(fVar6,0xfffffffe); puVar4 = (undefined4 *)puVar4[1]; *puVar4 = uStack_8c; puVar4[1] = uStack_88; puVar4[2] = uStack_84; puVar4[3] = uStack_80; puVar4[4] = uStack_7c; puVar4[5] = uStack_78; puVar4[6] = uStack_74; puVar4[7] = uStack_70; puVar4[8] = uStack_6c; puVar4[9] = uStack_68; *(undefined8 *)(puVar4 + 10) = uStack_64; puVar4[0xc] = uStack_5c; puVar4[0xe] = uStack_54; puVar4[0xf] = uStack_50; puVar4[0x10] = uStack_4c; puVar4[0x11] = uStack_48; puVar4[0x12] = uStack_44; puVar4[0x13] = uStack_40; puVar4[0x14] = uStack_3c; puVar4[0x15] = uStack_38; puVar4[0x16] = uStack_34; puVar4[0x17] = uStack_30; puVar4[0x18] = uStack_2c; return 1; } //@@ 008adf50 FUN_008adf50 undefined4 FUN_008adf50(void *param_1) { undefined2 uVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined2 *puVar7; undefined4 *puVar8; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } local_8 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,5); uVar4 = luaL_checkinteger(param_1,4); uVar5 = luaL_checkinteger(param_1,3); uVar6 = luaL_checkinteger(param_1,2); puVar7 = (undefined2 *)(*(code *)*local_8)((int)&local_8 + 2,uVar6,uVar5,uVar4,uVar3); uVar1 = *puVar7; puVar8 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar8 = luabridge::UserdataValue::vftable; puVar8[1] = puVar8 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a38); lua_setmetatable(param_1,0xfffffffe); *(undefined2 *)puVar8[1] = uVar1; return 1; } //@@ 008ae040 FUN_008ae040 undefined4 FUN_008ae040(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829b9); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ae0e0 FUN_008ae0e0 undefined4 FUN_008ae0e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ae180 FUN_008ae180 undefined4 FUN_008ae180(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,4); if (iVar1 == 0) { local_8 = 0; } else { local_8 = luaL_checklstring(param_1,4,0); } iVar1 = lua_type(param_1,3); if (iVar1 == 0) { uVar4 = 0; } else { uVar4 = luaL_checklstring(param_1,3,0); } uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,uVar4,local_8); return 0; } //@@ 008ae240 FUN_008ae240 undefined4 FUN_008ae240(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,3); if (iVar1 == 0) { uVar4 = 0; } else { uVar4 = luaL_checklstring(param_1,3,0); } uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,uVar4); return 0; } //@@ 008ae2d0 luabridge::CFunc::CallMember::f /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: luabridge member thunk: pushed as a C closure (push 0x8ae2d0 at 882422) whose upvalue is Entity_Player::AnimatePickup (0x7ab130), registered as "AnimatePickup" (0xb71de8); self EntityPlayer, arg 2 Sprite by value ("nil passed to reference", ANM2::ANM2 copy), arg 3 bool, arg 4 optional string */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { code *pcVar1; int iVar2; void *pvVar3; ANM2 *other; ANM2 local_26c; undefined4 local_158; undefined4 uStack_154; undefined4 *local_150; undefined4 local_14c; undefined4 uStack_148; undefined4 *local_13c; undefined4 local_138; ANM2 local_134; undefined4 local_20; undefined4 uStack_1c; undefined4 *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0547b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)((&local_134)[1]._animDefaultName._buf + 4); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 == 0) { local_138 = 0; } else { pvVar3 = Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_138 = *(undefined4 *)((int)pvVar3 + 4); } local_13c = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,4); if (iVar2 == 0) { uStack_148 = 0; } else { uStack_148 = luaL_checklstring(param_1,4,0); } iVar2 = lua_toboolean(param_1,3); local_14c = CONCAT31(local_14c._1_3_,iVar2 != 0); iVar2 = lua_type(param_1,2); if (iVar2 == 0) { other = (ANM2 *)0x0; } else { pvVar3 = Userdata::getClass(param_1,2,&g_luaClassKeySprite,1); other = *(ANM2 **)((int)pvVar3 + 4); if (other != (ANM2 *)0x0) goto LAB_008ae3c0; } luaL_error(param_1,"nil passed to reference"); LAB_008ae3c0: ANM2::ANM2(&local_134,other); local_20 = local_14c; uStack_1c = uStack_148; local_18 = local_13c; local_8 = 0; pcVar1 = (code *)*local_13c; ANM2::ANM2(&local_26c,&local_134); local_158 = local_20; uStack_154 = uStack_1c; local_150 = local_18; local_8._0_1_ = 1; (*pcVar1)(&local_26c,local_20,uStack_1c); local_8 = CONCAT31(local_8._1_3_,2); ANM2::Reset(&local_26c); AnimationState::~AnimationState(&local_26c._overlayAnimState); AnimationState::~AnimationState(&local_26c._animState); std::string::_Tidy_deallocate(local_26c._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_26c); local_8 = 3; ANM2::Reset(&local_134); AnimationState::~AnimationState(&local_134._overlayAnimState); AnimationState::~AnimationState(&local_134._animState); std::string::_Tidy_deallocate(local_134._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_134); ExceptionList = local_10; return 0; } //@@ 008ae4d0 FUN_008ae4d0 undefined4 FUN_008ae4d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } uVar3 = luaL_checklstring(param_1,2,0); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008ae570 FUN_008ae570 undefined4 FUN_008ae570(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,4); uVar4 = luaL_checkinteger(param_1,3); uVar5 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar5,uVar4,uVar3); return 0; } //@@ 008ae600 FUN_008ae600 undefined4 FUN_008ae600(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined8 uVar5; undefined4 uStack_14; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,3); if (iVar2 == 0) { uStack_14 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,3,&DAT_00c82992,1); uStack_14 = *(undefined4 *)((int)pvVar4 + 4); } uVar5 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar5,uStack_14); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008ae6c0 FUN_008ae6c0 undefined4 FUN_008ae6c0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 uVar4; float10 fVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,3); if (iVar1 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyEntity,0); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } fVar5 = (float10)luaL_checknumber(param_1,2); iVar1 = (*(code *)*puVar2)((float)fVar5,uVar4); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityLaser); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ae7b0 FUN_008ae7b0 undefined4 FUN_008ae7b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82991); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008ae850 FUN_008ae850 undefined4 FUN_008ae850(void *param_1) { int iVar1; undefined4 *puVar2; undefined8 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = (*(code *)*puVar2)(); FUN_0085c030(uVar3); return 1; } //@@ 008ae8b0 FUN_008ae8b0 undefined4 FUN_008ae8b0(void *param_1) { undefined4 uVar1; undefined4 uVar2; float fVar3; float fVar4; int iVar5; undefined4 *puVar6; void *pvVar7; undefined4 uVar8; undefined4 *puVar9; float10 fVar10; undefined4 uStack_50; float fStack_4c; undefined4 uStack_48; undefined4 uStack_44; float fStack_40; undefined4 uStack_3c; float fStack_38; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; float fStack_18; iVar5 = lua_type(param_1,1); if (iVar5 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar6 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar10 = (float10)luaL_checknumber(param_1,6); iVar5 = lua_type(param_1,5); uStack_50 = 0; if (iVar5 != 0) { pvVar7 = luabridge::Userdata::getClass(param_1,5,&g_luaClassKeyEntity,0); uStack_50 = *(undefined4 *)((int)pvVar7 + 4); } fStack_4c = (float)fVar10; uVar8 = luaL_checkinteger(param_1,4); fVar3 = fStack_4c; uVar1 = uStack_50; iVar5 = lua_type(param_1,3); puVar9 = (undefined4 *)0x0; if (iVar5 != 0) { pvVar7 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyVector,1); puVar9 = *(undefined4 **)((int)pvVar7 + 4); } uStack_50 = *puVar9; fStack_4c = (float)puVar9[1]; uStack_44 = uVar1; fStack_40 = fVar3; uStack_48 = uVar8; puVar9 = (undefined4 *)FUN_008baa50(); uStack_3c = uStack_44; fStack_40 = (float)uStack_48; fVar4 = fStack_4c; uVar2 = uStack_50; uStack_30 = *puVar9; uStack_2c = puVar9[1]; fStack_18 = fVar3; uStack_28 = uStack_50; uStack_24 = fStack_4c; uStack_20 = uStack_48; uStack_1c = uStack_44; uStack_48 = uStack_50; uStack_44 = fStack_4c; fStack_38 = fVar3; uStack_50 = uStack_30; fStack_4c = (float)uStack_2c; iVar5 = (*(code *)*puVar6)(&uStack_50,uVar2,fVar4,uVar8,uVar1,fVar3); if (iVar5 == 0) { lua_pushnil(param_1); return 1; } puVar6 = (undefined4 *)lua_newuserdata(param_1,8); *puVar6 = luabridge::UserdataPtr::vftable; puVar6[1] = iVar5; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityTear); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008aed10 luabridge::CFunc::CallMember::f /* DB: lua C closure pushed by FUN_00882bd0 with upvalue Entity_Player::FireTechLaser and registered as "FireTechLaser": luabridge::Userdata::getClass(g_luaClassKeyEntityPlayer) for self, luaL_checknumber/checkinteger/toboolean args, optional Entity arg 7, Vector args via FUN_008baa50 */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { float fVar1; float fVar2; undefined4 uVar3; float fVar4; undefined4 uVar5; int iVar6; undefined4 *puVar7; void *pvVar8; undefined4 *puVar9; float fVar10; float *pfVar11; float10 fVar12; float fStack_90; float fStack_8c; float fStack_88; undefined4 uStack_84; float fStack_80; undefined4 uStack_7c; float fStack_78; undefined4 uStack_74; float fStack_70; undefined4 uStack_6c; float fStack_60; float fStack_5c; float fStack_58; float fStack_54; undefined4 uStack_50; undefined4 uStack_4c; float fStack_48; undefined4 uStack_44; float fStack_40; undefined4 uStack_3c; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; float fStack_24; undefined4 uStack_20; float fStack_1c; iVar6 = lua_type(param_1,1); if (iVar6 != 0) { Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar7 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar12 = (float10)luaL_checknumber(param_1,8); fStack_90 = (float)fVar12; iVar6 = lua_type(param_1,7); fStack_60 = 0.0; if (iVar6 != 0) { pvVar8 = Userdata::getClass(param_1,7,&g_luaClassKeyEntity,0); fStack_60 = *(float *)((int)pvVar8 + 4); } fStack_5c = fStack_90; iVar6 = lua_toboolean(param_1,6); fStack_88 = fStack_5c; uStack_84 = fStack_8c; fStack_90 = (float)CONCAT31(fStack_90._1_3_,iVar6 != 0); fStack_8c = fStack_60; iVar6 = lua_toboolean(param_1,5); fStack_60 = (float)CONCAT31(fStack_60._1_3_,iVar6 != 0); fStack_5c = fStack_90; fStack_58 = fStack_8c; fStack_54 = fStack_88; uStack_50 = uStack_84; puVar9 = (undefined4 *)FUN_008baa50(); uVar3 = uStack_84; uStack_30 = *puVar9; uStack_2c = puVar9[1]; uStack_28 = fStack_60; fStack_24 = fStack_5c; uStack_20 = fStack_58; fStack_1c = fStack_54; fVar10 = (float)luaL_checkinteger(param_1,3); uStack_74 = uVar3; fStack_8c = (float)uStack_30; fStack_88 = (float)uStack_2c; uStack_84 = uStack_28; fStack_80 = fStack_24; uStack_7c = fStack_58; fStack_78 = fStack_54; fStack_90 = fVar10; pfVar11 = (float *)FUN_008baa50(); uStack_6c = uStack_74; fStack_70 = fStack_78; uVar5 = uStack_7c; fVar4 = fStack_80; uVar3 = uStack_84; fVar2 = fStack_88; fVar1 = fStack_8c; fStack_48 = fStack_80; uStack_44 = uStack_7c; fStack_40 = fStack_78; uStack_3c = uStack_74; fStack_60 = *pfVar11; fStack_5c = pfVar11[1]; fStack_58 = fStack_90; fStack_54 = fStack_8c; uStack_50 = fStack_88; uStack_4c = uStack_84; _fStack_8c = CONCAT44(fStack_90,fStack_5c); uStack_84 = fVar1; fStack_80 = fVar2; uStack_7c = uVar3; fStack_78 = fVar4; uStack_74 = uVar5; fStack_90 = fStack_60; iVar6 = (*(code *)*puVar7)(&fStack_90,fVar10,&uStack_84,uStack_28,fVar4,uVar5,fStack_70); if (iVar6 == 0) { lua_pushnil(param_1); return 1; } puVar7 = (undefined4 *)lua_newuserdata(param_1,8); *puVar7 = UserdataPtr::vftable; puVar7[1] = iVar6; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityLaser); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008aef50 FUN_008aef50 undefined4 FUN_008aef50(void *param_1) { float fVar1; float fVar2; int iVar3; undefined4 *puVar4; void *pvVar5; float *pfVar6; float10 fVar7; float fStack_50; float fStack_4c; float fStack_48; float fStack_44; float fStack_40; float fStack_3c; float fStack_38; float fStack_30; float fStack_2c; undefined8 uStack_28; float fStack_20; float fStack_1c; float fStack_18; iVar3 = lua_type(param_1,1); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar7 = (float10)luaL_checknumber(param_1,6); iVar3 = lua_type(param_1,5); fStack_50 = 0.0; if (iVar3 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,5,&g_luaClassKeyEntity,0); fStack_50 = *(float *)((int)pvVar5 + 4); } fStack_4c = (float)fVar7; fVar7 = (float10)luaL_checknumber(param_1,4); fVar2 = fStack_4c; fVar1 = fStack_50; pfVar6 = (float *)FUN_008baa50(); fStack_50 = *pfVar6; fStack_4c = pfVar6[1]; fStack_44 = fVar1; fStack_40 = fVar2; fStack_48 = (float)fVar7; pfVar6 = (float *)FUN_008baa50(); fStack_3c = fStack_44; fStack_40 = fStack_48; fStack_30 = *pfVar6; fStack_2c = pfVar6[1]; uStack_28 = CONCAT44(fStack_4c,fStack_50); fStack_20 = fStack_48; fStack_1c = fStack_44; fStack_18 = fVar2; fStack_48 = fStack_50; fStack_44 = fStack_4c; fStack_38 = fVar2; fStack_50 = fStack_30; fStack_4c = fStack_2c; iVar3 = (*(code *)*puVar4)(&fStack_50,&fStack_48,(float)fVar7,fVar1,fVar2); if (iVar3 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar3; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityLaser); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008af270 FUN_008af270 undefined4 FUN_008af270(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82995); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008af330 FUN_008af330 undefined4 FUN_008af330(void *param_1) { char cVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined8 *puVar5; undefined8 local_14; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { local_8 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_8 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined8 *)FUN_008baa50(); local_14 = *puVar5; cVar1 = (*(code *)*puVar4)(&local_14); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008af3d0 FUN_008af3d0 undefined4 FUN_008af3d0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_44 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); uStack_44 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar3)(&uStack_40,uVar4); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x2c); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a20); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; *puVar3 = uStack_48; puVar3[1] = uStack_44; puVar3[2] = uStack_40; puVar3[3] = uStack_3c; puVar3[4] = uStack_38; puVar3[5] = uStack_34; puVar3[6] = uStack_30; puVar3[7] = uStack_2c; puVar3[8] = uStack_28; return 1; } //@@ 008af4a0 FUN_008af4a0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008af4a0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_50; undefined4 uStack_4c; undefined4 uStack_38; undefined4 uStack_34; undefined1 auStack_24 [28]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(auStack_24 + 0x20); iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba500(param_1); (*(code *)*puVar2)(local_50,uStack_4c,auStack_24,uStack_38,uStack_34); return 0; } //@@ 008af670 FUN_008af670 undefined4 FUN_008af670(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined4 local_20; undefined8 local_1c; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_10 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); local_10 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); puVar4 = (undefined8 *)FUN_008baa50(); local_1c = *puVar4; local_20 = CONCAT22(local_20._2_2_,(undefined2)local_8); local_14 = local_20; (*(code *)*puVar3)(&local_c,&local_1c,local_8); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = local_8; *puVar3 = local_c; return 1; } //@@ 008af990 FUN_008af990 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008af990(void *param_1) { code *pcVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; byte *text; void *pvVar5; uint size; uint local_64; undefined4 local_60; undefined4 local_5c; char local_58 [24]; undefined4 local_40; undefined4 *local_3c; undefined4 local_38; char local_34 [8]; void *local_2c [4]; undefined4 local_1c; undefined4 *local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b05525; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 == 0) { local_60 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_60 = *(undefined4 *)((int)pvVar5 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,4); text = (byte *)luaL_checklstring(param_1,3,&local_64); local_1c = 0; local_18 = (undefined4 *)0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,local_64); local_8 = (void *)0x0; std::string::string(local_58,local_2c); local_8 = (void *)0xffffffff; local_40 = uVar4; local_3c = puVar3; if (0xf < local_18) { size = (int)local_18 + 1; pvVar5 = local_2c[0]; if (0xfff < size) { pvVar5 = *(void **)((int)local_2c[0] + -4); size = (int)local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,size); } local_8 = (void *)0x1; iVar2 = lua_type(param_1,2); local_38 = 0; if (iVar2 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyItem,1); local_38 = *(undefined4 *)((int)pvVar5 + 4); } std::string::string(local_34,local_58); local_18 = local_3c; local_1c = local_40; std::string::_Tidy_deallocate(local_58); local_8 = (void *)0x2; local_5c = local_38; pcVar1 = (code *)*puVar3; std::string::string(local_58,local_34); local_40 = local_1c; local_3c = local_18; local_8 = (void *)CONCAT31(local_8._1_3_,3); (*pcVar1)(local_5c,local_58,local_1c); std::string::_Tidy_deallocate(local_58); std::string::_Tidy_deallocate(local_34); ExceptionList = local_10; return 0; } //@@ 008afb60 FUN_008afb60 undefined4 FUN_008afb60(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityLaser); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008afc20 FUN_008afc20 undefined4 FUN_008afc20(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; iVar1 = (*(code *)*puVar3)(&local_14); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ce); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008afcf0 FUN_008afcf0 undefined4 FUN_008afcf0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); FUN_0085bfd0(); return 1; } //@@ 008afd70 FUN_008afd70 undefined4 FUN_008afd70(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008afe10 FUN_008afe10 undefined4 FUN_008afe10(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); uVar5 = 0; if (iVar2 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } cVar1 = (*(code *)*puVar3)(uVar5); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008afec0 FUN_008afec0 undefined4 FUN_008afec0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined4 local_1c; undefined8 local_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_c = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_c = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); puVar4 = (undefined8 *)FUN_008baa50(); local_18 = *puVar4; local_1c = CONCAT22(local_1c._2_2_,(undefined2)local_8); local_10 = local_1c; iVar1 = (*(code *)*puVar3)(&local_18,local_8); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityFamiliar); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b04b0 FUN_008b04b0 undefined4 FUN_008b04b0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; iVar1 = (*(code *)*puVar3)(&local_14); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityFamiliar); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b0580 FUN_008b0580 undefined4 FUN_008b0580(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3,iVar1 != 0); return 0; } //@@ 008b0610 FUN_008b0610 undefined4 FUN_008b0610(void *param_1) { uint uVar1; int iVar2; undefined4 *puVar3; int iVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 local_8; undefined1 uStack_5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,7); iVar4 = lua_toboolean(param_1,6); iVar5 = lua_toboolean(param_1,5); uVar1 = CONCAT13(uStack_5,(int3)CONCAT31(CONCAT21(CONCAT11(uStack_5,iVar2 != 0),iVar4 != 0), iVar5 != 0)); uVar6 = luaL_checkinteger(param_1,4); uVar7 = luaL_checkinteger(param_1,3); uVar8 = luaL_checkinteger(param_1,2); (*(code *)*puVar3)(uVar8,uVar7,uVar6,uVar1,uVar1 >> 8,uVar1 >> 0x10); return 0; } //@@ 008b06e0 FUN_008b06e0 undefined4 FUN_008b06e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b0730 FUN_008b0730 undefined4 FUN_008b0730(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); uVar5 = 0; if (iVar2 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntityPlayer,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } cVar1 = (*(code *)*puVar3)(uVar5); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b07e0 FUN_008b07e0 undefined4 FUN_008b07e0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b0850 FUN_008b0850 undefined4 FUN_008b0850(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 008b0900 FUN_008b0900 undefined4 FUN_008b0900(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,3); fVar4 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar4,(float)fVar3); return 0; } //@@ 008b0ad0 FUN_008b0ad0 undefined4 FUN_008b0ad0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b0b20 FUN_008b0b20 undefined4 FUN_008b0b20(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); return 0; } //@@ 008b0bb0 FUN_008b0bb0 undefined4 FUN_008b0bb0(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_1c; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_1c = *puVar4; (*(code *)*puVar3)(&local_10,&local_1c); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = local_c; *puVar3 = local_10; return 1; } //@@ 008b0c80 FUN_008b0c80 undefined4 FUN_008b0c80(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined4 local_1c; undefined8 local_18; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_c = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); local_c = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); local_8 = CONCAT31(local_8._1_3_,iVar1 != 0); puVar4 = (undefined8 *)FUN_008baa50(); local_18 = *puVar4; local_1c = CONCAT22(local_1c._2_2_,(undefined2)local_8); local_10 = local_1c; iVar1 = (*(code *)*puVar3)(&local_18,local_8); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityTear); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b0d70 FUN_008b0d70 undefined4 FUN_008b0d70(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 008b0e00 FUN_008b0e00 undefined4 FUN_008b0e00(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3,iVar1 != 0); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b0e90 FUN_008b0e90 undefined4 FUN_008b0e90(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,5); uVar4 = luaL_checkinteger(param_1,4); uVar5 = luaL_checkinteger(param_1,3); uVar6 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar6,uVar5,uVar4,uVar3); return 0; } //@@ 008b0f30 FUN_008b0f30 undefined4 FUN_008b0f30(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b0f80 FUN_008b0f80 undefined4 FUN_008b0f80(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b1020 FUN_008b1020 undefined4 FUN_008b1020(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; float10 fVar4; undefined4 uStack_18; undefined4 uStack_14; float afStack_10 [3]; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_14 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); uStack_14 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); afStack_10[0] = (float)fVar4; (*(code *)*puVar3)(afStack_10,afStack_10[0]); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = uStack_14; *puVar3 = uStack_18; return 1; } //@@ 008b1100 FUN_008b1100 undefined4 FUN_008b1100(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b1160 FUN_008b1160 undefined4 FUN_008b1160(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); puVar5 = (undefined4 *)0x0; if (iVar2 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar5 = *(undefined4 **)((int)pvVar4 + 4); } cVar1 = (*(code *)*puVar3)(*puVar5,puVar5[1]); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b1220 FUN_008b1220 undefined4 FUN_008b1220(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3,iVar1 != 0); return 0; } //@@ 008b13b0 FUN_008b13b0 undefined4 FUN_008b13b0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); iVar1 = (*(code *)*puVar2)((float)fVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829ce); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b1480 FUN_008b1480 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b1480(void *param_1) { code *pcVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined4 uVar5; undefined4 *puVar6; undefined4 uStack_254; undefined4 uStack_250; undefined4 uStack_24c; undefined4 uStack_248; undefined4 uStack_244; undefined4 auStack_240 [2]; undefined1 auStack_238 [176]; undefined4 uStack_188; undefined4 uStack_184; undefined4 uStack_180; undefined4 uStack_17c; undefined4 uStack_178; undefined1 auStack_170 [356]; uint local_c; local_c = __security_cookie ^ (uint)&uStack_254; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uStack_254 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); uStack_254 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar5 = FUN_008bb010(param_1); uStack_188 = luaL_checkinteger(param_1,4); FUN_004c5850(uVar5); puVar6 = (undefined4 *)FUN_008baa50(); uStack_250 = *puVar6; uStack_24c = puVar6[1]; uStack_248 = uStack_188; FUN_004c5850(&uStack_180); puVar6 = (undefined4 *)FUN_008baa50(); uStack_17c = uStack_24c; uStack_188 = *puVar6; uStack_184 = puVar6[1]; uStack_180 = uStack_250; uStack_178 = uStack_248; FUN_004c5850(auStack_240); pcVar1 = (code *)*puVar4; uStack_248 = uStack_180; auStack_240[0] = uStack_178; uStack_250 = uStack_188; uStack_244 = uStack_17c; uStack_24c = uStack_184; FUN_004c5850(auStack_170); (*pcVar1)(&uStack_250,&uStack_248,auStack_240[0],auStack_238); return 0; } //@@ 008b1630 FUN_008b1630 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b1630(void *param_1) { code *pcVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined4 uVar5; float *pfVar6; float10 fVar7; undefined4 uStack_254; float fStack_250; float fStack_24c; float fStack_248; float fStack_244; float afStack_240 [2]; undefined1 auStack_238 [176]; float fStack_188; float fStack_180; float fStack_17c; float fStack_178; undefined1 auStack_170 [356]; uint local_c; local_c = __security_cookie ^ (uint)&uStack_254; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { uStack_254 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); uStack_254 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar5 = FUN_008bb010(param_1); fVar7 = (float10)luaL_checknumber(param_1,4); fStack_188 = (float)fVar7; FUN_004c5850(uVar5); pfVar6 = (float *)FUN_008baa50(); fStack_250 = *pfVar6; fStack_24c = pfVar6[1]; fStack_248 = fStack_188; FUN_004c5850(&fStack_180); fStack_188 = (float)luaL_checkinteger(param_1,2); fStack_180 = fStack_250; fStack_17c = fStack_24c; fStack_178 = fStack_248; FUN_004c5850(afStack_240); pcVar1 = (code *)*puVar4; fStack_250 = fStack_188; fStack_248 = fStack_180; fStack_244 = fStack_17c; afStack_240[0] = fStack_178; FUN_004c5850(auStack_170); iVar2 = (*pcVar1)(fStack_250,&fStack_248,afStack_240[0],auStack_238); if (iVar2 == 0) { lua_pushnil(param_1); } else { puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829d4); lua_setmetatable(param_1,0xfffffffe); } return 1; } //@@ 008b1810 FUN_008b1810 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b1810(void *param_1) { code *pcVar1; int iVar2; undefined4 *puVar3; char local_88 [24]; char local_70 [24]; undefined4 local_58; undefined4 local_54; char *local_50; char local_4c [24]; char local_34 [24]; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05570; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); FUN_008ba360(param_1); local_8 = 0; local_50 = local_88; pcVar1 = (code *)*puVar3; std::string::string(local_88,local_4c); local_8._0_1_ = 1; std::string::string(local_70,local_34); local_58 = local_1c; local_54 = local_18; local_8 = CONCAT31(local_8._1_3_,2); (*pcVar1)(local_88,local_70,local_1c); std::string::_Tidy_deallocate(local_70); std::string::_Tidy_deallocate(local_88); std::string::_Tidy_deallocate(local_34); std::string::_Tidy_deallocate(local_4c); ExceptionList = local_10; return 0; } //@@ 008b1c10 FUN_008b1c10 undefined4 FUN_008b1c10(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829da,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b1c80 FUN_008b1c80 undefined4 * FUN_008b1c80(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int iVar5; void *pvVar6; undefined4 *puVar7; undefined4 uVar8; undefined4 uVar9; undefined4 *in_ECX; undefined4 uVar10; float10 fVar11; undefined2 uStack_6e; undefined4 uStack_64; iVar5 = lua_toboolean(param_1,7); uStack_6e = CONCAT11(uStack_6e._1_1_,iVar5 != 0); iVar5 = lua_type(param_1,6); if (iVar5 == 0) { uVar10 = 0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,6,&g_luaClassKeyEntity,0); uVar10 = *(undefined4 *)((int)pvVar6 + 4); } uStack_64 = CONCAT22(uStack_64._2_2_,uStack_6e); puVar7 = (undefined4 *)FUN_008baa50(); uVar1 = *puVar7; uVar2 = puVar7[1]; uVar8 = luaL_checkinteger(param_1,4); fVar11 = (float10)luaL_checknumber(param_1,3); puVar7 = (undefined4 *)FUN_008baa50(); uVar3 = *puVar7; uVar4 = puVar7[1]; uVar9 = luaL_checkinteger(param_1,1); in_ECX[1] = uVar3; in_ECX[2] = uVar4; in_ECX[3] = (float)fVar11; in_ECX[4] = uVar8; *in_ECX = uVar9; in_ECX[5] = uVar1; in_ECX[6] = uVar2; in_ECX[7] = uVar10; in_ECX[8] = uStack_64; return in_ECX; } //@@ 008b1db0 FUN_008b1db0 undefined4 FUN_008b1db0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b1e20 FUN_008b1e20 undefined4 FUN_008b1e20(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; float10 fVar4; float10 fVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,5); fVar4 = (float10)luaL_checknumber(param_1,4); fVar5 = (float10)luaL_checknumber(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,(float)fVar5,(float)fVar4,iVar1 != 0); return 0; } //@@ 008b1ef0 FUN_008b1ef0 undefined4 FUN_008b1ef0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b1f50 FUN_008b1f50 undefined4 FUN_008b1f50(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b2000 FUN_008b2000 undefined4 FUN_008b2000(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2070 FUN_008b2070 undefined4 FUN_008b2070(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a27); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b2110 FUN_008b2110 undefined4 FUN_008b2110(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008b2180 FUN_008b2180 undefined4 FUN_008b2180(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b21e0 FUN_008b21e0 undefined4 FUN_008b21e0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,3); fVar4 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar4,(float)fVar3); return 0; } //@@ 008b2270 FUN_008b2270 undefined4 FUN_008b2270(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b22e0 FUN_008b22e0 undefined4 FUN_008b22e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b2330 FUN_008b2330 undefined4 FUN_008b2330(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b2380 FUN_008b2380 undefined4 FUN_008b2380(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); return 0; } //@@ 008b2410 FUN_008b2410 undefined4 FUN_008b2410(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b25b0 FUN_008b25b0 undefined4 FUN_008b25b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2740 FUN_008b2740 undefined4 FUN_008b2740(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b27a0 FUN_008b27a0 undefined4 FUN_008b27a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b2800 FUN_008b2800 undefined4 FUN_008b2800(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829e3); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b28a0 FUN_008b28a0 undefined4 FUN_008b28a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82995); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b2940 FUN_008b2940 undefined4 FUN_008b2940(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeySprite); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b29e0 FUN_008b29e0 undefined4 FUN_008b29e0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008b2a60 FUN_008b2a60 undefined4 FUN_008b2a60(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b2ab0 FUN_008b2ab0 undefined4 FUN_008b2ab0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008b2b20 FUN_008b2b20 undefined4 FUN_008b2b20(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2b90 FUN_008b2b90 undefined4 FUN_008b2b90(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,3); if (iVar2 == 0) { uVar5 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyEntity,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } iVar2 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar2 != 0,uVar5); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2c50 FUN_008b2c50 undefined4 FUN_008b2c50(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; int iVar4; void *pvVar5; undefined4 uVar6; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,3); iVar4 = lua_type(param_1,2); uVar6 = 0; if (iVar4 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntityPlayer,0); uVar6 = *(undefined4 *)((int)pvVar5 + 4); } cVar1 = (*(code *)*puVar3)(uVar6,iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2d10 FUN_008b2d10 undefined4 FUN_008b2d10(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2d80 FUN_008b2d80 undefined4 FUN_008b2d80(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b2e10 FUN_008b2e10 undefined4 FUN_008b2e10(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b2eb0 FUN_008b2eb0 undefined4 FUN_008b2eb0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b2f00 FUN_008b2f00 undefined4 FUN_008b2f00(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; void *pvVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ec,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { uVar5 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyGridEntity,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } (*(code *)*puVar2)(uVar5,uVar3); return 0; } //@@ 008b2fa0 FUN_008b2fa0 undefined4 FUN_008b2fa0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ec,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008b3010 FUN_008b3010 undefined4 FUN_008b3010(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ec,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b3060 FUN_008b3060 undefined4 FUN_008b3060(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } lua_pushstring(param_1,iVar1); return 1; } //@@ 008b30e0 FUN_008b30e0 undefined4 FUN_008b30e0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b3150 FUN_008b3150 undefined4 FUN_008b3150(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b31b0 FUN_008b31b0 undefined4 FUN_008b31b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b3200 FUN_008b3200 undefined4 FUN_008b3200(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b3250 FUN_008b3250 undefined4 FUN_008b3250(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); iVar1 = (*(code *)*puVar2)((float)fVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829fa); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b3320 FUN_008b3320 undefined4 FUN_008b3320(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b3380 FUN_008b3380 undefined4 FUN_008b3380(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b33d0 FUN_008b33d0 undefined4 FUN_008b33d0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b3440 FUN_008b3440 undefined4 FUN_008b3440(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b34c0 FUN_008b34c0 undefined4 FUN_008b34c0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); puVar4 = (undefined4 *)0x0; if (iVar1 != 0) { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } iVar1 = (*(code *)*puVar2)(*puVar4,puVar4[1]); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b3580 FUN_008b3580 undefined4 FUN_008b3580(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyGridEntityDoor); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b3640 FUN_008b3640 undefined4 FUN_008b3640(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uStack_18; undefined4 uStack_14; undefined1 auStack_10 [12]; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_14 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); uStack_14 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar3)(auStack_10,uVar4); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = uStack_14; *puVar3 = uStack_18; return 1; } //@@ 008b3700 FUN_008b3700 undefined4 FUN_008b3700(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b3790 FUN_008b3790 undefined4 FUN_008b3790(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b3800 FUN_008b3800 undefined4 FUN_008b3800(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b3860 FUN_008b3860 undefined4 FUN_008b3860(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; (*(code *)*puVar3)(&local_14); FUN_0085bfd0(); return 1; } //@@ 008b38f0 FUN_008b38f0 undefined4 FUN_008b38f0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,3); uVar5 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar5,uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b3ad0 FUN_008b3ad0 undefined4 FUN_008b3ad0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined2 uStack_1a; undefined1 auStack_18 [12]; uint uStack_c; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,4); uStack_1a = CONCAT11(uStack_1a._1_1_,iVar2 != 0); iVar2 = lua_toboolean(param_1,3); auStack_18._1_2_ = uStack_1a; auStack_18[0] = iVar2 != 0; uVar4 = luaL_checkinteger(param_1,2); uStack_c = CONCAT13(uStack_c._3_1_,auStack_18._0_3_); cVar1 = (*(code *)*puVar3)(uVar4,auStack_18._0_3_,uStack_c >> 8); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b3ba0 FUN_008b3ba0 undefined4 FUN_008b3ba0(void *param_1) { undefined8 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; char cVar12; int iVar13; undefined4 *puVar14; undefined4 *puVar15; undefined4 uStack_e0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b0; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined8 uStack_80; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; iVar13 = lua_type(param_1,1); if (iVar13 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar14 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar15 = (undefined4 *)FUN_008badb0(); uStack_30 = *puVar15; uStack_2c = puVar15[1]; uStack_28 = puVar15[2]; uStack_24 = puVar15[3]; uStack_20 = puVar15[4]; uStack_1c = puVar15[5]; uStack_18 = puVar15[6]; uStack_14 = puVar15[7]; uVar1 = *(undefined8 *)(puVar15 + 8); iVar13 = lua_toboolean(param_1,4); uVar8 = uStack_14; uVar7 = uStack_18; uVar6 = uStack_1c; uVar5 = uStack_20; uVar4 = uStack_24; uVar3 = uStack_28; uVar2 = uStack_2c; uVar11 = uStack_30; uStack_e0 = CONCAT31(uStack_e0._1_3_,iVar13 != 0); uStack_b8 = (undefined4)((ulonglong)uVar1 >> 0x20); iVar13 = lua_toboolean(param_1,3); uStack_a4 = uVar2; uStack_a0 = uVar3; uStack_b0 = CONCAT31(uStack_b0._1_3_,iVar13 != 0); uStack_9c = uVar4; uStack_98 = uVar5; uStack_94 = uVar6; uStack_90 = uVar7; uStack_bc = (undefined4)uVar1; uStack_8c = uVar8; uStack_88 = uStack_bc; uStack_84 = uStack_b8; uStack_80 = CONCAT44(uStack_80._4_4_,uStack_b8); uStack_70 = luaL_checkinteger(param_1,2); uVar10 = uStack_84; uVar9 = uStack_88; uVar8 = uStack_8c; uVar7 = uStack_90; uVar6 = uStack_94; uVar5 = uStack_98; uVar4 = uStack_9c; uVar3 = uStack_a0; uVar2 = uStack_a4; uStack_5c = uStack_a0; uStack_58 = uStack_9c; uStack_54 = uStack_98; uStack_50 = uStack_94; uStack_6c = uStack_b0; uStack_68 = uStack_e0; uStack_64 = uVar11; uStack_60 = uStack_a4; uStack_4c = uStack_90; uStack_48 = uStack_8c; uStack_44 = uStack_88; uStack_40 = uStack_84; uStack_3c = uStack_b8; uStack_a4 = uVar11; uStack_a0 = uVar2; uStack_9c = uVar3; uStack_98 = uVar4; uStack_94 = uVar5; uStack_90 = uVar6; uStack_8c = uVar7; uStack_88 = uVar8; uStack_84 = uVar9; uStack_80 = CONCAT44(uStack_b8,uVar10); cVar12 = (*(code *)*puVar14)(uStack_70,uStack_b0,uStack_e0,&uStack_a4); lua_pushboolean(param_1,cVar12 != '\0'); return 1; } //@@ 008b3d60 luabridge::CFunc::CallMember::f /* DB: lua_pushcclosure'd by FUN_00890430 = addFunction("CheckLine", 0x7f0df0 Room::CheckLine); reads args via luabridge::Userdata::getClass */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; char cVar4; int iVar5; undefined4 *puVar6; void *pvVar7; undefined4 uVar8; undefined4 *puVar9; undefined4 uStack_a0; undefined4 uStack_94; undefined4 uStack_90; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; iVar5 = lua_type(param_1,1); if (iVar5 != 0) { Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar6 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar5 = lua_type(param_1,8); if (iVar5 == 0) { uStack_a0 = 0; } else { pvVar7 = Userdata::getClass(param_1,8,&g_luaClassKeyVector,0); uStack_a0 = *(undefined4 *)((int)pvVar7 + 4); } iVar5 = lua_toboolean(param_1,7); uStack_90 = CONCAT31(uStack_90._1_3_,iVar5 != 0); iVar5 = lua_toboolean(param_1,6); uStack_5c = uStack_90; uStack_58 = uStack_a0; uStack_54 = uStack_94; uStack_60 = CONCAT31(uStack_60._1_3_,iVar5 != 0); uVar8 = luaL_checkinteger(param_1,5); uVar3 = uStack_58; uVar2 = uStack_5c; uVar1 = uStack_60; uStack_30 = luaL_checkinteger(param_1,4); uStack_28 = uVar1; uStack_24 = uVar2; uStack_20 = uVar3; uStack_1c = uStack_54; uStack_2c = uVar8; puVar9 = (undefined4 *)FUN_008baa50(); uStack_60 = *puVar9; uStack_5c = puVar9[1]; uStack_58 = uStack_30; uStack_54 = uStack_2c; uStack_50._0_4_ = uStack_28; uStack_50._4_4_ = uStack_24; uStack_48 = uStack_20; uStack_44 = uStack_1c; puVar9 = (undefined4 *)FUN_008baa50(); uStack_3c = uStack_44; uStack_40 = uStack_48; uVar8 = uStack_50._4_4_; uVar3 = (undefined4)uStack_50; uVar2 = uStack_54; uVar1 = uStack_58; uStack_54 = uStack_5c; _uStack_5c = CONCAT44(uStack_60,puVar9[1]); _uStack_48 = CONCAT44(uStack_50._4_4_,(undefined4)uStack_50); uStack_60 = *puVar9; uStack_50 = CONCAT44(uVar2,uVar1); cVar4 = (*(code *)*puVar6)(&uStack_60,&uStack_58,uStack_30,uStack_2c,uVar3,uVar8,uStack_40); lua_pushboolean(param_1,cVar4 != '\0'); return 1; } //@@ 008b40a0 FUN_008b40a0 undefined4 FUN_008b40a0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyGridEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b4160 FUN_008b4160 undefined4 FUN_008b4160(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; iVar1 = (*(code *)*puVar3)(&local_14); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyGridEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b4230 FUN_008b4230 undefined4 FUN_008b4230(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b42a0 FUN_008b42a0 undefined4 FUN_008b42a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008b4310 FUN_008b4310 undefined4 FUN_008b4310(void *param_1) { float *pfVar1; float fVar2; int iVar3; void *pvVar4; undefined4 *puVar5; undefined4 *puVar6; float10 fVar7; undefined4 local_2c; undefined4 local_28; float local_24; float local_20; undefined4 local_1c; undefined1 local_17 [2]; undefined1 uStack_15; float local_c; undefined4 local_8; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { local_1c = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); local_1c = *(undefined4 *)((int)pvVar4 + 4); } puVar5 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_toboolean(param_1,6); local_8._0_3_ = CONCAT12(iVar3 != 0,(undefined2)local_8); iVar3 = lua_toboolean(param_1,5); _local_17 = CONCAT21(local_8._2_2_,iVar3 != 0); iVar3 = lua_toboolean(param_1,4); local_8 = (float)CONCAT13(uStack_15,(int3)CONCAT31(_local_17,iVar3 != 0)); fVar7 = (float10)luaL_checknumber(param_1,3); fVar2 = local_8; local_24 = (float)fVar7; puVar6 = (undefined4 *)FUN_008baa50(); local_2c = *puVar6; local_28 = puVar6[1]; local_c = local_24; local_20 = fVar2; local_8 = fVar2; (*(code *)*puVar5)(&local_c,&local_2c,local_24,fVar2,(uint)fVar2 >> 8,(uint)fVar2 >> 0x10); puVar5 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar5[1]; pfVar1[1] = local_8; *pfVar1 = local_c; return 1; } //@@ 008b4470 FUN_008b4470 undefined4 FUN_008b4470(void *param_1) { float *pfVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined4 *puVar5; float10 fVar6; undefined4 local_28; undefined4 local_24; float local_20; float local_1c; float local_10; float local_c; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { local_8 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); local_8 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar6 = (float10)luaL_checknumber(param_1,3); local_10 = (float)fVar6; puVar5 = (undefined4 *)FUN_008baa50(); local_28 = *puVar5; local_24 = puVar5[1]; local_20 = local_10; local_1c = local_c; (*(code *)*puVar4)(&local_10,&local_28,local_10); puVar4 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar4 = luabridge::UserdataValue::vftable; puVar4[1] = puVar4 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar4[1]; pfVar1[1] = local_c; *pfVar1 = local_10; return 1; } //@@ 008b4570 FUN_008b4570 undefined4 FUN_008b4570(void *param_1) { char cVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined4 *puVar5; float10 fVar6; undefined4 local_18; undefined4 local_14; float local_10; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { local_8 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); local_8 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar6 = (float10)luaL_checknumber(param_1,3); local_10 = (float)fVar6; puVar5 = (undefined4 *)FUN_008baa50(); local_18 = *puVar5; local_14 = puVar5[1]; cVar1 = (*(code *)*puVar4)(&local_18,local_10); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b4640 FUN_008b4640 undefined4 FUN_008b4640(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 uStack_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_24); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x28); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a39); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_24; puVar2[1] = uStack_20; puVar2[2] = uStack_1c; puVar2[3] = uStack_18; puVar2[4] = local_14; puVar2[5] = uStack_10; puVar2[6] = uStack_c; puVar2[7] = uStack_8; return 1; } //@@ 008b46f0 FUN_008b46f0 undefined4 FUN_008b46f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_24); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x28); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a3a); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; *puVar2 = local_24; puVar2[1] = local_20; puVar2[2] = local_1c; puVar2[3] = local_18; puVar2[4] = local_14; puVar2[5] = local_10; puVar2[6] = local_c; puVar2[7] = local_8; return 1; } //@@ 008b47c0 FUN_008b47c0 undefined4 FUN_008b47c0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b4860 FUN_008b4860 undefined4 FUN_008b4860(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 008b4a00 FUN_008b4a00 undefined4 FUN_008b4a00(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,4); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3,iVar1 != 0); return 0; } //@@ 008b4a90 FUN_008b4a90 undefined4 FUN_008b4a90(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b4af0 FUN_008b4af0 undefined4 FUN_008b4af0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829bc); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b4b90 FUN_008b4b90 undefined4 FUN_008b4b90(void *param_1) { int iVar1; undefined4 *puVar2; int iVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); iVar3 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar3 != 0,iVar1 != 0); return 0; } //@@ 008b4c10 FUN_008b4c10 undefined4 FUN_008b4c10(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; int iVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,3); iVar4 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar4 != 0,iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b4cb0 FUN_008b4cb0 undefined4 FUN_008b4cb0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008b4d20 FUN_008b4d20 undefined4 FUN_008b4d20(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,2); cVar1 = (*(code *)*puVar3)(iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b4da0 FUN_008b4da0 undefined4 FUN_008b4da0(void *param_1) { uint uVar1; char cVar2; int iVar3; undefined4 *puVar4; int iVar5; undefined1 local_b [6]; undefined1 uStack_5; iVar3 = lua_type(param_1,1); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_toboolean(param_1,4); iVar5 = lua_toboolean(param_1,3); local_b._0_3_ = CONCAT21(CONCAT11(uStack_5,iVar3 != 0),iVar5 != 0); iVar3 = lua_toboolean(param_1,2); uVar1 = CONCAT13(uStack_5,(int3)CONCAT31(local_b._0_3_,iVar3 != 0)); cVar2 = (*(code *)*puVar4)(uVar1,uVar1 >> 8,uVar1 >> 0x10); lua_pushboolean(param_1,cVar2 != '\0'); return 1; } //@@ 008b4e60 FUN_008b4e60 undefined4 FUN_008b4e60(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3,iVar1 != 0); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b4ef0 FUN_008b4ef0 undefined4 FUN_008b4ef0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008b4f70 FUN_008b4f70 undefined4 FUN_008b4f70(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; void *pvVar4; undefined4 uVar5; undefined4 local_8; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,3); if (iVar2 == 0) { local_8 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyGridEntity,0); local_8 = *(undefined4 *)((int)pvVar4 + 4); } iVar2 = lua_type(param_1,2); uVar5 = 0; if (iVar2 != 0) { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyGridEntity,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } cVar1 = (*(code *)*puVar3)(uVar5,local_8); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b5040 FUN_008b5040 undefined4 FUN_008b5040(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; float10 fVar4; undefined4 uStack_18; undefined4 uStack_14; float afStack_10 [3]; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_14 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); uStack_14 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); afStack_10[0] = (float)fVar4; (*(code *)*puVar3)(afStack_10,afStack_10[0]); puVar3 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; puVar3[1] = uStack_14; *puVar3 = uStack_18; return 1; } //@@ 008b5120 FUN_008b5120 undefined4 FUN_008b5120(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b5280 FUN_008b5280 undefined4 FUN_008b5280(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; undefined4 uVar5; iVar1 = lua_type(); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,0); } uVar5 = 0xfff0b9d7; pvVar3 = param_1; puVar2 = (undefined4 *)lua_touserdata(); iVar1 = lua_type(param_1,2,pvVar3,uVar5); if (iVar1 == 0) { puVar4 = (undefined4 *)0x0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&DAT_00c8298c,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } (*(code *)*puVar2)(*puVar4,puVar4[1],puVar4[2],puVar4[3],puVar4[4],puVar4[5],puVar4[6],puVar4[7], *(undefined8 *)(puVar4 + 8),puVar4[10]); return 0; } //@@ 008b5330 FUN_008b5330 undefined4 FUN_008b5330(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 *puVar4; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_14; undefined4 uStack_10; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { uStack_1c = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); uStack_1c = *(undefined4 *)((int)pvVar3 + 4); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); puVar4 = (undefined4 *)0x0; if (iVar1 != 0) { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar4 = *(undefined4 **)((int)pvVar3 + 4); } uStack_14 = *puVar4; uStack_10 = puVar4[1]; (*(code *)*puVar2)(&uStack_14,uStack_14,uStack_10); puVar4 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar4 = luabridge::UserdataValue::vftable; puVar4[1] = puVar4 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar4 = (undefined4 *)puVar4[1]; puVar4[1] = uStack_1c; *puVar4 = uStack_20; return 1; } //@@ 008b5430 FUN_008b5430 undefined4 FUN_008b5430(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008b54a0 FUN_008b54a0 undefined4 FUN_008b54a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyRoom,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b5500 FUN_008b5500 undefined4 FUN_008b5500(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b5550 FUN_008b5550 undefined4 FUN_008b5550(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008b55d0 FUN_008b55d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b55d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 ****ppppuVar3; uint size; undefined4 ****local_20 [4]; undefined4 local_10; uint local_c; undefined4 ***local_8; local_8 = (undefined4 ***)(__security_cookie ^ (uint)(local_20 + 7)); iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(local_20); ppppuVar3 = local_20; if (0xf < local_c) { ppppuVar3 = local_20[0]; } lua_pushlstring(param_1,ppppuVar3,local_10); if (0xf < local_c) { size = local_c + 1; ppppuVar3 = local_20[0]; if (0xfff < size) { ppppuVar3 = (undefined4 ****)local_20[0][-1]; size = local_c + 0x24; if (0x1f < (uint)((int)local_20[0] + (-4 - (int)ppppuVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar3,size); } return 1; } //@@ 008b5690 FUN_008b5690 undefined4 FUN_008b5690(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b5720 FUN_008b5720 undefined4 FUN_008b5720(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008b5790 FUN_008b5790 undefined4 FUN_008b5790(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b5820 FUN_008b5820 undefined4 FUN_008b5820(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,iVar1 != 0); return 0; } //@@ 008b58a0 FUN_008b58a0 undefined4 FUN_008b58a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyRoom); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b5940 FUN_008b5940 undefined4 FUN_008b5940(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0,uVar3); FUN_0085bfd0(); return 1; } //@@ 008b59d0 FUN_008b59d0 undefined4 FUN_008b59d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar4,uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a04); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b5aa0 FUN_008b5aa0 undefined4 FUN_008b5aa0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a03); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b5b40 FUN_008b5b40 undefined4 FUN_008b5b40(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 local_c; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(&local_c); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge:: UserdataValue_> ::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a3c); lua_setmetatable(param_1,0xfffffffe); puVar2 = (undefined4 *)puVar2[1]; puVar2[1] = local_8; *puVar2 = local_c; return 1; } //@@ 008b5be0 FUN_008b5be0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b5be0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 uVar7; undefined2 local_42; undefined2 uStack_26; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar4 = lua_type(param_1,1); if (iVar4 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar5 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,5); local_42 = CONCAT11(local_42._1_1_,iVar4 != 0); puVar6 = (undefined4 *)FUN_008bb0d0(); uVar7 = *puVar6; uVar1 = puVar6[1]; uVar2 = puVar6[2]; uVar3 = puVar6[3]; iVar4 = lua_toboolean(param_1,3); uStack_1c = uVar7; uStack_18 = uVar1; uStack_14 = uVar2; uStack_10 = uVar3; uStack_c = CONCAT22(uStack_26,local_42); uVar7 = luaL_checkinteger(param_1,2); (*(code *)*puVar5)(uVar7,iVar4 != 0,&uStack_1c,CONCAT22(uStack_26,local_42)); FUN_0085bfd0(); return 1; } //@@ 008b5cf0 FUN_008b5cf0 undefined4 FUN_008b5cf0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b5d50 FUN_008b5d50 undefined4 FUN_008b5d50(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b5dc0 FUN_008b5dc0 undefined4 FUN_008b5dc0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82995); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b5e60 FUN_008b5e60 undefined4 FUN_008b5e60(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b5ed0 FUN_008b5ed0 undefined4 FUN_008b5ed0(void *param_1) { int iVar1; undefined4 *puVar2; int iVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); iVar3 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar3 != 0,iVar1 != 0); return 0; } //@@ 008b5f50 FUN_008b5f50 undefined4 FUN_008b5f50(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 008b5fe0 FUN_008b5fe0 undefined4 FUN_008b5fe0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008b6050 FUN_008b6050 undefined4 FUN_008b6050(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,3); uVar5 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar5,uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b60e0 FUN_008b60e0 undefined4 FUN_008b60e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyLevel,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008b6150 FUN_008b6150 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b6150(void *param_1) { code *pcVar1; int iVar2; void *pvVar3; undefined4 *puVar4; byte *text; char acStack_80 [2]; char acStack_7e [10]; undefined4 uStack_74; char local_58 [32]; undefined4 local_38; undefined1 *local_34; char local_30 [28]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b055b5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; uStack_74 = 0x8b6187; iVar2 = lua_type(); if (iVar2 == 0) { local_38 = 0; } else { uStack_74 = 0x8b61a6; pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,0); local_38 = *(undefined4 *)((int)pvVar3 + 4); } uStack_74 = 0x8b61bb; puVar4 = (undefined4 *)lua_touserdata(); local_34 = acStack_80 + -4; text = (byte *)luaL_checklstring(param_1,2,&local_34); uStack_74 = 0; std::string::assign(acStack_80 + -4,text,(uint)local_34); FUN_008ba9c0(); local_8 = 0; pcVar1 = (code *)*puVar4; std::string::string(local_58,local_30); local_8 = CONCAT31(local_8._1_3_,1); std::string::string(acStack_80,local_58); (*pcVar1)(); std::string::_Tidy_deallocate(local_58); std::string::_Tidy_deallocate(local_30); ExceptionList = local_10; return 0; } //@@ 008b6260 FUN_008b6260 undefined4 FUN_008b6260(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b62b0 FUN_008b62b0 undefined4 FUN_008b62b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b6320 FUN_008b6320 undefined4 FUN_008b6320(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b6390 FUN_008b6390 undefined4 FUN_008b6390(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b63f0 FUN_008b63f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b63f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 ****ppppuVar3; uint size; undefined4 ****local_20 [4]; undefined4 local_10; uint local_c; undefined4 ***local_8; local_8 = (undefined4 ***)(__security_cookie ^ (uint)(local_20 + 7)); iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(local_20); ppppuVar3 = local_20; if (0xf < local_c) { ppppuVar3 = local_20[0]; } lua_pushlstring(param_1,ppppuVar3,local_10); if (0xf < local_c) { size = local_c + 1; ppppuVar3 = local_20[0]; if (0xfff < size) { ppppuVar3 = (undefined4 ****)local_20[0][-1]; size = local_c + 0x24; if (0x1f < (uint)((int)local_20[0] + (-4 - (int)ppppuVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar3,size); } return 1; } //@@ 008b64b0 FUN_008b64b0 undefined4 FUN_008b64b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b6510 FUN_008b6510 undefined4 FUN_008b6510(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); uVar3 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,uVar3,0); return 1; } //@@ 008b6590 FUN_008b6590 undefined4 FUN_008b6590(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b6620 FUN_008b6620 undefined4 FUN_008b6620(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b66b0 FUN_008b66b0 undefined4 FUN_008b66b0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a0d,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,3); uVar5 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar5,uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b6740 FUN_008b6740 undefined4 FUN_008b6740(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,6); uVar4 = luaL_checkinteger(param_1,5); uVar5 = luaL_checkinteger(param_1,4); uVar6 = luaL_checkinteger(param_1,3); uVar7 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar7,uVar6,uVar5,uVar4,uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b6840 FUN_008b6840 undefined4 FUN_008b6840(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined2 uStack_1a; undefined1 auStack_18 [12]; uint uStack_c; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,4); uStack_1a = CONCAT11(uStack_1a._1_1_,iVar2 != 0); iVar2 = lua_toboolean(param_1,3); auStack_18._1_2_ = uStack_1a; auStack_18[0] = iVar2 != 0; uVar4 = luaL_checkinteger(param_1,2); uStack_c = CONCAT13(uStack_c._3_1_,auStack_18._0_3_); cVar1 = (*(code *)*puVar3)(uVar4,auStack_18._0_3_,uStack_c >> 8); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b6910 FUN_008b6910 undefined4 FUN_008b6910(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b69a0 FUN_008b69a0 undefined4 FUN_008b69a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b69f0 FUN_008b69f0 undefined4 FUN_008b69f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); FUN_0085bfd0(); return 1; } //@@ 008b6a70 FUN_008b6a70 undefined4 FUN_008b6a70(void *param_1) { uint uVar1; int iVar2; undefined4 *puVar3; int iVar4; int iVar5; undefined4 uVar6; undefined4 uStack_13; undefined1 uStack_d; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,5); iVar4 = lua_toboolean(param_1,4); iVar5 = lua_toboolean(param_1,3); uStack_d = (undefined1)((uint)uStack_13 >> 8); uVar1 = CONCAT13(uStack_d,CONCAT21(CONCAT11(iVar2 != 0,iVar4 != 0),iVar5 != 0)); uVar6 = luaL_checkinteger(param_1,2); iVar2 = (*(code *)*puVar3)(uVar6,uVar1,uVar1 >> 8,uVar1 >> 0x10); lua_pushinteger(param_1,iVar2,iVar2 >> 0x1f); return 1; } //@@ 008b6b50 FUN_008b6b50 undefined4 FUN_008b6b50(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b6bd0 FUN_008b6bd0 undefined4 FUN_008b6bd0(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 uVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,3); if (iVar1 == 0) { uVar5 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,3,&g_luaClassKeyEntityPlayer,0); uVar5 = *(undefined4 *)((int)pvVar3 + 4); } uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar5); FUN_0085bfd0(); return 1; } //@@ 008b6c80 FUN_008b6c80 undefined4 FUN_008b6c80(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b6cf0 FUN_008b6cf0 undefined4 FUN_008b6cf0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b6d80 FUN_008b6d80 undefined4 FUN_008b6d80(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); lua_pushinteger(param_1,iVar1,iVar1 >> 0x1f); return 1; } //@@ 008b6e00 FUN_008b6e00 undefined4 FUN_008b6e00(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b6e60 FUN_008b6e60 undefined4 FUN_008b6e60(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); FUN_0085bfd0(); return 1; } //@@ 008b6ef0 FUN_008b6ef0 undefined4 FUN_008b6ef0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a10,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008b6f70 FUN_008b6f70 undefined4 FUN_008b6f70(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; void *pvVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82978,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { uVar5 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntityPlayer,0); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } (*(code *)*puVar2)(uVar5,uVar3); return 0; } //@@ 008b7010 FUN_008b7010 undefined4 FUN_008b7010(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82978,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,2); if (iVar1 == 0) { (*(code *)*puVar2)(0); return 0; } pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntityPlayer,0); (*(code *)*puVar2)(*(undefined4 *)((int)pvVar3 + 4)); return 0; } //@@ 008b70c0 FUN_008b70c0 undefined4 FUN_008b70c0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82978,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b7130 FUN_008b7130 undefined4 FUN_008b7130(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82978,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0); return 0; } //@@ 008b71a0 FUN_008b71a0 undefined4 FUN_008b71a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82978,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b71f0 FUN_008b71f0 undefined4 FUN_008b71f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b7240 FUN_008b7240 undefined4 FUN_008b7240(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b72b0 luabridge::CFunc::CallMember::f /* DB: lua_CFunction pushed as closure (push 0x8b72b0 at 0x893da2) with upvalue member pointer 0x428b20 (Game::Spawn, lua binding Game:Spawn) and name s_Spawn 'Spawn'; luabridge::Userdata::getClass for self, reads args, pushes result */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; int iVar9; undefined4 *puVar10; undefined4 uVar11; undefined4 uVar12; void *pvVar13; undefined4 uVar14; undefined4 *puVar15; undefined4 uVar16; undefined4 uStack_b4; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined8 uStack_50; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; iVar9 = lua_type(param_1,1); if (iVar9 != 0) { Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar10 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar11 = luaL_checkinteger(param_1,8); uVar12 = luaL_checkinteger(param_1,7); iVar9 = lua_type(param_1,6); uVar14 = 0; if (iVar9 != 0) { pvVar13 = Userdata::getClass(param_1,6,&g_luaClassKeyEntity,1); uVar14 = *(undefined4 *)((int)pvVar13 + 4); } puVar15 = (undefined4 *)FUN_008baa50(); uVar1 = *puVar15; uVar2 = puVar15[1]; puVar15 = (undefined4 *)FUN_008baa50(); uVar3 = *puVar15; uVar4 = puVar15[1]; uStack_54 = uStack_b4; uStack_68 = uVar1; uStack_64 = uVar2; uStack_60 = uVar14; uStack_5c = uVar12; uStack_58 = uVar11; uVar16 = luaL_checkinteger(param_1,3); uVar6 = uStack_58; uVar2 = uStack_5c; uVar12 = uStack_60; uVar11 = uStack_64; uVar14 = uStack_68; uStack_40 = luaL_checkinteger(param_1,2); uVar8 = uStack_54; uVar7 = uStack_58; uVar5 = uStack_5c; uVar1 = uStack_60; uStack_30 = uVar14; uStack_2c = uVar11; uStack_28 = uVar12; uStack_24 = uVar2; uStack_20 = uVar6; uStack_1c = uStack_54; uStack_60 = uVar14; uStack_5c = uVar11; _uStack_58 = CONCAT44(uVar2,uVar12); uStack_50 = CONCAT44(uVar8,uVar6); uStack_68 = uVar3; uStack_64 = uVar4; uStack_3c = uVar16; uStack_38 = uVar3; uStack_34 = uVar4; iVar9 = (*(code *)*puVar10)(uStack_40,uVar16,&uStack_68,&uStack_60,uVar1,uVar5,uVar7); if (iVar9 == 0) { lua_pushnil(param_1); return 1; } puVar10 = (undefined4 *)lua_newuserdata(param_1,8); *puVar10 = UserdataPtr::vftable; puVar10[1] = iVar9; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b7630 luabridge::CFunc::CallMember::f /* DB: luabridge member thunk: pushed as a C closure (push 0x8b7630 at 893e62) whose upvalue is Game::BombDamage (0x6ff2a0), registered under "BombDamage" (0xb746d0); checks self Game, reads args 2..9 (Vector, damage, radius, line check, Entity source, BitSet128 tear flags, int damage flags, bool) via Userdata::getClass/luaL_checkinteger/lua_toboolean */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { float fVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; undefined4 *puVar7; void *pvVar8; undefined4 *puVar9; undefined4 uVar10; float *pfVar11; float10 fVar12; float10 fVar13; undefined8 uVar14; undefined2 uStack_11a; undefined2 uStack_106; undefined4 uStack_104; undefined4 uStack_fc; undefined4 uStack_c0; undefined4 uStack_bc; float fStack_70; float fStack_6c; float fStack_68; undefined4 uStack_64; float fStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined8 uStack_40; undefined8 uStack_38; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; iVar6 = lua_type(param_1,1); if (iVar6 != 0) { Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar7 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar6 = lua_toboolean(param_1,9); uStack_11a = CONCAT11(uStack_11a._1_1_,iVar6 != 0); uVar14 = luaL_checkinteger(param_1,8); iVar6 = lua_type(param_1,7); puVar9 = (undefined4 *)0x0; if (iVar6 != 0) { pvVar8 = Userdata::getClass(param_1,7,&g_luaClassKeyBitSet128,1); puVar9 = *(undefined4 **)((int)pvVar8 + 4); } uStack_20 = *puVar9; uStack_1c = puVar9[1]; uStack_18 = puVar9[2]; uStack_14 = puVar9[3]; iVar6 = lua_type(param_1,6); uVar10 = 0; if (iVar6 != 0) { pvVar8 = Userdata::getClass(param_1,6,&g_luaClassKeyEntity,0); uVar10 = *(undefined4 *)((int)pvVar8 + 4); } uVar5 = uStack_14; uVar4 = uStack_18; uVar3 = uStack_1c; uVar2 = uStack_20; iVar6 = lua_toboolean(param_1,5); uStack_c0 = CONCAT31(uStack_c0._1_3_,iVar6 != 0); fVar12 = (float10)luaL_checknumber(param_1,4); fVar13 = (float10)luaL_checknumber(param_1,3); uStack_64 = uStack_fc; fStack_60 = (float)uStack_c0; uStack_5c = uStack_bc; fStack_70 = (float)fVar13; uStack_54 = uStack_fc; uStack_50 = uVar2; uStack_4c = uVar3; uStack_48 = uVar4; uStack_44 = uVar5; fStack_68 = (float)fVar12; uStack_58 = (float)uVar10; uStack_38._0_4_ = CONCAT22(uStack_106,uStack_11a); uStack_38._4_4_ = uStack_104; uStack_40 = uVar14; pfVar11 = (float *)FUN_008baa50(); uStack_2c = uStack_38._4_4_; uStack_30 = (undefined4)uStack_38; uVar14 = uStack_40; uVar3 = uStack_44; uVar2 = uStack_48; uStack_44 = uStack_4c; uStack_48 = uStack_50; uStack_4c = uStack_54; uStack_50 = uStack_58; uStack_54 = uStack_5c; uStack_58 = fStack_60; uStack_5c = uStack_64; fStack_60 = fStack_68; fVar1 = fStack_70; fStack_68 = fStack_70; uStack_64 = fStack_6c; uStack_38 = uStack_40; fStack_70 = *pfVar11; fStack_6c = pfVar11[1]; uStack_40 = CONCAT44(uVar3,uVar2); (*(code *)*puVar7)(&fStack_70,fVar1,(float)fVar12,uStack_58,uVar10,uStack_48,uStack_44,uVar2,uVar3 ,uVar14,uStack_30); return 0; } //@@ 008b78f0 luabridge::CFunc::CallMember::f /* DB: lua_pushcclosure(FUN_008b78f0) with upvalue Game::BombExplosionEffects, name "BombExplosionEffects" (registration FUN_00893eb0); reads Game userdata, Vector, damage, TearFlags BitSet128, Color, source Entity, radius scale, bools then calls the member */ undefined4 luabridge::CFunc::CallMember::f(void *param_1) { undefined8 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; undefined4 uVar13; undefined4 uVar14; int iVar15; undefined4 *puVar16; void *pvVar17; undefined4 uVar18; undefined4 *puVar19; float10 fVar20; float10 fVar21; undefined8 uVar22; undefined2 uStack_144; undefined2 uStack_126; undefined4 uStack_124; undefined4 uStack_100; undefined4 uStack_88; undefined4 uStack_84; float fStack_80; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined8 uStack_48; undefined4 uStack_40; undefined4 uStack_38; float fStack_30; undefined4 uStack_28; undefined8 uStack_20; undefined8 uStack_18; iVar15 = lua_type(param_1,1); if (iVar15 != 0) { Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar16 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar15 = lua_toboolean(param_1,10); _uStack_144 = CONCAT31(stack0xfffffebd,iVar15 != 0); uVar22 = luaL_checkinteger(param_1,9); iVar15 = lua_toboolean(param_1,8); uStack_100 = CONCAT31(uStack_100._1_3_,iVar15 != 0); fVar20 = (float10)luaL_checknumber(param_1,7); iVar15 = lua_type(param_1,6); uVar18 = 0; if (iVar15 != 0) { pvVar17 = Userdata::getClass(param_1,6,&g_luaClassKeyEntity,0); uVar18 = *(undefined4 *)((int)pvVar17 + 4); } puVar19 = (undefined4 *)FUN_008ba900(); uVar3 = *puVar19; uVar4 = puVar19[1]; uVar5 = puVar19[2]; uVar6 = puVar19[3]; uVar7 = puVar19[4]; uVar8 = puVar19[5]; uVar9 = puVar19[6]; uVar10 = puVar19[7]; uVar1 = *(undefined8 *)(puVar19 + 8); uVar2 = puVar19[10]; iVar15 = lua_type(param_1,4); puVar19 = (undefined4 *)0x0; if (iVar15 != 0) { pvVar17 = Userdata::getClass(param_1,4,&g_luaClassKeyBitSet128,1); puVar19 = *(undefined4 **)((int)pvVar17 + 4); } uVar11 = *puVar19; uVar12 = puVar19[1]; uVar13 = puVar19[2]; uVar14 = puVar19[3]; fVar21 = (float10)luaL_checknumber(param_1,3); puVar19 = (undefined4 *)FUN_008baa50(); uStack_88 = *puVar19; uStack_84 = puVar19[1]; uStack_28 = uStack_100; uStack_18 = CONCAT44(uStack_124,CONCAT22(uStack_126,uStack_144)); fStack_80 = (float)fVar21; uStack_78 = uVar11; uStack_74 = uVar12; uStack_70 = uVar13; uStack_6c = uVar14; uStack_68 = uVar3; uStack_64 = uVar4; uStack_60 = uVar5; uStack_5c = uVar6; uStack_58 = uVar7; uStack_54 = uVar8; uStack_50 = uVar9; uStack_4c = uVar10; uStack_48 = uVar1; uStack_40 = uVar2; uStack_38 = uVar18; fStack_30 = (float)fVar20; uStack_20 = uVar22; (*(code *)*puVar16)(&uStack_88,(float)fVar21,uVar11,uVar12,uVar13,uVar14,&uStack_68,uVar18, (float)fVar20,uStack_100,uVar22,CONCAT22(uStack_126,uStack_144)); return 0; } //@@ 008b7b70 FUN_008b7b70 undefined4 FUN_008b7b70(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; float fVar5; float fVar6; undefined4 uVar7; undefined4 uVar8; int iVar9; undefined4 *puVar10; void *pvVar11; undefined4 uVar12; undefined4 *puVar13; float *pfVar14; float10 fVar15; undefined4 uStack_b0; float fStack_90; float fStack_8c; float fStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; float fStack_74; undefined4 uStack_70; float fStack_6c; undefined4 uStack_68; undefined4 uStack_64; float fStack_60; float fStack_5c; float fStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined8 uStack_48; undefined4 uStack_40; float fStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_20; float fStack_1c; undefined4 uStack_18; undefined4 uStack_14; iVar9 = lua_type(param_1,1); if (iVar9 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar10 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar15 = (float10)luaL_checknumber(param_1,6); iVar9 = lua_type(param_1,5); uVar12 = 0; if (iVar9 != 0) { pvVar11 = luabridge::Userdata::getClass(param_1,5,&g_luaClassKeyEntity,0); uVar12 = *(undefined4 *)((int)pvVar11 + 4); } iVar9 = lua_type(param_1,4); puVar13 = (undefined4 *)0x0; if (iVar9 != 0) { pvVar11 = luabridge::Userdata::getClass(param_1,4,&g_luaClassKeyBitSet128,1); puVar13 = *(undefined4 **)((int)pvVar11 + 4); } uVar1 = *puVar13; uVar2 = puVar13[1]; uVar3 = puVar13[2]; uVar4 = puVar13[3]; uStack_18 = uStack_b0; uStack_20 = uVar12; fStack_1c = (float)fVar15; fVar15 = (float10)luaL_checknumber(param_1,3); fStack_90 = (float)fVar15; uStack_78 = uStack_20; fStack_74 = fStack_1c; uStack_70 = uStack_18; fStack_6c = (float)uStack_14; fStack_88 = (float)uVar1; uStack_84 = uVar2; uStack_80 = uVar3; uStack_7c = uVar4; pfVar14 = (float *)FUN_008baa50(); fStack_6c = fStack_74; uStack_70 = uStack_78; uVar8 = uStack_7c; uVar7 = uStack_80; uVar12 = uStack_84; fVar6 = fStack_88; fVar5 = fStack_90; fStack_60 = *pfVar14; fStack_5c = pfVar14[1]; uStack_48 = CONCAT44(uStack_7c,uStack_80); fStack_58 = fStack_90; uStack_54 = fStack_8c; uStack_50 = fStack_88; uStack_4c = uStack_84; uStack_40 = uStack_78; fStack_3c = fStack_74; uStack_38 = uStack_18; uStack_34 = uStack_14; fStack_88 = fStack_90; uStack_84 = fStack_8c; uStack_80 = fVar6; uStack_7c = uVar12; uStack_78 = uVar7; fStack_74 = (float)uVar8; uStack_68 = uStack_18; uStack_64 = uStack_14; fStack_90 = fStack_60; fStack_8c = fStack_5c; (*(code *)*puVar10)(&fStack_90,fVar5,uVar1,uVar2,uVar3,uVar4,uStack_20,fStack_1c); return 0; } //@@ 008b7d30 FUN_008b7d30 undefined4 FUN_008b7d30(void *param_1) { undefined8 uVar1; undefined4 uVar2; int iVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 uVar6; void *pvVar7; float10 fVar8; float10 fVar9; undefined4 uStack_70; undefined4 uStack_6c; float fStack_68; undefined4 uStack_64; float fStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined8 uStack_38; undefined4 uStack_30; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; iVar3 = lua_type(param_1,1); if (iVar3 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar4 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)FUN_008ba900(); uStack_28 = *puVar5; uStack_24 = puVar5[1]; uStack_20 = puVar5[2]; uStack_1c = puVar5[3]; uStack_18 = puVar5[4]; uStack_14 = puVar5[5]; uStack_10 = puVar5[6]; uStack_c = puVar5[7]; uVar1 = *(undefined8 *)(puVar5 + 8); uVar2 = puVar5[10]; uVar6 = luaL_checkinteger(param_1,6); fVar8 = (float10)luaL_checknumber(param_1,5); iVar3 = lua_type(param_1,4); if (iVar3 == 0) { uStack_64 = 0; } else { pvVar7 = luabridge::Userdata::getClass(param_1,4,&g_luaClassKeyEntity,0); uStack_64 = *(undefined4 *)((int)pvVar7 + 4); } fVar9 = (float10)luaL_checknumber(param_1,3); puVar5 = (undefined4 *)FUN_008baa50(); uStack_70 = *puVar5; uStack_6c = puVar5[1]; uStack_58 = uStack_28; uStack_54 = uStack_24; uStack_50 = uStack_20; uStack_4c = uStack_1c; uStack_48 = uStack_18; uStack_44 = uStack_14; uStack_40 = uStack_10; uStack_3c = uStack_c; fStack_68 = (float)fVar9; fStack_60 = (float)fVar8; uStack_5c = uVar6; uStack_38 = uVar1; uStack_30 = uVar2; (*(code *)*puVar4)(&uStack_70,(float)fVar9,uStack_64,(float)fVar8,uVar6,&uStack_58); return 0; } //@@ 008b80f0 FUN_008b80f0 undefined4 FUN_008b80f0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; int iVar4; void *pvVar5; undefined4 uVar6; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_toboolean(param_1,3); iVar4 = lua_type(param_1,2); uVar6 = 0; if (iVar4 != 0) { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); uVar6 = *(undefined4 *)((int)pvVar5 + 4); } cVar1 = (*(code *)*puVar3)(uVar6,iVar2 != 0); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b81b0 FUN_008b81b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008b81b0(void *param_1) { undefined8 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 local_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined8 local_68; undefined4 local_60; undefined8 local_5c; undefined4 local_54; undefined4 local_50; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { local_50 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); local_50 = *(undefined4 *)((int)pvVar5 + 4); } puVar6 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar7 = (undefined4 *)FUN_008bacd0(param_1); puVar8 = (undefined4 *)FUN_008baa50(); local_8c = puVar7[2]; local_90 = puVar7[1]; local_94 = *puVar7; local_9c = *puVar8; local_98 = puVar8[1]; local_60 = puVar7[0xd]; local_88 = puVar7[3]; uStack_84 = puVar7[4]; uStack_80 = puVar7[5]; uStack_7c = puVar7[6]; local_54 = puVar7[0x10]; local_78 = puVar7[7]; uStack_74 = puVar7[8]; uStack_70 = puVar7[9]; uStack_6c = puVar7[10]; local_68 = *(undefined8 *)(puVar7 + 0xb); uVar1 = *(undefined8 *)(puVar7 + 0xe); local_5c._4_4_ = (undefined4)((ulonglong)uVar1 >> 0x20); uVar2 = local_5c._4_4_; local_5c._0_4_ = (undefined4)uVar1; uVar3 = (undefined4)local_5c; local_5c = uVar1; (*(code *)*puVar6)(&local_9c,local_94,local_90,local_8c,&local_88,uVar3,uVar2); return 0; } //@@ 008b82d0 FUN_008b82d0 undefined4 FUN_008b82d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82989); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8370 FUN_008b8370 undefined4 FUN_008b8370(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyLevel); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8410 FUN_008b8410 undefined4 FUN_008b8410(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyRoom); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b84b0 FUN_008b84b0 undefined4 FUN_008b84b0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8570 FUN_008b8570 undefined4 FUN_008b8570(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined8 *puVar4; undefined8 local_14; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar4 = (undefined8 *)FUN_008baa50(); local_14 = *puVar4; iVar1 = (*(code *)*puVar3)(&local_14); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8640 FUN_008b8640 undefined4 FUN_008b8640(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined4 *puVar4; float10 fVar5; undefined4 local_18; undefined4 local_14; float local_10; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { local_8 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); local_8 = *(undefined4 *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar5 = (float10)luaL_checknumber(param_1,3); local_10 = (float)fVar5; puVar4 = (undefined4 *)FUN_008baa50(); local_18 = *puVar4; local_14 = puVar4[1]; iVar1 = (*(code *)*puVar3)(&local_18,local_10); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar3 = (undefined4 *)lua_newuserdata(param_1,8); *puVar3 = luabridge::UserdataPtr::vftable; puVar3[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntityPlayer); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8740 FUN_008b8740 undefined4 FUN_008b8740(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008b87a0 FUN_008b87a0 undefined4 FUN_008b87a0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a10); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8840 FUN_008b8840 undefined4 FUN_008b8840(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a2a); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b88e0 FUN_008b88e0 undefined4 FUN_008b88e0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82978); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8980 FUN_008b8980 undefined4 FUN_008b8980(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a0d); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b8b30 FUN_008b8b30 undefined4 FUN_008b8b30(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); uVar4 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar4,uVar3); return 0; } //@@ 008b8bb0 FUN_008b8bb0 undefined4 FUN_008b8bb0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0,uVar3); return 0; } //@@ 008b8c30 FUN_008b8c30 undefined4 FUN_008b8c30(void *param_1) { int iVar1; undefined4 *puVar2; void *pvVar3; undefined4 uVar4; undefined4 local_8; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_type(param_1,4); if (iVar1 == 0) { local_8 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,4,&g_luaClassKeyEntityPlayer,0); local_8 = *(undefined4 *)((int)pvVar3 + 4); } uVar4 = luaL_checkinteger(param_1,3); iVar1 = lua_toboolean(param_1,2); (*(code *)*puVar2)(iVar1 != 0,uVar4,local_8); return 0; } //@@ 008b8ce0 FUN_008b8ce0 undefined4 FUN_008b8ce0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b8d70 FUN_008b8d70 undefined4 FUN_008b8d70(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,iVar1 != 0); return 0; } //@@ 008b8df0 FUN_008b8df0 undefined4 FUN_008b8df0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = (*(code *)*puVar2)(); puVar2 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a3e); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar2[1] = uVar3; return 1; } //@@ 008b8e80 FUN_008b8e80 undefined4 FUN_008b8e80(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b8ee0 FUN_008b8ee0 undefined4 FUN_008b8ee0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,3); uVar5 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar5,uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b8f70 FUN_008b8f70 undefined4 FUN_008b8f70(void *param_1) { int iVar1; undefined4 *puVar2; int *piVar3; iVar1 = lua_type(param_1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); piVar3 = (int *)(*(code *)*puVar2)(); lua_pushnumber(param_1,(double)*piVar3); return 1; } //@@ 008b8fe0 FUN_008b8fe0 undefined4 FUN_008b8fe0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,3); fVar4 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar4,uVar3); return 0; } //@@ 008b9070 FUN_008b9070 undefined4 FUN_008b9070(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085c050(); return 1; } //@@ 008b91d0 FUN_008b91d0 undefined4 FUN_008b91d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = (*(code *)*puVar2)(); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a2b); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008b9270 FUN_008b9270 undefined4 FUN_008b9270(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; undefined4 *puVar7; undefined4 *puVar8; float10 fVar9; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; iVar6 = lua_type(param_1,1); if (iVar6 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar7 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)FUN_008bb070(); uVar1 = *puVar8; uVar5 = puVar8[4]; uVar2 = puVar8[1]; uVar3 = puVar8[2]; uVar4 = puVar8[3]; iVar6 = lua_toboolean(param_1,3); fVar9 = (float10)luaL_checknumber(param_1,2); uStack_20 = uVar1; uStack_1c = uVar2; uStack_18 = uVar3; uStack_14 = uVar4; uStack_10 = uVar5; (*(code *)*puVar7)((float)fVar9,iVar6 != 0,&uStack_20); return 0; } //@@ 008b9380 FUN_008b9380 undefined4 FUN_008b9380(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 uVar9; float10 fVar10; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; iVar6 = lua_type(param_1,1); if (iVar6 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); } puVar7 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)FUN_008bb070(); uVar1 = *puVar8; uVar5 = puVar8[4]; uVar2 = puVar8[1]; uVar3 = puVar8[2]; uVar4 = puVar8[3]; uVar9 = luaL_checkinteger(param_1,3); fVar10 = (float10)luaL_checknumber(param_1,2); uStack_20 = uVar1; uStack_1c = uVar2; uStack_18 = uVar3; uStack_14 = uVar4; uStack_10 = uVar5; (*(code *)*puVar7)((float)fVar10,uVar9,&uStack_20); return 0; } //@@ 008b96d0 FUN_008b96d0 undefined4 FUN_008b96d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a16,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,(float)fVar4); return 0; } //@@ 008b9760 FUN_008b9760 undefined4 FUN_008b9760(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a16,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b97d0 FUN_008b97d0 undefined4 FUN_008b97d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a16,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b9820 FUN_008b9820 undefined4 FUN_008b9820(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a16,0); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b98b0 FUN_008b98b0 undefined4 FUN_008b98b0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; float10 fVar4; float10 fVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a16,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,4); fVar5 = (float10)luaL_checknumber(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,(float)fVar5,(float)fVar4); return 0; } //@@ 008b9950 FUN_008b9950 undefined4 FUN_008b9950(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; void *pvVar4; undefined4 uVar5; iVar1 = lua_type(); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a16,0); } uVar5 = 0xfff0b9d7; pvVar4 = param_1; puVar2 = (undefined4 *)lua_touserdata(); uVar5 = luaL_checkinteger(param_1,2,pvVar4,uVar5); fVar3 = (float10)(*(code *)*puVar2)(uVar5); lua_pushnumber(param_1,(double)(float)fVar3); return 1; } //@@ 008b99f0 FUN_008b99f0 undefined4 FUN_008b99f0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,(float)fVar4); return 0; } //@@ 008b9a80 FUN_008b9a80 undefined4 FUN_008b9a80(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; float10 fVar4; float10 fVar5; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,4); fVar5 = (float10)luaL_checknumber(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,(float)fVar5,(float)fVar4); return 0; } //@@ 008b9b20 FUN_008b9b20 undefined4 FUN_008b9b20(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3); return 0; } //@@ 008b9b90 FUN_008b9b90 undefined4 FUN_008b9b90(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar3); return 0; } //@@ 008b9c20 FUN_008b9c20 undefined4 FUN_008b9c20(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); return 0; } //@@ 008b9c70 FUN_008b9c70 undefined4 FUN_008b9c70(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = lua_toboolean(param_1,3); uVar3 = luaL_checkinteger(param_1,2); (*(code *)*puVar2)(uVar3,iVar1 != 0); return 0; } //@@ 008b9cf0 FUN_008b9cf0 undefined4 FUN_008b9cf0(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); cVar1 = (*(code *)*puVar3)(uVar4); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b9d80 FUN_008b9d80 undefined4 FUN_008b9d80(void *param_1) { char cVar1; int iVar2; undefined4 *puVar3; iVar2 = lua_type(param_1,1); if (iVar2 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,1); } puVar3 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); cVar1 = (*(code *)*puVar3)(); lua_pushboolean(param_1,cVar1 != '\0'); return 1; } //@@ 008b9df0 FUN_008b9df0 undefined4 FUN_008b9df0(void *param_1) { int iVar1; undefined4 *puVar2; float10 fVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); fVar3 = (float10)luaL_checknumber(param_1,3); fVar4 = (float10)luaL_checknumber(param_1,2); (*(code *)*puVar2)((float)fVar4,(float)fVar3); return 0; } //@@ 008b9e80 FUN_008b9e80 undefined4 FUN_008b9e80(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a19,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bfd0(); return 1; } //@@ 008b9ee0 FUN_008b9ee0 undefined4 * FUN_008b9ee0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int iVar5; void *pvVar6; undefined4 *puVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 *in_ECX; undefined4 uVar11; undefined4 uStack_64; iVar5 = lua_type(param_1,6); if (iVar5 == 0) { uVar11 = 0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,6,&g_luaClassKeyEntity,0); uVar11 = *(undefined4 *)((int)pvVar6 + 4); } puVar7 = (undefined4 *)FUN_008baa50(); uVar1 = *puVar7; uVar2 = puVar7[1]; puVar7 = (undefined4 *)FUN_008baa50(); uVar3 = *puVar7; uVar4 = puVar7[1]; uVar8 = luaL_checkinteger(param_1,3); uVar9 = luaL_checkinteger(param_1,2); uVar10 = luaL_checkinteger(param_1,1); in_ECX[1] = uVar9; in_ECX[2] = uVar8; in_ECX[3] = uVar3; in_ECX[4] = uVar4; *in_ECX = uVar10; in_ECX[5] = uVar1; in_ECX[6] = uVar2; in_ECX[7] = uVar11; in_ECX[8] = uStack_64; return in_ECX; } //@@ 008b9ff0 FUN_008b9ff0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008b9ff0(undefined4 param_1) { byte *text; char *in_ECX; void *ptr; uint size; char *local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afc99d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_30 = in_ECX; text = (byte *)luaL_checklstring(param_1,1,&local_30,local_14); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,(uint)local_30); local_8 = (void *)0x0; std::string::string(in_ECX,local_2c); if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 008ba0c0 FUN_008ba0c0 void FUN_008ba0c0(void *param_1) { int iVar1; undefined4 uVar2; undefined4 *in_ECX; void *local_c; int local_8; local_c = param_1; lua_pushvalue(param_1,1); iVar1 = luaL_ref(param_1,0xfff0b9d8); *in_ECX = param_1; local_8 = iVar1; if (iVar1 == -1) { uVar2 = 0xffffffff; } else { LuaRef::push(&local_c,param_1); uVar2 = luaL_ref(param_1,0xfff0b9d8); } in_ECX[1] = uVar2; luaL_unref(param_1,0xfff0b9d8,iVar1); return; } //@@ 008ba130 FUN_008ba130 void FUN_008ba130(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x58); } return; } //@@ 008ba150 FUN_008ba150 void FUN_008ba150(void) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("invalid vector subscript"); } //@@ 008ba160 FUN_008ba160 void FUN_008ba160(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x3c) = 0; *(undefined4 *)(in_ECX + 0x40) = 0; return; } //@@ 008ba170 FUN_008ba170 void FUN_008ba170(void) { ANM2 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset(in_ECX); AnimationState::~AnimationState(&in_ECX->_overlayAnimState); AnimationState::~AnimationState(&in_ECX->_animState); std::string::_Tidy_deallocate((in_ECX->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)in_ECX); ExceptionList = local_10; return; } //@@ 008ba1e0 FUN_008ba1e0 void FUN_008ba1e0(undefined4 param_1) { float *in_ECX; float10 fVar1; float10 fVar2; float10 fVar3; float10 fVar4; float10 fVar5; float10 fVar6; float10 fVar7; float10 fVar8; float fStack_5c; fVar1 = (float10)luaL_checknumber(param_1,9); fVar2 = (float10)luaL_checknumber(param_1,8); fVar3 = (float10)luaL_checknumber(param_1,7); fVar4 = (float10)luaL_checknumber(param_1,6); fVar5 = (float10)luaL_checknumber(param_1,5); fVar6 = (float10)luaL_checknumber(param_1,4); fVar7 = (float10)luaL_checknumber(param_1,3); fVar8 = (float10)luaL_checknumber(param_1,2); in_ECX[1] = (float)fVar7; in_ECX[2] = (float)fVar6; in_ECX[3] = (float)fVar5; in_ECX[4] = (float)fVar4; *in_ECX = (float)fVar8; in_ECX[5] = (float)fVar3; in_ECX[6] = (float)fVar2; in_ECX[7] = (float)fVar1; in_ECX[8] = fStack_5c; return; } //@@ 008ba300 FUN_008ba300 void FUN_008ba300(void) { undefined1 *puVar1; undefined4 *puVar2; int in_EDX; puVar2 = (undefined4 *)lua_newuserdata(); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(); lua_setmetatable(); puVar1 = (undefined1 *)puVar2[1]; *puVar1 = 1; *(undefined4 *)(puVar1 + 4) = *(undefined4 *)(in_EDX + 4); *(undefined4 *)(puVar1 + 8) = *(undefined4 *)(in_EDX + 8); *(undefined4 *)(puVar1 + 0xc) = *(undefined4 *)(in_EDX + 0xc); return; } //@@ 008ba360 FUN_008ba360 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008ba360(undefined4 param_1) { float fVar1; byte *pbVar2; char *in_ECX; void *pvVar3; uint uVar4; float10 fVar5; undefined4 local_58; uint local_54; char *local_50; char local_4c [24]; float local_34; undefined4 local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b05605; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_50 = in_ECX; fVar5 = (float10)luaL_checknumber(param_1,4,local_14); fVar1 = (float)fVar5; pbVar2 = (byte *)luaL_checklstring(param_1,3,&local_50); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,pbVar2,(uint)local_50); local_8 = (void *)0x0; std::string::string(local_4c,local_2c); local_8 = (void *)0xffffffff; local_30 = local_58; local_34 = fVar1; if (0xf < local_18) { uVar4 = local_18 + 1; pvVar3 = local_2c[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_2c[0] + -4); uVar4 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } local_8 = (void *)0x1; pbVar2 = (byte *)luaL_checklstring(param_1,2,&local_54); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,pbVar2,local_54); local_8._0_1_ = 2; std::string::string(in_ECX,local_2c); local_8 = (void *)CONCAT31(local_8._1_3_,3); std::string::string(in_ECX + 0x18,local_4c); *(float *)(in_ECX + 0x30) = local_34; *(undefined4 *)(in_ECX + 0x34) = local_30; if (0xf < local_18) { uVar4 = local_18 + 1; pvVar3 = local_2c[0]; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_2c[0] + -4); uVar4 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } std::string::_Tidy_deallocate(local_4c); ExceptionList = local_10; return; } //@@ 008ba500 FUN_008ba500 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 * FUN_008ba500(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uStack_68; undefined4 *local_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; uint local_14; local_14 = __security_cookie ^ (uint)&uStack_68; uStack_68 = luaL_checkinteger(param_1,6); iVar1 = lua_type(param_1,5); uStack_5c = 0; if (iVar1 != 0) { pvVar2 = luabridge::Userdata::getClass(param_1,5,&g_luaClassKeyItem,1); uStack_5c = *(undefined4 *)((int)pvVar2 + 4); } uStack_58 = uStack_68; puVar3 = (undefined4 *)FUN_008bb0d0(); uStack_50 = *puVar3; uStack_4c = puVar3[1]; uStack_48 = puVar3[2]; uStack_44 = puVar3[3]; uStack_40 = luaL_checkinteger(param_1,3); uStack_3c = uStack_50; uStack_38 = uStack_4c; uStack_34 = uStack_48; uStack_30 = uStack_44; uStack_2c = uStack_5c; uStack_28 = uStack_58; uStack_24 = uStack_60; uVar4 = luaL_checkinteger(param_1,2); local_64[1] = uStack_40; local_64[2] = uStack_3c; local_64[3] = uStack_38; local_64[4] = uStack_34; *local_64 = uVar4; local_64[5] = uStack_30; local_64[6] = uStack_2c; local_64[7] = uStack_28; local_64[8] = uStack_24; return local_64; } //@@ 008ba5e0 FUN_008ba5e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008ba5e0(undefined4 param_1) { undefined4 uVar1; byte *text; char *in_ECX; void *ptr; uint size; char *local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff10d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_30 = in_ECX; uVar1 = luaL_checkinteger(param_1,3,local_14); text = (byte *)luaL_checklstring(param_1,2,&local_30); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,(uint)local_30); local_8 = (void *)0x0; std::string::string(in_ECX,local_2c); *(undefined4 *)(in_ECX + 0x18) = uVar1; *(char **)(in_ECX + 0x1c) = local_30; if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 008ba6d0 FUN_008ba6d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008ba6d0(undefined4 param_1) { int iVar1; byte *text; char *in_ECX; void *ptr; uint size; char *local_34; undefined2 local_2e; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af828d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_34 = in_ECX; iVar1 = lua_toboolean(param_1,3,local_14); local_2e = CONCAT11(local_2e._1_1_,iVar1 != 0); text = (byte *)luaL_checklstring(param_1,2,&local_34); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,(uint)local_34); local_8 = (void *)0x0; std::string::string(in_ECX,local_2c); *(undefined2 *)(in_ECX + 0x18) = local_2e; if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 008ba7c0 FUN_008ba7c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008ba7c0(undefined4 param_1) { byte *text; char *in_ECX; void *ptr; uint size; char *local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afc99d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_30 = in_ECX; text = (byte *)luaL_checklstring(param_1,2,&local_30,local_14); local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)0x0; std::string::assign((char *)local_2c,text,(uint)local_30); local_8 = (void *)0x0; std::string::string(in_ECX,local_2c); if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 008ba890 FUN_008ba890 void FUN_008ba890(undefined4 param_1) { float *in_ECX; float10 fVar1; float10 fVar2; float10 fVar3; float10 fVar4; float fStack_8; fVar1 = (float10)luaL_checknumber(param_1,5); fVar2 = (float10)luaL_checknumber(param_1,4); fVar3 = (float10)luaL_checknumber(param_1,3); fVar4 = (float10)luaL_checknumber(param_1,2); *in_ECX = (float)fVar4; in_ECX[1] = (float)fVar3; in_ECX[2] = (float)fVar2; in_ECX[3] = (float)fVar1; in_ECX[4] = fStack_8; return; } //@@ 008ba900 FUN_008ba900 int FUN_008ba900(void) { int iVar1; void *pvVar2; void *in_ECX; int in_EDX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,in_EDX,&DAT_00c8298c,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008ba960 FUN_008ba960 int FUN_008ba960(void) { int iVar1; void *pvVar2; void *in_ECX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,2,&DAT_00c82a29,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008ba9c0 FUN_008ba9c0 void FUN_008ba9c0(void *param_1) { char *in_ECX; void *ptr; uint size; uint in_stack_00000018; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0563d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; std::string::string(in_ECX,¶m_1); if (0xf < in_stack_00000018) { size = in_stack_00000018 + 1; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = in_stack_00000018 + 0x24; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return; } //@@ 008baa50 FUN_008baa50 int FUN_008baa50(void) { int iVar1; void *pvVar2; void *in_ECX; int in_EDX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,in_EDX,&g_luaClassKeyVector,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008baab0 FUN_008baab0 void FUN_008baab0(void *param_1) { float fVar1; float fVar2; float fVar3; float fVar4; undefined8 uVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; int iVar12; void *pvVar13; float *in_ECX; float *pfVar14; float10 fVar15; float10 fVar16; float10 fVar17; float10 fVar18; float fStack_20; float fStack_1c; float fStack_14; iVar12 = lua_type(param_1,8); if (iVar12 == 0) { pfVar14 = (float *)0x0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,8,&DAT_00c82986,1); pfVar14 = *(float **)((int)pvVar13 + 4); if (pfVar14 != (float *)0x0) goto LAB_008bab02; } luaL_error(param_1,"nil passed to reference"); LAB_008bab02: fVar8 = *pfVar14; fVar9 = pfVar14[1]; fVar10 = pfVar14[2]; fVar11 = pfVar14[3]; fVar6 = pfVar14[6]; uVar5 = *(undefined8 *)(pfVar14 + 4); pfVar14 = (float *)FUN_008bb070(); fVar1 = *pfVar14; fVar7 = pfVar14[4]; fVar2 = pfVar14[1]; fVar3 = pfVar14[2]; fVar4 = pfVar14[3]; fVar15 = (float10)luaL_checknumber(param_1,6); fVar16 = (float10)luaL_checknumber(param_1,5); fVar17 = (float10)luaL_checknumber(param_1,4); fVar18 = (float10)luaL_checknumber(param_1,3); in_ECX[1] = (float)fVar17; in_ECX[2] = (float)fVar16; in_ECX[3] = (float)fVar15; in_ECX[4] = fVar1; in_ECX[5] = fVar2; in_ECX[6] = fVar3; in_ECX[7] = fVar4; in_ECX[8] = fVar7; *in_ECX = (float)fVar18; in_ECX[9] = fVar8; in_ECX[10] = fVar9; in_ECX[0xb] = fVar10; in_ECX[0xc] = fVar11; fStack_20 = (float)uVar5; fStack_1c = (float)((ulonglong)uVar5 >> 0x20); in_ECX[0xd] = fStack_20; in_ECX[0xe] = fStack_1c; in_ECX[0xf] = fVar6; in_ECX[0x10] = fStack_14; return; } //@@ 008bac00 FUN_008bac00 int FUN_008bac00(void) { int iVar1; void *pvVar2; void *in_ECX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,2,&g_luaClassKeyBitSet128,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008bac60 FUN_008bac60 void FUN_008bac60(void *param_1) { undefined4 uVar1; int iVar2; void *pvVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined4 uVar5; undefined4 local_8; iVar2 = lua_type(param_1,4); if (iVar2 == 0) { uVar5 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,4,&g_luaClassKeyEntity,0); uVar5 = *(undefined4 *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)FUN_008baa50(); uVar1 = *puVar4; in_ECX[1] = puVar4[1]; in_ECX[3] = local_8; in_ECX[2] = uVar5; *in_ECX = uVar1; return; } //@@ 008bacd0 FUN_008bacd0 undefined4 * FUN_008bacd0(undefined4 param_1) { undefined8 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 *puVar12; undefined4 uVar13; undefined4 uVar14; undefined4 *in_ECX; float10 fVar15; float10 fVar16; undefined4 uStack_3c; uVar11 = luaL_checkinteger(param_1,8); fVar15 = (float10)luaL_checknumber(param_1,7); puVar12 = (undefined4 *)FUN_008ba900(); uVar3 = *puVar12; uVar4 = puVar12[1]; uVar5 = puVar12[2]; uVar6 = puVar12[3]; uVar2 = puVar12[10]; uVar7 = puVar12[4]; uVar8 = puVar12[5]; uVar9 = puVar12[6]; uVar10 = puVar12[7]; uVar1 = *(undefined8 *)(puVar12 + 8); fVar16 = (float10)luaL_checknumber(param_1,5); uVar13 = luaL_checkinteger(param_1,4); uVar14 = luaL_checkinteger(param_1,3); in_ECX[2] = (float)fVar16; *in_ECX = uVar14; uStack_3c = (undefined4)((ulonglong)uVar1 >> 0x20); in_ECX[1] = uVar13; in_ECX[3] = uVar3; in_ECX[4] = uVar4; in_ECX[5] = uVar5; in_ECX[6] = uVar6; in_ECX[7] = uVar7; in_ECX[8] = uVar8; in_ECX[9] = uVar9; in_ECX[10] = uVar10; *(undefined8 *)(in_ECX + 0xb) = uVar1; in_ECX[0xd] = uVar2; *(ulonglong *)(in_ECX + 0xe) = CONCAT44(uVar11,(float)fVar15); in_ECX[0x10] = uStack_3c; return in_ECX; } //@@ 008badb0 FUN_008badb0 int FUN_008badb0(void) { int iVar1; void *pvVar2; void *in_ECX; int in_EDX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,in_EDX,&DAT_00c82992,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008bae10 FUN_008bae10 void FUN_008bae10(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x34); } return; } //@@ 008bae40 FUN_008bae40 void FUN_008bae40(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } return; } //@@ 008bae70 FUN_008bae70 void FUN_008bae70(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 008baea0 MemMapBase::`scalar_deleting_destructor' /* Library Function - Single Match protected: virtual void * __thiscall MemMapBase::`scalar deleting destructor'(unsigned int) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void * __thiscall MemMapBase::_scalar_deleting_destructor_(MemMapBase *this,uint param_1) { *this = (MemMapBase)luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(this,0xc); } return this; } //@@ 008baed0 FUN_008baed0 void FUN_008baed0(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x28); } return; } //@@ 008baf00 FUN_008baf00 void FUN_008baf00(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = luabridge::UserdataValue::vftable; if (*(char *)(in_ECX + 2) == '\0') { local_8 = 0; tracked_alloc(1,(void *)in_ECX[3],0); } *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } ExceptionList = local_10; return; } //@@ 008baf80 FUN_008baf80 void FUN_008baf80(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x2c); } return; } //@@ 008bafb0 FUN_008bafb0 void FUN_008bafb0(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x70); } return; } //@@ 008bafe0 FUN_008bafe0 void FUN_008bafe0(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x1c); } return; } //@@ 008bb010 FUN_008bb010 void FUN_008bb010(void *param_1) { int iVar1; void *pvVar2; iVar1 = lua_type(param_1,5); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,5,&DAT_00c82998,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 != 0) goto LAB_008bb05b; } luaL_error(param_1,"nil passed to reference"); LAB_008bb05b: FUN_004c5850(iVar1); return; } //@@ 008bb070 FUN_008bb070 int FUN_008bb070(void) { int iVar1; void *pvVar2; void *in_ECX; int in_EDX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,in_EDX,&DAT_00c82983,1); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008bb0d0 FUN_008bb0d0 int FUN_008bb0d0(void) { int iVar1; void *pvVar2; void *in_ECX; iVar1 = lua_type(); if (iVar1 == 0) { luaL_error(); return 0; } pvVar2 = luabridge::Userdata::getClass(in_ECX,4,&DAT_00c82995,0); iVar1 = *(int *)((int)pvVar2 + 4); if (iVar1 == 0) { luaL_error(); } return iVar1; } //@@ 008bb130 FUN_008bb130 bool FUN_008bb130(void) { undefined4 uVar1; undefined4 uVar2; int iVar3; undefined4 *in_ECX; uVar1 = *in_ECX; lua_rawgeti(uVar1,0xfff0b9d8,in_ECX[1],(int)in_ECX[1] >> 0x1f); lua_rawgeti(uVar1,0xfff0b9d8,in_ECX[2],(int)in_ECX[2] >> 0x1f); lua_gettable(uVar1,0xfffffffe); lua_rotate(uVar1,0xfffffffe,0xffffffff); lua_settop(uVar1,0xfffffffe); uVar2 = lua_gettop(*in_ECX); iVar3 = lua_toboolean(*in_ECX,uVar2); lua_settop(uVar1,0xfffffffe); return iVar3 != 0; } //@@ 008bb1c0 FUN_008bb1c0 undefined4 FUN_008bb1c0(void *param_1) { int *piVar1; int iVar2; void *pvVar3; undefined4 *puVar4; iVar2 = lua_type(param_1,2); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); iVar2 = *(int *)((int)pvVar3 + 4); } puVar4 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar4 = luabridge::UserdataValue::vftable; puVar4[1] = puVar4 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297d); lua_setmetatable(param_1,0xfffffffe); piVar1 = (int *)puVar4[1]; *piVar1 = 0; if (iVar2 != 0) { *piVar1 = iVar2; std::multiset::insert(piVar1); } return 1; } //@@ 008bb260 FUN_008bb260 undefined4 FUN_008bb260(undefined4 param_1) { float *pfVar1; undefined4 *puVar2; float10 fVar3; float10 fVar4; fVar3 = (float10)luaL_checknumber(param_1,3); fVar4 = (float10)luaL_checknumber(param_1,2); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar2[1]; *pfVar1 = (float)fVar4; pfVar1[1] = (float)fVar3; return 1; } //@@ 008bb2e0 FUN_008bb2e0 undefined4 FUN_008bb2e0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008bb340 FUN_008bb340 undefined4 FUN_008bb340(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyVector,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bb3b0 FUN_008bb3b0 undefined4 FUN_008bb3b0(undefined4 param_1) { undefined4 *puVar1; undefined4 local_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; FUN_008ba890(param_1); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x1c); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82983); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; puVar1[4] = 0; *puVar1 = local_18; puVar1[1] = uStack_14; puVar1[2] = uStack_10; puVar1[3] = uStack_c; return 1; } //@@ 008bb420 FUN_008bb420 undefined4 FUN_008bb420(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82983,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008bb480 FUN_008bb480 undefined4 FUN_008bb480(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82983,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bb4f0 FUN_008bb4f0 undefined4 FUN_008bb4f0(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(param_1,0x24); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82986); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; puVar1[6] = 0; *puVar1 = 0; puVar1[1] = 0xffff; puVar1[2] = 0; puVar1[3] = 0x3f800000; puVar1[4] = 0xffffffff; puVar1[5] = 0; puVar1[6] = 0; return 1; } //@@ 008bb570 FUN_008bb570 undefined4 FUN_008bb570(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(param_1,0x54); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82989); lua_setmetatable(param_1,0xfffffffe); Font::Font((Font *)puVar1[1]); return 1; } //@@ 008bb5c0 FUN_008bb5c0 undefined4 FUN_008bb5c0(undefined4 param_1) { float *pfVar1; undefined4 *puVar2; float10 fVar3; float10 fVar4; float10 fVar5; float10 fVar6; float10 fVar7; float10 fVar8; float10 fVar9; fVar3 = (float10)luaL_checknumber(param_1,8); fVar4 = (float10)luaL_checknumber(param_1,7); fVar5 = (float10)luaL_checknumber(param_1,6); fVar6 = (float10)luaL_checknumber(param_1,5); fVar7 = (float10)luaL_checknumber(param_1,4); fVar8 = (float10)luaL_checknumber(param_1,3); fVar9 = (float10)luaL_checknumber(param_1,2); puVar2 = (undefined4 *)lua_newuserdata(param_1,0x34); *puVar2 = luabridge::UserdataValue::vftable; puVar2[1] = puVar2 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8298c); lua_setmetatable(param_1,0xfffffffe); pfVar1 = (float *)puVar2[1]; pfVar1[4] = 0.0; pfVar1[5] = 0.0; pfVar1[6] = 0.0; pfVar1[7] = 0.0; *pfVar1 = (float)fVar9; pfVar1[1] = (float)fVar8; pfVar1[2] = (float)fVar7; pfVar1[8] = (float)fVar5; pfVar1[3] = (float)fVar6; pfVar1[9] = (float)fVar4; pfVar1[10] = (float)fVar3; return 1; } //@@ 008bb720 FUN_008bb720 undefined4 FUN_008bb720(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(param_1,0x11c); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeySprite); lua_setmetatable(param_1,0xfffffffe); ANM2::constructor((ANM2 *)puVar1[1]); return 1; } //@@ 008bb770 FUN_008bb770 undefined4 FUN_008bb770(void *param_1) { int iVar1; void *pvVar2; undefined4 *puVar3; float fVar4; uint uVar5; float fVar6; uint uVar7; uint uVar8; iVar1 = lua_type(param_1,2); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); iVar1 = *(int *)((int)pvVar2 + 4); } puVar3 = (undefined4 *)lua_newuserdata(param_1,0x30); *puVar3 = luabridge::UserdataValue::vftable; puVar3[1] = puVar3 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82992); lua_setmetatable(param_1,0xfffffffe); puVar3 = (undefined4 *)puVar3[1]; if (iVar1 == 0) { *puVar3 = 0; puVar3[1] = 0; puVar3[2] = 0; puVar3[3] = 0; fVar4 = g_vectorZero.x; fVar6 = g_vectorZero.y; } else { *puVar3 = *(undefined4 *)(iVar1 + 0x28); puVar3[1] = *(undefined4 *)(iVar1 + 0x2c); puVar3[2] = *(undefined4 *)(iVar1 + 0x34); puVar3[3] = *(undefined4 *)(iVar1 + 0x38); fVar4 = *(float *)(iVar1 + 0x33c); fVar6 = *(float *)(iVar1 + 0x340); } puVar3[4] = fVar4; puVar3[5] = fVar6; if (iVar1 == 0) { fVar4 = g_vectorZero.x; fVar6 = g_vectorZero.y; } else { fVar4 = *(float *)(iVar1 + 0x360); fVar6 = *(float *)(iVar1 + 0x364); } puVar3[6] = fVar4; puVar3[7] = fVar6; if ((iVar1 == 0) || ((*(uint *)(iVar1 + 0x168) & 0x100) == 0)) { uVar8 = 0; if (iVar1 != 0) goto LAB_008bb8a1; uVar8 = 0; LAB_008bb8ba: uVar7 = 0; if (iVar1 != 0) goto LAB_008bb8c0; } else { uVar8 = 1; LAB_008bb8a1: if ((*(uint *)(iVar1 + 0x168) & 0x20000000) == 0) goto LAB_008bb8ba; uVar7 = 2; LAB_008bb8c0: if ((*(uint *)(iVar1 + 0x16c) & 0x400000) != 0) { uVar5 = 4; goto LAB_008bb8db; } } uVar5 = 0; LAB_008bb8db: puVar3[9] = iVar1; puVar3[8] = uVar5 | uVar7 | uVar8; return 1; } //@@ 008bb900 FUN_008bb900 undefined4 FUN_008bb900(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bb960 FUN_008bb960 undefined4 FUN_008bb960(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bb9c0 FUN_008bb9c0 undefined4 FUN_008bb9c0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008bba20 FUN_008bba20 undefined4 FUN_008bba20(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,*(int *)(*piVar3 + iVar1),*(int *)(*piVar3 + iVar1) >> 0x1f); return 1; } //@@ 008bba80 FUN_008bba80 undefined4 FUN_008bba80(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bbb20 FUN_008bbb20 undefined4 FUN_008bbb20(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bbbc0 FUN_008bbbc0 undefined4 FUN_008bbbc0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *(int *)(iVar1 + *piVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008bbc60 FUN_008bbc60 undefined4 FUN_008bbc60(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82992,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = 0; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); *(undefined4 *)(iVar1 + *piVar2) = *(undefined4 *)((int)pvVar4 + 4); return 0; } //@@ 008bbcf0 FUN_008bbcf0 undefined4 FUN_008bbcf0(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82995); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; *(undefined8 *)(puVar1 + 1) = 0x900000005; puVar1[3] = 7; *puVar1 = 0xaa17414f; return 1; } //@@ 008bbd60 FUN_008bbd60 undefined4 FUN_008bbd60(undefined4 param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)lua_newuserdata(param_1,0xb0); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82998); lua_setmetatable(param_1,0xfffffffe); ProjectileParams::ProjectileParams((ProjectileParams *)puVar1[1]); return 1; } //@@ 008bbdb0 FUN_008bbdb0 undefined4 FUN_008bbdb0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bbe10 FUN_008bbe10 undefined4 FUN_008bbe10(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bbe80 FUN_008bbe80 undefined4 FUN_008bbe80(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008bbee0 FUN_008bbee0 undefined4 FUN_008bbee0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bbf50 FUN_008bbf50 undefined4 FUN_008bbf50(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_008ab7d0(); return 1; } //@@ 008bbfb0 FUN_008bbfb0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008bbfb0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; int iVar10; int *piVar11; int iVar12; void *pvVar13; undefined4 *puVar14; undefined4 *puVar15; undefined4 local_34 [11]; uint local_8; local_8 = __security_cookie ^ (uint)(local_34 + 0xc); iVar10 = lua_type(param_1,1); if (iVar10 == 0) { iVar10 = 0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,0); iVar10 = *(int *)((int)pvVar13 + 4); } piVar11 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar12 = lua_type(param_1,2); if (iVar12 == 0) { puVar15 = (undefined4 *)0x0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,2,&DAT_00c8298c,1); puVar15 = *(undefined4 **)((int)pvVar13 + 4); } uVar2 = *puVar15; uVar3 = puVar15[1]; uVar4 = puVar15[2]; uVar5 = puVar15[3]; uVar6 = puVar15[4]; uVar7 = puVar15[5]; uVar8 = puVar15[6]; uVar9 = puVar15[7]; puVar14 = (undefined4 *)(*piVar11 + iVar10); uVar1 = puVar15[10]; if (puVar14 != local_34) { *(undefined8 *)(puVar14 + 8) = *(undefined8 *)(puVar15 + 8); *puVar14 = uVar2; puVar14[1] = uVar3; puVar14[2] = uVar4; puVar14[3] = uVar5; puVar14[10] = uVar1; puVar14[4] = uVar6; puVar14[5] = uVar7; puVar14[6] = uVar8; puVar14[7] = uVar9; } return 0; } //@@ 008bc070 FUN_008bc070 undefined4 FUN_008bc070(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); FUN_0085c030(*(undefined4 *)(*piVar3 + iVar1),*(undefined4 *)(*piVar3 + 4 + iVar1)); return 1; } //@@ 008bc0d0 FUN_008bc0d0 undefined4 FUN_008bc0d0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined8 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar5 = luaL_checkinteger(param_1,2); iVar1 = *piVar4; *(int *)(iVar2 + iVar1) = (int)uVar5; *(int *)(iVar2 + 4 + iVar1) = (int)((ulonglong)uVar5 >> 0x20); return 0; } //@@ 008bc130 FUN_008bc130 undefined4 FUN_008bc130(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bc1d0 FUN_008bc1d0 undefined4 FUN_008bc1d0(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bc270 FUN_008bc270 undefined4 FUN_008bc270(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bc2d0 FUN_008bc2d0 undefined4 FUN_008bc2d0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82998,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bc330 FUN_008bc330 undefined4 FUN_008bc330(undefined4 param_1) { undefined4 *puVar1; undefined8 uVar2; undefined8 uVar3; uVar2 = luaL_checkinteger(param_1,3); uVar3 = luaL_checkinteger(param_1,2); puVar1 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar1 = luabridge::UserdataValue::vftable; puVar1[1] = puVar1 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar1 = (undefined4 *)puVar1[1]; *puVar1 = (int)uVar3; puVar1[2] = (int)uVar2; puVar1[1] = (int)((ulonglong)uVar3 >> 0x20); puVar1[3] = (int)((ulonglong)uVar2 >> 0x20); return 1; } //@@ 008bc3c0 FUN_008bc3c0 undefined4 FUN_008bc3c0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyBitSet128,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); FUN_0085c030(*(undefined4 *)(*piVar3 + iVar1),*(undefined4 *)(*piVar3 + 4 + iVar1)); return 1; } //@@ 008bc420 FUN_008bc420 undefined4 FUN_008bc420(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined8 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyBitSet128,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar5 = luaL_checkinteger(param_1,2); iVar1 = *piVar4; *(int *)(iVar2 + iVar1) = (int)uVar5; *(int *)(iVar2 + 4 + iVar1) = (int)((ulonglong)uVar5 >> 0x20); return 0; } //@@ 008bc480 FUN_008bc480 undefined4 FUN_008bc480(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bc4e0 FUN_008bc4e0 undefined4 FUN_008bc4e0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bc540 FUN_008bc540 undefined4 FUN_008bc540(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008bc5b0 FUN_008bc5b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008bc5b0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008bc6c0 FUN_008bc6c0 undefined4 FUN_008bc6c0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bc720 FUN_008bc720 undefined4 FUN_008bc720(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bc790 FUN_008bc790 undefined4 FUN_008bc790(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008bc7f0 FUN_008bc7f0 undefined4 FUN_008bc7f0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a1,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,*(int *)(*piVar3 + iVar1),*(int *)(*piVar3 + iVar1) >> 0x1f); return 1; } //@@ 008bc850 FUN_008bc850 undefined4 FUN_008bc850(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bc8b0 FUN_008bc8b0 undefined4 FUN_008bc8b0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bc910 FUN_008bc910 undefined4 FUN_008bc910(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008bc980 FUN_008bc980 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008bc980(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008bca90 FUN_008bca90 undefined4 FUN_008bca90(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bcaf0 FUN_008bcaf0 undefined4 FUN_008bcaf0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bcb60 FUN_008bcb60 undefined4 FUN_008bcb60(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,*(int *)(*piVar3 + iVar1),*(int *)(*piVar3 + iVar1) >> 0x1f); return 1; } //@@ 008bcbc0 FUN_008bcbc0 undefined4 FUN_008bcbc0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a58); lua_setmetatable(param_1,0xfffffffe); *(undefined1 *)puVar5[1] = *(undefined1 *)(iVar1 + iVar2); return 1; } //@@ 008bcc50 FUN_008bcc50 undefined4 FUN_008bcc50(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829a4,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined1 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a58,1); *(undefined1 *)(iVar1 + *piVar2) = **(undefined1 **)((int)pvVar4 + 4); return 0; } //@@ 008bccf0 FUN_008bccf0 undefined4 FUN_008bccf0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bcd50 FUN_008bcd50 undefined4 FUN_008bcd50(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bcdb0 FUN_008bcdb0 undefined4 FUN_008bcdb0(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008bce20 FUN_008bce20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008bce20(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008bcf30 FUN_008bcf30 undefined4 FUN_008bcf30(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008bcf90 FUN_008bcf90 undefined4 FUN_008bcf90(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bd000 FUN_008bd000 undefined4 FUN_008bd000(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bd070 FUN_008bd070 undefined4 FUN_008bd070(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,(int)*(short *)(*piVar3 + iVar1),(int)*(short *)(*piVar3 + iVar1) >> 0x1f) ; return 1; } //@@ 008bd0d0 FUN_008bd0d0 undefined4 FUN_008bd0d0(void *param_1) { undefined2 uVar1; int iVar2; void *pvVar3; int *piVar4; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar1 = luaL_checkinteger(param_1,2); *(undefined2 *)(iVar2 + *piVar4) = uVar1; return 0; } //@@ 008bd130 FUN_008bd130 undefined4 FUN_008bd130(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,*(int *)(*piVar3 + iVar1),*(int *)(*piVar3 + iVar1) >> 0x1f); return 1; } //@@ 008bd190 FUN_008bd190 undefined4 FUN_008bd190(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); FUN_0085c030(*(undefined4 *)(*piVar3 + iVar1),*(undefined4 *)(*piVar3 + 4 + iVar1)); return 1; } //@@ 008bd1f0 FUN_008bd1f0 undefined4 FUN_008bd1f0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined8 uVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyItem,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar5 = luaL_checkinteger(param_1,2); iVar1 = *piVar4; *(int *)(iVar2 + iVar1) = (int)uVar5; *(int *)(iVar2 + 4 + iVar1) = (int)((ulonglong)uVar5 >> 0x20); return 0; } //@@ 008bd250 FUN_008bd250 undefined4 FUN_008bd250(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bd2b0 FUN_008bd2b0 undefined4 FUN_008bd2b0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bd310 FUN_008bd310 undefined4 FUN_008bd310(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008bd380 FUN_008bd380 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008bd380(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008bd490 FUN_008bd490 undefined4 FUN_008bd490(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bd4f0 FUN_008bd4f0 undefined4 FUN_008bd4f0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bd560 FUN_008bd560 undefined4 FUN_008bd560(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a57); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008bd5f0 FUN_008bd5f0 undefined4 FUN_008bd5f0(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829aa,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a57,1); *(undefined4 *)(iVar1 + *piVar2) = **(undefined4 **)((int)pvVar4 + 4); return 0; } //@@ 008bd690 FUN_008bd690 undefined4 FUN_008bd690(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bd6f0 FUN_008bd6f0 undefined4 FUN_008bd6f0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bd750 FUN_008bd750 undefined4 FUN_008bd750(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_008ab7d0(); return 1; } //@@ 008bd7b0 FUN_008bd7b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008bd7b0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; int iVar10; int *piVar11; int iVar12; void *pvVar13; undefined4 *puVar14; undefined4 *puVar15; undefined4 local_34 [11]; uint local_8; local_8 = __security_cookie ^ (uint)(local_34 + 0xc); iVar10 = lua_type(param_1,1); if (iVar10 == 0) { iVar10 = 0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,0); iVar10 = *(int *)((int)pvVar13 + 4); } piVar11 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar12 = lua_type(param_1,2); if (iVar12 == 0) { puVar15 = (undefined4 *)0x0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,2,&DAT_00c8298c,1); puVar15 = *(undefined4 **)((int)pvVar13 + 4); } uVar2 = *puVar15; uVar3 = puVar15[1]; uVar4 = puVar15[2]; uVar5 = puVar15[3]; uVar6 = puVar15[4]; uVar7 = puVar15[5]; uVar8 = puVar15[6]; uVar9 = puVar15[7]; puVar14 = (undefined4 *)(*piVar11 + iVar10); uVar1 = puVar15[10]; if (puVar14 != local_34) { *(undefined8 *)(puVar14 + 8) = *(undefined8 *)(puVar15 + 8); *puVar14 = uVar2; puVar14[1] = uVar3; puVar14[2] = uVar4; puVar14[3] = uVar5; puVar14[10] = uVar1; puVar14[4] = uVar6; puVar14[5] = uVar7; puVar14[6] = uVar8; puVar14[7] = uVar9; } return 0; } //@@ 008bd870 FUN_008bd870 undefined4 FUN_008bd870(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { iVar4 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,1); iVar4 = *(int *)((int)pvVar5 + 4); } piVar6 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)(*piVar6 + iVar4); puVar7 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 1; } //@@ 008bd900 FUN_008bd900 undefined4 FUN_008bd900(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; int *piVar5; void *pvVar6; undefined4 *puVar7; undefined4 *puVar8; int local_8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { local_8 = 0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,0); local_8 = *(int *)((int)pvVar6 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar8 = (undefined4 *)0x0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar8 = *(undefined4 **)((int)pvVar6 + 4); } uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; puVar7 = (undefined4 *)(*piVar5 + local_8); *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 0; } //@@ 008bd990 FUN_008bd990 undefined4 FUN_008bd990(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008bd9f0 FUN_008bd9f0 undefined4 FUN_008bd9f0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b0,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bda60 FUN_008bda60 undefined4 FUN_008bda60(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b3,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *(int *)(iVar1 + *piVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a6); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008bdb00 FUN_008bdb00 undefined4 FUN_008bdb00(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b3,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = 0; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyItem,1); *(undefined4 *)(iVar1 + *piVar2) = *(undefined4 *)((int)pvVar4 + 4); return 0; } //@@ 008bdb90 FUN_008bdb90 undefined4 FUN_008bdb90(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b3,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bdbf0 FUN_008bdbf0 undefined4 FUN_008bdbf0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b3,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bdc50 FUN_008bdc50 undefined4 FUN_008bdc50(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b6,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *(int *)(iVar1 + *piVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a6); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008bdcf0 FUN_008bdcf0 undefined4 FUN_008bdcf0(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b6,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = 0; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyItem,1); *(undefined4 *)(iVar1 + *piVar2) = *(undefined4 *)((int)pvVar4 + 4); return 0; } //@@ 008bdd80 FUN_008bdd80 undefined4 FUN_008bdd80(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829b6,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bdde0 FUN_008bdde0 undefined4 FUN_008bdde0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829b6,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bde40 FUN_008bde40 undefined4 FUN_008bde40(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829bf,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bdee0 FUN_008bdee0 undefined4 FUN_008bdee0(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829bf,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bdf80 FUN_008bdf80 undefined4 FUN_008bdf80(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829c2,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bdfe0 FUN_008bdfe0 undefined4 FUN_008bdfe0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829c2,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008be040 FUN_008be040 undefined4 FUN_008be040(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829c2,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008be0a0 FUN_008be0a0 undefined4 FUN_008be0a0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829c2,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008be110 FUN_008be110 undefined4 FUN_008be110(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008be170 FUN_008be170 undefined4 FUN_008be170(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntity,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008be1e0 FUN_008be1e0 undefined4 FUN_008be1e0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008be240 FUN_008be240 undefined4 FUN_008be240(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008be2b0 FUN_008be2b0 undefined4 FUN_008be2b0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008be310 FUN_008be310 undefined4 FUN_008be310(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008be370 FUN_008be370 undefined4 FUN_008be370(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008be410 FUN_008be410 undefined4 FUN_008be410(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008be4b0 FUN_008be4b0 undefined4 FUN_008be4b0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *(int *)(iVar1 + *piVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008be550 FUN_008be550 undefined4 FUN_008be550(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = 0; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); *(undefined4 *)(iVar1 + *piVar2) = *(undefined4 *)((int)pvVar4 + 4); return 0; } //@@ 008be5e0 FUN_008be5e0 undefined4 FUN_008be5e0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008be640 FUN_008be640 undefined4 FUN_008be640(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityTear,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008be6b0 FUN_008be6b0 undefined4 FUN_008be6b0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008be710 FUN_008be710 undefined4 FUN_008be710(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008be780 FUN_008be780 undefined4 FUN_008be780(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { iVar4 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); iVar4 = *(int *)((int)pvVar5 + 4); } piVar6 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)(*piVar6 + iVar4); puVar7 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 1; } //@@ 008be810 FUN_008be810 undefined4 FUN_008be810(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; int *piVar5; void *pvVar6; undefined4 *puVar7; undefined4 *puVar8; int local_8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { local_8 = 0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); local_8 = *(int *)((int)pvVar6 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar8 = (undefined4 *)0x0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar8 = *(undefined4 **)((int)pvVar6 + 4); } uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; puVar7 = (undefined4 *)(*piVar5 + local_8); *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 0; } //@@ 008be8a0 FUN_008be8a0 undefined4 FUN_008be8a0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_008ab7d0(); return 1; } //@@ 008be900 FUN_008be900 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008be900(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; int iVar10; int *piVar11; int iVar12; void *pvVar13; undefined4 *puVar14; undefined4 *puVar15; undefined4 local_34 [11]; uint local_8; local_8 = __security_cookie ^ (uint)(local_34 + 0xc); iVar10 = lua_type(param_1,1); if (iVar10 == 0) { iVar10 = 0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); iVar10 = *(int *)((int)pvVar13 + 4); } piVar11 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar12 = lua_type(param_1,2); if (iVar12 == 0) { puVar15 = (undefined4 *)0x0; } else { pvVar13 = luabridge::Userdata::getClass(param_1,2,&DAT_00c8298c,1); puVar15 = *(undefined4 **)((int)pvVar13 + 4); } uVar2 = *puVar15; uVar3 = puVar15[1]; uVar4 = puVar15[2]; uVar5 = puVar15[3]; uVar6 = puVar15[4]; uVar7 = puVar15[5]; uVar8 = puVar15[6]; uVar9 = puVar15[7]; puVar14 = (undefined4 *)(*piVar11 + iVar10); uVar1 = puVar15[10]; if (puVar14 != local_34) { *(undefined8 *)(puVar14 + 8) = *(undefined8 *)(puVar15 + 8); *puVar14 = uVar2; puVar14[1] = uVar3; puVar14[2] = uVar4; puVar14[3] = uVar5; puVar14[10] = uVar1; puVar14[4] = uVar6; puVar14[5] = uVar7; puVar14[6] = uVar8; puVar14[7] = uVar9; } return 0; } //@@ 008be9c0 FUN_008be9c0 undefined4 FUN_008be9c0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bea20 FUN_008bea20 undefined4 FUN_008bea20(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bea90 FUN_008bea90 undefined4 FUN_008bea90(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a56); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008beb20 FUN_008beb20 undefined4 FUN_008beb20(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a56,1); *(undefined4 *)(iVar1 + *piVar2) = **(undefined4 **)((int)pvVar4 + 4); return 0; } //@@ 008bebc0 FUN_008bebc0 undefined4 FUN_008bebc0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { iVar4 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); iVar4 = *(int *)((int)pvVar5 + 4); } piVar6 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)(*piVar6 + iVar4); puVar7 = (undefined4 *)lua_newuserdata(param_1,0x1c); *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829b3); lua_setmetatable(param_1,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; puVar7[4] = puVar8[4]; return 1; } //@@ 008bec60 FUN_008bec60 undefined4 FUN_008bec60(void *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; int *piVar7; int iVar8; void *pvVar9; undefined4 *puVar10; iVar6 = lua_type(param_1,1); if (iVar6 == 0) { iVar6 = 0; } else { pvVar9 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); iVar6 = *(int *)((int)pvVar9 + 4); } piVar7 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar8 = lua_type(param_1,2); if (iVar8 == 0) { puVar10 = (undefined4 *)0x0; } else { pvVar9 = luabridge::Userdata::getClass(param_1,2,&DAT_00c829b3,1); puVar10 = *(undefined4 **)((int)pvVar9 + 4); } uVar3 = puVar10[1]; uVar4 = puVar10[2]; uVar5 = puVar10[3]; uVar2 = puVar10[4]; iVar8 = *piVar7; puVar1 = (undefined4 *)(iVar8 + iVar6); *puVar1 = *puVar10; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; *(undefined4 *)(iVar8 + 0x10 + iVar6) = uVar2; return 0; } //@@ 008becf0 FUN_008becf0 undefined4 FUN_008becf0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bed50 FUN_008bed50 undefined4 FUN_008bed50(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityPlayer,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bedb0 FUN_008bedb0 undefined4 FUN_008bedb0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008bee10 FUN_008bee10 undefined4 FUN_008bee10(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829cb,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bee70 FUN_008bee70 undefined4 FUN_008bee70(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008beed0 FUN_008beed0 undefined4 FUN_008beed0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bef40 FUN_008bef40 undefined4 FUN_008bef40(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008befa0 FUN_008befa0 undefined4 FUN_008befa0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bf000 FUN_008bf000 undefined4 FUN_008bf000(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bf060 FUN_008bf060 undefined4 FUN_008bf060(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bf0d0 FUN_008bf0d0 undefined4 FUN_008bf0d0(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bf170 FUN_008bf170 undefined4 FUN_008bf170(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ce,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bf210 FUN_008bf210 undefined4 FUN_008bf210(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bf270 FUN_008bf270 undefined4 FUN_008bf270(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bf2d0 FUN_008bf2d0 undefined4 FUN_008bf2d0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008bf330 FUN_008bf330 undefined4 FUN_008bf330(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bf3a0 FUN_008bf3a0 undefined4 FUN_008bf3a0(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bf440 FUN_008bf440 undefined4 FUN_008bf440(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bf4e0 FUN_008bf4e0 undefined4 FUN_008bf4e0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bf540 FUN_008bf540 undefined4 FUN_008bf540(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityFamiliar,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bf5b0 FUN_008bf5b0 undefined4 FUN_008bf5b0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bf610 FUN_008bf610 undefined4 FUN_008bf610(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bf670 FUN_008bf670 undefined4 FUN_008bf670(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0x758); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8299e); lua_setmetatable(param_1,0xfffffffe); FUN_008c4b30(iVar1 + iVar2); return 1; } //@@ 008bf700 luabridge::CFunc::setProperty /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: lua __propset closure pushed by luabridge::Namespace::Class::addData_Pathfinder (push 0x8bf700 at 0x887a69, upvalue member offset 0x414, name 'Pathfinder'); getClass self, copies the 0x700-byte value */ undefined4 luabridge::CFunc::setProperty(void *param_1) { void **this; undefined4 *puVar1; int iVar2; int *copyTag; int iVar3; void *pvVar4; undefined4 uVar5; uint uVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 local_764; undefined4 local_760; undefined4 local_75c; undefined4 local_758; undefined4 local_754; undefined4 local_750; undefined4 local_74c; undefined4 local_748; undefined4 local_744; undefined4 local_740; undefined4 local_73c; undefined4 auStack_738 [448]; undefined1 local_38; undefined1 local_37; undefined4 local_34; undefined4 local_30; undefined1 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; void *local_1c [2]; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b05670; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_1c + 6); ExceptionList = &local_10; iVar2 = lua_type(param_1,1,local_14); if (iVar2 == 0) { iVar2 = 0; } else { pvVar4 = Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); iVar2 = *(int *)((int)pvVar4 + 4); } copyTag = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { uVar5 = 0; } else { pvVar4 = Userdata::getClass(param_1,2,&DAT_00c8299e,1); uVar5 = *(undefined4 *)((int)pvVar4 + 4); } FUN_008c4b30(uVar5); local_8 = (void *)0x0; puVar8 = (undefined4 *)(*copyTag + iVar2); uVar6 = 0; *puVar8 = local_764; puVar8[1] = local_760; puVar8[2] = local_75c; puVar8[3] = local_758; puVar8[4] = local_754; puVar8[5] = local_750; puVar8[6] = local_74c; puVar8[7] = local_748; puVar8[8] = local_744; puVar8[9] = local_740; puVar8[10] = local_73c; puVar7 = puVar8 + 0xb; do { puVar1 = auStack_738 + uVar6; uVar6 = uVar6 + 1; *puVar7 = *puVar1; puVar7 = puVar7 + 1; } while (uVar6 < 0x1c0); this = (void **)(puVar8 + 0x1d2); *(undefined1 *)(puVar8 + 0x1cb) = local_38; *(undefined1 *)((int)puVar8 + 0x72d) = local_37; puVar8[0x1cc] = local_34; puVar8[0x1cd] = local_30; *(undefined1 *)(puVar8 + 0x1ce) = local_2c; puVar8[0x1cf] = local_28; puVar8[0x1d0] = local_24; puVar8[0x1d1] = local_20; if (this != local_1c) { pvVar4 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)((int)pvVar4 + 4)); *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; puVar8[0x1d3] = 0; std_set_uint_copy(this,local_1c,(int)copyTag); } FID_conflict__Erase_tree_>_> (local_1c,(fuzzer_allocator_> *)local_1c, *(_Tree_node **)((int)local_1c[0] + 4)); operator_delete(local_1c[0],0x14); ExceptionList = local_10; return 0; } //@@ 008bf920 FUN_008bf920 undefined4 FUN_008bf920(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008bf980 FUN_008bf980 undefined4 FUN_008bf980(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bfa20 FUN_008bfa20 undefined4 FUN_008bfa20(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityNpc,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bfac0 FUN_008bfac0 undefined4 FUN_008bfac0(void *param_1) { int iVar1; undefined4 uVar2; int iVar3; void *pvVar4; int *piVar5; undefined4 *puVar6; iVar3 = lua_type(param_1,1); if (iVar3 == 0) { iVar3 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar3 = *(int *)((int)pvVar4 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar5; puVar6 = (undefined4 *)lua_newuserdata(param_1,0x10); *puVar6 = luabridge::UserdataValue::vftable; puVar6[1] = puVar6 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); puVar6 = (undefined4 *)puVar6[1]; uVar2 = *(undefined4 *)(iVar1 + iVar3); puVar6[1] = ((undefined4 *)(iVar1 + iVar3))[1]; *puVar6 = uVar2; return 1; } //@@ 008bfb60 FUN_008bfb60 undefined4 FUN_008bfb60(void *param_1) { undefined4 uVar1; int iVar2; int *piVar3; int iVar4; void *pvVar5; undefined4 *puVar6; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar2 = *(int *)((int)pvVar5 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar6 = (undefined4 *)0x0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyVector,1); puVar6 = *(undefined4 **)((int)pvVar5 + 4); } uVar1 = puVar6[1]; iVar4 = *piVar3; *(undefined4 *)(iVar4 + iVar2) = *puVar6; *(undefined4 *)(iVar4 + 4 + iVar2) = uVar1; return 0; } //@@ 008bfc00 FUN_008bfc00 undefined4 FUN_008bfc00(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008bfc60 FUN_008bfc60 undefined4 FUN_008bfc60(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008bfcd0 FUN_008bfcd0 undefined4 FUN_008bfcd0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { iVar4 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar4 = *(int *)((int)pvVar5 + 4); } piVar6 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)(*piVar6 + iVar4); puVar7 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyBitSet128); lua_setmetatable(param_1,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 1; } //@@ 008bfd60 FUN_008bfd60 undefined4 FUN_008bfd60(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; int *piVar5; void *pvVar6; undefined4 *puVar7; undefined4 *puVar8; int local_8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { local_8 = 0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); local_8 = *(int *)((int)pvVar6 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar8 = (undefined4 *)0x0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyBitSet128,1); puVar8 = *(undefined4 **)((int)pvVar6 + 4); } uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; puVar7 = (undefined4 *)(*piVar5 + local_8); *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 0; } //@@ 008bfdf0 FUN_008bfdf0 undefined4 FUN_008bfdf0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008bfe50 FUN_008bfe50 undefined4 FUN_008bfe50(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008bfeb0 FUN_008bfeb0 undefined4 FUN_008bfeb0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008bff10 FUN_008bff10 undefined4 FUN_008bff10(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008bff80 FUN_008bff80 undefined4 FUN_008bff80(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a58); lua_setmetatable(param_1,0xfffffffe); *(undefined1 *)puVar5[1] = *(undefined1 *)(iVar1 + iVar2); return 1; } //@@ 008c0010 FUN_008c0010 undefined4 FUN_008c0010(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined1 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a58,1); *(undefined1 *)(iVar1 + *piVar2) = **(undefined1 **)((int)pvVar4 + 4); return 0; } //@@ 008c00b0 FUN_008c00b0 undefined4 FUN_008c00b0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0x5c); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a55); lua_setmetatable(param_1,0xfffffffe); FUN_0085ded0(iVar1 + iVar2); return 1; } //@@ 008c0140 FUN_008c0140 undefined4 FUN_008c0140(void *param_1) { int iVar1; int iVar2; void *pvVar3; undefined4 uVar4; HomingLaser local_68; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b056ad; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = lua_type(param_1,1,__security_cookie ^ (int)register0x00000010 - 4U); if (iVar1 == 0) { iVar1 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar3 + 4); } local_14 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); if (iVar2 == 0) { uVar4 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a55,1); uVar4 = *(undefined4 *)((int)pvVar3 + 4); } FUN_0085ded0(uVar4); local_8 = 0; HomingLaser::operator_assign((HomingLaser *)(*local_14 + iVar1),&local_68); FID_conflict__Tidy(&local_68._bezier); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); ExceptionList = local_10; return 0; } //@@ 008c0230 FUN_008c0230 undefined4 FUN_008c0230(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008c0290 FUN_008c0290 undefined4 FUN_008c0290(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a54); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008c0320 FUN_008c0320 undefined4 FUN_008c0320(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a54,1); *(undefined4 *)(iVar1 + *piVar2) = **(undefined4 **)((int)pvVar4 + 4); return 0; } //@@ 008c03c0 FUN_008c03c0 undefined4 FUN_008c03c0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *(int *)(iVar1 + *piVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyEntity); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c0460 FUN_008c0460 undefined4 FUN_008c0460(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyEntityLaser,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = 0; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeyEntity,0); *(undefined4 *)(iVar1 + *piVar2) = *(undefined4 *)((int)pvVar4 + 4); return 0; } //@@ 008c04f0 FUN_008c04f0 undefined4 FUN_008c04f0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008c0550 FUN_008c0550 undefined4 FUN_008c0550(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e0,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008c05c0 FUN_008c05c0 undefined4 FUN_008c05c0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e3,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c0620 FUN_008c0620 undefined4 FUN_008c0620(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e3,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c0680 FUN_008c0680 undefined4 FUN_008c0680(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e3,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008c06e0 FUN_008c06e0 undefined4 FUN_008c06e0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e3,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008c0740 FUN_008c0740 undefined4 FUN_008c0740(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e3,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008c07b0 FUN_008c07b0 undefined4 FUN_008c07b0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { iVar4 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); iVar4 = *(int *)((int)pvVar5 + 4); } piVar6 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)(*piVar6 + iVar4); puVar7 = (undefined4 *)lua_newuserdata(param_1,0x28); *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829e3); lua_setmetatable(param_1,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; uVar1 = puVar8[5]; uVar2 = puVar8[6]; uVar3 = puVar8[7]; puVar7[4] = puVar8[4]; puVar7[5] = uVar1; puVar7[6] = uVar2; puVar7[7] = uVar3; return 1; } //@@ 008c0850 FUN_008c0850 undefined4 FUN_008c0850(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; int iVar8; int *piVar9; void *pvVar10; undefined4 *puVar11; undefined4 *puVar12; int local_8; iVar8 = lua_type(param_1,1); if (iVar8 == 0) { local_8 = 0; } else { pvVar10 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); local_8 = *(int *)((int)pvVar10 + 4); } piVar9 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar8 = lua_type(param_1,2); if (iVar8 == 0) { puVar12 = (undefined4 *)0x0; } else { pvVar10 = luabridge::Userdata::getClass(param_1,2,&DAT_00c829e3,1); puVar12 = *(undefined4 **)((int)pvVar10 + 4); } uVar1 = puVar12[1]; uVar2 = puVar12[2]; uVar3 = puVar12[3]; uVar4 = puVar12[4]; uVar5 = puVar12[5]; uVar6 = puVar12[6]; uVar7 = puVar12[7]; puVar11 = (undefined4 *)(*piVar9 + local_8); *puVar11 = *puVar12; puVar11[1] = uVar1; puVar11[2] = uVar2; puVar11[3] = uVar3; puVar11[4] = uVar4; puVar11[5] = uVar5; puVar11[6] = uVar6; puVar11[7] = uVar7; return 0; } //@@ 008c08f0 FUN_008c08f0 undefined4 FUN_008c08f0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c0950 FUN_008c0950 undefined4 FUN_008c0950(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntity,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c09b0 FUN_008c09b0 undefined4 FUN_008c09b0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c0a10 FUN_008c0a10 undefined4 FUN_008c0a10(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c0a70 FUN_008c0a70 undefined4 FUN_008c0a70(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0x11c); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeySprite); lua_setmetatable(param_1,0xfffffffe); ANM2::ANM2((ANM2 *)puVar5[1],(ANM2 *)(iVar1 + iVar2)); return 1; } //@@ 008c0b00 FUN_008c0b00 undefined4 FUN_008c0b00(void *param_1) { int iVar1; int iVar2; void *pvVar3; ANM2 *other; ANM2 *this; ANM2 local_12c; int *local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00affb50; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = lua_type(param_1,1,__security_cookie ^ (uint)&(&local_12c)[1]._filename._capacity); if (iVar1 == 0) { iVar1 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); iVar1 = *(int *)((int)pvVar3 + 4); } local_14 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); other = (ANM2 *)0x0; if (iVar2 != 0) { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeySprite,1); other = *(ANM2 **)((int)pvVar3 + 4); } ANM2::ANM2(&local_12c,other); Isaac::SwapANM2((ANM2 *)(*local_14 + iVar1),&local_12c); local_8 = 0; ANM2::Reset(this); AnimationState::~AnimationState(&local_12c._overlayAnimState); AnimationState::~AnimationState(&local_12c._animState); std::string::_Tidy_deallocate(local_12c._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_12c); ExceptionList = local_10; return 0; } //@@ 008c0c10 FUN_008c0c10 undefined4 FUN_008c0c10(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008c0c70 FUN_008c0c70 undefined4 FUN_008c0c70(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008c0ce0 FUN_008c0ce0 undefined4 FUN_008c0ce0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a53); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008c0d70 FUN_008c0d70 undefined4 FUN_008c0d70(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a53,1); *(undefined4 *)(iVar1 + *piVar2) = **(undefined4 **)((int)pvVar4 + 4); return 0; } //@@ 008c0e10 FUN_008c0e10 undefined4 FUN_008c0e10(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a52); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008c0ea0 FUN_008c0ea0 undefined4 FUN_008c0ea0(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a52,1); *(undefined4 *)(iVar1 + *piVar2) = **(undefined4 **)((int)pvVar4 + 4); return 0; } //@@ 008c0f40 FUN_008c0f40 undefined4 FUN_008c0f40(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008c0fb0 FUN_008c0fb0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008c0fb0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGridEntityDoor,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008c10c0 FUN_008c10c0 undefined4 FUN_008c10c0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c1120 FUN_008c1120 undefined4 FUN_008c1120(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c1180 FUN_008c1180 undefined4 FUN_008c1180(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008c11f0 FUN_008c11f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008c11f0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008c1300 FUN_008c1300 undefined4 FUN_008c1300(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008c1360 FUN_008c1360 undefined4 FUN_008c1360(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829e9,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008c13d0 FUN_008c13d0 undefined4 FUN_008c13d0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ec,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushboolean(param_1,*(char *)(iVar1 + *piVar3) != '\0'); return 1; } //@@ 008c1430 FUN_008c1430 undefined4 FUN_008c1430(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ec,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_toboolean(param_1,2); *(bool *)(iVar1 + *piVar3) = iVar4 != 0; return 0; } //@@ 008c14a0 FUN_008c14a0 undefined4 FUN_008c14a0(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008c1510 FUN_008c1510 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_008c1510(void *param_1) { int iVar1; void *pvVar2; int *piVar3; byte *text; uint size; void **this; uint local_24; void *local_20; void *pvStack_1c; void *pvStack_18; void *pvStack_14; undefined4 local_10; uint uStack_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); text = (byte *)luaL_checklstring(param_1,2,&local_24); local_20 = (void *)0x0; local_10 = 0; uStack_c = 0xf; std::string::assign((char *)&local_20,text,local_24); this = (void **)(*piVar3 + iVar1); if (this != &local_20) { std::string::_Tidy_deallocate((char *)this); *this = local_20; this[1] = pvStack_1c; this[2] = pvStack_18; this[3] = pvStack_14; *(ulonglong *)(this + 4) = CONCAT44(uStack_c,local_10); return 0; } if (0xf < uStack_c) { size = uStack_c + 1; pvVar2 = local_20; if (0xfff < size) { pvVar2 = *(void **)((int)local_20 + -4); size = uStack_c + 0x24; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } return 0; } //@@ 008c1620 FUN_008c1620 undefined4 FUN_008c1620(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c1680 FUN_008c1680 undefined4 FUN_008c1680(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829ef,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c16e0 FUN_008c16e0 undefined4 FUN_008c16e0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829f2,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c1740 FUN_008c1740 undefined4 FUN_008c1740(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f2,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c17a0 FUN_008c17a0 undefined4 FUN_008c17a0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0x11c); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeySprite); lua_setmetatable(param_1,0xfffffffe); ANM2::ANM2((ANM2 *)puVar5[1],(ANM2 *)(iVar1 + iVar2)); return 1; } //@@ 008c1830 FUN_008c1830 undefined4 FUN_008c1830(void *param_1) { int iVar1; int iVar2; void *pvVar3; ANM2 *other; ANM2 *this; ANM2 local_12c; int *local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00affb50; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = lua_type(param_1,1,__security_cookie ^ (uint)&(&local_12c)[1]._filename._capacity); if (iVar1 == 0) { iVar1 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,0); iVar1 = *(int *)((int)pvVar3 + 4); } local_14 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar2 = lua_type(param_1,2); other = (ANM2 *)0x0; if (iVar2 != 0) { pvVar3 = luabridge::Userdata::getClass(param_1,2,&g_luaClassKeySprite,1); other = *(ANM2 **)((int)pvVar3 + 4); } ANM2::ANM2(&local_12c,other); Isaac::SwapANM2((ANM2 *)(*local_14 + iVar1),&local_12c); local_8 = 0; ANM2::Reset(this); AnimationState::~AnimationState(&local_12c._overlayAnimState); AnimationState::~AnimationState(&local_12c._animState); std::string::_Tidy_deallocate(local_12c._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_12c); ExceptionList = local_10; return 0; } //@@ 008c1940 FUN_008c1940 undefined4 FUN_008c1940(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); if (*(int *)(iVar1 + *piVar3) == 0) { lua_pushnil(param_1); return 1; } lua_pushstring(param_1,*(int *)(iVar1 + *piVar3)); return 1; } //@@ 008c19c0 FUN_008c19c0 undefined4 FUN_008c19c0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; int iVar4; undefined4 uVar5; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { *(undefined4 *)(iVar1 + *piVar3) = 0; return 0; } uVar5 = luaL_checklstring(param_1,2,0); *(undefined4 *)(iVar1 + *piVar3) = uVar5; return 0; } //@@ 008c1a50 FUN_008c1a50 undefined4 FUN_008c1a50(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; void *pvVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { iVar4 = 0; } else { pvVar5 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,1); iVar4 = *(int *)((int)pvVar5 + 4); } piVar6 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar8 = (undefined4 *)(*piVar6 + iVar4); puVar7 = (undefined4 *)lua_newuserdata(param_1,0x18); *puVar7 = luabridge::UserdataValue::vftable; puVar7[1] = puVar7 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82995); lua_setmetatable(param_1,0xfffffffe); puVar7 = (undefined4 *)puVar7[1]; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 1; } //@@ 008c1ae0 FUN_008c1ae0 undefined4 FUN_008c1ae0(void *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; int *piVar5; void *pvVar6; undefined4 *puVar7; undefined4 *puVar8; int local_8; iVar4 = lua_type(param_1,1); if (iVar4 == 0) { local_8 = 0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f5,0); local_8 = *(int *)((int)pvVar6 + 4); } piVar5 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar4 = lua_type(param_1,2); if (iVar4 == 0) { puVar8 = (undefined4 *)0x0; } else { pvVar6 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82995,1); puVar8 = *(undefined4 **)((int)pvVar6 + 4); } uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; puVar7 = (undefined4 *)(*piVar5 + local_8); *puVar7 = *puVar8; puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; return 0; } //@@ 008c1b70 FUN_008c1b70 undefined4 FUN_008c1b70(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829f8,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c1bd0 FUN_008c1bd0 undefined4 FUN_008c1bd0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829f8,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c1c30 FUN_008c1c30 undefined4 FUN_008c1c30(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829fb,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c1c90 FUN_008c1c90 undefined4 FUN_008c1c90(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fb,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c1cf0 FUN_008c1cf0 undefined4 FUN_008c1cf0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829fb,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c010(); return 1; } //@@ 008c1d50 FUN_008c1d50 undefined4 FUN_008c1d50(void *param_1) { undefined2 uVar1; int iVar2; void *pvVar3; int *piVar4; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fb,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar1 = luaL_checkinteger(param_1,2); *(undefined2 *)(iVar2 + *piVar4) = uVar1; return 0; } //@@ 008c1db0 FUN_008c1db0 undefined4 FUN_008c1db0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829fb,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008c1e10 FUN_008c1e10 undefined4 FUN_008c1e10(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fb,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008c1e80 FUN_008c1e80 undefined4 FUN_008c1e80(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,(int)*(short *)(*piVar3 + iVar1),(int)*(short *)(*piVar3 + iVar1) >> 0x1f) ; return 1; } //@@ 008c1ee0 FUN_008c1ee0 undefined4 FUN_008c1ee0(void *param_1) { undefined2 uVar1; int iVar2; void *pvVar3; int *piVar4; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar1 = luaL_checkinteger(param_1,2); *(undefined2 *)(iVar2 + *piVar4) = uVar1; return 0; } //@@ 008c1f40 FUN_008c1f40 undefined4 FUN_008c1f40(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,*(undefined1 *)(*piVar3 + iVar1),0); return 1; } //@@ 008c1fa0 FUN_008c1fa0 undefined4 FUN_008c1fa0(void *param_1) { undefined1 uVar1; int iVar2; void *pvVar3; int *piVar4; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar1 = luaL_checkinteger(param_1,2); *(undefined1 *)(iVar2 + *piVar4) = uVar1; return 0; } //@@ 008c2000 FUN_008c2000 undefined4 FUN_008c2000(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008c2060 FUN_008c2060 undefined4 FUN_008c2060(void *param_1) { int iVar1; void *pvVar2; int *piVar3; float10 fVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c829fe,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); fVar4 = (float10)luaL_checknumber(param_1,2); *(float *)(iVar1 + *piVar3) = (float)fVar4; return 0; } //@@ 008c20d0 FUN_008c20d0 undefined4 FUN_008c20d0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c2130 FUN_008c2130 undefined4 FUN_008c2130(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008c2190 FUN_008c2190 undefined4 FUN_008c2190(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a51); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008c2220 FUN_008c2220 undefined4 FUN_008c2220(void *param_1) { undefined4 *puVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); puVar5 = (undefined4 *)(*piVar4 + iVar2); puVar1 = puVar5 + 4; if (0xf < (uint)puVar5[5]) { puVar5 = (undefined4 *)*puVar5; } lua_pushlstring(param_1,puVar5,*puVar1); return 1; } //@@ 008c2290 FUN_008c2290 undefined4 FUN_008c2290(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c050(); return 1; } //@@ 008c22f0 FUN_008c22f0 undefined4 FUN_008c22f0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c010(); return 1; } //@@ 008c2350 FUN_008c2350 undefined4 FUN_008c2350(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a01,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,*(undefined1 *)(*piVar3 + iVar1),0); return 1; } //@@ 008c23b0 FUN_008c23b0 undefined4 FUN_008c23b0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c2410 FUN_008c2410 undefined4 FUN_008c2410(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c2470 FUN_008c2470 undefined4 FUN_008c2470(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 *puVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *(int *)(iVar1 + *piVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar4 = (undefined4 *)lua_newuserdata(param_1,8); *puVar4 = luabridge::UserdataPtr::vftable; puVar4[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a00); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c2510 FUN_008c2510 undefined4 FUN_008c2510(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = 0; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a01,1); *(undefined4 *)(iVar1 + *piVar2) = *(undefined4 *)((int)pvVar4 + 4); return 0; } //@@ 008c25a0 FUN_008c25a0 undefined4 FUN_008c25a0(void *param_1) { int iVar1; int iVar2; void *pvVar3; int *piVar4; undefined4 *puVar5; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar1 = *piVar4; puVar5 = (undefined4 *)lua_newuserdata(param_1,0xc); *puVar5 = luabridge::UserdataValue_>::vftable; puVar5[1] = puVar5 + 2; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a50); lua_setmetatable(param_1,0xfffffffe); *(undefined4 *)puVar5[1] = *(undefined4 *)(iVar1 + iVar2); return 1; } //@@ 008c2630 FUN_008c2630 undefined4 FUN_008c2630(void *param_1) { int iVar1; int *piVar2; int iVar3; void *pvVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar4 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,0); iVar1 = *(int *)((int)pvVar4 + 4); } piVar2 = (int *)lua_touserdata(param_1,0xfff0b9d7); iVar3 = lua_type(param_1,2); if (iVar3 == 0) { *(undefined4 *)(iVar1 + *piVar2) = uRam00000000; return 0; } pvVar4 = luabridge::Userdata::getClass(param_1,2,&DAT_00c82a50,1); *(undefined4 *)(iVar1 + *piVar2) = **(undefined4 **)((int)pvVar4 + 4); return 0; } //@@ 008c26d0 FUN_008c26d0 undefined4 FUN_008c26d0(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bff0(); return 1; } //@@ 008c2730 FUN_008c2730 undefined4 FUN_008c2730(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085c010(); return 1; } //@@ 008c2790 FUN_008c2790 undefined4 FUN_008c2790(void *param_1) { undefined2 uVar1; int iVar2; void *pvVar3; int *piVar4; iVar2 = lua_type(param_1,1); if (iVar2 == 0) { iVar2 = 0; } else { pvVar3 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,0); iVar2 = *(int *)((int)pvVar3 + 4); } piVar4 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar1 = luaL_checkinteger(param_1,2); *(undefined2 *)(iVar2 + *piVar4) = uVar1; return 0; } //@@ 008c27f0 FUN_008c27f0 undefined4 FUN_008c27f0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&DAT_00c82a04,1); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); lua_pushinteger(param_1,(int)*(short *)(*piVar3 + iVar1),(int)*(short *)(*piVar3 + iVar1) >> 0x1f) ; return 1; } //@@ 008c2850 FUN_008c2850 undefined4 FUN_008c2850(void *param_1) { int iVar1; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,1); } lua_touserdata(param_1,0xfff0b9d7); FUN_0085bfd0(); return 1; } //@@ 008c28b0 FUN_008c28b0 undefined4 FUN_008c28b0(void *param_1) { int iVar1; void *pvVar2; int *piVar3; undefined4 uVar4; iVar1 = lua_type(param_1,1); if (iVar1 == 0) { iVar1 = 0; } else { pvVar2 = luabridge::Userdata::getClass(param_1,1,&g_luaClassKeyGame,0); iVar1 = *(int *)((int)pvVar2 + 4); } piVar3 = (int *)lua_touserdata(param_1,0xfff0b9d7); uVar4 = luaL_checkinteger(param_1,2); *(undefined4 *)(iVar1 + *piVar3) = uVar4; return 0; } //@@ 008c2910 FUN_008c2910 void FUN_008c2910(int param_1,undefined4 *param_2) { undefined8 *puVar1; uint uVar2; uint count; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; void *ptr; uint uVar6; undefined4 *puVar7; undefined4 *in_ECX; uint uVar8; undefined4 *puVar9; uVar2 = ((int)param_2 - param_1) / 0x18; ptr = (void *)*in_ECX; uVar6 = (in_ECX[1] - (int)ptr) / 0x18; if (uVar6 < uVar2) { count = (in_ECX[2] - (int)ptr) / 0x18; if (count < uVar2) { if (0xaaaaaaa < uVar2) { /* WARNING: Subroutine does not return */ std::_Xlen(); } if (0xaaaaaaa - (count >> 1) < count) { uVar8 = 0xaaaaaaa; } else { uVar8 = (count >> 1) + count; if (uVar8 < uVar2) { uVar8 = uVar2; } } if (ptr != (void *)0x0) { deallocate(ptr,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0xaaaaaaa < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } ptr = std::_Allocate(uVar8 * 0x18); uVar6 = 0; *in_ECX = ptr; in_ECX[1] = ptr; in_ECX[2] = (void *)(uVar8 * 0x18 + (int)ptr); } puVar9 = (undefined4 *)(param_1 + uVar6 * 0x18); FUN_008c5b30(ptr); puVar7 = (undefined4 *)in_ECX[1]; if (puVar9 != param_2) { do { uVar3 = puVar9[1]; uVar4 = puVar9[2]; uVar5 = puVar9[3]; *puVar7 = *puVar9; puVar7[1] = uVar3; puVar7[2] = uVar4; puVar7[3] = uVar5; puVar1 = (undefined8 *)(puVar9 + 4); puVar9 = puVar9 + 6; *(undefined8 *)(puVar7 + 4) = *puVar1; puVar7 = puVar7 + 6; } while (puVar9 != param_2); in_ECX[1] = puVar7; return; } } else { FUN_008c5b30(ptr); puVar7 = (undefined4 *)((int)ptr + uVar2 * 0x18); } in_ECX[1] = puVar7; return; } //@@ 008c2a70 std::vector::assign /* DB: assign(first,last) of 8-byte elements (max 0x1fffffff): overwrite in place, else deallocate+_Allocate x1.5 and copy; HomingLaser::operator_assign/CalculateSamples/remove_collinear_samples */ void std::vector::assign(undefined4 *param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 *ptr; undefined4 *in_ECX; int iVar3; uint uVar4; undefined4 *puVar5; undefined4 *puVar6; uint count; uint local_8; puVar5 = (undefined4 *)in_ECX[1]; ptr = (undefined4 *)*in_ECX; local_8 = (int)puVar5 - (int)ptr >> 3; uVar2 = (int)param_2 - (int)param_1 >> 3; if (uVar2 <= local_8) { puVar5 = ptr; for (; param_1 != param_2; param_1 = param_1 + 2) { *puVar5 = *param_1; puVar5[1] = param_1[1]; puVar5 = puVar5 + 2; } in_ECX[1] = ptr + uVar2 * 2; return; } count = in_ECX[2] - (int)ptr >> 3; if (count < uVar2) { if (0x1fffffff < uVar2) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x1fffffff - (count >> 1) < count) { uVar4 = 0x1fffffff; } else { uVar4 = (count >> 1) + count; if (uVar4 < uVar2) { uVar4 = uVar2; } } if (ptr != (undefined4 *)0x0) { deallocate(ptr,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x1fffffff < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } ptr = _Allocate(uVar4 * 8); local_8 = 0; *in_ECX = ptr; in_ECX[1] = ptr; in_ECX[2] = ptr + uVar4 * 2; puVar5 = ptr; } puVar6 = param_1 + local_8 * 2; if (param_1 != puVar6) { iVar3 = (int)ptr - (int)param_1; do { *(undefined4 *)(iVar3 + (int)param_1) = *param_1; *(undefined4 *)(iVar3 + 4 + (int)param_1) = param_1[1]; param_1 = param_1 + 2; } while (param_1 != puVar6); puVar5 = (undefined4 *)in_ECX[1]; } for (; puVar6 != param_2; puVar6 = puVar6 + 2) { uVar1 = puVar6[1]; *puVar5 = *puVar6; puVar5[1] = uVar1; puVar5 = puVar5 + 2; } in_ECX[1] = puVar5; return; } //@@ 008c2bd0 FUN_008c2bd0 undefined4 FUN_008c2bd0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a19); (**(code **)*puVar1)(0); return 0; } //@@ 008c2bf0 FUN_008c2bf0 undefined4 FUN_008c2bf0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a16); (**(code **)*puVar1)(0); return 0; } //@@ 008c2c10 FUN_008c2c10 undefined4 FUN_008c2c10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyGame); (**(code **)*puVar1)(0); return 0; } //@@ 008c2c30 FUN_008c2c30 undefined4 FUN_008c2c30(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82978); (**(code **)*puVar1)(0); return 0; } //@@ 008c2c50 FUN_008c2c50 undefined4 FUN_008c2c50(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a10); (**(code **)*puVar1)(0); return 0; } //@@ 008c2c70 FUN_008c2c70 undefined4 FUN_008c2c70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a0d); (**(code **)*puVar1)(0); return 0; } //@@ 008c2c90 FUN_008c2c90 undefined4 FUN_008c2c90(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyLevel); (**(code **)*puVar1)(0); return 0; } //@@ 008c2cb0 FUN_008c2cb0 undefined4 FUN_008c2cb0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyRoom); (**(code **)*puVar1)(0); return 0; } //@@ 008c2cd0 FUN_008c2cd0 undefined4 FUN_008c2cd0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a04); (**(code **)*puVar1)(0); return 0; } //@@ 008c2cf0 FUN_008c2cf0 undefined4 FUN_008c2cf0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a01); (**(code **)*puVar1)(0); return 0; } //@@ 008c2d10 FUN_008c2d10 undefined4 FUN_008c2d10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829fe); (**(code **)*puVar1)(0); return 0; } //@@ 008c2d30 FUN_008c2d30 undefined4 FUN_008c2d30(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829fb); (**(code **)*puVar1)(0); return 0; } //@@ 008c2d50 FUN_008c2d50 undefined4 FUN_008c2d50(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829f8); (**(code **)*puVar1)(0); return 0; } //@@ 008c2d70 FUN_008c2d70 undefined4 FUN_008c2d70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829f5); (**(code **)*puVar1)(0); return 0; } //@@ 008c2d90 FUN_008c2d90 undefined4 FUN_008c2d90(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829f2); (**(code **)*puVar1)(0); return 0; } //@@ 008c2db0 FUN_008c2db0 undefined4 FUN_008c2db0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829ef); (**(code **)*puVar1)(0); return 0; } //@@ 008c2dd0 FUN_008c2dd0 undefined4 FUN_008c2dd0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829ec); (**(code **)*puVar1)(0); return 0; } //@@ 008c2df0 FUN_008c2df0 undefined4 FUN_008c2df0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829e9); (**(code **)*puVar1)(0); return 0; } //@@ 008c2e10 FUN_008c2e10 undefined4 FUN_008c2e10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyGridEntityDoor); (**(code **)*puVar1)(0); return 0; } //@@ 008c2e30 FUN_008c2e30 undefined4 FUN_008c2e30(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyGridEntity); (**(code **)*puVar1)(0); return 0; } //@@ 008c2e50 FUN_008c2e50 undefined4 FUN_008c2e50(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829e3); (**(code **)*puVar1)(0); return 0; } //@@ 008c2e70 FUN_008c2e70 undefined4 FUN_008c2e70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829e0); (**(code **)*puVar1)(0); return 0; } //@@ 008c2e90 FUN_008c2e90 undefined4 FUN_008c2e90(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyEntityLaser); (**(code **)*puVar1)(0); return 0; } //@@ 008c2eb0 FUN_008c2eb0 undefined4 FUN_008c2eb0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829da); (**(code **)*puVar1)(0); return 0; } //@@ 008c2ed0 FUN_008c2ed0 undefined4 FUN_008c2ed0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyEntityNpc); (**(code **)*puVar1)(0); return 0; } //@@ 008c2ef0 FUN_008c2ef0 undefined4 FUN_008c2ef0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829d4); (**(code **)*puVar1)(0); return 0; } //@@ 008c2f10 FUN_008c2f10 undefined4 FUN_008c2f10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyEntityFamiliar); (**(code **)*puVar1)(0); return 0; } //@@ 008c2f30 FUN_008c2f30 undefined4 FUN_008c2f30(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829ce); (**(code **)*puVar1)(0); return 0; } //@@ 008c2f50 FUN_008c2f50 undefined4 FUN_008c2f50(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829cb); (**(code **)*puVar1)(0); return 0; } //@@ 008c2f70 FUN_008c2f70 undefined4 FUN_008c2f70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyEntityPlayer); (**(code **)*puVar1)(0); return 0; } //@@ 008c2f90 FUN_008c2f90 undefined4 FUN_008c2f90(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyEntityTear); (**(code **)*puVar1)(0); return 0; } //@@ 008c2fb0 FUN_008c2fb0 undefined4 FUN_008c2fb0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyEntity); (**(code **)*puVar1)(0); return 0; } //@@ 008c2fd0 FUN_008c2fd0 undefined4 FUN_008c2fd0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829c2); (**(code **)*puVar1)(0); return 0; } //@@ 008c2ff0 FUN_008c2ff0 undefined4 FUN_008c2ff0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829bf); (**(code **)*puVar1)(0); return 0; } //@@ 008c3010 FUN_008c3010 undefined4 FUN_008c3010(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829bc); (**(code **)*puVar1)(0); return 0; } //@@ 008c3030 FUN_008c3030 undefined4 FUN_008c3030(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829b9); (**(code **)*puVar1)(0); return 0; } //@@ 008c3050 FUN_008c3050 undefined4 FUN_008c3050(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829b6); (**(code **)*puVar1)(0); return 0; } //@@ 008c3070 FUN_008c3070 undefined4 FUN_008c3070(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829b3); (**(code **)*puVar1)(0); return 0; } //@@ 008c3090 FUN_008c3090 undefined4 FUN_008c3090(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829b0); (**(code **)*puVar1)(0); return 0; } //@@ 008c30b0 FUN_008c30b0 undefined4 FUN_008c30b0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829ad); (**(code **)*puVar1)(0); return 0; } //@@ 008c30d0 FUN_008c30d0 undefined4 FUN_008c30d0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829aa); (**(code **)*puVar1)(0); return 0; } //@@ 008c30f0 FUN_008c30f0 undefined4 FUN_008c30f0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyItem); (**(code **)*puVar1)(0); return 0; } //@@ 008c3110 FUN_008c3110 undefined4 FUN_008c3110(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829a4); (**(code **)*puVar1)(0); return 0; } //@@ 008c3130 FUN_008c3130 undefined4 FUN_008c3130(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c829a1); (**(code **)*puVar1)(0); return 0; } //@@ 008c3150 FUN_008c3150 undefined4 FUN_008c3150(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c8299e); (**(code **)*puVar1)(0); return 0; } //@@ 008c3170 FUN_008c3170 undefined4 FUN_008c3170(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyBitSet128); (**(code **)*puVar1)(0); return 0; } //@@ 008c3190 FUN_008c3190 undefined4 FUN_008c3190(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82998); (**(code **)*puVar1)(0); return 0; } //@@ 008c31b0 FUN_008c31b0 undefined4 FUN_008c31b0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82995); (**(code **)*puVar1)(0); return 0; } //@@ 008c31d0 FUN_008c31d0 undefined4 FUN_008c31d0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82992); (**(code **)*puVar1)(0); return 0; } //@@ 008c31f0 FUN_008c31f0 undefined4 FUN_008c31f0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeySprite); (**(code **)*puVar1)(0); return 0; } //@@ 008c3210 FUN_008c3210 undefined4 FUN_008c3210(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c8298c); (**(code **)*puVar1)(0); return 0; } //@@ 008c3230 FUN_008c3230 undefined4 FUN_008c3230(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82989); (**(code **)*puVar1)(0); return 0; } //@@ 008c3250 FUN_008c3250 undefined4 FUN_008c3250(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82986); (**(code **)*puVar1)(0); return 0; } //@@ 008c3270 FUN_008c3270 undefined4 FUN_008c3270(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82983); (**(code **)*puVar1)(0); return 0; } //@@ 008c3290 FUN_008c3290 undefined4 FUN_008c3290(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&g_luaClassKeyVector); (**(code **)*puVar1)(0); return 0; } //@@ 008c32b0 FUN_008c32b0 undefined4 FUN_008c32b0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c8297d); (**(code **)*puVar1)(0); return 0; } //@@ 008c32d0 FUN_008c32d0 undefined4 FUN_008c32d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a30,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3330 FUN_008c3330 undefined4 FUN_008c3330(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a3c,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3390 FUN_008c3390 undefined4 FUN_008c3390(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a33,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c33f0 FUN_008c33f0 undefined4 FUN_008c33f0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a36,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3450 FUN_008c3450 undefined4 FUN_008c3450(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a45,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c34b0 FUN_008c34b0 undefined4 FUN_008c34b0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a47,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3510 FUN_008c3510 undefined4 FUN_008c3510(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a2d,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3570 FUN_008c3570 undefined4 FUN_008c3570(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a3f,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c35d0 FUN_008c35d0 undefined4 FUN_008c35d0(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a43,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3630 FUN_008c3630 undefined4 FUN_008c3630(void *param_1) { int iVar1; undefined4 *puVar2; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a41,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); (*(code *)*puVar2)(); FUN_0085bff0(); return 1; } //@@ 008c3690 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes): "intValues", __class/__const; caller lua_register_intValues */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"intValues"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"intValues"); lua_pushcclosure(*in_ECX,FUN_008c5b90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"intValues"); lua_pushcclosure(*in_ECX,FUN_008c5b90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("intValues"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a31); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a30); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a2f); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c38a0 luabridge::Namespace::Class>::Class /* DB: luabridge beginClass ctor: lua_register_RoomDescriptor_array opens CppContainer.ArrayProxy then calls it, pushes name "RoomDescriptor", __class/__const; __gc FUN_008c5bb0 */ undefined4 * luabridge::Namespace::Class>::Class (undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"RoomDescriptor"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"RoomDescriptor"); lua_pushcclosure(*in_ECX,FUN_008c5bb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"RoomDescriptor"); lua_pushcclosure(*in_ECX,FUN_008c5bb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("RoomDescriptor"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a3d); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a3c); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a3b); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c3ab0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "RoomConfigSpawns"; from lua_register_RoomConfigSpawns */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"RoomConfigSpawns"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"RoomConfigSpawns"); lua_pushcclosure(*in_ECX,FUN_008c5bd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"RoomConfigSpawns"); lua_pushcclosure(*in_ECX,FUN_008c5bd0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("RoomConfigSpawns"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a34); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a33); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a32); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c3cc0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: name "RoomConfigEntries", __class/__const; only caller lua_register_RoomConfigEntries (0088d970) */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"RoomConfigEntries"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"RoomConfigEntries"); lua_pushcclosure(*in_ECX,FUN_008c5bf0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"RoomConfigEntries"); lua_pushcclosure(*in_ECX,FUN_008c5bf0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("RoomConfigEntries"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a37); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a36); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a35); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c3ed0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for EffectList; called from lua_register_EffectList */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"EffectList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"EffectList"); lua_pushcclosure(*in_ECX,FUN_008c5c10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"EffectList"); lua_pushcclosure(*in_ECX,FUN_008c5c10,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("EffectList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a46); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a45); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a25); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c40e0 luabridge::Namespace::Class::Class /* DB: lua_pushstring "VectorList", createConstTable/createClassTable/createStaticTable; only caller lua_register_VectorList */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"VectorList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"VectorList"); lua_pushcclosure(*in_ECX,FUN_008c5c30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"VectorList"); lua_pushcclosure(*in_ECX,FUN_008c5c30,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("VectorList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a48); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a47); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a27); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c42f0 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor (522 bytes): "CostumeConfigList", __class/__const; caller lua_register_CostumeConfigList */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"CostumeConfigList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"CostumeConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5c50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"CostumeConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5c50,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("CostumeConfigList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a2e); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a2d); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a2c); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c4500 luabridge::Namespace::Class>::Class /* DB: ? luabridge beginClass ctor for "ItemConfigList" called by lua_register_ItemConfigList inside the CppContainer/ArrayProxy namespace (same template as 0x8c38a0); __gc FUN_008c5c70 */ undefined4 * luabridge::Namespace::Class>::Class (undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"ItemConfigList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"ItemConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5c70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"ItemConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5c70,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("ItemConfigList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a40); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a3f); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a22); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c4710 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor for "PillConfigList"; from lua_register_PillConfigList */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"PillConfigList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"PillConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5c90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"PillConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5c90,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("PillConfigList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a44); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a43); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a24); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c4920 luabridge::Namespace::Class::Class /* DB: luabridge beginClass ctor: name "CardConfigList", __class/__const, __gc closure FUN_008c5cb0; only caller lua_register_CardConfigList (0087a010) */ undefined4 * luabridge::Namespace::Class::Class(undefined4 param_1,undefined4 *param_2) { undefined4 uVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0533d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = *param_2; in_ECX[1] = 0; local_8 = 0; in_ECX[1] = param_2[1] + 3; param_2[1] = 0; uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"CardConfigList"); lua_rawget(uVar1,uVar3); iVar4 = lua_type(*in_ECX,0xffffffff); if (iVar4 == 0) { lua_settop(*in_ECX,0xfffffffe); ClassBase::createConstTable(in_ECX,(byte *)"CardConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5cb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); ClassBase::createClassTable(in_ECX,(byte *)"CardConfigList"); lua_pushcclosure(*in_ECX,FUN_008c5cb0,0); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xfffffffe); lua_pushstring(uVar1,s___gc); lua_rotate(uVar1,0xfffffffe,1); lua_rawset(uVar1,uVar3); FUN_0085d500("CardConfigList"); lua_pushvalue(*in_ECX,0xffffffff); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a42); lua_pushvalue(*in_ECX,0xfffffffe); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a41); lua_pushvalue(*in_ECX,0xfffffffd); lua_rawsetp(*in_ECX,0xfff0b9d8,&DAT_00c82a23); } else { uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff,uVar2); lua_pushstring(uVar1,"__class"); lua_rawget(uVar1,uVar3); uVar1 = *in_ECX; uVar3 = lua_absindex(uVar1,0xffffffff); lua_pushstring(uVar1,"__const"); lua_rawget(uVar1,uVar3); lua_rotate(*in_ECX,0xfffffffd,1); lua_rotate(*in_ECX,0xfffffffe,1); } ExceptionList = local_10; return in_ECX; } //@@ 008c4b30 FUN_008c4b30 undefined4 * FUN_008c4b30(undefined4 *param_1) { undefined4 uVar1; void *pvVar2; undefined4 *in_ECX; int iVar3; undefined4 *puVar4; undefined4 *puVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b056dd; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = *param_1; uVar1 = param_1[1]; in_ECX[2] = param_1[2]; in_ECX[1] = uVar1; uVar1 = param_1[3]; in_ECX[4] = param_1[4]; in_ECX[3] = uVar1; in_ECX[5] = param_1[5]; in_ECX[6] = param_1[6]; in_ECX[7] = param_1[7]; in_ECX[8] = param_1[8]; in_ECX[9] = param_1[9]; in_ECX[10] = param_1[10]; puVar4 = param_1 + 0xb; puVar5 = in_ECX + 0xb; for (iVar3 = 0x1c0; iVar3 != 0; iVar3 = iVar3 + -1) { *puVar5 = *puVar4; puVar4 = puVar4 + 1; puVar5 = puVar5 + 1; } puVar4 = in_ECX + 0x1d2; *(undefined1 *)(in_ECX + 0x1cb) = *(undefined1 *)(param_1 + 0x1cb); *(undefined1 *)((int)in_ECX + 0x72d) = *(undefined1 *)((int)param_1 + 0x72d); uVar1 = param_1[0x1cd]; in_ECX[0x1cc] = param_1[0x1cc]; in_ECX[0x1cd] = uVar1; *(undefined1 *)(in_ECX + 0x1ce) = *(undefined1 *)(param_1 + 0x1ce); in_ECX[0x1cf] = param_1[0x1cf]; in_ECX[0x1d0] = param_1[0x1d0]; in_ECX[0x1d1] = param_1[0x1d1]; *puVar4 = 0; in_ECX[0x1d3] = 0; pvVar2 = operator_new(0x14); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *puVar4 = pvVar2; local_8 = 0; std_set_uint_copy(puVar4,param_1 + 0x1d2,(int)param_1); ExceptionList = local_10; return in_ECX; } //@@ 008c4c80 FUN_008c4c80 void FUN_008c4c80(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xb0); } return; } //@@ 008c4cb0 FUN_008c4cb0 void FUN_008c4cb0(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x30); } return; } //@@ 008c4ce0 FUN_008c4ce0 void FUN_008c4ce0(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = luabridge::UserdataValue::vftable; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 2)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x16)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0xe)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); std::string::_Tidy_deallocate((char *)(in_ECX + 2)); *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x11c); } ExceptionList = local_10; return; } //@@ 008c4d70 FUN_008c4d70 void FUN_008c4d70(byte param_1) { undefined4 *this; undefined4 *in_ECX; *in_ECX = luabridge::UserdataValue::vftable; Font::Unload((Font *)(in_ECX + 2)); this = in_ECX + 0x12; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[0x12] + 4)); operator_delete((void *)*this,0x18); FUN_004b3950(); *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x54); } return; } //@@ 008c4dd0 FUN_008c4dd0 void FUN_008c4dd0(byte param_1) { undefined4 *in_ECX; in_ECX[7] = 0; in_ECX[8] = 0; *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x24); } return; } //@@ 008c4e10 FUN_008c4e10 void FUN_008c4e10(byte param_1) { int *piVar1; int *in_ECX; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = (int)luabridge::UserdataValue::vftable; piVar1 = in_ECX + 2; local_14 = in_ECX; if (*piVar1 != 0) { local_14 = piVar1; std::multiset::erase(&local_14); *piVar1 = 0; } *in_ECX = (int)luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } ExceptionList = local_10; return; } //@@ 008c4e90 FUN_008c4e90 undefined4 FUN_008c4e90(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a41,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a4a); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c4f50 FUN_008c4f50 undefined4 FUN_008c4f50(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a41,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a49); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5010 FUN_008c5010 undefined4 FUN_008c5010(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a43,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a4c); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c50d0 FUN_008c50d0 undefined4 FUN_008c50d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a43,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a4b); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5190 FUN_008c5190 undefined4 FUN_008c5190(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a3f,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a4e); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5250 FUN_008c5250 undefined4 FUN_008c5250(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a3f,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a4d); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5310 FUN_008c5310 undefined4 FUN_008c5310(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a2d,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829aa); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c53d0 FUN_008c53d0 undefined4 FUN_008c53d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a2d,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829a9); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5490 FUN_008c5490 undefined4 FUN_008c5490(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a47,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&g_luaClassKeyVector); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5550 FUN_008c5550 undefined4 FUN_008c5550(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a47,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c8297f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5610 FUN_008c5610 undefined4 FUN_008c5610(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a45,0); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829b6); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c56d0 FUN_008c56d0 undefined4 FUN_008c56d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a45,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829b5); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5790 FUN_008c5790 undefined4 FUN_008c5790(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a36,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829fa); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5850 FUN_008c5850 undefined4 FUN_008c5850(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a33,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c829fd); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5910 FUN_008c5910 undefined4 FUN_008c5910(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a3c,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a03); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c59d0 FUN_008c59d0 undefined4 FUN_008c59d0(void *param_1) { int iVar1; undefined4 *puVar2; undefined4 uVar3; iVar1 = lua_type(param_1,1); if (iVar1 != 0) { luabridge::Userdata::getClass(param_1,1,&DAT_00c82a30,1); } puVar2 = (undefined4 *)lua_touserdata(param_1,0xfff0b9d7); uVar3 = luaL_checkinteger(param_1,2); iVar1 = (*(code *)*puVar2)(uVar3); if (iVar1 == 0) { lua_pushnil(param_1); return 1; } puVar2 = (undefined4 *)lua_newuserdata(param_1,8); *puVar2 = luabridge::UserdataPtr::vftable; puVar2[1] = iVar1; lua_rawgetp(param_1,0xfff0b9d8,&DAT_00c82a4f); lua_setmetatable(param_1,0xfffffffe); return 1; } //@@ 008c5a90 FUN_008c5a90 void FUN_008c5a90(byte param_1) { undefined4 *in_ECX; *in_ECX = luabridge::UserdataValue::vftable; FID_conflict__Tidy(in_ECX + 0x14); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x5c); } return; } //@@ 008c5ae0 FUN_008c5ae0 void FUN_008c5ae0(byte param_1) { int *this; undefined4 *in_ECX; this = in_ECX + 0x1d4; *in_ECX = luabridge::UserdataValue::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x14); *in_ECX = luabridge::Userdata::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x758); } return; } //@@ 008c5b30 FUN_008c5b30 undefined4 * FUN_008c5b30(undefined4 *param_1) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar2; undefined4 *puVar3; if (in_ECX == in_EDX) { return param_1; } puVar2 = in_ECX + 5; puVar3 = param_1 + 5; do { *param_1 = puVar2[-5]; param_1 = param_1 + 6; puVar3[-4] = puVar2[-4]; puVar3[-3] = puVar2[-3]; puVar3[-2] = puVar2[-2]; puVar3[-1] = puVar2[-1]; *puVar3 = *puVar2; puVar1 = puVar2 + 1; puVar2 = puVar2 + 6; puVar3 = puVar3 + 6; } while (puVar1 != in_EDX); return param_1; } //@@ 008c5b90 FUN_008c5b90 undefined4 FUN_008c5b90(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a30); (**(code **)*puVar1)(0); return 0; } //@@ 008c5bb0 FUN_008c5bb0 undefined4 FUN_008c5bb0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a3c); (**(code **)*puVar1)(0); return 0; } //@@ 008c5bd0 FUN_008c5bd0 undefined4 FUN_008c5bd0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a33); (**(code **)*puVar1)(0); return 0; } //@@ 008c5bf0 FUN_008c5bf0 undefined4 FUN_008c5bf0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a36); (**(code **)*puVar1)(0); return 0; } //@@ 008c5c10 FUN_008c5c10 undefined4 FUN_008c5c10(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a45); (**(code **)*puVar1)(0); return 0; } //@@ 008c5c30 FUN_008c5c30 undefined4 FUN_008c5c30(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a47); (**(code **)*puVar1)(0); return 0; } //@@ 008c5c50 FUN_008c5c50 undefined4 FUN_008c5c50(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a2d); (**(code **)*puVar1)(0); return 0; } //@@ 008c5c70 FUN_008c5c70 undefined4 FUN_008c5c70(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a3f); (**(code **)*puVar1)(0); return 0; } //@@ 008c5c90 FUN_008c5c90 undefined4 FUN_008c5c90(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a43); (**(code **)*puVar1)(0); return 0; } //@@ 008c5cb0 FUN_008c5cb0 undefined4 FUN_008c5cb0(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0085c3e0(&DAT_00c82a41); (**(code **)*puVar1)(0); return 0; } //@@ 008c5ccf GridEntity::Destroy /* ZHL [prefix56/57] bool Destroy(bool Immediate, EntityRef* Source); */ void __thiscall GridEntity::Destroy(GridEntity *this) { /* WARNING: Could not recover jumptable at 0x008c5cd1. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x3c))(); return; } //@@ 008c5cd4 Entity::IsBoss /* ZHL [lua] Lua binding Entity:IsBoss */ void __thiscall Entity::IsBoss(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5cd6. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x4c))(); return; } //@@ 008c5cd9 GridEntity::HurtWithSource /* ZHL [lua] Lua binding GridEntity:HurtWithSource */ void GridEntity::HurtWithSource(void) { int *in_ECX; /* WARNING: Could not recover jumptable at 0x008c5cdb. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 0x10))(); return; } //@@ 008c5cde Entity::TakeDamage /* ZHL [lua] Lua binding Entity:TakeDamage */ void __thiscall Entity::TakeDamage(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5ce0. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x20))(); return; } //@@ 008c5ce8 GridEntity::PostInit /* ZHL [lua] Lua binding GridEntity:PostInit */ void GridEntity::PostInit(void) { int *in_ECX; /* WARNING: Could not recover jumptable at 0x008c5cea. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 4))(); return; } //@@ 008c5ced Entity::Render /* ZHL [lua] Lua binding Entity:Render */ void __thiscall Entity::Render(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5cef. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x14))(); return; } //@@ 008c5cf2 Entity::KillWithSource /* ZHL [lua] Lua binding Entity:KillWithSource */ void __thiscall Entity::KillWithSource(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5cf4. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x24))(); return; } //@@ 008c5cf7 Entity_Laser::GetRenderZ /* ZHL [lua] Lua binding EntityLaser:GetRenderZ */ void __thiscall Entity_Laser::GetRenderZ(Entity_Laser *this) { /* WARNING: Could not recover jumptable at 0x008c5cf9. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x34))(); return; } //@@ 008c5cfc GridEntity::Update /* ZHL [lua] Lua binding GridEntity:Update */ void GridEntity::Update(void) { int *in_ECX; /* WARNING: Could not recover jumptable at 0x008c5cfe. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 8))(); return; } //@@ 008c5d01 Entity::RenderShadowLayer /* ZHL [lua] Lua binding Entity:RenderShadowLayer */ void __thiscall Entity::RenderShadowLayer(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5d03. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x18))(); return; } //@@ 008c5d06 Entity::Remove /* ZHL [lua] Lua binding Entity:Remove */ void __thiscall Entity::Remove(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5d08. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x28))(); return; } //@@ 008c5d0b Entity::CanShutDoors /* ZHL [lua] Lua binding Entity:CanShutDoors */ void __thiscall Entity::CanShutDoors(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5d0d. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x48))(); return; } //@@ 008c5d10 Entity::Update /* ZHL [lua] Lua binding Entity:Update */ void Entity::Update(void) { int *in_ECX; /* WARNING: Could not recover jumptable at 0x008c5d12. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 0xc))(); return; } //@@ 008c5d15 Entity::PostRender /* ZHL [lua] Lua binding Entity:PostRender */ void __thiscall Entity::PostRender(Entity *this) { /* WARNING: Could not recover jumptable at 0x008c5d17. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)this + 0x1c))(); return; } //@@ 008c5d20 FUN_008c5d20 void FUN_008c5d20(void) { undefined4 *puVar1; puVar1 = (undefined4 *)FUN_0041d4c0(); __stdio_common_vfprintf(*puVar1,puVar1[1]); return; } //@@ 008c5d50 FUN_008c5d50 void FUN_008c5d50(void) { FUN_008c5d20(); return; } //@@ 008c5d70 FUN_008c5d70 void FUN_008c5d70(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb440; local_10 = ExceptionList; ExceptionList = &local_10; FID_conflict__Tidy((void *)(in_ECX + 0x35c)); FID_conflict__Tidy((void *)(in_ECX + 0x350)); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x230)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x280)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x260)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x248)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x230)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x11c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x16c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x14c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x134)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x11c)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x58)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 008c6240 Menu_Bestiary::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads gfx/ui/main menu/BestiaryMenu.anm2 and gfx/ui/Death Screen.anm2 ("Diary"); called from MenuManager::LoadGraphics after Menu_DailyChallenge::load_graphics */ void Menu_Bestiary::load_graphics(void) { byte bVar1; byte *pbVar2; int in_ECX; byte *pbVar3; char *pcVar4; uint uVar5; bool bVar6; std_string menuAnmPath; std_string deathScreenAnmPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; menuAnmPath._size = 0; menuAnmPath._capacity = 0xf; menuAnmPath._buf[0] = '\0'; menuAnmPath._buf[1] = '\0'; menuAnmPath._buf[2] = '\0'; menuAnmPath._buf[3] = '\0'; menuAnmPath._buf._0_4_ = std::_Allocate(0x30); menuAnmPath._size = 0x22; menuAnmPath._capacity = 0x2f; builtin_strncpy((char *)menuAnmPath._buf._0_4_,"gfx/ui/main menu/BestiaryMenu.anm2",0x23); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 8),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar5 = menuAnmPath._capacity + 1; pcVar4 = (char *)menuAnmPath._buf._0_4_; if (0xfff < uVar5) { pcVar4 = *(char **)(menuAnmPath._buf._0_4_ + -4); uVar5 = menuAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuAnmPath._buf._0_4_ + (-4 - (int)pcVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,uVar5); } animData = *(byte **)(in_ECX + 0x3c); if (animData != (byte *)0x0) { pbVar2 = animData; if (0xf < *(uint *)(animData + 0x14)) { pbVar2 = *(byte **)animData; } pbVar3 = s_Idle; do { bVar1 = *pbVar2; bVar6 = bVar1 < *pbVar3; if (bVar1 != *pbVar3) { LAB_008c6365: uVar5 = -(uint)bVar6 | 1; goto LAB_008c636a; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar6 = bVar1 < pbVar3[1]; if (bVar1 != pbVar3[1]) goto LAB_008c6365; pbVar2 = pbVar2 + 2; pbVar3 = pbVar3 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_008c636a: if ((uVar5 == 0) && ((animData[0x34] == 0 || (*(char *)(in_ECX + 0x4c) != '\0')))) goto LAB_008c6396; } bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 8),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x38)); *(undefined1 *)(in_ECX + 0x4c) = 1; } LAB_008c6396: deathScreenAnmPath._size = 0; deathScreenAnmPath._capacity = 0xf; deathScreenAnmPath._buf[0] = '\0'; deathScreenAnmPath._buf[1] = '\0'; deathScreenAnmPath._buf[2] = '\0'; deathScreenAnmPath._buf[3] = '\0'; deathScreenAnmPath._buf._0_4_ = std::_Allocate(0x20); deathScreenAnmPath._size = 0x18; deathScreenAnmPath._capacity = 0x1f; builtin_strncpy((char *)deathScreenAnmPath._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x11c),&deathScreenAnmPath,1); local_14 = 0xffffffff; if (0xf < deathScreenAnmPath._capacity) { uVar5 = deathScreenAnmPath._capacity + 1; pcVar4 = (char *)deathScreenAnmPath._buf._0_4_; if (0xfff < uVar5) { pcVar4 = *(char **)(deathScreenAnmPath._buf._0_4_ + -4); uVar5 = deathScreenAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(deathScreenAnmPath._buf._0_4_ + (-4 - (int)pcVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,uVar5); } animData = *(byte **)(in_ECX + 0x150); deathScreenAnmPath._size = 0; deathScreenAnmPath._capacity = 0xf; deathScreenAnmPath._buf._0_4_ = deathScreenAnmPath._buf._0_4_ & 0xffffff00; if (animData != (byte *)0x0) { pbVar2 = animData; if (0xf < *(uint *)(animData + 0x14)) { pbVar2 = *(byte **)animData; } pcVar4 = "Diary"; do { bVar1 = *pbVar2; bVar6 = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_008c6487: uVar5 = -(uint)bVar6 | 1; goto LAB_008c648c; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar6 = bVar1 < (byte)pcVar4[1]; if (bVar1 != pcVar4[1]) goto LAB_008c6487; pbVar2 = pbVar2 + 2; pcVar4 = pcVar4 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_008c648c: if (uVar5 == 0) { if (animData[0x34] == 0) { ExceptionList = local_1c; return; } if (*(char *)(in_ECX + 0x160) != '\0') { ExceptionList = local_1c; return; } } } bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x11c),(byte *)"Diary",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x14c)); *(undefined1 *)(in_ECX + 0x160) = 1; } ExceptionList = local_1c; return; } //@@ 008c64e0 Menu_Bestiary::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager::Update case 0xe with ECX = MenuManager+0xd4d0 (_menuBestiary, typed Menu_Bestiary): animation updates on even frames, page/cursor handling */ void Menu_Bestiary::Update(void) { Menu_Bestiary MVar1; Menu_Bestiary MVar2; byte bVar3; std_string *anim; LayerState *pLVar4; Menu_Bestiary *in_ECX; void *ptr; uint uVar5; Menu_Bestiary MVar6; void *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff10d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; MVar1 = in_ECX[0xd2]; MVar2 = in_ECX[0xd1]; update_cursor(in_ECX); if ((g_manager->_framecount & 1) == 0) { if (in_ECX[0x44].field_0x1 != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0xe)); AnimationState::Update((AnimationState *)(in_ECX + 0x16)); } if (in_ECX[0xce].field_0x1 != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x98)); AnimationState::Update((AnimationState *)(in_ECX + 0xa0)); } if ((in_ECX[0x99] == (Menu_Bestiary)0x0) || (*(char *)(in_ECX + 0x9d) == '\0')) { anim = ANM2::GetAnimation((ANM2 *)(in_ECX + 0x98),(std_string *)local_2c); local_8 = (void *)0x0; if (0xf < anim->_capacity) { anim = *(std_string **)anim->_buf; } bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x8c),(byte *)anim,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x98)); *(undefined1 *)(in_ECX + 0x9d) = 1; } local_8 = (void *)0xffffffff; if (0xf < local_18) { uVar5 = local_18 + 1; ptr = local_2c[0]; if (0xfff < uVar5) { ptr = *(void **)((int)local_2c[0] + -4); uVar5 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } } } MVar6 = in_ECX[0xd1]; if ((MVar2 != MVar6) || (MVar1 != in_ECX[0xd2])) { LoadPreview(in_ECX); MVar6 = in_ECX[0xd1]; } MVar1 = in_ECX[0xd3]; uVar5 = ((int)in_ECX[0xd8] - (int)in_ECX[0xd7] >> 2) - 1; pLVar4 = ANM2::GetLayer((ANM2 *)(in_ECX + 2),&DAT_00000007); pLVar4->_visible = 0 < (int)MVar6; MVar2 = in_ECX[0xd1]; pLVar4 = ANM2::GetLayer((ANM2 *)(in_ECX + 2),&DAT_00000008); pLVar4->_visible = (int)MVar2 < (int)((int)MVar1 + 1 + ((-(uint)(uVar5 != 0) & uVar5) >> 2)); ExceptionList = local_10; return; } //@@ 008c66a0 Menu_Bestiary::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: draws #BESTIARY_KILLS/DEATHS/HITS/HP text, GetBestiaryKillCount, EntityConfig::GetBestiaryConfig; ECX = MenuManager+0xd4d0 (zhl _menuBestiary 0xd490 + drift) in menu render aggregator 0098a040 prototype: db/protos.zhl */ void __thiscall Menu_Bestiary::Render(Menu_Bestiary *frontAnimState) { Vector pos; Vector pos_00; Vector pos_01; Vector pos_02; KColor color; KColor color_00; Vector scale; uint uVar1; EntityConfig_Entity *bestiaryConfig; int iVar2; uint uVar3; Vector *pVVar4; byte *pbVar5; void *pvVar6; AnimationState *frontAnimState; void *encounterNode; AnimationLayer *layer; ANM2 *sprite; Font *pFVar7; Menu_Bestiary MVar8; float fVar9; float cellOffsetY; float fVar10; Menu_Bestiary MVar11; float fVar12; float fVar13; Menu_Bestiary MVar14; ColorMod whiteColor; Menu_Bestiary gridCellColor; undefined4 uStack_218; undefined4 uStack_214; Menu_Bestiary MStack_210; undefined4 local_1fc; undefined4 uStack_1f8; undefined4 local_1f4; Menu_Bestiary pageCellColor; undefined4 uStack_1ec; undefined4 uStack_1e8; Menu_Bestiary MStack_1e4; undefined4 local_1d0; undefined4 uStack_1cc; undefined4 local_1c8; KColor local_1c4; undefined1 local_1b0 [8]; void *local_1a8; PersistentGameData *local_1a0; Vector local_19c; Font *local_194; Vector renderPos; FontSettings fontSettings; undefined4 local_184; undefined4 local_180; undefined4 local_17c; undefined4 local_178; undefined4 local_174; undefined4 local_170; Menu_Bestiary local_16c; PersistentGameData *local_168; uint *local_164; Menu_Bestiary local_160; Vector local_15c; std_map *local_154; PersistentGameData *local_150; EntityConfig *local_14c; float local_148; float local_144; std_string local_140; byte textBuffer [260]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = textBuffer + 0x124; local_14 = 0xffffffff; puStack_18 = &LAB_00b0577e; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(textBuffer + 0x118); ExceptionList = &local_1c; local_19c.x = (g_menuManager->_ViewPosition).x + (float)*frontAnimState; local_19c.y = (g_menuManager->_ViewPosition).y + (float)frontAnimState[1]; pbVar5 = textBuffer + 0x124; if (frontAnimState[0x44].field_0x1 != '\0') { if (*(char *)(frontAnimState + 0x1e) == '\0') { AnimationState::Render((AnimationState *)(frontAnimState + 0xe),&local_19c,&g_vectorZero,&g_vectorZero); frontAnimState = (AnimationState *)(frontAnimState + 0x16); } else { puStack_20 = textBuffer + 0x124; AnimationState::Render((AnimationState *)(frontAnimState + 0x16),&local_19c,&g_vectorZero,&g_vectorZero) ; frontAnimState = (AnimationState *)(frontAnimState + 0xe); } AnimationState::Render(frontAnimState,&local_19c,&g_vectorZero,&g_vectorZero); pbVar5 = puStack_20; } puStack_20 = pbVar5; fVar10 = 0.0; local_14c = &g_manager->_entityConfig; MVar8 = frontAnimState[0xd1]; MVar14 = (Menu_Bestiary)0x3f800000; MVar11 = (Menu_Bestiary)0x3f000000; fVar12 = (g_menuManager->_ViewPosition).x + (float)*frontAnimState; fVar13 = (g_menuManager->_ViewPosition).y + (float)frontAnimState[1]; if ((int)frontAnimState[0xd3] < (int)MVar8) { fVar12 = fVar12 + 60.0; fVar13 = fVar13 + 142.0; local_168 = (PersistentGameData *)(((int)MVar8 - (int)frontAnimState[0xd3]) * 4); local_16c = (Menu_Bestiary)((int)local_168 - 4); local_148 = fVar13; local_144 = fVar12; if ((int)local_16c < (int)local_168) { fVar9 = 80.0; local_160 = (Menu_Bestiary)0x0; do { if ((int)frontAnimState[0xd8] - (int)frontAnimState[0xd7] >> 2 <= (int)local_16c) break; local_154 = (std_map *)((int)frontAnimState[0xd7] + (int)local_16c * 4); _Find_lower_bound<>(local_1b0,local_154); pvVar6 = local_1a8; if (((*(char *)((int)local_1a8 + 0xd) == '\0') && (*(void **)((int)local_1a8 + 0x10) <= local_154->_head)) && (local_1a8 != (local_14c->_entities)._head)) { uVar1 = (uint)local_16c & 0x80000001; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffe) + 1; } pFVar7 = (Font *)((float)(int)uVar1 * fVar9); uVar1 = (uint)local_16c & 0x80000003; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffc) + 1; } local_1a0 = &g_manager->_persistentGameData; local_150 = (PersistentGameData *)((int)local_1a8 + 0x18); cellOffsetY = (float)((int)uVar1 / 2) * fVar9; local_194 = pFVar7; local_154 = (std_map *)cellOffsetY; bestiaryConfig = EntityConfig::GetBestiaryConfig (&g_manager->_entityConfig,*(int *)((int)local_1a8 + 0x18), *(int *)((int)local_1a8 + 0x1c)); if ((bestiaryConfig == (EntityConfig_Entity *)0x0) || (bestiaryConfig->bestiary == 0)) { iVar2 = 0; } else { iVar2 = FUN_0092b1e0((bestiaryConfig->id << 0xc | bestiaryConfig->variant) << 8); } if (frontAnimState[0xd2] == local_160) { MVar11 = MVar14; } pageCellColor = (Menu_Bestiary)0x3f800000; uStack_1ec = 0x3f800000; uStack_1e8 = 0x3f800000; local_1d0 = 0; uStack_1cc = 0; local_1c8 = 0; if (frontAnimState + 0x71 != &pageCellColor) { frontAnimState[0x75] = (Menu_Bestiary)0x0; frontAnimState[0x76] = (Menu_Bestiary)0x0; frontAnimState[0x77] = (Menu_Bestiary)0x0; frontAnimState[0x78] = (Menu_Bestiary)0x0; frontAnimState[0x71] = (Menu_Bestiary)0x3f800000; frontAnimState[0x72] = (Menu_Bestiary)0x3f800000; frontAnimState[0x73] = (Menu_Bestiary)0x3f800000; frontAnimState[0x74] = MVar11; *(undefined8 *)(frontAnimState + 0x79) = 0; frontAnimState[0x7b] = (Menu_Bestiary)0x0; pFVar7 = local_194; } MStack_1e4 = MVar11; if (iVar2 < 1) { if (frontAnimState[0x54] != (Menu_Bestiary)0x0) { if (*(int *)((int)frontAnimState[0x53] + 0x80) < 6) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; if (*(int *)((int)frontAnimState[0x53] + 0x80) < 6) goto LAB_008c6d94; } MVar8 = frontAnimState[0x54]; local_150 = *(PersistentGameData **)((int)MVar8 + 0x4c); if (((MVar8 == (Menu_Bestiary)0x0) || ((int)local_150 < 0)) || (*(int *)((int)MVar8 + 0x1c) <= (int)local_150)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_150 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(frontAnimState + 0x53),(int)local_150,152.0); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; } LAB_008c6d94: local_15c.x = fVar12 + (float)local_194 + fVar10; local_15c.y = fVar13 + (float)local_154 + fVar10; if (frontAnimState[0x89].field_0x1 != '\0') { if (*(char *)(frontAnimState + 99) == '\0') { MVar8 = frontAnimState[0x54]; if (MVar8 != (Menu_Bestiary)0x0) { if (5 < *(int *)((int)frontAnimState[0x53] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x4c); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &local_15c,*(int *)((int)frontAnimState[0x55] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x53]); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; } } } MVar8 = frontAnimState[0x5c]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x5b], 5 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); MVar8 = frontAnimState[0x5d]; goto LAB_008c6eff; } } else { MVar8 = frontAnimState[0x5c]; if (MVar8 != (Menu_Bestiary)0x0) { if (5 < *(int *)((int)frontAnimState[0x5b] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x4c); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &local_15c,*(int *)((int)frontAnimState[0x5d] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x5b]); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; } } } MVar8 = frontAnimState[0x54]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x53], 5 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); MVar8 = frontAnimState[0x55]; LAB_008c6eff: iVar2 = *(int *)((int)MVar8 + iVar2 * 4); pVVar4 = &local_15c; LAB_008c6f13: AnimationLayer::RenderFrame (layer,pVVar4,iVar2,&g_vectorZero,&g_vectorZero,(ANM2 *)MVar11); goto LAB_008c6f19; } } } LAB_008c6f2c: MVar14 = (Menu_Bestiary)0x3f800000; } else { if ((*(int *)((int)pvVar6 + 0x178) == 0) || (*(char *)((int)pvVar6 + 0x17c) == '\0')) { local_1a0 = *(PersistentGameData **)((int)pvVar6 + 0x7c); if (frontAnimState[0x54] != (Menu_Bestiary)0x0) { if (*(int *)((int)frontAnimState[0x53] + 0x80) < 4) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; if (*(int *)((int)frontAnimState[0x53] + 0x80) < 4) goto LAB_008c6b3e; } MVar8 = frontAnimState[0x54]; local_150 = *(PersistentGameData **)((int)MVar8 + 0x44); if (((MVar8 == (Menu_Bestiary)0x0) || ((int)local_150 < 0)) || (*(int *)((int)MVar8 + 0x1c) <= (int)local_150)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_150 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(frontAnimState + 0x53),(int)local_150,(float)(int)local_1a0); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; } LAB_008c6b3e: local_19c.x = fVar12 + (float)local_194 + fVar10; local_19c.y = fVar13 + (float)local_154 + fVar10; if (frontAnimState[0x89].field_0x1 != '\0') { if (*(char *)(frontAnimState + 99) == '\0') { MVar8 = frontAnimState[0x54]; if (MVar8 != (Menu_Bestiary)0x0) { if (3 < *(int *)((int)frontAnimState[0x53] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x44); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &local_19c,*(int *)((int)frontAnimState[0x55] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x53]); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; } } } MVar8 = frontAnimState[0x5c]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x5b], 3 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x44), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); iVar2 = *(int *)((int)frontAnimState[0x5d] + iVar2 * 4); pVVar4 = &local_19c; goto LAB_008c6f13; } } else { MVar8 = frontAnimState[0x5c]; if (MVar8 != (Menu_Bestiary)0x0) { if (3 < *(int *)((int)frontAnimState[0x5b] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x44); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &local_19c,*(int *)((int)frontAnimState[0x5d] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x5b]); fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; } } } MVar8 = frontAnimState[0x54]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x53], 3 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x44), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); iVar2 = *(int *)((int)frontAnimState[0x55] + iVar2 * 4); pVVar4 = &local_19c; goto LAB_008c6f13; } } } goto LAB_008c6f2c; } renderPos.x = fVar12 + (float)pFVar7 + fVar10 + 21.0; renderPos.y = (fVar13 + cellOffsetY + fVar10) - 30.0; if (((local_150 != (PersistentGameData *)0x0) && (iVar2 = *(int *)(local_150->_achievements + 0x128), iVar2 != 0)) && (sprite = (ANM2 *)(iVar2 + 0xdf0), *(char *)(iVar2 + 0xef9) != '\0')) { ANM2::SetFrame(sprite,(std_string *)(iVar2 + 0xe08), *(int *)(local_150->_achievements + 0x2c)); Sprite::SetColor((Sprite *)sprite,(ColorMod *)(frontAnimState + 0x71)); *(float *)(iVar2 + 0xe8c) = g_vectorOne.x; *(float *)(iVar2 + 0xe90) = g_vectorOne.y; ANM2::Render(sprite,&renderPos,&g_vectorZero,&g_vectorZero); LAB_008c6f19: fVar10 = 0.0; fVar12 = local_144; fVar13 = local_148; goto LAB_008c6f2c; } } MVar11 = (Menu_Bestiary)0x3f000000; fVar9 = 80.0; } local_160 = (Menu_Bestiary)((int)local_160 + 1); local_16c = (Menu_Bestiary)((int)local_16c + 1); } while ((int)local_16c < (int)local_168); } } else { fVar12 = fVar12 + 42.0; fVar13 = fVar13 + 120.0; local_168 = (PersistentGameData *)((int)MVar8 * 0x10); local_15c.y = (float)((int)local_168 + 0x10); local_148 = fVar12; local_144 = fVar13; if ((int)local_168 < (int)local_15c.y) { fVar9 = 40.0; local_16c = (Menu_Bestiary)0x0; do { if ((int)frontAnimState[0xd5] - (int)frontAnimState[0xd4] >> 2 <= (int)local_168) break; local_150 = (PersistentGameData *)((int)frontAnimState[0xd4] + (int)local_168 * 4); _Find_lower_bound<>((undefined1 *)((int)&local_140 + 0xc),local_150); uVar1 = local_140._capacity; if (((*(char *)(local_140._capacity + 0xd) == '\0') && (*(uint *)(local_140._capacity + 0x10) <= *(uint *)local_150)) && ((void *)local_140._capacity != (local_14c->_entities)._head)) { uVar3 = (uint)local_168 & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } MVar8 = (Menu_Bestiary)((float)(int)uVar3 * fVar9); uVar3 = (uint)local_168 & 0x8000000f; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff0) + 1; } local_164 = (uint *)(local_140._capacity + 0x18); local_1a0 = (PersistentGameData *) ((*(int *)(local_140._capacity + 0x18) << 0xc | *(uint *)(local_140._capacity + 0x1c)) << 8); local_154 = &(g_manager->_persistentGameData)._bestiaryEncounters; fVar9 = (float)((int)(uVar3 + ((int)uVar3 >> 0x1f & 3U)) >> 2) * fVar9; local_194 = (Font *)fVar9; local_160 = MVar8; local_150 = local_1a0; std::set::find_node(&local_1c4._blue,&local_150); if ((*(char *)(local_1c4._unk + 0xd) == '\0') && (*(int *)(local_1c4._unk + 0x10) <= (int)local_1a0)) { pvVar6 = (void *)local_1c4._unk; } else { pvVar6 = local_154->_head; } if (pvVar6 == local_154->_head) { iVar2 = 0; } else { iVar2 = *(int *)((int)pvVar6 + 0x14); } if (frontAnimState[0xd2] == local_16c) { MVar11 = MVar14; } gridCellColor = (Menu_Bestiary)0x3f800000; uStack_218 = 0x3f800000; uStack_214 = 0x3f800000; local_1fc = 0; uStack_1f8 = 0; local_1f4 = 0; if (frontAnimState + 0x71 != &gridCellColor) { frontAnimState[0x75] = (Menu_Bestiary)0x0; frontAnimState[0x76] = (Menu_Bestiary)0x0; frontAnimState[0x77] = (Menu_Bestiary)0x0; frontAnimState[0x78] = (Menu_Bestiary)0x0; frontAnimState[0x71] = (Menu_Bestiary)0x3f800000; frontAnimState[0x72] = (Menu_Bestiary)0x3f800000; frontAnimState[0x73] = (Menu_Bestiary)0x3f800000; frontAnimState[0x74] = MVar11; *(undefined8 *)(frontAnimState + 0x79) = 0; frontAnimState[0x7b] = (Menu_Bestiary)0x0; MVar8 = local_160; } MStack_210 = MVar11; if (iVar2 < 1) { if (frontAnimState[0x54] != (Menu_Bestiary)0x0) { if (*(int *)((int)frontAnimState[0x53] + 0x80) < 6) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; if (*(int *)((int)frontAnimState[0x53] + 0x80) < 6) goto LAB_008c7578; } MVar8 = frontAnimState[0x54]; local_164 = *(uint **)((int)MVar8 + 0x4c); if (((MVar8 == (Menu_Bestiary)0x0) || ((int)local_164 < 0)) || (*(int *)((int)MVar8 + 0x1c) <= (int)local_164)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_164 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(frontAnimState + 0x53),(int)local_164,152.0); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; } LAB_008c7578: renderPos.x = (float)local_160 + fVar12 + fVar10; renderPos.y = (float)local_194 + fVar13 + fVar10; if (frontAnimState[0x89].field_0x1 != '\0') { if (*(char *)(frontAnimState + 99) == '\0') { MVar8 = frontAnimState[0x54]; if (MVar8 != (Menu_Bestiary)0x0) { if (5 < *(int *)((int)frontAnimState[0x53] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x4c); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &renderPos,*(int *)((int)frontAnimState[0x55] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x53]); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; } } } MVar8 = frontAnimState[0x5c]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x5b], 5 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); MVar8 = frontAnimState[0x5d]; goto LAB_008c76e5; } } else { MVar8 = frontAnimState[0x5c]; if (MVar8 != (Menu_Bestiary)0x0) { if (5 < *(int *)((int)frontAnimState[0x5b] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x4c); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &renderPos,*(int *)((int)frontAnimState[0x5d] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x5b]); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; } } } MVar8 = frontAnimState[0x54]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x53], 5 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); MVar8 = frontAnimState[0x55]; LAB_008c76e5: iVar2 = *(int *)((int)MVar8 + iVar2 * 4); pVVar4 = &renderPos; LAB_008c76f9: AnimationLayer::RenderFrame (layer,pVVar4,iVar2,&g_vectorZero,&g_vectorZero,(ANM2 *)MVar11); goto LAB_008c76ff; } } } LAB_008c7712: MVar14 = (Menu_Bestiary)0x3f800000; } else { if ((*(int *)(uVar1 + 0x178) == 0) || (*(char *)(uVar1 + 0x17c) == '\0')) { local_150 = *(PersistentGameData **)(uVar1 + 0x7c); if (frontAnimState[0x54] != (Menu_Bestiary)0x0) { if (*(int *)((int)frontAnimState[0x53] + 0x80) < 6) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; if (*(int *)((int)frontAnimState[0x53] + 0x80) < 6) goto LAB_008c7320; } MVar8 = frontAnimState[0x54]; local_164 = *(uint **)((int)MVar8 + 0x4c); if (((MVar8 == (Menu_Bestiary)0x0) || ((int)local_164 < 0)) || (*(int *)((int)MVar8 + 0x1c) <= (int)local_164)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_164 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(frontAnimState + 0x53),(int)local_164,(float)(int)local_150); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; } LAB_008c7320: local_19c.x = (float)local_160 + fVar12 + fVar10; local_19c.y = (float)local_194 + fVar13 + fVar10; if (frontAnimState[0x89].field_0x1 != '\0') { if (*(char *)(frontAnimState + 99) == '\0') { MVar8 = frontAnimState[0x54]; if (MVar8 != (Menu_Bestiary)0x0) { if (5 < *(int *)((int)frontAnimState[0x53] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x4c); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &local_19c,*(int *)((int)frontAnimState[0x55] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x53]); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; } } } MVar8 = frontAnimState[0x5c]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x5b], 5 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); iVar2 = *(int *)((int)frontAnimState[0x5d] + iVar2 * 4); pVVar4 = &local_19c; goto LAB_008c76f9; } } else { MVar8 = frontAnimState[0x5c]; if (MVar8 != (Menu_Bestiary)0x0) { if (5 < *(int *)((int)frontAnimState[0x5b] + 0x80)) { iVar2 = *(int *)((int)MVar8 + 0x4c); if (-1 < iVar2) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)), &local_19c,*(int *)((int)frontAnimState[0x5d] + iVar2 * 4),&g_vectorZero, &g_vectorZero,(ANM2 *)frontAnimState[0x5b]); fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; } } } MVar8 = frontAnimState[0x54]; if (((MVar8 != (Menu_Bestiary)0x0) && (MVar11 = frontAnimState[0x53], 5 < *(int *)((int)MVar11 + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); iVar2 = *(int *)((int)frontAnimState[0x55] + iVar2 * 4); pVVar4 = &local_19c; goto LAB_008c76f9; } } } goto LAB_008c7712; } local_1a8 = (void *)((fVar9 + fVar13 + fVar10) - 30.0); local_1b0._4_4_ = (float)MVar8 + fVar12 + fVar10 + 21.0; if (((local_164 != (uint *)0x0) && (uVar1 = local_164[0x58], uVar1 != 0)) && (sprite = (ANM2 *)(uVar1 + 0xdf0), *(char *)(uVar1 + 0xef9) != '\0')) { ANM2::SetFrame(sprite,(std_string *)(uVar1 + 0xe08),local_164[0x19]); Sprite::SetColor((Sprite *)sprite,(ColorMod *)(frontAnimState + 0x71)); *(float *)(uVar1 + 0xe8c) = g_vectorOne.x; *(float *)(uVar1 + 0xe90) = g_vectorOne.y; ANM2::Render(sprite,(Vector *)(local_1b0 + 4),&g_vectorZero,&g_vectorZero); LAB_008c76ff: fVar10 = 0.0; fVar12 = local_148; fVar13 = local_144; goto LAB_008c7712; } } MVar11 = (Menu_Bestiary)0x3f000000; fVar9 = 40.0; } local_16c = (Menu_Bestiary)((int)local_16c + 1); local_168 = (PersistentGameData *)((int)local_168 + 1); } while ((int)local_168 < (int)local_15c.y); } } MVar8 = frontAnimState[0xd1]; if ((int)frontAnimState[0xd3] < (int)MVar8) { if (frontAnimState[0xd7] != frontAnimState[0xd8]) { local_15c.y = (float)((int)frontAnimState[0xd7] + ((int)frontAnimState[0xd2] + ((int)MVar8 - (int)frontAnimState[0xd3]) * 4 + -4) * 4); goto LAB_008c7794; } LAB_008c77ce: pvVar6 = (local_14c->_entities)._head; } else { if (frontAnimState[0xd4] == frontAnimState[0xd5]) goto LAB_008c77ce; local_15c.y = (float)((int)frontAnimState[0xd4] + ((int)MVar8 * 0x10 + (int)frontAnimState[0xd2]) * 4); LAB_008c7794: _Find_lower_bound<>(&local_1c4._blue,local_15c.y); if ((*(char *)(local_1c4._unk + 0xd) != '\0') || (*(uint *)local_15c.y < *(uint *)(local_1c4._unk + 0x10))) goto LAB_008c77ce; pvVar6 = (void *)local_1c4._unk; } if (pvVar6 == (local_14c->_entities)._head) { ExceptionList = local_1c; return; } local_194 = &g_manager->_font2_TeamMeatEx12; local_168 = &g_manager->_persistentGameData; local_1a0 = (PersistentGameData *)&g_manager->_entityConfig; local_150 = *(PersistentGameData **)((int)pvVar6 + 0x18); fVar12 = ((g_menuManager->_ViewPosition).x + (float)*frontAnimState) - fVar10; fVar10 = ((g_menuManager->_ViewPosition).y + (float)frontAnimState[1]) - fVar10; local_14c = (EntityConfig *)fVar10; local_144 = fVar12; bestiaryConfig = EntityConfig::GetBestiaryConfig ((EntityConfig *)local_1a0,(int)local_150,*(int *)((int)pvVar6 + 0x1c)); if ((bestiaryConfig == (EntityConfig_Entity *)0x0) || (bestiaryConfig->bestiary == 0)) { LAB_008c78c8: local_148 = 0.0; } else { local_164 = (uint *)((bestiaryConfig->id << 0xc | bestiaryConfig->variant) << 8); local_154 = &local_168->_bestiaryEncounters; local_15c.y = (float)local_164; std::set::find_node(&local_1c4._blue,&local_15c.y); if ((*(char *)(local_1c4._unk + 0xd) == '\0') && (*(int *)(local_1c4._unk + 0x10) <= (int)local_164)) { encounterNode = (void *)local_1c4._unk; } else { encounterNode = local_154->_head; } if (encounterNode == local_154->_head) goto LAB_008c78c8; local_148 = *(float *)((int)encounterNode + 0x14); } local_19c.y = (float)PersistentGameData::GetBestiaryDeathCount (local_168,(int)local_150,*(int *)((int)pvVar6 + 0x1c)); local_150 = *(PersistentGameData **)((int)pvVar6 + 0x18); bestiaryConfig = EntityConfig::GetBestiaryConfig ((EntityConfig *)local_1a0,(int)local_150,*(int *)((int)pvVar6 + 0x1c)); if ((bestiaryConfig == (EntityConfig_Entity *)0x0) || (bestiaryConfig->bestiary == 0)) { LAB_008c7985: local_160 = (Menu_Bestiary)0x0; } else { local_164 = (uint *)((bestiaryConfig->id << 0xc | bestiaryConfig->variant) << 8); local_154 = (std_map *)&local_168->field_0xf74; local_15c.y = (float)local_164; std::set::find_node(&local_1c4._blue,&local_15c.y); if ((*(char *)(local_1c4._unk + 0xd) != '\0') || ((int)local_164 < *(int *)(local_1c4._unk + 0x10))) { local_1c4._unk = (int)local_154->_head; } if ((void *)local_1c4._unk == local_154->_head) goto LAB_008c7985; local_160 = *(Menu_Bestiary *)(local_1c4._unk + 0x14); } local_164 = (uint *)PersistentGameData::GetBestiaryKillCount (local_168,(int)local_150,*(int *)((int)pvVar6 + 0x1c)); local_15c.y = (float)(frontAnimState + 0x71); whiteColor._offset[0] = 0.0; whiteColor._offset[1] = 0.0; whiteColor._offset[2] = 0.0; if ((ColorMod *)local_15c.y != &whiteColor) { *(undefined8 *)(frontAnimState + 0x79) = 0; ((ColorMod *)local_15c.y)->_tint[0] = 1.0; frontAnimState[0x72] = (Menu_Bestiary)0x3f800000; frontAnimState[0x73] = (Menu_Bestiary)0x3f800000; frontAnimState[0x74] = (Menu_Bestiary)0x3f800000; frontAnimState[0x7b] = (Menu_Bestiary)0x0; frontAnimState[0x75] = (Menu_Bestiary)0x0; frontAnimState[0x76] = (Menu_Bestiary)0x0; frontAnimState[0x77] = (Menu_Bestiary)0x0; frontAnimState[0x78] = (Menu_Bestiary)0x0; fVar12 = local_144; } if (local_148 != 0.0) { if (frontAnimState[0xce].field_0x1 == '\0') { if ((*(int *)((int)pvVar6 + 0x178) == 0) || (*(char *)((int)pvVar6 + 0x17c) == '\0')) { local_16c = (Menu_Bestiary)(frontAnimState + 0x47); local_154 = *(std_map **)((int)pvVar6 + 0x7c); if ((int)frontAnimState[0xd3] < (int)frontAnimState[0xd1]) { if ((frontAnimState[0x54] != (Menu_Bestiary)0x0) && ((3 < *(int *)((int)frontAnimState[0x53] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)frontAnimState[0x53] + 0x80))))) { MVar8 = frontAnimState[0x54]; local_15c.y = *(float *)((int)MVar8 + 0x44); if ((MVar8 == (Menu_Bestiary)0x0) || (((int)local_15c.y < 0 || (*(int *)((int)MVar8 + 0x1c) <= (int)local_15c.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_15c.y * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(frontAnimState + 0x53),(int)local_15c.y,(float)(int)local_154); } iVar2 = 3; } else { if ((frontAnimState[0x54] != (Menu_Bestiary)0x0) && ((5 < *(int *)((int)frontAnimState[0x53] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)((int)frontAnimState[0x53] + 0x80))))) { MVar8 = frontAnimState[0x54]; local_15c.y = *(float *)((int)MVar8 + 0x4c); if ((MVar8 == (Menu_Bestiary)0x0) || (((int)local_15c.y < 0 || (*(int *)((int)MVar8 + 0x1c) <= (int)local_15c.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_15c.y * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(frontAnimState + 0x53),(int)local_15c.y,(float)(int)local_154); } iVar2 = 5; } local_1a8 = (void *)((float)local_14c + 120.0); local_1b0._4_4_ = local_144 + 340.0; Sprite::RenderLayer((Sprite *)local_16c,iVar2,(Vector *)(local_1b0 + 4),&g_vectorZero, &g_vectorZero); } else { local_1a8 = (void *)(fVar10 + 150.0); local_1b0._4_4_ = fVar12 + 319.0; if (((pvVar6 != (void *)0xffffffe8) && (iVar2 = *(int *)((int)pvVar6 + 0x178), iVar2 != 0)) && (sprite = (ANM2 *)(iVar2 + 0xdf0), *(char *)(iVar2 + 0xef9) != '\0')) { ANM2::SetFrame(sprite,(std_string *)(iVar2 + 0xe08),*(int *)((int)pvVar6 + 0x7c)); Sprite::SetColor((Sprite *)sprite,(ColorMod *)local_15c.y); *(float *)(iVar2 + 0xe8c) = g_vectorOne.x; *(float *)(iVar2 + 0xe90) = g_vectorOne.y; ANM2::Render(sprite,(Vector *)(local_1b0 + 4),&g_vectorZero,&g_vectorZero); } } } else { renderPos.x = fVar12 + 360.0 + *(float *)((int)pvVar6 + 0x104); renderPos.y = fVar10 + 150.0 + *(float *)((int)pvVar6 + 0x108); if (*(char *)(frontAnimState + 0xa8) == '\0') { AnimationState::Render ((AnimationState *)(frontAnimState + 0x98),&renderPos,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(frontAnimState + 0xa0),&renderPos,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render ((AnimationState *)(frontAnimState + 0xa0),&renderPos,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(frontAnimState + 0x98),&renderPos,&g_vectorZero,&g_vectorZero); } } EntityConfig_Entity::GetName((EntityConfig_Entity *)((int)pvVar6 + 0x18),&local_140,0x14); pFVar7 = local_194; local_14 = 1; pbVar5 = (byte *)&local_140; if ((void *)0xf < local_140._capacity) { pbVar5 = (byte *)local_140._buf._0_4_; } uVar1 = Font::get_string_width_n(local_194,pbVar5,-1); fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; if (uVar1 < 0xc9) { local_14 = CONCAT31(local_14._1_3_,3); pbVar5 = (byte *)&local_140; if ((void *)0xf < local_140._capacity) { pbVar5 = (byte *)local_140._buf._0_4_; } local_1c4._red = 0.2; local_1c4._green = 0.2; local_1c4._blue = 0.2; local_1c4._alpha = 1.0; local_144 = local_144 + 360.0; local_1c4._unk = 0; Font::DrawString(pbVar5,&local_1c4,&fontSettings); } else { fVar12 = 200.0 / (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]); local_14 = CONCAT31(local_14._1_3_,2); local_1c4._red = 0.2; local_1c4._green = 0.2; local_1c4._blue = 0.2; local_1c4._alpha = 1.0; pbVar5 = (byte *)&local_140; if ((void *)0xf < local_140._capacity) { pbVar5 = (byte *)local_140._buf._0_4_; } local_1c4._unk = 0; local_144 = local_144 + 360.0; pos.y = (float)local_14c + 160.0 + ((float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) / 200.0 - 1.0) * (float)(ushort)pFVar7->_base; pos.x = local_144; scale.y = fVar12; scale.x = fVar12; Font::DrawString(pFVar7,pbVar5,pos,scale,&local_1c4,&fontSettings); } local_14._0_1_ = 1; local_1b0 = (undefined1 [8])(double)*(float *)((int)pvVar6 + 0x68); string_table_translate(&g_manager->_stringTable,(byte *)"#BESTIARY_HP"); sprintf_s(textBuffer,0x100,(byte *)"%s: %.f"); fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; local_14._0_1_ = 4; local_15c.y = (float)local_14c + 180.0; local_1b0._4_4_ = 0x3f000000; local_1a8 = (void *)0x3f000000; pvVar6 = Font::measure_string (pFVar7,&local_1c4._green,textBuffer,&fontSettings,(Vector *)(local_1b0 + 4)) ; local_14._0_1_ = 5; color._blue = 0.2; color._red = 0.2; color._green = 0.2; color._alpha = 1.0; color._unk = 0; Font::render_glyph_quads(pFVar7,pvVar6,local_144,local_15c.y,0.5,0.5,color,&fontSettings); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14._0_1_ = 1; string_table_translate(&g_manager->_stringTable,(byte *)"#BESTIARY_HITS"); sprintf_s(textBuffer,0x100,(byte *)"%s: %d"); fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; local_14._0_1_ = 6; local_15c.y = (float)local_14c + 190.0; local_1b0._4_4_ = 0x3f000000; local_1a8 = (void *)0x3f000000; pvVar6 = Font::measure_string (pFVar7,&local_1c4._green,textBuffer,&fontSettings,(Vector *)(local_1b0 + 4)) ; local_14._0_1_ = 7; color_00._blue = 0.2; color_00._red = 0.2; color_00._green = 0.2; color_00._alpha = 1.0; color_00._unk = 0; Font::render_glyph_quads(pFVar7,pvVar6,local_144,local_15c.y,0.5,0.5,color_00,&fontSettings); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14._0_1_ = 1; string_table_translate(&g_manager->_stringTable,(byte *)"#BESTIARY_DEATHS"); sprintf_s(textBuffer,0x100,(byte *)"%s: %d"); fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; local_14._0_1_ = 8; local_1c4._red = 0.2; local_1c4._green = 0.2; local_1c4._blue = 0.2; local_1c4._alpha = 1.0; local_1c4._unk = 0; pos_00.y = (float)local_14c + 200.0; pos_00.x = local_144; Font::DrawString(pFVar7,textBuffer,pos_00,(Vector)0x3f0000003f000000,&local_1c4,&fontSettings); local_14._0_1_ = 1; string_table_translate(&g_manager->_stringTable,(byte *)"#BESTIARY_KILLS"); sprintf_s(textBuffer,0x100,(byte *)"%s: %d"); fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; local_14._0_1_ = 9; local_1c4._red = 0.2; local_1c4._green = 0.2; local_1c4._blue = 0.2; local_1c4._alpha = 1.0; local_1c4._unk = 0; pos_01.y = (float)local_14c + 210.0; pos_01.x = local_144; Font::DrawString(pFVar7,textBuffer,pos_01,(Vector)0x3f0000003f000000,&local_1c4,&fontSettings); local_14._0_1_ = 1; string_table_translate(&g_manager->_stringTable,(byte *)"#BESTIARY_ENCOUNTERS"); sprintf_s(textBuffer,0x100,(byte *)"%s: %d"); fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; local_14 = CONCAT31(local_14._1_3_,10); local_1c4._unk = 0; local_1c4._red = 0.2; local_1c4._green = 0.2; local_1c4._blue = 0.2; local_1c4._alpha = 1.0; pos_02.y = (float)local_14c + 220.0; pos_02.x = local_144; Font::DrawString(pFVar7,textBuffer,pos_02,(Vector)0x3f0000003f000000,&local_1c4,&fontSettings); std::string::_Tidy_deallocate(local_140._buf); ExceptionList = local_1c; return; } if ((frontAnimState[0x54] != (Menu_Bestiary)0x0) && ((5 < *(int *)((int)frontAnimState[0x53] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)((int)frontAnimState[0x53] + 0x80) )))) { MVar8 = frontAnimState[0x54]; local_15c.y = *(float *)((int)MVar8 + 0x4c); if ((MVar8 == (Menu_Bestiary)0x0) || (((int)local_15c.y < 0 || (*(int *)((int)MVar8 + 0x1c) <= (int)local_15c.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)frontAnimState[0x55] + (int)local_15c.y * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(frontAnimState + 0x53),(int)local_15c.y,152.0); } renderPos.y = (float)local_14c + 120.0; renderPos.x = local_144 + 340.0; local_14c = (EntityConfig *)renderPos.y; if (frontAnimState[0x89].field_0x1 != '\0') { if (*(char *)(frontAnimState + 99) == '\0') { MVar8 = frontAnimState[0x54]; if (((MVar8 != (Menu_Bestiary)0x0) && (5 < *(int *)((int)frontAnimState[0x53] + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)),&renderPos, *(int *)((int)frontAnimState[0x55] + iVar2 * 4),&g_vectorZero,&g_vectorZero, (ANM2 *)frontAnimState[0x53]); } MVar8 = frontAnimState[0x5c]; if (((MVar8 == (Menu_Bestiary)0x0) || (MVar11 = frontAnimState[0x5b], *(int *)((int)MVar11 + 0x80) < 6)) || (iVar2 = *(int *)((int)MVar8 + 0x4c), iVar2 < 0)) goto LAB_008c7c0b; layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); MVar8 = frontAnimState[0x5d]; } else { MVar8 = frontAnimState[0x5c]; if (((MVar8 != (Menu_Bestiary)0x0) && (5 < *(int *)((int)frontAnimState[0x5b] + 0x80))) && (iVar2 = *(int *)((int)MVar8 + 0x4c), -1 < iVar2)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)),&renderPos, *(int *)((int)frontAnimState[0x5d] + iVar2 * 4),&g_vectorZero,&g_vectorZero, (ANM2 *)frontAnimState[0x5b]); } MVar8 = frontAnimState[0x54]; if (((MVar8 == (Menu_Bestiary)0x0) || (MVar11 = frontAnimState[0x53], *(int *)((int)MVar11 + 0x80) < 6)) || (iVar2 = *(int *)((int)MVar8 + 0x4c), iVar2 < 0)) goto LAB_008c7c0b; layer = (AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)MVar8 + 0x18)); MVar8 = frontAnimState[0x55]; } AnimationLayer::RenderFrame (layer,&renderPos,*(int *)((int)MVar8 + iVar2 * 4),&g_vectorZero,&g_vectorZero, (ANM2 *)MVar11); } LAB_008c7c0b: fontSettings = (FontSettings)0x1; local_184 = 0xffff; local_180 = 0; local_17c = 0x3f800000; local_178 = 0xffffffff; local_174 = 0; local_170 = 0; local_14 = 0; local_1c4._unk = 0; local_1c4._red = 0.2; local_1c4._green = 0.2; local_1c4._blue = 0.2; local_1c4._alpha = 1.0; pbVar5 = string_table_translate(&g_manager->_stringTable,(byte *)"#BESTIARY_UNKNOWN"); Font::DrawString(pbVar5,&local_1c4,&fontSettings); ExceptionList = local_1c; return; } //@@ 008c8760 FUN_008c8760 void FUN_008c8760(void) { Menu_Bestiary *in_ECX; in_ECX[0xd1] = (Menu_Bestiary)0x0; in_ECX[0xd2] = (Menu_Bestiary)0x0; in_ECX[0xda] = (Menu_Bestiary)0x0; in_ECX[0xdb] = (Menu_Bestiary)0x0; in_ECX[0xdc] = (Menu_Bestiary)0x0; in_ECX[0xdd] = (Menu_Bestiary)0x0; Menu_Bestiary::LoadPreview(in_ECX); return; } //@@ 008c87b0 Menu_Bestiary::update_cursor /* DB: ? first call in Menu_Bestiary::Update; counts held frames for input actions 0x14..0x17 (menu directions) via input manager vtable+0x74 into +0x368..+0x374 and moves the grid cursor (+0x344 page/+0x34c index) prototype: db/protos.zhl */ void __thiscall Menu_Bestiary::update_cursor(Menu_Bestiary *this) { char isActionActive; uint uVar1; int iVar2; Menu_Bestiary newPage; Menu_Bestiary *heldFrames; Menu_Bestiary *local_24; undefined4 local_20; Menu_Bestiary local_1c; Menu_Bestiary lastPage; uint repeatDelay; Menu_Bestiary maxCursorIdx; int columns; char local_8 [4]; Menu_Bestiary cursorIdx; cursorIdx = this[0xd3]; iVar2 = (int)this[0xd8] - (int)this[0xd7] >> 2; uVar1 = iVar2 - 1; lastPage = (Menu_Bestiary)((int)cursorIdx + 1 + ((-(uint)(uVar1 != 0) & uVar1) >> 2)); local_1c = (Menu_Bestiary)(((int)this[0xd5] - (int)this[0xd4] >> 2) - 1U & 0x8000000f); if ((int)local_1c < 0) { local_1c = (Menu_Bestiary)(((int)local_1c - 1U | 0xfffffff0) + 1); } newPage = this[0xd1]; repeatDelay = 0xf; if ((int)cursorIdx < (int)newPage) { columns = 2; if (newPage == lastPage) { maxCursorIdx = (Menu_Bestiary)(iVar2 - 1U & 0x80000003); if ((int)maxCursorIdx < 0) { maxCursorIdx = (Menu_Bestiary)(((int)maxCursorIdx - 1U | 0xfffffffc) + 1); } } else { maxCursorIdx = (Menu_Bestiary)0x3; } } else { columns = 4; maxCursorIdx = (Menu_Bestiary)0xf; if (newPage == cursorIdx) { maxCursorIdx = local_1c; } } heldFrames = this + 0xda; local_8[0] = '\x14'; local_8[1] = '\0'; local_8[2] = '\0'; local_8[3] = '\0'; local_24 = this; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0); if (isActionActive == '\0') { *heldFrames = (Menu_Bestiary)0x0; } else { *heldFrames = (Menu_Bestiary)((int)*heldFrames + 1); } local_8[0] = '\x16'; local_8[1] = '\0'; local_8[2] = '\0'; local_8[3] = '\0'; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0); if (isActionActive == '\0') { this[0xdb] = (Menu_Bestiary)0x0; } else { this[0xdb] = (Menu_Bestiary)((int)this[0xdb] + 1); } local_8[0] = '\x15'; local_8[1] = '\0'; local_8[2] = '\0'; local_8[3] = '\0'; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0); if (isActionActive == '\0') { this[0xdc] = (Menu_Bestiary)0x0; } else { this[0xdc] = (Menu_Bestiary)((int)this[0xdc] + 1); } local_8[0] = '\x17'; local_8[1] = '\0'; local_8[2] = '\0'; local_8[3] = '\0'; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0); if (isActionActive == '\0') { this[0xdd] = (Menu_Bestiary)0x0; cursorIdx = (Menu_Bestiary)0x0; } else { this[0xdd] = (Menu_Bestiary)((int)this[0xdd] + 1); cursorIdx = this[0xdd]; } if (*heldFrames == (Menu_Bestiary)0x0) { if (this[0xdc] != (Menu_Bestiary)0x0) { this[0xdd] = (Menu_Bestiary)0x0; *heldFrames = (Menu_Bestiary)0x0; goto LAB_008c89a7; } if (this[0xdb] == (Menu_Bestiary)0x0) { if (cursorIdx != (Menu_Bestiary)0x0) { *heldFrames = (Menu_Bestiary)0x0; goto LAB_008c899d; } } else { this[0xdd] = (Menu_Bestiary)0x0; this[0xdc] = (Menu_Bestiary)0x0; *heldFrames = (Menu_Bestiary)0x0; } } else { this[0xdd] = (Menu_Bestiary)0x0; LAB_008c899d: this[0xdc] = (Menu_Bestiary)0x0; LAB_008c89a7: this[0xdb] = (Menu_Bestiary)0x0; } iVar2 = 0; local_8[0] = '\0'; local_8[1] = '\0'; local_8[2] = '\0'; local_8[3] = '\0'; do { cursorIdx = *heldFrames; if ((((cursorIdx != (Menu_Bestiary)0x0) && ((uint)cursorIdx % repeatDelay == 0)) || ((0x3c < (uint)cursorIdx && ((uint)cursorIdx % 10 == 0)))) || ((0xb4 < (uint)cursorIdx && ((uint)cursorIdx % 5 == 0)))) { local_8[iVar2] = '\x01'; } iVar2 = iVar2 + 1; heldFrames = heldFrames + 1; } while (iVar2 < 4); local_20 = 0x14; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_20,0,0) ; heldFrames = local_24; if ((isActionActive == '\0') && (local_8[0] == '\0')) { local_24 = (Menu_Bestiary *)0x15; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0); if ((isActionActive != '\0') || (local_8[2] != '\0')) { newPage = heldFrames[0xd2]; cursorIdx = (Menu_Bestiary)((int)newPage + 1); heldFrames[0xd2] = cursorIdx; if (((int)cursorIdx <= (int)maxCursorIdx) && ((int)cursorIdx % columns != 0)) { return; } if ((int)lastPage <= (int)heldFrames[0xd1]) { heldFrames[0xd2] = newPage; return; } cursorIdx = (Menu_Bestiary)((int)cursorIdx - columns); newPage = (Menu_Bestiary)((int)heldFrames[0xd1] + 1); heldFrames[0xd1] = newPage; heldFrames[0xd2] = cursorIdx; if (newPage == (Menu_Bestiary)((int)heldFrames[0xd3] + 1)) { LAB_008c8be2: heldFrames[0xd2] = (Menu_Bestiary)0x0; return; } if (newPage == lastPage) { uVar1 = (int)heldFrames[0xd8] - (int)heldFrames[0xd7] >> 2 & 0x80000003; if ((int)uVar1 < 0) { uVar1 = (uVar1 - 1 | 0xfffffffc) + 1; } if ((int)uVar1 <= (int)cursorIdx) goto LAB_008c8be2; } if (newPage != heldFrames[0xd3]) { return; } if ((int)local_1c < (int)cursorIdx) { cursorIdx = local_1c; } heldFrames[0xd2] = cursorIdx; return; } local_24 = (Menu_Bestiary *)0x16; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0); if ((isActionActive == '\0') && (local_8[1] == '\0')) { local_24 = (Menu_Bestiary *)0x17; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0); if ((isActionActive == '\0') && (local_8[3] == '\0')) { local_24 = (Menu_Bestiary *)0xf; isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0); if (isActionActive == '\0') { return; } FUN_0098aec0(); return; } cursorIdx = heldFrames[0xd2]; if (columns + -1 <= (int)cursorIdx / columns) { return; } heldFrames[0xd2] = (Menu_Bestiary)((int)cursorIdx + columns); if ((int)maxCursorIdx < (int)cursorIdx + columns) { heldFrames[0xd2] = cursorIdx; return; } return; } if ((int)heldFrames[0xd2] / columns < 1) { return; } newPage = (Menu_Bestiary)((int)heldFrames[0xd2] - columns); } else { newPage = local_24[0xd2]; cursorIdx = (Menu_Bestiary)((int)newPage + -1); local_24[0xd2] = cursorIdx; if ((-1 < (int)cursorIdx) && ((int)cursorIdx % columns != columns + -1)) { return; } if (0 < (int)local_24[0xd1]) { newPage = (Menu_Bestiary)((int)local_24[0xd1] + -1); local_24[0xd1] = newPage; local_24[0xd2] = (Menu_Bestiary)((int)cursorIdx + columns); if (newPage == local_24[0xd3]) { local_24[0xd2] = local_1c; return; } return; } } heldFrames[0xd2] = newPage; return; } //@@ 008c8c70 Menu_Bestiary::LoadPreview /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Menu_Bestiary::LoadPreview(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Bestiary::LoadPreview(Menu_Bestiary *this) { byte bVar1; int iVar2; LayerState *pLVar3; byte *pbVar4; void *ptr; byte *pbVar5; LayerState *pLVar6; uint uVar7; char *pcVar8; void *entityEntry; EntityConfig *entityConfig; Menu_Bestiary MVar9; ANM2 *pAVar10; ANM2 *pAVar11; bool bVar12; undefined4 local_bc [8]; undefined4 local_9c; undefined4 uStack_98; undefined4 local_94; LayerState *local_90; char *local_8c; Menu_Bestiary *menu; Menu_Bestiary layerIdx; Menu_Bestiary local_80; char isBrightLayer; LayerState *local_78; LayerState *cleanupFlags; ANM2 *previewSprite; void *resolvedPath [5]; uint resolvedPathCapacity; char *layerString [4]; uint layerStringSize; uint layerStringCapacity; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; puStack_20 = (undefined1 *)(layerString + 0x14); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b057ee; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(layerString + 0x11); ExceptionList = &local_1c; cleanupFlags = (LayerState *)0x0; local_90 = (LayerState *)0x0; previewSprite = (ANM2 *)(this + 0x8c); menu = this; ANM2::Reset(previewSprite); entityConfig = &g_manager->_entityConfig; MVar9 = this[0xd1]; if ((int)this[0xd3] < (int)MVar9) { if (this[0xd7] != this[0xd8]) { local_80 = (Menu_Bestiary) ((int)this[0xd7] + ((int)this[0xd2] + ((int)MVar9 - (int)this[0xd3]) * 4 + -4) * 4) ; goto LAB_008c8d25; } LAB_008c8d47: entityEntry = (entityConfig->_entities)._head; } else { if (this[0xd4] == this[0xd5]) goto LAB_008c8d47; local_80 = (Menu_Bestiary)((int)this[0xd4] + ((int)MVar9 * 0x10 + (int)this[0xd2]) * 4); LAB_008c8d25: _Find_lower_bound<>(local_3c._buf + 0xc,local_80); if ((*(char *)(local_3c._capacity + 0xd) != '\0') || (entityEntry = (void *)local_3c._capacity, *(uint *)local_80 < *(uint *)(local_3c._capacity + 0x10))) goto LAB_008c8d47; } if (entityEntry == (entityConfig->_entities)._head) { ExceptionList = local_1c; return; } if (*(int *)((int)entityEntry + 0x138) == 0) { ExceptionList = local_1c; return; } iVar2 = 0x110; if (*(int *)((int)entityEntry + 0x120) == 0) { iVar2 = 0x8c; } ANM2::Load(previewSprite,(std_string *)(iVar2 + (int)entityEntry),0); if ((*(int *)((int)entityEntry + 0x168) != 0) && (MVar9 = (Menu_Bestiary)0x0, menu[0xac] != (Menu_Bestiary)0x0)) { do { pLVar3 = ANM2::GetLayer(previewSprite,(byte *)MVar9); local_3c._capacity = 0xf; local_3c._size = 0; local_3c._buf._0_4_ = (LayerState *)0x0; local_14 = (char *)0x0; cleanupFlags = (LayerState *)((uint)cleanupFlags | 4); if (pLVar3->_layerData == (void *)0x0) { layerStringCapacity = 0xf; layerStringSize = 0; layerString[0] = (char *)0x0; } else { std::string::string((char *)layerString,(void *)((int)pLVar3->_layerData + 0x20)); } local_14._0_1_ = 1; anm2_resolve_spritesheet_path((int)entityEntry + 0x158,&local_3c,0); local_14._0_1_ = 3; if (0xf < layerStringCapacity) { uVar7 = layerStringCapacity + 1; pcVar8 = layerString[0]; if (0xfff < uVar7) { pcVar8 = *(char **)(layerString[0] + -4); uVar7 = layerStringCapacity + 0x24; if ((char *)0x1f < layerString[0] + (-4 - (int)pcVar8)) goto LAB_008c9312; } operator_delete(pcVar8,uVar7); } local_14._0_1_ = 4; if ((void *)0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; pLVar3 = (LayerState *)local_3c._buf._0_4_; if (0xfff < uVar7) { pLVar3 = (LayerState *)((LayerState *)(local_3c._buf._0_4_ + -0x9c))->_spriteSheet; uVar7 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pLVar3))) goto LAB_008c9312; } operator_delete(pLVar3,uVar7); } Sprite::ReplaceSpritesheet((Sprite *)previewSprite,(int)MVar9,(std_string *)resolvedPath); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < resolvedPathCapacity) { uVar7 = resolvedPathCapacity + 1; ptr = resolvedPath[0]; if (0xfff < uVar7) { ptr = *(void **)((int)resolvedPath[0] + -4); uVar7 = resolvedPathCapacity + 0x24; if (0x1f < (uint)((int)resolvedPath[0] + (-4 - (int)ptr))) goto LAB_008c9312; } operator_delete(ptr,uVar7); } MVar9 = (Menu_Bestiary)((int)MVar9 + 1); } while ((uint)MVar9 < (uint)menu[0xac]); } if ((((*(int *)((int)entityEntry + 0x18) == 0x110) || (*(int *)((int)entityEntry + 0x18) == 0x10f) ) && (*(int *)((int)entityEntry + 0x1c) == 1)) && (layerIdx = (Menu_Bestiary)0x0, menu[0xac] != (Menu_Bestiary)0x0)) { do { pLVar3 = ANM2::GetLayer(previewSprite,(byte *)layerIdx); cleanupFlags = (LayerState *)((uint)cleanupFlags | 8); if (pLVar3->_layerData == (void *)0x0) { local_3c._capacity = 0xf; local_3c._size = 0; local_3c._buf._0_4_ = (LayerState *)0x0; } else { std::string::string(local_3c._buf,(void *)((int)pLVar3->_layerData + 0x20)); } local_14 = (char *)0x5; local_90 = (LayerState *)&local_3c; if ((void *)0xf < local_3c._capacity) { local_90 = (LayerState *)local_3c._buf._0_4_; } local_78 = (LayerState *)local_3c._buf._0_4_; if (4 < local_3c._size) { local_8c = (local_90->_spriteSheetPath)._buf + (local_3c._size - 0xc); for (pbVar4 = memchr(local_90,0x41,(int)local_8c - (int)local_90); pbVar4 != (byte *)0x0; pbVar4 = memchr(pbVar4 + 1,0x41,(int)local_8c - (int)(pbVar4 + 1))) { local_80 = (Menu_Bestiary)0x1; pcVar8 = "Angel"; pbVar5 = pbVar4; if (*(int *)pbVar4 == 0x65676e41) { pbVar5 = pbVar4 + 4; local_80 = (Menu_Bestiary)0xfffffffd; pcVar8 = "l"; } bVar12 = *pbVar5 < (byte)*pcVar8; if ((*pbVar5 == *pcVar8) && ((local_80 == (Menu_Bestiary)0xfffffffd || (((bVar12 = pbVar5[1] < (byte)pcVar8[1], pbVar5[1] == pcVar8[1] && (bVar12 = pbVar5[2] < (byte)pcVar8[2], pbVar5[2] == pcVar8[2])) && (bVar12 = pbVar5[3] < (byte)pcVar8[3], pbVar5[3] == pcVar8[3])))))) { uVar7 = 0; } else { uVar7 = -(uint)bVar12 | 1; } if (uVar7 == 0) { if ((int)pbVar4 - (int)local_90 != -1) { uVar7 = local_3c._size - 4; if (local_3c._size < uVar7) { std::string::append_n(local_3c._buf,uVar7 - local_3c._size,0); } else { pLVar3 = (LayerState *)&local_3c; if ((void *)0xf < local_3c._capacity) { pLVar3 = local_78; } iVar2 = local_3c._size - 0xc; local_3c._size = uVar7; (pLVar3->_spriteSheetPath)._buf[iVar2] = '\0'; } std::string::append(local_3c._buf,(byte *)"Black.png",9); MVar9 = layerIdx; Sprite::ReplaceSpritesheet((Sprite *)previewSprite,(int)layerIdx,&local_3c); pLVar3 = (LayerState *)local_3c._buf._0_4_; goto LAB_008c9015; } break; } } } pLVar3 = local_78; MVar9 = layerIdx; LAB_008c9015: local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if ((void *)0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; pLVar6 = pLVar3; if (0xfff < uVar7) { pLVar6 = (LayerState *)pLVar3[-1]._spriteSheet; uVar7 = local_3c._capacity + 0x24; if (0x1f < (uint)((int)pLVar3 + (-4 - (int)pLVar6))) goto LAB_008c9312; } operator_delete(pLVar6,uVar7); } layerIdx = (Menu_Bestiary)((int)MVar9 + 1); } while ((uint)layerIdx < (uint)menu[0xac]); } local_80 = (Menu_Bestiary)0x0; if (menu[0xac] != (Menu_Bestiary)0x0) { do { pLVar3 = ANM2::GetLayer(previewSprite,(byte *)local_80); cleanupFlags = (LayerState *)((uint)cleanupFlags | 0x10); local_78 = pLVar3; if (pLVar3->_layerData == (void *)0x0) { layerStringCapacity = 0xf; layerStringSize = 0; layerString[0] = (char *)0x0; } else { std::string::string((char *)layerString,(void *)((int)pLVar3->_layerData + 8)); } local_14._0_1_ = 6; local_14._1_3_ = 0; local_90 = (LayerState *)((uint)cleanupFlags | 1); pcVar8 = (char *)layerString; if (0xf < layerStringCapacity) { pcVar8 = layerString[0]; } local_8c = layerString[0]; cleanupFlags = local_90; bVar1 = str_eq((byte *)pcVar8,layerStringSize,&DAT_00b64428,4); if (bVar1 == 0) { cleanupFlags = (LayerState *)((uint)cleanupFlags | 0x20); if (pLVar3->_layerData == (void *)0x0) { local_3c._capacity = 0xf; local_3c._buf._0_4_ = (LayerState *)0x0; local_3c._size = 0; } else { std::string::string(local_3c._buf,(void *)((int)pLVar3->_layerData + 8)); } pLVar3 = (LayerState *)local_3c._buf._0_4_; cleanupFlags = (LayerState *)((uint)cleanupFlags | 2); pLVar6 = (LayerState *)&local_3c; if ((void *)0xf < local_3c._capacity) { pLVar6 = (LayerState *)local_3c._buf._0_4_; } bVar1 = str_eq((byte *)pLVar6,local_3c._size,&DAT_00b1d57c,4); if (bVar1 != 0) goto LAB_008c91ab; isBrightLayer = '\0'; } else { pLVar3 = (LayerState *)local_3c._buf._0_4_; LAB_008c91ab: isBrightLayer = '\x01'; } if ((((uint)cleanupFlags & 2) != 0) && (cleanupFlags = (LayerState *)((uint)cleanupFlags & 0xfffffffd), (void *)0xf < local_3c._capacity)) { uVar7 = local_3c._capacity + 1; pLVar6 = pLVar3; if (0xfff < uVar7) { pLVar6 = (LayerState *)pLVar3[-1]._spriteSheet; uVar7 = local_3c._capacity + 0x24; if (0x1f < (uint)((int)pLVar3 + (-4 - (int)pLVar6))) { LAB_008c9312: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pLVar6,uVar7); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if ((((uint)cleanupFlags & 1) != 0) && (cleanupFlags = (LayerState *)((uint)cleanupFlags & 0xfffffffe), 0xf < layerStringCapacity) ) { uVar7 = layerStringCapacity + 1; pcVar8 = local_8c; if (0xfff < uVar7) { pcVar8 = *(char **)(local_8c + -4); uVar7 = layerStringCapacity + 0x24; if ((char *)0x1f < local_8c + (-4 - (int)pcVar8)) goto LAB_008c9312; } operator_delete(pcVar8,uVar7); } if (isBrightLayer != '\0') { local_9c = 0; uStack_98 = 0; local_94 = 0; if (&local_78->_color != (ColorMod *)local_bc) { (local_78->_color)._colorize[0] = 0.0; (local_78->_color)._colorize[1] = 0.0; (local_78->_color)._colorize[2] = 0.0; (local_78->_color)._colorize[3] = 0.0; (local_78->_color)._offset[0] = 0.0; (local_78->_color)._offset[1] = 0.0; (local_78->_color)._tint[0] = 1.8203125; (local_78->_color)._tint[1] = 1.703125; (local_78->_color)._tint[2] = 1.7421875; (local_78->_color)._tint[3] = 1.0; (local_78->_color)._offset[2] = 0.0; } } local_80 = (Menu_Bestiary)((int)local_80 + 1); } while ((uint)local_80 < (uint)menu[0xac]); } pAVar11 = previewSprite; MVar9 = (Menu_Bestiary)0x60; if (*(int *)((int)entityEntry + 0x18) != 0x3b6) { MVar9 = (Menu_Bestiary)0x0; } menu[0xd0] = MVar9; ANM2::LoadGraphics(previewSprite,(byte)menu); pAVar10 = previewSprite; local_78 = (LayerState *)((int)entityEntry + 0x128); if (0xf < *(uint *)((int)entityEntry + 0x13c)) { local_78 = *(LayerState **)local_78; } pbVar4 = (pAVar11->_animState)._animData; if (pbVar4 == (byte *)0x0) { LAB_008c9339: bVar1 = ANM2::SetAnimation(previewSprite,(byte *)local_78,1); if (bVar1 != 0) { AnimationState::Rewind(&pAVar10->_animState); (pAVar10->_animState)._isPlaying = 1; pAVar10 = previewSprite; } } else { pbVar5 = pbVar4; pLVar3 = local_78; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar5 = *(byte **)pbVar4; } do { bVar1 = *pbVar5; bVar12 = bVar1 < *(byte *)pLVar3; if (bVar1 != *(byte *)pLVar3) { LAB_008c9318: uVar7 = -(uint)bVar12 | 1; goto LAB_008c931d; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar12 = bVar1 < *(byte *)((int)pLVar3 + 1); if (bVar1 != *(byte *)((int)pLVar3 + 1)) goto LAB_008c9318; pbVar5 = pbVar5 + 2; pLVar3 = (LayerState *)((int)pLVar3 + 2); } while (bVar1 != 0); uVar7 = 0; LAB_008c931d: if ((uVar7 != 0) || ((pbVar4[0x34] != 0 && ((previewSprite->_animState)._isPlaying == 0)))) goto LAB_008c9339; } pAVar11 = previewSprite; if (*(int *)((int)entityEntry + 0x150) != 0) { local_78 = (LayerState *)((int)entityEntry + 0x140); if (0xf < *(uint *)((int)entityEntry + 0x154)) { local_78 = *(LayerState **)local_78; } pbVar4 = (pAVar10->_overlayAnimState)._animData; if (pbVar4 != (byte *)0x0) { pbVar5 = pbVar4; pLVar3 = local_78; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar5 = *(byte **)pbVar4; } do { bVar1 = *pbVar5; bVar12 = bVar1 < *(byte *)pLVar3; if (bVar1 != *(byte *)pLVar3) { LAB_008c93b0: uVar7 = -(uint)bVar12 | 1; goto LAB_008c93b5; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar12 = bVar1 < *(byte *)((int)pLVar3 + 1); if (bVar1 != *(byte *)((int)pLVar3 + 1)) goto LAB_008c93b0; pbVar5 = pbVar5 + 2; pLVar3 = (LayerState *)((int)pLVar3 + 2); } while (bVar1 != 0); uVar7 = 0; LAB_008c93b5: if ((uVar7 == 0) && ((pbVar4[0x34] == 0 || ((previewSprite->_overlayAnimState)._isPlaying != 0)))) goto LAB_008c93f3; } bVar1 = ANM2::SetOverlayAnimation(previewSprite,(byte *)local_78,1); pAVar10 = previewSprite; if (bVar1 != 0) { AnimationState::Rewind(&previewSprite->_overlayAnimState); (pAVar10->_overlayAnimState)._isPlaying = 1; pAVar11 = pAVar10; } } LAB_008c93f3: MVar9 = (Menu_Bestiary)(*(float *)((int)entityEntry + 0x10c) * g_vectorOne.y); menu[0xb3] = (Menu_Bestiary)(*(float *)((int)entityEntry + 0x10c) * g_vectorOne.x); menu[0xb4] = MVar9; pLVar3 = ANM2::GetLayer(pAVar11,(byte *)"shadow"); if (pLVar3 != (LayerState *)0x0) { pLVar3->_visible = 0; } ExceptionList = local_1c; return; } //@@ 008c9460 FUN_008c9460 void FUN_008c9460(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11c0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; tracked_alloc(1,(void *)*in_ECX,0); ExceptionList = local_10; return; } //@@ 008c94b0 FUN_008c94b0 void FUN_008c94b0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; FUN_008c9e10(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x10)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x60)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x40)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x28)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); ExceptionList = local_10; return; } //@@ 008c9530 Menu_ControllerSelect::Update /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: MenuManager::Update case 0xb (CONTROLS) between Menu_Options (10) and Menu_KeyConfig (12); +0x119 sprite flag like the Render 008c99b0; KAGE::Input::Manager::get_device, MenuManager::push_menu */ void Menu_ControllerSelect::Update(void) { qword qVar1; char cVar2; uint uVar3; byte *buffer; int iVar4; int *in_ECX; int *extraout_ECX; int *piVar5; byte *pbVar6; qword *allocCounter; void *historyEnd; byte *newEntry; int deviceId; int *device; int *deviceRefCount; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte ch; undefined4 *entriesEnd; MenuManager *menuManager; int *selection; local_8 = 0xffffffff; puStack_c = &LAB_00b05835; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar5 = in_ECX; if (*(char *)((int)in_ECX + 0x119) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x10)); AnimationState::Update((AnimationState *)(in_ECX + 0x18)); piVar5 = extraout_ECX; } FUN_008ca0a0(piVar5,uVar3); in_ECX[0x4a] = in_ECX[0x49]; (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff); uVar3 = DAT_00c57b24 - _DAT_00c57b20 >> 3; local_8 = 0; local_18 = uVar3; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_14 = 0; if (uVar3 != 0) { do { local_8 = 0xffffffff; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&device,local_14); local_8 = 1; if (device == (int *)0x0) { local_8 = 2; if (((deviceRefCount != (int *)0x0) && (cVar2 = (**(code **)(*deviceRefCount + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } } else { buffer = operator_new_tracked(0x40); deviceId = 0; *buffer = 0; local_8 = CONCAT31(local_8._1_3_,3); newEntry = buffer; (**(code **)(*device + 0xc))(); sprintf_s(buffer,0x40,&DAT_00b62fdc); pbVar6 = buffer; do { ch = *pbVar6; pbVar6 = pbVar6 + 1; } while (ch != 0); if (0x12 < (uint)((int)pbVar6 - (int)(buffer + 1))) { buffer[0x10] = 0x2e; buffer[0x11] = 0x2e; buffer[0x12] = 0; } entriesEnd = (undefined4 *)in_ECX[0x4a]; deviceId = device[3]; if (entriesEnd == (undefined4 *)in_ECX[0x4b]) { FUN_008c9e90(entriesEnd,&newEntry); iVar4 = in_ECX[0x4a]; buffer = newEntry; } else { entriesEnd[1] = deviceId; pbVar6 = operator_new_tracked(0x40); *entriesEnd = pbVar6; sprintf_s(pbVar6,0x40,&DAT_00b62fdc); in_ECX[0x4a] = in_ECX[0x4a] + 8; iVar4 = in_ECX[0x4a]; } if (5 < (uint)(iVar4 - in_ECX[0x49] >> 3)) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (buffer != (byte *)0x0) { uVar3 = *(uint *)(buffer + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free(buffer + -4); } local_8 = 5; if (((deviceRefCount != (int *)0x0) && (cVar2 = (**(code **)(*deviceRefCount + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } break; } if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (buffer != (byte *)0x0) { uVar3 = *(uint *)(buffer + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar3); free(buffer + -4); } local_8 = 7; if (((deviceRefCount != (int *)0x0) && (cVar2 = (**(code **)(*deviceRefCount + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } uVar3 = local_18; } local_14 = local_14 + 1; } while (local_14 < uVar3); } local_8 = 0xffffffff; piVar5 = in_ECX + 0x49; uVar3 = in_ECX[0x4a] - *piVar5 >> 3; if (uVar3 <= (uint)in_ECX[1]) { in_ECX[1] = uVar3 - 1; } local_18 = 0xe; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_18,0,0); if (cVar2 == '\0') { local_18 = 0xf; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_18,0,0); menuManager = g_menuManager; if (cVar2 == '\0') { local_18 = 0x17; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_18,0,0); if (cVar2 == '\0') { local_18 = 0x16; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_18,0,0); if ((cVar2 != '\0') && ((iVar4 = *in_ECX, iVar4 == 0 || ((0x31 < iVar4 && (iVar4 % 10 == 0)))))) { selection = in_ECX + 1; *selection = *selection + -1; if (*selection < 0) { in_ECX[1] = (in_ECX[0x4a] - *piVar5 >> 3) + -1; } } } else { iVar4 = *in_ECX; if (((iVar4 == 0) || ((0x31 < iVar4 && (iVar4 % 10 == 0)))) && (in_ECX[1] = in_ECX[1] + 1, in_ECX[0x4a] - *piVar5 >> 3 <= in_ECX[1])) { in_ECX[1] = 0; } } } else { historyEnd = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)historyEnd - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { historyEnd = (void *)((int)historyEnd + -4); (g_menuManager->_menuStateHistory)._end = historyEnd; } MenuManager::SetState(menuManager,*(int *)((int)historyEnd + -4),0); } } else { g_menuControllerIndex = *(int *)(*piVar5 + 4 + in_ECX[1] * 8); MenuManager::push_menu(0xc,in_ECX[1]); g_manager->_isHotkeysEnabled = 0; } local_18 = 0x16; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_18,0,0); if (cVar2 == '\0') { local_14 = 0x17; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_14,0,0); if (cVar2 == '\0') { *in_ECX = 0; ExceptionList = local_10; return; } } *in_ECX = *in_ECX + 1; ExceptionList = local_10; return; } //@@ 008c99b0 Menu_ControllerSelect::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? in MenuManager::Render list with MenuManager+0xd154 */ void __thiscall Menu_ControllerSelect::Render(Menu_ControllerSelect *this) { byte *text; KColor color; LayerState *cursorLayer; void *pvVar1; void *layerFrames; AnimationState *secondAnimState; int iVar2; byte *textEnd; uint row; Font *font; undefined1 glyphRun [16]; undefined4 fontParams; undefined4 local_144; undefined4 local_140; undefined4 local_13c; undefined4 local_138; undefined4 local_134; undefined4 local_130; float textX; float textY; float listY; float listX; Vector renderPos; byte nameText [256]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; ANM2 *animation; byte ch; local_8 = 0xffffffff; puStack_c = &LAB_00b0587b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(nameText + 0x110); ExceptionList = &local_10; cursorLayer = ANM2::GetLayer(&this->ControllerSelectSprite,(byte *)0x2); cursorLayer->_visible = 0; renderPos.x = (g_menuManager->_ViewPosition).x + this->PositionX; renderPos.y = (g_menuManager->_ViewPosition).y + this->PositionY; if ((this->ControllerSelectSprite)._loaded != 0) { if ((this->ControllerSelectSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->ControllerSelectSprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->ControllerSelectSprite)._overlayAnimState; } else { AnimationState::Render (&(this->ControllerSelectSprite)._overlayAnimState,&renderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->ControllerSelectSprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } row = 0; iVar2 = this[1].HoldInputTimer; if (this[1].SelectedElement - iVar2 >> 3 != 0) { listX = (g_menuManager->_ViewPosition).x + this->PositionX + 265.0; listY = (g_menuManager->_ViewPosition).y + this->PositionY + 60.0; do { text = *(byte **)(iVar2 + row * 8); if (text == (byte *)0x0) { iVar2 = 0; } else { textEnd = text; do { ch = *textEnd; textEnd = textEnd + 1; } while (ch != 0); iVar2 = (int)textEnd - (int)(text + 1); } text_convert_encoding(text,iVar2,0,nameText,0x80,1); font = &g_manager->_font2_TeamMeatEx12; if (*(int *)&g_manager->_stringTable == 0) { font = &g_manager->_font1_TeamMeatEx10; } fontParams = 0; local_144 = 0xffff; local_140 = 0; local_13c = 0x3f800000; local_138 = 0xffffffff; local_134 = 0; local_130 = 0; local_8 = 0; textY = (float)((double)(int)row + __uint_to_double_fixup[-((int)row >> 0x1f)]) * 20.0 + listY ; textX = listX - (float)((double)(int)row + __uint_to_double_fixup[-((int)row >> 0x1f)]) * 4.0; pvVar1 = Font::layout_glyphs(font,glyphRun,nameText,&fontParams,&g_vectorOne); local_8 = CONCAT31(local_8._1_3_,1); color._blue = 0.1764706; color._red = 0.21176471; color._green = 0.18431373; color._alpha = 1.0; color._unk = 0; Font::draw_glyph_run(font,textX,textY,pvVar1,1.0,1.0,color,&fontParams); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_8 = 0xffffffff; row = row + 1; iVar2 = this[1].HoldInputTimer; } while (row < (uint)(this[1].SelectedElement - iVar2 >> 3)); } cursorLayer = ANM2::GetLayer(&this->ControllerSelectSprite,(byte *)0x2); cursorLayer->_visible = 1; renderPos.x = ((g_menuManager->_ViewPosition).x + this->PositionX) - (float)this->SelectedElement * 4.0; renderPos.y = (g_menuManager->_ViewPosition).y + this->PositionY + (float)this->SelectedElement * 20.0; if ((this->ControllerSelectSprite)._loaded != 0) { if ((this->ControllerSelectSprite)._overlayRenderFirst == 0) { pvVar1 = (this->ControllerSelectSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (animation = (this->ControllerSelectSprite)._animState._animation, 2 < animation->_layerCount)) && (iVar2 = *(int *)((int)pvVar1 + 0x40), -1 < iVar2)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&renderPos, *(int *)((int)(this->ControllerSelectSprite)._animState._layerFrames + iVar2 * 4) ,&g_vectorZero,&g_vectorZero,animation); } pvVar1 = (this->ControllerSelectSprite)._overlayAnimState._animData; if (pvVar1 == (void *)0x0) { ExceptionList = local_10; return; } animation = (this->ControllerSelectSprite)._overlayAnimState._animation; if (animation->_layerCount < 3) { ExceptionList = local_10; return; } iVar2 = *(int *)((int)pvVar1 + 0x40); if (iVar2 < 0) { ExceptionList = local_10; return; } layerFrames = (this->ControllerSelectSprite)._overlayAnimState._layerFrames; } else { pvVar1 = (this->ControllerSelectSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (animation = (this->ControllerSelectSprite)._overlayAnimState._animation, 2 < animation->_layerCount)) && (iVar2 = *(int *)((int)pvVar1 + 0x40), -1 < iVar2)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&renderPos, *(int *)((int)(this->ControllerSelectSprite)._overlayAnimState._layerFrames + iVar2 * 4),&g_vectorZero,&g_vectorZero,animation); } pvVar1 = (this->ControllerSelectSprite)._animState._animData; if (pvVar1 == (void *)0x0) { ExceptionList = local_10; return; } animation = (this->ControllerSelectSprite)._animState._animation; if (animation->_layerCount < 3) { ExceptionList = local_10; return; } iVar2 = *(int *)((int)pvVar1 + 0x40); if (iVar2 < 0) { ExceptionList = local_10; return; } layerFrames = (this->ControllerSelectSprite)._animState._layerFrames; } AnimationLayer::RenderFrame ((AnimationLayer *)(iVar2 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&renderPos, *(int *)((int)layerFrames + iVar2 * 4),&g_vectorZero,&g_vectorZero,animation); } ExceptionList = local_10; return; } //@@ 008c9dd0 FUN_008c9dd0 void FUN_008c9dd0(void) { undefined4 *in_ECX; in_ECX[1] = 0; FUN_008ca0a0(); in_ECX[0x4a] = in_ECX[0x49]; *in_ECX = 0; return; } //@@ 008c9e10 FUN_008c9e10 void FUN_008c9e10(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_008ca0a0(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008c9e70 FUN_008c9e70 void FUN_008c9e70(void) { FUN_008ca0a0(); return; } //@@ 008c9e90 FUN_008c9e90 undefined4 * FUN_008c9e90(int param_1,int param_2) { uint uVar1; undefined4 *puVar2; void *pvVar3; int iVar4; undefined4 *puVar5; byte *pbVar6; void *ptr; int *in_ECX; uint uVar7; int extraout_ECX; undefined4 *puVar8; int iVar9; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b058bd; local_10 = ExceptionList; ExceptionList = &local_10; iVar9 = *in_ECX; iVar4 = in_ECX[1] - iVar9 >> 3; if (iVar4 == 0x1fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar4 + 1; uVar7 = in_ECX[2] - iVar9 >> 3; if (0x1fffffff - (uVar7 >> 1) < uVar7) { local_20 = 0x1fffffff; } else { uVar7 = (uVar7 >> 1) + uVar7; local_20 = uVar1; if (uVar1 <= uVar7) { local_20 = uVar7; } if (0x1fffffff < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar5 = std::_Allocate(local_20 << 3); local_8 = 0; puVar2 = puVar5 + (param_1 - iVar9 >> 3) * 2; puVar2[1] = *(undefined4 *)(param_2 + 4); pbVar6 = operator_new_tracked(0x40); *puVar2 = pbVar6; sprintf_s(pbVar6,0x40,&DAT_00b62fdc); iVar9 = *in_ECX; iVar4 = in_ECX[1]; if (param_1 == iVar4) { local_8 = CONCAT31(local_8._1_3_,1); puVar8 = puVar5; for (; iVar9 != iVar4; iVar9 = iVar9 + 8) { puVar8[1] = *(undefined4 *)(iVar9 + 4); pbVar6 = operator_new_tracked(0x40); *puVar8 = pbVar6; sprintf_s(pbVar6,0x40,&DAT_00b62fdc); puVar8 = puVar8 + 2; param_1 = extraout_ECX; } FUN_008ca0a0(param_1); } else { FUN_008ca120(iVar9,param_1,puVar5); FUN_008ca120(param_1,in_ECX[1],puVar2 + 2); } if (*in_ECX != 0) { FUN_008ca0a0(*in_ECX); pvVar3 = (void *)*in_ECX; uVar7 = in_ECX[2] - (int)pvVar3 & 0xfffffff8; ptr = pvVar3; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar3 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)puVar5; in_ECX[1] = (int)(puVar5 + uVar1 * 2); in_ECX[2] = (int)(puVar5 + local_20 * 2); ExceptionList = local_10; return puVar2; } //@@ 008ca06f Catch_All@008ca06f void Catch_All_008ca06f(void) { int unaff_EBP; FUN_008c9e70(*(undefined4 *)(unaff_EBP + -0x18),*(undefined4 *)(unaff_EBP + -0x2c)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 008ca0a0 FUN_008ca0a0 void FUN_008ca0a0(void) { int iVar1; uint uVar2; qword qVar3; void *pvVar4; int *in_ECX; int *in_EDX; qword *pqVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; if (in_ECX != in_EDX) { pvVar4 = g_mainHeap; do { iVar1 = *in_ECX; pqVar5 = (qword *)((int)pvVar4 + 0x30); if (pvVar4 == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } if (iVar1 != 0) { uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); pvVar4 = g_mainHeap; } in_ECX = in_ECX + 2; } while (in_ECX != in_EDX); } ExceptionList = local_10; return; } //@@ 008ca120 FUN_008ca120 undefined4 * FUN_008ca120(int param_1,int param_2,undefined4 *param_3) { void **ppvVar1; uint uVar2; byte *buffer; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b058ed; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 8) { param_3[1] = *(undefined4 *)(param_1 + 4); buffer = operator_new_tracked(0x40); *param_3 = buffer; sprintf_s(buffer,0x40,&DAT_00b62fdc); param_3 = param_3 + 2; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_008ca0a0(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 008ca1c0 FUN_008ca1c0 void FUN_008ca1c0(void) { FUN_008ca0a0(); return; } //@@ 008ca1d0 FUN_008ca1d0 uint FUN_008ca1d0(int param_1,int param_2,int param_3) { int *piVar1; int in_ECX; int *piVar2; uint uVar3; uint uVar4; uVar4 = 0; piVar2 = (int *)(in_ECX + (param_3 + 1) * 0x34); piVar1 = (int *)*piVar2; uVar3 = piVar2[1] - (int)piVar1 >> 3; if (uVar3 != 0) { do { if ((*piVar1 == param_1) && (piVar1[1] == param_2)) { return CONCAT31((int3)((uint)piVar1 >> 8),1); } uVar4 = uVar4 + 1; piVar1 = piVar1 + 2; } while (uVar4 < uVar3); } return (uint)piVar1 & 0xffffff00; } //@@ 008ca220 OnlineStatsScreen::~OnlineStatsScreen /* DB: ? Game::~Game member built in Game::constructor at Game+0x25954 (byte flag +0, ANM2 +4 = 0x25958, ANM2[4] +0x118 = 0x25a6c): resets those sprites and frees members via 008ca5b0/008cb2e0; the same object holds the 0x38-byte player-entry vector at +0x568 that netplay_lobby_render draws and Manager::update_ingame_input clears next to online_vote_send; online_stats_finalize (008ca600) sits beside it */ void OnlineStatsScreen::~OnlineStatsScreen(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; FUN_008ca5b0(__security_cookie ^ (int)register0x00000010 - 4U); std::vector<56byte_string>::_Tidy(); _eh_vector_destructor_iterator_((void *)(in_ECX + 0x118),0x114,4,ANM2::~ANM2); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x54)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); ExceptionList = local_10; return; } //@@ 008ca2c0 CompletionWidget::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? once from Game::LoadConfigXmls after ScoreSheet::LoadAnm2: this[0]=0, ANM2::Load(this+4, "gfx/ui/DeedsMenu.anm2"), "PlayerCharacter" anim; REPENTOGON CompletionWidget has Render/Update */ void CompletionWidget::Load(void) { byte *pbVar1; byte bVar2; byte *pbVar3; undefined1 *in_ECX; byte *pbVar4; char *pcVar5; uint uVar6; undefined4 *puVar7; bool bVar8; int local_58; std_string local_54; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; *in_ECX = 0; local_54._size = 0; local_54._capacity = 0xf; local_54._buf[0] = '\0'; local_54._buf[1] = '\0'; local_54._buf[2] = '\0'; local_54._buf[3] = '\0'; local_54._buf._0_4_ = std::_Allocate(0x20); local_54._size = 0x15; local_54._capacity = 0x1f; builtin_strncpy((char *)local_54._buf._0_4_,"gfx/ui/DeedsMenu.anm2",0x16); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 4),&local_54,1); local_14 = 0xffffffff; if (0xf < local_54._capacity) { uVar6 = local_54._capacity + 1; pcVar5 = (char *)local_54._buf._0_4_; if (0xfff < uVar6) { pcVar5 = *(char **)(local_54._buf._0_4_ + -4); uVar6 = local_54._capacity + 0x24; if ((char *)0x1f < (char *)(local_54._buf._0_4_ + (-4 - (int)pcVar5))) { LAB_008ca399: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar6); } pbVar1 = *(byte **)(in_ECX + 0x38); if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar4 = s_Idle; do { bVar2 = *pbVar3; bVar8 = bVar2 < *pbVar4; if (bVar2 != *pbVar4) { LAB_008ca3e0: uVar6 = -(uint)bVar8 | 1; goto LAB_008ca3e5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar8 = bVar2 < pbVar4[1]; if (bVar2 != pbVar4[1]) goto LAB_008ca3e0; pbVar3 = pbVar3 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar6 = 0; LAB_008ca3e5: if ((uVar6 == 0) && ((pbVar1[0x34] == 0 || (in_ECX[0x48] != '\0')))) goto LAB_008ca419; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x34)); in_ECX[0x48] = 1; } LAB_008ca419: if (in_ECX[0x10d] != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x34)); AnimationState::Update((AnimationState *)(in_ECX + 0x54)); } local_58 = 0; puVar7 = (undefined4 *)(in_ECX + 0x14c); do { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x15; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/DeedsMenu.anm2",0x16); local_14 = 1; ANM2::Load((ANM2 *)(puVar7 + -0xd),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar6 = local_3c._capacity + 1; pcVar5 = (char *)local_3c._buf._0_4_; if (0xfff < uVar6) { pcVar5 = *(char **)(local_3c._buf._0_4_ + -4); uVar6 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar5))) goto LAB_008ca399; } operator_delete(pcVar5,uVar6); } pbVar1 = (byte *)*puVar7; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (pbVar1 == (byte *)0x0) { LAB_008ca543: bVar2 = ANM2::SetAnimation((ANM2 *)(puVar7 + -0xd),(byte *)"PlayerCharacter",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(puVar7 + -1)); *(undefined1 *)(puVar7 + 4) = 1; } } else { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar5 = "PlayerCharacter"; do { bVar2 = *pbVar3; bVar8 = bVar2 < (byte)*pcVar5; if (bVar2 != *pcVar5) { LAB_008ca530: uVar6 = -(uint)bVar8 | 1; goto LAB_008ca535; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar8 = bVar2 < (byte)pcVar5[1]; if (bVar2 != pcVar5[1]) goto LAB_008ca530; pbVar3 = pbVar3 + 2; pcVar5 = pcVar5 + 2; } while (bVar2 != 0); uVar6 = 0; LAB_008ca535: if ((uVar6 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(puVar7 + 4) == '\0')))) goto LAB_008ca543; } if (*(char *)((int)puVar7 + 0xd5) != '\0') { AnimationState::Update((AnimationState *)(puVar7 + -1)); AnimationState::Update((AnimationState *)(puVar7 + 7)); } puVar7 = puVar7 + 0x45; local_58 = local_58 + 1; if (3 < local_58) { ExceptionList = local_1c; return; } } while( true ); } //@@ 008ca5b0 FUN_008ca5b0 void FUN_008ca5b0(void) { int iVar1; undefined1 *in_ECX; int iVar2; ANM2::Reset((ANM2 *)(in_ECX + 4)); iVar1 = *(int *)(in_ECX + 0x56c); iVar2 = *(int *)(in_ECX + 0x568); if (iVar2 == iVar1) { *(int *)(in_ECX + 0x56c) = iVar2; *in_ECX = 0; return; } do { std::string::_Tidy_deallocate((char *)(iVar2 + 8)); iVar2 = iVar2 + 0x38; } while (iVar2 != iVar1); *(undefined4 *)(in_ECX + 0x56c) = *(undefined4 *)(in_ECX + 0x568); *in_ECX = 0; return; } //@@ 008ca600 online_stats_finalize /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "Finalized stats for user %llu, %s", "Duplicate UserID in player info!", "Player %d"; callers Game::End and 004291c0 update_cutscene_state_machine void online_stats_finalize(undefined4 param_1) { byte bVar1; int iVar2; undefined4 uVar3; Manager *pMVar4; uint uVar5; byte *text; char *in_ECX; int extraout_ECX; void *pvVar6; byte *pbVar7; Game *pGVar8; int iVar9; int *piVar10; byte *pbVar11; char *length; uint local_68; int local_64; undefined8 local_60; void *local_58; undefined4 local_48; uint local_44; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_30; undefined4 local_2c; byte local_28 [16]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0591d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; if (*in_ECX == '\0') { pbVar11 = (byte *)0x8ca64c; local_18 = uVar5; PopupButtons::reset(1); *(undefined4 *)(extraout_ECX + 0x118) = 0x42c00000; *(undefined4 *)(extraout_ECX + 0x24c) = 6; *(code **)(extraout_ECX + 0x264) = FUN_008cb190; *(char **)(extraout_ECX + 0x268) = in_ECX; length = (char *)0x8ca681; OnlineStats::compute_awards(uVar5); iVar2 = *(int *)(in_ECX + 0x56c); iVar9 = *(int *)(in_ECX + 0x568); if (iVar9 != iVar2) { do { length = (char *)0x8ca69e; std::string::_Tidy_deallocate((char *)(iVar9 + 8)); iVar9 = iVar9 + 0x38; } while (iVar9 != iVar2); iVar9 = *(int *)(in_ECX + 0x568); } pGVar8 = g_game; *(int *)(in_ECX + 0x56c) = iVar9; local_68 = 0; iVar9 = (int)(pGVar8->_onlinePlayerStats)._end - (int)(pGVar8->_onlinePlayerStats)._begin; iVar2 = iVar9 >> 0x1f; if (iVar9 / 0x68 + iVar2 != iVar2) { local_64 = 0; do { pvVar6 = (pGVar8->_onlinePlayerStats)._begin; uVar5 = 0; pbVar11 = *(byte **)((int)pvVar6 + local_64 + 4); piVar10 = *(int **)(in_ECX + 0x568); iVar2 = *(int *)(in_ECX + 0x56c) - (int)piVar10 >> 0x1f; iVar9 = (*(int *)(in_ECX + 0x56c) - (int)piVar10) / 0x38 + iVar2; if (iVar9 != iVar2) { do { if ((*piVar10 == *(int *)((int)pvVar6 + local_64)) && ((byte *)piVar10[1] == pbVar11)) { length = "Duplicate UserID in player info! \n"; pbVar11 = (byte *)0x10; KAGE_LogMessage(0x10,(byte *)"Duplicate UserID in player info! \n"); goto LAB_008ca901; } uVar5 = uVar5 + 1; piVar10 = piVar10 + 0xe; } while (uVar5 < (uint)(iVar9 - iVar2)); } local_60 = 0; local_48 = 0; local_44 = 0xf; local_58 = (void *)0x0; local_30 = 0; local_40 = 0x3f800000; uStack_3c = 0x3f800000; uStack_38 = 0x3f800000; uStack_34 = 0x3f800000; local_2c = 1; local_8 = 0; if (*(int *)(in_ECX + 0x56c) == *(int *)(in_ECX + 0x570)) { std::vector<56byte>::_Emplace_reallocate(*(int *)(in_ECX + 0x56c),&local_60); pGVar8 = g_game; } else { FUN_008cb3a0(); *(int *)(in_ECX + 0x56c) = *(int *)(in_ECX + 0x56c) + 0x38; } local_8 = 0xffffffff; if (0xf < local_44) { uVar5 = local_44 + 1; pvVar6 = local_58; if (0xfff < uVar5) { pvVar6 = *(void **)((int)local_58 + -4); uVar5 = local_44 + 0x24; if (0x1f < (uint)((int)local_58 + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar5); pGVar8 = g_game; } pvVar6 = (pGVar8->_onlinePlayerStats)._begin; uVar3 = *(undefined4 *)(local_64 + 4 + (int)pvVar6); iVar2 = *(int *)(in_ECX + 0x56c); *(undefined4 *)(iVar2 + -0x38) = *(undefined4 *)(local_64 + (int)pvVar6); *(undefined4 *)(iVar2 + -0x34) = uVar3; *(undefined4 *)(*(int *)(in_ECX + 0x56c) + -4) = *(undefined4 *)((int)(pGVar8->_onlinePlayerStats)._begin + local_64 + 8); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { PlayerManager::GetPlayerSlotFromController (&pGVar8->_playerManager,*(int *)(*(int *)(in_ECX + 0x56c) + -0x38)); sprintf_s(local_28,0x10,(byte *)"Player %d"); pbVar11 = local_28; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); length = (char *)(pbVar11 + -(int)(local_28 + 1)); pbVar11 = local_28; std::string::assign((char *)(*(int *)(in_ECX + 0x56c) + -0x30),pbVar11,(uint)length); } else { text = user_profile_format_display_name (*(ulonglong *)(*(int *)(in_ECX + 0x56c) + -0x38), &g_manager->_font1_TeamMeatEx10,0x50); pbVar7 = text; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)(*(int *)(in_ECX + 0x56c) + -0x30),text, (int)pbVar7 - (int)(text + 1)); length = (char *)(*(int *)(in_ECX + 0x56c) + -0x30); if (0xf < *(uint *)(*(int *)(in_ECX + 0x56c) + -0x1c)) { length = *(char **)length; } KAGE_LogMessage(1,(byte *)"Finalized stats for user %llu, %s \n"); } LAB_008ca901: local_68 = local_68 + 1; local_64 = local_64 + 0x68; pGVar8 = g_game; } while (local_68 < (uint)(((int)(g_game->_onlinePlayerStats)._end - (int)(g_game->_onlinePlayerStats)._begin) / 0x68)); } if ((pGVar8 == (Game *)0x0) || ((pGVar8->_dailyChallenge)._id == 0)) { if (DAT_00bf9438 == 1) { online_session_reset(); pvVar6 = g_onlineVoteMap; DAT_00c79874 = FUN_008cb0f0; DAT_00bf9438 = 0; DAT_00bf943c = 0; DAT_00c79878 = in_ECX; FID_conflict__Erase_tree_>_> (&g_onlineVoteMap, (fuzzer_allocator_> *)&g_onlineVoteMap, *(_Tree_node **)((int)g_onlineVoteMap + 4)); *(void **)((int)pvVar6 + 4) = pvVar6; *(void **)pvVar6 = pvVar6; *(void **)((int)pvVar6 + 8) = pvVar6; DAT_00c79880 = 0; DAT_00bf9430 = 0x96; DAT_00bf9434 = 1; } pMVar4 = g_manager; *(undefined4 *)&g_manager[1]._gamestate.field_0x2e0 = 0; *(undefined4 *)&pMVar4[1]._gamestate.field_0x2dc = 0; } else { netplay_leave_lobby(&g_manager->_netplayManager,(int)pbVar11,(int)length); } *in_ECX = '\x01'; *(undefined4 *)(in_ECX + 0x574) = param_1; } ExceptionList = local_10; return; } //@@ 008caa20 FUN_008caa20 void FUN_008caa20(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 8)); return; } //@@ 008caa30 netplay_lobby_render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? renders the online player list: layers "Player%d Text"/"PlayerCharacter%d"/"Player_Character"/"Player_Me" ("[warn] no layer named %s"), vector of 0x38-byte entries at +0x568, ANM2 +0x118; called from Game::Render next to the revive prompt render */ void netplay_lobby_render(void) { byte bVar1; int iVar2; ANM2 *this; char cVar3; float *pfVar4; int extraout_EAX; LayerState *pLVar5; byte *text; byte ******ppppppbVar6; char *in_ECX; byte *pbVar7; AnimationState *this_00; uint uVar8; undefined4 *puVar9; byte *pbVar10; int iVar11; KColor local_128; undefined4 local_114; undefined4 local_110; undefined4 local_10c; undefined4 local_108; undefined4 local_104; undefined4 local_100; undefined4 local_fc; char *local_f8; Vector local_f4; Vector local_ec; uint local_e4; uint local_e0; undefined **local_dc [2]; uint local_d4; ANM2 *local_d0; float local_cc; float local_c8; undefined4 *local_c4; float local_c0; float local_bc; Vector local_b8; undefined4 local_b0; byte ******local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; uint local_98; byte local_94 [64]; byte local_54 [64]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0598c; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_54 + 0x50); ExceptionList = &local_10; local_e0 = 0; if (*in_ECX != '\0') { local_c8 = g_screenWidth * 0.5 - 242.0; local_cc = g_screenHeight * 0.5 - 139.0; local_f8 = in_ECX; local_b8.x = local_c8; local_b8.y = local_cc; if (in_ECX[0x10d] != '\0') { if (in_ECX[0x74] == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x34),&local_b8,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(in_ECX + 0x54),&local_b8,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x54),&local_b8,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(in_ECX + 0x34),&local_b8,&g_vectorZero,&g_vectorZero); } } iVar11 = *(int *)(in_ECX + 0x568); iVar2 = *(int *)(in_ECX + 0x56c) - iVar11 >> 0x1f; if ((*(int *)(in_ECX + 0x56c) - iVar11) / 0x38 + iVar2 != iVar2) { local_d0 = (ANM2 *)(in_ECX + 0x118); local_d4 = 0; uVar8 = 0; local_cc = local_b8.y; local_c8 = local_b8.x; while (local_d4 < 0xe0) { local_e4 = uVar8 + 1; puVar9 = (undefined4 *)(iVar11 + local_d4); local_c4 = puVar9; sprintf_s(local_54,0x40,(byte *)"Player%d Text"); if (*(int *)(in_ECX + 0x38) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x34),local_54); } local_ec.y = local_cc + pfVar4[1]; local_ec.x = local_c8 + *pfVar4; local_dc[0] = KAGE::System::UserProfileBase::vftable; local_c0 = local_ec.y; UserProfile::find_or_create(puVar9); local_8 = 0; local_dc[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_dc); } local_8 = 1; cVar3 = (*(code *)local_dc[0][5])(); local_8 = 0xffffffff; local_dc[0] = KAGE::System::UserProfileBase::vftable; if (cVar3 != '\0') { pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + 4),(byte *)"Player_Me"); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(in_ECX + 4),*(int *)pLVar5->_layerData,uVar8); } } puVar9 = local_c4; local_b0 = 1; local_ac = (byte ******)0xffff; local_a8 = 0; local_a4 = 0x3f800000; local_a0 = 0xffffffff; local_9c = 0; local_98 = 0; local_8 = 2; pbVar10 = (byte *)(local_c4 + 2); local_128._unk = 0; local_128._red = 0.21176471; local_128._green = 0.18431373; local_128._blue = 0.1764706; local_128._alpha = 1.0; if (0xf < (uint)local_c4[7]) { pbVar10 = *(byte **)pbVar10; } Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,pbVar10,&local_ec,&local_128,&local_b0); local_8 = 0xffffffff; pbVar10 = (byte *)&DAT_00c78f08; local_ec.y = local_c0 + 15.0; local_b8.y = (float)&g_manager->_font1_TeamMeatEx10; local_bc = 0.0; iVar11 = 0; local_c0 = local_ec.y; do { if (2 < (int)local_bc) break; cVar3 = FUN_008ca1d0(*puVar9,puVar9[1],iVar11); if (cVar3 != '\0') { pbVar7 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar7 = *(byte **)pbVar10; } text = string_table_translate(&g_manager->_stringTable,pbVar7); local_9c = 0; local_98 = 0xf; local_ac = (byte ******)0x0; pbVar7 = text; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)&local_ac,text,(int)pbVar7 - (int)(text + 1)); local_e0 = local_e0 | 1; local_114 = 1; local_110 = 0xffff; local_10c = 0; local_108 = 0x3f800000; local_104 = 0xffffffff; local_100 = 0; local_fc = 0; local_8 = 4; ppppppbVar6 = (byte ******)&local_ac; if (0xf < local_98) { ppppppbVar6 = local_ac; } local_128._unk = 0; local_128._red = 0.21176471; local_128._green = 0.18431373; local_128._blue = 0.1764706; local_128._alpha = 1.0; Font::DrawStringScaled ((Font *)local_b8.y,(byte *)ppppppbVar6,&local_ec,&local_128,&local_114); local_ec.y = local_c0 + 15.0; local_bc = (float)((int)local_bc + 1); local_8 = 0xffffffff; local_c0 = local_ec.y; if (0xf < local_98) { uVar8 = local_98 + 1; ppppppbVar6 = local_ac; if (0xfff < uVar8) { ppppppbVar6 = (byte ******)local_ac[-1]; uVar8 = local_98 + 0x24; if ((byte *)0x1f < (byte *)((int)local_ac + (-4 - (int)ppppppbVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar6,uVar8); } puVar9 = local_c4; } pbVar10 = pbVar10 + 0x18; iVar11 = iVar11 + 1; } while ((int)pbVar10 < 0xc79100); sprintf_s(local_94,0x40,(byte *)"PlayerCharacter%d"); in_ECX = local_f8; if (*(int *)(local_f8 + 0x38) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame((AnimationState *)(local_f8 + 0x34),local_94); } this = local_d0; local_b8.y = *pfVar4; local_bc = pfVar4[1]; iVar11 = local_c4[0xd]; pLVar5 = ANM2::GetLayer(local_d0,(byte *)"Player_Character"); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(this,*(int *)pLVar5->_layerData,iVar11 + -1); } local_f4.x = local_c8 + local_b8.y; local_f4.y = local_cc + local_bc; if (this->_loaded != 0) { if (local_d0->_overlayRenderFirst == 0) { AnimationState::Render(&this->_animState,&local_f4,&g_vectorZero,&g_vectorZero); this_00 = &this->_overlayAnimState; } else { AnimationState::Render(&this->_overlayAnimState,&local_f4,&g_vectorZero,&g_vectorZero); this_00 = &this->_animState; } AnimationState::Render(this_00,&local_f4,&g_vectorZero,&g_vectorZero); } iVar11 = *(int *)(in_ECX + 0x568); local_d4 = local_d4 + 0x38; local_d0 = local_d0 + 1; if ((uint)((*(int *)(in_ECX + 0x56c) - iVar11) / 0x38) <= local_e4) { ExceptionList = local_10; return; } uVar8 = local_e4; } } } ExceptionList = local_10; return; } //@@ 008cb0f0 FUN_008cb0f0 void FUN_008cb0f0(undefined4 param_1,int param_2) { Game *pGVar1; Manager *pMVar2; uint uVar3; pMVar2 = g_manager; pGVar1 = g_game; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (pMVar2->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; pMVar2[1]._persistentGameData._achievements[0] = 0; Game::End(pGVar1,*(int *)(param_2 + 0x574)); pGVar1 = g_game; *(undefined4 *)&g_game->_deathmatchManager = 0; *(undefined4 *)&(pGVar1->_deathmatchManager).field_0x4 = 0; uVar3 = Random(); if ((uVar3 & 1) == 0) { DeathmatchManager::set_type(&pGVar1->_deathmatchManager,1); return; } uVar3 = Random(); DeathmatchManager::set_type(&pGVar1->_deathmatchManager,uVar3 % 10 + 2); return; } //@@ 008cb190 FUN_008cb190 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008cb190(void) { Manager *pMVar1; void *pvVar2; uint uVar3; Vector *pos; int iVar4; int iVar5; float10 fVar6; KColor local_5c; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined1 local_2c [4]; void *local_28; byte local_24 [16]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar2 = g_onlineVoteMap; local_8 = 0xffffffff; puStack_c = &LAB_00b059cd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; local_28 = *(void **)g_onlineVoteMap; iVar5 = 0; local_14 = uVar3; if (local_28 != g_onlineVoteMap) { do { iVar4 = iVar5 + 1; if (*(int *)((int)local_28 + 0x18) != 0) { iVar4 = iVar5; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); iVar5 = iVar4; } while (local_28 != pvVar2); if (iVar4 != 0) { local_28 = (void *)((float)((double)DAT_00bf9430 + __uint_to_double_fixup[-(DAT_00bf9430 >> 0x1f)]) / 30.0); fVar6 = (float10)roundf(local_28,uVar3); local_28 = (void *)(float)fVar6; __ftoui3(); sprintf_s(local_24,0x10,s__d); pMVar1 = g_manager; local_48 = 4; local_44 = 0xffff; local_40 = 0; local_3c = 0x3f800000; local_38 = 0xffffffff; local_34 = 0; local_30 = 0; local_8 = 0; KColor::SetFromARGB(&local_5c,0xff362f2d); pos = (Vector *)FUN_004240b0(local_2c,1); Font::DrawStringScaled(&pMVar1->_font2_TeamMeatEx12,local_24,pos,&local_5c,&local_48); } } ExceptionList = local_10; return; } //@@ 008cb2e0 std::vector<56byte_string>::_Tidy /* DB: destroys 0x38-byte elements (std::string at +0) then frees; Game::~Game (right after Leaderboard::~Leaderboard), OnlineStatsScreen::~OnlineStatsScreen, netplay_player_list_destructor */ void std::vector<56byte_string>::_Tidy(void) { int *in_ECX; uint size; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { string::_Tidy_deallocate((char *)((int)pvVar1 + 8)); pvVar1 = (void *)((int)pvVar1 + 0x38); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x38) * 0x38; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008cb370 FUN_008cb370 void FUN_008cb370(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x38) { std::string::_Tidy_deallocate((char *)(param_1 + 8)); } return; } //@@ 008cb3a0 FUN_008cb3a0 void FUN_008cb3a0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; uVar1 = param_1[1]; *in_EDX = *param_1; in_EDX[1] = uVar1; in_EDX[2] = 0; in_EDX[6] = 0; in_EDX[7] = 0; uVar1 = param_1[3]; uVar2 = param_1[4]; uVar3 = param_1[5]; in_EDX[2] = param_1[2]; in_EDX[3] = uVar1; in_EDX[4] = uVar2; in_EDX[5] = uVar3; *(undefined8 *)(in_EDX + 6) = *(undefined8 *)(param_1 + 6); param_1[6] = 0; param_1[7] = 0xf; *(undefined1 *)(param_1 + 2) = 0; in_EDX[8] = param_1[8]; in_EDX[9] = param_1[9]; in_EDX[10] = param_1[10]; in_EDX[0xb] = param_1[0xb]; in_EDX[0xc] = param_1[0xc]; in_EDX[0xd] = param_1[0xd]; return; } //@@ 008cb420 std::vector<56byte>::_Emplace_reallocate /* DB: vector grow (max 0x4924924 = 2^32/56), moves 0x38-byte {2 ints, std::string, ...} elements; from online_stats_finalize when the vector at +0x56c is full */ undefined4 * std::vector<56byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 param_2) { undefined4 uVar1; int iVar2; uint uVar3; undefined4 *puVar4; int *in_ECX; uint uVar5; undefined4 *puVar6; int iVar7; undefined4 *puVar8; void *pvVar9; void *pvVar10; undefined4 *puVar11; uint local_28; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05a0d; local_10 = ExceptionList; ExceptionList = &local_10; iVar7 = (int)param_1 - *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0x38; if (iVar2 == 0x4924924) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar3 = iVar2 + 1; uVar5 = (in_ECX[2] - *in_ECX) / 0x38; if (0x4924924 - (uVar5 >> 1) < uVar5) { local_28 = 0x4924924; } else { uVar5 = (uVar5 >> 1) + uVar5; local_28 = uVar3; if (uVar3 <= uVar5) { local_28 = uVar5; } if (0x4924924 < local_28) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = _Allocate(local_28 * 0x38); local_8 = 0; FUN_008cb3a0(param_2); puVar6 = (undefined4 *)in_ECX[1]; puVar8 = (undefined4 *)*in_ECX; if (param_1 == puVar6) { local_8 = CONCAT31(local_8._1_3_,1); puVar11 = puVar4; for (; puVar8 != puVar6; puVar8 = puVar8 + 0xe) { uVar1 = puVar8[1]; *puVar11 = *puVar8; puVar11[1] = uVar1; string::string((char *)(puVar11 + 2),puVar8 + 2); puVar11[8] = puVar8[8]; puVar11[9] = puVar8[9]; puVar11[10] = puVar8[10]; puVar11[0xb] = puVar8[0xb]; puVar11[0xc] = puVar8[0xc]; puVar11[0xd] = puVar8[0xd]; puVar11 = puVar11 + 0xe; } } else { if (puVar8 != param_1) { do { FUN_008cb3a0(puVar8); puVar8 = puVar8 + 0xe; } while (puVar8 != param_1); puVar6 = (undefined4 *)in_ECX[1]; } for (; param_1 != puVar6; param_1 = param_1 + 0xe) { FUN_008cb3a0(param_1); } } pvVar9 = (void *)*in_ECX; if (pvVar9 != (void *)0x0) { pvVar10 = (void *)in_ECX[1]; if (pvVar9 != pvVar10) { do { string::_Tidy_deallocate((char *)((int)pvVar9 + 8)); pvVar9 = (void *)((int)pvVar9 + 0x38); } while (pvVar9 != pvVar10); pvVar9 = (void *)*in_ECX; } uVar5 = ((in_ECX[2] - (int)pvVar9) / 0x38) * 0x38; pvVar10 = pvVar9; if (0xfff < uVar5) { pvVar10 = *(void **)((int)pvVar9 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar9 + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar5); } *in_ECX = (int)puVar4; in_ECX[1] = (int)(puVar4 + uVar3 * 0xe); in_ECX[2] = (int)(puVar4 + local_28 * 0xe); ExceptionList = local_10; return puVar4 + (iVar7 / 0x38) * 0xe; } //@@ 008cb691 Catch_All@008cb691 void Catch_All_008cb691(void) { int unaff_EBP; FUN_008cb370(*(undefined4 *)(unaff_EBP + 0xc),*(undefined4 *)(unaff_EBP + -0x28)); FUN_004aaaa0(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + -0x1c)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 008cb6c0 FUN_008cb6c0 void FUN_008cb6c0(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; for (iVar2 = *in_ECX; iVar2 != iVar1; iVar2 = iVar2 + 0x38) { std::string::_Tidy_deallocate((char *)(iVar2 + 8)); } return; } //@@ 008cb6f0 FUN_008cb6f0 void FUN_008cb6f0(float *param_1) { int in_ECX; AnimationState *this; Vector local_10; local_10.x = *param_1 + 0.0; local_10.y = param_1[1] - (float)*(int *)(in_ECX + 0x11c); if (*(char *)(in_ECX + 0x109) != '\0') { this = (AnimationState *)(in_ECX + 0x50); if (*(char *)(in_ECX + 0x70) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x30),&local_10,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render(this,&local_10,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x30); } AnimationState::Render(this,&local_10,&g_vectorZero,&g_vectorZero); } return; } //@@ 008cb780 FUN_008cb780 void FUN_008cb780(void) { ANM2 *in_ECX; ANM2::constructor(in_ECX); return; } //@@ 008cb7a0 FUN_008cb7a0 void FUN_008cb7a0(void) { ANM2 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(in_ECX + 1,0x120,6,FUN_005cc630); local_8 = 0; ANM2::Reset(in_ECX); AnimationState::~AnimationState(&in_ECX->_overlayAnimState); AnimationState::~AnimationState(&in_ECX->_animState); std::string::_Tidy_deallocate((in_ECX->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)in_ECX); ExceptionList = local_10; return; } //@@ 008cbaf0 Menu_CreateLobby::unload_graphics /* DB: ECX=MenuManager+0xedd8 (CREATELOBBY menu, see 008cbd60): ANM2::Reset this and 6 more ANM2; from MenuManager::unload_graphics */ void Menu_CreateLobby::unload_graphics(void) { uint *ptr; void *pvVar1; undefined4 *puVar2; std_string *psVar3; ANM2 *in_ECX; int iVar4; uint *puVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::Reset(in_ECX); puVar5 = &in_ECX[1]._animDefaultName._size; iVar4 = 6; do { if (puVar5[-6] != 0) { AnmCache::RemoveRef((std_string *)(puVar5 + -10)); } puVar2 = puVar5 + -10; if (0xf < puVar5[-5]) { puVar2 = (undefined4 *)*puVar2; } puVar5[-6] = 0; *(undefined1 *)puVar2 = 0; AnimationState::SetAnimationData((AnimationState *)(puVar5 + 2),(void *)0x0); AnimationState::SetAnimationData((AnimationState *)(puVar5 + 10),(void *)0x0); psVar3 = (std_string *)(puVar5 + -4); if (0xf < puVar5[1]) { psVar3 = *(std_string **)psVar3->_buf; } *puVar5 = 0; psVar3->_buf[0] = '\0'; pvVar1 = (void *)puVar5[0x15]; puVar5[0x13] = 0; puVar5[0x14] = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); local_8 = 0xffffffff; } puVar5[0x15] = 0; puVar5[0x16] = 0; puVar5[0x17] = 0; puVar5[0x18] = 0; puVar5[0x19] = 0; puVar5[0x1a] = 0; puVar5[0x1b] = (uint)g_vectorZero.x; puVar5[0x1c] = (uint)g_vectorZero.y; puVar5[0x1d] = (uint)g_vectorOne.x; puVar5[0x1e] = (uint)g_vectorOne.y; puVar5[0x1f] = 0; puVar5[0x20] = 0x3f800000; puVar5[0x21] = 0x3f800000; puVar5[0x22] = 0x3f800000; puVar5[0x23] = 0x3f800000; puVar5[0x24] = 0; puVar5[0x25] = 0; puVar5[0x26] = 0; puVar5[0x27] = 0; puVar5[0x28] = 0; puVar5[0x29] = 0; puVar5[0x2a] = 0; puVar5[0x2f] = 0; puVar5[0x30] = 0; puVar5[0x31] = 0; puVar5[0x32] = 0; puVar5[0x33] = 0; puVar5[0x34] = 0; puVar5[0x35] = 0; puVar5[0x2b] = 0x3f800000; puVar5[0x2c] = 0x3f800000; puVar5[0x2d] = 0x3f800000; puVar5[0x2e] = 0; *(undefined2 *)(puVar5 + 0x36) = 0; puVar5[0x37] = 0x3f800000; *(undefined2 *)(puVar5 + 0x38) = 0; *(undefined1 *)(puVar5 + 0x12) = 0; puVar5[0x39] = 0xffffffff; puVar5[0x3a] = 0; puVar5 = puVar5 + 0x48; iVar4 = iVar4 + -1; } while (iVar4 != 0); ExceptionList = local_10; return; } //@@ 008cbd60 Menu_CreateLobby::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=MenuManager+0xedd8 (the menu whose Update 008cbfe0 Menu_OnlineMode::Update MenuManager::Update case 0x15 = eMainMenuType CREATELOBBY): ANM2::Load gfx/ui/main menu/CreateLobbyMenu.anm2 and CreateLobbyBoxes.anm2; from MenuManager::LoadGraphics */ void Menu_CreateLobby::load_graphics(void) { byte bVar1; byte *currentAnimName; ANM2 *in_ECX; byte *idleNameCursor; char *freeBlock; uint uVar2; int boxIndex; ANM2 *boxSprite; bool isLess; std_string menuAnmPath; std_string boxesAnmPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *currentAnim; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; menuAnmPath._size = 0; menuAnmPath._capacity = 0xf; menuAnmPath._buf[0] = '\0'; menuAnmPath._buf[1] = '\0'; menuAnmPath._buf[2] = '\0'; menuAnmPath._buf[3] = '\0'; menuAnmPath._buf._0_4_ = std::_Allocate(0x30); menuAnmPath._size = 0x25; menuAnmPath._capacity = 0x2f; builtin_strncpy((char *)menuAnmPath._buf._0_4_,"gfx/ui/main menu/CreateLobbyMenu.anm2",0x26); local_14 = 0; ANM2::Load(in_ECX,&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar2 = menuAnmPath._capacity + 1; freeBlock = (char *)menuAnmPath._buf._0_4_; if (0xfff < uVar2) { freeBlock = *(char **)(menuAnmPath._buf._0_4_ + -4); uVar2 = menuAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuAnmPath._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_008cbe44: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); } currentAnim = (in_ECX->_animState)._animData; if (currentAnim != (byte *)0x0) { currentAnimName = currentAnim; if (0xf < *(uint *)(currentAnim + 0x14)) { currentAnimName = *(byte **)currentAnim; } idleNameCursor = s_Idle; do { bVar1 = *currentAnimName; isLess = bVar1 < *idleNameCursor; if (bVar1 != *idleNameCursor) { LAB_008cbe90: uVar2 = -(uint)isLess | 1; goto LAB_008cbe95; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < idleNameCursor[1]; if (bVar1 != idleNameCursor[1]) goto LAB_008cbe90; currentAnimName = currentAnimName + 2; idleNameCursor = idleNameCursor + 2; } while (bVar1 != 0); uVar2 = 0; LAB_008cbe95: if ((uVar2 == 0) && ((currentAnim[0x34] == 0 || ((in_ECX->_animState)._isPlaying != 0)))) goto LAB_008cbec1; } bVar1 = ANM2::SetAnimation(in_ECX,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_008cbec1: boxIndex = 0; boxSprite = in_ECX + 1; do { boxesAnmPath._size = 0; boxesAnmPath._capacity = 0xf; boxesAnmPath._buf[0] = '\0'; boxesAnmPath._buf[1] = '\0'; boxesAnmPath._buf[2] = '\0'; boxesAnmPath._buf[3] = '\0'; boxesAnmPath._buf._0_4_ = std::_Allocate(0x30); boxesAnmPath._size = 0x26; boxesAnmPath._capacity = 0x2f; builtin_strncpy((char *)boxesAnmPath._buf._0_4_,"gfx/ui/main menu/CreateLobbyBoxes.anm2",0x27); local_14 = 1; ANM2::Load(boxSprite,&boxesAnmPath,1); local_14 = 0xffffffff; if (0xf < boxesAnmPath._capacity) { uVar2 = boxesAnmPath._capacity + 1; freeBlock = (char *)boxesAnmPath._buf._0_4_; if (0xfff < uVar2) { freeBlock = *(char **)(boxesAnmPath._buf._0_4_ + -4); uVar2 = boxesAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(boxesAnmPath._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_008cbe44; } operator_delete(freeBlock,uVar2); } boxesAnmPath._size = 0; boxesAnmPath._capacity = 0xf; boxesAnmPath._buf._0_4_ = boxesAnmPath._buf._0_4_ & 0xffffff00; FUN_008cd670(boxIndex); boxIndex = boxIndex + 1; boxSprite = (ANM2 *)(boxSprite[1]._filename._buf + 0xc); if (5 < boxIndex) { update_paper_layers(); ExceptionList = local_1c; return; } } while( true ); } //@@ 008cbfe0 Menu_OnlineMode::Update /* DB: ? MenuManager::Update case 0x15 with ECX = MenuManager+0xedd8: fades +0x7e8 by 0.1 and pushes the queued menu +0x7ec, calls Menu_Online::update_mode_select / 008cd3f0, updates 6 mode entries (Idle_DailyMatch/Idle_FriendMatch...), then 008cc5e0 Menu_CreateLobby::update_paper_layers void Menu_OnlineMode::Update(void) { void *in_ECX; int extraout_ECX; int extraout_ECX_00; int iVar1; int iVar2; undefined8 *modeEntry; float fadeAlpha; float shade; float fStack_2c; float fStack_28; undefined4 uStack_24; undefined4 local_10; undefined4 uStack_c; undefined4 local_8; play_idle_animation(); iVar2 = extraout_ECX; if (*(char *)((int)in_ECX + 0x109) != '\0') { AnimationState::Update((AnimationState *)((int)in_ECX + 0x30)); AnimationState::Update((AnimationState *)((int)in_ECX + 0x50)); iVar2 = extraout_ECX_00; } if (*(char *)((int)in_ECX + 0x7d4) == '\0') { fadeAlpha = *(float *)((int)in_ECX + 0x7e8) - 0.1; if (fadeAlpha <= 0.0) { fadeAlpha = 0.0; } *(float *)((int)in_ECX + 0x7e8) = fadeAlpha; if ((fadeAlpha == 0.0) && (*(int *)((int)in_ECX + 0x7ec) != 0)) { MenuManager::push_menu(*(int *)((int)in_ECX + 0x7ec),iVar2); fadeAlpha = *(float *)((int)in_ECX + 0x7e8); *(undefined4 *)((int)in_ECX + 0x7ec) = 0; } } else { fadeAlpha = *(float *)((int)in_ECX + 0x7e8) + 0.1; if (1.0 <= fadeAlpha) { fadeAlpha = 1.0; } *(float *)((int)in_ECX + 0x7e8) = fadeAlpha; } if (fadeAlpha == 1.0) { if (*(char *)((int)in_ECX + 0x7e4) == '\0') { update_mode_select(in_ECX); } else { update_seed_input(); } } iVar2 = 0; modeEntry = (undefined8 *)((int)in_ECX + 0x1dc); do { FUN_008cd670(iVar2); if (*(char *)((int)modeEntry + 0x41) != '\0') { AnimationState::Update((AnimationState *)(modeEntry + -0x13)); AnimationState::Update((AnimationState *)(modeEntry + -0xf)); } iVar1 = *(int *)(modeEntry + 10); if (*(char *)((int)modeEntry + 0x4c) == '\0') { if (0 < iVar1) { iVar1 = iVar1 + -1; goto LAB_008cc0eb; } } else if (iVar1 < 7) { iVar1 = iVar1 + 1; LAB_008cc0eb: *(int *)(modeEntry + 10) = iVar1; } uStack_24 = 0x3f800000; local_10 = 0; uStack_c = 0; local_8 = 0; shade = (float)(iVar1 * 0xe + 0x9d) * 0.003921569; if ((float *)(modeEntry + -4) != &shade) { *(undefined4 *)(modeEntry + -2) = 0; *(undefined4 *)((int)modeEntry + -0xc) = 0; *(undefined4 *)(modeEntry + -1) = 0; *(undefined4 *)((int)modeEntry + -4) = 0; *(float *)(modeEntry + -4) = shade; *(float *)((int)modeEntry + -0x1c) = shade; *(float *)(modeEntry + -3) = shade; *(undefined4 *)((int)modeEntry + -0x14) = 0x3f800000; *modeEntry = 0; *(undefined4 *)(modeEntry + 1) = 0; } iVar1 = *(int *)((int)modeEntry + 0x54); if (*(char *)((int)modeEntry + 0x4d) == '\0') { if (0 < iVar1) { iVar1 = iVar1 + -1; goto LAB_008cc176; } } else if (iVar1 < 7) { iVar1 = iVar1 + 1; LAB_008cc176: *(int *)((int)modeEntry + 0x54) = iVar1; } iVar2 = iVar2 + 1; modeEntry = modeEntry + 0x24; fStack_2c = shade; fStack_28 = shade; if (5 < iVar2) { Menu_CreateLobby::update_paper_layers(); return; } } while( true ); } //@@ 008cc1a0 Menu_Online::render_mode_select /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? MenuManager::Render passes ECX=MenuManager+0xedd8 (the Rep+ online mode menu whose Update 008cbfe0 Menu_OnlineMode::Update Menu_Online::update_mode_select); BackButton/BackKey/ChallengeBox layers, Menu_Challenge::render_seed_text */ void Menu_Online::render_mode_select(void) { Vector pos; Vector scale; LayerState *backKeyLayer; float *nullFrame; ANM2 *in_ECX; AnimationState *secondAnimState; int iVar1; byte *buttonLoaded; undefined4 local_68; undefined4 uStack_64; undefined4 uStack_60; void *pvStack_5c; undefined4 local_48; undefined4 uStack_44; undefined4 local_40; int lobbyGameMode; float originY; float originX; Vector menuPos; int gameMode; int buttonIdx; Vector nullPos; byte isKeyboard; undefined4 local_14; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; isKeyboard = g_menuControllerIndex == 0; lobbyGameMode = (g_manager->_lobbySettings)._gameMode; backKeyLayer = ANM2::GetLayer(in_ECX,(byte *)"BackKey"); local_48 = 0; backKeyLayer->_visible = isKeyboard; pvStack_5c = in_ECX[7]._overlayAnimState._nullLayerFrames; uStack_44 = 0; local_40 = 0; local_68 = 0x3f800000; uStack_64 = 0x3f800000; uStack_60 = 0x3f800000; if (&in_ECX->_color != (ColorMod *)&local_68) { (in_ECX->_color)._colorize[0] = 0.0; (in_ECX->_color)._colorize[1] = 0.0; (in_ECX->_color)._colorize[2] = 0.0; (in_ECX->_color)._colorize[3] = 0.0; (in_ECX->_color)._tint[0] = 1.0; (in_ECX->_color)._tint[1] = 1.0; (in_ECX->_color)._tint[2] = 1.0; (in_ECX->_color)._tint[3] = (float)pvStack_5c; (in_ECX->_color)._offset[0] = 0.0; (in_ECX->_color)._offset[1] = 0.0; (in_ECX->_color)._offset[2] = 0.0; } menuPos.x = (g_menuManager->_ViewPosition).x + (float)in_ECX[7]._overlayAnimState._animation; menuPos.y = (g_menuManager->_ViewPosition).y + (float)in_ECX[7]._overlayAnimState._animData; if (in_ECX->_loaded != 0) { if (in_ECX->_overlayRenderFirst == 0) { AnimationState::Render(&in_ECX->_animState,&menuPos,&g_vectorZero,&g_vectorZero); secondAnimState = &in_ECX->_overlayAnimState; } else { AnimationState::Render(&in_ECX->_overlayAnimState,&menuPos,&g_vectorZero,&g_vectorZero); secondAnimState = &in_ECX->_animState; } AnimationState::Render(secondAnimState,&menuPos,&g_vectorZero,&g_vectorZero); } buttonLoaded = &in_ECX[1]._loaded; originX = (g_menuManager->_ViewPosition).x + (float)in_ECX[7]._overlayAnimState._animation; originY = (g_menuManager->_ViewPosition).y + (float)in_ECX[7]._overlayAnimState._animData; iVar1 = (g_manager->_lobbySettings)._gameMode; buttonIdx = 0; gameMode = iVar1; do { if (((iVar1 != 4) || (buttonIdx != 4)) && ((in_ECX->_animState)._animData != (void *)0x0)) { nullFrame = AnimationState::GetNullFrame(&in_ECX->_animState,(&PTR_DAT_00b756f0)[buttonIdx]); if (nullFrame != (float *)0x0) { nullPos.x = originX + *nullFrame + 0.0; nullPos.y = (float)-*(int *)(buttonLoaded + 0x13) + originY + nullFrame[1]; if (*buttonLoaded != 0) { if (buttonLoaded[-0x99] == 0) { AnimationState::Render ((AnimationState *)(buttonLoaded + -0xd9),&nullPos,&g_vectorZero,&g_vectorZero ); secondAnimState = (AnimationState *)(buttonLoaded + -0xb9); } else { AnimationState::Render ((AnimationState *)(buttonLoaded + -0xb9),&nullPos,&g_vectorZero,&g_vectorZero ); secondAnimState = (AnimationState *)(buttonLoaded + -0xd9); } AnimationState::Render(secondAnimState,&nullPos,&g_vectorZero,&g_vectorZero); } } iVar1 = gameMode; } buttonIdx = buttonIdx + 1; buttonLoaded = buttonLoaded + 0x120; } while (buttonIdx < 6); if ((iVar1 == 4) && ((in_ECX->_animState)._animData != (void *)0x0)) { nullFrame = AnimationState::GetNullFrame(&in_ECX->_animState,(byte *)"ChallengeBox"); if (nullFrame != (float *)0x0) { nullPos.x = originX + *nullFrame; nullPos.y = originY + nullFrame[1]; FUN_008cb6f0(&nullPos); } } if ((lobbyGameMode != 4) && (((g_manager->_lobbySettings)._seed._size != 0 || (*(char *)&in_ECX[7]._overlayAnimState._layerFrames != '\0')))) { Menu_Challenge::render_seed_text(); } if (isKeyboard == 0) { if ((in_ECX->_animState)._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(&in_ECX->_animState,(byte *)"BackButton"); } nullPos.x = *nullFrame + menuPos.x; nullPos.y = nullFrame[1] + menuPos.y; pos.y = nullPos.y; pos.x = nullPos.x; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0xf,0,0, (ColorMod) ZEXT1644(CONCAT412(in_ECX[7]._overlayAnimState._nullLayerFrames, CONCAT48(0x3f800000,0x3f8000003f800000))),pos,scale); } return; } //@@ 008cc530 FUN_008cc530 void FUN_008cc530(void) { Manager *pMVar1; int in_ECX; undefined4 *puVar2; int iVar3; pMVar1 = g_manager; if (*(int *)(in_ECX + 0x7d8) == 5) { *(undefined4 *)(in_ECX + 0x7d8) = 0; } if (((pMVar1->_lobbySettings)._gameMode == 4) && ((pMVar1->_lobbySettings)._challenge == 0)) { (pMVar1->_lobbySettings)._gameMode = 0; } Menu_OnlineMode::play_idle_animation(); iVar3 = 0; puVar2 = (undefined4 *)(in_ECX + 0x230); do { FUN_008cd670(iVar3); iVar3 = iVar3 + 1; puVar2[-1] = 0; *puVar2 = 0; *(undefined2 *)(puVar2 + -2) = 0; puVar2 = puVar2 + 0x48; } while (iVar3 < 6); *(undefined1 *)(*(int *)(in_ECX + 0x7d8) * 0x120 + 0x228 + in_ECX) = 1; *(undefined4 *)(*(int *)(in_ECX + 0x7d8) * 0x120 + 0x22c + in_ECX) = 7; *(undefined1 *)(in_ECX + 0x7e4) = 0; *(undefined1 *)(in_ECX + 0x7d4) = 1; return; } //@@ 008cc5e0 Menu_CreateLobby::update_paper_layers /* DB: ? two ANM2s at ECX+0x114 (stride 0x120): hides every layer, shows "Paper", then DailyMode/ModeTitle/Challenge/Players/Password/TagTitle/Arrows per Manager _lobbySettings (gameMode) with ANM2::SetLayerFrame; from Menu_CreateLobby::load_graphics and Menu_OnlineMode::Update */ void Menu_CreateLobby::update_paper_layers(void) { int iVar1; LayerState *pLVar2; int in_ECX; int paperIndex; ANM2 *paper; byte *layerIndex; uint frame; int lobbyMode; Manager *manager; int settingValue; manager = g_manager; paperIndex = 0; iVar1 = (g_manager->_lobbySettings)._gameMode; lobbyMode = *(int *)&g_manager->_lobbySettings; do { layerIndex = (byte *)0x0; paper = (ANM2 *)(in_ECX + 0x114 + paperIndex * 0x120); if (paper->_layerCount != 0) { do { pLVar2 = ANM2::GetLayer(paper,layerIndex); layerIndex = layerIndex + 1; pLVar2->_visible = 0; } while (layerIndex < (byte *)paper->_layerCount); } pLVar2 = ANM2::GetLayer(paper,(byte *)"Paper"); pLVar2->_visible = 1; if (paperIndex == 0) { if (*(int *)&manager->_lobbySettings == 2) { pLVar2 = ANM2::GetLayer(paper,(byte *)"DailyMode"); pLVar2->_visible = 1; pLVar2 = ANM2::GetLayer(paper,(byte *)"DailyMode"); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,*(int *)(in_ECX + 0x7f0)); } } else { pLVar2 = ANM2::GetLayer(paper,(byte *)"ModeTitle"); pLVar2->_visible = 1; pLVar2 = ANM2::GetLayer(paper,&DAT_00b734e0); pLVar2->_visible = 1; pLVar2 = ANM2::GetLayer(paper,(byte *)"ModeTitle"); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,1); } settingValue = (manager->_lobbySettings)._gameMode; pLVar2 = ANM2::GetLayer(paper,&DAT_00b734e0); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,settingValue + 1); } } pLVar2 = ANM2::GetLayer(paper,(byte *)"Arrows"); pLVar2->_visible = *(byte *)(in_ECX + 0x229); } else if (paperIndex == 2) { if (iVar1 == 4) { LAB_008cc99f: pLVar2 = ANM2::GetLayer(paper,(byte *)"Password"); pLVar2->_visible = 1; frame = (uint)((manager->_lobbySettings)._password._size != 0); pLVar2 = ANM2::GetLayer(paper,(byte *)"Password"); if (pLVar2 != (LayerState *)0x0) goto LAB_008cc9e5; KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { pLVar2 = ANM2::GetLayer(paper,(byte *)"TagTitle"); pLVar2->_visible = 1; pLVar2 = ANM2::GetLayer(paper,&DAT_00b75640); pLVar2->_visible = 1; settingValue = *(int *)&(manager->_lobbySettings).field_0x14; pLVar2 = ANM2::GetLayer(paper,(byte *)"TagTitle"); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,(uint)(settingValue != 0)); } pLVar2 = ANM2::GetLayer(paper,&DAT_00b75640); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData, *(int *)&(manager->_lobbySettings).field_0x14); } pLVar2 = ANM2::GetLayer(paper,(byte *)"Arrows"); pLVar2->_visible = *(byte *)(in_ECX + 0x469); } } else if (paperIndex == 1) { pLVar2 = ANM2::GetLayer(paper,(byte *)"Players"); pLVar2->_visible = 1; settingValue = (manager->_lobbySettings)._maxPlayers; pLVar2 = ANM2::GetLayer(paper,(byte *)"Players"); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,settingValue + -2); } pLVar2 = ANM2::GetLayer(paper,(byte *)"Arrows"); pLVar2->_visible = *(byte *)(in_ECX + 0x349); } else if (paperIndex == 3) { if (iVar1 == 4) { pLVar2 = ANM2::GetLayer(paper,(byte *)"ChallengeTitle"); pLVar2->_visible = 1; settingValue = (manager->_lobbySettings)._challenge; pLVar2 = ANM2::GetLayer(paper,(byte *)"ChallengeTitle"); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,(uint)(0 < settingValue)); } pLVar2 = ANM2::GetLayer(paper,(byte *)"Challenge"); pLVar2->_visible = 1; pLVar2 = ANM2::GetLayer(paper,(byte *)"Challenge"); if (pLVar2 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { frame = (manager->_lobbySettings)._challenge; LAB_008cc9e5: ANM2::SetLayerFrame(paper,*(int *)pLVar2->_layerData,frame); } } else if (lobbyMode != 2) { pLVar2 = ANM2::GetLayer(paper,&DAT_00b7562c); pLVar2->_visible = 1; if (((manager->_lobbySettings)._seed._size == 0) && (*(char *)(in_ECX + 0x7e4) == '\0')) { frame = 0; } else { frame = 1; } pLVar2 = ANM2::GetLayer(paper,&DAT_00b7562c); if (pLVar2 != (LayerState *)0x0) goto LAB_008cc9e5; KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } } else if (paperIndex == 4) goto LAB_008cc99f; paperIndex = paperIndex + 1; if (5 < paperIndex) { return; } } while( true ); } //@@ 008cca10 Menu_OnlineMode::play_idle_animation /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Menu_OnlineMode::Update and FUN_008cc530 (menu enter via MenuManager::SetState); ECX is the menu ANM2: plays 'Idle_FriendMatch'/'Idle_DailyMatch'/'Idle_Challenge' by the current lobby mode and sets layer 'Title' frame to g_manager->_lobbySettings */ void Menu_OnlineMode::play_idle_animation(void) { byte bVar1; byte *curAnimChar; uint uVar2; LayerState *titleLayer; ANM2 *in_ECX; char *challengeNameChar; byte *idleNameChar; bool isLess; byte *idleAnimName; byte idleAnimNames [16]; undefined4 local_60; uint local_5c; char *local_58; undefined4 local_48; undefined4 local_44; undefined8 local_40; char local_38 [20]; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; int lobbyMode; Manager *manager; manager = g_manager; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b05a78; local_1c = ExceptionList; securityCookie = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; if ((g_manager->_lobbySettings)._gameMode != 4) { local_5c = 0xf; local_60 = 4; idleAnimNames[0] = 0x49; idleAnimNames[1] = 100; idleAnimNames[2] = 0x6c; idleAnimNames[3] = 0x65; idleAnimNames[4] = 0; local_14 = 0; local_48 = 0; local_44 = 0xf; local_58 = (char *)0x0; local_58 = std::_Allocate(0x20); local_48 = 0x10; local_44 = 0x1f; builtin_strncpy(local_58,"Idle_FriendMatch",0x11); builtin_strncpy(local_38,"lyMatch",8); local_38[0xc] = '\x0f'; local_38[0xd] = '\0'; local_38[0xe] = '\0'; local_38[0xf] = '\0'; local_38[8] = '\x0f'; local_38[9] = '\0'; local_38[10] = '\0'; local_38[0xb] = '\0'; local_40 = 0x6961445f656c6449; local_14 = 2; lobbyMode = *(int *)&manager->_lobbySettings; idleAnimName = idleAnimNames + lobbyMode * 0x18; if (0xf < *(uint *)(idleAnimNames + lobbyMode * 0x18 + 0x14)) { idleAnimName = *(byte **)idleAnimName; } animData = (in_ECX->_animState)._animData; if (animData != (byte *)0x0) { curAnimChar = animData; idleNameChar = idleAnimName; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar1 = *curAnimChar; isLess = bVar1 < *idleNameChar; if (bVar1 != *idleNameChar) { LAB_008ccc04: uVar2 = -(uint)isLess | 1; goto LAB_008ccc09; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < idleNameChar[1]; if (bVar1 != idleNameChar[1]) goto LAB_008ccc04; curAnimChar = curAnimChar + 2; idleNameChar = idleNameChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_008ccc09: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((in_ECX->_animState)._isPlaying != 0)))) goto LAB_008ccc34; } bVar1 = ANM2::SetAnimation(in_ECX,idleAnimName,1); if (bVar1 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_008ccc34: local_14 = 0xffffffff; _eh_vector_destructor_iterator_(idleAnimNames,0x18,3,std::string::_Tidy_deallocate); ExceptionList = local_1c; return; } animData = (in_ECX->_animState)._animData; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } challengeNameChar = "Idle_Challenge"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*challengeNameChar; if (bVar1 != *challengeNameChar) { LAB_008ccaa0: uVar2 = -(uint)isLess | 1; goto LAB_008ccaa5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)challengeNameChar[1]; if (bVar1 != challengeNameChar[1]) goto LAB_008ccaa0; curAnimChar = curAnimChar + 2; challengeNameChar = challengeNameChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_008ccaa5: if ((uVar2 == 0) && ((puStack_20 = local_38 + 0x34, animData[0x34] == 0 || (puStack_20 = local_38 + 0x34, (in_ECX->_animState)._isPlaying != 0)))) goto LAB_008ccad1; } puStack_20 = local_38 + 0x34; bVar1 = ANM2::SetAnimation(in_ECX,(byte *)"Idle_Challenge",1); if (bVar1 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_008ccad1: titleLayer = ANM2::GetLayer(in_ECX,(byte *)"Title"); if (titleLayer == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(in_ECX,*(int *)titleLayer->_layerData,*(int *)&manager->_lobbySettings); } ExceptionList = local_1c; return; } //@@ 008ccc70 Menu_OnlineMode::update_mode_select /* DB: ? ECX = MenuManager+0xedd8; parent 008cbfe0 Menu_OnlineMode::Update case 0x15 of MenuManager::Update (Menu_Online is +0xda98) (was Menu_Online::update_mode_select) prototype: db/protos.zhl */ void __thiscall Menu_OnlineMode::update_mode_select(void *lobbySettings) { Manager *pMVar1; char isActionTriggered; uint uVar2; int iVar3; std_string *seedStr; LobbySettings *lobbySettings; bool bVar4; undefined4 local_20; undefined4 actionId; undefined4 actionMenuUp; undefined4 actionMenuRight; undefined4 actionMenuLeft; int local_c; int gameMode; Manager *manager; int *maxPlayers; undefined4 savedLobbyType; int selection; manager = g_manager; actionMenuLeft = 0x14; gameMode = (g_manager->_lobbySettings)._gameMode; iVar3 = *(int *)&g_manager->_lobbySettings; lobbySettings = &g_manager->_lobbySettings; local_c = *(int *)((int)lobbySettings + 0x7d8); isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionMenuLeft,0,0); if (isActionTriggered == '\0') { actionMenuRight = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionMenuRight,0,0); if (isActionTriggered == '\0') { actionMenuUp = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionMenuUp,0,0); if (isActionTriggered == '\0') { actionId = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,0); if ((isActionTriggered != '\0') && (selection = *(int *)((int)lobbySettings + 0x7d8), *(char *)(selection * 0x120 + 0x229 + (int)lobbySettings) == '\0')) { if (iVar3 == 2) { if (selection != 0) { bVar4 = selection == 1; goto LAB_008cd0bf; } *(undefined4 *)((int)lobbySettings + 0x7d8) = 2; } else if (gameMode == 4) { if ((selection != 0) && (selection != 1)) { LAB_008cd0dc: bVar4 = selection == 2; goto LAB_008cd0df; } LAB_008cd11b: *(undefined4 *)((int)lobbySettings + 0x7d8) = 3; } else if (iVar3 == 0) { if (selection == 0) goto LAB_008cd11b; if (selection != 1) goto LAB_008cd0dc; *(undefined4 *)((int)lobbySettings + 0x7d8) = 4; } else { if (selection != 0) { bVar4 = selection == 1; goto LAB_008cd119; } *(undefined4 *)((int)lobbySettings + 0x7d8) = 2; } } } else { selection = *(int *)((int)lobbySettings + 0x7d8); if (*(char *)(selection * 0x120 + 0x229 + (int)lobbySettings) == '\0') { if (iVar3 == 2) { if (selection == 2) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 0; } else { bVar4 = selection == 4; LAB_008cd053: if (bVar4) goto LAB_008cd059; } } else if (gameMode == 4) { if ((selection == 3) || (selection == 4)) goto LAB_008cd059; LAB_008ccffc: if (selection == 5) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 2; } } else if (iVar3 == 0) { if (selection == 3) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 0; } else { if (selection != 4) goto LAB_008ccffc; *(undefined4 *)((int)lobbySettings + 0x7d8) = 1; } } else { if (selection != 2) { bVar4 = selection == 3; goto LAB_008cd053; } *(undefined4 *)((int)lobbySettings + 0x7d8) = 0; } } } } else { selection = *(int *)((int)lobbySettings + 0x7d8); if (*(char *)(selection * 0x120 + 0x229 + (int)lobbySettings) == '\0') { if (iVar3 == 2) { if (selection == 0) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 1; } else { if (selection == 2) goto LAB_008cd0c1; if (selection == 1) goto LAB_008cd0e1; LAB_008ccf0e: bVar4 = selection == 4; LAB_008cd0df: if (bVar4) { LAB_008cd0e1: *(undefined4 *)((int)lobbySettings + 0x7d8) = 5; } } } else if ((gameMode == 4) || (iVar3 == 0)) { if (selection == 0) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 1; } else if (selection == 1) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 2; } else { if (selection != 3) goto LAB_008ccf0e; if (gameMode == 4) goto LAB_008cd0e1; *(undefined4 *)((int)lobbySettings + 0x7d8) = 4; } } else { if (selection != 0) { if (selection == 2) goto LAB_008cd11b; if (selection != 1) { bVar4 = selection == 3; goto LAB_008cd0df; } goto LAB_008cd0e1; } LAB_008cd059: *(undefined4 *)((int)lobbySettings + 0x7d8) = 1; } } else if (selection == 0) { if (*(int *)lobbySettings == 2) { uVar2 = *(int *)((int)lobbySettings + 0x7f0) + 1U & 0x80000001; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xfffffffe) + 1; } *(uint *)((int)lobbySettings + 0x7f0) = uVar2; } else { (manager->_lobbySettings)._gameMode = ((manager->_lobbySettings)._gameMode + 1) % 5; } } else if (selection == 1) { maxPlayers = &(manager->_lobbySettings)._maxPlayers; *maxPlayers = *maxPlayers + 1; if (4 < (manager->_lobbySettings)._maxPlayers) { (manager->_lobbySettings)._maxPlayers = 2; } } else if (selection == 2) { *(int *)&(manager->_lobbySettings).field_0x14 = (*(int *)&(manager->_lobbySettings).field_0x14 + 1) % 6; } } } else { selection = *(int *)((int)lobbySettings + 0x7d8); if (*(char *)(selection * 0x120 + 0x229 + (int)lobbySettings) == '\0') { if (iVar3 == 2) { if (selection == 1) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 0; } else if (selection == 4) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 2; } else { bVar4 = selection == 5; LAB_008cd0bf: if (bVar4) { LAB_008cd0c1: *(undefined4 *)((int)lobbySettings + 0x7d8) = 4; } } } else if ((gameMode == 4) || (iVar3 == 0)) { if (selection == 1) goto LAB_008ccdd5; if (selection == 2) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 1; } else if (selection == 4) { if (gameMode != 4) goto LAB_008cd11b; } else if (selection == 5) { if (gameMode == 4) goto LAB_008cd11b; *(undefined4 *)((int)lobbySettings + 0x7d8) = 4; } } else if (selection == 1) { LAB_008ccdd5: *(undefined4 *)((int)lobbySettings + 0x7d8) = 0; } else if (selection == 3) { *(undefined4 *)((int)lobbySettings + 0x7d8) = 2; } else { bVar4 = selection == 5; LAB_008cd119: if (bVar4) goto LAB_008cd11b; } } else if (selection == 0) { if (*(int *)lobbySettings == 2) { iVar3 = 1; if (*(int *)((int)lobbySettings + 0x7f0) != 0) { iVar3 = *(int *)((int)lobbySettings + 0x7f0) + -1; } *(int *)((int)lobbySettings + 0x7f0) = iVar3; } else { iVar3 = (manager->_lobbySettings)._gameMode; if (iVar3 == 0) { (manager->_lobbySettings)._gameMode = 4; } else { (manager->_lobbySettings)._gameMode = iVar3 + -1; } } } else if (selection == 1) { maxPlayers = &(manager->_lobbySettings)._maxPlayers; *maxPlayers = *maxPlayers + -1; if ((manager->_lobbySettings)._maxPlayers < 2) { (manager->_lobbySettings)._maxPlayers = 4; } } else if (selection == 2) { iVar3 = *(int *)&(manager->_lobbySettings).field_0x14; if (iVar3 == 0) { *(undefined4 *)&(manager->_lobbySettings).field_0x14 = 5; } else { *(int *)&(manager->_lobbySettings).field_0x14 = iVar3 + -1; } } } pMVar1 = g_manager; if (*(int *)((int)lobbySettings + 0x7d8) != local_c) { iVar3 = local_c * 0x120; local_c = 0x11a; *(undefined1 *)(iVar3 + 0x228 + (int)lobbySettings) = 0; *(undefined1 *)(*(int *)((int)lobbySettings + 0x7d8) * 0x120 + 0x228 + (int)lobbySettings) = 1; seed_fart_sound_override(&local_c); SoundEffects::Play(&pMVar1->_sfxManager,local_c,1.0,2,0,1.0,0.0); } local_20 = 0; actionId = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,&local_20); if (isActionTriggered == '\0') { actionId = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,0); if (isActionTriggered != '\0') { iVar3 = *(int *)((int)lobbySettings + 0x7d8) * 0x120; if (*(char *)(iVar3 + 0x229 + (int)lobbySettings) == '\0') { savedLobbyType = *(undefined4 *)lobbySettings; LobbySettings::reset(lobbySettings); *(undefined4 *)lobbySettings = savedLobbyType; FUN_0098aec0(); } else { *(undefined1 *)(iVar3 + 0x229 + (int)lobbySettings) = 0; if (((*(int *)((int)lobbySettings + 0x7d8) == 0) && ((manager->_lobbySettings)._gameMode == 4)) && ((manager->_lobbySettings)._challenge == 0)) { (manager->_lobbySettings)._gameMode = 0; return; } } } } else { iVar3 = *(int *)((int)lobbySettings + 0x7d8); if (iVar3 == 5) { LobbyList::clear(&g_manager[1]._gamestate.field_0x288); if (gameMode == 4) { seedStr = &(manager->_lobbySettings)._seed; if (0xf < (manager->_lobbySettings)._seed._capacity) { seedStr = *(std_string **)(manager->_lobbySettings)._seed._buf; } (manager->_lobbySettings)._seed._size = 0; seedStr->_buf[0] = '\0'; *(undefined4 *)&(manager->_lobbySettings).field_0x14 = 0; } else { (manager->_lobbySettings)._challenge = 0; } iVar3 = *(int *)lobbySettings; if (iVar3 == 0) { LAB_008cd23c: FUN_00907230(lobbySettings); return; } if (iVar3 == 1) { LAB_008cd263: FUN_00907460(lobbySettings); return; } if (iVar3 == 2) { (manager->_lobbySettings)._gameMode = 5; if (*(int *)((int)lobbySettings + 0x7f0) == 0) { *(undefined4 *)lobbySettings = 0; goto LAB_008cd23c; } if (*(int *)((int)lobbySettings + 0x7f0) == 1) { *(undefined4 *)lobbySettings = 1; goto LAB_008cd263; } } } else { if (iVar3 != 0) { if (iVar3 == 1) { *(bool *)((int)lobbySettings + 0x349) = *(char *)((int)lobbySettings + 0x349) == '\0'; return; } if (iVar3 == 2) { if (gameMode != 4) { *(bool *)((int)lobbySettings + 0x469) = *(char *)((int)lobbySettings + 0x469) == '\0'; return; } } else { if (iVar3 == 3) { if (gameMode != 4) { g_manager->_isHotkeysEnabled = 0; *(undefined1 *)((int)lobbySettings + 0x7e4) = 1; return; } goto LAB_008cd2af; } if (iVar3 != 4) { return; } if (gameMode == 4) { MenuManager::push_menu(7,4); return; } } if ((manager->_lobbySettings)._password._size == 0) { FUN_0085b790(); return; } FUN_0040c2f0(); return; } *(bool *)((int)lobbySettings + 0x229) = *(char *)((int)lobbySettings + 0x229) == '\0'; if ((*(char *)((int)lobbySettings + 0x229) == '\0') && ((manager->_lobbySettings)._gameMode == 4)) { LAB_008cd2af: MenuManager::push_menu(7,iVar3); return; } } } return; } //@@ 008cd3f0 Menu_OnlineMode::update_seed_input /* DB: thiscall, only caller Menu_OnlineMode::Update (0x8cc097); polls keyboard via input vtable +0x74 for keys A-Z and 0-9 (GLFW codes 0x41.., 0x30..), backspace 0x103, appends into g_manager->_lobbySettings._seed (max 9 chars, space after 4), toggles _isHotkeysEnabled */ void Menu_OnlineMode::update_seed_input(void) { char cVar1; std_string *seed; std_string *seedData; uint uVar2; int in_ECX; char *textEnd; uint uVar3; byte keyChar; int keyCode; int queryKey; undefined2 local_8; undefined2 uStack_6; Manager *manager; manager = g_manager; _local_8 = 0xf; seed = &(g_manager->_lobbySettings)._seed; *(undefined1 *)(in_ECX + 0x589) = 1; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_8,0,0); if (cVar1 != '\0') { *(undefined1 *)(in_ECX + 0x7e4) = 0; if (0xf < (manager->_lobbySettings)._seed._capacity) { seed = *(std_string **)seed->_buf; } (manager->_lobbySettings)._seed._size = 0; seed->_buf[0] = '\0'; g_manager->_isHotkeysEnabled = 1; *(undefined1 *)(in_ECX + 0x589) = 0; return; } _local_8 = 0xe; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_8,0,0); if (cVar1 != '\0') { apply_lobby_seed(); return; } if ((manager->_lobbySettings)._seed._size < 9) { keyChar = 0x41; keyCode = 0x41; do { queryKey = keyCode; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&queryKey,0,0); if (cVar1 != '\0') { textEnd = (char *)&local_8; local_8 = (ushort)keyChar; do { cVar1 = *textEnd; textEnd = textEnd + 1; } while (cVar1 != '\0'); std::string::append(seed->_buf,(byte *)&local_8,(int)textEnd - ((int)&local_8 + 1)); } keyChar = keyChar + 1; keyCode = keyCode + 1; } while ((char)keyChar < '['); keyChar = 0x30; keyCode = 0x30; do { queryKey = keyCode; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&queryKey,0,0); if (cVar1 != '\0') { textEnd = (char *)&local_8; local_8 = (ushort)keyChar; do { cVar1 = *textEnd; textEnd = textEnd + 1; } while (cVar1 != '\0'); std::string::append(seed->_buf,(byte *)&local_8,(int)textEnd - ((int)&local_8 + 1)); } keyChar = keyChar + 1; keyCode = keyCode + 1; } while ((char)keyChar < ':'); if ((manager->_lobbySettings)._seed._size == 4) { textEnd = (char *)&local_8; _local_8 = CONCAT22(uStack_6,0x20); do { cVar1 = *textEnd; textEnd = textEnd + 1; } while (cVar1 != '\0'); std::string::append(seed->_buf,(byte *)&local_8,(int)textEnd - ((int)&local_8 + 1)); } } queryKey = 0x103; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&queryKey,0,0); if ((cVar1 != '\0') && (uVar2 = (manager->_lobbySettings)._seed._size, uVar2 != 0)) { if (uVar2 == 5) { seedData = seed; if (0xf < (manager->_lobbySettings)._seed._capacity) { seedData = *(std_string **)seed->_buf; } (manager->_lobbySettings)._seed._size = 3; seedData->_buf[3] = '\0'; } else { uVar3 = uVar2 - 1; if (uVar2 < uVar3) { std::string::append_n(seed->_buf,0xffffffff,0); } else { seedData = seed; if (0xf < (manager->_lobbySettings)._seed._capacity) { seedData = *(std_string **)seed->_buf; } (manager->_lobbySettings)._seed._size = uVar3; seedData->_buf[uVar3] = '\0'; } } } uVar2 = 0; if ((manager->_lobbySettings)._seed._size != 0) { do { uVar3 = (manager->_lobbySettings)._seed._capacity; seedData = seed; if (0xf < uVar3) { seedData = *(std_string **)seed->_buf; } if (seedData->_buf[uVar2] == 'O') { seedData = seed; if (0xf < uVar3) { seedData = *(std_string **)seed->_buf; } seedData->_buf[uVar2] = '0'; uVar3 = (manager->_lobbySettings)._seed._capacity; } seedData = seed; if (0xf < uVar3) { seedData = *(std_string **)seed->_buf; } if (seedData->_buf[uVar2] == 'I') { seedData = seed; if (0xf < uVar3) { seedData = *(std_string **)seed->_buf; } seedData->_buf[uVar2] = '1'; uVar3 = (manager->_lobbySettings)._seed._capacity; } seedData = seed; if (0xf < uVar3) { seedData = *(std_string **)seed->_buf; } if (seedData->_buf[uVar2] == 'U') { seedData = seed; if (0xf < uVar3) { seedData = *(std_string **)seed->_buf; } seedData->_buf[uVar2] = 'V'; } uVar2 = uVar2 + 1; } while (uVar2 < (manager->_lobbySettings)._seed._size); } return; } //@@ 008cd670 FUN_008cd670 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008cd670(int param_1) { bool bVar1; byte bVar2; char *text; byte ****ppppbVar3; int in_ECX; uint uVar4; int iVar5; byte ****local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; byte ***local_8; puStack_c = &LAB_00af18ad; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; if (((g_manager->_lobbySettings)._gameMode == 4) && ((param_1 == 3 || (param_1 == 4)))) { bVar1 = true; } else { bVar1 = false; } local_20 = 0; local_1c = 0xf; local_30[0] = (byte ****)0x0; local_8 = (byte ***)0x0; if (param_1 == 5) { text = "Small"; uVar4 = 5; } else if (bVar1) { text = "Large"; uVar4 = 5; } else { text = "Medium"; uVar4 = 6; } std::string::append((char *)local_30,(byte *)text,uVar4); iVar5 = 3; if (!bVar1) { iVar5 = param_1; } iVar5 = iVar5 * 0x120; ppppbVar3 = (byte ****)local_30; if (0xf < local_1c) { ppppbVar3 = local_30[0]; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x114 + iVar5),(byte *)ppppbVar3,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x144 + iVar5)); *(undefined1 *)(iVar5 + 0x158 + in_ECX) = 1; } if (0xf < local_1c) { uVar4 = local_1c + 1; ppppbVar3 = local_30[0]; if (0xfff < uVar4) { ppppbVar3 = (byte ****)local_30[0][-1]; uVar4 = local_1c + 0x24; if ((byte *)0x1f < (byte *)((int)local_30[0] + (-4 - (int)ppppbVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,uVar4); } ExceptionList = local_10; return; } //@@ 008cd7b0 Menu_Challenge::render_seed_text /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Menu_Challenge::Render body 008cc1a0 Menu_Online::render_mode_select GetNullFrame "SeedPos" then Font::DrawStringScaled */ void Menu_Challenge::render_seed_text(void) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; void *pvVar4; float *nullFrame; undefined4 ******ppppppuVar5; std_string *psVar6; std_string *psVar7; void *ptr; int in_ECX; undefined4 ******ppppppuVar8; uint size; uint uVar9; undefined4 ******ppppppuVar10; undefined4 ******ppppppuVar11; undefined4 drawParams; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; Vector textPos; float textY; int menu; std_string *linesBegin; std_string *linesEnd; std_string *linesCapacity; undefined4 ******local_64; undefined4 ******local_60; undefined4 ******local_5c; undefined4 ******local_58; void *seedPart; KColor local_50; undefined4 ******seedText [4]; undefined4 ******seedTextSize; undefined4 ******seedTextCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 *****local_14; puStack_20 = (undefined1 *)(seedText + 0xe); local_14 = (undefined4 *****)0xffffffff; puStack_18 = &LAB_00b05ad0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(seedText + 0xb); ExceptionList = &local_1c; if (*(int *)(in_ECX + 0x34) != 0) { menu = in_ECX; pvVar4 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x30),&DAT_00b75670); if (((pvVar4 == (void *)0x0) || (*(int *)(in_ECX + 0x4a8) == 0)) || (pvVar4 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x4a4),(byte *)"SeedPos"), pvVar4 == (void *)0x0)) goto LAB_008cddc4; local_58 = (undefined4 ******)((g_menuManager->_ViewPosition).x + *(float *)(in_ECX + 0x7dc)); local_5c = (undefined4 ******)((g_menuManager->_ViewPosition).y + *(float *)(in_ECX + 0x7e0)); if (*(int *)(in_ECX + 0x34) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x30),&DAT_00b75670); } local_58 = (undefined4 ******)((float)local_58 + *nullFrame); local_5c = (undefined4 ******)((float)local_5c + nullFrame[1]); if (*(int *)(in_ECX + 0x4a8) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x4a4),(byte *)"SeedPos") ; } textPos.x = (float)local_58 + *nullFrame + 0.0; textPos.y = (float)-*(int *)(in_ECX + 0x590) + (float)local_5c + nullFrame[1]; textY = textPos.y; std::string::string((char *)seedText,&(g_manager->_lobbySettings)._seed); local_14._0_1_ = 0; local_14._1_3_ = 0; if (seedTextSize < &DAT_00000009) { ppppppuVar11 = seedTextSize; ppppppuVar10 = seedTextCapacity; LAB_008cd921: do { ppppppuVar5 = seedText[0]; if (ppppppuVar11 == (undefined4 ******)&DAT_00000004) { if (ppppppuVar10 < &DAT_00000005) { if ((undefined4 ******)(0x7fffffff - ((uint)ppppppuVar10 >> 1)) < ppppppuVar10) { ppppppuVar8 = (undefined4 ******)0x7fffffff; } else { ppppppuVar11 = (undefined4 ******)((int)ppppppuVar10 + ((uint)ppppppuVar10 >> 1)); ppppppuVar8 = (undefined4 ******)&DAT_0000000f; if (&DAT_0000000f < ppppppuVar11) { ppppppuVar8 = ppppppuVar11; } } local_60 = ppppppuVar10; local_64 = std::_Allocate((uint)((int)ppppppuVar8 + 1)); ppppppuVar11 = (undefined4 ******)&DAT_00000005; local_58 = (undefined4 ******)&DAT_00000005; seedTextSize = (undefined4 ******)&DAT_00000005; ppppppuVar10 = ppppppuVar8; seedTextCapacity = ppppppuVar8; if (local_60 < (undefined4 ******)0x10) { *local_64 = ppppppuVar5; *(undefined2 *)(local_64 + 1) = 0x20; seedText[0] = local_64; } else { ppppppuVar8 = (undefined4 ******)((int)local_60 + 1); *local_64 = *ppppppuVar5; *(undefined2 *)(local_64 + 1) = 0x20; ppppppuVar11 = ppppppuVar5; if ((undefined4 ******)0xfff < ppppppuVar8) { ppppppuVar11 = (undefined4 ******)ppppppuVar5[-1]; ppppppuVar8 = local_60 + 9; if (0x1f < (uint)((int)ppppppuVar5 + (-4 - (int)ppppppuVar11))) goto LAB_008cddb4; } operator_delete(ppppppuVar11,(uint)ppppppuVar8); seedText[0] = local_64; ppppppuVar11 = local_58; } goto LAB_008cd921; } seedTextSize = (undefined4 ******)&DAT_00000005; ppppppuVar11 = seedText; if (&DAT_0000000f < ppppppuVar10) { ppppppuVar11 = seedText[0]; } *(undefined2 *)(ppppppuVar11 + 1) = 0x20; ppppppuVar11 = seedTextSize; ppppppuVar8 = seedTextCapacity; } else if (ppppppuVar11 < ppppppuVar10) { seedTextSize = (undefined4 ******)((int)ppppppuVar11 + 1); ppppppuVar5 = seedText; if (&DAT_0000000f < ppppppuVar10) { ppppppuVar5 = seedText[0]; } *(undefined2 *)((int)ppppppuVar5 + (int)ppppppuVar11) = 0x2d; ppppppuVar11 = seedTextSize; ppppppuVar8 = seedTextCapacity; } else { local_5c = ppppppuVar11; if (ppppppuVar11 == (undefined4 ******)0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } local_58 = (undefined4 ******)((int)ppppppuVar11 + 1); ppppppuVar8 = (undefined4 ******)((uint)local_58 | 0xf); if (ppppppuVar8 < (undefined4 ******)0x80000000) { if ((undefined4 ******)(0x7fffffff - ((uint)ppppppuVar10 >> 1)) < ppppppuVar10) { ppppppuVar8 = (undefined4 ******)0x7fffffff; } else { ppppppuVar11 = (undefined4 ******)((int)ppppppuVar10 + ((uint)ppppppuVar10 >> 1)); if (ppppppuVar8 < ppppppuVar11) { ppppppuVar8 = ppppppuVar11; } } } else { ppppppuVar8 = (undefined4 ******)0x7fffffff; } local_64 = ppppppuVar10; local_60 = std::_Allocate((uint)((int)ppppppuVar8 + 1)); ppppppuVar11 = local_5c; seedTextSize = local_58; seedTextCapacity = ppppppuVar8; if (local_64 < (undefined4 ******)0x10) { memcpy(local_60,seedText,(size_t)local_5c); *(undefined2 *)((int)ppppppuVar11 + (int)local_60) = 0x2d; } else { memcpy(local_60,ppppppuVar5,(size_t)local_5c); *(undefined2 *)((int)local_5c + (int)local_60) = 0x2d; ppppppuVar10 = (undefined4 ******)((int)local_64 + 1); ppppppuVar11 = ppppppuVar5; if ((undefined4 ******)0xfff < ppppppuVar10) { ppppppuVar11 = (undefined4 ******)ppppppuVar5[-1]; ppppppuVar10 = local_64 + 9; if (0x1f < (uint)((int)ppppppuVar5 + (-4 - (int)ppppppuVar11))) goto LAB_008cddb4; } operator_delete(ppppppuVar11,(uint)ppppppuVar10); } ppppppuVar11 = local_58; seedText[0] = local_60; } ppppppuVar10 = ppppppuVar8; } while (ppppppuVar11 < &DAT_00000009); in_ECX = menu; } linesBegin = (std_string *)0x0; linesEnd = (std_string *)0x0; linesCapacity = (std_string *)0x0; local_14._0_1_ = 1; psVar6 = (std_string *)FUN_00651a90(&seedPart,0,4); local_14._0_1_ = 2; vector_string_emplace_reallocate_move(&linesBegin,(std_string *)0x0,psVar6); local_14._0_1_ = 1; if (0xf < (uint)local_50._unk) { uVar9 = local_50._unk + 1; pvVar4 = seedPart; if (0xfff < uVar9) { pvVar4 = *(void **)((int)seedPart + -4); uVar9 = local_50._unk + 0x24; if (0x1f < (uint)((int)seedPart + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar9); } psVar6 = (std_string *)FUN_00651a90(&seedPart,5,4); local_14._0_1_ = 3; if (linesEnd == linesCapacity) { vector_string_emplace_reallocate_move(&linesBegin,linesEnd,psVar6); } else { linesEnd->_buf[0] = '\0'; linesEnd->_buf[1] = '\0'; linesEnd->_buf[2] = '\0'; linesEnd->_buf[3] = '\0'; linesEnd->_size = 0; linesEnd->_capacity = 0; uVar1 = *(undefined4 *)(psVar6->_buf + 4); uVar2 = *(undefined4 *)(psVar6->_buf + 8); uVar3 = *(undefined4 *)(psVar6->_buf + 0xc); *(undefined4 *)linesEnd->_buf = *(undefined4 *)psVar6->_buf; *(undefined4 *)(linesEnd->_buf + 4) = uVar1; *(undefined4 *)(linesEnd->_buf + 8) = uVar2; *(undefined4 *)(linesEnd->_buf + 0xc) = uVar3; uVar9 = psVar6->_capacity; linesEnd->_size = psVar6->_size; linesEnd->_capacity = uVar9; linesEnd = linesEnd + 1; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; } psVar6 = linesEnd; local_14._0_1_ = 1; if (0xf < (uint)local_50._unk) { uVar9 = local_50._unk + 1; pvVar4 = seedPart; if (0xfff < uVar9) { pvVar4 = *(void **)((int)seedPart + -4); uVar9 = local_50._unk + 0x24; if (0x1f < (uint)((int)seedPart + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar9); } KColor::SetFromARGB(&local_50,0xff362f2d); local_50._alpha = *(float *)(in_ECX + 0x7e8); ppppppuVar11 = (undefined4 ******)(((int)psVar6 - (int)linesBegin) / 0x18); local_64 = ppppppuVar11; if (ppppppuVar11 != (undefined4 ******)0x0) { psVar6 = linesBegin; do { drawParams = 1; local_98 = 0xffff; local_94 = 0; local_90 = 0x3f800000; local_8c = 0xffffffff; local_88 = 0; local_84 = 0; local_14._0_1_ = 4; psVar7 = psVar6; if (0xf < psVar6->_capacity) { psVar7 = *(std_string **)psVar6->_buf; } Font::DrawStringScaled (&g_manager->_font3_TeamMeatEx16,(byte *)psVar7,&textPos,&local_50,&drawParams); local_14._0_1_ = 1; psVar6 = psVar6 + 1; textPos.y = (float)(ushort)(g_manager->_font3_TeamMeatEx16)._base + textY; ppppppuVar11 = (undefined4 ******)((int)ppppppuVar11 + -1); textY = textPos.y; } while (ppppppuVar11 != (undefined4 ******)0x0); psVar6 = linesEnd; } psVar7 = linesBegin; if (linesBegin != (std_string *)0x0) { for (; psVar7 != psVar6; psVar7 = psVar7 + 1) { uVar9 = psVar7->_capacity; if (0xf < uVar9) { pvVar4 = *(void **)psVar7->_buf; size = uVar9 + 1; ptr = pvVar4; if (0xfff < size) { ptr = *(void **)((int)pvVar4 + -4); size = uVar9 + 0x24; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) goto LAB_008cddb4; } operator_delete(ptr,size); } psVar7->_size = 0; psVar7->_capacity = 0xf; psVar7->_buf[0] = 0; } uVar9 = (((int)linesCapacity - (int)linesBegin) / 0x18) * 0x18; psVar6 = linesBegin; if (0xfff < uVar9) { psVar6 = (std_string *)linesBegin[-1]._capacity; uVar9 = uVar9 + 0x23; if ((byte *)0x1f < (byte *)((int)linesBegin + (-4 - (int)psVar6))) goto LAB_008cddb4; } operator_delete(psVar6,uVar9); } if (&DAT_0000000f < seedTextCapacity) { ppppppuVar10 = (undefined4 ******)((int)seedTextCapacity + 1); ppppppuVar11 = seedText[0]; if ((undefined4 ******)0xfff < ppppppuVar10) { ppppppuVar11 = (undefined4 ******)seedText[0][-1]; ppppppuVar10 = seedTextCapacity + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)seedText[0] + (-4 - (int)ppppppuVar11))) { LAB_008cddb4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppuVar11,(uint)ppppppuVar10); } } LAB_008cddc4: ExceptionList = local_1c; return; } //@@ 008cddf0 Menu_OnlineMode::apply_lobby_seed /* DB: ? only caller FUN_008cd3f0 (from Menu_OnlineMode::Update) after the keyboard confirm: 9-char Manager _lobbySettings._seed -> special seed (Seeds::GetSeedEffect: PersistentGameData unlock "Seed %d added to SaveState", RemoveBlockingSeedEffects, AddSeedEffect, Menu_SpecialSeeds::Reset) or Seeds::String2Seed/SetStartSeed (custom run), invalid -> fart sound 0xbb and clear */ void Menu_OnlineMode::apply_lobby_seed(void) { std_string seedString; std_string seedString_00; std_string seed; Manager *pMVar1; int iVar2; uint uVar3; int in_ECX; Manager *manager; std_string *seedText; char acStackY_b0 [128]; undefined4 in_stack_ffffffd4; undefined4 in_stack_ffffffd8; undefined4 uVar4; undefined4 in_stack_ffffffdc; undefined4 uVar5; undefined4 in_stack_ffffffe0; undefined4 uVar6; undefined4 in_stack_ffffffe4; undefined4 uVar7; uint in_stack_ffffffe8; int soundId; MenuManager *menuManager; uint *seedSize; manager = g_manager; *(undefined1 *)(in_ECX + 0x7e4) = 0; *(undefined1 *)(in_ECX + 0x589) = 0; seedText = &(manager->_lobbySettings)._seed; seedSize = &(manager->_lobbySettings)._seed._size; if ((manager->_lobbySettings)._seed._size == 9) { std::string::string(acStackY_b0 + 0x84,seedText); seedString._buf[4] = (char)in_stack_ffffffd8; seedString._buf[5] = (char)((uint)in_stack_ffffffd8 >> 8); seedString._buf[6] = (char)((uint)in_stack_ffffffd8 >> 0x10); seedString._buf[7] = (char)((uint)in_stack_ffffffd8 >> 0x18); seedString._buf[0] = (char)in_stack_ffffffd4; seedString._buf[1] = (char)((uint)in_stack_ffffffd4 >> 8); seedString._buf[2] = (char)((uint)in_stack_ffffffd4 >> 0x10); seedString._buf[3] = (char)((uint)in_stack_ffffffd4 >> 0x18); seedString._buf[8] = (char)in_stack_ffffffdc; seedString._buf[9] = (char)((uint)in_stack_ffffffdc >> 8); seedString._buf[10] = (char)((uint)in_stack_ffffffdc >> 0x10); seedString._buf[0xb] = (char)((uint)in_stack_ffffffdc >> 0x18); seedString._buf[0xc] = (char)in_stack_ffffffe0; seedString._buf[0xd] = (char)((uint)in_stack_ffffffe0 >> 8); seedString._buf[0xe] = (char)((uint)in_stack_ffffffe0 >> 0x10); seedString._buf[0xf] = (char)((uint)in_stack_ffffffe0 >> 0x18); seedString._size = in_stack_ffffffe4; seedString._capacity = in_stack_ffffffe8; iVar2 = Seeds::GetSeedEffect(seedString); if (iVar2 == 0) { uVar3 = Seeds::String2Seed(seedText); pMVar1 = g_manager; if (uVar3 == 0) { soundId = 0xbb; seed_fart_sound_override(&soundId); SoundEffects::Play(&pMVar1->_sfxManager,soundId,1.0,2,0,1.0,0.0); menuManager = g_menuManager; if (0xf < (manager->_lobbySettings)._seed._capacity) { seedText = *(std_string **)seedText->_buf; } *seedSize = 0; seedText->_buf[0] = '\0'; (menuManager->_seedsObject)._isCustomRun = 0; return; } soundId = 8; seed_fart_sound_override(&soundId); uVar3 = 0; uVar7 = 0x3f800000; uVar6 = 0; uVar5 = 0; uVar4 = 0x3f800000; iVar2 = soundId; SoundEffects::Play(&pMVar1->_sfxManager,soundId,1.0,0,0,1.0,0.0); menuManager = g_menuManager; std::string::string(acStackY_b0 + 0x84,seedText); seed._buf[4] = (char)uVar4; seed._buf[5] = (char)((uint)uVar4 >> 8); seed._buf[6] = (char)((uint)uVar4 >> 0x10); seed._buf[7] = (char)((uint)uVar4 >> 0x18); seed._buf[0] = (char)iVar2; seed._buf[1] = (char)((uint)iVar2 >> 8); seed._buf[2] = (char)((uint)iVar2 >> 0x10); seed._buf[3] = (char)((uint)iVar2 >> 0x18); seed._buf[8] = (char)uVar5; seed._buf[9] = (char)((uint)uVar5 >> 8); seed._buf[10] = (char)((uint)uVar5 >> 0x10); seed._buf[0xb] = (char)((uint)uVar5 >> 0x18); seed._buf[0xc] = (char)uVar6; seed._buf[0xd] = (char)((uint)uVar6 >> 8); seed._buf[0xe] = (char)((uint)uVar6 >> 0x10); seed._buf[0xf] = (char)((uint)uVar6 >> 0x18); seed._size = uVar7; seed._capacity = uVar3; Seeds::SetStartSeed(&menuManager->_seedsObject,seed); (g_menuManager->_seedsObject)._isCustomRun = 1; } else { std::string::string(acStackY_b0 + 0x84,seedText); seedString_00._buf[4] = (char)in_stack_ffffffd8; seedString_00._buf[5] = (char)((uint)in_stack_ffffffd8 >> 8); seedString_00._buf[6] = (char)((uint)in_stack_ffffffd8 >> 0x10); seedString_00._buf[7] = (char)((uint)in_stack_ffffffd8 >> 0x18); seedString_00._buf[0] = (char)in_stack_ffffffd4; seedString_00._buf[1] = (char)((uint)in_stack_ffffffd4 >> 8); seedString_00._buf[2] = (char)((uint)in_stack_ffffffd4 >> 0x10); seedString_00._buf[3] = (char)((uint)in_stack_ffffffd4 >> 0x18); seedString_00._buf[8] = (char)in_stack_ffffffdc; seedString_00._buf[9] = (char)((uint)in_stack_ffffffdc >> 8); seedString_00._buf[10] = (char)((uint)in_stack_ffffffdc >> 0x10); seedString_00._buf[0xb] = (char)((uint)in_stack_ffffffdc >> 0x18); seedString_00._buf[0xc] = (char)in_stack_ffffffe0; seedString_00._buf[0xd] = (char)((uint)in_stack_ffffffe0 >> 8); seedString_00._buf[0xe] = (char)((uint)in_stack_ffffffe0 >> 0x10); seedString_00._buf[0xf] = (char)((uint)in_stack_ffffffe0 >> 0x18); seedString_00._size = in_stack_ffffffe4; seedString_00._capacity = in_stack_ffffffe8; iVar2 = Seeds::GetSeedEffect(seedString_00); manager = g_manager; if ((g_manager->_persistentGameData)._isReadOnly == 0) { *(undefined1 *)((int)(g_manager->_persistentGameData)._cutsceneCounters + iVar2 + 0x74) = 1; (manager->_persistentGameData).field_0xf14 = 0; *(undefined1 *)&manager->_persistentGameData = 1; KAGE_LogMessage(1,(byte *)"Seed %d added to SaveState\n"); } PersistentGameData::Save(&g_manager->_persistentGameData); Seeds::RemoveBlockingSeedEffects(&g_menuManager->_seedsObject,iVar2); Seeds::AddSeedEffect(&g_menuManager->_seedsObject,iVar2); Menu_SpecialSeeds::Reset(&g_menuManager->_menuSpecialSeeds); (g_menuManager->_seedsObject)._isCustomRun = 0; } soundId = 0x11a; manager = g_manager; } else { if (0xf < (manager->_lobbySettings)._seed._capacity) { seedText = *(std_string **)seedText->_buf; } *seedSize = 0; seedText->_buf[0] = '\0'; soundId = 0xbb; } seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); return; } //@@ 008ce010 sprite_member_at_0x10_destroy /* DB: ? destroys an ANM2/Sprite at ECX+0x10 (ANM2::Reset, AnimationState dtors at +0x40/+0x60, 2 strings), i.e. dtor of a non-polymorphic struct whose only non-trivial member is a Sprite at +0x10; only unwind callers, from MenuManager::constructor's EH states prototype: db/protos.zhl */ void __thiscall sprite_member_at_0x10_destroy(void *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)((int)this + 0x10)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x60)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x40)); std::string::_Tidy_deallocate((char *)((int)this + 0x28)); std::string::_Tidy_deallocate((char *)((int)this + 0x10)); ExceptionList = local_10; return; } //@@ 008ce080 Menu_CustomChallenge::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Menu_CustomChallenge::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_CustomChallenge::Update(Menu_CustomChallenge *this) { Menu_CustomChallenge MVar1; Seeds unk; KColor fadeColor; std_string seed; Manager *pMVar2; char isActionTriggered; uint selectedIndex; Seeds *menuSeeds; Manager *this_00; uint uVar3; Seeds aSStackY_2f08 [128]; undefined1 in_stack_ffffff54 [48]; undefined4 in_stack_ffffff84; undefined4 in_stack_ffffff88; undefined4 in_stack_ffffff8c; undefined4 in_stack_ffffff90; undefined4 in_stack_ffffff94; undefined4 uVar4; undefined4 in_stack_ffffff98; undefined4 uVar5; undefined4 in_stack_ffffff9c; int iVar6; undefined4 in_stack_ffffffa0; undefined4 in_stack_ffffffa4; undefined4 in_stack_ffffffa8; void *in_stack_ffffffac; uint in_stack_ffffffb0; int difficulty; char acStack_4a [2]; Menu_CustomChallenge local_34; undefined4 actionId; void *seedText [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; void *challengeParams; Manager *manager; MenuManager *menuManager; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(seedText + 10); ExceptionList = &local_10; if (((g_manager->_framecount & 1) == 0) && (this[0x46].field_0x1 != '\0')) { AnimationState::Update((AnimationState *)(this + 0x10)); in_stack_ffffffb0 = 0x8ce0d5; AnimationState::Update((AnimationState *)(this + 0x18)); } menuManager = g_menuManager; manager = g_manager; if (g_menuManager->_fadeOutActive == 0) { actionId = 0xe; iVar6 = 0x8ce203; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); pMVar2 = g_manager; if (isActionTriggered == '\0') { actionId = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') { actionId = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (isActionTriggered == '\0') { actionId = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered != '\0') { FUN_0098aec0(); } } else { MVar1 = this[1]; if (((MVar1 == (Menu_CustomChallenge)0x0) || ((0x31 < (int)MVar1 && ((int)MVar1 % 10 == 0)))) && (MVar1 = *this, *this = (Menu_CustomChallenge)((int)MVar1 + 1), ((int)(manager->_challengeParams)._end - (int)(manager->_challengeParams)._begin) / 0xa4 <= (int)MVar1 + 1)) { *this = (Menu_CustomChallenge)0x2e; } } } else { MVar1 = this[1]; if (((MVar1 == (Menu_CustomChallenge)0x0) || ((0x31 < (int)MVar1 && ((int)MVar1 % 10 == 0))) ) && (MVar1 = *this, *this = (Menu_CustomChallenge)((int)MVar1 + -1), (int)MVar1 + -1 < 0x2e)) { *this = (Menu_CustomChallenge) (((int)(g_manager->_challengeParams)._end - (int)(g_manager->_challengeParams)._begin) / 0xa4 + -1); } } } else if (((int)(manager->_challengeParams)._end - (int)(manager->_challengeParams)._begin) / 0xa4 == 0x2e) { local_34 = (Menu_CustomChallenge)0xbb; seed_fart_sound_override((int *)&local_34); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_34,1.0,2,0,1.0,0.0); } else { KColor::SetFromARGB((KColor *)(acStack_4a + -0x2a),0xff000000); fadeColor._green = (float)in_stack_ffffff90; fadeColor._red = (float)in_stack_ffffff8c; fadeColor._blue = (float)in_stack_ffffff94; fadeColor._alpha = (float)in_stack_ffffff98; fadeColor._unk = iVar6; MenuManager::start_game(fadeColor); } actionId = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if ((isActionTriggered == '\0') && (isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(), isActionTriggered == '\0') ) { this[1] = (Menu_CustomChallenge)0x0; ExceptionList = local_10; return; } this[1] = (Menu_CustomChallenge)((int)this[1] + 1); } else if (1.0 <= g_menuManager->_fadeOutProgress) { challengeParams = (g_manager->_challengeParams)._begin; local_34 = *this; uVar3 = ((int)(g_manager->_challengeParams)._end - (int)challengeParams) / 0xa4 - 1; local_18 = 0xf; local_1c = 0; seedText[0] = (void *)0x0; selectedIndex = -(uint)(local_34 != (Menu_CustomChallenge)0x0) & (uint)local_34; if (uVar3 <= selectedIndex) { selectedIndex = uVar3; } iVar6 = *(int *)((int)challengeParams + selectedIndex * 0xa4 + 0x44); local_8 = (void *)0x0; uVar4 = 0x8ce16d; std::string::string(acStack_4a + -0x1a,seedText); uVar5 = 0x8ce178; seed._buf[4] = (char)in_stack_ffffffa0; seed._buf[5] = (char)((uint)in_stack_ffffffa0 >> 8); seed._buf[6] = (char)((uint)in_stack_ffffffa0 >> 0x10); seed._buf[7] = (char)((uint)in_stack_ffffffa0 >> 0x18); seed._buf[0] = (char)in_stack_ffffff9c; seed._buf[1] = (char)((uint)in_stack_ffffff9c >> 8); seed._buf[2] = (char)((uint)in_stack_ffffff9c >> 0x10); seed._buf[3] = (char)((uint)in_stack_ffffff9c >> 0x18); seed._buf[8] = (char)in_stack_ffffffa4; seed._buf[9] = (char)((uint)in_stack_ffffffa4 >> 8); seed._buf[10] = (char)((uint)in_stack_ffffffa4 >> 0x10); seed._buf[0xb] = (char)((uint)in_stack_ffffffa4 >> 0x18); seed._buf[0xc] = (char)in_stack_ffffffa8; seed._buf[0xd] = (char)((uint)in_stack_ffffffa8 >> 8); seed._buf[0xe] = (char)((uint)in_stack_ffffffa8 >> 0x10); seed._buf[0xf] = (char)((uint)in_stack_ffffffa8 >> 0x18); seed._size = (uint)in_stack_ffffffac; seed._capacity = in_stack_ffffffb0; Seeds::SetStartSeed(&menuManager->_seedsObject,seed); local_8 = (void *)0xffffffff; if (0xf < local_18) { uVar3 = local_18 + 1; in_stack_ffffffac = seedText[0]; if (0xfff < uVar3) { in_stack_ffffffac = *(void **)((int)seedText[0] + -4); uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)seedText[0] + (-4 - (int)in_stack_ffffffac))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } in_stack_ffffffa8 = 0x8ce1b2; operator_delete(in_stack_ffffffac,uVar3); } menuSeeds = &g_menuManager->_seedsObject; menuSeeds->_isCustomRun = 1; difficulty = *(int *)((int)challengeParams + selectedIndex * 0xa4 + 0x70); Seeds::construct_from_copy(aSStackY_2f08 + 0x81,menuSeeds); unk._stageSeeds[6] = in_stack_ffffff84; unk._isCustomRun = in_stack_ffffff54[0]; unk._1_3_ = in_stack_ffffff54._1_3_; unk._gameStartSeed = in_stack_ffffff54._4_4_; unk._rng._seed = in_stack_ffffff54._8_4_; unk._rng._shift1 = in_stack_ffffff54._12_4_; unk._rng._shift2 = in_stack_ffffff54._16_4_; unk._rng._shift3 = in_stack_ffffff54._20_4_; unk._stageSeeds[0] = in_stack_ffffff54._24_4_; unk._stageSeeds[1] = in_stack_ffffff54._28_4_; unk._stageSeeds[2] = in_stack_ffffff54._32_4_; unk._stageSeeds[3] = in_stack_ffffff54._36_4_; unk._stageSeeds[4] = in_stack_ffffff54._40_4_; unk._stageSeeds[5] = in_stack_ffffff54._44_4_; unk._stageSeeds[7] = in_stack_ffffff88; unk._stageSeeds[8] = in_stack_ffffff8c; unk._stageSeeds[9] = in_stack_ffffff90; unk._stageSeeds[10] = uVar4; unk._stageSeeds[0xb] = uVar5; unk._stageSeeds[0xc] = in_stack_ffffff9c; unk._stageSeeds[0xd] = in_stack_ffffffa0; unk._playerInitSeed = in_stack_ffffffa4; unk._seedEffects = (void *)in_stack_ffffffa8; unk._seedEffectsCount = (int)in_stack_ffffffac; Manager::StartNewGame(this_00,iVar6,(int)local_34,unk,difficulty); } ExceptionList = local_10; return; } //@@ 008ce430 Menu_CustomChallenge::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? placed right after Menu_CustomChallenge::Update (008ce080) and in the menu render list 0098a040; REPENTOGON sig prologue "558bec6aff68..64a1..50 81ecb4000000" matches ours except frame 0xc4; renders "%d.%s" entries, random torn "Piece%d" layers, "Bottom", "Cursor" prototype: REPENTOGON */ void __thiscall Menu_CustomChallenge::Render(Menu_CustomChallenge *this) { code *pcVar1; KColor color; Manager *pMVar2; byte bVar3; Menu_CustomChallenge curAnimChar; uint uVar4; void *glyphs; byte *wantAnimChar; char *wantAnimStr; AnimationState *secondAnimState; int iVar5; int iVar6; int selectedRow; bool isLess; float fVar7; undefined1 glyphQuads [20]; undefined8 rngShifts; undefined4 measureParams; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; Vector textScale; Vector cursorPos; Vector piecePos; Manager *manager; float local_78; Vector local_74; Vector menuPos; int local_64; float menuY; float menuX; int row; byte textBuf [64]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Menu_CustomChallenge animData; MenuManager *menuManager; ANM2 *sprite; local_8 = 0xffffffff; puStack_c = &LAB_00b05b1b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(textBuf + 0x50); ExceptionList = &local_10; sprite = (ANM2 *)(this + 4); animData = this[0x11]; menuPos.x = (g_menuManager->_ViewPosition).x + (float)this[2] + 200.0; menuPos.y = (g_menuManager->_ViewPosition).y + (float)this[3] + 0.0; menuY = menuPos.y; menuX = menuPos.x; if (animData == (Menu_CustomChallenge)0x0) { LAB_008ce4e8: bVar3 = ANM2::SetAnimation(sprite,&DAT_00b6767c,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)((int)animData + 0x14)) { curAnimChar = *(Menu_CustomChallenge *)animData; } wantAnimChar = &DAT_00b6767c; do { bVar3 = *(byte *)curAnimChar; isLess = bVar3 < *wantAnimChar; if (bVar3 != *wantAnimChar) { LAB_008ce4d5: uVar4 = -(uint)isLess | 1; goto LAB_008ce4da; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)curAnimChar + 1); isLess = bVar3 < wantAnimChar[1]; if (bVar3 != wantAnimChar[1]) goto LAB_008ce4d5; curAnimChar = (Menu_CustomChallenge)((int)curAnimChar + 2); wantAnimChar = wantAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008ce4da: if ((uVar4 != 0) || ((*(byte *)((int)animData + 0x34) != 0 && (*(char *)(this + 0x15) == '\0'))) ) goto LAB_008ce4e8; } if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render((AnimationState *)(this + 0x10),&menuPos,&g_vectorZero,&g_vectorZero); AnimationState::Render((AnimationState *)(this + 0x18),&menuPos,&g_vectorZero,&g_vectorZero); menuY = menuPos.y; menuX = menuPos.x; } else { AnimationState::Render((AnimationState *)(this + 0x18),&menuPos,&g_vectorZero,&g_vectorZero); AnimationState::Render((AnimationState *)(this + 0x10),&menuPos,&g_vectorZero,&g_vectorZero); menuY = menuPos.y; menuX = menuPos.x; } } local_78 = 9.80909e-45; manager = g_manager; rngShifts = 0x900000005; row = 0; local_64 = ((uint)((((int)(g_manager->_challengeParams)._end - (int)(g_manager->_challengeParams)._begin) / 0xa4 + -0x2e) * 0x19) >> 5) + 1; fVar7 = 1.7299e-41; if (local_64 != 0) { do { if (fVar7 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar4 = (uint)fVar7 >> ((byte)rngShifts & 0x1f) ^ (uint)fVar7; uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; local_74.y = (float)(uVar4 >> (SUB41(local_78,0) & 0x1f) ^ uVar4); sprintf_s(textBuf,0x40,(byte *)"Piece%d"); animData = this[0x11]; if (animData == (Menu_CustomChallenge)0x0) { LAB_008ce698: bVar3 = ANM2::SetAnimation(sprite,textBuf,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)((int)animData + 0x14)) { curAnimChar = *(Menu_CustomChallenge *)animData; } wantAnimChar = textBuf; do { bVar3 = *(byte *)curAnimChar; isLess = bVar3 < *wantAnimChar; if (bVar3 != *wantAnimChar) { LAB_008ce685: uVar4 = -(uint)isLess | 1; goto LAB_008ce68a; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)curAnimChar + 1); isLess = bVar3 < wantAnimChar[1]; if (bVar3 != wantAnimChar[1]) goto LAB_008ce685; curAnimChar = (Menu_CustomChallenge)((int)curAnimChar + 2); wantAnimChar = wantAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008ce68a: if ((uVar4 != 0) || ((*(byte *)((int)animData + 0x34) != 0 && (*(char *)(this + 0x15) == '\0')))) goto LAB_008ce698; } row = row + 1; piecePos.x = menuX + 0.0; piecePos.y = (float)row * 32.0 + menuY; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x10),&piecePos,&g_vectorZero,&g_vectorZero); secondAnimState = (AnimationState *)(this + 0x18); } else { AnimationState::Render ((AnimationState *)(this + 0x18),&piecePos,&g_vectorZero,&g_vectorZero); secondAnimState = (AnimationState *)(this + 0x10); } AnimationState::Render(secondAnimState,&piecePos,&g_vectorZero,&g_vectorZero); } fVar7 = local_74.y; } while (row < local_64); } animData = this[0x11]; if (animData != (Menu_CustomChallenge)0x0) { curAnimChar = animData; if (0xf < *(uint *)((int)animData + 0x14)) { curAnimChar = *(Menu_CustomChallenge *)animData; } wantAnimStr = "Bottom"; do { bVar3 = *(byte *)curAnimChar; isLess = bVar3 < (byte)*wantAnimStr; if (bVar3 != *wantAnimStr) { LAB_008ce780: uVar4 = -(uint)isLess | 1; goto LAB_008ce785; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)curAnimChar + 1); isLess = bVar3 < (byte)wantAnimStr[1]; if (bVar3 != wantAnimStr[1]) goto LAB_008ce780; curAnimChar = (Menu_CustomChallenge)((int)curAnimChar + 2); wantAnimStr = wantAnimStr + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008ce785: if ((uVar4 == 0) && ((*(byte *)((int)animData + 0x34) == 0 || (*(char *)(this + 0x15) != '\0'))) ) goto LAB_008ce7b1; } bVar3 = ANM2::SetAnimation(sprite,(byte *)"Bottom",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; } LAB_008ce7b1: local_74.x = menuX + 0.0; local_74.y = (float)local_64 * 32.0 + menuY; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render((AnimationState *)(this + 0x10),&local_74,&g_vectorZero,&g_vectorZero); secondAnimState = (AnimationState *)(this + 0x18); } else { AnimationState::Render((AnimationState *)(this + 0x18),&local_74,&g_vectorZero,&g_vectorZero); secondAnimState = (AnimationState *)(this + 0x10); } AnimationState::Render(secondAnimState,&local_74,&g_vectorZero,&g_vectorZero); } if (0x2e < (uint)(((int)(manager->_challengeParams)._end - (int)(manager->_challengeParams)._begin ) / 0xa4)) { textScale.x = 0.8; local_78 = menuX - 90.0; textScale.y = 1.0; local_64 = 0x1d78; row = 1; do { sprintf_s(textBuf,0x40,(byte *)"%d.%s"); pMVar2 = g_manager; measureParams = 0; local_ac = 0xffff; local_a8 = 0; local_a4 = 0x3f800000; local_a0 = 0xffffffff; local_9c = 0; local_98 = 0; local_8 = 0; local_74.y = (float)(row + -1) * 25.0 + menuY; glyphs = Font::measure_string (&g_manager->_font2_TeamMeatEx12,glyphQuads,textBuf,&measureParams, &textScale); local_8 = CONCAT31(local_8._1_3_,1); color._alpha = 1.0; color._red = 0.0; color._green = 0.0; color._blue = 0.0; color._unk = 0; Font::render_glyph_quads (&pMVar2->_font2_TeamMeatEx12,glyphs,local_78,local_74.y,0.8,1.0,color, &measureParams); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_8 = 0xffffffff; if (*this == (Menu_CustomChallenge)(row + 0x2d)) { animData = this[0x11]; if (animData == (Menu_CustomChallenge)0x0) { LAB_008cea15: bVar3 = ANM2::SetAnimation((ANM2 *)(this + 4),(byte *)"Cursor",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)((int)animData + 0x14)) { curAnimChar = *(Menu_CustomChallenge *)animData; } wantAnimStr = "Cursor"; do { bVar3 = *(byte *)curAnimChar; isLess = bVar3 < (byte)*wantAnimStr; if (bVar3 != *wantAnimStr) { LAB_008cea02: uVar4 = -(uint)isLess | 1; goto LAB_008cea07; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)curAnimChar + 1); isLess = bVar3 < (byte)wantAnimStr[1]; if (bVar3 != wantAnimStr[1]) goto LAB_008cea02; curAnimChar = (Menu_CustomChallenge)((int)curAnimChar + 2); wantAnimStr = wantAnimStr + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008cea07: if ((uVar4 != 0) || ((*(byte *)((int)animData + 0x34) != 0 && (*(char *)(this + 0x15) == '\0')))) goto LAB_008cea15; } cursorPos.x = menuX - 93.0; cursorPos.y = ((float)row * 25.0 - 16.0) + menuY; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x10),&cursorPos,&g_vectorZero,&g_vectorZero); secondAnimState = (AnimationState *)(this + 0x18); } else { AnimationState::Render ((AnimationState *)(this + 0x18),&cursorPos,&g_vectorZero,&g_vectorZero); secondAnimState = (AnimationState *)(this + 0x10); } AnimationState::Render(secondAnimState,&cursorPos,&g_vectorZero,&g_vectorZero); } } local_64 = local_64 + 0xa4; uVar4 = row + 0x2e; row = row + 1; } while (uVar4 < (uint)(((int)(manager->_challengeParams)._end - (int)(manager->_challengeParams)._begin) / 0xa4)); } menuManager = g_menuManager; selectedRow = (int)*this + -0x2e; fVar7 = -216.0; iVar6 = (int)(g_manager->_challengeParams)._end - (int)(g_manager->_challengeParams)._begin; iVar5 = iVar6 >> 0x1f; iVar6 = iVar6 / 0xa4 + iVar5; iVar5 = -iVar5; if (4 < selectedRow) { if (selectedRow < iVar6 + -0x31 + iVar5) { iVar5 = (int)*this + -0x32; } else { iVar5 = iVar6 + -0x35 + iVar5; } fVar7 = -216.0 - (float)(iVar5 * 0x19); } g_menuManager->_viewPositionSet[0xf].y = fVar7; menuManager->_state = 1; ExceptionList = local_10; return; } //@@ 008ceb90 Menu_ModChallenges::reset /* DB: ? MenuManager::SetState case 0xf (MODCHALLENGES) and MenuManager::LoadGraphics right after loading ChallengeMenuCustom.anm2: plays the default anim and rewinds */ void Menu_ModChallenges::reset(void) { byte *pbVar1; MenuManager *pMVar2; byte bVar3; byte *pbVar4; uint uVar5; undefined4 *in_ECX; byte *pbVar6; bool bVar7; pbVar1 = (byte *)in_ECX[0x11]; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pbVar6 = &DAT_00b6767c; do { bVar3 = *pbVar4; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_008cebd0: uVar5 = -(uint)bVar7 | 1; goto LAB_008cebd5; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_008cebd0; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008cebd5: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x15) != '\0')))) goto LAB_008cec02; } bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),&DAT_00b6767c,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0x15) = 1; } LAB_008cec02: pMVar2 = g_menuManager; *in_ECX = 0x2e; in_ECX[1] = 0; pMVar2->_viewPositionSet[7].y = -216.0; pMVar2->_state = 1; return; } //@@ 008cec30 FUN_008cec30 undefined4 FUN_008cec30(void) { undefined4 uVar1; undefined4 in_ECX; uVar1 = 3; switch(in_ECX) { case 8: return 4; case 9: return 5; case 10: return 6; case 0xb: return 7; case 0xc: return 8; case 0xd: return 9; case 0xe: return 10; case 0xf: return 0xb; case 0x10: return 0xc; case 0x11: return 0xd; case 0x12: return 0xe; case 0x13: return 0xf; case 0x14: return 0x10; case 0x15: return 0x11; case 0x16: return 0x12; case 0x17: return 0x13; case 0x18: return 2; case 0x1c: return 0x14; case 0x1d: return 0x15; case 0x1e: return 0x17; case 0x1f: return 0x16; case 0x20: return 0x18; case 0x21: uVar1 = 0x1a; } return uVar1; } //@@ 008ced40 Menu_Cutscenes::Update /* DB: MenuManager::Update case 0xd (MainMenuType ENDINGS); calls Manager::ShowCutscene, MenuManager::SetState, the shared FUN_008cec30 with Menu_Cutscenes::Render */ void Menu_Cutscenes::Update(void) { int layerId; char isActionTriggered; uint cutsceneID; int animData; int *in_ECX; Manager *menuManager; void *historyEnd; int local_8; int animData; Manager *manager; MenuManager *menuManager; if (((g_manager->_framecount & 1) == 0) && (*(char *)((int)in_ECX + 0x119) != '\0')) { AnimationState::Update((AnimationState *)(in_ECX + 0x10)); AnimationState::Update((AnimationState *)(in_ECX + 0x18)); } local_8 = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_8,0,0); menuManager = g_menuManager; if (isActionTriggered == '\0') { local_8 = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if ((isActionTriggered != '\0') && ((animData = *in_ECX, animData == 0 || ((0x31 < animData && (animData % 10 == 0)))))) { animData = *(int *)(&DAT_00b23f50 + in_ECX[1] * 4); goto LAB_008cefaa; } } else { animData = *in_ECX; if ((animData == 0) || ((0x31 < animData && (animData % 10 == 0)))) { animData = *(int *)(&DAT_00b23ef0 + in_ECX[1] * 4); LAB_008cefaa: in_ECX[1] = animData; } } } else { animData = *in_ECX; if ((animData == 0) || ((0x31 < animData && (animData % 10 == 0)))) { in_ECX[1] = (in_ECX[1] + 1) % 0x18; } } } else { animData = *in_ECX; if ((animData == 0) || ((0x31 < animData && (animData % 10 == 0)))) { in_ECX[1] = (in_ECX[1] + 0x17) % 0x18; } } } else { historyEnd = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)historyEnd - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { historyEnd = (void *)((int)historyEnd + -4); (g_menuManager->_menuStateHistory)._end = historyEnd; } MenuManager::SetState(menuManager,*(int *)((int)historyEnd + -4),0); } } else { cutsceneID = FUN_008cec30(); manager = g_manager; if ((g_manager->_persistentGameData)._cutsceneCounters[cutsceneID] < 1) { local_8 = 0xbb; seed_fart_sound_override(&local_8); SoundEffects::Play(&manager->_sfxManager,local_8,1.0,2,0,1.0,0.0); } else { Manager::ShowCutscene(menuManager,cutsceneID,0,1); } } local_8 = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { local_8 = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0); if (isActionTriggered == '\0') { *in_ECX = 0; goto LAB_008cf05f; } } } } *in_ECX = *in_ECX + 1; LAB_008cf05f: animData = in_ECX[1]; if (in_ECX[0x11] != 0) { if ((*(int *)(in_ECX[0x10] + 0x80) < 0x1a) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)(in_ECX[0x10] + 0x80) < 0x1a)) { return; } animData = in_ECX[0x11]; layerId = *(int *)(animData + 0x9c); if (((animData == 0) || (layerId < 0)) || (*(int *)(animData + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x12] + layerId * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0x10),layerId,(float)animData); } return; } //@@ 008cf0e0 Menu_Cutscenes::Render /* DB: MenuManager::Render passes ECX=MenuManager+0xd3ac (_menuCutscenes, LEA ECX,[ESI+0xd3ac] at 0098a24c); hides the table of layers DAT_00b23fb0, shares FUN_008cec30 with Menu_Cutscenes::Update 008ced40 Menu_Cutscenes::Update void Menu_Cutscenes::Render(void) { byte *layerName; LayerState *layer; int iVar1; int layerFrames; int in_ECX; AnimationState *lastAnimState; int animLayerIndex; undefined4 *puVar2; undefined4 defaultColor [8]; undefined4 local_48; undefined4 uStack_44; undefined4 local_40; undefined4 lockedColor [8]; undefined4 local_1c; undefined4 uStack_18; undefined4 local_14; Vector drawPos; undefined4 *layerNameCursor; ANM2 *anm2; puVar2 = &DAT_00b23fb0; drawPos.x = (g_menuManager->_ViewPosition).x + *(float *)(in_ECX + 8); drawPos.y = (g_menuManager->_ViewPosition).y + *(float *)(in_ECX + 0xc); do { layer = ANM2::GetLayer((ANM2 *)(in_ECX + 0x10),(byte *)*puVar2); puVar2 = puVar2 + 1; layer->_visible = 0; } while ((int)puVar2 < 0xb24010); if (*(char *)(in_ECX + 0x119) != '\0') { if (*(char *)(in_ECX + 0x80) == '\0') { AnimationState::Render((AnimationState *)(in_ECX + 0x40),&drawPos,&g_vectorZero,&g_vectorZero) ; lastAnimState = (AnimationState *)(in_ECX + 0x60); } else { AnimationState::Render((AnimationState *)(in_ECX + 0x60),&drawPos,&g_vectorZero,&g_vectorZero) ; lastAnimState = (AnimationState *)(in_ECX + 0x40); } AnimationState::Render(lastAnimState,&drawPos,&g_vectorZero,&g_vectorZero); } layerNameCursor = &DAT_00b23fb0; do { layerName = (byte *)*layerNameCursor; iVar1 = FUN_008cec30(); if ((g_manager->_persistentGameData)._cutsceneCounters[iVar1] < 1) { puVar2 = (undefined4 *)(in_ECX + 0xb8); local_1c = 0; uStack_18 = 0; local_14 = 0; if (puVar2 != lockedColor) { *(undefined4 *)(in_ECX + 200) = 0; *(undefined4 *)(in_ECX + 0xcc) = 0; *(undefined4 *)(in_ECX + 0xd0) = 0; *(undefined4 *)(in_ECX + 0xd4) = 0; *(undefined8 *)(in_ECX + 0xd8) = 0; *puVar2 = 0x3f800000; *(undefined4 *)(in_ECX + 0xbc) = 0x3f800000; *(undefined4 *)(in_ECX + 0xc0) = 0x3f800000; *(undefined4 *)(in_ECX + 0xc4) = 0x3f000000; *(undefined4 *)(in_ECX + 0xe0) = 0; } layer = ANM2::GetLayer((ANM2 *)(in_ECX + 0x10),layerName); layer->_visible = 1; if (*(char *)(in_ECX + 0x119) != '\0') { if (*(char *)(in_ECX + 0x80) == '\0') { iVar1 = *(int *)(in_ECX + 0x44); if ((((iVar1 != 0) && (-1 < (int)layerName)) && ((int)layerName < (*(ANM2 **)(in_ECX + 0x40))->_layerCount)) && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(animLayerIndex * 0x10 + *(int *)(iVar1 + 0x18)),&drawPos, *(int *)(*(int *)(in_ECX + 0x48) + animLayerIndex * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)(in_ECX + 0x40)); } iVar1 = *(int *)(in_ECX + 100); if (((iVar1 != 0) && (-1 < (int)layerName)) && ((anm2 = *(ANM2 **)(in_ECX + 0x60), (int)layerName < anm2->_layerCount && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)))) { layerFrames = *(int *)(in_ECX + 0x68); goto LAB_008cf3fe; } } else { iVar1 = *(int *)(in_ECX + 100); if (((iVar1 != 0) && (-1 < (int)layerName)) && (((int)layerName < (*(ANM2 **)(in_ECX + 0x60))->_layerCount && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)))) { AnimationLayer::RenderFrame ((AnimationLayer *)(animLayerIndex * 0x10 + *(int *)(iVar1 + 0x18)),&drawPos, *(int *)(*(int *)(in_ECX + 0x68) + animLayerIndex * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)(in_ECX + 0x60)); } iVar1 = *(int *)(in_ECX + 0x44); if ((((iVar1 != 0) && (-1 < (int)layerName)) && (anm2 = *(ANM2 **)(in_ECX + 0x40), (int)layerName < anm2->_layerCount)) && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)) { layerFrames = *(int *)(in_ECX + 0x48); LAB_008cf3fe: AnimationLayer::RenderFrame ((AnimationLayer *)(animLayerIndex * 0x10 + *(int *)(iVar1 + 0x18)),&drawPos, *(int *)(layerFrames + animLayerIndex * 4),&g_vectorZero,&g_vectorZero,anm2); } } } local_48 = 0; uStack_44 = 0; local_40 = 0; if (puVar2 != defaultColor) { *(undefined4 *)(in_ECX + 200) = 0; *(undefined4 *)(in_ECX + 0xcc) = 0; *(undefined4 *)(in_ECX + 0xd0) = 0; *(undefined4 *)(in_ECX + 0xd4) = 0; *(undefined4 *)(in_ECX + 0xd8) = 0; *(undefined4 *)(in_ECX + 0xdc) = 0; *puVar2 = 0x3f800000; *(undefined4 *)(in_ECX + 0xbc) = 0x3f800000; *(undefined4 *)(in_ECX + 0xc0) = 0x3f800000; *(undefined4 *)(in_ECX + 0xc4) = 0x3f800000; *(undefined4 *)(in_ECX + 0xe0) = 0; } } else { layer = ANM2::GetLayer((ANM2 *)(in_ECX + 0x10),layerName); layer->_visible = 1; if (*(char *)(in_ECX + 0x119) != '\0') { if (*(char *)(in_ECX + 0x80) == '\0') { iVar1 = *(int *)(in_ECX + 0x44); if (((iVar1 != 0) && (-1 < (int)layerName)) && (((int)layerName < (*(ANM2 **)(in_ECX + 0x40))->_layerCount && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)))) { AnimationLayer::RenderFrame ((AnimationLayer *)(animLayerIndex * 0x10 + *(int *)(iVar1 + 0x18)),&drawPos, *(int *)(*(int *)(in_ECX + 0x48) + animLayerIndex * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)(in_ECX + 0x40)); } iVar1 = *(int *)(in_ECX + 100); if (((iVar1 != 0) && (-1 < (int)layerName)) && ((anm2 = *(ANM2 **)(in_ECX + 0x60), (int)layerName < anm2->_layerCount && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)))) { layerFrames = *(int *)(in_ECX + 0x68); goto LAB_008cf2a5; } } else { iVar1 = *(int *)(in_ECX + 100); if ((((iVar1 != 0) && (-1 < (int)layerName)) && ((int)layerName < (*(ANM2 **)(in_ECX + 0x60))->_layerCount)) && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(animLayerIndex * 0x10 + *(int *)(iVar1 + 0x18)),&drawPos, *(int *)(*(int *)(in_ECX + 0x68) + animLayerIndex * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)(in_ECX + 0x60)); } iVar1 = *(int *)(in_ECX + 0x44); if (((iVar1 != 0) && (-1 < (int)layerName)) && ((anm2 = *(ANM2 **)(in_ECX + 0x40), (int)layerName < anm2->_layerCount && (animLayerIndex = *(int *)(iVar1 + 0x38 + (int)layerName * 4), -1 < animLayerIndex)))) { layerFrames = *(int *)(in_ECX + 0x48); LAB_008cf2a5: AnimationLayer::RenderFrame ((AnimationLayer *)(animLayerIndex * 0x10 + *(int *)(iVar1 + 0x18)),&drawPos, *(int *)(layerFrames + animLayerIndex * 4),&g_vectorZero,&g_vectorZero,anm2); } } } } layerNameCursor = layerNameCursor + 1; if (0xb2400f < (int)layerNameCursor) { return; } } while( true ); } //@@ 008cf480 FUN_008cf480 void FUN_008cf480(void) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; undefined4 *in_ECX; byte *pbVar5; bool bVar6; pbVar1 = (byte *)in_ECX[0x11]; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar5 = s_Idle; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_008cf4c0: uVar4 = -(uint)bVar6 | 1; goto LAB_008cf4c5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_008cf4c0; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008cf4c5: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x15) != '\0')))) goto LAB_008cf4f2; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0x15) = 1; } LAB_008cf4f2: *in_ECX = 0; in_ECX[1] = 0; return; } //@@ 008cf510 FUN_008cf510 void FUN_008cf510(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb440; local_10 = ExceptionList; ExceptionList = &local_10; FUN_008d0730(__security_cookie ^ (int)register0x00000010 - 4U); Leaderboard::~Leaderboard((Leaderboard *)(in_ECX + 0x3a4)); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x270)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x2c0)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x2a0)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x288)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x270)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x13c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x18c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x16c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x154)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x13c)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x14)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 100)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x14)); ExceptionList = local_10; return; } //@@ 008cf610 Menu_DailyChallenge::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager::Update case 4 (MainMenuType DAILYRUN; case 3 is Menu_Game::Update, 5 Menu_Character::Update); calls daily_challenge_refresh, NetplayManager::check_connection, strings Appear/Loading prototype: db/protos.zhl */ void __thiscall Menu_DailyChallenge::Update(Menu_DailyChallenge *this) { KColor fadeColor; byte bVar1; char isActionTriggered; Menu_DailyChallenge curAnimChar; uint cmpResult; tm *gmTime; char *animName; Manager *manager; bool isLess; KColor aKStackY_a7c [128]; undefined4 uVar2; code *pcVar3; Menu_DailyChallenge *pMVar4; undefined4 cmpResult; undefined *puVar6; Menu_DailyChallenge local_48; byte serverTime [8]; __time64_t serverTime64; tm serverTm; undefined4 local_8; Menu_DailyChallenge animData; local_8 = __security_cookie ^ (uint)(serverTime + 0x40); bVar1 = NetplayManager::check_connection(&g_manager->_netplayManager); if (bVar1 == 0) { return; } if (((g_manager->_framecount & 1) == 0) && (this[0x47].field_0x1 != '\0')) { AnimationState::Update((AnimationState *)(this + 0x11)); AnimationState::Update((AnimationState *)(this + 0x19)); } ANM2::update_appear_then_idle((ANM2 *)(this + 0x4f)); GenericPrompt::Update((GenericPrompt *)(this + 0x9c),1); if (*this == (Menu_DailyChallenge)0x0) { daily_challenge_refresh(); FUN_008d0940(); } manager = g_manager; if (g_menuManager->_fadeOutActive != 0) { if (1.0 <= g_menuManager->_fadeOutProgress) { animData = this[2]; (g_manager->_dailyChallenge)._isPractice = animData == (Menu_DailyChallenge)0x2; manager->_rerunAvailable = 0; manager->_startingFromRerun = 0; manager->_debugStart = 0; manager->_starting = 1; manager->_networkPlay = 0; manager->_consecutiveResetCount = 0; if (animData != (Menu_DailyChallenge)0x2) { if ((manager->_persistentGameData)._eventCounters[0xbf] != 0) { PersistentGameData::IncreaseEventCounter (&manager->_persistentGameData,0xc0, -(manager->_persistentGameData)._eventCounters[0xc0]); manager = g_manager; } (manager->_persistentGameData)._eventCounters[0xbf] = 1; PersistentGameData::IncreaseEventCounter(&manager->_persistentGameData,0xbe,1); } } FUN_008d0840(); return; } if ((this[0x5c] == (Menu_DailyChallenge)0x0) || (*(char *)(this + 0x60) == '\0')) { if (this[0xea] == (Menu_DailyChallenge)0x0) { animData = *this; if (((animData != (Menu_DailyChallenge)0x0) && (animData != (Menu_DailyChallenge)0x1)) && (animData != (Menu_DailyChallenge)0x4)) { pMVar4 = &local_48; cmpResult = 0; pcVar3 = FUN_00a209e0; uVar2 = 0xffffffff; local_48 = (Menu_DailyChallenge)0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') { local_48 = (Menu_DailyChallenge)0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') { local_48 = (Menu_DailyChallenge)0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if ((isActionTriggered != '\0') && ((animData = this[1], animData == (Menu_DailyChallenge)0x0 || ((0x31 < (int)animData && ((int)animData % 10 == 0)))))) { animData = (Menu_DailyChallenge)((int)this[2] + 1); this[2] = animData; if (3 < (int)animData) { this[2] = (Menu_DailyChallenge)0x0; animData = (Menu_DailyChallenge)0x0; } while (((animData == (Menu_DailyChallenge)0x0 || (animData == (Menu_DailyChallenge)0x1)) && (*this != (Menu_DailyChallenge)0x2) )) { animData = (Menu_DailyChallenge)((int)animData + 1); this[2] = animData; } if (animData == (Menu_DailyChallenge)0x2) { animData = this[2]; if (*this != (Menu_DailyChallenge)0x3) { animData = (Menu_DailyChallenge)0x3; } this[2] = animData; } } } else { animData = this[1]; if ((animData == (Menu_DailyChallenge)0x0) || ((0x31 < (int)animData && ((int)animData % 10 == 0)))) { animData = (Menu_DailyChallenge)((int)this[2] + -1); this[2] = animData; if ((animData == (Menu_DailyChallenge)0x2) && (*this != (Menu_DailyChallenge)0x3)) { this[2] = (Menu_DailyChallenge)0x1; animData = (Menu_DailyChallenge)0x1; } while (((animData == (Menu_DailyChallenge)0x0 || (animData == (Menu_DailyChallenge)0x1)) && (*this != (Menu_DailyChallenge)0x2) )) { animData = (Menu_DailyChallenge)((int)animData + -1); this[2] = animData; } if ((int)animData < 0) { this[2] = (Menu_DailyChallenge)0x3; } } } } else { switch(this[2]) { case (Menu_DailyChallenge)0x0: input_poll_active_device(); DAT_00c5ab40 = 0; FUN_00a51aa0(); ANM2::Play((ANM2 *)(this + 5),(byte *)"Loading",0); break; case (Menu_DailyChallenge)0x1: bVar1 = show_beta_disclaimer_popup(1,FUN_008d0ed0,this); if (bVar1 == 0) { func_0x008d0810(); } break; case (Menu_DailyChallenge)0x2: puVar6 = &UNK_008cf88f; daily_challenge_refresh(); KColor::SetFromARGB(aKStackY_a7c + 0x81,0xff000000); fadeColor._green = (float)pcVar3; fadeColor._red = (float)uVar2; fadeColor._blue = (float)pMVar4; fadeColor._alpha = (float)cmpResult; fadeColor._unk = (int)puVar6; MenuManager::start_game(fadeColor); break; case (Menu_DailyChallenge)0x3: daily_challenge_refresh(); local_48 = (Menu_DailyChallenge)(g_manager->_dailyChallenge)._id; *(undefined4 *)(this + 0xe9) = 1; this[0xea] = (Menu_DailyChallenge)0x1; animData = this[0x13f]; if (animData == (Menu_DailyChallenge)0x0) { code_r0x008cf92b: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 0x132),(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x13e)); *(undefined1 *)(this + 0x143) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)((int)animData + 0x14)) { curAnimChar = *(Menu_DailyChallenge *)animData; } animName = "Appear"; do { bVar1 = *(byte *)curAnimChar; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { code_r0x008cf907: cmpResult = -(uint)isLess | 1; goto code_r0x008cf90c; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)curAnimChar + 1); isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto code_r0x008cf907; curAnimChar = (Menu_DailyChallenge)((int)curAnimChar + 2); animName = animName + 2; } while (bVar1 != 0); cmpResult = 0; code_r0x008cf90c: if ((cmpResult != 0) || ((*(byte *)((int)animData + 0x34) != 0 && (*(char *)(this + 0x143) == '\0')))) goto code_r0x008cf92b; } this[0x17c] = (Menu_DailyChallenge)0xffffffff; this[0x17e] = local_48; this[0x17d] = local_48; DailyChallenge::Init((DailyChallenge *)(this + 0x17f),(uint)local_48); KAGE::System::LeaderboardManager::release_result((int)this[0x177]); KAGE::System::LeaderboardManager::release_result((int)this[0x178]); KAGE::System::LeaderboardManager::release_result((int)this[0x179]); KAGE::System::LeaderboardManager::release_result((int)this[0x17a]); this[0x17a] = (Menu_DailyChallenge)0x0; this[0x179] = (Menu_DailyChallenge)0x0; this[0x178] = (Menu_DailyChallenge)0x0; this[0x177] = (Menu_DailyChallenge)0x0; *(undefined2 *)(this + 0x1d3) = 0x101; Leaderboard::get_leaderboard((Leaderboard *)(this + 0xe9),0,2); manager = g_manager; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (manager->_popupButtons)._buttons[0]._slideOffset = 96.0; (manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; (manager->_popupButtons)._buttons[1]._slideOffset = 96.0; } } } } else { Leaderboard::update_input(); } } else { local_48 = (Menu_DailyChallenge)0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') { local_48 = (Menu_DailyChallenge)0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') goto LAB_008cfb19; } FUN_00837590(); } LAB_008cfb19: if ((this[0xea] == (Menu_DailyChallenge)0x0) && ((this[0x5c] == (Menu_DailyChallenge)0x0 || (*(char *)(this + 0x60) == '\0')))) { local_48 = (Menu_DailyChallenge)0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered != '\0') { FUN_0098aec0(); } } animData = this[2]; while (((animData == (Menu_DailyChallenge)0x0 || (animData == (Menu_DailyChallenge)0x1)) && (*this == (Menu_DailyChallenge)0x3))) { animData = (Menu_DailyChallenge)((int)animData + 1); this[2] = animData; } if ((animData == (Menu_DailyChallenge)0x2) && (*this == (Menu_DailyChallenge)0x2)) { this[2] = (Menu_DailyChallenge)0x1; } local_48 = (Menu_DailyChallenge)0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') { local_48 = (Menu_DailyChallenge)0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionTriggered == '\0') { this[1] = (Menu_DailyChallenge)0x0; goto LAB_008cfbf4; } } this[1] = (Menu_DailyChallenge)((int)this[1] + 1); LAB_008cfbf4: Leaderboard::Update(); FUN_008d0840(); if (*this != (Menu_DailyChallenge)0x0) { get_server_time(serverTime); if ((serverTime[0] & 2) != 0) { serverTime64 = _mkgmtime64(&serverTm); } if ((serverTime[0] & 3) != 0) { gmTime = _gmtime64(&serverTime64); serverTm.tm_sec._0_1_ = (char)gmTime->tm_sec; serverTm.tm_sec._1_1_ = *(undefined1 *)((int)&gmTime->tm_sec + 1); serverTm.tm_sec._2_1_ = *(undefined1 *)((int)&gmTime->tm_sec + 2); serverTm.tm_sec._3_1_ = *(undefined1 *)((int)&gmTime->tm_sec + 3); serverTm.tm_min._0_1_ = (char)gmTime->tm_min; serverTm.tm_min._1_1_ = *(undefined1 *)((int)&gmTime->tm_min + 1); serverTm.tm_min._2_1_ = *(undefined1 *)((int)&gmTime->tm_min + 2); serverTm.tm_min._3_1_ = *(undefined1 *)((int)&gmTime->tm_min + 3); serverTm.tm_hour._0_1_ = (char)gmTime->tm_hour; serverTm.tm_hour._1_1_ = *(undefined1 *)((int)&gmTime->tm_hour + 1); serverTm.tm_hour._2_1_ = *(undefined1 *)((int)&gmTime->tm_hour + 2); serverTm.tm_hour._3_1_ = *(undefined1 *)((int)&gmTime->tm_hour + 3); serverTm.tm_mday._0_1_ = (undefined1)gmTime->tm_mday; serverTm.tm_mday._1_1_ = *(undefined1 *)((int)&gmTime->tm_mday + 1); serverTm.tm_mday._2_1_ = *(undefined1 *)((int)&gmTime->tm_mday + 2); serverTm.tm_mday._3_1_ = *(undefined1 *)((int)&gmTime->tm_mday + 3); serverTm.tm_mon = gmTime->tm_mon; serverTm.tm_year = gmTime->tm_year; serverTm.tm_wday = gmTime->tm_wday; serverTm.tm_yday = gmTime->tm_yday; serverTm.tm_isdst = gmTime->tm_isdst; } this[0x4b] = (Menu_DailyChallenge)(0x17 - (char)serverTm.tm_hour); serverTime[0] = serverTime[0] & 0xfc; this[0x4c] = (Menu_DailyChallenge)(0x3b - (char)serverTm.tm_min); this[0x4d] = (Menu_DailyChallenge)(0x3b - (char)serverTm.tm_sec); if (((this[0x4b] == (Menu_DailyChallenge)0x17) && (this[0x4c] == (Menu_DailyChallenge)0x3b)) && ((Menu_DailyChallenge)(0x3b - (char)serverTm.tm_sec) == (Menu_DailyChallenge)0x3b)) { *this = (Menu_DailyChallenge)0x0; } } if (((*(char *)(this + 0x4e) != '\0') && ((this[0x5c] == (Menu_DailyChallenge)0x0 || (*(char *)(this + 0x60) == '\0')))) && ((this[0xa9] == (Menu_DailyChallenge)0x0 || (*(char *)(this + 0xad) == '\0')))) { this[0xea] = (Menu_DailyChallenge)0x0; FUN_0098aec0(); } return; } //@@ 008cfd40 Menu_DailyChallenge::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Menu_DailyChallenge::Render(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_DailyChallenge::Render(Menu_DailyChallenge *this) { Vector pos; Vector pos_00; uint uVar1; byte *pbVar2; uint animCompare; LayerState *text2Layer; void *scoreNullFrame; undefined4 extraout_EAX; float *streakNullFrame; AnimationState *secondAnimState; byte *pbVar3; KColor *color; undefined4 extraout_ECX; KColor *color_00; KColor *color_01; undefined4 extraout_ECX_00; int iVar4; Font *font; bool bVar5; float fVar6; float fVar7; FontSettings scoreFontSettings [5]; undefined4 local_48c; undefined4 local_488; float *playerNameNullFrame; undefined4 local_480; undefined4 local_47c; KColor local_478; Font *selectedFont; FontSettings fontSettings; undefined4 local_45c; undefined4 local_458; undefined4 local_454; undefined4 local_450; undefined4 local_44c; undefined4 local_448; float renderY; float renderX; short playerNameWide [512]; KColor local_3c; undefined1 local_28 [16]; undefined *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Menu_DailyChallenge animName; byte nameChar; local_8 = 0xffffffff; puStack_c = &LAB_00b05b94; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; selectedFont = &g_manager->_font2_TeamMeatEx12; if (*(int *)&g_manager->_stringTable == 0) { selectedFont = &g_manager->_font3_TeamMeatEx16; } font = selectedFont; renderX = (g_menuManager->_ViewPosition).x + (float)this[3]; renderY = (g_menuManager->_ViewPosition).y + (float)this[4]; local_28._12_4_ = renderX; local_18 = (undefined *)renderY; local_14 = uVar1; if (this[0x47].field_0x1 != '\0') { if (*(char *)(this + 0x21) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x11),(Vector *)(local_28 + 0xc),&g_vectorZero, &g_vectorZero); secondAnimState = (AnimationState *)(this + 0x19); } else { AnimationState::Render ((AnimationState *)(this + 0x19),(Vector *)(local_28 + 0xc),&g_vectorZero, &g_vectorZero); secondAnimState = (AnimationState *)(this + 0x11); } AnimationState::Render(secondAnimState,(Vector *)(local_28 + 0xc),&g_vectorZero,&g_vectorZero); } animName = this[0x12]; if (animName == (Menu_DailyChallenge)0x0) { pbVar2 = &s_empty; } else { pbVar2 = (byte *)animName; if (0xf < *(uint *)((int)animName + 0x14)) { pbVar2 = *(byte **)animName; } } pbVar3 = s_Idle; do { nameChar = *pbVar2; bVar5 = nameChar < *pbVar3; if (nameChar != *pbVar3) { LAB_008cfe70: animCompare = -(uint)bVar5 | 1; goto LAB_008cfe75; } if (nameChar == 0) break; nameChar = *(byte *)((int)pbVar2 + 1); bVar5 = nameChar < pbVar3[1]; if (nameChar != pbVar3[1]) goto LAB_008cfe70; pbVar2 = (byte *)((int)pbVar2 + 2); pbVar3 = pbVar3 + 2; } while (nameChar != 0); animCompare = 0; LAB_008cfe75: renderY = (float)local_18; renderX = (float)local_28._12_4_; if (animCompare == 0) { if ((animName != (Menu_DailyChallenge)0x0) && (playerNameNullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x11),(byte *)"PlayerName"), playerNameNullFrame != (float *)0x0)) { local_18 = g_userProfile; local_28._12_4_ = KAGE::System::UserProfile::vftable; local_8 = 0; pbVar2 = (byte *)FUN_00a5f1c0(uVar1); local_8 = 0xffffffff; local_28._12_4_ = KAGE::System::UserProfileBase::vftable; if (pbVar2 == (byte *)0x0) { iVar4 = 0; } else { pbVar3 = pbVar2; do { nameChar = *pbVar3; pbVar3 = pbVar3 + 1; } while (nameChar != 0); iVar4 = (int)pbVar3 - (int)(pbVar2 + 1); } text_convert_encoding(pbVar2,iVar4,0,playerNameWide,0x200,1); iVar4 = Font::get_string_width_utf16(font,playerNameWide,-1); local_18 = (undefined *) (175.0 / (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)])); if ((float)local_18 <= 0.0) { local_18 = (undefined *)0x0; } if (1.0 <= (float)local_18) { local_18 = (undefined *)0x3f800000; } uVar1 = __ftoui3(); local_480 = 0; local_47c = 0xffff; fVar6 = renderX + *playerNameNullFrame; fVar7 = renderY + playerNameNullFrame[1]; local_478._red = 0.0; local_478._green = 1.0; local_478._blue = -NAN; local_478._alpha = 0.0; local_478._unk = 0; local_8 = 1; KColor::SetFromARGB(&local_3c,0xff362f2d); Font::draw_string_wide (font,playerNameWide,fVar6 - ((float)(uVar1 >> 1) + 0.0),fVar7 - 8.0,(float)local_18 ,(float)local_18,color,&local_480); local_8 = 0xffffffff; } text2Layer = ANM2::GetLayer((ANM2 *)(this + 5),(byte *)"Text2"); if (text2Layer == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { iVar4 = FUN_0040a8a0(*(undefined4 *)text2Layer->_layerData); if (iVar4 == 0) { if (this[0x12] == (Menu_DailyChallenge)0x0) goto LAB_008d033d; scoreNullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x11),(byte *)"Score"); if (scoreNullFrame != (void *)0x0) { sprintf_s((byte *)&local_3c._green,0x10,s__d); Font::get_string_width_n(font,(byte *)&local_3c._green,-1); FontSettings::constructor(scoreFontSettings); local_8 = 2; KColor::SetFromARGB((KColor *)local_28,0xff362f2d); font = selectedFont; Font::DrawString(&local_3c._green,extraout_ECX,extraout_EAX); local_8 = 0xffffffff; local_48c = 0; local_488 = 0; } } } if (this[0x12] != (Menu_DailyChallenge)0x0) { streakNullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x11),(byte *)"CurrentStreak"); if (streakNullFrame != (float *)0x0) { local_18 = &DAT_00b75810; pbVar2 = s__d; if ((uint)(g_manager->_persistentGameData)._eventCounters[0xc0] < (uint)(g_manager->_persistentGameData)._eventCounters[0x20a]) { pbVar2 = &DAT_00b75810; } sprintf_s(local_28 + 4,0x10,pbVar2); Font::get_string_width_n(font,local_28 + 4,-1); fVar7 = renderX + *streakNullFrame; fVar6 = renderY + streakNullFrame[1]; fontSettings = (FontSettings)0x0; local_45c = 0xffff; local_458 = 0; local_454 = 0x3f800000; local_450 = 0xffffffff; local_44c = 0; local_448 = 0; local_8 = 3; KColor::SetFromARGB(&local_478,0xff362f2d); pos.y = fVar6; pos.x = fVar7; Font::DrawString(font,local_28 + 4,pos,(Vector)0x3f4000003f400000,color_00,&fontSettings); local_8 = 0xffffffff; } if ((this[0x12] != (Menu_DailyChallenge)0x0) && (streakNullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x11),(byte *)"BestStreak"), streakNullFrame != (float *)0x0)) { sprintf_s((byte *)&local_3c._green,0x10,s__d); Font::get_string_width_n(font,(byte *)&local_3c._green,-1); fVar7 = renderX + *streakNullFrame; fVar6 = renderY + streakNullFrame[1]; fontSettings = (FontSettings)0x0; local_45c = 0xffff; local_458 = 0; local_454 = 0x3f800000; local_450 = 0xffffffff; local_44c = 0; local_448 = 0; local_8 = 4; KColor::SetFromARGB(&local_478,0xff362f2d); pos_00.y = fVar6; pos_00.x = fVar7; Font::DrawString(font,(byte *)&local_3c._green,pos_00,(Vector)0x3f4000003f400000,color_01, &fontSettings); } } } LAB_008d033d: sprintf_s((byte *)&local_3c._blue,10,(byte *)"%02d:%02d:%02d"); Font::get_string_width_n(font,(byte *)&local_3c._blue,-1); fontSettings = (FontSettings)0x0; local_45c = 0xffff; local_458 = 0; local_454 = 0x3f800000; local_450 = 0xffffffff; local_44c = 0; local_448 = 0; local_8 = 5; KColor::SetFromARGB(&local_478,0xff362f2d); Font::DrawString(&local_3c._blue,extraout_ECX_00,&fontSettings); local_8 = 0xffffffff; GenericPopup::Render((GenericPopup *)(this + 0x4f)); GenericPrompt::Render((GenericPrompt *)(this + 0x9c)); ExceptionList = local_10; return; } //@@ 008d0470 Menu_DailyChallenge::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads gfx/ui/main menu/Menu_DailyRun.anm2, gfx/ui/LeaderboardMenu.anm2, gfx/ui/ScoreMenu.anm2, GenericPrompt::Initialize; called from MenuManager::LoadGraphics right after the cutscenes menu sprite */ void Menu_DailyChallenge::load_graphics(void) { int in_ECX; char *freeBlock; undefined4 extraout_ECX; uint freeSize; std_string leaderboardPath; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b05bdd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x23; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/Menu_DailyRun.anm2",0x24); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x14),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { freeSize = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); freeSize = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } ANM2::Reset((ANM2 *)(in_ECX + 0x3b4)); ANM2::Reset((ANM2 *)(in_ECX + 0x4c8)); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x15; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/ScoreMenu.anm2",0x16); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x3b4),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { freeSize = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); freeSize = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } leaderboardPath._size = 0; leaderboardPath._capacity = 0xf; leaderboardPath._buf[0] = '\0'; leaderboardPath._buf[1] = '\0'; leaderboardPath._buf[2] = '\0'; leaderboardPath._buf[3] = '\0'; leaderboardPath._buf._0_4_ = std::_Allocate(0x20); leaderboardPath._size = 0x1b; leaderboardPath._capacity = 0x1f; builtin_strncpy((char *)leaderboardPath._buf._0_4_,"gfx/ui/LeaderboardMenu.anm2",0x1c); local_14 = 2; ANM2::Load((ANM2 *)(in_ECX + 0x4c8),&leaderboardPath,1); local_14 = 0xffffffff; if (0xf < leaderboardPath._capacity) { freeSize = leaderboardPath._capacity + 1; freeBlock = (char *)leaderboardPath._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(char **)(leaderboardPath._buf._0_4_ + -4); freeSize = leaderboardPath._capacity + 0x24; if ((char *)0x1f < (char *)(leaderboardPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } leaderboardPath._size = 0; leaderboardPath._capacity = 0xf; leaderboardPath._buf._0_4_ = leaderboardPath._buf._0_4_ & 0xffffff00; FUN_008370f0(); FUN_00837740(extraout_ECX); GenericPrompt::Initialize((GenericPrompt *)(in_ECX + 0x270),0); ExceptionList = local_1c; return; } //@@ 008d0730 FUN_008d0730 void FUN_008d0730(void) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; LayerState *pLVar5; undefined4 *in_ECX; byte *pbVar6; bool bVar7; pbVar1 = (byte *)in_ECX[0x12]; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar6 = s_Idle; do { bVar2 = *pbVar3; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_008d0770: uVar4 = -(uint)bVar7 | 1; goto LAB_008d0775; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_008d0770; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008d0775: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x16) != '\0')))) goto LAB_008d07a2; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 5),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x11)); *(undefined1 *)(in_ECX + 0x16) = 1; } LAB_008d07a2: pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + 5),&DAT_0000000b); pLVar5->_visible = 0; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; in_ECX[0x4a] = 0; KAGE::System::LeaderboardManager::release_result(in_ECX[0x1d6]); KAGE::System::LeaderboardManager::release_result(in_ECX[0x1d7]); in_ECX[0x1d7] = 0; in_ECX[0x1d6] = 0; *(undefined1 *)(in_ECX + 0x4e) = 0; in_ECX[0xea] = 0; return; } //@@ 008d0840 FUN_008d0840 void FUN_008d0840(void) { int iVar1; int iVar2; int iVar3; int in_ECX; iVar1 = *(int *)(in_ECX + 8); if ((*(int *)(in_ECX + 0x48) != 0) && ((5 < *(int *)(*(int *)(in_ECX + 0x44) + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)(*(int *)(in_ECX + 0x44) + 0x80))))) { iVar2 = *(int *)(in_ECX + 0x48); iVar3 = *(int *)(iVar2 + 0x4c); if ((iVar2 == 0) || ((iVar3 < 0 || (*(int *)(iVar2 + 0x1c) <= iVar3)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)(in_ECX + 0x4c) + iVar3 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0x44),iVar3,(float)iVar1); } iVar1 = (g_manager->_dailyChallenge)._params._playerType; if (*(int *)(in_ECX + 0x48) != 0) { if ((*(int *)(*(int *)(in_ECX + 0x44) + 0x80) < 0xc) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)(*(int *)(in_ECX + 0x44) + 0x80) < 0xc)) { return; } iVar2 = *(int *)(in_ECX + 0x48); iVar3 = *(int *)(iVar2 + 100); if (((iVar2 == 0) || (iVar3 < 0)) || (*(int *)(iVar2 + 0x1c) <= iVar3)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)(in_ECX + 0x4c) + iVar3 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0x44),iVar3,(float)iVar1); } return; } //@@ 008d0940 FUN_008d0940 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008d0940(int param_1) { byte bVar1; byte bVar2; uint uVar3; byte *pbVar4; byte *pbVar5; undefined4 *in_ECX; void *ptr; char *pcVar6; uint uVar7; bool bVar8; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af828d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_14 = uVar3; pbVar4 = leaderboard_name_format(local_2c,(g_manager->_dailyChallenge)._id,(int)in_ECX,param_1); local_8 = (void *)0x0; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } bVar1 = leaderboard_find_async(pbVar4,0,FUN_008d0aa0,in_ECX); local_8 = (void *)0xffffffff; if (0xf < local_18) { uVar7 = local_18 + 1; ptr = local_2c[0]; if (0xfff < uVar7) { ptr = *(void **)((int)local_2c[0] + -4); uVar7 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = 1; pbVar4 = (byte *)in_ECX[0x12]; local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)((uint)local_2c[0] & 0xffffff00); if (pbVar4 != (byte *)0x0) { pbVar5 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar5 = *(byte **)pbVar4; } pcVar6 = "Loading"; do { bVar2 = *pbVar5; bVar8 = bVar2 < (byte)*pcVar6; if (bVar2 != *pcVar6) { LAB_008d0a33: uVar7 = -(uint)bVar8 | 1; goto LAB_008d0a38; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar8 = bVar2 < (byte)pcVar6[1]; if (bVar2 != pcVar6[1]) goto LAB_008d0a33; pbVar5 = pbVar5 + 2; pcVar6 = pcVar6 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_008d0a38: if ((uVar7 == 0) && ((pbVar4[0x34] == 0 || (*(char *)(in_ECX + 0x16) != '\0')))) goto LAB_008d0a65; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 5),(byte *)"Loading",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x11)); *(undefined1 *)(in_ECX + 0x16) = 1; } LAB_008d0a65: if (bVar1 == 0) { *(undefined1 *)(in_ECX + 0x4e) = 1; FUN_00837510(uVar3); } ExceptionList = local_10; return; } //@@ 008d0aa0 FUN_008d0aa0 void FUN_008d0aa0(undefined4 *param_1,int param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; ExceptionList = &local_10; if (g_menuManager->_selectedMenuID != 4) { if (param_1 != (undefined4 *)0x0) { if ((void *)param_1[1] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)param_1[1],0); param_1[1] = 0; } local_8 = 0xffffffff; operator_delete(param_1,0x18); } KAGE::System::LeaderboardManager::release_result(*(int *)(param_2 + 0x758)); KAGE::System::LeaderboardManager::release_result(*(int *)(param_2 + 0x75c)); *(undefined4 *)(param_2 + 0x75c) = 0; *(undefined4 *)(param_2 + 0x758) = 0; ExceptionList = local_10; return; } if (param_1 == (undefined4 *)0x0) { FUN_00837510(__security_cookie ^ (int)register0x00000010 - 4U); *(undefined1 *)(param_2 + 0x138) = 1; ExceptionList = local_10; return; } if (*(int *)(param_2 + 0x758) == 0) { *(undefined4 *)(param_2 + 0x758) = *param_1; } else if (*(int *)(param_2 + 0x75c) == 0) { *(undefined4 *)(param_2 + 0x75c) = *param_1; } FUN_00a51c60(*param_1,FUN_008d0c30,param_2); ExceptionList = local_10; return; } //@@ 008d0bc0 FUN_008d0bc0 void FUN_008d0bc0(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; if (*(void **)((int)in_ECX + 4) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)((int)in_ECX + 4),0); *(undefined4 *)((int)in_ECX + 4) = 0; } operator_delete(in_ECX,0x18); ExceptionList = local_10; return; } //@@ 008d0c30 FUN_008d0c30 void FUN_008d0c30(int param_1,int *param_2) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; LayerState *pLVar5; byte *pbVar6; int iVar7; bool bVar8; if (g_menuManager->_selectedMenuID != 4) { KAGE::System::LeaderboardManager::release_result(param_2[0x1d6]); KAGE::System::LeaderboardManager::release_result(param_2[0x1d7]); param_2[0x1d7] = 0; param_2[0x1d6] = 0; return; } KAGE_LogMessage(1,(byte *)"got %d entries\n"); pbVar1 = (byte *)param_2[0x12]; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar6 = s_Idle; do { bVar2 = *pbVar3; bVar8 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_008d0cc0: uVar4 = -(uint)bVar8 | 1; goto LAB_008d0cc5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar8 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_008d0cc0; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008d0cc5: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((char)param_2[0x16] != '\0')))) goto LAB_008d0cf2; } bVar2 = ANM2::SetAnimation((ANM2 *)(param_2 + 5),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(param_2 + 0x11)); *(undefined1 *)(param_2 + 0x16) = 1; } LAB_008d0cf2: if (*(int *)(param_1 + 8) == 0) { if (param_2[0x1d7] == 0) { FUN_008d0940(2); return; } *param_2 = 2; iVar7 = 2; } else { *param_2 = 3; iVar7 = 3; param_2[0x4a] = *(int *)(*(int *)(param_1 + 4) + 0xc); if (*(int *)(param_1 + 4) != 0) { FUN_008571b0(*(int *)(param_1 + 4)); iVar7 = *param_2; } } pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),&UNK_00b757dc); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(param_2 + 5),*(int *)pLVar5->_layerData,(uint)(iVar7 != 2)); } iVar7 = *param_2; pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),(byte *)"Item2"); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(param_2 + 5),*(int *)pLVar5->_layerData,(uint)(iVar7 != 2)); } iVar7 = *param_2; pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),&UNK_00b75834); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(param_2 + 5),*(int *)pLVar5->_layerData,(uint)(iVar7 == 2)); } pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),&UNK_00b75824); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(param_2 + 5),*(int *)pLVar5->_layerData,0); } iVar7 = *param_2; pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),(byte *)"Text2"); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(param_2 + 5),*(int *)pLVar5->_layerData,(uint)(iVar7 == 2)); } pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),&DAT_00000005); pLVar5->_visible = 1; pLVar5 = ANM2::GetLayer((ANM2 *)(param_2 + 5),&DAT_0000000b); pLVar5->_visible = 1; return; } //@@ 008d0ea0 FUN_008d0ea0 void FUN_008d0ea0(int param_1,undefined4 *param_2) { KColor fadeColor; KColor aKStackY_a2c [128]; undefined1 in_stack_ffffffe8 [16]; int iVar1; if (param_1 == 0) { *param_2 = 0; return; } iVar1 = 0x8d0eae; daily_challenge_refresh(); KColor::SetFromARGB(aKStackY_a2c + 0x81,0xff000000); fadeColor._unk = iVar1; fadeColor._red = (float)in_stack_ffffffe8._0_4_; fadeColor._green = (float)in_stack_ffffffe8._4_4_; fadeColor._blue = (float)in_stack_ffffffe8._8_4_; fadeColor._alpha = (float)in_stack_ffffffe8._12_4_; MenuManager::start_game(fadeColor); return; } //@@ 008d0ed0 FUN_008d0ed0 void FUN_008d0ed0(char param_1) { int unused; if (param_1 != '\0') { LobbySettings::reset(&g_manager->_lobbySettings); *(undefined4 *)&g_manager->_lobbySettings = 2; MenuManager::push_menu(0x12,unused); } return; } //@@ 008d0f10 FUN_008d0f10 void FUN_008d0f10(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; std::vector::_Tidy(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x118)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x168)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x148)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x130)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x118)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x54)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); ExceptionList = local_10; return; } //@@ 008d0fd0 PauseScreen::load_drop_player_menu /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads gfx/ui/Menu_DropPlayer.anm2 (Background, UpperSelector) and gfx/ui/DropPlayer_Counter.anm2; called at the end of PauseScreen::Init */ void PauseScreen::load_drop_player_menu(void) { byte bVar1; byte *curAnimChar; int in_ECX; char *pcVar2; uint uVar3; bool isLess; std_string menuAnmPath; std_string counterAnmPath; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; securityCookie = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; menuAnmPath._size = 0; menuAnmPath._capacity = 0xf; menuAnmPath._buf[0] = '\0'; menuAnmPath._buf[1] = '\0'; menuAnmPath._buf[2] = '\0'; menuAnmPath._buf[3] = '\0'; menuAnmPath._buf._0_4_ = std::_Allocate(0x20); menuAnmPath._size = 0x1b; menuAnmPath._capacity = 0x1f; builtin_strncpy((char *)menuAnmPath._buf._0_4_,"gfx/ui/Menu_DropPlayer.anm2",0x1c); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 4),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar3 = menuAnmPath._capacity + 1; pcVar2 = (char *)menuAnmPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(menuAnmPath._buf._0_4_ + -4); uVar3 = menuAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuAnmPath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } animData = *(byte **)(in_ECX + 0x38); if (animData == (byte *)0x0) { LAB_008d1114: bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),(byte *)"Background",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x34)); *(undefined1 *)(in_ECX + 0x48) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } pcVar2 = "Background"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_008d1101: uVar3 = -(uint)isLess | 1; goto LAB_008d1106; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_008d1101; curAnimChar = curAnimChar + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_008d1106: if ((uVar3 != 0) || ((animData[0x34] != 0 && (*(char *)(in_ECX + 0x48) == '\0')))) goto LAB_008d1114; } counterAnmPath._size = 0; counterAnmPath._capacity = 0xf; counterAnmPath._buf[0] = '\0'; counterAnmPath._buf[1] = '\0'; counterAnmPath._buf[2] = '\0'; counterAnmPath._buf[3] = '\0'; counterAnmPath._buf._0_4_ = std::_Allocate(0x20); counterAnmPath._size = 0x1e; counterAnmPath._capacity = 0x1f; builtin_strncpy((char *)counterAnmPath._buf._0_4_,"gfx/ui/DropPlayer_Counter.anm2",0x1f); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x118),&counterAnmPath,1); local_14 = 0xffffffff; if (0xf < counterAnmPath._capacity) { uVar3 = counterAnmPath._capacity + 1; pcVar2 = (char *)counterAnmPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(counterAnmPath._buf._0_4_ + -4); uVar3 = counterAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(counterAnmPath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } animData = *(byte **)(in_ECX + 0x14c); counterAnmPath._size = 0; counterAnmPath._capacity = 0xf; counterAnmPath._buf._0_4_ = counterAnmPath._buf._0_4_ & 0xffffff00; if (animData != (byte *)0x0) { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } pcVar2 = "UpperSelector"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_008d1238: uVar3 = -(uint)isLess | 1; goto LAB_008d123d; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_008d1238; curAnimChar = curAnimChar + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_008d123d: if ((uVar3 == 0) && ((animData[0x34] == 0 || (*(char *)(in_ECX + 0x15c) != '\0')))) goto LAB_008d1269; } bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x118),(byte *)"UpperSelector",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x148)); *(undefined1 *)(in_ECX + 0x15c) = 1; } LAB_008d1269: *(undefined4 *)(in_ECX + 0x1b4) = *(undefined4 *)(in_ECX + 0x238); *(undefined4 *)(in_ECX + 0x1b8) = *(undefined4 *)(in_ECX + 0x238); ExceptionList = local_1c; return; } //@@ 008d12b0 PauseScreen::update_player_info_page /* DB: ? PauseScreen::Update when state==6: returns if HUD hidden, LowerSelector/UpperSelector anims, online_lobby_get_member_count, InputManager::FirstLocalDeviceID, PopupWindow::hide */ void PauseScreen::update_player_info_page(void) { int iVar1; byte *pbVar2; Manager *pMVar3; char cVar4; byte bVar5; int iVar6; int iVar7; Entity_Player *pEVar8; byte *pbVar9; uint uVar10; PauseScreen *in_ECX; byte *pbVar11; bool bVar12; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; byte *local_8; if ((g_game->_hud)._isVisible == 0) { return; } build_player_user_list(in_ECX); if (in_ECX->field_0x10d != '\0') { AnimationState::Update((AnimationState *)&in_ECX->field_0x34); AnimationState::Update((AnimationState *)&in_ECX->field_0x54); } if (in_ECX->field_0x221 != '\0') { AnimationState::Update((AnimationState *)&in_ECX->field_0x148); AnimationState::Update((AnimationState *)&in_ECX->field_0x168); } iVar6 = online_lobby_get_member_count(); iVar1 = iVar6 + -1; if (iVar1 <= in_ECX->_state) { in_ECX->_state = iVar6 + -2; } if (g_menuManager == (MenuManager *)0x0) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pEVar8 = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); iVar7 = pEVar8->_controllerIndex; } else { iVar7 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } } else { iVar7 = g_menuControllerIndex; } local_8 = (byte *)0xf; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_8,0,0); if ((cVar4 == '\0') && (0 < iVar1)) { local_8 = (byte *)0xe; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_8,0,0); if (cVar4 == '\0') { if (iVar1 < 2) goto LAB_008d1434; local_8 = (byte *)in_ECX->_state; local_c = 0x16; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_c,0,0); if (cVar4 == '\0') { local_10 = 0x17; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_10,0,0); if (cVar4 != '\0') goto LAB_008d154d; local_14 = 0x14; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_14,0,0); if (cVar4 != '\0') { in_ECX->_state = in_ECX->_state + -1; if (-1 < in_ECX->_state) goto LAB_008d156b; uVar10 = iVar6 - 2; goto LAB_008d1569; } local_18 = 0x15; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_18,0,0); if (cVar4 != '\0') { in_ECX->_state = (in_ECX->_state + 1) % iVar1; } } else { LAB_008d154d: if (iVar1 == 2) { uVar10 = (uint)(in_ECX->_state == 0); } else { uVar10 = 2; if (0 < in_ECX->_state) { uVar10 = 0; } } LAB_008d1569: in_ECX->_state = uVar10; } LAB_008d156b: pMVar3 = g_manager; if ((byte *)in_ECX->_state != local_8) { local_8 = (byte *)0x11a; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&pMVar3->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); } goto LAB_008d1434; } FUN_00909c40(*(undefined4 *)(*(int *)&in_ECX->field_0x22c + in_ECX->_state * 8), *(undefined4 *)(*(int *)&in_ECX->field_0x22c + 4 + in_ECX->_state * 8)); pMVar3 = g_manager; local_8 = (byte *)0x25; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&pMVar3->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); } PopupWindow::hide(&g_game->_pauseScreen); LAB_008d1434: local_8 = (byte *)0xb75850; pbVar2 = *(byte **)&in_ECX->field_0x14c; if (in_ECX->_state != 0) { local_8 = (byte *)0xb75860; } if (pbVar2 != (byte *)0x0) { pbVar9 = pbVar2; pbVar11 = local_8; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar9 = *(byte **)pbVar2; } do { bVar5 = *pbVar9; bVar12 = bVar5 < *pbVar11; if (bVar5 != *pbVar11) { LAB_008d15bc: uVar10 = -(uint)bVar12 | 1; goto LAB_008d15c1; } if (bVar5 == 0) break; bVar5 = pbVar9[1]; bVar12 = bVar5 < pbVar11[1]; if (bVar5 != pbVar11[1]) goto LAB_008d15bc; pbVar9 = pbVar9 + 2; pbVar11 = pbVar11 + 2; } while (bVar5 != 0); uVar10 = 0; LAB_008d15c1: if (uVar10 == 0) { if (pbVar2[0x34] == 0) { return; } if (in_ECX->field_0x15c != '\0') { return; } } } bVar5 = ANM2::SetAnimation((ANM2 *)&in_ECX->field_0x118,local_8,1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&in_ECX->field_0x148); in_ECX->field_0x15c = 1; } return; } //@@ 008d1600 kick_player_menu_render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called only from PauseScreen::Render case 6 with ECX = PauseScreen+0x1218 (unnamed kick sub-menu object, player list vector at +0x22c/+0x230); centers its ANM2 (this+4) on screen, draws "KICK PLAYER" at the "Title" null, "%d / %d" at "KickCounter", player HUD layouts / NetplayManager::get_drop_entry */ void kick_player_menu_render(void) { int iVar1; float *pfVar2; Entity_Player *player; int *in_ECX; KColor *color; KColor *color_00; Manager *pMVar3; int index; float fVar4; KColor local_78; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; float local_48; Vector local_44; Vector local_3c; byte local_34 [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05c25; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; if ((in_ECX[0x8c] - in_ECX[0x8b] >> 3 != 0) && ((g_game->_hud)._isVisible != 0)) { local_44.x = g_screenWidth * 0.5; local_44.y = g_screenHeight * 0.5; ANM2::Render((ANM2 *)(in_ECX + 1),&local_44,&g_vectorZero,&g_vectorZero); pMVar3 = g_manager; iVar1 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,(byte *)"KICK PLAYER",-1); local_48 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); if (in_ECX[0xe] == 0) { pfVar2 = (float *)0x0; } else { pfVar2 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0xd),(byte *)"Title"); pMVar3 = g_manager; } local_64 = 0; local_44.y = local_44.y + pfVar2[1]; local_44.x = (local_44.x + *pfVar2) - local_48 * 0.5; local_60 = 0xffff; local_5c = 0; local_58 = 0x3f800000; local_54 = 0xffffffff; local_50 = 0; local_4c = 0; local_8 = 0; KColor::SetFromARGB(&local_78,0xffffffff); Font::DrawStringScaled (&pMVar3->_font2_TeamMeatEx12,(byte *)"KICK PLAYER",&local_44,color,&local_64); local_8 = 0xffffffff; iVar1 = 2; index = *in_ECX + 1; player = PlayerManager::get_main_player(&g_game->_playerManager,index); if (player != (Entity_Player *)0x0) { iVar1 = HUD::GetPlayerHUDLayout(&g_game->_hud,index,player); } HUD::get_player_hud_position(&g_game->_hud,&local_3c,index,iVar1); if (*in_ECX == 0) { if (iVar1 == 2) { local_3c.y = local_3c.y + 50.0; } else { local_3c.y = local_3c.y + 65.0; } } else { local_3c.y = local_3c.y - 35.0; } ANM2::Render((ANM2 *)(in_ECX + 0x46),&local_3c,&g_vectorZero,&g_vectorZero); NetplayManager::get_drop_entry (&g_manager->_netplayManager, CONCAT44(*(undefined4 *)(in_ECX[0x8b] + 4 + *in_ECX * 8), *(undefined4 *)(in_ECX[0x8b] + *in_ECX * 8))); FUN_009060c0(); NetplayManager::get_drop_entry (&g_manager->_netplayManager, CONCAT44(*(undefined4 *)(in_ECX[0x8b] + 4 + *in_ECX * 8), *(undefined4 *)(in_ECX[0x8b] + *in_ECX * 8))); sprintf_s(local_34,0x20,(byte *)"%d / %d"); pMVar3 = g_manager; iVar1 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,local_34,-1); local_48 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) * (float)in_ECX[0x8e]; if (in_ECX[0x53] == 0) { pfVar2 = (float *)0x0; } else { pfVar2 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x52),(byte *)"KickCounter") ; pMVar3 = g_manager; } fVar4 = (float)in_ECX[0x8e]; local_64 = 0; local_60 = 0xffff; local_5c = 0; local_44.y = fVar4 * pfVar2[1] + local_3c.y; local_58 = 0x3f800000; local_54 = 0xffffffff; local_44.x = (local_3c.x + fVar4 * *pfVar2) - local_48 * 0.5; local_50 = 0; local_4c = 0; local_8 = 1; KColor::SetFromARGB(&local_78,0xffffffff); local_3c.x = fVar4; local_3c.y = fVar4; Font::DrawString(&pMVar3->_font2_TeamMeatEx12,local_34,&local_44,&local_3c,color_00,&local_64); } ExceptionList = local_10; return; } //@@ 008d19a0 PauseScreen::build_player_user_list /* DB: ? ECX=PauseScreen (caller PauseScreen::update_player_info_page): clears u64 vector +0x22c/+0x230, pushes the user id of each main player's netplay device (NetManager::GetDeviceById loop, "Invalid lobby user index"), then appends lobby members not yet listed (NetplayManager::is_user_in_player_list), loading their UserProfile/steam avatar prototype: db/protos.zhl */ void __thiscall PauseScreen::build_player_user_list(PauseScreen *playerManager) { char cVar1; byte isAlreadyListed; uint uVar2; int iVar3; NetplayManager deviceIter; int extraout_EAX; undefined4 uVar4; undefined1 *extraout_EAX_00; uint uVar5; undefined4 uVar6; int *playerSlot; int iVar7; uint playerIndex; PlayerManager *playerManager; uint deviceCount; undefined1 *userIds; int local_3c; int *lobbyRefCount; undefined4 memberUserIdLow; undefined4 memberUserIdHigh; undefined8 userId; undefined8 local_24; PauseScreen *pauseScreen; undefined **memberProfile; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; void *playerListEnd; undefined4 *userIdsEnd; local_8 = 0xffffffff; puStack_c = &LAB_00b05c7d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; userIds = &playerManager->field_0x22c; playerManager = &g_game->_playerManager; *(undefined4 *)&playerManager->field_0x230 = *(undefined4 *)userIds; playerIndex = 0; pauseScreen = playerManager; local_14 = userIds; iVar3 = PlayerManager::count_main_players(playerManager); if (iVar3 != 0) { do { playerListEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; if ((int)playerListEnd - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playerListEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; } if (playerIndex < (uint)((int)playerListEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + playerIndex; } uVar5 = 0; iVar3 = *(int *)(*playerSlot + 0x1618); deviceIter = g_manager->_netplayManager; deviceCount = *(int *)(g_manager + 1) - (int)deviceIter >> 2; if (deviceCount != 0) { do { iVar7 = *(int *)deviceIter; if (*(int *)(iVar7 + 0xc) == iVar3) goto LAB_008d1a7d; uVar5 = uVar5 + 1; deviceIter = (NetplayManager)((int)deviceIter + 4); } while (uVar5 < deviceCount); } KAGE_LogMessage(8,(byte *) "[Frame: %d] NetManager::GetDeviceById() failed to find device with ID %d \n" ); iVar7 = 0; LAB_008d1a7d: cVar1 = (**(code **)(*(int *)(iVar7 + 0x370) + 0x14))(uVar2); if (cVar1 == '\0') { iVar3 = FUN_0090b010(iVar3); userIds = local_14; iVar3 = *(int *)(iVar3 + 0x374); if (iVar3 == 0) { local_24 = 0; local_24._4_4_ = 0; local_24._0_4_ = (undefined **)0x0; uVar4 = (undefined **)local_24; uVar6 = local_24._4_4_; } else { uVar4 = *(undefined4 *)(iVar3 + 8); uVar6 = *(undefined4 *)(iVar3 + 0xc); } userId = CONCAT44(uVar6,uVar4); userIdsEnd = *(undefined4 **)&pauseScreen->field_0x230; if (userIdsEnd == *(undefined4 **)&pauseScreen->field_0x234) { std::vector<8byte>::_Emplace_reallocate(userIdsEnd,&userId); } else { *userIdsEnd = uVar4; userIdsEnd[1] = uVar6; *(int *)(local_14 + 4) = *(int *)(local_14 + 4) + 8; } } else { userIds = local_14; } playerIndex = playerIndex + 1; playerManager = &g_game->_playerManager; uVar5 = PlayerManager::count_main_players(playerManager); } while (playerIndex < uVar5); } local_3c = 0; lobbyRefCount = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_3c,&g_multiplayerLobbyPtr); local_8._0_1_ = 1; local_8._1_3_ = 0; uVar2 = 0; do { while( true ) { manager = g_manager; if ((local_3c == 0) || ((uint)(*(int *)(local_3c + 0x14) - *(int *)(local_3c + 0x10) >> 3) <= uVar2)) { local_8 = 5; if ((lobbyRefCount != (int *)0x0) && ((cVar1 = (**(code **)(*lobbyRefCount + 0xc))(), cVar1 != '\0' && (g_lobbyReleaseFn != (void *)0x0)))) { (*g_lobbyReleaseFn)(&local_3c); } ExceptionList = local_10; return; } local_24 = CONCAT44(local_24._4_4_,KAGE::System::UserProfileBase::vftable); UserProfile::find_or_create((void *)(*(int *)(local_3c + 0x10) + uVar2 * 8)); local_8._0_1_ = 2; local_24._0_4_ = KAGE::System::UserProfile::vftable; local_24._4_4_ = extraout_EAX; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_24); } local_8._0_1_ = 1; if (local_24._4_4_ == 0) { userId = 0; userId._4_4_ = 0; userId._0_4_ = 0; uVar4 = userId._4_4_; uVar6 = (undefined4)userId; } else { uVar4 = *(undefined4 *)(local_24._4_4_ + 0xc); uVar6 = *(undefined4 *)(local_24._4_4_ + 8); } isAlreadyListed = NetplayManager::is_user_in_player_list(&manager->_netplayManager,CONCAT44(uVar4,uVar6)); local_24 = CONCAT44(local_24._4_4_,KAGE::System::UserProfileBase::vftable); if (isAlreadyListed == 0) break; LAB_008d1ccc: uVar2 = uVar2 + 1; } if (local_3c == 0) { memberProfile = KAGE::System::UserProfile::vftable; local_14 = (undefined1 *)0x0; } else { if ((uint)(*(int *)(local_3c + 0x14) - *(int *)(local_3c + 0x10) >> 3) <= uVar2) { KAGE_LogMessage(0x10,(byte *)"Invalid lobby user index"); } memberProfile = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create((void *)(*(int *)(local_3c + 0x10) + uVar2 * 8)); local_8._0_1_ = 3; memberProfile = KAGE::System::UserProfile::vftable; local_14 = extraout_EAX_00; if (((extraout_EAX_00 != (undefined1 *)0x0) && (*(int *)(extraout_EAX_00 + 8) != 0 || *(int *)(extraout_EAX_00 + 0xc) != 0)) && (*(int *)(extraout_EAX_00 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&memberProfile); } } local_8._0_1_ = 4; if (local_14 == (undefined1 *)0x0) { userId = 0; userId._4_4_ = 0; userId._0_4_ = 0; memberUserIdLow = (undefined4)userId; memberUserIdHigh = userId._4_4_; } else { memberUserIdLow = *(undefined4 *)(local_14 + 8); memberUserIdHigh = *(undefined4 *)(local_14 + 0xc); } userIdsEnd = *(undefined4 **)&pauseScreen->field_0x230; if (userIdsEnd == *(undefined4 **)&pauseScreen->field_0x234) { std::vector<8byte>::_Emplace_reallocate(userIdsEnd,&memberUserIdLow); local_8._0_1_ = 1; memberProfile = KAGE::System::UserProfileBase::vftable; goto LAB_008d1ccc; } *userIdsEnd = memberUserIdLow; userIdsEnd[1] = memberUserIdHigh; *(int *)(userIds + 4) = *(int *)(userIds + 4) + 8; uVar2 = uVar2 + 1; local_8._0_1_ = 1; memberProfile = KAGE::System::UserProfileBase::vftable; } while( true ); } //@@ 008d1d20 FUN_008d1d20 void FUN_008d1d20(void) { char *in_ECX; if (*in_ECX != '\0') { in_ECX[4] = '\0'; in_ECX[5] = '\0'; in_ECX[6] = '\0'; in_ECX[7] = '\0'; *in_ECX = '\0'; } SharedPtrPair::~SharedPtrPair(in_ECX + 0x808); SharedPtrPair::~SharedPtrPair(in_ECX + 0x7dc); std::vector>::_Tidy(); OnlineEmotes::destructor(in_ECX + 8); return; } //@@ 008d1d60 OnlineEmotes::init /* DB: ? Game::LoadConfigXmls: resets state, resizes the 12-byte emote set vector to 2, fills set 0 with 0..19 and set 1 with 0x30..0x3a ("Invalid set index %d"), wheel angle 360/count, then OnlineEmotes::load_anm2 */ void OnlineEmotes::init(void) { int *piVar1; float fVar2; int iVar3; int *piVar4; uint uVar5; undefined4 uVar6; undefined1 *in_ECX; int iVar7; float fVar8; int local_8; piVar1 = (int *)(in_ECX + 0x7cc); *(undefined4 *)(in_ECX + 0x804) = *(undefined4 *)(in_ECX + 0x840); *(undefined4 *)(in_ECX + 0x830) = *(undefined4 *)(in_ECX + 0x844); *in_ECX = 1; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x834) = 0xffffffff; uVar5 = (*(int *)(in_ECX + 2000) - *piVar1) / 0xc; if (uVar5 < 3) { if (uVar5 < 2) { if ((uint)((*(int *)(in_ECX + 0x7d4) - *piVar1) / 0xc) < 2) { FUN_008d28c0(*(int *)(in_ECX + 0x7d4) - *piVar1,&local_8); } else { uVar6 = FUN_008d2880(*(undefined4 *)(in_ECX + 2000),2 - uVar5,in_ECX); *(undefined4 *)(in_ECX + 2000) = uVar6; } } } else { iVar7 = *piVar1; FUN_008d2810(*(int *)(in_ECX + 2000) - *piVar1); *(int *)(in_ECX + 2000) = iVar7 + 0x18; } iVar7 = 0; do { iVar3 = *piVar1; piVar4 = *(int **)(iVar3 + 4); if (piVar4 == *(int **)(iVar3 + 8)) { local_8 = iVar7; std::vector<4byte>::_Emplace_reallocate(piVar4,&local_8); } else { *piVar4 = iVar7; *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 4; } iVar7 = iVar7 + 1; } while (iVar7 < 0x14); iVar7 = 0x30; do { iVar3 = *piVar1; piVar4 = *(int **)(iVar3 + 0x10); local_8 = iVar7; if (piVar4 == *(int **)(iVar3 + 0x14)) { std::vector<4byte>::_Emplace_reallocate(piVar4,&local_8); } else { *piVar4 = iVar7; *(int *)(iVar3 + 0x10) = *(int *)(iVar3 + 0x10) + 4; } iVar7 = iVar7 + 1; } while (iVar7 < 0x3b); piVar1 = (int *)*piVar1; iVar7 = *(int *)(in_ECX + 2000) - (int)piVar1 >> 0x1f; if ((*(int *)(in_ECX + 2000) - (int)piVar1) / 0xc + iVar7 == iVar7) { KAGE_LogMessage(8,(byte *)"Invalid set index %d \n"); load_anm2(); in_ECX[0x18] = 0; return; } *(undefined4 *)(in_ECX + 0x7d8) = 0; fVar2 = *(float *)(in_ECX + 0x838); fVar8 = 360.0 / (float)((double)(piVar1[1] - *piVar1 >> 2) + __uint_to_double_fixup[-(piVar1[1] - *piVar1 >> 0x1f)]); *(float *)(in_ECX + 0x838) = fVar8; *(int *)(in_ECX + 0x834) = (int)(((float)*(int *)(in_ECX + 0x834) * fVar2) / fVar8 + 0.5); load_anm2(); in_ECX[0x18] = 0; return; } //@@ 008d1f20 EmoteWheel::Update /* DB: ? ECX=Game+0x25108 (Manager::update_ingame_input, netplay only): state +4 open/close anim (+0x840 += 12 up to +0x844), selection +0x834 from stick atan2 / 360/count (+0x838), emote sets vector-of-vectors +0x7cc with set index +0x7d8 switched by 008d26c0 ("Invalid set index"); 008d1d60 OnlineEmotes::init it in Game::LoadConfigXmls */ void EmoteWheel::Update(void) { int *piVar1; char cVar2; uint uVar3; int iVar4; float *pfVar5; int in_ECX; float fVar6; float fVar7; float local_24; float local_20; int local_1c [3]; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05cad; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 6); ExceptionList = &local_10; iVar4 = *(int *)(in_ECX + 4); if (iVar4 == 1) { iVar4 = 1; fVar7 = *(float *)(in_ECX + 0x844); fVar6 = *(float *)(in_ECX + 0x840) + 12.0; *(float *)(in_ECX + 0x840) = fVar6; if (fVar7 <= fVar6) { *(undefined4 *)(in_ECX + 4) = 2; *(float *)(in_ECX + 0x840) = fVar7; *(int *)(in_ECX + 0x834) = (int)(270.0 / *(float *)(in_ECX + 0x838)); iVar4 = 2; fVar6 = fVar7; } *(float *)(in_ECX + 0x804) = fVar6; } if (iVar4 == 3) { fVar7 = *(float *)(in_ECX + 0x840) - 12.0; *(float *)(in_ECX + 0x840) = fVar7; if (fVar7 <= 0.0) { *(undefined4 *)(in_ECX + 0x840) = 0; fVar7 = 0.0; *(undefined4 *)(in_ECX + 4) = 0; } *(float *)(in_ECX + 0x804) = fVar7; } iVar4 = FUN_0090b070(uVar3); if ((((((iVar4 == 0) || ((g_game->_pauseScreen)._state != 0)) || (*(int *)&g_game->_gameOver != 0) ) || (((g_game->_genericPrompt)._sprite._animState._animData != (void *)0x0 && ((g_game->_genericPrompt)._sprite._animState._isPlaying != 0)))) || (((g_game->_leaderboard)._state != 0 || (*(int *)&g_game->_stageTransition != 0)))) || ((*(int *)&g_game->_roomTransition != 0 && (cVar2 = Game::IsRoomTransitionActive(), cVar2 != '\0')))) { if (*(int *)(in_ECX + 4) == 2) { *(undefined4 *)(in_ECX + 0x834) = 0; *(undefined4 *)(in_ECX + 4) = 3; } *(undefined4 *)(in_ECX + 0x840) = 0; } else { FUN_0090b070(uVar3); iVar4 = FUN_00423970(); local_1c[2] = 0x1e; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 2,0,0); if ((cVar2 != '\0') && (*(int *)(in_ECX + 4) == 0)) { *(undefined4 *)(in_ECX + 0x834) = 0; FUN_008d26c0(0,0); *(undefined4 *)(in_ECX + 4) = 1; } if (*(int *)(in_ECX + 4) == 2) { if (iVar4 == 0) { if (*(int *)(in_ECX + 0x834) < 0) { *(undefined4 *)(in_ECX + 0x834) = 0; } local_1c[2] = 0x14; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 2,0,0); if (cVar2 == '\0') { local_1c[2] = 0x15; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 2,0,0); if (cVar2 != '\0') { *(uint *)(in_ECX + 0x834) = (*(int *)(in_ECX + 0x834) + 1U) % (uint)(*(int *)(*(int *)(in_ECX + 0x7cc) + 4 + *(int *)(in_ECX + 0x7d8) * 0xc) - *(int *)(*(int *)(in_ECX + 0x7cc) + *(int *)(in_ECX + 0x7d8) * 0xc) >> 2); } } else { piVar1 = (int *)(in_ECX + 0x834); *piVar1 = *piVar1 + -1; if (*piVar1 < 0) { *(int *)(in_ECX + 0x834) = (*(int *)(*(int *)(in_ECX + 0x7cc) + 4 + *(int *)(in_ECX + 0x7d8) * 0xc) - *(int *)(*(int *)(in_ECX + 0x7cc) + *(int *)(in_ECX + 0x7d8) * 0xc) >> 2) + -1; } } } else { *(undefined4 *)(in_ECX + 0x834) = 0xffffffff; InputManager::get_device(&PTR_vftable_00c57b18,local_1c,iVar4); local_8 = 0; if (local_1c[0] == 0) { pfVar5 = &local_24; local_24 = g_vectorZero.x; local_20 = g_vectorZero.y; } else { pfVar5 = (float *)FUN_00a1eed0(&local_24,0); } fVar7 = sqrtf(*pfVar5 * *pfVar5 + pfVar5[1] * pfVar5[1]); if (0.5 < fVar7) { fVar7 = atan2f(pfVar5[1],*pfVar5); fVar7 = fVar7 * 57.295776; if (fVar7 < 0.0) { fVar7 = fVar7 + 360.0; } *(int *)(in_ECX + 0x834) = (int)(fVar7 / *(float *)(in_ECX + 0x838)); } local_8 = 0xffffffff; FUN_004242b0(); } local_1c[2] = 0xe; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 2,0,0); if (cVar2 == '\0') { local_1c[1] = 0x1e; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 1,0,0); if (cVar2 == '\0') { local_1c[1] = 0x1c; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,local_1c + 1,0,0); if (cVar2 != '\0') { FUN_008d26c0((*(int *)(in_ECX + 0x7d8) + 1U) % (uint)((*(int *)(in_ECX + 2000) - *(int *)(in_ECX + 0x7cc)) / 0xc),0); ExceptionList = local_10; return; } local_20 = 2.10195e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,&local_20,0,0); if (cVar2 == '\0') { ExceptionList = local_10; return; } if (*(int *)(in_ECX + 4) == 2) { *(undefined4 *)(in_ECX + 0x834) = 0; *(undefined4 *)(in_ECX + 4) = 3; ExceptionList = local_10; return; } ExceptionList = local_10; return; } } if (-1 < *(int *)(in_ECX + 0x834)) { iVar4 = *(int *)(*(int *)(*(int *)(in_ECX + 0x7cc) + *(int *)(in_ECX + 0x7d8) * 0xc) + *(int *)(in_ECX + 0x834) * 4); if (iVar4 == 0x12) { iVar4 = rand(); *(int *)&g_manager[1]._gamestate.field_0x92c = iVar4 % 6 + 0x16; } else if (iVar4 == 0x13) { iVar4 = rand(); *(int *)&g_manager[1]._gamestate.field_0x92c = iVar4 % 0x14 + 0x1c; } else { *(int *)&g_manager[1]._gamestate.field_0x92c = iVar4; } } if (*(int *)(in_ECX + 4) == 2) { *(undefined4 *)(in_ECX + 0x834) = 0; *(undefined4 *)(in_ECX + 4) = 3; ExceptionList = local_10; return; } } } ExceptionList = local_10; return; } //@@ 008d2450 EmoteWheel::Render /* DB: ? ECX = Game+0x25108 (emote menu), reads the state (+4) and emote-set vector (+0x7cc) its update 008d1f20 EmoteWheel::Update (was Game::render_debug_overlay) */ void __thiscall EmoteWheel::Render(void *this) { undefined4 extraout_ECX; int iVar1; uint uVar2; float fVar3; float fVar4; float local_34; float local_30; float local_2c; float local_28; float local_24; float local_20; undefined4 local_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 local_c; if (*(int *)((int)this + 4) != 0) { local_34 = g_screenWidth * 0.5; local_c = 0; local_30 = g_screenHeight * 0.5; local_2c = local_34; local_28 = local_30; if (*(int *)((int)this + 4) == 2) { local_1c = 0x3f48c8c9; uStack_18 = 0x3f37b7b8; uStack_14 = 0x3f23a3a4; uStack_10 = 0x3eaaaaab; FUN_00424d70(&local_34,&local_1c,0x43b40000,*(undefined4 *)((int)this + 0x848)); if (-1 < *(int *)((int)this + 0x834)) { fVar3 = *(float *)((int)this + 0x838); fVar4 = (float)*(int *)((int)this + 0x834) * fVar3; KColor::set_from_argb_signed(0x6599ff99); FUN_00424d70(&local_34,extraout_ECX,fVar3 + fVar4,*(undefined4 *)((int)this + 0x848)); } uVar2 = 0; iVar1 = *(int *)(*(int *)((int)this + 0x7cc) + *(int *)((int)this + 0x7d8) * 0xc); if (*(int *)(*(int *)((int)this + 0x7cc) + 4 + *(int *)((int)this + 0x7d8) * 0xc) - iVar1 >> 2 != 0) { do { FUN_00430750(*(undefined4 *)(iVar1 + uVar2 * 4),0); ItemUseAnim::update(); local_34 = *(float *)((int)this + 0x804) - 20.0; fVar3 = ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * *(float *)((int)this + 0x838) + *(float *)((int)this + 0x838) * 0.5) * 0.017453292; fVar4 = cos(fVar3); fVar3 = sin(fVar3); local_24 = (fVar4 * local_34 - fVar3 * 0.0) + local_2c; local_20 = fVar3 * local_34 + fVar4 * 0.0 + local_28; Game::Update((Game *)((int)this + 8),&local_24); uVar2 = uVar2 + 1; iVar1 = *(int *)(*(int *)((int)this + 0x7cc) + *(int *)((int)this + 0x7d8) * 0xc); } while (uVar2 < (uint)(*(int *)(*(int *)((int)this + 0x7cc) + 4 + *(int *)((int)this + 0x7d8) * 0xc) - iVar1 >> 2)); return; } } else { fVar3 = *(float *)((int)this + 0x840) - (*(float *)((int)this + 0x844) - *(float *)((int)this + 0x848)); local_1c = 0x3f48c8c9; uStack_18 = 0x3f37b7b8; uStack_14 = 0x3f23a3a4; uStack_10 = 0x3eaaaaab; if (fVar3 <= 0.0) { fVar3 = 0.0; } FUN_00424d70(&local_34,&local_1c,0x43b40000,fVar3); } } return; } //@@ 008d26c0 FUN_008d26c0 void FUN_008d26c0(uint param_1,char param_2) { float fVar1; int in_ECX; int iVar2; float fVar3; if ((param_1 != *(uint *)(in_ECX + 0x7d8)) || (param_2 != '\0')) { iVar2 = *(int *)(in_ECX + 0x7cc); if (param_1 < (uint)((*(int *)(in_ECX + 2000) - iVar2) / 0xc)) { *(uint *)(in_ECX + 0x7d8) = param_1; iVar2 = *(int *)(iVar2 + 4 + param_1 * 0xc) - *(int *)(iVar2 + param_1 * 0xc); fVar1 = *(float *)(in_ECX + 0x838); fVar3 = 360.0 / (float)((double)(iVar2 >> 2) + __uint_to_double_fixup[-(iVar2 >> 0x1f)]); *(float *)(in_ECX + 0x838) = fVar3; *(int *)(in_ECX + 0x834) = (int)(((float)*(int *)(in_ECX + 0x834) * fVar1) / fVar3 + 0.5); return; } KAGE_LogMessage(8,(byte *)"Invalid set index %d \n"); } return; } //@@ 008d2790 std::vector>::_Tidy /* DB: destroys 0xc-byte elements via 008d2810 (each a vector of 4-byte items freed) and frees storage; Game::~Game member next to the SharedPtrPairs and 008d1d20 */ void std::vector>::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_008d2810(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008d2810 FUN_008d2810 void FUN_008d2810(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; int *in_EDX; do { if (in_ECX == in_EDX) { return; } pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffffc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } in_ECX = in_ECX + 3; } while( true ); } //@@ 008d2880 FUN_008d2880 undefined4 * FUN_008d2880(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1 = param_1 + 3; } FUN_008d2810(); return param_1; } //@@ 008d28c0 FUN_008d28c0 void FUN_008d28c0(undefined4 param_1,undefined1 *param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; void *pvVar4; int iVar5; uint uVar6; undefined4 *puVar7; undefined4 *puVar8; int *in_ECX; undefined4 *puVar9; uint size; void *ptr; undefined4 *puVar10; iVar5 = (in_ECX[1] - *in_ECX) / 0xc; uVar6 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar6 >> 1) < uVar6) { uVar6 = 0x15555555; } else { uVar6 = (uVar6 >> 1) + uVar6; if (uVar6 < 2) { uVar6 = 2; } else if (0x15555555 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = std::_Allocate(uVar6 * 0xc); FUN_008d2880(puVar7 + iVar5 * 3,2 - iVar5,*param_2); puVar1 = (undefined4 *)in_ECX[1]; puVar8 = (undefined4 *)*in_ECX; puVar9 = puVar1; puVar10 = puVar7; if (puVar8 != puVar1) { do { uVar2 = puVar8[2]; uVar3 = puVar8[1]; puVar9 = (undefined4 *)*puVar8; puVar8[2] = 0; puVar8[1] = 0; *puVar8 = 0; puVar8 = puVar8 + 3; *puVar10 = puVar9; puVar10[1] = uVar3; puVar10[2] = uVar2; puVar10 = puVar10 + 3; } while (puVar8 != puVar1); } FUN_008d2810(puVar9); if (*in_ECX != 0) { FUN_008d2810(*in_ECX); pvVar4 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar4) / 0xc) * 0xc; ptr = pvVar4; if (0xfff < size) { ptr = *(void **)((int)pvVar4 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + 6); in_ECX[2] = (int)(puVar7 + uVar6 * 3); return; } //@@ 008d2a30 PauseScreen_MyStuff::~PauseScreen_MyStuff /* DB: ? destructor of the PauseScreen member built right after Menu_Options (PauseScreen+0x838, ANM2 at +0x64 = PauseScreen+0x89c from PauseScreen::constructor): ANM2s +0x64/+0x1f0/+0x418/+0x52c, RichText, map erase, image refs; only PauseScreen::~PauseScreen (just before Menu_Options::~Menu_Options) */ void PauseScreen_MyStuff::~PauseScreen_MyStuff(void) { int iVar1; int iVar2; char cVar3; uint uVar4; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05cd0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(in_ECX + 0x18); *(undefined4 *)(in_ECX + 0x24) = 0; *(undefined4 *)(in_ECX + 0x28) = 0; *(undefined4 *)(in_ECX + 0x2c) = 0; KAGE::SmartPointer::reset((void *)(in_ECX + 0x640),(void *)0x0); iVar1 = *(int *)(in_ECX + 0x1e8); if (iVar1 != 0) { iVar2 = *(int *)(iVar1 + 0x120); std::map::_Erase_tree(iVar1 + 0x120,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)(iVar1 + 0x124) = 0; } local_8 = 0; if (*(int **)(in_ECX + 0x644) != (int *)0x0) { cVar3 = (**(code **)(**(int **)(in_ECX + 0x644) + 0xc))(uVar4); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((void *)(in_ECX + 0x640)); } } local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x52c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x57c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x55c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x544)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x52c)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x418)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x468)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x448)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x430)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x418)); local_8 = 3; ANM2::Reset((ANM2 *)(in_ECX + 0x304)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x354)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x334)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x31c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x304)); local_8 = 4; ANM2::Reset((ANM2 *)(in_ECX + 0x1f0)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x240)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x220)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x208)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1f0)); RichText::~RichText((void *)(in_ECX + 0x184)); local_8 = 5; ANM2::Reset((ANM2 *)(in_ECX + 100)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0xb4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x94)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x7c)); std::string::_Tidy_deallocate((char *)(in_ECX + 100)); local_8 = 6; if (*(int **)(in_ECX + 0x54) != (int *)0x0) { cVar3 = (**(code **)(**(int **)(in_ECX + 0x54) + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x50); } } local_8 = 7; if (*(int **)(in_ECX + 0x40) != (int *)0x0) { cVar3 = (**(code **)(**(int **)(in_ECX + 0x40) + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x3c); } } FID_conflict__Tidy((void *)(in_ECX + 0x18)); ExceptionList = local_10; return; } //@@ 008d2ca0 PauseScreen_MyStuff::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? PauseScreen::Init calls it on the member after Menu_Options (see 008d2a30): loads PauseScreen_MyStuff.anm2, ui_charge_icons.anm2, minimap_icons.anm2, Death Screen.anm2, MyStuff_SectionCursor.png, TeamMeatEx12.fnt; layers Items/Diary/ChargeIcon/Cursor prototype: db/protos.zhl */ void __thiscall PauseScreen_MyStuff::Init(void *this) { byte bVar1; char isReleased; byte *curAnim; LayerState *layer; void *cursorImage; byte *pbVar2; char *pcVar3; uint uVar4; byte *pbVar5; ANM2 *sprite; bool isLess; undefined1 imageRef [4]; int *imageRefCount; void *self; std_string filePath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *selfRef; puStack_20 = imageRef + 0x44; local_14 = 0xffffffff; puStack_18 = &LAB_00b05d25; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(imageRef + 0x38); ExceptionList = &local_1c; self = this; FUN_008d3250(local_24); filePath._buf._0_4_ = std::_Allocate(0x30); filePath._size = 0x20; filePath._capacity = 0x2f; builtin_strncpy((char *)filePath._buf._0_4_,"font/TeamMeatEx/TeamMeatEx12.fnt",0x21); local_14 = 0; RichText::load_font(&filePath); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; pcVar3 = (char *)filePath._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(filePath._buf._0_4_ + -4); uVar4 = filePath._capacity + 0x24; if ((char *)0x1f < (char *)(filePath._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } *(undefined4 *)((int)this + 0x1ec) = 0x3f666666; sprite = (ANM2 *)((int)this + 0x304); filePath._size = 0; filePath._capacity = 0xf; filePath._buf[0] = '\0'; filePath._buf[1] = '\0'; filePath._buf[2] = '\0'; filePath._buf[3] = '\0'; filePath._buf._0_4_ = std::_Allocate(0x20); filePath._size = 0x1f; filePath._capacity = 0x1f; builtin_strncpy((char *)filePath._buf._0_4_,"gfx/ui/PauseScreen_MyStuff.anm2",0x20); local_14 = 1; ANM2::Load(sprite,&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; pcVar3 = (char *)filePath._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(filePath._buf._0_4_ + -4); uVar4 = filePath._capacity + 0x24; if ((char *)0x1f < (char *)(filePath._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } pbVar5 = *(byte **)((int)this + 0x338); if (pbVar5 == (byte *)0x0) { LAB_008d2e85: bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)this + 0x334)); *(undefined1 *)((int)this + 0x348) = 1; } } else { curAnim = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnim = *(byte **)pbVar5; } pbVar2 = s_Idle; do { bVar1 = *curAnim; isLess = bVar1 < *pbVar2; if (bVar1 != *pbVar2) { LAB_008d2e72: uVar4 = -(uint)isLess | 1; goto LAB_008d2e77; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < pbVar2[1]; if (bVar1 != pbVar2[1]) goto LAB_008d2e72; curAnim = curAnim + 2; pbVar2 = pbVar2 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_008d2e77: if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && (*(char *)((int)this + 0x348) == '\0')))) goto LAB_008d2e85; } layer = ANM2::GetLayer(sprite,(byte *)"Cursor"); selfRef = self; sprite = (ANM2 *)((int)self + 0x418); filePath._size = 0; layer->_visible = 0; filePath._capacity = 0xf; filePath._buf[0] = '\0'; filePath._buf[1] = '\0'; filePath._buf[2] = '\0'; filePath._buf[3] = '\0'; filePath._buf._0_4_ = std::_Allocate(0x20); filePath._size = 0x18; filePath._capacity = 0x1f; builtin_strncpy((char *)filePath._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14 = 2; ANM2::Load(sprite,&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; pcVar3 = (char *)filePath._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(filePath._buf._0_4_ + -4); uVar4 = filePath._capacity + 0x24; if ((char *)0x1f < (char *)(filePath._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } pbVar5 = *(byte **)((int)selfRef + 0x44c); if (pbVar5 == (byte *)0x0) { LAB_008d2fa5: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Diary",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)selfRef + 0x448)); *(undefined1 *)((int)selfRef + 0x45c) = 1; } } else { curAnim = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnim = *(byte **)pbVar5; } pcVar3 = "Diary"; do { bVar1 = *curAnim; isLess = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_008d2f92: uVar4 = -(uint)isLess | 1; goto LAB_008d2f97; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_008d2f92; curAnim = curAnim + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_008d2f97: if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && (*(char *)((int)selfRef + 0x45c) == '\0')))) goto LAB_008d2fa5; } pbVar5 = (byte *)0x0; if (*(int *)((int)self + 0x498) != 0) { do { layer = ANM2::GetLayer(sprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while (pbVar5 < *(byte **)((int)self + 0x498)); } layer = ANM2::GetLayer(sprite,(byte *)"Items"); selfRef = self; sprite = (ANM2 *)((int)self + 0x52c); filePath._size = 0; layer->_visible = 1; filePath._capacity = 0xf; filePath._buf[0] = '\0'; filePath._buf[1] = '\0'; filePath._buf[2] = '\0'; filePath._buf[3] = '\0'; filePath._buf._0_4_ = std::_Allocate(0x20); filePath._size = 0x1b; filePath._capacity = 0x1f; builtin_strncpy((char *)filePath._buf._0_4_,"gfx/ui/ui_charge_icons.anm2",0x1c); local_14 = 3; ANM2::Load(sprite,&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; pcVar3 = (char *)filePath._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(filePath._buf._0_4_ + -4); uVar4 = filePath._capacity + 0x24; if ((char *)0x1f < (char *)(filePath._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } pbVar5 = *(byte **)((int)selfRef + 0x560); if (pbVar5 != (byte *)0x0) { curAnim = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnim = *(byte **)pbVar5; } pcVar3 = "ChargeIcon"; do { bVar1 = *curAnim; isLess = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_008d30f0: uVar4 = -(uint)isLess | 1; goto LAB_008d30f5; } if (bVar1 == 0) break; bVar1 = curAnim[1]; isLess = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_008d30f0; curAnim = curAnim + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_008d30f5: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || (*(char *)((int)selfRef + 0x570) != '\0')))) goto LAB_008d3121; } bVar1 = ANM2::SetAnimation(sprite,(byte *)"ChargeIcon",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)selfRef + 0x55c)); *(undefined1 *)((int)selfRef + 0x570) = 1; } LAB_008d3121: selfRef = self; filePath._size = 0; filePath._capacity = 0xf; filePath._buf[0] = '\0'; filePath._buf[1] = '\0'; filePath._buf[2] = '\0'; filePath._buf[3] = '\0'; filePath._buf._0_4_ = std::_Allocate(0x20); filePath._size = 0x19; filePath._capacity = 0x1f; builtin_strncpy((char *)filePath._buf._0_4_,"gfx/ui/minimap_icons.anm2",0x1a); local_14 = 4; ANM2::Load((ANM2 *)((int)selfRef + 0x1f0),&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; pcVar3 = (char *)filePath._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(filePath._buf._0_4_ + -4); uVar4 = filePath._capacity + 0x24; if ((char *)0x1f < (char *)(filePath._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } filePath._size = 0; filePath._capacity = 0xf; filePath._buf._0_4_ = filePath._buf._0_4_ & 0xffffff00; cursorImage = Manager::LoadImage(imageRef,(byte *)"gfx/ui/MyStuff_SectionCursor.png"); local_14 = 5; KAGE::SmartPointer::operator_assign((void *)((int)selfRef + 0x640),cursorImage); local_14 = 6; if (imageRefCount != (int *)0x0) { isReleased = (**(code **)(*imageRefCount + 0xc))(); if ((isReleased != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(imageRef); } } ExceptionList = local_1c; return; } //@@ 008d3250 FUN_008d3250 void FUN_008d3250(void) { int iVar1; int iVar2; LayerState *pLVar3; int in_ECX; *(undefined1 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x30) = 0; *(undefined4 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x38) = 0; KAGE::SmartPointer::reset((void *)(in_ECX + 0x3c),(void *)0x0); *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; KAGE::SmartPointer::reset((void *)(in_ECX + 0x50),(void *)0x0); *(undefined4 *)(in_ECX + 0x58) = 0; *(undefined4 *)(in_ECX + 0x5c) = 0; *(undefined4 *)(in_ECX + 0x60) = 0; ANM2::Reset((ANM2 *)(in_ECX + 100)); *(undefined4 *)(in_ECX + 0x178) = 0xffffffff; *(undefined4 *)(in_ECX + 0x17c) = 0; *(undefined4 *)(in_ECX + 0x180) = 0; *(undefined4 *)(in_ECX + 0x648) = 0; *(undefined4 *)(in_ECX + 0x64c) = 0; if (*(char *)(in_ECX + 0x40d) != '\0') { pLVar3 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x304),(byte *)"Cursor"); pLVar3->_visible = 0; } *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(in_ECX + 0x18); *(undefined4 *)(in_ECX + 0x24) = 0; *(undefined4 *)(in_ECX + 0x28) = 0; *(undefined4 *)(in_ECX + 0x2c) = 0; iVar1 = *(int *)(in_ECX + 0x1e8); if (iVar1 != 0) { iVar2 = *(int *)(iVar1 + 0x120); std::map::_Erase_tree(iVar1 + 0x120,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)(iVar1 + 0x124) = 0; } return; } //@@ 008d3360 PauseScreen::update_items_menu /* WARNING: Removing unreachable block (ram,0x008d351e) */ /* DB: ? PauseScreen::Update state 3: local device (InputManager::FirstLocalDeviceID in netplay), DescriptionArrowUp/Down layers, PauseScreen::update_items_page, StatsPanel::set (0084e200) via 008d4040 PauseScreen::update_trinket_display void PauseScreen::update_items_menu(void) { char cVar1; int iVar2; int iVar3; uint uVar4; undefined4 uVar5; Entity_Player *pEVar6; uint uVar7; LayerState *pLVar8; PauseScreen *in_ECX; undefined4 in_stack_ffffff88; undefined4 local_c [2]; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { iVar2 = -1; } else { iVar2 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { iVar3 = -1; } else { iVar3 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } local_c[0] = 0x14; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,local_c,0,0); if (cVar1 == '\0') { local_c[0] = 0x15; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,local_c,0,0); if (cVar1 != '\0') goto LAB_008d3410; *(undefined4 *)&in_ECX->field_0x648 = 0; } else { LAB_008d3410: *(int *)&in_ECX->field_0x648 = *(int *)&in_ECX->field_0x648 + 1; } local_c[0] = 0x16; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,local_c,0,0); if (cVar1 == '\0') { local_c[0] = 0x17; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,local_c,0,0); if (cVar1 != '\0') goto LAB_008d3472; *(undefined4 *)&in_ECX->field_0x64c = 0; } else { LAB_008d3472: *(int *)&in_ECX->field_0x64c = *(int *)&in_ECX->field_0x64c + 1; } local_c[0] = 0xf; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar2,FUN_00a20940,local_c,0,0); if (cVar1 == '\0') { update_items_menu_selection(in_ECX); if (((*(int *)&in_ECX->field_0x1c - *(int *)&in_ECX->field_0x18 & 0xfffffffcU) != 0) && (*(int *)(*(int *)&in_ECX->field_0x18 + *(int *)&in_ECX->field_0x24 * 4) != 0)) { local_c[0] = 0x1c; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar2,FUN_00a209e0,local_c,0,0); if (cVar1 != '\0') { uVar4 = *(int *)&in_ECX->field_0x14 + 1U & 0x80000003; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffc) + 1; } *(uint *)&in_ECX->field_0x14 = uVar4; if ((uVar4 == 1) && (*(int *)&in_ECX->field_0x38 == 0)) { uVar4 = 2; *(undefined4 *)&in_ECX->field_0x14 = 2; } if (uVar4 == 2) { if (*(int *)&in_ECX->field_0x4c != 0) goto LAB_008d354d; *(undefined4 *)&in_ECX->field_0x14 = 3; } else if (uVar4 != 3) goto LAB_008d354d; uVar5 = *(undefined4 *)&in_ECX->field_0x14; if (*(int *)&in_ECX->field_0x60 == 0) { uVar5 = 0; } *(undefined4 *)&in_ECX->field_0x14 = uVar5; } LAB_008d354d: update_items_page(); if (*(int *)&in_ECX->field_0x38 == 0) { pLVar8 = ANM2::GetLayer((ANM2 *)&in_ECX->field_0x304,(byte *)"DescriptionArrowUp"); pLVar8->_visible = 0; pLVar8 = ANM2::GetLayer((ANM2 *)&in_ECX->field_0x304,(byte *)"DescriptionArrowDown"); pLVar8->_visible = 0; update_trinket_display(); update_pocket_item_display(in_ECX); return; } FUN_008d47c0(*(int *)&in_ECX->field_0x38,&in_ECX->field_0x44,&in_ECX->field_0x48, in_stack_ffffff88,0x42c80000,*(int *)&in_ECX->field_0x14 == 1); pEVar6 = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); uVar7 = FUN_0084e820(pEVar6,*(undefined4 *)(*(int *)&in_ECX->field_0x38 + 4)); iVar2 = *(int *)&in_ECX->field_0x44; pLVar8 = ANM2::GetLayer((ANM2 *)&in_ECX->field_0x304,(byte *)"DescriptionArrowUp"); pLVar8->_visible = 0 < iVar2; uVar4 = *(uint *)&in_ECX->field_0x48; pLVar8 = ANM2::GetLayer((ANM2 *)&in_ECX->field_0x304,(byte *)"DescriptionArrowDown"); pLVar8->_visible = uVar4 < uVar7; update_trinket_display(); update_pocket_item_display(in_ECX); return; } } FUN_008d3250(); in_ECX->field_0x10 = 0; return; } //@@ 008d3640 PauseScreen::render_items_page /* DB: ? ECX = PauseScreen+0x838 (PauseScreen::Render 009b7485 LEA ECX,[ESI+0x838]): ANM2 layer render ("AnimationData is NULL", "LayerId out of bounds"), "BackButton" glyph via Manager::render_controller_action_glyph, OnlinePlayerInfo::render_items */ void PauseScreen::render_items_page(void) { int iVar1; int iVar2; Vector pos; Vector scale; float *pfVar3; Entity_Player *pEVar4; int in_ECX; int iVar5; AnimationState *this; float fVar6; float fVar7; Vector local_18; if (*(int *)(in_ECX + 0x338) == 0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)(*(int *)(in_ECX + 0x334) + 0x80) < 1) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } iVar5 = *(int *)(in_ECX + 0x338); if (((((iVar5 == 0) || (*(int *)(*(int *)(in_ECX + 0x334) + 0x80) < 0)) || (iVar1 = *(int *)(iVar5 + 0x38), iVar1 < 0)) || ((*(int *)(iVar5 + 0x1c) <= iVar1 || (iVar2 = *(int *)(*(int *)(in_ECX + 0x33c) + iVar1 * 4), iVar2 < 0)))) || (iVar5 = iVar1 * 0x10 + *(int *)(iVar5 + 0x18), *(int *)(iVar5 + 8) <= iVar2)) { iVar5 = 0; } else { iVar5 = iVar2 * 0x6c + *(int *)(iVar5 + 4); } local_18.x = g_screenWidth * 0.5 - *(float *)(iVar5 + 8) * 0.5; local_18.y = g_screenHeight * 0.5 - *(float *)(iVar5 + 0xc) * 0.5; if (*(char *)(in_ECX + 0x40d) != '\0') { if (*(char *)(in_ECX + 0x374) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x334),&local_18,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x354); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x354),&local_18,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x334); } AnimationState::Render(this,&local_18,&g_vectorZero,&g_vectorZero); } if (*(int *)(in_ECX + 0x338) != 0) { pfVar3 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x334),(byte *)"BackButton"); if (pfVar3 != (float *)0x0) { fVar7 = local_18.x + *pfVar3; fVar6 = local_18.y + pfVar3[1]; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pEVar4 = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); iVar5 = pEVar4->_controllerIndex; } else { iVar5 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } pos.y = fVar6; pos.x = fVar7; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,iVar5,0xf,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos,scale); } } if (((*(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18) & 0xfffffffcU) != 0) && (*(int *)(*(int *)(in_ECX + 0x18) + *(int *)(in_ECX + 0x24) * 4) != 0)) { OnlinePlayerInfo::render_items(&local_18); FUN_008d5440(&local_18); FUN_008d5640(&local_18); FUN_008d57f0(&local_18); } return; } //@@ 008d3890 PauseScreen::update_items_page /* DB: ? pause menu items list: iterates the player's collectible history (player+0x1dec, 0x1c-byte entries) keeping HasCollectible ones, ItemsArrowUp/Down, LoadImage; called from the pause item-description page 008d3360 PauseScreen::update_items_menu <- PauseScreen::Update */ void PauseScreen::update_items_page(void) { int *piVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; Entity_Player *pEVar5; byte isOwned; char cVar6; uint uVar7; undefined4 *historyEntry; LayerState *arrowLayer; int *piVar8; int iVar9; byte *path; void *pvVar10; int *in_ECX; int iVar11; undefined4 *puVar12; undefined1 local_74 [8]; void *local_6c; void *shownItemsVecBegin; undefined4 *shownItemsVecEnd; undefined4 *shownItemsVecCapacity; undefined1 local_5c [4]; undefined1 loadedImage [4]; int *local_54; undefined4 actionMenuDown; undefined4 actionMenuUp; int *local_48; InfoDisplay *local_44; int *local_40; void *local_3c; undefined4 *shownItemsCapacity; uint local_34; void *shownItems; Entity_Player *ownerPlayer; int local_28; byte isArrowVisible; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; InfoDisplay *deviceId; Manager *manager; puStack_20 = loadedImage + 0x54; local_14 = 0xffffffff; puStack_18 = &LAB_00b05d65; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(loadedImage + 0x48); ExceptionList = &local_1c; local_48 = in_ECX; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { local_44 = (InfoDisplay *)0xffffffff; puStack_20 = loadedImage + 0x54; } else { local_44 = (InfoDisplay *)InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if ((uint)(in_ECX[7] - in_ECX[6]) < 4) { ownerPlayer = (Entity_Player *)0x0; } else { ownerPlayer = *(Entity_Player **)(in_ECX[6] + in_ECX[9] * 4); } puVar12 = (undefined4 *)0x0; shownItems = (void *)0x0; shownItemsVecBegin = (void *)0x0; shownItemsVecEnd = (undefined4 *)0x0; shownItemsCapacity = (undefined4 *)0x0; shownItemsVecCapacity = (undefined4 *)0x0; local_14 = 0; local_34 = 0; local_3c = (ownerPlayer->_history)._historyItems._end; pvVar10 = (ownerPlayer->_history)._historyItems._begin; iVar9 = (int)local_3c - (int)pvVar10 >> 0x1f; local_40 = pvVar10; if (((int)local_3c - (int)pvVar10) / 0x1c + iVar9 != iVar9) { local_28 = 0; do { pEVar5 = ownerPlayer; if (*(char *)(local_28 + 4 + (int)pvVar10) == '\0') { isOwned = Entity_Player::HasCollectible(ownerPlayer,*(int *)(local_28 + 8 + (int)pvVar10),0) ; if (isOwned != 0) { historyEntry = (undefined4 *)((int)(pEVar5->_history)._historyItems._begin + local_28); if (puVar12 == shownItemsCapacity) { std::vector<28byte>::_Emplace_reallocate(puVar12,historyEntry); shownItemsCapacity = shownItemsVecCapacity; puVar12 = shownItemsVecEnd; } else { uVar2 = historyEntry[1]; uVar3 = historyEntry[2]; uVar4 = historyEntry[3]; *puVar12 = *historyEntry; puVar12[1] = uVar2; puVar12[2] = uVar3; puVar12[3] = uVar4; uVar2 = historyEntry[5]; puVar12[4] = historyEntry[4]; puVar12[5] = uVar2; puVar12[6] = historyEntry[6]; shownItemsVecEnd = puVar12 + 7; puVar12 = shownItemsVecEnd; } } } local_28 = local_28 + 0x1c; local_34 = local_34 + 1; local_3c = (pEVar5->_history)._historyItems._end; pvVar10 = (pEVar5->_history)._historyItems._begin; } while (local_34 < (uint)(((int)local_3c - (int)pvVar10) / 0x1c)); shownItems = shownItemsVecBegin; in_ECX = local_48; local_40 = pvVar10; } local_3c = (void *)((int)local_3c - (int)local_40); local_34 = 0; if ((int)local_3c / 0x1c + ((int)local_3c >> 0x1f) != (int)local_3c >> 0x1f) { local_28 = 0; piVar8 = local_40; shownItemsVecBegin = shownItems; do { pEVar5 = ownerPlayer; if (*(char *)(local_28 + 4 + (int)piVar8) == '\x01') { isOwned = Entity_Player::HasTrinket(ownerPlayer,*(uint *)(local_28 + 8 + (int)piVar8),0); if (isOwned != 0) { historyEntry = (undefined4 *)((int)(pEVar5->_history)._historyItems._begin + local_28); if (puVar12 == shownItemsCapacity) { std::vector<28byte>::_Emplace_reallocate(puVar12,historyEntry); shownItemsCapacity = shownItemsVecCapacity; puVar12 = shownItemsVecEnd; } else { uVar2 = historyEntry[1]; uVar3 = historyEntry[2]; uVar4 = historyEntry[3]; *puVar12 = *historyEntry; puVar12[1] = uVar2; puVar12[2] = uVar3; puVar12[3] = uVar4; uVar2 = historyEntry[5]; puVar12[4] = historyEntry[4]; puVar12[5] = uVar2; puVar12[6] = historyEntry[6]; shownItemsVecEnd = puVar12 + 7; puVar12 = shownItemsVecEnd; } } } local_28 = local_28 + 0x1c; local_34 = local_34 + 1; piVar8 = (ownerPlayer->_history)._historyItems._begin; } while (local_34 < (uint)(((int)(ownerPlayer->_history)._historyItems._end - (int)piVar8) / 0x1c)); shownItems = shownItemsVecBegin; in_ECX = local_48; } deviceId = local_44; piVar8 = (int *)in_ECX[0xd]; local_28 = ((int)puVar12 - (int)shownItems) / 0x1c; shownItemsVecBegin = shownItems; local_40 = piVar8; if (local_28 == 0) { in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; KAGE::SmartPointer::reset(in_ECX + 0xf,(void *)0x0); arrowLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 0xc1),(byte *)"ItemsArrowUp"); arrowLayer->_visible = 0; arrowLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 0xc1),(byte *)"ItemsArrowDown"); arrowLayer->_visible = 0; goto LAB_008d3fcb; } if (in_ECX[5] == 0) { iVar9 = in_ECX[0x192]; if ((iVar9 == 1) || ((0x1e < iVar9 && (iVar9 == (iVar9 / 0xf) * 0xf)))) { local_3c = (void *)0x14; cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(local_44,FUN_00a20940,&local_3c,0,0,uVar7); if (cVar6 == '\0') { local_34 = 0x15; cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(deviceId,FUN_00a20940,&local_34,0,0); if (cVar6 == '\0') goto LAB_008d3bc8; iVar9 = local_28 + -1; if (in_ECX[0xd] + 1 < local_28 + -1) { iVar9 = in_ECX[0xd] + 1; } } else { iVar9 = 0; if (0 < in_ECX[0xd] + -1) { iVar9 = in_ECX[0xd] + -1; } } in_ECX[0xd] = iVar9; } LAB_008d3bc8: deviceId = local_44; iVar9 = in_ECX[0x193]; if ((iVar9 == 1) || ((0x1e < iVar9 && (iVar9 == (iVar9 / 0xf) * 0xf)))) { actionMenuUp = 0x16; cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(local_44,FUN_00a20940,&actionMenuUp,0,0); if (cVar6 == '\0') { actionMenuDown = 0x17; cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (deviceId,FUN_00a20940,&actionMenuDown,0,0); if ((cVar6 != '\0') && (in_ECX[0xd] + *in_ECX <= local_28 + -1)) { in_ECX[0xd] = in_ECX[0xd] + *in_ECX; } } else if (*in_ECX <= in_ECX[0xd]) { iVar11 = in_ECX[0xd] - *in_ECX; iVar9 = 0; if (0 < iVar11) { iVar9 = iVar11; } in_ECX[0xd] = iVar9; } } piVar8 = (int *)in_ECX[0xd]; iVar9 = in_ECX[0xc]; if ((int)piVar8 < iVar9) { iVar11 = 0; if (0 < iVar9 + -6) { iVar11 = iVar9 + -6; } } else { if ((int)piVar8 < in_ECX[2] + iVar9) goto LAB_008d3caf; iVar11 = local_28 + -1; if (iVar9 + 6 < local_28 + -1) { iVar11 = iVar9 + 6; } } in_ECX[0xc] = iVar11; } LAB_008d3caf: piVar1 = (int *)in_ECX[0xe]; if (piVar1 == (int *)0x0) { LAB_008d3d91: piVar1 = *(int **)((int)shownItems + (int)piVar8 * 0x1c + 8); if (*(char *)((int)shownItems + (int)piVar8 * 0x1c + 4) == '\0') { local_44 = &g_manager->_infoDisplay; local_54 = piVar1; std::set::find_node(local_74,&local_54); if (((*(char *)((int)local_6c + 0xd) == '\0') && (*(int *)((int)local_6c + 0x10) <= (int)piVar1)) && (local_6c != (local_44->_collectibles)._head)) { puVar12 = (undefined4 *)((int)local_6c + 0x14); } else { puVar12 = &local_44->_defaultEntry; } in_ECX[0xe] = (int)puVar12; StatsPanel::set(ownerPlayer,0); uVar7 = *(uint *)(in_ECX[0xe] + 4); if (g_game == (Game *)0x0) { if ((int)uVar7 < 0) goto LAB_008d3f32; } else if ((int)uVar7 < 0) { if (((int)uVar7 < 0) && (pvVar10 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar7 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar10 >> 2)) { iVar9 = **(int **)((int)pvVar10 + ~uVar7 * 4); } else { iVar9 = 0; } goto LAB_008d3ede; } pvVar10 = (g_manager->_itemConfig)._collectibles._begin; if ((int)uVar7 < (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar10 >> 2) { iVar9 = *(int *)((int)pvVar10 + uVar7 * 4); goto LAB_008d3ede; } LAB_008d3f32: KAGE::SmartPointer::reset(in_ECX + 0xf,(void *)0x0); } else { local_44 = (InfoDisplay *)((uint)piVar1 & 0xffff7fff); std::set::find_node(local_5c,&local_44); if ((*(char *)((int)local_54 + 0xd) == '\0') && (local_54[4] <= (int)((uint)piVar1 & 0xffff7fff))) { piVar8 = local_54; } else { piVar8 = (g_manager->_infoDisplay)._trinkets._head; } if (piVar8 == (g_manager->_infoDisplay)._trinkets._head) { piVar8 = &(g_manager->_infoDisplay)._defaultEntry; } else { piVar8 = piVar8 + 5; } in_ECX[0xe] = (int)piVar8; StatsPanel::set(ownerPlayer,0); uVar7 = *(uint *)(in_ECX[0xe] + 4) & 0x7fff; pvVar10 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar10 >> 2 <= (int)uVar7) goto LAB_008d3f32; iVar9 = *(int *)((int)pvVar10 + uVar7 * 4); LAB_008d3ede: if (iVar9 == 0) goto LAB_008d3f32; path = (byte *)(iVar9 + 0x38); if (0xf < *(uint *)(iVar9 + 0x4c)) { path = *(byte **)path; } pvVar10 = Manager::LoadImage(loadedImage,path); local_14._0_1_ = 1; KAGE::SmartPointer::operator_assign(in_ECX + 0xf,pvVar10); local_14._0_1_ = 2; if (((local_54 != (int *)0x0) && (cVar6 = (**(code **)(*local_54 + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImage); } local_14 = (uint)local_14._1_3_ << 8; } in_ECX[0x11] = 0; iVar9 = in_ECX[0xe]; piVar8 = (int *)local_48[0xd]; local_48[0x12] = (*(int *)(iVar9 + 0x24) - *(int *)(iVar9 + 0x20)) / 0x68 + (*(int *)(iVar9 + 0x30) - *(int *)(iVar9 + 0x2c)) / 0x68; in_ECX = local_48; } else if (*piVar1 == 0) { if (piVar1[1] != *(int *)((int)shownItems + (int)piVar8 * 0x1c + 8)) goto LAB_008d3d91; } else if ((*piVar1 == 1) && (local_54 = piVar8, piVar1[1] != *(int *)((int)shownItems + (int)piVar8 * 0x1c + 8))) goto LAB_008d3d91; manager = g_manager; if (piVar8 != local_40) { local_48 = (int *)0x11a; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&manager->_sfxManager,(int)local_48,1.0,2,0,1.0,0.0); } isArrowVisible = 0 < in_ECX[0xc]; arrowLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 0xc1),(byte *)"ItemsArrowUp"); arrowLayer->_visible = isArrowVisible; isArrowVisible = (uint)in_ECX[2] < (uint)(local_28 - in_ECX[0xc]); arrowLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 0xc1),(byte *)"ItemsArrowDown"); arrowLayer->_visible = isArrowVisible; LAB_008d3fcb: if (shownItems != (void *)0x0) { uVar7 = (((int)shownItemsCapacity - (int)shownItems) / 0x1c) * 0x1c; pvVar10 = shownItems; if (0xfff < uVar7) { pvVar10 = *(void **)((int)shownItems + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)shownItems + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar7); } ExceptionList = local_1c; return; } //@@ 008d4040 PauseScreen::update_trinket_display /* DB: ? ECX=PauseScreen (caller PauseScreen::update_items_menu, mov ecx,edi): trinket slot +0x28 (<2) of player +0x16c0[slot], looks up InfoDisplay trinket entry into +0x4c, StatsPanel::set, ItemConfig _trinkets gfx via Manager::LoadImage */ void PauseScreen::update_trinket_display(void) { int iVar1; char cVar2; int iVar3; byte *path; void *pvVar4; uint uVar5; LayerState *pLVar6; int in_ECX; undefined4 *puVar7; uint uVar8; undefined4 in_stack_ffffffb8; undefined1 local_2c [8]; void *local_24; int local_20; undefined1 local_1c [4]; int *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05d9d; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *(int *)(in_ECX + 0x18); if ((uint)(*(int *)(in_ECX + 0x1c) - iVar3) < 4) { local_14 = 0; iVar3 = 0; } else { local_14 = *(int *)(iVar3 + *(int *)(in_ECX + 0x24) * 4); iVar3 = *(int *)(iVar3 + *(int *)(in_ECX + 0x24) * 4); } if ((*(uint *)(in_ECX + 0x28) < 2) && (uVar8 = *(uint *)(iVar3 + 0x16c0 + *(uint *)(in_ECX + 0x28) * 4), uVar8 != 0)) { local_20 = in_ECX; if ((*(int *)(in_ECX + 0x4c) == 0) || (uVar8 != *(uint *)(*(int *)(in_ECX + 0x4c) + 4))) { local_18 = (int *)(uVar8 & 0xffff7fff); std::set::find_node(local_2c,&local_18); iVar3 = local_14; if ((*(char *)((int)local_24 + 0xd) != '\0') || ((int)(uVar8 & 0xffff7fff) < *(int *)((int)local_24 + 0x10))) { local_24 = (g_manager->_infoDisplay)._trinkets._head; } if (local_24 == (g_manager->_infoDisplay)._trinkets._head) { puVar7 = &(g_manager->_infoDisplay)._defaultEntry; } else { puVar7 = (undefined4 *)((int)local_24 + 0x14); } *(undefined4 **)(in_ECX + 0x4c) = puVar7; in_stack_ffffffb8 = 0x8d412a; StatsPanel::set(local_14,uVar8 >> 0xf & 1); uVar8 = *(uint *)(*(int *)(in_ECX + 0x4c) + 4) & 0x7fff; pvVar4 = (g_manager->_itemConfig)._trinkets._begin; if (((int)uVar8 < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar4 >> 2) && (iVar1 = *(int *)((int)pvVar4 + uVar8 * 4), iVar1 != 0)) { path = (byte *)(iVar1 + 0x38); if (0xf < *(uint *)(iVar1 + 0x4c)) { path = *(byte **)path; } in_stack_ffffffb8 = 0x8d416d; pvVar4 = Manager::LoadImage(local_1c,path); local_8 = 0; KAGE::SmartPointer::operator_assign((void *)(in_ECX + 0x50),pvVar4); local_8 = 1; if (((local_18 != (int *)0x0) && (cVar2 = (**(code **)(*local_18 + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_1c); } local_8 = 0xffffffff; } else { KAGE::SmartPointer::reset((void *)(in_ECX + 0x50),(void *)0x0); } } else { iVar3 = local_14; } if (*(int *)(in_ECX + 0x4c) != 0) { FUN_008d47c0(*(int *)(in_ECX + 0x4c),(int *)(in_ECX + 0x58),in_ECX + 0x5c,in_stack_ffffffb8, 0x41f00000,*(int *)(in_ECX + 0x14) == 2); uVar5 = FUN_0084e820(iVar3,*(undefined4 *)(iVar3 + 0x16c0)); iVar3 = *(int *)(in_ECX + 0x58); pLVar6 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x304),(byte *)"TrinketArrowUp"); pLVar6->_visible = 0 < iVar3; uVar8 = *(uint *)(local_20 + 0x5c); pLVar6 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x304),(byte *)"TrinketArrowDown"); pLVar6->_visible = uVar8 < uVar5; ExceptionList = local_10; return; } } else { *(undefined4 *)(in_ECX + 0x4c) = 0; KAGE::SmartPointer::reset((void *)(in_ECX + 0x50),(void *)0x0); } pLVar6 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x304),(byte *)"TrinketArrowUp"); pLVar6->_visible = 0; pLVar6 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x304),(byte *)"TrinketArrowDown"); pLVar6->_visible = 0; ExceptionList = local_10; return; } //@@ 008d42a0 PauseScreen::update_pocket_item_display /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? ECX=PauseScreen (same as caller PauseScreen::update_items_menu): player = vector +0x18[+0x24], pocket slot +0x2c clamped 0..3, reads _pocketSlots, ItemPool::GetPillEffect for pills, EntityConfig::GetEntity(5,0x46/0x12c,..) anm2 into ANM2 +0x64, gfx/ui/ui_cardspills.anm2 CardFronts, PocketArrowUp/Down layers prototype: db/protos.zhl */ void __thiscall PauseScreen::update_pocket_item_display(PauseScreen *entityConfig) { int pocketId; EntityConfig_Entity *pickupConfig; undefined4 cardDisplay; void *pvVar2; std_string *anm2PathChars; LayerState *arrowLayer; char *freePtr; Entity_Player *player; uint uVar3; uint uVar4; int iVar5; undefined4 in_stack_ffffff80; std_string cardAnm2Path; std_string anm2PathStr; uint local_24; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; EntityConfig *entityConfig; bool isAnyLayerVisible; Manager *manager; int pocketId; ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); local_14 = 0xffffffff; puStack_18 = &LAB_00b05ddd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&cardAnm2Path + 0x44U; ExceptionList = &local_1c; if ((uint)(*(int *)&entityConfig->field_0x1c - *(int *)&entityConfig->field_0x18) < 4) { player = (Entity_Player *)0x0; } else { player = *(Entity_Player **)(*(int *)&entityConfig->field_0x18 + *(int *)&entityConfig->field_0x24 * 4); } pocketId = *(int *)&entityConfig->field_0x2c; if (pocketId < 1) { pocketId = 0; } iVar5 = 3; if (pocketId < 3) { iVar5 = pocketId; } pocketId = player->_pocketSlots[iVar5 * 2 + 1]; if (pocketId == 0) { pocketId = player->_pocketSlots[iVar5 * 2]; joined_r0x008d4475: if (pocketId == 0) { *(undefined4 *)&entityConfig->field_0x60 = 0; ANM2::Reset((ANM2 *)&entityConfig->field_0x64); goto LAB_008d448a; } } else if (pocketId == 1) { pocketId = player->_pocketSlots[iVar5 * 2]; goto joined_r0x008d4475; } if (((*(int *)&entityConfig->field_0x60 == 0) || (*(int *)&entityConfig->field_0x178 != pocketId)) || (ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50), *(int *)(*(int *)&entityConfig->field_0x60 + 4) != player->_pocketSlots[iVar5 * 2])) { *(int *)&entityConfig->field_0x178 = pocketId; if (player->_pocketSlots[iVar5 * 2 + 1] == 0) { ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); pocketId = ItemPool::GetPillEffect(&g_game->_itemPool,player->_pocketSlots[iVar5 * 2],player); pocketId = FUN_0084f6e0(pocketId); *(int *)&entityConfig->field_0x60 = pocketId; uVar3 = player->_pocketSlots[iVar5 * 2] & 0x7ff; uVar3 = -(uint)(uVar3 != 0) & uVar3; uVar4 = 0xe; if (uVar3 < 0xe) { uVar4 = uVar3; } entityConfig = &g_manager->_entityConfig; *(bool *)(pocketId + 0x44) = *(char *)((int)(&g_game->_itemPool + 1) + uVar4 + 0x3c) == '\0'; in_stack_ffffff80 = 5; pickupConfig = EntityConfig::GetEntity(entityConfig,5,0x46,player->_pocketSlots[iVar5 * 2]); if (pickupConfig == (EntityConfig_Entity *)0x0) { ANM2::Reset((ANM2 *)&entityConfig->field_0x64); } else { anm2PathChars = &pickupConfig->anm2Path; if (0xf < (pickupConfig->anm2Path)._capacity) { anm2PathChars = *(std_string **)anm2PathChars->_buf; } std::string::string_from_cstr(anm2PathStr._buf,(byte *)anm2PathChars); local_14 = 0; ANM2::Load((ANM2 *)&entityConfig->field_0x64,&anm2PathStr,1); local_14 = 0xffffffff; if (0xf < anm2PathStr._capacity) { uVar4 = anm2PathStr._capacity + 1; freePtr = (char *)anm2PathStr._buf._0_4_; if (0xfff < uVar4) { freePtr = *(char **)(anm2PathStr._buf._0_4_ + -4); uVar4 = anm2PathStr._capacity + 0x24; if ((char *)0x1f < (char *)(anm2PathStr._buf._0_4_ + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar4); } in_stack_ffffff80 = 0x8d44e9; ANM2::Play((ANM2 *)&entityConfig->field_0x64,s_Idle,0); } } else { ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); if (player->_pocketSlots[iVar5 * 2 + 1] == 1) { ppvStack_20 = (void **)((int)&cardAnm2Path + 0x50); cardDisplay = FUN_0084f740(player->_pocketSlots[iVar5 * 2]); manager = g_manager; *(undefined4 *)&entityConfig->field_0x60 = cardDisplay; pocketId = player->_pocketSlots[iVar5 * 2]; if ((pocketId < 0) || ((int)(manager->_itemConfig)._cards._end - (int)(manager->_itemConfig)._cards._begin >> 2 <= pocketId)) { pocketId = 0; } else { pocketId = *(int *)((int)(manager->_itemConfig)._cards._begin + pocketId * 4); } in_stack_ffffff80 = 5; pickupConfig = EntityConfig::GetEntity(&manager->_entityConfig,5,300,*(int *)(pocketId + 0x54)) ; if (pickupConfig == (EntityConfig_Entity *)0x0) { ANM2::Reset((ANM2 *)&entityConfig->field_0x64); } else { anm2PathStr._size = 0; anm2PathStr._capacity = 0xf; anm2PathStr._buf[0] = '\0'; anm2PathStr._buf[1] = '\0'; anm2PathStr._buf[2] = '\0'; anm2PathStr._buf[3] = '\0'; anm2PathStr._buf._0_4_ = std::_Allocate(0x20); anm2PathStr._size = 0x19; anm2PathStr._capacity = 0x1f; builtin_strncpy((char *)anm2PathStr._buf._0_4_,"gfx/ui/ui_cardspills.anm2",0x1a); local_14 = 1; ANM2::Load((ANM2 *)&entityConfig->field_0x64,&anm2PathStr,1); local_14 = 0xffffffff; if (0xf < anm2PathStr._capacity) { uVar4 = anm2PathStr._capacity + 1; freePtr = (char *)anm2PathStr._buf._0_4_; if (0xfff < uVar4) { freePtr = *(char **)(anm2PathStr._buf._0_4_ + -4); uVar4 = anm2PathStr._capacity + 0x24; if ((char *)0x1f < (char *)(anm2PathStr._buf._0_4_ + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar4); } in_stack_ffffff80 = 0x8d4636; ANM2::SetFrame((ANM2 *)&entityConfig->field_0x64,(std_string *)"CardFronts", player->_pocketSlots[iVar5 * 2]); uVar4 = 0; isAnyLayerVisible = false; if (*(int *)&entityConfig->field_0xe4 != 0) { do { pvVar2 = AnimationState::GetLayerFrame((AnimationState *)&entityConfig->field_0x94,uVar4); if ((pvVar2 != (void *)0x0) && (*(char *)((int)pvVar2 + 0x2c) != '\0')) { isAnyLayerVisible = true; } uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)&entityConfig->field_0xe4); if (isAnyLayerVisible) goto LAB_008d471f; } anm2PathChars = &pickupConfig->anm2Path; if (0xf < (pickupConfig->anm2Path)._capacity) { anm2PathChars = *(std_string **)anm2PathChars->_buf; } std::string::string_from_cstr(cardAnm2Path._buf,(byte *)anm2PathChars); local_14 = 2; ANM2::Load((ANM2 *)&entityConfig->field_0x64,&cardAnm2Path,1); local_14 = 0xffffffff; if (0xf < cardAnm2Path._capacity) { uVar4 = cardAnm2Path._capacity + 1; pvVar2 = (void *)cardAnm2Path._buf._0_4_; if (0xfff < uVar4) { pvVar2 = *(void **)(cardAnm2Path._buf._0_4_ + -4); uVar4 = cardAnm2Path._capacity + 0x24; if (0x1f < (uint)(cardAnm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } cardAnm2Path._size = 0; cardAnm2Path._capacity = 0xf; cardAnm2Path._buf._0_4_ = cardAnm2Path._buf._0_4_ & 0xffffff00; in_stack_ffffff80 = 0x8d4712; ANM2::Play((ANM2 *)&entityConfig->field_0x64,&DAT_00b6b338,0); } } } } LAB_008d471f: if (*(int *)&entityConfig->field_0x60 != 0) { FUN_008d47c0(*(undefined4 *)&entityConfig->field_0x60,&entityConfig->field_0x17c,&entityConfig->field_0x180, in_stack_ffffff80,0x41f00000,*(int *)&entityConfig->field_0x14 == 3); uVar3 = FUN_0084e820(player,player->_pocketSlots[0]); pocketId = *(int *)&entityConfig->field_0x17c; arrowLayer = ANM2::GetLayer((ANM2 *)&entityConfig->field_0x304,(byte *)"PocketArrowUp"); arrowLayer->_visible = 0 < pocketId; uVar4 = *(uint *)&entityConfig->field_0x180; arrowLayer = ANM2::GetLayer((ANM2 *)&entityConfig->field_0x304,(byte *)"PocketArrowDown"); arrowLayer->_visible = uVar4 < uVar3; ExceptionList = local_1c; return; } LAB_008d448a: arrowLayer = ANM2::GetLayer((ANM2 *)&entityConfig->field_0x304,(byte *)"PocketArrowUp"); arrowLayer->_visible = 0; arrowLayer = ANM2::GetLayer((ANM2 *)&entityConfig->field_0x304,(byte *)"PocketArrowDown"); arrowLayer->_visible = 0; ExceptionList = local_1c; return; } //@@ 008d47c0 FUN_008d47c0 void FUN_008d47c0(undefined4 param_1,int *param_2,uint *param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { int *piVar1; char cVar2; uint uVar3; undefined4 uVar4; int iVar5; int in_ECX; undefined4 uVar6; undefined4 in_stack_ffffffd0; undefined4 in_stack_ffffffe4; piVar1 = param_2; if ((*(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18) & 0xfffffffcU) == 0) { uVar6 = 0; } else { uVar6 = *(undefined4 *)(*(int *)(in_ECX + 0x18) + *(int *)(in_ECX + 0x24) * 4); } uVar3 = menu_item_description_build(param_1,*param_2,in_stack_ffffffe4,param_5); *param_3 = uVar3; uVar4 = FUN_008d8460(param_1,param_3); uVar3 = FUN_0084e820(uVar6,uVar4); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { param_2 = (int *)0xffffffff; } else { param_2 = (int *)InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if (((char)param_6 != '\0') && ((iVar5 = *(int *)(in_ECX + 0x64c), iVar5 == 1 || ((0x1e < iVar5 && (iVar5 == (iVar5 / 0xf) * 0xf)))))) { param_6 = 0x17; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a20940,¶m_6,0,0); if (cVar2 == '\0') { param_6 = 0x16; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(param_2,FUN_00a20940,¶m_6,0,0); if ((cVar2 != '\0') && (0 < *piVar1)) { iVar5 = *piVar1 + -1; *piVar1 = iVar5; uVar3 = menu_item_description_build(param_1,iVar5); *param_3 = uVar3; } } else if (*param_3 < uVar3) { *piVar1 = *piVar1 + 1; uVar3 = menu_item_description_build(param_1,*piVar1,in_stack_ffffffd0,param_5); *param_3 = uVar3; return; } } return; } //@@ 008d4940 OnlinePlayerInfo::render_items /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? layers Items/Trinkets/Cursor, Entity_Player::HasCollectible/HasTrinket, ModManager::RenderCustomCollectionItem; chain Game::Render -> 008d2450 EmoteWheel::Render Rep+ struct after PauseScreen) -> 008d3640 PauseScreen::render_items_page -> this */ void OnlinePlayerInfo::render_items(float *param_1) { float fVar1; float fVar2; float fVar3; Entity_Player *pEVar4; byte bVar5; undefined4 extraout_EAX; LayerState *pLVar6; undefined *puVar7; int iVar8; int iVar9; Vector *position; ANM2 *in_ECX; int iVar10; void *pvVar11; uint size; float *other; ColorMod *pCVar12; Vector *color; char *pcVar13; char *blendMode; ANM2 *pAVar14; ANM2 *pAVar15; undefined1 auStack_da [2]; KColor local_cc; Vector local_b8; char local_b0 [20]; Vector local_9c; Vector local_94; void *local_8c; void *local_88; ColorMod *local_84; ColorMod *local_80; Vector local_7c; ANM2 *local_74; ColorMod *local_70; float local_6c; float local_68; Entity_Player *local_64; HUD *local_60; void *local_5c; void *local_58; ANM2 *local_54; ColorMod local_50; void *local_24; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; float local_14; puStack_20 = (undefined1 *)(&local_50)[1]._offset; local_14 = -NAN; puStack_18 = &DAT_00b05e1d; local_1c = ExceptionList; local_24 = (void *)(__security_cookie ^ (uint)((&local_50)[1]._colorize + 1)); ExceptionList = &local_1c; iVar8 = *(int *)(in_ECX->_animDefaultName)._buf; local_68 = g_vectorZero.x; local_6c = g_vectorZero.y; if ((uint)(*(int *)((in_ECX->_animDefaultName)._buf + 4) - iVar8) < 4) { local_64 = (Entity_Player *)0x0; } else { local_64 = *(Entity_Player **)(iVar8 + *(int *)((in_ECX->_animDefaultName)._buf + 0xc) * 4); } iVar8 = local_64->_playerType; local_60 = &g_game->_hud; blendMode = (char *)0x0; local_7c.x = *param_1 + 26.0; local_7c.y = param_1[1] + 22.0; color = (Vector *)0x3f800000; local_74 = in_ECX; KColor::SetFromARGB(&local_cc,0xff000000); Color::Color(extraout_EAX); HUD::render_player_type_icon(iVar8,&local_7c); pCVar12 = (ColorMod *)0x0; local_5c = (void *)0x0; local_88 = (void *)0x0; local_84 = (ColorMod *)0x0; local_70 = (ColorMod *)0x0; local_80 = (ColorMod *)0x0; local_14 = 0.0; local_58 = (void *)0x0; pvVar11 = (local_64->_history)._historyItems._begin; iVar10 = (int)(local_64->_history)._historyItems._end - (int)pvVar11; iVar8 = iVar10 >> 0x1f; if (iVar10 / 0x1c + iVar8 != iVar8) { local_54 = (void *)0x0; do { pEVar4 = local_64; if (*(char *)((int)local_54 + (int)pvVar11 + 4) == '\0') { pAVar14 = (ANM2 *)0x0; color = *(Vector **)((int)local_54 + (int)pvVar11 + 8); bVar5 = Entity_Player::HasCollectible(local_64,(int)color,0); blendMode = (char *)pAVar14; if (bVar5 != 0) { blendMode = (char *)((int)(pEVar4->_history)._historyItems._begin + (int)local_54); if (pCVar12 == local_70) { color = (Vector *)pCVar12; std::vector<28byte>::_Emplace_reallocate(); local_70 = local_80; pCVar12 = local_84; } else { fVar1 = *(float *)((((ANM2 *)blendMode)->_filename)._buf + 4); fVar2 = *(float *)((((ANM2 *)blendMode)->_filename)._buf + 8); fVar3 = *(float *)((((ANM2 *)blendMode)->_filename)._buf + 0xc); pCVar12->_tint[0] = *(float *)(((ANM2 *)blendMode)->_filename)._buf; pCVar12->_tint[1] = fVar1; pCVar12->_tint[2] = fVar2; pCVar12->_tint[3] = fVar3; fVar1 = (float)(((ANM2 *)blendMode)->_filename)._capacity; pCVar12->_colorize[0] = (float)(((ANM2 *)blendMode)->_filename)._size; pCVar12->_colorize[1] = fVar1; pCVar12->_colorize[2] = *(float *)(((ANM2 *)blendMode)->_animDefaultName)._buf; local_84 = (ColorMod *)(pCVar12->_colorize + 3); pCVar12 = local_84; blendMode = (char *)pAVar14; } } } local_54 = (ANM2 *)((int)local_54 + 0x1c); local_58 = (void *)((int)local_58 + 1); pvVar11 = (local_64->_history)._historyItems._begin; } while (local_58 < (void *)(((int)(local_64->_history)._historyItems._end - (int)pvVar11) / 0x1c)); local_5c = local_88; } local_58 = (void *)0x0; iVar10 = (int)(local_64->_history)._historyItems._end - (int)pvVar11; iVar8 = iVar10 >> 0x1f; if (iVar10 / 0x1c + iVar8 != iVar8) { local_54 = (void *)0x0; local_88 = local_5c; do { pEVar4 = local_64; if (*(char *)((int)local_54 + (int)pvVar11 + 4) == '\x01') { pAVar14 = (ANM2 *)0x0; color = *(Vector **)((int)local_54 + (int)pvVar11 + 8); bVar5 = Entity_Player::HasTrinket(local_64,(uint)color,0); blendMode = (char *)pAVar14; if (bVar5 != 0) { blendMode = (char *)((int)(pEVar4->_history)._historyItems._begin + (int)local_54); if (pCVar12 == local_70) { color = (Vector *)pCVar12; std::vector<28byte>::_Emplace_reallocate(); local_70 = local_80; pCVar12 = local_84; } else { fVar1 = *(float *)((((ANM2 *)blendMode)->_filename)._buf + 4); fVar2 = *(float *)((((ANM2 *)blendMode)->_filename)._buf + 8); fVar3 = *(float *)((((ANM2 *)blendMode)->_filename)._buf + 0xc); pCVar12->_tint[0] = *(float *)(((ANM2 *)blendMode)->_filename)._buf; pCVar12->_tint[1] = fVar1; pCVar12->_tint[2] = fVar2; pCVar12->_tint[3] = fVar3; fVar1 = (float)(((ANM2 *)blendMode)->_filename)._capacity; pCVar12->_colorize[0] = (float)(((ANM2 *)blendMode)->_filename)._size; pCVar12->_colorize[1] = fVar1; pCVar12->_colorize[2] = *(float *)(((ANM2 *)blendMode)->_animDefaultName)._buf; local_84 = (ColorMod *)(pCVar12->_colorize + 3); pCVar12 = local_84; blendMode = (char *)pAVar14; } } } local_54 = (ANM2 *)((int)local_54 + 0x1c); local_58 = (void *)((int)local_58 + 1); pvVar11 = (local_64->_history)._historyItems._begin; } while (local_58 < (void *)(((int)(local_64->_history)._historyItems._end - (int)pvVar11) / 0x1c)); local_5c = local_88; } pAVar14 = local_74; local_54 = (ANM2 *)0x0; local_58 = (local_74->_animState)._animation; local_8c = (void *)(((int)pCVar12 - (int)local_5c) / 0x1c); pvVar11 = local_5c; local_88 = local_5c; if (local_58 < local_8c) { do { if (*(int *)((pAVar14->_filename)._buf + 8) <= (int)local_54) break; local_60 = (HUD *)((int)local_58 * 7); pCVar12 = *(ColorMod **)((int)pvVar11 + (int)local_58 * 0x1c + 8); if (*(char *)((int)pvVar11 + (int)local_58 * 0x1c + 4) == '\0') { if (g_game != (Game *)0x0) { if (-1 < (int)pCVar12) goto LAB_008d4e0c; if (((int)pCVar12 < 0) && (pvVar11 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)pCVar12 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar11 >> 2)) { iVar8 = **(int **)((int)pvVar11 + ~(uint)pCVar12 * 4); } else { iVar8 = 0; } LAB_008d4e28: if (iVar8 != 0) { blendMode = (char *)0x0; color = (Vector *)pCVar12; bVar5 = Entity_Player::HasCollectible(local_64,(int)pCVar12,0); if (bVar5 != 0) goto LAB_008d4e43; } goto LAB_008d4c8b; } if (-1 < (int)pCVar12) { LAB_008d4e0c: pvVar11 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar11 >> 2 <= (int)pCVar12) goto LAB_008d4c8b; iVar8 = *(int *)((int)pvVar11 + (int)pCVar12 * 4); goto LAB_008d4e28; } LAB_008d4c8e: } else { pvVar11 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar11 >> 2 <= (int)((uint)pCVar12 & 0x7fff)) || (*(int *)((int)pvVar11 + ((uint)pCVar12 & 0x7fff) * 4) == 0)) { LAB_008d4c8b: pvVar11 = local_5c; goto LAB_008d4c8e; } blendMode = (char *)0x0; color = (Vector *)pCVar12; bVar5 = Entity_Player::HasTrinket(local_64,(uint)pCVar12,0); if (bVar5 == 0) goto LAB_008d4c8b; LAB_008d4e43: if (((int)pCVar12 < 0x2dd) || (*(char *)((int)local_5c + (int)local_60 * 4 + 4) != '\0')) { pAVar15 = (ANM2 *)(pAVar14[3]._championColor._tint + 2); if (*(char *)((int)local_5c + (int)local_60 * 4 + 4) == '\0') { pLVar6 = ANM2::GetLayer(pAVar15,(byte *)"Trinkets"); blendMode = "Items"; pLVar6->_visible = 0; color = (Vector *)0x8d517c; pLVar6 = ANM2::GetLayer((ANM2 *)(pAVar14[3]._championColor._tint + 2),(byte *)"Items"); pLVar6->_visible = 1; if ((int)pCVar12 < 1) { local_60 = (HUD *)0x2dd; } else { local_60 = (HUD *)((int)pCVar12[-1]._offset + 0xb); } if (pAVar14[3]._bitflags != 0) { if (*(int *)(pAVar14[3]._shadowLayerIndex + 0x80) < 7) { blendMode = "LayerId out of bounds\n"; color = (Vector *)0x10; KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); if (*(int *)(pAVar14[3]._shadowLayerIndex + 0x80) < 7) goto LAB_008d5216; } iVar8 = pAVar14[3]._bitflags; local_74 = *(ANM2 **)(iVar8 + 0x50); if (((iVar8 == 0) || ((int)local_74 < 0)) || (*(int *)(iVar8 + 0x1c) <= (int)local_74) ) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)pAVar14[4]._filename._buf + (int)local_74 * 4) = 0; color = (Vector *)0x8d5216; blendMode = (char *)local_74; AnimationState::AdvanceLayerPosition ((AnimationState *)&pAVar14[3]._shadowLayerIndex,(int)local_74, (float)(int)local_60); } LAB_008d5216: local_7c.x = local_68 + 110.0 + *param_1; local_7c.y = local_6c + 29.0 + param_1[1]; if (*(char *)((int)pAVar14[4]._color._offset + 9) != '\0') { if (*(char *)&pAVar14[4]._animState._layerFrames == '\0') { iVar8 = pAVar14[3]._bitflags; if (iVar8 != 0) { pAVar15 = (ANM2 *)pAVar14[3]._shadowLayerIndex; if (6 < pAVar15->_layerCount) { iVar10 = *(int *)(iVar8 + 0x50); if (-1 < iVar10) { color = &g_vectorZero; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)(iVar8 + 0x18)), &local_7c,*(int *)(*(int *)pAVar14[4]._filename._buf + iVar10 * 4), &g_vectorZero,&g_vectorZero,pAVar15); blendMode = (char *)pAVar15; } } } iVar8 = *(int *)(pAVar14[4]._animDefaultName._buf + 4); if (((iVar8 != 0) && (pAVar15 = *(ANM2 **)pAVar14[4]._animDefaultName._buf, 6 < pAVar15->_layerCount) ) && (iVar10 = *(int *)(iVar8 + 0x50), -1 < iVar10)) { iVar9 = *(int *)(pAVar14[4]._animDefaultName._buf + 8); goto LAB_008d533e; } } else { iVar8 = *(int *)(pAVar14[4]._animDefaultName._buf + 4); if (iVar8 != 0) { pAVar15 = *(ANM2 **)pAVar14[4]._animDefaultName._buf; if (6 < pAVar15->_layerCount) { iVar10 = *(int *)(iVar8 + 0x50); if (-1 < iVar10) { color = &g_vectorZero; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)(iVar8 + 0x18)), &local_7c, *(int *)(*(int *)(pAVar14[4]._animDefaultName._buf + 8) + iVar10 * 4),&g_vectorZero,&g_vectorZero,pAVar15); blendMode = (char *)pAVar15; } } } iVar8 = pAVar14[3]._bitflags; if (((iVar8 != 0) && (pAVar15 = (ANM2 *)pAVar14[3]._shadowLayerIndex, 6 < pAVar15->_layerCount)) && (iVar10 = *(int *)(iVar8 + 0x50), -1 < iVar10)) { iVar9 = *(int *)pAVar14[4]._filename._buf; LAB_008d533e: iVar9 = *(int *)(iVar9 + iVar10 * 4); position = &local_7c; goto LAB_008d534e; } } } } else { pLVar6 = ANM2::GetLayer(pAVar15,(byte *)"Trinkets"); blendMode = "Items"; pLVar6->_visible = 1; color = (Vector *)0x8d4f5a; pLVar6 = ANM2::GetLayer((ANM2 *)(pAVar14[3]._championColor._tint + 2),(byte *)"Items"); pLVar6->_visible = 0; if ((int)pCVar12 < 1) { local_60 = (HUD *)0xbe; } else { local_60 = (HUD *)((int)pCVar12[-1]._offset + 0xb); } if (pAVar14[3]._bitflags != 0) { if (*(int *)(pAVar14[3]._shadowLayerIndex + 0x80) < 10) { blendMode = "LayerId out of bounds\n"; color = (Vector *)0x10; KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); if (*(int *)(pAVar14[3]._shadowLayerIndex + 0x80) < 10) goto LAB_008d4ff4; } iVar8 = pAVar14[3]._bitflags; local_74 = *(ANM2 **)(iVar8 + 0x5c); if (((iVar8 == 0) || ((int)local_74 < 0)) || (*(int *)(iVar8 + 0x1c) <= (int)local_74) ) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)pAVar14[4]._filename._buf + (int)local_74 * 4) = 0; color = (Vector *)0x8d4ff4; blendMode = (char *)local_74; AnimationState::AdvanceLayerPosition ((AnimationState *)&pAVar14[3]._shadowLayerIndex,(int)local_74, (float)(int)local_60); } LAB_008d4ff4: local_94.x = local_68 + 110.0 + *param_1; local_94.y = local_6c + 29.0 + param_1[1]; if (*(char *)((int)pAVar14[4]._color._offset + 9) != '\0') { if (*(char *)&pAVar14[4]._animState._layerFrames == '\0') { iVar8 = pAVar14[3]._bitflags; if (iVar8 != 0) { pAVar15 = (ANM2 *)pAVar14[3]._shadowLayerIndex; if (9 < pAVar15->_layerCount) { iVar10 = *(int *)(iVar8 + 0x5c); if (-1 < iVar10) { color = &g_vectorZero; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)(iVar8 + 0x18)), &local_94,*(int *)(*(int *)pAVar14[4]._filename._buf + iVar10 * 4), &g_vectorZero,&g_vectorZero,pAVar15); blendMode = (char *)pAVar15; } } } iVar8 = *(int *)(pAVar14[4]._animDefaultName._buf + 4); if (((iVar8 != 0) && (pAVar15 = *(ANM2 **)pAVar14[4]._animDefaultName._buf, 9 < pAVar15->_layerCount) ) && (iVar10 = *(int *)(iVar8 + 0x5c), -1 < iVar10)) { iVar9 = *(int *)(*(int *)(pAVar14[4]._animDefaultName._buf + 8) + iVar10 * 4); position = &local_94; LAB_008d534e: color = &g_vectorZero; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)(iVar8 + 0x18)),position, iVar9,&g_vectorZero,&g_vectorZero,pAVar15); blendMode = (char *)pAVar15; } } else { iVar8 = *(int *)(pAVar14[4]._animDefaultName._buf + 4); if (iVar8 != 0) { pAVar15 = *(ANM2 **)pAVar14[4]._animDefaultName._buf; if (9 < pAVar15->_layerCount) { iVar10 = *(int *)(iVar8 + 0x5c); if (-1 < iVar10) { color = &g_vectorZero; AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)(iVar8 + 0x18)), &local_94, *(int *)(*(int *)(pAVar14[4]._animDefaultName._buf + 8) + iVar10 * 4),&g_vectorZero,&g_vectorZero,pAVar15); blendMode = (char *)pAVar15; } } } iVar8 = pAVar14[3]._bitflags; if (iVar8 != 0) { pAVar15 = (ANM2 *)pAVar14[3]._shadowLayerIndex; if (9 < pAVar15->_layerCount) { iVar10 = *(int *)(iVar8 + 0x5c); if (-1 < iVar10) { iVar9 = *(int *)(*(int *)pAVar14[4]._filename._buf + iVar10 * 4); position = &local_94; goto LAB_008d534e; } } } } } } } else { local_b0[0x10] = '\a'; local_b0[0x11] = '\0'; local_b0[0x12] = '\0'; local_b0[0x13] = '\0'; if (((byte)g_graphicsManager_flags & 4) == 0) { local_b0[4] = '\x06'; local_b0[5] = '\0'; local_b0[6] = '\0'; local_b0[7] = '\0'; } else { local_b0[4] = '\x01'; local_b0[5] = '\0'; local_b0[6] = '\0'; local_b0[7] = '\0'; } local_b0[0] = '\0'; local_b0[1] = '\0'; local_b0[2] = '\0'; local_b0[3] = '\0'; local_b0[8] = '\a'; local_b0[9] = '\0'; local_b0[10] = '\0'; local_b0[0xb] = '\0'; local_b0[0xc] = '\x01'; local_b0[0xd] = '\0'; local_b0[0xe] = '\0'; local_b0[0xf] = '\0'; local_50._offset[0] = 0.0; local_50._tint[0] = 1.0; local_50._tint[1] = 1.0; local_50._tint[2] = 1.0; local_50._tint[3] = 1.0; local_50._offset[1] = 0.0; local_50._offset[2] = 0.0; local_50._colorize[0] = 0.0; local_50._colorize[1] = 0.0; local_50._colorize[2] = 0.0; local_50._colorize[3] = 0.0; local_b8.x = 1.0; local_b8.y = 1.0; local_9c.x = (local_68 - 36.0) + *param_1; local_9c.y = (local_6c - 15.0) + param_1[1]; blendMode = local_b0; color = (Vector *)&local_50; ModManager::RenderCustomCollectionItem (&g_manager->_modManager,(uint)pCVar12,&local_9c,&local_b8,(ColorMod *)color, blendMode); } if (local_58 == (pAVar14->_animState)._animData) { pLVar6 = ANM2::GetLayer((ANM2 *)(pAVar14[2]._championColor._tint + 2),(byte *)"Cursor"); pLVar6->_visible = 1; pLVar6 = ANM2::GetLayer((ANM2 *)(pAVar14[2]._championColor._tint + 2),(byte *)"Cursor"); if (pLVar6 == (LayerState *)0x0) { blendMode = "Cursor"; pcVar13 = "[warn] no layer named %s\n"; KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); color = (Vector *)pcVar13; } else { color = *(Vector **)pLVar6->_layerData; blendMode = (char *)local_54; ANM2::SetLayerFrame((ANM2 *)(pAVar14[2]._championColor._tint + 2),(int)color, (int)local_54); } } local_68 = local_68 + 20.0; local_6c = local_6c + 0.0; if ((float)*(int *)(pAVar14->_filename)._buf * 20.0 <= local_68) { local_6c = local_6c + 20.0; local_68 = 0.0; } local_54 = (ANM2 *)((local_54->_filename)._buf + 1); pvVar11 = local_5c; } local_58 = (void *)((int)local_58 + 1); } while (local_58 < local_8c); if (local_54 != (ANM2 *)0x0) goto LAB_008d4cb5; } blendMode = "Cursor"; color = (Vector *)0x8d4cb1; pLVar6 = ANM2::GetLayer((ANM2 *)(pAVar14[2]._championColor._tint + 2),(byte *)"Cursor"); pLVar6->_visible = 0; LAB_008d4cb5: if ((pAVar14->_filename)._capacity == 0) { puVar7 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar7 = g_currentShader; } other = pAVar14[5]._championColor._tint + 2; local_50._tint[0] = 1.0; local_50._tint[1] = 1.0; local_50._tint[2] = 1.0; local_50._tint[3] = 1.0; local_50._offset[0] = 0.0; local_50._offset[1] = 0.0; local_50._colorize[0] = 0.0; local_50._colorize[1] = 0.0; local_50._colorize[2] = 0.0; local_50._colorize[3] = 0.0; local_50._offset[2] = 0.0; g_currentShader = puVar7; KAGE::SmartPointer::operator_assign(auStack_da + -10,other); apply_sprite_shader_params(&local_50,1,color,blendMode); local_b0[0] = '\0'; local_b0[1] = '\0'; local_b0[2] = -0x80; local_b0[3] = '?'; local_b0[4] = '\0'; local_b0[5] = '\0'; local_b0[6] = -0x80; local_b0[7] = '?'; local_b0[8] = '\0'; local_b0[9] = '\0'; local_b0[10] = -0x80; local_b0[0xb] = '?'; local_b0[0xc] = '\0'; local_b0[0xd] = '\0'; local_b0[0xe] = -0x80; local_b0[0xf] = '?'; local_b0[0x10] = '\0'; local_b0[0x11] = '\0'; local_b0[0x12] = '\0'; local_b0[0x13] = '\0'; local_9c.x = *param_1 + 10.0; local_9c.y = param_1[1] + 8.0; (**(code **)(*(int *)*other + 0x20))(); } if (local_5c != (void *)0x0) { size = (((int)local_70 - (int)local_5c) / 0x1c) * 0x1c; pvVar11 = local_5c; if (0xfff < size) { pvVar11 = *(void **)((int)local_5c + -4); size = size + 0x23; if (0x1f < (uint)((int)local_5c + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,size); } ExceptionList = local_1c; return; } //@@ 008d5440 FUN_008d5440 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008d5440(float *param_1) { AnimationState *this; void **other; code *pcVar1; undefined *puVar2; ColorMod *color; Menu_Collection *in_ECX; float *pfVar3; int *piVar4; undefined1 auStackY_fc [128]; void *image; void *imageRefCount; KColor local_5c; void *local_48; void *local_44; Vector local_40; Color local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); local_44 = *(void **)((in_ECX->CollectionMenuSprite)._animDefaultName._buf + 0xc); if (local_44 != (void *)0x0) { this = (AnimationState *)(in_ECX[1].CollectionMenuSprite._color._colorize + 2); if (in_ECX[1].CollectionMenuSprite._color._colorize[3] == 0.0) { pfVar3 = (float *)0x0; } else { pfVar3 = AnimationState::GetNullFrame(this,(byte *)"CollectibleTitle"); local_44 = *(void **)((in_ECX->CollectionMenuSprite)._animDefaultName._buf + 0xc); } local_40.x = *pfVar3 + *param_1; local_40.y = pfVar3[1] + param_1[1]; KAGE::SmartPointer::operator_assign (auStackY_fc + 0x8c,&(in_ECX->CollectionMenuSprite)._animDefaultName._size); PauseScreen_MyStuff::render_entry(local_44,&local_40,0x69); local_44 = (in_ECX->CollectionMenuSprite)._animState._animData; local_48 = (in_ECX->CollectionMenuSprite)._animState._animation; if (in_ECX[1].CollectionMenuSprite._color._colorize[3] == 0.0) { pfVar3 = (float *)0x0; } else { pfVar3 = AnimationState::GetNullFrame(this,(byte *)"CollectibleDesc"); } local_40.x = *pfVar3 + *param_1; local_40.y = pfVar3[1] + param_1[1]; image = local_48; render_item_info_text (in_ECX,*(void **)((in_ECX->CollectionMenuSprite)._animDefaultName._buf + 0xc), &local_40,0x82,(uint)local_48,(uint)local_44); piVar4 = *(int **)((in_ECX->CollectionMenuSprite)._animDefaultName._buf + 0xc); if (*piVar4 == 0) { if (in_ECX[1].CollectionMenuSprite._color._colorize[3] == 0.0) { pfVar3 = (float *)0x0; } else { pfVar3 = AnimationState::GetNullFrame(this,(byte *)"CollectibleItemPools"); piVar4 = *(int **)((in_ECX->CollectionMenuSprite)._animDefaultName._buf + 0xc); } local_40.x = *param_1 + *pfVar3; local_40.y = pfVar3[1] + param_1[1]; image = (void *)piVar4[1]; Menu_Collection::render_item_pool_icons(in_ECX,(int)image,&local_40); } if (*(int *)(in_ECX->CollectionMenuSprite)._filename._buf == 1) { puVar2 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar2 = g_currentShader; } imageRefCount = (void *)0x8d5599; g_currentShader = puVar2; Color::Color(&local_38); other = &in_ECX[2].DeathScreenSprite._overlayAnimState._layerFrames; KAGE::SmartPointer::operator_assign(auStackY_fc + 0x8c,other); apply_sprite_shader_params(color,1,image,imageRefCount); pcVar1 = *(code **)(*(int *)*other + 0x20); KColor::SetFromARGB(&local_5c,0xffffffff); if (in_ECX[1].CollectionMenuSprite._color._colorize[3] == 0.0) { pfVar3 = (float *)0x0; } else { pfVar3 = AnimationState::GetNullFrame ((AnimationState *)(in_ECX[1].CollectionMenuSprite._color._colorize + 2), (byte *)"CollectibleTitle"); } local_40.x = *pfVar3 + *param_1 + 1.0; local_40.y = pfVar3[1] + param_1[1] + 1.0; (*pcVar1)(); } } return; } //@@ 008d5640 FUN_008d5640 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008d5640(float *param_1) { undefined4 uVar1; uint lineEnd; code *pcVar2; undefined *puVar3; ColorMod *color; void *in_ECX; float *pfVar4; undefined1 auStackY_fc [128]; void *image; void *imageRefCount; KColor local_58; void *local_44; Vector local_40; Color local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (*(int *)((int)in_ECX + 0x4c) != 0) { Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); if (*(int *)((int)in_ECX + 0x338) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame ((AnimationState *)((int)in_ECX + 0x334),(byte *)"TrinketTitle"); } uVar1 = *(undefined4 *)((int)in_ECX + 0x4c); local_40.x = *param_1 + *pfVar4; local_40.y = pfVar4[1] + param_1[1]; KAGE::SmartPointer::operator_assign(auStackY_fc + 0x8c,(void *)((int)in_ECX + 0x50)); PauseScreen_MyStuff::render_entry(uVar1,&local_40,0x69); local_44 = *(void **)((int)in_ECX + 0x58); lineEnd = *(uint *)((int)in_ECX + 0x5c); if (*(int *)((int)in_ECX + 0x338) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame ((AnimationState *)((int)in_ECX + 0x334),(byte *)"TrinketDesc"); } local_40.x = *param_1 + *pfVar4; local_40.y = pfVar4[1] + param_1[1]; image = local_44; render_item_info_text (in_ECX,*(void **)((int)in_ECX + 0x4c),&local_40,0x78,(uint)local_44,lineEnd); if (*(int *)((int)in_ECX + 0x14) == 2) { puVar3 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar3 = g_currentShader; } imageRefCount = (void *)0x8d574e; g_currentShader = puVar3; Color::Color(&local_38); KAGE::SmartPointer::operator_assign(auStackY_fc + 0x8c,(undefined4 *)((int)in_ECX + 0x640)); apply_sprite_shader_params(color,1,image,imageRefCount); pcVar2 = *(code **)(**(int **)((int)in_ECX + 0x640) + 0x20); KColor::SetFromARGB(&local_58,0xffffffff); if (*(int *)((int)in_ECX + 0x338) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame ((AnimationState *)((int)in_ECX + 0x334),(byte *)"TrinketTitle"); } local_40.x = *pfVar4 + *param_1 + 0.0; local_40.y = pfVar4[1] + param_1[1] + 3.0; (*pcVar2)(); } } return; } //@@ 008d57f0 FUN_008d57f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008d57f0(float *param_1) { code *pcVar1; float *pfVar2; undefined *puVar3; ColorMod *color; void *in_ECX; undefined1 auStackY_104 [128]; void *image; void *imageRefCount; KColor local_60; uint local_4c; Vector local_48; float local_40; void *local_3c; Color local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (*(int *)((int)in_ECX + 0x60) != 0) { Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); if (*(int *)((int)in_ECX + 0x338) == 0) { pfVar2 = (float *)0x0; } else { pfVar2 = AnimationState::GetNullFrame ((AnimationState *)((int)in_ECX + 0x334),(byte *)"PocketTitle"); } local_40 = *pfVar2 + *param_1; local_3c = (void *)(pfVar2[1] + param_1[1]); FUN_008d5da0(*(undefined4 *)((int)in_ECX + 0x60),(int)in_ECX + 100); local_4c = *(uint *)((int)in_ECX + 0x180); local_3c = *(void **)((int)in_ECX + 0x17c); if (*(int *)((int)in_ECX + 0x338) == 0) { pfVar2 = (float *)0x0; } else { pfVar2 = AnimationState::GetNullFrame ((AnimationState *)((int)in_ECX + 0x334),(byte *)"PocketDesc"); } local_48.x = *pfVar2 + *param_1; local_48.y = pfVar2[1] + param_1[1]; image = local_3c; render_item_info_text (in_ECX,*(void **)((int)in_ECX + 0x60),&local_48,0x78,(uint)local_3c,local_4c); if (*(int *)((int)in_ECX + 0x14) == 3) { puVar3 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar3 = g_currentShader; } imageRefCount = (void *)0x8d58f8; g_currentShader = puVar3; Color::Color(&local_38); KAGE::SmartPointer::operator_assign(auStackY_104 + 0x8c,(undefined4 *)((int)in_ECX + 0x640)); apply_sprite_shader_params(color,1,image,imageRefCount); pcVar1 = *(code **)(**(int **)((int)in_ECX + 0x640) + 0x20); KColor::SetFromARGB(&local_60,0xffffffff); if (*(int *)((int)in_ECX + 0x338) == 0) { pfVar2 = (float *)0x0; } else { pfVar2 = AnimationState::GetNullFrame ((AnimationState *)((int)in_ECX + 0x334),(byte *)"PocketTitle"); } local_48.x = *param_1 + *pfVar2 + 0.0; local_48.y = pfVar2[1] + param_1[1] + 3.0; (*pcVar1)(); } } return; } //@@ 008d5990 PauseScreen_MyStuff::render_entry /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? callers FUN_008d5440/FUN_008d5640 (from FUN_008d3640, pause screen items page); uses g_game->_pauseScreen._playerIdx player, ItemConfig::GetCollectible icon via ANM2::Render, '#ITEM_INFO_UNIDENTIFIED_PILL', rich_text_render */ void PauseScreen_MyStuff::render_entry (int *param_1,float *param_2,int param_3,int *param_4,int *param_5) { char isLastRef; Entity_Player *pEVar1; undefined *shader; ColorMod *color; byte *text; ItemConfig_Item *collectible; KColor *color_00; KColor *extraout_ECX; Vector *position; KColor *color_01; void *pvVar2; float scale; void *imageRefCount; int maxWidth; undefined1 auStack_10a [2]; undefined1 quad [112]; int *entry; float local_8c [3]; undefined4 uStack_80; float local_7c; undefined1 *puStack_78; float fStack_74; undefined1 *puStack_70; float local_6c; int myStuff; Vector local_64; float entryX; Vector drawPos; undefined1 local_50 [28]; undefined1 *puStack_34; undefined1 *puStack_30; undefined1 *puStack_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; code *renderFn; puStack_20 = local_50 + 0x4c; puStack_18 = &LAB_00b05e60; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; entry = param_1; local_14 = 0; pvVar2 = (void *)0x8d59f5; pEVar1 = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); entryX = *param_2; drawPos.y = param_2[1]; if (param_4 != (int *)0x0) { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_7c = 0.0; local_8c[0] = 0.0; puStack_70 = (undefined1 *) (float)((double)param_4[5] + __uint_to_double_fixup[-(param_4[5] >> 0x1f)]); local_6c = (float)CONCAT31(local_6c._1_3_,1); fStack_74 = (float)((double)param_4[4] + __uint_to_double_fixup[-(param_4[4] >> 0x1f)]); if ((*param_1 == 1) && (param_1[1] == 0x14)) { local_28 = (float)CONCAT31(local_28._1_3_,1); local_6c = local_28; local_50._8_4_ = 0.0; local_50._20_4_ = 0.0; local_50._12_4_ = 0.0; local_50._16_4_ = &DAT_42000000; local_50._24_4_ = 0.0; puStack_30 = &DAT_42000000; puStack_2c = &DAT_42000000; puStack_34 = &DAT_42000000; local_7c = (float)(3 - pEVar1->_monkeyPawCounter) * 32.0; local_8c[0] = local_7c + 0.0; fStack_74 = local_7c + 32.0; local_7c = local_7c + 0.0; puStack_70 = &DAT_42000000; } uStack_80 = 0; local_8c[1] = 0.0; imageRefCount = (void *)0x8d5b8d; g_currentShader = shader; local_8c[2] = fStack_74; puStack_78 = puStack_70; drawPos.x = entryX; Color::Color((Color *)local_50); KAGE::SmartPointer::operator_assign(auStack_10a + -10,¶m_4); apply_sprite_shader_params(color,1,pvVar2,imageRefCount); renderFn = *(code **)(*param_4 + 0x14); KColor::SetFromARGB((KColor *)(local_50 + 0x18),0xffffffff); local_64.x = (float)&DAT_42000000; local_64.y = (float)&DAT_42000000; render_quad_set_rect(quad,&drawPos,&local_64,color_00); (*renderFn)(local_8c); param_1 = entry; } entryX = entryX + 34.0; drawPos.y = drawPos.y + 7.0; pvVar2 = (void *)(myStuff + 0x184); drawPos.x = entryX; KColor::SetFromARGB((KColor *)(local_50 + 0x18),0xff362f2d); if ((char)param_1[0x11] == '\0') { text = (byte *)(param_1 + 2); if (0xf < (uint)param_1[7]) { text = *(byte **)text; } rich_text_render(pvVar2,&local_64,text,&drawPos,(KColor *)(local_50 + 0x18),0.625,-1); if (*param_1 == 0) { collectible = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_1[1]); if ((collectible != (ItemConfig_Item *)0x0) && (collectible->type == 3)) { drawPos.y = drawPos.y + 16.0; drawPos.x = ((float)((double)param_3 + __uint_to_double_fixup[-(param_3 >> 0x1f)]) - 4.0) + entryX; Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); item_info_update_charge_bar(); ANM2::Render((ANM2 *)(myStuff + 0x52c),&drawPos,&g_vectorZero,&g_vectorZero); } } } else { maxWidth = -1; scale = 0.625; if (*param_1 == 2) { position = &drawPos; color_01 = extraout_ECX; text = string_table_translate(&g_manager->_stringTable,(byte *)"#ITEM_INFO_UNIDENTIFIED_PILL") ; rich_text_render(pvVar2,&local_64,text,position,color_01,scale,maxWidth); } else { rich_text_render(pvVar2,&local_64,&DAT_00b6d12c,&drawPos,(KColor *)(local_50 + 0x18),0.625,-1) ; } } local_14 = 1; if (param_5 != (int *)0x0) { isLastRef = (**(code **)(*param_5 + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } ExceptionList = local_1c; return; } //@@ 008d5da0 FUN_008d5da0 void FUN_008d5da0(int *param_1,ANM2 *param_2,float *param_3) { byte *pbVar1; ItemConfig_Item *pIVar2; Entity_Player *pEVar3; int in_ECX; KColor *extraout_ECX; float fVar4; Vector *position; KColor *color; int maxWidth; KColor local_30; Vector local_1c; Vector local_14; Vector local_c; fVar4 = *param_3; local_c.y = param_3[1]; if (param_2->_loaded != 0) { local_14.x = fVar4 + 16.0; if (*param_1 == 2) { local_14.y = param_3[1] + 23.0; } else { local_14.y = param_3[1] + 17.0; } ANM2::Render(param_2,&local_14,&g_vectorZero,&g_vectorZero); } fVar4 = fVar4 + 34.0; local_14.y = local_c.y + 7.0; local_14.x = fVar4; local_c.y = local_14.y; KColor::SetFromARGB(&local_30,0xff362f2d); if ((char)param_1[0x11] != '\0') { maxWidth = -1; fVar4 = 0.625; if (*param_1 == 2) { position = &local_14; color = extraout_ECX; pbVar1 = string_table_translate (&g_manager->_stringTable,(byte *)"#ITEM_INFO_UNIDENTIFIED_PILL"); rich_text_render((void *)(in_ECX + 0x184),&local_c,pbVar1,position,color,fVar4,maxWidth); return; } rich_text_render((void *)(in_ECX + 0x184),&local_c,&DAT_00b6d12c,&local_14,&local_30,0.625,-1); return; } pbVar1 = (byte *)(param_1 + 2); if (0xf < (uint)param_1[7]) { pbVar1 = *(byte **)pbVar1; } rich_text_render((void *)(in_ECX + 0x184),&local_1c,pbVar1,&local_14,&local_30,0.625,-1); if (*param_1 == 0) { pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_1[1]); if ((pIVar2 != (ItemConfig_Item *)0x0) && (pIVar2->type == 3)) { local_14.x = fVar4 + 101.0; local_14.y = local_c.y + 16.0; pEVar3 = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); item_info_update_charge_bar(param_1[1],pEVar3); ANM2::Render((ANM2 *)(in_ECX + 0x52c),&local_14,&g_vectorZero,&g_vectorZero); } } return; } //@@ 008d5f70 render_item_info_text /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? shared by 008d5440 (CollectibleDesc/Title/ItemPools), 008d5640 (TrinketDesc), 008d57f0 (PocketDesc): string_table_translate + rich_text_render 009efdb0, Game::GetPlayer prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall render_item_info_text(void *this,void *text,Vector *position,int width,uint lineStart,uint lineEnd) { char cVar1; byte bVar2; uint uVar3; byte *pbVar4; int iVar5; byte *text_00; undefined4 *puVar6; byte *******pppppppbVar7; uint *text_01; void *pvVar8; int *piVar9; uint uVar10; int iVar11; Manager *pMVar12; float fVar13; KColor local_170; Vector local_15c; KColor local_154; uint local_140; uint local_13c; Vector local_138; Vector local_130; Vector local_128; Vector local_120; float local_118; uint local_114; void *local_110; float local_10c; uint *local_108; uint local_104; int *local_100; void *local_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined8 local_ec; void *local_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined8 local_d4; void *local_cc [4]; undefined4 local_bc; uint local_b8; void *local_b4 [4]; undefined4 local_a4; uint local_a0; void *local_9c [4]; undefined4 local_8c; uint local_88; byte *******local_84 [4]; undefined4 local_74; uint local_70; void *local_6c [4]; undefined4 local_5c; uint local_58; byte local_3f [24]; byte local_27 [3]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_27 + 0x23; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b05edc; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_27 + 0x17); ExceptionList = &local_1c; local_100 = text; local_110 = this; local_24 = uVar3; local_130.y = (float)Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); KColor::SetFromARGB(&local_154,0xff362f2d); KColor::SetFromARGB(&local_170,0xff1199b1); local_120.x = position->x; local_120.y = position->y; uVar10 = 0; local_114 = 0; local_118 = local_120.x; local_10c = local_120.y; if ((char)local_100[0x11] == '\0') { local_104 = 0; piVar9 = local_100; pMVar12 = g_manager; if ((int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2 != 0) { do { if (-1 < (int)local_104) { pvVar8 = (pMVar12->_itemConfig)._playerForms._begin; if ((int)local_104 < (int)(pMVar12->_itemConfig)._playerForms._end - (int)pvVar8 >> 2) { local_108 = *(uint **)((int)pvVar8 + local_104 * 4); if (local_108 != (uint *)0x0) { local_140 = local_108[2]; local_13c = local_108[3]; if (local_108[2] == 0 && local_108[3] == 0) { if (*local_108 == 0xf) { if (*piVar9 == 0) { if ((piVar9[1] == 0x23) || (piVar9[1] == 0x106)) goto LAB_008d6169; } else if ((*piVar9 == 1) && (piVar9[1] == 0x30)) { LAB_008d6169: if (lineStart <= uVar10) { if (*local_108 < 0x10) { iVar5 = ((int *)((int)local_130.y + 0x17dc))[*local_108]; } else { iVar5 = 0; } iVar11 = 3; if (iVar5 < 3) { iVar11 = iVar5; } pbVar4 = (byte *)FUN_00840510(); local_a4 = 0; local_a0 = 0xf; local_b4[0] = (void *)0x0; if (pbVar4 != local_3f) { std::string::assign((char *)local_b4,pbVar4,(int)local_3f - (int)pbVar4); pMVar12 = g_manager; } local_14 = 0; if (iVar11 < 0) { iVar5 = FUN_00840510(); *(undefined1 *)(iVar5 + -1) = 0x2d; pbVar4 = (byte *)(iVar5 + -1); } else { pbVar4 = (byte *)FUN_00840510(); } local_8c = 0; local_88 = 0xf; local_9c[0] = (void *)0x0; if (pbVar4 != local_27) { std::string::assign((char *)local_9c,pbVar4,(int)local_27 - (int)pbVar4); pMVar12 = g_manager; } text_01 = local_108 + 4; local_14._0_1_ = 1; if (0xf < local_108[9]) { text_01 = (uint *)*text_01; } text_00 = string_table_translate(&pMVar12->_stringTable,(byte *)text_01); local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)0x0; pbVar4 = text_00; do { bVar2 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar2 != 0); std::string::assign((char *)local_6c,text_00,(int)pbVar4 - (int)(text_00 + 1)) ; local_14._0_1_ = 2; puVar6 = std::string::append((char *)local_6c,&DAT_00b6db20,2); local_fc = (void *)*puVar6; uStack_f8 = puVar6[1]; uStack_f4 = puVar6[2]; uStack_f0 = puVar6[3]; local_ec = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 3; std::string::concat_move((char *)local_cc,(int)local_130.y,&local_fc,local_9c) ; local_14._0_1_ = 4; puVar6 = std::string::append((char *)local_cc,(byte *)&DAT_00b6db28,1); local_e4 = (void *)*puVar6; uStack_e0 = puVar6[1]; uStack_dc = puVar6[2]; uStack_d8 = puVar6[3]; local_d4 = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_14._0_1_ = 5; std::string::concat_move((char *)local_84,(int)local_130.y,&local_e4,local_b4) ; local_14._0_1_ = 7; if (0xf < local_d4._4_4_) { uVar10 = local_d4._4_4_ + 1; pvVar8 = local_e4; if (0xfff < uVar10) { pvVar8 = *(void **)((int)local_e4 + -4); uVar10 = local_d4._4_4_ + 0x24; if (0x1f < (uint)((int)local_e4 + (-4 - (int)pvVar8))) goto LAB_008d69bd; } operator_delete(pvVar8,uVar10); } local_14._0_1_ = 8; if (0xf < local_b8) { uVar10 = local_b8 + 1; pvVar8 = local_cc[0]; if (0xfff < uVar10) { pvVar8 = *(void **)((int)local_cc[0] + -4); uVar10 = local_b8 + 0x24; if (0x1f < (uint)((int)local_cc[0] + (-4 - (int)pvVar8))) goto LAB_008d69bd; } operator_delete(pvVar8,uVar10); } local_bc = 0; local_b8 = 0xf; local_cc[0] = (void *)((uint)local_cc[0] & 0xffffff00); local_14._0_1_ = 9; if (0xf < local_ec._4_4_) { uVar10 = local_ec._4_4_ + 1; pvVar8 = local_fc; if (0xfff < uVar10) { pvVar8 = *(void **)((int)local_fc + -4); uVar10 = local_ec._4_4_ + 0x24; if (0x1f < (uint)((int)local_fc + (-4 - (int)pvVar8))) goto LAB_008d69bd; } operator_delete(pvVar8,uVar10); } local_14._0_1_ = 10; if (0xf < local_58) { uVar10 = local_58 + 1; pvVar8 = local_6c[0]; if (0xfff < uVar10) { pvVar8 = *(void **)((int)local_6c[0] + -4); uVar10 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar8))) goto LAB_008d69bd; } operator_delete(pvVar8,uVar10); } local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); local_14._0_1_ = 0xb; if (0xf < local_88) { uVar10 = local_88 + 1; pvVar8 = local_9c[0]; if (0xfff < uVar10) { pvVar8 = *(void **)((int)local_9c[0] + -4); uVar10 = local_88 + 0x24; if (0x1f < (uint)((int)local_9c[0] + (-4 - (int)pvVar8))) goto LAB_008d69bd; } operator_delete(pvVar8,uVar10); } local_14._0_1_ = 0xc; if (0xf < local_a0) { uVar10 = local_a0 + 1; pvVar8 = local_b4[0]; if (0xfff < uVar10) { pvVar8 = *(void **)((int)local_b4[0] + -4); uVar10 = local_a0 + 0x24; if (0x1f < (uint)((int)local_b4[0] + (-4 - (int)pvVar8))) goto LAB_008d69bd; } operator_delete(pvVar8,uVar10); } pvVar8 = local_110; local_128.x = local_118 - 10.0; local_128.y = local_10c + 0.0; rich_text_render((void *)((int)local_110 + 0x184),&local_15c,&DAT_00b6db24, &local_128,&local_154,0.5,-1); pppppppbVar7 = (byte *******)local_84; if (0xf < local_70) { pppppppbVar7 = local_84[0]; } rich_text_render((void *)((int)pvVar8 + 0x184),&local_138,(byte *)pppppppbVar7 ,&local_120,&local_170,0.5,-1); local_120.y = (float)*(int *)((int)pvVar8 + 0xc) + local_138.y + local_10c; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_10c = local_120.y; if (0xf < local_70) { uVar10 = local_70 + 1; pppppppbVar7 = local_84[0]; if (0xfff < uVar10) { pppppppbVar7 = (byte *******)local_84[0][-1]; uVar10 = local_70 + 0x24; if ((byte *)0x1f < (byte *)((int)local_84[0] + (-4 - (int)pppppppbVar7))) { LAB_008d69bd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar7,uVar10); } local_74 = 0; local_70 = 0xf; local_84[0] = (byte *******)((uint)local_84[0] & 0xffffff00); uVar10 = local_114; pMVar12 = g_manager; } uVar10 = uVar10 + 1; local_114 = uVar10; if (lineEnd <= uVar10) { ExceptionList = local_1c; return; } goto LAB_008d6682; } } } else { if (*piVar9 == 0) { cVar1 = FUN_0072fe80(local_140,local_13c); } else { if (*piVar9 != 1) goto LAB_008d668e; cVar1 = FUN_0072fec0(local_140,local_13c,uVar3); } if (cVar1 != '\0') goto LAB_008d6169; LAB_008d6682: piVar9 = local_100; } } } } LAB_008d668e: local_104 = local_104 + 1; } while (local_104 < (uint)((int)(pMVar12->_itemConfig)._playerForms._end - (int)(pMVar12->_itemConfig)._playerForms._begin >> 2)); } piVar9 = local_100; local_108 = (uint *)0x0; local_114 = local_100[8]; iVar5 = (int)(local_100[9] - local_114) >> 0x1f; if ((int)(local_100[9] - local_114) / 0x68 + iVar5 != iVar5) { local_100 = (int *)0x0; fVar13 = local_10c; do { if (lineStart <= uVar10) { local_128.x = local_118 - 10.0; local_128.y = fVar13 + 0.0; rich_text_render((void *)((int)local_110 + 0x184),&local_15c,&DAT_00b6db24,&local_128, &local_154,0.5,-1); pbVar4 = (byte *)((int)local_100 + local_114); if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } rich_text_render((void *)((int)local_110 + 0x184),&local_138,pbVar4,&local_120,&local_154, 0.5,-1); fVar13 = (float)*(int *)((int)local_110 + 0xc) + local_138.y + local_10c; local_120.y = fVar13; local_10c = fVar13; } uVar10 = uVar10 + 1; if (lineEnd <= uVar10) { ExceptionList = local_1c; return; } local_100 = (int *)((int)local_100 + 0x68); local_108 = (uint *)((int)local_108 + 1); local_114 = piVar9[8]; } while (local_108 < (uint)((int)(piVar9[9] - local_114) / 0x68)); } iVar5 = piVar9[0xc] - piVar9[0xb]; local_100 = (int *)0x0; if (iVar5 / 0x68 + (iVar5 >> 0x1f) != iVar5 >> 0x1f) { local_108 = (uint *)0x0; do { uVar3 = FUN_008d8460(piVar9,iVar5); bVar2 = InfoDisplayItem::is_line_visible (piVar9,(int)local_100,(Entity_Player *)local_130.y,uVar3); if (bVar2 != 0) { if (lineStart <= uVar10) { local_128.x = local_118 - 10.0; local_128.y = local_10c + 0.0; rich_text_render((void *)((int)local_110 + 0x184),&local_15c,&DAT_00b6db24,&local_128, &local_154,0.5,-1); pbVar4 = (byte *)(piVar9[0xb] + (int)local_108); if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } rich_text_render((void *)((int)local_110 + 0x184),&local_138,pbVar4,&local_120, &local_154,0.5,width); local_120.y = (float)*(int *)((int)local_110 + 0xc) + local_138.y + local_10c; local_10c = local_120.y; } uVar10 = uVar10 + 1; if (lineEnd <= uVar10) { ExceptionList = local_1c; return; } } iVar5 = piVar9[0xc] - piVar9[0xb]; local_100 = (int *)((int)local_100 + 1); local_108 = (uint *)((int)local_108 + 0x68); } while (local_100 < (uint)(iVar5 / 0x68)); } } else { local_130.x = local_120.x - 10.0; local_130.y = local_120.y + 0.0; rich_text_render((void *)((int)this + 0x184),&local_138,&DAT_00b6db24,&local_130,&local_154,0.5, -1); rich_text_render((void *)((int)this + 0x184),&local_138,&DAT_00b6d12c,&local_120,&local_154,0.5, -1); } ExceptionList = local_1c; return; } //@@ 008d69d0 FUN_008d69d0 int FUN_008d69d0(int param_1) { int iVar1; uint uVar2; void *ptr; uint uVar3; int iVar4; bool bVar5; void *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b05f1d; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = 0; local_1c = (void *)0x0; local_18 = 0; local_14 = 0; local_8 = 0; ItemPool::GetItemPoolsForCollectible(&g_game->_itemPool,param_1,&local_1c); uVar2 = 0; uVar3 = local_18 - (int)local_1c >> 2; if (uVar3 != 0) { do { if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { iVar1 = *(int *)((int)local_1c + uVar2 * 4); if (((iVar1 != 0) && (((iVar1 != 0x10 && (iVar1 != 0x12)) && (iVar1 != 0x11)))) && (((iVar1 != 0x14 && (iVar1 != 0x13)) && (iVar1 != 0x16)))) { bVar5 = iVar1 == 0x15; goto LAB_008d6aa5; } LAB_008d6ad4: iVar4 = iVar4 + 1; } else { iVar1 = *(int *)((int)local_1c + uVar2 * 4); if (((iVar1 == 0) || (iVar1 == 1)) || ((iVar1 == 2 || ((((iVar1 == 4 || (iVar1 == 3)) || (iVar1 == 5)) || ((iVar1 == 6 || (iVar1 == 0xc))))))) ) goto LAB_008d6ad4; bVar5 = iVar1 == 0x1a; LAB_008d6aa5: if (((bVar5) || (iVar1 == 8)) || ((((iVar1 == 10 || (((iVar1 == 0xb || (iVar1 == 0xd)) || (iVar1 == 0xe)))) || (((iVar1 == 0x19 || (iVar1 == 0x1e)) || (iVar1 == 0x18)))) || (iVar1 == 0x17)))) goto LAB_008d6ad4; } uVar2 = uVar2 + 1; } while (uVar2 < uVar3); } if (local_1c != (void *)0x0) { uVar2 = local_14 - (int)local_1c & 0xfffffffc; ptr = local_1c; if (0xfff < uVar2) { ptr = *(void **)((int)local_1c + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_1c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } ExceptionList = local_10; return iVar4; } //@@ 008d6b30 Menu_Collection::render_item_pool_icons /* DB: ? once from the collection detail renderer 008d5440 (CollectibleTitle/CollectibleDesc/CollectibleItemPools): ItemPool::GetItemPoolsForCollectible then IconShop/IconTreasureRoom/IconBoss/IconDevilRoom/IconAngelRoom/IconPlanetarium... ItemPoolChests anims prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Menu_Collection::render_item_pool_icons(Menu_Collection *topAnimState,int collectibleId,Vector *position) { byte bVar1; int iVar2; Vector *pVVar3; byte *strCursor; uint cmpResult; char *iconAnimName; AnimationState *topAnimState; void *pools; void *ptr; byte *curAnimation; bool isLess; float fVar4; void *poolsBegin; int poolsEnd; int poolsCapacity; Vector iconPos; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05f4d; local_10 = ExceptionList; ExceptionList = &local_10; fVar4 = position->x; iconPos.y = position->y; iconPos.x = fVar4; iVar2 = FUN_008d69d0(collectibleId); if (1 < iVar2) { iconPos.x = fVar4 - ((float)iVar2 - 1.0) * 16.0 * 0.5; } poolsBegin = (void *)0x0; poolsEnd = 0; poolsCapacity = 0; local_8 = 0; ItemPool::GetItemPoolsForCollectible(&g_game->_itemPool,collectibleId,&poolsBegin); pVVar3 = (Vector *)(poolsEnd - (int)poolsBegin >> 2); position = (Vector *)0x0; pools = poolsBegin; if (pVVar3 == (Vector *)0x0) { LAB_008d7c66: if (pools != (void *)0x0) { cmpResult = poolsCapacity - (int)pools & 0xfffffffc; ptr = pools; if (0xfff < cmpResult) { ptr = *(void **)((int)pools + -4); cmpResult = cmpResult + 0x23; if (0x1f < (uint)((int)pools + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,cmpResult); } ExceptionList = local_10; return; } LAB_008d6c00: if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) { iVar2 = *(int *)((int)pools + (int)position * 4); if (iVar2 == 0) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d7371; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconTreasureRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7353; if (bVar1 == 0) goto LAB_008d734f; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7353; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7358; } if (iVar2 == 1) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconShop"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7448; if (bVar1 == 0) goto LAB_008d7444; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7448; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d744d; } goto LAB_008d7466; } if (iVar2 == 2) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBoss"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d74b0; if (bVar1 == 0) goto LAB_008d74ac; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d74b0; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d74b5; } goto LAB_008d74ce; } if (iVar2 == 4) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconAngelRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7520; if (bVar1 == 0) goto LAB_008d751c; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7520; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7525; } goto LAB_008d753e; } if (iVar2 == 3) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconDevilRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7588; if (bVar1 == 0) goto LAB_008d7584; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7588; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d758d; } goto LAB_008d75a6; } if (iVar2 == 5) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconSecretRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d75f4; if (bVar1 == 0) goto LAB_008d75f0; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d75f4; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d75f9; } goto LAB_008d7612; } if (iVar2 != 6) { if (iVar2 != 0xc) { if (iVar2 == 0x1a) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconPlanetarium"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) { LAB_008d6f00: cmpResult = -(uint)isLess | 1; goto LAB_008d6f05; } if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d6f00; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; LAB_008d6f05: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; } iconAnimName = "IconPlanetarium"; goto LAB_008d7378; } if (iVar2 != 8) { if (iVar2 != 9) { if (iVar2 != 0x1d) { if (iVar2 != 10) { if (iVar2 != 0xb) { if (iVar2 != 0xd) { if (iVar2 != 0xe) { if (iVar2 != 0x19) { if (iVar2 != 0x1e) { if (iVar2 != 0x18) { if (iVar2 != 0x17) goto LAB_008d7c59; curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset [2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconSlot"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7b90; if (bVar1 == 0) goto LAB_008d7b8c; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7b90; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7b95; } goto LAB_008d7ba6; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2] ; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconUltraSecretRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7b20; if (bVar1 == 0) goto LAB_008d7b1c; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7b20; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7b25; } goto LAB_008d7b3e; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7a80; if (bVar1 == 0) goto LAB_008d7a7c; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7a80; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7a85; } goto LAB_008d7a96; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d79e1; if (bVar1 == 0) goto LAB_008d79dd; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d79e1; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d79e6; } goto LAB_008d79f7; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7193; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7193; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d718f: cmpResult = 0; goto LAB_008d7198; } goto LAB_008d71b1; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d78f2; if (bVar1 == 0) goto LAB_008d78ee; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d78f2; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d78f7; } goto LAB_008d7908; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7858; if (bVar1 == 0) goto LAB_008d7854; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7858; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d785d; } goto LAB_008d786e; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d77c3; if (bVar1 == 0) goto LAB_008d77bf; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d77c3; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d77c8; } goto LAB_008d77d9; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "ItemPoolChests"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7038; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7038; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7034: cmpResult = 0; goto LAB_008d703d; } goto LAB_008d7056; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "ItemPoolChests"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d6fd0; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d6fd0; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d6fcc: cmpResult = 0; goto LAB_008d6fd5; } goto LAB_008d6fee; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "ItemPoolChests"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d6f68; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d6f68; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d6f64: cmpResult = 0; goto LAB_008d6f6d; } goto LAB_008d6f86; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d767e; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconCurseRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7660; if (bVar1 == 0) goto LAB_008d765c; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7660; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7665; } curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) { LAB_008d6e61: iconAnimName = "IconLibrary"; goto LAB_008d7378; } strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconLibrary"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) { LAB_008d6e43: cmpResult = -(uint)isLess | 1; goto LAB_008d6e48; } if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d6e43; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; LAB_008d6e48: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) goto LAB_008d6e61; goto LAB_008d7bea; } iVar2 = *(int *)((int)pools + (int)position * 4); if (iVar2 == 0) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconTreasureRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7353; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7353; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d734f: cmpResult = 0; goto LAB_008d7358; } goto LAB_008d7371; } if (iVar2 == 0x10) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconTreasureRoomGreed"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) { LAB_008d73e0: cmpResult = -(uint)isLess | 1; goto LAB_008d73e5; } if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d73e0; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; LAB_008d73e5: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; } iconAnimName = "IconTreasureRoomGreed"; goto LAB_008d7378; } if (iVar2 == 0x12) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconShop"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7448; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7448; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7444: cmpResult = 0; goto LAB_008d744d; } goto LAB_008d7466; } if (iVar2 == 0x11) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBoss"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d74b0; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d74b0; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d74ac: cmpResult = 0; goto LAB_008d74b5; } goto LAB_008d74ce; } if (iVar2 == 0x14) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconAngelRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7520; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7520; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d751c: cmpResult = 0; goto LAB_008d7525; } goto LAB_008d753e; } if (iVar2 == 0x13) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconDevilRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7588; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7588; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7584: cmpResult = 0; goto LAB_008d758d; } goto LAB_008d75a6; } if (iVar2 == 0x16) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconSecretRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d75f4; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d75f4; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d75f0: cmpResult = 0; goto LAB_008d75f9; } goto LAB_008d7612; } if (iVar2 == 0x15) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation != (byte *)0x0) { strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconCurseRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7660; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7660; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d765c: cmpResult = 0; goto LAB_008d7665; } goto LAB_008d767e; } if (iVar2 == 8) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d6f86; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "ItemPoolChests"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d6f68; if (bVar1 == 0) goto LAB_008d6f64; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d6f68; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d6f6d; } if (iVar2 == 9) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d6fee; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "ItemPoolChests"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d6fd0; if (bVar1 == 0) goto LAB_008d6fcc; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d6fd0; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d6fd5; } if (iVar2 == 0x1d) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d7056; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "ItemPoolChests"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7038; if (bVar1 == 0) goto LAB_008d7034; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7038; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d703d; } if (iVar2 == 10) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d77d9; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d77c3; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d77c3; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d77bf: cmpResult = 0; goto LAB_008d77c8; } if (iVar2 == 0xb) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d786e; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7858; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7858; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7854: cmpResult = 0; goto LAB_008d785d; } if (iVar2 == 0xd) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d7908; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d78f2; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d78f2; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d78ee: cmpResult = 0; goto LAB_008d78f7; } if (iVar2 == 0xe) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d71b1; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7193; if (bVar1 == 0) goto LAB_008d718f; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7193; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); cmpResult = 0; goto LAB_008d7198; } if (iVar2 == 0x19) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d79f7; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d79e1; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d79e1; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d79dd: cmpResult = 0; goto LAB_008d79e6; } if (iVar2 == 0x1e) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d7a96; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconBeggar"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7a80; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7a80; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7a7c: cmpResult = 0; goto LAB_008d7a85; } if (iVar2 == 0x18) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d7b3e; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconUltraSecretRoom"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7b20; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7b20; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7b1c: cmpResult = 0; goto LAB_008d7b25; } if (iVar2 == 0x17) { curAnimation = (byte *)(topAnimState->DeathScreenSprite)._championColor._offset[2]; if (curAnimation == (byte *)0x0) goto LAB_008d7ba6; strCursor = curAnimation; if (0xf < *(uint *)(curAnimation + 0x14)) { strCursor = *(byte **)curAnimation; } iconAnimName = "IconSlot"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*iconAnimName; if (bVar1 != *iconAnimName) goto LAB_008d7b90; if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)iconAnimName[1]; if (bVar1 != iconAnimName[1]) goto LAB_008d7b90; strCursor = strCursor + 2; iconAnimName = iconAnimName + 2; } while (bVar1 != 0); LAB_008d7b8c: cmpResult = 0; goto LAB_008d7b95; } goto LAB_008d7c59; LAB_008d7b90: cmpResult = -(uint)isLess | 1; LAB_008d7b95: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d7ba6: iconAnimName = "IconSlot"; goto LAB_008d7bad; } goto LAB_008d7bce; LAB_008d7b20: cmpResult = -(uint)isLess | 1; LAB_008d7b25: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d7b3e: iconAnimName = "IconUltraSecretRoom"; goto LAB_008d7378; LAB_008d7a80: cmpResult = -(uint)isLess | 1; LAB_008d7a85: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d7a96: iconAnimName = "IconBeggar"; goto LAB_008d7a9d; } goto LAB_008d7abe; LAB_008d79e1: cmpResult = -(uint)isLess | 1; LAB_008d79e6: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d79f7: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)"IconBeggar" ,1); if (bVar1 != 0) { AnimationState::Rewind ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)); *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } } if ((topAnimState->DeathScreenSprite)._championColor._offset[2] == 0.0) goto LAB_008d7bea; fVar4 = 4.0; goto LAB_008d7bdf; LAB_008d7193: cmpResult = -(uint)isLess | 1; LAB_008d7198: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d71b1: iconAnimName = "IconBeggar"; LAB_008d7bad: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)iconAnimName ,1); if (bVar1 != 0) { AnimationState::Rewind ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)); *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } } LAB_008d7bce: if ((topAnimState->DeathScreenSprite)._championColor._offset[2] == 0.0) goto LAB_008d7bea; fVar4 = 5.0; goto LAB_008d7bdf; LAB_008d78f2: cmpResult = -(uint)isLess | 1; LAB_008d78f7: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d7908: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)"IconBeggar" ,1); if (bVar1 != 0) { AnimationState::Rewind ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)); *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } } if ((topAnimState->DeathScreenSprite)._championColor._offset[2] == 0.0) goto LAB_008d7bea; fVar4 = 3.0; goto LAB_008d7bdf; LAB_008d7858: cmpResult = -(uint)isLess | 1; LAB_008d785d: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d786e: iconAnimName = "IconBeggar"; goto LAB_008d7875; } goto LAB_008d7896; LAB_008d77c3: cmpResult = -(uint)isLess | 1; LAB_008d77c8: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d77d9: iconAnimName = "IconBeggar"; goto LAB_008d77e0; } goto LAB_008d7801; LAB_008d7038: cmpResult = -(uint)isLess | 1; LAB_008d703d: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d7056: iconAnimName = "ItemPoolChests"; LAB_008d7875: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)iconAnimName ,1); if (bVar1 != 0) { AnimationState::Rewind ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)); *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } } LAB_008d7896: if ((topAnimState->DeathScreenSprite)._championColor._offset[2] == 0.0) goto LAB_008d7bea; fVar4 = 2.0; goto LAB_008d7bdf; LAB_008d6fd0: cmpResult = -(uint)isLess | 1; LAB_008d6fd5: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d6fee: iconAnimName = "ItemPoolChests"; LAB_008d7a9d: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)iconAnimName ,1); if (bVar1 != 0) { AnimationState::Rewind ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)); *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } } LAB_008d7abe: if ((topAnimState->DeathScreenSprite)._championColor._offset[2] == 0.0) goto LAB_008d7bea; fVar4 = 1.0; goto LAB_008d7bdf; LAB_008d6f68: cmpResult = -(uint)isLess | 1; LAB_008d6f6d: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d6f86: iconAnimName = "ItemPoolChests"; LAB_008d77e0: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)iconAnimName ,1); if (bVar1 != 0) { AnimationState::Rewind ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)); *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } } LAB_008d7801: if ((topAnimState->DeathScreenSprite)._championColor._offset[2] == 0.0) goto LAB_008d7bea; fVar4 = 0.0; LAB_008d7bdf: AnimationState::SetFrameFloat ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1),fVar4); goto LAB_008d7bea; LAB_008d7660: cmpResult = -(uint)isLess | 1; LAB_008d7665: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d767e: iconAnimName = "IconCurseRoom"; goto LAB_008d7378; LAB_008d75f4: cmpResult = -(uint)isLess | 1; LAB_008d75f9: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d7612: iconAnimName = "IconSecretRoom"; goto LAB_008d7378; LAB_008d7588: cmpResult = -(uint)isLess | 1; LAB_008d758d: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d75a6: iconAnimName = "IconDevilRoom"; goto LAB_008d7378; LAB_008d7520: cmpResult = -(uint)isLess | 1; LAB_008d7525: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d753e: iconAnimName = "IconAngelRoom"; goto LAB_008d7378; LAB_008d74b0: cmpResult = -(uint)isLess | 1; LAB_008d74b5: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d74ce: iconAnimName = "IconBoss"; goto LAB_008d7378; LAB_008d7448: cmpResult = -(uint)isLess | 1; LAB_008d744d: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d7466: iconAnimName = "IconShop"; goto LAB_008d7378; LAB_008d7353: cmpResult = -(uint)isLess | 1; LAB_008d7358: if ((cmpResult == 0) && ((curAnimation[0x34] == 0 || ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex != '\0')))) goto LAB_008d7bea; LAB_008d7371: iconAnimName = "IconTreasureRoom"; LAB_008d7378: bVar1 = ANM2::SetAnimation((ANM2 *)(topAnimState->DeathScreenSprite)._color._offset,(byte *)iconAnimName,1 ); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1)) ; *(undefined1 *)&(topAnimState->DeathScreenSprite)._shadowLayerIndex = 1; } LAB_008d7bea: if (*(char *)((int)&topAnimState[1].CollectionMenuSprite._nullLayerNames + 1) != '\0') { if ((char)topAnimState[1].HoldInputTimer == '\0') { AnimationState::Render ((AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1),&iconPos, &g_vectorZero,&g_vectorZero); topAnimState = (AnimationState *)&topAnimState->field_0x240; } else { AnimationState::Render ((AnimationState *)&topAnimState->field_0x240,&iconPos,&g_vectorZero,&g_vectorZero); topAnimState = (AnimationState *)((topAnimState->DeathScreenSprite)._championColor._offset + 1); } AnimationState::Render(topAnimState,&iconPos,&g_vectorZero,&g_vectorZero); } iconPos.x = iconPos.x + 16.0; pools = poolsBegin; LAB_008d7c59: position = (Vector *)((int)&position->x + 1); if (pVVar3 <= position) goto LAB_008d7c66; goto LAB_008d6c00; } //@@ 008d7cb0 menu_item_description_build /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? args (type,id) pair (0=collectible 35/262, 1=trinket 48 special cases), scans Manager+0x2a448 entry list, string_table_translate, strncpy 0x78; called from 008d47c0 (DescriptionArrowUp/Down item details panel) */ uint menu_item_description_build(int *param_1,uint param_2,undefined4 param_3,float param_4) { uint *puVar1; int iVar2; char cVar3; byte bVar4; uint uVar5; byte *pbVar6; Vector *pVVar7; int iVar8; byte *text; undefined4 *puVar9; byte *******pppppppbVar10; void *pvVar11; Manager *pMVar12; uint uVar13; uint *text_00; float fVar14; Vector local_124; Vector local_11c; Entity_Player *local_114; int local_110; int *local_10c; float local_108; uint local_104; uint local_100; void *local_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 uStack_f0; undefined8 local_ec; void *local_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined8 local_d4; void *local_cc [4]; undefined4 local_bc; uint local_b8; void *local_b4 [4]; undefined4 local_a4; uint local_a0; void *local_9c [4]; undefined4 local_8c; uint local_88; byte *******local_84 [4]; undefined4 local_74; uint local_70; void *local_6c [4]; undefined4 local_5c; uint local_58; byte local_3f [24]; byte local_27 [3]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_27 + 0x23; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b05fbc; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_27 + 0x17); ExceptionList = &local_1c; local_10c = param_1; local_24 = uVar5; local_114 = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); uVar13 = 0; fVar14 = 0.0; local_108 = 0.0; local_100 = 0; local_104 = 0; pMVar12 = g_manager; if ((int)(g_manager->_itemConfig)._playerForms._end - (int)(g_manager->_itemConfig)._playerForms._begin >> 2 != 0) { do { if (-1 < (int)local_104) { pvVar11 = (pMVar12->_itemConfig)._playerForms._begin; if ((int)local_104 < (int)(pMVar12->_itemConfig)._playerForms._end - (int)pvVar11 >> 2) { puVar1 = *(uint **)((int)pvVar11 + local_104 * 4); if (puVar1 != (uint *)0x0) { if (puVar1[2] == 0 && puVar1[3] == 0) { if (*puVar1 == 0xf) { if (*local_10c == 0) { if ((local_10c[1] == 0x23) || (local_10c[1] == 0x106)) goto LAB_008d7fb3; } else if ((*local_10c == 1) && (local_10c[1] == 0x30)) { LAB_008d7fb3: if (param_2 <= local_100) { pbVar6 = (byte *)FUN_00840510(); local_a4 = 0; local_a0 = 0xf; local_b4[0] = (void *)0x0; if (pbVar6 != local_3f) { std::string::assign((char *)local_b4,pbVar6,(int)local_3f - (int)pbVar6); pMVar12 = g_manager; } local_14 = 0; if (*puVar1 < 0x10) { iVar8 = local_114->_playerForms[*puVar1]; } else { iVar8 = 0; } if (iVar8 < 0) { iVar8 = FUN_00840510(); *(undefined1 *)(iVar8 + -1) = 0x2d; pbVar6 = (byte *)(iVar8 + -1); } else { pbVar6 = (byte *)FUN_00840510(); } local_8c = 0; local_88 = 0xf; local_9c[0] = (void *)0x0; if (pbVar6 != local_27) { std::string::assign((char *)local_9c,pbVar6,(int)local_27 - (int)pbVar6); pMVar12 = g_manager; } text_00 = puVar1 + 4; local_14._0_1_ = 1; if (0xf < puVar1[9]) { text_00 = (uint *)*text_00; } text = string_table_translate(&pMVar12->_stringTable,(byte *)text_00); local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)0x0; pbVar6 = text; do { bVar4 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar4 != 0); std::string::assign((char *)local_6c,text,(int)pbVar6 - (int)(text + 1)); local_14._0_1_ = 2; puVar9 = std::string::append((char *)local_6c,&DAT_00b6db20,2); local_fc = (void *)*puVar9; uStack_f8 = puVar9[1]; uStack_f4 = puVar9[2]; uStack_f0 = puVar9[3]; local_ec = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; local_14._0_1_ = 3; std::string::concat_move((char *)local_cc,(int)local_114,&local_fc,local_9c); local_14._0_1_ = 4; puVar9 = std::string::append((char *)local_cc,(byte *)&DAT_00b6db28,1); local_e4 = (void *)*puVar9; uStack_e0 = puVar9[1]; uStack_dc = puVar9[2]; uStack_d8 = puVar9[3]; local_d4 = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; local_14._0_1_ = 5; std::string::concat_move((char *)local_84,(int)local_114,&local_e4,local_b4); local_14._0_1_ = 7; if (0xf < local_d4._4_4_) { uVar13 = local_d4._4_4_ + 1; pvVar11 = local_e4; if (0xfff < uVar13) { pvVar11 = *(void **)((int)local_e4 + -4); uVar13 = local_d4._4_4_ + 0x24; if (0x1f < (uint)((int)local_e4 + (-4 - (int)pvVar11))) goto LAB_008d83f3; } operator_delete(pvVar11,uVar13); } local_14._0_1_ = 8; if (0xf < local_b8) { uVar13 = local_b8 + 1; pvVar11 = local_cc[0]; if (0xfff < uVar13) { pvVar11 = *(void **)((int)local_cc[0] + -4); uVar13 = local_b8 + 0x24; if (0x1f < (uint)((int)local_cc[0] + (-4 - (int)pvVar11))) goto LAB_008d83f3; } operator_delete(pvVar11,uVar13); } local_bc = 0; local_b8 = 0xf; local_cc[0] = (void *)((uint)local_cc[0] & 0xffffff00); local_14._0_1_ = 9; if (0xf < local_ec._4_4_) { uVar13 = local_ec._4_4_ + 1; pvVar11 = local_fc; if (0xfff < uVar13) { pvVar11 = *(void **)((int)local_fc + -4); uVar13 = local_ec._4_4_ + 0x24; if (0x1f < (uint)((int)local_fc + (-4 - (int)pvVar11))) goto LAB_008d83f3; } operator_delete(pvVar11,uVar13); } local_14._0_1_ = 10; if (0xf < local_58) { uVar13 = local_58 + 1; pvVar11 = local_6c[0]; if (0xfff < uVar13) { pvVar11 = *(void **)((int)local_6c[0] + -4); uVar13 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar11))) goto LAB_008d83f3; } operator_delete(pvVar11,uVar13); } local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); local_14._0_1_ = 0xb; if (0xf < local_88) { uVar13 = local_88 + 1; pvVar11 = local_9c[0]; if (0xfff < uVar13) { pvVar11 = *(void **)((int)local_9c[0] + -4); uVar13 = local_88 + 0x24; if (0x1f < (uint)((int)local_9c[0] + (-4 - (int)pvVar11))) goto LAB_008d83f3; } operator_delete(pvVar11,uVar13); } local_14._0_1_ = 0xc; if (0xf < local_a0) { uVar13 = local_a0 + 1; pvVar11 = local_b4[0]; if (0xfff < uVar13) { pvVar11 = *(void **)((int)local_b4[0] + -4); uVar13 = local_a0 + 0x24; if (0x1f < (uint)((int)local_b4[0] + (-4 - (int)pvVar11))) goto LAB_008d83f3; } operator_delete(pvVar11,uVar13); } iVar8 = local_110; pppppppbVar10 = (byte *******)local_84; if (0xf < local_70) { pppppppbVar10 = local_84[0]; } pVVar7 = Font::measure_rich_text ((Font *)(local_110 + 0x184),&local_11c,(byte *)pppppppbVar10 ,0x78,0.5); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_108 = local_108 + (float)*(int *)(iVar8 + 0xc) + pVVar7->y; if (0xf < local_70) { uVar13 = local_70 + 1; pppppppbVar10 = local_84[0]; if (0xfff < uVar13) { pppppppbVar10 = (byte *******)local_84[0][-1]; uVar13 = local_70 + 0x24; if ((byte *)0x1f < (byte *)((int)local_84[0] + (-4 - (int)pppppppbVar10))) { LAB_008d83f3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar10,uVar13); } local_74 = 0; local_70 = 0xf; local_84[0] = (byte *******)((uint)local_84[0] & 0xffffff00); pMVar12 = g_manager; fVar14 = local_108; } if (param_4 <= fVar14) { ExceptionList = local_1c; return local_100; } local_100 = local_100 + 1; } } } else { cVar3 = FUN_0072fe80(puVar1[2],puVar1[3],uVar5); fVar14 = local_108; if (cVar3 != '\0') goto LAB_008d7fb3; } } uVar13 = local_100; } } local_104 = local_104 + 1; } while (local_104 < (uint)((int)(pMVar12->_itemConfig)._playerForms._end - (int)(pMVar12->_itemConfig)._playerForms._begin >> 2)); } local_104 = 0; iVar8 = local_10c[8]; iVar2 = local_10c[9] - iVar8 >> 0x1f; if ((local_10c[9] - iVar8) / 0x68 + iVar2 != iVar2) { local_100 = 0; do { if (param_2 <= uVar13) { pbVar6 = (byte *)(local_100 + iVar8); if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pVVar7 = Font::measure_rich_text((Font *)(local_110 + 0x184),&local_11c,pbVar6,0x78,0.5); fVar14 = (float)*(int *)(local_110 + 0xc) + pVVar7->y + local_108; local_108 = fVar14; } if (param_4 <= fVar14) { ExceptionList = local_1c; return uVar13; } local_100 = local_100 + 0x68; local_104 = local_104 + 1; uVar13 = uVar13 + 1; iVar8 = local_10c[8]; } while (local_104 < (uint)((local_10c[9] - iVar8) / 0x68)); } uVar5 = 0; local_100 = local_10c[0xb]; iVar8 = (int)(local_10c[0xc] - local_100) >> 0x1f; if ((int)(local_10c[0xc] - local_100) / 0x68 + iVar8 != iVar8) { local_104 = 0; do { bVar4 = InfoDisplayItem::is_line_visible(local_10c,uVar5,local_114,local_10c[1]); if (bVar4 != 0) { if (param_2 <= uVar13) { pbVar6 = (byte *)(local_100 + local_104); if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pVVar7 = Font::measure_rich_text((Font *)(local_110 + 0x184),&local_124,pbVar6,0x78,0.5); local_108 = (float)*(int *)(local_110 + 0xc) + pVVar7->y + local_108; } if (param_4 <= local_108) { ExceptionList = local_1c; return uVar13; } uVar13 = uVar13 + 1; } uVar5 = uVar5 + 1; local_104 = local_104 + 0x68; local_100 = local_10c[0xb]; } while (uVar5 < (uint)((int)(local_10c[0xc] - local_100) / 0x68)); } ExceptionList = local_1c; return uVar13; } //@@ 008d8460 FUN_008d8460 int FUN_008d8460(int *param_1) { int iVar1; int in_ECX; int iVar2; int iVar3; iVar3 = *param_1; if (iVar3 != 1) { if ((iVar3 != 3) && (iVar3 != 2)) { return param_1[1]; } if ((*(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18) & 0xfffffffcU) == 0) { iVar3 = 0; } else { iVar3 = *(int *)(*(int *)(in_ECX + 0x18) + *(int *)(in_ECX + 0x24) * 4); } iVar2 = *(int *)(in_ECX + 0x2c); if (iVar2 < 1) { iVar2 = 0; } iVar1 = 3; if (iVar2 < 3) { iVar1 = iVar2; } return *(int *)(iVar3 + 0x17a0 + iVar1 * 8); } if ((*(int *)(in_ECX + 0x1c) - *(int *)(in_ECX + 0x18) & 0xfffffffcU) == 0) { iVar3 = 0; } else { iVar3 = *(int *)(*(int *)(in_ECX + 0x18) + *(int *)(in_ECX + 0x24) * 4); } if (*(uint *)(in_ECX + 0x28) < 2) { return *(int *)(iVar3 + 0x16c0 + *(uint *)(in_ECX + 0x28) * 4); } return 0; } //@@ 008d84f0 PauseScreen::update_items_menu_selection /* DB: ? ECX = PauseScreen; only caller PauseScreen::update_items_menu: rebuilds the player list (pause player, twin +0x1e68, +0x1d98, backup +0x1e6c) into +0x18, then on input action 0xb (KAGE input vtable +0x74) cycles the selected player (+0x24), active slot (+0x2c, players' +0x17a0) and pocket slot (+0x28, +0x16c0) prototype: db/protos.zhl */ void __thiscall PauseScreen::update_items_menu_selection(PauseScreen *this) { char isPressed; uint uVar1; int iVar2; int clampedActiveSlot; int *piVar3; int activeSlot; EntityPtr EVar4; uint uVar5; undefined1 *puVar6; EntityPtr *newPlayersEnd; size_t _Size; int *playersBegin; EntityPtr *playersEnd; EntityPtr *playersCapacity; int local_20; EntityPtr local_1c; void *listBegin; int *playersBuffer; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1e1d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; newPlayersEnd = (EntityPtr *)0x0; playersBuffer = (int *)0x0; playersBegin = (int *)0x0; playersEnd = (EntityPtr *)0x0; playersCapacity = (EntityPtr *)0x0; local_8 = 0; local_1c = (EntityPtr)Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); if (local_1c == (EntityPtr)0x0) { piVar3 = (int *)0x0; } else { std::vector::_Emplace_reallocate(0,&local_1c); EVar4 = local_1c; local_1c = *(EntityPtr *)((int)local_1c + 0x1e68); if (local_1c != (EntityPtr)0x0) { if (playersEnd == playersCapacity) { std::vector::_Emplace_reallocate(playersEnd,&local_1c); } else { *playersEnd = local_1c; playersEnd = playersEnd + 1; } } local_1c = *(EntityPtr *)((int)EVar4 + 0x1d98); if (local_1c != (EntityPtr)0x0) { if (playersEnd == playersCapacity) { std::vector::_Emplace_reallocate(playersEnd,&local_1c); } else { *playersEnd = local_1c; playersEnd = playersEnd + 1; } } local_1c = *(EntityPtr *)((int)EVar4 + 0x1e6c); if (local_1c != (EntityPtr)0x0) { if (playersEnd == playersCapacity) { std::vector::_Emplace_reallocate(playersEnd,&local_1c); playersBuffer = playersBegin; piVar3 = playersBegin; newPlayersEnd = playersEnd; goto LAB_008d85f0; } *playersEnd = local_1c; playersEnd = playersEnd + 1; } playersBuffer = playersBegin; piVar3 = playersBegin; newPlayersEnd = playersEnd; } LAB_008d85f0: listBegin = *(void **)&this->field_0x18; _Size = (int)newPlayersEnd - (int)piVar3; local_1c = (EntityPtr)((int)_Size >> 2); if (local_1c == (EntityPtr)(*(int *)&this->field_0x1c - (int)listBegin >> 2)) { EVar4 = (EntityPtr)0x0; if (local_1c != (EntityPtr)0x0) { local_20 = (int)listBegin - (int)playersBuffer; do { if (*piVar3 != *(int *)(local_20 + (int)piVar3)) goto LAB_008d878b; EVar4 = (EntityPtr)((int)EVar4 + 1); piVar3 = piVar3 + 1; } while ((uint)EVar4 < (uint)local_1c); } puVar6 = &this->field_0x18; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { iVar2 = -1; } else { iVar2 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if (*(int *)&this->field_0x1c - *(int *)puVar6 >> 2 == 0) goto LAB_008d8819; local_20 = 0xb; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar2,FUN_00a209e0,&local_20,0,0,uVar1); if (isPressed == '\0') goto LAB_008d8819; iVar2 = *(int *)&this->field_0x14; if (iVar2 == 0) { uVar1 = *(uint *)&this->field_0x24; uVar5 = (uVar1 + 1) % (uint)(*(int *)&this->field_0x1c - *(int *)puVar6 >> 2); *(uint *)&this->field_0x24 = uVar5; if (uVar1 == uVar5) goto LAB_008d8819; goto LAB_008d87cd; } if (iVar2 != 2) { if (iVar2 == 3) { local_1c = *(EntityPtr *)&this->field_0x2c; EVar4 = local_1c; do { EVar4 = (EntityPtr)((int)EVar4 + 1U & 3); *(EntityPtr *)&this->field_0x2c = EVar4; if ((*(int *)&this->field_0x1c - *(int *)puVar6 & 0xfffffffcU) == 0) { iVar2 = 0; } else { iVar2 = *(int *)(*(int *)puVar6 + *(int *)&this->field_0x24 * 4); } activeSlot = *(int *)&this->field_0x2c; if (activeSlot < 1) { activeSlot = 0; } clampedActiveSlot = 3; if (activeSlot < 3) { clampedActiveSlot = activeSlot; } } while ((*(int *)(iVar2 + 0x17a0 + clampedActiveSlot * 8) == 0) && (local_1c != EVar4)); if (local_1c != EVar4) { *(undefined4 *)&this->field_0x17c = 0; *(undefined4 *)&this->field_0x180 = 0; } } goto LAB_008d8819; } uVar1 = *(uint *)&this->field_0x28; uVar5 = uVar1; do { uVar5 = uVar5 - 1 & 1; *(uint *)&this->field_0x28 = uVar5; if ((*(int *)&this->field_0x1c - *(int *)puVar6 & 0xfffffffcU) == 0) { iVar2 = 0; } else { iVar2 = *(int *)(*(int *)puVar6 + *(int *)&this->field_0x24 * 4); } } while (((1 < *(uint *)&this->field_0x28) || (*(int *)(iVar2 + 0x16c0 + *(uint *)&this->field_0x28 * 4) == 0)) && (uVar1 != uVar5)); if (uVar1 == uVar5) goto LAB_008d8819; } else { LAB_008d878b: *(void **)&this->field_0x1c = listBegin; if ((int **)&this->field_0x18 != &playersBegin) { if ((uint)(*(int *)&this->field_0x20 - (int)listBegin >> 2) < (uint)local_1c) { std::vector::reserve_clear(local_1c); listBegin = *(void **)&this->field_0x18; } memmove(listBegin,playersBuffer,_Size); *(size_t *)&this->field_0x1c = (int)listBegin + _Size; } *(undefined4 *)&this->field_0x24 = 0; LAB_008d87cd: *(undefined4 *)&this->field_0x180 = 0; *(undefined4 *)&this->field_0x17c = 0; *(undefined4 *)&this->field_0x48 = 0; *(undefined4 *)&this->field_0x44 = 0; *(undefined4 *)&this->field_0x34 = 0; *(undefined4 *)&this->field_0x30 = 0; *(undefined4 *)&this->field_0x2c = 0; *(undefined4 *)&this->field_0x28 = 0; } *(undefined4 *)&this->field_0x58 = 0; *(undefined4 *)&this->field_0x5c = 0; LAB_008d8819: if (playersBuffer != (int *)0x0) { uVar1 = (int)playersCapacity - (int)playersBuffer & 0xfffffffc; piVar3 = playersBuffer; if (0xfff < uVar1) { piVar3 = (int *)playersBuffer[-1]; uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)playersBuffer + (-4 - (int)piVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar3,uVar1); } ExceptionList = local_10; return; } //@@ 008d8870 item_info_update_charge_bar /* DB: ? ECX = pause-screen item info widget (AnimationState at +0x55c, loaded flag +0x560): (collectible id, player): SetFrameFloat of the charge bar for active items (ItemConfig::GetCollectible type 3, chargeType 0/1/2), special cases 711 Flip for player types 29/38 (Tainted Lazarus) and 286/263/348/489/147 (Blank Card, Clear Rune, Placebo, D Infinity, Notched Axe); callers 008d5990/008d5da0 (item info builders with "#ITEM_INFO_UNIDENTIFIED_PILL") */ void item_info_update_charge_bar(int param_1,int param_2) { int iVar1; ItemConfig_Item *pIVar2; int in_ECX; if (param_1 == 0x2c7) { if ((*(int *)(param_2 + 0x13c0) == 0x1d) || (*(int *)(param_2 + 0x13c0) == 0x26)) goto LAB_008d8895; } else if ((((param_1 == 0x11e) || (param_1 == 0x107)) || (param_1 == 0x15c)) || ((param_1 == 0x1e9 || (param_1 == 0x93)))) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),8.0); return; } pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,param_1); if (pIVar2 == (ItemConfig_Item *)0x0) { return; } if (pIVar2->type != 3) { return; } if (pIVar2->chargeType != 0) { if (pIVar2->chargeType != 1) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),7.0); return; } if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),6.0); return; } iVar1 = pIVar2->maxCharges; if (iVar1 == 0xc) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),5.0); return; } if (iVar1 == 6) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),4.0); return; } if (iVar1 != 4) { if (iVar1 == 3) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),2.0); return; } if (iVar1 == 2) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),1.0); return; } if (iVar1 != 1) { if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),7.0); return; } if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),0.0); return; } LAB_008d8895: if (*(int *)(in_ECX + 0x560) == 0) { return; } AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x55c),3.0); return; } //@@ 008d8a90 FUN_008d8a90 void FUN_008d8a90(void) { ANM2 *this; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; this = (ANM2 *)(in_ECX + 0x14); ANM2::Reset(this); local_8 = 0; ANM2::Reset(this); AnimationState::~AnimationState((AnimationState *)(in_ECX + 100)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); std::string::_Tidy_deallocate((char *)this); ExceptionList = local_10; return; } //@@ 008d8b00 Menu_KeyConfig::Update /* DB: ECX=MenuManager+0xd284 in MenuManager::Update (zhl _menuKeyConfig 0xd244+0x40); "ActionId is out of range", input vtable polling prototype: db/protos.zhl */ void __thiscall Menu_KeyConfig::Update(Menu_KeyConfig *this) { char isActionTriggered; uint uVar1; int iVar2; float fVar3; int iVar4; void *historyEnd; int iVar5; int rebindDevice; int *rebindDeviceRef; Menu_KeyConfig *device; int *deviceRef; int local_24; int local_20; Menu_KeyConfig *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; MenuManager *menuManager; float *viewY; local_8 = 0xffffffff; puStack_c = &LAB_00b06005; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; g_manager->_isHotkeysEnabled = (char)this->State == '\0'; local_1c = this; if ((this->KeyConfigSprite)._loaded != 0) { AnimationState::Update(&(this->KeyConfigSprite)._animState); AnimationState::Update(&(this->KeyConfigSprite)._overlayAnimState); } iVar5 = g_menuControllerIndex; local_20 = g_menuControllerIndex; InputManager::get_device(&PTR_vftable_00c57b18,&device,g_menuControllerIndex); menuManager = g_menuManager; local_8 = 0; if (device == (Menu_KeyConfig *)0x0) { this->SelectedElement = 0; *(undefined1 *)&this->State = 0; g_menuControllerIndex = 0; g_manager->_isHotkeysEnabled = 1; historyEnd = (menuManager->_menuStateHistory)._end; if (1 < (uint)((int)historyEnd - (int)(menuManager->_menuStateHistory)._begin >> 2)) { historyEnd = (void *)((int)historyEnd + -4); (menuManager->_menuStateHistory)._end = historyEnd; } MenuManager::SetState(menuManager,*(int *)((int)historyEnd + -4),0); goto LAB_008d92f5; } iVar2 = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0,uVar1); if ((iVar2 != 0) && (((*(byte *)(iVar2 + 8) & 0x20) != 0 || (*(int *)(iVar2 + 900) == 3)))) { update_gamepad_layout(this); goto LAB_008d92f5; } if ((char)this->State == '\0') { local_18 = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_18,0); if (isActionTriggered == '\0') { local_18 = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_18,0,0); if (isActionTriggered == '\0') { local_24 = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_24,0,0); if (isActionTriggered == '\0') { local_14 = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_24 = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_24,0,0); if (isActionTriggered != '\0') goto LAB_008d8ed3; local_18 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_18,0,0); if (isActionTriggered == '\0') { local_1c = (Menu_KeyConfig *)&DAT_00000017; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_1c,0,0); if (isActionTriggered == '\0') { local_14 = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar5,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') goto LAB_008d9290; } this->SelectedColumn = 0; goto LAB_008d9290; } } this->SelectedColumn = 1; goto LAB_008d9290; } } iVar2 = this->SelectedElement; if (iVar2 == 0x13) { iVar2 = 0; LAB_008d8e49: this->SelectedElement = iVar2; menuManager = g_menuManager; if (iVar5 != 0) { if (iVar2 != 0x13) { if (iVar2 < 3) { g_menuManager->_viewPositionSet[0xc].y = -1890.0; menuManager->_state = 1; } else if (iVar2 < 0xb) { g_menuManager->_viewPositionSet[0xc].y = -1890.0 - ((float)iVar2 - 2.0) * 24.0 ; menuManager->_state = 1; } else { g_menuManager->_viewPositionSet[0xc].y = -2130.0; menuManager->_state = 1; } goto LAB_008d9290; } goto LAB_008d8f99; } goto LAB_008d8f1e; } if ((iVar5 == 0) || (iVar2 != 0xe)) { iVar2 = iVar2 + 1; goto LAB_008d8e49; } this->SelectedElement = 0x13; } else { LAB_008d8ed3: iVar2 = this->SelectedElement; if (iVar2 == 0) { iVar2 = 0x13; } else { if ((iVar5 != 0) && (iVar2 == 0x13)) { this->SelectedElement = 0xe; menuManager = g_menuManager; g_menuManager->_viewPositionSet[0xc].y = -2130.0; menuManager->_state = 1; goto LAB_008d9290; } iVar2 = iVar2 + -1; } this->SelectedElement = iVar2; menuManager = g_menuManager; if (iVar5 == 0) { LAB_008d8f1e: menuManager = g_menuManager; if (iVar2 < 3) { g_menuManager->_viewPositionSet[0xc].y = -1890.0; menuManager->_state = 1; } else if (iVar2 < 0xd) { g_menuManager->_viewPositionSet[0xc].y = -1890.0 - ((float)iVar2 - 2.0) * 19.0; menuManager->_state = 1; } else { g_menuManager->_viewPositionSet[0xc].y = -2118.0; menuManager->_state = 1; } goto LAB_008d9290; } if (iVar2 != 0x13) { viewY = &g_menuManager->_viewPositionSet[0xc].y; if (iVar2 < 3) { *viewY = -1890.0; menuManager->_state = 1; } else if (iVar2 < 0xb) { *viewY = -1890.0 - ((float)iVar2 - 2.0) * 24.0; menuManager->_state = 1; } else { *viewY = -2130.0; menuManager->_state = 1; } goto LAB_008d9290; } } LAB_008d8f99: menuManager = g_menuManager; g_menuManager->_viewPositionSet[0xc].y = -2130.0; menuManager->_state = 1; goto LAB_008d9290; } } iVar2 = 0; iVar5 = (uint)(iVar5 == 0) * 4 + 0xf; local_18 = iVar5; do { uVar1 = (&DAT_00b24010)[iVar2]; local_1c = device; fVar3 = device->PositionY; if ((uint)(*(int *)(device->KeyConfigSprite)._filename._buf - (int)fVar3 >> 4) <= uVar1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); fVar3 = local_1c->PositionY; iVar5 = local_18; } manager = g_manager; if ((*(int *)((int)fVar3 + uVar1 * 0x10) == -1) && (*(int *)((int)fVar3 + 4 + uVar1 * 0x10) == -1)) { local_1c = (Menu_KeyConfig *)0xbb; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&manager->_sfxManager,(int)local_1c,1.0,2,0,1.0,0.0); iVar5 = local_18; break; } iVar2 = iVar2 + 1; } while (iVar2 < iVar5); manager = g_manager; if (iVar2 == iVar5) { this->SelectedElement = 0; *(undefined1 *)&this->State = 0; g_menuControllerIndex = 0; manager->_isHotkeysEnabled = 1; FUN_0098aec0(); Manager::apply_device_key_config(local_20); } goto LAB_008d9290; } } if (this->SelectedElement == 0x13) { (**(code **)(device->State + 0x14))(); } else { *(undefined1 *)&this->State = 1; } } else { local_18 = (**(code **)(device->State + 0x3c))(0); iVar5 = g_menuControllerIndex; if ((local_18 != -1) && (local_18 != 0xf)) { *(undefined1 *)&this->State = 0; InputManager::get_device(&PTR_vftable_00c57b18,&rebindDevice,iVar5); iVar5 = local_18; local_8 = CONCAT31(local_8._1_3_,1); local_24 = 0x13; if (g_menuControllerIndex != 0) { local_24 = 0xf; } iVar2 = 0; do { uVar1 = (&DAT_00b24010)[iVar2]; local_20 = rebindDevice; iVar4 = *(int *)(rebindDevice + 0x10); if ((uint)(*(int *)(rebindDevice + 0x14) - iVar4 >> 4) <= uVar1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar4 = *(int *)(local_20 + 0x10); } local_14 = *(int *)(iVar4 + 4 + uVar1 * 0x10); if (*(int *)(iVar4 + uVar1 * 0x10) == iVar5) { uVar1 = (&DAT_00b24010)[iVar2]; local_20 = rebindDevice; iVar4 = *(int *)(rebindDevice + 0x10); if ((uint)(*(int *)(rebindDevice + 0x14) - iVar4 >> 4) <= uVar1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar4 = *(int *)(local_20 + 0x10); } *(undefined4 *)(iVar4 + uVar1 * 0x10) = 0xffffffff; } if (local_14 == iVar5) { uVar1 = (&DAT_00b24010)[iVar2]; local_20 = rebindDevice; iVar4 = *(int *)(rebindDevice + 0x10); if ((uint)(*(int *)(rebindDevice + 0x14) - iVar4 >> 4) <= uVar1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar4 = *(int *)(local_20 + 0x10); } *(undefined4 *)(iVar4 + 4 + uVar1 * 0x10) = 0xffffffff; } this = local_1c; iVar2 = iVar2 + 1; } while (iVar2 < local_24); local_8._0_1_ = 2; if (((rebindDeviceRef != (int *)0x0) && (isActionTriggered = (**(code **)(*rebindDeviceRef + 0xc))(), isActionTriggered != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&rebindDevice); } local_8 = (uint)local_8._1_3_ << 8; FUN_00a24330(this->SelectedColumn,(&DAT_00b24010)[this->SelectedElement],local_18); } } LAB_008d9290: if (((this->KeyConfigSprite)._animState._animData != (void *)0x0) && ((6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))))) { historyEnd = (this->KeyConfigSprite)._animState._animData; iVar5 = *(int *)((int)historyEnd + 0x50); if ((historyEnd == (void *)0x0) || ((iVar5 < 0 || (*(int *)((int)historyEnd + 0x1c) <= iVar5)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->KeyConfigSprite)._animState._layerFrames + iVar5 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->KeyConfigSprite)._animState,iVar5,0.0); } LAB_008d92f5: local_8 = 3; if (((deviceRef != (int *)0x0) && (isActionTriggered = (**(code **)(*deviceRef + 0xc))(), isActionTriggered != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } ExceptionList = local_10; return; } //@@ 008d9340 Menu_KeyConfig::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? renders #INPUT_WALK_*/#INPUT_SHOOT_*/#INPUT_BOMB... via string_table_translate + Font::DrawString, casts InputDeviceGamepad, "ActionId is out of range"; called in the menu render list 0098a040 MenuManager::Render after the controller-select render prototype: db/protos.zhl */ void __thiscall Menu_KeyConfig::Render(Menu_KeyConfig *this) { ColorMod *pCVar1; Vector pos; Vector pos_00; Vector scale; Vector scale_00; byte bVar2; char isLastDeviceRef; uint uVar3; byte *pbVar4; undefined4 keyName; LayerState *cursorLayer; void *pvVar5; byte *expectedAnimChar; AnimationLayer *animLayer; int iVar6; ANM2 *cursorAnm2; bool bVar7; undefined4 local_194 [8]; undefined4 local_174; undefined4 uStack_170; undefined4 local_16c; undefined4 local_168 [8]; undefined4 local_148; undefined4 uStack_144; undefined4 local_140; KColor textColor; float local_128; float fStack_124; float fStack_120; float fStack_11c; int local_118; float local_114; float local_110; float local_10c; float local_108; int actionCount; float labelBaseX; float labelBaseY; undefined4 local_e8; undefined4 local_e4; undefined4 local_e0; undefined4 local_dc; undefined4 local_d8; undefined4 local_d4; undefined4 local_d0; Vector selectedCursorPos; int secondaryKey; int controllerIndex; int primaryKey; float keyTextX; int rowHeight; float rowOffsetY; int *device; int *deviceRefCount; int *local_a0; Vector cursorPos; Vector local_94; int rowOffset; int row; Font *font; float originY; float originX; char *actionLabels [4]; char *local_68; char *local_64; char *local_60; char *local_5c; char *local_58; char *local_54; char *local_50; char *local_4c; char *local_48; char *local_44; char *local_40; char *local_3c; char *local_38; char *local_34; char *local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; int layerIndex; puStack_20 = (undefined1 *)(actionLabels + 0x1d); local_14 = (char *)0xffffffff; puStack_18 = &LAB_00b06061; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(actionLabels + 0x1a); ExceptionList = &local_1c; local_24 = uVar3; InputManager::get_device(&PTR_vftable_00c57b18,&device,g_menuControllerIndex); local_14 = (char *)0x0; local_94.x = (g_menuManager->_ViewPosition).x + this->PositionX; local_94.y = (g_menuManager->_ViewPosition).y + this->PositionY; originY = local_94.y; originX = local_94.x; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->KeyConfigSprite)._animState,&local_94,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->KeyConfigSprite)._overlayAnimState,&local_94,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render (&(this->KeyConfigSprite)._overlayAnimState,&local_94,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->KeyConfigSprite)._animState,&local_94,&g_vectorZero,&g_vectorZero); } originX = local_94.x; originY = local_94.y; } local_94.x = originX; local_94.y = originY; if (device == (int *)0x0) goto LAB_008d9fde; layerIndex = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0,uVar3); if ((layerIndex != 0) && (((*(byte *)(layerIndex + 8) & 0x20) != 0 || (*(int *)(layerIndex + 900) == 3)))) { render_gamepad_layout(this); goto LAB_008d9fde; } local_94.y = (float)&this->KeyConfigSprite; if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008d94f9: ANM2::Play((ANM2 *)local_94.y,s_Idle,0); } else { pbVar4 = (this->KeyConfigSprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } expectedAnimChar = s_Idle; do { bVar2 = *pbVar4; bVar7 = bVar2 < *expectedAnimChar; if (bVar2 != *expectedAnimChar) { LAB_008d94f0: uVar3 = -(uint)bVar7 | 1; goto LAB_008d94f5; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar7 = bVar2 < expectedAnimChar[1]; if (bVar2 != expectedAnimChar[1]) goto LAB_008d94f0; pbVar4 = pbVar4 + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar2 != 0); uVar3 = 0; LAB_008d94f5: if (uVar3 != 0) goto LAB_008d94f9; } font = &g_manager->_font2_TeamMeatEx12; KColor::SetFromARGB(&textColor,0xff362f2d); rowHeight = 0x13; labelBaseX = originX + 80.0; if (g_menuControllerIndex != 0) { rowHeight = 0x18; } actionLabels[0] = "#INPUT_WALK_UP"; labelBaseY = originY + 58.0; actionLabels[1] = "#INPUT_WALK_DOWN"; actionLabels[2] = "#INPUT_WALK_LEFT"; actionLabels[3] = "#INPUT_WALK_RIGHT"; local_68 = "#INPUT_SHOOT_UP"; actionCount = (uint)(g_menuControllerIndex == 0) * 4 + 0xf; local_64 = "#INPUT_SHOOT_DOWN"; local_60 = "#INPUT_SHOOT_LEFT"; local_5c = "#INPUT_SHOOT_RIGHT"; local_58 = "#INPUT_BOMB"; local_54 = "#INPUT_ITEM"; local_50 = "#INPUT_PILL_CARD"; local_4c = "#INPUT_DROP"; local_48 = "#INPUT_MAP"; local_44 = "#INPUT_EMOTE"; local_40 = "#INPUT_DESCRIPTIONS"; local_3c = "#INPUT_FULLSCREEN"; local_38 = "#INPUT_RESTART"; local_34 = "#INPUT_MUTE"; local_30 = "#INPUT_PAUSE"; controllerIndex = g_menuControllerIndex; row = 0; rowOffset = 0x41; do { uVar3 = (&DAT_00b24010)[row]; local_a0 = device; layerIndex = device[4]; if ((uint)(device[5] - layerIndex >> 4) <= uVar3) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); layerIndex = local_a0[4]; } iVar6 = row; primaryKey = *(int *)(layerIndex + uVar3 * 0x10); secondaryKey = *(int *)(layerIndex + 4 + uVar3 * 0x10); if ((primaryKey == -1) && (secondaryKey == -1)) { local_128 = 0.8; fStack_124 = 0.2; fStack_120 = 0.2; fStack_11c = 1.0; local_118 = 0; } else { local_118 = textColor._unk; local_128 = textColor._red; fStack_124 = textColor._green; fStack_120 = textColor._blue; fStack_11c = textColor._alpha; } local_e8 = 0; local_e4 = 0xffff; local_e0 = 0; local_dc = 0x3f800000; local_d8 = 0xffffffff; local_d4 = 0; local_d0 = 0; local_14._0_1_ = 1; pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)actionLabels[row]); local_a0 = (int *)((float)(rowOffset + -0x41) + labelBaseY); Font::DrawString(pbVar4,&local_128,&local_e8); local_14 = (char *)((uint)local_14._1_3_ << 8); rowOffsetY = (float)rowOffset; if (controllerIndex == 0) { LAB_008d97fd: local_e8 = 0; local_e4 = 0xffff; local_e0 = 0; local_dc = 0x3f800000; local_d8 = 0xffffffff; local_d4 = 0; local_d0 = 0; local_14._0_1_ = 2; pbVar4 = (byte *)(**(code **)(*device + 0x10))(primaryKey); layerIndex = Font::get_string_width_n(font,pbVar4,-1); keyTextX = (originX + 400.0) - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); keyName = (**(code **)(*device + 0x10))(primaryKey); Font::DrawString(keyName,&local_128,&local_e8); local_14 = (char *)((uint)local_14._1_3_ << 8); } else { local_108 = rowOffsetY + originY; local_10c = originX + 384.0; local_d0 = 0; pos.y = local_108; pos.x = local_10c; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; bVar2 = Manager::render_controller_action_glyph (g_manager,controllerIndex,(&DAT_00b24010)[iVar6],0,0, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); if (bVar2 == 0) goto LAB_008d97fd; } if (controllerIndex == 0) { LAB_008d9977: local_118 = textColor._unk; local_128 = textColor._red; fStack_124 = textColor._green; fStack_120 = textColor._blue; fStack_11c = textColor._alpha; local_e8 = 0; local_e4 = 0xffff; local_e0 = 0; local_dc = 0x3f800000; local_d8 = 0xffffffff; local_d4 = 0; local_d0 = 0; local_14._0_1_ = 3; pbVar4 = (byte *)(**(code **)(*device + 0x10))(secondaryKey); layerIndex = Font::get_string_width_n(font,pbVar4,-1); keyTextX = (originX + 300.0) - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); keyName = (**(code **)(*device + 0x10))(secondaryKey); Font::DrawString(keyName,&local_128,&local_e8); local_14 = (char *)((uint)local_14._1_3_ << 8); } else { local_110 = rowOffsetY + originY; local_114 = originX + 284.0; local_d0 = 0; pos_00.y = local_110; pos_00.x = local_114; scale_00.y = g_vectorOne.y; scale_00.x = g_vectorOne.x; bVar2 = Manager::render_controller_action_glyph (g_manager,controllerIndex,(&DAT_00b24010)[iVar6],1,0, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_00,scale_00); if (bVar2 == 0) goto LAB_008d9977; } layerIndex = this->SelectedElement; if (iVar6 == layerIndex) { cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); cursorLayer->_visible = 1; (this->KeyConfigSprite)._flipX = 1; if ((char)this->State == '\0') { layerIndex = this->SelectedColumn * 100; cursorPos.x = (480.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; cursorPos.y = (float)rowHeight * (float)iVar6 + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar5 = (this->KeyConfigSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar5 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } } else { pvVar5 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar5 = (this->KeyConfigSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } } } } else { pCVar1 = &(this->KeyConfigSprite)._color; local_148 = 0x3f2fafb0; uStack_144 = 0; local_140 = 0; if (pCVar1 != (ColorMod *)local_168) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.6862745; (this->KeyConfigSprite)._color._offset[1] = 0.0; pCVar1->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } layerIndex = this->SelectedColumn * 100; selectedCursorPos.x = (480.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; selectedCursorPos.y = (float)rowHeight * (float)row + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar5 = (this->KeyConfigSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)), &selectedCursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar5 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { cursorAnm2 = (this->KeyConfigSprite)._overlayAnimState._animation; animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008d9c3c; } } else { pvVar5 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)), &selectedCursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar5 = (this->KeyConfigSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { cursorAnm2 = (this->KeyConfigSprite)._animState._animation; animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008d9c3c: AnimationLayer::RenderFrame (animLayer,&selectedCursorPos,*(int *)((int)pvVar5 + layerIndex * 4), &g_vectorZero,&g_vectorZero,cursorAnm2); } } } local_174 = 0; uStack_170 = 0; local_16c = 0; if (pCVar1 != (ColorMod *)local_194) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.0; (this->KeyConfigSprite)._color._offset[1] = 0.0; pCVar1->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } iVar6 = row; } (this->KeyConfigSprite)._flipX = 0; cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); cursorLayer->_visible = 0; layerIndex = this->SelectedElement; } row = iVar6 + 1; rowOffset = rowOffset + rowHeight; } while (row < actionCount); if (layerIndex != 0x13) goto LAB_008d9fde; cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); cursorPos.x = originX + 75.0; cursorPos.y = originY + 390.0; cursorLayer->_visible = 1; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar5 = (this->KeyConfigSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._animState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)),&cursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4), &g_vectorZero,&g_vectorZero,cursorAnm2); } pvVar5 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008d9fb6; } } else { pvVar5 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)),&cursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero,cursorAnm2); } pvVar5 = (this->KeyConfigSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._animState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *(int *)((int)pvVar5 + 0x50), -1 < layerIndex)) { animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008d9fb6: AnimationLayer::RenderFrame (animLayer,&cursorPos,*(int *)((int)pvVar5 + layerIndex * 4),&g_vectorZero, &g_vectorZero,cursorAnm2); } } } cursorLayer = ANM2::GetLayer((ANM2 *)local_94.y,&DAT_00000006); cursorLayer->_visible = 0; LAB_008d9fde: local_14 = (char *)0x4; if (deviceRefCount != (int *)0x0) { isLastDeviceRef = (**(code **)(*deviceRefCount + 0xc))(); if ((isLastDeviceRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } } ExceptionList = local_1c; return; } //@@ 008da030 Menu_KeyConfig::update_gamepad_layout /* DB: ? Menu_KeyConfig::Update calls it only for an InputDeviceGamepad (flag 0x20 or type 3), same condition as render_gamepad_layout 008da510; "ActionId is out of range", Manager::apply_device_key_config prototype: db/protos.zhl */ void __thiscall Menu_KeyConfig::update_gamepad_layout(Menu_KeyConfig *this) { void *pvVar1; char isPressed; uint uVar2; int iVar3; int iVar4; MenuManager *menuManager; float viewY; int *device; int *deviceRefCount; int *local_20; int local_1c [3]; void *local_10; undefined1 *puStack_c; int local_8; Manager *manager; undefined4 menuAction; iVar4 = g_menuControllerIndex; local_8 = 0xffffffff; puStack_c = &LAB_00b0609d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_1c + 6); ExceptionList = &local_10; InputManager::get_device(&PTR_vftable_00c57b18,&device,g_menuControllerIndex); local_8 = 0; if (device == (int *)0x0) goto LAB_008da4aa; if ((char)this->State == '\0') { local_1c[2] = 0xe; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 2,0); if (isPressed == '\0') { local_1c[2] = 0xe; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 2,0,0); if (isPressed != '\0') goto LAB_008da335; local_1c[2] = 0xf; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 2,0,0); if (isPressed != '\0') { LAB_008da305: manager = g_manager; this->SelectedElement = 0; *(undefined1 *)&this->State = 0; g_menuControllerIndex = 0; manager->_isHotkeysEnabled = 1; FUN_0098aec0(); Manager::apply_device_key_config(iVar4); goto LAB_008da445; } local_1c[1] = 0xf; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 1,0,0); if (isPressed != '\0') goto LAB_008da305; local_1c[1] = 0x16; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 1,0,0); if (isPressed != '\0') { LAB_008da2db: menuManager = g_menuManager; if (this->SelectedElement == 0) { viewY = -2304.0; this->SelectedElement = 0x14; goto LAB_008da439; } iVar3 = this->SelectedElement + -1; this->SelectedElement = iVar3; goto LAB_008da3f8; } local_1c[2] = 0x16; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 2,0,0); if (isPressed != '\0') goto LAB_008da2db; local_1c[0] = 0x17; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c,0,0); if (isPressed == '\0') { local_20 = (int *)&DAT_00000017; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = (int *)&DAT_00000014; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = (int *)&DAT_00000014; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = (int *)0x15; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar4,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = (int *)0x15; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_20,0,0) ; if (isPressed == '\0') goto LAB_008da445; } this->SelectedColumn = 0; goto LAB_008da445; } } this->SelectedColumn = 1; goto LAB_008da445; } } menuManager = g_menuManager; if (this->SelectedElement != 0x14) { iVar3 = this->SelectedElement + 1; this->SelectedElement = iVar3; goto LAB_008da3f8; } viewY = -1890.0; this->SelectedElement = 0; goto LAB_008da439; } LAB_008da335: if (this->SelectedElement == 0x14) { (**(code **)(*device + 0x14))(); } else { *(undefined1 *)&this->State = 1; } } else { iVar4 = (**(code **)(*device + 0x3c))(0,uVar2); if (iVar4 == -1) goto LAB_008da445; *(undefined1 *)&this->State = 0; local_20 = device; uVar2 = (&DAT_00b24060)[this->SelectedElement]; local_1c[0] = this->SelectedColumn; iVar3 = device[4]; if ((uint)(device[5] - iVar3 >> 4) <= uVar2) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar3 = local_20[4]; } *(int *)(uVar2 * 0x10 + iVar3 + local_1c[0] * 4) = iVar4; switch(uVar2) { case 0: menuAction = 0x14; break; case 1: menuAction = 0x15; break; case 2: menuAction = 0x16; break; case 3: menuAction = 0x17; break; default: goto switchD_008da3b6_caseD_4; case 0xc: menuAction = 0x13; } FUN_00a24330(this->SelectedColumn,menuAction,iVar4); switchD_008da3b6_caseD_4: iVar4 = this->SelectedElement + 1; iVar3 = this->SelectedElement; if (iVar4 < 0x14) { this->SelectedElement = iVar4; iVar3 = iVar4; } menuManager = g_menuManager; LAB_008da3f8: if (iVar3 < 3) { viewY = -1890.0; } else if (iVar3 < 0x13) { viewY = -1890.0 - ((float)iVar3 - 2.0) * 23.0; } else { viewY = -2304.0; } LAB_008da439: menuManager->_viewPositionSet[0xc].y = viewY; menuManager->_state = 1; } LAB_008da445: if (((this->KeyConfigSprite)._animState._animData != (void *)0x0) && ((6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))))) { pvVar1 = (this->KeyConfigSprite)._animState._animData; iVar4 = *(int *)((int)pvVar1 + 0x50); if ((pvVar1 == (void *)0x0) || ((iVar4 < 0 || (*(int *)((int)pvVar1 + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->KeyConfigSprite)._animState._layerFrames + iVar4 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->KeyConfigSprite)._animState,iVar4,0.0); } LAB_008da4aa: local_8 = 1; if (((deviceRefCount != (int *)0x0) && (isPressed = (**(code **)(*deviceRefCount + 0xc))(), isPressed != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } ExceptionList = local_10; return; } //@@ 008da510 Menu_KeyConfig::render_gamepad_layout /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from the key-config menu render 008d9340 Menu_KeyConfig::Render when the device casts to InputDeviceGamepad with flag 0x20 or type 3; draws #INPUT_* labels (incl. FULLSCREEN/MUTE) with Font::DrawString next to button icons (ANM2::GetLayer/RenderFrame) prototype: db/protos.zhl */ void __thiscall Menu_KeyConfig::render_gamepad_layout(Menu_KeyConfig *this) { ColorMod *pCVar1; char **ppcVar2; byte bVar3; char isLastRef; byte *pbVar4; uint uVar5; undefined4 buttonName; LayerState *highlightLayer; void *pvVar6; byte *pbVar7; byte *pbVar8; char *pcVar9; AnimationLayer *animLayer; int iVar10; ANM2 *layerAnimState; bool bVar11; float fVar12; float fVar13; undefined4 local_160 [8]; undefined4 local_140; undefined4 uStack_13c; undefined4 local_138; undefined4 local_134 [8]; undefined4 local_114; undefined4 uStack_110; undefined4 local_10c; KColor textColor; KColor drawColor; Vector editCursorPos; int secondaryButton; int primaryButton; undefined4 drawParams; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; ANM2 *local_a8; float buttonTextX; int rowOffsetY; int *local_9c; int *deviceRefCount; float originY; float originX; Vector cursorPos; int *local_84; int row; Font *font; char *actionLabels [4]; char *local_68; char *local_64; char *local_60; char *local_5c; char *local_58; char *local_54; char *local_50; char *local_4c; char *local_48; char *local_44; char *local_40; char *local_3c; char *local_38; char *local_34; char *local_30; char *local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; int layerIndex; puStack_20 = (undefined1 *)(actionLabels + 0x1d); local_14 = (char *)0xffffffff; puStack_18 = &LAB_00b060f1; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(actionLabels + 0x1a); ExceptionList = &local_1c; if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008da599: pbVar4 = (this->KeyConfigSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar7 = *(byte **)pbVar4; } pbVar8 = s_Idle; do { bVar3 = *pbVar7; bVar11 = bVar3 < *pbVar8; if (bVar3 != *pbVar8) { LAB_008da5d0: uVar5 = -(uint)bVar11 | 1; goto LAB_008da5d5; } if (bVar3 == 0) break; bVar3 = pbVar7[1]; bVar11 = bVar3 < pbVar8[1]; if (bVar3 != pbVar8[1]) goto LAB_008da5d0; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008da5d5: if ((uVar5 == 0) && ((ppcVar2 = actionLabels + 0x1d, pbVar4[0x34] == 0 || (ppcVar2 = actionLabels + 0x1d, (this->KeyConfigSprite)._animState._isPlaying != 0)))) goto LAB_008da609; } bVar3 = ANM2::SetAnimation(&this->KeyConfigSprite,s_Idle,1); ppcVar2 = (char **)puStack_20; if (bVar3 != 0) { AnimationState::Rewind(&(this->KeyConfigSprite)._animState); (this->KeyConfigSprite)._animState._isPlaying = 1; ppcVar2 = (char **)puStack_20; } } else { pbVar4 = (this->KeyConfigSprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pbVar7 = s_Idle; do { bVar3 = *pbVar4; bVar11 = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_008da590: uVar5 = -(uint)bVar11 | 1; goto LAB_008da595; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar11 = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_008da590; pbVar4 = pbVar4 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008da595: ppcVar2 = actionLabels + 0x1d; if (uVar5 != 0) goto LAB_008da599; } LAB_008da609: puStack_20 = (undefined1 *)ppcVar2; if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008da64e: pbVar4 = (this->KeyConfigSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar7 = *(byte **)pbVar4; } pcVar9 = "IdleUD"; do { bVar3 = *pbVar7; bVar11 = bVar3 < (byte)*pcVar9; if (bVar3 != *pcVar9) { LAB_008da684: uVar5 = -(uint)bVar11 | 1; goto LAB_008da689; } if (bVar3 == 0) break; bVar3 = pbVar7[1]; bVar11 = bVar3 < (byte)pcVar9[1]; if (bVar3 != pcVar9[1]) goto LAB_008da684; pbVar7 = pbVar7 + 2; pcVar9 = pcVar9 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008da689: if ((uVar5 == 0) && ((pbVar4[0x34] == 0 || ((this->KeyConfigSprite)._animState._isPlaying != 0)))) goto LAB_008da6bd; } bVar3 = ANM2::SetAnimation(&this->KeyConfigSprite,(byte *)"IdleUD",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->KeyConfigSprite)._animState); (this->KeyConfigSprite)._animState._isPlaying = 1; } } else { pbVar4 = (this->KeyConfigSprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar9 = "IdleUD"; do { bVar3 = *pbVar4; bVar11 = bVar3 < (byte)*pcVar9; if (bVar3 != *pcVar9) { LAB_008da645: uVar5 = -(uint)bVar11 | 1; goto LAB_008da64a; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar11 = bVar3 < (byte)pcVar9[1]; if (bVar3 != pcVar9[1]) goto LAB_008da645; pbVar4 = pbVar4 + 2; pcVar9 = pcVar9 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008da64a: if (uVar5 != 0) goto LAB_008da64e; } LAB_008da6bd: originX = (g_menuManager->_ViewPosition).x + this->PositionX; originY = (g_menuManager->_ViewPosition).y + this->PositionY; KColor::SetFromARGB(&textColor,0xff362f2d); font = &g_manager->_font2_TeamMeatEx12; actionLabels[0] = "#INPUT_WALK_UP"; actionLabels[1] = "#INPUT_WALK_DOWN"; actionLabels[2] = "#INPUT_WALK_LEFT"; actionLabels[3] = "#INPUT_WALK_RIGHT"; local_68 = "#INPUT_SHOOT_UP"; local_64 = "#INPUT_SHOOT_DOWN"; local_60 = "#INPUT_SHOOT_LEFT"; local_5c = "#INPUT_SHOOT_RIGHT"; local_58 = "#INPUT_BOMB"; local_54 = "#INPUT_ITEM"; local_50 = "#INPUT_PILL_CARD"; local_4c = "#INPUT_DROP"; local_48 = "#INPUT_MAP"; local_44 = "#INPUT_EMOTE"; local_40 = "#INPUT_DESCRIPTIONS"; local_3c = "#INPUT_PAUSE_JOIN"; local_38 = "#INPUT_MENU_CONFIRM"; local_34 = "#INPUT_MENU_BACK"; local_30 = "#INPUT_MENU_L"; local_2c = "#INPUT_MENU_R"; InputManager::get_device(&PTR_vftable_00c57b18,&local_9c,g_menuControllerIndex); local_14 = (char *)0x0; local_84 = local_9c; if (local_9c == (int *)0x0) goto LAB_008db021; fVar12 = originY + 58.0; row = 0; rowOffsetY = 0; fVar13 = originX + 410.0; local_a8 = (ANM2 *)(originX + 300.0); do { layerIndex = local_9c[4]; uVar5 = (&DAT_00b24060)[row]; if ((uint)(local_9c[5] - layerIndex >> 4) <= uVar5) { local_84 = local_9c; KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); layerIndex = local_84[4]; } iVar10 = row; primaryButton = *(int *)(layerIndex + uVar5 * 0x10); secondaryButton = *(int *)(layerIndex + 4 + uVar5 * 0x10); if ((primaryButton == -1) && (secondaryButton == -1)) { drawColor._red = 0.8; drawColor._green = 0.2; drawColor._blue = 0.2; drawColor._alpha = 1.0; drawColor._unk = 0; } else { drawColor._unk = textColor._unk; drawColor._red = textColor._red; drawColor._green = textColor._green; drawColor._blue = textColor._blue; drawColor._alpha = textColor._alpha; } drawParams = 0; local_c0 = 0xffff; local_bc = 0; local_b8 = 0x3f800000; local_b4 = 0xffffffff; local_b0 = 0; local_ac = 0; local_14._0_1_ = 1; pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)actionLabels[row]); local_84 = (int *)((float)rowOffsetY + fVar12); Font::DrawString(pbVar4,&drawColor,&drawParams); drawParams = 0; local_c0 = 0xffff; local_bc = 0; local_b8 = 0x3f800000; local_b4 = 0xffffffff; local_b0 = 0; local_ac = 0; local_14._0_1_ = 2; pbVar4 = (byte *)(**(code **)(*local_9c + 0x10))(primaryButton); layerIndex = Font::get_string_width_n(font,pbVar4,-1); buttonTextX = fVar13 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); buttonName = (**(code **)(*local_9c + 0x10))(primaryButton); Font::DrawString(buttonName,&drawColor,&drawParams); drawParams = 0; local_c0 = 0xffff; local_bc = 0; local_b8 = 0x3f800000; local_b4 = 0xffffffff; local_b0 = 0; local_ac = 0; local_14._0_1_ = 3; pbVar4 = (byte *)(**(code **)(*local_9c + 0x10))(secondaryButton); layerIndex = Font::get_string_width_n(font,pbVar4,-1); buttonTextX = (float)local_a8 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); buttonName = (**(code **)(*local_9c + 0x10))(secondaryButton); Font::DrawString(buttonName,&drawColor,&drawParams); local_14 = (char *)((uint)local_14._1_3_ << 8); layerIndex = this->SelectedElement; if (iVar10 == layerIndex) { highlightLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); highlightLayer->_visible = 1; (this->KeyConfigSprite)._flipX = 1; if ((char)this->State == '\0') { layerIndex = this->SelectedColumn * 0x6e; cursorPos.x = (490.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; cursorPos.y = (float)iVar10 * 23.0 + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar6 = (this->KeyConfigSprite)._animState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar6 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } } else { pvVar6 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar6 = (this->KeyConfigSprite)._animState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)), &cursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } } } } else { pCVar1 = &(this->KeyConfigSprite)._color; local_114 = 0x3f2fafb0; uStack_110 = 0; local_10c = 0; if (pCVar1 != (ColorMod *)local_134) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.6862745; (this->KeyConfigSprite)._color._offset[1] = 0.0; pCVar1->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } layerIndex = this->SelectedColumn * 0x6e; editCursorPos.x = (490.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; editCursorPos.y = (float)row * 23.0 + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar6 = (this->KeyConfigSprite)._animState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)), &editCursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar6 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { layerAnimState = (this->KeyConfigSprite)._overlayAnimState._animation; animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)); pvVar6 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008daca2; } } else { pvVar6 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)), &editCursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar6 = (this->KeyConfigSprite)._animState._animData; if (((pvVar6 != (void *)0x0) && (6 < *(int *)((int)(this->KeyConfigSprite)._animState._animation + 0x80))) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { layerAnimState = (this->KeyConfigSprite)._animState._animation; animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)); pvVar6 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008daca2: AnimationLayer::RenderFrame (animLayer,&editCursorPos,*(int *)((int)pvVar6 + layerIndex * 4), &g_vectorZero,&g_vectorZero,layerAnimState); } } } local_140 = 0; uStack_13c = 0; local_138 = 0; if (pCVar1 != (ColorMod *)local_160) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.0; (this->KeyConfigSprite)._color._offset[1] = 0.0; pCVar1->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } iVar10 = row; } (this->KeyConfigSprite)._flipX = 0; highlightLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); highlightLayer->_visible = 0; layerIndex = this->SelectedElement; } rowOffsetY = rowOffsetY + 0x17; row = iVar10 + 1; } while (row < 0x14); if (layerIndex != 0x14) goto LAB_008db021; local_a8 = &this->KeyConfigSprite; highlightLayer = ANM2::GetLayer(local_a8,&DAT_00000006); cursorPos.x = originX + 75.0; cursorPos.y = originY + 430.0; highlightLayer->_visible = 1; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar6 = (this->KeyConfigSprite)._animState._animData; if (((pvVar6 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._animState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)),&cursorPos, *(int *)((int)(this->KeyConfigSprite)._animState._layerFrames + layerIndex * 4), &g_vectorZero,&g_vectorZero,layerAnimState); } pvVar6 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar6 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)); pvVar6 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008daff9; } } else { pvVar6 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar6 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { AnimationLayer::RenderFrame ((AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)),&cursorPos, *(int *)((int)(this->KeyConfigSprite)._overlayAnimState._layerFrames + layerIndex * 4),&g_vectorZero,&g_vectorZero,layerAnimState); } pvVar6 = (this->KeyConfigSprite)._animState._animData; if (((pvVar6 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._animState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *(int *)((int)pvVar6 + 0x50), -1 < layerIndex)) { animLayer = (AnimationLayer *)(layerIndex * 0x10 + *(int *)((int)pvVar6 + 0x18)); pvVar6 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008daff9: AnimationLayer::RenderFrame (animLayer,&cursorPos,*(int *)((int)pvVar6 + layerIndex * 4),&g_vectorZero, &g_vectorZero,layerAnimState); } } } highlightLayer = ANM2::GetLayer(local_a8,&DAT_00000006); highlightLayer->_visible = 0; LAB_008db021: local_14 = (char *)0x4; if (((deviceRefCount != (int *)0x0) && (isLastRef = (**(code **)(*deviceRefCount + 0xc))(), isLastRef != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_9c); } ExceptionList = local_1c; return; } //@@ 008db070 Menu_OnlineLobby::update_list_cursor /* DB: ? called from Menu_OnlineLobby::Update body 008dce10 Menu_OnlineLobbyList::Update scope type in Menu Lobby List") when +0x500 set; "Cursor" layer, AnimationState::Update, SoundEffects::Play */ void Menu_OnlineLobby::update_list_cursor(void) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; Manager *pMVar4; char isPressed; int cursor; LayerState *cursorLayer; int in_ECX; undefined4 buttonAction; undefined4 actionMenuUp; undefined4 actionMenuRight; undefined4 actionMenuLeft; int soundId; int cursorValue; Manager *manager; undefined4 *outSettings; manager = g_manager; if (*(char *)(in_ECX + 0x10d) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x34)); AnimationState::Update((AnimationState *)(in_ECX + 0x54)); } if (*(char *)(in_ECX + 0x124) == '\0') { return; } cursorValue = *(int *)(in_ECX + 0x118); actionMenuLeft = 0x14; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&actionMenuLeft,0,0); if (isPressed == '\0') { actionMenuRight = 0x15; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&actionMenuRight,0,0); if (isPressed == '\0') { actionMenuUp = 0x16; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&actionMenuUp,0,0); if (isPressed == '\0') { buttonAction = 0x17; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&buttonAction,0,0); if (isPressed == '\0') goto LAB_008db56d; cursor = *(int *)(in_ECX + 0x118); if (*(int *)&manager->_lobbySettings == 2) { if (0 < cursor) { if (cursor == 1) { *(undefined4 *)(in_ECX + 0x118) = 0xd; goto LAB_008db56d; } if (4 < cursor - 7U) goto LAB_008db55c; } } else if ((5 < cursor) && ((cursor < 7 || (0xc < cursor)))) { LAB_008db55c: if (4 < cursor - 0x10U) goto LAB_008db56d; } cursor = cursor + 1; } else { cursor = *(int *)(in_ECX + 0x118); if (*(int *)&manager->_lobbySettings != 2) { if ((5 < cursor - 1U) && (4 < cursor - 8U)) { if (cursor - 0xdU < 3) { *(undefined4 *)(in_ECX + 0x118) = 1; goto LAB_008db56d; } if (cursor < 0x11) goto LAB_008db56d; } *(uint *)(in_ECX + 0x118) = cursor - 1U; goto LAB_008db56d; } if (cursor == 1) { *(undefined4 *)(in_ECX + 0x118) = 0; goto LAB_008db56d; } if ((cursor < 8) || (0xd < cursor)) { if ((cursor == 0xe) || (cursor == 0xf)) goto LAB_008db317; if (cursor < 0x11) goto LAB_008db56d; cursor = cursor + -1; } else { cursor = cursor + -1; } } *(int *)(in_ECX + 0x118) = cursor; goto LAB_008db56d; } cursor = *(int *)(in_ECX + 0x118); if (*(int *)&manager->_lobbySettings == 2) { if (cursor == 0) { *(undefined4 *)(in_ECX + 0x118) = 7; goto LAB_008db56d; } if (cursor == 1) { *(undefined4 *)(in_ECX + 0x118) = 8; goto LAB_008db56d; } if (cursor == 7) { *(undefined4 *)(in_ECX + 0x118) = 0x10; goto LAB_008db56d; } if ((cursor == 8) || (cursor == 9)) { LAB_008db335: *(undefined4 *)(in_ECX + 0x118) = 0x11; goto LAB_008db56d; } if (cursor == 10) { *(undefined4 *)(in_ECX + 0x118) = 0x12; goto LAB_008db56d; } if ((cursor == 0xb) || (cursor == 0xc)) { LAB_008db326: *(undefined4 *)(in_ECX + 0x118) = 0x13; goto LAB_008db56d; } if (cursor == 0xd) { *(undefined4 *)(in_ECX + 0x118) = 0xe; goto LAB_008db56d; } if (cursor == 0xe) { *(undefined4 *)(in_ECX + 0x118) = 0xf; goto LAB_008db56d; } if (cursor != 0xf) goto LAB_008db56d; LAB_008db317: *(undefined4 *)(in_ECX + 0x118) = 0xc; goto LAB_008db56d; } if (cursor == 0) { *(undefined4 *)(in_ECX + 0x118) = 7; goto LAB_008db56d; } if (cursor == 1) { *(undefined4 *)(in_ECX + 0x118) = 8; goto LAB_008db56d; } if (cursor == 2) { *(undefined4 *)(in_ECX + 0x118) = 9; goto LAB_008db56d; } if (cursor == 3) { *(undefined4 *)(in_ECX + 0x118) = 10; goto LAB_008db56d; } if (cursor == 4) { *(undefined4 *)(in_ECX + 0x118) = 0xb; goto LAB_008db56d; } if ((cursor != 5) && (cursor != 6)) { if (cursor == 7) { *(undefined4 *)(in_ECX + 0x118) = 0x10; goto LAB_008db56d; } if ((cursor != 8) && (cursor != 9)) { if (cursor == 10) { *(undefined4 *)(in_ECX + 0x118) = 0x12; goto LAB_008db56d; } if ((cursor != 0xb) && (cursor != 0xc)) { if (cursor == 0xd) { *(undefined4 *)(in_ECX + 0x118) = 0xe; } else if (cursor == 0xe) { *(undefined4 *)(in_ECX + 0x118) = 0xf; } else if (cursor == 0xf) { *(undefined4 *)(in_ECX + 0x118) = 0x14; } goto LAB_008db56d; } goto LAB_008db326; } goto LAB_008db335; } LAB_008db133: *(undefined4 *)(in_ECX + 0x118) = 0xd; } else { cursor = *(int *)(in_ECX + 0x118); if (*(int *)&manager->_lobbySettings == 2) { if (cursor == 7) { *(undefined4 *)(in_ECX + 0x118) = 0; goto LAB_008db56d; } if ((cursor != 8) && (cursor != 9)) { if (((cursor != 10) && (cursor != 0xb)) && (cursor != 0xc)) goto LAB_008db12e; LAB_008db225: *(undefined4 *)(in_ECX + 0x118) = 0xf; goto LAB_008db56d; } } else { if (cursor == 7) { *(undefined4 *)(in_ECX + 0x118) = 0; goto LAB_008db56d; } if (cursor != 8) { if (cursor == 9) { *(undefined4 *)(in_ECX + 0x118) = 2; goto LAB_008db56d; } if (cursor == 10) { *(undefined4 *)(in_ECX + 0x118) = 3; goto LAB_008db56d; } if ((cursor == 0xb) || (cursor == 0xc)) { *(undefined4 *)(in_ECX + 0x118) = 4; goto LAB_008db56d; } if (cursor == 0xd) { *(undefined4 *)(in_ECX + 0x118) = 5; goto LAB_008db56d; } LAB_008db12e: if (cursor != 0xe) { if (cursor == 0xf) { *(undefined4 *)(in_ECX + 0x118) = 0xe; goto LAB_008db56d; } if (cursor == 0x10) { *(undefined4 *)(in_ECX + 0x118) = 7; goto LAB_008db56d; } if (cursor == 0x11) { *(undefined4 *)(in_ECX + 0x118) = 8; goto LAB_008db56d; } if (cursor == 0x12) { *(undefined4 *)(in_ECX + 0x118) = 10; goto LAB_008db56d; } if (cursor == 0x13) { *(undefined4 *)(in_ECX + 0x118) = 0xb; goto LAB_008db56d; } if (cursor != 0x14) goto LAB_008db56d; goto LAB_008db225; } goto LAB_008db133; } } *(undefined4 *)(in_ECX + 0x118) = 1; } LAB_008db56d: pMVar4 = g_manager; if (*(int *)(in_ECX + 0x118) != cursorValue) { soundId = 0x11a; seed_fart_sound_override(&soundId); SoundEffects::Play(&pMVar4->_sfxManager,soundId,1.0,2,0,1.0,0.0); cursorLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 4),(byte *)"Cursor"); if (cursorLayer == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)(in_ECX + 4),*(int *)cursorLayer->_layerData, *(int *)(in_ECX + 0x118)); } } buttonAction = 0xe; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&buttonAction,0,0); if (isPressed == '\0') { buttonAction = 0xf; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&buttonAction,0,0); if (isPressed == '\0') { return; } } else { cursorValue = *(int *)(in_ECX + 0x118); if (cursorValue != 0x14) { if (cursorValue == 0) { if (*(int *)&manager->_lobbySettings == 2) { *(bool *)(in_ECX + 0x141) = *(char *)(in_ECX + 0x141) == '\0'; return; } *(bool *)(in_ECX + 0x130) = *(char *)(in_ECX + 0x130) == '\0'; return; } if (cursorValue == 1) { if (*(int *)&manager->_lobbySettings == 2) { *(bool *)(in_ECX + 0x142) = *(char *)(in_ECX + 0x142) == '\0'; return; } *(bool *)(in_ECX + 0x131) = *(char *)(in_ECX + 0x131) == '\0'; return; } if (cursorValue == 2) { *(bool *)(in_ECX + 0x132) = *(char *)(in_ECX + 0x132) == '\0'; return; } if (cursorValue == 3) { *(bool *)(in_ECX + 0x133) = *(char *)(in_ECX + 0x133) == '\0'; return; } if (cursorValue == 4) { *(bool *)(in_ECX + 0x134) = *(char *)(in_ECX + 0x134) == '\0'; return; } if (cursorValue == 5) { *(bool *)(in_ECX + 0x13f) = *(char *)(in_ECX + 0x13f) == '\0'; return; } if (cursorValue == 6) { *(bool *)(in_ECX + 0x140) = *(char *)(in_ECX + 0x140) == '\0'; return; } if (cursorValue == 7) { *(bool *)(in_ECX + 0x136) = *(char *)(in_ECX + 0x136) == '\0'; return; } if (cursorValue == 8) { *(bool *)(in_ECX + 0x137) = *(char *)(in_ECX + 0x137) == '\0'; return; } if (cursorValue == 9) { *(bool *)(in_ECX + 0x138) = *(char *)(in_ECX + 0x138) == '\0'; return; } if (cursorValue == 10) { *(bool *)(in_ECX + 0x139) = *(char *)(in_ECX + 0x139) == '\0'; return; } if (cursorValue == 0xb) { *(bool *)(in_ECX + 0x13a) = *(char *)(in_ECX + 0x13a) == '\0'; return; } if (cursorValue == 0xc) { *(bool *)(in_ECX + 0x13b) = *(char *)(in_ECX + 0x13b) == '\0'; return; } if (cursorValue == 0xd) { *(bool *)(in_ECX + 0x13c) = *(char *)(in_ECX + 0x13c) == '\0'; return; } if (cursorValue == 0xe) { *(bool *)(in_ECX + 0x13d) = *(char *)(in_ECX + 0x13d) == '\0'; return; } if (cursorValue == 0xf) { *(bool *)(in_ECX + 0x13e) = *(char *)(in_ECX + 0x13e) == '\0'; return; } if (cursorValue == 0x10) { *(undefined4 *)(in_ECX + 300) = 3; return; } if (cursorValue == 0x11) { *(undefined4 *)(in_ECX + 300) = 0; return; } if (cursorValue == 0x12) { *(undefined4 *)(in_ECX + 300) = 1; return; } if (cursorValue == 0x13) { *(undefined4 *)(in_ECX + 300) = 2; return; } return; } outSettings = *(undefined4 **)(in_ECX + 0x128); if (outSettings != (undefined4 *)0x0) { uVar1 = *(undefined4 *)(in_ECX + 0x130); uVar2 = *(undefined4 *)(in_ECX + 0x134); uVar3 = *(undefined4 *)(in_ECX + 0x138); *outSettings = *(undefined4 *)(in_ECX + 300); outSettings[1] = uVar1; outSettings[2] = uVar2; outSettings[3] = uVar3; *(undefined8 *)(outSettings + 4) = *(undefined8 *)(in_ECX + 0x13c); } } *(undefined1 *)(in_ECX + 0x124) = 0; *(undefined4 *)(in_ECX + 0x128) = 0; return; } //@@ 008db8f0 Menu_OnlineLobby::render_player_slots /* DB: ? sub-render of the online lobby menu 0x8ddae0: layers Box10..Box20, Idle/Idle_Daily, BackButton/BackKey prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::render_player_slots(void *sprite) { Vector pos; Vector scale; byte bVar1; byte *pbVar2; uint uVar3; LayerState *pLVar4; float *backButtonOffset; char *pcVar5; byte *pbVar6; AnimationState *otherAnimState; bool bVar7; Vector local_20; byte isKeyboard; ANM2 *sprite; isKeyboard = g_menuControllerIndex == 0; local_20.y = (float)g_manager; pbVar2 = *(byte **)((int)sprite + 0x38); sprite = (ANM2 *)((int)sprite + 4); if (*(int *)&g_manager->_lobbySettings == 2) { if (pbVar2 != (byte *)0x0) { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pcVar5 = "Idle_Daily"; do { bVar1 = *pbVar2; bVar7 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_008db962: uVar3 = -(uint)bVar7 | 1; goto LAB_008db967; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_008db962; pbVar2 = pbVar2 + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_008db967: if ((uVar3 == 0) && ((*(char *)(*(int *)((int)sprite + 0x38) + 0x34) == '\0' || (*(char *)((int)sprite + 0x48) != '\0')))) goto LAB_008db9ec; } pcVar5 = "Idle_Daily"; } else { if (pbVar2 != (byte *)0x0) { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pbVar6 = s_Idle; do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_008db9b6: uVar3 = -(uint)bVar7 | 1; goto LAB_008db9bb; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_008db9b6; pbVar2 = pbVar2 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_008db9bb: if ((uVar3 == 0) && ((*(char *)(*(int *)((int)sprite + 0x38) + 0x34) == '\0' || (*(char *)((int)sprite + 0x48) != '\0')))) goto LAB_008db9ec; } pcVar5 = (char *)s_Idle; } bVar1 = ANM2::SetAnimation(sprite,(byte *)pcVar5,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)sprite + 0x34)); *(undefined1 *)((int)sprite + 0x48) = 1; } LAB_008db9ec: pLVar4 = ANM2::GetLayer(sprite,(byte *)"BackKey"); pLVar4->_visible = isKeyboard; if (*(int *)((int)local_20.y + 0x4b0d8) == 2) { local_20.y = (float)(uint)(*(char *)((int)sprite + 0x141) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75678); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); bVar7 = *(char *)((int)sprite + 0x142) == '\0'; } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); bVar7 = *(char *)((int)sprite + 0x142) == '\0'; } } else { local_20.y = (float)(uint)(*(char *)((int)sprite + 0x130) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75678); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } bVar7 = *(char *)((int)sprite + 0x131) == '\0'; } local_20.y = (float)(uint)!bVar7; pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75680); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x132) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75668); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x133) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75670); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x134) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b756d4); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x13f) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75c14); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x140) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75bf8); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x136) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75c00); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x137) != '\0'); pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75be8); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x138) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box10"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x139) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box11"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x13a) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box12"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x13b) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box13"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x13c) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box14"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x13d) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box15"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(char *)((int)sprite + 0x13e) != '\0'); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box16"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(int *)((int)sprite + 300) == 3); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box17"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(int *)((int)sprite + 300) == 0); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box18"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(int *)((int)sprite + 300) == 1); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box19"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.y = (float)(uint)(*(int *)((int)sprite + 300) == 2); pLVar4 = ANM2::GetLayer(sprite,(byte *)"Box20"); if (pLVar4 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar4->_layerData,(int)local_20.y); } local_20.x = (g_menuManager->_ViewPosition).x + *(float *)((int)sprite + 0x11c); local_20.y = (g_menuManager->_ViewPosition).y + *(float *)((int)sprite + 0x120); if (*(char *)((int)sprite + 0x10d) != '\0') { if (*(char *)((int)sprite + 0x74) == '\0') { AnimationState::Render ((AnimationState *)((int)sprite + 0x34),&local_20,&g_vectorZero,&g_vectorZero); otherAnimState = (AnimationState *)((int)sprite + 0x54); } else { AnimationState::Render ((AnimationState *)((int)sprite + 0x54),&local_20,&g_vectorZero,&g_vectorZero); otherAnimState = (AnimationState *)((int)sprite + 0x34); } AnimationState::Render(otherAnimState,&local_20,&g_vectorZero,&g_vectorZero); } if (isKeyboard == 0) { if (*(int *)((int)sprite + 0x38) == 0) { backButtonOffset = (float *)0x0; } else { backButtonOffset = AnimationState::GetNullFrame((AnimationState *)((int)sprite + 0x34),(byte *)"BackButton"); } local_20.y = backButtonOffset[1] + local_20.y; local_20.x = *backButtonOffset + local_20.x; pos.y = local_20.y; pos.x = local_20.x; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0xf,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); } return; } //@@ 008dc0a0 FUN_008dc0a0 bool FUN_008dc0a0(int *param_1,int *param_2) { char *_Str2; char *_Str1; int iVar1; _Str2 = (char *)(**(code **)(*param_2 + 4))(); _Str1 = (char *)(**(code **)(*param_1 + 4))(); iVar1 = _stricmp(_Str1,_Str2); return iVar1 < 0; } //@@ 008dc0d0 FUN_008dc0d0 bool FUN_008dc0d0(undefined4 param_1,int *param_2,int *param_3,undefined **param_4,int *param_5, int *param_6) { char cVar1; int iVar2; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b06135; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 1; if (param_2 == (int *)0x0) { iVar2 = 0; } else { iVar2 = (**(code **)(*param_2 + 0x30)) ("current_stage",__security_cookie ^ (int)register0x00000010 - 4U); } if (param_5 == (int *)0x0) { iVar3 = 0; } else { iVar3 = (**(code **)(*param_5 + 0x30))("current_stage"); } local_8 = CONCAT31(local_8._1_3_,2); if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(¶m_2); } } param_4 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 3; if (param_6 != (int *)0x0) { cVar1 = (**(code **)(*param_6 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(¶m_5); } } ExceptionList = local_10; return iVar2 < iVar3; } //@@ 008dc1a0 Menu_LobbyListFilters::constructor /* DB: ? ECX=MenuManager+0xe648: zeroes +0/+4, ANM2::constructor at +8, +0x11c, +0x230, clears fields, colors 0.21/0.18/0.18, path "gfx/ui/main menu/LobbyListFiltersMenu.anm2" stored at +0x388; from MenuManager::constructor */ void Menu_LobbyListFilters::constructor(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b061a8; local_10 = ExceptionList; ExceptionList = &local_10; in_ECX[1] = 0; *in_ECX = 0; ANM2::constructor((ANM2 *)(in_ECX + 2)); local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x47)); local_8._0_1_ = 1; ANM2::constructor((ANM2 *)(in_ECX + 0x8c)); *(undefined1 *)(in_ECX + 0xd1) = 0; in_ECX[0xd2] = 0; in_ECX[0xd3] = 0; in_ECX[0xd4] = 0; in_ECX[0xd5] = 0; in_ECX[0xd6] = 0; in_ECX[0xd7] = 0; in_ECX[0xd8] = 0; in_ECX[0xd9] = 0; local_8 = CONCAT31(local_8._1_3_,4); in_ECX[0xda] = 0; in_ECX[0xdb] = 0; in_ECX[0xdc] = 0; in_ECX[0xe1] = 0; in_ECX[0xdd] = 0x3e58d8d9; in_ECX[0xde] = 0x3e3cbcbd; in_ECX[0xdf] = 0x3e34b4b5; in_ECX[0xe0] = 0x3f800000; in_ECX[0xe2] = "gfx/ui/main menu/LobbyListFiltersMenu.anm2"; ANM2::constructor((ANM2 *)(in_ECX + 0xe3)); in_ECX[0x128] = 0; in_ECX[0x12a] = 0; in_ECX[0x129] = 0; *(undefined1 *)(in_ECX + 299) = 0; in_ECX[300] = 0; in_ECX[0x12d] = 1; in_ECX[0x12e] = 0x1010101; *(undefined2 *)(in_ECX + 0x12f) = 0x101; *(undefined1 *)((int)in_ECX + 0x4bd) = 0; *(undefined4 *)((int)in_ECX + 0x4be) = 0x1010101; *(undefined4 *)((int)in_ECX + 0x4c2) = 0x1010101; *(undefined1 *)((int)in_ECX + 0x4c6) = 1; *(undefined4 *)((int)in_ECX + 0x4c7) = 0x1010101; in_ECX[0x134] = 1; in_ECX[0x135] = 0x1010101; *(undefined2 *)(in_ECX + 0x136) = 0x101; *(undefined1 *)((int)in_ECX + 0x4d9) = 0; *(undefined4 *)((int)in_ECX + 0x4da) = 0x1010101; *(undefined4 *)((int)in_ECX + 0x4de) = 0x1010101; *(undefined1 *)((int)in_ECX + 0x4e2) = 1; *(undefined4 *)((int)in_ECX + 0x4e3) = 0x1010101; in_ECX[0x13a] = 1; in_ECX[0x13b] = 0x1010101; *(undefined2 *)(in_ECX + 0x13c) = 0x101; *(undefined1 *)((int)in_ECX + 0x4f1) = 0; *(undefined4 *)((int)in_ECX + 0x4f2) = 0x1010101; *(undefined4 *)((int)in_ECX + 0x4f6) = 0x1010101; *(undefined1 *)((int)in_ECX + 0x4fa) = 1; *(undefined4 *)((int)in_ECX + 0x4fb) = 0x1010101; *(undefined1 *)(in_ECX + 0x140) = 0; ExceptionList = local_10; return; } //@@ 008dc3c0 FUN_008dc3c0 void FUN_008dc3c0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02850; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0x4b0) = 0; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x38c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3dc)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3bc)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x3a4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x38c)); FUN_008e2b00(); FUN_008e2b80(); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x230)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x280)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x260)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x248)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x230)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x11c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x16c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x14c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x134)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x11c)); local_8 = 3; ANM2::Reset((ANM2 *)(in_ECX + 8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x58)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 008dca50 Menu_OnlineLobbyList::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? loads gfx/ui/main menu/LobbyListMenu.anm2, sets "Cursor" animation; called from MenuManager::LoadGraphics with the other menu loaders prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobbyList::load_graphics(void *this) { byte *pbVar1; byte bVar2; byte *nameCursor; byte *idleNameCursor; char *pcVar3; void *ptr; uint uVar4; bool bVar5; std_string anm2Path; std_string menuAnm2Path; uint local_24; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ppvStack_20 = (void **)((int)&anm2Path + 0x50); local_14 = 0xffffffff; puStack_18 = &LAB_00b05bdd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&anm2Path + 0x44U; ExceptionList = &local_1c; menuAnm2Path._size = 0; menuAnm2Path._capacity = 0xf; menuAnm2Path._buf[0] = '\0'; menuAnm2Path._buf[1] = '\0'; menuAnm2Path._buf[2] = '\0'; menuAnm2Path._buf[3] = '\0'; menuAnm2Path._buf._0_4_ = std::_Allocate(0x30); menuAnm2Path._size = 0x23; menuAnm2Path._capacity = 0x2f; builtin_strncpy((char *)menuAnm2Path._buf._0_4_,"gfx/ui/main menu/LobbyListMenu.anm2",0x24); local_14 = 0; ANM2::Load((ANM2 *)((int)this + 8),&menuAnm2Path,1); local_14 = 0xffffffff; if (0xf < menuAnm2Path._capacity) { uVar4 = menuAnm2Path._capacity + 1; pcVar3 = (char *)menuAnm2Path._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(menuAnm2Path._buf._0_4_ + -4); uVar4 = menuAnm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(menuAnm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } menuAnm2Path._size = 0; menuAnm2Path._capacity = 0xf; menuAnm2Path._buf[0] = '\0'; menuAnm2Path._buf[1] = '\0'; menuAnm2Path._buf[2] = '\0'; menuAnm2Path._buf[3] = '\0'; menuAnm2Path._buf._0_4_ = std::_Allocate(0x30); menuAnm2Path._size = 0x23; menuAnm2Path._capacity = 0x2f; builtin_strncpy((char *)menuAnm2Path._buf._0_4_,"gfx/ui/main menu/LobbyListMenu.anm2",0x24); local_14 = 1; ANM2::Load((ANM2 *)((int)this + 0x11c),&menuAnm2Path,1); local_14 = 0xffffffff; if (0xf < menuAnm2Path._capacity) { uVar4 = menuAnm2Path._capacity + 1; pcVar3 = (char *)menuAnm2Path._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(menuAnm2Path._buf._0_4_ + -4); uVar4 = menuAnm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(menuAnm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } pbVar1 = *(byte **)((int)this + 0x3c); if (pbVar1 == (byte *)0x0) { LAB_008dcc49: bVar2 = ANM2::SetAnimation((ANM2 *)((int)this + 8),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)this + 0x38)); *(undefined1 *)((int)this + 0x4c) = 1; } } else { nameCursor = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { nameCursor = *(byte **)pbVar1; } idleNameCursor = s_Idle; do { bVar2 = *nameCursor; bVar5 = bVar2 < *idleNameCursor; if (bVar2 != *idleNameCursor) { LAB_008dcc36: uVar4 = -(uint)bVar5 | 1; goto LAB_008dcc3b; } if (bVar2 == 0) break; bVar2 = nameCursor[1]; bVar5 = bVar2 < idleNameCursor[1]; if (bVar2 != idleNameCursor[1]) goto LAB_008dcc36; nameCursor = nameCursor + 2; idleNameCursor = idleNameCursor + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008dcc3b: if ((uVar4 != 0) || ((pbVar1[0x34] != 0 && (*(char *)((int)this + 0x4c) == '\0')))) goto LAB_008dcc49; } pbVar1 = *(byte **)((int)this + 0x150); if (pbVar1 != (byte *)0x0) { nameCursor = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { nameCursor = *(byte **)pbVar1; } pcVar3 = "Cursor"; do { bVar2 = *nameCursor; bVar5 = bVar2 < (byte)*pcVar3; if (bVar2 != *pcVar3) { LAB_008dcca3: uVar4 = -(uint)bVar5 | 1; goto LAB_008dcca8; } if (bVar2 == 0) break; bVar2 = nameCursor[1]; bVar5 = bVar2 < (byte)pcVar3[1]; if (bVar2 != pcVar3[1]) goto LAB_008dcca3; nameCursor = nameCursor + 2; pcVar3 = pcVar3 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008dcca8: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*(char *)((int)this + 0x160) != '\0')))) goto LAB_008dcce1; } bVar2 = ANM2::SetAnimation((ANM2 *)((int)this + 0x11c),(byte *)"Cursor",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)this + 0x14c)); *(undefined1 *)((int)this + 0x160) = 1; } LAB_008dcce1: anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; pbVar1 = *(byte **)((int)this + 0x388); nameCursor = pbVar1; do { bVar2 = *nameCursor; nameCursor = nameCursor + 1; } while (bVar2 != 0); std::string::assign(anm2Path._buf,pbVar1,(int)nameCursor - (int)(pbVar1 + 1)); local_14 = 2; ANM2::Load((ANM2 *)((int)this + 0x38c),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; ptr = (void *)anm2Path._buf._0_4_; if (0xfff < uVar4) { ptr = *(void **)(anm2Path._buf._0_4_ + -4); uVar4 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } pbVar1 = *(byte **)((int)this + 0x3c0); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; if (pbVar1 != (byte *)0x0) { nameCursor = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { nameCursor = *(byte **)pbVar1; } idleNameCursor = s_Idle; do { bVar2 = *nameCursor; bVar5 = bVar2 < *idleNameCursor; if (bVar2 != *idleNameCursor) { LAB_008dcdc0: uVar4 = -(uint)bVar5 | 1; goto LAB_008dcdc5; } if (bVar2 == 0) break; bVar2 = nameCursor[1]; bVar5 = bVar2 < idleNameCursor[1]; if (bVar2 != idleNameCursor[1]) goto LAB_008dcdc0; nameCursor = nameCursor + 2; idleNameCursor = idleNameCursor + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008dcdc5: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { ExceptionList = local_1c; return; } if (*(char *)((int)this + 0x3d0) != '\0') { ExceptionList = local_1c; return; } } } bVar2 = ANM2::SetAnimation((ANM2 *)((int)this + 0x38c),s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)this + 0x3bc)); *(undefined1 *)((int)this + 0x3d0) = 1; } ExceptionList = local_1c; return; } //@@ 008dce10 Menu_OnlineLobbyList::Update /* DB: ? MenuManager::Update (009897d0) case 0x12: "Unhandled scope type (%d) in Menu Lobby List", KAGE::Network::Multiplayer::LobbyImplBase casts, FUN_008de3a0/008de690 Menu_OnlineLobbyList::update_password_entry entries; its render is 008ddae0 Menu_OnlineLobby::Render ArrowUp/Down) prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobbyList::Update(void *menuManager) { int *piVar1; longlong lVar2; longlong lVar3; longlong lVar4; longlong lVar5; byte isConnected; char isTriggered; int iVar6; void *pvVar7; char *filterCursor; int iVar8; int unused; uint uVar9; uint uVar10; ulonglong timeNs; double dVar11; int local_30 [2]; int local_28; int local_24; undefined4 actionId; float local_1c; uint local_18; float local_14; int entryOffset; void *self; uint lobbyCount; uint *lastRequestTime; Manager *manager; MenuManager *menuManager; undefined4 savedScope; self = menuManager; isConnected = NetplayManager::check_connection(&g_manager->_netplayManager); if (isConnected == 0) { return; } if (((g_manager->_framecount & 1) == 0) && (*(char *)((int)menuManager + 0x111) != '\0')) { AnimationState::Update((AnimationState *)((int)menuManager + 0x38)); AnimationState::Update((AnimationState *)((int)menuManager + 0x58)); } if (*(char *)((int)menuManager + 0x4ac) != '\0') goto LAB_008ddac2; if (*(char *)((int)menuManager + 0x500) != '\0') { update_password_entry(menuManager); Menu_OnlineLobby::update_list_cursor(); return; } local_1c = 3.36312e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_1c,0,0); if (isTriggered != '\0') { reset(); } piVar1 = (int *)((int)menuManager + 0x4d0); if (*(int *)((int)menuManager + 0x4e8) == *piVar1) { filterCursor = (char *)((int)menuManager + 0x4d4); do { if (filterCursor[0x18] != *filterCursor) goto LAB_008dcf67; filterCursor = filterCursor + 1; } while ((int)(filterCursor + (-4 - (int)piVar1)) < 6); filterCursor = (char *)((int)menuManager + 0x4da); do { if (filterCursor[0x18] != *filterCursor) goto LAB_008dcf67; filterCursor = filterCursor + 1; } while ((int)(filterCursor + (-10 - (int)piVar1)) < 6); filterCursor = (char *)((int)menuManager + 0x4e0); do { if (filterCursor[0x18] != *filterCursor) goto LAB_008dcf67; filterCursor = filterCursor + 1; } while ((int)(filterCursor + (-0x10 - (int)piVar1)) < 3); filterCursor = (char *)((int)menuManager + 0x4e3); do { if (filterCursor[0x18] != *filterCursor) goto LAB_008dcf67; filterCursor = filterCursor + 1; } while ((int)(filterCursor + (-0x13 - (int)piVar1)) < 2); iVar8 = 0; do { if (*(char *)((int)menuManager + iVar8 + 0x4fd) != *(char *)((int)menuManager + iVar8 + 0x4e5)) goto LAB_008dcf67; iVar8 = iVar8 + 1; } while (iVar8 < 2); } else { LAB_008dcf67: *piVar1 = *(int *)((int)menuManager + 0x4e8); *(undefined4 *)((int)menuManager + 0x4d4) = *(undefined4 *)((int)menuManager + 0x4ec); *(undefined4 *)((int)menuManager + 0x4d8) = *(undefined4 *)((int)menuManager + 0x4f0); *(undefined4 *)((int)menuManager + 0x4dc) = *(undefined4 *)((int)menuManager + 0x4f4); *(undefined8 *)((int)menuManager + 0x4e0) = *(undefined8 *)((int)menuManager + 0x4f8); reset(); } uVar10 = 0; lobbyCount = 0; iVar8 = *(int *)&g_manager->_lobbySettings; if (iVar8 == 0) { uVar10 = (*(int *)((int)menuManager + 0x360) - *(int *)((int)menuManager + 0x35c)) / 0x18; lobbyCount = uVar10; } else if (iVar8 == 1) { uVar10 = *(int *)((int)menuManager + 0x354) - *(int *)((int)menuManager + 0x350) >> 5; lobbyCount = uVar10; } else if (iVar8 == 2) { uVar10 = (*(int *)((int)menuManager + 0x360) - *(int *)((int)menuManager + 0x35c)) / 0x18 + (*(int *)((int)menuManager + 0x354) - *(int *)((int)menuManager + 0x350) >> 5); lobbyCount = uVar10; } else { KAGE_LogMessage(0x10,(byte *)"Unhandled scope type (%d) in Menu Lobby List \n"); } local_1c = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) / 9.0; dVar11 = ceil((double)local_1c); local_1c = (float)dVar11; local_14 = local_1c; if (*(char *)((int)menuManager + 0x344) == '\0') { timeNs = GetTimeNs(); menuManager = self; uVar10 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_18 = (uint)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar10 * 0x431bde82; local_1c = (float)lVar3; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_18 + CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar10 = (uint)lVar3 >> 0x12 | uVar9 * 0x4000; local_30[0] = ((uVar9 >> 0x12) - *(int *)((int)self + 0x34c)) - (uint)(uVar10 < *(uint *)((int)self + 0x348)); if ((local_30[0] != 0) || (999 < uVar10 - *(uint *)((int)self + 0x348))) { local_1c = 3.08286e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_1c,0); if (isTriggered == '\0') { local_1c = 3.22299e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a20940,&local_1c,0,0); if (isTriggered != '\0') { iVar8 = *(int *)((int)menuManager + 0x370); if ((iVar8 == 0) || ((0x31 < iVar8 && (iVar8 % 10 == 0)))) { uVar10 = 9; local_18 = *(int *)((int)menuManager + 0x36c) + 1; *(uint *)((int)menuManager + 0x36c) = local_18; if ((int)local_14 == 1) { uVar10 = lobbyCount; } else if (*(int *)((int)menuManager + 0x368) == (int)local_14 + -1) { uVar10 = (int)lobbyCount % 9; } if ((int)uVar10 <= (int)local_18) { iVar8 = *(int *)((int)menuManager + 0x368) + 1; *(undefined4 *)((int)menuManager + 0x36c) = 0; if ((int)local_14 <= iVar8) { iVar8 = 0; } *(int *)((int)menuManager + 0x368) = iVar8; } goto LAB_008dd27e; } goto LAB_008dd2c4; } *(undefined4 *)((int)menuManager + 0x370) = 0; } else { iVar8 = *(int *)((int)menuManager + 0x370); if ((iVar8 == 0) || ((0x31 < iVar8 && (iVar8 % 10 == 0)))) { iVar8 = *(int *)((int)menuManager + 0x36c); iVar6 = iVar8 + -1; *(int *)((int)menuManager + 0x36c) = iVar6; if (iVar6 < 0) { piVar1 = (int *)((int)menuManager + 0x368); *piVar1 = *piVar1 + -1; *(int *)((int)menuManager + 0x36c) = iVar8 + 8; if (*piVar1 < 0) { *(int *)((int)menuManager + 0x368) = (int)local_14 + -1; if ((int)local_14 == 1) { *(uint *)((int)menuManager + 0x36c) = lobbyCount - 1; } else { *(int *)((int)menuManager + 0x36c) = (int)lobbyCount % 9 + -1; } } } LAB_008dd27e: manager = g_manager; if (1 < lobbyCount) { local_18 = 0x11a; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&manager->_sfxManager,local_18,1.0,2,0,1.0,0.0); } } LAB_008dd2c4: *(int *)((int)menuManager + 0x370) = *(int *)((int)menuManager + 0x370) + 1; } actionId = 0xe; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&actionId,0,0); if ((isTriggered != '\0') && (uVar10 = *(int *)((int)menuManager + 0x368) * 9 + *(int *)((int)menuManager + 0x36c), uVar10 < lobbyCount)) { LobbyList::clear(&g_manager[1]._gamestate.field_0x288); iVar8 = *(int *)&g_manager->_lobbySettings; if (iVar8 == 0) { LAB_008dd39b: KAGE::Network::Multiplayer::ConstLobby::ConstLobby (*(int *)((int)menuManager + 0x35c) + uVar10 * 0x18); Level::InitializeGenesisRoom(); } else if (iVar8 == 1) { KAGE::Network::Multiplayer::ConstLobby::ConstLobby (uVar10 * 0x20 + *(int *)((int)menuManager + 0x350) + 8); Level::InitializeGenesisRoom(); } else if (iVar8 == 2) { uVar9 = *(int *)((int)menuManager + 0x354) - *(int *)((int)menuManager + 0x350) >> 5; if (uVar9 <= uVar10) { uVar10 = uVar10 - uVar9; goto LAB_008dd39b; } KAGE::Network::Multiplayer::ConstLobby::ConstLobby (*(int *)((int)menuManager + 0x350) + 8 + uVar10 * 0x20); Level::InitializeGenesisRoom(); } else { KAGE_LogMessage(0x10,(byte *)"Unhandled scope type (%d) in Menu Lobby List \n"); } } lVar2 = CONCAT44(local_30[0],local_28); entryOffset = *(int *)((int)menuManager + 0x368); local_1c = 0.0; local_18 = entryOffset * 9; local_14 = (float)(entryOffset * 0xd8); entryOffset = entryOffset * 0x120; do { local_30[0] = (int)((ulonglong)lVar2 >> 0x20); local_28 = (int)lVar2; if (lobbyCount <= local_18) break; iVar8 = *(int *)&g_manager->_lobbySettings; if (iVar8 == 0) { timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_28 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar10 * 0x431bde82; local_24 = (int)lVar3; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_28 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); iVar8 = *(int *)((int)self + 0x35c); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar10 = (uint)lVar3 >> 0x12 | uVar9 * 0x4000; lastRequestTime = (uint *)((int)local_14 + 0x10 + iVar8); local_30[0] = ((uVar9 >> 0x12) - *(int *)((int)local_14 + 0x14 + iVar8)) - (uint)(uVar10 < *lastRequestTime); lVar2 = CONCAT44(local_30[0],local_28); if ((local_30[0] != 0) || (menuManager = self, 5000 < uVar10 - *lastRequestTime)) { iVar8 = *(int *)((int)local_14 + 4 + iVar8); if ((iVar8 != 0) && (pvVar7 = (void *)__RTDynamicCast(iVar8,0,&KAGE::Network::Multiplayer::LobbyImplBase ::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbySteam:: RTTI_Type_Descriptor), pvVar7 != (void *)0x0)) { KAGE::Network::Multiplayer::LobbySteam::request_lobby_data (pvVar7,(void *)0x0,(void *)0x0); } timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar10 * 0x431bde82; lVar2 = CONCAT44(local_30[0],(int)lVar4); lVar5 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), local_24 + (uint)CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar10 = (uint)((ulonglong)lVar4 >> 0x20); iVar8 = *(int *)((int)self + 0x35c); *(uint *)((int)local_14 + 0x10 + iVar8) = (uint)lVar4 >> 0x12 | uVar10 * 0x4000; *(uint *)((int)local_14 + 0x14 + iVar8) = uVar10 >> 0x12; menuManager = self; } } else if (iVar8 == 1) { timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar10 * 0x431bde82; local_28 = (int)lVar3; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_24 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); iVar8 = *(int *)((int)self + 0x350); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar10 = (uint)lVar3 >> 0x12 | uVar9 * 0x4000; lastRequestTime = (uint *)(entryOffset + 0x18 + iVar8); local_30[0] = ((uVar9 >> 0x12) - *(int *)(entryOffset + 0x1c + iVar8)) - (uint)(uVar10 < *lastRequestTime); lVar2 = CONCAT44(local_30[0],local_28); if ((local_30[0] != 0) || (menuManager = self, 5000 < uVar10 - *lastRequestTime)) { iVar8 = *(int *)(entryOffset + 0xc + iVar8); if ((iVar8 != 0) && (pvVar7 = (void *)__RTDynamicCast(iVar8,0,&KAGE::Network::Multiplayer::LobbyImplBase ::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbySteam:: RTTI_Type_Descriptor), pvVar7 != (void *)0x0)) { KAGE::Network::Multiplayer::LobbySteam::request_lobby_data (pvVar7,(void *)0x0,(void *)0x0); } timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar10 * 0x431bde82; lVar2 = CONCAT44(local_30[0],(int)lVar4); lVar5 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), local_24 + (uint)CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar10 = (uint)((ulonglong)lVar4 >> 0x20); iVar8 = *(int *)((int)self + 0x350); *(uint *)(entryOffset + 0x18 + iVar8) = (uint)lVar4 >> 0x12 | uVar10 * 0x4000; *(uint *)(entryOffset + 0x1c + iVar8) = uVar10 >> 0x12; menuManager = self; } } else if (iVar8 == 2) { if (local_18 < (uint)(*(int *)((int)menuManager + 0x354) - *(int *)((int)menuManager + 0x350) >> 5)) { timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar10 * 0x431bde82; local_28 = (int)lVar3; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_24 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); iVar8 = *(int *)((int)self + 0x350); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar10 = (uint)lVar3 >> 0x12 | uVar9 * 0x4000; lastRequestTime = (uint *)(entryOffset + 0x18 + iVar8); local_30[0] = ((uVar9 >> 0x12) - *(int *)(entryOffset + 0x1c + iVar8)) - (uint)(uVar10 < *lastRequestTime); lVar2 = CONCAT44(local_30[0],local_28); if ((local_30[0] != 0) || (menuManager = self, 5000 < uVar10 - *lastRequestTime)) { iVar8 = *(int *)(entryOffset + 0xc + iVar8); if ((iVar8 != 0) && (pvVar7 = (void *)__RTDynamicCast(iVar8,0,&KAGE::Network::Multiplayer:: LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbySteam:: RTTI_Type_Descriptor), pvVar7 != (void *)0x0)) { KAGE::Network::Multiplayer::LobbySteam::request_lobby_data (pvVar7,(void *)0x0,(void *)0x0); } timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar10 * 0x431bde82; lVar2 = CONCAT44(local_30[0],(int)lVar4); lVar5 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), local_24 + (uint)CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar10 = (uint)((ulonglong)lVar4 >> 0x20); iVar8 = *(int *)((int)self + 0x350); *(uint *)(entryOffset + 0x18 + iVar8) = (uint)lVar4 >> 0x12 | uVar10 * 0x4000; *(uint *)(entryOffset + 0x1c + iVar8) = uVar10 >> 0x12; menuManager = self; } } else { timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar10 * 0x431bde82; local_28 = (int)lVar3; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_24 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); iVar8 = *(int *)((int)self + 0x35c); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar10 = (uint)lVar3 >> 0x12 | uVar9 * 0x4000; lastRequestTime = (uint *)((int)local_14 + 0x10 + iVar8); local_30[0] = ((uVar9 >> 0x12) - *(int *)((int)local_14 + 0x14 + iVar8)) - (uint)(uVar10 < *lastRequestTime); lVar2 = CONCAT44(local_30[0],local_28); if ((local_30[0] != 0) || (menuManager = self, 5000 < uVar10 - *lastRequestTime)) { iVar8 = *(int *)((int)local_14 + 4 + iVar8); if ((iVar8 != 0) && (pvVar7 = (void *)__RTDynamicCast(iVar8,0,&KAGE::Network::Multiplayer:: LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbySteam:: RTTI_Type_Descriptor), pvVar7 != (void *)0x0)) { KAGE::Network::Multiplayer::LobbySteam::request_lobby_data (pvVar7,(void *)0x0,(void *)0x0); } timeNs = GetTimeNs(); uVar10 = (uint)(timeNs >> 0x20); lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_24 = (int)((ulonglong)lVar3 >> 0x20); lVar2 = (ulonglong)uVar10 * 0x431bde82; lVar4 = (ulonglong)uVar10 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar2 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_24 + (uint)CARRY4((uint)lVar3,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar3) >> 0x20)); uVar10 = (uint)((ulonglong)lVar3 >> 0x20); iVar6 = local_18 - (*(int *)((int)self + 0x354) - *(int *)((int)self + 0x350) >> 5); iVar8 = *(int *)((int)self + 0x35c); *(uint *)(iVar8 + 0x10 + iVar6 * 0x18) = (uint)lVar3 >> 0x12 | uVar10 * 0x4000; *(uint *)(iVar8 + 0x14 + iVar6 * 0x18) = uVar10 >> 0x12; menuManager = self; } } } else { KAGE_LogMessage(0x10,(byte *)"Unhandled scope type (%d) in Menu Lobby List \n"); lVar2 = CONCAT44(local_30[0],local_28); } local_28 = (int)lVar2; local_1c = (float)((int)local_1c + 1); entryOffset = entryOffset + 0x20; local_18 = local_18 + 1; local_14 = (float)((int)local_14 + 0x18); } while ((uint)local_1c < 9); } } local_30[0] = 0xf; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,local_30,0,0); menuManager = g_menuManager; if (isTriggered != '\0') { pvVar7 = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)pvVar7 - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { pvVar7 = (void *)((int)pvVar7 + -4); (g_menuManager->_menuStateHistory)._end = pvVar7; } MenuManager::SetState(menuManager,*(int *)((int)pvVar7 + -4),0); Menu_OnlineLobby::update_list_cursor(); return; } local_30[0] = 0x1c; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,local_30,0,0); if (isTriggered != '\0') { savedScope = *(undefined4 *)&g_manager->_lobbySettings; LobbySettings::reset(&g_manager->_lobbySettings); *(undefined4 *)&g_manager->_lobbySettings = savedScope; MenuManager::push_menu(0x15,unused); Menu_OnlineLobby::update_list_cursor(); return; } local_30[0] = 0x19; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,local_30,0,0); if (isTriggered != '\0') { *(undefined1 *)((int)menuManager + 0x4ac) = 1; *(undefined4 **)((int)menuManager + 0x4b0) = (undefined4 *)((int)menuManager + 0x4e8); *(undefined4 *)((int)menuManager + 0x4b4) = *(undefined4 *)((int)menuManager + 0x4e8); *(undefined4 *)((int)menuManager + 0x4b8) = *(undefined4 *)((int)menuManager + 0x4ec); *(undefined4 *)((int)menuManager + 0x4bc) = *(undefined4 *)((int)menuManager + 0x4f0); *(undefined4 *)((int)menuManager + 0x4c0) = *(undefined4 *)((int)menuManager + 0x4f4); *(undefined8 *)((int)menuManager + 0x4c4) = *(undefined8 *)((int)menuManager + 0x4f8); Menu_OnlineLobby::update_list_cursor(); return; } if (*(int *)&g_manager->_lobbySettings != 1) { local_30[0] = 0x1d; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,local_30,0,0); if (isTriggered != '\0') { FUN_0040c2f0(); *(undefined1 *)((int)menuManager + 0x500) = 1; } } LAB_008ddac2: Menu_OnlineLobby::update_list_cursor(); return; } //@@ 008ddae0 Menu_OnlineLobby::Render /* DB: strings LobbyList, RefreshButton/FiltersButton/CreateButton Position, EnterPasswordPaper, "Unhandled scope type (%d) in Menu Lobby List"; called from MenuManager::Render 0098a040 prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::Render(void *this) { ulonglong uVar1; longlong lVar2; longlong lVar3; longlong lVar4; ColorMod color; undefined1 auVar5 [32]; ColorMod color_00; ColorMod color_01; Vector pos; Vector pos_00; Vector pos_01; Vector pos_02; undefined1 *puVar6; int iVar7; LayerState *layer; float *nullFrame; void *pvVar8; byte *loadingText; uint uVar9; uint uVar10; bool isKeyboard; ulonglong timeNs; double dVar11; Vector scale; Vector scale_00; Vector scale_01; Vector scale_02; Vector pos_03; Vector local_78; Vector local_70; undefined4 local_64; undefined4 local_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; float local_34; float *local_30; float originY; float originX; byte isPasswordPaperVisible; byte isLayerVisible; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; AnimationState *animState; Font *font; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0622d; local_1c = ExceptionList; ExceptionList = &local_1c; local_70.x = (g_menuManager->_ViewPosition).x + *(float *)this; local_70.y = (g_menuManager->_ViewPosition).y + *(float *)((int)this + 4); local_30 = *(float **)&g_manager->_lobbySettings; isPasswordPaperVisible = local_30 != (float *)0x1; local_78.y = (float)this; originY = local_70.y; originX = local_70.x; puVar6 = (undefined1 *)((int)register0x00000010 + -4); if ((*(int *)((int)this + 0x3c) != 0) && ((puVar6 = (undefined1 *)((int)register0x00000010 + -4), 2 < *(int *)(*(int *)((int)this + 0x38) + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), puVar6 = puStack_20, 2 < *(int *)(*(int *)((int)this + 0x38) + 0x80))))) { puStack_20 = puVar6; iVar7 = *(int *)((int)this + 0x3c); local_34 = *(float *)(iVar7 + 0x40); if ((iVar7 == 0) || (((int)local_34 < 0 || (*(int *)(iVar7 + 0x1c) <= (int)local_34)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)((int)this + 0x40) + (int)local_34 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)((int)this + 0x38),(int)local_34,(float)(int)local_30); puVar6 = puStack_20; } puStack_20 = puVar6; if (*(char *)((int)this + 0x344) == '\0') { iVar7 = (*(int *)((int)this + 0x360) - *(int *)((int)this + 0x35c)) / 0x18 + (*(int *)((int)this + 0x354) - *(int *)((int)this + 0x350) >> 5); local_34 = (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) / 9.0; dVar11 = ceil((double)local_34); local_34 = (float)dVar11; isLayerVisible = 1; if ((int)dVar11 < 2) goto LAB_008ddc52; } else { LAB_008ddc52: isLayerVisible = 0; } layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"ArrowUp"); layer->_visible = isLayerVisible; if (*(char *)((int)this + 0x344) == '\0') { iVar7 = *(int *)((int)this + 0x354) - *(int *)((int)this + 0x350); local_34 = (float)((double)(iVar7 >> 5) + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) / 9.0; dVar11 = ceil((double)local_34); local_34 = (float)dVar11; isLayerVisible = 1; if ((uint)((int)dVar11 + (*(int *)((int)this + 0x360) - *(int *)((int)this + 0x35c)) / 0x18) < 2 ) goto LAB_008ddce7; } else { LAB_008ddce7: isLayerVisible = 0; } layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"ArrowDown"); isKeyboard = g_menuControllerIndex == 0; layer->_visible = isLayerVisible; isLayerVisible = isKeyboard; layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"CreateButton"); layer->_visible = isLayerVisible; layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"RefreshButton"); layer->_visible = isLayerVisible; layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"FiltersButton"); layer->_visible = isLayerVisible; layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"BackButton"); layer->_visible = isLayerVisible; if (((local_30 == (float *)0x1) || (g_menuControllerIndex != 0)) || (*(char *)((int)this + 0x500) != '\0')) { layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"EnterPasswordButton"); layer->_visible = 0; if (local_30 != (float *)0x1) goto LAB_008ddd97; LAB_008ddda4: isLayerVisible = 0; } else { layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"EnterPasswordButton"); layer->_visible = 1; LAB_008ddd97: isLayerVisible = 1; if (*(char *)((int)this + 0x500) != '\0') goto LAB_008ddda4; } layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"EnterPasswordText"); layer->_visible = isLayerVisible; layer = ANM2::GetLayer((ANM2 *)((int)this + 8),(byte *)"EnterPasswordPaper"); layer->_visible = isPasswordPaperVisible; if (*(char *)((int)this + 0x111) != '\0') { if (*(char *)((int)this + 0x78) == '\0') { AnimationState::Render ((AnimationState *)((int)this + 0x38),&local_70,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)((int)this + 0x58),&local_70,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render ((AnimationState *)((int)this + 0x58),&local_70,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)((int)this + 0x38),&local_70,&g_vectorZero,&g_vectorZero); } originX = local_70.x; originY = local_70.y; } if (g_menuControllerIndex != 0) { animState = (AnimationState *)((int)this + 0x38); if (*(int *)((int)this + 0x3c) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"CreateButton Position"); } scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; local_70.y = nullFrame[1] + originY; local_70.x = *nullFrame + originX; local_60 = 0; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; pos.y = local_70.y; pos.x = local_70.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x1c,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); if (*(int *)((int)this + 0x3c) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"RefreshButton Position"); } local_70.y = originY + nullFrame[1]; scale_00.y = g_vectorOne.y; scale_00.x = g_vectorOne.x; local_70.x = originX + *nullFrame; auVar5 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))); color._offset[0] = (float)local_60; color._tint[0] = (float)auVar5._0_4_; color._tint[1] = (float)auVar5._4_4_; color._tint[2] = (float)auVar5._8_4_; color._tint[3] = (float)auVar5._12_4_; color._colorize[0] = (float)auVar5._16_4_; color._colorize[1] = (float)auVar5._20_4_; color._colorize[2] = (float)auVar5._24_4_; color._colorize[3] = (float)auVar5._28_4_; color._offset[1] = (float)local_60; color._offset[2] = 0.0; pos_00.y = local_70.y; pos_00.x = local_70.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x18,0,1,color,pos_00,scale_00); if (*(int *)((int)this + 0x3c) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"FiltersButton Position"); } local_70.y = originY + nullFrame[1]; scale_01.y = g_vectorOne.y; scale_01.x = g_vectorOne.x; local_70.x = originX + *nullFrame; auVar5 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))); color_00._offset[0] = (float)local_60; color_00._tint[0] = (float)auVar5._0_4_; color_00._tint[1] = (float)auVar5._4_4_; color_00._tint[2] = (float)auVar5._8_4_; color_00._tint[3] = (float)auVar5._12_4_; color_00._colorize[0] = (float)auVar5._16_4_; color_00._colorize[1] = (float)auVar5._20_4_; color_00._colorize[2] = (float)auVar5._24_4_; color_00._colorize[3] = (float)auVar5._28_4_; color_00._offset[1] = (float)local_60; color_00._offset[2] = 0.0; pos_01.y = local_70.y; pos_01.x = local_70.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x19,0,1,color_00,pos_01,scale_01); if (*(int *)((int)this + 0x3c) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"BackButton Postion"); } local_70.y = originY + nullFrame[1]; scale_02.y = g_vectorOne.y; scale_02.x = g_vectorOne.x; local_70.x = originX + *nullFrame; auVar5 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))); color_01._offset[0] = (float)local_60; color_01._tint[0] = (float)auVar5._0_4_; color_01._tint[1] = (float)auVar5._4_4_; color_01._tint[2] = (float)auVar5._8_4_; color_01._tint[3] = (float)auVar5._12_4_; color_01._colorize[0] = (float)auVar5._16_4_; color_01._colorize[1] = (float)auVar5._20_4_; color_01._colorize[2] = (float)auVar5._24_4_; color_01._colorize[3] = (float)auVar5._28_4_; color_01._offset[1] = (float)local_60; color_01._offset[2] = 0.0; pos_02.y = local_70.y; pos_02.x = local_70.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0xf,0,1,color_01,pos_02,scale_02); if ((*(char *)((int)this + 0x500) == '\0') && (local_30 != (float *)0x1)) { if (*(int *)((int)this + 0x3c) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"EnterPasswordButton Postion"); } local_70.y = originY + nullFrame[1]; local_70.x = originX + *nullFrame; pos_03.y = local_70.y; pos_03.x = local_70.x; render_input_button_icon (g_menuControllerIndex,0x1d,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_03); } } if (*(int *)((int)this + 0x3c) == 0) { pvVar8 = (void *)0x0; local_30 = (float *)0x0; } else { local_30 = AnimationState::GetNullFrame((AnimationState *)((int)this + 0x38),(byte *)"Loading"); if (*(int *)((int)this + 0x3c) == 0) { pvVar8 = (void *)0x0; } else { pvVar8 = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x38),(byte *)"LobbyList"); } } lVar4 = CONCAT44(local_70.y,local_34); if ((local_30 != (float *)0x0) && (pvVar8 != (void *)0x0)) { if (*(char *)((int)this + 0x344) == '\0') { timeNs = GetTimeNs(); this = (void *)local_78.y; uVar9 = (uint)(timeNs >> 0x20); uVar1 = (timeNs & 0xffffffff) * 0xd7b634db; local_70.x = (float)uVar1; lVar2 = (timeNs & 0xffffffff) * 0x431bde82; local_64 = (undefined4)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar9 * 0xd7b634db; local_48 = (undefined4)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar9 * 0x431bde82; local_70.y = (float)((ulonglong)lVar4 >> 0x20); local_34 = (float)lVar4; uVar1 = lVar3 + (uVar1 >> 0x20); uVar10 = (uint)(uVar1 >> 0x20); lVar2 = lVar2 + (uVar1 & 0xffffffff); local_50 = (undefined4)lVar2; uVar9 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar10,uVar9),uVar10 + uVar9); uVar9 = (uint)((ulonglong)lVar2 >> 0x20); uVar10 = (uint)lVar2 >> 0x12 | uVar9 * 0x4000; pvVar8 = (void *)(((uVar9 >> 0x12) - *(int *)((int)local_78.y + 0x34c)) - (uint)(uVar10 < *(uint *)((int)local_78.y + 0x348))); if ((pvVar8 != (void *)0x0) || (999 < uVar10 - *(uint *)((int)local_78.y + 0x348))) { iVar7 = *(int *)&g_manager->_lobbySettings; local_78.y = (float)pvVar8; if (iVar7 == 0) { render_lobby_list(this); } else if (iVar7 == 1) { render_lobby_list(this); } else if (iVar7 == 2) { Menu_LobbyList::render_lobbies(); } else { KAGE_LogMessage(0x10,(byte *)"Unhandled scope type (%d) in Menu Lobby List \n"); } goto LAB_008de313; } } local_70.y = (float)((ulonglong)lVar4 >> 0x20); local_34 = (float)lVar4; local_60 = 1; uStack_5c = 0xffff; uStack_58 = 0; font = &g_manager->_font2_TeamMeatEx12; uStack_54 = 0x3f800000; local_50 = 0xffffffff; local_4c = 0; local_48 = 0; local_14 = 0; local_78.x = originX + *local_30; local_78.y = originY + local_30[1]; loadingText = string_table_translate(&g_manager->_stringTable,(byte *)"#LOADING"); Font::DrawString(font,loadingText,&local_78,(Vector *)(local_30 + 4), (KColor *)((int)this + 0x374),&local_60); local_14 = 0xffffffff; } LAB_008de313: if (*(char *)((int)this + 0x500) != '\0') { if (*(int *)((int)this + 0x3c) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x38),(byte *)"Password Position"); } local_78.x = *nullFrame + originX; local_78.y = nullFrame[1] + originY; lobby_password_render(&(g_manager->_lobbySettings)._password,&local_78,1.0); } if (*(char *)((int)this + 0x4ac) != '\0') { render_player_slots((void *)((int)this + 0x388)); } ExceptionList = local_1c; return; } //@@ 008de3a0 Menu_OnlineLobbyList::reset /* DB: MenuManager::SetState case 0x12 (FRIENDLOBBIES) and Menu_OnlineLobbyList::Update: Idle/Cursor anims, ArrowUp/ArrowDown layers, "Unhandled scope type (%d) in Menu Lobby List" */ void Menu_OnlineLobbyList::reset(void) { longlong lVar1; longlong lVar2; byte bVar3; byte *curAnimChar; uint uVar4; LayerState *arrowLayer; void *in_ECX; byte *idleNameChar; char *cursorNameChar; bool isLess; ulonglong timeNs; byte *animData; int lobbyScope; Manager *manager; FUN_008e3100(); *(undefined4 *)((int)in_ECX + 0x354) = *(undefined4 *)((int)in_ECX + 0x350); FUN_008e3070(); *(undefined4 *)((int)in_ECX + 0x360) = *(undefined4 *)((int)in_ECX + 0x35c); animData = *(byte **)((int)in_ECX + 0x3c); if (animData == (byte *)0x0) { LAB_008de435: bVar3 = ANM2::SetAnimation((ANM2 *)((int)in_ECX + 8),s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)in_ECX + 0x38)); *(undefined1 *)((int)in_ECX + 0x4c) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } idleNameChar = s_Idle; do { bVar3 = *curAnimChar; isLess = bVar3 < *idleNameChar; if (bVar3 != *idleNameChar) { LAB_008de422: uVar4 = -(uint)isLess | 1; goto LAB_008de427; } if (bVar3 == 0) break; bVar3 = curAnimChar[1]; isLess = bVar3 < idleNameChar[1]; if (bVar3 != idleNameChar[1]) goto LAB_008de422; curAnimChar = curAnimChar + 2; idleNameChar = idleNameChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008de427: if ((uVar4 != 0) || ((animData[0x34] != 0 && (*(char *)((int)in_ECX + 0x4c) == '\0')))) goto LAB_008de435; } animData = *(byte **)((int)in_ECX + 0x150); if (animData == (byte *)0x0) { LAB_008de4a6: bVar3 = ANM2::SetAnimation((ANM2 *)((int)in_ECX + 0x11c),(byte *)"Cursor",1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)in_ECX + 0x14c)); *(undefined1 *)((int)in_ECX + 0x160) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } cursorNameChar = "Cursor"; do { bVar3 = *curAnimChar; isLess = bVar3 < (byte)*cursorNameChar; if (bVar3 != *cursorNameChar) { LAB_008de490: uVar4 = -(uint)isLess | 1; goto LAB_008de495; } if (bVar3 == 0) break; bVar3 = curAnimChar[1]; isLess = bVar3 < (byte)cursorNameChar[1]; if (bVar3 != cursorNameChar[1]) goto LAB_008de490; curAnimChar = curAnimChar + 2; cursorNameChar = cursorNameChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008de495: if ((uVar4 != 0) || ((animData[0x34] != 0 && (*(char *)((int)in_ECX + 0x160) == '\0')))) goto LAB_008de4a6; } *(undefined1 *)((int)in_ECX + 0x344) = 1; timeNs = GetTimeNs(); uVar4 = (uint)(timeNs >> 0x20); lVar1 = (timeNs & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar4 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)((int)in_ECX + 0x348) = (uint)lVar1 >> 0x12 | uVar4 * 0x4000; *(uint *)((int)in_ECX + 0x34c) = uVar4 >> 0x12; *(undefined4 *)((int)in_ECX + 0x368) = 0; *(undefined4 *)((int)in_ECX + 0x36c) = 0; *(undefined4 *)((int)in_ECX + 0x370) = 0; arrowLayer = ANM2::GetLayer((ANM2 *)((int)in_ECX + 8),(byte *)"ArrowUp"); arrowLayer->_visible = 0; arrowLayer = ANM2::GetLayer((ANM2 *)((int)in_ECX + 8),(byte *)"ArrowDown"); manager = g_manager; arrowLayer->_visible = 0; *(bool *)((int)in_ECX + 0x4d9) = *(int *)&manager->_lobbySettings != 0; *(bool *)((int)in_ECX + 0x4f1) = *(int *)&manager->_lobbySettings != 0; animData = *(byte **)((int)in_ECX + 0x3c0); if (animData == (byte *)0x0) { LAB_008de5fd: bVar3 = ANM2::SetAnimation((ANM2 *)((int)in_ECX + 0x38c),s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)((int)in_ECX + 0x3bc)); *(undefined1 *)((int)in_ECX + 0x3d0) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } idleNameChar = s_Idle; do { bVar3 = *curAnimChar; isLess = bVar3 < *idleNameChar; if (bVar3 != *idleNameChar) { LAB_008de5e7: uVar4 = -(uint)isLess | 1; goto LAB_008de5ec; } if (bVar3 == 0) break; bVar3 = curAnimChar[1]; isLess = bVar3 < idleNameChar[1]; if (bVar3 != idleNameChar[1]) goto LAB_008de5e7; curAnimChar = curAnimChar + 2; idleNameChar = idleNameChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_008de5ec: if ((uVar4 != 0) || ((animData[0x34] != 0 && (*(char *)((int)in_ECX + 0x3d0) == '\0')))) goto LAB_008de5fd; } manager = g_manager; *(undefined4 *)((int)in_ECX + 0x4a0) = 0; *(undefined4 *)((int)in_ECX + 0x4b0) = 0; lobbyScope = *(int *)&manager->_lobbySettings; if (lobbyScope == 0) { LAB_008de680: request_lobby_list(in_ECX); return; } if (lobbyScope == 2) { if (*(char *)((int)in_ECX + 0x4e5) != '\0') goto LAB_008de680; } else if (lobbyScope == 1) { FUN_008e18b0(); return; } KAGE_LogMessage(0x10,(byte *)"Unhandled scope type (%d) in Menu Lobby List \n"); return; } //@@ 008de690 Menu_OnlineLobbyList::update_password_entry /* DB: ? from Menu_OnlineLobbyList::Update when +0x500 set (before update_list_cursor); edits a <8 char buffer at Manager+0x4b108/+0x4b118, "lobby_password", Multiplayer::set_service_provider prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobbyList::update_password_entry(void *password) { void *pvVar1; undefined1 *puVar2; char isKeyTriggered; std_string *psVar3; char *pcVar4; std_string *password; undefined1 searchQuery [8]; undefined4 local_64; undefined1 local_60 [4]; undefined4 local_5c; undefined1 local_54 [12]; undefined4 local_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined8 local_38; undefined4 local_30; undefined4 confirmAction; undefined4 *local_28; void *menu; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; char *copyCursor; byte *keyText; Manager *manager; uint newSize; uint *passwordSize; int serviceProvider; manager = g_manager; puStack_20 = local_54 + 0x50; local_14 = 0xffffffff; puStack_18 = &LAB_00b0625d; local_1c = ExceptionList; ExceptionList = &local_1c; password = &(g_manager->_lobbySettings)._password; passwordSize = &(g_manager->_lobbySettings)._password._size; menu = password; puVar2 = local_54 + 0x50; if ((g_manager->_lobbySettings)._password._size < 8) { local_28 = (undefined4 *)0x57; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0,FUN_00a207d0,&local_28,0,0,__security_cookie ^ (uint)(local_54 + 0x44)); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x41; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x53; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x44; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x109; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x107; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x108; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if (isKeyTriggered == '\0') { local_28 = (undefined4 *)0x106; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); puVar2 = puStack_20; if (isKeyTriggered == '\0') goto LAB_008de88b; keyText = &DAT_00b6312c; } else { keyText = &DAT_00b63160; } } else { keyText = &DAT_00b6315c; } } else { keyText = &DAT_00b75e80; } } else { keyText = &DAT_00b66140; } } else { keyText = &DAT_00b6614c; } } else { keyText = &DAT_00b656e8; } } else { keyText = &DAT_00b75e7c; } std::string::append(password->_buf,keyText,1); puVar2 = puStack_20; } LAB_008de88b: puStack_20 = puVar2; local_28 = (undefined4 *)0x103; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_28,0,0); if ((isKeyTriggered != '\0') && (*passwordSize != 0)) { newSize = *passwordSize - 1; psVar3 = password; if (0xf < (manager->_lobbySettings)._password._capacity) { psVar3 = *(std_string **)password->_buf; } *passwordSize = newSize; psVar3->_buf[newSize] = '\0'; } confirmAction = 0xe; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&confirmAction,0,0); if (isKeyTriggered == '\0') { local_30 = 0xf; isKeyTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_30,0,0); if (isKeyTriggered == '\0') { ExceptionList = local_1c; return; } if (0xf < (manager->_lobbySettings)._password._capacity) { password = *(std_string **)password->_buf; } *passwordSize = 0; password->_buf[0] = '\0'; } else if (*passwordSize == 8) { FUN_00a53b70(); local_14 = 0; local_64 = 3; if (0xf < (manager->_lobbySettings)._password._capacity) { password = *(std_string **)password->_buf; } local_38 = 0; local_48 = 0; uStack_44 = 0; uStack_40 = 0; uStack_3c = 0; local_28 = (undefined4 *)FUN_00a53e50(&local_30,local_5c,&local_48); local_28 = (undefined4 *)*local_28; pcVar4 = operator_new_tracked(0xf); strncpy(pcVar4,"lobby_password",0xf); *local_28 = pcVar4; if (password == (std_string *)0x0) { pcVar4 = (char *)0x0; } else { psVar3 = password; do { pcVar4 = psVar3->_buf; psVar3 = (std_string *)(psVar3->_buf + 1); } while (*pcVar4 != '\0'); pcVar4 = operator_new_tracked((uint)((int)psVar3 + (1 - (int)(password->_buf + 1)))); psVar3 = password; do { copyCursor = psVar3->_buf; psVar3 = (std_string *)(psVar3->_buf + 1); } while (*copyCursor != '\0'); strncpy(pcVar4,password->_buf,(size_t)((int)psVar3 + (1 - (int)(password->_buf + 1)))); } local_28[4] = 2; local_28[2] = pcVar4; manager = g_manager; local_28[3] = (int)pcVar4 >> 0x1f; serviceProvider = (manager->_optionsConfig)._eosCrossplay; if ((serviceProvider == 2) || (serviceProvider == 3)) { serviceProvider = 3; } else { serviceProvider = 2; } Multiplayer::set_service_provider(serviceProvider); pvVar1 = menu; KAGE::Network::MultiplayerManager::request_lobby_list (&DAT_00c79a50,searchQuery,on_password_search_result,menu); *(undefined1 *)((int)pvVar1 + 0x344) = 1; FUN_00a539f0(); FID_conflict__Tidy(local_54); FID_conflict__Tidy(local_60); menu = pvVar1; } else { if (0xf < (manager->_lobbySettings)._password._capacity) { password = *(std_string **)password->_buf; } *passwordSize = 0; manager = g_manager; password->_buf[0] = '\0'; local_28 = (undefined4 *)0xbb; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); } *(undefined1 *)((int)menu + 0x500) = 0; ExceptionList = local_1c; return; } //@@ 008deac0 Menu_OnlineLobby::render_lobby_list /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "LobbyList" anm, "#Online/NO_FRIEND_LOBBIES", "%d / %d", "Loading", Font::DrawStringScaled; called from lobby menu render 008ddae0 prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::render_lobby_list(void *cursorAnim) { Vector position; char isLastRef; float *pfVar1; byte *text; int *other; undefined4 userIdHigh; int iVar2; int frame; AnimationState *cursorAnim; undefined4 userIdLow; Font *font; undefined1 auStackY_218 [128]; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_182 [2]; undefined1 avatarQuad [112]; undefined8 zeroUserId; int *avatarImage; int *avatarImageRefCount; undefined1 *local_f8; float rowStartX; Vector textPos; undefined **local_e8; int *entryLobby; int *entryLobbyRefCount; int row; undefined4 drawParams; undefined4 local_d4; KColor local_d0; float local_bc; Vector drawPos; float *local_b0; float cursorX; byte countText [132]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = countText + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00b062d5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(countText + 0x98); ExceptionList = &local_1c; cursorX = (g_menuManager->_ViewPosition).x + *(float *)cursorAnim; local_bc = (g_menuManager->_ViewPosition).y + *(float *)((int)cursorAnim + 4); if (*(int *)((int)cursorAnim + 0x3c) == 0) { pfVar1 = (float *)0x0; local_b0 = (float *)0x0; puStack_20 = countText + 0xa4; } else { local_b0 = AnimationState::GetNullFrame((AnimationState *)((int)cursorAnim + 0x38),(byte *)"Loading"); if (*(int *)((int)cursorAnim + 0x3c) == 0) { pfVar1 = (float *)0x0; } else { pfVar1 = AnimationState::GetNullFrame ((AnimationState *)((int)cursorAnim + 0x38),(byte *)"LobbyList"); } } if ((uint)(*(int *)((int)cursorAnim + 0x354) - *(int *)((int)cursorAnim + 0x350)) < 0x20) { drawParams = 1; local_d4 = 0xffff; local_d0._red = 0.0; font = &g_manager->_font2_TeamMeatEx12; local_d0._green = 1.0; local_d0._blue = -NAN; local_d0._alpha = 0.0; local_d0._unk = 0; local_14 = 0; textPos.x = cursorX + *local_b0; textPos.y = local_bc + local_b0[1]; text = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/NO_FRIEND_LOBBIES"); Font::DrawString(font,text,&textPos,(Vector *)(local_b0 + 4),(KColor *)((int)cursorAnim + 0x374), &drawParams); } else { drawPos.x = cursorX + *pfVar1; drawPos.y = local_bc + pfVar1[1]; row = 0; local_bc = (float)(*(int *)((int)cursorAnim + 0x368) * 9); local_b0 = (float *)(*(int *)((int)cursorAnim + 0x368) * 0x120); cursorX = drawPos.x; do { pfVar1 = local_b0; if ((uint)(*(int *)((int)cursorAnim + 0x354) - *(int *)((int)cursorAnim + 0x350) >> 5) <= (uint)local_bc) { ExceptionList = local_1c; return; } local_e8 = KAGE::Network::Multiplayer::ConstLobby::vftable; entryLobby = (int *)0x0; entryLobbyRefCount = (int *)0x0; local_14 = 1; std::shared_ptr::assign (&entryLobby,(void *)(*(int *)((int)cursorAnim + 0x350) + 0xc + (int)local_b0)); local_14 = 2; rowStartX = cursorX; if (row == *(int *)((int)cursorAnim + 0x36c)) { if (*(char *)((int)cursorAnim + 0x225) != '\0') { if (*(char *)((int)cursorAnim + 0x18c) == '\0') { AnimationState::Render ((AnimationState *)((int)cursorAnim + 0x14c),&drawPos,&g_vectorZero,&g_vectorZero); cursorAnim = (AnimationState *)((int)cursorAnim + 0x16c); } else { AnimationState::Render ((AnimationState *)((int)cursorAnim + 0x16c),&drawPos,&g_vectorZero,&g_vectorZero); cursorAnim = (AnimationState *)((int)cursorAnim + 0x14c); } AnimationState::Render(cursorAnim,&drawPos,&g_vectorZero,&g_vectorZero); cursorX = drawPos.x; pfVar1 = local_b0; } local_f8 = auStackY_218 + 0x88; lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_14._0_1_ = 3; std::shared_ptr::assign(auStack_182 + -10,&entryLobby); local_14 = CONCAT31(local_14._1_3_,2); ::render_lobby_info(cursorAnim,lobbyHandleVtable,lobby,lobbyRefCount); } drawPos.y = drawPos.y - 2.0; cursorX = cursorX + 24.0; local_d0._red = 1.0; local_d0._green = 1.0; local_d0._blue = 1.0; local_d0._alpha = 1.0; local_d0._unk = 0; render_quad_set_uniform_color (avatarQuad,cursorX,drawPos.y + 4.0,cursorX + 12.0,drawPos.y + 12.0 + 4.0,&local_d0) ; iVar2 = *(int *)(*(int *)((int)cursorAnim + 0x350) + 4 + (int)pfVar1); if ((iVar2 == 0) || (other = (int *)(iVar2 + 0x14), *other == 0)) { other = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&avatarImage,other); local_14._0_1_ = 4; (**(code **)(*avatarImage + 0x1c))(); local_14._0_1_ = 5; if (((avatarImageRefCount != (int *)0x0) && (isLastRef = (**(code **)(*avatarImageRefCount + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 2; drawPos.x = cursorX + 16.0; font = &g_manager->_font1_TeamMeatEx10; iVar2 = *(int *)(*(int *)((int)cursorAnim + 0x350) + (int)local_b0 + 4); if (iVar2 == 0) { zeroUserId = 0; zeroUserId._4_4_ = 0; zeroUserId._0_4_ = 0; userIdHigh = zeroUserId._4_4_; userIdLow = (undefined4)zeroUserId; } else { userIdHigh = *(undefined4 *)(iVar2 + 0xc); userIdLow = *(undefined4 *)(iVar2 + 8); } cursorX = drawPos.x; text = user_profile_format_display_name(CONCAT44(userIdHigh,userIdLow),font,0x46); drawParams = 0; local_d4 = 0xffff; local_d0._red = 0.0; local_d0._green = 1.0; local_d0._blue = -NAN; local_d0._alpha = 0.0; local_d0._unk = 0; local_14._0_1_ = 6; Font::DrawStringScaled(font,text,&drawPos,(KColor *)((int)cursorAnim + 0x374),&drawParams); local_14._0_1_ = 2; drawPos.x = cursorX + 85.0; cursorX = drawPos.x; if (entryLobby != (int *)0x0) { (**(code **)(*entryLobby + 0x1c))(); } sprintf(countText,(byte *)"%d / %d"); drawParams = 0; local_d4 = 0xffff; local_d0._red = 0.0; local_d0._green = 1.0; local_d0._blue = -NAN; local_d0._alpha = 0.0; local_d0._unk = 0; local_14._0_1_ = 7; Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,countText,&drawPos,(KColor *)((int)cursorAnim + 0x374), &drawParams); local_14 = CONCAT31(local_14._1_3_,2); cursorX = cursorX + 35.0; iVar2 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar2 == 2) || (iVar2 == 3)) { if (entryLobby == (int *)0x0) { iVar2 = 0; } else { iVar2 = (**(code **)(*entryLobby + 4))(); } textPos.x = cursorX + 0.0; textPos.y = drawPos.y + 8.0; frame = 0; if (iVar2 != 2) { frame = iVar2; } position.y = textPos.y; position.x = textPos.x; render_online_icon(frame,position,g_vectorOne.x,g_vectorOne.y); } cursorX = rowStartX; drawPos.x = rowStartX; drawPos.y = drawPos.y + 22.0; local_e8 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 8; if (((entryLobbyRefCount != (int *)0x0) && (isLastRef = (**(code **)(*entryLobbyRefCount + 0xc))(), isLastRef != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } row = row + 1; local_bc = (float)((int)local_bc + 1); local_b0 = (float *)((int)local_b0 + 0x20); } while ((uint)row < 9); } ExceptionList = local_1c; return; } //@@ 008df1d0 Menu_OnlineLobby::render_lobby_list /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: sub-render of the online lobby menu 0x8ddae0 (reached from the menu renderer 0x98a040): LobbyList anim, "#Online/IN_LOBBY", "#Online/NO_PUBLIC_LOBBIES", "%d / %d", Loading prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::render_lobby_list(void *this) { Vector position; char cVar1; float *loadingFrame; byte *translatedText; int iVar2; int iVar3; std_string *psVar4; int iVar5; AnimationState *pAVar6; uint size; float *lobbyListFrame; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_122 [2]; undefined4 local_110; undefined4 local_10c; undefined4 local_108; undefined4 local_104; undefined4 local_100; undefined4 local_fc; undefined4 local_f8; float rowStartX; Vector drawPos; uint lobbyIndex; undefined **lobbyEntryVtable; int *lobbyEntry; int *lobbyEntryRefCount; int local_d8; float local_d4; float *local_d0; Vector rowPos; float cursorX; std_string *stageName [5]; uint local_ac; byte playerCountText [132]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Font *font; puStack_20 = playerCountText + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00b0634a; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(playerCountText + 0x98); ExceptionList = &local_1c; cursorX = (g_menuManager->_ViewPosition).x + *(float *)this; local_d4 = (g_menuManager->_ViewPosition).y + *(float *)((int)this + 4); if (*(int *)((int)this + 0x3c) == 0) { local_d0 = (float *)0x0; lobbyListFrame = (float *)0x0; puStack_20 = playerCountText + 0xa4; } else { loadingFrame = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x38),(byte *)"Loading"); local_d0 = loadingFrame; if (*(int *)((int)this + 0x3c) == 0) { lobbyListFrame = (float *)0x0; } else { lobbyListFrame = AnimationState::GetNullFrame((AnimationState *)((int)this + 0x38),(byte *)"LobbyList"); local_d0 = loadingFrame; } } iVar5 = *(int *)((int)this + 0x360) - *(int *)((int)this + 0x35c); iVar2 = iVar5 >> 0x1f; if (iVar5 / 0x18 + iVar2 == iVar2) { local_110 = 1; local_10c = 0xffff; local_108 = 0; font = &g_manager->_font2_TeamMeatEx12; local_104 = 0x3f800000; local_100 = 0xffffffff; local_fc = 0; local_f8 = 0; local_14 = 0; drawPos.x = cursorX + *local_d0; drawPos.y = local_d4 + local_d0[1]; translatedText = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/NO_PUBLIC_LOBBIES"); Font::DrawString(font,translatedText,&drawPos,(Vector *)(local_d0 + 4), (KColor *)((int)this + 0x374),&local_110); } else { rowPos.x = cursorX + *lobbyListFrame; rowPos.y = local_d4 + lobbyListFrame[1]; lobbyIndex = *(int *)((int)this + 0x368) * 9; local_d0 = (float *)0x0; local_d4 = (float)(*(int *)((int)this + 0x368) * 0xd8); cursorX = rowPos.x; do { if ((uint)((*(int *)((int)this + 0x360) - *(int *)((int)this + 0x35c)) / 0x18) <= lobbyIndex) { ExceptionList = local_1c; return; } lobbyEntryVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyEntry = (int *)0x0; lobbyEntryRefCount = (int *)0x0; local_14 = 1; std::shared_ptr::assign(&lobbyEntry,(void *)((int)local_d4 + 4 + *(int *)((int)this + 0x35c))) ; local_14 = 2; rowStartX = cursorX; if (local_d0 == (float *)*(uint *)((int)this + 0x36c)) { if (*(char *)((int)this + 0x225) != '\0') { if (*(char *)((int)this + 0x18c) == '\0') { AnimationState::Render ((AnimationState *)((int)this + 0x14c),&rowPos,&g_vectorZero,&g_vectorZero); pAVar6 = (AnimationState *)((int)this + 0x16c); } else { AnimationState::Render ((AnimationState *)((int)this + 0x16c),&rowPos,&g_vectorZero,&g_vectorZero); pAVar6 = (AnimationState *)((int)this + 0x14c); } AnimationState::Render(pAVar6,&rowPos,&g_vectorZero,&g_vectorZero); cursorX = rowPos.x; } lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_14._0_1_ = 3; std::shared_ptr::assign(auStack_122 + -10,&lobbyEntry); local_14 = CONCAT31(local_14._1_3_,2); ::render_lobby_info(this,lobbyHandleVtable,lobby,lobbyRefCount); } rowPos.x = cursorX + 20.0; if (lobbyEntry == (int *)0x0) { iVar2 = 0; } else { iVar2 = (**(code **)(*lobbyEntry + 0x30))(); } pAVar6 = (AnimationState *)((int)this + 0x260); if (*(int *)((int)this + 0x264) != 0) { AnimationState::SetFrameFloat(pAVar6,(float)iVar2); } if (*(char *)((int)this + 0x339) != '\0') { if (*(char *)((int)this + 0x2a0) == '\0') { AnimationState::Render(pAVar6,&rowPos,&g_vectorZero,&g_vectorZero); pAVar6 = (AnimationState *)((int)this + 0x280); } else { AnimationState::Render ((AnimationState *)((int)this + 0x280),&rowPos,&g_vectorZero,&g_vectorZero); } AnimationState::Render(pAVar6,&rowPos,&g_vectorZero,&g_vectorZero); } rowPos.x = rowPos.x + 18.0; rowPos.y = rowPos.y + 4.0; cursorX = rowPos.x; if (lobbyEntry == (int *)0x0) { iVar2 = 0; LAB_008df663: iVar5 = 0; LAB_008df66d: iVar3 = 0; } else { iVar2 = (**(code **)(*lobbyEntry + 0x30))(); if (lobbyEntry == (int *)0x0) goto LAB_008df663; iVar5 = (**(code **)(*lobbyEntry + 0x30))(); local_d8 = iVar5; if (lobbyEntry == (int *)0x0) goto LAB_008df66d; iVar3 = (**(code **)(*lobbyEntry + 0x30))(); iVar5 = local_d8; } local_110 = 3; local_10c = 0x50ffff; local_108 = 1; local_100 = 0xffffffff; local_fc = 0; local_f8 = 0; local_14._0_1_ = 4; local_104 = 0x3f333333; if (iVar2 == 0) { font = &g_manager->_font1_TeamMeatEx10; translatedText = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/IN_LOBBY") ; Font::DrawStringScaled(font,translatedText,&rowPos,(KColor *)((int)this + 0x374),&local_110) ; } else if (iVar2 == 0x3e9) { font = &g_manager->_font1_TeamMeatEx10; translatedText = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/IN_DEATHMATCH"); Font::DrawStringScaled(font,translatedText,&rowPos,(KColor *)((int)this + 0x374),&local_110) ; } else { Level::get_stage_display_name((std_string *)stageName,iVar2,iVar5,0,0,0,(uint)(1 < iVar3)); local_14._0_1_ = 5; psVar4 = (std_string *)stageName; if (0xf < local_ac) { psVar4 = stageName[0]; } Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,(byte *)psVar4,&rowPos, (KColor *)((int)this + 0x374),&local_110); local_14._0_1_ = 4; if (0xf < local_ac) { size = local_ac + 1; psVar4 = stageName[0]; if (0xfff < size) { psVar4 = (std_string *)stageName[0][-1]._capacity; size = local_ac + 0x24; if ((byte *)0x1f < (byte *)((int)stageName[0] + (-4 - (int)psVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar4,size); } } rowPos.x = cursorX + 80.0; cursorX = rowPos.x; if (lobbyEntry != (int *)0x0) { (**(code **)(*lobbyEntry + 0x1c))(); } sprintf(playerCountText,(byte *)"%d / %d"); Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,playerCountText,&rowPos, (KColor *)((int)this + 0x374),&local_110); cursorX = cursorX + 35.0; iVar2 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar2 == 2) || (iVar2 == 3)) { if (lobbyEntry == (int *)0x0) { iVar2 = 0; } else { iVar2 = (**(code **)(*lobbyEntry + 4))(); } drawPos.x = cursorX + 0.0; drawPos.y = rowPos.y + 4.0; iVar5 = 0; if (iVar2 != 2) { iVar5 = iVar2; } position.y = drawPos.y; position.x = drawPos.x; render_online_icon(iVar5,position,g_vectorOne.x,g_vectorOne.y); } rowPos.y = rowPos.y + 16.0; cursorX = rowStartX; rowPos.x = rowStartX; lobbyEntryVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 6; if (((lobbyEntryRefCount != (int *)0x0) && (cVar1 = (**(code **)(*lobbyEntryRefCount + 0xc))(), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } lobbyIndex = lobbyIndex + 1; local_d0 = (float *)((int)local_d0 + 1); local_d4 = (float)((int)local_d4 + 0x18); } while (local_d0 < 9); } ExceptionList = local_1c; return; } //@@ 008df9b0 Menu_LobbyList::render_lobbies /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from the lobby-list menu render 008ddae0 Menu_OnlineLobby::Render after "Unhandled scope type (%d) in Menu Lobby List"; "LobbyList" layer, "#Online/IN_LOBBY"/IN_DEATHMATCH/NO_LOBBIES, "%d / %d", current_stage/lobby_mode fields, Font::DrawStringScaled */ void Menu_LobbyList::render_lobbies(void) { Vector position; Vector position_00; char isLastRef; float *loadingFrame; byte *pbVar1; int *other; undefined4 uVar2; int iVar3; int iVar4; float *in_ECX; uint uVar5; KColor *color; undefined4 uVar6; AnimationState *animState; float *lobbyListFrame; Font *font; float fVar7; float fVar8; undefined1 auStackY_250 [128]; undefined **ppuVar9; void *pvVar10; void *pvVar11; undefined1 auStack_1ba [2]; undefined1 quad [116]; undefined1 *local_13c; undefined1 *local_138; Vector iconPos; int *image; int *imageRefCount; uint entryEnd; undefined8 local_120; int row; Vector textPos; int *lobbyImpl; int *lobbyCtrl; uint entryIndex; undefined4 fontSettings; undefined4 local_f8; int local_f4; undefined4 local_f0; undefined4 local_ec; int local_e8; int local_e4; undefined **otherLobby; int *otherLobbyImpl; int *otherLobbyCtrl; float local_d4; float *local_d0; Vector drawPos; float cursorX; undefined1 local_c0 [20]; uint local_ac; byte countText [132]; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = countText + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00b0640f; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(countText + 0x98); ExceptionList = &local_1c; fVar7 = (g_menuManager->_ViewPosition).x + *in_ECX; local_d4 = (g_menuManager->_ViewPosition).y + in_ECX[1]; if (in_ECX[0xf] == 0.0) { local_d0 = (float *)0x0; lobbyListFrame = (float *)0x0; puStack_20 = countText + 0xa4; } else { loadingFrame = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0xe),(byte *)"Loading"); local_d0 = loadingFrame; if (in_ECX[0xf] == 0.0) { lobbyListFrame = (float *)0x0; } else { lobbyListFrame = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0xe),(byte *)"LobbyList"); local_d0 = loadingFrame; } } local_14 = ((int)in_ECX[0xd8] - (int)in_ECX[0xd7]) / 0x18; if ((local_14 == 0) && ((uint)((int)in_ECX[0xd5] - (int)in_ECX[0xd4]) < 0x20)) { fontSettings = 1; local_f8 = 0xffff; font = &g_manager->_font2_TeamMeatEx12; local_f0 = 0x3f800000; local_ec = 0xffffffff; textPos.x = fVar7 + *local_d0; textPos.y = local_d4 + local_d0[1]; local_f4 = local_14; local_e8 = local_14; local_e4 = local_14; pbVar1 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/NO_LOBBIES"); Font::DrawString(font,pbVar1,&textPos,(Vector *)(local_d0 + 4),(KColor *)(in_ECX + 0xdd), &fontSettings); } else { drawPos.x = fVar7 + *lobbyListFrame; drawPos.y = local_d4 + lobbyListFrame[1]; entryIndex = (int)in_ECX[0xda] * 9; entryEnd = local_14 + ((int)in_ECX[0xd5] - (int)in_ECX[0xd4] >> 5); local_d0 = (float *)((int)in_ECX[0xda] * 0x120); row = 0; cursorX = drawPos.x; while (iVar3 = row, entryIndex < entryEnd) { uVar5 = (int)in_ECX[0xd5] - (int)in_ECX[0xd4] >> 5; if (entryIndex < uVar5) { lobbyImpl = (int *)0x0; lobbyCtrl = (int *)0x0; local_14 = 1; std::shared_ptr::assign(&lobbyImpl,(void *)((int)in_ECX[0xd4] + (int)local_d0 + 0xc)); local_14 = 2; local_d4 = cursorX; if ((float)iVar3 == in_ECX[0xdb]) { if (*(char *)((int)in_ECX + 0x225) != '\0') { if (*(char *)(in_ECX + 99) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x53),&drawPos,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)(in_ECX + 0x5b); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x5b),&drawPos,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)(in_ECX + 0x53); } AnimationState::Render(animState,&drawPos,&g_vectorZero,&g_vectorZero); cursorX = drawPos.x; } local_138 = auStackY_250 + 0x88; ppuVar9 = KAGE::Network::Multiplayer::ConstLobby::vftable; pvVar10 = (void *)0x0; pvVar11 = (void *)0x0; local_14._0_1_ = 3; std::shared_ptr::assign(auStack_1ba + -10,&lobbyImpl); local_14 = CONCAT31(local_14._1_3_,2); render_lobby_info(in_ECX,ppuVar9,pvVar10,pvVar11); } fVar8 = drawPos.y - 2.0; fVar7 = cursorX + 24.0; drawPos.y = fVar8; KColor::SetFromARGB((KColor *)(local_c0 + 4),0xffffffff); render_quad_set_uniform_color(quad,fVar7,fVar8 + 4.0,fVar7 + 12.0,fVar8 + 12.0 + 4.0,color); iVar3 = *(int *)((int)in_ECX[0xd4] + (int)local_d0 + 4); if ((iVar3 == 0) || (other = (int *)(iVar3 + 0x14), *other == 0)) { other = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&image,other); local_14._0_1_ = 4; (**(code **)(*image + 0x1c))(); local_14._0_1_ = 5; if (((imageRefCount != (int *)0x0) && (isLastRef = (**(code **)(*imageRefCount + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 2; fVar7 = cursorX + 24.0 + 16.0; font = &g_manager->_font1_TeamMeatEx10; iVar3 = *(int *)((int)in_ECX[0xd4] + (int)local_d0 + 4); if (iVar3 == 0) { local_120 = 0; local_120._4_4_ = 0.0; local_120._0_4_ = 0; uVar2 = local_120._4_4_; uVar6 = (undefined4)local_120; } else { uVar2 = *(undefined4 *)(iVar3 + 0xc); uVar6 = *(undefined4 *)(iVar3 + 8); } drawPos.x = fVar7; pbVar1 = user_profile_format_display_name(CONCAT44(uVar2,uVar6),font,0x46); fontSettings = 0; local_f8 = 0xffff; local_f4 = 0; local_f0 = 0x3f800000; local_ec = 0xffffffff; local_e8 = 0; local_e4 = 0; local_14._0_1_ = 6; Font::DrawStringScaled(font,pbVar1,&drawPos,(KColor *)(in_ECX + 0xdd),&fontSettings); local_14._0_1_ = 2; fVar7 = fVar7 + 85.0; drawPos.x = fVar7; if (lobbyImpl != (int *)0x0) { (**(code **)(*lobbyImpl + 0x1c))(); } sprintf(countText,(byte *)"%d / %d"); fontSettings = 0; local_f8 = 0xffff; local_f4 = 0; local_f0 = 0x3f800000; local_ec = 0xffffffff; local_e8 = 0; local_e4 = 0; local_14._0_1_ = 7; Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,countText,&drawPos,(KColor *)(in_ECX + 0xdd), &fontSettings); local_14 = CONCAT31(local_14._1_3_,2); iVar3 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar3 == 2) || (iVar3 == 3)) { if (lobbyImpl == (int *)0x0) { iVar3 = 0; } else { iVar3 = (**(code **)(*lobbyImpl + 4))(); } iconPos.x = fVar7 + 35.0 + 0.0; iconPos.y = drawPos.y + 4.0; iVar4 = 0; if (iVar3 != 2) { iVar4 = iVar3; } position.y = iconPos.y; position.x = iconPos.x; render_online_icon(iVar4,position,g_vectorOne.x,g_vectorOne.y); } cursorX = local_d4; drawPos.x = local_d4; drawPos.y = drawPos.y + 22.0; local_14 = 8; if (lobbyCtrl != (int *)0x0) { isLastRef = (**(code **)(*lobbyCtrl + 0xc))(); goto joined_r0x008e0604; } } else { otherLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; otherLobbyImpl = (int *)0x0; otherLobbyCtrl = (int *)0x0; local_14 = 9; std::shared_ptr::assign (&otherLobbyImpl,(void *)((int)in_ECX[0xd7] + (entryIndex - uVar5) * 0x18 + 4)); local_14 = 10; local_120 = CONCAT44(cursorX,(undefined4)local_120); if ((float)iVar3 == in_ECX[0xdb]) { if (*(char *)((int)in_ECX + 0x225) != '\0') { if (*(char *)(in_ECX + 99) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x53),&drawPos,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)(in_ECX + 0x5b); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x5b),&drawPos,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)(in_ECX + 0x53); } AnimationState::Render(animState,&drawPos,&g_vectorZero,&g_vectorZero); cursorX = drawPos.x; } local_13c = auStackY_250 + 0x88; ppuVar9 = KAGE::Network::Multiplayer::ConstLobby::vftable; pvVar10 = (void *)0x0; pvVar11 = (void *)0x0; local_14._0_1_ = 0xb; std::shared_ptr::assign(auStack_1ba + -10,&otherLobbyImpl); local_14 = CONCAT31(local_14._1_3_,10); render_lobby_info(in_ECX,ppuVar9,pvVar10,pvVar11); } drawPos.x = cursorX + 20.0; if (otherLobbyImpl == (int *)0x0) { iVar3 = 0; } else { iVar3 = (**(code **)(*otherLobbyImpl + 0x30))(); } animState = (AnimationState *)(in_ECX + 0x98); if (in_ECX[0x99] != 0.0) { AnimationState::SetFrameFloat(animState,(float)iVar3); } if (*(char *)((int)in_ECX + 0x339) != '\0') { if (*(char *)(in_ECX + 0xa8) == '\0') { AnimationState::Render(animState,&drawPos,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)(in_ECX + 0xa0); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0xa0),&drawPos,&g_vectorZero,&g_vectorZero); } AnimationState::Render(animState,&drawPos,&g_vectorZero,&g_vectorZero); } fVar7 = drawPos.x + 18.0; drawPos.y = drawPos.y + 4.0; drawPos.x = fVar7; if (otherLobbyImpl == (int *)0x0) { iVar3 = 0; LAB_008e030b: fVar8 = 0.0; LAB_008e0315: iVar4 = 0; } else { iVar3 = (**(code **)(*otherLobbyImpl + 0x30))(); if (otherLobbyImpl == (int *)0x0) goto LAB_008e030b; fVar8 = (float)(**(code **)(*otherLobbyImpl + 0x30))(); local_d4 = fVar8; if (otherLobbyImpl == (int *)0x0) goto LAB_008e0315; iVar4 = (**(code **)(*otherLobbyImpl + 0x30))(); fVar8 = local_d4; } fontSettings = 3; local_f8 = 0x50ffff; local_f4 = 1; local_ec = 0xffffffff; local_e8 = 0; local_e4 = 0; local_14._0_1_ = 0xc; local_f0 = 0x3f333333; if (iVar3 == 0) { font = &g_manager->_font1_TeamMeatEx10; pbVar1 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/IN_LOBBY"); Font::DrawStringScaled(font,pbVar1,&drawPos,(KColor *)(in_ECX + 0xdd),&fontSettings); } else if (iVar3 == 0x3e9) { font = &g_manager->_font1_TeamMeatEx10; pbVar1 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/IN_DEATHMATCH"); Font::DrawStringScaled(font,pbVar1,&drawPos,(KColor *)(in_ECX + 0xdd),&fontSettings); } else { Level::get_stage_display_name ((std_string *)local_c0,iVar3,(int)fVar8,0,0,0,(uint)(1 < iVar4)); local_14._0_1_ = 0xd; pbVar1 = local_c0; if (0xf < local_ac) { pbVar1 = (byte *)local_c0._0_4_; } Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,pbVar1,&drawPos,(KColor *)(in_ECX + 0xdd), &fontSettings); local_14._0_1_ = 0xc; if (0xf < local_ac) { uVar5 = local_ac + 1; pbVar1 = (byte *)local_c0._0_4_; if (0xfff < uVar5) { pbVar1 = *(byte **)(local_c0._0_4_ + -4); uVar5 = local_ac + 0x24; if ((byte *)0x1f < (byte *)(local_c0._0_4_ + (-4 - (int)pbVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar1,uVar5); } } fVar7 = fVar7 + 80.0; drawPos.x = fVar7; if (otherLobbyImpl != (int *)0x0) { (**(code **)(*otherLobbyImpl + 0x1c))(); } sprintf(countText,(byte *)"%d / %d"); Font::DrawStringScaled (&g_manager->_font1_TeamMeatEx10,countText,&drawPos,(KColor *)(in_ECX + 0xdd), &fontSettings); iVar3 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar3 == 2) || (iVar3 == 3)) { if (otherLobbyImpl == (int *)0x0) { iVar3 = 0; } else { iVar3 = (**(code **)(*otherLobbyImpl + 4))(); } textPos.x = fVar7 + 35.0 + 0.0; textPos.y = drawPos.y + 4.0; iVar4 = 0; if (iVar3 != 2) { iVar4 = iVar3; } position_00.y = textPos.y; position_00.x = textPos.x; render_online_icon(iVar4,position_00,g_vectorOne.x,g_vectorOne.y); } cursorX = local_120._4_4_; drawPos.x = local_120._4_4_; drawPos.y = drawPos.y + 16.0; otherLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 0xe; if (otherLobbyCtrl != (int *)0x0) { isLastRef = (**(code **)(*otherLobbyCtrl + 0xc))(); joined_r0x008e0604: if ((isLastRef != '\0') && (g_lobbyReleaseFn != (code *)0x0)) { (*g_lobbyReleaseFn)(); } } } row = row + 1; local_d0 = (float *)((int)local_d0 + 0x20); entryIndex = entryIndex + 1; if (8 < (uint)row) { ExceptionList = local_1c; return; } } } ExceptionList = local_1c; return; } //@@ 008e0660 render_lobby_info /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? online lobby panel: '%d / %d Players', '#Online/IN_LOBBY', lobby_mode/lobby_tag/game_difficulty/current_stage, LobbyInfoTextPos, Font::DrawStringScaled; 3 lobby-menu callers prototype: db/protos.zhl, confirmed by RET 12 */ void render_lobby_info(void *panel,void *lobbyHandleVtable,void *lobby,void *lobbyRefCount) { Manager *pMVar1; char cVar2; uint uVar3; float *pfVar4; int iVar5; byte *pbVar6; int stageType; int iVar7; undefined4 *settings; byte *pbVar8; std_string *psVar9; AnimationState *this; Font *this_00; void *pvVar10; KColor *color; Vector local_2a0; uint local_298; KColor *local_294; undefined4 local_290; undefined4 local_28c; undefined4 local_288; undefined4 local_284; undefined4 local_280; undefined4 local_27c; undefined4 local_278; undefined1 local_274 [4]; void *local_270; Vector local_26c; float local_264; float local_25c; float local_258; undefined4 local_254; std_string *local_250; char local_24c [16]; uint local_23c; byte local_238 [20]; uint uStack_224; char local_220 [24]; char local_208 [24]; char local_1f0 [24]; char local_1d8 [24]; char local_1c0 [24]; byte local_1a8 [20]; uint uStack_194; char local_190 [24]; char local_178 [24]; char local_160 [24]; char local_148 [24]; char local_130 [24]; byte local_118 [256]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar1 = g_manager; puStack_c = &LAB_00b064f2; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_118 + 0x114); ExceptionList = &local_10; local_8 = 0; this_00 = &g_manager->_font1_TeamMeatEx10; local_294 = (KColor *)((g_menuManager->_ViewPosition).x + *(float *)panel); local_264 = (g_menuManager->_ViewPosition).y + *(float *)((int)panel + 4); local_18 = uVar3; if (*(int *)((int)panel + 0x3c) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame ((AnimationState *)((int)panel + 0x38),(byte *)"LobbyInfoTextPos"); } local_25c = *pfVar4; local_258 = pfVar4[1]; _eh_vector_constructor_iterator_(local_238,0x18,6,FUN_0040c380,std::string::_Tidy_deallocate); local_8._0_1_ = 1; if (lobby == (void *)0x0) { local_298 = 0; } else { local_298 = (**(code **)(*(int *)lobby + 0x30))("lobby_mode",uVar3); } uVar3 = local_298; std::string::assign((char *)local_238,(byte *)"Normal",6); std::string::assign(local_220,&DAT_00b75ec0,4); std::string::assign(local_208,(byte *)"Greed",5); std::string::assign(local_1f0,(byte *)"Greedier",8); std::string::assign(local_1d8,(byte *)"Challenge",9); std::string::assign(local_1c0,(byte *)"Daily Run",9); iVar5 = uVar3 * 0x18; pbVar6 = local_238 + iVar5; pbVar8 = pbVar6; if (0xf < *(uint *)(local_238 + uVar3 * 0x18 + 0x14)) { pbVar8 = *(byte **)pbVar6; } Font::get_string_width_n(this_00,pbVar8,-1); local_254 = 1; local_250 = (std_string *)0xffff; local_24c[0] = '\0'; local_24c[1] = '\0'; local_24c[2] = '\0'; local_24c[3] = '\0'; local_24c[4] = '\0'; local_24c[5] = '\0'; local_24c[6] = -0x80; local_24c[7] = '?'; local_24c[8] = -1; local_24c[9] = -1; local_24c[10] = -1; local_24c[0xb] = -1; local_24c[0xc] = '\0'; local_24c[0xd] = '\0'; local_24c[0xe] = '\0'; local_24c[0xf] = '\0'; local_23c = 0; local_25c = local_25c + (float)local_294; local_8._0_1_ = 2; local_2a0.x = local_25c + 10.0; local_2a0.y = local_258 + local_264 + 0.0; pbVar8 = pbVar6; if (0xf < *(uint *)(local_238 + iVar5 + 0x14)) { pbVar8 = *(byte **)pbVar6; } local_294 = (KColor *)((int)panel + 0x374); local_26c.y = local_2a0.y; Font::DrawStringScaled(this_00,pbVar8,&local_2a0,local_294,&local_254); local_8 = CONCAT31(local_8._1_3_,1); if (0xf < *(uint *)(local_238 + iVar5 + 0x14)) { pbVar6 = *(byte **)pbVar6; } iVar5 = Font::get_string_width_n(this_00,pbVar6,-1); this = (AnimationState *)((int)panel + 0x260); local_2a0.y = 10.0 - ((float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * 0.5 + 20.0); if (*(int *)((int)panel + 0x264) != 0) { AnimationState::SetFrameFloat(this,(float)(int)local_298); } local_2a0.x = local_2a0.y + local_25c; local_2a0.y = local_26c.y; if (*(char *)((int)panel + 0x339) != '\0') { if (*(char *)((int)panel + 0x2a0) == '\0') { AnimationState::Render(this,&local_2a0,&g_vectorZero,&g_vectorZero); this = (AnimationState *)((int)panel + 0x280); } else { AnimationState::Render ((AnimationState *)((int)panel + 0x280),&local_2a0,&g_vectorZero,&g_vectorZero); } AnimationState::Render(this,&local_2a0,&g_vectorZero,&g_vectorZero); } local_258 = local_258 + 30.0; if ((lobby == (void *)0x0) || (iVar5 = (**(code **)(*(int *)lobby + 0x30))("current_stage"), iVar5 == 0)) { pbVar6 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/IN_LOBBY"); Font::get_string_width_n(this_00,pbVar6,-1); local_290 = 1; local_28c = 0xffff; local_288 = 0; local_284 = 0x3f800000; local_280 = 0xffffffff; local_27c = 0; local_278 = 0; local_8._0_1_ = 3; settings = &local_290; } else { if (iVar5 != 0x3e9) { if (lobby == (void *)0x0) { stageType = 0; LAB_008e0a66: iVar7 = 0; } else { stageType = (**(code **)(*(int *)lobby + 0x30))("current_stage_type"); if (lobby == (void *)0x0) goto LAB_008e0a66; iVar7 = (**(code **)(*(int *)lobby + 0x30))("game_difficulty"); } Level::get_stage_display_name ((std_string *)&local_250,iVar5,stageType,0,0,0,(uint)(1 < iVar7)); local_28c = 0xffff; local_288 = 0; local_284 = 0x3f800000; local_280 = 0xffffffff; local_27c = 0; local_278 = 0; local_290 = 1; psVar9 = (std_string *)&local_250; if (0xf < local_23c) { psVar9 = local_250; } local_274[0] = 0; local_270 = (void *)0x0; local_26c.x = 0.0; local_26c.y = 0.0; local_8._0_1_ = 7; FormattedText::set(local_274,(byte *)psVar9,this_00,100,1.0,1); color = local_294; local_8._0_1_ = 8; Font::render_glyph_quads (this_00,local_274,local_25c,local_258 + local_264,1.0,1.0,*local_294,&local_290); uVar3 = ((int)local_26c.x - (int)local_270) / 0xc; if (1 < uVar3) { iVar5 = (uint)(ushort)(pMVar1->_font1_TeamMeatEx10)._lineHeight * (uVar3 - 1); local_258 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) + local_258; } local_8 = CONCAT31(local_8._1_3_,6); std::vector<12byte>::clear(); if (local_270 != (void *)0x0) { uVar3 = (((int)local_26c.y - (int)local_270) / 0xc) * 0xc; pvVar10 = local_270; if (0xfff < uVar3) { pvVar10 = *(void **)((int)local_270 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_270 + (-4 - (int)pvVar10))) goto LAB_008e0c6e; } operator_delete(pvVar10,uVar3); } local_8 = CONCAT31(local_8._1_3_,1); if (0xf < local_23c) { uVar3 = local_23c + 1; psVar9 = local_250; if (0xfff < uVar3) { psVar9 = (std_string *)local_250[-1]._capacity; uVar3 = local_23c + 0x24; if ((byte *)0x1f < (byte *)((int)local_250 + (-4 - (int)psVar9))) { LAB_008e0c6e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar9,uVar3); } goto LAB_008e0d37; } pbVar6 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/IN_DEATHMATCH"); Font::get_string_width_n(this_00,pbVar6,-1); local_254 = 1; local_250 = (std_string *)0xffff; local_24c[0] = '\0'; local_24c[1] = '\0'; local_24c[2] = '\0'; local_24c[3] = '\0'; local_24c[4] = '\0'; local_24c[5] = '\0'; local_24c[6] = -0x80; local_24c[7] = '?'; local_24c[8] = -1; local_24c[9] = -1; local_24c[10] = -1; local_24c[0xb] = -1; local_24c[0xc] = '\0'; local_24c[0xd] = '\0'; local_24c[0xe] = '\0'; local_24c[0xf] = '\0'; local_23c = 0; local_8._0_1_ = 4; settings = &local_254; } color = local_294; local_26c.y = local_258 + local_264; local_26c.x = local_25c; Font::DrawStringScaled(this_00,pbVar6,&local_26c,local_294,settings); local_8 = CONCAT31(local_8._1_3_,1); LAB_008e0d37: local_258 = local_258 + 30.0; if (lobby != (void *)0x0) { (**(code **)(*(int *)lobby + 0x1c))(); } sprintf(local_118,(byte *)"%d / %d Players"); Font::get_string_width_n(this_00,local_118,-1); local_290 = 1; local_28c = 0xffff; local_288 = 0; local_284 = 0x3f800000; local_280 = 0xffffffff; local_27c = 0; local_278 = 0; local_26c.y = local_258 + local_264; local_8._0_1_ = 9; local_26c.x = local_25c; Font::DrawStringScaled(this_00,local_118,&local_26c,color,&local_290); local_8._0_1_ = 1; local_258 = local_258 + 30.0; _eh_vector_constructor_iterator_(local_1a8,0x18,6,FUN_0040c380,std::string::_Tidy_deallocate); local_8._0_1_ = 10; if (lobby != (void *)0x0) { iVar5 = (**(code **)(*(int *)lobby + 0x30))("lobby_tag"); if (iVar5 != 0) { std::string::assign((char *)local_1a8,&DAT_00b6d124,4); std::string::assign(local_190,(byte *)"Casual",6); std::string::assign(local_178,(byte *)"Min/Max",7); std::string::assign(local_160,(byte *)"Achievements",0xc); std::string::assign(local_148,(byte *)"SpeedRun",8); std::string::assign(local_130,(byte *)"Streaking",9); pbVar6 = local_1a8 + iVar5 * 0x18; pbVar8 = pbVar6; if (0xf < *(uint *)(local_1a8 + iVar5 * 0x18 + 0x14)) { pbVar8 = *(byte **)pbVar6; } Font::get_string_width_n(this_00,pbVar8,-1); local_290 = 1; local_28c = 0xffff; local_288 = 0; local_284 = 0x3f800000; local_280 = 0xffffffff; local_27c = 0; local_278 = 0; local_26c.y = local_258 + local_264; local_8._0_1_ = 0xb; local_26c.x = local_25c; if (0xf < *(uint *)(local_1a8 + iVar5 * 0x18 + 0x14)) { pbVar6 = *(byte **)pbVar6; } Font::DrawStringScaled(this_00,pbVar6,&local_26c,color,&local_290); local_8._0_1_ = 10; local_258 = local_258 + 30.0; } if ((lobby != (void *)0x0) && (local_298 = (**(code **)(*(int *)lobby + 0x30))("lobby_challenge"), local_298 != 0)) { local_28c = 0x6effff; local_280 = 0xffffffff; local_27c = 0; local_278 = 0; local_8._0_1_ = 0xc; local_288 = 1; local_284 = 0x3f800000; local_290 = 1; pvVar10 = (g_manager->_challengeParams)._begin; uVar3 = ((int)(g_manager->_challengeParams)._end - (int)pvVar10) / 0xa4 - 1; if (local_298 < uVar3) { uVar3 = local_298; } std::string::string((char *)&local_250,(void *)(uVar3 * 0xa4 + (int)pvVar10)); local_8._0_1_ = 0xd; if (local_298 == 0x2d) { std::string::assign((char *)&local_250,(byte *)"DELETE THIS",0xb); } local_26c.y = local_258 + local_264; psVar9 = (std_string *)&local_250; if (0xf < local_23c) { psVar9 = local_250; } local_26c.x = local_25c; Font::DrawStringScaled(this_00,(byte *)psVar9,&local_26c,color,&local_290); local_8._0_1_ = 0xc; if (0xf < local_23c) { uVar3 = local_23c + 1; psVar9 = local_250; if (0xfff < uVar3) { psVar9 = (std_string *)local_250[-1]._capacity; uVar3 = local_23c + 0x24; if ((byte *)0x1f < (byte *)((int)local_250 + (-4 - (int)psVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar9,uVar3); } } } local_8._0_1_ = 1; _eh_vector_destructor_iterator_(local_1a8,0x18,6,std::string::_Tidy_deallocate); local_8 = (uint)local_8._1_3_ << 8; _eh_vector_destructor_iterator_(local_238,0x18,6,std::string::_Tidy_deallocate); local_8 = 0xe; if (((lobbyRefCount != (void *)0x0) && (cVar2 = (**(code **)(*(int *)lobbyRefCount + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobby); } ExceptionList = local_10; return; } //@@ 008e11b0 Level::InitializeGenesisRoom /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Level::InitializeGenesisRoom(); */ void __thiscall Level::InitializeGenesisRoom(undefined4 param_1,undefined **param_2,int *param_3,int *param_4) { char cVar1; byte bVar2; uint uVar3; byte *text; undefined1 auStackY_178 [128]; undefined **propertiesVtable; void *pvVar4; undefined4 uVar5; void *propertiesRefCount; undefined1 auStack_e6 [2]; undefined1 popup [84]; undefined1 local_8c [12]; undefined1 local_80 [12]; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; Vector local_38; void *lobbyText [4]; int lobbyTextSize; uint lobbyTextCapacity; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; int membersBegin; int membersEnd; puStack_c = &LAB_00b06556; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(lobbyText + 0xb); ExceptionList = &local_10; local_8 = (void *)0x0; if (param_3 == (int *)0x0) { cVar1 = '\0'; } else { membersEnd = param_3[5]; membersBegin = param_3[4]; uVar3 = (**(code **)(*param_3 + 0x1c))(); cVar1 = '\x01' - ((uint)(membersEnd - membersBegin >> 3) < uVar3); } if (cVar1 == '\0') { local_38.y = (float)(auStackY_178 + 0x84); propertiesVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; pvVar4 = (void *)0x0; propertiesRefCount = (void *)0x0; local_8._0_1_ = 2; std::shared_ptr::assign(auStackY_178 + 0x88,¶m_3); local_8 = (void *)((uint)local_8._1_3_ << 8); bVar2 = online_check_game_version(propertiesVtable,pvVar4,propertiesRefCount); if (bVar2 != 0) { bVar2 = online_lobby_is_user_banned(¶m_2); if (bVar2 == 0) { if (param_3 == (int *)0x0) { text = (byte *)0x0; } else { text = (byte *)(**(code **)(*param_3 + 0x2c))(); } uVar5 = 0x8e130e; std::string::string_from_cstr((char *)lobbyText,text); local_8 = (void *)CONCAT31(local_8._1_3_,3); if (lobbyTextSize == 8) { local_38.y = (float)(auStackY_178 + 0x84); local_8._0_1_ = 4; std::shared_ptr::assign(auStackY_178 + 0x88,¶m_3); local_8 = (void *)CONCAT31(local_8._1_3_,3); LobbyPasswordPrompt::open(); } else { online_lobby_join(&g_manager->_netplayManager,¶m_2,CONCAT44(text,uVar5)); } local_8 = (void *)((uint)local_8 & 0xffffff00); if (0xf < lobbyTextCapacity) { uVar3 = lobbyTextCapacity + 1; pvVar4 = lobbyText[0]; if (0xfff < uVar3) { pvVar4 = *(void **)((int)lobbyText[0] + -4); uVar3 = lobbyTextCapacity + 0x24; if (0x1f < (uint)((int)lobbyText[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar3); } } } } else { local_38.x = (float)&DAT_bf800000; local_38.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_38); local_8 = (void *)CONCAT31(local_8._1_3_,1); MessagePopup::add_ok_button((byte *)"##GAME###Online/ERROR_LOBBY_FULL",popup); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,popup); local_64 = 0; local_60 = 0; local_6c = 0; local_68 = 0; local_74 = 0; local_70 = 0; FID_conflict__Tidy(local_80); FID_conflict__Tidy(local_8c); } param_2 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = (void *)0x5; if (param_4 != (int *)0x0) { cVar1 = (**(code **)(*param_4 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 008e1400 Menu_OnlineLobbyList::request_lobby_list /* DB: called with ECX=this from Menu_OnlineLobbyList::reset (8de680 mov ecx,ebx); builds lobby search filters "lobby_tag", "lobby_mode", "current_stage" (cap 0x32 results) and starts the search with FUN_00a542c0(&filters, 008e1fb0 Menu_OnlineLobbyList::on_lobby_list_received this) prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobbyList::request_lobby_list(void *this) { char *filterKey; uint allocSize; undefined4 *puVar1; void *pvVar2; undefined4 *filter; int iVar3; undefined4 maxResults; undefined4 local_60; int lobbyMode; void *otherFiltersBegin; undefined4 uStack_54; int otherFiltersCapacityEnd; void *filtersBegin; undefined4 *filtersEnd; undefined4 *filtersCapacityEnd; undefined4 emptyFilter; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined8 local_30; int index; void *menu; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b0658d; local_1c = ExceptionList; ExceptionList = &local_1c; maxResults = 0x32; filter = (undefined4 *)0x0; puVar1 = (undefined4 *)0x0; otherFiltersBegin = (void *)0x0; uStack_54 = 0; otherFiltersCapacityEnd = 0; filtersBegin = (void *)0x0; filtersEnd = (undefined4 *)0x0; filtersCapacityEnd = (undefined4 *)0x0; local_14 = 0; iVar3 = *(int *)((int)this + 0x4d0); local_60 = 1; lobbyMode = iVar3; if ((iVar3 != 2) && (iVar3 != 1)) { lobbyMode = 3; if (iVar3 == 0) { lobbyMode = 0; } } index = 0; menu = this; do { if (*(char *)((int)this + index + 0x4da) == '\0') { local_30 = 0; emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; if (filter == puVar1) { filter = (undefined4 *)FUN_00a53f00(filter,&emptyFilter); } else { *filter = 0; filter[1] = 0; filter[2] = 0; filter[3] = 0; *(undefined8 *)(filter + 4) = 0; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(10); strncpy(filterKey,"lobby_tag",10); *filter = filterKey; filter[2] = index; filter[3] = 0; filter[4] = 5; puVar1 = filtersCapacityEnd; this = menu; filter = filtersEnd; } index = index + 1; } while (index < 6); if (*(int *)&g_manager->_lobbySettings == 2) { index = 0; do { if (index != 5) { local_30 = 0; emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; if (filter == puVar1) { filter = (undefined4 *)FUN_00a53f00(filter,&emptyFilter); } else { *filter = 0; filter[1] = 0; filter[2] = 0; filter[3] = 0; *(undefined8 *)(filter + 4) = 0; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(0xb); strncpy(filterKey,"lobby_mode",0xb); *filter = filterKey; filter[2] = index; filter[3] = 0; filter[4] = 5; puVar1 = filtersCapacityEnd; filter = filtersEnd; } index = index + 1; } while (index < 6); local_30 = 0; emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; if (filter == puVar1) { filter = (undefined4 *)FUN_00a53f00(filter,&emptyFilter); } else { *filter = 0; filter[1] = 0; filter[2] = 0; filter[3] = 0; *(undefined8 *)(filter + 4) = 0; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(0xb); strncpy(filterKey,"lobby_mode",0xb); *filter = filterKey; filter[2] = 5; filter[3] = 0; filter[4] = 2; LAB_008e174c: emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_30 = 0; if (filtersEnd == filtersCapacityEnd) { puVar1 = (undefined4 *)FUN_00a53f00(filtersEnd,&emptyFilter); } else { *filtersEnd = 0; filtersEnd[1] = 0; filtersEnd[2] = 0; filtersEnd[3] = 0; *(undefined8 *)(filtersEnd + 4) = 0; puVar1 = filtersEnd; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(0xe); strncpy(filterKey,"current_stage",0xe); *puVar1 = filterKey; puVar1[4] = 2; LAB_008e17a0: puVar1[3] = 0; puVar1[2] = 0; } else { index = 0; do { if (*(char *)((int)this + index + 0x4d4) == '\0') { local_30 = 0; emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; if (filter == puVar1) { filter = (undefined4 *)FUN_00a53f00(filter,&emptyFilter); } else { *filter = 0; filter[1] = 0; filter[2] = 0; filter[3] = 0; *(undefined8 *)(filter + 4) = 0; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(0xb); strncpy(filterKey,"lobby_mode",0xb); *filter = filterKey; filter[2] = index; filter[3] = 0; filter[4] = 5; puVar1 = filtersCapacityEnd; this = menu; filter = filtersEnd; } index = index + 1; } while (index < 6); local_30 = 0; emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; if (filter == puVar1) { filter = (undefined4 *)FUN_00a53f00(filter,&emptyFilter); } else { *filter = 0; filter[1] = 0; filter[2] = 0; filter[3] = 0; *(undefined8 *)(filter + 4) = 0; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(0xb); strncpy(filterKey,"lobby_mode",0xb); *filter = filterKey; filter[2] = 5; filter[3] = 0; filter[4] = 5; if (*(char *)((int)menu + 0x4e3) == '\0') { emptyFilter = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; local_30 = 0; if (filtersEnd == filtersCapacityEnd) { puVar1 = (undefined4 *)FUN_00a53f00(filtersEnd,&emptyFilter); } else { *filtersEnd = 0; filtersEnd[1] = 0; filtersEnd[2] = 0; filtersEnd[3] = 0; *(undefined8 *)(filtersEnd + 4) = 0; puVar1 = filtersEnd; filtersEnd = filtersEnd + 6; } filterKey = operator_new_tracked(0xe); strncpy(filterKey,"current_stage",0xe); *puVar1 = filterKey; puVar1[4] = 5; goto LAB_008e17a0; } if (*(char *)((int)menu + 0x4e4) == '\0') goto LAB_008e174c; } pvVar2 = menu; iVar3 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar3 == 2) || (iVar3 == 3)) { iVar3 = 3; } else { iVar3 = 2; } Multiplayer::set_service_provider(iVar3); KAGE::Network::MultiplayerManager::request_lobby_list (&DAT_00c79a50,&maxResults,on_lobby_list_received,pvVar2); FUN_00a539f0(); if (filtersBegin != (void *)0x0) { allocSize = (((int)filtersCapacityEnd - (int)filtersBegin) / 0x18) * 0x18; pvVar2 = filtersBegin; if (0xfff < allocSize) { pvVar2 = *(void **)((int)filtersBegin + -4); allocSize = allocSize + 0x23; if (0x1f < (uint)((int)filtersBegin + (-4 - (int)pvVar2))) goto LAB_008e1889; } operator_delete(pvVar2,allocSize); filtersBegin = (void *)0x0; filtersEnd = (undefined4 *)0x0; filtersCapacityEnd = (undefined4 *)0x0; } if (otherFiltersBegin != (void *)0x0) { allocSize = ((otherFiltersCapacityEnd - (int)otherFiltersBegin) / 0x18) * 0x18; pvVar2 = otherFiltersBegin; if (0xfff < allocSize) { pvVar2 = *(void **)((int)otherFiltersBegin + -4); allocSize = allocSize + 0x23; if (0x1f < (uint)((int)otherFiltersBegin + (-4 - (int)pvVar2))) { LAB_008e1889: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,allocSize); } ExceptionList = local_1c; return; } //@@ 008e18b0 FUN_008e18b0 void FUN_008e18b0(void) { char cVar1; int in_ECX; cVar1 = KAGE::System::FriendManager::request_friend_lobbies (Menu_OnlineLobbyList::lobby_search_callback,in_ECX,1); if (cVar1 == '\0') { *(undefined1 *)(in_ECX + 0x344) = 0; *(undefined4 *)(in_ECX + 0x348) = 0; *(undefined4 *)(in_ECX + 0x34c) = 0; } return; } //@@ 008e18f0 FUN_008e18f0 undefined1 FUN_008e18f0(undefined4 param_1,int param_2,int *param_3) { char cVar1; uint uVar2; int in_ECX; int *piVar3; uint uVar4; int iVar5; undefined1 uVar6; int local_28; int iStack_24; int iStack_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1690; local_10 = ExceptionList; ExceptionList = &local_10; uVar4 = 0; uVar2 = *(int *)(in_ECX + 0x354) - *(int *)(in_ECX + 0x350) >> 5; if (uVar2 != 0) { piVar3 = (int *)(*(int *)(in_ECX + 0x350) + 0xc); do { iVar5 = *piVar3; if (iVar5 == 0) { iStack_14 = 0; iVar5 = iStack_14; iStack_14 = 0; } else { iStack_14 = *(int *)(iVar5 + 8); iVar5 = *(int *)(iVar5 + 0xc); } if (param_2 == 0) { iStack_24 = 0; local_28 = 0; } else { local_28 = *(int *)(param_2 + 8); iStack_24 = *(int *)(param_2 + 0xc); } if ((iStack_14 == local_28) && (iVar5 == iStack_24)) goto LAB_008e1a58; uVar4 = uVar4 + 1; piVar3 = piVar3 + 8; } while (uVar4 < uVar2); } uVar4 = 0; uVar2 = (*(int *)(in_ECX + 0x360) - *(int *)(in_ECX + 0x35c)) / 0x18; if (uVar2 != 0) { piVar3 = (int *)(*(int *)(in_ECX + 0x35c) + 4); do { iVar5 = *piVar3; if (iVar5 == 0) { iStack_24 = 0; iStack_14 = 0; iVar5 = iStack_24; } else { iStack_14 = *(int *)(iVar5 + 8); iVar5 = *(int *)(iVar5 + 0xc); } if (param_2 == 0) { iStack_24 = 0; local_28 = 0; } else { local_28 = *(int *)(param_2 + 8); iStack_24 = *(int *)(param_2 + 0xc); } if ((iStack_14 == local_28) && (iVar5 == iStack_24)) goto LAB_008e1a58; uVar4 = uVar4 + 1; piVar3 = piVar3 + 6; } while (uVar4 < uVar2); } uVar6 = 0; LAB_008e1a10: param_1 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(¶m_2); } } ExceptionList = local_10; return uVar6; LAB_008e1a58: uVar6 = 1; goto LAB_008e1a10; } //@@ 008e1a70 Menu_OnlineLobbyList::lobby_search_callback /* DB: ? passed as callback to FUN_00a57060 by FUN_008e18b0/FUN_008e1fb0 (Menu_OnlineLobbyList::reset path) with the menu as context (param_2): filters the found ConstLobby list (lobby mode 2 needs status 5), copies into a std::list, sorts by name with _stricmp, fills the menu list at +0x350; strings "list too long", "lobby_mode" */ void Menu_OnlineLobbyList::lobby_search_callback(int *param_1,int param_2) { int *piVar1; undefined4 *puVar2; char cVar3; int iVar4; undefined4 *puVar5; char *nodeName; char *otherName; uint *puVar6; uint *puVar7; int iVar8; undefined4 local_78; undefined **local_5c; uint local_58; undefined **local_54; undefined1 local_50 [4]; int *entryRefCount; undefined8 local_44; uint *lobbyList; int lobbyListSize; uint *local_30; undefined ***local_2c; uint *local_28; uint *local_24; uint *local_20; uint **local_1c; uint *local_18; uint *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b065fe; local_10 = ExceptionList; ExceptionList = &local_10; lobbyList = (uint *)0x0; lobbyListSize = 0; lobbyList = operator_new(0x1c); *lobbyList = (uint)lobbyList; lobbyList[1] = (uint)lobbyList; local_8._0_1_ = 0; local_8._1_3_ = 0; local_14 = (uint *)0x0; iVar4 = *param_1; iVar8 = param_1[1] - iVar4 >> 0x1f; local_24 = lobbyList; if ((param_1[1] - iVar4) / 0x14 + iVar8 != iVar8) { local_28 = (uint *)(param_2 + 0x4d0); iVar8 = 0; do { local_30 = &local_78; local_78 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 1; std::shared_ptr::assign(local_50 + -0x24,(void *)(iVar8 + 0xc + iVar4)); local_8._0_1_ = 0; cVar3 = FUN_0085bd40(); if ((cVar3 != '\0') && ((*(int *)&g_manager->_lobbySettings != 2 || ((piVar1 = *(int **)(*param_1 + 0xc + iVar8), piVar1 != (int *)0x0 && (iVar4 = (**(code **)(*piVar1 + 0x30))(), iVar4 == 5)))))) { iVar4 = *param_1; local_24 = lobbyList; if (lobbyListSize == 0x9249249) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_1c = &lobbyList; local_8._0_1_ = 2; local_18 = (uint *)0x0; puVar5 = operator_new(0x1c); local_2c = (undefined ***)(puVar5 + 2); *local_2c = KAGE::System::UserProfileBase::vftable; puVar5[3] = *(undefined4 *)(iVar4 + 4 + iVar8); *local_2c = KAGE::System::UserProfile::vftable; local_20 = puVar5 + 4; *local_20 = (uint)KAGE::Network::Multiplayer::ConstLobby::vftable; puVar5[5] = 0; puVar5[6] = 0; local_8._0_1_ = 4; local_18 = puVar5; std::shared_ptr::assign(puVar5 + 5,(void *)(iVar4 + 0xc + iVar8)); local_8._0_1_ = 0; lobbyListSize = lobbyListSize + 1; puVar2 = (undefined4 *)local_24[1]; *puVar5 = local_24; puVar5[1] = puVar2; local_24[1] = (uint)puVar5; local_18 = (uint *)0x0; *puVar2 = puVar5; } iVar4 = *param_1; iVar8 = iVar8 + 0x14; local_14 = (uint *)((int)local_14 + 1); } while (local_14 < (uint *)((param_1[1] - iVar4) / 0x14)); local_24 = lobbyList; } puVar6 = local_24; lobbyList = local_24; if ((lobbyListSize != 0) && (lobbyListSize != 1)) { local_18 = (uint *)FUN_008e33c0(); local_20 = (uint *)FUN_008e33c0(); puVar7 = local_18; puVar6 = (uint *)*puVar6; local_14 = puVar6; nodeName = (char *)(**(code **)(puVar6[2] + 4))(); otherName = (char *)(**(code **)(puVar7[2] + 4))(); local_78 = (undefined **)0x8e1c9a; iVar4 = _stricmp(otherName,nodeName); if (iVar4 < 0) { local_28 = puVar7; } else { local_28 = puVar6; do { puVar6 = (uint *)*puVar6; local_14 = puVar6; if (puVar6 == puVar7) goto LAB_008e1d71; nodeName = (char *)(**(code **)(puVar6[2] + 4))(); otherName = (char *)(**(code **)(puVar7[2] + 4))(); local_78 = (undefined **)0x8e1cdd; iVar4 = _stricmp(otherName,nodeName); } while (-1 < iVar4); } do { local_2c = (undefined ***)(puVar6 + 2); local_30 = puVar7; do { puVar7 = (uint *)*puVar7; if (puVar7 == local_20) break; nodeName = (char *)(*(code *)(*local_2c)[1])(); otherName = (char *)(**(code **)(puVar7[2] + 4))(); local_78 = (undefined **)0x8e1d0f; iVar4 = _stricmp(otherName,nodeName); } while (iVar4 < 0); puVar2 = (undefined4 *)local_30[1]; *puVar2 = puVar7; puVar5 = (undefined4 *)puVar7[1]; *puVar5 = local_14; puVar6 = (uint *)local_14[1]; *puVar6 = (uint)local_30; local_14[1] = (uint)puVar5; puVar7[1] = (uint)puVar2; local_30[1] = (uint)puVar6; puVar6 = local_14; if (puVar7 == local_20) goto LAB_008e1d71; do { puVar6 = (uint *)*puVar6; local_14 = puVar6; if (puVar6 == puVar7) goto LAB_008e1d71; nodeName = (char *)(**(code **)(puVar6[2] + 4))(); otherName = (char *)(**(code **)(puVar7[2] + 4))(); local_78 = (undefined **)0x8e1d65; iVar4 = _stricmp(otherName,nodeName); } while (-1 < iVar4); } while( true ); } LAB_008e1d7c: puVar6 = (uint *)*lobbyList; FUN_008e3100(); *(undefined4 *)(param_2 + 0x354) = *(undefined4 *)(param_2 + 0x350); if (puVar6 != lobbyList) { do { local_30 = &local_78; local_78 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 6; std::shared_ptr::assign(local_50 + -0x24,puVar6 + 5); cVar3 = FUN_008e18f0(); if (cVar3 == '\0') { local_2c = &local_5c; local_58 = 0; local_5c = KAGE::System::UserProfile::vftable; local_8._0_1_ = 7; local_54 = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(); local_8 = CONCAT31(local_8._1_3_,8); local_58 = puVar6[3]; std::shared_ptr::assign(local_50,puVar6 + 5); local_44 = 0; if (*(int *)(param_2 + 0x354) == *(int *)(param_2 + 0x358)) { local_78 = (undefined **)0x8e1e4d; FUN_008e2ea0(); } else { FUN_008e3190(); *(int *)(param_2 + 0x354) = *(int *)(param_2 + 0x354) + 0x20; } local_54 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 9; if (((entryRefCount != (int *)0x0) && (cVar3 = (**(code **)(*entryRefCount + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } puVar6 = (uint *)*puVar6; } while (puVar6 != lobbyList); } local_8 = 0xffffffff; *(undefined1 *)(param_2 + 0x344) = 0; *(undefined4 *)lobbyList[1] = 0; puVar2 = (undefined4 *)*lobbyList; while (puVar2 != (undefined4 *)0x0) { puVar5 = (undefined4 *)*puVar2; puVar2[4] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 10; if ((((int *)puVar2[6] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)puVar2[6] + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = 0xffffffff; puVar2[2] = KAGE::System::UserProfileBase::vftable; local_78 = (undefined **)0x8e1efa; operator_delete(puVar2,0x1c); puVar2 = puVar5; } local_78 = (undefined **)0x8e1f0d; operator_delete(lobbyList,0x1c); ExceptionList = local_10; return; LAB_008e1d71: *local_24 = (uint)local_28; goto LAB_008e1d7c; } //@@ 008e1f30 FriendEntry::~FriendEntry /* DB: ? dtor of a 0x14-byte element {UserProfile at +0 (8 bytes), ConstLobby at +8}: releases the ConstLobby impl via g_lobbyReleaseFn then resets UserProfileBase::vftable; the 0x14-stride vector of these is walked in 008e1a70; unwind-only callers; a vector of the same 0x14-byte elements is freed by 00a57690 std::vector::_Tidy the FriendManager/EosFriendManager dtor 00a56e10, hence friend + their lobby prototype: db/protos.zhl */ void __thiscall FriendEntry::~FriendEntry(void *this) { char cVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)((int)this + 8) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)((int)this + 0x10) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 0x10) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)this + 0xc); } } *(undefined ***)this = KAGE::System::UserProfileBase::vftable; ExceptionList = local_10; return; } //@@ 008e1fb0 Menu_OnlineLobbyList::on_lobby_list_received /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? callback pushed by 008e1400 Menu_OnlineLobbyList::request_lobby_list 0x8e1fb0 at 8e17d5) to the lobby search, param_2 = the menu (+0x4e6 flag); walks the result vector (0xc stride shared_ptr), drops full/password ("lobby_password") lobbies and those failing PersistentGameData::Unlocked, builds a list of ConstLobby */ void Menu_OnlineLobbyList::on_lobby_list_received(int *param_1,int param_2) { undefined4 *puVar1; char cVar2; byte isUnlocked; uint uVar3; char *pcVar4; int iVar5; undefined4 *node; char extraout_DL; uint userIdCount; int iVar6; int *piVar7; int iVar8; undefined4 auStackY_2dc [128]; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 lobbyEntry [4]; int *lobbyEntryRefCount; undefined8 local_a4; int **local_9c; undefined4 *newNode; undefined4 *local_94; int *results; undefined8 local_8c; int lobbyOffset; uint lobbyIndex; int local_78; int *lobbyList; int lobbyListSize; LobbySettings settings; int userIdsBegin; int userIdsEnd; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isChallengeLocked; char *passwordStart; local_8 = 0xffffffff; puStack_c = &LAB_00b06691; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)((&settings)[1]._seed._buf + 8); ExceptionList = &local_10; results = param_1; local_78 = param_2; lobbyList = (int *)0x0; lobbyListSize = 0; lobbyList = operator_new(0x14); *lobbyList = (int)lobbyList; lobbyList[1] = (int)lobbyList; local_8 = 0; iVar5 = *param_1; lobbyIndex = 0; iVar6 = param_1[1] - iVar5 >> 0x1f; if ((param_1[1] - iVar5) / 0xc + iVar6 != iVar6) { lobbyOffset = 0; do { iVar6 = lobbyOffset; piVar7 = *(int **)(iVar5 + 4 + lobbyOffset); if (piVar7 == (int *)0x0) { cVar2 = '\0'; } else { iVar5 = piVar7[5]; iVar8 = piVar7[4]; uVar3 = (**(code **)(*piVar7 + 0x1c))(); cVar2 = '\x01' - ((uint)(iVar5 - iVar8 >> 3) < uVar3); } if (cVar2 == '\0') { piVar7 = *(int **)(*param_1 + 4 + iVar6); if (piVar7 == (int *)0x0) { pcVar4 = (char *)0x0; } else { pcVar4 = (char *)(**(code **)(*piVar7 + 0x2c))(); } passwordStart = pcVar4 + 1; do { cVar2 = *pcVar4; pcVar4 = pcVar4 + 1; } while (cVar2 != '\0'); if (pcVar4 == passwordStart) { local_8._0_1_ = 1; std::shared_ptr::assign(auStackY_2dc + 0x82,(void *)(*param_1 + 4 + iVar6)); local_8 = (uint)local_8._1_3_ << 8; cVar2 = FUN_008e18f0(); if (cVar2 == '\0') { local_8._0_1_ = 2; std::shared_ptr::assign(auStackY_2dc + 0x82,(void *)(*param_1 + 4 + iVar6)); local_8 = (uint)local_8._1_3_ << 8; cVar2 = FUN_0085bd40(); if (cVar2 != '\0') { LobbySettings::reset(&settings); local_94 = auStackY_2dc + 0x81; lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_8._0_1_ = 4; std::shared_ptr::assign(auStackY_2dc + 0x82,(void *)(*param_1 + 4 + iVar6)); local_8 = CONCAT31(local_8._1_3_,3); Menu_Save::select_save_slot ((Menu_Save *)&settings,lobbyHandleVtable,lobby,lobbyRefCount); if (g_userProfile == (void *)0x0) { local_8c = 0; local_8c._4_4_ = 0; local_8c._0_4_ = 0; iVar5 = (int)local_8c; iVar8 = local_8c._4_4_; } else { iVar5 = *(int *)((int)g_userProfile + 8); iVar8 = *(int *)((int)g_userProfile + 0xc); } uVar3 = 0; userIdCount = userIdsEnd - userIdsBegin >> 3; if (userIdCount != 0) { do { if ((*(int *)(userIdsBegin + uVar3 * 8) == iVar5) && (*(int *)(userIdsBegin + 4 + uVar3 * 8) == iVar8)) { cVar2 = '\x01'; goto LAB_008e21b9; } uVar3 = uVar3 + 1; } while (uVar3 < userIdCount); } cVar2 = '\0'; LAB_008e21b9: if (settings._challenge == 0) { LAB_008e21eb: isChallengeLocked = false; } else { if ((uint)settings._challenge < 0x2e) { iVar5 = *(int *)(&DAT_00b7b0b0 + settings._challenge * 4); } else { iVar5 = 0; } isUnlocked = PersistentGameData::Unlocked(&g_manager->_persistentGameData,iVar5); cVar2 = extraout_DL; if (isUnlocked != 0) goto LAB_008e21eb; isChallengeLocked = true; } piVar7 = lobbyList; if ((cVar2 == '\0') && (!isChallengeLocked)) { iVar5 = *results; if (lobbyListSize == 0xccccccc) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_9c = &lobbyList; local_8._0_1_ = 5; newNode = (undefined4 *)0x0; node = operator_new(0x14); node[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8c = CONCAT44(node + 2,(int)local_8c); node[3] = 0; node[4] = 0; local_8 = CONCAT31(local_8._1_3_,6); newNode = node; std::shared_ptr::assign(node + 3,(void *)(iVar5 + iVar6 + 4)); lobbyListSize = lobbyListSize + 1; puVar1 = (undefined4 *)piVar7[1]; *node = piVar7; node[1] = puVar1; piVar7[1] = (int)node; newNode = (undefined4 *)0x0; *puVar1 = node; iVar6 = lobbyOffset; } local_8 = local_8 & 0xffffff00; std::vector::_Tidy(); std::string::_Tidy_deallocate(settings._password._buf); std::string::_Tidy_deallocate(settings._seed._buf); param_1 = results; } } } } iVar5 = *param_1; lobbyOffset = iVar6 + 0xc; lobbyIndex = lobbyIndex + 1; } while (lobbyIndex < (uint)((param_1[1] - iVar5) / 0xc)); param_2 = local_78; } FUN_008e34e0(); piVar7 = (int *)*lobbyList; FUN_008e3070(); *(undefined4 *)(param_2 + 0x360) = *(undefined4 *)(param_2 + 0x35c); if (piVar7 != lobbyList) { do { KAGE::SmartPointer::SmartPointer(); local_8._0_1_ = 8; std::shared_ptr::assign(lobbyEntry,piVar7 + 3); local_a4 = 0; puVar1 = *(undefined4 **)(local_78 + 0x360); if (puVar1 == *(undefined4 **)(local_78 + 0x364)) { std::vector::_Emplace_reallocate(); } else { *puVar1 = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar1[1] = 0; puVar1[2] = 0; local_8._0_1_ = 9; local_94 = puVar1; std::shared_ptr::assign(puVar1 + 1,lobbyEntry); puVar1[4] = (undefined4)local_a4; puVar1[5] = local_a4._4_4_; *(int *)(param_2 + 0x360) = *(int *)(param_2 + 0x360) + 0x18; } local_8._0_1_ = 10; if (((lobbyEntryRefCount != (int *)0x0) && (cVar2 = (**(code **)(*lobbyEntryRefCount + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = (uint)local_8._1_3_ << 8; piVar7 = (int *)*piVar7; } while (piVar7 != lobbyList); } iVar5 = local_78; if ((*(int *)&g_manager->_lobbySettings == 2) && (*(char *)(local_78 + 0x4e6) != '\0')) { cVar2 = KAGE::System::FriendManager::request_friend_lobbies(); if (cVar2 != '\0') goto LAB_008e244c; *(undefined4 *)(iVar5 + 0x348) = 0; *(undefined4 *)(iVar5 + 0x34c) = 0; } *(undefined1 *)(iVar5 + 0x344) = 0; LAB_008e244c: *(undefined4 *)lobbyList[1] = 0; puVar1 = (undefined4 *)*lobbyList; while (puVar1 != (undefined4 *)0x0) { node = (undefined4 *)*puVar1; local_8 = 0xb; (**(code **)puVar1[2])(); operator_delete(puVar1,0x14); puVar1 = node; } local_8 = 0xffffffff; operator_delete(lobbyList,0x14); ExceptionList = local_10; return; } //@@ 008e24c0 KAGE::Network::Multiplayer::ConstLobby::~ConstLobby /* DB: resets vftable to ConstLobby::vftable and releases the shared_ptr control block at this+8 (refcount vslot 0xc, deleter g_lobbyReleaseFn); paired with the Lobby objects built by 00a29f60 prototype: db/protos.zhl */ void __thiscall KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(void *this) { char cVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)this = vftable; local_8 = 0; if (*(int **)((int)this + 8) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 8) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)this + 4); } } ExceptionList = local_10; return; } //@@ 008e2530 Menu_OnlineLobbyList::on_password_search_result /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: lobby-search callback pushed by Menu_OnlineLobbyList::update_password_entry into FUN_00a542c0 (ecx=0xc79a50 MultiplayerManager); compares each lobby's lobby_password and calls online_lobby_join, else plays sfx 0xbb */ void Menu_OnlineLobbyList::on_password_search_result(int *param_1,int param_2) { int iVar1; int *ptr; byte bVar2; int *piVar3; byte *text; byte *****pppppbVar4; uint uVar5; byte *textEnd; byte *****lobbyPasswordBuf; std_string *managerPassword; uint excludedIdCount; byte *****pppppbVar6; int lobbiesBegin; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_d2 [2]; int userIdLo; int userIdHi; int lobbyOffset; uint lobbyIdx; int *local_a0; LobbySettings lobbySettings; int excludedIdsBegin; int excludedIdsEnd; byte *****enteredPassword [4]; int enteredPasswordSize; uint enteredPasswordCapacity; byte *****lobbyPassword [4]; int lobbyPasswordSize; uint lobbyPasswordCapacity; uint stackCookie; void *local_10; undefined1 *puStack_c; byte ****local_8; undefined4 *listNode; Manager *manager; undefined4 *nextNode; local_8 = (byte ****)0xffffffff; puStack_c = &LAB_00b066f9; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(lobbyPassword + 10); ExceptionList = &local_10; *(undefined1 *)(param_2 + 0x344) = 0; std::string::string((char *)enteredPassword,&(g_manager->_lobbySettings)._password); local_8._0_1_ = 0; local_8._1_3_ = 0; if (enteredPasswordSize == 8) { piVar3 = operator_new(0x14); *piVar3 = (int)piVar3; piVar3[1] = (int)piVar3; local_8._0_1_ = 1; lobbiesBegin = *param_1; lobbyIdx = 0; iVar1 = param_1[1] - lobbiesBegin >> 0x1f; local_a0 = piVar3; if ((param_1[1] - lobbiesBegin) / 0xc + iVar1 != iVar1) { lobbyOffset = 0; do { piVar3 = *(int **)(lobbyOffset + 4 + lobbiesBegin); if (piVar3 == (int *)0x0) { text = (byte *)0x0; } else { text = (byte *)(**(code **)(*piVar3 + 0x2c))(); } lobbyPasswordSize = 0; lobbyPasswordCapacity = 0xf; lobbyPassword[0] = (byte *****)0x0; textEnd = text; do { bVar2 = *textEnd; textEnd = textEnd + 1; } while (bVar2 != 0); std::string::assign((char *)lobbyPassword,text,(int)textEnd - (int)(text + 1)); pppppbVar6 = lobbyPassword[0]; local_8._0_1_ = 2; if (lobbyPasswordSize == 8) { pppppbVar4 = (byte *****)enteredPassword; if (0xf < enteredPasswordCapacity) { pppppbVar4 = enteredPassword[0]; } lobbyPasswordBuf = (byte *****)lobbyPassword; if (0xf < lobbyPasswordCapacity) { lobbyPasswordBuf = lobbyPassword[0]; } bVar2 = str_eq((byte *)lobbyPasswordBuf,8,(byte *)pppppbVar4,8); if (bVar2 == 0) goto LAB_008e27d6; LobbySettings::reset(&lobbySettings); lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_8._0_1_ = 4; std::shared_ptr::assign(auStack_d2 + -10,(void *)(*param_1 + 4 + lobbyOffset)); local_8._0_1_ = 3; Menu_Save::select_save_slot ((Menu_Save *)&lobbySettings,lobbyHandleVtable,lobby,lobbyRefCount); manager = g_manager; if (g_userProfile == (void *)0x0) { userIdHi = 0; userIdLo = 0; } else { userIdLo = *(int *)((int)g_userProfile + 8); userIdHi = *(int *)((int)g_userProfile + 0xc); } uVar5 = 0; excludedIdCount = excludedIdsEnd - excludedIdsBegin >> 3; if (excludedIdCount != 0) { while ((*(int *)(excludedIdsBegin + uVar5 * 8) != userIdLo || (*(int *)(excludedIdsBegin + 4 + uVar5 * 8) != userIdHi))) { uVar5 = uVar5 + 1; if (excludedIdCount <= uVar5) goto LAB_008e2714; } std::vector::_Tidy(); std::string::_Tidy_deallocate(lobbySettings._password._buf); std::string::_Tidy_deallocate(lobbySettings._seed._buf); goto LAB_008e27d6; } LAB_008e2714: managerPassword = &(g_manager->_lobbySettings)._password; if (0xf < (g_manager->_lobbySettings)._password._capacity) { managerPassword = *(std_string **)(g_manager->_lobbySettings)._password._buf; } (g_manager->_lobbySettings)._password._size = 0; managerPassword->_buf[0] = '\0'; online_lobby_join(&manager->_netplayManager,(void *)(*param_1 + lobbyIdx * 0xc), CONCAT44(lobbyRefCount,lobby)); std::vector::_Tidy(); std::string::_Tidy_deallocate(lobbySettings._password._buf); std::string::_Tidy_deallocate(lobbySettings._seed._buf); local_8._0_1_ = 1; if (0xf < lobbyPasswordCapacity) { uVar5 = lobbyPasswordCapacity + 1; pppppbVar4 = pppppbVar6; if (0xfff < uVar5) { pppppbVar4 = (byte *****)pppppbVar6[-1]; uVar5 = lobbyPasswordCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar6 + (-4 - (int)pppppbVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,uVar5); } piVar3 = local_a0; *(undefined4 *)local_a0[1] = 0; listNode = (undefined4 *)*local_a0; while (listNode != (undefined4 *)0x0) { nextNode = (undefined4 *)*listNode; local_8._0_1_ = 5; (**(code **)listNode[2])(); operator_delete(listNode,0x14); listNode = nextNode; } local_8._0_1_ = 0; operator_delete(piVar3,0x14); goto LAB_008e28fb; } LAB_008e27d6: local_8._0_1_ = 1; if (lobbyPasswordCapacity < 0x10) goto LAB_008e280d; uVar5 = lobbyPasswordCapacity + 1; pppppbVar4 = pppppbVar6; if (0xfff < uVar5) { pppppbVar4 = (byte *****)pppppbVar6[-1]; uVar5 = lobbyPasswordCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar6 + (-4 - (int)pppppbVar4))) goto LAB_008e2927; } operator_delete(pppppbVar4,uVar5); LAB_008e280d: lobbiesBegin = *param_1; lobbyOffset = lobbyOffset + 0xc; lobbyIdx = lobbyIdx + 1; } while (lobbyIdx < (uint)((param_1[1] - lobbiesBegin) / 0xc)); piVar3 = (int *)local_a0[1]; } ptr = local_a0; *piVar3 = 0; listNode = (undefined4 *)*local_a0; while (listNode != (undefined4 *)0x0) { nextNode = (undefined4 *)*listNode; local_8._0_1_ = 6; (**(code **)listNode[2])(); operator_delete(listNode,0x14); listNode = nextNode; } local_8._0_1_ = 0; operator_delete(ptr,0x14); } manager = g_manager; managerPassword = &(g_manager->_lobbySettings)._password; if (0xf < (g_manager->_lobbySettings)._password._capacity) { managerPassword = *(std_string **)(g_manager->_lobbySettings)._password._buf; } (g_manager->_lobbySettings)._password._size = 0; managerPassword->_buf[0] = '\0'; local_a0 = (int *)0xbb; seed_fart_sound_override((int *)&local_a0); SoundEffects::Play(&manager->_sfxManager,(int)local_a0,1.0,2,0,1.0,0.0); LAB_008e28fb: if (0xf < enteredPasswordCapacity) { uVar5 = enteredPasswordCapacity + 1; pppppbVar6 = enteredPassword[0]; if (0xfff < uVar5) { pppppbVar6 = (byte *****)enteredPassword[0][-1]; uVar5 = enteredPasswordCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)enteredPassword[0] + (-4 - (int)pppppbVar6))) { LAB_008e2927: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar6,uVar5); } ExceptionList = local_10; return; } //@@ 008e29b0 std::list::~list /* DB: ? frees every 0x14-byte node after calling the 12-byte element's virtual dtor (vtable at node+8), then the head; unwind-only callers in the lobby list code (008e1a70 Menu_OnlineLobbyList::lobby_search_callback a std::list with a self-linked 0x14 head and ConstLobby elements) */ void std::list::~list(void) { undefined4 *puVar1; undefined4 *puVar2; uint uVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; puStack_c = &LAB_00af1360; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; local_8 = 0; (**(code **)puVar1[2])(0,uVar3); operator_delete(puVar1,0x14); puVar1 = puVar2; } local_8 = 0xffffffff; operator_delete((void *)*in_ECX,0x14); ExceptionList = local_10; return; } //@@ 008e2a40 FUN_008e2a40 void FUN_008e2a40(void) { undefined4 *puVar1; undefined4 *puVar2; char cVar3; uint uVar4; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; puVar1[4] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if ((((int *)puVar1[6] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)puVar1[6] + 0xc))(uVar4), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(puVar1 + 5); } local_8 = 0xffffffff; puVar1[2] = KAGE::System::UserProfileBase::vftable; operator_delete(puVar1,0x1c); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x1c); ExceptionList = local_10; return; } //@@ 008e2b00 FUN_008e2b00 void FUN_008e2b00(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_008e3070(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x18) * 0x18; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008e2b80 FUN_008e2b80 void FUN_008e2b80(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_008e3100(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xffffffe0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008e2be0 FUN_008e2be0 void FUN_008e2be0(void) { FUN_008e3070(); return; } //@@ 008e2c00 FUN_008e2c00 void FUN_008e2c00(void) { FUN_008e3100(); return; } //@@ 008e2c20 std::vector::_Emplace_reallocate /* DB: MSVC vector growth with element size 0x18 (max 0xaaaaaaa), new element = KAGE::Network::Multiplayer::ConstLobby vftable + shared_ptr::assign + 8 bytes; caller FUN_008e1fb0 (lobby list builder, 'list too long', lobby_password) */ undefined4 * std::vector::_Emplace_reallocate(int param_1,int param_2) { uint uVar1; undefined4 *puVar2; int iVar3; undefined4 uVar4; void *pvVar5; undefined4 *puVar6; int *in_ECX; uint uVar7; undefined4 *puVar8; int iVar9; void *ptr; uint local_20; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b06753; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *in_ECX; iVar9 = (in_ECX[1] - *in_ECX) / 0x18; if (iVar9 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar9 + 1; uVar7 = (in_ECX[2] - *in_ECX) / 0x18; if (0xaaaaaaa - (uVar7 >> 1) < uVar7) { local_20 = 0xaaaaaaa; } else { uVar7 = (uVar7 >> 1) + uVar7; local_20 = uVar1; if (uVar1 <= uVar7) { local_20 = uVar7; } if (0xaaaaaaa < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = _Allocate(local_20 * 0x18); puVar2 = puVar6 + ((param_1 - iVar3) / 0x18) * 6; *puVar2 = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar2[1] = 0; puVar2[2] = 0; local_8 = 1; shared_ptr::assign(puVar2 + 1,(void *)(param_2 + 4)); uVar7 = local_8 >> 8; local_8 = local_8 & 0xffffff00; uVar4 = *(undefined4 *)(param_2 + 0x14); puVar2[4] = *(undefined4 *)(param_2 + 0x10); puVar2[5] = uVar4; iVar3 = in_ECX[1]; iVar9 = *in_ECX; if (param_1 == iVar3) { puVar8 = puVar6; local_8._1_3_ = (int3)uVar7; for (; local_8 = CONCAT31(local_8._1_3_,2), iVar9 != iVar3; iVar9 = iVar9 + 0x18) { *puVar8 = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar8[1] = 0; puVar8[2] = 0; local_8._0_1_ = 3; shared_ptr::assign(puVar8 + 1,(void *)(iVar9 + 4)); uVar4 = *(undefined4 *)(iVar9 + 0x10); puVar8[5] = *(undefined4 *)(iVar9 + 0x14); puVar8[4] = uVar4; puVar8 = puVar8 + 6; } FUN_008e3070(iVar3); } else { FUN_008e3230(iVar9,param_1,puVar6); FUN_008e3230(param_1,in_ECX[1],puVar2 + 6); } if (*in_ECX != 0) { FUN_008e3070(*in_ECX); pvVar5 = (void *)*in_ECX; uVar7 = ((in_ECX[2] - (int)pvVar5) / 0x18) * 0x18; ptr = pvVar5; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar5 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)puVar6; in_ECX[1] = (int)(puVar6 + uVar1 * 6); in_ECX[2] = (int)(puVar6 + local_20 * 6); ExceptionList = local_10; return puVar2; } //@@ 008e2e75 Catch_All@008e2e75 void Catch_All_008e2e75(void) { int unaff_EBP; FUN_008e2be0(*(undefined4 *)(unaff_EBP + -0x18),*(undefined4 *)(unaff_EBP + -0x24)); deallocate(*(void **)(unaff_EBP + -0x14),*(uint *)(unaff_EBP + -0x28)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 008e2ea0 FUN_008e2ea0 int FUN_008e2ea0(int param_1,undefined4 param_2) { uint uVar1; int iVar2; int iVar3; void *pvVar4; void *ptr; int *in_ECX; uint uVar5; void *pvVar6; void *extraout_ECX; int iVar7; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0677d; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = in_ECX[1] - iVar2 >> 5; if (iVar3 == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar5 = in_ECX[2] - iVar2 >> 5; if (0x7ffffff - (uVar5 >> 1) < uVar5) { local_20 = 0x7ffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; local_20 = uVar1; if (uVar1 <= uVar5) { local_20 = uVar5; } if (0x7ffffff < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = std::_Allocate(local_20 << 5); iVar7 = (param_1 - iVar2 & 0xffffffe0U) + (int)pvVar4; local_8 = 0; FUN_008e3190(param_2); iVar2 = in_ECX[1]; iVar3 = *in_ECX; if (param_1 == iVar2) { local_8 = CONCAT31(local_8._1_3_,1); pvVar6 = pvVar4; for (; iVar3 != iVar2; iVar3 = iVar3 + 0x20) { FUN_008e3190(iVar3); pvVar6 = extraout_ECX; } FUN_008e3100(pvVar6); } else { FUN_008e32f0(iVar3,param_1,pvVar4); FUN_008e32f0(param_1,in_ECX[1],iVar7 + 0x20); } if (*in_ECX != 0) { FUN_008e3100(*in_ECX); pvVar6 = (void *)*in_ECX; uVar5 = in_ECX[2] - (int)pvVar6 & 0xffffffe0; ptr = pvVar6; if (0xfff < uVar5) { ptr = *(void **)((int)pvVar6 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } *in_ECX = (int)pvVar4; in_ECX[1] = (int)(uVar1 * 0x20 + (int)pvVar4); in_ECX[2] = (int)(local_20 * 0x20 + (int)pvVar4); ExceptionList = local_10; return iVar7; } //@@ 008e3044 Catch_All@008e3044 void Catch_All_008e3044(void) { int unaff_EBP; FUN_008e2c00(*(undefined4 *)(unaff_EBP + -0x18),*(undefined4 *)(unaff_EBP + -0x2c)); FUN_00571230(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x28)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 008e3070 FUN_008e3070 void FUN_008e3070(void) { void **ppvVar1; char cVar2; uint uVar3; undefined4 *in_ECX; undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1360; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, in_ECX != in_EDX; in_ECX = in_ECX + 6) { *in_ECX = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if ((((int *)in_ECX[2] != (int *)0x0) && (cVar2 = (**(code **)(*(int *)in_ECX[2] + 0xc))(uVar3), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 1); } ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 008e3100 FUN_008e3100 void FUN_008e3100(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { iVar4 = in_ECX + 0xc; do { *(undefined ***)(iVar4 + -4) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)(iVar4 + 4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar4 + 4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(iVar4); } } *(undefined ***)(iVar4 + -0xc) = KAGE::System::UserProfileBase::vftable; iVar1 = iVar4 + 0x14; iVar4 = iVar4 + 0x20; } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 008e3190 FUN_008e3190 void FUN_008e3190(int param_1) { undefined4 uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b067b8; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = KAGE::System::UserProfileBase::vftable; in_ECX[1] = *(undefined4 *)(param_1 + 4); *in_ECX = KAGE::System::UserProfile::vftable; in_ECX[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; in_ECX[3] = 0; in_ECX[4] = 0; local_8 = 1; std::shared_ptr::assign(in_ECX + 3,(void *)(param_1 + 0xc)); uVar1 = *(undefined4 *)(param_1 + 0x1c); in_ECX[6] = *(undefined4 *)(param_1 + 0x18); in_ECX[7] = uVar1; ExceptionList = local_10; return; } //@@ 008e3230 FUN_008e3230 undefined4 * FUN_008e3230(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; uint uVar2; undefined4 in_ECX; undefined4 *puVar3; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; puStack_c = &LAB_00b067f8; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(auStack_7 + 3); ExceptionList = &local_10; auStack_7 = (undefined1 [3])0x0; if (param_1 != param_2) { puVar3 = param_1 + 4; do { *param_3 = KAGE::Network::Multiplayer::ConstLobby::vftable; param_3[1] = 0; param_3[2] = 0; local_8 = 1; std::shared_ptr::assign(param_3 + 1,puVar3 + -3); in_ECX = puVar3[1]; param_3[4] = *puVar3; puVar1 = puVar3 + 2; param_3[5] = in_ECX; param_3 = param_3 + 6; puVar3 = puVar3 + 6; } while (puVar1 != param_2); } local_8 = 0; FUN_008e3070(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 008e32f0 FUN_008e32f0 undefined4 * FUN_008e32f0(int param_1,int param_2,undefined4 *param_3) { int iVar1; uint uVar2; undefined4 in_ECX; void *value; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; puStack_c = &LAB_00b06840; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(auStack_7 + 3); ExceptionList = &local_10; auStack_7 = (undefined1 [3])0x0; if (param_1 != param_2) { value = (void *)(param_1 + 0xc); do { *param_3 = KAGE::System::UserProfileBase::vftable; param_3[1] = *(undefined4 *)((int)value + -8); *param_3 = KAGE::System::UserProfile::vftable; param_3[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; param_3[3] = 0; param_3[4] = 0; local_8 = 2; std::shared_ptr::assign(param_3 + 3,value); in_ECX = *(undefined4 *)((int)value + 0x10); param_3[6] = *(undefined4 *)((int)value + 0xc); param_3[7] = in_ECX; param_3 = param_3 + 8; iVar1 = (int)value + 0x14; value = (void *)((int)value + 0x20); } while (iVar1 != param_2); } local_8 = 0; FUN_008e3100(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 008e33c0 FUN_008e33c0 int * FUN_008e33c0(code *param_1) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *puVar3; char cVar4; int *piVar5; int *piVar6; int *in_ECX; int in_EDX; int *piVar7; int *local_1c; int *local_10; if (in_EDX == 0) { return (int *)*in_ECX; } if (in_EDX == 1) { return *(int **)*in_ECX; } piVar5 = (int *)FUN_008e33c0(param_1); piVar6 = (int *)FUN_008e33c0(param_1); local_1c = (int *)*in_ECX; cVar4 = (*param_1)(piVar5 + 2,local_1c + 2); local_10 = local_1c; if (cVar4 == '\0') { do { local_10 = (int *)*local_10; if (local_10 == piVar5) goto LAB_008e34b2; cVar4 = (*param_1)(piVar5 + 2,local_10 + 2); } while (cVar4 == '\0'); } else { local_1c = piVar5; } do { piVar7 = piVar5; do { piVar7 = (int *)*piVar7; if (piVar7 == piVar6) break; cVar4 = (*param_1)(piVar7 + 2,local_10 + 2); } while (cVar4 != '\0'); puVar1 = (undefined4 *)piVar5[1]; *puVar1 = piVar7; puVar2 = (undefined4 *)piVar7[1]; *puVar2 = local_10; puVar3 = (undefined4 *)local_10[1]; *puVar3 = piVar5; local_10[1] = (int)puVar2; piVar7[1] = (int)puVar1; piVar5[1] = (int)puVar3; if (piVar7 == piVar6) { LAB_008e34b2: *in_ECX = (int)local_1c; return piVar6; } do { local_10 = (int *)*local_10; if (local_10 == piVar7) goto LAB_008e34b2; cVar4 = (*param_1)(piVar7 + 2,local_10 + 2); piVar5 = piVar7; } while (cVar4 == '\0'); } while( true ); } //@@ 008e34e0 FUN_008e34e0 undefined4 FUN_008e34e0(undefined4 param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; int in_EDX; if (in_EDX == 0) { return *in_ECX; } if (in_EDX == 1) { return *(undefined4 *)*in_ECX; } FUN_008e34e0(param_1); uVar1 = FUN_008e34e0(param_1); uVar2 = std::list::_Merge_same(uVar1,param_1); *in_ECX = uVar2; return uVar1; } //@@ 008e3560 FUN_008e3560 void FUN_008e3560(void) { FUN_008e3100(); return; } //@@ 008e3570 FUN_008e3570 void FUN_008e3570(void) { FUN_008e3070(); return; } //@@ 008e3580 std::list::_Merge_same /* DB: MSVC list merge of two sorted runs [first,mid) [mid,last) with predicate param_2 on shared_ptr copies (std::shared_ptr::assign per compare), splicing nodes; only caller 008e34e0 (list::_Sort) next to Menu_Mods */ int * std::list::_Merge_same(int *param_1,code *param_2) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *puVar3; int *piVar4; char cVar5; int *in_ECX; int *in_EDX; int *piVar6; undefined4 local_58; undefined4 local_4c; undefined4 local_48; uint uStack_44; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b068dd; local_10 = ExceptionList; uStack_44 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_4c = 0; local_48 = 0; local_8 = 0; local_58 = 0x8e35e0; shared_ptr::assign(&local_4c,in_ECX + 3); local_58 = 0; local_8 = 2; shared_ptr::assign(&local_58,in_EDX + 3); local_8 = 0xffffffff; cVar5 = (*param_2)(); piVar4 = in_EDX; local_18 = in_ECX; while (cVar5 == '\0') { local_18 = (int *)*local_18; if (local_18 == in_EDX) { ExceptionList = local_10; return in_ECX; } local_4c = 0; local_48 = 0; local_8 = 3; local_58 = 0x8e3672; shared_ptr::assign(&local_4c,local_18 + 3); local_58 = 0; local_8 = 5; shared_ptr::assign(&local_58,in_EDX + 3); local_8 = 0xffffffff; cVar5 = (*param_2)(); piVar4 = in_ECX; } do { piVar6 = in_EDX; do { piVar6 = (int *)*piVar6; if (piVar6 == param_1) break; local_4c = 0; local_48 = 0; local_8 = 6; local_58 = 0x8e3704; shared_ptr::assign(&local_4c,local_18 + 3); local_58 = 0; local_8 = 8; shared_ptr::assign(&local_58,piVar6 + 3); local_8 = 0xffffffff; cVar5 = (*param_2)(); } while (cVar5 != '\0'); puVar1 = (undefined4 *)in_EDX[1]; *puVar1 = piVar6; puVar2 = (undefined4 *)piVar6[1]; *puVar2 = local_18; puVar3 = (undefined4 *)local_18[1]; *puVar3 = in_EDX; local_18[1] = (int)puVar2; piVar6[1] = (int)puVar1; in_EDX[1] = (int)puVar3; if (piVar6 == param_1) { ExceptionList = local_10; return piVar4; } do { local_18 = (int *)*local_18; if (local_18 == piVar6) { ExceptionList = local_10; return piVar4; } local_4c = 0; local_48 = 0; local_8 = 9; local_58 = 0x8e37be; shared_ptr::assign(&local_4c,local_18 + 3); local_58 = 0; local_8 = 0xb; shared_ptr::assign(&local_58,piVar6 + 3); local_8 = 0xffffffff; cVar5 = (*param_2)(); in_EDX = piVar6; } while (cVar5 == '\0'); } while( true ); } //@@ 008e3830 Menu_Mods::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager::Update case 0x10 (MainMenuType MODS): WidgetTab, "/disable.it" prototype: REPENTOGON */ void __thiscall Menu_Mods::Update(Menu_Mods *this) { char isActionTriggered; byte isDisableFileExists; char *modPath; undefined4 *puVar1; byte ****ppppbVar2; Menu_Mods MVar3; LayerState *widgetTabLayer; byte *modsDirEnd; void *freeBlock; Menu_Mods lastModIndex; uint freeSize; undefined4 heldUpAction; undefined4 menuUpAction; undefined4 confirmAction; uint local_78; int local_74; byte isWidgetTabVisible; void *local_6c; undefined4 local_5c; uint local_58; void *modsDir [4]; undefined4 local_44; uint local_40; byte ****disableFilePath; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; Manager *manager; undefined4 modEntry; byte *modsDirNext; int selectedMod; manager = g_manager; puStack_20 = (undefined1 *)(modsDir + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0691d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(modsDir + 0x11); ExceptionList = &local_1c; confirmAction = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&confirmAction,0,0,local_24); if (isActionTriggered == '\0') { menuUpAction = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&menuUpAction,0,0); if (isActionTriggered == '\0') { local_78 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_78,0,0); if (isActionTriggered == '\0') { local_74 = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_74,0,0); if (isActionTriggered == '\0') { local_74 = 0x1c; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_74,0,0); if (isActionTriggered != '\0') { (g_manager->_optionsConfig)._enableMods = (g_manager->_optionsConfig)._enableMods == 0; *(undefined1 *)(this + 0x49) = 1; } } else { FUN_0098aec0(); } } else if (((g_manager->_optionsConfig)._enableMods != 0) && ((MVar3 = this[1], MVar3 == (Menu_Mods)0x0 || ((0x31 < (int)MVar3 && ((int)MVar3 % 10 == 0)))))) { MVar3 = *this; *this = (Menu_Mods)((int)MVar3 + 1); if ((int)MVar3 + 1 < *(int *)&manager->field_0x2a6c4 - (int)manager->_modManager >> 2) { this[0x4a] = (Menu_Mods)((int)this[0x4a] + 4); } else { *this = (Menu_Mods)0x0; *(ModManager *)(this + 0x4a) = manager->_modManager; } } } else if (((g_manager->_optionsConfig)._enableMods != 0) && ((MVar3 = this[1], MVar3 == (Menu_Mods)0x0 || ((0x31 < (int)MVar3 && ((int)MVar3 % 10 == 0)))))) { *this = (Menu_Mods)((int)*this + -1); if ((int)*this < 0) { lastModIndex = (Menu_Mods) ((*(int *)&manager->field_0x2a6c4 - (int)manager->_modManager >> 2) + -1); MVar3 = (Menu_Mods)0x0; if (0 < (int)lastModIndex) { MVar3 = lastModIndex; } *this = MVar3; MVar3 = *(Menu_Mods *)&manager->field_0x2a6c4; this[0x4a] = MVar3; if (*(int *)&manager->field_0x2a6c4 - (int)manager->_modManager >> 2 != 0) { this[0x4a] = (Menu_Mods)((int)MVar3 + -4); } } else { this[0x4a] = (Menu_Mods)((int)this[0x4a] + -4); } } } else { if (((g_manager->_optionsConfig)._enableMods == 0) || (this[0x4a] == *(Menu_Mods *)&manager->field_0x2a6c4)) goto LAB_008e3c85; selectedMod = *(int *)this[0x4a]; *(bool *)(selectedMod + 0xfc) = *(char *)(selectedMod + 0xfc) == '\0'; modEntry = *(undefined4 *)this[0x4a]; local_44 = 0; local_40 = 0xf; modsDir[0] = (void *)0x0; modsDirNext = g_modsDirectory; do { modsDirEnd = modsDirNext; modsDirNext = modsDirEnd + 1; } while (*modsDirEnd != 0); std::string::assign((char *)modsDir,g_modsDirectory,(uint)(modsDirEnd + -0xc72e28)); local_14 = (void *)0x0; modPath = (char *)FUN_00651d50(modEntry); local_14._0_1_ = 1; puVar1 = std::string::append(modPath,(byte *)"/disable.it",0xb); disableFilePath = (byte ****)*puVar1; uStack_38 = puVar1[1]; uStack_34 = puVar1[2]; uStack_30 = puVar1[3]; local_2c = *(undefined8 *)(puVar1 + 4); puVar1[4] = 0; puVar1[5] = 0xf; *(undefined1 *)puVar1 = 0; local_14._0_1_ = 3; if (0xf < local_58) { freeSize = local_58 + 1; freeBlock = local_6c; if (0xfff < freeSize) { freeBlock = *(void **)((int)local_6c + -4); freeSize = local_58 + 0x24; if (0x1f < (uint)((int)local_6c + (-4 - (int)freeBlock))) goto LAB_008e39e8; } operator_delete(freeBlock,freeSize); } local_5c = 0; local_58 = 0xf; local_6c = (void *)((uint)local_6c & 0xffffff00); local_14._0_1_ = 4; if (0xf < local_40) { freeSize = local_40 + 1; freeBlock = modsDir[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)modsDir[0] + -4); freeSize = local_40 + 0x24; if (0x1f < (uint)((int)modsDir[0] + (-4 - (int)freeBlock))) { LAB_008e39e8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } local_44 = 0; local_40 = 0xf; modsDir[0] = (void *)((uint)modsDir[0] & 0xffffff00); if (*(char *)(*(int *)this[0x4a] + 0xfc) == '\0') { ppppbVar2 = (byte ****)&disableFilePath; if (0xf < local_2c._4_4_) { ppppbVar2 = disableFilePath; } puVar1 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)ppppbVar2,0); if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); } } else { ppppbVar2 = (byte ****)&disableFilePath; if (0xf < local_2c._4_4_) { ppppbVar2 = disableFilePath; } isDisableFileExists = file_exists((byte *)ppppbVar2); if (isDisableFileExists != 0) { ppppbVar2 = (byte ****)&disableFilePath; if (0xf < local_2c._4_4_) { ppppbVar2 = disableFilePath; } remove((char *)ppppbVar2); } } local_14 = (void *)0xffffffff; *(undefined1 *)(this + 0x49) = 1; if (0xf < local_2c._4_4_) { freeSize = local_2c._4_4_ + 1; ppppbVar2 = disableFilePath; if (0xfff < freeSize) { ppppbVar2 = (byte ****)disableFilePath[-1]; freeSize = local_2c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)disableFilePath + (-4 - (int)ppppbVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar2,freeSize); } local_2c = 0xf00000000; disableFilePath = (byte ****)((uint)disableFilePath & 0xffffff00); } LAB_008e3c85: local_78 = (uint)((g_manager->_optionsConfig)._enableMods == 0); if ((this[0x11] != (Menu_Mods)0x0) && ((0xc < *(int *)((int)this[0x10] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0xc < *(int *)((int)this[0x10] + 0x80))))) { MVar3 = this[0x11]; local_74 = *(int *)((int)MVar3 + 0x68); if ((MVar3 == (Menu_Mods)0x0) || ((local_74 < 0 || (*(int *)((int)MVar3 + 0x1c) <= local_74)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)this[0x12] + local_74 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(this + 0x10),local_74,(float)(int)local_78); } isWidgetTabVisible = g_menuControllerIndex == 0; widgetTabLayer = ANM2::GetLayer((ANM2 *)(this + 4),(byte *)"WidgetTab"); widgetTabLayer->_visible = isWidgetTabVisible; local_74 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_74,0,0); if (isActionTriggered == '\0') { heldUpAction = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&heldUpAction,0,0); if (isActionTriggered == '\0') { this[1] = (Menu_Mods)0x0; ExceptionList = local_1c; return; } } this[1] = (Menu_Mods)((int)this[1] + 1); ExceptionList = local_1c; return; } //@@ 008e3db0 AnimationLayer::RenderFrame /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix65/69] __thiscall void AnimationLayer::RenderFrame(const Vector& position, int frameIndex, const Vector& topLeftClamp, const Vector& BottomRightClamp, ANM2* animation); */ void __thiscall AnimationLayer::RenderFrame(AnimationLayer *this) { code *pcVar1; KColor color; KColor color_00; Vector pos; Manager *pMVar2; MenuManager *pMVar3; ANM2 *pAVar4; byte bVar5; AnimationLayer AVar6; uint uVar7; float *pfVar8; void *pvVar9; int iVar10; byte *pbVar11; char *pcVar12; AnimationState *pAVar13; int iVar14; ModManager MVar15; bool bVar16; float fVar17; undefined1 local_1b8 [20]; undefined8 local_1a4; undefined4 local_198; undefined4 local_194; undefined4 local_190; undefined4 local_18c; undefined4 local_188; undefined4 local_184; undefined4 local_180; undefined4 local_17c; undefined4 local_178; undefined4 local_174; undefined4 local_170; undefined4 local_16c; undefined4 local_168; undefined4 local_164; undefined4 local_160; undefined4 uStack_15c; undefined4 uStack_158; undefined4 uStack_154; Vector local_150; undefined4 local_148; undefined4 uStack_144; Vector VStack_140; ANM2 *local_134; AnimationLayer *local_130; Manager *local_12c; Vector local_128; Vector local_120; Vector local_118; float local_110; Vector local_10c; AnimationLayer local_104; float local_100; float local_fc; char local_f8 [72]; char local_b0 [72]; byte local_68 [68]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_68 + 100; local_14 = 0xffffffff; puStack_18 = &LAB_00b06981; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_68 + 0x58); ExceptionList = &local_1c; local_134 = (ANM2 *)(this + 4); AVar6 = this[0x11]; local_120.x = (g_menuManager->_ViewPosition).x + (float)this[2] + 200.0; local_120.y = (g_menuManager->_ViewPosition).y + (float)this[3] + 0.0; local_130 = this; local_100 = local_120.y; local_fc = local_120.x; if (AVar6 == (AnimationLayer)0x0) { LAB_008e3e98: bVar5 = ANM2::SetAnimation(local_134,&DAT_00b6767c,1); pbVar11 = puStack_20; if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; pbVar11 = puStack_20; } } else { if (0xf < *(uint *)((int)AVar6 + 0x14)) { AVar6 = *(AnimationLayer *)AVar6; } pbVar11 = &DAT_00b6767c; do { bVar5 = *(byte *)AVar6; bVar16 = bVar5 < *pbVar11; if (bVar5 != *pbVar11) { LAB_008e3e80: uVar7 = -(uint)bVar16 | 1; goto LAB_008e3e85; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)AVar6 + 1); bVar16 = bVar5 < pbVar11[1]; if (bVar5 != pbVar11[1]) goto LAB_008e3e80; AVar6 = (AnimationLayer)((int)AVar6 + 2); pbVar11 = pbVar11 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_008e3e85: if ((uVar7 != 0) || ((pbVar11 = local_68 + 100, *(char *)((int)this[0x11] + 0x34) != '\0' && (pbVar11 = local_68 + 100, *(char *)(this + 0x15) == '\0')))) goto LAB_008e3e98; } puStack_20 = pbVar11; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render((AnimationState *)(this + 0x10),&local_120,&g_vectorZero,&g_vectorZero) ; AnimationState::Render((AnimationState *)(this + 0x18),&local_120,&g_vectorZero,&g_vectorZero) ; local_100 = local_120.y; local_fc = local_120.x; } else { AnimationState::Render((AnimationState *)(this + 0x18),&local_120,&g_vectorZero,&g_vectorZero) ; AnimationState::Render((AnimationState *)(this + 0x10),&local_120,&g_vectorZero,&g_vectorZero) ; local_100 = local_120.y; local_fc = local_120.x; } } if (((g_menuControllerIndex != 0) && (this[0x11] != (AnimationLayer)0x0)) && (pfVar8 = AnimationState::GetNullFrame((AnimationState *)(this + 0x10),(byte *)"WidgetButton"), pfVar8 != (float *)0x0)) { local_128.y = pfVar8[1] + local_100; local_128.x = *pfVar8 + local_fc; pos.y = local_128.y; pos.x = local_128.x; render_input_button_icon (g_menuControllerIndex,0x1c,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ); } local_10c.y = 9.80909e-45; local_12c = g_manager; local_118.y = 1.7299e-41; local_1a4 = 0x900000005; local_110 = 0.0; local_104 = (AnimationLayer) (((uint)((*(int *)&g_manager->field_0x2a6c4 - (int)g_manager->_modManager >> 2) * 0x19 ) >> 5) + 1); if (local_104 != (AnimationLayer)0x0) { do { if (local_118.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = (uint)local_118.y >> ((byte)local_1a4 & 0x1f) ^ (uint)local_118.y; uVar7 = uVar7 << ((byte)((ulonglong)local_1a4 >> 0x20) & 0x1f) ^ uVar7; local_118.y = (float)(uVar7 >> (SUB41(local_10c.y,0) & 0x1f) ^ uVar7); sprintf_s(local_68,0x40,(byte *)"Piece%d"); AVar6 = this[0x11]; if (AVar6 == (AnimationLayer)0x0) { LAB_008e414c: bVar5 = ANM2::SetAnimation((ANM2 *)(this + 4),local_68,1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; } } else { if (0xf < *(uint *)((int)AVar6 + 0x14)) { AVar6 = *(AnimationLayer *)AVar6; } pbVar11 = local_68; do { bVar5 = *(byte *)AVar6; bVar16 = bVar5 < *pbVar11; if (bVar5 != *pbVar11) { LAB_008e4134: uVar7 = -(uint)bVar16 | 1; goto LAB_008e4139; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)AVar6 + 1); bVar16 = bVar5 < pbVar11[1]; if (bVar5 != pbVar11[1]) goto LAB_008e4134; AVar6 = (AnimationLayer)((int)AVar6 + 2); pbVar11 = pbVar11 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_008e4139: if ((uVar7 != 0) || ((*(char *)((int)this[0x11] + 0x34) != '\0' && (*(char *)(this + 0x15) == '\0')))) goto LAB_008e414c; } local_110 = (float)((int)local_110 + 1); VStack_140.x = local_fc + 0.0; VStack_140.y = (float)(int)local_110 * 32.0 + local_100; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x10),&VStack_140,&g_vectorZero,&g_vectorZero); pAVar13 = (AnimationState *)(this + 0x18); } else { AnimationState::Render ((AnimationState *)(this + 0x18),&VStack_140,&g_vectorZero,&g_vectorZero); pAVar13 = (AnimationState *)(this + 0x10); } AnimationState::Render(pAVar13,&VStack_140,&g_vectorZero,&g_vectorZero); } } while ((int)local_110 < (int)local_104); } AVar6 = this[0x11]; if (AVar6 != (AnimationLayer)0x0) { if (0xf < *(uint *)((int)AVar6 + 0x14)) { AVar6 = *(AnimationLayer *)AVar6; } pcVar12 = "Bottom"; do { bVar5 = *(byte *)AVar6; bVar16 = bVar5 < (byte)*pcVar12; if (bVar5 != *pcVar12) { LAB_008e4255: uVar7 = -(uint)bVar16 | 1; goto LAB_008e425a; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)AVar6 + 1); bVar16 = bVar5 < (byte)pcVar12[1]; if (bVar5 != pcVar12[1]) goto LAB_008e4255; AVar6 = (AnimationLayer)((int)AVar6 + 2); pcVar12 = pcVar12 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_008e425a: if ((uVar7 == 0) && ((*(char *)((int)this[0x11] + 0x34) == '\0' || (*(char *)(this + 0x15) != '\0')))) goto LAB_008e428b; } bVar5 = ANM2::SetAnimation((ANM2 *)(this + 4),(byte *)"Bottom",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x10)); *(undefined1 *)(this + 0x15) = 1; } LAB_008e428b: local_10c.x = local_fc + 0.0; local_10c.y = (float)(int)local_104 * 32.0 + local_100; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render((AnimationState *)(this + 0x10),&local_10c,&g_vectorZero,&g_vectorZero) ; pAVar13 = (AnimationState *)(this + 0x18); } else { AnimationState::Render((AnimationState *)(this + 0x18),&local_10c,&g_vectorZero,&g_vectorZero) ; pAVar13 = (AnimationState *)(this + 0x10); } AnimationState::Render(pAVar13,&local_10c,&g_vectorZero,&g_vectorZero); } MVar15 = local_12c->_modManager; iVar14 = *(int *)&local_12c->field_0x2a6c4 - (int)MVar15 >> 2; if ((g_manager->_optionsConfig)._enableMods == 0) { local_104 = (AnimationLayer)0x0; if (iVar14 != 0) { local_fc = local_fc - 90.0; local_118.x = 0.8; local_118.y = 1.0; do { local_10c.y = (float)((int)local_104 + 1); sprintf_s(local_68,0x40,(byte *)"%d.%s"); local_160 = 0x3f008081; uStack_15c = 0x3f008081; uStack_158 = 0x3f008081; uStack_154 = 0x3f800000; if (*(char *)(*(int *)MVar15 + 0xfe) != '\0') { local_160 = 0x3f800000; uStack_15c = 0x3f000000; uStack_158 = 0x3f000000; uStack_154 = 0x3f800000; strncpy(local_f8,(char *)local_68,0x40); sprintf_s(local_68,0x40,(byte *)"%s[Old]"); } pMVar2 = g_manager; local_198 = 0; local_194 = 0xffff; local_190 = 0; local_18c = 0x3f800000; local_188 = 0xffffffff; local_184 = 0; local_180 = 0; local_14 = 2; local_134 = (ANM2 *)((float)((double)(int)local_104 + __uint_to_double_fixup[-((int)local_104 >> 0x1f)]) * 25.0 + local_100); pvVar9 = Font::measure_string (&g_manager->_font2_TeamMeatEx12,local_1b8,local_68,&local_198,&local_118 ); local_14 = CONCAT31(local_14._1_3_,3); color_00._green = (float)uStack_15c; color_00._red = (float)local_160; color_00._blue = (float)uStack_158; color_00._alpha = (float)uStack_154; color_00._unk = 0; Font::render_glyph_quads (&pMVar2->_font2_TeamMeatEx12,pvVar9,local_fc,(float)local_134,0.8,1.0,color_00, &local_198); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); MVar15 = (ModManager)((int)MVar15 + 4); local_14 = 0xffffffff; local_104 = (AnimationLayer)local_10c.y; } while ((uint)local_10c.y < (uint)(*(int *)&local_12c->field_0x2a6c4 - (int)local_12c->_modManager >> 2)); this = local_130; } } else { local_118.y = 0.0; if (iVar14 != 0) { local_150.x = 0.8; local_110 = local_fc - 90.0; local_150.y = 1.0; do { local_104 = (AnimationLayer)((int)local_118.y + 1); sprintf_s(local_68,0x40,(byte *)"%d.%s"); local_148 = 0; uStack_144 = 0; VStack_140.x = 0.0; if (*(char *)(*(int *)MVar15 + 0xfc) == '\0') { local_148 = 0x3f008081; uStack_144 = 0x3f008081; VStack_140.x = 0.5019608; } VStack_140.y = 1.0; if (*(char *)(*(int *)MVar15 + 0xfe) != '\0') { local_148 = 0x3f800000; uStack_144 = 0; VStack_140.x = 0.0; VStack_140.y = 1.0; strncpy(local_b0,(char *)local_68,0x40); sprintf_s(local_68,0x40,(byte *)"%s[Old]"); } pMVar2 = g_manager; local_17c = 0; local_178 = 0xffff; local_174 = 0; local_170 = 0x3f800000; local_16c = 0xffffffff; local_168 = 0; local_164 = 0; local_14 = 0; local_10c.y = (float)((double)(int)local_118.y + __uint_to_double_fixup[-((int)local_118.y >> 0x1f)]) * 25.0 + local_100 ; pvVar9 = Font::measure_string (&g_manager->_font2_TeamMeatEx12,&local_160,local_68,&local_17c, &local_150); local_14 = CONCAT31(local_14._1_3_,1); color._green = (float)uStack_144; color._red = (float)local_148; color._blue = VStack_140.x; color._alpha = VStack_140.y; color._unk = 0; Font::render_glyph_quads (&pMVar2->_font2_TeamMeatEx12,pvVar9,local_110,local_10c.y,0.8,1.0,color, &local_17c); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); this = local_130; local_14 = 0xffffffff; if (*local_130 == (AnimationLayer)local_118.y) { local_10c.y = *(float *)(local_130 + 0x11); if ((AnimationLayer)local_10c.y == (AnimationLayer)0x0) { LAB_008e45d3: bVar5 = ANM2::SetAnimation((ANM2 *)(local_130 + 4),(byte *)"Cursor",1); pAVar4 = local_134; if (bVar5 != 0) { AnimationState::Rewind(&local_134->_animState); (pAVar4->_animState)._isPlaying = 1; this = local_130; } } else { AVar6 = (AnimationLayer)local_10c.y; if (0xf < *(uint *)((int)local_10c.y + 0x14)) { AVar6 = *(AnimationLayer *)local_10c.y; } pcVar12 = "Cursor"; do { bVar5 = *(byte *)AVar6; bVar16 = bVar5 < (byte)*pcVar12; if (bVar5 != *pcVar12) { LAB_008e45b0: uVar7 = -(uint)bVar16 | 1; goto LAB_008e45b5; } if (bVar5 == 0) break; bVar5 = *(byte *)((int)AVar6 + 1); bVar16 = bVar5 < (byte)pcVar12[1]; if (bVar5 != pcVar12[1]) goto LAB_008e45b0; AVar6 = (AnimationLayer)((int)AVar6 + 2); pcVar12 = pcVar12 + 2; } while (bVar5 != 0); uVar7 = 0; LAB_008e45b5: if ((uVar7 != 0) || ((*(byte *)((int)local_10c.y + 0x34) != 0 && (*(char *)(local_130 + 0x15) == '\0')))) goto LAB_008e45d3; } local_128.x = local_fc - 93.0; local_128.y = ((float)((double)(int)local_104 + __uint_to_double_fixup[-((int)local_104 >> 0x1f)]) * 25.0 - 16.0) + local_100; if (this[0x46].field_0x1 != '\0') { if (*(char *)(this + 0x20) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x10),&local_128,&g_vectorZero,&g_vectorZero); pAVar13 = (AnimationState *)(this + 0x18); } else { AnimationState::Render ((AnimationState *)(this + 0x18),&local_128,&g_vectorZero,&g_vectorZero); pAVar13 = (AnimationState *)(this + 0x10); } AnimationState::Render(pAVar13,&local_128,&g_vectorZero,&g_vectorZero); } } MVar15 = (ModManager)((int)MVar15 + 4); local_118.y = (float)local_104; } while ((uint)local_104 < (uint)(*(int *)&local_12c->field_0x2a6c4 - (int)local_12c->_modManager >> 2)); } } pMVar3 = g_menuManager; AVar6 = *this; fVar17 = -216.0; iVar14 = *(int *)&g_manager->field_0x2a6c4 - (int)g_manager->_modManager >> 2; if (4 < (int)AVar6) { iVar10 = iVar14 + -7; if ((int)AVar6 < iVar14 + -3) { iVar10 = (int)AVar6 + -4; } fVar17 = -216.0 - (float)(iVar10 * 0x19); } g_menuManager->_viewPositionSet[0x10].y = fVar17; pMVar3->_state = 1; ExceptionList = local_1c; return; } //@@ 008e4970 Menu_Mods::reset /* DB: ? MenuManager::SetState case 0x10 (MODS) and MenuManager::LoadGraphics right after loading ModsMenu.anm2: plays the default anim and rewinds */ void Menu_Mods::reset(void) { byte *pbVar1; MenuManager *pMVar2; byte bVar3; byte *pbVar4; uint uVar5; undefined4 *in_ECX; byte *pbVar6; bool bVar7; pbVar1 = (byte *)in_ECX[0x11]; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pbVar6 = &DAT_00b6767c; do { bVar3 = *pbVar4; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_008e49b0: uVar5 = -(uint)bVar7 | 1; goto LAB_008e49b5; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_008e49b0; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008e49b5: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x15) != '\0')))) goto LAB_008e49e2; } bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),&DAT_00b6767c,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0x15) = 1; } LAB_008e49e2: pMVar2 = g_menuManager; *in_ECX = 0; in_ECX[1] = 0; pMVar2->_viewPositionSet[7].y = -216.0; pMVar2->_state = 1; *(ModManager *)(in_ECX + 0x4a) = g_manager->_modManager; *(undefined1 *)(in_ECX + 0x49) = 0; return; } //@@ 008e4a20 FUN_008e4a20 void FUN_008e4a20(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afb440; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)(in_ECX + 0x240) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)(in_ECX + 0x248) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x248) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 0x244); } } local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x118)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x168)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x148)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x130)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x118)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x54)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); ExceptionList = local_10; return; } //@@ 008e4b10 Menu_Online::Update /* DB: MenuManager::Update case 0x13: Cursor, "Daily Run"/"Friend Match"/"Options" entries; render 008e4e30 Menu_Online::Render ...) prototype: REPENTOGON */ void __thiscall Menu_Online::Update(Menu_Online *this) { byte bVar1; char isActionTriggered; int iVar2; LayerState *cursorLayer; int unused; undefined4 menuAction; undefined4 upAction; int soundId; char *entryAnim; Manager *manager; int *state; bVar1 = NetplayManager::check_connection(&g_manager->_netplayManager); if (bVar1 == 0) { return; } if (((g_manager->_framecount & 1) == 0) && ((this->_anm2)._loaded != 0)) { AnimationState::Update(&(this->_anm2)._animState); AnimationState::Update(&(this->_anm2)._overlayAnimState); } upAction = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&upAction,0,0); if (isActionTriggered == '\0') { menuAction = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&menuAction,0,0); if (isActionTriggered != '\0') { iVar2 = this->_prevState; if ((iVar2 == 0) || ((0x31 < iVar2 && (iVar2 % 10 == 0)))) { this->_state = this->_state + 1; if (4 < this->_state) { this->_state = this->_state + -5; } goto LAB_008e4c1e; } goto LAB_008e4c65; } iVar2 = 0; } else { iVar2 = this->_prevState; if ((iVar2 == 0) || ((0x31 < iVar2 && (iVar2 % 10 == 0)))) { state = &this->_state; *state = *state + -1; if (*state < 0) { this->_state = this->_state + 5; } LAB_008e4c1e: manager = g_manager; soundId = 0x11a; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); iVar2 = this->_prevState; } LAB_008e4c65: iVar2 = iVar2 + 1; } this->_prevState = iVar2; iVar2 = this->_state; if (iVar2 == 0) { entryAnim = "Quick Match"; } else if (iVar2 == 1) { entryAnim = "Public Match"; } else if (iVar2 == 2) { entryAnim = "Friend Match"; } else if (iVar2 == 3) { entryAnim = "Daily Run"; } else { if (iVar2 != 4) goto LAB_008e4cc5; entryAnim = "Options"; } ANM2::Play((ANM2 *)&this->field_0x118,(byte *)entryAnim,0); LAB_008e4cc5: if (((g_manager->_framecount & 1) != 0) && (this->field_0x221 != '\0')) { AnimationState::Update((AnimationState *)&this->field_0x148); AnimationState::Update((AnimationState *)&this->field_0x168); } menuAction = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&menuAction,0,0); if (isActionTriggered == '\0') { menuAction = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&menuAction,0,0); if (isActionTriggered != '\0') { FUN_0098aec0(); } } else { switch(this->_state) { case 0: bVar1 = show_beta_disclaimer_popup(1,FUN_008e68a0,this); if (bVar1 == 0) { start_quick_match(); } break; case 1: bVar1 = show_beta_disclaimer_popup(1,FUN_008e68a0,this); if (bVar1 == 0) { FUN_008e56b0(); } break; case 2: bVar1 = show_beta_disclaimer_popup(1,FUN_008e68a0,this); if (bVar1 == 0) { FUN_008e5720(); } break; case 3: MenuManager::push_menu(4,unused); break; case 4: MenuManager::push_menu(0x14,unused); } } cursorLayer = ANM2::GetLayer(&this->_anm2,(byte *)"Cursor"); if (cursorLayer == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); return; } ANM2::SetLayerFrame(&this->_anm2,*(int *)cursorLayer->_layerData,this->_state); return; } //@@ 008e4e30 Menu_Online::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: "#Online/ONLINE_DAILY/FRIEND/OPTIONS/PUBLIC/QUICK_DESCRIPTOR", BackButton/BackKey, calls Menu_Online::render_descriptor; in MenuManager::Render menu list prototype: REPENTOGON */ void __thiscall Menu_Online::Render(Menu_Online *this) { byte bVar1; Vector pos; Vector scale; LayerState *backKeyLayer; byte *translatedText; int iVar2; float *nullFrame; byte *pbVar3; void *freeBlock; AnimationState *topAnimState; uint freeSize; Vector renderPos; byte isKeyboard; std_string descriptor; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; float menuX; float menuY; puStack_20 = (undefined1 *)((int)&descriptor + 0x40); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b069dd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((int)&descriptor + 0x34U); ExceptionList = &local_1c; isKeyboard = g_menuControllerIndex == 0; backKeyLayer = ANM2::GetLayer(&this->_anm2,(byte *)"BackKey"); backKeyLayer->_visible = isKeyboard; renderPos.x = (g_menuManager->_ViewPosition).x + *(float *)(this + 1); renderPos.y = (g_menuManager->_ViewPosition).y + *(float *)this[1]._anm2._filename._buf; if ((this->_anm2)._loaded != 0) { if ((this->_anm2)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_anm2)._animState,&renderPos,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->_anm2)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render (&(this->_anm2)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); AnimationState::Render(&(this->_anm2)._animState,&renderPos,&g_vectorZero,&g_vectorZero); } } menuY = renderPos.y; menuX = renderPos.x; iVar2 = this->_state; if (iVar2 == 0) { translatedText = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/ONLINE_QUICK_DESCRIPTOR"); descriptor._size = 0; descriptor._capacity = 0xf; descriptor._buf._0_4_ = (void *)0x0; pbVar3 = translatedText; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign(descriptor._buf,translatedText,(int)pbVar3 - (int)(translatedText + 1)); local_14 = (void *)0x0; LAB_008e4f9b: render_descriptor(this,&descriptor); local_14 = (void *)0xffffffff; if (descriptor._capacity < 0x10) goto LAB_008e4fe1; freeSize = descriptor._capacity + 1; freeBlock = (void *)descriptor._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(descriptor._buf._0_4_ + -4); iVar2 = descriptor._buf._0_4_ - (int)freeBlock; joined_r0x008e5119: freeSize = descriptor._capacity + 0x24; if (0x1f < iVar2 - 4U) { local_14 = (void *)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { if (iVar2 == 1) { translatedText = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/ONLINE_PUBLIC_DESCRIPTOR"); descriptor._size = 0; descriptor._capacity = 0xf; descriptor._buf._0_4_ = (void *)0x0; pbVar3 = translatedText; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign(descriptor._buf,translatedText,(int)pbVar3 - (int)(translatedText + 1)); local_14 = (void *)0x1; goto LAB_008e4f9b; } if (iVar2 == 2) { pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/ONLINE_FRIEND_DESCRIPTOR"); std::string::string_from_cstr(descriptor._buf,pbVar3); local_14 = (void *)0x2; goto LAB_008e4f9b; } if (iVar2 == 3) { pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/ONLINE_DAILY_DESCRIPTOR"); std::string::string_from_cstr(descriptor._buf,pbVar3); local_14 = (void *)0x3; goto LAB_008e4f9b; } if (iVar2 != 4) goto LAB_008e4fe1; pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/ONLINE_OPTIONS_DESCRIPTOR"); std::string::string_from_cstr(descriptor._buf,pbVar3); local_14 = (void *)0x4; render_descriptor(this,&descriptor); local_14 = (void *)0xffffffff; if (descriptor._capacity < 0x10) goto LAB_008e4fe1; freeSize = descriptor._capacity + 1; freeBlock = (void *)descriptor._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(descriptor._buf._0_4_ + -4); iVar2 = descriptor._buf._0_4_ - (int)freeBlock; goto joined_r0x008e5119; } } local_14 = (void *)0xffffffff; operator_delete(freeBlock,freeSize); LAB_008e4fe1: if ((this->_anm2)._animState._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(&(this->_anm2)._animState,(byte *)"Doodle Position"); } renderPos.x = menuX + *nullFrame; renderPos.y = menuY + nullFrame[1]; if (this->field_0x221 != '\0') { if (this->field_0x188 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x148,&renderPos,&g_vectorZero,&g_vectorZero); topAnimState = (AnimationState *)&this->field_0x168; } else { AnimationState::Render ((AnimationState *)&this->field_0x168,&renderPos,&g_vectorZero,&g_vectorZero); topAnimState = (AnimationState *)&this->field_0x148; } AnimationState::Render(topAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } if (isKeyboard == 0) { if ((this->_anm2)._animState._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(&(this->_anm2)._animState,(byte *)"BackButton"); } renderPos.y = menuY + nullFrame[1]; renderPos.x = menuX + *nullFrame; descriptor._capacity = 0; pos.y = renderPos.y; pos.x = renderPos.x; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0xf,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); } ExceptionList = local_1c; return; } //@@ 008e5260 Menu_Online::enter /* DB: ? MenuManager::SetState state 0x13 with ECX = MenuManager+0xda98 (Menu_Online): sets "Idle", +0x22c = 1 / +0x230 = 0, then if a pending ConstLobby is set in Manager calls online_lobby_join */ void Menu_Online::enter(void) { byte bVar1; char cVar2; uint uVar3; byte *currentAnimName; uint uVar4; int in_ECX; byte *idleName; bool bVar5; undefined4 uVar6; undefined **joinLobby; undefined4 joinLobbyPtr; int *joinLobbyRefCount; undefined **pendingLobby; int *pendingLobbyPtr; int *pendingLobbyRefCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; Manager *manager; undefined1 *pendingLobbySrc; local_8 = 0xffffffff; puStack_c = &LAB_00b06a35; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; animData = *(byte **)(in_ECX + 0x38); if (animData == (byte *)0x0) { LAB_008e52d3: bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x34)); *(undefined1 *)(in_ECX + 0x48) = 1; } } else { currentAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { currentAnimName = *(byte **)animData; } idleName = s_Idle; do { bVar1 = *currentAnimName; bVar5 = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_008e52c0: uVar4 = -(uint)bVar5 | 1; goto LAB_008e52c5; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; bVar5 = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_008e52c0; currentAnimName = currentAnimName + 2; idleName = idleName + 2; } while (bVar1 != 0); uVar4 = 0; LAB_008e52c5: if ((uVar4 != 0) || ((animData[0x34] != 0 && (*(char *)(in_ECX + 0x48) == '\0')))) goto LAB_008e52d3; } manager = g_manager; *(undefined4 *)(in_ECX + 0x230) = 0; *(undefined4 *)(in_ECX + 0x22c) = 1; pendingLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; pendingLobbyPtr = (int *)0x0; pendingLobbyRefCount = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&pendingLobbyPtr,&manager[1]._gamestate.field_0x8ec); local_8 = 1; if (pendingLobbyPtr != (int *)0x0) { cVar2 = (**(code **)(*pendingLobbyPtr + 0xc))(uVar3); if (cVar2 != '\0') { bVar5 = true; goto LAB_008e5354; } } bVar5 = false; LAB_008e5354: pendingLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 2; if (pendingLobbyRefCount != (int *)0x0) { cVar2 = (**(code **)(*pendingLobbyRefCount + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&pendingLobbyPtr); } } manager = g_manager; if (bVar5) { joinLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; joinLobbyPtr = 0; joinLobbyRefCount = (int *)0x0; pendingLobbySrc = &g_manager[1]._gamestate.field_0x8ec; local_8 = 3; uVar6 = 0x8e53c2; std::shared_ptr::assign(&joinLobbyPtr,pendingLobbySrc); local_8 = 4; online_lobby_join(&manager->_netplayManager,&joinLobby,CONCAT44(pendingLobbySrc,uVar6)); joinLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if (joinLobbyRefCount != (int *)0x0) { cVar2 = (**(code **)(*joinLobbyRefCount + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&joinLobbyPtr); } } } ExceptionList = local_10; return; } //@@ 008e5420 Menu_Online::start_quick_match /* DB: ? Menu_Online::Update state 0 (and FUN_008e68a0 option 0) after show_beta_disclaimer_popup: resets daily challenge+LobbySettings, pushes popup ##GAME###Online/SEARCHING_FOR_LOBBIES, set_service_provider, lobby search (FUN_00a542c0) with callback 008e5f40 Menu_Online::on_quick_match_search_result void Menu_Online::start_quick_match(void) { int iVar1; void *in_ECX; uint freeSize; void *freeBlock; undefined1 local_f4 [48]; undefined4 local_c4; undefined1 local_a0 [12]; undefined1 local_94 [12]; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; Vector popupSize; undefined4 textEntry; char *entryText; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 uStack_2c; void *pvStack_28; undefined4 uStack_24; int local_20; void *local_1c; float local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; manager = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b06a78; local_10 = ExceptionList; ExceptionList = &local_10; (g_manager->_dailyChallenge)._id = 0; (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(manager->_dailyChallenge)._params); LobbySettings::reset(&g_manager->_lobbySettings); popupSize.x = (float)&DAT_bf800000; popupSize.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_f4,&g_manager->_font2_TeamMeatEx12,online_quick_match_popup_callback,in_ECX, &popupSize); local_8 = 0; local_30 = 0x3e5cdcdd; uStack_2c = 0x3e2cacad; pvStack_28 = (void *)0x3e34b4b5; uStack_24 = 0x3f800000; local_1c = (void *)g_vectorZero.x; textEntry = 0; entryText = "##GAME###Online/SEARCHING_FOR_LOBBIES"; local_38 = 0xffffffff; local_34 = 0xffffffff; local_20 = 0; local_18 = g_vectorZero.y; local_14 = 1; std::vector<48byte>::push_back(&textEntry); local_c4 = 1000; local_70 = 0xdeadbeef; iVar1 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_f4); *(int *)((int)in_ECX + 0x23c) = iVar1; local_34 = 0x32; pvStack_28 = (void *)0x0; uStack_24 = 0; local_20 = 0; local_1c = (void *)0x0; local_18 = 0.0; local_14 = 0; local_8 = CONCAT31(local_8._1_3_,1); local_30 = 1; uStack_2c = 1; iVar1 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar1 == 2) || (iVar1 == 3)) { iVar1 = 3; } else { iVar1 = 2; } Multiplayer::set_service_provider(iVar1); KAGE::Network::MultiplayerManager::request_lobby_list (&DAT_00c79a50,&local_34,on_quick_match_search_result,in_ECX); FUN_00a539f0(); if (local_1c != (void *)0x0) { freeSize = ((local_14 - (int)local_1c) / 0x18) * 0x18; freeBlock = local_1c; if (0xfff < freeSize) { freeBlock = *(void **)((int)local_1c + -4); freeSize = freeSize + 0x23; if (0x1f < (uint)((int)local_1c + (-4 - (int)freeBlock))) goto LAB_008e5642; } operator_delete(freeBlock,freeSize); } if (pvStack_28 != (void *)0x0) { freeSize = ((local_20 - (int)pvStack_28) / 0x18) * 0x18; freeBlock = pvStack_28; if (0xfff < freeSize) { freeBlock = *(void **)((int)pvStack_28 + -4); freeSize = freeSize + 0x23; if (0x1f < (uint)((int)pvStack_28 + (-4 - (int)freeBlock))) { LAB_008e5642: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } local_78 = 0; local_74 = 0; local_80 = 0; local_7c = 0; local_88 = 0; local_84 = 0; FID_conflict__Tidy(local_94); FID_conflict__Tidy(local_a0); ExceptionList = local_10; return; } //@@ 008e56b0 FUN_008e56b0 void FUN_008e56b0(void) { Manager *pMVar1; int unused; pMVar1 = g_manager; (g_manager->_dailyChallenge)._id = 0; (pMVar1->_dailyChallenge)._seed = 0; (pMVar1->_dailyChallenge)._specialDailyId = 0; (pMVar1->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(pMVar1->_dailyChallenge)._params); LobbySettings::reset(&g_manager->_lobbySettings); *(undefined4 *)&g_manager->_lobbySettings = 0; MenuManager::push_menu(0x12,unused); return; } //@@ 008e5720 FUN_008e5720 void FUN_008e5720(void) { Manager *pMVar1; int unused; pMVar1 = g_manager; (g_manager->_dailyChallenge)._id = 0; (pMVar1->_dailyChallenge)._seed = 0; (pMVar1->_dailyChallenge)._specialDailyId = 0; (pMVar1->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(pMVar1->_dailyChallenge)._params); LobbySettings::reset(&g_manager->_lobbySettings); *(undefined4 *)&g_manager->_lobbySettings = 1; MenuManager::push_menu(0x12,unused); return; } //@@ 008e5790 Menu_Online::render_descriptor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: called from Menu_Online::Render (0x8e4e30, uses _state +0x230) with the translated #Online/ONLINE_*_DESCRIPTOR string; this+0x34 is _anm2._animState, null frame "Descriptor Position" prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Menu_Online::render_descriptor(Menu_Online *this,std_string *text) { KColor color; float *nullFrame; std_string *lineChars; char *backChar; std_string *psVar1; void *pvVar2; void *ptr; std_string *psVar3; uint size; uint uVar4; undefined1 *puVar5; undefined1 *puVar6; undefined1 *puVar7; undefined4 fontParams; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined1 *local_7c; float textX; std_string *local_74; std_string *local_70; uint charIndex; Font *font; uint *lastLineSize; float textY; std_string *lines; std_string *linesEnd; std_string *linesCapacity; undefined1 *local_50; undefined1 *local_4c; std_string *local_48; undefined1 *local_44; byte ch; std_string tmpLine; uint stackCookie; char *pcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *lastLineSizePtr; pcStack_20 = (char *)((int)register0x00000010 + 0xfffffffc); local_14 = 0xffffffff; puStack_18 = &LAB_00b06ad8; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)((int)register0x00000010 + 0xfffffff0U); ExceptionList = &local_1c; textX = (g_menuManager->_ViewPosition).x + *(float *)(this + 1); textY = (g_menuManager->_ViewPosition).y + *(float *)this[1]._anm2._filename._buf; if ((this->_anm2)._animState._animData == (void *)0x0) { nullFrame = (float *)0x0; pcStack_20 = (char *)((int)register0x00000010 + 0xfffffffc); } else { nullFrame = AnimationState::GetNullFrame (&(this->_anm2)._animState,(byte *)"Descriptor Position"); } textX = textX + *nullFrame; textY = textY + nullFrame[1]; font = &g_manager->_font1_TeamMeatEx10; lines = (std_string *)0x0; linesEnd = (std_string *)0x0; linesCapacity = (std_string *)0x0; tmpLine._capacity = (uint)&DAT_0000000f; tmpLine._size = 0; tmpLine._buf._0_4_ = (std_string *)0x0; local_14 = 1; vector_string_emplace_reallocate_move(&lines,(std_string *)0x0,&tmpLine); local_14 = local_14 & 0xffffff00; if (&DAT_0000000f < tmpLine._capacity) { puVar5 = (undefined1 *)(tmpLine._capacity + 1); lineChars = (std_string *)tmpLine._buf._0_4_; if ((undefined1 *)0xfff < puVar5) { lineChars = (std_string *)((std_string *)(tmpLine._buf._0_4_ + -0x18))->_capacity; puVar5 = (undefined1 *)(tmpLine._capacity + 0x24); if (0x1f < (uint)(tmpLine._buf._0_4_ + (-4 - (int)lineChars))) goto LAB_008e5f00; } operator_delete(lineChars,(uint)puVar5); } charIndex = 0; if (text->_size != 0) { LAB_008e58d0: psVar1 = linesEnd; psVar3 = linesEnd + -1; lineChars = text; if (0xf < text->_capacity) { lineChars = *(std_string **)text->_buf; } local_70 = psVar3; if (lineChars->_buf[charIndex] == '\n') { tmpLine._capacity = (uint)&DAT_0000000f; tmpLine._size = 0; tmpLine._buf._0_4_ = (std_string *)0x0; local_14._0_1_ = 2; if (linesEnd == linesCapacity) { vector_string_emplace_reallocate_move(&lines,linesEnd,&tmpLine); } else { linesEnd->_buf[0] = '\0'; linesEnd->_buf[1] = '\0'; linesEnd->_buf[2] = '\0'; linesEnd->_buf[3] = '\0'; linesEnd->_size = 0; linesEnd->_capacity = 0; linesEnd->_buf[0] = '\0'; linesEnd->_buf[1] = '\0'; linesEnd->_buf[2] = '\0'; linesEnd->_buf[3] = '\0'; *(undefined4 *)(linesEnd->_buf + 4) = tmpLine._buf._4_4_; *(undefined4 *)(linesEnd->_buf + 8) = tmpLine._buf._8_4_; *(undefined4 *)(linesEnd->_buf + 0xc) = tmpLine._buf._12_4_; tmpLine._buf._0_4_ = (std_string *)0x0; linesEnd->_size = 0; linesEnd->_capacity = 0xf; linesEnd = linesEnd + 1; } local_14 = (uint)local_14._1_3_ << 8; if (&DAT_0000000f < tmpLine._capacity) { puVar5 = (undefined1 *)(tmpLine._capacity + 1); lineChars = (std_string *)tmpLine._buf._0_4_; if ((undefined1 *)0xfff < puVar5) { lineChars = (std_string *)((std_string *)(tmpLine._buf._0_4_ + -0x18))->_capacity; puVar5 = (undefined1 *)(tmpLine._capacity + 0x24); if (0x1f < (uint)(tmpLine._buf._0_4_ + (-4 - (int)lineChars))) goto LAB_008e5f00; } operator_delete(lineChars,(uint)puVar5); } } else { lineChars = text; if (0xf < text->_capacity) { lineChars = *(std_string **)text->_buf; } local_4c = (undefined1 *)linesEnd[-1]._capacity; puVar5 = (undefined1 *)linesEnd[-1]._size; ch = lineChars->_buf[charIndex]; lastLineSize = &linesEnd[-1]._size; if (puVar5 < local_4c) { *lastLineSize = (uint)(puVar5 + 1); lineChars = psVar3; if (&DAT_0000000f < local_4c) { lineChars = *(std_string **)psVar3->_buf; } lineChars->_buf[(int)puVar5] = ch; (lineChars->_buf + 1)[(int)puVar5] = 0; } else { if (puVar5 == (undefined1 *)0x7fffffff) { LAB_008e5f30: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } local_50 = (undefined1 *)((uint)(puVar5 + 1) | 0xf); if (local_50 < (undefined1 *)0x80000000) { local_44 = (undefined1 *)((uint)local_4c >> 1); if ((undefined1 *)(0x7fffffff - (int)local_44) < local_4c) { local_50 = (undefined1 *)0x7fffffff; } else if (local_50 < local_44 + (int)local_4c) { local_50 = local_44 + (int)local_4c; } } else { local_50 = (undefined1 *)0x7fffffff; } local_48 = std::_Allocate((uint)(local_50 + 1)); *lastLineSize = (uint)(puVar5 + 1); psVar1[-1]._capacity = (uint)local_50; if (local_4c < (undefined1 *)0x10) { memcpy(local_48,psVar3,(size_t)puVar5); local_48->_buf[(int)puVar5] = ch; (local_48->_buf + 1)[(int)puVar5] = '\0'; } else { local_44 = *(undefined1 **)psVar3->_buf; memcpy(local_48,local_44,(size_t)puVar5); local_48->_buf[(int)puVar5] = ch; puVar6 = local_4c + 1; (local_48->_buf + 1)[(int)puVar5] = '\0'; puVar5 = local_44; if ((undefined1 *)0xfff < puVar6) { puVar5 = *(undefined1 **)(local_44 + -4); puVar6 = local_4c + 0x24; if ((undefined1 *)0x1f < local_44 + (-4 - (int)puVar5)) goto LAB_008e5f00; } operator_delete(puVar5,(uint)puVar6); } *(std_string **)psVar3->_buf = local_48; } lineChars = psVar3; if (0xf < psVar1[-1]._capacity) { lineChars = *(std_string **)psVar3->_buf; } uVar4 = Font::get_string_width_n(font,(byte *)lineChars,-1); if (0x9f < uVar4) { local_44 = (undefined1 *)*lastLineSize; puVar5 = local_44 + -1; if (puVar5 != (undefined1 *)0x0) { do { lineChars = psVar3; if (0xf < psVar1[-1]._capacity) { lineChars = *(std_string **)psVar3->_buf; } if (lineChars->_buf[(int)puVar5] == 0x20) { puVar6 = (undefined1 *)0x0; tmpLine._size = 0; tmpLine._capacity = (uint)&DAT_0000000f; tmpLine._buf._0_4_ = (std_string *)0x0; local_50 = puVar5 + 1; local_14 = CONCAT31(local_14._1_3_,3); if (local_44 <= local_50) goto LAB_008e5c86; lineChars = psVar3; puVar5 = &DAT_0000000f; goto LAB_008e5b47; } puVar5 = puVar5 + -1; } while (puVar5 != (undefined1 *)0x0); } } } lineChars = linesEnd; goto LAB_008e5995; } lineChars = linesEnd; LAB_008e5d36: psVar3 = (std_string *)(((int)lineChars - (int)lines) / 0x18); local_70 = psVar3; if (psVar3 < (std_string *)0x2) { if (psVar3 != (std_string *)0x0) goto LAB_008e5d7f; } else { textY = textY - (float)(ushort)font->_base; LAB_008e5d7f: lineChars = lines; do { fontParams = 1; local_94 = 0xffff; local_90 = 0; local_8c = 0x3f800000; local_88 = 0xffffffff; local_84 = 0; local_80 = 0; local_14._0_1_ = 4; psVar1 = lineChars; if (0xf < lineChars->_capacity) { psVar1 = *(std_string **)lineChars->_buf; } pvVar2 = Font::measure_string(font,tmpLine._buf + 8,(byte *)psVar1,&fontParams,&g_vectorOne); local_14._0_1_ = 5; color._blue = 0.1764706; color._red = 0.21176471; color._green = 0.18431373; color._alpha = 1.0; color._unk = 0; Font::render_glyph_quads(font,pvVar2,textX,textY,1.0,1.0,color,&fontParams); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); lineChars = lineChars + 1; local_14 = (uint)local_14._1_3_ << 8; textY = (float)(ushort)font->_base + textY; psVar3 = (std_string *)((int)&psVar3[-1]._capacity + 3); } while (psVar3 != (std_string *)0x0); lineChars = linesEnd; } psVar3 = lines; if (lines != (std_string *)0x0) { for (; psVar3 != lineChars; psVar3 = psVar3 + 1) { uVar4 = psVar3->_capacity; if (0xf < uVar4) { pvVar2 = *(void **)psVar3->_buf; size = uVar4 + 1; ptr = pvVar2; if (0xfff < size) { ptr = *(void **)((int)pvVar2 + -4); size = uVar4 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) goto LAB_008e5f00; } operator_delete(ptr,size); } psVar3->_size = 0; psVar3->_capacity = 0xf; psVar3->_buf[0] = 0; } uVar4 = (((int)linesCapacity - (int)lines) / 0x18) * 0x18; lineChars = lines; if (0xfff < uVar4) { lineChars = (std_string *)lines[-1]._capacity; uVar4 = uVar4 + 0x23; if ((byte *)0x1f < (byte *)((int)lines + (-4 - (int)lineChars))) { LAB_008e5f00: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(lineChars,uVar4); } ExceptionList = local_1c; return; while( true ) { local_50 = local_50 + 1; local_44 = (undefined1 *)*lastLineSize; lineChars = psVar3; puVar5 = puVar7; local_48 = (std_string *)tmpLine._buf._0_4_; if (local_44 <= local_50) break; LAB_008e5b47: psVar3 = local_70; if (0xf < lineChars->_capacity) { lineChars = *(std_string **)lineChars->_buf; } ch = lineChars->_buf[(int)local_50]; if (puVar6 < puVar5) { tmpLine._size = (uint)(puVar6 + 1); lineChars = &tmpLine; if (&DAT_0000000f < puVar5) { lineChars = (std_string *)tmpLine._buf._0_4_; } lineChars->_buf[(int)puVar6] = ch; (lineChars->_buf + 1)[(int)puVar6] = '\0'; puVar6 = (undefined1 *)tmpLine._size; puVar7 = (undefined1 *)tmpLine._capacity; } else { local_4c = puVar6; local_48 = (std_string *)tmpLine._buf._0_4_; if (puVar6 == (undefined1 *)0x7fffffff) goto LAB_008e5f30; local_44 = puVar6 + 1; puVar7 = (undefined1 *)((uint)local_44 | 0xf); if (puVar7 < (undefined1 *)0x80000000) { if ((undefined1 *)(0x7fffffff - ((uint)puVar5 >> 1)) < puVar5) { puVar7 = (undefined1 *)0x7fffffff; } else if (puVar7 < puVar5 + ((uint)puVar5 >> 1)) { puVar7 = puVar5 + ((uint)puVar5 >> 1); } } else { puVar7 = (undefined1 *)0x7fffffff; } local_7c = puVar5; local_74 = std::_Allocate((uint)(puVar7 + 1)); tmpLine._size = (uint)local_44; tmpLine._capacity = (uint)puVar7; if (local_7c < (undefined1 *)0x10) { memcpy(local_74,&tmpLine,(size_t)local_4c); local_74->_buf[(int)local_4c] = ch; (local_74->_buf + 1)[(int)local_4c] = '\0'; } else { memcpy(local_74,local_48,(size_t)local_4c); local_74->_buf[(int)local_4c] = ch; (local_74->_buf + 1)[(int)local_4c] = '\0'; puVar5 = local_7c + 1; lineChars = local_48; if ((undefined1 *)0xfff < puVar5) { lineChars = (std_string *)local_48[-1]._capacity; puVar5 = local_7c + 0x24; if (0x1f < (uint)((int)local_48 + (-4 - (int)lineChars))) goto LAB_008e5f00; } operator_delete(lineChars,(uint)puVar5); } puVar6 = local_44; tmpLine._buf._0_4_ = local_74; } } LAB_008e5c86: backChar = (char *)FUN_00693680(); lastLineSizePtr = lastLineSize; if (*backChar == ' ') { puVar5 = local_44; } else { do { uVar4 = *lastLineSizePtr; lineChars = psVar3; if (0xf < psVar3->_capacity) { lineChars = *(std_string **)psVar3->_buf; } *lastLineSizePtr = uVar4 - 1; lineChars->_buf[uVar4 - 1] = 0; backChar = (char *)FUN_00693680(); } while (*backChar != ' '); puVar5 = (undefined1 *)psVar3->_size; } lineChars = linesEnd; if (0xf < psVar3->_capacity) { psVar3 = *(std_string **)psVar3->_buf; } *lastLineSizePtr = (uint)(puVar5 + -1); psVar3->_buf[(int)(puVar5 + -1)] = 0; if (linesEnd == linesCapacity) { vector_string_emplace_reallocate(&lines,linesEnd,&tmpLine); } else { std::string::string(linesEnd->_buf,&tmpLine); linesEnd = lineChars + 1; } lineChars = linesEnd; local_14 = local_14 & 0xffffff00; if (&DAT_0000000f < tmpLine._capacity) { puVar5 = (undefined1 *)(tmpLine._capacity + 1); psVar3 = (std_string *)tmpLine._buf._0_4_; if ((undefined1 *)0xfff < puVar5) { psVar3 = (std_string *)((std_string *)(tmpLine._buf._0_4_ + -0x18))->_capacity; puVar5 = (undefined1 *)(tmpLine._capacity + 0x24); if (0x1f < (uint)(tmpLine._buf._0_4_ + (-4 - (int)psVar3))) goto LAB_008e5f00; } operator_delete(psVar3,(uint)puVar5); } LAB_008e5995: charIndex = charIndex + 1; if (text->_size <= charIndex) goto LAB_008e5d36; goto LAB_008e58d0; } //@@ 008e5f40 Menu_Online::on_quick_match_search_result /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? search callback passed by 008e5420 Menu_Online::start_quick_match FUN_00a542c0(params,cb,menu); iterates found lobbies (vector), checks lobby_mode/current_stage/lobby_password attributes, joins one, PopupManager::close */ void Menu_Online::on_quick_match_search_result(int *param_1,int param_2) { char *pcVar1; undefined4 *puVar2; undefined4 *puVar3; int *piVar4; char cVar5; int iVar6; char *passwordChar; uint i; undefined4 *puVar7; int *sortEnd; int iVar8; int *piVar9; uint excludedIdCount; int *sortEnd; int lobbyIt; undefined1 auStackY_164 [128]; undefined **lobbyHandleVtable; void *pvVar11; void *lobbyRefCount; undefined1 auStack_d2 [2]; int local_b8; undefined1 lobbyRef [4]; int *local_a4; undefined4 lobbySortKey; int *local_9c; int *local_98; undefined **local_94; int **local_90; int *local_8c; int *listHead; int *local_84; int *local_80; int *candidateList; int candidateCount; undefined8 local_74; LobbySettings lobbySettings; int excludedIdsBegin; int excludedIdsEnd; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b06b72; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)((&lobbySettings)[1]._seed._buf + 8); ExceptionList = &local_10; candidateList = (int *)0x0; candidateCount = 0; candidateList = operator_new(0x18); *candidateList = (int)candidateList; candidateList[1] = (int)candidateList; local_8 = 0; lobbyIt = *param_1; if (lobbyIt != param_1[1]) { do { piVar9 = (int *)(lobbyIt + 4); if ((*(int **)(lobbyIt + 4) == (int *)0x0) || (iVar6 = (**(code **)(**(int **)(lobbyIt + 4) + 0x30))(), iVar6 != 5)) { if ((int *)*piVar9 == (int *)0x0) { passwordChar = (char *)0x0; } else { passwordChar = (char *)(**(code **)(*(int *)*piVar9 + 0x2c))(); } pcVar1 = passwordChar + 1; do { cVar5 = *passwordChar; passwordChar = passwordChar + 1; } while (cVar5 != '\0'); if (passwordChar == pcVar1) { iVar6 = *piVar9; if (iVar6 == 0) { local_74 = 0; local_74._4_4_ = (int *)0x0; local_74._0_4_ = (int *)0x0; local_9c = (int *)local_74; sortEnd = local_74._4_4_; } else { local_9c = *(int **)(iVar6 + 8); sortEnd = *(int **)(iVar6 + 0xc); } local_98 = sortEnd; local_80 = local_9c; FUN_00731ee0(); if (((*(char *)(local_b8 + 0xd) == '\0') && (*(int **)(local_b8 + 0x14) <= sortEnd)) && ((*(int **)(local_b8 + 0x14) < sortEnd || (*(int **)(local_b8 + 0x10) <= local_80)))) { iVar6 = local_b8; iVar8 = *(int *)&g_manager[1]._gamestate.field_0x8f4; } else { iVar6 = *(int *)&g_manager[1]._gamestate.field_0x8f4; iVar8 = iVar6; } if (iVar6 == iVar8) { KAGE::SmartPointer::SmartPointer(); local_8 = CONCAT31(local_8._1_3_,1); std::shared_ptr::assign(lobbyRef,piVar9); if ((int *)*piVar9 == (int *)0x0) { lobbySortKey = 0; } else { lobbySortKey = (**(code **)(*(int *)*piVar9 + 0x30))(); } LobbySettings::reset(&lobbySettings); local_84 = (int *)(auStackY_164 + 0x84); lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; pvVar11 = (void *)0x0; lobbyRefCount = (void *)0x0; local_8._0_1_ = 3; std::shared_ptr::assign(auStackY_164 + 0x88,lobbyRef); local_8._0_1_ = 2; Menu_Save::select_save_slot ((Menu_Save *)&lobbySettings,lobbyHandleVtable,pvVar11,lobbyRefCount); if (g_userProfile == (void *)0x0) { local_74 = 0; local_74._4_4_ = (int *)0x0; local_74._0_4_ = (int *)0x0; iVar6 = (int)local_74._4_4_; iVar8 = (int)(int *)local_74; } else { iVar6 = *(int *)((int)g_userProfile + 0xc); iVar8 = *(int *)((int)g_userProfile + 8); } i = 0; excludedIdCount = excludedIdsEnd - excludedIdsBegin >> 3; if (excludedIdCount != 0) { do { if ((*(int *)(excludedIdsBegin + i * 8) == iVar8) && (*(int *)(excludedIdsBegin + 4 + i * 8) == iVar6)) goto LAB_008e61df; i = i + 1; } while (i < excludedIdCount); } listHead = candidateList; if (candidateCount == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_90 = &candidateList; local_8._0_1_ = 4; local_8c = (int *)0x0; puVar7 = operator_new(0x18); local_74 = CONCAT44(puVar7 + 2,(int *)local_74); puVar7[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar7[3] = 0; puVar7[4] = 0; local_8._0_1_ = 5; local_8c = puVar7; std::shared_ptr::assign(puVar7 + 3,lobbyRef); puVar7[5] = lobbySortKey; candidateCount = candidateCount + 1; local_8c = (int *)0x0; puVar2 = (undefined4 *)listHead[1]; *puVar7 = listHead; puVar7[1] = puVar2; listHead[1] = (int)puVar7; *puVar2 = puVar7; LAB_008e61df: std::vector::_Tidy(); std::string::_Tidy_deallocate(lobbySettings._password._buf); std::string::_Tidy_deallocate(lobbySettings._seed._buf); local_8._0_1_ = 7; if (((local_a4 != (int *)0x0) && (cVar5 = (**(code **)(*local_a4 + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = (uint)local_8._1_3_ << 8; } } } lobbyIt = lobbyIt + 0xc; } while (lobbyIt != param_1[1]); } local_84 = (int *)((uint)local_84 & 0xffffff00); listHead = candidateList; if ((candidateCount != 0) && (candidateCount != 1)) { local_80 = (int *)FUN_008e69a0(); sortEnd = (int *)FUN_008e69a0(); local_74 = CONCAT44(sortEnd,(int *)local_74); local_84 = (int *)*listHead; sortEnd = local_84; piVar9 = local_80; if ((uint)local_80[5] < (uint)local_84[5]) { local_84 = local_80; piVar4 = local_80; } else { do { sortEnd = (int *)*sortEnd; if (sortEnd == local_80) goto LAB_008e6318; piVar4 = local_80; } while ((uint)sortEnd[5] <= (uint)local_80[5]); } LAB_008e62d0: local_8c = piVar4; piVar9 = (int *)*piVar9; if (piVar9 != sortEnd) goto code_r0x008e62d6; goto LAB_008e62de; } LAB_008e6323: *(undefined1 *)(param_2 + 0x24c) = 0; if ((candidateCount == 0) || (cVar5 = FUN_009c38e0(), cVar5 == '\0')) { local_94 = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(); local_8._0_1_ = 8; pvVar11 = (void *)FUN_00a71f00(); local_8._0_1_ = 9; std::shared_ptr::assign(&local_90,pvVar11); local_8._0_1_ = 10; if ((local_98 != (int *)0x0) && ((cVar5 = (**(code **)(*local_98 + 0xc))(), cVar5 != '\0' && (g_lobbyReleaseFn != (void *)0x0)))) { (*g_lobbyReleaseFn)(); } local_8._0_1_ = 0xb; std::shared_ptr::assign((void *)(param_2 + 0x244),&local_90); local_94 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 0xc; if (((local_8c != (int *)0x0) && (cVar5 = (**(code **)(*local_8c + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = (uint)local_8._1_3_ << 8; } else { std::shared_ptr::assign((void *)(param_2 + 0x244),(void *)(*candidateList + 0xc)); } local_74 = CONCAT44(0xffffffff,(int *)local_74); PopupManager::close(&g_manager[1]._gamestate.field_0xcf0,(int *)(param_2 + 0x23c), (int *)((int)&local_74 + 4)); local_8 = 0xffffffff; *(int *)(param_2 + 0x23c) = -1; *(undefined4 *)candidateList[1] = 0; puVar2 = (undefined4 *)*candidateList; while (puVar2 != (undefined4 *)0x0) { puVar7 = (undefined4 *)*puVar2; puVar2[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0xd; if ((((int *)puVar2[4] != (int *)0x0) && (cVar5 = (**(code **)(*(int *)puVar2[4] + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = 0xffffffff; operator_delete(puVar2,0x18); puVar2 = puVar7; } operator_delete(candidateList,0x18); ExceptionList = local_10; return; code_r0x008e62d6: piVar4 = local_8c; if ((uint)piVar9[5] < (uint)sortEnd[5]) goto LAB_008e62d0; LAB_008e62de: puVar2 = (undefined4 *)local_8c[1]; *puVar2 = piVar9; puVar7 = (undefined4 *)piVar9[1]; *puVar7 = sortEnd; puVar3 = (undefined4 *)sortEnd[1]; *puVar3 = local_8c; sortEnd[1] = (int)puVar7; piVar9[1] = (int)puVar2; local_8c[1] = (int)puVar3; if (piVar9 != sortEnd) { do { sortEnd = (int *)*sortEnd; if (sortEnd == piVar9) goto LAB_008e6318; piVar4 = piVar9; } while ((uint)sortEnd[5] <= (uint)piVar9[5]); goto LAB_008e62d0; } LAB_008e6318: *listHead = (int)local_84; goto LAB_008e6323; } //@@ 008e64f0 online_quick_match_popup_callback /* DB: ? popup callback passed to FontDrawParams::FontDrawParams (popup ctor) by 008e5420 Menu_Online::start_quick_match itself; button ids 0xDEADBEEF (cancel), 0x1212 CREATE_NEW_LOBBY -> MenuManager::push_menu(0x15), 0x2323 JOIN_LOBBY_IN_PROGRESS -> online_lobby_join; builds "##GAME###Online/ONLY_FOUND_JOIN_IN_PROGRESS"/"NO_LOBBIES_FOUND" popups from the found lobby's "current_stage"; ctx = Menu_Online (+0x23c popup, +0x244 lobby, +0x24c flag) */ void online_quick_match_popup_callback(int *param_1,void *param_2) { void *lobbyInfo; void *userData; char cVar1; int iVar2; int extraout_ECX; int extraout_ECX_00; undefined4 in_stack_ffffff18; char *pcVar3; undefined1 local_d0 [132]; undefined4 local_4c; undefined4 local_48; undefined4 local_2c; undefined4 uStack_28; undefined **ppuStack_24; undefined4 uStack_20; int *local_1c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; userData = param_2; local_8 = 0xffffffff; puStack_c = &LAB_00b06bd3; local_10 = ExceptionList; ExceptionList = &local_10; lobbyInfo = (void *)((int)param_2 + 0x240); if (*param_1 == -0x21524111) { local_18.x = 0.0; local_18.y = 0.0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 0; std::shared_ptr::assign((void *)((int)userData + 0x244),&uStack_20); ppuStack_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_1c == (int *)0x0) { ExceptionList = local_10; return; } cVar1 = (**(code **)(*local_1c + 0xc))(); if (cVar1 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } (*g_lobbyReleaseFn)(&uStack_20); ExceptionList = local_10; return; } if (*param_1 == 0x1212) { local_18.x = 0.0; local_18.y = 0.0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 2; std::shared_ptr::assign((void *)((int)userData + 0x244),&uStack_20); ppuStack_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 3; iVar2 = 0; if (((local_1c != (int *)0x0) && (cVar1 = (**(code **)(*local_1c + 0xc))(), iVar2 = extraout_ECX, cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&uStack_20); iVar2 = extraout_ECX_00; } local_8 = 0xffffffff; MenuManager::push_menu(0x15,iVar2); ExceptionList = local_10; return; } if (*(int **)((int)param_2 + 0x244) != (int *)0x0) { pcVar3 = (char *)0x8e663a; cVar1 = (**(code **)(**(int **)((int)param_2 + 0x244) + 0xc)) (__security_cookie ^ (uint)(local_d0 + 0xcc)); if (cVar1 != '\0') { if ((*(char *)((int)userData + 0x24c) != '\0') || (*(int **)((int)userData + 0x244) == (int *)0x0)) { LAB_008e679a: online_lobby_join(&g_manager->_netplayManager,lobbyInfo,CONCAT44(pcVar3,in_stack_ffffff18)); local_18.x = 0.0; local_18.y = 0.0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 5; std::shared_ptr::assign((void *)((int)userData + 0x244),&uStack_20); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&ppuStack_24); *(undefined1 *)((int)userData + 0x24c) = 0; ExceptionList = local_10; return; } pcVar3 = "current_stage"; in_stack_ffffff18 = 0x8e6667; iVar2 = (**(code **)(**(int **)((int)userData + 0x244) + 0x30))(); if (iVar2 < 1) goto LAB_008e679a; local_18.x = -1.0; local_18.y = -1.0; MessagePopup::MessagePopup (local_d0,&g_manager->_font2_TeamMeatEx12,online_quick_match_popup_callback,userData ,&local_18); local_8 = 4; local_1c = (int *)0x0; local_2c = 0x3e5cdcdd; uStack_28 = 0x3e2cacad; ppuStack_24 = (undefined **)0x3e34b4b5; uStack_20 = 0x3f800000; param_1 = (int *)0x1; FUN_009c2700("##GAME###Online/ONLY_FOUND_JOIN_IN_PROGRESS",&g_vectorZero,¶m_1,&local_2c); local_1c = (int *)0x0; param_1 = (int *)0x1; local_18.x = 0.0; local_18.y = 35.0; local_2c = 0x3e5cdcdd; uStack_28 = 0x3e2cacad; ppuStack_24 = (undefined **)0x3e34b4b5; uStack_20 = 0x3f800000; param_2 = (void *)0x1212; FUN_009c2760("##GAME###Online/CREATE_NEW_LOBBY",¶m_2,&local_18,¶m_1,&local_2c); local_1c = (int *)0x0; param_1 = (int *)0x1; param_2 = (void *)0x2323; local_2c = 0x3e5cdcdd; uStack_28 = 0x3e2cacad; ppuStack_24 = (undefined **)0x3e34b4b5; uStack_20 = 0x3f800000; FUN_009c2760("##GAME###Online/JOIN_LOBBY_IN_PROGRESS",¶m_2,&g_vectorZero,¶m_1, &local_2c); local_4c = 0xdeadbeef; iVar2 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_d0); *(int *)((int)userData + 0x23c) = iVar2; *(undefined1 *)((int)userData + 0x24c) = 1; goto LAB_008e685f; } } local_18.x = -1.0; local_18.y = -1.0; MessagePopup::MessagePopup (local_d0,&g_manager->_font2_TeamMeatEx12,FUN_008e6880,(void *)0x0,&local_18); local_8 = 6; MessagePopup::add_yes_no_buttons((byte *)"##GAME###Online/NO_LOBBIES_FOUND",local_d0); local_48 = 0; PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_d0); LAB_008e685f: FUN_00420710(); ExceptionList = local_10; return; } //@@ 008e6880 FUN_008e6880 void FUN_008e6880(int *param_1) { int in_ECX; if (*param_1 == 1) { MenuManager::push_menu(0x15,in_ECX); } return; } //@@ 008e68a0 FUN_008e68a0 void FUN_008e68a0(char param_1,int param_2) { int iVar1; if (param_1 != '\0') { iVar1 = *(int *)(param_2 + 0x230); if (iVar1 == 0) { Menu_Online::start_quick_match(); return; } if (iVar1 == 1) { FUN_008e56b0(); return; } if (iVar1 == 2) { FUN_008e5720(); return; } } return; } //@@ 008e68e0 FUN_008e68e0 void FUN_008e68e0(void) { undefined4 *puVar1; undefined4 *puVar2; char cVar3; uint uVar4; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; puVar1[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if ((((int *)puVar1[4] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)puVar1[4] + 0xc))(uVar4), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(puVar1 + 3); } local_8 = 0xffffffff; operator_delete(puVar1,0x18); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x18); ExceptionList = local_10; return; } //@@ 008e69a0 FUN_008e69a0 int * FUN_008e69a0(undefined4 param_1) { uint uVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 *puVar4; int *piVar5; int *piVar6; int *piVar7; int *in_ECX; int *piVar8; int in_EDX; int *piVar9; int *piVar10; if (in_EDX == 0) { return (int *)*in_ECX; } if (in_EDX == 1) { return *(int **)*in_ECX; } piVar6 = (int *)FUN_008e69a0(param_1); piVar7 = (int *)FUN_008e69a0(param_1); piVar9 = (int *)*in_ECX; uVar1 = piVar9[5]; piVar10 = piVar9; piVar5 = piVar6; while (piVar8 = piVar6, uVar1 <= (uint)piVar6[5]) { piVar10 = (int *)*piVar10; if (piVar10 == piVar6) goto LAB_008e6a5a; piVar5 = piVar9; uVar1 = piVar10[5]; } LAB_008e6a15: piVar6 = (int *)*piVar6; if (piVar6 != piVar7) goto code_r0x008e6a1b; goto LAB_008e6a23; code_r0x008e6a1b: if ((uint)piVar10[5] <= (uint)piVar6[5]) { LAB_008e6a23: puVar2 = (undefined4 *)piVar8[1]; *puVar2 = piVar6; puVar3 = (undefined4 *)piVar6[1]; *puVar3 = piVar10; puVar4 = (undefined4 *)piVar10[1]; *puVar4 = piVar8; piVar10[1] = (int)puVar3; piVar6[1] = (int)puVar2; piVar8[1] = (int)puVar4; if (piVar6 == piVar7) { LAB_008e6a57: piVar9 = piVar5; LAB_008e6a5a: *in_ECX = (int)piVar9; return piVar7; } do { piVar10 = (int *)*piVar10; if (piVar10 == piVar6) goto LAB_008e6a57; piVar8 = piVar6; } while ((uint)piVar10[5] <= (uint)piVar6[5]); } goto LAB_008e6a15; } //@@ 008e6a80 Menu_Online::render_descriptions /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? 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 */ void Menu_Online::render_descriptions(void) { std_string *keySize; float fVar1; float fVar2; float *nullFrame; byte *translatedText; Vector *pos; Font *pFVar3; byte *****pppppbVar4; int in_ECX; byte *strCursor; uint uVar5; byte *statKey; int statIndex; Vector hiddenValuePos; Vector valuePos; Vector descriptionPos; int statOffset; KColor textColor; Vector labelPos; float columnX; float rowY; Vector local_88; undefined4 fontSettings; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; byte *****descriptionText [4]; undefined4 descriptionTextSize; uint descriptionTextCapacity; byte *****tmpString [4]; undefined4 tmpStringSize; uint tmpStringCapacity; byte countText [32]; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; int statCount; byte strChar; local_8 = 0xffffffff; puStack_c = &LAB_00b06c45; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(countText + 0x30); ExceptionList = &local_10; local_88.x = (g_menuManager->_ViewPosition).x + *(float *)(in_ECX + 0x128); local_88.y = (g_menuManager->_ViewPosition).y + *(float *)(in_ECX + 300); if (*(char *)(in_ECX + 0x109) != '\0') { if (*(char *)(in_ECX + 0x70) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x30),&local_88,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(in_ECX + 0x50),&local_88,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x50),&local_88,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)(in_ECX + 0x30),&local_88,&g_vectorZero,&g_vectorZero); } } fVar2 = local_88.y; fVar1 = local_88.x; if (*(int *)(in_ECX + 0x34) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)(in_ECX + 0x30),(byte *)"TextStartPos"); } labelPos.y = fVar2 + nullFrame[1]; statIndex = 0; labelPos.x = fVar1 + *nullFrame; statKey = (byte *)&DAT_00c78f08; statOffset = 0xa8c; columnX = labelPos.x; rowY = labelPos.y; local_88.y = labelPos.y; do { statCount = *(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,(byte *)"??????",&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 < *(uint *)(statKey + 0x14)) { strCursor = *(byte **)statKey; } translatedText = string_table_translate(&g_manager->_stringTable,strCursor); tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (byte *****)0x0; strCursor = translatedText; do { strChar = *strCursor; strCursor = strCursor + 1; } while (strChar != 0); std::string::assign((char *)tmpString,translatedText, (int)strCursor - (int)(translatedText + 1)); local_8._0_1_ = 1; pppppbVar4 = (byte *****)tmpString; if (0xf < tmpStringCapacity) { pppppbVar4 = tmpString[0]; } Font::DrawStringScaled(pFVar3,(byte *)pppppbVar4,&labelPos,&textColor,&fontSettings); local_8._0_1_ = 0; if (0xf < tmpStringCapacity) { uVar5 = tmpStringCapacity + 1; pppppbVar4 = tmpString[0]; if (0xfff < uVar5) { pppppbVar4 = (byte *****)tmpString[0][-1]; uVar5 = tmpStringCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)tmpString[0] + (-4 - (int)pppppbVar4))) goto LAB_008e718e; } operator_delete(pppppbVar4,uVar5); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (byte *****)((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 == *(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 (*(int *)(in_ECX + 0x34) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)(in_ECX + 0x30),(byte *)"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,(byte *)"??????",&descriptionPos,&textColor, &fontSettings); } else { keySize = *(std_string **)(statKey + 0x10); pFVar3 = &g_manager->_font1_TeamMeatEx10; if (0x7fffffffU - (int)keySize < 5) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } strCursor = statKey; if (0xf < *(uint *)(statKey + 0x14)) { strCursor = *(byte **)statKey; } std::string::concat((char *)tmpString,(int)local_88.y,keySize,strCursor, (uint)keySize,(byte *)"_DESC",5); local_8._0_1_ = 6; pppppbVar4 = (byte *****)tmpString; if (0xf < tmpStringCapacity) { pppppbVar4 = tmpString[0]; } translatedText = string_table_translate(&g_manager->_stringTable,(byte *)pppppbVar4); descriptionTextSize = 0; descriptionTextCapacity = 0xf; descriptionText[0] = (byte *****)0x0; strCursor = translatedText; do { strChar = *strCursor; strCursor = strCursor + 1; } while (strChar != 0); std::string::assign((char *)descriptionText,translatedText, (int)strCursor - (int)(translatedText + 1)); local_8._0_1_ = 5; if (0xf < tmpStringCapacity) { uVar5 = tmpStringCapacity + 1; pppppbVar4 = tmpString[0]; if (0xfff < uVar5) { pppppbVar4 = (byte *****)tmpString[0][-1]; uVar5 = tmpStringCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)tmpString[0] + (-4 - (int)pppppbVar4))) goto LAB_008e718e; } operator_delete(pppppbVar4,uVar5); } tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (byte *****)((uint)tmpString[0] & 0xffffff00); local_8._0_1_ = 7; pppppbVar4 = (byte *****)descriptionText; if (0xf < descriptionTextCapacity) { pppppbVar4 = descriptionText[0]; } Font::DrawStringScaled(pFVar3,(byte *)pppppbVar4,&descriptionPos,&textColor,&fontSettings); local_8._0_1_ = 5; if (0xf < descriptionTextCapacity) { uVar5 = descriptionTextCapacity + 1; pppppbVar4 = descriptionText[0]; if (0xfff < uVar5) { pppppbVar4 = (byte *****)descriptionText[0][-1]; uVar5 = descriptionTextCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)descriptionText[0] + (-4 - (int)pppppbVar4))) { LAB_008e718e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar4,uVar5); } descriptionTextSize = 0; descriptionTextCapacity = 0xf; descriptionText[0] = (byte *****)((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 ); } //@@ 008e71c0 FUN_008e71c0 void FUN_008e71c0(void) { byte *pbVar1; ANM2 *pAVar2; byte bVar3; byte *pbVar4; uint uVar5; ANM2 *in_ECX; byte *pbVar6; bool bVar7; pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pbVar6 = s_Idle; do { bVar3 = *pbVar4; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_008e7200: uVar5 = -(uint)bVar7 | 1; goto LAB_008e7205; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_008e7200; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008e7205: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((in_ECX->_animState)._isPlaying != 0)))) goto LAB_008e7231; } bVar3 = ANM2::SetAnimation(in_ECX,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_008e7231: in_ECX[1]._filename._size = 0; in_ECX[1]._filename._buf[0] = '\0'; in_ECX[1]._filename._buf[1] = '\0'; in_ECX[1]._filename._buf[2] = '\0'; in_ECX[1]._filename._buf[3] = '\0'; pAVar2 = in_ECX + 1; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; pAVar2 = in_ECX + 1; (pAVar2->_filename)._buf[8] = '\0'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pAVar2 = in_ECX + 1; (pAVar2->_filename)._buf[0xc] = '\0'; (pAVar2->_filename)._buf[0xd] = '\0'; (pAVar2->_filename)._buf[0xe] = '\0'; (pAVar2->_filename)._buf[0xf] = '\0'; return; } //@@ 008e7250 Menu_OnlineAwards::Update /* DB: ECX=MenuManager+0xf5cc; MenuManager::Update case 0x16 = eMainMenuType ONLINEAWARDS: back button pops the menu stack + MenuManager::SetState, cursor moves over a 7-column grid (+0x124 index) */ void Menu_OnlineAwards::Update(void) { int iVar1; char isPressed; uint repeatPhase; int in_ECX; int iVar2; void *historyEnd; bool isRepeatFrame; undefined4 action; uint holdFrames; MenuManager *menuManager; action = 0xf; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&action,0,0); menuManager = g_menuManager; if (isPressed != '\0') { historyEnd = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)historyEnd - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { historyEnd = (void *)((int)historyEnd + -4); (g_menuManager->_menuStateHistory)._end = historyEnd; } MenuManager::SetState(menuManager,*(int *)((int)historyEnd + -4),0); } action = 0x16; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&action,0,0); if (isPressed == '\0') { iVar2 = 0; } else { holdFrames = *(uint *)(in_ECX + 0x114); if (holdFrames == 0) { LAB_008e72f6: iVar1 = *(int *)(in_ECX + 0x124); iVar2 = iVar1 + 6; if (iVar1 % 7 != 0) { iVar2 = iVar1 + -1; } *(int *)(in_ECX + 0x124) = iVar2; } else if (0x27 < (int)holdFrames) { repeatPhase = holdFrames & 0x80000007; isRepeatFrame = repeatPhase == 0; if ((int)repeatPhase < 0) { isRepeatFrame = (repeatPhase - 1 | 0xfffffff8) == 0xffffffff; } if (isRepeatFrame) goto LAB_008e72f6; } iVar2 = holdFrames + 1; } *(int *)(in_ECX + 0x114) = iVar2; action = 0x17; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&action,0,0); if (isPressed == '\0') { iVar2 = 0; } else { holdFrames = *(uint *)(in_ECX + 0x118); if (holdFrames == 0) { LAB_008e7366: iVar1 = *(int *)(in_ECX + 0x124); iVar2 = iVar1 + -6; if (iVar1 % 7 != 6) { iVar2 = iVar1 + 1; } *(int *)(in_ECX + 0x124) = iVar2; } else if (0x27 < (int)holdFrames) { repeatPhase = holdFrames & 0x80000007; isRepeatFrame = repeatPhase == 0; if ((int)repeatPhase < 0) { isRepeatFrame = (repeatPhase - 1 | 0xfffffff8) == 0xffffffff; } if (isRepeatFrame) goto LAB_008e7366; } iVar2 = holdFrames + 1; } *(int *)(in_ECX + 0x118) = iVar2; action = 0x14; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&action,0,0); if (isPressed == '\0') { iVar2 = 0; } else { holdFrames = *(uint *)(in_ECX + 0x11c); if (holdFrames == 0) { LAB_008e73d7: iVar1 = *(int *)(in_ECX + 0x124); if (iVar1 < 7) { iVar2 = holdFrames + 1; *(int *)(in_ECX + 0x124) = iVar1 + 0xe; goto LAB_008e73fc; } *(int *)(in_ECX + 0x124) = iVar1 + -7; } else if (0x27 < (int)holdFrames) { repeatPhase = holdFrames & 0x80000007; isRepeatFrame = repeatPhase == 0; if ((int)repeatPhase < 0) { isRepeatFrame = (repeatPhase - 1 | 0xfffffff8) == 0xffffffff; } if (isRepeatFrame) goto LAB_008e73d7; } iVar2 = holdFrames + 1; } LAB_008e73fc: *(int *)(in_ECX + 0x11c) = iVar2; action = 0x15; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&action,0,0); if (isPressed == '\0') { *(undefined4 *)(in_ECX + 0x120) = 0; return; } holdFrames = *(uint *)(in_ECX + 0x120); if (holdFrames != 0) { if ((int)holdFrames < 0x28) goto LAB_008e7479; repeatPhase = holdFrames & 0x80000007; isRepeatFrame = repeatPhase == 0; if ((int)repeatPhase < 0) { isRepeatFrame = (repeatPhase - 1 | 0xfffffff8) == 0xffffffff; } if (!isRepeatFrame) goto LAB_008e7479; } iVar2 = *(int *)(in_ECX + 0x124); if (0xd < iVar2) { *(int *)(in_ECX + 0x124) = iVar2 + -0xe; *(uint *)(in_ECX + 0x120) = holdFrames + 1; return; } *(int *)(in_ECX + 0x124) = iVar2 + 7; LAB_008e7479: *(uint *)(in_ECX + 0x120) = holdFrames + 1; return; } //@@ 008e74d0 FUN_008e74d0 void FUN_008e74d0(undefined1 param_1) { int extraout_EAX; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b06c7d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(¶m_1); in_ECX[1] = extraout_EAX; local_8 = 0; *in_ECX = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(in_ECX); } in_ECX[2] = 1; *(undefined1 *)(in_ECX + 3) = 0; ExceptionList = local_10; return; } //@@ 008e7560 online_lobby_find_member_index /* DB: copies g_multiplayerLobbyPtr and returns FUN_00a28590(ECX) = index of the user id in the lobby's 8-byte member-id array (+0x10/+0x14), -1 if absent; Menu_OnlineLobby::change_character passes the result to HUD::LoadGraphics prototype: db/protos.zhl */ int __fastcall online_lobby_find_member_index(void *user) { char cVar1; uint uVar2; int iVar3; undefined4 local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b06cad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = 0; local_14 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_18,&g_multiplayerLobbyPtr); iVar3 = FUN_00a28590(user); local_8 = 1; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } ExceptionList = local_10; return iVar3; } //@@ 008e7610 FUN_008e7610 void FUN_008e7610(void) { int *in_ECX; FUN_008ef400(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x28); return; } //@@ 008e7630 FUN_008e7630 void FUN_008e7630(void) { uint uVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb440; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00a1d6b0(FUN_008ee4d0); FUN_00a1d6b0(online_lobby_members_changed_callback); if (*(undefined4 **)(in_ECX + 0x95c) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 0x95c))(1,uVar1); *(undefined4 *)(in_ECX + 0x95c) = 0; } MenuDialog::~MenuDialog((void *)(in_ECX + 0x6e4)); FUN_008ef400((undefined4 *)(in_ECX + 0x694),*(undefined4 *)(*(int *)(in_ECX + 0x694) + 4)); operator_delete(*(void **)(in_ECX + 0x694),0x28); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x574)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5c4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5a4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x58c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x574)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x460)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4b0)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x490)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x478)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x460)); local_8 = 0xffffffff; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x124),0x114,3,ANM2::~ANM2); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x10)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x60)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x40)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x28)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); ExceptionList = local_10; return; } //@@ 008e7ce0 Menu_OnlineLobby::unload_graphics /* DB: ECX=MenuManager+0xdce8 (Update there is Menu_OnlineLobby::Update 008e8240, render 008e8af0): ANM2::Reset +0x10 and 3 ANM2 at +0x124; from MenuManager::unload_graphics */ void Menu_OnlineLobby::unload_graphics(void) { uint *ptr; void *pvVar1; undefined4 *puVar2; int in_ECX; int iVar3; undefined4 *puVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::Reset((ANM2 *)(in_ECX + 0x10)); puVar4 = (undefined4 *)(in_ECX + 0x14c); iVar3 = 3; do { if (puVar4[-6] != 0) { AnmCache::RemoveRef((std_string *)(puVar4 + -10)); } puVar2 = puVar4 + -10; if (0xf < (uint)puVar4[-5]) { puVar2 = (undefined4 *)*puVar2; } puVar4[-6] = 0; *(undefined1 *)puVar2 = 0; AnimationState::SetAnimationData((AnimationState *)(puVar4 + 2),(void *)0x0); AnimationState::SetAnimationData((AnimationState *)(puVar4 + 10),(void *)0x0); puVar2 = puVar4 + -4; if (0xf < (uint)puVar4[1]) { puVar2 = (undefined4 *)*puVar2; } *puVar4 = 0; *(undefined1 *)puVar2 = 0; pvVar1 = (void *)puVar4[0x15]; puVar4[0x13] = 0; puVar4[0x14] = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); local_8 = 0xffffffff; } puVar4[0x15] = 0; puVar4[0x16] = 0; puVar4[0x17] = 0; puVar4[0x18] = 0; puVar4[0x19] = 0; puVar4[0x1a] = 0; puVar4[0x1b] = g_vectorZero.x; puVar4[0x1c] = g_vectorZero.y; puVar4[0x1d] = g_vectorOne.x; puVar4[0x1e] = g_vectorOne.y; puVar4[0x1f] = 0; puVar4[0x20] = 0x3f800000; puVar4[0x21] = 0x3f800000; puVar4[0x22] = 0x3f800000; puVar4[0x23] = 0x3f800000; puVar4[0x24] = 0; puVar4[0x25] = 0; puVar4[0x26] = 0; puVar4[0x27] = 0; puVar4[0x28] = 0; puVar4[0x29] = 0; puVar4[0x2a] = 0; puVar4[0x2f] = 0; puVar4[0x30] = 0; puVar4[0x31] = 0; puVar4[0x32] = 0; puVar4[0x33] = 0; puVar4[0x34] = 0; puVar4[0x35] = 0; puVar4[0x2b] = 0x3f800000; puVar4[0x2c] = 0x3f800000; puVar4[0x2d] = 0x3f800000; puVar4[0x2e] = 0; *(undefined2 *)(puVar4 + 0x36) = 0; puVar4[0x37] = 0x3f800000; *(undefined2 *)(puVar4 + 0x38) = 0; *(undefined1 *)(puVar4 + 0x12) = 0; puVar4[0x39] = 0xffffffff; puVar4[0x3a] = 0; puVar4 = puVar4 + 0x45; iVar3 = iVar3 + -1; } while (iVar3 != 0); ExceptionList = local_10; return; } //@@ 008e7f60 Menu_OnlineLobby::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads gfx/ui/main menu/OnlineLobby.anm2, "PlayerInfo" layer setup (AdvanceLayerPosition); called from MenuManager::LoadGraphics next to Menu_OnlineLobbyList::load_graphics 008dca50 Menu_OnlineLobbyList::load_graphics void Menu_OnlineLobby::load_graphics(void) { int layerId; byte bVar1; uint uVar2; byte *curAnimChar; int in_ECX; char *pcVar3; uint size; undefined4 *playerInfoAnim; bool isLess; uint playerInfoIdx; std_string lobbyAnmPath; std_string playerInfoAnmPath; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; int animLayers; int gameMode; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af79f5; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; lobbyAnmPath._size = 0; lobbyAnmPath._capacity = 0xf; lobbyAnmPath._buf[0] = '\0'; lobbyAnmPath._buf[1] = '\0'; lobbyAnmPath._buf[2] = '\0'; lobbyAnmPath._buf[3] = '\0'; securityCookie = uVar2; lobbyAnmPath._buf._0_4_ = std::_Allocate(0x30); lobbyAnmPath._size = 0x21; lobbyAnmPath._capacity = 0x2f; builtin_strncpy((char *)lobbyAnmPath._buf._0_4_,"gfx/ui/main menu/OnlineLobby.anm2",0x22); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x10),&lobbyAnmPath,1); local_14 = 0xffffffff; if (0xf < lobbyAnmPath._capacity) { size = lobbyAnmPath._capacity + 1; pcVar3 = (char *)lobbyAnmPath._buf._0_4_; if (0xfff < size) { pcVar3 = *(char **)(lobbyAnmPath._buf._0_4_ + -4); size = lobbyAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(lobbyAnmPath._buf._0_4_ + (-4 - (int)pcVar3))) { LAB_008e803b: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,size); } FUN_008ed090(uVar2); gameMode = (g_manager->_lobbySettings)._gameMode; if (*(int *)(in_ECX + 0x44) != 0) { if (*(int *)(*(int *)(in_ECX + 0x40) + 0x80) < 0xd) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); if (*(int *)((int)((AnimationState *)(in_ECX + 0x40))->_animation + 0x80) < 0xd) goto LAB_008e80ce; } animLayers = *(int *)(in_ECX + 0x44); layerId = *(int *)(animLayers + 0x68); if (((animLayers == 0) || (layerId < 0)) || (*(int *)(animLayers + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)(in_ECX + 0x48) + layerId * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0x40),layerId,(float)gameMode); } LAB_008e80ce: playerInfoIdx = 0; playerInfoAnim = (undefined4 *)(in_ECX + 0x158); do { playerInfoAnmPath._size = 0; playerInfoAnmPath._capacity = 0xf; playerInfoAnmPath._buf[0] = '\0'; playerInfoAnmPath._buf[1] = '\0'; playerInfoAnmPath._buf[2] = '\0'; playerInfoAnmPath._buf[3] = '\0'; playerInfoAnmPath._buf._0_4_ = std::_Allocate(0x30); playerInfoAnmPath._size = 0x21; playerInfoAnmPath._capacity = 0x2f; builtin_strncpy((char *)playerInfoAnmPath._buf._0_4_,"gfx/ui/main menu/OnlineLobby.anm2",0x22); local_14 = 1; ANM2::Load((ANM2 *)(playerInfoAnim + -0xd),&playerInfoAnmPath,1); local_14 = 0xffffffff; if (0xf < playerInfoAnmPath._capacity) { uVar2 = playerInfoAnmPath._capacity + 1; pcVar3 = (char *)playerInfoAnmPath._buf._0_4_; if (0xfff < uVar2) { pcVar3 = *(char **)(playerInfoAnmPath._buf._0_4_ + -4); uVar2 = playerInfoAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(playerInfoAnmPath._buf._0_4_ + (-4 - (int)pcVar3))) goto LAB_008e803b; } operator_delete(pcVar3,uVar2); } animData = (byte *)*playerInfoAnim; playerInfoAnmPath._size = 0; playerInfoAnmPath._capacity = 0xf; playerInfoAnmPath._buf._0_4_ = playerInfoAnmPath._buf._0_4_ & 0xffffff00; if (animData == (byte *)0x0) { LAB_008e81e3: bVar1 = ANM2::SetAnimation((ANM2 *)(playerInfoAnim + -0xd),(byte *)"PlayerInfo",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(playerInfoAnim + -1)); *(undefined1 *)(playerInfoAnim + 4) = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } pcVar3 = "PlayerInfo"; do { bVar1 = *curAnimChar; isLess = bVar1 < (byte)*pcVar3; if (bVar1 != *pcVar3) { LAB_008e81d0: uVar2 = -(uint)isLess | 1; goto LAB_008e81d5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (byte)pcVar3[1]; if (bVar1 != pcVar3[1]) goto LAB_008e81d0; curAnimChar = curAnimChar + 2; pcVar3 = pcVar3 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_008e81d5: if ((uVar2 != 0) || ((animData[0x34] != 0 && (*(char *)(playerInfoAnim + 4) == '\0')))) goto LAB_008e81e3; } playerInfoAnim = playerInfoAnim + 0x45; playerInfoIdx = playerInfoIdx + 1; if (2 < playerInfoIdx) { ExceptionList = local_1c; return; } } while( true ); } //@@ 008e8240 Menu_OnlineLobby::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager::Update case 0x11: #Online/MATCH_ENDED, NO_CONNECTION_TO_HOST; render 008e8af0 (GAME_STARTING_COUNTDOWN, RUN_STARTING) */ void Menu_OnlineLobby::Update(void) { ulonglong uVar1; longlong lVar2; longlong lVar3; longlong lVar4; byte isConnected; char cVar5; uint uVar6; undefined4 uVar7; void *localMember; int iVar8; undefined4 *serverTime; uint *in_ECX; uint uVar9; Manager *extraout_EDX; Manager *pMVar10; uint uVar11; AnimationState *animState; uint *puVar12; ulonglong nowNs; int unused2; undefined1 popup [172]; undefined1 lobbyRef [12]; int connection; int *connectionRefCount; undefined4 local_a0; undefined **local_9c; undefined **local_98; int *local_94; undefined **local_90; int lobby; uint *local_88; Vector local_80; undefined4 local_78; uint *local_74 [2]; char isChatClosed; int local_68; char local_62; char local_61; undefined1 serverTimeBuf [60]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = serverTimeBuf + 0x5c; local_14 = 0xffffffff; puStack_18 = &LAB_00b06d7a; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(serverTimeBuf + 0x50); ExceptionList = &local_1c; local_80.y = (float)in_ECX; local_24 = uVar6; isConnected = NetplayManager::check_connection(&g_manager->_netplayManager); if (isConnected == 0) { ExceptionList = local_1c; return; } local_9c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_98 = (undefined **)0x0; local_94 = (int *)0x0; local_14 = 0; std::shared_ptr::assign(&local_98,&g_multiplayerLobbyPtr); local_9c = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 1; if (local_98 == (undefined **)0x0) { LAB_008e82fe: local_61 = '\x01'; } else { cVar5 = (**(code **)(*local_98 + 0xc))(uVar6); local_61 = '\0'; if (cVar5 == '\0') goto LAB_008e82fe; } local_9c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 2; if (((local_94 != (int *)0x0) && (cVar5 = (**(code **)(*local_94 + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_14 = 0xffffffff; if (local_61 != '\0') { ExceptionList = local_1c; return; } if (g_menuManager->_fadeOutActive != 0) { if (g_menuManager->_fadeOutProgress < 1.0) { ExceptionList = local_1c; return; } if ((g_manager->_framecount & 1) == 0) { start_game(); ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } if ((char)in_ECX[0x1b2] != '\0') { ExceptionList = local_1c; return; } Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::flush_channel(); Multiplayer::get_lobby(&DAT_00c79a50,lobbyRef); local_14 = 3; uVar7 = FUN_00a286f0(); local_14._0_1_ = 4; FUN_00a29fd0(&connection,uVar7); local_98 = KAGE::System::UserProfileBase::vftable; local_14._0_1_ = 7; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(lobbyRef); lVar4 = CONCAT44(local_88,local_68); if (in_ECX[0x1a4] == 0xffffffff) { nowNs = GetTimeNs(); in_ECX = (uint *)local_80.y; uVar6 = (uint)(nowNs >> 0x20); uVar1 = (nowNs & 0xffffffff) * 0xd7b634db; local_90 = (undefined **)uVar1; lVar2 = (nowNs & 0xffffffff) * 0x431bde82; local_a0 = (undefined4)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar6 * 0xd7b634db; local_74[0] = (uint *)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar6 * 0x431bde82; local_88 = (uint *)((ulonglong)lVar4 >> 0x20); local_68 = (int)lVar4; uVar1 = lVar3 + (uVar1 >> 0x20); uVar9 = (uint)(uVar1 >> 0x20); lVar2 = lVar2 + (uVar1 & 0xffffffff); local_78 = (undefined4)lVar2; uVar6 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar6),uVar9 + uVar6); uVar9 = (uint)((ulonglong)lVar2 >> 0x20); uVar11 = (uint)lVar2 >> 0x12 | uVar9 * 0x4000; uVar6 = *(uint *)local_80.y; local_80.y = (float)(((uVar9 >> 0x12) - *(uint *)((int)local_80.y + 4)) - (uint)(uVar11 < *(uint *)local_80.y)); if ((((uint *)local_80.y != (uint *)0x0) || (10000 < uVar11 - uVar6)) && ((connection != 0 && (*(int *)(connection + 0x20) == 0 && *(int *)(connection + 0x24) == 0))) ) { local_80.x = (float)&DAT_bf800000; local_80.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_80); local_14._0_1_ = 8; MessagePopup::add_ok_button((byte *)"##GAME###Online/NO_CONNECTION_TO_HOST",popup); iVar8 = 0x8e8529; uVar6 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,popup); *(uint *)((float)in_ECX + 0x1a4) = uVar6; *(uint *)((float)in_ECX + 0x255) = 0; *(uint *)((float)in_ECX + 0x256) = 0; unused2 = 0x8e8548; FUN_0098aec0(); netplay_leave_lobby(&g_manager->_netplayManager,iVar8,unused2); NetplayManager::reset(&g_manager->_netplayManager,1); init_lobby_view(in_ECX); local_14._0_1_ = 7; FUN_00420710(); lVar4 = CONCAT44(local_88,local_68); } } local_88 = (uint *)((ulonglong)lVar4 >> 0x20); local_68 = (int)lVar4; cVar5 = FUN_009c3990(); isChatClosed = cVar5 == '\0'; local_68 = (g_manager->_lobbySettings)._gameMode; if ((local_68 == 5) || (local_61 = '\x01', local_68 != 4)) { local_61 = '\0'; } if ((*(int *)&g_manager[1]._gamestate.field_0x290 == 0) && (*(int *)&g_manager[1]._gamestate.field_0x2d8 < 1)) { online_chat_update(); cVar5 = FUN_0091e7a0(); pMVar10 = extraout_EDX; if (cVar5 != '\0') goto LAB_008e85f9; local_62 = '\0'; pMVar10 = extraout_EDX; } else { online_chat_update(); pMVar10 = g_manager; LAB_008e85f9: local_62 = '\x01'; } if ((pMVar10->_framecount & 1) == 0) { ANM2::Update((ANM2 *)(in_ECX + 4)); animState = (AnimationState *)(in_ECX + 0x55); local_74[0] = (void *)0x3; do { if (*(char *)((int)&animState[6]._currentlyTriggeredEvents + 1) != '\0') { AnimationState::Update(animState); AnimationState::Update(animState + 1); } animState = (AnimationState *)&animState[8]._isPlaying; local_74[0] = (uint *)((int)local_74[0] + -1); } while (local_74[0] != (void *)0x0); } puVar12 = in_ECX + 0x1a5; localMember = lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)); if (*(char *)((int)localMember + 10) == '\0') { input_poll_active_device(); } localMember = lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)); if ((*(char *)((int)localMember + 9) != '\0') && (localMember = lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)), *(char *)((int)localMember + 8) == '\n')) { ANM2::Update((ANM2 *)(in_ECX + 0x15d)); } if (((in_ECX[0x1b9] == 1) || (in_ECX[0x1b9] == 2)) || (local_62 != '\0')) goto LAB_008e8854; if (isChatClosed != '\0') { update_controls(in_ECX); } if (local_68 == 5) { local_74[0] = lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)); local_62 = '\0'; LAB_008e872d: FUN_00949bc0(); if ((local_74[0] != (void *)0x0) && (((uint *)(uint)*(byte *)((int)local_74[0] + 8) != (uint *)local_80.y || (*(char *)((int)local_74[0] + 9) != local_62)))) { *(char *)((int)local_74[0] + 8) = SUB41(local_80.y,0); *(char *)((int)local_74[0] + 9) = local_62; iVar8 = online_lobby_find_member_index(local_74[0]); load_member_sprite(in_ECX,iVar8); FUN_008ee3b0(); } } else if (local_61 != '\0') { local_74[0] = lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)); local_62 = '\0'; Manager::GetChallengeParams(g_manager,(g_manager->_lobbySettings)._challenge); goto LAB_008e872d; } uVar6 = in_ECX[0x1ae]; if (uVar6 == 0) { if ((local_68 != 5) && (local_61 == '\0')) { lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)); cVar5 = FUN_00949b70(); if (cVar5 == '\0') { change_character(1,1); } } } else { in_ECX[0x1af] = in_ECX[0x1af] + 1; if (uVar6 <= in_ECX[0x1af]) { in_ECX[0x1af] = 0; if (uVar6 < 0xf) { uVar6 = Random(); local_88 = (uint *)(uVar6 & 3); puVar12 = (uint *)0x0; local_80.y = (float)((int)local_88 + 1); if ((uint *)local_80.y != (uint *)0x0) { do { change_character(1,puVar12 == local_88); puVar12 = (uint *)((int)puVar12 + 1); } while (puVar12 < (uint)local_80.y); } localMember = lobby_member_map_get_or_add(in_ECX + 0x1a5,(ulonglong *)(in_ECX + 0x1a8)); if (*(char *)((int)localMember + 8) == '\0') { change_character(1,1); } } in_ECX[0x1ae] = in_ECX[0x1ae] + 1; if (in_ECX[0x1ae] == 0x10) { in_ECX[0x1ae] = 0; toggle_ready(); } } } LAB_008e8854: puVar12 = in_ECX + 0x1a5; local_61 = '\0'; local_74[0] = *(uint **)*puVar12; if (local_74[0] != (uint *)*puVar12) { do { if ((char)local_74[0][9] != '\0') { local_61 = '\x01'; break; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)local_74); } while (local_74[0] != (uint *)*puVar12); } if ((*(char *)((int)in_ECX + 0x6c9) != '\0') && (local_61 == '\0')) { localMember = lobby_member_map_get_or_add(puVar12,(ulonglong *)(in_ECX + 0x1a8)); if (*(char *)((int)localMember + 10) != '\0') { toggle_ready(); } local_90 = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = 0; local_88 = (uint *)0x0; local_14._0_1_ = 9; std::shared_ptr::assign(&lobby,&g_multiplayerLobbyPtr); if (lobby == 0) { iVar8 = 0; } else { iVar8 = *(int *)(lobby + 0x14) - *(int *)(lobby + 0x10) >> 3; } local_90 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 10; if (((local_88 != (uint *)0x0) && (cVar5 = (**(code **)(*local_88 + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_14._0_1_ = 7; if (iVar8 == 1) { local_80.x = (float)&DAT_bf800000; local_80.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_80); local_14._0_1_ = 0xb; MessagePopup::add_ok_button((byte *)"##GAME###Online/MATCH_ENDED",popup); uVar6 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,popup); in_ECX[0x1a3] = uVar6; local_14._0_1_ = 7; FUN_00420710(); } } *(char *)((int)in_ECX + 0x6c9) = local_61; update_force_restart(in_ECX); if (local_68 == 5) { serverTime = get_server_time(serverTimeBuf); iVar8 = date_to_yyyymmdd((byte)*serverTime,serverTime[1],*(longlong *)(serverTime + 2), serverTime[4],serverTime[5],serverTime[6],serverTime[7],serverTime[8], serverTime[9],serverTime[10],serverTime[0xb], (int)*(undefined8 *)(serverTime + 0xc)); if ((g_manager->_dailyChallenge)._id != iVar8) { daily_challenge_refresh(); } } if (isChatClosed != '\0') { online_chat_window_update(); } pMVar10 = g_manager; uVar6 = in_ECX[599]; if (uVar6 != 0) { *(int *)(uVar6 + 0xd4) = g_menuControllerIndex; *(undefined4 *)(uVar6 + 0xbc) = 0; *(undefined4 *)(uVar6 + 0xc0) = 1; *(undefined4 *)(uVar6 + 0xc4) = 2; *(undefined4 *)(uVar6 + 200) = 3; *(undefined4 *)(uVar6 + 0xcc) = 0xe; *(undefined4 *)(uVar6 + 0xd0) = 0x1c; *(float *)(in_ECX[599] + 0x94) = (pMVar10->_optionsConfig)._sfxVolume; (**(code **)(*(int *)in_ECX[599] + 0xc))(); } local_14 = 0xc; if (((connectionRefCount != (int *)0x0) && (cVar5 = (**(code **)(*connectionRefCount + 0xc))(), cVar5 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } ExceptionList = local_1c; return; } //@@ 008e8af0 Menu_OnlineLobby::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? eMainMenuType ONLINELOBBY=17 is 008e8240 Menu_OnlineLobby::Update rendered from 0098a040; layers Menu_background3/Show_Password/Winstreak/Best_Winstreak/ChallengeName, '#RunStatus/*' and '#Online/*' strings prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::Render(void *this) { Vector pos; Vector pos_00; Vector pos_01; Vector scale; Vector scale_00; Vector scale_01; char cVar1; uint uVar2; int *hostMember; LayerState *pLVar3; undefined4 nullIndex; float *nullFrame; void *memberEntry; int iVar4; Vector *nullFramePos; int layerEntry; AnimationState *animState; byte *text; Font *ptr; code *minigameRenderFn; undefined4 local_118; undefined4 local_114; undefined4 local_110; undefined4 local_10c; undefined4 local_108; undefined4 local_104; undefined4 local_100; KColor textColor; Manager *local_e4; Vector textPos; float menuX; float local_d4; Vector local_d0; byte isKeyboard; byte local_c6; byte isPasswordProtected; undefined4 drawSettings; Font local_c0 [2]; uint local_24; short *psStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int nullLayerId; char *stringKey; psStack_20 = (short *)&local_c0[2]._numChars; local_14 = 0xffffffff; puStack_18 = &LAB_00b06de1; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)&local_c0[2]._scaleW; ExceptionList = &local_1c; isKeyboard = g_menuControllerIndex == 0; local_e4 = g_manager; local_24 = uVar2; hostMember = lobby_get_member_info(this,0); if (((hostMember == (int *)0x0) || (cVar1 = (**(code **)(*hostMember + 0x14))(uVar2), cVar1 == '\0')) || (isPasswordProtected = 1, (g_manager->_lobbySettings)._password._size == 0)) { isPasswordProtected = 0; } pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Menu_background3"); if (pLVar3 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)((int)this + 0x10),*(int *)pLVar3->_layerData, (uint)isPasswordProtected); } if ((isPasswordProtected == 0) || (*(char *)((int)this + 0x6c0) != '\0')) { pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Show_Password"); pLVar3->_visible = 0; if (isPasswordProtected != 0) goto LAB_008e8bfc; LAB_008e8c15: local_c6 = 0; } else { pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Show_Password"); pLVar3->_visible = 1; LAB_008e8bfc: if ((isKeyboard == 0) || (local_c6 = 1, *(char *)((int)this + 0x6c0) != '\0')) goto LAB_008e8c15; } pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Show_Password_Button"); pLVar3->_visible = local_c6; pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Back_Button"); pLVar3->_visible = isKeyboard; local_c6 = isPasswordProtected ^ 1; pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Winstreak"); pLVar3->_visible = local_c6; if (*(int *)((int)this + 0x44) != 0) { nullIndex = AnimationData::find_null_index("WinStreakNum"); AnimationState::SetNullLayerFrame(nullIndex,isPasswordProtected); } pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"Best_Winstreak"); pLVar3->_visible = local_c6; if (*(int *)((int)this + 0x44) != 0) { nullIndex = AnimationData::find_null_index("BestStreakNum"); AnimationState::SetNullLayerFrame(nullIndex,isPasswordProtected); } local_d4 = (float)((local_e4->_lobbySettings)._challenge + -1); pLVar3 = ANM2::GetLayer((ANM2 *)((int)this + 0x10),(byte *)"ChallengeName"); if (pLVar3 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)((int)this + 0x10),*(int *)pLVar3->_layerData,(int)local_d4); } menuX = (g_menuManager->_ViewPosition).x + *(float *)((int)this + 8); local_d4 = (g_menuManager->_ViewPosition).y + *(float *)((int)this + 0xc); local_d0.x = menuX; local_d0.y = local_d4; if (*(char *)((int)this + 0x119) != '\0') { if (*(char *)((int)this + 0x80) == '\0') { AnimationState::Render ((AnimationState *)((int)this + 0x40),&local_d0,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)((int)this + 0x60); } else { AnimationState::Render ((AnimationState *)((int)this + 0x60),&local_d0,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)((int)this + 0x40); } AnimationState::Render(animState,&local_d0,&g_vectorZero,&g_vectorZero); } menuX = local_d0.x; local_d4 = local_d0.y; render_lobby_info(); if (isKeyboard == 0) { if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x40),(byte *)"BackButton"); } local_d0.y = nullFrame[1] + local_d4; local_d0.x = *nullFrame + menuX; local_100 = 0; pos.y = local_d0.y; pos.x = local_d0.x; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0xf,0,0, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); } uVar2 = 0; do { GameOver::RenderItemSprite(this,uVar2); uVar2 = uVar2 + 1; } while (uVar2 < 4); memberEntry = lobby_member_map_get_or_add ((void *)((int)this + 0x694),(ulonglong *)((int)this + 0x6a0)); if ((*(char *)((int)memberEntry + 9) != '\0') && (memberEntry = lobby_member_map_get_or_add ((void *)((int)this + 0x694),(ulonglong *)((int)this + 0x6a0)), *(char *)((int)memberEntry + 8) == '\n')) { if (*(int *)((int)this + 0x44) == 0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)(*(int *)((int)this + 0x40) + 0x80) < 0x2b) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } iVar4 = *(int *)((int)this + 0x44); if ((((iVar4 == 0) || (*(int *)(*(int *)((int)this + 0x40) + 0x80) < 0x2a)) || (nullLayerId = *(int *)(iVar4 + 0xe0), nullLayerId < 0)) || (*(int *)(iVar4 + 0x1c) <= nullLayerId)) { LAB_008e8f42: iVar4 = 0; } else { layerEntry = nullLayerId * 0x10 + *(int *)(iVar4 + 0x18); iVar4 = *(int *)(*(int *)((int)this + 0x48) + nullLayerId * 4); if ((iVar4 < 0) || (*(int *)(layerEntry + 8) <= iVar4)) goto LAB_008e8f42; iVar4 = iVar4 * 0x6c + *(int *)(layerEntry + 4); } local_d0.x = *(float *)(iVar4 + 0x10) + menuX; local_d0.y = *(float *)(iVar4 + 0x14) + local_d4; if (*(char *)((int)this + 0x67d) != '\0') { if (*(char *)((int)this + 0x5e4) == '\0') { AnimationState::Render ((AnimationState *)((int)this + 0x5a4),&local_d0,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)((int)this + 0x5c4); } else { AnimationState::Render ((AnimationState *)((int)this + 0x5c4),&local_d0,&g_vectorZero,&g_vectorZero); animState = (AnimationState *)((int)this + 0x5a4); } AnimationState::Render(animState,&local_d0,&g_vectorZero,&g_vectorZero); } } if (isPasswordProtected != 0) { if (isKeyboard == 0) { if (*(char *)((int)this + 0x6c0) == '\0') { if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x40),(byte *)"ShowPasswordButton"); } local_d0.y = nullFrame[1] + local_d4; local_d0.x = *nullFrame + menuX; local_100 = 0; pos_00.y = local_d0.y; pos_00.x = local_d0.x; scale_00.y = g_vectorOne.y; scale_00.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x1d,0,0, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))) ,pos_00,scale_00); goto LAB_008e90a3; } } else { LAB_008e90a3: if (*(char *)((int)this + 0x6c0) == '\0') goto LAB_008e910b; } if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x40),(byte *)"PasswordPosition"); } local_d0.x = *nullFrame + menuX; local_d0.y = nullFrame[1] + local_d4; lobby_password_render(&(g_manager->_lobbySettings)._password,&local_d0,1.0); } LAB_008e910b: local_d0.y = (float)(local_e4->_lobbySettings)._gameMode; iVar4 = 0xa88; if (local_d0.y == 7.00649e-45) { iVar4 = 0xae4; } if (*(int *)((g_manager->_persistentGameData)._achievements + iVar4 + -0x38) == 0) { text = s__d; } else { text = &DAT_00b75810; } sprintf((byte *)&local_c0[0]._scaleW,text); local_e4 = (Manager *)&g_manager->_font2_TeamMeatEx12; drawSettings = 0; local_c0[0]._isLoaded = 0xff; local_c0[0]._1_3_ = 0xff; local_c0[0]._fontSize = 0; local_c0[0]._infoBitField = 0; local_c0[0]._charSet = 0; local_c0[0]._stretchH = 0; local_c0[0]._aa = 0x80; local_c0[0]._paddingUp = 0x3f; local_c0[0]._paddingRight = 0xff; local_c0[0]._paddingDown = 0xff; local_c0[0]._paddingLeft = 0xff; local_c0[0]._spacingHoriz = 0xff; local_c0[0]._spacingVert = 0; local_c0[0]._outline = 0; local_c0[0]._18_2_ = 0; local_c0[0]._lineHeight = 0; local_c0[0]._base = 0; local_14 = 0; animState = (AnimationState *)((int)this + 0x40); textColor._unk = 0; textColor._red = 0.21176471; textColor._green = 0.18431373; textColor._blue = 0.1764706; textColor._alpha = 1.0; if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"WinStreakNum"); } textPos.x = menuX + *nullFrame; textPos.y = local_d4 + nullFrame[1]; Font::DrawStringScaled ((Font *)local_e4,(byte *)&local_c0[0]._scaleW,&textPos,&textColor,&drawSettings); sprintf((byte *)&local_c0[0]._scaleW,s__d); local_d0.y = (float)&g_manager->_font2_TeamMeatEx12; drawSettings = 0; local_c0[0]._0_4_ = (Font *)0xffff; local_c0[0]._fontSize = 0; local_c0[0]._infoBitField = 0; local_c0[0]._charSet = 0; local_c0[0]._stretchH = 0; local_c0[0]._aa = 0x80; local_c0[0]._paddingUp = 0x3f; local_c0[0]._paddingRight = 0xff; local_c0[0]._paddingDown = 0xff; local_c0[0]._paddingLeft = 0xff; local_c0[0]._spacingHoriz = 0xff; local_c0[0]._spacingVert = 0; local_c0[0]._outline = 0; local_c0[0]._18_2_ = 0; local_c0[0]._lineHeight = 0; local_c0[0]._base = 0; local_14 = 1; textColor._unk = 0; textColor._red = 0.21176471; textColor._green = 0.18431373; textColor._blue = 0.1764706; textColor._alpha = 1.0; if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"BestStreakNum"); } textPos.x = menuX + *nullFrame; textPos.y = local_d4 + nullFrame[1]; Font::DrawStringScaled ((Font *)local_d0.y,(byte *)&local_c0[0]._scaleW,&textPos,&textColor,&drawSettings); local_14 = 0xffffffff; if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(animState,(byte *)"Chat Position"); } textPos.x = *nullFrame + menuX; textPos.y = nullFrame[1] + local_d4; OnlineChat::render_all(&textPos,1); if (*(char *)((int)this + 0x6c8) == '\0') { if (*(char *)((int)this + 0x6c9) == '\0') { if ((*(int *)((int)this + 0x6ac) < 1) && (*(int *)((int)this + 0x6b0) < 1)) { stringKey = "#Online/WAITING_TO_START"; goto LAB_008e9724; } text = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/GAME_STARTING_COUNTDOWN"); sprintf(&DAT_00c82b60,text); text = &DAT_00c82b60; } else { if (*(int *)((int)this + 0x6cc) == 0x26) { stringKey = "#GAME_IN_PROGRESS"; goto LAB_008e9724; } Level::get_stage_display_name ((std_string *)local_c0,*(int *)((int)this + 0x6d0),*(int *)((int)this + 0x6d4),0,0, 0,(uint)(*(int *)((int)this + 0x6e0) != 0)); local_14 = 2; switch(*(undefined4 *)((int)this + 0x6cc)) { case 1: stringKey = "#RunStatus/ROOM_MEGA_SATAN"; break; case 2: stringKey = "#RunStatus/ROOM_BOSS"; break; case 3: stringKey = "#RunStatus/ROOM_MINIBOSS"; break; case 4: stringKey = "#RunStatus/ROOM_ARCADE"; break; case 5: stringKey = "#RunStatus/ROOM_DEVIL"; break; case 6: stringKey = "#RunStatus/ROOM_ANGEL"; break; case 7: stringKey = "#RunStatus/ROOM_BARREN"; break; case 8: stringKey = "#RunStatus/ROOM_ISAACS"; break; case 9: stringKey = "#RunStatus/ROOM_SHOP"; break; case 10: stringKey = "#RunStatus/ROOM_BLACK_MARKET"; break; case 0xb: stringKey = "#RunStatus/ROOM_ERROR"; break; case 0xc: stringKey = "#RunStatus/ROOM_BOSSRUSH"; break; case 0xd: stringKey = "#RunStatus/ROOM_CURSE"; break; case 0xe: stringKey = "#RunStatus/ROOM_CHALLENGE"; break; case 0xf: stringKey = "#RunStatus/ROOM_DICE"; break; case 0x10: stringKey = "#RunStatus/ROOM_LIBRARY"; break; case 0x11: stringKey = "#RunStatus/ROOM_SACRIFICE"; break; case 0x12: stringKey = "#RunStatus/ROOM_TREASURE"; break; case 0x13: stringKey = "#RunStatus/ROOM_CHEST"; break; case 0x14: stringKey = "#RunStatus/ROOM_SECRET"; break; case 0x15: stringKey = "#RunStatus/ROOM_SUPERSECRET"; break; case 0x16: stringKey = "#RunStatus/ROOM_DUNGEON"; break; case 0x17: stringKey = "#RunStatus/ROOM_PLANETARIUM"; break; case 0x18: stringKey = "#RunStatus/ROOM_RED"; break; case 0x19: stringKey = "#RunStatus/ROOM_DEATH_CERTIFICATE"; break; case 0x1a: stringKey = "#RunStatus/ROOM_LIL_PORTAL"; break; case 0x1b: stringKey = "#RunStatus/ROOM_MEMBER_SHOP"; break; case 0x1c: stringKey = "#RunStatus/ROOM_GENESIS"; break; case 0x1d: stringKey = "#RunStatus/ROOM_DOGMA"; break; case 0x1e: stringKey = "#RunStatus/ROOM_BEAST"; break; case 0x1f: stringKey = "#RunStatus/CHALLENGE_RUN"; break; case 0x20: stringKey = "#RunStatus/GREED_MODE_NORMAL"; break; case 0x21: stringKey = "#RunStatus/GREED_MODE_FIGHTING"; break; case 0x22: stringKey = "#RunStatus/GREED_MODE_BOSS"; break; case 0x23: stringKey = "#RunStatus/GREED_MODE_DEVIL"; break; case 0x24: stringKey = "#RunStatus/GREED_MODE_ULTRA_GREED"; break; case 0x25: stringKey = "#RunStatus/WON_RUN"; break; default: stringKey = "#RunStatus/NORMAL_RUN"; } text = string_table_translate(&g_manager->_stringTable,(byte *)stringKey); iVar4 = *(int *)((int)this + 0x6cc); if (iVar4 == 2) { iVar4 = FUN_0069d200(*(undefined4 *)((int)this + 0x6d8)); if (iVar4 == 0) goto LAB_008e968b; local_d0.y = (float)local_c0; if (0xf < (uint)local_c0[0]._20_4_) { local_d0.y = (float)local_c0[0]._0_4_; } text = (byte *)(iVar4 + 4); if (0xf < *(uint *)(iVar4 + 0x18)) { text = *(byte **)text; } string_table_translate(&g_manager->_stringTable,text); text = string_table_translate (&g_manager->_stringTable,(byte *)"#RunStatus/ROOM_BOSS_SPECIFIC"); sprintf(&DAT_00c82a60,text); } else if (iVar4 == 0x21) { sprintf(&DAT_00c82a60,text); } else { if (iVar4 == 0x24) { text = &DAT_00b62fdc; } LAB_008e968b: sprintf(&DAT_00c82a60,text); } local_14 = 0xffffffff; text = &DAT_00c82a60; if (0xf < (uint)local_c0[0]._20_4_) { uVar2 = local_c0[0]._20_4_ + 1; ptr = (Font *)local_c0[0]._0_4_; if (0xfff < uVar2) { ptr = (Font *)((Font *)(local_c0[0]._0_4_ + -0x4c))->_missingCharacter; uVar2 = local_c0[0]._20_4_ + 0x24; if (0x1f < (uint)(local_c0[0]._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } local_c0[0]._spacingVert = 0; local_c0[0]._outline = 0; local_c0[0]._18_2_ = 0; local_c0[0]._lineHeight = 0xf; local_c0[0]._base = 0; local_c0[0]._0_4_ = local_c0[0]._0_4_ & 0xffffff00; } LAB_008e9788: local_d0.y = (float)&g_manager->_font1_TeamMeatEx10; local_118 = 4; local_114 = 0xffff; local_110 = 0; local_10c = 0x3f800000; local_108 = 0xffffffff; local_104 = 0; local_100 = 0; local_14 = 3; textColor._unk = 0; textColor._red = 0.21176471; textColor._green = 0.18431373; textColor._blue = 0.1764706; textColor._alpha = 1.0; if (*(int *)((int)this + 0x44) == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x40),(byte *)"Countdown Position"); } textPos.x = menuX + *nullFrame; textPos.y = local_d4 + nullFrame[1]; Font::DrawStringScaled((Font *)local_d0.y,text,&textPos,&textColor,&local_118); local_14 = 0xffffffff; } else { if ((g_manager->_lobbySettings)._gameMode == 5) { stringKey = "#Online/RUN_STARTING_DAILY"; } else { stringKey = "#Online/RUN_STARTING"; } LAB_008e9724: text = string_table_translate(&g_manager->_stringTable,(byte *)stringKey); if (text != (byte *)0x0) goto LAB_008e9788; } if (*(int **)((int)this + 0x95c) == (int *)0x0) goto LAB_008e99ec; if (*(int *)((int)this + 0x44) == 0) { minigameRenderFn = *(code **)(**(int **)((int)this + 0x95c) + 0x10); LAB_008e989c: nullFramePos = &g_vectorZero; } else { nullFramePos = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x40),(byte *)"Minigame"); minigameRenderFn = *(code **)(**(int **)((int)this + 0x95c) + 0x10); if (nullFramePos == (Vector *)0x0) goto LAB_008e989c; } textPos.x = menuX + nullFramePos->x; textPos.y = local_d4 + nullFramePos->y; (*minigameRenderFn)(&textPos); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; if (((byte)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; cVar1 = (**(code **)(**(int **)((int)this + 0x95c) + 0x1c))(); if ((cVar1 != '\0') && (cVar1 = (**(code **)(**(int **)((int)this + 0x95c) + 0x20))(), cVar1 == '\0')) { if ((*(int *)((int)this + 0x44) == 0) || (nullFramePos = AnimationState::GetNullFrame ((AnimationState *)((int)this + 0x40),(byte *)"MinigameButton"), nullFramePos == (Vector *)0x0)) { nullFramePos = &g_vectorZero; } local_d0.y = local_d4 + nullFramePos->y; local_d0.x = menuX + nullFramePos->x; local_100 = 0; pos_01.y = local_d0.y; pos_01.x = local_d0.x; scale_01.y = g_vectorOne.y; scale_01.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0xe,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_01,scale_01); } LAB_008e99ec: InviteFriendsMenu::Render(); ExceptionList = local_1c; return; } //@@ 008e9ac0 Menu_OnlineLobby::init_lobby_view /* DB: ? zeroes lobby fields (+0x68c..+0x954), sets "PlayerInfo" anims per slot, sends "current_stage"/"current_stage_type" message ("Attempting to create a message when there is no multiplayer service"); callers: MATCH_ENDED, LOBBY_KICKED, lobby joined prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::init_lobby_view(void *this) { int iVar1; byte bVar2; char cVar3; uint uVar4; byte *curAnimName; int extraout_EAX; void *pvVar5; undefined4 memberIdHigh; undefined ***ownerProfile; uint uVar6; undefined **ppuVar7; char *expectedAnimName; undefined4 memberIdLow; undefined4 *puVar8; int *memberIter; ulonglong *puVar9; ulonglong *lobbyMenu; bool bVar10; ulonglong nowMs; void *messageRefCount; KColor textColor; undefined **profile; int local_84; undefined4 local_80; uint local_7c; int members; int membersEnd; undefined4 local_70; undefined **local_6c; int *lobbyPtr; int *lobbyRefCount; undefined **local_60; undefined4 local_5c; undefined8 local_58; undefined8 local_50; ulonglong *local_44; undefined4 *local_40; uint *local_3c; uint index; Manager *local_34; undefined4 local_30; int local_2c; byte local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *curAnimData; Manager *manager; uint *memberMap; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b06e75; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_40 = (undefined4 *)0x0; *(undefined4 *)((int)this + 0x6b4) = 0; *(undefined4 *)((int)this + 0x6b8) = 0; *(undefined4 *)((int)this + 0x6bc) = 0; *(undefined4 *)((int)this + 0x6ac) = 0; *(undefined4 *)((int)this + 0x6b0) = 0; *(undefined2 *)((int)this + 0x6c0) = 0; *(undefined2 *)((int)this + 0x6c8) = 0; *(undefined4 *)((int)this + 0x954) = 0; *(undefined4 *)((int)this + 0x688) = 0xffffffff; *(undefined4 *)((int)this + 0x68c) = 0xffffffff; *(undefined4 *)((int)this + 0x690) = 0xffffffff; *(undefined4 *)((int)this + 0x94c) = 0; *(undefined4 *)((int)this + 0x950) = 0; local_44 = this; FUN_008ed090(uVar4); puVar8 = (undefined4 *)((int)this + 0x158); index = 3; do { curAnimData = (byte *)*puVar8; if (curAnimData == (byte *)0x0) { LAB_008e9be8: bVar2 = ANM2::SetAnimation((ANM2 *)(puVar8 + -0xd),(byte *)"PlayerInfo",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(puVar8 + -1)); *(undefined1 *)(puVar8 + 4) = 1; } } else { curAnimName = curAnimData; if (0xf < *(uint *)(curAnimData + 0x14)) { curAnimName = *(byte **)curAnimData; } expectedAnimName = "PlayerInfo"; do { bVar2 = *curAnimName; bVar10 = bVar2 < (byte)*expectedAnimName; if (bVar2 != *expectedAnimName) { LAB_008e9bd5: uVar4 = -(uint)bVar10 | 1; goto LAB_008e9bda; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; bVar10 = bVar2 < (byte)expectedAnimName[1]; if (bVar2 != expectedAnimName[1]) goto LAB_008e9bd5; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008e9bda: if ((uVar4 != 0) || ((curAnimData[0x34] != 0 && (*(char *)(puVar8 + 4) == '\0')))) goto LAB_008e9be8; } lobbyMenu = local_44; puVar8 = puVar8 + 0x45; index = index - 1; if (index == 0) { iVar1 = *(int *)((int)local_44 + 0x694); local_3c = (uint *)((int)local_44 + 0x694); FUN_008ef400(local_3c,*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(lobbyMenu + 0xd3) = 0; *(undefined4 *)((int)lobbyMenu + 0x6cc) = 0x26; *(undefined4 *)(lobbyMenu + 0xda) = 0; *(undefined4 *)((int)lobbyMenu + 0x6d4) = 0; *(undefined4 *)(lobbyMenu + 0xdb) = 0; *(undefined4 *)((int)lobbyMenu + 0x6dc) = 0; *(undefined4 *)(lobbyMenu + 0xdc) = 0; members = 0; membersEnd = 0; local_70 = 0; local_6c = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyPtr = (int *)0x0; lobbyRefCount = (int *)0x0; local_14 = 1; std::shared_ptr::assign(&lobbyPtr,&g_multiplayerLobbyPtr); local_6c = KAGE::Network::Multiplayer::Lobby::vftable; puVar9 = (ulonglong *)0x0; local_14._0_1_ = 2; KAGE::Network::Multiplayer::Lobby::get_members(&local_6c,&members,1); local_6c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 3; if (((lobbyRefCount != (int *)0x0) && (cVar3 = (**(code **)(*lobbyRefCount + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobbyPtr); } local_14 = (uint)local_14._1_3_ << 8; if (7 < (uint)(membersEnd - members)) { local_40 = (undefined4 *)(membersEnd - members >> 3); index = 0; if (local_40 != (undefined4 *)0x0) { local_34 = (Manager *)&profile; memberIter = (int *)(members + 4); do { iVar1 = *memberIter; if (iVar1 == 0) { local_50 = 0; local_50._4_4_ = (undefined **)0x0; local_50._0_4_ = (undefined **)0x0; local_2c = (int)local_50._4_4_; local_30 = (undefined **)local_50; } else { local_2c = *(int *)(iVar1 + 0xc); local_30 = *(undefined4 *)(iVar1 + 8); } profile = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&local_30); local_14._0_1_ = 4; profile = KAGE::System::UserProfile::vftable; local_84 = extraout_EAX; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&profile); } local_80 = 1; local_7c = local_7c & 0xffffff00; local_14._0_1_ = 5; iVar1 = *memberIter; if (iVar1 == 0) { local_50 = 0; local_50._4_4_ = (undefined **)0x0; local_50._0_4_ = (undefined **)0x0; memberIdHigh = local_50._4_4_; memberIdLow = (undefined **)local_50; } else { memberIdHigh = *(undefined4 *)(iVar1 + 0xc); memberIdLow = *(undefined4 *)(iVar1 + 8); } local_58 = CONCAT44(memberIdHigh,memberIdLow); pvVar5 = lobby_member_map_get_or_add((undefined1 *)((int)lobbyMenu + 0x694),&local_58); *(int *)((int)pvVar5 + 4) = local_84; *(undefined1 *)((int)pvVar5 + 8) = (undefined1)local_80; *(undefined1 *)((int)pvVar5 + 9) = local_80._1_1_; *(undefined1 *)((int)pvVar5 + 10) = local_80._2_1_; *(undefined1 *)((int)pvVar5 + 0xb) = local_80._3_1_; *(undefined1 *)((int)pvVar5 + 0xc) = (undefined1)local_7c; local_14 = (uint)local_14._1_3_ << 8; profile = KAGE::System::UserProfileBase::vftable; cVar3 = (**(code **)(memberIter[-1] + 0x14))(); if (cVar3 != '\0') { iVar1 = *memberIter; if (iVar1 == 0) { local_50 = 0; local_50._4_4_ = (undefined **)0x0; local_50._0_4_ = (undefined **)0x0; memberIdHigh = local_50._4_4_; memberIdLow = (undefined **)local_50; } else { memberIdHigh = *(undefined4 *)(iVar1 + 0xc); memberIdLow = *(undefined4 *)(iVar1 + 8); } *(undefined4 *)((int)lobbyMenu + 0x6a4) = memberIdHigh; manager = g_manager; *(undefined4 *)(lobbyMenu + 0xd4) = memberIdLow; local_21 = (manager->_persistentGameData)._characterMenuShown != 0; iVar1 = *memberIter; if (iVar1 == 0) { local_50 = 0; local_50._4_4_ = (undefined **)0x0; local_50._0_4_ = (undefined **)0x0; local_5c = local_50._4_4_; local_60 = (undefined **)local_50; } else { local_5c = *(undefined4 *)(iVar1 + 0xc); local_60 = *(undefined ***)(iVar1 + 8); } pvVar5 = lobby_member_map_get_or_add ((undefined1 *)((int)lobbyMenu + 0x694),(ulonglong *)&local_60); *(byte *)((int)pvVar5 + 9) = local_21; } memberIter = memberIter + 2; index = index + 1; } while (index < local_40); } memberMap = local_3c; local_34 = g_manager; index = 0; local_40 = (g_manager->_lobbyMembers)._end; puVar8 = (g_manager->_lobbyMembers)._begin; iVar1 = (int)local_40 - (int)puVar8 >> 0x1f; if (((int)local_40 - (int)puVar8) / 0x14 + iVar1 != iVar1) { local_2c = 0; do { iVar1 = *(int *)((int)puVar8 + local_2c + 4); if (iVar1 == 0) { local_58 = 0; local_58._4_4_ = (uint *)0x0; local_58._0_4_ = 0; local_3c = local_58._4_4_; local_40 = (undefined4 *)(uint)local_58; } else { local_3c = *(uint **)(iVar1 + 0xc); local_40 = (undefined4 *)*(uint *)(iVar1 + 8); } local_50 = CONCAT44(local_3c,local_40); FUN_00731ee0(&local_84,&local_50); if (((*(char *)(local_7c + 0xd) != '\0') || (local_3c < *(uint **)(local_7c + 0x14))) || ((uVar4 = local_7c, local_3c <= *(uint **)(local_7c + 0x14) && (local_40 < *(uint *)(local_7c + 0x10))))) { uVar4 = *memberMap; } if (uVar4 != *memberMap) { local_40 = (undefined4 *)0x12; pvVar5 = lobby_member_map_get_or_add(memberMap,&local_50); manager = local_34; FUN_00949bc0((int)pvVar5 + 9); pvVar5 = lobby_member_map_get_or_add(memberMap,&local_50); *(undefined1 *)((int)pvVar5 + 8) = local_40._0_1_; puVar8 = (manager->_lobbyMembers)._begin; } index = index + 1; local_2c = local_2c + 0x14; local_40 = (local_34->_lobbyMembers)._end; } while (index < (uint)(((int)local_40 - (int)puVar8) / 0x14)); lobbyMenu = local_44; } if (puVar8 != local_40) { do { *puVar8 = KAGE::System::UserProfileBase::vftable; puVar8 = puVar8 + 5; } while (puVar8 != local_40); puVar8 = (local_34->_lobbyMembers)._begin; } (local_34->_lobbyMembers)._end = puVar8; pvVar5 = lobby_member_map_get_or_add ((undefined1 *)((int)lobbyMenu + 0x694),lobbyMenu + 0xd4); FUN_008ee3b0(pvVar5); NetplayManager::store_local_persistent_game_data(); local_6c = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyPtr = (int *)0x0; lobbyRefCount = (int *)0x0; local_14._0_1_ = 6; std::shared_ptr::assign(&lobbyPtr,&g_multiplayerLobbyPtr); if (lobbyPtr == (int *)0x0) { local_44 = (ulonglong *)0x0; } else { local_44 = (ulonglong *)(lobbyPtr[5] - lobbyPtr[4] >> 3); } local_6c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 7; if (((lobbyRefCount != (int *)0x0) && (cVar3 = (**(code **)(*lobbyRefCount + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobbyPtr); } manager = g_manager; local_14 = (uint)local_14._1_3_ << 8; puVar9 = (ulonglong *)0x0; if (local_44 != (ulonglong *)0x0) { local_40 = (undefined4 *)(**(code **)(*(int *)&g_manager[1]._gamestate.field_0x6c + 4))(); if (*(int *)&manager[1]._gamestate.field_0x5c == 0) { pvVar5 = *(void **)&manager[1]._gamestate.field_0x50; } else { pvVar5 = *(void **)&manager[1]._gamestate.field_0x5c; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = (void *)0x0; puVar8 = local_40; NetConnection::send_message(g_multiplayerService,&local_50,1,pvVar5,(uint)local_40,0); manager = g_manager; local_44 = (ulonglong *)&DAT_0000003f; local_14._0_1_ = 8; FUN_008ef1d0(&local_50); NetplayManager::send_message(&manager->_netplayManager,1,puVar8,messageRefCount); local_14._0_1_ = 9; if (((local_50._4_4_ != (undefined **)0x0) && (cVar3 = (**(code **)((int)*local_50._4_4_ + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_50); } local_14 = (uint)local_14._1_3_ << 8; puVar9 = local_44; } FUN_008ed320(); update_ready_state(lobbyMenu); } local_6c = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyPtr = (int *)0x0; lobbyRefCount = (int *)0x0; local_14._0_1_ = 10; std::shared_ptr::assign(&lobbyPtr,&g_multiplayerLobbyPtr); local_6c = KAGE::Network::Multiplayer::Lobby::vftable; local_14._0_1_ = 0xb; if (lobbyPtr == (int *)0x0) { local_5c = 0; ownerProfile = &local_60; local_60 = KAGE::System::UserProfile::vftable; uVar4 = (uint)puVar9 | 0x2c0; } else { ownerProfile = (undefined ***)(**(code **)(*lobbyPtr + 0x20))(&local_60); uVar4 = (uint)puVar9 | 0x1c0; } local_50 = CONCAT44(local_50._4_4_,KAGE::System::UserProfileBase::vftable); local_50._4_4_ = ownerProfile[1]; local_50._0_4_ = KAGE::System::UserProfile::vftable; uVar6 = uVar4 & 0xfffffdff; if ((uVar4 & 0x200) == 0) { uVar6 = uVar4; } ppuVar7 = KAGE::System::UserProfileBase::vftable; if ((uVar6 & 0x100) == 0) { ppuVar7 = local_60; } local_14._0_1_ = 0xc; local_60 = ppuVar7; local_21 = KAGE::System::UserProfile::is_local_user(&local_50); local_50 = CONCAT44(local_50._4_4_,KAGE::System::UserProfileBase::vftable); local_6c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 0xd; if (((lobbyRefCount != (int *)0x0) && (cVar3 = (**(code **)(*lobbyRefCount + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobbyPtr); } local_14 = (uint)local_14._1_3_ << 8; if (local_21 != 0) { KAGE::Network::Multiplayer::Lobby::Lobby(&DAT_00c79a70); local_14._0_1_ = 0xe; FUN_00a2a970("current_stage",0); local_14 = (uint)local_14._1_3_ << 8; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_6c); Multiplayer::get_lobby(&DAT_00c79a50,&local_84); local_14._0_1_ = 0xf; FUN_00a2a970("current_stage_type",0); local_14 = (uint)local_14._1_3_ << 8; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_84); } manager = g_manager; *(undefined4 *)&g_manager[1]._gamestate.field_0x87c = 0x3f000000; *(undefined4 *)&manager[1]._gamestate.field_0x88c = 0x438e8000; *(undefined4 *)&manager[1]._gamestate.field_0x888 = 2; KColor::SetFromARGB(&textColor,0xff362f2d); *(float *)&manager[1]._gamestate.field_0x864 = textColor._red; *(float *)&manager[1]._gamestate.field_0x868 = textColor._green; *(float *)&manager[1]._gamestate.field_0x86c = textColor._blue; *(float *)&manager[1]._gamestate.field_0x870 = textColor._alpha; *(int *)&manager[1]._gamestate.field_0x874 = textColor._unk; manager[1]._gamestate.field_0x878 = 0; *(undefined4 *)&manager[1]._gamestate.field_0x880 = 8; *(undefined4 *)&manager[1]._gamestate.field_0x884 = 7; nowMs = get_time_ms(); *lobbyMenu = nowMs; if (*(int **)((int)lobbyMenu + 0x95c) != (int *)0x0) { (**(code **)(**(int **)((int)lobbyMenu + 0x95c) + 0x18))(0); } vector_UserProfile_destroy(&members); ExceptionList = local_1c; return; } } while( true ); } //@@ 008ea350 FUN_008ea350 void FUN_008ea350(void) { undefined4 *in_ECX; *in_ECX = KAGE::System::UserProfileBase::vftable; return; } //@@ 008ea360 FUN_008ea360 void FUN_008ea360(int param_1) { int in_ECX; *(undefined4 *)(in_ECX + 4) = *(undefined4 *)(param_1 + 4); *(undefined1 *)(in_ECX + 8) = *(undefined1 *)(param_1 + 8); *(undefined1 *)(in_ECX + 9) = *(undefined1 *)(param_1 + 9); *(undefined1 *)(in_ECX + 10) = *(undefined1 *)(param_1 + 10); *(undefined1 *)(in_ECX + 0xb) = *(undefined1 *)(param_1 + 0xb); *(undefined1 *)(in_ECX + 0xc) = *(undefined1 *)(param_1 + 0xc); return; } //@@ 008ea3a0 Menu_OnlineLobby::handle_kicked /* DB: ? when g_menuManager->_selectedMenuID == 0x11 (online lobby) and lobby check: pops menu state history (MenuManager::SetState), resets g_multiplayerLobbyPtr, netplay_leave_lobby, NetplayManager::reset, queues the "#Online/LOBBY_KICKED" popup (PopupQueue::push + add_ok_button); from FUN_008ea6e0 and NetplayManager::process_drop_player_message */ void Menu_OnlineLobby::handle_kicked(void) { char cVar1; uint uVar2; int lobbyState; byte *pbVar3; void *in_ECX; void *historyEnd; bool isLobbyCopyHeld; int unused1; void **key; undefined1 local_ec [84]; undefined1 local_98 [12]; undefined1 local_8c [12]; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined8 local_44; undefined **local_3c; undefined **kickedLobby; int *kickedLobbyCtrl; undefined **local_30; undefined **local_2c; int *lobbyCtrl; undefined **local_24; Vector local_20; char isLobbyActive; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; MenuManager *menuManager; puStack_c = &LAB_00b06ef1; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_8c + 0x88); ExceptionList = &local_10; isLobbyCopyHeld = false; local_44 = ZEXT48((undefined **)local_44); if (g_menuManager->_selectedMenuID == 0x11) { local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_20.x = 0.0; local_20.y = 0.0; local_8 = 0; std::shared_ptr::assign(&local_20,&g_multiplayerLobbyPtr); local_24 = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 1; isLobbyCopyHeld = true; local_44 = CONCAT44(7,(undefined **)local_44); if ((int *)local_20.x != (int *)0x0) { cVar1 = (**(code **)(*(int *)local_20.x + 0xc))(); isLobbyActive = '\x01'; if (cVar1 != '\0') goto LAB_008ea42a; } } isLobbyActive = '\0'; LAB_008ea42a: if (isLobbyCopyHeld) { local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 2; if ((((int *)local_20.y != (int *)0x0) && (cVar1 = (**(code **)(*(int *)local_20.y + 0xc))(uVar2), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_20); } } menuManager = g_menuManager; local_8 = 0xffffffff; if (isLobbyActive != '\0') { *(undefined4 *)((int)in_ECX + 0x954) = 0; *(undefined4 *)((int)in_ECX + 0x958) = 0; historyEnd = (menuManager->_menuStateHistory)._end; if (1 < (uint)((int)historyEnd - (int)(menuManager->_menuStateHistory)._begin >> 2)) { historyEnd = (void *)((int)historyEnd + -4); (menuManager->_menuStateHistory)._end = historyEnd; } MenuManager::SetState(menuManager,*(int *)((int)historyEnd + -4),0); local_30 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_2c = (undefined **)0x0; lobbyCtrl = (int *)0x0; key = &g_multiplayerLobbyPtr; local_8 = 3; unused1 = 0x8ea4db; std::shared_ptr::assign(&local_2c,&g_multiplayerLobbyPtr); local_30 = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 4; if (local_2c == (undefined **)0x0) { lobbyState = 0; } else { key = (undefined ***)0x8ea4f5; lobbyState = (**(code **)(*local_2c + 0x3c))(); } local_30 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if (lobbyCtrl != (int *)0x0) { key = (undefined ***)0x8ea517; cVar1 = (**(code **)(*lobbyCtrl + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { key = &local_2c; unused1 = 0x8ea52a; (*g_lobbyReleaseFn)(); } } manager = g_manager; if (lobbyState == 3) { local_3c = KAGE::Network::Multiplayer::ConstLobby::vftable; kickedLobby = (undefined **)0x0; kickedLobbyCtrl = (int *)0x0; local_8 = 6; std::shared_ptr::assign(&kickedLobby,&g_multiplayerLobbyPtr); local_3c = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 7; if (kickedLobby == (undefined **)0x0) { local_44 = 0; local_44._4_4_ = (int *)0x0; local_44._0_4_ = (undefined **)0x0; local_20.x = (float)local_44._4_4_; local_24 = (undefined **)local_44; } else { local_20.x = (float)kickedLobby[3]; local_24 = (undefined **)kickedLobby[2]; } key = &local_24; unused1 = 0x8ea5ac; pbVar3 = map_u64_bool_subscript(&manager[1]._gamestate.field_0x8f4,(ulonglong *)key); *pbVar3 = 1; local_3c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 8; if (kickedLobbyCtrl != (int *)0x0) { key = (undefined ***)0x8ea5cb; cVar1 = (**(code **)(*kickedLobbyCtrl + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { key = &kickedLobby; unused1 = 0x8ea5de; (*g_lobbyReleaseFn)(); } } } local_8 = 0xffffffff; netplay_leave_lobby(&g_manager->_netplayManager,unused1,(int)key); NetplayManager::reset(&g_manager->_netplayManager,1); init_lobby_view(in_ECX); local_20.x = (float)&DAT_bf800000; local_20.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_ec,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_20); local_8 = 9; pbVar3 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/LOBBY_KICKED"); MessagePopup::add_ok_button(pbVar3,local_ec); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_ec); local_70 = 0; local_6c = 0; local_78 = 0; local_74 = 0; local_80 = 0; local_7c = 0; FID_conflict__Tidy(local_8c); FID_conflict__Tidy(local_98); } ExceptionList = local_10; return; } //@@ 008ea6e0 FUN_008ea6e0 void FUN_008ea6e0(undefined4 *param_1,int *param_2) { undefined4 *puVar1; char cVar2; uint uVar3; void *user; int iVar4; void *in_ECX; undefined8 uVar5; undefined1 local_30 [8]; int local_28; void *local_24; uint local_20; undefined **ppuStack_1c; void *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puVar1 = param_1; puStack_c = &LAB_00b06f2d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_30 + 0x2c); ExceptionList = &local_10; local_8 = 0; local_24 = (void *)*param_1; local_20 = param_1[1]; local_18 = local_24; local_14 = local_20; FUN_00731ee0(local_30,&local_24); if ((((*(char *)(local_28 + 0xd) == '\0') && (*(uint *)(local_28 + 0x14) <= local_14)) && ((*(uint *)(local_28 + 0x14) < local_14 || (*(void **)(local_28 + 0x10) <= local_18)))) && (local_28 != *(int *)((int)in_ECX + 0x694))) { if (puVar1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar4 = *(int *)(*(int *)puVar1[2] + 0x14); user = lobby_member_map_get_or_add((void *)((int)in_ECX + 0x694),(ulonglong *)&local_24); switch(*(undefined1 *)(iVar4 + 8)) { case 0: *(undefined1 *)((int)user + 8) = *(undefined1 *)(iVar4 + 10); *(byte *)((int)user + 9) = *(byte *)(iVar4 + 9) & 1; *(byte *)((int)user + 10) = *(byte *)(iVar4 + 9) >> 1 & 1; *(byte *)((int)user + 0xc) = *(byte *)(iVar4 + 9) >> 2 & 1; iVar4 = online_lobby_find_member_index(user); Menu_OnlineLobby::load_member_sprite(in_ECX,iVar4); Menu_OnlineLobby::update_ready_state(in_ECX); break; case 2: iVar4 = online_lobby_find_member_index(user); Menu_OnlineLobby::load_member_sprite(in_ECX,iVar4); break; case 6: *(undefined4 *)((int)in_ECX + 0x6cc) = *(undefined4 *)(iVar4 + 0xc); *(undefined4 *)((int)in_ECX + 0x6d0) = *(undefined4 *)(iVar4 + 0x10); *(undefined4 *)((int)in_ECX + 0x6d4) = *(undefined4 *)(iVar4 + 0x14); *(uint *)((int)in_ECX + 0x6d8) = (uint)*(byte *)(iVar4 + 0x18); *(uint *)((int)in_ECX + 0x6dc) = (uint)(*(byte *)(iVar4 + 0x19) >> 4); *(uint *)((int)in_ECX + 0x6e0) = *(byte *)(iVar4 + 0x19) & 0xf; break; case 8: local_18 = g_userProfile; ppuStack_1c = KAGE::System::UserProfile::vftable; uVar5 = FUN_00a23920(uVar3); if (((int)uVar5 == *(int *)(iVar4 + 0x10)) && ((int)((ulonglong)uVar5 >> 0x20) == *(int *)(iVar4 + 0x14))) { Menu_OnlineLobby::handle_kicked(); } break; case 9: KAGE_LogMessage(1,(byte *)"Recieved upload complete message for User %llu \n "); *(undefined1 *)((int)user + 0xb) = 1; } } local_8 = 1; if (((param_2 != (int *)0x0) && (cVar2 = (**(code **)(*param_2 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } ExceptionList = local_10; return; } //@@ 008ea8f0 Menu_OnlineLobby::update_force_restart /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from Menu_OnlineLobby::Update: lobby_get_member_info loop, Multiplayer::get_lobby, logs "Force Restart is setting Lobby Visibility to PRIVATE"/"%d", leaderboard "%d_scores_coop_R+" via leaderboard_find_async prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::update_force_restart(void *this) { char isLastRef; byte isFindStarted; uint uVar1; void *pvVar2; undefined ***ownerProfileSrc; undefined4 lobbyVisibility; byte *******pppppppbVar3; char *nameEnd; uint uVar4; int iVar5; undefined **ownerProfile; undefined **local_4c; undefined **lobby; int *lobbyPtr; int *lobbyRefCount; undefined1 lobbyHandle [4]; undefined **tmpProfile; uint local_34; char isLobbyVisible; byte isLocalOwner; byte *******leaderboardName [3]; undefined1 lobbyCheckHandle [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isAllReady; char *nameNext; local_8 = 0xffffffff; puStack_c = &LAB_00b06fa6; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(lobbyCheckHandle + 0x1c); ExceptionList = &local_10; local_34 = 0; iVar5 = 0; local_14 = uVar1; do { pvVar2 = lobby_get_member_info(this,iVar5); if ((pvVar2 != (void *)0x0) && (*(char *)((int)pvVar2 + 0xc) != '\0')) { ExceptionList = local_10; return; } iVar5 = iVar5 + 1; } while (iVar5 < 4); if ((*(char *)((int)this + 0x6a8) == '\0') && (*(char *)((int)this + 0x6c1) == '\0')) { ExceptionList = local_10; return; } lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyPtr = (int *)0x0; lobbyRefCount = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&lobbyPtr,&g_multiplayerLobbyPtr); lobby = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 1; if (lobbyPtr == (int *)0x0) { local_34 = 0; ownerProfileSrc = &tmpProfile; tmpProfile = KAGE::System::UserProfile::vftable; uVar1 = 0x16; } else { ownerProfileSrc = (undefined ***)(**(code **)(*lobbyPtr + 0x20))(&tmpProfile,uVar1); uVar1 = 0xe; } local_4c = ownerProfileSrc[1]; ownerProfile = KAGE::System::UserProfile::vftable; if ((uVar1 & 0x10) != 0) { uVar1 = uVar1 & 0xffffffef; } if ((uVar1 & 8) != 0) { uVar1 = uVar1 & 0xfffffff7; tmpProfile = KAGE::System::UserProfileBase::vftable; } uVar4 = 0; local_8 = CONCAT31(local_8._1_3_,2); isLocalOwner = KAGE::System::UserProfile::is_local_user(&ownerProfile); ownerProfile = KAGE::System::UserProfileBase::vftable; lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 3; if (((lobbyRefCount != (int *)0x0) && (isLastRef = (**(code **)(*lobbyRefCount + 0xc))(), isLastRef != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobbyPtr); } local_8 = 0xffffffff; if ((*(char *)((int)this + 0x6c1) == '\0') || (isLocalOwner == 0)) goto LAB_008eab31; iVar5 = *(int *)((int)this + 0x6ac); if (iVar5 == 0) { iVar5 = *(int *)((int)this + 0x6b0); } if (iVar5 - 1U < 0xb3) { pvVar2 = Multiplayer::get_lobby(&DAT_00c79a50,lobbyCheckHandle); local_8 = 4; uVar4 = uVar1 | 0x21; local_34 = uVar4; if (*(int **)((int)pvVar2 + 4) == (int *)0x0) goto LAB_008eaa98; iVar5 = (**(code **)(**(int **)((int)pvVar2 + 4) + 0x3c))(); isLobbyVisible = '\x01'; if (iVar5 == 0) goto LAB_008eaa98; } else { LAB_008eaa98: isLobbyVisible = '\0'; } local_8 = 0xffffffff; if ((uVar4 & 1) != 0) { KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(lobbyCheckHandle); } if (isLobbyVisible != '\0') { pvVar2 = Multiplayer::get_lobby(&DAT_00c79a50,lobbyHandle); local_8 = 5; if (*(int **)((int)pvVar2 + 4) == (int *)0x0) { lobbyVisibility = 0; } else { lobbyVisibility = (**(code **)(**(int **)((int)pvVar2 + 4) + 0x3c))(); } *(undefined4 *)((int)this + 0x6c4) = lobbyVisibility; local_8 = 0xffffffff; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(lobbyHandle); KAGE_LogMessage(1,(byte *)"Force Restart is setting Lobby Visibility to PRIVATE \n"); pvVar2 = Multiplayer::get_lobby(&DAT_00c79a50,lobbyHandle); local_8 = 6; if (*(int **)((int)pvVar2 + 4) != (int *)0x0) { (**(code **)(**(int **)((int)pvVar2 + 4) + 0x38))(0); } local_8 = 0xffffffff; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(lobbyHandle); } LAB_008eab31: if (*(int *)((int)this + 0x6ac) < 1) { if (*(int *)((int)this + 0x6b0) < 1) { if (isLocalOwner == 0) { ExceptionList = local_10; return; } if (*(int *)((int)this + 0x954) != 3) { ExceptionList = local_10; return; } isAllReady = true; iVar5 = 0; do { pvVar2 = lobby_get_member_info(this,iVar5); if (pvVar2 != (void *)0x0) { if (*(char *)((int)pvVar2 + 0xb) == '\0') { isAllReady = false; } } iVar5 = iVar5 + 1; } while (iVar5 < 4); if (!isAllReady) { ExceptionList = local_10; return; } FUN_008ee080(); *(undefined4 *)((int)this + 0x954) = 0; ExceptionList = local_10; return; } iVar5 = *(int *)((int)this + 0x6b0) + -1; *(int *)((int)this + 0x6b0) = iVar5; } else { iVar5 = *(int *)((int)this + 0x6ac) + -1; *(int *)((int)this + 0x6ac) = iVar5; } if (iVar5 == 0) { if ((g_manager->_lobbySettings)._gameMode == 5) { sprintf_s(&DAT_00c7f490,0x20,(byte *)"%d_scores_coop_R+"); local_1c = 0; local_18 = 0xf; leaderboardName[0] = (byte *******)0x0; nameNext = &DAT_00c7f490; do { nameEnd = nameNext; nameNext = nameEnd + 1; } while (*nameEnd != '\0'); std::string::assign((char *)leaderboardName,&DAT_00c7f490,(uint)(nameEnd + -0xc7f490)); local_8 = 7; pppppppbVar3 = (byte *******)leaderboardName; if (0xf < local_18) { pppppppbVar3 = leaderboardName[0]; } isFindStarted = leaderboard_find_async((byte *)pppppppbVar3,0,FUN_008eec40,this); local_8 = 0xffffffff; if (0xf < local_18) { uVar1 = local_18 + 1; pppppppbVar3 = leaderboardName[0]; if (0xfff < uVar1) { pppppppbVar3 = (byte *******)leaderboardName[0][-1]; uVar1 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)leaderboardName[0] + (-4 - (int)pppppppbVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar3,uVar1); } if (isFindStarted != 0) { *(undefined4 *)((int)this + 0x954) = 1; } if (isLocalOwner == 0) { ExceptionList = local_10; return; } } else { if (isLocalOwner == 0) { ExceptionList = local_10; return; } FUN_008ee080(); } if (*(char *)((int)this + 0x6c1) != '\0') { KAGE_LogMessage(1,(byte *)"Force Restart is setting Lobby Visibility to %d \n"); pvVar2 = Multiplayer::get_lobby(&DAT_00c79a50,&lobby); local_8 = 8; if (*(int **)((int)pvVar2 + 4) != (int *)0x0) { (**(code **)(**(int **)((int)pvVar2 + 4) + 0x38))(*(undefined4 *)((int)this + 0x6c4)); } KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&lobby); } } ExceptionList = local_10; return; } //@@ 008ead10 Menu_OnlineLobby::update_controls /* DB: ? once from Menu_OnlineLobby::Update: input callbacks via vftable 00c57b18 slot 0x74, CONFIRM_LEAVE_LOBBY prompt, "Attempting to create a message when there is no multiplayer service", toggles this+0x6b8/+0x6bc/+0x6c0 chat state prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::update_controls(void *this) { int iVar1; Vector VVar2; char cVar3; uint uVar4; Vector *pVVar5; void *pvVar6; int iVar7; int *piVar8; int *piVar9; bool bVar10; undefined8 bannedUserId; void *messageRefCount; undefined1 popup [84]; undefined1 local_a4 [12]; undefined1 local_98 [12]; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; Vector local_50; byte isLocalUser; char isCharacterChangeAllowed; undefined1 messageHeader [4]; undefined **lobby; int *local_38; int *local_34; int *local_30; undefined **userProfile; float local_28; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; int *memberActionPtr; puStack_20 = messageHeader + 0x3c; puStack_18 = &LAB_00b07039; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(messageHeader + 0x30); ExceptionList = &local_1c; local_28 = 0.0; lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_38 = (int *)0x0; local_34 = (int *)0x0; local_14 = 0; std::shared_ptr::assign(&local_38,&g_multiplayerLobbyPtr); lobby = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 1; if (local_38 == (int *)0x0) { pVVar5 = &local_50; local_50.x = 1.6914087e-38; local_50.y = 0.0; uVar4 = 0x16; } else { pVVar5 = (Vector *)(**(code **)(*local_38 + 0x20))(&local_50,uVar4); uVar4 = 0xe; } userProfile = KAGE::System::UserProfileBase::vftable; local_28 = pVVar5->y; userProfile = KAGE::System::UserProfile::vftable; if ((uVar4 & 0x10) != 0) { uVar4 = uVar4 & 0xffffffef; } if ((uVar4 & 8) != 0) { uVar4 = uVar4 & 0xfffffff7; local_50.x = (float)KAGE::System::UserProfileBase::vftable; } local_30 = (int *)(uVar4 | 0x20); local_14 = CONCAT31(local_14._1_3_,2); isLocalUser = KAGE::System::UserProfile::is_local_user(&userProfile); userProfile = KAGE::System::UserProfileBase::vftable; lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 3; if (((local_34 != (int *)0x0) && (cVar3 = (**(code **)(*local_34 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } local_14 = 0xffffffff; iVar7 = (g_manager->_lobbySettings)._gameMode; if (((iVar7 == 5) || (iVar7 == 4)) || (isCharacterChangeAllowed = '\x01', *(int *)((int)this + 0x94c) != 0)) { isCharacterChangeAllowed = '\0'; } local_28 = 1.96182e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if ((cVar3 != '\0') && (pvVar6 = lobby_member_map_get_or_add ((void *)((int)this + 0x694),(ulonglong *)((int)this + 0x6a0)), *(char *)((int)pvVar6 + 8) == '\0')) { *(undefined4 *)((int)this + 0x6b8) = 1; *(undefined4 *)((int)this + 0x6bc) = 0; } local_28 = 2.10195e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 != '\0') { local_50.x = -1.0; local_50.y = -1.0; MessagePopup::MessagePopup (popup,&g_manager->_font2_TeamMeatEx12,leave_popup_callback,this,&local_50); local_14 = 4; MessagePopup::add_yes_no_buttons((byte *)"##GAME###Online/CONFIRM_LEAVE_LOBBY",popup); iVar7 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,popup); local_14 = 0xffffffff; *(int *)((int)this + 0x688) = iVar7; local_7c = 0; local_78 = 0; local_84 = 0; local_80 = 0; local_8c = 0; local_88 = 0; FID_conflict__Tidy(local_98); FID_conflict__Tidy(local_a4); } local_28 = 3.92364e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 == '\0') { local_28 = 3.36312e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 == '\0') { LAB_008eb094: local_21 = '\0'; } else { lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_38 = (int *)0x0; local_34 = (int *)0x0; local_14 = 5; std::shared_ptr::assign(&local_38,&g_multiplayerLobbyPtr); lobby = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 6; local_30 = (int *)((uint)local_30 | 0xc1); local_28 = (float)local_30; if (local_38 == (int *)0x0) { bVar10 = false; } else { iVar7 = local_38[5]; iVar1 = local_38[4]; uVar4 = (**(code **)(*local_38 + 0x1c))(); bVar10 = uVar4 <= (uint)(iVar7 - iVar1 >> 3); } local_21 = '\x01'; if (bVar10) goto LAB_008eb094; } if (((uint)local_30 & 1) != 0) { lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 7; if (((local_34 != (int *)0x0) && (cVar3 = (**(code **)(*local_34 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } } local_14 = 0xffffffff; if (local_21 != '\0') { InviteFriendsMenu::load_graphics(); } } else { pvVar6 = lobby_member_map_get_or_add ((void *)((int)this + 0x694),(ulonglong *)((int)this + 0x6a0)); bVar10 = *(char *)((int)pvVar6 + 8) != '\0'; if (bVar10) { toggle_ready(); } *(uint *)((int)this + 0x6b8) = (uint)!bVar10; *(undefined4 *)((int)this + 0x6bc) = 0; } local_28 = 4.06377e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (((cVar3 != '\0') && (piVar8 = lobby_get_member_info(this,0), piVar8 != (int *)0x0)) && ((cVar3 = (**(code **)(*piVar8 + 0x14))(), cVar3 != '\0' && ((g_manager->_lobbySettings)._password._size != 0)))) { *(bool *)((int)this + 0x6c0) = *(char *)((int)this + 0x6c0) == '\0'; } if (isCharacterChangeAllowed == '\0') goto LAB_008eb2be; pvVar6 = lobby_member_map_get_or_add((void *)((int)this + 0x694),(ulonglong *)((int)this + 0x6a0)) ; if ((*(char *)((int)pvVar6 + 10) != '\0') || (*(int *)((int)this + 0x6b8) != 0)) goto LAB_008eb2be; iVar7 = *(int *)((int)this + 0x6b4); if ((iVar7 == 0) || ((0x31 < iVar7 && (iVar7 % 10 == 0)))) { local_21 = '\x01'; } else { local_21 = '\0'; } local_28 = 2.8026e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_28,0,0); if (cVar3 == '\0') { local_28 = 2.94273e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_28,0,0); if (cVar3 != '\0') { if (local_21 != '\0') { change_character(1,1); } goto LAB_008eb224; } *(undefined4 *)((int)this + 0x6b4) = 0; } else if (local_21 == '\0') { LAB_008eb224: *(int *)((int)this + 0x6b4) = *(int *)((int)this + 0x6b4) + 1; } else { change_character(0xffffffff,1); *(int *)((int)this + 0x6b4) = *(int *)((int)this + 0x6b4) + 1; } pvVar6 = lobby_member_map_get_or_add((void *)((int)this + 0x694),(ulonglong *)((int)this + 0x6a0)) ; local_28 = 3.50325e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if ((cVar3 != '\0') && ((*(char *)((int)pvVar6 + 9) != '\0' || (cVar3 = FUN_008ed2e0(), cVar3 != '\0')))) { change_character(0x3e9,1); Menu_Character::set_character_menu_shown (&g_menuManager->_menuCharacter, 1 - (g_manager->_persistentGameData)._characterMenuShown); Menu_Character::Reset(&g_menuManager->_menuCharacter); } LAB_008eb2be: lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_38 = (int *)0x0; local_34 = (int *)0x0; local_14 = 8; std::shared_ptr::assign(&local_38,&g_multiplayerLobbyPtr); if (local_38 == (int *)0x0) { uVar4 = 0; } else { uVar4 = local_38[5] - local_38[4] >> 3; } lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 9; if (((local_34 != (int *)0x0) && (cVar3 = (**(code **)(*local_34 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } local_14 = 0xffffffff; if (1 < uVar4) { local_28 = 3.64338e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 != '\0') { if (*(int *)((int)this + 0x94c) == 0) { pvVar6 = Multiplayer::get_lobby(&DAT_00c79a50,&lobby); iVar7 = *(int *)((int)pvVar6 + 4); if (iVar7 == 0) { *(undefined4 *)((int)this + 0x94c) = 0xffffffff; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&lobby); } else { *(int *)((int)this + 0x94c) = (*(int *)(iVar7 + 0x14) - *(int *)(iVar7 + 0x10) >> 3) + -1; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&lobby); } } else { *(int *)((int)this + 0x94c) = *(int *)((int)this + 0x94c) + -1; } *(undefined4 *)((int)this + 0x950) = 0; } local_28 = 3.78351e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 != '\0') { lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_38 = (int *)0x0; local_34 = (int *)0x0; local_14 = 10; std::shared_ptr::assign(&local_38,&g_multiplayerLobbyPtr); if (local_38 == (int *)0x0) { uVar4 = 0; } else { uVar4 = local_38[5] - local_38[4] >> 3; } lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; *(uint *)((int)this + 0x94c) = (*(int *)((int)this + 0x94c) + 1U) % uVar4; local_14 = 0xb; if (((local_34 != (int *)0x0) && (cVar3 = (**(code **)(*local_34 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } *(undefined4 *)((int)this + 0x950) = 0; } } lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_38 = (int *)0x0; local_34 = (int *)0x0; local_14 = 0xc; std::shared_ptr::assign(&local_38,&g_multiplayerLobbyPtr); if (local_38 == (int *)0x0) { iVar7 = 0; } else { iVar7 = local_38[5] - local_38[4] >> 3; } lobby = KAGE::Network::Multiplayer::ConstLobby::vftable; uVar4 = *(uint *)((int)this + 0x94c); if (iVar7 - 1U < *(uint *)((int)this + 0x94c)) { uVar4 = iVar7 - 1U; } *(uint *)((int)this + 0x94c) = uVar4; local_14 = 0xd; if (((local_34 != (int *)0x0) && (cVar3 = (**(code **)(*local_34 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } local_14 = 0xffffffff; if (0 < *(int *)((int)this + 0x94c)) { local_28 = 3.22299e-44; local_30 = (int *)((isLocalUser != 0) + 1); cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); piVar8 = local_30; if (cVar3 != '\0') { *(int *)((int)this + 0x950) = (*(int *)((int)this + 0x950) + 1) % ((int)local_30 + 1); } local_28 = 3.08286e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 != '\0') { memberActionPtr = (int *)((int)this + 0x950); *memberActionPtr = *memberActionPtr + -1; piVar9 = (int *)*(int *)((int)this + 0x950); if (*memberActionPtr < 0) { piVar9 = piVar8; } *(int **)((int)this + 0x950) = piVar9; } local_28 = 1.96182e-44; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_28,0,0); if (cVar3 != '\0') { local_30 = (int *)(*(int *)((int)this + 0x94c) + -1); uVar4 = 0; while (iVar7 = FUN_008edde0(uVar4), (int *)iVar7 != local_30) { uVar4 = uVar4 + 1; if (3 < uVar4) { ExceptionList = local_1c; return; } } local_30 = lobby_get_member_info(this,uVar4); if (local_30 != (int *)0x0) { iVar7 = *(int *)((int)this + 0x950); if (iVar7 == 0) { (**(code **)(*local_30 + 0x1c))(); ExceptionList = local_1c; return; } if (iVar7 == 1) { (**(code **)(*local_30 + 0x10))(); ExceptionList = local_1c; return; } if (iVar7 == 2) { bannedUserId = FUN_00a23920(); NetplayManager::ban_user(bannedUserId); iVar7 = local_30[1]; if (iVar7 == 0) { local_50.x = 0.0; local_50.y = 0.0; VVar2 = local_50; local_50.y = 0.0; local_50.x = 0.0; local_34 = (int *)local_50.y; local_38 = (int *)local_50.x; local_50 = VVar2; } else { local_34 = (int *)*(float *)(iVar7 + 0xc); local_38 = *(int **)(iVar7 + 8); } messageHeader[0] = 8; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = (void *)0x0; pvVar6 = (void *)0x10; NetConnection::send_message(g_multiplayerService,&local_50,1,messageHeader,0x10,0); manager = g_manager; local_14 = 0xe; FUN_008ef1d0(&local_50); NetplayManager::send_message(&manager->_netplayManager,1,pvVar6,messageRefCount); local_14 = 0xf; if ((((int *)local_50.y != (int *)0x0) && (cVar3 = (**(code **)(*(int *)local_50.y + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_50); } } } } } ExceptionList = local_1c; return; } //@@ 008eb750 Menu_OnlineLobby::start_game /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from Menu_OnlineLobby::Update (on even frames, then returns): resets +0x958, LobbySettings::reset, ChallengeParam::Reset, daily_challenge_refresh, Menu_Save::select_save_slot, PersistentGameData::IncreaseEventCounter */ void Menu_OnlineLobby::start_game(void) { char cVar1; int in_ECX; Manager *manager; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_b2 [2]; KColor local_a8; undefined **lobbyHandle; int *lobbyPtr; int *lobbyRefCountPtr; byte isRerunAvailable; LobbySettings lobbySettings; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint local_14; manager = g_manager; puStack_20 = (&lobbySettings)[1]._password._buf + 4; local_14 = 0xffffffff; puStack_18 = &LAB_00b070a1; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)&(&lobbySettings)[1]._seed._size; ExceptionList = &local_1c; *(undefined4 *)(in_ECX + 0x958) = 0; *(undefined4 *)&manager[1]._gamestate.field_0x87c = 0x3f000000; *(undefined4 *)&manager[1]._gamestate.field_0x88c = 0x43480000; *(undefined4 *)&manager[1]._gamestate.field_0x888 = 5; KColor::SetFromARGB(&local_a8,0xffffffff); *(float *)&manager[1]._gamestate.field_0x864 = local_a8._red; *(float *)&manager[1]._gamestate.field_0x868 = local_a8._green; *(float *)&manager[1]._gamestate.field_0x86c = local_a8._blue; *(float *)&manager[1]._gamestate.field_0x870 = local_a8._alpha; *(int *)&manager[1]._gamestate.field_0x874 = local_a8._unk; manager[1]._gamestate.field_0x878 = 1; *(undefined4 *)&manager[1]._gamestate.field_0x880 = 10; *(undefined4 *)&manager[1]._gamestate.field_0x884 = 0x14; if ((manager->_lobbySettings)._gameMode == 5) { lobbyHandle = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyPtr = (int *)0x0; lobbyRefCountPtr = (int *)0x0; local_14 = 0; std::shared_ptr::assign(&lobbyPtr,&g_multiplayerLobbyPtr); lobbyHandle = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 1; if (lobbyPtr != (int *)0x0) { (**(code **)(*lobbyPtr + 0x38))(); } lobbyHandle = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 2; if (lobbyRefCountPtr != (int *)0x0) { cVar1 = (**(code **)(*lobbyRefCountPtr + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } local_14 = 0xffffffff; daily_challenge_refresh(); manager = g_manager; } isRerunAvailable = manager->_rerunAvailable; LobbySettings::reset(&lobbySettings); local_a8._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_a8._alpha = 0.0; local_a8._unk = 0; local_14 = 4; std::shared_ptr::assign(&local_a8._alpha,&g_multiplayerLobbyPtr); local_a8._blue = (float)KAGE::Network::Multiplayer::Lobby::vftable; lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_14._0_1_ = 6; std::shared_ptr::assign(auStack_b2 + -10,&local_a8._alpha); local_14._0_1_ = 5; Menu_Save::select_save_slot((Menu_Save *)&lobbySettings,lobbyHandleVtable,lobby,lobbyRefCount); local_a8._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 7; if ((int *)local_a8._unk != (int *)0x0) { cVar1 = (**(code **)(*(int *)local_a8._unk + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } local_14 = CONCAT31(local_14._1_3_,3); manager->_rerunAvailable = isRerunAvailable; manager->_debugStart = 0; manager->_startingFromRerun = 0; manager->_starting = 1; manager->_networkPlay = 1; manager->_startChallenge = lobbySettings._challenge; manager->_consecutiveResetCount = 0; (manager->_dailyChallenge)._isPractice = 0; if (lobbySettings._gameMode == 5) { if ((g_manager->_persistentGameData)._eventCounters[0xbf] != 0) { PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,0xc0, -(g_manager->_persistentGameData)._eventCounters[0xc0]); } manager = g_manager; (g_manager->_persistentGameData)._eventCounters[0xbf] = 1; PersistentGameData::IncreaseEventCounter(&manager->_persistentGameData,0xbe,1); } else { (manager->_dailyChallenge)._id = 0; (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; ChallengeParam::Reset(&(manager->_dailyChallenge)._params); } std::vector::_Tidy(); std::string::_Tidy_deallocate(lobbySettings._password._buf); std::string::_Tidy_deallocate(lobbySettings._seed._buf); ExceptionList = local_1c; return; } //@@ 008eba50 Menu_OnlineLobby::render_lobby_info /* DB: ? from Menu_OnlineLobby::Render: null "LobbyInfoPos", layers Mode_Type/Tag_Type set by lobby mode (Manager+0x4b0dc/+0x4b0ec/+0x4b100), returns early while Manager+0x4b0e0 set */ void Menu_OnlineLobby::render_lobby_info(void) { byte bVar1; float *infoNullFrame; byte *pbVar2; uint cmpResult; LayerState *pLVar3; int in_ECX; byte *pbVar4; byte *pbVar5; AnimationState *lastAnimState; bool isLess; Vector drawPos; float baseY; float lineSpacing; char isSeedShown; ANM2 *infoSprite; Manager *manager; int tagType; if ((g_manager->_lobbySettings)._challenge != 0) { return; } tagType = *(int *)&(g_manager->_lobbySettings).field_0x14; if (((g_manager->_lobbySettings)._seed._size == 0) || ((g_manager->_lobbySettings)._gameMode == 5) ) { isSeedShown = '\0'; } else { isSeedShown = '\x01'; } bVar1 = (tagType != 0) + 2; if (isSeedShown == '\0') { bVar1 = (tagType != 0) + 1; } if (bVar1 < 3) { lineSpacing = 17.0; } else { lineSpacing = 14.0; } drawPos.y = (g_menuManager->_ViewPosition).x + *(float *)(in_ECX + 8); baseY = (g_menuManager->_ViewPosition).y + *(float *)(in_ECX + 0xc); if (*(int *)(in_ECX + 0x44) == 0) { infoNullFrame = (float *)0x0; } else { infoNullFrame = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x40),(byte *)"LobbyInfoPos"); } drawPos.x = drawPos.y + *infoNullFrame; drawPos.y = baseY + infoNullFrame[1]; if (1 < bVar1) { drawPos.y = drawPos.y - ((float)bVar1 * 0.5 * lineSpacing - lineSpacing * 0.5); } pbVar2 = *(byte **)(in_ECX + 0x494); infoSprite = (ANM2 *)(in_ECX + 0x460); if (pbVar2 == (byte *)0x0) { LAB_008ebba9: bVar1 = ANM2::SetAnimation(infoSprite,&DAT_00b734e0,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x490)); *(undefined1 *)(in_ECX + 0x4a4) = 1; } } else { if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pbVar4 = &DAT_00b734e0; do { bVar1 = *pbVar2; isLess = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_008ebb91: cmpResult = -(uint)isLess | 1; goto LAB_008ebb96; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; isLess = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_008ebb91; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); cmpResult = 0; LAB_008ebb96: if ((cmpResult != 0) || ((*(char *)(*(int *)(in_ECX + 0x494) + 0x34) != '\0' && (*(char *)(in_ECX + 0x4a4) == '\0'))) ) goto LAB_008ebba9; } if (*(char *)(in_ECX + 0x569) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x490)); AnimationState::Update((AnimationState *)(in_ECX + 0x4b0)); } manager = g_manager; pLVar3 = ANM2::GetLayer(infoSprite,(byte *)"Mode_Type"); if (pLVar3 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(infoSprite,*(int *)pLVar3->_layerData,(manager->_lobbySettings)._gameMode); } if (*(char *)(in_ECX + 0x569) != '\0') { if (*(char *)(in_ECX + 0x4d0) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x490),&drawPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(in_ECX + 0x4b0); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x4b0),&drawPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(in_ECX + 0x490); } AnimationState::Render(lastAnimState,&drawPos,&g_vectorZero,&g_vectorZero); } if (tagType == 0) goto LAB_008ebdb4; drawPos.y = drawPos.y + lineSpacing; pbVar2 = *(byte **)(in_ECX + 0x494); if (pbVar2 == (byte *)0x0) { LAB_008ebce3: bVar1 = ANM2::SetAnimation(infoSprite,&DAT_00b75640,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x490)); *(undefined1 *)(in_ECX + 0x4a4) = 1; } } else { pbVar4 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar4 = *(byte **)pbVar2; } pbVar5 = &DAT_00b75640; do { bVar1 = *pbVar4; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_008ebcd0: cmpResult = -(uint)isLess | 1; goto LAB_008ebcd5; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_008ebcd0; pbVar4 = pbVar4 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); cmpResult = 0; LAB_008ebcd5: if ((cmpResult != 0) || ((pbVar2[0x34] != 0 && (*(char *)(in_ECX + 0x4a4) == '\0')))) goto LAB_008ebce3; } if (*(char *)(in_ECX + 0x569) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x490)); AnimationState::Update((AnimationState *)(in_ECX + 0x4b0)); } tagType = *(int *)&(g_manager->_lobbySettings).field_0x14; pLVar3 = ANM2::GetLayer(infoSprite,(byte *)"Tag_Type"); if (pLVar3 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(infoSprite,*(int *)pLVar3->_layerData,tagType); } if (*(char *)(in_ECX + 0x569) != '\0') { if (*(char *)(in_ECX + 0x4d0) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x490),&drawPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(in_ECX + 0x4b0); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x4b0),&drawPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(in_ECX + 0x490); } AnimationState::Render(lastAnimState,&drawPos,&g_vectorZero,&g_vectorZero); } LAB_008ebdb4: if (isSeedShown != '\0') { drawPos.y = drawPos.y + lineSpacing; FUN_008ebde0(&drawPos); } return; } //@@ 008ebde0 FUN_008ebde0 void FUN_008ebde0(Vector *param_1) { AnimationState *this; byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; Font *this_00; float *pfVar5; std_string *text; int in_ECX; byte *pbVar6; AnimationState *this_01; bool bVar7; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; KColor local_30; Vector local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b070dd; local_10 = ExceptionList; ExceptionList = &local_10; pbVar1 = *(byte **)(in_ECX + 0x494); if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pbVar6 = &DAT_00b7562c; do { bVar2 = *pbVar3; bVar7 = bVar2 < *pbVar6; if (bVar2 != *pbVar6) { LAB_008ebe43: uVar4 = -(uint)bVar7 | 1; goto LAB_008ebe48; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < pbVar6[1]; if (bVar2 != pbVar6[1]) goto LAB_008ebe43; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008ebe48: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x4a4) != '\0')))) goto LAB_008ebe81; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x460),&DAT_00b7562c,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x490)); *(undefined1 *)(in_ECX + 0x4a4) = 1; } LAB_008ebe81: this = (AnimationState *)(in_ECX + 0x490); if (*(char *)(in_ECX + 0x569) != '\0') { AnimationState::Update(this); AnimationState::Update((AnimationState *)(in_ECX + 0x4b0)); if (*(char *)(in_ECX + 0x569) != '\0') { if (*(char *)(in_ECX + 0x4d0) == '\0') { AnimationState::Render(this,param_1,&g_vectorZero,&g_vectorZero); this_01 = (AnimationState *)(in_ECX + 0x4b0); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x4b0),param_1,&g_vectorZero,&g_vectorZero); this_01 = this; } AnimationState::Render(this_01,param_1,&g_vectorZero,&g_vectorZero); } } this_00 = &g_manager->_font2_TeamMeatEx12; local_4c = 3; local_48 = 0xffff; local_44 = 0; local_40 = 0x3f800000; local_3c = 0xffffffff; local_38 = 0; local_34 = 0; local_8 = 0; KColor::SetFromARGB(&local_30,0xff362f2d); if (*(int *)(in_ECX + 0x494) == 0) { pfVar5 = (float *)0x0; } else { pfVar5 = AnimationState::GetNullFrame(this,(byte *)"SeedNum"); } local_1c.x = *pfVar5 + param_1->x; local_1c.y = pfVar5[1] + param_1->y; text = &(g_manager->_lobbySettings)._seed; if (0xf < (g_manager->_lobbySettings)._seed._capacity) { text = *(std_string **)text->_buf; } Font::DrawStringScaled(this_00,(byte *)text,&local_1c,&local_30,&local_4c); ExceptionList = local_10; return; } //@@ 008ebfb0 GameOver::RenderItemSprite /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall void GameOver::RenderItemSprite(int itemId, Vector* pos, ColorMod* color, Vector* scale, BlendMode* blendMode); prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall GameOver::RenderItemSprite(GameOver *this,int memberIndex) { ColorMod color; ColorMod color_00; Vector position; Vector pos; Vector pos_00; GameOver *pGVar1; char cVar2; ANM2 *memberSprite; int *user; int iVar3; std_string *right; byte *******pppppppbVar4; float *nullFrame; LayerState *pLVar5; float fVar6; void *settings; KColor *color_01; byte unk; void *pvVar7; KColor *color_02; int *size; uint uVar8; undefined1 *portraitSprite; bool bVar9; float fVar10; float fVar11; float fVar12; undefined1 in_stack_fffffef0 [28]; undefined4 in_stack_ffffff0c; int in_stack_ffffff10; KColor *in_stack_ffffff14; KColor *pos_01; char *nullLayerName; FontSettings fontSettings [5]; undefined4 local_b8; undefined4 local_b4; undefined **local_b0; Font *local_ac; int *local_a8; KColor local_a4; GameOver *local_90; float local_8c; int local_88; float slotY; float slotX; int local_7c; byte local_76; char isSwapAllowed; byte local_74; char isKeyboard; char local_72; byte isVisible; undefined1 local_70 [8]; char local_68 [8]; undefined4 local_60; uint local_5c; byte *******local_58; KColor local_54; void *numberText [3]; undefined **local_34; KColor local_30; void *local_1c; undefined1 *puStack_18; void *local_14; Manager *manager; local_30._unk = (int)(numberText + 0xf); puStack_18 = &LAB_00b07173; local_1c = ExceptionList; local_30._alpha = (float)(__security_cookie ^ (uint)(numberText + 0xc)); ExceptionList = &local_1c; local_a4._green = (float)memberIndex; local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_30._red = 0.0; local_30._green = 0.0; local_14 = (void *)0x0; local_90 = this; std::shared_ptr::assign(&local_30,&g_multiplayerLobbyPtr); local_34 = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = (void *)0x1; if ((int *)local_30._red == (int *)0x0) { LAB_008ec04c: local_74 = '\x01'; } else { cVar2 = (**(code **)(*(int *)local_30._red + 0xc))(); local_74 = '\0'; if (cVar2 == '\0') goto LAB_008ec04c; } local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = (void *)0x2; if ((((int *)local_30._green != (int *)0x0) && (cVar2 = (**(code **)(*(int *)local_30._green + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_14 = (void *)0xffffffff; if (local_74 != '\0') { ExceptionList = local_1c; return; } isKeyboard = g_menuControllerIndex == 0; slotX = (g_menuManager->_ViewPosition).x + *(float *)&this->field_0x8; slotY = (g_menuManager->_ViewPosition).y + *(float *)&this->field_0xc; local_8c = g_vectorZero.x; local_a4._unk = (int)g_vectorZero.y; memberSprite = (ANM2 *)lobby_member_sprite_get(); if (memberSprite == (ANM2 *)0x0) { ExceptionList = local_1c; return; } local_a4._blue = (float)memberSprite; user = lobby_get_member_info(this,(int)local_a4._green); local_a8 = user; local_7c = FUN_008edde0(); local_7c = local_7c + 1; local_88 = *(int *)&local_90[8].field_0x4c; local_74 = local_7c == local_88; if (user == (int *)0x0) { LAB_008ec144: local_72 = '\0'; } else { cVar2 = (**(code **)(*user + 0x14))(); local_72 = '\x01'; if (cVar2 == '\0') goto LAB_008ec144; } local_54._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_54._alpha = 0.0; local_54._unk = 0; local_14 = (void *)0x3; std::shared_ptr::assign(&local_54._alpha,&g_multiplayerLobbyPtr); local_54._blue = (float)KAGE::Network::Multiplayer::Lobby::vftable; local_14 = (void *)0x4; if ((int *)local_54._alpha == (int *)0x0) { local_30._green = 0.0; } else { iVar3 = (**(code **)(*(int *)local_54._alpha + 0x20))(); local_30._green = *(float *)(iVar3 + 4); local_b0 = KAGE::System::UserProfileBase::vftable; } local_30._red = (float)KAGE::System::UserProfile::vftable; local_14 = (void *)CONCAT31(local_14._1_3_,5); local_76 = KAGE::System::UserProfile::is_local_user(&local_30); local_30._red = (float)KAGE::System::UserProfileBase::vftable; local_54._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = (void *)0x6; if ((((int *)local_54._unk != (int *)0x0) && (cVar2 = (**(code **)(*(int *)local_54._unk + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_54._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_54._alpha = 0.0; local_54._unk = 0; local_14 = (void *)0x7; std::shared_ptr::assign(&local_54._alpha,&g_multiplayerLobbyPtr); local_54._blue = (float)KAGE::Network::Multiplayer::Lobby::vftable; local_14 = (void *)0x8; if ((int *)local_54._alpha == (int *)0x0) { local_ac = (Font *)0x0; } else { local_ac = (Font *)(**(code **)(*(int *)local_54._alpha + 0x1c))(); } local_54._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = (void *)0x9; if ((((int *)local_54._unk != (int *)0x0) && (cVar2 = (**(code **)(*(int *)local_54._unk + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; iVar3 = (g_manager->_lobbySettings)._gameMode; if ((((iVar3 == 4) || (iVar3 == 5)) || (local_7c != local_88)) || (isSwapAllowed = '\x01', local_72 == '\0')) { isSwapAllowed = '\0'; } if ((user == (int *)0x0) || (cVar2 = (**(code **)(*user + 0x14))(), cVar2 == '\0')) { right = int_to_string((std_string *)numberText,local_7c); builtin_strncpy(local_68,"Player",7); local_5c = 0xf; local_60 = 0xe; local_70 = (undefined1 [8])0x6e6f697469736f50; local_14 = (void *)0xb; std::string::concat_move((char *)&local_58,(int)local_30._green,local_70,right); local_14._0_1_ = 0xc; pppppppbVar4 = (byte *******)&local_58; if (&DAT_0000000f < (uint)local_54._unk) { pppppppbVar4 = local_58; } if (*(int *)&local_90->field_0x44 == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)&local_90->field_0x40,(byte *)pppppppbVar4); } memberSprite = (ANM2 *)local_a4._blue; local_8c = *nullFrame; local_a4._unk = (int)nullFrame[1]; local_14._0_1_ = 0xb; if (&DAT_0000000f < (uint)local_54._unk) { size = (int *)(local_54._unk + 1); pppppppbVar4 = local_58; if ((int *)0xfff < size) { pppppppbVar4 = (byte *******)local_58[-1]; size = (int *)(local_54._unk + 0x24); if ((byte *)0x1f < (byte *)((int)local_58 + (-4 - (int)pppppppbVar4))) goto LAB_008ec408; } operator_delete(pppppppbVar4,(uint)size); } local_14._0_1_ = 10; if (0xf < local_5c) { uVar8 = local_5c + 1; pvVar7 = (void *)local_70._0_4_; if (0xfff < uVar8) { pvVar7 = *(void **)(local_70._0_4_ + -4); uVar8 = local_5c + 0x24; if (0x1f < (uint)(local_70._0_4_ + (-4 - (int)pvVar7))) goto LAB_008ec408; } operator_delete(pvVar7,uVar8); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < (uint)local_30._green) { uVar8 = (int)local_30._green + 1; pvVar7 = numberText[0]; if (0xfff < uVar8) { pvVar7 = *(void **)((int)numberText[0] + -4); uVar8 = (int)local_30._green + 0x24; if (0x1f < (uint)((int)numberText[0] + (-4 - (int)pvVar7))) { LAB_008ec408: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar8); } local_30._green = slotY + (float)local_a4._unk; local_30._red = slotX + local_8c; in_stack_ffffff14 = (KColor *)0x8ec44e; ANM2::Render(memberSprite,(Vector *)&local_30,&g_vectorZero,&g_vectorZero); } if ((memberSprite->_animState)._animData == (void *)0x0) { slotX = slotX + local_8c; slotY = slotY + (float)local_a4._unk; local_a4._alpha = slotX; local_8c = slotY; } else { nullFrame = AnimationState::GetNullFrame(&memberSprite->_animState,(byte *)"Player_Info"); slotX = slotX + local_8c; slotY = slotY + (float)local_a4._unk; local_a4._alpha = slotX; local_8c = slotY; if (nullFrame != (float *)0x0) { local_a4._alpha = slotX + *nullFrame; local_8c = slotY + nullFrame[1]; } } local_a4._unk = (int)slotX; local_30._green = slotY; if ((uint)local_a4._green < local_ac) { FUN_0040a860(); if (((user == (int *)0x0) || (local_72 == '\0')) || ((*(char *)((int)user + 10) != '\0' || (isKeyboard == '\0')))) { pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Ready_Button"); pLVar5->_visible = 0; if ((user != (int *)0x0) && (local_72 != '\0')) goto LAB_008ec54e; LAB_008ec56c: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Unready_Button"); pLVar5->_visible = 0; if ((user != (int *)0x0) || (isVisible = 1, local_90[6].field_0x8 != '\0')) goto LAB_008ec590; } else { pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Ready_Button"); pLVar5->_visible = 1; LAB_008ec54e: if ((*(char *)((int)user + 10) != '\x01') || (isKeyboard == '\0')) goto LAB_008ec56c; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Unready_Button"); pLVar5->_visible = 1; LAB_008ec590: isVisible = 0; } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Invite_Player"); pLVar5->_visible = isVisible; FUN_0040a860(); if (((user == (int *)0x0) && (local_90[6].field_0x8 == '\0')) && (isKeyboard != '\0')) { pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Invite_Player_Button"); pLVar5->_visible = 1; LAB_008ec5da: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Swap_Button"); pLVar5->_visible = 0; if ((user != (int *)0x0) && (local_72 != '\0')) goto LAB_008ec5f4; LAB_008ec667: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_ArrowLeft"); pLVar5->_visible = 0; if ((user != (int *)0x0) && (local_72 != '\0')) goto LAB_008ec681; LAB_008ec69f: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_ArrowRight"); pLVar5->_visible = 0; if (user != (int *)0x0) goto LAB_008ec6b3; LAB_008ec6e0: isVisible = 0; } else { pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Invite_Player_Button"); pLVar5->_visible = 0; if (((((user == (int *)0x0) || (local_7c != local_88)) || ((local_72 == '\0' || ((*(char *)((int)user + 10) != '\0' || ((char)user[3] != '\0')))))) || (cVar2 = FUN_008ed2e0(), cVar2 == '\0')) || ((isKeyboard == '\0' || (isSwapAllowed == '\0')))) goto LAB_008ec5da; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Swap_Button"); pLVar5->_visible = 1; LAB_008ec5f4: if ((*(char *)((int)user + 10) != '\0') || (isSwapAllowed == '\0')) goto LAB_008ec667; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_ArrowLeft"); pLVar5->_visible = 1; LAB_008ec681: if ((*(char *)((int)user + 10) != '\0') || (isSwapAllowed == '\0')) goto LAB_008ec69f; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_ArrowRight"); pLVar5->_visible = 1; LAB_008ec6b3: if ((((local_7c != local_88) || (local_72 == '\0')) || (*(char *)((int)user + 10) != '\0')) || ((((char)user[3] != '\0' || (cVar2 = FUN_008ed2e0(), cVar2 == '\0')) || (isVisible = 1, isSwapAllowed == '\0')))) goto LAB_008ec6e0; } pLVar5 = ANM2::GetLayer(memberSprite,&DAT_00b6d168); pLVar5->_visible = isVisible; isVisible = user != (int *)0x0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Number"); pLVar5->_visible = isVisible; if (user == (int *)0x0) { FUN_0040a860(); LAB_008ec78b: fVar10 = slotY; fVar11 = slotX; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Character"); pLVar5->_visible = 0; if (user != (int *)0x0) goto LAB_008ec79f; LAB_008ec7cb: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Ready"); pLVar5->_visible = 0; if (user != (int *)0x0) goto LAB_008ec7df; LAB_008ec803: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Unready"); pLVar5->_visible = 0; if ((user != (int *)0x0) && ((slotY = fVar10, slotX = fVar11, local_72 != '\0' || (local_7c != local_88)))) goto LAB_008ec839; LAB_008ec851: pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_InProgress"); pLVar5->_visible = 0; if (user != (int *)0x0) goto LAB_008ec865; LAB_008ec879: isVisible = 0; } else { online_lobby_find_member_index(user); FUN_0040a860(); if (local_72 == '\0') { slotX = (float)local_a4._unk; slotY = local_30._green; if (local_7c == local_88) goto LAB_008ec78b; } fVar11 = (float)local_a4._unk; fVar10 = local_30._green; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Character"); pLVar5->_visible = 1; slotY = fVar10; slotX = fVar11; LAB_008ec79f: if (((local_72 == '\0') && ((local_7c == local_88 || (*(char *)((int)user + 10) != '\x01')))) || ((char)user[3] != '\0')) goto LAB_008ec7cb; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Ready"); pLVar5->_visible = 1; LAB_008ec7df: if (((local_72 == '\0') || (*(char *)((int)user + 10) != '\x01')) || ((char)user[3] != '\0')) goto LAB_008ec803; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Unready"); pLVar5->_visible = 1; LAB_008ec839: if ((char)user[3] == '\0') goto LAB_008ec851; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_InProgress"); pLVar5->_visible = 1; LAB_008ec865: if ((local_72 == '\0') && (local_7c == local_88)) goto LAB_008ec879; isVisible = 1; } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Completion"); pLVar5->_visible = isVisible; FUN_0040a860(); } else { pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Ready_Button"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Unready_Button"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Invite_Player"); pLVar5->_visible = 1; FUN_0040a860(); pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Invite_Player_Button"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Swap_Button"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Number"); pLVar5->_visible = 0; FUN_0040a860(); pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Character"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Ready"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Unready"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_InProgress"); pLVar5->_visible = 0; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Completion"); pLVar5->_visible = 0; } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Next_Right"); pLVar5->_visible = local_74; if ((local_7c != local_88) || (isVisible = 1, isKeyboard == '\0')) { isVisible = 0; } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Right_Next_Button"); pLVar5->_visible = isVisible; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Next_Left"); pLVar5->_visible = local_74; if ((local_7c != local_88) || (isVisible = 1, isKeyboard == '\0')) { isVisible = 0; } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Left_Next_Button"); pLVar5->_visible = isVisible; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Options"); pLVar5->_visible = local_74; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Options_Cursor"); pLVar5->_visible = local_74; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Options"); if (pLVar5 == (LayerState *)0x0) { in_stack_ffffff14 = (KColor *)0x8eca3e; KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(memberSprite,*(int *)pLVar5->_layerData,(uint)(local_76 == 0)); } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Player_Options_Cursor"); if (pLVar5 == (LayerState *)0x0) { pos_01 = (KColor *)&DAT_00000004; in_stack_ffffff14 = (KColor *)0x8eca78; KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { pos_01 = (KColor *)0x8eca91; ANM2::SetLayerFrame(memberSprite,*(int *)pLVar5->_layerData,*(int *)&local_90[8].field_0x50); } if ((isKeyboard == '\0') && (local_7c == local_88)) { if ((memberSprite->_animState)._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame (&memberSprite->_animState,(byte *)"PlayerNextRightButton"); } local_30._green = slotY + nullFrame[1]; local_30._red = slotX + *nullFrame; Manager::render_button_sprite(); if ((memberSprite->_animState)._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame (&memberSprite->_animState,(byte *)"PlayerNextLeftButton"); } local_30._green = slotY + nullFrame[1]; local_30._red = slotX + *nullFrame; pos_01 = (KColor *)0xc; in_stack_ffffff14 = (KColor *)0x8ecb29; Manager::render_button_sprite(); } if (user == (int *)0x0) { pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Connection_Bar"); bVar9 = g_menuControllerIndex == 0; pLVar5->_visible = 0; if (bVar9) { ExceptionList = local_1c; return; } if (local_90[6].field_0x8 != '\0') { ExceptionList = local_1c; return; } if (local_ac <= (uint)local_a4._green) { ExceptionList = local_1c; return; } nullFrame = Sprite::GetNullFrame((Sprite *)memberSprite,(byte *)"InviteButton"); fVar11 = local_8c + nullFrame[1]; fVar10 = local_a4._alpha + *nullFrame; local_30._green = fVar11; local_30._red = fVar10; Color::Color(0x3f800000); iVar3 = 0x18; goto LAB_008ed064; } cVar2 = (**(code **)(*user + 0x14))(); pGVar1 = local_90; if (cVar2 != '\0') { if ((char)user[2] == '\0') { pLVar5 = ANM2::GetLayer((ANM2 *)&local_90->field_0x10,(byte *)"Player_Portrait_Random"); pLVar5->_visible = 1; pLVar5 = ANM2::GetLayer((ANM2 *)&pGVar1->field_0x10,(byte *)"Player_Portrait"); pLVar5->_visible = 0; } else { FUN_00949b90(); local_30._green = (float)FUN_0069bd10(); if (local_30._green == 0.0) goto LAB_008ecbd8; portraitSprite = &local_90->field_0x10; pLVar5 = ANM2::GetLayer((ANM2 *)portraitSprite,(byte *)"Player_Portrait"); pLVar5->_visible = 1; pLVar5 = ANM2::GetLayer((ANM2 *)portraitSprite,(byte *)"Player_Portrait_Random"); pLVar5->_visible = 0; Sprite::ReplaceSpritesheet ((Sprite *)portraitSprite,0x2a,(std_string *)((int)local_30._green + 0x4c)); ANM2::LoadGraphics((ANM2 *)portraitSprite,unk); } memberSprite = (ANM2 *)local_a4._blue; } LAB_008ecbd8: iVar3 = user[1]; local_ac = &g_manager->_font1_TeamMeatEx10; if (iVar3 == 0) { local_30._red = 0.0; fVar10 = local_30._red; local_30._green = 0.0; fVar11 = local_30._green; local_30._green = 0.0; local_30._red = 0.0; fVar6 = local_30._green; fVar12 = local_30._red; local_30._red = fVar10; local_30._green = fVar11; } else { fVar6 = *(float *)(iVar3 + 0xc); fVar12 = *(float *)(iVar3 + 8); } local_30._green = (float)user_profile_format_display_name(CONCAT44(fVar6,fVar12),local_ac,0x46); if ((memberSprite->_animState)._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame(&memberSprite->_animState,(byte *)"PlayerName"); } local_a4._red = slotX + *nullFrame; local_a4._green = slotY + nullFrame[1]; if ((local_7c == local_88) && (local_72 == '\0')) { local_a4._green = local_a4._green + 10.0; } FUN_00a1a580(); local_14 = (void *)0xd; KColor::SetFromARGB(&local_54,0xff362f2d); pos_01 = &local_a4; in_stack_ffffff10 = 0x8eccac; in_stack_ffffff14 = (KColor *)local_30._green; Font::DrawStringScaled(local_ac,(byte *)local_30._green,(Vector *)pos_01,color_02,fontSettings); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; iVar3 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar3 == 2) || (iVar3 == 3)) { cVar2 = (**(code **)(*user + 0x14))(); fVar11 = g_vectorOne.y; fVar10 = g_vectorOne.x; if (cVar2 == '\0') { fVar6 = 8.0; fVar12 = 18.0; } else { fVar6 = 58.0; fVar12 = 30.0; } local_30._red = local_a4._alpha + fVar6; local_30._green = local_8c + fVar12; in_stack_ffffff10 = (**(code **)(*local_a8 + 0xc))(); in_stack_ffffff0c = 0x8ecd41; position.y = local_30._green; position.x = local_30._red; in_stack_ffffff14 = (KColor *)local_30._red; pos_01 = (KColor *)local_30._green; render_online_icon(in_stack_ffffff10,position,fVar10,fVar11); memberSprite = (ANM2 *)local_a4._blue; user = local_a8; } cVar2 = (**(code **)(*user + 0x14))(); if (cVar2 == '\0') { FUN_00a29fd0(); local_14 = (void *)0xe; if (((KColor *)local_30._red == (KColor *)0x0) || (0x77 < *(ushort *)&((KColor *)((int)local_30._red + 0x14))->_red)) { iVar3 = 0; } else { iVar3 = 2; if (0x3c < *(ushort *)&((KColor *)((int)local_30._red + 0x14))->_red) { iVar3 = 1; } } local_76 = local_7c != local_88; pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Connection_Bar"); pLVar5->_visible = local_76; ANM2::SetLayerFrame(memberSprite,0x21,iVar3); FUN_008eee70(); ExceptionList = local_1c; return; } pLVar5 = ANM2::GetLayer(memberSprite,(byte *)"Connection_Bar"); pLVar5->_visible = 0; if (((char)user[2] == '\n') && (*(char *)((int)user + 10) == '\0')) { sprintf_s((byte *)&local_54,0x14,(byte *)"Tokens: %d"); nullFrame = Sprite::GetNullFrame((Sprite *)memberSprite,(byte *)"EdenTokenCounter"); manager = g_manager; local_30._green = slotY + nullFrame[1]; fVar10 = slotX + *nullFrame; iVar3 = Font::get_string_width_n(&g_manager->_font1_TeamMeatEx10,(byte *)&local_54,-1); local_30._red = fVar10 - (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * 0.5 ; FontSettings::constructor(fontSettings); local_14 = (void *)0xf; KColor::SetFromARGB((KColor *)(local_70 + 4),0xff362f2d); pos_01 = &local_30; in_stack_ffffff14 = &local_54; in_stack_ffffff10 = 0x8ece9e; Font::DrawStringScaled (&manager->_font1_TeamMeatEx10,(byte *)in_stack_ffffff14,(Vector *)pos_01,color_01, settings); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_b8 = 0; local_b4 = 0; memberSprite = (ANM2 *)local_a4._blue; user = local_a8; } if (g_menuControllerIndex == 0) { ExceptionList = local_1c; return; } if (*(char *)((int)user + 10) == '\0') { nullLayerName = "ReadyButton"; } else { nullLayerName = "UnreadyButton"; } nullFrame = Sprite::GetNullFrame((Sprite *)memberSprite,(byte *)nullLayerName); fVar11 = local_a4._alpha + *nullFrame; fVar10 = local_8c + nullFrame[1]; local_30._green = fVar10; local_30._red = fVar11; Color::Color(0x3f800000); color._colorize[3] = (float)in_stack_ffffff0c; color._tint[0] = (float)in_stack_fffffef0._0_4_; color._tint[1] = (float)in_stack_fffffef0._4_4_; color._tint[2] = (float)in_stack_fffffef0._8_4_; color._tint[3] = (float)in_stack_fffffef0._12_4_; color._colorize[0] = (float)in_stack_fffffef0._16_4_; color._colorize[1] = (float)in_stack_fffffef0._20_4_; color._colorize[2] = (float)in_stack_fffffef0._24_4_; color._offset[0] = (float)in_stack_ffffff10; color._offset[1] = (float)in_stack_ffffff14; color._offset[2] = (float)pos_01; pos.y = fVar10; pos.x = fVar11; render_input_button_icon(g_menuControllerIndex,0x1c,0,1,color,pos); if (isSwapAllowed == '\0') { ExceptionList = local_1c; return; } if (*(char *)((int)user + 10) != '\0') { ExceptionList = local_1c; return; } if (local_7c != local_88) { ExceptionList = local_1c; return; } if ((*(char *)((int)user + 9) == '\0') && (cVar2 = FUN_008ed2e0(), cVar2 == '\0')) { ExceptionList = local_1c; return; } nullFrame = Sprite::GetNullFrame((Sprite *)memberSprite,(byte *)"SwapButton"); fVar11 = local_8c + nullFrame[1]; fVar10 = local_a4._alpha + *nullFrame; local_30._green = fVar11; local_30._red = fVar10; Color::Color(0x3f800000); iVar3 = 0x19; LAB_008ed064: color_00._colorize[3] = (float)in_stack_ffffff0c; color_00._tint[0] = (float)in_stack_fffffef0._0_4_; color_00._tint[1] = (float)in_stack_fffffef0._4_4_; color_00._tint[2] = (float)in_stack_fffffef0._8_4_; color_00._tint[3] = (float)in_stack_fffffef0._12_4_; color_00._colorize[0] = (float)in_stack_fffffef0._16_4_; color_00._colorize[1] = (float)in_stack_fffffef0._20_4_; color_00._colorize[2] = (float)in_stack_fffffef0._24_4_; color_00._offset[0] = (float)in_stack_ffffff10; color_00._offset[1] = (float)in_stack_ffffff14; color_00._offset[2] = (float)pos_01; pos_00.y = fVar11; pos_00.x = fVar10; render_input_button_icon(g_menuControllerIndex,iVar3,0,1,color_00,pos_00); ExceptionList = local_1c; return; } //@@ 008ed090 FUN_008ed090 void FUN_008ed090(void) { int iVar1; byte *pbVar2; byte bVar3; byte *pbVar4; uint uVar5; int in_ECX; byte *pbVar6; char *name; bool bVar7; iVar1 = (g_manager->_lobbySettings)._gameMode; if ((iVar1 == 5) || (iVar1 != 4)) { bVar7 = false; } else { bVar7 = true; } name = "Background"; if (bVar7) { name = "Background_Challenge"; } bVar3 = ANM2::IsPlaying((ANM2 *)(in_ECX + 0x10),(byte *)name); if (bVar3 != 0) { return; } pbVar2 = *(byte **)(in_ECX + 0x44); if (pbVar2 != (byte *)0x0) { pbVar4 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar4 = *(byte **)pbVar2; } pbVar6 = (byte *)name; do { bVar3 = *pbVar4; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_008ed106: uVar5 = -(uint)bVar7 | 1; goto LAB_008ed10b; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_008ed106; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_008ed10b: if ((uVar5 == 0) && ((pbVar2[0x34] == 0 || (*(char *)(in_ECX + 0x54) != '\0')))) goto LAB_008ed133; } bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x10),(byte *)name,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x40)); *(undefined1 *)(in_ECX + 0x54) = 1; } LAB_008ed133: FUN_008ed320(); return; } //@@ 008ed150 Menu_OnlineLobby::change_character /* DB: ? thiscall (ECX mistyped HUD): finds this lobby member's entry (lobby_member_map_get_or_add at +0x6a0); param 0x3e9 toggles tainted (+9) else steps the character byte (+8) by param through 18 characters, wrapping and skipping ones Menu_Character_Entry::IsCharacterAvailable rejects; plays menu sounds 0xc2/0xc3/0x23b; Menu_OnlineLobby::Update/update_controls */ void Menu_OnlineLobby::change_character(int param_1,char param_2) { Manager *pMVar1; byte bVar2; void *user; int iVar3; void *in_ECX; undefined4 extraout_ECX; int extraout_ECX_00; int iVar4; char cVar6; uint uVar5; uint3 uVar7; int iVar8; bool bVar9; int local_8; iVar3 = param_1; user = lobby_member_map_get_or_add ((void *)((int)in_ECX + 0x694),(ulonglong *)((int)in_ECX + 0x6a0)); if (param_1 == 0x3e9) { cVar6 = *(char *)((int)user + 9); iVar4 = 0; *(bool *)((int)user + 9) = cVar6 == '\0'; if (cVar6 == '\0') { iVar4 = 0x12; } bVar2 = Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *) (&PTR_s_00_Random_00b24140 + (iVar4 + (uint)*(byte *)((int)user + 8)) * 6), CONCAT31((int3)((uint)extraout_ECX >> 8),cVar6)); pMVar1 = g_manager; local_8 = 0x23b; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar1->_sfxManager,local_8,1.0,2,0,1.0,0.0); if (bVar2 != 0) goto LAB_008ed2b8; param_1 = 1; } iVar8 = 0; iVar4 = 0x12; uVar5 = (uint)CONCAT11(*(undefined1 *)((int)user + 8),*(undefined1 *)((int)user + 8)); if (*(char *)((int)user + 9) != '\0') { iVar8 = 0x12; } do { uVar7 = (uint3)(uVar5 >> 8); bVar2 = (char)uVar5 + (char)param_1; uVar5 = CONCAT31(uVar7,bVar2); *(byte *)((int)user + 8) = bVar2; if (bVar2 == 0xff) { *(undefined1 *)((int)user + 8) = 0x11; uVar5 = CONCAT31(uVar7,0x11); } else if (0x11 < bVar2) { *(undefined1 *)((int)user + 8) = 0; uVar5 = (uint)uVar7 << 8; } bVar2 = Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *) (&PTR_s_00_Random_00b24140 + ((uVar5 & 0xff) + iVar8) * 6),iVar4); pMVar1 = g_manager; cVar6 = (char)(uVar5 >> 8); } while ((bVar2 == 0) && (iVar4 = extraout_ECX_00, (char)uVar5 != cVar6)); if ((iVar3 != 0x3e9) && ((char)uVar5 != cVar6)) { bVar9 = -1 < param_1; param_1 = 0xc2; if (bVar9) { param_1 = 0xc3; } seed_fart_sound_override(¶m_1); SoundEffects::Play(&pMVar1->_sfxManager,param_1,1.0,0,0,1.0,0.0); } LAB_008ed2b8: if (param_2 != '\0') { iVar3 = online_lobby_find_member_index(user); load_member_sprite(in_ECX,iVar3); FUN_008ee3b0(user); } return; } //@@ 008ed2e0 FUN_008ed2e0 undefined1 FUN_008ed2e0(void) { byte bVar1; int in_ECX; int extraout_ECX; uint uVar2; undefined **this; this = &PTR_s_00_Random_00b242f0; uVar2 = 0; do { bVar1 = Menu_Character_Entry::IsCharacterAvailable((Menu_Character_Entry *)this,in_ECX); if (bVar1 != 0) { return 1; } uVar2 = uVar2 + 0x18; this = this + 6; in_ECX = extraout_ECX; } while (uVar2 < 0x1b0); return 0; } //@@ 008ed320 FUN_008ed320 void FUN_008ed320(void) { void *in_ECX; uint memberIndex; memberIndex = 0; do { Menu_OnlineLobby::load_member_sprite(in_ECX,memberIndex); memberIndex = memberIndex + 1; } while (memberIndex < 4); return; } //@@ 008ed350 Menu_OnlineLobby::load_member_sprite /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX is the Menu_OnlineLobby, arg a lobby member index; loads that member's sprite (was a wrong ZHL exact match HUD::LoadGraphics) prototype: db/protos.zhl, confirmed by RET 4 */ void Menu_OnlineLobby::load_member_sprite(void *lobby,int memberIndex) { char cVar1; ANM2 *memberSprite; LayerState *layer; int iVar2; byte *****pppppbVar3; void *pvVar4; uint uVar5; byte *pbVar6; int iVar7; int *piVar8; uint local_a8; int *piStack_a4; PersistentGameData *local_a0; undefined8 local_9c; char local_94 [4]; undefined2 local_90; undefined1 local_8e; undefined4 local_8c; undefined4 local_88; int markOrder [6]; byte *****pppppbStack_6c; undefined4 uStack_68; undefined4 local_64; undefined4 uStack_60; undefined4 uStack_5c; uint uStack_58; int markLayerIds [6]; void *memberNumberText [4]; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; uint completionFlags; int *memberInfo; byte playerType; puStack_20 = (undefined1 *)(memberNumberText + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b071c0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(memberNumberText + 0xb); ExceptionList = &local_1c; memberSprite = (ANM2 *)lobby_member_sprite_get(memberIndex); if (memberSprite == (ANM2 *)0x0) { ExceptionList = local_1c; return; } piStack_a4 = lobby_get_member_info(lobby,memberIndex); pbVar6 = (byte *)((int)&local_88 + 1); local_a0 = (PersistentGameData *)(memberIndex + 1); do { pbVar6 = pbVar6 + -1; uVar5 = (uint)local_a0 / 10; *pbVar6 = (char)local_a0 + (char)uVar5 * -10 + 0x30; local_a0 = (PersistentGameData *)uVar5; } while (uVar5 != 0); local_2c = 0; local_28 = 0xf; memberNumberText[0] = (void *)0x0; if (pbVar6 != (byte *)((int)&local_88 + 1)) { std::string::assign((char *)memberNumberText,pbVar6,((int)&local_88 + 1) - (int)pbVar6); } builtin_strncpy(local_94,"Play",4); local_88 = 0xf; local_8c = 0xe; local_9c = 0x6e6f697469736f50; local_90 = 0x7265; local_8e = 0; local_14 = (void *)0x1; std::string::concat_move((char *)&pppppbStack_6c,(int)piStack_a4,&local_9c,memberNumberText); local_14._0_1_ = 2; pppppbVar3 = (byte *****)&pppppbStack_6c; if (0xf < uStack_58) { pppppbVar3 = pppppbStack_6c; } if (*(int *)((int)lobby + 0x44) != 0) { AnimationState::GetNullFrame((AnimationState *)((int)lobby + 0x40),(byte *)pppppbVar3); } local_14._0_1_ = 1; if (0xf < uStack_58) { uVar5 = uStack_58 + 1; pppppbVar3 = pppppbStack_6c; if (0xfff < uVar5) { pppppbVar3 = (byte *****)pppppbStack_6c[-1]; uVar5 = uStack_58 + 0x24; if (0x1f < (uint)((int)pppppbStack_6c + (-4 - (int)pppppbVar3))) goto LAB_008ed547; } operator_delete(pppppbVar3,uVar5); } local_14._0_1_ = 0; if (0xf < local_88) { uVar5 = local_88 + 1; pvVar4 = (void *)local_9c; if (0xfff < uVar5) { pvVar4 = *(void **)((int)(void *)local_9c + -4); uVar5 = local_88 + 0x24; if (0x1f < (uint)((int)(void *)local_9c + (-4 - (int)pvVar4))) goto LAB_008ed547; } operator_delete(pvVar4,uVar5); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < local_28) { uVar5 = local_28 + 1; pvVar4 = memberNumberText[0]; if (0xfff < uVar5) { pvVar4 = *(void **)((int)memberNumberText[0] + -4); uVar5 = local_28 + 0x24; if (0x1f < (uint)((int)memberNumberText[0] + (-4 - (int)pvVar4))) { LAB_008ed547: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } iVar7 = 0; do { *(ulonglong *)(markLayerIds + iVar7) = CONCAT44(iVar7 + 0x11,iVar7 + 0x10); markLayerIds[iVar7 + 2] = iVar7 + 0x12; markLayerIds[iVar7 + 3] = iVar7 + 0x13; iVar7 = iVar7 + 4; } while (iVar7 < 0xc); uVar5 = 0; do { layer = ANM2::GetLayer(memberSprite,(byte *)markLayerIds[uVar5]); memberInfo = piStack_a4; uVar5 = uVar5 + 1; layer->_visible = 0; } while (uVar5 < 0xc); if (piStack_a4 == (int *)0x0) { ExceptionList = local_1c; return; } iVar7 = 0; if (*(char *)((int)piStack_a4 + 9) != '\0') { iVar7 = 0x12; } playerType = *(byte *)(piStack_a4 + 2); if (((memberSprite->_animState)._animData != (void *)0x0) && ((2 < *(int *)((int)(memberSprite->_animState)._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 2 < *(int *)((int)(memberSprite->_animState)._animation + 0x80))))) { pvVar4 = (memberSprite->_animState)._animData; piStack_a4 = *(int **)((int)pvVar4 + 0x40); if ((pvVar4 == (void *)0x0) || (((int)piStack_a4 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)piStack_a4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(memberSprite->_animState)._layerFrames + (int)piStack_a4 * 4) = 0; AnimationState::AdvanceLayerPosition (&memberSprite->_animState,(int)piStack_a4,(float)(iVar7 + (uint)playerType)); } cVar1 = *(char *)((int)memberInfo + 10); if (((memberSprite->_animState)._animData != (void *)0x0) && ((5 < *(int *)((int)(memberSprite->_animState)._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)((int)(memberSprite->_animState)._animation + 0x80))))) { pvVar4 = (memberSprite->_animState)._animData; piStack_a4 = *(int **)((int)pvVar4 + 0x4c); if ((pvVar4 == (void *)0x0) || (((int)piStack_a4 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)piStack_a4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(memberSprite->_animState)._layerFrames + (int)piStack_a4 * 4) = 0; AnimationState::AdvanceLayerPosition (&memberSprite->_animState,(int)piStack_a4,(float)(cVar1 != '\0')); } if ((char)memberInfo[2] != '\0') { iVar7 = memberInfo[1]; if (iVar7 == 0) { piStack_a4 = (int *)0x0; local_a8 = 0; piVar8 = piStack_a4; } else { local_a8 = *(uint *)(iVar7 + 8); piVar8 = (int *)*(uint *)(iVar7 + 0xc); } _local_a8 = CONCAT44(piVar8,local_a8); local_a0 = (PersistentGameData *)local_a8; FUN_00731ee0(&local_90,&local_a8); if ((((*(char *)(local_88 + 0xd) == '\0') && (*(uint *)(local_88 + 0x14) <= piVar8)) && ((*(uint *)(local_88 + 0x14) < piVar8 || (*(uint *)(local_88 + 0x10) <= local_a0)))) && (local_88 != *(uint *)&g_manager[1]._gamestate.field_0xc0)) { markOrder[0] = 0; markOrder[1] = 1; markOrder[2] = 2; markOrder[3] = 4; markOrder[4] = 5; markOrder[5] = 3; pppppbStack_6c = (byte *****)0x6; uStack_68 = 9; local_64 = 0xc; uStack_60 = 7; uStack_5c = 0xd; uStack_58 = 0xe; cVar1 = (**(code **)(*memberInfo + 0x14))(); if (cVar1 == '\0') { iVar7 = memberInfo[1]; if (iVar7 == 0) { piStack_a4 = (int *)0x0; local_a8 = 0; } else { local_a8 = *(uint *)(iVar7 + 8); piStack_a4 = *(int **)(iVar7 + 0xc); } local_a0 = (PersistentGameData *)FUN_0090c300(&local_a8); } else { local_a0 = &g_manager->_persistentGameData; } uVar5 = (uint)*(byte *)(memberInfo + 2); if (uVar5 < 0x12) { iVar7 = 0; if (*(char *)((int)memberInfo + 9) != '\0') { iVar7 = 0x12; } iVar7 = *(int *)(&DAT_00b24144 + (iVar7 + uVar5) * 0x18); } else { iVar7 = 0; if (*(char *)((int)memberInfo + 9) != '\0') { iVar7 = 4; } iVar7 = *(int *)((int)g_modCharacters + uVar5 * 8 + iVar7 + -0x90); } uVar5 = 0; do { if ((iVar7 < 0x29) && (&DAT_00c35ed0 + iVar7 * 0x90 != (undefined *)0x0)) { iVar2 = *(int *)(&DAT_00c35ed0 + iVar7 * 0x90 + *(int *)((int)markOrder + uVar5) * 8); } else { iVar2 = 0; } completionFlags = local_a0->_eventCounters[iVar2]; iVar2 = 0; if ((completionFlags & 8) == 0) { if ((completionFlags & 4) == 0) { if ((completionFlags & 2) == 0) { if ((completionFlags & 1) != 0) { iVar2 = 1; } } else { iVar2 = 2; } } else { iVar2 = 3; } } else { iVar2 = 4; } pbVar6 = *(byte **)((int)markLayerIds + uVar5); ANM2::SetLayerFrame(memberSprite,(int)pbVar6,iVar2); layer = ANM2::GetLayer(memberSprite,pbVar6); uVar5 = uVar5 + 4; layer->_visible = 1; } while (uVar5 < 0x30); } } ExceptionList = local_1c; return; } //@@ 008ed910 Menu_OnlineLobby::update_ready_state /* DB: ? counts lobby members with ready byte +0x22 (tree at +0x694), sets all-ready flag +0x6a8 / countdown +0x6ac (0xb4 frames), queries g_multiplayerLobbyPtr and NetworkManager::get_peer; Menu_OnlineLobby::init_lobby_view, toggle_ready prototype: db/protos.zhl */ void __thiscall Menu_OnlineLobby::update_ready_state(void *this) { undefined1 *puVar1; char isLastRef; uint uVar2; int ownerProfile; undefined4 uVar3; int ownerProfile; int *local_54; int *lobbyRefCount; undefined **constLobby; undefined **local_48; int *constLobbyRefCount; undefined4 peerId; undefined4 uStack_3c; int peer; int *peerRefCount; undefined **local_2c; int local_28; int local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b07245; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; *(undefined1 *)((int)this + 0x6a8) = 1; ownerProfile = 0; local_24 = **(int **)((int)this + 0x694); puVar1 = (undefined1 *)((int)register0x00000010 + -4); if ((int *)local_24 != *(int **)((int)this + 0x694)) { do { if (*(char *)(local_24 + 0x22) == '\0') { *(undefined1 *)((int)this + 0x6a8) = 0; *(undefined4 *)((int)this + 0x6ac) = 0; } else { ownerProfile = ownerProfile + 1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); puVar1 = puStack_20; } while (local_24 != *(int *)((int)this + 0x694)); } puStack_20 = puVar1; local_24 = *(int *)((int)this + 0x698); constLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_48 = (undefined **)0x0; constLobbyRefCount = (int *)0x0; local_14 = 0; std::shared_ptr::assign(&local_48,&g_multiplayerLobbyPtr); constLobby = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 1; if (local_48 == (undefined **)0x0) { local_28 = 0; } else { local_28 = (**(code **)(*local_48 + 0x3c))(uVar2); } constLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 2; if (constLobbyRefCount != (int *)0x0) { isLastRef = (**(code **)(*constLobbyRefCount + 0xc))(); if ((isLastRef != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_48); } } if (local_28 == 3) { local_24 = 2; } local_54 = (int *)0x0; lobbyRefCount = (int *)0x0; local_14 = 3; std::shared_ptr::assign(&local_54,&g_multiplayerLobbyPtr); local_14 = 4; if (local_54 == (int *)0x0) { local_28 = 0; } else { ownerProfile = (**(code **)(*local_54 + 0x20))(&local_48); local_28 = *(int *)(ownerProfile + 4); local_48 = KAGE::System::UserProfileBase::vftable; } local_2c = KAGE::System::UserProfile::vftable; local_14 = CONCAT31(local_14._1_3_,5); if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::SmartPointer(0); } else { if (local_28 == 0) { uStack_3c = 0; peerId = 0; } else { peerId = *(undefined4 *)(local_28 + 8); uStack_3c = *(undefined4 *)(local_28 + 0xc); } NetworkManager::get_peer(g_multiplayerService,&peer,(ulonglong *)&peerId); } local_14._0_1_ = 9; if (lobbyRefCount != (int *)0x0) { isLastRef = (**(code **)(*lobbyRefCount + 0xc))(); if ((isLastRef != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_54); } } if (((peer == 0) || (*(int *)(peer + 0x24) != 0)) || (*(int *)(peer + 0x20) != 0)) { if ((*(char *)((int)this + 0x6c1) == '\0') && (*(char *)((int)this + 0x6a8) == '\0')) { if (local_24 <= ownerProfile) { *(undefined1 *)((int)this + 0x6c1) = 1; if (*(int *)((int)this + 0x6b0) == 0) { *(undefined4 *)((int)this + 0x6b0) = 600; } local_54 = (int *)0x0; lobbyRefCount = (int *)0x0; local_14._0_1_ = 10; std::shared_ptr::assign(&local_54,&g_multiplayerLobbyPtr); local_14._0_1_ = 0xb; if (local_54 == (int *)0x0) { uVar3 = 0; } else { uVar3 = (**(code **)(*local_54 + 0x3c))(); } *(undefined4 *)((int)this + 0x6c4) = uVar3; local_14 = CONCAT31(local_14._1_3_,0xc); if (lobbyRefCount != (int *)0x0) { isLastRef = (**(code **)(*lobbyRefCount + 0xc))(); if ((isLastRef != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_54); } } } } else { if ((ownerProfile < local_24) && (*(char *)((int)this + 0x6c1) != '\0')) { local_54 = (int *)0x0; lobbyRefCount = (int *)0x0; local_14._0_1_ = 0xd; std::shared_ptr::assign(&local_54,&g_multiplayerLobbyPtr); local_14._0_1_ = 0xe; if (local_54 != (int *)0x0) { (**(code **)(*local_54 + 0x38))(*(undefined4 *)((int)this + 0x6c4)); } local_14 = CONCAT31(local_14._1_3_,0xf); if (lobbyRefCount != (int *)0x0) { isLastRef = (**(code **)(*lobbyRefCount + 0xc))(); if ((isLastRef != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_54); } } *(undefined1 *)((int)this + 0x6c1) = 0; *(undefined4 *)((int)this + 0x6b0) = 0; *(undefined4 *)((int)this + 0x6ac) = 0; } if ((*(char *)((int)this + 0x6a8) != '\0') && ((0xb4 < *(int *)((int)this + 0x6ac) || (*(int *)((int)this + 0x6ac) == 0)))) { ownerProfile = *(int *)((int)this + 0x6b0); *(undefined1 *)((int)this + 0x6c1) = 0; if ((ownerProfile == 0) || (0xb3 < ownerProfile)) { ownerProfile = 0xb4; } *(int *)((int)this + 0x6ac) = ownerProfile; } } } local_14 = 0x10; if (peerRefCount != (int *)0x0) { isLastRef = (**(code **)(*peerRefCount + 0xc))(); if ((isLastRef != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(&peer); } } ExceptionList = local_1c; return; } //@@ 008edd00 Menu_OnlineLobby::toggle_ready /* DB: ? ECX=Menu_OnlineLobby: flips the ready byte (+10) of the local entry in the member map at +0x6a0, refreshes (online_lobby_find_member_index, HUD::LoadGraphics, 008ed910, 008ee3b0), plays sound 1 and notifies the listener at +0x95c (vtable +0x18) with the new state; callers Menu_OnlineLobby::Update / update_controls */ void Menu_OnlineLobby::toggle_ready(void) { ulonglong *userId; char cVar1; code *pcVar2; Manager *pMVar3; void *pvVar4; void *pvVar5; int memberIndex; void *in_ECX; int local_8; userId = (ulonglong *)((int)in_ECX + 0x6a0); pvVar4 = lobby_member_map_get_or_add((void *)((int)in_ECX + 0x694),userId); cVar1 = *(char *)((int)pvVar4 + 10); pvVar4 = lobby_member_map_get_or_add((void *)((int)in_ECX + 0x694),userId); *(bool *)((int)pvVar4 + 10) = cVar1 == '\0'; pvVar4 = (void *)((int)in_ECX + 0x694); pvVar5 = lobby_member_map_get_or_add(pvVar4,userId); memberIndex = online_lobby_find_member_index(pvVar5); load_member_sprite(in_ECX,memberIndex); update_ready_state(in_ECX); pvVar5 = lobby_member_map_get_or_add(pvVar4,userId); FUN_008ee3b0(pvVar5); pMVar3 = g_manager; local_8 = 1; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar3->_sfxManager,local_8,1.0,0,0,1.0,0.0); if (*(int **)((int)in_ECX + 0x95c) != (int *)0x0) { pcVar2 = *(code **)(**(int **)((int)in_ECX + 0x95c) + 0x18); pvVar4 = lobby_member_map_get_or_add(pvVar4,userId); (*pcVar2)(*(undefined1 *)((int)pvVar4 + 10)); } return; } //@@ 008edde0 FUN_008edde0 int FUN_008edde0(int param_1) { bool bVar1; char cVar2; int *piVar3; int iVar4; void *in_ECX; int memberIndex; int iVar5; memberIndex = 0; iVar5 = 0; do { piVar3 = lobby_get_member_info(in_ECX,memberIndex); if (piVar3 == (int *)0x0) { LAB_008ede0d: bVar1 = false; } else { cVar2 = (**(code **)(*piVar3 + 0x14))(); if (cVar2 == '\0') goto LAB_008ede0d; bVar1 = true; } iVar4 = memberIndex + 1; if (!bVar1) { iVar4 = memberIndex; } if (iVar4 == param_1) { return iVar5; } iVar5 = iVar5 + 1; memberIndex = iVar4 + 1; if (2 < iVar5) { return -1; } } while( true ); } //@@ 008ede40 lobby_member_sprite_get /* DB: ? (memberIdx): returns ECX+0x10 (first sprite) when lobby_get_member_info(idx) says local (vtable +0x14), otherwise the idx-th remote member's sprite at ECX+0x124+n*0x114 (max 3), 0 if none; callers GameOver::RenderItemSprite and HUD::LoadGraphics */ int lobby_member_sprite_get(int param_1) { bool bVar1; char cVar2; int *piVar3; int iVar4; void *in_ECX; int memberIndex; uint uVar5; piVar3 = lobby_get_member_info(in_ECX,param_1); if (piVar3 != (int *)0x0) { cVar2 = (**(code **)(*piVar3 + 0x14))(); if (cVar2 != '\0') { return (int)in_ECX + 0x10; } } memberIndex = 0; uVar5 = 0; do { piVar3 = lobby_get_member_info(in_ECX,memberIndex); if (piVar3 == (int *)0x0) { LAB_008ede8d: bVar1 = false; } else { cVar2 = (**(code **)(*piVar3 + 0x14))(); if (cVar2 == '\0') goto LAB_008ede8d; bVar1 = true; } iVar4 = memberIndex + 1; if (!bVar1) { iVar4 = memberIndex; } if (iVar4 == param_1) { return uVar5 * 0x114 + 0x124 + (int)in_ECX; } uVar5 = uVar5 + 1; memberIndex = iVar4 + 1; if (2 < uVar5) { return 0; } } while( true ); } //@@ 008eded0 lobby_get_member_info /* DB: ? takes member index; reads global lobby (shared_ptr g_multiplayerLobbyPtr) member count (8-byte entries), Lobby member user id via FUN_00a284d0 ("Invalid lobby user index"), then searches map at +0x694 for that 64-bit id and returns &entry+0x18 or 0; GameOver::RenderItemSprite, Menu_OnlineLobby::Render prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall lobby_get_member_info(void *this,int memberIndex) { undefined4 *puVar1; char cVar2; uint uVar3; int iVar4; int iVar5; uint uVar6; undefined4 local_34; int *local_30; undefined **local_2c; undefined **local_28; int *local_24; undefined8 local_20; void *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0728d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_28 = (undefined **)0x0; local_24 = (int *)0x0; local_8 = 0; local_18 = this; std::shared_ptr::assign(&local_28,&g_multiplayerLobbyPtr); if (local_28 == (undefined **)0x0) { uVar6 = 0; } else { uVar6 = (int)local_28[5] - (int)local_28[4] >> 3; } local_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(uVar3), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_28); } iVar4 = memberIndex; if ((uint)memberIndex < uVar6) { local_34 = 0; local_30 = (int *)0x0; local_8 = 2; std::shared_ptr::assign(&local_34,&g_multiplayerLobbyPtr); local_8 = 3; iVar4 = KAGE::Network::Multiplayer::Lobby::get_member(&local_28,iVar4); iVar4 = *(int *)(iVar4 + 4); if (iVar4 == 0) { local_20 = 0; local_20._4_4_ = 0; local_20._0_4_ = 0; iVar5 = local_20._4_4_; iVar4 = (int)local_20; } else { iVar5 = *(int *)(iVar4 + 0xc); iVar4 = *(int *)(iVar4 + 8); } local_28 = KAGE::System::UserProfileBase::vftable; local_8 = 4; if (((local_30 != (int *)0x0) && (cVar2 = (**(code **)(*local_30 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_34); } puVar1 = *(undefined4 **)((int)local_18 + 0x694); memberIndex = *puVar1; while ((undefined4 *)memberIndex != puVar1) { if ((*(int *)(memberIndex + 0x10) == iVar4) && (*(int *)(memberIndex + 0x14) == iVar5)) { ExceptionList = local_10; return (undefined4 *)(memberIndex + 0x18); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&memberIndex); } } ExceptionList = local_10; return (void *)0x0; } //@@ 008ee080 FUN_008ee080 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008ee080(void) { void **ppvVar1; undefined4 *puVar2; Manager *pMVar3; char cVar4; uint uVar5; undefined4 *puVar6; void *pvVar7; uint uVar8; int iVar9; std_vector *psVar10; uint memberIndex; void *messageRefCount; undefined **ppuStack_98; void *pvStack_94; undefined4 uStack_90; void *pvStack_8c; void *pvStack_88; void *pvStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined **ppuStack_70; undefined1 auStack_6c [4]; int *piStack_68; int iStack_64; int iStack_60; void *local_5c; char cStack_55; void *pvStack_54; undefined **ppuStack_50; char acStack_4c [4]; char acStack_48 [4]; undefined8 uStack_44; void *pvStack_3c; undefined **ppuStack_38; char acStack_34 [4]; char acStack_30 [4]; uint uStack_2c; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = acStack_30 + 0x2c; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b072d8; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(acStack_30 + 0x20); ExceptionList = &local_1c; local_24 = uVar5; KAGE_LogMessage(1,(byte *)"Menu_OnlineLobby::send_game_start() \n"); pMVar3 = g_manager; psVar10 = &g_manager->_lobbyMembers; *(undefined1 *)((int)local_5c + 0x6c8) = 1; puVar2 = (pMVar3->_lobbyMembers)._end; puVar6 = psVar10->_begin; if (puVar6 != puVar2) { do { *puVar6 = KAGE::System::UserProfileBase::vftable; puVar6 = puVar6 + 5; } while (puVar6 != puVar2); puVar6 = psVar10->_begin; } memberIndex = 0; (pMVar3->_lobbyMembers)._end = puVar6; if (*(int *)((int)local_5c + 0x698) != 0) { iStack_64 = 4; iStack_60 = 0x12; do { pvVar7 = lobby_get_member_info(local_5c,memberIndex); ppuStack_38 = KAGE::System::UserProfile::vftable; uStack_28 = 5; uStack_14 = 0; acStack_34 = *(char (*) [4])((int)pvVar7 + 4); uVar8 = (uint)*(byte *)((int)pvVar7 + 8); cStack_55 = *(char *)((int)pvVar7 + 9); acStack_30[0] = '\x01'; if (uVar8 < 0x12) { iVar9 = 0; if (cStack_55 != '\0') { iVar9 = iStack_60; } uStack_2c = *(uint *)(&DAT_00b24144 + (iVar9 + uVar8) * 0x18); } else { iVar9 = 0; if (cStack_55 != '\0') { iVar9 = iStack_64; } uStack_2c = *(uint *)((int)g_modCharacters + iVar9 + -0x90 + uVar8 * 8); } puVar2 = (pMVar3->_lobbyMembers)._end; if (puVar2 == (pMVar3->_lobbyMembers)._capacity) { FUN_008ef230(puVar2,&ppuStack_38); } else { puVar2[1] = acStack_34; *puVar2 = KAGE::System::UserProfile::vftable; *(undefined1 *)(puVar2 + 2) = 1; puVar2[3] = uStack_2c; puVar2[4] = 5; ppvVar1 = &(pMVar3->_lobbyMembers)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x14); } memberIndex = memberIndex + 1; uStack_14 = 0xffffffff; } while (memberIndex < *(uint *)((int)local_5c + 0x698)); } KAGE::Filesys::BufferedStream::BufferedStream(&ppuStack_98,0); uStack_14 = 1; FUN_0090c560(uVar5); std::string::string((char *)&pvStack_54,&(g_manager->_lobbySettings)._seed); uStack_14 = CONCAT31(uStack_14._1_3_,2); iVar9 = (g_manager->_lobbySettings)._challenge; if ((g_manager->_lobbySettings)._gameMode == 5) { Seeds::Seed2String((std_string *)&pvStack_3c,(g_manager->_dailyChallenge)._seed); std::string::_Tidy_deallocate((char *)&pvStack_54); iVar9 = 0; pvStack_54 = pvStack_3c; ppuStack_50 = ppuStack_38; acStack_4c[0] = acStack_34[0]; acStack_4c[1] = acStack_34[1]; acStack_4c[2] = acStack_34[2]; acStack_4c[3] = acStack_34[3]; acStack_48[0] = acStack_30[0]; acStack_48[1] = acStack_30[1]; acStack_48[2] = acStack_30[2]; acStack_48[3] = acStack_30[3]; uStack_44 = CONCAT44(uStack_28,uStack_2c); } FUN_00916f70(iVar9,&pvStack_54,&g_manager[1]._gamestate.field_0x70,0); pvVar7 = pvStack_8c; if (pvStack_80 != (void *)0x0) { pvVar7 = pvStack_80; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = (void *)0x0; NetConnection::send_message(g_multiplayerService,auStack_6c,1,pvVar7,(uint)pvStack_94,0); pMVar3 = g_manager; uStack_14._0_1_ = 3; FUN_008ef1d0(auStack_6c); NetplayManager::send_message(&pMVar3->_netplayManager,0x11,pvStack_94,messageRefCount); uStack_14 = CONCAT31(uStack_14._1_3_,4); if (piStack_68 != (int *)0x0) { cVar4 = (**(code **)(*piStack_68 + 0xc))(); if ((cVar4 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(auStack_6c); } } if (0xf < uStack_44._4_4_) { uVar5 = uStack_44._4_4_ + 1; pvVar7 = pvStack_54; if (0xfff < uVar5) { pvVar7 = *(void **)((int)pvStack_54 + -4); uVar5 = uStack_44._4_4_ + 0x24; if (0x1f < (uint)((int)pvStack_54 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } ppuStack_70 = KAGE::Filesys::StreamBase::vftable; ppuStack_98 = KAGE::Filesys::BufferedStreamBase::vftable; pvStack_94 = (void *)0x0; uStack_90 = 0; pvStack_88 = pvStack_8c; pvStack_80 = (void *)0x0; uStack_7c = 0; uStack_78 = 0; uStack_74 = 0; FUN_007dcd30(); ExceptionList = local_1c; return; } //@@ 008ee3b0 FUN_008ee3b0 void FUN_008ee3b0(int param_1) { Manager *pMVar1; char cVar2; void *message; void *messageRefCount; undefined1 auStack_30 [4]; int *piStack_2c; undefined1 uStack_28; byte bStack_27; undefined1 uStack_26; char local_22; byte local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = auStack_30 + 0x2c; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b0731d; local_1c = ExceptionList; ExceptionList = &local_1c; local_21 = *(char *)(param_1 + 9) != '\0'; local_22 = *(char *)(param_1 + 10); KAGE_LogMessage(1,(byte *) "Menu_OnlineLobby::broadcast_lobby_info_message() broadcasting lobby info message \n" ); uStack_26 = *(undefined1 *)(param_1 + 8); bStack_27 = local_21 | 2; if (local_22 == '\0') { bStack_27 = local_21; } uStack_28 = 0; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = (void *)0x0; message = (void *)0x3; NetConnection::send_message(g_multiplayerService,auStack_30,1,&uStack_28,3,0); pMVar1 = g_manager; uStack_14 = 0; FUN_008ef1d0(auStack_30); NetplayManager::send_message(&pMVar1->_netplayManager,1,message,messageRefCount); uStack_14 = 1; if (piStack_2c != (int *)0x0) { cVar2 = (**(code **)(*piStack_2c + 0xc))(); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(auStack_30); } } ExceptionList = local_1c; return; } //@@ 008ee4d0 FUN_008ee4d0 void FUN_008ee4d0(undefined4 param_1,void *param_2,undefined4 param_3,int param_4) { ulonglong *userId; char cVar1; Manager *pMVar2; undefined4 uVar3; void *pvVar4; void *pvVar5; byte bVar6; int iVar7; bool bVar8; undefined8 uVar9; void *messageRefCount; undefined8 uStack_1c; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; iVar7 = param_4; uStack_8 = 0xffffffff; puStack_c = &LAB_00b0735d; local_10 = ExceptionList; ExceptionList = &local_10; if (*(char *)(param_4 + 0x6c8) == '\0') { switch(param_3) { case 0: uVar9 = FUN_00a23920(__security_cookie ^ (int)register0x00000010 - 4U); uVar3 = FUN_008e74d0(uVar9); pvVar5 = (void *)(iVar7 + 0x694); uStack_8 = 0; uStack_1c = FUN_00a23920(); lobby_member_map_get_or_add(pvVar5,&uStack_1c); FUN_008ea360(uVar3); userId = (ulonglong *)(iVar7 + 0x6a0); uStack_8 = 0xffffffff; pvVar4 = lobby_member_map_get_or_add(pvVar5,userId); bVar8 = *(char *)((int)pvVar4 + 9) != '\0'; pvVar4 = lobby_member_map_get_or_add(pvVar5,userId); cVar1 = *(char *)((int)pvVar4 + 10); KAGE_LogMessage(1,(byte *) "Menu_OnlineLobby::on_lobby_user_modified() eLobbyUserModification::Joined: Sending lobby info \n" ); pvVar5 = lobby_member_map_get_or_add(pvVar5,userId); messageRefCount = (void *)0x0; pvVar4 = (void *)0x3; bVar6 = bVar8 | 2; if (cVar1 == '\0') { bVar6 = bVar8; } param_4 = (uint)CONCAT21(CONCAT11((char)((uint)param_4 >> 0x18), *(undefined1 *)((int)pvVar5 + 8)),bVar6) << 8; FUN_00a296e0(&uStack_1c,1,¶m_4,3,0); uStack_8 = 1; FUN_008ef1d0(&uStack_1c); multiplayer_send_message(param_2,pvVar4,messageRefCount); uStack_8 = 0xffffffff; FUN_00708d40(); KAGE_LogMessage(1,(byte *) "Menu_OnlineLobby::on_lobby_user_modified() eLobbyUserModification::Joined: Sending local save data \n" ); pMVar2 = g_manager; pvVar5 = (void *)(**(code **)(*(int *)&g_manager[1]._gamestate.field_0x6c + 4))(); iVar7 = *(int *)&pMVar2[1]._gamestate.field_0x5c; if (iVar7 == 0) { iVar7 = *(int *)&pMVar2[1]._gamestate.field_0x50; } pvVar4 = (void *)0x0; FUN_00a296e0(&uStack_1c,1,iVar7,pvVar5,0); uStack_8 = 2; FUN_008ef1d0(&uStack_1c); multiplayer_send_message(param_2,pvVar5,pvVar4); FUN_00708d40(); ExceptionList = local_10; return; case 1: case 2: case 3: case 4: if (*(int *)((int)param_2 + 4) == 0) { uStack_1c = 0; } KAGE_LogMessage(1,(byte *)"Menu_OnlineLobby::on_lobby_user_modified() Player %llu left \n"); iVar7 = *(int *)((int)param_2 + 4); if (iVar7 == 0) { uStack_1c._4_4_ = 0; uStack_1c._0_4_ = 0; } else { uStack_1c._0_4_ = *(undefined4 *)(iVar7 + 8); uStack_1c._4_4_ = *(undefined4 *)(iVar7 + 0xc); } FUN_008eefb0(&uStack_1c); } } ExceptionList = local_10; return; } //@@ 008ee700 online_lobby_members_changed_callback /* DB: ? event listener added to list 0xc79b70 (FUN_00a1d6b0) by Menu_OnlineLobby init and removed at 986cf0; ctx = Menu_OnlineLobby: Lobby::get_members(1) and syncs the member map ctx+0x694 (lobby_member_map_get_or_add), removes stale entries, Menu_OnlineLobby::update_ready_state */ void online_lobby_members_changed_callback(void *param_1,void *param_2) { int iVar1; undefined4 *puVar2; char cVar3; uint uVar4; void *pvVar5; uint uVar6; int *this; undefined4 *puVar7; int *piVar8; undefined4 *puVar9; uint uVar10; undefined8 uVar11; undefined4 *local_40; undefined4 *local_3c; int local_38; undefined **local_34; int local_30; int *local_2c; int *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b07395; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_40 = (undefined4 *)0x0; local_3c = (undefined4 *)0x0; local_38 = 0; local_8 = 0; KAGE::Network::Multiplayer::Lobby::get_members(param_1,&local_40,1); uVar6 = 0; uVar10 = (int)local_3c - (int)local_40 >> 3; if (uVar10 != 0) { local_20 = (int *)((int)param_2 + 0x694); piVar8 = local_40 + 1; do { iVar1 = *piVar8; if (iVar1 == 0) { local_1c = 0; local_1c._4_4_ = (void *)0x0; local_1c._0_4_ = (undefined **)0x0; local_30 = (int)local_1c._4_4_; local_34 = (undefined **)local_1c; } else { local_30 = *(int *)(iVar1 + 0xc); local_34 = *(undefined ***)(iVar1 + 8); } pvVar5 = lobby_member_map_get_or_add(local_20,(ulonglong *)&local_34); iVar1 = *piVar8; uVar6 = uVar6 + 1; piVar8 = piVar8 + 2; *(int *)((int)pvVar5 + 4) = iVar1; } while (uVar6 < uVar10); } this = (int *)((int)param_2 + 0x694); piVar8 = *(int **)*this; local_1c = CONCAT44(piVar8,(undefined **)local_1c); local_20 = this; if (piVar8 != (int *)*this) { do { local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_30 = 0; local_2c = (int *)0x0; local_8 = CONCAT31(local_8._1_3_,1); std::shared_ptr::assign(&local_30,&g_multiplayerLobbyPtr); local_34 = KAGE::Network::Multiplayer::Lobby::vftable; if (local_30 != 0) { iVar1 = *(int *)(local_30 + 0x10); uVar6 = 0; if (*(int *)(local_30 + 0x14) - iVar1 >> 3 != 0) { do { uVar11 = FUN_00a23920(); if ((*(int *)(iVar1 + uVar6 * 8) == (int)uVar11) && (*(int *)(iVar1 + 4 + uVar6 * 8) == (int)((ulonglong)uVar11 >> 0x20))) { this = local_20; goto LAB_008ee83e; } uVar6 = uVar6 + 1; } while (uVar6 < (uint)(*(int *)(local_30 + 0x14) - iVar1 >> 3)); } this = local_20; } uVar6 = 0xffffffff; LAB_008ee83e: local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 2; if (((local_2c != (int *)0x0) && (cVar3 = (**(code **)(*local_2c + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_30); } local_8 = (uint)local_8._1_3_ << 8; if (uVar6 == 0xffffffff) { local_1c._4_4_ = piVar8; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)((int)&local_1c + 4)); pvVar5 = std_tree_extract(this,piVar8); *(undefined ***)((int)pvVar5 + 0x18) = KAGE::System::UserProfileBase::vftable; operator_delete(pvVar5,0x28); piVar8 = local_1c._4_4_; } else { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)((int)&local_1c + 4)); piVar8 = local_1c._4_4_; } } while (piVar8 != (void *)*this); } FUN_008ed320(uVar4); Menu_OnlineLobby::update_ready_state(param_2); puVar7 = local_3c; puVar2 = local_40; if (local_40 != (undefined4 *)0x0) { local_8 = 3; for (puVar9 = local_40; puVar9 != puVar7; puVar9 = puVar9 + 2) { (**(code **)*puVar9)(0); } uVar4 = local_38 - (int)puVar2 & 0xfffffff8; puVar7 = puVar2; if (0xfff < uVar4) { puVar7 = (undefined4 *)puVar2[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)puVar2 + (-4 - (int)puVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar7,uVar4); } ExceptionList = local_10; return; } //@@ 008ee940 Menu_OnlineLobby::leave_popup_callback /* DB: ? popup callback (pushed with ECX userdata by Menu_OnlineLobby::update_controls via the popup desc ctor 009c25e0 MessagePopup::MessagePopup MessagePopup::add_yes_no_buttons): on result != 1 pops the menu state, netplay_leave_lobby, NetplayManager::reset, PersistentGameData::Save/SaveToSteamCloud, Manager::BackupSaveFile */ void Menu_OnlineLobby::leave_popup_callback(int *param_1,void *param_2) { MenuManager *this; char cVar1; uint uVar2; int lobbyState; byte *lobbyFlag; int *steamContext; void *menuStateHistoryEnd; uint lobbyDestructFlags; PersistentGameData *persistentGameData; int unused1; void **key; int *lobbyPtr; int *lobbyCtrl; undefined **lobbyView; int *lobbyViewPtr; int *lobbyViewCtrl; undefined **lobbyView2; int *lobbyView2Ptr; int *lobbyView2Ctrl; int *lobbyIdLow; int lobbyIdHigh; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isLobbyCopyHeld; bool isLobbyState3; Manager *manager; this = g_menuManager; local_8 = 0xffffffff; puStack_c = &LAB_00b07417; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_1c = ZEXT48((int *)local_1c); if (*param_1 != 1) { return; } ExceptionList = &local_10; *(undefined4 *)((int)param_2 + 0x954) = 0; *(undefined4 *)((int)param_2 + 0x958) = 0; menuStateHistoryEnd = (this->_menuStateHistory)._end; if (1 < (uint)((int)menuStateHistoryEnd - (int)(this->_menuStateHistory)._begin >> 2)) { menuStateHistoryEnd = (void *)((int)menuStateHistoryEnd + -4); (this->_menuStateHistory)._end = menuStateHistoryEnd; } MenuManager::SetState(this,*(int *)((int)menuStateHistoryEnd + -4),0); lobbyView = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyViewPtr = (int *)0x0; lobbyViewCtrl = (int *)0x0; key = &g_multiplayerLobbyPtr; local_8 = 0; unused1 = 0x8ee9e2; std::shared_ptr::assign(&lobbyViewPtr,&g_multiplayerLobbyPtr); lobbyView = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 1; lobbyDestructFlags = 0xd; isLobbyCopyHeld = false; local_1c = CONCAT44(0xd,(int *)local_1c); if (lobbyViewPtr != (int *)0x0) { key = (int **)0x8eea06; cVar1 = (**(code **)(*lobbyViewPtr + 0xc))(uVar2); if (cVar1 != '\0') { lobbyView2 = KAGE::Network::Multiplayer::ConstLobby::vftable; lobbyView2Ptr = (int *)0x0; lobbyView2Ctrl = (int *)0x0; key = &g_multiplayerLobbyPtr; local_8 = 2; unused1 = 0x8eea33; std::shared_ptr::assign(&lobbyView2Ptr,&g_multiplayerLobbyPtr); lobbyView2 = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 3; lobbyDestructFlags = 0x3f; isLobbyCopyHeld = true; local_1c = CONCAT44(0x3f,(int *)local_1c); if (lobbyView2Ptr != (int *)0x0) { key = (int **)0x8eea55; lobbyState = (**(code **)(*lobbyView2Ptr + 0x3c))(); isLobbyState3 = true; if (lobbyState == 3) goto LAB_008eea62; } } } isLobbyState3 = false; LAB_008eea62: uVar2 = lobbyDestructFlags; if (isLobbyCopyHeld) { uVar2 = lobbyDestructFlags & 0xfffffffd; lobbyView2 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_1c = CONCAT44(lobbyDestructFlags,(int *)local_1c) & 0xfffffffdffffffff; local_8 = 4; if (lobbyView2Ctrl != (int *)0x0) { key = (int **)0x8eea89; cVar1 = (**(code **)(*lobbyView2Ctrl + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { key = &lobbyView2Ptr; unused1 = 0x8eea9c; (*g_lobbyReleaseFn)(); } } } if ((uVar2 & 1) != 0) { lobbyView = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if (lobbyViewCtrl != (int *)0x0) { key = (int **)0x8eeac7; cVar1 = (**(code **)(*lobbyViewCtrl + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { key = &lobbyViewPtr; unused1 = 0x8eeada; (*g_lobbyReleaseFn)(); } } } manager = g_manager; if (isLobbyState3) { lobbyPtr = (int *)0x0; lobbyCtrl = (int *)0x0; local_8 = 6; std::shared_ptr::assign(&lobbyPtr,&g_multiplayerLobbyPtr); local_8 = 7; if (lobbyPtr == (int *)0x0) { local_1c = 0; local_1c._4_4_ = 0; local_1c._0_4_ = (int *)0x0; lobbyIdHigh = local_1c._4_4_; lobbyIdLow = (int *)local_1c; } else { lobbyIdHigh = lobbyPtr[3]; lobbyIdLow = (int *)lobbyPtr[2]; } key = &lobbyIdLow; unused1 = 0x8eeb5d; lobbyFlag = map_u64_bool_subscript(&manager[1]._gamestate.field_0x8f4,(ulonglong *)key); *lobbyFlag = 1; local_8 = 8; if (lobbyCtrl != (int *)0x0) { key = (int **)0x8eeb7c; cVar1 = (**(code **)(*lobbyCtrl + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { key = &lobbyPtr; unused1 = 0x8eeb8f; (*g_lobbyReleaseFn)(); } } } local_8 = 0xffffffff; netplay_leave_lobby(&g_manager->_netplayManager,unused1,(int)key); NetplayManager::reset(&g_manager->_netplayManager,1); init_lobby_view(param_2); persistentGameData = &g_manager->_persistentGameData; if ((*(char *)persistentGameData != '\0') && ((g_manager->_persistentGameData)._isFileLoaded != 0) ) { *(undefined1 *)persistentGameData = 0; Manager::BackupSaveFile((Manager *)persistentGameData); manager = g_manager; steamContext = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*steamContext != 0) && ((manager->_optionsConfig)._enableSteamCloud != 0)) { PersistentGameData::SaveToSteamCloud(persistentGameData); ExceptionList = local_10; return; } PersistentGameData::Save(persistentGameData); } ExceptionList = local_10; return; } //@@ 008eec40 FUN_008eec40 void FUN_008eec40(undefined4 *param_1,int param_2) { int iVar1; void *pvVar2; undefined4 uVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07457; local_10 = ExceptionList; if (param_1 == (undefined4 *)0x0) { *(undefined4 *)(param_2 + 0x954) = 0; return; } ExceptionList = &local_10; *(undefined4 *)(param_2 + 0x958) = *param_1; DAT_00c5ab40 = 0; uVar3 = *(undefined4 *)(param_2 + 0x958); iVar1 = FUN_00a51d10(uVar3); if (iVar1 == 0) { KAGE_LogMessage(4,(byte *) "Attempting to upload score to leaderboard that hasn\'t been downloaded\n"); *(undefined4 *)(param_2 + 0x954) = 2; ExceptionList = local_10; return; } pvVar2 = operator_new(0xb0); if (pvVar2 == (void *)0x0) { uVar3 = 0; } else { uVar3 = FUN_00a51570(2,uVar3,0,0,0,0,&LAB_008eed40,param_2); } local_8 = 0xffffffff; FUN_00a52100(uVar3); *(undefined4 *)(param_2 + 0x954) = 2; ExceptionList = local_10; return; } //@@ 008eee70 FUN_008eee70 void FUN_008eee70(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 008eeed0 lobby_member_map_get_or_add /* DB: ? std::map keyed by 64-bit user id (lower_bound FUN_00731ee0); if absent inserts a 0x28-byte node holding a KAGE::System::UserProfile (vftable, refcount 1) and returns the iterator; Menu_OnlineLobby::Update/Render/init_lobby_view prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall lobby_member_map_get_or_add(void *this,ulonglong *userId) { undefined4 uVar1; ulonglong uVar2; uint uVar3; undefined4 *newNode; void *local_24; int local_20; void *local_1c; void *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0748d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_24,userId); if (*(char *)((int)local_1c + 0xd) == '\0') { if ((*(uint *)((int)local_1c + 0x14) <= *(uint *)((int)userId + 4)) && ((*(uint *)((int)local_1c + 0x14) < *(uint *)((int)userId + 4) || (*(uint *)((int)local_1c + 0x10) <= (uint)*userId)))) goto LAB_008eef8b; } if (*(int *)((int)this + 4) == 0x6666666) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } uVar1 = *(undefined4 *)this; local_8 = 0; local_14 = 0; local_18 = this; newNode = operator_new(0x28); uVar2 = *userId; newNode[5] = *(undefined4 *)((int)userId + 4); newNode[4] = (int)uVar2; newNode[7] = 0; newNode[6] = KAGE::System::UserProfile::vftable; newNode[8] = 1; *(undefined1 *)(newNode + 9) = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(this,local_24,local_20,newNode); LAB_008eef8b: ExceptionList = local_10; return (void *)((int)local_1c + 0x18); } //@@ 008eefb0 FUN_008eefb0 int FUN_008eefb0(uint *param_1) { char cVar1; int *piVar2; uint uVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_10; piVar2 = (int *)*in_ECX; piVar5 = (int *)piVar2[1]; piVar4 = piVar5; piVar8 = piVar2; piVar9 = piVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar3 = piVar4[5]; if ((param_1[1] < uVar3) || ((param_1[1] <= uVar3 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar3) && ((param_1[1] < uVar3 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_10 = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar1 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_10 = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar2) && (*(char *)((int)piVar9 + 0xd) != '\0')) { FUN_008ef400(in_ECX,piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar2 = (int *)param_1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); *(undefined ***)((int)ptr + 0x18) = KAGE::System::UserProfileBase::vftable; operator_delete(ptr,0x28); } while (param_1 != (uint *)piVar9); return local_10; } return local_10; } //@@ 008ef120 vector_UserProfile_destroy /* DB: ? std::vector of 8-byte polymorphic elements (KAGE::System::UserProfile: vftable + impl): calls each element's scalar destructor vfunc 0 then frees the buffer; Menu_OnlineLobby::init_lobby_view, InviteFriendsMenu::load_graphics and several unwind funclets prototype: db/protos.zhl */ void __fastcall vector_UserProfile_destroy(void *vec) { uint uVar1; undefined4 *puVar2; undefined4 *puVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1360; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = *(undefined4 **)vec; if (puVar2 != (undefined4 *)0x0) { puVar3 = *(undefined4 **)((int)vec + 4); local_8 = 0; if (puVar2 != puVar3) { do { (**(code **)*puVar2)(0,uVar1); puVar2 = puVar2 + 2; } while (puVar2 != puVar3); puVar2 = *(undefined4 **)vec; } uVar1 = *(int *)((int)vec + 8) - (int)puVar2 & 0xfffffff8; puVar3 = puVar2; if (0xfff < uVar1) { puVar3 = (undefined4 *)puVar2[-1]; uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)puVar2 + (-4 - (int)puVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar3,uVar1); *(undefined4 *)vec = 0; *(undefined4 *)((int)vec + 4) = 0; *(undefined4 *)((int)vec + 8) = 0; } ExceptionList = local_10; return; } //@@ 008ef1d0 FUN_008ef1d0 void FUN_008ef1d0(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 008ef230 FUN_008ef230 undefined4 * FUN_008ef230(int param_1,int param_2) { uint uVar1; undefined4 *puVar2; int iVar3; void *pvVar4; uint uVar5; int *in_ECX; uint uVar6; undefined1 *puVar7; undefined4 *puVar8; undefined4 *puVar9; int iVar10; iVar3 = *in_ECX; iVar10 = (in_ECX[1] - *in_ECX) / 0x14; if (iVar10 == 0xccccccc) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar10 + 1; uVar5 = (in_ECX[2] - *in_ECX) / 0x14; if (0xccccccc - (uVar5 >> 1) < uVar5) { uVar6 = 0xccccccc; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar6 = uVar1; if (uVar1 <= uVar5) { uVar6 = uVar5; } if (0xccccccc < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = std::_Allocate(uVar6 * 0x14); puVar2 = (undefined4 *)((int)pvVar4 + ((param_1 - iVar3) / 0x14) * 0x14); *puVar2 = KAGE::System::UserProfileBase::vftable; puVar2[1] = *(undefined4 *)(param_2 + 4); *puVar2 = KAGE::System::UserProfile::vftable; *(undefined1 *)(puVar2 + 2) = *(undefined1 *)(param_2 + 8); puVar2[3] = *(undefined4 *)(param_2 + 0xc); puVar2[4] = *(undefined4 *)(param_2 + 0x10); iVar3 = in_ECX[1]; iVar10 = *in_ECX; if (param_1 == iVar3) { if (iVar10 != iVar3) { puVar7 = (undefined1 *)((int)pvVar4 + 8); do { *(undefined ***)(puVar7 + -8) = KAGE::System::UserProfileBase::vftable; *(undefined4 *)(puVar7 + -4) = *(undefined4 *)(iVar10 + 4); *(undefined ***)(puVar7 + -8) = KAGE::System::UserProfile::vftable; *puVar7 = *(undefined1 *)(iVar10 + 8); *(undefined4 *)(puVar7 + 4) = *(undefined4 *)(iVar10 + 0xc); puVar8 = (undefined4 *)(iVar10 + 0x10); iVar10 = iVar10 + 0x14; *(undefined4 *)(puVar7 + 8) = *puVar8; puVar7 = puVar7 + 0x14; } while (iVar10 != iVar3); } } else { FUN_008ef450(iVar10,param_1,pvVar4); FUN_008ef450(param_1,in_ECX[1],puVar2 + 5); } puVar8 = (undefined4 *)*in_ECX; if (puVar8 != (undefined4 *)0x0) { puVar9 = (undefined4 *)in_ECX[1]; if (puVar8 != puVar9) { do { *puVar8 = KAGE::System::UserProfileBase::vftable; puVar8 = puVar8 + 5; } while (puVar8 != puVar9); puVar8 = (undefined4 *)*in_ECX; } uVar5 = ((in_ECX[2] - (int)puVar8) / 0x14) * 0x14; puVar9 = puVar8; if (0xfff < uVar5) { puVar9 = (undefined4 *)puVar8[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)puVar8 + (-4 - (int)puVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar9,uVar5); } *in_ECX = (int)pvVar4; in_ECX[1] = (int)((int)pvVar4 + uVar1 * 0x14); in_ECX[2] = (int)(uVar6 * 0x14 + (int)pvVar4); return puVar2; } //@@ 008ef400 FUN_008ef400 void FUN_008ef400(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_008ef400(param_1,param_2[2]); piVar2 = (int *)*param_2; param_2[6] = (int)KAGE::System::UserProfileBase::vftable; operator_delete(param_2,0x28); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 008ef450 FUN_008ef450 void FUN_008ef450(undefined1 *param_1,undefined1 *param_2,undefined4 *param_3) { undefined1 *puVar1; undefined4 *puVar2; undefined1 *puVar3; if (param_1 != param_2) { puVar2 = param_3; puVar3 = param_1 + 8; do { *puVar2 = KAGE::System::UserProfileBase::vftable; puVar2[1] = *(undefined4 *)(puVar3 + -4); *puVar2 = KAGE::System::UserProfile::vftable; (puVar3 + 0x14)[(int)param_3 + (-0x14 - (int)param_1)] = *puVar3; puVar2[3] = *(undefined4 *)(puVar3 + 4); puVar2[4] = *(undefined4 *)(puVar3 + 8); puVar1 = puVar3 + 0xc; puVar2 = puVar2 + 5; puVar3 = puVar3 + 0x14; } while (puVar1 != param_2); } return; } //@@ 008ef4b0 RevivePlayerMenu::~RevivePlayerMenu /* DB: Game::~Game destroys it right before PauseScreen::~PauseScreen, mirroring Game::constructor which builds ANM2s at Game+0x24edc/+0x24ff0 just after PauseScreen::constructor = _revivePlayerMenu (0x24ecc) +0x10/+0x124, the two sprites this resets */ void RevivePlayerMenu::~RevivePlayerMenu(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x124)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x174)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x154)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x13c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x124)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x10)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x60)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x40)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x28)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); ExceptionList = local_10; return; } //@@ 008ef560 RevivePlayerMenu::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: gfx/ui/Menu_RevivePlayer.anm2 */ void RevivePlayerMenu::Init(void) { byte *pbVar1; byte bVar2; byte *pbVar3; undefined4 *in_ECX; char *pcVar4; uint uVar5; bool bVar6; std_string local_54; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_54._size = 0; local_54._capacity = 0xf; local_54._buf[0] = '\0'; local_54._buf[1] = '\0'; local_54._buf[2] = '\0'; local_54._buf[3] = '\0'; local_54._buf._0_4_ = std::_Allocate(0x20); local_54._size = 0x1d; local_54._capacity = 0x1f; builtin_strncpy((char *)local_54._buf._0_4_,"gfx/ui/Menu_RevivePlayer.anm2",0x1e); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 4),&local_54,1); local_14 = 0xffffffff; if (0xf < local_54._capacity) { uVar5 = local_54._capacity + 1; pcVar4 = (char *)local_54._buf._0_4_; if (0xfff < uVar5) { pcVar4 = *(char **)(local_54._buf._0_4_ + -4); uVar5 = local_54._capacity + 0x24; if ((char *)0x1f < (char *)(local_54._buf._0_4_ + (-4 - (int)pcVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,uVar5); } pbVar1 = (byte *)in_ECX[0x11]; if (pbVar1 == (byte *)0x0) { LAB_008ef6a3: bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),(byte *)"Background",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0x15) = 1; } } else { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar4 = "Background"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar4; if (bVar2 != *pcVar4) { LAB_008ef690: uVar5 = -(uint)bVar6 | 1; goto LAB_008ef695; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar4[1]; if (bVar2 != pcVar4[1]) goto LAB_008ef690; pbVar3 = pbVar3 + 2; pcVar4 = pcVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_008ef695: if ((uVar5 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(in_ECX + 0x15) == '\0')))) goto LAB_008ef6a3; } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x21; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/RevivePlayer_Selector.anm2",0x22); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x49),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar5 = local_3c._capacity + 1; pcVar4 = (char *)local_3c._buf._0_4_; if (0xfff < uVar5) { pcVar4 = *(char **)(local_3c._buf._0_4_ + -4); uVar5 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,uVar5); } pbVar1 = (byte *)in_ECX[0x56]; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar4 = "UpperSelector"; do { bVar2 = *pbVar3; bVar6 = bVar2 < (byte)*pcVar4; if (bVar2 != *pcVar4) { LAB_008ef7c0: uVar5 = -(uint)bVar6 | 1; goto LAB_008ef7c5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < (byte)pcVar4[1]; if (bVar2 != pcVar4[1]) goto LAB_008ef7c0; pbVar3 = pbVar3 + 2; pcVar4 = pcVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_008ef7c5: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x5a) != '\0')))) goto LAB_008ef7f1; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x49),(byte *)"UpperSelector",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x55)); *(undefined1 *)(in_ECX + 0x5a) = 1; } LAB_008ef7f1: in_ECX[0x70] = in_ECX[0x8e]; in_ECX[0x71] = in_ECX[0x8e]; in_ECX[2] = 0; in_ECX[1] = 0xffffffff; *in_ECX = 0; ExceptionList = local_1c; return; } //@@ 008ef840 FUN_008ef840 void FUN_008ef840(undefined4 param_1) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; Entity_Player *pEVar5; uint uVar6; undefined4 *in_ECX; char *pcVar7; PlayerManager *this; bool bVar8; pbVar1 = (byte *)in_ECX[0x11]; if (pbVar1 == (byte *)0x0) { LAB_008ef893: bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 4),(byte *)"Background",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0x15) = 1; } } else { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar7 = "Background"; do { bVar2 = *pbVar3; bVar8 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_008ef880: uVar4 = -(uint)bVar8 | 1; goto LAB_008ef885; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar8 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_008ef880; pbVar3 = pbVar3 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008ef885: if ((uVar4 != 0) || ((pbVar1[0x34] != 0 && (*(char *)(in_ECX + 0x15) == '\0')))) goto LAB_008ef893; } pbVar1 = (byte *)in_ECX[0x56]; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } pcVar7 = "UpperSelector"; do { bVar2 = *pbVar3; bVar8 = bVar2 < (byte)*pcVar7; if (bVar2 != *pcVar7) { LAB_008ef8f0: uVar4 = -(uint)bVar8 | 1; goto LAB_008ef8f5; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar8 = bVar2 < (byte)pcVar7[1]; if (bVar2 != pcVar7[1]) goto LAB_008ef8f0; pbVar3 = pbVar3 + 2; pcVar7 = pcVar7 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008ef8f5: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*(char *)(in_ECX + 0x5a) != '\0')))) goto LAB_008ef92e; } bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x49),(byte *)"UpperSelector",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x55)); *(undefined1 *)(in_ECX + 0x5a) = 1; } LAB_008ef92e: this = &g_game->_playerManager; uVar4 = in_ECX[2]; in_ECX[1] = param_1; pEVar5 = PlayerManager::get_main_player(this,uVar4); while ((pEVar5 != (Entity_Player *)0x0 && (pEVar5 = PlayerManager::get_main_player(this,uVar4), pEVar5->_isCoopGhost == 0))) { uVar6 = PlayerManager::count_main_players(this); uVar4 = (uVar4 + 1) % uVar6; in_ECX[2] = uVar4; pEVar5 = PlayerManager::get_main_player(this,uVar4); } *in_ECX = 1; return; } //@@ 008ef990 coop_join_menu_update /* DB: ? multiplayer-only overlay (called from 006fa540 Manager::update_ingame_input !is_single_player and Game::Update): state machine on MENUCONFIRM/MENULEFT/MENURIGHT/MENUDOWN (0xe/0x14/0x15/0x17), two ANM2s (+0x10, +0x124), Player_stats_add, count_main_players */ void coop_join_menu_update(void) { int *piVar1; Game *pGVar2; Manager *pMVar3; byte bVar4; char cVar5; uint uVar6; int iVar7; Entity_Player *pEVar8; uint uVar9; int *in_ECX; PlayerManager *pPVar10; int iVar11; int iVar12; int iStack_34; code *pcStack_30; undefined4 *puStack_2c; int iStack_28; undefined4 local_10 [3]; if (*in_ECX == 1) { if ((g_game->_hud)._isVisible != 0) { uVar6 = PlayerManager::GetNumCoopPlayers(&g_game->_playerManager); iStack_28 = 0x8ef9d6; bVar4 = InputManager::is_device_connected(&PTR_vftable_00c57b18,in_ECX[1]); if ((bVar4 != 0) && (uVar6 != 0)) { ANM2::Update((ANM2 *)(in_ECX + 4)); ANM2::Update((ANM2 *)(in_ECX + 0x49)); puStack_2c = local_10; iStack_28 = 0; pcStack_30 = FUN_00a209e0; iStack_34 = in_ECX[1]; local_10[0] = 0xe; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if ((cVar5 == '\0') && (cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (in_ECX[1],FUN_00a209e0,local_10 + -4,0), cVar5 == '\0')) { if (uVar6 < 2) { return; } iVar12 = 0; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(in_ECX[1],FUN_00a209e0,local_10 + -4,0) ; if (cVar5 == '\0') { iStack_34 = 0x17; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (in_ECX[1],FUN_00a209e0,&iStack_34,0,0); pGVar2 = g_game; if (cVar5 == '\0') { iStack_34 = 0x14; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (in_ECX[1],FUN_00a209e0,&iStack_34,0,0); if (cVar5 == '\0') { iStack_34 = 0x15; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (in_ECX[1],FUN_00a209e0,&iStack_34,0,0); if (cVar5 != '\0') { uVar6 = in_ECX[2]; pPVar10 = &g_game->_playerManager; do { uVar9 = PlayerManager::count_main_players(pPVar10); uVar6 = (uVar6 + 1) % uVar9; in_ECX[2] = uVar6; pEVar8 = PlayerManager::get_main_player(pPVar10,uVar6); if (pEVar8 == (Entity_Player *)0x0) break; pEVar8 = PlayerManager::get_main_player(pPVar10,uVar6); } while (pEVar8->_isCoopGhost == 0); } } else { iVar11 = in_ECX[2]; pPVar10 = &g_game->_playerManager; do { iVar11 = iVar11 + -1; in_ECX[2] = iVar11; if (iVar11 < 0) { iVar11 = PlayerManager::count_main_players(pPVar10); iVar11 = iVar11 + -1; in_ECX[2] = iVar11; } pEVar8 = PlayerManager::get_main_player(pPVar10,iVar11); } while ((pEVar8 != (Entity_Player *)0x0) && (pEVar8 = PlayerManager::get_main_player(pPVar10,iVar11), pEVar8->_isCoopGhost == 0)); } } else { in_ECX[2] = in_ECX[2] + 2; pPVar10 = &pGVar2->_playerManager; uVar6 = in_ECX[2]; iVar11 = PlayerManager::count_main_players(pPVar10); if (iVar11 <= (int)uVar6) { iVar11 = PlayerManager::count_main_players(pPVar10); uVar6 = uVar6 - iVar11; in_ECX[2] = uVar6; } pEVar8 = PlayerManager::get_main_player(pPVar10,uVar6); while ((pEVar8 != (Entity_Player *)0x0 && (pEVar8 = PlayerManager::get_main_player(pPVar10,uVar6), pEVar8->_isCoopGhost == 0))) { uVar9 = PlayerManager::count_main_players(pPVar10); uVar6 = (uVar6 + 1) % uVar9; in_ECX[2] = uVar6; pEVar8 = PlayerManager::get_main_player(pPVar10,uVar6); } } } else { piVar1 = in_ECX + 2; *piVar1 = *piVar1 + -2; pGVar2 = g_game; iVar11 = in_ECX[2]; if (*piVar1 < 0) { iVar7 = PlayerManager::count_main_players(&g_game->_playerManager); iVar11 = iVar11 + iVar7; in_ECX[2] = iVar11; } pPVar10 = &pGVar2->_playerManager; pEVar8 = PlayerManager::get_main_player(pPVar10,iVar11); while ((pEVar8 != (Entity_Player *)0x0 && (pEVar8 = PlayerManager::get_main_player(pPVar10,iVar11), pEVar8->_isCoopGhost == 0))) { iVar11 = iVar11 + -1; in_ECX[2] = iVar11; if (iVar11 < 0) { iVar11 = PlayerManager::count_main_players(pPVar10); iVar11 = iVar11 + -1; in_ECX[2] = iVar11; } pEVar8 = PlayerManager::get_main_player(pPVar10,iVar11); } } pMVar3 = g_manager; if (in_ECX[2] == iVar12) { return; } iVar12 = 0x11a; seed_fart_sound_override(local_10 + -10); SoundEffects::Play(&pMVar3->_sfxManager,iVar12,1.0,2,0,1.0,0.0); return; } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { PlayerManager::get_main_player(&g_game->_playerManager,in_ECX[2]); FUN_009b9450(); PlayerManager::ReviveCoopPlayer(); pGVar2 = g_game; pEVar8 = (Entity_Player *)FUN_009bac00(); } else { PlayerManager::get_main_player(&g_game->_playerManager,in_ECX[2]); FUN_0090a670(); pGVar2 = g_game; pEVar8 = (Entity_Player *)FUN_0090b0e0(); } Player_stats_add(&pGVar2->_onlinePlayerStats,0xc,pEVar8,1.0); pMVar3 = g_manager; iVar12 = 0x36; seed_fart_sound_override(local_10 + -5); SoundEffects::Play(&pMVar3->_sfxManager,iVar12,1.0,2,0,1.0,0.0); } *in_ECX = 2; in_ECX[3] = 8; in_ECX[1] = -1; return; } } else if ((*in_ECX == 2) && (iVar12 = in_ECX[3], in_ECX[3] = iVar12 + -1, iVar12 < 1)) { *in_ECX = 0; } return; } //@@ 008efe10 RevivePlayerMenu::Render /* DB: ? Game::Render after the pause screen: when state +0 == 1, coop players exist and the HUD is visible, renders ANM2 +4 at screen center, "REVIVE PLAYER" at the "Title" null, UpperSelector/LowerSelector; RevivePlayerMenu::Init is 008ef560 RevivePlayerMenu::Init void RevivePlayerMenu::Render(void) { Game *pGVar1; int iVar2; float *pfVar3; void *settings; Entity_Player *player; char *anim; int *in_ECX; KColor *color; Manager *pMVar4; FontSettings local_54 [5]; undefined4 local_40; undefined4 local_3c; KColor local_38; Vector local_24; int *local_1c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pGVar1 = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00b074bd; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = in_ECX; iVar2 = PlayerManager::GetNumCoopPlayers(&g_game->_playerManager); if (((*in_ECX == 1) && (iVar2 != 0)) && ((pGVar1->_hud)._isVisible != 0)) { local_24.x = g_screenWidth * 0.5; local_24.y = g_screenHeight * 0.5; ANM2::Render((ANM2 *)(in_ECX + 4),&local_24,&g_vectorZero,&g_vectorZero); pMVar4 = g_manager; iVar2 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,(byte *)"REVIVE PLAYER",-1); local_18.y = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]); if (in_ECX[0x11] == 0) { pfVar3 = (float *)0x0; } else { pfVar3 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x10),(byte *)"Title"); pMVar4 = g_manager; } local_24.y = local_24.y + pfVar3[1]; local_24.x = (local_24.x + *pfVar3) - local_18.y * 0.5; FontSettings::constructor(local_54); local_8 = 0; KColor::SetFromARGB(&local_38,0xffffffff); Font::DrawStringScaled (&pMVar4->_font2_TeamMeatEx12,(byte *)"REVIVE PLAYER",&local_24,color,settings); pGVar1 = g_game; local_8 = 0xffffffff; iVar2 = in_ECX[2]; local_40 = 0; local_3c = 0; player = PlayerManager::get_main_player(&g_game->_playerManager,iVar2); iVar2 = HUD::GetPlayerHUDLayout(&pGVar1->_hud,iVar2,player); FUN_009a6320(&local_18,player,iVar2); if (g_screenHeight * 0.5 <= local_18.y) { local_18.y = local_18.y - 35.0; anim = "LowerSelector"; } else if (iVar2 == 2) { local_18.y = local_18.y + 50.0; anim = "UpperSelector"; } else { local_18.y = local_18.y + 65.0; anim = "UpperSelector"; } ANM2::Play((ANM2 *)(local_1c + 0x49),(byte *)anim,0); ANM2::Render((ANM2 *)(local_1c + 0x49),&local_18,&g_vectorZero,&g_vectorZero); } ExceptionList = local_10; return; } //@@ 008f0040 SpecialSeed::get_display_name /* DB: ? ECX 0x28-byte special seed entry (id +0xc, name std::string +0x10): returns name, or StringTable::get_string("SeedMenu", lang, name+1) when it starts with '#'; Menu_SpecialSeeds::Render, Menu_Character::submit_seed */ char * SpecialSeed::get_display_name(char *param_1) { byte bVar1; Manager *pMVar2; byte *text; int in_ECX; byte *pbVar3; byte local_5; pMVar2 = g_manager; if (*(int *)(in_ECX + 0x20) == 0) { param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; *param_1 = '\0'; return param_1; } text = (byte *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x24)) { text = *(byte **)text; } if (*text == 0x23) { local_5 = 0; StringTable::get_string (&g_manager->_stringTable,(byte *)"SeedMenu",*(int *)&g_manager->_stringTable,text + 1 ,&local_5); if (local_5 == 0) { local_5 = 0; text = StringTable::get_string (&pMVar2->_stringTable,(byte *)"SeedMenu",*(int *)&pMVar2->_stringTable, text + 1,&local_5); } } param_1[0] = '\0'; param_1[1] = '\0'; param_1[2] = '\0'; param_1[3] = '\0'; param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; pbVar3 = text; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign(param_1,text,(int)pbVar3 - (int)(text + 1)); return param_1; } //@@ 008f0120 FUN_008f0120 void FUN_008f0120(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; FUN_008f2690(__security_cookie ^ (int)register0x00000010 - 4U); std::string::_Tidy_deallocate((char *)(in_ECX + 0x148)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x130)); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x1c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x6c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); ExceptionList = local_10; return; } //@@ 008f01b0 Menu_SpecialSeeds::Update /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: MenuManager::Update case 6; calls Menu_SpecialSeeds::Reset, Seeds::AddSeedEffect/HasSeedEffect/RemoveBlockingSeedEffects, MenuManager::SetState prototype: db/protos.zhl */ void __thiscall Menu_SpecialSeeds::Update(Menu_SpecialSeeds *seedEffectSet) { float *pfVar1; uint seedEffect; char isActionTriggered; byte isSeedActive; int iVar2; int *entryIt; void *pvVar3; void **seedEffectSet; float fVar4; float fVar5; undefined1 local_30 [8]; void *seedEffectNode; undefined4 local_24; undefined4 local_20 [2]; uint local_18 [2]; Seeds *local_10; undefined4 actionId; char isComboHeld; uint entries; Manager *manager; MenuManager *menuManager; Seeds *scaledIndex; if (((g_manager->_framecount & 1) == 0) && ((seedEffectSet->SpecialSeedsSprite)._loaded != 0)) { AnimationState::Update(&(seedEffectSet->SpecialSeedsSprite)._animState); AnimationState::Update(&(seedEffectSet->SpecialSeedsSprite)._overlayAnimState); } actionId = 0x18; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&actionId,0,0); if (isActionTriggered == '\0') { LAB_008f0261: isComboHeld = '\0'; } else { actionId = 0x19; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&actionId,0,0); if (isActionTriggered == '\0') goto LAB_008f0261; actionId = 0x1c; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,0); isComboHeld = '\x01'; if (isActionTriggered == '\0') goto LAB_008f0261; } actionId = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,0); menuManager = g_menuManager; manager = g_manager; if (isActionTriggered == '\0') { if (isComboHeld == '\0') { local_18[0] = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_18,0,0); if (isActionTriggered == '\0') { local_10 = (Seeds *)&DAT_00000017; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_10,0,0); if (isActionTriggered == '\0') { local_20[0] = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,local_20,0,0); if (isActionTriggered != '\0') { FUN_0098aec0(); } } else { fVar4 = seedEffectSet->PositionY; if ((fVar4 == 0.0) || ((0x1d < (int)fVar4 && ((int)fVar4 % 5 == 0)))) { seedEffectSet->PositionX = (float)((int)seedEffectSet->PositionX + 1); entries = seedEffectSet[1].SpecialSeedsSprite._filename._capacity; fVar4 = seedEffectSet->PositionX; if ((int)fVar4 < (int)(*(int *)seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf - entries) / 0x28) { do { if (*(int *)(entries + (int)fVar4 * 0x28) != 0) goto LAB_008f0594; fVar4 = (float)((int)fVar4 + 1); seedEffectSet->PositionX = fVar4; } while ((int)fVar4 < (int)(*(int *)seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf - entries) / 0x28); } seedEffectSet->PositionX = 0.0; } } } else { fVar4 = seedEffectSet->PositionY; if ((fVar4 == 0.0) || ((0x1d < (int)fVar4 && ((int)fVar4 % 5 == 0)))) { pfVar1 = &seedEffectSet->PositionX; *pfVar1 = (float)((int)*pfVar1 + -1); fVar4 = seedEffectSet->PositionX; fVar5 = *pfVar1; while (-1 < (int)fVar5) { if (*(int *)(seedEffectSet[1].SpecialSeedsSprite._filename._capacity + (int)fVar4 * 0x28) != 0) goto LAB_008f0594; fVar4 = (float)((int)fVar4 + -1); seedEffectSet->PositionX = fVar4; fVar5 = fVar4; } seedEffectSet->PositionX = (float)((int)(*(int *)seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf - seedEffectSet[1].SpecialSeedsSprite._filename._capacity) / 0x28 + -1); } } } else { fVar4 = seedEffectSet->PositionX; entries = seedEffectSet[1].SpecialSeedsSprite._filename._capacity; if (*(int *)(entries + (int)fVar4 * 0x28) == 3) { if ((g_manager->_persistentGameData)._isReadOnly == 0) { *(undefined1 *) ((int)(g_manager->_persistentGameData)._cutsceneCounters + *(int *)(entries + 0xc + (int)fVar4 * 0x28) + 0x74) = 0; *(undefined1 *)&manager->_persistentGameData = 1; } local_18[0] = *(uint *)(entries + 0xc + (int)fVar4 * 0x28); std_set_int_erase_key(&(g_menuManager->_seedsObject)._seedEffects,(int *)local_18); fVar4 = seedEffectSet->PositionX; Reset(seedEffectSet); iVar2 = (int)(*(int *)seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf - seedEffectSet[1].SpecialSeedsSprite._filename._capacity) / 0x28; if ((int)fVar4 < iVar2) { entryIt = (int *)(seedEffectSet[1].SpecialSeedsSprite._filename._capacity + (int)fVar4 * 0x28); do { if (*entryIt != 0) break; fVar4 = (float)((int)fVar4 + 1); entryIt = entryIt + 10; } while ((int)fVar4 < iVar2); } if (iVar2 + -1 < (int)fVar4) { fVar4 = (float)(iVar2 + -1); } seedEffectSet->PositionX = fVar4; } } } else { local_18[0] = seedEffectSet[1].SpecialSeedsSprite._filename._capacity; local_10 = (Seeds *)((int)seedEffectSet->PositionX * 5); iVar2 = *(int *)(local_18[0] + (int)seedEffectSet->PositionX * 0x28); if (iVar2 == 1) { seedEffectSet = &(g_menuManager->_seedsObject)._seedEffects; pvVar3 = *seedEffectSet; FID_conflict__Erase_tree_>_> (seedEffectSet, (fuzzer_allocator_> *)seedEffectSet, *(_Tree_node **)((int)pvVar3 + 4)); *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; (menuManager->_seedsObject)._seedEffectsCount = 0; iVar2 = *(int *)(local_18[0] + (int)local_10 * 8); } scaledIndex = local_10; entries = local_18[0]; menuManager = g_menuManager; if (iVar2 == 2) { pvVar3 = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)pvVar3 - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { pvVar3 = (void *)((int)pvVar3 + -4); (g_menuManager->_menuStateHistory)._end = pvVar3; } MenuManager::SetState(menuManager,*(int *)((int)pvVar3 + -4),0); } if (*(int *)(entries + (int)scaledIndex * 8) == 3) { local_10 = &g_menuManager->_seedsObject; isSeedActive = Seeds::HasSeedEffect(local_10,*(uint *)(entries + 0xc + (int)scaledIndex * 8)); seedEffect = *(uint *)(entries + 0xc + (int)scaledIndex * 8); if (isSeedActive == 0) { Seeds::RemoveBlockingSeedEffects(local_10,seedEffect); Seeds::AddSeedEffect (&g_menuManager->_seedsObject,*(int *)(entries + 0xc + (int)scaledIndex * 8)); } else { local_18[0] = seedEffect; std_set_int_erase_key(&(g_menuManager->_seedsObject)._seedEffects,(int *)local_18); } } } LAB_008f0594: menuManager = g_menuManager; local_24 = 9; std::set::find_node(local_30,&local_24); if (((*(char *)((int)seedEffectNode + 0xd) == '\0') && (*(int *)((int)seedEffectNode + 0x10) < 10) ) && (seedEffectNode != (menuManager->_seedsObject)._seedEffects)) { seedEffectSet->HoldInputTimer = seedEffectSet->HoldInputTimer + 1; if (0x1e < seedEffectSet->HoldInputTimer) { seedEffectSet->HoldInputTimer = 0x1e; } } else { seedEffectSet->HoldInputTimer = 0; } local_24 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_24,0,0); if (isActionTriggered == '\0') { local_20[0] = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_20,0,0); if (isActionTriggered == '\0') { seedEffectSet->PositionY = 0.0; goto LAB_008f0642; } } seedEffectSet->PositionY = (float)((int)seedEffectSet->PositionY + 1); LAB_008f0642: menuManager = g_menuManager; entries = seedEffectSet[1].SpecialSeedsSprite._filename._capacity; fVar4 = DAT_00c35e24 + *(float *)(entries + 8 + (int)seedEffectSet->PositionX * 0x28) + DAT_00c35e4c; fVar5 = DAT_00c35e20 + *(float *)(entries + 4 + (int)seedEffectSet->PositionX * 0x28) + _DAT_00c35e48; seedEffectSet->SelectedElement = (int)fVar4; seedEffectSet->State = (int)fVar5; menuManager->_viewPositionSet[6].x = *(float *)&menuManager->field_0xf6fc; menuManager->_viewPositionSet[6].y = *(float *)&menuManager->field_0xf700; menuManager->_state = 1; if (135.0 < fVar4) { menuManager->_viewPositionSet[6].y = menuManager->_viewPositionSet[6].y - (fVar4 - 135.0); } return; } //@@ 008f06e0 Menu_SpecialSeeds::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: PaperTop/PaperMiddle/PaperBottom, NoAchievement, {numseeds}, Seeds::CanAddSeedEffect, string_scramble_seeded; called from menu render dispatcher FUN_0098a040 prototype: db/protos.zhl */ void __thiscall Menu_SpecialSeeds::Render(Menu_SpecialSeeds *sprite) { code *pcVar1; KColor color; byte bVar2; char isEffectAddable; undefined4 *nullFrame; int iVar3; void *pvVar4; uint uVar5; float *nullFrameOffset; int *setFindResult; byte *text; Font *needle; int iVar6; AnimationState *otherAnimState; byte *****pppppbVar7; byte *****strChar; ANM2 *sprite; float fVar8; float paperBottomY; char acStackY_640 [128]; byte *****in_stack_fffffa4c; Seeds *in_stack_fffffa50; float textBuf2; undefined1 *textSize; void *local_588; int local_57c; undefined1 local_578 [8]; void *local_570; void *local_564; void *local_558; undefined1 local_554 [20]; undefined8 local_540; byte *****local_530; byte ****ppppbStack_52c; undefined8 uStack_528; undefined4 local_520; ANM2 *spriteCopy; float colorAlpha; Vector cursorPos; Vector noAchievementPos; Vector checkmarkPos; float local_4f4; byte *****local_4f0; byte ****ppppbStack_4ec; byte ****ppppbStack_4e8; byte ****ppppbStack_4e4; Seeds *local_4e0; byte *****pppppbStack_4dc; float local_4d8; Menu_SpecialSeeds *self; uint checkmarkSeed; float local_4cc; float baseY; float baseX; int *seedEntry; float local_4bc; float local_4b8; float local_4b4; byte *****local_4b0; float local_4ac; float local_4a8; char isChecked; Vector local_4a0; Font *local_494; Seeds *local_490; byte *****numSeedsText [4]; uint numSeedsTextSize; uint numSeedsTextCapacity; byte *****displayName; byte ****ppppbStack_470; byte ****ppppbStack_46c; byte ****ppppbStack_468; Vector local_464; undefined4 local_45c; Font local_458 [14]; byte local_27 [3]; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int *comboBan; MenuManager *menuManager; puStack_20 = local_27 + 0x23; local_14 = -1; puStack_18 = &LAB_00b07527; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(local_27 + 0x17); ExceptionList = &local_1c; sprite = &sprite->SpecialSeedsSprite; baseX = (g_menuManager->_ViewPosition).x + *(float *)&sprite->field_0x14; baseY = (g_menuManager->_ViewPosition).y + *(float *)&sprite->field_0x18; local_4a0.y = baseY; local_4a0.x = baseX; spriteCopy = sprite; self = sprite; nullFrame = (undefined4 *)ANM2::GetNullFrame(sprite); local_494 = (Font *)*nullFrame; local_4d8 = (float)nullFrame[1]; textBuf2 = 1.3135225e-38; iVar3 = ANM2::GetNullFrame(sprite); local_490 = *(Seeds **)(iVar3 + 4); bVar2 = ANM2::SetAnimation(sprite,(byte *)"PaperTop",1); if (((bVar2 != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(sprite->SpecialSeedsSprite)._animState,0.0), (sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) { (sprite->SpecialSeedsSprite)._animState._isPlaying = 0; } if ((sprite->SpecialSeedsSprite)._loaded != 0) { if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero); textBuf2 = 1.3135514e-38; AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero, &g_vectorZero); baseY = local_4a0.y; baseX = local_4a0.x; } else { AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero, &g_vectorZero); textBuf2 = 1.313541e-38; AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero); baseY = local_4a0.y; baseX = local_4a0.x; } } paperBottomY = DAT_00c35e4c + *(float *)(*(int *)sprite[1].SpecialSeedsSprite._animDefaultName._buf + -0x20); fVar8 = (local_4d8 + (float)local_490) - DAT_00c35e24; local_4a0.y = baseY + local_4d8; local_4a0.x = baseX + (float)local_494; local_4bc = 2.478522e-32; uStack_528 = 0x900000005; local_4d8 = 9.80909e-45; checkmarkSeed = 0x512578; local_540 = 0x900000005; local_4b4 = fVar8; local_4a8 = paperBottomY; pvVar4 = ANM2::GetAnimationData(sprite,(byte *)"PaperMiddle"); local_490 = *(Seeds **)((int)pvVar4 + 0x30); if (fVar8 < paperBottomY) { do { if (local_4bc == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar5 = (uint)local_4bc >> ((byte)uStack_528 & 0x1f) ^ (uint)local_4bc; uVar5 = uVar5 << ((byte)((ulonglong)uStack_528 >> 0x20) & 0x1f) ^ uVar5; local_4bc = (float)(uVar5 >> (SUB41(local_4d8,0) & 0x1f) ^ uVar5); if (local_490 == (Seeds *)0x0) { local_4b8 = 0.0; } else { local_4b8 = (float)((uint)local_4bc % (uint)local_490); } textBuf2 = 1.3136013e-38; nullFrameOffset = (float *)ANM2::GetNullFrame(sprite); local_4ac = *nullFrameOffset; local_494 = (Font *)nullFrameOffset[1]; if (local_4a8 < (float)local_494 + local_4b4) { local_4b8 = 5.60519e-45; textBuf2 = 1.3136112e-38; nullFrameOffset = (float *)ANM2::GetNullFrame(sprite); local_4ac = *nullFrameOffset; local_494 = (Font *)nullFrameOffset[1]; } bVar2 = ANM2::SetAnimation(sprite,(byte *)"PaperMiddle",1); if (((bVar2 != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&(sprite->SpecialSeedsSprite)._animState,(float)(int)local_4b8), (sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) { (sprite->SpecialSeedsSprite)._animState._isPlaying = 0; } if ((sprite->SpecialSeedsSprite)._loaded != 0) { if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState; } else { AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero, &g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._animState; } textBuf2 = 1.3136348e-38; AnimationState::Render(otherAnimState,&local_4a0,&g_vectorZero,&g_vectorZero); } local_4b4 = (float)local_494 + local_4b4; local_4a0.y = local_4a0.y + (float)local_494; local_4a0.x = local_4a0.x + local_4ac; } while (local_4b4 < local_4a8); } bVar2 = ANM2::SetAnimation(sprite,(byte *)"PaperBottom",1); if (((bVar2 != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(sprite->SpecialSeedsSprite)._animState,0.0), (sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) { (sprite->SpecialSeedsSprite)._animState._isPlaying = 0; } if ((sprite->SpecialSeedsSprite)._loaded != 0) { if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState; } else { AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero, &g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._animState; } textBuf2 = 1.3136662e-38; AnimationState::Render(otherAnimState,&local_4a0,&g_vectorZero,&g_vectorZero); } iVar6 = *(int *)sprite[1].SpecialSeedsSprite._animDefaultName._buf - sprite[1].SpecialSeedsSprite._filename._capacity; local_4a8 = 0.0; iVar3 = iVar6 >> 0x1f; if (iVar6 / 0x28 + iVar3 != iVar3) { do { uVar5 = sprite[1].SpecialSeedsSprite._filename._capacity; isChecked = '\0'; local_4b8 = *(float *)(uVar5 + 4 + (int)local_4a8 * 0x28); seedEntry = (int *)(uVar5 + (int)local_4a8 * 0x28); local_4b4 = (float)*seedEntry; local_4bc = (float)seedEntry[2]; if (((local_4b4 == 4.2039e-45) || (local_4b4 == 2.8026e-45)) || (local_4b4 == 1.4013e-45)) { local_4ac = -NAN; if (local_4b4 == 4.2039e-45) { local_494 = (Font *)seedEntry[3]; local_490 = &g_menuManager->_seedsObject; std::set::find_node(); if ((*(char *)((int)local_558 + 0xd) == '\0') && (*(int *)((int)local_558 + 0x10) <= (int)local_494)) { pvVar4 = local_558; } else { pvVar4 = local_490->_seedEffects; } if (pvVar4 == local_490->_seedEffects) { isEffectAddable = Seeds::CanAddSeedEffect(); if (isEffectAddable == '\0') { local_4ac = -NAN; } } else { fVar8 = sprite->PositionX; local_490 = (Seeds *)((int)fVar8 * 5); uVar5 = sprite[1].SpecialSeedsSprite._filename._capacity; iVar3 = *(int *)(uVar5 + (int)fVar8 * 0x28); if (iVar3 == 3) { local_490 = *(Seeds **)(uVar5 + 0xc + (int)fVar8 * 0x28); if ((local_494 < (Font *)&DAT_00000050) && (local_490 < &DAT_00000050)) { comboBan = (int *)((int)g_seedComboBans + (int)local_494 * 8); setFindResult = (int *)std::set::find(); sprite = self; if (*setFindResult == *comboBan) goto LAB_008f0d31; } } else if (iVar3 != 1) { LAB_008f0d31: local_4ac = -2.4216445e+38; goto LAB_008f0d3c; } local_4ac = -NAN; } } else if ((local_4b4 == 2.8026e-45) || (local_4b4 == 1.4013e-45)) goto LAB_008f0d31; LAB_008f0d3c: if (checkmarkSeed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } checkmarkSeed = checkmarkSeed >> ((byte)local_540 & 0x1f) ^ checkmarkSeed; checkmarkSeed = checkmarkSeed << ((byte)((ulonglong)local_540 >> 0x20) & 0x1f) ^ checkmarkSeed; checkmarkSeed = checkmarkSeed >> (SUB41(local_4d8,0) & 0x1f) ^ checkmarkSeed; local_490 = (Seeds *)(checkmarkSeed % 3); bVar2 = ANM2::SetAnimation(sprite,(byte *)"Checkmark",1); if (((bVar2 != 0) && ((sprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&sprite->_animState,(float)(int)local_490), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } if (local_4b4 == 4.2039e-45) { local_490 = (Seeds *)&(g_menuManager->_seedsObject)._seedEffects; local_494 = (Font *)seedEntry[3]; std::set::find_node(); if ((*(char *)((int)local_564 + 0xd) == '\0') && (*(int *)((int)local_564 + 0x10) <= seedEntry[3])) { pvVar4 = local_564; } else { pvVar4 = *(void **)local_490; } if (pvVar4 != *(void **)local_490) { isChecked = '\x01'; checkmarkPos.x = baseX + local_4b8 + DAT_00c35e20 + _DAT_00c35e28; checkmarkPos.y = baseY + local_4bc + DAT_00c35e24 + _DAT_00c35e2c; if ((sprite->SpecialSeedsSprite)._loaded != 0) { if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&checkmarkPos,&g_vectorZero, &g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState; } else { AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&checkmarkPos,&g_vectorZero ,&g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._animState; } textBuf2 = 1.3137847e-38; AnimationState::Render(otherAnimState,&checkmarkPos,&g_vectorZero,&g_vectorZero); } } } SpecialSeed::get_display_name(); local_14 = 0; text = (byte *)FUN_008f2b70(); numSeedsTextSize = 0; numSeedsTextCapacity = 0xf; numSeedsText[0] = (byte *****)0x0; if (text != local_27) { std::string::assign((char *)numSeedsText,text,(int)local_27 - (int)text); } local_458[0]._lineHeight = 0xf; local_458[0]._base = 0; local_458[0]._spacingVert = 10; local_458[0]._outline = 0; local_458[0]._18_2_ = 0; local_458[0]._isLoaded = 0x7b; local_458[0]._1_3_ = 0x6d756e; local_458[0]._fontSize = 0x6573; local_458[0]._infoBitField = 0x65; local_458[0]._charSet = 100; local_458[0]._stretchH = 0x7d73; local_458[0]._aa = 0; local_14._0_1_ = 2; fVar8 = local_464.x; local_494 = (Font *)&displayName; if (0xf < (uint)local_464.y) { local_494 = (Font *)displayName; } local_4f0 = (byte *****)0x0; local_4e0 = (Seeds *)0x0; pppppbStack_4dc = (byte *****)0x0; local_490 = (Seeds *)local_464.x; if (&DAT_0000000f < (uint)local_464.x) { local_4b0 = (byte *****)((uint)local_464.x | 0xf); if ((byte *****)0x7fffffff < local_4b0) { local_4b0 = (byte *****)0x7fffffff; } local_4f0 = std::_Allocate((uint)((int)local_4b0 + 1)); textBuf2 = 1.3138286e-38; memcpy(local_4f0,local_494,(size_t)((int)fVar8 + 1)); pppppbStack_4dc = local_4b0; } else { local_4f0 = *(byte ******)local_494; ppppbStack_4ec = *(byte *****)((int)local_494 + 4); ppppbStack_4e8 = *(byte *****)((int)local_494 + 8); ppppbStack_4e4 = *(byte *****)((int)local_494 + 0xc); pppppbStack_4dc = (byte *****)&DAT_0000000f; } uStack_528 = CONCAT44(ppppbStack_4e4,ppppbStack_4e8); local_4e0 = (Seeds *)fVar8; local_14._0_1_ = 3; local_494 = (Font *)local_458[0]._0_4_; local_490 = local_4e0; if ((Seeds *)fVar8 != (Seeds *)0x0) { uVar5 = 0; local_530 = local_4f0; ppppbStack_52c = ppppbStack_4ec; while( true ) { needle = local_458; if (0xf < (uint)local_458[0]._20_4_) { needle = local_494; } pppppbVar7 = (byte *****)&local_4f0; if (&DAT_0000000f < pppppbStack_4dc) { pppppbVar7 = local_4f0; } textBuf2 = 1.3138455e-38; uVar5 = std::string::find((byte *)pppppbVar7,(uint)local_4e0,uVar5,&needle->_isLoaded,10 ); if (uVar5 == 0xffffffff) break; pppppbVar7 = (byte *****)numSeedsText; if (0xf < numSeedsTextCapacity) { pppppbVar7 = numSeedsText[0]; } in_stack_fffffa50 = (Seeds *)0x8f10e2; std::string::replace((char *)&local_4f0,uVar5,10,(byte *)pppppbVar7,numSeedsTextSize); uVar5 = uVar5 + numSeedsTextSize; } sprite = spriteCopy; } local_530 = local_4f0; uStack_528 = CONCAT44(ppppbStack_4e4,ppppbStack_4e8); local_4f0 = (byte *****)((uint)local_4f0 & 0xffffff00); local_4a0.y = (float)pppppbStack_4dc; local_4a0.x = (float)local_4e0; pppppbStack_4dc = (byte *****)0xf; local_4e0 = (Seeds *)0x0; ppppbStack_52c = ppppbStack_4ec; std::string::_Tidy_deallocate((char *)&displayName); displayName = local_530; ppppbStack_470 = ppppbStack_52c; ppppbStack_46c = (byte ****)uStack_528; ppppbStack_468 = uStack_528._4_4_; local_458[0]._lineHeight = 0xf; local_458[0]._base = 0; local_14 = (uint)local_14._1_3_ << 8; local_464 = local_4a0; local_458[0]._spacingVert = 0; local_458[0]._outline = 0; local_458[0]._18_2_ = 0; local_458[0]._0_8_ = local_458[0]._0_8_ & 0xffffffffffffff00; if (0xf < numSeedsTextCapacity) { uVar5 = numSeedsTextCapacity + 1; pppppbVar7 = numSeedsText[0]; if (0xfff < uVar5) { pppppbVar7 = (byte *****)numSeedsText[0][-1]; uVar5 = numSeedsTextCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)numSeedsText[0] + (-4 - (int)pppppbVar7))) goto LAB_008f19db; } operator_delete(pppppbVar7,uVar5); } menuManager = g_menuManager; pppppbVar7 = (byte *****)&local_4b0; textSize = local_578; numSeedsTextSize = 0; numSeedsTextCapacity = 0xf; numSeedsText[0] = (byte *****)((uint)numSeedsText[0] & 0xffffff00); local_4b0 = (byte *****)&DAT_00000009; iVar3 = 0x8f1223; std::set::find_node(); sprite = self; if ((*(char *)((int)local_570 + 0xd) != '\0') || (pvVar4 = local_570, 9 < *(int *)((int)local_570 + 0x10))) { pvVar4 = (menuManager->_seedsObject)._seedEffects; } if (((pvVar4 != (menuManager->_seedsObject)._seedEffects) && (self->HoldInputTimer - 1U < 0x1d)) && (*(int *)&g_manager->_stringTable == 0)) { std::string::string(acStackY_640 + 0x8c,&displayName); local_4b0 = string_scramble_seeded (local_458,in_stack_fffffa4c,(int)in_stack_fffffa50,(int)textBuf2, iVar3,(uint)textSize,(uint)pppppbVar7); if (&displayName != (byte ******)local_4b0) { if (0xf < (uint)local_464.y) { uVar5 = (int)local_464.y + 1; pppppbVar7 = displayName; if (0xfff < uVar5) { pppppbVar7 = (byte *****)displayName[-1]; uVar5 = (int)local_464.y + 0x24; if ((byte *)0x1f < (byte *)((int)displayName + (-4 - (int)pppppbVar7))) goto LAB_008f19db; } operator_delete(pppppbVar7,uVar5); } displayName = (byte *****)*local_4b0; ppppbStack_470 = local_4b0[1]; ppppbStack_46c = local_4b0[2]; ppppbStack_468 = local_4b0[3]; local_464 = *(Vector *)(local_4b0 + 4); local_4b0[4] = (byte ****)0x0; local_4b0[5] = (byte ****)0xf; *(byte *)local_4b0 = 0; } if (0xf < (uint)local_458[0]._20_4_) { uVar5 = local_458[0]._20_4_ + 1; pvVar4 = (void *)local_458[0]._0_4_; if (0xfff < uVar5) { pvVar4 = *(void **)(local_458[0]._0_4_ + -4); uVar5 = local_458[0]._20_4_ + 0x24; if (0x1f < (uint)(local_458[0]._0_4_ + (-4 - (int)pvVar4))) goto LAB_008f19db; } operator_delete(pvVar4,uVar5); } local_458[0]._spacingVert = 0; local_458[0]._outline = 0; local_458[0]._18_2_ = 0; local_458[0]._lineHeight = 0xf; local_458[0]._base = 0; local_458[0]._0_8_ = local_458[0]._0_8_ & 0xffffffffffffff00; } pppppbVar7 = (byte *****)&displayName; if (((uint)local_464.y < 0x10) || (pppppbVar7 = displayName, displayName != (byte *****)0x0) ) { local_4b0 = (byte *****)((int)pppppbVar7 + 1); strChar = pppppbVar7; do { bVar2 = *(byte *)strChar; strChar = (byte *****)((int)strChar + 1); } while (bVar2 != 0); iVar3 = (int)strChar - (int)local_4b0; } else { iVar3 = 0; } text_convert_encoding((byte *)pppppbVar7,iVar3,0,&local_458[0]._scaleW,0x200,1); local_494 = &g_manager->_font2_TeamMeatEx12; if (((local_4b4 != 1.4013e-45) && (local_4b4 != 2.8026e-45)) && ((*(int *)&g_manager->_stringTable != 2 && (*(int *)&g_manager->_stringTable != 0xb)))) { local_494 = &g_manager->_font1_TeamMeatEx10; } local_45c = 0; local_458[0]._isLoaded = 0xff; local_458[0]._1_3_ = 0xff; local_458[0]._fontSize = 0; local_458[0]._infoBitField = 0; local_458[0]._charSet = 0; local_4cc = baseX + DAT_00c35e20 + local_4b8; local_4f4 = baseY + DAT_00c35e24 + local_4bc; local_458[0]._stretchH = 0; local_458[0]._aa = 0x80; local_458[0]._paddingUp = 0x3f; local_458[0]._paddingRight = 0xff; local_458[0]._paddingDown = 0xff; local_458[0]._paddingLeft = 0xff; local_458[0]._spacingHoriz = 0xff; local_458[0]._spacingVert = 0; local_458[0]._outline = 0; local_458[0]._18_2_ = 0; local_458[0]._lineHeight = 0; local_458[0]._base = 0; local_14._0_1_ = 4; local_520 = 0; local_4b0 = (byte *****)(((float)((uint)local_4ac >> 0x10 & 0xff) + 0.0) / 255.0); uVar5 = (uint)local_4ac >> 0x18; local_490 = (Seeds *)(((float)((uint)local_4ac >> 8 & 0xff) + 0.0) / 255.0); local_4ac = ((float)((uint)local_4ac & 0xff) + 0.0) / 255.0; colorAlpha = ((float)uVar5 + 0.0) / 255.0; pvVar4 = Font::layout_glyphs(local_494,local_554,(byte *)&local_458[0]._scaleW,&local_45c, &g_vectorOne); local_14._0_1_ = 5; color._green = (float)local_490; color._red = (float)local_4b0; color._blue = local_4ac; color._alpha = colorAlpha; color._unk = 0; in_stack_fffffa4c = local_4b0; in_stack_fffffa50 = local_490; textBuf2 = local_4ac; Font::draw_glyph_run(local_494,local_4cc,local_4f4,pvVar4,1.0,1.0,color,&local_45c); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14 = (uint)local_14._1_3_ << 8; local_458[0]._spacingVert = 0; local_458[0]._outline = 0; local_458[0]._18_2_ = 0; local_458[0]._lineHeight = 0; local_458[0]._base = 0; iVar3 = Font::get_string_width_utf16(local_494,&local_458[0]._scaleW,-1); local_4f4 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]); if (local_4b4 == 2.8026e-45) { bVar2 = Seeds::AchievementUnlocksDisallowed(&g_menuManager->_seedsObject); if (bVar2 == 0) goto LAB_008f1841; local_490 = (Seeds *)0x0; if (local_4b4 == 4.2039e-45) goto LAB_008f16e0; LAB_008f174b: bVar2 = ANM2::SetAnimation(sprite,(byte *)"NoAchievement",1); if (((bVar2 != 0) && ((sprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&sprite->_animState,(float)(int)local_490), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } noAchievementPos.x = DAT_00c35e38 + baseX + local_4b8 + DAT_00c35e20 + local_4f4; noAchievementPos.y = DAT_00c35e3c + baseY + local_4bc + DAT_00c35e24 + 0.0; if ((sprite->SpecialSeedsSprite)._loaded != 0) { if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&noAchievementPos,&g_vectorZero, &g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState; } else { AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&noAchievementPos, &g_vectorZero,&g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._animState; } textBuf2 = 1.3141177e-38; AnimationState::Render(otherAnimState,&noAchievementPos,&g_vectorZero,&g_vectorZero); } } else if (local_4b4 == 4.2039e-45) { local_4cc = (float)seedEntry[3]; std::set::find_node(); if (*(char *)(local_57c + 0xd) == '\0') { sprite = &sprite->SpecialSeedsSprite; iVar3 = local_57c; if (seedEntry[3] < *(int *)(local_57c + 0x10)) goto LAB_008f16d6; } else { LAB_008f16d6: iVar3 = DAT_00c798d0; } if (iVar3 != DAT_00c798d0) { LAB_008f16e0: local_490 = (Seeds *)&(g_menuManager->_seedsObject)._seedEffects; local_4cc = (float)seedEntry[3]; std::set::find_node(); if ((*(char *)((int)local_588 + 0xd) == '\0') && (*(int *)((int)local_588 + 0x10) <= seedEntry[3])) { pvVar4 = local_588; } else { pvVar4 = *(void **)local_490; } local_490 = (Seeds *)(uint)(pvVar4 == *(void **)local_490); goto LAB_008f174b; } } LAB_008f1841: local_14 = -1; if (0xf < (uint)local_464.y) { uVar5 = (int)local_464.y + 1; pppppbVar7 = displayName; if (0xfff < uVar5) { pppppbVar7 = (byte *****)displayName[-1]; uVar5 = (int)local_464.y + 0x24; if ((byte *)0x1f < (byte *)((int)displayName + (-4 - (int)pppppbVar7))) { LAB_008f19db: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar7,uVar5); } } if (local_4a8 == sprite->PositionX) { bVar2 = ANM2::SetAnimation(sprite,(byte *)"Cursor",1); if (((bVar2 != 0) && ((sprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&sprite->_animState,0.0), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } cursorPos.x = 0.0; if (isChecked == '\0') { cursorPos.x = 16.0; } cursorPos.x = baseX + local_4b8 + DAT_00c35e20 + _DAT_00c35e30 + cursorPos.x; cursorPos.y = baseY + local_4bc + DAT_00c35e24 + _DAT_00c35e34 + 0.0; if ((sprite->SpecialSeedsSprite)._loaded != 0) { if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(sprite->SpecialSeedsSprite)._animState,&cursorPos,&g_vectorZero,&g_vectorZero ); otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState; } else { AnimationState::Render (&(sprite->SpecialSeedsSprite)._overlayAnimState,&cursorPos,&g_vectorZero, &g_vectorZero); otherAnimState = &(sprite->SpecialSeedsSprite)._animState; } textBuf2 = 1.3141633e-38; AnimationState::Render(otherAnimState,&cursorPos,&g_vectorZero,&g_vectorZero); } } local_4a8 = (float)((int)local_4a8 + 1); } while ((uint)local_4a8 < (uint)((int)(*(int *)sprite[1].SpecialSeedsSprite._animDefaultName._buf - sprite[1].SpecialSeedsSprite._filename._capacity) / 0x28)); } ExceptionList = local_1c; return; } //@@ 008f19f0 Menu_SpecialSeeds::Reset /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? this=Menu_SpecialSeeds: zeroes +0xc/+0x10, loads seedmenu.xml layout entries (vector +0x160 stride 0x28, nodes seedmenu/entryDialog/spacer, attrs name/unlock/enable/confirm/reset); called by Menu_SpecialSeeds::Update 008f01b0 Menu_SpecialSeeds::Update by MenuManager menu-stack setup 0098aa30 MenuManager::SetState state==6 prototype: db/protos.zhl */ void __thiscall Menu_SpecialSeeds::Reset(Menu_SpecialSeeds *this) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; byte bVar4; uint uVar5; int *file; int iVar6; byte *text; void *pvVar7; byte *attrNameChar; int ******implementedChars; char *pcVar8; byte *pbVar9; Menu_SpecialSeeds *targetString; byte *pbVar10; int entriesBytes; qword *allocatedBytes; uint entryIter; undefined4 *puVar11; float *entryPos; undefined4 *puVar12; uint uVar13; bool bVar14; bool isLess; float layoutX; float layoutY; byte *pbVar15; undefined4 *eraseDst; undefined4 *eraseSrc; undefined1 xmlDoc [48]; undefined1 auStack_10080 [65564]; int ******implementedText [4]; int implementedTextSize; uint implementedTextCapacity; undefined4 newEntryType; undefined4 local_48; undefined4 local_44; int newEntryId; void *newEntryName; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 newEntryNameSize; uint newEntryNameCapacity; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int *****local_14; int entryType; std_string *entriesEndField; Manager *manager; MenuManager *menuManager; qword oldAllocated; menuManager = g_menuManager; puStack_20 = (undefined1 *)(implementedText + 0x18); local_14 = (int *****)0xffffffff; puStack_18 = &LAB_00b07590; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(implementedText + 0x15); ExceptionList = &local_1c; this->PositionX = 0.0; this->PositionY = 0.0; menuManager->_viewPositionSet[7].y = -216.0; menuManager->_state = 1; stackCookie = uVar5; file = FileSystem::Open(&PTR_vftable_00c37a10,(byte *)"seedmenu.xml",(int *)0x0); if (file == (int *)0x0) { KAGE_LogMessage(1,(byte *)"ERROR Could not read seed menu layout\n"); } else { uVar13 = *(uint *)this[1].SpecialSeedsSprite._animDefaultName._buf; entryIter = this[1].SpecialSeedsSprite._filename._capacity; if (entryIter != uVar13) { do { std::string::_Tidy_deallocate((char *)(entryIter + 0x10)); entryIter = entryIter + 0x28; } while (entryIter != uVar13); entryIter = this[1].SpecialSeedsSprite._filename._capacity; } *(uint *)this[1].SpecialSeedsSprite._animDefaultName._buf = entryIter; iVar6 = (**(code **)(*file + 4))(uVar5); text = operator_new_tracked(iVar6 + 1); (**(code **)(*file + 0x14))(text,1,iVar6); text[iVar6] = 0; (**(code **)*file)(1); FUN_00413b90(); local_14 = (int *****)0x0; pbVar15 = (byte *)0x8f1b22; pbVar9 = text; rapidxml::xml_document::parse(xmlDoc,text); pvVar7 = xml_node::first_node(xmlDoc,(byte *)"entryDialog",(int)pbVar15,(byte)pbVar9); for (puVar12 = *(undefined4 **)((int)pvVar7 + 0x20); bVar4 = (byte)pbVar9, puVar12 != (undefined4 *)0x0; puVar12 = (undefined4 *)puVar12[6]) { pbVar10 = (byte *)*puVar12; pcVar8 = "unlock"; attrNameChar = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { attrNameChar = pbVar10; } do { bVar4 = *attrNameChar; bVar14 = bVar4 < (byte)*pcVar8; if (bVar4 != *pcVar8) { LAB_008f1b71: uVar5 = -(uint)bVar14 | 1; goto LAB_008f1b76; } if (bVar4 == 0) break; bVar4 = attrNameChar[1]; bVar14 = bVar4 < (byte)pcVar8[1]; if (bVar4 != pcVar8[1]) goto LAB_008f1b71; attrNameChar = attrNameChar + 2; pcVar8 = pcVar8 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f1b76: if (uVar5 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar12[1] != (byte *)0x0) { pbVar15 = (byte *)puVar12[1]; } pbVar9 = pbVar15; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); pbVar9 = pbVar9 + -(int)(pbVar15 + 1); targetString = this + 1; LAB_008f1c08: std::string::assign((char *)targetString,pbVar15,(uint)pbVar9); } else { pcVar8 = "enable"; attrNameChar = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { attrNameChar = pbVar10; } do { bVar4 = *attrNameChar; bVar14 = bVar4 < (byte)*pcVar8; if (bVar4 != *pcVar8) { LAB_008f1bd7: uVar5 = -(uint)bVar14 | 1; goto LAB_008f1bdc; } if (bVar4 == 0) break; bVar4 = attrNameChar[1]; bVar14 = bVar4 < (byte)pcVar8[1]; if (bVar4 != pcVar8[1]) goto LAB_008f1bd7; attrNameChar = attrNameChar + 2; pcVar8 = pcVar8 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f1bdc: if (uVar5 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar12[1] != (byte *)0x0) { pbVar15 = (byte *)puVar12[1]; } pbVar9 = pbVar15; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); pbVar9 = pbVar9 + -(int)(pbVar15 + 1); targetString = (Menu_SpecialSeeds *)&this[1].field_0x18; goto LAB_008f1c08; } } bVar4 = (byte)pbVar9; if (puVar12[4] == 0) break; } pvVar7 = xml_node::first_node(xmlDoc,(byte *)"seedmenu",(int)pbVar15,bVar4); for (puVar12 = *(undefined4 **)((int)pvVar7 + 0x18); puVar12 != (undefined4 *)0x0; puVar12 = (undefined4 *)puVar12[0xb]) { pbVar15 = (byte *)*puVar12; pcVar8 = "reset"; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; bVar14 = bVar4 < (byte)*pcVar8; if (bVar4 != *pcVar8) { LAB_008f1c77: uVar5 = -(uint)bVar14 | 1; goto LAB_008f1c7c; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar14 = bVar4 < (byte)pcVar8[1]; if (bVar4 != pcVar8[1]) goto LAB_008f1c77; pbVar9 = pbVar9 + 2; pcVar8 = pcVar8 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f1c7c: if (uVar5 == 0) { local_48 = 0; local_44 = 0; newEntryId = 0; newEntryNameSize = 0; newEntryNameCapacity = 0xf; newEntryName = (void *)0x0; local_14._1_3_ = (uint3)((uint)local_14 >> 8); local_14 = (int *****)CONCAT31(local_14._1_3_,1); newEntryType = 1; pbVar15 = s_name; do { pbVar9 = pbVar15; pbVar15 = pbVar9 + 1; } while (*pbVar15 != 0); puVar11 = (undefined4 *)puVar12[8]; if (puVar11 != (undefined4 *)0x0) { LAB_008f1cd0: pbVar15 = (byte *)*puVar11; if (pbVar15 == (byte *)0x0) { pbVar10 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar10 = (byte *)puVar11[2]; } if (pbVar10 != pbVar9 + -0xb1c13b) goto LAB_008f1d83; pbVar10 = pbVar10 + (int)pbVar15; if (pbVar15 < pbVar10) { iVar6 = (int)s_name - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar10 <= pbVar15) goto LAB_008f1d10; } goto LAB_008f1d83; } LAB_008f1d10: pbVar15 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar15 = (byte *)puVar11[1]; } pbVar9 = pbVar15; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); std::string::assign((char *)&newEntryName,pbVar15,(int)pbVar9 - (int)(pbVar15 + 1)); } LAB_008f1d45: puVar11 = *(undefined4 **)this[1].SpecialSeedsSprite._animDefaultName._buf; if (puVar11 == *(undefined4 **)(this[1].SpecialSeedsSprite._animDefaultName._buf + 4)) { FUN_008f28c0(puVar11,&newEntryType); } else { puVar11[3] = newEntryId; *puVar11 = newEntryType; puVar11[1] = local_48; puVar11[2] = local_44; std::string::string((char *)(puVar11 + 4),&newEntryName); entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName; *(int *)entriesEndField->_buf = *(int *)entriesEndField->_buf + 0x28; } local_14 = (int *****)((uint)local_14 & 0xffffff00); if (0xf < newEntryNameCapacity) { uVar5 = newEntryNameCapacity + 1; pvVar7 = newEntryName; if (0xfff < uVar5) { pvVar7 = *(void **)((int)newEntryName + -4); uVar5 = newEntryNameCapacity + 0x24; if (0x1f < (uint)((int)newEntryName + (-4 - (int)pvVar7))) goto LAB_008f2464; } operator_delete(pvVar7,uVar5); } pbVar15 = (byte *)*puVar12; } pcVar8 = "confirm"; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; bVar14 = bVar4 < (byte)*pcVar8; if (bVar4 != *pcVar8) { LAB_008f1e12: uVar5 = -(uint)bVar14 | 1; goto LAB_008f1e17; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar14 = bVar4 < (byte)pcVar8[1]; if (bVar4 != pcVar8[1]) goto LAB_008f1e12; pbVar9 = pbVar9 + 2; pcVar8 = pcVar8 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f1e17: if (uVar5 == 0) { local_48 = 0; local_44 = 0; newEntryId = 0; newEntryNameSize = 0; newEntryNameCapacity = 0xf; newEntryName = (void *)0x0; local_14 = (int *****)CONCAT31(local_14._1_3_,2); newEntryType = 2; pbVar15 = s_name; do { pbVar9 = pbVar15; pbVar15 = pbVar9 + 1; } while (*pbVar15 != 0); puVar11 = (undefined4 *)puVar12[8]; if (puVar11 != (undefined4 *)0x0) { LAB_008f1e70: pbVar15 = (byte *)*puVar11; if (pbVar15 == (byte *)0x0) { pbVar10 = (byte *)0x0; pbVar15 = &g_xmlNullStr; } else { pbVar10 = (byte *)puVar11[2]; } if (pbVar10 != pbVar9 + -0xb1c13b) goto LAB_008f1f23; pbVar10 = pbVar10 + (int)pbVar15; if (pbVar15 < pbVar10) { iVar6 = (int)s_name - (int)pbVar15; while (*pbVar15 == pbVar15[iVar6]) { pbVar15 = pbVar15 + 1; if (pbVar10 <= pbVar15) goto LAB_008f1eb0; } goto LAB_008f1f23; } LAB_008f1eb0: pbVar15 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar15 = (byte *)puVar11[1]; } pbVar9 = pbVar15; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); std::string::assign((char *)&newEntryName,pbVar15,(int)pbVar9 - (int)(pbVar15 + 1)); } LAB_008f1ee5: puVar11 = *(undefined4 **)this[1].SpecialSeedsSprite._animDefaultName._buf; if (puVar11 == *(undefined4 **)(this[1].SpecialSeedsSprite._animDefaultName._buf + 4)) { FUN_008f28c0(puVar11,&newEntryType); } else { puVar11[3] = newEntryId; *puVar11 = newEntryType; puVar11[1] = local_48; puVar11[2] = local_44; std::string::string((char *)(puVar11 + 4),&newEntryName); entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName; *(int *)entriesEndField->_buf = *(int *)entriesEndField->_buf + 0x28; } local_14 = (int *****)((uint)local_14 & 0xffffff00); if (0xf < newEntryNameCapacity) { uVar5 = newEntryNameCapacity + 1; pvVar7 = newEntryName; if (0xfff < uVar5) { pvVar7 = *(void **)((int)newEntryName + -4); uVar5 = newEntryNameCapacity + 0x24; if (0x1f < (uint)((int)newEntryName + (-4 - (int)pvVar7))) goto LAB_008f2464; } operator_delete(pvVar7,uVar5); } pbVar15 = (byte *)*puVar12; } pbVar10 = &DAT_00b658e4; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; bVar14 = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_008f1fb0: uVar5 = -(uint)bVar14 | 1; goto LAB_008f1fb5; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar14 = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_008f1fb0; pbVar9 = pbVar9 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f1fb5: if (uVar5 == 0) { newEntryNameCapacity = 0xf; local_48 = 0; local_44 = 0; newEntryId = 0; newEntryNameSize = 0; newEntryName = (void *)0x0; local_14 = (int *****)CONCAT31(local_14._1_3_,3); puVar11 = (undefined4 *)puVar12[8]; newEntryType = 3; bVar14 = true; for (; puVar11 != (undefined4 *)0x0; puVar11 = (undefined4 *)puVar11[6]) { pbVar15 = (byte *)*puVar11; pbVar10 = s_id; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; isLess = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_008f2038: uVar5 = -(uint)isLess | 1; goto LAB_008f203d; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; isLess = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_008f2038; pbVar9 = pbVar9 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f203d: if (uVar5 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar15 = (byte *)puVar11[1]; } newEntryId = atoi((char *)pbVar15); } else { pbVar10 = s_name; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; isLess = bVar4 < *pbVar10; if (bVar4 != *pbVar10) { LAB_008f2091: uVar5 = -(uint)isLess | 1; goto LAB_008f2096; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; isLess = bVar4 < pbVar10[1]; if (bVar4 != pbVar10[1]) goto LAB_008f2091; pbVar9 = pbVar9 + 2; pbVar10 = pbVar10 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f2096: if (uVar5 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar15 = (byte *)puVar11[1]; } pbVar9 = pbVar15; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); std::string::assign((char *)&newEntryName,pbVar15,(int)pbVar9 - (int)(pbVar15 + 1)); } else { pcVar8 = "implemented"; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; isLess = bVar4 < (byte)*pcVar8; if (bVar4 != *pcVar8) { LAB_008f20f7: uVar5 = -(uint)isLess | 1; goto LAB_008f20fc; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; isLess = bVar4 < (byte)pcVar8[1]; if (bVar4 != pcVar8[1]) goto LAB_008f20f7; pbVar9 = pbVar9 + 2; pcVar8 = pcVar8 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f20fc: if (uVar5 == 0) { implementedText[0] = (int ******)0x0; implementedTextSize = 0; pbVar15 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar15 = (byte *)puVar11[1]; } implementedTextCapacity = 0xf; pbVar9 = pbVar15; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); std::string::assign((char *)implementedText,pbVar15,(int)pbVar9 - (int)(pbVar15 + 1) ); if (implementedTextSize == 0) { LAB_008f2201: bVar14 = false; } else { implementedChars = (int ******)implementedText; if (0xf < implementedTextCapacity) { implementedChars = implementedText[0]; } if (implementedTextSize == 4) { if ((*implementedChars == (int *****)0x65757274) || ((((bVar4 = (byte)*implementedChars, bVar14 = bVar4 < 0x74, bVar4 == 0x74 && (bVar14 = *(byte *)((int)implementedChars + 1) < 0x72, *(byte *)((int)implementedChars + 1) == 0x72)) && (bVar14 = *(byte *)((int)implementedChars + 2) < 0x75, *(byte *)((int)implementedChars + 2) == 0x75)) && (bVar14 = *(byte *)((int)implementedChars + 3) < 0x65, *(byte *)((int)implementedChars + 3) == 0x65)))) { uVar5 = 0; } else { uVar5 = -(uint)bVar14 | 1; } if (uVar5 != 0) goto LAB_008f2199; } else { LAB_008f2199: implementedChars = (int ******)implementedText; if (0xf < implementedTextCapacity) { implementedChars = implementedText[0]; } if (implementedTextSize == 4) { if ((*implementedChars == (int *****)0x65757254) || (((bVar4 = (byte)*implementedChars, bVar14 = bVar4 < 0x54, bVar4 == 0x54 && (bVar14 = *(byte *)((int)implementedChars + 1) < 0x72, *(byte *)((int)implementedChars + 1) == 0x72)) && ((bVar14 = *(byte *)((int)implementedChars + 2) < 0x75, *(byte *)((int)implementedChars + 2) == 0x75 && (bVar14 = *(byte *)((int)implementedChars + 3) < 0x65, *(byte *)((int)implementedChars + 3) == 0x65)))))) { uVar5 = 0; } else { uVar5 = -(uint)bVar14 | 1; } if (uVar5 == 0) goto LAB_008f21f8; } implementedChars = (int ******)implementedText; if (0xf < implementedTextCapacity) { implementedChars = implementedText[0]; } iVar6 = atoi((char *)implementedChars); if (iVar6 == 0) goto LAB_008f2201; } LAB_008f21f8: bVar14 = true; } if (0xf < implementedTextCapacity) { uVar5 = implementedTextCapacity + 1; implementedChars = implementedText[0]; if (0xfff < uVar5) { implementedChars = (int ******)implementedText[0][-1]; uVar5 = implementedTextCapacity + 0x24; if (0x1f < (uint)((int)implementedText[0] + (-4 - (int)implementedChars))) goto LAB_008f2464; } operator_delete(implementedChars,uVar5); } implementedTextSize = 0; implementedTextCapacity = 0xf; implementedText[0] = (int ******)((uint)implementedText[0] & 0xffffff00); } } } if (puVar11[4] == 0) break; } manager = g_manager; if (bVar14) { if (*(char *)((int)(g_manager->_persistentGameData)._cutsceneCounters + newEntryId + 0x74) != '\0') { puVar11 = *(undefined4 **)this[1].SpecialSeedsSprite._animDefaultName._buf; if (puVar11 == *(undefined4 **)(this[1].SpecialSeedsSprite._animDefaultName._buf + 4)) { FUN_008f28c0(puVar11,&newEntryType); } else { *puVar11 = newEntryType; puVar11[1] = local_48; puVar11[2] = local_44; puVar11[3] = newEntryId; std::string::string((char *)(puVar11 + 4),&newEntryName); entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName; *(int *)entriesEndField->_buf = *(int *)entriesEndField->_buf + 0x28; } } } else if ((g_manager->_persistentGameData)._isReadOnly == 0) { *(undefined1 *) ((int)(g_manager->_persistentGameData)._cutsceneCounters + newEntryId + 0x74) = 0; *(undefined1 *)&manager->_persistentGameData = 1; } local_14 = (int *****)((uint)local_14 & 0xffffff00); if (0xf < newEntryNameCapacity) { uVar5 = newEntryNameCapacity + 1; pvVar7 = newEntryName; if (0xfff < uVar5) { pvVar7 = *(void **)((int)newEntryName + -4); uVar5 = newEntryNameCapacity + 0x24; if (0x1f < (uint)((int)newEntryName + (-4 - (int)pvVar7))) goto LAB_008f2464; } operator_delete(pvVar7,uVar5); } pbVar15 = (byte *)*puVar12; } pcVar8 = "spacer"; pbVar9 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar9 = pbVar15; } do { bVar4 = *pbVar9; bVar14 = bVar4 < (byte)*pcVar8; if (bVar4 != *pcVar8) { LAB_008f2360: uVar5 = -(uint)bVar14 | 1; goto LAB_008f2365; } if (bVar4 == 0) break; bVar4 = pbVar9[1]; bVar14 = bVar4 < (byte)pcVar8[1]; if (bVar4 != pcVar8[1]) goto LAB_008f2360; pbVar9 = pbVar9 + 2; pcVar8 = pcVar8 + 2; } while (bVar4 != 0); uVar5 = 0; LAB_008f2365: if ((uVar5 == 0) && (puVar11 = *(undefined4 **)this[1].SpecialSeedsSprite._animDefaultName._buf, puVar11[-10] != 0)) { newEntryType = 0; local_44 = 0; local_48 = 0; newEntryId = 0; newEntryNameSize = 0; newEntryNameCapacity = 0xf; newEntryName = (void *)0x0; local_14._0_1_ = 4; if (puVar11 == *(undefined4 **)(this[1].SpecialSeedsSprite._animDefaultName._buf + 4)) { FUN_008f27b0(puVar11,&newEntryType); } else { *puVar11 = 0; puVar11[1] = 0; puVar11[2] = 0; puVar11[3] = 0; puVar11[8] = 0; puVar11[9] = 0; puVar11[4] = 0; puVar11[5] = uStack_38; puVar11[6] = uStack_34; puVar11[7] = uStack_30; newEntryName = (void *)0x0; puVar11[8] = 0; puVar11[9] = 0xf; entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName; *(int *)entriesEndField->_buf = *(int *)entriesEndField->_buf + 0x28; } local_14 = (int *****)((uint)local_14._1_3_ << 8); if (0xf < newEntryNameCapacity) { uVar5 = newEntryNameCapacity + 1; pvVar7 = newEntryName; if (0xfff < uVar5) { pvVar7 = *(void **)((int)newEntryName + -4); uVar5 = newEntryNameCapacity + 0x24; if (0x1f < (uint)((int)newEntryName + (-4 - (int)pvVar7))) { LAB_008f2464: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } } } puVar12 = *(undefined4 **)this[1].SpecialSeedsSprite._animDefaultName._buf; if (puVar12[-10] == 0) { uVar5 = this[1].SpecialSeedsSprite._filename._capacity; eraseDst = (undefined4 *)(uVar5 + (((int)((int)puVar12 - uVar5) / 0x28) * 5 + -5) * 8); eraseSrc = eraseDst + 10; if (eraseSrc != puVar12) { pcVar8 = (char *)(eraseDst + 4); puVar11 = eraseDst + 0x12; do { *eraseDst = *eraseSrc; *(undefined4 *)(pcVar8 + -0xc) = puVar11[-7]; *(undefined4 *)(pcVar8 + -8) = puVar11[-6]; *(undefined4 *)(pcVar8 + -4) = puVar11[-5]; if (pcVar8 != (char *)(puVar11 + -4)) { std::string::_Tidy_deallocate(pcVar8); uVar1 = puVar11[-3]; uVar2 = puVar11[-2]; uVar3 = puVar11[-1]; *(undefined4 *)pcVar8 = puVar11[-4]; *(undefined4 *)(pcVar8 + 4) = uVar1; *(undefined4 *)(pcVar8 + 8) = uVar2; *(undefined4 *)(pcVar8 + 0xc) = uVar3; uVar1 = puVar11[1]; *(undefined4 *)(pcVar8 + 0x10) = *puVar11; *(undefined4 *)(pcVar8 + 0x14) = uVar1; *puVar11 = 0; puVar11[1] = 0xf; *(undefined1 *)(puVar11 + -4) = 0; } eraseDst = eraseDst + 10; eraseSrc = eraseSrc + 10; pcVar8 = pcVar8 + 0x28; puVar11 = puVar11 + 10; } while (eraseSrc != puVar12); puVar12 = *(undefined4 **)this[1].SpecialSeedsSprite._animDefaultName._buf; } std::string::_Tidy_deallocate((char *)(puVar12 + -6)); entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName; *(int *)entriesEndField->_buf = *(int *)entriesEndField->_buf + -0x28; } local_14 = (int *****)0x5; xml_memory_pool::clear(auStack_10080); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar5 = *(uint *)(text + -4); oldAllocated = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar5; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)oldAllocated < uVar5); free(text + -4); } uVar5 = this[1].SpecialSeedsSprite._filename._capacity; uVar13 = 0; entriesBytes = *(int *)this[1].SpecialSeedsSprite._animDefaultName._buf - uVar5; layoutY = 0.0; layoutX = 0.0; iVar6 = entriesBytes >> 0x1f; if (entriesBytes / 0x28 + iVar6 != iVar6) { entryPos = (float *)(uVar5 + 4); do { *entryPos = layoutX; entryPos[1] = layoutY; entryType = (int)entryPos[-1]; if ((entryType == 1) || (entryType == 2)) { layoutX = layoutX + _DAT_00c35e40; layoutY = layoutY + _DAT_00c35e44; } else if (entryType == 0) { layoutX = layoutX + _DAT_00c35e50; layoutY = layoutY + _DAT_00c35e54; } else { layoutX = layoutX + _DAT_00c35e48; layoutY = layoutY + DAT_00c35e4c; } uVar13 = uVar13 + 1; entryPos = entryPos + 10; } while (uVar13 < (uint)((int)(*(int *)this[1].SpecialSeedsSprite._animDefaultName._buf - this[1].SpecialSeedsSprite._filename._capacity) / 0x28)); } } ExceptionList = local_1c; return; LAB_008f1d83: puVar11 = (undefined4 *)puVar11[6]; if (puVar11 == (undefined4 *)0x0) goto LAB_008f1d45; goto LAB_008f1cd0; LAB_008f1f23: puVar11 = (undefined4 *)puVar11[6]; if (puVar11 == (undefined4 *)0x0) goto LAB_008f1ee5; goto LAB_008f1e70; } //@@ 008f2680 FUN_008f2680 void FUN_008f2680(void) { int in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); return; } //@@ 008f2690 FUN_008f2690 void FUN_008f2690(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { std::string::_Tidy_deallocate((char *)((int)pvVar1 + 0x10)); pvVar1 = (void *)((int)pvVar1 + 0x28); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x28) * 0x28; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008f2720 FUN_008f2720 void FUN_008f2720(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x28) { std::string::_Tidy_deallocate((char *)(param_1 + 0x10)); } return; } //@@ 008f2750 FUN_008f2750 void FUN_008f2750(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; *in_EDX = *param_1; uVar1 = param_1[2]; in_EDX[1] = param_1[1]; in_EDX[2] = uVar1; in_EDX[3] = param_1[3]; in_EDX[4] = 0; in_EDX[8] = 0; in_EDX[9] = 0; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; in_EDX[4] = param_1[4]; in_EDX[5] = uVar1; in_EDX[6] = uVar2; in_EDX[7] = uVar3; *(undefined8 *)(in_EDX + 8) = *(undefined8 *)(param_1 + 8); param_1[8] = 0; param_1[9] = 0xf; *(undefined1 *)(param_1 + 4) = 0; return; } //@@ 008f27b0 FUN_008f27b0 void * FUN_008f27b0(int param_1,undefined4 param_2) { void *pvVar1; uint uVar2; int iVar3; void *pvVar4; void *pvVar5; int *in_ECX; uint uVar6; int iVar7; iVar7 = *in_ECX; iVar3 = (in_ECX[1] - iVar7) / 0x28; if (iVar3 == 0x6666666) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (in_ECX[2] - iVar7) / 0x28; if (0x6666666 - (uVar2 >> 1) < uVar2) { uVar6 = 0x6666666; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar6 = iVar3 + 1U; if (iVar3 + 1U <= uVar2) { uVar6 = uVar2; } if (0x6666666 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = std::_Allocate(uVar6 * 0x28); pvVar1 = (void *)((int)pvVar4 + ((param_1 - iVar7) / 0x28) * 0x28); FUN_008f2750(param_2); iVar7 = *in_ECX; pvVar5 = pvVar4; if (param_1 != in_ECX[1]) { FUN_008f2ae0(pvVar4,iVar7); pvVar5 = (void *)((int)pvVar1 + 0x28); } FUN_008f2ae0(pvVar5,iVar7); FUN_008f2a50(pvVar4,iVar3 + 1,uVar6); return pvVar1; } //@@ 008f28c0 FUN_008f28c0 undefined4 * FUN_008f28c0(int param_1,undefined4 *param_2) { undefined4 *puVar1; uint uVar2; undefined4 uVar3; int iVar4; undefined4 *puVar5; int *in_ECX; uint uVar6; undefined4 *puVar7; int iVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b075c0; local_10 = ExceptionList; ExceptionList = &local_10; iVar8 = *in_ECX; iVar4 = (in_ECX[1] - iVar8) / 0x28; if (iVar4 == 0x6666666) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (in_ECX[2] - iVar8) / 0x28; if (0x6666666 - (uVar2 >> 1) < uVar2) { uVar6 = 0x6666666; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar6 = iVar4 + 1U; if (iVar4 + 1U <= uVar2) { uVar6 = uVar2; } if (0x6666666 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar5 = std::_Allocate(uVar6 * 0x28); local_8 = 0; puVar1 = puVar5 + ((param_1 - iVar8) / 0x28) * 10; *puVar1 = *param_2; uVar3 = param_2[2]; puVar1[1] = param_2[1]; puVar1[2] = uVar3; puVar1[3] = param_2[3]; std::string::string((char *)(puVar1 + 4),param_2 + 4); iVar8 = *in_ECX; puVar7 = puVar5; if (param_1 != in_ECX[1]) { FUN_008f2ae0(puVar5,iVar8); puVar7 = puVar1 + 10; } FUN_008f2ae0(puVar7,iVar8); FUN_008f2a50(puVar5,iVar4 + 1,uVar6); ExceptionList = local_10; return puVar1; } //@@ 008f2a1d Catch_All@008f2a1d void Catch_All_008f2a1d(void) { int unaff_EBP; FUN_008f2720(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x1c)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 008f2a50 FUN_008f2a50 void FUN_008f2a50(int param_1,int param_2,int param_3) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { std::string::_Tidy_deallocate((char *)((int)pvVar1 + 0x10)); pvVar1 = (void *)((int)pvVar1 + 0x28); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x28) * 0x28; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0x28; in_ECX[2] = param_1 + param_3 * 0x28; return; } //@@ 008f2ae0 FUN_008f2ae0 undefined4 * FUN_008f2ae0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; puVar7 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 9; puVar6 = param_1 + 1; do { *puVar7 = puVar5[-9]; uVar2 = puVar5[-8]; puVar7 = puVar7 + 10; puVar6[1] = puVar5[-7]; puVar1 = puVar5 + 1; *puVar6 = uVar2; puVar6[2] = puVar5[-6]; puVar6[3] = 0; puVar6[7] = 0; *(undefined4 *)((int)param_1 + (-0x28 - (int)in_ECX) + (int)(puVar5 + 10)) = 0; uVar2 = puVar5[-4]; uVar3 = puVar5[-3]; uVar4 = puVar5[-2]; puVar6[3] = puVar5[-5]; puVar6[4] = uVar2; puVar6[5] = uVar3; puVar6[6] = uVar4; *(undefined8 *)(puVar6 + 7) = *(undefined8 *)(puVar5 + -1); puVar5[-1] = 0; *puVar5 = 0xf; *(undefined1 *)(puVar5 + -5) = 0; puVar5 = puVar5 + 10; puVar6 = puVar6 + 10; } while (puVar1 != in_EDX); } return puVar7; } //@@ 008f2b70 FUN_008f2b70 char * FUN_008f2b70(uint param_1,uint param_2) { longlong lVar1; char *in_ECX; uint uVar2; uint uVar3; int iVar4; while (param_2 != 0) { lVar1 = (ulonglong)param_2 * 0x6d694b2f + ((ulonglong)param_1 * 0x6d694b2f >> 0x20); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); uVar2 = (int)((ulonglong)param_1 * 0x12e0be82 >> 0x20) + (uint)CARRY4((uint)((ulonglong)param_1 * 0x12e0be82),(uint)lVar1); iVar4 = 9; lVar1 = (ulonglong)param_2 * 0x12e0be82 + (ulonglong)CONCAT14(CARRY4(uVar3,uVar2),uVar3 + uVar2) ; uVar2 = (param_2 - (int)((ulonglong)lVar1 >> 0x20)) - (uint)(param_1 < (uint)lVar1); lVar1 = lVar1 + CONCAT44(uVar2 >> 1,param_1 - (uint)lVar1 >> 1 | uVar2 * -0x80000000); param_2 = (uint)((ulonglong)lVar1 >> 0x20); uVar3 = (uint)lVar1 >> 0x1d | param_2 * 8; param_2 = param_2 >> 0x1d; uVar2 = param_1 + uVar3 * -1000000000; do { in_ECX = in_ECX + -1; *in_ECX = (char)uVar2 + (char)(uVar2 / 10) * -10 + '0'; iVar4 = iVar4 + -1; uVar2 = uVar2 / 10; param_1 = uVar3; } while (iVar4 != 0); } do { in_ECX = in_ECX + -1; uVar2 = param_1 / 10; *in_ECX = (char)param_1 + (char)uVar2 * -10 + '0'; param_1 = uVar2; } while (uVar2 != 0); return in_ECX; } //@@ 008f2c90 FUN_008f2c90 void FUN_008f2c90(undefined4 param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_008f2d20(param_1); uVar1 = puVar4[1]; puVar4[1] = in_ECX[1]; in_ECX[1] = uVar1; uVar1 = *puVar4; *puVar4 = *in_ECX; *in_ECX = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_1c); } } ExceptionList = local_10; return; } //@@ 008f2d20 FUN_008f2d20 void FUN_008f2d20(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 008f2d80 ModEntry::ModEntry /* DB: ? constructor of the object ModManager::ListMods allocates (0xf04 bytes via FUN_00a0f4c0) before parsing: 8 empty std::strings, two std::list sentinels, eh_vector_constructor_iterator for an array member */ void ModEntry::ModEntry(void) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b07680; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[5] = 0xf; in_ECX[4] = 0; *(undefined1 *)in_ECX = 0; in_ECX[6] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0xf; *(undefined1 *)(in_ECX + 6) = 0; in_ECX[0xc] = 0; in_ECX[0x11] = 0xf; in_ECX[0x10] = 0; *(undefined1 *)(in_ECX + 0xc) = 0; in_ECX[0x12] = 0; in_ECX[0x17] = 0xf; in_ECX[0x16] = 0; *(undefined1 *)(in_ECX + 0x12) = 0; in_ECX[0x18] = 0; in_ECX[0x1c] = 0; in_ECX[0x1d] = 0xf; *(undefined1 *)(in_ECX + 0x18) = 0; in_ECX[0x1e] = 0; in_ECX[0x23] = 0xf; in_ECX[0x22] = 0; *(undefined1 *)(in_ECX + 0x1e) = 0; in_ECX[0x24] = 0; in_ECX[0x29] = 0xf; in_ECX[0x28] = 0; *(undefined1 *)(in_ECX + 0x24) = 0; in_ECX[0x2a] = 0; in_ECX[0x2f] = 0xf; in_ECX[0x2e] = 0; *(undefined1 *)(in_ECX + 0x2a) = 0; in_ECX[0x30] = 0; in_ECX[0x35] = 0xf; in_ECX[0x34] = 0; *(undefined1 *)(in_ECX + 0x30) = 0; in_ECX[0x36] = 0; in_ECX[0x37] = 0; in_ECX[0x38] = 0; local_8 = 9; in_ECX[0x39] = 0; in_ECX[0x3a] = 0; pvVar1 = operator_new(0xc); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; in_ECX[0x39] = pvVar1; local_8._0_1_ = 10; in_ECX[0x3b] = 0; in_ECX[0x3c] = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0x3b] = pvVar1; local_8._0_1_ = 0xb; in_ECX[0x3d] = 0; in_ECX[0x3e] = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0x3d] = pvVar1; local_8 = CONCAT31(local_8._1_3_,0xc); *(undefined2 *)(in_ECX + 0x3f) = 0x101; *(undefined1 *)((int)in_ECX + 0xfe) = 0; _eh_vector_constructor_iterator_(in_ECX + 0x40,0x114,0xd,ANM2::constructor,ANM2::~ANM2); ExceptionList = local_10; return; } //@@ 008f2fb0 FUN_008f2fb0 void FUN_008f2fb0(void) { int *this; int *in_ECX; this = in_ECX + 2; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[2] + 4)); operator_delete((void *)*this,0x18); FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x18); return; } //@@ 008f2ff0 ModManager::~ModManager /* DB: Manager::destructor member just before EntityConfig's (Manager+0x2a670) dtor: destroys ANM2s at +0x20148/+0x20034 (ends at +0x2025c, i.e. Manager _modManager 0x2a6c0 up to _stringTable 0x4a920), a string, the KAGE::Thread member (00a5a4c0), 008fc570 and the mod vector at +0 */ void ModManager::~ModManager(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)((int)in_ECX + 0x20148)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x20198)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x20178)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x20160)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x20148)); local_8 = 1; ANM2::Reset((ANM2 *)((int)in_ECX + 0x20034)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x20084)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x20064)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x2004c)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x20034)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x2001c)); KAGE::Thread::~Thread((void *)((int)in_ECX + 0x2000c)); FUN_008fc570(); FID_conflict__Tidy(in_ECX); ExceptionList = local_10; return; } //@@ 008f30d0 ModManager::LoadModContent /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: iterates ModManager mods vector (this+0/+4) skipping disabled (+0xfd), Mod::GetContentPath for entities2.xml/items.xml/items_metadata.xml/pocketitems.xml/locusts.xml/info_display.xml/... and calls each config loader (ItemConfig::LoadLocustConfig 0072ba80, 0084eba0 InfoDisplay::load_xml */ void ModManager::LoadModContent(void) { uint *puVar1; qword qVar2; undefined4 uVar3; undefined4 uVar4; byte *pbVar5; byte bVar6; uint uVar7; byte *pbVar8; std_string *psVar9; char *pcVar10; void *pvVar11; int *in_ECX; std_string *psVar12; byte *pbVar13; uint uVar14; qword *pqVar15; int *piVar16; std_string local_84; std_string local_6c; std_string local_54; std_string local_3c; uint local_24; char *pcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pcStack_20 = (char *)((int)register0x00000010 + 0xfffffffc); local_14 = 0xffffffff; puStack_18 = &LAB_00b0773d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)((int)register0x00000010 + 0xfffffff0U); ExceptionList = &local_1c; piVar16 = (int *)*in_ECX; local_24 = uVar7; pcVar10 = (char *)((int)register0x00000010 + 0xfffffffc); if (piVar16 != (int *)in_ECX[1]) { do { if (*(char *)(*piVar16 + 0xfd) != '\0') { Mod::load_menu_sprites(uVar7); builtin_strncpy(local_54._buf,"entities2.xml",0xe); local_54._capacity = 0xf; local_54._size = 0xd; local_14 = 0; Mod::GetContentPath((void *)*piVar16,&local_3c,&local_54); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } uVar14 = *(uint *)(pbVar8 + -4); qVar2 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar2 < uVar14); free(pbVar8 + -4); local_14._0_1_ = 2; } if (pbVar8 != (byte *)0x0) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } EntityConfig::LoadEntities(psVar9,*piVar16); } local_54._capacity = 0xf; local_54._size = 9; builtin_strncpy(local_54._buf,"items.xm",8); local_54._buf[8] = 'l'; local_54._buf[9] = '\0'; local_14._0_1_ = 4; psVar9 = Mod::GetContentPath((void *)*piVar16,&local_6c,&local_54); if (&local_3c != psVar9) { std::string::_Tidy_deallocate(local_3c._buf); local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } if (0xf < local_6c._capacity) { uVar14 = local_6c._capacity + 1; psVar9 = (std_string *)local_6c._buf._0_4_; if (0xfff < uVar14) { psVar9 = (std_string *)((std_string *)(local_6c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_6c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_6c._buf._0_4_ + (-4 - (int)psVar9))) goto LAB_008f46dd; } operator_delete(psVar9,uVar14); } local_14._0_1_ = 2; local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } uVar14 = *(uint *)(pbVar8 + -4); qVar2 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar2 < uVar14); free(pbVar8 + -4); local_14._0_1_ = 2; } if (pbVar8 != (byte *)0x0) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::Load(psVar9,*piVar16); } pvVar11 = (void *)*piVar16; pcVar10 = std::_Allocate(0x20); local_54._size = 0x10; local_54._capacity = 0x1f; builtin_strncpy(pcVar10,"info_display.xml",0x11); local_54._buf._0_4_ = pcVar10; local_14._0_1_ = 6; psVar9 = Mod::GetContentPath(pvVar11,&local_6c,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } if (0xf < local_6c._capacity) { uVar14 = local_6c._capacity + 1; psVar9 = (std_string *)local_6c._buf._0_4_; if (0xfff < uVar14) { psVar9 = (std_string *)((std_string *)(local_6c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_6c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_6c._buf._0_4_ + (-4 - (int)psVar9))) goto LAB_008f46dd; } operator_delete(psVar9,uVar14); } local_14._0_1_ = 2; local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } uVar14 = *(uint *)(pbVar8 + -4); qVar2 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar2 < uVar14); free(pbVar8 + -4); local_14._0_1_ = 2; } if (pbVar8 != (byte *)0x0) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } InfoDisplay::load_xml(psVar9,*piVar16); } builtin_strncpy(local_54._buf,"pocketitems.xml",0x10); local_54._capacity = 0xf; local_54._size = 0xf; local_14._0_1_ = 8; psVar9 = Mod::GetContentPath((void *)*piVar16,&local_6c,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } if (0xf < local_6c._capacity) { uVar14 = local_6c._capacity + 1; psVar9 = (std_string *)local_6c._buf._0_4_; if (0xfff < uVar14) { psVar9 = (std_string *)((std_string *)(local_6c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_6c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_6c._buf._0_4_ + (-4 - (int)psVar9))) goto LAB_008f46dd; } operator_delete(psVar9,uVar14); } local_14._0_1_ = 2; local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } uVar14 = *(uint *)(pbVar8 + -4); qVar2 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar2 < uVar14); free(pbVar8 + -4); local_14._0_1_ = 2; } if (pbVar8 != (byte *)0x0) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::load_pocketitems_xml(&g_manager->_itemConfig,(byte *)psVar9,(void *)*piVar16); } builtin_strncpy(local_54._buf,"costumes2.xml",0xe); local_54._capacity = 0xf; local_54._size = 0xd; local_14._0_1_ = 10; psVar9 = Mod::GetContentPath((void *)*piVar16,&local_6c,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } if (0xf < local_6c._capacity) { uVar14 = local_6c._capacity + 1; psVar9 = (std_string *)local_6c._buf._0_4_; if (0xfff < uVar14) { psVar9 = (std_string *)((std_string *)(local_6c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_6c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_6c._buf._0_4_ + (-4 - (int)psVar9))) goto LAB_008f46dd; } operator_delete(psVar9,uVar14); } local_14._0_1_ = 2; local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0xb; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::load_costumes_xml(&g_manager->_itemConfig,(byte *)psVar9,(void *)*piVar16); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"items_metadata.xml",0x12); local_14._0_1_ = 0xc; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0xd; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::load_metadata_xml(&g_manager->_itemConfig,(byte *)psVar9,(void *)*piVar16); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"wisps.xml",9); local_14._0_1_ = 0xe; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0xf; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::load_wisps_xml(&g_manager->_itemConfig,(byte *)psVar9,(void *)*piVar16); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"locusts.xml",0xb); local_14._0_1_ = 0x10; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0x11; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::LoadLocustConfig(&g_manager->_itemConfig,(byte *)psVar9,(ModEntry *)*piVar16); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"recipes.xml",0xb); local_14._0_1_ = 0x12; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0x13; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::load_recipes_xml(&g_manager->_itemConfig,(byte *)psVar9,(void *)*piVar16); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"bombcostumes.xml",0x10); local_14._0_1_ = 0x14; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0x15; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } ItemConfig::LoadBombCostumes(&g_manager->_itemConfig,(byte *)psVar9,1); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"challenges.xml",0xe); local_14._0_1_ = 0x16; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0x17; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } challenges_xml_load(psVar9,1); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"players.xml",0xb); local_14._0_1_ = 0x18; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0x19; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } EntityConfig::load_players_xml(psVar9,*piVar16); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"sounds.xml",10); local_14._0_1_ = 0x1a; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } pbVar8 = FileSystem::ResolvePath((byte *)psVar9); if (pbVar8 != (byte *)0x0) { local_14._0_1_ = 0x1b; tracked_alloc(1,pbVar8,0); local_14._0_1_ = 2; psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } SFXManager::load_xml(psVar9,1); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"music.xml",9); local_14._0_1_ = 0x1c; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } bVar6 = file_exists((byte *)psVar9); if (bVar6 != 0) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } Music::LoadConfig((Music *)&g_manager->_musicManager,(byte *)psVar9,1); } pvVar11 = (void *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_54._buf,(byte *)"nightmares.xml",0xe); local_14._0_1_ = 0x1d; psVar9 = Mod::GetContentPath(pvVar11,&local_84,&local_54); if (&local_3c != psVar9) { if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar12 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar12 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar12))) goto LAB_008f46dd; } operator_delete(psVar12,uVar14); } local_3c._buf._0_4_ = *(undefined4 *)psVar9->_buf; local_3c._buf._4_4_ = *(undefined4 *)(psVar9->_buf + 4); local_3c._buf._8_4_ = *(undefined4 *)(psVar9->_buf + 8); local_3c._buf._12_4_ = *(undefined4 *)(psVar9->_buf + 0xc); local_3c._size = psVar9->_size; local_3c._capacity = psVar9->_capacity; psVar9->_size = 0; psVar9->_capacity = 0xf; psVar9->_buf[0] = '\0'; } std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) goto LAB_008f46dd; } operator_delete(pvVar11,uVar14); } psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } bVar6 = file_exists((byte *)psVar9); if (bVar6 != 0) { psVar9 = &local_3c; if (0xf < local_3c._capacity) { psVar9 = (std_string *)local_3c._buf._0_4_; } NightmareScene::load_nightmares_xml(psVar9); } pbVar8 = (byte *)*piVar16; local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_8_ = local_54._buf._0_8_ & 0xffffffff00000000; pbVar5 = g_modsDirectory; do { pbVar13 = pbVar5; pbVar5 = pbVar13 + 1; } while (*pbVar13 != 0); std::string::assign(local_54._buf,g_modsDirectory,(uint)(pbVar13 + -0xc72e28)); local_14._0_1_ = 0x1e; puVar1 = (uint *)(pbVar8 + 0x10); if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } pvVar11 = std::string::append(local_54._buf,pbVar8,*puVar1); FUN_00417100(pvVar11); local_14._0_1_ = 0x1f; pvVar11 = std::string::append(local_84._buf,(byte *)"/main.lua",9); FUN_00417100(pvVar11); if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; psVar9 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar14) { psVar9 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar14 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar9))) goto LAB_008f46dd; } operator_delete(psVar9,uVar14); } uVar3 = local_6c._buf._0_4_; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; uVar4 = local_6c._buf._0_4_; local_6c._buf[0] = (char)uVar3; local_6c._buf[1] = SUB41(uVar3,1); local_6c._buf[2] = SUB41(uVar3,2); local_6c._buf[3] = SUB41(uVar3,3); local_3c._buf[0] = local_6c._buf[0]; local_3c._buf[1] = local_6c._buf[1]; local_3c._buf[2] = local_6c._buf[2]; local_3c._buf[3] = local_6c._buf[3]; local_3c._buf[4] = local_6c._buf[4]; local_3c._buf[5] = local_6c._buf[5]; local_3c._buf[6] = local_6c._buf[6]; local_3c._buf[7] = local_6c._buf[7]; local_3c._buf[8] = local_6c._buf[8]; local_3c._buf[9] = local_6c._buf[9]; local_3c._buf[10] = local_6c._buf[10]; local_3c._buf[0xb] = local_6c._buf[0xb]; local_3c._buf[0xc] = local_6c._buf[0xc]; local_3c._buf[0xd] = local_6c._buf[0xd]; local_3c._buf[0xe] = local_6c._buf[0xe]; local_3c._buf[0xf] = local_6c._buf[0xf]; local_3c._capacity = local_6c._capacity; local_3c._size = local_6c._size; local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = uVar4; std::string::_Tidy_deallocate(local_6c._buf); std::string::_Tidy_deallocate(local_84._buf); local_14._0_1_ = 2; if (0xf < local_54._capacity) { uVar14 = local_54._capacity + 1; pvVar11 = (void *)local_54._buf._0_4_; if (0xfff < uVar14) { pvVar11 = *(void **)(local_54._buf._0_4_ + -4); uVar14 = local_54._capacity + 0x24; if (0x1f < (uint)(local_54._buf._0_4_ + (-4 - (int)pvVar11))) { LAB_008f46dd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar14); } pbVar8 = std::string::c_str(local_3c._buf); bVar6 = file_exists(pbVar8); if (bVar6 != 0) { DAT_00c71698 = *piVar16; pbVar8 = std::string::c_str(local_3c._buf); FUN_0086e6c0(pbVar8); DAT_00c71698 = 0; } local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_3c._buf); } piVar16 = piVar16 + 1; pcVar10 = pcStack_20; } while (piVar16 != (int *)in_ECX[1]); } pcStack_20 = pcVar10; Menu_Mods::Update((Menu_Mods *)&g_manager->_entityConfig); std::string::string_from_cstr(local_84._buf,(byte *)"gfx/ui/mod_defaults.anm2"); local_14 = 0x20; ANM2::Load((ANM2 *)(in_ECX + 0x8052),&local_84,1); std::string::_Tidy_deallocate(local_84._buf); ExceptionList = local_1c; return; } //@@ 008f46f0 ModManager::LoadModItemPools /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: for each enabled mod (+0xfd) when g_game exists: Mod::GetContentPath("itempools.xml"), FileSystem::ResolvePath, ItemPool::load_pools(&g_game->_itemPool, path, 1); caller ItemPool::Init */ void ModManager::LoadModItemPools(void) { byte *ptr; std_string *psVar1; int *in_ECX; void *ptr_00; uint uVar2; undefined4 *puVar3; std_string *local_44 [5]; uint local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; puStack_c = &LAB_00b07785; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; if ((g_game != (Game *)0x0) && (puVar3 = (undefined4 *)*in_ECX, puVar3 != (undefined4 *)in_ECX[1]) ) { do { if (*(char *)((int)*puVar3 + 0xfd) != '\0') { builtin_strncpy(local_2c._buf + 8,"s.xml",6); local_2c._capacity = 0xf; local_2c._size = 0xd; builtin_strncpy(local_2c._buf,"itempool",8); local_8 = 0; Mod::GetContentPath((void *)*puVar3,(std_string *)local_44,&local_2c); local_8._0_1_ = 2; if (0xf < local_2c._capacity) { uVar2 = local_2c._capacity + 1; ptr_00 = (void *)local_2c._buf._0_4_; if (0xfff < uVar2) { ptr_00 = *(void **)(local_2c._buf._0_4_ + -4); uVar2 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr_00))) goto LAB_008f4883; } operator_delete(ptr_00,uVar2); } psVar1 = (std_string *)local_44; if (0xf < local_30) { psVar1 = local_44[0]; } ptr = FileSystem::ResolvePath((byte *)psVar1); if (ptr != (byte *)0x0) { local_8._0_1_ = 3; tracked_alloc(1,ptr,0); local_8 = CONCAT31(local_8._1_3_,2); psVar1 = (std_string *)local_44; if (0xf < local_30) { psVar1 = local_44[0]; } ItemPool::load_pools(&g_game->_itemPool,(byte *)psVar1,1); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < local_30) { uVar2 = local_30 + 1; psVar1 = local_44[0]; if (0xfff < uVar2) { psVar1 = (std_string *)local_44[0][-1]._capacity; uVar2 = local_30 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44[0] + (-4 - (int)psVar1))) { LAB_008f4883: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar1,uVar2); } } puVar3 = puVar3 + 1; } while (puVar3 != (undefined4 *)in_ECX[1]); } ExceptionList = local_10; return; } //@@ 008f4890 ModManager::LoadModBossPools /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: for each enabled mod (+0xfd) Mod::GetContentPath("bosspools.xml"), FileSystem::ResolvePath, BossPool::load_xml; caller BossPool::init */ void ModManager::LoadModBossPools(void) { byte *ptr; std_string *psVar1; int *in_ECX; void *ptr_00; uint uVar2; undefined4 *puVar3; std_string *local_44 [5]; uint local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; puStack_c = &LAB_00b07785; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; if ((g_game != (Game *)0x0) && (puVar3 = (undefined4 *)*in_ECX, puVar3 != (undefined4 *)in_ECX[1]) ) { do { if (*(char *)((int)*puVar3 + 0xfd) != '\0') { builtin_strncpy(local_2c._buf + 8,"s.xml",6); local_2c._capacity = 0xf; local_2c._size = 0xd; builtin_strncpy(local_2c._buf,"bosspool",8); local_8 = 0; Mod::GetContentPath((void *)*puVar3,(std_string *)local_44,&local_2c); local_8._0_1_ = 2; if (0xf < local_2c._capacity) { uVar2 = local_2c._capacity + 1; ptr_00 = (void *)local_2c._buf._0_4_; if (0xfff < uVar2) { ptr_00 = *(void **)(local_2c._buf._0_4_ + -4); uVar2 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr_00))) goto LAB_008f4a23; } operator_delete(ptr_00,uVar2); } psVar1 = (std_string *)local_44; if (0xf < local_30) { psVar1 = local_44[0]; } ptr = FileSystem::ResolvePath((byte *)psVar1); if (ptr != (byte *)0x0) { local_8._0_1_ = 3; tracked_alloc(1,ptr,0); local_8 = CONCAT31(local_8._1_3_,2); psVar1 = (std_string *)local_44; if (0xf < local_30) { psVar1 = local_44[0]; } BossPool::load_xml(psVar1,*puVar3); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < local_30) { uVar2 = local_30 + 1; psVar1 = local_44[0]; if (0xfff < uVar2) { psVar1 = (std_string *)local_44[0][-1]._capacity; uVar2 = local_30 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44[0] + (-4 - (int)psVar1))) { LAB_008f4a23: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar1,uVar2); } } puVar3 = puVar3 + 1; } while (puVar3 != (undefined4 *)in_ECX[1]); } ExceptionList = local_10; return; } //@@ 008f4a30 ModManager::LoadShaders /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: shaders.xml parse ("Could not find root node shaders in mod %s", vertex/fragment/parameters); callers ModManager::TriggerResize and the reload paths; zhl ModManager::LoadShaders() prototype: REPENTOGON */ void __thiscall ModManager::LoadShaders(ModManager *this) { char cVar1; int iVar2; int iVar3; longlong lVar4; qword qVar5; ulonglong uVar6; byte *pbVar7; std_string *psVar8; int iVar9; void *pvVar10; int *piVar11; undefined4 *puVar12; byte *******pppppppbVar13; int *piVar14; int *piVar15; uint uVar16; qword *pqVar17; byte *pbVar18; byte *pbVar19; char *pcVar20; ModManager MVar21; bool bVar22; char *pcVar23; byte bVar24; byte *******pppppppbStack_10128; undefined4 uStack_10124; byte *******pppppppbStack_10120; undefined4 uStack_1011c; ModManager MStack_10118; byte *pbStack_10114; uint uStack_10110; byte *******pppppppbStack_1010c; undefined8 uStack_10108; int *piStack_100fc; byte *pbStack_100f8; byte *pbStack_100f4; byte *pbStack_100f0; byte bStack_100e9; undefined1 auStack_100e8 [48]; undefined1 auStack_100b8 [65560]; byte *******local_a0; undefined4 uStack_9c; byte *******pppppppbStack_98; undefined4 uStack_94; undefined4 uStack_90; uint uStack_8c; std_string local_84; byte *******local_6c; undefined4 uStack_68; undefined4 uStack_64; uint uStack_60; undefined8 local_5c; byte *******local_54; undefined4 uStack_50; byte *******pppppppbStack_4c; undefined4 uStack_48; undefined4 local_44; uint uStack_40; std_string local_3c; uint local_24; std_string **ppsStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ppsStack_20 = (std_string **)((int)&local_84 + 0x80); puStack_18 = &LAB_00b0783f; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&local_84 + 0x74U; ExceptionList = &local_1c; MStack_10118 = *this; uStack_10110 = 0; if (MStack_10118 != this[1]) { do { MVar21 = MStack_10118; if (*(char *)((int)*(void **)MStack_10118 + 0xfd) != '\0') { builtin_strncpy(local_3c._buf + 8,"xml",4); local_3c._capacity = 0xf; local_3c._size = 0xb; builtin_strncpy(local_3c._buf,"shaders.",8); local_14 = 0; Mod::GetContentPath(*(void **)MStack_10118,&local_84,&local_3c); local_14._0_1_ = 2; if (0xf < local_3c._capacity) { uVar16 = local_3c._capacity + 1; pvVar10 = (void *)local_3c._buf._0_4_; if (0xfff < uVar16) { pvVar10 = *(void **)(local_3c._buf._0_4_ + -4); uVar16 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar10))) { LAB_008f5943: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar16); } psVar8 = &local_84; if (0xf < local_84._capacity) { psVar8 = (std_string *)local_84._buf._0_4_; } pbVar7 = FileSystem::ResolvePath((byte *)psVar8); bStack_100e9 = pbVar7 != (byte *)0x0; if (pbVar7 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar17 = &g_allocatedBytesNoHeap; } else { pqVar17 = (qword *)((int)g_mainHeap + 0x30); } uVar16 = *(uint *)(pbVar7 + -4); qVar5 = *pqVar17; *(uint *)pqVar17 = (uint)*pqVar17 - uVar16; *(uint *)((int)pqVar17 + 4) = *(uint *)((int)pqVar17 + 4) - (uint)((uint)qVar5 < uVar16); free(pbVar7 + -4); local_14._0_1_ = 2; } if (bStack_100e9 != 0) { psVar8 = &local_84; if (0xf < local_84._capacity) { psVar8 = (std_string *)local_84._buf._0_4_; } piStack_100fc = FileSystem::Open(&PTR_vftable_00c37a10,(byte *)psVar8,(int *)0x0); if (piStack_100fc == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] Failed to open shader config file %s\n"); } else { iVar9 = (**(code **)(*piStack_100fc + 4))(); pbStack_10114 = operator_new_tracked(iVar9 + 1); (**(code **)(*piStack_100fc + 0x14))(pbStack_10114,1,iVar9); pbStack_10114[iVar9] = 0; (**(code **)*piStack_100fc)(1); FUN_00413b90(); local_14._0_1_ = 4; pcVar23 = (char *)0x8f4c1d; pbVar7 = pbStack_10114; rapidxml::xml_document::parse(auStack_100e8,pbStack_10114); bVar24 = (byte)pbVar7; pvVar10 = xml_node::first_node(auStack_100e8,(byte *)"shaders",(int)pcVar23,bVar24); if (pvVar10 == (void *)0x0) { piVar11 = *(int **)MVar21; if (0xf < (uint)piVar11[5]) { piVar11 = (int *)*piVar11; } bVar24 = (byte)piVar11; pcVar23 = "Could not find root node \'shaders\' in mod %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'shaders\' in mod %s\n"); } for (piStack_100fc = xml_node::first_node(pvVar10,(byte *)"shader",(int)pcVar23,bVar24); piStack_100fc != (int *)0x0; piStack_100fc = (int *)piStack_100fc[0xb]) { pbVar7 = operator_new(0x80); if (pbVar7 == (byte *)0x0) { pbStack_100f8 = (byte *)0x0; } else { pbStack_100f8 = pbVar7; memset(pbVar7,0,0x80); pbVar7[0] = 0; pbVar7[1] = 0; pbVar7[2] = 0; pbVar7[3] = 0; pbVar7[0x10] = 0; pbVar7[0x11] = 0; pbVar7[0x12] = 0; pbVar7[0x13] = 0; pbVar7[0x14] = 0xf; pbVar7[0x15] = 0; pbVar7[0x16] = 0; pbVar7[0x17] = 0; *pbVar7 = 0; FUN_00a245b0(); pbVar7[0x68] = 0; pbVar7[0x69] = 0; pbVar7[0x6a] = 0; pbVar7[0x6b] = 0; pbVar7[0x6c] = 0; pbVar7[0x6d] = 0; pbVar7[0x6e] = 0; pbVar7[0x6f] = 0; pbVar19 = pbVar7 + 0x70; local_14._0_1_ = 8; uStack_10108 = CONCAT44(pbVar19,(undefined4)uStack_10108); pbVar19[0] = 0; pbVar19[1] = 0; pbVar19[2] = 0; pbVar19[3] = 0; pbVar7[0x74] = 0; pbVar7[0x75] = 0; pbVar7[0x76] = 0; pbVar7[0x77] = 0; pvVar10 = operator_new(0x2c); *(void **)pvVar10 = pvVar10; *(void **)((int)pvVar10 + 4) = pvVar10; *(void **)((int)pvVar10 + 8) = pvVar10; *(undefined2 *)((int)pvVar10 + 0xc) = 0x101; *(void **)pbVar19 = pvVar10; } local_14._0_1_ = 4; pbVar7 = s_name; do { pbStack_100f4 = pbVar7; pbVar7 = pbStack_100f4 + 1; } while (*pbVar7 != 0); pbStack_100f4 = pbStack_100f4 + -0xb1c13b; for (pbStack_100f0 = (byte *)piStack_100fc[8]; pbStack_100f0 != (byte *)0x0; pbStack_100f0 = *(byte **)((int)pbStack_100f0 + 0x18)) { pbVar7 = *(byte **)pbStack_100f0; if (pbVar7 == (byte *)0x0) { pbVar19 = (byte *)0x0; pbVar7 = &g_xmlNullStr; } else { pbVar19 = *(byte **)((int)pbStack_100f0 + 8); } if (pbVar19 == pbStack_100f4) { pbVar19 = pbVar19 + (int)pbVar7; puVar12 = (undefined4 *)pbStack_100f0; if (pbVar19 <= pbVar7) goto LAB_008f4d93; iVar9 = (int)s_name - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto LAB_008f4d93; } } } puVar12 = (undefined4 *)0x0; LAB_008f4d93: pbVar7 = &g_xmlNullStr; if ((byte *)puVar12[1] != (byte *)0x0) { pbVar7 = (byte *)puVar12[1]; } pbVar19 = pbVar7; do { bVar24 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar24 != 0); std::string::assign((char *)pbStack_100f8,pbVar7,(int)pbVar19 - (int)(pbVar7 + 1)); pcVar23 = "parameters"; do { pcVar20 = pcVar23; pcVar23 = pcVar20 + 1; } while (*pcVar23 != '\0'); pbStack_100f0 = (byte *)piStack_100fc[6]; if (pbStack_100f0 != (byte *)0x0) { LAB_008f4df0: pbVar7 = *(byte **)pbStack_100f0; if (pbVar7 == (byte *)0x0) { pcVar23 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar23 = *(char **)((int)pbStack_100f0 + 8); } if (pcVar23 != pcVar20 + -0xb76d4b) goto LAB_008f4e81; pbVar19 = (byte *)(pcVar23 + (int)pbVar7); if (pbVar7 < pbVar19) { iVar9 = (int)"parameters" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto LAB_008f4e26; } goto LAB_008f4e81; } LAB_008f4e26: pbStack_100f8[0x78] = 0; pbStack_100f8[0x79] = 0; pbStack_100f8[0x7a] = 0; pbStack_100f8[0x7b] = 0; if (pbStack_100f0 != (byte *)0x0) { pcVar23 = "param"; do { pcVar20 = pcVar23; pcVar23 = pcVar20 + 1; } while (*pcVar23 != '\0'); for (pbStack_100f4 = *(byte **)((int)pbStack_100f0 + 0x18); pbStack_100f4 != (byte *)0x0; pbStack_100f4 = *(byte **)(pbStack_100f4 + 0x2c) ) { pbVar7 = *(byte **)pbStack_100f4; if (pbVar7 == (byte *)0x0) { pcVar23 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar23 = *(char **)(pbStack_100f4 + 8); } if (pcVar23 == pcVar20 + -0xb76d43) { pbVar19 = (byte *)(pcVar23 + (int)pbVar7); if (pbVar19 <= pbVar7) goto joined_r0x008f4f6b; iVar9 = (int)"param" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto joined_r0x008f4f6b; } } } pbStack_100f4 = (byte *)0x0; joined_r0x008f4f6b: do { if (pbStack_100f4 == (byte *)0x0) break; pbVar7 = s_name; do { pbVar19 = pbVar7; pbVar7 = pbVar19 + 1; } while (*pbVar7 != 0); pppppppbStack_1010c = (byte *******)(pbVar19 + -0xb1c13b); for (pbStack_100f0 = *(byte **)(pbStack_100f4 + 0x20); pbStack_100f0 != (byte *)0x0; pbStack_100f0 = *(byte **)((int)pbStack_100f0 + 0x18)) { pbVar7 = *(byte **)pbStack_100f0; if (pbVar7 == (byte *)0x0) { pbVar19 = (byte *)0x0; pbVar7 = &g_xmlNullStr; } else { pbVar19 = *(byte **)((int)pbStack_100f0 + 8); } if ((byte *******)pbVar19 == pppppppbStack_1010c) { pbVar19 = pbVar19 + (int)pbVar7; puVar12 = (undefined4 *)pbStack_100f0; if (pbVar19 <= pbVar7) goto LAB_008f4fef; iVar9 = (int)s_name - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto LAB_008f4fef; } } } puVar12 = (undefined4 *)0x0; LAB_008f4fef: local_3c._size = 0; pbVar7 = &g_xmlNullStr; if ((byte *)puVar12[1] != (byte *)0x0) { pbVar7 = (byte *)puVar12[1]; } local_3c._capacity = 0xf; local_3c._buf._0_8_ = local_3c._buf._0_8_ & 0xffffffff00000000; pbVar19 = pbVar7; do { bVar24 = *pbVar19; pbVar19 = pbVar19 + 1; } while (bVar24 != 0); std::string::assign(local_3c._buf,pbVar7,(int)pbVar19 - (int)(pbVar7 + 1)); local_14._0_1_ = 9; uStack_10108 = uStack_10108 & 0xffffffff; uVar6 = uStack_10108; pcVar23 = "type"; do { pcVar20 = pcVar23; pcVar23 = pcVar20 + 1; } while (*pcVar23 != '\0'); pppppppbStack_1010c = (byte *******)(pcVar20 + -0xb69a0b); for (puVar12 = *(undefined4 **)(pbStack_100f4 + 0x20); puVar12 != (undefined4 *)0x0; puVar12 = (undefined4 *)puVar12[6]) { pbVar7 = (byte *)*puVar12; if (pbVar7 == (byte *)0x0) { pppppppbVar13 = (byte *******)0x0; pbVar7 = &g_xmlNullStr; } else { pppppppbVar13 = (byte *******)puVar12[2]; } if (pppppppbVar13 == pppppppbStack_1010c) { pbVar19 = pbVar7 + (int)pppppppbVar13; if (pbVar19 <= pbVar7) goto LAB_008f50c3; iVar9 = (int)&DAT_00b69a0c - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto LAB_008f50c3; } } } puVar12 = (undefined4 *)0x0; LAB_008f50c3: pcVar23 = "float"; pbStack_100f0 = &g_xmlNullStr; if ((byte *)puVar12[1] != (byte *)0x0) { pbStack_100f0 = (byte *)puVar12[1]; } pbVar7 = pbStack_100f0; do { bStack_100e9 = *pbVar7; bVar22 = bStack_100e9 < (byte)*pcVar23; if (bStack_100e9 != *pcVar23) { LAB_008f5122: uVar16 = -(uint)bVar22 | 1; goto LAB_008f5127; } if (bStack_100e9 == 0) break; bStack_100e9 = pbVar7[1]; bVar22 = bStack_100e9 < (byte)pcVar23[1]; if (bStack_100e9 != pcVar23[1]) goto LAB_008f5122; pbVar7 = pbVar7 + 2; pcVar23 = pcVar23 + 2; } while (bStack_100e9 != 0); uVar16 = 0; LAB_008f5127: if (uVar16 == 0) { iVar9 = 1; } else { pbVar19 = &DAT_00b76d3c; pbVar7 = pbStack_100f0; do { bStack_100e9 = *pbVar7; bVar22 = bStack_100e9 < *pbVar19; if (bStack_100e9 != *pbVar19) { LAB_008f5182: uVar16 = -(uint)bVar22 | 1; goto LAB_008f5187; } if (bStack_100e9 == 0) break; bStack_100e9 = pbVar7[1]; bVar22 = bStack_100e9 < pbVar19[1]; if (bStack_100e9 != pbVar19[1]) goto LAB_008f5182; pbVar7 = pbVar7 + 2; pbVar19 = pbVar19 + 2; } while (bStack_100e9 != 0); uVar16 = 0; LAB_008f5187: if (uVar16 == 0) { iVar9 = 2; } else { pbVar19 = &DAT_00b76d34; pbVar7 = pbStack_100f0; do { bStack_100e9 = *pbVar7; bVar22 = bStack_100e9 < *pbVar19; if (bStack_100e9 != *pbVar19) { LAB_008f51e2: uVar16 = -(uint)bVar22 | 1; goto LAB_008f51e7; } if (bStack_100e9 == 0) break; bStack_100e9 = pbVar7[1]; bVar22 = bStack_100e9 < pbVar19[1]; if (bStack_100e9 != pbVar19[1]) goto LAB_008f51e2; pbVar7 = pbVar7 + 2; pbVar19 = pbVar19 + 2; } while (bStack_100e9 != 0); uVar16 = 0; LAB_008f51e7: if (uVar16 == 0) { iVar9 = 3; } else { pbVar19 = &DAT_00b76e54; pbVar7 = pbStack_100f0; do { bVar24 = *pbVar7; bVar22 = bVar24 < *pbVar19; if (bVar24 != *pbVar19) { LAB_008f5215: uVar16 = -(uint)bVar22 | 1; goto LAB_008f521a; } if (bVar24 == 0) break; bVar24 = pbVar7[1]; bVar22 = bVar24 < pbVar19[1]; if (bVar24 != pbVar19[1]) goto LAB_008f5215; pbVar7 = pbVar7 + 2; pbVar19 = pbVar19 + 2; } while (bVar24 != 0); uVar16 = 0; LAB_008f521a: uStack_10108._4_4_ = 0; iVar9 = uStack_10108._4_4_; if (uVar16 == 0) { iVar9 = 4; } } } } uStack_10108 = uVar6; piVar11 = (int *)FUN_008fc6e0(&local_3c); *piVar11 = iVar9; *(int *)(pbStack_100f8 + 0x78) = *(int *)(pbStack_100f8 + 0x78) + iVar9; local_14._0_1_ = 4; if (0xf < local_3c._capacity) { uVar16 = local_3c._capacity + 1; pvVar10 = (void *)local_3c._buf._0_4_; if (0xfff < uVar16) { pvVar10 = *(void **)(local_3c._buf._0_4_ + -4); uVar16 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_008f5943; } operator_delete(pvVar10,uVar16); } pbStack_100f4 = *(byte **)(pbStack_100f4 + 0x2c); } while( true ); } goto LAB_008f4e9f; } LAB_008f4e92: pbStack_100f8[0x78] = 0; pbStack_100f8[0x79] = 0; pbStack_100f8[0x7a] = 0; pbStack_100f8[0x7b] = 0; LAB_008f4e9f: uStack_10124 = 0; uStack_1011c = 0; pcVar23 = "vertex"; do { pcVar20 = pcVar23; pcVar23 = pcVar20 + 1; } while (*pcVar23 != '\0'); pbStack_100f0 = (byte *)piStack_100fc[6]; for (pbStack_100f4 = pbStack_100f0; pbStack_100f4 != (byte *)0x0; pbStack_100f4 = *(byte **)(pbStack_100f4 + 0x2c)) { pbVar7 = *(byte **)pbStack_100f4; if (pbVar7 == (byte *)0x0) { pcVar23 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar23 = *(char **)(pbStack_100f4 + 8); } if (pcVar23 == pcVar20 + -0xb76e4b) { pbVar19 = (byte *)(pcVar23 + (int)pbVar7); pbVar18 = pbStack_100f4; if (pbVar19 <= pbVar7) goto LAB_008f52e7; iVar9 = (int)"vertex" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto LAB_008f52e7; } } } pbVar18 = (byte *)0x0; LAB_008f52e7: pcVar23 = "fragment"; pppppppbStack_10128 = (byte *******)&g_xmlNullStr; if (*(byte ********)(*(int *)(pbVar18 + 0x18) + 4) != (byte *******)0x0) { pppppppbStack_10128 = *(byte ********)(*(int *)(pbVar18 + 0x18) + 4); } do { pcVar20 = pcVar23; pcVar23 = pcVar20 + 1; } while (*pcVar23 != '\0'); pcVar20 = pcVar20 + -0xb76e3f; uStack_10108 = CONCAT44(pcVar20,(undefined4)uStack_10108); for (; pbStack_100f0 != (byte *)0x0; pbStack_100f0 = *(byte **)(pbStack_100f0 + 0x2c)) { pbVar7 = *(byte **)pbStack_100f0; if (pbVar7 == (byte *)0x0) { pcVar23 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar23 = *(char **)(pbStack_100f0 + 8); } if (pcVar23 == pcVar20) { pbVar19 = (byte *)(pcVar23 + (int)pbVar7); pbVar18 = pbStack_100f0; if (pbVar19 <= pbVar7) goto LAB_008f5377; iVar9 = (int)"fragment" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar19 <= pbVar7) goto LAB_008f5377; } } } pbVar18 = (byte *)0x0; LAB_008f5377: pppppppbStack_10120 = (byte *******)&g_xmlNullStr; if (*(byte ********)(*(int *)(pbVar18 + 0x18) + 4) != (byte *******)0x0) { pppppppbStack_10120 = *(byte ********)(*(int *)(pbVar18 + 0x18) + 4); } local_5c = 0xf00000000; local_6c = (byte *******)0x0; local_44 = 0; uStack_40 = 0xf; local_54 = (byte *******)0x0; local_14._0_1_ = 0xb; pppppppbStack_1010c = pppppppbStack_10128; if (*(byte *)pppppppbStack_10128 != 0x23) { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_8_ = local_3c._buf._0_8_ & 0xffffffff00000000; pcVar23 = std::_Allocate(0x40); local_3c._size = 0x3c; local_3c._capacity = 0x3f; builtin_strncpy(pcVar23, "#ifndef GL_ES\n#define lowp \n#define mediump \n#endif\n#line 1\n", 0x3d); local_3c._buf._0_4_ = pcVar23; local_14._0_1_ = 0xc; pppppppbVar13 = pppppppbStack_10128; do { cVar1 = *(char *)pppppppbVar13; pppppppbVar13 = (byte *******)((int)pppppppbVar13 + 1); } while (cVar1 != '\0'); puVar12 = std::string::append(local_3c._buf,(byte *)pppppppbStack_10128, (int)pppppppbVar13 - ((int)pppppppbStack_10128 + 1)); uStack_10110 = uStack_10110 | 1; pppppppbStack_98 = (byte *******)*puVar12; uStack_94 = puVar12[1]; uStack_90 = puVar12[2]; uStack_8c = puVar12[3]; uStack_10108 = *(ulonglong *)(puVar12 + 4); puVar12[4] = 0; puVar12[5] = 0xf; *(undefined1 *)puVar12 = 0; if (0xf < local_5c._4_4_) { uVar16 = local_5c._4_4_ + 1; pppppppbVar13 = local_6c; if (0xfff < uVar16) { pppppppbVar13 = (byte *******)local_6c[-1]; uVar16 = local_5c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c + (-4 - (int)pppppppbVar13))) goto LAB_008f5943; } operator_delete(pppppppbVar13,uVar16); } local_14._0_1_ = 0xb; local_6c = pppppppbStack_98; uStack_68 = uStack_94; uStack_64 = uStack_90; uStack_60 = uStack_8c; local_5c = uStack_10108; if (0xf < local_3c._capacity) { uVar16 = local_3c._capacity + 1; pvVar10 = (void *)local_3c._buf._0_4_; if (0xfff < uVar16) { pvVar10 = *(void **)(local_3c._buf._0_4_ + -4); uVar16 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_008f5943; } operator_delete(pvVar10,uVar16); } pppppppbStack_10128 = (byte *******)&local_6c; if (0xf < local_5c._4_4_) { pppppppbStack_10128 = local_6c; } } if (*(byte *)pppppppbStack_10120 != 0x23) { local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_8_ = local_3c._buf._0_8_ & 0xffffffff00000000; std::string::assign(local_3c._buf, (byte *) "#ifndef GL_ES\n#define lowp \n#define mediump \n#endif\n#line 1\n" ,0x3c); local_14._0_1_ = 0xd; pppppppbVar13 = pppppppbStack_10120; do { cVar1 = *(char *)pppppppbVar13; pppppppbVar13 = (byte *******)((int)pppppppbVar13 + 1); } while (cVar1 != '\0'); pvVar10 = std::string::append(local_3c._buf,(byte *)pppppppbStack_10120, (int)pppppppbVar13 - ((int)pppppppbStack_10120 + 1)); FUN_00417100(pvVar10); uStack_10110 = uStack_10110 | 2; if (0xf < uStack_40) { uVar16 = uStack_40 + 1; pppppppbVar13 = local_54; if (0xfff < uVar16) { pppppppbVar13 = (byte *******)local_54[-1]; uVar16 = uStack_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)pppppppbVar13))) goto LAB_008f5943; } operator_delete(pppppppbVar13,uVar16); } local_54 = local_a0; local_a0 = (byte *******)((uint)local_a0 & 0xffffff00); uStack_50 = uStack_9c; pppppppbStack_4c = pppppppbStack_98; uStack_48 = uStack_94; local_44 = uStack_90; uStack_40 = uStack_8c; uStack_90 = 0; uStack_8c = 0xf; std::string::_Tidy_deallocate((char *)&local_a0); local_14._0_1_ = 0xb; if (0xf < local_3c._capacity) { uVar16 = local_3c._capacity + 1; pvVar10 = (void *)local_3c._buf._0_4_; if (0xfff < uVar16) { pvVar10 = *(void **)(local_3c._buf._0_4_ + -4); uVar16 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)pvVar10))) goto LAB_008f5943; } operator_delete(pvVar10,uVar16); } pppppppbStack_10120 = (byte *******)&local_54; if (0xf < uStack_40) { pppppppbStack_10120 = local_54; } } lVar4 = (ulonglong)(*(int *)(pbStack_100f8 + 0x74) + 6) * 8; puVar12 = operator_new_tracked (-(uint)((int)((ulonglong)lVar4 >> 0x20) != 0) | (uint)lVar4); *(undefined4 **)(pbStack_100f8 + 0x7c) = puVar12; *puVar12 = "Position"; puVar12[1] = 5; iVar9 = *(int *)(pbStack_100f8 + 0x7c); *(char **)(iVar9 + 8) = "Color"; *(undefined4 *)(iVar9 + 0xc) = 6; iVar9 = *(int *)(pbStack_100f8 + 0x7c); *(char **)(iVar9 + 0x10) = "TexCoord"; *(undefined4 *)(iVar9 + 0x14) = 7; iVar9 = *(int *)(pbStack_100f8 + 0x7c); *(char **)(iVar9 + 0x18) = "RenderData"; *(undefined4 *)(iVar9 + 0x1c) = 4; iVar9 = *(int *)(pbStack_100f8 + 0x7c); *(char **)(iVar9 + 0x20) = "Scale"; *(undefined4 *)(iVar9 + 0x24) = 1; iVar9 = *(int *)(pbStack_100f8 + 0x74); iVar2 = *(int *)(pbStack_100f8 + 0x7c); *(byte **)(iVar2 + 0x28 + iVar9 * 8) = &s_empty; *(undefined4 *)(iVar2 + 0x2c + iVar9 * 8) = 0; piVar11 = (int *)**(int **)(pbStack_100f8 + 0x70); if (piVar11 != *(int **)(pbStack_100f8 + 0x70)) { iVar9 = 0x28; do { pvVar10 = operator_new_tracked(piVar11[8] + 1); piVar14 = piVar11 + 4; uStack_10108 = CONCAT44(pvVar10,(undefined4)uStack_10108); if (0xf < (uint)piVar11[9]) { piVar14 = (int *)*piVar14; } piVar15 = piVar14; do { iVar2 = *piVar15; piVar15 = (int *)((int)piVar15 + 1); *(char *)((int)pvVar10 + (-1 - (int)piVar14) + (int)piVar15) = (char)iVar2; } while ((char)iVar2 != '\0'); iVar2 = piVar11[10]; iVar3 = *(int *)(pbStack_100f8 + 0x7c); *(void **)(iVar9 + iVar3) = pvVar10; *(int *)(iVar9 + 4 + iVar3) = iVar2; iVar9 = iVar9 + 8; piVar14 = (int *)piVar11[2]; if (*(char *)((int)piVar14 + 0xd) == '\0') { cVar1 = *(char *)(*piVar14 + 0xd); piVar11 = piVar14; piVar14 = (int *)*piVar14; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar14 + 0xd); piVar11 = piVar14; piVar14 = (int *)*piVar14; } } else { cVar1 = *(char *)(piVar11[1] + 0xd); piVar15 = (int *)piVar11[1]; piVar14 = piVar11; while ((piVar11 = piVar15, cVar1 == '\0' && (piVar14 == (int *)piVar11[2]))) { cVar1 = *(char *)(piVar11[1] + 0xd); piVar15 = (int *)piVar11[1]; piVar14 = piVar11; } } } while (piVar11 != *(int **)(pbStack_100f8 + 0x70)); MVar21 = MStack_10118; } pbVar7 = pbStack_100f8; if (0xf < *(uint *)(pbStack_100f8 + 0x14)) { pbVar7 = *(byte **)pbStack_100f8; } Shader::load(pbStack_100f8 + 0x18,pbVar7,*(void **)(pbStack_100f8 + 0x7c), &pppppppbStack_10128); KAGE::SmartPointer::reset(pbStack_100f8 + 0x68); iVar9 = *(int *)MVar21; uStack_10108 = CONCAT44(*(undefined4 *)(iVar9 + 0xe4),(undefined4)uStack_10108); if (*(int *)(iVar9 + 0xe8) == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_14._0_1_ = 0xe; piVar11 = operator_new(0xc); piVar11[2] = (int)pbStack_100f8; *(int *)(iVar9 + 0xe8) = *(int *)(iVar9 + 0xe8) + 1; puVar12 = *(undefined4 **)(uStack_10108._4_4_ + 4); *piVar11 = uStack_10108._4_4_; piVar11[1] = (int)puVar12; *(int **)(uStack_10108._4_4_ + 4) = piVar11; *puVar12 = piVar11; local_14._0_1_ = 10; if (0xf < uStack_40) { uVar16 = uStack_40 + 1; pppppppbVar13 = local_54; if (0xfff < uVar16) { pppppppbVar13 = (byte *******)local_54[-1]; uVar16 = uStack_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)pppppppbVar13))) goto LAB_008f5943; } operator_delete(pppppppbVar13,uVar16); } local_14._0_1_ = 4; local_44 = 0; uStack_40 = 0xf; local_54 = (byte *******)((uint)local_54 & 0xffffff00); if (0xf < local_5c._4_4_) { uVar16 = local_5c._4_4_ + 1; pppppppbVar13 = local_6c; if (0xfff < uVar16) { pppppppbVar13 = (byte *******)local_6c[-1]; uVar16 = local_5c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c + (-4 - (int)pppppppbVar13))) goto LAB_008f5943; } operator_delete(pppppppbVar13,uVar16); } } local_14._0_1_ = 0xf; tracked_alloc(1,pbStack_10114,0); local_14 = CONCAT31(local_14._1_3_,0x10); xml_memory_pool::clear(auStack_100b8); } } local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_84._buf); } MStack_10118 = (ModManager)((int)MVar21 + 4); } while (MStack_10118 != this[1]); } ExceptionList = local_1c; return; LAB_008f4e81: pbStack_100f0 = *(byte **)((int)pbStack_100f0 + 0x2c); if (pbStack_100f0 == (byte *)0x0) goto LAB_008f4e92; goto LAB_008f4df0; } //@@ 008f5960 FUN_008f5960 void FUN_008f5960(void) { char *this; char *this_00; uint uVar1; int *in_ECX; int *this_01; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; ANM2::Reset((ANM2 *)(in_ECX + 0x8052)); FUN_008f7dd0(uVar1); ModManager::unload_shaders(); puVar2 = (undefined4 *)*in_ECX; if (puVar2 != (undefined4 *)in_ECX[1]) { do { this_00 = (char *)*puVar2; if (this_00 != (char *)0x0) { local_8 = 0; _eh_vector_destructor_iterator_(this_00 + 0x100,0x114,0xd,ANM2::~ANM2); this_01 = (int *)(this_00 + 0xec); this = this_00 + 0xf4; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(this_00 + 0xf4) + 4)); operator_delete(*(void **)this,0x18); FID_conflict__Erase_tree_>_> (this_01,(fuzzer_allocator_> *)this_01, *(_Tree_node **)(*this_01 + 4)); operator_delete((void *)*this_01,0x18); FUN_00498f80(); std::vector::_Tidy(); std::string::_Tidy_deallocate(this_00 + 0xc0); std::string::_Tidy_deallocate(this_00 + 0xa8); std::string::_Tidy_deallocate(this_00 + 0x90); std::string::_Tidy_deallocate(this_00 + 0x78); std::string::_Tidy_deallocate(this_00 + 0x60); std::string::_Tidy_deallocate(this_00 + 0x48); std::string::_Tidy_deallocate(this_00 + 0x30); std::string::_Tidy_deallocate(this_00 + 0x18); std::string::_Tidy_deallocate(this_00); local_8 = 0xffffffff; operator_delete(this_00,0xf04); } puVar2 = puVar2 + 1; } while (puVar2 != (undefined4 *)in_ECX[1]); puVar2 = (undefined4 *)*in_ECX; } in_ECX[1] = (int)puVar2; FUN_008fc570(); ExceptionList = local_10; return; } //@@ 008f5ad0 ModManager::TryRedirectPath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void ModManager::TryRedirectPath(std_string* result, std_string* filePath); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall ModManager::TryRedirectPath(ModManager *this,std_string *result,std_string *filePath) { uint uVar1; uint uVar2; uint uVar3; ModManager ptr; undefined4 *puVar4; byte *pbVar5; byte ****ppppbVar6; uint ****ppppuVar7; int iVar8; undefined4 extraout_ECX; void *pvVar9; std_string *psVar10; uint uVar11; ModManager MVar12; undefined4 *local_a8; uint ****local_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 local_8c; uint uStack_88; void *local_84 [4]; undefined4 local_74; uint local_70; void *local_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined8 local_5c; byte ****local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_44; uint local_40; uint ****local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_84 + 0x20); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b07895; local_1c = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_84 + 0x1d); ExceptionList = &local_1c; psVar10 = filePath; if (0xf < filePath->_capacity) { psVar10 = *(std_string **)filePath->_buf; } local_24 = uVar1; uVar2 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash((byte *)psVar10); uVar1 = FUN_00a15ab0(extraout_ECX,uVar1); uVar11 = uVar2 & 0x7fff; uVar3 = 0; ptr = this[uVar11 + 3]; if (ptr != (ModManager)0x0) { do { if (((*(uint *)ptr == uVar2) && (*(uint *)((int)ptr + 4) == uVar1)) || (0x7fff < uVar3)) break; uVar11 = uVar11 + 1 & 0x7fff; uVar3 = uVar3 + 1; ptr = this[uVar11 + 3]; } while (ptr != (ModManager)0x0); if (uVar3 == 0x8000) { if (ptr != (ModManager)0x0) { std::string::_Tidy_deallocate((char *)((int)ptr + 0xc)); operator_delete((void *)ptr,0x24); } } else if (ptr != (ModManager)0x0) goto LAB_008f608f; } ptr = (ModManager)operator_new(0x24); if (ptr == (ModManager)0x0) { ptr = (ModManager)0x0; } else { *(uint *)((int)ptr + 0xc) = 0; *(uint *)((int)ptr + 0x1c) = 0; *(uint *)((int)ptr + 0x20) = 0xf; } *(uint *)ptr = uVar2; *(uint *)((int)ptr + 4) = uVar1; *(uint *)((int)ptr + 8) = 0; this[uVar11 + 3] = ptr; MVar12 = *this; if (MVar12 != this[1]) { do { uVar1 = *(uint *)MVar12; if (*(char *)(uVar1 + 0xfd) != '\0') { uVar2 = *(uint *)(uVar1 + 0x40); local_a8 = (undefined4 *)(uVar1 + 0x30); if (0xf < *(uint *)(uVar1 + 0x44)) { local_a8 = (undefined4 *)*local_a8; } if (uVar2 < 0x10) { local_54 = (byte ****)*local_a8; uStack_50 = local_a8[1]; uStack_4c = local_a8[2]; uStack_48 = local_a8[3]; uVar1 = 0xf; } else { uVar1 = uVar2 | 0xf; if (0x7fffffff < uVar1) { uVar1 = 0x7fffffff; } local_54 = std::_Allocate(uVar1 + 1); memcpy(local_54,local_a8,uVar2 + 1); } local_14 = (void *)0x0; uVar3 = uVar2 - 1; if (uVar2 < uVar2 - 1) { uVar3 = uVar2; } ppppbVar6 = (byte ****)&local_54; if (0xf < uVar1) { ppppbVar6 = local_54; } local_74 = 0; local_70 = 0xf; local_84[0] = (void *)0x0; local_44 = uVar2; local_40 = uVar1; std::string::assign((char *)local_84,(byte *)ppppbVar6,uVar3); local_14._0_1_ = 1; puVar4 = std::string::append((char *)local_84,(byte *)"-dlc3/",6); local_6c = (void *)*puVar4; uStack_68 = puVar4[1]; uStack_64 = puVar4[2]; uStack_60 = puVar4[3]; local_5c = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 2; psVar10 = filePath; if (0xf < filePath->_capacity) { psVar10 = *(std_string **)filePath->_buf; } puVar4 = std::string::append((char *)&local_6c,(byte *)psVar10,filePath->_size); local_3c = (uint ****)*puVar4; uStack_38 = puVar4[1]; uStack_34 = puVar4[2]; uStack_30 = puVar4[3]; local_2c = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 4; if (0xf < local_5c._4_4_) { uVar1 = local_5c._4_4_ + 1; pvVar9 = local_6c; if (0xfff < uVar1) { pvVar9 = *(void **)((int)local_6c + -4); uVar1 = local_5c._4_4_ + 0x24; if (0x1f < (uint)((int)local_6c + (-4 - (int)pvVar9))) goto LAB_008f6140; } operator_delete(pvVar9,uVar1); } local_5c = 0xf00000000; local_6c = (void *)((uint)local_6c & 0xffffff00); local_14._0_1_ = 5; if (0xf < local_70) { uVar1 = local_70 + 1; pvVar9 = local_84[0]; if (0xfff < uVar1) { pvVar9 = *(void **)((int)local_84[0] + -4); uVar1 = local_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar9))) goto LAB_008f6140; } operator_delete(pvVar9,uVar1); } local_74 = 0; ppppuVar7 = (uint ****)&local_3c; if (0xf < local_2c._4_4_) { ppppuVar7 = local_3c; } local_70 = 0xf; local_84[0] = (void *)((uint)local_84[0] & 0xffffff00); pbVar5 = FileSystem::ResolvePath((byte *)ppppuVar7); if (pbVar5 == (byte *)0x0) { if (0x7fffffff - local_44 < filePath->_size) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar6 = (byte ****)&local_54; if (0xf < local_40) { ppppbVar6 = local_54; } psVar10 = filePath; if (0xf < filePath->_capacity) { psVar10 = *(std_string **)filePath->_buf; } std::string::concat((char *)&local_9c,(int)result,psVar10,(byte *)ppppbVar6,local_44, (byte *)psVar10,filePath->_size); if (0xf < local_2c._4_4_) { uVar1 = local_2c._4_4_ + 1; ppppuVar7 = local_3c; if (0xfff < uVar1) { ppppuVar7 = (uint ****)local_3c[-1]; uVar1 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)ppppuVar7))) goto LAB_008f6140; } operator_delete(ppppuVar7,uVar1); } local_3c = local_9c; uStack_38 = uStack_98; uStack_34 = uStack_94; uStack_30 = uStack_90; ppppuVar7 = (uint ****)&local_3c; if (0xf < uStack_88) { ppppuVar7 = local_9c; } local_2c = CONCAT44(uStack_88,local_8c); pbVar5 = FileSystem::ResolvePath((byte *)ppppuVar7); if (pbVar5 != (byte *)0x0) { local_14._0_1_ = 7; tracked_alloc(1,pbVar5,0); local_14._0_1_ = 5; } if (pbVar5 == (byte *)0x0) { if (0xf < local_2c._4_4_) { uVar1 = local_2c._4_4_ + 1; ppppuVar7 = local_3c; if (0xfff < uVar1) { ppppuVar7 = (uint ****)local_3c[-1]; uVar1 = local_2c._4_4_ + 0x24; local_14._0_1_ = 0; if (0x1f < (uint)((int)local_3c + (-4 - (int)ppppuVar7))) goto LAB_008f6140; } local_14._0_1_ = pbVar5 != (byte *)0x0; operator_delete(ppppuVar7,uVar1); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_2c = 0xf00000000; local_3c = (uint ****)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar1 = local_40 + 1; ppppbVar6 = local_54; if (0xfff < uVar1) { ppppbVar6 = (byte ****)local_54[-1]; uVar1 = local_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54 + (-4 - (int)ppppbVar6))) goto LAB_008f6140; } operator_delete(ppppbVar6,uVar1); } goto LAB_008f5fd3; } *(uint *)((int)ptr + 8) = *(uint *)MVar12; if ((uint *****)((int)ptr + 0xc) != &local_3c) { ppppuVar7 = (uint ****)&local_3c; if (0xf < local_2c._4_4_) { ppppuVar7 = local_3c; } std::string::assign((char *)((int)ptr + 0xc),(byte *)ppppuVar7,(uint)local_2c); } local_14._0_1_ = 0; if (0xf < local_2c._4_4_) { uVar1 = local_2c._4_4_ + 1; ppppuVar7 = local_3c; if (0xfff < uVar1) { ppppuVar7 = (uint ****)local_3c[-1]; uVar1 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)ppppuVar7))) goto LAB_008f6140; } operator_delete(ppppuVar7,uVar1); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_2c = 0xf00000000; local_3c = (uint ****)((uint)local_3c & 0xffffff00); if (local_40 < 0x10) break; uVar1 = local_40 + 1; ppppbVar6 = local_54; if (0xfff < uVar1) { ppppbVar6 = (byte ****)local_54[-1]; iVar8 = (int)local_54 - (int)ppppbVar6; goto joined_r0x008f613a; } } else { local_14._0_1_ = 6; tracked_alloc(1,pbVar5,0); local_14._0_1_ = 5; *(uint *)((int)ptr + 8) = *(uint *)MVar12; if ((uint *****)((int)ptr + 0xc) != &local_3c) { ppppuVar7 = (uint ****)&local_3c; if (0xf < local_2c._4_4_) { ppppuVar7 = local_3c; } std::string::assign((char *)((int)ptr + 0xc),(byte *)ppppuVar7,(uint)local_2c); } local_14._0_1_ = 0; if (0xf < local_2c._4_4_) { uVar1 = local_2c._4_4_ + 1; ppppuVar7 = local_3c; if (0xfff < uVar1) { ppppuVar7 = (uint ****)local_3c[-1]; uVar1 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)ppppuVar7))) goto LAB_008f6140; } operator_delete(ppppuVar7,uVar1); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_2c = 0xf00000000; local_3c = (uint ****)((uint)local_3c & 0xffffff00); if (local_40 < 0x10) break; uVar1 = local_40 + 1; ppppbVar6 = local_54; if (0xfff < uVar1) { ppppbVar6 = (byte ****)local_54[-1]; iVar8 = (int)local_54 - (int)ppppbVar6; joined_r0x008f613a: local_14._1_3_ = 0xffffff; local_14._0_1_ = 0xff; local_2c = 0xf00000000; uVar1 = local_40 + 0x24; if (0x1f < iVar8 - 4U) { LAB_008f6140: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } local_2c = 0xf00000000; local_14._1_3_ = 0xffffff; local_14._0_1_ = 0xff; operator_delete(ppppbVar6,uVar1); break; } LAB_008f5fd3: MVar12 = (ModManager)((int)MVar12 + 4); } while (MVar12 != this[1]); } LAB_008f608f: if (*(uint *)((int)ptr + 8) != 0) { filePath = (std_string *)((int)ptr + 0xc); } std::string::string(result->_buf,filePath); ExceptionList = local_1c; return; } //@@ 008f6190 FUN_008f6190 uint FUN_008f6190(int param_1,int param_2) { uint uVar1; byte *a; byte *b; a = (byte *)(param_1 + 0x18); b = (byte *)(param_2 + 0x18); if (0xf < *(uint *)(param_2 + 0x2c)) { b = *(byte **)b; } if (0xf < *(uint *)(param_1 + 0x2c)) { a = *(byte **)a; } uVar1 = string_compare(a,*(uint *)(param_1 + 0x28),b,*(uint *)(param_2 + 0x28)); return uVar1 >> 0x1f; } //@@ 008f61d0 ModManager::ListMods /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x008f6bfe) */ /* ZHL [exact] __thiscall void ModManager::ListMods(); */ void __thiscall ModManager::ListMods(ModManager *this) { uint *ptr; char cVar1; ModManager MVar2; qword qVar3; code *tag; byte **ppbVar4; undefined4 uVar5; byte bVar6; uint uVar7; byte *pbVar8; int *piVar9; void *pvVar10; byte ***pppbVar11; undefined4 *puVar12; byte **ppbVar13; byte ******ppppppbVar14; ModManager MVar15; byte *pbVar16; char *pcVar17; std_string *psVar18; byte **ppbVar19; char *pcVar20; uint uVar21; byte *pbVar22; qword *pqVar23; byte ******ppppppbVar24; byte **ppbVar25; int iVar26; byte **ppbVar27; byte ***pppbVar28; int iStack_10104; char *pcStack_100fc; uint uStack_100f8; code *pcStack_100f4; byte **ppbStack_100f0; void *pvStack_100ec; byte *pbStack_100e8; byte *pbStack_100e4; byte **ppbStack_100e0; byte **ppbStack_100dc; byte **ppbStack_100d8; char cStack_100d1; undefined4 uStack_100d0; undefined4 uStack_100cc; undefined4 uStack_100c0; undefined4 uStack_100bc; undefined4 *puStack_100b8; undefined4 *puStack_100b4; undefined4 uStack_100b0; undefined1 *puStack_100a0; undefined1 *puStack_1009c; undefined4 *puStack_10098; undefined1 auStack_10094 [65536]; undefined4 uStack_94; undefined4 uStack_90; void *apvStack_88 [5]; uint uStack_74; byte *pbStack_70; byte *pbStack_6c; byte *pbStack_68; byte *pbStack_64; byte *pbStack_60; byte *pbStack_5c; byte ******appppppbStack_58 [4]; std_string *psStack_48; uint uStack_44; undefined1 auStack_40 [8]; byte *pbStack_38; byte *pbStack_34; byte *pbStack_30; byte *pbStack_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = auStack_40 + 0x3c; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b0790d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(auStack_40 + 0x30); ExceptionList = &local_1c; uStack_100f8 = 0; ppbStack_100e0 = (byte **)0x0; local_24 = uVar7; pvStack_100ec = (void *)filesys_list_directory(&s_empty,g_modsDirectory,&ppbStack_100e0); KAGE_LogMessage(1,(byte *)"begin list mods\n"); ppbVar4 = ppbStack_100e0; tag = free_exref; iStack_10104 = 0; ppbStack_100f0 = (byte **)0x0; if (ppbStack_100e0 != (byte **)0x0) { pcStack_100f4 = tolower_exref; pvVar10 = pvStack_100ec; do { ppbVar25 = ppbStack_100f0; if ((*(byte *)((int)pvVar10 + (int)ppbStack_100f0 * 8) & 2) != 0) { psStack_48 = (std_string *)0x0; uStack_44 = 0xf; appppppbStack_58[0] = (byte ******)0x0; pbVar8 = g_modsDirectory; do { pbVar16 = pbVar8; pbVar8 = pbVar16 + 1; } while (*pbVar16 != 0); std::string::assign((char *)appppppbStack_58,g_modsDirectory,(uint)(pbVar16 + -0xc72e28)); uStack_14 = 0; pbVar8 = *(byte **)((int)pvVar10 + (int)ppbVar25 * 8 + 4); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); std::string::append((char *)appppppbStack_58,pbVar8,(int)pbVar16 - (int)(pbVar8 + 1)); ppppppbVar14 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar14 = appppppbStack_58[0]; } pcStack_100fc = (char *)((int)ppppppbVar14 + (int)psStack_48->_buf); ppppppbVar24 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar24 = appppppbStack_58[0]; } if (ppppppbVar24 != (byte ******)pcStack_100fc) { iVar26 = (int)ppppppbVar14 - (int)ppppppbVar24; do { bVar6 = (*pcStack_100f4)((int)(char)*(byte *)ppppppbVar24); *(byte *)((int)ppppppbVar24 + iVar26) = bVar6; ppppppbVar24 = (byte ******)((int)ppppppbVar24 + 1); } while (ppppppbVar24 != (byte ******)pcStack_100fc); } ppppppbVar14 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar14 = appppppbStack_58[0]; } pbVar8 = path_join((byte *)"/metadata.xml",(byte *)ppppppbVar14,0,0); piVar9 = FileSystem::Open(&PTR_vftable_00c37a10,pbVar8,(int *)0x0); if (pbVar8 != (byte *)0x0) { operator_delete(pbVar8,1); } pvVar10 = operator_new(0xf04); uStack_14._0_1_ = 1; if (pvVar10 == (void *)0x0) { ppbStack_100dc = (byte **)0x0; } else { ppbStack_100dc = (byte **)ModEntry::ModEntry(); } uStack_14 = (uint)uStack_14._1_3_ << 8; pcStack_100fc = (char *)ppbStack_100dc; if (piVar9 != (int *)0x0) { pppbVar11 = (byte ***)(**(code **)(*piVar9 + 4))(); ppbStack_100e0 = operator_new_tracked((int)pppbVar11 + 1); pbVar8 = (byte *)0x1; pppbVar28 = pppbVar11; (**(code **)(*piVar9 + 0x14))(ppbStack_100e0); *(byte *)((int)ppbStack_100e0 + (int)pppbVar11) = 0; (**(code **)*piVar9)(1); puStack_100a0 = auStack_10094; uStack_100d0 = 0; puStack_1009c = auStack_10094; uStack_100cc = 0; uStack_100c0 = 0; uStack_100bc = 0; puStack_10098 = &uStack_94; uStack_94 = 0; uStack_90 = 0; uStack_14 = CONCAT31(uStack_14._1_3_,2); puStack_100b8 = (undefined4 *)0x0; uStack_100b0 = 0; ppbStack_100d8 = ppbStack_100e0; if (((*(byte *)ppbStack_100e0 == 0xef) && (*(byte *)((int)ppbStack_100e0 + 1) == 0xbb)) && (*(byte *)((int)ppbStack_100e0 + 2) == 0xbf)) { ppbStack_100d8 = (byte **)((int)ppbStack_100e0 + 3); } while( true ) { bVar6 = (byte)pppbVar28; cVar1 = (&DAT_00b1b060)[*(byte *)ppbStack_100d8]; while (cVar1 != '\0') { pbVar16 = (byte *)((int)ppbStack_100d8 + 1); ppbStack_100d8 = (byte **)((int)ppbStack_100d8 + 1); cVar1 = (&DAT_00b1b060)[*pbVar16]; } if (*(byte *)ppbStack_100d8 == 0) goto LAB_008f6571; if (*(byte *)ppbStack_100d8 != 0x3c) break; ppbStack_100d8 = (byte **)((int)ppbStack_100d8 + 1); pppbVar28 = &ppbStack_100d8; pbVar8 = (byte *)0x8f650e; puVar12 = (undefined4 *)rapidxml::xml_document::parse_node(pppbVar28); if (puVar12 == (undefined4 *)0x0) { } else { if (puStack_100b8 == (undefined4 *)0x0) { puVar12[10] = 0; puStack_100b8 = puVar12; } else { puVar12[10] = puStack_100b4; puStack_100b4[0xb] = puVar12; } puVar12[4] = &uStack_100d0; puVar12[0xb] = 0; puStack_100b4 = puVar12; } } g_xmlParseError = (byte *)s_expected_<_00b1b66c; LAB_008f6571: pcVar20 = "metadata"; do { pcVar17 = pcVar20; pcVar20 = pcVar17 + 1; } while (*pcVar20 != '\0'); ppbStack_100d8 = (byte **)(pcVar17 + -0xb76e9f); puVar12 = puStack_100b8; if (puStack_100b8 != (undefined4 *)0x0) { LAB_008f6596: pbVar16 = (byte *)*puVar12; if (pbVar16 == (byte *)0x0) { ppbVar25 = (byte **)0x0; pbVar16 = &g_xmlNullStr; } else { ppbVar25 = (byte **)puVar12[2]; } if (ppbVar25 != ppbStack_100d8) goto LAB_008f67da; pbVar22 = (byte *)((int)ppbVar25 + (int)pbVar16); if (pbVar16 < pbVar22) { iVar26 = (int)"metadata" - (int)pbVar16; while (*pbVar16 == pbVar16[iVar26]) { pbVar16 = pbVar16 + 1; if (pbVar22 <= pbVar16) goto LAB_008f65d0; } goto LAB_008f67da; } LAB_008f65d0: pvVar10 = xml_node::first_node(puVar12,s_name,(int)pbVar8,bVar6); if (pvVar10 != (void *)0x0) { pbVar8 = &g_xmlNullStr; if (*(byte **)((int)pvVar10 + 4) != (byte *)0x0) { pbVar8 = *(byte **)((int)pvVar10 + 4); } ppbStack_100d8 = (byte **)(pbVar8 + 1); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); uVar21 = (int)pbVar16 - (int)ppbStack_100d8; std::string::assign((char *)(ppbStack_100dc + 6),pbVar8,uVar21); bVar6 = (byte)uVar21; } pvVar10 = xml_node::first_node(puVar12,(byte *)"directory",(int)pbVar8,bVar6); if (pvVar10 != (void *)0x0) { pbVar8 = &g_xmlNullStr; if (*(byte **)((int)pvVar10 + 4) != (byte *)0x0) { pbVar8 = *(byte **)((int)pvVar10 + 4); } pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); uVar21 = (int)pbVar16 - (int)(pbVar8 + 1); std::string::assign((char *)ppbStack_100dc,pbVar8,uVar21); bVar6 = (byte)uVar21; } pvVar10 = xml_node::first_node(puVar12,(byte *)"description",(int)pbVar8,bVar6); if (pvVar10 != (void *)0x0) { pbVar8 = &g_xmlNullStr; if (*(byte **)((int)pvVar10 + 4) != (byte *)0x0) { pbVar8 = *(byte **)((int)pvVar10 + 4); } ppbStack_100d8 = (byte **)(pbVar8 + 1); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); uVar21 = (int)pbVar16 - (int)ppbStack_100d8; std::string::assign((char *)(ppbStack_100dc + 0x2a),pbVar8,uVar21); bVar6 = (byte)uVar21; } pvVar10 = xml_node::first_node(puVar12,(byte *)"version",(int)pbVar8,bVar6); if (pvVar10 != (void *)0x0) { pbVar8 = &g_xmlNullStr; if (*(byte **)((int)pvVar10 + 4) != (byte *)0x0) { pbVar8 = *(byte **)((int)pvVar10 + 4); } ppbStack_100d8 = (byte **)(pbVar8 + 1); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); uVar21 = (int)pbVar16 - (int)ppbStack_100d8; std::string::assign((char *)(ppbStack_100dc + 0x1e),pbVar8,uVar21); bVar6 = (byte)uVar21; } pvVar10 = xml_node::first_node(puVar12,s_id,(int)pbVar8,bVar6); if (pvVar10 != (void *)0x0) { pbVar8 = &g_xmlNullStr; if (*(byte **)((int)pvVar10 + 4) != (byte *)0x0) { pbVar8 = *(byte **)((int)pvVar10 + 4); } ppbStack_100d8 = (byte **)(pbVar8 + 1); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); uVar21 = (int)pbVar16 - (int)ppbStack_100d8; std::string::assign((char *)(ppbStack_100dc + 0x24),pbVar8,uVar21); bVar6 = (byte)uVar21; } pvVar10 = xml_node::first_node(puVar12,(byte *)"visibility",(int)pbVar8,bVar6); if (pvVar10 != (void *)0x0) { pbVar8 = &g_xmlNullStr; if (*(byte **)((int)pvVar10 + 4) != (byte *)0x0) { pbVar8 = *(byte **)((int)pvVar10 + 4); } ppbStack_100d8 = (byte **)(pbVar8 + 1); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); uVar21 = (int)pbVar16 - (int)ppbStack_100d8; std::string::assign((char *)(ppbStack_100dc + 0x30),pbVar8,uVar21); bVar6 = (byte)uVar21; } ppbStack_100d8 = xml_node::first_node(puVar12,&DAT_00b6e3b4,(int)pbVar8,bVar6); if (ppbStack_100d8 != (byte **)0x0) { LAB_008f67a0: ppbVar25 = ppbStack_100dc; pbVar8 = s_id; do { pbStack_100e4 = pbVar8; pbVar8 = pbStack_100e4 + 1; } while (*pbVar8 != 0); pbStack_100e4 = pbStack_100e4 + -0xb1bfef; for (pbVar8 = ppbStack_100d8[8]; pbVar8 != (byte *)0x0; pbVar8 = *(byte **)(pbVar8 + 0x18)) { pbVar16 = *(byte **)pbVar8; if (pbVar16 == (byte *)0x0) { pbVar22 = (byte *)0x0; pbVar16 = &g_xmlNullStr; } else { pbVar22 = *(byte **)(pbVar8 + 8); } if (pbVar22 == pbStack_100e4) { pbVar22 = pbVar22 + (int)pbVar16; if (pbVar22 <= pbVar16) goto LAB_008f6921; iVar26 = (int)s_id - (int)pbVar16; while (*pbVar16 == pbVar16[iVar26]) { pbVar16 = pbVar16 + 1; if (pbVar22 <= pbVar16) goto LAB_008f6921; } } } pbVar8 = (byte *)0x0; LAB_008f6921: if (pbVar8 != (byte *)0x0) { pbVar16 = &g_xmlNullStr; if (*(byte **)(pbVar8 + 4) != (byte *)0x0) { pbVar16 = *(byte **)(pbVar8 + 4); } pbStack_30 = (byte *)0x0; pbStack_2c = (byte *)0xf; auStack_40._0_4_ = (byte *)0x0; pbVar8 = pbVar16; do { bVar6 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar6 != 0); std::string::assign(auStack_40,pbVar16,(int)pbVar8 - (int)(pbVar16 + 1)); uVar5 = auStack_40._0_4_; uStack_14._0_1_ = 3; psVar18 = (std_string *)ppbVar25[0x37]; if (psVar18 == (std_string *)ppbVar25[0x38]) { vector_string_emplace_reallocate_move (ppbVar25 + 0x36,psVar18,(std_string *)auStack_40); pbVar8 = pbStack_2c; } else { auStack_40._0_4_ = auStack_40._0_4_ & 0xffffff00; *(undefined4 *)psVar18->_buf = uVar5; *(undefined4 *)(psVar18->_buf + 4) = auStack_40._4_4_; *(byte **)(psVar18->_buf + 8) = pbStack_38; *(byte **)(psVar18->_buf + 0xc) = pbStack_34; psVar18->_size = (uint)pbStack_30; psVar18->_capacity = (uint)pbStack_2c; ppbVar25[0x37] = ppbVar25[0x37] + 0x18; pbVar8 = (byte *)0xf; } uStack_14 = CONCAT31(uStack_14._1_3_,2); if ((byte *)0xf < pbVar8) { pbVar22 = pbVar8 + 1; pbVar16 = (byte *)auStack_40._0_4_; if ((byte *)0xfff < pbVar22) { pbVar16 = *(byte **)(auStack_40._0_4_ + -4); pbVar22 = pbVar8 + 0x24; if ((byte *)0x1f < (byte *)(auStack_40._0_4_ + (-4 - (int)pbVar16))) goto LAB_008f70a8; } operator_delete(pbVar16,(uint)pbVar22); } } pcVar20 = "tag"; do { pcVar17 = pcVar20; pcVar20 = pcVar17 + 1; } while (*pcVar20 != '\0'); ppbStack_100d8 = (byte **)ppbStack_100d8[0xb]; if (ppbStack_100d8 != (byte **)0x0) { do { pbVar8 = *ppbStack_100d8; if (pbVar8 == (byte *)0x0) { pbVar16 = (byte *)0x0; pbVar8 = &g_xmlNullStr; } else { pbVar16 = ppbStack_100d8[2]; } if (pbVar16 == (byte *)(pcVar17 + -0xb6e3b3)) { pbVar16 = pbVar8 + (int)pbVar16; if (pbVar16 <= pbVar8) goto LAB_008f67a0; iVar26 = (int)&DAT_00b6e3b4 - (int)pbVar8; while (*pbVar8 == pbVar8[iVar26]) { pbVar8 = pbVar8 + 1; if (pbVar16 <= pbVar8) goto LAB_008f67a0; } } ppbStack_100d8 = (byte **)ppbStack_100d8[0xb]; if (ppbStack_100d8 == (byte **)0x0) break; } while( true ); } } } LAB_008f67e5: uStack_14._0_1_ = 4; tracked_alloc(1,ppbStack_100e0,0); uStack_14._0_1_ = 5; xml_memory_pool::clear(&puStack_100a0); uStack_14 = (uint)uStack_14._1_3_ << 8; } cStack_100d1 = '\0'; if (ppbStack_100dc[10] == (byte *)0x0) { pbVar8 = *(byte **)((int)pvStack_100ec + (int)ppbStack_100f0 * 8 + 4); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); std::string::assign((char *)(ppbStack_100dc + 6),pbVar8,(int)pbVar16 - (int)(pbVar8 + 1)); cStack_100d1 = '\x01'; } if (ppbStack_100dc[4] == (byte *)0x0) { pbVar8 = *(byte **)((int)pvStack_100ec + (int)ppbStack_100f0 * 8 + 4); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); std::string::assign((char *)ppbStack_100dc,pbVar8,(int)pbVar16 - (int)(pbVar8 + 1)); cStack_100d1 = '\x01'; } if (ppbStack_100dc[0x22] == (byte *)0x0) { std::string::assign((char *)(ppbStack_100dc + 0x1e),&DAT_00b76e84,3); cStack_100d1 = '\x01'; } if (ppbStack_100dc[5] < (byte *)0x10) { ppbStack_100e0 = (byte **)((int)ppbStack_100dc + (int)ppbStack_100dc[4]); ppbVar25 = ppbStack_100dc; ppbVar13 = ppbStack_100dc; if ((byte *)0xf < ppbStack_100dc[5]) goto LAB_008f6a7e; } else { ppbStack_100e0 = (byte **)((int)*ppbStack_100dc + (int)ppbStack_100dc[4]); ppbVar13 = (byte **)*ppbStack_100dc; LAB_008f6a7e: ppbVar25 = (byte **)*ppbStack_100dc; } if (ppbVar25 != ppbStack_100e0) { iVar26 = (int)ppbVar13 - (int)ppbVar25; do { bVar6 = (*pcStack_100f4)((int)(char)*(byte *)ppbVar25); *(byte *)((int)ppbVar25 + iVar26) = bVar6; ppbVar25 = (byte **)((int)ppbVar25 + 1); } while (ppbVar25 != ppbStack_100e0); } if (cStack_100d1 != '\0') { ModEntry::parse_metadata_xml(); } ppbVar25 = ppbStack_100dc; pcVar20 = &DAT_00c73228; do { pcVar17 = pcVar20; pcVar20 = pcVar17 + 1; } while (*pcVar17 != '\0'); psVar18 = (std_string *)(pcVar17 + -0xc73228); if ((std_string *)(0x7fffffffU - (int)ppbStack_100dc[4]) < psVar18) goto LAB_008f70e6; ppbVar13 = ppbStack_100dc; if ((byte *)0xf < ppbStack_100dc[5]) { ppbVar13 = (byte **)*ppbStack_100dc; } std::string::concat((char *)apvStack_88,(int)pbStack_100e4,psVar18,&DAT_00c73228, (uint)psVar18,(byte *)ppbVar13,(uint)ppbStack_100dc[4]); uStack_100f8 = uStack_100f8 | 1; uStack_14 = CONCAT31(uStack_14._1_3_,6); piVar9 = std::string::append((char *)apvStack_88,(byte *)&DAT_00b6db28,1); ppbVar13 = ppbVar25 + 0x18; pbStack_70 = (byte *)*piVar9; pbStack_6c = (byte *)piVar9[1]; pbStack_68 = (byte *)piVar9[2]; pbStack_64 = (byte *)piVar9[3]; pbStack_100e8 = (byte *)piVar9[4]; pbStack_100e4 = (byte *)piVar9[5]; piVar9[4] = 0; piVar9[5] = 0xf; *(undefined1 *)piVar9 = 0; pbStack_60 = pbStack_100e8; pbStack_5c = pbStack_100e4; pbStack_38 = pbStack_70; pbStack_34 = pbStack_6c; pbStack_30 = pbStack_68; pbStack_2c = pbStack_64; if (ppbVar13 == &pbStack_70) { if (&DAT_0000000f < pbStack_100e4) { pbVar16 = pbStack_100e4 + 1; pbVar8 = pbStack_70; if ((byte *)0xfff < pbVar16) { pbVar8 = *(byte **)(pbStack_70 + -4); pbVar16 = pbStack_100e4 + 0x24; if ((byte *)0x1f < pbStack_70 + (-4 - (int)pbVar8)) goto LAB_008f70a8; } operator_delete(pbVar8,(uint)pbVar16); } } else { std::string::_Tidy_deallocate((char *)ppbVar13); *ppbVar13 = pbStack_38; ppbVar25[0x19] = pbStack_34; ppbVar25[0x1a] = pbStack_30; ppbVar25[0x1b] = pbStack_2c; ppbVar25[0x1c] = pbStack_100e8; ppbVar25[0x1d] = pbStack_100e4; } uStack_14 = uStack_14 & 0xffffff00; if (0xf < uStack_74) { uVar21 = uStack_74 + 1; pvVar10 = apvStack_88[0]; if (0xfff < uVar21) { pvVar10 = *(void **)((int)apvStack_88[0] + -4); uVar21 = uStack_74 + 0x24; if (0x1f < (uint)((int)apvStack_88[0] + (-4 - (int)pvVar10))) goto LAB_008f70a8; } operator_delete(pvVar10,uVar21); } pbStack_100e4 = ppbVar25[0x1d]; if (pbStack_100e4 < (byte *)0x10) { ppbVar27 = (byte **)((int)ppbVar13 + (int)ppbVar25[0x1c]); ppbVar19 = ppbVar13; ppbVar25 = ppbVar13; if (&DAT_0000000f < pbStack_100e4) goto LAB_008f6c13; } else { ppbVar27 = (byte **)(ppbVar25[0x1c] + (int)*ppbVar13); ppbVar19 = (byte **)*ppbVar13; LAB_008f6c13: ppbVar25 = (byte **)*ppbVar13; ppbVar13 = ppbVar19; } if (ppbVar25 != ppbVar27) { pbStack_100e4 = (byte *)((int)ppbVar13 - (int)ppbVar25); do { bVar6 = (*pcStack_100f4)((int)(char)*(byte *)ppbVar25); *(byte *)((int)ppbVar25 + (int)pbStack_100e4) = bVar6; ppbVar25 = (byte **)((int)ppbVar25 + 1); } while (ppbVar25 != ppbVar27); } pbVar8 = *(byte **)((int)pvStack_100ec + (int)ppbStack_100f0 * 8 + 4); pbVar16 = pbVar8; do { bVar6 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar6 != 0); std::string::assign((char *)ppbStack_100dc,pbVar8,(int)pbVar16 - (int)(pbVar8 + 1)); if (ppbStack_100dc[5] < (byte *)0x10) { ppbStack_100e0 = (byte **)((int)ppbStack_100dc + (int)ppbStack_100dc[4]); ppbVar25 = ppbStack_100dc; ppbVar13 = ppbStack_100dc; if ((byte *)0xf < ppbStack_100dc[5]) goto LAB_008f6c95; } else { ppbStack_100e0 = (byte **)((int)*ppbStack_100dc + (int)ppbStack_100dc[4]); ppbVar13 = (byte **)*ppbStack_100dc; LAB_008f6c95: ppbVar25 = (byte **)*ppbStack_100dc; } if (ppbVar25 != ppbStack_100e0) { iVar26 = (int)ppbVar13 - (int)ppbVar25; do { bVar6 = (*pcStack_100f4)((int)(char)*(byte *)ppbVar25); *(byte *)((int)ppbVar25 + iVar26) = bVar6; ppbVar25 = (byte **)((int)ppbVar25 + 1); } while (ppbVar25 != ppbStack_100e0); } if (0x7fffffffU - (int)psStack_48 < 0xb) { LAB_008f70e6: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppppbVar14 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar14 = appppppbStack_58[0]; } std::string::concat(auStack_40,(int)pbStack_100e4,psStack_48,(byte *)ppppppbVar14, (uint)psStack_48,(byte *)"/resources/",0xb); ppbVar13 = ppbStack_100dc; ppbVar25 = ppbStack_100dc + 0xc; if (ppbVar25 == (byte **)auStack_40) { if ((byte *)0xf < pbStack_2c) { pbVar16 = pbStack_2c + 1; pbVar8 = (byte *)auStack_40._0_4_; if ((byte *)0xfff < pbVar16) { pbVar8 = *(byte **)(auStack_40._0_4_ + -4); pbVar16 = pbStack_2c + 0x24; if ((byte *)0x1f < (byte *)(auStack_40._0_4_ + (-4 - (int)pbVar8))) goto LAB_008f70a8; } operator_delete(pbVar8,(uint)pbVar16); } } else { std::string::_Tidy_deallocate((char *)ppbVar25); *ppbVar25 = (byte *)auStack_40._0_4_; ppbVar13[0xd] = (byte *)auStack_40._4_4_; ppbVar13[0xe] = pbStack_38; ppbVar13[0xf] = pbStack_34; ppbVar13[0x10] = pbStack_30; ppbVar13[0x11] = pbStack_2c; } if (0x7fffffffU - (int)psStack_48 < 9) goto LAB_008f70e6; ppppppbVar14 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar14 = appppppbStack_58[0]; } std::string::concat(auStack_40,(int)pbStack_100e4,psStack_48,(byte *)ppppppbVar14, (uint)psStack_48,(byte *)"/content/",9); ppbVar25 = ppbVar13 + 0x12; if (ppbVar25 == (byte **)auStack_40) { if ((byte *)0xf < pbStack_2c) { pbVar16 = pbStack_2c + 1; pbVar8 = (byte *)auStack_40._0_4_; if ((byte *)0xfff < pbVar16) { pbVar8 = *(byte **)(auStack_40._0_4_ + -4); pbVar16 = pbStack_2c + 0x24; if ((byte *)0x1f < (byte *)(auStack_40._0_4_ + (-4 - (int)pbVar8))) goto LAB_008f70a8; } operator_delete(pbVar8,(uint)pbVar16); } } else { std::string::_Tidy_deallocate((char *)ppbVar25); *ppbVar25 = (byte *)auStack_40._0_4_; ppbVar13[0x13] = (byte *)auStack_40._4_4_; ppbVar13[0x14] = pbStack_38; ppbVar13[0x15] = pbStack_34; ppbVar13[0x16] = pbStack_30; ppbVar13[0x17] = pbStack_2c; } if (0x7fffffffU - (int)psStack_48 < 0xb) goto LAB_008f70e6; ppppppbVar14 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar14 = appppppbStack_58[0]; } std::string::concat(auStack_40,(int)pbStack_100e4,psStack_48,(byte *)ppppppbVar14, (uint)psStack_48,(byte *)"/disable.it",0xb); uStack_14 = CONCAT31(uStack_14._1_3_,7); pbVar8 = auStack_40; if ((byte *)0xf < pbStack_2c) { pbVar8 = (byte *)auStack_40._0_4_; } pbVar8 = FileSystem::ResolvePath(pbVar8); cStack_100d1 = pbVar8 != (byte *)0x0; if (pbVar8 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar23 = &g_allocatedBytesNoHeap; } else { pqVar23 = (qword *)((int)g_mainHeap + 0x30); } uVar21 = *(uint *)(pbVar8 + -4); qVar3 = *pqVar23; *(uint *)pqVar23 = (uint)*pqVar23 - uVar21; *(uint *)((int)pqVar23 + 4) = *(uint *)((int)pqVar23 + 4) - (uint)((uint)qVar3 < uVar21); free(pbVar8 + -4); } uStack_14 = uStack_14 & 0xffffff00; if ((byte *)0xf < pbStack_2c) { pbVar16 = pbStack_2c + 1; pbVar8 = (byte *)auStack_40._0_4_; if ((byte *)0xfff < pbVar16) { pbVar8 = *(byte **)(auStack_40._0_4_ + -4); pbVar16 = pbStack_2c + 0x24; if ((byte *)0x1f < (byte *)(auStack_40._0_4_ + (-4 - (int)pbVar8))) goto LAB_008f70a8; } operator_delete(pbVar8,(uint)pbVar16); } pbStack_30 = (byte *)0x0; pbStack_2c = (byte *)0xf; auStack_40._0_4_ = auStack_40._0_4_ & 0xffffff00; if (cStack_100d1 == '\0') { bVar6 = (g_manager->_optionsConfig)._enableMods; } else { bVar6 = 0; } *(byte *)((int)ppbVar13 + 0xfd) = bVar6; *(bool *)(ppbVar13 + 0x3f) = cStack_100d1 == '\0'; if (0x7fffffffU - (int)psStack_48 < 10) goto LAB_008f70e6; ppppppbVar14 = (byte ******)appppppbStack_58; if (0xf < uStack_44) { ppppppbVar14 = appppppbStack_58[0]; } std::string::concat(auStack_40,(int)tag,psStack_48,(byte *)ppppppbVar14,(uint)psStack_48, (byte *)"/update.it",10); uStack_100f8 = uStack_100f8 | 0x3e; uStack_14._0_1_ = 9; pbVar8 = auStack_40; if ((byte *)0xf < pbStack_2c) { pbVar8 = (byte *)auStack_40._0_4_; } pbVar8 = FileSystem::ResolvePath(pbVar8); cStack_100d1 = pbVar8 != (byte *)0x0; if (pbVar8 != (byte *)0x0) { uStack_14._0_1_ = 10; tracked_alloc(1,pbVar8,0); } uStack_14 = (uint)uStack_14._1_3_ << 8; std::string::_Tidy_deallocate(auStack_40); if (cStack_100d1 != '\0') { *(undefined2 *)(ppbVar13 + 0x3f) = 0; *(byte *)((int)ppbVar13 + 0xfe) = 1; } iVar26 = iStack_10104 + 1; if (*(byte *)((int)ppbVar13 + 0xfd) == 0) { iVar26 = iStack_10104; } MVar2 = this[1]; if (MVar2 == this[2]) { std::vector<4byte>::_Emplace_reallocate(MVar2,&pcStack_100fc); } else { *(byte ***)MVar2 = ppbVar13; this[1] = (ModManager)((int)this[1] + 4); } KAGE_LogMessage(1,(byte *)"LOADED MOD %s\n"); uStack_14 = 0xffffffff; if (0xf < uStack_44) { uVar21 = uStack_44 + 1; ppppppbVar14 = appppppbStack_58[0]; if (0xfff < uVar21) { ppppppbVar14 = (byte ******)appppppbStack_58[0][-1]; uVar21 = uStack_44 + 0x24; if ((byte *)0x1f < (byte *)((int)appppppbStack_58[0] + (-4 - (int)ppppppbVar14))) { LAB_008f70a8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar14,uVar21); } pvVar10 = pvStack_100ec; iStack_10104 = iVar26; } ppbStack_100f0 = (byte **)((int)ppbStack_100f0 + 1); } while (ppbStack_100f0 < ppbVar4); } if (pvStack_100ec != (void *)0x0) { ptr = (uint *)((int)pvStack_100ec + -4); uStack_14 = 0xb; _eh_vector_destructor_iterator_(pvStack_100ec,8,*ptr,FUN_00a5a420); operator_delete(ptr,*ptr * 8 + 4); uStack_14 = 0xffffffff; } std::_Sort_unchecked((int)this[1] - (int)*this >> 2,FUN_008f6190,uVar7); MVar2 = this[0x8097]; if (MVar2 != (ModManager)0x3) { if (iStack_10104 == 0) { if ((MVar2 == (ModManager)0x2) || (MVar15 = (ModManager)0x1, MVar2 == (ModManager)0x4)) { MVar15 = (ModManager)0x4; } this[0x8097] = MVar15; } else { this[0x8097] = (ModManager)0x2; } } ExceptionList = local_1c; return; LAB_008f67da: puVar12 = (undefined4 *)puVar12[0xb]; if (puVar12 == (undefined4 *)0x0) goto LAB_008f67e5; goto LAB_008f6596; } //@@ 008f70f0 LuaEngine::LuamodCMD /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix43/44] __thiscall char* LuaEngine::LuamodCMD(char * modname); prototype: REPENTOGON, confirmed by RET 4 */ byte * __thiscall LuaEngine::LuamodCMD(LuaEngine *this,byte *modname) { uint *puVar1; byte bVar2; byte *pbVar3; undefined4 *puVar4; byte *pbVar5; LuaEngine *pLVar6; byte *******pppppppbVar7; undefined4 extraout_EAX; byte *pbVar8; void *pvVar9; uint uVar10; LuaEngine LVar11; void *local_5c [4]; undefined4 local_4c; uint local_48; void *local_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined8 local_34; byte *******local_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 local_1c; uint uStack_18; uint local_14; LuaEngine local_10; undefined1 *puStack_c; void *local_8; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00b0795d; local_10 = (LuaEngine)ExceptionList; local_14 = __security_cookie ^ (uint)(local_5c + 0x16); ExceptionList = &local_10; LVar11 = *this; pLVar6 = ExceptionList; if (LVar11 != this[1]) { do { pbVar5 = *(byte **)LVar11; if (pbVar5[0xfd] != 0) { pbVar3 = modname; if (0xf < *(uint *)(modname + 0x14)) { pbVar3 = *(byte **)modname; } pbVar8 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar8 = *(byte **)pbVar5; } bVar2 = str_eq(pbVar8,*(uint *)(pbVar5 + 0x10),pbVar3,*(uint *)(modname + 0x10)); if (bVar2 != 0) { local_4c = 0; local_48 = 0xf; local_5c[0] = (void *)0x0; pbVar3 = g_modsDirectory; do { pbVar8 = pbVar3; pbVar3 = pbVar8 + 1; } while (*pbVar8 != 0); std::string::assign((char *)local_5c,g_modsDirectory,(uint)(pbVar8 + -0xc72e28)); local_8 = (void *)0x0; puVar1 = (uint *)(pbVar5 + 0x10); if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } puVar4 = std::string::append((char *)local_5c,pbVar5,*puVar1); local_44 = (void *)*puVar4; uStack_40 = puVar4[1]; uStack_3c = puVar4[2]; uStack_38 = puVar4[3]; local_34 = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_8._0_1_ = 1; puVar4 = std::string::append((char *)&local_44,(byte *)"/main.lua",9); local_2c = (byte *******)*puVar4; uStack_28 = puVar4[1]; uStack_24 = puVar4[2]; uStack_20 = puVar4[3]; local_1c = puVar4[4]; uStack_18 = puVar4[5]; puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_8._0_1_ = 3; if (0xf < local_34._4_4_) { uVar10 = local_34._4_4_ + 1; pvVar9 = local_44; if (0xfff < uVar10) { pvVar9 = *(void **)((int)local_44 + -4); uVar10 = local_34._4_4_ + 0x24; if (0x1f < (uint)((int)local_44 + (-4 - (int)pvVar9))) goto LAB_008f73d3; } operator_delete(pvVar9,uVar10); } local_34 = 0xf00000000; local_44 = (void *)((uint)local_44 & 0xffffff00); local_8._0_1_ = 4; if (0xf < local_48) { uVar10 = local_48 + 1; pvVar9 = local_5c[0]; if (0xfff < uVar10) { pvVar9 = *(void **)((int)local_5c[0] + -4); uVar10 = local_48 + 0x24; if (0x1f < (uint)((int)local_5c[0] + (-4 - (int)pvVar9))) goto LAB_008f73d3; } operator_delete(pvVar9,uVar10); } local_4c = 0; pppppppbVar7 = (byte *******)&local_2c; if (0xf < uStack_18) { pppppppbVar7 = local_2c; } local_48 = 0xf; local_5c[0] = (void *)((uint)local_5c[0] & 0xffffff00); pbVar5 = FileSystem::ResolvePath((byte *)pppppppbVar7); if (pbVar5 != (byte *)0x0) { local_8._0_1_ = 5; tracked_alloc(1,pbVar5,0); local_8._0_1_ = 4; DAT_00c71698 = *(int *)LVar11; pppppppbVar7 = (byte *******)&local_2c; if (0xf < uStack_18) { pppppppbVar7 = local_2c; } pbVar5 = (byte *)FUN_0086e6c0(pppppppbVar7); DAT_00c71698 = 0; if (uStack_18 < 0x10) { DAT_00c71698 = 0; ExceptionList = (void *)local_10; return pbVar5; } uVar10 = uStack_18 + 1; pppppppbVar7 = local_2c; if (0xfff < uVar10) { pppppppbVar7 = (byte *******)local_2c[-1]; uVar10 = uStack_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)pppppppbVar7))) { LAB_008f73d3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar7,uVar10); ExceptionList = (void *)local_10; return (byte *)CONCAT31((int3)((uint)extraout_EAX >> 8),(char)pbVar5); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < uStack_18) { uVar10 = uStack_18 + 1; pppppppbVar7 = local_2c; if (0xfff < uVar10) { pppppppbVar7 = (byte *******)local_2c[-1]; uVar10 = uStack_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c + (-4 - (int)pppppppbVar7))) goto LAB_008f73d3; } operator_delete(pppppppbVar7,uVar10); } } } LVar11 = (LuaEngine)((int)LVar11 + 4); pLVar6 = this; } while (LVar11 != this[1]); } ExceptionList = (void *)local_10; return (byte *)((uint)pLVar6 & 0xffffff00); } //@@ 008f73f0 ModManager::TriggerResize /* ZHL [exact] __thiscall void ModManager::TriggerResize(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall ModManager::TriggerResize(ModManager *this) { FUN_008f7dd0(); unload_shaders(); LoadShaders(this); create_shader_render_targets(this); return; } //@@ 008f7420 FUN_008f7420 void FUN_008f7420(void) { int *piVar1; undefined4 *puVar2; int *in_ECX; int *piVar3; int *piVar4; undefined8 local_10; piVar4 = (int *)*in_ECX; if (piVar4 != (int *)in_ECX[1]) { do { if ((*(char *)(*piVar4 + 0xfd) != '\0') && (piVar1 = *(int **)(*piVar4 + 0xe4), piVar3 = (int *)*piVar1, piVar3 != piVar1)) { do { local_10 = 0; std::vector::resize(&local_10); puVar2 = std::deque::back(); if ((byte *)(puVar2 + 1) != (byte *)0x0) { *(byte *)(puVar2 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar2 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)(piVar3[2] + 0x68),1); piVar3 = (int *)*piVar3; } while (piVar3 != (int *)*(int *)(*piVar4 + 0xe4)); } piVar4 = piVar4 + 1; } while (piVar4 != (int *)in_ECX[1]); } return; } //@@ 008f74c0 Game::render_mod_shaders /* DB: ? called near the end of Game::Render (after 009c3890(2)): builds LuaRef (00865490) from mod shader entries, LuaRef::push params (MC_GET_SHADER_PARAMS style), render target push/pop, render_quad_set_uniform_color, memcpy uniforms */ void Game::render_mod_shaders(void) { 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 local_d0; 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 *local_80; int vertexIndex; int vertexData; float *paramNameChars; undefined4 ****local_70; KColor KStack_6c; float *vertexCursor; int vertexOffset; int *paramIter; int paramOffset; void *local_44; 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 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b079a5; local_1c = ExceptionList; ExceptionList = &local_1c; modCursor = in_ECX[1]; if (modCursor != *in_ECX) { local_80 = in_ECX; do { iVar8 = modCursor; if (*(char *)(*(int *)(modCursor + -4) + 0xfd) != '\0') { piVar6 = *(int **)(*(int *)(modCursor + -4) + 0xe4); if (piVar6 != (int *)*piVar6) { do { _glfw_context_reset(1); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } RenderTarget::Clear(&DAT_00c798e0); 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; local_d0 = 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 *)(*(int *)(iVar2 + 8) + 0x18); if ((pvVar4 != (void *)0x0) && ((*(byte *)(*(int *)(iVar2 + 8) + 0x1c) & 1) != 0)) { iVar2 = *shaderEntry; g_currentShader = pvVar4; } iVar2 = (**(code **)(**(int **)(*(int *)(iVar2 + 8) + 0x68) + 0x14)) (&local_d0,quad,g_drawRectUnset); vertexData = iVar2; if (iVar2 != 0) { vertexStride = *(int *)(*(int *)(*shaderEntry + 8) + 0x78) + 0xe; lua_callback_run_get_shader_params(&luaState,*(int *)(*shaderEntry + 8)); vertexCursor = (float *)(iVar2 + 0x28); vertexStrideBytes = vertexStride << 2; local_14 = 0; vertexIndex = 0; vertexOffset = 0; piVar6 = shaderEntry; iVar2 = vertexStride; do { pvVar4 = luaState; paramOffset = 0xe; iVar1 = *(int *)(*(int *)(*(int *)(*piVar6 + 8) + 0x68) + 0x10); vertexCursor[-1] = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) ; iVar1 = *(int *)(*(int *)(*(int *)(*piVar6 + 8) + 0x68) + 0x14); *vertexCursor = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); iVar1 = *(int *)(*(int *)(*(int *)(*piVar6 + 8) + 0x68) + 0x18); vertexCursor[1] = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); iVar1 = *(int *)(*(int *)(*(int *)(*piVar6 + 8) + 0x68) + 0x1c); vertexCursor[2] = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); ppppuVar9 = (undefined4 ****)g_screenPointScale; vertexCursor[3] = g_screenPointScale; if (paramsRef != -1) { LuaRef::push(&luaState,luaState); iVar2 = lua_type(pvVar4,0xffffffff); lua_settop(luaState,0xfffffffe); if ((iVar2 == 5) && (piVar6 = *(int **)(*(int *)(*shaderEntry + 8) + 0x70), paramIter = (int *)*piVar6, paramIter != piVar6)) { local_a0 = luaState; local_9c = paramsRef; do { piVar6 = paramIter; paramNameChars = (float *)(paramIter + 4); paramNameSize = (float)paramIter[8]; local_70 = (undefined4 ****)0x0; KStack_6c._alpha = 0.0; KStack_6c._unk = 0; local_90 = (double)CONCAT44(paramNameSize,(undefined4)local_90); if (0xf < (uint)paramIter[9]) { paramNameChars = (float *)*paramNameChars; } if ((uint)paramNameSize < 0x10) { ppppuVar9 = (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 = (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,(int)local_90._4_4_ + 1); KStack_6c._unk = (int)local_38._4_4_; KStack_6c._alpha = local_90._4_4_; ppppuVar5 = &local_70; if (0xf < local_38._4_4_) { ppppuVar5 = local_70; } } lua_pushlstring(luaState,ppppuVar5,KStack_6c._alpha); paramNameRef = luaL_ref(luaState,0xfff0b9d8); if (0xf < (uint)KStack_6c._unk) { uVar7 = KStack_6c._unk + 1; ppppuVar5 = local_70; if (0xfff < uVar7) { ppppuVar5 = (undefined4 ****)local_70[-1]; uVar7 = KStack_6c._unk + 0x24; if (0x1f < (uint)((int)local_70 + (-4 - (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 = (undefined4 ****)((uint)local_70 & 0xffffff00); local_44 = luaState; FUN_0085c270(luaState); paramValueRef = luaL_ref(luaState,0xfff0b9d8); luaL_unref(luaState,0xfff0b9d8,paramNameRef); if (piVar6[10] == 1) { if (paramValueRef != -1) { LuaRef::push(&local_44,luaState); uVar3 = lua_type(luaState,0xffffffff); local_38 = (double)CONCAT44(uVar3,(undefined4)local_38); lua_settop(luaState,0xfffffffe); if (local_38._4_4_ != (undefined4 ****)0x3) goto LAB_008f79b0; LuaRef::push(&local_44,luaState); uVar3 = lua_gettop(luaState); luaNumber = (float10)luaL_checknumber(luaState,uVar3); local_38 = (double)CONCAT44((float)luaNumber,(undefined4)local_38); lua_settop(luaState,0xfffffffe); *(undefined4 *****)(vertexData + (paramOffset + vertexOffset) * 4) = local_38._4_4_; ppppuVar9 = local_38._4_4_; } } else { LAB_008f79b0: if (paramValueRef != -1) { LuaRef::push(&local_44,luaState); uVar3 = lua_type(luaState,0xffffffff); local_38 = (double)CONCAT44(uVar3,(undefined4)local_38); lua_settop(luaState,0xfffffffe); if (local_38._4_4_ == (undefined4 ****)0x5) { LuaRef::push(&local_44,luaState); lua_len(luaState,0xffffffff); luaNumber = (float10)luaL_checknumber(luaState,0xffffffff); local_38 = (double)luaNumber; lua_settop(luaState,0xfffffffe); lua_settop(luaState,0xfffffffe); if ((int)local_38 == piVar6[10]) { local_38 = (double)CONCAT44(1,(undefined4)local_38); LuaRef::push(&local_44,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 < (int)local_90) { local_ac = luaState; local_a8 = paramValueRef; iVar8 = (int)local_38._4_4_; 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; LuaRef::push(&local_44,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 <= (int)local_38); piVar6 = paramIter; iVar8 = modCursor; } } } } } paramOffset = paramOffset + piVar6[10]; local_14 = local_14 & 0xffffff00; luaL_unref(luaState,0xfff0b9d8,paramValueRef); paramIter = (int *)piVar6[2]; if (*(char *)((int)paramIter + 0xd) == '\0') { isNilNode = *(char *)(*paramIter + 0xd); piVar6 = (int *)*paramIter; while (isNilNode == '\0') { isNilNode = *(char *)(*piVar6 + 0xd); paramIter = piVar6; piVar6 = (int *)*piVar6; } } else { isNilNode = *(char *)(piVar6[1] + 0xd); nextNode = (int *)piVar6[1]; while ((paramIter = nextNode, isNilNode == '\0' && (piVar6 == (int *)paramIter[2]))) { isNilNode = *(char *)(paramIter[1] + 0xd); nextNode = (int *)paramIter[1]; piVar6 = paramIter; } } } while (paramIter != *(int **)(*(int *)(*shaderEntry + 8) + 0x70)); } piVar6 = shaderEntry; iVar2 = vertexStride; } vertexCursor = (float *)((int)vertexCursor + vertexStrideBytes); vertexIndex = vertexIndex + 1; vertexOffset = vertexOffset + iVar2; } while (vertexIndex < 4); local_14 = 0xffffffff; luaL_unref(luaState,0xfff0b9d8,paramsRef); } piVar6 = (int *)*shaderEntry; } while (piVar6 != (int *)**(undefined4 **)(*(int *)(iVar8 + -4) + 0xe4)); in_ECX = local_80; } } modCursor = iVar8 + -4; } while (modCursor != *in_ECX); } ExceptionList = local_1c; return; } //@@ 008f7c40 ModManager::create_shader_render_targets /* DB: ? walks the mod vector (ECX+0/+4); for each mod with shaders (+0xfd) creates a framebuffer-sized render target (KAGE_Graphics::create_render_target with g_framebufferWidth/14) for every shader in its list (+0xe4) lacking one (+0x68); callers Game::constructor (last call), ModManager::TriggerResize, 007084c0 prototype: db/protos.zhl */ void __thiscall ModManager::create_shader_render_targets(ModManager *this) { int *piVar1; undefined4 uVar2; char cVar3; uint uVar4; byte *name; void *other; undefined4 *extraout_EAX; int *piVar5; ModManager MVar6; KColor local_3c; undefined1 local_28 [4]; int *local_24; undefined1 local_20 [4]; int *local_1c; ModManager *local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b079dd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; MVar6 = *this; local_18 = this; if (MVar6 != this[1]) { do { if ((*(char *)(*(int *)MVar6 + 0xfd) != '\0') && (piVar1 = *(int **)(*(int *)MVar6 + 0xe4), piVar5 = (int *)*piVar1, piVar5 != piVar1)) { do { name = (byte *)piVar5[2]; if (*(int *)(name + 0x68) == 0) { local_3c._unk = 0; local_3c._red = 0.0; local_3c._green = 0.0; local_3c._blue = 0.0; local_3c._alpha = 0.0; if (0xf < *(uint *)(name + 0x14)) { name = *(byte **)name; } other = KAGE_Graphics::create_render_target (local_28,g_framebufferWidth,DAT_00c79114,name,&local_3c); local_8 = 0; local_14 = (undefined4 *)(piVar5[2] + 0x68); shared_ptr::assign(local_20,other); uVar2 = extraout_EAX[1]; extraout_EAX[1] = local_14[1]; local_14[1] = uVar2; uVar2 = *extraout_EAX; *extraout_EAX = *local_14; *local_14 = uVar2; local_8 = CONCAT31(local_8._1_3_,1); if (((local_1c != (int *)0x0) && (cVar3 = (**(code **)(*local_1c + 0xc))(uVar4), cVar3 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_20); } local_8 = 2; if (((local_24 != (int *)0x0) && (cVar3 = (**(code **)(*local_24 + 0xc))(), cVar3 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_28); } local_8 = 0xffffffff; piVar1 = *(int **)(piVar5[2] + 0x68); if ((piVar1[0xe] != 1) || (piVar1[0xf] != 1)) { (**(code **)(*piVar1 + 0x48))(1,1); piVar1[0xe] = 1; piVar1[0xf] = 1; } } piVar5 = (int *)*piVar5; } while (piVar5 != (int *)*(int *)(*(int *)MVar6 + 0xe4)); } MVar6 = (ModManager)((int)MVar6 + 4); } while (MVar6 != local_18[1]); } ExceptionList = local_10; return; } //@@ 008f7dd0 FUN_008f7dd0 void FUN_008f7dd0(void) { int *piVar1; int *in_ECX; int *extraout_ECX; int *piVar2; int *piVar3; int *piVar4; piVar4 = (int *)*in_ECX; piVar2 = in_ECX; if (piVar4 != (int *)in_ECX[1]) { do { if ((*(char *)(*piVar4 + 0xfd) != '\0') && (piVar1 = *(int **)(*piVar4 + 0xe4), piVar3 = (int *)*piVar1, piVar3 != piVar1)) { do { KAGE::SmartPointer::reset(piVar2); piVar3 = (int *)*piVar3; piVar2 = extraout_ECX; } while (piVar3 != (int *)*(int *)(*piVar4 + 0xe4)); } piVar4 = piVar4 + 1; } while (piVar4 != (int *)in_ECX[1]); } return; } //@@ 008f7e20 ModManager::unload_shaders /* DB: ? ECX=ModManager: for each mod (vector at +0) with shaders enabled (+0xfd) walks its shader list (+0xe4): resets the RenderTargetBase smart pointer, destroys the shader (ShaderBase vftable, FUN_00a149a0/00a15310), frees param tables; from ModManager::TriggerResize and the ModManager unload 008f5960 */ void ModManager::unload_shaders(void) { uint *_Memory; int *piVar1; uint uVar2; char *this; undefined4 *puVar3; undefined4 *puVar4; qword qVar5; char cVar6; uint uVar7; qword *pqVar8; int *in_ECX; int iVar9; void *pvVar10; uint uVar11; int *piVar12; int *piVar13; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07a00; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar13 = (int *)*in_ECX; if (piVar13 != (int *)in_ECX[1]) { do { iVar9 = *piVar13; if (*(char *)(iVar9 + 0xfd) != '\0') { piVar12 = (int *)**(int **)(iVar9 + 0xe4); if (piVar12 != *(int **)(iVar9 + 0xe4)) { do { KAGE::SmartPointer::reset(piVar12[2] + 0x68); (**(code **)(*(int *)(piVar12[2] + 0x18) + 4))(uVar7); iVar9 = piVar12[2]; uVar11 = 5; pvVar10 = g_mainHeap; if (5 < *(int *)(iVar9 + 0x74) + 5U) { do { iVar9 = *(int *)(*(int *)(iVar9 + 0x7c) + uVar11 * 8); pqVar8 = (qword *)((int)pvVar10 + 0x30); if (pvVar10 == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } if (iVar9 != 0) { _Memory = (uint *)(iVar9 + -4); uVar2 = *_Memory; qVar5 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar2; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar5 < uVar2); free(_Memory); pvVar10 = g_mainHeap; } iVar9 = piVar12[2]; uVar11 = uVar11 + 1; } while (uVar11 < *(int *)(iVar9 + 0x74) + 5U); } iVar9 = *(int *)(iVar9 + 0x7c); if (pvVar10 == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)pvVar10 + 0x30); } if (iVar9 != 0) { uVar11 = *(uint *)(iVar9 + -4); qVar5 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar11; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar5 < uVar11) ; free((void *)(iVar9 + -4)); } local_8 = 0xffffffff; this = (char *)piVar12[2]; if (this != (char *)0x0) { piVar1 = (int *)(this + 0x70); FUN_004235c0(piVar1,*(undefined4 *)(*piVar1 + 4)); operator_delete((void *)*piVar1,0x2c); local_8 = 2; if (((*(int **)(this + 0x6c) != (int *)0x0) && (cVar6 = (**(code **)(**(int **)(this + 0x6c) + 0xc))(), cVar6 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(this + 0x68); } local_8 = 0xffffffff; *(undefined ***)(this + 0x18) = KAGE::Graphics::ShaderBase::vftable; KAGE::Graphics::ShaderBase::free_uniforms(this + 0x18); FID_conflict__Tidy(this + 0x58); FUN_00a15310(); std::string::_Tidy_deallocate(this); operator_delete(this,0x80); } iVar9 = *piVar13; piVar12 = (int *)*piVar12; } while (piVar12 != (int *)*(int *)(iVar9 + 0xe4)); } puVar3 = *(undefined4 **)(iVar9 + 0xe4); *(undefined4 *)puVar3[1] = 0; puVar3 = (undefined4 *)*puVar3; while (puVar3 != (undefined4 *)0x0) { puVar4 = (undefined4 *)*puVar3; operator_delete(puVar3,0xc); puVar3 = puVar4; } *(undefined4 *)*(undefined4 *)(iVar9 + 0xe4) = *(undefined4 *)(iVar9 + 0xe4); *(int *)(*(int *)(iVar9 + 0xe4) + 4) = *(int *)(iVar9 + 0xe4); *(undefined4 *)(iVar9 + 0xe8) = 0; } piVar13 = piVar13 + 1; } while (piVar13 != (int *)in_ECX[1]); } ExceptionList = local_10; return; } //@@ 008f8040 ModManager::LoadModRooms /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (ModManager::LoadModRooms(stageId,mode) ret8) */ void ModManager::LoadModRooms(int param_1,int param_2) { RoomConfig_Stage *pRVar1; char cVar2; RoomConfig_Stage RVar3; undefined4 *puVar4; byte *ptr; std_string *psVar5; RoomConfig_Stage RVar6; RoomConfig_Stage *pRVar7; int *in_ECX; RoomConfig_Stage length; void *pvVar8; uint uVar9; int *piVar10; int iVar11; RoomConfig_Stage *pRVar12; int iStack_b8; RoomConfig_Stage *pRStack_b4; RoomConfig_Stage local_b0; int iStack_ac; int *local_a8; int *piStack_a4; uint uStack_a0; uint *puStack_9c; int local_98; char cStack_91; RoomConfig_Stage *local_90; uint uStack_8c; int local_88; void *local_84 [5]; uint uStack_70; void *pvStack_6c; char acStack_68 [4]; char acStack_64 [4]; char acStack_60 [4]; uint uStack_5c; uint uStack_58; void *apvStack_54 [4]; undefined4 uStack_44; uint uStack_40; std_string *apsStack_3c [5]; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(apvStack_54 + 0x14); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b07a78; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(apvStack_54 + 0x11); ExceptionList = &local_1c; local_98 = param_1; local_88 = param_2; if ((g_game != (Game *)0x0) && (local_a8 = (int *)*in_ECX, local_a8 != (int *)in_ECX[1])) { do { piVar10 = local_a8; if (*(char *)(*local_a8 + 0xfd) != '\0') { local_90 = (RoomConfig_Stage *)(g_game->_ventricleRazorPortals + param_1 * 0xc4 + 0x598); RVar6 = (RoomConfig_Stage)(local_90 + param_2 * 0xb + 0x19); local_b0 = RVar6; RoomConfigStage::GetDisplayName(local_90,(std_string *)local_84,0x14); local_14 = (void *)0x0; KAGE_LogMessage(1,(byte *)"[ModManager] load stage %d: %s (mode %d)\n"); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < uStack_70) { uVar9 = uStack_70 + 1; pvVar8 = local_84[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)local_84[0] + -4); uVar9 = uStack_70 + 0x24; if (0x1f < (uint)((int)local_84[0] + (-4 - (int)pvVar8))) goto LAB_008f868f; } operator_delete(pvVar8,uVar9); } local_90 = (RoomConfig_Stage *)*piVar10; RVar3 = *(RoomConfig_Stage *)((int)RVar6 + 0x10); uStack_44 = 0; uStack_40 = 0xf; apvStack_54[0] = (void *)0x0; length = (RoomConfig_Stage)((int)RVar3 - 3U); if ((uint)RVar3 < (int)RVar3 - 3U) { length = RVar3; } RVar3 = RVar6; if (0xf < (uint)*(RoomConfig_Stage *)((int)RVar6 + 0x14)) { RVar3 = *(RoomConfig_Stage *)RVar6; } std::string::assign((char *)apvStack_54,(byte *)RVar3,(uint)length); local_14 = (void *)0x1; puVar4 = std::string::append((char *)apvStack_54,&UNK_00b6cb40,3); pvStack_6c = (void *)*puVar4; acStack_68 = (char [4])puVar4[1]; acStack_64 = (char [4])puVar4[2]; acStack_60 = (char [4])puVar4[3]; uStack_5c = puVar4[4]; uStack_58 = puVar4[5]; puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 2; Mod::GetContentPath(local_90,(std_string *)apsStack_3c,(std_string *)&pvStack_6c); local_14._0_1_ = 4; if (0xf < uStack_58) { uVar9 = uStack_58 + 1; pvVar8 = pvStack_6c; if (0xfff < uVar9) { pvVar8 = *(void **)((int)pvStack_6c + -4); uVar9 = uStack_58 + 0x24; if (0x1f < (uint)((int)pvStack_6c + (-4 - (int)pvVar8))) goto LAB_008f868f; } operator_delete(pvVar8,uVar9); } local_14._0_1_ = 5; if (0xf < uStack_40) { uVar9 = uStack_40 + 1; pvVar8 = apvStack_54[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)apvStack_54[0] + -4); uVar9 = uStack_40 + 0x24; if (0x1f < (uint)((int)apvStack_54[0] + (-4 - (int)pvVar8))) goto LAB_008f868f; } operator_delete(pvVar8,uVar9); } uStack_44 = 0; psVar5 = (std_string *)apsStack_3c; if (0xf < uStack_28) { psVar5 = apsStack_3c[0]; } uStack_40 = 0xf; apvStack_54[0] = (void *)((uint)apvStack_54[0] & 0xffffff00); ptr = FileSystem::ResolvePath((byte *)psVar5); cStack_91 = ptr != (byte *)0x0; if (ptr != (byte *)0x0) { local_14._0_1_ = 6; tracked_alloc(1,ptr,0); local_14._0_1_ = 5; } if (cStack_91 != '\0') { psVar5 = (std_string *)apsStack_3c; if (0xf < uStack_28) { psVar5 = apsStack_3c[0]; } piStack_a4 = FileSystem::Open(&PTR_vftable_00c37a10,(byte *)psVar5,(int *)0x0); if (piStack_a4 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"[ModManager] Failed to open room config files %s!\n"); } else { (**(code **)(*piStack_a4 + 0x14))(&iStack_b8,1,4); if (iStack_b8 != 0x31425453) { KAGE_LogMessage(1,(byte *)"[ModManager] bad room config header in %s!\n"); if (uStack_28 < 0x10) { ExceptionList = local_1c; return; } uVar9 = uStack_28 + 1; psVar5 = apsStack_3c[0]; if (uVar9 < 0x1000) { LAB_008f8695: operator_delete(psVar5,uVar9); ExceptionList = local_1c; return; } psVar5 = (std_string *)apsStack_3c[0][-1]._capacity; uVar9 = uStack_28 + 0x24; if ((byte *)((int)apsStack_3c[0] + (-4 - (int)psVar5)) < (byte *)0x20) goto LAB_008f8695; goto LAB_008f868f; } uStack_a0 = *(uint *)((int)RVar6 + 0x1c); (**(code **)(*piStack_a4 + 0x14))(&iStack_ac,4,1); if (iStack_ac == 0) { uStack_8c = *(uint *)((int)RVar6 + 0x1c); } else { KAGE_LogMessage(1,(byte *)"reallocate %d rooms.\n"); pRStack_b4 = (RoomConfig_Stage *)(*(int *)((int)RVar6 + 0x1c) + iStack_ac); local_90 = (RoomConfig_Stage *)0x0; uVar9 = -(uint)((int)(ZEXT48(pRStack_b4) * 0x5c >> 0x20) != 0) | (uint)(ZEXT48(pRStack_b4) * 0x5c); uStack_8c = (uint)pRStack_b4; puStack_9c = operator_new_tracked(-(uint)(0xfffffffb < uVar9) | uVar9 + 4); local_14._0_1_ = 7; if (puStack_9c == (uint *)0x0) { puStack_9c = (uint *)0x0; } else { *puStack_9c = uStack_8c; puStack_9c = puStack_9c + 1; _eh_vector_constructor_iterator_ (puStack_9c,0x5c,uStack_8c,(_func_void_void_ptr *)&UNK_00828b20, RoomConfigRoom::dtor); } local_14._0_1_ = 5; pRVar7 = *(RoomConfig_Stage **)((int)RVar6 + 0x18); pRStack_b4 = pRVar7 + *(int *)((int)RVar6 + 0x1c) * 0x17; if (pRVar7 != pRStack_b4) { local_90 = (RoomConfig_Stage *)(puStack_9c + 2); pRVar12 = pRVar7 + 10; do { local_90[-2] = *pRVar7; local_90[-1] = pRVar12[-9]; *local_90 = pRVar12[-8]; local_90[1] = pRVar12[-7]; local_90[2] = pRVar12[-6]; if (local_90 + 3 != pRVar12 + -5) { RVar6 = (RoomConfig_Stage)(pRVar12 + -5); if (0xf < (uint)*pRVar12) { RVar6 = *(RoomConfig_Stage *)RVar6; } std::string::assign((char *)(local_90 + 3),(byte *)RVar6,(uint)pRVar12[-1]); } pRVar7 = pRVar7 + 0x17; local_90[9] = pRVar12[1]; local_90[10] = pRVar12[2]; local_90[0xb] = pRVar12[3]; local_90[0xc] = pRVar12[4]; local_90[0xd] = pRVar12[5]; local_90[0xe] = pRVar12[6]; *(undefined2 *)(local_90 + 0xf) = *(undefined2 *)(pRVar12 + 7); local_90[0xf].field_0x2 = pRVar12[7].field_0x2; local_90[0xf].field_0x3 = pRVar12[7].field_0x3; local_90[0x10] = pRVar12[8]; local_90[0x11] = pRVar12[9]; local_90[0x12] = pRVar12[10]; local_90[0x13] = pRVar12[0xb]; pRVar1 = pRVar12 + 0xc; pRVar12 = pRVar12 + 0x17; local_90[0x14] = *pRVar1; local_90 = local_90 + 0x17; } while (pRVar7 != pRStack_b4); pRVar7 = *(RoomConfig_Stage **)((int)local_b0 + 0x18); piVar10 = local_a8; RVar6 = local_b0; } if (pRVar7 != (RoomConfig_Stage *)0x0) { pRVar12 = pRVar7 + -1; local_14._0_1_ = 8; _eh_vector_destructor_iterator_(pRVar7,0x5c,(uint)*pRVar12,RoomConfigRoom::dtor); operator_delete(pRVar12,(int)*pRVar12 * 0x5c + 4); local_14._0_1_ = 5; RVar6 = local_b0; } *(uint **)((int)RVar6 + 0x18) = puStack_9c; *(uint *)((int)RVar6 + 0x1c) = uStack_8c; } if (uStack_a0 < uStack_8c) { iVar11 = uStack_a0 * 0x5c; do { RoomConfig::ReadRoom(); *(int *)(*(int *)((int)RVar6 + 0x18) + 4 + iVar11) = local_88; puStack_9c = RoomSet::GetVariantSet ((RoomSet *)RVar6, *(uint *)(*(int *)((int)RVar6 + 0x18) + 8 + iVar11)); uStack_8c = *(uint *)(*(int *)((int)RVar6 + 0x18) + 0xc + iVar11); cVar2 = VariantRanges::Insert(uStack_8c); if (cVar2 == '\0') { uVar9 = *puStack_9c; piVar10 = *(int **)(uVar9 + 8); if ((piVar10 == (int *)0x0) || (*piVar10 + 2 != *(int *)(uVar9 + 4))) { *(int *)(uVar9 + 4) = *(int *)(uVar9 + 4) + 1; uStack_8c = *(uint *)(*puStack_9c + 4); } else { uStack_8c = *piVar10 + 1; *(int *)(uVar9 + 8) = piVar10[2]; *(int *)(*puStack_9c + 4) = piVar10[1]; operator_delete(piVar10,0xc); } } *(uint *)(*(int *)((int)RVar6 + 0x18) + 0xc + iVar11) = uStack_8c; iVar11 = iVar11 + 0x5c; uStack_a0 = uStack_a0 + 1; } while (uStack_a0 < *(uint *)((int)RVar6 + 0x1c)); piVar10 = local_a8; } (**(code **)*piStack_a4)(1); } } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < uStack_28) { uVar9 = uStack_28 + 1; psVar5 = apsStack_3c[0]; if (0xfff < uVar9) { psVar5 = (std_string *)apsStack_3c[0][-1]._capacity; uVar9 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)apsStack_3c[0] + (-4 - (int)psVar5))) { LAB_008f868f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar5,uVar9); } param_1 = local_98; param_2 = local_88; } local_a8 = piVar10 + 1; } while (local_a8 != (int *)in_ECX[1]); } ExceptionList = local_1c; return; } //@@ 008f86c0 ModManager::LoadModCurses /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (ModManager::LoadModCurses) */ void ModManager::LoadModCurses(void) { byte *ptr; std_string *psVar1; int *in_ECX; void *ptr_00; uint uVar2; undefined4 *puVar3; std_string local_44; std_string *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; std_string *local_8; puStack_c = &LAB_00b07ac5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; if ((g_game != (Game *)0x0) && (puVar3 = (undefined4 *)*in_ECX, puVar3 != (undefined4 *)in_ECX[1]) ) { do { if (*(char *)((int)*puVar3 + 0xfd) != '\0') { local_44._capacity = 0xf; local_44._size = 10; builtin_strncpy(local_44._buf,"curses.xml",0xb); local_8 = (std_string *)0x0; Mod::GetContentPath((void *)*puVar3,(std_string *)local_2c,&local_44); local_8._0_1_ = 2; if (0xf < local_44._capacity) { uVar2 = local_44._capacity + 1; ptr_00 = (void *)local_44._buf._0_4_; if (0xfff < uVar2) { ptr_00 = *(void **)(local_44._buf._0_4_ + -4); uVar2 = local_44._capacity + 0x24; if (0x1f < (uint)(local_44._buf._0_4_ + (-4 - (int)ptr_00))) goto LAB_008f884d; } operator_delete(ptr_00,uVar2); } psVar1 = (std_string *)local_2c; if (0xf < local_18) { psVar1 = local_2c[0]; } ptr = FileSystem::ResolvePath((byte *)psVar1); if (ptr != (byte *)0x0) { local_8._0_1_ = 3; tracked_alloc(1,ptr,0); local_8 = (std_string *)CONCAT31(local_8._1_3_,2); psVar1 = (std_string *)local_2c; if (0xf < local_18) { psVar1 = local_2c[0]; } RoomConfig::LoadCursesXml(&g_game->_roomConfig,(byte *)psVar1,1); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < local_18) { uVar2 = local_18 + 1; psVar1 = local_2c[0]; if (0xfff < uVar2) { psVar1 = (std_string *)local_2c[0][-1]._capacity; uVar2 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c[0] + (-4 - (int)psVar1))) { LAB_008f884d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar1,uVar2); } } puVar3 = puVar3 + 1; } while (puVar3 != (undefined4 *)in_ECX[1]); } ExceptionList = local_10; return; } //@@ 008f8860 ModManager::RenderCustomCharacterPortraits /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix142/370] __thiscall void ModManager::RenderCustomCharacterPortraits(int id, Vector* pos, ColorMod* color, Vector* scale); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall ModManager::RenderCustomCharacterPortraits (ModManager *this,int id,Vector *pos,ColorMod *color,Vector *scale) { ANM2 *this_00; float fVar1; float fVar2; float fVar3; byte bVar4; byte *pbVar5; uint uVar6; void *unused; std_string *psVar7; void *pvVar8; EntityConfig_Player *this_01; bool bVar9; std_string *local_40; void *local_3c [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0xb); if (id < 0) { return; } pvVar8 = (g_manager->_entityConfig)._players._begin; unused = (void *)((int)(g_manager->_entityConfig)._players._end - (int)pvVar8); if ((int)unused / 0x148 <= id) { return; } this_01 = (EntityConfig_Player *)(id * 0x148 + (int)pvVar8); if (this_01 == (EntityConfig_Player *)0x0) { return; } this_00 = this_01->_moddedMenuPortraitANM2; if (this_00 == (ANM2 *)0x0) { return; } ExceptionList = &local_1c; local_40 = EntityConfig_Player::GetDisplayName(this_01,(std_string *)local_3c,unused); local_14 = (void *)0x0; if (0xf < local_40->_capacity) { local_40 = *(std_string **)local_40->_buf; } pbVar5 = (this_00->_animState)._animData; if (pbVar5 != (byte *)0x0) { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } psVar7 = local_40; do { bVar4 = *pbVar5; bVar9 = bVar4 < (byte)psVar7->_buf[0]; if (bVar4 != psVar7->_buf[0]) { LAB_008f8953: uVar6 = -(uint)bVar9 | 1; goto LAB_008f8958; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar9 = bVar4 < (byte)psVar7->_buf[1]; if (bVar4 != psVar7->_buf[1]) goto LAB_008f8953; pbVar5 = pbVar5 + 2; psVar7 = (std_string *)(psVar7->_buf + 2); } while (bVar4 != 0); uVar6 = 0; LAB_008f8958: if ((uVar6 == 0) && ((*(char *)((int)(this_00->_animState)._animData + 0x34) == '\0' || ((this_00->_animState)._isPlaying != 0)))) goto LAB_008f8987; } bVar4 = ANM2::SetAnimation(this_00,(byte *)local_40,1); if (bVar4 != 0) { AnimationState::Rewind(&this_00->_animState); (this_00->_animState)._isPlaying = 1; } LAB_008f8987: local_14 = (void *)0xffffffff; if (0xf < local_28) { uVar6 = local_28 + 1; pvVar8 = local_3c[0]; if (0xfff < uVar6) { pvVar8 = *(void **)((int)local_3c[0] + -4); uVar6 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c[0] + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar6); } pvVar8 = this_01->_moddedMenuPortraitANM2; local_2c = 0; local_28 = 0xf; local_3c[0] = (void *)((uint)local_3c[0] & 0xffffff00); if ((ColorMod *)((int)pvVar8 + 0xa8) != color) { fVar1 = color->_tint[1]; fVar2 = color->_tint[2]; fVar3 = color->_tint[3]; ((ColorMod *)((int)pvVar8 + 0xa8))->_tint[0] = color->_tint[0]; *(float *)((int)pvVar8 + 0xac) = fVar1; *(float *)((int)pvVar8 + 0xb0) = fVar2; *(float *)((int)pvVar8 + 0xb4) = fVar3; fVar1 = color->_colorize[1]; fVar2 = color->_colorize[2]; fVar3 = color->_colorize[3]; *(float *)((int)pvVar8 + 0xb8) = color->_colorize[0]; *(float *)((int)pvVar8 + 0xbc) = fVar1; *(float *)((int)pvVar8 + 0xc0) = fVar2; *(float *)((int)pvVar8 + 0xc4) = fVar3; *(undefined8 *)((int)pvVar8 + 200) = *(undefined8 *)color->_offset; *(float *)((int)pvVar8 + 0xd0) = color->_offset[2]; pvVar8 = this_01->_moddedMenuPortraitANM2; } *(float *)((int)pvVar8 + 0x9c) = scale->x; *(float *)((int)pvVar8 + 0xa0) = scale->y; ANM2::Render(this_01->_moddedMenuPortraitANM2,pos,&g_vectorZero,&g_vectorZero); ExceptionList = local_1c; return; } //@@ 008f8a60 ModManager::RenderCustomGameOver /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (CharacterId, Vector* pos): EntityConfig_Player (0x148 stride) _moddedGameOverANM2, GetDisplayName, renders it; caller GameOver::Render (counterpart of RenderCustomCharacterMenu 008f8d00) */ void ModManager::RenderCustomGameOver(int param_1,Vector *param_2) { ANM2 *this; byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; void *unused; std_string *psVar5; void *pvVar6; EntityConfig_Player *this_00; bool bVar7; std_string *local_30; void *local_2c [4]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00aff10d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); if (param_1 < 0) { return; } pvVar6 = (g_manager->_entityConfig)._players._begin; unused = (void *)((int)(g_manager->_entityConfig)._players._end - (int)pvVar6); if ((int)unused / 0x148 <= param_1) { return; } this_00 = (EntityConfig_Player *)(param_1 * 0x148 + (int)pvVar6); if (this_00 == (EntityConfig_Player *)0x0) { return; } this = this_00->_moddedGameOverANM2; if (this == (ANM2 *)0x0) { return; } ExceptionList = &local_10; local_30 = EntityConfig_Player::GetDisplayName(this_00,(std_string *)local_2c,unused); local_8 = (void *)0x0; if (0xf < local_30->_capacity) { local_30 = *(std_string **)local_30->_buf; } pbVar1 = (this->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; psVar5 = local_30; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } do { bVar2 = *pbVar3; bVar7 = bVar2 < (byte)psVar5->_buf[0]; if (bVar2 != psVar5->_buf[0]) { LAB_008f8b40: uVar4 = -(uint)bVar7 | 1; goto LAB_008f8b45; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < (byte)psVar5->_buf[1]; if (bVar2 != psVar5->_buf[1]) goto LAB_008f8b40; pbVar3 = pbVar3 + 2; psVar5 = (std_string *)(psVar5->_buf + 2); } while (bVar2 != 0); uVar4 = 0; LAB_008f8b45: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((this->_animState)._isPlaying != 0)))) goto LAB_008f8b70; } bVar2 = ANM2::SetAnimation(this,(byte *)local_30,1); if (bVar2 != 0) { AnimationState::Rewind(&this->_animState); (this->_animState)._isPlaying = 1; } LAB_008f8b70: local_8 = (void *)0xffffffff; if (0xf < local_18) { uVar4 = local_18 + 1; pvVar6 = local_2c[0]; if (0xfff < uVar4) { pvVar6 = *(void **)((int)local_2c[0] + -4); uVar4 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar4); } local_1c = 0; local_18 = 0xf; local_2c[0] = (void *)((uint)local_2c[0] & 0xffffff00); ANM2::Render(this_00->_moddedGameOverANM2,param_2,&g_vectorZero,&g_vectorZero); ExceptionList = local_10; return; } //@@ 008f8c00 ModManager::Reset /* ZHL [exact] __thiscall void ModManager::Reset(); */ void __thiscall ModManager::Reset(ModManager *this) { void *this_00; Game *pGVar1; uint uVar2; uint uVar3; this_00 = g_luaEngine; KAGE_LogMessage(1,(byte *)"Lua is resetting!\n"); LuaEngine::destroy(this_00); LuaEngine::Init(this_00,*(byte *)((int)this_00 + 0x1c)); if (DAT_00c79860 != 0) { this[0x8097] = (ModManager)0x3; } FUN_008f5960(); ListMods(this); LoadShaders(this); Manager::unload_configs(); LoadModContent(); if (g_menuManager != (MenuManager *)0x0) { pause_screen_unload_sprites(); AnmCache::Clear(); FUN_00954710(); Menu_Character::Reset(&g_menuManager->_menuCharacter); Menu_Collection::reset(); } if (g_game != (Game *)0x0) { uVar3 = 0; uVar2 = 0; pGVar1 = g_game; do { if (uVar3 < 0x25) { RoomConfig_Stage::unload ((RoomConfig_Stage *)(pGVar1->_ventricleRazorPortals + uVar2 + 0x598)); pGVar1 = g_game; } uVar2 = uVar2 + 0xc4; uVar3 = uVar3 + 1; } while (uVar2 < 0x1c54); } return; } //@@ 008f8cd0 FUN_008f8cd0 uint FUN_008f8cd0(void) { int *piVar1; undefined4 *in_ECX; piVar1 = (int *)*in_ECX; while( true ) { if (piVar1 == (int *)in_ECX[1]) { return (uint)piVar1 & 0xffffff00; } if (*(char *)(*piVar1 + 0xfd) != '\0') break; piVar1 = piVar1 + 1; } return CONCAT31((int3)((uint)piVar1 >> 8),1); } //@@ 008f8d00 ModManager::RenderCustomCharacterMenu /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (CharacterId, Vector* RenderPos, Sprite* DefaultSprite) exactly as REPENTOGON: id bounds-checked against the 0x148-byte EntityConfig_Player vector, renders DefaultSprite layer 0 when no _moddedMenuBackgroundANM2 or !_renderCustomBackground, then the modded sprite with GetDisplayName; caller Menu_Character::render_wheel (the ZHL match at 00a54150 LobbySteam::find_by_id_string wrong) */ void ModManager::RenderCustomCharacterMenu(int param_1,Vector *param_2,Sprite *param_3) { byte *pbVar1; byte bVar2; byte *pbVar3; uint uVar4; void *unused; void *extraout_ECX; std_string *psVar5; void *pvVar6; ANM2 *this; EntityConfig_Player *this_00; bool bVar7; std_string *local_34; void *local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af85cd; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; if (param_1 < 0) { LAB_008f8e9e: Sprite::RenderLayer(param_3,0,param_2,&g_vectorZero,&g_vectorZero); ExceptionList = local_10; return; } pvVar6 = (g_manager->_entityConfig)._players._begin; unused = (void *)((int)(g_manager->_entityConfig)._players._end - (int)pvVar6); if ((((int)unused / 0x148 <= param_1) || (this_00 = (EntityConfig_Player *)(param_1 * 0x148 + (int)pvVar6), this_00 == (EntityConfig_Player *)0x0)) || (this = this_00->_moddedMenuBackgroundANM2, this == (ANM2 *)0x0)) goto LAB_008f8e9e; if (this_00->_renderCustomBackground == 0) { Sprite::RenderLayer(param_3,0,param_2,&g_vectorZero,&g_vectorZero); this = this_00->_moddedMenuBackgroundANM2; unused = extraout_ECX; } local_34 = EntityConfig_Player::GetDisplayName(this_00,(std_string *)local_30,unused); local_8 = (void *)0x0; if (0xf < local_34->_capacity) { local_34 = *(std_string **)local_34->_buf; } pbVar1 = (this->_animState)._animData; if (pbVar1 != (byte *)0x0) { pbVar3 = pbVar1; psVar5 = local_34; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar3 = *(byte **)pbVar1; } do { bVar2 = *pbVar3; bVar7 = bVar2 < (byte)psVar5->_buf[0]; if (bVar2 != psVar5->_buf[0]) { LAB_008f8e05: uVar4 = -(uint)bVar7 | 1; goto LAB_008f8e0a; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar7 = bVar2 < (byte)psVar5->_buf[1]; if (bVar2 != psVar5->_buf[1]) goto LAB_008f8e05; pbVar3 = pbVar3 + 2; psVar5 = (std_string *)(psVar5->_buf + 2); } while (bVar2 != 0); uVar4 = 0; LAB_008f8e0a: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || ((this->_animState)._isPlaying != 0)))) goto LAB_008f8e35; } bVar2 = ANM2::SetAnimation(this,(byte *)local_34,1); if (bVar2 != 0) { AnimationState::Rewind(&this->_animState); (this->_animState)._isPlaying = 1; } LAB_008f8e35: local_8 = (void *)0xffffffff; if (0xf < local_1c) { uVar4 = local_1c + 1; pvVar6 = local_30[0]; if (0xfff < uVar4) { pvVar6 = *(void **)((int)local_30[0] + -4); uVar4 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar4); } local_20 = 0; local_1c = 0xf; local_30[0] = (void *)((uint)local_30[0] & 0xffffff00); ANM2::Render(this_00->_moddedMenuBackgroundANM2,param_2,&g_vectorZero,&g_vectorZero); ExceptionList = local_10; return; } //@@ 008f8ee0 HUD::render_modded_coop_portrait /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from HUD::Render: param_1 player type indexes the EntityConfig_Player vector (Manager+0x2a678, stride 0x148); when its _moddedCoopMenuANM2 is set renders it at param_2 with EntityConfig_Player::GetDisplayName */ void HUD::render_modded_coop_portrait (int param_1,Vector *param_2,undefined4 *param_3,float *param_4) { float fVar1; float fVar2; float fVar3; byte bVar4; EntityConfig_Player *playerConfig; byte *currentAnimName; uint uVar5; void *playersBytes; std_string *nameCursor; void *pvVar6; ANM2 *portrait; bool isLess; std_string *animName; void *displayName [4]; uint displayNameSize; uint displayNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; byte *animData; puStack_20 = (undefined1 *)(displayName + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(displayName + 0xb); if (param_1 < 0) { return; } pvVar6 = (g_manager->_entityConfig)._players._begin; playersBytes = (void *)((int)(g_manager->_entityConfig)._players._end - (int)pvVar6); if ((int)playersBytes / 0x148 <= param_1) { return; } playerConfig = (EntityConfig_Player *)(param_1 * 0x148 + (int)pvVar6); if (playerConfig == (EntityConfig_Player *)0x0) { return; } portrait = playerConfig->_moddedCoopMenuANM2; if (portrait == (ANM2 *)0x0) { return; } ExceptionList = &local_1c; animName = EntityConfig_Player::GetDisplayName (playerConfig,(std_string *)displayName,playersBytes); local_14 = (void *)0x0; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } animData = (portrait->_animState)._animData; if (animData != (byte *)0x0) { currentAnimName = animData; nameCursor = animName; if (0xf < *(uint *)(animData + 0x14)) { currentAnimName = *(byte **)animData; } do { bVar4 = *currentAnimName; isLess = bVar4 < (byte)nameCursor->_buf[0]; if (bVar4 != nameCursor->_buf[0]) { LAB_008f8fd0: uVar5 = -(uint)isLess | 1; goto LAB_008f8fd5; } if (bVar4 == 0) break; bVar4 = currentAnimName[1]; isLess = bVar4 < (byte)nameCursor->_buf[1]; if (bVar4 != nameCursor->_buf[1]) goto LAB_008f8fd0; currentAnimName = currentAnimName + 2; nameCursor = (std_string *)(nameCursor->_buf + 2); } while (bVar4 != 0); uVar5 = 0; LAB_008f8fd5: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((portrait->_animState)._isPlaying != 0)))) goto LAB_008f9000; } bVar4 = ANM2::SetAnimation(portrait,(byte *)animName,1); if (bVar4 != 0) { AnimationState::Rewind(&portrait->_animState); (portrait->_animState)._isPlaying = 1; } LAB_008f9000: local_14 = (void *)0xffffffff; if (0xf < displayNameCapacity) { uVar5 = displayNameCapacity + 1; pvVar6 = displayName[0]; if (0xfff < uVar5) { pvVar6 = *(void **)((int)displayName[0] + -4); uVar5 = displayNameCapacity + 0x24; if (0x1f < (uint)((int)displayName[0] + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar5); } displayNameSize = 0; displayNameCapacity = 0xf; pvVar6 = playerConfig->_moddedCoopMenuANM2; displayName[0] = (void *)((uint)displayName[0] & 0xffffff00); *(undefined4 *)((int)pvVar6 + 0x9c) = *param_3; *(undefined4 *)((int)pvVar6 + 0xa0) = param_3[1]; portrait = playerConfig->_moddedCoopMenuANM2; if (&portrait->_color != (ColorMod *)param_4) { fVar1 = param_4[1]; fVar2 = param_4[2]; fVar3 = param_4[3]; (portrait->_color)._tint[0] = *param_4; (portrait->_color)._tint[1] = fVar1; (portrait->_color)._tint[2] = fVar2; (portrait->_color)._tint[3] = fVar3; fVar1 = param_4[5]; fVar2 = param_4[6]; fVar3 = param_4[7]; (portrait->_color)._colorize[0] = param_4[4]; (portrait->_color)._colorize[1] = fVar1; (portrait->_color)._colorize[2] = fVar2; (portrait->_color)._colorize[3] = fVar3; *(undefined8 *)(portrait->_color)._offset = *(undefined8 *)(param_4 + 8); (portrait->_color)._offset[2] = param_4[10]; portrait = playerConfig->_moddedCoopMenuANM2; } ANM2::Render(portrait,param_2,&g_vectorZero,&g_vectorZero); ExceptionList = local_1c; return; } //@@ 008f90e0 ModManager::RenderCustomCollectionItem /* ZHL [exact] __thiscall void ModManager::RenderCustomCollectionItem(unsigned int itemID, Vector* pos, Vector* scale, ColorMod* color, BlendMode* blendMode); prototype: REPENTOGON, confirmed by RET 20 */ void __thiscall ModManager::RenderCustomCollectionItem (ModManager *this,uint itemID,Vector *pos,Vector *scale,ColorMod *color,void *blendMode) { int iVar1; byte bVar2; ItemConfig_Item *pIVar3; LayerState *pLVar4; byte *layerName; ANM2 *pAVar5; pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,itemID); if ((pIVar3 != (ItemConfig_Item *)0x0) && (iVar1 = *(int *)(pIVar3[1].name._buf + 0xc), iVar1 != 0)) { pAVar5 = (ANM2 *)(iVar1 + 0xcdc); if (*(char *)(iVar1 + 0xde5) == '\0') { pAVar5 = (ANM2 *)(this + 0x8052); bVar2 = ANM2::SetAnimation(pAVar5,(byte *)"Default",1); if (((bVar2 != 0) && (this[0x805f] != (ModManager)0x0)) && (AnimationState::SetFrameFloat((AnimationState *)(this + 0x805e),0.0), this[0x805f] != (ModManager)0x0)) { *(undefined1 *)(this + 0x8063) = 0; } Sprite::SetColor((Sprite *)pAVar5,color); this[0x8079] = (ModManager)scale->x; this[0x807a] = (ModManager)scale->y; pLVar4 = ANM2::GetLayer(pAVar5,(byte *)0x0); pLVar4->_blendMode[0] = *(int *)blendMode; pLVar4->_blendMode[1] = *(int *)((int)blendMode + 4); pLVar4->_blendMode[2] = *(int *)((int)blendMode + 8); pLVar4->_blendMode[3] = *(int *)((int)blendMode + 0xc); pLVar4->_blendMode[4] = *(int *)((int)blendMode + 0x10); Sprite::RenderLayer((Sprite *)pAVar5,0,pos,&g_vectorZero,&g_vectorZero); } else { ANM2::SetFrame(pAVar5,(std_string *)(iVar1 + 0xcf4),*(int *)(pIVar3[1].name._buf + 8)); Sprite::SetColor((Sprite *)pAVar5,color); layerName = (byte *)0x0; *(float *)(iVar1 + 0xd78) = scale->x; *(float *)(iVar1 + 0xd7c) = scale->y; if (*(int *)(iVar1 + 0xd5c) != 0) { do { pLVar4 = ANM2::GetLayer(pAVar5,layerName); layerName = layerName + 1; pLVar4->_blendMode[0] = *(int *)blendMode; pLVar4->_blendMode[1] = *(int *)((int)blendMode + 4); pLVar4->_blendMode[2] = *(int *)((int)blendMode + 8); pLVar4->_blendMode[3] = *(int *)((int)blendMode + 0xc); pLVar4->_blendMode[4] = *(int *)((int)blendMode + 0x10); } while (layerName < *(byte **)(iVar1 + 0xd5c)); } if (*(char *)(iVar1 + 0xde5) != '\0') { if (*(char *)(iVar1 + 0xd4c) == '\0') { AnimationState::Render((AnimationState *)(iVar1 + 0xd0c),pos,&g_vectorZero,&g_vectorZero); AnimationState::Render((AnimationState *)(iVar1 + 0xd2c),pos,&g_vectorZero,&g_vectorZero); return; } AnimationState::Render((AnimationState *)(iVar1 + 0xd2c),pos,&g_vectorZero,&g_vectorZero); AnimationState::Render((AnimationState *)(iVar1 + 0xd0c),pos,&g_vectorZero,&g_vectorZero); return; } } } return; } //@@ 008f92b0 ModEntry::parse_metadata_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=ModEntry: metadata/name/directory/description/version/visibility/tag/id into _directory 0x0, _name 0x18, _metadataDescription 0xa8 (zhl ModEntry) */ void ModEntry::parse_metadata_xml(void) { uint *puVar1; byte bVar2; char cVar3; int iVar4; qword qVar5; undefined4 *puVar6; char *pcVar7; undefined4 *puVar8; byte *pbVar9; undefined4 *puVar10; char *pcVar11; byte *pbVar12; int *piVar13; byte *in_ECX; byte *pbVar14; byte *pbVar15; byte ****ppppbVar16; qword *pqVar17; uint uVar18; uint uStack_10080; int iStack_10078; undefined1 auStack_10074 [24]; undefined4 *puStack_1005c; undefined4 *puStack_10058; undefined1 auStack_10044 [65560]; byte ****local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; byte ***local_8; local_8 = (byte ***)0xffffffff; puStack_c = &LAB_00b07b08; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; FUN_00413b90(local_14); local_8 = (byte ***)0x0; puVar6 = (undefined4 *)FUN_00416510(0x30); *puVar6 = 0; puVar6[1] = 0; puVar6[4] = 0; puVar6[5] = 1; puVar6[6] = 0; puVar6[8] = 0; pcVar7 = "metadata"; do { pcVar11 = pcVar7; pcVar7 = pcVar11 + 1; } while (*pcVar7 != '\0'); *puVar6 = "metadata"; puVar6[2] = pcVar11 + -0xb76e9f; if (puStack_1005c == (undefined4 *)0x0) { puVar6[10] = 0; puStack_1005c = puVar6; } else { puVar6[10] = puStack_10058; *(undefined4 **)((int)puStack_10058 + 0x2c) = puVar6; } puVar6[4] = auStack_10074; puVar6[0xb] = 0; puStack_10058 = puVar6; puVar8 = (undefined4 *)FUN_00416510(0x30); *puVar8 = 0; puVar8[1] = 0; puVar8[4] = 0; puVar8[5] = 1; puVar8[6] = 0; puVar8[8] = 0; pbVar14 = s_name; do { pbVar9 = pbVar14; pbVar14 = pbVar9 + 1; } while (*pbVar14 != 0); *puVar8 = s_name; puVar8[2] = pbVar9 + -0xb1c13b; pbVar14 = in_ECX + 0x18; if (0xf < *(uint *)(in_ECX + 0x2c)) { pbVar14 = *(byte **)pbVar14; } bVar2 = *pbVar14; pbVar9 = pbVar14; while (bVar2 != 0) { pbVar9 = pbVar9 + 1; bVar2 = *pbVar9; } puVar8[1] = pbVar14; puVar8[3] = (int)pbVar9 - (int)pbVar14; if (puVar6[6] == 0) { puVar8[10] = 0; puVar6[6] = puVar8; } else { puVar8[10] = puVar6[7]; *(undefined4 **)(puVar6[7] + 0x2c) = puVar8; } puVar6[7] = puVar8; puVar8[4] = puVar6; puVar8[0xb] = 0; puVar8 = (undefined4 *)FUN_00416510(0x30); *puVar8 = 0; puVar8[1] = 0; puVar8[4] = 0; puVar8[5] = 1; puVar8[6] = 0; puVar8[8] = 0; pcVar7 = "directory"; do { pcVar11 = pcVar7; pcVar7 = pcVar11 + 1; } while (*pcVar7 != '\0'); *puVar8 = "directory"; puVar8[2] = pcVar11 + -0xb76e93; pbVar14 = in_ECX; if (0xf < *(uint *)(in_ECX + 0x14)) { pbVar14 = *(byte **)in_ECX; } bVar2 = *pbVar14; pbVar9 = pbVar14; while (bVar2 != 0) { pbVar9 = pbVar9 + 1; bVar2 = *pbVar9; } puVar8[1] = pbVar14; puVar8[3] = (int)pbVar9 - (int)pbVar14; if (puVar6[6] == 0) { puVar8[10] = 0; puVar6[6] = puVar8; } else { puVar8[10] = puVar6[7]; *(undefined4 **)(puVar6[7] + 0x2c) = puVar8; } puVar6[7] = puVar8; puVar8[4] = puVar6; puVar8[0xb] = 0; puVar8 = (undefined4 *)FUN_00416510(0x30); *puVar8 = 0; puVar8[1] = 0; puVar8[4] = 0; puVar8[5] = 1; puVar8[6] = 0; puVar8[8] = 0; pcVar7 = "description"; do { pcVar11 = pcVar7; pcVar7 = pcVar11 + 1; } while (*pcVar7 != '\0'); *puVar8 = "description"; puVar8[2] = pcVar11 + -0xb698bb; pbVar14 = in_ECX + 0xa8; if (0xf < *(uint *)(in_ECX + 0xbc)) { pbVar14 = *(byte **)pbVar14; } bVar2 = *pbVar14; pbVar9 = pbVar14; while (bVar2 != 0) { pbVar9 = pbVar9 + 1; bVar2 = *pbVar9; } puVar8[1] = pbVar14; puVar8[3] = (int)pbVar9 - (int)pbVar14; if (puVar6[6] == 0) { puVar8[10] = 0; puVar6[6] = puVar8; } else { puVar8[10] = puVar6[7]; *(undefined4 **)(puVar6[7] + 0x2c) = puVar8; } puVar6[7] = puVar8; puVar8[4] = puVar6; puVar8[0xb] = 0; puVar8 = (undefined4 *)FUN_00416510(0x30); *puVar8 = 0; puVar8[1] = 0; puVar8[4] = 0; puVar8[5] = 1; puVar8[6] = 0; puVar8[8] = 0; pcVar7 = "version"; do { pcVar11 = pcVar7; pcVar7 = pcVar11 + 1; } while (*pcVar7 != '\0'); *puVar8 = "version"; puVar8[2] = pcVar11 + -0xb66b53; pbVar14 = in_ECX + 0x78; if (0xf < *(uint *)(in_ECX + 0x8c)) { pbVar14 = *(byte **)pbVar14; } bVar2 = *pbVar14; pbVar9 = pbVar14; while (bVar2 != 0) { pbVar9 = pbVar9 + 1; bVar2 = *pbVar9; } puVar8[1] = pbVar14; puVar8[3] = (int)pbVar9 - (int)pbVar14; if (puVar6[6] == 0) { puVar8[10] = 0; puVar6[6] = puVar8; } else { puVar8[10] = puVar6[7]; *(undefined4 **)(puVar6[7] + 0x2c) = puVar8; } puVar6[7] = puVar8; puVar8[4] = puVar6; puVar8[0xb] = 0; puVar8 = (undefined4 *)FUN_00416510(0x30); *puVar8 = 0; puVar8[1] = 0; puVar8[4] = 0; puVar8[5] = 1; puVar8[6] = 0; puVar8[8] = 0; pcVar7 = "visibility"; do { pcVar11 = pcVar7; pcVar7 = pcVar11 + 1; } while (*pcVar7 != '\0'); *puVar8 = "visibility"; puVar8[2] = pcVar11 + -0xb76e87; pbVar14 = in_ECX + 0xc0; if (0xf < *(uint *)(in_ECX + 0xd4)) { pbVar14 = *(byte **)pbVar14; } bVar2 = *pbVar14; pbVar9 = pbVar14; while (bVar2 != 0) { pbVar9 = pbVar9 + 1; bVar2 = *pbVar9; } puVar8[1] = pbVar14; puVar8[3] = (int)pbVar9 - (int)pbVar14; if (puVar6[6] == 0) { puVar8[10] = 0; puVar6[6] = puVar8; } else { puVar8[10] = puVar6[7]; *(undefined4 **)(puVar6[7] + 0x2c) = puVar8; } puVar6[7] = puVar8; puVar8[4] = puVar6; puVar8[0xb] = 0; uStack_10080 = 0; iVar4 = *(int *)(in_ECX + 0xdc) - *(int *)(in_ECX + 0xd8) >> 0x1f; if ((*(int *)(in_ECX + 0xdc) - *(int *)(in_ECX + 0xd8)) / 0x18 + iVar4 != iVar4) { iStack_10078 = 0; do { puVar8 = (undefined4 *)FUN_00416510(0x30); *puVar8 = 0; puVar8[1] = 0; puVar8[4] = 0; puVar8[5] = 1; puVar8[6] = 0; puVar8[8] = 0; pcVar7 = "tag"; do { pcVar11 = pcVar7; pcVar7 = pcVar11 + 1; } while (*pcVar7 != '\0'); *puVar8 = &DAT_00b6e3b4; puVar8[2] = pcVar11 + -0xb6e3b3; puVar10 = (undefined4 *)FUN_00416510(0x1c); *puVar10 = 0; puVar10[1] = 0; puVar10[4] = 0; pbVar14 = s_id; do { pbVar9 = pbVar14; pbVar14 = pbVar9 + 1; } while (*pbVar14 != 0); *puVar10 = s_id; puVar10[2] = pbVar9 + -0xb1bfef; pcVar7 = (char *)(*(int *)(in_ECX + 0xd8) + iStack_10078); if (0xf < *(uint *)(pcVar7 + 0x14)) { pcVar7 = *(char **)pcVar7; } cVar3 = *pcVar7; pcVar11 = pcVar7; while (cVar3 != '\0') { pcVar11 = pcVar11 + 1; cVar3 = *pcVar11; } puVar10[1] = pcVar7; puVar10[3] = (int)pcVar11 - (int)pcVar7; if (puVar8[8] == 0) { puVar10[5] = 0; puVar8[8] = puVar10; } else { puVar10[5] = puVar8[9]; *(undefined4 **)(puVar8[9] + 0x18) = puVar10; } puVar8[9] = puVar10; puVar10[4] = puVar8; puVar10[6] = 0; if (puVar6[6] == 0) { puVar8[10] = 0; puVar6[6] = puVar8; } else { puVar8[10] = puVar6[7]; *(undefined4 **)(puVar6[7] + 0x2c) = puVar8; } iStack_10078 = iStack_10078 + 0x18; puVar6[7] = puVar8; puVar8[4] = puVar6; puVar8[0xb] = 0; uStack_10080 = uStack_10080 + 1; } while (uStack_10080 < (uint)((*(int *)(in_ECX + 0xdc) - *(int *)(in_ECX + 0xd8)) / 0x18)); } pbVar9 = operator_new_tracked(0x1000); pbVar12 = rapidxml::internal::print_node(pbVar9,auStack_10074,0,0); *pbVar12 = 0; local_1c = 0; local_18 = 0xf; local_2c[0] = (byte ****)0x0; pbVar14 = g_modsDirectory; do { pbVar15 = pbVar14; pbVar14 = pbVar15 + 1; } while (*pbVar15 != 0); std::string::assign((char *)local_2c,g_modsDirectory,(uint)(pbVar15 + -0xc72e28)); local_8 = (byte ***)CONCAT31(local_8._1_3_,1); puVar1 = (uint *)(in_ECX + 0x10); if (0xf < *(uint *)(in_ECX + 0x14)) { in_ECX = *(byte **)in_ECX; } std::string::append((char *)local_2c,in_ECX,*puVar1); ppppbVar16 = (byte ****)local_2c; if (0xf < local_18) { ppppbVar16 = local_2c[0]; } pbVar14 = path_join((byte *)"/metadata.xml",(byte *)ppppbVar16,0,0); piVar13 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,pbVar14,0); if (pbVar14 != (byte *)0x0) { operator_delete(pbVar14,1); } if (piVar13 != (int *)0x0) { (**(code **)(*piVar13 + 0x1c))(pbVar9,1,(int)pbVar12 - (int)pbVar9); (**(code **)*piVar13)(1); } if (pbVar9 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar17 = &g_allocatedBytesNoHeap; } else { pqVar17 = (qword *)((int)g_mainHeap + 0x30); } uVar18 = *(uint *)(pbVar9 + -4); qVar5 = *pqVar17; *(uint *)pqVar17 = (uint)*pqVar17 - uVar18; *(uint *)((int)pqVar17 + 4) = *(uint *)((int)pqVar17 + 4) - (uint)((uint)qVar5 < uVar18); free(pbVar9 + -4); } local_8 = (byte ***)((uint)local_8 & 0xffffff00); if (0xf < local_18) { uVar18 = local_18 + 1; ppppbVar16 = local_2c[0]; if (0xfff < uVar18) { ppppbVar16 = (byte ****)local_2c[0][-1]; uVar18 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c[0] + (-4 - (int)ppppbVar16))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar16,uVar18); } local_1c = 0; local_18 = 0xf; local_2c[0] = (byte ****)((uint)local_2c[0] & 0xffffff00); local_8 = (byte ***)0x3; xml_memory_pool::clear(auStack_10044); ExceptionList = local_10; return; } //@@ 008f99c0 Mod::GetContentPath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: src/rooms decompile labels (Mod::GetContentPath(out,name) (content-dlc3/ then content/)) prototype: db/protos.zhl, confirmed by RET 8 */ std_string * __thiscall Mod::GetContentPath(void *this,std_string *outPath,std_string *name) { byte *tag; uint *puVar1; uint uVar2; undefined4 *puVar3; byte ****ppppbVar4; byte *pbVar5; int iVar6; uint uVar7; void *ptr; std_string *psVar8; std_string *local_74; byte ****local_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined8 local_5c; void *local_54 [4]; undefined4 local_44; uint local_40; byte ****local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 local_2c; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_54 + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b07b5d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_54 + 0x11); ExceptionList = &local_1c; tag = (byte *)((int)this + 0x48); uVar7 = *(int *)((int)this + 0x58) - 1; if (*(uint *)((int)this + 0x58) < uVar7) { uVar7 = *(uint *)((int)this + 0x58); } local_44 = 0; local_40 = 0xf; local_54[0] = (void *)0x0; pbVar5 = tag; if (0xf < *(uint *)((int)this + 0x5c)) { pbVar5 = *(byte **)tag; } local_24 = uVar2; std::string::assign((char *)local_54,pbVar5,uVar7); local_14 = (void *)0x0; puVar3 = std::string::append((char *)local_54,(byte *)"-dlc3/",6); local_6c = (byte ****)*puVar3; uStack_68 = puVar3[1]; uStack_64 = puVar3[2]; uStack_60 = puVar3[3]; local_5c = *(undefined8 *)(puVar3 + 4); puVar3[4] = 0; puVar3[5] = 0xf; *(undefined1 *)puVar3 = 0; local_14._0_1_ = 2; if (0xf < local_40) { uVar7 = local_40 + 1; ptr = local_54[0]; if (0xfff < uVar7) { ptr = *(void **)((int)local_54[0] + -4); uVar7 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } psVar8 = (std_string *)name->_size; local_44 = 0; local_40 = 0xf; local_54[0] = (void *)((uint)local_54[0] & 0xffffff00); if ((std_string *)(0x7fffffff - (uint)local_5c) < psVar8) { /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar2); } ppppbVar4 = (byte ****)&local_6c; if (0xf < local_5c._4_4_) { ppppbVar4 = local_6c; } local_74 = name; if (0xf < name->_capacity) { local_74 = *(std_string **)name->_buf; psVar8 = (std_string *)name->_size; } std::string::concat((char *)&local_3c,(int)tag,psVar8,(byte *)ppppbVar4,(uint)local_5c, (byte *)local_74,(uint)psVar8); local_14._0_1_ = 3; ppppbVar4 = (byte ****)&local_3c; if (0xf < uStack_28) { ppppbVar4 = local_3c; } pbVar5 = FileSystem::ResolvePath((byte *)ppppbVar4); if (pbVar5 == (byte *)0x0) { puVar1 = &name->_size; psVar8 = (std_string *)(0x7fffffff - *(uint *)((int)this + 0x58)); if (psVar8 < (std_string *)*puVar1) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pbVar5 = tag; if (0xf < *(uint *)((int)this + 0x5c)) { pbVar5 = *(byte **)tag; } if (0xf < name->_capacity) { name = *(std_string **)name->_buf; } std::string::concat(outPath->_buf,(int)tag,psVar8,pbVar5,*(uint *)((int)this + 0x58), (byte *)name,*puVar1); if (0xf < uStack_28) { uVar7 = uStack_28 + 1; ppppbVar4 = local_3c; if (0xfff < uVar7) { ppppbVar4 = (byte ****)local_3c[-1]; uVar7 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)ppppbVar4))) goto LAB_008f9c94; } operator_delete(ppppbVar4,uVar7); } local_3c = (byte ****)((uint)local_3c & 0xffffff00); if (local_5c._4_4_ < 0x10) { ExceptionList = local_1c; return outPath; } uVar7 = local_5c._4_4_ + 1; ppppbVar4 = local_6c; if (uVar7 < 0x1000) goto LAB_008f9bb7; ppppbVar4 = (byte ****)local_6c[-1]; iVar6 = (int)local_6c - (int)ppppbVar4; } else { local_14._0_1_ = 4; tracked_alloc(1,pbVar5,0); ppppbVar4 = local_3c; local_14._0_1_ = 3; outPath->_buf[0] = '\0'; outPath->_buf[1] = '\0'; outPath->_buf[2] = '\0'; outPath->_buf[3] = '\0'; outPath->_size = 0; outPath->_capacity = 0; local_3c = (byte ****)((uint)local_3c & 0xffffff00); *(byte *****)outPath->_buf = ppppbVar4; *(undefined4 *)(outPath->_buf + 4) = uStack_38; *(undefined4 *)(outPath->_buf + 8) = uStack_34; *(undefined4 *)(outPath->_buf + 0xc) = uStack_30; outPath->_size = local_2c; outPath->_capacity = uStack_28; if (local_5c._4_4_ < 0x10) { ExceptionList = local_1c; return outPath; } uVar7 = local_5c._4_4_ + 1; ppppbVar4 = local_6c; if (uVar7 < 0x1000) goto LAB_008f9bb7; ppppbVar4 = (byte ****)local_6c[-1]; iVar6 = (int)local_6c - (int)ppppbVar4; } uStack_28 = 0xf; local_2c = 0; uVar7 = local_5c._4_4_ + 0x24; if (0x1f < iVar6 - 4U) { LAB_008f9c94: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_008f9bb7: uStack_28 = 0xf; local_2c = 0; operator_delete(ppppbVar4,uVar7); ExceptionList = local_1c; return outPath; } //@@ 008f9cb0 Mod::load_menu_sprites /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? ECX = Mod (ModManager::LoadModContent loops enabled mods +0xfd): for each path of the table at 00b240c0 (gfx/CharacterMenu.anm2, gfx/CharacterPortraits.anm2 ...) Mod::GetContentPath + FileSystem::ResolvePath, ANM2::Load into Mod+0x100 sprites */ void Mod::load_menu_sprites(void) { byte bVar1; qword qVar2; byte *pbVar3; std_string *psVar4; byte *pbVar5; void *in_ECX; void *ptr; uint uVar6; qword *pqVar7; uint uVar8; ANM2 *this; std_string *local_44 [5]; uint local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00b07ba5; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&local_2c + 0x28U; ExceptionList = &local_10; this = (ANM2 *)((int)in_ECX + 0x100); uVar8 = 0; do { pbVar5 = *(byte **)((int)&PTR_s_gfx_CharacterMenu_anm2_00b240c0 + uVar8); if (pbVar5 != (byte *)0x0) { local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; pbVar3 = pbVar5; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign(local_2c._buf,pbVar5,(int)pbVar3 - (int)(pbVar5 + 1)); local_8 = 0; GetContentPath(in_ECX,(std_string *)local_44,&local_2c); local_8._0_1_ = 2; if (0xf < local_2c._capacity) { uVar6 = local_2c._capacity + 1; ptr = (void *)local_2c._buf._0_4_; if (0xfff < uVar6) { ptr = *(void **)(local_2c._buf._0_4_ + -4); uVar6 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr))) goto LAB_008f9e44; } operator_delete(ptr,uVar6); } psVar4 = (std_string *)local_44; if (0xf < local_30) { psVar4 = local_44[0]; } pbVar5 = FileSystem::ResolvePath((byte *)psVar4); if (pbVar5 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)(pbVar5 + -4); qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar6; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar2 < uVar6); free(pbVar5 + -4); local_8._0_1_ = 2; } if (pbVar5 != (byte *)0x0) { ANM2::Load(this,(std_string *)local_44,1); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (0xf < local_30) { uVar6 = local_30 + 1; psVar4 = local_44[0]; if (0xfff < uVar6) { psVar4 = (std_string *)local_44[0][-1]._capacity; uVar6 = local_30 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44[0] + (-4 - (int)psVar4))) { LAB_008f9e44: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar4,uVar6); } } uVar8 = uVar8 + 4; this = this + 1; if (0x33 < uVar8) { ExceptionList = local_10; return; } } while( true ); } //@@ 008f9e50 Mod::load_content_anm2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (slot, relPath): Mod::GetContentPath + FileSystem::ResolvePath, then ANM2::Load into ECX+0x100+slot*0x114 (array of per-mod sprites); ItemConfig::Load passes slot 0xb for the items.xml "deathanm2" attribute, EntityConfig::LoadEntities slot 0xc */ void Mod::load_content_anm2(int param_1,std_string *param_2) { std_string *psVar1; byte *ptr; void *in_ECX; uint size; std_string *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; std_string *local_8; local_8 = (std_string *)0xffffffff; puStack_c = &LAB_00b07bdd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; GetContentPath(in_ECX,(std_string *)local_2c,param_2); local_8 = (std_string *)0x0; psVar1 = (std_string *)local_2c; if (0xf < local_18) { psVar1 = local_2c[0]; } ptr = FileSystem::ResolvePath((byte *)psVar1); if (ptr != (byte *)0x0) { local_8._0_1_ = 1; tracked_alloc(1,ptr,0); local_8 = (std_string *)((uint)local_8._1_3_ << 8); ANM2::Load((ANM2 *)(param_1 * 0x114 + 0x100 + (int)in_ECX),(std_string *)local_2c,1); } if (0xf < local_18) { size = local_18 + 1; psVar1 = local_2c[0]; if (0xfff < size) { psVar1 = (std_string *)local_2c[0][-1]._capacity; size = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c[0] + (-4 - (int)psVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar1,size); } ExceptionList = local_10; return; } //@@ 008f9f40 ModManager::add_mod_entry /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (name, dir, path) from ModManager::UpdateWorkshopMods: builds an entry with "/disable.it" (FileSystem::ResolvePath -> disabled), "/metadata.xml" (missing flag), creates "/unfinished.it" (SaveDataManager::open_file_write) and pushes it via FUN_008fc5b0 */ void ModManager::add_mod_entry(void **param_1,void **param_2,void *param_3) { void **ppvVar1; byte *pbVar2; byte ****ppppbVar3; undefined4 *puVar4; int in_ECX; void *pvVar5; uint uVar6; uint local_c4; void *local_c0 [4]; undefined4 local_b0; uint local_ac; void *local_a8 [4]; undefined4 local_98; uint local_94; void *local_90 [4]; undefined4 local_80; uint local_7c; undefined1 local_78; byte ****local_74 [4]; undefined4 local_64; uint local_60; byte ****local_5c [4]; undefined4 local_4c; uint local_48; byte ****local_44 [4]; undefined4 local_34; uint local_30; byte ****local_2c [4]; std_string *local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; byte ***local_8; local_8 = (byte ***)0xffffffff; puStack_c = &LAB_00b07c40; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; std::string::string((char *)local_2c,param_3); local_b0 = 0; local_ac = 0xf; local_c0[0] = (void *)0x0; local_98 = 0; local_94 = 0xf; local_a8[0] = (void *)0x0; local_80 = 0; local_7c = 0xf; local_90[0] = (void *)0x0; local_8._0_1_ = 1; local_8._1_3_ = 0; if (local_c0 != param_1) { ppvVar1 = param_1 + 4; if ((void *)0xf < param_1[5]) { param_1 = *param_1; } std::string::assign((char *)local_c0,(byte *)param_1,(uint)*ppvVar1); } if (local_a8 != param_2) { ppvVar1 = param_2 + 4; if ((void *)0xf < param_2[5]) { param_2 = *param_2; } std::string::assign((char *)local_a8,(byte *)param_2,(uint)*ppvVar1); } ppppbVar3 = (byte ****)local_2c; if (0xf < local_18) { ppppbVar3 = local_2c[0]; } std::string::assign((char *)local_90,(byte *)ppppbVar3,(uint)local_1c); if (0x7fffffffU - (int)local_1c < 0xb) { LAB_008fa37c: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar3 = (byte ****)local_2c; if (0xf < local_18) { ppppbVar3 = local_2c[0]; } std::string::concat((char *)local_74,in_ECX,local_1c,(byte *)ppppbVar3,(uint)local_1c, (byte *)"/disable.it",0xb); local_8._0_1_ = 2; ppppbVar3 = (byte ****)local_74; if (0xf < local_60) { ppppbVar3 = local_74[0]; } pbVar2 = FileSystem::ResolvePath((byte *)ppppbVar3); local_78 = pbVar2 != (byte *)0x0; if (pbVar2 != (byte *)0x0) { local_8._0_1_ = 3; tracked_alloc(1,pbVar2,0); local_8._0_1_ = 2; } if (0x7fffffffU - (int)local_1c < 0xd) goto LAB_008fa37c; ppppbVar3 = (byte ****)local_2c; if (0xf < local_18) { ppppbVar3 = local_2c[0]; } std::string::concat((char *)local_5c,in_ECX,local_1c,(byte *)ppppbVar3,(uint)local_1c, (byte *)"/metadata.xml",0xd); local_8._0_1_ = 4; ppppbVar3 = (byte ****)local_5c; if (0xf < local_48) { ppppbVar3 = local_5c[0]; } pbVar2 = FileSystem::ResolvePath((byte *)ppppbVar3); if (pbVar2 != (byte *)0x0) { local_8._0_1_ = 5; tracked_alloc(1,pbVar2,0); local_8._0_1_ = 4; } local_c4 = pbVar2 != (byte *)0x0 ^ 1; if (0x7fffffffU - (int)local_1c < 0xe) goto LAB_008fa37c; ppppbVar3 = (byte ****)local_2c; if (0xf < local_18) { ppppbVar3 = local_2c[0]; } std::string::concat((char *)local_44,in_ECX,local_1c,(byte *)ppppbVar3,(uint)local_1c, (byte *)"/unfinished.it",0xe); local_8 = (byte ***)CONCAT31(local_8._1_3_,6); ppppbVar3 = (byte ****)local_44; if (0xf < local_30) { ppppbVar3 = local_44[0]; } puVar4 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)ppppbVar3,0); if (puVar4 != (undefined4 *)0x0) { (**(code **)*puVar4)(1); } FUN_008fc5b0(&local_c4); if (0xf < local_30) { uVar6 = local_30 + 1; ppppbVar3 = local_44[0]; if (0xfff < uVar6) { ppppbVar3 = (byte ****)local_44[0][-1]; uVar6 = local_30 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44[0] + (-4 - (int)ppppbVar3))) goto LAB_008fa34e; } operator_delete(ppppbVar3,uVar6); } local_34 = 0; local_30 = 0xf; local_44[0] = (byte ****)((uint)local_44[0] & 0xffffff00); if (0xf < local_48) { uVar6 = local_48 + 1; ppppbVar3 = local_5c[0]; if (0xfff < uVar6) { ppppbVar3 = (byte ****)local_5c[0][-1]; uVar6 = local_48 + 0x24; if ((byte *)0x1f < (byte *)((int)local_5c[0] + (-4 - (int)ppppbVar3))) goto LAB_008fa34e; } operator_delete(ppppbVar3,uVar6); } local_4c = 0; local_48 = 0xf; local_5c[0] = (byte ****)((uint)local_5c[0] & 0xffffff00); if (0xf < local_60) { uVar6 = local_60 + 1; ppppbVar3 = local_74[0]; if (0xfff < uVar6) { ppppbVar3 = (byte ****)local_74[0][-1]; uVar6 = local_60 + 0x24; if ((byte *)0x1f < (byte *)((int)local_74[0] + (-4 - (int)ppppbVar3))) goto LAB_008fa34e; } operator_delete(ppppbVar3,uVar6); } local_64 = 0; local_60 = 0xf; local_74[0] = (byte ****)((uint)local_74[0] & 0xffffff00); if (0xf < local_7c) { uVar6 = local_7c + 1; pvVar5 = local_90[0]; if (0xfff < uVar6) { pvVar5 = *(void **)((int)local_90[0] + -4); uVar6 = local_7c + 0x24; if (0x1f < (uint)((int)local_90[0] + (-4 - (int)pvVar5))) goto LAB_008fa34e; } operator_delete(pvVar5,uVar6); } if (0xf < local_94) { uVar6 = local_94 + 1; pvVar5 = local_a8[0]; if (0xfff < uVar6) { pvVar5 = *(void **)((int)local_a8[0] + -4); uVar6 = local_94 + 0x24; if (0x1f < (uint)((int)local_a8[0] + (-4 - (int)pvVar5))) goto LAB_008fa34e; } operator_delete(pvVar5,uVar6); } if (0xf < local_ac) { uVar6 = local_ac + 1; pvVar5 = local_c0[0]; if (0xfff < uVar6) { pvVar5 = *(void **)((int)local_c0[0] + -4); uVar6 = local_ac + 0x24; if (0x1f < (uint)((int)local_c0[0] + (-4 - (int)pvVar5))) goto LAB_008fa34e; } operator_delete(pvVar5,uVar6); } if (0xf < local_18) { uVar6 = local_18 + 1; ppppbVar3 = local_2c[0]; if (0xfff < uVar6) { ppppbVar3 = (byte ****)local_2c[0][-1]; uVar6 = local_18 + 0x24; if ((byte *)0x1f < (byte *)((int)local_2c[0] + (-4 - (int)ppppbVar3))) { LAB_008fa34e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,uVar6); } ExceptionList = local_10; return; } //@@ 008fa390 ModManager::UpdateWorkshopMods /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ZHL name; walks 0x50-byte workshop entries, state 2 -> '#MOD_UNINSTALLING', '#MOD_INSTALLING'/'#MOD_UPDATING', writes /disable.it /unfinished.it, FileSystem::ResolvePath prototype: REPENTOGON */ void __thiscall ModManager::UpdateWorkshopMods(ModManager *this) { undefined2 *puVar1; undefined1 *puVar2; byte bVar3; std_string *psVar4; int iVar5; qword qVar6; byte *pbVar7; int ****ppppiVar8; int ****ppppiVar9; undefined4 *puVar10; byte ****ppppbVar11; LPCSTR ***ppppCVar12; char *text; int ****ppppiVar13; LPCSTR ***ppppCVar14; uint uVar15; qword *pqVar16; int ****ppppiVar17; int iVar18; int ****ppppiVar19; int *in_stack_00000004; _SHFILEOPSTRUCTA local_2f0; _SHFILEOPSTRUCTA local_2d0; int *local_2b0; uint local_2ac; undefined1 *local_2a8; int ****local_2a4; char local_29d; int ****local_29c; int ****local_298; LPCSTR ***local_294; int ****local_290; byte ****local_28c [5]; uint local_278; byte ****local_274 [4]; undefined4 local_264; uint local_260; int ****local_25c; int ***pppiStack_258; int ***pppiStack_254; int ***pppiStack_250; int ****local_24c; int ****local_248; LPCSTR ***local_244; int ***pppiStack_240; int ***pppiStack_23c; int ***pppiStack_238; int ****local_234; int ****local_230; int ****local_22c; int ***pppiStack_228; int ***pppiStack_224; int ***pppiStack_220; int ****local_21c; int ****local_218; byte local_214 [256]; byte local_114 [256]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00b07cb7; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_114 + 0x110); ExceptionList = &local_10; local_2b0 = in_stack_00000004; local_2ac = 0; iVar18 = *in_stack_00000004; iVar5 = in_stack_00000004[1] - iVar18 >> 0x1f; if ((in_stack_00000004[1] - iVar18) / 0x50 + iVar5 != iVar5) { do { ppppiVar19 = (int ****)(local_2ac * 0x50 + iVar18); local_29c = ppppiVar19; if (*ppppiVar19 == (int ***)0x2) { pbVar7 = string_table_translate(&g_manager->_stringTablePc,(byte *)"#MOD_UNINSTALLING"); sprintf_s(local_214,0x100,pbVar7); pbVar7 = local_214; do { bVar3 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar3 != 0); std::string::assign(&g_manager->field_0x4a6dc,local_214,(int)pbVar7 - (int)(local_214 + 1)); local_29c = (int ****)ppppiVar19[0xb]; ppppiVar17 = ppppiVar19 + 7; local_244 = (LPCSTR ***)0x0; local_234 = (int ****)0x0; local_230 = (int ****)0x0; if ((int ***)0xf < ppppiVar19[0xc]) { ppppiVar17 = (int ****)*ppppiVar17; } if (&DAT_0000000f < local_29c) { ppppiVar19 = (int ****)((uint)local_29c | 0xf); if ((int ****)0x7fffffff < ppppiVar19) { ppppiVar19 = (int ****)0x7fffffff; } local_244 = std::_Allocate((uint)((int)ppppiVar19 + 1)); memcpy(local_244,ppppiVar17,(size_t)((int)local_29c + 1)); local_230 = ppppiVar19; } else { local_244 = (LPCSTR ***)*ppppiVar17; pppiStack_240 = ppppiVar17[1]; pppiStack_23c = ppppiVar17[2]; pppiStack_238 = ppppiVar17[3]; local_230 = (int ****)&DAT_0000000f; } local_8._0_1_ = 6; local_8._1_3_ = 0; local_234 = local_29c; std::string::append((char *)&local_244,&DAT_00b76eac,1); ppppiVar13 = (int ****)0x0; ppppCVar14 = local_244; ppppiVar19 = local_234; ppppiVar17 = local_230; if (local_234 != (int ****)0x0) { do { ppppCVar12 = (LPCSTR ***)&local_244; if (&DAT_0000000f < ppppiVar17) { ppppCVar12 = ppppCVar14; } if (*(char *)((int)ppppCVar12 + (int)ppppiVar13) == '/') { ppppCVar12 = (LPCSTR ***)&local_244; if (&DAT_0000000f < ppppiVar17) { ppppCVar12 = ppppCVar14; } *(undefined1 *)((int)ppppCVar12 + (int)ppppiVar13) = 0x5c; ppppCVar14 = local_244; ppppiVar19 = local_234; ppppiVar17 = local_230; } ppppiVar13 = (int ****)((int)ppppiVar13 + 1); } while (ppppiVar13 < ppppiVar19); } if (ppppiVar19 < ppppiVar17) { local_234 = (int ****)((int)ppppiVar19 + 1); ppppCVar12 = (LPCSTR ***)&local_244; if (&DAT_0000000f < ppppiVar17) { ppppCVar12 = ppppCVar14; } *(undefined2 *)((int)ppppCVar12 + (int)ppppiVar19) = 0; } else { if (ppppiVar19 == (int ****)0x7fffffff) goto LAB_008fb119; local_290 = (int ****)((uint)((int)ppppiVar19 + 1) | 0xf); if (local_290 < (int ****)0x80000000) { if ((int ****)(0x7fffffff - ((uint)ppppiVar17 >> 1)) < ppppiVar17) { local_290 = (int ****)0x7fffffff; } else { ppppiVar13 = (int ****)((int)ppppiVar17 + ((uint)ppppiVar17 >> 1)); if (local_290 < ppppiVar13) { local_290 = ppppiVar13; } } } else { local_290 = (int ****)0x7fffffff; } local_294 = std::_Allocate((uint)((int)local_290 + 1)); ppppCVar14 = local_244; local_234 = (int ****)((int)ppppiVar19 + 1); local_230 = local_290; local_29c = (int ****)((int)local_294 + (int)ppppiVar19); local_298 = (int ****)((undefined1 *)((int)ppppiVar19 + 1) + (int)local_294); if (ppppiVar17 < (int ****)0x10) { memcpy(local_294,&local_244,(size_t)ppppiVar19); *(undefined1 *)local_29c = 0; *(undefined1 *)local_298 = 0; } else { memcpy(local_294,local_244,(size_t)ppppiVar19); ppppiVar19 = (int ****)((int)ppppiVar17 + 1); *(undefined1 *)local_29c = 0; *(undefined1 *)local_298 = 0; ppppCVar12 = ppppCVar14; if ((int ****)0xfff < ppppiVar19) { ppppCVar12 = (LPCSTR ***)ppppCVar14[-1]; ppppiVar19 = ppppiVar17 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)ppppCVar14 + (-4 - (int)ppppCVar12))) goto LAB_008fb113; } operator_delete(ppppCVar12,(uint)ppppiVar19); } local_244 = local_294; } local_2f0.hwnd = (HWND)0x0; local_2f0.wFunc = 0; local_2f0.pFrom = (LPCSTR)0x0; local_2f0.pTo = (LPCSTR)0x0; local_2f0._24_4_ = 0; local_2f0._16_8_ = 0; local_2f0.lpszProgressTitle._2_2_ = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); local_2f0.hwnd = (HWND)0x0; } else if (DAT_00c73694 == 0x60001) { local_2f0.hwnd = *(HWND *)((int)g_glfwWindow + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized"); local_2f0.hwnd = (HWND)0x0; } local_2f0.fFlags = 0x614; local_2f0.pFrom = (LPCSTR)&local_244; if (&DAT_0000000f < local_230) { local_2f0.pFrom = (LPCSTR)local_244; } local_2f0.wFunc = 3; SHFileOperationA(&local_2f0); local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; if (&DAT_0000000f < local_230) { ppppiVar19 = (int ****)((int)local_230 + 1); ppppCVar14 = local_244; if ((int ****)0xfff < ppppiVar19) { ppppCVar14 = (LPCSTR ***)local_244[-1]; ppppiVar19 = local_230 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_244 + (-4 - (int)ppppCVar14))) goto LAB_008fb113; } operator_delete(ppppCVar14,(uint)ppppiVar19); } local_234 = (int ****)0x0; local_230 = (int ****)&DAT_0000000f; local_244 = (LPCSTR ***)((uint)local_244 & 0xffffff00); } else { text = "#MOD_INSTALLING"; if (*ppppiVar19 != (int ***)0x1) { text = "#MOD_UPDATING"; } pbVar7 = string_table_translate(&g_manager->_stringTablePc,(byte *)text); sprintf_s(local_114,0x100,pbVar7); pbVar7 = local_114; do { bVar3 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar3 != 0); std::string::assign(&g_manager->field_0x4a6dc,local_114,(int)pbVar7 - (int)(local_114 + 1)); local_290 = (int ****)ppppiVar19[0xb]; ppppiVar17 = ppppiVar19 + 7; local_25c = (int ****)0x0; local_24c = (int ****)0x0; local_248 = (int ****)0x0; if ((int ***)0xf < ppppiVar19[0xc]) { ppppiVar17 = (int ****)*ppppiVar17; } if (&DAT_0000000f < local_290) { ppppiVar19 = (int ****)((uint)local_290 | 0xf); if ((int ****)0x7fffffff < ppppiVar19) { ppppiVar19 = (int ****)0x7fffffff; } local_25c = std::_Allocate((uint)((int)ppppiVar19 + 1)); memcpy(local_25c,ppppiVar17,(size_t)((int)local_290 + 1)); local_24c = local_290; local_248 = ppppiVar19; } else { local_25c = (int ****)*ppppiVar17; pppiStack_258 = ppppiVar17[1]; pppiStack_254 = ppppiVar17[2]; pppiStack_250 = ppppiVar17[3]; local_248 = (int ****)&DAT_0000000f; local_24c = local_290; } local_2a4 = local_29c + 0xd; local_8 = 0; local_22c = (int ****)0x0; local_21c = (int ****)0x0; local_218 = (int ****)0x0; ppppiVar19 = (int ****)local_29c[0x11]; local_290 = local_2a4; if ((int ***)0xf < local_29c[0x12]) { local_290 = (int ****)*local_2a4; } if (&DAT_0000000f < ppppiVar19) { ppppiVar17 = (int ****)((uint)ppppiVar19 | 0xf); if ((int ****)0x7fffffff < ppppiVar17) { ppppiVar17 = (int ****)0x7fffffff; } local_22c = std::_Allocate((uint)((int)ppppiVar17 + 1)); memcpy(local_22c,local_290,(size_t)((int)ppppiVar19 + 1)); local_218 = ppppiVar17; } else { local_22c = (int ****)*local_290; pppiStack_228 = local_290[1]; pppiStack_224 = local_290[2]; pppiStack_220 = local_290[3]; local_218 = (int ****)&DAT_0000000f; } local_8._0_1_ = 1; local_21c = ppppiVar19; std::string::append((char *)&local_25c,&DAT_00b76eac,1); std::string::append((char *)&local_22c,&DAT_00b76eac,1); ppppiVar19 = (int ****)0x0; if (local_24c != (int ****)0x0) { ppppiVar17 = local_248; ppppiVar13 = local_25c; ppppiVar8 = local_24c; do { ppppiVar9 = (int ****)&local_25c; if (&DAT_0000000f < ppppiVar17) { ppppiVar9 = ppppiVar13; } if (*(char *)((int)ppppiVar9 + (int)ppppiVar19) == '/') { ppppiVar8 = (int ****)&local_25c; if (&DAT_0000000f < ppppiVar17) { ppppiVar8 = ppppiVar13; } *(undefined1 *)((int)ppppiVar8 + (int)ppppiVar19) = 0x5c; ppppiVar17 = local_248; ppppiVar13 = local_25c; ppppiVar8 = local_24c; } ppppiVar19 = (int ****)((int)ppppiVar19 + 1); } while (ppppiVar19 < ppppiVar8); } ppppiVar19 = (int ****)0x0; if (local_21c != (int ****)0x0) { ppppiVar17 = local_21c; ppppiVar13 = local_218; ppppiVar8 = local_22c; do { ppppiVar9 = (int ****)&local_22c; if (&DAT_0000000f < ppppiVar13) { ppppiVar9 = ppppiVar8; } if (*(char *)((int)ppppiVar9 + (int)ppppiVar19) == '/') { ppppiVar17 = (int ****)&local_22c; if (&DAT_0000000f < ppppiVar13) { ppppiVar17 = ppppiVar8; } *(undefined1 *)((int)ppppiVar17 + (int)ppppiVar19) = 0x5c; ppppiVar17 = local_21c; ppppiVar13 = local_218; ppppiVar8 = local_22c; } ppppiVar19 = (int ****)((int)ppppiVar19 + 1); } while (ppppiVar19 < ppppiVar17); } std::string::append((char *)&local_25c,&DAT_00b76fc0,3); ppppiVar19 = local_24c; local_290 = local_248; if (local_24c < local_248) { ppppiVar19 = (int ****)&local_25c; if (&DAT_0000000f < local_248) { ppppiVar19 = local_25c; } puVar1 = (undefined2 *)((int)ppppiVar19 + (int)local_24c); local_24c = (int ****)((int)local_24c + 1); *puVar1 = 0; } else { if (local_24c == (int ****)0x7fffffff) goto LAB_008fb119; ppppiVar17 = (int ****)((uint)((int)local_24c + 1) | 0xf); if (ppppiVar17 < (int ****)0x80000000) { if ((int ****)(0x7fffffff - ((uint)local_248 >> 1)) < local_248) { ppppiVar17 = (int ****)0x7fffffff; } else { ppppiVar13 = (int ****)(((uint)local_248 >> 1) + (int)local_248); if (ppppiVar17 < ppppiVar13) { ppppiVar17 = ppppiVar13; } } } else { ppppiVar17 = (int ****)0x7fffffff; } local_298 = std::_Allocate((uint)((int)ppppiVar17 + 1)); ppppiVar13 = local_25c; local_24c = (int ****)((int)ppppiVar19 + 1); local_294 = (LPCSTR ***)((undefined1 *)((int)ppppiVar19 + 1) + (int)local_298); puVar2 = (undefined1 *)((int)ppppiVar19 + (int)local_298); local_2a8 = puVar2; local_248 = ppppiVar17; if (local_290 < (int ****)0x10) { memcpy(local_298,&local_25c,(size_t)ppppiVar19); *puVar2 = 0; *(undefined1 *)local_294 = 0; } else { memcpy(local_298,local_25c,(size_t)ppppiVar19); ppppiVar17 = (int ****)((int)local_290 + 1); *local_2a8 = 0; *(undefined1 *)local_294 = 0; ppppiVar19 = ppppiVar13; if ((int ****)0xfff < ppppiVar17) { ppppiVar19 = (int ****)ppppiVar13[-1]; ppppiVar17 = local_290 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)ppppiVar13 + (-4 - (int)ppppiVar19))) goto LAB_008fb113; } operator_delete(ppppiVar19,(uint)ppppiVar17); } local_25c = local_298; } ppppiVar19 = local_21c; local_298 = local_218; if (local_21c < local_218) { ppppiVar19 = (int ****)&local_22c; if (&DAT_0000000f < local_218) { ppppiVar19 = local_22c; } puVar1 = (undefined2 *)((int)ppppiVar19 + (int)local_21c); local_21c = (int ****)((int)local_21c + 1); *puVar1 = 0; } else { if (local_21c == (int ****)0x7fffffff) goto LAB_008fb119; ppppiVar17 = (int ****)((uint)((int)local_21c + 1) | 0xf); if (ppppiVar17 < (int ****)0x80000000) { if ((int ****)(0x7fffffff - ((uint)local_218 >> 1)) < local_218) { ppppiVar17 = (int ****)0x7fffffff; } else { ppppiVar13 = (int ****)(((uint)local_218 >> 1) + (int)local_218); if (ppppiVar17 < ppppiVar13) { ppppiVar17 = ppppiVar13; } } } else { ppppiVar17 = (int ****)0x7fffffff; } local_290 = std::_Allocate((uint)((int)ppppiVar17 + 1)); ppppiVar13 = local_22c; local_21c = (int ****)((int)ppppiVar19 + 1); local_294 = (LPCSTR ***)((undefined1 *)((int)ppppiVar19 + 1) + (int)local_290); puVar2 = (undefined1 *)((int)local_290 + (int)ppppiVar19); local_2a8 = puVar2; local_218 = ppppiVar17; if (local_298 < (int ****)0x10) { memcpy(local_290,&local_22c,(size_t)ppppiVar19); *puVar2 = 0; *(undefined1 *)local_294 = 0; } else { memcpy(local_290,local_22c,(size_t)ppppiVar19); ppppiVar17 = (int ****)((int)local_298 + 1); *local_2a8 = 0; *(undefined1 *)local_294 = 0; ppppiVar19 = ppppiVar13; if ((int ****)0xfff < ppppiVar17) { ppppiVar19 = (int ****)ppppiVar13[-1]; ppppiVar17 = local_298 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)ppppiVar13 + (-4 - (int)ppppiVar19))) goto LAB_008fb113; } operator_delete(ppppiVar19,(uint)ppppiVar17); } local_22c = local_290; } local_2d0.hwnd = (HWND)0x0; local_2d0.wFunc = 0; local_2d0.pFrom = (LPCSTR)0x0; local_2d0.pTo = (LPCSTR)0x0; local_2d0._24_4_ = 0; local_2d0._16_8_ = 0; local_2d0.lpszProgressTitle._2_2_ = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); local_2d0.hwnd = (HWND)0x0; } else if (DAT_00c73694 == 0x60001) { local_2d0.hwnd = *(HWND *)((int)g_glfwWindow + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized"); local_2d0.hwnd = (HWND)0x0; } local_2d0.fFlags = 0x614; local_2d0.pFrom = (LPCSTR)&local_22c; if (&DAT_0000000f < local_218) { local_2d0.pFrom = (LPCSTR)local_22c; } local_2d0.wFunc = 3; SHFileOperationA(&local_2d0); ppppiVar19 = (int ****)&local_22c; if (&DAT_0000000f < local_218) { ppppiVar19 = local_22c; } CreateDirectoryA((LPCSTR)ppppiVar19,(LPSECURITY_ATTRIBUTES)0x0); ppppiVar19 = local_2a4; psVar4 = (std_string *)local_2a4[4]; if (0x7fffffffU - (int)psVar4 < 0xe) { LAB_008fb119: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppiVar17 = local_2a4; if ((int ***)0xf < local_2a4[5]) { ppppiVar17 = (int ****)*local_2a4; } std::string::concat((char *)local_28c,(int)local_2a4,psVar4,(byte *)ppppiVar17,(uint)psVar4, (byte *)"/unfinished.it",0xe); local_8 = CONCAT31(local_8._1_3_,2); ppppbVar11 = (byte ****)local_28c; if (0xf < local_278) { ppppbVar11 = local_28c[0]; } puVar10 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)ppppbVar11,0); if (puVar10 != (undefined4 *)0x0) { (**(code **)*puVar10)(1); } local_8._0_1_ = 1; if (0xf < local_278) { uVar15 = local_278 + 1; ppppbVar11 = local_28c[0]; if (0xfff < uVar15) { ppppbVar11 = (byte ****)local_28c[0][-1]; uVar15 = local_278 + 0x24; if ((byte *)0x1f < (byte *)((int)local_28c[0] + (-4 - (int)ppppbVar11))) goto LAB_008fb113; } operator_delete(ppppbVar11,uVar15); } local_2d0.wFunc = 2; local_2d0.pTo = (LPCSTR)&local_22c; if (&DAT_0000000f < local_218) { local_2d0.pTo = (LPCSTR)local_22c; } local_2d0.pFrom = (LPCSTR)&local_25c; if (&DAT_0000000f < local_248) { local_2d0.pFrom = (LPCSTR)local_25c; } SHFileOperationA(&local_2d0); if (*(char *)(local_29c + 0x13) != '\0') { psVar4 = (std_string *)ppppiVar19[4]; if (0x7fffffffU - (int)psVar4 < 0xb) goto LAB_008fb119; ppppiVar17 = ppppiVar19; if ((int ***)0xf < ppppiVar19[5]) { ppppiVar17 = (int ****)*ppppiVar19; } std::string::concat((char *)local_28c,(int)local_2a4,psVar4,(byte *)ppppiVar17, (uint)psVar4,(byte *)"/disable.it",0xb); local_8 = CONCAT31(local_8._1_3_,3); ppppbVar11 = (byte ****)local_28c; if (0xf < local_278) { ppppbVar11 = local_28c[0]; } puVar10 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)ppppbVar11,0); if (puVar10 != (undefined4 *)0x0) { (**(code **)*puVar10)(1); } local_8._0_1_ = 1; if (0xf < local_278) { uVar15 = local_278 + 1; ppppbVar11 = local_28c[0]; if (0xfff < uVar15) { ppppbVar11 = (byte ****)local_28c[0][-1]; uVar15 = local_278 + 0x24; if ((byte *)0x1f < (byte *)((int)local_28c[0] + (-4 - (int)ppppbVar11))) goto LAB_008fb113; } operator_delete(ppppbVar11,uVar15); } } psVar4 = (std_string *)ppppiVar19[4]; if (0x7fffffffU - (int)psVar4 < 0xe) goto LAB_008fb119; if ((int ***)0xf < ppppiVar19[5]) { ppppiVar19 = (int ****)*ppppiVar19; } std::string::concat((char *)local_274,(int)local_2a4,psVar4,(byte *)ppppiVar19,(uint)psVar4, (byte *)"/unfinished.it",0xe); local_8 = CONCAT31(local_8._1_3_,4); ppppbVar11 = (byte ****)local_274; if (0xf < local_260) { ppppbVar11 = local_274[0]; } pbVar7 = FileSystem::ResolvePath((byte *)ppppbVar11); local_29d = pbVar7 != (byte *)0x0; if (pbVar7 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar16 = &g_allocatedBytesNoHeap; } else { pqVar16 = (qword *)((int)g_mainHeap + 0x30); } uVar15 = *(uint *)(pbVar7 + -4); qVar6 = *pqVar16; *(uint *)pqVar16 = (uint)*pqVar16 - uVar15; *(uint *)((int)pqVar16 + 4) = *(uint *)((int)pqVar16 + 4) - (uint)((uint)qVar6 < uVar15); free(pbVar7 + -4); } if (local_29d != '\0') { ppppbVar11 = (byte ****)local_274; if (0xf < local_260) { ppppbVar11 = local_274[0]; } remove((char *)ppppbVar11); } local_8._0_1_ = 1; if (0xf < local_260) { uVar15 = local_260 + 1; ppppbVar11 = local_274[0]; if (0xfff < uVar15) { ppppbVar11 = (byte ****)local_274[0][-1]; uVar15 = local_260 + 0x24; if ((byte *)0x1f < (byte *)((int)local_274[0] + (-4 - (int)ppppbVar11))) goto LAB_008fb113; } operator_delete(ppppbVar11,uVar15); } local_8._0_1_ = 0; local_264 = 0; local_260 = 0xf; local_274[0] = (byte ****)((uint)local_274[0] & 0xffffff00); if (&DAT_0000000f < local_218) { ppppiVar17 = (int ****)((int)local_218 + 1); ppppiVar19 = local_22c; if ((int ****)0xfff < ppppiVar17) { ppppiVar19 = (int ****)local_22c[-1]; ppppiVar17 = local_218 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_22c + (-4 - (int)ppppiVar19))) goto LAB_008fb113; } operator_delete(ppppiVar19,(uint)ppppiVar17); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; local_21c = (int ****)0x0; local_218 = (int ****)&DAT_0000000f; local_22c = (int ****)((uint)local_22c & 0xffffff00); if (&DAT_0000000f < local_248) { ppppiVar17 = (int ****)((int)local_248 + 1); ppppiVar19 = local_25c; if ((int ****)0xfff < ppppiVar17) { ppppiVar19 = (int ****)local_25c[-1]; ppppiVar17 = local_248 + 9; if ((undefined1 *)0x1f < (undefined1 *)((int)local_25c + (-4 - (int)ppppiVar19))) { LAB_008fb113: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppiVar19,(uint)ppppiVar17); } } local_2ac = local_2ac + 1; iVar18 = *local_2b0; } while (local_2ac < (uint)((local_2b0[1] - iVar18) / 0x50)); } *(undefined1 *)(local_2b0 + 3) = 1; ExceptionList = local_10; return; } //@@ 008fb120 ModManager::UpdateWorkshopMods /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: REPENTOGON name; SteamInternal_ContextInit UGC calls, "Updating mod %s", /metadata.xml, /unfinished.it, gfx/ui/loading.anm2 spinner, ModManager::Reset prototype: REPENTOGON */ void __thiscall ModManager::UpdateWorkshopMods(ModManager *this) { uint *puVar1; uint *puVar2; ModManager *pMVar3; ANM2 *this_00; char cVar4; byte bVar5; uint uVar6; int *piVar7; undefined4 *puVar8; undefined4 *puVar9; byte *pbVar10; int iVar11; void *pvVar12; void *pvVar13; undefined3 extraout_var; ModManager *pMVar14; int iVar15; byte *******pppppppbVar16; void **text; undefined4 uVar17; byte *pbVar18; byte *pbVar19; std_string *allocSource; Manager *extraout_ECX; Manager *extraout_ECX_00; Manager *this_01; DWORD dwMilliseconds; ModManager MVar20; ModManager *pMVar21; char *pcVar22; code *pcVar23; undefined4 uVar24; undefined4 uVar25; double dVar26; double dVar27; LARGE_INTEGER LStack_105a8; void *pvStack_105a0; ModManager *pMStack_1059c; ModManager *pMStack_10598; ModManager *pMStack_10594; char cStack_10590; undefined8 uStack_1058c; undefined8 uStack_10584; LARGE_INTEGER LStack_1057c; undefined4 *puStack_10574; ModManager *pMStack_10570; LARGE_INTEGER LStack_1056c; ModManager *pMStack_10564; byte abStack_10560 [7]; char cStack_10559; undefined1 auStack_10558 [48]; undefined1 auStack_10528 [65556]; void *local_514 [4]; undefined4 local_504; uint local_500; undefined4 local_4fc; void *local_4f8 [4]; undefined4 local_4e8; uint local_4e4; void *local_4e0 [4]; undefined4 local_4d0; uint local_4cc; void *local_4c8 [4]; undefined4 local_4b8; uint local_4b4; undefined1 local_4b0; byte *******local_4ac [4]; std_string *local_49c; uint local_498; byte *******local_494 [4]; std_string *local_484; uint local_480; byte *******local_47c [4]; uint local_46c; uint local_468; char local_464 [16]; undefined4 local_454; uint local_450; byte *******local_44c [4]; uint local_43c; uint local_438; std_string local_434; byte local_41c [844]; byte abStack_d0 [4]; undefined *local_cc [4]; undefined *local_bc; undefined **local_b4 [2]; basic_iostream_> local_ac [4]; undefined4 *local_a8; undefined4 *local_a4; undefined4 *local_98; undefined4 *local_94; int *local_88; int *local_84; int local_7c; uint local_78; basic_ios_> local_64 [72]; byte local_1c [8]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07de3; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; pMStack_10564 = (ModManager *)0x0; uStack_1058c = (double)(ulonglong)(uint)uStack_1058c; pMStack_10570 = this; local_14 = uVar6; piVar7 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c48c,uVar6); if (*piVar7 != 0) { cStack_10559 = '\0'; puVar8 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c48c,uVar6); puVar8 = (undefined4 *)(**(code **)(*(int *)*puVar8 + 0x128))(); puStack_10574 = puVar8; pvStack_105a0 = operator_new_tracked (-(uint)((int)(ZEXT48(puVar8) * 8 >> 0x20) != 0) | (uint)(ZEXT48(puVar8) * 8)); puVar9 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c48c); (**(code **)(*(int *)*puVar9 + 300))(pvStack_105a0,puVar8); cStack_10590 = '\0'; pMStack_1059c = (ModManager *)0x0; pMStack_10598 = (ModManager *)0x0; pMStack_10594 = (ModManager *)0x0; puVar8 = (undefined4 *)0x0; local_8._0_1_ = 0; local_8._1_3_ = 0; uStack_10584 = (double)(ulonglong)(uint)uStack_10584; if (puStack_10574 != (undefined4 *)0x0) { pcVar23 = SteamInternal_ContextInit_exref; do { puVar9 = (undefined4 *)(*pcVar23)(&PTR_FUN_00c5c48c); uVar6 = (**(code **)(*(int *)*puVar9 + 0x130)) (*(undefined4 *)((int)pvStack_105a0 + (int)puVar8 * 8), *(undefined4 *)((int)pvStack_105a0 + (int)puVar8 * 8 + 4)); if ((uVar6 & 4) != 0) { pMStack_10564 = (ModManager *)0x0; LStack_105a8.QuadPart = 0.0; memset(local_41c,0,0x400); puVar9 = (undefined4 *)(*pcVar23)(&PTR_FUN_00c5c48c); cVar4 = (**(code **)(*(int *)*puVar9 + 0x134)) (*(undefined4 *)((int)pvStack_105a0 + (int)puVar8 * 8), *(undefined4 *)((int)pvStack_105a0 + (int)puVar8 * 8 + 4),&LStack_105a8 ,local_41c,0x400,&pMStack_10564); if (cVar4 != '\0') { pbVar10 = path_join((byte *)"/metadata.xml",local_41c,0,0); piVar7 = FileSystem::Open(&PTR_vftable_00c37a10,pbVar10,(int *)0x0); if (pbVar10 != (byte *)0x0) { operator_delete(pbVar10,1); } if (piVar7 != (int *)0x0) { local_434._size = 0; local_434._capacity = 0xf; local_434._buf._0_4_ = (char *)0x0; local_49c = (std_string *)0x0; local_498 = 0xf; local_4ac[0] = (byte *******)0x0; local_46c = 0; local_468 = 0xf; local_47c[0] = (byte *******)0x0; local_454 = 0; local_450 = 0xf; local_464._0_4_ = (undefined ***)0x0; local_8._0_1_ = 4; iVar11 = (**(code **)(*piVar7 + 4))(); LStack_1057c.s.HighPart = (LONG)operator_new_tracked(iVar11 + 1); (**(code **)(*piVar7 + 0x14))(LStack_1057c.s.HighPart,1,iVar11); *(undefined1 *)(LStack_1057c.s.HighPart + iVar11) = 0; (**(code **)*piVar7)(1); FUN_00413b90(); local_8 = CONCAT31(local_8._1_3_,5); pbVar10 = (byte *)0x8fb3de; uVar24 = LStack_1057c._4_4_; rapidxml::xml_document::parse(auStack_10558,(byte *)LStack_1057c.s.HighPart); bVar5 = (byte)uVar24; pvVar12 = xml_node::first_node(auStack_10558,(byte *)"metadata",(int)pbVar10,bVar5); if (pvVar12 != (void *)0x0) { pvVar13 = xml_node::first_node(pvVar12,s_name,(int)pbVar10,bVar5); if (pvVar13 != (void *)0x0) { pbVar10 = &g_xmlNullStr; if (*(byte **)((int)pvVar13 + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)pvVar13 + 4); } pbVar18 = pbVar10; do { bVar5 = *pbVar18; pbVar18 = pbVar18 + 1; } while (bVar5 != 0); uVar6 = (int)pbVar18 - (int)(pbVar10 + 1); std::string::assign(local_434._buf,pbVar10,uVar6); bVar5 = (byte)uVar6; } pvVar13 = xml_node::first_node(pvVar12,(byte *)"directory",(int)pbVar10,bVar5); if (pvVar13 != (void *)0x0) { pbVar10 = &g_xmlNullStr; if (*(byte **)((int)pvVar13 + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)pvVar13 + 4); } pbVar18 = pbVar10; do { bVar5 = *pbVar18; pbVar18 = pbVar18 + 1; } while (bVar5 != 0); uVar6 = (int)pbVar18 - (int)(pbVar10 + 1); std::string::assign((char *)local_4ac,pbVar10,uVar6); bVar5 = (byte)uVar6; } pvVar13 = xml_node::first_node(pvVar12,s_id,(int)pbVar10,bVar5); if (pvVar13 != (void *)0x0) { pbVar10 = &g_xmlNullStr; if (*(byte **)((int)pvVar13 + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)pvVar13 + 4); } pbVar18 = pbVar10; do { bVar5 = *pbVar18; pbVar18 = pbVar18 + 1; } while (bVar5 != 0); uVar6 = (int)pbVar18 - (int)(pbVar10 + 1); std::string::assign((char *)local_47c,pbVar10,uVar6); bVar5 = (byte)uVar6; } pvVar12 = xml_node::first_node(pvVar12,(byte *)"version",(int)pbVar10,bVar5); if (pvVar12 != (void *)0x0) { pbVar10 = &g_xmlNullStr; if (*(byte **)((int)pvVar12 + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)pvVar12 + 4); } pbVar18 = pbVar10; do { bVar5 = *pbVar18; pbVar18 = pbVar18 + 1; } while (bVar5 != 0); std::string::assign(local_464,pbVar10,(int)pbVar18 - (int)(pbVar10 + 1)); } } if ((undefined ***)LStack_1057c.s.HighPart != (undefined ***)0x0) { local_8 = CONCAT31(local_8._1_3_,6); tracked_alloc(1,(void *)LStack_1057c.s.HighPart,0); } local_8._0_1_ = 7; xml_memory_pool::clear(auStack_10528); local_8 = CONCAT31(local_8._1_3_,4); if ((local_46c == 0) || (local_49c == (std_string *)0x0)) { local_8._0_1_ = 3; if (0xf < local_450) { uVar6 = local_450 + 1; uVar24 = local_464._0_4_; if (0xfff < uVar6) { uVar24 = *(undefined ***)(local_464._0_4_ - 4); uVar6 = local_450 + 0x24; if (0x1f < (local_464._0_4_ - uVar24) - 4) goto LAB_008fc14c; } operator_delete((void *)uVar24,uVar6); } } else { iVar11 = 0; MVar20 = *pMStack_10570; pMVar14 = pMStack_10570; if (MVar20 == pMStack_10570[1]) { LAB_008fb5a4: uVar24._1_3_ = (undefined3)((uint)pMVar14 >> 8); uVar24._0_1_ = 1; LStack_1056c.s.HighPart = uVar24; if (iVar11 != 0) { LStack_1057c.s.HighPart = (LONG)local_464; if (0xf < local_450) { LStack_1057c._4_4_ = local_464._0_4_; } pcVar22 = (char *)(iVar11 + 0x78); if (0xf < *(uint *)(iVar11 + 0x8c)) { pcVar22 = *(char **)pcVar22; } if ((undefined ***)LStack_1057c.s.HighPart != (undefined ***)0x0) { do { LStack_1056c.s.HighPart._0_1_ = 1; if (pcVar22 == (char *)0x0) goto LAB_008fb69d; iVar11 = atoi(pcVar22); iVar15 = atoi((char *)LStack_1057c.s.HighPart); if (iVar15 < iVar11) { uVar24 = 0; LStack_1056c.s = (_struct_19) (CONCAT44(iVar15,LStack_1056c.s.LowPart) & 0xffffff00ffffffff); LAB_008fb684: if ((undefined ***)LStack_1057c.s.HighPart != (undefined ***)0x0) goto LAB_008fb69d; goto LAB_008fb68d; } LStack_1056c.s.HighPart._0_1_ = 1; iVar11 = atoi(pcVar22); iVar15 = atoi((char *)LStack_1057c.s.HighPart); if (iVar11 < iVar15) { uVar24 = LStack_1056c.s.HighPart; goto LAB_008fb684; } uVar24 = strchr((char *)(LStack_1057c.s.HighPart + 1),0x2e); LStack_1057c.s.HighPart = uVar24; pcVar22 = strchr(pcVar22 + 1,0x2e); if ((undefined ***)uVar24 != (undefined ***)0x0) { uVar24 = uVar24 + 1; LStack_1057c.s.HighPart = uVar24; } if (pcVar22 != (char *)0x0) { pcVar22 = pcVar22 + 1; } } while ((undefined ***)uVar24 != (undefined ***)0x0); uVar24 = 1; } LAB_008fb68d: uVar6 = uVar24 & 0xff; if (pcVar22 == (char *)0x0) { uVar6 = 0; } LStack_1056c.s.HighPart = uVar6; } } else { do { iVar11 = *(int *)MVar20; pbVar10 = (byte *)(iVar11 + 0x90); pppppppbVar16 = (byte *******)local_47c; if (0xf < local_468) { pppppppbVar16 = local_47c[0]; } if (0xf < *(uint *)(iVar11 + 0xa4)) { pbVar10 = *(byte **)pbVar10; } bVar5 = str_eq(pbVar10,*(uint *)(iVar11 + 0xa0),(byte *)pppppppbVar16,local_46c) ; pMVar14 = (ModManager *)CONCAT31(extraout_var,bVar5); if (bVar5 != 0) goto LAB_008fb5a4; MVar20 = (ModManager)((int)MVar20 + 4); } while (MVar20 != pMStack_10570[1]); LStack_1056c.s.HighPart._0_1_ = 1; } LAB_008fb69d: pbVar10 = local_41c; local_504 = 0; local_500 = 0xf; local_514[0] = (void *)0x0; do { bVar5 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar5 != 0); std::string::assign((char *)local_514,local_41c,(int)pbVar10 - (int)(local_41c + 1)) ; local_8._0_1_ = 8; local_484 = (std_string *)0x0; local_480 = 0xf; local_494[0] = (byte *******)0x0; pbVar10 = g_modsDirectory; do { pbVar18 = pbVar10; pbVar10 = pbVar18 + 1; } while (*pbVar18 != 0); std::string::assign((char *)local_494,g_modsDirectory,(uint)(pbVar18 + -0xc72e28)); local_8._0_1_ = 9; abStack_10560[0] = 0x5f; if (local_49c == (std_string *)0x7fffffff) goto LAB_008fc544; pppppppbVar16 = (byte *******)local_4ac; if (0xf < local_498) { pppppppbVar16 = local_4ac[0]; } std::string::concat((char *)local_44c,(int)pMStack_10564,local_49c, (byte *)pppppppbVar16,(uint)local_49c,abStack_10560,1); uVar24 = uStack_1058c._4_4_; uStack_1058c = (double)((ulonglong)uStack_1058c | 0x100000000); local_8._0_1_ = 10; pppppppbVar16 = (byte *******)local_44c; if (0xf < local_438) { pppppppbVar16 = local_44c[0]; } std::string::append((char *)local_494,(byte *)pppppppbVar16,local_43c); local_8._0_1_ = 9; if (0xf < local_438) { uVar6 = local_438 + 1; pppppppbVar16 = local_44c[0]; if (0xfff < uVar6) { pppppppbVar16 = (byte *******)local_44c[0][-1]; uVar6 = local_438 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44c[0] + (-4 - (int)pppppppbVar16))) goto LAB_008fc14c; } operator_delete(pppppppbVar16,uVar6); } pppppppbVar16 = (byte *******)local_47c; if (0xf < local_468) { pppppppbVar16 = local_47c[0]; } std::string::append((char *)local_494,(byte *)pppppppbVar16,local_46c); if (LStack_1056c.s.HighPart._0_1_ == '\0') { if (0x7fffffffU - (int)local_484 < 0xe) goto LAB_008fc544; pppppppbVar16 = (byte *******)local_494; if (0xf < local_480) { pppppppbVar16 = local_494[0]; } std::string::concat((char *)local_44c,(int)pMStack_10564,local_484, (byte *)pppppppbVar16,(uint)local_484,(byte *)"/unfinished.it" ,0xe); uStack_1058c = (double)(CONCAT44(uVar24,(uint)uStack_1058c) | 0x300000000); local_8._0_1_ = 0xb; pppppppbVar16 = (byte *******)local_44c; if (0xf < local_438) { pppppppbVar16 = local_44c[0]; } pbVar10 = FileSystem::ResolvePath((byte *)pppppppbVar16); abStack_10560[0] = pbVar10 != (byte *)0x0; if (pbVar10 != (byte *)0x0) { local_8._0_1_ = 0xc; tracked_alloc(1,pbVar10,0); } LStack_1057c.s.HighPart = LStack_1056c.s.HighPart & 0xff; if (abStack_10560[0] != 0) { LStack_1057c.s.HighPart = 1; } local_8._0_1_ = 9; if (0xf < local_438) { uVar6 = local_438 + 1; pppppppbVar16 = local_44c[0]; if (0xfff < uVar6) { pppppppbVar16 = (byte *******)local_44c[0][-1]; uVar6 = local_438 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44c[0] + (-4 - (int)pppppppbVar16))) goto LAB_008fc14c; } operator_delete(pppppppbVar16,uVar6); } if ((char)LStack_1057c.s.HighPart != '\0') goto LAB_008fb92d; } else { LAB_008fb92d: KAGE_LogMessage(1,(byte *)"Updating mod \'%s\'\n"); add_mod_entry(&local_434,local_514,local_494); cStack_10559 = '\x01'; } local_8._0_1_ = 8; if (0xf < local_480) { uVar6 = local_480 + 1; pppppppbVar16 = local_494[0]; if (0xfff < uVar6) { pppppppbVar16 = (byte *******)local_494[0][-1]; uVar6 = local_480 + 0x24; if ((byte *)0x1f < (byte *)((int)local_494[0] + (-4 - (int)pppppppbVar16))) goto LAB_008fc14c; } operator_delete(pppppppbVar16,uVar6); } local_8._0_1_ = 4; if (0xf < local_500) { uVar6 = local_500 + 1; pvVar12 = local_514[0]; if (0xfff < uVar6) { pvVar12 = *(void **)((int)local_514[0] + -4); uVar6 = local_500 + 0x24; if (0x1f < (uint)((int)local_514[0] + (-4 - (int)pvVar12))) goto LAB_008fc14c; } operator_delete(pvVar12,uVar6); } local_8._0_1_ = 3; if (0xf < local_450) { uVar6 = local_450 + 1; uVar24 = local_464._0_4_; if (0xfff < uVar6) { uVar24 = *(undefined ***)(local_464._0_4_ - 4); uVar6 = local_450 + 0x24; if (0x1f < (local_464._0_4_ - uVar24) - 4) goto LAB_008fc14c; } operator_delete((void *)uVar24,uVar6); } } local_464._0_4_ = local_464._0_4_ & 0xffffff00; local_450 = 0xf; local_454 = 0; if (0xf < local_468) { local_8._0_1_ = 2; local_450 = 0xf; local_454 = 0; uVar6 = local_468 + 1; pppppppbVar16 = local_47c[0]; if (0xfff < uVar6) { pppppppbVar16 = (byte *******)local_47c[0][-1]; uVar6 = local_468 + 0x24; if ((byte *)0x1f < (byte *)((int)local_47c[0] + (-4 - (int)pppppppbVar16))) goto LAB_008fc14c; } operator_delete(pppppppbVar16,uVar6); } local_8._0_1_ = 1; if (0xf < local_498) { uVar6 = local_498 + 1; pppppppbVar16 = local_4ac[0]; if (0xfff < uVar6) { pppppppbVar16 = (byte *******)local_4ac[0][-1]; uVar6 = local_498 + 0x24; if ((byte *)0x1f < (byte *)((int)local_4ac[0] + (-4 - (int)pppppppbVar16))) goto LAB_008fc14c; } operator_delete(pppppppbVar16,uVar6); } local_8._0_1_ = 0; if (0xf < local_434._capacity) { uVar6 = local_434._capacity + 1; pcVar22 = (char *)local_434._buf._0_4_; if (0xfff < uVar6) { pcVar22 = *(char **)(local_434._buf._0_4_ + -4); uVar6 = local_434._capacity + 0x24; if ((char *)0x1f < (char *)(local_434._buf._0_4_ + (-4 - (int)pcVar22))) goto LAB_008fc14c; } operator_delete(pcVar22,uVar6); } } puVar8 = uStack_10584._4_4_; pcVar23 = SteamInternal_ContextInit_exref; } } puVar8 = (undefined4 *)((int)puVar8 + 1); uStack_10584 = (double)CONCAT44(puVar8,(uint)uStack_10584); } while (puVar8 < puStack_10574); } MVar20 = *pMStack_10570; if (MVar20 != pMStack_10570[1]) { LStack_1057c.s.HighPart = (LONG)local_b4; do { iVar11 = *(int *)MVar20; local_cc[0] = &DAT_00b1b17c; LStack_1056c.QuadPart = 0.0; local_bc = &DAT_00b1b174; puStack_10574 = (undefined4 *)(iVar11 + 0x90); std::basic_ios_>::basic_ios_> (local_64); local_8 = CONCAT31(local_8._1_3_,0xd); pMStack_10564 = (ModManager *)(uStack_1058c._4_4_ | 4); uStack_1058c = (double)((ulonglong)uStack_1058c | 0x400000000); std::basic_iostream_>:: basic_iostream_> ((basic_iostream_> *)local_cc, (basic_streambuf_> *)local_b4); local_8 = 0xe; *(undefined ***)((int)local_cc + *(int *)(local_cc[0] + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)(local_41c + *(int *)(local_cc[0] + 4) + 0x34c) = *(int *)(local_cc[0] + 4) + -0x68; std::basic_streambuf_>:: basic_streambuf_> ((basic_streambuf_> *)local_b4); local_8._0_1_ = 0xf; local_b4[0] = std::basic_stringbuf,std::allocator_>:: vftable; uVar6 = *(uint *)(iVar11 + 0xa0); uStack_10584 = (double)CONCAT44(uVar6,(uint)uStack_10584); if (0xf < *(uint *)(iVar11 + 0xa4)) { puStack_10574 = *(undefined4 **)(iVar11 + 0x90); } if (0x7fffffff < uVar6) { /* WARNING: Subroutine does not return */ std::_Xbad_alloc(); } if (uVar6 == 0) { local_7c = 0; } else { pvVar12 = std::_Allocate(uVar6); memcpy(pvVar12,puStack_10574,(size_t)uStack_10584._4_4_); local_7c = (int)uStack_10584._4_4_ + (int)pvVar12; *local_a8 = pvVar12; *local_98 = pvVar12; *local_88 = (int)uStack_10584._4_4_; *local_a4 = pvVar12; *local_94 = pvVar12; *local_84 = local_7c - (int)pvVar12; } local_78 = (uint)(uVar6 != 0); local_8._0_1_ = 0x10; std::basic_istream_>::operator>> ((basic_istream_> *)local_cc,(__uint64 *)&LStack_1056c ); if (LStack_1056c.s.LowPart != 0 || LStack_1056c.s.HighPart != 0) { pbVar18 = *(byte **)MVar20; pbVar10 = pbVar18 + 0x90; puVar1 = (uint *)(pbVar18 + 0xa0); if (0xf < *(uint *)(pbVar18 + 0xa4)) { pbVar10 = *(byte **)pbVar10; } puVar2 = (uint *)(pbVar18 + 0x10); if (0xf < *(uint *)(pbVar18 + 0x14)) { pbVar18 = *(byte **)pbVar18; } uVar6 = std::string::find(pbVar18,*puVar2,0,pbVar10,*puVar1); if (uVar6 != 0xffffffff) { puVar8 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c48c); uVar6 = (**(code **)(*(int *)*puVar8 + 0x130)) (LStack_1056c.s.LowPart,LStack_1056c.s.HighPart); if ((uVar6 & 1) == 0) { pbVar10 = *(byte **)MVar20; pbVar18 = g_modsDirectory; do { pbVar19 = pbVar18; pbVar18 = pbVar19 + 1; } while (*pbVar19 != 0); allocSource = (std_string *)(pbVar19 + -0xc72e28); puVar1 = (uint *)(pbVar10 + 0x10); if ((std_string *)(0x7fffffff - *puVar1) < allocSource) { LAB_008fc544: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } std::string::concat((char *)local_44c,(int)pMStack_10564,allocSource,g_modsDirectory, (uint)allocSource,pbVar10,*puVar1); uStack_1058c = (double)((ulonglong)uStack_1058c | 0x800000000); iVar11 = *(int *)MVar20; text = (void **)(iVar11 + 0x18); local_4e8 = 0; local_4e4 = 0xf; local_4f8[0] = (void *)0x0; local_4d0 = 0; local_4cc = 0xf; local_4e0[0] = (void *)0x0; local_4b8 = 0; local_4b4 = 0xf; local_4c8[0] = (void *)0x0; local_8._0_1_ = 0x12; if (local_4f8 != text) { if (0xf < *(uint *)(iVar11 + 0x2c)) { text = *text; } std::string::assign((char *)local_4f8,(byte *)text,*(uint *)(iVar11 + 0x28)); } pppppppbVar16 = (byte *******)local_44c; if (0xf < local_438) { pppppppbVar16 = local_44c[0]; } std::string::assign((char *)local_4e0,(byte *)pppppppbVar16,local_43c); pMVar14 = pMStack_10598; local_4fc = 2; local_4b0 = 0; if (pMStack_10598 == pMStack_10594) { std::vector<80byte>::_Emplace_reallocate(pMStack_10598,&local_4fc); } else { pMStack_10564 = pMStack_10598; *pMStack_10598 = (ModManager)0x2; std::string::string((char *)(pMStack_10598 + 1),local_4f8); local_8._0_1_ = 0x13; std::string::string((char *)(pMVar14 + 7),local_4e0); local_8._0_1_ = 0x14; std::string::string((char *)(pMVar14 + 0xd),local_4c8); *(undefined1 *)(pMVar14 + 0x13) = local_4b0; pMStack_10598 = pMStack_10598 + 0x14; } local_8._0_1_ = 0x11; if (0xf < local_4b4) { uVar6 = local_4b4 + 1; pvVar12 = local_4c8[0]; if (0xfff < uVar6) { pvVar12 = *(void **)((int)local_4c8[0] + -4); uVar6 = local_4b4 + 0x24; if (0x1f < (uint)((int)local_4c8[0] + (-4 - (int)pvVar12))) goto LAB_008fc14c; } operator_delete(pvVar12,uVar6); } if (0xf < local_4cc) { uVar6 = local_4cc + 1; pvVar12 = local_4e0[0]; if (0xfff < uVar6) { pvVar12 = *(void **)((int)local_4e0[0] + -4); uVar6 = local_4cc + 0x24; if (0x1f < (uint)((int)local_4e0[0] + (-4 - (int)pvVar12))) goto LAB_008fc14c; } operator_delete(pvVar12,uVar6); } if (0xf < local_4e4) { uVar6 = local_4e4 + 1; pvVar12 = local_4f8[0]; if (0xfff < uVar6) { pvVar12 = *(void **)((int)local_4f8[0] + -4); uVar6 = local_4e4 + 0x24; if (0x1f < (uint)((int)local_4f8[0] + (-4 - (int)pvVar12))) goto LAB_008fc14c; } operator_delete(pvVar12,uVar6); } local_8._0_1_ = 0x10; cStack_10559 = '\x01'; if (0xf < local_438) { uVar6 = local_438 + 1; pppppppbVar16 = local_44c[0]; if (0xfff < uVar6) { pppppppbVar16 = (byte *******)local_44c[0][-1]; uVar6 = local_438 + 0x24; if ((byte *)0x1f < (byte *)((int)local_44c[0] + (-4 - (int)pppppppbVar16))) goto LAB_008fc14c; } operator_delete(pppppppbVar16,uVar6); } } } } local_8._0_1_ = 0; *(undefined ***)((int)local_cc + *(int *)(local_cc[0] + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)(local_41c + *(int *)(local_cc[0] + 4) + 0x34c) = *(int *)(local_cc[0] + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>:: ~basic_iostream_>(local_ac); std::basic_ios_>::~basic_ios_> (local_64); MVar20 = (ModManager)((int)MVar20 + 4); } while (MVar20 != pMStack_10570[1]); } if (pMStack_1059c != pMStack_10598) { cVar4 = pMStack_10570[0x804f].field_0x1; *(undefined1 *)(pMStack_10570 + 0x8006) = 1; if (cVar4 == '\0') { this_00 = (ANM2 *)(pMStack_10570 + 0x800d); local_434._size = 0; local_434._capacity = 0xf; local_434._buf[0] = '\0'; local_434._buf[1] = '\0'; local_434._buf[2] = '\0'; local_434._buf[3] = '\0'; local_434._buf._0_4_ = std::_Allocate(0x20); local_434._size = 0x13; local_434._capacity = 0x1f; builtin_strncpy((char *)local_434._buf._0_4_,"gfx/ui/loading.anm2",0x14); local_8._0_1_ = 0x15; ANM2::Load(this_00,&local_434,1); local_8._0_1_ = 0; if (0xf < local_434._capacity) { uVar6 = local_434._capacity + 1; pcVar22 = (char *)local_434._buf._0_4_; if (0xfff < uVar6) { pcVar22 = *(char **)(local_434._buf._0_4_ + -4); uVar6 = local_434._capacity + 0x24; if ((char *)0x1f < (char *)(local_434._buf._0_4_ + (-4 - (int)pcVar22))) { LAB_008fc14c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar22,uVar6); } } Random(); sprintf_s(local_1c,8,s__d); pMVar14 = pMStack_10570; bVar5 = ANM2::SetAnimation((ANM2 *)(pMStack_10570 + 0x800d),local_1c,1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)(pMVar14 + 0x8019)); *(undefined1 *)(pMVar14 + 0x801e) = 1; } std::string::assign((char *)(pMVar14 + 0x8007),&s_empty,0); pMStack_10564 = pMVar14 + 0x8003; (**(code **)((int)pMVar14[0x8003] + 8))(UpdateWorkshopMods,4,0x1f9c0,&pMStack_1059c); pMVar21 = pMStack_10570; uVar24 = 0; uVar25 = 0; uStack_1058c = 0.0; puStack_10574 = (undefined4 *)0x0; pMVar14 = pMVar14 + 0x8003; if (cStack_10590 == '\0') { do { if (_glfw == 0) { _glfwInputError(0x10001,0); uStack_10584 = 0.0; } else { QueryPerformanceCounter(&LStack_1057c); FUN_00aefe20(); uStack_10584 = (double)CONCAT44(uVar25,uVar24); FUN_00aefe20(); uStack_10584 = uStack_10584 / (double)CONCAT44(uVar25,uVar24); } uStack_1058c = 1.0 / (uStack_10584 - uStack_1058c) + 0.5; floor(uStack_1058c); uVar17 = thunk_FUN_00af0780(); uVar24 = SUB84(uStack_10584,0); uVar25 = (undefined4)((ulonglong)uStack_10584 >> 0x20); uStack_1058c = uStack_10584; *(undefined4 *)&g_manager->field_0x4b12c = uVar17; piVar7 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar7 != 0) { SteamAPI_RunCallbacks(); } KAGE::System::update(); puStack_10574 = (undefined4 *)((int)puStack_10574 + 1); this_01 = extraout_ECX; if ((((uint)puStack_10574 & 1) == 0) && (pMVar21[0x804f].field_0x1 != '\0')) { AnimationState::Update((AnimationState *)(pMVar21 + 0x8019)); AnimationState::Update((AnimationState *)(pMVar21 + 0x8021)); this_01 = extraout_ECX_00; } Manager::Render(this_01); if ((g_graphicsManager_flags & 0x200) == 0) { if (_glfw == 0) { _glfwInputError(0x10001); dVar26 = 0.0; } else { QueryPerformanceCounter(&LStack_1056c); FUN_00aefe20(); dVar26 = (double)CONCAT44(uVar25,uVar24); FUN_00aefe20(); dVar26 = dVar26 / (double)CONCAT44(uVar25,uVar24); } dVar26 = (0.016666666666666666 - (dVar26 - uStack_10584)) * -1000.0; uVar6 = ~(int)dVar26; dwMilliseconds = 0; if (uVar6 != 0 && (int)dVar26 < 0) { dwMilliseconds = uVar6; } if (dwMilliseconds != 0) { Sleep(dwMilliseconds); } do { if (_glfw == 0) { _glfwInputError(); dVar27 = 0.0; } else { QueryPerformanceCounter(&LStack_105a8); FUN_00aefe20(); dVar27 = dVar26; FUN_00aefe20(); dVar27 = dVar26 / dVar27; } uVar24 = 0x11111111; uVar25 = 0x3f911111; dVar26 = 0.016666666666666666; } while (dVar27 - uStack_10584 < 0.016666666666666666); } } while (cStack_10590 == '\0'); pMVar14 = pMStack_10564; } (**(code **)((int)*pMVar14 + 0xc))(); *(undefined1 *)(pMStack_10570 + 0x8006) = 0; } if (pvStack_105a0 != (void *)0x0) { local_8._0_1_ = 0x16; tracked_alloc(1,pvStack_105a0,0); local_8._0_1_ = 0; } if (cStack_10559 != '\0') { Reset(pMStack_10570); } pMVar14 = pMStack_10598; if (pMStack_1059c != (ModManager *)0x0) { if (pMStack_1059c != pMStack_10598) { pMVar21 = pMStack_1059c + 7; do { std::string::_Tidy_deallocate((char *)(pMVar21 + 6)); std::string::_Tidy_deallocate((char *)pMVar21); std::string::_Tidy_deallocate((char *)(pMVar21 + -6)); pMVar3 = pMVar21 + 0xd; pMVar21 = pMVar21 + 0x14; } while (pMVar3 != pMVar14); } deallocate(pMStack_1059c,((int)pMStack_10594 - (int)pMStack_1059c) / 0x50); } } ExceptionList = local_10; return; } //@@ 008fc570 FUN_008fc570 void FUN_008fc570(void) { void *ptr; undefined4 *in_ECX; int iVar1; iVar1 = 0x8000; do { ptr = (void *)*in_ECX; if (ptr != (void *)0x0) { std::string::_Tidy_deallocate((char *)((int)ptr + 0xc)); operator_delete(ptr,0x24); *in_ECX = 0; } in_ECX = in_ECX + 1; iVar1 = iVar1 + -1; } while (iVar1 != 0); return; } //@@ 008fc5b0 FUN_008fc5b0 void FUN_008fc5b0(undefined4 *param_1) { undefined4 *puVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07e2b; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<80byte>::_Emplace_reallocate(puVar1,param_1); ExceptionList = local_10; return; } *puVar1 = *param_1; std::string::string((char *)(puVar1 + 1),param_1 + 1); local_8 = 0; std::string::string((char *)(puVar1 + 7),param_1 + 7); local_8 = CONCAT31(local_8._1_3_,1); std::string::string((char *)(puVar1 + 0xd),param_1 + 0xd); *(undefined1 *)(puVar1 + 0x13) = *(undefined1 *)(param_1 + 0x13); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x50; ExceptionList = local_10; return; } //@@ 008fc660 FUN_008fc660 void FUN_008fc660(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_008fcc50(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x50) * 0x50; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 008fc6e0 FUN_008fc6e0 int FUN_008fc6e0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::_Try_emplace(local_10,param_1); return *piVar1 + 0x28; } //@@ 008fc700 FUN_008fc700 void FUN_008fc700(void) { FUN_008fcc50(); return; } //@@ 008fc720 deallocate /* Library Function - Multiple Matches With Same Base Name public: void __thiscall std::allocator::deallocate(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int) public: void __thiscall std::allocator::deallocate(struct GSISymbolEntry * const,unsigned int) Library: Visual Studio 2019 Release prototype: db/protos.zhl, confirmed by RET 8 */ void deallocate(void *ptr,uint count) { void *ptr_00; uint size; size = count * 0x50; ptr_00 = ptr; if (0xfff < size) { ptr_00 = *(void **)((int)ptr + -4); size = size + 0x23; if (0x1f < (uint)((int)ptr + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); return; } //@@ 008fc760 FUN_008fc760 void FUN_008fc760(void) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; uVar1 = *in_ECX; lua_rawgeti(uVar1,0xfff0b9d8,in_ECX[1],(int)in_ECX[1] >> 0x1f); lua_rawgeti(uVar1,0xfff0b9d8,in_ECX[2],(int)in_ECX[2] >> 0x1f); lua_gettable(uVar1,0xfffffffe); lua_rotate(uVar1,0xfffffffe,0xffffffff); lua_settop(uVar1,0xfffffffe); uVar2 = lua_gettop(*in_ECX); luaL_checknumber(*in_ECX,uVar2); lua_settop(uVar1,0xfffffffe); return; } //@@ 008fc7e0 std::vector<80byte>::_Emplace_reallocate /* DB: vector grow (max 0x3333333 = 2^32/80) of 0x50-byte records; from ModManager::UpdateWorkshopMods when the vector is full */ undefined4 * std::vector<80byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { void *pvVar1; int iVar2; undefined4 *puVar3; int *in_ECX; uint uVar4; uint uVar5; undefined4 *puVar6; void *ptr; undefined4 *puVar7; int iVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07e6b; local_10 = ExceptionList; ExceptionList = &local_10; iVar8 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0x50; if (iVar2 == 0x3333333) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = (in_ECX[2] - *in_ECX) / 0x50; if (0x3333333 - (uVar5 >> 1) < uVar5) { uVar4 = 0x3333333; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar4 = iVar2 + 1U; if (iVar2 + 1U <= uVar5) { uVar4 = uVar5; } if (0x3333333 < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar3 = _Allocate(uVar4 * 0x50); puVar6 = puVar3 + ((param_1 - iVar8) / 0x50) * 0x14; local_8 = 0; *puVar6 = *param_2; string::string((char *)(puVar6 + 1),param_2 + 1); local_8._0_1_ = 1; string::string((char *)(puVar6 + 7),param_2 + 7); local_8 = CONCAT31(local_8._1_3_,2); string::string((char *)(puVar6 + 0xd),param_2 + 0xd); *(undefined1 *)(puVar6 + 0x13) = *(undefined1 *)(param_2 + 0x13); iVar8 = *in_ECX; puVar7 = puVar3; if (param_1 != in_ECX[1]) { FUN_008fcf20(puVar3,iVar8); puVar7 = puVar6 + 0x14; } FUN_008fcf20(puVar7,iVar8); if (*in_ECX != 0) { FUN_008fcc50(*in_ECX); pvVar1 = (void *)*in_ECX; uVar5 = ((in_ECX[2] - (int)pvVar1) / 0x50) * 0x50; ptr = pvVar1; if (0xfff < uVar5) { ptr = *(void **)((int)pvVar1 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } *in_ECX = (int)puVar3; in_ECX[1] = (int)(puVar3 + (iVar2 + 1) * 0x14); in_ECX[2] = (int)(puVar3 + uVar4 * 0x14); ExceptionList = local_10; return puVar6; } //@@ 008fc9bd Catch_All@008fc9bd void Catch_All_008fc9bd(void) { int unaff_EBP; FUN_008fc700(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x24)); deallocate(*(void **)(unaff_EBP + -0x28),*(uint *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 008fc9f0 std::map::_Try_emplace /* DB: ? key-string lower-bound then operator_new(0x2c) node with 4-byte value at +0x28 zeroed (max_size 0x5d1745d); FUN_008fc6e0 returns node+0x28 (operator[]), used by ModManager::LoadShaders; separate instantiation from 0069e0c0 std::map::_Try_emplace void std::map::_Try_emplace(undefined4 *param_1,byte *param_2) { char cVar1; int *piVar2; undefined4 *puVar3; uint uVar4; byte *pbVar5; uint uVar6; byte *pbVar7; int iVar8; undefined4 *puVar9; undefined4 *in_ECX; undefined4 *puVar10; int *piVar11; undefined4 *puVar12; uint local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07ea5; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar2 = (int *)*in_ECX; local_1c = 0; local_18 = (int *)piVar2[1]; local_14 = piVar2; if (*(char *)((int)local_18 + 0xd) == '\0') { piVar11 = local_18; do { local_18 = piVar11; pbVar7 = (byte *)(local_18 + 4); pbVar5 = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { pbVar5 = *(byte **)param_2; } if (0xf < (uint)local_18[9]) { pbVar7 = *(byte **)pbVar7; } uVar6 = string_compare(pbVar7,local_18[8],pbVar5,*(uint *)(param_2 + 0x10)); if ((int)uVar6 < 0) { piVar11 = (int *)local_18[2]; } else { piVar11 = (int *)*local_18; local_14 = local_18; } local_1c = uVar6 >> 0x1f ^ 1; } while (*(char *)((int)piVar11 + 0xd) == '\0'); } if (*(char *)((int)local_14 + 0xd) == '\0') { pbVar7 = (byte *)(local_14 + 4); if (0xf < (uint)local_14[9]) { pbVar7 = *(byte **)pbVar7; } pbVar5 = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { pbVar5 = *(byte **)param_2; } iVar8 = string_compare(pbVar5,*(uint *)(param_2 + 0x10),pbVar7,local_14[8]); if (-1 < iVar8) { *param_1 = local_14; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } local_8 = 0; puVar9 = operator_new(0x2c); local_8 = 1; string::string((char *)(puVar9 + 4),param_2); puVar9[10] = 0; *puVar9 = piVar2; puVar9[1] = piVar2; puVar9[2] = piVar2; *(undefined2 *)(puVar9 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; puVar9[1] = local_18; if (local_18 == piVar2) { *piVar2 = (int)puVar9; piVar2[1] = (int)puVar9; piVar2[2] = (int)puVar9; *(undefined1 *)(puVar9 + 3) = 1; } else { if (local_1c == 0) { local_18[2] = (int)puVar9; if (local_18 == (int *)piVar2[2]) { piVar2[2] = (int)puVar9; } } else { *local_18 = (int)puVar9; if (local_18 == (int *)*piVar2) { *piVar2 = (int)puVar9; } } cVar1 = *(char *)(puVar9[1] + 0xc); puVar12 = puVar9; while (cVar1 == '\0') { puVar3 = (undefined4 *)puVar12[1]; puVar10 = *(undefined4 **)puVar3[1]; if (puVar3 == puVar10) { puVar10 = (undefined4 *)((undefined4 *)puVar3[1])[2]; if (*(char *)(puVar10 + 3) == '\0') goto LAB_008fcbcf; if (puVar12 == (undefined4 *)puVar3[2]) { FUN_00415fe0(puVar3); puVar12 = puVar3; } *(undefined1 *)(puVar12[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar12[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar12[1] + 4)); } else if (*(char *)(puVar10 + 3) == '\0') { LAB_008fcbcf: *(undefined1 *)(puVar3 + 3) = 1; *(undefined1 *)(puVar10 + 3) = 1; *(undefined1 *)(*(int *)(puVar12[1] + 4) + 0xc) = 0; puVar12 = *(undefined4 **)(puVar12[1] + 4); } else { if (puVar12 == (undefined4 *)*puVar3) { FUN_00415f80(puVar3); puVar12 = puVar3; } *(undefined1 *)(puVar12[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar12[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar12[1] + 4)); } cVar1 = *(char *)(puVar12[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *param_1 = puVar9; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 008fcc50 FUN_008fcc50 void FUN_008fcc50(void) { char *pcVar1; char *in_ECX; char *in_EDX; char *this; if (in_ECX != in_EDX) { this = in_ECX + 0x1c; do { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); std::string::_Tidy_deallocate(this + -0x18); pcVar1 = this + 0x34; this = this + 0x50; } while (pcVar1 != in_EDX); } return; } //@@ 008fcc90 std::_Sort_unchecked /* DB: MSVC introsort on 4-byte elements with predicate: recursion on itself, heap-sort fallback when ideal<=0 (sift loops), insertion sort below 32 elements (0x80 bytes); caller ModManager::ListMods (008f7080) */ void std::_Sort_unchecked(int param_1,code *param_2) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; uint uVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 *local_24; undefined4 *local_1c; undefined4 *local_14; undefined4 *local_10; undefined4 *local_c; local_24 = in_EDX; local_14 = in_ECX; if (0x80 < (int)((int)in_EDX - (int)in_ECX & 0xfffffffcU)) { do { if (param_1 < 1) { uVar6 = (int)in_EDX - (int)in_ECX; uVar3 = (int)uVar6 >> 2; puVar5 = (undefined4 *)((int)uVar6 >> 3); if (0 < (int)puVar5) { local_10 = (undefined4 *)(uVar3 - 1); puVar4 = (undefined4 *)((int)local_10 >> 1); do { uVar1 = in_ECX[(int)puVar5 + -1]; puVar5 = (undefined4 *)((int)puVar5 + -1); puVar8 = puVar5; puVar7 = puVar5; if ((int)puVar5 < (int)puVar4) { do { puVar7 = (undefined4 *)((int)puVar8 * 2 + 2); cVar2 = (*param_2)(in_ECX[(int)puVar7],in_ECX[(int)puVar8 * 2 + 1]); if (cVar2 != '\0') { puVar7 = (undefined4 *)((int)puVar8 * 2 + 1); } in_ECX[(int)puVar8] = in_ECX[(int)puVar7]; puVar8 = puVar7; } while ((int)puVar7 < (int)puVar4); } if ((puVar7 == puVar4) && ((uVar3 & 1) == 0)) { in_ECX[(int)puVar7] = in_ECX[uVar3 - 1]; puVar7 = local_10; } while ((int)puVar5 < (int)puVar7) { puVar8 = (undefined4 *)((int)puVar7 + -1 >> 1); cVar2 = (*param_2)(in_ECX[(int)puVar8],uVar1); if (cVar2 == '\0') break; in_ECX[(int)puVar7] = in_ECX[(int)puVar8]; puVar7 = puVar8; } in_ECX[(int)puVar7] = uVar1; } while (0 < (int)puVar5); } if ((int)uVar3 < 2) { return; } do { local_10 = *(undefined4 **)((int)in_ECX + (uVar6 - 4)); *(undefined4 *)((int)in_ECX + (uVar6 - 4)) = *in_ECX; FUN_008fd290((int)(uVar6 - 4) >> 2,&local_10,param_2); uVar6 = uVar6 - 4; } while (7 < (int)(uVar6 & 0xfffffffc)); return; } _Partition_by_median_guess_unchecked<4byte>(in_EDX,param_2); param_1 = (param_1 >> 1) + (param_1 >> 2); if ((int)((int)local_10 - (int)in_ECX & 0xfffffffcU) < (int)((int)in_EDX - (int)local_c & 0xfffffffcU)) { _Sort_unchecked(param_1,param_2); local_14 = local_c; in_ECX = local_c; } else { _Sort_unchecked(param_1,param_2); local_24 = local_10; in_EDX = local_10; } } while (0x80 < (int)((int)in_EDX - (int)in_ECX & 0xfffffffcU)); } puVar5 = in_ECX; if (in_ECX != in_EDX) { while (puVar4 = puVar5 + 1, puVar4 != local_24) { uVar1 = *puVar4; cVar2 = (*param_2)(uVar1,*in_ECX); if (cVar2 == '\0') { cVar2 = (*param_2)(uVar1,*puVar5); local_1c = puVar4; if (cVar2 != '\0') { puVar5 = puVar4; do { local_1c = puVar5 + -1; *puVar5 = *local_1c; cVar2 = (*param_2)(uVar1,puVar5[-2]); puVar5 = local_1c; } while (cVar2 != '\0'); in_ECX = local_14; } *local_1c = uVar1; puVar5 = puVar4; } else { memmove((void *)((int)puVar4 + (4 - ((int)puVar4 - (int)in_ECX))),in_ECX, (int)puVar4 - (int)in_ECX); *in_ECX = uVar1; puVar5 = puVar4; } } } return; } //@@ 008fcf20 FUN_008fcf20 undefined4 * FUN_008fcf20(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *puVar5; undefined4 *in_EDX; undefined4 *puVar6; undefined8 *puVar7; undefined4 *puVar8; puVar5 = in_ECX; puVar8 = param_1; if (in_ECX != in_EDX) { puVar6 = in_ECX + 6; puVar7 = (undefined8 *)(param_1 + 0xb); do { *puVar8 = puVar6[-6]; *(undefined4 *)(puVar7 + -5) = 0; puVar8 = puVar8 + 0x14; *(undefined4 *)(puVar7 + -3) = 0; *(undefined4 *)((int)param_1 + (-0x50 - (int)in_ECX) + (int)(puVar6 + 0x14)) = 0; uVar2 = puVar6[-4]; uVar3 = puVar6[-3]; uVar4 = puVar6[-2]; *(undefined4 *)(puVar7 + -5) = puVar6[-5]; *(undefined4 *)((int)puVar7 + -0x24) = uVar2; *(undefined4 *)(puVar7 + -4) = uVar3; *(undefined4 *)((int)puVar7 + -0x1c) = uVar4; puVar7[-3] = *(undefined8 *)(puVar6 + -1); puVar6[-1] = 0; *puVar6 = 0xf; *(undefined1 *)(puVar6 + -5) = 0; *(undefined4 *)(puVar7 + -2) = 0; *(undefined4 *)puVar7 = 0; *(undefined4 *)((int)puVar7 + 4) = 0; uVar2 = puVar6[2]; uVar3 = puVar6[3]; uVar4 = puVar6[4]; *(undefined4 *)(puVar7 + -2) = puVar6[1]; *(undefined4 *)((int)puVar7 + -0xc) = uVar2; *(undefined4 *)(puVar7 + -1) = uVar3; *(undefined4 *)((int)puVar7 + -4) = uVar4; *puVar7 = *(undefined8 *)(puVar6 + 5); puVar6[5] = 0; puVar6[6] = 0xf; *(undefined1 *)(puVar6 + 1) = 0; *(undefined4 *)(puVar7 + 1) = 0; *(undefined4 *)(puVar7 + 3) = 0; *(undefined4 *)((int)puVar7 + 0x1c) = 0; uVar2 = puVar6[8]; uVar3 = puVar6[9]; uVar4 = puVar6[10]; *(undefined4 *)(puVar7 + 1) = puVar6[7]; *(undefined4 *)((int)puVar7 + 0xc) = uVar2; *(undefined4 *)(puVar7 + 2) = uVar3; *(undefined4 *)((int)puVar7 + 0x14) = uVar4; puVar7[3] = *(undefined8 *)(puVar6 + 0xb); puVar6[0xb] = 0; puVar6[0xc] = 0xf; *(undefined1 *)(puVar6 + 7) = 0; *(undefined1 *)(puVar7 + 4) = *(undefined1 *)(puVar6 + 0xd); puVar1 = puVar6 + 0xe; puVar5 = in_EDX; puVar6 = puVar6 + 0x14; puVar7 = puVar7 + 10; } while (puVar1 != in_EDX); } FUN_008fcc50(puVar5); return puVar8; } //@@ 008fd030 std::_Partition_by_median_guess_unchecked<4byte> /* DB: MSVC std::sort partition: Tukey ninther when count > 40 (0x28) via FUN_008fd340 (_Med3), then fat partition; callers std::_Sort_unchecked 0x92cbe0 and 0x8fcc90 */ void std::_Partition_by_median_guess_unchecked<4byte>(undefined4 *param_1,code *param_2) { undefined4 *puVar1; undefined4 uVar2; char cVar3; int iVar4; undefined4 *in_ECX; undefined4 *puVar5; undefined4 *in_EDX; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 *local_14; undefined4 *local_10; undefined4 *local_8; puVar5 = param_1 + -1; puVar6 = in_EDX + ((int)param_1 - (int)in_EDX >> 3); iVar4 = (int)puVar5 - (int)in_EDX >> 2; if (0x28 < iVar4) { iVar4 = iVar4 + 1 >> 3; FUN_008fd340(in_EDX + iVar4 * 2,param_2); FUN_008fd340(puVar6 + iVar4,param_2); FUN_008fd340(puVar5,param_2); puVar5 = puVar5 + -iVar4; } FUN_008fd340(puVar5,param_2); local_8 = puVar6 + 1; do { puVar5 = puVar6; if (puVar5 <= in_EDX) break; puVar6 = puVar5 + -1; cVar3 = (*param_2)(*puVar6,*puVar5); if (cVar3 != '\0') break; cVar3 = (*param_2)(*puVar5,*puVar6); } while (cVar3 == '\0'); if (local_8 < param_1) { do { cVar3 = (*param_2)(*local_8,*puVar5); if ((cVar3 != '\0') || (cVar3 = (*param_2)(*puVar5,*local_8), cVar3 != '\0')) break; local_8 = local_8 + 1; } while (local_8 < param_1); } puVar6 = local_8; puVar7 = puVar5; puVar8 = local_8; LAB_008fd144: local_10 = puVar5; do { local_14 = puVar8; LAB_008fd150: if (puVar8 < param_1) { do { cVar3 = (*param_2)(*puVar7,*puVar8); if (cVar3 == '\0') { cVar3 = (*param_2)(*puVar8,*puVar7); if (cVar3 != '\0') break; if (puVar6 != puVar8) { uVar2 = *puVar6; *puVar6 = *puVar8; *puVar8 = uVar2; } puVar6 = puVar6 + 1; } puVar8 = puVar8 + 1; } while (puVar8 < param_1); puVar5 = local_10; local_14 = puVar8; local_8 = puVar6; } if (in_EDX < puVar5) { puVar6 = local_10; do { puVar6 = puVar6 + -1; cVar3 = (*param_2)(*puVar6,*puVar7); if (cVar3 == '\0') { cVar3 = (*param_2)(*puVar7,*puVar6); puVar5 = local_10; if (cVar3 != '\0') break; puVar7 = puVar7 + -1; if (puVar7 != puVar6) { uVar2 = *puVar7; *puVar7 = *puVar6; *puVar6 = uVar2; } } local_10 = local_10 + -1; puVar5 = local_10; } while (in_EDX < local_10); puVar6 = local_8; puVar8 = local_14; local_10 = puVar5; } if (puVar5 != in_EDX) { puVar5 = puVar5 + -1; if (puVar8 != param_1) { uVar2 = *puVar8; *puVar8 = *puVar5; puVar8 = puVar8 + 1; *puVar5 = uVar2; goto LAB_008fd144; } puVar7 = puVar7 + -1; local_10 = puVar5; if (puVar5 == puVar7) { puVar1 = puVar6 + -1; puVar6 = puVar6 + -1; uVar2 = *puVar7; *puVar7 = *puVar1; *puVar6 = uVar2; local_8 = puVar6; } else { puVar6 = puVar6 + -1; uVar2 = *puVar5; *puVar5 = *puVar7; *puVar7 = uVar2; *puVar7 = *puVar6; *puVar6 = uVar2; local_8 = puVar6; } goto LAB_008fd150; } if (puVar8 == param_1) { *in_ECX = puVar7; in_ECX[1] = puVar6; return; } if (puVar6 != puVar8) { uVar2 = *puVar7; *puVar7 = *puVar6; *puVar6 = uVar2; } puVar6 = puVar6 + 1; uVar2 = *puVar7; *puVar7 = *puVar8; puVar7 = puVar7 + 1; *puVar8 = uVar2; puVar8 = puVar8 + 1; local_8 = puVar6; } while( true ); } //@@ 008fd290 FUN_008fd290 void FUN_008fd290(uint param_1,undefined4 *param_2,code *param_3) { char cVar1; int iVar2; int in_ECX; int in_EDX; int iVar3; int iVar4; iVar2 = (int)(param_1 - 1) >> 1; iVar4 = in_EDX; iVar3 = in_EDX; if (in_EDX < iVar2) { do { iVar3 = iVar4 * 2 + 2; cVar1 = (*param_3)(*(undefined4 *)(in_ECX + iVar3 * 4),*(undefined4 *)(in_ECX + 4 + iVar4 * 8) ); if (cVar1 != '\0') { iVar3 = iVar4 * 2 + 1; } *(undefined4 *)(in_ECX + iVar4 * 4) = *(undefined4 *)(in_ECX + iVar3 * 4); iVar4 = iVar3; } while (iVar3 < iVar2); } if ((iVar3 == iVar2) && ((param_1 & 1) == 0)) { *(undefined4 *)(in_ECX + iVar3 * 4) = *(undefined4 *)(in_ECX + -4 + param_1 * 4); iVar3 = param_1 - 1; } while (in_EDX < iVar3) { iVar4 = iVar3 + -1 >> 1; cVar1 = (*param_3)(*(undefined4 *)(in_ECX + iVar4 * 4),*param_2); if (cVar1 == '\0') break; *(undefined4 *)(in_ECX + iVar3 * 4) = *(undefined4 *)(in_ECX + iVar4 * 4); iVar3 = iVar4; } *(undefined4 *)(in_ECX + iVar3 * 4) = *param_2; return; } //@@ 008fd340 FUN_008fd340 void FUN_008fd340(undefined4 *param_1,code *param_2) { undefined4 uVar1; char cVar2; undefined4 *in_ECX; undefined4 *in_EDX; cVar2 = (*param_2)(*in_EDX,*in_ECX); if (cVar2 != '\0') { uVar1 = *in_EDX; *in_EDX = *in_ECX; *in_ECX = uVar1; } cVar2 = (*param_2)(*param_1,*in_EDX); if (cVar2 != '\0') { uVar1 = *param_1; *param_1 = *in_EDX; *in_EDX = uVar1; cVar2 = (*param_2)(uVar1,*in_ECX); if (cVar2 != '\0') { uVar1 = *in_EDX; *in_EDX = *in_ECX; *in_ECX = uVar1; } } return; } //@@ 008fd3a0 FUN_008fd3a0 void FUN_008fd3a0(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("STEAMUGC_INTERFACE_VERSION020"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 008fd3c0 MTRNG::Init /* ZHL [exact] __thiscall void MTRNG::Init(uint32_t seed); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall MTRNG::Init(MTRNG *this,uint seed) { MTRNG MVar1; *this = (MTRNG)seed; this[0x270] = (MTRNG)0x1; do { MVar1 = this[0x270]; this[(int)MVar1] = (MTRNG)(((uint)this[(int)MVar1 + -1] >> 0x1e ^ (uint)this[(int)MVar1 + -1]) * 0x6c078965 + (int)MVar1); this[0x270] = (MTRNG)((int)this[0x270] + 1); } while ((int)this[0x270] < 0x270); return; } //@@ 008fd410 MTRNG::Next /* ZHL [exact] __thiscall uint32_t MTRNG::Next(); prototype: REPENTOGON, confirmed by RET 0 */ uint __thiscall MTRNG::Next(MTRNG *this) { MTRNG MVar1; MTRNG MVar2; uint uVar3; int iVar4; MVar2 = this[0x270]; if (0x26f < (int)MVar2) { if (MVar2 == (MTRNG)0x271) { Init(this,0x1571); } iVar4 = 0; do { uVar3 = ((uint)this[iVar4 + 1] ^ (uint)this[iVar4]) & 0x7fffffff ^ (uint)this[iVar4]; this[iVar4] = (MTRNG)(uVar3 >> 1 ^ (uint)(&PTR_00b67f8c)[uVar3 & 1] ^ (uint)this[iVar4 + 0x18d]); iVar4 = iVar4 + 1; } while (iVar4 < 0xe3); do { uVar3 = ((uint)this[iVar4 + 1] ^ (uint)this[iVar4]) & 0x7fffffff ^ (uint)this[iVar4]; this[iVar4] = (MTRNG)(uVar3 >> 1 ^ (uint)(&PTR_00b67f8c)[uVar3 & 1] ^ (uint)this[iVar4 + -0xe3]); iVar4 = iVar4 + 1; } while (iVar4 < 0x26f); uVar3 = ((uint)*this ^ (uint)this[0x26f]) & 0x7fffffff ^ (uint)this[0x26f]; this[0x26f] = (MTRNG)((uint)(&PTR_00b67f8c)[uVar3 & 1] ^ (uint)this[0x18c] ^ uVar3 >> 1); MVar2 = (MTRNG)0x0; this[0x270] = (MTRNG)0x0; } MVar1 = this[(int)MVar2]; this[0x270] = (MTRNG)((int)MVar2 + 1); uVar3 = (uint)MVar1 ^ (uint)MVar1 >> 0xb; uVar3 = uVar3 ^ (uVar3 & 0xff3a58ad) << 7; uVar3 = uVar3 ^ (uVar3 & 0xffffdf8c) << 0xf; return uVar3 >> 0x12 ^ uVar3; } //@@ 008fd510 FUN_008fd510 void FUN_008fd510(void) { undefined4 *this; int in_ECX; this = (undefined4 *)(in_ECX + 4); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 4) + 4)); operator_delete((void *)*this,0x20); return; } //@@ 008fd530 NetplayManager::process_consolidated_messages /* DB: ? loop over NetworkManager::receive_message(4) while g_multiplayerService exists, "This function should only be called on consolidated messages", dispatches per message type; returns char checked by NetplayManager::Update before try_advance_frame */ char NetplayManager::process_consolidated_messages(void) { int iVar1; NetplayManager NVar2; char *pcVar3; undefined4 *puVar4; undefined4 uVar5; char cVar6; int *piVar7; byte *pbVar8; char *in_ECX; NetplayManager NVar9; undefined1 local_54 [8]; int local_4c; undefined4 local_48; uint local_44; undefined4 *local_40; int *local_3c; undefined4 local_38; int *piStack_34; undefined4 local_30; uint local_2c; char *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_54 + 0x50; puStack_18 = &LAB_00b07edd; local_1c = ExceptionList; ExceptionList = &local_1c; local_24 = in_ECX; while (local_14 = 0xffffffff, g_multiplayerService != (void *)0x0) { piVar7 = NetworkManager::receive_message(g_multiplayerService,&local_38,4,0); iVar1 = *piVar7; local_14 = 0; if (((piStack_34 != (int *)0x0) && (cVar6 = (**(code **)(*piStack_34 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_38); } local_14 = 0xffffffff; if (iVar1 == 0) break; if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_40,4,1); } puVar4 = local_40; local_14 = 1; if (local_40[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } if (*(int *)(*(int *)(*(int *)puVar4[2] + 0x14) + 8) == 0) { local_30 = *local_40; local_2c = local_40[1]; pbVar8 = map_u64_bool_subscript(in_ECX + 4,(ulonglong *)&local_30); *pbVar8 = 1; } local_14 = 2; if (((local_3c != (int *)0x0) && (cVar6 = (**(code **)(*local_3c + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_40); } } local_14 = 0xffffffff; if (*in_ECX != '\0') { NVar9 = g_manager->_netplayManager; NVar2 = *(NetplayManager *)(g_manager + 1); if (NVar9 != NVar2) { local_3c = (int *)(local_24 + 4); do { iVar1 = *(int *)(*(int *)NVar9 + 0x374); if (iVar1 == 0) { local_38 = 0; uVar5 = local_38; piStack_34 = (int *)0x0; local_38 = 0; local_44 = (uint)piStack_34; local_48 = local_38; local_38 = uVar5; } else { local_44 = *(uint *)(iVar1 + 0xc); local_48 = *(undefined4 *)(iVar1 + 8); } _local_38 = CONCAT44(local_48,local_38); local_2c = local_44; FUN_00731ee0(local_54,&local_48); if (((*(char *)(local_4c + 0xd) != '\0') || (local_2c < *(uint *)(local_4c + 0x14))) || (((local_2c <= *(uint *)(local_4c + 0x14) && (piStack_34 < *(uint *)(local_4c + 0x10))) || (local_4c == *local_3c)))) { ExceptionList = local_1c; return '\x01'; } NVar9 = (NetplayManager)((int)NVar9 + 4); } while (NVar9 != NVar2); } pcVar3 = local_24; piVar7 = (int *)(local_24 + 4); *local_24 = '\0'; iVar1 = *piVar7; FID_conflict__Erase_tree_>_> (piVar7,(fuzzer_allocator_> *)piVar7, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; pcVar3[8] = '\0'; pcVar3[9] = '\0'; pcVar3[10] = '\0'; pcVar3[0xb] = '\0'; in_ECX = local_24; } ExceptionList = local_1c; return *in_ECX; } //@@ 008fd750 FUN_008fd750 void FUN_008fd750(void) { int *this; int iVar1; char *in_ECX; if (*in_ECX == '\0') { this = (int *)(in_ECX + 4); *in_ECX = '\0'; in_ECX[0xc] = '\0'; iVar1 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; in_ECX[8] = '\0'; in_ECX[9] = '\0'; in_ECX[10] = '\0'; in_ECX[0xb] = '\0'; *in_ECX = '\x01'; in_ECX[0xc] = '\0'; return; } KAGE_LogMessage(4,(byte *) "Attempting to enter network asynchronous section while one is already active.\n" ); return; } //@@ 008fd7a0 map_u64_bool_subscript /* DB: std::map::operator[]: lower_bound by 64-bit key (FUN_00731ee0), inserts a 0x20-byte node with value byte 0 if missing, returns &value; used with user ids by online_chat_update, PauseScreen::Update, NetworkManager::receive_message prototype: db/protos.zhl, confirmed by RET 4 */ byte * __thiscall map_u64_bool_subscript(void *this,ulonglong *key) { undefined4 uVar1; ulonglong uVar2; uint uVar3; undefined4 *newNode; void *local_24; int local_20; void *local_1c; void *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07f0d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_24,key); if (*(char *)((int)local_1c + 0xd) == '\0') { if ((*(uint *)((int)local_1c + 0x14) <= *(uint *)((int)key + 4)) && ((*(uint *)((int)local_1c + 0x14) < *(uint *)((int)key + 4) || (*(uint *)((int)local_1c + 0x10) <= (uint)*key)))) goto LAB_008fd846; } if (*(int *)((int)this + 4) == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } uVar1 = *(undefined4 *)this; local_8 = 0; local_14 = 0; local_18 = this; newNode = operator_new(0x20); uVar2 = *key; newNode[5] = *(undefined4 *)((int)key + 4); newNode[4] = (int)uVar2; *(undefined1 *)(newNode + 6) = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(this,local_24,local_20,newNode); LAB_008fd846: ExceptionList = local_10; return (byte *)((int)local_1c + 0x18); } //@@ 008fd870 FUN_008fd870 void FUN_008fd870(int *param_1,uint *param_2) { int *in_ECX; undefined1 local_10 [8]; int local_8; FUN_00731ee0(local_10,param_2); if (*(char *)(local_8 + 0xd) == '\0') { if ((*(uint *)(local_8 + 0x14) <= param_2[1]) && ((*(uint *)(local_8 + 0x14) < param_2[1] || (*(uint *)(local_8 + 0x10) <= *param_2)))) { *param_1 = local_8; return; } } *param_1 = *in_ECX; return; } //@@ 008fd8c0 FUN_008fd8c0 void FUN_008fd8c0(void) { FUN_00900940(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); return; } //@@ 008fd900 NetDesyncHandler::Update /* DB: "NetDesyncHandler::process_desync_confirm_message() could not find...", "Desync Handler creating new lobby", "Finalizing resync!"; state machine on *this; from NetplayManager::Update */ void NetDesyncHandler::Update(void) { NetplayManager *pNVar1; int iVar2; undefined4 *puVar3; float fVar4; undefined4 uVar5; char cVar6; int iVar7; NetplayManager *pNVar8; Entity_Player *pEVar9; NetplayManager NVar10; NetplayManager in_ECX; uint uVar11; uint uVar12; char *format; undefined4 uVar13; Manager *pMVar14; int *piVar15; uint uVar16; NetplayManager NVar17; void *pvVar18; undefined1 *puVar19; void *messageRefCount; int *piVar20; undefined1 auStack_7a [2]; undefined4 uStack_6c; int iStack_68; undefined1 uStack_64; undefined8 local_60; undefined4 uStack_58; NetplayManager NStack_54; undefined8 local_50; int *local_48; NetplayManager local_44; undefined4 uStack_40; NetplayManager local_3c; undefined8 uStack_38; float *local_30; int *local_2c; NetplayManager local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = auStack_7a + 0x76; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b07f45; local_1c = ExceptionList; ExceptionList = &local_1c; local_24 = 0; local_28 = in_ECX; receive_messages(); iVar7 = *(int *)in_ECX; if (iVar7 != 1) { if (iVar7 == 2) { local_2c = *(int **)((int)in_ECX + 0x10); local_44 = (NetplayManager)0x0; uVar11 = *(int *)((int)in_ECX + 0x14) - (int)local_2c >> 3; _uStack_40 = CONCAT44(uVar11,uStack_40); if (uVar11 != 0) { local_48 = (int *)(*(int *)((int)in_ECX + 0x20) - *(int *)((int)in_ECX + 0x1c) >> 3); do { piVar20 = (int *)0x0; if (local_48 == (int *)0x0) { ExceptionList = local_1c; return; } piVar15 = *(int **)((int)in_ECX + 0x1c); while ((*piVar15 != *local_2c || (piVar15[1] != local_2c[1]))) { piVar20 = (int *)((int)piVar20 + 1); piVar15 = piVar15 + 2; if (local_48 <= piVar20) { ExceptionList = local_1c; return; } } local_44 = (NetplayManager)((int)local_44 + 1); local_2c = local_2c + 2; in_ECX = local_28; } while ((uint)local_44 < uVar11); } *(int *)in_ECX = 3; KAGE_LogMessage(1,(byte *) "[Frame: %d] Recieved all Recovery Start messages, Resync Frame = %d \n"); ExceptionList = local_1c; return; } if (iVar7 == 3) { if ((uint)g_manager[1]._state < *(uint *)((int)in_ECX + 0xc)) { ExceptionList = local_1c; return; } *(int *)in_ECX = 4; KAGE_LogMessage(1,(byte *)"[Frame: %d] Finalizing resync! Resync Frame = %d \n"); local_48 = (int *)0x4; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } pvVar18 = (void *)0x3; puVar19 = &DAT_00000008; NetConnection::send_message(g_multiplayerService,&local_50,1,&local_48,8,3); pMVar14 = g_manager; uStack_14 = 3; FUN_008ef1d0(&local_50); NetplayManager::send_message(&pMVar14->_netplayManager,8,puVar19,pvVar18); uStack_14 = 4; if (local_50._4_4_ == (int *)0x0) { ExceptionList = local_1c; return; } cVar6 = (**(code **)(*local_50._4_4_ + 0xc))(); if (cVar6 == '\0') { ExceptionList = local_1c; return; } if (g_multiplayerRelease == (void *)0x0) { ExceptionList = local_1c; return; } (*g_multiplayerRelease)(); ExceptionList = local_1c; return; } if (iVar7 != 4) { ExceptionList = local_1c; return; } local_2c = *(int **)((int)in_ECX + 0x1c); local_44 = (NetplayManager)0x0; local_3c = (NetplayManager)(*(int *)((int)in_ECX + 0x20) - (int)local_2c >> 3); if (local_3c != (NetplayManager)0x0) { local_48 = (int *)(*(int *)((int)in_ECX + 0x2c) - *(int *)((int)in_ECX + 0x28) >> 3); do { piVar20 = (int *)0x0; if (local_48 == (int *)0x0) { ExceptionList = local_1c; return; } piVar15 = *(int **)((int)in_ECX + 0x28); while ((*piVar15 != *local_2c || (piVar15[1] != local_2c[1]))) { piVar20 = (int *)((int)piVar20 + 1); piVar15 = piVar15 + 2; if (local_48 <= piVar20) { ExceptionList = local_1c; return; } } local_44 = (NetplayManager)((int)local_44 + 1); local_2c = local_2c + 2; in_ECX = local_28; } while ((uint)local_44 < (uint)local_3c); } iVar7 = *(int *)((int)in_ECX + 0x40); uVar11 = *(int *)((int)in_ECX + 0x44) - iVar7 >> 3; local_2c = (int *)(uVar11 - 1); if (local_2c < uVar11) { pMVar14 = g_manager; do { pEVar9 = PlayerManager::get_player_by_user_id ((PlayerManager *)&pMVar14->_netplayManager, (ulonglong *)(iVar7 + (int)local_2c * 8)); if (pEVar9 != (Entity_Player *)0x0) { local_30 = &pEVar9->_size; fVar4 = (pEVar9->_sizeMulti).x; if (fVar4 == 0.0) { local_60 = 0; local_3c = (NetplayManager)0x0; local_44 = (NetplayManager)0x0; } else { local_44 = *(NetplayManager *)((int)fVar4 + 8); local_3c = *(NetplayManager *)((int)fVar4 + 0xc); } piVar20 = (int *)0x0; puVar19 = &g_manager[1]._gamestate.field_0x8c4; uStack_38 = CONCAT44(puVar19,(undefined4)uStack_38); local_48 = (int *)((*(int *)&g_manager[1]._gamestate.field_0x8c8 - *(int *)puVar19) / 0x18 ); if (local_48 != (int *)0x0) { piVar15 = (int *)(*(int *)puVar19 + 4); do { iVar7 = *(int *)(*piVar15 + 0x374); if (iVar7 == 0) { local_60 = 0; local_60._4_4_ = (NetplayManager)0x0; local_60._0_4_ = (NetplayManager)0x0; NVar10 = local_60._4_4_; NVar17 = local_60._0_4_; } else { NVar10 = *(NetplayManager *)(iVar7 + 0xc); NVar17 = *(NetplayManager *)(iVar7 + 8); } if ((NVar17 == local_44) && (NVar10 == local_3c)) { FUN_00913a10(); break; } piVar20 = (int *)((int)piVar20 + 1); piVar15 = piVar15 + 6; } while (piVar20 < local_48); } NetplayManager::RemoveRemotePlayer(); pMVar14 = g_manager; } iVar7 = *(int *)((int)in_ECX + 0x40); local_2c = (int *)((int)local_2c - 1); } while (local_2c < (uint)(*(int *)((int)in_ECX + 0x44) - iVar7 >> 3)); } if ((*(int *)(g_manager + 1) - (int)g_manager->_netplayManager & 0xfffffffcU) == 4) { KAGE_LogMessage(1,(byte *)"[Frame: %d] Desync Handler creating new lobby\n"); FUN_00907830(); } FUN_008fed20(); *(int *)in_ECX = 0; ExceptionList = local_1c; return; } uStack_38 = uStack_38 & 0xffffffff; local_3c = g_manager->_netplayManager; local_44 = (NetplayManager)(*(int *)(g_manager + 1) - (int)local_3c >> 2); uVar11 = local_24; if (local_44 != (NetplayManager)0x0) { do { iVar7 = *(int *)(*(int *)local_3c + 0x374); if (iVar7 == 0) { local_50 = 0; local_50._4_4_ = (int *)0x0; local_50._0_4_ = (float *)0x0; local_30 = (float *)local_50; piVar20 = local_50._4_4_; } else { local_30 = *(float **)(iVar7 + 8); piVar20 = *(int **)(iVar7 + 0xc); } uVar11 = local_24 | 1; if (g_userProfile == (void *)0x0) { local_50 = 0; local_2c = (int *)0x0; local_50._0_4_ = (float *)0x0; puVar19 = (undefined1 *)(float *)local_50; } else { local_2c = *(int **)((int)g_userProfile + 0xc); puVar19 = *(undefined1 **)((int)g_userProfile + 8); in_ECX = local_28; } if (((float *)puVar19 != local_30) || (local_2c != piVar20)) { uVar12 = 0; piVar15 = *(int **)((int)in_ECX + 0x10); uVar16 = *(int *)((int)in_ECX + 0x14) - (int)piVar15 >> 3; if (uVar16 == 0) { ExceptionList = local_1c; return; } while (((float *)*piVar15 != local_30 || (in_ECX = local_28, (int *)piVar15[1] != piVar20))) { uVar12 = uVar12 + 1; piVar15 = piVar15 + 2; if (uVar16 <= uVar12) { ExceptionList = local_1c; return; } } } local_24 = local_24 & 0xfffffffe; uVar12 = uStack_38._4_4_ + 1; local_3c = (NetplayManager)((int)local_3c + 4); uStack_38 = CONCAT44(uVar12,(undefined4)uStack_38); } while (uVar12 < (uint)local_44); } local_24 = uVar11; write_desync_diff(); save_desync_files(); local_48 = (int *)FUN_0090b070(); local_30 = (float *)0x0; local_24 = local_48[0xef]; if (local_24 == 0) { KAGE_LogMessage(1,(byte *) "[Frame: %d] NetDesyncHandler::process_desync_confirm_message() could not find a local framestate for the desync \n" ); } else { KAGE_LogMessage(1,(byte *) "[Frame: %u] NetDesyncHandler::process_desync_confirm_message() Local Framestate Checksum : %u \n" ); iVar7 = FUN_0090d950(); if (iVar7 != 0) { local_30 = *(float **)(iVar7 + 8); } } KAGE_LogMessage(1,(byte *) "[Frame: %d] NetDesyncHandler::process_desync_confirm_message() Local Save Checksum : %u \n" ); local_44 = (NetplayManager)0x0; if (*(int *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2 != 0) { do { iVar7 = *(int *)((int)g_manager->_netplayManager + (int)local_44 * 4); local_2c = (int *)(iVar7 + 0x370); cVar6 = (**(code **)(*(int *)(iVar7 + 0x370) + 0x14))(); if (cVar6 == '\0') { pNVar1 = (NetplayManager *)((int)in_ECX + 0xc); pNVar8 = &local_3c; if ((uint)g_manager[1]._state <= (uint)*pNVar1) { pNVar8 = pNVar1; } local_28 = *pNVar8; *pNVar1 = local_28; iVar2 = *(int *)(iVar7 + 0x374); if (iVar2 == 0) { local_3c = (NetplayManager)0x0; uStack_38 = 0; } else { local_3c = *(NetplayManager *)(iVar2 + 0xc); uStack_38 = CONCAT44(*(undefined4 *)(iVar2 + 8),(undefined4)uStack_38); } (**(code **)(*(int *)(iVar7 + 0x370) + 4))(); KAGE_LogMessage(1,(byte *) "[Frame: %u] Sending Recovery Start Message to player \"%s\" %llu, ResyncFrame = %u \n" ); iStack_68 = *(int *)((int)in_ECX + 0xc); local_28 = *(NetplayManager *)(iVar7 + 0x3bc); uStack_6c = 3; if ((local_24 == 0) || (local_28 == (NetplayManager)0x0)) { KAGE_LogMessage(1,(byte *)"[Frame: %u] - Missing frametstates %u \n"); if ((local_24 != 0) && (local_28 != (NetplayManager)0x0)) goto LAB_008fdc8f; LAB_008fdd3f: iVar2 = *(int *)(iVar7 + 0x374); if (iVar2 == 0) { uStack_40 = 0; uVar5 = uStack_40; local_3c = (NetplayManager)0x0; NVar10 = local_3c; local_3c = (NetplayManager)0x0; uStack_40 = 0; uVar13 = uStack_40; NVar17 = local_3c; uStack_40 = uVar5; local_3c = NVar10; } else { uVar13 = *(undefined4 *)(iVar2 + 8); NVar17 = *(NetplayManager *)(iVar2 + 0xc); } puVar3 = *(undefined4 **)((int)in_ECX + 0x44); local_60 = CONCAT44(NVar17,uVar13); if (puVar3 == *(undefined4 **)((int)in_ECX + 0x48)) { std::vector<8byte>::_Emplace_reallocate(); } else { *puVar3 = uVar13; *(NetplayManager *)(puVar3 + 1) = NVar17; *(int *)((int)in_ECX + 0x44) = *(int *)((int)in_ECX + 0x44) + 8; } uStack_64 = 1; if (*(int *)(iVar7 + 0x374) == 0) { uStack_40 = 0; local_3c = (NetplayManager)0x0; NVar10 = local_3c; local_3c = (NetplayManager)0x0; local_28 = local_3c; local_3c = NVar10; } else { local_28 = *(NetplayManager *)(*(int *)(iVar7 + 0x374) + 0xc); } (**(code **)(*local_2c + 4))(); format = " - resolutionPlan = SYNC_PLAN_DROP for user \"%s\" %llu \n"; } else { KAGE_LogMessage(1,(byte *) "[Frame: %u] - Remote Framestate Checksum : %u Local Framestate Checksum: %u \n" ); KAGE_LogMessage(1,(byte *) "[Frame: %u] - Remote Framestate Global Seed : %u Local Framestate Global Seed: %u \n" ); KAGE_LogMessage(1,(byte *) "[Frame: %u] - Remote Save Checksum : %u Local Save Checksum: %u \n"); LAB_008fdc8f: if ((((*(int *)((int)local_28 + 0x14) != *(int *)(local_24 + 0x14)) || (*(int *)((int)local_28 + 0x10) != *(int *)(local_24 + 0x10))) || (local_30 == (float *)0x0)) || (local_30 != (float *)*(int *)(iVar7 + 0x3c0))) goto LAB_008fdd3f; iVar2 = *(int *)(iVar7 + 0x374); if (iVar2 == 0) { uStack_40 = 0; uVar5 = uStack_40; local_3c = (NetplayManager)0x0; NVar10 = local_3c; local_3c = (NetplayManager)0x0; uStack_40 = 0; uStack_58 = uStack_40; NStack_54 = local_3c; uStack_40 = uVar5; local_3c = NVar10; } else { uStack_58 = *(undefined4 *)(iVar2 + 8); NStack_54 = *(NetplayManager *)(iVar2 + 0xc); } puVar3 = *(undefined4 **)((int)in_ECX + 0x38); if (puVar3 == *(undefined4 **)((int)in_ECX + 0x3c)) { std::vector<8byte>::_Emplace_reallocate(); } else { *puVar3 = uStack_58; *(NetplayManager *)(puVar3 + 1) = NStack_54; *(int *)((int)in_ECX + 0x38) = *(int *)((int)in_ECX + 0x38) + 8; } uStack_64 = 0; if (*(int *)(iVar7 + 0x374) == 0) { uStack_40 = 0; local_3c = (NetplayManager)0x0; NVar10 = local_3c; local_3c = (NetplayManager)0x0; local_28 = local_3c; local_3c = NVar10; } else { local_28 = *(NetplayManager *)(*(int *)(iVar7 + 0x374) + 0xc); } (**(code **)(*local_2c + 4))(); format = " - resolutionPlan = SYNC_PLAN_SYNC for user \"%s\" %llu \n"; } KAGE_LogMessage(1,(byte *)format); if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = (void *)0x3; pvVar18 = (void *)0xc; NetConnection::send_message(g_multiplayerService,&local_50,1,&uStack_6c,0xc,3); uStack_14 = 0; FUN_008ef1d0(&local_50); multiplayer_send_message(local_2c,pvVar18,messageRefCount); uStack_14 = 1; if (((local_50._4_4_ != (int *)0x0) && (cVar6 = (**(code **)(*local_50._4_4_ + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } uStack_14 = 0xffffffff; } local_44 = (NetplayManager)((int)local_44 + 1); } while ((uint)local_44 < (uint)(*(int *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2) ); } uVar11 = 0; pMVar14 = g_manager; if (*(int *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2 != 0) { do { local_48 = *(int **)(*(int *)((int)pMVar14->_netplayManager + uVar11 * 4) + 0x3bc); if (local_48 != (int *)0x0) { FUN_0041c7d0(); operator_delete(local_48,0x18); pMVar14 = g_manager; *(undefined4 *)(*(int *)((int)g_manager->_netplayManager + uVar11 * 4) + 0x3bc) = 0; } uVar11 = uVar11 + 1; } while (uVar11 < (uint)(*(int *)(pMVar14 + 1) - (int)pMVar14->_netplayManager >> 2)); } *(int *)in_ECX = 2; iVar7 = *(int *)((int)in_ECX + 0x50) - *(int *)((int)in_ECX + 0x4c); while (iVar7 >> 3 != 0) { KAGE_LogMessage(1,(byte *) "[Frame: %d] Processing queued Recovery Start message from NetDesyncHandler::process_desync_confirm_message() \n" ); piVar20 = (int *)0x0; local_48 = *(int **)(*(int *)((int)in_ECX + 0x50) + -4); local_44 = *(NetplayManager *)(*(int *)((int)in_ECX + 0x50) + -8); if (((local_48 != (int *)0x0) && (cVar6 = (**(code **)(*local_48 + 4))(), cVar6 != '\0')) && ((piVar20 != (int *)0x0 && ((cVar6 = (**(code **)(*piVar20 + 0xc))(), cVar6 != '\0' && (g_multiplayerRelease != (void *)0x0)))))) { (*g_multiplayerRelease)(auStack_7a + -10); } FUN_008ffaf0(); uStack_14 = 2; piVar20 = *(int **)(*(int *)((int)in_ECX + 0x50) + -4); if (((piVar20 != (int *)0x0) && (cVar6 = (**(code **)(*piVar20 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } uStack_14 = 0xffffffff; *(int *)((int)in_ECX + 0x50) = *(int *)((int)in_ECX + 0x50) + -8; iVar7 = *(int *)((int)in_ECX + 0x50) - *(int *)((int)in_ECX + 0x4c); } ExceptionList = local_1c; return; } //@@ 008fe3a0 FUN_008fe3a0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_008fe3a0(int *param_1,int param_2) { undefined8 *puVar1; uint uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; Manager *pMVar6; byte *pbVar7; char cVar8; uint uVar9; int iVar10; int iVar11; void *pvVar12; undefined4 *puVar13; byte ****ppppbVar14; int *piVar15; uint uVar16; int *in_ECX; char *ptr; undefined4 *puVar17; undefined1 *message; void *pvVar18; undefined1 auStack_278 [4]; int *local_274; int iStack_270; int *piStack_26c; int *local_268; undefined4 *puStack_264; int *piStack_260; uint uStack_25c; char *pcStack_258; undefined4 uStack_248; uint uStack_244; byte ****appppbStack_240 [4]; undefined4 uStack_230; uint uStack_22c; byte abStack_228 [516]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = abStack_228 + 0x224; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b07fa8; local_1c = ExceptionList; uVar9 = __security_cookie ^ (uint)(abStack_228 + 0x218); ExceptionList = &local_1c; local_274 = param_1; local_268 = in_ECX; local_24 = uVar9; pbVar7 = abStack_228 + 0x224; if ((param_2 != 0) && (pbVar7 = abStack_228 + 0x224, param_2 != 1)) { KAGE_LogMessage(0x10,(byte *)"Message type is not a notify\n"); pbVar7 = puStack_20; } puStack_20 = pbVar7; if (*in_ECX == 0) { if (g_game != (Game *)0x0) { KAGE_LogMessage(8,(byte *)"[Frame: %d] Desync detected! desyncFrame = %d \n"); in_ECX[1] = in_ECX[1] + 1; in_ECX[2] = (int)param_1; iVar10 = FUN_0090b070(uVar9); piStack_260 = *(int **)(iVar10 + 0x3bc); piStack_26c = (int *)iVar10; if (piStack_260 != (int *)0x0) { FUN_0041c7d0(); operator_delete(piStack_260,0x18); *(undefined4 *)(iVar10 + 0x3bc) = 0; } *(undefined4 *)(iVar10 + 0x3c0) = 0; iVar11 = FUN_0090d950(param_1); if (iVar11 != 0) { *(undefined4 *)(iVar10 + 0x3c0) = *(undefined4 *)(iVar11 + 8); } pvVar18 = g_game->_room; iVar10 = *(int *)((int)pvVar18 + 0x1614) + -1; if (-1 < iVar10) { uVar9 = *(int *)((int)pvVar18 + 0x1610) + iVar10; LAB_008fe4e6: uStack_25c = (uVar9 & 0x1f) * 3; if (*(int **)((int)pvVar18 + (uVar9 & 0x1f) * 0x18 + 0x1310) != param_1) goto code_r0x008fe4f9; piStack_260 = operator_new(0x18); uStack_14 = 0; if (piStack_260 == (int *)0x0) { piVar15 = (int *)0x0; } else { *piStack_260 = *(int *)((int)pvVar18 + uStack_25c * 8 + 0x1310); piStack_260[1] = 0; piStack_260[2] = 0; piStack_260[3] = 0; puStack_264 = *(undefined4 **)((int)pvVar18 + uStack_25c * 8 + 0x1318); puVar17 = *(undefined4 **)((int)pvVar18 + uStack_25c * 8 + 0x1314); if (puVar17 != puStack_264) { uVar9 = ((int)puStack_264 - (int)puVar17) / 0x38; if (0x4924924 < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar9 = uVar9 * 0x38; pvVar12 = std::_Allocate(uVar9); piStack_260[1] = (int)pvVar12; piStack_260[2] = (int)pvVar12; piStack_260[3] = (int)((int)pvVar12 + uVar9); puVar13 = (undefined4 *)piStack_260[1]; do { uVar3 = puVar17[1]; uVar4 = puVar17[2]; uVar5 = puVar17[3]; *puVar13 = *puVar17; puVar13[1] = uVar3; puVar13[2] = uVar4; puVar13[3] = uVar5; uVar3 = puVar17[5]; uVar4 = puVar17[6]; uVar5 = puVar17[7]; puVar13[4] = puVar17[4]; puVar13[5] = uVar3; puVar13[6] = uVar4; puVar13[7] = uVar5; uVar3 = puVar17[9]; uVar4 = puVar17[10]; uVar5 = puVar17[0xb]; puVar13[8] = puVar17[8]; puVar13[9] = uVar3; puVar13[10] = uVar4; puVar13[0xb] = uVar5; puVar1 = (undefined8 *)(puVar17 + 0xc); puVar17 = puVar17 + 0xe; *(undefined8 *)(puVar13 + 0xc) = *puVar1; puVar13 = puVar13 + 0xe; } while (puVar17 != puStack_264); piStack_260[2] = (int)puVar13; } piStack_260[4] = *(int *)((int)pvVar18 + uStack_25c * 8 + 0x1320); piStack_260[5] = *(int *)((int)pvVar18 + uStack_25c * 8 + 0x1324); piVar15 = piStack_260; param_1 = local_274; } uStack_14 = 0xffffffff; *(int **)((int)piStack_26c + 0x3bc) = piVar15; } LAB_008fe61a: KAGE_LogMessage(1,(byte *)"[Frame: %d] Broadcasting MSG_DESYNC_NOTIFY: Desync Frame = %d \n"); iStack_270 = param_2; piStack_26c = param_1; if ((param_2 != 0) && (param_2 != 1)) { KAGE_LogMessage(0x10,(byte *)"Message type is not a notify\n"); } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } pvVar18 = (void *)0x3; message = &DAT_00000008; NetConnection::send_message(g_multiplayerService,auStack_278,1,&iStack_270,8,3); pMVar6 = g_manager; uStack_14 = 1; FUN_008ef1d0(auStack_278); NetplayManager::send_message(&pMVar6->_netplayManager,8,message,pvVar18); uStack_14 = 2; if (((local_274 != (int *)0x0) && (cVar8 = (**(code **)(*local_274 + 0xc))(), cVar8 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(auStack_278); } uStack_14 = 0xffffffff; if (param_2 == 0) { pcStack_258 = std::_Allocate(0x20); uStack_248 = 0x15; uStack_244 = 0x1f; builtin_strncpy(pcStack_258,"desync_framestate.txt",0x16); uStack_14 = 3; online_log_make_path(1); uStack_14 = 0xffffffff; if (0xf < uStack_244) { uVar9 = uStack_244 + 1; ptr = pcStack_258; if (0xfff < uVar9) { ptr = *(char **)(pcStack_258 + -4); uVar9 = uStack_244 + 0x24; if ((char *)0x1f < pcStack_258 + (-4 - (int)ptr)) goto LAB_008fe802; } operator_delete(ptr,uVar9); } uStack_14 = 4; ppppbVar14 = (byte ****)appppbStack_240; if (0xf < uStack_22c) { ppppbVar14 = appppbStack_240[0]; } piVar15 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)ppppbVar14,0); uStack_14 = 0xffffffff; piStack_260 = piVar15; if (0xf < uStack_22c) { uVar9 = uStack_22c + 1; ppppbVar14 = appppbStack_240[0]; if (0xfff < uVar9) { ppppbVar14 = (byte ****)appppbStack_240[0][-1]; uVar9 = uStack_22c + 0x24; if ((byte *)0x1f < (byte *)((int)appppbStack_240[0] + (-4 - (int)ppppbVar14))) { LAB_008fe802: uStack_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar14,uVar9); } uStack_230 = 0; uStack_22c = 0xf; appppbStack_240[0] = (byte ****)((uint)appppbStack_240[0] & 0xffffff00); if (piVar15 != (int *)0x0) { iVar10 = sprintf(abStack_228, (byte *) "\r\n========== DESYNCED (at frame %d), dumping frame information\r\n"); (**(code **)(*piVar15 + 0x1c))(abStack_228,1,iVar10); KAGE_LogMessage(1,abStack_228); uVar9 = 0; pvVar18 = g_game->_room; if (*(int *)((int)pvVar18 + 0x1614) != 0) { do { uVar2 = *(int *)((int)pvVar18 + 0x1610) + uVar9; uVar16 = uVar2 & 0x1f; piStack_26c = (int *)(uVar16 * 3); if ((*(int **)((int)pvVar18 + uVar16 * 0x18 + 0x1310) == param_1) && ((uVar9 == *(int *)((int)pvVar18 + 0x1614) - 1U || (*(int **)((int)pvVar18 + (uVar2 + 1 & 0x1f) * 0x18 + 0x1310) != param_1)))) { sprintf(abStack_228, (byte *) "---------- \r\nFrame %d, checksum %08x, global RNG checksum %08x %s\r\n"); (**(code **)(*piStack_260 + 0x1c))(); KAGE_LogMessage(1,abStack_228); uStack_25c = 0; iVar11 = *(int *)((int)pvVar18 + uVar16 * 0x18 + 0x1318) - *(int *)((int)pvVar18 + uVar16 * 0x18 + 0x1314); iVar10 = iVar11 >> 0x1f; if (iVar11 / 0x38 + iVar10 != iVar10) { puStack_264 = (undefined4 *)0x0; do { sprintf(abStack_228, (byte *) "%04d: %d.%d.%d pre(%g, %g, %g, %g) post(%g, %g, %g, %g) %08x G:%08x\r\n" ); (**(code **)(*piStack_260 + 0x1c))(); KAGE_LogMessage(1,abStack_228); uStack_25c = uStack_25c + 1; puStack_264 = puStack_264 + 0xe; } while (uStack_25c < (uint)((*(int *)((int)pvVar18 + uVar16 * 0x18 + 0x1318) - *(int *)((int)pvVar18 + uVar16 * 0x18 + 0x1314)) / 0x38)); } break; } uVar9 = uVar9 + 1; } while (uVar9 < *(uint *)((int)pvVar18 + 0x1614)); } piVar15 = piStack_260; (**(code **)(*piStack_260 + 0x20))(); (**(code **)*piVar15)(1); } } in_ECX = local_268; } if (*in_ECX == 0) { *in_ECX = 1; } } ExceptionList = local_1c; return; code_r0x008fe4f9: uVar9 = uVar9 - 1; iVar10 = iVar10 + -1; if (iVar10 < 0) goto LAB_008fe61a; goto LAB_008fe4e6; } //@@ 008feaa0 FUN_008feaa0 uint FUN_008feaa0(int param_1) { uint in_EAX; int in_ECX; uint uVar1; uint *puVar2; uint uVar3; puVar2 = *(uint **)(in_ECX + 0x40); uVar1 = *(int *)(in_ECX + 0x44) - (int)puVar2 >> 3; uVar3 = 0; if (uVar1 != 0) { in_EAX = *(uint *)(param_1 + 0xc); do { if ((*puVar2 == in_EAX) && (puVar2[1] == 0)) { return CONCAT31((int3)(in_EAX >> 8),1); } uVar3 = uVar3 + 1; puVar2 = puVar2 + 2; } while (uVar3 < uVar1); } return in_EAX & 0xffffff00; } //@@ 008feaf0 FUN_008feaf0 void FUN_008feaf0(int param_1,int param_2) { void *pvVar1; void *pvVar2; int iVar3; int iVar4; int iVar5; int extraout_EAX; uint uVar6; int in_ECX; uint uVar7; undefined **local_18 [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07ff5; local_10 = ExceptionList; ExceptionList = &local_10; local_18[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(¶m_1); local_8 = 0; local_18[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_18); } local_8 = 1; KAGE_LogMessage(1,(byte *)"[Frame: %d] NetDesyncHandler::RemoveUser() Removing user \"%s\" %llu\n" ); iVar5 = param_2; iVar4 = param_1; iVar3 = *(int *)(in_ECX + 0x10); uVar6 = 0; uVar7 = *(int *)(in_ECX + 0x14) - iVar3 >> 3; if (uVar7 != 0) { do { if ((*(int *)(iVar3 + uVar6 * 8) == param_1) && (*(int *)(iVar3 + 4 + uVar6 * 8) == param_2)) { pvVar2 = (void *)(iVar3 + uVar6 * 8); pvVar1 = (void *)((int)pvVar2 + 8); memmove(pvVar2,pvVar1,*(int *)(in_ECX + 0x14) - (int)pvVar1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + -8; break; } uVar6 = uVar6 + 1; } while (uVar6 < uVar7); } uVar6 = 0; iVar3 = *(int *)(in_ECX + 0x1c); uVar7 = *(int *)(in_ECX + 0x20) - iVar3 >> 3; if (uVar7 != 0) { do { if ((*(int *)(iVar3 + uVar6 * 8) == iVar4) && (*(int *)(iVar3 + 4 + uVar6 * 8) == iVar5)) { pvVar2 = (void *)(iVar3 + uVar6 * 8); pvVar1 = (void *)((int)pvVar2 + 8); memmove(pvVar2,pvVar1,*(int *)(in_ECX + 0x20) - (int)pvVar1); *(int *)(in_ECX + 0x20) = *(int *)(in_ECX + 0x20) + -8; break; } uVar6 = uVar6 + 1; } while (uVar6 < uVar7); } uVar6 = 0; iVar3 = *(int *)(in_ECX + 0x28); uVar7 = *(int *)(in_ECX + 0x2c) - iVar3 >> 3; if (uVar7 != 0) { do { if ((*(int *)(iVar3 + uVar6 * 8) == iVar4) && (*(int *)(iVar3 + 4 + uVar6 * 8) == iVar5)) { pvVar2 = (void *)(iVar3 + uVar6 * 8); pvVar1 = (void *)((int)pvVar2 + 8); memmove(pvVar2,pvVar1,*(int *)(in_ECX + 0x2c) - (int)pvVar1); *(int *)(in_ECX + 0x2c) = *(int *)(in_ECX + 0x2c) + -8; break; } uVar6 = uVar6 + 1; } while (uVar6 < uVar7); } uVar6 = 0; iVar3 = *(int *)(in_ECX + 0x34); uVar7 = *(int *)(in_ECX + 0x38) - iVar3 >> 3; if (uVar7 != 0) { do { if ((*(int *)(iVar3 + uVar6 * 8) == iVar4) && (*(int *)(iVar3 + 4 + uVar6 * 8) == iVar5)) { pvVar2 = (void *)(iVar3 + uVar6 * 8); pvVar1 = (void *)((int)pvVar2 + 8); memmove(pvVar2,pvVar1,*(int *)(in_ECX + 0x38) - (int)pvVar1); *(int *)(in_ECX + 0x38) = *(int *)(in_ECX + 0x38) + -8; break; } uVar6 = uVar6 + 1; } while (uVar6 < uVar7); } uVar6 = 0; iVar3 = *(int *)(in_ECX + 0x40); uVar7 = *(int *)(in_ECX + 0x44) - iVar3 >> 3; if (uVar7 != 0) { while ((*(int *)(iVar3 + uVar6 * 8) != iVar4 || (*(int *)(iVar3 + 4 + uVar6 * 8) != iVar5))) { uVar6 = uVar6 + 1; if (uVar7 <= uVar6) { ExceptionList = local_10; return; } } pvVar2 = (void *)(iVar3 + uVar6 * 8); pvVar1 = (void *)((int)pvVar2 + 8); memmove(pvVar2,pvVar1,*(int *)(in_ECX + 0x44) - (int)pvVar1); *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; } ExceptionList = local_10; return; } //@@ 008fed20 FUN_008fed20 void FUN_008fed20(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x14) = *(undefined4 *)(in_ECX + 0x10); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)(in_ECX + 0x1c); *(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(in_ECX + 0x40); *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(in_ECX + 0x34); FUN_00900b90(); *(undefined4 *)(in_ECX + 0x50) = *(undefined4 *)(in_ECX + 0x4c); *(undefined4 *)(in_ECX + 0xc) = 0; return; } //@@ 008fed60 NetDesyncHandler::receive_messages /* DB: ? ECX = NetDesyncHandler, only caller NetDesyncHandler::Update (first thing it does): loops NetworkManager::receive_message(channel 3) and handles MSG_DESYNC_NOTIFY / CONFIRM / RECOVERY_START / RECOVERY_COMPLETE ("[Frame: %d] Recieved MSG_DESYNC_... from user %llu"), "This function should only be called on consolidated messages" */ void NetDesyncHandler::receive_messages(void) { int iVar1; char cVar2; int *piVar3; Entity_Player *pEVar4; int in_ECX; uint uVar5; undefined1 auStack_5a [2]; int *local_48; uint local_44; undefined1 local_40 [4]; int *local_3c; int *local_38; PlayerManager *local_34; PlayerManager *local_30; int local_2c; int *local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_40 + 0x3c; puStack_18 = &LAB_00b0802d; local_1c = ExceptionList; ExceptionList = &local_1c; local_30 = (PlayerManager *)0x0; local_2c = in_ECX; do { while( true ) { local_14 = 0xffffffff; if (g_multiplayerService == (void *)0x0) { ExceptionList = local_1c; return; } piVar3 = NetworkManager::receive_message(g_multiplayerService,local_40,3,0); iVar1 = *piVar3; local_14 = 0; if (((local_3c != (int *)0x0) && (cVar2 = (**(code **)(*local_3c + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; if (iVar1 == 0) { ExceptionList = local_1c; return; } if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(); } else { NetworkManager::receive_message(g_multiplayerService,&local_38,3,1); } piVar3 = local_38; local_14 = 1; if (local_38[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages") ; } local_28 = (int *)*local_38; iVar1 = *(int *)(*(int *)(*(int *)piVar3[2] + 0x14) + 8); local_30 = (PlayerManager *)&g_manager->_netplayManager; local_24 = local_38[1]; cVar2 = NetplayManager::is_player_removal_queued(); if (cVar2 == '\0') break; LAB_008ff0a5: local_14 = 2; if (((local_34 != (PlayerManager *)0x0) && (cVar2 = (**(code **)((int)(local_34->_playerList)._begin + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } local_48 = local_28; local_44 = local_24; pEVar4 = PlayerManager::get_player_by_user_id(local_30,(ulonglong *)&local_48); if (pEVar4 == (Entity_Player *)0x0) goto LAB_008ff0a5; if ((iVar1 == 0) || (iVar1 == 1)) { KAGE_LogMessage(1,(byte *)"[Frame: %d] Recieved MSG_DESYNC_NOTIFY from user %llu \n"); piVar3 = (int *)0x0; local_30 = local_34; local_28 = local_38; if ((((local_34 != (PlayerManager *)0x0) && ((cVar2 = (**(code **)((int)(local_34->_playerList)._begin + 4))(), cVar2 != '\0' && (piVar3 != (int *)0x0)))) && (cVar2 = (**(code **)(*piVar3 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(auStack_5a + -10); } func_0x008ff0f0(); } else if (iVar1 == 2) { KAGE_LogMessage(1,(byte *)"[Frame: %d] Recieved MSG_DESYNC_CONFIRM from user %llu \n"); FUN_008ef1d0(&local_38); func_0x008ff600(); } else if (iVar1 == 3) { KAGE_LogMessage(1,(byte *)"[Frame: %d] Recieved MSG_DESYNC_RECOVERY_START from user %llu \n"); FUN_008ef1d0(&local_38); FUN_008ffaf0(); } else if (iVar1 == 4) { KAGE_LogMessage(1,(byte *) "[Frame: %d] Recieved MSG_DESYNC_RECOVERY_COMPLETE from user %llu \n"); uVar5 = 0; local_28 = (int *)local_38[1]; local_30 = *(PlayerManager **)(local_2c + 0x2c); piVar3 = *(int **)(local_2c + 0x28); local_24 = (int)local_30 - (int)piVar3 >> 3; if (local_24 != 0) { do { if (((void *)*piVar3 == (void *)*local_38) && ((int *)piVar3[1] == local_28)) { KAGE_LogMessage(8,(byte *) "[Frame %d] NetDesyncHandler::add_user_resync_complete() recieved user ID (%llu) which has already completed recovery! \n" ); goto LAB_008ff06e; } uVar5 = uVar5 + 1; piVar3 = piVar3 + 2; } while (uVar5 < local_24); } if (local_30 == *(PlayerManager **)(local_2c + 0x30)) { std::vector<8byte>::_Emplace_reallocate(); } else { (local_30->_playerList)._begin = (void *)*local_38; (local_30->_playerList)._end = local_28; *(int *)(local_2c + 0x2c) = *(int *)(local_2c + 0x2c) + 8; } } else { KAGE_LogMessage(8,(byte *) "[Frame: %d] Received invalid desync message (%d), from user %llu !\n"); } LAB_008ff06e: local_14 = 3; if (((local_34 != (PlayerManager *)0x0) && (cVar2 = (**(code **)((int)(local_34->_playerList)._begin + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } while( true ); } //@@ 008ffaf0 FUN_008ffaf0 void FUN_008ffaf0(int *param_1,int *param_2) { char cVar1; uint uVar2; int *piVar3; int *in_ECX; uint uVar4; uint uVar5; int local_24; int local_20; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar3 = param_1; puStack_c = &LAB_00b0811d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } local_18 = *(int **)(*(int *)piVar3[2] + 0x14); if (*in_ECX == 2) { uVar4 = 0; piVar3 = (int *)in_ECX[7]; local_24 = *param_1; local_20 = param_1[1]; uVar5 = in_ECX[8] - (int)piVar3 >> 3; if (uVar5 != 0) { do { if ((*piVar3 == local_24) && (piVar3[1] == local_20)) { KAGE_LogMessage(8,(byte *) "[Frame %d] NetDesyncHandler::add_user_recovery_start() recieved user ID (%llu) which has already started recovery! \n" ); goto LAB_008ffbe3; } uVar4 = uVar4 + 1; piVar3 = piVar3 + 2; } while (uVar4 < uVar5); } piVar3 = (int *)in_ECX[8]; if (piVar3 == (int *)in_ECX[9]) { std::vector<8byte>::_Emplace_reallocate(piVar3,&local_24); } else { *piVar3 = local_24; piVar3[1] = local_20; in_ECX[8] = in_ECX[8] + 8; } LAB_008ffbe3: piVar3 = in_ECX; if ((uint)in_ECX[3] < (uint)local_18[3]) { piVar3 = local_18; } in_ECX[3] = piVar3[3]; KAGE_LogMessage(1,(byte *) "[Frame: %d] NetDesyncHandler::process_desync_recovery_start_message, Resync Count = %d/%d, Resync Frame = %d \n" ); } else if (in_ECX[0x14] == in_ECX[0x15]) { FUN_009009c0(in_ECX[0x14],¶m_1); } else { FUN_008ef1d0(¶m_1); in_ECX[0x14] = in_ECX[0x14] + 8; } local_8 = 1; if (param_2 != (int *)0x0) { cVar1 = (**(code **)(*param_2 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } } ExceptionList = local_10; return; } //@@ 008ffc70 NetDesyncHandler::write_desync_diff /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: only caller NetDesyncHandler::Update; 'Desync detected on frame: %d ... Number of players', '[Frame: %d] Missing Desync Frame States from user "%s"! Cannot create Desync Diff', SaveDataManager::open_file_write desync_diff.txt */ void NetDesyncHandler::write_desync_diff(void) { int iVar1; int *piVar2; int *piVar3; bool bVar4; bool bVar5; bool bVar6; bool bVar7; bool bVar8; bool bVar9; bool bVar10; Manager *pMVar11; byte *pbVar12; bool bVar13; uint uVar14; byte *******pppppppbVar15; int *piVar16; int iVar17; int iVar18; void *ptr; NetplayManager NVar19; uint uVar20; bool bVar21; int *piStack_294; uint uStack_290; uint uStack_284; int iStack_280; int iStack_278; uint uStack_26c; byte *******local_258 [4]; undefined4 local_248; uint local_244; undefined8 local_240; undefined1 local_238 [16]; byte local_228 [516]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pMVar11 = g_manager; puStack_20 = local_228 + 0x224; local_14 = 0xffffffff; puStack_18 = &LAB_00b0815b; local_1c = ExceptionList; uVar14 = __security_cookie ^ (uint)(local_228 + 0x218); ExceptionList = &local_1c; bVar13 = false; uVar20 = 0; NVar19 = g_manager->_netplayManager; local_24 = uVar14; pbVar12 = local_228 + 0x224; if (*(int *)(g_manager + 1) - (int)NVar19 >> 2 != 0) { do { iVar18 = *(int *)((int)NVar19 + uVar20 * 4); if (*(int *)(iVar18 + 0x3bc) == 0) { (**(code **)(*(int *)(iVar18 + 0x370) + 4))(uVar14); KAGE_LogMessage(8,(byte *) "[Frame: %d] Missing Desync Frame States from user \"%s\"! Cannot create Desync Diff \n" ); NVar19 = pMVar11->_netplayManager; bVar13 = true; } uVar20 = uVar20 + 1; } while (uVar20 < (uint)(*(int *)(pMVar11 + 1) - (int)NVar19 >> 2)); pbVar12 = puStack_20; if (bVar13) { ExceptionList = local_1c; return; } } puStack_20 = pbVar12; local_238._0_6_ = 0x78742e666669; local_238._8_4_ = 0xf; local_238._12_4_ = 0xf; local_240 = 0x645f636e79736564; local_238._0_8_ = 0x7478742e666669; local_14 = 0; online_log_make_path(1); local_14 = 0xffffffff; if (0xf < (uint)local_238._12_4_) { uVar14 = local_238._12_4_ + 1; ptr = (void *)local_240; if (0xfff < uVar14) { ptr = *(void **)((int)(void *)local_240 + -4); uVar14 = local_238._12_4_ + 0x24; if (0x1f < (uint)((int)(void *)local_240 + (-4 - (int)ptr))) goto LAB_008ffe40; } operator_delete(ptr,uVar14); } local_14 = 1; pppppppbVar15 = (byte *******)local_258; if (0xf < local_244) { pppppppbVar15 = local_258[0]; } piVar16 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)pppppppbVar15,0); local_14 = 0xffffffff; if (0xf < local_244) { uVar14 = local_244 + 1; pppppppbVar15 = local_258[0]; if (0xfff < uVar14) { pppppppbVar15 = (byte *******)local_258[0][-1]; uVar14 = local_244 + 0x24; if ((byte *)0x1f < (byte *)((int)local_258[0] + (-4 - (int)pppppppbVar15))) { LAB_008ffe40: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar15,uVar14); } local_248 = 0; local_244 = 0xf; local_258[0] = (byte *******)((uint)local_258[0] & 0xffffff00); if (piVar16 == (int *)0x0) { ExceptionList = local_1c; return; } iVar18 = *(int *)(*(int *)pMVar11->_netplayManager + 0x3bc); iVar17 = sprintf_s(local_228,0x200, (byte *) "Desync detected on frame: %d \r\n\r\n--------------------------------------------------------------------------------------------\r\n\r\nNumber of players: %d \r\nPlayer Info: \r\n" ); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar17); KAGE_LogMessage(8,local_228); uVar14 = 0; NVar19 = pMVar11->_netplayManager; if (*(int *)(pMVar11 + 1) - (int)NVar19 >> 2 != 0) { do { (**(code **)(*(int *)(*(int *)((int)NVar19 + uVar14 * 4) + 0x370) + 4))(); iVar17 = sprintf_s(local_228,0x200,(byte *)" - Player %d: Username = %s, ID = %llu \r\n"); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar17); KAGE_LogMessage(8,local_228); uVar14 = uVar14 + 1; NVar19 = pMVar11->_netplayManager; } while (uVar14 < (uint)(*(int *)(pMVar11 + 1) - (int)NVar19 >> 2)); } iVar17 = sprintf_s(local_228,0x200, (byte *) "\r\n--------------------------------------------------------------------------------------------\r\n\r\nChecksums: \r\n" ); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar17); KAGE_LogMessage(8,local_228); uVar14 = 0; uStack_26c = (*(int *)(iVar18 + 8) - *(int *)(iVar18 + 4)) / 0x38; if (*(int *)(pMVar11 + 1) - (int)pMVar11->_netplayManager >> 2 != 0) { do { iVar18 = *(int *)(*(int *)((int)pMVar11->_netplayManager + uVar14 * 4) + 0x3bc); iVar17 = sprintf(local_228, (byte *)" - Player%d: Checksum (%08x), Global RNG checksum (%08x) \r\n"); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar17); KAGE_LogMessage(8,local_228); uVar20 = (*(int *)(iVar18 + 8) - *(int *)(iVar18 + 4)) / 0x38; if (uStack_26c < uVar20) { uStack_26c = uVar20; } uVar14 = uVar14 + 1; } while (uVar14 < (uint)(*(int *)(pMVar11 + 1) - (int)pMVar11->_netplayManager >> 2)); } iVar18 = sprintf_s(local_228,0x200, (byte *) "\r\n--------------------------------------------------------------------------------------------\r\n\r\nDesyncd Entities: \r\n\r\n" ); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar18); KAGE_LogMessage(8,local_228); iStack_278 = 0; uStack_284 = 0; if (uStack_26c != 0) { iStack_280 = 0; do { iVar18 = *(int *)(pMVar11 + 1); NVar19 = pMVar11->_netplayManager; uVar20 = 0; uVar14 = iVar18 - (int)NVar19 >> 2; local_238 = ZEXT816(0); if (uVar14 != 0) { do { iVar17 = *(int *)(*(int *)((int)NVar19 + uVar20 * 4) + 0x3bc); iVar1 = *(int *)(iVar17 + 4); if (uStack_284 < (uint)((*(int *)(iVar17 + 8) - iVar1) / 0x38)) { *(int *)(local_238 + uVar20 * 4) = iStack_280 + iVar1; } uVar20 = uVar20 + 1; } while (uVar20 < uVar14); uStack_290 = 1; bVar13 = false; NVar19 = pMVar11->_netplayManager; piStack_294 = (int *)local_238; bVar4 = false; bVar5 = false; bVar6 = false; bVar7 = false; bVar8 = false; bVar9 = false; bVar10 = false; do { if (uStack_290 < (uint)(iVar18 - (int)NVar19 >> 2)) { piVar2 = (int *)*piStack_294; uVar20 = uStack_290; do { piVar3 = *(int **)(local_238 + uVar20 * 4); if ((piVar2 == (int *)0x0) != (piVar3 == (int *)0x0)) { bVar13 = true; } if ((piVar2 != (int *)0x0) && (piVar3 != (int *)0x0)) { if (*piVar2 != *piVar3) { uVar20 = 1; } iVar17 = *(int *)(local_238 + uVar20 * 4); if (((piVar2[1] != *(int *)(iVar17 + 4)) || (piVar2[3] != *(int *)(iVar17 + 0xc))) || (piVar2[2] != *(int *)(iVar17 + 8))) { bVar4 = true; } if (((float)piVar2[6] != *(float *)(iVar17 + 0x18)) || ((float)piVar2[7] != *(float *)(iVar17 + 0x1c))) { bVar5 = true; } if (((float)piVar2[8] != *(float *)(iVar17 + 0x20)) || ((float)piVar2[9] != *(float *)(iVar17 + 0x24))) { bVar6 = true; } if (((float)piVar2[10] != *(float *)(iVar17 + 0x28)) || ((float)piVar2[0xb] != *(float *)(iVar17 + 0x2c))) { bVar7 = true; } if (((float)piVar2[0xc] != *(float *)(iVar17 + 0x30)) || ((float)piVar2[0xd] != *(float *)(iVar17 + 0x34))) { bVar8 = true; } if (piVar2[4] != *(int *)(*(int *)(local_238 + uVar20 * 4) + 0x10)) { bVar9 = true; } if (piVar2[5] != *(int *)(*(int *)(local_238 + uVar20 * 4) + 0x14)) { bVar10 = true; } } uVar20 = uVar20 + 1; } while (uVar20 < uVar14); NVar19 = pMVar11->_netplayManager; } piStack_294 = piStack_294 + 1; bVar21 = uStack_290 < (uint)(iVar18 - (int)NVar19 >> 2); uStack_290 = uStack_290 + 1; } while (bVar21); if (((((bVar13) || (bVar4)) || (bVar5)) || ((bVar6 || (bVar7)))) || ((bVar8 || ((bVar9 || (bVar10)))))) { iStack_278 = iStack_278 + 1; iVar18 = sprintf_s(local_228,0x200,(byte *)"Entity %d:\r\n"); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar18); KAGE_LogMessage(8,local_228); uVar14 = 0; if (*(int *)(pMVar11 + 1) - (int)pMVar11->_netplayManager >> 2 != 0) { do { iVar18 = sprintf_s(local_228,0x200,(byte *)" - Player %d: "); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar18); KAGE_LogMessage(8,local_228); if (*(int *)(local_238 + uVar14 * 4) == 0) { iVar18 = sprintf_s(local_228,0x200,(byte *)"Missing!"); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar18); KAGE_LogMessage(8,local_228); } else { iVar18 = sprintf_s(local_228,0x200,(byte *)" Type: (%d.%d.%d) "); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar18); KAGE_LogMessage(8,local_228); if (bVar4) { sprintf_s(local_228,0x200,(byte *)" (Type Mismatch!) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } if (bVar5) { sprintf_s(local_228,0x200,(byte *)" PrePosition: (%.16f, %.16f) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } if (bVar6) { sprintf_s(local_228,0x200,(byte *)" PreVelocity: (%.16f, %.16f) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } if (bVar7) { sprintf_s(local_228,0x200,(byte *)" PostPosition: (%.16f, %.16f) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } if (bVar8) { sprintf_s(local_228,0x200,(byte *)" PostVelocity: (%.16f, %.16f) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } if (bVar9) { sprintf_s(local_228,0x200,(byte *)" Seed: (%08x) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } if (bVar10) { sprintf_s(local_228,0x200,(byte *)" GlobalSeed: (%08x) "); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); } } sprintf_s(local_228,0x200,&DAT_00b657f8); (**(code **)(*piVar16 + 0x1c))(); KAGE_LogMessage(8,local_228); uVar14 = uVar14 + 1; } while (uVar14 < (uint)(*(int *)(pMVar11 + 1) - (int)pMVar11->_netplayManager >> 2)); } } } iStack_280 = iStack_280 + 0x38; uStack_284 = uStack_284 + 1; } while (uStack_284 < uStack_26c); if (iStack_278 != 0) goto LAB_00900912; } iVar18 = sprintf_s(local_228,0x200,(byte *)"No Entity Desyncs Detected \r\n"); (**(code **)(*piVar16 + 0x1c))(local_228,1,iVar18); KAGE_LogMessage(8,local_228); LAB_00900912: (**(code **)*piVar16)(1); ExceptionList = local_1c; return; } //@@ 00900940 FUN_00900940 void FUN_00900940(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_00900b90(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009009a0 FUN_009009a0 void FUN_009009a0(void) { FUN_00900b90(); return; } //@@ 009009c0 FUN_009009c0 void * FUN_009009c0(int param_1,undefined4 param_2) { uint uVar1; void *pvVar2; int iVar3; void *pvVar4; int iVar5; void *pvVar6; void *ptr; int *in_ECX; uint uVar7; int extraout_ECX; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0819d; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *in_ECX; iVar5 = in_ECX[1] - iVar3 >> 3; if (iVar5 == 0x1fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar5 + 1; uVar7 = in_ECX[2] - iVar3 >> 3; if (0x1fffffff - (uVar7 >> 1) < uVar7) { local_20 = 0x1fffffff; } else { uVar7 = (uVar7 >> 1) + uVar7; local_20 = uVar1; if (uVar1 <= uVar7) { local_20 = uVar7; } if (0x1fffffff < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar6 = std::_Allocate(local_20 << 3); local_8 = 0; pvVar2 = (void *)((int)pvVar6 + (param_1 - iVar3 >> 3) * 8); FUN_008ef1d0(param_2); iVar3 = in_ECX[1]; iVar5 = *in_ECX; if (param_1 == iVar3) { local_8 = CONCAT31(local_8._1_3_,1); for (; iVar5 != iVar3; iVar5 = iVar5 + 8) { FUN_008ef1d0(iVar5); param_1 = extraout_ECX; } FUN_00900b90(param_1); } else { FUN_00900c10(iVar5,param_1,pvVar6); FUN_00900c10(param_1,in_ECX[1],(int)pvVar2 + 8); } if (*in_ECX != 0) { FUN_00900b90(*in_ECX); pvVar4 = (void *)*in_ECX; uVar7 = in_ECX[2] - (int)pvVar4 & 0xfffffff8; ptr = pvVar4; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar4 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)pvVar6; in_ECX[1] = (int)((int)pvVar6 + uVar1 * 8); in_ECX[2] = (int)((int)pvVar6 + local_20 * 8); ExceptionList = local_10; return pvVar2; } //@@ 00900b5e Catch_All@00900b5e void Catch_All_00900b5e(void) { int unaff_EBP; FUN_009009a0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x2c)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00900b90 FUN_00900b90 void FUN_00900b90(void) { void **ppvVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, in_ECX != in_EDX; in_ECX = in_ECX + 8) { local_8 = 0; if (((*(int **)(in_ECX + 4) != (int *)0x0) && (cVar2 = (**(code **)(**(int **)(in_ECX + 4) + 0xc))(uVar3), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(in_ECX); } ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 00900c10 FUN_00900c10 int FUN_00900c10(int param_1,int param_2,int param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b081cd; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 8) { FUN_008ef1d0(param_1); param_3 = param_3 + 8; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_00900b90(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 00900c90 FUN_00900c90 void FUN_00900c90(void) { FUN_00900b90(); return; } //@@ 00900ca0 net_input_frame_capture /* DB: ? ECX = a stack net input frame (lea ecx,[ebp-0x2c] in NetInputDevice::is_input_ready, only caller): skipped while console/pause/revive menu open; ORs 32 device actions (vtable +0x30) into a button mask (+4), quantizes axis pairs (vtable +0x38) to shorts *32767 (+6, +8, ...), Entity_Player::GetMouseAimTarget, is_any_player_restart_held */ void net_input_frame_capture(Entity_Player *param_1,int *param_2,int *param_3) { char cVar1; byte bVar2; uint uVar3; int in_ECX; uint uVar4; float10 fVar5; float fVar6; Vector local_20; code *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b081fd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if ((((g_game->_console == (Console)0x0) && ((g_game->_pauseScreen)._state == 0)) && (g_game->_revivePlayerMenu == 0)) && ((param_2[3] != 0 || ((*(int *)&g_manager[1]._gamestate.field_0x290 == 0 && (*(int *)&g_manager[1]._gamestate.field_0x2d8 < 1)))))) { is_any_player_restart_held(__security_cookie ^ (int)register0x00000010 - 4U); uVar4 = 0; do { uVar3 = FUN_00900f50(); if ((((g_game->_emoteMenuState == 0) || (uVar4 == 2)) || ((uVar4 == 3 || ((uVar4 == 0 || (uVar4 == 1)))))) && (uVar3 != 0xff)) { cVar1 = (**(code **)(*param_2 + 0x30))(uVar4); if (cVar1 != '\0') { *(ushort *)(in_ECX + 4) = *(ushort *)(in_ECX + 4) | (ushort)(1 << (uVar3 & 0x1f)); } } uVar4 = uVar4 + 1; } while (uVar4 < 0x20); local_20.y = *(float *)(*param_2 + 0x38); local_18 = (code *)local_20.y; fVar5 = (float10)(*(code *)local_20.y)(1); local_18 = (code *)(float)fVar5; fVar5 = (float10)(*(code *)local_20.y)(0); fVar6 = (float)((float10)1 + ((float10)(float)local_18 - fVar5)); if (fVar6 <= 0.0) { fVar6 = 0.0; } if (2.0 <= fVar6) { fVar6 = 2.0; } *(short *)(in_ECX + 6) = (short)(int)(fVar6 * 32767.0); local_20.y = *(float *)(*param_2 + 0x38); local_18 = (code *)local_20.y; fVar5 = (float10)(*(code *)local_20.y)(3); local_20.y = (float)fVar5; fVar5 = (float10)(*local_18)(2); fVar6 = (float)((float10)1 + ((float10)local_20.y - fVar5)); if (fVar6 <= 0.0) { fVar6 = 0.0; } if (2.0 <= fVar6) { fVar6 = 2.0; } *(short *)(in_ECX + 8) = (short)(int)(fVar6 * 32767.0); local_20.y = *(float *)(*param_2 + 0x38); local_18 = (code *)local_20.y; fVar5 = (float10)(*(code *)local_20.y)(5); local_20.y = (float)fVar5; fVar5 = (float10)(*local_18)(4); fVar6 = (float)((float10)1 + ((float10)local_20.y - fVar5)); if (fVar6 <= 0.0) { fVar6 = 0.0; } if (2.0 <= fVar6) { fVar6 = 2.0; } *(short *)(in_ECX + 10) = (short)(int)(fVar6 * 32767.0); local_20.y = *(float *)(*param_2 + 0x38); local_18 = (code *)local_20.y; fVar5 = (float10)(*(code *)local_20.y)(7); local_20.y = (float)fVar5; fVar5 = (float10)(*local_18)(6); local_20.x = 0.0; fVar6 = (float)((float10)1 + ((float10)local_20.y - fVar5)); local_20.y = 0.0; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (2.0 <= fVar6) { fVar6 = 2.0; } *(short *)(in_ECX + 0xc) = (short)(int)(fVar6 * 32767.0); if (param_1 != (Entity_Player *)0x0) { bVar2 = Entity_Player::GetMouseAimTarget(param_1,&local_20,1); if (bVar2 != 0) { *(byte *)(in_ECX + 0xf) = *(byte *)(in_ECX + 0xf) | 2; *(short *)(in_ECX + 10) = (short)(int)local_20.x; *(short *)(in_ECX + 0xc) = (short)(int)local_20.y; } } if ((g_manager->_optionsConfig)._jacobEsauControls == 1) { *(byte *)(in_ECX + 0xf) = *(byte *)(in_ECX + 0xf) | 1; } } local_8 = 1; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_2); } } ExceptionList = local_10; return; } //@@ 00900f50 FUN_00900f50 undefined4 FUN_00900f50(void) { undefined4 in_ECX; switch(in_ECX) { case 0: return 0; case 1: return 1; case 2: return 2; case 3: return 3; case 4: return 4; case 5: return 5; case 6: return 6; case 7: return 7; case 8: return 8; case 9: return 9; case 10: return 10; case 0xb: return 0xb; default: return 0xff; case 0xe: return 0xc; case 0x12: return 0xd; case 0x22: return 0xe; } } //@@ 00901030 FUN_00901030 void FUN_00901030(uint param_1) { int iVar1; void *ptr; undefined4 *in_ECX; iVar1 = in_ECX[1]; while ((iVar1 != 0 && (*(uint *)((int)*(void **)*in_ECX + 0x10) < param_1))) { ptr = std::_Tree::_Extract(in_ECX,*(void **)*in_ECX); operator_delete(ptr,0x24); iVar1 = in_ECX[1]; } return; } //@@ 00901070 FUN_00901070 void FUN_00901070(uint *param_1) { uint uVar1; undefined4 uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; undefined4 *newNode; void *ptr; undefined4 *in_ECX; uint uVar8; uint uVar9; uint uVar10; uint uVar11; void *local_38; int local_34; void *local_30; undefined4 local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0822d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; uVar3 = *param_1; uVar4 = param_1[1]; uVar5 = param_1[2]; uVar6 = param_1[3]; uVar1 = *param_1; uVar8 = uVar3; uVar9 = uVar4; uVar10 = uVar5; uVar11 = uVar6; local_24 = uVar1; _Find_lower_bound<>(&local_38,&local_24); if ((*(char *)((int)local_30 + 0xd) != '\0') || (uVar1 < *(uint *)((int)local_30 + 0x10))) { if (in_ECX[1] == 0x71c71c7) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar7); } uVar2 = *in_ECX; local_14 = 0; local_28 = 0; newNode = operator_new(0x24); newNode[4] = local_24; newNode[5] = 0; newNode[6] = 0; newNode[7] = 0; newNode[8] = 0; newNode[6] = 0x7fff0000; newNode[7] = 0x7fff7fff; newNode[8] = 0x3c7fff; *newNode = uVar2; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; local_30 = std::_Tree::_Insert_node(in_ECX,local_38,local_34,newNode); uVar8 = uVar3; uVar9 = uVar4; uVar10 = uVar5; uVar11 = uVar6; } *(uint *)((int)local_30 + 0x14) = uVar8; *(uint *)((int)local_30 + 0x18) = uVar9; *(uint *)((int)local_30 + 0x1c) = uVar10; *(uint *)((int)local_30 + 0x20) = uVar11; if ((uint)in_ECX[2] < (uint)in_ECX[1]) { do { ptr = std::_Tree::_Extract(in_ECX,*(void **)*in_ECX); operator_delete(ptr,0x24); } while ((uint)in_ECX[2] < (uint)in_ECX[1]); } ExceptionList = local_1c; return; } //@@ 00901190 FUN_00901190 int FUN_00901190(uint param_1) { uint uVar1; uint uVar2; int *newNode; int iVar3; int *in_ECX; void *local_38; int local_34; void *local_30; undefined4 local_28; void *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0825d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; _Find_lower_bound<>(&local_38,¶m_1); uVar1 = param_1; if (((*(char *)((int)local_30 + 0xd) == '\0') && (*(uint *)((int)local_30 + 0x10) <= param_1)) && (local_24 = (void *)*in_ECX, local_30 != local_24)) { _Find_lower_bound<>(&local_38,¶m_1); if ((*(char *)((int)local_30 + 0xd) != '\0') || (uVar1 < *(uint *)((int)local_30 + 0x10))) { if (in_ECX[1] == 0x71c71c7) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } local_14 = 0; local_28 = 0; newNode = operator_new(0x24); newNode[4] = param_1; newNode[5] = 0; newNode[6] = 0; newNode[7] = 0; newNode[8] = 0; newNode[6] = 0x7fff0000; newNode[7] = 0x7fff7fff; newNode[8] = 0x3c7fff; *newNode = (int)local_24; newNode[1] = (int)local_24; newNode[2] = (int)local_24; *(undefined2 *)(newNode + 3) = 0; local_30 = std::_Tree::_Insert_node(in_ECX,local_38,local_34,newNode); } iVar3 = (int)local_30 + 0x14; } else { iVar3 = 0; } ExceptionList = local_1c; return iVar3; } //@@ 009012b0 FUN_009012b0 int * FUN_009012b0(void) { char cVar1; int *piVar2; int iVar3; int iVar4; int *piVar5; undefined4 *in_ECX; piVar2 = (int *)*in_ECX; if (*(char *)((int)piVar2 + 0xd) != '\0') { return (int *)(piVar2[2] + 0x10); } iVar3 = *piVar2; if (*(char *)(iVar3 + 0xd) == '\0') { cVar1 = *(char *)(*(int *)(iVar3 + 8) + 0xd); iVar4 = *(int *)(iVar3 + 8); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar4 + 8) + 0xd); iVar3 = iVar4; iVar4 = *(int *)(iVar4 + 8); } return (int *)(iVar3 + 0x10); } cVar1 = *(char *)(piVar2[1] + 0xd); piVar5 = (int *)piVar2[1]; while ((cVar1 == '\0' && (piVar2 == (int *)*piVar5))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar2 = piVar5; piVar5 = (int *)piVar5[1]; } if (*(char *)((int)piVar2 + 0xd) != '\0') { piVar5 = piVar2; } return piVar5 + 4; } //@@ 00901310 std::vector<16byte>::_Emplace_reallocate /* DB: element size 0x10, max 0xfffffff, grows x1.5, copies 4 dwords; NetplayManager::send_remove_frame, NpcHelper::hush_fly_shape_build */ undefined4 * std::vector<16byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 *param_2) { int iVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 *puVar6; int iVar7; uint uVar8; undefined4 *puVar9; undefined4 *puVar10; int *in_ECX; uint uVar11; undefined4 *puVar12; undefined4 *puVar13; undefined4 *puVar14; uint uVar15; undefined4 *puVar16; puVar14 = param_1; iVar1 = *in_ECX; uVar15 = (int)param_1 - iVar1; iVar7 = in_ECX[1] - iVar1 >> 4; if (iVar7 == 0xfffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar8 = iVar7 + 1; uVar11 = in_ECX[2] - iVar1 >> 4; if (0xfffffff - (uVar11 >> 1) < uVar11) { param_1 = (undefined4 *)0xfffffff; } else { uVar11 = (uVar11 >> 1) + uVar11; param_1 = (undefined4 *)uVar8; if (uVar8 <= uVar11) { param_1 = (undefined4 *)uVar11; } if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar9 = _Allocate((int)param_1 << 4); puVar16 = (undefined4 *)((uVar15 & 0xfffffff0) + (int)puVar9); uVar2 = param_2[1]; uVar3 = param_2[2]; uVar4 = param_2[3]; *puVar16 = *param_2; puVar16[1] = uVar2; puVar16[2] = uVar3; puVar16[3] = uVar4; puVar13 = (undefined4 *)in_ECX[1]; puVar12 = (undefined4 *)*in_ECX; puVar6 = puVar9; if (puVar14 == puVar13) { for (; puVar12 != puVar13; puVar12 = puVar12 + 4) { uVar2 = puVar12[1]; uVar3 = puVar12[2]; uVar4 = puVar12[3]; *puVar6 = *puVar12; puVar6[1] = uVar2; puVar6[2] = uVar3; puVar6[3] = uVar4; puVar6 = puVar6 + 4; } } else { puVar10 = puVar9; puVar6 = puVar16; if (puVar12 != puVar14) { do { uVar2 = *puVar12; uVar3 = puVar12[1]; uVar4 = puVar12[2]; uVar5 = puVar12[3]; puVar12 = puVar12 + 4; *puVar10 = uVar2; puVar10[1] = uVar3; puVar10[2] = uVar4; puVar10[3] = uVar5; puVar10 = puVar10 + 4; } while (puVar12 != puVar14); puVar13 = (undefined4 *)in_ECX[1]; } for (; puVar14 != puVar13; puVar14 = puVar14 + 4) { uVar2 = puVar14[1]; uVar3 = puVar14[2]; uVar4 = puVar14[3]; puVar6[4] = *puVar14; puVar6[5] = uVar2; puVar6[6] = uVar3; puVar6[7] = uVar4; puVar6 = puVar6 + 4; } } FUN_007de290(puVar9,uVar8,param_1); return puVar16; } //@@ 00901410 FID_conflict:_Erase_tree_>_> /* Library Function - Multiple Matches With Different Base Names public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) public: void __thiscall std::_Tree_val >::_Erase_tree_and_orphan > >(class fuzzer::fuzzer_allocator > &,struct std::_Tree_node *) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Erase_tree_>_> (void *this,fuzzer_allocator_> *param_1, _Tree_node *param_2) { _Tree_node _Var1; _Tree_node *p_Var2; _Var1 = param_2[0xd]; while (_Var1 == (_Tree_node)0x0) { FID_conflict__Erase_tree_>_> (this,param_1,*(_Tree_node **)(param_2 + 8)); p_Var2 = *(_Tree_node **)param_2; operator_delete(param_2,0x24); param_2 = p_Var2; _Var1 = p_Var2[0xd]; } return; } //@@ 00901450 FUN_00901450 void FUN_00901450(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x24); } return; } //@@ 00901470 FUN_00901470 void FUN_00901470(void) { int in_ECX; /* WARNING: Could not recover jumptable at 0x0090147c. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)(in_ECX + 0x370) + 4))(); return; } //@@ 00901480 FUN_00901480 undefined4 FUN_00901480(uint param_1) { int in_ECX; uint uVar1; uint uVar2; uVar2 = 1 << (param_1 & 0x1f); uVar1 = 0; if (0x1f < param_1) { uVar1 = uVar2; } uVar2 = uVar2 ^ uVar1; if (0x3f < param_1) { uVar1 = uVar2; } if ((uVar2 & *(uint *)(in_ECX + 0x380)) == 0 && (uVar1 & *(uint *)(in_ECX + 900)) == 0) { return 0; } return 1; } //@@ 009014c0 FUN_009014c0 undefined4 FUN_009014c0(uint param_1) { int in_ECX; uint uVar1; uint uVar2; uVar2 = 1 << (param_1 & 0x1f); uVar1 = 0; if (0x1f < param_1) { uVar1 = uVar2; } uVar2 = uVar2 ^ uVar1; if (0x3f < param_1) { uVar1 = uVar2; } if ((uVar2 & *(uint *)(in_ECX + 0x388)) == 0 && (uVar1 & *(uint *)(in_ECX + 0x38c)) == 0) { return 0; } return 1; } //@@ 00901500 FUN_00901500 void FUN_00901500(uint param_1) { int in_ECX; uint uVar1; uint uVar2; uVar1 = 1 << (param_1 & 0x1f); uVar2 = 0; if (0x1f < param_1) { uVar2 = uVar1; } uVar1 = uVar1 ^ uVar2; if (0x3f < param_1) { uVar2 = uVar1; } *(uint *)(in_ECX + 0x380) = *(uint *)(in_ECX + 0x380) | uVar1; *(uint *)(in_ECX + 900) = *(uint *)(in_ECX + 900) | uVar2; return; } //@@ 00901530 FUN_00901530 void FUN_00901530(byte param_1) { uint uVar1; int in_ECX; uVar1 = ~(1 << (param_1 & 0x1f)); *(uint *)(in_ECX + 0x388) = *(uint *)(in_ECX + 0x388) & uVar1; *(uint *)(in_ECX + 0x38c) = *(uint *)(in_ECX + 0x38c) & (int)uVar1 >> 0x1f; return; } //@@ 00901560 FUN_00901560 undefined4 FUN_00901560(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(in_ECX + 0x380) | *(uint *)(in_ECX + 900); if (uVar1 == 0) { return 0; } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 00901580 FUN_00901580 undefined4 FUN_00901580(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(in_ECX + 0x388) | *(uint *)(in_ECX + 0x38c); if (uVar1 == 0) { return 0; } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 009015a0 FUN_009015a0 float10 FUN_009015a0(void) { return (float10)0; } //@@ 009015b0 NetInputDevice::NetInputDevice /* DB: constructor: sets IsaacRepentancePlus::NetInputDevice::vftable at +0, UserProfile at +0x370, SmartPointer +0x378, std::map/list heads; base ctor FUN_00a1e050; only caller FUN_006f6500 (allocates it per remote player) */ void NetInputDevice::NetInputDevice(int param_1) { undefined4 *this; undefined4 *puVar1; void *pvVar2; undefined4 *puVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b082e1; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00a1e050(__security_cookie ^ (int)register0x00000010 - 4U); *in_ECX = IsaacRepentancePlus::NetInputDevice::vftable; in_ECX[0xdc] = KAGE::System::UserProfileBase::vftable; in_ECX[0xdd] = *(undefined4 *)(param_1 + 4); in_ECX[0xdc] = KAGE::System::UserProfile::vftable; local_8 = 1; KAGE::SmartPointer::SmartPointer(in_ECX + 0xde); local_8._0_1_ = 2; in_ECX[0xe5] = 0; in_ECX[0xe4] = 0; in_ECX[0xe7] = 0; in_ECX[0xe6] = 0; in_ECX[0xe8] = 0; in_ECX[0xe9] = 0; pvVar2 = operator_new(0x24); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; in_ECX[0xe8] = pvVar2; in_ECX[0xea] = 0xffff; this = in_ECX + 0xeb; local_8._0_1_ = 3; *this = 0; in_ECX[0xec] = 0; pvVar2 = operator_new(0x24); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *this = pvVar2; in_ECX[0xed] = 0xffff; local_8._0_1_ = 4; in_ECX[0xef] = 0; in_ECX[0xf0] = 0; in_ECX[0xf2] = 0; in_ECX[0xf3] = 0; pvVar2 = operator_new(0x10); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; in_ECX[0xf2] = pvVar2; *(undefined1 *)(in_ECX + 0xf5) = 0; in_ECX[0xf6] = 0; in_ECX[0xf7] = 0; in_ECX[0xf8] = 0; local_8 = CONCAT31(local_8._1_3_,6); puVar1 = in_ECX + 0xf9; *puVar1 = 0; in_ECX[0xfa] = 0; in_ECX[0xfb] = 0; in_ECX[0xfc] = 0; in_ECX[0xfd] = 0; puVar3 = operator_new(8); puVar3[1] = 0; *puVar1 = puVar3; *puVar3 = puVar1; FUN_00901b70(); *(ushort *)(in_ECX + 2) = *(ushort *)(in_ECX + 2) | 1; in_ECX[0xed] = 0x3c; if (0x3c < (uint)in_ECX[0xec]) { do { pvVar2 = std::_Tree::_Extract(this,*(void **)*this); operator_delete(pvVar2,0x24); } while ((uint)in_ECX[0xed] < (uint)in_ECX[0xec]); } ExceptionList = local_10; return; } //@@ 009017c0 FUN_009017c0 void FUN_009017c0(byte param_1) { undefined4 *puVar1; void *pvVar2; char cVar3; uint uVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar2 = (void *)in_ECX[0xef]; *in_ECX = IsaacRepentancePlus::NetInputDevice::vftable; if (pvVar2 != (void *)0x0) { FUN_0041c7d0(uVar4); operator_delete(pvVar2,0x18); in_ECX[0xef] = 0; } FUN_00902dc0(); pvVar2 = (void *)in_ECX[0xf9]; in_ECX[0xf9] = 0; operator_delete(pvVar2,8); std::vector::_Tidy(); FUN_0042c780(); puVar1 = in_ECX + 0xeb; FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(in_ECX[0xeb] + 4)); operator_delete((void *)*puVar1,0x24); puVar1 = in_ECX + 0xe8; FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(in_ECX[0xe8] + 4)); operator_delete((void *)*puVar1,0x24); local_8 = 0; if ((int *)in_ECX[0xdf] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[0xdf] + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(in_ECX + 0xde); } } in_ECX[0xdc] = KAGE::System::UserProfileBase::vftable; *in_ECX = KAGE::Input::InputDeviceBase::vftable; FUN_00a1e2c0(); FUN_004b3950(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x3f8); } ExceptionList = local_10; return; } //@@ 00901910 FUN_00901910 void FUN_00901910(void) { int *in_ECX; FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x24); return; } //@@ 00901930 NetInputDevice::NetInputDevice /* DB: constructor: sets IsaacRepentancePlus::NetInputDevice::vftable, UserProfile member, SmartPointer from InputManager::get_device(userId), ring/map of 0x3c input frames (std::_Tree::_Extract trimming); caller FUN_006f6500 (adds remote players: 'Failed to find input device for UserId %llu') */ undefined4 * NetInputDevice::NetInputDevice(int param_1) { char cVar1; void *pvVar2; undefined4 *puVar3; undefined4 *in_ECX; undefined4 extraout_ECX; int *this; undefined4 *puVar4; undefined1 local_20 [4]; int *local_1c; undefined4 *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08377; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = in_ECX; FUN_00a1e050(__security_cookie ^ (uint)(local_20 + 0x1c)); *in_ECX = IsaacRepentancePlus::NetInputDevice::vftable; in_ECX[0xdd] = 0; in_ECX[0xdc] = KAGE::System::UserProfile::vftable; local_8 = 1; KAGE::SmartPointer::SmartPointer(extraout_ECX); local_8._0_1_ = 2; puVar3 = in_ECX + 0xe8; in_ECX[0xe5] = 0; in_ECX[0xe4] = 0; in_ECX[0xe7] = 0; in_ECX[0xe6] = 0; *puVar3 = 0; in_ECX[0xe9] = 0; local_1c = puVar3; pvVar2 = operator_new(0x24); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *puVar3 = pvVar2; in_ECX[0xea] = 0xffff; this = in_ECX + 0xeb; local_8._0_1_ = 3; *this = 0; in_ECX[0xec] = 0; local_1c = this; pvVar2 = operator_new(0x24); puVar3 = local_18; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *this = (int)pvVar2; in_ECX[0xed] = 0xffff; local_8._0_1_ = 4; local_18[0xef] = 0; local_18[0xf2] = 0; local_18[0xf3] = 0; pvVar2 = operator_new(0x10); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; puVar3[0xf2] = pvVar2; *(undefined1 *)(puVar3 + 0xf5) = 0; puVar3[0xf6] = 0; puVar3[0xf7] = 0; puVar3[0xf8] = 0; puVar4 = puVar3 + 0xf9; local_8._0_1_ = 6; *puVar4 = 0; puVar3[0xfa] = 0; puVar3[0xfb] = 0; puVar3[0xfc] = 0; puVar3[0xfd] = 0; puVar3 = operator_new(8); puVar3[1] = 0; *puVar4 = puVar3; *puVar3 = puVar4; local_8._0_1_ = 7; FUN_00901b70(); *(ushort *)(local_18 + 2) = *(ushort *)(local_18 + 2) | 1; pvVar2 = InputManager::get_device(&PTR_vftable_00c57b18,local_20,param_1); local_8._0_1_ = 8; FUN_00902e80(pvVar2); local_8 = CONCAT31(local_8._1_3_,9); if (local_1c != (int *)0x0) { cVar1 = (**(code **)(*local_1c + 0xc))(); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_20); } } in_ECX[0xed] = 0x3c; if (0x3c < (uint)in_ECX[0xec]) { do { pvVar2 = std::_Tree::_Extract(this,*(void **)*this); operator_delete(pvVar2,0x24); } while ((uint)in_ECX[0xed] < (uint)in_ECX[0xec]); } ExceptionList = local_10; return local_18; } //@@ 00901b70 FUN_00901b70 void FUN_00901b70(void) { int *this; void *ptr; int iVar1; char *pcVar2; int in_ECX; char *this_00; *(undefined4 *)(in_ECX + 0x380) = 0; *(undefined4 *)(in_ECX + 900) = 0; *(undefined4 *)(in_ECX + 0x388) = 0; *(undefined4 *)(in_ECX + 0x38c) = 0; *(undefined4 *)(in_ECX + 0x3c0) = 0; *(float *)(in_ECX + 0x390) = g_vectorZero.x; *(float *)(in_ECX + 0x394) = g_vectorZero.y; *(float *)(in_ECX + 0x398) = g_vectorZero.x; *(float *)(in_ECX + 0x39c) = g_vectorZero.y; ptr = *(void **)(in_ECX + 0x3bc); *(undefined4 *)(in_ECX + 0x3c4) = 0x3c; *(undefined4 *)(in_ECX + 0x3d0) = 0; *(undefined1 *)(in_ECX + 0x3d4) = 0; if (ptr != (void *)0x0) { FUN_0041c7d0(); operator_delete(ptr,0x18); *(undefined4 *)(in_ECX + 0x3bc) = 0; } iVar1 = *(int *)(in_ECX + 0x3a0); FID_conflict__Erase_tree_>_> ((void *)(in_ECX + 0x3a0),(void *)(in_ECX + 0x3a0), *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0x3a4) = 0; this = (int *)(in_ECX + 0x3ac); iVar1 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0x3b0) = 0; pcVar2 = *(char **)(in_ECX + 0x3dc); this_00 = *(char **)(in_ECX + 0x3d8); if (this_00 != pcVar2) { do { std::string::_Tidy_deallocate(this_00); this_00 = this_00 + 0x18; } while (this_00 != pcVar2); this_00 = *(char **)(in_ECX + 0x3d8); } *(char **)(in_ECX + 0x3dc) = this_00; FUN_00902dc0(); return; } //@@ 00901cb0 NetInputDevice::is_input_ready /* DB: ? ECX=net input device next to NetInputDevice::ProcessInputMessage 00902010: checks +8 flag, connection vtable +0x14 at +0x370, keeps a <=30 entry std::list ("list too long") of timestamps at +0x3c8, returns bool; from NetplayManager::try_advance_frame per peer */ undefined1 NetInputDevice::is_input_ready(undefined1 param_1,int *param_2) { int iVar1; undefined4 *puVar2; char cVar3; int *piVar4; undefined4 uVar5; int *piVar6; int iVar7; int in_ECX; uint uVar8; Manager *pMVar9; undefined1 uVar10; int iVar11; undefined8 uVar12; undefined4 in_stack_ffffffb4; undefined4 uVar13; int local_30; undefined4 local_2c; int *local_28; undefined4 local_24; undefined1 local_20 [4]; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b083b5; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if ((*(byte *)(in_ECX + 8) & 1) == 0) { uVar10 = 1; goto LAB_00901fc3; } cVar3 = (**(code **)(*(int *)(in_ECX + 0x370) + 0x14)) (__security_cookie ^ (uint)(local_20 + 0x1c)); if (cVar3 == '\0') { piVar4 = (int *)FUN_00a29fd0(local_20,in_ECX + 0x370); iVar7 = *piVar4; local_8._0_1_ = 1; if (((local_1c != (int *)0x0) && (cVar3 = (**(code **)(*local_1c + 0xc))(), cVar3 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(local_20); } local_8 = (uint)local_8._1_3_ << 8; if (iVar7 != 0) { piVar4 = (int *)(in_ECX + 0x3c8); local_18 = FUN_00a58670(); iVar7 = *piVar4; if (*(int *)(in_ECX + 0x3cc) == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8._0_1_ = 2; local_24 = 0; local_28 = piVar4; piVar6 = operator_new(0x10); *(undefined8 *)(piVar6 + 2) = local_18; local_8 = (uint)local_8._1_3_ << 8; *(int *)(in_ECX + 0x3cc) = *(int *)(in_ECX + 0x3cc) + 1; puVar2 = *(undefined4 **)(iVar7 + 4); *piVar6 = iVar7; piVar6[1] = (int)puVar2; *(int **)(iVar7 + 4) = piVar6; *puVar2 = piVar6; uVar8 = *(uint *)(in_ECX + 0x3cc); while (0x1e < uVar8) { piVar6 = *(int **)*piVar4; iVar7 = *piVar6; *(int *)(in_ECX + 0x3cc) = *(int *)(in_ECX + 0x3cc) + -1; *(int *)piVar6[1] = iVar7; *(int *)(iVar7 + 4) = piVar6[1]; operator_delete(piVar6,0x10); uVar8 = *(uint *)(in_ECX + 0x3cc); } } LAB_00901f19: pMVar9 = g_manager; } else { iVar7 = *(int *)(in_ECX + 0x3a4); if (iVar7 == 0) { uVar8 = g_manager[1]._state; pMVar9 = g_manager; } else { local_18._4_4_ = *(undefined4 *)(in_ECX + 0x3a0); uVar12 = FUN_009012b0(); uVar8 = *(int *)uVar12 + 1; pMVar9 = (Manager *)((ulonglong)uVar12 >> 0x20); } local_18 = CONCAT44(local_18._4_4_,(undefined4)local_18); if (uVar8 <= (uint)(pMVar9[1]._previousState + pMVar9[1]._state)) { local_18 = CONCAT44(local_18._4_4_,(undefined4)local_18); if (g_game != (Game *)0x0) { iVar11 = *(int *)(in_ECX + 0x378); local_18._4_4_ = 0x3c; if (iVar11 != 0) { iVar1 = *(int *)&pMVar9[1]._gamestate.field_0x92c; if (iVar1 == 0x3c) { if ((*(int *)&pMVar9[1]._gamestate.field_0x290 != 0) || (0 < *(int *)&pMVar9[1]._gamestate.field_0x2d8)) { local_18._4_4_ = 0x15; } } else { *(undefined4 *)&pMVar9[1]._gamestate.field_0x92c = 0x3c; iVar7 = *(int *)(in_ECX + 0x3a4); iVar11 = *(int *)(in_ECX + 0x378); local_18._4_4_ = iVar1; } } if (iVar7 == 0) { local_30 = pMVar9[1]._state; } else { local_18._0_4_ = *(undefined4 *)(in_ECX + 0x3a0); piVar4 = (int *)FUN_009012b0(); local_30 = *piVar4 + 1; } local_2c = 0x7fff0000; local_28 = (int *)0x7fff7fff; local_24 = (uint)CONCAT12((char)local_18._4_4_,0x7fff); if (iVar11 != 0) { uVar13 = 0x901dfa; uVar5 = FUN_004253d0(); FUN_00902d60(in_ECX + 0x378); net_input_frame_capture(uVar5,in_stack_ffffffb4,uVar13); } iVar7 = local_30; FUN_00901070(&local_30); FUN_00901070(&local_30); broadcast_frame_input(iVar7); goto LAB_00901f19; } } } FUN_00901030(pMVar9[1]._state); FUN_00901030(g_manager[1]._state + -5); if (*(char *)&g_manager[1]._persistentGameData == '\0') { iVar7 = 0; } else { iVar7 = g_manager[1]._previousState; } if (*(int *)(in_ECX + 0x3a4) == 0) { uVar8 = g_manager[1]._state; pMVar9 = g_manager; } else { local_18._0_4_ = *(undefined4 *)(in_ECX + 0x3a0); uVar12 = FUN_009012b0(); uVar8 = *(int *)uVar12 + 1; pMVar9 = (Manager *)((ulonglong)uVar12 >> 0x20); } if ((uint)(pMVar9[1]._state + iVar7) < uVar8) { iVar7 = FUN_00901190(pMVar9[1]._state); if (((iVar7 != 0) && (((*(ushort *)(iVar7 + 4) & 0x4000) == 0 || (*(int *)(in_ECX + 0x3f4) != 0)))) && (iVar7 != 0)) { uVar10 = 1; goto LAB_00901fc3; } } uVar10 = 0; LAB_00901fc3: local_8 = 3; if (param_2 != (int *)0x0) { cVar3 = (**(code **)(*param_2 + 0xc))(); if ((cVar3 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(¶m_1); } } ExceptionList = local_10; return uVar10; } //@@ 00902010 NetInputDevice::ProcessInputMessage /* DB: log strings "NetInputDevice::ProcessInputMessage - CHECKSUM MISMATCH!", "Dropping input packet for frame we already have"; called from NetplayManager::Update */ undefined1 NetInputDevice::ProcessInputMessage(int param_1,int *param_2) { int iVar1; char cVar2; uint uVar3; void *ptr; undefined1 uVar4; int iVar5; char *format; undefined **local_68; int local_64; int local_60; void *local_5c; void *local_58; int local_54; int local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined **local_40; int local_3c; byte local_38; uint local_34; int local_30; uint local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; uint local_1c; uint local_18; undefined1 local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b083f5; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (*(char *)(*(int *)(**(int **)(param_1 + 8) + 0x14) + 5) != '\x01') { KAGE_LogMessage(0x10,(byte *)"Specified message is not an input message"); } iVar5 = param_1; if (*(int *)(param_1 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar1 = param_1; iVar5 = *(int *)(**(int **)(iVar5 + 8) + 0x18) + -8; if (*(int *)(param_1 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } local_50 = *(int *)(**(int **)(iVar1 + 8) + 0x14) + 8; local_5c = (void *)0x0; local_54 = 0; local_44 = 0; local_48 = 0; local_4c = 0; local_58 = (void *)0x0; local_68 = KAGE::Filesys::BufferedStream::vftable; local_40 = KAGE::Filesys::BufferedStream::vftable; local_8 = CONCAT31(local_8._1_3_,1); local_30 = 1; local_3c = 0; local_38 = 0; local_34 = 0xfedcba76; local_1c = 0; local_64 = iVar5; local_60 = iVar5; KAGE::Filesys::BufferedStream::read(&local_68,&local_1c,4,1); local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,4,1); } else { (*(code *)local_40[5])(&local_18,4,1,uVar3); } local_28 = local_18; local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,4,1); } else { (*(code *)local_40[5])(&local_18); } uVar3 = local_18; local_24 = local_18; local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,4,1); } else { (*(code *)local_40[5])(&local_18); } local_20 = local_18; if (uVar3 != 0) { FUN_0090d4a0(&local_28); } Checksum::Update(&local_3c,(byte *)&local_28,0xc); local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,4,1); } else { (*(code *)local_40[5])(&local_18); } uVar3 = local_18; local_2c = local_18; local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,2,1); } else { (*(code *)local_40[5])(&local_18); } local_28 = CONCAT22(local_28._2_2_,(undefined2)local_18); local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,2,1); } else { (*(code *)local_40[5])(&local_18); } local_28 = CONCAT22((undefined2)local_18,(undefined2)local_28); local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,2,1); } else { (*(code *)local_40[5])(&local_18); } local_24 = CONCAT22(local_24._2_2_,(undefined2)local_18); local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,2,1); } else { (*(code *)local_40[5])(&local_18); } local_24 = CONCAT22((undefined2)local_18,(undefined2)local_24); local_18 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_18,2,1); } else { (*(code *)local_40[5])(&local_18); } local_20 = CONCAT22(local_20._2_2_,(undefined2)local_18); local_11 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_11,1,1); } else { (*(code *)local_40[5])(&local_11); } local_20._0_3_ = CONCAT12(local_11,(undefined2)local_20); local_11 = 0; if ((code *)local_40[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_68,&local_11,1,1); } else { (*(code *)local_40[5])(&local_11); } local_20 = CONCAT13(local_11,(undefined3)local_20); Checksum::Update(&local_3c,(byte *)&local_2c,0x10); if (uVar3 < (uint)g_manager[1]._state) { format = "NetInputDevice::ProcessInputMessage - Dropping input packet outside of match scope. Received Frame: %d, Current Frame: %d\n" ; LAB_0090244d: KAGE_LogMessage(1,(byte *)format); } else { iVar5 = FUN_00901190(uVar3); if (iVar5 == 0) { if ((local_30 == 0) && (local_38 != 0)) { if (local_38 < 4) { memset((void *)((int)&local_3c + (uint)local_38),0,(uint)(byte)(4 - local_38)); } uVar3 = local_34 * -0x80000000 + (local_34 >> 1) + local_3c; } else { uVar3 = local_34; } if (uVar3 == local_1c) { FUN_00901070(&local_2c); FUN_00901070(&local_2c); uVar4 = 1; goto LAB_00902459; } format = "NetInputDevice::ProcessInputMessage - CHECKSUM MISMATCH! Expected: %08x, Received: %08x\n"; goto LAB_0090244d; } KAGE_LogMessage(1,(byte *) "NetInputDevice::ProcessInputMessage - Dropping input packet for frame we already have. Frame: %d\n" ); } uVar4 = 0; LAB_00902459: local_8 = local_8 & 0xffffff00; local_40 = KAGE::Filesys::StreamBase::vftable; local_68 = KAGE::Filesys::BufferedStreamBase::vftable; local_64 = 0; local_60 = 0; local_58 = local_5c; local_50 = 0; local_4c = 0; local_48 = 0; local_44 = 0; if (local_5c != (void *)0x0) { uVar3 = local_54 - (int)local_5c; ptr = local_5c; if (0xfff < uVar3) { ptr = *(void **)((int)local_5c + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_5c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); local_58 = (void *)0x0; local_54 = 0; } local_8 = 2; if (param_2 != (int *)0x0) { local_5c = local_58; cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } } ExceptionList = local_10; return uVar4; } //@@ 00902530 FUN_00902530 undefined4 FUN_00902530(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; undefined4 uVar4; undefined8 uVar5; undefined1 local_38 [4]; int *local_34; undefined4 local_30; int iStack_2c; int local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b08420; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; uVar4 = 2; if (g_multiplayerService == (void *)0x0) { puStack_20 = local_38 + 0x34; KAGE::SmartPointer::SmartPointer(0); } else { iVar1 = *(int *)(in_ECX + 0x374); if (iVar1 == 0) { iStack_2c = 0; local_30 = 0; } else { local_30 = *(undefined4 *)(iVar1 + 8); iStack_2c = *(undefined4 *)(iVar1 + 0xc); } NetworkManager::get_peer(g_multiplayerService,&local_28,(ulonglong *)&local_30); } iStack_2c = local_28; local_14 = 0; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(uVar3), cVar2 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(&local_28); } local_14 = 0xffffffff; if (iStack_2c != 0) { FUN_00a29fd0(local_38,in_ECX + 0x370); uVar5 = FUN_00a58670(); local_24 = (int *)uVar5; _local_30 = CONCAT44((int)((ulonglong)uVar5 >> 0x20),local_30); local_14 = 1; if (local_34 != (int *)0x0) { cVar2 = (**(code **)(*local_34 + 0xc))(); if ((cVar2 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(local_38); } uVar5 = CONCAT44(iStack_2c,local_24); } if ((int)((ulonglong)uVar5 >> 0x20) == 0) { if ((uint)uVar5 < 0x40) { uVar4 = 0; } else if ((uint)uVar5 < 0x80) { uVar4 = 1; } } if (0x39 < *(int *)(in_ECX + 0x3c4)) { ExceptionList = local_1c; return uVar4; } } ExceptionList = local_1c; return 2; } //@@ 009026a0 FUN_009026a0 float10 FUN_009026a0(float param_1) { char cVar1; int *in_ECX; float fVar2; switch(param_1) { case 0.0: fVar2 = -(float)in_ECX[0xe4]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 1.4013e-45: fVar2 = (float)in_ECX[0xe4]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 2.8026e-45: fVar2 = -(float)in_ECX[0xe5]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 4.2039e-45: fVar2 = (float)in_ECX[0xe5]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 5.60519e-45: LAB_00902768: fVar2 = -(float)in_ECX[0xe6]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 7.00649e-45: LAB_0090278b: fVar2 = (float)in_ECX[0xe6]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 8.40779e-45: LAB_009027b1: fVar2 = -(float)in_ECX[0xe7]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; case 9.80909e-45: LAB_009027d4: fVar2 = (float)in_ECX[0xe7]; if (fVar2 <= 0.0) { fVar2 = 0.0; } return (float10)fVar2; } if ((char)in_ECX[0xf5] != '\0') { switch(param_1) { case 5.60519e-45: goto LAB_00902768; case 7.00649e-45: goto LAB_0090278b; case 8.40779e-45: goto LAB_009027b1; case 9.80909e-45: goto LAB_009027d4; } } cVar1 = (**(code **)(*in_ECX + 0x30))(param_1); param_1 = 1.0; if (cVar1 == '\0') { param_1 = 0.0; } return (float10)param_1; } //@@ 00902850 FUN_00902850 void FUN_00902850(undefined4 param_1,uint param_2) { int in_ECX; switch(param_1) { case 0: *(uint *)(in_ECX + 0x390) = param_2 ^ 0x80000000; return; case 1: *(uint *)(in_ECX + 0x390) = param_2; return; case 2: *(uint *)(in_ECX + 0x394) = param_2 ^ 0x80000000; return; case 3: *(uint *)(in_ECX + 0x394) = param_2; return; case 4: *(uint *)(in_ECX + 0x398) = param_2 ^ 0x80000000; return; case 5: *(uint *)(in_ECX + 0x398) = param_2; return; case 6: *(uint *)(in_ECX + 0x39c) = param_2 ^ 0x80000000; return; case 7: *(uint *)(in_ECX + 0x39c) = param_2; } return; } //@@ 00902930 FUN_00902930 void FUN_00902930(void) { int in_ECX; if (*(int *)(in_ECX + 0x378) != 0) { FUN_00a1f010(); } return; } //@@ 00902950 NetInputDevice::broadcast_frame_input /* DB: log "NetInputDevice::broadcast_frame_input should only be called on the local player", "Attempting to create a message when there is no multiplayer service"; Checksum::Update, NetplayManager::send_message; callers NetInputDevice::is_input_ready (00901cb0) and NightmareScene::Show */ void NetInputDevice::broadcast_frame_input(undefined4 param_1) { undefined8 uVar1; undefined8 *puVar2; Manager *pMVar3; byte *data; char cVar4; int in_ECX; void *this; int extraout_ECX; uint *puVar5; uint uVar6; undefined4 uVar7; undefined4 uVar8; void *messageRefCount; undefined1 local_80 [4]; void *local_7c; uint *local_74; uint *local_68; int local_58; int local_54; byte local_50; uint local_4c; int local_48; undefined8 local_44; undefined4 local_3c; undefined1 local_38 [4]; int *local_34; byte *local_2c; undefined4 local_28; byte local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b08455; local_1c = ExceptionList; ExceptionList = &local_1c; cVar4 = (**(code **)(*(int *)(in_ECX + 0x370) + 0x14)) (__security_cookie ^ (uint)(local_38 + 0x28)); if (cVar4 == '\0') { KAGE_LogMessage(0x10,(byte *) "NetInputDevice::broadcast_frame_input should only be called on the local player" ); } if (*(int *)&g_manager[1]._persistentGameData.field_0x20 != 0) { local_2c = (byte *)(*(int *)&g_manager[1]._persistentGameData.field_0x20 + *(int *)&g_manager[1]._persistentGameData.field_0x1c); if (g_manager[1]._state - 1U <= **(uint **)(*(int *)&g_manager[1]._persistentGameData.field_0x14 + (*(int *)&g_manager[1]._persistentGameData.field_0x18 - 1U & (uint)(local_2c + -1)) * 4)) { puVar2 = *(undefined8 **) (*(int *)&g_manager[1]._persistentGameData.field_0x14 + (*(int *)&g_manager[1]._persistentGameData.field_0x18 - 1U & (uint)(local_2c + -1)) * 4); uVar1 = *puVar2; uVar7 = *(undefined4 *)(puVar2 + 1); local_44._4_4_ = (undefined4)((ulonglong)uVar1 >> 0x20); uVar8 = local_44._4_4_; local_44 = uVar1; goto LAB_00902a25; } } uVar8 = 0; local_44 = 0; uVar7 = 0; LAB_00902a25: local_3c = uVar7; local_2c = (byte *)FUN_00901190(param_1); if (local_2c != (byte *)0x0) { KAGE::Filesys::BufferedStream::BufferedStream(local_80,0); local_14 = 0; local_48 = 1; local_54 = 0; local_50 = 0; local_4c = 0xfedcba76; local_28 = 0; (**(code **)(local_58 + 0x1c))(&local_28,4,1); local_28 = (undefined4)local_44; (**(code **)(local_58 + 0x1c))(&local_28,4,1); local_28 = uVar8; (**(code **)(local_58 + 0x1c))(&local_28,4,1); local_28 = uVar7; (**(code **)(local_58 + 0x1c))(&local_28,4,1); data = local_2c; local_2c = *(byte **)local_2c; (**(code **)(local_58 + 0x1c))(&local_2c,4,1); local_2c = (byte *)(uint)*(ushort *)(data + 4); (**(code **)(local_58 + 0x1c))(&local_2c,2,1); local_2c = (byte *)(uint)*(ushort *)(data + 6); (**(code **)(local_58 + 0x1c))(&local_2c,2,1); local_2c = (byte *)(uint)*(ushort *)(data + 8); (**(code **)(local_58 + 0x1c))(&local_2c,2,1); local_2c = (byte *)(uint)*(ushort *)(data + 10); (**(code **)(local_58 + 0x1c))(&local_2c,2,1); local_2c = (byte *)(uint)*(ushort *)(data + 0xc); (**(code **)(local_58 + 0x1c))(&local_2c,2,1); local_21 = data[0xe]; (**(code **)(local_58 + 0x1c))(&local_21,1,1); local_21 = data[0xf]; (**(code **)(local_58 + 0x1c))(&local_21,1,1); Checksum::Update(&local_54,(byte *)&local_44,0xc); Checksum::Update(this,data,0x10); if ((local_48 == 0) && (local_50 != 0)) { if (local_50 < 4) { memset((void *)(extraout_ECX + (uint)local_50),0,(uint)(byte)(4 - local_50)); } uVar6 = local_4c * -0x80000000 + (local_4c >> 1) + local_54; } else { uVar6 = local_4c; } puVar5 = local_74; if (local_68 != (uint *)0x0) { puVar5 = local_68; } *puVar5 = uVar6; puVar5 = local_74; if (local_68 != (uint *)0x0) { puVar5 = local_68; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = (void *)0x1; NetConnection::send_message(g_multiplayerService,local_38,1,puVar5,(uint)local_7c,1); pMVar3 = g_manager; local_14._0_1_ = 1; FUN_008ef1d0(local_38); NetplayManager::send_message(&pMVar3->_netplayManager,8,local_7c,messageRefCount); local_14 = CONCAT31(local_14._1_3_,2); if (local_34 != (int *)0x0) { cVar4 = (**(code **)(*local_34 + 0xc))(); if ((cVar4 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_38); } } FUN_00a58200(); } ExceptionList = local_1c; return; } //@@ 00902c90 FUN_00902c90 void FUN_00902c90(void) { void *ptr; undefined4 *in_ECX; FUN_00902dc0(); ptr = (void *)*in_ECX; *in_ECX = 0; operator_delete(ptr,8); return; } //@@ 00902cb0 KAGE::SmartPointer::SmartPointer /* DB: default ctor: zeroes ECX, wraps null in a new ReferenceCount (0x18), releases old via g_inputDeviceRelease; same shape as 00a28790; InputManager::get_device */ void KAGE::SmartPointer::SmartPointer(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } } in_ECX[1] = this; *in_ECX = 0; ExceptionList = local_10; return; } //@@ 00902d60 FUN_00902d60 void FUN_00902d60(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 00902dc0 FUN_00902dc0 void FUN_00902dc0(void) { void *pvVar1; void *ptr; int in_ECX; int iVar2; uint size; iVar2 = *(int *)(in_ECX + 0x10); do { if (iVar2 == 0) goto LAB_00902e02; std::vector::_Tidy(); iVar2 = *(int *)(in_ECX + 0x10) + -1; *(int *)(in_ECX + 0x10) = iVar2; } while (iVar2 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; LAB_00902e02: iVar2 = *(int *)(in_ECX + 8); while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(*(int *)(in_ECX + 4) + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x10); } } pvVar1 = *(void **)(in_ECX + 4); if (pvVar1 != (void *)0x0) { size = *(int *)(in_ECX + 8) * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 00902e80 FUN_00902e80 void FUN_00902e80(undefined4 param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_00902d60(param_1); uVar1 = puVar4[1]; puVar4[1] = in_ECX[1]; in_ECX[1] = uVar1; uVar1 = *puVar4; *puVar4 = *in_ECX; *in_ECX = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_1c); } } ExceptionList = local_10; return; } //@@ 00902f10 FUN_00902f10 void FUN_00902f10(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 00902fb0 FUN_00902fb0 void FUN_00902fb0(int param_1) { *(uint *)(param_1 + 0x14) = *(uint *)(param_1 + 0x14) & 0xfffff9ff | 0x800; return; } //@@ 00902fd0 FUN_00902fd0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00902fd0(void) { byte local_410 [1028]; uint local_c; local_c = __security_cookie ^ (uint)local_410; sprintf(local_410,(byte *)"online_logs/desyncs/"); online_logs_prune(10); sprintf(local_410,(byte *)"online_logs/sessions/"); online_logs_prune(0x1e); return; } //@@ 00903040 FUN_00903040 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00903040(undefined4 param_1,undefined4 param_2,int param_3,int param_4) { code *pcVar1; int *piVar2; undefined4 uVar3; int iVar4; byte *pbVar5; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08490; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; sprintf(local_414,(byte *)"%s/online_logs/sessions/%s/persistentgamedata%d_begin.dat"); PersistentGameData::write_file(local_414); sprintf(local_414,(byte *)"%s/online_logs/sessions/%s/persistentgamedata%d_end.dat"); PersistentGameData::write_file(local_414); sprintf(local_414,(byte *)"%s/online_logs/sessions/%s/sharedsave_begin.dat"); piVar2 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_414,0); if (piVar2 != (int *)0x0) { pcVar1 = *(code **)(*piVar2 + 0x1c); uVar3 = (**(code **)(*(int *)(param_3 + 0x48) + 4))(); iVar4 = *(int *)(param_3 + 0x38); if (iVar4 == 0) { iVar4 = *(int *)(param_3 + 0x2c); } (*pcVar1)(iVar4,1,uVar3); (**(code **)*piVar2)(1); } sprintf(local_414,(byte *)"%s/online_logs/sessions/%s/sharedsave_end.dat"); piVar2 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_414,0); if (piVar2 != (int *)0x0) { pcVar1 = *(code **)(*piVar2 + 0x1c); uVar3 = (**(code **)(*(int *)(param_4 + 0x48) + 4))(); iVar4 = *(int *)(param_4 + 0x38); if (iVar4 == 0) { iVar4 = *(int *)(param_4 + 0x2c); } (*pcVar1)(iVar4,1,uVar3); (**(code **)*piVar2)(1); } local_8 = 0; KAGE_LogMessage(1,(byte *)"Local user ID = %llu\n"); local_8 = 0xffffffff; KAGE_LogMessage(1,(byte *)"Shared save user ID = %llu\n"); KAGE_LogMessage(1,(byte *)"Shared save user ID = %llu\n"); KAGE_LogMessage(1,(byte *)"Shared save user ID = %llu\n"); KAGE_LogMessage(1,(byte *)"Shared save user ID = %llu\n"); sprintf(local_414,(byte *)"%s/online_logs/sessions/%s/log.txt"); if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(); pbVar5 = local_414; uVar3 = (**(code **)(*(int *)g_logFile + 0x38))(pbVar5); FUN_00a25130(uVar3,pbVar5); } ExceptionList = local_10; return 1; } //@@ 009032d0 NetDesyncHandler::save_desync_files /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? only caller NetDesyncHandler::Update: writes desync_log.txt (g_logFile flush), "Saving screenshot...", desync_shared_save.dat via SaveDataManager::open_file_write; next to write_desync_dump 009036b0 write_desync_dump void NetDesyncHandler::save_desync_files(void) { Manager *pMVar1; undefined4 *puVar2; undefined4 uVar3; int *piVar4; byte *path; int *piVar5; int iVar6; void *ptr; char *pcVar7; uint uVar8; uint local_70; char *local_6c; undefined4 local_5c; uint local_58; undefined8 local_54; char local_4c [4]; undefined2 local_48; undefined1 local_46; undefined4 local_44; uint local_40; char *local_3c; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_4c + 0x48; puStack_18 = &LAB_00b084f5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_4c + 0x3c); ExceptionList = &local_1c; builtin_strncpy(local_4c,"og.t",4); local_40 = 0xf; local_44 = 0xe; local_54 = 0x6c5f636e79736564; local_48 = 0x7478; local_46 = 0; local_14 = 0; puVar2 = (undefined4 *)online_log_make_path(1,local_24); local_14._0_1_ = 1; if (0xf < (uint)puVar2[5]) { puVar2 = (undefined4 *)*puVar2; } if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(); uVar3 = (**(code **)(*(int *)g_logFile + 0x38))(puVar2); FUN_00a25130(uVar3,puVar2); } local_14 = (uint)local_14._1_3_ << 8; if (0xf < local_28) { uVar8 = local_28 + 1; pcVar7 = local_3c; if (0xfff < uVar8) { pcVar7 = *(char **)((int)local_3c + -4); uVar8 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pcVar7))) goto LAB_00903402; } operator_delete(pcVar7,uVar8); } local_14 = -1; local_2c = 0; local_28 = 0xf; local_3c = (char *)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar8 = local_40 + 1; ptr = (void *)local_54; if (0xfff < uVar8) { ptr = *(void **)((int)(void *)local_54 + -4); uVar8 = local_40 + 0x24; if (0x1f < (uint)((int)(void *)local_54 + (-4 - (int)ptr))) { LAB_00903402: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar8); } uVar8 = *(uint *)&g_manager[1]._gamestate.field_0x228; pMVar1 = g_manager + 1; local_70 = uVar8; _Find_lower_bound<>(&local_48,&local_70); if (((*(char *)(local_40 + 0xd) == '\0') && (*(uint *)(local_40 + 0x10) <= uVar8)) && (local_40 != *(uint *)&(pMVar1->_persistentGameData).field_0x24)) { piVar4 = (int *)std::map::try_emplace(&local_44,&local_70); iVar6 = *piVar4; piVar4 = (int *)(iVar6 + 0x14); if ((piVar4 != (int *)0x0) && (*piVar4 != 0)) { local_6c = std::_Allocate(0x20); local_5c = 0x16; local_58 = 0x1f; builtin_strncpy(local_6c,"desync_shared_save.dat",0x17); local_14 = 2; path = (byte *)online_log_make_path(1); local_14._0_1_ = 3; if (0xf < *(uint *)(path + 0x14)) { path = *(byte **)path; } piVar5 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,path,0); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < local_28) { uVar8 = local_28 + 1; pcVar7 = local_3c; if (0xfff < uVar8) { pcVar7 = *(char **)((int)local_3c + -4); uVar8 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pcVar7))) goto LAB_00903558; } operator_delete(pcVar7,uVar8); } local_14 = -1; local_2c = 0; local_28 = 0xf; local_3c = (char *)((uint)local_3c & 0xffffff00); if (0xf < local_58) { uVar8 = local_58 + 1; pcVar7 = local_6c; if (0xfff < uVar8) { pcVar7 = *(char **)(local_6c + -4); uVar8 = local_58 + 0x24; if ((char *)0x1f < local_6c + (-4 - (int)pcVar7)) { LAB_00903558: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar7,uVar8); } if (piVar5 != (int *)0x0) { (**(code **)(*piVar5 + 0x1c))(*piVar4,*(undefined4 *)(iVar6 + 0x18),1); (**(code **)*piVar5)(1); } } } KAGE_LogMessage(1,(byte *)"Saving screenshot...\n"); local_3c = std::_Allocate(0x20); local_2c = 0x11; local_28 = 0x1f; builtin_strncpy(local_3c,"desync_screenshot",0x12); local_14 = 4; online_log_make_path(0); local_14._0_1_ = 5; save_screenshot(); local_14 = CONCAT31(local_14._1_3_,4); if (0xf < local_58) { uVar8 = local_58 + 1; pcVar7 = local_6c; if (0xfff < uVar8) { pcVar7 = *(char **)(local_6c + -4); uVar8 = local_58 + 0x24; if ((char *)0x1f < local_6c + (-4 - (int)pcVar7)) goto LAB_0090365d; } operator_delete(pcVar7,uVar8); } local_14 = 0xffffffff; local_5c = 0; local_58 = 0xf; local_6c = (char *)((uint)local_6c & 0xffffff00); if (0xf < local_28) { uVar8 = local_28 + 1; pcVar7 = local_3c; if (0xfff < uVar8) { pcVar7 = *(char **)(local_3c + -4); uVar8 = local_28 + 0x24; if ((char *)0x1f < local_3c + (-4 - (int)pcVar7)) { LAB_0090365d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar7,uVar8); } func_0x00904e70(); if ((g_multiplayerService != (void *)0x0) && (iVar6 = (*(code *)**(undefined4 **)g_multiplayerService)(), iVar6 != 1)) { func_0x009053f0(); } ExceptionList = local_1c; return; } //@@ 009036b0 write_desync_dump /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? console command handler 0x68cdc0 (reached from Isaac::ExecuteCommand) writes a netplay desync report: "Desync Frame", "Current Frame", "Application Address = 0x%llx", "Could not open file for writing" */ char * write_desync_dump(void) { byte bVar1; uint uVar2; int *piVar3; int iVar4; void *pvVar5; uint uVar6; byte *pbVar7; byte *in_ECX; char *pcVar8; uint uVar9; byte *pbVar10; char *pcVar11; basic_istream_> local_6e4 [16]; basic_ostream_> local_6d4 [160]; undefined1 local_634 [8]; int aiStack_62c [64]; int local_52c; undefined *local_528 [4]; undefined *local_518 [2]; undefined **local_510 [2]; basic_iostream_> local_508 [48]; undefined4 local_4d8; undefined4 local_4d4; basic_ios_> local_4c0 [72]; int local_478 [2]; int local_470 [2]; byte *local_468; undefined **local_464; uint local_460; uint local_45c; undefined4 local_458; undefined4 local_454; undefined4 local_450; void *local_44c; undefined4 local_448; uint local_444; undefined4 local_440; undefined **local_43c; uint local_438; byte *local_434; undefined4 local_430; int local_42c; uint local_428; void *local_424; int local_420; int local_41c; int *local_418; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08575; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; local_428 = 0; local_434 = in_ECX; local_14 = uVar2; piVar3 = FileSystem::Open(&PTR_vftable_00c37a10,in_ECX,(int *)0x0); if (piVar3 != (int *)0x0) { (**(code **)(*piVar3 + 0xc))(0,0,uVar2); iVar4 = (**(code **)(*piVar3 + 4))(); pvVar5 = operator_new_tracked(iVar4 + 1); local_424 = pvVar5; local_438 = (**(code **)(*piVar3 + 0x14))(pvVar5,iVar4,1); *(undefined1 *)(iVar4 + (int)pvVar5) = 0; (**(code **)*piVar3)(1); if (pvVar5 != (void *)0x0) { local_458 = 0; local_450 = 0; local_45c = local_438; local_460 = local_438; local_440 = 0; local_444 = 0; local_448 = 0; local_454 = 0; local_464 = KAGE::Filesys::BufferedStream::vftable; local_43c = KAGE::Filesys::BufferedStream::vftable; local_8 = 0; local_44c = pvVar5; piVar3 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_434,0); local_418 = piVar3; if (piVar3 == (int *)0x0) { pcVar11 = "Could not open file for writing"; local_8 = CONCAT31(local_8._1_3_,1); pvVar5 = local_424; } else { local_41c = 0; local_430 = 0; FUN_00904a00(); local_42c = 0; memset(local_634,0,0x10c); local_420 = local_52c; LAB_00903850: if ((code *)local_43c[2] == FUN_00a58260) { uVar2 = local_444; } else { uVar2 = (*(code *)local_43c[2])(); } if ((code *)local_43c[1] == FUN_00a58250) { uVar6 = local_460; } else { uVar6 = (*(code *)local_43c[1])(); } if (uVar6 <= uVar2) { (**(code **)*piVar3)(1); pcVar11 = (char *)0x0; pvVar5 = local_424; goto LAB_00903d19; } if ((code *)local_43c[2] == FUN_00a58260) { uVar2 = local_444; } else { uVar2 = (*(code *)local_43c[2])(); } if ((code *)local_43c[5] == memory_stream_read) { uVar6 = KAGE::Filesys::BufferedStream::read(&local_464,&DAT_00c94a90,1,0x1000); } else { uVar6 = (*(code *)local_43c[5])(); } uVar9 = 0; if (uVar6 != 0) { while (uVar9 < 0x3ff) { bVar1 = (&DAT_00c94a90)[uVar9]; local_414[uVar9] = bVar1; if (((bVar1 == 0) || (uVar9 = uVar9 + 1, bVar1 == 10)) || (uVar6 <= uVar9)) break; } } local_468 = local_414 + uVar9; *local_468 = 0; if (uVar2 + uVar9 <= uVar2 + uVar6) { uVar6 = uVar9; } if ((code *)local_43c[3] == KAGE::Filesys::BufferedStream::seek_base2) { KAGE::Filesys::BufferedStream::seek(uVar6 + uVar2,0); } else { (*(code *)local_43c[3])(uVar6 + uVar2,0); } pcVar11 = strstr((char *)local_414,"Application Address"); if (pcVar11 == (char *)0x0) { if ((((uVar9 == 0) || (local_414[0] == 0x2a)) || ((local_414[0] == 10 || ((pcVar11 = strstr((char *)local_414,"Current Frame"), pcVar11 != (char *)0x0 || (pcVar11 = strstr((char *)local_414,"Desync Frame"), pcVar11 != (char *)0x0)))))) || (pcVar11 = strstr((char *)local_414,"Application Version"), iVar4 = local_42c, pcVar11 != (char *)0x0)) { if (local_420 != 0) { NetLogging::format_callstack(local_41c,local_430); memset(local_634,0,0x10c); local_420 = local_52c; } piVar3 = local_418; (**(code **)(*local_418 + 0x1c))(local_414,1,uVar9); } else { if (local_42c == 0) { pcVar11 = "Application start address not found"; goto LAB_00903cc2; } pbVar7 = local_468 + -1; pbVar10 = pbVar7; if (local_414 < pbVar7) { do { if (*pbVar10 == 0x28) break; pbVar10 = pbVar10 + -1; } while (local_414 < pbVar10); } for (; (pbVar10 + 3 < pbVar7 && (*pbVar7 != 0x29)); pbVar7 = pbVar7 + -1) { } *pbVar7 = 0; std_stringstream_constructor(local_414); local_8._0_1_ = 5; std::basic_ostream_>::operator<<(local_6d4,FUN_00902fb0); FUN_00414b50(); std::basic_istream_>::operator>> (local_6e4,(__uint64 *)local_478); aiStack_62c[local_420] = (local_478[0] - iVar4) + local_41c; local_52c = local_52c + 1; local_8 = (uint)local_8._1_3_ << 8; local_420 = local_52c; FUN_0040d480(); piVar3 = local_418; } goto LAB_00903850; } pcVar11 = strchr((char *)local_414,0x3d); if (pcVar11 != (char *)0x0) { pcVar11 = pcVar11 + 4; do { pcVar8 = pcVar11; pcVar11 = pcVar8 + 1; } while (*pcVar8 != '\0'); *pcVar8 = '\0'; local_528[0] = &DAT_00b1b17c; local_518[0] = &DAT_00b1b174; std::basic_ios_>::basic_ios_> (local_4c0); local_8 = CONCAT31(local_8._1_3_,2); local_428 = local_428 | 1; std::basic_iostream_>:: basic_iostream_> ((basic_iostream_> *)local_528, (basic_streambuf_> *)local_510); local_8 = 3; *(undefined ***)((int)local_528 + *(int *)(local_528[0] + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)((int)aiStack_62c + *(int *)(local_528[0] + 4) + 0x100) = *(int *)(local_528[0] + 4) + -0x68; std::basic_streambuf_>:: basic_streambuf_> ((basic_streambuf_> *)local_510); local_510[0] = std::basic_stringbuf,std::allocator_>:: vftable; local_4d8 = 0; local_4d4 = 0; local_8._0_1_ = 4; std::basic_ostream_>::operator<< ((basic_ostream_> *)local_518,FUN_00902fb0); FUN_00414b50(); std::basic_istream_>::operator>> ((basic_istream_> *)local_528,(__uint64 *)local_470) ; local_42c = local_470[0]; sprintf(local_414,(byte *)"Application Address = 0x%llx\n\n"); piVar3 = local_418; (**(code **)(*local_418 + 0x1c))(local_414,1,uVar9); local_8 = (uint)local_8._1_3_ << 8; *(undefined ***)((int)local_528 + *(int *)(local_528[0] + 4)) = std::basic_stringstream,std::allocator_>::vftable; *(int *)((int)aiStack_62c + *(int *)(local_528[0] + 4) + 0x100) = *(int *)(local_528[0] + 4) + -0x68; std::basic_stringbuf::~basic_stringbuf(); std::basic_iostream_>:: ~basic_iostream_>(local_508); std::basic_ios_>::~basic_ios_> (local_4c0); goto LAB_00903850; } pcVar11 = "Application start address couldn\'t be processed"; LAB_00903cc2: (**(code **)*local_418)(1); piVar3 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_434,0); pvVar5 = local_424; if (piVar3 != (int *)0x0) { (**(code **)(*piVar3 + 0x1c))(local_424,1,local_438); (**(code **)*piVar3)(1); } LAB_00903d19: local_8 = CONCAT31(local_8._1_3_,6); } tracked_alloc(1,pvVar5,0); FUN_00a58200(); ExceptionList = local_10; return pcVar11; } } ExceptionList = local_10; return "Could not load input file"; } //@@ 00903d60 online_logs_prune /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? lists g_userDataDir/ (filesys_list_directory) with _time64 and DateTime, parses names (atoi) and deletes old ones (FUN_00a25560); called twice from FUN_00902fd0 with "online_logs/desyncs/" and "online_logs/sessions/" */ void online_logs_prune(int param_1) { uint *ptr; uint uVar1; uint uVar2; uint uVar3; void *pvVar4; int iVar5; int iVar6; tm *ptVar7; byte *pbVar8; undefined4 in_EDX; int iVar9; code *pcVar10; undefined4 *puVar11; __time64_t _Var12; byte isLowercase; byte isAppendSlash; int local_4e8; int local_4e4; byte local_4e0; __time64_t local_4d8; tm local_4d0; byte local_4a8 [1024]; char local_a8 [2]; char local_a6; undefined1 local_a5 [2]; char local_a3; undefined1 local_a2 [4]; char local_9e; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b085a0; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_24 = uVar3; _Var12 = _time64((__time64_t *)0x0); iVar9 = (int)((ulonglong)_Var12 >> 0x20); pvVar4 = (void *)filesys_list_directory(g_userDataDir,in_EDX,&local_4e8); local_4e4 = local_4e8; if (local_4e8 != 0) { puVar11 = (undefined4 *)((int)pvVar4 + 4); pcVar10 = atoi_exref; do { if ((*(byte *)(puVar11 + -1) & 2) != 0) { strcpy_s(local_a8,0x80,(char *)*puVar11); if (local_a6 == '_') { local_a6 = '\0'; local_4e8 = (*pcVar10)(local_a8,uVar3); if (local_a3 == '_') { local_a3 = '\0'; iVar5 = (*pcVar10)(local_a5); if (local_9e == '_') { local_9e = '\0'; iVar6 = (*pcVar10)(local_a2); DateTime::constructor(1); local_4e0 = local_4e0 | 2; local_4d0.tm_mon = local_4e8 + -1; local_4d0.tm_year = iVar6 + -0x76c; local_4d0.tm_mday = iVar5; local_4d8 = _mkgmtime64(&local_4d0); if ((local_4e0 & 3) != 0) { ptVar7 = _gmtime64(&local_4d8); local_4d0.tm_sec = ptVar7->tm_sec; local_4d0.tm_min = ptVar7->tm_min; local_4d0.tm_hour = ptVar7->tm_hour; local_4d0.tm_mday = ptVar7->tm_mday; local_4d0.tm_mon = ptVar7->tm_mon; local_4d0.tm_year = ptVar7->tm_year; local_4d0.tm_wday = ptVar7->tm_wday; local_4d0.tm_yday = ptVar7->tm_yday; local_4d0.tm_isdst = ptVar7->tm_isdst; } iVar5 = (int)((ulonglong)local_4d8 >> 0x20); local_4e0 = local_4e0 & 0xfc; uVar1 = (uint)((uint)_Var12 < (uint)local_4d8); uVar2 = iVar9 - iVar5; if ((-1 < (int)(uVar2 - uVar1)) && ((uVar2 != uVar1 && SBORROW4(iVar9,iVar5) == SBORROW4(uVar2,uVar1) || ((uint)(param_1 * 0x15180) < (uint)_Var12 - (uint)local_4d8)))) { sprintf(local_4a8,(byte *)"%s%s%s"); isAppendSlash = 0; isLowercase = 0; pbVar8 = (byte *)(**(code **)(PTR_vftable_00c5aa80 + 0x10))(); pbVar8 = path_join(local_4a8,pbVar8,isLowercase,isAppendSlash); (**(code **)(PTR_vftable_00c5aa80 + 0x28))(pbVar8); if (pbVar8 != (byte *)0x0) { local_14 = 0; tracked_alloc(1,pbVar8,0); local_14 = 0xffffffff; } } pcVar10 = atoi_exref; } } } } puVar11 = puVar11 + 2; local_4e4 = local_4e4 + -1; } while (local_4e4 != 0); local_4e4 = 0; } if (pvVar4 != (void *)0x0) { ptr = (uint *)((int)pvVar4 + -4); local_14 = 1; _eh_vector_destructor_iterator_(pvVar4,8,*ptr,FUN_00a5a420); operator_delete(ptr,*ptr * 8 + 4); } ExceptionList = local_1c; return; } //@@ 00904050 make_timestamp_string /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: sprintf_s(global,0x40,'%02d_%02d_%d__%02d_%02d_%02d'); caller 009047f0 online_log_make_path it to 'online_logs/desyncs/' */ int * make_timestamp_string(void) { undefined1 *puVar1; undefined1 *puVar2; byte bVar3; undefined2 *puVar4; void *pvVar5; undefined2 *_Size; char *pcVar6; char cVar7; uint uVar8; tm *ptVar9; byte ****ppppbVar10; byte *pbVar11; int *piVar12; uint uVar13; void *pvVar14; int *in_ECX; char *pcVar15; undefined2 *puVar16; undefined **ppuVar17; uint uVar18; undefined1 *puVar19; byte *pbVar20; uint uVar21; void *pvVar22; longlong lVar23; uint local_b0; uint local_ac; undefined4 local_a0; undefined4 local_9c; undefined1 local_98; undefined1 uStack_97; undefined1 uStack_96; undefined1 uStack_95; undefined1 uStack_94; undefined1 uStack_93; undefined1 uStack_92; undefined1 uStack_91; undefined1 uStack_90; undefined1 uStack_8f; undefined1 uStack_8e; undefined1 uStack_8d; undefined1 uStack_8c; undefined1 uStack_8b; undefined1 uStack_8a; undefined1 uStack_89; undefined2 local_88; undefined2 uStack_86; undefined2 uStack_84; undefined2 uStack_82; undefined2 uStack_80; undefined2 uStack_7e; undefined2 uStack_7c; undefined2 uStack_7a; int local_78; byte ****local_6c [4]; uint local_5c; uint local_58; undefined **local_4c; undefined **local_48; undefined4 local_44; byte local_40 [12]; undefined **local_34; undefined **local_30; undefined4 local_2c; byte local_28 [4]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_28 + 0x24; puStack_18 = &LAB_00b08627; local_1c = ExceptionList; uVar8 = __security_cookie ^ (uint)(local_28 + 0x18); ExceptionList = &local_1c; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0xf; *(undefined1 *)in_ECX = 0; local_14 = 0; local_a0 = *(undefined4 *)&g_manager[1]._persistentGameData.field_0x8; local_9c = *(undefined4 *)&g_manager[1]._persistentGameData.field_0xc; local_24 = uVar8; ptVar9 = _gmtime64((__time64_t *)&local_a0); local_98 = (undefined1)ptVar9->tm_sec; uStack_97 = *(undefined1 *)((int)&ptVar9->tm_sec + 1); uStack_96 = *(undefined1 *)((int)&ptVar9->tm_sec + 2); uStack_95 = *(undefined1 *)((int)&ptVar9->tm_sec + 3); uStack_94 = (undefined1)ptVar9->tm_min; uStack_93 = *(undefined1 *)((int)&ptVar9->tm_min + 1); uStack_92 = *(undefined1 *)((int)&ptVar9->tm_min + 2); uStack_91 = *(undefined1 *)((int)&ptVar9->tm_min + 3); uStack_90 = (undefined1)ptVar9->tm_hour; uStack_8f = *(undefined1 *)((int)&ptVar9->tm_hour + 1); uStack_8e = *(undefined1 *)((int)&ptVar9->tm_hour + 2); uStack_8d = *(undefined1 *)((int)&ptVar9->tm_hour + 3); uStack_8c = (undefined1)ptVar9->tm_mday; uStack_8b = *(undefined1 *)((int)&ptVar9->tm_mday + 1); uStack_8a = *(undefined1 *)((int)&ptVar9->tm_mday + 2); uStack_89 = *(undefined1 *)((int)&ptVar9->tm_mday + 3); local_88 = (undefined2)ptVar9->tm_mon; uStack_86 = *(undefined2 *)((int)&ptVar9->tm_mon + 2); uStack_84 = (undefined2)ptVar9->tm_year; uStack_82 = *(undefined2 *)((int)&ptVar9->tm_year + 2); uStack_80 = (undefined2)ptVar9->tm_wday; uStack_7e = *(undefined2 *)((int)&ptVar9->tm_wday + 2); uStack_7c = (undefined2)ptVar9->tm_yday; uStack_7a = *(undefined2 *)((int)&ptVar9->tm_yday + 2); local_78 = ptVar9->tm_isdst; sprintf_s(&DAT_00c82ba0,0x40,(byte *)"%02d_%02d_%d__%02d_%02d_%02d"); pcVar6 = &DAT_00c82ba0; do { pcVar15 = pcVar6; pcVar6 = pcVar15 + 1; } while (*pcVar15 != '\0'); std::string::append((char *)in_ECX,&DAT_00c82ba0,(uint)(pcVar15 + -0xc82ba0)); std::string::append((char *)in_ECX,&DAT_00b783d8,2); local_2c = g_userProfile; if (g_userProfile == (void *)0x0) { LAB_00904570: local_30 = KAGE::System::UserProfile::vftable; local_14 = 7; pbVar11 = (byte *)FUN_00a5f1c0(); pbVar20 = pbVar11; do { bVar3 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar3 != 0); std::string::append((char *)in_ECX,pbVar11,(int)pbVar20 - (int)(pbVar11 + 1)); local_14._0_1_ = 0; local_30 = KAGE::System::UserProfileBase::vftable; } else { lVar23 = __aullshr(uVar8); local_30 = (undefined **)((ulonglong)lVar23 >> 0x20); if (lVar23 != 0xfefefefe) goto LAB_00904570; local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 2; local_4c = local_30; local_48 = local_30; local_44 = local_30; local_2c = local_30; std::shared_ptr::assign(&local_30,&g_multiplayerLobbyPtr); local_34 = KAGE::Network::Multiplayer::Lobby::vftable; local_14._0_1_ = 3; KAGE::Network::Multiplayer::Lobby::get_members(&local_34,&local_4c,1); local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 4; if (((local_2c != (undefined **)0x0) && (cVar7 = (**(code **)(*local_2c + 0xc))(), cVar7 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_30); } local_14._0_1_ = 1; local_ac = 4; local_b0 = 0; uVar8 = (int)local_48 - (int)local_4c >> 3; ppuVar17 = local_4c; if (uVar8 != 0) { do { cVar7 = (**(code **)(*ppuVar17 + 0x14))(); if (cVar7 != '\0') { local_ac = local_b0; break; } local_b0 = local_b0 + 1; ppuVar17 = ppuVar17 + 2; } while (local_b0 < uVar8); } local_2c = (undefined **)in_ECX[4]; puVar4 = (undefined2 *)in_ECX[5]; if (local_2c < puVar4) { in_ECX[4] = (int)((int)local_2c + 1); piVar12 = in_ECX; if (&DAT_0000000f < puVar4) { piVar12 = (int *)*in_ECX; } *(undefined2 *)((int)piVar12 + (int)local_2c) = 0x50; } else { if (local_2c == (undefined **)0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } puVar1 = (undefined1 *)((int)local_2c + 1); puVar19 = (undefined1 *)((uint)puVar1 | 0xf); if (puVar19 < (undefined1 *)0x80000000) { if ((undefined2 *)(0x7fffffff - ((uint)puVar4 >> 1)) < puVar4) { puVar19 = (undefined1 *)0x7fffffff; } else { puVar2 = (undefined1 *)(((uint)puVar4 >> 1) + (int)puVar4); if (puVar19 < puVar2) { puVar19 = puVar2; } } } else { puVar19 = (undefined1 *)0x7fffffff; } pvVar14 = std::_Allocate((uint)(puVar19 + 1)); _Size = (undefined2 *)local_2c; in_ECX[4] = (int)puVar1; in_ECX[5] = (int)puVar19; puVar16 = (undefined2 *)((int)pvVar14 + (int)local_2c); local_2c = (undefined **)puVar16; if (puVar4 < (undefined2 *)0x10) { memcpy(pvVar14,in_ECX,(size_t)_Size); *puVar16 = 0x50; } else { pvVar5 = (void *)*in_ECX; memcpy(pvVar14,pvVar5,(size_t)_Size); puVar16 = (undefined2 *)((int)puVar4 + 1); *(undefined2 *)local_2c = 0x50; pvVar22 = pvVar5; if ((undefined2 *)0xfff < puVar16) { pvVar22 = *(void **)((int)pvVar5 + -4); puVar16 = puVar4 + 0x12; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)pvVar22))) goto LAB_009047a1; } operator_delete(pvVar22,(uint)puVar16); } *in_ECX = (int)pvVar14; } pbVar20 = local_28 + 1; if ((int)local_ac < 0) { local_ac = -local_ac; do { pbVar11 = pbVar20; pbVar20 = pbVar11 + -1; uVar8 = local_ac / 10; *pbVar20 = (char)local_ac + (char)uVar8 * -10 + 0x30; local_ac = uVar8; } while (uVar8 != 0); pbVar20 = pbVar11 + -2; *pbVar20 = 0x2d; } else { do { pbVar20 = pbVar20 + -1; uVar8 = local_ac / 10; *pbVar20 = (char)local_ac + (char)uVar8 * -10 + 0x30; local_ac = uVar8; } while (uVar8 != 0); } local_5c = 0; local_6c[0] = (byte ****)0x0; local_58 = 0xf; if (pbVar20 != local_28 + 1) { std::string::assign((char *)local_6c,pbVar20,(int)(local_28 + 1) - (int)pbVar20); } local_14._0_1_ = 5; ppppbVar10 = (byte ****)local_6c; if (0xf < local_58) { ppppbVar10 = local_6c[0]; } std::string::append((char *)in_ECX,(byte *)ppppbVar10,local_5c); local_14._0_1_ = 1; if (0xf < local_58) { uVar8 = local_58 + 1; ppppbVar10 = local_6c[0]; if (0xfff < uVar8) { ppppbVar10 = (byte ****)local_6c[0][-1]; uVar8 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)ppppbVar10))) goto LAB_009047a1; } operator_delete(ppppbVar10,uVar8); } local_14._0_1_ = 0; if (local_4c != (undefined **)0x0) { local_14 = 6; ppuVar17 = local_4c; if (local_4c != local_48) { do { (**(code **)*ppuVar17)(0); ppuVar17 = ppuVar17 + 2; } while (ppuVar17 != local_48); } local_14._0_1_ = 0; uVar8 = ((int)local_44 - (int)local_4c >> 3) * 8; ppuVar17 = local_4c; if (0xfff < uVar8) { ppuVar17 = (undefined **)local_4c[-1]; uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)local_4c + (-4 - (int)ppuVar17))) goto LAB_009047a1; } operator_delete(ppuVar17,uVar8); } } if (1 < *(int *)&g_manager[1]._gamestate.field_0x224) { std::string::append((char *)in_ECX,&DAT_00b783d4,2); pbVar20 = local_40 + 1; uVar8 = *(uint *)&g_manager[1]._gamestate.field_0x224; if ((int)uVar8 < 0) { uVar8 = -uVar8; do { pbVar11 = pbVar20; pbVar20 = pbVar11 + -1; uVar18 = uVar8 / 10; *pbVar20 = (char)uVar8 + (char)uVar18 * -10 + 0x30; uVar8 = uVar18; } while (uVar18 != 0); pbVar20 = pbVar11 + -2; *pbVar20 = 0x2d; } else { do { pbVar20 = pbVar20 + -1; uVar18 = uVar8 / 10; *pbVar20 = (char)uVar8 + (char)uVar18 * -10 + 0x30; uVar8 = uVar18; } while (uVar18 != 0); } local_5c = 0; local_6c[0] = (byte ****)0x0; local_58 = 0xf; if (pbVar20 != local_40 + 1) { std::string::assign((char *)local_6c,pbVar20,(int)(local_40 + 1) - (int)pbVar20); } local_14 = 8; ppppbVar10 = (byte ****)local_6c; if (0xf < local_58) { ppppbVar10 = local_6c[0]; } std::string::append((char *)in_ECX,(byte *)ppppbVar10,local_5c); local_14._0_1_ = 0; if (0xf < local_58) { uVar8 = local_58 + 1; ppppbVar10 = local_6c[0]; if (0xfff < uVar8) { ppppbVar10 = (byte ****)local_6c[0][-1]; uVar8 = local_58 + 0x24; if ((byte *)0x1f < (byte *)((int)local_6c[0] + (-4 - (int)ppppbVar10))) goto LAB_009047a1; } operator_delete(ppppbVar10,uVar8); } uVar8 = in_ECX[4]; uVar18 = in_ECX[5]; if (uVar8 < uVar18) { in_ECX[4] = uVar8 + 1; piVar12 = in_ECX; if (0xf < uVar18) { piVar12 = (int *)*in_ECX; } *(undefined2 *)((int)piVar12 + uVar8) = 0x29; } else { if (uVar8 == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } local_2c = (undefined **)(uVar8 + 1); uVar21 = (uint)local_2c | 0xf; if (uVar21 < 0x80000000) { if (0x7fffffff - (uVar18 >> 1) < uVar18) { uVar21 = 0x7fffffff; } else { uVar13 = (uVar18 >> 1) + uVar18; if (uVar21 < uVar13) { uVar21 = uVar13; } } } else { uVar21 = 0x7fffffff; } pvVar14 = std::_Allocate(uVar21 + 1); in_ECX[4] = (int)local_2c; in_ECX[5] = uVar21; puVar4 = (undefined2 *)((int)pvVar14 + uVar8); local_2c = (undefined **)puVar4; if (uVar18 < 0x10) { memcpy(pvVar14,in_ECX,uVar8); *puVar4 = 0x29; } else { pvVar5 = (void *)*in_ECX; memcpy(pvVar14,pvVar5,uVar8); uVar8 = uVar18 + 1; *(undefined2 *)local_2c = 0x29; pvVar22 = pvVar5; if (0xfff < uVar8) { pvVar22 = *(void **)((int)pvVar5 + -4); uVar8 = uVar18 + 0x24; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)pvVar22))) { LAB_009047a1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar22,uVar8); } *in_ECX = (int)pvVar14; } } ExceptionList = local_1c; return in_ECX; } //@@ 009047f0 online_log_make_path /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? builds (userDataDir if param_1) + "online_logs/desyncs/" + make_timestamp_string into ECX std::string; callers FUN_008ffc70, FUN_009032d0 */ void online_log_make_path(char param_1) { uint *puVar1; byte bVar2; uint _Size; void *_Src; uint uVar3; int *piVar4; uint uVar5; void *pvVar6; int *in_ECX; byte *pbVar7; byte *in_EDX; byte *pbVar8; uint uVar9; void *ptr; void *local_30; uint local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b08686; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; pbVar8 = g_userDataDir; if (param_1 == '\0') { pbVar8 = &s_empty; } *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0xf; *(undefined1 *)in_ECX = 0; pbVar7 = pbVar8; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); std::string::assign((char *)in_ECX,pbVar8,(int)pbVar7 - (int)(pbVar8 + 1)); local_8 = 0; std::string::append((char *)in_ECX,(byte *)"online_logs/desyncs/",0x14); pbVar8 = (byte *)make_timestamp_string(uVar3); local_8 = 1; puVar1 = (uint *)(pbVar8 + 0x10); if (0xf < *(uint *)(pbVar8 + 0x14)) { pbVar8 = *(byte **)pbVar8; } std::string::append((char *)in_ECX,pbVar8,*puVar1); local_8 = local_8 & 0xffffff00; if (0xf < local_1c) { uVar3 = local_1c + 1; pvVar6 = local_30; if (0xfff < uVar3) { pvVar6 = *(void **)((int)local_30 + -4); uVar3 = local_1c + 0x24; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar6))) goto LAB_009048dd; } operator_delete(pvVar6,uVar3); } uVar3 = in_ECX[5]; _Size = in_ECX[4]; if (_Size < uVar3) { in_ECX[4] = _Size + 1; piVar4 = in_ECX; if (0xf < uVar3) { piVar4 = (int *)*in_ECX; } *(undefined2 *)((int)piVar4 + _Size) = 0x2f; } else { if (_Size == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } uVar9 = _Size + 1 | 0xf; if (uVar9 < 0x80000000) { if (0x7fffffff - (uVar3 >> 1) < uVar3) { uVar9 = 0x7fffffff; } else { uVar5 = (uVar3 >> 1) + uVar3; if (uVar9 < uVar5) { uVar9 = uVar5; } } } else { uVar9 = 0x7fffffff; } pvVar6 = std::_Allocate(uVar9 + 1); in_ECX[5] = uVar9; in_ECX[4] = _Size + 1; if (uVar3 < 0x10) { memcpy(pvVar6,in_ECX,_Size); *(undefined2 *)((int)pvVar6 + _Size) = 0x2f; } else { _Src = (void *)*in_ECX; memcpy(pvVar6,_Src,_Size); uVar9 = uVar3 + 1; *(undefined2 *)((int)pvVar6 + _Size) = 0x2f; ptr = _Src; if (0xfff < uVar9) { ptr = *(void **)((int)_Src + -4); uVar9 = uVar3 + 0x24; if (0x1f < (uint)((int)_Src + (-4 - (int)ptr))) { LAB_009048dd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)pvVar6; } puVar1 = (uint *)(in_EDX + 0x10); if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } std::string::append((char *)in_ECX,in_EDX,*puVar1); ExceptionList = local_10; return; } //@@ 00904a00 FUN_00904a00 void FUN_00904a00(void) { HMODULE pHVar1; HANDLE pvVar2; int iVar3; int *in_ECX; int *in_EDX; int local_10; int local_c; pHVar1 = GetModuleHandleA((LPCSTR)0x0); pvVar2 = GetCurrentProcess(); iVar3 = K32GetModuleInformation(pvVar2,pHVar1,&local_10,0xc); if (iVar3 == 0) { *in_ECX = 0; *in_EDX = -1; return; } *in_ECX = local_10; *in_EDX = local_c + local_10; return; } //@@ 00904a60 NetLogging::format_callstack /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (frames, count) from write_desync_dump: SymSetOptions(0x14)/SymInitialize once (DAT_00c7f4c0), resolves each return address with SymFromAddr/line info, strstr strips "NetLogging::", appends " (0x%llx)\n" */ void NetLogging::format_callstack(uint param_1,uint param_2) { byte bVar1; HANDLE pvVar2; int iVar3; char *pcVar4; byte ****ppppbVar5; undefined4 ****ppppuVar6; byte *pbVar7; int in_EDX; uint uVar8; uint uVar9; uint uVar10; uint *puVar11; uint uVar12; undefined4 uVar13; undefined4 uVar14; undefined8 *puVar15; undefined4 *puVar16; undefined4 *puVar17; undefined4 local_1c4 [2]; uint local_1bc; byte *local_1b8; undefined8 local_1ac; int local_1a0; int *local_19c; undefined4 local_198; uint local_194; uint local_190; uint local_18c; undefined4 *local_188; uint *local_184; uint local_180; byte ****local_17c [4]; uint local_16c; uint local_168; undefined4 ****local_164 [4]; undefined4 local_154; uint local_150; byte local_14c [256]; byte local_4c [52]; byte local_18 [4]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = -1; puStack_c = &LAB_00b086cb; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; local_1a0 = in_EDX; if (DAT_00c7f4c0 == '\0') { SymSetOptions(0x14,local_14); uVar14 = 1; uVar13 = 0; pvVar2 = GetCurrentProcess(); SymInitialize(pvVar2,uVar13,uVar14); DAT_00c7f4c0 = '\x01'; } local_198 = 0; local_1ac = 0; local_188 = calloc(0x120,1); local_1c4[0] = 0x18; *local_188 = 0x20; local_188[6] = 0xff; local_180 = 0; if (*(int *)(in_EDX + 0x108) != 0) { local_184 = (uint *)(in_EDX + 8); local_190 = (int)param_1 >> 0x1f; local_194 = param_1; while( true ) { uVar10 = local_180; puVar11 = local_184; local_154 = 0; local_150 = 0xf; local_164[0] = (undefined4 ****)0x0; local_8 = 0; uVar9 = *local_184; uVar8 = (int)uVar9 >> 0x1f; local_18c = uVar8; if ((uVar8 < local_190) || ((uVar8 <= local_190 && (uVar9 < local_194)))) break; if (((uint)((int)param_2 >> 0x1f) < uVar8) || (((uint)((int)param_2 >> 0x1f) <= uVar8 && (param_2 < uVar9)))) break; puVar15 = &local_1ac; uVar12 = uVar9; puVar17 = local_188; pvVar2 = GetCurrentProcess(); iVar3 = SymGetSymFromAddr64(pvVar2,uVar12,uVar8,puVar15,puVar17); if (iVar3 == 0) { LAB_00904d70: sprintf(local_4c,(byte *)" (0x%llx)\n"); pbVar7 = local_4c; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::append((char *)local_164,local_4c,(int)pbVar7 - (int)(local_4c + 1)); ppppuVar6 = local_164; if (0xf < local_150) { ppppuVar6 = local_164[0]; } (**(code **)(*local_19c + 0x1c))(ppppuVar6,1,local_154); } else { iVar3 = UnDecorateSymbolName(local_188 + 7,local_14c,0x100,0); if (iVar3 == 0) goto LAB_00904d70; pcVar4 = strstr((char *)local_14c,"NetLogging::"); if (pcVar4 == (char *)0x0) { pbVar7 = local_14c; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::append((char *)local_164,local_14c,(int)pbVar7 - (int)(local_14c + 1)); puVar17 = local_1c4; puVar16 = &local_198; uVar8 = local_18c; pvVar2 = GetCurrentProcess(); iVar3 = SymGetLineFromAddr64(pvVar2,uVar9,uVar8,puVar16,puVar17); if (iVar3 != 0) { std::string::append((char *)local_164,&DAT_00b783bc,4); pbVar7 = local_1b8; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::append((char *)local_164,local_1b8,(int)pbVar7 - (int)(local_1b8 + 1)); std::string::append((char *)local_164,&DAT_00b66134,1); pbVar7 = local_18 + 1; uVar9 = local_1bc; do { pbVar7 = pbVar7 + -1; local_16c = uVar9 / 10; *pbVar7 = (char)uVar9 + (char)local_16c * -10 + 0x30; uVar9 = local_16c; } while (local_16c != 0); local_168 = 0xf; local_17c[0] = (byte ****)0x0; if (pbVar7 != local_18 + 1) { std::string::assign((char *)local_17c,pbVar7,(int)(local_18 + 1) - (int)pbVar7); } local_8._0_1_ = 1; ppppbVar5 = (byte ****)local_17c; if (0xf < local_168) { ppppbVar5 = local_17c[0]; } std::string::append((char *)local_164,(byte *)ppppbVar5,local_16c); local_8 = (uint)local_8._1_3_ << 8; if (0xf < local_168) { uVar9 = local_168 + 1; ppppbVar5 = local_17c[0]; if (0xfff < uVar9) { ppppbVar5 = (byte ****)local_17c[0][-1]; uVar9 = local_168 + 0x24; if ((byte *)0x1f < (byte *)((int)local_17c[0] + (-4 - (int)ppppbVar5))) goto LAB_00904e5d; } operator_delete(ppppbVar5,uVar9); } uVar10 = local_180; puVar11 = local_184; } goto LAB_00904d70; } } local_8 = -1; if (0xf < local_150) { uVar9 = local_150 + 1; ppppuVar6 = local_164[0]; if (0xfff < uVar9) { ppppuVar6 = (undefined4 ****)local_164[0][-1]; uVar9 = local_150 + 0x24; if (0x1f < (uint)((int)local_164[0] + (-4 - (int)ppppuVar6))) { LAB_00904e5d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar6,uVar9); } local_180 = uVar10 + 1; local_184 = puVar11 + 1; if (*(uint *)(local_1a0 + 0x108) <= local_180) break; } } free(local_188); ExceptionList = local_10; return; } //@@ 00905c80 FUN_00905c80 void FUN_00905c80(char *param_1) { int *piVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; int *piVar5; int iVar6; undefined4 *puVar7; int iVar8; char *pcVar9; uint local_8; iVar2 = curl_easy_init(); if (iVar2 == 0) { KAGE_LogMessage(8,(byte *)"Failed to initialize cURL\n"); if (param_1 == (char *)0x0) { return; } std::vector::_Tidy(); } else { uVar3 = curl_mime_init(iVar2); uVar4 = curl_mime_addpart(uVar3); curl_mime_name(uVar4,"sessionid"); pcVar9 = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { pcVar9 = *(char **)param_1; } curl_mime_data(uVar4,pcVar9,0xffffffff); piVar1 = (int *)(param_1 + 0x18); iVar6 = *piVar1; local_8 = 0; iVar8 = *(int *)(param_1 + 0x1c) - iVar6 >> 0x1f; if ((*(int *)(param_1 + 0x1c) - iVar6) / 0x18 + iVar8 != iVar8) { iVar8 = 0; do { piVar5 = (int *)(iVar8 + iVar6); if (0xf < *(uint *)(iVar8 + 0x14 + iVar6)) { piVar5 = (int *)*piVar5; } pcVar9 = "Appending file for upload: \"%s\"...\n"; uVar4 = 1; KAGE_LogMessage(1,(byte *)"Appending file for upload: \"%s\"...\n"); uVar4 = curl_mime_addpart(uVar3,uVar4,pcVar9,piVar5); curl_mime_name(uVar4,"sendfiles[]"); puVar7 = (undefined4 *)(*piVar1 + iVar8); if (0xf < (uint)puVar7[5]) { puVar7 = (undefined4 *)*puVar7; } curl_mime_filedata(uVar4,puVar7); iVar6 = *piVar1; local_8 = local_8 + 1; iVar8 = iVar8 + 0x18; } while (local_8 < (uint)((*(int *)(param_1 + 0x1c) - iVar6) / 0x18)); } curl_easy_setopt(iVar2,0x2751,"curl-ca-bundle.crt"); curl_easy_setopt(iVar2,0x2712,"https://isaactest.vgrnd.com/api-file-upload.php"); curl_easy_setopt(iVar2,0x281d,uVar3); iVar6 = curl_easy_perform(iVar2); if (iVar6 == 0) { KAGE_LogMessage(1,(byte *)"Successfully uploaded log files!\n"); } else { curl_easy_strerror(iVar6); KAGE_LogMessage(8,(byte *)"Failed to upload log files! error = %s\n"); } curl_mime_free(uVar3); curl_easy_cleanup(iVar2); std::vector::_Tidy(); } std::string::_Tidy_deallocate(param_1); operator_delete(param_1,0x24); return; } //@@ 00905e30 FUN_00905e30 void FUN_00905e30(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x114); } return; } //@@ 00905e50 FUN_00905e50 uint FUN_00905e50(int param_1,int param_2) { int *piVar1; int in_ECX; uint uVar2; uint uVar3; piVar1 = *(int **)(in_ECX + 0x14); uVar3 = 0; uVar2 = *(int *)(in_ECX + 0x18) - (int)piVar1 >> 3; if (uVar2 != 0) { do { if ((*piVar1 == param_1) && (piVar1[1] == param_2)) { return CONCAT31((int3)((uint)piVar1 >> 8),1); } uVar3 = uVar3 + 1; piVar1 = piVar1 + 2; } while (uVar3 < uVar2); } return (uint)piVar1 & 0xffffff00; } //@@ 00905ea0 FUN_00905ea0 undefined4 FUN_00905ea0(void) { Manager *pMVar1; byte bVar2; uint uVar3; int iVar4; ulonglong *in_ECX; pMVar1 = g_manager; bVar2 = NetplayManager::is_user_in_player_list(&g_manager->_netplayManager,*in_ECX); if (bVar2 == 0) { iVar4 = *(int *)(pMVar1 + 1) - (int)pMVar1->_netplayManager; return CONCAT31((int3)(iVar4 >> 10),(uint)(iVar4 >> 2) <= *(uint *)((int)in_ECX + 0xc)); } uVar3 = (*(int *)(pMVar1 + 1) - (int)pMVar1->_netplayManager >> 2) - 1; return CONCAT31((int3)(uVar3 >> 8),uVar3 <= *(uint *)((int)in_ECX + 0xc)); } //@@ 00905ef0 FUN_00905ef0 undefined4 * FUN_00905ef0(undefined4 *param_1) { int extraout_EAX; void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b087ed; local_10 = ExceptionList; ExceptionList = &local_10; *param_1 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(in_ECX); param_1[1] = extraout_EAX; local_8 = 0; *param_1 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(param_1); } ExceptionList = local_10; return param_1; } //@@ 00905f60 FUN_00905f60 void FUN_00905f60(undefined4 param_1) { char cVar1; ReferenceCountBase *this; undefined4 local_2c; ReferenceCountBase *local_28; uint uStack_24; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6694; local_10 = ExceptionList; uStack_24 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_2c = 0; local_28 = (ReferenceCountBase *)0x0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if (local_28 != (ReferenceCountBase *)0x0) { cVar1 = (**(code **)(*(int *)local_28 + 0xc))(); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_2c); } } local_2c = param_1; local_28 = this; FUN_00a20df0(); ExceptionList = local_10; return; } //@@ 00906020 FUN_00906020 void FUN_00906020(int param_1) { char cVar1; uint uVar2; undefined1 *outDevice; int index; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0881d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; index = *(int *)(param_1 + 0xc); outDevice = local_1c; InputManager::get_device(&PTR_vftable_00c57b18,outDevice,index); local_8 = 0; FUN_00902d60(local_1c); FUN_00a20eb0(outDevice,index); local_8 = 1; if (local_18 != (int *)0x0) { cVar1 = (**(code **)(*local_18 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_1c); } } ExceptionList = local_10; return; } //@@ 009060c0 FUN_009060c0 int FUN_009060c0(void) { Manager *pMVar1; byte bVar2; ulonglong *in_ECX; pMVar1 = g_manager; bVar2 = NetplayManager::is_user_in_player_list(&g_manager->_netplayManager,*in_ECX); if (bVar2 == 0) { return *(int *)(pMVar1 + 1) - (int)pMVar1->_netplayManager >> 2; } return (*(int *)(pMVar1 + 1) - (int)pMVar1->_netplayManager >> 2) + -1; } //@@ 00906100 FUN_00906100 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00906100(Entity_Player *param_1) { int iVar1; int *in_ECX; uint local_610; byte *local_60c; undefined4 local_608; undefined4 local_604; undefined1 local_600; undefined4 local_5fc; undefined4 local_5f8; GameStatePlayer local_5f4 [330]; undefined4 local_cc; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08850; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (param_1 == (Entity_Player *)0x0) { *in_ECX = 0x29; in_ECX[1] = 0; (**(code **)(in_ECX[2] + 4))(0,0xffffffff,local_14); ExceptionList = local_10; return; } *in_ECX = param_1->_playerType; in_ECX[1] = g_game->_stage; (**(code **)(in_ECX[2] + 4))(); local_60c = &s_empty; local_608 = 0; local_5f8 = 1; local_604 = 0; local_610 = -(uint)(in_ECX != (int *)0xfffffff8) & (uint)(in_ECX + 0xc); local_600 = 0; local_5fc = 0xfedcba76; input_state_reset(local_5f4); local_8 = 0; GameStatePlayer::Init(local_5f4); Entity_Player::StoreGameState(param_1,local_5f4,1); if (param_1->_backupPlayer != (void *)0x0) { local_cc = *(undefined4 *)((int)param_1->_backupPlayer + 0x13c0); } GameState::write_player(&local_610); iVar1 = *in_ECX; if (iVar1 != 0xb) { if (iVar1 == 0xc) { *in_ECX = 3; GameStatePlayer::~GameStatePlayer(local_5f4); ExceptionList = local_10; return; } if (iVar1 != 0x23) goto LAB_0090620f; } *in_ECX = 8; LAB_0090620f: GameStatePlayer::~GameStatePlayer(local_5f4); ExceptionList = local_10; return; } //@@ 00906260 SaveSlotManager::constructor /* DB: ? constructs a ~0x1c90-byte object: PersistentGameData at +0x5c, ANM2s at +0x10b4/+0x18e4/+0x1a18, KColor; called once from the manager constructor 00950610 Manager::constructor manager+0x4b3bc..) */ NetplayManager * SaveSlotManager::constructor(void) { NetplayManager *pNVar1; NetplayManager NVar2; NetplayManager *in_ECX; undefined4 uVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b08a31; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = (NetplayManager)0x0; in_ECX[1] = (NetplayManager)0x0; in_ECX[2] = (NetplayManager)0x0; local_8 = 0; pNVar1 = in_ECX + 10; in_ECX[3] = (NetplayManager)0x0; in_ECX[4] = (NetplayManager)0x3; in_ECX[5] = (NetplayManager)0x0; *(undefined1 *)(in_ECX + 6) = 0; in_ECX[8] = (NetplayManager)0x0; in_ECX[9] = (NetplayManager)0x0; *pNVar1 = (NetplayManager)0x0; in_ECX[0xb] = (NetplayManager)0x0; in_ECX[0xc] = (NetplayManager)0x0; in_ECX[0xd] = (NetplayManager)0x0; in_ECX[0xe] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(8); *(undefined4 *)((int)NVar2 + 4) = 0; *pNVar1 = NVar2; *(NetplayManager **)NVar2 = pNVar1; local_8._0_1_ = 1; in_ECX[0xf] = (NetplayManager)0x0; in_ECX[0x10] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0x1c); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0xf] = NVar2; in_ECX[0x11] = (NetplayManager)0x0; in_ECX[0x12] = (NetplayManager)0x0; in_ECX[0x13] = (NetplayManager)0x0; local_8._0_1_ = 3; *(undefined2 *)(in_ECX + 0x14) = 0x100; in_ECX[0x14].field_0x2 = 1; in_ECX[0x15] = (NetplayManager)0x0; in_ECX[0x16] = (NetplayManager)0xffffffff; PersistentGameData::constructor((PersistentGameData *)(in_ECX + 0x17)); local_8._0_1_ = 4; KAGE::Filesys::BufferedStream::BufferedStream(in_ECX + 0x3fb,0); local_8._0_1_ = 5; KAGE::Filesys::BufferedStream::BufferedStream(in_ECX + 0x40e,0); local_8._0_1_ = 6; (**(code **)((int)in_ECX[0x40e] + 8))(); (**(code **)((int)in_ECX[0x40e] + 4))(0,0xffffffff); in_ECX[0x406] = (NetplayManager)0x0; in_ECX[0x407] = (NetplayManager)0x0; in_ECX[0x408] = (NetplayManager)0x0; in_ECX[0x409] = (NetplayManager)0x0; in_ECX[0x40a] = (NetplayManager)0x0; in_ECX[0x40b] = (NetplayManager)0x0; in_ECX[0x40c] = (NetplayManager)0x0; in_ECX[0x40d] = (NetplayManager)0x0; local_8._0_1_ = 7; in_ECX[0x41a] = (NetplayManager)0x0; in_ECX[0x41b] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0xfa8); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x41a] = NVar2; local_8._0_1_ = 8; in_ECX[0x41c] = (NetplayManager)0x0; in_ECX[0x41d] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0xe8); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x41c] = NVar2; local_8._0_1_ = 9; pNVar1 = in_ECX + 0x41e; *pNVar1 = (NetplayManager)0x0; in_ECX[0x41f] = (NetplayManager)0x0; in_ECX[0x420] = (NetplayManager)0x0; in_ECX[0x421] = (NetplayManager)0x0; in_ECX[0x422] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(8); *(undefined4 *)((int)NVar2 + 4) = 0; *pNVar1 = NVar2; *(NetplayManager **)NVar2 = pNVar1; local_8._0_1_ = 10; pNVar1 = in_ECX + 0x423; *pNVar1 = (NetplayManager)0x0; in_ECX[0x424] = (NetplayManager)0x0; in_ECX[0x425] = (NetplayManager)0x0; in_ECX[0x426] = (NetplayManager)0x0; in_ECX[0x427] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(8); *(undefined4 *)((int)NVar2 + 4) = 0; *pNVar1 = NVar2; *(NetplayManager **)NVar2 = pNVar1; local_8._0_1_ = 0xb; pNVar1 = in_ECX + 0x428; *pNVar1 = (NetplayManager)0x0; in_ECX[0x429] = (NetplayManager)0x0; in_ECX[0x42a] = (NetplayManager)0x0; in_ECX[0x42b] = (NetplayManager)0x0; in_ECX[0x42c] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(8); *(undefined4 *)((int)NVar2 + 4) = 0; *pNVar1 = NVar2; *(NetplayManager **)NVar2 = pNVar1; local_8._0_1_ = 0xc; ANM2::constructor((ANM2 *)(in_ECX + 0x42d)); in_ECX[0x472] = (NetplayManager)0x0; in_ECX[0x473] = (NetplayManager)0x0; in_ECX[0x474] = (NetplayManager)0x0; in_ECX[0x475] = (NetplayManager)0x0; in_ECX[0x476] = (NetplayManager)0x0; in_ECX[0x477] = (NetplayManager)0x0; in_ECX[0x478] = (NetplayManager)0x0; in_ECX[0x479] = (NetplayManager)0x0; in_ECX[0x47a] = (NetplayManager)0x0; in_ECX[0x47b] = (NetplayManager)0x0; in_ECX[0x47c] = (NetplayManager)0x0; in_ECX[0x47d] = (NetplayManager)0x0; in_ECX[0x47e] = (NetplayManager)0x0; in_ECX[0x47f] = (NetplayManager)0x0; in_ECX[0x480] = (NetplayManager)0x0; in_ECX[0x481] = (NetplayManager)0x0; in_ECX[0x482] = (NetplayManager)0x0; in_ECX[0x483] = (NetplayManager)0x0; in_ECX[0x484] = (NetplayManager)0x0; in_ECX[0x485] = (NetplayManager)0x0; in_ECX[0x486] = (NetplayManager)0x0; in_ECX[0x487] = (NetplayManager)0x0; local_8._0_1_ = 0xe; *(undefined1 *)(in_ECX + 0x488) = 0; in_ECX[0x489] = (NetplayManager)0x0; in_ECX[0x48a] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0x20); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x489] = NVar2; *(undefined1 *)(in_ECX + 0x48b) = 0; local_8._0_1_ = 0xf; in_ECX[0x48c] = (NetplayManager)0x0; in_ECX[0x48d] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0x48); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x48c] = NVar2; in_ECX[0x48e] = (NetplayManager)0x0; in_ECX[0x48f] = (NetplayManager)0x0; in_ECX[0x493] = (NetplayManager)0x0; in_ECX[0x494] = (NetplayManager)0xf; *(undefined1 *)(in_ECX + 0x48f) = 0; local_8._0_1_ = 0x11; OnlineChatMessage::constructor(in_ECX + 0x495); local_8._0_1_ = 0x12; in_ECX[0x4a0] = (NetplayManager)0x0; in_ECX[0x4a1] = (NetplayManager)0x0; in_ECX[0x4a2] = (NetplayManager)0x0; in_ECX[0x4a4] = (NetplayManager)0x0; in_ECX[0x4a5] = (NetplayManager)0x0; in_ECX[0x602] = (NetplayManager)0x0; KColor::SetFromARGB((KColor *)(in_ECX + 0x603),0xffffffff); *(undefined1 *)(in_ECX + 0x608) = 1; in_ECX[0x609] = (NetplayManager)0x3f000000; in_ECX[0x60a] = (NetplayManager)0x5; in_ECX[0x60b] = (NetplayManager)0xa; in_ECX[0x60c] = (NetplayManager)0x2; in_ECX[0x60d] = (NetplayManager)0x43480000; in_ECX[0x60e] = (NetplayManager)0x41800000; in_ECX[0x60f] = (NetplayManager)0x43160000; in_ECX[0x610] = (NetplayManager)0x40800000; in_ECX[0x611] = (NetplayManager)0x3f400000; in_ECX[0x612] = (NetplayManager)0xbb8; uVar3 = 0x20; in_ECX[0x614] = (NetplayManager)0x0; in_ECX[0x615] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0x20); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x614] = NVar2; in_ECX[0x613] = (NetplayManager)(((float)in_ECX[0x611] / (float)in_ECX[0x60e]) * 0.8); memset(in_ECX + 0x4a6,0,0x570); in_ECX[0x616] = (NetplayManager)0x0; in_ECX[0x617] = (NetplayManager)0x0; in_ECX[0x618] = (NetplayManager)0x0; local_8._0_1_ = 0x14; in_ECX[0x619] = (NetplayManager)0x0; in_ECX[0x61a] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0x30); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x619] = NVar2; in_ECX[0x61b] = (NetplayManager)0x0; in_ECX[0x61c] = (NetplayManager)0x0; in_ECX[0x61d] = (NetplayManager)0x0; in_ECX[0x61e] = (NetplayManager)0x0; in_ECX[0x61f] = (NetplayManager)0x0; in_ECX[0x620] = (NetplayManager)0x0; in_ECX[0x621] = (NetplayManager)0x0; in_ECX[0x622] = (NetplayManager)0x0; in_ECX[0x623] = (NetplayManager)0x0; local_8._0_1_ = 0x18; in_ECX[0x624] = (NetplayManager)KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(uVar3); local_8._0_1_ = 0x19; in_ECX[0x627] = (NetplayManager)0x0; in_ECX[0x628] = (NetplayManager)0x0; NVar2 = (NetplayManager)operator_new(0x20); *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; *(undefined2 *)((int)NVar2 + 0xc) = 0x101; in_ECX[0x627] = NVar2; local_8._0_1_ = 0x1a; in_ECX[0x629] = (NetplayManager)0x0; in_ECX[0x62a] = (NetplayManager)0x0; in_ECX[0x62b] = (NetplayManager)0x0; in_ECX[0x62c] = (NetplayManager)0x0; in_ECX[0x62d] = (NetplayManager)0x0; in_ECX[0x62e] = (NetplayManager)0x0; in_ECX[0x62f] = (NetplayManager)0x0; in_ECX[0x635] = (NetplayManager)0x3c; in_ECX[0x636] = (NetplayManager)0x0; in_ECX[0x637] = (NetplayManager)0x0; ANM2::constructor((ANM2 *)(in_ECX + 0x639)); KColor::SetFromARGB((KColor *)(in_ECX + 0x67e),0xffffffff); in_ECX[0x683] = (NetplayManager)0x0; in_ECX[0x684] = (NetplayManager)0x0; in_ECX[0x685] = (NetplayManager)0x0; local_8._0_1_ = 0x1b; ANM2::constructor((ANM2 *)(in_ECX + 0x686)); local_8._0_1_ = 0x1c; in_ECX[0x6cb] = (NetplayManager)KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(in_ECX + 0x6cc); local_8._0_1_ = 0x1d; ANM2::constructor((ANM2 *)(in_ECX + 0x6ce)); KColor::SetFromARGB((KColor *)(in_ECX + 0x713),0xffffffff); in_ECX[0x718] = (NetplayManager)0x0; in_ECX[0x719] = (NetplayManager)0x0; in_ECX[0x71a] = (NetplayManager)0x0; in_ECX[0x71b] = (NetplayManager)0x0; in_ECX[0x71f] = (NetplayManager)0x0; in_ECX[0x720] = (NetplayManager)0xf; *(undefined1 *)(in_ECX + 0x71b) = 0; local_8._0_1_ = 0x1f; in_ECX[0x721] = (NetplayManager)KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(in_ECX + 0x722); in_ECX[0x724] = (NetplayManager)0x0; in_ECX[0x725] = (NetplayManager)0x0; local_8 = CONCAT31(local_8._1_3_,0x21); NetplayManager::reset(in_ECX,1); std::list>::push_back(netplay_lobby_join_requested_callback,in_ECX); ExceptionList = local_10; return in_ECX; } //@@ 00906a10 FUN_00906a10 void FUN_00906a10(void) { FUN_00a58200(); return; } //@@ 00906a20 FUN_00906a20 void FUN_00906a20(void) { int *in_ECX; FUN_009156e0(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0xfa8); return; } //@@ 00906a40 FUN_00906a40 void FUN_00906a40(void) { int *in_ECX; std::map::destroy_subtree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0xe8); return; } //@@ 00906a70 FUN_00906a70 void FUN_00906a70(void) { int *in_ECX; FUN_00914d90(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x30); return; } //@@ 00906a90 NetplayManager::~NetplayManager /* DB: Manager::destructor calls it right after NetplayManager::reset(1); destroys the members 00906260 SaveSlotManager::constructor (ANM2 +0x10b4, ConstLobby +0x1890, trees +0x189c/+0x1864/+0x1224, five vector) and clears +0x1c90; 00906260 SaveSlotManager::constructor therefore NetplayManager::constructor (Manager ctor calls it after zeroing +0x4b3d0, next member at +0x4d070, fits _netplayManager at Manager+0x4b3d8) */ void NetplayManager::~NetplayManager(void) { undefined4 *puVar1; void *ptr; char cVar2; uint uVar3; void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08a50; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00a1d6b0(netplay_lobby_join_requested_callback); NetplayTextPopup::clear(uVar3); *(undefined4 *)((int)in_ECX + 0x1c90) = 0; *(undefined4 *)((int)in_ECX + 0x1c94) = 0; GenericPopup::destructor(); daily_lobby_join_destructor(); puVar1 = (undefined4 *)((int)in_ECX + 0x189c); FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(*(int *)((int)in_ECX + 0x189c) + 4)); operator_delete((void *)*puVar1,0x20); *(undefined ***)((int)in_ECX + 0x1890) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)((int)in_ECX + 0x1898) != (int *)0x0) { cVar2 = (**(code **)(**(int **)((int)in_ECX + 0x1898) + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)in_ECX + 0x1894); } } FUN_004b3950(); std::vector<32byte>::_Tidy(); std::vector<24byte>::_Tidy(); FUN_00914d90((undefined4 *)((int)in_ECX + 0x1864), *(undefined4 *)(*(int *)((int)in_ECX + 0x1864) + 4)); operator_delete(*(void **)((int)in_ECX + 0x1864),0x30); FUN_00913df0(); OnlineChat::destructor(); puVar1 = (undefined4 *)((int)in_ECX + 0x1224); FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(*(int *)((int)in_ECX + 0x1224) + 4)); operator_delete((void *)*puVar1,0x20); FUN_00900940(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); local_8 = 1; NetplayTextPopup::clear(); local_8 = CONCAT31(local_8._1_3_,2); ANM2::Reset((ANM2 *)((int)in_ECX + 0x10b4)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x1104)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x10e4)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x10cc)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x10b4)); std::deque<36byte>::_Tidy(); std::deque<4byte>::~deque(); std::deque<12byte>::~deque(); std::map::destroy_subtree ((undefined4 *)((int)in_ECX + 0x1070), *(undefined4 *)(*(int *)((int)in_ECX + 0x1070) + 4)); operator_delete(*(void **)((int)in_ECX + 0x1070),0xe8); FUN_009156e0((undefined4 *)((int)in_ECX + 0x1068), *(undefined4 *)(*(int *)((int)in_ECX + 0x1068) + 4)); operator_delete(*(void **)((int)in_ECX + 0x1068),0xfa8); FUN_00a58200(); FUN_00a58200(); local_8 = 3; if (*(undefined4 **)((int)in_ECX + 0x60) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)((int)in_ECX + 0x60))(1); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)((int)in_ECX + 0xfc0)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x7c)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 100)); std::vector::_Tidy(); puVar1 = (undefined4 *)((int)in_ECX + 0x3c); FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(*(int *)((int)in_ECX + 0x3c) + 4)); operator_delete((void *)*puVar1,0x1c); std::deque<12byte>::_Tidy(); ptr = *(void **)((int)in_ECX + 0x28); *(undefined4 *)((int)in_ECX + 0x28) = 0; operator_delete(ptr,8); FID_conflict__Tidy(in_ECX); ExceptionList = local_10; return; } //@@ 00906d60 NetplayManager::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=NetplayManager (ANM2 at +0x10b4 = ui_streak.anm2, the member ~NetplayManager 00906a90 destroys); strings game_version/build_number/v1.9.7.17/J460, NetplayManager::reset, OnlineChatMessage ctor; called once from Manager::Init after ModManager::LoadModContent */ void NetplayManager::Init(void) { undefined4 *puVar1; Manager *pMVar2; NetplayManager *pNVar3; char cVar4; LayerState *pLVar5; int *piVar6; char *pcVar7; void *extraout_EAX; NetplayManager *extraout_EAX_00; NetplayManager *in_ECX; NetplayManager NVar8; uint size; NetplayManager *chat; undefined **ppuVar9; void *userRefCount; undefined1 auStack_9a [2]; undefined1 local_8c [44]; undefined **local_60; undefined1 *puStack_5c; undefined **local_58; undefined4 local_54; int *local_50; NetplayManager *local_48; NetplayManager local_44; std_string local_40; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_8c + 0x88; local_14 = 0xffffffff; puStack_18 = &LAB_00b08a9d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_8c + 0x7c); ExceptionList = &local_1c; local_40._size = 0; local_40._capacity = 0xf; local_40._buf[0] = '\0'; local_40._buf[1] = '\0'; local_40._buf[2] = '\0'; local_40._buf[3] = '\0'; local_48 = in_ECX; local_40._buf._0_4_ = std::_Allocate(0x20); local_40._size = 0x15; local_40._capacity = 0x1f; builtin_strncpy((char *)local_40._buf._0_4_,"gfx/ui/ui_streak.anm2",0x16); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x42d),&local_40,1); local_14 = 0xffffffff; if (0xf < local_40._capacity) { size = local_40._capacity + 1; pcVar7 = (char *)local_40._buf._0_4_; if (0xfff < size) { pcVar7 = *(char **)(local_40._buf._0_4_ + -4); size = local_40._capacity + 0x24; if ((char *)0x1f < (char *)(local_40._buf._0_4_ + (-4 - (int)pcVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar7,size); } pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x42d),(byte *)"paper"); pLVar5->_visible = 0; std::list>::push_back(); std::list>::push_back(); local_40._buf[8] = '\0'; local_40._buf[9] = '\0'; local_40._buf[10] = '\0'; local_40._buf[0xb] = '\0'; local_40._buf[0xc] = '\0'; local_40._buf[0xd] = '\0'; local_40._buf[0xe] = '\0'; local_40._buf[0xf] = '\0'; local_40._size = 0; local_40._capacity = 0; piVar6 = (int *)FUN_00a53dd0(&local_44); puVar1 = (undefined4 *)*piVar6; pcVar7 = operator_new_tracked(0xd); strncpy(pcVar7,"game_version",0xd); *puVar1 = pcVar7; pcVar7 = operator_new_tracked(10); strncpy(pcVar7,"v1.9.7.17",10); puVar1[2] = pcVar7; puVar1[3] = (int)pcVar7 >> 0x1f; local_40._buf[8] = '\0'; local_40._buf[9] = '\0'; local_40._buf[10] = '\0'; local_40._buf[0xb] = '\0'; local_40._buf[0xc] = '\0'; local_40._buf[0xd] = '\0'; local_40._buf[0xe] = '\0'; local_40._buf[0xf] = '\0'; local_40._size = 0; local_40._capacity = 0; piVar6 = (int *)FUN_00a53dd0(&local_44); puVar1 = (undefined4 *)*piVar6; pcVar7 = operator_new_tracked(0xd); strncpy(pcVar7,"build_number",0xd); *puVar1 = pcVar7; pcVar7 = operator_new_tracked(5); strncpy(pcVar7,"J460",5); puVar1[2] = pcVar7; puVar1[3] = (int)pcVar7 >> 0x1f; local_40._buf[0] = '\0'; local_40._buf[1] = '\0'; local_40._buf[2] = '\0'; local_40._buf[3] = '\0'; local_40._buf[4] = '\0'; local_40._buf[5] = '\0'; local_40._buf[6] = '\0'; local_40._buf[7] = '\0'; local_40._buf[8] = '\0'; local_40._buf[9] = '\0'; local_40._buf[10] = '\0'; local_40._buf[0xb] = '\0'; local_40._buf[0xc] = '\0'; local_40._buf[0xd] = '\0'; local_40._buf[0xe] = '\0'; local_40._buf[0xf] = '\0'; local_40._size = 0; local_40._capacity = 0; piVar6 = (int *)FUN_00a53e50(&local_44); puVar1 = (undefined4 *)*piVar6; pcVar7 = operator_new_tracked(0xd); strncpy(pcVar7,"game_version",0xd); *puVar1 = pcVar7; pcVar7 = operator_new_tracked(10); strncpy(pcVar7,"v1.9.7.17",10); puVar1[4] = 2; puVar1[2] = pcVar7; puVar1[3] = (int)pcVar7 >> 0x1f; local_40._buf[0] = '\0'; local_40._buf[1] = '\0'; local_40._buf[2] = '\0'; local_40._buf[3] = '\0'; local_40._buf[4] = '\0'; local_40._buf[5] = '\0'; local_40._buf[6] = '\0'; local_40._buf[7] = '\0'; local_40._buf[8] = '\0'; local_40._buf[9] = '\0'; local_40._buf[10] = '\0'; local_40._buf[0xb] = '\0'; local_40._buf[0xc] = '\0'; local_40._buf[0xd] = '\0'; local_40._buf[0xe] = '\0'; local_40._buf[0xf] = '\0'; local_40._size = 0; local_40._capacity = 0; piVar6 = (int *)FUN_00a53e50(&local_44); puVar1 = (undefined4 *)*piVar6; pcVar7 = operator_new_tracked(0xd); strncpy(pcVar7,"build_number",0xd); *puVar1 = pcVar7; pcVar7 = operator_new_tracked(5); strncpy(pcVar7,"J460",5); pNVar3 = local_48; local_40._capacity = (uint)g_userProfile; puVar1[2] = pcVar7; pMVar2 = g_manager; puVar1[3] = (int)pcVar7 >> 0x1f; puVar1[4] = 2; chat = local_48 + 0x48c; local_40._size = (uint)KAGE::System::UserProfile::vftable; local_48[0x602] = (NetplayManager)&pMVar2->_font2_TeamMeatEx12; local_14 = 1; if ((void *)local_40._capacity == (void *)0x0) { local_60 = (undefined **)0x0; ppuVar9 = local_60; puStack_5c = (undefined1 *)0x0; local_60 = (undefined **)0x0; local_58 = local_60; local_54 = puStack_5c; local_60 = ppuVar9; } else { local_58 = *(undefined ***)(local_40._capacity + 8); local_54 = (undefined1 *)*(undefined4 *)(local_40._capacity + 0xc); } local_44 = (NetplayManager)(local_48 + 0x48f); if (0xf < (uint)local_48[0x494]) { local_44 = *(NetplayManager *)local_44; } _local_60 = CONCAT44(auStack_9a + -10,local_60); UserProfile::find_or_create(&local_58); local_14._0_1_ = 2; ppuVar9 = KAGE::System::UserProfile::vftable; userRefCount = extraout_EAX; if (((extraout_EAX != (void *)0x0) && (*(int *)((int)extraout_EAX + 8) != 0 || *(int *)((int)extraout_EAX + 0xc) != 0)) && (*(int *)((int)extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(auStack_9a + -10); } local_14._0_1_ = 1; OnlineChatMessage::constructor(local_8c,chat,(byte *)local_44,ppuVar9,userRefCount,1.0); local_14 = CONCAT31(local_14._1_3_,3); pNVar3[0x495] = *extraout_EAX_00; pNVar3[0x497] = extraout_EAX_00[2]; FormattedText::operator_assign(pNVar3 + 0x498,extraout_EAX_00 + 3); pNVar3[0x49c] = extraout_EAX_00[7]; pNVar3[0x49d] = extraout_EAX_00[8]; pNVar3[0x49e] = extraout_EAX_00[9]; pNVar3[0x49f] = extraout_EAX_00[10]; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14 = 0xffffffff; load_mute_list(); reset(local_48,1); daily_lobby_join_init(); local_40._size = 0; local_40._capacity = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(); local_14 = 4; std::shared_ptr::assign(local_48 + 0x722,&local_54); local_58 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 5; if (local_50 != (int *)0x0) { cVar4 = (**(code **)(*local_50 + 0xc))(); if ((cVar4 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } local_14 = 0xffffffff; FUN_008370f0(); NVar8 = (NetplayManager)(local_48 + 0x71b); if (0xf < (uint)local_48[0x720]) { NVar8 = local_48[0x71b]; } local_48[0x71f] = (NetplayManager)0x0; *(undefined1 *)NVar8 = 0; ExceptionList = local_1c; return; } //@@ 00907200 FUN_00907200 void FUN_00907200(void) { int iVar1; iVar1 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar1 == 2) || (iVar1 == 3)) { Multiplayer::set_service_provider(3); return; } Multiplayer::set_service_provider(2); return; } //@@ 00907230 FUN_00907230 void FUN_00907230(int param_1) { int iVar1; void *in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar2; int iVar3; undefined1 auStack_f8 [48]; undefined4 uStack_c8; undefined1 auStack_a4 [12]; undefined1 auStack_98 [12]; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_4c; char *pcStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; float fStack_28; float fStack_24; undefined4 uStack_20; Vector VStack_1c; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b08ae0; local_10 = ExceptionList; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Creating public lobby...\n"); iVar3 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar3 == 2) || (iVar3 == 3)) { iVar3 = 3; } else { iVar3 = 2; } Multiplayer::set_service_provider(iVar3); VStack_1c.x = (float)&DAT_bf800000; VStack_1c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (auStack_f8,&g_manager->_font2_TeamMeatEx12,FUN_009083b0,in_ECX,&VStack_1c); uStack_8 = 0; uStack_3c = 0x3e5cdcdd; uStack_38 = 0x3e2cacad; uStack_34 = 0x3e34b4b5; uStack_30 = 0x3f800000; fStack_28 = g_vectorZero.x; uStack_4c = 0; pcStack_48 = "##GAME###Online/CREATING_LOBBY"; uStack_44 = 0xffffffff; uStack_40 = 0xffffffff; uStack_2c = 0; fStack_24 = g_vectorZero.y; uStack_20 = 1; std::vector<48byte>::push_back(&uStack_4c); uStack_c8 = 1000; uStack_74 = 0xdeadbeef; iVar1 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,auStack_f8); iVar3 = *(int *)((int)in_ECX + 0x1864); *(int *)((int)in_ECX + 0x58) = iVar1; FUN_00914d90((int)in_ECX + 0x1864,*(undefined4 *)(iVar3 + 4)); *(int *)(iVar3 + 4) = iVar3; *(int *)iVar3 = iVar3; *(int *)(iVar3 + 8) = iVar3; *(undefined4 *)((int)in_ECX + 0x1868) = 0; iVar3 = *(int *)((int)in_ECX + 0x1870); iVar1 = *(int *)((int)in_ECX + 0x186c); uVar2 = extraout_ECX; if (iVar1 != iVar3) { do { std::vector::_Tidy(); iVar1 = iVar1 + 0x18; } while (iVar1 != iVar3); iVar1 = *(int *)((int)in_ECX + 0x186c); uVar2 = extraout_ECX_00; } *(int *)((int)in_ECX + 0x1870) = iVar1; iVar3 = *(int *)((int)in_ECX + 0x187c); iVar1 = *(int *)((int)in_ECX + 0x1878); if (iVar1 != iVar3) { do { std::vector::_Tidy(); iVar1 = iVar1 + 0x20; } while (iVar1 != iVar3); iVar1 = *(int *)((int)in_ECX + 0x1878); uVar2 = extraout_ECX_01; } *(int *)((int)in_ECX + 0x187c) = iVar1; *(undefined4 *)((int)in_ECX + 0x1888) = *(undefined4 *)((int)in_ECX + 0x1884); *(undefined4 *)((int)in_ECX + 0x1c90) = 0; *(undefined4 *)((int)in_ECX + 0x1c94) = 0; KAGE::Network::MultiplayerManager::create_lobby(3,*(undefined4 *)(param_1 + 0xc),uVar2,in_ECX); uStack_7c = 0; uStack_78 = 0; uStack_84 = 0; uStack_80 = 0; uStack_8c = 0; uStack_88 = 0; FID_conflict__Tidy(auStack_98); FID_conflict__Tidy(auStack_a4); ExceptionList = local_10; return; } //@@ 00907460 FUN_00907460 void FUN_00907460(int param_1) { int iVar1; void *in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar2; int iVar3; undefined1 auStack_f8 [48]; undefined4 uStack_c8; undefined1 auStack_a4 [12]; undefined1 auStack_98 [12]; undefined4 uStack_8c; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_4c; char *pcStack_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; float fStack_28; float fStack_24; undefined4 uStack_20; Vector VStack_1c; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b08ae0; local_10 = ExceptionList; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Creating friend lobby...\n"); iVar3 = (g_manager->_optionsConfig)._eosCrossplay; if ((iVar3 == 2) || (iVar3 == 3)) { iVar3 = 3; } else { iVar3 = 2; } Multiplayer::set_service_provider(iVar3); VStack_1c.x = (float)&DAT_bf800000; VStack_1c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (auStack_f8,&g_manager->_font2_TeamMeatEx12,FUN_009083b0,in_ECX,&VStack_1c); uStack_8 = 0; uStack_3c = 0x3e5cdcdd; uStack_38 = 0x3e2cacad; uStack_34 = 0x3e34b4b5; uStack_30 = 0x3f800000; fStack_28 = g_vectorZero.x; uStack_4c = 0; pcStack_48 = "##GAME###Online/CREATING_LOBBY"; uStack_44 = 0xffffffff; uStack_40 = 0xffffffff; uStack_2c = 0; fStack_24 = g_vectorZero.y; uStack_20 = 1; std::vector<48byte>::push_back(&uStack_4c); uStack_c8 = 1000; uStack_74 = 0xdeadbeef; iVar1 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,auStack_f8); iVar3 = *(int *)((int)in_ECX + 0x1864); *(int *)((int)in_ECX + 0x58) = iVar1; FUN_00914d90((int)in_ECX + 0x1864,*(undefined4 *)(iVar3 + 4)); *(int *)(iVar3 + 4) = iVar3; *(int *)iVar3 = iVar3; *(int *)(iVar3 + 8) = iVar3; *(undefined4 *)((int)in_ECX + 0x1868) = 0; iVar3 = *(int *)((int)in_ECX + 0x1870); iVar1 = *(int *)((int)in_ECX + 0x186c); uVar2 = extraout_ECX; if (iVar1 != iVar3) { do { std::vector::_Tidy(); iVar1 = iVar1 + 0x18; } while (iVar1 != iVar3); iVar1 = *(int *)((int)in_ECX + 0x186c); uVar2 = extraout_ECX_00; } *(int *)((int)in_ECX + 0x1870) = iVar1; iVar3 = *(int *)((int)in_ECX + 0x187c); iVar1 = *(int *)((int)in_ECX + 0x1878); if (iVar1 != iVar3) { do { std::vector::_Tidy(); iVar1 = iVar1 + 0x20; } while (iVar1 != iVar3); iVar1 = *(int *)((int)in_ECX + 0x1878); uVar2 = extraout_ECX_01; } *(int *)((int)in_ECX + 0x187c) = iVar1; *(undefined4 *)((int)in_ECX + 0x1888) = *(undefined4 *)((int)in_ECX + 0x1884); *(undefined4 *)((int)in_ECX + 0x1c90) = 0; *(undefined4 *)((int)in_ECX + 0x1c94) = 0; KAGE::Network::MultiplayerManager::create_lobby(1,*(undefined4 *)(param_1 + 0xc),uVar2,in_ECX); uStack_7c = 0; uStack_78 = 0; uStack_84 = 0; uStack_80 = 0; uStack_8c = 0; uStack_88 = 0; FID_conflict__Tidy(auStack_98); FID_conflict__Tidy(auStack_a4); ExceptionList = local_10; return; } //@@ 00907690 netplay_leave_lobby /* DB: copies the global current-lobby shared_ptr g_multiplayerLobbyPtr and, if valid, logs "Leaving current lobby %llu" with its 64-bit lobby id (+8/+0xc) then leaves/resets it; Game::FinishChallenge, Menu_OnlineLobby::Update, online_stats_finalize prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall netplay_leave_lobby(void *this,int unused1,int unused2) { int iVar1; char cVar2; uint uVar3; int iVar4; int *local_24; int *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b08b15; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_24 = (int *)0x0; local_20 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_24,&g_multiplayerLobbyPtr); local_8 = 1; if ((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(uVar3), cVar2 != '\0')) { if (local_24 == (int *)0x0) { local_1c = 0; } KAGE_LogMessage(1,(byte *)"Leaving current lobby %llu\n"); *(undefined4 *)((int)this + 0x1c90) = 0; *(undefined4 *)((int)this + 0x1c94) = 0; Multiplayer::leave_lobby(FUN_00908830,this); iVar4 = (int)(g_manager->_lobbyMembers)._end - (int)(g_manager->_lobbyMembers)._begin; iVar1 = iVar4 >> 0x1f; if (iVar4 / 0x14 + iVar1 != iVar1) { do { if ((DAT_00c5abc4 & 1) != 0) { lobby_process_user_commands(); } _EOS_Platform_Tick_4(g_eosPlatform); eos_user_info_process_pending(); Sleep(10); iVar4 = (int)(g_manager->_lobbyMembers)._end - (int)(g_manager->_lobbyMembers)._begin; iVar1 = iVar4 >> 0x1f; } while (iVar4 / 0x14 + iVar1 != iVar1); } LobbyList::clear((void *)((int)this + 0x1230)); } local_8 = 2; if (((local_20 != (int *)0x0) && (cVar2 = (**(code **)(*local_20 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_24); } ExceptionList = local_10; return; } //@@ 00907830 FUN_00907830 void FUN_00907830(void) { char cVar1; uint uVar2; int iVar3; int *in_ECX; int *piVar4; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08b55; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar4 = (int *)*in_ECX; if (piVar4 != (int *)in_ECX[1]) { do { cVar1 = (**(code **)(*(int *)(*piVar4 + 0x370) + 0x14))(uVar2); if (cVar1 == '\0') { NetplayManager::RemoveRemotePlayer(*piVar4 + 0x370); piVar4 = (int *)*in_ECX; } else { piVar4 = piVar4 + 1; } } while (piVar4 != (int *)in_ECX[1]); } local_18 = (int *)0x0; local_14 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_18,&g_multiplayerLobbyPtr); local_8 = 1; if (local_18 == (int *)0x0) { iVar3 = 0; } else { iVar3 = (**(code **)(*local_18 + 0x3c))(); } local_8 = 2; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } local_8 = 0xffffffff; if (iVar3 == 1) { FUN_00907460(); ExceptionList = local_10; return; } FUN_00907230(&g_manager->_lobbySettings); ExceptionList = local_10; return; } //@@ 00907960 online_check_game_version /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? returns bool: reads "game_version"/"build_number" from a lobby/peer property object (vtable +0x2c) and compares with the local build, showing "Online/ONLINE_VERSION_MISMATCH" when different; callers Level::InitializeGenesisRoom (lobby join path), 009088e0, 009d98f0 prototype: db/protos.zhl, confirmed by RET 12 */ byte online_check_game_version(void *propertiesVtable,void *properties,void *propertiesRefCount) { char *pcVar1; char cVar2; char *pcVar3; byte *pbVar4; uint uVar5; byte *pbVar6; byte bVar7; bool bVar8; undefined1 local_2c8 [168]; Vector local_220; byte local_218 [512]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b08b98; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_218 + 0x214); ExceptionList = &local_10; local_8 = 0; if (properties == (void *)0x0) { pcVar3 = (char *)0x0; } else { pcVar3 = (char *)(**(code **)(*(int *)properties + 0x2c))("game_version",local_18); } pcVar1 = pcVar3 + 1; do { cVar2 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar2 != '\0'); if (pcVar3 == pcVar1) { bVar7 = 1; } else { if (properties == (void *)0x0) { pbVar4 = (byte *)0x0; } else { pbVar4 = (byte *)(**(code **)(*(int *)properties + 0x2c))("game_version"); } pbVar6 = (byte *)&DAT_00b1bddc; do { bVar7 = *pbVar4; bVar8 = bVar7 < *pbVar6; if (bVar7 != *pbVar6) { LAB_00907a01: uVar5 = -(uint)bVar8 | 1; goto LAB_00907a06; } if (bVar7 == 0) break; bVar7 = pbVar4[1]; bVar8 = bVar7 < pbVar6[1]; if (bVar7 != pbVar6[1]) goto LAB_00907a01; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar7 != 0); uVar5 = 0; LAB_00907a06: if (uVar5 == 0) { if (properties == (void *)0x0) { pbVar4 = (byte *)0x0; } else { pbVar4 = (byte *)(**(code **)(*(int *)properties + 0x2c))("build_number"); } pbVar6 = &DAT_00b784d8; do { bVar7 = *pbVar4; bVar8 = bVar7 < *pbVar6; if (bVar7 != *pbVar6) { LAB_00907a43: uVar5 = -(uint)bVar8 | 1; goto LAB_00907a48; } if (bVar7 == 0) break; bVar7 = pbVar4[1]; bVar8 = bVar7 < pbVar6[1]; if (bVar7 != pbVar6[1]) goto LAB_00907a43; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar7 != 0); uVar5 = 0; LAB_00907a48: if (uVar5 == 0) { bVar7 = 1; goto LAB_00907b0a; } } local_220.x = (float)&DAT_bf800000; local_220.y = (float)&DAT_bf800000; bVar7 = 0; MessagePopup::MessagePopup (local_2c8,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_220); local_8 = CONCAT31(local_8._1_3_,1); if (properties != (void *)0x0) { (**(code **)(*(int *)properties + 0x2c))("game_version"); } pbVar4 = (byte *)StringTable::translate("Online/ONLINE_VERSION_MISMATCH"); sprintf_s(local_218,0x200,pbVar4); MessagePopup::add_ok_button(local_218,local_2c8); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_2c8); FUN_00420710(); } LAB_00907b0a: local_8 = 2; if (((propertiesRefCount != (void *)0x0) && (cVar2 = (**(code **)(*(int *)propertiesRefCount + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&properties); } ExceptionList = local_10; return bVar7; } //@@ 00907b60 online_lobby_get_member_count /* DB: copies the global lobby shared_ptr g_multiplayerLobbyPtr and returns its member array size ((+0x14 - +0x10) >> 3), 0 without a lobby; PauseScreen::Update, netplay_lobby_menu_update prototype: db/protos.zhl */ int __cdecl online_lobby_get_member_count(void) { char cVar1; uint uVar2; int iVar3; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b06cad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = 0; local_14 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_18,&g_multiplayerLobbyPtr); if (local_18 == 0) { iVar3 = 0; } else { iVar3 = *(int *)(local_18 + 0x14) - *(int *)(local_18 + 0x10) >> 3; } local_8 = 1; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } ExceptionList = local_10; return iVar3; } //@@ 00907c10 NetplayManager::is_user_in_player_list /* DB: ECX=Manager+0x4b3d8: scans the player pointer vector +0..+4 comparing each player's +0x374 UserProfile id with (lo,hi), returns bool; update_player_removal, RemoveRemotePlayer prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall NetplayManager::is_user_in_player_list(NetplayManager *this,ulonglong userId) { int iVar1; NetplayManager NVar2; uint uVar3; uint uVar4; undefined4 local_c; undefined4 uStack_8; NVar2 = *this; uVar3 = 0; uVar4 = (int)this[1] - (int)NVar2 >> 2; if (uVar4 != 0) { do { iVar1 = *(int *)(*(int *)NVar2 + 0x374); if (iVar1 == 0) { uStack_8 = 0; local_c = 0; } else { local_c = *(undefined4 *)(iVar1 + 8); uStack_8 = *(undefined4 *)(iVar1 + 0xc); } if (userId == CONCAT44(uStack_8,local_c)) { return 1; } uVar3 = uVar3 + 1; NVar2 = (NetplayManager)((int)NVar2 + 4); } while (uVar3 < uVar4); } return 0; } //@@ 00907c80 FUN_00907c80 void FUN_00907c80(int param_1,int param_2,int param_3) { Manager *pMVar1; char cVar2; uint uVar3; int **ppiVar4; int iVar5; std_string *psVar6; int *piStack_3c; int *piStack_38; undefined **ppuStack_34; int *piStack_30; int *piStack_2c; undefined8 local_28; int *piStack_20; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b08c28; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (param_1 != 0) { KAGE_LogMessage(1,(byte *)"Failed to create lobby, result = %d\n"); goto LAB_00908020; } if (*(int *)(param_2 + 4) == 0) { local_28 = 0; } KAGE_LogMessage(1,(byte *)"Successfully created lobby %llu\n"); if (g_game == (Game *)0x0) { local_28 = 0xb9c1bc; piStack_20 = (int *)0x0; uStack_8 = 0; std::shared_ptr::assign((void *)((int)&local_28 + 4),&g_multiplayerLobbyPtr); local_28._0_4_ = KAGE::Network::Multiplayer::Lobby::vftable; uStack_8 = 1; if (local_28._4_4_ != (int *)0x0) { (**(code **)(*local_28._4_4_ + 0x24))("current_stage",0); } local_28 = CONCAT44(local_28._4_4_,KAGE::Network::Multiplayer::ConstLobby::vftable); uStack_8 = 2; if (((piStack_20 != (int *)0x0) && (cVar2 = (**(code **)(*piStack_20 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)&local_28 + 4); } ppuStack_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; piStack_30 = (int *)0x0; piStack_2c = (int *)0x0; uStack_8 = 3; std::shared_ptr::assign(&piStack_30,&g_multiplayerLobbyPtr); ppuStack_34 = KAGE::Network::Multiplayer::Lobby::vftable; uStack_8 = 4; if (piStack_30 != (int *)0x0) { (**(code **)(*piStack_30 + 0x24))("current_stage_type",0); } ppuStack_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; uStack_8 = 5; if (((piStack_2c != (int *)0x0) && (cVar2 = (**(code **)(*piStack_2c + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { ppiVar4 = &piStack_30; LAB_00907f01: (*g_lobbyReleaseFn)(ppiVar4); } } else { ppuStack_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; piStack_30 = (int *)0x0; piStack_2c = (int *)0x0; uStack_8 = 6; std::shared_ptr::assign(&piStack_30,&g_multiplayerLobbyPtr); ppuStack_34 = KAGE::Network::Multiplayer::Lobby::vftable; uStack_8 = 7; iVar5 = 0x3e9; if (*(int *)&g_game->_deathmatchManager < 2) { iVar5 = g_game->_stage; } if (piStack_30 != (int *)0x0) { (**(code **)(*piStack_30 + 0x24))("current_stage",iVar5,uVar3); } ppuStack_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; uStack_8 = 8; if (((piStack_2c != (int *)0x0) && (cVar2 = (**(code **)(*piStack_2c + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&piStack_30); } piStack_3c = (int *)0x0; piStack_38 = (int *)0x0; uStack_8 = 9; std::shared_ptr::assign(&piStack_3c,&g_multiplayerLobbyPtr); uStack_8 = 10; if (piStack_3c != (int *)0x0) { (**(code **)(*piStack_3c + 0x24))("current_stage_type",g_game->_stageType); } uStack_8 = 0xb; if (((piStack_38 != (int *)0x0) && (cVar2 = (**(code **)(*piStack_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { ppiVar4 = &piStack_3c; goto LAB_00907f01; } } pMVar1 = g_manager; local_28 = 0xb9c1bc; piStack_20 = (int *)0x0; uStack_8 = 0xc; std::shared_ptr::assign((void *)((int)&local_28 + 4),&g_multiplayerLobbyPtr); local_28._0_4_ = KAGE::Network::Multiplayer::Lobby::vftable; uStack_8 = 0xd; if (((local_28._4_4_ != (int *)0x0) && ((**(code **)(*local_28._4_4_ + 0x24))("lobby_mode",(pMVar1->_lobbySettings)._gameMode), local_28._4_4_ != (int *)0x0)) && ((**(code **)(*local_28._4_4_ + 0x24)) ("lobby_tag",*(undefined4 *)&(pMVar1->_lobbySettings).field_0x14), local_28._4_4_ != (int *)0x0)) { (**(code **)(*local_28._4_4_ + 0x24))("lobby_challenge",(pMVar1->_lobbySettings)._challenge); } psVar6 = &(pMVar1->_lobbySettings)._seed; if (0xf < (pMVar1->_lobbySettings)._seed._capacity) { psVar6 = *(std_string **)psVar6->_buf; } if (local_28._4_4_ != (int *)0x0) { (**(code **)(*local_28._4_4_ + 0x28))("lobby_seed",psVar6); } psVar6 = &(pMVar1->_lobbySettings)._password; if (0xf < (pMVar1->_lobbySettings)._password._capacity) { psVar6 = *(std_string **)psVar6->_buf; } if (local_28._4_4_ != (int *)0x0) { (**(code **)(*local_28._4_4_ + 0x28))("lobby_password",psVar6); } local_28 = CONCAT44(local_28._4_4_,KAGE::Network::Multiplayer::ConstLobby::vftable); uStack_8 = 0xe; if (((piStack_20 != (int *)0x0) && (cVar2 = (**(code **)(*piStack_20 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)&local_28 + 4); } uStack_8 = 0xffffffff; LAB_00908020: if (*(code **)(param_3 + 0x1c90) != (code *)0x0) { (**(code **)(param_3 + 0x1c90))(*(undefined4 *)(param_3 + 0x1c94)); *(undefined4 *)(param_3 + 0x1c90) = 0; *(undefined4 *)(param_3 + 0x1c94) = 0; } FUN_00908660(param_1,param_2,param_3); ExceptionList = local_10; return; } //@@ 00908070 netplay_lost_connection_callback /* DB: ? pushed as popup callback (push 0x908070 at 0x90e748) by NetplayManager::check_connection for the LOST_CONNECTION_TO_SERVER popup; fades game out (fadeSpeed 0.08), netplay_leave_lobby, NetplayManager::reset, resets Menu_Character/Challenge/SpecialSeeds, ModManager::Reset */ void netplay_lost_connection_callback(undefined4 param_1,NetplayManager *param_2) { void **ppvVar1; Game *pGVar2; Manager *pMVar3; MenuManager *pMVar4; undefined4 *puVar5; int iVar6; void *pvVar7; void *pvVar8; PlayerManager *pPVar9; _Tree_node *p_Var10; uint uVar11; MenuManager *pMVar12; void **in_stack_ffffff98; byte *this; _Tree_node *in_stack_ffffff9c; _Tree_node *local_58; MenuManager *local_54; float local_50; float fStack_4c; float fStack_48; float fStack_44; KColor local_24; pMVar12 = g_menuManager; pGVar2 = g_game; if ((g_game != (Game *)0x0) && (g_game->_stage != 0)) { KColor::SetFromARGB(&local_24,0xff000000); local_50 = local_24._red; fStack_4c = local_24._green; fStack_48 = local_24._blue; fStack_44 = (pGVar2->_fadeOutColor)._alpha; pGVar2->_fadeSpeed = 0.08; pGVar2->_fadeOutTarget = 2; (pGVar2->_fadeOutColor)._red = local_24._red; (pGVar2->_fadeOutColor)._green = local_24._green; (pGVar2->_fadeOutColor)._blue = local_24._blue; (pGVar2->_fadeOutColor)._alpha = fStack_44; (pGVar2->_fadeOutColor)._unk = 0; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08; if (pGVar2->_challenge == 0) { local_58 = (_Tree_node *)CONCAT31(local_58._1_3_,1); if ((pGVar2->_dailyChallenge)._id != 0) goto LAB_0090812b; } else { LAB_0090812b: local_58 = (_Tree_node *)((uint)local_58 & 0xffffff00); } this = (byte *)0x0; in_stack_ffffff9c = local_58; FUN_0090cd10(); pGVar2 = g_game; uVar11 = 0; pPVar9 = &g_game->_playerManager; g_manager->_isSaveOnExit = 0; if ((int)(pGVar2->_playerManager)._playerList._end - (int)(pPVar9->_playerList)._begin >> 2 != 0 ) { do { pvVar7 = (pPVar9->_playerList)._end; if ((int)pvVar7 - (int)(pPVar9->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (pPVar9->_playerList)._end; } puVar5 = (pPVar9->_playerList)._begin; if (uVar11 < (uint)((int)pvVar7 - (int)puVar5 >> 2)) { puVar5 = puVar5 + uVar11; } in_stack_ffffff9c = (_Tree_node *)0x0; this = (byte *)0xffffffff; Entity_Player::SetControllerIndex((Entity_Player *)*puVar5); uVar11 = uVar11 + 1; pPVar9 = &g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar9->_playerList)._begin >> 2)); } goto LAB_00908387; } local_54 = g_menuManager; pvVar7 = (g_menuManager->_menuStateHistory)._end; pvVar8 = (g_menuManager->_menuStateHistory)._begin; if (((int)pvVar7 - (int)pvVar8 >> 2 != 0) && (*(int *)((int)pvVar7 + -4) == 4)) { in_stack_ffffff9c = (_Tree_node *)0x9081ea; FUN_008d0730(); pvVar8 = (pMVar12->_menuStateHistory)._begin; } (pMVar12->_menuStateHistory)._end = pvVar8; p_Var10 = (_Tree_node *)0x1; do { this = (pMVar12->_menuStateHistory)._end; local_58 = p_Var10; if (this == (pMVar12->_menuStateHistory)._capacity) { in_stack_ffffff9c = (_Tree_node *)&local_58; std::vector::_Emplace_reallocate(this,in_stack_ffffff9c); } else { *(_Tree_node **)this = p_Var10; ppvVar1 = &(pMVar12->_menuStateHistory)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); this = (byte *)in_stack_ffffff98; } pMVar3 = g_manager; p_Var10 = p_Var10 + 1; in_stack_ffffff98 = (void **)this; } while ((int)p_Var10 < 4); iVar6 = 0; if (pMVar12->_selectedMenuID != 0) { local_58 = (_Tree_node *)&DAT_00000008; seed_fart_sound_override((int *)&local_58); in_stack_ffffff9c = (_Tree_node *)0x0; this = (byte *)0x3f800000; SoundEffects::Play(&pMVar3->_sfxManager,(int)local_58,1.0,0,0,1.0,0.0); iVar6 = pMVar12->_selectedMenuID; pMVar12->_state = 1; } if (iVar6 == 0x10) { if (pMVar12->field_0xda90 != '\0') { ModManager::Reset(&g_manager->_modManager); in_stack_ffffff9c = (_Tree_node *)g_manager->_currentSaveSlot; this = (byte *)0x90829e; FUN_00959fa0(); iVar6 = pMVar12->_selectedMenuID; goto LAB_009082a1; } } else { LAB_009082a1: pMVar4 = g_menuManager; if (iVar6 == 2) { Menu_Character::Reset(&pMVar12->_menuCharacter); FUN_00982060(); pvVar7 = (pMVar12->_seedsObject)._seedEffects; this = (byte *)&(pMVar12->_seedsObject)._seedEffects; in_stack_ffffff9c = *(_Tree_node **)((int)pvVar7 + 4); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, in_stack_ffffff9c); *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; (pMVar12->_seedsObject)._seedEffectsCount = 0; pMVar12 = local_54; } else if (iVar6 == 5) { (pMVar12->_menuCharacter)._seedUnlockPageState = 0; (pMVar12->_menuCharacter)._seedUnlockPageTimer = 0; std::string::assign(&(pMVar12->_menuCharacter).field_0xd84,&s_empty,0); in_stack_ffffff9c = (_Tree_node *)0x0; this = &s_empty; std::string::assign(&(pMVar12->_menuCharacter).field_0xd9c,&s_empty,0); } else if (iVar6 == 7) { in_stack_ffffff9c = (_Tree_node *)0x90833a; Menu_Challenge::reset(&pMVar12->_menuChallenge); } else if (iVar6 == 0xc) { (pMVar12->_menuKeyConfig).SelectedElement = 0; (pMVar12->_menuKeyConfig).SelectedColumn = 0; *(undefined1 *)&(pMVar12->_menuKeyConfig).State = 0; pMVar4->_viewPositionSet[0xc].y = -1890.0; pMVar4->_state = 1; } } if (pMVar12->_selectedMenuID == 6) { in_stack_ffffff9c = (_Tree_node *)0x908380; Menu_SpecialSeeds::Reset(&pMVar12->_menuSpecialSeeds); } pMVar12->_selectedMenuID = 3; LAB_00908387: netplay_leave_lobby(param_2,(int)this,(int)in_stack_ffffff9c); NetplayManager::reset(param_2,1); param_2[0x16] = (NetplayManager)0xffffffff; return; } //@@ 009083b0 FUN_009083b0 void FUN_009083b0(int *param_1,void *param_2) { char cVar1; uint uVar2; byte *pbVar3; int iVar4; int in_stack_ffffffcc; int in_stack_ffffffd0; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08b55; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*param_1 == -0x21524111) { if (*(int *)((int)param_2 + 0x54) == 0) { netplay_leave_lobby(param_2,in_stack_ffffffcc,in_stack_ffffffd0); ExceptionList = local_10; return; } } else { if (*(int *)((int)param_2 + 0x54) != 0) { pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/LOBBY_CREATE_FAILED"); FUN_0090ea90(*(undefined4 *)((int)param_2 + 0x54),pbVar3); ExceptionList = local_10; return; } iVar4 = (g_manager->_lobbySettings)._gameMode; local_18 = (int *)0x0; if (iVar4 == 4) { iVar4 = 0; } local_14 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_18,&g_multiplayerLobbyPtr); local_8 = 1; if (local_18 != (int *)0x0) { (**(code **)(*local_18 + 0x24))("game_difficulty",iVar4,uVar2); } local_8 = 2; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } local_8 = 0xffffffff; FUN_009084f0(param_1,param_2); } ExceptionList = local_10; return; } //@@ 009084f0 FUN_009084f0 void FUN_009084f0(int *param_1,void *param_2) { Manager *pMVar1; undefined1 *puVar2; uint uVar3; byte *pbVar4; MenuManager *extraout_EAX; int in_stack_ffffffac; int in_stack_ffffffb0; KColor local_40; MenuManager *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b08c67; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; if (*param_1 == -0x21524111) { if (*(int *)((int)param_2 + 0x54) == 0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); netplay_leave_lobby(param_2,in_stack_ffffffac,in_stack_ffffffb0); ExceptionList = local_1c; return; } } else { if (*(int *)((int)param_2 + 0x54) != 0) { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_FAILED"); FUN_0090ea90(*(undefined4 *)((int)param_2 + 0x54),pbVar4); ExceptionList = local_1c; return; } if ((g_game == (Game *)0x0) || (g_game->_stage == 0)) { puVar2 = (undefined1 *)((int)register0x00000010 + -4); if (g_menuManager == (MenuManager *)0x0) { local_24 = operator_new(0xf930); local_14 = 0; if (local_24 == (MenuManager *)0x0) { g_menuManager = (MenuManager *)0x0; } else { MenuManager::constructor(local_24); g_menuManager = extraout_EAX; } local_14 = 0xffffffff; MenuManager::Init(g_menuManager,uVar3); puVar2 = puStack_20; } puStack_20 = puVar2; if (g_menuManager->_selectedMenuID == 0) { KColor::SetFromARGB(&local_40,0xffffffff); pMVar1 = g_manager; (g_manager->_pendingMenuFadeColor)._red = local_40._red; (pMVar1->_pendingMenuFadeColor)._green = local_40._green; (pMVar1->_pendingMenuFadeColor)._blue = local_40._blue; (pMVar1->_pendingMenuFadeColor)._alpha = local_40._alpha; pMVar1->_pendingMenuState = 0x11; (pMVar1->_pendingMenuFadeColor)._unk = local_40._unk; pMVar1->_isMenuPending = 1; ExceptionList = local_1c; return; } MenuManager::SetState(g_menuManager,0x11,1); } } ExceptionList = local_1c; return; } //@@ 00908660 FUN_00908660 void FUN_00908660(int param_1,int param_2,int param_3) { int *popupId; Manager *pMVar1; int iVar2; char cVar3; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_3e [2]; undefined4 local_28; int *local_24; undefined8 local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar2 = param_3; local_8 = 0xffffffff; puStack_c = &LAB_00b08cb0; local_10 = ExceptionList; ExceptionList = &local_10; popupId = (int *)(param_3 + 0x58); cVar3 = FUN_009c38e0(); pMVar1 = g_manager; if (cVar3 != '\0') { *(int *)(iVar2 + 0x54) = param_1; param_3 = -1; PopupManager::close(&pMVar1[1]._gamestate.field_0xcf0,popupId,¶m_3); } *popupId = -1; if (param_1 != 0) { KAGE_LogMessage(1,(byte *)"Failed to join lobby, result = %d\n"); ExceptionList = local_10; return; } if (*(code **)(iVar2 + 0x1c90) != (code *)0x0) { (**(code **)(iVar2 + 0x1c90))(); *(undefined4 *)(iVar2 + 0x1c90) = 0; *(undefined4 *)(iVar2 + 0x1c94) = 0; } pMVar1 = g_manager; if (g_menuManager != (MenuManager *)0x0) { local_28 = 0; local_24 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_28,&g_multiplayerLobbyPtr); lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_8 = 2; std::shared_ptr::assign(auStack_3e + -10,&local_28); local_8 = CONCAT31(local_8._1_3_,1); Menu_Save::select_save_slot ((Menu_Save *)&pMVar1->_lobbySettings,lobbyHandleVtable,lobby,lobbyRefCount); local_8 = 3; if (((local_24 != (int *)0x0) && (cVar3 = (**(code **)(*local_24 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = 0xffffffff; Menu_OnlineLobby::init_lobby_view(&g_menuManager->field_0xdce8); } if (*(int *)(param_2 + 4) == 0) { local_20 = 0; } KAGE_LogMessage(1,(byte *)"Successfully joined lobby %llu\n"); ExceptionList = local_10; return; } //@@ 00908830 FUN_00908830 void FUN_00908830(int param_1,undefined4 param_2,int *param_3) { undefined4 *puVar1; Manager *pMVar2; char cVar3; undefined4 *puVar4; int *piVar5; if (param_1 == 0) { if ((code *)param_3[0x724] != (code *)0x0) { (*(code *)param_3[0x724])(param_3[0x725]); param_3[0x724] = 0; param_3[0x725] = 0; } pMVar2 = g_manager; puVar1 = (g_manager->_lobbyMembers)._end; puVar4 = (g_manager->_lobbyMembers)._begin; if (puVar4 != puVar1) { do { *puVar4 = KAGE::System::UserProfileBase::vftable; puVar4 = puVar4 + 5; } while (puVar4 != puVar1); puVar4 = (pMVar2->_lobbyMembers)._begin; } (pMVar2->_lobbyMembers)._end = puVar4; piVar5 = (int *)*param_3; if (piVar5 != (int *)param_3[1]) { do { cVar3 = (**(code **)(*(int *)(*piVar5 + 0x370) + 0x14))(); if (cVar3 == '\0') { NetplayManager::RemoveRemotePlayer(*piVar5 + 0x370); piVar5 = (int *)*param_3; } else { piVar5 = piVar5 + 1; } } while (piVar5 != (int *)param_3[1]); } } return; } //@@ 009088e0 netplay_lobby_join_requested_callback /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? callback registered twice by SaveSlotManager::constructor (push 0x9088e0 at 0x9069eb/0x906ab7); takes a ConstLobby, online_check_game_version, online_lobby_is_user_banned, show_beta_disclaimer_popup, closes popup and queues ##GAME###Online/CONNECTING_TO_SERVER */ void netplay_lobby_join_requested_callback(undefined4 *param_1,undefined1 *param_2) { Manager *pMVar1; Manager *pMVar2; Vector VVar3; byte bVar4; char cVar5; undefined4 *puVar6; int iVar7; undefined **ppuVar8; void *pvVar9; void *pvVar10; void *propertiesRefCount; undefined1 auStack_f6 [2]; undefined1 local_ec [164]; undefined4 local_48; char *local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; float local_24; float local_20; undefined4 local_1c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar10 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b08d05; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c82bc0) { _Init_thread_header(); if (DAT_00c82bc0 == -1) { iVar7 = *(int *)((int)pvVar10 + 4); if (iVar7 == 0) { local_18.x = 0.0; local_18.y = 0.0; VVar3 = local_18; local_18.y = 0.0; local_18.x = 0.0; DAT_00c82bcc = local_18.y; _DAT_00c82bc8 = local_18.x; local_18 = VVar3; } else { DAT_00c82bcc = *(float *)(iVar7 + 0xc); _DAT_00c82bc8 = *(float *)(iVar7 + 8); } _Init_thread_footer(); } } param_1 = (undefined4 *)(auStack_f6 + -0xe); ppuVar8 = KAGE::Network::Multiplayer::ConstLobby::vftable; pvVar9 = (void *)0x0; propertiesRefCount = (void *)0x0; local_8 = 0; std::shared_ptr::assign(auStack_f6 + -10,(void *)((int)pvVar10 + 4)); local_8 = 0xffffffff; bVar4 = online_check_game_version(ppuVar8,pvVar9,propertiesRefCount); if (bVar4 != 0) { bVar4 = online_lobby_is_user_banned(pvVar10); if (bVar4 == 0) { bVar4 = show_beta_disclaimer_popup(1,FUN_00913870,&DAT_00c82bc8); if (bVar4 == 0) { puVar6 = operator_new(0xc); local_8 = 1; param_1 = puVar6; if (puVar6 == (undefined4 *)0x0) { puVar6 = (undefined4 *)0x0; } else { *puVar6 = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(); } local_8 = 0xffffffff; std::shared_ptr::assign(puVar6 + 1,(void *)((int)pvVar10 + 4)); if (g_multiplayerService == (void *)0x0) { cVar5 = FUN_009c38e0(); if (cVar5 != '\0') { param_1 = (undefined4 *)0xffffffff; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0, (int *)(g_manager[1]._persistentGameData._achievements + 8), (int *)¶m_1); } pMVar2 = g_manager; param_2 = auStack_f6 + -0xe; pMVar1 = g_manager + 1; (pMVar1->_persistentGameData)._achievements[8] = 0xff; (pMVar1->_persistentGameData)._achievements[9] = 0xff; (pMVar1->_persistentGameData)._achievements[10] = 0xff; (pMVar1->_persistentGameData)._achievements[0xb] = 0xff; ppuVar8 = KAGE::Network::Multiplayer::ConstLobby::vftable; pvVar10 = (void *)0x0; pvVar9 = (void *)0x0; local_8 = 2; std::shared_ptr::assign(auStack_f6 + -10,puVar6 + 1); local_8 = 0xffffffff; NetplayManager::request_join_lobby(&pMVar2->_netplayManager,ppuVar8,pvVar10,pvVar9); if (puVar6 != (undefined4 *)0x0) { (**(code **)*puVar6)(); } } else { _DAT_00c5abc4 = _DAT_00c5abc4 | 2; DAT_00c5abd0 = FUN_00908be0; DAT_00c5abd4 = puVar6; cVar5 = (**(code **)(*(int *)g_multiplayerService + 0xc))(); if (cVar5 != '\0') { local_18.x = -1.0; local_18.y = -1.0; MessagePopup::MessagePopup (local_ec,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_18); local_8 = 3; local_38 = 0x3e5cdcdd; uStack_34 = 0x3e2cacad; uStack_30 = 0x3e34b4b5; uStack_2c = 0x3f800000; local_24 = g_vectorZero.x; local_48 = 0; local_44 = "##GAME###Online/CONNECTING_TO_SERVER"; local_40 = 0xffffffff; local_3c = 0xffffffff; local_28 = 0; local_20 = g_vectorZero.y; local_1c = 1; std::vector<48byte>::push_back(); iVar7 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_ec); *(int *)((int)param_2 + 0x58) = iVar7; FUN_00420710(); ExceptionList = local_10; return; } } } } } ExceptionList = local_10; return; } //@@ 00908be0 FUN_00908be0 void FUN_00908be0(int param_1,undefined4 *param_2) { Manager *pMVar1; Manager *pMVar2; char cVar3; undefined **lobbyVftable; void *lobby; void *lobbyRefCount; undefined1 auStack_1e [2]; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08d40; local_10 = ExceptionList; ExceptionList = &local_10; cVar3 = FUN_009c38e0(); if (cVar3 != '\0') { local_14 = -1; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0, (int *)(g_manager[1]._persistentGameData._achievements + 8),&local_14); } pMVar2 = g_manager; pMVar1 = g_manager + 1; (pMVar1->_persistentGameData)._achievements[8] = 0xff; (pMVar1->_persistentGameData)._achievements[9] = 0xff; (pMVar1->_persistentGameData)._achievements[10] = 0xff; (pMVar1->_persistentGameData)._achievements[0xb] = 0xff; if (param_1 == 0) { lobbyVftable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_8 = 0; std::shared_ptr::assign(auStack_1e + -10,param_2 + 1); local_8 = 0xffffffff; NetplayManager::request_join_lobby(&pMVar2->_netplayManager,lobbyVftable,lobby,lobbyRefCount); } else { string_table_translate(&pMVar2->_stringTable,(byte *)"#LOBBY_JOIN_FAILED"); FUN_0090ea90(); } if (param_2 != (undefined4 *)0x0) { (**(code **)*param_2)(); } ExceptionList = local_10; return; } //@@ 00908ce0 netplay_leave_lobby_callback /* DB: ? callback passed to Multiplayer::leave_lobby by NetplayManager::join_pending_lobby: result 0 -> LobbyList::clear and fade the game out (fadeSpeed 0.08, target 3), else shows "#LOBBY_JOIN_FAILED" via FUN_0090ea90 */ void netplay_leave_lobby_callback(int param_1,undefined4 param_2,int param_3) { float fVar1; Game *pGVar2; char cVar3; byte *pbVar4; KColor local_50; undefined **ppuStack_34; undefined1 auStack_30 [4]; int *local_2c; undefined8 local_28; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = auStack_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00b08d6d; local_1c = ExceptionList; ExceptionList = &local_1c; FUN_00908830(param_1,param_2,param_3,__security_cookie ^ (uint)(auStack_30 + 0x20)); if (param_1 == 0) { LobbyList::clear(&g_manager[1]._gamestate.field_0x288); KColor::SetFromARGB(&local_50,0xff000000); pGVar2 = g_game; fVar1 = (g_game->_fadeOutColor)._alpha; g_game->_fadeSpeed = 0.08; pGVar2->_fadeOutTarget = 3; (pGVar2->_fadeOutColor)._red = local_50._red; (pGVar2->_fadeOutColor)._green = local_50._green; (pGVar2->_fadeOutColor)._blue = local_50._blue; (pGVar2->_fadeOutColor)._alpha = fVar1; (pGVar2->_fadeOutColor)._unk = 0; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08; ExceptionList = local_1c; return; } local_28 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_28); local_14 = 0; std::shared_ptr::assign((void *)(param_3 + 0x1894),auStack_30); ppuStack_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 1; if (local_2c != (int *)0x0) { cVar3 = (**(code **)(*local_2c + 0xc))(); if ((cVar3 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(auStack_30); } } local_14 = 0xffffffff; pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#LOBBY_JOIN_FAILED"); FUN_0090ea90(param_1,pbVar4); ExceptionList = local_1c; return; } //@@ 00908e70 NetplayManager::QueueRemovePlayer /* DB: log text "NetManager::QueueRemovePlayer() Queueing remove player"; update_player_removal */ void NetplayManager::QueueRemovePlayer(float *param_1) { char cVar1; Entity_Player *pEVar2; undefined4 uVar3; PlayerManager *in_ECX; undefined4 uVar4; uint size; void *ptr; float fVar5; undefined4 uStack_40; Entity_Player *pEStack_3c; undefined4 uStack_38; void *pvStack_34; undefined4 uStack_30; int iStack_2c; undefined8 uStack_28; undefined8 local_20; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b08d9d; local_10 = ExceptionList; ExceptionList = &local_10; if (((Vector *)(param_1 + 1))->x == 0.0) { local_20 = 0; } (**(code **)((int)*param_1 + 4))(__security_cookie ^ (int)register0x00000010 - 4U); KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::QueueRemovePlayer() Queueing remove player \"%s\" %llu \n" ); fVar5 = ((Vector *)(param_1 + 1))->x; if (fVar5 == 0.0) { local_20._4_4_ = (Entity_Player *)0x0; local_20._0_4_ = 0; } else { local_20._0_4_ = *(undefined4 *)((int)fVar5 + 8); local_20._4_4_ = *(Entity_Player **)((int)fVar5 + 0xc); } pEVar2 = PlayerManager::get_player_by_user_id(in_ECX,&local_20); local_20._4_4_ = pEVar2; if (pEVar2 != (Entity_Player *)0x0) { if ((char)in_ECX[0x15]._coopSlots[0]._state == '\0') { cVar1 = FUN_008feaa0(pEVar2); if (cVar1 != '\0') { if (fVar5 == 0.0) { uStack_28 = 0; } (**(code **)((int)*param_1 + 4))(); KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::QueueRemovePlayer() Player \"%s\" %llu is already queued to by dropped by the Desync Handler (Removing player from Desync Handler) \n" ); fVar5 = ((local_20._4_4_)->_sizeMulti).x; if (fVar5 == 0.0) { uStack_28 = 0; uStack_28._4_4_ = 0; uStack_28._0_4_ = 0; uVar3 = uStack_28._4_4_; uVar4 = (undefined4)uStack_28; } else { uVar3 = *(undefined4 *)((int)fVar5 + 0xc); uVar4 = *(undefined4 *)((int)fVar5 + 8); } FUN_008feaf0(uVar4,uVar3); fVar5 = ((Vector *)(param_1 + 1))->x; } if (fVar5 == 0.0) { uStack_28 = 0; uStack_28._4_4_ = 0; uStack_28._0_4_ = 0; uVar3 = uStack_28._4_4_; uVar4 = (undefined4)uStack_28; } else { uVar3 = *(undefined4 *)((int)fVar5 + 0xc); uVar4 = *(undefined4 *)((int)fVar5 + 8); } cVar1 = is_player_removal_queued(uVar4,uVar3); if (cVar1 != '\0') { if (fVar5 == 0.0) { uStack_28 = 0; } (**(code **)((int)*param_1 + 4))(); KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::QueueRemovePlayer() Player \"%s\" %llu is already queued for removal (Ignoring queue request) \n" ); ExceptionList = local_10; return; } if (fVar5 == 0.0) { uStack_28 = 0; } (**(code **)((int)*param_1 + 4))(); KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::QueueRemovePlayer() Adding player \"%s\" %llu to pending removals\n" ); uStack_40 = 0; pEStack_3c = local_20._4_4_; uStack_38 = 0; pvStack_34 = (void *)0x0; uStack_30 = 0; iStack_2c = 0; uStack_8 = 0; FUN_00913ac0(&uStack_40); if (pvStack_34 == (void *)0x0) { ExceptionList = local_10; return; } size = iStack_2c - (int)pvStack_34 & 0xfffffff8; ptr = pvStack_34; if (0xfff < size) { ptr = *(void **)((int)pvStack_34 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvStack_34 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); ExceptionList = local_10; return; } param_1 = &pEVar2->_size; } RemoveRemotePlayer(param_1); ExceptionList = local_10; return; } //@@ 00909110 FUN_00909110 void FUN_00909110(void) { std::vector::_Tidy(); return; } //@@ 00909120 NetplayManager::is_player_removal_queued /* DB: ECX=NetplayManager: scans the 0x18-byte removal queue +0x186c..+0x1870 comparing entry player's +0x374 UserProfile id with (lo,hi); update_player_removal */ uint NetplayManager::is_player_removal_queued(int param_1,uint param_2) { int iVar1; int iVar2; int in_ECX; int iVar3; int *piVar4; uint uVar5; int local_c; uint uStack_8; iVar3 = *(int *)(in_ECX + 0x1870) - *(int *)(in_ECX + 0x186c); uStack_8 = iVar3 * 0x2aaaaaab; iVar2 = iVar3 >> 0x1f; iVar3 = iVar3 / 0x18 + iVar2; uVar5 = 0; if (iVar3 != iVar2) { piVar4 = (int *)(*(int *)(in_ECX + 0x186c) + 4); do { iVar1 = *(int *)(*piVar4 + 0x374); if (iVar1 == 0) { uStack_8 = 0; local_c = 0; } else { local_c = *(int *)(iVar1 + 8); uStack_8 = *(uint *)(iVar1 + 0xc); } if ((local_c == param_1) && (uStack_8 == param_2)) { return CONCAT31((int3)(uStack_8 >> 8),1); } uVar5 = uVar5 + 1; piVar4 = piVar4 + 6; } while (uVar5 < (uint)(iVar3 - iVar2)); } return uStack_8 & 0xffffff00; } //@@ 009091a0 NetplayManager::RemoveRemotePlayer /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: log text "NetManager::RemoveRemotePlayer(UserProfile) Removing remote player"; called with player+0x370 UserProfile from update_player_removal */ void NetplayManager::RemoveRemotePlayer(EntityPtr param_1) { void **ppvVar1; int iVar2; Room *pRVar3; int *piVar4; qword qVar5; Game *pGVar6; Manager *pMVar7; EntityPtr EVar8; Vector VVar9; byte bVar10; char cVar11; uint uVar12; Entity_Player *pEVar13; int iVar14; Vector *pVVar15; Entity_Player *pEVar16; NetplayManager NVar17; undefined4 uVar18; int *piVar19; byte unusedBool; NetplayManager *in_ECX; float fVar20; uint uVar21; float fVar22; qword *pqVar23; void *pvVar24; NetplayManager NVar25; uint uVar26; longlong lVar27; void *pvVar28; undefined1 *puVar29; Vector VStack_7c; NetplayManager *local_74; undefined1 auStack_70 [12]; NetplayManager local_64; undefined4 uStack_60; Entity_Player *pEStack_5c; EntityPtr local_54; int local_50; float local_4c; Vector local_48; undefined4 local_40 [2]; undefined8 local_38; NetplayManager local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)(local_40 + 0xf); local_14 = 0xffffffff; puStack_18 = &LAB_00b08dd5; local_1c = ExceptionList; uVar12 = __security_cookie ^ (uint)(local_40 + 0xc); ExceptionList = &local_1c; local_54 = param_1; iVar14 = *(int *)((int)param_1 + 4); if (iVar14 == 0) { local_48.x = 0.0; local_48.y = 0.0; VVar9 = local_48; local_48.y = 0.0; local_48.x = 0.0; fVar22 = local_48.y; fVar20 = local_48.x; local_48 = VVar9; } else { fVar22 = *(float *)(iVar14 + 0xc); fVar20 = *(float *)(iVar14 + 8); } local_74 = in_ECX; local_24 = uVar12; remove_drop_entry(fVar20,fVar22); iVar14 = *(int *)((int)param_1 + 4); if (iVar14 == 0) { local_48.x = 0.0; local_48.y = 0.0; VVar9 = local_48; local_48.y = 0.0; local_48.x = 0.0; fVar22 = local_48.y; fVar20 = local_48.x; local_48 = VVar9; } else { fVar22 = *(float *)(iVar14 + 0xc); fVar20 = *(float *)(iVar14 + 8); } bVar10 = is_user_in_player_list(in_ECX,CONCAT44(fVar22,fVar20)); if (bVar10 == 0) { local_40[0] = 4; if (*(int *)((int)param_1 + 4) == 0) { local_38 = 0; } else { local_38 = *(undefined8 *)(*(int *)((int)param_1 + 4) + 8); } local_30 = in_ECX[3]; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } puVar29 = &DAT_00000005; pvVar28 = (void *)0x18; NetConnection::send_message(g_multiplayerService,auStack_70 + 8,1,local_40,0x18,5); local_14 = 0; FUN_008ef1d0(auStack_70 + 8); multiplayer_send_message((void *)param_1,pvVar28,puVar29); local_14 = 1; if (((local_64 != (NetplayManager)0x0) && (cVar11 = (**(code **)(*(int *)local_64 + 0xc))(), cVar11 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(auStack_70 + 8); } local_14 = 0xffffffff; } local_4c = 0.0; if ((int)in_ECX[0x617] - (int)in_ECX[0x616] >> 4 != 0) { local_50 = 0; do { local_48 = (Vector)FUN_00a23920(uVar12); FUN_00914480(&local_48); local_4c = (float)((int)local_4c + 1); local_50 = local_50 + 0x10; } while ((uint)local_4c < (uint)((int)in_ECX[0x617] - (int)in_ECX[0x616] >> 4)); param_1 = local_54; } iVar14 = *(int *)((int)param_1 + 4); if (iVar14 == 0) { local_48.x = 0.0; local_48.y = 0.0; local_4c = 0.0; local_50 = 0; } else { local_50 = *(undefined4 *)(iVar14 + 8); local_4c = *(float *)(iVar14 + 0xc); } (**(code **)(*(int *)param_1 + 4))(); KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::RemoveRemotePlayer(UserProfile) Removing remote player \"%s\" %llu \n" ); pvVar28 = (g_manager->_lobbyMembers)._begin; pEStack_5c = (g_manager->_lobbyMembers)._end; if (pvVar28 != pEStack_5c) { LAB_009093b4: iVar14 = *(int *)((int)pvVar28 + 4); if (iVar14 == 0) { local_48.x = 0.0; local_48.y = 0.0; local_50 = 0; local_4c = 0.0; } else { local_4c = *(float *)(iVar14 + 8); local_50 = *(undefined4 *)(iVar14 + 0xc); } pvVar24 = (void *)((int)pvVar28 + 0x14); lVar27 = FUN_00a23920(); if (lVar27 != CONCAT44(local_50,local_4c)) goto LAB_009093f2; if (pvVar24 == pEStack_5c) { pEVar13 = pEStack_5c; } else { puVar29 = (undefined1 *)((int)pvVar28 + 8); do { *(undefined4 *)(puVar29 + -4) = *(undefined4 *)(puVar29 + 0x10); pvVar24 = (void *)((int)pvVar24 + 0x14); *puVar29 = puVar29[0x14]; *(undefined4 *)(puVar29 + 4) = *(undefined4 *)(puVar29 + 0x18); *(undefined4 *)(puVar29 + 8) = *(undefined4 *)(puVar29 + 0x1c); puVar29 = puVar29 + 0x14; } while (pvVar24 != pEStack_5c); pEVar13 = (g_manager->_lobbyMembers)._end; } pMVar7 = g_manager; *(undefined ***)((int)pEVar13 + -0x14) = KAGE::System::UserProfileBase::vftable; ppvVar1 = &(pMVar7->_lobbyMembers)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -0x14); } LAB_00909444: iVar14 = *(int *)((int)local_54 + 4); if (iVar14 == 0) { local_48.x = 0.0; local_48.y = 0.0; VVar9 = local_48; local_48.y = 0.0; local_48.x = 0.0; fVar22 = local_48.y; fVar20 = local_48.x; local_48 = VVar9; } else { fVar22 = *(float *)(iVar14 + 0xc); fVar20 = *(float *)(iVar14 + 8); } FUN_008feaf0(fVar20,fVar22); NVar25 = in_ECX[1]; local_64 = *in_ECX; fVar22 = (float)((int)NVar25 - (int)local_64 >> 2); local_4c = 0.0; local_48.y = fVar22; if (fVar22 == 0.0) { LAB_00909b6b: local_64 = (NetplayManager)0x0; VStack_7c.y = *(float *)in_ECX; uVar12 = (int)NVar25 - (int)VStack_7c.y >> 2; if (uVar12 != 0) { piVar4 = (g_game->_playerManager)._playerList._begin; uVar26 = (int)(g_game->_playerManager)._playerList._end - (int)piVar4 >> 2; do { uVar21 = 0; if (uVar26 != 0) { piVar19 = piVar4; do { iVar14 = *piVar19; if (*(int *)(iVar14 + 0x1618) == *(int *)(*(int *)VStack_7c.y + 0xc)) { if ((iVar14 != 0) && (*(char *)(iVar14 + 0x20a9) == '\0')) { ExceptionList = local_1c; return; } break; } uVar21 = uVar21 + 1; piVar19 = piVar19 + 1; } while (uVar21 < uVar26); } local_64 = (NetplayManager)((int)local_64 + 1); VStack_7c.y = (float)((int)VStack_7c.y + 4); } while ((uint)local_64 < uVar12); in_ECX = local_74; } if (*(int *)&g_game->_deathmatchManager < 2) { in_ECX[0x62d] = (NetplayManager)0x0; in_ECX[0x62c] = (NetplayManager)((int)in_ECX[3] + 0x3c); } ExceptionList = local_1c; return; } while( true ) { iVar14 = *(int *)local_64; iVar2 = *(int *)(iVar14 + 0x374); if (iVar2 == 0) { VStack_7c.y = 0.0; uStack_60 = 0; pEStack_5c = (Entity_Player *)0x0; } else { pEStack_5c = *(Entity_Player **)(iVar2 + 8); VStack_7c.y = *(float *)(iVar2 + 0xc); } local_50 = iVar14; lVar27 = FUN_00a23920(); if (lVar27 == CONCAT44(VStack_7c.y,pEStack_5c)) break; local_4c = (float)((int)local_4c + 1); local_64 = (NetplayManager)((int)local_64 + 4); if ((uint)local_48.y <= (uint)local_4c) goto LAB_00909b68; } if (iVar14 != 0) { pEVar13 = (Entity_Player *)FUN_004253d0(); if (pEVar13 == (Entity_Player *)0x0) { in_ECX = local_74; } else { if (*(char *)g_game->_room != '\0') { local_64 = (NetplayManager)0x2; do { iVar14 = FUN_004253d0(); bVar10 = 0; local_48.x = *(float *)(iVar14 + 0x33c); local_48.y = *(float *)(iVar14 + 0x340); pVVar15 = Room::FindFreePickupSpawnPosition(g_game->_room,&VStack_7c,&local_48,0.0,0,0,0); Entity_Player::DropTrinket(pEVar13,pVVar15,bVar10); local_64 = (NetplayManager)((int)local_64 + -1); } while (local_64 != (NetplayManager)0x0); local_64 = (NetplayManager)0x0; pEVar16 = (Entity_Player *)FUN_004253d0(); uVar12 = Entity_Player::GetMaxPocketItems(pEVar16); if (uVar12 != 0) { do { pRVar3 = g_game->_room; iVar14 = FUN_004253d0(); local_48.x = *(float *)(iVar14 + 0x33c); local_48.y = *(float *)(iVar14 + 0x340); pVVar15 = Room::FindFreePickupSpawnPosition(pRVar3,&VStack_7c,&local_48,0.0,0,0,0); NVar25 = local_64; Entity_Player::DropPocketItem(pEVar13,(int)local_64,pVVar15); local_64 = (NetplayManager)((int)NVar25 + 1); pEVar16 = (Entity_Player *)FUN_004253d0(); NVar17 = (NetplayManager)Entity_Player::GetMaxPocketItems(pEVar16); } while ((uint)((int)NVar25 + 1) < (uint)NVar17); } bVar10 = Entity_Player::HasCollectible(pEVar13,0x147,0); if (bVar10 != 0) { Entity_Player::RemoveCollectible(pEVar13,0x147,0,0,1); pRVar3 = g_game->_room; pVVar15 = Room::GetCenterPos((Vector *)(auStack_70 + 8)); Room::FindFreePickupSpawnPosition(pRVar3,&local_48,pVVar15,0.0,1,0,0); uVar12 = Random(); Game::Spawn(g_game,5,100,&local_48,&g_vectorZero,(Entity *)0x0,0x147,uVar12); } bVar10 = Entity_Player::HasCollectible(pEVar13,0x148,0); if (bVar10 != 0) { Entity_Player::RemoveCollectible(pEVar13,0x148,0,0,1); pRVar3 = g_game->_room; pVVar15 = Room::GetCenterPos((Vector *)(auStack_70 + 8)); Room::FindFreePickupSpawnPosition(pRVar3,&local_48,pVVar15,0.0,1,0,0); uVar12 = Random(); Game::Spawn(g_game,5,100,&local_48,&g_vectorZero,(Entity *)0x0,0x148,uVar12); } bVar10 = Entity_Player::HasCollectible(pEVar13,0xee,0); if (bVar10 != 0) { Entity_Player::RemoveCollectible(pEVar13,0xee,0,0,1); pRVar3 = g_game->_room; pVVar15 = Room::GetCenterPos((Vector *)(auStack_70 + 8)); Room::FindFreePickupSpawnPosition(pRVar3,&local_48,pVVar15,0.0,1,0,0); uVar12 = Random(); Game::Spawn(g_game,5,100,&local_48,&g_vectorZero,(Entity *)0x0,0xee,uVar12); } bVar10 = Entity_Player::HasCollectible(pEVar13,0xef,0); if (bVar10 != 0) { Entity_Player::RemoveCollectible(pEVar13,0xef,0,0,1); pRVar3 = g_game->_room; pVVar15 = Room::GetCenterPos((Vector *)(auStack_70 + 8)); Room::FindFreePickupSpawnPosition(pRVar3,&local_48,pVVar15,0.0,1,0,0); uVar12 = Random(); Game::Spawn(g_game,5,100,&local_48,&g_vectorZero,(Entity *)0x0,0xef,uVar12); } bVar10 = Entity_Player::HasCollectible(pEVar13,0x272,0); if (bVar10 != 0) { Entity_Player::RemoveCollectible(pEVar13,0x272,0,0,1); pRVar3 = g_game->_room; pVVar15 = Room::GetCenterPos((Vector *)(auStack_70 + 8)); Room::FindFreePickupSpawnPosition(pRVar3,&local_48,pVVar15,0.0,1,0,0); uVar12 = Random(); Game::Spawn(g_game,5,100,&local_48,&g_vectorZero,(Entity *)0x0,0x272,uVar12); } bVar10 = Entity_Player::HasCollectible(pEVar13,0x273,0); if (bVar10 != 0) { Entity_Player::RemoveCollectible(pEVar13,0x273,0,0,1); pRVar3 = g_game->_room; pVVar15 = Room::GetCenterPos((Vector *)(auStack_70 + 8)); Room::FindFreePickupSpawnPosition(pRVar3,&local_48,pVVar15,0.0,1,0,0); uVar12 = Random(); Game::Spawn(g_game,5,100,&local_48,&g_vectorZero,(Entity *)0x0,0x273,uVar12); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)auStack_70,6,0xb,-1, 0,0); NVar25 = (NetplayManager)0x0; local_14 = 2; if (local_64 != (NetplayManager)0x0) { do { if (*(Entity_Player **)(*(int *)(auStack_70._4_4_ + (int)NVar25 * 4) + 0x3c8) == pEVar13 ) { uVar12 = Random(); iVar14 = *(int *)(auStack_70._4_4_ + (int)NVar25 * 4); local_48.x = *(float *)(iVar14 + 0x33c); local_48.y = *(float *)(iVar14 + 0x340); Game::Spawn(g_game,1000,0xf,&local_48,&g_vectorZero,(Entity *)0x0,0,uVar12); (**(code **)(**(int **)(auStack_70._4_4_ + (int)NVar25 * 4) + 0x28))(); } NVar25 = (NetplayManager)((int)NVar25 + 1); } while ((uint)NVar25 < (uint)local_64); } local_14 = 0xffffffff; if (auStack_70[0] == '\0') { if (g_mainHeap == (void *)0x0) { pqVar23 = &g_allocatedBytesNoHeap; } else { pqVar23 = (qword *)((int)g_mainHeap + 0x30); } if ((void *)auStack_70._4_4_ != (void *)0x0) { uVar12 = *(uint *)(auStack_70._4_4_ + -4); qVar5 = *pqVar23; *(uint *)pqVar23 = (uint)*pqVar23 - uVar12; *(uint *)((int)pqVar23 + 4) = *(uint *)((int)pqVar23 + 4) - (uint)((uint)qVar5 < uVar12) ; free((uint *)(auStack_70._4_4_ + -4)); } } local_14 = 0xffffffff; iVar14 = local_50; } uVar18 = FUN_004253d0(); in_ECX = local_74; iVar2 = *(int *)(iVar14 + 0x374); if (iVar2 == 0) { local_48.y = 0.0; local_48.x = 0.0; } else { local_48.x = *(float *)(iVar2 + 8); local_48.y = *(float *)(iVar2 + 0xc); } FUN_0090c740(&local_48,uVar18); } } pEStack_5c = (Entity_Player *)FUN_004253d0(); if (pEStack_5c != (Entity_Player *)0x0) { local_54 = pEStack_5c->_twinPlayer; Entity_Player::TriggerDeath(pEStack_5c,0); PlayerManager::RemoveCoPlayer(&g_game->_playerManager,pEStack_5c,unusedBool); pvVar28 = g_game->_room; EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1238),(Entity *)pEStack_5c); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1258),(Entity *)pEStack_5c); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1248),(Entity *)pEStack_5c); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1268),(Entity *)pEStack_5c); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x12a8),(Entity *)pEStack_5c); pEStack_5c->_valid = 0; EntityList::invalidate_type_cache ((EntityList *)((int)pvVar28 + 0x1218),pEStack_5c->_type,pEStack_5c->_variant, pEStack_5c->_subtype); pGVar6 = g_game; if (*(Entity_Player **)&(g_game->_playerManager).field_0x7c == pEStack_5c) { *(undefined4 *)&(g_game->_playerManager).field_0x7c = 0; } if (local_54 != (EntityPtr)0x0) { pvVar28 = pGVar6->_room; EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1238),(Entity *)local_54); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1258),(Entity *)local_54); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1248),(Entity *)local_54); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x1268),(Entity *)local_54); EntityList_EL::remove((EntityList_EL *)((int)pvVar28 + 0x12a8),(Entity *)local_54); *(undefined1 *)((int)local_54 + 0x170) = 0; EntityList::invalidate_type_cache ((EntityList *)((int)pvVar28 + 0x1218),*(int *)((int)local_54 + 0x28), *(int *)((int)local_54 + 0x2c),*(int *)((int)local_54 + 0x30)); EVar8 = local_54; (**(code **)(*(int *)local_54 + 0x44))(); (*(code *)**(undefined4 **)EVar8)(1); } pEVar13 = pEStack_5c; (**(code **)(*(int *)pEStack_5c + 0x44))(); (*(code *)**(undefined4 **)pEVar13)(1); iVar14 = local_50; } KAGE_LogMessage(1,(byte *)"[Frame %d] Removing input device with ID %d \n"); pvVar24 = (void *)((int)*in_ECX + (int)local_4c * 4); pvVar28 = (void *)((int)pvVar24 + 4); memmove(pvVar24,pvVar28,(int)in_ECX[1] - (int)pvVar28); in_ECX[1] = (NetplayManager)((int)in_ECX[1] + -4); FUN_00906020(iVar14); LAB_00909b68: NVar25 = in_ECX[1]; goto LAB_00909b6b; LAB_009093f2: pvVar28 = pvVar24; if (pvVar24 == pEStack_5c) goto LAB_00909444; goto LAB_009093b4; } //@@ 00909c40 FUN_00909c40 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00909c40(undefined4 param_1,undefined4 param_2) { undefined8 uVar1; char cVar2; uint uVar3; void *pvVar4; int extraout_EAX; int *piVar5; int *piVar6; int iVar7; byte *text; char *this; undefined4 *puVar8; NetplayManager *in_ECX; byte ****ppppbVar9; undefined4 uVar10; undefined4 uVar11; undefined1 auStack_94 [4]; undefined4 local_90; undefined4 local_8c; undefined8 uStack_88; undefined **local_80; uint local_7c; int *piStack_78; int *piStack_74; void *apvStack_70 [5]; uint uStack_5c; void *apvStack_58 [2]; undefined4 uStack_50; undefined4 uStack_4c; NetplayManager NStack_48; uint uStack_44; byte ****ppppbStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 uStack_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(apvStack_58 + 0x15); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b08e50; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(apvStack_58 + 0x12); ExceptionList = &local_1c; local_8c = param_2; local_90 = param_1; local_24 = uVar3; pvVar4 = NetplayManager::get_drop_entry(in_ECX,CONCAT44(param_2,param_1)); if (pvVar4 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "[Frame: %d] NetManager::VoteToDrop() encountered invalid player ID: %llu \n" ); } else { local_80 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(pvVar4); local_14 = (void *)0x0; local_80 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_80); } local_14 = (void *)0x1; (*(code *)local_80[1])(uVar3); KAGE_LogMessage(1,(byte *)"[Frame: %d] NetManager::VoteToDrop() Voting to drop player \"%s\" \n" ); local_14 = (void *)0xffffffff; if (g_userProfile == (void *)0x0) { piStack_78 = (int *)0x0; piVar6 = piStack_78; piStack_74 = (int *)0x0; piStack_78 = (int *)0x0; piVar5 = piStack_78; piStack_78 = piVar6; } else { piStack_74 = *(int **)((int)g_userProfile + 0xc); piVar5 = *(int **)((int)g_userProfile + 8); } uStack_88 = CONCAT44(piStack_74,piVar5); local_7c = (uint)piStack_74; piStack_74 = piVar5; FUN_00731ee0(&uStack_30,&uStack_88); if ((((*(char *)(uStack_2c._4_4_ + 0xd) == '\0') && (*(uint *)(uStack_2c._4_4_ + 0x14) <= local_7c)) && ((*(uint *)(uStack_2c._4_4_ + 0x14) < local_7c || (*(int **)(uStack_2c._4_4_ + 0x10) <= piStack_74)))) && (uStack_2c._4_4_ != *(int *)((int)pvVar4 + 8))) { ExceptionList = local_1c; return; } uStack_88 = CONCAT44(local_7c,piStack_74); piVar6 = (int *)FUN_00915960(&local_80,&uStack_88); apvStack_58[0] = (void *)0x0; *(undefined1 *)(*piVar6 + 0x18) = 1; uStack_50 = local_90; uStack_4c = local_8c; NStack_48 = in_ECX[3]; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } uVar11 = 5; uVar10 = 0x18; NetConnection::send_message(g_multiplayerService,&piStack_78,1,apvStack_58,0x18,5); local_14 = (void *)0x2; FUN_008ef1d0(&piStack_78); FUN_00a29a40(0,uVar10,uVar11); cVar2 = FUN_00905ea0(); if (cVar2 != '\0') { iVar7 = FUN_00905ef0(auStack_94); local_14._0_1_ = 3; iVar7 = *(int *)(iVar7 + 4); if (iVar7 == 0) { uStack_88 = 0; uStack_88._4_4_ = 0; uStack_88._0_4_ = 0; uVar10 = uStack_88._4_4_; uVar11 = (undefined4)uStack_88; } else { uVar10 = *(undefined4 *)(iVar7 + 0xc); uVar11 = *(undefined4 *)(iVar7 + 8); } NetplayManager::ban_user(uVar11,uVar10); local_14._0_1_ = 2; piVar6 = (int *)FUN_00905ef0(&uStack_88); local_14._0_1_ = 4; text = (byte *)(**(code **)(*piVar6 + 4))(); this = std::string::string_from_cstr((char *)apvStack_70,text); local_14._0_1_ = 5; puVar8 = std::string::append(this,(byte *)" WAS KICKED",0xb); ppppbStack_3c = (byte ****)*puVar8; uStack_38 = puVar8[1]; uStack_34 = puVar8[2]; uStack_30 = puVar8[3]; uVar1 = *(undefined8 *)(puVar8 + 4); puVar8[4] = 0; puVar8[5] = 0xf; *(undefined1 *)puVar8 = 0; local_14._0_1_ = 6; uStack_2c._4_4_ = (uint)((ulonglong)uVar1 >> 0x20); ppppbVar9 = (byte ****)&ppppbStack_3c; if (0xf < uStack_2c._4_4_) { ppppbVar9 = ppppbStack_3c; } uVar10 = 0x909ea3; uStack_2c = uVar1; std::string::string_from_cstr((char *)apvStack_58,(byte *)ppppbVar9); local_14._0_1_ = 7; FUN_00428b60(apvStack_58,0x6e,uVar10,ppppbVar9); local_14._0_1_ = 6; if (0xf < uStack_44) { uVar3 = uStack_44 + 1; pvVar4 = apvStack_58[0]; if (0xfff < uVar3) { pvVar4 = *(void **)((int)apvStack_58[0] + -4); uVar3 = uStack_44 + 0x24; if (0x1f < (uint)((int)apvStack_58[0] + (-4 - (int)pvVar4))) goto LAB_00909f49; } operator_delete(pvVar4,uVar3); } local_14._0_1_ = 5; if (0xf < uStack_2c._4_4_) { uVar3 = uStack_2c._4_4_ + 1; ppppbVar9 = ppppbStack_3c; if (0xfff < uVar3) { ppppbVar9 = (byte ****)ppppbStack_3c[-1]; uVar3 = uStack_2c._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbStack_3c + (-4 - (int)ppppbVar9))) goto LAB_00909f49; } operator_delete(ppppbVar9,uVar3); } local_14._0_1_ = 4; if (0xf < uStack_5c) { uVar3 = uStack_5c + 1; pvVar4 = apvStack_70[0]; if (0xfff < uVar3) { pvVar4 = *(void **)((int)apvStack_70[0] + -4); uVar3 = uStack_5c + 0x24; if (0x1f < (uint)((int)apvStack_70[0] + (-4 - (int)pvVar4))) { LAB_00909f49: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar3); } local_14._0_1_ = 2; uVar10 = FUN_00905ef0(&uStack_2c); local_14 = (void *)CONCAT31(local_14._1_3_,8); NetplayManager::QueueRemovePlayer(uVar10); } local_14 = (void *)0x9; if (((piStack_74 != (int *)0x0) && (cVar2 = (**(code **)(*piStack_74 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&piStack_78); } } ExceptionList = local_1c; return; } //@@ 00909fe0 NetplayManager::get_drop_entry /* DB: returns the {u64 user, std::set} entry for the user in vector +0x1858, appending a new one if absent; NetplayManager::process_drop_player_message prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall NetplayManager::get_drop_entry(NetplayManager *this,ulonglong userId) { undefined4 uVar1; NetplayManager *pNVar2; NetplayManager NVar3; void *pvVar4; uint uVar5; uint uVar6; ulonglong local_24; void *local_1c; undefined4 local_18; NetplayManager *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08e8d; local_10 = ExceptionList; NVar3 = this[0x616]; uVar5 = 0; uVar6 = (int)this[0x617] - (int)NVar3 >> 4; if (uVar6 != 0) { do { if ((*(int *)NVar3 == (int)userId) && (*(int *)((int)NVar3 + 4) == userId._4_4_)) { return (void *)NVar3; } uVar5 = uVar5 + 1; NVar3 = (NetplayManager)((int)NVar3 + 0x10); } while (uVar5 < uVar6); } local_1c = (void *)0x0; local_18 = 0; ExceptionList = &local_10; local_14 = this; local_24 = userId; local_1c = operator_new(0x20); pNVar2 = local_14; *(void **)local_1c = local_1c; *(void **)((int)local_1c + 4) = local_1c; *(void **)((int)local_1c + 8) = local_1c; *(undefined2 *)((int)local_1c + 0xc) = 0x101; local_8 = 0; NVar3 = local_14[0x617]; if (NVar3 == local_14[0x618]) { std::vector<16byte>::_Emplace_reallocate(NVar3,&local_24); } else { *(ulonglong *)NVar3 = local_24; *(undefined4 *)((int)NVar3 + 8) = 0; *(undefined4 *)((int)NVar3 + 0xc) = 0; pvVar4 = operator_new(0x20); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; *(undefined2 *)((int)pvVar4 + 0xc) = 0x101; *(void **)((int)NVar3 + 8) = pvVar4; *(void **)((int)NVar3 + 8) = local_1c; uVar1 = *(undefined4 *)((int)NVar3 + 0xc); *(undefined4 *)((int)NVar3 + 0xc) = local_18; this[0x617] = (NetplayManager)((int)this[0x617] + 0x10); local_1c = pvVar4; local_18 = uVar1; } FID_conflict__Erase_tree_>_> (&local_1c,(fuzzer_allocator_> *)&local_1c, *(_Tree_node **)((int)local_1c + 4)); operator_delete(local_1c,0x20); ExceptionList = local_10; return (void *)((int)pNVar2[0x617] + -0x10); } //@@ 0090a130 FUN_0090a130 void FUN_0090a130(void) { undefined4 *this; int in_ECX; this = (undefined4 *)(in_ECX + 8); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 8) + 4)); operator_delete((void *)*this,0x20); return; } //@@ 0090a150 NetplayManager::ban_user /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (userId as u64): copies g_multiplayerLobbyPtr and, if a lobby exists, logs "[Frame: %d] Banning user %llu from the lobby" and bans; callers Menu_OnlineLobby::update_controls and NetplayManager::update_player_removal */ void NetplayManager::ban_user(undefined **param_1,undefined4 param_2) { undefined4 *puVar1; Manager *pMVar2; char cVar3; byte bVar4; uint uVar5; int iVar6; byte *pbVar7; byte *pbVar8; byte *pbVar9; undefined4 ****ppppuVar10; undefined **appuStack_d0 [2]; undefined **local_c8; int *local_c4; int *local_c0; undefined **ppuStack_bc; undefined4 uStack_b8; undefined4 ****appppuStack_b4 [4]; int iStack_a4; uint uStack_a0; byte abStack_9c [104]; byte abStack_34 [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b08ee1; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(abStack_34 + 0x30); ExceptionList = &local_10; local_c8 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_c4 = (int *)0x0; local_c0 = (int *)0x0; local_8 = 0; local_14 = uVar5; std::shared_ptr::assign(&local_c4,&g_multiplayerLobbyPtr); local_c8 = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 1; if ((local_c4 != (int *)0x0) && (cVar3 = (**(code **)(*local_c4 + 0xc))(uVar5), cVar3 != '\0')) { KAGE_LogMessage(1,(byte *)"[Frame: %d] Banning user %llu from the lobby \n"); pMVar2 = g_manager; ppuStack_bc = param_1; uStack_b8 = param_2; puVar1 = *(undefined4 **)&g_manager->field_0x4b124; if (puVar1 == *(undefined4 **)&g_manager->field_0x4b128) { std::vector<8byte>::_Emplace_reallocate(puVar1,&ppuStack_bc); } else { *puVar1 = param_1; puVar1[1] = param_2; *(int *)&pMVar2->field_0x4b124 = *(int *)&pMVar2->field_0x4b124 + 8; } if (local_c4 == (int *)0x0) { uStack_b8 = 0; } else { iVar6 = (**(code **)(*local_c4 + 0x20))(appuStack_d0); uStack_b8 = *(undefined4 *)(iVar6 + 4); appuStack_d0[0] = KAGE::System::UserProfileBase::vftable; } ppuStack_bc = KAGE::System::UserProfile::vftable; local_8._0_1_ = 2; bVar4 = KAGE::System::UserProfile::is_local_user(&ppuStack_bc); local_8 = CONCAT31(local_8._1_3_,1); if (bVar4 != 0) { sprintf_s(abStack_34,0x20,&UNK_00b78d18); pbVar8 = abStack_34; do { bVar4 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar4 != 0); sprintf_s(abStack_9c,100,&DAT_00b62fdc); if (local_c4 == (int *)0x0) { pbVar7 = (byte *)0x0; } else { pbVar7 = (byte *)(**(code **)(*local_c4 + 0x2c))(abStack_9c); } iStack_a4 = 0; uStack_a0 = 0xf; appppuStack_b4[0] = (undefined4 ****)0x0; pbVar9 = pbVar7; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); std::string::assign((char *)appppuStack_b4,pbVar7,(int)pbVar9 - (int)(pbVar7 + 1)); local_8 = CONCAT31(local_8._1_3_,3); while ((byte *)0x64 < pbVar8 + iStack_a4 + (1 - (int)(abStack_34 + 1))) { sprintf_s(abStack_9c,100,&DAT_00b69520); if (local_c4 == (int *)0x0) { pbVar7 = (byte *)0x0; } else { pbVar7 = (byte *)(**(code **)(*local_c4 + 0x2c))(abStack_9c); } pbVar9 = pbVar7; do { bVar4 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar4 != 0); std::string::assign((char *)appppuStack_b4,pbVar7,(int)pbVar9 - (int)(pbVar7 + 1)); } pbVar8 = abStack_34; do { bVar4 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar4 != 0); std::string::append((char *)appppuStack_b4,abStack_34,(int)pbVar8 - (int)(abStack_34 + 1)); ppppuVar10 = appppuStack_b4; if (0xf < uStack_a0) { ppppuVar10 = appppuStack_b4[0]; } if (local_c4 != (int *)0x0) { (**(code **)(*local_c4 + 0x28))(abStack_9c,ppppuVar10); } local_8 = CONCAT31(local_8._1_3_,1); if (0xf < uStack_a0) { uVar5 = uStack_a0 + 1; ppppuVar10 = appppuStack_b4[0]; if (0xfff < uVar5) { ppppuVar10 = (undefined4 ****)appppuStack_b4[0][-1]; uVar5 = uStack_a0 + 0x24; if (0x1f < (uint)((int)appppuStack_b4[0] + (-4 - (int)ppppuVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar10,uVar5); } } } local_c8 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 4; if (((local_c0 != (int *)0x0) && (cVar3 = (**(code **)(*local_c0 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_c4); } ExceptionList = local_10; return; } //@@ 0090a4b0 FUN_0090a4b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0090a4b0(int param_1,int param_2,int param_3,uint param_4) { Manager *pMVar1; char cVar2; uint *puVar3; int in_ECX; uint *puVar4; uint uVar5; int *piVar6; int iVar7; int iVar8; undefined1 *message; undefined1 *messageRefCount; undefined8 local_40; int local_38; int iStack_34; int iStack_30; uint uStack_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b08f1d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; piVar6 = *(int **)(in_ECX + 0x1888); iVar8 = (int)piVar6 - *(int *)(in_ECX + 0x1884) >> 4; if (iVar8 == 0) { uStack_2c = param_4; } else { puVar4 = (uint *)(*(int *)(in_ECX + 0x1884) + 0xc); do { puVar3 = ¶m_4; if (param_4 <= *puVar4) { puVar3 = puVar4; } puVar4 = puVar4 + 4; uStack_2c = *puVar3; iVar8 = iVar8 + -1; } while (iVar8 != 0); uVar5 = 0; iVar8 = 0; do { iVar8 = iVar8 + 0x10; uVar5 = uVar5 + 1; *(uint *)(*(int *)(in_ECX + 0x1884) + -4 + iVar8) = uStack_2c; piVar6 = *(int **)(in_ECX + 0x1888); } while (uVar5 < (uint)((int)piVar6 - *(int *)(in_ECX + 0x1884) >> 4)); } local_38 = param_1; iStack_34 = param_2; iStack_30 = param_3; if (piVar6 == *(int **)(in_ECX + 0x188c)) { FUN_009148c0(piVar6,&local_38); } else { *piVar6 = param_1; piVar6[1] = param_2; piVar6[2] = param_3; piVar6[3] = uStack_2c; *(int *)(in_ECX + 0x1888) = *(int *)(in_ECX + 0x1888) + 0x10; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } if (g_userProfile == (void *)0x0) { local_40 = 0; local_40._4_4_ = (int *)0x0; local_40._0_4_ = 0; iVar8 = (int)local_40._4_4_; iVar7 = (int)local_40; } else { iVar8 = *(int *)((int)g_userProfile + 0xc); iVar7 = *(int *)((int)g_userProfile + 8); } if ((iVar7 == param_1) && (iVar8 == param_2)) { iStack_30 = param_3; uStack_2c = param_4; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = &DAT_00000008; message = &DAT_00000008; NetConnection::send_message(g_multiplayerService,&local_40,1,&iStack_30,8,8); pMVar1 = g_manager; local_14 = 0; FUN_008ef1d0(&local_40); NetplayManager::send_message(&pMVar1->_netplayManager,8,message,messageRefCount); local_14 = 1; if (((local_40._4_4_ != (int *)0x0) && (cVar2 = (**(code **)(*local_40._4_4_ + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_40); } } ExceptionList = local_1c; return; } //@@ 0090a670 FUN_0090a670 void FUN_0090a670(Entity_Player *param_1) { undefined4 *puVar1; char cVar2; uint uVar3; void *pvVar4; int *piVar5; int iVar6; void *in_ECX; uint uVar7; uint uVar8; int iVar9; undefined4 uVar10; int iVar11; undefined4 uVar12; undefined4 auStack_40 [2]; int iStack_38; int iStack_34; undefined4 uStack_30; void *pvStack_2c; undefined4 uStack_28; int iStack_24; undefined8 uStack_20; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b08f5d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(auStack_40 + 0xf); ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"[FRAME: %d] Queueing Revive Player \n"); pvVar4 = InputManager::GetDeviceByPlayerEntity(in_ECX,param_1); if (pvVar4 == (void *)0x0) { KAGE_LogMessage(8,(byte *)"[FRAME: %d] Revive requested for player that does not exist! \n"); ExceptionList = local_10; return; } iVar6 = *(int *)((int)pvVar4 + 0x374); if (iVar6 == 0) { uStack_20 = 0; uStack_20._4_4_ = 0; uStack_20._0_4_ = 0; iVar9 = uStack_20._4_4_; iVar6 = (int)uStack_20; } else { iVar9 = *(int *)(iVar6 + 0xc); iVar6 = *(int *)(iVar6 + 8); } uVar7 = 0; uVar8 = *(int *)((int)in_ECX + 0x187c) - *(int *)((int)in_ECX + 0x1878) >> 5; if (uVar8 != 0) { piVar5 = (int *)(*(int *)((int)in_ECX + 0x1878) + 8); do { if ((*piVar5 == iVar6) && (piVar5[1] == iVar9)) { KAGE_LogMessage(1,(byte *) "[FRAME: %d] Revive requested for player (ID = %llu) that is already queued for revival!, adding local user to confirm list \n" ); iVar11 = *(int *)((int)in_ECX + 0x1878); uVar7 = 0; uVar8 = *(int *)((int)in_ECX + 0x187c) - iVar11 >> 5; if (uVar8 == 0) goto LAB_0090a7c5; goto LAB_0090a7b3; } uVar7 = uVar7 + 1; piVar5 = piVar5 + 8; } while (uVar7 < uVar8); } auStack_40[0] = 0; uStack_30 = 0; pvStack_2c = (void *)0x0; uStack_28 = 0; iStack_24 = 0; uStack_8 = 0; iStack_38 = iVar6; iStack_34 = iVar9; FUN_00913950(auStack_40); if (pvStack_2c == (void *)0x0) { ExceptionList = local_10; return; } uVar3 = iStack_24 - (int)pvStack_2c & 0xfffffff8; pvVar4 = pvStack_2c; if (0xfff < uVar3) { pvVar4 = *(void **)((int)pvStack_2c + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar3); ExceptionList = local_10; return; while( true ) { uVar7 = uVar7 + 1; iVar11 = iVar11 + 0x20; if (uVar8 <= uVar7) break; LAB_0090a7b3: if ((*(int *)(iVar11 + 8) == iVar6) && (*(int *)(iVar11 + 0xc) == iVar9)) goto LAB_0090a7c7; } LAB_0090a7c5: iVar11 = 0; LAB_0090a7c7: iVar6 = FUN_0090b070(uVar3); iVar6 = *(int *)(iVar6 + 0x374); if (iVar6 == 0) { uStack_20._4_4_ = 0; uStack_20._0_4_ = 0; uVar10 = uStack_20._4_4_; uVar12 = (int)uStack_20; } else { uVar10 = *(undefined4 *)(iVar6 + 0xc); uVar12 = *(undefined4 *)(iVar6 + 8); } uStack_20 = CONCAT44(uVar10,uVar12); cVar2 = FUN_00905e50(uVar12,uVar10); if (cVar2 != '\0') { ExceptionList = local_10; return; } puVar1 = *(undefined4 **)(iVar11 + 0x18); if (puVar1 == *(undefined4 **)(iVar11 + 0x1c)) { std::vector<8byte>::_Emplace_reallocate(puVar1,&uStack_20); ExceptionList = local_10; return; } *puVar1 = uVar12; puVar1[1] = uVar10; *(int *)(iVar11 + 0x18) = *(int *)(iVar11 + 0x18) + 8; ExceptionList = local_10; return; } //@@ 0090a890 FUN_0090a890 void FUN_0090a890(void) { std::vector::_Tidy(); return; } //@@ 0090a8a0 NetplayManager::reset /* DB: ECX = g_Manager+0x4b3d8 (_netplayManager per db/fields.tsv) in Manager::destructor and Menu_OnlineLobby::Update; clears state fields, frees per-peer buffers in map +0x3c, erases trees, releases input devices prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall NetplayManager::reset(NetplayManager *this,byte isReleaseDevices) { NetplayManager *this_00; qword qVar1; char cVar2; uint uVar3; undefined4 extraout_ECX; undefined4 extraout_ECX_00; qword *pqVar4; NetplayManager NVar5; NetplayManager NVar6; undefined1 *outDevice; int iVar7; undefined1 local_18 [4]; NetplayManager local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08f8d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; this[3] = (NetplayManager)0x0; this[0x62c] = (NetplayManager)0x0; this[0x62d] = (NetplayManager)0x0; this[5] = (NetplayManager)0x0; *(undefined1 *)(this + 6) = 1; std::deque<12byte>::_Tidy(uVar3); this[0x12] = this[0x11]; NVar6 = this[0xf]; local_14 = *(NetplayManager *)NVar6; if (local_14 != NVar6) { do { NVar6 = local_14; iVar7 = *(int *)((int)local_14 + 0x14); if (iVar7 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar7 + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar3; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar3); free((void *)(iVar7 + -4)); local_8 = 0xffffffff; *(int *)((int)NVar6 + 0x14) = 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); NVar6 = this[0xf]; } while (local_14 != NVar6); } FID_conflict__Erase_tree_>_> (this + 0xf,(fuzzer_allocator_> *)(this + 0xf), *(_Tree_node **)((int)NVar6 + 4)); *(NetplayManager *)((int)NVar6 + 4) = NVar6; *(NetplayManager *)NVar6 = NVar6; *(NetplayManager *)((int)NVar6 + 8) = NVar6; this[0x10] = (NetplayManager)0x0; this[0x477] = this[0x476]; this[0x47a] = this[0x479]; this[0x483] = this[0x482]; this[0x472] = (NetplayManager)0x0; this[0x473] = (NetplayManager)0x0; this[0x480] = this[0x47f]; FUN_00900b90(extraout_ECX); this_00 = this + 0x489; this[0x486] = this[0x485]; this[0x475] = (NetplayManager)0x0; NVar6 = *this_00; *(undefined1 *)(this + 0x488) = 0; *(undefined1 *)(this + 0x48b) = 0; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)NVar6 + 4)); *(NetplayManager *)((int)NVar6 + 4) = NVar6; *(NetplayManager *)NVar6 = NVar6; *(NetplayManager *)((int)NVar6 + 8) = NVar6; this[0x48a] = (NetplayManager)0x0; NVar6 = this[0x41c]; this[0x630] = (NetplayManager)0x26; this[0x631] = (NetplayManager)0xe; this[0x632] = (NetplayManager)0x0; this[0x633] = (NetplayManager)0x0; *(undefined1 *)(this + 0x634) = 0; std::map::destroy_subtree (this + 0x41c,*(undefined4 *)((int)NVar6 + 4)); *(NetplayManager *)((int)NVar6 + 4) = NVar6; *(NetplayManager *)NVar6 = NVar6; *(NetplayManager *)((int)NVar6 + 8) = NVar6; this[0x41d] = (NetplayManager)0x0; FUN_00915be0(extraout_ECX_00); this[0x617] = this[0x616]; if (isReleaseDevices == 0) { NVar6 = *this; if (NVar6 != this[1]) { do { FUN_00901b70(); NVar6 = (NetplayManager)((int)NVar6 + 4); } while (NVar6 != this[1]); } ExceptionList = local_10; return; } NVar6 = *this; if (3 < (uint)((int)this[1] - (int)NVar6)) { do { iVar7 = *(int *)(*(int *)NVar6 + 0xc); outDevice = local_18; InputManager::get_device(&PTR_vftable_00c57b18,outDevice,iVar7); local_8 = 1; FUN_00902d60(local_18); FUN_00a20eb0(outDevice,iVar7); local_8 = 2; if (((local_14 != (NetplayManager)0x0) && (cVar2 = (**(code **)(*(int *)local_14 + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_18); } local_8 = 0xffffffff; NVar6 = *this; } while (((int)this[1] - (int)NVar6 & 0xfffffffcU) != 0); } NVar6 = this[0x61c]; NVar5 = this[0x61b]; if (NVar5 != NVar6) { do { std::vector::_Tidy(); NVar5 = (NetplayManager)((int)NVar5 + 0x18); } while (NVar5 != NVar6); NVar5 = this[0x61b]; } this[0x61c] = NVar5; NVar6 = this[0x61f]; NVar5 = this[0x61e]; if (NVar5 != NVar6) { do { std::vector::_Tidy(); NVar5 = (NetplayManager)((int)NVar5 + 0x20); } while (NVar5 != NVar6); NVar5 = this[0x61e]; } this[0x61f] = NVar5; NVar6 = this[0x619]; this[0x622] = this[0x621]; FUN_00914d90(this + 0x619,*(undefined4 *)((int)NVar6 + 4)); *(NetplayManager *)((int)NVar6 + 4) = NVar6; *(NetplayManager *)NVar6 = NVar6; *(NetplayManager *)((int)NVar6 + 8) = NVar6; this[0x61a] = (NetplayManager)0x0; ExceptionList = local_10; return; } //@@ 0090abf0 PlayerManager::get_player_by_user_id /* DB: ? scans vector at this[0..1]; compares each player's +0x374 object's 64-bit id (+8/+0xc) with param_1 and returns the player or 0; NetplayManager::Update / update_player_removal prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Player * __thiscall PlayerManager::get_player_by_user_id(PlayerManager *this,ulonglong *userId) { float fVar1; uint uVar2; int *piVar3; uint uVar4; int local_10; int iStack_c; piVar3 = (this->_playerList)._begin; uVar2 = (int)(this->_playerList)._end - (int)piVar3 >> 2; uVar4 = 0; if (uVar2 != 0) { do { fVar1 = (((Entity_Player *)*piVar3)->_sizeMulti).x; if (fVar1 == 0.0) { iStack_c = 0; local_10 = 0; } else { local_10 = *(int *)((int)fVar1 + 8); iStack_c = *(int *)((int)fVar1 + 0xc); } if ((local_10 == (int)*userId) && (iStack_c == *(int *)((int)userId + 4))) { return (Entity_Player *)*piVar3; } uVar4 = uVar4 + 1; piVar3 = piVar3 + 1; } while (uVar4 < uVar2); } return (Entity_Player *)0x0; } //@@ 0090ac70 InputManager::GetDeviceByPlayerEntity /* DB: log string prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall InputManager::GetDeviceByPlayerEntity(void *this,Entity_Player *player) { void *pvVar1; int iVar2; uint uVar3; int *piVar4; Entity_Player *pEVar5; int *piVar6; uint uVar7; int extraout_ECX; Entity_Player *pEVar8; uint uVar9; uint local_24; int *local_20; if (player == (Entity_Player *)0x0) { KAGE_LogMessage(8,(byte *)"[Frame %d] GetDeviceByPlayerEntity() given NULL player entity \n"); return (void *)0x0; } local_20 = *(int **)this; local_24 = 0; uVar3 = *(int *)((int)this + 4) - (int)local_20 >> 2; if (uVar3 != 0) { piVar6 = (g_game->_playerManager)._playerList._begin; uVar9 = (int)(g_game->_playerManager)._playerList._end - (int)piVar6 >> 2; do { pvVar1 = (void *)*local_20; uVar7 = 0; iVar2 = *(int *)((int)pvVar1 + 0xc); if (uVar9 != 0) { piVar4 = piVar6; do { pEVar8 = (Entity_Player *)*piVar4; if (pEVar8->_controllerIndex == iVar2) goto LAB_0090ad07; uVar7 = uVar7 + 1; piVar4 = piVar4 + 1; } while (uVar7 < uVar9); } pEVar8 = (Entity_Player *)0x0; LAB_0090ad07: pEVar5 = Entity_Player::GetMainTwin(player); if ((pEVar8 == pEVar5) || (iVar2 == *(int *)(extraout_ECX + 0x1618))) { return pvVar1; } local_24 = local_24 + 1; local_20 = local_20 + 1; } while (local_24 < uVar3); } KAGE_LogMessage(8,(byte *) "[Frame %d] GetDeviceByPlayerEntity() cannot find device for the given player entity \n " ); KAGE_LogMessage(8,(byte *)"----------------------------------------------------------- \n "); KAGE_LogMessage(8,(byte *)"playerEntity PlayerType: %d, Device ID: %d \n "); KAGE_LogMessage(8,(byte *)"Device List: \n "); uVar3 = 0; if (*(int *)((int)this + 4) - *(int *)this >> 2 == 0) { LAB_0090ae59: KAGE_LogMessage(8,(byte *)"----------------------------------------------------------- \n"); return (void *)0x0; } LAB_0090ada1: KAGE_LogMessage(8,(byte *)" - UserID(%llu), DeviceID(%d), SourceDeviceID(%d) \n "); uVar9 = 0; iVar2 = *(int *)(*(int *)(*(int *)this + uVar3 * 4) + 0xc); piVar6 = (g_game->_playerManager)._playerList._begin; uVar7 = (int)(g_game->_playerManager)._playerList._end - (int)piVar6 >> 2; if (uVar7 != 0) { do { if (*(int *)(piVar6[uVar9] + 0x1618) == iVar2) { if (piVar6[uVar9] != 0) { uVar9 = 0; goto LAB_0090ae80; } break; } uVar9 = uVar9 + 1; } while (uVar9 < uVar7); } KAGE_LogMessage(8,(byte *)" - Device is not associated with a player entity!!! \n "); goto LAB_0090ae42; while( true ) { uVar9 = uVar9 + 1; piVar6 = piVar6 + 1; if (uVar7 <= uVar9) break; LAB_0090ae80: if (*(int *)(*piVar6 + 0x1618) == iVar2) break; } KAGE_LogMessage(8,(byte *)" - Device\'s Player Type: %d \n "); LAB_0090ae42: uVar3 = uVar3 + 1; if ((uint)(*(int *)((int)this + 4) - *(int *)this >> 2) <= uVar3) goto LAB_0090ae59; goto LAB_0090ada1; } //@@ 0090aeb0 InputManager::FirstLocalDeviceID /* DB: string "[Frame %d] FirstLocalDeviceID() Could not find a device for the local user!"; walks the input-slot vector (ECX), first whose profile (+0x370) vfunc +0x14 is local returns its device (+0x378)->+0xc id, -1 if none; neighbours InputManager::GetDeviceByPlayerEntity 0090ac70 prototype: db/protos.zhl */ int __thiscall InputManager::FirstLocalDeviceID(void *this) { char cVar1; int iVar2; uint uVar3; uVar3 = 0; iVar2 = *(int *)this; if (*(int *)((int)this + 4) - iVar2 >> 2 != 0) { do { iVar2 = *(int *)(iVar2 + uVar3 * 4); cVar1 = (**(code **)(*(int *)(iVar2 + 0x370) + 0x14))(); if (cVar1 != '\0') { iVar2 = *(int *)(iVar2 + 0x378); if (iVar2 == 0) { return -1; } return *(int *)(iVar2 + 0xc); } uVar3 = uVar3 + 1; iVar2 = *(int *)this; } while (uVar3 < (uint)(*(int *)((int)this + 4) - iVar2 >> 2)); } KAGE_LogMessage(8,(byte *) "[Frame %d] FirstLocalDeviceID() Could not find a device for the local user! \n " ); return -1; } //@@ 0090af30 FUN_0090af30 void FUN_0090af30(undefined4 param_1) { char cVar1; uint uVar2; int iVar3; undefined4 uVar4; undefined1 auStack_1c [4]; int *piStack_18; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b08fbd; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(auStack_1c + 0x18); ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"[Frame: %d] Setting local device ID to %d \n"); iVar3 = FUN_0090b070(uVar2); if (iVar3 == 0) { KAGE_LogMessage(8,(byte *) "[Frame: %d] NetManager::SetLocalDeviceID() failed to find device for local user! \n" ); } else { uVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x28))(auStack_1c,param_1); uStack_8 = 0; FUN_00902e80(uVar4); uStack_8 = 1; if (piStack_18 != (int *)0x0) { cVar1 = (**(code **)(*piStack_18 + 0xc))(); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(auStack_1c); ExceptionList = local_10; return; } } } ExceptionList = local_10; return; } //@@ 0090b010 FUN_0090b010 int FUN_0090b010(int param_1) { int *piVar1; int *in_ECX; uint uVar2; uint uVar3; uVar2 = 0; piVar1 = (int *)*in_ECX; uVar3 = in_ECX[1] - (int)piVar1 >> 2; if (uVar3 != 0) { do { if (*(int *)(*piVar1 + 0xc) == param_1) { return *piVar1; } uVar2 = uVar2 + 1; piVar1 = piVar1 + 1; } while (uVar2 < uVar3); } KAGE_LogMessage(8,(byte *) "[Frame: %d] NetManager::GetDeviceById() failed to find device with ID %d \n"); return 0; } //@@ 0090b070 FUN_0090b070 int FUN_0090b070(void) { char cVar1; int *in_ECX; int iVar2; uint uVar3; uVar3 = 0; iVar2 = *in_ECX; if (in_ECX[1] - iVar2 >> 2 != 0) { do { iVar2 = *(int *)(iVar2 + uVar3 * 4); cVar1 = (**(code **)(*(int *)(iVar2 + 0x370) + 0x14))(); if (cVar1 != '\0') { return iVar2; } uVar3 = uVar3 + 1; iVar2 = *in_ECX; } while (uVar3 < (uint)(in_ECX[1] - iVar2 >> 2)); } KAGE_LogMessage(8,(byte *)"[Frame: %d] NetManager::GetLocalUserDevice() failed to find device!\n") ; return 0; } //@@ 0090b0e0 FUN_0090b0e0 undefined4 FUN_0090b0e0(void) { int iVar1; undefined4 uVar2; iVar1 = FUN_0090b070(); if (iVar1 == 0) { return 0; } FUN_0090b070(); uVar2 = FUN_004253d0(); return uVar2; } //@@ 0090b100 NetplayManager::IsIdxLocalPlayer /* ZHL [exact] __thiscall bool NetplayManager::IsIdxLocalPlayer(uint32_t idx); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall NetplayManager::IsIdxLocalPlayer(NetplayManager *this,uint idx) { byte bVar1; NetplayManager NVar2; uint uVar3; uint uVar4; NVar2 = *this; uVar4 = 0; uVar3 = (int)this[1] - (int)NVar2 >> 2; if (uVar3 != 0) { do { if (*(uint *)(*(int *)NVar2 + 0xc) == idx) { bVar1 = (**(code **)(*(int *)(*(int *)NVar2 + 0x370) + 0x14))(); return bVar1; } uVar4 = uVar4 + 1; NVar2 = (NetplayManager)((int)NVar2 + 4); } while (uVar4 < uVar3); } return 1; } //@@ 0090b150 NetplayManager::Update /* DB: ECX=Manager+0x4b3d8 (zhl _netplayManager 0x4afb8 + Rep+ drift, fonts drift ~+0x400 too) from main loop 00954cd0; "[Frame %d] Executing delayed game start", #Online/LOBBY_JOIN_DAILY_* */ undefined4 NetplayManager::Update(void) { undefined1 *puVar1; int iVar2; uint uVar3; Game *pGVar4; undefined1 *puVar5; char cVar6; int *piVar7; undefined4 uVar8; PlayerManager *in_ECX; uint uVar9; Manager *pMVar10; undefined1 auStack_8a [2]; int *local_50; int *local_4c; int *local_48; int *local_44; int *local_40; int *local_3c; undefined1 local_38 [4]; Entity_Player *local_34; int *local_30; int *local_2c; int *local_28; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b0901e; local_1c = ExceptionList; ExceptionList = &local_1c; local_30 = (int *)0x0; local_28 = (int *)0x0; puVar5 = local_38 + 0x34; if ((in_ECX[0x1d]._coopSlots[1]._menuPosition != 0.0) && (puVar5 = local_38 + 0x34, (char)in_ECX[0x1d]._coopSlots[2]._state != '\0')) { ANM2::update_appear_then_idle((ANM2 *)&in_ECX[0x1c]._extraPlayers._end); if (in_ECX[0x1f].field_0x7d != '\0') { AnimationState::Update((AnimationState *)&in_ECX[0x1e].field_0x80); AnimationState::Update((AnimationState *)&in_ECX[0x1e].field_0xa0); } local_2c = (int *)&DAT_0000000f; cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_2c); if (cVar6 != '\0') { daily_lobby_join_reset(); } in_ECX[0x1c]._roomTransitionPlayer = (void *)((int)in_ECX[0x1c]._roomTransitionPlayer + 1); puVar5 = puStack_20; if ((void *)0x5a < in_ECX[0x1c]._roomTransitionPlayer) { puVar1 = in_ECX[0x1c]._stageTransitionPlayer; if (puVar1 == (undefined1 *)0x2) { daily_lobby_join_reset(); string_table_translate(&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_DAILY_DENIED"); daily_lobby_join_show_error(); puVar5 = puStack_20; } else if (puVar1 == &DAT_00000005) { daily_lobby_join_reset(); string_table_translate(&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_DAILY_FAILED"); daily_lobby_join_show_error(); puVar5 = puStack_20; } else if (puVar1 == (undefined1 *)0x3) { daily_lobby_join_reset(); string_table_translate (&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_DAILY_IN_PROGRESS"); daily_lobby_join_show_error(); puVar5 = puStack_20; } else if (puVar1 == &DAT_00000004) { join_pending_lobby(&g_manager->_netplayManager,&in_ECX[0x1f].field_0x88); daily_lobby_join_reset(); puVar5 = puStack_20; } } } puStack_20 = puVar5; LobbyPasswordPrompt::Update(); update_text_popup((NetplayManager *)&in_ECX[0x13]._coopSlots[3]._playerType); process_lobby_messages(); if ((*(int *)&in_ECX[0x1c].field_0x98 != 0) && (*(int *)&in_ECX[0x1c].field_0x94 == in_ECX->_coopSlots[0]._controllerIndex)) { KAGE_LogMessage(1,(byte *)"[Frame %d] Executing delayed game start \n"); FUN_00a581a0(); local_14 = 0; FUN_0090ca40(); *(undefined4 *)&in_ECX[0x1c].field_0x94 = 0; if (*(void **)&in_ECX[0x1c].field_0x98 != (void *)0x0) { operator_delete(*(void **)&in_ECX[0x1c].field_0x98,1); *(undefined4 *)&in_ECX[0x1c].field_0x98 = 0; } *(undefined4 *)&in_ECX[0x1c].field_0x9c = 0; local_14 = 0xffffffff; FUN_00a58200(); } while (g_multiplayerService != (void *)0x0) { piVar7 = NetworkManager::receive_message(g_multiplayerService,local_38,2,0); iVar2 = *piVar7; local_14 = 1; if (((local_34 != (Entity_Player *)0x0) && (cVar6 = (**(code **)(*(int *)local_34 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; if (iVar2 == 0) break; local_28 = (int *)((uint)local_28 | 2); if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(); } else { NetworkManager::receive_message(g_multiplayerService,&local_48,2,1); } local_14 = 2; if (((local_44 != (int *)0x0) && (cVar6 = (**(code **)(*local_44 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; } update_status_messages(); while (g_multiplayerService != (void *)0x0) { piVar7 = NetworkManager::receive_message(g_multiplayerService,&local_50,10,0); iVar2 = *piVar7; local_14 = 3; if (((local_4c != (int *)0x0) && (cVar6 = (**(code **)(*local_4c + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; if (iVar2 == 0) break; local_28 = (int *)((uint)local_28 | 4); if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(); } else { NetworkManager::receive_message(g_multiplayerService,&local_48,10,1); } local_14 = 4; piVar7 = (int *)0x0; local_2c = local_44; local_30 = local_48; if ((((local_44 != (int *)0x0) && (cVar6 = (**(code **)(*local_44 + 4))(), cVar6 != '\0')) && (piVar7 != (int *)0x0)) && ((cVar6 = (**(code **)(*piVar7 + 0xc))(), cVar6 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStack_8a + -10); } Camera::UpdateUltrasmooth((Camera *)&in_ECX[0x15]._coopSlots[1]._playerType); local_14 = 5; if (((local_44 != (int *)0x0) && (cVar6 = (**(code **)(*local_44 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; } process_drop_player_message(); receive_vote_end_message(); update_player_removal(); if ((in_ECX->_playerList)._begin != (in_ECX->_playerList)._end) { local_50 = (int *)0x0; local_4c = (int *)0x0; local_14 = 6; std::shared_ptr::assign(&local_50,&g_multiplayerLobbyPtr); local_14 = 7; local_30 = (int *)((uint)local_28 | 0x19); local_28 = local_30; if (local_50 != (int *)0x0) { cVar6 = (**(code **)(*local_50 + 0xc))(); local_21 = '\0'; if (cVar6 != '\0') goto LAB_0090b5d1; } } local_21 = '\x01'; LAB_0090b5d1: if (((uint)local_28 & 1) != 0) { local_28 = (int *)((uint)local_28 & 0xfffffffe); local_14 = 8; if (((local_4c != (int *)0x0) && (cVar6 = (**(code **)(*local_4c + 0xc))(), cVar6 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } local_14 = 0xffffffff; if (local_21 == '\0') { check_connection((NetplayManager *)in_ECX); pMVar10 = g_manager; uVar9 = in_ECX->_coopSlots[0]._playerType; uVar3 = (g_manager->_optionsConfig)._onlineInputDelay; in_ECX->_coopSlots[0]._playerType = uVar3; if (uVar9 < uVar3) { *(undefined1 *)&in_ECX->_coopSlots[0]._menuPosition = 1; } if (pMVar10->_state == 2) { online_chat_update(); pMVar10 = g_manager; } if ((pMVar10->_framecount & 1) == 0) { while (g_multiplayerService != (void *)0x0) { piVar7 = NetworkManager::receive_message(g_multiplayerService,&local_50,1,0); iVar2 = *piVar7; local_14 = 9; if (((local_4c != (int *)0x0) && (cVar6 = (**(code **)(*local_4c + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; if (iVar2 == 0) break; local_28 = (int *)((uint)local_28 | 0x20); if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(); } else { NetworkManager::receive_message(g_multiplayerService,&local_40,1,1); } local_14 = 10; local_48 = (int *)*local_40; local_44 = (int *)local_40[1]; local_34 = PlayerManager::get_player_by_user_id(in_ECX,(ulonglong *)&local_48); if (local_34 != (Entity_Player *)0x0) { piVar7 = (int *)0x0; local_30 = local_3c; local_2c = local_40; if ((((local_3c != (int *)0x0) && (cVar6 = (**(code **)(*local_3c + 4))(), cVar6 != '\0')) && (piVar7 != (int *)0x0)) && ((cVar6 = (**(code **)(*piVar7 + 0xc))(), cVar6 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStack_8a + -10); } NetInputDevice::ProcessInputMessage(); } local_14 = 0xb; if (((local_3c != (int *)0x0) && (cVar6 = (**(code **)(*local_3c + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; } process_drop_player_message(); update_revives(); online_vote_update(); NetDesyncHandler::Update(); iVar2 = *(int *)&in_ECX[0x1c].field_0xb0; local_34 = (Entity_Player *)get_rich_presence_room_status(); pGVar4 = g_game; if (((local_34 != (Entity_Player *)iVar2) || (*(int *)&in_ECX[0x1c].field_0xb4 != g_game->_stage)) || (((iVar2 = g_game->_difficulty, iVar2 == 2 || (iVar2 == 3)) && ((in_ECX[0x1c]._rng._seed != g_game->_greedModeWave || (in_ECX[0x1c]._rng._shift1 != (iVar2 == 3) + 10)))))) { *(Entity_Player **)&in_ECX[0x1c].field_0xb0 = local_34; *(int *)&in_ECX[0x1c].field_0xb4 = pGVar4->_stage; in_ECX[0x1c]._rng._seed = pGVar4->_greedModeWave; in_ECX[0x1c]._rng._shift1 = (pGVar4->_difficulty == 3) + 10; *(bool *)&in_ECX[0x1c]._rng._shift2 = *(int *)((int)pGVar4->_room + 0x723c) != -1; update_lobby_stage_info(); } cVar6 = process_consolidated_messages(); if (cVar6 == '\0') { uVar8 = try_advance_frame(); ExceptionList = local_1c; return uVar8; } ExceptionList = local_1c; return 0; } uVar9 = 0; if ((int)(in_ECX->_playerList)._end - (int)(in_ECX->_playerList)._begin >> 2 != 0) { do { iVar2 = *(int *)((int)(in_ECX->_playerList)._begin + uVar9 * 4); uVar9 = uVar9 + 1; *(undefined4 *)(iVar2 + 0x388) = 0; *(undefined4 *)(iVar2 + 0x38c) = 0; } while (uVar9 < (uint)((int)(in_ECX->_playerList)._end - (int)(in_ECX->_playerList)._begin >> 2)); } } ExceptionList = local_1c; return 1; } //@@ 0090b900 NetplayManager::Render /* DB: ECX=Manager+0x4b3d8 from Manager::Render: centered status text (Font::DrawString, "Center" null), OnlineChat::render_all at +0x1230, GenericPopup +0x18e4 and ANM2 +0x1a18 */ void NetplayManager::Render(void) { Manager *pMVar1; char cVar2; uint uVar3; int in_ECX; AnimationState *this; byte *str; float *pfVar4; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; KColor local_2c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0904d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(int *)(in_ECX + 0x10b0) != 0) { local_18.x = g_screenWidth * 0.5; local_18.y = 48.0; if (*(char *)(in_ECX + 0x11bd) != '\0') { if (*(char *)(in_ECX + 0x1124) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x10e4),&local_18,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x1104); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x1104),&local_18,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x10e4); } AnimationState::Render(this,&local_18,&g_vectorZero,&g_vectorZero); } if (*(int *)(in_ECX + 0x10e8) == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0x10e4),(byte *)"Center"); } pMVar1 = g_manager; local_18.x = local_18.x + *pfVar4; local_48 = 4; local_18.y = (local_18.y + pfVar4[1]) - 2.0; local_44 = 0xffff; local_40 = 0; local_3c = 0x3f800000; local_38 = 0xffffffff; local_34 = 0; local_30 = 0; local_8 = 0; KColor::SetFromARGB(&local_2c,0xffffffff); str = *(byte **)(*(int *)(in_ECX + 0x10a4) + (*(int *)(in_ECX + 0x10a8) - 1U & *(uint *)(in_ECX + 0x10ac)) * 4); if (0xf < *(uint *)(str + 0x14)) { str = *(byte **)str; } Font::DrawString(&pMVar1->_font2_TeamMeatEx12,str,&local_18,(Vector *)(pfVar4 + 4),&local_2c, &local_48); } local_8 = 0xffffffff; if (g_menuManager == (MenuManager *)0x0) { local_18.y = DAT_00c79980 - 80.0; local_18.x = 60.0; OnlineChat::render_all(&local_18,0); } if ((*(int *)(in_ECX + 0x1918) != 0) && (*(char *)(in_ECX + 0x1928) != '\0')) { GenericPopup::Render((GenericPopup *)(in_ECX + 0x18e4)); cVar2 = FUN_00837610(uVar3); if (cVar2 != '\0') { local_18.x = (g_screenWidth - 480.0) * 0.5 + 240.0; local_18.y = (g_screenHeight - 270.0) * 0.5 + 150.0; ANM2::Render((ANM2 *)(in_ECX + 0x1a18),&local_18,&g_vectorZero,&g_vectorZero); } } if ((*(int *)(in_ECX + 0x1b6c) != 0) && (*(char *)(in_ECX + 0x1b7c) != '\0')) { GenericPopup::Render((GenericPopup *)(in_ECX + 0x1b38)); cVar2 = FUN_00837610(uVar3); if (cVar2 != '\0') { local_18.x = (g_screenWidth - 480.0) * 0.5 + 209.0; local_18.y = (g_screenHeight - 270.0) * 0.5 + 130.0; lobby_password_render((void *)(in_ECX + 0x1c6c),&local_18,1.0); } } ExceptionList = local_10; return; } //@@ 0090bbf0 online_lobby_join /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "##GAME###Online/JOINING_LOBBY", ONLINE_CHALLENGE_BLOCKED, "Unknown or unsupported service provider type", Menu_Save::select_save_slot, PersistentGameData::Unlocked; callers Level::InitializeGenesisRoom(!), 008e2530, 008e5260, 008e64f0, 0090bf10 prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall online_lobby_join(void *this,void *lobbyInfo,ulonglong sharedRef) { int *piVar1; char cVar2; byte bVar3; int iVar4; Manager *extraout_EDX; Manager *pMVar5; undefined1 auStackY_1d8 [128]; undefined **lobbyHandleVtable; void *lobby; void *lobbyRefCount; undefined1 auStack_146 [2]; undefined1 local_138 [48]; undefined4 local_108; undefined1 local_e4 [12]; undefined1 local_d8 [12]; undefined4 local_cc; undefined4 local_c8; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; undefined4 local_8c; undefined4 uStack_88; undefined **ppuStack_84; undefined4 uStack_80; int *local_7c; Vector local_78; LobbySettings local_70; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b090a6; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)((&local_70)[1]._seed._buf + 0xc); ExceptionList = &local_10; if (*(int **)((int)lobbyInfo + 4) == (int *)0x0) { LAB_0090bc40: piVar1 = *(int **)((int)lobbyInfo + 4); if (piVar1 != (int *)0x0) { iVar4 = (**(code **)(*piVar1 + 4))(); if (iVar4 == 2) { Multiplayer::set_service_provider(3); goto LAB_0090bc68; } } KAGE_LogMessage(0x10,(byte *)"Unknown or unsupported service provider type specified\n"); } else { iVar4 = (**(code **)(**(int **)((int)lobbyInfo + 4) + 4))(); if (iVar4 != 1) goto LAB_0090bc40; Multiplayer::set_service_provider(2); } LAB_0090bc68: cVar2 = online_check_mods_allowed(); if (cVar2 != '\0') goto LAB_0090be87; bVar3 = online_lobby_is_user_banned(lobbyInfo); if (bVar3 != 0) goto LAB_0090be87; LobbySettings::reset(&local_70); local_78.y = (float)(auStackY_1d8 + 0x84); lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby = (void *)0x0; lobbyRefCount = (void *)0x0; local_8 = 1; std::shared_ptr::assign(auStackY_1d8 + 0x88,(int *)((int)lobbyInfo + 4)); local_8 = local_8 & 0xffffff00; Menu_Save::select_save_slot((Menu_Save *)&local_70,lobbyHandleVtable,lobby,lobbyRefCount); pMVar5 = g_manager; if (local_70._challenge == 0) { LAB_0090bda3: local_78.x = -1.0; local_78.y = -1.0; MessagePopup::MessagePopup(local_138,&pMVar5->_font2_TeamMeatEx12,FUN_009084f0,this,&local_78); local_8 = CONCAT31(local_8._1_3_,3); local_7c = (int *)0x0; local_8c = 0x3e5cdcdd; uStack_88 = 0x3e2cacad; ppuStack_84 = (undefined **)0x3e34b4b5; uStack_80 = 0x3f800000; local_78.y = 1.4013e-45; FUN_009c2700("##GAME###Online/JOINING_LOBBY"); local_108 = 1000; local_b4 = 0xdeadbeef; iVar4 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_138); *(int *)((int)this + 0x58) = iVar4; *(undefined4 *)((int)this + 0x1c90) = 0; *(undefined4 *)((int)this + 0x1c94) = 0; KAGE::Network::MultiplayerManager::join_lobby(); FUN_00420710(); } else { if ((uint)local_70._challenge < 0x2e) { iVar4 = *(int *)(&DAT_00b7b0b0 + local_70._challenge * 4); } else { iVar4 = 0; } bVar3 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,iVar4); pMVar5 = extraout_EDX; if (bVar3 != 0) goto LAB_0090bda3; local_78.x = -1.0; local_78.y = -1.0; MessagePopup::MessagePopup (local_138,&extraout_EDX->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_78); local_8 = CONCAT31(local_8._1_3_,2); MessagePopup::add_ok_button((byte *)"##GAME###Online/ONLINE_CHALLENGE_BLOCKED",local_138); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_138); local_bc = 0; local_b8 = 0; local_c4 = 0; local_c0 = 0; local_cc = 0; local_c8 = 0; FID_conflict__Tidy(local_d8); FID_conflict__Tidy(local_e4); } local_8 = 0xffffffff; std::vector::_Tidy(); std::string::_Tidy_deallocate(local_70._password._buf); std::string::_Tidy_deallocate(local_70._seed._buf); LAB_0090be87: local_78.x = 0.0; local_78.y = 0.0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(); local_8 = 4; std::shared_ptr::assign((void *)((int)this + 0x1894),&uStack_80); ppuStack_84 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if (local_7c != (int *)0x0) { cVar2 = (**(code **)(*local_7c + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 0090bf10 NetplayManager::join_pending_lobby /* DB: ? NetplayManager::Update state 4 with this+0x1b2c: without a game creates MenuManager (MenuManager::constructor/Init, SetState) and stores the ConstLobby; with no game running calls online_lobby_join, else stores it and leaves the current lobby prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall NetplayManager::join_pending_lobby(NetplayManager *this,void *lobby) { Manager *pMVar1; MenuManager *this_00; MenuManager *extraout_EAX; int unused; undefined1 auStackY_dc [128]; undefined4 in_stack_ffffffac; undefined4 in_stack_ffffffb0; undefined1 auStack_4a [2]; KColor local_40; int local_28; MenuManager *pMStack_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = auStack_4a + 0x46; local_14 = 0xffffffff; puStack_18 = &LAB_00b090fa; local_1c = ExceptionList; ExceptionList = &local_1c; if (g_manager->_currentSaveSlot == 0) { if (g_menuManager == (MenuManager *)0x0) { puStack_20 = auStack_4a + 0x46; glfw_get_window_size(&local_28,0); glfw_get_window_size(&local_28,unused); Manager::set_viewport_size(); this_00 = operator_new(0xf930); _local_28 = CONCAT44(this_00,local_28); local_14 = 0; if (this_00 == (MenuManager *)0x0) { g_menuManager = (MenuManager *)0x0; } else { MenuManager::constructor(this_00); g_menuManager = extraout_EAX; } local_14 = 0xffffffff; MenuManager::Init(g_menuManager); KColor::SetFromARGB(&local_40,0xffffffff); pMVar1 = g_manager; (g_manager->_pendingMenuFadeColor)._red = local_40._red; (pMVar1->_pendingMenuFadeColor)._green = local_40._green; (pMVar1->_pendingMenuFadeColor)._blue = local_40._blue; (pMVar1->_pendingMenuFadeColor)._alpha = local_40._alpha; pMVar1->_pendingMenuState = 2; (pMVar1->_pendingMenuFadeColor)._unk = local_40._unk; pMVar1->_isMenuPending = 1; } else { puStack_20 = auStack_4a + 0x46; MenuManager::SetState(g_menuManager,2,1); } _local_28 = CONCAT44(auStackY_dc + 0x84,local_28); local_14 = 1; std::shared_ptr::assign(auStackY_dc + 0x88,(void *)((int)lobby + 4)); local_14 = 0xffffffff; FUN_009db250(); } else if ((g_game == (Game *)0x0) || (g_game->_stage == 0)) { online_lobby_join(this,lobby,CONCAT44(in_stack_ffffffb0,in_stack_ffffffac)); } else { puStack_20 = auStack_4a + 0x46; std::shared_ptr::assign(this + 0x625,(void *)((int)lobby + 4)); if (*this == this[1]) { _local_28 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(); local_14 = 2; netplay_leave_lobby_callback(); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_40._blue); } else { Multiplayer::leave_lobby(); } } ExceptionList = local_1c; return; } //@@ 0090c0e0 NetplayManager::store_local_persistent_game_data /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=Manager+0x4b3d8 from Menu_OnlineLobby::init_lobby_view: serializes Manager PersistentGameData with the local user id into the stream +0x1014, then 0090c2d0 loads it into the per-user map +0x1068 entry */ void NetplayManager::store_local_persistent_game_data(void) { int *piVar1; void *ptr; void *pvVar2; int in_ECX; undefined4 local_98; undefined4 uStack_94; void *local_8c; undefined4 local_88; void *pvStack_84; undefined1 local_79; undefined4 local_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 local_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; int local_58 [13]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; puStack_20 = (undefined1 *)(local_58 + 0x15); local_14 = 0xffffffff; puStack_18 = &LAB_00b09145; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_58 + 0x12); ExceptionList = &local_1c; piVar1 = (int *)(in_ECX + 0xfec); (**(code **)(*piVar1 + 8))(local_24); (**(code **)(*piVar1 + 4))(0,0xffffffff); KAGE::Filesys::BufferedStream::BufferedStream(local_58,0); local_14 = 0; (**(code **)(local_58[0] + 8))(); (**(code **)(local_58[0] + 4))(0,0xffffffff); local_78 = 0; uStack_74 = 0; uStack_70 = 0; uStack_6c = 0; local_68 = 0; uStack_64 = 0; uStack_60 = 0; uStack_5c = 0; local_8c = g_userProfile; local_14 = 2; if (g_userProfile == (void *)0x0) { pvStack_84 = (void *)0x0; local_88 = 0; } else { local_88 = *(undefined4 *)((int)g_userProfile + 8); pvStack_84 = *(void **)((int)g_userProfile + 0xc); } FUN_0091b0f0(&g_manager->_persistentGameData,&local_88); local_14._0_1_ = 1; local_8c = (void *)0x0; pvVar2 = PersistentGameDataWriter::compress(&local_78,(uint *)&local_8c); pvStack_84 = pvVar2; (**(code **)(*piVar1 + 4))(0,0xffffffff); pvVar2 = local_8c; (**(code **)(*piVar1 + 0xc))((int)local_8c + 5); local_79 = 2; (**(code **)(*(int *)(in_ECX + 0x1014) + 0x1c))(&local_79,1,1); local_8c = pvVar2; (**(code **)(*(int *)(in_ECX + 0x1014) + 0x1c))(&local_8c,4,1); ptr = pvStack_84; (**(code **)(*(int *)(in_ECX + 0x1014) + 0x1c))(pvStack_84,pvVar2,1); if (ptr != (void *)0x0) { local_14._0_1_ = 3; tracked_alloc(1,ptr,0); local_14._0_1_ = 1; } PersistentGameData::operator_assign(&g_manager->_persistentGameData); local_8c = g_userProfile; local_14 = CONCAT31(local_14._1_3_,4); if (g_userProfile == (void *)0x0) { uStack_94 = 0; local_98 = 0; } else { local_98 = *(undefined4 *)((int)g_userProfile + 8); uStack_94 = *(undefined4 *)((int)g_userProfile + 0xc); } _local_88 = CONCAT44(uStack_94,local_98); FUN_0090c2d0(&local_88,&local_78); FUN_00a58200(); ExceptionList = local_1c; return; } //@@ 0090c2d0 FUN_0090c2d0 void FUN_0090c2d0(undefined4 param_1,void *param_2) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_009154f0(local_10,param_1); PersistentGameDataReader::read(param_2,(PersistentGameData *)(*piVar1 + 0x18)); return; } //@@ 0090c300 FUN_0090c300 undefined4 FUN_0090c300(uint *param_1) { undefined4 uVar1; int in_ECX; undefined1 local_10 [8]; int local_8; FUN_00731ee0(local_10,param_1); if (*(char *)(local_8 + 0xd) == '\0') { if ((*(uint *)(local_8 + 0x14) <= param_1[1]) && (((*(uint *)(local_8 + 0x14) < param_1[1] || (*(uint *)(local_8 + 0x10) <= *param_1)) && (local_8 != *(int *)(in_ECX + 0x1068))))) { uVar1 = FUN_00914150(param_1); return uVar1; } } return 0; } //@@ 0090c360 NetplayManager::get_player_persistent_game_data /* DB: ECX=Manager+0x4b3d8: device of the player (InputManager::GetDeviceByPlayerEntity), its UserProfile id, finds it in map +0x1064 and returns &value+0x18 (a per-user PersistentGameData) or 0; Entity_Slot::Init stores it at slot+0x548 for variant 11 */ undefined4 NetplayManager::get_player_persistent_game_data(Entity_Player *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; void *in_ECX; uint uVar4; uint uVar5; uint local_20; uint uStack_1c; undefined1 local_14 [8]; int local_c; pvVar2 = InputManager::GetDeviceByPlayerEntity(in_ECX,param_1); if (pvVar2 != (void *)0x0) { iVar1 = *(int *)((int)pvVar2 + 0x374); if (iVar1 == 0) { uStack_1c = 0; local_20 = 0; uVar4 = local_20; uVar5 = uStack_1c; } else { uVar4 = *(uint *)(iVar1 + 8); uVar5 = *(uint *)(iVar1 + 0xc); } _local_20 = CONCAT44(uVar5,uVar4); FUN_00731ee0(local_14,&local_20); if ((((*(char *)(local_c + 0xd) == '\0') && (*(uint *)(local_c + 0x14) <= uVar5)) && ((*(uint *)(local_c + 0x14) < uVar5 || (*(uint *)(local_c + 0x10) <= uVar4)))) && (local_c != *(int *)((int)in_ECX + 0x1068))) { uVar3 = FUN_00914150(&local_20); return uVar3; } } return 0; } //@@ 0090c400 FUN_0090c400 undefined4 FUN_0090c400(void) { int iVar1; int *piVar2; uint uVar3; int in_ECX; uint uVar4; void *pvVar5; uint uVar6; int *local_44; uint local_40; uint local_3c; undefined8 local_38; undefined8 local_30; uint local_28; uint local_24; int local_20; undefined1 local_14 [8]; uint local_c; pvVar5 = (g_manager->_lobbyMembers)._begin; if (pvVar5 != (g_manager->_lobbyMembers)._end) { local_44 = (int *)(in_ECX + 0x1068); do { iVar1 = *(int *)((int)pvVar5 + 4); if (iVar1 == 0) { local_38 = 0; local_38._4_4_ = 0; local_38._0_4_ = 0; uVar4 = (uint)local_38; uVar6 = local_38._4_4_; } else { uVar4 = *(uint *)(iVar1 + 8); uVar6 = *(uint *)(iVar1 + 0xc); } local_40 = uVar4; local_3c = uVar6; FUN_00731ee0(&local_28,&local_40); if (*(char *)(local_20 + 0xd) != '\0') { return 0; } if (uVar6 < *(uint *)(local_20 + 0x14)) { return 0; } if ((uVar6 <= *(uint *)(local_20 + 0x14)) && (uVar4 < *(uint *)(local_20 + 0x10))) { return 0; } if (local_20 == *local_44) { return 0; } pvVar5 = (void *)((int)pvVar5 + 0x14); } while (pvVar5 != (g_manager->_lobbyMembers)._end); } piVar2 = *(int **)(in_ECX + 0x1864); local_44 = (int *)*piVar2; if (local_44 != piVar2) { local_40 = *(uint *)(in_ECX + 0x1068); local_38 = CONCAT44(local_38._4_4_,in_ECX + 0x1068); do { iVar1 = local_44[7]; if (iVar1 == 0) { local_30 = 0; local_30._4_4_ = 0; local_30._0_4_ = 0; uVar4 = (uint)local_30; uVar6 = local_30._4_4_; } else { uVar4 = *(uint *)(iVar1 + 8); uVar6 = *(uint *)(iVar1 + 0xc); } local_28 = uVar4; local_24 = uVar6; FUN_00731ee0(local_14,&local_28); if (((*(char *)(local_c + 0xd) != '\0') || (uVar6 < *(uint *)(local_c + 0x14))) || ((uVar3 = local_c, uVar6 <= *(uint *)(local_c + 0x14) && (uVar4 < *(uint *)(local_c + 0x10))))) { uVar3 = *(uint *)(in_ECX + 0x1068); } if (uVar3 == local_40) { return 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_44); } while (local_44 != piVar2); } return 1; } //@@ 0090c560 FUN_0090c560 void FUN_0090c560(void) { int iVar1; uint uVar2; undefined4 *puVar3; int in_ECX; uint uVar4; int *unaff_FS_OFFSET; undefined4 *local_3c; undefined4 *local_38; undefined4 *local_34; undefined4 *local_30; undefined4 **local_2c; int local_28; uint local_24; int iStack_20; int local_1c; undefined *puStack_18; undefined4 local_14; iStack_20 = (int)register0x00000010 + -4; local_14 = 0xffffffff; puStack_18 = &DAT_00b09198; local_1c = *unaff_FS_OFFSET; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; *unaff_FS_OFFSET = (int)&local_1c; uVar4 = *(uint *)(in_ECX + 0x106c); local_3c = (undefined4 *)0x0; local_38 = (undefined4 *)0x0; local_34 = (undefined4 *)0x0; local_28 = in_ECX; iVar1 = (int)register0x00000010 + -4; if (uVar4 != 0) { local_24 = uVar4; if (0x3333333 < uVar4) { /* WARNING: Subroutine does not return */ std::_Xlen(uVar2); } iStack_20 = (int)register0x00000010 + -4; puVar3 = std::_Allocate(uVar4 * 0x50); local_34 = puVar3 + uVar4 * 0x14; local_2c = &local_3c; local_14._1_3_ = 0; local_3c = puVar3; local_38 = puVar3; for (; local_24 != 0; local_24 = local_24 - 1) { local_14._0_1_ = 1; local_30 = puVar3; KAGE::Filesys::BufferedStream::BufferedStream(puVar3 + 8,0); local_14._0_1_ = 2; (**(code **)(puVar3[8] + 8))(); (**(code **)(puVar3[8] + 4))(0,0xffffffff); *puVar3 = 0; puVar3[1] = 0; puVar3[2] = 0; puVar3[3] = 0; puVar3[4] = 0; puVar3[5] = 0; puVar3[6] = 0; puVar3[7] = 0; puVar3 = puVar3 + 0x14; } local_38 = puVar3; iVar1 = iStack_20; } iStack_20 = iVar1; iVar1 = local_28; local_14 = 3; local_24 = **(int **)(local_28 + 0x1068); if ((int *)local_24 != *(int **)(local_28 + 0x1068)) { do { FUN_0091b0f0(local_24 + 0x18,local_24 + 0x10); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); } while (local_24 != *(int *)(iVar1 + 0x1068)); } load_persistent_game_data_buffer(local_28 + 0x1018); if (local_3c != (undefined4 *)0x0) { FUN_00915c20(local_3c); uVar4 = (((int)local_34 - (int)local_3c) / 0x50) * 0x50; puVar3 = local_3c; if (0xfff < uVar4) { puVar3 = (undefined4 *)local_3c[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_3c + (-4 - (int)puVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar3,uVar4); } *unaff_FS_OFFSET = local_1c; return; } //@@ 0090c740 FUN_0090c740 void FUN_0090c740(undefined4 param_1,int param_2) { int iVar1; undefined1 local_10 [12]; std::map::try_emplace(local_10,param_1); iVar1 = *(int *)(param_2 + 0x1e68); if (((iVar1 == 0) || (*(int *)(iVar1 + 0x161c) == -1)) || (*(int *)(param_2 + 0x161c) <= *(int *)(iVar1 + 0x161c))) { iVar1 = param_2; } FUN_00906100(iVar1); std::map::try_emplace(local_10,param_1); FUN_00906100(*(undefined4 *)(param_2 + 0x1e68)); std::map::try_emplace(local_10,param_1); FUN_00906100(*(undefined4 *)(param_2 + 0x1e6c)); return; } //@@ 0090c7e0 NetplayManager::restore_player_state /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=NetplayManager (map end +0x1070 next to the +0x1064 map of get_player_persistent_game_data): (userId*, player) finds the pending entry for the user (FUN_00913e50), picks the one of 4 0x34-byte slots whose key == player _playerType (+0x13c0), GameStatePlayer::Init/read from its buffer + Entity_Player::RestoreGameState, marks the slot 0x29 (free; FUN_00913e70 erases when all 4 are free), recurses into the linked players +0x1e68/+0x1e6c; callers Game::add_players (006f6500) and itself */ int NetplayManager::restore_player_state(uint *param_1,EntityPtr param_2) { int iVar1; EntityPtr EVar2; EntityPtr EVar3; uint *puVar4; uint uVar5; int *piVar6; int in_ECX; int *piVar7; undefined1 local_628 [8]; int local_620; uint local_61c; byte *local_618; undefined4 local_614; undefined4 local_610; undefined1 local_60c; undefined4 local_608; undefined4 local_604; int local_600; EntityPtr local_5fc; uint *local_5f8; GameStatePlayer local_5f0 [375]; uint local_14; void *local_10; undefined1 *puStack_c; GameStatePlayer local_8; local_8 = (GameStatePlayer)0xffffffff; puStack_c = &LAB_00b091d0; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_5f0 + 0x17b); ExceptionList = &local_10; local_5f8 = param_1; local_5fc = param_2; local_14 = uVar5; FUN_00731ee0(local_628,param_1); if (*(char *)(local_620 + 0xd) != '\0') { ExceptionList = local_10; return 0; } if (param_1[1] < *(uint *)(local_620 + 0x14)) { ExceptionList = local_10; return 0; } if ((param_1[1] <= *(uint *)(local_620 + 0x14)) && (*param_1 < *(uint *)(local_620 + 0x10))) { ExceptionList = local_10; return 0; } if (local_620 == *(int *)(in_ECX + 0x1070)) { ExceptionList = local_10; return 0; } piVar6 = (int *)FUN_00913e50(param_1); iVar1 = *(int *)((int)param_2 + 0x13c0); if (*piVar6 == iVar1) { piVar7 = piVar6; } else { piVar7 = piVar6 + 0xd; if (((piVar6[0xd] != iVar1) && (piVar7 = piVar6 + 0x1a, piVar6[0x1a] != iVar1)) && (piVar7 = piVar6 + 0x27, piVar6[0x27] != iVar1)) goto LAB_0090c9f0; } if (piVar7 != (int *)0x0) { (**(code **)(piVar7[0xc] + 0xc))(0,0,uVar5); local_618 = &s_empty; local_604 = 1; local_610 = 0; local_60c = 0; local_61c = -(uint)(piVar7 != (int *)0xfffffff8) & (uint)(piVar7 + 0xc); local_608 = 0xfedcba76; input_state_reset(local_5f0); local_8 = (GameStatePlayer)0x0; GameStatePlayer::Init(local_5f0); local_614 = 0xa9; GameStatePlayer::read(&local_61c); Entity_Player::RestoreGameState((Entity_Player *)local_5fc,local_5f0); puVar4 = local_5f8; local_600 = piVar7[1]; *piVar7 = 0x29; piVar7[1] = 0; if (((*piVar6 == 0x29) && (piVar6[0xd] == 0x29)) && ((piVar6[0x1a] == 0x29 && (piVar6[0x27] == 0x29)))) { std::map::erase(local_5f8); } EVar3 = local_5fc; EVar2 = *(EntityPtr *)((int)local_5fc + 0x1e68); if ((EVar2 != (EntityPtr)0x0) && (((*(int *)((int)EVar2 + 0x161c) == -1 || (*(int *)((int)local_5fc + 0x161c) <= *(int *)((int)EVar2 + 0x161c))) || (EVar2 == local_5fc)))) { restore_player_state(puVar4,EVar2); } if (*(int *)((int)EVar3 + 0x1e6c) != 0) { restore_player_state(puVar4,*(int *)((int)EVar3 + 0x1e6c)); } GameStatePlayer::~GameStatePlayer(local_5f0); ExceptionList = local_10; return local_600; } LAB_0090c9f0: if ((((*piVar6 == 0x29) && (piVar6[0xd] == 0x29)) && (piVar6[0x1a] == 0x29)) && (piVar6[0x27] == 0x29)) { std::map::erase(param_1); } ExceptionList = local_10; return 0; } //@@ 0090ca40 FUN_0090ca40 void FUN_0090ca40(uint param_1,char param_2) { uint uVar1; Game *pGVar2; Manager *pMVar3; uint uVar4; char cVar5; char cVar6; void *_Dst; int *piVar7; int in_ECX; void *_Src; undefined4 *puVar8; int iVar9; PersistentGameData *this; uVar4 = param_1; if (param_2 == '\0') { piVar7 = (int *)(param_1 + 0x28); param_1 = param_1 & 0xffffff; (**(code **)(*piVar7 + 0x14))((int)¶m_1 + 3,1,1); param_1 = 0; (**(code **)(*(int *)(uVar4 + 0x28) + 0x14))(¶m_1,4,1); (**(code **)(*(int *)(uVar4 + 0x28) + 0xc))(0,0); uVar1 = param_1; if (*(uint *)(in_ECX + 0xc) < param_1) { KAGE_LogMessage(1,(byte *)"[Frame %d] Notify Game Start being delayed until frame %d \n"); *(undefined4 *)(in_ECX + 0x18a4) = 0; if (*(void **)(in_ECX + 0x18a8) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 0x18a8),1); *(undefined4 *)(in_ECX + 0x18a8) = 0; } *(undefined4 *)(in_ECX + 0x18ac) = 0; *(uint *)(in_ECX + 0x18a4) = uVar1; uVar1 = *(uint *)(uVar4 + 4); *(uint *)(in_ECX + 0x18ac) = uVar1; _Dst = operator_new_tracked(uVar1); *(void **)(in_ECX + 0x18a8) = _Dst; _Src = *(void **)(uVar4 + 0x18); if (_Src == (void *)0x0) { _Src = *(void **)(uVar4 + 0xc); } memcpy(_Dst,_Src,*(size_t *)(in_ECX + 0x18ac)); return; } KAGE_LogMessage(1,(byte *)"[Frame %d] Notify Game Start \n"); if (param_2 == '\0') goto LAB_0090cb79; } else { KAGE_LogMessage(1,(byte *)"[Frame %d] Notify Game Start \n"); } pGVar2 = g_game; iVar9 = 0x15; puVar8 = (undefined4 *)&g_game->field_0x1bc14; (g_game->_onlinePlayerStats)._end = (g_game->_onlinePlayerStats)._begin; do { puVar8[1] = *puVar8; iVar9 = iVar9 + -1; puVar8 = puVar8 + 0xd; } while (iVar9 != 0); pGVar2->field_0x1c030 = 0; LAB_0090cb79: param_1 = param_1 & 0xffffff; (**(code **)(*(int *)(uVar4 + 0x28) + 0x14))((int)¶m_1 + 3,1,1); if (param_1._3_1_ == '\x04') { NetplayManager::load_game_start_packet(); } else if (param_1._3_1_ == '\x05') { FUN_00917fd0(); } else { KAGE_LogMessage(0x10,(byte *)"Unknown game start message type\n"); } NetplayManager::add_new_players(&g_manager->_netplayManager); cVar5 = param_2; pMVar3 = g_manager; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (pMVar3->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; if (param_2 != '\0') { piVar7 = (pMVar3->_lobbyMembers)._begin; if (piVar7 != (pMVar3->_lobbyMembers)._end) { do { cVar6 = (**(code **)(*piVar7 + 0x14))(); if (cVar6 != '\0') { if ((piVar7[3] == 9) || (piVar7[3] == 0x1e)) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x15,-1); this = &g_manager->_persistentGameData; if ((*(char *)this != '\0') && ((g_manager->_persistentGameData)._isFileLoaded != 0)) { *(undefined1 *)this = 0; Manager::BackupSaveFile((Manager *)this); pMVar3 = g_manager; piVar7 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar7 == 0) || ((pMVar3->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(this); } else { PersistentGameData::SaveToSteamCloud(this); } } } break; } piVar7 = piVar7 + 5; } while (piVar7 != (pMVar3->_lobbyMembers)._end); } memset(&DAT_00c716a0,0,0xb74); } DAT_00c71672 = 1; PersistentGameDataReader::read((void *)(in_ECX + 0x1018),&g_manager->_persistentGameData); pMVar3 = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar3->_persistentGameData)._isReadOnly = 0; if ((cVar5 == '\0') && (g_menuManager == (MenuManager *)0x0)) { func_0x0090d3f0(); } return; } //@@ 0090cd10 FUN_0090cd10 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0090cd10(int param_1,char param_2) { NetplayManager *pNVar1; undefined8 uVar2; undefined8 *puVar3; uint uVar4; Game *pGVar5; undefined4 uVar6; undefined4 uVar7; char cVar8; uint uVar9; int iVar10; int *extraout_EAX; int *piVar11; NetplayManager *in_ECX; PersistentGameData *pPVar12; NetplayManager NVar13; int eEventCounters; void *pvVar14; void *pvVar15; undefined1 auStack_90 [4]; Manager *pMStack_8c; undefined8 uStack_88; int *piStack_80; undefined1 uStack_79; undefined4 uStack_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; int aiStack_58 [13]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int iStack_14; puStack_20 = (undefined1 *)(aiStack_58 + 0x15); iStack_14 = 0xffffffff; puStack_18 = &LAB_00b0923d; local_1c = ExceptionList; uVar9 = __security_cookie ^ (uint)(aiStack_58 + 0x12); ExceptionList = &local_1c; local_24 = uVar9; KAGE_LogMessage(1,(byte *)"[Frame %d] NetManager::NotifyGameEnd() Result = %d \n"); iVar10 = (**(code **)((int)in_ECX[0x418] + 4))(uVar9); if (iVar10 == 0) { ExceptionList = local_1c; return; } shared_save_write(); KAGE::Filesys::BufferedStream::BufferedStream(aiStack_58,0); iStack_14 = 0; (**(code **)(aiStack_58[0] + 8))(); (**(code **)(aiStack_58[0] + 4))(0,0xffffffff); uStack_78 = 0; uStack_74 = 0; uStack_70 = 0; uStack_6c = 0; uStack_68 = 0; uStack_64 = 0; uStack_60 = 0; uStack_5c = 0; iStack_14 = 1; in_ECX[0x406] = (NetplayManager)0x0; in_ECX[0x407] = (NetplayManager)0x0; in_ECX[0x408] = (NetplayManager)0x0; in_ECX[0x409] = (NetplayManager)0x0; in_ECX[0x40a] = (NetplayManager)0x0; in_ECX[0x40b] = (NetplayManager)0x0; in_ECX[0x40c] = (NetplayManager)0x0; in_ECX[0x40d] = (NetplayManager)0x0; KAGE::Filesys::BufferedStream::operator_assign(aiStack_58); iStack_14 = 0xffffffff; FUN_00a58200(); memset(&DAT_00c716a0,0,0xb74); Menu_Save::load_slot_data(); if (in_ECX[0x422] != (NetplayManager)0x0) { while( true ) { puVar3 = *(undefined8 **) ((int)in_ECX[0x41f] + ((int)in_ECX[0x420] - 1U & (uint)in_ECX[0x421]) * 4); uVar2 = *puVar3; uStack_88._4_4_ = (undefined **)((ulonglong)uVar2 >> 0x20); uVar6 = uStack_88._4_4_; uStack_88._0_4_ = (undefined4)uVar2; uVar7 = (undefined4)uStack_88; uStack_88 = uVar2; unlock_completion_mark_for_player_type(uVar7,uVar6,*(undefined4 *)(puVar3 + 1)); pNVar1 = in_ECX + 0x422; *pNVar1 = (NetplayManager)((int)*pNVar1 + -1); if (*pNVar1 == (NetplayManager)0x0) break; in_ECX[0x421] = (NetplayManager)((int)in_ECX[0x421] + 1); } in_ECX[0x421] = (NetplayManager)0x0; } NVar13 = in_ECX[0x427]; while (NVar13 != (NetplayManager)0x0) { uVar9 = (uint)in_ECX[0x426] & 1; iVar10 = *(int *)((int)in_ECX[0x424] + ((uint)in_ECX[0x426] >> 1 & (int)in_ECX[0x425] - 1U) * 4) ; pMStack_8c = *(Manager **)(iVar10 + uVar9 * 8); iVar10 = *(int *)(iVar10 + 4 + uVar9 * 8); in_ECX[0x427] = (NetplayManager)((int)NVar13 + -1); if ((NetplayManager)((int)NVar13 + -1) == (NetplayManager)0x0) { in_ECX[0x426] = (NetplayManager)0x0; } else { in_ECX[0x426] = (NetplayManager)((int)in_ECX[0x426] + 1); } PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,(int)pMStack_8c,iVar10) ; NVar13 = in_ECX[0x427]; } if (param_1 == 1) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x27e); PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x27f); if (param_2 == '\0') goto LAB_0090cfe7; PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,499, -(g_manager->_persistentGameData)._eventCounters[499]); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x1f1,1); pPVar12 = &g_manager->_persistentGameData; uVar9 = (g_manager->_persistentGameData)._eventCounters[0x1f2]; uVar4 = (g_manager->_persistentGameData)._eventCounters[0x1f1]; if (uVar4 <= uVar9) goto LAB_0090cfe7; iVar10 = uVar4 - uVar9; eEventCounters = 0x1f2; } else { if (param_1 == 2) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x27e); } if (param_2 == '\0') goto LAB_0090cfe7; pPVar12 = &g_manager->_persistentGameData; iVar10 = (g_manager->_persistentGameData)._eventCounters[0x1f1]; if (iVar10 == 0) { iVar10 = 1; eEventCounters = 499; } else { iVar10 = -iVar10; eEventCounters = 0x1f1; } } PersistentGameData::IncreaseEventCounter(pPVar12,eEventCounters,iVar10); LAB_0090cfe7: if (g_game->field_0x1c030 == '\0') { OnlineStats::compute_awards(); } pGVar5 = g_game; if ((g_game->field_0x1c030 != '\0') || (KAGE_LogMessage(0x10,(byte *) "Attempting to save coop award progress before finalizing stats \n"), pGVar5->field_0x1c030 != '\0')) { piVar11 = (int *)&pGVar5->field_0x1bc14; pMStack_8c = (Manager *)0x0; do { uVar9 = 0; iVar10 = *piVar11; if (piVar11[1] - iVar10 >> 3 != 0) { do { uStack_88 = CONCAT44(KAGE::System::UserProfileBase::vftable,(undefined4)uStack_88); UserProfile::find_or_create((void *)(iVar10 + uVar9 * 8)); iStack_14 = 2; uStack_88._4_4_ = KAGE::System::UserProfile::vftable; piStack_80 = extraout_EAX; if (((extraout_EAX != (int *)0x0) && (extraout_EAX[2] != 0 || extraout_EAX[3] != 0)) && (extraout_EAX[5] == 0)) { KAGE::System::UserProfile::load_steam_avatar((void *)((int)&uStack_88 + 4)); } iStack_14 = 3; cVar8 = (*(code *)uStack_88._4_4_[5])(); iStack_14 = 0xffffffff; uStack_88 = CONCAT44(KAGE::System::UserProfileBase::vftable,(undefined4)uStack_88); if (cVar8 != '\0') { PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,(int)pMStack_8c + 500,1); } uVar9 = uVar9 + 1; iVar10 = *piVar11; } while (uVar9 < (uint)(piVar11[1] - iVar10 >> 3)); } pMStack_8c = (Manager *)((int)pMStack_8c + 1); piVar11 = piVar11 + 0xd; } while (pMStack_8c < 0x15); } pPVar12 = &g_manager->_persistentGameData; if ((*(char *)pPVar12 != '\0') && ((g_manager->_persistentGameData)._isFileLoaded != 0)) { *(undefined1 *)pPVar12 = 0; Manager::BackupSaveFile((Manager *)pPVar12); pMStack_8c = g_manager; piVar11 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar11 == 0) || ((pMStack_8c->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(pPVar12); } else { PersistentGameData::SaveToSteamCloud(pPVar12); } } NVar13 = in_ECX[0x41a]; FUN_009156e0(in_ECX + 0x41a,*(undefined4 *)((int)NVar13 + 4)); *(NetplayManager *)((int)NVar13 + 4) = NVar13; *(NetplayManager *)NVar13 = NVar13; *(NetplayManager *)((int)NVar13 + 8) = NVar13; in_ECX[0x41b] = (NetplayManager)0x0; uStack_79 = 3; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } pvVar15 = (void *)0x0; pvVar14 = (void *)0x1; NetConnection::send_message(g_multiplayerService,(void *)((int)&uStack_88 + 4),1,&uStack_79,1,0); iStack_14 = 4; FUN_008ef1d0((int)&uStack_88 + 4); NetplayManager::send_message(in_ECX,1,pvVar14,pvVar15); iStack_14 = 5; if (((piStack_80 != (int *)0x0) && (cVar8 = (**(code **)(*piStack_80 + 0xc))(), cVar8 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)((int)&uStack_88 + 4); } iStack_14 = 0xffffffff; NetplayManager::store_local_persistent_game_data(); uStack_88 = 0xb9c1bc; piStack_80 = (int *)0x0; iStack_14 = 6; std::shared_ptr::assign((void *)((int)&uStack_88 + 4),&g_multiplayerLobbyPtr); if (uStack_88._4_4_ == (undefined **)0x0) { iVar10 = 0; } else { iVar10 = *(int *)((int)uStack_88._4_4_ + 0x14) - *(int *)((int)uStack_88._4_4_ + 0x10) >> 3; } uStack_88 = CONCAT44(uStack_88._4_4_,KAGE::Network::Multiplayer::ConstLobby::vftable); iStack_14 = 7; if (((piStack_80 != (int *)0x0) && (cVar8 = (**(code **)(*piStack_80 + 0xc))(), cVar8 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)&uStack_88 + 4); } iStack_14 = 0xffffffff; if (iVar10 != 0) { pvVar14 = (void *)(**(code **)((int)in_ECX[0x405] + 4))(); NVar13 = in_ECX[0x401]; if (NVar13 == (NetplayManager)0x0) { NVar13 = in_ECX[0x3fe]; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } pvVar15 = (void *)0x0; NetConnection::send_message(g_multiplayerService,auStack_90,1,(void *)NVar13,(uint)pvVar14,0); iStack_14 = 8; FUN_008ef1d0(auStack_90); NetplayManager::send_message(in_ECX,1,pvVar14,pvVar15); iStack_14 = 9; if (((pMStack_8c != (Manager *)0x0) && (cVar8 = (**(code **)(*(int *)pMStack_8c + 0xc))(), cVar8 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(auStack_90); } } ExceptionList = local_1c; return; } //@@ 0090d360 KAGE::Filesys::BufferedStream::operator_assign /* DB: copies +4/+8, the byte vector +0xc (vector::_Clear_and_reserve + memmove) and +0x18..+0x24; Menu_Save::load_slot_data on BufferedStream locals */ void KAGE::Filesys::BufferedStream::operator_assign(int param_1) { int *piVar1; void *_Src; int in_ECX; uint _Size; void *local_8; piVar1 = (int *)(in_ECX + 0xc); *(undefined4 *)(in_ECX + 4) = *(undefined4 *)(param_1 + 4); *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(param_1 + 8); if (piVar1 != (int *)(param_1 + 0xc)) { _Src = *(void **)(param_1 + 0xc); local_8 = (void *)*piVar1; _Size = *(int *)(param_1 + 0x10) - (int)_Src; if ((uint)(*(int *)(in_ECX + 0x14) - (int)local_8) < _Size) { std::vector::_Clear_and_reserve(_Size); local_8 = (void *)*piVar1; } memmove(local_8,_Src,_Size); *(uint *)(in_ECX + 0x10) = _Size + (int)local_8; } *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)(param_1 + 0x18); *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(param_1 + 0x1c); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)(param_1 + 0x20); *(undefined4 *)(in_ECX + 0x24) = *(undefined4 *)(param_1 + 0x24); return; } //@@ 0090d4a0 FUN_0090d4a0 undefined4 FUN_0090d4a0(int *param_1) { int iVar1; int iVar2; bool bVar3; int iVar4; int in_ECX; uint uVar5; char *format; if (*(uint *)(in_ECX + 0x38) == 0) { return 1; } uVar5 = *param_1 - **(int **)(*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(uint *)(in_ECX + 0x34)) * 4); if (*(uint *)(in_ECX + 0x38) <= uVar5) { return 1; } iVar1 = *(int *)(*(int *)(*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(int *)(in_ECX + 0x34) + uVar5) * 4) + 4 ); iVar2 = param_1[1]; if ((*(int *)(*(int *)(*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(int *)(in_ECX + 0x34) + uVar5) * 4) + 8) == param_1[2]) || (iVar4 = (**(code **)(*(int *)(in_ECX + 0x1060) + 4))(), iVar4 == 0)) { bVar3 = false; } else { bVar3 = true; } if ((iVar1 == iVar2) && (!bVar3)) { return 1; } if (*(int *)(in_ECX + 0x11c8) == 0) { if (iVar1 == iVar2) { if (g_game != (Game *)0x0) { Console::print_format (&g_game->_console, "[Frame: %d] Save checksum mismatch (frame %d): local %08x, remote %08x\n", *(undefined4 *)(in_ECX + 0xc),*param_1, *(undefined4 *) (*(int *)(*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(int *)(in_ECX + 0x34) + uVar5) * 4) + 8),param_1[2]); } format = "[Frame: %d] Save checksum mismatch (frame %d): local %08x, remote %08x\n"; } else { if (g_game != (Game *)0x0) { Console::print_format (&g_game->_console, "[Frame: %d] Checksum mismatch (frame %d): local %08x, remote %08x\n", *(undefined4 *)(in_ECX + 0xc),*param_1, *(undefined4 *) (*(int *)(*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(int *)(in_ECX + 0x34) + uVar5) * 4) + 4),param_1[1]); } format = "[Frame: %d] Checksum mismatch (frame %d): local %08x, remote %08x\n"; } KAGE_LogMessage(1,(byte *)format); } FUN_008fe3a0(*param_1,iVar1 == iVar2); return 0; } //@@ 0090d640 NetplayManager::save_frame_snapshot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? (bool resetEntities): writes PersistentGameData to +0x1018, replaces the snapshot buffer in the per-frame map +0x38 for frame +0xc, pushes {frame, EntityList value, hash FUN_00683580} onto the deque +0x28; NetplayManager::try_advance_frame */ void NetplayManager::save_frame_snapshot(char param_1) { int *this; uint *puVar1; int iVar2; undefined8 *puVar3; qword qVar4; undefined ***pppuVar5; uint uVar6; int iVar7; int *piVar8; void *pvVar9; int iVar10; int in_ECX; uint uVar11; qword *pqVar12; EntityList *this_00; undefined4 local_94; int iStack_90; int local_8c; EntityList *local_88; undefined4 local_84; uint local_80; int local_7c; undefined4 local_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 local_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined **local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined **local_30 [3]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined **local_14; puStack_20 = (undefined1 *)(local_30 + 0xb); local_14 = (undefined **)0xffffffff; puStack_18 = &LAB_00b09285; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_30 + 8); ExceptionList = &local_1c; this_00 = (EntityList *)((int)g_game->_room + 0x1218); local_88 = this_00; local_7c = in_ECX; local_24 = uVar6; pppuVar5 = local_30 + 0xb; if (param_1 != '\0') { EntityList::Reset(this_00); EntityList::Update(this_00,0); pppuVar5 = (undefined ***)puStack_20; } puStack_20 = (undefined1 *)pppuVar5; iVar2 = local_7c; this = (int *)(local_7c + 0x28); uVar11 = *(uint *)(local_7c + 0x34); local_80 = *(int *)(local_7c + 0x38) + uVar11; piVar8 = (int *)*this; while( true ) { if (uVar11 == local_80) { KAGE::Filesys::BufferedStream::BufferedStream(&local_58,0); local_14 = (undefined **)0x0; (*(code *)local_58[2])(uVar6); (*(code *)local_58[1])(0,0xffffffff); local_78 = 0; uStack_74 = 0; uStack_70 = 0; uStack_6c = 0; local_68 = 0; uStack_64 = 0; uStack_60 = 0; uStack_5c = 0; local_14 = (undefined **)0x1; PersistentGameDataWriter::write (&local_78,&g_manager->_persistentGameData,(void *)(local_7c + 0x1018)); puVar1 = (uint *)(local_7c + 0xc); _Find_lower_bound<>(&local_94,puVar1); if (((*(char *)(local_8c + 0xd) == '\0') && (*(uint *)(local_8c + 0x10) <= *puVar1)) && (local_8c != *(int *)(local_7c + 0x3c))) { piVar8 = (int *)std::map::try_emplace(&local_84,puVar1); if (*(int *)(*piVar8 + 0x14) != 0) { piVar8 = (int *)std::map::try_emplace(&local_84,puVar1); iVar7 = *(int *)(*piVar8 + 0x14); if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } if (iVar7 != 0) { uVar6 = *(uint *)(iVar7 + -4); qVar4 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar6; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar4 < uVar6); free((void *)(iVar7 + -4)); } local_14 = (undefined **)CONCAT31(local_14._1_3_,1); piVar8 = (int *)std::map::try_emplace(&local_84,puVar1); *(undefined4 *)(*piVar8 + 0x14) = 0; } std::map::erase(puVar1); } local_84 = 0; local_80 = 0; pvVar9 = PersistentGameDataWriter::compress(&local_78,&local_80); piVar8 = (int *)std::map::try_emplace(&iStack_90,local_7c + 0xc); iVar7 = *piVar8; *(void **)(iVar7 + 0x14) = pvVar9; *(uint *)(iVar7 + 0x18) = local_80; local_80 = checksum_stream(local_30,0,0); uVar6 = *(uint *)(iVar2 + 0x30); local_94 = *(undefined4 *)(local_7c + 0xc); iStack_90 = local_88[1]._updateEL._capacity; uVar11 = *(uint *)(iVar2 + 0x38); if (uVar6 <= uVar11 + 1) { std_deque_growmap(this,uVar11); uVar6 = *(uint *)(iVar2 + 0x30); uVar11 = *(uint *)(iVar2 + 0x38); } *(uint *)(iVar2 + 0x34) = *(uint *)(iVar2 + 0x34) & uVar6 - 1; uVar6 = uVar11 + *(int *)(iVar2 + 0x34) & uVar6 - 1; iVar10 = *(int *)(iVar2 + 0x2c); iVar7 = uVar6 * 4; if (*(int *)(iVar10 + uVar6 * 4) == 0) { pvVar9 = operator_new(0xc); *(void **)(iVar7 + *(int *)(iVar2 + 0x2c)) = pvVar9; iVar10 = *(int *)(iVar2 + 0x2c); } puVar3 = *(undefined8 **)(iVar10 + iVar7); *puVar3 = CONCAT44(iStack_90,local_94); *(uint *)(puVar3 + 1) = local_80; *(int *)(iVar2 + 0x38) = *(int *)(iVar2 + 0x38) + 1; local_30[0] = KAGE::Filesys::StreamBase::vftable; local_58 = KAGE::Filesys::BufferedStreamBase::vftable; local_54 = 0; local_50 = 0; local_48 = local_4c; local_40 = 0; uStack_3c = 0; uStack_38 = 0; uStack_34 = 0; FUN_007dcd30(); ExceptionList = local_1c; return; } if (piVar8 == (int *)0x0) { iVar7 = 0; } else { iVar7 = *piVar8; } if (**(int **)(*(int *)(iVar7 + 4) + (*(int *)(iVar7 + 8) - 1U & uVar11) * 4) == *(int *)(local_7c + 0xc)) break; uVar11 = uVar11 + 1; } iVar2 = local_88[1]._updateEL._capacity; if (piVar8 == (int *)0x0) { *(int *)(*(int *)(_DAT_00000004 + (_DAT_00000008 - 1U & uVar11) * 4) + 4) = iVar2; ExceptionList = local_1c; return; } *(int *)(*(int *)(*(int *)(*piVar8 + 4) + (*(int *)(*piVar8 + 8) - 1U & uVar11) * 4) + 4) = iVar2; ExceptionList = local_1c; return; } //@@ 0090d950 FUN_0090d950 undefined4 FUN_0090d950(int param_1) { uint uVar1; int in_ECX; uVar1 = 0; if (*(uint *)(in_ECX + 0x38) != 0) { do { if (**(int **)(*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(int *)(in_ECX + 0x34) + uVar1) * 4) == param_1 ) { return *(undefined4 *) (*(int *)(in_ECX + 0x2c) + (*(int *)(in_ECX + 0x30) - 1U & *(int *)(in_ECX + 0x34) + uVar1) * 4); } uVar1 = uVar1 + 1; } while (uVar1 < *(uint *)(in_ECX + 0x38)); } return 0; } //@@ 0090d9b0 NetplayManager::add_new_players /* DB: ? "[Frame %d] Adding %d new players\n", next to write_player_game_states_message (was a ZHL prefix match NPCAI_Pathfinder::EvadeTarget) */ void __thiscall NetplayManager::add_new_players(NetplayManager *this) { void **ppvVar1; NetplayManager NVar2; Manager *pMVar3; NetplayManager *pNVar4; char cVar5; byte bVar6; int iVar7; undefined ***pppuVar8; undefined **ppuVar9; uint uVar10; undefined **recipient; undefined4 *puVar11; void *pvVar12; void *messageRefCount; undefined1 auStack_9a [2]; undefined **ppuStack_8c; undefined **ppuStack_88; undefined4 uStack_84; void *pvStack_80; void *pvStack_7c; void *pvStack_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; undefined **ppuStack_64; undefined **ppuStack_60; int *piStack_5c; int *piStack_58; undefined4 *puStack_54; undefined4 *puStack_50; undefined4 *puStack_4c; undefined **ppuStack_48; undefined **ppuStack_44; NetplayManager NStack_3c; undefined **ppuStack_38; undefined **local_34; NetplayManager *local_30; NetplayManager NStack_2c; undefined **local_28; char cStack_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint uStack_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00b0931f; local_1c = ExceptionList; ExceptionList = &local_1c; local_28 = (undefined **)0x0; local_34 = (undefined **)0x0; if (this[0x61a] != (NetplayManager)0x0) { local_30 = this; KAGE_LogMessage(1,(byte *)"[Frame %d] Adding %d new players\n"); local_34 = (undefined **)0x0; puStack_54 = (undefined4 *)0x0; puStack_50 = (undefined4 *)0x0; puStack_4c = (undefined4 *)0x0; uStack_14 = 0; NStack_3c = (NetplayManager)0x0; ppuStack_38 = (undefined **)0x0; NStack_3c = (NetplayManager)operator_new(0x30); pNVar4 = local_30; *(NetplayManager *)NStack_3c = NStack_3c; *(NetplayManager *)((int)NStack_3c + 4) = NStack_3c; *(NetplayManager *)((int)NStack_3c + 8) = NStack_3c; *(undefined2 *)((int)NStack_3c + 0xc) = 0x101; uStack_14._0_1_ = 1; NStack_2c = *(NetplayManager *)this[0x619]; if (NStack_2c != this[0x619]) { do { NVar2 = NStack_2c; ppuStack_60 = KAGE::Network::Multiplayer::ConstLobby::vftable; piStack_5c = (int *)0x0; piStack_58 = (int *)0x0; uStack_14._0_1_ = 2; std::shared_ptr::assign(&piStack_5c,&g_multiplayerLobbyPtr); local_28 = (undefined **)((uint)local_28 | 0xc); ppuStack_60 = KAGE::Network::Multiplayer::Lobby::vftable; uStack_14._0_1_ = 3; ppuStack_48 = (undefined **)FUN_00a28590(); ppuStack_44 = (undefined **)((int)ppuStack_48 >> 0x1f); iVar7 = FUN_00913ba0(); *(undefined4 *)(iVar7 + 4) = *(undefined4 *)((int)NVar2 + 0x1c); *(undefined1 *)(iVar7 + 8) = *(undefined1 *)((int)NVar2 + 0x20); *(undefined4 *)(iVar7 + 0xc) = *(undefined4 *)((int)NVar2 + 0x24); *(undefined4 *)(iVar7 + 0x10) = *(undefined4 *)((int)NVar2 + 0x28); ppuStack_60 = KAGE::Network::Multiplayer::ConstLobby::vftable; uStack_14._0_1_ = 4; if (((piStack_58 != (int *)0x0) && (cVar5 = (**(code **)(*piStack_58 + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } uStack_14._0_1_ = 1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&NStack_2c); } while (NStack_2c != pNVar4[0x619]); } NStack_2c = *(NetplayManager *)NStack_3c; recipient = (undefined **)(undefined4 *)0x0; if (NStack_2c != NStack_3c) { puVar11 = puStack_4c; do { if (puStack_50 == puVar11) { FUN_008ef230(); puVar11 = puStack_4c; } else { *puStack_50 = KAGE::System::UserProfileBase::vftable; puStack_50[1] = *(int *)((int)NStack_2c + 0x1c); *puStack_50 = KAGE::System::UserProfile::vftable; *(undefined1 *)(puStack_50 + 2) = *(undefined1 *)((int)NStack_2c + 0x20); puStack_50[3] = *(int *)((int)NStack_2c + 0x24); puStack_50[4] = *(int *)((int)NStack_2c + 0x28); puStack_50 = puStack_50 + 5; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&NStack_2c); } while (NStack_2c != NStack_3c); local_34 = (undefined **)puStack_54; recipient = (undefined **)puStack_54; } uStack_14 = (uint)uStack_14._1_3_ << 8; FUN_00914d90(); operator_delete((void *)NStack_3c,0x30); pMVar3 = g_manager; if (recipient != (undefined **)puStack_50) { do { puVar11 = (pMVar3->_lobbyMembers)._end; if (puVar11 == (pMVar3->_lobbyMembers)._capacity) { FUN_008ef230(); } else { *puVar11 = KAGE::System::UserProfileBase::vftable; puVar11[1] = recipient[1]; *puVar11 = KAGE::System::UserProfile::vftable; *(undefined1 *)(puVar11 + 2) = *(undefined1 *)(recipient + 2); puVar11[3] = recipient[3]; puVar11[4] = recipient[4]; ppvVar1 = &(pMVar3->_lobbyMembers)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x14); } recipient = recipient + 5; } while (recipient != (undefined **)puStack_50); recipient = local_34; } ppuStack_60 = KAGE::Network::Multiplayer::ConstLobby::vftable; piStack_5c = (int *)0x0; piStack_58 = (int *)0x0; uStack_14._0_1_ = 5; std::shared_ptr::assign(&piStack_5c,&g_multiplayerLobbyPtr); ppuVar9 = local_28; ppuStack_60 = KAGE::Network::Multiplayer::Lobby::vftable; uStack_14 = CONCAT31(uStack_14._1_3_,6); local_28 = (undefined **)((uint)local_28 | 0x31); local_34 = local_28; if (piStack_5c == (int *)0x0) { ppuStack_44 = (undefined **)0x0; pppuVar8 = &ppuStack_48; ppuStack_48 = KAGE::System::UserProfile::vftable; uVar10 = (uint)ppuVar9 | 0xb1; } else { pppuVar8 = (undefined ***)(**(code **)(*piStack_5c + 0x20))(); uVar10 = (uint)local_28 | 0x40; } NStack_3c = (NetplayManager)KAGE::System::UserProfileBase::vftable; ppuStack_38 = pppuVar8[1]; NStack_3c = (NetplayManager)KAGE::System::UserProfile::vftable; if ((char)uVar10 < '\0') { uVar10 = uVar10 & 0xffffff7f; } if ((uVar10 & 0x40) != 0) { uVar10 = uVar10 & 0xffffffbf; ppuStack_48 = KAGE::System::UserProfileBase::vftable; } local_34 = (undefined **)(uVar10 | 0x102); uStack_14 = 7; local_28 = local_34; bVar6 = KAGE::System::UserProfile::is_local_user(&NStack_3c); if ((bVar6 == 0) || (cStack_21 = '\x01', local_30[0x41d] == (NetplayManager)0x0)) { cStack_21 = '\0'; } ppuVar9 = local_28; if (((uint)local_28 & 2) != 0) { ppuVar9 = (undefined **)((uint)local_28 & 0xfffffffd); NStack_3c = (NetplayManager)KAGE::System::UserProfileBase::vftable; } uStack_14 = 0; if (((uint)ppuVar9 & 1) != 0) { ppuStack_60 = KAGE::Network::Multiplayer::ConstLobby::vftable; uStack_14 = 8; if (((piStack_58 != (int *)0x0) && (cVar5 = (**(code **)(*piStack_58 + 0xc))(), cVar5 != '\0') ) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } uStack_14 = uStack_14 & 0xffffff00; } if (cStack_21 != '\0') { KAGE::Filesys::BufferedStream::BufferedStream(&ppuStack_8c,0); uStack_14 = CONCAT31(uStack_14._1_3_,9); write_player_game_states_message(); local_34 = ppuStack_88; pvVar12 = pvStack_80; if (pvStack_74 != (void *)0x0) { pvVar12 = pvStack_74; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } NetConnection::send_message(g_multiplayerService,&ppuStack_48,1,pvVar12,(uint)local_34,0); puVar11 = puStack_50; uStack_14._0_1_ = 10; for (; recipient != (undefined **)puVar11; recipient = recipient + 5) { NStack_2c = (NetplayManager)((int)auStack_9a + -10); pvVar12 = (void *)0x0; messageRefCount = (void *)0x0; local_34 = ppuStack_44; NVar2 = (NetplayManager)((int)auStack_9a + -10); local_28 = ppuStack_48; if (ppuStack_44 != (undefined **)0x0) { cVar5 = (**(code **)(*ppuStack_44 + 4))(); NVar2 = NStack_2c; if (cVar5 != '\0') { if (((*(int **)((int)NStack_2c + 4) != (int *)0x0) && (cVar5 = (**(code **)(**(int **)((int)NStack_2c + 4) + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(NStack_2c); } *(undefined ***)((int)NStack_2c + 4) = local_34; *(undefined ***)NStack_2c = local_28; NVar2 = NStack_2c; } } NStack_2c = NVar2; multiplayer_send_message(recipient,pvVar12,messageRefCount); } uStack_14._0_1_ = 0xb; if (((ppuStack_44 != (undefined **)0x0) && (cVar5 = (**(code **)(*ppuStack_44 + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } uStack_14 = (uint)uStack_14._1_3_ << 8; ppuStack_64 = KAGE::Filesys::StreamBase::vftable; ppuStack_8c = KAGE::Filesys::BufferedStreamBase::vftable; ppuStack_88 = (undefined **)0x0; uStack_84 = 0; pvStack_7c = pvStack_80; pvStack_74 = (void *)0x0; uStack_70 = 0; uStack_6c = 0; uStack_68 = 0; FUN_007dcd30(); } Game::add_players(g_game,(int *)&puStack_54,4); pNVar4 = local_30; NVar2 = local_30[0x619]; FUN_00914d90(); *(NetplayManager *)((int)NVar2 + 4) = NVar2; *(NetplayManager *)NVar2 = NVar2; *(NetplayManager *)((int)NVar2 + 8) = NVar2; pNVar4[0x61a] = (NetplayManager)0x0; puVar11 = puStack_54; if (puStack_54 != (undefined4 *)0x0) { for (; puVar11 != puStack_50; puVar11 = puVar11 + 5) { *puVar11 = KAGE::System::UserProfileBase::vftable; } uVar10 = (((int)puStack_4c - (int)puStack_54) / 0x14) * 0x14; puVar11 = puStack_54; if (0xfff < uVar10) { puVar11 = (undefined4 *)puStack_54[-1]; uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)puStack_54 + (-4 - (int)puVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar11,uVar10); } } ExceptionList = local_1c; return; } //@@ 0090df40 NetplayManager::process_pending_joins /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? "[Frame %d] Processing pending joins" (frame at ECX+0xc) when pending joins (+0x1868) exist or forced (param); callers StageTransition::Update and Manager::RestartGame */ void NetplayManager::process_pending_joins(undefined4 param_1) { char cVar1; uint uVar2; int iVar3; NetplayManager *in_ECX; void *pvVar4; void *message; void *messageRefCount; undefined1 auStack_bc [4]; void *pvStack_b8; void *pvStack_b0; void *pvStack_a4; undefined **ppuStack_90; int *piStack_8c; undefined **ppuStack_88; void *pvStack_84; byte bStack_7d; undefined1 auStack_7c [80]; void *apvStack_2c [3]; undefined **ppuStack_20; int *piStack_1c; int *piStack_18; uint local_14; void *local_10; undefined1 *puStack_c; void *pvStack_8; pvStack_8 = (void *)0xffffffff; puStack_c = &LAB_00b0938e; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(apvStack_2c + 10); ExceptionList = &local_10; if ((in_ECX[0x61a] != (NetplayManager)0x0) || ((char)param_1 != '\0')) { local_14 = uVar2; KAGE_LogMessage(1,(byte *)"[Frame %d] Processing pending joins \n"); if ((char)param_1 != '\0') { reset(in_ECX,0); } add_new_players(); ppuStack_20 = KAGE::Network::Multiplayer::ConstLobby::vftable; piStack_1c = (int *)0x0; piStack_18 = (int *)0x0; pvStack_8 = (void *)0x0; std::shared_ptr::assign(&piStack_1c,&g_multiplayerLobbyPtr); ppuStack_20 = KAGE::Network::Multiplayer::Lobby::vftable; pvStack_8 = (void *)0x1; if (piStack_1c == (int *)0x0) { pvStack_84 = (void *)0x0; } else { iVar3 = (**(code **)(*piStack_1c + 0x20))(&ppuStack_90,uVar2); pvStack_84 = *(void **)(iVar3 + 4); ppuStack_90 = KAGE::System::UserProfileBase::vftable; } ppuStack_88 = KAGE::System::UserProfile::vftable; pvStack_8 = (void *)CONCAT31(pvStack_8._1_3_,2); bStack_7d = KAGE::System::UserProfile::is_local_user(&ppuStack_88); ppuStack_88 = KAGE::System::UserProfileBase::vftable; ppuStack_20 = KAGE::Network::Multiplayer::ConstLobby::vftable; pvStack_8 = (void *)0x3; if (piStack_18 != (int *)0x0) { cVar1 = (**(code **)(*piStack_18 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&piStack_1c); } } pvStack_8 = (void *)0xffffffff; if (bStack_7d != 0) { KAGE::Filesys::BufferedStream::BufferedStream(auStack_bc,0); pvStack_8 = (void *)0x4; if ((char)param_1 == '\0') { FUN_009193b0(); pvStack_8._0_1_ = 6; PersistentGameDataWriter::write(auStack_7c,&g_manager->_persistentGameData,in_ECX + 0x406); piStack_18 = (int *)0xf; piStack_1c = (int *)0x0; apvStack_2c[0] = (void *)0x0; pvStack_8._0_1_ = 7; FUN_00916f70(g_game->_challenge,apvStack_2c,auStack_7c,0); pvStack_8._0_1_ = 6; if (0xf < piStack_18) { uVar2 = (int)piStack_18 + 1; pvVar4 = apvStack_2c[0]; if (0xfff < uVar2) { pvVar4 = *(void **)((int)apvStack_2c[0] + -4); uVar2 = (int)piStack_18 + 0x24; if (0x1f < (uint)((int)apvStack_2c[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } pvStack_8 = (void *)CONCAT31(pvStack_8._1_3_,4); FUN_00a58200(); } else { piStack_18 = (int *)0xf; piStack_1c = (int *)0x0; apvStack_2c[0] = (void *)0x0; pvStack_8 = (void *)0x5; FUN_00916f70(g_game->_challenge,apvStack_2c,in_ECX + 0x406,param_1); pvStack_8 = (void *)CONCAT31(pvStack_8._1_3_,4); if (0xf < piStack_18) { uVar2 = (int)piStack_18 + 1; pvVar4 = apvStack_2c[0]; if (0xfff < uVar2) { pvVar4 = *(void **)((int)apvStack_2c[0] + -4); uVar2 = (int)piStack_18 + 0x24; if (0x1f < (uint)((int)apvStack_2c[0] + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } } pvStack_84 = pvStack_b8; pvVar4 = pvStack_b0; if (pvStack_a4 != (void *)0x0) { pvVar4 = pvStack_a4; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = (void *)0x0; message = pvStack_84; NetConnection::send_message(g_multiplayerService,&ppuStack_90,1,pvVar4,(uint)pvStack_84,0); pvStack_8._0_1_ = 8; FUN_008ef1d0(&ppuStack_90); send_message(in_ECX,0x1c,message,messageRefCount); pvStack_8 = (void *)CONCAT31(pvStack_8._1_3_,9); if (piStack_8c != (int *)0x0) { cVar1 = (**(code **)(*piStack_8c + 0xc))(); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&ppuStack_90); } } FUN_00a58200(); } } ExceptionList = local_10; return; } //@@ 0090e2a0 FUN_0090e2a0 void FUN_0090e2a0(GameState *param_1,int *param_2,uint param_3) { byte bVar1; Game *pGVar2; Manager *pMVar3; undefined4 *puVar4; Entity_Player *pEVar5; Entity_Player *pEVar6; int *piVar7; uint uVar8; void *pvVar9; int iVar10; uint uVar11; int iVar12; PlayerManager *pPVar13; undefined4 uVar14; undefined4 uVar15; undefined1 auStack_30 [8]; undefined4 uStack_28; undefined4 uStack_24; undefined8 uStack_20; undefined8 uStack_18; PlayerManager *local_c; FUN_00923450(); FUN_007384d0(); FUN_009b9150(); pMVar3 = g_manager; bVar1 = (g_manager->_persistentGameData)._isReadOnly; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); pGVar2 = g_game; (pMVar3->_persistentGameData)._isReadOnly = 1; Game::restore_game_state(pGVar2,param_1,1); pMVar3 = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); pGVar2 = g_game; pPVar13 = &g_game->_playerManager; (pMVar3->_persistentGameData)._isReadOnly = bVar1; uVar11 = 0; if ((int)(pGVar2->_playerManager)._playerList._end - (int)(pPVar13->_playerList)._begin >> 2 != 0) { do { pvVar9 = (pPVar13->_playerList)._end; if ((int)pvVar9 - (int)(pPVar13->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar9 = (pPVar13->_playerList)._end; } pGVar2 = g_game; piVar7 = (pPVar13->_playerList)._begin; uVar8 = (int)pvVar9 - (int)piVar7 >> 2; if (uVar11 < uVar8) { piVar7 = piVar7 + uVar11; } iVar12 = *piVar7; pPVar13 = &g_game->_playerManager; puVar4 = (undefined4 *) PlayerManager::get_player_start_position(auStack_30,iVar12,&g_vectorZero,uVar8); uVar11 = uVar11 + 1; *(undefined4 *)(iVar12 + 0x33c) = *puVar4; *(undefined4 *)(iVar12 + 0x340) = puVar4[1]; *(undefined1 *)(iVar12 + 0x410) = 0; } while (uVar11 < (uint)((int)(pGVar2->_playerManager)._playerList._end - (int)(pPVar13->_playerList)._begin >> 2)); } if (param_2 != (int *)0x0) { Game::add_players(g_game,param_2,param_3); } pMVar3 = g_manager; uVar11 = PlayerManager::count_main_players(&g_game->_playerManager); if (uVar11 != ((int)(pMVar3->_lobbyMembers)._end - (int)(pMVar3->_lobbyMembers)._begin) / 0x14) { KAGE_LogMessage(0x10,(byte *)"Num Players in match != Num Remote players! \n"); } uVar8 = 0; if (uVar11 != 0) { iVar12 = 0; do { iVar10 = *(int *)(iVar12 + 4 + (int)(pMVar3->_lobbyMembers)._begin); if (iVar10 == 0) { uStack_18 = 0; uStack_18._4_4_ = 0; uStack_18._0_4_ = 0; uVar14 = uStack_18._4_4_; uVar15 = (undefined4)uStack_18; } else { uVar14 = *(undefined4 *)(iVar10 + 0xc); uVar15 = *(undefined4 *)(iVar10 + 8); } uStack_20 = CONCAT44(uVar14,uVar15); pEVar5 = PlayerManager::get_player_by_user_id(local_c,&uStack_20); pEVar6 = PlayerManager::get_main_player(&g_game->_playerManager,uVar8); if ((pEVar5 != (Entity_Player *)0x0) && (pEVar6 != (Entity_Player *)0x0)) { Entity_Player::SetControllerIndex(pEVar6,(pEVar5->_damageEvents)._end,0); if (pEVar6->_twinPlayer != (EntityPtr)0x0) { Entity_Player::SetControllerIndex ((Entity_Player *)pEVar6->_twinPlayer,(pEVar5->_damageEvents)._end,0); } } uVar8 = uVar8 + 1; iVar12 = iVar12 + 0x14; } while (uVar8 < uVar11); } HUD::AssignPlayerHUDs(&g_game->_hud); uVar11 = 0; pPVar13 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar13->_playerList)._begin >> 2 != 0) { do { pvVar9 = (pPVar13->_playerList)._end; if ((int)pvVar9 - (int)(pPVar13->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar9 = (pPVar13->_playerList)._end; } piVar7 = (pPVar13->_playerList)._begin; if (uVar11 < (uint)((int)pvVar9 - (int)piVar7 >> 2)) { piVar7 = piVar7 + uVar11; } PlayerManager::GetPlayerSlotFromController(pPVar13,*(int *)(*piVar7 + 0x1618)); uVar11 = uVar11 + 1; pPVar13 = &g_game->_playerManager; } while (uVar11 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar13->_playerList)._begin >> 2)); } pGVar2 = g_game; KAGE_LogMessage(1,(byte *)"Clearing player color assignments \n"); puVar4 = (undefined4 *)&(pGVar2->_playerManager).field_0x60; iVar12 = 0; do { KAGE_LogMessage(1,(byte *)"Clearing player color assignment for color %d \n"); iVar12 = iVar12 + 1; *puVar4 = 0xffffffff; puVar4 = puVar4 + 1; } while (iVar12 < 4); param_3 = 0; pvVar9 = (pMVar3->_lobbyMembers)._begin; iVar10 = (int)(pMVar3->_lobbyMembers)._end - (int)pvVar9; iVar12 = iVar10 >> 0x1f; if (iVar10 / 0x14 + iVar12 != iVar12) { param_1 = (GameState *)0x0; do { iVar12 = *(int *)((int)param_1 + 0x10 + (int)pvVar9); uStack_18 = CONCAT44(iVar12,(undefined4)uStack_18); if (iVar12 != 5) { iVar12 = *(int *)((int)param_1 + 4 + (int)pvVar9); if (iVar12 == 0) { uStack_20 = 0; uStack_20._4_4_ = 0; uStack_20._0_4_ = 0; uStack_24 = uStack_20._4_4_; uStack_28 = (undefined4)uStack_20; } else { uStack_24 = *(undefined4 *)(iVar12 + 0xc); uStack_28 = *(undefined4 *)(iVar12 + 8); } pEVar5 = PlayerManager::get_player_by_user_id(local_c,(ulonglong *)&uStack_28); pGVar2 = g_game; if ((pEVar5 != (Entity_Player *)0x0) && (pvVar9 = (pEVar5->_damageEvents)._end, (g_game->_playerManager).field_0x5c != '\0')) { iVar12 = 0; piVar7 = (int *)&(g_game->_playerManager).field_0x60; do { if ((void *)*piVar7 == pvVar9) { if (iVar12 == uStack_18._4_4_) goto LAB_0090e650; if (iVar12 != 5) { KAGE_LogMessage(1,(byte *)"Clearing player color assignment for color %d \n"); (pGVar2->_seedEffects)._stageSeeds[iVar12 + -0x25] = -1; } break; } iVar12 = iVar12 + 1; piVar7 = piVar7 + 1; } while (iVar12 < 4); (pGVar2->_seedEffects)._stageSeeds[uStack_18._4_4_ + -0x25] = (int)pvVar9; } } LAB_0090e650: param_3 = param_3 + 1; param_1 = (GameState *)((int)param_1 + 0x14); pvVar9 = (pMVar3->_lobbyMembers)._begin; } while (param_3 < (uint)(((int)(pMVar3->_lobbyMembers)._end - (int)pvVar9) / 0x14)); } uVar14 = 1; HUD::mark_all_slots_dirty(&g_game->_hud,1,1); uVar15 = 0x90e6ab; text_image_cache_reset(&(g_game->_hud)._statHUD); FUN_009a8a40(uVar14,uVar15); return; } //@@ 0090e6d0 NetplayManager::check_connection /* DB: returns 1 while the network session (g_multiplayerService vtable +0x10) is up; otherwise, once (ECX+0x58 == -1), opens the "##PLATFORM###LOST_CONNECTION_TO_SERVER" popup and stores its id at +0x58, returns 0; NetplayManager::Update, Menu_Online*::Update prototype: db/protos.zhl */ byte __thiscall NetplayManager::check_connection(NetplayManager *this) { undefined1 *puVar1; char cVar2; NetplayManager NVar3; undefined1 local_d0 [168]; Vector local_28; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_d0 + 0xcc; local_14 = 0xffffffff; puStack_18 = &LAB_00b093d0; local_1c = ExceptionList; ExceptionList = &local_1c; puVar1 = local_d0 + 0xcc; if ((g_multiplayerService != (void *)0x0) && (cVar2 = (**(code **)(*(int *)g_multiplayerService + 0x10)) (__security_cookie ^ (uint)(local_d0 + 0xc0)), puVar1 = puStack_20, cVar2 != '\0')) { ExceptionList = local_1c; return 1; } puStack_20 = puVar1; if (this[0x16] == (NetplayManager)0xffffffff) { local_28.x = (float)&DAT_bf800000; local_28.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_d0,&g_manager->_font2_TeamMeatEx12,netplay_lost_connection_callback,this, &local_28); local_14 = 0; MessagePopup::add_ok_button((byte *)"##PLATFORM###LOST_CONNECTION_TO_SERVER",local_d0); NVar3 = (NetplayManager)PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_d0); this[0x16] = NVar3; FUN_00420710(); ExceptionList = local_1c; return 0; } ExceptionList = local_1c; return 1; } //@@ 0090e7d0 online_check_mods_allowed /* DB: strings "##PLATFORM###ONLINE_MODS_BANNED"/"ONLINE_MODS_NEEDS_RESTART"/"ONLINE_MODS_PERMABANNED"; when the mod state Manager+0x4a91c is 2/3/4 queues the matching popup (PopupQueue desc FUN_009c25e0, OK button FUN_009c3c30, PopupQueue::push) and returns false; online_lobby_join, Menu_Game::Update */ undefined4 online_check_mods_allowed(void) { int iVar1; char *text; undefined1 local_c4 [84]; undefined1 local_70 [12]; undefined1 local_64 [12]; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09400; local_10 = ExceptionList; iVar1 = *(int *)&g_manager->field_0x4a91c; if (iVar1 == 2) { text = "##PLATFORM###ONLINE_MODS_BANNED"; } else if (iVar1 == 3) { text = "##PLATFORM###ONLINE_MODS_PERMABANNED"; } else { if (iVar1 != 4) { return 0; } text = "##PLATFORM###ONLINE_MODS_NEEDS_RESTART"; } local_18.x = (float)&DAT_bf800000; local_18.y = (float)&DAT_bf800000; ExceptionList = &local_10; MessagePopup::MessagePopup (local_c4,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_18); local_8 = 0; MessagePopup::add_ok_button((byte *)text,local_c4); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_c4); local_48 = 0; local_44 = 0; local_50 = 0; local_4c = 0; local_58 = 0; local_54 = 0; FID_conflict__Tidy(local_64); FID_conflict__Tidy(local_70); ExceptionList = local_10; return 1; } //@@ 0090e8e0 online_lobby_is_user_banned /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (lobby): copies the lobby's ConstLobby/settings (LobbySettings::reset, Menu_Save::select_save_slot) and scans its 8-byte banned user-id list for the local g_userProfile id; on a hit shows "##GAME###Online/ONLINE_USER_BANNED" and returns 1; online_lobby_join aborts when it returns true; also Level::InitializeGenesisRoom and 009088e0 prototype: db/protos.zhl, confirmed by RET 4 */ byte online_lobby_is_user_banned(void *lobby) { Vector VVar1; uint uVar2; uint uVar3; byte bVar4; float fVar5; float fVar6; undefined1 auStackY_1c0 [128]; undefined **lobbyHandleVtable; void *lobby_00; void *lobbyRefCount; undefined1 auStack_12e [2]; undefined1 local_120 [84]; undefined1 local_cc [12]; undefined1 local_c0 [12]; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; Vector local_78; LobbySettings local_70; int local_28; int local_24; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09443; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)((&local_70)[1]._seed._buf + 0xc); ExceptionList = &local_10; LobbySettings::reset(&local_70); local_78.y = (float)(auStackY_1c0 + 0x84); lobbyHandleVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; lobby_00 = (void *)0x0; lobbyRefCount = (void *)0x0; local_8 = 1; std::shared_ptr::assign(auStackY_1c0 + 0x88,(void *)((int)lobby + 4)); local_8 = local_8 & 0xffffff00; Menu_Save::select_save_slot((Menu_Save *)&local_70,lobbyHandleVtable,lobby_00,lobbyRefCount); if (g_userProfile == (void *)0x0) { local_78.x = 0.0; local_78.y = 0.0; VVar1 = local_78; local_78.y = 0.0; local_78.x = 0.0; fVar5 = local_78.x; fVar6 = local_78.y; local_78 = VVar1; } else { fVar5 = *(float *)((int)g_userProfile + 8); fVar6 = *(float *)((int)g_userProfile + 0xc); } uVar2 = 0; uVar3 = local_24 - local_28 >> 3; if (uVar3 != 0) { do { if ((*(float *)(local_28 + uVar2 * 8) == fVar5) && (*(float *)(local_28 + 4 + uVar2 * 8) == fVar6)) { local_78.x = -1.0; local_78.y = -1.0; MessagePopup::MessagePopup (local_120,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_78); local_8 = CONCAT31(local_8._1_3_,2); MessagePopup::add_ok_button((byte *)"##GAME###Online/ONLINE_USER_BANNED",local_120); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_120); local_a4 = 0; local_a0 = 0; local_ac = 0; local_a8 = 0; local_b4 = 0; local_b0 = 0; FID_conflict__Tidy(local_c0); FID_conflict__Tidy(local_cc); bVar4 = 1; goto LAB_0090e99a; } uVar2 = uVar2 + 1; } while (uVar2 < uVar3); } bVar4 = 0; LAB_0090e99a: std::vector::_Tidy(); std::string::_Tidy_deallocate(local_70._password._buf); std::string::_Tidy_deallocate(local_70._seed._buf); ExceptionList = local_10; return bVar4; } //@@ 0090ea90 FUN_0090ea90 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_0090ea90(int param_1) { char *text; undefined1 local_2c4 [84]; undefined1 local_270 [12]; undefined1 local_264 [12]; undefined4 local_258; undefined4 local_254; undefined4 local_250; undefined4 local_24c; undefined4 local_248; undefined4 local_244; Vector local_21c; byte local_214 [512]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09480; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_214 + 0x210); ExceptionList = &local_10; if (param_1 == 0) { KAGE_LogMessage(0x10,(byte *)"Result is not an error"); switchD_0090ebeb_caseD_4: text = "#Online/ERROR_UNKNOWN"; } else { switch(param_1) { case 3: text = "#Online/ERROR_NOT_CONNECTED"; break; default: goto switchD_0090ebeb_caseD_4; case 5: text = "#Online/ERROR_TIMED_OUT"; break; case 6: text = "#Online/ERROR_ACCESS_DENIED"; break; case 9: text = "#Online/ERROR_LIMIT_REACHED"; break; case 0xb: text = "#Online/ERROR_REQUEST_BLOCKED"; break; case 0xc: text = "#Online/ERROR_USER_BANNED"; break; case 0x10: text = "#Online/ERROR_LOBBY_DOESNT_EXIST"; break; case 0x11: text = "#Online/ERROR_LOBBY_FULL"; } } local_21c.x = (float)&DAT_bf800000; local_21c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_2c4,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_21c); local_8 = 0; string_table_translate(&g_manager->_stringTable,(byte *)text); sprintf_s(local_214,0x200,(byte *)"%s\\n%s"); MessagePopup::add_ok_button(local_214,local_2c4); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_2c4); local_248 = 0; local_244 = 0; local_250 = 0; local_24c = 0; local_258 = 0; local_254 = 0; FID_conflict__Tidy(local_264); FID_conflict__Tidy(local_270); ExceptionList = local_10; return; } //@@ 0090eca0 NetplayManager::send_message /* DB: ? callers build a message with FUN_00a78160(msg,1,data,size,..) then call this(flags,...); flags bit1 adds the lobby host, bit4 walks the peer list at this+0x1864 (std::list, user id at node +0x1c) collecting recipients into a set of 64-bit ids before dispatching; Menu_OnlineLobby::update_controls (flags 1), Manager::update_state_loading (0x11) prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall NetplayManager::send_message(NetplayManager *this,uint flags,void *message,void *messageRefCount) { int iVar1; byte bVar2; char cVar3; undefined4 uVar4; byte *pbVar5; undefined4 uVar6; NetplayManager NVar7; void *pvVar8; uint uVar9; longlong lVar10; undefined1 auStackY_138 [128]; void *pvVar11; int *piVar12; NetplayManager *pNVar13; void *local_94; undefined4 local_8c; int *local_88; undefined **local_84; int local_80; int *local_7c; undefined8 local_78; void *local_70; NetplayManager *local_6c; NetplayManager *local_68; uint local_64; int local_60; int *local_5c; undefined **local_58; int local_54; void *local_4c; undefined4 local_48; NetplayManager *local_44; undefined8 local_40; undefined4 local_38; NetplayManager *pNStack_34; void *local_2c; NetplayManager *local_28; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b09533; local_1c = ExceptionList; ExceptionList = &local_1c; local_28 = (NetplayManager *)0x0; pNStack_34 = (NetplayManager *)0x0; local_14 = 0; local_44 = this; if ((flags & 1) == 0) { local_4c = (void *)0x0; local_48 = 0; local_4c = operator_new(0x20); *(void **)local_4c = local_4c; *(void **)((int)local_4c + 4) = local_4c; *(void **)((int)local_4c + 8) = local_4c; *(undefined2 *)((int)local_4c + 0xc) = 0x101; if ((flags & 2) != 0) { local_2c = (void *)0x0; pNVar13 = (NetplayManager *)0x0; while( true ) { local_84 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_80 = 0; local_7c = (int *)0x0; local_14._0_1_ = 2; std::shared_ptr::assign(&local_80,&g_multiplayerLobbyPtr); local_28 = (NetplayManager *)((uint)pNVar13 | 0x18); if (local_80 == 0) { pvVar8 = (void *)0x0; } else { pvVar8 = (void *)(*(int *)(local_80 + 0x14) - *(int *)(local_80 + 0x10) >> 3); } local_84 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14._0_1_ = 3; if (((local_7c != (int *)0x0) && (cVar3 = (**(code **)(*local_7c + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } if (pvVar8 <= local_2c) break; local_8c = 0; local_88 = (int *)0x0; local_14._0_1_ = 4; std::shared_ptr::assign(&local_8c,&g_multiplayerLobbyPtr); local_28 = (NetplayManager *)((uint)pNVar13 | 0x78); local_14._0_1_ = 5; KAGE::Network::Multiplayer::Lobby::get_member(); local_14._0_1_ = 8; if (((local_88 != (int *)0x0) && (cVar3 = (**(code **)(*local_88 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_14 = CONCAT31(local_14._1_3_,7); pvVar8 = (g_manager->_lobbyMembers)._begin; pvVar11 = (g_manager->_lobbyMembers)._end; local_40 = CONCAT44(pvVar11,(NetplayManager *)local_40); if (pvVar8 != pvVar11) { do { iVar1 = *(int *)((int)pvVar8 + 4); if (iVar1 == 0) { pNStack_34 = (NetplayManager *)0x0; pNVar13 = pNStack_34; local_38 = 0; pNStack_34 = (NetplayManager *)0x0; } else { pNStack_34 = *(NetplayManager **)(iVar1 + 8); pNVar13 = *(NetplayManager **)(iVar1 + 0xc); } lVar10 = FUN_00a23920(); if (lVar10 == CONCAT44(pNVar13,pNStack_34)) goto LAB_0090ef7c; pvVar8 = (void *)((int)pvVar8 + 0x14); } while ((NetplayManager)pvVar8 != local_40._4_4_); } iVar1 = local_54; if (local_54 == 0) { local_40 = 0; local_40._4_4_ = (NetplayManager)0x0; local_40._0_4_ = (NetplayManager *)0x0; local_68 = (NetplayManager *)local_40; uVar9 = (uint)local_40._4_4_; } else { local_68 = *(NetplayManager **)(local_54 + 8); uVar9 = *(uint *)(local_54 + 0xc); } local_64 = uVar9; pNStack_34 = local_68; FUN_00731ee0(); if (((*(char *)((int)local_94 + 0xd) == '\0') && (*(uint *)((int)local_94 + 0x14) <= uVar9)) && (((*(uint *)((int)local_94 + 0x14) < uVar9 || (*(NetplayManager **)((int)local_94 + 0x10) <= pNStack_34)) && (local_94 != local_4c)))) { LAB_0090ef7c: local_21 = '\0'; } else { if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::SmartPointer(); } else { if (iVar1 == 0) { local_40 = 0; local_40._4_4_ = (NetplayManager)0x0; local_40._0_4_ = (void *)0x0; local_70 = (NetplayManager *)local_40; local_6c = (NetplayManager *)local_40._4_4_; } else { local_70 = *(void **)(iVar1 + 8); local_6c = *(NetplayManager **)(iVar1 + 0xc); } NetworkManager::get_peer(g_multiplayerService,&local_60,(ulonglong *)&local_70); } local_14 = CONCAT31(local_14._1_3_,9); local_28 = (NetplayManager *)((uint)local_28 | 0x81); pNStack_34 = local_28; if ((local_60 == 0) && ((bVar2 = KAGE::System::UserProfile::is_local_user(&local_58), bVar2 == 0 || ((flags & 0x10) == 0)))) goto LAB_0090ef7c; local_21 = '\x01'; } local_14._1_3_ = 0; if (((uint)local_28 & 1) != 0) { local_28 = (NetplayManager *)((uint)local_28 & 0xfffffffe); local_14 = 10; if (((local_5c != (int *)0x0) && (cVar3 = (**(code **)(*local_5c + 0xc))(), cVar3 != '\0') ) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } } pvVar8 = messageRefCount; local_14._0_1_ = 7; if (local_21 != '\0') { pvVar11 = (void *)0x0; piVar12 = (int *)0x0; local_40 = CONCAT44(message,(NetplayManager *)local_40); if ((messageRefCount != (void *)0x0) && (cVar3 = (**(code **)(*(int *)messageRefCount + 4))(), cVar3 != '\0')) { if ((piVar12 != (int *)0x0) && ((cVar3 = (**(code **)(*piVar12 + 0xc))(), cVar3 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStackY_138 + 0x84); } pvVar11 = (void *)local_40._4_4_; piVar12 = pvVar8; } multiplayer_send_message(&local_58,pvVar11,piVar12); if (local_54 == 0) { local_40 = 0; local_40._4_4_ = (NetplayManager)0x0; local_40._0_4_ = (NetplayManager *)0x0; uVar4 = local_40._4_4_; uVar6 = (NetplayManager *)local_40; } else { uVar4 = *(undefined4 *)(local_54 + 0xc); uVar6 = *(undefined4 *)(local_54 + 8); } local_78 = CONCAT44(uVar4,uVar6); pbVar5 = map_u64_bool_subscript(&local_4c,&local_78); *pbVar5 = 1; } local_2c = (void *)((int)local_2c + 1); local_58 = KAGE::System::UserProfileBase::vftable; pNVar13 = local_28; } this = local_44; } local_14._0_1_ = 1; if ((flags & 4) != 0) { NVar7 = *(NetplayManager *)this[0x619]; local_40 = CONCAT44(NVar7,(NetplayManager *)local_40); if (NVar7 != this[0x619]) { do { iVar1 = *(int *)((int)NVar7 + 0x1c); if (iVar1 == 0) { local_78 = 0; local_78._4_4_ = (NetplayManager *)0x0; local_78._0_4_ = (void *)0x0; local_6c = local_78._4_4_; local_70 = (NetplayManager *)local_78; } else { local_6c = *(NetplayManager **)(iVar1 + 0xc); local_70 = *(void **)(iVar1 + 8); } local_2c = local_70; pNStack_34 = local_6c; FUN_00731ee0(); if ((((*(char *)((int)local_94 + 0xd) == '\0') && (*(NetplayManager **)((int)local_94 + 0x14) <= pNStack_34)) && ((*(NetplayManager **)((int)local_94 + 0x14) < pNStack_34 || (*(void **)((int)local_94 + 0x10) <= local_2c)))) && (local_94 != local_4c)) { LAB_0090f165: local_21 = '\0'; } else { if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::SmartPointer(); } else { if (iVar1 == 0) { local_78 = 0; local_78._4_4_ = (NetplayManager *)0x0; local_78._0_4_ = (NetplayManager *)0x0; local_68 = (NetplayManager *)local_78; local_64 = (uint)local_78._4_4_; } else { local_68 = *(NetplayManager **)(iVar1 + 8); local_64 = *(uint *)(iVar1 + 0xc); } NetworkManager::get_peer(g_multiplayerService,&local_60,(ulonglong *)&local_68); } local_14 = CONCAT31(local_14._1_3_,0xb); local_28 = (NetplayManager *)((uint)local_28 | 0x102); pNStack_34 = local_28; if ((local_60 == 0) && ((cVar3 = (**(code **)(*(int *)((int)NVar7 + 0x18) + 0x14))(), cVar3 == '\0' || ((flags & 0x10) == 0)))) goto LAB_0090f165; local_21 = '\x01'; } local_14._1_3_ = 0; if (((uint)local_28 & 2) != 0) { local_28 = (NetplayManager *)((uint)local_28 & 0xfffffffd); local_14 = 0xc; if (((local_5c != (int *)0x0) && (cVar3 = (**(code **)(*local_5c + 0xc))(), cVar3 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } } local_14._0_1_ = 1; if (local_21 != '\0') { pvVar8 = (void *)0x0; pNVar13 = (NetplayManager *)0x0; pNStack_34 = messageRefCount; local_2c = message; if ((messageRefCount != (void *)0x0) && (cVar3 = (**(code **)(*(int *)messageRefCount + 4))(), cVar3 != '\0')) { if ((pNVar13 != (NetplayManager *)0x0) && ((cVar3 = (**(code **)((int)*pNVar13 + 0xc))(), cVar3 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStackY_138 + 0x84); } pvVar8 = local_2c; pNVar13 = pNStack_34; } multiplayer_send_message((void *)((int)NVar7 + 0x18),pvVar8,pNVar13); iVar1 = *(int *)((int)NVar7 + 0x1c); if (iVar1 == 0) { local_78 = 0; local_78._4_4_ = (NetplayManager *)0x0; local_78._0_4_ = (NetplayManager *)0x0; local_54 = (int)local_78._4_4_; local_58 = (undefined **)(NetplayManager *)local_78; } else { local_54 = *(int *)(iVar1 + 0xc); local_58 = *(undefined ***)(iVar1 + 8); } pbVar5 = map_u64_bool_subscript(&local_4c,(ulonglong *)&local_58); *pbVar5 = 1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)((int)&local_40 + 4)); NVar7 = local_40._4_4_; } while (local_40._4_4_ != local_44[0x619]); } } if (((flags & 8) != 0) && (piVar12 = (g_manager->_lobbyMembers)._begin, piVar12 != (g_manager->_lobbyMembers)._end)) { do { iVar1 = piVar12[1]; if (iVar1 == 0) { local_78 = 0; local_78._4_4_ = (NetplayManager *)0x0; local_78._0_4_ = (void *)0x0; local_6c = local_78._4_4_; local_70 = (NetplayManager *)local_78; } else { local_6c = *(NetplayManager **)(iVar1 + 0xc); local_70 = *(void **)(iVar1 + 8); } local_40 = CONCAT44(local_70,(NetplayManager *)local_40); local_44 = local_6c; FUN_00731ee0(); if ((((*(char *)((int)local_94 + 0xd) == '\0') && (*(NetplayManager **)((int)local_94 + 0x14) <= local_44)) && ((*(NetplayManager **)((int)local_94 + 0x14) < local_44 || (*(uint *)((int)local_94 + 0x10) <= (uint)local_40._4_4_)))) && (local_94 != local_4c)) { LAB_0090f35f: local_21 = '\0'; } else { if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::SmartPointer(); } else { if (iVar1 == 0) { local_78 = 0; local_78._4_4_ = (NetplayManager *)0x0; local_78._0_4_ = (NetplayManager *)0x0; local_68 = (NetplayManager *)local_78; local_64 = (uint)local_78._4_4_; } else { local_68 = *(NetplayManager **)(iVar1 + 8); local_64 = *(uint *)(iVar1 + 0xc); } NetworkManager::get_peer(g_multiplayerService,&local_60,(ulonglong *)&local_68); } local_14 = CONCAT31(local_14._1_3_,0xd); local_28 = (NetplayManager *)((uint)local_28 | 0x204); pNStack_34 = local_28; if ((local_60 == 0) && ((cVar3 = (**(code **)(*piVar12 + 0x14))(), cVar3 == '\0' || ((flags & 0x10) == 0)))) goto LAB_0090f35f; local_21 = '\x01'; } local_14._1_3_ = 0; if (((uint)local_28 & 4) != 0) { local_28 = (NetplayManager *)((uint)local_28 & 0xfffffffb); local_14 = 0xe; if (((local_5c != (int *)0x0) && (cVar3 = (**(code **)(*local_5c + 0xc))(), cVar3 != '\0') ) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } } local_14._0_1_ = 1; if (local_21 != '\0') { pvVar8 = (void *)0x0; pNVar13 = (NetplayManager *)0x0; local_44 = messageRefCount; local_40 = CONCAT44(message,(NetplayManager *)local_40); if ((messageRefCount != (void *)0x0) && (cVar3 = (**(code **)(*(int *)messageRefCount + 4))(), cVar3 != '\0')) { if ((pNVar13 != (NetplayManager *)0x0) && ((cVar3 = (**(code **)((int)*pNVar13 + 0xc))(), cVar3 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStackY_138 + 0x84); } pvVar8 = (void *)local_40._4_4_; pNVar13 = local_44; } multiplayer_send_message(piVar12,pvVar8,pNVar13); iVar1 = piVar12[1]; if (iVar1 == 0) { local_78 = 0; local_78._4_4_ = (NetplayManager *)0x0; local_78._0_4_ = (NetplayManager *)0x0; local_54 = (int)local_78._4_4_; local_58 = (undefined **)(NetplayManager *)local_78; } else { local_54 = *(int *)(iVar1 + 0xc); local_58 = *(undefined ***)(iVar1 + 8); } pbVar5 = map_u64_bool_subscript(&local_4c,(ulonglong *)&local_58); *pbVar5 = 1; } piVar12 = piVar12 + 5; } while (piVar12 != (g_manager->_lobbyMembers)._end); } FID_conflict__Erase_tree_>_> (&local_4c,(fuzzer_allocator_> *)&local_4c, *(_Tree_node **)((int)local_4c + 4)); operator_delete(local_4c,0x20); } else { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); FUN_008ef1d0(&message); FUN_00a29a40((byte)(flags >> 4) & 1); } local_14 = 0xf; if (((messageRefCount != (void *)0x0) && (cVar3 = (**(code **)(*(int *)messageRefCount + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } ExceptionList = local_1c; return; } //@@ 0090f4c0 FUN_0090f4c0 void * FUN_0090f4c0(void *param_1) { int iVar1; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar2; undefined1 local_18; undefined1 local_17; char local_11; iVar1 = FUN_0090b070(); uVar2 = extraout_ECX; if ((iVar1 == 0) || (iVar1 = FUN_004253d0(), uVar2 = extraout_ECX_00, iVar1 == 0)) { KAGE::SmartPointer::reset(uVar2); return param_1; } switch(*(undefined4 *)(iVar1 + 0x13c0)) { case 0xb: case 0x23: break; case 0xc: break; case 0x11: break; case 0x14: break; case 0x26: } FUN_00949bc0(&local_11); local_18 = 0; local_17 = 6; if (local_11 != '\0') { local_17 = 7; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } NetConnection::send_message(g_multiplayerService,param_1,1,&local_18,3,0); return param_1; } //@@ 0090f5f0 user_profile_format_display_name /* DB: ? sprintf's UserProfile name (FUN_00a5f1c0 returns "???"/"localhost"/name) into static buf DAT_00c82bd0, truncates with "..." until Font::get_string_width_n fits the max width arg, masks when an option byte (Manager+0x2a3e0) is set; used by OnlineChat::render, lobby lists, Entity_Player::Render prototype: db/protos.zhl, confirmed by RET 16 */ byte * user_profile_format_display_name(ulonglong profileRef,void *font,uint maxWidth) { void *this; uint uVar1; int extraout_EAX; uint uVar2; char *pcVar3; char *pcVar4; undefined **local_18 [2]; void *local_10; undefined1 *puStack_c; undefined **local_8; local_8 = (undefined **)0xffffffff; puStack_c = &LAB_00b09575; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_18 + 5); ExceptionList = &local_10; local_18[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&profileRef); local_8 = (undefined **)0x0; local_18[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_18); } local_8 = (undefined **)0x1; (*(code *)local_18[0][1])(uVar1); sprintf(&DAT_00c82bd0,&DAT_00b62fdc); uVar1 = maxWidth; this = font; local_18[0] = KAGE::System::UserProfileBase::vftable; if (maxWidth != 0xffffffff) { uVar2 = Font::get_string_width_n(font,&DAT_00c82bd0,-1); if (uVar1 < uVar2) { pcVar3 = &DAT_00c82bd0; do { pcVar4 = pcVar3; pcVar3 = pcVar4 + 1; } while (*pcVar4 != '\0'); if (pcVar4 + -0xc82bd0 < (char *)0x4) { strncpy(&DAT_00c82bd0,"...",(size_t)(pcVar4 + -0xc82bd0)); } else { uVar2 = Font::get_string_width_n(this,&DAT_00c82bd0,-1); if (uVar1 < uVar2) { pcVar4 = pcVar4 + -3; do { builtin_strncpy(pcVar4,"...",4); pcVar4 = pcVar4 + -1; uVar2 = Font::get_string_width_n(this,&DAT_00c82bd0,-1); } while (uVar1 < uVar2); } } } } if ((g_manager->_optionsConfig)._streamerMode != 0) { pcVar3 = &DAT_00c82bd0; do { pcVar4 = pcVar3; pcVar3 = pcVar4 + 1; } while (*pcVar4 != '\0'); pcVar3 = (char *)0x3; if ((int)(pcVar4 + -0xc82bd0) < 3) { pcVar3 = pcVar4 + -0xc82bd0; } sprintf_s((byte *)(pcVar3 + 0xc82bd0),0x40 - (int)pcVar3,&DAT_00b1cec0); } ExceptionList = local_10; return &DAT_00c82bd0; } //@@ 0090f760 NetplayManager::process_drop_player_message /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "Recieved Drop Player Message", eDropMessageType::MSG_DROP_EXECUTE, "This function should only be called on consolidated messages"; called from FUN_0090b150 */ void NetplayManager::process_drop_player_message(void) { char cVar1; byte bVar2; uint uVar3; int *piVar4; ulonglong *this; int extraout_EAX; undefined4 uVar5; int extraout_EAX_00; int extraout_EAX_01; int extraout_EAX_02; int extraout_EAX_03; byte *pbVar6; undefined4 *puVar7; int extraout_EAX_04; int extraout_EAX_05; int extraout_EAX_06; int extraout_EAX_07; int extraout_EAX_08; int extraout_EAX_09; int extraout_EAX_10; int extraout_EAX_11; int extraout_EAX_12; int extraout_EAX_13; int extraout_EAX_14; Entity_Player *pEVar8; PlayerManager *in_ECX; byte *pbVar9; byte *******pppppppbVar10; uint uVar11; undefined4 uVar12; byte *******pppppppbVar13; void *pvVar14; int unused1; int iVar15; undefined1 auStack_170 [8]; undefined4 uStack_168; undefined4 uStack_164; undefined4 local_160; undefined4 local_15c; undefined4 uStack_158; undefined4 uStack_154; undefined4 local_150; undefined4 local_14c; undefined4 uStack_148; undefined4 uStack_144; undefined4 local_140; undefined4 local_13c; undefined1 local_138 [4]; int *local_134; undefined **local_130; int local_12c; undefined **local_128; int local_124; undefined **local_120; int local_11c; undefined **appuStack_118 [2]; undefined **ppuStack_110; int iStack_10c; undefined **local_108 [2]; undefined **appuStack_100 [2]; undefined **appuStack_f8 [2]; undefined **local_f0 [2]; undefined **local_e8 [2]; undefined **local_e0 [2]; undefined **appuStack_d8 [2]; undefined **appuStack_d0 [2]; undefined **appuStack_c8 [2]; undefined **local_c0 [2]; undefined **local_b8 [2]; undefined4 *local_b0; int *piStack_ac; undefined4 local_a8; undefined4 local_a4; undefined8 local_a0; undefined8 uStack_98; undefined8 local_90; byte *******pppppppbStack_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 uStack_74; uint uStack_70; byte *******pppppppbStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; uint uStack_58; void *apvStack_54 [4]; undefined4 uStack_44; uint uStack_40; ulonglong uStack_3c; char acStack_34 [12]; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = acStack_34 + 0x30; puStack_18 = &LAB_00b09748; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(acStack_34 + 0x24); ExceptionList = &local_1c; local_24 = uVar3; do { local_14 = 0xffffffff; if (g_multiplayerService == (void *)0x0) { ExceptionList = local_1c; return; } piVar4 = NetworkManager::receive_message(g_multiplayerService,local_138,5,0); iVar15 = *piVar4; local_14 = 0; if (((local_134 != (int *)0x0) && (cVar1 = (**(code **)(*local_134 + 0xc))(uVar3), cVar1 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_138); } local_14 = 0xffffffff; if (iVar15 == 0) { ExceptionList = local_1c; return; } if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_b0,5,1); } local_14 = 1; local_90._4_4_ = local_b0; if (local_b0[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } if (*(int *)(*(int *)local_90._4_4_[2] + 0x18) != 0x20) { KAGE_LogMessage(0x10,(byte *)"Invalid data size recieved for Drop Player Message \n"); } puVar7 = local_b0; if (local_b0[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } local_90 = CONCAT44(*(int *)(*(int *)puVar7[2] + 0x14) + 8,(undefined4)local_90); this = get_drop_entry((NetplayManager *)in_ECX, *(ulonglong *)(*(int *)(*(int *)puVar7[2] + 0x14) + 0x10)); if (this == (ulonglong *)0x0) { KAGE_LogMessage(8,(byte *) "[Frame: %d] Recieved Drop Player Message with invalid drop player ID: %llu \n" ); } else { iVar15 = *local_90._4_4_; if (iVar15 == 0) { local_140 = *local_b0; local_13c = local_b0[1]; local_c0[0] = KAGE::System::UserProfileBase::vftable; local_a8 = local_140; local_a4 = local_13c; UserProfile::find_or_create(&local_140); local_14._0_1_ = 2; local_c0[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_c0); } local_14._0_1_ = 3; uVar5 = (*(code *)local_c0[0][1])(); uStack_98 = CONCAT44(uVar5,(undefined4)uStack_98); local_130 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 4; local_130 = KAGE::System::UserProfile::vftable; local_12c = extraout_EAX_00; if (((extraout_EAX_00 != 0) && (*(int *)(extraout_EAX_00 + 8) != 0 || *(int *)(extraout_EAX_00 + 0xc) != 0)) && (*(int *)(extraout_EAX_00 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_130); } local_14._0_1_ = 5; if (local_12c == 0) { local_a0 = local_a0 & 0xffffffff; local_90 = 0; } else { local_90 = CONCAT44(*(undefined4 *)(local_12c + 8),(undefined4)local_90); local_a0 = CONCAT44(*(undefined4 *)(local_12c + 0xc),(undefined4)local_a0); } local_b8[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 6; local_b8[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_01 != 0) && (*(int *)(extraout_EAX_01 + 8) != 0 || *(int *)(extraout_EAX_01 + 0xc) != 0)) && (*(int *)(extraout_EAX_01 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_b8); } local_14._0_1_ = 7; (*(code *)local_b8[0][1])(); KAGE_LogMessage(1,(byte *) "[Frame: %d] Recieved eDropMessageType::MSG_DROP_ON for player \"%s\" %llu from player \"%s\" %llu \n" ); local_14._0_1_ = 1; local_b8[0] = KAGE::System::UserProfileBase::vftable; local_130 = KAGE::System::UserProfileBase::vftable; local_c0[0] = KAGE::System::UserProfileBase::vftable; uStack_148 = *local_b0; uStack_144 = local_b0[1]; piVar4 = (int *)FUN_00915960(auStack_170,&uStack_148); *(undefined1 *)(*piVar4 + 0x18) = 1; if ((int)(in_ECX->_playerList)._end - (int)(in_ECX->_playerList)._begin >> 2 != 0) { appuStack_c8[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 8; appuStack_c8[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_02 != 0) && (*(int *)(extraout_EAX_02 + 8) != 0 || *(int *)(extraout_EAX_02 + 0xc) != 0)) && (*(int *)(extraout_EAX_02 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_c8); } local_14._0_1_ = 9; cVar1 = (*(code *)appuStack_c8[0][5])(); local_14._0_1_ = 1; appuStack_c8[0] = KAGE::System::UserProfileBase::vftable; if (cVar1 == '\0') { appuStack_d0[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 10; appuStack_d0[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_03 != 0) && (*(int *)(extraout_EAX_03 + 8) != 0 || *(int *)(extraout_EAX_03 + 0xc) != 0)) && (*(int *)(extraout_EAX_03 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_d0); } local_14._0_1_ = 0xb; pbVar6 = (byte *)(*(code *)appuStack_d0[0][1])(); acStack_34[8] = '\0'; acStack_34[9] = '\0'; acStack_34[10] = '\0'; acStack_34[0xb] = '\0'; uStack_28 = 0xf; uStack_3c = uStack_3c & 0xffffffff00000000; uStack_98 = CONCAT44(pbVar6 + 1,(undefined4)uStack_98); pbVar9 = pbVar6; do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar2 != 0); std::string::assign((char *)&uStack_3c,pbVar6,(int)pbVar9 - (int)(pbVar6 + 1)); local_14._0_1_ = 0xc; puVar7 = std::string::append((char *)&uStack_3c,(byte *)" RECEIVED A KICK VOTE",0x15); pppppppbStack_84 = (byte *******)*puVar7; uStack_74 = puVar7[4]; uStack_70 = puVar7[5]; uStack_80 = puVar7[1]; uStack_7c = puVar7[2]; uStack_78 = puVar7[3]; puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; local_14._0_1_ = 0xd; uStack_44 = 0; pppppppbVar13 = (byte *******)&pppppppbStack_84; if (0xf < uStack_70) { pppppppbVar13 = pppppppbStack_84; } uStack_40 = 0xf; apvStack_54[0] = (void *)0x0; uStack_98 = CONCAT44((byte *)((int)pppppppbVar13 + 1),(undefined4)uStack_98); pppppppbVar10 = pppppppbVar13; do { bVar2 = *(byte *)pppppppbVar10; pppppppbVar10 = (byte *******)((int)pppppppbVar10 + 1); } while (bVar2 != 0); uVar11 = (int)pppppppbVar10 - ((int)pppppppbVar13 + 1); std::string::assign((char *)apvStack_54,(byte *)pppppppbVar13,uVar11); local_14._0_1_ = 0xe; FUN_00428b60(apvStack_54,0x6e,pppppppbVar13,uVar11); local_14._0_1_ = 0xd; if (0xf < uStack_40) { uVar11 = uStack_40 + 1; pvVar14 = apvStack_54[0]; if (0xfff < uVar11) { pvVar14 = *(void **)((int)apvStack_54[0] + -4); uVar11 = uStack_40 + 0x24; if (0x1f < (uint)((int)apvStack_54[0] + (-4 - (int)pvVar14))) goto LAB_0091061f; } operator_delete(pvVar14,uVar11); } local_14._0_1_ = 0xc; if (0xf < uStack_70) { uVar11 = uStack_70 + 1; pppppppbVar13 = pppppppbStack_84; if (0xfff < uVar11) { pppppppbVar13 = (byte *******)pppppppbStack_84[-1]; uVar11 = uStack_70 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbStack_84 + (-4 - (int)pppppppbVar13))) goto LAB_0091061f; } operator_delete(pppppppbVar13,uVar11); } local_14._0_1_ = 0xb; if (0xf < uStack_28) { uVar11 = uStack_28 + 1; pvVar14 = (void *)uStack_3c; if (0xfff < uVar11) { pvVar14 = *(void **)((int)(void *)uStack_3c + -4); uVar11 = uStack_28 + 0x24; if (0x1f < (uint)((int)(void *)uStack_3c + (-4 - (int)pvVar14))) goto LAB_0091061f; } operator_delete(pvVar14,uVar11); } acStack_34[8] = '\0'; acStack_34[9] = '\0'; acStack_34[10] = '\0'; acStack_34[0xb] = '\0'; uStack_28 = 0xf; uStack_3c = uStack_3c & 0xffffffffffffff00; appuStack_d0[0] = KAGE::System::UserProfileBase::vftable; } local_14._0_1_ = 1; local_90 = CONCAT44(&g_manager->_netplayManager,(undefined4)local_90); bVar2 = is_user_in_player_list(&g_manager->_netplayManager,*this); if (bVar2 == 0) { uVar11 = local_90._4_4_[1] - *local_90._4_4_ >> 2; } else { uVar11 = (local_90._4_4_[1] - *local_90._4_4_ >> 2) - 1; } if (uVar11 <= *(uint *)((int)this + 0xc)) { ppuStack_110 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0xf; ppuStack_110 = KAGE::System::UserProfile::vftable; iStack_10c = extraout_EAX_04; if (((extraout_EAX_04 != 0) && (*(int *)(extraout_EAX_04 + 8) != 0 || *(int *)(extraout_EAX_04 + 0xc) != 0)) && (*(int *)(extraout_EAX_04 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&ppuStack_110); } local_14._0_1_ = 0x10; if (iStack_10c == 0) { uStack_98 = 0; uStack_98._4_4_ = 0; uStack_98._0_4_ = 0; uVar5 = uStack_98._4_4_; uVar12 = (undefined4)uStack_98; } else { uVar5 = *(undefined4 *)(iStack_10c + 0xc); uVar12 = *(undefined4 *)(iStack_10c + 8); } ban_user(uVar12,uVar5); local_14._0_1_ = 1; ppuStack_110 = KAGE::System::UserProfileBase::vftable; appuStack_d8[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x11; appuStack_d8[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_05 != 0) && (*(int *)(extraout_EAX_05 + 8) != 0 || *(int *)(extraout_EAX_05 + 0xc) != 0)) && (*(int *)(extraout_EAX_05 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_d8); } local_14._0_1_ = 0x12; uVar5 = 0x90fe2f; cVar1 = (*(code *)appuStack_d8[0][5])(); local_14._0_1_ = 1; appuStack_d8[0] = KAGE::System::UserProfileBase::vftable; if (cVar1 == '\0') { appuStack_118[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x14; appuStack_118[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_06 != 0) && (*(int *)(extraout_EAX_06 + 8) != 0 || *(int *)(extraout_EAX_06 + 0xc) != 0)) && (*(int *)(extraout_EAX_06 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_118); } local_14 = CONCAT31(local_14._1_3_,0x15); QueueRemovePlayer(appuStack_118); appuStack_118[0] = KAGE::System::UserProfileBase::vftable; } else { builtin_strncpy(acStack_34," KICKED",8); uStack_28 = 0xf; acStack_34[8] = '\x0f'; acStack_34[9] = '\0'; acStack_34[10] = '\0'; acStack_34[0xb] = '\0'; uStack_3c = 0x4552455720554f59; local_14._0_1_ = 0x13; FUN_00428b60(&uStack_3c,0x6e,uVar12,uVar5); local_14._0_1_ = 1; if (0xf < uStack_28) { uVar11 = uStack_28 + 1; pvVar14 = (void *)uStack_3c; if (0xfff < uVar11) { pvVar14 = *(void **)((int)(void *)uStack_3c + -4); uVar11 = uStack_28 + 0x24; if (0x1f < (uint)((int)(void *)uStack_3c + (-4 - (int)pvVar14))) { LAB_0091061f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar14,uVar11); } uVar5 = *(undefined4 *)((int)this + 4); uVar12 = (undefined4)*this; remove_drop_entry(uVar12,uVar5); FUN_00907830(uVar12,uVar5); } } } } else if (iVar15 == 1) { local_150 = *local_b0; local_14c = local_b0[1]; uStack_98 = CONCAT44(local_14c,(undefined4)uStack_98); local_e8[0] = KAGE::System::UserProfileBase::vftable; local_a8 = local_150; UserProfile::find_or_create(&local_150); local_14._0_1_ = 0x16; local_e8[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_07 != 0) && (*(int *)(extraout_EAX_07 + 8) != 0 || *(int *)(extraout_EAX_07 + 0xc) != 0)) && (*(int *)(extraout_EAX_07 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_e8); } local_14._0_1_ = 0x17; local_a4 = (*(code *)local_e8[0][1])(); local_120 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x18; local_120 = KAGE::System::UserProfile::vftable; local_11c = extraout_EAX_08; if (((extraout_EAX_08 != 0) && (*(int *)(extraout_EAX_08 + 8) != 0 || *(int *)(extraout_EAX_08 + 0xc) != 0)) && (*(int *)(extraout_EAX_08 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_120); } local_14._0_1_ = 0x19; if (local_11c == 0) { local_90 = local_90 & 0xffffffff; local_a0 = 0; } else { local_a0 = CONCAT44(*(undefined4 *)(local_11c + 8),(undefined4)local_a0); local_90 = CONCAT44(*(undefined4 *)(local_11c + 0xc),(undefined4)local_90); } local_e0[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x1a; local_e0[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_09 != 0) && (*(int *)(extraout_EAX_09 + 8) != 0 || *(int *)(extraout_EAX_09 + 0xc) != 0)) && (*(int *)(extraout_EAX_09 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_e0); } local_14 = CONCAT31(local_14._1_3_,0x1b); (*(code *)local_e0[0][1])(); KAGE_LogMessage(1,(byte *) "[Frame: %d] Recieved eDropMessageType::MSG_DROP_OFF for player \"%s\" %llu from player \"%s\" %llu \n" ); local_e0[0] = KAGE::System::UserProfileBase::vftable; local_120 = KAGE::System::UserProfileBase::vftable; local_e8[0] = KAGE::System::UserProfileBase::vftable; uStack_158 = *local_b0; uStack_154 = local_b0[1]; FUN_00914480(&uStack_158); } else if (iVar15 == 4) { local_160 = *local_b0; local_15c = local_b0[1]; uStack_98 = CONCAT44(local_15c,(undefined4)uStack_98); local_108[0] = KAGE::System::UserProfileBase::vftable; local_a8 = local_160; UserProfile::find_or_create(&local_160); local_14._0_1_ = 0x1c; local_108[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_10 != 0) && (*(int *)(extraout_EAX_10 + 8) != 0 || *(int *)(extraout_EAX_10 + 0xc) != 0)) && (*(int *)(extraout_EAX_10 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_108); } local_14._0_1_ = 0x1d; local_a4 = (*(code *)local_108[0][1])(); local_128 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x1e; local_128 = KAGE::System::UserProfile::vftable; local_124 = extraout_EAX_11; if (((extraout_EAX_11 != 0) && (*(int *)(extraout_EAX_11 + 8) != 0 || *(int *)(extraout_EAX_11 + 0xc) != 0)) && (*(int *)(extraout_EAX_11 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_128); } local_14._0_1_ = 0x1f; if (local_124 == 0) { local_90 = local_90 & 0xffffffff; local_a0 = 0; } else { local_a0 = CONCAT44(*(undefined4 *)(local_124 + 8),(undefined4)local_a0); local_90 = CONCAT44(*(undefined4 *)(local_124 + 0xc),(undefined4)local_90); } local_f0[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x20; local_f0[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_12 != 0) && (*(int *)(extraout_EAX_12 + 8) != 0 || *(int *)(extraout_EAX_12 + 0xc) != 0)) && (*(int *)(extraout_EAX_12 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_f0); } local_14._0_1_ = 0x21; (*(code *)local_f0[0][1])(); KAGE_LogMessage(1,(byte *) "[Frame: %d] Recieved eDropMessageType::MSG_DROP_EXECUTE for player \"%s\" %llu from player \"%s\" %llu \n" ); local_14._0_1_ = 1; local_f0[0] = KAGE::System::UserProfileBase::vftable; local_128 = KAGE::System::UserProfileBase::vftable; local_108[0] = KAGE::System::UserProfileBase::vftable; appuStack_100[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x22; appuStack_100[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_13 != 0) && (*(int *)(extraout_EAX_13 + 8) != 0 || *(int *)(extraout_EAX_13 + 0xc) != 0)) && (*(int *)(extraout_EAX_13 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_100); } local_14._0_1_ = 0x23; cVar1 = (*(code *)appuStack_100[0][5])(); local_14._0_1_ = 1; iVar15 = *(int *)((int)this + 4); unused1 = (int)*this; appuStack_100[0] = KAGE::System::UserProfileBase::vftable; if (cVar1 == '\0') { bVar2 = is_user_in_player_list((NetplayManager *)in_ECX,*this); if (bVar2 != 0) { appuStack_f8[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); local_14._0_1_ = 0x24; appuStack_f8[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX_14 != 0) && (*(int *)(extraout_EAX_14 + 8) != 0 || *(int *)(extraout_EAX_14 + 0xc) != 0)) && (*(int *)(extraout_EAX_14 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(appuStack_f8); } local_14._0_1_ = 0x25; pbVar6 = (byte *)(*(code *)appuStack_f8[0][1])(); acStack_34[8] = '\0'; acStack_34[9] = '\0'; acStack_34[10] = '\0'; acStack_34[0xb] = '\0'; uStack_28 = 0xf; uStack_3c = uStack_3c & 0xffffffff00000000; uStack_98 = CONCAT44(pbVar6 + 1,(undefined4)uStack_98); pbVar9 = pbVar6; do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar2 != 0); std::string::assign((char *)&uStack_3c,pbVar6,(int)pbVar9 - (int)(pbVar6 + 1)); local_14._0_1_ = 0x26; puVar7 = std::string::append((char *)&uStack_3c,(byte *)" WAS KICKED",0xb); pppppppbStack_6c = (byte *******)*puVar7; uStack_5c = puVar7[4]; uStack_58 = puVar7[5]; uStack_68 = puVar7[1]; uStack_64 = puVar7[2]; uStack_60 = puVar7[3]; puVar7[4] = 0; puVar7[5] = 0xf; *(undefined1 *)puVar7 = 0; local_14._0_1_ = 0x27; uStack_44 = 0; pppppppbVar13 = (byte *******)&pppppppbStack_6c; if (0xf < uStack_58) { pppppppbVar13 = pppppppbStack_6c; } uStack_40 = 0xf; apvStack_54[0] = (void *)0x0; uStack_98 = CONCAT44((byte *)((int)pppppppbVar13 + 1),(undefined4)uStack_98); pppppppbVar10 = pppppppbVar13; do { bVar2 = *(byte *)pppppppbVar10; pppppppbVar10 = (byte *******)((int)pppppppbVar10 + 1); } while (bVar2 != 0); uVar11 = (int)pppppppbVar10 - ((int)pppppppbVar13 + 1); std::string::assign((char *)apvStack_54,(byte *)pppppppbVar13,uVar11); local_14._0_1_ = 0x28; FUN_00428b60(apvStack_54,0x6e,pppppppbVar13,uVar11); local_14._0_1_ = 0x27; if (0xf < uStack_40) { uVar11 = uStack_40 + 1; pvVar14 = apvStack_54[0]; if (0xfff < uVar11) { pvVar14 = *(void **)((int)apvStack_54[0] + -4); uVar11 = uStack_40 + 0x24; if (0x1f < (uint)((int)apvStack_54[0] + (-4 - (int)pvVar14))) goto LAB_0091061f; } operator_delete(pvVar14,uVar11); } local_14._0_1_ = 0x26; if (0xf < uStack_58) { uVar11 = uStack_58 + 1; pppppppbVar13 = pppppppbStack_6c; if (0xfff < uVar11) { pppppppbVar13 = (byte *******)pppppppbStack_6c[-1]; uVar11 = uStack_58 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbStack_6c + (-4 - (int)pppppppbVar13))) goto LAB_0091061f; } operator_delete(pppppppbVar13,uVar11); } local_14._0_1_ = 0x25; if (0xf < uStack_28) { uVar11 = uStack_28 + 1; pvVar14 = (void *)uStack_3c; if (0xfff < uVar11) { pvVar14 = *(void **)((int)(void *)uStack_3c + -4); uVar11 = uStack_28 + 0x24; if (0x1f < (uint)((int)(void *)uStack_3c + (-4 - (int)pvVar14))) goto LAB_0091061f; } operator_delete(pvVar14,uVar11); } local_14 = CONCAT31(local_14._1_3_,1); uStack_168 = (undefined4)*this; uStack_164 = *(undefined4 *)((int)this + 4); appuStack_f8[0] = KAGE::System::UserProfileBase::vftable; pEVar8 = PlayerManager::get_player_by_user_id(in_ECX,(ulonglong *)&uStack_168); RemoveRemotePlayer(&pEVar8->_size); } } else { bVar2 = is_user_in_player_list((NetplayManager *)in_ECX,*this); if (bVar2 == 0) { if (g_menuManager == (MenuManager *)0x0) { netplay_leave_lobby(in_ECX,unused1,iVar15); reset((NetplayManager *)in_ECX,1); } else { Menu_OnlineLobby::handle_kicked(); } } } } else { KAGE_LogMessage(8,(byte *) "[Frame: %d] Recieved Drop Player Message with invalid message type: %d \n" ); } } local_14 = 0x29; if (((piStack_ac != (int *)0x0) && (cVar1 = (**(code **)(*piStack_ac + 0xc))(), cVar1 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_b0); } } while( true ); } //@@ 00910650 NetplayManager::update_status_messages /* DB: ? NetplayManager::Update: receives type-9 messages and stores the payload dword in the sender player's +0x3c4, and every 1000 ms broadcasts its own type-9 message carrying Manager+0x4b12c (GetTimeNs timestamp at +0x18b8) */ void NetplayManager::update_status_messages(void) { int iVar1; longlong lVar2; longlong lVar3; longlong lVar4; Manager *pMVar5; PlayerManager *this; char cVar6; uint uVar7; int *piVar8; Entity_Player *pEVar9; undefined4 *puVar10; PlayerManager *in_ECX; uint uVar11; undefined4 *puVar12; ulonglong uVar13; undefined1 *message; undefined1 *messageRefCount; undefined4 *local_40; int *local_3c; undefined4 local_38; int *local_34; undefined4 local_30; int *local_2c; undefined4 *local_28; PlayerManager *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b09795; local_1c = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_24 = in_ECX; while( true ) { this = local_24; local_14 = 0xffffffff; if (g_multiplayerService == (void *)0x0) break; piVar8 = NetworkManager::receive_message(g_multiplayerService,&local_30,9,0); iVar1 = *piVar8; local_14 = 0; if (((local_2c != (int *)0x0) && (cVar6 = (**(code **)(*local_2c + 0xc))(uVar7), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_30); } local_14 = 0xffffffff; if (iVar1 == 0) break; if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_40,9,1); } puVar10 = local_40; local_14 = 1; local_38 = *local_40; local_34 = (int *)local_40[1]; pEVar9 = PlayerManager::get_player_by_user_id(this,(ulonglong *)&local_38); if (pEVar9 != (Entity_Player *)0x0) { _local_2c = CONCAT44(puVar10,local_2c); puVar12 = puVar10; if (puVar10[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages") ; puVar10 = local_28; puVar12 = local_40; } if (*(int *)(*(int *)(*(int *)puVar10[2] + 0x14) + 8) == 0) { if (puVar12[3] != 1) { KAGE_LogMessage(0x10,(byte *) "This function should only be called on consolidated messages"); } pEVar9->_target = *(EntityPtr *)(*(int *)(*(int *)puVar12[2] + 0x14) + 0xc); } } local_14 = 2; if (((local_3c != (int *)0x0) && (cVar6 = (**(code **)(*local_3c + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_40); } } local_14 = 0xffffffff; if ((this->_playerList)._begin != (this->_playerList)._end) { uVar13 = GetTimeNs(); lVar2 = (uVar13 & 0xffffffff) * 0x431bde82; local_34 = (int *)((ulonglong)lVar2 >> 0x20); lVar3 = (uVar13 >> 0x20) * 0xd7b634db; lVar4 = (uVar13 >> 0x20) * 0x431bde82; uVar13 = lVar3 + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20); uVar11 = (uint)(uVar13 >> 0x20); _local_2c = CONCAT44((int)lVar4,(int)((ulonglong)lVar3 >> 0x20)); lVar2 = lVar2 + (uVar13 & 0xffffffff); local_30 = (undefined4)lVar2; uVar7 = (uint)((ulonglong)lVar2 >> 0x20); lVar4 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar11,uVar7),uVar11 + uVar7); uVar7 = (uint)((ulonglong)lVar4 >> 0x20); uVar11 = (uint)lVar4 >> 0x12 | uVar7 * 0x4000; if (((uVar7 >> 0x12) - *(int *)&local_24[0x1c].field_0xac != (uint)(uVar11 < *(uint *)&local_24[0x1c].field_0xa8)) || (1000 < uVar11 - *(int *)&local_24[0x1c].field_0xa8)) { local_40 = (undefined4 *)0x0; local_3c = *(int **)&g_manager->field_0x4b12c; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = &DAT_00000009; message = &DAT_00000008; NetConnection::send_message(g_multiplayerService,&local_38,0,&local_40,8,9); pMVar5 = g_manager; local_14 = 3; FUN_008ef1d0(&local_38); send_message(&pMVar5->_netplayManager,1,message,messageRefCount); local_14 = 4; if (((local_34 != (int *)0x0) && (cVar6 = (**(code **)(*local_34 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_38); } uVar13 = GetTimeNs(); lVar2 = (uVar13 & 0xffffffff) * 0x431bde82; lVar3 = (uVar13 >> 0x20) * 0xd7b634db + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20); uVar11 = (uint)((ulonglong)lVar3 >> 0x20); uVar7 = (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (uVar13 >> 0x20) * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar11,uVar7),uVar11 + uVar7); uVar7 = (uint)((ulonglong)lVar2 >> 0x20); *(uint *)&local_24[0x1c].field_0xa8 = (uint)lVar2 >> 0x12 | uVar7 * 0x4000; *(uint *)&local_24[0x1c].field_0xac = uVar7 >> 0x12; } } ExceptionList = local_1c; return; } //@@ 00910980 NetplayManager::try_advance_frame /* DB: ? returns bool; called from the lobby/daily join path 0090b150; iterates the player array (+0/+4) hashing per-player state (00a790b0/00a2a460 KAGE::SmartPointer::SmartPointer g_multiplayerService netplay active), compares queued input frames in three vectors (+0x1878,+0x1884,+0x1890) against the current frame (+0xc), clears +0x18 */ char NetplayManager::try_advance_frame(void) { byte *pbVar1; qword qVar2; Game *pGVar3; undefined1 *puVar4; char cVar5; byte bVar6; byte *pbVar7; int *piVar8; int *in_ECX; uint uVar9; int iVar10; uint uVar11; qword *pqVar12; uint uVar13; int iVar14; uint uVar15; void *pvVar16; uint uVar17; Entity_Player *player; bool bVar18; float fVar19; undefined1 auStack_62 [2]; int local_50; undefined4 local_48; int *piStack_44; undefined4 local_40; int *local_3c; undefined8 local_38; int local_2c; int *local_28; char local_22; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = auStack_62 + 0x5e; local_14 = 0xffffffff; puStack_18 = &LAB_00b097c0; local_1c = ExceptionList; ExceptionList = &local_1c; uVar13 = 0; iVar14 = *in_ECX; local_21 = '\x01'; local_28 = in_ECX; puVar4 = auStack_62 + 0x5e; if (in_ECX[1] - iVar14 >> 2 != 0) { do { if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::SmartPointer(auStack_62 + -10); } else { iVar14 = *(int *)(*(int *)(iVar14 + uVar13 * 4) + 0x374); if (iVar14 == 0) { piStack_44 = (int *)0x0; local_48 = 0; } else { local_48 = *(undefined4 *)(iVar14 + 8); piStack_44 = *(int **)(iVar14 + 0xc); } local_40 = local_48; local_3c = piStack_44; NetworkManager::get_peer(g_multiplayerService,auStack_62 + -10,(ulonglong *)&local_40); } cVar5 = NetInputDevice::is_input_ready(); if ((cVar5 == '\0') || (bVar18 = local_21 == '\0', local_21 = '\x01', bVar18)) { local_21 = '\0'; } uVar13 = uVar13 + 1; iVar14 = *in_ECX; puVar4 = puStack_20; } while (uVar13 < (uint)(in_ECX[1] - iVar14 >> 2)); } puStack_20 = puVar4; iVar14 = (in_ECX[0x61c] - in_ECX[0x61b]) / 0x18; if (iVar14 == 0) { } else { piVar8 = (int *)(in_ECX[0x61b] + 8); do { cVar5 = '\0'; if (*piVar8 != in_ECX[3]) { cVar5 = local_21; } iVar14 = iVar14 + -1; piVar8 = piVar8 + 6; local_21 = cVar5; } while (iVar14 != 0); in_ECX = local_28; } iVar14 = in_ECX[0x61f] - in_ECX[0x61e] >> 5; if (iVar14 != 0) { piVar8 = (int *)(in_ECX[0x61e] + 0x10); do { cVar5 = '\0'; if (*piVar8 != in_ECX[3]) { cVar5 = local_21; } iVar14 = iVar14 + -1; piVar8 = piVar8 + 8; local_21 = cVar5; } while (iVar14 != 0); in_ECX = local_28; } iVar14 = in_ECX[0x622] - in_ECX[0x621] >> 4; if (iVar14 != 0) { piVar8 = (int *)(in_ECX[0x621] + 0xc); do { cVar5 = '\0'; if (*piVar8 != in_ECX[3]) { cVar5 = local_21; } iVar14 = iVar14 + -1; piVar8 = piVar8 + 4; local_21 = cVar5; } while (iVar14 != 0); in_ECX = local_28; } if ((in_ECX[0x472] != 0) && ((uint)in_ECX[0x475] <= (uint)in_ECX[3])) { ExceptionList = local_1c; return '\0'; } if (local_21 == '\0') { ExceptionList = local_1c; return '\0'; } *(undefined1 *)(in_ECX + 6) = 0; uVar13 = 0; iVar14 = *in_ECX; if (in_ECX[1] - iVar14 >> 2 == 0) { LAB_00910f99: uVar13 = in_ECX[0xe]; if ((uint)(in_ECX[4] * 2) < uVar13) { do { piVar8 = (int *)**(undefined4 **)(in_ECX[0xb] + (in_ECX[0xc] - 1U & in_ECX[0xd]) * 4); local_28 = piVar8; _Find_lower_bound<>(); if (((*(char *)(local_50 + 0xd) == '\0') && (*(int **)(local_50 + 0x10) <= piVar8)) && (local_50 != in_ECX[0xf])) { piVar8 = (int *)std::map::try_emplace(); if (*(int *)(*piVar8 + 0x14) != 0) { piVar8 = (int *)std::map::try_emplace(); iVar14 = *(int *)(*piVar8 + 0x14); if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } if (iVar14 != 0) { uVar13 = *(uint *)(iVar14 + -4); qVar2 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar13; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar2 < uVar13); free((void *)(iVar14 + -4)); } local_14 = 0xffffffff; piVar8 = (int *)std::map::try_emplace(); *(undefined4 *)(*piVar8 + 0x14) = 0; } std::map::erase(); uVar13 = in_ECX[0xe]; } uVar13 = uVar13 - 1; in_ECX[0xe] = uVar13; if (uVar13 == 0) { in_ECX[0xd] = 0; } else { in_ECX[0xd] = in_ECX[0xd] + 1; } } while ((uint)(in_ECX[4] * 2) < uVar13); } save_frame_snapshot(); pGVar3 = g_game; if (((in_ECX[0x62c] != 0 || in_ECX[0x62d] != 0) && (in_ECX[0x62d] == 0)) && ((uint)in_ECX[0x62c] <= (uint)in_ECX[3])) { in_ECX[0x62c] = 0; in_ECX[0x62d] = 0; Game::End(pGVar3,1); } in_ECX[3] = in_ECX[3] + 1; ExceptionList = local_1c; return local_21; } LAB_00910b70: local_3c = *(int **)(iVar14 + uVar13 * 4); if ((local_3c[2] & 1) == 0) { ((Vector *)(local_3c + 0xe2))->x = 0.0; local_3c[0xe3] = 0; local_3c[0xe0] = 0; local_3c[0xe1] = 0; ((Vector *)(local_3c + 0xe4))->x = 0.0; local_3c[0xe5] = 0; local_3c[0xe6] = 0; ((ColorMod *)(local_3c + 0xe7))->_tint[0] = 0.0; } else { local_2c = FUN_00901190(); uVar15 = 0; local_38._4_4_ = (void *)0x0; local_38 = 0; uVar17 = (uint)local_38._4_4_; do { iVar14 = FUN_00900f50(); if ((iVar14 != 0xff) && (((uint)*(ushort *)(local_2c + 4) & 1 << ((byte)iVar14 & 0x1f)) != 0)) { uVar9 = 1 << (uVar15 & 0x1f); uVar11 = 0; if (0x1f < uVar15) { uVar11 = uVar9; } uVar9 = uVar9 ^ uVar11; if (0x3f < uVar15) { uVar11 = uVar9; } local_38 = CONCAT44((uint)local_38._4_4_ | uVar9,(undefined4)local_38); uVar17 = uVar17 | uVar11; } uVar15 = uVar15 + 1; } while (uVar15 < 0x20); pvVar16 = (void *)local_3c[0xe0]; uVar15 = local_3c[0xe1]; local_3c[0xe0] = (int)local_38._4_4_; ((Vector *)(local_3c + 0xe2))->x = (float)(~(uint)pvVar16 & (uint)local_38._4_4_); local_3c[0xe3] = ~uVar15 & uVar17; local_3c[0xe1] = uVar17; ((Vector *)(local_3c + 0xe4))->x = (float)*(ushort *)(local_2c + 6) / 32767.0 - 1.0; local_3c[0xe5] = (int)((float)*(ushort *)(local_2c + 8) / 32767.0 - 1.0); bVar18 = (*(byte *)(local_2c + 0xf) & 2) == 0; if (bVar18) { local_3c[0xe6] = (int)((float)*(ushort *)(local_2c + 10) / 32767.0 - 1.0); fVar19 = (float)*(ushort *)(local_2c + 0xc) / 32767.0 - 1.0; } else { local_3c[0xe6] = (int)(float)(int)*(short *)(local_2c + 10); fVar19 = (float)(int)*(short *)(local_2c + 0xc); } ((ColorMod *)(local_3c + 0xe7))->_tint[0] = fVar19; *(bool *)(local_3c + 0xf5) = !bVar18; pGVar3 = g_game; uVar17 = 0; iVar14 = local_3c[3]; local_3c[0xf4] = (int)*(char *)(local_2c + 0xf) & 1; piVar8 = (pGVar3->_playerManager)._playerList._begin; uVar15 = (int)(pGVar3->_playerManager)._playerList._end - (int)piVar8 >> 2; if (uVar15 != 0) { do { iVar10 = piVar8[uVar17]; local_38 = CONCAT44(iVar10,(undefined4)local_38); if (*(int *)(iVar10 + 0x1618) == iVar14) { if (iVar10 != 0) { uVar17 = 0; if (*(char *)(local_2c + 0xe) == '\x15') goto LAB_00910d40; goto LAB_00910d90; } break; } uVar17 = uVar17 + 1; } while (uVar17 < uVar15); } } goto LAB_00910f7e; while( true ) { uVar17 = uVar17 + 1; piVar8 = piVar8 + 1; if (uVar15 <= uVar17) break; LAB_00910d90: iVar10 = *piVar8; if (*(int *)(iVar10 + 0x1618) == iVar14) goto LAB_00910daa; } iVar10 = 0; LAB_00910daa: if ((*(char *)(iVar10 + 0x26d8) != '\0') && (*(int *)(iVar10 + 0x26dc) == 0x15)) { *(undefined1 *)(iVar10 + 0x26d8) = 0; *(undefined4 *)(iVar10 + 0x26dc) = 0x3c; *(undefined4 *)(iVar10 + 0x26e0) = 0; *(undefined4 *)(iVar10 + 0x26e4) = 0; } local_22 = *(char *)(local_2c + 0xe); if (local_22 == '<') goto LAB_00910f7e; uVar17 = 0; piVar8 = (g_game->_playerManager)._playerList._begin; uVar15 = (int)(g_game->_playerManager)._playerList._end - (int)piVar8 >> 2; if (uVar15 != 0) { do { player = (Entity_Player *)*piVar8; if (player->_controllerIndex == local_3c[3]) goto LAB_00910e26; uVar17 = uVar17 + 1; piVar8 = piVar8 + 1; } while (uVar17 < uVar15); } player = (Entity_Player *)0x0; LAB_00910e26: pvVar16 = (void *)(int)local_22; if (pvVar16 != (void *)0x15) { Player_stats_add(&g_game->_onlinePlayerStats,8,player,1.0); } *(undefined1 *)&player[1]._damageEvents._end = 1; *(undefined4 *)&player[1]._pendingDamageFlags = 0x78; if (player[1]._damageEvents._capacity == pvVar16) goto LAB_00910f7e; player[1]._damageEvents._capacity = pvVar16; player[1]._pendingDamage = 0.0; if (pvVar16 == (void *)0x15) goto LAB_00910f7e; local_3c = (int *)((int)(&player[1]._splatColor + 2) + ((int)pvVar16 * 6 + 3) * 4); if (0xf < (uint)((Vector *)(local_3c + 5))->x) { local_3c = (int *)*local_3c; } pbVar1 = *(byte **)&player[1]._flags; if (pbVar1 == (byte *)0x0) { LAB_00910ee9: bVar6 = ANM2::SetAnimation((ANM2 *)(player[1]._sprite._championColor._colorize + 2), (byte *)local_3c,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)&player[1]._shadowOffset.y); *(undefined1 *)&player[1]._collisionPoints._begin = 1; } } else { pbVar7 = pbVar1; piVar8 = local_3c; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar7 = *(byte **)pbVar1; } do { bVar6 = *pbVar7; bVar18 = bVar6 < (byte)*piVar8; if (bVar6 != (byte)*piVar8) { LAB_00910ed0: uVar17 = -(uint)bVar18 | 1; goto LAB_00910ed5; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar18 = bVar6 < *(byte *)((int)piVar8 + 1); if (bVar6 != *(byte *)((int)piVar8 + 1)) goto LAB_00910ed0; pbVar7 = pbVar7 + 2; piVar8 = (int *)((int)piVar8 + 2); } while (bVar6 != 0); uVar17 = 0; LAB_00910ed5: if ((uVar17 != 0) || ((pbVar1[0x34] != 0 && (*(char *)&player[1]._collisionPoints._begin == '\0')))) goto LAB_00910ee9; } if (*(char *)((int)&player[1]._shrinkCountdown + 1) != '\0') { AnimationState::Update((AnimationState *)&player[1]._shadowOffset.y); AnimationState::Update((AnimationState *)&player[1]._entityGridCollisionClass); } LAB_00910f7e: uVar13 = uVar13 + 1; iVar14 = *local_28; in_ECX = local_28; if ((uint)(local_28[1] - iVar14 >> 2) <= uVar13) goto LAB_00910f99; goto LAB_00910b70; while( true ) { uVar17 = uVar17 + 1; piVar8 = piVar8 + 1; if (uVar15 <= uVar17) break; LAB_00910d40: iVar10 = *piVar8; if (*(int *)(iVar10 + 0x1618) == iVar14) goto LAB_00910d54; } iVar10 = 0; LAB_00910d54: *(undefined1 *)(iVar10 + 0x26d8) = 1; *(undefined4 *)(iVar10 + 0x26e4) = 0; if (*(int *)(iVar10 + 0x26dc) != 0x15) { *(undefined4 *)(iVar10 + 0x26dc) = 0x15; *(undefined4 *)(iVar10 + 0x26e0) = 0; } goto LAB_00910f7e; } //@@ 00911120 NetplayManager::update_player_removal /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? handles eRemoveMessageType::MSG_REMOVE_FRAME, IsPlayerRemoveConfirmed, "YOU WERE KICKED"; this holds vectors of pending removals; called from lobby update 0x90b150 */ void NetplayManager::update_player_removal(void) { undefined4 uVar1; int iVar2; ulonglong uVar3; byte bVar4; char cVar5; int *piVar6; uint uVar7; int extraout_EAX; void *extraout_EAX_00; Entity_Player *pEVar8; PlayerManager *in_ECX; void *pvVar9; int iVar10; CoopJoinSlot *pCVar11; CoopJoinSlot *pCVar12; int *piVar13; int *piVar14; undefined4 *puVar15; int iVar16; uint uVar17; void *ptr; int *piVar18; undefined1 auStack_ba [2]; undefined8 local_a0; CoopJoinSlot local_98; int *local_84; undefined8 local_80; PlayerManager *local_74; undefined8 local_70; undefined8 uStack_68; undefined8 *local_60; int *local_5c; undefined **local_58; void *local_54; undefined8 local_50; char local_41; int *local_40; longlong local_3c; char local_34 [4]; void *local_30; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00b09828; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_34 + 0x24); ExceptionList = &local_1c; local_74 = in_ECX; puStack_20 = local_34 + 0x30; if ((int)(in_ECX->_playerList)._end - (int)(in_ECX->_playerList)._begin >> 2 != 0) { iVar16 = in_ECX[0x1c]._coopSlots[3]._controllerIndex; piVar6 = (int *)(in_ECX[0x1c]._coopSlots[3]._playerType - iVar16 >> 4); local_5c = (int *)((int)piVar6 - 1); puStack_20 = local_34 + 0x30; if (local_5c < piVar6) { local_40 = (int *)((int)local_5c * 0x10); puStack_20 = local_34 + 0x30; do { puVar15 = (undefined4 *)((int)local_40 + iVar16); uStack_68 = CONCAT44(&g_manager->_netplayManager,(int)uStack_68); bVar4 = is_user_in_player_list (&g_manager->_netplayManager, CONCAT44(*(undefined4 *)((int)local_40 + iVar16 + 4),*puVar15)); if (bVar4 == 0) { uVar7 = uStack_68._4_4_[1] - *uStack_68._4_4_ >> 2; } else { uVar7 = (uStack_68._4_4_[1] - *uStack_68._4_4_ >> 2) - 1; } if ((uVar7 <= (uint)puVar15[3]) && (cVar5 = is_player_removal_queued(), cVar5 == '\0')) { local_50 = CONCAT44(local_50._4_4_,KAGE::System::UserProfileBase::vftable); UserProfile::find_or_create(puVar15); local_14 = 0; local_50._0_4_ = KAGE::System::UserProfile::vftable; local_50._4_4_ = (int *)extraout_EAX; if ((extraout_EAX != 0) && ((*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0 && (*(int *)(extraout_EAX + 0x14) == 0)))) { KAGE::System::UserProfile::load_steam_avatar(&local_50); } local_14 = 1; cVar5 = (*(code *)((undefined **)local_50)[5])(); local_14 = 0xffffffff; local_50 = CONCAT44(local_50._4_4_,KAGE::System::UserProfileBase::vftable); if (cVar5 == '\0') { ban_user(); local_58 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(puVar15); local_14 = 3; local_58 = KAGE::System::UserProfile::vftable; local_54 = extraout_EAX_00; if (((extraout_EAX_00 != (void *)0x0) && (*(int *)((int)extraout_EAX_00 + 8) != 0 || *(int *)((int)extraout_EAX_00 + 0xc) != 0)) && (*(int *)((int)extraout_EAX_00 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_58); } local_14 = 4; QueueRemovePlayer(); local_14 = 0xffffffff; local_58 = KAGE::System::UserProfileBase::vftable; } else { remove_drop_entry(); if (1 < (uint)((int)(in_ECX->_playerList)._end - (int)(in_ECX->_playerList)._begin >> 2) ) { builtin_strncpy(local_34," KIC",4); local_28 = 0xf; local_2c = 0xf; local_3c = 0x4552455720554f59; local_30 = (void *)0x44454b; local_14 = 2; FUN_00428b60(&local_3c,0x6e); local_14 = 0xffffffff; if (0xf < local_28) { uVar7 = local_28 + 1; pvVar9 = (void *)local_3c; if (0xfff < uVar7) { pvVar9 = *(void **)((int)(void *)local_3c + -4); uVar7 = local_28 + 0x24; if (0x1f < (uint)((int)(void *)local_3c + (-4 - (int)pvVar9))) goto LAB_00911409; } operator_delete(pvVar9,uVar7); } remove_drop_entry(); FUN_00907830(); } } } iVar16 = in_ECX[0x1c]._coopSlots[3]._controllerIndex; local_5c = (int *)((int)local_5c - 1); local_40 = local_40 + -4; } while (local_5c < (int *)(in_ECX[0x1c]._coopSlots[3]._playerType - iVar16 >> 4)); } } local_40 = (int *)&in_ECX[0x1c].field_0x5c; local_54 = (void *)0x0; iVar10 = *(int *)&in_ECX[0x1c].field_0x60 - *local_40; iVar16 = iVar10 >> 0x1f; if (iVar10 / 0x18 + iVar16 != iVar16) { iVar16 = 0; do { if (*(int *)(iVar16 + *(int *)&in_ECX[0x1c].field_0x5c) == 0) { if (*(int *)(*(int *)(iVar16 + 4 + *(int *)&in_ECX[0x1c].field_0x5c) + 0x374) == 0) { local_50 = 0; } send_remove_frame(); iVar10 = *(int *)&in_ECX[0x1c].field_0x5c + iVar16; local_50 = CONCAT44(iVar10,(undefined **)local_50); local_5c = (int *)(iVar10 + 0xc); iVar10 = FUN_0090b070(); iVar10 = *(int *)(iVar10 + 0x374); if (iVar10 == 0) { local_70 = 0; uVar3 = local_70; local_70._4_4_ = (int *)0x0; local_70._0_1_ = 0; local_70._1_3_ = 0; local_84 = local_70._4_4_; local_98._16_4_ = (undefined4)local_70; local_70 = uVar3; } else { local_84 = *(int **)(iVar10 + 0xc); local_98._16_4_ = *(undefined4 *)(iVar10 + 8); } uStack_68 = CONCAT44(local_84,(int)uStack_68); puVar15 = *(undefined4 **)((int)local_50._4_4_ + 0x10); if (puVar15 == *(undefined4 **)((int)local_50._4_4_ + 0x14)) { std::vector<8byte>::_Emplace_reallocate(); } else { *puVar15 = local_98._16_4_; puVar15[1] = local_84; local_5c[1] = local_5c[1] + 8; } pCVar11 = (CoopJoinSlot *)(*(int *)&in_ECX[0x1c].field_0x5c + 8 + iVar16); if ((uint)pCVar11->_controllerIndex < (uint)in_ECX->_coopSlots[0]._controllerIndex) { pCVar11 = in_ECX->_coopSlots; } *(int *)(*(int *)&in_ECX[0x1c].field_0x5c + 8 + iVar16) = pCVar11->_controllerIndex; *(undefined4 *)(*(int *)&in_ECX[0x1c].field_0x5c + iVar16) = 1; } iVar16 = iVar16 + 0x18; local_54 = (void *)((int)local_54 + 1); } while (local_54 < (void *)((local_40[1] - *local_40) / 0x18)); } do { if (g_multiplayerService == (void *)0x0) { cVar5 = '\0'; } else { piVar6 = NetworkManager::receive_message (g_multiplayerService,&local_98._isPlayerTypeForced,6,0); local_41 = *piVar6 != 0; local_14 = 5; if (((local_84 != (int *)0x0) && (cVar5 = (**(code **)(*local_84 + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; cVar5 = local_41; } if (cVar5 == '\0') { local_54 = *(void **)&in_ECX[0x1c].field_0x60; iVar16 = *(int *)&in_ECX[0x1c].field_0x5c; uStack_68 = uStack_68 & 0xffffffff; iVar10 = (int)local_54 - iVar16 >> 0x1f; if (((int)local_54 - iVar16) / 0x18 + iVar10 == iVar10) goto LAB_00911aa4; iVar10 = 0; local_70 = local_70 & 0xffffffff; break; } if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(); } else { NetworkManager::receive_message(g_multiplayerService,&local_60,6,1); } local_a0 = 0; local_98._controllerIndex = 0; local_98._playerType = 0; local_98._state = 0; local_98._menuPosition = 0.0; local_14 = 7; piVar6 = (int *)0x0; local_50 = CONCAT44(local_5c,(undefined **)local_50); uStack_68 = CONCAT44(local_60,(int)uStack_68); if ((((local_5c != (int *)0x0) && (cVar5 = (**(code **)(*local_5c + 4))(), cVar5 != '\0')) && (piVar6 != (int *)0x0)) && ((cVar5 = (**(code **)(*piVar6 + 0xc))(), cVar5 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStack_ba + -10); } RemovePlayerMessage::read(); local_54 = (void *)local_98._playerType; pEVar8 = PlayerManager::get_player_by_user_id(in_ECX,&local_a0); local_70 = CONCAT44(pEVar8,(undefined4)local_70); KAGE_LogMessage(1,(byte *) "[FRAME: %d] Recieved eRemoveMessageType::MSG_REMOVE_FRAME from User(%llu), for User(%llu) \n" ); uVar17 = 0; uVar7 = (*(int *)&in_ECX[0x1c].field_0x60 - *(int *)&in_ECX[0x1c].field_0x5c) / 0x18; local_50 = CONCAT44(uVar7,(undefined **)local_50); if (uVar7 != 0) { piVar6 = (int *)(*(int *)&in_ECX[0x1c].field_0x5c + 4); do { iVar16 = *(int *)(*piVar6 + 0x374); if (iVar16 == 0) { uStack_68 = 0; uStack_68._4_4_ = (int *)0x0; uStack_68._0_4_ = 0; iVar10 = (int)uStack_68._4_4_; iVar16 = (int)uStack_68; } else { iVar10 = *(int *)(iVar16 + 0xc); iVar16 = *(int *)(iVar16 + 8); } if ((iVar16 == (int)local_a0) && (iVar10 == local_a0._4_4_)) { iVar16 = uVar17 * 0x18; pCVar12 = (CoopJoinSlot *)(*(int *)&in_ECX[0x1c].field_0x5c + 8 + iVar16); pCVar11 = &local_98; if ((uint)local_98._controllerIndex <= (uint)pCVar12->_controllerIndex) { pCVar11 = pCVar12; } *(int *)(iVar16 + 8 + *(int *)&in_ECX[0x1c].field_0x5c) = pCVar11->_controllerIndex; iVar16 = *(int *)&in_ECX[0x1c].field_0x5c + iVar16; uVar1 = *(undefined4 *)((int)local_60 + 4); local_50 = CONCAT44(uVar1,(undefined **)local_50); puVar15 = *(undefined4 **)(iVar16 + 0x10); if (puVar15 == *(undefined4 **)(iVar16 + 0x14)) { std::vector<8byte>::_Emplace_reallocate(); } else { *puVar15 = *(undefined4 *)local_60; puVar15[1] = uVar1; *(int *)(iVar16 + 0x10) = *(int *)(iVar16 + 0x10) + 8; } if (local_70._4_4_ == (int *)0x0) goto LAB_0091189c; goto LAB_00911863; } uVar17 = uVar17 + 1; piVar6 = piVar6 + 6; } while (uVar17 < uVar7); } if (local_70._4_4_ != (int *)0x0) { local_3c = ZEXT48(local_70._4_4_) << 0x20; local_34[0] = '\0'; local_34[1] = '\0'; local_34[2] = '\0'; local_34[3] = '\0'; local_30 = (void *)0x0; local_2c = 0; uStack_68 = uStack_68 & 0xffffffff; local_28 = 0; local_14 = CONCAT31(local_14._1_3_,8); puVar15 = *(undefined4 **)&in_ECX[0x1c].field_0x60; if (puVar15 == *(undefined4 **)&in_ECX[0x1c].field_0x64) { FUN_00914ba0(); uStack_68 = CONCAT44(local_28,(int)uStack_68); } else { *puVar15 = 0; puVar15[1] = local_70._4_4_; puVar15[2] = 0; puVar15[3] = 0; puVar15[4] = 0; puVar15[5] = 0; *(int *)&in_ECX[0x1c].field_0x60 = *(int *)&in_ECX[0x1c].field_0x60 + 0x18; } pvVar9 = local_30; pCVar11 = &local_98; if ((uint)local_98._controllerIndex < (uint)in_ECX->_coopSlots[0]._controllerIndex) { pCVar11 = in_ECX->_coopSlots; } *(int *)(*(int *)&in_ECX[0x1c].field_0x60 + -0x10) = pCVar11->_controllerIndex; iVar16 = *(int *)&in_ECX[0x1c].field_0x60; uVar1 = *(undefined4 *)((int)local_60 + 4); local_80 = *local_60; local_50 = CONCAT44(uVar1,(undefined **)local_50); puVar15 = *(undefined4 **)(iVar16 + -8); if (puVar15 == *(undefined4 **)(iVar16 + -4)) { std::vector<8byte>::_Emplace_reallocate(); } else { *puVar15 = *(undefined4 *)local_60; puVar15[1] = uVar1; *(int *)(iVar16 + -8) = *(int *)(iVar16 + -8) + 8; } local_14 = CONCAT31(local_14._1_3_,7); if (pvVar9 != (void *)0x0) { uVar7 = ((int)uStack_68._4_4_ - (int)pvVar9 >> 3) * 8; ptr = pvVar9; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar9 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar9 + (-4 - (int)ptr))) { LAB_00911409: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } LAB_00911863: uVar7 = 0; iVar16 = local_98._state - (int)local_54 >> 4; local_50 = CONCAT44(iVar16,(undefined **)local_50); if (iVar16 != 0) { uStack_68 = CONCAT44((int)local_70._4_4_ + 0x3a0,(int)uStack_68); do { FUN_00901070(); uVar7 = uVar7 + 1; in_ECX = local_74; } while (uVar7 < local_50._4_4_); } } LAB_0091189c: local_14 = CONCAT31(local_14._1_3_,6); if (local_54 != (void *)0x0) { uVar7 = (int)local_98._menuPosition - (int)local_54 & 0xfffffff0; pvVar9 = local_54; if (0xfff < uVar7) { pvVar9 = *(void **)((int)local_54 - 4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar9))) goto LAB_00911409; } operator_delete(pvVar9,uVar7); } local_14 = 9; if (((local_5c != (int *)0x0) && (cVar5 = (**(code **)(*local_5c + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_14 = 0xffffffff; } while( true ); LAB_00911940: iVar10 = *(int *)(*(int *)(iVar16 + 4 + iVar10) + 0x374); if (iVar10 == 0) { local_80 = 0; local_40 = (int *)0x0; local_5c = (int *)0x0; } else { local_5c = *(int **)(iVar10 + 8); local_40 = *(int **)(iVar10 + 0xc); } iVar10 = (int)local_54 - iVar16; local_54 = (void *)0x0; iVar10 = iVar10 / 0x18; local_50 = CONCAT44(iVar10,(undefined **)local_50); if (iVar10 == 0) { LAB_00911c37: KAGE_LogMessage(8,(byte *) "[Frame %d] IsPlayerRemoveConfirmed() given User ID (%llu) that is not pending removal! \n" ); LAB_00911a68: } else { do { iVar2 = *(int *)(*(int *)(iVar16 + 4) + 0x374); if (iVar2 == 0) { local_80 = 0; local_80._4_4_ = (int *)0x0; local_80._0_4_ = (int *)0x0; piVar6 = local_80._4_4_; piVar13 = (int *)local_80; } else { piVar6 = *(int **)(iVar2 + 0xc); piVar13 = *(int **)(iVar2 + 8); } if ((piVar13 == local_5c) && (piVar6 == local_40)) { local_54 = (void *)iVar16; } iVar16 = iVar16 + 0x18; iVar10 = iVar10 + -1; } while (iVar10 != 0); in_ECX = local_74; if (local_54 == (void *)0x0) goto LAB_00911c37; local_40 = (local_74->_playerList)._begin; iVar16 = (int)(local_74->_playerList)._end - (int)local_40 >> 2; local_50 = CONCAT44(iVar16,(undefined **)local_50); local_5c = (int *)0x0; piVar6 = (int *)0x0; if (iVar16 != 0) { do { iVar16 = *(int *)(*local_40 + 0x374); if (iVar16 == 0) { local_80 = 0; local_80._4_4_ = (int *)0x0; local_80._0_4_ = (int *)0x0; iVar10 = (int)(int *)local_80; iVar16 = (int)local_80._4_4_; } else { iVar10 = *(int *)(iVar16 + 8); iVar16 = *(int *)(iVar16 + 0xc); } cVar5 = is_player_removal_queued(); if (cVar5 == '\0') { uVar7 = 0; piVar6 = *(int **)((int)local_54 + 0xc); uVar17 = *(int *)((int)local_54 + 0x10) - (int)piVar6 >> 3; if (uVar17 == 0) { LAB_00911a65: in_ECX = local_74; goto LAB_00911a68; } while ((*piVar6 != iVar10 || (piVar6[1] != iVar16))) { uVar7 = uVar7 + 1; piVar6 = piVar6 + 2; if (uVar17 <= uVar7) goto LAB_00911a65; } } local_5c = (int *)((int)local_5c + 1); local_40 = local_40 + 1; } while (local_5c < local_50._4_4_); piVar6 = local_5c; } local_5c = piVar6; in_ECX = local_74; if (*(uint *)(*(int *)&local_74[0x1c].field_0x5c + 8 + (int)local_70._4_4_) <= (uint)local_74->_coopSlots[0]._controllerIndex) { *(undefined4 *)(*(int *)&local_74[0x1c].field_0x5c + (int)local_70._4_4_) = 2; } } local_54 = *(void **)&in_ECX[0x1c].field_0x60; iVar10 = (int)local_70._4_4_ + 0x18; iVar16 = *(int *)&in_ECX[0x1c].field_0x5c; uVar7 = (int)uStack_68._4_4_ + 1; uStack_68 = CONCAT44(uVar7,(int)uStack_68); local_70 = CONCAT44(iVar10,(undefined4)local_70); if ((uint)(((int)local_54 - iVar16) / 0x18) <= uVar7) { LAB_00911aa4: uVar17 = ((int)local_54 - iVar16) / 0x18; uVar7 = uVar17 - 1; uStack_68 = CONCAT44(uVar7,(int)uStack_68); if (uVar7 < uVar17) { local_54 = (void *)(uVar7 * 0x18); do { if (*(int *)(iVar16 + (int)local_54) == 2) { RemoveRemotePlayer(); local_40 = (int *)(*(int *)&in_ECX[0x1c].field_0x5c + (int)local_54); piVar13 = *(int **)&in_ECX[0x1c].field_0x60; piVar6 = local_40 + 6; local_50 = CONCAT44(piVar6,(undefined **)local_50); local_5c = piVar13; if (piVar6 != piVar13) { piVar14 = local_40 + 5; piVar18 = local_40 + 0xb; local_70 = CONCAT44(piVar14,(undefined4)local_70); do { *local_40 = *piVar6; piVar14[-4] = piVar18[-4]; piVar14[-3] = piVar18[-3]; if (piVar14 != piVar18) { std::vector::_Tidy(); piVar14[-2] = piVar18[-2]; local_70._4_4_[-1] = piVar18[-1]; *local_70._4_4_ = *piVar18; piVar18[-2] = 0; piVar18[-1] = 0; *piVar18 = 0; piVar14 = local_70._4_4_; piVar13 = local_5c; } local_40 = local_40 + 6; piVar6 = (int *)((int)local_50._4_4_ + 0x18); piVar14 = piVar14 + 6; local_50 = CONCAT44(piVar6,(undefined **)local_50); piVar18 = piVar18 + 6; local_70 = CONCAT44(piVar14,(undefined4)local_70); } while (piVar6 != piVar13); in_ECX = local_74; } std::vector::_Tidy(); *(int *)&in_ECX[0x1c].field_0x60 = *(int *)&in_ECX[0x1c].field_0x60 + -0x18; uVar7 = (uint)uStack_68._4_4_; } local_54 = (void *)((int)local_54 + -0x18); iVar16 = *(int *)&in_ECX[0x1c].field_0x5c; uVar7 = uVar7 - 1; uStack_68 = CONCAT44(uVar7,(int)uStack_68); } while (uVar7 < (uint)((*(int *)&in_ECX[0x1c].field_0x60 - iVar16) / 0x18)); } ExceptionList = local_1c; return; } goto LAB_00911940; } //@@ 00911c60 FUN_00911c60 void FUN_00911c60(void) { FUN_004b3950(); return; } //@@ 00911c70 NetplayManager::update_revives /* DB: walks the revive queue +0x1878 (0x20 entries), sends Message_RevivePlayer, logs "Recieved Message_RevivePlayer ..." / "Revival Frame for User(%llu) has passed without being revived!"; NetplayManager::Update */ void NetplayManager::update_revives(void) { undefined4 *puVar1; PlayerManager *pPVar2; Game *pGVar3; Manager *pMVar4; char cVar5; uint uVar6; PlayerManager **ppPVar7; int iVar8; int *piVar9; Entity_Player *pEVar10; int *piVar11; PlayerManager *in_ECX; PlayerManager **ppPVar12; uint *puVar13; PlayerManager *pPVar14; uint uVar15; PlayerManager *pPVar16; int iVar17; int iVar18; void *pvVar19; void *pvVar20; undefined1 *messageRefCount; undefined4 auStack_90 [2]; int iStack_88; int iStack_84; int iStack_80; void *pvStack_7c; undefined4 uStack_78; int iStack_74; undefined4 local_70; undefined4 local_6c; undefined8 local_68; void *pvStack_60; void *pvStack_5c; void *local_58; void *local_54; PlayerManager *local_4c; undefined8 local_48; PlayerManager *local_40; PlayerManager *local_3c; undefined4 local_38; int *local_34; PlayerManager *local_30; int *local_2c; int *local_28; PlayerManager *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00b0987d; local_1c = ExceptionList; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uVar6 = __security_cookie ^ (uint)(auStack_90 + 0x20); ExceptionList = &local_1c; iVar8 = *(int *)&in_ECX[0x1c].field_0x68; piVar11 = (int *)&in_ECX[0x1c].field_0x68; local_30 = (PlayerManager *)0x0; local_28 = piVar11; local_24 = in_ECX; if (*(int *)&in_ECX[0x1c].field_0x6c - iVar8 >> 5 != 0) { iVar18 = 0; do { if (*(int *)(iVar18 + iVar8) == 0) { local_4c = (PlayerManager *) (local_24->_coopSlots[0]._playerType + local_24->_coopSlots[0]._controllerIndex); ppPVar7 = (PlayerManager **)(iVar8 + 0x10 + iVar18); ppPVar12 = &local_4c; if (local_4c <= *ppPVar7) { ppPVar12 = ppPVar7; } local_70 = *(undefined4 *)(iVar18 + 8 + iVar8); local_4c = *ppPVar12; local_6c = *(undefined4 *)(iVar18 + 0xc + iVar8); local_68 = CONCAT44(local_68._4_4_,local_4c); if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = &DAT_00000007; pvVar20 = (void *)0x10; NetConnection::send_message(g_multiplayerService,&local_40,1,&local_70,0x10,7); pMVar4 = g_manager; local_14 = 0; FUN_008ef1d0(&local_40); send_message(&pMVar4->_netplayManager,8,pvVar20,messageRefCount); local_14 = 1; if (((local_3c != (PlayerManager *)0x0) && (cVar5 = (**(code **)((int)(local_3c->_playerList)._begin + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_40); } local_14 = 0xffffffff; iVar17 = *local_28 + iVar18; iVar8 = FUN_0090b070(); iVar8 = *(int *)(iVar8 + 0x374); if (iVar8 == 0) { local_48 = 0; local_48._4_4_ = (uint *)0x0; local_48._0_4_ = 0; local_38 = (undefined4)local_48; local_34 = (int *)local_48._4_4_; } else { local_38 = *(undefined4 *)(iVar8 + 8); local_34 = *(int **)(iVar8 + 0xc); } puVar1 = *(undefined4 **)(iVar17 + 0x18); if (puVar1 == *(undefined4 **)(iVar17 + 0x1c)) { std::vector<8byte>::_Emplace_reallocate(puVar1,&local_38); } else { *puVar1 = local_38; puVar1[1] = local_34; *(int *)(iVar17 + 0x18) = *(int *)(iVar17 + 0x18) + 8; } *(PlayerManager **)(*local_28 + 0x10 + iVar18) = local_4c; *(undefined4 *)(*local_28 + iVar18) = 1; piVar11 = local_28; } local_30 = (PlayerManager *)((int)&(local_30->_playerList)._begin + 1); iVar8 = *piVar11; iVar18 = iVar18 + 0x20; } while (local_30 < (PlayerManager *)(piVar11[1] - iVar8 >> 5)); } LAB_00911e30: piVar11 = local_28; if (g_multiplayerService != (void *)0x0) { piVar9 = NetworkManager::receive_message(g_multiplayerService,&local_38,7,0); iVar8 = *piVar9; local_14 = 2; if (((local_34 != (int *)0x0) && (cVar5 = (**(code **)(*local_34 + 0xc))(uVar6), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_38); } local_14 = 0xffffffff; if (iVar8 != 0) { if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_40,7,1); } pPVar14 = local_40; local_14 = 3; local_58 = (local_40->_playerList)._begin; local_54 = (local_40->_playerList)._end; pEVar10 = PlayerManager::get_player_by_user_id(local_24,(ulonglong *)&local_58); if (pEVar10 != (Entity_Player *)0x0) { local_4c = pPVar14; if (pPVar14->_coopSlots[0]._controllerIndex != 1) { KAGE_LogMessage(0x10,(byte *) "This function should only be called on consolidated messages"); } iVar8 = *(int *)(*(int *)(local_4c->_playerList)._capacity + 0x14); local_2c = (int *)(iVar8 + 8); local_48 = CONCAT44(iVar8 + 0x10,(undefined4)local_48); KAGE_LogMessage(1,(byte *) "[FRAME: %d] Recieved Message_RevivePlayer from User(%llu), for User(%llu), Revive Frame = %d \n" ); piVar9 = local_2c; iVar8 = *piVar11; local_30 = (PlayerManager *)0x0; local_4c = (PlayerManager *)(piVar11[1] - iVar8 >> 5); if (local_4c != (PlayerManager *)0x0) { do { if ((*(int *)(iVar8 + 8) == *local_2c) && (*(int *)(iVar8 + 0xc) == local_2c[1])) { if (iVar8 != 0) { pPVar14 = (PlayerManager *)0x0; puVar13 = *(uint **)(iVar8 + 0x14); local_4c = (PlayerManager *)(*(int *)(iVar8 + 0x18) - (int)puVar13 >> 3); if (local_4c == (PlayerManager *)0x0) goto LAB_00912059; local_30 = (local_40->_playerList)._begin; goto LAB_00912042; } break; } local_30 = (PlayerManager *)((int)&(local_30->_playerList)._begin + 1); iVar8 = iVar8 + 0x20; } while (local_30 < local_4c); } KAGE_LogMessage(1,(byte *) "[FRAME: %d] - No pending revival found for user(%llu), creating one \n"); iStack_88 = *piVar9; iStack_84 = piVar9[1]; auStack_90[0] = 0; iStack_80 = 0; pvStack_7c = (void *)0x0; uStack_78 = 0; iStack_74 = 0; local_14 = CONCAT31(local_14._1_3_,4); local_68._0_4_ = (local_40->_playerList)._begin; local_68._4_4_ = (local_40->_playerList)._end; std::vector<8byte>::_Emplace_reallocate(0,&local_68); iStack_80 = piVar9[2]; puVar1 = *(undefined4 **)&local_24[0x1c].field_0x6c; if (puVar1 == local_24[0x1c]._coopPlayerTypes._begin) { FUN_009149f0(puVar1,auStack_90); } else { *puVar1 = auStack_90[0]; puVar1[2] = iStack_88; puVar1[3] = iStack_84; puVar1[4] = iStack_80; FUN_00915d70(&pvStack_7c); piVar11[1] = piVar11[1] + 0x20; } local_14 = CONCAT31(local_14._1_3_,3); if (pvStack_7c != (void *)0x0) { uVar15 = (iStack_74 - (int)pvStack_7c >> 3) * 8; pvVar20 = pvStack_7c; if (0xfff < uVar15) { pvVar20 = *(void **)((int)pvStack_7c + -4); uVar15 = uVar15 + 0x23; if (0x1f < (uint)((int)pvStack_7c + (-4 - (int)pvVar20))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar20,uVar15); } } goto LAB_0091211f; } } iVar8 = piVar11[1]; pPVar14 = (PlayerManager *)*piVar11; local_30 = (PlayerManager *)0x0; if (iVar8 - (int)pPVar14 >> 5 == 0) { LAB_009122d0: uVar6 = iVar8 - (int)pPVar14 >> 5; local_30 = (PlayerManager *)(uVar6 - 1); if (local_30 < uVar6) { local_2c = (int *)((int)local_30 * 0x20); do { pGVar3 = g_game; if (*(int *)((int)pPVar14->_coopSlots + (int)local_2c + -0xc) == 2) { pPVar16 = &g_game->_playerManager; local_4c = pPVar16; pEVar10 = PlayerManager::get_player_by_user_id (local_24,(ulonglong *)((int)pPVar14->_coopSlots + (int)local_2c + -4) ); uVar6 = 0; piVar11 = (pPVar16->_playerList)._begin; uVar15 = (int)(pGVar3->_playerManager)._playerList._end - (int)piVar11 >> 2; if (uVar15 != 0) { do { iVar8 = piVar11[uVar6]; if (*(void **)(iVar8 + 0x1618) == (pEVar10->_damageEvents)._end) goto LAB_00912346; uVar6 = uVar6 + 1; } while (uVar6 < uVar15); } iVar8 = 0; if (uVar15 != 0) { LAB_00912346: uVar6 = 0; do { if (*piVar11 == iVar8) goto LAB_00912357; uVar6 = uVar6 + 1; piVar11 = piVar11 + 1; } while (uVar6 < uVar15); } uVar6 = 0xffffffff; LAB_00912357: PlayerManager::ReviveCoopPlayer(uVar6); local_34 = (int *)((int)local_2c + *(int *)&local_24[0x1c].field_0x68); pPVar14 = *(PlayerManager **)&local_24[0x1c].field_0x6c; local_4c = (PlayerManager *)(local_34 + 8); local_3c = pPVar14; if (local_4c != pPVar14) { piVar11 = local_34 + 7; piVar9 = local_34 + 0xf; local_48 = CONCAT44(piVar11,(undefined4)local_48); do { *local_34 = (int)(local_4c->_playerList)._begin; iVar8 = piVar9[-4]; piVar11[-5] = piVar9[-5]; piVar11[-4] = iVar8; piVar11[-3] = piVar9[-3]; if (piVar11 != piVar9) { std::vector::_Tidy(); piVar11[-2] = piVar9[-2]; local_48._4_4_[-1] = piVar9[-1]; *local_48._4_4_ = *piVar9; piVar9[-2] = 0; piVar9[-1] = 0; *piVar9 = 0; piVar11 = (int *)local_48._4_4_; pPVar14 = local_3c; } piVar11 = piVar11 + 8; local_4c = (PlayerManager *)(local_4c->_coopSlots + 1); local_34 = local_34 + 8; local_48 = CONCAT44(piVar11,(undefined4)local_48); piVar9 = piVar9 + 8; } while (local_4c != pPVar14); } pPVar14 = local_24; std::vector::_Tidy(); *(int *)&pPVar14[0x1c].field_0x6c = *(int *)&pPVar14[0x1c].field_0x6c + -0x20; piVar11 = local_28; } local_30 = (PlayerManager *)((int)local_30 - 1); pPVar14 = (PlayerManager *)*piVar11; local_2c = (int *)((int)local_2c + -0x20); } while (local_30 < (uint)(piVar11[1] - (int)pPVar14 >> 5)); } ExceptionList = local_1c; return; } local_2c = (int *)0x0; LAB_00912180: piVar11 = local_2c; uVar15 = 0; uVar6 = iVar8 - (int)pPVar14 >> 5; pPVar16 = pPVar14; if (uVar6 != 0) { local_4c = *(PlayerManager **)((int)pPVar14->_coopSlots + (int)local_2c + -4); iVar8 = *(int *)((int)&pPVar14->_coopSlots[0]._controllerIndex + (int)local_2c); local_48 = CONCAT44(iVar8,(undefined4)local_48); local_3c = pPVar14; do { if (((pPVar14->_playerList)._capacity == local_4c) && (pPVar14->_coopSlots[0]._controllerIndex == iVar8)) { pPVar16 = local_3c; if (pPVar14 != (PlayerManager *)0x0) { local_34 = (int *)0x0; pPVar2 = (local_24->_playerList)._begin; piVar9 = (int *)((int)(local_24->_playerList)._end - (int)pPVar2 >> 2); local_48 = CONCAT44(piVar9,(undefined4)local_48); local_3c = pPVar2; if (piVar9 == (int *)0x0) goto LAB_00912262; local_4c = (PlayerManager *)pPVar14->_coopSlots[0]._state; uVar6 = (int)pPVar14->_coopSlots[0]._menuPosition - (int)local_4c >> 3; goto LAB_00912202; } break; } uVar15 = uVar15 + 1; pPVar14 = (PlayerManager *)(pPVar14->_coopSlots + 1); pPVar16 = *(PlayerManager **)&local_24[0x1c].field_0x68; local_3c = pPVar16; } while (uVar15 < uVar6); } goto LAB_00912283; while( true ) { pPVar14 = (PlayerManager *)((int)&(pPVar14->_playerList)._begin + 1); puVar13 = puVar13 + 2; if (local_4c <= pPVar14) break; LAB_00912042: if (((PlayerManager *)*puVar13 == local_30) && ((void *)puVar13[1] == (local_40->_playerList)._end)) { KAGE_LogMessage(8,(byte *) "[FRAME: %d] - User(%llu) has already confirmed revival for User(%llu)! \n") ; goto LAB_0091211f; } } LAB_00912059: KAGE_LogMessage(1,(byte *) "[FRAME: %d] - Adding revival confirmation to existing pending revival \n"); puVar13 = (uint *)(iVar8 + 0x10); if (*(uint *)(iVar8 + 0x10) < *local_48._4_4_) { puVar13 = local_48._4_4_; } *(uint *)(iVar8 + 0x10) = *puVar13; puVar1 = *(undefined4 **)(iVar8 + 0x18); pvStack_60 = (local_40->_playerList)._begin; pvStack_5c = (local_40->_playerList)._end; if (puVar1 == *(undefined4 **)(iVar8 + 0x1c)) { std::vector<8byte>::_Emplace_reallocate(puVar1,&pvStack_60); } else { *puVar1 = pvStack_60; puVar1[1] = pvStack_5c; *(int *)(iVar8 + 0x18) = *(int *)(iVar8 + 0x18) + 8; } LAB_0091211f: local_14 = 5; if (((local_3c != (PlayerManager *)0x0) && (cVar5 = (**(code **)((int)(local_3c->_playerList)._begin + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_40); } local_14 = 0xffffffff; goto LAB_00911e30; while( true ) { pPVar14 = local_4c; while (((pPVar14->_playerList)._begin != pvVar20 || ((pPVar14->_playerList)._end != pvVar19))) { uVar15 = uVar15 + 1; pPVar14 = (PlayerManager *)&(pPVar14->_playerList)._capacity; if (uVar6 <= uVar15) goto LAB_00912241; } local_34 = (int *)((int)local_34 + 1); local_3c = (PlayerManager *)&(local_3c->_playerList)._end; if (piVar9 <= local_34) break; LAB_00912202: iVar8 = *(int *)((int)(local_3c->_playerList)._begin + 0x374); if (iVar8 == 0) { local_68 = 0; local_68._4_4_ = (void *)0x0; local_68._0_4_ = (void *)0x0; pvVar20 = (void *)local_68; pvVar19 = local_68._4_4_; } else { pvVar20 = *(void **)(iVar8 + 8); pvVar19 = *(void **)(iVar8 + 0xc); } uVar15 = 0; if (uVar6 == 0) { LAB_00912241: pPVar16 = (PlayerManager *)*local_28; goto LAB_00912283; } } pPVar16 = (PlayerManager *)*local_28; LAB_00912262: puVar1 = (undefined4 *)((int)pPVar16->_coopSlots + (int)local_2c + -0xc); if (local_24->_coopSlots[0]._controllerIndex == puVar1[4]) { *puVar1 = 2; } else { LAB_00912283: if (*(uint *)((int)&pPVar16->_coopSlots[0]._playerType + (int)local_2c) < (uint)local_24->_coopSlots[0]._controllerIndex) { KAGE_LogMessage(8,(byte *) "[FRAME: %d] Revival Frame for User(%llu) has passed without being revived! (Revive Frame = %d) \n" ); } } local_2c = (int *)((int)piVar11 + 0x20); local_30 = (PlayerManager *)((int)local_30 + 1); iVar8 = local_28[1]; pPVar14 = (PlayerManager *)*local_28; piVar11 = local_28; if ((uint)(iVar8 - (int)pPVar14 >> 5) <= local_30) goto LAB_009122d0; goto LAB_00912180; } //@@ 00912450 NetplayManager::remove_drop_entry /* DB: erases the {u64 user, std::set} entry for the user from the vector at +0x1858; update_player_removal, remove_remote_player 009091a0 NetplayManager::RemoveRemotePlayer void NetplayManager::remove_drop_entry(int param_1,undefined4 *param_2) { undefined4 uVar1; int iVar2; int *piVar3; undefined4 *puVar4; int in_ECX; uint uVar5; undefined4 *puVar6; uint uVar7; int *local_8; piVar3 = *(int **)(in_ECX + 0x1858); uVar5 = 0; uVar7 = *(int *)(in_ECX + 0x185c) - (int)piVar3 >> 4; if (uVar7 != 0) { while ((*piVar3 != param_1 || ((undefined4 *)piVar3[1] != param_2))) { uVar5 = uVar5 + 1; piVar3 = piVar3 + 4; if (uVar7 <= uVar5) { return; } } puVar4 = *(undefined4 **)(in_ECX + 0x185c); param_2 = (undefined4 *)(*(int *)(in_ECX + 0x1858) + uVar5 * 0x10); puVar6 = param_2 + 4; if (puVar6 != puVar4) { local_8 = param_2 + 6; piVar3 = param_2 + 2; do { uVar1 = puVar6[1]; *param_2 = *puVar6; param_2[1] = uVar1; if (piVar3 != local_8) { iVar2 = *piVar3; FID_conflict__Erase_tree_>_> (piVar3,(fuzzer_allocator_> *)piVar3, *(_Tree_node **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; piVar3[1] = 0; iVar2 = *piVar3; *piVar3 = *local_8; *local_8 = iVar2; iVar2 = piVar3[1]; piVar3[1] = local_8[1]; local_8[1] = iVar2; } param_2 = param_2 + 4; puVar6 = puVar6 + 4; local_8 = local_8 + 4; piVar3 = piVar3 + 4; } while (puVar6 != puVar4); puVar4 = *(undefined4 **)(in_ECX + 0x185c); } piVar3 = puVar4 + -2; FID_conflict__Erase_tree_>_> (piVar3,(fuzzer_allocator_> *)piVar3, *(_Tree_node **)(*piVar3 + 4)); operator_delete((void *)*piVar3,0x20); *(int *)(in_ECX + 0x185c) = *(int *)(in_ECX + 0x185c) + -0x10; } return; } //@@ 00912560 NetplayManager::receive_vote_end_message /* DB: "[Frame: %d] Recieved Vote End message from user %llu", "Victory lap vote processed"; calls NetworkManager::receive_message, called from NetplayManager::Update (was HUD::ShowFortuneText) */ void __thiscall NetplayManager::receive_vote_end_message(NetplayManager *this) { undefined4 uVar1; char cVar2; uint uVar3; int *piVar4; NetplayManager NVar5; int iVar6; undefined4 *puVar7; int iVar8; void *ptr; undefined4 *puVar9; int iVar10; void *pvStack_5c; undefined4 *puStack_58; undefined4 *puStack_54; undefined8 local_50; undefined1 local_48 [4]; int *local_44; undefined4 *local_40; int *piStack_3c; Game *local_38; NetplayManager *local_34; uint local_30; uint local_2c; NetplayManager local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_48 + 0x44; puStack_18 = &LAB_00b098b5; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_48 + 0x38); ExceptionList = &local_1c; local_34 = this; while (local_14 = 0xffffffff, g_multiplayerService != (void *)0x0) { piVar4 = NetworkManager::receive_message(g_multiplayerService,local_48,8,0); iVar10 = *piVar4; local_14 = 0; if (((local_44 != (int *)0x0) && (cVar2 = (**(code **)(*local_44 + 0xc))(uVar3), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_48); } local_14 = 0xffffffff; if (iVar10 == 0) break; if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_40,8,1); } local_14 = 1; KAGE_LogMessage(1,(byte *)"[Frame: %d] Recieved Vote End message from user %llu \n"); puVar9 = local_40; if (local_40[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } FUN_0090a4b0(*local_40,local_40[1],*(undefined4 *)(*(int *)(*(int *)puVar9[2] + 0x14) + 8), *(undefined4 *)(*(int *)(*(int *)puVar9[2] + 0x14) + 0xc)); local_14 = 2; if (((piStack_3c != (int *)0x0) && (cVar2 = (**(code **)(*piStack_3c + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_40); } } local_14 = 0xffffffff; local_30 = (int)this[0x622] - (int)this[0x621] >> 4; if (local_30 != 0) { local_28 = *this; local_24 = 0; local_2c = (int)this[1] - (int)local_28 >> 2; if (local_2c != 0) { do { uVar3 = 0; iVar10 = *(int *)(*(int *)local_28 + 0x374); NVar5 = this[0x621]; while( true ) { if (iVar10 == 0) { local_50 = 0; local_50._4_4_ = 0; local_50._0_4_ = 0; iVar6 = (int)local_50; iVar8 = local_50._4_4_; } else { iVar6 = *(int *)(iVar10 + 8); iVar8 = *(int *)(iVar10 + 0xc); } if (((*(int *)NVar5 == iVar6) && (*(int *)((int)NVar5 + 4) == iVar8)) && ((uint)*(NetplayManager *)((int)NVar5 + 0xc) <= (uint)local_34[3])) break; uVar3 = uVar3 + 1; NVar5 = (NetplayManager)((int)NVar5 + 0x10); if (local_30 <= uVar3) { ExceptionList = local_1c; return; } } local_24 = local_24 + 1; local_28 = (NetplayManager)((int)local_28 + 4); } while (local_24 < local_2c); } local_38 = g_game; if (((g_game->_genericPrompt)._sprite._animState._animData != (void *)0x0) && ((g_game->_genericPrompt)._sprite._animState._isPlaying != 0)) { KAGE_LogMessage(1,(byte *)"[Frame: %d] Victory lap vote processed \n"); GenericPrompt::Disappear(&(g_game->_genericPrompt)._sprite); local_24 = 1; puVar9 = (undefined4 *)0x0; pvStack_5c = (void *)0x0; puStack_58 = (undefined4 *)0x0; local_28 = (NetplayManager)0x0; puStack_54 = (undefined4 *)0x0; local_14 = 3; uVar3 = *(uint *)&g_manager[1]._gamestate.field_0x8dc; local_30 = (int)(*(int *)&g_manager[1]._gamestate.field_0x8e0 - uVar3) >> 4; if (local_30 != 0) { iVar10 = 0; do { puVar7 = (undefined4 *)(uVar3 + iVar10); if (puVar7[2] == 0) { if ((NetplayManager)puVar9 == local_28) { std::vector<8byte>::_Emplace_reallocate(puVar9,puVar7); local_28 = (NetplayManager)puStack_54; puVar9 = puStack_58; } else { uVar1 = puVar7[1]; *puVar9 = *puVar7; puVar9[1] = uVar1; puStack_58 = puVar9 + 2; puVar9 = puStack_58; } } if (g_userProfile == (void *)0x0) { local_50 = 0; local_50._4_4_ = 0; local_50._0_4_ = 0; iVar6 = local_50._4_4_; iVar8 = (int)local_50; } else { iVar6 = *(int *)((int)g_userProfile + 0xc); iVar8 = *(int *)((int)g_userProfile + 8); } uVar3 = *(uint *)&g_manager[1]._gamestate.field_0x8dc; if ((*(int *)(uVar3 + iVar10) == iVar8) && (*(int *)(uVar3 + 4 + iVar10) == iVar6)) { local_24 = *(int *)(uVar3 + 8 + iVar10); } iVar10 = iVar10 + 0x10; local_30 = local_30 + -1; local_2c = uVar3; } while (local_30 != 0); NVar5 = local_28; if (local_24 == 0) { KAGE::Network::MultiplayerManager::request_user_profiles(&pvStack_5c,uVar3,local_38); NVar5 = (NetplayManager)puStack_54; } if (pvStack_5c != (void *)0x0) { uVar3 = (int)NVar5 - (int)pvStack_5c & 0xfffffff8; ptr = pvStack_5c; if (0xfff < uVar3) { ptr = *(void **)((int)pvStack_5c + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)pvStack_5c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } } } local_34[0x622] = local_34[0x621]; } ExceptionList = local_1c; return; } //@@ 009128e0 NetplayManager::update_lobby_stage_info /* DB: when the local user owns the lobby (UserProfile::is_local_user) sets lobby data "current_stage"/"current_stage_type" via Lobby vfunc +0x24; NetplayManager::Update and 0095a4a0 */ void NetplayManager::update_lobby_stage_info(void) { undefined1 *puVar1; char cVar2; int iVar3; NetplayManager *in_ECX; void *message; NetplayManager messageRefCount; undefined1 auStack_62 [2]; undefined1 local_54 [20]; undefined **local_40; int *local_3c; int *local_38; undefined **local_34; undefined **local_2c; undefined1 *local_28; byte local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_54 + 0x50; puStack_18 = &LAB_00b0991d; local_1c = ExceptionList; ExceptionList = &local_1c; local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_3c = (int *)0x0; local_38 = (int *)0x0; local_14 = 0; std::shared_ptr::assign(&local_3c,&g_multiplayerLobbyPtr); local_40 = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 1; if (local_3c == (int *)0x0) { local_28 = (undefined1 *)0x0; } else { iVar3 = (**(code **)(*local_3c + 0x20))(); local_28 = *(undefined1 **)(iVar3 + 4); local_34 = KAGE::System::UserProfileBase::vftable; } local_2c = KAGE::System::UserProfile::vftable; local_14 = CONCAT31(local_14._1_3_,2); local_21 = KAGE::System::UserProfile::is_local_user(&local_2c); local_2c = KAGE::System::UserProfileBase::vftable; local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 3; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_14 = 0xffffffff; if (local_21 != 0) { messageRefCount = in_ECX[0x630]; message = (void *)0x9129f1; FUN_009187f0(); local_28 = auStack_62 + -10; puVar1 = auStack_62 + -10; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); puVar1 = local_28; } local_28 = puVar1; NetConnection::send_message(g_multiplayerService,auStack_62 + -10,1,local_54,0x14,0); send_message(in_ECX,2,message,(void *)messageRefCount); local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_3c = (int *)0x0; local_38 = (int *)0x0; local_14 = 4; std::shared_ptr::assign(&local_3c,&g_multiplayerLobbyPtr); local_40 = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 5; if (local_3c != (int *)0x0) { (**(code **)(*local_3c + 0x24))(); } local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 6; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_3c = (int *)0x0; local_38 = (int *)0x0; local_14 = 7; std::shared_ptr::assign(&local_3c,&g_multiplayerLobbyPtr); local_40 = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 8; if (local_3c != (int *)0x0) { (**(code **)(*local_3c + 0x24))(); } local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 9; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } ExceptionList = local_1c; return; } //@@ 00912b60 NetplayManager::request_join_lobby /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=NetplayManager (+0x18d8 state, +0x1918/+0x1928): with daily-challenge lobbies runs daily_challenge_refresh and "#Online/LOBBY_JOIN_DAILY_CHECK" popup, reads lobby "current_stage", otherwise NetplayManager::join_pending_lobby or LobbyPasswordPrompt::open for passworded lobbies; 3 callers in NetplayManager prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall NetplayManager::request_join_lobby (NetplayManager *this,void *lobbyVftable,void *lobby,void *lobbyRefCount) { char cVar1; int iVar2; undefined4 local_a0; undefined **local_84; int *local_80; int *local_7c; undefined ***local_70; int local_68; char local_54 [24]; char local_3c [16]; int local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0997e; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_3c + 0x38); ExceptionList = &local_10; local_70 = (undefined ***)(local_54 + -0x50); local_a0 = 0; local_8 = 1; std::shared_ptr::assign(&local_a0,&lobby); local_8 = local_8 & 0xffffff00; FUN_0085b160(); local_8 = CONCAT31(local_8._1_3_,2); if (local_68 != 5) { if (local_2c == 0) { local_a0 = 0x912d0e; join_pending_lobby(this,&lobbyVftable); } else { local_70 = (undefined ***)(local_54 + -0x50); local_a0 = 0; local_8._0_1_ = 6; std::shared_ptr::assign(&local_a0,&lobby); local_8 = CONCAT31(local_8._1_3_,2); LobbyPasswordPrompt::open(); } goto LAB_00912d0e; } local_70 = &local_84; local_84 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_80 = (int *)0x0; local_7c = (int *)0x0; local_8._0_1_ = 3; local_a0 = 0x912c0a; std::shared_ptr::assign(&local_80,&lobby); local_8._0_1_ = 4; if ((this[0x646] == (NetplayManager)0x0) || (*(char *)(this + 0x64a) == '\0')) { daily_challenge_refresh(); this[0x636] = (NetplayManager)0x1; local_a0 = 0x912c3a; std::shared_ptr::assign(this + 0x6cc,&local_80); FUN_00837510(); string_table_translate(&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_DAILY_CHECK"); FUN_00837660(); this[0x637] = (NetplayManager)0x0; if (local_80 != (int *)0x0) { local_a0 = 0x912c7b; iVar2 = (**(code **)(*local_80 + 0x30))(); if (iVar2 != 0) { this[0x636] = (NetplayManager)0x3; goto LAB_00912c90; } } local_a0 = 0x912c90; FUN_009c5f90(); } LAB_00912c90: local_84 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,5); if (local_7c != (int *)0x0) { cVar1 = (**(code **)(*local_7c + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { local_a0 = 0x912cbc; (*g_lobbyReleaseFn)(); } } LAB_00912d0e: std::vector::_Tidy(); std::string::_Tidy_deallocate(local_3c); std::string::_Tidy_deallocate(local_54); lobbyVftable = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 7; if (lobbyRefCount != (void *)0x0) { cVar1 = (**(code **)(*(int *)lobbyRefCount + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { local_a0 = 0x912d55; (*g_lobbyReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00912d80 FUN_00912d80 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00912d80(int param_1,int *param_2,int param_3,int param_4) { int iVar1; bool bVar2; bool bVar3; bool bVar4; char cVar5; int extraout_EAX; byte *pbVar6; undefined4 uVar7; void *extraout_ECX; void *pvVar8; uint uVar9; int iVar10; void *message; undefined1 *message_00; undefined *messageRefCount; undefined1 auStack_d2 [2]; undefined4 uStack_bc; uint local_b8; void *pvStack_b0; undefined8 local_ac; void *apvStack_a4 [5]; uint uStack_90; void *apvStack_8c [4]; undefined4 uStack_7c; uint uStack_78; void *pvStack_74; undefined4 uStack_64; uint uStack_60; void *pvStack_5c; undefined4 uStack_4c; uint uStack_48; void *apvStack_44 [4]; undefined4 uStack_34; uint uStack_30; void *pvStack_2c; undefined1 auStack_28 [12]; undefined **ppuStack_1c; uint uStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b09a43; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(auStack_28 + 0x24); ExceptionList = &local_10; local_b8 = 0; switch(param_3) { case 0: iVar10 = *(int *)(param_1 + 4); if (iVar10 == 0) { local_ac = 0; pvStack_b0 = (void *)0x0; } else { pvStack_b0 = *(void **)(iVar10 + 8); local_b8 = *(undefined4 *)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); if (param_2[1] == 0) { local_ac = 0; } KAGE_LogMessage(1,(byte *)"[Frame %d] User %llu (%s) joined lobby %llu\n"); goto LAB_009130ee; case 1: iVar10 = *(int *)(param_1 + 4); if (iVar10 == 0) { local_ac = 0; pvStack_b0 = (void *)0x0; local_b8 = 0; } else { local_b8 = *(undefined4 *)(iVar10 + 8); pvStack_b0 = *(void **)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); if (param_2[1] == 0) { local_ac = 0; } KAGE_LogMessage(1,(byte *)"[Frame %d] User %llu (%s) left lobby %llu\n"); break; case 2: iVar10 = *(int *)(param_1 + 4); if (iVar10 == 0) { local_ac = 0; pvStack_b0 = (void *)0x0; local_b8 = 0; } else { local_b8 = *(undefined4 *)(iVar10 + 8); pvStack_b0 = *(void **)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); if (param_2[1] == 0) { local_ac = 0; } KAGE_LogMessage(1,(byte *)"[Frame %d] User %llu (%s) disconnected from lobby %llu\n"); break; case 3: iVar10 = *(int *)(param_1 + 4); if (iVar10 == 0) { local_ac = 0; pvStack_b0 = (void *)0x0; local_b8 = 0; } else { local_b8 = *(undefined4 *)(iVar10 + 8); pvStack_b0 = *(void **)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); if (param_2[1] == 0) { local_ac = 0; } KAGE_LogMessage(1,(byte *)"[Frame %d] User %llu (%s) got kicked from lobby %llu\n"); break; case 4: iVar10 = *(int *)(param_1 + 4); if (iVar10 == 0) { local_ac = 0; pvStack_b0 = (void *)0x0; local_b8 = 0; } else { local_b8 = *(undefined4 *)(iVar10 + 8); pvStack_b0 = *(void **)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); if (param_2[1] == 0) { local_ac = 0; } KAGE_LogMessage(1,(byte *)"[Frame %d] User %llu (%s) got banned from lobby %llu\n"); break; default: if (param_3 != 0) break; goto LAB_009130ee; } iVar10 = param_2[1]; if (iVar10 == 0) { local_ac._4_4_ = (int *)0x0; local_ac._0_4_ = 0; } else { local_ac._0_4_ = *(undefined4 *)(iVar10 + 8); local_ac._4_4_ = *(int **)(iVar10 + 0xc); } FUN_00914170(); LAB_009130ee: if ((((g_game == (Game *)0x0) || (g_game->_stage == 0)) && (g_menuManager != (MenuManager *)0x0)) && (g_menuManager->field_0xe3b0 == '\0')) { ExceptionList = local_10; return; } switch(param_3) { case 0: iVar10 = param_2[1]; if (iVar10 == 0) { local_ac = 0; local_ac._4_4_ = (void *)0x0; pvStack_b0 = (void *)0x0; pvVar8 = local_ac._4_4_; } else { pvStack_b0 = *(void **)(iVar10 + 8); pvVar8 = *(void **)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); message = pvStack_b0; KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::on_lobby_user_modified() :: KAGE::Network::eLobbyUserModification::Joined :: User: \"%s\" %llu \n" ); FUN_0090f4c0(auStack_d2 + -10); multiplayer_send_message(param_2,message,pvVar8); pvStack_b0 = (void *)(**(code **)(*(int *)(param_4 + 0x1014) + 4))(); iVar10 = *(int *)(param_4 + 0x1004); if (iVar10 == 0) { iVar10 = *(int *)(param_4 + 0xff8); } iVar1 = param_2[1]; if (iVar1 == 0) { local_b8 = 0; uStack_bc = 0; } else { uStack_bc = *(undefined4 *)(iVar1 + 8); local_b8 = *(undefined4 *)(iVar1 + 0xc); } ppuStack_1c = KAGE::System::UserProfileBase::vftable; messageRefCount = &UNK_009131ec; UserProfile::find_or_create(&uStack_bc); uStack_8 = 0; ppuStack_1c = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { messageRefCount = &UNK_00913217; KAGE::System::UserProfile::load_steam_avatar(&ppuStack_1c); } uStack_8 = 1; FUN_00a296e0(auStack_d2 + -10,1,iVar10,pvStack_b0,0); multiplayer_send_message(&ppuStack_1c,message,messageRefCount); uStack_8 = 0xffffffff; FUN_009187f0(); message_00 = auStack_28; pvVar8 = extraout_ECX; func_0x00914860(&local_ac,extraout_ECX); uStack_8 = 2; FUN_008ef1d0(&local_ac); multiplayer_send_message(param_2,message_00,pvVar8); uStack_8 = 3; if (((local_ac._4_4_ != (int *)0x0) && (cVar5 = (**(code **)(*local_ac._4_4_ + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } break; case 1: case 2: case 3: iVar10 = param_2[1]; if (iVar10 == 0) { local_ac = 0; pvStack_b0 = (void *)0x0; local_b8 = 0; } else { local_b8 = *(undefined4 *)(iVar10 + 8); pvStack_b0 = *(void **)(iVar10 + 0xc); } (**(code **)(*param_2 + 4))(); KAGE_LogMessage(1,(byte *) "[Frame: %d] NetManager::on_lobby_user_modified() :: %d :: User: \"%s\" %llu \n" ); iVar10 = param_2[1]; if (iVar10 == 0) { local_ac._4_4_ = (int *)0x0; local_ac._0_4_ = 0; } else { local_ac._0_4_ = *(uint *)(iVar10 + 8); local_ac._4_4_ = *(int **)(iVar10 + 0xc); } pvStack_b0 = local_ac._4_4_; local_b8 = (uint)local_ac; FUN_00731ee0(); if (((*(char *)(uStack_18 + 0xd) == '\0') && (*(uint *)(uStack_18 + 0x14) <= pvStack_b0)) && ((*(uint *)(uStack_18 + 0x14) < pvStack_b0 || (*(uint *)(uStack_18 + 0x10) <= local_b8)))) { uVar9 = uStack_18; } else { uVar9 = *(uint *)(param_4 + 0x1864); } if (uVar9 != *(uint *)(param_4 + 0x1864)) { if (iVar10 == 0) { local_ac = 0; FUN_00913c80(); ExceptionList = local_10; return; } local_ac = *(undefined8 *)(iVar10 + 8); FUN_00913c80(); ExceptionList = local_10; return; } cVar5 = (**(code **)(*param_2 + 0x14))(); if (cVar5 != '\0') { FUN_00907830(); ExceptionList = local_10; return; } if (*(int *)(param_4 + 0x11c8) != 0) { FUN_00a23920(); FUN_008feaf0(); } pbVar6 = (byte *)(**(code **)(*param_2 + 4))(); std::string::string_from_cstr((char *)apvStack_a4,pbVar6); uStack_8 = 4; _uStack_bc = CONCAT44(1,uStack_bc); FUN_0060c790(); uStack_8 = 5; bVar3 = false; bVar2 = false; _uStack_bc = CONCAT44(3,uStack_bc); cVar5 = FUN_00923cb0(); if (cVar5 == '\0') { pbVar6 = (byte *)(**(code **)(*param_2 + 4))(); std::string::string_from_cstr((char *)apvStack_44,pbVar6); uStack_8 = 6; _uStack_bc = CONCAT44(7,uStack_bc); FUN_0060c790(); bVar3 = true; bVar2 = true; cVar5 = FUN_00923cb0(); bVar4 = true; if (cVar5 != '\0') goto code_r0x009134f1; } else { code_r0x009134f1: bVar4 = false; } if (bVar2) { if (0xf < uStack_18) { uVar9 = uStack_18 + 1; pvVar8 = pvStack_2c; if (0xfff < uVar9) { pvVar8 = *(void **)((int)pvStack_2c + -4); uVar9 = uStack_18 + 0x24; if (0x1f < (uint)((int)pvStack_2c + (-4 - (int)pvVar8))) goto code_r0x00913624; } operator_delete(pvVar8,uVar9); } ppuStack_1c = (undefined **)0x0; uStack_18 = 0xf; pvStack_2c = (void *)((uint)pvStack_2c & 0xffffff00); } uStack_8 = 5; if (bVar3) { if (0xf < uStack_30) { uVar9 = uStack_30 + 1; pvVar8 = apvStack_44[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)apvStack_44[0] + -4); uVar9 = uStack_30 + 0x24; if (0x1f < (uint)((int)apvStack_44[0] + (-4 - (int)pvVar8))) goto code_r0x00913624; } operator_delete(pvVar8,uVar9); } uStack_34 = 0; uStack_30 = 0xf; apvStack_44[0] = (void *)((uint)apvStack_44[0] & 0xffffff00); } uStack_8 = 4; if (0xf < uStack_48) { uVar9 = uStack_48 + 1; pvVar8 = pvStack_5c; if (0xfff < uVar9) { pvVar8 = *(void **)((int)pvStack_5c + -4); uVar9 = uStack_48 + 0x24; if (0x1f < (uint)((int)pvStack_5c + (-4 - (int)pvVar8))) goto code_r0x00913624; } operator_delete(pvVar8,uVar9); } pvStack_5c = (void *)((uint)pvStack_5c & 0xffffff00); uStack_48 = 0xf; uStack_4c = 0; uStack_8 = 0xffffffff; if (0xf < uStack_90) { uVar9 = uStack_90 + 1; pvVar8 = apvStack_a4[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)apvStack_a4[0] + -4); uVar9 = uStack_90 + 0x24; if (0x1f < (uint)((int)apvStack_a4[0] + (-4 - (int)pvVar8))) { code_r0x00913624: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar9); } if (bVar4) { pbVar6 = (byte *)(**(code **)(*param_2 + 4))(); std::string::string_from_cstr((char *)apvStack_8c,pbVar6); uStack_8 = 7; uVar7 = FUN_0060c790(); uStack_8._0_1_ = 8; FUN_00428b60(uVar7,0x6e); uStack_8 = CONCAT31(uStack_8._1_3_,7); if (0xf < uStack_60) { uVar9 = uStack_60 + 1; pvVar8 = pvStack_74; if (0xfff < uVar9) { pvVar8 = *(void **)((int)pvStack_74 + -4); uVar9 = uStack_60 + 0x24; if (0x1f < (uint)((int)pvStack_74 + (-4 - (int)pvVar8))) goto code_r0x009136ef; } operator_delete(pvVar8,uVar9); } uStack_8 = 0xffffffff; uStack_64 = 0; uStack_60 = 0xf; pvStack_74 = (void *)((uint)pvStack_74 & 0xffffff00); if (0xf < uStack_78) { uVar9 = uStack_78 + 1; pvVar8 = apvStack_8c[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)apvStack_8c[0] + -4); uVar9 = uStack_78 + 0x24; if (0x1f < (uint)((int)apvStack_8c[0] + (-4 - (int)pvVar8))) { code_r0x009136ef: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar9); } uStack_7c = 0; uStack_78 = 0xf; apvStack_8c[0] = (void *)((uint)apvStack_8c[0] & 0xffffff00); } NetplayManager::QueueRemovePlayer(); } ExceptionList = local_10; return; } //@@ 00913760 FUN_00913760 void FUN_00913760(int param_1,int *param_2,int *param_3) { int *piVar1; char cVar2; uint uVar3; int *piVar4; int iVar5; int *_Dst; undefined4 uVar6; char *pcVar7; undefined4 uVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar1 = param_3; puStack_c = &LAB_00b09a7d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; uVar8 = *(undefined4 *)(param_1 + 0xc); iVar5 = param_3[3]; pcVar7 = "[Frame: %d] Input device (ID = %d) disconnected \n"; uVar6 = 1; KAGE_LogMessage(1,(byte *)"[Frame: %d] Input device (ID = %d) disconnected \n"); _Dst = (int *)*piVar1; param_3 = (int *)__RTDynamicCast(param_1,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0, uVar6,pcVar7,iVar5,uVar8,uVar3); piVar4 = (int *)piVar1[1]; if (_Dst != piVar4) { do { if ((param_3 == (int *)0x0) || ((int *)*_Dst != param_3)) { if (*(int *)(*_Dst + 0x378) == 0) { iVar5 = -0x21524111; } else { iVar5 = *(int *)(*(int *)(*_Dst + 0x378) + 0xc); } if (iVar5 == *(int *)(param_1 + 0xc)) { FUN_00902f10(0); piVar4 = (int *)piVar1[1]; } _Dst = _Dst + 1; } else { memmove(_Dst,_Dst + 1,(int)piVar4 - (int)(_Dst + 1)); piVar1[1] = piVar1[1] + -4; piVar4 = (int *)piVar1[1]; } } while (_Dst != piVar4); } local_8 = 1; if (param_2 != (int *)0x0) { cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return; } //@@ 00913870 FUN_00913870 void FUN_00913870(char param_1,undefined4 *param_2) { Manager *pMVar1; void *in_stack_ffffffdc; void *in_stack_ffffffe0; void *in_stack_ffffffe4; undefined4 local_10; undefined4 local_c; pMVar1 = g_manager; if (param_1 != '\0') { local_10 = *param_2; local_c = param_2[1]; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_10); NetplayManager::request_join_lobby (&pMVar1->_netplayManager,in_stack_ffffffdc,in_stack_ffffffe0,in_stack_ffffffe4); } return; } //@@ 009138d0 std::vector::_Tidy /* DB: ? vector of 0x14-byte elements whose dtor only resets UserProfileBase::vftable at +0 (an 8-byte UserProfile plus trivial data), then frees storage; Manager::destructor and 009510f0 */ void std::vector::_Tidy(void) { uint size; int *in_ECX; undefined4 *puVar1; undefined4 *puVar2; puVar1 = (undefined4 *)*in_ECX; if (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)in_ECX[1]; if (puVar1 != puVar2) { do { *puVar1 = KAGE::System::UserProfileBase::vftable; puVar1 = puVar1 + 5; } while (puVar1 != puVar2); puVar1 = (undefined4 *)*in_ECX; } size = ((in_ECX[2] - (int)puVar1) / 0x14) * 0x14; puVar2 = puVar1; if (0xfff < size) { puVar2 = (undefined4 *)puVar1[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar1 + (-4 - (int)puVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00913950 FUN_00913950 void FUN_00913950(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { FUN_009149f0(puVar1,param_1); return; } *puVar1 = *param_1; uVar2 = param_1[3]; puVar1[2] = param_1[2]; puVar1[3] = uVar2; puVar1[4] = param_1[4]; FUN_00915d70(param_1 + 5); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x20; return; } //@@ 009139a0 std::vector<32byte>::_Tidy /* DB: destroys 0x20-byte elements (inner vector at +0) and frees; NetplayManager destructor on +0x1878 (revive queue) */ void std::vector<32byte>::_Tidy(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { vector::_Tidy(); pvVar1 = (void *)((int)pvVar1 + 0x20); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = in_ECX[2] - (int)pvVar1 & 0xffffffe0; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00913a10 FUN_00913a10 void FUN_00913a10(int *param_1,int param_2) { undefined4 *puVar1; int in_ECX; undefined4 *puVar2; undefined4 *puVar3; undefined4 *local_8; local_8 = (undefined4 *)(param_2 + 0x18); puVar1 = *(undefined4 **)(in_ECX + 4); if (local_8 != puVar1) { puVar3 = (undefined4 *)(param_2 + 0x2c); puVar2 = (undefined4 *)(param_2 + 0x14); do { puVar2[-5] = *local_8; puVar2[-4] = puVar3[-4]; puVar2[-3] = puVar3[-3]; if (puVar2 != puVar3) { std::vector::_Tidy(); puVar2[-2] = puVar3[-2]; puVar2[-1] = puVar3[-1]; *puVar2 = *puVar3; puVar3[-2] = 0; puVar3[-1] = 0; *puVar3 = 0; } puVar2 = puVar2 + 6; local_8 = local_8 + 6; puVar3 = puVar3 + 6; } while (local_8 != puVar1); } std::vector::_Tidy(); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -0x18; *param_1 = param_2; return; } //@@ 00913ac0 FUN_00913ac0 void FUN_00913ac0(undefined4 *param_1) { undefined4 *puVar1; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { FUN_00914ba0(puVar1,param_1); return; } *puVar1 = *param_1; puVar1[1] = param_1[1]; puVar1[2] = param_1[2]; FUN_00915d70(param_1 + 3); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x18; return; } //@@ 00913b10 std::vector<24byte>::_Tidy /* DB: destroys 0x18-byte elements (inner vector) and frees; NetplayManager destructor on +0x186c (removal queue) */ void std::vector<24byte>::_Tidy(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { vector::_Tidy(); pvVar1 = (void *)((int)pvVar1 + 0x18); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x18) * 0x18; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00913ba0 FUN_00913ba0 int FUN_00913ba0(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09aad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_24,param_1); if (*(char *)((int)local_1c + 0xd) == '\0') { if ((*(uint *)((int)local_1c + 0x14) <= param_1[1]) && ((*(uint *)((int)local_1c + 0x14) < param_1[1] || (*(uint *)((int)local_1c + 0x10) <= *param_1)))) goto LAB_00913c62; } if (in_ECX[1] == 0x5555555) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x30); uVar2 = *param_1; newNode[5] = param_1[1]; newNode[4] = uVar2; newNode[7] = 0; newNode[6] = KAGE::System::UserProfile::vftable; *(undefined1 *)(newNode + 8) = 0; newNode[9] = 0; newNode[10] = 5; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(in_ECX,local_24,local_20,newNode); LAB_00913c62: ExceptionList = local_10; return (int)local_1c + 0x18; } //@@ 00913c80 FUN_00913c80 int FUN_00913c80(uint *param_1) { char cVar1; int *piVar2; uint uVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_10; piVar2 = (int *)*in_ECX; piVar5 = (int *)piVar2[1]; piVar4 = piVar5; piVar8 = piVar2; piVar9 = piVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar3 = piVar4[5]; if ((param_1[1] < uVar3) || ((param_1[1] <= uVar3 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar3) && ((param_1[1] < uVar3 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_10 = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar1 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_10 = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar2) && (*(char *)((int)piVar9 + 0xd) != '\0')) { FUN_00914d90(in_ECX,piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar2 = (int *)param_1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); *(undefined ***)((int)ptr + 0x18) = KAGE::System::UserProfileBase::vftable; operator_delete(ptr,0x30); } while (param_1 != (uint *)piVar9); return local_10; } return local_10; } //@@ 00913df0 FUN_00913df0 void FUN_00913df0(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_00915be0(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xfffffff0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00913e50 FUN_00913e50 int FUN_00913e50(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x18; } //@@ 00913e70 std::map::erase /* DB: equal_range on a u64 key (lower/upper bound loops on node +0x10/+0x14) then std_tree_extract + destroy (std::map::destroy_subtree) per node; 2 callers in NetplayManager FUN_0090c7e0 */ int std::map::erase(uint *param_1) { char cVar1; int *piVar2; uint uVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_10; piVar2 = (int *)*in_ECX; piVar5 = (int *)piVar2[1]; piVar4 = piVar5; piVar8 = piVar2; piVar9 = piVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar3 = piVar4[5]; if ((param_1[1] < uVar3) || ((param_1[1] <= uVar3 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar3) && ((param_1[1] < uVar3 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_10 = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar1 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_10 = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar2) && (*(char *)((int)piVar9 + 0xd) != '\0')) { destroy_subtree(in_ECX,piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar2 = (int *)param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); *(undefined4 *)((int)ptr + 0xcc) = *(undefined4 *)((int)ptr + 200); *(undefined ***)((int)ptr + 0xe4) = KAGE::Filesys::StreamBase::vftable; *(undefined ***)((int)ptr + 0xbc) = KAGE::Filesys::BufferedStreamBase::vftable; *(undefined4 *)((int)ptr + 0xc0) = 0; *(undefined4 *)((int)ptr + 0xc4) = 0; *(undefined4 *)((int)ptr + 0xcc) = *(undefined4 *)((int)ptr + 200); *(undefined4 *)((int)ptr + 0xd4) = 0; *(undefined4 *)((int)ptr + 0xd8) = 0; *(undefined4 *)((int)ptr + 0xdc) = 0; *(undefined4 *)((int)ptr + 0xe0) = 0; FUN_007dcd30(); *(undefined4 *)((int)ptr + 0x98) = *(undefined4 *)((int)ptr + 0x94); *(undefined ***)((int)ptr + 0xb0) = KAGE::Filesys::StreamBase::vftable; *(undefined ***)((int)ptr + 0x88) = KAGE::Filesys::BufferedStreamBase::vftable; *(undefined4 *)((int)ptr + 0x8c) = 0; *(undefined4 *)((int)ptr + 0x90) = 0; *(undefined4 *)((int)ptr + 0x98) = *(undefined4 *)((int)ptr + 0x94); *(undefined4 *)((int)ptr + 0xa0) = 0; *(undefined4 *)((int)ptr + 0xa4) = 0; *(undefined4 *)((int)ptr + 0xa8) = 0; *(undefined4 *)((int)ptr + 0xac) = 0; FUN_007dcd30(); *(undefined4 *)((int)ptr + 100) = *(undefined4 *)((int)ptr + 0x60); *(undefined ***)((int)ptr + 0x7c) = KAGE::Filesys::StreamBase::vftable; *(undefined ***)((int)ptr + 0x54) = KAGE::Filesys::BufferedStreamBase::vftable; *(undefined4 *)((int)ptr + 0x58) = 0; *(undefined4 *)((int)ptr + 0x5c) = 0; *(undefined4 *)((int)ptr + 100) = *(undefined4 *)((int)ptr + 0x60); *(undefined4 *)((int)ptr + 0x6c) = 0; *(undefined4 *)((int)ptr + 0x70) = 0; *(undefined4 *)((int)ptr + 0x74) = 0; *(undefined4 *)((int)ptr + 0x78) = 0; FUN_007dcd30(); *(undefined4 *)((int)ptr + 0x30) = *(undefined4 *)((int)ptr + 0x2c); *(undefined ***)((int)ptr + 0x48) = KAGE::Filesys::StreamBase::vftable; *(undefined ***)((int)ptr + 0x20) = KAGE::Filesys::BufferedStreamBase::vftable; *(undefined4 *)((int)ptr + 0x24) = 0; *(undefined4 *)((int)ptr + 0x28) = 0; *(undefined4 *)((int)ptr + 0x30) = *(undefined4 *)((int)ptr + 0x2c); *(undefined4 *)((int)ptr + 0x38) = 0; *(undefined4 *)((int)ptr + 0x3c) = 0; *(undefined4 *)((int)ptr + 0x40) = 0; *(undefined4 *)((int)ptr + 0x44) = 0; FUN_007dcd30(); operator_delete(ptr,0xe8); } while (param_1 != (uint *)piVar9); return local_10; } return local_10; } //@@ 00914150 FUN_00914150 int FUN_00914150(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_009154f0(local_10,param_1); return *piVar1 + 0x18; } //@@ 00914170 FUN_00914170 int FUN_00914170(uint *param_1) { char cVar1; int *piVar2; uint uVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; ExceptionList = &local_10; piVar2 = (int *)*in_ECX; piVar5 = (int *)piVar2[1]; piVar4 = piVar5; piVar8 = piVar2; piVar9 = piVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar3 = piVar4[5]; if ((param_1[1] < uVar3) || ((param_1[1] <= uVar3 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar3) && ((param_1[1] < uVar3 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_1c = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar1 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_1c = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar2) && (*(char *)((int)piVar9 + 0xd) != '\0')) { FUN_009156e0(in_ECX,piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar2 = (int *)param_1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); local_8 = 0; if (*(undefined4 **)((int)ptr + 0x1c) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)((int)ptr + 0x1c))(1); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)((int)ptr + 0xf7c)); std::string::_Tidy_deallocate((char *)((int)ptr + 0x38)); std::string::_Tidy_deallocate((char *)((int)ptr + 0x20)); local_8 = 0xffffffff; operator_delete(ptr,0xfa8); } while (param_1 != (uint *)piVar9); ExceptionList = local_10; return local_1c; } ExceptionList = local_10; return local_1c; } //@@ 00914340 std::map::erase /* DB: erase by uint key (equal_range, count returned); NetplayManager frame snapshot map (0090d640, try_advance_frame) */ int std::map::erase(uint *param_1) { char cVar1; int *piVar2; int *piVar3; int *piVar4; void *ptr; undefined4 *in_ECX; int *piVar5; int iVar6; int *piVar7; int *piVar8; int local_10; piVar2 = (int *)*in_ECX; piVar4 = (int *)piVar2[1]; piVar7 = piVar2; piVar8 = piVar2; if (*(char *)((int)piVar4 + 0xd) == '\0') { piVar3 = piVar4; do { if ((uint)piVar3[4] < *param_1) { piVar5 = (int *)piVar3[2]; } else { if ((*(char *)((int)piVar8 + 0xd) != '\0') && (*param_1 < (uint)piVar3[4])) { piVar8 = piVar3; } piVar5 = (int *)*piVar3; piVar7 = piVar3; } piVar3 = piVar5; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar4 = (int *)*piVar8; } if (*(char *)((int)piVar4 + 0xd) == '\0') { do { if (*param_1 < (uint)piVar4[4]) { piVar3 = (int *)*piVar4; piVar8 = piVar4; } else { piVar3 = (int *)piVar4[2]; } piVar4 = piVar3; } while (*(char *)((int)piVar3 + 0xd) == '\0'); } iVar6 = 0; local_10 = 0; piVar4 = piVar7; if (piVar7 != piVar8) { do { piVar3 = (int *)piVar4[2]; iVar6 = iVar6 + 1; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; while ((piVar4 = piVar5, cVar1 == '\0' && (piVar3 == (int *)piVar4[2]))) { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; } } } while (piVar4 != piVar8); local_10 = iVar6; } param_1 = (uint *)piVar7; if ((piVar7 == (int *)*piVar2) && (*(char *)((int)piVar8 + 0xd) != '\0')) { FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, (_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar7 != piVar8) { do { piVar2 = (int *)param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); operator_delete(ptr,0x1c); } while (param_1 != (uint *)piVar8); return local_10; } return local_10; } //@@ 00914480 FUN_00914480 int FUN_00914480(uint *param_1) { char cVar1; int *piVar2; uint uVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_10; piVar2 = (int *)*in_ECX; piVar5 = (int *)piVar2[1]; piVar4 = piVar5; piVar8 = piVar2; piVar9 = piVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar3 = piVar4[5]; if ((param_1[1] < uVar3) || ((param_1[1] <= uVar3 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar3) && ((param_1[1] < uVar3 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_10 = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar1 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_10 = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar2) && (*(char *)((int)piVar9 + 0xd) != '\0')) { FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, (_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar2 = (int *)param_1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std::_Tree::_Extract(in_ECX,piVar2); operator_delete(ptr,0x20); } while (param_1 != (uint *)piVar9); return local_10; } return local_10; } //@@ 009145f0 KAGE::SmartPointer::reset /* DB: allocates empty ReferenceCount block, releases old one at this+4, ptr=0 (same shape as 00709150) */ void KAGE::SmartPointer::reset(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } in_ECX[1] = this; *in_ECX = 0; ExceptionList = local_10; return; } //@@ 009146a0 FUN_009146a0 undefined4 FUN_009146a0(void) { undefined4 *this; int *this_00; undefined4 *ptr; short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); ptr = (undefined4 *)in_ECX[5]; if (ptr != (undefined4 *)0x0) { *ptr = 0; ptr[1] = 0; FUN_00a5a210(); this = ptr + 6; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(ptr[6] + 4)); operator_delete((void *)*this,0x20); this_00 = ptr + 2; ptr[4] = 0; ptr[5] = 0; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(*this_00 + 4)); operator_delete((void *)*this_00,0x1c); operator_delete(ptr,0x20); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x0091474f. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 00914760 FUN_00914760 void FUN_00914760(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00915c20(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x50) * 0x50; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009147e0 FUN_009147e0 void FUN_009147e0(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x20) { std::vector::_Tidy(); } return; } //@@ 00914810 FUN_00914810 void FUN_00914810(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x18) { std::vector::_Tidy(); } return; } //@@ 00914840 FUN_00914840 void FUN_00914840(void) { FUN_00915be0(); return; } //@@ 009148c0 FUN_009148c0 undefined4 * FUN_009148c0(void *param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; int iVar3; void *pvVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; int iVar8; void *_Dst; void *ptr; int *in_ECX; uint uVar9; uint uVar10; iVar3 = *in_ECX; iVar8 = in_ECX[1] - iVar3 >> 4; if (iVar8 == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar8 + 1; uVar9 = in_ECX[2] - iVar3 >> 4; if (0xfffffff - (uVar9 >> 1) < uVar9) { uVar10 = 0xfffffff; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar10 = uVar1; if (uVar1 <= uVar9) { uVar10 = uVar9; } if (0xfffffff < uVar10) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar10 * 0x10); puVar2 = (undefined4 *)(((int)param_1 - iVar3 & 0xfffffff0U) + (int)_Dst); uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; *puVar2 = *param_2; puVar2[1] = uVar5; puVar2[2] = uVar6; puVar2[3] = uVar7; pvVar4 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar4,in_ECX[1] - (int)pvVar4); } else { memmove(_Dst,pvVar4,(int)param_1 - (int)pvVar4); memmove(puVar2 + 4,param_1,in_ECX[1] - (int)param_1); } pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { uVar9 = in_ECX[2] - (int)pvVar4 & 0xfffffff0; ptr = pvVar4; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar4 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)_Dst; in_ECX[1] = (int)(uVar1 * 0x10 + (int)_Dst); in_ECX[2] = (int)(uVar10 * 0x10 + (int)_Dst); return puVar2; } //@@ 009149f0 FUN_009149f0 undefined4 * FUN_009149f0(int param_1,undefined4 *param_2) { uint uVar1; undefined4 uVar2; int iVar3; undefined4 *puVar4; int *in_ECX; uint uVar5; uint uVar6; undefined4 *puVar7; void *pvVar8; void *pvVar9; undefined4 *puVar10; int iVar11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09ad0; local_10 = ExceptionList; ExceptionList = &local_10; iVar11 = *in_ECX; iVar3 = in_ECX[1] - iVar11 >> 5; if (iVar3 == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar5 = in_ECX[2] - iVar11 >> 5; if (0x7ffffff - (uVar5 >> 1) < uVar5) { uVar6 = 0x7ffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar6 = uVar1; if (uVar1 <= uVar5) { uVar6 = uVar5; } if (0x7ffffff < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = std::_Allocate(uVar6 * 0x20); puVar7 = (undefined4 *)((param_1 - iVar11 & 0xffffffe0U) + (int)puVar4); local_8 = 0; *puVar7 = *param_2; uVar2 = param_2[3]; puVar7[2] = param_2[2]; puVar7[3] = uVar2; puVar7[4] = param_2[4]; FUN_00915d70(param_2 + 5); iVar11 = *in_ECX; puVar10 = puVar4; if (param_1 != in_ECX[1]) { FUN_00915e30(puVar4,iVar11); puVar10 = puVar7 + 8; } FUN_00915e30(puVar10,iVar11); pvVar8 = (void *)*in_ECX; if (pvVar8 != (void *)0x0) { pvVar9 = (void *)in_ECX[1]; if (pvVar8 != pvVar9) { do { std::vector::_Tidy(); pvVar8 = (void *)((int)pvVar8 + 0x20); } while (pvVar8 != pvVar9); pvVar8 = (void *)*in_ECX; } uVar5 = in_ECX[2] - (int)pvVar8 & 0xffffffe0; pvVar9 = pvVar8; if (0xfff < uVar5) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar5); } *in_ECX = (int)puVar4; in_ECX[1] = (int)(puVar4 + uVar1 * 8); in_ECX[2] = (int)(puVar4 + uVar6 * 8); ExceptionList = local_10; return puVar7; } //@@ 00914b68 Catch_All@00914b68 void Catch_All_00914b68(void) { int unaff_EBP; FUN_009147e0(*(undefined4 *)(unaff_EBP + -0x18),*(undefined4 *)(unaff_EBP + -0x18)); FUN_00571230(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00914ba0 FUN_00914ba0 undefined4 * FUN_00914ba0(int param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; int *in_ECX; uint uVar4; uint uVar5; void *pvVar6; void *pvVar7; undefined4 *puVar8; int iVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09af0; local_10 = ExceptionList; ExceptionList = &local_10; iVar9 = *in_ECX; iVar2 = (in_ECX[1] - *in_ECX) / 0x18; if (iVar2 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar5 = (in_ECX[2] - *in_ECX) / 0x18; if (0xaaaaaaa - (uVar5 >> 1) < uVar5) { uVar4 = 0xaaaaaaa; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar4 = iVar2 + 1U; if (iVar2 + 1U <= uVar5) { uVar4 = uVar5; } if (0xaaaaaaa < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar3 = std::_Allocate(uVar4 * 0x18); local_8 = 0; puVar1 = puVar3 + ((param_1 - iVar9) / 0x18) * 6; *puVar1 = *param_2; puVar1[1] = param_2[1]; puVar1[2] = param_2[2]; FUN_00915d70(param_2 + 3); iVar9 = *in_ECX; puVar8 = puVar3; if (param_1 != in_ECX[1]) { FUN_00915eb0(puVar3,iVar9); puVar8 = puVar1 + 6; } FUN_00915eb0(puVar8,iVar9); pvVar6 = (void *)*in_ECX; if (pvVar6 != (void *)0x0) { pvVar7 = (void *)in_ECX[1]; if (pvVar6 != pvVar7) { do { std::vector::_Tidy(); pvVar6 = (void *)((int)pvVar6 + 0x18); } while (pvVar6 != pvVar7); pvVar6 = (void *)*in_ECX; } uVar5 = ((in_ECX[2] - (int)pvVar6) / 0x18) * 0x18; pvVar7 = pvVar6; if (0xfff < uVar5) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar5); } *in_ECX = (int)puVar3; in_ECX[1] = (int)(puVar3 + (iVar2 + 1) * 6); in_ECX[2] = (int)(puVar3 + uVar4 * 6); ExceptionList = local_10; return puVar1; } //@@ 00914d5f Catch_All@00914d5f void Catch_All_00914d5f(void) { int unaff_EBP; FUN_00914810(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + 8)); deallocate(*(void **)(unaff_EBP + -0x18),*(uint *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00914d90 FUN_00914d90 void FUN_00914d90(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00914d90(param_1,param_2[2]); piVar2 = (int *)*param_2; param_2[6] = (int)KAGE::System::UserProfileBase::vftable; operator_delete(param_2,0x30); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00914de0 FUN_00914de0 void FUN_00914de0(undefined4 *param_1) { undefined4 uVar1; void *pvVar2; undefined4 *in_EDX; uVar1 = param_1[1]; *in_EDX = *param_1; in_EDX[1] = uVar1; in_EDX[2] = 0; in_EDX[3] = 0; pvVar2 = operator_new(0x20); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; in_EDX[2] = pvVar2; in_EDX[2] = param_1[2]; param_1[2] = pvVar2; uVar1 = in_EDX[3]; in_EDX[3] = param_1[3]; param_1[3] = uVar1; return; } //@@ 00914e40 std::vector<16byte>::_Emplace_reallocate /* DB: vector grow (max 0xfffffff), 16-byte elements; from NetplayManager::get_drop_entry when the vector at +0x185c is full */ int std::vector<16byte>::_Emplace_reallocate(undefined4 *param_1,undefined4 param_2) { uint uVar1; int *piVar2; char cVar3; undefined4 *puVar4; int iVar5; int *piVar6; int iVar7; undefined4 *puVar8; void *pvVar9; undefined4 uVar10; int *piVar11; void *ptr; int *in_ECX; uint uVar12; int *piVar13; undefined4 *puVar14; int iVar15; undefined4 *puVar16; uint local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09b25; local_10 = ExceptionList; ExceptionList = &local_10; iVar15 = *in_ECX; iVar7 = in_ECX[1] - iVar15 >> 4; if (iVar7 == 0xfffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar7 + 1; uVar12 = in_ECX[2] - iVar15 >> 4; if (0xfffffff - (uVar12 >> 1) < uVar12) { local_1c = 0xfffffff; } else { uVar12 = (uVar12 >> 1) + uVar12; local_1c = uVar1; if (uVar1 <= uVar12) { local_1c = uVar12; } if (0xfffffff < local_1c) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar8 = _Allocate(local_1c << 4); iVar15 = ((int)param_1 - iVar15 & 0xfffffff0U) + (int)puVar8; local_8._0_1_ = 0; local_8._1_3_ = 0; FUN_00914de0(param_2); puVar4 = (undefined4 *)in_ECX[1]; puVar16 = (undefined4 *)*in_ECX; if (param_1 == puVar4) { puVar14 = puVar8; for (; local_8._0_1_ = 1, puVar16 != puVar4; puVar16 = puVar16 + 4) { piVar2 = puVar14 + 2; uVar10 = puVar16[1]; *puVar14 = *puVar16; puVar14[1] = uVar10; *piVar2 = 0; puVar14[3] = 0; pvVar9 = operator_new(0x20); *(void **)pvVar9 = pvVar9; *(void **)((int)pvVar9 + 4) = pvVar9; *(void **)((int)pvVar9 + 8) = pvVar9; *(undefined2 *)((int)pvVar9 + 0xc) = 0x101; *piVar2 = (int)pvVar9; local_8._0_1_ = 2; uVar10 = FUN_00916020(*(undefined4 *)(puVar16[2] + 4),pvVar9,puVar8); *(undefined4 *)(*piVar2 + 4) = uVar10; puVar14[3] = puVar16[3]; piVar11 = (int *)*piVar2; piVar13 = (int *)piVar11[1]; if (*(char *)((int)piVar13 + 0xd) == '\0') { piVar6 = (int *)*piVar13; if (*(char *)(*piVar13 + 0xd) == '\0') { do { piVar13 = piVar6; piVar6 = (int *)*piVar13; } while (*(char *)(*piVar13 + 0xd) == '\0'); piVar11 = (int *)*piVar2; } *piVar11 = (int)piVar13; iVar7 = *(int *)(*piVar2 + 4); iVar5 = *(int *)(iVar7 + 8); cVar3 = *(char *)(iVar5 + 0xd); while (cVar3 == '\0') { cVar3 = *(char *)(*(int *)(iVar5 + 8) + 0xd); iVar7 = iVar5; iVar5 = *(int *)(iVar5 + 8); } *(int *)(*piVar2 + 8) = iVar7; } else { *piVar11 = (int)piVar11; *(int *)(*piVar2 + 8) = *piVar2; } puVar14 = puVar14 + 4; } FUN_00915be0(puVar4); } else { FUN_00915ca0(puVar16,param_1,puVar8); FUN_00915ca0(param_1,in_ECX[1],iVar15 + 0x10); } if (*in_ECX != 0) { FUN_00915be0(*in_ECX); pvVar9 = (void *)*in_ECX; uVar12 = in_ECX[2] - (int)pvVar9 & 0xfffffff0; ptr = pvVar9; if (0xfff < uVar12) { ptr = *(void **)((int)pvVar9 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)pvVar9 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar12); } *in_ECX = (int)puVar8; in_ECX[1] = (int)(puVar8 + uVar1 * 4); in_ECX[2] = (int)(puVar8 + local_1c * 4); ExceptionList = local_10; return iVar15; } //@@ 009150a0 Catch_All@009150a0 void Catch_All_009150a0(void) { int unaff_EBP; FUN_00914840(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x2c)); FUN_005cbf50(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009150d0 std::map::try_emplace /* DB: ? MSVC _Tree insert on u64 key (+0x10/+0x14), max_size 0x11a7b96 (0xe8-byte node) whose value has four KAGE::Filesys::BufferedStream members, i.e. the map NetplayManager::read/write_player_game_states_message walk; callers FUN_0090c740 (x3) and NetplayManager::read_player_game_states_message */ void std::map::try_emplace(undefined4 *param_1,uint *param_2) { int iVar1; int *piVar2; uint uVar3; int *piVar4; int *in_ECX; int *piVar5; int *piVar6; int *local_28; int local_24; int *local_20; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09b83; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_28,param_2); if (*(char *)((int)local_20 + 0xd) == '\0') { if (((uint)local_20[5] <= param_2[1]) && (((uint)local_20[5] < param_2[1] || ((uint)local_20[4] <= *param_2)))) { *(undefined1 *)(param_1 + 1) = 0; goto LAB_0091530e; } } if (in_ECX[1] == 0x11a7b96) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } iVar1 = *in_ECX; local_8 = 0; local_18 = (int *)0x0; piVar4 = operator_new(0xe8); local_8 = 1; uVar3 = param_2[1]; piVar4[4] = *param_2; piVar4[5] = uVar3; local_18 = piVar4; memset(piVar4 + 6,0,0xd0); piVar4[6] = 0x29; piVar4[7] = 0; KAGE::Filesys::BufferedStream::BufferedStream(piVar4 + 8,0); local_14 = piVar4 + 0x13; local_8._0_1_ = 2; *local_14 = 0x29; piVar4[0x14] = 0; KAGE::Filesys::BufferedStream::BufferedStream(piVar4 + 0x15,0); local_14 = piVar4 + 0x20; local_8._0_1_ = 3; *local_14 = 0x29; piVar4[0x21] = 0; KAGE::Filesys::BufferedStream::BufferedStream(piVar4 + 0x22,0); local_14 = piVar4 + 0x2d; local_8 = CONCAT31(local_8._1_3_,4); *local_14 = 0x29; piVar4[0x2e] = 0; KAGE::Filesys::BufferedStream::BufferedStream(piVar4 + 0x2f,0); *local_18 = iVar1; local_18[1] = iVar1; local_18[2] = iVar1; *(undefined2 *)(local_18 + 3) = 0; in_ECX[1] = in_ECX[1] + 1; piVar4 = (int *)*in_ECX; local_18[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)local_18; piVar4[1] = (int)local_18; piVar4[2] = (int)local_18; *(undefined1 *)(local_18 + 3) = 1; } else { if (local_24 == 0) { local_28[2] = (int)local_18; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)local_18; } } else { *local_28 = (int)local_18; if (local_28 == (int *)*piVar4) { *piVar4 = (int)local_18; } } piVar6 = local_18; if (*(char *)(local_18[1] + 0xc) == '\0') { do { piVar2 = (int *)piVar6[1]; piVar5 = *(int **)piVar2[1]; if (piVar2 == piVar5) { piVar5 = (int *)((undefined4 *)piVar2[1])[2]; if ((char)piVar5[3] == '\0') goto LAB_009152aa; if (piVar6 == (int *)piVar2[2]) { FUN_00415fe0(piVar2); piVar6 = piVar2; } *(undefined1 *)(piVar6[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar6[1] + 4)); } else if ((char)piVar5[3] == '\0') { LAB_009152aa: *(undefined1 *)(piVar2 + 3) = 1; *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; piVar6 = *(int **)(piVar6[1] + 4); } else { if (piVar6 == (int *)*piVar2) { FUN_00415f80(piVar2); piVar6 = piVar2; } *(undefined1 *)(piVar6[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar6[1] + 4)); } } while (*(char *)(piVar6[1] + 0xc) == '\0'); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; local_20 = local_18; LAB_0091530e: *param_1 = local_20; ExceptionList = local_10; return; } //@@ 00915330 std::map::destroy_subtree /* DB: ? recursive erase of 0xe8-byte nodes each holding four BufferedStreams; NetplayManager::reset and destructor */ void std::map::destroy_subtree(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { destroy_subtree(param_1,param_2[2]); piVar2 = (int *)*param_2; param_2[0x33] = param_2[0x32]; param_2[0x39] = (int)KAGE::Filesys::StreamBase::vftable; param_2[0x2f] = (int)KAGE::Filesys::BufferedStreamBase::vftable; param_2[0x30] = 0; param_2[0x31] = 0; param_2[0x33] = param_2[0x32]; param_2[0x35] = 0; param_2[0x36] = 0; param_2[0x37] = 0; param_2[0x38] = 0; FUN_007dcd30(); param_2[0x26] = param_2[0x25]; param_2[0x2c] = (int)KAGE::Filesys::StreamBase::vftable; param_2[0x22] = (int)KAGE::Filesys::BufferedStreamBase::vftable; param_2[0x23] = 0; param_2[0x24] = 0; param_2[0x26] = param_2[0x25]; param_2[0x28] = 0; param_2[0x29] = 0; param_2[0x2a] = 0; param_2[0x2b] = 0; FUN_007dcd30(); param_2[0x19] = param_2[0x18]; param_2[0x1f] = (int)KAGE::Filesys::StreamBase::vftable; param_2[0x15] = (int)KAGE::Filesys::BufferedStreamBase::vftable; param_2[0x16] = 0; param_2[0x17] = 0; param_2[0x19] = param_2[0x18]; param_2[0x1b] = 0; param_2[0x1c] = 0; param_2[0x1d] = 0; param_2[0x1e] = 0; FUN_007dcd30(); param_2[0xc] = param_2[0xb]; param_2[0x12] = (int)KAGE::Filesys::StreamBase::vftable; param_2[8] = (int)KAGE::Filesys::BufferedStreamBase::vftable; param_2[9] = 0; param_2[10] = 0; param_2[0xc] = param_2[0xb]; param_2[0xe] = 0; param_2[0xf] = 0; param_2[0x10] = 0; param_2[0x11] = 0; FUN_007dcd30(); operator_delete(param_2,0xe8); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 009154f0 FUN_009154f0 void FUN_009154f0(int *param_1,uint *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09bb5; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_24,param_2); if (*(char *)(local_1c + 0xd) == '\0') { if ((*(uint *)(local_1c + 0x14) <= param_2[1]) && ((*(uint *)(local_1c + 0x14) < param_2[1] || (*(uint *)(local_1c + 0x10) <= *param_2)))) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0x1059ee) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = (int *)0x0; piVar6 = operator_new(0xfa8); local_8 = 1; uVar5 = param_2[1]; piVar6[4] = *param_2; piVar6[5] = uVar5; local_14 = piVar6; PersistentGameData::constructor((PersistentGameData *)(piVar6 + 6)); *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_00915652: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_00915652; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 009156e0 FUN_009156e0 void FUN_009156e0(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; void **ppvVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar1 = *(char *)((int)param_2 + 0xd); ppvVar3 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar3, cVar1 == '\0') { FUN_009156e0(param_1,param_2[2]); piVar2 = (int *)*param_2; local_8 = 0; if ((undefined4 *)param_2[7] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)param_2[7])(1,uVar4); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)(param_2 + 0x3df)); std::string::_Tidy_deallocate((char *)(param_2 + 0xe)); std::string::_Tidy_deallocate((char *)(param_2 + 8)); local_8 = 0xffffffff; operator_delete(param_2,0xfa8); ppvVar3 = ExceptionList; param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } ExceptionList = local_10; return; } //@@ 00915790 std::map::try_emplace /* DB: lower_bound then inserts a 0x1c-byte node {key +0x10, two zero dwords} (max 0x9249249); NetplayManager frame snapshot map (try_advance_frame, 0090d640) */ void std::map::try_emplace(int *param_1,uint *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09bed; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x1c); piVar6[4] = *param_2; piVar6[5] = 0; piVar6[6] = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_009158db: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_009158db; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00915960 FUN_00915960 void FUN_00915960(int *param_1,uint *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07f0d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_24,param_2); if (*(char *)(local_1c + 0xd) == '\0') { if ((*(uint *)(local_1c + 0x14) <= param_2[1]) && ((*(uint *)(local_1c + 0x14) < param_2[1] || (*(uint *)(local_1c + 0x10) <= *param_2)))) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x20); uVar5 = param_2[1]; piVar6[4] = *param_2; piVar6[5] = uVar5; *(undefined1 *)(piVar6 + 6) = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_00915ab1: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_00915ab1; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00915b40 FUN_00915b40 void FUN_00915b40(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 00915be0 FUN_00915be0 void FUN_00915be0(void) { int *piVar1; int *in_ECX; int *in_EDX; int *this; if (in_ECX != in_EDX) { this = in_ECX + 2; do { FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x20); piVar1 = this + 2; this = this + 4; } while (piVar1 != in_EDX); } return; } //@@ 00915c20 FUN_00915c20 void FUN_00915c20(void) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar2; if (in_ECX != in_EDX) { puVar2 = in_ECX + 0xb; do { puVar2[7] = KAGE::Filesys::StreamBase::vftable; puVar2[-3] = KAGE::Filesys::BufferedStreamBase::vftable; puVar2[-2] = 0; puVar2[-1] = 0; puVar2[1] = *puVar2; puVar2[3] = 0; puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0; FUN_007dcd30(); puVar1 = puVar2 + 9; puVar2 = puVar2 + 0x14; } while (puVar1 != in_EDX); } return; } //@@ 00915c90 FUN_00915c90 void FUN_00915c90(void) { void *pvVar1; int *piVar2; uint size; undefined4 *in_ECX; void *ptr; piVar2 = (int *)*in_ECX; if (piVar2 == (int *)0x0) { return; } if (*piVar2 != 0) { FUN_00915c20(*piVar2); pvVar1 = (void *)*piVar2; size = ((piVar2[2] - (int)pvVar1) / 0x50) * 0x50; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *piVar2 = 0; piVar2[1] = 0; piVar2[2] = 0; } return; } //@@ 00915ca0 FUN_00915ca0 undefined4 * FUN_00915ca0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 uVar2; uint uVar3; void *pvVar4; undefined4 in_ECX; undefined4 *puVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b09c1d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (param_1 != param_2) { puVar5 = param_1 + 2; do { uVar2 = puVar5[-1]; *param_3 = puVar5[-2]; param_3[1] = uVar2; param_3[2] = 0; param_3[3] = 0; pvVar4 = operator_new(0x20); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; *(undefined2 *)((int)pvVar4 + 0xc) = 0x101; param_3[2] = pvVar4; param_3[2] = *puVar5; *puVar5 = pvVar4; in_ECX = param_3[3]; param_3[3] = puVar5[1]; param_3 = param_3 + 4; puVar5[1] = in_ECX; puVar1 = puVar5 + 2; puVar5 = puVar5 + 4; } while (puVar1 != param_2); } FUN_00915be0(in_ECX,uVar3); ExceptionList = local_10; return param_3; } //@@ 00915d70 FUN_00915d70 void FUN_00915d70(undefined4 *param_1) { void *_Src; size_t _Size; uint uVar1; void *_Dst; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; _Src = (void *)*param_1; if (_Src != (void *)param_1[1]) { _Size = (int)param_1[1] - (int)_Src; uVar1 = (int)_Size >> 3; if (0x1fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar1 = uVar1 * 8; _Dst = std::_Allocate(uVar1); *in_ECX = _Dst; in_ECX[1] = _Dst; in_ECX[2] = (void *)(uVar1 + (int)_Dst); memmove(_Dst,_Src,_Size); in_ECX[1] = (void *)(uVar1 + (int)_Dst); } return; } //@@ 00915df0 FUN_00915df0 void FUN_00915df0(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0xfa8); } return; } //@@ 00915e10 FUN_00915e10 void FUN_00915e10(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0xe8); } return; } //@@ 00915e30 FUN_00915e30 undefined4 * FUN_00915e30(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 6; do { *puVar6 = puVar5[-6]; uVar2 = puVar5[-4]; puVar6[3] = puVar5[-3]; puVar6[2] = uVar2; puVar6[4] = puVar5[-2]; uVar2 = *puVar5; uVar3 = puVar5[1]; uVar4 = puVar5[-1]; puVar5[1] = 0; *puVar5 = 0; puVar5[-1] = 0; *(undefined4 *)((int)param_1 + (-0x20 - (int)in_ECX) + (int)(puVar5 + 8)) = uVar2; puVar1 = puVar5 + 2; puVar6[5] = uVar4; puVar6[7] = uVar3; puVar6 = puVar6 + 8; puVar5 = puVar5 + 8; } while (puVar1 != in_EDX); } return puVar6; } //@@ 00915eb0 FUN_00915eb0 undefined4 * FUN_00915eb0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 4; do { *puVar6 = puVar5[-4]; puVar6[1] = puVar5[-3]; puVar6[2] = puVar5[-2]; uVar2 = *puVar5; uVar3 = puVar5[1]; uVar4 = puVar5[-1]; puVar5[1] = 0; *puVar5 = 0; puVar5[-1] = 0; *(undefined4 *)((int)param_1 + (-0x18 - (int)in_ECX) + (int)(puVar5 + 6)) = uVar2; puVar1 = puVar5 + 2; puVar6[3] = uVar4; puVar6[5] = uVar3; puVar6 = puVar6 + 6; puVar5 = puVar5 + 6; } while (puVar1 != in_EDX); } return puVar6; } //@@ 00915f20 FUN_00915f20 void FUN_00915f20(void) { FUN_00a58200(); return; } //@@ 00915f30 FUN_00915f30 void FUN_00915f30(void) { FUN_00915be0(); return; } //@@ 00915f40 FUN_00915f40 void FUN_00915f40(void) { FUN_00915c20(); return; } //@@ 00915f50 std::vector::_Clear_and_reserve /* DB: frees the byte buffer and allocates exactly max(n, 1.5*cap) (max 0x7fffffff); BufferedStream copy 0090d360, Entity_Familiar::RestoreState */ void std::vector::_Clear_and_reserve(uint param_1) { void *pvVar1; int *in_ECX; uint size; void *ptr; uint size_00; if (0x7fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1; if (0x7fffffff - (size >> 1) < size) { size_00 = 0x7fffffff; } else { size_00 = (size >> 1) + size; if (size_00 < param_1) { size_00 = param_1; } } if (pvVar1 != (void *)0x0) { ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } pvVar1 = _Allocate(size_00); *in_ECX = (int)pvVar1; in_ECX[1] = (int)pvVar1; in_ECX[2] = (int)pvVar1 + size_00; return; } //@@ 00915ff0 FUN_00915ff0 void FUN_00915ff0(void) { int *this; undefined4 *in_ECX; this = (int *)in_ECX[1]; if (this != (int *)0x0) { FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)*in_ECX, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x20); } return; } //@@ 00916020 FUN_00916020 int * FUN_00916020(undefined4 *param_1,int param_2,undefined4 param_3) { int iVar1; int iVar2; int *piVar3; int iVar4; int *piVar5; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b09c4d; local_10 = ExceptionList; ExceptionList = &local_10; piVar5 = (int *)*in_ECX; if (*(char *)((int)param_1 + 0xd) == '\0') { local_8 = 0; piVar3 = operator_new(0x20); iVar4 = param_1[5]; iVar1 = param_1[6]; iVar2 = param_1[7]; piVar3[4] = param_1[4]; piVar3[5] = iVar4; piVar3[6] = iVar1; piVar3[7] = iVar2; *piVar3 = (int)piVar5; piVar3[2] = (int)piVar5; *(undefined2 *)(piVar3 + 3) = 0; piVar3[1] = param_2; *(undefined1 *)(piVar3 + 3) = *(undefined1 *)(param_1 + 3); local_8 = 1; if (*(char *)((int)piVar5 + 0xd) != '\0') { piVar5 = piVar3; } iVar4 = FUN_00916020(*param_1,piVar3,param_3); *piVar3 = iVar4; iVar4 = FUN_00916020(param_1[2],piVar3,param_3); piVar3[2] = iVar4; } ExceptionList = local_10; return piVar5; } //@@ 009160ee Catch_All@009160ee void Catch_All_009160ee(void) { fuzzer_allocator_> *pfVar1; void *this; int unaff_EBP; _Tree_node *p_Var2; p_Var2 = *(_Tree_node **)(unaff_EBP + 0xc); pfVar1 = (fuzzer_allocator_> *)Config::GetCollectibles(); FID_conflict__Erase_tree_>_> (this,pfVar1,p_Var2); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00916110 NetplayManager::send_remove_frame /* DB: ? (userId): writes {0, id, 0} plus the player's (+0x3ac) 16-byte entries to a stream, NetConnection::send_message type 6, NetplayManager::send_message(8); NetplayManager::update_player_removal */ void NetplayManager::send_remove_frame(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; Manager *pMVar4; char cVar5; uint uVar6; undefined4 *puVar7; undefined4 *puVar8; void *pvVar9; Entity_Player *message; undefined1 *messageRefCount; undefined **local_80; void *local_7c; undefined4 local_78; void *local_74; void *local_70; void *local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined **local_58; void *local_54; undefined4 *local_50; undefined4 *local_4c; undefined1 local_48 [4]; int *local_44; undefined4 local_40; Entity_Player *local_3c; undefined4 *local_34; float local_30; void *local_2c; undefined4 *local_28; undefined1 local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_48 + 0x44; local_14 = 0xffffffff; puStack_18 = &LAB_00b09c8d; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_48 + 0x38); ExceptionList = &local_1c; KAGE::Filesys::BufferedStream::BufferedStream(&local_80,0); local_14 = 0; local_34 = (undefined4 *)0x0; (*(code *)local_58[7])(&local_34,4,1,uVar6); local_3c = (Entity_Player *)param_2; local_40 = param_1; (*(code *)local_58[7])(&local_40,8,1); (*(code *)local_58[7])(&local_34,4,1); local_3c = PlayerManager::get_player_by_user_id ((PlayerManager *)&g_manager->_netplayManager,(ulonglong *)¶m_1); puVar8 = (undefined4 *)0x0; local_2c = (void *)0x0; puVar7 = (undefined4 *)0x0; local_54 = (void *)0x0; local_50 = (undefined4 *)0x0; local_34 = (undefined4 *)0x0; local_4c = (undefined4 *)0x0; local_14 = CONCAT31(local_14._1_3_,1); if ((local_3c != (Entity_Player *)0x0) && (local_30 = *(float *)local_3c->_slowingAmount, (int *)local_30 != (int *)local_3c->_slowingAmount)) { do { if (puVar7 == puVar8) { std::vector<16byte>::_Emplace_reallocate(puVar7,(undefined4 *)((int)local_30 + 0x14)); local_28 = local_50; puVar8 = local_4c; } else { uVar1 = *(undefined4 *)((int)local_30 + 0x18); uVar2 = *(undefined4 *)((int)local_30 + 0x1c); uVar3 = *(undefined4 *)((int)local_30 + 0x20); *puVar7 = *(undefined4 *)((int)local_30 + 0x14); puVar7[1] = uVar1; puVar7[2] = uVar2; puVar7[3] = uVar3; local_28 = puVar7 + 4; } local_50 = local_28; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_30); puVar7 = local_28; } while (local_30 != local_3c->_slowingAmount); local_2c = local_54; local_34 = puVar8; } puVar8 = local_34; local_28 = (undefined4 *)((int)puVar7 - (int)local_2c >> 4); local_21 = SUB41(local_28,0); local_54 = local_2c; (*(code *)local_58[7])(&local_21,1,1); puVar7 = local_28; local_30 = 0.0; if (local_28 != (undefined4 *)0x0) { pvVar9 = local_2c; do { buffered_stream_write(&local_58,pvVar9,0x10,1); pvVar9 = (void *)((int)pvVar9 + 0x10); local_30 = (float)((int)local_30 + 1); } while ((uint)local_30 < puVar7); puVar8 = local_34; } local_3c = local_7c; pvVar9 = local_74; if (local_68 != (void *)0x0) { pvVar9 = local_68; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = &DAT_00000006; message = local_3c; NetConnection::send_message(g_multiplayerService,local_48,1,pvVar9,(uint)local_3c,6); pMVar4 = g_manager; local_14._0_1_ = 2; FUN_008ef1d0(local_48); send_message(&pMVar4->_netplayManager,8,message,messageRefCount); local_14 = CONCAT31(local_14._1_3_,3); if (((local_44 != (int *)0x0) && (cVar5 = (**(code **)(*local_44 + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_48); } if (local_2c != (void *)0x0) { uVar6 = (int)puVar8 - (int)local_2c & 0xfffffff0; pvVar9 = local_2c; if (0xfff < uVar6) { pvVar9 = *(void **)((int)local_2c + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)local_2c + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar6); } local_58 = KAGE::Filesys::StreamBase::vftable; local_80 = KAGE::Filesys::BufferedStreamBase::vftable; local_7c = (void *)0x0; local_78 = 0; local_70 = local_74; local_68 = (void *)0x0; local_64 = 0; local_60 = 0; local_5c = 0; FUN_007dcd30(); ExceptionList = local_1c; return; } //@@ 009163b0 RemovePlayerMessage::read /* WARNING: Removing unreachable block (ram,0x009165e0) */ /* WARNING: Removing unreachable block (ram,0x009165ef) */ /* WARNING: Removing unreachable block (ram,0x009165ff) */ /* WARNING: Removing unreachable block (ram,0x00916605) */ /* DB: ? deserializes a consolidated remove message (memory_stream_read: int type, u64 user, int frame, byte count, count*16 bytes) into ECX; NetplayManager::update_player_removal before logging MSG_REMOVE_FRAME */ void RemovePlayerMessage::read(int param_1,int *param_2) { char cVar1; uint uVar2; int iVar3; undefined4 *in_ECX; uint uVar4; undefined **local_20; undefined8 local_1c; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b09cc5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (*(int *)(param_1 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } if (*(int *)(param_1 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } local_20 = KAGE::Filesys::BufferedStream::vftable; local_8 = CONCAT31(local_8._1_3_,1); local_1c = (ulonglong)(uint)local_1c; memory_stream_read(&local_20,(void *)((int)&local_1c + 4),4,1); *in_ECX = local_1c._4_4_; local_1c = 0; if ((code *)local_20[5] == memory_stream_read) { memory_stream_read(&local_20,&local_1c,8,1); } else { (*(code *)local_20[5])(&local_1c,8,1,uVar2); } in_ECX[2] = (uint)local_1c; in_ECX[3] = local_1c._4_4_; local_1c = local_1c & 0xffffffff; if ((code *)local_20[5] == memory_stream_read) { memory_stream_read(&local_20,(void *)((int)&local_1c + 4),4,1); } else { (*(code *)local_20[5])((int)&local_1c + 4); } in_ECX[4] = local_1c._4_4_; local_11 = 0; if ((code *)local_20[5] == memory_stream_read) { memory_stream_read(&local_20,&local_11,1,1); } else { (*(code *)local_20[5])(&local_11); } iVar3 = in_ECX[5]; uVar4 = (uint)local_11; uVar2 = in_ECX[6] - iVar3 >> 4; if (uVar4 < uVar2) { iVar3 = uVar4 * 0x10 + iVar3; } else { if (uVar4 <= uVar2) goto LAB_00916573; if ((uint)(in_ECX[7] - iVar3 >> 4) < uVar4) { FUN_009166b0(uVar4,(int)&local_1c + 4); goto LAB_00916573; } iVar3 = FUN_00916670(in_ECX[6],uVar4 - uVar2,local_1c._4_4_); } in_ECX[6] = iVar3; LAB_00916573: if (uVar4 != 0) { iVar3 = 0; do { memory_stream_read(&local_20,(void *)(in_ECX[5] + iVar3),0x10,1); iVar3 = iVar3 + 0x10; uVar4 = uVar4 - 1; } while (uVar4 != 0); } local_20 = KAGE::Filesys::StreamBase::vftable; local_8 = 2; if (((param_2 != (int *)0x0) && (cVar1 = (**(code **)(*param_2 + 0xc))(), cVar1 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } ExceptionList = local_10; return; } //@@ 00916670 FUN_00916670 void FUN_00916670(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0x7fff0000; param_1[2] = 0x7fff7fff; param_1[3] = 0x3c7fff; param_1 = param_1 + 4; } return; } //@@ 009166b0 FUN_009166b0 void FUN_009166b0(uint param_1,undefined1 *param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; int *in_ECX; uint uVar8; int iVar9; if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar9 = in_ECX[1] - *in_ECX >> 4; uVar8 = in_ECX[2] - *in_ECX >> 4; if (0xfffffff - (uVar8 >> 1) < uVar8) { uVar8 = 0xfffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; if (uVar8 < param_1) { uVar8 = param_1; } else if (0xfffffff < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = std::_Allocate(uVar8 << 4); FUN_00916670(puVar6 + iVar9 * 4,param_1 - iVar9,*param_2); puVar1 = (undefined4 *)in_ECX[1]; puVar5 = puVar6; for (puVar7 = (undefined4 *)*in_ECX; puVar7 != puVar1; puVar7 = puVar7 + 4) { uVar2 = puVar7[1]; uVar3 = puVar7[2]; uVar4 = puVar7[3]; *puVar5 = *puVar7; puVar5[1] = uVar2; puVar5[2] = uVar3; puVar5[3] = uVar4; puVar5 = puVar5 + 4; } FUN_007de290(puVar6,param_1,uVar8); return; } //@@ 00916770 NetplayManager::process_lobby_messages /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? NetplayManager::Update: receives channel-0 consolidated messages, resolves the sender UserProfile (find_or_create, load_steam_avatar) and logs "[Frame %d] Received %s message from user %s [%llu]" with the type name table 00b240f4 (Player Info, Seed Info, Save Data, Save Data Request, Join New Game, Join Existing Game, Run Status, Report Game States); stores received save data via 0090c2d0 */ void NetplayManager::process_lobby_messages(void) { Manager *pMVar1; MenuManager *pMVar2; ulonglong *puVar3; ulonglong *puVar4; char *pcVar5; char cVar6; int extraout_EAX; void *pvVar7; int *piVar8; int extraout_EAX_00; undefined4 uVar9; Manager *pMVar10; int extraout_EAX_01; int iVar11; undefined1 *puVar12; Manager *pMVar13; undefined1 uStack_f0; undefined4 uStack_e8; void *pvStack_e4; Manager *pMStack_e0; void *pvStack_dc; NetplayManager local_d8; int local_d4; int local_d0; void *local_cc; int local_c8; undefined4 local_c4; void *local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; undefined **local_b0; undefined **local_ac [2]; ulonglong *local_a4; int *piStack_a0; Manager *pMStack_9c; undefined1 auStack_98 [4]; Manager *local_94; Manager *local_90; Manager *local_8c; undefined8 uStack_88; char *local_80; byte bStack_79; undefined1 auStack_78 [84]; uint local_24; byte *pbStack_20; void *local_1c; undefined1 *puStack_18; byte local_14 [4]; pbStack_20 = local_14 + 0x10; local_14[0] = 0xff; local_14[1] = 0xff; local_14[2] = 0xff; local_14[3] = 0xff; puStack_18 = &LAB_00b09d5f; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_14 + 4); ExceptionList = &local_1c; cVar6 = FUN_00a29b10(0); if (cVar6 == '\0') { ExceptionList = local_1c; return; } if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_a4,0,1); } puVar3 = local_a4; local_14[0] = 0; local_14[1] = 0; local_14[2] = 0; local_14[3] = 0; local_90 = *(Manager **)local_a4; local_8c = *(Manager **)((int)local_a4 + 4); if (*(int *)((int)local_a4 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } puVar4 = local_a4; local_80 = (char *)(*(int *)(**(int **)(puVar3 + 1) + 0x14) + 8); if (*(int *)((int)local_a4 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } puVar3 = local_a4; iVar11 = *(int *)(**(int **)(puVar4 + 1) + 0x18) + -8; if (*(int *)((int)local_a4 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } pMVar13 = local_8c; local_c0 = (void *)(*(int *)(**(int **)(puVar3 + 1) + 0x14) + 8); local_cc = (void *)0x0; local_c4._0_1_ = 0; local_c4._1_1_ = 0; local_c4._2_1_ = 0; local_c4._3_1_ = 0; local_b4 = 0; local_b8 = 0; local_bc = 0; local_c8 = 0; local_d8 = (NetplayManager)KAGE::Filesys::BufferedStream::vftable; local_b0 = KAGE::Filesys::BufferedStream::vftable; local_14[0] = 1; local_94 = local_90; local_ac[0] = KAGE::System::UserProfileBase::vftable; local_d4 = iVar11; local_d0 = iVar11; UserProfile::find_or_create(&local_90); local_14[0] = 2; local_ac[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_ac); } local_14[0] = 3; (*(code *)local_ac[0][1])(); pcVar5 = local_80; pMVar10 = local_94; KAGE_LogMessage(1,(byte *)"[Frame %d] Received %s message from user %s [%llu]\n"); pMVar2 = g_menuManager; pMVar1 = g_manager; local_14[0] = 1; local_ac[0] = KAGE::System::UserProfileBase::vftable; switch(*pcVar5) { case '\0': if (g_menuManager == (MenuManager *)0x0) { local_94 = g_manager; for (pvVar7 = (g_manager->_lobbyMembers)._begin; pvVar7 != (g_manager->_lobbyMembers)._end; pvVar7 = (void *)((int)pvVar7 + 0x14)) { iVar11 = *(int *)((int)pvVar7 + 4); if (iVar11 == 0) { uStack_88 = 0; uStack_88._4_4_ = (Manager *)0x0; uStack_88._0_4_ = (Manager *)0x0; pMVar13 = uStack_88._4_4_; pMVar10 = (Manager *)uStack_88; } else { pMVar13 = *(Manager **)(iVar11 + 0xc); pMVar10 = *(Manager **)(iVar11 + 8); } if ((pMVar10 == local_90) && (pMVar13 == local_8c)) goto LAB_00916ee3; } puVar12 = &g_manager[1]._gamestate.field_0x8bc; piVar8 = (int *)FUN_008fd870(&pMStack_9c,&local_90); if (*piVar8 == *(int *)puVar12) { if ((local_80[1] & 2U) == 0) goto LAB_00916ee3; KAGE_LogMessage(1,(byte *)"[Frame %d] Adding pending join for player %llu \n"); func_0x008e74a0(); local_14[0] = 4; uStack_88._0_4_ = (Manager *)KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&local_90); local_14[0] = 5; uStack_88 = CONCAT44(extraout_EAX_00,KAGE::System::UserProfile::vftable); iVar11 = extraout_EAX_00; if (((extraout_EAX_00 != 0) && (iVar11 = extraout_EAX_00, *(int *)(extraout_EAX_00 + 8) != 0 || *(int *)(extraout_EAX_00 + 0xc) != 0)) && (iVar11 = extraout_EAX_00, *(int *)(extraout_EAX_00 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&uStack_88); iVar11 = (int)uStack_88._4_4_; } local_14[0] = 4; uVar9 = FUN_00949b90(); pMVar13 = (Manager *)&local_90; pMVar10 = (Manager *)&pvStack_e4; FUN_00731ee0(pMVar10,pMVar13); if (((*(char *)((int)pvStack_dc + 0xd) != '\0') || (local_8c < *(Manager **)((int)pvStack_dc + 0x14))) || ((local_8c <= *(Manager **)((int)pvStack_dc + 0x14) && (local_90 < *(Manager **)((int)pvStack_dc + 0x10))))) { if (*(int *)&pMVar1[1]._gamestate.field_0x8c0 == 0x5555555) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } pMVar10 = *(Manager **)puVar12; local_14[0] = 6; uStack_88 = ZEXT48(&local_94[1]._gamestate.field_0x8bc); pMVar13 = operator_new(0x30); pMVar13->_currentSaveSlot = (int)local_90; *(Manager **)&pMVar13->_persistentGameData = local_8c; *(undefined4 *)&(pMVar13->_persistentGameData).field_0x8 = 0; (pMVar13->_persistentGameData)._saveFile = KAGE::System::UserProfile::vftable; (pMVar13->_persistentGameData).field_0xc = 0; *(undefined4 *)&(pMVar13->_persistentGameData).field_0x10 = 0; *(undefined4 *)&(pMVar13->_persistentGameData).field_0x14 = 5; *(Manager **)pMVar13 = pMVar10; *(Manager **)&pMVar13->field_0x4 = pMVar10; pMVar13->_state = (int)pMVar10; *(undefined2 *)&pMVar13->_previousState = 0; pvStack_dc = std::_Tree::_Insert_node (&local_94[1]._gamestate.field_0x8bc,pvStack_e4,(int)pMStack_e0, pMVar13); pMVar10 = pMStack_e0; } *(undefined1 *)((int)pvStack_dc + 0x20) = uStack_f0; *(int *)((int)pvStack_dc + 0x1c) = iVar11; *(undefined4 *)((int)pvStack_dc + 0x24) = uVar9; *(undefined4 *)((int)pvStack_dc + 0x28) = uStack_e8; local_14[0] = 1; } else { if ((local_80[1] & 2U) != 0) goto LAB_00916ee3; pMVar13 = (Manager *)&local_90; pMVar10 = (Manager *)0x916a2f; FUN_00913c80(pMVar13); } break; } goto LAB_00916ec7; case '\x02': FUN_009193b0(); local_14[0] = 7; bStack_79 = 0; if ((code *)local_b0[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_d8,&bStack_79,1,1); } else { (*(code *)local_b0[5])(&bStack_79); } if (bStack_79 != 2) { KAGE_LogMessage(0x10,(byte *)"Specified data is not a report save data message\n"); } local_80 = (char *)0x0; if ((code *)local_b0[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_d8,&local_80,4,1); } else { (*(code *)local_b0[5])(&local_80); } if ((code *)local_b0[2] != FUN_00a58260) { (*(code *)local_b0[2])(); } FUN_0091ad50(auStack_78); uStack_88 = *local_a4; pMVar10 = (Manager *)&uStack_88; FUN_0090c2d0(pMVar10,auStack_78); local_14[0] = 1; pMVar13 = (Manager *)0x916cbb; FUN_00a58200(); break; case '\x03': pMVar10 = (Manager *)(**(code **)(*(int *)&g_manager[1]._gamestate.field_0x6c + 4))(); iVar11 = *(int *)&pMVar1[1]._gamestate.field_0x5c; if (iVar11 == 0) { iVar11 = *(int *)&pMVar1[1]._gamestate.field_0x50; } FUN_00a296e0(auStack_98,1,iVar11,pMVar10,0); local_14[0] = 8; uStack_88._0_4_ = (Manager *)KAGE::System::UserProfileBase::vftable; puVar12 = (undefined1 *)0x916d0c; UserProfile::find_or_create(&local_90); local_14[0] = 9; uStack_88 = CONCAT44(extraout_EAX_01,KAGE::System::UserProfile::vftable); if (((extraout_EAX_01 != 0) && (*(int *)(extraout_EAX_01 + 8) != 0 || *(int *)(extraout_EAX_01 + 0xc) != 0)) && (*(int *)(extraout_EAX_01 + 0x14) == 0)) { puVar12 = &LAB_00916d34; KAGE::System::UserProfile::load_steam_avatar(&uStack_88); } local_14[0] = 10; FUN_008ef1d0(auStack_98); multiplayer_send_message(&uStack_88,pMVar10,puVar12); local_14[0] = 1; pMVar13 = (Manager *)0x916d61; FUN_00708d40(); break; case '\x04': case '\x05': pMStack_9c = (Manager *)CONCAT31(pMStack_9c._1_3_,*pcVar5 == '\x04'); if (g_menuManager == (MenuManager *)0x0) { pMVar10 = (Manager *)&local_d8; pMVar13 = pMStack_9c; FUN_0090ca40(pMVar10,pMStack_9c); } else { KAGE_LogMessage(1,(byte *)"Menu_OnlineLobby::notify_game_start() \n"); puVar12 = &pMVar2->field_0xe370; pMVar2->field_0xe3b0 = 1; if (*(int *)puVar12 != -1) { local_80 = (char *)0xffffffff; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0,(int *)puVar12,(int *)&local_80); *(undefined4 *)puVar12 = 0xffffffff; } if (*(int *)&pMVar2->field_0xe374 != -1) { local_94 = (Manager *)0xffffffff; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0,(int *)&pMVar2->field_0xe374, (int *)&local_94); *(undefined4 *)&pMVar2->field_0xe374 = 0xffffffff; } if (*(int *)&pMVar2->field_0xe378 != -1) { pMStack_9c = (Manager *)0xffffffff; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0,(int *)&pMVar2->field_0xe378, (int *)&pMStack_9c); *(undefined4 *)&pMVar2->field_0xe378 = 0xffffffff; } FUN_0090ca40(&local_d8,1); DAT_00c7ac68 = 1; Menu_Character::Reset(&g_menuManager->_menuCharacter); iVar11 = *(int *)&pMVar2->field_0xe37c; pMVar10 = (Manager *)&pMVar2->field_0xe37c; DAT_00c7ac68 = 0; pMVar13 = *(Manager **)(iVar11 + 4); FUN_008ef400(pMVar10,pMVar13); *(int *)(iVar11 + 4) = iVar11; *(int *)iVar11 = iVar11; *(int *)(iVar11 + 8) = iVar11; *(undefined4 *)&pMVar2->field_0xe380 = 0; } break; case '\a': pMVar13 = (Manager *)0x916ebd; read_player_game_states_message(&local_d8); } if (g_menuManager != (MenuManager *)0x0) { LAB_00916ec7: FUN_008ef1d0(&local_a4); FUN_008ea6e0(pMVar10,pMVar13); } LAB_00916ee3: FUN_00a58200(); local_14[0] = 0xb; local_14[1] = 0; local_14[2] = 0; local_14[3] = 0; if (((piStack_a0 != (int *)0x0) && (cVar6 = (**(code **)(*piStack_a0 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_a4); } ExceptionList = local_1c; return; } //@@ 00916f70 FUN_00916f70 void FUN_00916f70(undefined4 param_1,undefined4 param_2,void *param_3,char param_4) { uint uVar1; void *ptr; int *in_ECX; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = 0; ptr = PersistentGameDataWriter::compress(param_3,&local_14); (**(code **)(*in_ECX + 4))(0,0xffffffff,uVar1); if (((g_game == (Game *)0x0) || (g_game->_stage == 0)) || (param_4 != '\0')) { write_new_game_to_stream(param_1,param_2,ptr,local_14); } else { write_game_state_to_stream(param_1,ptr,local_14); } if (ptr != (void *)0x0) { local_8 = 0; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return; } //@@ 00917030 write_new_game_to_stream /* DB: sibling of write_game_state_to_stream: FUN_00916f70 picks it when no game/stage 0/force; writes msg byte 4, lobby member count + per-member (id 8 bytes, 4,1,4), seed via Seeds::String2Seed or Random, seed effects, Steam user id */ void write_new_game_to_stream (undefined4 param_1,std_string *param_2,undefined4 param_3,undefined4 param_4) { int *piVar1; std_string seedString; std_string seedString_00; Manager *pMVar2; std_string *str; undefined4 uVar3; uint uVar4; int *piVar5; uint uVar6; int iVar7; undefined4 *puVar8; int in_ECX; undefined4 in_EDX; void *pvVar9; int in_stack_ffffff84; undefined4 in_stack_ffffff88; undefined4 in_stack_ffffff8c; undefined1 *in_stack_ffffff90; undefined4 in_stack_ffffff94; char acStack_62 [18]; int local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined8 local_14; undefined1 local_6; undefined1 local_5; piVar1 = (int *)(in_ECX + 0x28); local_5 = 4; local_18 = in_EDX; (**(code **)(*(int *)(in_ECX + 0x28) + 0x1c))(); pMVar2 = g_manager; local_6 = (undefined1) (((int)(g_manager->_lobbyMembers)._end - (int)(g_manager->_lobbyMembers)._begin) / 0x14) ; (**(code **)(*piVar1 + 0x1c))(); pvVar9 = (pMVar2->_lobbyMembers)._begin; if (pvVar9 != (pMVar2->_lobbyMembers)._end) { do { iVar7 = *(int *)((int)pvVar9 + 4); if (iVar7 == 0) { local_14 = 0; local_14._4_4_ = 0; local_14._0_4_ = 0; local_20 = local_14._4_4_; local_24 = (int)local_14; } else { local_20 = *(undefined4 *)(iVar7 + 0xc); local_24 = *(int *)(iVar7 + 8); } (**(code **)(*piVar1 + 0x1c))(); local_14 = CONCAT44(*(undefined4 *)((int)pvVar9 + 0xc),(int)local_14); (**(code **)(*piVar1 + 0x1c))(); local_6 = *(undefined1 *)((int)pvVar9 + 8); in_stack_ffffff90 = &local_6; in_stack_ffffff94 = 1; (**(code **)(*piVar1 + 0x1c))(); in_stack_ffffff84 = (int)&local_14 + 4; in_stack_ffffff8c = 1; local_14 = CONCAT44(*(undefined4 *)((int)pvVar9 + 0x10),(int)local_14); in_stack_ffffff88 = 4; (**(code **)(*piVar1 + 0x1c))(); pvVar9 = (void *)((int)pvVar9 + 0x14); } while (pvVar9 != (pMVar2->_lobbyMembers)._end); } str = param_2; uVar4 = Seeds::String2Seed(param_2); if (uVar4 == 0) { uVar6 = Random(); uVar4 = 1; if (1 < uVar6) { uVar4 = uVar6; } local_14 = CONCAT44(uVar4,(int)local_14); (**(code **)(*piVar1 + 0x1c))(); local_6 = 0; uVar4 = 0x9171e4; (**(code **)(*piVar1 + 0x1c))(); std::string::string(acStack_62 + -0x1a,str); seedString._buf[4] = (char)in_stack_ffffff88; seedString._buf[5] = (char)((uint)in_stack_ffffff88 >> 8); seedString._buf[6] = (char)((uint)in_stack_ffffff88 >> 0x10); seedString._buf[7] = (char)((uint)in_stack_ffffff88 >> 0x18); seedString._buf[0] = (char)in_stack_ffffff84; seedString._buf[1] = (char)((uint)in_stack_ffffff84 >> 8); seedString._buf[2] = (char)((uint)in_stack_ffffff84 >> 0x10); seedString._buf[3] = (char)((uint)in_stack_ffffff84 >> 0x18); seedString._buf[8] = (char)in_stack_ffffff8c; seedString._buf[9] = (char)((uint)in_stack_ffffff8c >> 8); seedString._buf[10] = (char)((uint)in_stack_ffffff8c >> 0x10); seedString._buf[0xb] = (char)((uint)in_stack_ffffff8c >> 0x18); seedString._buf._12_4_ = in_stack_ffffff90; seedString._size = in_stack_ffffff94; seedString._capacity = uVar4; iVar7 = Seeds::GetSeedEffect(seedString); if (iVar7 != 0) { std::string::string(acStack_62 + -0x1a,str); seedString_00._buf[4] = (char)in_stack_ffffff88; seedString_00._buf[5] = (char)((uint)in_stack_ffffff88 >> 8); seedString_00._buf[6] = (char)((uint)in_stack_ffffff88 >> 0x10); seedString_00._buf[7] = (char)((uint)in_stack_ffffff88 >> 0x18); seedString_00._buf[0] = (char)in_stack_ffffff84; seedString_00._buf[1] = (char)((uint)in_stack_ffffff84 >> 8); seedString_00._buf[2] = (char)((uint)in_stack_ffffff84 >> 0x10); seedString_00._buf[3] = (char)((uint)in_stack_ffffff84 >> 0x18); seedString_00._buf[8] = (char)in_stack_ffffff8c; seedString_00._buf[9] = (char)((uint)in_stack_ffffff8c >> 8); seedString_00._buf[10] = (char)((uint)in_stack_ffffff8c >> 0x10); seedString_00._buf[0xb] = (char)((uint)in_stack_ffffff8c >> 0x18); seedString_00._buf._12_4_ = in_stack_ffffff90; seedString_00._size = in_stack_ffffff94; seedString_00._capacity = uVar4; iVar7 = Seeds::GetSeedEffect(seedString_00); local_14 = CONCAT44(iVar7,(int)local_14); goto LAB_0091715b; } } else { uVar4 = Seeds::String2Seed(str); local_14 = CONCAT44(uVar4,(int)local_14); (**(code **)(*piVar1 + 0x1c))(); local_6 = 1; (**(code **)(*piVar1 + 0x1c))(); } local_14 = local_14 & 0xffffffff; LAB_0091715b: (**(code **)(*piVar1 + 0x1c))(); local_6 = (undefined1)local_18; (**(code **)(*piVar1 + 0x1c))(); (**(code **)(*piVar1 + 0x1c))(¶m_1,4,1); piVar5 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); if (*piVar5 == 0) { local_24 = 1; } else { puVar8 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); local_24 = (**(code **)(*(int *)*puVar8 + 0xc))(); } local_20 = 0; (**(code **)(*piVar1 + 0x1c))(&local_24,8,1); local_24 = *(int *)&g_manager[1]._persistentGameData.field_0x30 - *(int *)&g_manager[1]._persistentGameData.field_0x2c >> 3; local_20 = 0; (**(code **)(*piVar1 + 0x1c))(&local_24,8,1); uVar4 = 0; iVar7 = *(int *)&g_manager[1]._persistentGameData.field_0x2c; if (*(int *)&g_manager[1]._persistentGameData.field_0x30 - iVar7 >> 3 != 0) { do { local_1c = *(undefined4 *)(iVar7 + uVar4 * 8); local_18 = *(undefined4 *)(iVar7 + 4 + uVar4 * 8); (**(code **)(*piVar1 + 0x1c))(&local_1c,8,1); uVar4 = uVar4 + 1; iVar7 = *(int *)&g_manager[1]._persistentGameData.field_0x2c; } while (uVar4 < (uint)(*(int *)&g_manager[1]._persistentGameData.field_0x30 - iVar7 >> 3)); } uVar3 = param_4; param_1 = param_4; (**(code **)(*piVar1 + 0x1c))(¶m_1,4,1); (**(code **)(*piVar1 + 0x1c))(param_3,uVar3,1); return; } //@@ 009172f0 write_game_state_to_stream /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? writes header, player list then 006f9000 Game::store_game_state GameState::write into 128K stack buffer, miniz compress (00a850f0/00a85140), 'Buffer overflow'; caller 00916f70 (no callers; online) */ void write_game_state_to_stream(undefined4 param_1,undefined4 param_2,uint param_3) { int *piVar1; qword qVar2; Manager *pMVar3; int *piVar4; void *pvVar5; void *pvVar6; Game *pGVar7; int in_ECX; int iVar8; undefined4 in_EDX; qword *pqVar9; uint uVar10; void *pvVar11; PlayerManager *pPVar12; int iVar13; undefined ***pppuStack_1febc; byte *pbStack_1feb8; undefined4 uStack_1feb4; undefined4 uStack_1feb0; undefined1 uStack_1feac; undefined4 uStack_1fea8; undefined4 uStack_1fea4; undefined **ppuStack_1fea0; Game *pGStack_1fe9c; undefined4 uStack_1fe98; int iStack_1fe94; int iStack_1fe90; int iStack_1fe88; undefined4 uStack_1fe84; undefined4 uStack_1fe80; undefined4 uStack_1fe7c; undefined **ppuStack_1fe78; undefined4 uStack_1fe74; undefined4 uStack_1fe70; undefined4 uStack_1fe6c; int iStack_1fe68; undefined4 uStack_1fe64; void *pvStack_1fe60; undefined8 uStack_1fe58; uint uStack_1fe50; int iStack_1fe4c; Game *pGStack_1fe48; undefined1 uStack_1fe42; undefined1 uStack_1fe41; GameState GStack_1fe40; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09dbd; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x28); uStack_1fe74 = param_2; uStack_1fe42 = 5; uStack_1fe6c = in_EDX; (**(code **)(*piVar1 + 0x1c))(&uStack_1fe42,1,1,__security_cookie ^ (int)register0x00000010 - 4U); pGStack_1fe48 = (Game *)g_manager[1]._state; (**(code **)(*piVar1 + 0x1c))(&pGStack_1fe48,4,1); pMVar3 = g_manager; uStack_1fe42 = (undefined1) (((int)(g_manager->_lobbyMembers)._end - (int)(g_manager->_lobbyMembers)._begin) / 0x14); (**(code **)(*piVar1 + 0x1c))(&uStack_1fe42,1,1); pvVar11 = (pMVar3->_lobbyMembers)._begin; if (pvVar11 != (pMVar3->_lobbyMembers)._end) { do { iVar13 = *(int *)((int)pvVar11 + 4); if (iVar13 == 0) { uStack_1fe58 = 0; uStack_1fe58._4_4_ = 0; uStack_1fe58._0_4_ = 0; uStack_1fe64 = uStack_1fe58._4_4_; iStack_1fe68 = (int)uStack_1fe58; } else { uStack_1fe64 = *(undefined4 *)(iVar13 + 0xc); iStack_1fe68 = *(int *)(iVar13 + 8); } (**(code **)(*piVar1 + 0x1c))(&iStack_1fe68,8,1); iStack_1fe4c = *(int *)((int)pvVar11 + 0xc); (**(code **)(*piVar1 + 0x1c))(&iStack_1fe4c,4,1); uStack_1fe41 = *(undefined1 *)((int)pvVar11 + 8); (**(code **)(*piVar1 + 0x1c))(&uStack_1fe41,1,1); iStack_1fe4c = *(int *)((int)pvVar11 + 0x10); (**(code **)(*piVar1 + 0x1c))(&iStack_1fe4c,4,1); pvVar11 = (void *)((int)pvVar11 + 0x14); } while (pvVar11 != (pMVar3->_lobbyMembers)._end); } uVar10 = 0; pPVar12 = &g_game->_playerManager; pGVar7 = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar12->_playerList)._begin >> 2 != 0) { do { pvVar11 = (pPVar12->_playerList)._end; if ((int)pvVar11 - (int)(pPVar12->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar11 = (pPVar12->_playerList)._end; pGVar7 = g_game; } piVar4 = (pPVar12->_playerList)._begin; if (uVar10 < (uint)((int)pvVar11 - (int)piVar4 >> 2)) { piVar4 = piVar4 + uVar10; } iVar13 = *piVar4; pPVar12 = &pGVar7->_playerManager; uVar10 = uVar10 + 1; *(float *)(iVar13 + 0x33c) = g_vectorZero.x; *(float *)(iVar13 + 0x340) = g_vectorZero.y; } while (uVar10 < (uint)((int)(pGVar7->_playerManager)._playerList._end - (int)(pPVar12->_playerList)._begin >> 2)); } GameState::constructor(&GStack_1fe40); local_8 = 0; Game::store_game_state(g_game,&GStack_1fe40); KAGE::Filesys::BufferedStream::BufferedStream(&ppuStack_1fea0,0x80000); local_8._0_1_ = 1; pppuStack_1febc = &ppuStack_1fe78; pbStack_1feb8 = &s_empty; uStack_1feb4 = 0; uStack_1fea4 = 1; uStack_1feb0 = 0; uStack_1feac = 0; uStack_1fea8 = 0xfedcba76; GameState::write(&GStack_1fe40,&pppuStack_1febc); pvVar11 = operator_new_tracked(0x80000); pGStack_1fe48 = pGStack_1fe9c; iStack_1fe4c = iStack_1fe94; if (iStack_1fe88 != 0) { iStack_1fe4c = iStack_1fe88; } if (DAT_00c7de50 == (void *)0x0) { pvVar5 = operator_new(0xc); uStack_1fe58 = CONCAT44(pvVar5,(int)uStack_1fe58); local_8._0_1_ = 2; if (pvVar5 == (void *)0x0) { pvVar5 = (void *)0x0; } else { pvVar6 = operator_new_tracked(0x10000); *(void **)((int)pvVar5 + 8) = pvVar6; } local_8._0_1_ = 1; DAT_00c7de50 = pvVar5; } FUN_00a850f0(); pGVar7 = (Game *)lzw_compress(pvVar11,iStack_1fe4c,pGStack_1fe48); if ((Game *)0x80000 < pGVar7) { KAGE_LogMessage(0x10,(byte *)"Buffer overflow"); } pGStack_1fe48 = pGStack_1fe9c; (**(code **)(*piVar1 + 0x1c))(&pGStack_1fe48,4,1); pGStack_1fe48 = pGVar7; (**(code **)(*piVar1 + 0x1c))(&pGStack_1fe48,4,1); (**(code **)(*piVar1 + 0x1c))(pvVar11,1,pGVar7); if (pvVar11 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar10 = *(uint *)((int)pvVar11 + -4); qVar2 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar10; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar2 < uVar10); free((void *)((int)pvVar11 + -4)); } ppuStack_1fe78 = KAGE::Filesys::StreamBase::vftable; ppuStack_1fea0 = KAGE::Filesys::BufferedStreamBase::vftable; pGStack_1fe9c = (Game *)0x0; uStack_1fe98 = 0; iStack_1fe90 = iStack_1fe94; iStack_1fe88 = 0; uStack_1fe84 = 0; uStack_1fe80 = 0; uStack_1fe7c = 0; FUN_007dcd30(); local_8 = 0xffffffff; GameState::~GameState(&GStack_1fe40); pGVar7 = g_game; pGStack_1fe48 = g_game; uStack_1fe41 = (undefined1) (((int)(g_game->_onlinePlayerStats)._end - (int)(g_game->_onlinePlayerStats)._begin ) / 0x68); (**(code **)(*piVar1 + 0x1c))(&uStack_1fe41,1,1); pvVar11 = (pGVar7->_onlinePlayerStats)._begin; uStack_1fe50 = 0; iVar8 = (int)(pGVar7->_onlinePlayerStats)._end - (int)pvVar11; iVar13 = iVar8 >> 0x1f; if (iVar8 / 0x68 + iVar13 != iVar13) { iStack_1fe4c = 0; do { iVar13 = iStack_1fe4c; iStack_1fe68 = *(int *)((int)pvVar11 + iStack_1fe4c); uStack_1fe64 = *(undefined4 *)((int)pvVar11 + iStack_1fe4c + 4); (**(code **)(*piVar1 + 0x1c))(&iStack_1fe68,8,1); iVar13 = iVar13 + 0xc; iVar8 = 0x16; do { uStack_1fe58 = CONCAT44(*(undefined4 *) (iVar13 + (int)(pGStack_1fe48->_onlinePlayerStats)._begin), (int)uStack_1fe58); (**(code **)(*piVar1 + 0x1c))((int)&uStack_1fe58 + 4,4,1); iVar13 = iVar13 + 4; iVar8 = iVar8 + -1; } while (iVar8 != 0); uStack_1fe50 = uStack_1fe50 + 1; iStack_1fe4c = iStack_1fe4c + 0x68; pvVar11 = (pGStack_1fe48->_onlinePlayerStats)._begin; } while (uStack_1fe50 < (uint)(((int)(pGStack_1fe48->_onlinePlayerStats)._end - (int)pvVar11) / 0x68)); } uStack_1fe58 = CONCAT44(DAT_00c34f04,(int)uStack_1fe58); (**(code **)(*piVar1 + 0x1c))((int)&uStack_1fe58 + 4,4,1); (**(code **)(*piVar1 + 0x1c))(&DAT_00c7ac70,4,0x270); uVar10 = g_manager->_framecount & 0x80000001; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xfffffffe) + 1; } uStack_1fe41 = (undefined1)uVar10; (**(code **)(*piVar1 + 0x1c))(&uStack_1fe41,1,1); pGVar7 = g_game; iVar13 = 0; do { uStack_1fe58 = CONCAT44(iVar13,(int)uStack_1fe58); std::set::find_node(&iStack_1fe68,(int)&uStack_1fe58 + 4); if (((*(char *)((int)pvStack_1fe60 + 0xd) == '\0') && (*(int *)((int)pvStack_1fe60 + 0x10) <= iVar13)) && (pvStack_1fe60 != (pGVar7->_seedEffects)._seedEffects)) goto LAB_009178e4; iVar13 = iVar13 + 1; } while (iVar13 < 0x50); iVar13 = 0; LAB_009178e4: uStack_1fe58 = CONCAT44(iVar13,(int)uStack_1fe58); (**(code **)(*piVar1 + 0x1c))((int)&uStack_1fe58 + 4,4,1); uStack_1fe41 = (undefined1)uStack_1fe6c; (**(code **)(*piVar1 + 0x1c))(&uStack_1fe41,1,1); uStack_1fe6c = param_1; (**(code **)(*piVar1 + 0x1c))(&uStack_1fe6c,4,1); iStack_1fe68 = *(int *)&g_manager[1]._persistentGameData.field_0x8; uStack_1fe64 = *(undefined4 *)&g_manager[1]._persistentGameData.field_0xc; (**(code **)(*piVar1 + 0x1c))(&iStack_1fe68,8,1); iStack_1fe68 = *(int *)&g_manager[1]._persistentGameData.field_0x30 - *(int *)&g_manager[1]._persistentGameData.field_0x2c >> 3; uStack_1fe64 = 0; (**(code **)(*piVar1 + 0x1c))(&iStack_1fe68,8,1); uVar10 = 0; iVar13 = *(int *)&g_manager[1]._persistentGameData.field_0x2c; if (*(int *)&g_manager[1]._persistentGameData.field_0x30 - iVar13 >> 3 != 0) { do { uStack_1fe70 = *(undefined4 *)(iVar13 + uVar10 * 8); uStack_1fe6c = *(undefined4 *)(iVar13 + 4 + uVar10 * 8); (**(code **)(*piVar1 + 0x1c))(&uStack_1fe70,8,1); uVar10 = uVar10 + 1; iVar13 = *(int *)&g_manager[1]._persistentGameData.field_0x2c; } while (uVar10 < (uint)(*(int *)&g_manager[1]._persistentGameData.field_0x30 - iVar13 >> 3)); } uStack_1fe50 = param_3; (**(code **)(*piVar1 + 0x1c))(&uStack_1fe50,4,1); (**(code **)(*piVar1 + 0x1c))(uStack_1fe74,param_3,1); ExceptionList = local_10; return; } //@@ 00917a50 NetplayManager::load_game_start_packet /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from the game-start notify FUN_0090ca40 ("[Frame %d] Notify Game Start"): reads a stream (vfunc +0x14 read(buf,size,count)) into Manager _lobbyMembers (UserProfile::find_or_create, load_steam_avatar), seeds (Seeds::set_start_seed, AddSeedEffect), then NetplayManager::reset / MenuManager::start_game */ void NetplayManager::load_game_start_packet(void) { int *piVar1; undefined1 *puVar2; undefined4 *puVar3; KColor fadeColor; Manager *pMVar4; Manager *pMVar5; undefined4 *puVar6; int extraout_EAX; void *pvVar7; int in_ECX; undefined4 in_EDX; std_vector *psVar8; uint uVar9; void **ppvVar10; bool bVar11; byte bVar12; undefined4 local_ec; undefined4 local_e8; undefined **local_e0; undefined4 local_dc; byte local_d8; int local_d4; uint local_d0; undefined8 local_cc; uint local_bc; undefined4 local_b8; undefined8 local_b4; int local_a8; undefined8 local_a4; undefined8 local_9c; undefined **local_90; uint local_8c; uint local_88; int local_84; byte local_7d; uint local_7c; byte local_75; Seeds local_74; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; pMVar4 = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b09e13; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_74)[1]._rng._shift3; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x28); local_75 = 0; psVar8 = &g_manager->_lobbyMembers; local_b8 = in_EDX; (**(code **)(*(int *)(in_ECX + 0x28) + 0x14))(&local_75,1,1,local_14); puVar3 = (pMVar4->_lobbyMembers)._end; puVar6 = psVar8->_begin; if (puVar6 != puVar3) { do { *puVar6 = KAGE::System::UserProfileBase::vftable; puVar6 = puVar6 + 5; } while (puVar6 != puVar3); puVar6 = psVar8->_begin; } (pMVar4->_lobbyMembers)._end = puVar6; for (local_7c = (uint)local_75; local_7c != 0; local_7c = local_7c - 1) { local_dc = 0; local_e0 = KAGE::System::UserProfile::vftable; local_d8 = 0; local_d4 = 0; local_d0 = 5; local_8 = 0; local_b4 = 0; (**(code **)(*piVar1 + 0x14))(&local_b4,8,1); local_a4 = local_b4; local_90 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&local_a4); local_8._0_1_ = 1; local_90 = KAGE::System::UserProfile::vftable; local_8c = extraout_EAX; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_90); } local_8 = (uint)local_8._1_3_ << 8; local_90 = KAGE::System::UserProfileBase::vftable; local_84 = 0; (**(code **)(*piVar1 + 0x14))(&local_84,4,1); local_d4 = local_84; local_75 = 0; (**(code **)(*piVar1 + 0x14))(&local_75,1,1); local_d8 = local_75; local_88 = 0; (**(code **)(*piVar1 + 0x14))(&local_88,4,1); puVar3 = (pMVar4->_lobbyMembers)._end; local_d0 = local_88; if (puVar3 == (pMVar4->_lobbyMembers)._capacity) { FUN_008ef230(puVar3,&local_e0); } else { *(byte *)(puVar3 + 2) = local_75; puVar3[1] = local_8c; *puVar3 = KAGE::System::UserProfile::vftable; puVar3[3] = local_84; puVar3[4] = local_88; ppvVar10 = &(pMVar4->_lobbyMembers)._end; *ppvVar10 = (void *)((int)*ppvVar10 + 0x14); } local_8 = 0xffffffff; } local_88 = 0; (**(code **)(*piVar1 + 0x14))(&local_88,4,1); local_75 = 0; (**(code **)(*piVar1 + 0x14))(&local_75,1,1); bVar12 = local_75 != 0; local_84 = 0; local_7d = bVar12; (**(code **)(*piVar1 + 0x14))(&local_84,4,1); local_75 = 0; (**(code **)(*piVar1 + 0x14))(&local_75,1,1); local_8c = (uint)local_75; local_a8 = 0; (**(code **)(*piVar1 + 0x14))(&local_a8,4,1); local_a4 = 0; (**(code **)(*piVar1 + 0x14))(&local_a4,8,1); local_cc = 0; (**(code **)(*piVar1 + 0x14))(&local_cc,8,1); local_b4 = CONCAT44((int)local_cc,(undefined4)local_b4); local_bc = local_cc._4_4_; local_9c = 0; if ((local_cc._4_4_ != 0) || ((int)local_cc != 0)) { local_9c._0_4_ = 0; local_7c = 0; uVar9 = (uint)local_9c; do { pMVar4 = g_manager; local_9c = 0; (**(code **)(*piVar1 + 0x14))(&local_9c,8,1); puVar3 = *(undefined4 **)&pMVar4[1]._persistentGameData.field_0x30; local_ec = (uint)local_9c; local_e8 = local_9c._4_4_; if (puVar3 == *(undefined4 **)&pMVar4[1]._persistentGameData.field_0x34) { std::vector<8byte>::_Emplace_reallocate(puVar3,&local_ec); } else { *puVar3 = (uint)local_9c; puVar3[1] = local_9c._4_4_; puVar2 = &pMVar4[1]._persistentGameData.field_0x30; *(int *)puVar2 = *(int *)puVar2 + 8; } bVar11 = 0xfffffffe < uVar9; uVar9 = uVar9 + 1; local_7c = local_7c + bVar11; } while ((local_7c < local_bc) || ((local_7c <= local_bc && (uVar9 < local_b4._4_4_)))); bVar12 = local_7d; } local_7c = 0; (**(code **)(*piVar1 + 0x14))(&local_7c,4,1); (**(code **)(*piVar1 + 8))(local_b8); FUN_0091ad50(); local_74._rng._seed = -0x55e8beb1; local_74._rng._shift1 = 5; local_74._rng._shift2 = 9; local_74._rng._shift3 = 7; local_74._seedEffects = (void *)0x0; local_74._seedEffectsCount = 0; pvVar7 = operator_new(0x14); *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; *(undefined2 *)((int)pvVar7 + 0xc) = 0x101; local_74._gameStartSeed = 0; local_74._isCustomRun = 0; local_74._seedEffects = pvVar7; FID_conflict__Erase_tree_>_> (&local_74._seedEffects, (fuzzer_allocator_> *)&local_74._seedEffects, *(_Tree_node **)((int)pvVar7 + 4)); *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; local_74._seedEffectsCount = 0; local_8 = 2; Seeds::set_start_seed(&local_74,local_88); local_74._isCustomRun = bVar12; Seeds::operator_assign(&g_manager->_startSeeds,&local_74); pMVar4 = g_manager; ppvVar10 = &(g_manager->_startSeeds)._seedEffects; pvVar7 = *ppvVar10; FID_conflict__Erase_tree_>_> (ppvVar10,(fuzzer_allocator_> *)ppvVar10, *(_Tree_node **)((int)pvVar7 + 4)); pMVar5 = g_manager; *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; (pMVar4->_startSeeds)._seedEffectsCount = 0; Seeds::AddSeedEffect(&pMVar5->_startSeeds,local_84); pMVar4 = g_manager; g_manager->_startDifficulty = local_8c; pMVar4->_startChallenge = local_a8; *(undefined4 *)&pMVar4[1]._persistentGameData.field_0xc = local_a4._4_4_; pMVar4->_rerunAvailable = 0; *(undefined4 *)&pMVar4[1]._persistentGameData.field_0x8 = (undefined4)local_a4; reset(&pMVar4->_netplayManager,0); if (g_menuManager == (MenuManager *)0x0) { g_manager->_starting = 1; } else { fadeColor._alpha = 1.0; fadeColor._red = 0.0; fadeColor._green = 0.0; fadeColor._blue = 0.0; fadeColor._unk = 0; MenuManager::start_game(fadeColor); } FID_conflict__Erase_tree_>_> (&local_74._seedEffects, (fuzzer_allocator_> *)&local_74._seedEffects, *(_Tree_node **)((int)local_74._seedEffects + 4)); operator_delete(local_74._seedEffects,0x14); ExceptionList = local_10; return; } //@@ 00917fd0 FUN_00917fd0 /* WARNING: Removing unreachable block (ram,0x009183d2) */ /* WARNING: Removing unreachable block (ram,0x009183e4) */ /* WARNING: Removing unreachable block (ram,0x009183f4) */ /* WARNING: Removing unreachable block (ram,0x009183fa) */ void FUN_00917fd0(void) { void **ppvVar1; undefined1 *puVar2; undefined4 *puVar3; KColor fadeColor; qword qVar4; Game *pGVar5; Manager *pMVar6; int iVar7; int iVar8; undefined4 *puVar9; void *extraout_EAX; void *pvVar10; void *pvVar11; void *pvVar12; uint uVar13; int in_ECX; int *piVar14; undefined4 in_EDX; qword *pqVar15; int iVar16; std_vector *psVar17; int iVar18; bool bVar19; undefined **ppuStack_74; undefined ***pppuStack_70; byte *pbStack_6c; undefined **ppuStack_68; undefined4 uStack_64; byte bStack_60; std_vector *psStack_5c; uint uStack_58; undefined4 local_54; int *local_50; undefined **ppuStack_4c; void *pvStack_48; undefined8 uStack_44; int iStack_38; undefined4 uStack_34; void *pvStack_30; undefined8 uStack_2c; std_vector *psStack_20; uint local_1c; uint uStack_18; byte bStack_11; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; pMVar6 = g_manager; uStack_8 = 0xffffffff; puStack_c = &LAB_00b09e6f; local_10 = ExceptionList; ExceptionList = &local_10; piVar14 = (int *)(in_ECX + 0x28); local_1c = 0; local_54 = in_EDX; local_50 = piVar14; (**(code **)(*piVar14 + 0x14))(&local_1c,4,1,__security_cookie ^ (int)register0x00000010 - 4U); pMVar6[1]._state = local_1c; KAGE_LogMessage(1,(byte *)"Joining existing game on frame %d\n"); pMVar6 = g_manager; psVar17 = &g_manager->_lobbyMembers; bStack_11 = 0; (**(code **)(*piVar14 + 0x14))(&bStack_11,1,1); puVar3 = (pMVar6->_lobbyMembers)._end; puVar9 = psVar17->_begin; if (puVar9 != puVar3) { do { *puVar9 = KAGE::System::UserProfileBase::vftable; puVar9 = puVar9 + 5; } while (puVar9 != puVar3); puVar9 = psVar17->_begin; } (pMVar6->_lobbyMembers)._end = puVar9; for (pvStack_30 = (void *)(uint)bStack_11; pvStack_30 != (void *)0x0; pvStack_30 = (void *)((int)pvStack_30 - 1)) { uStack_64 = 0; ppuStack_68 = KAGE::System::UserProfile::vftable; bStack_60 = 0; psStack_5c = (std_vector *)0x0; uStack_58 = 5; uStack_8 = 0; uStack_2c = 0; (**(code **)(*piVar14 + 0x14))(&uStack_2c,8,1); uStack_44 = uStack_2c; ppuStack_4c = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&uStack_44); uStack_8._0_1_ = 1; ppuStack_4c = KAGE::System::UserProfile::vftable; pvStack_48 = extraout_EAX; if (((extraout_EAX != (void *)0x0) && (*(int *)((int)extraout_EAX + 8) != 0 || *(int *)((int)extraout_EAX + 0xc) != 0)) && (*(int *)((int)extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&ppuStack_4c); } pvVar10 = pvStack_48; uStack_8 = (uint)uStack_8._1_3_ << 8; ppuStack_4c = KAGE::System::UserProfileBase::vftable; psStack_20 = (std_vector *)0x0; (**(code **)(*piVar14 + 0x14))(&psStack_20,4,1); psStack_5c = psStack_20; bStack_11 = 0; (**(code **)(*piVar14 + 0x14))(&bStack_11,1,1); bStack_60 = bStack_11; local_1c = 0; (**(code **)(*piVar14 + 0x14))(&local_1c,4,1); puVar3 = (pMVar6->_lobbyMembers)._end; uStack_58 = local_1c; if (puVar3 == (pMVar6->_lobbyMembers)._capacity) { FUN_008ef230(puVar3,&ppuStack_68); } else { *(byte *)(puVar3 + 2) = bStack_11; puVar3[1] = pvVar10; *puVar3 = KAGE::System::UserProfile::vftable; puVar3[3] = psStack_20; puVar3[4] = local_1c; ppvVar1 = &(pMVar6->_lobbyMembers)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x14); } uStack_8 = 0xffffffff; } local_1c = 0; (**(code **)(*piVar14 + 0x14))(&local_1c,4,1); psStack_20 = (std_vector *)0x0; (**(code **)(*piVar14 + 0x14))(&psStack_20,4,1); psVar17 = psStack_20; pvVar10 = operator_new_tracked((uint)psStack_20); pvStack_30 = operator_new_tracked(local_1c); (**(code **)(*piVar14 + 0x14))(pvVar10,psVar17,1); if (DAT_00c7de50 == (void *)0x0) { pvVar11 = operator_new(0xc); uStack_8 = 2; pvStack_48 = pvVar11; if (pvVar11 == (void *)0x0) { DAT_00c7de50 = (void *)0x0; } else { pvVar12 = operator_new_tracked(0x10000); *(void **)((int)pvVar11 + 8) = pvVar12; DAT_00c7de50 = pvVar11; } uStack_8 = 0xffffffff; } FUN_00a850f0(); uVar13 = lzw_decompress(pvStack_30,pvVar10,psStack_20); if (local_1c < uVar13) { KAGE_LogMessage(0x10,(byte *)"Buffer overflow"); } if (pvVar10 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } uVar13 = *(uint *)((int)pvVar10 + -4); qVar4 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar13; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar4 < uVar13); free((void *)((int)pvVar10 + -4)); } ppuStack_74 = KAGE::Filesys::BufferedStream::vftable; uStack_8 = 4; GameState::Clear(&g_manager->_gamestate); pppuStack_70 = &ppuStack_74; (g_manager->_gamestate)._saveFile = pppuStack_70; pbStack_6c = &s_empty; ppuStack_68 = (undefined **)0x0; uStack_58 = 1; uStack_64 = 0; bStack_60 = 0; psStack_5c = (std_vector *)0xfedcba76; GameState::read(&pppuStack_70,0); (g_manager->_gamestate)._saveFile = (void *)0x0; uStack_8 = 0xffffffff; ppuStack_74 = KAGE::Filesys::StreamBase::vftable; bStack_11 = 0; (**(code **)(*piVar14 + 0x14))(&bStack_11,1,1); uStack_18 = (uint)bStack_11; do { if (uStack_18 == 0) { uStack_18 = 0; (**(code **)(*piVar14 + 0x14))(&uStack_18,4,1); DAT_00c34f04 = uStack_18; (**(code **)(*piVar14 + 0x14))(&DAT_00c7ac70,4,0x270); bStack_11 = 0; (**(code **)(*piVar14 + 0x14))(&bStack_11,1,1); pMVar6 = g_manager; uVar13 = g_manager->_framecount & 0x80000001; if ((int)uVar13 < 0) { uVar13 = (uVar13 - 1 | 0xfffffffe) + 1; } if (uVar13 != (bStack_11 & 1)) { g_manager->_framecount = g_manager->_framecount + 1; } uStack_18 = 0; (**(code **)(*piVar14 + 0x14))(&uStack_18,4,1); Seeds::AddSeedEffect(&pMVar6->_startSeeds,uStack_18); bStack_11 = 0; (**(code **)(*piVar14 + 0x14))(&bStack_11,1,1); g_manager->_startDifficulty = (uint)bStack_11; uStack_18 = 0; (**(code **)(*piVar14 + 0x14))(&uStack_18,4,1); pMVar6 = g_manager; g_manager->_startChallenge = uStack_18; uStack_2c = 0; (**(code **)(*piVar14 + 0x14))(&uStack_2c,8,1); *(uint *)&pMVar6[1]._persistentGameData.field_0xc = uStack_2c._4_4_; *(uint *)&pMVar6[1]._persistentGameData.field_0x8 = (uint)uStack_2c; uStack_2c = 0; (**(code **)(*piVar14 + 0x14))(&uStack_2c,8,1); pvStack_48 = (void *)(uint)uStack_2c; local_50 = (int *)uStack_2c._4_4_; uStack_44 = 0; if ((uStack_2c._4_4_ != 0) || ((uint)uStack_2c != 0)) { uStack_44._0_4_ = 0; uStack_18 = 0; uVar13 = (uint)uStack_44; do { pMVar6 = g_manager; uStack_44 = 0; (**(code **)(*piVar14 + 0x14))(&uStack_44,8,1); puVar3 = *(undefined4 **)&pMVar6[1]._persistentGameData.field_0x30; uStack_34 = (uint)uStack_44; pvStack_30 = uStack_44._4_4_; if (puVar3 == *(undefined4 **)&pMVar6[1]._persistentGameData.field_0x34) { std::vector<8byte>::_Emplace_reallocate(puVar3,&uStack_34); } else { *puVar3 = (uint)uStack_44; puVar3[1] = uStack_44._4_4_; puVar2 = &pMVar6[1]._persistentGameData.field_0x30; *(int *)puVar2 = *(int *)puVar2 + 8; } bVar19 = 0xfffffffe < uVar13; uVar13 = uVar13 + 1; uStack_18 = uStack_18 + bVar19; } while ((uStack_18 < local_50) || ((uStack_18 <= local_50 && (uVar13 < pvStack_48)))); } iStack_38 = 0; (**(code **)(*piVar14 + 0x14))(&iStack_38,4,1); (**(code **)(*piVar14 + 8))(local_54); FUN_0091ad50(); pMVar6 = g_manager; bVar19 = g_menuManager == (MenuManager *)0x0; g_manager->_rerunAvailable = 1; if (bVar19) { FUN_0090e2a0(&pMVar6->_gamestate,0,0); ExceptionList = local_10; return; } fadeColor._alpha = 1.0; fadeColor._red = 0.0; fadeColor._green = 0.0; fadeColor._blue = 0.0; fadeColor._unk = 0; MenuManager::start_game(fadeColor); ExceptionList = local_10; return; } uStack_2c = 0; (**(code **)(*piVar14 + 0x14))(&uStack_2c,8,1); iVar8 = uStack_2c._4_4_; local_1c = 0; iStack_38 = 0xc; do { iVar18 = iStack_38; pvStack_30 = (void *)0x0; (**(code **)(*piVar14 + 0x14))(&pvStack_30,4,1); pGVar5 = g_game; pvStack_48 = pvStack_30; psStack_20 = &g_game->_onlinePlayerStats; if (*(int *)&g_game->_deathmatchManager < 2) { if (g_game->field_0x1c030 == '\0') { if (local_1c < 0x16) { pvVar10 = (g_game->_onlinePlayerStats)._end; uVar13 = 0; piVar14 = psStack_20->_begin; uStack_44 = CONCAT44(pvVar10,(uint)uStack_44); iVar18 = (int)pvVar10 - (int)piVar14 >> 0x1f; iVar16 = ((int)pvVar10 - (int)piVar14) / 0x68 + iVar18; iVar7 = (uint)uStack_2c; if (iVar16 != iVar18) { do { if ((*piVar14 == (uint)uStack_2c) && (piVar14[1] == iVar8)) goto LAB_009184ed; uVar13 = uVar13 + 1; piVar14 = piVar14 + 0x1a; } while (uVar13 < (uint)(iVar16 - iVar18)); } online_stats_add_user((uint)uStack_2c,iVar8); pvVar10 = (pGVar5->_onlinePlayerStats)._end; LAB_009184ed: uVar13 = 0; piVar14 = psStack_20->_begin; iVar18 = (int)pvVar10 - (int)piVar14 >> 0x1f; iVar16 = ((int)pvVar10 - (int)piVar14) / 0x68 + iVar18; if (iVar16 != iVar18) { do { if ((*piVar14 == iVar7) && (piVar14[1] == iVar8)) goto LAB_00918534; uVar13 = uVar13 + 1; piVar14 = piVar14 + 0x1a; } while (uVar13 < (uint)(iVar16 - iVar18)); } KAGE_LogMessage(8,(byte *) "CoopStats::get_player_info() did not have data for user %llu \n"); piVar14 = (int *)0x0; LAB_00918534: *(void **)((int)piVar14 + iStack_38) = pvStack_48; iVar18 = iStack_38; piVar14 = local_50; } } } local_1c = local_1c + 1; iStack_38 = iVar18 + 4; } while (iStack_38 < 100); uStack_18 = uStack_18 - 1; } while( true ); } //@@ 009187f0 FUN_009187f0 void FUN_009187f0(int param_1) { int iVar1; Game *pGVar2; undefined1 *in_ECX; pGVar2 = g_game; *in_ECX = 6; *(int *)(in_ECX + 4) = param_1; *(int *)(in_ECX + 8) = pGVar2->_stage; *(int *)(in_ECX + 0xc) = pGVar2->_stageType; *(undefined2 *)(in_ECX + 0x10) = 0; if ((param_1 == 2) || (param_1 == 3)) { in_ECX[0x10] = *(undefined1 *)((int)pGVar2->_room + 0x1bb0); } iVar1 = pGVar2->_difficulty; if ((iVar1 == 2) || (iVar1 == 3)) { in_ECX[0x11] = (iVar1 == 3) + 10U | (char)pGVar2->_greedModeWave << 4; return; } return; } //@@ 00918870 NetplayManager::write_player_game_states_message /* DB: mirror of NetplayManager::read_player_game_states_message: walks the same std::map at g_manager[1]+0x106c (u64 key, bytes at +0x18/+0x1c, four length-prefixed buffers at +0x48/+0x7c/+0xb0/+0xe4) into a BufferedStream, tdefl-compresses (FUN_00a89de0) and writes size+data */ void NetplayManager::write_player_game_states_message(void) { qword qVar1; Manager *pMVar2; uint uVar3; int iVar4; int iVar5; int iVar6; int iVar7; void *pvVar8; undefined4 uVar9; int extraout_ECX; undefined4 extraout_ECX_00; qword *pqVar10; int *piVar11; uint uVar12; undefined **local_58; int *local_54; undefined4 local_50; int local_4c; int local_48; int local_44; int local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined **local_30; undefined4 local_2c; undefined4 local_28; int *local_20; undefined4 *local_1c; int local_18; undefined1 local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar2 = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b09e9d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar12 = 1; KAGE::Filesys::BufferedStream::BufferedStream(&local_58,0); local_8 = 0; piVar11 = *(int **)&pMVar2[1]._gamestate.field_0xc8; local_18 = *piVar11; if ((int *)local_18 != piVar11) { do { iVar7 = local_18; iVar4 = (**(code **)(*(int *)(local_18 + 0x48) + 4))(uVar3); iVar5 = (**(code **)(*(int *)(iVar7 + 0x7c) + 4))(); iVar6 = (**(code **)(*(int *)(iVar7 + 0xb0) + 4))(); iVar7 = (**(code **)(*(int *)(iVar7 + 0xe4) + 4))(); uVar12 = uVar12 + iVar4 + iVar5 + iVar6 + 0x18 + iVar7; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_18); } while (local_18 != *(int *)&pMVar2[1]._gamestate.field_0xc8); } if ((uint)(local_44 - local_4c) < uVar12) { if (0x7fffffff < uVar12) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_00a2c860(uVar12); } local_11 = pMVar2[1]._gamestate.field_0xcc; (*(code *)local_30[7])(&local_11,1,1); piVar11 = *(int **)&pMVar2[1]._gamestate.field_0xc8; local_18 = *piVar11; if ((int *)local_18 != piVar11) { do { iVar7 = local_18; local_2c = *(undefined4 *)(local_18 + 0x10); local_28 = *(undefined4 *)(local_18 + 0x14); (*(code *)local_30[7])(&local_2c,8,1); local_11 = *(undefined1 *)(iVar7 + 0x18); (*(code *)local_30[7])(&local_11,1,1); local_11 = *(undefined1 *)(iVar7 + 0x1c); (*(code *)local_30[7])(&local_11,1,1); uVar3 = (**(code **)(*(int *)(iVar7 + 0x48) + 4))(); local_1c = (undefined4 *)(uVar3 & 0xffff); (*(code *)local_30[7])(&local_1c,2,1); iVar4 = (**(code **)(*(int *)(iVar7 + 0x48) + 4))(); if (iVar4 != 0) { uVar3 = (**(code **)(*(int *)(iVar7 + 0x48) + 4))(); pvVar8 = *(void **)(iVar7 + 0x38); if (pvVar8 == (void *)0x0) { pvVar8 = *(void **)(iVar7 + 0x2c); } buffered_stream_write(&local_30,pvVar8,1,uVar3); } local_11 = *(undefined1 *)(iVar7 + 0x4c); (*(code *)local_30[7])(&local_11,1,1); local_11 = *(undefined1 *)(iVar7 + 0x50); (*(code *)local_30[7])(&local_11,1,1); uVar3 = (**(code **)(*(int *)(iVar7 + 0x7c) + 4))(); local_1c = (undefined4 *)(uVar3 & 0xffff); (*(code *)local_30[7])(&local_1c,2,1); iVar4 = (**(code **)(*(int *)(iVar7 + 0x7c) + 4))(); if (iVar4 != 0) { uVar3 = (**(code **)(*(int *)(iVar7 + 0x7c) + 4))(); pvVar8 = *(void **)(iVar7 + 0x6c); if (pvVar8 == (void *)0x0) { pvVar8 = *(void **)(iVar7 + 0x60); } buffered_stream_write(&local_30,pvVar8,1,uVar3); } local_11 = *(undefined1 *)(iVar7 + 0x80); (*(code *)local_30[7])(&local_11,1,1); local_11 = *(undefined1 *)(iVar7 + 0x84); (*(code *)local_30[7])(&local_11,1,1); uVar3 = (**(code **)(*(int *)(iVar7 + 0xb0) + 4))(); local_1c = (undefined4 *)(uVar3 & 0xffff); (*(code *)local_30[7])(&local_1c,2,1); iVar4 = (**(code **)(*(int *)(iVar7 + 0xb0) + 4))(); if (iVar4 != 0) { uVar3 = (**(code **)(*(int *)(iVar7 + 0xb0) + 4))(); pvVar8 = *(void **)(iVar7 + 0xa0); if (pvVar8 == (void *)0x0) { pvVar8 = *(void **)(iVar7 + 0x94); } buffered_stream_write(&local_30,pvVar8,1,uVar3); } local_11 = *(undefined1 *)(iVar7 + 0xb4); (*(code *)local_30[7])(&local_11,1,1); local_11 = *(undefined1 *)(iVar7 + 0xb8); (*(code *)local_30[7])(&local_11,1,1); uVar3 = (**(code **)(*(int *)(iVar7 + 0xe4) + 4))(); local_1c = (undefined4 *)(uVar3 & 0xffff); (*(code *)local_30[7])(&local_1c,2,1); iVar4 = (**(code **)(*(int *)(iVar7 + 0xe4) + 4))(); if (iVar4 != 0) { uVar3 = (**(code **)(*(int *)(iVar7 + 0xe4) + 4))(); pvVar8 = *(void **)(iVar7 + 0xd4); if (pvVar8 == (void *)0x0) { pvVar8 = *(void **)(iVar7 + 200); } buffered_stream_write(&local_30,pvVar8,1,uVar3); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_18); } while (local_18 != *(int *)&pMVar2[1]._gamestate.field_0xc8); } piVar11 = local_54; pvVar8 = operator_new_tracked((uint)local_54); iVar7 = local_4c; if (local_40 != 0) { iVar7 = local_40; } if (g_deflateCompressor == (void *)0x0) { local_1c = operator_new(0x14); if (local_1c == (undefined4 *)0x0) { g_deflateCompressor = (undefined4 *)0x0; } else { *local_1c = 0; local_1c[1] = 0; local_1c[3] = 0; g_deflateCompressor = local_1c; } local_40 = extraout_ECX; } FUN_00a89ba0(local_40); uVar9 = tdefl_compress(pvVar8,piVar11,iVar7,piVar11,extraout_ECX_00); (**(code **)(*local_20 + 4))(0,0xffffffff); piVar11 = local_20 + 10; local_11 = 7; (**(code **)(local_20[10] + 0x1c))(&local_11,1,1); local_20 = local_54; (**(code **)(*piVar11 + 0x1c))(&local_20,4,1); (**(code **)(*piVar11 + 0x1c))(pvVar8,1,uVar9); if (pvVar8 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)((int)pvVar8 + -4); qVar1 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar3; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar1 < uVar3); free((void *)((int)pvVar8 + -4)); } local_30 = KAGE::Filesys::StreamBase::vftable; local_58 = KAGE::Filesys::BufferedStreamBase::vftable; local_54 = (int *)0x0; local_50 = 0; local_48 = local_4c; local_40 = 0; local_3c = 0; local_38 = 0; local_34 = 0; FUN_007dcd30(); ExceptionList = local_10; return; } //@@ 00918d00 NetplayManager::read_player_game_states_message /* WARNING: Removing unreachable block (ram,0x00919362) */ /* WARNING: Removing unreachable block (ram,0x00919371) */ /* WARNING: Removing unreachable block (ram,0x00919381) */ /* WARNING: Removing unreachable block (ram,0x00919387) */ /* DB: only string "Specified data is not a report player game states message"; decompresses (00a614d0) then memory_stream_read; the ZHL Entity_Pickup::TriggerShopPurchase signature matched wrongly */ void __thiscall NetplayManager::read_player_game_states_message(NetplayManager *this) { qword qVar1; Manager *pMVar2; uint uVar3; int iVar4; int iVar5; uint *puVar6; void *pvVar7; byte bVar8; uint uVar9; qword *pqVar10; code *pcVar11; NetplayManager NVar12; undefined **local_38; undefined4 local_34; undefined4 local_30; Manager *local_28; void *local_24; uint local_20; undefined8 local_1c; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09ecd; local_10 = ExceptionList; ExceptionList = &local_10; local_28 = g_manager; local_11 = 0; (**(code **)((int)this[10] + 0x14)) (&local_11,1,1,__security_cookie ^ (int)register0x00000010 - 4U); if (local_11 != 7) { KAGE_LogMessage(0x10,(byte *)"Specified data is not a report player game states message\n"); } local_1c = (ulonglong)(uint)local_1c; (**(code **)((int)this[10] + 0x14))((int)&local_1c + 4,4,1); bVar8 = 1; uVar9 = local_1c._4_4_ - 1; uVar3 = local_1c._4_4_ >> 1; while (uVar3 != 0) { uVar9 = uVar9 | uVar3; bVar8 = bVar8 + 1; uVar3 = local_1c._4_4_ >> (bVar8 & 0x1f); } local_1c = CONCAT44(uVar9 + 1,(uint)local_1c); local_24 = operator_new_tracked(uVar9 + 1); iVar4 = (**(code **)((int)this[10] + 8))(); iVar5 = (**(code **)((int)this[10] + 4))(); local_20 = iVar5 - iVar4; NVar12 = this[6]; if (NVar12 == (NetplayManager)0x0) { NVar12 = this[3]; } iVar4 = (**(code **)((int)this[10] + 8))(); buffer_decompress(iVar4 + (int)NVar12,local_20); local_38 = KAGE::Filesys::BufferedStream::vftable; local_8 = 0; local_11 = 0; memory_stream_read(&local_38,&local_11,1,1); pMVar2 = local_28; uVar9 = (uint)local_11; local_28 = (Manager *)&local_28[1]._gamestate.field_0xc8; iVar4 = *(int *)local_28; local_20 = uVar9; std::map::destroy_subtree(local_28,*(undefined4 *)(iVar4 + 4)); *(int *)(iVar4 + 4) = iVar4; *(int *)iVar4 = iVar4; *(int *)(iVar4 + 8) = iVar4; *(undefined4 *)&pMVar2[1]._gamestate.field_0xcc = 0; pcVar11 = free_exref; do { if (uVar9 == 0) { if (local_24 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar9 = *(uint *)((int)local_24 + -4); qVar1 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar9; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar1 < uVar9); (*pcVar11)((uint *)((int)local_24 + -4)); } ExceptionList = local_10; return; } local_1c = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_1c,8,1); } else { (*(code *)local_38[5])(&local_1c); } local_34 = (uint)local_1c; local_30 = local_1c._4_4_; puVar6 = (uint *)FUN_00913e50(&local_34); local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } *puVar6 = (uint)local_11; local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[1] = (uint)local_11; (**(code **)(puVar6[2] + 4))(0,0xffffffff); local_1c = local_1c & 0xffffffff; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,(void *)((int)&local_1c + 4),2,1); } else { (*(code *)local_38[5])((int)&local_1c + 4); } if ((short)(local_1c >> 0x20) != 0) { uVar9 = local_1c._4_4_ & 0xffff; pvVar7 = operator_new_tracked(uVar9); memory_stream_read(&local_38,pvVar7,1,uVar9); (**(code **)(puVar6[0xc] + 0x1c))(pvVar7,1,uVar9); if (pvVar7 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar9 = *(uint *)((int)pvVar7 + -4); qVar1 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar9; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar1 < uVar9); free((void *)((int)pvVar7 + -4)); local_8 = local_8 & 0xffffff00; } } local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[0xd] = (uint)local_11; local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[0xe] = (uint)local_11; (**(code **)(puVar6[0xf] + 4))(0,0xffffffff); local_1c = local_1c & 0xffffffff; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,(void *)((int)&local_1c + 4),2,1); } else { (*(code *)local_38[5])((int)&local_1c + 4); } if ((short)(local_1c >> 0x20) != 0) { uVar9 = local_1c._4_4_ & 0xffff; pvVar7 = operator_new_tracked(uVar9); memory_stream_read(&local_38,pvVar7,1,uVar9); (**(code **)(puVar6[0x19] + 0x1c))(pvVar7,1,uVar9); if (pvVar7 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar9 = *(uint *)((int)pvVar7 + -4); qVar1 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar9; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar1 < uVar9); free((void *)((int)pvVar7 + -4)); local_8 = local_8 & 0xffffff00; } } local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[0x1a] = (uint)local_11; local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[0x1b] = (uint)local_11; (**(code **)(puVar6[0x1c] + 4))(0,0xffffffff); local_1c = local_1c & 0xffffffff; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,(void *)((int)&local_1c + 4),2,1); } else { (*(code *)local_38[5])((int)&local_1c + 4); } if ((short)(local_1c >> 0x20) != 0) { uVar9 = local_1c._4_4_ & 0xffff; pvVar7 = operator_new_tracked(uVar9); memory_stream_read(&local_38,pvVar7,1,uVar9); (**(code **)(puVar6[0x26] + 0x1c))(pvVar7,1,uVar9); if (pvVar7 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar9 = *(uint *)((int)pvVar7 + -4); qVar1 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar9; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar1 < uVar9); free((void *)((int)pvVar7 + -4)); local_8 = local_8 & 0xffffff00; } } local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[0x27] = (uint)local_11; local_11 = 0; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,&local_11,1,1); } else { (*(code *)local_38[5])(&local_11); } puVar6[0x28] = (uint)local_11; (**(code **)(puVar6[0x29] + 4))(0,0xffffffff); local_1c = local_1c & 0xffffffff; if ((code *)local_38[5] == memory_stream_read) { memory_stream_read(&local_38,(void *)((int)&local_1c + 4),2,1); } else { (*(code *)local_38[5])((int)&local_1c + 4); } if ((short)(local_1c >> 0x20) == 0) { LAB_009192e4: pcVar11 = free_exref; } else { uVar9 = local_1c._4_4_ & 0xffff; pvVar7 = operator_new_tracked(uVar9); memory_stream_read(&local_38,pvVar7,1,uVar9); (**(code **)(puVar6[0x33] + 0x1c))(pvVar7,1,uVar9); if (pvVar7 == (void *)0x0) goto LAB_009192e4; if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar9 = *(uint *)((int)pvVar7 + -4); qVar1 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar9; pcVar11 = free_exref; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar1 < uVar9); free((void *)((int)pvVar7 + -4)); local_8 = local_8 & 0xffffff00; } local_20 = local_20 - 1; uVar9 = local_20; } while( true ); } //@@ 009193b0 FUN_009193b0 void FUN_009193b0(void) { uint uVar1; undefined4 *in_ECX; int *unaff_FS_OFFSET; int local_1c; undefined *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &DAT_00b09f00; local_1c = *unaff_FS_OFFSET; uVar1 = __security_cookie ^ (int)register0x00000010 - 0x10U; *unaff_FS_OFFSET = (int)&local_1c; KAGE::Filesys::BufferedStream::BufferedStream(in_ECX + 8,0); local_14 = 0; (**(code **)(in_ECX[8] + 8))(uVar1); (**(code **)(in_ECX[8] + 4))(0,0xffffffff); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; *unaff_FS_OFFSET = local_1c; return; } //@@ 00919440 shared_save_write /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? builds a PersistentGameData snapshot (PersistentGameData::constructor + copy of the bestiary/achievements), serializes it through two BufferedStreams and writes "sharedsave%d.dat" (save slot Manager+0x10) via SaveDataManager::open_file_write with a gmtime header ("%02d_%02d_%d__%02d_%02d_%02d"); callers PersistentGameData::Save and PersistentGameData::SaveToSteamCloud prototype: db/protos.zhl */ byte __cdecl shared_save_write(void) { undefined1 *this; Manager *pMVar1; byte bVar2; char cVar3; int iVar4; uint uVar5; int *piVar6; tm *ptVar7; uint local_2070; uint uStack_206c; int *local_2064; undefined1 local_205d; uint local_205c; PersistentGameData local_2058; PersistentGameData local_10c8; byte local_138; undefined4 local_130; undefined4 local_12c; char local_128; undefined1 uStack_127; undefined1 uStack_126; undefined1 uStack_125; undefined1 uStack_124; undefined1 uStack_123; undefined1 uStack_122; undefined1 uStack_121; undefined1 uStack_120; undefined1 uStack_11f; undefined1 uStack_11e; undefined1 uStack_11d; undefined1 uStack_11c; undefined1 uStack_11b; undefined1 uStack_11a; undefined1 uStack_119; undefined2 local_118; undefined2 uStack_116; undefined2 uStack_114; undefined2 uStack_112; undefined2 uStack_110; undefined2 uStack_10e; undefined2 uStack_10c; undefined2 uStack_10a; int local_108; undefined4 local_100; undefined4 uStack_fc; undefined4 uStack_f8; undefined4 uStack_f4; undefined4 local_f0; undefined4 uStack_ec; undefined4 uStack_e8; undefined4 uStack_e4; int local_e0; uint local_dc; int local_d4; int local_c8; undefined4 local_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined4 uStack_a4; undefined4 local_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; int local_90; uint local_8c; int local_84; int local_78; byte local_5c [32]; byte local_3c [12]; undefined1 local_30 [8]; int local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pMVar1 = g_manager; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00b09f6f; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_30 + 0x20); ExceptionList = &local_1c; if (DAT_00c71672 == '\0') { bVar2 = 1; } else { this = &g_manager[1]._gamestate.field_0x70; cVar3 = FUN_0091b510(local_24); if (((cVar3 != '\0') && (iVar4 = (**(code **)(*(int *)&pMVar1[1]._gamestate.field_0xb8 + 4))(), iVar4 != 0)) && ((g_game == (Game *)0x0 || (*(int *)&g_game->_deathmatchManager < 2)))) { PersistentGameData::constructor(&local_2058); local_14 = 0; PersistentGameDataReader::read(this,&local_2058); pMVar1 = g_manager; PersistentGameData::copy_shared_progress(); PersistentGameData::copy_constructor(&pMVar1->_persistentGameData); local_14 = CONCAT31(local_14._1_3_,1); iVar4 = FUN_0090b070(); if ((iVar4 != 0) && (iVar4 = FUN_004253d0(), iVar4 != 0)) { memset(&DAT_00c716a0,0,0xb74); memcpy(&DAT_00c716a0,*(void **)(iVar4 + 0x16c8), *(int *)(iVar4 + 0x16cc) - (int)*(void **)(iVar4 + 0x16c8) & 0xfffffffc); } pMVar1 = g_manager; uVar5 = 0; do { *(bool *)((int)local_10c8._eventCounters + uVar5 + 0x82c) = 0 < (int)(&DAT_00c716a0)[uVar5]; uVar5 = uVar5 + 1; } while (uVar5 < 0x2dd); local_14 = CONCAT31(local_14._1_3_,2); if (g_userProfile == (void *)0x0) { uStack_206c = 0; local_2070 = 0; } else { local_2070 = *(uint *)((int)g_userProfile + 8); uStack_206c = *(uint *)((int)g_userProfile + 0xc); } local_2064 = (int *)uStack_206c; local_205c = local_2070; FUN_00731ee0(local_30,&local_2070); if (((*(char *)(local_28 + 0xd) != '\0') || (local_2064 < *(uint *)(local_28 + 0x14))) || ((local_2064 <= *(uint *)(local_28 + 0x14) && (local_205c < *(uint *)(local_28 + 0x10))))) { local_28 = *(int *)&pMVar1[1]._gamestate.field_0xc0; } if (local_28 != *(int *)&pMVar1[1]._gamestate.field_0xc0) { FUN_00914150(&local_2070); } PersistentGameData::copy_shared_progress(); local_14._0_1_ = 1; KAGE::Filesys::BufferedStream::BufferedStream(&local_e0,0); local_14._0_1_ = 3; (**(code **)(local_e0 + 8))(); (**(code **)(local_e0 + 4))(0,0xffffffff); local_100 = 0; uStack_fc = 0; uStack_f8 = 0; uStack_f4 = 0; local_f0 = 0; uStack_ec = 0; uStack_e8 = 0; uStack_e4 = 0; local_14._0_1_ = 4; KAGE::Filesys::BufferedStream::BufferedStream(&local_90,0); local_14._0_1_ = 5; (**(code **)(local_90 + 8))(); (**(code **)(local_90 + 4))(0,0xffffffff); local_b0 = 0; uStack_ac = 0; uStack_a8 = 0; uStack_a4 = 0; local_a0 = 0; uStack_9c = 0; uStack_98 = 0; uStack_94 = 0; local_14 = CONCAT31(local_14._1_3_,6); PersistentGameDataWriter::write(&local_100,&local_2058,this); PersistentGameDataWriter::write(&local_b0,&local_10c8,this); sprintf(local_5c,(byte *)"sharedsave%d.dat"); piVar6 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,local_5c,0); local_2064 = piVar6; if (piVar6 != (int *)0x0) { (**(code **)(*piVar6 + 0x1c))(&DAT_00b79dac,1,4); local_205d = 2; (**(code **)(*piVar6 + 0x1c))(&local_205d,1,1); local_130 = *(undefined4 *)&g_manager[1]._persistentGameData.field_0x8; local_12c = *(undefined4 *)&g_manager[1]._persistentGameData.field_0xc; local_138 = 1; ptVar7 = _gmtime64((__time64_t *)&local_130); local_138 = local_138 & 0xfc; local_128 = (char)ptVar7->tm_sec; uStack_127 = *(undefined1 *)((int)&ptVar7->tm_sec + 1); uStack_126 = *(undefined1 *)((int)&ptVar7->tm_sec + 2); uStack_125 = *(undefined1 *)((int)&ptVar7->tm_sec + 3); uStack_124 = (undefined1)ptVar7->tm_min; uStack_123 = *(undefined1 *)((int)&ptVar7->tm_min + 1); uStack_122 = *(undefined1 *)((int)&ptVar7->tm_min + 2); uStack_121 = *(undefined1 *)((int)&ptVar7->tm_min + 3); uStack_120 = (undefined1)ptVar7->tm_hour; uStack_11f = *(undefined1 *)((int)&ptVar7->tm_hour + 1); uStack_11e = *(undefined1 *)((int)&ptVar7->tm_hour + 2); uStack_11d = *(undefined1 *)((int)&ptVar7->tm_hour + 3); uStack_11c = (undefined1)ptVar7->tm_mday; uStack_11b = *(undefined1 *)((int)&ptVar7->tm_mday + 1); uStack_11a = *(undefined1 *)((int)&ptVar7->tm_mday + 2); uStack_119 = *(undefined1 *)((int)&ptVar7->tm_mday + 3); local_118 = (undefined2)ptVar7->tm_mon; uStack_116 = *(undefined2 *)((int)&ptVar7->tm_mon + 2); uStack_114 = (undefined2)ptVar7->tm_year; uStack_112 = *(undefined2 *)((int)&ptVar7->tm_year + 2); uStack_110 = (undefined2)ptVar7->tm_wday; uStack_10e = *(undefined2 *)((int)&ptVar7->tm_wday + 2); uStack_10c = (undefined2)ptVar7->tm_yday; uStack_10a = *(undefined2 *)((int)&ptVar7->tm_yday + 2); local_108 = ptVar7->tm_isdst; local_205c = (uint)local_128; sprintf_s(local_3c,0x18,(byte *)"%02d_%02d_%d__%02d_%02d_%02d"); piVar6 = local_2064; (**(code **)(*local_2064 + 0x1c))(local_3c,1,0x18); local_205c = local_dc; (**(code **)(*piVar6 + 0x1c))(&local_205c,4,1); if (local_c8 != 0) { local_d4 = local_c8; } (**(code **)(*piVar6 + 0x1c))(local_d4,1,local_dc); local_205c = local_8c; (**(code **)(*piVar6 + 0x1c))(&local_205c,4,1); if (local_78 != 0) { local_84 = local_78; } (**(code **)(*piVar6 + 0x1c))(local_84,1,local_8c); (**(code **)*piVar6)(1); } FUN_00a58200(); FUN_00a58200(); local_14 = CONCAT31(local_14._1_3_,7); if (local_10c8._saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_10c8._saveFile)(1); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)&local_10c8._bestiaryEncounters); std::string::_Tidy_deallocate(&local_10c8.field_0x20); std::string::_Tidy_deallocate(&local_10c8.field_0x8); local_14 = 8; if (local_2058._saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_2058._saveFile)(1); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)&local_2058._bestiaryEncounters); std::string::_Tidy_deallocate(&local_2058.field_0x20); std::string::_Tidy_deallocate(&local_2058.field_0x8); } bVar2 = 0; } ExceptionList = local_1c; return bVar2; } //@@ 00919980 Menu_Save::load_slot_data /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Menu_Save::Reset for each slot after Manager::SetSaveSlot; constructs a local PersistentGameData, reads "sharedsave%d.dat", logs "Merging eden coins: pdTokens=..." */ void Menu_Save::load_slot_data(void) { PersistentGameData *pPVar1; undefined1 isMerged; uint uVar2; int *piVar3; tm *utcTime; byte *achievement; int gain; char *pcVar4; char *dstFlag; int iVar5; int *piVar6; byte isAchieved; char isFlagSet; undefined4 extraout_ECX; int shareEndOffset; PersistentGameData *pPVar7; int remaining; int gain; byte *shareEndAchievement; int shareStartOffset; int *local_2ffc; int *nodeKey; void *local_2ff4; PersistentGameData *local_2ff0; byte local_2fea; char headerChar; undefined1 local_2fe8 [3984]; PersistentGameData local_2058; PersistentGameData local_10c8; undefined4 shareEndReader; undefined4 uStack_134; undefined4 uStack_130; undefined4 uStack_12c; undefined4 local_128; undefined4 uStack_124; undefined4 uStack_120; undefined4 uStack_11c; int shareEndStream [12]; undefined4 shareStartReader; undefined4 uStack_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 local_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; int shareStartStream; uint local_c4; int local_bc; int local_b8; int local_b0; int local_ac; uint local_a8; uint local_a4; undefined1 local_a0 [8]; byte local_98; undefined8 local_90; PersistentGameData *local_88; PersistentGameData *pPStack_84; int iStack_80; int iStack_7c; int local_78; PersistentGameData *pPStack_74; int iStack_70; int iStack_6c; int local_68; undefined **local_64; byte fileName [32]; byte timestamp [24]; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = timestamp + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00b0a002; local_1c = ExceptionList; uVar2 = __security_cookie ^ (uint)(timestamp + 0x2c); ExceptionList = &local_1c; stackCookie = uVar2; sprintf(fileName,(byte *)"sharedsave%d.dat"); piVar3 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,fileName); if (piVar3 == (int *)0x0) { Manager::SetSaveSlot(g_manager,g_manager->_currentSaveSlot); DAT_00c71672 = 0; ExceptionList = local_1c; return; } local_2fea = 1; headerChar = '\0'; (**(code **)(*piVar3 + 0x14))(&headerChar,1,1,uVar2); if (headerChar == 'v') { headerChar = '\0'; (**(code **)(*piVar3 + 0x14))(&headerChar,1,1); if (headerChar != 'e') goto LAB_00919ab9; headerChar = '\0'; (**(code **)(*piVar3 + 0x14))(&headerChar,1,1); if (headerChar != 'r') goto LAB_00919ab9; headerChar = '\0'; (**(code **)(*piVar3 + 0x14))(&headerChar,1,1); if (headerChar != '=') goto LAB_00919ab9; local_2fea = FUN_00a28210(extraout_ECX); if (1 < local_2fea) { (**(code **)(*piVar3 + 0x14))(timestamp,1,0x18); goto LAB_00919b8b; } } else { LAB_00919ab9: (**(code **)(*piVar3 + 0xc))(0,0); } local_90 = FUN_00a61490(); local_98 = 1; utcTime = _gmtime64(&local_90); local_98 = local_98 & 0xfc; local_88 = (PersistentGameData *)utcTime->tm_sec; pPStack_84 = (PersistentGameData *)utcTime->tm_min; iStack_80 = utcTime->tm_hour; iStack_7c = utcTime->tm_mday; local_78 = utcTime->tm_mon; pPStack_74 = (PersistentGameData *)utcTime->tm_year; iStack_70 = utcTime->tm_wday; iStack_6c = utcTime->tm_yday; local_68 = utcTime->tm_isdst; local_2ffc = (int *)(int)(char)utcTime->tm_sec; sprintf_s(timestamp,0x18,(byte *)"%02d_%02d_%d__%02d_%02d_%02d"); LAB_00919b8b: local_2ff0 = (PersistentGameData *)0x0; (**(code **)(*piVar3 + 0x14))(&local_2ff0,4,1); pPVar1 = local_2ff0; local_2ff4 = operator_new_tracked((uint)local_2ff0); (**(code **)(*piVar3 + 0x14))(local_2ff4,1,pPVar1); local_2ff0 = (PersistentGameData *)0x0; (**(code **)(*piVar3 + 0x14))(&local_2ff0,4,1); pPVar7 = local_2ff0; local_2ff0 = operator_new_tracked((uint)local_2ff0); (**(code **)(*piVar3 + 0x14))(local_2ff0,1,pPVar7); (**(code **)*piVar3)(1); KAGE::Filesys::BufferedStream::BufferedStream(&shareStartStream,0); local_14 = 0; (**(code **)(shareStartStream + 8))(); (**(code **)(shareStartStream + 4))(0,0xffffffff); shareStartReader = 0; uStack_e4 = 0; uStack_e0 = 0; uStack_dc = 0; local_d8 = 0; uStack_d4 = 0; uStack_d0 = 0; uStack_cc = 0; local_14 = 1; KAGE::Filesys::BufferedStream::BufferedStream(shareEndStream,0); local_14._0_1_ = 2; (**(code **)(shareEndStream[0] + 8))(); (**(code **)(shareEndStream[0] + 4))(0,0xffffffff); shareEndReader = 0; uStack_134 = 0; uStack_130 = 0; uStack_12c = 0; local_128 = 0; uStack_124 = 0; uStack_120 = 0; uStack_11c = 0; iStack_80 = 0; local_78 = 0; pPStack_84 = pPVar1; local_88 = pPVar1; pPStack_74 = local_2ff4; local_68 = 0; iStack_6c = 0; iStack_70 = 0; iStack_7c = 0; local_90._4_4_ = KAGE::Filesys::BufferedStream::vftable; local_64 = KAGE::Filesys::BufferedStream::vftable; local_14._0_1_ = 4; KAGE::Filesys::BufferedStream::operator_assign((int)&local_90 + 4); FUN_00a58200(); pPVar1 = local_2ff0; iStack_80 = 0; local_78 = 0; pPStack_84 = pPVar7; local_88 = pPVar7; pPStack_74 = local_2ff0; local_68 = 0; iStack_6c = 0; iStack_70 = 0; iStack_7c = 0; local_90._4_4_ = KAGE::Filesys::BufferedStream::vftable; local_64 = KAGE::Filesys::BufferedStream::vftable; local_14._0_1_ = 5; KAGE::Filesys::BufferedStream::operator_assign((int)&local_90 + 4); local_14 = CONCAT31(local_14._1_3_,3); FUN_00a58200(); if (1 < local_2fea) { local_a8 = local_c4 - 0x20; uVar2 = local_b8 - local_bc; if (local_b0 != 0) { uVar2 = local_c4; } if ((local_a8 < local_a4) || (uVar2 < local_a8 - local_a4)) { KAGE::Filesys::BufferedStream::rebuffer(&shareStartStream); } local_ac = local_a8 - local_a4; memory_stream_read(local_a0,&shareStartReader,8,4); } manager = g_manager; pPVar7 = &g_manager->_persistentGameData; local_2ff0 = pPVar7; PersistentGameData::copy_constructor(pPVar7); local_14._0_1_ = 6; PersistentGameData::constructor(&local_2058); local_14._0_1_ = 7; PersistentGameData::constructor(&local_10c8); local_14._0_1_ = 8; PersistentGameDataReader::read(&shareStartReader,&local_2058); PersistentGameDataReader::read(&shareEndReader,&local_10c8); if (local_2ff4 != (void *)0x0) { local_14._0_1_ = 9; tracked_alloc(1,local_2ff4,0); local_14._0_1_ = 8; } if (pPVar1 != (PersistentGameData *)0x0) { local_14._0_1_ = 10; tracked_alloc(1,pPVar1,0); local_14._0_1_ = 8; } Manager::SetSaveSlot(g_manager,g_manager->_currentSaveSlot); local_2ff4 = (void *)0x6b; gain = (int)&local_10c8 + (1 - (int)pPVar7); achievement = (manager->_persistentGameData)._achievements + 1; shareEndOffset = (int)&local_10c8 - (int)pPVar7; iVar5 = (int)&local_10c8 + (2 - (int)pPVar7); shareEndAchievement = local_10c8._achievements; do { if ((achievement[-1] == 0) && (*shareEndAchievement == 0)) { isAchieved = 0; } else { isAchieved = 1; } achievement[-1] = isAchieved; if ((*achievement == 0) && (achievement[shareEndOffset] == 0)) { isAchieved = 0; } else { isAchieved = 1; } *achievement = isAchieved; if ((achievement[1] == 0) && (achievement[gain] == 0)) { isAchieved = 0; } else { isAchieved = 1; } achievement[1] = isAchieved; if ((achievement[2] == 0) && (achievement[iVar5] == 0)) { isAchieved = 0; } else { isAchieved = 1; } achievement[2] = isAchieved; if ((achievement[3] == 0) && (achievement[(int)&local_10c8 + (3 - (int)pPVar7)] == 0)) { isAchieved = 0; } else { isAchieved = 1; } achievement[3] = isAchieved; if ((achievement[4] == 0) && (achievement[(int)&local_10c8 + (4 - (int)pPVar7)] == 0)) { isAchieved = 0; } else { isAchieved = 1; } achievement[4] = isAchieved; shareEndAchievement = shareEndAchievement + 6; achievement = achievement + 6; local_2ff4 = (void *)((int)local_2ff4 + -1); } while (local_2ff4 != (void *)0x0); shareStartOffset = (int)&local_2058 - (int)local_2ff0; piVar3 = local_2ff0->_eventCounters; remaining = 0x20b; do { gain = *(int *)((int)piVar3 + shareEndOffset) - *(int *)(shareStartOffset + (int)piVar3); if (gain < 0) { gain = 0; } *piVar3 = *piVar3 + gain; piVar3 = piVar3 + 1; remaining = remaining + -1; } while (remaining != 0); local_2ff4 = (void *)0x2dd; pcVar4 = &local_2ff0->field_0xae8; do { if ((*pcVar4 == '\0') && (pcVar4[shareEndOffset] == '\0')) { isFlagSet = '\0'; } else { isFlagSet = '\x01'; } *pcVar4 = isFlagSet; pcVar4 = pcVar4 + 1; local_2ff4 = (void *)((int)local_2ff4 + -1); } while (local_2ff4 != (void *)0x0); piVar3 = (int *)&local_2ff0->field_0xdc8; remaining = 0xe; do { gain = *(int *)((int)piVar3 + shareEndOffset) - *(int *)((int)piVar3 + shareStartOffset); if (gain < 0) { gain = 0; } *piVar3 = *piVar3 + gain; piVar3 = piVar3 + 1; remaining = remaining + -1; } while (remaining != 0); if ((local_2ff0->field_0xe00 == '\0') && (local_10c8._3584_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe00 = isMerged; if ((local_2ff0->field_0xe01 == '\0') && (local_10c8._3585_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe01 = isMerged; if ((local_2ff0->field_0xe02 == '\0') && (local_10c8._3586_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe02 = isMerged; if ((local_2ff0->field_0xe03 == '\0') && (local_10c8._3587_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe03 = isMerged; if ((local_2ff0->field_0xe04 == '\0') && (local_10c8._3588_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe04 = isMerged; if ((local_2ff0->field_0xe05 == '\0') && (local_10c8._3589_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe05 = isMerged; if ((local_2ff0->field_0xe06 == '\0') && (local_10c8._3590_1_ == '\0')) { isMerged = 0; } else { isMerged = 1; } local_2ff0->field_0xe06 = isMerged; pcVar4 = &local_10c8.field_0xe07; dstFlag = &local_2ff0->field_0xe08; local_2ff4 = (void *)0x1a; do { if ((dstFlag[-1] == '\0') && (*pcVar4 == '\0')) { isFlagSet = '\0'; } else { isFlagSet = '\x01'; } dstFlag[-1] = isFlagSet; if ((*dstFlag == '\0') && (dstFlag[shareEndOffset] == '\0')) { isFlagSet = '\0'; } else { isFlagSet = '\x01'; } *dstFlag = isFlagSet; if ((dstFlag[1] == '\0') && (dstFlag[gain] == '\0')) { isFlagSet = '\0'; } else { isFlagSet = '\x01'; } dstFlag[1] = isFlagSet; if ((dstFlag[2] == '\0') && (dstFlag[iVar5] == '\0')) { isFlagSet = '\0'; } else { isFlagSet = '\x01'; } dstFlag[2] = isFlagSet; pcVar4 = pcVar4 + 4; dstFlag = dstFlag + 4; local_2ff4 = (void *)((int)local_2ff4 + -1); } while (local_2ff4 != (void *)0x0); gain = 0x1b; piVar3 = local_2ff0->_cutsceneCounters; do { iVar5 = *(int *)((int)piVar3 + shareEndOffset) - *(int *)((int)piVar3 + shareStartOffset); nodeKey = (int *)0x0; if (iVar5 < 0) { iVar5 = 0; } *piVar3 = *piVar3 + iVar5; gain = gain + -1; piVar3 = piVar3 + 1; } while (gain != 0); pcVar4 = &local_10c8.field_0xe6f; gain = 0x17; dstFlag = &local_2ff0->field_0xe70; do { if ((dstFlag[-1] != '\0') || (local_2fea = '\0', *pcVar4 != '\0')) { local_2fea = '\x01'; } dstFlag[-1] = local_2fea; if ((*dstFlag != '\0') || (local_2fea = '\0', dstFlag[shareEndOffset] != '\0')) { local_2fea = '\x01'; } pcVar4 = pcVar4 + 2; *dstFlag = local_2fea; dstFlag = dstFlag + 2; gain = gain + -1; } while (gain != 0); local_2ffc = *(int **)local_10c8._bestiaryEncounters._head; local_2ff4 = (void *)0x0; if (local_2ffc != local_10c8._bestiaryEncounters._head) { do { piVar3 = local_2ffc + 4; nodeKey = piVar3; piVar6 = (int *)std::map::operator_index(piVar3); gain = *piVar6; piVar3 = (int *)std::map::operator_index(piVar3); iVar5 = *piVar3; piVar3 = (int *)std::map::operator_index(nodeKey); iVar5 = iVar5 - gain; if (iVar5 < 0) { iVar5 = 0; } *piVar3 = *piVar3 + iVar5; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_2ffc); } while (local_2ffc != local_10c8._bestiaryEncounters._head); } local_2ffc = *(int **)local_10c8._bestiaryKills._head; if (local_2ffc != local_10c8._bestiaryKills._head) { do { piVar3 = local_2ffc + 4; nodeKey = piVar3; piVar6 = (int *)std::map::operator_index(piVar3); gain = *piVar6; piVar3 = (int *)std::map::operator_index(piVar3); iVar5 = *piVar3; piVar3 = (int *)std::map::operator_index(nodeKey); iVar5 = iVar5 - gain; if (iVar5 < 0) { iVar5 = 0; } *piVar3 = *piVar3 + iVar5; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_2ffc); } while (local_2ffc != local_10c8._bestiaryKills._head); } pPVar1 = local_2ff0; KAGE_LogMessage(1,(byte *)"Merging eden coins: pdTokens = %d, shareStart = %d, shareEnd = %d \n"); gain = pPVar1->_eventCounters[0x15] + (local_10c8._eventCounters[0x15] - local_2058._eventCounters[0x15]); DAT_00c71672 = 0; if (gain < 0) { gain = 0; } pPVar1->_eventCounters[0x15] = gain; pPVar1->_eventCounters[0x72] = local_10c8._eventCounters[0x72]; *(undefined1 *)pPVar1 = 1; FUN_00929660(0); FUN_00903040(local_2fe8,pPVar1,&shareStartReader,&shareEndReader); FUN_00a25510(fileName); FUN_00926240(); FUN_00926240(); FUN_00926240(); FUN_00a58200(); FUN_00a58200(); DAT_00c71672 = 0; ExceptionList = local_1c; return; } //@@ 0091a450 load_persistent_game_data_buffer /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (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 lookups; from 0090c560 */ void load_persistent_game_data_buffer(int param_1) { undefined4 uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; char *pcVar15; int iVar16; int iVar17; uint uVar18; uint extraout_ECX; uint uVar19; uint extraout_ECX_00; uint in_EDX; uint *puVar20; uint *puVar21; uint *puVar22; uint *puVar23; byte *pbVar24; byte *pbVar25; int *piVar26; undefined4 *puVar27; int *unaff_FS_OFFSET; undefined1 local_1034 [8]; int *local_102c; undefined1 local_1028 [8]; int *local_1020; int local_101c; int local_1018; int *local_1014; undefined4 local_1010; int *local_100c; undefined4 local_1008; uint local_1004; uint local_1000; int *local_ffc; int local_ff8; int *local_ff4; uint local_ff0; int local_fec; undefined8 local_fe8; int local_fe0; int *local_fdc; PersistentGameData local_fd8; undefined4 local_48 [9]; uint local_24; undefined1 *puStack_20; int local_1c; undefined *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)(local_48 + 0x11); local_14 = 0xffffffff; puStack_18 = &DAT_00b0a06c; local_1c = *unaff_FS_OFFSET; local_24 = __security_cookie ^ (uint)(local_48 + 0xe); *unaff_FS_OFFSET = (int)&local_1c; local_1018 = param_1; local_1004 = in_EDX; PersistentGameData::constructor(&local_fd8); local_14 = 0; memset(local_fd8._achievements,1,0x282); memset(local_fd8._eventCounters,0xff,0x82c); memset(&local_fd8.field_0xae8,1,0x2dd); memset(&local_fd8.field_0xdc8,0xff,0x38); local_fd8._3584_4_ = 0x1010101; local_fd8._3588_2_ = 0x101; local_fd8._3590_1_ = 1; memset(&local_fd8.field_0xe07,1,0x68); local_fd8._cutsceneCounters[0x18] = 0x7fffffff; local_fd8._cutsceneCounters[0x19] = 0x7fffffff; local_fd8._cutsceneCounters[0] = 0x7fffffff; local_fd8._cutsceneCounters[1] = 0x7fffffff; local_fd8._cutsceneCounters[2] = 0x7fffffff; local_fd8._cutsceneCounters[3] = 0x7fffffff; local_fd8._cutsceneCounters[0x1a] = 0x7fffffff; local_fd8._cutsceneCounters[4] = 0x7fffffff; local_fd8._cutsceneCounters[5] = 0x7fffffff; local_fd8._cutsceneCounters[6] = 0x7fffffff; local_fd8._cutsceneCounters[7] = 0x7fffffff; local_fd8._cutsceneCounters[8] = 0x7fffffff; local_fd8._cutsceneCounters[9] = 0x7fffffff; local_fd8._cutsceneCounters[10] = 0x7fffffff; local_fd8._cutsceneCounters[0xb] = 0x7fffffff; local_fd8._cutsceneCounters[0xc] = 0x7fffffff; local_fd8._cutsceneCounters[0xd] = 0x7fffffff; local_fd8._cutsceneCounters[0xe] = 0x7fffffff; local_fd8._cutsceneCounters[0xf] = 0x7fffffff; local_fd8._cutsceneCounters[0x10] = 0x7fffffff; local_fd8._cutsceneCounters[0x11] = 0x7fffffff; local_fd8._cutsceneCounters[0x12] = 0x7fffffff; local_fd8._cutsceneCounters[0x13] = 0x7fffffff; local_fd8._cutsceneCounters[0x14] = 0x7fffffff; local_fd8._cutsceneCounters[0x15] = 0x7fffffff; local_fd8._cutsceneCounters[0x16] = 0x7fffffff; local_fd8._cutsceneCounters[0x17] = 0x7fffffff; local_fe8 = 0; FUN_0091b0f0(&local_fd8,&local_fe8); local_ffc = (int *)0x0; local_ff8 = 0; local_ffc = operator_new(0x18); *local_ffc = (int)local_ffc; local_ffc[1] = (int)local_ffc; local_ffc[2] = (int)local_ffc; *(undefined2 *)(local_ffc + 3) = 0x101; local_14._0_1_ = 1; local_1014 = (int *)0x0; local_1010 = 0; local_1014 = operator_new(0x18); *local_1014 = (int)local_1014; local_1014[1] = (int)local_1014; local_1014[2] = (int)local_1014; *(undefined2 *)(local_1014 + 3) = 0x101; local_14._0_1_ = 2; local_ff4 = (int *)0x0; local_ff0 = 0; local_ff4 = operator_new(0x18); *local_ff4 = (int)local_ff4; local_ff4[1] = (int)local_ff4; local_ff4[2] = (int)local_ff4; *(undefined2 *)(local_ff4 + 3) = 0x101; local_14._0_1_ = 3; local_100c = (int *)0x0; local_1008 = 0; local_100c = operator_new(0x18); *local_100c = (int)local_100c; local_100c[1] = (int)local_100c; local_100c[2] = (int)local_100c; *(undefined2 *)(local_100c + 3) = 0x101; local_14 = CONCAT31(local_14._1_3_,4); local_1000 = 0; local_48[0] = 0; local_48[1] = 0; local_48[2] = 0; local_48[3] = 0; local_48[4] = 0; local_48[5] = 0; local_48[6] = 0; local_48[7] = 0; if (in_EDX == 0) { local_fe8 = CONCAT44(local_fec,(undefined4)local_fe8); } else { do { iVar17 = local_1018; puVar27 = (undefined4 *)(local_1000 * 0x50 + local_fec); iVar16 = *(int *)(local_1018 + 0x38); uVar1 = puVar27[1]; local_48[local_1000 * 2] = *puVar27; local_48[local_1000 * 2 + 1] = uVar1; if (iVar16 != 0) { KAGE_LogMessage(0x10,(byte *)"Attempting to retrieve read-only buffer in a writable mode\n") ; } puVar20 = *(uint **)(iVar17 + 0x2c); puVar22 = (uint *)puVar27[0xe]; if (puVar22 == (uint *)0x0) { puVar22 = (uint *)puVar27[0xb]; } if ((puVar22 + 0x14 < puVar20) || (iVar16 = 0, puVar20 + 0x14 < puVar22)) { iVar16 = -0x40; uVar19 = puVar22[1]; uVar18 = puVar22[2]; uVar2 = puVar22[3]; *puVar20 = *puVar22 & *puVar20; puVar20[1] = uVar19 & puVar20[1]; puVar20[2] = uVar18 & puVar20[2]; puVar20[3] = uVar2 & puVar20[3]; uVar19 = puVar22[5]; uVar18 = puVar22[6]; uVar2 = puVar22[7]; puVar20[4] = puVar22[4] & puVar20[4]; puVar20[5] = uVar19 & puVar20[5]; puVar20[6] = uVar18 & puVar20[6]; puVar20[7] = uVar2 & puVar20[7]; uVar19 = puVar22[9]; uVar18 = puVar22[10]; uVar2 = puVar22[0xb]; puVar20[8] = puVar22[8] & puVar20[8]; puVar20[9] = uVar19 & puVar20[9]; puVar20[10] = uVar18 & puVar20[10]; puVar20[0xb] = uVar2 & puVar20[0xb]; uVar19 = puVar22[0xd]; uVar18 = puVar22[0xe]; uVar2 = puVar22[0xf]; puVar20[0xc] = puVar22[0xc] & puVar20[0xc]; puVar20[0xd] = uVar19 & puVar20[0xd]; puVar20[0xe] = uVar18 & puVar20[0xe]; puVar20[0xf] = uVar2 & puVar20[0xf]; puVar20 = puVar20 + 0x10; puVar22 = puVar22 + 0x10; } iVar16 = iVar16 + 0x51; do { puVar23 = puVar22; puVar21 = puVar20; *(byte *)puVar21 = (byte)*puVar21 & (byte)*puVar23; puVar22 = (uint *)((int)puVar23 + 1); local_fe8 = CONCAT44(puVar21,(undefined4)local_fe8); puVar20 = (uint *)((int)puVar21 + 1); iVar16 = iVar16 + -1; } while (iVar16 != 0); iVar16 = 0; if ((1 < __isa_available) && (((uint *)((int)puVar23 + 0x20bU) < puVar20 || (iVar16 = 0, (uint *)((int)puVar21 + 0x20b) < puVar22)))) { iVar16 = 0x20; do { uVar19 = *puVar20; uVar18 = puVar20[1]; uVar2 = puVar20[2]; uVar3 = puVar20[3]; uVar4 = *puVar22; uVar5 = puVar22[1]; uVar6 = puVar22[2]; uVar7 = puVar22[3]; *puVar20 = (uVar19 < uVar4) * uVar19 | (uVar19 >= uVar4) * uVar4; puVar20[1] = (uVar18 < uVar5) * uVar18 | (uVar18 >= uVar5) * uVar5; puVar20[2] = (uVar2 < uVar6) * uVar2 | (uVar2 >= uVar6) * uVar6; puVar20[3] = (uVar3 < uVar7) * uVar3 | (uVar3 >= uVar7) * uVar7; uVar19 = puVar20[4]; uVar18 = puVar20[5]; uVar2 = puVar20[6]; uVar3 = puVar20[7]; uVar4 = puVar22[4]; uVar5 = puVar22[5]; uVar6 = puVar22[6]; uVar7 = puVar22[7]; puVar20[4] = (uVar19 < uVar4) * uVar19 | (uVar19 >= uVar4) * uVar4; puVar20[5] = (uVar18 < uVar5) * uVar18 | (uVar18 >= uVar5) * uVar5; puVar20[6] = (uVar2 < uVar6) * uVar2 | (uVar2 >= uVar6) * uVar6; puVar20[7] = (uVar3 < uVar7) * uVar3 | (uVar3 >= uVar7) * uVar7; uVar19 = puVar20[8]; uVar18 = puVar20[9]; uVar2 = puVar20[10]; uVar3 = puVar20[0xb]; uVar4 = puVar22[8]; uVar5 = puVar22[9]; uVar6 = puVar22[10]; uVar7 = puVar22[0xb]; puVar20[8] = (uVar19 < uVar4) * uVar19 | (uVar19 >= uVar4) * uVar4; puVar20[9] = (uVar18 < uVar5) * uVar18 | (uVar18 >= uVar5) * uVar5; puVar20[10] = (uVar2 < uVar6) * uVar2 | (uVar2 >= uVar6) * uVar6; puVar20[0xb] = (uVar3 < uVar7) * uVar3 | (uVar3 >= uVar7) * uVar7; uVar19 = puVar20[0xc]; uVar18 = puVar20[0xd]; uVar2 = puVar20[0xe]; uVar3 = puVar20[0xf]; uVar4 = puVar22[0xc]; uVar5 = puVar22[0xd]; uVar6 = puVar22[0xe]; uVar7 = puVar22[0xf]; puVar22 = puVar22 + 0x10; puVar20[0xc] = (uVar19 < uVar4) * uVar19 | (uVar19 >= uVar4) * uVar4; puVar20[0xd] = (uVar18 < uVar5) * uVar18 | (uVar18 >= uVar5) * uVar5; puVar20[0xe] = (uVar2 < uVar6) * uVar2 | (uVar2 >= uVar6) * uVar6; puVar20[0xf] = (uVar3 < uVar7) * uVar3 | (uVar3 >= uVar7) * uVar7; puVar20 = puVar20 + 0x10; iVar16 = iVar16 + -1; } while (iVar16 != 0); iVar16 = -0x200; } iVar16 = iVar16 + 0x20b; do { puVar23 = puVar22; puVar21 = puVar20; uVar19 = *puVar23; if (*puVar21 <= *puVar23) { uVar19 = *puVar21; } puVar22 = puVar23 + 1; *puVar21 = uVar19; puVar20 = puVar21 + 1; iVar16 = iVar16 + -1; } while (iVar16 != 0); if (((uint *)((int)puVar23 + 0x5fU) < puVar20) || (iVar16 = 0, (uint *)((int)puVar21 + 0x5fU) < puVar22)) { iVar16 = -0x40; uVar19 = puVar23[2]; uVar18 = puVar23[3]; uVar2 = puVar23[4]; *puVar20 = *puVar22 & *puVar20; puVar21[2] = uVar19 & puVar21[2]; puVar21[3] = uVar18 & puVar21[3]; puVar21[4] = uVar2 & puVar21[4]; uVar19 = puVar23[6]; uVar18 = puVar23[7]; uVar2 = puVar23[8]; puVar21[5] = puVar23[5] & puVar21[5]; puVar21[6] = uVar19 & puVar21[6]; puVar21[7] = uVar18 & puVar21[7]; puVar21[8] = uVar2 & puVar21[8]; uVar19 = puVar23[10]; uVar18 = puVar23[0xb]; uVar2 = puVar23[0xc]; puVar21[9] = puVar23[9] & puVar21[9]; puVar21[10] = uVar19 & puVar21[10]; puVar21[0xb] = uVar18 & puVar21[0xb]; puVar21[0xc] = uVar2 & puVar21[0xc]; uVar19 = puVar23[0xe]; uVar18 = puVar23[0xf]; uVar2 = puVar23[0x10]; puVar21[0xd] = puVar23[0xd] & puVar21[0xd]; puVar21[0xe] = uVar19 & puVar21[0xe]; puVar21[0xf] = uVar18 & puVar21[0xf]; puVar21[0x10] = uVar2 & puVar21[0x10]; puVar20 = puVar21 + 0x11; puVar22 = puVar23 + 0x11; } iVar16 = iVar16 + 0x5c; do { puVar23 = puVar22; puVar21 = puVar20; *(byte *)puVar21 = (byte)*puVar21 & (byte)*puVar23; puVar22 = (uint *)((int)puVar23 + 1); local_fe8 = CONCAT44(puVar21,(undefined4)local_fe8); puVar20 = (uint *)((int)puVar21 + 1); iVar16 = iVar16 + -1; } while (iVar16 != 0); iVar16 = 0; if ((1 < __isa_available) && (((uint *)((int)puVar23 + 0xeU) < puVar20 || (iVar16 = 0, (uint *)((int)puVar21 + 0xe) < puVar22)))) { iVar16 = 3; do { uVar19 = *puVar20; uVar18 = puVar20[1]; uVar2 = puVar20[2]; uVar3 = puVar20[3]; uVar4 = *puVar22; uVar5 = puVar22[1]; uVar6 = puVar22[2]; uVar7 = puVar22[3]; puVar22 = puVar22 + 4; *puVar20 = (uVar19 < uVar4) * uVar19 | (uVar19 >= uVar4) * uVar4; puVar20[1] = (uVar18 < uVar5) * uVar18 | (uVar18 >= uVar5) * uVar5; puVar20[2] = (uVar2 < uVar6) * uVar2 | (uVar2 >= uVar6) * uVar6; puVar20[3] = (uVar3 < uVar7) * uVar3 | (uVar3 >= uVar7) * uVar7; puVar20 = puVar20 + 4; iVar16 = iVar16 + -1; } while (iVar16 != 0); iVar16 = -0xc; } iVar16 = iVar16 + 0xe; do { iVar17 = iVar16; puVar23 = puVar22; puVar21 = puVar20; uVar19 = *puVar23; if (*puVar21 <= *puVar23) { uVar19 = *puVar21; } *puVar21 = uVar19; puVar20 = puVar21 + 1; iVar16 = iVar17 + -1; puVar22 = puVar23 + 1; } while (iVar16 != 0); iVar17 = iVar17 + 0xd; *(byte *)puVar20 = (byte)*puVar20 & (byte)puVar23[1]; puVar20 = (uint *)((int)puVar21 + 5); puVar22 = (uint *)((int)puVar23 + 5); do { puVar23 = puVar22; puVar21 = puVar20; puVar22 = (uint *)((int)puVar23 + 1); *(byte *)puVar21 = (byte)*puVar21 & (byte)*puVar23; puVar20 = (uint *)((int)puVar21 + 1); iVar17 = iVar17 + -1; } while (iVar17 != 0); iVar16 = 0; if ((1 < __isa_available) && (((uint *)((int)puVar23 + 0x1bU) < puVar20 || ((uint *)((int)puVar21 + 0x1bU) < puVar22)))) { uVar19 = *puVar20; iVar17 = *(int *)((int)puVar21 + 5); iVar8 = *(int *)((int)puVar21 + 9); iVar9 = *(int *)((int)puVar21 + 0xd); iVar16 = -0x10; uVar18 = *puVar22; iVar10 = *(int *)((int)puVar23 + 5); iVar11 = *(int *)((int)puVar23 + 9); iVar12 = *(int *)((int)puVar23 + 0xd); *puVar20 = ((int)uVar19 < (int)uVar18) * uVar19 | ((int)uVar19 >= (int)uVar18) * uVar18; *(uint *)((int)puVar21 + 5) = (uint)(iVar17 < iVar10) * iVar17 | (uint)(iVar17 >= iVar10) * iVar10; *(uint *)((int)puVar21 + 9) = (uint)(iVar8 < iVar11) * iVar8 | (uint)(iVar8 >= iVar11) * iVar11; *(uint *)((int)puVar21 + 0xd) = (uint)(iVar9 < iVar12) * iVar9 | (uint)(iVar9 >= iVar12) * iVar12; iVar17 = *(int *)((int)puVar21 + 0x11); iVar8 = *(int *)((int)puVar21 + 0x15); iVar9 = *(int *)((int)puVar21 + 0x19); iVar10 = *(int *)((int)puVar21 + 0x1d); iVar11 = *(int *)((int)puVar23 + 0x11); iVar12 = *(int *)((int)puVar23 + 0x15); iVar13 = *(int *)((int)puVar23 + 0x19); iVar14 = *(int *)((int)puVar23 + 0x1d); *(uint *)((int)puVar21 + 0x11) = (uint)(iVar17 < iVar11) * iVar17 | (uint)(iVar17 >= iVar11) * iVar11; *(uint *)((int)puVar21 + 0x15) = (uint)(iVar8 < iVar12) * iVar8 | (uint)(iVar8 >= iVar12) * iVar12; *(uint *)((int)puVar21 + 0x19) = (uint)(iVar9 < iVar13) * iVar9 | (uint)(iVar9 >= iVar13) * iVar13; *(uint *)((int)puVar21 + 0x1d) = (uint)(iVar10 < iVar14) * iVar10 | (uint)(iVar10 >= iVar14) * iVar14; iVar17 = *(int *)((int)puVar21 + 0x21); iVar8 = *(int *)((int)puVar21 + 0x25); iVar9 = *(int *)((int)puVar21 + 0x29); iVar10 = *(int *)((int)puVar21 + 0x2d); iVar11 = *(int *)((int)puVar23 + 0x21); iVar12 = *(int *)((int)puVar23 + 0x25); iVar13 = *(int *)((int)puVar23 + 0x29); iVar14 = *(int *)((int)puVar23 + 0x2d); *(uint *)((int)puVar21 + 0x21) = (uint)(iVar17 < iVar11) * iVar17 | (uint)(iVar17 >= iVar11) * iVar11; *(uint *)((int)puVar21 + 0x25) = (uint)(iVar8 < iVar12) * iVar8 | (uint)(iVar8 >= iVar12) * iVar12; *(uint *)((int)puVar21 + 0x29) = (uint)(iVar9 < iVar13) * iVar9 | (uint)(iVar9 >= iVar13) * iVar13; *(uint *)((int)puVar21 + 0x2d) = (uint)(iVar10 < iVar14) * iVar10 | (uint)(iVar10 >= iVar14) * iVar14; iVar17 = *(int *)((int)puVar21 + 0x31); iVar8 = *(int *)((int)puVar21 + 0x35); iVar9 = *(int *)((int)puVar21 + 0x39); iVar10 = *(int *)((int)puVar21 + 0x3d); iVar11 = *(int *)((int)puVar23 + 0x31); iVar12 = *(int *)((int)puVar23 + 0x35); iVar13 = *(int *)((int)puVar23 + 0x39); iVar14 = *(int *)((int)puVar23 + 0x3d); *(uint *)((int)puVar21 + 0x31) = (uint)(iVar17 < iVar11) * iVar17 | (uint)(iVar17 >= iVar11) * iVar11; *(uint *)((int)puVar21 + 0x35) = (uint)(iVar8 < iVar12) * iVar8 | (uint)(iVar8 >= iVar12) * iVar12; *(uint *)((int)puVar21 + 0x39) = (uint)(iVar9 < iVar13) * iVar9 | (uint)(iVar9 >= iVar13) * iVar13; *(uint *)((int)puVar21 + 0x3d) = (uint)(iVar10 < iVar14) * iVar10 | (uint)(iVar10 >= iVar14) * iVar14; puVar20 = (uint *)((int)puVar21 + 0x41); puVar22 = (uint *)((int)puVar23 + 0x41); } iVar16 = iVar16 + 0x1b; do { puVar23 = puVar22; puVar21 = puVar20; uVar19 = *puVar23; if ((int)*puVar21 <= (int)*puVar23) { uVar19 = *puVar21; } *puVar21 = uVar19; puVar20 = puVar21 + 1; iVar16 = iVar16 + -1; puVar22 = puVar23 + 1; } while (iVar16 != 0); *(byte *)puVar20 = (byte)*puVar20 & (byte)puVar23[1]; *(byte *)((int)puVar21 + 5) = *(byte *)((int)puVar21 + 5) & *(byte *)((int)puVar23 + 5); *(byte *)((int)puVar21 + 6) = *(byte *)((int)puVar21 + 6) & *(byte *)((int)puVar23 + 6); *(byte *)((int)puVar21 + 7) = *(byte *)((int)puVar21 + 7) & *(byte *)((int)puVar23 + 7); *(byte *)(puVar21 + 2) = (byte)puVar21[2] & (byte)puVar23[2]; *(byte *)((int)puVar21 + 9) = *(byte *)((int)puVar21 + 9) & *(byte *)((int)puVar23 + 9); local_fe8 = CONCAT44((byte *)((int)puVar21 + 10),(undefined4)local_fe8); pbVar24 = (byte *)((int)puVar23 + 0xe); for (local_fdc = *(int **)((int)puVar23 + 10); local_fdc != (int *)0x0; local_fdc = (int *)((int)local_fdc + -1)) { std::set::find_node(local_1028,pbVar24); if (((*(char *)((int)local_1020 + 0xd) != '\0') || (*(int *)pbVar24 < local_1020[4])) || (local_1020 == local_ffc)) { puVar27 = (undefined4 *)std::map::operator_index(pbVar24); *puVar27 = 0xffffffff; } puVar20 = (uint *)std::map::operator_index(pbVar24); uVar19 = *(uint *)(pbVar24 + 4); if (uVar19 < *puVar20) { puVar20 = (uint *)std::map::operator_index(pbVar24); *puVar20 = uVar19; } pcVar15 = (char *)FUN_0091b9c0(pbVar24); pbVar24 = pbVar24 + 8; *pcVar15 = *pcVar15 + '\x01'; } pbVar25 = pbVar24 + 4; for (local_fdc = *(int **)pbVar24; local_fdc != (int *)0x0; local_fdc = (int *)((int)local_fdc + -1)) { std::set::find_node(local_1034,pbVar25); if (((*(char *)((int)local_102c + 0xd) != '\0') || (*(int *)pbVar25 < local_102c[4])) || (local_102c == local_ff4)) { puVar27 = (undefined4 *)std::map::operator_index(pbVar25); *puVar27 = 0xffffffff; } puVar20 = (uint *)std::map::operator_index(pbVar25); uVar19 = *(uint *)(pbVar25 + 4); if (uVar19 < *puVar20) { puVar20 = (uint *)std::map::operator_index(pbVar25); *puVar20 = uVar19; } pcVar15 = (char *)FUN_0091b9c0(pbVar25); pbVar25 = pbVar25 + 8; *pcVar15 = *pcVar15 + '\x01'; } local_1000 = local_1000 + 1; local_fdc = (int *)0x0; } while (local_1000 < local_1004); } uVar19 = local_1004; local_fdc = (int *)*local_1014; piVar26 = local_1014; if (local_fdc != local_1014) { do { uVar18 = (uint)*(byte *)(local_fdc + 5); if (uVar18 < uVar19) { std::map::erase(local_fdc + 4); uVar18 = extraout_ECX; piVar26 = local_1014; } FUN_0091b960(&local_fec,uVar18); } while (local_fdc != piVar26); } local_fdc = (int *)*local_100c; piVar26 = local_100c; if (local_fdc != local_100c) { do { uVar19 = (uint)*(byte *)(local_fdc + 5); if (uVar19 < local_1004) { std::map::erase(local_fdc + 4); uVar19 = extraout_ECX_00; piVar26 = local_100c; } FUN_0091b960(&local_fec,uVar19); } while (local_fdc != piVar26); } iVar16 = local_1018; iVar17 = FUN_00a57da0(); (**(code **)(*(int *)(iVar16 + 0x48) + 0xc))((int)local_fe8._4_4_ - iVar17,0); local_fec = local_ff8; FUN_0091b560(&local_fec,4); piVar26 = (int *)*local_ffc; local_fe8._4_4_ = piVar26; if (piVar26 != local_ffc) { do { local_1018 = local_fe8._4_4_[5]; local_101c = local_fe8._4_4_[4]; FUN_0091b560(&local_101c,8); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)((int)&local_fe8 + 4)); } while (local_fe8._4_4_ != local_ffc); } local_1000 = local_ff0; FUN_0091b560(&local_1000,4); local_fe8._4_4_ = (int *)*local_ff4; if (local_fe8._4_4_ != local_ff4) { do { local_fdc = (int *)local_fe8._4_4_[5]; local_fe0 = local_fe8._4_4_[4]; FUN_0091b560(&local_fe0,8); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)((int)&local_fe8 + 4)); } while (local_fe8._4_4_ != local_ff4); } FUN_0091b560(local_48,0x20); FUN_00436fb0(); FUN_00436fb0(); FUN_00436fb0(); FUN_00436fb0(); FUN_00926240(); *unaff_FS_OFFSET = local_1c; return; } //@@ 0091acc0 PersistentGameDataWriter::compress /* DB: ? thiscall (out size*): size from stream vfunc +8 at +0x48, allocates, creates g_deflateCompressor on first use and deflates the stream buffer (+0x38 or +0x2c); NetplayManager::store_local_persistent_game_data, save_frame_snapshot prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall PersistentGameDataWriter::compress(void *this,uint *outSize) { uint uVar1; void *pvVar2; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar3; undefined4 extraout_ECX_01; int iVar4; uVar1 = (**(code **)(*(int *)((int)this + 0x48) + 8))(); *outSize = uVar1; pvVar2 = operator_new_tracked(uVar1); uVar1 = *outSize; iVar4 = *(int *)((int)this + 0x38); if (iVar4 == 0) { iVar4 = *(int *)((int)this + 0x2c); } uVar3 = extraout_ECX; if (g_deflateCompressor == (void *)0x0) { g_deflateCompressor = operator_new(0x14); if (g_deflateCompressor == (undefined4 *)0x0) { g_deflateCompressor = (undefined4 *)0x0; } else { *(undefined4 *)g_deflateCompressor = 0; *(undefined4 *)((int)g_deflateCompressor + 4) = 0; *(undefined4 *)((int)g_deflateCompressor + 0xc) = 0; } uVar3 = extraout_ECX_00; } FUN_00a89ba0(uVar3); uVar1 = tdefl_compress(pvVar2,uVar1,iVar4,uVar1,extraout_ECX_01); *outSize = uVar1; return pvVar2; } //@@ 0091ad50 FUN_0091ad50 void FUN_0091ad50(undefined4 *param_1) { uint uVar1; uVar1 = buffer_decompress(); if (0x10000 < uVar1) { KAGE_LogMessage(0x10,(byte *)"Buffer overflow"); } (**(code **)(param_1[8] + 8))(); (**(code **)(param_1[8] + 4))(uVar1,0xffffffff); *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[6] = 0; param_1[7] = 0; (**(code **)(param_1[0x12] + 0x1c))(&DAT_00c82c10,1,uVar1); (**(code **)(param_1[0x12] + 0xc))(0xffffffe0,2); (**(code **)(param_1[0x12] + 0x14))(param_1,8,4); (**(code **)(param_1[0x12] + 0xc))(0,0); return; } //@@ 0091adf0 PersistentGameDataReader::read /* DB: ? ECX=reader with stream at +0x48, param=PersistentGameData: reads achievements 0x282, counters 0x82c, collectibles 0x2dd, ... and a set list (inverse of PersistentGameData::write); Menu_Save::load_slot_data, 0090c2d0 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall PersistentGameDataReader::read(void *this,PersistentGameData *data) { int *piVar1; undefined4 *newNode; void *node; uint uVar2; std_map *bestiaryMap; void *insertParent; int insertSide; void *foundNode; std_map *local_28; undefined4 local_24; std_map *local_20; undefined4 local_1c; uint i; PersistentGameData *encounterCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; PersistentGameData *gameData; local_8 = 0xffffffff; puStack_c = &LAB_00b0a0b5; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x48); (**(code **)(*(int *)((int)this + 0x48) + 0xc)) (0,0,__security_cookie ^ (int)register0x00000010 - 4U); gameData = data; FUN_0091b650(data->_achievements,0x282); (**(code **)(*piVar1 + 0x14))(gameData->_eventCounters,1,0x82c); FUN_0091b650(&gameData->field_0xae8,0x2dd); (**(code **)(*piVar1 + 0x14))(&gameData->field_0xdc8,1,0x38); FUN_0091b650(&gameData->field_0xe00,7); FUN_0091b650(&gameData->field_0xe07,0x68); (**(code **)(*piVar1 + 0x14))(gameData->_cutsceneCounters,1,0x6c); FUN_0091b650(&gameData->field_0xe6f,0x2e); node = (gameData->_bestiaryEncounters)._head; bestiaryMap = &gameData->_bestiaryEncounters; FID_conflict__Erase_tree_>_> (bestiaryMap,(fuzzer_allocator_> *)bestiaryMap, *(_Tree_node **)((int)node + 4)); *(void **)((int)node + 4) = node; *(void **)node = node; *(void **)((int)node + 8) = node; (gameData->_bestiaryEncounters)._size = 0; encounterCount = (PersistentGameData *)0x0; (**(code **)(*piVar1 + 0x14))(&encounterCount,1,4); i = 0; if (encounterCount != (PersistentGameData *)0x0) { do { uVar2 = i; local_20 = (std_map *)0xffffffff; local_1c = 0xffffffff; (**(code **)(*piVar1 + 0x14))(&local_20,1,8); std::set::find_node(&insertParent,&local_20); if ((*(char *)((int)foundNode + 0xd) != '\0') || (node = foundNode, (int)local_20 < *(int *)((int)foundNode + 0x10))) { if ((gameData->_bestiaryEncounters)._size == 0xaaaaaaa) goto LAB_0091b0e5; node = bestiaryMap->_head; local_8 = 0; local_24 = 0; local_28 = bestiaryMap; newNode = operator_new(0x18); local_8 = 0xffffffff; local_24 = 0; newNode[4] = local_20; newNode[5] = 0; *newNode = node; newNode[1] = node; newNode[2] = node; *(undefined2 *)(newNode + 3) = 0; node = std::_Tree::_Insert_node(bestiaryMap,insertParent,insertSide,newNode); uVar2 = i; } i = uVar2 + 1; *(undefined4 *)((int)node + 0x14) = local_1c; } while (i < encounterCount); } gameData = data; bestiaryMap = &data->_bestiaryKills; node = bestiaryMap->_head; FID_conflict__Erase_tree_>_> (bestiaryMap,(fuzzer_allocator_> *)bestiaryMap, *(_Tree_node **)((int)node + 4)); *(void **)((int)node + 4) = node; *(void **)node = node; *(void **)((int)node + 8) = node; (gameData->_bestiaryKills)._size = 0; data = (PersistentGameData *)0x0; (**(code **)(*piVar1 + 0x14))(&data,1,4); i = 0; if (data != (PersistentGameData *)0x0) { do { uVar2 = i; local_28 = (std_map *)0xffffffff; local_24 = 0xffffffff; (**(code **)(*piVar1 + 0x14))(&local_28,1,8); std::set::find_node(&insertParent,&local_28); if ((*(char *)((int)foundNode + 0xd) != '\0') || (node = foundNode, (int)local_28 < *(int *)((int)foundNode + 0x10))) { if ((gameData->_bestiaryKills)._size == 0xaaaaaaa) { LAB_0091b0e5: /* WARNING: Subroutine does not return */ FUN_004170d0(); } node = bestiaryMap->_head; local_8 = 1; local_1c = 0; local_20 = bestiaryMap; newNode = operator_new(0x18); local_8 = 0xffffffff; local_1c = 0; newNode[4] = local_28; newNode[5] = 0; *newNode = node; newNode[1] = node; newNode[2] = node; *(undefined2 *)(newNode + 3) = 0; node = std::_Tree::_Insert_node(bestiaryMap,insertParent,insertSide,newNode); uVar2 = i; } i = uVar2 + 1; *(undefined4 *)((int)node + 0x14) = local_24; } while (i < data); } (**(code **)(*piVar1 + 0xc))(0,2); ExceptionList = local_10; return; } //@@ 0091b0f0 FUN_0091b0f0 void FUN_0091b0f0(PersistentGameData *param_1,undefined4 *param_2) { void *in_ECX; undefined4 local_28; undefined4 local_24; undefined8 local_20; undefined8 local_18; undefined8 local_10; local_20 = 0; local_18 = 0; local_10 = 0; local_28 = *param_2; local_24 = param_2[1]; PersistentGameDataWriter::write(in_ECX,param_1,&local_28); return; } //@@ 0091b130 PersistentGameDataWriter::write /* WARNING: Removing unreachable block (ram,0x0091b43b) */ /* WARNING: Removing unreachable block (ram,0x0091b44a) */ /* WARNING: Removing unreachable block (ram,0x0091b45a) */ /* WARNING: Removing unreachable block (ram,0x0091b4b4) */ /* DB: ? thiscall (PersistentGameData*, ?): resets the output stream (vtable at +0x48/+0x20, size (n+m)*8+0x994), writes bit/byte blocks of the data (+0x38 0x282, +700 0x82c, +0xae8 0x2dd, +0xdc8, +0xe00..) and the vector at +0xf64; NetplayManager::save_frame_snapshot, shared_save_write ("sharedsave%d.dat") prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall PersistentGameDataWriter::write(void *this,PersistentGameData *data,void *header) { undefined4 killCount; undefined4 uVar2; undefined4 uVar3; undefined4 *puVar4; undefined4 *puVar5; uint uVar6; void *node; int *piVar7; undefined4 *entriesEnd; void *local_3c; undefined4 killKey; void *local_34; undefined4 *local_30; undefined4 encounterKey; undefined4 *local_28; undefined4 *self; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint killCount; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0a0f5; local_1c = ExceptionList; ExceptionList = &local_1c; self = this; (**(code **)(*(int *)((int)this + 0x48) + 0xc)) (0,0,__security_cookie ^ (int)register0x00000010 - 0x10U); uVar6 = (data->_bestiaryEncounters)._size; killCount = (data->_bestiaryKills)._size; (**(code **)(*(int *)((int)this + 0x20) + 8))(); (**(code **)(*(int *)((int)this + 0x20) + 4))((uVar6 + killCount) * 8 + 0x994,0xffffffff); *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x1c) = 0; FUN_0091b580(data->_achievements,0x282); piVar7 = self + 0x12; (**(code **)(*piVar7 + 0x1c))(data->_eventCounters,1,0x82c); FUN_0091b580(&data->field_0xae8,0x2dd); (**(code **)(*piVar7 + 0x1c))(&data->field_0xdc8,1,0x38); FUN_0091b580(&data->field_0xe00,7); FUN_0091b580(&data->field_0xe07,0x68); (**(code **)(*piVar7 + 0x1c))(data->_cutsceneCounters,1,0x6c); FUN_0091b580(&data->field_0xe6f,0x2e); local_28 = (undefined4 *)0x0; entriesEnd = (undefined4 *)0x0; local_30 = (undefined4 *)0x0; local_14 = 0; local_3c = (void *)(data->_bestiaryEncounters)._size; node = *(void **)(data->_bestiaryEncounters)._head; local_34 = node; if (local_3c != (void *)0x0) { if ((void *)0x1fffffff < local_3c) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector<8byte>::_Reallocate_exactly(local_3c); } local_30 = (undefined4 *)0x0; puVar5 = (undefined4 *)0x0; if (node != (data->_bestiaryEncounters)._head) { do { local_28 = *(undefined4 **)((int)node + 0x14); encounterKey = *(undefined4 *)((int)node + 0x10); if (entriesEnd == local_30) { std::vector<8byte>::_Emplace_reallocate(entriesEnd,&encounterKey); local_30 = (undefined4 *)0x0; } else { *entriesEnd = encounterKey; entriesEnd[1] = local_28; entriesEnd = entriesEnd + 2; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_34); node = local_34; puVar5 = entriesEnd; } while (local_34 != (data->_bestiaryEncounters)._head); } puVar4 = self; local_28 = (void *)0x0; local_3c = (void *)((int)puVar5 >> 3); (**(code **)(self[0x12] + 0x1c))(&local_3c,1,4); if (local_3c != (void *)0x0) { (**(code **)(puVar4[0x12] + 0x1c))(local_28,1,(int)local_3c << 3); } local_14 = 0xffffffff; if (local_28 != (void *)0x0) { uVar6 = ((int)local_30 - (int)local_28 >> 3) * 8; puVar5 = local_28; if (0xfff < uVar6) { puVar5 = *(undefined4 **)((int)local_28 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)local_28 + (-4 - (int)puVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar5,uVar6); } local_34 = (void *)0x0; local_28 = (undefined4 *)0x0; entriesEnd = (undefined4 *)0x0; local_14 = 1; uVar6 = (data->_bestiaryKills)._size; node = *(void **)(data->_bestiaryKills)._head; local_3c = node; if (uVar6 != 0) { if (0x1fffffff < uVar6) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector<8byte>::_Reallocate_exactly(uVar6); } local_28 = (undefined4 *)0x0; local_34 = (void *)0x0; if (node != (data->_bestiaryKills)._head) { do { local_34 = *(void **)((int)node + 0x14); killKey = *(undefined4 *)((int)node + 0x10); if (local_28 == (undefined4 *)0x0) { std::vector<8byte>::_Emplace_reallocate(0,&killKey); } else { *local_28 = killKey; local_28[1] = local_34; entriesEnd = local_28 + 2; } local_28 = entriesEnd; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_3c); node = local_3c; } while (local_3c != (data->_bestiaryKills)._head); } local_30 = (undefined4 *)((int)local_28 >> 3); (**(code **)(self[0x12] + 0x1c))(&local_30,1,4); if (local_30 != (undefined4 *)0x0) { (**(code **)(self[0x12] + 0x1c))(0,1,(int)local_30 << 3); } puVar5 = self; local_14 = 0xffffffff; (**(code **)(self[0x12] + 0xc))(0,2); killCount = *(undefined4 *)((int)header + 4); uVar2 = *(undefined4 *)((int)header + 8); uVar3 = *(undefined4 *)((int)header + 0xc); *puVar5 = *(undefined4 *)header; puVar5[1] = killCount; puVar5[2] = uVar2; puVar5[3] = uVar3; killCount = *(undefined4 *)((int)header + 0x14); uVar2 = *(undefined4 *)((int)header + 0x18); uVar3 = *(undefined4 *)((int)header + 0x1c); puVar5[4] = *(undefined4 *)((int)header + 0x10); puVar5[5] = killCount; puVar5[6] = uVar2; puVar5[7] = uVar3; (**(code **)(puVar5[0x12] + 0x1c))(puVar5,1,0x20); ExceptionList = local_1c; return; } //@@ 0091b510 FUN_0091b510 uint FUN_0091b510(void) { uint uVar1; int in_ECX; int local_10; int iStack_c; if (g_userProfile == (void *)0x0) { iStack_c = 0; local_10 = 0; } else { local_10 = *(int *)((int)g_userProfile + 8); iStack_c = *(int *)((int)g_userProfile + 0xc); } uVar1 = 0; while ((*(int *)(in_ECX + uVar1 * 8) != local_10 || (*(int *)(in_ECX + 4 + uVar1 * 8) != iStack_c) )) { uVar1 = uVar1 + 1; if (3 < uVar1) { return uVar1 & 0xffffff00; } } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 0091b560 FUN_0091b560 void FUN_0091b560(undefined4 param_1,undefined4 param_2) { int in_ECX; (**(code **)(*(int *)(in_ECX + 0x48) + 0x1c))(param_1,1,param_2); return; } //@@ 0091b580 FUN_0091b580 void FUN_0091b580(int param_1,uint param_2) { qword qVar1; uint uVar2; void *_Dst; int in_ECX; qword *pqVar3; uint size; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; size = (param_2 >> 3) + 1; _Dst = operator_new_tracked(size); memset(_Dst,0,size); uVar4 = 0; if (param_2 != 0) { do { if (*(char *)(uVar4 + param_1) != '\0') { *(byte *)((uVar4 >> 3) + (int)_Dst) = *(byte *)((uVar4 >> 3) + (int)_Dst) | (byte)(1 << (uVar4 & 7)); } uVar4 = uVar4 + 1; } while (uVar4 < param_2); } (**(code **)(*(int *)(in_ECX + 0x48) + 0x1c))(_Dst,1,size,uVar2); if (_Dst != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)((int)_Dst + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar2; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar2); free((void *)((int)_Dst + -4)); } ExceptionList = local_10; return; } //@@ 0091b650 FUN_0091b650 void FUN_0091b650(void *param_1,uint param_2) { byte bVar1; qword qVar2; byte bVar3; uint uVar4; void *pvVar5; int in_ECX; qword *pqVar6; uint uVar7; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar7 = (param_2 >> 3) + 1; pvVar5 = tracked_alloc(0,(void *)0x0,(ulonglong)uVar7); (**(code **)(*(int *)(in_ECX + 0x48) + 0x14))(pvVar5,1,uVar7,uVar4); memset(param_1,0,param_2); uVar4 = 0; if (param_2 != 0) { bVar3 = 1; do { bVar1 = *(byte *)((uVar4 >> 3) + (int)pvVar5) & bVar3; bVar3 = bVar3 << 1 | (char)bVar3 < '\0'; *(bool *)(uVar4 + (int)param_1) = bVar1 != 0; uVar4 = uVar4 + 1; } while (uVar4 < param_2); } if (pvVar5 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)((int)pvVar5 + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar4); free((void *)((int)pvVar5 + -4)); } ExceptionList = local_10; return; } //@@ 0091b720 PersistentGameData::copy_shared_progress /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? fastcall ECX=dst EDX=src PersistentGameData: copies a fixed list of event counters (+700 + id*4: 0x72,0x73,0xa2..0xaf, 0xd4, 0x181..0x190...) and 12 achievement bytes (+0x38 + id); twice from shared_save_write around the shared save merge */ void PersistentGameData::copy_shared_progress(void) { int iVar1; int in_ECX; int iVar2; int in_EDX; uint i; int nextId; int iVar3; int eventCounterIds [2]; undefined8 uStack_c0; int aiStack_b8 [12]; undefined4 local_88; int local_84 [19]; int achievementIds [13]; achievementIds[0xc] = __security_cookie ^ (uint)(achievementIds + 0xd); if ((in_ECX != 0) && (in_EDX != 0)) { eventCounterIds[0] = 0x72; eventCounterIds[1] = 0x73; iVar1 = 0; nextId = 0xa2; do { iVar2 = iVar1; iVar3 = nextId + 4; *(ulonglong *)(eventCounterIds + iVar2 + 2) = CONCAT44(nextId + -2,nextId + -3); aiStack_b8[iVar2] = nextId + -1; aiStack_b8[iVar2 + 1] = nextId; iVar1 = iVar2 + 4; nextId = iVar3; } while (iVar3 < 0xae); if (iVar1 < 0xe) { iVar2 = iVar2 + 0xa3; do { eventCounterIds[iVar1 + 2] = iVar2; iVar1 = iVar1 + 1; iVar2 = iVar2 + 1; } while (iVar1 < 0xe); } iVar1 = 0x10; local_84[0] = 0x181; local_84[1] = 0x182; local_84[2] = 0x183; local_84[3] = 0x184; local_88 = 0xd4; local_84[4] = 0x185; local_84[5] = 0x186; local_84[6] = 0x187; local_84[7] = 0x188; local_84[8] = 0x189; local_84[9] = 0x18a; local_84[10] = 0x18b; local_84[0xb] = 0x18c; local_84[0xc] = 0x18d; local_84[0xd] = 0x18e; local_84[0xe] = 399; local_84[0xf] = 400; do { local_84[iVar1] = iVar1 + 0x181; iVar1 = iVar1 + 1; } while (iVar1 < 0x13); i = 0; do { iVar1 = eventCounterIds[i] * 4 + 700; *(undefined4 *)(iVar1 + in_ECX) = *(undefined4 *)(iVar1 + in_EDX); iVar1 = eventCounterIds[i + 1] * 4 + 700; *(undefined4 *)(iVar1 + in_ECX) = *(undefined4 *)(iVar1 + in_EDX); iVar1 = eventCounterIds[i + 2] * 4 + 700; *(undefined4 *)(iVar1 + in_ECX) = *(undefined4 *)(iVar1 + in_EDX); iVar1 = aiStack_b8[i - 1] * 4 + 700; *(undefined4 *)(iVar1 + in_ECX) = *(undefined4 *)(iVar1 + in_EDX); iVar1 = aiStack_b8[i] * 4 + 700; *(undefined4 *)(iVar1 + in_ECX) = *(undefined4 *)(iVar1 + in_EDX); iVar1 = i + 1; i = i + 6; iVar1 = aiStack_b8[iVar1] * 4 + 700; *(undefined4 *)(iVar1 + in_ECX) = *(undefined4 *)(iVar1 + in_EDX); } while (i < 0x24); i = 0; achievementIds[0] = 0xf2; achievementIds[1] = 0xf3; achievementIds[2] = 0xf4; achievementIds[3] = 0xf5; achievementIds[4] = 0x113; achievementIds[5] = 0xf6; achievementIds[6] = 0xf7; achievementIds[7] = 0xf8; achievementIds[8] = 0x155; achievementIds[9] = 0xf9; achievementIds[10] = 0xfa; achievementIds[0xb] = 0xfb; do { *(undefined1 *)(achievementIds[i] + 0x38 + in_ECX) = *(undefined1 *)(achievementIds[i] + 0x38 + in_EDX); *(undefined1 *)(achievementIds[i + 1] + 0x38 + in_ECX) = *(undefined1 *)(achievementIds[i + 1] + 0x38 + in_EDX); *(undefined1 *)(achievementIds[i + 2] + 0x38 + in_ECX) = *(undefined1 *)(achievementIds[i + 2] + 0x38 + in_EDX); *(undefined1 *)(achievementIds[i + 3] + 0x38 + in_ECX) = *(undefined1 *)(achievementIds[i + 3] + 0x38 + in_EDX); *(undefined1 *)(achievementIds[i + 4] + 0x38 + in_ECX) = *(undefined1 *)(achievementIds[i + 4] + 0x38 + in_EDX); iVar1 = i + 5; i = i + 6; *(undefined1 *)(achievementIds[iVar1] + 0x38 + in_ECX) = *(undefined1 *)(achievementIds[iVar1] + 0x38 + in_EDX); } while (i < 0xc); } return; } //@@ 0091b960 FUN_0091b960 int * FUN_0091b960(int *param_1) { char cVar1; int *piVar2; int *piVar3; int *in_ECX; int *piVar4; piVar3 = (int *)*in_ECX; *param_1 = (int)piVar3; piVar4 = (int *)piVar3[2]; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar3 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { piVar4 = (int *)piVar3[1]; if (*(char *)((int)piVar4 + 0xd) == '\0') { while (piVar3 == (int *)piVar4[2]) { *in_ECX = (int)piVar4; piVar2 = (int *)piVar4[1]; piVar3 = piVar4; piVar4 = piVar2; if (*(char *)((int)piVar2 + 0xd) != '\0') { *in_ECX = (int)piVar2; return param_1; } } } } *in_ECX = (int)piVar4; return param_1; } //@@ 0091b9c0 FUN_0091b9c0 int FUN_0091b9c0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_0091bb20(local_10,param_1); return *piVar1 + 0x14; } //@@ 0091b9e0 std::map::erase /* DB: erase by int key (signed compare, node 0x18) returning count; load_persistent_game_data_buffer */ int std::map::erase(int *param_1) { char cVar1; int *piVar2; int *piVar3; int *piVar4; void *ptr; undefined4 *in_ECX; int *piVar5; int iVar6; int *piVar7; int *piVar8; int local_10; piVar2 = (int *)*in_ECX; piVar4 = (int *)piVar2[1]; piVar7 = piVar2; piVar8 = piVar2; if (*(char *)((int)piVar4 + 0xd) == '\0') { piVar3 = piVar4; do { if (piVar3[4] < *param_1) { piVar5 = (int *)piVar3[2]; } else { if ((*(char *)((int)piVar8 + 0xd) != '\0') && (*param_1 < piVar3[4])) { piVar8 = piVar3; } piVar5 = (int *)*piVar3; piVar7 = piVar3; } piVar3 = piVar5; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar4 = (int *)*piVar8; } if (*(char *)((int)piVar4 + 0xd) == '\0') { do { if (*param_1 < piVar4[4]) { piVar3 = (int *)*piVar4; piVar8 = piVar4; } else { piVar3 = (int *)piVar4[2]; } piVar4 = piVar3; } while (*(char *)((int)piVar3 + 0xd) == '\0'); } iVar6 = 0; local_10 = 0; piVar4 = piVar7; if (piVar7 != piVar8) { do { piVar3 = (int *)piVar4[2]; iVar6 = iVar6 + 1; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; while ((piVar4 = piVar5, cVar1 == '\0' && (piVar3 == (int *)piVar4[2]))) { cVar1 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; } } } while (piVar4 != piVar8); local_10 = iVar6; } param_1 = piVar7; if ((piVar7 == (int *)*piVar2) && (*(char *)((int)piVar8 + 0xd) != '\0')) { FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, (_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar7 != piVar8) { do { piVar2 = param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = _Tree::_Extract(in_ECX,piVar2); operator_delete(ptr,0x18); } while (param_1 != piVar8); return local_10; } return local_10; } //@@ 0091bb20 FUN_0091bb20 void FUN_0091bb20(undefined4 *param_1,int *param_2) { char cVar1; int *piVar2; int *piVar3; bool bVar4; int *piVar5; int *piVar6; undefined4 *in_ECX; int *piVar7; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a12d; local_10 = ExceptionList; ExceptionList = &local_10; piVar2 = (int *)*in_ECX; bVar4 = false; local_14 = (int *)piVar2[1]; piVar6 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar5 = local_14; do { local_14 = piVar5; if (local_14[4] < *param_2) { piVar5 = (int *)local_14[2]; } else { piVar5 = (int *)*local_14; piVar6 = local_14; } bVar4 = *param_2 <= local_14[4]; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if ((*(char *)((int)piVar6 + 0xd) == '\0') && (piVar6[4] <= *param_2)) { *(undefined1 *)(param_1 + 1) = 0; } else { if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; piVar6 = operator_new(0x18); piVar6[4] = *param_2; *(undefined1 *)(piVar6 + 5) = 0; *piVar6 = (int)piVar2; piVar6[1] = (int)piVar2; piVar6[2] = (int)piVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_14; if (local_14 == piVar2) { *piVar2 = (int)piVar6; piVar2[1] = (int)piVar6; piVar2[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (bVar4) { *local_14 = (int)piVar6; if (local_14 == (int *)*piVar2) { *piVar2 = (int)piVar6; } } else { local_14[2] = (int)piVar6; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar5 = piVar6; while (cVar1 == '\0') { piVar3 = (int *)piVar5[1]; piVar7 = *(int **)piVar3[1]; if (piVar3 == piVar7) { piVar7 = (int *)((undefined4 *)piVar3[1])[2]; if ((char)piVar7[3] == '\0') goto LAB_0091bc81; if (piVar5 == (int *)piVar3[2]) { FUN_00415fe0(piVar3); piVar5 = piVar3; } *(undefined1 *)(piVar5[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar5[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar5[1] + 4)); } else if ((char)piVar7[3] == '\0') { LAB_0091bc81: *(undefined1 *)(piVar3 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar5[1] + 4) + 0xc) = 0; piVar5 = *(int **)(piVar5[1] + 4); } else { if (piVar5 == (int *)*piVar3) { FUN_00415f80(piVar3); piVar5 = piVar3; } *(undefined1 *)(piVar5[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar5[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar5[1] + 4)); } cVar1 = *(char *)(piVar5[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; } *param_1 = piVar6; ExceptionList = local_10; return; } //@@ 0091bd10 stristr /* DB: ECX=haystack, EDX=needle: case-insensitive substring search via tolower, returns pointer or 0; profanity masking in 0091e980 */ byte * stristr(void) { byte bVar1; char cVar2; int iVar3; int iVar4; int iVar5; int iVar6; byte *in_ECX; byte *in_EDX; byte *pbVar7; byte *pbVar8; byte *pbVar9; byte *pbVar10; code *pcVar11; pcVar11 = tolower_exref; if (*in_EDX != 0) { iVar3 = tolower((uint)*in_EDX); pbVar7 = in_EDX + 1; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); pbVar9 = in_ECX; do { do { in_ECX = pbVar9; pbVar9 = in_ECX + 1; if (*in_ECX == 0) { return (byte *)0x0; } cVar2 = (*pcVar11)(*in_ECX); } while (cVar2 != (char)iVar3); iVar4 = (int)pbVar7 - (int)(in_EDX + 2); pbVar8 = in_EDX + 1; pbVar10 = pbVar9; if ((int)pbVar7 - (int)(in_EDX + 2) == 0) break; while( true ) { iVar4 = iVar4 + -1; iVar5 = (*pcVar11)((int)(char)*pbVar8); iVar6 = tolower((int)(char)*pbVar10); pcVar11 = tolower_exref; if ((((iVar6 != iVar5) || (iVar4 == 0)) || (*pbVar10 == 0)) || (*pbVar8 == 0)) break; pbVar10 = pbVar10 + 1; pbVar8 = pbVar8 + 1; } iVar4 = tolower((uint)*pbVar8); iVar5 = tolower((uint)*pbVar10); } while (iVar5 != iVar4); } return in_ECX; } //@@ 0091be00 profanity_list_load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "profanity_list.txt": copies the bundled file into the user dir if missing, reloads when GetFileTime changed into the list DAT_00c7986c ("list too long"); OnlineChat::receive_message (0091e980) */ void profanity_list_load(void) { char cVar1; uint uVar2; undefined4 *puVar3; int *piVar4; HANDLE pvVar5; BOOL BVar6; undefined1 *puVar7; char *pcVar8; int *piVar9; int iVar10; code *pcVar11; _FILETIME local_60; _FILETIME local_58; char *local_50; char local_49; int local_48; int iStack_44; int iStack_40; int iStack_3c; int local_38; int iStack_34; int iStack_30; int iStack_2c; char local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0a15d; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_24 = uVar2; puVar7 = (undefined1 *)((int)register0x00000010 + -4); if (DAT_00c72218 == '\0') { sprintf_s((byte *)&DAT_00c72218,0x400,&DAT_00b60c28); puVar7 = puStack_20; } puStack_20 = puVar7; puVar3 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)&DAT_00c72218); local_49 = puVar3 != (undefined4 *)0x0; if (puVar3 != (undefined4 *)0x0) { (**(code **)*puVar3)(1,uVar2); } if (local_49 == '\0') { piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,(byte *)"profanity_list.txt",(int *)0x0); if (piVar4 != (int *)0x0) { (**(code **)(*piVar4 + 0xc))(0,0); uVar2 = (**(code **)(*piVar4 + 4))(); local_50 = operator_new_tracked(uVar2); local_58.dwHighDateTime = (**(code **)(*piVar4 + 0x14))(local_50,uVar2,1); (**(code **)*piVar4)(1); pcVar8 = local_50; if (local_50 != (char *)0x0) { piVar4 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)&DAT_00c72218,0); if (piVar4 != (int *)0x0) { (**(code **)(*piVar4 + 0x1c))(pcVar8,1,local_58.dwHighDateTime); (**(code **)*piVar4)(1); } local_14 = 0; tracked_alloc(1,pcVar8,0); local_14 = 0xffffffff; } } } pvVar5 = CreateFileA(&DAT_00c72218,0x80000000,1,(LPSECURITY_ATTRIBUTES)0x0,3,0x80,(HANDLE)0x0); local_58.dwLowDateTime = DAT_00c72618; local_58.dwHighDateTime = DAT_00c7261c; if (pvVar5 != (HANDLE)0xffffffff) { BVar6 = GetFileTime(pvVar5,(LPFILETIME)0x0,(LPFILETIME)0x0,&local_58); if (BVar6 != 0) goto LAB_0091bfa6; } GetLastError(); KAGE_LogMessage(1,(byte *)"Failed to open profanity list file, %d\n"); FUN_0091c1f0(); LAB_0091bfa6: CloseHandle(pvVar5); if ((local_58.dwLowDateTime != DAT_00c72618) || (local_58.dwHighDateTime != DAT_00c7261c)) { FUN_0091c1f0(); piVar4 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)&DAT_00c72218); if (piVar4 != (int *)0x0) { cVar1 = (**(code **)(*piVar4 + 0x10))(); if (cVar1 == '\0') { pcVar11 = strchr_exref; do { uVar2 = (**(code **)(*piVar4 + 0x18))(&DAT_00c92c10,0x400); if (uVar2 < 0x20) { puVar7 = (undefined1 *)(*pcVar11)(&DAT_00c92c10,0xd); if (puVar7 != (undefined1 *)0x0) { *puVar7 = 0; } puVar7 = (undefined1 *)(*pcVar11)(&DAT_00c92c10,10); if (puVar7 != (undefined1 *)0x0) { *puVar7 = 0; } pcVar8 = &DAT_00c92c10; local_50 = &DAT_00c92c10; if (DAT_00c92c10 == ' ') { do { pcVar8 = pcVar8 + 1; } while (*pcVar8 == ' '); local_50 = pcVar8; } pcVar8 = local_50; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); iVar10 = (int)pcVar8 - (int)(local_50 + 1); if (iVar10 != 0) { pcVar8 = local_50 + iVar10 + -1; do { if (*pcVar8 != ' ') break; *pcVar8 = '\0'; pcVar8 = pcVar8 + -1; iVar10 = iVar10 + -1; } while (iVar10 != 0); } pcVar8 = local_50; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); strncpy((char *)&local_48,local_50,(size_t)(pcVar8 + (1 - (int)(local_50 + 1)))); iVar10 = DAT_00c7986c; pcVar8 = local_50; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); local_28 = (char)pcVar8 - ((char)local_50 + '\x01'); if (DAT_00c79870 == 0x5d1745d) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_60.dwLowDateTime = (DWORD)&DAT_00c7986c; local_14 = 1; local_60.dwHighDateTime = 0; piVar9 = operator_new(0x2c); piVar9[2] = local_48; piVar9[3] = iStack_44; piVar9[4] = iStack_40; piVar9[5] = iStack_3c; piVar9[6] = local_38; piVar9[7] = iStack_34; piVar9[8] = iStack_30; piVar9[9] = iStack_2c; local_14 = 0xffffffff; *(char *)(piVar9 + 10) = local_28; DAT_00c79870 = DAT_00c79870 + 1; puVar3 = *(undefined4 **)(iVar10 + 4); *piVar9 = iVar10; piVar9[1] = (int)puVar3; *(int **)(iVar10 + 4) = piVar9; pcVar11 = strchr_exref; local_60.dwHighDateTime = 0; *puVar3 = piVar9; } cVar1 = (**(code **)(*piVar4 + 0x10))(); } while (cVar1 == '\0'); } local_58.dwHighDateTime = local_58.dwHighDateTime & 0xffffff00; FUN_0091c240(local_58.dwHighDateTime); (**(code **)*piVar4)(1); pvVar5 = CreateFileA(&DAT_00c72218,0x80000000,1,(LPSECURITY_ATTRIBUTES)0x0,3,0x80,(HANDLE)0x0) ; local_60.dwLowDateTime = DAT_00c72618; local_60.dwHighDateTime = DAT_00c7261c; if (pvVar5 != (HANDLE)0xffffffff) { BVar6 = GetFileTime(pvVar5,(LPFILETIME)0x0,(LPFILETIME)0x0,&local_60); if (BVar6 != 0) { DAT_00c72618 = local_60.dwLowDateTime; DAT_00c7261c = local_60.dwHighDateTime; } } CloseHandle(pvVar5); } } ExceptionList = local_1c; return; } //@@ 0091c1f0 FUN_0091c1f0 void FUN_0091c1f0(void) { undefined4 *puVar1; undefined4 *puVar2; puVar2 = DAT_00c7986c; *(undefined4 *)DAT_00c7986c[1] = 0; puVar2 = (undefined4 *)*puVar2; while (puVar2 != (undefined4 *)0x0) { puVar1 = (undefined4 *)*puVar2; operator_delete(puVar2,0x2c); puVar2 = puVar1; } *DAT_00c7986c = DAT_00c7986c; DAT_00c7986c[1] = DAT_00c7986c; DAT_00c79870 = 0; return; } //@@ 0091c240 FUN_0091c240 int * FUN_0091c240(undefined4 param_1) { byte bVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 *puVar4; int *piVar5; int *piVar6; int *piVar7; int *in_ECX; int *piVar8; int in_EDX; int *piVar9; int *piVar10; if (in_EDX == 0) { return (int *)*in_ECX; } if (in_EDX == 1) { return *(int **)*in_ECX; } piVar6 = (int *)FUN_0091c240(param_1); piVar7 = (int *)FUN_0091c240(param_1); piVar9 = (int *)*in_ECX; bVar1 = *(byte *)(piVar9 + 10); piVar10 = piVar9; piVar5 = piVar6; while (piVar8 = piVar6, *(byte *)(piVar6 + 10) <= bVar1) { piVar10 = (int *)*piVar10; if (piVar10 == piVar6) goto LAB_0091c2fa; piVar5 = piVar9; bVar1 = *(byte *)(piVar10 + 10); } LAB_0091c2b5: piVar6 = (int *)*piVar6; if (piVar6 != piVar7) goto code_r0x0091c2bb; goto LAB_0091c2c3; code_r0x0091c2bb: if (*(byte *)(piVar6 + 10) <= *(byte *)(piVar10 + 10)) { LAB_0091c2c3: puVar2 = (undefined4 *)piVar8[1]; *puVar2 = piVar6; puVar3 = (undefined4 *)piVar6[1]; *puVar3 = piVar10; puVar4 = (undefined4 *)piVar10[1]; *puVar4 = piVar8; piVar10[1] = (int)puVar3; piVar6[1] = (int)puVar2; piVar8[1] = (int)puVar4; if (piVar6 == piVar7) { LAB_0091c2f7: piVar9 = piVar5; LAB_0091c2fa: *in_ECX = (int)piVar9; return piVar7; } do { piVar10 = (int *)*piVar10; if (piVar10 == piVar6) goto LAB_0091c2f7; piVar8 = piVar6; } while (*(byte *)(piVar6 + 10) <= *(byte *)(piVar10 + 10)); } goto LAB_0091c2b5; } //@@ 0091c320 online_vote_update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? NetplayManager::Update: ticks the vote timer DAT_00bf9430, lobby owner (UserProfile::is_local_user) tallies members' choices when it expires and sends the result */ void online_vote_update(void) { int *piVar1; int *piVar2; char cVar3; int iVar4; undefined4 uVar5; float *pfVar6; undefined4 uVar7; void *pvVar8; Manager *pMVar9; uint uVar10; undefined4 *puVar11; float10 fVar12; float fVar13; undefined1 *messageRefCount; undefined1 local_b8 [8]; void *local_b0; undefined **local_ac; int *local_a8; int *local_a4; float local_a0; uint local_9c; undefined8 local_98; Manager *local_8c; undefined8 local_88; undefined8 local_80; byte local_71; float local_70; void *pvStack_6c; undefined4 local_68 [2]; undefined4 local_60 [8]; undefined1 local_40 [16]; float local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_40 + 0x3c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0a1bb; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_40 + 0x30); ExceptionList = &local_1c; online_vote_process_messages(local_24); if (DAT_00bf9438 != 1) { if ((DAT_00c79880 != 0) && (DAT_00bf9430 != -1)) { DAT_00bf9430 = DAT_00bf9430 + -1; } local_ac = KAGE::Network::Multiplayer::ConstLobby::vftable; local_a8 = (int *)0x0; local_a4 = (int *)0x0; local_14 = 0; std::shared_ptr::assign(&local_a8,&g_multiplayerLobbyPtr); local_ac = KAGE::Network::Multiplayer::Lobby::vftable; local_14 = 1; if (local_a8 == (int *)0x0) { local_88._4_4_ = 0; } else { iVar4 = (**(code **)(*local_a8 + 0x20))(&local_98); local_88._4_4_ = *(undefined4 *)(iVar4 + 4); local_98 = CONCAT44(local_98._4_4_,KAGE::System::UserProfileBase::vftable); } local_88._0_4_ = KAGE::System::UserProfile::vftable; local_14 = CONCAT31(local_14._1_3_,2); local_71 = KAGE::System::UserProfile::is_local_user(&local_88); local_88 = CONCAT44(local_88._4_4_,KAGE::System::UserProfileBase::vftable); local_ac = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 3; if (((local_a4 != (int *)0x0) && (cVar3 = (**(code **)(*local_a4 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_a8); } pMVar9 = g_manager; local_14 = 0xffffffff; if (local_71 != 0) { local_8c = g_manager; fVar13 = (float)((double)DAT_00bf9430 + __uint_to_double_fixup[-(DAT_00bf9430 >> 0x1f)]) / 30.0; _local_70 = CONCAT44(fVar13,local_70); fVar12 = (float10)roundf(fVar13); pvStack_6c = (void *)(float)fVar12; iVar4 = __ftoui3(); if ((iVar4 == 0) && (pvVar8 = (pMVar9->_lobbyMembers)._begin, pvVar8 != (pMVar9->_lobbyMembers)._end)) { do { iVar4 = *(int *)((int)pvVar8 + 4); if (iVar4 == 0) { local_70 = 0.0; fVar13 = local_70; pvStack_6c = (void *)0x0; local_70 = 0.0; local_a0 = local_70; local_70 = fVar13; } else { pvStack_6c = *(void **)(iVar4 + 0xc); local_a0 = *(float *)(iVar4 + 8); } local_80 = CONCAT44(pvStack_6c,(undefined4)local_80); local_9c = (uint)pvStack_6c; pvStack_6c = (void *)local_a0; FUN_0091ce60(local_b8,&local_a0); if (*(char *)((int)local_b0 + 0xd) == '\0') { if (((local_80._4_4_ < *(uint *)((int)local_b0 + 0x14)) || ((local_80._4_4_ <= *(uint *)((int)local_b0 + 0x14) && (pvStack_6c < (uint)*(float *)((int)local_b0 + 0x10))))) || (local_b0 == g_onlineVoteMap)) goto LAB_0091c548; } else { LAB_0091c548: pvStack_6c = (void *)DAT_00bf943c; if (iVar4 == 0) { local_80 = 0; local_80._4_4_ = (int *)0x0; local_80._0_4_ = 0; uVar5 = (undefined4)local_80; uVar7 = local_80._4_4_; } else { uVar5 = *(undefined4 *)(iVar4 + 8); uVar7 = *(undefined4 *)(iVar4 + 0xc); } local_98 = CONCAT44(uVar7,uVar5); pfVar6 = (float *)map_u64_int_subscript(&local_98); *pfVar6 = (float)pvStack_6c; } pvVar8 = (void *)((int)pvVar8 + 0x14); pMVar9 = local_8c; } while (pvVar8 != (local_8c->_lobbyMembers)._end); } local_8c = (pMVar9->_lobbyMembers)._end; pvVar8 = (pMVar9->_lobbyMembers)._begin; if (pvVar8 != local_8c) { do { iVar4 = *(int *)((int)pvVar8 + 4); if (iVar4 == 0) { local_98 = 0; local_98._4_4_ = 0; local_98._0_4_ = 0.0; local_a0 = (float)local_98; uVar10 = local_98._4_4_; } else { local_a0 = *(float *)(iVar4 + 8); uVar10 = *(uint *)(iVar4 + 0xc); } local_9c = uVar10; pvStack_6c = (void *)local_a0; FUN_0091ce60(local_b8,&local_a0); if (*(char *)((int)local_b0 + 0xd) != '\0') { ExceptionList = local_1c; return; } if (uVar10 < *(uint *)((int)local_b0 + 0x14)) { ExceptionList = local_1c; return; } if ((uVar10 <= *(uint *)((int)local_b0 + 0x14)) && (pvStack_6c < (uint)*(float *)((int)local_b0 + 0x10))) { ExceptionList = local_1c; return; } if (local_b0 == g_onlineVoteMap) { ExceptionList = local_1c; return; } pvVar8 = (void *)((int)pvVar8 + 0x14); } while (pvVar8 != local_8c); } local_68[0] = 1; local_88 = 0; memset(local_60,0,0x30); pvVar8 = g_onlineVoteMap; pvStack_6c = *(void **)g_onlineVoteMap; if (*(void **)g_onlineVoteMap != g_onlineVoteMap) { local_80 = CONCAT44(local_40,(undefined4)local_80); puVar11 = local_60; do { uVar5 = *(undefined4 *)((int)pvStack_6c + 0x14); iVar4 = *(int *)((int)pvStack_6c + 0x18); *puVar11 = *(undefined4 *)((int)pvStack_6c + 0x10); piVar2 = local_80._4_4_; puVar11[1] = uVar5; piVar1 = (int *)((int)&local_88 + iVar4 * 4); *piVar1 = *piVar1 + 1; *piVar2 = iVar4; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&pvStack_6c); local_80 = CONCAT44((int)local_80._4_4_ + 4,(undefined4)local_80); puVar11 = puVar11 + 2; } while (pvStack_6c != pvVar8); } uVar10 = *(uint *)((int)&local_88 + (int)DAT_00bf943c * 4); local_30 = DAT_00bf943c; if (uVar10 < (undefined **)local_88) { local_30 = 0.0; uVar10 = (uint)(undefined **)local_88; } if (uVar10 < local_88._4_4_) { local_30 = 1.4013e-45; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); } messageRefCount = &DAT_0000000b; pvVar8 = (void *)0x40; NetConnection::send_message(g_multiplayerService,&local_80,1,local_68,0x40,0xb); pMVar9 = g_manager; local_14 = 4; FUN_008ef1d0(&local_80); NetplayManager::send_message(&pMVar9->_netplayManager,0x18,pvVar8,messageRefCount); DAT_00bf9438 = 1; local_14 = 5; if (((local_80._4_4_ != (int *)0x0) && (cVar3 = (**(code **)(*local_80._4_4_ + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_80); } } } ExceptionList = local_1c; return; } //@@ 0091c770 online_session_reset /* DB: ? resets online globals: DAT_00c79874/78 = 0, DAT_00bf9434..40 to 2/1/2/2, erases the std::map at g_onlineVoteMap; callers online_stats_finalize, Manager::update_state_loading and other netplay teardown paths prototype: db/protos.zhl */ void __cdecl online_session_reset(void) { void *pvVar1; pvVar1 = g_onlineVoteMap; DAT_00c79874 = 0; DAT_00c79878 = 0; DAT_00bf9438 = 1; DAT_00bf943c = 2; DAT_00bf9440 = 2; FID_conflict__Erase_tree_>_> (&g_onlineVoteMap, (fuzzer_allocator_> *)&g_onlineVoteMap, *(_Tree_node **)((int)g_onlineVoteMap + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; DAT_00c79880 = 0; DAT_00bf9434 = 2; return; } //@@ 0091c7e0 online_vote_start /* DB: ? when DAT_00bf9438 == 1: online_session_reset, stores callback EDX / ctx / options, timer = ECX*30 frames, clears the vote map g_onlineVoteMap; Room::SpawnClearAward (ECX 5, EDX 0x708380) next to GenericPrompt::Show in multiplayer */ undefined4 online_vote_start(undefined4 param_1,undefined4 param_2,undefined4 param_3) { void *pvVar1; int in_ECX; undefined4 in_EDX; if (DAT_00bf9438 == 1) { online_session_reset(); pvVar1 = g_onlineVoteMap; DAT_00bf943c = param_2; DAT_00c79878 = param_1; DAT_00bf9438 = 0; DAT_00c79874 = in_EDX; FID_conflict__Erase_tree_>_> (&g_onlineVoteMap, (fuzzer_allocator_> *)&g_onlineVoteMap, *(_Tree_node **)((int)g_onlineVoteMap + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; DAT_00bf9430 = in_ECX * 0x1e; DAT_00bf9434 = param_3; DAT_00c79880 = 0; return 1; } return 0; } //@@ 0091c870 online_vote_send /* DB: ? ECX = vote (0/1, else "Invalid vote specified"); if it equals the pending vote resets the session state and records it for the local user (g_userProfile id), then builds a NetConnection message (type 0xb, "Attempting to create a message when there is no multiplayer service") and NetplayManager::send_message(0x18); callers Manager::update_ingame_input, Manager::update_state_loading, 00837fe0 prototype: db/protos.zhl */ void __fastcall online_vote_send(int vote) { Manager *pMVar1; code *pcVar2; char cVar3; uint uVar4; int *piVar5; undefined1 *puVar6; undefined1 *messageRefCount; undefined4 local_38; undefined4 uStack_34; undefined1 local_30 [4]; int *local_2c; undefined4 local_28; int local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pcVar2 = DAT_00c79874; puStack_20 = local_30 + 0x2c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0a205; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_30 + 0x20); ExceptionList = &local_1c; if (((DAT_00bf9438 == 0) && (vote != 0)) && (vote != 1)) { puStack_20 = local_30 + 0x2c; KAGE_LogMessage(0x10,(byte *)"Invalid vote specified\n"); ExceptionList = local_1c; return; } puVar6 = local_30 + 0x2c; if (vote == DAT_00bf9434) { local_24 = DAT_00c79878; online_session_reset(); local_14 = 0; if (g_userProfile == (void *)0x0) { uStack_34 = 0; local_38 = 0; } else { local_38 = *(undefined4 *)((int)g_userProfile + 8); uStack_34 = *(undefined4 *)((int)g_userProfile + 0xc); } DAT_00bf9440 = vote; piVar5 = map_u64_int_subscript((ulonglong *)&local_38); local_14 = 0xffffffff; *piVar5 = vote; if (pcVar2 != (code *)0x0) { (*pcVar2)(vote,local_24,uVar4); } online_session_reset(); puVar6 = puStack_20; } puStack_20 = puVar6; local_28 = 0; local_24 = vote; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = &DAT_0000000b; puVar6 = &DAT_00000008; NetConnection::send_message(g_multiplayerService,local_30,1,&local_28,8,0xb); pMVar1 = g_manager; local_14 = 1; FUN_008ef1d0(local_30); NetplayManager::send_message(&pMVar1->_netplayManager,0x18,puVar6,messageRefCount); local_14 = 2; if (local_2c != (int *)0x0) { cVar3 = (**(code **)(*local_2c + 0xc))(); if ((cVar3 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_30); } } ExceptionList = local_1c; return; } //@@ 0091ca00 online_vote_get_local_choice /* DB: ? looks up the local user (g_userProfile id) in the vote map g_onlineVoteMap and returns its value; Manager::update_state_loading sets Manager+0x4aba0 = (value == 2) */ int online_vote_get_local_choice(void) { int *piVar1; uint uVar2; uint uVar3; undefined1 local_30 [8]; void *local_28; undefined **local_24; void *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a23d; local_10 = ExceptionList; ExceptionList = &local_10; local_20 = g_userProfile; local_24 = KAGE::System::UserProfile::vftable; local_8 = 0; if (g_userProfile == (void *)0x0) { local_1c._4_4_ = 0; local_1c._0_4_ = 0; uVar2 = (uint)local_1c; uVar3 = local_1c._4_4_; } else { uVar2 = *(uint *)((int)g_userProfile + 8); uVar3 = *(uint *)((int)g_userProfile + 0xc); } local_1c = CONCAT44(uVar3,uVar2); FUN_0091ce60(local_30,&local_1c); if ((((*(char *)((int)local_28 + 0xd) == '\0') && (*(uint *)((int)local_28 + 0x14) <= uVar3)) && ((*(uint *)((int)local_28 + 0x14) < uVar3 || (*(uint *)((int)local_28 + 0x10) <= uVar2)))) && (local_28 != g_onlineVoteMap)) { piVar1 = map_u64_int_subscript(&local_1c); ExceptionList = local_10; return *piVar1; } ExceptionList = local_10; return 2; } //@@ 0091cac0 FUN_0091cac0 void FUN_0091cac0(void) { float10 fVar1; fVar1 = (float10)roundf((float)((double)DAT_00bf9430 + __uint_to_double_fixup[-(DAT_00bf9430 >> 0x1f)]) / 30.0); __ftoui3((float)fVar1); return; } //@@ 0091cb10 FUN_0091cb10 int FUN_0091cb10(void) { int iVar1; void *pvVar2; int in_ECX; int iVar3; void *local_8; pvVar2 = g_onlineVoteMap; if (in_ECX == 2) { return DAT_00c79880; } local_8 = *(void **)g_onlineVoteMap; iVar1 = 0; while (local_8 != pvVar2) { iVar3 = iVar1 + 1; if (*(int *)((int)local_8 + 0x18) != in_ECX) { iVar3 = iVar1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); iVar1 = iVar3; } return iVar1; } //@@ 0091cb70 online_vote_process_messages /* DB: ? first call of online_vote_update: drains NetworkManager::receive_message channel 0xb while g_multiplayerService exists, "This function should only be called on consolidated messages", handles the vote payloads */ void online_vote_process_messages(void) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; char cVar4; uint uVar5; int *piVar6; ulonglong *key; undefined4 local_48; undefined4 local_44; undefined1 local_40 [4]; int *local_3c; undefined4 *local_38; int *local_34; undefined4 local_30; code *local_2c; int local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_40 + 0x3c; puStack_18 = &LAB_00b0a26d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_40 + 0x30); ExceptionList = &local_1c; while( true ) { local_14 = 0xffffffff; if (g_multiplayerService == (void *)0x0) { ExceptionList = local_1c; return; } piVar6 = NetworkManager::receive_message(g_multiplayerService,local_40,0xb,0); iVar1 = *piVar6; local_14 = 0; if (((local_3c != (int *)0x0) && (cVar4 = (**(code **)(*local_3c + 0xc))(uVar5), cVar4 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_40); } local_14 = 0xffffffff; if (iVar1 == 0) break; if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::reset(0); } else { NetworkManager::receive_message(g_multiplayerService,&local_38,0xb,1); } puVar2 = local_38; local_14 = 1; if (local_38[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } puVar3 = local_38; iVar1 = *(int *)(*(int *)(*(int *)puVar2[2] + 0x14) + 8); if (iVar1 == 0) { if (DAT_00bf9438 != 1) { if (local_38[3] != 1) { KAGE_LogMessage(0x10,(byte *) "This function should only be called on consolidated messages"); } local_44 = local_38[1]; iVar1 = *(int *)(*(int *)(*(int *)puVar3[2] + 0x14) + 0xc); local_48 = *local_38; piVar6 = map_u64_int_subscript((ulonglong *)&local_48); *piVar6 = iVar1; } } else if (iVar1 == 1) { local_2c = DAT_00c79874; local_30 = DAT_00c79878; if (local_38[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages") ; } iVar1 = *(int *)(*(int *)puVar3[2] + 0x14); online_session_reset(); DAT_00bf9440 = *(undefined4 *)(iVar1 + 0x40); local_24 = (int *)(iVar1 + 0x30); local_28 = 4; key = (ulonglong *)(iVar1 + 0x10); do { if ((int)*key != 0 || *(int *)((int)key + 4) != 0) { iVar1 = *local_24; piVar6 = map_u64_int_subscript(key); *piVar6 = iVar1; } local_24 = local_24 + 1; key = key + 1; local_28 = local_28 + -1; } while (local_28 != 0); if (local_2c != (code *)0x0) { (*local_2c)(DAT_00bf9440,local_30); } online_session_reset(); } local_14 = 2; if (((local_34 != (int *)0x0) && (cVar4 = (**(code **)(*local_34 + 0xc))(), cVar4 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_38); } } ExceptionList = local_1c; return; } //@@ 0091cd90 map_u64_int_subscript /* DB: std::map::operator[] on g_onlineVoteMap: lower_bound (FUN_0091ce60) by 64-bit key, inserts 0x20-byte node with value 0 if missing, returns &value (+0x18); online_vote_update/send/get_local_choice prototype: db/protos.zhl, confirmed by RET 4 */ int * map_u64_int_subscript(ulonglong *key) { ulonglong uVar1; void *pvVar2; uint uVar3; undefined4 *newNode; void *local_24; int local_20; void *local_1c; void **local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a29d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_0091ce60(&local_24,key); pvVar2 = g_onlineVoteMap; if (*(char *)((int)local_1c + 0xd) == '\0') { if ((*(uint *)((int)local_1c + 0x14) <= *(uint *)((int)key + 4)) && ((*(uint *)((int)local_1c + 0x14) < *(uint *)((int)key + 4) || (*(uint *)((int)local_1c + 0x10) <= (uint)*key)))) goto LAB_0091ce44; } if (DAT_00c79880 == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } local_18 = &g_onlineVoteMap; local_8 = 0; local_14 = 0; newNode = operator_new(0x20); uVar1 = *key; newNode[5] = *(undefined4 *)((int)key + 4); newNode[4] = (int)uVar1; newNode[6] = 0; *newNode = pvVar2; newNode[1] = pvVar2; newNode[2] = pvVar2; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(&g_onlineVoteMap,local_24,local_20,newNode); LAB_0091ce44: ExceptionList = local_10; return (int *)((int)local_1c + 0x18); } //@@ 0091ce60 FUN_0091ce60 int * FUN_0091ce60(int *param_1,uint *param_2) { uint uVar1; uint uVar2; void *pvVar3; undefined4 *puVar4; int iVar5; pvVar3 = g_onlineVoteMap; puVar4 = *(undefined4 **)((int)g_onlineVoteMap + 4); *param_1 = (int)puVar4; param_1[1] = 0; param_1[2] = (int)pvVar3; if (*(char *)((int)puVar4 + 0xd) == '\0') { uVar1 = *param_2; uVar2 = param_2[1]; do { *param_1 = (int)puVar4; if ((uVar2 < (uint)puVar4[5]) || ((uVar2 <= (uint)puVar4[5] && (uVar1 <= (uint)puVar4[4])))) { param_1[2] = (int)puVar4; iVar5 = 1; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; iVar5 = 0; } param_1[1] = iVar5; } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 0091cec0 OnlineChatMessage::constructor /* DB: ? {0, KAGE::System::UserProfile (find_or_create + load_steam_avatar), byte, 7 zeroed dwords}; OnlineChat::add_message and NetplayManager constructor 00906260 SaveSlotManager::constructor +0x24) prototype: db/protos.zhl */ void __thiscall OnlineChatMessage::constructor(void *this) { undefined4 *this_00; int extraout_EAX; undefined8 local_1c; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a2cd; local_10 = ExceptionList; ExceptionList = &local_10; this_00 = (undefined4 *)((int)this + 4); *(undefined4 *)this = 0; local_1c = 0; *this_00 = KAGE::System::UserProfileBase::vftable; local_14 = this_00; UserProfile::find_or_create(&local_1c); *(int *)((int)this + 8) = extraout_EAX; local_8 = 0; *this_00 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(this_00); } *(undefined1 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(undefined4 *)((int)this + 0x28) = 0; ExceptionList = local_10; return; } //@@ 0091cf80 OnlineChatMessage::constructor /* DB: ? (user, text, ..., time in XMM3): zeroes +0, builds a UserProfile at +4 (UserProfile::find_or_create, load_steam_avatar), clears a string at +0x10, stores the float at +0x28 and sets the text via FUN_0091d080; callers online_chat_update, online_chat_text_input and 00906d60 prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall OnlineChatMessage::constructor (void *this,void *chat,byte *text,void *user,void *userRefCount,float timestamp) { undefined4 *this_00; int extraout_EAX; undefined8 local_24; undefined4 *local_1c; void *local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a31b; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; this_00 = (undefined4 *)((int)this + 4); *(undefined4 *)this = 0; local_24 = 0; *this_00 = KAGE::System::UserProfileBase::vftable; local_1c = this_00; local_18 = this; local_14 = timestamp; UserProfile::find_or_create(&local_24); *(int *)((int)this + 8) = extraout_EAX; local_8._0_1_ = 1; *this_00 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(this_00); } *(undefined1 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x18) = 0; local_8 = CONCAT31(local_8._1_3_,3); *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(float *)((int)this + 0x28) = local_14; set_text(chat,text,0,KAGE::System::UserProfile::vftable,userRefCount); ExceptionList = local_10; return; } //@@ 0091d080 OnlineChatMessage::set_text /* DB: ? thiscall (chat, text, ...): stores chat/user, formats the sender with user_profile_format_display_name into a static buffer, Font::get_string_width_n, FormattedText::set, trims old lines; OnlineChatMessage::constructor, OnlineChat::add_message */ void OnlineChatMessage::set_text (int param_1,byte *param_2,byte param_3,undefined4 param_4,int param_5) { byte bVar1; void *ptr; uint uVar2; int iVar3; int iVar4; int *in_ECX; undefined2 *puVar5; undefined1 *puVar6; undefined1 *puVar7; int iVar8; bool bVar9; float scale; undefined4 local_20; undefined4 uStack_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a34d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; bVar9 = g_manager != (Manager *)0x0; *in_ECX = param_1; in_ECX[2] = param_5; if (bVar9) { uVar2 = __ftoui3(uVar2); if (param_5 == 0) { uStack_1c = 0; local_20 = 0; } else { local_20 = *(undefined4 *)(param_5 + 8); uStack_1c = *(undefined4 *)(param_5 + 0xc); } user_profile_format_display_name(CONCAT44(uStack_1c,local_20),*(void **)(param_1 + 0x5d8),uVar2) ; sprintf(&DAT_00c7f4c8,&DAT_00b6d198); } Font::get_string_width_n(*(Font **)(param_1 + 0x5d8),&DAT_00c7f4c8,-1); scale = *(float *)(param_1 + 0x5f4); iVar3 = __ftoui3(); FormattedText::set(in_ECX + 3,param_2,*(void **)(param_1 + 0x5d8),iVar3,scale,param_3); iVar3 = in_ECX[5]; iVar8 = in_ECX[4]; if (*(uint *)(param_1 + 0x600) < (uint)((iVar3 - iVar8) / 0xc)) { do { iVar4 = in_ECX[4]; uVar2 = (iVar3 - iVar8) / 0xc - 1; if (uVar2 < (uint)((in_ECX[5] - iVar4) / 0xc)) { if (((*(byte *)(in_ECX + 3) & 1) == 0) && (ptr = *(void **)(iVar4 + 4 + uVar2 * 0xc), ptr != (void *)0x0)) { local_8._0_1_ = 1; tracked_alloc(1,ptr,0); local_8 = (uint)local_8._1_3_ << 8; iVar4 = in_ECX[4]; } if (((uVar2 != 0) && (bVar1 = *(byte *)(iVar4 + -0xc + uVar2 * 0xc), (bVar1 & 2) != 0)) && ((*(byte *)(iVar4 + uVar2 * 0xc) & 2) == 0)) { *(byte *)(iVar4 + -0xc + uVar2 * 0xc) = bVar1 & 0xfd; iVar4 = in_ECX[4]; } puVar7 = (undefined1 *)in_ECX[5]; puVar6 = (undefined1 *)(iVar4 + (uVar2 * 3 + 3) * 4); if (puVar6 != puVar7) { puVar5 = (undefined2 *)(iVar4 + (uVar2 * 3 + 2) * 4); do { *(undefined1 *)(puVar5 + -4) = *puVar6; puVar6 = puVar6 + 0xc; *(undefined4 *)(puVar5 + -2) = *(undefined4 *)(puVar5 + 4); *puVar5 = puVar5[6]; puVar5 = puVar5 + 6; } while (puVar6 != puVar7); puVar7 = (undefined1 *)in_ECX[5]; } in_ECX[5] = (int)(puVar7 + -0xc); } iVar3 = in_ECX[5]; iVar8 = in_ECX[4]; } while (*(uint *)(param_1 + 0x600) < (uint)((iVar3 - iVar8) / 0xc)); } ExceptionList = local_10; return; } //@@ 0091d2b0 OnlineChat::render /* DB: ? sprintf "%s:" name prefix lines, KAGE_ColorShader via FUN_00a140c0, Entity_Familiar::GetPlayerSlot for colors; caller 0091e650 OnlineChat::render_all by the lobby render 008e8af0 Menu_OnlineLobby::Render HUD 0090b900 NetplayManager::Render void OnlineChat::render(float *param_1,char param_2,char param_3) { float fVar1; int iVar2; KColor color; KColor color_00; uint uVar3; Entity_Player *pEVar4; int iVar5; int iVar6; byte *str; void *this; int *in_ECX; undefined4 uVar7; undefined4 extraout_ECX; int unused; Font *pFVar8; float fVar9; float fVar10; float in_XMM2_Da; float fVar11; undefined1 local_120 [44]; float local_f4; float local_e0; float local_cc; float local_b8; undefined4 local_b0; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; int local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; uint local_64; undefined4 local_60; undefined4 local_5c; KColor local_58; float local_44; float local_40; Vector local_3c; Vector local_34; float local_2c; Font *local_28; float local_24; Vector local_20 [2]; void *local_10; undefined1 *puStack_c; float local_8; local_8 = -NAN; puStack_c = &LAB_00b0a3ae; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = in_ECX[2]; pFVar8 = *(Font **)(*in_ECX + 0x5d8); local_28 = pFVar8; local_24 = in_XMM2_Da; if (iVar5 == 0) { LAB_0091d341: sprintf(&DAT_00c93010,&s_empty); } else { local_20[0].y = *(float *)(iVar5 + 8); iVar6 = *(int *)(iVar5 + 0xc); if (*(int *)(iVar5 + 8) == 0 && iVar6 == 0) goto LAB_0091d341; uVar3 = __ftoui3(__security_cookie ^ (uint)&local_20[3].y); user_profile_format_display_name(CONCAT44(iVar6,local_20[0].y),pFVar8,uVar3); sprintf(&DAT_00c93010,&DAT_00b6d198); } g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; if (((byte)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; iVar5 = in_ECX[2]; iVar6 = *in_ECX; if (iVar5 == 0) { local_20[0].y = 0.0; local_20[0].x = 0.0; } else { local_20[0].x = *(float *)(iVar5 + 8); local_20[0].y = *(float *)(iVar5 + 0xc); } if (((*(char *)(iVar6 + 0x5f0) == '\0') || (pEVar4 = PlayerManager::get_player_by_user_id ((PlayerManager *)&g_manager->_netplayManager,(ulonglong *)local_20), pEVar4 == (Entity_Player *)0x0)) || (iVar5 = FUN_004253d0(), iVar5 == 0)) { local_58._red = *(float *)(iVar6 + 0x5dc); local_58._unk = *(int *)(iVar6 + 0x5ec); local_58._green = *(float *)(iVar6 + 0x5e0); local_58._blue = *(float *)(iVar6 + 0x5e4); } else { Entity_Familiar::GetPlayerSlot((Entity_Familiar *)&g_game->_playerManager,&local_58,iVar5); iVar6 = *in_ECX; } pFVar8 = local_28; local_58._alpha = local_24 * (float)in_ECX[10]; local_94 = *(int *)(iVar6 + 0x5ec); local_88 = *(undefined4 *)(iVar6 + 0x5dc); local_8c = *(undefined4 *)(iVar6 + 0x5e0); local_90 = *(undefined4 *)(iVar6 + 0x5e4); local_24 = local_58._alpha; iVar6 = Font::get_string_width_n(local_28,&DAT_00c93010,-1); iVar5 = *in_ECX; local_3c.x = *(float *)(iVar5 + 0x5f4); local_40 = local_3c.x * (float)in_ECX[7]; local_44 = local_3c.x * (float)in_ECX[8]; local_2c = local_3c.x * *(float *)(iVar5 + 0x610) + (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]) * local_3c.x; fVar9 = local_3c.x * *(float *)(iVar5 + 0x608); local_3c.y = local_3c.x; local_20[0].y = local_3c.x; if (param_2 == '\0') { uVar7 = 0xffff; local_34.y = (float)((in_ECX[5] - in_ECX[4]) / 0xc - 1); if ((int)local_34.y < 0) { fVar10 = param_1[1]; } else { _param_2 = (int)local_34.y * 0xc; do { fVar10 = local_34.y; FormattedText::FormattedText (-(uint)((uint)local_34.y < (uint)((in_ECX[5] - in_ECX[4]) / 0xc)) & _param_2 + in_ECX[4],uVar7); local_7c = 0; local_78 = 0xffff; local_74 = 0; local_70 = 0x3f800000; local_6c = 0xffffffff; local_68 = 0; local_64 = 0; local_8 = 5.60519e-45; color_00._green = (float)local_8c; color_00._red = (float)local_88; color_00._blue = (float)local_90; color_00._alpha = local_24; color_00._unk = local_94; Font::render_glyph_quads (local_28,&local_a4,(*param_1 - local_40) + local_2c,(param_1[1] - local_44) + 0.0 ,local_20[0].y,local_20[0].y,color_00,&local_7c); local_8 = -NAN; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_34.y = (float)((int)fVar10 - 1); fVar10 = param_1[1] - fVar9; _param_2 = _param_2 + -0xc; param_1[1] = fVar10; uVar7 = extraout_ECX; } while (-1 < (int)local_34.y); pFVar8 = local_28; } local_7c = 0; local_78 = 0xffff; local_74 = 0; local_70 = 0x3f800000; local_6c = 0xffffffff; local_68 = 0; local_64 = 0; local_8 = 7.00649e-45; local_20[0].y = (fVar10 - local_44) + fVar9; local_20[0].x = (*param_1 - local_40) + 0.0; Font::DrawString(pFVar8,&DAT_00c93010,local_20,&local_3c,&local_58,&local_7c); } else { local_b0 = 0; local_ac = 0xffff; local_a8 = 0; local_a4 = 0x3f800000; local_a0 = 0xffffffff; local_9c = 0; local_98 = 0; local_8 = 0.0; local_34.x = *param_1 - local_40; local_34.y = param_1[1] - local_44; Font::DrawString(pFVar8,&DAT_00c93010,&local_34,&local_3c,&local_58,&local_b0); local_8 = -NAN; local_34.y = (float)in_ECX[4]; iVar5 = in_ECX[5] - (int)local_34.y; _param_2 = 0; if (0 < iVar5 / 0xc) { local_3c.y = 0.0; do { FormattedText::FormattedText (-(uint)(_param_2 < (uint)((in_ECX[5] - (int)local_34.y) / 0xc)) & (int)local_3c.y + in_ECX[4],iVar5); local_60 = 0; local_5c = 0xffff; local_58._red = 0.0; local_58._green = 1.0; local_58._blue = -NAN; local_58._alpha = 0.0; local_58._unk = 0; local_8 = 2.8026e-45; color._green = (float)local_8c; color._red = (float)local_88; color._blue = (float)local_90; color._alpha = local_24; color._unk = local_94; Font::render_glyph_quads (pFVar8,&local_a4,(*param_1 - local_40) + local_2c,(param_1[1] - local_44) + 0.0, local_20[0].y,local_20[0].y,color,&local_60); local_8 = -NAN; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); _param_2 = _param_2 + 1; local_3c.y = (float)((int)local_3c.y + 0xc); param_1[1] = fVar9 + param_1[1]; local_34.y = (float)in_ECX[4]; iVar5 = in_ECX[5] - (int)local_34.y; } while ((int)_param_2 < iVar5 / 0xc); goto LAB_0091d913; } } local_8 = -NAN; LAB_0091d913: if (param_3 != '\0') { iVar5 = in_ECX[5]; iVar6 = (iVar5 - in_ECX[4]) / 0xc; if (iVar6 == 0) { fVar10 = 0.0; } else { uVar3 = iVar6 - 1; if (uVar3 < (uint)((iVar5 - in_ECX[4]) / 0xc)) { str = *(byte **)(in_ECX[4] + 4 + uVar3 * 0xc); } else { str = (byte *)0x0; } iVar6 = Font::get_string_width_n(local_28,str,-1); iVar5 = in_ECX[5]; fVar10 = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]); } iVar6 = *in_ECX; fVar11 = 0.0; fVar1 = *(float *)(iVar6 + 0x5f4); iVar2 = iVar5 - in_ECX[4] >> 0x1f; fVar10 = local_2c + *param_1 + fVar10 * fVar1; if ((iVar5 - in_ECX[4]) / 0xc + iVar2 == iVar2) { fVar10 = fVar10 - 1.0; fVar9 = 0.0; } else { fVar10 = fVar10 + 1.0; } local_58._red = *(float *)(iVar6 + 0x5dc); local_58._green = *(float *)(iVar6 + 0x5e0); local_58._blue = *(float *)(iVar6 + 0x5e4); local_58._alpha = *(float *)(iVar6 + 0x5e8); local_58._unk = *(int *)(iVar6 + 0x5ec); render_quad_set_uniform_color (local_120,fVar10,fVar1 * 9.0 + (param_1[1] - fVar9),fVar1 * 6.0 + fVar10, fVar1 * 11.0 + (param_1[1] - fVar9),&local_58); if ((local_f4 + local_e0 + local_cc + local_b8) * 0.25 != fVar11) { shader_push((byte *)"KAGE_ColorShader"); local_74 = 0; local_84 = 0; local_78 = 0; local_80 = 0; local_6c = 0x3f800000; local_7c = 0x3f800000; local_68 = 0x3f800000; local_70 = 0x3f800000; local_64 = local_64 & 0xffffff00; this = kage_graphics_flush((void *)0x0); render_quad_draw(this,&local_84,local_120,1,unused); FUN_00a14200(); } } ExceptionList = local_10; return; } //@@ 0091dae0 FUN_0091dae0 void FUN_0091dae0(void) { int *in_ECX; std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x48); return; } //@@ 0091db00 FUN_0091db00 void FUN_0091db00(void) { int in_ECX; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); *(undefined ***)(in_ECX + 4) = KAGE::System::UserProfileBase::vftable; return; } //@@ 0091db20 OnlineChat::destructor /* DB: ECX=NetplayManager+0x1230 in NetplayManager destructor 00906a90: erases map +0x620, vector, UserProfile +0x28, string, frees message list (node 0x48) */ void OnlineChat::destructor(void) { int *this; uint uVar1; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0a50; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; LobbyList::clear(in_ECX); this = in_ECX + 0x188; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[0x188] + 4)); operator_delete((void *)*this,0x20); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); in_ECX[10] = (int)KAGE::System::UserProfileBase::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 3)); std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x48); ExceptionList = local_10; return; } //@@ 0091dbc0 FUN_0091dbc0 void FUN_0091dbc0(undefined4 *param_1) { undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[2] = param_1[2]; FormattedText::operator_assign(in_ECX + 3,param_1 + 3); in_ECX[7] = param_1[7]; in_ECX[8] = param_1[8]; in_ECX[9] = param_1[9]; in_ECX[10] = param_1[10]; return; } //@@ 0091dc10 online_chat_update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=chat state (vector of messages at +0, countdown +0x14): handles "/mute "/"/unmute " commands (mute_list.txt), "[Frame %d] Broadcasting chat message", %llu steam id; called from online update 008e8240 Menu_OnlineLobby::Update delayed-start 0090b150 NetplayManager::Update void online_chat_update(void) { char *pcVar1; byte bVar2; longlong lVar3; longlong lVar4; longlong lVar5; Manager *pMVar6; char cVar7; byte *pbVar8; int iVar9; byte *pbVar10; void *extraout_EAX; void *pvVar11; int *piVar12; void *extraout_EAX_00; int *extraout_EAX_01; undefined4 uVar13; void *extraout_EAX_02; int *in_ECX; int *piVar14; char *pcVar15; size_t _MaxCount; undefined4 uVar16; uint uVar17; uint uVar18; float fVar19; uint uVar20; float fVar21; ulonglong uVar22; undefined **ppuVar23; undefined1 auStack_f2 [2]; undefined1 local_e8 [4]; undefined **local_e4; int *local_bc; int *local_b8; int local_b4; byte *local_b0; byte *local_ac; undefined8 local_a8; void *local_a0; byte *local_94; int *local_90; char local_89; undefined8 local_88; undefined8 local_80; char local_71; undefined **local_70; byte *local_6c; byte local_68 [20]; undefined1 local_54 [48]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_54 + 0x50; local_14 = 0xffffffff; puStack_18 = &LAB_00b0a43c; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_54 + 0x44); ExceptionList = &local_1c; if (0 < in_ECX[0x14]) { in_ECX[0x14] = in_ECX[0x14] + -1; } fVar21 = 0.0; local_ac = *(byte **)*in_ECX; local_90 = in_ECX; if (local_ac != (byte *)*in_ECX) { uVar20 = 0x80000000; puStack_20 = local_54 + 0x50; do { local_b0 = local_ac; piVar14 = *(int **)(local_ac + 0x18); local_a0 = *(void **)(local_ac + 0x3c); fVar19 = (float)(*(uint *)(local_ac + 0x38) ^ uVar20); if ((float)(*(uint *)(local_ac + 0x38) ^ uVar20) <= fVar21) { fVar19 = fVar21; } local_80 = CONCAT44(piVar14,(undefined4)local_80); if ((float)piVar14[0x185] <= fVar19) { fVar19 = (float)piVar14[0x185]; } fVar19 = fVar19 + *(float *)(local_ac + 0x38); *(float *)(local_ac + 0x38) = fVar19; if (local_a0 < (void *)piVar14[0x17e]) { local_6c = (byte *)*piVar14; pbVar8 = (byte *)0x0; local_88 = CONCAT44(*(byte **)local_6c,(int)local_88); if (local_6c != *(byte **)local_6c) { pbVar8 = (byte *)0x0; do { pbVar10 = local_6c; local_94 = local_6c; std::_Tree_iterator::operator_decrement(&local_94); pbVar8 = pbVar8 + (*(int *)(local_94 + 0x2c) - *(int *)(local_94 + 0x28)) / 0xc; local_94 = pbVar10; std::_Tree_iterator::operator_decrement(&local_94); if (local_a0 <= *(void **)(local_94 + 0x3c)) break; std::_Tree_iterator::operator_decrement(&local_6c); } while (local_6c != local_88._4_4_); piVar14 = local_80._4_4_; local_94 = pbVar8; } if ((byte *)piVar14[0x17f] < pbVar8) goto LAB_0091df60; if (*(float *)(local_b0 + 0x40) < 1.0) { fVar19 = *(float *)(local_b0 + 0x40) + (float)piVar14[0x187]; if (fVar19 <= fVar21) { fVar19 = fVar21; } if (1.0 <= fVar19) { fVar19 = 1.0; } *(float *)(local_b0 + 0x40) = fVar19; } LAB_0091dd7c: std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_ac); } else { LAB_0091df60: piVar12 = local_90; pbVar8 = local_b0; fVar19 = (float)((uint)fVar19 ^ uVar20) / (float)piVar14[0x182]; *(float *)(local_b0 + 0x40) = fVar19; if (0.001 <= fVar19) goto LAB_0091dd7c; local_6c = local_b0; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_6c); pvVar11 = std::_Tree::_Extract(piVar12,pbVar8); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); *(undefined ***)((int)pvVar11 + 0x1c) = KAGE::System::UserProfileBase::vftable; operator_delete(pvVar11,0x48); uVar20 = 0x80000000; fVar21 = 0.0; local_ac = local_6c; } } while (local_ac != (byte *)*local_90); } local_b0 = local_ac; if (((((g_manager->_optionsConfig)._onlineChatEnabled == 0) || ((g_game->_pauseScreen)._state != 0)) || (g_game->_console != (Console)0x0)) || (g_game->_emoteMenuState != 0)) { piVar14 = local_90; goto LAB_0091e4c1; } local_80 = CONCAT44(0x101,(undefined4)local_80); cVar7 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,(int)&local_80 + 4); piVar14 = local_90; if (cVar7 != '\0') { piVar12 = local_90 + 3; if (local_90[2] == 0) { local_90[2] = 1; std::string::assign((char *)piVar12,&s_empty,0); local_a0 = g_userProfile; local_a8._4_4_ = KAGE::System::UserProfile::vftable; local_14 = 9; if (g_userProfile == (void *)0x0) { local_80 = 0; local_80._4_4_ = (int *)0x0; local_80._0_4_ = 0; uVar13 = local_80._4_4_; uVar16 = (undefined4)local_80; } else { uVar13 = *(undefined4 *)((int)g_userProfile + 0xc); uVar16 = *(undefined4 *)((int)g_userProfile + 8); } local_6c = (byte *)(piVar14 + 3); local_88 = CONCAT44(uVar13,uVar16); if (0xf < (uint)piVar14[8]) { local_6c = *(byte **)local_6c; } local_80 = CONCAT44(auStack_f2 + -10,(undefined4)local_80); UserProfile::find_or_create(&local_88); local_14._0_1_ = 10; ppuVar23 = KAGE::System::UserProfile::vftable; pvVar11 = extraout_EAX_02; if (((extraout_EAX_02 != (void *)0x0) && (*(int *)((int)extraout_EAX_02 + 8) != 0 || *(int *)((int)extraout_EAX_02 + 0xc) != 0)) && (*(int *)((int)extraout_EAX_02 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(auStack_f2 + -10); } local_14._0_1_ = 9; OnlineChatMessage::constructor(local_e8,piVar14,local_6c,ppuVar23,pvVar11,1.0); local_14 = CONCAT31(local_14._1_3_,0xb); FUN_0091dbc0(); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14 = 0xffffffff; local_e4 = KAGE::System::UserProfileBase::vftable; piVar14[0x16] = 0x3f800000; } else { if (0xf < (uint)local_90[8]) { piVar12 = (int *)*piVar12; } iVar9 = _strnicmp((char *)piVar12,"/mute ",6); pbVar8 = (byte *)(piVar14 + 3); local_71 = iVar9 == 0; pbVar10 = pbVar8; if (0xf < (uint)piVar14[8]) { pbVar10 = *(byte **)pbVar8; } iVar9 = _strnicmp((char *)pbVar10,"/unmute ",8); local_89 = iVar9 == 0; if ((local_71 != '\0') || ((bool)local_89)) { pcVar15 = "/mute "; if (local_71 == '\0') { pcVar15 = "/unmute "; } pcVar1 = pcVar15 + 1; do { cVar7 = *pcVar15; pcVar15 = pcVar15 + 1; } while (cVar7 != '\0'); if (0xf < (uint)piVar14[8]) { pbVar8 = *(byte **)pbVar8; } local_6c = pbVar8 + ((int)pcVar15 - (int)pcVar1); local_bc = (int *)0x0; local_b8 = (int *)0x0; local_b4 = 0; local_14 = 0; pvVar11 = Multiplayer::get_lobby(&DAT_00c79a50,&local_a8); local_14._0_1_ = 1; KAGE::Network::Multiplayer::Lobby::get_members(pvVar11,&local_bc,0); local_14 = (uint)local_14._1_3_ << 8; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_a8); local_71 = '\0'; local_88 = 0; piVar12 = local_bc; cVar7 = '\0'; if (local_bc != local_b8) { do { pbVar8 = local_6c; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); _MaxCount = (int)pbVar8 - (int)(local_6c + 1); pbVar8 = local_6c; pcVar15 = (char *)(**(code **)(*piVar12 + 4))(); iVar9 = _strnicmp(pcVar15,(char *)pbVar8,_MaxCount); if (iVar9 == 0) { if ((int)local_88 != 0 || local_88._4_4_ != (byte *)0x0) { cVar7 = '\x01'; goto LAB_0091e0db; } if (piVar12[1] == 0) { local_88 = 0; } else { local_88 = *(ulonglong *)(piVar12[1] + 8); } } piVar12 = piVar12 + 2; } while (piVar12 != local_b8); cVar7 = local_71; } LAB_0091e0db: if (local_89 == '\0') { LAB_0091e113: if (((int)local_88 == 0 && local_88._4_4_ == (byte *)0x0) || (cVar7 != '\0')) goto LAB_0091e1fe; if (local_89 == '\0') { pbVar8 = map_u64_bool_subscript(piVar14 + 0x188,&local_88); *pbVar8 = 1; } else { std::map::erase(); } if (DAT_00c72620 == '\0') { sprintf_s((byte *)&DAT_00c72620,0x400,&DAT_00b60c28); } piVar12 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)&DAT_00c72620,0); if (piVar12 != (int *)0x0) { local_6c = *(byte **)piVar14[0x188]; if (local_6c != (byte *)piVar14[0x188]) { do { sprintf(local_68,(byte *)"%llu\n"); pbVar8 = local_68; local_80 = CONCAT44(local_68 + 1,(undefined4)local_80); do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); (**(code **)(*piVar12 + 0x1c))(local_68); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_6c); } while (local_6c != (byte *)piVar14[0x188]); } (**(code **)*piVar12)(); } local_6c = (byte *)0x10c; } else { if ((int)local_88 != 0 || local_88._4_4_ != (byte *)0x0) { if (cVar7 == '\0') { piVar12 = (int *)FUN_008fd870(); cVar7 = *piVar12 == piVar14[0x188]; } goto LAB_0091e113; } LAB_0091e1fe: local_6c = (byte *)0xbb; } pMVar6 = g_manager; seed_fart_sound_override((int *)&local_6c); SoundEffects::Play(&pMVar6->_sfxManager,(int)local_6c,1.0,2,0,1.0,0.0); pbVar8 = (byte *)(piVar14 + 3); std::string::assign((char *)pbVar8,&s_empty,0); local_6c = g_userProfile; local_70 = KAGE::System::UserProfile::vftable; local_14._0_1_ = 2; if (g_userProfile == (void *)0x0) { local_80 = 0; local_80._4_4_ = (int *)0x0; local_80._0_4_ = 0; local_a8._4_4_ = (undefined **)local_80._4_4_; local_a8._0_4_ = (undefined4)local_80; } else { local_a8._4_4_ = (undefined **)*(undefined4 *)((int)g_userProfile + 0xc); local_a8._0_4_ = *(undefined4 *)((int)g_userProfile + 8); } if (0xf < (uint)piVar14[8]) { pbVar8 = *(byte **)pbVar8; } local_80 = CONCAT44(auStack_f2 + -10,(undefined4)local_80); UserProfile::find_or_create(&local_a8); local_14._0_1_ = 3; ppuVar23 = KAGE::System::UserProfile::vftable; pvVar11 = extraout_EAX_00; if (((extraout_EAX_00 != (void *)0x0) && (*(int *)((int)extraout_EAX_00 + 8) != 0 || *(int *)((int)extraout_EAX_00 + 0xc) != 0)) && (*(int *)((int)extraout_EAX_00 + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(auStack_f2 + -10); } local_14._0_1_ = 2; OnlineChatMessage::constructor(local_e8,piVar14,pbVar8,ppuVar23,pvVar11,1.0); local_14 = CONCAT31(local_14._1_3_,4); piVar14[9] = *extraout_EAX_01; piVar14[0xb] = extraout_EAX_01[2]; FormattedText::operator_assign(piVar14 + 0xc,extraout_EAX_01 + 3); piVar14[0x10] = extraout_EAX_01[7]; piVar14[0x11] = extraout_EAX_01[8]; piVar14[0x12] = extraout_EAX_01[9]; piVar14[0x13] = extraout_EAX_01[10]; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14 = 0xffffffff; piVar14[2] = 0; if (local_bc != (int *)0x0) { local_14 = 5; piVar12 = local_bc; if (local_bc != local_b8) { do { (**(code **)*piVar12)(); piVar12 = piVar12 + 2; } while (piVar12 != local_b8); } local_14 = 0xffffffff; uVar20 = local_b4 - (int)local_bc & 0xfffffff8; piVar12 = local_bc; if (0xfff < uVar20) { piVar12 = (int *)local_bc[-1]; uVar20 = uVar20 + 0x23; if (0x1f < (uint)((int)local_bc + (-4 - (int)piVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar12,uVar20); } } else { if (piVar14[7] != 0) { OnlineChat::broadcast_message(); } std::string::assign((char *)pbVar8,&s_empty,0); local_88 = CONCAT44(g_userProfile,KAGE::System::UserProfile::vftable); local_14 = 6; local_a8 = FUN_00a23920(); if (0xf < (uint)piVar14[8]) { pbVar8 = *(byte **)pbVar8; } local_80 = CONCAT44(auStack_f2 + -10,(undefined4)local_80); UserProfile::find_or_create(&local_a8); local_14._0_1_ = 7; ppuVar23 = KAGE::System::UserProfile::vftable; pvVar11 = extraout_EAX; if (((extraout_EAX != (void *)0x0) && (*(int *)((int)extraout_EAX + 8) != 0 || *(int *)((int)extraout_EAX + 0xc) != 0)) && (*(int *)((int)extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(auStack_f2 + -10); } local_14._0_1_ = 6; OnlineChatMessage::constructor(local_54,piVar14,pbVar8,ppuVar23,pvVar11,1.0); local_14 = CONCAT31(local_14._1_3_,8); FUN_0091dbc0(); FUN_0091db00(); local_14 = 0xffffffff; piVar14[2] = 0; piVar14[0x14] = 5; KAGE_LogMessage(1,(byte *)"[Frame %d] Broadcasting chat message \n"); } } } if (piVar14[2] != 0) { online_chat_text_input(); } LAB_0091e4c1: lVar5 = CONCAT44(local_6c,local_a0); if (piVar14[2] != 0) { piVar14[2] = piVar14[2] + 1; uVar22 = GetTimeNs(); uVar20 = (uint)(uVar22 >> 0x20); lVar3 = (uVar22 & 0xffffffff) * 0x431bde82; local_88 = CONCAT44((int)((ulonglong)lVar3 >> 0x20),(int)local_88); lVar4 = (ulonglong)uVar20 * 0xd7b634db; lVar5 = (ulonglong)uVar20 * 0x431bde82; uVar22 = lVar4 + ((uVar22 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar22 >> 0x20); lVar3 = lVar3 + (uVar22 & 0xffffffff); local_80 = CONCAT44((int)((ulonglong)lVar4 >> 0x20),(int)lVar3); uVar20 = (uint)((ulonglong)lVar3 >> 0x20); lVar3 = lVar5 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar20),uVar17 + uVar20); uVar20 = (uint)((ulonglong)lVar3 >> 0x20); local_90[0x18] = (uint)lVar3 >> 0x12 | uVar20 * 0x4000; local_90[0x19] = uVar20 >> 0x12; piVar14 = local_90; } local_6c = (byte *)((ulonglong)lVar5 >> 0x20); local_a0 = (void *)lVar5; if (0.0 < (float)piVar14[0x16]) { uVar22 = GetTimeNs(); uVar17 = (uint)(uVar22 >> 0x20); lVar5 = (uVar22 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar17 * 0xd7b634db + ((uVar22 & 0xffffffff) * 0xd7b634db >> 0x20); uVar18 = (uint)((ulonglong)lVar3 >> 0x20); uVar20 = (int)((ulonglong)lVar5 >> 0x20) + (uint)CARRY4((uint)lVar5,(uint)lVar3); lVar5 = (ulonglong)uVar17 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar18,uVar20),uVar18 + uVar20); uVar20 = (uint)((ulonglong)lVar5 >> 0x20); uVar18 = (uint)lVar5 >> 0x12 | uVar20 * 0x4000; uVar17 = local_90[0x186] >> 0x1f; uVar20 = ((uVar20 >> 0x12) - local_90[0x19]) - (uint)(uVar18 < (uint)local_90[0x18]); piVar14 = local_90; if ((uVar17 <= uVar20) && ((uVar17 < uVar20 || ((uint)local_90[0x186] < uVar18 - local_90[0x18])))) { local_90[0x16] = 0; } } fVar21 = (float)piVar14[0x15]; if ((float)piVar14[0x16] <= fVar21) { if (fVar21 <= (float)piVar14[0x16]) { ExceptionList = local_1c; return; } fVar21 = fVar21 - (float)piVar14[0x187]; } else { fVar21 = fVar21 + (float)piVar14[0x187]; } if (fVar21 <= 0.0) { fVar21 = 0.0; } if (1.0 <= fVar21) { fVar21 = 1.0; } piVar14[0x15] = (int)fVar21; ExceptionList = local_1c; return; } //@@ 0091e650 OnlineChat::render_all /* DB: ECX=NetplayManager+0x1230 from NetplayManager::Render and Menu_OnlineLobby::Render: renders the input line then each message via OnlineChat::render */ void OnlineChat::render_all(float *param_1,int *param_2) { float *pfVar1; undefined4 *in_ECX; float local_10; float local_c; float local_8; pfVar1 = param_1; if ((char)param_2 == '\0') { local_8 = (float)in_ECX[0x15]; if (local_8 <= 0.0) { return; } } else { local_8 = 1.0; } if (in_ECX[2] != 0) { local_10 = *param_1 + 0.0; local_c = (float)in_ECX[0x182] * (float)in_ECX[0x17d] + param_1[1]; render(&local_10,1,(byte)((uint)in_ECX[2] / 0x19) & 1); } local_10 = *pfVar1; local_c = pfVar1[1]; param_1 = (float *)*in_ECX; if (param_1 != (float *)*param_1) { do { param_2 = (int *)param_1; std::_Tree_iterator::operator_decrement(¶m_2); render(&local_10,0,0); std::_Tree_iterator::operator_decrement(¶m_1); } while (param_1 != (float *)*(int **)*in_ECX); } return; } //@@ 0091e730 LobbyList::clear /* DB: ? ECX = std::map whose values hold vectors: clears the shared string and each node's vector<12byte>, erases all nodes (FUN_0091fb10) and resets the head/size; Menu_Online::update_mode_select, Menu_OnlineLobbyList::Update prototype: db/protos.zhl */ void __thiscall LobbyList::clear(void *this) { int *piVar1; int *local_8; std::string::assign((char *)((int)this + 0xc),&s_empty,0); std::vector<12byte>::clear(); piVar1 = *(int **)this; local_8 = (int *)*piVar1; if (local_8 != piVar1) { do { std::vector<12byte>::clear(); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); piVar1 = *(int **)this; } while (local_8 != piVar1); } std::map::_Erase_tree(this,piVar1[1]); piVar1[1] = (int)piVar1; *piVar1 = (int)piVar1; piVar1[2] = (int)piVar1; *(undefined4 *)((int)this + 4) = 0; return; } //@@ 0091e7a0 FUN_0091e7a0 undefined1 FUN_0091e7a0(void) { int in_ECX; if ((*(int *)(in_ECX + 8) == 0) && (*(int *)(in_ECX + 0x50) < 1)) { return 0; } return 1; } //@@ 0091e7c0 OnlineChat::broadcast_message /* DB: sends local Steam id (8 bytes), u16 length and the text via NetConnection/NetplayManager::send_message; online_chat_update when +0x1c set */ void OnlineChat::broadcast_message(undefined4 *param_1) { Manager *pMVar1; char cVar2; uint uVar3; int *piVar4; undefined4 *puVar5; void *data; void *messageRefCount; undefined **local_64; void *local_60; undefined4 local_5c; void *local_58; void *local_54; void *local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined **local_3c; undefined1 local_38 [4]; int *local_34; undefined4 local_30; uint local_2c [2]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint local_14; puStack_20 = (undefined1 *)(local_2c + 10); local_14 = 0xffffffff; puStack_18 = &LAB_00b0a485; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 7); ExceptionList = &local_1c; apply_roll_command(param_1); local_24 = param_1[4]; KAGE::Filesys::BufferedStream::BufferedStream(&local_64,0); local_14 = 0; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec,uVar3); if (*piVar4 == 0) { local_30 = 1; } else { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec,uVar3); local_30 = (**(code **)(*(int *)*puVar5 + 0xc))(); } local_2c[0] = 0; (*(code *)local_3c[7])(&local_30,8,1); uVar3 = local_24; local_2c[0] = local_24 & 0xffff; (*(code *)local_3c[7])(local_2c,2,1); if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } buffered_stream_write(&local_3c,param_1,1,uVar3); data = local_58; if (local_4c != (void *)0x0) { data = local_4c; } if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } messageRefCount = (void *)0xa; NetConnection::send_message(g_multiplayerService,local_38,1,data,(uint)local_60,10); pMVar1 = g_manager; local_14._0_1_ = 1; FUN_008ef1d0(local_38); NetplayManager::send_message(&pMVar1->_netplayManager,0x11,local_60,messageRefCount); local_14 = CONCAT31(local_14._1_3_,2); if (local_34 != (int *)0x0) { cVar2 = (**(code **)(*local_34 + 0xc))(); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_38); } } local_3c = KAGE::Filesys::StreamBase::vftable; local_64 = KAGE::Filesys::BufferedStreamBase::vftable; local_60 = (void *)0x0; local_5c = 0; local_54 = local_58; local_4c = (void *)0x0; local_48 = 0; local_44 = 0; local_40 = 0; FUN_007dcd30(); ExceptionList = local_1c; return; } //@@ 0091e980 Camera::UpdateUltrasmooth /* ZHL [prefix62/64] __thiscall void Camera::UpdateUltrasmooth(bool unk); */ void __thiscall Camera::UpdateUltrasmooth(Camera *this,uint *param_2,int *param_3) { code *pcVar1; undefined1 *puVar2; char cVar3; uint securityCookie; char *match; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 uVar4; uint *message; int *profanityNode; uint uVar5; undefined **stream; undefined1 local_3c [8]; int foundNode; undefined8 local_30; Camera *self; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; Camera *self2; message = param_2; puStack_20 = local_3c + 0x38; puStack_18 = &LAB_00b0a4c8; local_1c = ExceptionList; securityCookie = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; local_14 = 0; self = this; puVar2 = local_3c + 0x38; if ((g_manager->_optionsConfig)._onlineChatEnabled != 0) { local_30 = *(undefined8 *)param_2; FUN_00731ee0(local_3c,&local_30); self2 = self; if (*(char *)(foundNode + 0xd) == '\0') { if ((*(uint *)(foundNode + 0x14) <= message[1]) && (((*(uint *)(foundNode + 0x14) < message[1] || (*(uint *)(foundNode + 0x10) <= *message)) && (puVar2 = puStack_20, foundNode != *(int *)(this[10]._focusPositionBuffer + 8))))) goto LAB_0091ec0a; } local_24 = **(int **)self->_aimOffsetBuffer; if ((int *)local_24 != *(int **)self->_aimOffsetBuffer) { uVar5 = 0x80000000; do { if (*(uint *)(local_24 + 0x3c) < *(uint *)(*(int *)(local_24 + 0x18) + 0x5f8)) { *(uint *)(local_24 + 0x38) = *(uint *)self2[10]._shakeOffsetBuffer ^ uVar5; } *(uint *)(local_24 + 0x3c) = *(uint *)(local_24 + 0x3c) + 1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); } while (local_24 != *(uint *)self2->_aimOffsetBuffer); message = param_2; } if (message[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); message = param_2; } if (message[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } stream = KAGE::Filesys::BufferedStream::vftable; local_14 = CONCAT31(local_14._1_3_,1); local_30 = 0; memory_stream_read(&stream,&local_30,8,1); local_24 = 0; if ((code *)stream[5] == memory_stream_read) { memory_stream_read(&stream,&local_24,2,1); } else { (*(code *)stream[5])(&local_24); } uVar5 = local_24 & 0xffff; memory_stream_read(&stream,&DAT_00c93050,1,uVar5); manager = g_manager; if (0x7ff < uVar5) { FUN_00aef86f(); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } (&DAT_00c93050)[uVar5] = 0; uVar4 = extraout_ECX; if ((manager->_optionsConfig)._onlineFilterEnabled != 0) { profanity_list_load(); profanityNode = (int *)*DAT_00c7986c; uVar4 = extraout_ECX_00; if (profanityNode != DAT_00c7986c) { do { match = (char *)stristr(); uVar4 = extraout_ECX_01; while (match != (char *)0x0) { uVar5 = (uint)*(byte *)(profanityNode + 10); if (match == &DAT_00c93050) { cVar3 = (&DAT_00c93050)[uVar5]; LAB_0091ebb0: if ((cVar3 == ' ') || (cVar3 == '\0')) { strncpy(match,"********************************",uVar5); } } else { cVar3 = match[uVar5]; if (match[-1] == ' ') goto LAB_0091ebb0; } match = (char *)stristr(); uVar4 = extraout_ECX_02; } profanityNode = (int *)*profanityNode; } while (profanityNode != DAT_00c7986c); } } OnlineChat::add_message(uVar4,(undefined4)local_30,local_30._4_4_,*param_2,param_2[1]); FUN_00a58200(); puVar2 = puStack_20; } LAB_0091ec0a: puStack_20 = puVar2; local_14 = 2; if (((param_3 != (int *)0x0) && (cVar3 = (**(code **)(*param_3 + 0xc))(securityCookie), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_2); } ExceptionList = local_1c; return; } //@@ 0091ec60 OnlineChat::add_message /* DB: ? from 0091e980: builds a chat line (0091cec0 OnlineChatMessage::constructor UserProfile::find_or_create + load_steam_avatar), FormattedText of DAT_00c93050, stamps GetTimeNs ms at +0x60 and alpha 1.0 at +0x58 */ void OnlineChat::add_message (undefined4 param_1,undefined4 param_2,undefined ***param_3,undefined4 param_4, undefined4 param_5) { longlong lVar1; longlong lVar2; int extraout_EAX; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; undefined **local_a0; undefined4 *local_9c; uint uStack_98; undefined4 local_88; undefined4 local_84; undefined **local_7c; undefined1 local_4c [4]; undefined **local_48; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a510; local_10 = ExceptionList; uStack_98 = __security_cookie ^ (uint)(local_4c + 0x48); ExceptionList = &local_10; local_9c = (undefined4 *)0x91ec95; local_18 = in_ECX; OnlineChatMessage::constructor(local_4c); local_8 = 0; local_88 = param_2; local_84 = param_3; local_a0 = (undefined **)0x91ecb4; FUN_0091fb80(); local_9c = &local_88; local_8 = CONCAT31(local_8._1_3_,1); local_a0 = (undefined **)¶m_2; std::multimap::emplace(); local_9c = (undefined4 *)0x91ecd2; std::vector<12byte>::clear(); local_9c = (undefined4 *)0x91ecda; std::vector<12byte>::_Tidy(); local_7c = KAGE::System::UserProfileBase::vftable; local_8 = 0xffffffff; local_9c = (undefined4 *)0x91ecf0; std::vector<12byte>::clear(); local_9c = (undefined4 *)0x91ecf8; std::vector<12byte>::_Tidy(); param_3 = &local_a0; local_48 = KAGE::System::UserProfileBase::vftable; local_a0 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(¶m_4); local_8 = 2; local_a0 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_a0); } local_8 = 0xffffffff; OnlineChatMessage::set_text(in_ECX,&DAT_00c93050,1); local_9c = (undefined4 *)0x91ed5d; uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(local_18 + 0x60) = (uint)lVar1 >> 0x12 | uVar3 * 0x4000; *(uint *)(local_18 + 100) = uVar3 >> 0x12; *(undefined4 *)(local_18 + 0x58) = 0x3f800000; ExceptionList = local_10; return; } //@@ 0091ede0 FUN_0091ede0 void FUN_0091ede0(void) { int in_ECX; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); *(undefined ***)(in_ECX + 0xc) = KAGE::System::UserProfileBase::vftable; return; } //@@ 0091ee00 OnlineChat::is_key_repeating /* DB: ECX=OnlineChat state: key code param, held counter at +0x68+key*4; true on press or every 3rd frame after 30 held; online_chat_text_input */ undefined4 OnlineChat::is_key_repeating(int param_1) { int iVar1; int iVar2; char cVar3; int in_ECX; iVar2 = param_1; iVar1 = in_ECX + param_1 * 4; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a20730,¶m_1,0,0); if (cVar3 == '\0') { *(undefined4 *)(iVar1 + 0x68) = 0; } else { *(int *)(iVar1 + 0x68) = *(int *)(iVar1 + 0x68) + 1; } param_1 = iVar2; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,¶m_1,0,0); if ((cVar3 == '\0') && ((*(int *)(iVar1 + 0x68) < 0x1e || (*(int *)(iVar1 + 0x68) % 3 != 0)))) { return 0; } return 1; } //@@ 0091ee90 online_chat_text_input /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? only caller online_chat_update 0091dc10; polls GetKeyState(VK_CAPITAL) and key codes 0x154/0x155/0x158 via input vftable+0x74, edits the chat buffer (memcpy), FUN_0091cf80 append */ void online_chat_text_input(void) { byte *end; char cVar1; byte bVar2; SHORT SVar3; BOOL BVar4; HANDLE hMem; char *pcVar5; byte *pbVar6; byte *text; byte *pbVar7; void *extraout_EAX; byte *****pppppbVar8; void *in_ECX; char *pcVar9; int *this; byte *****pppppbVar10; int iVar11; uint uVar12; uint uVar13; undefined **user; void *userRefCount; byte abStack_ba [34]; undefined4 local_80 [2]; undefined4 local_78; undefined1 local_74 [4]; int local_70; int local_6c; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined8 local_4c; byte *local_40; byte local_39; byte *****local_38 [4]; uint local_28; uint local_24; undefined **local_20; void *local_1c; undefined2 local_18; uint local_14; void *local_10; undefined1 *puStack_c; byte ****local_8; local_8 = (byte ****)0xffffffff; puStack_c = &LAB_00b0a55d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_38 + 0xd); ExceptionList = &local_10; pbVar7 = (byte *)((int)in_ECX + 0xc); std::string::string((char *)local_38,pbVar7); local_8 = (byte ****)0x0; SVar3 = GetKeyState(0x14); local_50 = CONCAT22(SVar3,(undefined2)local_50) & 0xff01ffff; local_4c = CONCAT44(0x154,(int *)local_4c); cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar1 == '\0') { local_4c = CONCAT44(0x158,(int *)local_4c); cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar1 != '\0') goto LAB_0091ef40; local_39 = 0; if (local_50._2_1_ != '\0') goto LAB_0091ef44; local_50 = local_50 & 0xffffff; } else { LAB_0091ef40: local_39 = 1; LAB_0091ef44: local_50 = CONCAT13(1,(undefined3)local_50); } local_4c = CONCAT44(0x155,(int *)local_4c); cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar1 == '\0') { local_4c = CONCAT44(0x159,(int *)local_4c); cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a20730,(int)&local_4c + 4); if (cVar1 != '\0') goto LAB_0091ef9e; } else { LAB_0091ef9e: cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { BVar4 = OpenClipboard((HWND)0x0); if (BVar4 != 0) { hMem = GetClipboardData(1); local_4c = CONCAT44(hMem,(int *)local_4c); if ((hMem != (HANDLE)0x0) && (pcVar5 = GlobalLock(hMem), pcVar5 != (char *)0x0)) { pcVar9 = pcVar5; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); uVar12 = 0x1ff; if ((uint)((int)pcVar9 - (int)(pcVar5 + 1)) < 0x1ff) { uVar12 = (int)pcVar9 - (int)(pcVar5 + 1); } memcpy(&DAT_00c93850,pcVar5,uVar12 * 2); (&DAT_00c93850)[uVar12] = 0; GlobalUnlock(local_4c._4_4_); CloseClipboard(); pcVar5 = &DAT_00c93850; do { pcVar9 = pcVar5; pcVar5 = pcVar9 + 1; } while (*pcVar9 != '\0'); std::string::append((char *)pbVar7,&DAT_00c93850,(uint)(pcVar9 + -0xc93850)); goto LAB_0091f085; } } CloseClipboard(); DAT_00c93850 = 0; goto LAB_0091f085; } } local_40 = (byte *)0x41; do { cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { if (local_50._3_1_ == '\0') { pbVar6 = (byte *)(uint)(byte)((char)local_40 + 0x20); } else { pbVar6 = local_40; } std::string::push_back((char *)pbVar7,(byte)pbVar6); } local_40 = (byte *)((int)local_40 + 1); } while ((int)local_40 < 0x5b); LAB_0091f085: local_40 = (byte *)0x0; do { cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { if (local_50._3_1_ == '\0') { bVar2 = (char)local_40 + 0x30; } else { local_20 = (undefined **)0x23402129; local_1c = (void *)0x265e2524; local_18 = 0x282a; bVar2 = *(byte *)((int)&local_20 + (int)local_40); local_4c._0_5_ = CONCAT14(bVar2,(int *)local_4c); } std::string::push_back((char *)pbVar7,bVar2); } local_40 = (byte *)((int)local_40 + 1); } while ((int)local_40 < 10); local_40 = (byte *)0x140; do { cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,(char)local_40 - 0x10); } local_40 = local_40 + 1; } while ((int)local_40 < 0x14a); cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,0x20); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 == '\0') { local_50 = CONCAT13(local_39 << 4,(undefined3)local_50); } else { local_50 = CONCAT13(local_39 * '\x10',(undefined3)local_50); std::string::push_back((char *)pbVar7,local_39 * '\x10' + 0x2c); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,local_50._3_1_ + 0x2e); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,0x2e); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,local_50._3_1_ + 0x2f); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { bVar2 = 0x2d; if (local_39 != 0) { bVar2 = 0x5f; } std::string::push_back((char *)pbVar7,bVar2); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { bVar2 = 0x3d; if (local_39 != 0) { bVar2 = 0x2b; } std::string::push_back((char *)pbVar7,bVar2); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { bVar2 = 0x27; if (local_39 != 0) { bVar2 = 0x22; } std::string::push_back((char *)pbVar7,bVar2); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,(local_39 ^ 1) + 0x3a); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 == '\0') { local_39 = local_39 << 5; } else { local_39 = local_39 * ' '; std::string::push_back((char *)pbVar7,local_39 + 0x5b); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,local_39 + 0x5d); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,local_39 + 0x5c); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,0x2f); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,0x2d); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,0x2b); } cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { std::string::push_back((char *)pbVar7,0x3d); } cVar1 = OnlineChat::is_key_repeating(); if ((cVar1 != '\0') && (*(int *)((int)in_ECX + 0x1c) != 0)) { if (*(uint *)((int)in_ECX + 0x20) < 0x10) { local_40 = pbVar7; } else { local_40 = *(byte **)pbVar7; } pbVar7 = local_40; local_50 = 0; local_4c = CONCAT44(local_40 + *(int *)((int)in_ECX + 0x1c),(int *)local_4c); pbVar6 = utf8_decode_next(local_40,&local_50,local_40 + *(int *)((int)in_ECX + 0x1c)); if (local_50 != 0) { end = local_4c._4_4_; do { text = pbVar6; local_50 = 0; local_40 = pbVar7; pbVar6 = utf8_decode_next(text,&local_50,end); pbVar7 = text; } while (local_50 != 0); } this = (int *)((int)in_ECX + 0xc); pbVar7 = local_40 + (*(int *)((int)in_ECX + 0x1c) - (int)local_4c._4_4_); if (*(byte **)((int)in_ECX + 0x1c) < pbVar7) { std::string::append_n((char *)this,(int)pbVar7 - (int)*(byte **)((int)in_ECX + 0x1c),0); } else { if (0xf < *(uint *)((int)in_ECX + 0x20)) { this = (int *)*this; } *(byte **)((int)in_ECX + 0x1c) = pbVar7; *(byte *)((int)this + (int)pbVar7) = 0; } } pppppbVar10 = (byte *****)((int)in_ECX + 0xc); cVar1 = OnlineChat::is_key_repeating(); if (cVar1 != '\0') { (**(code **)(PTR_vftable_00c57b18 + 0x28))(); local_8._0_1_ = 1; (**(code **)(*(int *)local_4c + 0x50))(0x100); local_8._0_1_ = 2; if (((local_4c._4_4_ != (byte *)0x0) && (cVar1 = (**(code **)(*(int *)local_4c._4_4_ + 0xc))(), cVar1 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } local_8 = (byte ****)((uint)local_8._1_3_ << 8); *(undefined4 *)((int)in_ECX + 8) = 0; } if (*(uint *)((int)in_ECX + 0x1c) != local_28) { local_1c = g_userProfile; local_20 = KAGE::System::UserProfile::vftable; local_8._0_1_ = 3; if (g_userProfile == (void *)0x0) { local_4c = 0; local_4c._4_4_ = (byte *)0x0; local_4c._0_4_ = (int *)0x0; local_50 = (uint)local_4c._4_4_; local_54 = (int *)local_4c; } else { local_50 = *(uint *)((int)g_userProfile + 0xc); local_54 = *(undefined4 *)((int)g_userProfile + 8); } pppppbVar8 = pppppbVar10; if (0xf < *(uint *)((int)in_ECX + 0x20)) { pppppbVar8 = (byte *****)*pppppbVar10; } local_4c = CONCAT44(pppppbVar8,(int *)local_4c); local_40 = abStack_ba + -10; UserProfile::find_or_create(&local_54); local_8._0_1_ = 4; user = KAGE::System::UserProfile::vftable; userRefCount = extraout_EAX; if (((extraout_EAX != (void *)0x0) && (*(int *)((int)extraout_EAX + 8) != 0 || *(int *)((int)extraout_EAX + 0xc) != 0)) && (*(int *)((int)extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(abStack_ba + -10); } local_8._0_1_ = 3; OnlineChatMessage::constructor(local_80,in_ECX,local_4c._4_4_,user,userRefCount,1.0); local_8 = (byte ****)CONCAT31(local_8._1_3_,6); uVar13 = (local_6c - local_70) / 0xc; uVar12 = uVar13 - 1; if (uVar12 < uVar13) { uVar13 = (uint)*(ushort *)(local_70 + 8 + uVar12 * 0xc); iVar11 = *(int *)(local_70 + 4 + uVar12 * 0xc); } else { iVar11 = 0; uVar13 = 0; } pppppbVar8 = pppppbVar10; if (0xf < *(uint *)((int)in_ECX + 0x20)) { pppppbVar8 = (byte *****)*pppppbVar10; } if ((*(int *)((int)in_ECX + 0x1c) == 0) || ((byte *)(iVar11 + uVar13) == (byte *)((int)pppppbVar8 + *(int *)((int)in_ECX + 0x1c)))) { *(undefined4 *)((int)in_ECX + 0x24) = local_80[0]; *(undefined4 *)((int)in_ECX + 0x2c) = local_78; FormattedText::operator_assign((void *)((int)in_ECX + 0x30),local_74); *(undefined4 *)((int)in_ECX + 0x40) = local_64; *(undefined4 *)((int)in_ECX + 0x44) = local_60; *(undefined4 *)((int)in_ECX + 0x48) = local_5c; *(undefined4 *)((int)in_ECX + 0x4c) = local_58; } else if ((byte ******)pppppbVar10 != local_38) { pppppbVar8 = (byte *****)local_38; if (0xf < local_24) { pppppbVar8 = local_38[0]; } std::string::assign((char *)pppppbVar10,(byte *)pppppbVar8,local_28); } std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); } if (0xf < local_24) { uVar12 = local_24 + 1; pppppbVar10 = local_38[0]; if (0xfff < uVar12) { pppppbVar10 = (byte *****)local_38[0][-1]; uVar12 = local_24 + 0x24; if ((byte *)0x1f < (byte *)((int)local_38[0] + (-4 - (int)pppppbVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar10,uVar12); } ExceptionList = local_10; return; } //@@ 0091f5d0 OnlineChat::apply_roll_command /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? if the message starts with '/', parses it and replaces it with "Rolled a D20! Result = " + rand%20+1 or "Rolled a D6! Result = " + rand%6+1; first call in OnlineChat::broadcast_message */ void OnlineChat::apply_roll_command(char *param_1) { byte bVar1; char *pcVar2; byte *******pppppppbVar3; int iVar4; byte *******pppppppbVar5; int iVar6; byte *******pppppppbVar7; uint uVar8; uint size; byte *******local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; byte ******local_8; local_8 = (byte ******)0xffffffff; puStack_c = &LAB_00b0a59d; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); if (*(int *)(param_1 + 0x10) == 0) { return; } pcVar2 = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { pcVar2 = *(char **)param_1; } if (*pcVar2 != '/') { return; } ExceptionList = &local_10; std::string::string((char *)local_30,param_1); local_8 = (byte ******)0x0; pppppppbVar5 = (byte *******)local_30; if (0xf < local_1c) { pppppppbVar5 = local_30[0]; } pppppppbVar3 = (byte *******)((int)pppppppbVar5 + local_20); pppppppbVar7 = (byte *******)local_30; if (0xf < local_1c) { pppppppbVar7 = local_30[0]; } if (pppppppbVar7 != pppppppbVar3) { iVar6 = (int)pppppppbVar5 - (int)pppppppbVar7; do { iVar4 = tolower((int)(char)*(byte *)pppppppbVar7); *(byte *)((int)pppppppbVar7 + iVar6) = (byte)iVar4; pppppppbVar7 = (byte *******)((int)pppppppbVar7 + 1); } while (pppppppbVar7 != pppppppbVar3); } uVar8 = local_1c; pppppppbVar5 = local_30[0]; pppppppbVar7 = (byte *******)local_30; if (0xf < local_1c) { pppppppbVar7 = local_30[0]; } bVar1 = str_eq((byte *)pppppppbVar7,local_20,&DAT_00b79ecc,3); if (bVar1 == 0) { pppppppbVar7 = (byte *******)local_30; if (0xf < uVar8) { pppppppbVar7 = pppppppbVar5; } bVar1 = str_eq((byte *)pppppppbVar7,local_20,&DAT_00b79eac,4); if (bVar1 == 0) goto LAB_0091f723; iVar6 = rand(); std::string::assign(param_1,(byte *)"Rolled a D20! Result = ",0x17); std::string::push_back(param_1,(char)(iVar6 % 0x14) + 1); iVar6 = iVar6 % 0x14 + 0x1c; } else { iVar6 = rand(); std::string::assign(param_1,(byte *)"Rolled a D6! Result = ",0x16); std::string::push_back(param_1,(char)(iVar6 % 6) + 1); iVar6 = iVar6 % 6 + 0x16; } *(int *)&g_manager[1]._gamestate.field_0x92c = iVar6; uVar8 = local_1c; pppppppbVar5 = local_30[0]; LAB_0091f723: if (0xf < uVar8) { size = uVar8 + 1; pppppppbVar7 = pppppppbVar5; if (0xfff < size) { pppppppbVar7 = (byte *******)pppppppbVar5[-1]; size = uVar8 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbVar5 + (-4 - (int)pppppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar7,size); } ExceptionList = local_10; return; } //@@ 0091f780 NetplayManager::load_mute_list /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=NetplayManager (only caller NetplayManager::Init): "%s/mute_list.txt" in g_userDataDir, clears the u64 set +0x620, SaveDataManager::open_file_read, reads lines, stoull ("invalid stoull argument") into the set (map_u64_bool_subscript) */ void NetplayManager::load_mute_list(void) { char *pcVar1; char cVar2; uint uVar3; int *piVar4; int iVar5; undefined1 *puVar6; char *pcVar7; int *piVar8; byte *pbVar9; int in_ECX; undefined4 ****ppppuVar10; code *pcVar11; ulonglong uVar12; undefined8 local_3c; int *local_34; undefined4 ****local_30; undefined4 ****local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_14 = uVar3; if (DAT_00c72620 == '\0') { sprintf_s((byte *)&DAT_00c72620,0x400,&DAT_00b60c28); } local_34 = (int *)(in_ECX + 0x620); iVar5 = *local_34; FID_conflict__Erase_tree_>_> (local_34,(fuzzer_allocator_> *)local_34, *(_Tree_node **)(iVar5 + 4)); *(int *)(iVar5 + 4) = iVar5; *(int *)iVar5 = iVar5; *(int *)(iVar5 + 8) = iVar5; *(undefined4 *)(in_ECX + 0x624) = 0; piVar4 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)&DAT_00c72620); if (piVar4 != (int *)0x0) { cVar2 = (**(code **)(*piVar4 + 0x10))(uVar3); if (cVar2 == '\0') { pcVar11 = strchr_exref; do { iVar5 = (**(code **)(*piVar4 + 0x18))(&DAT_00c93a50,0x400); if (iVar5 != 0) { puVar6 = (undefined1 *)(*pcVar11)(&DAT_00c93a50,0xd); if (puVar6 != (undefined1 *)0x0) { *puVar6 = 0; } puVar6 = (undefined1 *)(*pcVar11)(&DAT_00c93a50,10); if (puVar6 != (undefined1 *)0x0) { *puVar6 = 0; } local_1c = 0; local_18 = 0xf; local_2c[0] = (undefined4 ****)0x0; pcVar1 = &DAT_00c93a50; do { pcVar7 = pcVar1; pcVar1 = pcVar7 + 1; } while (*pcVar7 != '\0'); std::string::assign((char *)local_2c,&DAT_00c93a50,(uint)(pcVar7 + -0xc93a50)); local_8 = (undefined4 ***)0x0; piVar8 = _errno(); ppppuVar10 = local_2c; if (0xf < local_18) { ppppuVar10 = local_2c[0]; } *piVar8 = 0; uVar12 = strtoull(ppppuVar10,&local_30,10); if (ppppuVar10 == local_30) { std::_Xinvalid_argument("invalid stoull argument"); pcVar11 = (code *)swi(3); (*pcVar11)(); return; } if (*piVar8 == 0x22) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("stoull argument out of range"); } local_3c = uVar12; pbVar9 = map_u64_bool_subscript(local_34,&local_3c); local_8 = (undefined4 ***)0xffffffff; *pbVar9 = 1; if (0xf < local_18) { uVar3 = local_18 + 1; ppppuVar10 = local_2c[0]; if (0xfff < uVar3) { ppppuVar10 = (undefined4 ****)local_2c[0][-1]; uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar10,uVar3); } local_1c = 0; local_18 = 0xf; local_2c[0] = (undefined4 ****)((uint)local_2c[0] & 0xffffff00); pcVar11 = strchr_exref; } cVar2 = (**(code **)(*piVar4 + 0x10))(); } while (cVar2 == '\0'); } (**(code **)*piVar4)(1); } ExceptionList = local_10; return; } //@@ 0091f9a0 std::map::erase /* DB: erases a 64-bit key (equal_range then _Extract, node 0x20) from OnlineChat+0x620 (mute map); online_chat_update "/unmute" */ int std::map::erase(uint *param_1) { char cVar1; int *piVar2; uint uVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_10; piVar2 = (int *)*in_ECX; piVar5 = (int *)piVar2[1]; piVar4 = piVar5; piVar8 = piVar2; piVar9 = piVar2; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar3 = piVar4[5]; if ((param_1[1] < uVar3) || ((param_1[1] <= uVar3 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar3) && ((param_1[1] < uVar3 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_10 = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar1 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_10 = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar2) && (*(char *)((int)piVar9 + 0xd) != '\0')) { FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, (_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar2 = (int *)param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar2); operator_delete(ptr,0x20); } while (param_1 != (uint *)piVar9); return local_10; } return local_10; } //@@ 0091fb10 std::map::_Erase_tree /* DB: ? recursive _Erase_tree of 0x48-byte nodes (two vector<12byte>, UserProfile at +0x1c); LobbyList::clear, OnlineChat::destructor */ void std::map::_Erase_tree(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { _Erase_tree(param_1,param_2[2]); piVar2 = (int *)*param_2; vector<12byte>::clear(); vector<12byte>::_Tidy(); param_2[7] = (int)KAGE::System::UserProfileBase::vftable; operator_delete(param_2,0x48); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 0091fb80 FUN_0091fb80 void FUN_0091fb80(undefined4 *param_1) { undefined4 uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a5eb; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = *param_1; in_ECX[1] = KAGE::System::UserProfileBase::vftable; in_ECX[2] = param_1[2]; in_ECX[1] = KAGE::System::UserProfile::vftable; *(undefined1 *)(in_ECX + 3) = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; local_8 = 1; FormattedText::operator_assign(in_ECX + 3,param_1 + 3); uVar1 = param_1[8]; in_ECX[7] = param_1[7]; in_ECX[8] = uVar1; in_ECX[9] = param_1[9]; in_ECX[10] = param_1[10]; ExceptionList = local_10; return; } //@@ 0091fc30 std::multimap::emplace /* DB: ? red-black tree insert of a new 0x48-byte node keyed by a 64-bit value (compares +0x14/+0x10 hi/lo, equal keys go right), value copy-constructed by FUN_0091fb80; from OnlineChat::add_message */ void std::multimap::emplace(undefined4 *param_1,int *param_2) { char cVar1; int iVar2; int iVar3; int *piVar4; bool bVar5; uint uVar6; int *piVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a62d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar2 = *in_ECX; local_8 = 0; piVar7 = operator_new(0x48); local_8 = 1; iVar3 = param_2[1]; piVar7[4] = *param_2; piVar7[5] = iVar3; FUN_0091fb80(param_2 + 2); *piVar7 = iVar2; piVar7[1] = iVar2; piVar7[2] = iVar2; *(undefined2 *)(piVar7 + 3) = 0; local_8 = 2; bVar5 = false; piVar4 = (int *)*in_ECX; piVar9 = (int *)piVar4[1]; if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar8 = piVar9; do { piVar9 = piVar8; if (((uint)piVar9[5] < (uint)piVar7[5]) || (((uint)piVar9[5] <= (uint)piVar7[5] && ((uint)piVar9[4] <= (uint)piVar7[4])))) { piVar8 = (int *)piVar9[2]; bVar5 = false; } else { piVar8 = (int *)*piVar9; bVar5 = true; } } while (*(char *)((int)piVar8 + 0xd) == '\0'); } if (in_ECX[1] == 0x38e38e3) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } in_ECX[1] = in_ECX[1] + 1; piVar7[1] = (int)piVar9; if (piVar9 == piVar4) { *piVar4 = (int)piVar7; piVar4[1] = (int)piVar7; piVar4[2] = (int)piVar7; *(undefined1 *)(piVar7 + 3) = 1; } else { if (bVar5) { *piVar9 = (int)piVar7; if (piVar9 == (int *)*piVar4) { *piVar4 = (int)piVar7; } } else { piVar9[2] = (int)piVar7; if (piVar9 == (int *)piVar4[2]) { piVar4[2] = (int)piVar7; } } cVar1 = *(char *)(piVar7[1] + 0xc); piVar9 = piVar7; while (cVar1 == '\0') { piVar8 = (int *)piVar9[1]; piVar10 = *(int **)piVar8[1]; if (piVar8 == piVar10) { piVar10 = (int *)((undefined4 *)piVar8[1])[2]; if ((char)piVar10[3] == '\0') goto LAB_0091fd9a; if (piVar9 == (int *)piVar8[2]) { FUN_00415fe0(piVar8); piVar9 = piVar8; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar9[1] + 4)); } else if ((char)piVar10[3] == '\0') { LAB_0091fd9a: *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(piVar10 + 3) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; piVar9 = *(int **)(piVar9[1] + 4); } else { if (piVar9 == (int *)*piVar8) { FUN_00415f80(piVar8); piVar9 = piVar8; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar9[1] + 4)); } cVar1 = *(char *)(piVar9[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 0091fe20 FUN_0091fe20 void FUN_0091fe20(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if (iVar1 != 0) { std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); *(undefined ***)(iVar1 + 0x1c) = KAGE::System::UserProfileBase::vftable; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x48); } } return; } //@@ 0091fe60 FUN_0091fe60 void FUN_0091fe60(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x48); } return; } //@@ 0091fe80 NightmareScene::load_nightmares_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (path): FileSystem::Open + XML "nightmares"/"nightmare" nodes with backgroundAnm2/progressAnm2 (default nightmare_bg.anm2), pushes 0x18-byte entries into the vector at ECX+0xc and ANM2::Load into ECX+0x20/+0x248 (NightmareScene sprite offsets); callers Manager::load_configs and ModManager::LoadModContent */ undefined4 NightmareScene::load_nightmares_xml(byte *param_1) { undefined4 *puVar1; qword qVar2; uint uVar3; int *piVar4; undefined4 uVar5; int iVar6; byte *text; void *pvVar7; void *pvVar8; byte *pbVar9; byte ****ppppbVar10; LayerState *pLVar11; int in_ECX; byte *pbVar12; std_string *psVar13; byte *pbVar14; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 extraout_ECX_03; uint size; qword *pqVar15; bool bVar16; byte bVar17; undefined1 auStack_100d0 [48]; undefined1 auStack_100a0 [65564]; byte *local_84; char acStack_80 [4]; char acStack_7c [4]; char acStack_78 [4]; undefined8 local_74; byte *local_6c; char acStack_68 [4]; char acStack_64 [4]; char acStack_60 [4]; uint local_5c; uint uStack_58; byte *local_54; char acStack_50 [4]; char acStack_4c [4]; char acStack_48 [4]; uint local_44; uint uStack_40; byte ****local_3c [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ***local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (byte ***)0xffffffff; puStack_18 = &LAB_00b0a680; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; local_24 = uVar3; piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar4 == (int *)0x0) { uVar5 = 0; } else { local_74._0_4_ = 0; local_74._4_4_ = 0xf; local_84 = (byte *)0x0; uStack_40 = 0xf; local_44 = 0; local_54 = (byte *)0x0; local_14 = (byte ***)0x1; iVar6 = (**(code **)(*piVar4 + 4))(uVar3); text = operator_new_tracked(iVar6 + 1); (**(code **)(*piVar4 + 0x14))(text,1,iVar6); text[iVar6] = 0; (**(code **)*piVar4)(1); FUN_00413b90(); local_14._0_1_ = 2; uVar3 = 0x91ffb1; pbVar9 = text; rapidxml::xml_document::parse(auStack_100d0,text); bVar17 = (byte)pbVar9; pvVar7 = xml_node::first_node(auStack_100d0,(byte *)"nightmares",uVar3,bVar17); pvVar8 = xml_node::first_attribute(pvVar7,&DAT_00b66f40,uVar3,bVar17); local_2c = 0; local_28 = 0xf; local_3c[0] = (byte ****)0x0; pbVar9 = &g_xmlNullStr; if (*(byte **)((int)pvVar8 + 4) != (byte *)0x0) { pbVar9 = *(byte **)((int)pvVar8 + 4); } pbVar14 = pbVar9 + 1; pbVar12 = pbVar9; do { bVar17 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar17 != 0); uVar3 = (int)pbVar12 - (int)pbVar14; std::string::assign((char *)local_3c,pbVar9,uVar3); local_14._0_1_ = 3; pvVar8 = xml_node::first_attribute(pvVar7,(byte *)"progressAnm2",(uint)pbVar9,(byte)uVar3); pbVar9 = &g_xmlNullStr; if (*(byte **)((int)pvVar8 + 4) != (byte *)0x0) { pbVar9 = *(byte **)((int)pvVar8 + 4); } pbVar12 = pbVar9; do { bVar17 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar17 != 0); psVar13 = (std_string *)(pbVar12 + -(int)(pbVar9 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar13) { LAB_00920436: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppbVar10 = (byte ****)local_3c; if (0xf < local_28) { ppppbVar10 = local_3c[0]; } std::string::concat((char *)&local_6c,(int)pbVar14,psVar13,(byte *)ppppbVar10,local_2c,pbVar9, (uint)psVar13); bVar17 = (byte)psVar13; if (0xf < local_74._4_4_) { uVar3 = local_74._4_4_ + 1; pbVar9 = local_84; if (0xfff < uVar3) { pbVar9 = *(byte **)(local_84 + -4); uVar3 = local_74._4_4_ + 0x24; if ((byte *)0x1f < local_84 + (-4 - (int)pbVar9)) goto LAB_0092030e; } operator_delete(pbVar9,uVar3); bVar17 = (byte)uVar3; } local_84 = local_6c; acStack_80[0] = acStack_68[0]; acStack_80[1] = acStack_68[1]; acStack_80[2] = acStack_68[2]; acStack_80[3] = acStack_68[3]; acStack_7c[0] = acStack_64[0]; acStack_7c[1] = acStack_64[1]; acStack_7c[2] = acStack_64[2]; acStack_7c[3] = acStack_64[3]; acStack_78[0] = acStack_60[0]; acStack_78[1] = acStack_60[1]; acStack_78[2] = acStack_60[2]; acStack_78[3] = acStack_60[3]; local_74._4_4_ = uStack_58; local_74._0_4_ = local_5c; pvVar8 = xml_node::first_attribute(pvVar7,(byte *)"backgroundAnm2",(uint)pbVar9,bVar17); if (pvVar8 == (void *)0x0) { pbVar9 = (byte *)"nightmare_bg.anm2"; } else { pbVar9 = &g_xmlNullStr; if (*(byte **)((int)pvVar8 + 4) != (byte *)0x0) { pbVar9 = *(byte **)((int)pvVar8 + 4); } } pbVar12 = pbVar9; do { bVar17 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar17 != 0); psVar13 = (std_string *)(pbVar12 + -(int)(pbVar9 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar13) goto LAB_00920436; ppppbVar10 = (byte ****)local_3c; if (0xf < local_28) { ppppbVar10 = local_3c[0]; } std::string::concat((char *)&local_6c,(int)pbVar14,psVar13,(byte *)ppppbVar10,local_2c,pbVar9, (uint)psVar13); bVar17 = (byte)psVar13; if (0xf < uStack_40) { uVar3 = uStack_40 + 1; pbVar9 = local_54; if (0xfff < uVar3) { pbVar9 = *(byte **)(local_54 + -4); uVar3 = uStack_40 + 0x24; if ((byte *)0x1f < local_54 + (-4 - (int)pbVar9)) goto LAB_0092030e; } operator_delete(pbVar9,uVar3); bVar17 = (byte)uVar3; } local_54 = local_6c; acStack_50[0] = acStack_68[0]; acStack_50[1] = acStack_68[1]; acStack_50[2] = acStack_68[2]; acStack_50[3] = acStack_68[3]; acStack_4c[0] = acStack_64[0]; acStack_4c[1] = acStack_64[1]; acStack_4c[2] = acStack_64[2]; acStack_4c[3] = acStack_64[3]; acStack_48[0] = acStack_60[0]; acStack_48[1] = acStack_60[1]; acStack_48[2] = acStack_60[2]; acStack_48[3] = acStack_60[3]; local_44 = local_5c; uStack_40 = uStack_58; for (pvVar7 = xml_node::first_node(pvVar7,(byte *)"nightmare",(int)pbVar9,bVar17); pvVar7 != (void *)0x0; pvVar7 = *(void **)((int)pvVar7 + 0x2c)) { for (puVar1 = *(undefined4 **)((int)pvVar7 + 0x20); puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)puVar1[6]) { pbVar9 = &g_xmlNullStr; if ((byte *)*puVar1 != (byte *)0x0) { pbVar9 = (byte *)*puVar1; } pbVar14 = &DAT_00b1bff4; do { bVar17 = *pbVar9; bVar16 = bVar17 < *pbVar14; if (bVar17 != *pbVar14) { LAB_009201e1: uVar3 = -(uint)bVar16 | 1; goto LAB_009201e6; } if (bVar17 == 0) break; bVar17 = pbVar9[1]; bVar16 = bVar17 < pbVar14[1]; if (bVar17 != pbVar14[1]) goto LAB_009201e1; pbVar9 = pbVar9 + 2; pbVar14 = pbVar14 + 2; } while (bVar17 != 0); uVar3 = 0; LAB_009201e6: if (uVar3 == 0) { pbVar9 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar9 = (byte *)puVar1[1]; } pbVar14 = pbVar9; do { bVar17 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar17 != 0); psVar13 = (std_string *)(pbVar14 + -(int)(pbVar9 + 1)); if ((std_string *)(0x7fffffff - local_2c) < psVar13) goto LAB_00920436; ppppbVar10 = (byte ****)local_3c; if (0xf < local_28) { ppppbVar10 = local_3c[0]; } std::string::concat((char *)&local_6c,(int)(pbVar9 + 1),psVar13,(byte *)ppppbVar10, local_2c,pbVar9,(uint)psVar13); pbVar9 = local_6c; local_14._0_1_ = 4; psVar13 = *(std_string **)(in_ECX + 0xc); if (psVar13 == *(std_string **)(in_ECX + 0x10)) { vector_string_emplace_reallocate_move ((void *)(in_ECX + 8),psVar13,(std_string *)&local_6c); uVar3 = uStack_58; } else { local_6c = (byte *)((uint)local_6c & 0xffffff00); *(byte **)psVar13->_buf = pbVar9; *(char (*) [4])(psVar13->_buf + 4) = acStack_68; *(char (*) [4])(psVar13->_buf + 8) = acStack_64; *(char (*) [4])(psVar13->_buf + 0xc) = acStack_60; psVar13->_size = local_5c; psVar13->_capacity = uStack_58; *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 0x18; uVar3 = 0xf; } local_14._0_1_ = 3; if (0xf < uVar3) { size = uVar3 + 1; pbVar9 = local_6c; if (0xfff < size) { pbVar9 = *(byte **)(local_6c + -4); size = uVar3 + 0x24; if ((byte *)0x1f < local_6c + (-4 - (int)pbVar9)) goto LAB_0092030e; } operator_delete(pbVar9,size); } } if (puVar1[4] == 0) break; } } local_14._0_1_ = 2; if (0xf < local_28) { uVar3 = local_28 + 1; ppppbVar10 = local_3c[0]; if (0xfff < uVar3) { ppppbVar10 = (byte ****)local_3c[0][-1]; uVar3 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c[0] + (-4 - (int)ppppbVar10))) { LAB_0092030e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar10,uVar3); } local_14 = (byte ***)CONCAT31(local_14._1_3_,5); xml_memory_pool::clear(auStack_100a0); if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = extraout_ECX; if (text != (byte *)0x0) { uVar3 = *(uint *)(text + -4); qVar2 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar3; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar2 < uVar3); free(text + -4); uVar5 = extraout_ECX_00; } local_14 = (byte ***)CONCAT31(local_14._1_3_,1); if (*(char *)(in_ECX + 0x351) == '\0') { ANM2::Load((ANM2 *)(in_ECX + 0x248),(std_string *)&local_84,1); uVar5 = extraout_ECX_01; } if ((*(char *)(in_ECX + 0x129) == '\0') && (ANM2::Load((ANM2 *)(in_ECX + 0x20),(std_string *)&local_54,1), uVar5 = extraout_ECX_02, 7 < *(uint *)(in_ECX + 0xa0))) { pLVar11 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x20),&DAT_00000007); pLVar11->_bitflags = pLVar11->_bitflags | 0x60; uVar5 = extraout_ECX_03; } FUN_00920440(uVar5); if (0xf < uStack_40) { uVar3 = uStack_40 + 1; pbVar9 = local_54; if (0xfff < uVar3) { pbVar9 = *(byte **)(local_54 + -4); uVar3 = uStack_40 + 0x24; if ((byte *)0x1f < local_54 + (-4 - (int)pbVar9)) goto LAB_0092041f; } operator_delete(pbVar9,uVar3); } local_44 = 0; uStack_40 = 0xf; local_54 = (byte *)((uint)local_54 & 0xffffff00); if (0xf < local_74._4_4_) { uVar3 = local_74._4_4_ + 1; pbVar9 = local_84; if (0xfff < uVar3) { pbVar9 = *(byte **)(local_84 + -4); uVar3 = local_74._4_4_ + 0x24; if ((byte *)0x1f < local_84 + (-4 - (int)pbVar9)) { LAB_0092041f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar9,uVar3); } uVar5 = 1; } ExceptionList = local_1c; return uVar5; } //@@ 00920440 FUN_00920440 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00920440(void) { uint *puVar1; int iVar2; undefined4 uVar3; int in_ECX; int iVar4; uint uVar5; uint uVar6; uint local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; local_c = 0; *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)(in_ECX + 0x14); iVar4 = *(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8); iVar2 = iVar4 >> 0x1f; if (iVar4 / 0x18 + iVar2 != iVar2) { do { puVar1 = *(uint **)(in_ECX + 0x18); if (puVar1 == *(uint **)(in_ECX + 0x1c)) { std::vector::_Emplace_reallocate(puVar1,&local_c); } else { *puVar1 = local_c; *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + 4; } local_c = local_c + 1; } while (local_c < (uint)((*(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8)) / 0x18)); } iVar2 = *(int *)(in_ECX + 0x14); uVar6 = *(int *)(in_ECX + 0x18) - iVar2 >> 2; iVar4 = uVar6 - 1; if (0 < iVar4) { do { if (uVar6 == 0) { uVar5 = 0; } else { uVar5 = Random(); uVar5 = uVar5 % uVar6; } uVar3 = *(undefined4 *)(iVar2 + iVar4 * 4); uVar6 = uVar6 - 1; *(undefined4 *)(iVar2 + iVar4 * 4) = *(undefined4 *)(iVar2 + uVar5 * 4); iVar4 = iVar4 + -1; *(undefined4 *)(iVar2 + uVar5 * 4) = uVar3; } while (0 < iVar4); } return; } //@@ 00920510 NightmareScene::Update /* DB: ECX=Manager+0x21628 from Manager::Update: Dream Catcher (566) / MENUCONFIRM skip, "Dogma"/"Interrupt"/"Scene" anims, AnimationState updates */ void NightmareScene::Update(void) { int *piVar1; bool bVar2; byte bVar3; byte bVar4; Entity_Player *pEVar5; uint uVar6; char *anim; byte *anim_00; LayerState *pLVar7; int iVar8; int iVar9; byte extraout_CL; byte extraout_CL_00; int *in_ECX; bool bVar10; float fVar11; if (*in_ECX == 0) { return; } pEVar5 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x236,(RNG **)&g_game->_playerManager,1); if (((pEVar5 == (Entity_Player *)0x0) || (((bVar4 = extraout_CL, 0 < g_game->_stage && (g_game->_stage < 7)) && (bVar4 = 0, (g_game->_gameStateFlags & 0x1000000000000) != 0)))) && (bVar3 = input_is_action_triggered(g_manager,0xe,-1,(Entity *)0x0,0), bVar4 = extraout_CL_00, bVar3 != 0)) { bVar2 = true; } else { bVar2 = false; } uVar6 = Game::GetStageID(g_game,bVar4); if ((uVar6 == 0x1a) && (bVar4 = input_is_action_triggered(g_manager,0xe,-1,(Entity *)0x0,0), bVar4 != 0)) { bVar2 = true; } uVar6 = in_ECX[1]; if ((uVar6 & 1) == 0) { if (*(char *)((int)in_ECX + 0x129) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x14)); AnimationState::Update((AnimationState *)(in_ECX + 0x1c)); } if (*(char *)((int)in_ECX + 0x5dd) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x141)); AnimationState::Update((AnimationState *)(in_ECX + 0x149)); } if ((in_ECX[0x15] == 0) || ((char)in_ECX[0x19] == '\0')) { anim = "Dogma"; if ((char)in_ECX[0x17a] == '\0') { anim = &DAT_00b1b410; } ANM2::Play((ANM2 *)(in_ECX + 8),(byte *)anim,0); } if (*(char *)((int)in_ECX + 0x23d) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x59)); AnimationState::Update((AnimationState *)(in_ECX + 0x61)); if ((in_ECX[1] == in_ECX[0xe9] * 2) && (bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x4d),(byte *)"Scene",1), bVar4 != 0)) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x59)); *(undefined1 *)(in_ECX + 0x5e) = 1; } if (((((char)in_ECX[0x12f] != '\0') && (in_ECX[0x134] != 0)) && ((uint)(in_ECX[0xe9] * 2) < (uint)in_ECX[1])) && ((in_ECX[0x5a] == 0 || ((char)in_ECX[0x5e] == '\0')))) { if (in_ECX[0x62] == 0) { LAB_00920712: anim_00 = *(byte **)(in_ECX[0x131] + (in_ECX[0x132] - 1U & in_ECX[0x133]) * 4); if (0xf < *(uint *)(anim_00 + 0x14)) { anim_00 = *(byte **)anim_00; } bVar4 = ANM2::SetOverlayAnimation((ANM2 *)(in_ECX + 0x4d),anim_00,1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x61)); *(undefined1 *)(in_ECX + 0x66) = 1; } if (9 < (uint)in_ECX[0x6d]) { pLVar7 = ANM2::GetLayer((ANM2 *)(in_ECX + 0x4d),&DAT_00000009); pLVar7->_bitflags = pLVar7->_bitflags | 0x60; } } else if ((char)in_ECX[0x66] == '\0') { std::string::_Tidy_deallocate (*(char **)(in_ECX[0x131] + (in_ECX[0x132] - 1U & in_ECX[0x133]) * 4)); piVar1 = in_ECX + 0x134; *piVar1 = *piVar1 + -1; if (*piVar1 != 0) { in_ECX[0x133] = in_ECX[0x133] + 1; goto LAB_00920712; } in_ECX[0x133] = 0; } } if ((((char)in_ECX[0x17a] != '\0') && (in_ECX[0x5a] != 0)) && (bVar4 = AnimationState::IsEventTriggered ((AnimationState *)(in_ECX + 0x59),(byte *)"Interrupt"), bVar4 != 0)) { ANM2::Reset((ANM2 *)(in_ECX + 0x4d)); TextureCache::Purge(); *in_ECX = 0; return; } } uVar6 = in_ECX[1]; if (uVar6 < 0x1e) { in_ECX[0xd7] = (int)(1.0 - ((float)(uVar6 >> 1) + 0.0) / 15.0); } else if (*(char *)((int)in_ECX + 0x23d) == '\0') { in_ECX[0xd7] = 0; } else { if ((char)in_ECX[0x12f] == '\0') { if (in_ECX[0x5a] == 0) { iVar8 = 0; } else { iVar8 = *(int *)(in_ECX[0x5a] + 0x30); } iVar9 = ANM2::GetFrame((ANM2 *)(in_ECX + 0x4d)); iVar8 = iVar8 - iVar9; } else { if ((1 < (uint)in_ECX[0x134]) || ((char)in_ECX[0x66] == '\0')) { in_ECX[0xd7] = 0; goto LAB_009208b9; } if (in_ECX[0x62] == 0) { uVar6 = in_ECX[1]; iVar8 = 1; } else { uVar6 = in_ECX[1]; iVar8 = *(int *)(in_ECX[0x62] + 0x30) - (int)(float)in_ECX[0x65]; } } fVar11 = (float)iVar8 / 15.0; if (fVar11 <= 0.0) { fVar11 = 0.0; } if (1.0 <= fVar11) { fVar11 = 1.0; } in_ECX[0xd7] = (int)(1.0 - fVar11); } } LAB_009208b9: if (in_ECX[0xe9] * 2 + 2U < uVar6) { if ((char)in_ECX[0x12f] == '\0') { if (in_ECX[0x5a] != 0) { bVar10 = (char)in_ECX[0x5e] == '\0'; goto LAB_009208ec; } } else { bVar10 = in_ECX[0x134] == 0; LAB_009208ec: if (!bVar10) goto LAB_009208ee; } } else { LAB_009208ee: if (!bVar2) goto LAB_00920918; } ANM2::Reset((ANM2 *)(in_ECX + 0xea)); ANM2::Reset((ANM2 *)(in_ECX + 0x4d)); TextureCache::Purge(); uVar6 = in_ECX[1]; *in_ECX = 0; LAB_00920918: in_ECX[1] = uVar6 + 1; return; } //@@ 00920940 NightmareScene::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: zhl declares NightmareScene::Render; called from manager render switch for state 5 (STATE_NIGHTMARE); anims Levels/Connector/ClearFloor/BossIndicator/IsaacIndicator/Clock sit next to NightmareScene::Show strings prototype: REPENTOGON */ void __thiscall NightmareScene::Render(NightmareScene *this) { float fVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; byte bVar5; LayerState *pLVar6; int iVar7; float *pfVar8; int iVar9; ChallengeParam *pCVar10; float fVar11; byte *pbVar12; uint uVar13; Game *pGVar14; byte *pbVar15; void *pvVar16; undefined4 *puVar17; char *pcVar18; AnimationState *pAVar19; int unused; int iVar20; bool bVar21; float fVar22; ANM2 *animation; undefined1 local_100 [44]; float local_d4; float local_c0; float local_ac; float local_98; undefined1 *local_8c; Vector local_88; float local_80; float local_7c; uint local_78; float local_74; float local_70; float local_6c; char local_65; Game *local_64; void *local_60; int *local_5c; float local_58; Vector local_54; int aiStack_4c [5]; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; KColor local_28; uint local_14; local_14 = __security_cookie ^ (uint)(aiStack_4c + 0xf); if ((g_game->_difficulty == 2) || (local_65 = '\0', g_game->_difficulty == 3)) { local_65 = '\x01'; } RenderTarget::Clear(&DAT_00c798e0); if (*(int *)this == 0) { return; } local_74 = *(float *)&this->field_0x54; if ((local_74 != 0.0) && (local_78 = 0, *(int *)((int)local_74 + 0x1c) != 0)) { local_58 = 0.0; do { pbVar12 = *(byte **)((int)local_58 + *(int *)((int)local_74 + 0x18)); local_60 = AnimationState::GetLayerFrame((AnimationState *)&this->field_0x50,(int)pbVar12); pLVar6 = ANM2::GetLayer((ANM2 *)&this->field_0x20,pbVar12); if (((pLVar6->_visible != 0) && (local_60 != (void *)0x0)) && (*(char *)((int)local_60 + 0x2c) != '\0')) { local_64 = (Game *)(*(int *)((int)local_74 + 0x18) + (int)local_58); if (((((int)pbVar12 < 0) || (*(int *)(*(int *)&this->field_0x50 + 0x80) <= (int)pbVar12)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), (int)pbVar12 < 0)) || (*(int *)(*(int *)&this->field_0x50 + 0x80) <= (int)pbVar12)) { iVar7 = 0; } else { iVar7 = *(int *)(*(int *)&this->field_0x58 + *(int *)(*(int *)&this->field_0x54 + 0x38 + (int)pbVar12 * 4) * 4); } AnimationLayer::RenderFrame ((AnimationLayer *)local_64,&g_vectorZero,iVar7,&g_vectorZero,&g_vectorZero, (ANM2 *)&this->field_0x20); pvVar16 = local_60; if ((this[1].field_0x239 != '\0') && ((pbVar12 == (byte *)0x2 || (pbVar12 == &DAT_00000006)))) { local_5c = (int *)(-*(float *)((int)local_60 + 0x24) * *(float *)((int)local_60 + 0x1c)); local_70 = *(float *)((int)local_60 + 0x5c); local_64 = (Game *)(local_70 * 0.017453292); local_60 = (void *)(-*(float *)((int)local_60 + 0x20) * *(float *)((int)local_60 + 0x18)); local_7c = cos((float)local_64); fVar22 = sin((float)local_64); if ((undefined4 *)&this[1].field_0x1d8 == (undefined4 *)((int)pvVar16 + 0x30)) { fVar11 = local_70; } else { uVar2 = *(undefined4 *)((int)pvVar16 + 0x34); uVar3 = *(undefined4 *)((int)pvVar16 + 0x38); uVar4 = *(undefined4 *)((int)pvVar16 + 0x3c); *(undefined4 *)&this[1].field_0x1d8 = *(undefined4 *)((int)pvVar16 + 0x30); *(undefined4 *)&this[1].field_0x1dc = uVar2; *(undefined4 *)&this[1].field_0x1e0 = uVar3; *(undefined4 *)&this[1].field_0x1e4 = uVar4; uVar2 = *(undefined4 *)((int)pvVar16 + 0x44); uVar3 = *(undefined4 *)((int)pvVar16 + 0x48); uVar4 = *(undefined4 *)((int)pvVar16 + 0x4c); *(undefined4 *)&this[1].field_0x1e8 = *(undefined4 *)((int)pvVar16 + 0x40); *(undefined4 *)&this[1].field_0x1ec = uVar2; *(undefined4 *)&this[1].field_0x1f0 = uVar3; *(undefined4 *)&this[1].field_0x1f4 = uVar4; *(undefined8 *)&this[1].field_0x1f8 = *(undefined8 *)((int)pvVar16 + 0x50); *(undefined4 *)&this[1].field_0x200 = *(undefined4 *)((int)pvVar16 + 0x58); fVar11 = *(float *)((int)pvVar16 + 0x5c); } *(float *)&this[1].field_0x1d4 = fVar11; *(undefined4 *)&this[1].field_0x1cc = *(undefined4 *)((int)pvVar16 + 0x18); *(undefined4 *)&this[1].field_0x1d0 = *(undefined4 *)((int)pvVar16 + 0x1c); fVar11 = *(float *)&this->field_0xb8; fVar1 = *(float *)((int)pvVar16 + 0x14); *(float *)&this[1].field_0x1c4 = ((float)local_60 * local_7c - (float)local_5c * fVar22) + *(float *)&this->field_0xb4 + *(float *)((int)pvVar16 + 0x10); *(float *)&this[1].field_0x1c8 = (float)local_5c * local_7c + (float)local_60 * fVar22 + fVar11 + fVar1; if (this[1].field_0x239 != '\0') { if (this[1].field_0x1a0 == '\0') { AnimationState::Render ((AnimationState *)&this[1].field_0x160,&g_vectorZero,&g_vectorZero, &g_vectorZero); pAVar19 = (AnimationState *)&this[1].field_0x180; } else { AnimationState::Render ((AnimationState *)&this[1].field_0x180,&g_vectorZero,&g_vectorZero, &g_vectorZero); pAVar19 = (AnimationState *)&this[1].field_0x160; } AnimationState::Render(pAVar19,&g_vectorZero,&g_vectorZero,&g_vectorZero); } } } local_78 = local_78 + 1; local_58 = (float)((int)local_58 + 0x10); } while (local_78 < *(uint *)((int)local_74 + 0x1c)); } if (this[1].field_0x118 == '\0') { if (this->field_0x23d != '\0') { if (this->field_0x1a4 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x164,&g_vectorZero,&g_vectorZero,&g_vectorZero); goto LAB_00921007; } AnimationState::Render ((AnimationState *)&this->field_0x184,&g_vectorZero,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x164; goto LAB_0092100d; } } else { AnimationState::Render ((AnimationState *)&this->field_0x164,&g_vectorZero,&g_vectorZero,&g_vectorZero); if (((this[1].field_0x10d != '\0') && (*(int *)&this[1].field_0x12c != 0)) && (*(int *)&this->field_0x188 != 0)) { local_58 = 5.60519e-45; local_64 = *(Game **)(*(int *)&this[1].field_0x120 + (*(int *)&this[1].field_0x124 - 1U & *(uint *)&this[1].field_0x128) * 4); *(undefined4 *)&this[1].field_0x98 = *(undefined4 *)&this->field_0x1c8; *(undefined4 *)&this[1].field_0x9c = *(undefined4 *)&this->field_0x1cc; local_5c = &DAT_00c5d254; do { pfVar8 = AnimationState::GetNullFrame ((AnimationState *)&this->field_0x184,(byte *)local_5c[-1]); if (((pfVar8 != (float *)0x0) && (*(char *)(pfVar8 + 3) != '\0')) && (iVar7 = local_64->_roomMap[local_5c[3] + -0x5eb1], iVar7 != 0)) { pbVar12 = (byte *)*local_5c; if (pbVar12 == &DAT_00000006) { uVar13 = *(uint *)(iVar7 + 4); if ((int)uVar13 < 0x2dd) { local_60 = (void *)(uVar13 - 1); goto LAB_00920dfe; } local_28._unk = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { local_28._green = 8.40779e-45; } else { local_28._green = 1.4013e-45; } local_28._red = 0.0; local_28._blue = 9.80909e-45; local_28._alpha = 1.4013e-45; local_54.x = *(float *)&this[1].field_0x98 + *pfVar8; local_54.y = *(float *)&this[1].field_0x9c + pfVar8[1]; ModManager::RenderCustomCollectionItem (&g_manager->_modManager,uVar13,&local_54,(Vector *)(pfVar8 + 4), (ColorMod *)(pfVar8 + 6),&local_28); } else if (((pbVar12 == (byte *)0x3) && (local_60 = *(void **)(iVar7 + 0x160), local_60 != (void *)0x0)) && (*(char *)(iVar7 + 0x164) != '\0')) { local_88.x = *(float *)&this[1].field_0x98 + *pfVar8; local_88.y = *(float *)&this[1].field_0x9c + pfVar8[1]; if (*(char *)((int)local_60 + 0xef9) != '\0') { ANM2::SetFrame((ANM2 *)((int)local_60 + 0xdf0),(std_string *)((int)local_60 + 0xe08), *(int *)(iVar7 + 100)); Sprite::SetColor((Sprite *)((int)local_60 + 0xdf0),(ColorMod *)(pfVar8 + 6)); *(float *)((int)local_60 + 0xe8c) = pfVar8[4]; *(float *)((int)local_60 + 0xe90) = pfVar8[5]; ANM2::Render((ANM2 *)((int)local_60 + 0xdf0),&local_88,&g_vectorZero,&g_vectorZero); } } else { local_60 = *(void **)(iVar7 + 100); LAB_00920dfe: pLVar6 = ANM2::GetLayer((ANM2 *)&this[1].field_0x4,pbVar12); fVar22 = (float)local_5c[2]; fVar11 = pfVar8[1]; (pLVar6->_pos).x = (float)local_5c[1] + *pfVar8; (pLVar6->_pos).y = fVar22 + fVar11; pLVar6->_rotation = pfVar8[0x11]; (pLVar6->_size).x = pfVar8[4]; (pLVar6->_size).y = pfVar8[5]; if (&pLVar6->_color != (ColorMod *)(pfVar8 + 6)) { fVar22 = pfVar8[7]; fVar11 = pfVar8[8]; fVar1 = pfVar8[9]; (pLVar6->_color)._tint[0] = pfVar8[6]; (pLVar6->_color)._tint[1] = fVar22; (pLVar6->_color)._tint[2] = fVar11; (pLVar6->_color)._tint[3] = fVar1; fVar22 = pfVar8[0xb]; fVar11 = pfVar8[0xc]; fVar1 = pfVar8[0xd]; (pLVar6->_color)._colorize[0] = pfVar8[10]; (pLVar6->_color)._colorize[1] = fVar22; (pLVar6->_color)._colorize[2] = fVar11; (pLVar6->_color)._colorize[3] = fVar1; fVar22 = pfVar8[0xf]; (pLVar6->_color)._offset[0] = pfVar8[0xe]; (pLVar6->_color)._offset[1] = fVar22; (pLVar6->_color)._offset[2] = pfVar8[0x10]; } ANM2::SetLayerFrame((ANM2 *)&this[1].field_0x4,*local_5c,(int)local_60); iVar7 = *local_5c; if (this[1].field_0x10d != '\0') { if (this[1].field_0x74 == '\0') { iVar20 = *(int *)&this[1].field_0x38; if ((((iVar20 != 0) && (-1 < iVar7)) && (iVar7 < (*(ANM2 **)&this[1].field_0x34)->_layerCount)) && (iVar9 = *(int *)(iVar20 + 0x38 + iVar7 * 4), -1 < iVar9)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar9 * 0x10 + *(int *)(iVar20 + 0x18)), &g_vectorZero,*(int *)(*(int *)&this[1].field_0x3c + iVar9 * 4), &g_vectorZero,&g_vectorZero,*(ANM2 **)&this[1].field_0x34); } iVar20 = *(int *)&this[1].field_0x58; if (((iVar20 != 0) && (-1 < iVar7)) && ((animation = *(ANM2 **)&this[1].field_0x54, iVar7 < animation->_layerCount && (iVar7 = *(int *)(iVar20 + 0x38 + iVar7 * 4), -1 < iVar7)))) { iVar9 = *(int *)&this[1].field_0x5c; goto LAB_00920f90; } } else { iVar20 = *(int *)&this[1].field_0x58; if (((iVar20 != 0) && (-1 < iVar7)) && ((iVar7 < (*(ANM2 **)&this[1].field_0x54)->_layerCount && (iVar9 = *(int *)(iVar20 + 0x38 + iVar7 * 4), -1 < iVar9)))) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar9 * 0x10 + *(int *)(iVar20 + 0x18)), &g_vectorZero,*(int *)(*(int *)&this[1].field_0x5c + iVar9 * 4), &g_vectorZero,&g_vectorZero,*(ANM2 **)&this[1].field_0x54); } iVar20 = *(int *)&this[1].field_0x38; if ((((iVar20 != 0) && (-1 < iVar7)) && (animation = *(ANM2 **)&this[1].field_0x34, iVar7 < animation->_layerCount)) && (iVar7 = *(int *)(iVar20 + 0x38 + iVar7 * 4), -1 < iVar7)) { iVar9 = *(int *)&this[1].field_0x3c; LAB_00920f90: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar7 * 0x10 + *(int *)(iVar20 + 0x18)), &g_vectorZero,*(int *)(iVar9 + iVar7 * 4),&g_vectorZero,&g_vectorZero, animation); } } } } } local_5c = local_5c + 5; local_58 = (float)((int)local_58 + -1); } while (local_58 != 0.0); local_58 = 0.0; } LAB_00921007: pAVar19 = (AnimationState *)&this->field_0x184; LAB_0092100d: AnimationState::Render(pAVar19,&g_vectorZero,&g_vectorZero,&g_vectorZero); } if (this[1].field_0x244 != '\0') goto LAB_00921b36; local_88.y = (float)((*(uint *)&this->field_0x4 >> 1) - 0x1e); if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { fVar22 = (float)(g_game->_stage + 1); } else { fVar22 = (float)g_game->_stage; } local_58 = 8.40779e-45; local_70 = fVar22; if (local_65 == '\0') { if (((g_manager->_persistentGameData)._achievements[4] != 0) || ((((g_manager->_state == 2 && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))) || (7 < *(int *)&this->field_0x364)) || ((*(int *)&this->field_0x364 == 6 && (this->field_0x368 == '\0')))))) { local_58 = 1.12104e-44; } pCVar10 = Game::GetChallengeParams(g_game); if (pCVar10->_isPathTypeSet != 0) { if (pCVar10->_endStage == 6) { local_58 = 8.40779e-45; } else if (7 < pCVar10->_endStage) { local_58 = 1.12104e-44; } } if (fVar22 != 1.26117e-44) goto LAB_00921072; local_58 = fVar22; LAB_0092110a: local_5c = (int *)fVar22; if ((int)fVar22 < (int)local_58) { local_5c = (int *)local_58; } local_80 = -NAN; local_6c = 0.0; local_7c = -NAN; local_74 = -NAN; local_78 = 0; fVar22 = local_80; if (-1 < (int)local_5c) goto LAB_00921130; } else { local_58 = 9.80909e-45; LAB_00921072: if (fVar22 != 1.82169e-44) goto LAB_0092110a; local_58 = 0.0; local_70 = 0.0; local_5c = (int *)0x0; LAB_00921130: local_64 = g_game; fVar11 = 0.0; local_80 = -NAN; local_6c = 0.0; local_7c = -NAN; local_74 = -NAN; local_78 = 0; do { if (fVar11 == 0.0) { if (local_70 == 0.0) { iVar7 = this->_stageBarIcons[0xd]; goto LAB_0092117e; } } else if ((fVar11 != 1.26117e-44) || (this->_stageBarIcons[9] != 0x11)) { iVar7 = this->_stageBarIcons[(int)fVar11]; LAB_0092117e: aiStack_4c[(int)local_6c] = iVar7; if ((fVar11 == local_58) && (*(float *)&this->field_0x364 != local_58)) { local_7c = local_6c; } if (((int *)fVar11 == local_5c) && (*(float *)&this->field_0x364 != local_80)) { local_80 = local_6c; } if (fVar11 == local_70) { local_74 = local_6c; if (this->field_0x368 == '\0') { if ((g_game->_challenge == 0x1f) || (local_78 = 1, local_70 == 0.0)) { local_78 = 0xffffffff; } } else { local_78 = 0; } } local_6c = (float)((int)local_6c + 1); } fVar11 = (float)((int)fVar11 + 1); fVar22 = local_80; } while ((int)fVar11 <= (int)local_5c); } for (; (fVar11 = local_6c, -1 < (int)fVar22 && (aiStack_4c[(int)fVar22] == 0x11)); fVar22 = (float)((int)fVar22 + -1)) { aiStack_4c[(int)fVar22] = -1; } local_8c = &this->field_0x248; pbVar12 = *(byte **)&this->field_0x27c; local_5c = (int *)((g_screenWidth * 0.5 - (float)((int)local_6c * 0x1b + -4) * 0.5) + 11.5); local_58 = (float)local_5c + 13.5; if (pbVar12 == (byte *)0x0) { LAB_009212c6: bVar5 = ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)"Connector",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&this->field_0x278); this->field_0x28c = 1; fVar11 = local_6c; } } else { if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar12 = *(byte **)pbVar12; } pcVar18 = "Connector"; do { bVar5 = *pbVar12; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_009212a0: uVar13 = -(uint)bVar21 | 1; goto LAB_009212a5; } if (bVar5 == 0) break; bVar5 = pbVar12[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_009212a0; pbVar12 = pbVar12 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_009212a5: if ((uVar13 != 0) || ((*(char *)(*(int *)&this->field_0x27c + 0x34) != '\0' && (this->field_0x28c == '\0')))) goto LAB_009212c6; } local_60 = (void *)((int)fVar11 + -1); pGVar14 = (Game *)0x0; fVar22 = local_58; if (0 < (int)local_60) { do { local_64 = (Game *)((int)&pGVar14->_stage + 1); local_54.y = 24.0; local_54.x = (float)(int)pGVar14 * 27.0 + fVar22; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x278,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x278; } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); fVar22 = local_58; } local_60 = (void *)((int)local_60 + -1); pGVar14 = local_64; } while (local_60 != (void *)0x0); } pbVar12 = *(byte **)(local_8c + 0x34); if (pbVar12 == (byte *)0x0) { LAB_009213f6: bVar5 = ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)"Levels",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&this->field_0x278); this->field_0x28c = 1; fVar11 = local_6c; } } else { if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar12 = *(byte **)pbVar12; } pcVar18 = "Levels"; do { bVar5 = *pbVar12; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_009213d0: uVar13 = -(uint)bVar21 | 1; goto LAB_009213d5; } if (bVar5 == 0) break; bVar5 = pbVar12[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_009213d0; pbVar12 = pbVar12 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_009213d5: if ((uVar13 != 0) || ((*(char *)(*(int *)&this->field_0x27c + 0x34) != '\0' && (this->field_0x28c == '\0')))) goto LAB_009213f6; } local_58 = 0.0; if (0 < (int)fVar11) { do { if (-1 < aiStack_4c[(int)local_58]) { if (*(int *)&this->field_0x27c != 0) { AnimationState::SetFrameFloat ((AnimationState *)&this->field_0x278,(float)aiStack_4c[(int)local_58]); } local_54.y = 24.0; local_54.x = (float)(int)local_58 * 27.0 + (float)local_5c; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x278,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x278; } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); } } local_58 = (float)((int)local_58 + 1); } while ((int)local_58 < (int)fVar11); } pbVar12 = *(byte **)&this->field_0x27c; if (pbVar12 == (byte *)0x0) { LAB_00921544: bVar5 = ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)"ClearFloor",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&this->field_0x278); this->field_0x28c = 1; } } else { pbVar15 = pbVar12; if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar15 = *(byte **)pbVar12; } pcVar18 = "ClearFloor"; do { bVar5 = *pbVar15; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_00921520: uVar13 = -(uint)bVar21 | 1; goto LAB_00921525; } if (bVar5 == 0) break; bVar5 = pbVar15[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_00921520; pbVar15 = pbVar15 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_00921525: if ((uVar13 != 0) || ((pbVar12[0x34] != 0 && (this->field_0x28c == '\0')))) goto LAB_00921544; } fVar11 = 0.0; fVar22 = local_6c; if (0 < (int)local_6c) { do { if ((-1 < aiStack_4c[(int)fVar11]) && (fVar11 != local_74)) { local_54.y = 24.0; local_54.x = (float)(int)fVar11 * 27.0 + (float)local_5c; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x278,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x278; } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); fVar22 = local_6c; } } fVar11 = (float)((int)fVar11 + 1); } while ((int)fVar11 < (int)fVar22); } pbVar12 = *(byte **)&this->field_0x27c; if (pbVar12 == (byte *)0x0) { LAB_0092166b: bVar5 = ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)"NotClearFloor",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&this->field_0x278); this->field_0x28c = 1; } } else { pbVar15 = pbVar12; if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar15 = *(byte **)pbVar12; } pcVar18 = "NotClearFloor"; do { bVar5 = *pbVar15; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_00921647: uVar13 = -(uint)bVar21 | 1; goto LAB_0092164c; } if (bVar5 == 0) break; bVar5 = pbVar15[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_00921647; pbVar15 = pbVar15 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_0092164c: if ((uVar13 != 0) || ((pbVar12[0x34] != 0 && (this->field_0x28c == '\0')))) goto LAB_0092166b; } fVar22 = local_6c; local_60 = (void *)0x0; if (0 < (int)local_6c) { do { if (aiStack_4c[(int)local_60] < 0) { local_54.y = 24.0; local_54.x = (float)(int)local_60 * 27.0 + (float)local_5c; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x278,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x278; } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); } } local_60 = (void *)((int)local_60 + 1); } while ((int)local_60 < (int)fVar22); } if ((-1 < (int)local_7c) && ((int)local_80 <= (int)local_7c)) { if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { pbVar12 = *(byte **)&this->field_0x27c; if (pbVar12 == (byte *)0x0) { LAB_00921834: pcVar18 = "GreedIndicator"; goto LAB_0092183b; } pbVar15 = pbVar12; if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar15 = *(byte **)pbVar12; } pcVar18 = "GreedIndicator"; do { bVar5 = *pbVar15; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_00921810: uVar13 = -(uint)bVar21 | 1; goto LAB_00921815; } if (bVar5 == 0) break; bVar5 = pbVar15[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_00921810; pbVar15 = pbVar15 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_00921815: if ((uVar13 != 0) || ((pbVar12[0x34] != 0 && (this->field_0x28c == '\0')))) goto LAB_00921834; } else { pbVar12 = *(byte **)&this->field_0x27c; if (pbVar12 != (byte *)0x0) { pbVar15 = pbVar12; if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar15 = *(byte **)pbVar12; } pcVar18 = "BossIndicator"; do { bVar5 = *pbVar15; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_00921797: uVar13 = -(uint)bVar21 | 1; goto LAB_0092179c; } if (bVar5 == 0) break; bVar5 = pbVar15[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_00921797; pbVar15 = pbVar15 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_0092179c: if (uVar13 == 0) { if ((pbVar12[0x34] == 0) || (this->field_0x28c != '\0')) goto LAB_00921852; pcVar18 = "BossIndicator"; goto LAB_0092183b; } } pcVar18 = "BossIndicator"; LAB_0092183b: bVar5 = ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)pcVar18,1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&this->field_0x278); this->field_0x28c = 1; } } LAB_00921852: local_54.y = 24.0; local_54.x = (float)(int)local_7c * 27.0 + (float)local_5c; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x278,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x278; } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); } } if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && (g_game->_challenge != 0x1f)) && (*(int *)&this->field_0x364 < 6)) { if ((g_game->_timeCounter <= g_game->_bossRushParTime) && (local_70 != 0.0)) { pbVar12 = *(byte **)&this->field_0x27c; local_64 = (Game *)((float)g_game->_timeCounter / (float)g_game->_bossRushParTime); if (pbVar12 == (byte *)0x0) { LAB_00921997: bVar5 = ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)"Clock",1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)&this->field_0x278); this->field_0x28c = 1; } } else { pbVar15 = pbVar12; if (0xf < *(uint *)(pbVar12 + 0x14)) { pbVar15 = *(byte **)pbVar12; } pcVar18 = "Clock"; do { bVar5 = *pbVar15; bVar21 = bVar5 < (byte)*pcVar18; if (bVar5 != *pcVar18) { LAB_00921973: uVar13 = -(uint)bVar21 | 1; goto LAB_00921978; } if (bVar5 == 0) break; bVar5 = pbVar15[1]; bVar21 = bVar5 < (byte)pcVar18[1]; if (bVar5 != pcVar18[1]) goto LAB_00921973; pbVar15 = pbVar15 + 2; pcVar18 = pcVar18 + 2; } while (bVar5 != 0); uVar13 = 0; LAB_00921978: if ((uVar13 != 0) || ((pbVar12[0x34] != 0 && (this->field_0x28c == '\0')))) goto LAB_00921997; } local_54.y = 24.0; local_54.x = (float)local_64 * 135.0 + (float)local_5c; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render ((AnimationState *)&this->field_0x278,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x278; } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); } } } if (-2 < (int)local_74) { ANM2::SetAnimation((ANM2 *)&this->field_0x248,(byte *)"IsaacIndicator",1); pAVar19 = (AnimationState *)&this->field_0x278; if (*(int *)&this->field_0x27c != 0) { AnimationState::SetFrameFloat (pAVar19,(float)(int)((*(uint *)&this->field_0x4 >> 1) % *(uint *)(*(int *)&this->field_0x27c + 0x30))); } fVar22 = 5.60519e-44; if ((int)local_88.y < 0x28) { fVar22 = local_88.y; } local_54.y = 24.0; fVar11 = 1.4013e-44; if (10 < (int)fVar22) { fVar11 = fVar22; } local_54.x = ((float)(int)local_74 * 27.0 + (float)local_5c) - (1.0 - (float)((int)fVar11 + -10) / 30.0) * (float)(int)local_78 * 27.0; if (this->field_0x351 != '\0') { if (this->field_0x2b8 == '\0') { AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); pAVar19 = (AnimationState *)&this->field_0x298; } else { AnimationState::Render ((AnimationState *)&this->field_0x298,&local_54,&g_vectorZero,&g_vectorZero); } AnimationState::Render(pAVar19,&local_54,&g_vectorZero,&g_vectorZero); } } LAB_00921b36: fVar22 = 0.0; if (0.0 < *(float *)&this->field_0x35c) { g_graphicsManager_blendMode[1] = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_28._alpha = *(float *)&this->field_0x35c; local_28._unk = 0; local_28._red = 0.0; local_28._green = 0.0; local_28._blue = 0.0; render_quad_set_uniform_color(local_100,0.0,0.0,g_screenWidth,g_screenHeight,&local_28); if ((local_d4 + local_c0 + local_ac + local_98) * 0.25 != fVar22) { shader_push((byte *)"KAGE_ColorShader"); local_28._red = 0.0; local_38 = 0; local_2c = 0; local_34 = 0; local_28._blue = 1.0; local_30 = 0x3f800000; local_28._alpha = 1.0; local_28._green = 1.0; local_28._unk = local_28._unk & 0xffffff00; pvVar16 = kage_graphics_flush((void *)0x0); render_quad_draw(pvVar16,&local_38,local_100,1,unused); if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } uVar13 = g_shaderStackSize; puVar17 = (undefined4 *)FUN_00684fc0(); g_shaderStackSize = uVar13 - 1; g_currentShader = (void *)*puVar17; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } } } return; } //@@ 00921ce0 NightmareScene::Show /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void NightmareScene::Show(bool unk); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall NightmareScene::Show(NightmareScene *this,byte unk) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; RoomConfig_Room *pRVar5; int iVar6; void **ppvVar7; code *pcVar8; bool bVar9; Manager *pMVar10; EntityConfig_Entity *pEVar11; NightmareScene *pNVar12; char cVar13; byte bVar14; int iVar15; std_string *psVar16; int *piVar17; Entity_Player *pEVar18; RoomConfig_Room *pRVar19; short *psVar20; undefined8 *puVar21; uint uVar22; ItemConfig_Item *pIVar23; EntityConfig_Entity *pEVar24; NetplayManager NVar25; uint *puVar26; byte *anim; LayerState *pLVar27; byte extraout_CL; byte extraout_CL_00; byte unk_00; int iVar28; char *****pppppcVar29; undefined1 *puVar30; uint uVar31; Game *pGVar32; uint uVar33; PlayerManager *pPVar34; void *pvVar35; float fVar36; char *pcVar37; ColorMod local_334; undefined1 local_308 [8]; void *local_300; uint local_2fc; undefined8 uStack_2f8; undefined4 uStack_2f0; uint local_2ec; undefined8 uStack_2e8; undefined4 uStack_2e0; undefined8 local_2d8; undefined4 local_2d0; undefined8 local_2c8; undefined4 local_2c0; undefined8 local_2b8; undefined4 local_2b0; uint local_2ac; undefined8 uStack_2a8; void *pvStack_2a0; undefined4 local_29c; uint local_298; undefined8 uStack_294; undefined4 uStack_28c; int *local_288; undefined4 uStack_284; undefined4 uStack_280; undefined4 uStack_27c; undefined4 local_278; void **local_274; void *local_270; RoomDescriptor *local_26c; int local_268; uint local_264; void *local_260; RoomConfig_Room *local_25c; void **local_258; EntityConfig_Entity *local_254; NightmareScene *local_250; EntityConfig_Entity *local_24c; char *****local_248; undefined8 local_244; undefined4 local_23c; ANM2 local_238; char local_120 [24]; EntityConfig_Entity *local_108; EntityConfig_Entity *local_104; char local_100 [24]; EntityConfig_Entity *local_e8; undefined4 local_e4; std_string *local_e0 [4]; uint local_d0; uint local_cc; void *local_c8 [4]; undefined4 local_b8; uint local_b4; undefined8 local_b0; undefined4 local_a8; std_string local_a4; std_string local_8c; char *local_74; int local_64; uint local_60; std_string local_5c; char *****local_44 [4]; undefined4 local_34; uint local_30; uint local_2c [3]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint local_14; pGVar32 = g_game; puStack_20 = (undefined1 *)(local_2c + 10); local_14 = 0xffffffff; puStack_18 = &LAB_00b0a72a; local_1c = ExceptionList; local_2c[2] = __security_cookie ^ (uint)(local_2c + 7); ExceptionList = &local_1c; piVar17 = (g_game->_playerManager)._playerList._begin; local_250 = this; puVar26 = local_2c + 10; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar17 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar17 = (pGVar32->_playerManager)._playerList._begin; puVar26 = (uint *)puStack_20; } puStack_20 = (undefined1 *)puVar26; local_270 = (void *)*piVar17; std::string::string(local_a4._buf, (void *)(*(int *)&this->field_0x8 + *(int *)(*(int *)&this->field_0x14 + *(int *)&this->field_0x360 * 4) * 0x18)); pGVar32 = g_game; local_14 = 0; local_29c = 0x4f; std::set::find_node(local_308,&local_29c); if ((*(char *)((int)local_300 + 0xd) != '\0') || (0x4f < *(int *)((int)local_300 + 0x10))) { local_300 = (pGVar32->_seedEffects)._seedEffects; } if (local_300 != (pGVar32->_seedEffects)._seedEffects) { psVar16 = &local_a4; if (0xf < local_a4._capacity) { psVar16 = (std_string *)local_a4._buf._0_4_; } iVar15 = strncmp(psVar16->_buf,"gfx/ui/stage/nightmare",0x16); if (iVar15 == 0) { psVar16 = &local_a4; if (0xf < local_a4._capacity) { psVar16 = (std_string *)local_a4._buf._0_4_; } local_60 = 0xf; local_74 = (char *)0x0; local_64 = iVar15; local_74 = std::_Allocate(0x30); local_64 = 0x23; local_60 = 0x2f; builtin_strncpy(local_74,"gfx/promo/gfuel/ui/stage/nightmareg",0x24); local_14._0_1_ = 1; FUN_0060c790((undefined1 *)((int)&psVar16->_capacity + 2)); local_14._0_1_ = 3; if (0xf < local_60) { uVar31 = local_60 + 1; pcVar37 = local_74; if (0xfff < uVar31) { pcVar37 = *(char **)(local_74 + -4); uVar31 = local_60 + 0x24; if ((char *)0x1f < local_74 + (-4 - (int)pcVar37)) { LAB_00921eab: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar37,uVar31); } local_64 = 0; local_60 = 0xf; local_74 = (char *)((uint)local_74 & 0xffffff00); ANM2::constructor(&local_238); local_14 = CONCAT31(local_14._1_3_,4); ANM2::Load(&local_238,(std_string *)local_e0,1); if (local_238._loaded != 0) { psVar16 = (std_string *)local_e0; if (0xf < local_cc) { psVar16 = local_e0[0]; } std::string::assign(local_a4._buf,(byte *)psVar16,local_d0); } local_14._0_1_ = 5; ANM2::Reset(&local_238); AnimationState::~AnimationState(&local_238._overlayAnimState); AnimationState::~AnimationState(&local_238._animState); std::string::_Tidy_deallocate(local_238._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&local_238); local_14 = (uint)local_14._1_3_ << 8; if (0xf < local_cc) { uVar31 = local_cc + 1; psVar16 = local_e0[0]; if (0xfff < uVar31) { psVar16 = (std_string *)local_e0[0][-1]._capacity; uVar31 = local_cc + 0x24; if ((byte *)0x1f < (byte *)((int)local_e0[0] + (-4 - (int)psVar16))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar16,uVar31); } local_d0 = 0; local_cc = 0xf; local_e0[0] = (std_string *)((uint)local_e0[0] & 0xffffff00); } } *(undefined4 *)(this + 1) = 0x28; this[1].field_0x118 = 0; local_288 = (int *)0x0; uStack_284 = 0; uStack_280 = 0; uStack_27c = 0; local_278 = 0; piVar17 = operator_new(8); pNVar12 = local_250; piVar17[1] = 0; *piVar17 = (int)&local_288; puVar30 = &this[1].field_0x11c; local_14._0_1_ = 6; local_288 = piVar17; if ((int **)puVar30 != &local_288) { local_288 = *(int **)puVar30; *(int **)puVar30 = piVar17; if (piVar17 != (int *)0x0) { *piVar17 = (int)puVar30; } if (local_288 != (int *)0x0) { *local_288 = (int)&local_288; } uVar1 = *(undefined4 *)&this[1].field_0x120; *(undefined4 *)&this[1].field_0x120 = uStack_284; uVar2 = *(undefined4 *)&this[1].field_0x124; *(undefined4 *)&this[1].field_0x124 = uStack_280; uVar3 = *(undefined4 *)&this[1].field_0x128; *(undefined4 *)&this[1].field_0x128 = uStack_27c; uVar4 = *(undefined4 *)&this[1].field_0x12c; *(undefined4 *)&this[1].field_0x12c = local_278; uStack_284 = uVar1; uStack_280 = uVar2; uStack_27c = uVar3; local_278 = uVar4; } if (local_250[1].field_0x244 == '\0') { pEVar18 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x236,(RNG **)&g_game->_playerManager,1); if ((pEVar18 != (Entity_Player *)0x0) && (g_game->_stage != 0xd)) { if (pNVar12[1].field_0x10d == '\0') { local_5c._size = 0; local_5c._capacity = 0xf; local_5c._buf[0] = '\0'; local_5c._buf[1] = '\0'; local_5c._buf[2] = '\0'; local_5c._buf[3] = '\0'; local_5c._buf._0_4_ = std::_Allocate(0x20); local_5c._size = 0x18; local_5c._capacity = 0x1f; builtin_strncpy((char *)local_5c._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14._0_1_ = 7; ANM2::Load((ANM2 *)&pNVar12[1].field_0x4,&local_5c,1); local_14._0_1_ = 6; if (0xf < local_5c._capacity) { uVar31 = local_5c._capacity + 1; pcVar37 = (char *)local_5c._buf._0_4_; if (0xfff < uVar31) { pcVar37 = *(char **)(local_5c._buf._0_4_ + -4); uVar31 = local_5c._capacity + 0x24; if ((char *)0x1f < (char *)(local_5c._buf._0_4_ + (-4 - (int)pcVar37))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar37,uVar31); } local_5c._size = 0; local_5c._capacity = 0xf; local_5c._buf._0_4_ = local_5c._buf._0_4_ & 0xffffff00; ANM2::Play((ANM2 *)&pNVar12[1].field_0x4,(byte *)"Diary",0); local_334._offset[0] = -0.1283; local_334._colorize[0] = 0.0; local_334._colorize[1] = 0.0; local_334._colorize[2] = 0.0; local_334._colorize[3] = 0.0; local_334._offset[1] = -0.126; local_334._tint[0] = 1.1616; local_334._tint[1] = 1.3218; local_334._tint[2] = 1.5972; local_334._tint[3] = 1.0; local_334._offset[2] = -0.1642; Sprite::SetColor((Sprite *)&pNVar12[1].field_0x4,&local_334); } pGVar32 = g_game; pNVar12[1].field_0x118 = 1; *(undefined4 *)(pNVar12 + 1) = 10; local_26c = pGVar32->_roomList; local_274 = (void **)0x0; if (0 < pGVar32->_nbRooms) { local_258 = &pGVar32->_roomList[0].Data; LAB_00922220: ppvVar7 = local_258; if (local_258[-1] != (void *)0x0) goto LAB_009228d6; pRVar5 = *local_258; local_25c = pRVar5; if (((pRVar5 == (RoomConfig_Room *)0x0) || (pRVar5->Type != 4)) || (local_258[0x29] != (void *)0xffffffff)) goto LAB_009228d6; pEVar18 = PlayerManager::FirstCollectibleOwner (&pGVar32->_playerManager,0x19e,(RNG **)&pGVar32->_playerManager,1); if (pEVar18 != (Entity_Player *)0x0) { uVar31 = (uint)ppvVar7[0x13]; local_2b8 = 0x500000001; local_254 = (EntityConfig_Entity *)0x10; local_2b0 = 0x10; if (uVar31 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar8 = (code *)swi(3); (*pcVar8)(); return; } uVar31 = uVar31 >> 1 ^ uVar31; uVar31 = uVar31 << 5 ^ uVar31; iVar28 = 0; local_254 = (EntityConfig_Entity *)(uVar31 >> 0x10 ^ uVar31); iVar15 = g_game->_stageType; if ((iVar15 == 4) || (iVar15 == 5)) { iVar6 = g_game->_stage; if ((iVar6 == 1) || (iVar6 == 2)) { iVar28 = (iVar15 != 4) + 0x1b; } else if ((iVar6 == 3) || (iVar6 == 4)) { iVar28 = (iVar15 != 4) + 0x1d; } else if ((iVar6 == 5) || (iVar6 == 6)) { iVar28 = (iVar15 != 4) + 0x1f; } } if (pRVar5->Subtype == 0) { uVar31 = 1; } else { if (pRVar5->Subtype != 2) goto LAB_00922378; uVar31 = 3; } pRVar19 = RoomConfig::GetRandomRoom (&g_game->_roomConfig,(uint)local_254,0,iVar28,4,pRVar5->Shape,0,-1,1, 10,(uint *)&pRVar5->Doors,uVar31,-1); local_25c = pRVar5; if (pRVar19 != (RoomConfig_Room *)0x0) { local_25c = pRVar19; } } LAB_00922378: iVar15 = 0; local_34 = 0; local_30 = 0xf; local_44[0] = (char *****)0x0; local_2c[0] = 0; local_2c[1] = 0; local_14._0_1_ = 8; local_264 = (uint)local_258[0x13]; local_254 = (EntityConfig_Entity *)&DAT_00000007; local_2c0 = 7; local_2c8 = 0x700000002; local_260 = (void *)0x0; if (local_25c->SpawnCount == 0) { LAB_00922789: uVar31 = local_30; if (0x7fffffff - (local_30 >> 1) < local_30) { uVar33 = 0x7fffffff; } else { uVar22 = local_30 + (local_30 >> 1); uVar33 = 0x1f; if (0x1f < uVar22) { uVar33 = uVar22; } } local_248 = std::_Allocate(uVar33 + 1); local_34 = 0x10; *local_248 = (char ****)0x61657254; local_248[1] = (char ****)0x65727573; local_248[2] = (char ****)0x6d6f6f52; local_248[3] = (char ****)0x706f6f50; *(char *)(local_248 + 4) = '\0'; local_30 = uVar33; if (0xf < uVar31) { uVar22 = uVar31 + 1; pppppcVar29 = local_44[0]; if (0xfff < uVar22) { pppppcVar29 = (char *****)local_44[0][-1]; uVar22 = uVar31 + 0x24; if ((char *)0x1f < (char *)((int)local_44[0] + (-4 - (int)pppppcVar29))) goto LAB_00921eab; } LAB_009227fa: operator_delete(pppppcVar29,uVar22); } LAB_00922809: local_44[0] = local_248; } else { local_24c = (EntityConfig_Entity *)0x0; do { if (1 < iVar15) break; if (local_264 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar8 = (code *)swi(3); (*pcVar8)(); return; } local_264 = local_264 >> ((byte)local_2c8 & 0x1f) ^ local_264; local_264 = local_264 << ((byte)((ulonglong)local_2c8 >> 0x20) & 0x1f) ^ local_264; uVar31 = local_264 >> ((byte)local_254 & 0x1f) ^ local_264; psVar20 = (short *)((int)local_25c->Spawns + (int)local_24c); local_248 = (char *****)(*psVar20 + 1 + (psVar20[1] + 1) * (uint)local_25c->Width); local_264 = uVar31; if ((char)psVar20[4] != '\0') { puVar21 = Spawn::PickEntry(psVar20,(float)((double)(int)uVar31 + __uint_to_double_fixup [-((int)uVar31 >> 0x1f)]) * 2.3283062e-10); local_b0 = *puVar21; local_a8 = *(undefined4 *)(puVar21 + 1); Room::TransformEntry(g_game->_room,&local_b0,(uint)local_248,uVar31); uStack_294 = 0x900000005; local_248 = (char *****)&DAT_00000007; if (uVar31 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar8 = (code *)swi(3); (*pcVar8)(); return; } uVar31 = uVar31 >> 5 ^ uVar31; uStack_2a8 = 0x900000005; uVar31 = uVar31 << 9 ^ uVar31; local_2ac = uVar31 >> 7 ^ uVar31; pvStack_2a0 = (void *)0x7; uStack_294 = 0x900000005; uStack_28c = 7; local_298 = local_2ac; if (((int)local_b0 == 5) && (local_b0._4_2_ == 100)) { uVar22 = (uint)local_b0._6_2_; if (uVar22 == 0) { if (uVar31 >> 7 == uVar31) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar8 = (code *)swi(3); (*pcVar8)(); return; } local_298 = local_2ac >> 5 ^ local_2ac; local_298 = local_298 << 9 ^ local_298; local_298 = local_298 >> 7 ^ local_298; uVar22 = ItemPool::GetSeededCollectible (local_298,1,(RoomDescriptor *)(local_258 + -4)); } pIVar23 = ItemConfig::GetCollectible(&g_manager->_itemConfig,uVar22); local_2c[iVar15] = (uint)pIVar23; iVar15 = iVar15 + 1; } } local_24c = (EntityConfig_Entity *)((local_24c->name)._buf + 4); local_260 = (void *)((int)local_260 + 1); } while (local_260 < (void *)(uint)(ushort)local_25c->SpawnCount); uVar31 = local_30; pppppcVar29 = local_44[0]; if (iVar15 == 0) { if (0xf < local_30) { local_34 = 0x10; memmove(local_44[0],"TreasureRoomPoop",0x10); *(char *)(pppppcVar29 + 4) = '\0'; goto LAB_0092280c; } goto LAB_00922789; } if (iVar15 == 1) { if (0xb < local_30) { local_34 = 0xc; pppppcVar29 = (char *****)local_44; if (0xf < local_30) { pppppcVar29 = local_44[0]; } memmove(pppppcVar29,"TreasureRoom",0xc); *(char *)(pppppcVar29 + 3) = '\0'; goto LAB_0092280c; } if (0x7fffffff - (local_30 >> 1) < local_30) { uVar33 = 0x7fffffff; } else { uVar22 = local_30 + (local_30 >> 1); uVar33 = 0xf; if (0xf < uVar22) { uVar33 = uVar22; } } local_248 = std::_Allocate(uVar33 + 1); local_34 = 0xc; local_248[0] = (char ****)0x61657254; local_248[1] = (char ****)0x65727573; local_248[2] = (char ****)0x6d6f6f52; *(char *)(local_248 + 3) = '\0'; LAB_009226d0: local_30 = uVar33; if (uVar31 < 0x10) goto LAB_00922809; uVar22 = uVar31 + 1; pppppcVar29 = local_44[0]; if (uVar22 < 0x1000) goto LAB_009227fa; pppppcVar29 = (char *****)local_44[0][-1]; uVar22 = uVar31 + 0x24; if ((char *)0x1f < (char *)((int)local_44[0] + (-4 - (int)pppppcVar29))) goto LAB_00921eab; goto LAB_009227fa; } if (local_30 < 0x12) { if (0x7fffffff - (local_30 >> 1) < local_30) { uVar33 = 0x7fffffff; } else { uVar22 = local_30 + (local_30 >> 1); uVar33 = 0x1f; if (0x1f < uVar22) { uVar33 = uVar22; } } local_248 = std::_Allocate(uVar33 + 1); local_34 = 0x12; *local_248 = (char ****)0x61657254; local_248[1] = (char ****)0x65727573; local_248[2] = (char ****)0x6d6f6f52; local_248[3] = (char ****)0x62756f44; *(undefined2 *)(local_248 + 4) = 0x656c; *(char *)((int)local_248 + 0x12) = '\0'; goto LAB_009226d0; } local_34 = 0x12; pppppcVar29 = (char *****)local_44; if (0xf < local_30) { pppppcVar29 = local_44[0]; } memmove(pppppcVar29,"TreasureRoomDouble",0x12); *(char *)((int)pppppcVar29 + 0x12) = '\0'; } LAB_0092280c: pNVar12 = local_250; iVar15 = *(int *)&local_250[1].field_0x12c; uVar31 = *(uint *)&local_250[1].field_0x124; if (uVar31 <= iVar15 + 1U) { std::deque<32byte>::_Growmap(iVar15); uVar31 = *(uint *)&pNVar12[1].field_0x124; iVar15 = *(int *)&pNVar12[1].field_0x12c; } uVar22 = uVar31 - 1 & *(uint *)&pNVar12[1].field_0x128; *(uint *)&pNVar12[1].field_0x128 = uVar22; uVar31 = uVar31 - 1 & uVar22 + iVar15; iVar15 = *(int *)&pNVar12[1].field_0x120; if (*(int *)(iVar15 + uVar31 * 4) == 0) { pvVar35 = operator_new(0x20); *(void **)(*(int *)&pNVar12[1].field_0x120 + uVar31 * 4) = pvVar35; iVar15 = *(int *)&pNVar12[1].field_0x120; } pcVar37 = *(char **)(iVar15 + uVar31 * 4); std::string::string(pcVar37,local_44); *(uint *)(pcVar37 + 0x18) = local_2c[0]; *(uint *)(pcVar37 + 0x1c) = local_2c[1]; *(int *)&pNVar12[1].field_0x12c = *(int *)&pNVar12[1].field_0x12c + 1; local_14._0_1_ = 6; if (0xf < local_30) { uVar31 = local_30 + 1; pppppcVar29 = local_44[0]; if (0xfff < uVar31) { pppppcVar29 = (char *****)local_44[0][-1]; uVar31 = local_30 + 0x24; if ((char *)0x1f < (char *)((int)local_44[0] + (-4 - (int)pppppcVar29))) goto LAB_00921eab; } operator_delete(pppppcVar29,uVar31); } local_34 = 0; local_30 = 0xf; local_44[0] = (char *****)((uint)local_44[0] & 0xffffff00); pGVar32 = g_game; LAB_009228d6: local_274 = (void **)((int)local_274 + 1); local_258 = local_258 + 0x2e; if (pGVar32->_nbRooms <= (int)local_274) goto LAB_009228fb; goto LAB_00922220; } LAB_009228fb: local_260 = (void *)0x0; if (0 < pGVar32->_nbRooms) { local_25c = (RoomConfig_Room *)&local_26c->Group; do { if (local_25c[-2].Subtype == 0) { iVar15 = *(int *)&local_25c[-2].field_0x14; if ((((iVar15 != 0) && (*(int *)(iVar15 + 8) == 5)) && (local_25c->StageId == -1)) && (((pGVar32->_difficulty != 2 && (pGVar32->_difficulty != 3)) || (pGVar32->_lastBossRoomListIdx == local_25c[-2].Variant)))) { uVar31 = local_25c[-1].Mode; local_26c = (RoomDescriptor *)&DAT_00000007; local_2d0 = 7; iVar15 = *(ushort *)(iVar15 + 0x44) - 1; local_2d8 = 0x700000002; local_258 = (void **)0x0; local_274 = (void **)0x0; local_24c = (EntityConfig_Entity *)0x0; local_254 = (EntityConfig_Entity *)0x0; if (iVar15 < 0) { LAB_00922baf: pMVar10 = g_manager; if (((pGVar32->_gameStateFlags & 0x800000000000) == 0) || (pGVar32->_stage != 6)) goto LAB_00922c20; local_268 = 0x2d00000; _Find_lower_bound<>(&uStack_2a8,&local_268); if ((*(char *)((int)pvStack_2a0 + 0xd) != '\0') || (0x2d00000 < *(uint *)((int)pvStack_2a0 + 0x10))) goto LAB_00922c20; pEVar24 = local_24c; if (((pvStack_2a0 != (pMVar10->_entityConfig)._entities._head) && ((EntityConfig_Entity *)((int)pvStack_2a0 + 0x18) != (EntityConfig_Entity *)0x0) ) && (*(int *)((int)pvStack_2a0 + 0x48) != 0)) { pEVar24 = (EntityConfig_Entity *)((int)pvStack_2a0 + 0x18); } } else { local_264 = iVar15 * 0x10; do { if (uVar31 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar8 = (code *)swi(3); (*pcVar8)(); return; } uVar31 = uVar31 >> ((byte)local_2d8 & 0x1f) ^ uVar31; uVar31 = uVar31 << ((byte)((ulonglong)local_2d8 >> 0x20) & 0x1f) ^ uVar31; uVar31 = uVar31 >> ((byte)local_26c & 0x1f) ^ uVar31; psVar20 = (short *)(*(int *)(*(int *)&local_25c[-2].field_0x14 + 0x40) + local_264 ); local_248 = (char *****) (*psVar20 + 1 + (psVar20[1] + 1) * (uint)*(byte *)(*(int *)&local_25c[-2].field_0x14 + 0x46)); if ((char)psVar20[4] != '\0') { puVar21 = Spawn::PickEntry(psVar20,(float)((double)(int)uVar31 + __uint_to_double_fixup [-((int)uVar31 >> 0x1f)]) * 2.3283062e-10); local_244 = *puVar21; local_23c = *(undefined4 *)(puVar21 + 1); Room::TransformEntry(g_game->_room,&local_244,(uint)local_248,uVar31); uStack_2f8 = 0x900000005; local_248 = (char *****)&DAT_00000007; if (uVar31 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar8 = (code *)swi(3); (*pcVar8)(); return; } local_2fc = uVar31 >> 5 ^ uVar31; uStack_2e8 = 0x900000005; local_2fc = local_2fc << 9 ^ local_2fc; local_2fc = local_2fc >> 7 ^ local_2fc; uStack_2e0 = 7; uStack_2f8 = 0x900000005; uStack_2f0 = 7; local_2ec = local_2fc; pEVar24 = EntityConfig::GetEntity (&g_manager->_entityConfig,(int)local_244, (uint)local_244._4_2_,(uint)local_244._6_2_); if (pEVar24 != (EntityConfig_Entity *)0x0) { ppvVar7 = (void **)pEVar24->bossID; if (ppvVar7 != (void **)0x0) { if (local_258 == (void **)0x0) { local_258 = ppvVar7; local_24c = pEVar24; } else if (ppvVar7 != local_258) { local_274 = ppvVar7; local_254 = pEVar24; } } } } local_264 = local_264 - 0x10; iVar15 = iVar15 + -1; } while (-1 < iVar15); if (local_258 == (void **)0x0) { pGVar32 = g_game; goto LAB_00922baf; } LAB_00922c20: pEVar24 = local_24c; } if ((*(int *)(*(int *)&local_25c[-2].field_0x14 + 8) == 5) && (*(int *)(*(int *)&local_25c[-2].field_0x14 + 0xc) - 0xe74U < 0x96)) { bVar9 = true; } else { bVar9 = false; } if (bVar9) { local_8c._buf._0_4_ = std::_Allocate(0x20); local_8c._size = 0x11; local_8c._capacity = 0x1f; builtin_strncpy((char *)local_8c._buf._0_4_,"BossDoubleTrouble",0x12); local_14._0_1_ = 9; std::string::string(local_120,&local_8c); local_104 = pEVar24; if (local_274 != (void **)0x0) { local_104 = local_254; } local_14._0_1_ = 10; local_108 = pEVar24; std::deque<32byte>::push_back(local_120); std::string::_Tidy_deallocate(local_120); local_14._0_1_ = 6; if (0xf < local_8c._capacity) { uVar31 = local_8c._capacity + 1; pcVar37 = (char *)local_8c._buf._0_4_; if (0xfff < uVar31) { pcVar37 = *(char **)(local_8c._buf._0_4_ + -4); uVar31 = local_8c._capacity + 0x24; if ((char *)0x1f < (char *)(local_8c._buf._0_4_ + (-4 - (int)pcVar37))) goto LAB_00921eab; } operator_delete(pcVar37,uVar31); } local_8c._size = 0; local_8c._capacity = 0xf; local_8c._buf._0_4_ = local_8c._buf._0_4_ & 0xffffff00; } else { local_b8 = 0; local_b4 = 0xf; local_c8[0] = (void *)0x0; std::string::assign((char *)local_c8,&DAT_00b6c734,4); local_14._0_1_ = 0xb; std::string::string(local_100,local_c8); local_e4 = 0; local_14._0_1_ = 0xc; local_e8 = pEVar24; std::deque<32byte>::push_back(local_100); std::string::_Tidy_deallocate(local_100); local_14._0_1_ = 6; if (0xf < local_b4) { uVar31 = local_b4 + 1; pvVar35 = local_c8[0]; if (0xfff < uVar31) { pvVar35 = *(void **)((int)local_c8[0] + -4); uVar31 = local_b4 + 0x24; if (0x1f < (uint)((int)local_c8[0] + (-4 - (int)pvVar35))) goto LAB_00921eab; } operator_delete(pvVar35,uVar31); } local_b8 = 0; local_b4 = 0xf; local_c8[0] = (void *)((uint)local_c8[0] & 0xffffff00); } pGVar32 = g_game; } } local_260 = (void *)((int)local_260 + 1); local_25c = local_25c + 2; } while ((int)local_260 < pGVar32->_nbRooms); } uVar31 = 0x1e; pcVar37 = "gfx/ui/stage/nightmare_dc.anm2"; goto LAB_00922e39; } } else { uVar31 = 0x21; pcVar37 = "gfx/ui/stage/nightmare_dogma.anm2"; LAB_00922e39: std::string::assign(local_a4._buf,(byte *)pcVar37,uVar31); } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pPVar34 = &g_game->_playerManager; local_254 = (EntityConfig_Entity *)0x0; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar34->_playerList)._begin >> 2 != 0) { do { pEVar24 = local_254; pvVar35 = (pPVar34->_playerList)._end; piVar17 = (pPVar34->_playerList)._begin; if ((int)pvVar35 - (int)piVar17 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar35 = (pPVar34->_playerList)._end; piVar17 = (pPVar34->_playerList)._begin; } pEVar11 = local_254; if (pEVar24 < (EntityConfig_Entity *)((int)pvVar35 - (int)piVar17 >> 2)) { piVar17 = piVar17 + (int)pEVar24; } local_260 = (void *)*piVar17; NVar25 = g_manager->_netplayManager; if (NVar25 == *(NetplayManager *)(g_manager + 1)) { LAB_00922f0e: local_270 = local_260; break; } puVar30 = (undefined1 *)0x0; local_26c = (RoomDescriptor *)((int)*(NetplayManager *)(g_manager + 1) - (int)NVar25 >> 2); if (local_26c == (RoomDescriptor *)0x0) goto LAB_00922f0e; while (*(int *)(*(int *)NVar25 + 0xc) != *(int *)((int)local_260 + 0x1618)) { puVar30 = puVar30 + 1; NVar25 = (NetplayManager)((int)NVar25 + 4); if (local_26c <= puVar30) goto LAB_00922f0e; } cVar13 = (**(code **)(*(int *)(*(int *)NVar25 + 0x370) + 0x14))(); if (cVar13 != '\0') goto LAB_00922f0e; local_254 = (EntityConfig_Entity *)((int)&pEVar11->id + 1); pPVar34 = &g_game->_playerManager; } while (local_254 < (EntityConfig_Entity *) ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar34->_playerList)._begin >> 2)); } iVar15 = FUN_0090b070(); uVar31 = g_manager[1]._state - 5; uVar31 = -(uint)(uVar31 != 0) & uVar31; while( true ) { if (*(int *)(iVar15 + 0x3a4) == 0) { uVar22 = g_manager[1]._state; } else { local_268 = *(int *)(iVar15 + 0x3a0); puVar26 = (uint *)FUN_009012b0(); uVar22 = *puVar26; } if (uVar22 < uVar31) break; NetInputDevice::broadcast_frame_input(uVar31); uVar31 = uVar31 + 1; } } pNVar12 = local_250; iVar15 = *(int *)((int)local_270 + 0x13c0); local_268 = iVar15; if ((iVar15 < 0) || (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= iVar15)) { pvVar35 = (void *)0x0; } else { pvVar35 = (void *)(iVar15 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); local_270 = pvVar35; if (pvVar35 != (void *)0x0) { Sprite::ReplaceSpritesheet ((Sprite *)&local_250->field_0x20,2,(std_string *)((int)pvVar35 + 0x4c)); Sprite::ReplaceSpritesheet ((Sprite *)&pNVar12->field_0x20,6,(std_string *)((int)pvVar35 + 0x4c)); pvVar35 = local_270; iVar15 = local_268; goto LAB_00923057; } } KAGE_LogMessage(1,(byte *)"[warn] could not load player config for type %d.\n"); LAB_00923057: ANM2::Reset((ANM2 *)&local_250[1].field_0x130); pNVar12 = local_250; bVar14 = extraout_CL; if (*(int *)((int)pvVar35 + 0x8c) != 0) { ANM2::Load((ANM2 *)&local_250[1].field_0x130,(std_string *)((int)pvVar35 + 0x7c),1); anim = &pNVar12[1].field_0x148; if (0xf < *(uint *)&pNVar12[1].field_0x15c) { anim = *(byte **)anim; } ANM2::Play((ANM2 *)&pNVar12[1].field_0x130,anim,0); bVar14 = extraout_CL_00; } pGVar32 = g_game; uVar31 = Game::GetStageID(g_game,bVar14); std::string::string(local_8c._buf,pGVar32->_ventricleRazorPortals + uVar31 * 0xc4 + 0x5cc); pNVar12 = local_250; puVar30 = &local_250->field_0x20; local_14._0_1_ = 0xd; Sprite::ReplaceSpritesheet((Sprite *)puVar30,3,&local_8c); local_14 = CONCAT31(local_14._1_3_,6); std::string::_Tidy_deallocate(local_8c._buf); ANM2::LoadGraphics((ANM2 *)puVar30,unk_00); bVar14 = ANM2::SetAnimation((ANM2 *)puVar30,(byte *)"Intro",1); if (bVar14 != 0) { AnimationState::Rewind((AnimationState *)&pNVar12->field_0x50); pNVar12->field_0x64 = 1; } pNVar12 = local_250; puVar30 = &local_250->field_0x134; ANM2::Reset((ANM2 *)puVar30); ANM2::Load((ANM2 *)puVar30,&local_a4,1); bVar14 = ANM2::SetAnimation((ANM2 *)puVar30,(byte *)"Scene",1); if (((bVar14 != 0) && (*(int *)&pNVar12->field_0x168 != 0)) && (AnimationState::SetFrameFloat((AnimationState *)&pNVar12->field_0x164,0.0), *(int *)&pNVar12->field_0x168 != 0)) { pNVar12->field_0x178 = 0; } pNVar12 = local_250; if (((((iVar15 == 4) || (iVar15 == 0x10)) || ((iVar15 == 0x11 || ((iVar15 == 0xe || (iVar15 == 0x19)))))) || (iVar15 == 0x23)) || (iVar15 == 0x21)) { pLVar27 = ANM2::GetLayer((ANM2 *)&local_250->field_0x20,(byte *)0x2); pLVar27->_visible = 0; pLVar27 = ANM2::GetLayer((ANM2 *)&pNVar12->field_0x20,&DAT_00000006); pLVar27->_visible = 1; } else { pLVar27 = ANM2::GetLayer((ANM2 *)&local_250->field_0x20,(byte *)0x2); pLVar27->_visible = 1; pLVar27 = ANM2::GetLayer((ANM2 *)&pNVar12->field_0x20,&DAT_00000006); pLVar27->_visible = 0; } pNVar12 = local_250; *(undefined4 *)local_250 = 1; *(undefined4 *)&local_250->field_0x4 = 0; fVar36 = g_screenHeight * 0.5; *(float *)&local_250->field_0xb4 = g_screenWidth * 0.5; *(float *)&local_250->field_0xb8 = fVar36; fVar36 = g_screenHeight * 0.5; *(float *)&local_250->field_0x1c8 = g_screenWidth * 0.5; *(float *)&local_250->field_0x1cc = fVar36; pGVar32 = g_game; *(uint *)&local_250->field_0x360 = (*(int *)&local_250->field_0x360 + 1U) % (uint)((*(int *)&local_250->field_0xc - *(int *)&local_250->field_0x8) / 0x18); iVar15 = pGVar32->_stage; *(int *)&local_250->field_0x364 = iVar15 + -1; iVar28 = pGVar32->_stageType; if ((iVar28 == 4) || (iVar28 == 5)) { *(int *)&local_250->field_0x364 = iVar15; } pMVar10 = g_manager; cVar13 = local_250[1].field_0x244; local_250->field_0x368 = unk; iVar15 = 0x60; if (cVar13 != '\0') { iVar15 = 0x41; } Music::Play((Music *)&pMVar10->_musicManager,iVar15,(pMVar10->_optionsConfig)._musicVolume); if (g_game->_stage == 0xc) { *(undefined4 *)&pNVar12->field_0x364 = 9; } std::deque<32byte>::_Tidy(); std::string::_Tidy_deallocate(local_a4._buf); ExceptionList = local_1c; return; } //@@ 00923320 NightmareScene::record_stage /* DB: ECX=Manager+0x21628 (NightmareScene) from Level::SetStage: maps (stage, stageType) incl. greed mode (Game+0x269c8 2/3) to a stage-bar icon index stored at +0x36c+chapter*4, sets +0x5e8/+0x3a0 for stage 13 */ void NightmareScene::record_stage(int param_1,int param_2) { Game *pGVar1; undefined1 uVar2; int in_ECX; int iVar3; pGVar1 = g_game; iVar3 = 0x11; *(undefined1 *)(in_ECX + 0x5e8) = 0; if ((pGVar1->_difficulty == 2) || (pGVar1->_difficulty == 3)) { if ((param_2 != 4) && (param_2 != 5)) { if (param_1 < 5) { param_2 = (param_1 + -1) * 3 + param_2; } else if (param_1 == 5) { param_2 = param_2 + 0xd; } else if (param_1 == 6) { param_2 = param_2 + 0x10; } else { if (param_1 == 7) { iVar3 = 0x10; } param_2 = iVar3 + param_2; } goto LAB_0092342f; } param_2 = param_1 * 2 + 0xd + param_2; } else { if (param_1 == 0xd) { uVar2 = *(undefined1 *)(in_ECX + 0x5e8); if (param_2 == 1) { uVar2 = 1; } *(undefined1 *)(in_ECX + 0x5e8) = uVar2; *(undefined4 *)(in_ECX + 0x3a0) = 0x1b; return; } if ((param_2 != 4) && (param_2 != 5)) { if (param_1 < 10) { param_2 = ((param_1 + -1) / 2) * 3 + param_2; } else if (param_1 == 10) { param_2 = param_2 + 0xd; } else if (param_1 == 0xb) { param_2 = param_2 + 0xf; } else { if (param_1 == 0xc) { iVar3 = 0x12; } param_2 = iVar3 + param_2; } goto LAB_0092342f; } param_2 = param_2 + 0xf + ((param_1 + -1) / 2) * 2; } param_1 = param_1 + 1; LAB_0092342f: *(int *)(in_ECX + 0x36c + param_1 * 4) = param_2; if (param_1 == 0xc) { *(undefined4 *)(in_ECX + 0x394) = *(undefined4 *)(in_ECX + 0x39c); } return; } //@@ 00923450 FUN_00923450 void FUN_00923450(void) { uint *puVar1; undefined4 uVar2; int in_ECX; int iVar3; uint uVar4; uint uVar5; int iVar6; int local_c; uint local_8; *(undefined8 *)(in_ECX + 0x36c) = 0x1100000011; *(undefined8 *)(in_ECX + 0x374) = 0x1100000011; local_8 = 0; *(undefined8 *)(in_ECX + 0x37c) = 0x1100000011; *(undefined8 *)(in_ECX + 900) = 0x1100000011; *(undefined8 *)(in_ECX + 0x38c) = 0x1100000011; *(undefined8 *)(in_ECX + 0x394) = 0x1100000011; *(undefined8 *)(in_ECX + 0x39c) = 0x1100000011; local_c = *(int *)(in_ECX + 0x14); *(int *)(in_ECX + 0x18) = local_c; iVar3 = *(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8); iVar6 = iVar3 >> 0x1f; if (iVar3 / 0x18 + iVar6 != iVar6) { do { puVar1 = *(uint **)(in_ECX + 0x18); if (puVar1 == *(uint **)(in_ECX + 0x1c)) { std::vector::_Emplace_reallocate(puVar1,&local_8); } else { *puVar1 = local_8; *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + 4; } local_8 = local_8 + 1; } while (local_8 < (uint)((*(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8)) / 0x18)); local_c = *(int *)(in_ECX + 0x14); } uVar5 = *(int *)(in_ECX + 0x18) - local_c >> 2; iVar6 = uVar5 - 1; if (0 < iVar6) { do { if (uVar5 == 0) { uVar4 = 0; } else { uVar4 = Random(); uVar4 = uVar4 % uVar5; } uVar2 = *(undefined4 *)(local_c + iVar6 * 4); uVar5 = uVar5 - 1; *(undefined4 *)(local_c + iVar6 * 4) = *(undefined4 *)(local_c + uVar4 * 4); iVar6 = iVar6 + -1; *(undefined4 *)(local_c + uVar4 * 4) = uVar2; } while (0 < iVar6); } *(undefined4 *)(in_ECX + 0x360) = 0; return; } //@@ 00923550 std::deque<32byte>::push_back /* DB: ECX=NightmareScene+0x4c0: move-pushes a {std::string, u64} element (block 0x20); NightmareScene::Show */ void std::deque<32byte>::push_back(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; void *pvVar5; int in_ECX; int iVar6; uint uVar7; int iVar8; iVar6 = *(int *)(in_ECX + 0x10); uVar7 = *(uint *)(in_ECX + 8); if (uVar7 <= iVar6 + 1U) { _Growmap(iVar6); uVar7 = *(uint *)(in_ECX + 8); iVar6 = *(int *)(in_ECX + 0x10); } *(uint *)(in_ECX + 0xc) = *(uint *)(in_ECX + 0xc) & uVar7 - 1; iVar8 = *(int *)(in_ECX + 4); uVar7 = iVar6 + *(int *)(in_ECX + 0xc) & uVar7 - 1; iVar6 = uVar7 * 4; if (*(int *)(iVar8 + uVar7 * 4) == 0) { pvVar5 = operator_new(0x20); *(void **)(iVar6 + *(int *)(in_ECX + 4)) = pvVar5; iVar8 = *(int *)(in_ECX + 4); } puVar1 = *(undefined4 **)(iVar6 + iVar8); *puVar1 = 0; puVar1[4] = 0; puVar1[5] = 0; uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; *puVar1 = *param_1; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; uVar2 = param_1[7]; puVar1[6] = param_1[6]; puVar1[7] = uVar2; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; return; } //@@ 00923600 std::deque<32byte>::_Tidy /* DB: destroys {std::string,8 bytes} elements and frees the map; NightmareScene::Show and 00950f10 */ void std::deque<32byte>::_Tidy(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; int iVar2; uint size; iVar2 = in_ECX[4]; do { if (iVar2 == 0) goto LAB_0092363f; string::_Tidy_deallocate(*(char **)(in_ECX[1] + (iVar2 + in_ECX[3] + -1 & in_ECX[2] - 1) * 4)); iVar2 = in_ECX[4] + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; LAB_0092363f: iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x20); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 009236c0 std::deque<32byte>::_Growmap /* DB: deque block map grow (x2, min 8) for 0x20-byte elements; NightmareScene::Show via 00923550 std::deque<32byte>::push_back void std::deque<32byte>::_Growmap(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0x7ffffff - uVar3 < uVar3) { FUN_0040cad0(); LAB_009237f6: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = _Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_009237f6; } //@@ 00923800 NetplayTextPopup::destructor /* DB: ? Unwind-only: ANM2::Reset +0x14, two AnimationStates, strings, then deque _Tidy 00923d90 std::deque<36byte>::_Tidy +0; same layout as the TextIn/TextOut popup NetplayManager::update_text_popup drives */ void NetplayTextPopup::destructor(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; clear(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x14)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 100)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x14)); std::deque<36byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00923880 NetplayTextPopup::clear /* DB: pops every queued message of the deque (+4..+0x10), calling its callback (+0x1c, arg +0x20), frees strings, ANM2::Reset +0x14; NetplayTextPopup::destructor, NetplayManager::~NetplayManager */ void NetplayTextPopup::clear(void) { int iVar1; code *pcVar2; char *this; int in_ECX; int iVar3; uint uVar4; int iVar5; int iVar6; iVar3 = *(int *)(in_ECX + 0x10); do { if (iVar3 == 0) goto LAB_00923900; iVar6 = *(int *)(in_ECX + 8); uVar4 = *(uint *)(in_ECX + 0xc); iVar5 = *(int *)(in_ECX + 4); iVar1 = *(int *)(iVar5 + (iVar6 - 1U & uVar4) * 4); pcVar2 = *(code **)(iVar1 + 0x1c); if (pcVar2 != (code *)0x0) { (*pcVar2)(*(undefined4 *)(iVar1 + 0x20)); iVar3 = *(int *)(in_ECX + 0x10); uVar4 = *(uint *)(in_ECX + 0xc); iVar6 = *(int *)(in_ECX + 8); iVar5 = *(int *)(in_ECX + 4); } this = *(char **)(iVar5 + (iVar3 + (uVar4 - 1) & iVar6 - 1U) * 4); this[0x1c] = '\0'; this[0x1d] = '\0'; this[0x1e] = '\0'; this[0x1f] = '\0'; this[0x20] = '\0'; this[0x21] = '\0'; this[0x22] = '\0'; this[0x23] = '\0'; std::string::_Tidy_deallocate(this); iVar3 = *(int *)(in_ECX + 0x10) + -1; *(int *)(in_ECX + 0x10) = iVar3; } while (iVar3 != 0); *(undefined4 *)(in_ECX + 0xc) = 0; LAB_00923900: if (*(int *)(in_ECX + 0x48) != 0) { *(undefined1 *)(in_ECX + 0x58) = 0; } ANM2::Reset((ANM2 *)(in_ECX + 0x14)); return; } //@@ 00923920 NetplayManager::update_text_popup /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? only caller NetplayManager::Update, TextIn/TextOut/TextStay; ZHL called it ReviveFromTrinket */ void __thiscall NetplayManager::update_text_popup(NetplayManager *this) { uint *puVar1; int iVar2; int iVar3; bool bVar4; undefined4 uVar5; byte bVar6; NetplayManager NVar7; std_string *psVar8; std_string *psVar9; uint uVar10; char *pcVar11; NetplayManager NVar12; NetplayManager NVar13; bool bVar14; std_string local_20; std_string *local_8; local_8 = (std_string *)(__security_cookie ^ (uint)((int)&local_20 + 0x1cU)); bVar14 = false; if (this[0x47].field_0x1 != '\0') { AnimationState::Update((AnimationState *)(this + 0x11)); AnimationState::Update((AnimationState *)(this + 0x19)); } if (this[0x12] == (NetplayManager)0x0) { local_20._buf._0_4_ = (std_string *)0x0; local_20._capacity = 0xf; local_20._size = 0; LAB_00923989: psVar8 = (std_string *)local_20._buf._0_4_; psVar9 = &local_20; if (0xf < local_20._capacity) { psVar9 = (std_string *)local_20._buf._0_4_; } bVar14 = true; bVar6 = str_eq((byte *)psVar9,local_20._size,(byte *)"TextIn",6); bVar4 = true; if (bVar6 == 0) goto LAB_009239ae; } else { if (*(char *)(this + 0x16) == '\0') { std::string::string(local_20._buf,(void *)this[0x12]); goto LAB_00923989; } psVar8 = (std_string *)local_20._buf._0_4_; LAB_009239ae: bVar4 = false; } if ((bVar14) && (0xf < local_20._capacity)) { uVar10 = local_20._capacity + 1; psVar9 = psVar8; if (0xfff < uVar10) { psVar9 = (std_string *)psVar8[-1]._capacity; uVar10 = local_20._capacity + 0x24; if ((byte *)0x1f < (byte *)((int)psVar8 + (-4 - (int)psVar9))) goto LAB_00923ac5; } operator_delete(psVar9,uVar10); } bVar14 = false; if (bVar4) { NVar12 = this[0x12]; if (NVar12 != (NetplayManager)0x0) { NVar7 = NVar12; if (0xf < *(uint *)((int)NVar12 + 0x14)) { NVar7 = *(NetplayManager *)NVar12; } pcVar11 = "TextStay"; do { bVar6 = *(byte *)NVar7; bVar14 = bVar6 < (byte)*pcVar11; if (bVar6 != *pcVar11) { LAB_00923a30: uVar10 = -(uint)bVar14 | 1; goto LAB_00923a35; } if (bVar6 == 0) break; bVar6 = *(byte *)((int)NVar7 + 1); bVar14 = bVar6 < (byte)pcVar11[1]; if (bVar6 != pcVar11[1]) goto LAB_00923a30; NVar7 = (NetplayManager)((int)NVar7 + 2); pcVar11 = pcVar11 + 2; } while (bVar6 != 0); uVar10 = 0; LAB_00923a35: if (uVar10 == 0) { if (*(byte *)((int)NVar12 + 0x34) == 0) { return; } if (*(char *)(this + 0x16) != '\0') { return; } } } pcVar11 = "TextStay"; goto LAB_00923c61; } if (this[0x12] == (NetplayManager)0x0) { local_20._buf._0_4_ = (std_string *)0x0; local_20._capacity = 0xf; local_20._size = 0; } else { std::string::string(local_20._buf,(void *)this[0x12]); } uVar5 = local_20._buf._0_4_; psVar8 = &local_20; if (0xf < local_20._capacity) { psVar8 = (std_string *)local_20._buf._0_4_; } bVar6 = str_eq((byte *)psVar8,local_20._size,(byte *)"TextStay",8); if (0xf < local_20._capacity) { uVar10 = local_20._capacity + 1; psVar8 = (std_string *)uVar5; if (0xfff < uVar10) { psVar8 = (std_string *)((std_string *)(uVar5 + -0x18))->_capacity; uVar10 = local_20._capacity + 0x24; if ((byte *)0x1f < (byte *)(uVar5 + (-4 - (int)psVar8))) { LAB_00923ac5: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar8,uVar10); } if (bVar6 != 0) { NVar12 = this[2]; NVar7 = this[3]; NVar13 = this[1]; iVar2 = *(int *)((int)NVar13 + ((int)NVar12 - 1U & (uint)NVar7) * 4); iVar3 = *(int *)(iVar2 + 0x18); if (0 < iVar3) { *(int *)(iVar2 + 0x18) = iVar3 + -1; NVar7 = this[3]; NVar12 = this[2]; NVar13 = this[1]; } if (0 < *(int *)(*(int *)((int)NVar13 + ((int)NVar12 - 1U & (uint)NVar7) * 4) + 0x18)) { return; } NVar12 = this[0x12]; if (NVar12 != (NetplayManager)0x0) { NVar7 = NVar12; if (0xf < *(uint *)((int)NVar12 + 0x14)) { NVar7 = *(NetplayManager *)NVar12; } pcVar11 = "TextOut"; do { bVar6 = *(byte *)NVar7; bVar14 = bVar6 < (byte)*pcVar11; if (bVar6 != *pcVar11) { LAB_00923b50: uVar10 = -(uint)bVar14 | 1; goto LAB_00923b55; } if (bVar6 == 0) break; bVar6 = *(byte *)((int)NVar7 + 1); bVar14 = bVar6 < (byte)pcVar11[1]; if (bVar6 != pcVar11[1]) goto LAB_00923b50; NVar7 = (NetplayManager)((int)NVar7 + 2); pcVar11 = pcVar11 + 2; } while (bVar6 != 0); uVar10 = 0; LAB_00923b55: if (uVar10 == 0) { if (*(byte *)((int)NVar12 + 0x34) == 0) { return; } if (*(char *)(this + 0x16) != '\0') { return; } } } pcVar11 = "TextOut"; goto LAB_00923c61; } if ((this[0x12] == (NetplayManager)0x0) || (*(char *)(this + 0x16) == '\0')) { psVar8 = ANM2::GetAnimation((ANM2 *)(this + 0x11),&local_20); bVar14 = true; puVar1 = &psVar8->_size; if (0xf < psVar8->_capacity) { psVar8 = *(std_string **)psVar8->_buf; } bVar6 = str_eq((byte *)psVar8,*puVar1,(byte *)"TextOut",7); if ((bVar6 == 0) || (bVar4 = true, this[4] == (NetplayManager)0x0)) goto LAB_00923bbc; } else { LAB_00923bbc: bVar4 = false; } if ((bVar14) && (0xf < local_20._capacity)) { uVar10 = local_20._capacity + 1; psVar8 = (std_string *)local_20._buf._0_4_; if (0xfff < uVar10) { psVar8 = (std_string *)((std_string *)(local_20._buf._0_4_ + -0x18))->_capacity; uVar10 = local_20._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_20._buf._0_4_ + (-4 - (int)psVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar8,uVar10); } if (!bVar4) { return; } FUN_00923d30(); if (this[4] == (NetplayManager)0x0) { return; } NVar12 = this[0x12]; if (NVar12 != (NetplayManager)0x0) { NVar7 = NVar12; if (0xf < *(uint *)((int)NVar12 + 0x14)) { NVar7 = *(NetplayManager *)NVar12; } pcVar11 = "TextIn"; do { bVar6 = *(byte *)NVar7; bVar14 = bVar6 < (byte)*pcVar11; if (bVar6 != *pcVar11) { LAB_00923c47: uVar10 = -(uint)bVar14 | 1; goto LAB_00923c4c; } if (bVar6 == 0) break; bVar6 = *(byte *)((int)NVar7 + 1); bVar14 = bVar6 < (byte)pcVar11[1]; if (bVar6 != pcVar11[1]) goto LAB_00923c47; NVar7 = (NetplayManager)((int)NVar7 + 2); pcVar11 = pcVar11 + 2; } while (bVar6 != 0); uVar10 = 0; LAB_00923c4c: if (uVar10 == 0) { if (*(byte *)((int)NVar12 + 0x34) == 0) { return; } if (*(char *)(this + 0x16) != '\0') { return; } } } pcVar11 = "TextIn"; LAB_00923c61: bVar6 = ANM2::SetAnimation((ANM2 *)(this + 5),(byte *)pcVar11,1); if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x11)); *(undefined1 *)(this + 0x16) = 1; } return; } //@@ 00923c90 FUN_00923c90 void FUN_00923c90(void) { char *in_ECX; in_ECX[0x1c] = '\0'; in_ECX[0x1d] = '\0'; in_ECX[0x1e] = '\0'; in_ECX[0x1f] = '\0'; in_ECX[0x20] = '\0'; in_ECX[0x21] = '\0'; in_ECX[0x22] = '\0'; in_ECX[0x23] = '\0'; std::string::_Tidy_deallocate(in_ECX); return; } //@@ 00923cb0 FUN_00923cb0 uint FUN_00923cb0(byte *param_1) { uint *puVar1; uint uVar2; byte bVar3; uint in_EAX; byte *b; undefined3 extraout_var; int in_ECX; byte *a; uint uVar4; uVar2 = *(uint *)(in_ECX + 0x10); uVar4 = 0; if (uVar2 != 0) { in_EAX = *(uint *)(in_ECX + 0xc); do { a = *(byte **)(*(int *)(in_ECX + 4) + (*(int *)(in_ECX + 8) - 1U & in_EAX + uVar4) * 4); b = param_1; if (0xf < *(uint *)(param_1 + 0x14)) { b = *(byte **)param_1; } puVar1 = (uint *)(a + 0x10); if (0xf < *(uint *)(a + 0x14)) { a = *(byte **)a; } bVar3 = str_eq(a,*puVar1,b,*(uint *)(param_1 + 0x10)); if (bVar3 != 0) { return CONCAT31(extraout_var,1); } uVar4 = uVar4 + 1; in_EAX = *(uint *)(in_ECX + 0xc); } while (uVar4 < uVar2); } return in_EAX & 0xffffff00; } //@@ 00923d30 FUN_00923d30 void FUN_00923d30(void) { int *piVar1; int iVar2; code *pcVar3; char *this; int in_ECX; uint uVar4; int iVar5; int iVar6; iVar5 = *(int *)(in_ECX + 8); uVar4 = *(uint *)(in_ECX + 0xc); iVar6 = *(int *)(in_ECX + 4); iVar2 = *(int *)(iVar6 + (iVar5 - 1U & uVar4) * 4); pcVar3 = *(code **)(iVar2 + 0x1c); if (pcVar3 != (code *)0x0) { (*pcVar3)(*(undefined4 *)(iVar2 + 0x20)); uVar4 = *(uint *)(in_ECX + 0xc); iVar5 = *(int *)(in_ECX + 8); iVar6 = *(int *)(in_ECX + 4); } this = *(char **)(iVar6 + (uVar4 + *(int *)(in_ECX + 0x10) + -1 & iVar5 - 1U) * 4); this[0x1c] = '\0'; this[0x1d] = '\0'; this[0x1e] = '\0'; this[0x1f] = '\0'; this[0x20] = '\0'; this[0x21] = '\0'; this[0x22] = '\0'; this[0x23] = '\0'; std::string::_Tidy_deallocate(this); piVar1 = (int *)(in_ECX + 0x10); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)(in_ECX + 0xc) = 0; } return; } //@@ 00923d90 std::deque<36byte>::_Tidy /* DB: destroys 0x24-byte elements (string inside) and the block map; NetplayManager destructor 00906a90 NetplayManager::~NetplayManager 00923800 NetplayTextPopup::destructor void std::deque<36byte>::_Tidy(void) { char *this; void *pvVar1; void *ptr; undefined4 *in_ECX; int iVar2; uint size; iVar2 = in_ECX[4]; do { if (iVar2 == 0) goto LAB_00923ddd; this = *(char **)(in_ECX[1] + (iVar2 + in_ECX[3] + -1 & in_ECX[2] - 1) * 4); this[0x1c] = '\0'; this[0x1d] = '\0'; this[0x1e] = '\0'; this[0x1f] = '\0'; this[0x20] = '\0'; this[0x21] = '\0'; this[0x22] = '\0'; this[0x23] = '\0'; string::_Tidy_deallocate(this); iVar2 = in_ECX[4] + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; LAB_00923ddd: iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x24); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 00923e60 FUN_00923e60 void FUN_00923e60(void) { void *pvVar1; uint uVar2; uint uVar3; void *_Dst; int in_ECX; uint uVar4; size_t sVar5; size_t _Size; void *pvVar6; uVar2 = *(uint *)(in_ECX + 8); uVar3 = 1; if (uVar2 != 0) { uVar3 = uVar2; } for (; (uVar4 = uVar3 - uVar2, uVar4 == 0 || (uVar3 < 8)); uVar3 = uVar3 * 2) { if (0x71c71c7 - uVar3 < uVar3) { FUN_0040cad0(); LAB_00923f96: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } uVar2 = *(uint *)(in_ECX + 0xc); if (uVar3 < 0x40000000) { _Dst = std::_Allocate(uVar3 * 4); pvVar1 = (void *)(*(int *)(in_ECX + 4) + uVar2 * 4); pvVar6 = (void *)((int)_Dst + uVar2 * 4); sVar5 = (*(int *)(in_ECX + 8) * 4 - (int)pvVar1) + *(int *)(in_ECX + 4); memmove(pvVar6,pvVar1,sVar5); pvVar6 = (void *)(sVar5 + (int)pvVar6); if (uVar4 < uVar2) { sVar5 = uVar4 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); pvVar1 = (void *)(sVar5 + *(int *)(in_ECX + 4)); _Size = (*(int *)(in_ECX + 4) - (int)pvVar1) + uVar2 * 4; memmove(_Dst,pvVar1,_Size); memset((void *)(_Size + (int)_Dst),0,sVar5); } else { sVar5 = uVar2 * 4; memmove(pvVar6,*(void **)(in_ECX + 4),sVar5); memset((void *)((int)pvVar6 + sVar5),0,(uVar4 - uVar2) * 4); memset(_Dst,0,sVar5); } if (*(void **)(in_ECX + 4) != (void *)0x0) { deallocate(*(void **)(in_ECX + 4),*(uint *)(in_ECX + 8)); } *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + uVar4; *(void **)(in_ECX + 4) = _Dst; return; } goto LAB_00923f96; } //@@ 00923fa0 FUN_00923fa0 void FUN_00923fa0(int param_1) { int *piVar1; int iVar2; int *piVar3; int in_ECX; int iVar4; iVar2 = param_1; piVar1 = (int *)(in_ECX + 0xa8); param_1 = 10; iVar4 = 0; if (0 < iVar2) { iVar4 = iVar2; } *piVar1 = iVar4; piVar3 = ¶m_1; if (iVar4 < 10) { piVar3 = piVar1; } *piVar1 = *piVar3; return; } //@@ 00923fd0 FUN_00923fd0 void FUN_00923fd0(int param_1) { int *piVar1; int iVar2; int *piVar3; int in_ECX; int iVar4; iVar2 = param_1; piVar1 = (int *)(in_ECX + 0xac); param_1 = 10; iVar4 = 0; if (0 < iVar2) { iVar4 = iVar2; } *piVar1 = iVar4; piVar3 = ¶m_1; if (iVar4 < 10) { piVar3 = piVar1; } *piVar1 = *piVar3; return; } //@@ 00924000 OptionsConfig::reset_defaults /* DB: ? writes default option values (three 0.3f volumes at +0x18..+0x20, 1.0f scales, window size from glfw_get_window_size into +0x74/+0x78, 99 at +0x6c, ...) and clears the string at +0; callers OptionsConfig::Load (before parsing options.ini) and Manager::constructor */ void __thiscall OptionsConfig::reset_defaults(OptionsConfig *this) { int *piVar1; int unused; int local_c [2]; this->_musicVolume = 0.3; this->_sfxVolume = 0.3; this->_mapOpacity = 0.3; this->_isFullscreen = 0; this->_filterEnabled = 0; this->_exposure = 1.0; this->_brightness = 0.0; this->_gamma = 1.0; this->_contrast = 1.0; this->_controlHotplugEnabled = 1; this->_popupsMode = 1; this->_cameraStyle = 1; this->_historyHudMode = 0; this->_hudOffset = 1.0; this->_tryImportSave = 0; this->_enableMods = 1; this->_enableRumble = 1; this->_enableChargeBars = 0; this->_bossHpOnBottom = 1; this->_enableFoundHUD = 0; this->_enableBulletVisibility = 0; this->_enableAimLock = 1; this->_touchMode = 1; this->_ascentVoiceover = 1; this->_onlineHud = 0; this->_streamerMode = 0; this->_onlinePlayerVolume = 6; this->_onlinePlayerOpacity = 10; this->_onlineChatEnabled = 1; this->_onlineFilterEnabled = 1; this->_onlineColorSet = 0; this->_onlineInputDelay = 3; this->_itemInfoDisplayEnabled = 0; this->_announcerVoiceMode = 0; this->_enableDebugConsole = 0; this->_maxScale = 99; this->_maxRenderScale = 2; this->_enableVSync = 1; this->_enableSteamCloud = 1; this->_enablePauseOnFocusLost = 1; this->_enableMouseControl = 0; piVar1 = glfw_get_window_size(local_c,(int)this); this->_windowWidth = *piVar1; piVar1 = glfw_get_window_size(local_c,unused); this->_windowHeight = piVar1[1]; this->_windowPosX = 8; this->_windowPosY = 0x20; this->_consoleFont = 0; this->_enableFadedConsoleDisplay = 0; this->_enableSaveCommandHistory = 1; this->_enableBorderlessFullscreen = 0; this->_enableEpicOverlay = 1; this->_eosCrossplay = 0; this->_acceptedPublicBeta_VERSION = 0; this->_acceptedDataCollectionDisclaimer = 0; if ((this->_optionsIniFilePath)._capacity < 0x10) { (this->_optionsIniFilePath)._size = 0; (this->_optionsIniFilePath)._buf[0] = '\0'; return; } (this->_optionsIniFilePath)._size = 0; **(undefined1 **)(this->_optionsIniFilePath)._buf = 0; return; } //@@ 00924180 OptionsConfig::load_config_ini /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=Manager+0x2a33c (OptionsConfig) from Manager::Init: defaults the shader toggles to 1 then reads config.ini EnableBloom/Caustics/ColorCorrection/ColorModifier/Filter/Interpolation/Lighting/Pixelation/Shockwave/WaterSurface */ void __thiscall OptionsConfig::load_config_ini(OptionsConfig *this) { Manager *pMVar1; byte bVar2; uint uVar3; byte *extraout_EAX; byte *path; int *piVar4; int iVar5; void *pvVar6; uint uVar7; void *local_4c [2]; void *local_44 [4]; uint local_34; uint local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; pMVar1 = g_manager; puStack_c = &LAB_00b0a77d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; this->_enableColorCorrection = 1; this->_enableLighting = 1; this->_enableShockwave = 1; this->_enableCaustics = 1; this->_enableFilter = 1; this->_enablePixelation = 1; this->_enableBloom = 1; this->_enableWaterSurface = 1; this->_enableInterpolation = 1; this->_getsSetToEnableWaterSurface = 1; this->_enableColorModifier = 1; local_2c._capacity = 0xf; local_2c._size = 10; builtin_strncpy(local_2c._buf,"config.ini",0xb); local_8 = 0; local_14 = uVar3; ModManager::TryRedirectPath(&pMVar1->_modManager,(std_string *)local_44,&local_2c); local_8._0_1_ = 1; path = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { path = *(byte **)extraout_EAX; } piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); local_8 = (uint)local_8._1_3_ << 8; if (0xf < local_30) { uVar7 = local_30 + 1; pvVar6 = local_44[0]; if (0xfff < uVar7) { pvVar6 = *(void **)((int)local_44[0] + -4); uVar7 = local_30 + 0x24; if (0x1f < (uint)((int)local_44[0] + (-4 - (int)pvVar6))) goto LAB_009242ab; } operator_delete(pvVar6,uVar7); } local_8 = -1; local_34 = 0; local_30 = 0xf; local_44[0] = (void *)((uint)local_44[0] & 0xffffff00); if (0xf < local_2c._capacity) { uVar7 = local_2c._capacity + 1; pvVar6 = (void *)local_2c._buf._0_4_; if (0xfff < uVar7) { pvVar6 = *(void **)(local_2c._buf._0_4_ + -4); uVar7 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)pvVar6))) { LAB_009242ab: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar7); } if (piVar4 != (int *)0x0) { iVar5 = (**(code **)(*piVar4 + 4))(uVar3); pvVar6 = operator_new_tracked(iVar5 + 1); *(undefined1 *)((int)pvVar6 + iVar5) = 0; (**(code **)(*piVar4 + 0x14))(pvVar6,1,iVar5); (**(code **)*piVar4)(1); keyvalue_map_parse(pvVar6); local_8 = 3; tracked_alloc(1,pvVar6,0); local_8 = CONCAT31(local_8._1_3_,2); bVar2 = read_bool("EnableColorCorrection",1); this->_enableColorCorrection = bVar2; bVar2 = read_bool("EnableCaustics",1); this->_enableCaustics = bVar2; bVar2 = read_bool("EnableShockwave",1); this->_enableShockwave = bVar2; bVar2 = read_bool("EnableLighting",1); this->_enableLighting = bVar2; bVar2 = read_bool("EnableFilter",1); this->_enableFilter = bVar2; bVar2 = read_bool("EnablePixelation",1); this->_enablePixelation = bVar2; bVar2 = read_bool("EnableBloom",1); this->_enableBloom = bVar2; bVar2 = read_bool("EnableWaterSurface",1); this->_enableWaterSurface = bVar2; bVar2 = read_bool("EnableInterpolation",1); this->_enableInterpolation = bVar2; bVar2 = read_bool("EnableColorModifier",1); this->_enableColorModifier = bVar2; this->_getsSetToEnableWaterSurface = this->_enableWaterSurface; FUN_00431200(local_4c,*(undefined4 *)((int)local_4c[0] + 4)); operator_delete(local_4c[0],0x40); } ExceptionList = local_10; return; } //@@ 00924440 OptionsConfig::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON OptionsConfig::Load(path): reads options.ini keys (Fullscreen, MusicVolume, EnableMods, AcceptedPublicBeta_%s, OnlineInputDelay ...), calls OptionsConfig::Save; from 00952410 prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall OptionsConfig::Load(OptionsConfig *this,byte *path) { Manager *pMVar1; OptionsConfig *this_00; char cVar2; byte bVar3; undefined1 uVar4; int *piVar5; int iVar6; void *ptr; int iVar7; byte *pbVar8; byte *******pppppppbVar9; int unused; int unused_00; int unused_01; uint uVar10; byte *******pppppppbVar11; bool bVar12; float in_XMM0_Da; int local_80; byte *******local_7c; OptionsConfig *local_78; byte *local_74; byte local_6d; byte *******local_6c [2]; byte *local_64; undefined4 local_54; undefined4 local_50; byte *******local_4c [4]; int *local_3c; uint local_38; byte local_34 [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a7cd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_74 = path; local_78 = this; reset_defaults(this,local_14); pbVar8 = path; do { bVar3 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar3 != 0); std::string::assign((char *)this,path,(int)pbVar8 - (int)(path + 1)); piVar5 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,path); local_6d = 0; local_7c = (byte *******)piVar5; if (piVar5 == (int *)0x0) { local_38 = 0xf; local_4c[0] = (byte *******)0x0; pbVar8 = local_74; do { bVar3 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar3 != 0); local_3c = piVar5; std::string::assign((char *)local_4c,local_74,(int)pbVar8 - (int)(local_74 + 1)); local_8 = 0; local_74 = std::_Allocate(0x20); local_54 = 0x1c; local_50 = 0x1f; local_74[0] = 'B'; local_74[1] = 'i'; local_74[2] = 'n'; local_74[3] = 'd'; local_74[4] = 'i'; local_74[5] = 'n'; local_74[6] = 'g'; local_74[7] = ' '; local_74[8] = 'o'; local_74[9] = 'f'; local_74[10] = ' '; local_74[0xb] = 'I'; local_74[0xc] = 's'; local_74[0xd] = 'a'; local_74[0xe] = 'a'; local_74[0xf] = 'c'; in_XMM0_Da = 2.838854e+29; local_74[0x10] = 0x20; local_74[0x11] = 0x52; local_74[0x12] = 0x65; local_74[0x13] = 0x70; local_74[0x14] = 0x65; local_74[0x15] = 0x6e; local_74[0x16] = 0x74; local_74[0x17] = 0x61; local_74[0x18] = 'n'; local_74[0x19] = 'c'; local_74[0x1a] = 'e'; local_74[0x1b] = '+'; local_74[0x1c] = 0; local_8 = CONCAT31(local_8._1_3_,1); local_7c = (byte *******)local_4c; if (0xf < local_38) { local_7c = local_4c[0]; } local_64 = local_74; if ((int *)0x1b < local_3c) { piVar5 = (int *)0xffffffff; if (local_3c + -7 != (int *)0xffffffff) { piVar5 = local_3c + -7; } local_6d = *local_74; pppppppbVar11 = (byte *******)((int)piVar5 + (int)local_7c); LAB_00924554: if (*(byte *)pppppppbVar11 != local_6d) { LAB_009245a7: if (pppppppbVar11 == local_7c) goto LAB_009245c8; pppppppbVar11 = (byte *******)((int)pppppppbVar11 + -1); goto LAB_00924554; } uVar10 = 0x18; pppppppbVar9 = pppppppbVar11; pbVar8 = local_74; do { if (*pppppppbVar9 != *(byte *******)pbVar8) { bVar3 = (byte)*pppppppbVar9; bVar12 = bVar3 < *pbVar8; if ((((bVar3 == *pbVar8) && (bVar12 = *(byte *)((int)pppppppbVar9 + 1) < pbVar8[1], *(byte *)((int)pppppppbVar9 + 1) == pbVar8[1])) && (bVar12 = *(byte *)((int)pppppppbVar9 + 2) < pbVar8[2], *(byte *)((int)pppppppbVar9 + 2) == pbVar8[2])) && (bVar12 = *(byte *)((int)pppppppbVar9 + 3) < pbVar8[3], *(byte *)((int)pppppppbVar9 + 3) == pbVar8[3])) { uVar10 = 0; } else { uVar10 = -(uint)bVar12 | 1; } goto LAB_0092459a; } pppppppbVar9 = pppppppbVar9 + 1; pbVar8 = pbVar8 + 4; bVar12 = 3 < uVar10; uVar10 = uVar10 - 4; } while (bVar12); uVar10 = 0; LAB_0092459a: if (uVar10 != 0) goto LAB_009245a7; if ((int)pppppppbVar11 - (int)local_7c != 0xffffffff) { std::string::replace ((char *)local_4c,(int)pppppppbVar11 - (int)local_7c,0x1c, (byte *)"Binding of Isaac Afterbirth+",0x1c); } LAB_009245c8: this = local_78; } pppppppbVar11 = (byte *******)local_4c; if (0xf < local_38) { pppppppbVar11 = local_4c[0]; } piVar5 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)pppppppbVar11); local_7c = (byte *******)piVar5; if (piVar5 == (int *)0x0) { Save(this); operator_delete(local_74,0x20); if (local_38 < 0x10) { ExceptionList = local_10; return; } uVar10 = local_38 + 1; local_6c[0] = local_4c[0]; if (0xfff < uVar10) { local_6c[0] = (byte *******)local_4c[0][-1]; uVar10 = local_38 + 0x24; if ((byte *)0x1f < (byte *)((int)local_4c[0] + (-4 - (int)local_6c[0]))) { LAB_0092466d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto LAB_00924ce7; } local_6d = 1; operator_delete(local_74,0x20); local_8 = 0xffffffff; if (0xf < local_38) { uVar10 = local_38 + 1; pppppppbVar11 = local_4c[0]; if (0xfff < uVar10) { pppppppbVar11 = (byte *******)local_4c[0][-1]; uVar10 = local_38 + 0x24; if ((byte *)0x1f < (byte *)((int)local_4c[0] + (-4 - (int)pppppppbVar11))) goto LAB_0092466d; } operator_delete(pppppppbVar11,uVar10); } local_3c = (int *)0x0; local_38 = 0xf; local_4c[0] = (byte *******)((uint)local_4c[0] & 0xffffff00); } iVar6 = (**(code **)(*piVar5 + 4))(); ptr = operator_new_tracked(iVar6 + 1); pppppppbVar11 = local_7c; *(undefined1 *)((int)ptr + iVar6) = 0; (**(code **)((int)*local_7c + 0x14))(ptr,1,iVar6); (*(code *)**pppppppbVar11)(1); keyvalue_map_parse(ptr); local_8 = 3; tracked_alloc(1,ptr,0); local_8 = CONCAT31(local_8._1_3_,2); FUN_00684130("Language",0); Manager::validate_language(g_manager,unused); FUN_006843a0("MusicVolume"); this_00 = local_78; pMVar1 = g_manager; local_78->_musicVolume = in_XMM0_Da; (pMVar1->_musicManager)._isEnabled = 0.0 < in_XMM0_Da; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._volume = (pMVar1->_optionsConfig)._musicVolume; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._targetVolume = (pMVar1->_optionsConfig)._musicVolume; cVar2 = read_bool("MusicEnabled",1); if (cVar2 == '\0') { (g_manager->_musicManager)._isEnabled = 0; } FUN_006843a0("SFXVolume"); pMVar1 = g_manager; this_00->_sfxVolume = in_XMM0_Da; SoundEffects::ClearVolumeModifier(&pMVar1->_sfxManager); FUN_006843a0("MapOpacity"); this_00->_mapOpacity = in_XMM0_Da; bVar3 = read_bool("Filter",0); this_00->_filterEnabled = bVar3; FUN_006843a0("Exposure"); this_00->_exposure = in_XMM0_Da; FUN_006843a0("Brightness"); this_00->_brightness = in_XMM0_Da; FUN_006843a0("Gamma"); this_00->_gamma = in_XMM0_Da; FUN_006843a0("Contrast"); this_00->_contrast = in_XMM0_Da; bVar3 = read_bool("ControllerHotplug",1); this_00->_controlHotplugEnabled = bVar3; if (bVar3 != ((byte)(DAT_00c57b1c >> 1) & 1)) { if (bVar3 == 0) { DAT_00c57b1c = DAT_00c57b1c & 0xfffffffd; } else { (**(code **)(DAT_00c57b64 + 8))(FUN_00a220c0,2,0x1000,&PTR_vftable_00c57b18); DAT_00c57b1c = DAT_00c57b1c | 2; } } iVar6 = FUN_00684130("PopUps",1); this_00->_popupsMode = iVar6; iVar6 = FUN_00684130("CameraStyle",1); this_00->_cameraStyle = iVar6; iVar6 = FUN_00684130("ShowRecentItems",0); this_00->_historyHudMode = iVar6; FUN_006843a0("HudOffset"); this_00->_hudOffset = in_XMM0_Da; bVar3 = read_bool("TryImportSave",0); this_00->_tryImportSave = bVar3; bVar3 = read_bool("BossHpOnBottom",1); this_00->_bossHpOnBottom = bVar3; bVar3 = read_bool("FoundHUD",0); this_00->_enableFoundHUD = bVar3; bVar3 = read_bool("EnableMods",1); this_00->_enableMods = bVar3; bVar3 = read_bool("RumbleEnabled",1); this_00->_enableRumble = bVar3; bVar3 = read_bool("ChargeBars",0); this_00->_enableChargeBars = bVar3; bVar3 = read_bool("BulletVisibility",0); this_00->_enableBulletVisibility = bVar3; iVar6 = FUN_00684130("TouchMode",1); this_00->_touchMode = iVar6; bVar3 = read_bool("AimLock",1); this_00->_enableAimLock = bVar3; iVar6 = FUN_00684130("JacobEsauControls",1); this_00->_jacobEsauControls = iVar6; iVar6 = FUN_00684130("AscentVoiceOver",1); this_00->_ascentVoiceover = iVar6 != 0; iVar6 = FUN_00684130("OnlineHud",0); this_00->_onlineHud = iVar6; iVar7 = FUN_00684130("OnlinePlayerVolume",6); iVar6 = 0; if (0 < iVar7) { iVar6 = iVar7; } iVar7 = 10; if (iVar6 < 10) { iVar7 = iVar6; } this_00->_onlinePlayerVolume = iVar7; iVar7 = FUN_00684130("OnlinePlayerOpacity",10); iVar6 = 0; if (0 < iVar7) { iVar6 = iVar7; } iVar7 = 10; if (iVar6 < 10) { iVar7 = iVar6; } this_00->_onlinePlayerOpacity = iVar7; iVar6 = FUN_00684130("MultiplayerColorSet",0); this_00->_onlineColorSet = iVar6; iVar7 = FUN_00684130("OnlineInputDelay",3); iVar6 = 5; if (iVar7 < 5) { iVar6 = iVar7; } iVar7 = 1; if (1 < iVar6) { iVar7 = iVar6; } this_00->_onlineInputDelay = iVar7; bVar3 = read_bool("ItemInfoDisplayEnabled",0); this_00->_itemInfoDisplayEnabled = bVar3; sprintf(local_34,(byte *)"AcceptedPublicBeta_%s"); bVar3 = read_bool(local_34,0); this_00->_acceptedPublicBeta_VERSION = bVar3; bVar3 = read_bool("AcceptedDataCollectionDisclaimer",0); this_00->_acceptedDataCollectionDisclaimer = bVar3; bVar3 = read_bool("EnableDebugConsole",0); this_00->_enableDebugConsole = bVar3; iVar6 = FUN_00684130("AnnouncerVoiceMode",0); this_00->_announcerVoiceMode = iVar6; bVar3 = read_bool("OnlineChatEnabled",1); this_00->_onlineChatEnabled = bVar3; bVar3 = read_bool("OnlineChatFilterEnabled",1); this_00->_onlineFilterEnabled = bVar3; bVar3 = read_bool("StreamerMode",0); this_00->_streamerMode = bVar3; iVar6 = FUN_00684130("MaxScale",99); this_00->_maxScale = iVar6; iVar6 = FUN_00684130("MaxRenderScale",2); this_00->_maxRenderScale = iVar6; uVar4 = read_bool("VSync",1); set_vsync(this_00,uVar4); bVar3 = read_bool("PauseOnFocusLost",1); this_00->_enablePauseOnFocusLost = bVar3; bVar3 = read_bool("SteamCloud",1); this_00->_enableSteamCloud = bVar3; bVar3 = read_bool("MouseControl",0); this_00->_enableMouseControl = bVar3; glfwSetInputMode(g_glfwWindow,(bVar3 != 0) + 0x34001); iVar6 = FUN_00684130("ConsoleFont",0); this_00->_consoleFont = iVar6; bVar3 = read_bool("FadedConsoleDisplay",0); this_00->_enableFadedConsoleDisplay = bVar3; bVar3 = read_bool("SaveCommandHistory",1); this_00->_enableSaveCommandHistory = bVar3; bVar3 = read_bool("UseExclusiveFullscreen",0); this_00->_enableBorderlessFullscreen = bVar3; piVar5 = glfw_get_window_size(&local_80,unused_00); iVar6 = FUN_00684130("WindowWidth",*piVar5); this_00->_windowWidth = iVar6; piVar5 = glfw_get_window_size(&local_80,unused_01); iVar6 = FUN_00684130("WindowHeight",piVar5[1]); this_00->_windowHeight = iVar6; iVar6 = FUN_00684130("WindowPosX",0); if ((iVar6 < 8) || (0xffff < iVar6)) { iVar6 = 8; } iVar7 = FUN_00684130("WindowPosY",0); if ((iVar7 < 8) || (0xffff < iVar7)) { iVar7 = 0x20; } this_00->_windowPosX = iVar6; this_00->_windowPosY = iVar7; glfw_set_window_pos(iVar6,iVar7); bVar3 = read_bool("Fullscreen",0); set_fullscreen(this_00,bVar3); bVar3 = read_bool("EnableEpicOverlay",1); this_00->_enableEpicOverlay = bVar3; iVar6 = FUN_00684130("EosCrossplay",0); this_00->_eosCrossplay = iVar6; if (local_6d != 0) { this_00->_gamma = 1.0; this_00->_hudOffset = 1.0; } FUN_00431200(local_6c,local_6c[0][1]); uVar10 = 0x40; LAB_00924ce7: operator_delete(local_6c[0],uVar10); ExceptionList = local_10; return; } //@@ 00924d10 OptionsConfig::Save /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void OptionsConfig::Save(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall OptionsConfig::Save(OptionsConfig *this) { byte bVar1; char cVar2; int *piVar3; byte *pbVar4; char *pcVar5; byte abStackY_4a4 [128]; byte abStack_31e [2]; byte abStack_22e [2]; byte abStack_1e6 [2]; byte abStack_1b6 [2]; byte abStack_19e [2]; undefined4 uStack_190; undefined1 auStack_174 [2]; byte abStack_172 [6]; byte abStack_16c [12]; byte abStack_160 [12]; byte abStack_154 [12]; byte local_148 [260]; uint local_44; local_44 = __security_cookie ^ (uint)auStack_174; if (0xf < (this->_optionsIniFilePath)._capacity) { this = *(OptionsConfig **)(this->_optionsIniFilePath)._buf; } piVar3 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,(byte *)this,0); if (piVar3 == (int *)0x0) { uStack_190 = 0x924d6c; KAGE_LogMessage(1,(byte *)"[warn] could not opn %s for writing. options will not be saved.\n"); return; } uStack_190 = 0x924d98; sprintf_s(local_148,0x100,(byte *)"[Options]\r\n"); pbVar4 = local_148; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); uStack_190 = 0x924dba; (**(code **)(*piVar3 + 0x1c))(); uStack_190 = *(int *)&g_manager->_stringTable; sprintf_s(abStack_154,0x100,(byte *)"Language=%d\r\n"); pbVar4 = abStack_154; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); uStack_190 = (int)pbVar4 - (int)(abStack_154 + 1); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_160,0x100,(byte *)"MusicVolume=%.4f\r\n"); pbVar4 = abStack_160; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_16c,0x100,(byte *)"MusicEnabled=%d\r\n"); pbVar4 = abStack_16c; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(auStack_174 + -4,0x100,(byte *)"SFXVolume=%.4f\r\n"); pcVar5 = auStack_174 + -4; do { cVar2 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar2 != '\0'); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(auStack_174 + -0x10,0x100,(byte *)"MapOpacity=%.4f\r\n"); pcVar5 = auStack_174 + -0x10; do { cVar2 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar2 != '\0'); (**(code **)(*piVar3 + 0x1c))(); sprintf_s((byte *)&uStack_190,0x100,(byte *)"Fullscreen=%d\r\n"); pcVar5 = (char *)&uStack_190; do { cVar2 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar2 != '\0'); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_19e + 2,0x100,(byte *)"Filter=%d\r\n"); pbVar4 = abStack_19e + 2; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_19e + -10,0x100,(byte *)"Exposure=%.4f\r\n"); pbVar4 = abStack_19e + -10; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1b6 + 2,0x100,(byte *)"Gamma=%.4f\r\n"); pbVar4 = abStack_1b6 + 2; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1b6 + -10,0x100,(byte *)"ControllerHotplug=%d\r\n"); pbVar4 = abStack_1b6 + -10; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1b6 + -0x16,0x100,(byte *)"PopUps=%d\r\n"); pbVar4 = abStack_1b6 + -0x16; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1e6 + 0xe,0x100,(byte *)"CameraStyle=%d\r\n"); pbVar4 = abStack_1e6 + 0xe; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1e6 + 2,0x100,(byte *)"ShowRecentItems=%d\r\n"); pbVar4 = abStack_1e6 + 2; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1e6 + -10,0x100,(byte *)"HudOffset=%.4f\r\n"); pbVar4 = abStack_1e6 + -10; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1e6 + -0x16,0x100,(byte *)"TryImportSave=%d\r\n"); pbVar4 = abStack_1e6 + -0x16; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_1e6 + -0x22,0x100,(byte *)"FoundHUD=%d\r\n"); pbVar4 = abStack_1e6 + -0x22; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + 0x1a,0x100,(byte *)"EnableMods=%d\r\n"); pbVar4 = abStack_22e + 0x1a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + 0xe,0x100,(byte *)"RumbleEnabled=%d\r\n"); pbVar4 = abStack_22e + 0xe; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + 2,0x100,(byte *)"ChargeBars=%d\r\n"); pbVar4 = abStack_22e + 2; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -10,0x100,(byte *)"BulletVisibility=%d\r\n"); pbVar4 = abStack_22e + -10; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x16,0x100,(byte *)"TouchMode=%d\r\n"); pbVar4 = abStack_22e + -0x16; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x22,0x100,(byte *)"AimLock=%d\r\n"); pbVar4 = abStack_22e + -0x22; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x2e,0x100,(byte *)"JacobEsauControls=%d\r\n"); pbVar4 = abStack_22e + -0x2e; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x3a,0x100,(byte *)"AscentVoiceOver=%d\r\n"); pbVar4 = abStack_22e + -0x3a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x46,0x100,(byte *)"OnlineHud=%d\r\n"); pbVar4 = abStack_22e + -0x46; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x52,0x100,(byte *)"StreamerMode=%d\r\n"); pbVar4 = abStack_22e + -0x52; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x5e,0x100,(byte *)"OnlinePlayerVolume=%d\r\n"); pbVar4 = abStack_22e + -0x5e; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x6a,0x100,(byte *)"OnlinePlayerOpacity=%d\r\n"); pbVar4 = abStack_22e + -0x6a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_22e + -0x76,0x100,(byte *)"OnlineChatEnabled=%d\r\n"); pbVar4 = abStack_22e + -0x76; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x6e,0x100,(byte *)"OnlineChatFilterEnabled=%d\r\n"); pbVar4 = abStack_31e + 0x6e; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x62,0x100,(byte *)"MultiplayerColorSet=%d\r\n"); pbVar4 = abStack_31e + 0x62; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x56,0x100,(byte *)"OnlineInputDelay=%d\r\n"); pbVar4 = abStack_31e + 0x56; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x4a,0x100,(byte *)"ItemInfoDisplayEnabled=%d\r\n"); pbVar4 = abStack_31e + 0x4a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x3e,0x100,(byte *)"AcceptedPublicBeta_%s=%d\r\n"); pbVar4 = abStack_31e + 0x3e; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x32,0x100,(byte *)"AcceptedDataCollectionDisclaimer=%d\r\n"); pbVar4 = abStack_31e + 0x32; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x26,0x100,(byte *)"EnableDebugConsole=%d\r\n"); pbVar4 = abStack_31e + 0x26; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0x1a,0x100,(byte *)"MaxScale=%d\r\n"); pbVar4 = abStack_31e + 0x1a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 0xe,0x100,(byte *)"MaxRenderScale=%d\r\n"); pbVar4 = abStack_31e + 0xe; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + 2,0x100,(byte *)"VSync=%d\r\n"); pbVar4 = abStack_31e + 2; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -10,0x100,(byte *)"PauseOnFocusLost=%d\r\n"); pbVar4 = abStack_31e + -10; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x16,0x100,(byte *)"SteamCloud=%d\r\n"); pbVar4 = abStack_31e + -0x16; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x22,0x100,(byte *)"MouseControl=%d\r\n"); pbVar4 = abStack_31e + -0x22; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x2e,0x100,(byte *)"BossHpOnBottom=%d\r\n"); pbVar4 = abStack_31e + -0x2e; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x3a,0x100,(byte *)"AnnouncerVoiceMode=%d\r\n"); pbVar4 = abStack_31e + -0x3a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x46,0x100,(byte *)"ConsoleFont=%d\r\n"); pbVar4 = abStack_31e + -0x46; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x52,0x100,(byte *)"FadedConsoleDisplay=%d\r\n"); pbVar4 = abStack_31e + -0x52; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x5e,0x100,(byte *)"SaveCommandHistory=%d\r\n"); pbVar4 = abStack_31e + -0x5e; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x6a,0x100,(byte *)"WindowWidth=%d\r\n"); pbVar4 = abStack_31e + -0x6a; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s(abStack_31e + -0x76,0x100,(byte *)"WindowHeight=%d\r\n"); pbVar4 = abStack_31e + -0x76; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(); sprintf_s((byte *)((int)register0x00000010 + -0x3a0),0x100,(byte *)"WindowPosX=%d\r\n"); pcVar5 = (char *)((int)register0x00000010 + -0x3a0); do { cVar2 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar2 != '\0'); (**(code **)(*piVar3 + 0x1c))((int)register0x00000010 + -0x3a0,1); sprintf_s(abStackY_4a4 + 0xf8,0x100,(byte *)"WindowPosY=%d\r\n"); pbVar4 = abStackY_4a4 + 0xf8; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(abStackY_4a4 + 0xf8,1,(int)pbVar4 - (int)(abStackY_4a4 + 0xf9)); sprintf_s(abStackY_4a4 + 0xec,0x100,(byte *)"UseExclusiveFullscreen=%d\r\n"); pbVar4 = abStackY_4a4 + 0xec; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(abStackY_4a4 + 0xec,1,(int)pbVar4 - (int)(abStackY_4a4 + 0xed)); sprintf_s(abStackY_4a4 + 0xe0,0x100,(byte *)"EnableEpicOverlay=%d\r\n"); pbVar4 = abStackY_4a4 + 0xe0; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(abStackY_4a4 + 0xe0,1,(int)pbVar4 - (int)(abStackY_4a4 + 0xe1)); sprintf_s(abStackY_4a4 + 0xd4,0x100,(byte *)"EosCrossplay=%d\r\n"); pbVar4 = abStackY_4a4 + 0xd4; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(abStackY_4a4 + 0xd4,1,(int)pbVar4 - (int)(abStackY_4a4 + 0xd5)); sprintf_s(abStackY_4a4 + 200,0x100,&DAT_00b657f8); pbVar4 = abStackY_4a4 + 200; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); (**(code **)(*piVar3 + 0x1c))(abStackY_4a4 + 200,1,(int)pbVar4 - (int)(abStackY_4a4 + 0xc9)); (**(code **)*piVar3)(1); return; } //@@ 00925bc0 FUN_00925bc0 void FUN_00925bc0(int param_1) { int *piVar1; int in_ECX; int *piVar2; int local_c [2]; local_c[1] = 5; piVar2 = ¶m_1; if (4 < param_1) { piVar2 = local_c + 1; } piVar1 = local_c; if (1 < *piVar2) { piVar1 = piVar2; } *(int *)(in_ECX + 0xb8) = *piVar1; return; } //@@ 00925c00 OptionsConfig::SetMusicVolume /* ZHL [exact] __thiscall void OptionsConfig::SetMusicVolume(float volume); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall OptionsConfig::SetMusicVolume(OptionsConfig *this,float volume) { Manager *pMVar1; pMVar1 = g_manager; this->_musicVolume = volume; (pMVar1->_musicManager)._isEnabled = 0.0 < volume; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._volume = (pMVar1->_optionsConfig)._musicVolume; (pMVar1->_musicManager)._channels[(pMVar1->_musicManager)._currentChannel]._targetVolume = (pMVar1->_optionsConfig)._musicVolume; return; } //@@ 00925c60 OptionsConfig::set_fullscreen /* DB: thiscall OptionsConfig: stores the bool at +0x24, switches the window (FUN_00a196b0(fullscreen, +0x66)); when windowed restores window pos (+0x74/+0x78), size (+0x7c/+0x80) and sets cursor mode GLFW_CURSOR 0x34001+(+0x6a); OptionsConfig::Load, Menu_Options::Update prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall OptionsConfig::set_fullscreen(OptionsConfig *this,byte isFullscreen) { undefined3 in_stack_00000005; int local_10; int local_c; this->_isFullscreen = isFullscreen; KAGE_Graphics::set_fullscreen(_isFullscreen,this->_enableBorderlessFullscreen); if (this->_isFullscreen == 0) { local_10 = this->_windowWidth; local_c = this->_windowHeight; FUN_00a19450(&local_10); glfw_set_window_pos(this->_windowPosX,this->_windowPosY); glfwSetInputMode(g_glfwWindow,(this->_enableMouseControl != 0) + 0x34001); } return; } //@@ 00925ce0 OptionsConfig::set_vsync /* DB: ECX=OptionsConfig: stores +0x67, warns "Display Hz: %d, Target: 60.. disabling vsync", toggles g_graphicsManager_flags 0x200; OptionsConfig::Load ("VSync") and the Lua Options.VSync setter 00896ff0 */ void __thiscall OptionsConfig::set_vsync(OptionsConfig *this,uint param_2) { int iVar1; uint uVar2; int iVar3; byte bVar4; float fVar5; float fVar6; this->_enableVSync = (byte)param_2; bVar4 = (byte)param_2; if ((byte)param_2 != 0) { iVar1 = window_get_current_monitor(); if (iVar1 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0x1c1); } if (_glfw == 0) { _glfwInputError(0x10001,0); uVar2 = 0; } else { iVar3 = (*DAT_00c736fc)(iVar1,iVar1 + 0x98U); uVar2 = -(uint)(iVar3 != 0) & iVar1 + 0x98U; } fVar5 = (float)*(int *)(uVar2 + 0x14) / 60.0; FUN_00925f30(); fVar6 = 1.0 - fVar5; if (fVar5 <= 1.0 - fVar5) { fVar6 = fVar5; } if (0.04 < fVar6) { KAGE_LogMessage(1,(byte *)"Display Hz: %d, Target: 60.. disabling vsync for this session.\n"); param_2 = param_2 & 0xffffff00; bVar4 = 0; } } if (bVar4 != ((byte)(g_graphicsManager_flags >> 9) & 1)) { if (bVar4 == 0) { g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffdff; } else { g_graphicsManager_flags = g_graphicsManager_flags | 0x200; } FUN_00a1a470(param_2); } return; } //@@ 00925df0 FUN_00925df0 void FUN_00925df0(void) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { return; } return; } //@@ 00925e30 file_copy_to_save_data /* DB: (src, dst) -> bool: FileSystem::Open + read all, SaveDataManager::open_file_write(dst) + write; Manager::Init copies options.ini from older Isaac install dirs */ bool file_copy_to_save_data(byte *param_1,byte *param_2) { uint uVar1; int *piVar2; void *ptr; undefined4 uVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar2 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar2 != (int *)0x0) { (**(code **)(*piVar2 + 0xc))(0,0,uVar1); uVar1 = (**(code **)(*piVar2 + 4))(); ptr = operator_new_tracked(uVar1); uVar3 = (**(code **)(*piVar2 + 0x14))(ptr,uVar1,1); (**(code **)*piVar2)(1); if (ptr != (void *)0x0) { piVar2 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,param_2,0); if (piVar2 != (int *)0x0) { (**(code **)(*piVar2 + 0x1c))(ptr,1,uVar3); (**(code **)*piVar2)(1); } local_8 = 0; tracked_alloc(1,ptr,0); ExceptionList = local_10; return piVar2 != (int *)0x0; } } ExceptionList = local_10; return false; } //@@ 00925f30 FUN_00925f30 void FUN_00925f30(void) { float *in_ECX; float in_XMM0_Da; double local_50 [9]; modf((double)in_XMM0_Da,local_50); *in_ECX = (float)local_50[0]; return; } //@@ 00925f80 PersistentGameData::constructor /* ZHL [exact] __thiscall PersistentGameData* PersistentGameData::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ PersistentGameData * __thiscall PersistentGameData::constructor(PersistentGameData *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a81b; local_10 = ExceptionList; ExceptionList = &local_10; this->_saveFile = (void *)0x0; *(undefined4 *)&this->field_0x8 = 0; *(undefined4 *)&this->field_0x18 = 0; *(undefined4 *)&this->field_0x1c = 0xf; this->field_0x8 = 0; *(undefined4 *)&this->field_0x20 = 0; *(undefined4 *)&this->field_0x30 = 0; *(undefined4 *)&this->field_0x34 = 0xf; this->field_0x20 = 0; local_8 = 1; PersistentGameData_Bestiary::constructor ((PersistentGameData_Bestiary *)&this->_bestiaryEncounters); Clear(this,1); ExceptionList = local_10; return this; } //@@ 00926020 PersistentGameData_Bestiary::constructor /* ZHL [exact] __thiscall PersistentGameData_Bestiary* PersistentGameData_Bestiary::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ PersistentGameData_Bestiary * __thiscall PersistentGameData_Bestiary::constructor(PersistentGameData_Bestiary *this) { PersistentGameData_Bestiary PVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a863; local_10 = ExceptionList; ExceptionList = &local_10; *this = (PersistentGameData_Bestiary)0x0; this[1] = (PersistentGameData_Bestiary)0x0; PVar1 = (PersistentGameData_Bestiary)operator_new(0x18); *(PersistentGameData_Bestiary *)PVar1 = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 4) = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 8) = PVar1; *(undefined2 *)((int)PVar1 + 0xc) = 0x101; *this = PVar1; local_8 = 0; this[2] = (PersistentGameData_Bestiary)0x0; this[3] = (PersistentGameData_Bestiary)0x0; PVar1 = (PersistentGameData_Bestiary)operator_new(0x18); *(PersistentGameData_Bestiary *)PVar1 = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 4) = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 8) = PVar1; *(undefined2 *)((int)PVar1 + 0xc) = 0x101; this[2] = PVar1; local_8._0_1_ = 1; this[4] = (PersistentGameData_Bestiary)0x0; this[5] = (PersistentGameData_Bestiary)0x0; PVar1 = (PersistentGameData_Bestiary)operator_new(0x18); *(PersistentGameData_Bestiary *)PVar1 = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 4) = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 8) = PVar1; *(undefined2 *)((int)PVar1 + 0xc) = 0x101; this[4] = PVar1; local_8 = CONCAT31(local_8._1_3_,2); this[6] = (PersistentGameData_Bestiary)0x0; this[7] = (PersistentGameData_Bestiary)0x0; PVar1 = (PersistentGameData_Bestiary)operator_new(0x18); *(PersistentGameData_Bestiary *)PVar1 = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 4) = PVar1; *(PersistentGameData_Bestiary *)((int)PVar1 + 8) = PVar1; *(undefined2 *)((int)PVar1 + 0xc) = 0x101; this[6] = PVar1; ExceptionList = local_10; return this; } //@@ 00926120 PersistentGameData_Bestiary::~PersistentGameData_Bestiary /* DB: erases the four std::map at +0x18/+0x10/+8/+0 (0x18-byte nodes), the exact inverse of PersistentGameData_Bestiary::constructor (00926020, four 0x18 tree heads); callers include Manager::destructor and the save loaders prototype: db/protos.zhl */ void __thiscall PersistentGameData_Bestiary::~PersistentGameData_Bestiary(PersistentGameData_Bestiary *this) { PersistentGameData_Bestiary *pPVar1; pPVar1 = this + 6; FID_conflict__Erase_tree_>_> (pPVar1,(fuzzer_allocator_> *)pPVar1, *(_Tree_node **)((int)this[6] + 4)); operator_delete((void *)*pPVar1,0x18); pPVar1 = this + 4; FID_conflict__Erase_tree_>_> (pPVar1,(fuzzer_allocator_> *)pPVar1, *(_Tree_node **)((int)this[4] + 4)); operator_delete((void *)*pPVar1,0x18); pPVar1 = this + 2; FID_conflict__Erase_tree_>_> (pPVar1,(fuzzer_allocator_> *)pPVar1, *(_Tree_node **)((int)this[2] + 4)); operator_delete((void *)*pPVar1,0x18); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)((int)*this + 4)); operator_delete((void *)*this,0x18); return; } //@@ 009261a0 PersistentGameData::copy_constructor /* DB: ? inits strings +8/+0x20, PersistentGameData_Bestiary::constructor at +0xf64, then copies from param (FUN_00929010); Menu_Save::load_slot_data on g_manager->_persistentGameData */ void PersistentGameData::copy_constructor(undefined4 param_1) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0a8a9; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0xf; *(undefined1 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x30) = 0; *(undefined4 *)(in_ECX + 0x34) = 0xf; *(undefined1 *)(in_ECX + 0x20) = 0; local_8 = 1; PersistentGameData_Bestiary::constructor((PersistentGameData_Bestiary *)(in_ECX + 0xf64)); local_8 = CONCAT31(local_8._1_3_,2); operator_assign(param_1); ExceptionList = local_10; return; } //@@ 00926240 FUN_00926240 void FUN_00926240(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(undefined4 **)(in_ECX + 4) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 4))(1,__security_cookie ^ (int)register0x00000010 - 4U); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)(in_ECX + 0xf64)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 009262b0 PersistentGameData::Clear /* ZHL [exact] __thiscall void PersistentGameData::Clear(bool unk); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PersistentGameData::Clear(PersistentGameData *this,byte unk) { std_map *psVar1; undefined1 *this_00; void *pvVar2; int iVar3; int *piVar4; *(undefined4 *)&this->field_0xf84 = 0; if (unk != 0) { *(undefined4 *)&this->field_0xf88 = 0; } memset(this->_achievements,0,0x282); memset(&this->field_0xae8,0,0x2dd); piVar4 = this->_eventCounters; for (iVar3 = 0x20b; iVar3 != 0; iVar3 = iVar3 + -1) { *piVar4 = 0; piVar4 = piVar4 + 1; } *(undefined4 *)&this->field_0xdc8 = 0; *(undefined4 *)&this->field_0xdcc = 0; *(undefined4 *)&this->field_0xdd0 = 0; *(undefined4 *)&this->field_0xdd4 = 0; *(undefined4 *)&this->field_0xdd8 = 0; *(undefined4 *)&this->field_0xddc = 0; *(undefined4 *)&this->field_0xde0 = 0; *(undefined4 *)&this->field_0xde4 = 0; *(undefined4 *)&this->field_0xde8 = 0; *(undefined4 *)&this->field_0xdec = 0; *(undefined4 *)&this->field_0xdf0 = 0; *(undefined4 *)&this->field_0xdf4 = 0; *(undefined8 *)&this->field_0xdf8 = 0; *(undefined4 *)&this->field_0xe00 = 0; *(undefined2 *)&this->field_0xe04 = 0; this->field_0xe06 = 0; memset(&this->field_0xe07,0,0x68); memset(&this->field_0xe6f,0,0x2e); this->_cutsceneCounters[0] = 0; this->_cutsceneCounters[1] = 0; this->_cutsceneCounters[2] = 0; this->_cutsceneCounters[3] = 0; this->_cutsceneCounters[4] = 0; this->_cutsceneCounters[5] = 0; this->_cutsceneCounters[6] = 0; this->_cutsceneCounters[7] = 0; this->_cutsceneCounters[8] = 0; this->_cutsceneCounters[9] = 0; this->_cutsceneCounters[10] = 0; this->_cutsceneCounters[0xb] = 0; this->_cutsceneCounters[0xc] = 0; this->_cutsceneCounters[0xd] = 0; this->_cutsceneCounters[0xe] = 0; this->_cutsceneCounters[0xf] = 0; this->_cutsceneCounters[0x10] = 0; this->_cutsceneCounters[0x11] = 0; this->_cutsceneCounters[0x12] = 0; this->_cutsceneCounters[0x13] = 0; this->_cutsceneCounters[0x14] = 0; this->_cutsceneCounters[0x15] = 0; this->_cutsceneCounters[0x16] = 0; this->_cutsceneCounters[0x17] = 0; this->_cutsceneCounters[0x18] = 0; this->_cutsceneCounters[0x19] = 0; this->_cutsceneCounters[0x1a] = 0; this->_lastDifficulty = 0; this->_characterMenuShown = 0; memset(&this->field_0xf14,0,0x50); pvVar2 = (this->_bestiaryDeaths)._head; FID_conflict__Erase_tree_>_> (&this->_bestiaryDeaths, (fuzzer_allocator_> *)&this->_bestiaryDeaths, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (this->_bestiaryDeaths)._size = 0; psVar1 = &this->_bestiaryEncounters; pvVar2 = psVar1->_head; FID_conflict__Erase_tree_>_> (psVar1,(fuzzer_allocator_> *)psVar1, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (this->_bestiaryEncounters)._size = 0; this_00 = &this->field_0xf74; iVar3 = *(int *)this_00; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(iVar3 + 4)); *(int *)(iVar3 + 4) = iVar3; *(int *)iVar3 = iVar3; *(int *)(iVar3 + 8) = iVar3; *(undefined4 *)&this->field_0xf78 = 0; psVar1 = &this->_bestiaryKills; pvVar2 = psVar1->_head; FID_conflict__Erase_tree_>_> (psVar1,(fuzzer_allocator_> *)psVar1, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (this->_bestiaryKills)._size = 0; *(undefined2 *)this = 0; this->_isSteamAchievementsEnabled = 1; this->_isFileLoaded = 1; return; } //@@ 00926460 FUN_00926460 void FUN_00926460(byte param_1) { Manager *pMVar1; int *piVar2; PersistentGameData *in_ECX; PersistentGameData::Clear(in_ECX,param_1); pMVar1 = g_manager; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar2 == 0) || ((pMVar1->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(in_ECX); return; } PersistentGameData::SaveToSteamCloud(in_ECX); return; } //@@ 009264b0 FUN_009264b0 uint FUN_009264b0(byte *param_1,byte *param_2) { byte bVar1; byte *pbVar2; byte *pbVar3; bool bVar4; if (((*param_1 & 2) == 0) || ((*param_2 & 2) != 0)) { pbVar2 = *(byte **)(param_2 + 4); pbVar3 = *(byte **)(param_1 + 4); do { bVar1 = *pbVar3; bVar4 = bVar1 < *pbVar2; if (bVar1 != *pbVar2) { LAB_009264f0: param_2 = (byte *)(-(uint)bVar4 | 1); goto LAB_009264f5; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar4 = bVar1 < pbVar2[1]; if (bVar1 != pbVar2[1]) goto LAB_009264f0; pbVar3 = pbVar3 + 2; pbVar2 = pbVar2 + 2; } while (bVar1 != 0); param_2 = (byte *)0x0; LAB_009264f5: if (-1 < (int)param_2) { return CONCAT31((int3)((uint)param_2 >> 8),1); } } return (uint)param_2 & 0xffffff00; } //@@ 00926510 save_backup_find_latest /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? no ECX; lists "%s/save_backups/" (FUN_00a163f0), sorts names, keeps files whose name matches PersistentGameData::get_save_file_name after an 8-digit timestamp prefix, PersistentGameData::Load's each into a stack copy and returns the newest timestamp that loads; caller FUN_009d98f0 (save menu) */ int save_backup_find_latest(void) { uint *ptr; byte bVar1; char *pcVar2; qword qVar3; char cVar4; uint uVar5; void *pvVar6; void *pvVar7; void *pvVar8; byte *pbVar9; byte *pbVar10; uint uVar11; int iVar12; PersistentGameData *in_ECX; uint uVar13; uint uVar14; char *pcVar15; byte *pbVar16; int *piVar17; qword *pqVar18; bool bVar19; longlong lVar20; int local_15c4; uint local_15bc; undefined1 local_15b8 [8]; void *local_15b0; undefined4 local_15a0; uint local_159c; void *local_1598; undefined4 local_1588; uint local_1584; PersistentGameData_Bestiary local_654 [11]; byte local_628 [1540]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_628 + 0x624; local_14 = 0xffffffff; puStack_18 = &LAB_00b0a8f6; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_628 + 0x618); ExceptionList = &local_1c; local_15bc = 0; local_24 = uVar5; sprintf(&DAT_00c93e50,(byte *)"%s/save_backups/"); pvVar6 = (void *)filesys_list_directory_mounts(&DAT_00c93e50,&local_15bc); uVar11 = local_15bc; pvVar7 = operator_new_tracked (-(uint)((int)((ulonglong)local_15bc * 4 >> 0x20) != 0) | (uint)((ulonglong)local_15bc * 4)); uVar13 = 0; if (uVar11 != 0) { if (0xf < uVar11) { uVar14 = uVar13; piVar17 = (int *)((int)pvVar7 + 0x20); do { lVar20 = SUB168(ZEXT416(3),0); piVar17[-8] = (uVar14 << lVar20) + (int)pvVar6; piVar17[-7] = (uVar14 + 1 << lVar20) + (int)pvVar6; piVar17[-6] = (uVar14 + 2 << lVar20) + (int)pvVar6; piVar17[-5] = (uVar14 + 3 << lVar20) + (int)pvVar6; piVar17[-4] = (uVar14 + 4 << lVar20) + (int)pvVar6; piVar17[-3] = (uVar14 + 5 << lVar20) + (int)pvVar6; piVar17[-2] = (uVar14 + 6 << lVar20) + (int)pvVar6; piVar17[-1] = (uVar14 + 7 << lVar20) + (int)pvVar6; uVar13 = uVar14 + 0x10; *piVar17 = (uVar14 + 8 << lVar20) + (int)pvVar6; piVar17[1] = (uVar14 + 9 << lVar20) + (int)pvVar6; piVar17[2] = (uVar14 + 10 << lVar20) + (int)pvVar6; piVar17[3] = (uVar14 + 0xb << lVar20) + (int)pvVar6; piVar17[4] = (uVar14 + 0xc << lVar20) + (int)pvVar6; piVar17[5] = (uVar14 + 0xd << lVar20) + (int)pvVar6; piVar17[6] = (uVar14 + 0xe << lVar20) + (int)pvVar6; piVar17[7] = (uVar14 + 0xf << lVar20) + (int)pvVar6; uVar14 = uVar13; piVar17 = piVar17 + 0x10; } while (uVar13 < (uVar11 & 0xfffffff0)); } if (uVar13 < uVar11) { pvVar8 = (void *)((int)pvVar6 + uVar13 * 8); do { *(void **)((int)pvVar7 + uVar13 * 4) = pvVar8; uVar13 = uVar13 + 1; pvVar8 = (void *)((int)pvVar8 + 8); } while (uVar13 < uVar11); } } std::_Sort_unchecked<4byte>((int)(uVar11 * 4) >> 2,FUN_009264b0,uVar5); pbVar9 = PersistentGameData::get_save_file_name(in_ECX); uVar5 = 0; local_15c4 = 0; if (uVar11 != 0) { uVar11 = local_15bc; do { pbVar16 = *(byte **)((int)pvVar7 + uVar5 * 4); if ((*pbVar16 & 1) != 0) { pcVar2 = *(char **)(pbVar16 + 4); pcVar15 = pcVar2; do { cVar4 = *pcVar15; pcVar15 = pcVar15 + 1; } while (cVar4 != '\0'); if (9 < (uint)((int)pcVar15 - (int)(pcVar2 + 1))) { pbVar16 = (byte *)(pcVar2 + 9); pbVar10 = pbVar9; do { bVar1 = *pbVar16; bVar19 = bVar1 < *pbVar10; if (bVar1 != *pbVar10) { LAB_00926750: uVar11 = -(uint)bVar19 | 1; goto LAB_00926755; } if (bVar1 == 0) break; bVar1 = pbVar16[1]; bVar19 = bVar1 < pbVar10[1]; if (bVar1 != pbVar10[1]) goto LAB_00926750; pbVar16 = pbVar16 + 2; pbVar10 = pbVar10 + 2; } while (bVar1 != 0); uVar11 = 0; LAB_00926755: if ((uVar11 == 0) && (iVar12 = (int)pcVar2[7] + ((int)pcVar2[6] + ((int)pcVar2[5] + ((int)pcVar2[4] + ((int)pcVar2[3] + ((int)pcVar2[2] + ((int)pcVar2[1] + *pcVar2 * 10) * 10) * 10) * 10) * 10) * 10) * 10 + -0x1fca0550, local_15c4 < iVar12)) { local_15b8._4_4_ = (undefined4 *)0x0; local_15a0 = 0; local_159c = 0xf; local_15b0 = (void *)0x0; local_1588 = 0; local_1584 = 0xf; local_1598 = (void *)0x0; local_14 = 1; PersistentGameData_Bestiary::constructor(local_654); PersistentGameData::Clear((PersistentGameData *)local_15b8,1); local_14 = 2; sprintf(&DAT_00c93e50,(byte *)"%s/save_backups/"); sprintf_s(local_628,0x600,&DAT_00b60c28); cVar4 = PersistentGameData::Load((PersistentGameData *)local_15b8,local_628); if (cVar4 != '\0') { local_15c4 = iVar12; } local_14 = 3; if ((undefined4 *)local_15b8._4_4_ != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_15b8._4_4_)(1); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary(local_654); if (0xf < local_1584) { uVar11 = local_1584 + 1; pvVar8 = local_1598; if (0xfff < uVar11) { pvVar8 = *(void **)((int)local_1598 + -4); uVar11 = local_1584 + 0x24; if (0x1f < (uint)((int)local_1598 + (-4 - (int)pvVar8))) goto LAB_009269fc; } operator_delete(pvVar8,uVar11); } local_1588 = 0; local_1584 = 0xf; local_1598 = (void *)((uint)local_1598 & 0xffffff00); if (0xf < local_159c) { uVar11 = local_159c + 1; pvVar8 = local_15b0; if (0xfff < uVar11) { pvVar8 = *(void **)((int)local_15b0 + -4); uVar11 = local_159c + 0x24; if (0x1f < (uint)((int)local_15b0 + (-4 - (int)pvVar8))) { LAB_009269fc: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar11); } local_15a0 = 0; local_159c = 0xf; local_15b0 = (void *)((uint)local_15b0 & 0xffffff00); } } uVar11 = local_15bc; } uVar5 = uVar5 + 1; } while (uVar5 < uVar11); } local_14 = 4; pqVar18 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar18 = &g_allocatedBytesNoHeap; } if (pvVar7 != (void *)0x0) { uVar11 = *(uint *)((int)pvVar7 + -4); qVar3 = *pqVar18; *(uint *)pqVar18 = (uint)*pqVar18 - uVar11; *(uint *)((int)pqVar18 + 4) = *(uint *)((int)pqVar18 + 4) - (uint)((uint)qVar3 < uVar11); free((void *)((int)pvVar7 + -4)); } if (pvVar6 != (void *)0x0) { ptr = (uint *)((int)pvVar6 + -4); local_14 = 5; _eh_vector_destructor_iterator_(pvVar6,8,*ptr,FUN_00a5a420); operator_delete(ptr,*ptr * 8 + 4); } if (g_mainHeap == (void *)0x0) { pqVar18 = &g_allocatedBytesNoHeap; } else { pqVar18 = (qword *)((int)g_mainHeap + 0x30); } if (pbVar9 != (byte *)0x0) { uVar11 = *(uint *)(pbVar9 + -4); qVar3 = *pqVar18; *(uint *)pqVar18 = (uint)*pqVar18 - uVar11; *(uint *)((int)pqVar18 + 4) = *(uint *)((int)pqVar18 + 4) - (uint)((uint)qVar3 < uVar11); free(pbVar9 + -4); } ExceptionList = local_1c; return local_15c4; } //@@ 00926a50 PersistentGameData::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool PersistentGameData::Load(char const *filepath); */ byte __thiscall PersistentGameData::Load(PersistentGameData *this,byte *param_2) { char isImported; byte bVar1; int *saveFile; uint position; undefined4 ****rebirthPathText; int fd; byte *pathEnd; undefined4 ****ppppuVar2; uint uVar3; char *format; undefined4 searchText; undefined1 uStack_44; undefined4 uStack_38; undefined4 uStack_34; undefined4 ****rebirthPath [5]; uint rebirthPathCapacity; uint securityCookie; void *local_10; undefined1 *puStack_c; undefined4 ***pppuStack_8; pppuStack_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b0a935; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(rebirthPath + 0xb); ExceptionList = &local_10; if (this->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_saveFile)(1,securityCookie); } pathEnd = param_2; do { bVar1 = *pathEnd; pathEnd = pathEnd + 1; } while (bVar1 != 0); std::string::assign(&this->field_0x8,param_2,(int)pathEnd - (int)(param_2 + 1)); KAGE_LogMessage(1,(byte *)"Loading Repentance PersistentGameData from disk: %s.\n"); saveFile = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,param_2); this->_saveFile = saveFile; if (saveFile == (int *)0x0) { Clear(this,1); isImported = func_0x0092c7e0(param_2); if (isImported == '\0') { KAGE_LogMessage(1,(byte *)"No Repentance PersistentGameData, trying to import AB+ save.\n"); isImported = func_0x0092c550(param_2); if (isImported == '\0') { KAGE_LogMessage(1,(byte *)"No AB+ PersistentGameData, trying to import AB save.\n"); isImported = TryImportABLocalSave(this,param_2); if (isImported == '\0') { KAGE_LogMessage(1,(byte *)"No AB PersistentGameData, trying to import Rebirth save.\n"); std::string::string_from_cstr((char *)rebirthPath,param_2); uVar3 = rebirthPathCapacity; ppppuVar2 = rebirthPath[0]; uStack_34 = 0xf; uStack_38 = 4; searchText = 0x2b706572; uStack_44 = 0; pppuStack_8 = (undefined4 ***)0x1; rebirthPathText = rebirthPath; if (0xf < rebirthPathCapacity) { rebirthPathText = rebirthPath[0]; } position = FUN_00836980(rebirthPathText,&searchText,4); if (position != 0xffffffff) { std::string::replace((char *)rebirthPath,position,4,&s_empty,0); ppppuVar2 = rebirthPath[0]; uVar3 = rebirthPathCapacity; } rebirthPathText = rebirthPath; if (0xf < uVar3) { rebirthPathText = ppppuVar2; } isImported = TryImportRebirthLocalSave(this,rebirthPathText); if (isImported == '\0') { Clear(this,1); KAGE_LogMessage(1,(byte *) "No PersistentGameData found for any version of Isaac, creating new one.\n" ); Save(this); bVar1 = 0; } else { KAGE_LogMessage(1,(byte *)"Successfully imported Rebirth save!!\n"); bVar1 = 0; if (this->_isFileLoaded != 0) { Save(this); bVar1 = this->_isFileLoaded; } } if (0xf < rebirthPathCapacity) { uVar3 = rebirthPathCapacity + 1; ppppuVar2 = rebirthPath[0]; if (0xfff < uVar3) { ppppuVar2 = (undefined4 ****)rebirthPath[0][-1]; uVar3 = rebirthPathCapacity + 0x24; if (0x1f < (uint)((int)rebirthPath[0] + (-4 - (int)ppppuVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar2,uVar3); } ExceptionList = local_10; return bVar1; } format = "Successfully imported from AB!\n"; } else { format = "Successfully imported from AB+!\n"; } } else { format = "Successfully imported!\n"; } KAGE_LogMessage(1,(byte *)format); if (this->_isFileLoaded == 0) { ExceptionList = local_10; return 0; } Save(this); } else { isImported = (**(code **)(*saveFile + 0x30))(); if ((isImported != '\0') && (fd = _fileno((FILE *)saveFile[3]), -1 < fd)) { flock(fd,1); } bVar1 = func_0x00926e90(); saveFile = this->_saveFile; this->_isFileLoaded = bVar1; isImported = (**(code **)(*saveFile + 0x30))(); if ((isImported != '\0') && (fd = _fileno((FILE *)saveFile[3]), -1 < fd)) { flock(fd,8); } (**(code **)(*(int *)this->_saveFile + 0x34))(); } ExceptionList = local_10; return this->_isFileLoaded; } //@@ 00926cf0 PersistentGameData::LoadFromSteamCloud /* DB: logs "Loading PersistentGameData from Steam Cloud" */ byte PersistentGameData::LoadFromSteamCloud(void) { qword qVar1; char cVar2; byte bVar3; undefined4 *puVar4; undefined4 *puVar5; undefined1 *puVar6; PersistentGameData *in_ECX; qword *pqVar7; if (in_ECX->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x28); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0x28; *puVar4 = 0x28; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xffffffd7 < (uint)qVar1); puVar5 = puVar4 + 1; if (puVar5 != (undefined4 *)0x0) { puVar4[2] = 2; puVar4[3] = 0; *puVar5 = IsaacRepentancePlus::SteamCloudFile::vftable; puVar4[5] = 0; puVar4[7] = 0; puVar4[8] = 0; *(undefined2 *)(puVar4 + 9) = 0; goto LAB_00926d39; } } puVar5 = (undefined4 *)0x0; LAB_00926d39: puVar6 = &in_ECX->field_0x20; in_ECX->_saveFile = puVar5; KAGE_LogMessage(1,(byte *)"Loading PersistentGameData from Steam Cloud: %s.\n"); if (0xf < *(uint *)&in_ECX->field_0x34) { puVar6 = *(undefined1 **)puVar6; } cVar2 = (**(code **)(*(int *)in_ECX->_saveFile + 0x24))(puVar6); if ((cVar2 != '\0') && (cVar2 = (**(code **)(*(int *)in_ECX->_saveFile + 0x30))(), cVar2 != '\0')) { bVar3 = func_0x00926e90(); in_ECX->_isFileLoaded = bVar3; (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); return in_ECX->_isFileLoaded; } KAGE_LogMessage(1,(byte *)"SteamCloud could not find or open %s.\n"); (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); Clear(in_ECX,1); KAGE_LogMessage(1,(byte *)"Trying to import AB+ Steam save.\n"); cVar2 = FUN_0092c0e0(); if (((cVar2 == '\0') && (cVar2 = FUN_0092bf00(), cVar2 == '\0')) && (cVar2 = FUN_0092bd20(), cVar2 == '\0')) { KAGE_LogMessage(1,(byte *)"Starting with a clean save state.\n"); Clear(in_ECX,1); } else { KAGE_LogMessage(1,(byte *)"Successfully imported!\n"); if (in_ECX->_isFileLoaded != 0) { SaveToSteamCloud(in_ECX); return in_ECX->_isFileLoaded; } } return 0; } //@@ 00926f10 PersistentGameData::read /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=PersistentGameData (stored to [ebp-0x24], fields +0xf84/+0xf88 filled), param = input stream: reads the 16-byte header and compares with "CNGSAVE06R".."CNGSAVE09R" ("PersistentGameData wrong file header (%.16s)"), checksum_stream vs trailing dword ("checksum invalid!"), "Unsuported save version (probably an AB or Rebirth save)!", then per-chunk loop ("Reading chunk %d"); counterpart of PersistentGameData::write (009282e0); 5 call sites incl. PersistentGameData::TryImportABLocalSave prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall PersistentGameData::read(PersistentGameData *this,void *stream) { undefined4 uVar1; int iVar2; PersistentGameData *pPVar3; char isEof; uint uVar4; undefined4 *newNode; void *mapNode; int *expectedHeader; int *piVar5; PersistentGameData *pPVar6; std_map *psVar7; undefined1 *this_00; int iVar8; uint uVar9; bool bVar10; void *pvStack_114; int iStack_110; void *pvStack_10c; void *pvStack_108; int iStack_104; void *pvStack_100; void *pvStack_fc; int iStack_f8; void *pvStack_f4; void *pvStack_f0; int iStack_ec; void *pvStack_e8; undefined1 *puStack_e4; undefined4 uStack_e0; std_map *psStack_dc; undefined4 uStack_d8; std_map *psStack_d4; undefined4 uStack_d0; std_map *psStack_cc; undefined4 uStack_c8; int list3Key; int list1Key; uint list1Value; uint list1Bytes; undefined4 cutsceneCounterValue; uint list3Value; uint list3Bytes; int list2Key; uint list2Value; uint list2Bytes; undefined4 levelCounterValue; undefined4 counterValue; int list4Key; uint list4Value; uint list4Bytes; undefined4 bestiaryListType; undefined4 gameSettingValue; uint bestiaryListCount; uint bestiaryListIdx; int iStack_78; uint storedChecksum; uint specialSeedCount; uint cutsceneCounterCount; uint challengeCounterCount; uint bossCount; uint miniBossCount; uint collectibleCount; uint levelCounterCount; uint counterCount; uint achievementCount; int chunkId; int chunkLimit; uint gameSettingCount; uint uStack_40; uint uStack_3c; char achievementByte; char specialSeedByte; char challengeCounterByte; char bossByte; char miniBossByte; char collectibleByte; int iStack_30; uint chunkSize; PersistentGameData *self; int local_24 [4]; uint local_14; void *local_10; undefined1 *puStack_c; int iStack_8; iStack_8 = 0xffffffff; puStack_c = &LAB_00b0a991; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 8); ExceptionList = &local_10; self = this; (**(code **)(*(int *)stream + 0x14))(local_24,1,0x10,local_14); expectedHeader = &DAT_00b1b98c; piVar5 = local_24; uVar9 = 0xc; do { if (*expectedHeader != *piVar5) { expectedHeader = &DAT_00b1b9a0; piVar5 = local_24; uVar9 = 0xc; goto LAB_00926f90; } expectedHeader = expectedHeader + 1; piVar5 = piVar5 + 1; bVar10 = 3 < uVar9; uVar9 = uVar9 - 4; } while (bVar10); uVar9 = 6; chunkLimit = 9; goto LAB_00927011; while( true ) { expectedHeader = expectedHeader + 1; piVar5 = piVar5 + 1; bVar10 = uVar9 < 4; uVar9 = uVar9 - 4; if (bVar10) break; LAB_00926f90: if (*expectedHeader != *piVar5) { expectedHeader = &DAT_00b1b9b4; piVar5 = local_24; uVar9 = 0xc; goto LAB_00926fc0; } } uVar9 = 7; chunkLimit = 10; goto LAB_00927011; while( true ) { expectedHeader = expectedHeader + 1; piVar5 = piVar5 + 1; bVar10 = uVar9 < 4; uVar9 = uVar9 - 4; if (bVar10) break; LAB_00926fc0: if (*expectedHeader != *piVar5) { expectedHeader = &DAT_00b7ab6c; piVar5 = local_24; uVar9 = 0xc; do { if (*expectedHeader != *piVar5) { KAGE_LogMessage(1,(byte *)"PersistentGameData wrong file header (%.16s)\n"); ExceptionList = local_10; return 0; } expectedHeader = expectedHeader + 1; piVar5 = piVar5 + 1; bVar10 = 3 < uVar9; uVar9 = uVar9 - 4; } while (bVar10); uVar9 = 9; chunkLimit = 0xb; goto LAB_00927011; } } uVar9 = 8; chunkLimit = 10; LAB_00927011: uVar4 = checksum_stream(stream,0x10,4); (**(code **)(*(int *)stream + 0xc))(0xfffffffc,2); storedChecksum = 0; (**(code **)(*(int *)stream + 0x14))(&storedChecksum,4,1); if (storedChecksum == uVar4) { if (8 < uVar9) { (**(code **)(*(int *)stream + 0xc))(0x10,0); pPVar6 = self; (**(code **)(*(int *)stream + 0x14))(&self->field_0xf84,4,1); chunkId = 0; do { do { isEof = (**(code **)(*(int *)stream + 0x10))(); if (((isEof != '\0') || (chunkId < 0)) || (chunkLimit <= chunkId)) { (**(code **)(*(int *)stream + 0x14))(&pPVar6->field_0xf88,4,1); ExceptionList = local_10; return 1; } (**(code **)(*(int *)stream + 0x14))(&chunkId,4,1); KAGE_LogMessage(1,(byte *)"Reading chunk %d\n"); chunkSize = 0; (**(code **)(*(int *)stream + 0x14))(&chunkSize,4,1); } while (chunkSize == 0); switch(chunkId) { case 1: KAGE_LogMessage(1,(byte *)"Reading Achievements\n"); achievementCount = 0; (**(code **)(*(int *)stream + 0x14))(&achievementCount,4,1); if (achievementCount != 0x282) { KAGE_LogMessage(4,(byte *)"Different number of achievements %d/%d\n"); } uVar9 = 0; if (achievementCount != 0) { do { if (chunkSize <= uVar9) break; (**(code **)(*(int *)stream + 0x14))(&achievementByte,1,1); if (uVar9 < 0x282) { pPVar6->_achievements[uVar9] = '\0' < achievementByte; } uVar9 = uVar9 + 1; } while (uVar9 < achievementCount); } KAGE_LogMessage(1,(byte *)"Done Reading Achievements\n"); break; case 2: KAGE_LogMessage(1,(byte *)"Reading Counters\n"); counterCount = 0; (**(code **)(*(int *)stream + 0x14))(&counterCount,4,1); if (counterCount != 0x20b) { KAGE_LogMessage(4,(byte *)"Different number of counters %d/%d\n"); } uVar9 = 0; if (counterCount != 0) { uVar4 = 0; do { if (chunkSize <= uVar4) break; (**(code **)(*(int *)stream + 0x14))(&counterValue,4,1); if (uVar9 < 0x20b) { *(undefined4 *)((int)self->_eventCounters + uVar4) = counterValue; } uVar9 = uVar9 + 1; uVar4 = uVar4 + 4; } while (uVar9 < counterCount); } KAGE_LogMessage(1,(byte *)"Done Reading Counters\n"); pPVar6 = self; break; case 3: KAGE_LogMessage(1,(byte *)"Reading Level Counters\n"); levelCounterCount = 0; (**(code **)(*(int *)stream + 0x14))(&levelCounterCount,4,1); if (levelCounterCount != 0xe) { KAGE_LogMessage(4,(byte *)"Different number of counters %d/%d\n"); } uVar9 = 0; if (levelCounterCount != 0) { uVar4 = 0; do { if (chunkSize <= uVar4) break; (**(code **)(*(int *)stream + 0x14))(&levelCounterValue,4,1); if (uVar9 < 0xe) { *(undefined4 *)((int)self->_cutsceneCounters + (uVar4 - 0xd8)) = levelCounterValue; } uVar9 = uVar9 + 1; uVar4 = uVar4 + 4; } while (uVar9 < levelCounterCount); } KAGE_LogMessage(1,(byte *)"Done Reading Level Counters\n"); pPVar6 = self; break; case 4: KAGE_LogMessage(1,(byte *)"Reading Collectibles\n"); collectibleCount = 0; (**(code **)(*(int *)stream + 0x14))(&collectibleCount,4,1); if (collectibleCount != 0x2dd) { KAGE_LogMessage(4,(byte *)"Different number of collectibles in collection %d/%d\n"); } uVar9 = 0; if (collectibleCount != 0) { do { if (chunkSize <= uVar9) break; (**(code **)(*(int *)stream + 0x14))(&collectibleByte,1,1); if (uVar9 < 0x2dd) { *(bool *)((int)pPVar6->_eventCounters + uVar9 + 0x82c) = '\0' < collectibleByte; } uVar9 = uVar9 + 1; } while (uVar9 < collectibleCount); } KAGE_LogMessage(1,(byte *)"Done Reading Collectibles\n"); break; case 5: KAGE_LogMessage(1,(byte *)"Reading Mini Bosses\n"); miniBossCount = 0; (**(code **)(*(int *)stream + 0x14))(&miniBossCount,4,1); if (miniBossCount != 7) { KAGE_LogMessage(4,(byte *)"Different number of minibosses %d/%d\n"); } uVar9 = 0; if (miniBossCount != 0) { do { if (chunkSize <= uVar9) break; (**(code **)(*(int *)stream + 0x14))(&miniBossByte,1,1); if (uVar9 < 7) { *(bool *)((int)pPVar6->_cutsceneCounters + (uVar9 - 0xa0)) = '\0' < miniBossByte; } uVar9 = uVar9 + 1; } while (uVar9 < miniBossCount); } KAGE_LogMessage(1,(byte *)"Done Reading Mini Bosses\n"); break; case 6: KAGE_LogMessage(1,(byte *)"Reading Bosses\n"); bossCount = 0; (**(code **)(*(int *)stream + 0x14))(&bossCount,4,1); if (bossCount != 0x68) { KAGE_LogMessage(4,(byte *)"Different number of minibosses %d/%d\n"); } uVar9 = 0; if (bossCount != 0) { do { if (chunkSize <= uVar9) break; (**(code **)(*(int *)stream + 0x14))(&bossByte,1,1); if (uVar9 < 0x68) { *(bool *)((int)pPVar6->_cutsceneCounters + (uVar9 - 0x99)) = '\0' < bossByte; } uVar9 = uVar9 + 1; } while (uVar9 < bossCount); } KAGE_LogMessage(1,(byte *)"Done Reading Bosses\n"); break; case 7: KAGE_LogMessage(1,(byte *)"Reading Challenge Counters\n"); challengeCounterCount = 0; (**(code **)(*(int *)stream + 0x14))(&challengeCounterCount,4,1); if (challengeCounterCount != 0x2e) { KAGE_LogMessage(4,(byte *)"Different number of challenges %d/%d\n"); } uVar9 = 0; if (challengeCounterCount != 0) { do { if (chunkSize <= uVar9) break; (**(code **)(*(int *)stream + 0x14))(&challengeCounterByte,1,1); if (uVar9 < 0x2e) { *(bool *)((int)pPVar6->_cutsceneCounters + (uVar9 - 0x31)) = '\0' < challengeCounterByte; } uVar9 = uVar9 + 1; } while (uVar9 < challengeCounterCount); } KAGE_LogMessage(1,(byte *)"Done Reading Challenge Counters\n"); break; case 8: KAGE_LogMessage(1,(byte *)"Reading Cutscene Counters\n"); cutsceneCounterCount = 0; (**(code **)(*(int *)stream + 0x14))(&cutsceneCounterCount,4,1); if (cutsceneCounterCount != 0x1b) { KAGE_LogMessage(4,(byte *)"Different number of cutscenes %d/%d\n"); } uVar9 = 0; if (cutsceneCounterCount != 0) { uVar4 = 0; do { if (chunkSize <= uVar4) break; (**(code **)(*(int *)stream + 0x14))(&cutsceneCounterValue,4,1); if (uVar9 < 0x1b) { *(undefined4 *)((int)self->_cutsceneCounters + uVar4) = cutsceneCounterValue; } uVar9 = uVar9 + 1; uVar4 = uVar4 + 4; } while (uVar9 < cutsceneCounterCount); } KAGE_LogMessage(1,(byte *)"Done Reading Cutscene Counters\n"); pPVar6 = self; break; case 9: KAGE_LogMessage(1,(byte *)"Reading GameSettings\n"); gameSettingCount = 0; (**(code **)(*(int *)stream + 0x14))(&gameSettingCount,4,1); bVar10 = gameSettingCount == 2; if (!bVar10) { KAGE_LogMessage(4,(byte *)"Different number of settings %d/%d\n"); bVar10 = gameSettingCount == 2; } if (1 < gameSettingCount && !bVar10) { gameSettingCount = 2; } uVar9 = 0; if (gameSettingCount != 0) { uVar4 = 0; do { if (chunkSize <= uVar4) break; (**(code **)(*(int *)stream + 0x14))(&gameSettingValue,4,1); if (uVar9 < 2) { *(undefined4 *)((int)self->_cutsceneCounters + uVar4 + 0x6c) = gameSettingValue; } uVar9 = uVar9 + 1; uVar4 = uVar4 + 4; } while (uVar9 < gameSettingCount); } KAGE_LogMessage(1,(byte *)"Done Reading GameSettings\n"); pPVar6 = self; break; case 10: KAGE_LogMessage(1,(byte *)"Reading Special Seed Counters\n"); specialSeedCount = 0; (**(code **)(*(int *)stream + 0x14))(&specialSeedCount,4,1); if (specialSeedCount != 0x50) { KAGE_LogMessage(4,(byte *)"Different number of special seeds %d/%d\n"); } uVar9 = 0; if (specialSeedCount != 0) { do { if (chunkSize <= uVar9) break; (**(code **)(*(int *)stream + 0x14))(&specialSeedByte,1,1); if (uVar9 < 0x50) { *(bool *)((int)pPVar6->_cutsceneCounters + uVar9 + 0x74) = '\0' < specialSeedByte; } uVar9 = uVar9 + 1; } while (uVar9 < specialSeedCount); } KAGE_LogMessage(1,(byte *)"Done Reading Special Seed Counters\n"); break; case 0xb: KAGE_LogMessage(1,(byte *)"Reading Bestiary Counters\n"); mapNode = (pPVar6->_bestiaryDeaths)._head; FID_conflict__Erase_tree_>_> (&pPVar6->_bestiaryDeaths, (fuzzer_allocator_> *) &pPVar6->_bestiaryDeaths,*(_Tree_node **)((int)mapNode + 4) ); pPVar3 = self; *(void **)((int)mapNode + 4) = mapNode; *(void **)mapNode = mapNode; *(void **)((int)mapNode + 8) = mapNode; (pPVar6->_bestiaryDeaths)._size = 0; psVar7 = &self->_bestiaryEncounters; mapNode = psVar7->_head; FID_conflict__Erase_tree_>_> (psVar7,(fuzzer_allocator_> *)psVar7, *(_Tree_node **)((int)mapNode + 4)); pPVar6 = self; *(void **)((int)mapNode + 4) = mapNode; *(void **)mapNode = mapNode; *(void **)((int)mapNode + 8) = mapNode; (pPVar3->_bestiaryEncounters)._size = 0; this_00 = &self->field_0xf74; iVar8 = *(int *)this_00; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(iVar8 + 4)); pPVar3 = self; *(int *)(iVar8 + 4) = iVar8; *(int *)iVar8 = iVar8; *(int *)(iVar8 + 8) = iVar8; *(undefined4 *)&pPVar6->field_0xf78 = 0; psVar7 = &self->_bestiaryKills; mapNode = psVar7->_head; FID_conflict__Erase_tree_>_> (psVar7,(fuzzer_allocator_> *)psVar7, *(_Tree_node **)((int)mapNode + 4)); *(void **)((int)mapNode + 4) = mapNode; *(void **)mapNode = mapNode; *(void **)((int)mapNode + 8) = mapNode; (pPVar3->_bestiaryKills)._size = 0; (**(code **)(*(int *)stream + 0x14))(&bestiaryListCount,4,1); bestiaryListIdx = 0; if (bestiaryListCount != 0) { do { (**(code **)(*(int *)stream + 0x14))(&bestiaryListType,4,1); switch(bestiaryListType) { case 1: (**(code **)(*(int *)stream + 0x14))(&list1Bytes,4,1); if (0 < (int)list1Bytes) { uStack_3c = list1Bytes >> 2; iVar8 = 0; if (uStack_3c != 0) { do { (**(code **)(*(int *)stream + 0x14))(&list1Key,4,1); (**(code **)(*(int *)stream + 0x14))(&list1Value,4,1); iVar2 = list1Key; uStack_40 = list1Value; iStack_78 = list1Key; std::set::find_node(&pvStack_114,&iStack_78); if ((*(char *)((int)pvStack_10c + 0xd) != '\0') || (mapNode = pvStack_10c, iVar2 < *(int *)((int)pvStack_10c + 0x10))) { if ((self->_bestiaryEncounters)._size == 0xaaaaaaa) { LAB_00927cd3: /* WARNING: Subroutine does not return */ FUN_004170d0(); } mapNode = (self->_bestiaryEncounters)._head; iStack_8 = 3; uStack_d8 = 0; psStack_dc = &self->_bestiaryEncounters; newNode = operator_new(0x18); iStack_8 = 0xffffffff; uStack_d8 = 0; newNode[4] = iStack_78; newNode[5] = 0; *newNode = mapNode; newNode[1] = mapNode; newNode[2] = mapNode; *(undefined2 *)(newNode + 3) = 0; mapNode = std::_Tree::_Insert_node (&self->_bestiaryEncounters,pvStack_114,iStack_110, newNode); } iVar8 = iVar8 + 1; *(uint *)((int)mapNode + 0x14) = uStack_40; } while (iVar8 < (int)uStack_3c); } } break; case 2: (**(code **)(*(int *)stream + 0x14))(&list2Bytes,4,1); if (0 < (int)list2Bytes) { uStack_3c = list2Bytes >> 2; iVar8 = 0; if (uStack_3c != 0) { do { (**(code **)(*(int *)stream + 0x14))(&list2Key,4,1); (**(code **)(*(int *)stream + 0x14))(&list2Value,4,1); iVar2 = list2Key; uStack_40 = list2Value; iStack_30 = list2Key; std::set::find_node(&pvStack_fc,&iStack_30); if ((*(char *)((int)pvStack_f4 + 0xd) != '\0') || (mapNode = pvStack_f4, iVar2 < *(int *)((int)pvStack_f4 + 0x10))) { if ((self->_bestiaryKills)._size == 0xaaaaaaa) goto LAB_00927cd3; mapNode = (self->_bestiaryKills)._head; iStack_8 = 1; uStack_c8 = 0; psStack_cc = &self->_bestiaryKills; newNode = operator_new(0x18); iStack_8 = 0xffffffff; uStack_c8 = 0; newNode[4] = iStack_30; newNode[5] = 0; *newNode = mapNode; newNode[1] = mapNode; newNode[2] = mapNode; *(undefined2 *)(newNode + 3) = 0; mapNode = std::_Tree::_Insert_node (&self->_bestiaryKills,pvStack_fc,iStack_f8,newNode); } iVar8 = iVar8 + 1; *(uint *)((int)mapNode + 0x14) = uStack_40; } while (iVar8 < (int)uStack_3c); } } break; case 3: (**(code **)(*(int *)stream + 0x14))(&list3Bytes,4,1); if (0 < (int)list3Bytes) { uStack_3c = list3Bytes >> 2; iVar8 = 0; if (uStack_3c != 0) { do { (**(code **)(*(int *)stream + 0x14))(&list3Key,4,1); (**(code **)(*(int *)stream + 0x14))(&list3Value,4,1); iVar2 = list3Key; uStack_40 = list3Value; iStack_30 = list3Key; std::set::find_node(&pvStack_108,&iStack_30); if ((*(char *)((int)pvStack_100 + 0xd) != '\0') || (mapNode = pvStack_100, iVar2 < *(int *)((int)pvStack_100 + 0x10))) { if (*(int *)&self->field_0xf78 == 0xaaaaaaa) goto LAB_00927cd3; uVar1 = *(undefined4 *)&self->field_0xf74; iStack_8 = 2; uStack_e0 = 0; puStack_e4 = &self->field_0xf74; newNode = operator_new(0x18); iStack_8 = 0xffffffff; uStack_e0 = 0; newNode[4] = iStack_30; newNode[5] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; mapNode = std::_Tree::_Insert_node (&self->field_0xf74,pvStack_108,iStack_104,newNode); } iVar8 = iVar8 + 1; *(uint *)((int)mapNode + 0x14) = uStack_40; } while (iVar8 < (int)uStack_3c); } } break; case 4: (**(code **)(*(int *)stream + 0x14))(&list4Bytes,4,1); if (0 < (int)list4Bytes) { uStack_40 = list4Bytes >> 2; iVar8 = 0; if (uStack_40 != 0) { do { (**(code **)(*(int *)stream + 0x14))(&list4Key,4,1); (**(code **)(*(int *)stream + 0x14))(&list4Value,4,1); iVar2 = list4Key; uStack_3c = list4Value; iStack_30 = list4Key; std::set::find_node(&pvStack_f0,&iStack_30); if ((*(char *)((int)pvStack_e8 + 0xd) != '\0') || (mapNode = pvStack_e8, iVar2 < *(int *)((int)pvStack_e8 + 0x10))) { if ((self->_bestiaryDeaths)._size == 0xaaaaaaa) goto LAB_00927cd3; mapNode = (self->_bestiaryDeaths)._head; iStack_8 = 0; uStack_d0 = 0; psStack_d4 = &self->_bestiaryDeaths; newNode = operator_new(0x18); iStack_8 = 0xffffffff; uStack_d0 = 0; newNode[4] = iStack_30; newNode[5] = 0; *newNode = mapNode; newNode[1] = mapNode; newNode[2] = mapNode; *(undefined2 *)(newNode + 3) = 0; mapNode = std::_Tree::_Insert_node (&self->_bestiaryDeaths,pvStack_f0,iStack_ec,newNode); } iVar8 = iVar8 + 1; *(uint *)((int)mapNode + 0x14) = uStack_3c; } while (iVar8 < (int)uStack_40); } } } bestiaryListIdx = bestiaryListIdx + 1; } while (bestiaryListIdx < bestiaryListCount); } KAGE_LogMessage(1,(byte *)"Done Reading Bestiary Counters\n"); pPVar6 = self; } } while( true ); } KAGE_LogMessage(1,(byte *)"[warn] Unsuported save version (probably an AB or Rebirth save)!\n"); } else { KAGE_LogMessage(1,(byte *)"[warn] PersistentGameData checksum invalid!\n"); } ExceptionList = local_10; return 0; } //@@ 00927d20 PersistentGameData::backfill_cutscene_counters /* DB: ? ECX=PersistentGameData: raises _cutsceneCounters[2..] (+0xea8..+0xf04) to at least 1 when the matching _eventCounters (+0x2c0.., +0x2e8/+0x2f0/+0x31c/+0x320/+0x324/+0x534/+0x5a8) or flags +0xa68/+0xa6c are set, so already-earned cutscenes show in the cutscene menu; only caller FUN_00926cf0 ("Loading PersistentGameData from Steam Cloud") */ void __thiscall PersistentGameData::backfill_cutscene_counters(PersistentGameData *this) { int iVar1; int iVar2; int *piVar3; int *piVar4; int *piVar5; int minCount; iVar1 = this->_eventCounters[1]; if (this->_achievements[4] != 0) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[3]) { piVar3 = this->_cutsceneCounters + 3; } piVar4 = this->_cutsceneCounters + 2; this->_cutsceneCounters[3] = *piVar3; minCount = 1; piVar3 = &minCount; if (1 < *piVar4) { piVar3 = piVar4; } iVar2 = *piVar3; *piVar4 = iVar2; piVar3 = &minCount; if (1 < iVar2) { piVar3 = piVar4; } minCount = 1; iVar2 = *piVar3; *piVar4 = iVar2; piVar3 = &minCount; if (1 < iVar2) { piVar3 = piVar4; } minCount = 1; *piVar4 = *piVar3; } if (0 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[4]) { piVar3 = this->_cutsceneCounters + 4; } this->_cutsceneCounters[4] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (1 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[5]) { piVar3 = this->_cutsceneCounters + 5; } this->_cutsceneCounters[5] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (2 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[6]) { piVar3 = this->_cutsceneCounters + 6; } this->_cutsceneCounters[6] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (3 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[7]) { piVar3 = this->_cutsceneCounters + 7; } this->_cutsceneCounters[7] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (4 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[8]) { piVar3 = this->_cutsceneCounters + 8; } this->_cutsceneCounters[8] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (5 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[9]) { piVar3 = this->_cutsceneCounters + 9; } this->_cutsceneCounters[9] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (6 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[10]) { piVar3 = this->_cutsceneCounters + 10; } this->_cutsceneCounters[10] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (7 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0xb]) { piVar3 = this->_cutsceneCounters + 0xb; } this->_cutsceneCounters[0xb] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (8 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0xc]) { piVar3 = this->_cutsceneCounters + 0xc; } this->_cutsceneCounters[0xc] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (9 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0xd]) { piVar3 = this->_cutsceneCounters + 0xd; } this->_cutsceneCounters[0xd] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (10 < iVar1) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0xe]) { piVar3 = this->_cutsceneCounters + 0xe; } this->_cutsceneCounters[0xe] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } } } } } } } } } } } if (0 < this->_eventCounters[0xd]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0xf]) { piVar3 = this->_cutsceneCounters + 0xf; } this->_cutsceneCounters[0xf] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < this->_eventCounters[0xb]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x10]) { piVar3 = this->_cutsceneCounters + 0x10; } this->_cutsceneCounters[0x10] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < this->_eventCounters[0x19]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x12]) { piVar3 = this->_cutsceneCounters + 0x12; } this->_cutsceneCounters[0x12] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < this->_eventCounters[0x18]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x11]) { piVar3 = this->_cutsceneCounters + 0x11; } this->_cutsceneCounters[0x11] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < this->_eventCounters[0x1a]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x13]) { piVar3 = this->_cutsceneCounters + 0x13; } this->_cutsceneCounters[0x13] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < this->_eventCounters[0x9e]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x14]) { piVar3 = this->_cutsceneCounters + 0x14; } this->_cutsceneCounters[0x14] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < this->_eventCounters[0xbb]) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x16]) { piVar3 = this->_cutsceneCounters + 0x16; } this->_cutsceneCounters[0x16] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (this->_eventCounters[0x1eb] != 0) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x18]) { piVar3 = this->_cutsceneCounters + 0x18; } this->_cutsceneCounters[0x18] = *piVar3; piVar3 = this->_cutsceneCounters + 2; minCount = 1; piVar4 = &minCount; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (this->_eventCounters[0x1ec] != 0) { minCount = 1; piVar3 = &minCount; if (1 < this->_cutsceneCounters[0x19]) { piVar3 = this->_cutsceneCounters + 0x19; } piVar4 = this->_cutsceneCounters + 2; this->_cutsceneCounters[0x19] = *piVar3; piVar3 = this->_cutsceneCounters + 0x1a; minCount = 1; piVar5 = &minCount; if (1 < *piVar4) { piVar5 = piVar4; } iVar1 = *piVar5; *piVar4 = iVar1; minCount = 1; piVar5 = &minCount; if (1 < *piVar3) { piVar5 = piVar3; } *piVar3 = *piVar5; piVar3 = &minCount; if (1 < iVar1) { piVar3 = piVar4; } minCount = 1; *piVar4 = *piVar3; } return; } //@@ 009282e0 PersistentGameData::write /* DB: called from PersistentGameData::Save between stream flushes; writes section headers (id 1 len 0x282 achievements bytes at +0x38, id 2 len 0x82c = 0x20b event counters at +0x2bc, id 3 ...) through the stream vtable +0x1c and updates the checksum (00683410) prototype: db/protos.zhl */ void __thiscall PersistentGameData::write(PersistentGameData *this) { undefined1 *puVar1; int extraout_ECX; void *pvVar2; uint *puVar3; int *valuePtr; int local_40; byte local_3c; uint local_38; int local_34; uint finalChecksum; void *checksumWord; void *local_28; void *local_24; void *local_20; void *local_1c; void *sectionSize; void *sectionId; void *sectionCount; byte flagByte [7]; byte isFlagSet; (**(code **)(*(int *)this->_saveFile + 0x1c))(&DAT_00b7ab6c,1,0x10); local_34 = 1; local_40 = 0; local_3c = 0; local_38 = 0xfedcba76; (**(code **)(*(int *)this->_saveFile + 0x1c))(&this->field_0xf84,4,1); local_28 = *(void **)&this->field_0xf84; Checksum::Update(&local_40,(byte *)&local_28,4); sectionId = (void *)0x1; sectionSize = (void *)0x282; sectionCount = (void *)0x282; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { do { isFlagSet = this->_achievements[(int)pvVar2] != 0; (**(code **)(*(int *)this->_saveFile + 0x1c))(&isFlagSet,1,1); flagByte[0] = isFlagSet; Checksum::Update(&local_40,flagByte,1); pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < sectionCount); } sectionId = (void *)0x2; sectionSize = (void *)0x82c; sectionCount = (void *)0x20b; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { valuePtr = this->_eventCounters; do { (**(code **)(*(int *)this->_saveFile + 0x1c))(valuePtr,4,1); local_28 = (void *)*valuePtr; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)((int)pvVar2 + 1); valuePtr = valuePtr + 1; } while (pvVar2 < sectionCount); } sectionId = (void *)0x3; sectionSize = (void *)0x38; sectionCount = (void *)0xe; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { puVar3 = (uint *)&this->field_0xdc8; do { (**(code **)(*(int *)this->_saveFile + 0x1c))(puVar3,4,1); local_28 = (void *)*puVar3; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)((int)pvVar2 + 1); puVar3 = puVar3 + 1; } while (pvVar2 < sectionCount); } sectionId = (void *)0x4; sectionSize = (void *)0xb74; sectionCount = (void *)0x2dd; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { do { isFlagSet = *(char *)((int)this->_eventCounters + (int)pvVar2 + 0x82cU) != '\0'; (**(code **)(*(int *)this->_saveFile + 0x1c))(&isFlagSet,1,1); flagByte[0] = isFlagSet; Checksum::Update(&local_40,flagByte,1); pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < sectionCount); } sectionId = (void *)0x5; sectionSize = (void *)0x1c; sectionCount = (void *)0x7; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { do { isFlagSet = *(char *)((int)this->_cutsceneCounters + ((int)pvVar2 - 0xa0U)) != '\0'; (**(code **)(*(int *)this->_saveFile + 0x1c))(&isFlagSet,1,1); flagByte[0] = isFlagSet; Checksum::Update(&local_40,flagByte,1); pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < sectionCount); } sectionId = (void *)0x6; sectionSize = (void *)0x1a0; sectionCount = (void *)0x68; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { do { isFlagSet = *(char *)((int)this->_cutsceneCounters + ((int)pvVar2 - 0x99U)) != '\0'; (**(code **)(*(int *)this->_saveFile + 0x1c))(&isFlagSet,1,1); flagByte[0] = isFlagSet; Checksum::Update(&local_40,flagByte,1); pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < sectionCount); } sectionId = (void *)0x7; sectionSize = (void *)0xb8; sectionCount = (void *)0x2e; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { do { isFlagSet = *(char *)((int)this->_cutsceneCounters + ((int)pvVar2 - 0x31U)) != '\0'; (**(code **)(*(int *)this->_saveFile + 0x1c))(&isFlagSet,1,1); flagByte[0] = isFlagSet; Checksum::Update(&local_40,flagByte,1); pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < sectionCount); } sectionId = (void *)0x8; sectionSize = (void *)0x6c; sectionCount = (void *)0x1b; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { valuePtr = this->_cutsceneCounters; do { local_20 = (void *)*valuePtr; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_20,4,1); local_28 = local_20; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)((int)pvVar2 + 1); valuePtr = valuePtr + 1; } while (pvVar2 < sectionCount); } sectionId = (void *)0x9; sectionSize = (void *)0x8; sectionCount = (void *)0x2; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { valuePtr = &this->_lastDifficulty; do { local_20 = (void *)*valuePtr; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_20,4,1); local_28 = local_20; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)((int)pvVar2 + 1); valuePtr = valuePtr + 1; } while (pvVar2 < sectionCount); } sectionId = (void *)0xa; sectionSize = (void *)0x140; sectionCount = (void *)0x50; (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionCount,4,1); local_28 = sectionCount; Checksum::Update(&local_40,(byte *)&local_28,4); pvVar2 = (void *)0x0; if (sectionCount != (void *)0x0) { do { isFlagSet = *(char *)((int)this->_cutsceneCounters + (int)pvVar2 + 0x74U) != '\0'; (**(code **)(*(int *)this->_saveFile + 0x1c))(&isFlagSet,1,1); flagByte[0] = isFlagSet; Checksum::Update(&local_40,flagByte,1); pvVar2 = (void *)((int)pvVar2 + 1); } while (pvVar2 < sectionCount); } sectionCount = (void *)((this->_bestiaryEncounters)._size + *(int *)&this->field_0xf78 + (this->_bestiaryDeaths)._size + (this->_bestiaryKills)._size); sectionId = (void *)0xb; sectionSize = (void *)((int)sectionCount * 4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionId,4,1); local_28 = sectionId; Checksum::Update(&local_40,(byte *)&local_28,4); (**(code **)(*(int *)this->_saveFile + 0x1c))(§ionSize,4,1); local_28 = sectionSize; Checksum::Update(&local_40,(byte *)&local_28,4); local_24 = (void *)0x4; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_24,4,1); local_28 = local_24; Checksum::Update(&local_40,(byte *)&local_28,4); local_1c = (void *)0x4; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_1c,4,1); local_28 = local_1c; Checksum::Update(&local_40,(byte *)&local_28,4); local_20 = (void *)((this->_bestiaryDeaths)._size << 2); (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_20,4,1); local_28 = local_20; Checksum::Update(&local_40,(byte *)&local_28,4); valuePtr = (this->_bestiaryDeaths)._head; local_28 = (void *)*valuePtr; if (local_28 != valuePtr) { do { pvVar2 = local_28; puVar3 = (uint *)((int)local_28 + 0x10); (**(code **)(*(int *)this->_saveFile + 0x1c))(puVar3,4,1); checksumWord = (void *)*puVar3; Checksum::Update(&local_40,(byte *)&checksumWord,4); (**(code **)(*(int *)this->_saveFile + 0x1c))((uint *)((int)pvVar2 + 0x14),4,1); checksumWord = *(void **)((int)pvVar2 + 0x14); Checksum::Update(&local_40,(byte *)&checksumWord,4); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); } while (local_28 != (this->_bestiaryDeaths)._head); } local_1c = (void *)0x2; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_1c,4,1); checksumWord = local_1c; Checksum::Update(&local_40,(byte *)&checksumWord,4); local_20 = (void *)((this->_bestiaryKills)._size << 2); (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_20,4,1); checksumWord = local_20; Checksum::Update(&local_40,(byte *)&checksumWord,4); valuePtr = (this->_bestiaryKills)._head; local_28 = (void *)*valuePtr; if (local_28 != valuePtr) { do { pvVar2 = local_28; puVar3 = (uint *)((int)local_28 + 0x10); (**(code **)(*(int *)this->_saveFile + 0x1c))(puVar3,4,1); checksumWord = (void *)*puVar3; Checksum::Update(&local_40,(byte *)&checksumWord,4); (**(code **)(*(int *)this->_saveFile + 0x1c))((int *)((int)pvVar2 + 0x14),4,1); checksumWord = *(void **)((int)pvVar2 + 0x14); Checksum::Update(&local_40,(byte *)&checksumWord,4); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); } while (local_28 != (this->_bestiaryKills)._head); } local_1c = (void *)0x3; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_1c,4,1); checksumWord = local_1c; Checksum::Update(&local_40,(byte *)&checksumWord,4); local_20 = (void *)(*(int *)&this->field_0xf78 << 2); (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_20,4,1); checksumWord = local_20; Checksum::Update(&local_40,(byte *)&checksumWord,4); local_28 = (void *)**(int **)&this->field_0xf74; if (local_28 != *(int **)&this->field_0xf74) { do { pvVar2 = local_28; puVar3 = (uint *)((int)local_28 + 0x10); (**(code **)(*(int *)this->_saveFile + 0x1c))(puVar3,4,1); checksumWord = (void *)*puVar3; Checksum::Update(&local_40,(byte *)&checksumWord,4); (**(code **)(*(int *)this->_saveFile + 0x1c))((int *)((int)pvVar2 + 0x14),4,1); checksumWord = *(void **)((int)pvVar2 + 0x14); Checksum::Update(&local_40,(byte *)&checksumWord,4); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); } while (local_28 != *(void **)&this->field_0xf74); } local_1c = (void *)0x1; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_1c,4,1); checksumWord = local_1c; Checksum::Update(&local_40,(byte *)&checksumWord,4); local_20 = (void *)((this->_bestiaryEncounters)._size << 2); (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_20,4,1); checksumWord = local_20; Checksum::Update(&local_40,(byte *)&checksumWord,4); valuePtr = (this->_bestiaryEncounters)._head; local_28 = (void *)*valuePtr; if (local_28 != valuePtr) { do { pvVar2 = local_28; puVar3 = (uint *)((int)local_28 + 0x10); (**(code **)(*(int *)this->_saveFile + 0x1c))(puVar3,4,1); checksumWord = (void *)*puVar3; Checksum::Update(&local_40,(byte *)&checksumWord,4); (**(code **)(*(int *)this->_saveFile + 0x1c))((int *)((int)pvVar2 + 0x14),4,1); checksumWord = *(void **)((int)pvVar2 + 0x14); Checksum::Update(&local_40,(byte *)&checksumWord,4); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); } while (local_28 != (this->_bestiaryEncounters)._head); } puVar1 = &this->field_0xf88; *(int *)puVar1 = *(int *)puVar1 + 1; (**(code **)(*(int *)this->_saveFile + 0x1c))(puVar1,4,1); checksumWord = *(void **)puVar1; Checksum::Update(&local_40,(byte *)&checksumWord,4); if ((local_34 == 0) && (local_3c != 0)) { if (local_3c < 4) { memset((void *)(extraout_ECX + (uint)local_3c),0,(uint)(byte)(4 - local_3c)); } finalChecksum = local_38 * -0x80000000 + (local_38 >> 1) + local_40; } else { finalChecksum = local_38; } (**(code **)(*(int *)this->_saveFile + 0x1c))(&finalChecksum,4,1); return; } //@@ 00928ee0 PersistentGameData::SaveToSteamCloud /* ZHL [exact] __thiscall void PersistentGameData::SaveToSteamCloud(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall PersistentGameData::SaveToSteamCloud(PersistentGameData *this) { qword qVar1; byte bVar2; char cVar3; undefined4 *puVar4; undefined4 *puVar5; qword *pqVar6; undefined1 *puVar7; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar2 = shared_save_write(), bVar2 == 0)) { return; } if (this->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x28); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x28; *puVar4 = 0x28; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffd7 < (uint)qVar1); puVar5 = puVar4 + 1; if (puVar5 != (undefined4 *)0x0) { puVar4[2] = 2; puVar4[3] = 0; *puVar5 = IsaacRepentancePlus::SteamCloudFile::vftable; puVar4[5] = 0; puVar4[7] = 0; puVar4[8] = 0; *(undefined2 *)(puVar4 + 9) = 0; goto LAB_00928f4a; } } puVar5 = (undefined4 *)0x0; LAB_00928f4a: puVar7 = &this->field_0x20; this->_saveFile = puVar5; KAGE_LogMessage(1,(byte *)"Saving PersistentGameData to Steam Cloud: %s.\n"); if (0xf < *(uint *)&this->field_0x34) { puVar7 = *(undefined1 **)puVar7; } cVar3 = FUN_00683930(puVar7,0x10000); if ((cVar3 == '\0') || (cVar3 = (**(code **)(*(int *)this->_saveFile + 0x30))(), cVar3 == '\0')) { (**(code **)(*(int *)this->_saveFile + 0x34))(); KAGE_LogMessage(1,(byte *)"[warn] failed to open file.\n"); return; } write(this); (**(code **)(*(int *)this->_saveFile + 0x34))(); return; } //@@ 00929010 PersistentGameData::operator_assign /* DB: copies two std::strings (+8, +0x20) and the fixed blocks +0x38 (0xa0 dwords), +700 (0x20b), +0xae8 (0xb7), +0xdc8...; PersistentGameData::copy_constructor, NetplayManager::store_local_persistent_game_data */ void PersistentGameData::operator_assign(int param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; byte *srcText; int in_ECX; int dwordsLeft; undefined4 *src; undefined4 *dst; srcText = (byte *)(param_1 + 8); if ((byte *)(in_ECX + 8) != srcText) { if (0xf < *(uint *)(param_1 + 0x1c)) { srcText = *(byte **)srcText; } std::string::assign((char *)(in_ECX + 8),srcText,*(uint *)(param_1 + 0x18)); } srcText = (byte *)(param_1 + 0x20); if ((byte *)(in_ECX + 0x20) != srcText) { if (0xf < *(uint *)(param_1 + 0x34)) { srcText = *(byte **)srcText; } std::string::assign((char *)(in_ECX + 0x20),srcText,*(uint *)(param_1 + 0x30)); } src = (undefined4 *)(param_1 + 0x38); dst = (undefined4 *)(in_ECX + 0x38); for (dwordsLeft = 0xa0; dwordsLeft != 0; dwordsLeft = dwordsLeft + -1) { *dst = *src; src = src + 1; dst = dst + 1; } *(undefined2 *)dst = *(undefined2 *)src; src = (undefined4 *)(param_1 + 700); dst = (undefined4 *)(in_ECX + 700); for (dwordsLeft = 0x20b; dwordsLeft != 0; dwordsLeft = dwordsLeft + -1) { *dst = *src; src = src + 1; dst = dst + 1; } src = (undefined4 *)(param_1 + 0xae8); dst = (undefined4 *)(in_ECX + 0xae8); for (dwordsLeft = 0xb7; dwordsLeft != 0; dwordsLeft = dwordsLeft + -1) { *dst = *src; src = src + 1; dst = dst + 1; } *(undefined1 *)dst = *(undefined1 *)src; uVar1 = *(undefined4 *)(param_1 + 0xdcc); uVar2 = *(undefined4 *)(param_1 + 0xdd0); uVar3 = *(undefined4 *)(param_1 + 0xdd4); *(undefined4 *)(in_ECX + 0xdc8) = *(undefined4 *)(param_1 + 0xdc8); *(undefined4 *)(in_ECX + 0xdcc) = uVar1; *(undefined4 *)(in_ECX + 0xdd0) = uVar2; *(undefined4 *)(in_ECX + 0xdd4) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xddc); uVar2 = *(undefined4 *)(param_1 + 0xde0); uVar3 = *(undefined4 *)(param_1 + 0xde4); *(undefined4 *)(in_ECX + 0xdd8) = *(undefined4 *)(param_1 + 0xdd8); *(undefined4 *)(in_ECX + 0xddc) = uVar1; *(undefined4 *)(in_ECX + 0xde0) = uVar2; *(undefined4 *)(in_ECX + 0xde4) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xdec); uVar2 = *(undefined4 *)(param_1 + 0xdf0); uVar3 = *(undefined4 *)(param_1 + 0xdf4); *(undefined4 *)(in_ECX + 0xde8) = *(undefined4 *)(param_1 + 0xde8); *(undefined4 *)(in_ECX + 0xdec) = uVar1; *(undefined4 *)(in_ECX + 0xdf0) = uVar2; *(undefined4 *)(in_ECX + 0xdf4) = uVar3; *(undefined8 *)(in_ECX + 0xdf8) = *(undefined8 *)(param_1 + 0xdf8); *(undefined4 *)(in_ECX + 0xe00) = *(undefined4 *)(param_1 + 0xe00); *(undefined2 *)(in_ECX + 0xe04) = *(undefined2 *)(param_1 + 0xe04); *(undefined1 *)(in_ECX + 0xe06) = *(undefined1 *)(param_1 + 0xe06); src = (undefined4 *)(param_1 + 0xe07); dst = (undefined4 *)(in_ECX + 0xe07); for (dwordsLeft = 0x1a; dwordsLeft != 0; dwordsLeft = dwordsLeft + -1) { *dst = *src; src = src + 1; dst = dst + 1; } uVar1 = *(undefined4 *)(param_1 + 0xe73); uVar2 = *(undefined4 *)(param_1 + 0xe77); uVar3 = *(undefined4 *)(param_1 + 0xe7b); *(undefined4 *)(in_ECX + 0xe6f) = *(undefined4 *)(param_1 + 0xe6f); *(undefined4 *)(in_ECX + 0xe73) = uVar1; *(undefined4 *)(in_ECX + 0xe77) = uVar2; *(undefined4 *)(in_ECX + 0xe7b) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xe83); uVar2 = *(undefined4 *)(param_1 + 0xe87); uVar3 = *(undefined4 *)(param_1 + 0xe8b); *(undefined4 *)(in_ECX + 0xe7f) = *(undefined4 *)(param_1 + 0xe7f); *(undefined4 *)(in_ECX + 0xe83) = uVar1; *(undefined4 *)(in_ECX + 0xe87) = uVar2; *(undefined4 *)(in_ECX + 0xe8b) = uVar3; *(undefined8 *)(in_ECX + 0xe8f) = *(undefined8 *)(param_1 + 0xe8f); *(undefined4 *)(in_ECX + 0xe97) = *(undefined4 *)(param_1 + 0xe97); *(undefined2 *)(in_ECX + 0xe9b) = *(undefined2 *)(param_1 + 0xe9b); src = (undefined4 *)(param_1 + 0xea0); dst = (undefined4 *)(in_ECX + 0xea0); for (dwordsLeft = 0x1b; dwordsLeft != 0; dwordsLeft = dwordsLeft + -1) { *dst = *src; src = src + 1; dst = dst + 1; } uVar1 = *(undefined4 *)(param_1 + 0xf0c); *(undefined4 *)(in_ECX + 0xf10) = *(undefined4 *)(param_1 + 0xf10); *(undefined4 *)(in_ECX + 0xf0c) = uVar1; uVar1 = *(undefined4 *)(param_1 + 0xf18); uVar2 = *(undefined4 *)(param_1 + 0xf1c); uVar3 = *(undefined4 *)(param_1 + 0xf20); *(undefined4 *)(in_ECX + 0xf14) = *(undefined4 *)(param_1 + 0xf14); *(undefined4 *)(in_ECX + 0xf18) = uVar1; *(undefined4 *)(in_ECX + 0xf1c) = uVar2; *(undefined4 *)(in_ECX + 0xf20) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xf28); uVar2 = *(undefined4 *)(param_1 + 0xf2c); uVar3 = *(undefined4 *)(param_1 + 0xf30); *(undefined4 *)(in_ECX + 0xf24) = *(undefined4 *)(param_1 + 0xf24); *(undefined4 *)(in_ECX + 0xf28) = uVar1; *(undefined4 *)(in_ECX + 0xf2c) = uVar2; *(undefined4 *)(in_ECX + 0xf30) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xf38); uVar2 = *(undefined4 *)(param_1 + 0xf3c); uVar3 = *(undefined4 *)(param_1 + 0xf40); *(undefined4 *)(in_ECX + 0xf34) = *(undefined4 *)(param_1 + 0xf34); *(undefined4 *)(in_ECX + 0xf38) = uVar1; *(undefined4 *)(in_ECX + 0xf3c) = uVar2; *(undefined4 *)(in_ECX + 0xf40) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xf48); uVar2 = *(undefined4 *)(param_1 + 0xf4c); uVar3 = *(undefined4 *)(param_1 + 0xf50); *(undefined4 *)(in_ECX + 0xf44) = *(undefined4 *)(param_1 + 0xf44); *(undefined4 *)(in_ECX + 0xf48) = uVar1; *(undefined4 *)(in_ECX + 0xf4c) = uVar2; *(undefined4 *)(in_ECX + 0xf50) = uVar3; uVar1 = *(undefined4 *)(param_1 + 0xf58); uVar2 = *(undefined4 *)(param_1 + 0xf5c); uVar3 = *(undefined4 *)(param_1 + 0xf60); *(undefined4 *)(in_ECX + 0xf54) = *(undefined4 *)(param_1 + 0xf54); *(undefined4 *)(in_ECX + 0xf58) = uVar1; *(undefined4 *)(in_ECX + 0xf5c) = uVar2; *(undefined4 *)(in_ECX + 0xf60) = uVar3; std_map_copy_assign((void *)(in_ECX + 0xf64),(void *)(param_1 + 0xf64)); std_map_copy_assign((void *)(in_ECX + 0xf6c),(void *)(param_1 + 0xf6c)); std_map_copy_assign((void *)(in_ECX + 0xf74),(void *)(param_1 + 0xf74)); std_map_copy_assign((void *)(in_ECX + 0xf7c),(void *)(param_1 + 0xf7c)); *(undefined4 *)(in_ECX + 0xf84) = *(undefined4 *)(param_1 + 0xf84); *(undefined4 *)(in_ECX + 0xf88) = *(undefined4 *)(param_1 + 0xf88); *(undefined1 *)(in_ECX + 0xf8c) = *(undefined1 *)(param_1 + 0xf8c); *(undefined4 *)(in_ECX + 4) = 0; return; } //@@ 00929240 PersistentGameData::get_save_file_name /* DB: ? returns a heap copy of the file-name part (after the last '/') of the save path string at ECX+8 (or the fallback path at +0x20 when empty); Manager::BackupSaveFile uses it in "%s%d.%s" for save_backups/, also Menu_Save::Update and 00926510 prototype: db/protos.zhl */ byte * __thiscall PersistentGameData::get_save_file_name(PersistentGameData *this) { byte *pbVar1; byte *pbVar2; byte bVar3; byte *pbVar4; pbVar4 = &this->field_0x8; if (0xf < *(uint *)&this->field_0x1c) { pbVar4 = *(byte **)pbVar4; } bVar3 = *pbVar4; if (bVar3 == 0) { pbVar4 = &this->field_0x20; if (0xf < *(uint *)&this->field_0x34) { pbVar4 = *(byte **)pbVar4; } bVar3 = *pbVar4; } pbVar1 = pbVar4; if (bVar3 != 0) { do { pbVar1 = pbVar1 + 1; } while (*pbVar1 != 0); for (; (pbVar1 != pbVar4 && (*pbVar1 != 0x2f)); pbVar1 = pbVar1 + -1) { } } pbVar4 = pbVar1 + 1; if (*pbVar1 != 0x2f) { pbVar4 = pbVar1; } pbVar1 = pbVar4; do { bVar3 = *pbVar1; pbVar1 = pbVar1 + 1; } while (bVar3 != 0); pbVar2 = operator_new_tracked((uint)(pbVar1 + (1 - (int)(pbVar4 + 1)))); pbVar1 = pbVar2; do { bVar3 = *pbVar4; pbVar4 = pbVar4 + 1; *pbVar1 = bVar3; pbVar1 = pbVar1 + 1; } while (bVar3 != 0); return pbVar2; } //@@ 009292c0 Manager::BackupSaveFile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: %s/save_backups/ + time-stamped name; Game::Exit, ChangeRoom prototype: db/protos.zhl */ void __thiscall Manager::BackupSaveFile(Manager *this) { byte *ptr; __time64_t local_51c; byte local_514 [1280]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0a9c0; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_514 + 0x510); ExceptionList = &local_10; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { local_51c = _time64((__time64_t *)0x0); _localtime64(&local_51c); ptr = PersistentGameData::get_save_file_name((PersistentGameData *)this); sprintf(&DAT_00c93e50,(byte *)"%s/save_backups/"); sprintf_s(local_514,0x500,(byte *)"%s%d.%s"); local_8 = 0; tracked_alloc(1,ptr,0); local_8 = 0xffffffff; PersistentGameData::write_file(local_514); } ExceptionList = local_10; return; } //@@ 009293d0 PersistentGameData::write_file /* DB: ECX=PersistentGameData (+4 file): SaveDataManager::open_file_write(path), "Could not open %s for writing!", flock, PersistentGameData::write, close; Manager::BackupSaveFile */ void PersistentGameData::write_file(byte *param_1) { qword qVar1; char cVar2; undefined4 *puVar3; undefined4 *puVar4; int *piVar5; int iVar6; PersistentGameData *in_ECX; qword *pqVar7; if (in_ECX->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x14); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0x14; *puVar3 = 0x14; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xffffffeb < (uint)qVar1); puVar4 = puVar3 + 1; if (puVar4 != (undefined4 *)0x0) { puVar3[2] = 2; puVar3[3] = 0; *puVar4 = KAGE::Filesys::File::vftable; puVar3[4] = 0; goto LAB_00929418; } } puVar4 = (undefined4 *)0x0; LAB_00929418: in_ECX->_saveFile = puVar4; piVar5 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,param_1,0); in_ECX->_saveFile = piVar5; if (piVar5 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"Could not open %s for writing!\n"); return; } cVar2 = (**(code **)(*piVar5 + 0x30))(); if (cVar2 != '\0') { iVar6 = _fileno((FILE *)piVar5[3]); if (-1 < iVar6) { flock(iVar6,2); } } write(in_ECX); piVar5 = in_ECX->_saveFile; cVar2 = (**(code **)(*piVar5 + 0x30))(); if (cVar2 != '\0') { iVar6 = _fileno((FILE *)piVar5[3]); if (-1 < iVar6) { flock(iVar6,8); } } (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); return; } //@@ 009294f0 PersistentGameData::Save /* DB: "no filename supplied" prototype: db/protos.zhl */ void __thiscall PersistentGameData::Save(PersistentGameData *this) { qword qVar1; byte bVar2; char cVar3; undefined4 *puVar4; undefined4 *puVar5; byte *path; int *piVar6; int iVar7; qword *pqVar8; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar2 = shared_save_write(), bVar2 == 0)) { return; } if (*(int *)&this->field_0x18 == 0) { KAGE_LogMessage(1,(byte *)"PersistentGameData no filename supplied\n"); return; } if (this->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)this->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x14); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 + 0x14; *puVar4 = 0x14; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) + (uint)(0xffffffeb < (uint)qVar1); puVar5 = puVar4 + 1; if (puVar5 != (undefined4 *)0x0) { puVar4[2] = 2; puVar4[3] = 0; *puVar5 = KAGE::Filesys::File::vftable; puVar4[4] = 0; goto LAB_00929575; } } puVar5 = (undefined4 *)0x0; LAB_00929575: path = &this->field_0x8; this->_saveFile = puVar5; if (0xf < *(uint *)&this->field_0x1c) { path = *(byte **)path; } piVar6 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,path,0); this->_saveFile = piVar6; if (piVar6 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"Could not open %s for writing!\n"); return; } cVar3 = (**(code **)(*piVar6 + 0x30))(); if ((cVar3 != '\0') && (iVar7 = _fileno((FILE *)piVar6[3]), -1 < iVar7)) { flock(iVar7,2); } write(this); piVar6 = this->_saveFile; cVar3 = (**(code **)(*piVar6 + 0x30))(); if ((cVar3 != '\0') && (iVar7 = _fileno((FILE *)piVar6[3]), -1 < iVar7)) { flock(iVar7,8); } (**(code **)(*(int *)this->_saveFile + 0x34))(); return; } //@@ 00929660 FUN_00929660 void FUN_00929660(char param_1) { Manager *pMVar1; int *piVar2; Manager *in_ECX; if ((*(char *)in_ECX != '\0') && ((in_ECX->_persistentGameData).field_0xf78 != '\0')) { *(undefined1 *)in_ECX = 0; if (param_1 != '\0') { Manager::BackupSaveFile(in_ECX); } pMVar1 = g_manager; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar2 != 0) && ((pMVar1->_optionsConfig)._enableSteamCloud != 0)) { PersistentGameData::SaveToSteamCloud((PersistentGameData *)in_ECX); return; } PersistentGameData::Save((PersistentGameData *)in_ECX); } return; } //@@ 009296c0 PersistentGameData::check_challenge_unlocks /* DB: for challenges 1..0x2d (Manager+0x2a664 challenge params, 0xa4 each, required-achievement id vector at +0x48) unlocks DAT_00b7b0b0[challenge] via PersistentGameData::TryUnlock when every required achievement flag is set; runs after achievement grants (PersistentGameData::TryUnlock, TryAddBestiaryEncounter, Entity_Player::AddBlueFlies) prototype: db/protos.zhl */ void __thiscall PersistentGameData::check_challenge_unlocks(PersistentGameData *this) { int iVar1; void *pvVar2; bool bVar3; bool bVar4; uint uVar5; uint uVar6; uint uVar7; uint uVar8; uVar7 = 1; do { uVar6 = 0; pvVar2 = (g_manager->_challengeParams)._begin; uVar8 = ((int)(g_manager->_challengeParams)._end - (int)(g_manager->_challengeParams)._begin) / 0xa4 - 1; bVar4 = true; while( true ) { bVar3 = bVar4; uVar5 = uVar8; if (uVar7 < uVar8) { uVar5 = uVar7; } if ((uint)(*(int *)(uVar5 * 0xa4 + 0x4c + (int)pvVar2) - *(int *)(uVar5 * 0xa4 + 0x48 + (int)pvVar2) >> 2) <= uVar6) break; iVar1 = uVar6 * 4; uVar5 = uVar8; if (uVar7 < uVar8) { uVar5 = uVar7; } uVar6 = uVar6 + 1; bVar4 = false; if (this->_achievements[*(int *)(*(int *)(uVar5 * 0xa4 + 0x48 + (int)pvVar2) + iVar1)] != 0) { bVar4 = bVar3; } } if (((bVar3) && (uVar7 < 0x2e)) && (*(int *)(&DAT_00b7b0b0 + uVar7 * 4) != 0)) { TryUnlock(this,*(int *)(&DAT_00b7b0b0 + uVar7 * 4)); } uVar7 = uVar7 + 1; } while ((int)uVar7 < 0x2e); return; } //@@ 00929790 PersistentGameData::UnlockSteamAchievement /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void PersistentGameData::UnlockSteamAchievement(int achievementID); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PersistentGameData::UnlockSteamAchievement(PersistentGameData *this,int achievementID) { undefined4 *puVar1; byte local_14 [8]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (this->_isSteamAchievementsEnabled != 0) { sprintf_s(local_14,8,s__d); KAGE_LogMessage(1,(byte *)"unlock steam achievement \'%s\'\n"); if ((DAT_00c5ab08 & 1) != 0) { puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar1 + 0x18))(local_14); puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar1 + 0x24))(); } } return; } //@@ 009299e0 FUN_009299e0 void FUN_009299e0(undefined1 param_1) { int in_ECX; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); *(undefined1 *)(in_ECX + 1) = param_1; return; } //@@ 00929a20 PersistentGameData::TryUnlock /* ZHL [exact] __thiscall bool PersistentGameData::TryUnlock(int achievementID); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall PersistentGameData::TryUnlock(PersistentGameData *this,int achievementID) { Manager *unusedArg; byte bVar1; unusedArg = g_manager; if (((this->_isReadOnly != 0) || (achievementID == 0)) || (this->_achievements[achievementID] != 0)) { return 0; } this->_achievements[achievementID] = 1; if (unusedArg->_netplayManager != *(NetplayManager *)(unusedArg + 1)) { bVar1 = Manager::IsGameplayInputActive((int)unusedArg); if (bVar1 != 0) goto LAB_00929a75; } if (this->_isSteamAchievementsEnabled != 0) { UnlockSteamAchievement(this,achievementID); Manager::queue_achievement_popup(achievementID); } LAB_00929a75: *(undefined1 *)this = 1; check_challenge_unlocks(this); check_collection_unlocks(this); return 1; } //@@ 00929aa0 PersistentGameData::Unlocked /* ZHL [exact] __thiscall bool PersistentGameData::Unlocked(int achievementID); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall PersistentGameData::Unlocked(PersistentGameData *this,int achievementID) { if ((achievementID == -2) || ((-1 < achievementID && ((0x281 < (uint)achievementID || (((achievementID != 0 && (this->_achievements[achievementID] == 0)) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))))))))) { return 0; } return 1; } //@@ 00929b00 FUN_00929b00 undefined * FUN_00929b00(void) { int in_ECX; if (in_ECX < 0x29) { return &DAT_00c35ed0 + in_ECX * 0x90; } return (undefined *)0x0; } //@@ 00929b20 FUN_00929b20 undefined4 FUN_00929b20(void) { int in_ECX; int in_EDX; if ((in_EDX < 0x29) && (&DAT_00c35ed0 + in_EDX * 0x90 != (undefined *)0x0)) { return *(undefined4 *)(&DAT_00c35ed0 + in_EDX * 0x90 + in_ECX * 8); } return 0; } //@@ 00929b40 PersistentGameData::IncreaseEventCounter /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void PersistentGameData::IncreaseEventCounter(int eEventCounters, int num); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall PersistentGameData::IncreaseEventCounter(PersistentGameData *this,int eEventCounters,int num) { int iVar1; uint uVar2; int marksDone; uint baseAllMarks; int iVar3; uint characterIndex; uint allMarksCount; int specificMarkCount; uint baseAllMarksCount; int aiStack_c4 [47]; uint local_8; bool isAllMarked; local_8 = __security_cookie ^ (uint)(aiStack_c4 + 0x30); if (this->_isReadOnly == 0) { iVar1 = this->_eventCounters[eEventCounters]; iVar3 = 0; if (-iVar1 == num || -num < iVar1) { iVar3 = iVar1 + num; } this->_eventCounters[eEventCounters] = iVar3; *(undefined1 *)this = 1; uVar2 = 0; if (this->_eventCounters[0xca] != 0) { TryUnlock(this,0x167); uVar2 = this->_eventCounters[0xca]; } if (9 < uVar2) { TryUnlock(this,0x181); } if (9 < (uint)this->_eventCounters[200]) { TryUnlock(this,0x179); } if (4 < (uint)this->_eventCounters[0xc9]) { TryUnlock(this,0x17e); } uVar2 = this->_eventCounters[2]; if (99 < uVar2) { TryUnlock(this,0x55); uVar2 = this->_eventCounters[2]; } if (499 < uVar2) { TryUnlock(this,0x15e); } uVar2 = this->_eventCounters[3]; if (9 < uVar2) { TryUnlock(this,0x1c); uVar2 = this->_eventCounters[3]; } if (99 < uVar2) { TryUnlock(this,0xc); } if (3 < (uint)this->_eventCounters[7]) { TryUnlock(this,0x24); } if (9 < (uint)this->_eventCounters[9]) { TryUnlock(this,0x1a); } if (99 < (uint)this->_eventCounters[5]) { TryUnlock(this,0x91); } if (4 < (uint)this->_eventCounters[0xc2]) { TryUnlock(this,0x161); } uVar2 = this->_eventCounters[0xb]; if (9 < uVar2) { TryUnlock(this,0x44); uVar2 = this->_eventCounters[0xb]; } if (4 < uVar2) { TryUnlock(this,0x39); } if (4 < (uint)this->_eventCounters[0xd]) { TryUnlock(this,0x4e); } if ((this->_eventCounters[0x18] != 0) && (this->_eventCounters[0x19] != 0)) { TryUnlock(this,0x29); } if (99 < (uint)this->_eventCounters[10]) { TryUnlock(this,0x1e); } uVar2 = 0; if (this->_eventCounters[1] != 0) { TryUnlock(this,0x51); uVar2 = this->_eventCounters[1]; } if (1 < uVar2) { TryUnlock(this,0x96); uVar2 = this->_eventCounters[1]; } if (2 < uVar2) { TryUnlock(this,8); uVar2 = this->_eventCounters[1]; } if (3 < uVar2) { TryUnlock(this,0x8b); uVar2 = this->_eventCounters[1]; } if (4 < uVar2) { TryUnlock(this,0x21); uVar2 = this->_eventCounters[1]; } if (5 < uVar2) { TryUnlock(this,0x8c); uVar2 = this->_eventCounters[1]; } if (6 < uVar2) { TryUnlock(this,0x8d); uVar2 = this->_eventCounters[1]; } if (7 < uVar2) { TryUnlock(this,10); uVar2 = this->_eventCounters[1]; } if (8 < uVar2) { TryUnlock(this,0xb); uVar2 = this->_eventCounters[1]; } if (9 < uVar2) { TryUnlock(this,0x20); TryUnlock(this,0xea); uVar2 = this->_eventCounters[1]; } if (10 < uVar2) { TryUnlock(this,0x22); uVar2 = this->_eventCounters[1]; if (10 < uVar2) { TryUnlock(this,0x156); uVar2 = this->_eventCounters[1]; } } if (0xf < uVar2) { TryUnlock(this,0x157); uVar2 = this->_eventCounters[1]; } if (0x14 < uVar2) { TryUnlock(this,0x158); uVar2 = this->_eventCounters[1]; } if (0x1d < uVar2) { TryUnlock(this,0x159); } if (0x13 < (uint)this->_eventCounters[0xc]) { TryUnlock(this,0x3d); } if (99 < (uint)this->_eventCounters[0xe]) { TryUnlock(this,0x40); } uVar2 = this->_eventCounters[0xf]; if (9 < uVar2) { TryUnlock(this,0x42); uVar2 = this->_eventCounters[0xf]; } if (0x18 < uVar2) { TryUnlock(this,0x17c); } uVar2 = this->_eventCounters[0x10]; if (0x13 < uVar2) { TryUnlock(this,0x8e); uVar2 = this->_eventCounters[0x10]; } if (0x18 < uVar2) { TryUnlock(this,0x178); uVar2 = this->_eventCounters[0x10]; } if (0x31 < uVar2) { TryUnlock(this,0x17f); } if (0x1d < (uint)this->_eventCounters[0x11]) { TryUnlock(this,0x93); } if (0x1d < (uint)this->_eventCounters[0x12]) { TryUnlock(this,0x94); } if ((0x1e < (uint)this->_eventCounters[0xbe]) && (g_manager->_state == 1)) { TryUnlock(this,0x145); } if (4 < (uint)this->_eventCounters[0xc0]) { TryUnlock(this,0x150); } if (6 < (uint)this->_eventCounters[0xc1]) { TryUnlock(this,0x162); } if (0x13 < (uint)this->_eventCounters[0xc3]) { TryUnlock(this,0x166); } if (0x13 < (uint)this->_eventCounters[0xc4]) { TryUnlock(this,0x16a); } if (0x31 < (uint)this->_eventCounters[0xc5]) { TryUnlock(this,0x16c); } if (0x13 < (uint)this->_eventCounters[0xc6]) { TryUnlock(this,0x173); } if (0x31 < (uint)this->_eventCounters[199]) { TryUnlock(this,0x177); } if (9 < (uint)this->_eventCounters[0x1ed]) { TryUnlock(this,0x199); } if (9 < (uint)this->_eventCounters[0x1ee]) { TryUnlock(this,0x221); } if (4 < (uint)this->_eventCounters[0x1ef]) { TryUnlock(this,0x20b); } if (2 < (uint)this->_eventCounters[0x9e]) { TryUnlock(this,0x197); } iVar1 = 0; do { aiStack_c4[iVar1] = iVar1; aiStack_c4[iVar1 + 1] = iVar1 + 1; aiStack_c4[iVar1 + 2] = iVar1 + 2; aiStack_c4[iVar1 + 3] = iVar1 + 3; iVar1 = iVar1 + 4; } while (iVar1 < 8); iVar1 = 0; aiStack_c4[8] = 9; aiStack_c4[9] = 0xc; aiStack_c4[10] = 0xd; aiStack_c4[0xb] = 0xe; baseAllMarks = 0; uVar2 = 0; aiStack_c4[0xc] = 0; aiStack_c4[0xd] = 1; aiStack_c4[0xe] = 2; aiStack_c4[0xf] = 3; aiStack_c4[0x14] = 8; aiStack_c4[0x10] = 4; aiStack_c4[0x11] = 5; aiStack_c4[0x12] = 6; aiStack_c4[0x13] = 7; aiStack_c4[0x15] = 9; aiStack_c4[0x17] = 0xd; aiStack_c4[0x18] = 0xe; aiStack_c4[0x19] = 0xf; aiStack_c4[0x1a] = 0x10; aiStack_c4[0x16] = 10; aiStack_c4[0x1d] = 0x15; aiStack_c4[0x1e] = 0x16; aiStack_c4[0x1f] = 0x17; aiStack_c4[0x20] = 0x18; aiStack_c4[0x1b] = 0x12; aiStack_c4[0x21] = 0x19; aiStack_c4[0x22] = 0x1a; aiStack_c4[0x23] = 0x1b; aiStack_c4[0x24] = 0x1c; aiStack_c4[0x1c] = 0x13; aiStack_c4[0x25] = 0x1d; aiStack_c4[0x26] = 0x1e; aiStack_c4[0x27] = 0x1f; aiStack_c4[0x28] = 0x20; aiStack_c4[0x2d] = 0x25; aiStack_c4[0x29] = 0x21; aiStack_c4[0x2a] = 0x22; aiStack_c4[0x2b] = 0x23; aiStack_c4[0x2c] = 0x24; specificMarkCount = 0; baseAllMarksCount = 0; allMarksCount = 0; isAllMarked = true; characterIndex = 0; do { if (aiStack_c4[characterIndex + 0xc] < 0x29) { iVar3 = aiStack_c4[characterIndex + 0xc] * 0x90; baseAllMarks = baseAllMarksCount; if (&DAT_00c35ed0 + iVar3 != (undefined *)0x0) { marksDone = 0; uVar2 = 0; do { iVar1 = *(int *)(&DAT_00c35ed0 + iVar3 + aiStack_c4[uVar2] * 8); if ((iVar1 != 0) && ((this->_eventCounters[iVar1] & 2) != 0)) { marksDone = marksDone + 1; } uVar2 = uVar2 + 1; } while (uVar2 < 0xc); if ((((this->_eventCounters[*(int *)(&DAT_00c35ed8 + iVar3)] != 0) && (this->_eventCounters[*(int *)(&DAT_00c35ef0 + iVar3)] != 0)) && (this->_eventCounters[*(int *)(&DAT_00c35ee0 + iVar3)] != 0)) && (this->_eventCounters[*(int *)(&DAT_00c35ef8 + iVar3)] != 0)) { TryUnlock(this,*(int *)(&DAT_00c35f54 + iVar3)); } if ((this->_eventCounters[*(int *)(&DAT_00c35ee8 + iVar3)] != 0) && (this->_eventCounters[*(int *)(&DAT_00c35f18 + iVar3)] != 0)) { TryUnlock(this,*(int *)(&DAT_00c35f5c + iVar3)); } if (marksDone == 0xc) { TryUnlock(this,*(int *)(&DAT_00c35f24 + iVar3)); } if (characterIndex < 0x11) { iVar1 = specificMarkCount + 1; if (this->_eventCounters[*(int *)(&DAT_00c35ef0 + iVar3)] == 0) { iVar1 = specificMarkCount; } isAllMarked = (bool)(this->_eventCounters[*(int *)(&DAT_00c35f00 + iVar3)] != 0 & isAllMarked); specificMarkCount = iVar1; if (marksDone != 0xc) goto LAB_0092a235; baseAllMarksCount = baseAllMarksCount + 1; uVar2 = allMarksCount + 1; baseAllMarks = baseAllMarksCount; allMarksCount = allMarksCount + 1; } else if (marksDone == 0xc) { uVar2 = allMarksCount + 1; iVar1 = specificMarkCount; allMarksCount = uVar2; } else { LAB_0092a235: iVar1 = specificMarkCount; uVar2 = allMarksCount; } } } characterIndex = characterIndex + 1; } while (characterIndex < 0x22); if (2 < iVar1) { TryUnlock(this,0x15a); iVar1 = specificMarkCount; } if (5 < iVar1) { TryUnlock(this,0x15b); } if (isAllMarked) { TryUnlock(this,0x114); } if (0x10 < baseAllMarks) { TryUnlock(this,0x223); } if (0x21 < uVar2) { TryUnlock(this,0x27c); } } return; } //@@ 0092a2d0 PersistentGameData::AddToCollection /* ZHL [exact] __thiscall void PersistentGameData::AddToCollection(int collectibleID); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PersistentGameData::AddToCollection(PersistentGameData *this,int collectibleID) { if ((this->_isReadOnly == 0) && ((uint)collectibleID < 0x2dd)) { if ((collectibleID != 0) && (*(char *)((int)this->_eventCounters + collectibleID + 0x82c) == '\0')) { *(undefined1 *)((int)this->_eventCounters + collectibleID + 0x82c) = 1; *(undefined1 *)this = 1; check_collection_unlocks(this); } if (((this->field_0xb5c != '\0') && (this->field_0xb27 != '\0')) && (this->field_0xc4c != '\0')) { TryUnlock(this,0x17d); } if ((this->field_0xc39 != '\0') && (this->field_0xbd0 != '\0')) { TryUnlock(this,0x16b); } } return; } //@@ 0092a350 PersistentGameData::check_collection_unlocks /* DB: thiscall PersistentGameData; counts collectibles 1..0x2dc seen/unlocked (skipping 276,283,331,333-335 and hidden), then TryUnlock 69/84 (all 176 ...), 235, 339 and 637 (Dead God) when thresholds reached; called from AddToCollection, TryUnlock, TryAddBestiaryEncounter prototype: db/protos.zhl */ void __thiscall PersistentGameData::check_collection_unlocks(PersistentGameData *this) { ItemConfig_Item *pIVar1; int iVar2; int iVar3; int iVar4; uint id; int iVar5; int iVar6; int local_c; iVar6 = 0; iVar4 = 0; iVar3 = 0; id = 1; local_c = 0; do { if (*(char *)((int)this->_eventCounters + id + 0x82c) == '\0') { if (((((id != 0x114) && (id != 0x14d)) && (id != 0x14e)) && ((id != 0x14f && (id != 0x11b)))) && (id != 0x14b)) { pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,id); if ((pIVar1 == (ItemConfig_Item *)0x0) || (iVar2 = iVar6, pIVar1->hidden != 0)) { iVar4 = iVar4 + 1; iVar2 = iVar6 + 1; if (0x15a < id) { iVar2 = iVar6; } } iVar3 = local_c; goto LAB_0092a3f8; } iVar3 = iVar3 + 1; local_c = iVar3; } else { iVar4 = iVar4 + 1; iVar2 = iVar6 + 1; if (0x15a < id) { iVar2 = iVar6; } LAB_0092a3f8: iVar6 = iVar2; } id = id + 1; if (0x2dc < (int)id) { if (0x159 < iVar3 + iVar6) { iVar5 = 0; iVar6 = 1; iVar2 = 0; do { if (this->_achievements[iVar6] == 0) { if (((((iVar6 == 0x81) || (iVar6 == 0x82)) || (iVar6 == 0x83)) || (((iVar6 == 0x84 || (iVar6 == 0x85)) || ((iVar6 == 0x9c || ((iVar6 == 0x52 || (iVar6 == 0x54)))))))) || (iVar6 == 0xaf)) { iVar2 = iVar2 + 1; } } else { iVar5 = iVar5 + 1; } iVar6 = iVar6 + 1; } while (iVar6 < 0xb3); if (0xb0 < iVar2 + iVar5) { TryUnlock(this,0x45); iVar3 = local_c; } if ((0xb0 < iVar5) && (iVar3 == 0)) { TryUnlock(this,0x54); } } if (0x1fd < iVar4) { iVar6 = 1; iVar3 = 0; do { iVar2 = iVar3 + 1; if (this->_achievements[iVar6] == 0) { iVar2 = iVar3; } iVar6 = iVar6 + 1; iVar3 = iVar2; } while (iVar6 < 0x282); if (0x112 < iVar2) { TryUnlock(this,0xeb); } if (0x191 < iVar2) { TryUnlock(this,0x153); } if ((0x2db < iVar4) && (0x27f < iVar2)) { TryUnlock(this,0x27d); } } return; } } while( true ); } //@@ 0092a520 FUN_0092a520 void FUN_0092a520(uint param_1) { PersistentGameData *in_ECX; if (in_ECX->_isReadOnly == 0) { if (param_1 < 0x10) { if (param_1 - 7 < 7) { param_1 = param_1 - 7; } else if (param_1 == 0xe) { param_1 = 6; } else if (6 < (int)param_1) { return; } *(undefined1 *)((int)in_ECX->_cutsceneCounters + (param_1 - 0xa0)) = 1; *(undefined1 *)in_ECX = 1; KAGE_LogMessage(1,(byte *)"MiniBoss %d added to SaveState\n"); if ((((in_ECX->field_0xe00 != '\0') && (in_ECX->field_0xe01 != '\0')) && (in_ECX->field_0xe02 != '\0')) && (((in_ECX->field_0xe03 != '\0' && (in_ECX->field_0xe04 != '\0')) && ((in_ECX->field_0xe05 != '\0' && (in_ECX->field_0xe06 != '\0')))))) { PersistentGameData::TryUnlock(in_ECX,0x16); return; } } else { KAGE_LogMessage(1,(byte *)"[warn] AddMiniBoss: invalid miniboss id %d\n"); } } return; } //@@ 0092a5e0 FUN_0092a5e0 void FUN_0092a5e0(int param_1) { PersistentGameData *in_ECX; if ((in_ECX->_isReadOnly == 0) && (param_1 < 0x68)) { *(undefined1 *)((int)in_ECX->_cutsceneCounters + param_1 + -0x99) = 1; *(undefined1 *)in_ECX = 1; KAGE_LogMessage(1,(byte *)"Boss %d added to SaveState\n"); if (((in_ECX->field_0xe08 != '\0') && (((in_ECX->field_0xe09 != '\0' && (in_ECX->field_0xe14 != '\0')) && (in_ECX->field_0xe18 != '\0')))) && ((in_ECX->field_0xe33 != '\0' && (in_ECX->field_0xe3f != '\0')))) { PersistentGameData::TryUnlock(in_ECX,0x56); } if (((in_ECX->field_0xe0a != '\0') && (in_ECX->field_0xe0b != '\0')) && ((in_ECX->field_0xe15 != '\0' && (((in_ECX->field_0xe23 != '\0' && (in_ECX->field_0xe36 != '\0')) && (in_ECX->field_0xe34 != '\0')))))) { PersistentGameData::TryUnlock(in_ECX,0x57); } if (((in_ECX->field_0xe0c != '\0') && (in_ECX->field_0xe0d != '\0')) && ((in_ECX->field_0xe16 != '\0' && ((in_ECX->field_0xe37 != '\0' && (in_ECX->field_0xe35 != '\0')))))) { PersistentGameData::TryUnlock(in_ECX,0x58); } if (in_ECX->field_0xe26 != '\0') { PersistentGameData::TryUnlock(in_ECX,0xf); } if ((((in_ECX->field_0xe10 != '\0') && (in_ECX->field_0xe11 != '\0')) && (in_ECX->field_0xe12 != '\0')) && ((in_ECX->field_0xe13 != '\0' && (in_ECX->field_0xe2d != '\0')))) { PersistentGameData::TryUnlock(in_ECX,0x174); } if (((in_ECX->field_0xe54 != '\0') && (in_ECX->field_0xe52 != '\0')) && ((in_ECX->field_0xe53 != '\0' && (in_ECX->field_0xe62 != '\0')))) { PersistentGameData::TryUnlock(in_ECX,0x19c); } if ((((in_ECX->field_0xe5a != '\0') && (in_ECX->field_0xe57 != '\0')) && (in_ECX->field_0xe51 != '\0')) && (in_ECX->field_0xe59 != '\0')) { PersistentGameData::TryUnlock(in_ECX,0x19d); } if (((in_ECX->field_0xe0d != '\0') && (in_ECX->field_0xe56 != '\0')) && (in_ECX->field_0xe58 != '\0')) { PersistentGameData::TryUnlock(in_ECX,0x19e); } } return; } //@@ 0092a7b0 PersistentGameData::AddChallenge /* ZHL [exact] __thiscall void PersistentGameData::AddChallenge(int challengeID); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PersistentGameData::AddChallenge(PersistentGameData *this,int challengeID) { if ((this->_isReadOnly == 0) && ((uint)challengeID < 0x2e)) { *(undefined1 *)((int)this->_cutsceneCounters + challengeID + -0x31) = 1; switch(challengeID) { case 1: TryUnlock(this,0x59); return; case 2: TryUnlock(this,0x5a); return; case 3: TryUnlock(this,0x5b); return; case 4: TryUnlock(this,0x5c); return; case 5: TryUnlock(this,0x5d); return; case 6: TryUnlock(this,0x5e); return; case 7: TryUnlock(this,0x78); return; case 8: TryUnlock(this,0x60); return; case 9: TryUnlock(this,0x61); return; case 10: TryUnlock(this,0x62); return; case 0xb: TryUnlock(this,99); return; case 0xc: TryUnlock(this,100); return; case 0xd: TryUnlock(this,0x3c); return; case 0xe: TryUnlock(this,0x3f); return; case 0xf: TryUnlock(this,0x65); return; case 0x10: TryUnlock(this,0x66); return; case 0x11: TryUnlock(this,0x67); return; case 0x12: TryUnlock(this,0x68); return; case 0x13: TryUnlock(this,0x3e); return; case 0x14: TryUnlock(this,0x5f); return; case 0x15: TryUnlock(this,0xe0); return; case 0x16: TryUnlock(this,0xe1); return; case 0x17: TryUnlock(this,0xe2); return; case 0x18: TryUnlock(this,0xe3); return; case 0x19: TryUnlock(this,0xe4); return; case 0x1a: TryUnlock(this,0xe5); return; case 0x1b: TryUnlock(this,0xe6); return; case 0x1c: TryUnlock(this,0xe7); return; case 0x1d: TryUnlock(this,0xe8); return; case 0x1e: TryUnlock(this,0xe9); return; case 0x1f: TryUnlock(this,0x14b); return; case 0x20: TryUnlock(this,0x14c); return; case 0x21: TryUnlock(this,0x14d); return; case 0x22: TryUnlock(this,0x14e); return; case 0x23: TryUnlock(this,0x14f); return; case 0x24: TryUnlock(this,0x205); return; case 0x25: TryUnlock(this,0x206); return; case 0x26: TryUnlock(this,0x207); return; case 0x27: TryUnlock(this,0x208); return; case 0x28: TryUnlock(this,0x209); return; case 0x29: TryUnlock(this,0x20a); return; case 0x2a: TryUnlock(this,0x213); return; case 0x2b: TryUnlock(this,0x214); return; case 0x2c: TryUnlock(this,0x215); return; case 0x2d: TryUnlock(this,0x21a); return; } } return; } //@@ 0092aaf0 FUN_0092aaf0 uint FUN_0092aaf0(int param_1,int param_2) { EntityConfig_Entity *in_EAX; uint uVar1; int in_ECX; if (*(char *)(in_ECX + 1) == '\0') { in_EAX = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,param_1,param_2); if ((in_EAX != (EntityConfig_Entity *)0x0) && (in_EAX->bestiary != 0)) { uVar1 = FUN_0092ab40((in_EAX->id << 0xc | in_EAX->variant) << 8); return uVar1; } } return (uint)in_EAX & 0xffffff00; } //@@ 0092ab40 FUN_0092ab40 undefined4 FUN_0092ab40(int param_1) { int *piVar1; undefined4 *puVar2; int in_ECX; int local_18; undefined1 local_14 [8]; int local_c; if (*(char *)(in_ECX + 1) != '\0') { return 0; } local_18 = param_1; std::set::find_node(local_14,&local_18); if (((*(char *)(local_c + 0xd) == '\0') && (*(int *)(local_c + 0x10) <= param_1)) && (local_c != *(int *)(in_ECX + 0xf74))) { local_18 = param_1; piVar1 = (int *)std::map::operator_index(&local_18); *piVar1 = *piVar1 + 1; return 1; } local_18 = param_1; puVar2 = (undefined4 *)std::map::operator_index(&local_18); *puVar2 = 1; return 1; } //@@ 0092abd0 FUN_0092abd0 uint FUN_0092abd0(int param_1,int param_2) { EntityConfig_Entity *in_EAX; uint uVar1; int in_ECX; if (*(char *)(in_ECX + 1) == '\0') { in_EAX = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,param_1,param_2); if ((in_EAX != (EntityConfig_Entity *)0x0) && (in_EAX->bestiary != 0)) { uVar1 = FUN_0092ac20((in_EAX->id << 0xc | in_EAX->variant) << 8); return uVar1; } } return (uint)in_EAX & 0xffffff00; } //@@ 0092ac20 FUN_0092ac20 undefined4 FUN_0092ac20(int param_1) { int *piVar1; undefined4 *puVar2; int in_ECX; int local_18; undefined1 local_14 [8]; int local_c; if (*(char *)(in_ECX + 1) != '\0') { return 0; } local_18 = param_1; std::set::find_node(local_14,&local_18); if (((*(char *)(local_c + 0xd) == '\0') && (*(int *)(local_c + 0x10) <= param_1)) && (local_c != *(int *)(in_ECX + 0xf7c))) { local_18 = param_1; piVar1 = (int *)std::map::operator_index(&local_18); *piVar1 = *piVar1 + 1; return 1; } local_18 = param_1; puVar2 = (undefined4 *)std::map::operator_index(&local_18); *puVar2 = 1; return 1; } //@@ 0092acb0 PersistentGameData::AddBestiaryKill /* ZHL [exact] __thiscall bool PersistentGameData::AddBestiaryKill(int EntityType, int EntityVariant); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall PersistentGameData::AddBestiaryKill(PersistentGameData *this,int EntityType,int EntityVariant) { EntityConfig_Entity *pEVar1; int *piVar2; undefined4 *puVar3; uint uVar4; int iVar5; int iVar6; PersistentGameData *this_00; undefined1 local_10 [8]; void *local_8; if (((this->_isReadOnly != 0) || (pEVar1 = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,EntityType,EntityVariant), pEVar1 == (EntityConfig_Entity *)0x0)) || (pEVar1->bestiary == 0)) { return 0; } iVar6 = (pEVar1->id << 0xc | pEVar1->variant) * 0x100; EntityVariant = iVar6; std::set::find_node(local_10,&EntityVariant); if (((*(char *)((int)local_8 + 0xd) == '\0') && (*(int *)((int)local_8 + 0x10) <= iVar6)) && (local_8 != (this->_bestiaryKills)._head)) { EntityVariant = iVar6; piVar2 = (int *)std::map::operator_index(&EntityVariant); *piVar2 = *piVar2 + 1; } else { EntityType = iVar6; puVar3 = (undefined4 *)std::map::operator_index(&EntityType); *puVar3 = 1; } this_00 = &g_manager->_persistentGameData; uVar4 = GetBestiaryKillCount(this_00,pEVar1->id,pEVar1->variant); switch(pEVar1->id) { case 0x10f: case 0x110: iVar6 = GetBestiaryKillCount(this_00,0x110,0); iVar5 = GetBestiaryKillCount(this_00,0x10f,0); if (9 < (uint)(iVar6 + iVar5)) { TryUnlock(this_00,0x175); } break; case 0x132: if (0x13 < uVar4) { TryUnlock(this_00,0x15d); return 1; } break; case 0x194: if (0x13 < uVar4) { TryUnlock(this_00,0x164); return 1; } } return 1; } //@@ 0092aea0 PersistentGameData::TryAddBestiaryEncounter /* DB: ? GetBestiaryConfig, encounter set, Steam achievement prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall PersistentGameData::TryAddBestiaryEncounter(PersistentGameData *this,int type,int variant) { PersistentGameData *this_00; int *piVar1; Manager *pMVar2; byte bVar3; undefined4 *puVar4; int iVar5; int *extraout_ECX; int *extraout_ECX_00; int *piVar6; uint uVar7; float fVar8; int *local_24; int *local_20; int *local_1c; EntityConfig_Entity *local_18; undefined1 local_14 [8]; void *local_c; if (this->_isReadOnly != 0) { return 0; } local_18 = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,type,variant); if (local_18 == (EntityConfig_Entity *)0x0) { return 0; } if (local_18->bestiary == 0) { return 0; } piVar6 = (int *)((local_18->id << 0xc | local_18->variant) * 0x100); local_24 = piVar6; std::set::find_node(local_14,&local_24); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) <= (int)piVar6)) && (local_c != (this->_bestiaryEncounters)._head)) { local_20 = piVar6; piVar6 = (int *)std::map::operator_index(&local_20); *piVar6 = *piVar6 + 1; piVar6 = extraout_ECX; } else { local_1c = piVar6; puVar4 = (undefined4 *)std::map::operator_index(&local_1c); *puVar4 = 1; piVar6 = extraout_ECX_00; } if (DAT_00c7f508 == 0) { piVar1 = (g_manager->_entityConfig)._entities._head; local_24 = (int *)*piVar1; piVar6 = local_24; if (local_24 != piVar1) { fVar8 = 0.0; uVar7 = DAT_00c7f508; do { if (((-1 < local_24[0x1f]) && ((float)local_24[0x1a] != fVar8)) && ((char)local_24[0x40] != '\0')) { uVar7 = uVar7 + 1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); } while (local_24 != piVar1); piVar6 = local_24; DAT_00c7f508 = uVar7; } } pMVar2 = g_manager; if (((DAT_00c7f508 <= (this->_bestiaryEncounters)._size) && (this_00 = &g_manager->_persistentGameData, (g_manager->_persistentGameData)._isReadOnly == 0) ) && ((g_manager->_persistentGameData)._achievements[0x144] == 0)) { (g_manager->_persistentGameData)._achievements[0x144] = 1; if (((pMVar2->_netplayManager == *(NetplayManager *)(pMVar2 + 1)) || (bVar3 = Manager::IsGameplayInputActive((int)piVar6), bVar3 == 0)) && ((pMVar2->_persistentGameData)._isSteamAchievementsEnabled != 0)) { UnlockSteamAchievement(this_00,0x144); Manager::queue_achievement_popup(0x144); } *(undefined1 *)this_00 = 1; check_challenge_unlocks(this_00); check_collection_unlocks(this_00); } if (((local_18->id == 0x4e) && (local_18->variant != 0)) && (iVar5 = GetBestiaryEncounterCount(this,0x4e,0), iVar5 == 0)) { TryAddBestiaryEncounter(this,0x4e,0); AddBestiaryKill(this,0x4e,0); } return 1; } //@@ 0092b070 PersistentGameData::GetBestiaryDeathCount /* ZHL [exact] __thiscall int PersistentGameData::GetBestiaryDeathCount(int EntityType, int EntityVariant); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall PersistentGameData::GetBestiaryDeathCount(PersistentGameData *this,int EntityType,int EntityVariant) { EntityConfig_Entity *pEVar1; int iVar2; undefined1 local_10 [8]; void *local_8; pEVar1 = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,EntityType,EntityVariant); if ((pEVar1 == (EntityConfig_Entity *)0x0) || (pEVar1->bestiary == 0)) { return 0; } iVar2 = (pEVar1->id << 0xc | pEVar1->variant) * 0x100; EntityVariant = iVar2; std::set::find_node(local_10,&EntityVariant); if (((*(char *)((int)local_8 + 0xd) == '\0') && (*(int *)((int)local_8 + 0x10) <= iVar2)) && (local_8 != (this->_bestiaryDeaths)._head)) { return *(int *)((int)local_8 + 0x14); } return 0; } //@@ 0092b100 PersistentGameData::GetBestiaryKillCount /* ZHL [exact] __thiscall int PersistentGameData::GetBestiaryKillCount(int EntityType, int EntityVariant); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall PersistentGameData::GetBestiaryKillCount(PersistentGameData *this,int EntityType,int EntityVariant) { EntityConfig_Entity *pEVar1; int iVar2; undefined1 local_10 [8]; void *local_8; pEVar1 = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,EntityType,EntityVariant); if ((pEVar1 == (EntityConfig_Entity *)0x0) || (pEVar1->bestiary == 0)) { return 0; } iVar2 = (pEVar1->id << 0xc | pEVar1->variant) * 0x100; EntityVariant = iVar2; std::set::find_node(local_10,&EntityVariant); if (((*(char *)((int)local_8 + 0xd) == '\0') && (*(int *)((int)local_8 + 0x10) <= iVar2)) && (local_8 != (this->_bestiaryKills)._head)) { return *(int *)((int)local_8 + 0x14); } return 0; } //@@ 0092b190 PersistentGameData::GetBestiaryEncounterCount /* ZHL [exact] __thiscall int PersistentGameData::GetBestiaryEncounterCount(int EntityType, int EntityVariant); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall PersistentGameData::GetBestiaryEncounterCount (PersistentGameData *this,int EntityType,int EntityVariant) { EntityConfig_Entity *pEVar1; int iVar2; pEVar1 = EntityConfig::GetBestiaryConfig(&g_manager->_entityConfig,EntityType,EntityVariant); if ((pEVar1 == (EntityConfig_Entity *)0x0) || (pEVar1->bestiary == 0)) { return 0; } iVar2 = FUN_0092b1e0((pEVar1->id << 0xc | pEVar1->variant) << 8); return iVar2; } //@@ 0092b1e0 FUN_0092b1e0 undefined4 FUN_0092b1e0(int param_1) { int iVar1; int in_ECX; undefined1 local_10 [8]; int local_8; iVar1 = param_1; std::set::find_node(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) == '\0') && (*(int *)(local_8 + 0x10) <= iVar1)) && (local_8 != *(int *)(in_ECX + 0xf64))) { return *(undefined4 *)(local_8 + 0x14); } return 0; } //@@ 0092b230 FUN_0092b230 void FUN_0092b230(int param_1) { undefined1 *in_ECX; if (in_ECX[1] == '\0') { in_ECX[param_1 + 0xf14] = 1; in_ECX[0xf14] = 0; *in_ECX = 1; KAGE_LogMessage(1,(byte *)"Seed %d added to SaveState\n"); } return; } //@@ 0092b270 PersistentGameData::set_run_mask /* DB: ? ECX=PersistentGameData: stores two dwords at +0x5ac/+0xa7c, counts set bits 0..0x28 across them and TryUnlock(0x143) when more than 4, sets byte +0; Manager::RestartGame calls it with (0,0) */ void PersistentGameData::set_run_mask(uint param_1,uint param_2) { uint uVar1; PersistentGameData *in_ECX; uint uVar2; uint uVar3; int iVar4; iVar4 = 0; in_ECX->_eventCounters[0xbc] = param_1; in_ECX->_eventCounters[0x1f0] = param_2; uVar1 = 0; do { uVar3 = 1 << (uVar1 & 0x1f); uVar2 = 0; if (0x1f < uVar1) { uVar2 = uVar3; } uVar3 = uVar3 ^ uVar2; if (0x3f < uVar1) { uVar2 = uVar3; } if ((uVar3 & param_1) != 0 || (uVar2 & param_2) != 0) { iVar4 = iVar4 + 1; } uVar1 = uVar1 + 1; } while ((int)uVar1 < 0x29); if (4 < iVar4) { TryUnlock(in_ECX,0x143); } *(undefined1 *)in_ECX = 1; return; } //@@ 0092b2e0 PersistentGameData::TryImportRebirthLocalSave /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0092b4ef) */ /* ZHL [exact] __thiscall bool PersistentGameData::TryImportRebirthLocalSave(const char* path); */ undefined1 __thiscall PersistentGameData::TryImportRebirthLocalSave(PersistentGameData *this,byte *param_2) { char cVar1; char isFileOpen; byte *searchText; int *saveFile; int iVar2; int *steamContext; byte *pbVar3; undefined3 uVar6; byte *****extraout_ECX; undefined4 extraout_ECX_00; byte *****pppppbVar4; void *freeBlock; byte *****pppppbVar5; byte *****compareCursor; uint uVar7; undefined4 *copySrc; byte *****matchPos; undefined4 *copyDst; int *unaff_FS_OFFSET; bool bVar8; undefined8 counterEntry; undefined1 isImported; void *rebirthSavePath [4]; undefined4 rebirthSavePathSize; uint rebirthSavePathCapacity; void *pvStack_4e0; undefined4 uStack_4d0; uint uStack_4cc; undefined4 rebirthAchievements; undefined4 uStack_298; undefined1 uStack_10c; undefined1 uStack_10b; undefined1 uStack_10a; undefined1 uStack_109; undefined1 uStack_108; undefined1 uStack_107; undefined1 uStack_106; undefined4 uStack_105; undefined4 uStack_101; undefined4 uStack_fd; undefined4 uStack_f9; undefined4 uStack_f5; undefined4 uStack_f1; undefined4 uStack_ed; undefined4 uStack_e9; undefined4 uStack_e5; undefined4 uStack_e1; undefined4 uStack_dd; undefined4 uStack_d9; undefined8 uStack_d5; undefined1 uStack_cd; undefined4 uStack_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined1 uStack_b8; int rebirthCutsceneCounter0; int rebirthCutsceneCounter1; int rebirthCutsceneCounter2; int rebirthCutsceneCounter3; int rebirthCutsceneCounter4; int rebirthCutsceneCounter5; int rebirthCutsceneCounter6; int rebirthCutsceneCounter7; int rebirthCutsceneCounter8; int rebirthCutsceneCounter9; int rebirthCutsceneCounter10; int rebirthCutsceneCounter11; int rebirthCutsceneCounter12; int rebirthCutsceneCounter13; int rebirthCutsceneCounter14; int rebirthCutsceneCounter15; int rebirthCutsceneCounter16; int rebirthCutsceneCounter17; int rebirthCutsceneCounter18; int rebirthCutsceneCounter19; int rebirthLastDifficulty; byte *pbStack_54; undefined4 searchTextSize; undefined4 searchTextCapacity; byte *****rebirthPath [4]; uint rebirthPathSize; uint rebirthPathCapacity; uint stackCookie; byte *****pppppbStack_20; int iStack_1c; undefined *puStack_18; byte ****ppppbStack_14; byte curByte; Manager *manager; pppppbStack_20 = (byte *****)(rebirthPath + 0xe); ppppbStack_14 = (byte ****)0xffffffff; puStack_18 = &UNK_00b0aa10; iStack_1c = *unaff_FS_OFFSET; stackCookie = __security_cookie ^ (uint)(rebirthPath + 0xb); *unaff_FS_OFFSET = (int)&iStack_1c; searchText = std::_Allocate(0x20); searchTextSize = 0x1c; searchText[0] = 'B'; searchText[1] = 'i'; searchText[2] = 'n'; searchText[3] = 'd'; searchText[4] = 'i'; searchText[5] = 'n'; searchText[6] = 'g'; searchText[7] = ' '; searchText[8] = 'o'; searchText[9] = 'f'; searchText[10] = ' '; searchText[0xb] = 'I'; searchText[0xc] = 's'; searchText[0xd] = 'a'; searchText[0xe] = 'a'; searchText[0xf] = 'c'; searchTextCapacity = 0x1f; searchText[0x10] = 0x20; searchText[0x11] = 0x52; searchText[0x12] = 0x65; searchText[0x13] = 0x70; searchText[0x14] = 0x65; searchText[0x15] = 0x6e; searchText[0x16] = 0x74; searchText[0x17] = 0x61; searchText[0x18] = 'n'; searchText[0x19] = 'c'; searchText[0x1a] = 'e'; searchText[0x1b] = '+'; searchText[0x1c] = 0; ppppbStack_14 = (byte ****)0x0; rebirthPathSize = 0; rebirthPathCapacity = 0xf; rebirthPath[0] = (byte *****)0x0; pbVar3 = param_2; do { curByte = *pbVar3; pbVar3 = pbVar3 + 1; } while (curByte != 0); pbStack_54 = searchText; std::string::assign((char *)rebirthPath,param_2,(int)pbVar3 - (int)(param_2 + 1)); ppppbStack_14._0_1_ = 1; pppppbVar5 = (byte *****)rebirthPath; if (0xf < rebirthPathCapacity) { pppppbVar5 = rebirthPath[0]; } pppppbVar4 = pppppbVar5; if (0x1b < rebirthPathSize) { iVar2 = -1; if (rebirthPathSize - 0x1c != -1) { iVar2 = rebirthPathSize - 0x1c; } matchPos = (byte *****)((int)pppppbVar5 + iVar2); do { if (*(byte *)matchPos == *searchText) { uVar7 = 0x18; pbVar3 = searchText; compareCursor = matchPos; do { pppppbVar4 = (byte *****)*compareCursor; if (pppppbVar4 != *(byte ******)pbVar3) { bVar8 = (byte)pppppbVar4 < *pbVar3; if ((byte)pppppbVar4 == *pbVar3) { curByte = *(byte *)((int)compareCursor + 1); uVar6 = (undefined3)((uint)pppppbVar4 >> 8); pppppbVar4 = (byte *****)CONCAT31(uVar6,curByte); bVar8 = curByte < pbVar3[1]; if (curByte == pbVar3[1]) { curByte = *(byte *)((int)compareCursor + 2); pppppbVar4 = (byte *****)CONCAT31(uVar6,curByte); bVar8 = curByte < pbVar3[2]; if (curByte == pbVar3[2]) { curByte = *(byte *)((int)compareCursor + 3); pppppbVar4 = (byte *****)CONCAT31(uVar6,curByte); bVar8 = curByte < pbVar3[3]; if (curByte == pbVar3[3]) { uVar7 = 0; goto LAB_0092b42a; } } } } uVar7 = -(uint)bVar8 | 1; goto LAB_0092b42a; } compareCursor = compareCursor + 1; pbVar3 = pbVar3 + 4; bVar8 = 3 < uVar7; uVar7 = uVar7 - 4; } while (bVar8); uVar7 = 0; LAB_0092b42a: if (uVar7 == 0) { if ((int)matchPos - (int)pppppbVar5 != 0xffffffff) { std::string::replace ((char *)rebirthPath,(int)matchPos - (int)pppppbVar5,0x1c, (byte *)"Binding of Isaac Rebirth",0x18); pppppbVar4 = extraout_ECX; } break; } } pppppbVar4 = pppppbVar5; if (matchPos == pppppbVar5) break; matchPos = (byte *****)((int)matchPos + -1); } while( true ); } pppppbVar5 = (byte *****)rebirthPath; if (0xf < rebirthPathCapacity) { pppppbVar5 = rebirthPath[0]; } rebirthSavePathSize = 0; rebirthSavePathCapacity = 0xf; rebirthSavePath[0] = (void *)0x0; uStack_4d0 = 0; uStack_4cc = 0xf; pvStack_4e0 = (void *)0x0; RebirthSaveData::Clear(pppppbVar4); ppppbStack_14 = (byte ****)CONCAT31(ppppbStack_14._1_3_,2); RebirthSaveData::Clear(extraout_ECX_00); pppppbVar4 = pppppbVar5; do { cVar1 = *(char *)pppppbVar4; pppppbVar4 = (byte *****)((int)pppppbVar4 + 1); } while (cVar1 != '\0'); std::string::assign((char *)rebirthSavePath,(byte *)pppppbVar5, (int)pppppbVar4 - ((int)pppppbVar5 + 1)); KAGE_LogMessage(1,(byte *)"Loading RebirthPersistentGameData from disk: %s.\n"); saveFile = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)pppppbVar5); if (saveFile == (int *)0x0) { LAB_0092b7ec: isImported = 0; } else { cVar1 = (**(code **)(*saveFile + 0x30))(); if ((cVar1 != '\0') && (iVar2 = _fileno((FILE *)saveFile[3]), -1 < iVar2)) { flock(iVar2,1); } cVar1 = func_0x009e4260(); isFileOpen = (**(code **)(*saveFile + 0x30))(); if ((isFileOpen != '\0') && (iVar2 = _fileno((FILE *)saveFile[3]), -1 < iVar2)) { flock(iVar2,8); } (**(code **)(*saveFile + 0x34))(); if (cVar1 == '\0') goto LAB_0092b7ec; Clear(this,1); copySrc = &rebirthAchievements; pbVar3 = this->_achievements; for (iVar2 = 0x2c; iVar2 != 0; iVar2 = iVar2 + -1) { *(undefined4 *)pbVar3 = *copySrc; copySrc = copySrc + 1; pbVar3 = pbVar3 + 4; } *(undefined2 *)pbVar3 = *(undefined2 *)copySrc; pbVar3[2] = *(byte *)((int)copySrc + 2); *(undefined4 *)&this->field_0xe07 = uStack_105; *(undefined4 *)&this->field_0xe0b = uStack_101; *(undefined4 *)&this->field_0xe0f = uStack_fd; *(undefined4 *)&this->field_0xe13 = uStack_f9; *(undefined4 *)&this->field_0xe17 = uStack_f5; *(undefined4 *)&this->field_0xe1b = uStack_f1; *(undefined4 *)&this->field_0xe1f = uStack_ed; *(undefined4 *)&this->field_0xe23 = uStack_e9; *(undefined4 *)&this->field_0xe27 = uStack_e5; *(undefined4 *)&this->field_0xe2b = uStack_e1; *(undefined4 *)&this->field_0xe2f = uStack_dd; *(undefined4 *)&this->field_0xe33 = uStack_d9; *(undefined8 *)&this->field_0xe37 = uStack_d5; this->field_0xe3f = uStack_cd; *(undefined4 *)&this->field_0xe6f = uStack_cc; *(undefined4 *)&this->field_0xe73 = uStack_c8; *(undefined4 *)&this->field_0xe77 = uStack_c4; *(undefined4 *)&this->field_0xe7b = uStack_c0; *(undefined4 *)&this->field_0xe7f = uStack_bc; this->field_0xe83 = uStack_b8; copySrc = &uStack_298; copyDst = (undefined4 *)&this->field_0xae8; for (iVar2 = 0x56; iVar2 != 0; iVar2 = iVar2 + -1) { *copyDst = *copySrc; copySrc = copySrc + 1; copyDst = copyDst + 1; } *(undefined2 *)copyDst = *(undefined2 *)copySrc; *(undefined1 *)((int)copyDst + 2) = *(undefined1 *)((int)copySrc + 2); iVar2 = 0; do { counterEntry = func_0x009e3ea0(); iVar2 = iVar2 + 1; this->_eventCounters[(int)counterEntry] = (int)((ulonglong)counterEntry >> 0x20); } while (iVar2 < 0x5f); iVar2 = 0; this->_cutsceneCounters[0] = rebirthCutsceneCounter0; this->_cutsceneCounters[1] = rebirthCutsceneCounter1; this->_cutsceneCounters[2] = rebirthCutsceneCounter2; this->_cutsceneCounters[3] = rebirthCutsceneCounter3; this->_cutsceneCounters[4] = rebirthCutsceneCounter4; this->_cutsceneCounters[5] = rebirthCutsceneCounter5; this->_cutsceneCounters[6] = rebirthCutsceneCounter6; this->_cutsceneCounters[7] = rebirthCutsceneCounter7; this->_cutsceneCounters[8] = rebirthCutsceneCounter8; this->_cutsceneCounters[9] = rebirthCutsceneCounter9; this->_cutsceneCounters[10] = rebirthCutsceneCounter10; this->_cutsceneCounters[0xb] = rebirthCutsceneCounter11; this->_cutsceneCounters[0xc] = rebirthCutsceneCounter12; this->_cutsceneCounters[0xd] = rebirthCutsceneCounter13; this->_cutsceneCounters[0xe] = rebirthCutsceneCounter14; this->_cutsceneCounters[0xf] = rebirthCutsceneCounter15; this->_cutsceneCounters[0x10] = rebirthCutsceneCounter16; this->_cutsceneCounters[0x11] = rebirthCutsceneCounter17; this->_cutsceneCounters[0x12] = rebirthCutsceneCounter18; this->_cutsceneCounters[0x13] = rebirthCutsceneCounter19; this->field_0xe00 = uStack_10c; this->field_0xe01 = uStack_10b; this->field_0xe02 = uStack_10a; this->field_0xe03 = uStack_109; this->field_0xe04 = uStack_108; this->field_0xe05 = uStack_107; this->field_0xe06 = uStack_106; this->_lastDifficulty = rebirthLastDifficulty; do { counterEntry = func_0x009e4f80(); iVar2 = iVar2 + 1; this->_cutsceneCounters[(int)counterEntry + -0x36] = (int)((ulonglong)counterEntry >> 0x20); manager = g_manager; } while (iVar2 < 0xc); *(undefined1 *)this = 1; iVar2 = (manager->_optionsConfig)._popupsMode; (manager->_optionsConfig)._popupsMode = 0; check_challenge_unlocks(this); IncreaseEventCounter(this,0,0); (g_manager->_optionsConfig)._popupsMode = iVar2; if ((*(char *)this == '\0') || (this->_isFileLoaded == 0)) { LAB_0092b7d7: isImported = 1; } else { *(undefined1 *)this = 0; Manager::BackupSaveFile((Manager *)this); manager = g_manager; steamContext = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*steamContext == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) { Save(this); goto LAB_0092b7d7; } SaveToSteamCloud(this); isImported = 1; } } ppppbStack_14 = (byte ****)CONCAT31(ppppbStack_14._1_3_,4); if (saveFile != (int *)0x0) { (**(code **)*saveFile)(1); } if (0xf < uStack_4cc) { uVar7 = uStack_4cc + 1; freeBlock = pvStack_4e0; if (0xfff < uVar7) { freeBlock = *(void **)((int)pvStack_4e0 + -4); uVar7 = uStack_4cc + 0x24; if (0x1f < (uint)((int)pvStack_4e0 + (-4 - (int)freeBlock))) goto LAB_0092b8cf; } operator_delete(freeBlock,uVar7); } uStack_4d0 = 0; uStack_4cc = 0xf; pvStack_4e0 = (void *)((uint)pvStack_4e0 & 0xffffff00); if (0xf < rebirthSavePathCapacity) { uVar7 = rebirthSavePathCapacity + 1; freeBlock = rebirthSavePath[0]; if (0xfff < uVar7) { freeBlock = *(void **)((int)rebirthSavePath[0] + -4); uVar7 = rebirthSavePathCapacity + 0x24; if (0x1f < (uint)((int)rebirthSavePath[0] + (-4 - (int)freeBlock))) goto LAB_0092b8cf; } operator_delete(freeBlock,uVar7); } rebirthSavePathSize = 0; rebirthSavePathCapacity = 0xf; rebirthSavePath[0] = (void *)((uint)rebirthSavePath[0] & 0xffffff00); if (0xf < rebirthPathCapacity) { uVar7 = rebirthPathCapacity + 1; pppppbVar5 = rebirthPath[0]; if (0xfff < uVar7) { pppppbVar5 = (byte *****)rebirthPath[0][-1]; uVar7 = rebirthPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)rebirthPath[0] + (-4 - (int)pppppbVar5))) { LAB_0092b8cf: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar5,uVar7); } rebirthPathSize = 0; rebirthPathCapacity = 0xf; rebirthPath[0] = (byte *****)((uint)rebirthPath[0] & 0xffffff00); operator_delete(searchText,0x20); *unaff_FS_OFFSET = iStack_1c; return isImported; } //@@ 0092b930 PersistentGameData::import_afterbirth_save /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0092bcc2) */ /* WARNING: Removing unreachable block (ram,0x0092bc71) */ /* WARNING: Removing unreachable block (ram,0x0092bc82) */ /* WARNING: Removing unreachable block (ram,0x0092bc92) */ /* WARNING: Removing unreachable block (ram,0x0092bcd3) */ /* WARNING: Removing unreachable block (ram,0x0092bce3) */ /* WARNING: Removing unreachable block (ram,0x0092bce9) */ /* DB: ? only caller PersistentGameData::TryImportABLocalSave (result to this+0x3e3): AfterbirthPersistentGameData::check_header on the stream, PersistentGameData::Clear, copies achievements/counters/etc from the AB+ layout prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall PersistentGameData::import_afterbirth_save(PersistentGameData *this,void *stream) { char isHeaderValid; uint uVar1; int *steamContext; undefined4 extraout_ECX; int iVar2; byte *srcAchievement; undefined4 *srcWord; byte *dstAchievement; undefined4 *dstWord; undefined8 remap; byte isImported; byte abAchievements [280]; int abEventCounters [162]; undefined4 local_338 [111]; undefined4 local_17c; undefined4 uStack_178; undefined4 uStack_174; undefined4 uStack_170; undefined4 local_16c; undefined4 uStack_168; undefined4 uStack_164; undefined4 uStack_160; undefined4 local_15c; undefined4 uStack_158; undefined4 uStack_154; undefined4 uStack_150; undefined1 local_14c; undefined1 local_14b; undefined1 local_14a; undefined1 local_149; undefined1 local_148; undefined1 local_147; undefined1 local_146; undefined4 local_145; undefined4 uStack_141; undefined4 uStack_13d; undefined4 uStack_139; undefined4 local_135; undefined4 uStack_131; undefined4 uStack_12d; undefined4 uStack_129; undefined4 local_125; undefined4 uStack_121; undefined4 uStack_11d; undefined4 uStack_119; undefined4 local_115; undefined4 uStack_111; undefined4 uStack_10d; undefined4 uStack_109; undefined2 local_105; undefined1 local_103; undefined4 local_102; undefined4 uStack_fe; undefined4 uStack_fa; undefined4 uStack_f6; undefined4 local_f2; undefined4 uStack_ee; undefined4 local_ea; undefined2 local_e6; undefined1 local_e4; int local_e0; int iStack_dc; int iStack_d8; int iStack_d4; int local_d0; int iStack_cc; int iStack_c8; int iStack_c4; int local_c0; int iStack_bc; int iStack_b8; int iStack_b4; int local_b0; int iStack_ac; int iStack_a8; int iStack_a4; int local_a0; int iStack_9c; int iStack_98; int iStack_94; undefined8 local_90; int abLastDifficulty; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0aa50; local_1c = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_24 = uVar1; FUN_0041d560(this); local_14 = 0; FUN_0041d560(extraout_ECX); (**(code **)(*(int *)stream + 0xc))(0,0,uVar1); isHeaderValid = AfterbirthPersistentGameData::check_header(stream); if (isHeaderValid == '\0') { isImported = 0; } else { Clear(this,1); srcAchievement = abAchievements; dstAchievement = this->_achievements; for (iVar2 = 0x45; iVar2 != 0; iVar2 = iVar2 + -1) { *(undefined4 *)dstAchievement = *(undefined4 *)srcAchievement; srcAchievement = srcAchievement + 4; dstAchievement = dstAchievement + 4; } *dstAchievement = *srcAchievement; *(undefined4 *)&this->field_0xe07 = local_145; *(undefined4 *)&this->field_0xe0b = uStack_141; *(undefined4 *)&this->field_0xe0f = uStack_13d; *(undefined4 *)&this->field_0xe13 = uStack_139; *(undefined4 *)&this->field_0xe17 = local_135; *(undefined4 *)&this->field_0xe1b = uStack_131; *(undefined4 *)&this->field_0xe1f = uStack_12d; *(undefined4 *)&this->field_0xe23 = uStack_129; *(undefined4 *)&this->field_0xe27 = local_125; *(undefined4 *)&this->field_0xe2b = uStack_121; *(undefined4 *)&this->field_0xe2f = uStack_11d; *(undefined4 *)&this->field_0xe33 = uStack_119; *(undefined4 *)&this->field_0xe37 = local_115; *(undefined4 *)&this->field_0xe3b = uStack_111; *(undefined4 *)&this->field_0xe3f = uStack_10d; *(undefined4 *)&this->field_0xe43 = uStack_109; *(undefined2 *)&this->field_0xe47 = local_105; this->field_0xe49 = local_103; *(undefined4 *)&this->field_0xe6f = local_102; *(undefined4 *)&this->field_0xe73 = uStack_fe; *(undefined4 *)&this->field_0xe77 = uStack_fa; *(undefined4 *)&this->field_0xe7b = uStack_f6; *(undefined4 *)&this->field_0xe7f = local_f2; *(undefined4 *)&this->field_0xe83 = uStack_ee; *(undefined4 *)&this->field_0xe87 = local_ea; *(undefined2 *)&this->field_0xe8b = local_e6; this->field_0xe8d = local_e4; srcWord = local_338; dstWord = (undefined4 *)&this->field_0xae8; for (iVar2 = 0x6e; iVar2 != 0; iVar2 = iVar2 + -1) { *dstWord = *srcWord; srcWord = srcWord + 1; dstWord = dstWord + 1; } *(undefined2 *)dstWord = *(undefined2 *)srcWord; do { remap = afterbirth_save_index_remap(); iVar2 = (int)((ulonglong)remap >> 0x20); this->_eventCounters[(int)remap] = abEventCounters[iVar2]; } while (iVar2 + 1 < 0xa2); this->_cutsceneCounters[0] = local_e0; this->_cutsceneCounters[1] = iStack_dc; this->_cutsceneCounters[2] = iStack_d8; this->_cutsceneCounters[3] = iStack_d4; this->_cutsceneCounters[4] = local_d0; this->_cutsceneCounters[5] = iStack_cc; this->_cutsceneCounters[6] = iStack_c8; this->_cutsceneCounters[7] = iStack_c4; this->_cutsceneCounters[8] = local_c0; this->_cutsceneCounters[9] = iStack_bc; this->_cutsceneCounters[10] = iStack_b8; this->_cutsceneCounters[0xb] = iStack_b4; this->_cutsceneCounters[0xc] = local_b0; this->_cutsceneCounters[0xd] = iStack_ac; this->_cutsceneCounters[0xe] = iStack_a8; this->_cutsceneCounters[0xf] = iStack_a4; this->_cutsceneCounters[0x10] = local_a0; this->_cutsceneCounters[0x11] = iStack_9c; this->_cutsceneCounters[0x12] = iStack_98; this->_cutsceneCounters[0x13] = iStack_94; *(undefined8 *)(this->_cutsceneCounters + 0x14) = local_90; this->field_0xe00 = local_14c; this->field_0xe01 = local_14b; this->field_0xe02 = local_14a; this->field_0xe03 = local_149; this->field_0xe04 = local_148; this->field_0xe05 = local_147; this->field_0xe06 = local_146; this->_lastDifficulty = abLastDifficulty; manager = g_manager; *(undefined4 *)&this->field_0xdc8 = local_17c; *(undefined4 *)&this->field_0xdcc = uStack_178; *(undefined4 *)&this->field_0xdd0 = uStack_174; *(undefined4 *)&this->field_0xdd4 = uStack_170; *(undefined4 *)&this->field_0xdd8 = local_16c; *(undefined4 *)&this->field_0xddc = uStack_168; *(undefined4 *)&this->field_0xde0 = uStack_164; *(undefined4 *)&this->field_0xde4 = uStack_160; *(undefined4 *)&this->field_0xde8 = local_15c; *(undefined4 *)&this->field_0xdec = uStack_158; *(undefined4 *)&this->field_0xdf0 = uStack_154; *(undefined4 *)&this->field_0xdf4 = uStack_150; *(undefined1 *)this = 1; iVar2 = (manager->_optionsConfig)._popupsMode; (manager->_optionsConfig)._popupsMode = 0; check_challenge_unlocks(this); IncreaseEventCounter(this,0,0); (g_manager->_optionsConfig)._popupsMode = iVar2; if ((*(char *)this != '\0') && (this->_isFileLoaded != 0)) { *(undefined1 *)this = 0; Manager::BackupSaveFile((Manager *)this); manager = g_manager; steamContext = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*steamContext == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) { Save(this); } else { SaveToSteamCloud(this); } } isImported = 1; } ExceptionList = local_1c; return isImported; } //@@ 0092bd20 FUN_0092bd20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ byte FUN_0092bd20(void) { char cVar1; byte bVar2; uint uVar3; int *stream; undefined4 ****ppppuVar4; PersistentGameData *in_ECX; uint uVar5; undefined4 local_44; undefined1 local_40; undefined4 local_34; undefined4 local_30; undefined4 ****local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b0aa95; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_14 = uVar3; stream = operator_new(0x24); if (stream == (int *)0x0) { stream = (int *)0x0; } else { stream[1] = 2; stream[2] = 0; *stream = (int)IsaacRepentancePlus::SteamCloudFile::vftable; stream[4] = 0; stream[6] = 0; stream[7] = 0; *(undefined2 *)(stream + 8) = 0; } std::string::string((char *)local_2c,&in_ECX->field_0x20); uVar5 = local_18; local_30 = 0xf; local_34 = 4; local_44 = 0x2b706572; local_40 = 0; local_8 = (undefined4 ***)0x1; ppppuVar4 = local_2c; if (0xf < local_18) { ppppuVar4 = local_2c[0]; } uVar3 = FUN_00836980(ppppuVar4,&local_44,4,uVar3); if (uVar3 != 0xffffffff) { std::string::replace((char *)local_2c,uVar3,4,&DAT_00b7b020,3); uVar5 = local_18; } ppppuVar4 = local_2c; if (0xf < uVar5) { ppppuVar4 = local_2c[0]; } if (*(code **)(*stream + 0x24) == FUN_00683820) { cVar1 = FUN_00683820(ppppuVar4); } else { cVar1 = (**(code **)(*stream + 0x24))(ppppuVar4); } if (cVar1 != '\0') { if (*(code **)(*stream + 0x30) == FUN_00a25440) { cVar1 = stream[1] != 2; } else { cVar1 = (**(code **)(*stream + 0x30))(); } if (cVar1 != '\0') { bVar2 = PersistentGameData::import_afterbirth_save(in_ECX,stream); in_ECX->_isFileLoaded = bVar2; if (*(code **)(*stream + 0x34) == FUN_006839b0) { FUN_006839b0(); bVar2 = in_ECX->_isFileLoaded; } else { (**(code **)(*stream + 0x34))(); bVar2 = in_ECX->_isFileLoaded; } goto LAB_0092bea7; } } KAGE_LogMessage(1,(byte *)"SteamCloud could not find or open AB save file %s.\n"); if (*(code **)(*stream + 0x34) == FUN_006839b0) { FUN_006839b0(); } else { (**(code **)(*stream + 0x34))(); } bVar2 = 0; LAB_0092bea7: if (0xf < local_18) { uVar3 = local_18 + 1; ppppuVar4 = local_2c[0]; if (0xfff < uVar3) { ppppuVar4 = (undefined4 ****)local_2c[0][-1]; uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar4,uVar3); } ExceptionList = local_10; return bVar2; } //@@ 0092bf00 FUN_0092bf00 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ byte FUN_0092bf00(void) { char cVar1; byte bVar2; uint uVar3; int *stream; undefined4 ****ppppuVar4; PersistentGameData *in_ECX; uint uVar5; undefined4 local_44; undefined1 local_40; undefined4 local_34; undefined4 local_30; undefined4 ****local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b0aa95; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_14 = uVar3; stream = operator_new(0x24); if (stream == (int *)0x0) { stream = (int *)0x0; } else { stream[1] = 2; stream[2] = 0; *stream = (int)IsaacRepentancePlus::SteamCloudFile::vftable; stream[4] = 0; stream[6] = 0; stream[7] = 0; *(undefined2 *)(stream + 8) = 0; } std::string::string((char *)local_2c,&in_ECX->field_0x20); uVar5 = local_18; local_30 = 0xf; local_34 = 4; local_44 = 0x2b706572; local_40 = 0; local_8 = (undefined4 ***)0x1; ppppuVar4 = local_2c; if (0xf < local_18) { ppppuVar4 = local_2c[0]; } uVar3 = FUN_00836980(ppppuVar4,&local_44,4,uVar3); if (uVar3 != 0xffffffff) { std::string::replace((char *)local_2c,uVar3,4,&DAT_00b7afe4,4); uVar5 = local_18; } ppppuVar4 = local_2c; if (0xf < uVar5) { ppppuVar4 = local_2c[0]; } if (*(code **)(*stream + 0x24) == FUN_00683820) { cVar1 = FUN_00683820(ppppuVar4); } else { cVar1 = (**(code **)(*stream + 0x24))(ppppuVar4); } if (cVar1 != '\0') { if (*(code **)(*stream + 0x30) == FUN_00a25440) { cVar1 = stream[1] != 2; } else { cVar1 = (**(code **)(*stream + 0x30))(); } if (cVar1 != '\0') { bVar2 = PersistentGameData::read(in_ECX,stream); in_ECX->_isFileLoaded = bVar2 != 0; if (*(code **)(*stream + 0x34) == FUN_006839b0) { FUN_006839b0(); bVar2 = in_ECX->_isFileLoaded; } else { (**(code **)(*stream + 0x34))(); bVar2 = in_ECX->_isFileLoaded; } goto LAB_0092c08c; } } KAGE_LogMessage(1,(byte *)"SteamCloud could not find or open AB+ save file %s.\n"); if (*(code **)(*stream + 0x34) == FUN_006839b0) { FUN_006839b0(); } else { (**(code **)(*stream + 0x34))(); } bVar2 = 0; LAB_0092c08c: if (0xf < local_18) { uVar3 = local_18 + 1; ppppuVar4 = local_2c[0]; if (0xfff < uVar3) { ppppuVar4 = (undefined4 ****)local_2c[0][-1]; uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar4,uVar3); } ExceptionList = local_10; return bVar2; } //@@ 0092c0e0 FUN_0092c0e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ byte FUN_0092c0e0(void) { char cVar1; byte bVar2; uint uVar3; int *stream; undefined4 ****ppppuVar4; PersistentGameData *in_ECX; uint uVar5; undefined4 local_44; undefined1 local_40; undefined4 local_34; undefined4 local_30; undefined4 ****local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b0aa95; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_14 = uVar3; stream = operator_new(0x24); if (stream == (int *)0x0) { stream = (int *)0x0; } else { stream[1] = 2; stream[2] = 0; *stream = (int)IsaacRepentancePlus::SteamCloudFile::vftable; stream[4] = 0; stream[6] = 0; stream[7] = 0; *(undefined2 *)(stream + 8) = 0; } std::string::string((char *)local_2c,&in_ECX->field_0x20); uVar5 = local_18; local_30 = 0xf; local_34 = 4; local_44 = 0x2b706572; local_40 = 0; local_8 = (undefined4 ***)0x1; ppppuVar4 = local_2c; if (0xf < local_18) { ppppuVar4 = local_2c[0]; } uVar3 = FUN_00836980(ppppuVar4,&local_44,4,uVar3); if (uVar3 != 0xffffffff) { std::string::replace((char *)local_2c,uVar3,4,&DAT_00b7afa4,4); uVar5 = local_18; } ppppuVar4 = local_2c; if (0xf < uVar5) { ppppuVar4 = local_2c[0]; } if (*(code **)(*stream + 0x24) == FUN_00683820) { cVar1 = FUN_00683820(ppppuVar4); } else { cVar1 = (**(code **)(*stream + 0x24))(ppppuVar4); } if (cVar1 != '\0') { if (*(code **)(*stream + 0x30) == FUN_00a25440) { cVar1 = stream[1] != 2; } else { cVar1 = (**(code **)(*stream + 0x30))(); } if (cVar1 != '\0') { bVar2 = PersistentGameData::read(in_ECX,stream); in_ECX->_isFileLoaded = bVar2 != 0; if (*(code **)(*stream + 0x34) == FUN_006839b0) { FUN_006839b0(); bVar2 = in_ECX->_isFileLoaded; } else { (**(code **)(*stream + 0x34))(); bVar2 = in_ECX->_isFileLoaded; } goto LAB_0092c26c; } } KAGE_LogMessage(1,(byte *)"SteamCloud could not find or open Repentance save file %s.\n"); if (*(code **)(*stream + 0x34) == FUN_006839b0) { FUN_006839b0(); } else { (**(code **)(*stream + 0x34))(); } bVar2 = 0; LAB_0092c26c: if (0xf < local_18) { uVar3 = local_18 + 1; ppppuVar4 = local_2c[0]; if (0xfff < uVar3) { ppppuVar4 = (undefined4 ****)local_2c[0][-1]; uVar3 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar4,uVar3); } ExceptionList = local_10; return bVar2; } //@@ 0092c2c0 PersistentGameData::TryImportABLocalSave /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool PersistentGameData::TryImportABLocalSave(const char* path); */ byte __thiscall PersistentGameData::TryImportABLocalSave(PersistentGameData *this,byte *param_2) { char cVar1; byte bVar2; uint uVar3; byte *pbVar4; byte *****pppppbVar5; int *stream; int iVar6; byte *pbVar7; byte *****pppppbVar8; uint uVar9; byte *****pppppbVar10; int *unaff_FS_OFFSET; bool bVar11; byte bStack_55; byte *****apppppbStack_3c [4]; uint uStack_2c; uint uStack_28; uint uStack_24; byte *****pppppbStack_20; int iStack_1c; undefined *puStack_18; byte ****ppppbStack_14; pppppbStack_20 = (byte *****)(apppppbStack_3c + 0xe); ppppbStack_14 = (byte ****)0xffffffff; puStack_18 = &UNK_00b0aad5; iStack_1c = *unaff_FS_OFFSET; uVar3 = __security_cookie ^ (uint)(apppppbStack_3c + 0xb); *unaff_FS_OFFSET = (int)&iStack_1c; uStack_2c = 0; uStack_28 = 0xf; apppppbStack_3c[0] = (byte *****)0x0; pbVar7 = param_2; do { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar2 != 0); uStack_24 = uVar3; std::string::assign((char *)apppppbStack_3c,param_2,(int)pbVar7 - (int)(param_2 + 1)); ppppbStack_14 = (byte ****)0x0; pbVar7 = std::_Allocate(0x20); pbVar7[0] = 'B'; pbVar7[1] = 'i'; pbVar7[2] = 'n'; pbVar7[3] = 'd'; pbVar7[4] = 'i'; pbVar7[5] = 'n'; pbVar7[6] = 'g'; pbVar7[7] = ' '; pbVar7[8] = 'o'; pbVar7[9] = 'f'; pbVar7[10] = ' '; pbVar7[0xb] = 'I'; pbVar7[0xc] = 's'; pbVar7[0xd] = 'a'; pbVar7[0xe] = 'a'; pbVar7[0xf] = 'c'; pbVar7[0x10] = 0x20; pbVar7[0x11] = 0x52; pbVar7[0x12] = 0x65; pbVar7[0x13] = 0x70; pbVar7[0x14] = 0x65; pbVar7[0x15] = 0x6e; pbVar7[0x16] = 0x74; pbVar7[0x17] = 0x61; pbVar7[0x18] = 'n'; pbVar7[0x19] = 'c'; pbVar7[0x1a] = 'e'; pbVar7[0x1b] = '+'; pbVar7[0x1c] = 0; ppppbStack_14 = (byte ****)CONCAT31(ppppbStack_14._1_3_,1); pppppbVar5 = (byte *****)apppppbStack_3c; if (0xf < uStack_28) { pppppbVar5 = apppppbStack_3c[0]; } if (uStack_2c < 0x1c) { LAB_0092c428: pppppbVar5 = (byte *****)apppppbStack_3c; if (0xf < uStack_28) { pppppbVar5 = apppppbStack_3c[0]; } stream = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,(byte *)pppppbVar5); if (stream == (int *)0x0) { KAGE_LogMessage(1,(byte *)"No AB save found! (%s)\n"); bStack_55 = 0; } else { cVar1 = (**(code **)(*stream + 0x30))(uVar3); if ((cVar1 != '\0') && (iVar6 = _fileno((FILE *)stream[3]), -1 < iVar6)) { flock(iVar6,1); } bVar2 = import_afterbirth_save(this,stream); this->_isFileLoaded = bVar2; cVar1 = (**(code **)(*stream + 0x30))(); if ((cVar1 != '\0') && (iVar6 = _fileno((FILE *)stream[3]), -1 < iVar6)) { flock(iVar6,8); } (**(code **)(*stream + 0x34))(); (**(code **)*stream)(1); bStack_55 = this->_isFileLoaded; } operator_delete(pbVar7,0x20); if (0xf < uStack_28) { uVar3 = uStack_28 + 1; pppppbVar5 = apppppbStack_3c[0]; if (0xfff < uVar3) { pppppbVar5 = (byte *****)apppppbStack_3c[0][-1]; uVar3 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppbStack_3c[0] + (-4 - (int)pppppbVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar5,uVar3); } *unaff_FS_OFFSET = iStack_1c; return bStack_55; } iVar6 = -1; if (uStack_2c - 0x1c != -1) { iVar6 = uStack_2c - 0x1c; } pppppbVar10 = (byte *****)((int)pppppbVar5 + iVar6); do { if (*(byte *)pppppbVar10 == *pbVar7) { uVar9 = 0x18; pbVar4 = pbVar7; pppppbVar8 = pppppbVar10; do { if (*pppppbVar8 != *(byte *****)pbVar4) { bVar2 = (byte)*pppppbVar8; bVar11 = bVar2 < *pbVar4; if ((((bVar2 == *pbVar4) && (bVar11 = *(byte *)((int)pppppbVar8 + 1) < pbVar4[1], *(byte *)((int)pppppbVar8 + 1) == pbVar4[1])) && (bVar11 = *(byte *)((int)pppppbVar8 + 2) < pbVar4[2], *(byte *)((int)pppppbVar8 + 2) == pbVar4[2])) && (bVar11 = *(byte *)((int)pppppbVar8 + 3) < pbVar4[3], *(byte *)((int)pppppbVar8 + 3) == pbVar4[3])) { uVar9 = 0; } else { uVar9 = -(uint)bVar11 | 1; } goto LAB_0092c3fa; } pppppbVar8 = pppppbVar8 + 1; pbVar4 = pbVar4 + 4; bVar11 = 3 < uVar9; uVar9 = uVar9 - 4; } while (bVar11); uVar9 = 0; LAB_0092c3fa: if (uVar9 == 0) { if ((int)pppppbVar10 - (int)pppppbVar5 != 0xffffffff) { std::string::replace ((char *)apppppbStack_3c,(int)pppppbVar10 - (int)pppppbVar5,0x1c, (byte *)"Binding of Isaac Afterbirth",0x1b); } goto LAB_0092c428; } } if (pppppbVar10 == pppppbVar5) goto LAB_0092c428; pppppbVar10 = (byte *****)((int)pppppbVar10 + -1); } while( true ); } //@@ 0092ca70 std::map::operator_index /* DB: lower_bound (std::set::find_node) then inserts a 0x18-byte node {key at +0x10, value 0 at +0x14} if missing, returns &value (max_size 0xaaaaaaa check); used on the bestiary maps by PersistentGameData::AddBestiaryKill / TryAddBestiaryEncounter; same body as 00730ed0 std::map::operator_index int std::map::operator_index(int *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5f7d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; set::find_node(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(int *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x18); newNode[4] = *param_1; newNode[5] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = _Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 0092cb30 std_map_copy_assign /* DB: std::_Tree copy-assign: if different, erases this tree, copies nodes from param (FUN_0082e720), size, fixes leftmost/rightmost; Entity_Player::StoreGameState/RestoreGameState (a std::map/set member of the player state) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std_map_copy_assign(void *this,void *other) { char cVar1; int iVar2; int *piVar3; int *piVar4; int iVar5; int *piVar6; undefined4 uVar7; if (this != other) { iVar2 = *(int *)this; FID_conflict__Erase_tree_>_> (this,this,*(_Tree_node **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)((int)this + 4) = 0; uVar7 = std::map::_Copy_nodes (*(undefined4 *)(*(int *)other + 4),*(undefined4 *)this,other); *(undefined4 *)(*(int *)this + 4) = uVar7; piVar3 = *(int **)this; *(undefined4 *)((int)this + 4) = *(undefined4 *)((int)other + 4); piVar4 = (int *)piVar3[1]; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar1 = *(char *)(*piVar4 + 0xd); piVar6 = (int *)*piVar4; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar6 + 0xd); piVar4 = piVar6; piVar6 = (int *)*piVar6; } *piVar3 = (int)piVar4; iVar2 = *(int *)(*(int *)this + 4); iVar5 = *(int *)(iVar2 + 8); cVar1 = *(char *)(iVar5 + 0xd); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar5 + 8) + 0xd); iVar2 = iVar5; iVar5 = *(int *)(iVar5 + 8); } *(int *)(*(int *)this + 8) = iVar2; return this; } *piVar3 = (int)piVar3; *(int *)(*(int *)this + 8) = *(int *)this; } return this; } //@@ 0092cbe0 std::_Sort_unchecked<4byte> /* DB: MSVC std::sort core: loop while range > 0x80 bytes (32 x 4-byte, _ISORT_MAX), heap-sort fallback when ideal<=0, partitions with 0x8fd030, recurses on itself (0x92cc44/56), insertion sort tail with memmove; predicate in param_2; called by FUN_00926510 */ void std::_Sort_unchecked<4byte>(int param_1,code *param_2) { undefined4 uVar1; char cVar2; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *local_20; undefined4 *local_1c; undefined4 *local_18; undefined4 *local_14; undefined4 *local_10; undefined4 *local_c; undefined4 *local_8; local_18 = in_ECX; local_8 = in_EDX; if (0x80 < (int)((int)in_EDX - (int)in_ECX & 0xfffffffcU)) { do { if (param_1 < 1) { local_8 = (undefined4 *)((int)in_EDX - (int)in_ECX); local_18 = (undefined4 *)((int)local_8 >> 2); if (0 < (int)local_8 >> 3) { local_1c = (undefined4 *)((int)local_18 - 1); local_14 = (undefined4 *)((int)local_1c >> 1); local_c = (undefined4 *)((int)local_8 >> 3); do { local_10 = (undefined4 *)in_ECX[(int)local_c + -1]; puVar3 = (undefined4 *)((int)local_c + -1); puVar5 = puVar3; local_c = puVar3; if ((int)puVar3 < (int)local_14) { do { puVar5 = (undefined4 *)((int)puVar3 * 2 + 2); cVar2 = (*param_2)(in_ECX[(int)puVar5],in_ECX[(int)puVar3 * 2 + 1]); if (cVar2 != '\0') { puVar5 = (undefined4 *)((int)puVar3 * 2 + 1); } in_ECX[(int)puVar3] = in_ECX[(int)puVar5]; puVar3 = puVar5; } while ((int)puVar5 < (int)local_14); } if ((puVar5 == local_14) && (((uint)local_18 & 1) == 0)) { in_ECX[(int)puVar5] = in_ECX[(int)local_18 - 1]; puVar5 = local_1c; } if ((int)local_c < (int)puVar5) { do { puVar3 = (undefined4 *)((int)puVar5 + -1 >> 1); cVar2 = (*param_2)(in_ECX[(int)puVar3],local_10); if (cVar2 == '\0') break; in_ECX[(int)puVar5] = in_ECX[(int)puVar3]; puVar5 = puVar3; } while ((int)local_c < (int)puVar3); } in_ECX[(int)puVar5] = local_10; } while (0 < (int)local_c); } puVar5 = local_8; if ((int)local_18 < 2) { return; } do { local_1c = *(undefined4 **)((int)in_ECX + ((int)puVar5 - 4U)); *(undefined4 *)((int)in_ECX + ((int)puVar5 - 4U)) = *in_ECX; FUN_008fd290((int)((int)puVar5 - 4U) >> 2,&local_1c,param_2); puVar5 = (undefined4 *)((int)puVar5 - 4); } while (7 < (int)((uint)puVar5 & 0xfffffffc)); return; } _Partition_by_median_guess_unchecked<4byte>(in_EDX,param_2); param_1 = (param_1 >> 1) + (param_1 >> 2); if ((int)((int)local_20 - (int)in_ECX & 0xfffffffcU) < (int)((int)in_EDX - (int)local_1c & 0xfffffffcU)) { _Sort_unchecked<4byte>(param_1,param_2); local_18 = local_1c; in_ECX = local_1c; } else { _Sort_unchecked<4byte>(param_1,param_2); local_8 = local_20; in_EDX = local_20; } } while (0x80 < (int)((int)in_EDX - (int)in_ECX & 0xfffffffcU)); } if ((in_ECX != in_EDX) && (local_14 = in_ECX + 1, local_14 != local_8)) { do { puVar5 = local_14; uVar1 = *local_14; local_10 = local_14; local_c = (undefined4 *)uVar1; cVar2 = (*param_2)(uVar1,*in_ECX); if (cVar2 == '\0') { cVar2 = (*param_2)(local_c,puVar5[-1]); puVar3 = local_c; if (cVar2 != '\0') { puVar4 = local_10; do { puVar6 = puVar5 + -1; *puVar4 = *puVar6; cVar2 = (*param_2)(puVar3,puVar5[-2]); puVar4 = puVar6; puVar5 = puVar6; } while (cVar2 != '\0'); puVar5 = local_14; in_ECX = local_18; local_10 = puVar6; } *local_10 = local_c; } else { memmove((void *)((int)puVar5 + (4 - ((int)puVar5 - (int)in_ECX))),in_ECX, (int)puVar5 - (int)in_ECX); *in_ECX = uVar1; } local_14 = puVar5 + 1; } while (local_14 != local_8); } return; } //@@ 0092ce30 FUN_0092ce30 void FUN_0092ce30(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ab0d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0xf; *(undefined1 *)in_ECX = 0; local_8 = 0; SoundInstance::SoundInstance(in_ECX + 6); *(undefined1 *)(in_ECX + 0xc) = 0; in_ECX[0xd] = 1; ExceptionList = local_10; return; } //@@ 0092cea0 FUN_0092cea0 void FUN_0092cea0(void) { int in_ECX; *(undefined4 *)(in_ECX + 4) = 0xffffffff; _eh_vector_constructor_iterator_((void *)(in_ECX + 8),0x38,7,FUN_0092ce30,FUN_0092cf10); *(undefined4 *)(in_ECX + 400) = 0; *(undefined1 *)(in_ECX + 0x198) = 0; *(undefined4 *)(in_ECX + 0x19c) = 0; *(undefined4 *)(in_ECX + 0x1a0) = 0; *(undefined4 *)(in_ECX + 0x1b0) = 0; *(undefined4 *)(in_ECX + 0x1b4) = 0xf; *(undefined1 *)(in_ECX + 0x1a0) = 0; return; } //@@ 0092cf10 FUN_0092cf10 void FUN_0092cf10(void) { char *in_ECX; FUN_00a2ab40(); std::string::_Tidy_deallocate(in_ECX); return; } //@@ 0092cf40 SFXManager::Preload /* ZHL [lua] Lua binding SFXManager:Preload */ void SFXManager::Preload(int param_1) { int *in_ECX; SoundEffect *this; if (-1 < param_1) { if (param_1 < (in_ECX[1] - *in_ECX) / 0x1b8) { this = (SoundEffect *)(param_1 * 0x1b8 + *in_ECX); if (*(char *)(this + 0x66) == '\0') { KAGE_LogMessage(1,(byte *)"Preload sound %d.\n"); SoundEffect::Load(this); in_ECX[3] = in_ECX[3] + 1; } this[0x66].field_0x1 = 0; } } return; } //@@ 0092cfb0 SoundEffect::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void SoundEffect::Load(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall SoundEffect::Load(SoundEffect *this) { undefined1 uVar1; char cVar2; uint uVar3; std_string *psVar4; int iVar5; uint uVar6; uint lengthA; uint uVar7; std_string *psVar8; SoundEffect *this_00; undefined1 local_3c [4]; int *local_38; SoundEffect *local_34; SoundEffect local_30; std_string *local_2c [4]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; std_string *local_8; local_8 = (std_string *)0xffffffff; puStack_c = &LAB_00b0ab45; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_30 = (SoundEffect)0x0; if (this[100] != (SoundEffect)0x0) { this_00 = this + 8; local_34 = this; local_14 = uVar3; do { ModManager::TryRedirectPath (&g_manager->_modManager,(std_string *)local_2c,(std_string *)(this_00 + -6)); uVar7 = local_18; psVar8 = local_2c[0]; local_8 = (std_string *)0x0; uVar6 = local_1c - 4; if (local_1c < uVar6) { /* WARNING: Subroutine does not return */ FUN_00499950(uVar3); } lengthA = 4; if (local_1c - uVar6 < 4) { lengthA = local_1c - uVar6; } psVar4 = (std_string *)local_2c; if (0xf < local_18) { psVar4 = local_2c[0]; } iVar5 = string_compare((byte *)(psVar4->_buf + uVar6),lengthA,&DAT_00b7b1bc,4); if (iVar5 == 0) { uVar1 = 1; } else { psVar4 = (std_string *)local_2c; if (0xf < uVar7) { psVar4 = psVar8; } (**(code **)(PTR_vftable_00c5aaa0 + 0x24))(local_3c,psVar4,0,0); local_8._0_1_ = 1; SoundInstance::assign(this_00,local_3c); local_8 = (std_string *)CONCAT31(local_8._1_3_,2); if (local_38 != (int *)0x0) { cVar2 = (**(code **)(*local_38 + 0xc))(); if ((cVar2 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_3c); } } uVar1 = 0; uVar7 = local_18; psVar8 = local_2c[0]; } local_8 = (std_string *)0xffffffff; *(undefined1 *)(this_00 + 6) = uVar1; if (0xf < uVar7) { uVar6 = uVar7 + 1; psVar4 = psVar8; if (0xfff < uVar6) { psVar4 = (std_string *)psVar8[-1]._capacity; uVar6 = uVar7 + 0x24; if (0x1f < (uint)((int)psVar8 + (-4 - (int)psVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar4,uVar6); } this_00 = this_00 + 0xe; local_30 = (SoundEffect)((int)local_30 + 1); this = local_34; } while ((uint)local_30 < (uint)local_34[100]); } *(undefined1 *)(this + 0x66) = 1; ExceptionList = local_10; return; } //@@ 0092d140 SFXManager::load_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: parses sounds.xml ("sounds"/"sound"/"sample"/"weight"), "Sound Effect %d out of bounds! Update NUM_SOUND_EFFECTS", calls SoundEffect::Load; called from manager config loader 0x952df0 and mod loader 0x8f30d0 */ undefined4 SFXManager::load_xml(byte *param_1,char param_2) { void **ppvVar1; void **ppvVar2; int iVar3; undefined4 *puVar4; qword qVar5; uint uVar6; undefined4 uVar7; void *ptr; byte *text; void *pvVar8; void *pvVar9; byte *text_00; byte *****pppppbVar10; int *in_ECX; uint uVar11; int iVar12; byte *pbVar13; byte *pbVar14; byte *pbVar15; std_string *allocSource; qword *pqVar16; void **ppvVar17; int *piVar18; byte *pbVar19; char *pcVar21; char *pcVar20; bool bVar22; byte bVar23; void *pvStack_10424; void **ppvStack_1041c; int *piStack_10418; int *piStack_10414; undefined4 uStack_10410; undefined4 uStack_1040c; byte abStack_10408 [48]; byte abStack_103d8 [4]; byte abStack_103d4 [340]; undefined4 uStack_10280; undefined4 uStack_1027c; byte bStack_10278; byte bStack_10277; int iStack_10274; byte *****apppppbStack_10270 [4]; uint uStack_10260; uint uStack_1025c; undefined1 auStack_10258 [48]; undefined1 auStack_10228 [65560]; undefined1 local_210 [4]; undefined4 local_20c; undefined1 local_208 [392]; undefined4 local_80; undefined1 local_78; undefined4 local_74; void *local_70; undefined4 local_60; uint local_5c; void *local_54; void *pvStack_50; void *pvStack_4c; void *pvStack_48; void *local_44; void *pvStack_40; byte *****local_3c [3]; int local_30; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; puStack_18 = &LAB_00b0ab9e; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; piStack_10414 = in_ECX; local_24 = uVar6; piStack_10418 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piStack_10418 == (int *)0x0) { uVar7 = 0; } else { if (param_2 == '\0') { if (&local_30 != in_ECX) { ppvVar2 = (void **)*in_ECX; ppvStack_1041c = (void **)in_ECX[1]; iVar12 = in_ECX[2]; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; if (ppvVar2 != (void **)0x0) { if (ppvVar2 != ppvStack_1041c) { ppvVar17 = ppvVar2 + 0x6d; do { local_14._0_1_ = 0; local_14._1_3_ = 0; pvVar8 = *ppvVar17; if ((void *)0xf < pvVar8) { pvVar9 = ppvVar17[-5]; uVar11 = (int)pvVar8 + 1; ptr = pvVar9; if (0xfff < uVar11) { ptr = *(void **)((int)pvVar9 - 4); uVar11 = (int)pvVar8 + 0x24; if (0x1f < (uint)((int)pvVar9 + (-4 - (int)ptr))) goto LAB_0092d2ca; } operator_delete(ptr,uVar11); } ppvVar17[-1] = (void *)0x0; *ppvVar17 = (void *)0xf; *(undefined1 *)(ppvVar17 + -5) = 0; _eh_vector_destructor_iterator_(ppvVar17 + -0x6b,0x38,7,FUN_0092cf10); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; ppvVar1 = ppvVar17 + 1; ppvVar17 = ppvVar17 + 0x6e; } while (ppvVar1 != ppvStack_1041c); in_ECX = piStack_10414; } uVar11 = ((iVar12 - (int)ppvVar2) / 0x1b8) * 0x1b8; ppvVar17 = ppvVar2; if (0xfff < uVar11) { ppvVar17 = ppvVar2[-1]; uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)ppvVar2 + (-4 - (int)ppvVar17))) { LAB_0092d2ca: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppvVar17,uVar11); } } piVar18 = piStack_10414; iVar12 = in_ECX[1] - *in_ECX; uVar11 = iVar12 / 0x1b8; if (uVar11 < 0x444) { if (uVar11 < 0x443) { if ((uint)((piStack_10414[2] - *piStack_10414) / 0x1b8) < 0x443) { std::vector::_Resize_reallocate (piStack_10414[2] - *piStack_10414,&ppvStack_1041c); } else { iVar12 = std::_Uninitialized_value_construct_n (in_ECX[1],0x443 - uVar11,ppvStack_1041c); piVar18[1] = iVar12; } } } else { iVar3 = *piStack_10414; std::_Destroy_range(iVar12,uVar6); piStack_10414[1] = iVar3 + 0x75328; } } piVar18 = piStack_10418; iVar12 = (**(code **)(*piStack_10418 + 4))(); text = operator_new_tracked(iVar12 + 1); (**(code **)(*piVar18 + 0x14))(text,1,iVar12); text[iVar12] = 0; (**(code **)*piVar18)(1); piStack_10414[3] = 0; FUN_00413b90(); local_14 = (byte ****)0x1; uVar6 = 0x92d3e9; pbVar19 = text; rapidxml::xml_document::parse(auStack_10258,text); bVar23 = (byte)pbVar19; pvVar8 = xml_node::first_node(auStack_10258,(byte *)"sounds",uVar6,bVar23); pvVar9 = xml_node::first_attribute(pvVar8,&DAT_00b66f40,uVar6,bVar23); local_2c = 0; local_28 = 0xf; local_3c[0] = (byte *****)0x0; pbVar19 = &g_xmlNullStr; if (*(byte **)((int)pvVar9 + 4) != (byte *)0x0) { pbVar19 = *(byte **)((int)pvVar9 + 4); } pbVar13 = pbVar19; do { bVar23 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar23 != 0); uVar6 = (int)pbVar13 - (int)(pbVar19 + 1); std::string::assign((char *)local_3c,pbVar19,uVar6); local_14._0_1_ = 2; pvStack_10424 = xml_node::first_node(pvVar8,(byte *)"sound",(int)pbVar19,(byte)uVar6); if (pvStack_10424 != (void *)0x0) { LAB_0092d470: uStack_1040c = 0xffffffff; _eh_vector_constructor_iterator_(abStack_10408,0x38,7,FUN_0092ce30,FUN_0092cf10); uStack_10280 = 0; bStack_10278 = 0; iStack_10274 = 0; uStack_10260 = 0; uStack_1025c = 0xf; apppppbStack_10270[0] = (byte *****)0x0; local_14._0_1_ = 3; for (puVar4 = *(undefined4 **)((int)pvStack_10424 + 0x20); puVar4 != (undefined4 *)0x0; puVar4 = (undefined4 *)puVar4[6]) { pbVar19 = (byte *)*puVar4; pbVar14 = s_id; pbVar13 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar13 = pbVar19; } do { bVar23 = *pbVar13; bVar22 = bVar23 < *pbVar14; if (bVar23 != *pbVar14) { LAB_0092d511: uVar6 = -(uint)bVar22 | 1; goto LAB_0092d516; } if (bVar23 == 0) break; bVar23 = pbVar13[1]; bVar22 = bVar23 < pbVar14[1]; if (bVar23 != pbVar14[1]) goto LAB_0092d511; pbVar13 = pbVar13 + 2; pbVar14 = pbVar14 + 2; } while (bVar23 != 0); uVar6 = 0; LAB_0092d516: if (uVar6 == 0) { pbVar19 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar19 = (byte *)puVar4[1]; } iStack_10274 = atoi((char *)pbVar19); } else { pbVar14 = s_name; pbVar13 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar13 = pbVar19; } do { bVar23 = *pbVar13; bVar22 = bVar23 < *pbVar14; if (bVar23 != *pbVar14) { LAB_0092d568: uVar6 = -(uint)bVar22 | 1; goto LAB_0092d56d; } if (bVar23 == 0) break; bVar23 = pbVar13[1]; bVar22 = bVar23 < pbVar14[1]; if (bVar23 != pbVar14[1]) goto LAB_0092d568; pbVar13 = pbVar13 + 2; pbVar14 = pbVar14 + 2; } while (bVar23 != 0); uVar6 = 0; LAB_0092d56d: if (uVar6 == 0) { pbVar19 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar19 = (byte *)puVar4[1]; } pbVar13 = pbVar19; do { bVar23 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar23 != 0); std::string::assign((char *)apppppbStack_10270,pbVar19,(int)pbVar13 - (int)(pbVar19 + 1) ); } } if (puVar4[4] == 0) break; } piVar18 = piStack_10414; if (param_2 == '\0') { if (((iStack_10274 < 0) || (iStack_10274 < 0x443)) || (KAGE_LogMessage(0x10,(byte *) "Sound Effect %d out of bounds! Update NUM_SOUND_EFFECTS.\n"), iStack_10274 < 0x443)) { piVar18 = piStack_10414; goto LAB_0092d6fa; } local_14._0_1_ = 6; goto LAB_0092daa4; } iStack_10274 = (piStack_10414[1] - *piStack_10414) / 0x1b8; local_20c = 0xffffffff; _eh_vector_constructor_iterator_(local_208,0x38,7,FUN_0092ce30,FUN_0092cf10); local_80 = 0; local_78 = 0; local_74 = 0; local_60 = 0; local_5c = 0xf; local_70 = (void *)0x0; local_14 = (byte ****)CONCAT31(local_14._1_3_,4); pvVar8 = (void *)piVar18[1]; if (pvVar8 == (void *)piVar18[2]) { std::vector::_Emplace_reallocate(pvVar8,local_210); } else { SoundEffect::move_constructor(pvVar8,local_210); piVar18[1] = piVar18[1] + 0x1b8; } local_14._0_1_ = 5; if (0xf < local_5c) { uVar6 = local_5c + 1; pvVar8 = local_70; if (0xfff < uVar6) { pvVar8 = *(void **)((int)local_70 + -4); uVar6 = local_5c + 0x24; if (0x1f < (uint)((int)local_70 + (-4 - (int)pvVar8))) goto LAB_0092d2ca; } operator_delete(pvVar8,uVar6); } local_60 = 0; local_5c = 0xf; local_70 = (void *)((uint)local_70 & 0xffffff00); _eh_vector_destructor_iterator_(local_208,0x38,7,FUN_0092cf10); local_14._0_1_ = 3; LAB_0092d6fa: pbVar19 = abStack_10408; piStack_10418 = (int *)0x7; pbVar14 = (byte *)(iStack_10274 * 0x1b8 + *piVar18); *(undefined4 *)pbVar14 = uStack_10410; *(undefined4 *)(pbVar14 + 4) = uStack_1040c; pbVar13 = pbVar14; do { pbVar15 = pbVar13 + 0x38; ppvStack_1041c = (void **)(pbVar19 + 0x14); if (pbVar13 + 8 != pbVar19) { text_00 = pbVar19; if ((void *)0xf < *ppvStack_1041c) { text_00 = *(byte **)pbVar19; } std::string::assign((char *)(pbVar13 + 8),text_00,*(uint *)(pbVar19 + 0x10)); } SoundInstance::operator_assign(ppvStack_1041c + 1); pbVar19 = pbVar19 + 0x38; *pbVar15 = (abStack_10408 + (-8 - (int)pbVar14))[(int)pbVar15]; *(undefined4 *)(pbVar13 + 0x3c) = *(undefined4 *)(abStack_10408 + (-4 - (int)pbVar14) + (int)pbVar15); piStack_10418 = (int *)((int)piStack_10418 + -1); pbVar13 = pbVar15; } while (piStack_10418 != (int *)0x0); *(undefined4 *)(pbVar14 + 400) = uStack_10280; *(undefined4 *)(pbVar14 + 0x194) = uStack_1027c; pbVar14[0x198] = bStack_10278; pbVar14[0x199] = bStack_10277; *(int *)(pbVar14 + 0x19c) = iStack_10274; if ((byte ******)(pbVar14 + 0x1a0) != apppppbStack_10270) { pppppbVar10 = (byte *****)apppppbStack_10270; if (0xf < uStack_1025c) { pppppbVar10 = apppppbStack_10270[0]; } std::string::assign((char *)(pbVar14 + 0x1a0),(byte *)pppppbVar10,uStack_10260); } pcVar20 = "sample"; do { pcVar21 = pcVar20; pcVar20 = pcVar21 + 1; } while (*pcVar20 != '\0'); for (piStack_10418 = *(int **)((int)pvStack_10424 + 0x18); piStack_10418 != (int *)0x0; piStack_10418 = (int *)piStack_10418[0xb]) { pbVar19 = (byte *)*piStack_10418; if (pbVar19 == (byte *)0x0) { pcVar20 = (char *)0x0; pbVar19 = &g_xmlNullStr; } else { pcVar20 = (char *)piStack_10418[2]; } if (pcVar20 == pcVar21 + -0xb7b167) { pbVar13 = (byte *)(pcVar20 + (int)pbVar19); if (pbVar13 <= pbVar19) goto LAB_0092d890; iVar12 = (int)"sample" - (int)pbVar19; while (*pbVar19 == pbVar19[iVar12]) { pbVar19 = pbVar19 + 1; if (pbVar13 <= pbVar19) goto LAB_0092d890; } } } goto LAB_0092da86; } LAB_0092db29: local_14 = (byte ****)CONCAT31(local_14._1_3_,1); if (0xf < local_28) { uVar6 = local_28 + 1; pppppbVar10 = local_3c[0]; if (0xfff < uVar6) { pppppbVar10 = (byte *****)local_3c[0][-1]; uVar6 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c[0] + (-4 - (int)pppppbVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar10,uVar6); } local_14 = (byte ****)0x8; xml_memory_pool::clear(auStack_10228); if (g_mainHeap == (void *)0x0) { pqVar16 = &g_allocatedBytesNoHeap; } else { pqVar16 = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar6 = *(uint *)(text + -4); qVar5 = *pqVar16; *(uint *)pqVar16 = (uint)*pqVar16 - uVar6; *(uint *)((int)pqVar16 + 4) = *(uint *)((int)pqVar16 + 4) - (uint)((uint)qVar5 < uVar6); free(text + -4); } uVar7 = 1; } ExceptionList = local_1c; return uVar7; LAB_0092d890: do { iVar12 = iStack_10274 * 0x1b8 + *piStack_10414; uVar6 = *(uint *)(iVar12 + 400); if (6 < uVar6) { KAGE_LogMessage(1,(byte *)"[warn] Sound Effect %d exceeding max samples.\n"); break; } ppvStack_1041c = (void **)(uVar6 * 0x38 + 8 + iVar12); *(uint *)(iVar12 + 400) = uVar6 + 1; for (puVar4 = (undefined4 *)piStack_10418[8]; puVar4 != (undefined4 *)0x0; puVar4 = (undefined4 *)puVar4[6]) { pbVar19 = (byte *)*puVar4; pbVar15 = &DAT_00b66e0c; pbVar13 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar13 = pbVar19; } do { bVar23 = *pbVar13; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_0092d92d: uVar6 = -(uint)bVar22 | 1; goto LAB_0092d932; } if (bVar23 == 0) break; bVar23 = pbVar13[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_0092d92d; pbVar13 = pbVar13 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar6 = 0; LAB_0092d932: if (uVar6 == 0) { pbVar19 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar19 = (byte *)puVar4[1]; } pbVar13 = pbVar19; do { bVar23 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar23 != 0); allocSource = (std_string *)(pbVar13 + -(int)(pbVar19 + 1)); if ((std_string *)(0x7fffffff - local_2c) < allocSource) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppbVar10 = (byte *****)local_3c; if (0xf < local_28) { pppppbVar10 = local_3c[0]; } std::string::concat((char *)&local_54,(int)pbVar14,allocSource,(byte *)pppppbVar10,local_2c, pbVar19,(uint)allocSource); ppvVar2 = ppvStack_1041c; if (ppvStack_1041c == &local_54) { if ((void *)0xf < pvStack_40) { uVar6 = (int)pvStack_40 + 1; pvVar8 = local_54; if (0xfff < uVar6) { pvVar8 = *(void **)((int)local_54 - 4); uVar6 = (int)pvStack_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar8))) goto LAB_0092d2ca; } operator_delete(pvVar8,uVar6); } } else { std::string::_Tidy_deallocate((char *)ppvStack_1041c); *ppvVar2 = local_54; ppvVar2[1] = pvStack_50; ppvVar2[2] = pvStack_4c; ppvVar2[3] = pvStack_48; ppvVar2[4] = local_44; ppvVar2[5] = pvStack_40; } } else { pcVar20 = "weight"; pbVar13 = &g_xmlNullStr; if (pbVar19 != (byte *)0x0) { pbVar13 = pbVar19; } do { bVar23 = *pbVar13; bVar22 = bVar23 < (byte)*pcVar20; if (bVar23 != *pcVar20) { LAB_0092da23: uVar6 = -(uint)bVar22 | 1; goto LAB_0092da28; } if (bVar23 == 0) break; bVar23 = pbVar13[1]; bVar22 = bVar23 < (byte)pcVar20[1]; if (bVar23 != pcVar20[1]) goto LAB_0092da23; pbVar13 = pbVar13 + 2; pcVar20 = pcVar20 + 2; } while (bVar23 != 0); uVar6 = 0; LAB_0092da28: if (uVar6 == 0) { pbVar19 = &g_xmlNullStr; if ((byte *)puVar4[1] != (byte *)0x0) { pbVar19 = (byte *)puVar4[1]; } pvVar8 = (void *)atoi((char *)pbVar19); ppvStack_1041c[0xd] = pvVar8; } } if (puVar4[4] == 0) break; } piStack_10418 = (int *)piStack_10418[0xb]; } while (piStack_10418 != (int *)0x0); LAB_0092da86: piVar18 = piStack_10414; SoundEffect::Load((SoundEffect *)(iStack_10274 * 0x1b8 + *piStack_10414)); piVar18[3] = piVar18[3] + 1; local_14._0_1_ = 7; LAB_0092daa4: if (0xf < uStack_1025c) { uVar6 = uStack_1025c + 1; pppppbVar10 = apppppbStack_10270[0]; if (0xfff < uVar6) { pppppbVar10 = (byte *****)apppppbStack_10270[0][-1]; uVar6 = uStack_1025c + 0x24; if ((byte *)0x1f < (byte *)((int)apppppbStack_10270[0] + (-4 - (int)pppppbVar10))) goto LAB_0092d2ca; } operator_delete(pppppbVar10,uVar6); } uStack_10260 = 0; uStack_1025c = 0xf; apppppbStack_10270[0] = (byte *****)((uint)apppppbStack_10270[0] & 0xffffff00); _eh_vector_destructor_iterator_(abStack_10408,0x38,7,FUN_0092cf10); local_14._0_1_ = 2; pvStack_10424 = *(void **)((int)pvStack_10424 + 0x2c); if (pvStack_10424 == (void *)0x0) goto LAB_0092db29; goto LAB_0092d470; } //@@ 0092dbd0 FUN_0092dbd0 void FUN_0092dbd0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; std::string::_Tidy_deallocate((char *)(in_ECX + 0x1a0)); _eh_vector_destructor_iterator_((void *)(in_ECX + 8),0x38,7,FUN_0092cf10); ExceptionList = local_10; return; } //@@ 0092dc30 SoundEffects::Play /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __thiscall void SoundEffects::Play(int ID,float Volume,int FrameDelay,bool Loop,float Pitch,float Pan); prototype: REPENTOGON, confirmed by RET 24 */ void __thiscall SoundEffects::Play(SoundEffects *this,int ID,float Volume,int FrameDelay,byte Loop,float Pitch, float Pan) { float fVar1; SoundEffect SVar2; code *pcVar3; char cVar4; uint uVar5; SoundEffect SVar6; SoundEffect *this_00; undefined3 in_stack_00000011; undefined1 local_18 [8]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0abe9; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94050) && (_Init_thread_header(&DAT_00c94050,__security_cookie ^ (uint)(local_18 + 0x14)), DAT_00c94050 == -1)) { _DAT_00c5d2a4 = 0x1b00000005; DAT_00c5d2ac = 8; _atexit((_func_4879 *)&DAT_00b166d0); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c94050); } if ((-1 < ID) && (ID < ((int)(this->_sounds)._end - (int)(this->_sounds)._begin) / 0x1b8)) { this_00 = (SoundEffect *)(ID * 0x1b8 + (int)(this->_sounds)._begin); if (this_00[100] == (SoundEffect)0x0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); ExceptionList = local_10; return; } if (*(char *)(this_00 + 0x66) == '\0') { SoundEffect::Load(this_00); KAGE_LogMessage(1,(byte *)"[warn] Sound %d was not preloaded.\n"); *(int *)&this->field_0xc = *(int *)&this->field_0xc + 1; } SVar6 = (SoundEffect)(g_manager->_framecount >> 1); if (((int)this_00[1] <= (int)SVar6) || ((int)this_00[1] < 0)) { SVar2 = this_00[100]; this_00[0x65] = (SoundEffect)Volume; *this_00 = SVar6; this_00[1] = (SoundEffect)(FrameDelay + (int)SVar6); if ((DAT_00c5d2a0 == 0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), DAT_00c5d2a0 == 0)) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar5 = DAT_00c5d2a0 >> ((byte)_DAT_00c5d2a4 & 0x1f) ^ DAT_00c5d2a0; uVar5 = uVar5 << ((byte)((ulonglong)_DAT_00c5d2a4 >> 0x20) & 0x1f) ^ uVar5; DAT_00c5d2a0 = uVar5 >> ((byte)DAT_00c5d2ac & 0x1f) ^ uVar5; uVar5 = 0; if (SVar2 != (SoundEffect)0x0) { uVar5 = DAT_00c5d2a0 % (uint)SVar2; } if (*(char *)(this_00 + uVar5 * 0xe + 0xe) != '\0') { if ((this_00[uVar5 * 0xe + 8] != (SoundEffect)0x0) && (cVar4 = (**(code **)(*(int *)this_00[uVar5 * 0xe + 8] + 0x28))(), cVar4 != '\0')) { FUN_00a2abd0(); } SVar6 = (SoundEffect)(this_00 + uVar5 * 0xe + 2); if (0xf < (uint)this_00[uVar5 * 0xe + 7]) { SVar6 = this_00[uVar5 * 0xe + 2]; } (**(code **)(PTR_vftable_00c5aaa0 + 0x24))(local_18,SVar6,1,0); local_8 = 1; SoundInstance::assign(this_00 + uVar5 * 0xe + 8,local_18); local_8 = 0xffffffff; FUN_007e2740(); } *(byte *)(this_00 + uVar5 * 0xe + 10) = Loop; if (this_00[uVar5 * 0xe + 8] != (SoundEffect)0x0) { (**(code **)(*(int *)this_00[uVar5 * 0xe + 8] + 0x40))(_Loop); } this_00[uVar5 * 0xe + 0xd] = (SoundEffect)Pitch; if (this_00[uVar5 * 0xe + 8] != (SoundEffect)0x0) { (**(code **)(*(int *)this_00[uVar5 * 0xe + 8] + 0x58))(Pitch); } fVar1 = this->_volumeModifier; if (fVar1 <= 0.0) { fVar1 = 0.0; } SVar6 = (SoundEffect)(fVar1 * Volume * (g_manager->_optionsConfig)._sfxVolume); if (1.0 <= (float)SVar6) { SVar6 = (SoundEffect)0x3f800000; } this_00[uVar5 * 0xe + 0xb] = SVar6; if (this_00[uVar5 * 0xe + 8] != (SoundEffect)0x0) { (**(code **)(*(int *)this_00[uVar5 * 0xe + 8] + 0x48))(SVar6); if (this_00[uVar5 * 0xe + 8] != (SoundEffect)0x0) { (**(code **)(*(int *)this_00[uVar5 * 0xe + 8] + 0x2c))(1); *(undefined2 *)&this_00[uVar5 * 0xe + 10].field_0x1 = 1; } } FUN_00a2ac20(); } } ExceptionList = local_10; return; } //@@ 0092df00 FUN_0092df00 void FUN_0092df00(int param_1,undefined4 param_2,int param_3,byte param_4,float param_5) { SoundEffects *in_ECX; float in_XMM3_Da; SoundEffects::Play(in_ECX,param_1,in_XMM3_Da,param_3,param_4,param_5,0.0); return; } //@@ 0092df40 SFXManager::AdjustVolume /* ZHL [lua] Lua binding SFXManager:AdjustVolume prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall SFXManager::AdjustVolume(void *this,int soundId,float volume) { char cVar1; int iVar2; char *pcVar3; uint uVar4; float fVar5; if ((-1 < soundId) && (soundId < (*(int *)((int)this + 4) - *(int *)this) / 0x1b8)) { iVar2 = soundId * 0x1b8 + *(int *)this; if (*(int *)(iVar2 + 400) == 0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); return; } if (*(char *)(iVar2 + 0x198) != '\0') { pcVar3 = (char *)(iVar2 + 0x29); *(float *)(iVar2 + 0x194) = volume; uVar4 = 0; do { if (*(int **)(pcVar3 + -9) != (int *)0x0) { if ((*pcVar3 != '\0') && (cVar1 = (**(code **)(**(int **)(pcVar3 + -9) + 0x38))(), cVar1 != '\0')) { *pcVar3 = '\0'; } cVar1 = (**(code **)(**(int **)(pcVar3 + -9) + 0x38))(); if ((cVar1 != '\0') || (*pcVar3 != '\0')) { fVar5 = *(float *)((int)this + 0x10); if (fVar5 <= 0.0) { fVar5 = 0.0; } fVar5 = fVar5 * volume * (g_manager->_optionsConfig)._sfxVolume; if (1.0 <= fVar5) { fVar5 = 1.0; } *(float *)(pcVar3 + 3) = fVar5; if (*(int **)(pcVar3 + -9) != (int *)0x0) { (**(code **)(**(int **)(pcVar3 + -9) + 0x48))(fVar5); } } } uVar4 = uVar4 + 1; pcVar3 = pcVar3 + 0x38; } while (uVar4 < *(uint *)(iVar2 + 400)); } } return; } //@@ 0092e050 SFXManager::AdjustPitch /* ZHL [lua] Lua binding SFXManager:AdjustPitch prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall SFXManager::AdjustPitch(void *this,int soundId,float pitch) { char cVar1; int iVar2; char *pcVar3; uint uVar4; if (-1 < soundId) { if (soundId < (*(int *)((int)this + 4) - *(int *)this) / 0x1b8) { iVar2 = soundId * 0x1b8 + *(int *)this; if (*(int *)(iVar2 + 400) == 0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); return; } if (*(char *)(iVar2 + 0x198) != '\0') { uVar4 = 0; pcVar3 = (char *)(iVar2 + 0x29); do { if (*(int **)(pcVar3 + -9) != (int *)0x0) { if (*pcVar3 != '\0') { cVar1 = (**(code **)(**(int **)(pcVar3 + -9) + 0x38))(); if (cVar1 != '\0') { *pcVar3 = '\0'; } } cVar1 = (**(code **)(**(int **)(pcVar3 + -9) + 0x38))(); if ((cVar1 != '\0') || (*pcVar3 != '\0')) { *(float *)(pcVar3 + 0xb) = pitch; if (*(int **)(pcVar3 + -9) != (int *)0x0) { (**(code **)(**(int **)(pcVar3 + -9) + 0x58))(pitch); } } } uVar4 = uVar4 + 1; pcVar3 = pcVar3 + 0x38; } while (uVar4 < *(uint *)(iVar2 + 400)); } } } return; } //@@ 0092e120 SFXManager::adjust_pan /* DB: (soundId, pan in XMM2): bounds-checks the 0x1b8-byte sound entry ("[warn] Sound %d has no samples."), for each playing voice (stride 0x38) stores the pan and calls the source's set-pan slot ("Attempting to set pan on non-mono source (%s)..."); sits between SFXManager::AdjustPitch and SFXManager::Stop; callers Game::update_trapdoor_loop_sfx (after AdjustVolume(0x3f0)) and Room::update_ambient_sounds (0x1cc) */ void SFXManager::adjust_pan(int param_1) { char cVar1; int iVar2; int *in_ECX; int iVar3; int *piVar4; uint uVar5; float in_XMM2_Da; if (param_1 < (in_ECX[1] - *in_ECX) / 0x1b8) { iVar3 = param_1 * 0x1b8 + *in_ECX; if (*(int *)(iVar3 + 400) == 0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); return; } if (*(char *)(iVar3 + 0x198) != '\0') { uVar5 = 0; piVar4 = (int *)(iVar3 + 0x20); do { if ((int *)*piVar4 != (int *)0x0) { if (*(char *)((int)piVar4 + 9) != '\0') { cVar1 = (**(code **)(*(int *)*piVar4 + 0x38))(); if (cVar1 != '\0') { *(undefined1 *)((int)piVar4 + 9) = 0; } } cVar1 = (**(code **)(*(int *)*piVar4 + 0x38))(); if ((cVar1 != '\0') || (*(char *)((int)piVar4 + 9) != '\0')) { piVar4[4] = (int)in_XMM2_Da; if ((int *)*piVar4 != (int *)0x0) { iVar2 = (**(code **)(*(int *)*piVar4 + 0x60))(); if ((iVar2 < 2) || (in_XMM2_Da == 0.0)) { (**(code **)(*(int *)*piVar4 + 0x50))(in_XMM2_Da); } else { KAGE_LogMessage(4,(byte *) "Attempting to set pan on non-mono source (%s), this will have no effect\n" ); } } } } uVar5 = uVar5 + 1; piVar4 = piVar4 + 0xe; } while (uVar5 < *(uint *)(iVar3 + 400)); } } return; } //@@ 0092e230 SFXManager::Stop /* ZHL [lua] Lua binding SFXManager:Stop prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall SFXManager::Stop(void *this,int soundId) { char cVar1; uint uVar2; char *pcVar3; int iVar4; if (-1 < soundId) { if (soundId < (*(int *)((int)this + 4) - *(int *)this) / 0x1b8) { iVar4 = soundId * 0x1b8 + *(int *)this; if (*(int *)(iVar4 + 400) == 0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); return; } if (*(char *)(iVar4 + 0x198) != '\0') { uVar2 = 0; pcVar3 = (char *)(iVar4 + 0x29); do { *(undefined4 *)(iVar4 + 4) = 0xffffffff; if (*(int **)(pcVar3 + -9) != (int *)0x0) { if (*pcVar3 != '\0') { cVar1 = (**(code **)(**(int **)(pcVar3 + -9) + 0x38))(); if (cVar1 != '\0') { *pcVar3 = '\0'; } } cVar1 = (**(code **)(**(int **)(pcVar3 + -9) + 0x38))(); if (((cVar1 != '\0') || (*pcVar3 != '\0')) && (*(int **)(pcVar3 + -9) != (int *)0x0)) { (**(code **)(**(int **)(pcVar3 + -9) + 0x3c))(); *pcVar3 = '\0'; } } uVar2 = uVar2 + 1; pcVar3 = pcVar3 + 0x38; } while (uVar2 < *(uint *)(iVar4 + 400)); } } } return; } //@@ 0092e300 SFXManager::StopLoopingSounds /* ZHL [lua] Lua binding SFXManager:StopLoopingSounds prototype: db/protos.zhl */ void __thiscall SFXManager::StopLoopingSounds(void *this) { int *piVar1; char cVar2; int iVar3; int iVar4; uint uVar5; int iVar6; int local_10; uint local_c; iVar3 = *(int *)this; iVar4 = *(int *)((int)this + 4) - iVar3; local_c = 0; iVar6 = iVar4 >> 0x1f; if (iVar4 / 0x1b8 + iVar6 != iVar6) { local_10 = 0; do { if ((*(char *)(local_10 + 0x198 + iVar3) != '\0') && (uVar5 = 0, *(int *)(local_10 + 400 + iVar3) != 0)) { iVar6 = local_10; do { piVar1 = *(int **)(iVar6 + 0x20 + iVar3); if (piVar1 != (int *)0x0) { if ((*(char *)(iVar6 + 0x29 + iVar3) != '\0') && (cVar2 = (**(code **)(*piVar1 + 0x38))(), cVar2 != '\0')) { *(undefined1 *)(iVar6 + 0x29 + iVar3) = 0; } cVar2 = (**(code **)(**(int **)(iVar6 + 0x20 + iVar3) + 0x38))(); if ((cVar2 != '\0') || (*(char *)(iVar6 + 0x29 + iVar3) != '\0')) { iVar3 = *(int *)this; piVar1 = *(int **)(iVar6 + 0x20 + iVar3); if (piVar1 == (int *)0x0) { cVar2 = *(char *)(iVar6 + 0x28 + iVar3); } else { cVar2 = (**(code **)(*piVar1 + 0x44))(); iVar3 = *(int *)this; } if (cVar2 != '\0') { piVar1 = *(int **)(iVar6 + 0x20 + iVar3); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 0x3c))(); *(undefined1 *)(iVar6 + iVar3 + 0x29) = 0; } } } } uVar5 = uVar5 + 1; iVar6 = iVar6 + 0x38; iVar3 = *(int *)this; } while (uVar5 < *(uint *)(local_10 + 400 + iVar3)); } local_10 = local_10 + 0x1b8; local_c = local_c + 1; } while (local_c < (uint)((*(int *)((int)this + 4) - iVar3) / 0x1b8)); } return; } //@@ 0092e430 SoundEffects::ClearVolumeModifier /* ZHL [exact] __thiscall void SoundEffects::ClearVolumeModifier(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall SoundEffects::ClearVolumeModifier(SoundEffects *this) { int *piVar1; char cVar2; void *pvVar3; int iVar4; int iVar5; float fVar6; uint local_10; uint local_c; local_10 = 0; pvVar3 = (this->_sounds)._begin; iVar4 = (int)(this->_sounds)._end - (int)pvVar3; iVar5 = iVar4 >> 0x1f; if (iVar4 / 0x1b8 + iVar5 != iVar5) { iVar5 = 0; do { local_c = 0; if (*(int *)(iVar5 + 400 + (int)pvVar3) != 0) { iVar4 = iVar5; do { if ((*(char *)(iVar5 + 0x198 + (int)pvVar3) != '\0') && (piVar1 = *(int **)(iVar4 + 0x20 + (int)pvVar3), piVar1 != (int *)0x0)) { if ((*(char *)(iVar4 + 0x29 + (int)pvVar3) != '\0') && (cVar2 = (**(code **)(*piVar1 + 0x38))(), cVar2 != '\0')) { *(undefined1 *)(iVar4 + 0x29 + (int)pvVar3) = 0; } cVar2 = (**(code **)(**(int **)(iVar4 + 0x20 + (int)pvVar3) + 0x38))(); if ((cVar2 != '\0') || (*(char *)(iVar4 + 0x29 + (int)pvVar3) != '\0')) { fVar6 = this->_volumeModifier; pvVar3 = (this->_sounds)._begin; if (fVar6 <= 0.0) { fVar6 = 0.0; } fVar6 = fVar6 * *(float *)(iVar5 + 0x194 + (int)pvVar3) * (g_manager->_optionsConfig)._sfxVolume; *(float *)(iVar4 + 0x2c + (int)pvVar3) = fVar6; piVar1 = *(int **)(iVar4 + 0x20 + (int)pvVar3); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 0x48))(fVar6); } } } iVar4 = iVar4 + 0x38; local_c = local_c + 1; pvVar3 = (this->_sounds)._begin; } while (local_c < *(uint *)(iVar5 + 400 + (int)pvVar3)); } local_10 = local_10 + 1; iVar5 = iVar5 + 0x1b8; } while (local_10 < (uint)(((int)(this->_sounds)._end - (int)pvVar3) / 0x1b8)); } return; } //@@ 0092e560 SFXManager::IsPlaying /* ZHL [lua] Lua binding SFXManager:IsPlaying prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall SFXManager::IsPlaying(void *this,int soundId) { int *piVar1; char cVar2; int iVar3; int iVar4; int iVar5; uint uVar6; if ((((-1 < soundId) && (iVar5 = *(int *)this, soundId < (*(int *)((int)this + 4) - iVar5) / 0x1b8)) && (iVar3 = soundId * 0x1b8, *(int *)(iVar5 + 400 + iVar3) != 0)) && (*(char *)(iVar5 + 0x198 + iVar3) != '\0')) { uVar6 = 0; iVar4 = iVar3; do { piVar1 = *(int **)(iVar4 + 0x20 + iVar5); if (piVar1 != (int *)0x0) { if ((*(char *)(iVar4 + 0x29 + iVar5) != '\0') && (cVar2 = (**(code **)(*piVar1 + 0x38))(), cVar2 != '\0')) { *(undefined1 *)(iVar4 + 0x29 + iVar5) = 0; } cVar2 = (**(code **)(**(int **)(iVar4 + 0x20 + iVar5) + 0x38))(); if ((cVar2 != '\0') || (*(char *)(iVar4 + 0x29 + iVar5) != '\0')) { return 1; } } uVar6 = uVar6 + 1; iVar4 = iVar4 + 0x38; iVar5 = *(int *)this; } while (uVar6 < *(uint *)(iVar5 + 400 + iVar3)); } return 0; } //@@ 0092e620 SFXManager::SetAmbientSound /* ZHL [lua] Lua binding SFXManager:SetAmbientSound prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall SFXManager::SetAmbientSound(void *this,int soundId,float volume,float pitch) { Manager *pMVar1; int soundId_00; byte bVar2; soundId_00 = soundId; if (0.01 < volume) { bVar2 = IsPlaying(this,soundId); pMVar1 = g_manager; if (bVar2 != 0) { AdjustVolume(this,soundId_00,volume); AdjustPitch(this,soundId_00,pitch); return; } soundId = soundId_00; seed_fart_sound_override(&soundId); SoundEffects::Play(&pMVar1->_sfxManager,soundId,volume,2,1,pitch,0.0); } else { bVar2 = IsPlaying(this,soundId); if (bVar2 != 0) { Stop(this,soundId_00); return; } } return; } //@@ 0092e6e0 SFXManager::GetAmbientSoundVolume /* ZHL [lua] Lua binding SFXManager:GetAmbientSoundVolume prototype: db/protos.zhl, confirmed by RET 4 */ float __thiscall SFXManager::GetAmbientSoundVolume(void *this,int soundId) { byte bVar1; int iVar2; if ((-1 < soundId) && (soundId < (*(int *)((int)this + 4) - *(int *)this) / 0x1b8)) { iVar2 = soundId * 0x1b8 + *(int *)this; if (*(int *)(iVar2 + 400) == 0) { KAGE_LogMessage(1,(byte *)"[warn] Sound %d has no samples.\n"); } else if (*(char *)(iVar2 + 0x198) != '\0') { bVar1 = IsPlaying(this,soundId); if (bVar1 != 0) { return *(float *)(iVar2 + 0x194); } } } return 0.0; } //@@ 0092e750 std::vector::_Tidy /* DB: destroys 0x1b8-byte elements (FUN_0092ea80) and frees the buffer; Manager::destructor */ void std::vector::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { _Destroy_range(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x1b8) * 0x1b8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0092e7d0 FUN_0092e7d0 void FUN_0092e7d0(void) { std::_Destroy_range(); return; } //@@ 0092e7f0 FUN_0092e7f0 void FUN_0092e7f0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x1b8; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 0092e830 SoundEffect::move_constructor /* DB: EDX=dest: copies id/count, 7 x 0x38 samples, flags, and moves the std::string at +0x1a0; used by the vector reallocators prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl SoundEffect::move_constructor(void *dst,void *src) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; *(undefined4 *)dst = *(undefined4 *)src; *(undefined4 *)((int)dst + 4) = *(undefined4 *)((int)src + 4); _eh_vector_copy_constructor_iterator_ ((void *)((int)dst + 8),(void *)((int)src + 8),0x38,7,FUN_0092eb00,FUN_0092cf10); *(undefined4 *)((int)dst + 400) = *(undefined4 *)((int)src + 400); *(undefined4 *)((int)dst + 0x194) = *(undefined4 *)((int)src + 0x194); *(undefined1 *)((int)dst + 0x198) = *(undefined1 *)((int)src + 0x198); *(undefined1 *)((int)dst + 0x199) = *(undefined1 *)((int)src + 0x199); *(undefined4 *)((int)dst + 0x19c) = *(undefined4 *)((int)src + 0x19c); *(undefined4 *)((int)dst + 0x1a0) = 0; *(undefined4 *)((int)dst + 0x1b0) = 0; *(undefined4 *)((int)dst + 0x1b4) = 0; uVar1 = *(undefined4 *)((int)src + 0x1a4); uVar2 = *(undefined4 *)((int)src + 0x1a8); uVar3 = *(undefined4 *)((int)src + 0x1ac); *(undefined4 *)((int)dst + 0x1a0) = *(undefined4 *)((int)src + 0x1a0); *(undefined4 *)((int)dst + 0x1a4) = uVar1; *(undefined4 *)((int)dst + 0x1a8) = uVar2; *(undefined4 *)((int)dst + 0x1ac) = uVar3; *(undefined8 *)((int)dst + 0x1b0) = *(undefined8 *)((int)src + 0x1b0); *(undefined4 *)((int)src + 0x1b0) = 0; *(undefined4 *)((int)src + 0x1b4) = 0xf; *(undefined1 *)((int)src + 0x1a0) = 0; return; } //@@ 0092e900 std::vector::_Emplace_reallocate /* DB: 0x1b8-byte elements (max 0x94f209), move-constructs the new one with FUN_0092e830; SFXManager::load_xml */ void * std::vector::_Emplace_reallocate(int param_1,void *param_2) { uint uVar1; int iVar2; int iVar3; void *pvVar4; void *dst; int *in_ECX; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ac10; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0x1b8; if (iVar3 == 0x94f209) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0x1b8; if (0x94f209 - (uVar1 >> 1) < uVar1) { uVar5 = 0x94f209; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0x94f209 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = _Allocate(uVar5 * 0x1b8); local_8 = 0; dst = (void *)(((param_1 - iVar2) / 0x1b8) * 0x1b8 + (int)pvVar4); SoundEffect::move_constructor(dst,param_2); if (param_1 == in_ECX[1]) { _Uninitialized_move(*in_ECX,in_ECX[1],pvVar4); } else { FUN_0092ed30(*in_ECX,param_1,pvVar4); FUN_0092ed30(param_1,in_ECX[1],(int)dst + 0x1b8); } _Change_array(pvVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return dst; } //@@ 0092ea4e Catch_All@0092ea4e void Catch_All_0092ea4e(void) { int unaff_EBP; FUN_0092e7d0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_0092e7f0(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0092ea80 std::_Destroy_range /* DB: ECX..EDX of 0x1b8-byte entries: string +0 and 7 x 0x38 sample sub-entries (FUN_0092cf10); SFXManager::load_xml */ void std::_Destroy_range(void) { int iVar1; int in_ECX; int in_EDX; void *pvVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if (in_ECX != in_EDX) { pvVar2 = (void *)(in_ECX + 8); do { local_8 = 0; string::_Tidy_deallocate((char *)((int)pvVar2 + 0x198)); _eh_vector_destructor_iterator_(pvVar2,0x38,7,FUN_0092cf10); iVar1 = (int)pvVar2 + 0x1b0; pvVar2 = (void *)((int)pvVar2 + 0x1b8); } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 0092eb00 FUN_0092eb00 void FUN_0092eb00(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ac3d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; local_8 = 0; FUN_00a2aa60(param_1 + 6); *(undefined1 *)(in_ECX + 0xc) = *(undefined1 *)(param_1 + 0xc); in_ECX[0xd] = param_1[0xd]; ExceptionList = local_10; return; } //@@ 0092eba0 std::vector::_Change_array /* DB: std::_Destroy_range, frees (0x1b8 stride), installs new buffer; _Emplace_reallocate/_Resize_reallocate */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { _Destroy_range(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x1b8) * 0x1b8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x1b8 + param_1; in_ECX[2] = param_3 * 0x1b8 + param_1; return; } //@@ 0092ec30 std::_Uninitialized_move /* DB: copies 0x1b8-byte SoundEffects (7x0x38 sub array copy ctor, string +0x198) into the new buffer, then std::_Destroy_range; std::vector::_Emplace_reallocate/_Resize_reallocate */ void std::_Uninitialized_move(int param_1,int param_2,undefined4 *param_3) { int iVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *pvVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ac6d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (param_1 != param_2) { pvVar3 = (void *)(param_1 + 8); do { *param_3 = *(undefined4 *)((int)pvVar3 + -8); param_3[1] = *(undefined4 *)((int)pvVar3 + -4); _eh_vector_copy_constructor_iterator_(param_3 + 2,pvVar3,0x38,7,FUN_0092ef90,FUN_0092cf10); param_3[100] = *(undefined4 *)((int)pvVar3 + 0x188); param_3[0x65] = *(undefined4 *)((int)pvVar3 + 0x18c); *(undefined1 *)(param_3 + 0x66) = *(undefined1 *)((int)pvVar3 + 400); *(undefined1 *)((int)param_3 + 0x199) = *(undefined1 *)((int)pvVar3 + 0x191); param_3[0x67] = *(undefined4 *)((int)pvVar3 + 0x194); string::string((char *)(param_3 + 0x68),(void *)((int)pvVar3 + 0x198)); param_3 = param_3 + 0x6e; iVar1 = (int)pvVar3 + 0x1b0; in_ECX = extraout_ECX; pvVar3 = (void *)((int)pvVar3 + 0x1b8); } while (iVar1 != param_2); } _Destroy_range(in_ECX,uVar2); ExceptionList = local_10; return; } //@@ 0092ed30 FUN_0092ed30 void * FUN_0092ed30(void *param_1,void *param_2,void *param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ac6d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = (void *)((int)param_1 + 0x1b8)) { SoundEffect::move_constructor(param_3,param_1); param_3 = (void *)((int)param_3 + 0x1b8); ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } std::_Destroy_range(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 0092edc0 std::_Uninitialized_value_construct_n /* DB: constructs N 0x1b8-byte entries (FUN_0092cea0), destroys the range on throw; SFXManager::load_xml */ int std::_Uninitialized_value_construct_n(int param_1,int param_2) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ac9d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_2 != 0; param_2 = param_2 + -1) { FUN_0092cea0(uVar2); param_1 = param_1 + 0x1b8; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } _Destroy_range(in_ECX); ExceptionList = local_10; return param_1; } //@@ 0092ee40 std::vector::_Resize_reallocate /* DB: 0x1b8-byte elements, grows to 0x443 (1091 sounds) via _Uninitialized_value_construct_n FUN_0092edc0; SFXManager::load_xml */ void std::vector::_Resize_reallocate(undefined4 param_1,undefined1 *param_2) { int iVar1; void *pvVar2; int *in_ECX; uint uVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0acc0; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = (in_ECX[1] - *in_ECX) / 0x1b8; uVar3 = (in_ECX[2] - *in_ECX) / 0x1b8; if (0x94f209 - (uVar3 >> 1) < uVar3) { uVar3 = 0x94f209; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < 0x443) { uVar3 = 0x443; } else if (0x94f209 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar2 = _Allocate(uVar3 * 0x1b8); local_8 = 0; _Uninitialized_value_construct_n ((void *)(iVar1 * 0x1b8 + (int)pvVar2),0x443 - iVar1,*param_2); _Uninitialized_move(*in_ECX,in_ECX[1],pvVar2); _Change_array(pvVar2,0x443,uVar3); ExceptionList = local_10; return; } //@@ 0092ef49 Catch_All@0092ef49 void Catch_All_0092ef49(void) { int unaff_EBP; FUN_0092e7d0(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x18)); FUN_0092e7f0(*(undefined4 *)(unaff_EBP + -0x20),*(undefined4 *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0092ef80 FUN_0092ef80 void FUN_0092ef80(void) { std::_Destroy_range(); return; } //@@ 0092ef90 FUN_0092ef90 void FUN_0092ef90(void *param_1) { char *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ac3d; local_10 = ExceptionList; ExceptionList = &local_10; std::string::string(in_ECX,param_1); local_8 = 0; FUN_00a2aa60((int)param_1 + 0x18); in_ECX[0x30] = *(char *)((int)param_1 + 0x30); *(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)((int)param_1 + 0x34); ExceptionList = local_10; return; } //@@ 0092f050 StageTransition::update_player_trapdoor_scale /* DB: ? (player, isFast): when the transition state (ECX+0x10) is 4 and the player sprite plays "Trapdoor", eases sprite _scale above 2.0 back toward 1.5 by animFrame (rate 1.0 or 1.5); callers StageTransition::Update and Game::interpolate_update */ void StageTransition::update_player_trapdoor_scale(Entity_Player *param_1,char param_2) { float fVar1; float fVar2; byte bVar3; byte *pbVar4; uint uVar5; float *extraout_EAX; int in_ECX; char *pcVar6; bool bVar7; float fVar8; float fVar9; float fVar10; Vector local_10; if (((*(int *)(in_ECX + 0x10) == 4) && ((param_1->_sprite)._animState._animData != (void *)0x0)) && ((param_1->_sprite)._animState._isPlaying != 0)) { pbVar4 = (param_1->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar6 = "Trapdoor"; do { bVar3 = *pbVar4; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_0092f0b0: uVar5 = -(uint)bVar7 | 1; goto LAB_0092f0b5; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_0092f0b0; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0092f0b5: if (uVar5 == 0) { fVar1 = (param_1->_sprite)._scale.x; fVar2 = (param_1->_sprite)._scale.y; if ((2.0 < fVar1) || (2.0 < fVar2)) { if (param_2 == '\0') { fVar10 = 1.0; } else { fVar10 = 1.5; } fVar9 = 1.0 - 1.0 / (fVar10 + (param_1->_sprite)._animState._animFrame); fVar10 = 1.5; if (fVar2 <= 1.5) { fVar10 = fVar2; } fVar8 = 1.5; if (fVar1 <= 1.5) { fVar8 = fVar1; } (param_1->_sprite)._scale.y = (fVar10 - fVar2) * fVar9 + fVar2; (param_1->_sprite)._scale.x = (fVar8 - fVar1) * fVar9 + fVar1; } Entity_Player::GetFlyingOffset(param_1,&local_10); fVar1 = (param_1->_sprite)._offset.x; fVar2 = (param_1->_sprite)._offset.y; fVar10 = (param_1->_sprite)._scale.y; fVar9 = extraout_EAX[1]; (param_1->_sprite)._offset.x = ((0.0 - *extraout_EAX) - fVar1) * 0.15 + fVar1; (param_1->_sprite)._offset.y = (((-32.0 - fVar10 * 11.0) - fVar9) - fVar2) * 0.15 + fVar2; } } return; } //@@ 0092f1c0 StageTransition::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: catchUpPlayer=Game._stageTransition (0x1ba78), switch on state; "[warn] No ending for big chest!", Player Exit/Pickup anims, Level::SetNextStage/Init/ShowName, Game::End; called from Game::Update when the state != 0 prototype: db/protos.zhl */ void __thiscall StageTransition::Update(StageTransition *catchUpPlayer) { undefined1 uVar1; int *piVar2; byte bVar3; uint uVar4; Vector *trapdoorPos; Entity *spawnedEffect; uint uVar5; std_string *animName; int *playerIt; RoomDescriptor *startingRoom; int iVar6; void *pvVar7; Game *game; int gridX; char cVar8; undefined4 *playerSlot; Entity_Player *player; bool bVar9; float fVar10; float fVar11; double dVar12; Vector dustVelocity; float angleSin; float dustSpeed; float angle; Vector spawnPos; StageTransition *transition; Entity_Player *waitingPlayer; GridEntity *trapdoorGrid; int minExitFrame; char isExitAnimDone; Entity_Player *local_38; Entity_Player *exitingPlayer; char local_2e; char isNoPlayerExiting; void *tmpString [4]; uint tmpStringSize; uint tmpStringCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; Entity_Player *catchUpPlayer; uint *flagsHigh; Manager *manager; qword savedFlags; GridEntity *trapdoor; game = g_game; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0aced; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(tmpString + 10); ExceptionList = &local_10; transition = catchUpPlayer; local_14 = uVar4; switch(*(undefined4 *)catchUpPlayer) { case 1: isNoPlayerExiting = '\x01'; waitingPlayer = (Entity_Player *)0x0; exitingPlayer = (Entity_Player *)0x0; minExitFrame = 1000; local_2e = '\0'; EntityList::Update((EntityList *)((int)g_game->_room + 0x1218),1); if (((catchUpPlayer[1]._frame == 4) && (pvVar7 = (g_game->_playerManager)._stageTransitionPlayer, *(float *)((int)pvVar7 + 0x1b1c) == g_vectorZero.x)) && (*(float *)((int)pvVar7 + 0x1b20) == g_vectorZero.y)) { playerIt = (g_game->_playerManager)._playerList._begin; if (playerIt != (g_game->_playerManager)._playerList._end) { do { piVar2 = (int *)*playerIt; if ((piVar2 != (int *)0x0) && (piVar2[0xb] == 0)) { (**(code **)(*piVar2 + 0xc))(); } playerIt = playerIt + 1; } while (playerIt != (g_game->_playerManager)._playerList._end); } break; } playerIt = (g_game->_playerManager)._playerList._begin; player = (Entity_Player *)0x0; if (playerIt != (g_game->_playerManager)._playerList._end) { do { player = (Entity_Player *)*playerIt; if ((player != (Entity_Player *)0x0) && (player->_variant == 0)) { if (player->_isPlayingExtraAnimation == 0) { LAB_0092f31d: isExitAnimDone = '\0'; } else { if ((player->_sprite)._animState._animData != (void *)0x0) { local_38 = (Entity_Player *)(player->_sprite)._animState._animFrame; dVar12 = floor((double)(float)local_38); local_38 = (Entity_Player *)(float)dVar12; if ((int)dVar12 != *(int *)((int)(player->_sprite)._animState._animData + 0x30) + -1) goto LAB_0092f31d; } isExitAnimDone = '\x01'; } (**(code **)(*(int *)player + 0xc))(); if ((player->_dead == 0) && (catchUpPlayer[1]._frame != 1)) { if (((player->_isPlayingExtraAnimation == 0) && (player->_isPlayingItemAnimation == 0)) || ((player->_isCoopGhost != 0 && (fVar10 = (player->_moveToTarget).x - (player->_pos).x, fVar11 = (player->_moveToTarget).y - (player->_pos).y, fVar11 * fVar11 + fVar10 * fVar10 <= 1.0)))) { if (isExitAnimDone == '\0') { if ((player->_visible != 0) && (waitingPlayer == (Entity_Player *)0x0)) { waitingPlayer = player; } } else { player->_visible = 0; } } else { isNoPlayerExiting = '\0'; if ((player->_sprite)._animState._animData == (void *)0x0) { iVar6 = -1; } else { local_38 = (Entity_Player *)(player->_sprite)._animState._animFrame; dVar12 = floor((double)(float)local_38); iVar6 = (int)dVar12; } local_38 = player; if (minExitFrame <= iVar6) { iVar6 = minExitFrame; local_38 = exitingPlayer; } minExitFrame = iVar6; exitingPlayer = local_38; update_player_trapdoor_scale(player,0); if (((player->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered (&(player->_sprite)._animState,&DAT_00b1d534), bVar3 != 0)) { local_2e = '\x01'; exitingPlayer = local_38; } } } } playerIt = playerIt + 1; } while (playerIt != (g_game->_playerManager)._playerList._end); player = exitingPlayer; if (exitingPlayer != (Entity_Player *)0x0) { fVar10 = (exitingPlayer->_moveToTarget).y; *(float *)(catchUpPlayer + 2) = (exitingPlayer->_moveToTarget).x; catchUpPlayer[2]._frame = (int)fVar10; } } pvVar7 = g_game->_room; gridX = (int)((*(float *)(catchUpPlayer + 2) - 40.0) / 40.0 + 0.5); iVar6 = (int)(((float)catchUpPlayer[2]._frame - 120.0) / 40.0 + 0.5); if (gridX < 0) { LAB_0092f849: cVar8 = isNoPlayerExiting; } else { if (((*(int *)((int)pvVar7 + 0xc) <= gridX) || (iVar6 < 0)) || (*(int *)((int)pvVar7 + 0x10) <= iVar6)) goto LAB_0092f849; uVar4 = iVar6 * *(int *)((int)pvVar7 + 0xc) + gridX; if (0x1bf < uVar4) goto LAB_0092f849; trapdoor = *(GridEntity **)((int)pvVar7 + uVar4 * 4 + 0x24); trapdoorGrid = trapdoor; if (((trapdoor == (GridEntity *)0x0) || ((trapdoor->_desc)._type != 0x11)) || ((trapdoor->_desc)._variant != 0)) goto LAB_0092f849; if (local_2e != '\0') { bVar3 = ANM2::SetAnimation(&trapdoor->_sprite,(byte *)"Player Exit",1); if (bVar3 != 0) { AnimationState::Rewind(&(trapdoor->_sprite)._animState); (trapdoor->_sprite)._animState._isPlaying = 1; } if (*(float *)((int)g_game->_room + 0x7240) <= 0.2) { uVar4 = Random(); trapdoorPos = GridEntity::Position(trapdoorGrid,&spawnPos); spawnedEffect = Game::Spawn(g_game,1000,0xf,trapdoorPos,&g_vectorZero,(Entity *)0x0,2,uVar4); savedFlags = spawnedEffect->_flags; iVar6 = *(int *)spawnedEffect; flagsHigh = (uint *)((int)&spawnedEffect->_flags + 4); *flagsHigh = *flagsHigh | 0x1000; *(int *)&spawnedEffect->_flags = (int)savedFlags; (spawnedEffect->_sprite)._color._tint[3] = 0.5; (spawnedEffect->_sprite)._playbackSpeed = 2.0; spawnedEffect->_renderDepthOffset = 4.0; (**(code **)(iVar6 + 0xc))(); } else { uVar4 = Random(); trapdoorPos = GridEntity::Position(trapdoorGrid,&spawnPos); spawnedEffect = Game::Spawn(g_game,1000,99,trapdoorPos,&g_vectorZero,(Entity *)0x0,0,uVar4); fVar10 = (spawnedEffect->_sprite)._scale.x; fVar11 = (spawnedEffect->_sprite)._scale.y; savedFlags = spawnedEffect->_flags; flagsHigh = (uint *)((int)&spawnedEffect->_flags + 4); *flagsHigh = *flagsHigh | 0x1000; *(int *)&spawnedEffect->_flags = (int)savedFlags; iVar6 = *(int *)spawnedEffect; (spawnedEffect->_sprite)._scale.x = fVar10 + fVar10; (spawnedEffect->_sprite)._scale.y = fVar11 + fVar11; (spawnedEffect->_sprite)._playbackSpeed = 2.0; (**(code **)(iVar6 + 0xc))(); uVar4 = Random(); trapdoor = trapdoorGrid; local_38 = (Entity_Player *)(uVar4 % 5 + 3); if (local_38 != (Entity_Player *)0x0) { do { uVar4 = Random(); uVar5 = Random(); angle = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; angle = angle + angle; angleSin = sin(angle); uVar5 = Random(); dustSpeed = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)] ) * 2.3283064e-10 * 8.0; dustVelocity.x = cos(angle); dustVelocity.x = dustVelocity.x * dustSpeed; iVar6 = *(int *)((int)g_game->_room + 0xc); dustVelocity.y = dustSpeed * angleSin; spawnPos.x = (float)(trapdoor->_gridIndex % iVar6) * 40.0 + 40.0; spawnPos.y = (float)(trapdoor->_gridIndex / iVar6) * 40.0 + 120.0; spawnedEffect = Game::Spawn(g_game,1000,99,&spawnPos,&dustVelocity,(Entity *)0x0,1,uVar4); fVar10 = (spawnedEffect->_sprite)._scale.x; fVar11 = (spawnedEffect->_sprite)._scale.y; spawnedEffect[1]._damageEvents._end = (void *)0x3f800000; (spawnedEffect->_sprite)._scale.x = fVar10 + fVar10; (spawnedEffect->_sprite)._scale.y = fVar11 + fVar11; uVar4 = Random(); flagsHigh = (uint *)((int)&spawnedEffect->_flags + 4); *flagsHigh = *flagsHigh | 0x1000; dVar12 = __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]; *(int *)&spawnedEffect->_flags = (int)spawnedEffect->_flags; iVar6 = *(int *)spawnedEffect; spawnedEffect[1]._damageEvents._begin = (void *)(-8.0 - (float)((double)(int)uVar4 + dVar12) * 2.3283064e-10 * 4.0); (**(code **)(iVar6 + 0xc))(); local_38 = (Entity_Player *)((int)&local_38[-1]._replacedPlayer + 3); } while (local_38 != (Entity_Player *)0x0); local_38 = (Entity_Player *)0x0; catchUpPlayer = transition; player = exitingPlayer; } } } if (((trapdoorGrid->_sprite)._animState._animData == (void *)0x0) || ((trapdoorGrid->_sprite)._animState._isPlaying == 0)) goto LAB_0092f849; ANM2::Update(&trapdoorGrid->_sprite); cVar8 = '\0'; } catchUpPlayer = waitingPlayer; if (((player == (Entity_Player *)0x0) || (waitingPlayer == (Entity_Player *)0x0)) || (minExitFrame < 6)) { if (cVar8 == '\0') goto LAB_0092f901; } else { animName = ANM2::GetAnimation((ANM2 *)&(player->_sprite)._animState,(std_string *)tmpString); local_8 = (void *)0x0; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } Entity_Player::PlayExtraAnimation(catchUpPlayer,(byte *)animName); local_8 = (void *)0xffffffff; if (0xf < tmpStringCapacity) { uVar4 = tmpStringCapacity + 1; pvVar7 = tmpString[0]; if (0xfff < uVar4) { pvVar7 = *(void **)((int)tmpString[0] + -4); uVar4 = tmpStringCapacity + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar4); } fVar10 = (player->_moveToTarget).y; tmpStringSize = 0; tmpStringCapacity = 0xf; tmpString[0] = (void *)((uint)tmpString[0] & 0xffffff00); (catchUpPlayer->_moveToTarget).x = (player->_moveToTarget).x; (catchUpPlayer->_moveToTarget).y = fVar10; LAB_0092f901: if (catchUpPlayer[1]._frame != 1) break; } playerIt = (g_game->_playerManager)._playerList._begin; if (playerIt != (g_game->_playerManager)._playerList._end) { piVar2 = (g_game->_playerManager)._playerList._end; do { iVar6 = *playerIt; if ((iVar6 != 0) && (*(int *)(iVar6 + 0x2c) == 0)) { *(float *)(iVar6 + 0xdc) = g_vectorZero.x; *(float *)(iVar6 + 0xe0) = g_vectorZero.y; } playerIt = playerIt + 1; } while (playerIt != piVar2); } if ((0x14 < (uint)catchUpPlayer->_frame) || ((catchUpPlayer[1]._frame == 1 && (5 < (uint)catchUpPlayer->_frame)))) { catchUpPlayer->_frame = 0; *(int *)catchUpPlayer = 2; FUN_007ea5d0(); SFXManager::StopLoopingSounds(&g_manager->_sfxManager); if ((catchUpPlayer[1]._frame == 4) && (iVar6 = get_stage_ending_id(), iVar6 != 0)) { if (iVar6 == 0xff) { KAGE_LogMessage(1,(byte *)"[warn] No ending for big chest!\n"); Game::FinishChallenge(g_game); *(int *)catchUpPlayer = 4; } else { if ((g_game->_onlineStatsScreen)._isActive == 0) { Game::End(g_game,iVar6); } *(int *)catchUpPlayer = 4; } } } break; case 2: uVar4 = catchUpPlayer->_frame; uVar5 = catchUpPlayer->_duration; if (uVar4 < uVar5) { if (uVar4 == uVar5 - 2) { if (*(char *)(catchUpPlayer + 1) == '\0') { iVar6 = catchUpPlayer[1]._frame; if (iVar6 == 2) { Level::SetStage((Level *)g_game,0xb,0); } else if (iVar6 == 3) { Level::SetStage((Level *)g_game,0xc,0); } else if (iVar6 == 6) { Level::SetStage((Level *)g_game,0xd,0); } else { Level::SetNextStage((Level *)g_game); } } else { bVar3 = Game::IsInTimedSet(g_game,0x10); if (bVar3 != 0) { bVar3 = Game::IsGreedMode(game); if (bVar3 == 0) { iVar6 = (~g_game->_stageNameNumeral & 1U) + 1; game = g_game; } else { iVar6 = 1; } Level::SetStage((Level *)game,iVar6,0); Seeds::ForgetStageSeed(&g_game->_seedEffects,g_game->_stage); } } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { NetplayManager::process_pending_joins(); } break; } if ((uVar4 != uVar5 - 1) || ((char)catchUpPlayer[1]._duration != '\0')) break; bVar3 = Level::IsAscent((Level *)g_game); bVar9 = bVar3 == 0; LAB_0092fe68: if (!bVar9) break; } else { catchUpPlayer->_frame = 0; *(undefined4 *)catchUpPlayer = 3; if (uVar5 == 8) { catchUpPlayer->_duration = 0xf; } game = g_game; if (catchUpPlayer[1]._frame == 1) { playerSlot = (g_game->_playerManager)._playerList._begin; if (playerSlot != (g_game->_playerManager)._playerList._end) { do { player = (Entity_Player *)*playerSlot; if ((player != (Entity_Player *)0x0) && (player->_variant == 0)) { if (player == (game->_playerManager)._stageTransitionPlayer) { Entity_Player::AnimateCollectible (player,0x7f,(byte *)"Pickup",(byte *)"PlayerPickupSparkle"); } else { Entity_Player::PlayExtraAnimation(player,(byte *)"Appear"); } game = g_game; } playerSlot = playerSlot + 1; } while (playerSlot != (game->_playerManager)._playerList._end); } } else if (((catchUpPlayer[1]._frame != 5) && (bVar3 = Level::IsAscent((Level *)g_game), bVar3 == 0)) && (playerSlot = (game->_playerManager)._playerList._begin, playerSlot != (game->_playerManager)._playerList._end)) { do { player = (Entity_Player *)*playerSlot; if ((player != (Entity_Player *)0x0) && (player->_variant == 0)) { Entity_Player::PlayExtraAnimation(player,(byte *)"Appear"); game = g_game; } playerSlot = playerSlot + 1; } while (playerSlot != (game->_playerManager)._playerList._end); } EntityList::Update((EntityList *)((int)game->_room + 0x1218),1); playerIt = (g_game->_playerManager)._playerList._begin; game = g_game; if (playerIt != (g_game->_playerManager)._playerList._end) { do { piVar2 = (int *)*playerIt; if ((piVar2 != (int *)0x0) && (piVar2[0xb] == 0)) { (**(code **)(*piVar2 + 0xc))(); game = g_game; *(undefined1 *)((int)piVar2 + 0x171) = 1; } playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); } if (game->field_0x10 == '\0') { game->_stagesWithoutHeartsPicked = game->_stagesWithoutHeartsPicked + 1; if (1 < game->_stagesWithoutHeartsPicked) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x2a); game = g_game; } } else { game->_stagesWithoutHeartsPicked = 0; } if ((game->_levelStateFlags & 0x20) == 0) { game->_stagesWithoutDamage = game->_stagesWithoutDamage + 1; if (1 < game->_stagesWithoutDamage) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x43); game = g_game; } } else { game->_stagesWithoutDamage = 0; } if ((((game->_difficulty != 2) && (game->_difficulty != 3)) && (game->_stage == 7)) && ((game->_stageType == 4 || (game->_stageType == 5)))) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x19b); game = g_game; } if (catchUpPlayer[1]._frame == 5) { savedFlags = game->_gameStateFlags; flagsHigh = (uint *)((int)&game->_gameStateFlags + 4); *flagsHigh = *flagsHigh | 0x10000; *(int *)&game->_gameStateFlags = (int)savedFlags; if (catchUpPlayer[1]._frame != 5) goto LAB_0092fbfd; LAB_0092fc1b: manager = g_manager; local_38 = (Entity_Player *)0x267; seed_fart_sound_override((int *)&local_38); SoundEffects::Play(&manager->_sfxManager,(int)local_38,1.0,2,0,1.0,0.0); } else { LAB_0092fbfd: if (((0 < game->_stage) && (game->_stage < 7)) && ((game->_gameStateFlags & 0x1000000000000) != 0)) goto LAB_0092fc1b; } Level::Init(); Room::Update(); Manager::save_game_state(); PlayerManager::trigger_new_room_effects(&g_game->_playerManager); game = g_game; if ((g_game->_challenge == 0x1f) && (g_game->_stage != 0xb)) { playerIt = (g_game->_playerManager)._playerList._begin; if (playerIt != (g_game->_playerManager)._playerList._end) { do { iVar6 = *playerIt; if ((iVar6 != 0) && (*(int *)(iVar6 + 0x2c) == 0)) { *(undefined1 *)(iVar6 + 0x1398) = 0; *(undefined1 *)(iVar6 + 0x139a) = 0; } playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); } RoomTransition::start (&g_game->_roomTransition, g_game->_roomList[g_game->_lastBossRoomListIdx].GridIndex,0xffffffff,0xf,0); RoomTransition::Update(&g_game->_roomTransition); startingRoom = Level::GetRoomByIdx((Level *)g_game,g_game->_startingRoomIdx,-1); game = g_game; startingRoom->Flags = startingRoom->Flags & 0xfffffffe; Game::UpdateVisibility(game); *(undefined4 *)catchUpPlayer = 0; } if ((char)catchUpPlayer[1]._duration == '\0') break; if ((0 < g_game->_stage) && (g_game->_stage < 7)) { bVar9 = (g_game->_gameStateFlags & 0x1000000000000) == 0; goto LAB_0092fe68; } } manager = g_manager; uVar1 = *(undefined1 *)(catchUpPlayer + 1); g_manager->_isNightmarePending = 1; manager->field_0x4b2a5 = uVar1; break; case 3: uVar4 = catchUpPlayer->_frame; if ((uVar4 == 2) && ((char)catchUpPlayer[1]._duration != '\0')) { Room::PlayMusic(g_game->_room); uVar4 = catchUpPlayer->_frame; } game = g_game; if ((uint)catchUpPlayer->_duration <= uVar4) { catchUpPlayer->_frame = 0; *(undefined4 *)catchUpPlayer = 4; Level::ShowName((Level *)game,0); } break; case 4: local_2e = '\x01'; EntityList::Update((EntityList *)((int)g_game->_room + 0x1218),1); playerIt = (g_game->_playerManager)._playerList._begin; game = g_game; if (playerIt == (g_game->_playerManager)._playerList._end) { LAB_0092ff4d: *(int *)catchUpPlayer = 0; } else { cVar8 = local_2e; do { piVar2 = (int *)*playerIt; if ((piVar2 != (int *)0x0) && (piVar2[0xb] == 0)) { (**(code **)(*piVar2 + 0xc))(uVar4); if (((char)piVar2[0x4e6] == '\0') && (*(char *)((int)piVar2 + 0x139a) == '\0')) { *(undefined1 *)(piVar2 + 0x104) = 1; } else { cVar8 = '\0'; } game = g_game; } playerIt = playerIt + 1; } while (playerIt != (game->_playerManager)._playerList._end); catchUpPlayer = transition; if (cVar8 != '\0') goto LAB_0092ff4d; } ItemOverlay::Update(&game->_itemOverlay,0); } catchUpPlayer->_frame = catchUpPlayer->_frame + 1; game = g_game; if ((*(int *)catchUpPlayer == 3) || (*(int *)catchUpPlayer == 2)) { (g_game->_hud)._hudRefreshType = 2; (game->_hud)._hudRefreshCountdown = 2; } ExceptionList = local_10; return; } //@@ 0092ffc0 StageTransition::Render /* DB: ECX=Game+0x1ba78 from Game::Render: computes the fade alpha from state/timer, white in Mega Satan style flag, draws the fullscreen fade quad, render_color_shader_pass in states 2/3 */ void StageTransition::Render(void) { int iVar1; int *in_ECX; KColor local_8c; undefined1 local_78 [116]; iVar1 = *in_ECX; if (iVar1 == 3) { local_8c._alpha = 1.0 - (float)((double)in_ECX[1] + __uint_to_double_fixup[-(in_ECX[1] >> 0x1f)]) / (float)((double)in_ECX[2] + __uint_to_double_fixup[-(in_ECX[2] >> 0x1f)]); } else if (iVar1 == 2) { local_8c._alpha = (float)((double)in_ECX[1] + __uint_to_double_fixup[-(in_ECX[1] >> 0x1f)]) / (float)((double)in_ECX[2] + __uint_to_double_fixup[-(in_ECX[2] >> 0x1f)]); } else { local_8c._alpha = (float)&DAT_bf800000; } local_8c._unk = 0; local_8c._red = 0.0; local_8c._green = 0.0; local_8c._blue = 0.0; if (in_ECX[4] != 5) { if ((((g_game->_stage < 1) || (6 < g_game->_stage)) || ((g_game->_gameStateFlags & 0x1000000000000) == 0)) || (iVar1 == 2)) goto LAB_009300d4; } local_8c._blue = 1.0; local_8c._green = 1.0; local_8c._red = 1.0; LAB_009300d4: g_graphicsManager_blendMode[1] = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; render_quad_set_uniform_color(local_78,0.0,0.0,g_screenWidth,g_screenHeight,&local_8c); if ((*in_ECX == 2) || (*in_ECX == 3)) { render_color_shader_pass(local_78); } return; } //@@ 00930160 StageTransition::get_fade_progress /* DB: ECX=Game+0x1ba78 (StageTransition): returns t/duration (+4/+8) in state 2, 1 - that in state 3, else -1.0; Game::Render */ void StageTransition::get_fade_progress(void) { int iVar1; int *in_ECX; iVar1 = *in_ECX; if ((iVar1 != 3) && (iVar1 != 2)) { return; } if (iVar1 == 3) { return; } return; } //@@ 009301d0 FUN_009301d0 uint FUN_009301d0(void) { uint in_EAX; int iVar1; int *in_ECX; if (in_ECX[4] != 5) { iVar1 = g_game->_stage; if (((iVar1 < 1) || (6 < iVar1)) || (in_EAX = *(uint *)((int)&g_game->_gameStateFlags + 4) & 0x10000, iVar1 = 0, in_EAX == 0)) { LAB_0093020c: return CONCAT31((int3)((uint)iVar1 >> 8),1); } if (*in_ECX == 2) { in_EAX = _get_index_plus_one_if_kind_4_5(); iVar1 = 0; if (in_EAX == 1) goto LAB_0093020c; } } return in_EAX & 0xffffff00; } //@@ 00930220 TemporaryEffects::AddEffect /* DB: merges/pushes 16-byte {ItemConfig*,count,cooldown} entry, ORs item cache flags (+0x54), AddCostume on owning player prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall TemporaryEffects::AddEffect(TemporaryEffects *this,void *Effect,byte addcostume,int count) { void **ppvVar1; int *piVar2; void *pvVar3; int iVar4; int iVar5; int iVar6; int *piVar7; if ((this->_disabled == 0) && (count != 0)) { piVar2 = (this->_effects)._end; piVar7 = (this->_effects)._begin; if (piVar7 != piVar2) { do { if (*piVar7 == *(int *)Effect) { if (piVar7 != piVar2) { piVar7[1] = piVar7[1] + count; piVar7[2] = piVar7[2] + *(int *)((int)Effect + 8); this->_cacheFlags = this->_cacheFlags | *(uint *)(*(int *)Effect + 0x54); this->_shouldEvaluateCache = 1; return; } break; } piVar7 = piVar7 + 4; } while (piVar7 != piVar2); } if (piVar2 == (this->_effects)._capacity) { std::vector::_Emplace_reallocate(piVar2,Effect); } else { iVar4 = *(int *)((int)Effect + 4); iVar5 = *(int *)((int)Effect + 8); iVar6 = *(int *)((int)Effect + 0xc); *piVar2 = *(int *)Effect; piVar2[1] = iVar4; piVar2[2] = iVar5; piVar2[3] = iVar6; ppvVar1 = &(this->_effects)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 0x10); } pvVar3 = (this->_effects)._begin; *(int *)((((int)(this->_effects)._end - (int)pvVar3 & 0xfffffff0U) - 0xc) + (int)pvVar3) = count ; if ((this->_player != (Entity_Player *)0x0) && (addcostume != 0)) { Entity_Player::AddCostume(this->_player,*(ItemConfig_Item **)Effect,0); } this->_cacheFlags = this->_cacheFlags | *(uint *)(*(int *)Effect + 0x54); this->_shouldEvaluateCache = 1; } return; } //@@ 009302e0 TemporaryEffects::AddCollectibleEffect /* ZHL [lua] Lua binding TemporaryEffects:AddCollectibleEffect prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall TemporaryEffects::AddCollectibleEffect(TemporaryEffects *this,int coltype,byte addcostume,int count) { ItemConfig_Item *local_18; undefined4 local_14; int local_10; undefined4 local_c; local_18 = ItemConfig::GetCollectible(&g_manager->_itemConfig,coltype); if (local_18 != (ItemConfig_Item *)0x0) { local_10 = local_18->maxCooldown; local_14 = 0; local_c = 0; AddEffect(this,&local_18,addcostume,count); } return; } //@@ 00930330 TemporaryEffects::AddTrinketEffect /* ZHL [lua] Lua binding TemporaryEffects:AddTrinketEffect prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall TemporaryEffects::AddTrinketEffect(TemporaryEffects *this,int trinkettype,byte addcostume,int count) { void *pvVar1; int local_18 [3]; undefined4 local_c; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(trinkettype & 0x7fffU) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) && (local_18[0] = *(int *)((int)pvVar1 + (trinkettype & 0x7fffU) * 4), local_18[0] != 0)) { local_18[2] = *(undefined4 *)(local_18[0] + 0x78); local_18[1] = 0; local_c = 0; AddEffect(this,local_18,addcostume,count); } return; } //@@ 00930390 TemporaryEffects::AddNullEffect /* ZHL [lua] Lua binding TemporaryEffects:AddNullEffect prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall TemporaryEffects::AddNullEffect(TemporaryEffects *this,int nulleffectid,byte addcostume,int count) { void *pvVar1; int local_18 [3]; undefined4 local_c; if (((-1 < nulleffectid) && (pvVar1 = (g_manager->_itemConfig)._nullItems._begin, nulleffectid < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 >> 2)) && (local_18[0] = *(int *)((int)pvVar1 + nulleffectid * 4), local_18[0] != 0)) { local_18[2] = *(undefined4 *)(local_18[0] + 0x78); local_18[1] = 0; local_c = 0; AddEffect(this,local_18,addcostume,count); } return; } //@@ 009303f0 TemporaryEffects::RemoveEffect /* DB: finds effect by ItemConfig, decrements count, TriggerEffectRemoved; called from ClearTemporaryEffects prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall TemporaryEffects::RemoveEffect(TemporaryEffects *this,void *effect,int count) { void **ppvVar1; int *piVar2; uint uVar3; ItemConfig_Item *item; int *_Dst; uint count_00; if (this->_disabled == 0) { piVar2 = (this->_effects)._end; _Dst = (this->_effects)._begin; if (_Dst != piVar2) { while (*_Dst != *(int *)effect) { _Dst = _Dst + 4; if (_Dst == piVar2) { return; } } if (_Dst != piVar2) { uVar3 = _Dst[1]; item = (ItemConfig_Item *)*_Dst; count_00 = uVar3; if ((uint)count < uVar3) { count_00 = count; } _Dst[1] = uVar3 - count_00; if ((int)(uVar3 - count_00) < 1) { memmove(_Dst,_Dst + 4,(int)(this->_effects)._end - (int)(_Dst + 4)); ppvVar1 = &(this->_effects)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -0x10); } if (this->_player == (Entity_Player *)0x0) { Room::TriggerEffectRemoved(g_game->_room,item,0); } else { Entity_Player::trigger_collectible_effect_removed(this->_player,item,count_00); } this->_cacheFlags = this->_cacheFlags | *(uint *)(*(int *)effect + 0x54); this->_shouldEvaluateCache = 1; } } } return; } //@@ 009304a0 TemporaryEffects::RemoveCollectibleEffect /* ZHL [exact] __thiscall void TemporaryEffects::RemoveCollectibleEffect(int coltype, int count); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall TemporaryEffects::RemoveCollectibleEffect(TemporaryEffects *this,int coltype,int count) { ItemConfig_Item *local_14; undefined4 local_10; int local_c; undefined4 local_8; local_14 = ItemConfig::GetCollectible(&g_manager->_itemConfig,coltype); if (local_14 != (ItemConfig_Item *)0x0) { local_c = local_14->maxCooldown; local_10 = 0; local_8 = 0; RemoveEffect(this,&local_14,count); } return; } //@@ 009304f0 TemporaryEffects::RemoveTrinketEffect /* ZHL [exact] __thiscall void TemporaryEffects::RemoveTrinketEffect(int trinkettype, int count); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall TemporaryEffects::RemoveTrinketEffect(TemporaryEffects *this,int trinkettype,int count) { void *pvVar1; int local_14 [3]; undefined4 local_8; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if (((int)(trinkettype & 0x7fffU) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) && (local_14[0] = *(int *)((int)pvVar1 + (trinkettype & 0x7fffU) * 4), local_14[0] != 0)) { local_14[2] = *(undefined4 *)(local_14[0] + 0x78); local_14[1] = 0; local_8 = 0; RemoveEffect(this,local_14,count); } return; } //@@ 00930550 TemporaryEffects::RemoveNullEffect /* ZHL [exact] __thiscall void TemporaryEffects::RemoveNullEffect(int nulleffectid, int count); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall TemporaryEffects::RemoveNullEffect(TemporaryEffects *this,int nulleffectid,int count) { void *pvVar1; int local_18 [3]; undefined4 local_c; if (((-1 < nulleffectid) && (pvVar1 = (g_manager->_itemConfig)._nullItems._begin, nulleffectid < (int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 >> 2)) && (local_18[0] = *(int *)((int)pvVar1 + nulleffectid * 4), local_18[0] != 0)) { local_18[2] = *(undefined4 *)(local_18[0] + 0x78); local_18[1] = 0; local_c = 0; RemoveEffect(this,local_18,count); } return; } //@@ 009305c0 TemporaryEffects::has_item_effect /* DB: walks the 0x10-stride entries for an ItemConfig_Item*, checks _disabled at +0x11 prototype: db/protos.zhl, confirmed by RET 4 */ byte TemporaryEffects::has_item_effect(TemporaryEffects *effects,ItemConfig_Item *item) { int *piVar1; if (effects->_disabled == 0) { for (piVar1 = (effects->_effects)._begin; piVar1 != (effects->_effects)._end; piVar1 = piVar1 + 4) { if ((ItemConfig_Item *)*piVar1 == item) { return 1; } } } return 0; } //@@ 009305f0 TemporaryEffects::HasCollectibleEffect /* ZHL [exact] __thiscall bool TemporaryEffects::HasCollectibleEffect(int coltype); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall TemporaryEffects::HasCollectibleEffect(TemporaryEffects *this,int coltype) { int iVar1; int *piVar2; if (this->_disabled == 0) { for (piVar2 = (this->_effects)._begin; piVar2 != (this->_effects)._end; piVar2 = piVar2 + 4) { iVar1 = *(int *)*piVar2; if ((((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) && (((int *)*piVar2)[1] == coltype)) { return 1; } } } return 0; } //@@ 00930640 TemporaryEffects::HasTrinketEffect /* ZHL [exact] __thiscall bool TemporaryEffects::HasTrinketEffect(int trinkettype); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall TemporaryEffects::HasTrinketEffect(TemporaryEffects *this,int trinkettype) { int *piVar1; if (this->_disabled == 0) { for (piVar1 = (this->_effects)._begin; piVar1 != (this->_effects)._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 2) && (((int *)*piVar1)[1] == trinkettype)) { return 1; } } } return 0; } //@@ 00930680 TemporaryEffects::HasNullEffect /* ZHL [exact] __thiscall bool TemporaryEffects::HasNullEffect(int nulleffectid); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall TemporaryEffects::HasNullEffect(TemporaryEffects *this,int nulleffectid) { int *piVar1; if (this->_disabled == 0) { for (piVar1 = (this->_effects)._begin; piVar1 != (this->_effects)._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 0) && (((int *)*piVar1)[1] == nulleffectid)) { return 1; } } } return 0; } //@@ 009306c0 TemporaryEffects::ClearEffects /* ZHL [lua] Lua binding TemporaryEffects:ClearEffects prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall TemporaryEffects::ClearEffects(TemporaryEffects *this,byte isClearPersistent) { void **ppvVar1; ItemConfig_Item *item; bool bVar2; void *pvVar3; uint uVar4; int iVar5; int local_18; uint local_14; void *local_10; if (this->_disabled == 0) { pvVar3 = (this->_effects)._end; do { local_10 = (this->_effects)._begin; bVar2 = false; uVar4 = (int)pvVar3 - (int)local_10 >> 4; local_14 = uVar4 - 1; if (uVar4 <= local_14) { return; } local_18 = local_14 * 0x10; do { item = *(ItemConfig_Item **)(local_18 + (int)local_10); if ((isClearPersistent != 0) || (item->persistentEffect == 0)) { iVar5 = item->type; if ((((iVar5 == 1) || ((iVar5 == 3 || (iVar5 == 4)))) && (item->id == 0x75)) && (pvVar3 = this->_player, *(char *)((int)pvVar3 + 0x20a9) == '\0')) { iVar5 = 0; if (0 < *(int *)((int)pvVar3 + 0x1340)) { iVar5 = *(int *)((int)pvVar3 + 0x1344); } if (*(int *)((int)pvVar3 + 0x1d88) + *(int *)((int)pvVar3 + 0x134c) + iVar5 <= (int)((*(int *)((int)pvVar3 + 0x13c0) == 5) + 1)) goto LAB_009307de; } this->_cacheFlags = this->_cacheFlags | item->cacheFlags; iVar5 = ((undefined4 *)(local_18 + (int)local_10))[1]; pvVar3 = (void *)((int)local_10 + local_18 + 0x10); memmove((void *)((int)local_10 + local_18),pvVar3,(int)(this->_effects)._end - (int)pvVar3 ); ppvVar1 = &(this->_effects)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -0x10); if (this->_player == (Entity_Player *)0x0) { Room::TriggerEffectRemoved(g_game->_room,item,0); } else { Entity_Player::trigger_collectible_effect_removed(this->_player,item,iVar5); } this->_shouldEvaluateCache = 1; bVar2 = true; } LAB_009307de: pvVar3 = (this->_effects)._end; local_18 = local_18 + -0x10; local_10 = (this->_effects)._begin; local_14 = local_14 - 1; } while (local_14 < (uint)((int)pvVar3 - (int)local_10 >> 4)); } while (bVar2); } return; } //@@ 00930820 TemporaryEffects::Update /* DB: thiscall TemporaryEffects (vector of 0x10-byte effects at +4): unless disabled (+0x11) clears cache flags, decrements each cooldown (+8) and on 0 removes the effect, ORs its item cache flags (+0x54), calls Room::TriggerEffectRemoved or Entity_Player::trigger_collectible_effect_removed (owner +0x14); between AddEffect/ClearEffects and GetCollectibleEffect; Entity_Player::Update, Room::Update */ void __thiscall TemporaryEffects::Update(TemporaryEffects *this) { void **ppvVar1; Manager *pMVar2; uint uVar3; int iVar4; int *piVar5; void *_Dst; void *pvVar6; int iVar7; ItemConfig_Item *local_14; uint local_10; TemporaryEffects *local_c; if (this->_disabled == 0) { this->_cacheFlags = 0; pvVar6 = (this->_effects)._begin; uVar3 = (int)(this->_effects)._end - (int)pvVar6 >> 4; local_10 = uVar3 - 1; if (local_10 < uVar3) { iVar7 = local_10 * 0x10; local_c = this; do { iVar4 = *(int *)(iVar7 + 8 + (int)pvVar6); if ((0 < iVar4) && (iVar4 = iVar4 + -1, *(int *)(iVar7 + 8 + (int)pvVar6) = iVar4, pMVar2 = g_manager, iVar4 == 0)) { piVar5 = *(int **)(iVar7 + (int)pvVar6); if (piVar5 != (int *)0x0) { iVar4 = *piVar5; if (((iVar4 == 1) || (iVar4 == 3)) || (iVar4 == 4)) { if ((piVar5[1] == 0x3a) && (*(int *)(iVar7 + 0xc + (int)pvVar6) == 0)) { local_14 = (ItemConfig_Item *)0x403; seed_fart_sound_override((int *)&local_14); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_14,1.0,2,0,1.0,0.0); piVar5 = *(int **)(iVar7 + (int)pvVar6); this = local_c; } } else { } } this->_cacheFlags = this->_cacheFlags | piVar5[0x15]; local_14 = *(ItemConfig_Item **)(iVar7 + (int)pvVar6); _Dst = (void *)((int)(this->_effects)._begin + iVar7); iVar4 = *(int *)(iVar7 + 4 + (int)pvVar6); pvVar6 = (void *)((int)_Dst + 0x10); memmove(_Dst,pvVar6,(int)(this->_effects)._end - (int)pvVar6); ppvVar1 = &(this->_effects)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -0x10); if (this->_player == (Entity_Player *)0x0) { Room::TriggerEffectRemoved(g_game->_room,local_14,0); } else { Entity_Player::trigger_collectible_effect_removed(this->_player,local_14,iVar4); } this->_shouldEvaluateCache = 1; } local_10 = local_10 - 1; pvVar6 = (this->_effects)._begin; iVar7 = iVar7 + -0x10; } while (local_10 < (uint)((int)(this->_effects)._end - (int)pvVar6 >> 4)); } } return; } //@@ 00930980 TemporaryEffects::GetCollectibleEffect /* ZHL [exact] __thiscall TemporaryEffect* TemporaryEffects::GetCollectibleEffect(int coltype); prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall TemporaryEffects::GetCollectibleEffect(TemporaryEffects *this,int coltype) { int iVar1; int *piVar2; if (this->_disabled == 0) { for (piVar2 = (this->_effects)._begin; piVar2 != (this->_effects)._end; piVar2 = piVar2 + 4) { iVar1 = *(int *)*piVar2; if ((((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) && (((int *)*piVar2)[1] == coltype)) { return piVar2; } } } return (void *)0x0; } //@@ 009309c0 TemporaryEffects::GetTrinketEffect /* ZHL [exact] __thiscall TemporaryEffect* TemporaryEffects::GetTrinketEffect(int trinkettype); prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall TemporaryEffects::GetTrinketEffect(TemporaryEffects *this,int trinkettype) { int *piVar1; if (this->_disabled == 0) { for (piVar1 = (this->_effects)._begin; piVar1 != (this->_effects)._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 2) && (((int *)*piVar1)[1] == trinkettype)) { return piVar1; } } } return (void *)0x0; } //@@ 00930a00 FUN_00930a00 int * FUN_00930a00(int param_1) { int *piVar1; int in_ECX; if (*(char *)(in_ECX + 0x11) == '\0') { for (piVar1 = *(int **)(in_ECX + 4); piVar1 != *(int **)(in_ECX + 8); piVar1 = piVar1 + 4) { if (*piVar1 == param_1) { return piVar1; } } } return (int *)0x0; } //@@ 00930a30 TemporaryEffects::GetNullEffect /* ZHL [lua] Lua binding TemporaryEffects:GetNullEffect prototype: REPENTOGON, confirmed by RET 4 */ void * __thiscall TemporaryEffects::GetNullEffect(TemporaryEffects *this,int nulleffectid) { int *piVar1; if (this->_disabled == 0) { for (piVar1 = (this->_effects)._begin; piVar1 != (this->_effects)._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 0) && (((int *)*piVar1)[1] == nulleffectid)) { return piVar1; } } } return (void *)0x0; } //@@ 00930a70 TemporaryEffects::GetCollectibleEffectNum /* ZHL [exact] __thiscall int TemporaryEffects::GetCollectibleEffectNum(int coltype); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall TemporaryEffects::GetCollectibleEffectNum(TemporaryEffects *this,int coltype) { void *pvVar1; if (this->_disabled == 0) { pvVar1 = GetCollectibleEffect(this,coltype); if (pvVar1 != (void *)0x0) { return *(int *)((int)pvVar1 + 4); } } return 0; } //@@ 00930aa0 TemporaryEffects::GetTrinketEffectNum /* ZHL [exact] __thiscall int TemporaryEffects::GetTrinketEffectNum(int trinkettype); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall TemporaryEffects::GetTrinketEffectNum(TemporaryEffects *this,int trinkettype) { int *piVar1; if (this->_disabled == 0) { for (piVar1 = (this->_effects)._begin; piVar1 != (this->_effects)._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 2) && (((int *)*piVar1)[1] == trinkettype)) { return piVar1[1]; } } } return 0; } //@@ 00930ae0 TemporaryEffects::GetNullEffectNum /* ZHL [exact] __thiscall int TemporaryEffects::GetNullEffectNum(int nulleffectid); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall TemporaryEffects::GetNullEffectNum(TemporaryEffects *this,int nulleffectid) { int *piVar1; if (this->_disabled == 0) { for (piVar1 = (this->_effects)._begin; piVar1 != (this->_effects)._end; piVar1 = piVar1 + 4) { if ((*(int *)*piVar1 == 0) && (((int *)*piVar1)[1] == nulleffectid)) { return piVar1[1]; } } } return 0; } //@@ 00930b20 FUN_00930b20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00930b20(void) { char cVar1; code *pcVar2; void *pvVar3; int iVar4; HMODULE hModule; FARPROC pFVar5; DWORD DVar6; DWORD DVar7; HANDLE hObject; HANDLE pvVar8; undefined4 uVar9; int in_ECX; DWORD *pDVar10; char *pcVar11; int iVar12; char *pcVar13; undefined1 auStack_3b4 [4]; int local_3b0; DWORD DStack_3ac; int iStack_3a8; undefined4 uStack_3a4; undefined1 auStack_3a0 [92]; char acStack_344 [12]; _SYSTEMTIME _Stack_338; char acStack_328 [233]; char acStack_23f [267]; char acStack_134 [296]; uint local_c; local_c = __security_cookie ^ (uint)auStack_3b4; local_3b0 = in_ECX; if (g_luaEngine != (void *)0x0) { KAGE_LogMessage(1,(byte *)"Lua stack trace:\n"); pvVar3 = g_luaEngine; iVar12 = 0; do { iVar4 = lua_getstack(*(undefined4 *)((int)pvVar3 + 0x18),iVar12,auStack_3a0); if (iVar4 == 0) break; iVar4 = lua_getinfo(*(undefined4 *)((int)pvVar3 + 0x18),&UNK_00b75288,auStack_3a0); if (iVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"Failed to generate Lua stack trace: lua_getinfo returned 0\n") ; } KAGE_LogMessage(1,(byte *)"%s(%d): %s\n"); iVar12 = iVar12 + 1; } while (iVar12 < 10); } KAGE_LogMessage(1,(byte *)"Caught exception, writing minidump...\n"); hModule = LoadLibraryA("dbghelp"); if (hModule == (HMODULE)0x0) { KAGE_LogMessage(0x10,(byte *) "Failed to create Minidump: LoadLibrary(\'dbghelp\') returned NULL\n"); } pFVar5 = GetProcAddress(hModule,"MiniDumpWriteDump"); if (pFVar5 == (FARPROC)0x0) { KAGE_LogMessage(0x10,(byte *)"Failed to create Minidump: GetProcAddress returned NULL\n"); } GetLocalTime(&_Stack_338); DVar6 = GetCurrentThreadId(); DVar7 = GetCurrentProcessId(); FUN_00652a30(acStack_328,0x104, "%scrash_dumps/isaacv1.9.7.17.J460-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", g_userDataDir,_Stack_338.wYear,_Stack_338.wMonth,_Stack_338.wDay,_Stack_338.wHour, _Stack_338.wMinute,_Stack_338.wSecond,DVar7,DVar6); pcVar11 = acStack_328; pcVar13 = pcVar11; do { if (acStack_328[0] == '\0') { *pcVar13 = '\0'; hObject = CreateFileA(acStack_328,0x40000000,1,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0); DStack_3ac = GetCurrentThreadId(); iStack_3a8 = local_3b0; uStack_3a4 = 0; DVar6 = GetCurrentProcessId(); pvVar8 = GetCurrentProcess(); pDVar10 = &DStack_3ac; if (local_3b0 == 0) { pDVar10 = (DWORD *)0x0; } (*pFVar5)(pvVar8,DVar6,hObject,1,pDVar10,0,0); CloseHandle(hObject); if ((g_logFile != (void *)0x0) && (iVar12 = (**(code **)(*(int *)g_logFile + 0x38))(), iVar12 != 0)) { memset(acStack_134,0,0x104); memset(acStack_23f + 3,0,0x104); if (g_logFile == (void *)0x0) { pcVar11 = (char *)0x0; } else { pcVar11 = (char *)(**(code **)(*(int *)g_logFile + 0x38))(); } strcpy_s(acStack_134,0x104,pcVar11); strcpy_s(acStack_23f + 3,0x104,acStack_344); pcVar11 = acStack_23f + 3; do { cVar1 = *pcVar11; pcVar11 = pcVar11 + 1; } while (cVar1 != '\0'); if ((char *)0x103 < pcVar11 + (-4 - (int)(acStack_23f + 4))) { FUN_00aef86f(); pcVar2 = (code *)swi(3); uVar9 = (*pcVar2)(); return uVar9; } acStack_328[(int)(pcVar11 + (-4 - (int)(acStack_23f + 4)) + 0xec)] = '\0'; strcat_s(acStack_23f + 3,0x104,".txt"); if ((g_logFile != (void *)0x0) && ((**(code **)(*(int *)g_logFile + 0x20))(), g_logFile != (void *)0x0)) { (*(code *)**(undefined4 **)g_logFile)(1); g_logFile = (void *)0x0; } _DAT_00c79bdc = 0; FUN_00a25130(acStack_134,acStack_23f + 3); } ShellExecuteA((HWND)0x0,"open","crash_uploader.exe",acStack_344,(LPCSTR)0x0,0); return 0; } if (acStack_328[0] == ':') { if ((int)pcVar11 - (int)acStack_328 == 1) { LAB_00930ce5: *pcVar13 = acStack_328[0]; pcVar13 = pcVar13 + 1; } } else if ((((acStack_328[0] != '*') && (acStack_328[0] != '?')) && (acStack_328[0] != '%')) && (((acStack_328[0] != '\'' && (acStack_328[0] != '\"')) && (acStack_328[0] != '`')))) goto LAB_00930ce5; acStack_328[0] = pcVar11[1]; pcVar11 = pcVar11 + 1; } while( true ); } //@@ 00930ec0 FUN_00930ec0 void FUN_00930ec0(void) { KAGE_LogMessage(1,&DAT_00b6ec00); return; } //@@ 00930ee0 FUN_00930ee0 void FUN_00930ee0(char param_1) { void *pvVar1; int iVar2; code *pcVar3; Game *pGVar4; Entity_Player *pEVar5; uint uVar6; int *piVar7; int iVar8; uint uVar9; uint uVar10; uint *puVar11; if (((param_1 == '\0') && (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) && (pEVar5 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b1,(RNG **)&g_game->_playerManager,1), pEVar5 != (Entity_Player *)0x0)) { uVar9 = 0; pvVar1 = g_game->_room; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { pGVar4 = g_game; iVar2 = *(int *)(*(int *)((int)pvVar1 + 0x125c) + uVar9 * 4); if ((*(int *)(iVar2 + 0x28) == 5) && (*(int *)(iVar2 + 0x2c) == 100)) { piVar7 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar7 = (pGVar4->_playerManager)._playerList._begin; } iVar2 = *piVar7; iVar8 = *(int *)(iVar2 + 0x1774); if ((int)(iVar8 - *(int *)(iVar2 + 6000) & 0xfffffff0U) < 0x2b11) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); iVar8 = *(int *)(iVar2 + 0x1774); } uVar6 = (iVar8 - *(int *)(iVar2 + 6000) >> 4) - 1; uVar10 = 0x2b1; if (uVar6 < 0x2b1) { uVar10 = uVar6; } puVar11 = (uint *)(uVar10 * 0x10 + *(int *)(iVar2 + 6000)); uVar6 = *puVar11; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = *puVar11; if (uVar6 == 0) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } } uVar6 = uVar6 >> ((byte)puVar11[1] & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)puVar11[2] & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)puVar11[3] & 0x1f) ^ uVar6; *puVar11 = uVar6; uVar6 = uVar6 % 0xd; if (uVar6 != 0) { do { Entity_Pickup::update_cycle_collectible (*(Entity_Pickup **)(*(int *)((int)pvVar1 + 0x125c) + uVar9 * 4),1); uVar6 = uVar6 - 1; } while (0 < (int)uVar6); } } uVar9 = uVar9 + 1; } while (uVar9 < *(uint *)((int)pvVar1 + 0x1264)); } } return; } //@@ 00931050 IsaacMain /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] cleanup int IsaacMain(int argc, char** argv); */ undefined4 IsaacMain(int param_1,int param_2) { void *pvVar1; char cVar2; byte *argCursor; uint uVar3; undefined4 uVar4; uint uVar5; uint uVar6; char *optionCursor; undefined4 extraout_ECX; undefined4 extraout_ECX_00; Manager *this; DWORD dwMilliseconds; int iVar7; bool bVar8; double frameTime; double dVar9; uint uStack_560; double lastFrameTime; uint slowFrameCount; byte logPath [1024]; byte versionText [256]; uint local_20; undefined1 *local_1c; void *local_14; code *pcStack_10; uint local_c; undefined4 local_8; byte argChar; pcStack_10 = __except_handler4; local_14 = ExceptionList; local_c = __security_cookie ^ 0xbcc178; uStack_560 = __security_cookie ^ (uint)(versionText + 0x11c); local_1c = (undefined1 *)&uStack_560; ExceptionList = &local_14; local_8 = 0; local_20 = uStack_560; FontKerningPair::SetupSaveDirectories(); iVar7 = 0; do { if (param_1 <= iVar7) { sprintf_s(logPath,0x400,&DAT_00b60c28); uVar4 = extraout_ECX_00; LAB_0093112d: log_file_open(logPath,uVar4); PTR_FUN_00c5aa7c = FUN_00930ec0; CoInitialize((LPVOID)0x0); init_engine_parameters(); kage_system_init(); std::list>::push_back(FUN_00930ee0,0); KAGE_LogMessage(1,(byte *)"Command Line: \n"); for (iVar7 = 0; iVar7 < param_1; iVar7 = iVar7 + 1) { KAGE_LogMessage(1,&UNK_00b7b3f4); KAGE_LogMessage(1,*(byte **)(param_2 + iVar7 * 4)); KAGE_LogMessage(1,&DAT_00b66310); } sprintf_s(versionText,0x100,(byte *)"Game Version: %s \n"); KAGE_LogMessage(1,versionText); cVar2 = epoxy_internal_has_gl_extension(); if ((cVar2 != '\0') || (iVar7 = epoxy_internal_gl_version(), 0x1d < iVar7)) { (*(code *)epoxy_glClampColorARB)(0x891a,0); } FontKerningPair::IsaacStartup(param_2); lastFrameTime = 0.0; slowFrameCount = 0; uVar3 = 0; bVar8 = false; dVar9 = 0.0; do { do { frameTime = dVar9; FUN_00a266a0(); floor(1.0 / (frameTime - lastFrameTime) + 0.5); uVar4 = thunk_FUN_00af0780(); *(undefined4 *)&g_manager->field_0x4b12c = uVar4; dVar9 = 0.016666666666666666 / (frameTime - lastFrameTime); if (dVar9 <= 1.1) { slowFrameCount = 0; } else { slowFrameCount = slowFrameCount + 1; if (0x1e < slowFrameCount) { bVar8 = true; uVar3 = 0; } } lastFrameTime = frameTime; } while ((DAT_00c35e68 & 1) != 0); func_0x009ab6d0(); Manager::Render(this); if (g_game != (Game *)0x0) { FUN_008657c0(); } pvVar1 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x1f9); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else if (*(int *)((int)pvVar1 + 0x1c) == 1) { Isaac::Shutdown(); SteamAPI_Shutdown(); _DAT_00c5af9c = _DAT_00c5af9c & 0xfffffffe; DAT_00c5ab14 = DAT_00c5ab14 & 0xfffffffe; SetThreadExecutionState(0x80000000); timeEndPeriod(DAT_00c7de70); kage_shutdown(); CoUninitialize(); ExceptionList = local_14; return 0; } if ((bVar8) || ((g_graphicsManager_flags & 0x200) == 0)) { FUN_00a266a0(); dVar9 = dVar9 - frameTime; uVar5 = (uint)((0.016666666666666666 - dVar9) * -1000.0); uVar6 = ~uVar5; dwMilliseconds = 0; if (uVar6 != 0 && (int)uVar5 < 0) { dwMilliseconds = uVar6; } if (dwMilliseconds == 0) { uVar3 = uVar3 + 1; if (0x1e < uVar3) { bVar8 = false; slowFrameCount = 0; } } else { uVar3 = 0; cVar2 = func_0x0095dee0(); if (cVar2 == '\0') { Sleep(dwMilliseconds); } } do { FUN_00a266a0(); dVar9 = dVar9 - frameTime; } while (dVar9 < 0.016666666666666666); } } while( true ); } optionCursor = "--localhost_match"; argCursor = *(byte **)(param_2 + iVar7 * 4); do { argChar = *argCursor; bVar8 = argChar < (byte)*optionCursor; if (argChar != *optionCursor) { LAB_009310d0: uVar3 = -(uint)bVar8 | 1; goto LAB_009310d5; } if (argChar == 0) break; argChar = argCursor[1]; bVar8 = argChar < (byte)optionCursor[1]; if (argChar != optionCursor[1]) goto LAB_009310d0; argCursor = argCursor + 2; optionCursor = optionCursor + 2; } while (argChar != 0); uVar3 = 0; LAB_009310d5: if (uVar3 == 0) { _time64((__time64_t *)0x0); sprintf_s(logPath,0x400,(byte *)"%s%s%llu.txt"); uVar4 = extraout_ECX; goto LAB_0093112d; } iVar7 = iVar7 + 1; } while( true ); } //@@ 009314c0 AchievementOverlay::~AchievementOverlay /* DB: destroys the 0x282 x 0x34-byte entry array at +0x134 and the ANM2 at +0x20, then the deque at +0 (00557a60); matches Manager::constructor's AchievementOverlay at Manager+0x21c1c (ANM2 +0x20, 0x34-byte entries +0x134, db/fields.tsv); called from Manager::destructor */ void __thiscall AchievementOverlay::~AchievementOverlay(AchievementOverlay *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(this->_entries,0x34,0x282,FUN_00420b00); local_8 = 0; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); std::deque<4byte>::~deque(); ExceptionList = local_10; return; } //@@ 00931550 AchievementOverlay::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=Manager+0x21c1c from Manager::load_configs and FUN_00954710: ANM2::Load "gfx/ui/achievement/Achievements.anm2" into +0x20 */ void __thiscall AchievementOverlay::load_graphics(AchievementOverlay *this) { char *ptr; uint size; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af18ad; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x24; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/achievement/Achievements.anm2",0x25); local_14 = 0; ANM2::Load(&this->_sprite,&local_3c,1); if (0xf < local_3c._capacity) { size = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } this->_state = 0; this->_frame = 0; this->_isPopupBlocked = 0; ExceptionList = local_1c; return; } //@@ 00931670 AchievementOverlay::load_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=Manager+0x21c1c from Manager::load_configs: parses achievements.xml ("achievements"/"achievement", gfx/name strings into 0x34-byte entries) */ undefined4 AchievementOverlay::load_xml(byte *param_1) { undefined4 *puVar1; qword qVar2; uint uVar3; int *piVar4; undefined4 uVar5; int iVar6; byte *text; void *pvVar7; void *pvVar8; byte *****pppppbVar9; int in_ECX; byte *pbVar10; byte *pbVar11; std_string *allocSource; uint uVar12; qword *pqVar13; bool bVar14; byte *pbVar15; byte bVar16; uint uStack_100d4; byte *****apppppbStack_100d0 [4]; uint uStack_100c0; uint uStack_100bc; byte *****pppppbStack_100b8; undefined4 uStack_100b4; undefined4 uStack_100b0; undefined4 uStack_100ac; uint uStack_100a8; uint uStack_100a4; undefined1 auStack_100a0 [48]; undefined1 auStack_10070 [65564]; byte *****local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_44; uint uStack_40; byte *****local_3c [4]; uint local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00b0ad43; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; local_24 = uVar3; piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar4 == (int *)0x0) { uVar5 = 0; } else { iVar6 = (**(code **)(*piVar4 + 4))(uVar3); text = operator_new_tracked(iVar6 + 1); (**(code **)(*piVar4 + 0x14))(text,1,iVar6); text[iVar6] = 0; (**(code **)*piVar4)(1); FUN_00413b90(); local_14 = (byte ****)0x0; pbVar15 = (byte *)0x93173f; pbVar10 = text; rapidxml::xml_document::parse(auStack_100a0,text); bVar16 = (byte)pbVar10; pvVar7 = xml_node::first_node(auStack_100a0,(byte *)"achievements",(int)pbVar15,bVar16); local_2c = 0; local_28 = 0xf; local_3c[0] = (byte *****)0x0; local_14 = (byte ****)CONCAT31(local_14._1_3_,1); pvVar8 = xml_node::first_attribute(pvVar7,&DAT_00b6987c,(uint)pbVar15,bVar16); if (pvVar8 != (void *)0x0) { pbVar15 = &g_xmlNullStr; if (*(byte **)((int)pvVar8 + 4) != (byte *)0x0) { pbVar15 = *(byte **)((int)pvVar8 + 4); } pbVar10 = pbVar15; do { bVar16 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar16 != 0); uVar3 = (int)pbVar10 - (int)(pbVar15 + 1); std::string::assign((char *)local_3c,pbVar15,uVar3); bVar16 = (byte)uVar3; } for (pvVar7 = xml_node::first_node(pvVar7,(byte *)"achievement",(int)pbVar15,bVar16); pvVar7 != (void *)0x0; pvVar7 = *(void **)((int)pvVar7 + 0x2c)) { uStack_100c0 = 0; uStack_100bc = 0xf; apppppbStack_100d0[0] = (byte *****)0x0; uStack_100a8 = 0; uStack_100a4 = 0xf; pppppbStack_100b8 = (byte *****)0x0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14 = (byte ****)CONCAT31(local_14._1_3_,2); for (puVar1 = *(undefined4 **)((int)pvVar7 + 0x20); puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)puVar1[6]) { pbVar15 = (byte *)*puVar1; pbVar11 = s_id; pbVar10 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar10 = pbVar15; } do { bVar16 = *pbVar10; bVar14 = bVar16 < *pbVar11; if (bVar16 != *pbVar11) { LAB_00931851: uVar3 = -(uint)bVar14 | 1; goto LAB_00931856; } if (bVar16 == 0) break; bVar16 = pbVar10[1]; bVar14 = bVar16 < pbVar11[1]; if (bVar16 != pbVar11[1]) goto LAB_00931851; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar16 != 0); uVar3 = 0; LAB_00931856: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar15 = (byte *)puVar1[1]; } uStack_100d4 = atoi((char *)pbVar15); } else { pbVar11 = &DAT_00b6e37c; pbVar10 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar10 = pbVar15; } do { bVar16 = *pbVar10; bVar14 = bVar16 < *pbVar11; if (bVar16 != *pbVar11) { LAB_009318b0: uVar3 = -(uint)bVar14 | 1; goto LAB_009318b5; } if (bVar16 == 0) break; bVar16 = pbVar10[1]; bVar14 = bVar16 < pbVar11[1]; if (bVar16 != pbVar11[1]) goto LAB_009318b0; pbVar11 = pbVar11 + 2; pbVar10 = pbVar10 + 2; } while (bVar16 != 0); uVar3 = 0; LAB_009318b5: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar15 = (byte *)puVar1[1]; } pbVar10 = pbVar15; do { bVar16 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar16 != 0); std::string::assign((char *)apppppbStack_100d0,pbVar15,(int)pbVar10 - (int)(pbVar15 + 1) ); } else { pbVar11 = &DAT_00b66fec; pbVar10 = &g_xmlNullStr; if (pbVar15 != (byte *)0x0) { pbVar10 = pbVar15; } do { bVar16 = *pbVar10; bVar14 = bVar16 < *pbVar11; if (bVar16 != *pbVar11) { LAB_00931920: uVar3 = -(uint)bVar14 | 1; goto LAB_00931925; } if (bVar16 == 0) break; bVar16 = pbVar10[1]; bVar14 = bVar16 < pbVar11[1]; if (bVar16 != pbVar11[1]) goto LAB_00931920; pbVar11 = pbVar11 + 2; pbVar10 = pbVar10 + 2; } while (bVar16 != 0); uVar3 = 0; LAB_00931925: if (uVar3 == 0) { pbVar15 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar15 = (byte *)puVar1[1]; } pbVar10 = pbVar15; do { bVar16 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar16 != 0); allocSource = (std_string *)(pbVar10 + -(int)(pbVar15 + 1)); if ((std_string *)(0x7fffffff - local_2c) < allocSource) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppbVar9 = (byte *****)local_3c; if (0xf < local_28) { pppppbVar9 = local_3c[0]; } std::string::concat((char *)&local_54,in_ECX,allocSource,(byte *)pppppbVar9,local_2c, pbVar15,(uint)allocSource); if (0xf < uStack_100a4) { uVar3 = uStack_100a4 + 1; pppppbVar9 = pppppbStack_100b8; if (0xfff < uVar3) { pppppbVar9 = (byte *****)pppppbStack_100b8[-1]; uVar3 = uStack_100a4 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbStack_100b8 + (-4 - (int)pppppbVar9))) goto LAB_00931b16; } operator_delete(pppppbVar9,uVar3); } pppppbStack_100b8 = local_54; uStack_100b4 = uStack_50; uStack_100b0 = uStack_4c; uStack_100ac = uStack_48; uStack_100a8 = local_44; uStack_100a4 = uStack_40; } } } if (puVar1[4] == 0) break; } if (uStack_100d4 < 0x282) { iVar6 = in_ECX + uStack_100d4 * 0x34; *(uint *)(iVar6 + 0x134) = uStack_100d4; if ((byte ******)(iVar6 + 0x138) != apppppbStack_100d0) { pppppbVar9 = (byte *****)apppppbStack_100d0; if (0xf < uStack_100bc) { pppppbVar9 = apppppbStack_100d0[0]; } std::string::assign((char *)(iVar6 + 0x138),(byte *)pppppbVar9,uStack_100c0); } if ((byte ******)(iVar6 + 0x150) != &pppppbStack_100b8) { pppppbVar9 = (byte *****)&pppppbStack_100b8; if (0xf < uStack_100a4) { pppppbVar9 = pppppbStack_100b8; } std::string::assign((char *)(iVar6 + 0x150),(byte *)pppppbVar9,uStack_100a8); } } uVar3 = uStack_100bc; local_14 = (byte ****)CONCAT31(local_14._1_3_,1); if (0xf < uStack_100a4) { uVar12 = uStack_100a4 + 1; pppppbVar9 = pppppbStack_100b8; if (0xfff < uVar12) { pppppbVar9 = (byte *****)pppppbStack_100b8[-1]; uVar12 = uStack_100a4 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbStack_100b8 + (-4 - (int)pppppbVar9))) goto LAB_00931b16; } operator_delete(pppppbVar9,uVar12); } if (0xf < uVar3) { uVar12 = uVar3 + 1; pppppbVar9 = apppppbStack_100d0[0]; if (0xfff < uVar12) { pppppbVar9 = (byte *****)apppppbStack_100d0[0][-1]; uVar12 = uVar3 + 0x24; if ((byte *)0x1f < (byte *)((int)apppppbStack_100d0[0] + (-4 - (int)pppppbVar9))) goto LAB_00931b16; } operator_delete(pppppbVar9,uVar12); } } local_14 = (byte ****)((uint)local_14 & 0xffffff00); if (0xf < local_28) { uVar3 = local_28 + 1; pppppbVar9 = local_3c[0]; if (0xfff < uVar3) { pppppbVar9 = (byte *****)local_3c[0][-1]; uVar3 = local_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c[0] + (-4 - (int)pppppbVar9))) { LAB_00931b16: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar9,uVar3); } local_14 = (byte ****)0x3; xml_memory_pool::clear(auStack_10070); if (g_mainHeap == (void *)0x0) { pqVar13 = &g_allocatedBytesNoHeap; } else { pqVar13 = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar3 = *(uint *)(text + -4); qVar2 = *pqVar13; *(uint *)pqVar13 = (uint)*pqVar13 - uVar3; *(uint *)((int)pqVar13 + 4) = *(uint *)((int)pqVar13 + 4) - (uint)((uint)qVar2 < uVar3); free(text + -4); } uVar5 = 1; } ExceptionList = local_1c; return uVar5; } //@@ 00931ba0 AchievementOverlay::Update /* DB: REPENTOGON AchievementOverlay::Update; ECX=Manager+0x21c1c, status +0x1c (1 slide in, 2 still for 0x5a frames or MENUCONFIRM, 3 "Dissapear"), plays sound 8, "No sprite for achievement %d (%s)"; Manager::Update and Manager::queue_achievement_popup prototype: REPENTOGON */ void __thiscall AchievementOverlay::Update(AchievementOverlay *this) { uint uVar1; Manager *pMVar2; byte bVar3; uint uVar4; LayerState *pLVar5; std_string *pngFilename; byte unk; int iVar6; float fVar7; AchievementOverlay *local_c [2]; iVar6 = this->_state; local_c[0] = this; if ((((iVar6 != 0) && (this->_isPopupBlocked == 0)) && ((g_manager->_framecount & 1) == 0)) && ((this->_sprite)._loaded != 0)) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); iVar6 = this->_state; } if (iVar6 == 1) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { this->_frame = 0; this->_state = 2; ANM2::Play(&this->_sprite,s_Idle,0); pMVar2 = g_manager; local_c[0] = (AchievementOverlay *)&DAT_00000008; seed_fart_sound_override((int *)local_c); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_c[0],1.0,2,0,1.0,0.0); } } else if (iVar6 == 2) { iVar6 = this->_frame; this->_frame = iVar6 + 1; if ((0x5a < iVar6) || (bVar3 = input_is_action_pressed(0xe,-1,(Entity *)0x0,iVar6), bVar3 != 0)) { ANM2::Play(&this->_sprite,(byte *)"Dissapear",0); this->_state = 3; } } else if ((iVar6 == 3) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { this->_state = 0; } fVar7 = 1.0; if ((this->_state == 0) && (uVar1 = (this->_queue)._size, uVar1 != 0)) { uVar4 = (this->_queue)._offset; this->_currentEntry = *(int *)(*(int *)((int)(this->_queue)._map + (uVar4 >> 2 & (this->_queue)._mapSize - 1) * 4 ) + (uVar4 & 3) * 4); uVar1 = uVar1 - 1; (this->_queue)._size = uVar1; uVar4 = 0; if (uVar1 != 0) { uVar4 = (this->_queue)._offset + 1; } (this->_queue)._offset = uVar4; pMVar2 = g_manager; this->_state = 1; if (((pMVar2->_optionsConfig)._popupsMode == 2) || (pMVar2->_netplayManager != *(NetplayManager *)(pMVar2 + 1))) { fVar7 = 0.3; bVar3 = 0; } else { bVar3 = 1; } (this->_sprite)._scale.x = fVar7; (this->_sprite)._scale.y = fVar7; pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar5->_visible = bVar3; pngFilename = &this->_entries[this->_currentEntry]._gfx; if (pngFilename->_size == 0) { pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x3); pLVar5->_visible = 0; KAGE_LogMessage(8,(byte *)"No sprite for achievement %d (%s)\n"); } else { Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,3,pngFilename); ANM2::LoadGraphics(&this->_sprite,unk); pLVar5 = ANM2::GetLayer(&this->_sprite,(byte *)0x3); pLVar5->_visible = 1; } ANM2::Play(&this->_sprite,(byte *)"Appear",0); } return; } //@@ 00931de0 BackdropConfig::constructor /* DB: zeroes the strings (size 0, cap 0xf) and fields of one 0x13c-byte backdrop entry; Backdrop::LoadConfig before parsing each node */ void BackdropConfig::constructor(void) { int in_ECX; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x18) = 0xf; *(undefined4 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x2c) = 0; *(undefined4 *)(in_ECX + 0x30) = 0xf; *(undefined4 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0xf; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x5c) = 0; *(undefined4 *)(in_ECX + 0x60) = 0xf; *(undefined4 *)(in_ECX + 100) = 0; *(undefined4 *)(in_ECX + 0x68) = 0; *(undefined4 *)(in_ECX + 0x6c) = 0; *(undefined4 *)(in_ECX + 0x70) = 0; *(undefined1 *)(in_ECX + 0x74) = 0; *(undefined4 *)(in_ECX + 0x78) = 0; *(undefined4 *)(in_ECX + 0x88) = 0; *(undefined4 *)(in_ECX + 0x8c) = 0xf; *(undefined4 *)(in_ECX + 0x90) = 0; *(undefined4 *)(in_ECX + 0xa0) = 0; *(undefined4 *)(in_ECX + 0xa4) = 0xf; *(undefined4 *)(in_ECX + 0xa8) = 0; *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0xf; *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xd0) = 0; *(undefined4 *)(in_ECX + 0xd4) = 0xf; *(undefined4 *)(in_ECX + 0xd8) = 0; *(undefined4 *)(in_ECX + 0xe8) = 0; *(undefined4 *)(in_ECX + 0xec) = 0xf; *(undefined4 *)(in_ECX + 0xf0) = 0; *(undefined4 *)(in_ECX + 0x100) = 0; *(undefined4 *)(in_ECX + 0x104) = 0xf; *(undefined4 *)(in_ECX + 0x108) = 0; *(undefined4 *)(in_ECX + 0x118) = 0; *(undefined4 *)(in_ECX + 0x11c) = 0xf; *(undefined4 *)(in_ECX + 0x120) = 0; *(undefined4 *)(in_ECX + 0x130) = 0; *(undefined4 *)(in_ECX + 0x134) = 0xf; *(undefined2 *)(in_ECX + 0x138) = 0; return; } //@@ 00931f50 FUN_00931f50 void FUN_00931f50(undefined4 *param_1,int param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; uVar1 = *(undefined4 *)(param_2 + 8); uVar2 = *(undefined4 *)(param_2 + 4); uVar3 = *(undefined4 *)(param_2 + 0x10); uVar4 = *(undefined4 *)(param_2 + 0x1c); param_1[3] = 0; param_1[5] = 0; param_1[7] = 0; param_1[4] = uVar1; *param_1 = uVar1; param_1[3] = uVar2; param_1[1] = uVar2; param_1[6] = uVar3; param_1[2] = uVar3; param_1[7] = uVar4; param_1[5] = uVar4; *(undefined1 *)(param_1 + 8) = 1; return; } //@@ 00931fc0 FUN_00931fc0 void FUN_00931fc0(undefined4 *param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; uVar1 = *param_2; uVar2 = param_2[5]; uVar3 = param_2[6]; uVar4 = param_2[3]; param_1[3] = 0; param_1[5] = 0; param_1[7] = 0; param_1[4] = uVar1; *param_1 = uVar1; param_1[3] = uVar2; param_1[1] = uVar2; param_1[6] = uVar3; param_1[2] = uVar3; param_1[7] = uVar4; param_1[5] = uVar4; *(undefined1 *)(param_1 + 8) = 1; return; } //@@ 00932020 FUN_00932020 void FUN_00932020(undefined4 *param_1,int param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; uVar1 = *(undefined4 *)(param_2 + 8); uVar2 = *(undefined4 *)(param_2 + 0x14); uVar3 = *(undefined4 *)(param_2 + 0x10); uVar4 = *(undefined4 *)(param_2 + 0xc); param_1[3] = 0; param_1[5] = 0; param_1[7] = 0; param_1[4] = uVar1; *param_1 = uVar1; param_1[3] = uVar2; param_1[1] = uVar2; param_1[6] = uVar3; param_1[2] = uVar3; param_1[7] = uVar4; param_1[5] = uVar4; *(undefined1 *)(param_1 + 8) = 1; return; } //@@ 00932090 grid_rect_to_quad /* DB: fills a quad (4 corners) from grid rect (x,y,w,h) * 26 and sets byte +0x20; Backdrop::render_floor_to_target */ void grid_rect_to_quad(float *param_1,int param_2,int param_3,int param_4,int param_5) { float fVar1; float fVar2; param_1[3] = 0.0; param_1[5] = 0.0; param_1[7] = 0.0; *(undefined1 *)(param_1 + 8) = 1; fVar2 = (float)(param_4 + param_2) * 26.0; fVar1 = (float)(param_5 + param_3) * 26.0; param_1[4] = (float)param_2 * 26.0; *param_1 = (float)param_2 * 26.0; param_1[3] = (float)param_3 * 26.0; param_1[1] = (float)param_3 * 26.0; param_1[6] = fVar2; param_1[2] = fVar2; param_1[7] = fVar1; param_1[5] = fVar1; return; } //@@ 00932120 Backdrop::render_grid_rect /* DB: ? renders a white uniform-color quad for grid rect (x,y,w,h)*26 offset by Backdrop+0x4f1c; Backdrop::render_floor_to_target */ void * Backdrop::render_grid_rect(void *param_1,int param_2,int param_3,int param_4,int param_5) { int in_ECX; KColor *color; KColor local_18; KColor::SetFromARGB(&local_18,0xffffffff); render_quad_set_uniform_color (param_1,(float)param_2 * 26.0 + *(float *)(in_ECX + 0x4f18), (float)param_3 * 26.0 + *(float *)(in_ECX + 0x4f1c), (float)(param_4 + param_2) * 26.0 + *(float *)(in_ECX + 0x4f18), (float)(param_5 + param_3) * 26.0 + *(float *)(in_ECX + 0x4f1c),color); return param_1; } //@@ 009321c0 Backdrop::constructor /* DB: ? once from Room::constructor on room+0x1bc8: zeroes smart pointers +0x10..+0x28, ANM2::constructor, creates "Floor Surface", "Floor Surface 2", "Wall Surface", "Temp Backdrop Surface" render buffers (REPENTOGON Backdrop fields floorBuffer/wallsBuffer/floorSurface2/tempBackdropSurface) */ void Backdrop::constructor(void) { char isLastRef; void *renderTarget; void *in_ECX; undefined4 extraout_ECX; KColor *clearColor; KColor *clearColor_00; KColor *clearColor_01; KColor *clearColor_02; KColor clearColorValue; undefined1 newTarget [4]; int *newTargetRefCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ae2f; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00708c90(in_ECX); local_8 = 0; FUN_00708c90(extraout_ECX); *(undefined4 *)((int)in_ECX + 0x10) = 0; *(undefined4 *)((int)in_ECX + 0x14) = 0; *(undefined4 *)((int)in_ECX + 0x18) = 0; *(undefined4 *)((int)in_ECX + 0x1c) = 0; *(undefined4 *)((int)in_ECX + 0x24) = 0; *(undefined4 *)((int)in_ECX + 0x28) = 0; local_8._0_1_ = 4; KAGE::SmartPointer::SmartPointer((void *)((int)in_ECX + 0x2c),(void *)0x0); *(undefined4 *)((int)in_ECX + 0x34) = 0; *(undefined4 *)((int)in_ECX + 0x38) = 0; local_8._0_1_ = 6; ANM2::constructor((ANM2 *)((int)in_ECX + 0x3c)); local_8._0_1_ = 7; _eh_vector_constructor_iterator_ ((void *)((int)in_ECX + 0x154),0x13c,0x3f,BackdropConfig::constructor, BackdropConfig::~BackdropConfig); local_8._0_1_ = 8; *(undefined4 *)((int)in_ECX + 0x4f1c) = 0; *(undefined4 *)((int)in_ECX + 0x4f18) = 0; *(undefined4 *)((int)in_ECX + 0x4f24) = 0; *(undefined4 *)((int)in_ECX + 0x4f20) = 0; *(undefined8 *)((int)in_ECX + 0x4f2c) = 0x900000005; *(undefined4 *)((int)in_ECX + 0x4f28) = 0xaa17414f; *(undefined4 *)((int)in_ECX + 0x4f34) = 7; ANM2::constructor((ANM2 *)((int)in_ECX + 0x4f3c)); local_8._0_1_ = 9; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5050)); local_8._0_1_ = 10; ANM2::constructor((ANM2 *)((int)in_ECX + 0x5164)); local_8._0_1_ = 0xb; KColor::SetFromARGB(&clearColorValue,0); renderTarget = KAGE_Graphics::create_render_target (newTarget,0x30c,0x1d4,(byte *)"Floor Surface",clearColor); local_8._0_1_ = 0xc; shared_ptr::operator_assign(in_ECX,renderTarget); local_8._0_1_ = 0xd; if (newTargetRefCount != (int *)0x0) { isLastRef = (**(code **)(*newTargetRefCount + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(newTarget); } } local_8._0_1_ = 0xb; KColor::SetFromARGB(&clearColorValue,0); renderTarget = KAGE_Graphics::create_render_target (newTarget,0x30c,0x1d4,(byte *)"Wall Surface",clearColor_00); local_8._0_1_ = 0xe; shared_ptr::operator_assign((void *)((int)in_ECX + 8),renderTarget); local_8._0_1_ = 0xf; if (newTargetRefCount != (int *)0x0) { isLastRef = (**(code **)(*newTargetRefCount + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(newTarget); } } local_8._0_1_ = 0xb; KColor::SetFromARGB(&clearColorValue,0); renderTarget = KAGE_Graphics::create_render_target (newTarget,0x30c,0x1d4,(byte *)"Floor Surface 2",clearColor_01); local_8._0_1_ = 0x10; shared_ptr::operator_assign((void *)((int)in_ECX + 0x10),renderTarget); local_8._0_1_ = 0x11; if (newTargetRefCount != (int *)0x0) { isLastRef = (**(code **)(*newTargetRefCount + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(newTarget); } } local_8._0_1_ = 0xb; *(undefined1 *)((int)in_ECX + 0x20) = 0; KColor::SetFromARGB(&clearColorValue,0); renderTarget = KAGE_Graphics::create_render_target (newTarget,0x30c,0x1d4,(byte *)"Temp Backdrop Surface",clearColor_02); local_8._0_1_ = 0x12; shared_ptr::operator_assign((void *)((int)in_ECX + 0x18),renderTarget); local_8 = CONCAT31(local_8._1_3_,0x13); if (newTargetRefCount != (int *)0x0) { isLastRef = (**(code **)(*newTargetRefCount + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(newTarget); } } *(undefined4 *)((int)in_ECX + 0x4f38) = 0x11111111; *(undefined8 *)((int)in_ECX + 0x4f2c) = 0x900000005; *(undefined4 *)((int)in_ECX + 0x4f34) = 7; *(undefined4 *)((int)in_ECX + 0x4f28) = 0x11111111; *(float *)((int)in_ECX + 0x4f18) = g_vectorZero.x; *(float *)((int)in_ECX + 0x4f1c) = g_vectorZero.y; *(float *)((int)in_ECX + 0x4f20) = g_vectorZero.x; *(float *)((int)in_ECX + 0x4f24) = g_vectorZero.y; ExceptionList = local_10; return; } //@@ 009324f0 BackdropConfig::~BackdropConfig /* DB: ? destroys 12 std::strings (one backdrops.xml entry's gfx paths); called from Backdrop::LoadConfig ("Could not find root node 'backdrops'") per parsed entry and Backdrop::pre_render_walls prototype: db/protos.zhl */ void __thiscall BackdropConfig::~BackdropConfig(BackdropConfig *this) { std::string::_Tidy_deallocate(&this->field_0x120); std::string::_Tidy_deallocate(&this->field_0x108); std::string::_Tidy_deallocate(&this->field_0xf0); std::string::_Tidy_deallocate(&this->field_0xd8); std::string::_Tidy_deallocate(&this->field_0xc0); std::string::_Tidy_deallocate(&this->field_0xa8); std::string::_Tidy_deallocate(&this->field_0x90); std::string::_Tidy_deallocate(&this->field_0x78); std::string::_Tidy_deallocate(&this->field_0x4c); std::string::_Tidy_deallocate(&this->field_0x34); std::string::_Tidy_deallocate(&this->field_0x1c); std::string::_Tidy_deallocate(&this->field_0x4); return; } //@@ 00932570 Backdrop::destructor /* DB: ECX=Room+0x1bc8 in the Room destructor 007e9ba0: resets render targets, ANM2s +0x5164/+0x5050/+0x4f3c/+0x3c, the 0x3f BackdropConfig array +0x154 (stride 0x13c) */ void Backdrop::destructor(void) { char cVar1; int in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ae50; local_10 = ExceptionList; ExceptionList = &local_10; KAGE::SmartPointer::reset(in_ECX); KAGE::SmartPointer::reset(extraout_ECX); KAGE::SmartPointer::reset(extraout_ECX_00); KAGE::SmartPointer::reset((void *)(in_ECX + 0x2c),(void *)0x0); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x5164)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x51b4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5194)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x517c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x5164)); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x5050)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x50a0)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5080)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x5068)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x5050)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x4f3c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4f8c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4f6c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x4f54)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x4f3c)); local_8 = 0xffffffff; _eh_vector_destructor_iterator_ ((void *)(in_ECX + 0x154),0x13c,0x3f,BackdropConfig::~BackdropConfig); local_8 = 3; ANM2::Reset((ANM2 *)(in_ECX + 0x3c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x8c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x6c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x54)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x3c)); local_8 = 4; if (*(int **)(in_ECX + 0x38) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x38) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x34); } } local_8 = 5; if (*(int **)(in_ECX + 0x30) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x30) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((void *)(in_ECX + 0x2c)); } } local_8 = 6; if (*(int **)(in_ECX + 0x28) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x28) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x24); } } local_8 = 7; if (*(int **)(in_ECX + 0x1c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x1c) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 0x18); } } local_8 = 8; if (*(int **)(in_ECX + 0x14) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x14) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 0x10); } } local_8 = 9; if (*(int **)(in_ECX + 0xc) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0xc) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 8); } } local_8 = 10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00932810 Backdrop::LoadConfig /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x00933911) */ /* WARNING: Removing unreachable block (ram,0x0093392a) */ /* WARNING: Removing unreachable block (ram,0x00933938) */ /* WARNING: Removing unreachable block (ram,0x0093394c) */ /* DB: parses backdrops.xml ("Could not find root node 'backdrops'", walls/floors/watergfx/props attrs); Room::constructor calls it (REPENTOGON Backdrop::LoadConfig(char* xmlpath)) */ undefined4 Backdrop::LoadConfig(byte *param_1) { byte isJoinedPathAlive; int *file; undefined4 isLoaded; int iVar2; byte *text; void *rootAttribute; int iVar3; std_string *rootText; int in_ECX; byte *strCursor; byte *attrNameCursor; uint appendLength; std_string *psVar4; byte *valueText; void *freeBlock; uint freeSize; bool isLess; char *pcVar5; undefined4 *attribute; uint cleanupFlags; BackdropConfig config; undefined1 xmlDoc [48]; undefined1 xmlMemoryPool [65560]; BackdropConfig defaultConfig; std_string effectsGfxRoot; std_string gfxRoot; std_string gridGfxRoot; std_string joinedPath; std_string attrValue; void *local_1c; undefined1 *puStack_18; undefined4 local_14; bool isJoinedPathAlive; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b036; local_1c = ExceptionList; freeSize = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; cleanupFlags = 0; isJoinedPathAlive = false; file = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (file == (int *)0x0) { isLoaded = 0; } else { iVar2 = (**(code **)(*file + 4))(freeSize); text = operator_new_tracked(iVar2 + 1); (**(code **)(*file + 0x14))(text,1,iVar2); text[iVar2] = 0; (**(code **)*file)(1); FUN_00413b90(); local_14 = 0; pcVar5 = (char *)0x9328f7; valueText = text; rapidxml::xml_document::parse(xmlDoc,text); isJoinedPathAlive = (byte)valueText; freeBlock = xml_node::first_node(xmlDoc,(byte *)"backdrops",(int)pcVar5,isJoinedPathAlive); if (freeBlock == (void *)0x0) { pcVar5 = "Could not find root node \'backdrops\' in %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'backdrops\' in %s\n"); isJoinedPathAlive = (byte)param_1; } rootAttribute = xml_node::first_attribute(freeBlock,&DAT_00b6987c,(uint)pcVar5,isJoinedPathAlive); gfxRoot._size = 0; gfxRoot._capacity = 0xf; gfxRoot._buf[0] = '\0'; gfxRoot._buf[1] = '\0'; gfxRoot._buf[2] = '\0'; gfxRoot._buf[3] = '\0'; valueText = &g_xmlNullStr; if (*(byte **)((int)rootAttribute + 4) != (byte *)0x0) { valueText = *(byte **)((int)rootAttribute + 4); } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); freeSize = (int)strCursor - (int)(valueText + 1); std::string::assign(gfxRoot._buf,valueText,freeSize); local_14._0_1_ = 1; rootAttribute = xml_node::first_attribute(freeBlock,(byte *)"gridgfxroot",(uint)valueText,(byte)freeSize); gridGfxRoot._size = 0; gridGfxRoot._capacity = 0xf; gridGfxRoot._buf[0] = '\0'; gridGfxRoot._buf[1] = '\0'; gridGfxRoot._buf[2] = '\0'; gridGfxRoot._buf[3] = '\0'; valueText = &g_xmlNullStr; if (*(byte **)((int)rootAttribute + 4) != (byte *)0x0) { valueText = *(byte **)((int)rootAttribute + 4); } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); freeSize = (int)strCursor - (int)(valueText + 1); std::string::assign(gridGfxRoot._buf,valueText,freeSize); local_14._0_1_ = 2; rootAttribute = xml_node::first_attribute (freeBlock,(byte *)"effectsgfxroot",(uint)valueText,(byte)freeSize); effectsGfxRoot._size = 0; effectsGfxRoot._capacity = 0xf; effectsGfxRoot._buf[0] = '\0'; effectsGfxRoot._buf[1] = '\0'; effectsGfxRoot._buf[2] = '\0'; effectsGfxRoot._buf[3] = '\0'; valueText = &g_xmlNullStr; if (*(byte **)((int)rootAttribute + 4) != (byte *)0x0) { valueText = *(byte **)((int)rootAttribute + 4); } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); std::string::assign(effectsGfxRoot._buf,valueText,(int)strCursor - (int)(valueText + 1)); BackdropConfig::constructor(); local_14._0_1_ = 4; defaultConfig.backdropId = 0; std::string::assign(&defaultConfig.field_0x78,(byte *)"gfx/grid/props_01_basement.anm2",0x1f); std::string::assign(&defaultConfig.field_0x90,(byte *)"gfx/grid/rocks_basement.png",0x1b); std::string::assign(&defaultConfig.field_0xa8,(byte *)"gfx/grid/grid_pit.png",0x15); std::string::assign(&defaultConfig.field_0xc0,(byte *)"gfx/grid/grid_pit_water.png",0x1b); std::string::assign(&defaultConfig.field_0xd8,(byte *)"gfx/grid/grid_bridge.png",0x18); std::string::assign(&defaultConfig.field_0xf0,(byte *)"gfx/grid/door_01_normaldoor.png",0x1f); std::string::assign(&defaultConfig.field_0x108,(byte *)"gfx/grid/door_08_holeinwall.png",0x1f); std::string::assign(&defaultConfig.field_0x120,(byte *)"gfx/grid/grid_spikes.png",0x18); BackdropConfig::operator_assign(&defaultConfig); iVar3 = config.backdropId; config.backdropId = defaultConfig.backdropId; for (iVar2 = *(int *)((int)freeBlock + 0x18); defaultConfig.backdropId = config.backdropId, iVar2 != 0; iVar2 = *(int *)(iVar2 + 0x2c)) { std::string::string(&config.field_0x4,&defaultConfig.field_0x4); local_14._0_1_ = 5; std::string::string(&config.field_0x1c,&defaultConfig.field_0x1c); local_14._0_1_ = 6; std::string::string(&config.field_0x34,&defaultConfig.field_0x34); local_14._0_1_ = 7; std::string::string(&config.field_0x4c,&defaultConfig.field_0x4c); local_14._0_1_ = 8; config.walls = defaultConfig.walls; config.wallVariants = defaultConfig.wallVariants; config.floors = defaultConfig.floors; config.floorVariants = defaultConfig.floorVariants; config.unk1._0_1_ = (undefined1)defaultConfig.unk1; std::string::string(&config.field_0x78,&defaultConfig.field_0x78); local_14._0_1_ = 9; std::string::string(&config.field_0x90,&defaultConfig.field_0x90); local_14._0_1_ = 10; std::string::string(&config.field_0xa8,&defaultConfig.field_0xa8); local_14._0_1_ = 0xb; std::string::string(&config.field_0xc0,&defaultConfig.field_0xc0); local_14._0_1_ = 0xc; std::string::string(&config.field_0xd8,&defaultConfig.field_0xd8); local_14._0_1_ = 0xd; std::string::string(&config.field_0xf0,&defaultConfig.field_0xf0); local_14._0_1_ = 0xe; std::string::string(&config.field_0x108,&defaultConfig.field_0x108); local_14._0_1_ = 0xf; std::string::string(&config.field_0x120,&defaultConfig.field_0x120); config.waterPitsMode._0_1_ = (undefined1)defaultConfig.waterPitsMode; config.waterPitsMode._1_1_ = defaultConfig.waterPitsMode._1_1_; local_14._0_1_ = 0x10; attribute = *(undefined4 **)(iVar2 + 0x20); if (attribute != (undefined4 *)0x0) { do { valueText = (byte *)*attribute; attrNameCursor = s_id; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < *attrNameCursor; if (isJoinedPathAlive != *attrNameCursor) { LAB_00932cc1: freeSize = -(uint)isLess | 1; goto LAB_00932cc6; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < attrNameCursor[1]; if (isJoinedPathAlive != attrNameCursor[1]) goto LAB_00932cc1; strCursor = strCursor + 2; attrNameCursor = attrNameCursor + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00932cc6: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } config.backdropId = atoi((char *)valueText); } else { attrNameCursor = &DAT_00b66fec; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < *attrNameCursor; if (isJoinedPathAlive != *attrNameCursor) { LAB_00932d21: freeSize = -(uint)isLess | 1; goto LAB_00932d26; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < attrNameCursor[1]; if (isJoinedPathAlive != attrNameCursor[1]) goto LAB_00932d21; strCursor = strCursor + 2; attrNameCursor = attrNameCursor + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00932d26: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); appendLength = (int)strCursor - (int)(valueText + 1); if (0x7fffffff - gfxRoot._size < appendLength) { LAB_00934421: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } psVar4 = &gfxRoot; if (0xf < gfxRoot._capacity) { psVar4 = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,(std_string *)appendLength,(byte *)psVar4, gfxRoot._size,valueText,appendLength); std::string::_Tidy_deallocate(&config.field_0x4); config._4_1_ = joinedPath._buf[0]; config._5_1_ = joinedPath._buf[1]; config._6_1_ = joinedPath._buf[2]; config._7_1_ = joinedPath._buf[3]; config._8_1_ = joinedPath._buf[4]; config._9_1_ = joinedPath._buf[5]; config._10_1_ = joinedPath._buf[6]; config._11_1_ = joinedPath._buf[7]; config._12_1_ = joinedPath._buf[8]; config._13_1_ = joinedPath._buf[9]; config._14_1_ = joinedPath._buf[10]; config._15_1_ = joinedPath._buf[0xb]; config._16_1_ = joinedPath._buf[0xc]; config._17_1_ = joinedPath._buf[0xd]; config._18_1_ = joinedPath._buf[0xe]; config._19_1_ = joinedPath._buf[0xf]; config._20_4_ = joinedPath._size; config._24_4_ = joinedPath._capacity; } else { attrNameCursor = &DAT_00b7b60c; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < *attrNameCursor; if (isJoinedPathAlive != *attrNameCursor) { LAB_00932de2: freeSize = -(uint)isLess | 1; goto LAB_00932de7; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < attrNameCursor[1]; if (isJoinedPathAlive != attrNameCursor[1]) goto LAB_00932de2; strCursor = strCursor + 2; attrNameCursor = attrNameCursor + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00932de7: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(strCursor + -(int)(valueText + 1)); if ((std_string *)(0x7fffffff - gfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gfxRoot; if (0xf < gfxRoot._capacity) { rootText = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4,(byte *)rootText,gfxRoot._size, valueText,(uint)psVar4); std::string::_Tidy_deallocate(&config.field_0x34); config._52_1_ = joinedPath._buf[0]; config._53_1_ = joinedPath._buf[1]; config._54_1_ = joinedPath._buf[2]; config._55_1_ = joinedPath._buf[3]; config._56_1_ = joinedPath._buf[4]; config._57_1_ = joinedPath._buf[5]; config._58_1_ = joinedPath._buf[6]; config._59_1_ = joinedPath._buf[7]; config._60_1_ = joinedPath._buf[8]; config._61_1_ = joinedPath._buf[9]; config._62_1_ = joinedPath._buf[10]; config._63_1_ = joinedPath._buf[0xb]; config._64_1_ = joinedPath._buf[0xc]; config._65_1_ = joinedPath._buf[0xd]; config._66_1_ = joinedPath._buf[0xe]; config._67_1_ = joinedPath._buf[0xf]; config._68_4_ = joinedPath._size; config._72_4_ = joinedPath._capacity; } else { attrNameCursor = &DAT_00b7b600; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < *attrNameCursor; if (isJoinedPathAlive != *attrNameCursor) { LAB_00932ea3: freeSize = -(uint)isLess | 1; goto LAB_00932ea8; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < attrNameCursor[1]; if (isJoinedPathAlive != attrNameCursor[1]) goto LAB_00932ea3; strCursor = strCursor + 2; attrNameCursor = attrNameCursor + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00932ea8: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(strCursor + -(int)(valueText + 1)); if ((std_string *)(0x7fffffff - gfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gfxRoot; if (0xf < gfxRoot._capacity) { rootText = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4,(byte *)rootText,gfxRoot._size, valueText,(uint)psVar4); std::string::_Tidy_deallocate(&config.field_0x4c); config._76_1_ = joinedPath._buf[0]; config._77_1_ = joinedPath._buf[1]; config._78_1_ = joinedPath._buf[2]; config._79_1_ = joinedPath._buf[3]; config._80_1_ = joinedPath._buf[4]; config._81_1_ = joinedPath._buf[5]; config._82_1_ = joinedPath._buf[6]; config._83_1_ = joinedPath._buf[7]; config._84_1_ = joinedPath._buf[8]; config._85_1_ = joinedPath._buf[9]; config._86_1_ = joinedPath._buf[10]; config._87_1_ = joinedPath._buf[0xb]; config._88_1_ = joinedPath._buf[0xc]; config._89_1_ = joinedPath._buf[0xd]; config._90_1_ = joinedPath._buf[0xe]; config._91_1_ = joinedPath._buf[0xf]; config._92_4_ = joinedPath._size; config._96_4_ = joinedPath._capacity; } else { pcVar5 = "watergfx"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00932f64: freeSize = -(uint)isLess | 1; goto LAB_00932f69; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00932f64; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00932f69: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(strCursor + -(int)(valueText + 1)); if ((std_string *)(0x7fffffff - gfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gfxRoot; if (0xf < gfxRoot._capacity) { rootText = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4,(byte *)rootText,gfxRoot._size ,valueText,(uint)psVar4); std::string::_Tidy_deallocate(&config.field_0x1c); config._28_1_ = joinedPath._buf[0]; config._29_1_ = joinedPath._buf[1]; config._30_1_ = joinedPath._buf[2]; config._31_1_ = joinedPath._buf[3]; config._32_1_ = joinedPath._buf[4]; config._33_1_ = joinedPath._buf[5]; config._34_1_ = joinedPath._buf[6]; config._35_1_ = joinedPath._buf[7]; config._36_1_ = joinedPath._buf[8]; config._37_1_ = joinedPath._buf[9]; config._38_1_ = joinedPath._buf[10]; config._39_1_ = joinedPath._buf[0xb]; config._40_1_ = joinedPath._buf[0xc]; config._41_1_ = joinedPath._buf[0xd]; config._42_1_ = joinedPath._buf[0xe]; config._43_1_ = joinedPath._buf[0xf]; config._44_4_ = joinedPath._size; config._48_4_ = joinedPath._capacity; } else { pcVar5 = "walls"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933030: freeSize = -(uint)isLess | 1; goto LAB_00933035; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933030; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933035: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } config.walls = atoi((char *)valueText); } else { pcVar5 = "wallvariants"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933090: freeSize = -(uint)isLess | 1; goto LAB_00933095; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933090; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933095: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } config.wallVariants = atoi((char *)valueText); } else { pcVar5 = "floors"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_009330f0: freeSize = -(uint)isLess | 1; goto LAB_009330f5; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_009330f0; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_009330f5: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } config.floors = atoi((char *)valueText); } else { pcVar5 = "floorvariants"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933150: freeSize = -(uint)isLess | 1; goto LAB_00933155; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933150; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933155: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } config.floorVariants = atoi((char *)valueText); } else { pcVar5 = "fullimage"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_009331b0: freeSize = -(uint)isLess | 1; goto LAB_009331b5; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_009331b0; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_009331b5: if (freeSize == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } strCursor = valueText; do { isJoinedPathAlive = *strCursor; strCursor = strCursor + 1; } while (isJoinedPathAlive != 0); std::string::assign(attrValue._buf,valueText, (int)strCursor - (int)(valueText + 1)); if (attrValue._size == 0) { LAB_009332c2: config.unk1._0_1_ = 0; } else { psVar4 = &attrValue; if (0xf < attrValue._capacity) { psVar4 = (std_string *)attrValue._buf._0_4_; } if (attrValue._size == 4) { if ((*(int *)psVar4->_buf == 0x65757274) || ((((isJoinedPathAlive = (byte)*(int *)psVar4->_buf, isLess = isJoinedPathAlive < 0x74, isJoinedPathAlive == 0x74 && (isLess = (byte)psVar4->_buf[1] < 0x72, psVar4->_buf[1] == 0x72)) && (isLess = (byte)psVar4->_buf[2] < 0x75, psVar4->_buf[2] == 0x75)) && (isLess = (byte)psVar4->_buf[3] < 0x65, psVar4->_buf[3] == 0x65)))) { freeSize = 0; } else { freeSize = -(uint)isLess | 1; } if (freeSize != 0) goto LAB_0093325c; } else { LAB_0093325c: psVar4 = &attrValue; if (0xf < attrValue._capacity) { psVar4 = (std_string *)attrValue._buf._0_4_; } if (attrValue._size == 4) { if ((*(int *)psVar4->_buf == 0x65757254) || (((isJoinedPathAlive = (byte)*(int *)psVar4->_buf, isLess = isJoinedPathAlive < 0x54, isJoinedPathAlive == 0x54 && (isLess = (byte)psVar4->_buf[1] < 0x72, psVar4->_buf[1] == 0x72)) && ((isLess = (byte)psVar4->_buf[2] < 0x75, psVar4->_buf[2] == 0x75 && (isLess = (byte)psVar4->_buf[3] < 0x65, psVar4->_buf[3] == 0x65)))))) { freeSize = 0; } else { freeSize = -(uint)isLess | 1; } if (freeSize == 0) goto LAB_009332b9; } psVar4 = &attrValue; if (0xf < attrValue._capacity) { psVar4 = (std_string *)attrValue._buf._0_4_; } iVar3 = atoi(psVar4->_buf); if (iVar3 == 0) goto LAB_009332c2; } LAB_009332b9: config.unk1._0_1_ = 1; } if (0xf < attrValue._capacity) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } } else { pcVar5 = "props"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933337: freeSize = -(uint)isLess | 1; goto LAB_0093333c; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933337; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_0093333c: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; psVar4 = &attrValue; attrValue._capacity = 0xf; cleanupFlags = cleanupFlags | 2; attrValue._size = 0; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(valueText + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4,(byte *)rootText ,gridGfxRoot._size,strCursor,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x11; isJoinedPathAlive = true; } std::string::_Tidy_deallocate(&config.field_0x78); config._120_1_ = psVar4->_buf[0]; config._121_1_ = psVar4->_buf[1]; config._122_1_ = psVar4->_buf[2]; config._123_1_ = psVar4->_buf[3]; config._124_1_ = psVar4->_buf[4]; config._125_1_ = psVar4->_buf[5]; config._126_1_ = psVar4->_buf[6]; config._127_1_ = psVar4->_buf[7]; config._128_1_ = psVar4->_buf[8]; config._129_1_ = psVar4->_buf[9]; config._130_1_ = psVar4->_buf[10]; config._131_1_ = psVar4->_buf[0xb]; config._132_1_ = psVar4->_buf[0xc]; config._133_1_ = psVar4->_buf[0xd]; config._134_1_ = psVar4->_buf[0xe]; config._135_1_ = psVar4->_buf[0xf]; config._136_4_ = psVar4->_size; config._140_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; if (((cleanupFlags & 2) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffd, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((isJoinedPathAlive) && (isJoinedPathAlive = false, 0xf < joinedPath._capacity)) { freeSize = joinedPath._capacity + 1; freeBlock = (void *)joinedPath._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(joinedPath._buf._0_4_ + -4); freeSize = joinedPath._capacity + 0x24; if (0x1f < (joinedPath._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } } else { pcVar5 = "rocks"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_009334f4: freeSize = -(uint)isLess | 1; goto LAB_009334f9; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_009334f4; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_009334f9: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; psVar4 = &attrValue; attrValue._capacity = 0xf; cleanupFlags = cleanupFlags | 8; attrValue._size = 0; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(valueText + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4, (byte *)rootText,gridGfxRoot._size,strCursor ,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x12; cleanupFlags = cleanupFlags | 0x200004; } std::string::_Tidy_deallocate(&config.field_0x90); config._144_1_ = psVar4->_buf[0]; config._145_1_ = psVar4->_buf[1]; config._146_1_ = psVar4->_buf[2]; config._147_1_ = psVar4->_buf[3]; config._148_1_ = psVar4->_buf[4]; config._149_1_ = psVar4->_buf[5]; config._150_1_ = psVar4->_buf[6]; config._151_1_ = psVar4->_buf[7]; config._152_1_ = psVar4->_buf[8]; config._153_1_ = psVar4->_buf[9]; config._154_1_ = psVar4->_buf[10]; config._155_1_ = psVar4->_buf[0xb]; config._156_1_ = psVar4->_buf[0xc]; config._157_1_ = psVar4->_buf[0xd]; config._158_1_ = psVar4->_buf[0xe]; config._159_1_ = psVar4->_buf[0xf]; config._160_4_ = psVar4->_size; config._164_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; if (((cleanupFlags & 8) != 0) && (cleanupFlags = cleanupFlags & 0xfffffff7, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if (((cleanupFlags & 4) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffb, 0xf < joinedPath._capacity)) { freeSize = joinedPath._capacity + 1; freeBlock = (void *)joinedPath._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(joinedPath._buf._0_4_ + -4); freeSize = joinedPath._capacity + 0x24; if (0x1f < (joinedPath._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } } else { attrNameCursor = &DAT_00b68fb8; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < *attrNameCursor; if (isJoinedPathAlive != *attrNameCursor) { LAB_009336b0: freeSize = -(uint)isLess | 1; goto LAB_009336b5; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < attrNameCursor[1]; if (isJoinedPathAlive != attrNameCursor[1]) goto LAB_009336b0; strCursor = strCursor + 2; attrNameCursor = attrNameCursor + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_009336b5: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; psVar4 = &attrValue; attrValue._capacity = 0xf; cleanupFlags = cleanupFlags | 0x20; attrValue._size = 0; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(valueText + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4, (byte *)rootText,gridGfxRoot._size, strCursor,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x13; cleanupFlags = cleanupFlags | 0x400010; } std::string::_Tidy_deallocate(&config.field_0xa8); config._168_1_ = psVar4->_buf[0]; config._169_1_ = psVar4->_buf[1]; config._170_1_ = psVar4->_buf[2]; config._171_1_ = psVar4->_buf[3]; config._172_1_ = psVar4->_buf[4]; config._173_1_ = psVar4->_buf[5]; config._174_1_ = psVar4->_buf[6]; config._175_1_ = psVar4->_buf[7]; config._176_1_ = psVar4->_buf[8]; config._177_1_ = psVar4->_buf[9]; config._178_1_ = psVar4->_buf[10]; config._179_1_ = psVar4->_buf[0xb]; config._180_1_ = psVar4->_buf[0xc]; config._181_1_ = psVar4->_buf[0xd]; config._182_1_ = psVar4->_buf[0xe]; config._183_1_ = psVar4->_buf[0xf]; config._184_4_ = psVar4->_size; config._188_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; if (((cleanupFlags & 0x20) != 0) && (cleanupFlags = cleanupFlags & 0xffffffdf, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((cleanupFlags & 0x10) != 0) { cleanupFlags = cleanupFlags & 0xffffffef; LAB_00933f46: local_14._1_3_ = 0; local_14._0_1_ = 0x10; std::string::_Tidy_deallocate(joinedPath._buf); } } else { pcVar5 = "waterpit"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933820: freeSize = -(uint)isLess | 1; goto LAB_00933825; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933820; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933825: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; std::string::assign(attrValue._buf,&s_empty,0); psVar4 = &attrValue; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(valueText + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4, (byte *)rootText,gridGfxRoot._size, strCursor,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x14; cleanupFlags = cleanupFlags | 0x800040; } std::string::_Tidy_deallocate(&config.field_0xc0); config._192_1_ = psVar4->_buf[0]; config._193_1_ = psVar4->_buf[1]; config._194_1_ = psVar4->_buf[2]; config._195_1_ = psVar4->_buf[3]; config._196_1_ = psVar4->_buf[4]; config._197_1_ = psVar4->_buf[5]; config._198_1_ = psVar4->_buf[6]; config._199_1_ = psVar4->_buf[7]; config._200_1_ = psVar4->_buf[8]; config._201_1_ = psVar4->_buf[9]; config._202_1_ = psVar4->_buf[10]; config._203_1_ = psVar4->_buf[0xb]; config._204_1_ = psVar4->_buf[0xc]; config._205_1_ = psVar4->_buf[0xd]; config._206_1_ = psVar4->_buf[0xe]; config._207_1_ = psVar4->_buf[0xf]; config._208_4_ = psVar4->_size; config._212_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((cleanupFlags & 0x40) != 0) { cleanupFlags = cleanupFlags & 0xffffffbf; goto LAB_00933f46; } } else { pcVar5 = "bridge"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_009339a2: freeSize = -(uint)isLess | 1; goto LAB_009339a7; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_009339a2; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_009339a7: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; std::string::assign(attrValue._buf,&s_empty,0); psVar4 = &attrValue; cleanupFlags = cleanupFlags | 0x200; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *)(valueText + -(int)(strCursor + 1)) ; if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4, (byte *)rootText,gridGfxRoot._size, strCursor,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x15; cleanupFlags = cleanupFlags | 0x1000100; } std::string::_Tidy_deallocate(&config.field_0xd8); config._216_1_ = psVar4->_buf[0]; config._217_1_ = psVar4->_buf[1]; config._218_1_ = psVar4->_buf[2]; config._219_1_ = psVar4->_buf[3]; config._220_1_ = psVar4->_buf[4]; config._221_1_ = psVar4->_buf[5]; config._222_1_ = psVar4->_buf[6]; config._223_1_ = psVar4->_buf[7]; config._224_1_ = psVar4->_buf[8]; config._225_1_ = psVar4->_buf[9]; config._226_1_ = psVar4->_buf[10]; config._227_1_ = psVar4->_buf[0xb]; config._228_1_ = psVar4->_buf[0xc]; config._229_1_ = psVar4->_buf[0xd]; config._230_1_ = psVar4->_buf[0xe]; config._231_1_ = psVar4->_buf[0xf]; config._232_4_ = psVar4->_size; config._236_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; if (((cleanupFlags & 0x200) != 0) && (cleanupFlags = cleanupFlags & 0xfffffdff, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((cleanupFlags & 0x100) != 0) { cleanupFlags = cleanupFlags & 0xfffffeff; goto LAB_00933f46; } } else { attrNameCursor = &DAT_00b6cb48; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < *attrNameCursor; if (isJoinedPathAlive != *attrNameCursor) { LAB_00933b30: freeSize = -(uint)isLess | 1; goto LAB_00933b35; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < attrNameCursor[1]; if (isJoinedPathAlive != attrNameCursor[1]) goto LAB_00933b30; strCursor = strCursor + 2; attrNameCursor = attrNameCursor + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933b35: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; std::string::assign(attrValue._buf,&s_empty,0); psVar4 = &attrValue; cleanupFlags = cleanupFlags | 0x800; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *) (valueText + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4, (byte *)rootText,gridGfxRoot._size, strCursor,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x16; cleanupFlags = cleanupFlags | 0x2000400; } std::string::_Tidy_deallocate(&config.field_0xf0); config._240_1_ = psVar4->_buf[0]; config._241_1_ = psVar4->_buf[1]; config._242_1_ = psVar4->_buf[2]; config._243_1_ = psVar4->_buf[3]; config._244_1_ = psVar4->_buf[4]; config._245_1_ = psVar4->_buf[5]; config._246_1_ = psVar4->_buf[6]; config._247_1_ = psVar4->_buf[7]; config._248_1_ = psVar4->_buf[8]; config._249_1_ = psVar4->_buf[9]; config._250_1_ = psVar4->_buf[10]; config._251_1_ = psVar4->_buf[0xb]; config._252_1_ = psVar4->_buf[0xc]; config._253_1_ = psVar4->_buf[0xd]; config._254_1_ = psVar4->_buf[0xe]; config._255_1_ = psVar4->_buf[0xf]; config._256_4_ = psVar4->_size; config._260_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; if (((cleanupFlags & 0x800) != 0) && (cleanupFlags = cleanupFlags & 0xfffff7ff, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((cleanupFlags & 0x400) != 0) { cleanupFlags = cleanupFlags & 0xfffffbff; goto LAB_00933f46; } } else { pcVar5 = "holeinwall"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933cc0: freeSize = -(uint)isLess | 1; goto LAB_00933cc5; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933cc0; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933cc5: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; std::string::assign(attrValue._buf,&s_empty,0); psVar4 = &attrValue; cleanupFlags = cleanupFlags | 0x2000; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } valueText = strCursor; do { isJoinedPathAlive = *valueText; valueText = valueText + 1; } while (isJoinedPathAlive != 0); psVar4 = (std_string *) (valueText + -(int)(strCursor + 1)); if ((std_string *)(0x7fffffff - gridGfxRoot._size) < psVar4) goto LAB_00934421; rootText = &gridGfxRoot; if (0xf < gridGfxRoot._capacity) { rootText = (std_string *)gridGfxRoot._buf._0_4_; } std::string::concat(joinedPath._buf,in_ECX,psVar4, (byte *)rootText,gridGfxRoot._size ,strCursor,(uint)psVar4); psVar4 = &joinedPath; local_14._0_1_ = 0x17; cleanupFlags = cleanupFlags | 0x4001000; } std::string::_Tidy_deallocate(&config.field_0x108); config._264_1_ = psVar4->_buf[0]; config._265_1_ = psVar4->_buf[1]; config._266_1_ = psVar4->_buf[2]; config._267_1_ = psVar4->_buf[3]; config._268_1_ = psVar4->_buf[4]; config._269_1_ = psVar4->_buf[5]; config._270_1_ = psVar4->_buf[6]; config._271_1_ = psVar4->_buf[7]; config._272_1_ = psVar4->_buf[8]; config._273_1_ = psVar4->_buf[9]; config._274_1_ = psVar4->_buf[10]; config._275_1_ = psVar4->_buf[0xb]; config._276_1_ = psVar4->_buf[0xc]; config._277_1_ = psVar4->_buf[0xd]; config._278_1_ = psVar4->_buf[0xe]; config._279_1_ = psVar4->_buf[0xf]; config._280_4_ = psVar4->_size; config._284_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; if (((cleanupFlags & 0x2000) != 0) && (cleanupFlags = cleanupFlags & 0xffffdfff, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((cleanupFlags & 0x1000) != 0) { cleanupFlags = cleanupFlags & 0xffffefff; goto LAB_00933f46; } } else { pcVar5 = "spikes"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933e50: freeSize = -(uint)isLess | 1; goto LAB_00933e55; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933e50; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933e55: if (freeSize == 0) { valueText = (byte *)attribute[1]; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } if (*strCursor == 0) { attrValue._buf[0] = '\0'; attrValue._buf[1] = '\0'; attrValue._buf[2] = '\0'; attrValue._buf[3] = '\0'; attrValue._size = 0; attrValue._capacity = 0xf; std::string::assign(attrValue._buf,&s_empty,0); psVar4 = &attrValue; cleanupFlags = cleanupFlags | 0x8000; } else { strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } psVar4 = (std_string *)FUN_00421620(strCursor); local_14._0_1_ = 0x18; cleanupFlags = cleanupFlags | 0x4000; } FUN_004215a0(psVar4); if (((cleanupFlags & 0x8000) != 0) && (cleanupFlags = cleanupFlags & 0xffff7fff, 0xf < attrValue._capacity)) { freeSize = attrValue._capacity + 1; freeBlock = (void *)attrValue._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(attrValue._buf._0_4_ + -4); freeSize = attrValue._capacity + 0x24; if (0x1f < (attrValue._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0x10; local_14._1_3_ = 0; if ((cleanupFlags & 0x4000) != 0) { cleanupFlags = cleanupFlags & 0xffffbfff; goto LAB_00933f46; } } else { pcVar5 = "waterpitsmode"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933f94: freeSize = -(uint)isLess | 1; goto LAB_00933f99; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933f94; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933f99: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } iVar3 = atoi((char *)valueText); config.waterPitsMode._0_1_ = (undefined1)iVar3; } else { pcVar5 = "reversewatergfx"; strCursor = &g_xmlNullStr; if (valueText != (byte *)0x0) { strCursor = valueText; } do { isJoinedPathAlive = *strCursor; isLess = isJoinedPathAlive < (byte)*pcVar5; if (isJoinedPathAlive != *pcVar5) { LAB_00933ff4: freeSize = -(uint)isLess | 1; goto LAB_00933ff9; } if (isJoinedPathAlive == 0) break; isJoinedPathAlive = strCursor[1]; isLess = isJoinedPathAlive < (byte)pcVar5[1]; if (isJoinedPathAlive != pcVar5[1]) goto LAB_00933ff4; strCursor = strCursor + 2; pcVar5 = pcVar5 + 2; } while (isJoinedPathAlive != 0); freeSize = 0; LAB_00933ff9: if (freeSize == 0) { valueText = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { valueText = (byte *)attribute[1]; } std::string::string_from_cstr (joinedPath._buf,valueText); config.waterPitsMode._1_1_ = string_to_bool(); std::string::_Tidy_deallocate(joinedPath._buf); } } } } } } } } } } } } } } } } } } } } } while ((attribute[4] != 0) && (attribute = (undefined4 *)attribute[6], attribute != (undefined4 *)0x0)); } if (config.backdropId - 1U < 0x3e) { BackdropConfig::operator_assign(&config); } local_14._0_1_ = 4; std::string::_Tidy_deallocate(&config.field_0x120); if (0xf < (uint)config._284_4_) { freeSize = config._284_4_ + 1; freeBlock = (void *)config._264_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._264_4_ + -4); freeSize = config._284_4_ + 0x24; if (0x1f < (config._264_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._260_4_) { freeSize = config._260_4_ + 1; freeBlock = (void *)config._240_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._240_4_ + -4); freeSize = config._260_4_ + 0x24; if (0x1f < (config._240_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._236_4_) { freeSize = config._236_4_ + 1; freeBlock = (void *)config._216_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._216_4_ + -4); freeSize = config._236_4_ + 0x24; if (0x1f < (config._216_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._212_4_) { freeSize = config._212_4_ + 1; freeBlock = (void *)config._192_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._192_4_ + -4); freeSize = config._212_4_ + 0x24; if (0x1f < (config._192_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._188_4_) { freeSize = config._188_4_ + 1; freeBlock = (void *)config._168_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._168_4_ + -4); freeSize = config._188_4_ + 0x24; if (0x1f < (config._168_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._164_4_) { freeSize = config._164_4_ + 1; freeBlock = (void *)config._144_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._144_4_ + -4); freeSize = config._164_4_ + 0x24; if (0x1f < (config._144_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._140_4_) { freeSize = config._140_4_ + 1; freeBlock = (void *)config._120_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._120_4_ + -4); freeSize = config._140_4_ + 0x24; if (0x1f < (config._120_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._96_4_) { freeSize = config._96_4_ + 1; freeBlock = (void *)config._76_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._76_4_ + -4); freeSize = config._96_4_ + 0x24; if (0x1f < (config._76_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._72_4_) { freeSize = config._72_4_ + 1; freeBlock = (void *)config._52_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._52_4_ + -4); freeSize = config._72_4_ + 0x24; if (0x1f < (config._52_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._48_4_) { freeSize = config._48_4_ + 1; freeBlock = (void *)config._28_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._28_4_ + -4); freeSize = config._48_4_ + 0x24; if (0x1f < (config._28_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } if (0xf < (uint)config._24_4_) { freeSize = config._24_4_ + 1; freeBlock = (void *)config._4_4_; if (0xfff < freeSize) { freeBlock = *(void **)(config._4_4_ + -4); freeSize = config._24_4_ + 0x24; if (0x1f < (config._4_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } iVar3 = config.backdropId; config.backdropId = defaultConfig.backdropId; } config.backdropId = iVar3; BackdropConfig::~BackdropConfig(&defaultConfig); local_14._0_1_ = 2; if (0xf < effectsGfxRoot._capacity) { freeSize = effectsGfxRoot._capacity + 1; freeBlock = (void *)effectsGfxRoot._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(effectsGfxRoot._buf._0_4_ + -4); freeSize = effectsGfxRoot._capacity + 0x24; if (0x1f < (effectsGfxRoot._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 1; if (0xf < gridGfxRoot._capacity) { freeSize = gridGfxRoot._capacity + 1; freeBlock = (void *)gridGfxRoot._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(gridGfxRoot._buf._0_4_ + -4); freeSize = gridGfxRoot._capacity + 0x24; if (0x1f < (gridGfxRoot._buf._0_4_ - (int)freeBlock) - 4U) goto LAB_009343c2; } operator_delete(freeBlock,freeSize); } local_14._0_1_ = 0; if (0xf < gfxRoot._capacity) { freeSize = gfxRoot._capacity + 1; freeBlock = (void *)gfxRoot._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(gfxRoot._buf._0_4_ + -4); freeSize = gfxRoot._capacity + 0x24; if (0x1f < (gfxRoot._buf._0_4_ - (int)freeBlock) - 4U) { LAB_009343c2: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } local_14 = 0x19; xml_memory_pool::clear(xmlMemoryPool); local_14 = 0x1a; tracked_alloc(1,text,0); isLoaded = 1; } ExceptionList = local_1c; return isLoaded; } //@@ 00934430 BackdropConfig::operator_assign /* DB: copy-assign of the same 0x13c-byte entry (std::string::assign per field); Backdrop::LoadConfig */ void BackdropConfig::operator_assign(undefined4 *param_1) { byte *pbVar1; undefined4 *in_ECX; *in_ECX = *param_1; pbVar1 = (byte *)(param_1 + 1); if ((byte *)(in_ECX + 1) != pbVar1) { if (0xf < (uint)param_1[6]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 1),pbVar1,param_1[5]); } pbVar1 = (byte *)(param_1 + 7); if ((byte *)(in_ECX + 7) != pbVar1) { if (0xf < (uint)param_1[0xc]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 7),pbVar1,param_1[0xb]); } pbVar1 = (byte *)(param_1 + 0xd); if ((byte *)(in_ECX + 0xd) != pbVar1) { if (0xf < (uint)param_1[0x12]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0xd),pbVar1,param_1[0x11]); } pbVar1 = (byte *)(param_1 + 0x13); if ((byte *)(in_ECX + 0x13) != pbVar1) { if (0xf < (uint)param_1[0x18]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x13),pbVar1,param_1[0x17]); } in_ECX[0x19] = param_1[0x19]; in_ECX[0x1a] = param_1[0x1a]; in_ECX[0x1b] = param_1[0x1b]; in_ECX[0x1c] = param_1[0x1c]; *(undefined1 *)(in_ECX + 0x1d) = *(undefined1 *)(param_1 + 0x1d); pbVar1 = (byte *)(param_1 + 0x1e); if ((byte *)(in_ECX + 0x1e) != pbVar1) { if (0xf < (uint)param_1[0x23]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x1e),pbVar1,param_1[0x22]); } pbVar1 = (byte *)(param_1 + 0x24); if ((byte *)(in_ECX + 0x24) != pbVar1) { if (0xf < (uint)param_1[0x29]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x24),pbVar1,param_1[0x28]); } pbVar1 = (byte *)(param_1 + 0x2a); if ((byte *)(in_ECX + 0x2a) != pbVar1) { if (0xf < (uint)param_1[0x2f]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x2a),pbVar1,param_1[0x2e]); } pbVar1 = (byte *)(param_1 + 0x30); if ((byte *)(in_ECX + 0x30) != pbVar1) { if (0xf < (uint)param_1[0x35]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x30),pbVar1,param_1[0x34]); } pbVar1 = (byte *)(param_1 + 0x36); if ((byte *)(in_ECX + 0x36) != pbVar1) { if (0xf < (uint)param_1[0x3b]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x36),pbVar1,param_1[0x3a]); } pbVar1 = (byte *)(param_1 + 0x3c); if ((byte *)(in_ECX + 0x3c) != pbVar1) { if (0xf < (uint)param_1[0x41]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x3c),pbVar1,param_1[0x40]); } pbVar1 = (byte *)(param_1 + 0x42); if ((byte *)(in_ECX + 0x42) != pbVar1) { if (0xf < (uint)param_1[0x47]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x42),pbVar1,param_1[0x46]); } pbVar1 = (byte *)(param_1 + 0x48); if ((byte *)(in_ECX + 0x48) != pbVar1) { if (0xf < (uint)param_1[0x4d]) { pbVar1 = *(byte **)pbVar1; } std::string::assign((char *)(in_ECX + 0x48),pbVar1,param_1[0x4c]); } *(undefined1 *)(in_ECX + 0x4e) = *(undefined1 *)(param_1 + 0x4e); *(undefined1 *)((int)in_ECX + 0x139) = *(undefined1 *)((int)param_1 + 0x139); return; } //@@ 00934600 BackdropConfig::copy_constructor /* DB: copies a 0x13c-byte backdrops.xml entry (id, 4 strings, 4 ints + bool, 7 more strings, 2 bools); Backdrop::pre_render_walls */ void BackdropConfig::copy_constructor(undefined4 *param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0b0f0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = *param_1; std::string::string((char *)(in_ECX + 1),param_1 + 1); local_8 = 0; std::string::string((char *)(in_ECX + 7),param_1 + 7); local_8._0_1_ = 1; std::string::string((char *)(in_ECX + 0xd),param_1 + 0xd); local_8._0_1_ = 2; std::string::string((char *)(in_ECX + 0x13),param_1 + 0x13); local_8._0_1_ = 3; in_ECX[0x19] = param_1[0x19]; in_ECX[0x1a] = param_1[0x1a]; in_ECX[0x1b] = param_1[0x1b]; in_ECX[0x1c] = param_1[0x1c]; *(undefined1 *)(in_ECX + 0x1d) = *(undefined1 *)(param_1 + 0x1d); std::string::string((char *)(in_ECX + 0x1e),param_1 + 0x1e); local_8._0_1_ = 4; std::string::string((char *)(in_ECX + 0x24),param_1 + 0x24); local_8._0_1_ = 5; std::string::string((char *)(in_ECX + 0x2a),param_1 + 0x2a); local_8._0_1_ = 6; std::string::string((char *)(in_ECX + 0x30),param_1 + 0x30); local_8._0_1_ = 7; std::string::string((char *)(in_ECX + 0x36),param_1 + 0x36); local_8._0_1_ = 8; std::string::string((char *)(in_ECX + 0x3c),param_1 + 0x3c); local_8._0_1_ = 9; std::string::string((char *)(in_ECX + 0x42),param_1 + 0x42); local_8 = CONCAT31(local_8._1_3_,10); std::string::string((char *)(in_ECX + 0x48),param_1 + 0x48); *(undefined1 *)(in_ECX + 0x4e) = *(undefined1 *)(param_1 + 0x4e); *(undefined1 *)((int)in_ECX + 0x139) = *(undefined1 *)((int)param_1 + 0x139); ExceptionList = local_10; return; } //@@ 00934770 Backdrop::PreRenderControls /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: this=Backdrop (0x150 backdropId==3, 0x4f18 unkVec, +0x5050 ANM2 "Controls"/"Keyboard" anims, EntityConfig_Player::_moddedControlsANM2 + GetDisplayName); REPENTOGON ASM hook Backdrop_PreRenderControls_GetCharacterAnimName lives here; called from Backdrop::load_details chain (009356a0) prototype: db/protos.zhl */ void __thiscall Backdrop::PreRenderControls(Backdrop *this) { code *pcVar1; Backdrop BVar2; Backdrop BVar3; byte isAnimChanged; char cVar4; int iVar5; std_string *anim; float *nullFrame; ANM2 *sprite; int *piVar6; int iconCount; AnimationState *lastLayer; void *pvVar7; uint uVar8; ColorMod *spriteColor; int glyphCount; float fVar9; float fVar10; Vector glyphPos; void *offsetsBegin; undefined4 local_94; int offsetsCapacityEnd; int device; int *deviceRefCount; Vector controlsPos; uint rowOffset; void *local_78; int framesEnd; int framesCapacityEnd; EntityConfig_Player *local_6c; EntityConfig_Player *local_68; Backdrop jitterSeed; int controllerIndex; int *local_5c; void *framesBegin; float cursorX; uint local_50; int *iconRow; int row; int playerType; ANM2 *controlsSprite; void *displayName [4]; uint displayNameSize; uint displayNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; Backdrop colorComponent; Game *game; puStack_20 = (undefined1 *)(displayName + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0b138; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(displayName + 0xb); ExceptionList = &local_1c; sprite = (ANM2 *)(this + 0x1414); playerType = g_manager->_startPlayerType; controlsSprite = sprite; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { puStack_20 = (undefined1 *)(displayName + 0xe); } else { FUN_0090b070(local_24); iVar5 = FUN_004253d0(); playerType = *(int *)(iVar5 + 0x13c0); } if (playerType < 0x29) { isAnimChanged = ANM2::SetAnimation(sprite,(byte *)"Controls",1); if ((isAnimChanged != 0) && (this[0x1421] != (Backdrop)0x0)) { fVar9 = (float)playerType; goto LAB_0093493f; } } else { pvVar7 = (g_manager->_entityConfig)._players._begin; if (((playerType < ((int)(g_manager->_entityConfig)._players._end - (int)pvVar7) / 0x148) && (local_6c = (EntityConfig_Player *)(playerType * 0x148 + (int)pvVar7), local_6c != (EntityConfig_Player *)0x0)) && (sprite = local_6c->_moddedControlsANM2, sprite != (ANM2 *)0x0)) { anim = EntityConfig_Player::GetDisplayName (local_6c,(std_string *)displayName,(void *)playerType); local_14 = (void *)0x0; if (0xf < anim->_capacity) { anim = *(std_string **)anim->_buf; } isAnimChanged = ANM2::SetAnimation(sprite,(byte *)anim,1); if (((isAnimChanged != 0) && ((sprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&sprite->_animState,0.0), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } local_14 = (void *)0xffffffff; if (0xf < displayNameCapacity) { uVar8 = displayNameCapacity + 1; pvVar7 = displayName[0]; if (0xfff < uVar8) { pvVar7 = *(void **)((int)displayName[0] + -4); uVar8 = displayNameCapacity + 0x24; if (0x1f < (uint)((int)displayName[0] + (-4 - (int)pvVar7))) { LAB_009348c4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar8); } displayNameSize = 0; displayNameCapacity = 0xf; displayName[0] = (void *)((uint)displayName[0] & 0xffffff00); sprite = local_6c->_moddedControlsANM2; if (sprite != (ANM2 *)0x0) { controlsSprite = sprite; goto LAB_00934952; } } sprite = (ANM2 *)(this + 0x1414); isAnimChanged = ANM2::SetAnimation(sprite,(byte *)"Controls",1); if ((isAnimChanged != 0) && (this[0x1421] != (Backdrop)0x0)) { fVar9 = 0.0; LAB_0093493f: sprite = (ANM2 *)(this + 0x1414); AnimationState::SetFrameFloat((AnimationState *)(this + 0x1420),fVar9); if (this[0x1421] != (Backdrop)0x0) { *(undefined1 *)(this + 0x1425) = 0; } } } LAB_00934952: spriteColor = &sprite->_color; controlsPos.y = (float)this[0x13c7] + 91.0; controlsPos.x = ((float)this[0x13c8] + (float)this[0x13c6]) * 0.5; fVar9 = 1.0; if (this[0x54] == (Backdrop)0x3) { fVar9 = 0.6; fVar10 = 0.7; } else { fVar10 = 1.0; } spriteColor->_tint[0] = fVar10; (sprite->_color)._tint[1] = fVar9; (sprite->_color)._tint[2] = fVar9; (sprite->_color)._tint[3] = 1.0; if (controlsSprite->_loaded != 0) { if (controlsSprite->_overlayRenderFirst == 0) { AnimationState::Render(&controlsSprite->_animState,&controlsPos,&g_vectorZero,&g_vectorZero); lastLayer = &controlsSprite->_overlayAnimState; } else { AnimationState::Render (&controlsSprite->_overlayAnimState,&controlsPos,&g_vectorZero,&g_vectorZero); lastLayer = &controlsSprite->_animState; } AnimationState::Render(lastLayer,&controlsPos,&g_vectorZero,&g_vectorZero); } if ((ColorMod *)(this + 0x1483) != spriteColor) { BVar2 = *(Backdrop *)((sprite->_color)._tint + 1); BVar3 = *(Backdrop *)((sprite->_color)._tint + 2); colorComponent = *(Backdrop *)((sprite->_color)._tint + 3); this[0x1483] = (Backdrop)spriteColor->_tint[0]; this[0x1484] = BVar2; this[0x1485] = BVar3; this[0x1486] = colorComponent; BVar2 = *(Backdrop *)((sprite->_color)._colorize + 1); BVar3 = *(Backdrop *)((sprite->_color)._colorize + 2); colorComponent = *(Backdrop *)((sprite->_color)._colorize + 3); this[0x1487] = (Backdrop)(sprite->_color)._colorize[0]; this[0x1488] = BVar2; this[0x1489] = BVar3; this[0x148a] = colorComponent; *(undefined8 *)(this + 0x148b) = *(undefined8 *)(sprite->_color)._offset; this[0x148d] = *(Backdrop *)((sprite->_color)._offset + 2); } game = g_game; piVar6 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar6 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar6 = (game->_playerManager)._playerList._begin; } controllerIndex = *(int *)(*piVar6 + 0x1618); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_00934aa5: if (controllerIndex == 0) { isAnimChanged = ANM2::SetAnimation((ANM2 *)(this + 0x1459),(byte *)"Keyboard",1); if (((isAnimChanged != 0) && (this[0x1466] != (Backdrop)0x0)) && (AnimationState::SetFrameFloat((AnimationState *)(this + 0x1465),0.0), this[0x1466] != (Backdrop)0x0)) { *(undefined1 *)(this + 0x146a) = 0; } goto LAB_00934be2; } } else { iVar5 = FUN_0090b070(); if (*(int *)(iVar5 + 0x378) != 0) { controllerIndex = *(int *)(*(int *)(iVar5 + 0x378) + 0xc); goto LAB_00934aa5; } controllerIndex = -0x21524111; } InputManager::get_device(&PTR_vftable_00c57b18,&device,controllerIndex); local_14 = (void *)0x1; if (((device == 0) || (iVar5 = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0), iVar5 == 0 )) || ((iVar5 = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0), (*(byte *)(iVar5 + 8) & 0x20) != 0 || (*(int *)(iVar5 + 900) != 0)))) { local_14 = (void *)0x2; if (deviceRefCount == (int *)0x0) { ExceptionList = local_1c; return; } cVar4 = (**(code **)(*deviceRefCount + 0xc))(); if (cVar4 == '\0') { ExceptionList = local_1c; return; } if (g_inputDeviceRelease == (void *)0x0) { ExceptionList = local_1c; return; } (*g_inputDeviceRelease)(&device); ExceptionList = local_1c; return; } isAnimChanged = ANM2::SetAnimation((ANM2 *)(this + 0x1459),&DAT_00b7b76c,1); if (((isAnimChanged != 0) && (this[0x1466] != (Backdrop)0x0)) && (AnimationState::SetFrameFloat((AnimationState *)(this + 0x1465),0.0), this[0x1466] != (Backdrop)0x0)) { *(undefined1 *)(this + 0x146a) = 0; } local_14 = (void *)0x3; if (((deviceRefCount != (int *)0x0) && (cVar4 = (**(code **)(*deviceRefCount + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } local_14 = (void *)0xffffffff; LAB_00934be2: iconCount = 8; jitterSeed = this[0x13ca]; local_6c = (EntityConfig_Player *)&DAT_00000008; if (playerType == 0x13) { if ((g_manager->_optionsConfig)._jacobEsauControls == 1) { iconCount = (int)&DAT_00000009; } local_6c = (EntityConfig_Player *)iconCount; } row = 0; iconRow = &DAT_00b7baa0; rowOffset = 0; sprite = controlsSprite; do { uVar8 = rowOffset; if ((sprite->_animState)._animData != (void *)0x0) { nullFrame = AnimationState::GetNullFrameById(&sprite->_animState,row); if ((nullFrame != (float *)0x0) && (*(char *)(nullFrame + 3) != '\0')) { framesBegin = (void *)0x0; framesEnd = 0; framesCapacityEnd = 0; offsetsBegin = (void *)0x0; local_94 = 0; offsetsCapacityEnd = 0; local_14 = (void *)0x5; local_50 = 0; cursorX = 0.0; local_68 = (EntityConfig_Player *)0x0; local_5c = iconRow; do { iVar5 = *local_5c; if (iVar5 == -1) break; local_78 = framesBegin; if (((playerType == 0x13) && ((g_manager->_optionsConfig)._jacobEsauControls == 1)) && (iVar5 == 10)) { cursorX = cursorX - 4.0; render_control_icon(0xb,framesEnd - (int)framesBegin >> 2,controllerIndex,&local_50, &cursorX,&local_78,&offsetsBegin); iVar5 = 9; glyphCount = framesEnd - (int)local_78; } else { glyphCount = framesEnd - (int)framesBegin; } render_control_icon(iVar5,glyphCount >> 2,controllerIndex,&local_50,&cursorX,&local_78, &offsetsBegin); local_68 = (EntityConfig_Player *)((int)&local_68->_id + 1); local_5c = local_5c + 1; framesBegin = local_78; } while (local_68 < local_6c); iVar5 = framesEnd; local_50 = 0; local_5c = offsetsBegin; local_78 = framesBegin; if (framesEnd - (int)framesBegin >> 2 != 0) { do { local_68 = (EntityConfig_Player *)(controlsPos.y + nullFrame[1]); if (jitterSeed == (Backdrop)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)jitterSeed >> 5 ^ (uint)jitterSeed; uVar8 = uVar8 << 0xf ^ uVar8; jitterSeed = (Backdrop)(uVar8 >> 0x11 ^ uVar8); glyphPos.y = (float)local_68 + (float)(int)((uint)jitterSeed % 3 - 1); glyphPos.x = cursorX + *(float *)((int)local_5c + local_50 * 4) + controlsPos.x + *nullFrame; if (this[0x1466] != (Backdrop)0x0) { AnimationState::SetFrameFloat ((AnimationState *)(this + 0x1465), (float)*(int *)((int)framesBegin + local_50 * 4)); } if (this[0x149b].field_0x1 != '\0') { if (*(char *)(this + 0x1475) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x1465),&glyphPos,&g_vectorZero,&g_vectorZero); lastLayer = (AnimationState *)(this + 0x146d); } else { AnimationState::Render ((AnimationState *)(this + 0x146d),&glyphPos,&g_vectorZero,&g_vectorZero); lastLayer = (AnimationState *)(this + 0x1465); } AnimationState::Render(lastLayer,&glyphPos,&g_vectorZero,&g_vectorZero); } local_50 = local_50 + 1; } while (local_50 < (uint)(iVar5 - (int)framesBegin >> 2)); } local_14 = (void *)CONCAT31(local_14._1_3_,4); if (local_5c != (void *)0x0) { uVar8 = (offsetsCapacityEnd - (int)local_5c >> 2) * 4; piVar6 = local_5c; if (0xfff < uVar8) { piVar6 = *(int **)((int)local_5c + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)local_5c + (-4 - (int)piVar6))) goto LAB_009348c4; } operator_delete(piVar6,uVar8); offsetsBegin = (void *)0x0; local_94 = 0; offsetsCapacityEnd = 0; } local_14 = (void *)0xffffffff; if (framesBegin != (void *)0x0) { uVar8 = framesCapacityEnd - (int)framesBegin & 0xfffffffc; pvVar7 = framesBegin; if (0xfff < uVar8) { pvVar7 = *(void **)((int)framesBegin + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)framesBegin + (-4 - (int)pvVar7))) goto LAB_009348c4; } operator_delete(pvVar7,uVar8); local_78 = (void *)0x0; framesEnd = 0; framesCapacityEnd = 0; } uVar8 = rowOffset; } sprite = controlsSprite; } rowOffset = uVar8 + 0x14; row = row + 1; iconRow = iconRow + 5; if (0x9f < rowOffset) { ExceptionList = local_1c; return; } } while( true ); } //@@ 00935010 Backdrop::render_control_icon /* DB: ? Backdrop::PreRenderControls: (actionId, flag, controllerIdx, Vector* ...) InputManager::get_device, "ActionId is out of range", picks the button frame of the controls sprite ("AnimationData is NULL", "LayerId out of bounds") */ void Backdrop::render_control_icon (uint param_1,int param_2,int param_3,float *param_4,float *param_5,int param_6, int param_7) { float *pfVar1; char isLastRef; int layerId; int in_ECX; int layerAnim; int buttonFrame; int device; int *deviceRefCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; int *framesEnd; float iconX; int layerId; local_8 = 0xffffffff; puStack_c = &LAB_00b0b17d; local_10 = ExceptionList; ExceptionList = &local_10; InputManager::get_device(&PTR_vftable_00c57b18,&device,param_3); local_8 = 0; if (device == 0) { buttonFrame = -1; } else { buttonFrame = *(int *)(device + 0x10); if ((uint)(*(int *)(device + 0x14) - buttonFrame >> 4) <= param_1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); buttonFrame = *(int *)(device + 0x10); } buttonFrame = *(int *)(buttonFrame + param_1 * 0x10); } pfVar1 = param_5; if (param_3 == 0) { if ((param_2 != 0) && (buttonFrame == 0x20)) { *param_5 = *param_5 + 4.0; } } else { buttonFrame = controller_button_to_glyph_frame(buttonFrame); } if (*(int *)(in_ECX + 0x5198) == 0) { LAB_009350db: KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } else { AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x5194),(float)buttonFrame); if (*(int *)(in_ECX + 0x5198) == 0) goto LAB_009350db; } if (*(int *)(*(int *)(in_ECX + 0x5194) + 0x80) < 1) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } layerId = *(int *)(in_ECX + 0x5198); if ((layerId != 0) && (-1 < *(int *)(*(int *)(in_ECX + 0x5194) + 0x80))) { layerId = *(int *)(layerId + 0x38); if ((-1 < layerId) && (layerId < *(int *)(layerId + 0x1c))) { layerAnim = layerId * 0x10 + *(int *)(layerId + 0x18); layerId = *(int *)(*(int *)(in_ECX + 0x519c) + layerId * 4); if ((((-1 < layerId) && (layerId < *(int *)(layerAnim + 8))) && (layerId = layerId * 0x6c + *(int *)(layerAnim + 4), layerId != 0)) && (*(char *)(layerId + 0x2c) != '\0')) { if (param_2 != 0) { *param_4 = *param_4 + *(float *)(layerId + 0x20); *pfVar1 = *pfVar1 - *(float *)(layerId + 0x20); } iconX = *param_4; *param_4 = (*(float *)(layerId + 8) - *(float *)(layerId + 0x20)) + iconX; goto LAB_009351d8; } } } if (param_2 != 0) { *param_4 = *param_4 + 4.0; *pfVar1 = *pfVar1 - 4.0; } iconX = *param_4; buttonFrame = 0; *param_4 = iconX + 8.0; LAB_009351d8: framesEnd = *(int **)(param_6 + 4); param_3 = buttonFrame; param_4 = (float *)iconX; if (framesEnd == *(int **)(param_6 + 8)) { std::vector::_Emplace_reallocate(framesEnd,¶m_3); } else { *framesEnd = buttonFrame; *(int *)(param_6 + 4) = *(int *)(param_6 + 4) + 4; } pfVar1 = *(float **)(param_7 + 4); if (pfVar1 == *(float **)(param_7 + 8)) { std::vector::_Emplace_reallocate(pfVar1,¶m_4); } else { *pfVar1 = iconX; *(float **)(param_7 + 4) = pfVar1 + 1; } local_8 = 1; if (deviceRefCount != (int *)0x0) { isLastRef = (**(code **)(*deviceRefCount + 0xc))(); if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } } ExceptionList = local_10; return; } //@@ 00935270 Backdrop::get_random_floor_variant /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Backdrop: picks RNG(+0x4f28)::RandomInt(config[+0x150].count +0x1c0) with special cases for backdrop ids 0x21/0x28/0x2d/0x2e/0x2f/0x3b (room flag 0x1000); Backdrop::render_ashpit_ash */ uint Backdrop::get_random_floor_variant(void) { int iVar1; int iVar2; uint uVar3; int in_ECX; int iVar4; RNG local_18; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; iVar1 = *(int *)(in_ECX + 0x150); iVar4 = iVar1 * 0x13c + in_ECX; if (iVar1 == 0x2d) { if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) & 0x1000) != 0) { uVar3 = RNG::RandomInt((RNG *)(in_ECX + 0x4f28),*(int *)(iVar4 + 0x1c0) - 1); return uVar3; } } else { if ((iVar1 == 0x2e) || (iVar1 == 0x3b)) { if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) & 0x1000) != 0) { return 1; } uVar3 = *(uint *)(iVar4 + 0x1c0); goto LAB_00935378; } if ((((iVar1 == 0x21) || (iVar1 == 0x28)) && (iVar2 = *(int *)((int)g_game->_room + 4), iVar2 != 0)) && ((iVar2 = *(int *)(iVar2 + 0x10), iVar2 != 0 && (*(int *)(iVar2 + 0x48) != 1)))) { uVar3 = RNG::RandomInt((RNG *)(in_ECX + 0x4f28),*(int *)(iVar4 + 0x1c0) - 1); return uVar3; } } uVar3 = *(uint *)(iVar4 + 0x1c0); if (iVar1 != 0x2f) { uVar3 = RNG::RandomInt((RNG *)(in_ECX + 0x4f28),uVar3); return uVar3; } LAB_00935378: local_18._seed = *(int *)(in_ECX + 0x4f38); local_18._shift3 = 0x1b; local_18._shift1 = 4; local_18._shift2 = 3; uVar3 = RNG::RandomInt(&local_18,uVar3); return uVar3; } //@@ 009353b0 Backdrop::render_ashpit_ash /* DB: Backdrop::load_details callee; this=Backdrop (rng at +0x4f28): gfx/backdrop/04x_ashpit_ash(_Lfloor/_Nfloor).png via Manager::LoadImage drawn into a render target (SetRenderTarget/Clear/Sprite::RenderLayer) */ void Backdrop::render_ashpit_ash(void) { int iVar1; char isLastRef; void *loadedImage; undefined4 *in_ECX; undefined4 uStack_64; undefined1 auStack_4a [2]; undefined1 nFloorImage [4]; int *nFloorImageRefCount; undefined1 ashImage [4]; int *ashImageRefCount; undefined1 floorImage [4]; int *floorImageRefCount; undefined1 lFloorImage [4]; int *local_1c; undefined1 *local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int roomConfigData; int roomShape; local_8 = 0xffffffff; puStack_c = &LAB_00b0b1e5; local_10 = ExceptionList; ExceptionList = &local_10; get_random_floor_variant(); iVar1 = in_ECX[0x54]; if (((iVar1 != 0x2e) && (iVar1 != 0x3b)) || ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) & 0x1000) == 0)) { if (((iVar1 == 0x34) || (iVar1 == 0x35)) || (iVar1 == 0x36)) { KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*in_ECX,0); RenderTarget::Clear(&DAT_00c798e0); DAT_00c33910 = 0; Sprite::RenderLayer((Sprite *)(in_ECX + 0xf),0,&g_vectorZero,&g_vectorZero,&g_vectorZero); DAT_00c33910 = 1; _glfw_context_reset(); ExceptionList = local_10; return; } get_random_floor_variant(); local_1c = (int *)(auStack_4a + -10); KAGE::SmartPointer::operator_assign(auStack_4a + -10,in_ECX + 0xd); local_18 = auStack_4a + -0x12; local_8 = 10; uStack_64 = 0x935602; KAGE::SmartPointer::operator_assign(auStack_4a + -0x12,in_ECX + 9); local_8 = CONCAT31(local_8._1_3_,0xb); shared_ptr::assign(&uStack_64,in_ECX); local_8 = 0xffffffff; render_floor_to_target(); ExceptionList = local_10; return; } Manager::LoadImage(ashImage,(byte *)"gfx/backdrop/04x_ashpit_ash.png"); local_8 = 0; KAGE::SmartPointer::SmartPointer(floorImage,(void *)0x0); local_8._0_1_ = 1; iVar1 = *(int *)((int)g_game->_room + 4); roomConfigData = *(int *)(iVar1 + 0x10); roomShape = *(int *)(roomConfigData + 0x48); if (roomShape - 9U < 4) { loadedImage = Manager::LoadImage(lFloorImage,(byte *)"gfx/backdrop/04x_ashpit_ash_Lfloor.png"); local_8._0_1_ = 2; KAGE::SmartPointer::operator_assign(floorImage,loadedImage); local_8._0_1_ = 3; if (local_1c == (int *)0x0) goto LAB_009354f2; isLastRef = (**(code **)(*local_1c + 0xc))(); } else { if (((iVar1 == 0) || (roomConfigData == 0)) || ((roomShape != 2 && (((roomShape != 3 && (roomShape != 5)) && (roomShape != 7)))))) goto LAB_009354f2; loadedImage = Manager::LoadImage(nFloorImage,(byte *)"gfx/backdrop/04x_ashpit_ash_Nfloor.png"); local_8._0_1_ = 4; KAGE::SmartPointer::operator_assign(floorImage,loadedImage); local_8._0_1_ = 5; if (nFloorImageRefCount == (int *)0x0) goto LAB_009354f2; isLastRef = (**(code **)(*nFloorImageRefCount + 0xc))(); } if ((isLastRef != '\0') && (g_imageReleaseFn != (code *)0x0)) { (*g_imageReleaseFn)(); } LAB_009354f2: local_8._0_1_ = 1; local_14 = auStack_4a + -10; KAGE::SmartPointer::operator_assign(auStack_4a + -10,floorImage); local_18 = auStack_4a + -0x12; local_8._0_1_ = 6; uStack_64 = 0x935518; KAGE::SmartPointer::operator_assign(auStack_4a + -0x12,ashImage); local_8._0_1_ = 7; shared_ptr::assign(&uStack_64,in_ECX); local_8._0_1_ = 1; render_floor_to_target(); KAGE::SmartPointer::reset(ashImage,(void *)0x0); KAGE::SmartPointer::reset(floorImage,(void *)0x0); local_8 = CONCAT31(local_8._1_3_,8); if (((floorImageRefCount != (int *)0x0) && (isLastRef = (**(code **)(*floorImageRefCount + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_8 = 9; if (((ashImageRefCount == (int *)0x0) || (isLastRef = (**(code **)(*ashImageRefCount + 0xc))(), isLastRef == '\0')) || (g_imageReleaseFn == (void *)0x0)) { ExceptionList = local_10; return; } (*g_imageReleaseFn)(); ExceptionList = local_10; return; } //@@ 009356a0 Backdrop::render_floor_to_target /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Backdrop::load_details helper 009353b0; SetRenderTarget+Clear, tiles 13x7 rects (0xd,7) and 2x2 corner pieces, RNG variant pick */ void __thiscall Backdrop::render_floor_to_target(void) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; Backdrop left; char cVar11; uint uVar12; void *pvVar13; undefined4 uVar14; float *pfVar15; float *pfVar16; undefined4 uVar17; void *in_ECX; KColor *color; 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; int extraout_ECX_13; int extraout_ECX_14; int extraout_ECX_15; int extraout_ECX_16; int extraout_ECX_17; int extraout_EDX; uint uVar18; Backdrop BVar19; code *drawFn; int iVar20; Backdrop *pBVar21; Backdrop right; float tileSize; int in_stack_00000004; RNG *in_stack_00000008; undefined4 uStack0000000c; int *in_stack_00000010; undefined4 uStack00000014; int *in_stack_00000018; undefined4 uStack0000001c; int *in_stack_00000020; undefined1 edgeDestQuad [112]; undefined1 destQuad [112]; float local_214; float fStack_210; float fStack_20c; float fStack_208; float local_204; float fStack_200; float fStack_1fc; float fStack_1f8; int local_1f4; float local_1f0; float fStack_1ec; float fStack_1e8; float fStack_1e4; float local_1e0; float fStack_1dc; float fStack_1d8; float fStack_1d4; int local_1d0; float local_1cc; float fStack_1c8; float fStack_1c4; float fStack_1c0; float local_1bc; float fStack_1b8; float fStack_1b4; float fStack_1b0; float local_1ac; float local_1a8; float fStack_1a4; float fStack_1a0; float fStack_19c; KColor white; RNG *rng; void *quadsBegin; SourceQuad *quadsEnd; SourceQuad *quadsCapacity; int gridHeight; Backdrop local_170; void *quads; Backdrop local_168; uint local_164; float local_160; float fStack_15c; float fStack_158; float fStack_154; float local_150; float fStack_14c; float fStack_148; float fStack_144; int local_140; uint local_13c; Backdrop local_138; char isNarrowRoom; Backdrop local_130; Backdrop *backdrop; undefined1 cornerQuads [32]; undefined1 local_108 [4]; undefined1 local_104 [36]; undefined1 local_e0 [36]; undefined1 local_bc [36]; undefined1 local_98 [36]; undefined1 local_74 [36]; float local_50 [11]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; undefined4 *lastQuad; undefined4 *pickedQuad; int quadColumn; RNG *rngRef; puStack_20 = (undefined1 *)(local_50 + 0x13); puStack_18 = &LAB_00b0b241; local_1c = ExceptionList; uVar12 = __security_cookie ^ (uint)(local_50 + 0x10); ExceptionList = &local_1c; rng = in_stack_00000008; local_14 = 2.8026e-45; pvVar13 = g_game->_room; local_164 = *(uint *)((int)pvVar13 + 0xc); gridHeight = *(int *)((int)pvVar13 + 0x10); iVar20 = *(int *)((int)pvVar13 + 4); if ((iVar20 == 0) || (quadColumn = *(int *)(iVar20 + 0x10), quadColumn == 0)) { quadColumn = *(int *)(iVar20 + 0x10); uVar18 = 1; } else { uVar18 = *(uint *)(quadColumn + 0x48); } local_130 = (Backdrop)(*(int *)(quadColumn + 0x48) + -9); if ((((uVar18 == 2) || (uVar18 == 3)) || (uVar18 == 7)) || (isNarrowRoom = '\0', uVar18 == 5)) { isNarrowRoom = '\x01'; } local_168 = (Backdrop)(*(int *)((int)in_ECX + 0x150) * 0x13c); local_13c = uVar18; backdrop = in_ECX; local_24 = uVar12; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,uStack0000000c,0); RenderTarget::Clear(&DAT_00c798e0); pBVar21 = backdrop; if (backdrop[0x54] == (Backdrop)0x0) { LAB_00937416: pBVar21 = backdrop; goto LAB_00935e76; } if (((backdrop[0x54] == (Backdrop)0xf) && (uVar18 != 1)) && ((3 < (uint)local_130 && (isNarrowRoom == '\0')))) { grid_rect_to_quad(cornerQuads,0xb,0xe,2,2); grid_rect_to_quad(local_104,0xd,0xe,2,2); grid_rect_to_quad(local_e0,0xd,0x10,2,2); grid_rect_to_quad(local_bc,0xb,0x10,2,2); grid_rect_to_quad(&local_1cc,0xf,0xe,1,1); local_168 = backdrop[0x13c7]; local_130 = backdrop[0x13c6]; if ((float)local_168 < (float)backdrop[0x13c9] - 0.001) { do { uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { drawFn = (code *)swi(3); (*drawFn)(); return; } } tileSize = 52.0; uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)in_stack_00000008->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift3 & 0x1f) ^ uVar12; in_stack_00000008->_seed = uVar12; local_170 = (Backdrop)(uVar12 & 3); drawFn = *(code **)(*uStack00000014 + 0x14); BVar19 = local_168; KColor::SetFromARGB(&white,0xffffffff); local_138 = (Backdrop)((float)BVar19 + tileSize); right = (Backdrop)((float)local_130 + tileSize); left = local_130; local_130 = right; pvVar13 = render_quad_set_uniform_color (destQuad,(float)left,(float)BVar19,(float)right,(float)local_138,color) ; (*drawFn)(cornerQuads + (int)local_170 * 0x24,pvVar13,g_drawRectUnset); if ((float)backdrop[0x13c8] - 0.001 < (float)local_130) { local_130 = backdrop[0x13c6]; local_168 = local_138; } in_stack_00000008 = rng; } while ((float)local_168 < (float)backdrop[0x13c9] - 0.001); } drawFn = *(code **)(*uStack00000014 + 0x14); uVar14 = render_grid_rect(destQuad,0,0,1,1); (*drawFn)(&local_1cc,uVar14,g_drawRectUnset); drawFn = *(code **)(*uStack00000014 + 0x14); render_grid_rect(destQuad,local_164 - 3,0,1,1); uVar14 = FUN_00931f50(&local_160,&local_1cc); (*drawFn)(uVar14,extraout_ECX,g_drawRectUnset); drawFn = *(code **)(*uStack00000014 + 0x14); render_grid_rect(destQuad,0,gridHeight + -3,1,1); uVar14 = FUN_00931fc0(&local_160,&local_1cc); (*drawFn)(uVar14,extraout_ECX_00,g_drawRectUnset); drawFn = *(code **)(*uStack00000014 + 0x14); render_grid_rect(destQuad,local_164 - 3,gridHeight + -3,1,1); pfVar15 = (float *)FUN_00932020(&local_160,&local_1cc); uVar14 = extraout_ECX_01; LAB_00935e6b: (*drawFn)(pfVar15,uVar14,g_drawRectUnset); } else if (*(char *)((int)((int)local_168 + 0x1c8) + (int)backdrop) == '\0') { if (((uint)local_130 < 4) && (uStack0000001c != (Backdrop)0x0)) { uVar12 = RNG::RandomInt(in_stack_00000008,2); pBVar21 = backdrop; if ((backdrop[0x54] == (Backdrop)0x2e) || (backdrop[0x54] == (Backdrop)0x3b)) { uVar12 = (uint)(in_stack_00000004 == 1); } iVar20 = uVar12 * 7; grid_rect_to_quad(local_98,0,iVar20,0xd,7); grid_rect_to_quad(local_74,0xd,iVar20,0xd,7); grid_rect_to_quad(local_50,0x1a,iVar20,0xd,7); if (local_13c == 0xb) { drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,0,0,0xd,7); (*drawFn)(local_98,uVar14,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,0xd,0,0xd,7); (*drawFn)(local_74,uVar14,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,0xd,7,0xd,7); pfVar15 = local_50; } else if (local_13c == 9) { drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0,7,0xd,7); uVar14 = FUN_00931fc0(&local_1cc,local_98); (*drawFn)(uVar14,extraout_ECX_03,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0xd,7,0xd,7); uVar14 = FUN_00931fc0(&local_1cc,local_74); (*drawFn)(uVar14,extraout_ECX_04,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0xd,0,0xd,7); pfVar15 = (float *)FUN_00931fc0(&local_1cc,local_50); uVar14 = extraout_ECX_05; } else { if (local_13c != 10) { if (local_13c != 0xc) goto LAB_00935e76; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0xd,0,0xd,7); uVar14 = FUN_00931f50(&local_1cc,local_98); (*drawFn)(uVar14,extraout_ECX_09,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0,0,0xd,7); uVar14 = FUN_00931f50(&local_1cc,local_74); (*drawFn)(uVar14,extraout_ECX_10,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0,7,0xd,7); pfVar15 = local_50; pfVar16 = &local_1cc; goto LAB_00935e5f; } drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0xd,7,0xd,7); uVar14 = FUN_00932020(&local_1cc,local_98); (*drawFn)(uVar14,extraout_ECX_06,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0,7,0xd,7); uVar14 = FUN_00932020(&local_1cc,local_74); (*drawFn)(uVar14,extraout_ECX_07,g_drawRectUnset); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0,0,0xd,7); pfVar15 = (float *)FUN_00932020(&local_1cc,local_50); uVar14 = extraout_ECX_08; } goto LAB_00935e6b; } if ((isNarrowRoom == '\0') || (uStack0000001c == (Backdrop)0x0)) { quads = (void *)0x0; quadsBegin = (void *)0x0; local_138 = (Backdrop)0x0; quadsEnd = (SourceQuad *)0x0; quadsCapacity = (SourceQuad *)0x0; local_14 = (float)CONCAT31(local_14._1_3_,3); tileSize = 26.0; if ((backdrop[0x54] == (Backdrop)0x10) || (backdrop[0x54] == (Backdrop)0x12)) { local_150 = 52.0; local_160 = 52.0; fStack_154 = 52.0; fStack_15c = 52.0; fStack_148 = 234.0; fStack_158 = 234.0; fStack_144 = 156.0; fStack_14c = 156.0; local_140._0_1_ = 1; std::vector::_Emplace_reallocate(0,&local_160); local_150 = 286.0; local_160 = 286.0; fStack_154 = 52.0; fStack_15c = 52.0; fStack_148 = 468.0; fStack_158 = 468.0; fStack_144 = 156.0; fStack_14c = 156.0; local_140 = CONCAT31(local_140._1_3_,1); if (quadsEnd == quadsCapacity) { std::vector::_Emplace_reallocate(quadsEnd,&local_160); } else { SourceQuad::SourceQuad(quadsEnd,&local_160); quadsEnd = (SourceQuad *)(extraout_ECX_13 + 0x24); } local_150 = 52.0; local_160 = 52.0; fStack_154 = 208.0; fStack_15c = 208.0; fStack_148 = 234.0; fStack_158 = 234.0; fStack_144 = 312.0; fStack_14c = 312.0; local_140 = CONCAT31(local_140._1_3_,1); if (quadsEnd == quadsCapacity) { std::vector::_Emplace_reallocate(quadsEnd,&local_160); } else { SourceQuad::SourceQuad(quadsEnd,&local_160); quadsEnd = (SourceQuad *)(extraout_ECX_14 + 0x24); } local_150 = 286.0; local_160 = 286.0; fStack_154 = 208.0; fStack_15c = 208.0; fStack_148 = 468.0; fStack_158 = 468.0; fStack_144 = 312.0; fStack_14c = 312.0; local_140 = CONCAT31(local_140._1_3_,1); if (quadsEnd == quadsCapacity) { std::vector::_Emplace_reallocate(quadsEnd,&local_160); } else { SourceQuad::SourceQuad(quadsEnd,&local_160); quadsEnd = (SourceQuad *)(extraout_ECX_15 + 0x24); } local_150 = 52.0; local_160 = 52.0; fStack_154 = 312.0; fStack_15c = 312.0; fStack_148 = 234.0; fStack_158 = 234.0; fStack_144 = 468.0; fStack_14c = 468.0; local_140 = CONCAT31(local_140._1_3_,1); if (quadsEnd == quadsCapacity) { std::vector::_Emplace_reallocate(quadsEnd,&local_160); } else { SourceQuad::SourceQuad(quadsEnd,&local_160); quadsEnd = (SourceQuad *)(extraout_ECX_16 + 0x24); } local_150 = 286.0; local_160 = 286.0; fStack_154 = 312.0; fStack_15c = 312.0; fStack_148 = 468.0; fStack_158 = 468.0; fStack_144 = 468.0; fStack_14c = 468.0; local_140 = CONCAT31(local_140._1_3_,1); if (quadsEnd == quadsCapacity) { std::vector::_Emplace_reallocate(quadsEnd,&local_160); } else { SourceQuad::SourceQuad(quadsEnd,&local_160); quadsEnd = (SourceQuad *)(extraout_ECX_17 + 0x24); } quads = quadsBegin; pvVar13 = quadsBegin; } else { iVar20 = *(int *)((int)((int)local_168 + 0x1c4) + (int)backdrop); uVar12 = iVar20 * in_stack_00000004; local_130 = (Backdrop)uVar12; if (uVar12 < iVar20 + uVar12) { do { local_140 = CONCAT31(local_140._1_3_,1); iVar20 = (uVar12 >> 1) * 6; quadColumn = (uVar12 & 1) * 9; fStack_15c = (float)(iVar20 + 2) * tileSize; local_160 = (float)(quadColumn + 2) * tileSize; fStack_158 = (float)(quadColumn + 9) * tileSize; fStack_14c = (float)(iVar20 + 6) * tileSize; fStack_154 = fStack_15c; local_150 = local_160; fStack_148 = fStack_158; fStack_144 = fStack_14c; if (quadsEnd == quadsCapacity) { std::vector::_Emplace_reallocate(quadsEnd,&local_160); tileSize = 26.0; } else { SourceQuad::SourceQuad(quadsEnd,&local_160); quadsEnd = (SourceQuad *)(extraout_EDX + 0x24); } uVar12 = uVar12 + 1; } while (uVar12 < (uint)(*(int *)((int)((int)local_168 + 0x1c4) + (int)pBVar21) + (int)local_130)); quads = quadsBegin; in_stack_00000008 = rng; local_138 = (Backdrop)quadsEnd; } quadsBegin = quads; quadsEnd = (SourceQuad *)local_138; if ((uint)(((int)local_138 - (int)quads) / 0x24) < 0x20) { do { std::vector<36byte>::_Insert_range(quadsEnd,quadsBegin,quadsEnd,local_170); } while ((uint)(((int)quadsEnd - (int)quadsBegin) / 0x24) < 0x20); local_138 = (Backdrop)quadsEnd; quads = quadsBegin; in_stack_00000008 = rng; } pvVar13 = quads; local_130 = (Backdrop)(((int)local_138 - (int)quads) / 0x24); local_168 = (Backdrop)((int)local_130 - 1); quadsBegin = quads; quadsEnd = (SourceQuad *)local_138; if (0 < (int)local_168) { local_138 = (Backdrop)((int)local_168 * 0x24); do { uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { drawFn = (code *)swi(3); (*drawFn)(); return; } } uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)in_stack_00000008->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift3 & 0x1f) ^ uVar12; uVar18 = 0; in_stack_00000008->_seed = uVar12; if (local_130 != (Backdrop)0x0) { uVar18 = uVar12 % (uint)local_130; } pickedQuad = (undefined4 *)((int)pvVar13 + uVar18 * 0x24); uVar17 = pickedQuad[1]; uVar1 = pickedQuad[2]; uVar2 = pickedQuad[3]; local_130 = (Backdrop)((int)local_130 - 1); uVar14 = *(undefined4 *)((int)local_138 + 0x20 + (int)pvVar13); lastQuad = (undefined4 *)((int)local_138 + (int)pvVar13); uVar3 = *lastQuad; uVar4 = lastQuad[1]; uVar5 = lastQuad[2]; uVar6 = lastQuad[3]; lastQuad = (undefined4 *)((int)local_138 + 0x10 + (int)pvVar13); uVar7 = *lastQuad; uVar8 = lastQuad[1]; uVar9 = lastQuad[2]; uVar10 = lastQuad[3]; lastQuad = (undefined4 *)((int)local_138 + (int)pvVar13); *lastQuad = *pickedQuad; lastQuad[1] = uVar17; lastQuad[2] = uVar1; lastQuad[3] = uVar2; pickedQuad = (undefined4 *)((int)pvVar13 + uVar18 * 0x24 + 0x10); uVar17 = pickedQuad[1]; uVar1 = pickedQuad[2]; uVar2 = pickedQuad[3]; lastQuad = (undefined4 *)((int)local_138 + 0x10 + (int)pvVar13); *lastQuad = *pickedQuad; lastQuad[1] = uVar17; lastQuad[2] = uVar1; lastQuad[3] = uVar2; *(undefined4 *)((int)local_138 + 0x20 + (int)pvVar13) = *(undefined4 *)((int)pvVar13 + uVar18 * 0x24 + 0x20); pickedQuad = (undefined4 *)((int)pvVar13 + uVar18 * 0x24); *pickedQuad = uVar3; pickedQuad[1] = uVar4; pickedQuad[2] = uVar5; pickedQuad[3] = uVar6; pickedQuad = (undefined4 *)((int)pvVar13 + uVar18 * 0x24 + 0x10); *pickedQuad = uVar7; pickedQuad[1] = uVar8; pickedQuad[2] = uVar9; pickedQuad[3] = uVar10; *(undefined4 *)((int)pvVar13 + uVar18 * 0x24 + 0x20) = uVar14; local_168 = (Backdrop)((int)local_168 + -1); in_stack_00000008 = rng; local_138 = (Backdrop)((int)local_138 + -0x24); } while (0 < (int)local_168); } } local_138 = (Backdrop)(local_164 - 9); if ((backdrop[0x54] == (Backdrop)0x10) || (backdrop[0x54] == (Backdrop)0x12)) { gridHeight = gridHeight + -5; } else { gridHeight = gridHeight + -6; } uVar12 = 0xffffffff; local_130 = (Backdrop)0x0; local_164 = 0xffffffff; local_170 = (Backdrop)0x7; if (gridHeight < 1) { local_164 = 0xffffffff; } else { do { if ((local_130 == (Backdrop)0x3) && (4 < gridHeight)) { local_130 = (Backdrop)0x4; } local_168 = (Backdrop)0x0; BVar19 = local_130; if (0 < (int)local_138) { do { rngRef = rng; if ((local_168 == (Backdrop)0x6) && (7 < (int)local_138)) { local_168 = local_170; } if (local_13c == 9) { if (4 < (int)BVar19) goto LAB_009369d2; if (7 < (int)local_168) goto LAB_009369d2; } else { if (local_13c == 10) { if ((int)BVar19 < 5) { LAB_009369c9: if (7 < (int)local_168) goto LAB_00936d40; } } else if (local_13c == 0xb) { if ((4 < (int)BVar19) && ((int)local_168 < 8)) goto LAB_00936d40; } else if ((local_13c == 0xc) && (4 < (int)BVar19)) goto LAB_009369c9; LAB_009369d2: if ((backdrop[0x54] == (Backdrop)0x10) || (pvVar13 = quads, backdrop[0x54] == (Backdrop)0x12)) { uVar12 = rng->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = rngRef->_seed; if (uVar12 == 0) { drawFn = (code *)swi(3); (*drawFn)(); return; } } uVar12 = uVar12 >> ((byte)rngRef->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)rngRef->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)rngRef->_shift3 & 0x1f) ^ uVar12; rngRef->_seed = uVar12; local_164 = uVar12 & 3; BVar19 = local_130; } else { local_164 = uVar12 + 1; } if (((int)local_168 < 1) || ((int)BVar19 < 1)) { if ((int)local_168 < 1) { if ((int)BVar19 < 1) { pfVar15 = (float *)((int)pvVar13 + local_164 * 0x24); local_1f0 = *pfVar15; fStack_1ec = pfVar15[1]; fStack_1e8 = pfVar15[2]; fStack_1e4 = pfVar15[3]; pfVar15 = (float *)((int)pvVar13 + local_164 * 0x24 + 0x10); local_1e0 = *pfVar15; fStack_1dc = pfVar15[1]; fStack_1d8 = pfVar15[2]; fStack_1d4 = pfVar15[3]; local_1d0 = *(int *)((int)pvVar13 + local_164 * 0x24 + 0x20); } else { local_1f0 = *(float *)((int)pvVar13 + local_164 * 0x24); fStack_1ec = *(float *)((int)pvVar13 + local_164 * 0x24 + 0x14); fStack_1e8 = *(float *)((int)pvVar13 + local_164 * 0x24 + 0x18); fStack_1dc = *(float *)((int)pvVar13 + local_164 * 0x24 + 0xc); local_140 = CONCAT31(local_140._1_3_,1); local_1d0 = local_140; fStack_1e4 = fStack_1ec; local_1e0 = local_1f0; fStack_1d8 = fStack_1e8; fStack_1d4 = fStack_1dc; local_160 = local_1f0; fStack_15c = fStack_1ec; fStack_158 = fStack_1e8; fStack_154 = fStack_1ec; local_150 = local_1f0; fStack_14c = fStack_1dc; fStack_148 = fStack_1e8; fStack_144 = fStack_1dc; } } else { local_1f0 = *(float *)((int)pvVar13 + local_164 * 0x24 + 8); fStack_1ec = *(float *)((int)pvVar13 + local_164 * 0x24 + 4); fStack_1e8 = *(float *)((int)pvVar13 + local_164 * 0x24 + 0x10); fStack_1dc = *(float *)((int)pvVar13 + local_164 * 0x24 + 0x1c); local_140 = CONCAT31(local_140._1_3_,1); local_1d0 = local_140; fStack_1e4 = fStack_1ec; local_1e0 = local_1f0; fStack_1d8 = fStack_1e8; fStack_1d4 = fStack_1dc; local_160 = local_1f0; fStack_15c = fStack_1ec; fStack_158 = fStack_1e8; fStack_154 = fStack_1ec; local_150 = local_1f0; fStack_14c = fStack_1dc; fStack_148 = fStack_1e8; fStack_144 = fStack_1dc; } } else { local_140 = CONCAT31(local_140._1_3_,1); local_1f0 = *(float *)((int)pvVar13 + local_164 * 0x24 + 8); fStack_1ec = *(float *)((int)pvVar13 + local_164 * 0x24 + 0x14); fStack_1e8 = *(float *)((int)pvVar13 + local_164 * 0x24 + 0x10); fStack_1dc = *(float *)((int)pvVar13 + local_164 * 0x24 + 0xc); local_1d0 = local_140; fStack_1e4 = fStack_1ec; local_1e0 = local_1f0; fStack_1d8 = fStack_1e8; fStack_1d4 = fStack_1dc; local_160 = local_1f0; fStack_15c = fStack_1ec; fStack_158 = fStack_1e8; fStack_154 = fStack_1ec; local_150 = local_1f0; fStack_14c = fStack_1dc; fStack_148 = fStack_1e8; fStack_144 = fStack_1dc; } white._red = 1.0; white._green = 1.0; white._blue = 1.0; white._alpha = 1.0; white._unk = 0; drawFn = *(code **)(*uStack00000014 + 0x14); render_quad_set_uniform_color (local_98,(float)(int)local_168 * 26.0 + (float)backdrop[0x13c6], (float)(int)BVar19 * 26.0 + (float)backdrop[0x13c7], (float)((int)local_168 + 7) * 26.0 + (float)backdrop[0x13c6], (float)((int)BVar19 + 4) * 26.0 + (float)backdrop[0x13c7],&white); (*drawFn)(&local_1f0,local_98,g_drawRectUnset); uVar12 = local_164; BVar19 = local_130; in_stack_00000008 = rng; } LAB_00936d40: local_168 = (Backdrop)((int)local_168 + 6); pvVar13 = quads; } while ((int)local_168 < (int)local_138); } local_130 = (Backdrop)((int)BVar19 + 3); pvVar13 = quads; } while ((int)local_130 < gridHeight); local_130 = (Backdrop)0x0; do { if ((local_130 == (Backdrop)0x3) && (4 < gridHeight)) { local_130 = (Backdrop)0x4; } if (local_13c == 0xc) { if ((int)local_130 < 5) goto LAB_00936dba; } else if ((local_13c != 10) || (4 < (int)local_130)) { LAB_00936dba: if ((backdrop[0x54] == (Backdrop)0x10) || (backdrop[0x54] == (Backdrop)0x12)) { uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { drawFn = (code *)swi(3); (*drawFn)(); return; } } uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)in_stack_00000008->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift3 & 0x1f) ^ uVar12; in_stack_00000008->_seed = uVar12; local_164 = uVar12 & 3; } else { local_164 = uVar12 + 1; } local_214 = *(float *)((int)quads + local_164 * 0x24 + 8); fStack_20c = *(float *)((int)quads + local_164 * 0x24 + 0x10); local_140 = CONCAT31(local_140._1_3_,1); if ((int)local_130 < 1) { fStack_210 = *(float *)((int)quads + local_164 * 0x24 + 4); fStack_200 = *(float *)((int)quads + local_164 * 0x24 + 0x1c); } else { fStack_210 = *(float *)((int)quads + local_164 * 0x24 + 0x14); fStack_200 = *(float *)((int)quads + local_164 * 0x24 + 0xc); } local_1f4 = local_140; white._unk = 0; white._red = 1.0; white._green = 1.0; white._blue = 1.0; white._alpha = 1.0; drawFn = *(code **)(*uStack00000014 + 0x14); fStack_208 = fStack_210; local_204 = local_214; fStack_1fc = fStack_20c; fStack_1f8 = fStack_200; local_160 = local_214; fStack_15c = fStack_210; fStack_158 = fStack_20c; fStack_154 = fStack_210; local_150 = local_214; fStack_14c = fStack_200; fStack_148 = fStack_20c; fStack_144 = fStack_200; render_quad_set_uniform_color (edgeDestQuad,(float)(int)local_138 * 26.0 + (float)backdrop[0x13c6], (float)(int)local_130 * 26.0 + (float)backdrop[0x13c7], (float)((int)local_138 + 7) * 26.0 + (float)backdrop[0x13c6], (float)((int)local_130 + 4) * 26.0 + (float)backdrop[0x13c7],&white); (*drawFn)(&local_214,edgeDestQuad,g_drawRectUnset); } local_130 = (Backdrop)((int)local_130 + 3); uVar12 = local_164; in_stack_00000008 = rng; } while ((int)local_130 < gridHeight); } local_130 = (Backdrop)0x0; if (0 < (int)local_138) { do { if ((local_130 == (Backdrop)0x6) && (7 < (int)local_138)) { local_130 = local_170; } if (local_13c == 0xc) { if ((int)local_130 < 8) goto LAB_0093704c; } else if ((local_13c != 0xb) || (7 < (int)local_130)) { LAB_0093704c: if ((backdrop[0x54] == (Backdrop)0x10) || (backdrop[0x54] == (Backdrop)0x12)) { uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar12 = in_stack_00000008->_seed; if (uVar12 == 0) { drawFn = (code *)swi(3); (*drawFn)(); return; } } uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift1 & 0x1f) ^ uVar12; uVar12 = uVar12 << ((byte)in_stack_00000008->_shift2 & 0x1f) ^ uVar12; uVar12 = uVar12 >> ((byte)in_stack_00000008->_shift3 & 0x1f) ^ uVar12; in_stack_00000008->_seed = uVar12; local_164 = (uVar12 & 1) + 4; } else { local_164 = local_164 + 1; } fStack_1a4 = *(float *)((int)quads + local_164 * 0x24 + 0x14); fStack_14c = *(float *)((int)quads + local_164 * 0x24 + 0xc); white._unk = CONCAT31(white._unk._1_3_,1); if ((int)local_130 < 1) { local_1a8 = *(float *)((int)quads + local_164 * 0x24); fStack_1a0 = *(float *)((int)quads + local_164 * 0x24 + 0x18); } else { local_1a8 = *(float *)((int)quads + local_164 * 0x24 + 8); fStack_1a0 = *(float *)((int)quads + local_164 * 0x24 + 0x10); } local_140 = white._unk; white._unk = 0; white._red = 1.0; white._green = 1.0; white._blue = 1.0; white._alpha = 1.0; drawFn = *(code **)(*uStack00000014 + 0x14); fStack_19c = fStack_1a4; local_160 = local_1a8; fStack_15c = fStack_1a4; fStack_158 = fStack_1a0; fStack_154 = fStack_1a4; local_150 = local_1a8; fStack_148 = fStack_1a0; fStack_144 = fStack_14c; render_quad_set_uniform_color (local_108,(float)(int)local_130 * 26.0 + (float)backdrop[0x13c6], (float)gridHeight * 26.0 + (float)backdrop[0x13c7], (float)((int)local_130 + 7) * 26.0 + (float)backdrop[0x13c6], (float)(gridHeight + 4) * 26.0 + (float)backdrop[0x13c7],&white); (*drawFn)(&local_160,local_108,g_drawRectUnset); } local_130 = (Backdrop)((int)local_130 + 6); in_stack_00000008 = rng; } while ((int)local_130 < (int)local_138); } if (local_13c != 0xc) { white._red = 1.0; white._green = 1.0; white._blue = 1.0; white._alpha = 1.0; white._unk = 0; drawFn = *(code **)(*uStack00000014 + 0x14); render_quad_set_uniform_color (destQuad,(float)(int)local_138 * 26.0 + (float)backdrop[0x13c6], (float)gridHeight * 26.0 + (float)backdrop[0x13c7], (float)((int)local_138 + 7) * 26.0 + (float)backdrop[0x13c6], (float)(gridHeight + 4) * 26.0 + (float)backdrop[0x13c7],&white); local_1cc = *(float *)((int)quads + local_164 * 0x24 + 8); fStack_1c8 = *(float *)((int)quads + local_164 * 0x24 + 0x14); fStack_1c4 = *(float *)((int)quads + local_164 * 0x24 + 0x10); fStack_1b8 = *(float *)((int)quads + local_164 * 0x24 + 0xc); local_1ac = (float)CONCAT31(local_1ac._1_3_,1); fStack_1c0 = fStack_1c8; local_1bc = local_1cc; fStack_1b4 = fStack_1c4; fStack_1b0 = fStack_1b8; (*drawFn)(&local_1cc,destQuad,g_drawRectUnset); } local_14 = (float)CONCAT31(local_14._1_3_,2); if (quads != (void *)0x0) { uVar12 = (((int)quadsCapacity - (int)quads) / 0x24) * 0x24; pvVar13 = quads; if (0xfff < uVar12) { pvVar13 = *(void **)((int)quads + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)quads + (-4 - (int)pvVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar13,uVar12); } } else { local_13c = RNG::RandomInt(in_stack_00000008,2); if ((backdrop[0x54] == (Backdrop)0x2e) || (backdrop[0x54] == (Backdrop)0x3b)) { local_13c = (uint)(in_stack_00000004 == 1); } if (uVar18 != 2) { if (uVar18 == 7) { grid_rect_to_quad(&local_1cc,0,local_13c * 3 + 7,0xd,3); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,0,2,0xd,3); (*drawFn)(&local_1cc,uVar14,g_drawRectUnset); pfVar15 = (float *)grid_rect_to_quad(&local_160,0,local_13c * 3 + 7,0xd,3); local_1cc = *pfVar15; fStack_1c8 = pfVar15[1]; fStack_1c4 = pfVar15[2]; fStack_1c0 = pfVar15[3]; local_1bc = pfVar15[4]; fStack_1b8 = pfVar15[5]; fStack_1b4 = pfVar15[6]; fStack_1b0 = pfVar15[7]; local_1ac = pfVar15[8]; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,0xd,2,0xd,3); pfVar15 = &local_1cc; pfVar16 = &local_160; LAB_00935e5f: pfVar15 = (float *)FUN_00931f50(pfVar16,pfVar15); uVar14 = extraout_ECX_11; } else { if (uVar18 == 3) { local_170 = uStack0000001c; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,4,0,5,6); uVar17 = grid_rect_to_quad(&local_1cc,local_13c * 5,0,5,6); (*drawFn)(uVar17,uVar14,g_drawRectUnset); local_170 = uStack0000001c; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,4,6,5,1); uVar17 = grid_rect_to_quad(&local_1cc,local_13c * 5,0,5,1); uVar17 = FUN_00931fc0(&local_160,uVar17); (*drawFn)(uVar17,uVar14,g_drawRectUnset); goto LAB_00935e70; } if (uVar18 != 5) goto LAB_00937416; grid_rect_to_quad(&local_1cc,local_13c * 5,0,5,7); drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,4,0,5,7); (*drawFn)(&local_1cc,uVar14,g_drawRectUnset); pfVar15 = (float *)grid_rect_to_quad(&local_160,local_13c * 5,0,5,7); local_1cc = *pfVar15; fStack_1c8 = pfVar15[1]; fStack_1c4 = pfVar15[2]; fStack_1c0 = pfVar15[3]; local_1bc = pfVar15[4]; fStack_1b8 = pfVar15[5]; fStack_1b4 = pfVar15[6]; fStack_1b0 = pfVar15[7]; local_1ac = pfVar15[8]; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); render_grid_rect(destQuad,4,7,5,7); pfVar15 = (float *)FUN_00931fc0(&local_160,&local_1cc); uVar14 = extraout_ECX_12; } goto LAB_00935e6b; } local_170 = uStack0000001c; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,0,2,0xc,3); uVar17 = grid_rect_to_quad(&local_1cc,0,local_13c * 3 + 7,0xc,3); (*drawFn)(uVar17,uVar14,g_drawRectUnset); local_170 = uStack0000001c; drawFn = *(code **)(*(int *)uStack0000001c + 0x14); uVar14 = render_grid_rect(destQuad,0xc,2,1,3); uVar17 = grid_rect_to_quad(&local_1cc,0,local_13c * 3 + 7,1,3); uVar17 = FUN_00931f50(&local_160,uVar17); (*drawFn)(uVar17,uVar14,g_drawRectUnset); } } else { drawFn = *(code **)(*uStack00000014 + 0x20); KColor::SetFromARGB(&white,0xffffffff); (*drawFn)(&g_vectorZero,extraout_ECX_02,uVar12); } LAB_00935e70: pBVar21 = backdrop; LAB_00935e76: iVar20 = g_game->_startingRoomIdx; if ((g_game->_stage - 1U < 6) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { iVar20 = 0x54; } if ((((g_game->_stage == 1) && (g_game->_stageType != 4)) && (g_game->_stageType != 5)) && (iVar20 == g_game->_currentRoomIdx)) { PreRenderControls(pBVar21); } _glfw_context_reset(1); local_14._0_1_ = 4; if (((in_stack_00000010 != (int *)0x0) && (cVar11 = (**(code **)(*in_stack_00000010 + 0xc))(), cVar11 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&uStack0000000c); } local_14 = (float)CONCAT31(local_14._1_3_,5); if (((in_stack_00000018 != (int *)0x0) && (cVar11 = (**(code **)(*in_stack_00000018 + 0xc))(), cVar11 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&uStack00000014); } local_14 = 8.40779e-45; if (((in_stack_00000020 != (int *)0x0) && (cVar11 = (**(code **)(*in_stack_00000020 + 0xc))(), cVar11 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&uStack0000001c); } ExceptionList = local_1c; return; } //@@ 00937420 Backdrop::pre_render_walls /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Switch with 1 destination removed at 0x00937fa4 */ /* DB: REPENTOGON name; room=Backdrop: configurations[backdropId] (+0x154 stride 0x13c) .walls (+0x64) ==0 early-out, RenderTarget::Clear, per-backdrop switch (0x14 greed), Room::GetRoomShape; called by Backdrop::load_details; sig differs only by prologue/frame size prototype: REPENTOGON */ void __cdecl Backdrop::pre_render_walls(void) { int iVar1; byte isHorizontalNarrow; char isPreAscentMomRoom; uint uVar3; Entity *spawnedEffect; Backdrop BVar4; float *quad; undefined4 *srcBuf; Backdrop *in_ECX; int iVar5; RNG *rng; KColor *color; KColor *color_00; KColor *extraout_ECX; KColor *color_01; KColor *extraout_ECX_00; KColor *color_02; KColor *extraout_ECX_01; KColor *color_03; KColor *color_04; KColor *color_05; KColor *color_06; KColor *color_07; KColor *color_08; uint uVar6; KColor *color_09; KColor *color_10; Backdrop *pBVar7; int *extraout_EDX; ushort uVar10; int *piVar8; ushort extraout_var; ushort extraout_var_00; Backdrop *pBVar9; int iVar11; code *pcVar12; undefined4 *dstBuf; float fVar13; void *pvVar14; float fVar15; float left; float right; undefined4 uVar16; TypeDescriptor *pTVar17; TypeDescriptor *pTVar18; undefined4 uVar19; KColor *color_11; undefined1 auStack_8f8 [112]; undefined1 auStack_888 [112]; undefined1 auStack_818 [112]; undefined1 auStack_7a8 [112]; undefined1 auStack_738 [112]; undefined1 auStack_6c8 [112]; undefined1 auStack_658 [112]; undefined1 auStack_5e8 [112]; undefined1 auStack_578 [112]; undefined1 auStack_508 [112]; undefined1 auStack_498 [112]; undefined4 auStack_428 [28]; undefined4 local_3b8 [29]; float fStack_344; float fStack_340; float fStack_33c; float fStack_338; float fStack_334; float fStack_330; float fStack_32c; float fStack_328; undefined1 uStack_324; undefined4 auStack_320 [28]; float local_2b0; float local_2ac; float local_2a8; float local_2a4; float local_2a0; float local_29c; float local_298; float local_294; undefined1 local_290; int shapeMaxY; int shapeMinY; int shapeMinX; float local_280; int *piStack_27c; float fStack_278; int *piStack_274; float local_270; int *piStack_26c; float fStack_268; int *piStack_264; uint local_260; Vector local_25c; RNG *wallRng; float local_250; int *local_24c; float local_248; int *local_244; float local_240; int *local_23c; float local_238; int *local_234; uint local_230; float fStack_22c; float fStack_228; float fStack_224; float fStack_220; float fStack_21c; float fStack_218; float fStack_214; float fStack_210; float fStack_20c; float fStack_208; float fStack_204; undefined1 uStack_200; int local_1fc; int gridHeight; float fStack_1f4; float fStack_1f0; float fStack_1ec; float fStack_1e8; KColor local_1e4; int gridWidth; float local_1cc; float local_1c8; int roomShape; uint local_1c0; float local_1bc; float local_1b8; float local_1b4; int *local_1b0; float local_1ac; Backdrop local_1a8; Backdrop *local_1a4; BackdropConfig config; char local_60 [8]; float fStack_58; int *piStack_54; float local_50; int *piStack_4c; float fStack_48; int *piStack_44; float local_40; int *local_3c; undefined4 local_38; undefined1 local_34 [12]; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; bool isHorizontalNarrow; Backdrop room; puStack_20 = local_34 + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b280; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_34 + 0x24); if (in_ECX[(int)in_ECX[0x54] * 0x4f + 0x6e] == (Backdrop)0x0) { return; } ExceptionList = &local_1c; local_1a4 = in_ECX; BackdropConfig::copy_constructor(in_ECX + (int)in_ECX[0x54] * 0x4f + 0x55); local_14 = 0; iVar5 = *(int *)((int)g_game->_room + 4); if ((iVar5 == 0) || (iVar5 = *(int *)(iVar5 + 0x10), iVar5 == 0)) { iVar5 = 1; } else { iVar5 = *(int *)(iVar5 + 0x48); } roomShape = iVar5; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)in_ECX[2],0); iVar5 = iVar5 * 0x20; shapeMinX = *(int *)(&DAT_00c35b80 + iVar5); shapeMinY = *(int *)(&DAT_00c35b84 + iVar5); local_1fc = *(int *)(&DAT_00c35b88 + iVar5); shapeMaxY = *(int *)(&DAT_00c35b8c + iVar5); local_1e4._green = *(float *)(&DAT_00c35b90 + iVar5); local_1e4._blue = *(float *)(&DAT_00c35b94 + iVar5); local_1e4._alpha = *(float *)(&DAT_00c35b98 + iVar5); local_1e4._unk = *(int *)(&DAT_00c35b9c + iVar5); RenderTarget::Clear(&DAT_00c798e0); room = in_ECX[0x54]; if ((room == (Backdrop)0x0) || ((char)config.unk1 != '\0')) goto LAB_0093b1df; local_1cc = 4.2039e-45; if (room == (Backdrop)0x14) { local_1a8 = (Backdrop)g_game->_room; room = (Backdrop)0x14; if (((std_vector *)&((Room *)local_1a8)->_roomType)->_begin != (void *)0x2) { isHorizontalNarrow = Game::IsGreedMode(g_game); room = in_ECX[0x54]; if (isHorizontalNarrow == 0) goto LAB_009375f3; } switch(*(int *)((int)local_1a8 + 0x7068)) { default: config.wallVariants = 1; break; case 2: local_1cc = 5.60519e-45; break; case 3: local_1cc = 4.2039e-45; break; case 4: local_1cc = 2.8026e-45; break; case 5: local_1cc = 1.4013e-45; } pBVar7 = in_ECX + (int)room * 0x4f + 0x6e; LAB_009375b6: room = *pBVar7; rng = (RNG *)(in_ECX + 0x13ca); LAB_0093767c: local_1ac = (float)RNG::RandomInt(rng,(uint)room); } else { LAB_009375f3: local_1a8 = (Backdrop)(in_ECX + (int)room * 0x4f); if ((room != (Backdrop)0x2e) && (room != (Backdrop)0x3b)) { pBVar7 = (Backdrop *)(((Room *)local_1a8)->_gridEntities + 0x65); if (room != (Backdrop)0x2f) goto LAB_009375b6; local_34._0_4_ = in_ECX[0x13ce]; room = *pBVar7; LAB_0093766c: local_28 = 3.78351e-44; rng = (RNG *)local_34; local_34._4_4_ = 4; local_34._8_4_ = 3; goto LAB_0093767c; } if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) & 0x1000) == 0) { local_34._0_4_ = in_ECX[0x13ce]; room = *(Backdrop *)(((Room *)local_1a8)->_gridEntities + 0x65); goto LAB_0093766c; } local_1ac = 1.4013e-45; } iVar5 = config.wallVariants; room = in_ECX[0x54]; if (room == (Backdrop)0x1) { if (*(int *)((int)g_game->_room + 8) == 5) { config.wallVariants = 1; pvVar14 = g_game->_room; local_1ac = (float)iVar5; local_1a8 = *(Backdrop *)((int)pvVar14 + 0x14); local_1b8 = *(float *)((int)pvVar14 + 0x18); local_1b4 = *(float *)((int)pvVar14 + 0x1c); local_1bc = *(float *)((int)pvVar14 + 0x20); if (0 < *(int *)((int)pvVar14 + 0x10) * *(int *)((int)pvVar14 + 0xc)) { iVar5 = 0; do { room = in_ECX[0x13ca]; if (room == (Backdrop)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); room = in_ECX[0x13ca]; if (room == (Backdrop)0x0) { pcVar12 = (code *)swi(3); (*pcVar12)(); return; } } uVar3 = (uint)room >> (SUB41(in_ECX[0x13cb],0) & 0x1f) ^ (uint)room; uVar3 = uVar3 << (SUB41(in_ECX[0x13cc],0) & 0x1f) ^ uVar3; room = (Backdrop)(uVar3 >> (SUB41(in_ECX[0x13cd],0) & 0x1f) ^ uVar3); in_ECX[0x13ca] = room; if (((uint)room & 1) != 0) { iVar11 = *(int *)((int)g_game->_room + 0xc); local_25c.x = (float)(iVar5 % iVar11) * 40.0 + 40.0; local_25c.y = (float)(iVar5 / iVar11) * 40.0 + 120.0; fVar13 = local_25c.y; if (local_25c.y <= local_1b8 + 20.0) { fVar13 = local_1b8 + 20.0; } if (local_1bc - 20.0 <= fVar13) { fVar13 = local_1bc - 20.0; } fVar15 = local_25c.x; if (local_25c.x <= (float)local_1a8 + 20.0) { fVar15 = (float)local_1a8 + 20.0; } if (local_1b4 - 20.0 <= fVar15) { fVar15 = local_1b4 - 20.0; } if ((fVar15 == local_25c.x) && (fVar13 == local_25c.y)) { uVar3 = Random(); uVar19 = 0; pTVar18 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar16 = 0; spawnedEffect = Game::Spawn(g_game,1000,7,&local_25c,&g_vectorZero,(Entity *)0x0,0,uVar3); local_1b0 = (int *)__RTDynamicCast(spawnedEffect,uVar16,pTVar17,pTVar18,uVar19); room = in_ECX[0x13ca]; if (room == (Backdrop)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); room = in_ECX[0x13ca]; if (room == (Backdrop)0x0) { pcVar12 = (code *)swi(3); (*pcVar12)(); return; } } uVar3 = (uint)room >> (SUB41(in_ECX[0x13cb],0) & 0x1f) ^ (uint)room; uVar3 = uVar3 << (SUB41(in_ECX[0x13cc],0) & 0x1f) ^ uVar3; room = (Backdrop)(uVar3 >> (SUB41(in_ECX[0x13cd],0) & 0x1f) ^ uVar3); in_ECX[0x13ca] = room; fVar15 = (float)((double)(int)room + __uint_to_double_fixup[-((int)room >> 0x1f)]) * 2.3283062e-10 * 2.5 + 0.5; fVar13 = fVar15 * g_vectorOne.x; local_1b0[0x3a] = (int)(fVar15 * g_vectorOne.y); local_1b0[0x39] = (int)fVar13; (**(code **)(*local_1b0 + 0xc))(); } } iVar5 = iVar5 + 1; } while (iVar5 < *(int *)((int)g_game->_room + 0x10) * *(int *)((int)g_game->_room + 0xc)); room = in_ECX[0x54]; goto LAB_00937981; } } LAB_009379ce: isPreAscentMomRoom = Room::is_pre_ascent_mom_room(); if ((isPreAscentMomRoom == '\0') || (isHorizontalNarrow = Level::IsAscent((Level *)g_game), isHorizontalNarrow != 0)) goto LAB_00937cb8; } else { LAB_00937981: if (room == (Backdrop)0x2d) { if ((*(float *)((int)g_game->_room + 0x7460) != g_vectorZero.x) || (*(float *)((int)g_game->_room + 0x7464) != g_vectorZero.y)) { local_1ac = (float)config.walls; } goto LAB_009379ce; } if ((room != (Backdrop)0x1e) && (room != (Backdrop)0x27)) goto LAB_009379ce; } local_1a8 = (Backdrop)g_game->_room; local_1b4 = (float)(((Room *)local_1a8)->_gridHeight * ((Room *)local_1a8)->_gridWidth); Room::GetCenterPos(&local_25c); room = local_1a8; local_1b8 = 0.0; if (0 < (int)local_1b4) { do { fVar13 = (float)((int)local_1b8 % *(int *)((int)room + 0xc)) * 40.0 + 40.0; local_28 = (float)((int)local_1b8 / *(int *)((int)room + 0xc)) * 40.0 + 120.0; local_34._8_4_ = fVar13; local_1b0 = (int *)(local_28 - local_25c.y); local_1c8 = (fVar13 - local_25c.x) * 0.6; iVar5 = Room::GetRoomShape((Room *)room); if ((iVar5 == 2) || (((*(void **)((int)room + 4) != (void *)0x0 && (iVar5 = *(int *)((int)*(void **)((int)room + 4) + 0x10), iVar5 != 0)) && (*(int *)(iVar5 + 0x48) == 7)))) { local_1b0 = (int *)((float)local_1b0 + (float)local_1b0); } iVar5 = Room::GetRoomShape((Room *)room); if ((iVar5 == 3) || (((*(void **)((int)room + 4) != (void *)0x0 && (iVar5 = *(int *)((int)*(void **)((int)room + 4) + 0x10), iVar5 != 0)) && (*(int *)(iVar5 + 0x48) == 5)))) { local_1c8 = local_1c8 + local_1c8; } BVar4 = in_ECX[0x13ca]; if (BVar4 == (Backdrop)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); BVar4 = in_ECX[0x13ca]; if (BVar4 == (Backdrop)0x0) { pcVar12 = (code *)swi(3); (*pcVar12)(); return; } } uVar3 = (uint)BVar4 >> (SUB41(in_ECX[0x13cb],0) & 0x1f) ^ (uint)BVar4; uVar3 = uVar3 << (SUB41(in_ECX[0x13cc],0) & 0x1f) ^ uVar3; BVar4 = (Backdrop)(uVar3 >> (SUB41(in_ECX[0x13cd],0) & 0x1f) ^ uVar3); in_ECX[0x13ca] = BVar4; if ((((uint)BVar4 & 1) != 0) && (fVar13 = sqrtf((float)local_1b0 * (float)local_1b0 + local_1c8 * local_1c8), fVar13 < 100.0)) { uVar3 = Random(); local_1a8 = (Backdrop) Game::Spawn(g_game,1000,7,(Vector *)(local_34 + 8),&g_vectorZero,(Entity *)0x0,0 ,uVar3); BVar4 = in_ECX[0x13ca]; if (BVar4 == (Backdrop)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); BVar4 = in_ECX[0x13ca]; if (BVar4 == (Backdrop)0x0) { pcVar12 = (code *)swi(3); (*pcVar12)(); return; } } uVar3 = (uint)BVar4 >> (SUB41(in_ECX[0x13cb],0) & 0x1f) ^ (uint)BVar4; uVar3 = uVar3 << (SUB41(in_ECX[0x13cc],0) & 0x1f) ^ uVar3; BVar4 = (Backdrop)(uVar3 >> (SUB41(in_ECX[0x13cd],0) & 0x1f) ^ uVar3); in_ECX[0x13ca] = BVar4; pvVar14 = (void *)((float)((double)(int)BVar4 + __uint_to_double_fixup[-((int)BVar4 >> 0x1f)]) * 2.3283062e-10 * 2.5 + 0.5); ((Vector *)((void **)((int)local_1a8 + 0x24) + 0x30))->x = (float)pvVar14; ((void **)((int)local_1a8 + 0x24))[0x31] = pvVar14; if (in_ECX[0x54] == (Backdrop)0x27) { local_40 = 0.0; local_50 = 0.0; piStack_4c = (int *)0x0; fStack_48 = 0.0; piStack_44 = (int *)0x0; local_3c = (int *)0x0; local_38 = 0; builtin_strncpy(local_60,"333?333?",8); fStack_58 = (float)0x3f333333; piStack_54 = (int *)0x3f800000; (**(code **)(*(int *)local_1a8 + 0x3c))(local_60,0xffffffff,0xff,0,1); } (**(code **)(*(int *)local_1a8 + 0xc))(); } local_1b8 = (float)((int)local_1b8 + 1); } while ((int)local_1b8 < (int)local_1b4); } LAB_00937cb8: gridWidth = *(int *)((int)g_game->_room + 0xc); gridHeight = *(int *)((int)g_game->_room + 0x10); rng = (RNG *)(in_ECX + 0x13ca); local_2a0 = 468.0; local_2b0 = 468.0; local_298 = 520.0; local_2a8 = 520.0; local_290 = 1; local_2ac = (float)((int)local_1ac * 2) * 26.0; local_1c0 = 0; local_29c = (float)((int)local_1ac * 2 + 2) * 26.0; local_2a4 = local_2ac; local_294 = local_29c; wallRng = rng; do { room = (Backdrop)rng->_seed; if (room == (Backdrop)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); room = in_ECX[0x13ca]; rng = (RNG *)(in_ECX + 0x13ca); if (room == (Backdrop)0x0) { pcVar12 = (code *)swi(3); (*pcVar12)(); return; } } uVar3 = (uint)room >> ((byte)rng->_shift1 & 0x1f) ^ (uint)room; uVar3 = uVar3 << (SUB41(in_ECX[0x13cc],0) & 0x1f) ^ uVar3; room = (Backdrop)(uVar3 >> (SUB41(in_ECX[0x13cd],0) & 0x1f) ^ uVar3); in_ECX[0x13ca] = room; if ((uint)room % (uint)local_1cc == 0) { local_1b8 = (float)config.wallVariants; if (room == (Backdrop)0x0) { local_1a8 = room; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); room = in_ECX[0x13ca]; if (room == (Backdrop)0x0) { pcVar12 = (code *)swi(3); (*pcVar12)(); return; } } uVar3 = (uint)room >> (SUB41(in_ECX[0x13cb],0) & 0x1f) ^ (uint)room; uVar3 = uVar3 << (SUB41(in_ECX[0x13cc],0) & 0x1f) ^ uVar3; room = (Backdrop)(uVar3 >> (SUB41(in_ECX[0x13cd],0) & 0x1f) ^ uVar3); in_ECX[0x13ca] = room; if (local_1b8 == 0.0) { local_1a8 = (Backdrop)((int)local_1ac * config.wallVariants); } else { local_1a8 = (Backdrop)((int)local_1ac * config.wallVariants + (uint)room % (uint)local_1b8); } } else { local_1a8 = (Backdrop)((int)local_1ac * config.wallVariants); } fVar15 = 26.0; local_260 = CONCAT31(local_260._1_3_,1); local_240 = 0.0; local_250 = 0.0; local_244 = (int *)0x0; iVar5 = ((uint)local_1a8 >> 1) * 6; local_24c = (int *)0x0; local_238 = 1.0; local_248 = 1.0; iVar11 = ((uint)local_1a8 & 1) * 9; local_234 = (int *)0x3f800000; local_23c = (int *)0x3f800000; local_230 = local_230 & 0xffffff00; local_1e4._unk = 0; fStack_278 = (float)(iVar11 + 2) * 26.0; piStack_26c = (int *)((float)(iVar5 + 2) * 26.0); local_280 = (float)iVar11 * 26.0; piStack_27c = (int *)((float)iVar5 * 26.0); local_1e4._red = 1.0; local_1e4._green = 1.0; local_1e4._blue = 1.0; local_1e4._alpha = 1.0; piStack_274 = piStack_27c; local_270 = local_280; fStack_268 = fStack_278; piStack_264 = piStack_26c; local_1c8 = fStack_278; local_1b0 = piStack_26c; ColorQuad::ColorQuad(local_3b8,&local_1e4); local_250 = local_280; local_24c = piStack_27c; local_248 = fStack_278; local_244 = piStack_274; local_230 = local_260; local_240 = local_270; local_23c = piStack_26c; local_238 = fStack_268; local_234 = piStack_264; KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 52.0; render_quad_set_uniform_color (auStack_320,(float)in_ECX[0x13c6] - 52.0,(float)in_ECX[0x13c7] - 52.0, (float)in_ECX[0x13c6] + 0.0,(float)in_ECX[0x13c7] + 0.0,color); uVar3 = local_1c0; srcBuf = auStack_320; dstBuf = local_3b8; for (iVar5 = 0x1c; pBVar7 = local_1a4, iVar5 != 0; iVar5 = iVar5 + -1) { *dstBuf = *srcBuf; srcBuf = srcBuf + 1; dstBuf = dstBuf + 1; } if (roomShape == 9) { if (uVar3 == 0) { local_1e4._red = 1.0; local_1e4._green = 1.0; local_1e4._blue = 1.0; local_1e4._alpha = 1.0; local_1e4._unk = uVar3; render_quad_set_uniform_color (auStack_320,(float)local_1a4[0x13c6] + 286.0,(float)local_1a4[0x13c7] - fVar13, (float)local_1a4[0x13c6] + 338.0,(float)local_1a4[0x13c7] + 0.0,&local_1e4); srcBuf = auStack_320; dstBuf = local_3b8; for (iVar5 = 0x1c; pBVar7 = local_1a4, iVar5 != 0; iVar5 = iVar5 + -1) { *dstBuf = *srcBuf; srcBuf = srcBuf + 1; dstBuf = dstBuf + 1; } (**(code **)(*(int *)local_1a4[9] + 0x14))(&local_250,local_3b8,g_drawRectUnset); color_11 = &local_1e4; room = pBVar7[0x13c7]; BVar4 = pBVar7[0x13c6]; local_1e4._red = 1.0; local_1e4._green = 1.0; local_1e4._blue = 1.0; local_1e4._alpha = 1.0; local_1e4._unk = 0; fVar13 = (float)room + 182.0; fVar15 = (float)room + 130.0; left = (float)BVar4 - 52.0; right = (float)BVar4 + 0.0; LAB_00938a7a: render_quad_set_uniform_color(auStack_320,left,fVar15,right,fVar13,color_11); srcBuf = auStack_320; dstBuf = local_3b8; for (iVar5 = 0x1c; iVar5 != 0; iVar5 = iVar5 + -1) { *dstBuf = *srcBuf; srcBuf = srcBuf + 1; dstBuf = dstBuf + 1; } } } else if (roomShape == 10) { if (uVar3 == 1) { KColor::SetFromARGB(&local_1e4,0xffffffff); render_quad_set_uniform_color (auStack_320,(float)pBVar7[0x13c6] + 338.0,(float)pBVar7[0x13c7] - fVar13, (float)pBVar7[0x13c6] + 390.0,(float)pBVar7[0x13c7] + 0.0,color_00); srcBuf = auStack_320; dstBuf = local_3b8; for (iVar5 = 0x1c; pBVar7 = local_1a4, iVar5 != 0; iVar5 = iVar5 + -1) { *dstBuf = *srcBuf; srcBuf = srcBuf + 1; dstBuf = dstBuf + 1; } (**(code **)(*(int *)local_1a4[9] + 0x14))(&local_250,local_3b8,g_drawRectUnset); iVar5 = gridWidth; KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = (float)pBVar7[0x13c7] + 182.0; fVar15 = (float)pBVar7[0x13c7] + 130.0; color_11 = extraout_ECX; LAB_00938a65: left = (float)(iVar5 + -2) * 26.0 + (float)pBVar7[0x13c6]; right = (float)gridWidth * 26.0 + (float)pBVar7[0x13c6]; goto LAB_00938a7a; } } else if (roomShape == 0xb) { if (uVar3 == 2) { iVar5 = gridHeight + -2; KColor::SetFromARGB(&local_1e4,0xffffffff); render_quad_set_uniform_color (auStack_320,(float)pBVar7[0x13c6] + 286.0, (float)iVar5 * fVar15 + (float)pBVar7[0x13c7],(float)pBVar7[0x13c6] + 338.0, (float)gridHeight * fVar15 + (float)pBVar7[0x13c7],color_01); srcBuf = auStack_320; dstBuf = local_3b8; for (iVar5 = 0x1c; pBVar7 = local_1a4, iVar5 != 0; iVar5 = iVar5 + -1) { *dstBuf = *srcBuf; srcBuf = srcBuf + 1; dstBuf = dstBuf + 1; } (**(code **)(*(int *)local_1a4[9] + 0x14))(&local_250,local_3b8,g_drawRectUnset); KColor::SetFromARGB(&local_1e4,0xffffffff); room = pBVar7[0x13c7]; BVar4 = pBVar7[0x13c6]; fVar13 = (float)room + 234.0; fVar15 = (float)room + 182.0; left = (float)BVar4 - 52.0; right = (float)BVar4 + 0.0; color_11 = extraout_ECX_00; goto LAB_00938a7a; } } else if (roomShape == 0xc) { if (uVar3 == 3) { iVar5 = gridHeight + -2; KColor::SetFromARGB(&local_1e4,0xffffffff); render_quad_set_uniform_color (auStack_320,(float)pBVar7[0x13c6] + 338.0, (float)iVar5 * fVar15 + (float)pBVar7[0x13c7],(float)pBVar7[0x13c6] + 390.0, (float)gridHeight * fVar15 + (float)pBVar7[0x13c7],color_02); srcBuf = auStack_320; dstBuf = local_3b8; for (iVar5 = 0x1c; pBVar7 = local_1a4, iVar5 != 0; iVar5 = iVar5 + -1) { *dstBuf = *srcBuf; srcBuf = srcBuf + 1; dstBuf = dstBuf + 1; } (**(code **)(*(int *)local_1a4[9] + 0x14))(&local_250,local_3b8,g_drawRectUnset); iVar5 = gridWidth; KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = (float)pBVar7[0x13c7] + 234.0; fVar15 = (float)pBVar7[0x13c7] + 182.0; color_11 = extraout_ECX_01; goto LAB_00938a65; } } else if ((((roomShape == 2) || (roomShape == 3)) || (roomShape == 7)) || (roomShape == 5)) { /* WARNING: Could not recover jumptable at 0x009387a6. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)(&PTR_LAB_0093b46c)[uVar3])(); return; } in_ECX = local_1a4; iVar5 = roomShape; (**(code **)(*(int *)local_1a4[9] + 0x14))(&local_250,local_3b8,g_drawRectUnset); spawn_wall_details(); local_1c0 = local_1c0 + 1; if (3 < local_1c0) break; rng = (RNG *)(in_ECX + 0x13ca); } while( true ); local_1c0 = 0; do { fVar13 = local_1cc; rng = wallRng; local_1b0 = (int *)0x0; local_1bc = 0.0; if (iVar5 == 9) { local_1b0 = (int *)0x7; LAB_00938ba7: uVar3 = RNG::RandomInt(wallRng,(uint)local_1cc); if (uVar3 == 0) { local_1c8 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1c8 = 0.0; } uVar3 = RNG::RandomInt(rng,(uint)fVar13); if (uVar3 == 0) { local_1b4 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1b4 = 0.0; } fVar13 = 26.0; uVar3 = (int)local_1c8 + (int)local_1ac * config.wallVariants; uStack_200 = 1; iVar5 = local_1c0 + (uVar3 & 1) * 9; iVar1 = (uVar3 >> 1) * 6; uVar3 = (int)local_1b4 + (int)local_1ac * config.wallVariants; iVar11 = local_1c0 + (uVar3 & 1) * 9; fStack_224 = (float)((uVar3 >> 1) * 6); fStack_220 = (float)(iVar5 + 2) * 26.0; fStack_21c = (float)iVar1 * 26.0; fStack_218 = (float)(iVar5 + 3) * 26.0; fStack_20c = (float)(iVar1 + 2) * 26.0; fStack_214 = fStack_21c; fStack_210 = fStack_220; fStack_208 = fStack_218; fStack_204 = fStack_20c; KColor::SetFromARGB(&local_1e4,0xffffffff); local_1a8 = (Backdrop)((float)(int)(local_1c0 + 1) * fVar13); local_1b8 = (float)(int)local_1c0 * fVar13; render_quad_set_uniform_color (auStack_498,local_1b8 + (float)local_1a4[0x13c6], (float)((int)local_1b0 + -2) * fVar13 + (float)local_1a4[0x13c7], (float)local_1a4[0x13c6] + (float)local_1a8, (float)(int)local_1b0 * fVar13 + (float)local_1a4[0x13c7],&local_1e4); (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_220,auStack_498,g_drawRectUnset); spawn_wall_details(); iVar5 = gridHeight + ((int)local_1bc - 2U); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; render_quad_set_uniform_color (auStack_508,(float)local_1a4[0x13c6] + local_1b8, (float)iVar5 * 26.0 + (float)local_1a4[0x13c7], (float)local_1a4[0x13c6] + (float)local_1a8, (float)(iVar5 + 2) * 26.0 + (float)local_1a4[0x13c7],color_03); local_260 = CONCAT31(local_260._1_3_,1); local_280 = (float)(iVar11 + 2) * fVar13; piStack_27c = (int *)((float)((int)fStack_224 + 2) * fVar13); fStack_278 = (float)(iVar11 + 3) * fVar13; piStack_26c = (int *)((float)(int)fStack_224 * fVar13); piStack_274 = piStack_27c; local_270 = local_280; fStack_268 = fStack_278; piStack_264 = piStack_26c; (**(code **)(*(int *)local_1a4[9] + 0x14))(&local_280,auStack_508,g_drawRectUnset); in_ECX = local_1a4; spawn_wall_details(); iVar5 = roomShape; } else { if (iVar5 == 0xb) { local_1bc = -NAN; goto LAB_00938ba7; } if ((iVar5 == 2) || (iVar5 == 7)) { local_1b0 = (int *)0x2; local_1bc = -NAN; goto LAB_00938ba7; } if (((iVar5 != 3) && (iVar5 != 5)) || ((shapeMinX + -1 <= (int)local_1c0 && ((int)local_1c0 <= local_1fc + -1)))) goto LAB_00938ba7; } local_1c0 = local_1c0 + 1; } while ((int)local_1c0 < 7); local_1b0 = (int *)0x7; uVar3 = gridWidth + -8; local_1c0 = uVar3; if (7 < (int)uVar3) { do { fVar13 = local_1cc; rng = wallRng; local_1b4 = 0.0; local_1c8 = 0.0; if (iVar5 == 9) { if (local_1b0 < 0xd) { LAB_00938f84: local_1b4 = 9.80909e-45; } LAB_00938ff9: uVar3 = RNG::RandomInt(wallRng,(uint)local_1cc); if (uVar3 == 0) { local_1bc = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1bc = 0.0; } uVar3 = RNG::RandomInt(rng,(uint)fVar13); if (uVar3 == 0) { local_1b8 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1b8 = 0.0; } fVar13 = 26.0; uVar3 = (int)local_1bc + (int)local_1ac * config.wallVariants; local_260 = CONCAT31(local_260._1_3_,1); iVar5 = ((uint)local_1b0 & 1) + (uVar3 & 1) * 9; iVar11 = (uVar3 >> 1) * 6; uVar3 = (int)local_1b8 + (int)local_1ac * config.wallVariants; local_1a8 = (Backdrop)((uVar3 >> 1) * 6); local_280 = (float)(iVar5 + 7) * 26.0; fStack_22c = (float)(((uint)local_1b0 & 1) + (uVar3 & 1) * 9 + 7); piStack_27c = (int *)((float)iVar11 * 26.0); fStack_278 = (float)(iVar5 + 8) * 26.0; piStack_26c = (int *)((float)(iVar11 + 2) * 26.0); piStack_274 = piStack_27c; local_270 = local_280; fStack_268 = fStack_278; piStack_264 = piStack_26c; KColor::SetFromARGB(&local_1e4,0xffffffff); pBVar7 = local_1a4; fStack_224 = (float)(int)((int)local_1b0 + 1) * fVar13; fStack_228 = (float)(int)local_1b0 * fVar13; render_quad_set_uniform_color (auStack_578,fStack_228 + (float)local_1a4[0x13c6], (float)(int)((int)local_1b4 - 2) * fVar13 + (float)local_1a4[0x13c7], (float)local_1a4[0x13c6] + fStack_224, (float)(int)local_1b4 * fVar13 + (float)local_1a4[0x13c7],&local_1e4); (**(code **)(*(int *)pBVar7[9] + 0x14))(&local_280,auStack_578,g_drawRectUnset); spawn_wall_details(); iVar5 = gridHeight + ((int)local_1c8 - 2U); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; render_quad_set_uniform_color (auStack_7a8,(float)local_1a4[0x13c6] + fStack_228, (float)iVar5 * 26.0 + (float)local_1a4[0x13c7], (float)local_1a4[0x13c6] + fStack_224, (float)(iVar5 + 2) * 26.0 + (float)local_1a4[0x13c7],color_04); local_1e4._green = (float)(int)local_1a8 * fVar13; fStack_1f4 = (float)(int)fStack_22c * fVar13; fStack_1f0 = (float)(int)((int)local_1a8 + 2) * fVar13; fStack_1ec = (float)((int)fStack_22c + 1) * fVar13; local_1e4._unk = CONCAT31(local_1e4._unk._1_3_,1); fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_1f4,auStack_7a8,g_drawRectUnset); in_ECX = local_1a4; spawn_wall_details(); uVar3 = local_1c0; iVar5 = roomShape; } else { if (iVar5 == 10) { if (0xc < local_1b0) goto LAB_00938f84; goto LAB_00938ff9; } if (iVar5 == 0xb) { if (local_1b0 < 0xd) { LAB_00938fa6: local_1c8 = -NAN; } goto LAB_00938ff9; } if (iVar5 == 0xc) { if (0xc < local_1b0) goto LAB_00938fa6; goto LAB_00938ff9; } if ((iVar5 == 2) || (iVar5 == 7)) { local_1b4 = 2.8026e-45; local_1c8 = -NAN; goto LAB_00938ff9; } if (((iVar5 != 3) && (iVar5 != 5)) || ((shapeMinX + -1 <= (int)local_1b0 && ((int)local_1b0 <= local_1fc + -1)))) goto LAB_00938ff9; } local_1b0 = (int *)((int)local_1b0 + 1); } while ((int)local_1b0 < (int)uVar3); } if ((int)uVar3 < gridWidth + -2) { local_1b0 = (int *)0x7; local_1a8 = (Backdrop)uVar3; do { fVar13 = local_1cc; rng = wallRng; local_1a8 = (Backdrop)((int)local_1a8 + 1); local_1b8 = 0.0; local_1bc = 0.0; if (iVar5 == 10) { if (0xc < (int)uVar3) { local_1b8 = 9.80909e-45; } LAB_00939431: uVar3 = RNG::RandomInt(wallRng,(uint)local_1cc); if (uVar3 == 0) { local_1b4 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1b4 = 0.0; } uVar3 = RNG::RandomInt(rng,(uint)fVar13); if (uVar3 == 0) { local_1c8 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1c8 = 0.0; } uVar3 = (int)local_1b4 + (int)local_1ac * config.wallVariants; iVar5 = (uVar3 >> 1) * 6; iVar11 = gridWidth + -1 + ((uVar3 & 1) * 9 - local_1c0); uVar3 = (int)local_1c8 + (int)local_1ac * config.wallVariants; local_25c.y = (float)((uVar3 >> 1) * 6); fStack_224 = (float)(((uVar3 & 1) * 9 - local_1c0) + gridWidth + -1); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; fStack_22c = (float)(int)local_1a8 * 26.0; fStack_228 = (float)(int)local_1c0 * 26.0; render_quad_set_uniform_color (auStack_5e8,fStack_228 + (float)local_1a4[0x13c6], (float)(int)((int)local_1b8 - 2) * 26.0 + (float)local_1a4[0x13c7], (float)local_1a4[0x13c6] + fStack_22c, (float)(int)local_1b8 * 26.0 + (float)local_1a4[0x13c7],color_05); fStack_1f4 = (float)(iVar11 + 1) * fVar13; fStack_1f0 = (float)iVar5 * fVar13; fStack_1ec = (float)iVar11 * fVar13; local_1e4._green = (float)(iVar5 + 2) * fVar13; local_1e4._unk._0_1_ = 1; fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_1f4,auStack_5e8,g_drawRectUnset); pBVar7 = local_1a4; spawn_wall_details(); iVar5 = gridHeight + ((int)local_1bc - 2U); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; render_quad_set_uniform_color (auStack_658,(float)pBVar7[0x13c6] + fStack_228, (float)iVar5 * 26.0 + (float)pBVar7[0x13c7],(float)pBVar7[0x13c6] + fStack_22c, (float)(iVar5 + 2) * 26.0 + (float)pBVar7[0x13c7],color_06); fStack_1f4 = (float)((int)fStack_224 + 1) * fVar13; fStack_1f0 = (float)((int)local_25c.y + 2) * fVar13; fStack_1ec = (float)(int)fStack_224 * fVar13; local_1e4._green = (float)(int)local_25c.y * fVar13; local_1e4._unk = CONCAT31(local_1e4._unk._1_3_,1); fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)pBVar7[9] + 0x14))(&fStack_1f4,auStack_658,g_drawRectUnset); spawn_wall_details(); uVar3 = local_1c0; iVar5 = roomShape; } else { if (iVar5 == 0xc) { if (0xc < (int)uVar3) { local_1bc = -NAN; } goto LAB_00939431; } if ((iVar5 == 2) || (iVar5 == 7)) { local_1b8 = 2.8026e-45; local_1bc = -NAN; goto LAB_00939431; } if (((iVar5 != 3) && (iVar5 != 5)) || ((shapeMinX + -1 <= (int)uVar3 && ((int)uVar3 <= local_1fc + -1)))) goto LAB_00939431; } uVar3 = uVar3 + 1; local_1b0 = (int *)((int)local_1b0 - 1); in_ECX = local_1a4; local_1c0 = uVar3; } while ((int)uVar3 < gridWidth + -2); } local_1fc = 0; do { fVar13 = local_1cc; rng = wallRng; local_1a8 = (Backdrop)0x0; local_1b4 = 0.0; if (iVar5 == 9) { local_1a8 = (Backdrop)0xd; LAB_00939868: uVar3 = RNG::RandomInt(wallRng,(uint)local_1cc); if (uVar3 == 0) { local_1b8 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1b8 = 0.0; } uVar3 = RNG::RandomInt(rng,(uint)fVar13); if (uVar3 == 0) { local_1bc = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1bc = 0.0; } fVar13 = 26.0; uVar3 = (int)local_1b8 + (int)local_1ac * config.wallVariants; uStack_324 = 1; iVar5 = local_1fc + ((uVar3 >> 1) * 3 + 1) * 2; iVar11 = (uVar3 & 1) * 9; uVar3 = (int)local_1bc + (int)local_1ac * config.wallVariants; fStack_228 = (float)(local_1fc + 2 + (uVar3 >> 1) * 6); iVar1 = (uVar3 & 1) * 9; fStack_344 = (float)iVar11 * 26.0; fStack_340 = (float)iVar5 * 26.0; fStack_33c = (float)(iVar11 + 2) * 26.0; fStack_330 = (float)(iVar5 + 1) * 26.0; fStack_338 = fStack_340; fStack_334 = fStack_344; fStack_32c = fStack_33c; fStack_328 = fStack_330; KColor::SetFromARGB(&local_1e4,0xffffffff); local_25c.y = (float)(local_1fc + 1) * fVar13; fStack_22c = (float)local_1fc * fVar13; render_quad_set_uniform_color (auStack_6c8,(float)((int)local_1a8 + -2) * fVar13 + (float)local_1a4[0x13c6], fStack_22c + (float)local_1a4[0x13c7], (float)(int)local_1a8 * fVar13 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + local_25c.y,&local_1e4); (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_344,auStack_6c8,g_drawRectUnset); spawn_wall_details(); iVar5 = gridWidth + ((int)local_1b4 - 2U); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; render_quad_set_uniform_color (auStack_738,(float)iVar5 * 26.0 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + fStack_22c, (float)(iVar5 + 2) * 26.0 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + local_25c.y,color_07); fStack_1ec = (float)iVar1 * fVar13; local_1e4._unk = CONCAT31(local_1e4._unk._1_3_,1); fStack_1f4 = (float)(iVar1 + 2) * fVar13; fStack_1f0 = (float)(int)fStack_228 * fVar13; local_1e4._green = (float)((int)fStack_228 + 1) * fVar13; fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_1f4,auStack_738,g_drawRectUnset); in_ECX = local_1a4; spawn_wall_details(); iVar5 = roomShape; } else { if (iVar5 == 10) { local_1b4 = -NAN; goto LAB_00939868; } if ((iVar5 == 3) || (iVar5 == 5)) { local_1a8 = (Backdrop)0x4; local_1b4 = -NAN; goto LAB_00939868; } if (((iVar5 != 2) && (iVar5 != 7)) || ((shapeMinY + -1 <= local_1fc && (local_1fc <= shapeMaxY + -1)))) goto LAB_00939868; } local_1fc = local_1fc + 1; } while (local_1fc < 4); local_1b0 = (int *)&DAT_00000004; uVar3 = gridHeight + -5; local_1c0 = uVar3; if (4 < (int)uVar3) { do { fVar13 = local_1cc; rng = wallRng; local_1a8 = (Backdrop)0x0; local_1b4 = 0.0; if (iVar5 == 9) { if (local_1b0 < &DAT_00000007) { LAB_00939c37: local_1a8 = (Backdrop)0xd; } LAB_00939cac: uVar3 = RNG::RandomInt(wallRng,(uint)local_1cc); if (uVar3 == 0) { local_1b8 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1b8 = 0.0; } uVar3 = RNG::RandomInt(rng,(uint)fVar13); if (uVar3 == 0) { local_1bc = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1bc = 0.0; } fVar13 = 26.0; uVar3 = (int)local_1b8 + (int)local_1ac * config.wallVariants; local_38 = CONCAT31(local_38._1_3_,1); iVar5 = ((uint)local_1b0 & 1) + ((uVar3 >> 1) * 3 + 2) * 2; iVar11 = (uVar3 & 1) * 9; uVar3 = (int)local_1bc + (int)local_1ac * config.wallVariants; fStack_58 = (float)iVar11 * 26.0; fStack_224 = (float)(((uint)local_1b0 & 1) + ((uVar3 >> 1) * 3 + 2) * 2); fStack_228 = (float)((uVar3 & 1) * 9); piStack_54 = (int *)((float)iVar5 * 26.0); local_50 = (float)(iVar11 + 2) * 26.0; piStack_44 = (int *)((float)(iVar5 + 1) * 26.0); piStack_4c = piStack_54; fStack_48 = fStack_58; local_40 = local_50; local_3c = piStack_44; KColor::SetFromARGB(&local_1e4,0xffffffff); pBVar7 = local_1a4; local_25c.y = (float)(int)((int)local_1b0 + 1) * fVar13; fStack_22c = (float)(int)local_1b0 * fVar13; render_quad_set_uniform_color (auStack_8f8,(float)((int)local_1a8 + -2) * fVar13 + (float)local_1a4[0x13c6], fStack_22c + (float)local_1a4[0x13c7], (float)(int)local_1a8 * fVar13 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + local_25c.y,&local_1e4); (**(code **)(*(int *)pBVar7[9] + 0x14))(&fStack_58,auStack_8f8,g_drawRectUnset); spawn_wall_details(); iVar5 = gridWidth + ((int)local_1b4 - 2U); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; render_quad_set_uniform_color (auStack_818,(float)iVar5 * 26.0 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + fStack_22c, (float)(iVar5 + 2) * 26.0 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + local_25c.y,color_08); local_1e4._unk = CONCAT31(local_1e4._unk._1_3_,1); fStack_1f4 = (float)((int)fStack_228 + 2) * fVar13; fStack_1f0 = (float)(int)fStack_224 * fVar13; fStack_1ec = (float)(int)fStack_228 * fVar13; local_1e4._green = (float)((int)fStack_224 + 1) * fVar13; fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_1f4,auStack_818,g_drawRectUnset); in_ECX = local_1a4; spawn_wall_details(); uVar3 = local_1c0; iVar5 = roomShape; } else { if (iVar5 == 0xb) { if (&DAT_00000006 < local_1b0) goto LAB_00939c37; goto LAB_00939cac; } if (iVar5 == 10) { if (local_1b0 < &DAT_00000007) { LAB_00939c59: local_1b4 = -NAN; } goto LAB_00939cac; } if (iVar5 == 0xc) { if (&DAT_00000006 < local_1b0) goto LAB_00939c59; goto LAB_00939cac; } if ((iVar5 == 3) || (iVar5 == 5)) { local_1a8 = (Backdrop)0x4; local_1b4 = -NAN; goto LAB_00939cac; } if (((iVar5 != 2) && (iVar5 != 7)) || ((shapeMinY + -1 <= (int)local_1b0 && ((int)local_1b0 <= shapeMaxY + -1)))) goto LAB_00939cac; } local_1b0 = (int *)((int)local_1b0 + 1); } while ((int)local_1b0 < (int)uVar3); } if ((int)uVar3 < gridHeight + -2) { local_1c8 = (float)(uVar3 + 1); local_1b0 = (int *)&DAT_00000004; do { fVar13 = local_1cc; rng = wallRng; local_1a8 = (Backdrop)0x0; local_1b4 = 0.0; if (iVar5 == 9) { if ((int)uVar3 < 7) { LAB_0093a067: local_1a8 = (Backdrop)0xd; } LAB_0093a0dc: uVar3 = RNG::RandomInt(wallRng,(uint)local_1cc); if (uVar3 == 0) { local_1b8 = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1b8 = 0.0; } uVar3 = RNG::RandomInt(rng,(uint)fVar13); if (uVar3 == 0) { local_1bc = (float)RNG::RandomInt(rng,config.wallVariants); } else { local_1bc = 0.0; } uVar3 = (int)local_1b8 + (int)local_1ac * config.wallVariants; iVar5 = (uVar3 & 1) * 9; uVar6 = (int)local_1bc + (int)local_1ac * config.wallVariants; iVar11 = gridHeight + -1 + ((uVar3 >> 1) * 6 - local_1c0); fStack_224 = (float)(((uVar6 >> 1) * 6 - local_1c0) + gridHeight + -1); fStack_228 = (float)((uVar6 & 1) * 9); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; local_25c.y = (float)(int)local_1c8 * 26.0; fStack_22c = (float)(int)local_1c0 * 26.0; render_quad_set_uniform_color (auStack_888,(float)((int)local_1a8 + -2) * 26.0 + (float)local_1a4[0x13c6], fStack_22c + (float)local_1a4[0x13c7], (float)(int)local_1a8 * 26.0 + (float)local_1a4[0x13c6], (float)local_1a4[0x13c7] + local_25c.y,color_09); fStack_1f4 = (float)iVar5 * fVar13; fStack_1f0 = (float)(iVar11 + 1) * fVar13; fStack_1ec = (float)(iVar5 + 2) * fVar13; local_1e4._green = (float)iVar11 * fVar13; local_1e4._unk._0_1_ = 1; fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)local_1a4[9] + 0x14))(&fStack_1f4,auStack_888,g_drawRectUnset); pBVar7 = local_1a4; spawn_wall_details(); iVar5 = gridWidth + ((int)local_1b4 - 2U); KColor::SetFromARGB(&local_1e4,0xffffffff); fVar13 = 26.0; render_quad_set_uniform_color (auStack_320,(float)iVar5 * 26.0 + (float)pBVar7[0x13c6], (float)pBVar7[0x13c7] + fStack_22c, (float)(iVar5 + 2) * 26.0 + (float)pBVar7[0x13c6], (float)pBVar7[0x13c7] + local_25c.y,color_10); local_1e4._unk = CONCAT31(local_1e4._unk._1_3_,1); fStack_1f4 = (float)((int)fStack_228 + 2) * fVar13; fStack_1f0 = (float)((int)fStack_224 + 1) * fVar13; fStack_1ec = (float)(int)fStack_228 * fVar13; local_1e4._green = (float)(int)fStack_224 * fVar13; fStack_1e8 = fStack_1f0; local_1e4._red = fStack_1f4; local_1e4._blue = fStack_1ec; local_1e4._alpha = local_1e4._green; (**(code **)(*(int *)pBVar7[9] + 0x14))(&fStack_1f4,auStack_320,g_drawRectUnset); spawn_wall_details(); uVar3 = local_1c0; iVar5 = roomShape; } else { if (iVar5 == 0xb) { if (6 < (int)uVar3) goto LAB_0093a067; goto LAB_0093a0dc; } if (iVar5 == 10) { if ((int)uVar3 < 7) { LAB_0093a089: local_1b4 = -NAN; } goto LAB_0093a0dc; } if (iVar5 == 0xc) { if (6 < (int)uVar3) goto LAB_0093a089; goto LAB_0093a0dc; } if ((iVar5 == 3) || (iVar5 == 5)) { local_1a8 = (Backdrop)0x4; local_1b4 = -NAN; goto LAB_0093a0dc; } if (((iVar5 != 2) && (iVar5 != 7)) || ((shapeMinY + -1 <= (int)uVar3 && ((int)uVar3 <= shapeMaxY + -1)))) goto LAB_0093a0dc; } uVar3 = uVar3 + 1; local_1c8 = (float)((int)local_1c8 + 1); local_1b0 = (int *)((int)local_1b0 + -1); in_ECX = local_1a4; local_1c0 = uVar3; } while ((int)uVar3 < gridHeight + -2); } if (iVar5 == 9) { pcVar12 = *(code **)(*(int *)in_ECX[9] + 0x14); uVar16 = render_grid_rect(auStack_428,0xb,5,2,2); quad = &local_2b0; LAB_0093a644: (*pcVar12)(quad,uVar16,g_drawRectUnset); piVar8 = extraout_EDX; iVar5 = roomShape; } else { if (iVar5 == 10) { pcVar12 = *(code **)(*(int *)in_ECX[9] + 0x14); uVar16 = render_grid_rect(auStack_428,0xd,5,2,2); local_1e4._red = local_2a8; fStack_1e8 = local_2ac; local_1e4._blue = local_2a0; local_1e4._green = local_294; LAB_0093a621: quad = &fStack_1f4; local_1e4._unk = CONCAT31(local_1e4._unk._1_3_,1); fStack_1f4 = local_1e4._red; fStack_1f0 = fStack_1e8; fStack_1ec = local_1e4._blue; local_1e4._alpha = local_1e4._green; goto LAB_0093a644; } if (iVar5 == 0xb) { pcVar12 = *(code **)(*(int *)in_ECX[9] + 0x14); uVar16 = render_grid_rect(auStack_428,0xb,7,2,2); local_1e4._red = local_2b0; local_1e4._blue = local_298; LAB_0093a609: local_1e4._green = local_2a4; fStack_1e8 = local_29c; goto LAB_0093a621; } piVar8 = local_1b0; if (iVar5 == 0xc) { pcVar12 = *(code **)(*(int *)in_ECX[9] + 0x14); uVar16 = render_grid_rect(auStack_428,0xd,7,2,2); local_1e4._red = local_2a8; local_1e4._blue = local_2a0; goto LAB_0093a609; } } game = g_game; uVar10 = (ushort)((uint)piVar8 >> 0x10); if ((g_game->_stage == 10) && (g_game->_stageType == 1)) { grid_rect_to_quad(&local_280,0,2,2,1); quad = (float *)grid_rect_to_quad(&fStack_58,0,2,2,2); fStack_220 = *quad; fStack_21c = quad[5]; fStack_218 = quad[6]; fStack_20c = quad[3]; uStack_200 = 1; fStack_214 = fStack_21c; fStack_210 = fStack_220; fStack_208 = fStack_218; fStack_204 = fStack_20c; grid_rect_to_quad(&local_250,2,0,1,2); FUN_0081fae0(&DAT_00c35b80 + *(int *)(*(int *)(*(int *)((int)game->_room + 4) + 0x10) + 0x48) * 0x20); if ((iVar5 == 2) || (((iVar5 == 7 || (iVar5 == 3)) || (iVar5 == 5)))) { pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1f0 + -3,(int)fStack_1ec + -1,2,1); (*pcVar12)(&local_280,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1f0 + -3,(int)local_1e4._red + -2,2,2); (*pcVar12)(&fStack_220,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,fStack_1e8,(int)fStack_1ec + -1,2,1); fStack_48 = fStack_278; fStack_58 = fStack_278; piStack_4c = piStack_27c; piStack_54 = piStack_27c; local_40 = local_270; local_50 = local_270; local_3c = piStack_264; piStack_44 = piStack_264; local_38._0_1_ = 1; (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,fStack_1e8,(int)local_1e4._red + -2,2,2); fStack_48 = fStack_218; fStack_58 = fStack_218; piStack_4c = (int *)fStack_21c; piStack_54 = (int *)fStack_21c; local_40 = fStack_210; local_50 = fStack_210; local_3c = (int *)fStack_204; piStack_44 = (int *)fStack_204; local_38._0_1_ = 1; (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1f0 + -1,(int)fStack_1ec + -3,1,2); (*pcVar12)(&local_250,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1f0 + -1,local_1e4._red,1,2); fStack_48 = local_250; fStack_58 = local_250; piStack_4c = local_23c; piStack_54 = local_23c; local_40 = local_238; local_50 = local_238; local_3c = local_244; piStack_44 = local_244; local_38._0_1_ = 1; (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1e8 + -1,(int)fStack_1ec + -3,1,2); fStack_48 = local_248; fStack_58 = local_248; piStack_4c = local_24c; piStack_54 = local_24c; local_40 = local_240; local_50 = local_240; local_3c = local_234; piStack_44 = local_234; local_38 = CONCAT31(local_38._1_3_,1); (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); srcBuf = auStack_428; fVar15 = local_1e4._red; fVar13 = fStack_1e8; LAB_0093ad9b: uVar16 = render_grid_rect(srcBuf,(int)fVar13 + -1,fVar15,1,2); fStack_48 = local_248; local_40 = local_240; LAB_0093adcd: piStack_44 = local_244; piStack_4c = local_23c; LAB_0093addf: local_38 = CONCAT31(local_38._1_3_,1); quad = &fStack_58; fStack_58 = fStack_48; piStack_54 = piStack_4c; local_50 = local_40; local_3c = piStack_44; } else { if (iVar5 == 0xb) { pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1f0 + -3,(int)local_1e4._red + -1,2,1); fStack_48 = local_280; fStack_58 = local_280; piStack_4c = piStack_26c; piStack_54 = piStack_26c; local_40 = fStack_268; local_50 = fStack_268; local_3c = piStack_274; piStack_44 = piStack_274; local_38 = CONCAT31(local_38._1_3_,1); (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_320,(int)local_1e4._green + -1,local_1e4._unk,1,2); fStack_48 = local_250; local_40 = local_238; goto LAB_0093adcd; } if (iVar5 == 0xc) { pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,fStack_1e8,(int)local_1e4._red + -1,2,1); fStack_48 = fStack_278; fStack_58 = fStack_278; piStack_4c = piStack_26c; piStack_54 = piStack_26c; local_40 = local_270; local_50 = local_270; local_3c = piStack_274; piStack_44 = piStack_274; local_38 = CONCAT31(local_38._1_3_,1); (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); srcBuf = auStack_320; fVar15 = (float)local_1e4._unk; fVar13 = local_1e4._alpha; goto LAB_0093ad9b; } if (iVar5 != 9) { uVar10 = extraout_var; if (iVar5 != 10) goto LAB_0093adfb; pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1e8 + -1,(int)fStack_1ec + -3,1,2); fStack_48 = local_248; fStack_58 = local_248; piStack_4c = local_24c; piStack_54 = local_24c; local_40 = local_240; local_50 = local_240; local_3c = local_234; piStack_44 = local_234; local_38 = CONCAT31(local_38._1_3_,1); (*pcVar12)(&fStack_58,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_320,local_1e4._alpha,(int)local_1e4._blue + -1,2,1); fStack_48 = fStack_278; piStack_4c = piStack_27c; local_40 = local_270; piStack_44 = piStack_264; goto LAB_0093addf; } pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_428,(int)fStack_1f0 + -1,(int)fStack_1ec + -3,1,2); (*pcVar12)(&local_250,uVar16,g_drawRectUnset); pcVar12 = *(code **)(*(int *)local_1a4[9] + 0x14); uVar16 = render_grid_rect(auStack_320,(int)local_1e4._green + -3,(int)local_1e4._blue + -1,2,1 ); quad = &local_280; } (*pcVar12)(quad,uVar16,g_drawRectUnset); uVar10 = extraout_var_00; } LAB_0093adfb: pBVar7 = local_1a4; iVar5 = roomShape; if (local_1a4[0x1411].field_0x1 == '\0') goto LAB_0093b1df; DAT_00c33910 = 0; local_1b8 = -NAN; local_1a8 = (Backdrop)0xfffffffe; if ((roomShape == 2) || (roomShape == 7)) { isHorizontalNarrow = true; } else { isHorizontalNarrow = false; } if ((roomShape == 3) || (roomShape == 5)) { gridWidth = gridWidth + -4; iVar11 = (uint)uVar10 << 0x10; local_1b8 = 2.8026e-45; } else { iVar11 = CONCAT22(uVar10,0x100); if (isHorizontalNarrow) { gridHeight = gridHeight + -2; local_1a8 = (Backdrop)0x0; } } room = local_1a4[0x54]; if (((room == (Backdrop)0x1f) || (room == (Backdrop)0x2d)) && (local_1ac == 1.4013e-45)) { LAB_0093aecd: fVar13 = 0.18; local_1cc = 0.18; if (((room == (Backdrop)0x2e) || (room == (Backdrop)0x3b)) && (local_1ac == 2.8026e-45)) { fVar13 = 0.45; local_1cc = 0.45; } rng = (RNG *)(local_1a4 + 0x13ca); local_1ac = (float)(CONCAT31((int3)((uint)local_1ac >> 8),isHorizontalNarrow) ^ 1); isHorizontalNarrow = (byte)((uint)iVar11 >> 8); pBVar9 = (Backdrop *)CONCAT31((int3)((uint)iVar11 >> 8),isHorizontalNarrow); local_1bc = (float)((int)local_1a8 + 7); local_1b4 = (float)(int)local_1a8 * 26.0; local_28 = local_1b4 + (float)local_1a4[0x13c7]; local_1c8 = (float)((int)local_1b8 + 0xd); local_1a8 = (Backdrop)((float)(int)local_1b8 * 26.0); if (roomShape == 9) { local_34._8_4_ = (float)(int)local_1c8 * 26.0 + (float)local_1a4[0x13c6]; local_1a4 = pBVar9; render_wall_detail(pBVar7,rng,(Vector *)(local_34 + 8),0,0,isHorizontalNarrow,SUB41(local_1ac,0),fVar13); local_34._8_4_ = (float)local_1a8 + (float)pBVar7[0x13c6]; local_28 = (float)(int)local_1bc * 26.0 + (float)pBVar7[0x13c7]; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),0,0, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); room = pBVar7[0x13c6]; local_28 = local_1b4 + (float)pBVar7[0x13c7]; local_1b0 = (int *)((float)gridWidth * 26.0); LAB_0093b050: local_34._8_4_ = (float)local_1b0 + (float)room; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),1,0, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); room = pBVar7[0x13c6]; local_1b4 = (float)(gridHeight - 7); local_1b8 = (float)gridHeight * 26.0; local_28 = local_1b8 + (float)pBVar7[0x13c7]; if (iVar5 != 0xb) goto LAB_0093b34e; local_34._8_4_ = (float)(int)local_1c8 * 26.0 + (float)room; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),0,1, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); local_34._8_4_ = (float)local_1a8 + (float)pBVar7[0x13c6]; local_28 = (float)(int)local_1b4 * 26.0 + (float)pBVar7[0x13c7]; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),0,1, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); room = pBVar7[0x13c6]; local_28 = local_1b8 + (float)pBVar7[0x13c7]; LAB_0093b198: local_34._8_4_ = (float)local_1b0 + (float)room; } else { local_34._8_4_ = (float)local_1a8 + (float)local_1a4[0x13c6]; local_1a4 = pBVar9; render_wall_detail(pBVar7,rng,(Vector *)(local_34 + 8),0,0,isHorizontalNarrow,SUB41(local_1ac,0),fVar13); room = pBVar7[0x13c6]; local_28 = local_1b4 + (float)pBVar7[0x13c7]; local_1b0 = (int *)((float)gridWidth * 26.0); if (iVar5 != 10) goto LAB_0093b050; local_34._8_4_ = (float)(gridWidth + -0xd) * 26.0 + (float)room; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),1,0, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); local_34._8_4_ = (float)local_1b0 + (float)pBVar7[0x13c6]; local_28 = (float)(int)local_1bc * 26.0 + (float)pBVar7[0x13c7]; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),1,0, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); room = pBVar7[0x13c6]; local_1b4 = (float)(gridHeight - 7); local_1b8 = (float)gridHeight * 26.0; local_28 = local_1b8 + (float)pBVar7[0x13c7]; LAB_0093b34e: local_34._8_4_ = (float)local_1a8 + (float)room; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),0,1, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); room = pBVar7[0x13c6]; local_28 = local_1b8 + (float)pBVar7[0x13c7]; if (iVar5 != 0xc) goto LAB_0093b198; local_34._8_4_ = (float)(gridWidth + -0xd) * 26.0 + (float)room; render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),1,1, (byte)local_1a4,SUB41(local_1ac,0),local_1cc); local_34._8_4_ = (float)local_1b0 + (float)pBVar7[0x13c6]; local_28 = (float)(int)local_1b4 * 26.0 + (float)pBVar7[0x13c7]; } render_wall_detail(pBVar7,(RNG *)(pBVar7 + 0x13ca),(Vector *)(local_34 + 8),1,1,(byte)local_1a4, SUB41(local_1ac,0),local_1cc); } else { if ((room == (Backdrop)0x20) || (room == (Backdrop)0x3a)) { if (local_1ac != 0.0) goto LAB_0093b1d8; goto LAB_0093aecd; } if ((room == (Backdrop)0x2e) || (room == (Backdrop)0x3b)) { if (local_1ac != 1.4013e-45) goto LAB_0093aecd; } else if ((room == (Backdrop)0x2a) || (room == (Backdrop)0x2f)) goto LAB_0093aecd; } LAB_0093b1d8: DAT_00c33910 = 1; LAB_0093b1df: _glfw_context_reset(1); BackdropConfig::~BackdropConfig(&config); ExceptionList = local_1c; return; } //@@ 0093b480 backdrop_detail_to_world_pos /* DB: ECX=out, EDX=in: room top-left (Room +0x14/+0x18) - 80 + pos/0.65, shifted for room shapes 2/7 (y-80) and 3/5 (x-160); Backdrop::spawn_wall_details prototype: db/protos.zhl */ Vector * __fastcall backdrop_detail_to_world_pos(Vector *outPosition,Vector *position) { float fVar1; void *pvVar2; int iVar3; float fVar4; float fVar5; pvVar2 = g_game->_room; fVar5 = *(float *)((int)pvVar2 + 0x18); iVar3 = *(int *)((int)pvVar2 + 4); fVar4 = (*(float *)((int)pvVar2 + 0x14) - 80.0) + position->x / 0.65; fVar1 = position->y; outPosition->x = fVar4; fVar5 = (fVar5 - 80.0) + fVar1 / 0.65; outPosition->y = fVar5; if ((iVar3 != 0) && (iVar3 = *(int *)(iVar3 + 0x10), iVar3 != 0)) { iVar3 = *(int *)(iVar3 + 0x48); if ((iVar3 == 2) || (iVar3 == 7)) { outPosition->x = fVar4 + 0.0; outPosition->y = fVar5 - 80.0; } else if ((iVar3 == 3) || (iVar3 == 5)) { outPosition->x = fVar4 - 160.0; outPosition->y = fVar5 + 0.0; return outPosition; } } return outPosition; } //@@ 0093b530 FUN_0093b530 undefined4 FUN_0093b530(void) { Vector *in_ECX; undefined4 extraout_ECX; float *in_EDX; Vector local_10; local_10.x = (*in_EDX + in_EDX[6]) * 0.5; local_10.y = (in_EDX[7] + in_EDX[1]) * 0.5; backdrop_detail_to_world_pos(in_ECX,&local_10); return extraout_ECX; } //@@ 0093b580 backdrop_wall_normal /* DB: ECX=out Vector, EDX=vertical flag, (flipA,flipB): returns (+-1,0) or (0,+-1); every wall detail case in Backdrop::spawn_wall_details calls it before FUN_0093b530 */ void backdrop_wall_normal(char param_1,char param_2) { undefined4 *in_ECX; int in_EDX; undefined1 *puVar1; if (in_EDX != 0) { if (param_2 == '\0') { puVar1 = (undefined1 *)0x3f800000; } else { puVar1 = &DAT_bf800000; } *in_ECX = 0; in_ECX[1] = puVar1; return; } if (param_1 == '\0') { *in_ECX = 0x3f800000; in_ECX[1] = 0; return; } *in_ECX = &DAT_bf800000; in_ECX[1] = 0; return; } //@@ 0093b620 Backdrop::spawn_detail_effects /* DB: ? Backdrop::spawn_wall_details: for each null layer of the sprite at +0x30 spawns EFFECT 1000.121 at the null's position /0.65 (mirrored by flipX/flipY) and copies the null's color/frame */ void Backdrop::spawn_detail_effects(char param_1,char param_2) { uint *puVar1; uint uVar2; int iVar3; ANM2 *pAVar4; qword qVar5; float *pfVar6; uint seed; Entity *pEVar7; int in_ECX; float *in_EDX; uint local_18; Vector local_10; uVar2 = *(uint *)(in_ECX + 0x88); local_18 = 0; if (uVar2 != 0) { do { if (((*(int *)(in_ECX + 0x34) != 0) && (pfVar6 = AnimationState::GetNullFrameById((AnimationState *)(in_ECX + 0x30),local_18), pfVar6 != (float *)0x0)) && (*(char *)(pfVar6 + 3) != '\0')) { local_10.x = *pfVar6 / 0.65; local_10.y = pfVar6[1] / 0.65; if (param_1 != '\0') { local_10.x = -local_10.x; } local_10.x = local_10.x + *in_EDX; if (param_2 != '\0') { local_10.y = -local_10.y; } local_10.y = local_10.y + in_EDX[1]; seed = Random(); pEVar7 = Game::SpawnEx(g_game,1000,0x79,&local_10,&g_vectorZero,(Entity *)0x0,0,seed,0); qVar5 = pEVar7->_flags; iVar3 = *(int *)pEVar7; puVar1 = (uint *)((int)&pEVar7->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&pEVar7->_flags = (int)qVar5; pEVar7->_renderZOffset = 0x40000000; pAVar4 = &pEVar7[1]._sprite; (pAVar4->_animDefaultName)._buf[0xc] = '\0'; (pAVar4->_animDefaultName)._buf[0xd] = '\0'; (pAVar4->_animDefaultName)._buf[0xe] = '@'; (pAVar4->_animDefaultName)._buf[0xf] = '@'; (**(code **)(iVar3 + 0x3c))(pfVar6 + 6,0xffffffff,0xff,0,1); (pEVar7->_sprite)._scale.x = pfVar6[4]; (pEVar7->_sprite)._scale.y = pfVar6[5]; } local_18 = local_18 + 1; } while (local_18 < uVar2); } return; } //@@ 0093b760 Backdrop::spawn_wall_details /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? rng=Backdrop (+0x150 backdrop id, +0x4f28 RNG): per wall slot spawns effect 1000.121 embers / 1000.140 decoration entities with gfx/backdrop/*_details, *_torches, *_pipes anm2 by backdrop type; called from FUN_007f1380 */ void __thiscall Backdrop::spawn_wall_details(void) { uint *puVar1; int iVar2; undefined4 uVar3; code *pcVar4; ANM2 *pAVar5; undefined1 axisChar; byte bVar6; uint uVar7; float *wallPos; uint uVar8; Entity *detail; GridEntity *gridEntity; ColorMod *color; Vector *pVVar9; LayerState *layer; char *pcVar10; char slotXChar; void *in_ECX; void *ptr; byte *layerName; Entity *flipTarget; RNG *rng; float fVar11; undefined1 *puVar12; float emberScale; undefined1 *puVar13; undefined8 uVar14; int in_stack_00000004; int in_stack_00000008; int in_stack_0000000c; int in_stack_00000010; float *in_stack_00000014; undefined4 in_stack_00000018; undefined4 in_stack_0000001c; Vector local_f8; float local_f0; Entity *local_ec; byte isLayerVisible; Vector local_e4; Vector local_dc; Vector spawnPos; Vector detailPos; undefined4 local_c4; undefined1 local_c0 [44]; undefined1 local_94 [44]; undefined1 local_68 [44]; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; undefined4 local_14; qword flags; byte isFlipX; byte isFlipY; char slotDigit; char slotYChar; puStack_20 = local_68 + 100; local_14 = 0xffffffff; puStack_18 = &DAT_00b0b31d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_68 + 0x58); ExceptionList = &local_1c; iVar2 = *(int *)((int)in_ECX + 0x150); local_e4.y = (float)in_stack_00000014; isFlipY = (byte)in_stack_0000001c; slotXChar = (char)in_stack_00000004; slotYChar = (char)in_stack_00000008; isFlipX = (byte)in_stack_00000018; local_24 = uVar7; if (iVar2 == 3) { puVar12 = local_68 + 100; if (in_stack_00000010 == 1) { puStack_20 = local_68 + 100; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94054) && (puStack_20 = local_68 + 100, _Init_thread_header(&DAT_00c94054,uVar7), DAT_00c94054 == -1) ) { _DAT_00c94078 = 0; _DAT_00c94068 = 0; uRam00c9406c = 0; uRam00c94070 = 0; uRam00c94074 = 0; _DAT_00c9407c = 0; _DAT_00c94080 = 0; _DAT_00c94058 = 0x3f800000; uRam00c9405c = 0x3f333333; uRam00c94060 = 0x3f000000; uRam00c94064 = 0x3f800000; _Init_thread_footer(&DAT_00c94054); } backdrop_wall_normal(in_stack_00000018,in_stack_0000001c); wallPos = (float *)FUN_0093b530(); spawnPos.x = detailPos.x * 20.0 + *wallPos; spawnPos.y = detailPos.y * 20.0 + wallPos[1]; uVar8 = Random(); local_dc.y = (float)Game::Spawn(g_game,1000,0x79,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar8 ); flags = ((Entity *)local_dc.y)->_flags; puVar1 = (uint *)((int)&((Entity *)local_dc.y)->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&((Entity *)local_dc.y)->_flags = (int)flags; iVar2 = *(int *)local_dc.y; (((Entity *)local_dc.y)->_posOffset).x = detailPos.x * -8.0; (((Entity *)local_dc.y)->_posOffset).y = detailPos.y * -8.0; pAVar5 = &((Entity *)((int)local_dc.y + 0x40c))->_sprite; (pAVar5->_animDefaultName)._buf[0xc] = '\0'; (pAVar5->_animDefaultName)._buf[0xd] = '\0'; (pAVar5->_animDefaultName)._buf[0xe] = '@'; (pAVar5->_animDefaultName)._buf[0xf] = '@'; (**(code **)(iVar2 + 0x3c))(&DAT_00c94058,0xffffffff,0xff,0,1); uVar8 = *(uint *)((int)in_ECX + 0x4f28); if (uVar8 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar8 = *(uint *)((int)in_ECX + 0x4f28); if (uVar8 == 0) { pcVar4 = (code *)swi(3); (*pcVar4)(); return; } } uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)in_ECX + 0x4f2c) & 0x1f) ^ uVar8; uVar8 = uVar8 << ((byte)*(undefined4 *)((int)in_ECX + 0x4f30) & 0x1f) ^ uVar8; uVar8 = uVar8 >> ((byte)*(undefined4 *)((int)in_ECX + 0x4f34) & 0x1f) ^ uVar8; *(uint *)((int)in_ECX + 0x4f28) = uVar8; emberScale = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283062e-10 * 0.3 + 0.5; fVar11 = emberScale * g_vectorOne.x; (((ANM2 *)((int)local_dc.y + 0x48))->_scale).y = emberScale * g_vectorOne.y; (((ANM2 *)((int)local_dc.y + 0x48))->_scale).x = fVar11; puVar12 = puStack_20; } } else if (iVar2 == 0xf) { puVar12 = local_68 + 100; if (((in_stack_00000008 == 0) && (puVar12 = local_68 + 100, in_stack_00000004 == 5)) && (puVar12 = local_68 + 100, in_stack_00000010 != 2)) { puStack_20 = local_68 + 100; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94084) && (puStack_20 = local_68 + 100, _Init_thread_header(&DAT_00c94084,uVar7), DAT_00c94084 == -1) ) { Color::Color(0x3f4ccccd); _Init_thread_footer(&DAT_00c94084); } FUN_0093b530(); if (isFlipX == 0) { fVar11 = 10.0; } else { fVar11 = -10.0; } detailPos.x = fVar11 + detailPos.x; if (isFlipY == 0) { fVar11 = 20.0; } else { fVar11 = -20.0; } detailPos.y = fVar11 + detailPos.y; uVar8 = Random(); local_dc.y = (float)Game::Spawn(g_game,1000,0x79,&detailPos,&g_vectorZero,(Entity *)0x0,0, uVar8); flags = ((Entity *)local_dc.y)->_flags; puVar1 = (uint *)((int)&((Entity *)local_dc.y)->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&((Entity *)local_dc.y)->_flags = (int)flags; (**(code **)(*(int *)local_dc.y + 0x3c))(&DAT_00c94088,0xffffffff,0xff,0,1); puVar12 = &DAT_bf800000; (((ANM2 *)((int)local_dc.y + 0x48))->_scale).x = 0.15; (((ANM2 *)((int)local_dc.y + 0x48))->_scale).y = 0.2; if (isFlipX == 0) { puVar13 = (undefined1 *)0x3f800000; } else { puVar13 = puVar12; } if (isFlipY == 0) { puVar12 = (undefined1 *)0x3f800000; } ((ANM2 *)((int)local_dc.y + 0x48))->_rotation = (float)puVar12 * (float)puVar13 * -20.0; puVar12 = puStack_20; } } else { puVar12 = local_68 + 100; if (iVar2 == 9) { if ((in_stack_00000004 != 0) || (puVar12 = local_68 + 100, in_stack_00000008 != 0)) { puVar12 = local_68 + 100; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c940b4) && (_Init_thread_header(&DAT_00c940b4,uVar7), puVar12 = puStack_20, DAT_00c940b4 == -1)) { _DAT_00c940d8 = 0x3d808081; _DAT_00c940c8 = 0; uRam00c940cc = 0; uRam00c940d0 = 0; uRam00c940d4 = 0; _DAT_00c940b8 = 0; uRam00c940bc = 0; uRam00c940c0 = 0; uRam00c940c4 = 0x3f4ccccd; _DAT_00c940dc = 0x3d70f0f2; _DAT_00c940e0 = 0x3da8a8a9; _Init_thread_footer(&DAT_00c940b4); puVar12 = puStack_20; } puStack_20 = puVar12; backdrop_wall_normal(in_stack_00000018,in_stack_0000001c); wallPos = (float *)FUN_0093b530(); rng = (RNG *)((int)in_ECX + 0x4f28); fVar11 = RNG::RandomFloat(rng); local_dc.y = fVar11 * 40.0 + 20.0; detailPos.x = local_f0 * local_dc.y + *wallPos; detailPos.y = (float)local_ec * local_dc.y + wallPos[1]; local_dc.y = cos(1.5707964); fVar11 = sin(1.5707964); local_c4 = (float)local_ec * local_dc.y; local_ec = (Entity *)(local_f0 * local_dc.y - (float)local_ec * fVar11); local_c4 = local_c4 + local_f0 * fVar11; fVar11 = RNG::RandomFloat(rng); local_dc.y = fVar11 * 10.0 - 10.0; detailPos.x = detailPos.x + local_dc.y * (float)local_ec; detailPos.y = detailPos.y + local_dc.y * local_c4; uVar8 = Random(); local_dc.y = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 1.0; uVar8 = RNG::Next(rng); detail = Game::Spawn(g_game,1000,7,&detailPos,&g_vectorZero,(Entity *)0x0,0,uVar8); pcVar4 = *(code **)(*(int *)detail + 0x3c); (detail->_sprite)._scale.x = local_dc.y; (detail->_sprite)._scale.y = local_dc.y; (*pcVar4)(&DAT_00c940b8,0xffffffff,0xff,0,1); (**(code **)(*(int *)detail + 0xc))(); in_stack_00000014 = (float *)local_e4.y; puVar12 = puStack_20; if (in_stack_00000004 == 3) { FUN_0093b530(); uVar8 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar8); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x2c; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/backdrop/15_The Dank Depths_details.anm2" ,0x2d); local_14 = 0; ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar8 = anm2Path._capacity + 1; pcVar10 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar8) { pcVar10 = *(char **)(anm2Path._buf._0_4_ + -4); uVar8 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar10,uVar8); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; color = (ColorMod *)FUN_0070c570(local_94); Sprite::SetColor((Sprite *)&detail->_sprite,color); bVar6 = ANM2::SetAnimation(&detail->_sprite,(byte *)"pillar",1); if (bVar6 != 0) { AnimationState::Rewind(&(detail->_sprite)._animState); (detail->_sprite)._animState._isPlaying = 1; in_stack_00000014 = (float *)local_e4.y; } *(uint *)&detail->_flags = (uint)detail->_flags | 8; (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = isFlipY; *(undefined4 *)((int)&detail->_flags + 4) = *(undefined4 *)((int)&detail->_flags + 4); puVar12 = puStack_20; } } puStack_20 = puVar12; puVar12 = puStack_20; if ((in_stack_0000000c == 0) && ((in_stack_00000010 == 1 || (in_stack_00000010 == 3)))) { FUN_0093b530(); uVar8 = Random(); local_dc.y = (float)Game::Spawn(g_game,1000,0x8c,&local_f8,&g_vectorZero,(Entity *)0x0,0, uVar8); local_ec = (Entity *)&((Entity *)local_dc.y)->_sprite; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x2c; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/backdrop/15_The Dank Depths_details.anm2", 0x2d); local_14 = 1; ANM2::Load((ANM2 *)local_ec,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar8 = anm2Path._capacity + 1; pcVar10 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar8) { pcVar10 = *(char **)(anm2Path._buf._0_4_ + -4); uVar8 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar10,uVar8); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; if ((in_stack_00000004 == 0) && (in_stack_00000008 == 0)) { local_c4 = (float)CONCAT22(local_c4._2_2_,0x30); } else { axisChar = 0x68; slotDigit = slotXChar; if (in_stack_00000004 == 0) { axisChar = 0x76; slotDigit = slotYChar; } local_c4._0_2_ = CONCAT11(slotDigit + '0',axisChar); local_c4 = (float)(CONCAT22(local_c4._2_2_,(undefined2)local_c4) & 0xff00ffff); } bVar6 = ANM2::SetAnimation((ANM2 *)local_ec,(byte *)&local_c4,1); detail = local_ec; if (bVar6 != 0) { AnimationState::Rewind((AnimationState *)&local_ec->_subtype); ((AnimationState *)&detail->_subtype)->_isPlaying = 1; in_stack_00000014 = (float *)local_e4.y; } *(byte *)((int)local_ec + 0x100) = isFlipX; ((ANM2 *)((int)local_dc.y + 0x48))->_flipY = isFlipY; uVar14 = FUN_0070c570(local_68); Sprite::SetColor((Sprite *)((ulonglong)uVar14 >> 0x20),(ColorMod *)uVar14); uVar3 = *(undefined4 *)((int)((int)local_dc.y + 0x168) + 4); *(uint *)((int)local_dc.y + 0x168) = (uint)*(qword *)((int)local_dc.y + 0x168) | 0x2008; *(undefined4 *)((int)((int)local_dc.y + 0x168) + 4) = uVar3; puVar12 = puStack_20; } } } puStack_20 = puVar12; local_c4 = (float)(*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 9 & 0xffffff01); iVar2 = *(int *)((int)in_ECX + 0x150); if (iVar2 == 0x2d) { if (in_stack_0000000c == 1) { if ((in_stack_00000004 < 3) || ((in_stack_00000004 - 1U & 1) != 0)) { if (in_stack_00000008 < 3) { ExceptionList = local_1c; return; } if ((in_stack_00000008 - 1U & 1) != 0) { ExceptionList = local_1c; return; } } if ((byte)local_c4 != 0) { ExceptionList = local_1c; return; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c940e4) && (_Init_thread_header(&DAT_00c940e4,uVar7), DAT_00c940e4 == -1)) { Color::Color(0x3f800000); _Init_thread_footer(&DAT_00c940e4); } backdrop_wall_normal(in_stack_00000018,in_stack_0000001c); wallPos = (float *)FUN_0093b530(); spawnPos.y = detailPos.y * 20.0 + wallPos[1]; spawnPos.x = detailPos.x * 20.0 + *wallPos; uVar7 = Random(); uVar8 = RNG::RandomInt((RNG *)((int)in_ECX + 0x4f28),0x28); detail = Game::Spawn(g_game,1000,0x79,&spawnPos,&g_vectorZero,(Entity *)0x0,(uint)(uVar8 == 0) ,uVar7); flags = detail->_flags; puVar1 = (uint *)((int)&detail->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detail->_flags = (int)flags; iVar2 = *(int *)detail; (detail->_posOffset).x = detailPos.x * -20.0; (detail->_posOffset).y = detailPos.y * -20.0; (**(code **)(iVar2 + 0x3c))(&DAT_00c940e8,0xffffffff,0xff,0,1); fVar11 = g_vectorOne.y * 0.5; (detail->_sprite)._scale.x = g_vectorOne.x * 0.5; (detail->_sprite)._scale.y = fVar11; ExceptionList = local_1c; return; } if (in_stack_0000000c != 0) { ExceptionList = local_1c; return; } if (in_stack_00000010 != 1) { ExceptionList = local_1c; return; } if ((((in_stack_00000004 != 3) && (in_stack_00000004 != 5)) && (in_stack_00000004 != 7)) && ((in_stack_00000008 != 3 && (in_stack_00000008 != 5)))) { ExceptionList = local_1c; return; } backdrop_wall_normal(in_stack_00000018,in_stack_0000001c); wallPos = (float *)FUN_0093b530(); spawnPos.x = local_e4.x * 20.0 + *wallPos; spawnPos.y = local_e4.y * 20.0 + wallPos[1]; detailPos.x = spawnPos.x + local_e4.x * 40.0; detailPos.y = local_e4.y * 40.0 + spawnPos.y; gridEntity = Room::GetGridEntityFromPos(g_game->_room,&detailPos); if (gridEntity != (GridEntity *)0x0) { iVar2 = (gridEntity->_desc)._type; if (iVar2 == 2) { ExceptionList = local_1c; return; } if (iVar2 == 3) { ExceptionList = local_1c; return; } if (iVar2 == 4) { ExceptionList = local_1c; return; } if (iVar2 == 5) { ExceptionList = local_1c; return; } if (iVar2 == 6) { ExceptionList = local_1c; return; } if (iVar2 == 0xb) { ExceptionList = local_1c; return; } if (iVar2 == 0xc) { ExceptionList = local_1c; return; } if (iVar2 == 0xe) { ExceptionList = local_1c; return; } } uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar7); local_dc.y = -local_e4.x; flags = detail->_flags; puVar1 = (uint *)((int)&detail->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detail->_flags = (int)flags; (detail->_posOffset).x = local_dc.y * 20.0; (detail->_posOffset).y = -local_e4.y * 20.0; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; local_ec = detail; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x21; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/backdrop/02x_dross_pipes.anm2",0x22); local_14 = 2; ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar7 = anm2Path._capacity + 1; pcVar10 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar7) { pcVar10 = *(char **)(anm2Path._buf._0_4_ + -4); uVar7 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar10,uVar7); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; color = (ColorMod *)FUN_0070c570(local_68); Sprite::SetColor((Sprite *)&detail->_sprite,color); uVar7 = (uint)local_c4 >> 0x10; axisChar = 0x68; if (in_stack_00000004 == 0) { axisChar = 0x76; slotXChar = slotYChar; } local_c4._0_2_ = CONCAT11(slotXChar + '0',axisChar); local_c4 = (float)(CONCAT22((short)uVar7,(undefined2)local_c4) & 0xff00ffff); bVar6 = ANM2::SetAnimation(&detail->_sprite,(byte *)&local_c4,1); if (bVar6 != 0) { AnimationState::Rewind(&(detail->_sprite)._animState); (detail->_sprite)._animState._isPlaying = 1; detail = local_ec; } (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = isFlipY; if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) & 0x1000) == 0) { ExceptionList = local_1c; return; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94114) && (_Init_thread_header(&DAT_00c94114), DAT_00c94114 == -1)) { _DAT_00c94138 = 0x3f19999a; _DAT_00c94128 = 0; uRam00c9412c = 0; uRam00c94130 = 0; uRam00c94134 = 0; _DAT_00c94118 = 0; uRam00c9411c = 0; uRam00c94120 = 0; uRam00c94124 = 0x3f800000; _DAT_00c9413c = 0x3ecccccd; _DAT_00c94140 = 0; _Init_thread_footer(&DAT_00c94114); } if (in_stack_00000004 == 0) { detailPos.x = local_e4.y * 6.0 + local_e4.x * 28.0; detailPos.y = local_dc.y * 6.0 + local_e4.y * 28.0; } else { detailPos.x = local_e4.y * 10.0 + local_e4.x * 24.0; detailPos.y = local_dc.y * 10.0 + local_e4.y * 24.0; } detailPos.x = detailPos.x + spawnPos.x; detailPos.y = detailPos.y + spawnPos.y; uVar7 = Random(); local_dc.y = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 1.0; uVar7 = RNG::Next((RNG *)((int)in_ECX + 0x4f28)); detail = Game::Spawn(g_game,1000,7,&detailPos,&g_vectorZero,(Entity *)0x0,0,uVar7); iVar2 = *(int *)detail; (detail->_sprite)._scale.x = local_dc.y; (detail->_sprite)._scale.y = local_dc.y; (**(code **)(iVar2 + 0x3c))(&DAT_00c94118,0xffffffff,0xff,0,1); (**(code **)(*(int *)detail + 0xc))(); ExceptionList = local_1c; return; } if (iVar2 != 0x20) { if (iVar2 != 0x3a) { if ((iVar2 == 0x2e) || (iVar2 == 0x3b)) { if ((in_stack_0000000c != 0) && (in_stack_0000000c != 1)) { ExceptionList = local_1c; return; } if ((in_stack_00000004 < 2) && (in_stack_00000008 < 2)) { ExceptionList = local_1c; return; } if (in_stack_00000010 != 1) { ExceptionList = local_1c; return; } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94144) && (_Init_thread_header(&DAT_00c94144,uVar7), DAT_00c94144 == -1)) { Color::Color(0x3f800000); _Init_thread_footer(&DAT_00c94144); } backdrop_wall_normal(in_stack_00000018,in_stack_0000001c); wallPos = (float *)FUN_0093b530(); spawnPos.y = detailPos.y * 20.0 + wallPos[1]; spawnPos.x = detailPos.x * 20.0 + *wallPos; uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x79,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar7); flags = detail->_flags; iVar2 = *(int *)detail; puVar1 = (uint *)((int)&detail->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detail->_flags = (int)flags; (detail->_posOffset).x = detailPos.x * 16.0; (detail->_posOffset).y = detailPos.y * 16.0; pAVar5 = &detail[1]._sprite; (pAVar5->_animDefaultName)._buf[0xc] = '\0'; (pAVar5->_animDefaultName)._buf[0xd] = '\0'; (pAVar5->_animDefaultName)._buf[0xe] = '@'; (pAVar5->_animDefaultName)._buf[0xf] = '@'; (**(code **)(iVar2 + 0x3c))(&DAT_00c94148,0xffffffff,0xff,0,1); fVar11 = RNG::RandomFloat((RNG *)((int)in_ECX + 0x4f28)); fVar11 = fVar11 * 0.1 + 0.2; (detail->_sprite)._scale.x = (ABS(detailPos.y) + 1.0) * fVar11; (detail->_sprite)._scale.y = (ABS(detailPos.x) + 1.0) * fVar11; ExceptionList = local_1c; return; } if ((iVar2 == 0x21) || (iVar2 == 0x29)) { if ((in_stack_00000004 != 2) && (((in_stack_00000004 != 4 && (in_stack_00000004 != 6)) && (in_stack_00000008 != 3)))) { ExceptionList = local_1c; return; } backdrop_wall_normal(in_stack_00000018,in_stack_0000001c); wallPos = (float *)FUN_0093b530(); detailPos.x = spawnPos.x * 20.0 + *wallPos; detailPos.y = spawnPos.y * 20.0 + wallPos[1]; uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&detailPos,&g_vectorZero,(Entity *)0x0,0,uVar7); (detail->_posOffset).x = -spawnPos.x * 20.0; (detail->_posOffset).y = -spawnPos.y * 20.0; color = (ColorMod *)FUN_0070c570(local_68); Sprite::SetColor((Sprite *)&detail->_sprite,color); flags = detail->_flags; puVar1 = (uint *)((int)&detail->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detail->_flags = (int)flags; uVar7 = RNG::RandomInt((RNG *)((int)in_ECX + 0x4f28),3); if (uVar7 == 0) { pcVar10 = "gfx/backdrop/05x_mausoleumB_torches_off.anm2"; if (*(int *)((int)in_ECX + 0x150) != 0x29) { pcVar10 = "gfx/backdrop/05x_mausoleum_torches_off.anm2"; } std::string::string_from_cstr(anm2Path._buf,(byte *)pcVar10); local_14 = 9; } else { pcVar10 = "gfx/backdrop/05x_mausoleumB_torches.anm2"; if (*(int *)((int)in_ECX + 0x150) != 0x29) { pcVar10 = "gfx/backdrop/05x_mausoleum_torches.anm2"; } std::string::string_from_cstr(anm2Path._buf,(byte *)pcVar10); local_14 = 10; } ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); uVar7 = (uint)local_c4 >> 0x10; axisChar = 0x68; if (in_stack_00000004 == 0) { axisChar = 0x76; slotXChar = slotYChar; } local_c4._0_2_ = CONCAT11(slotXChar + '0',axisChar); local_c4 = (float)(CONCAT22((short)uVar7,(undefined2)local_c4) & 0xff00ffff); ANM2::Play(&detail->_sprite,(byte *)&local_c4,1); (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = isFlipY; ExceptionList = local_1c; return; } if (iVar2 != 0x2f) { ExceptionList = local_1c; return; } if ((((in_stack_0000000c == 0) && (in_stack_00000010 == 1)) && (((1 < in_stack_00000004 && (in_stack_00000004 < 7)) || ((1 < in_stack_00000008 && (in_stack_00000008 < 5)))))) && (uVar7 = RNG::RandomInt((RNG *)((int)in_ECX + 0x4f28),2), uVar7 == 0)) { FUN_0093b530(); uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&local_f8,&g_vectorZero,(Entity *)0x0,0,uVar7); std::string::string_from_cstr (anm2Path._buf,(byte *)"gfx/backdrop/06x_gehenna_wall_details.anm2"); local_14 = 0xb; ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); color = (ColorMod *)FUN_0070c570(local_68); Sprite::SetColor((Sprite *)&detail->_sprite,color); detail->_sortingLayer = 1; axisChar = 0x68; uVar7 = (uint)local_c4 >> 0x10; if (in_stack_00000004 == 0) { axisChar = 0x76; slotXChar = slotYChar; } local_c4._0_2_ = CONCAT11(slotXChar + '0',axisChar); local_c4 = (float)(CONCAT22((short)uVar7,(undefined2)local_c4) & 0xff00ffff); ANM2::Play(&detail->_sprite,(byte *)&local_c4,1); (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = isFlipY; } if (in_stack_00000004 != 2) { ExceptionList = local_1c; return; } if (isFlipY != 0) { ExceptionList = local_1c; return; } local_dc.y = (float)((int)in_ECX + 0x4f28); uVar7 = RNG::RandomInt((RNG *)local_dc.y,3); if (uVar7 == 0) { ExceptionList = local_1c; return; } if (isFlipX == 0) { pVVar9 = &detailPos; spawnPos.x = *(float *)local_e4.y - 52.0; spawnPos.y = *(float *)((int)local_e4.y + 4) - 0.0; } else { pVVar9 = &local_f8; spawnPos.x = *(float *)((int)local_e4.y + 8) + 52.0; spawnPos.y = *(float *)((int)local_e4.y + 0xc) + 0.0; } pVVar9 = backdrop_detail_to_world_pos(pVVar9,&spawnPos); local_e4.x = pVVar9->x; local_e4.y = pVVar9->y; uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&local_e4,&g_vectorZero,(Entity *)0x0,0,uVar7); flags = detail->_flags; puVar1 = (uint *)((int)&detail->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detail->_flags = (int)flags; std::string::string_from_cstr(anm2Path._buf,(byte *)"gfx/backdrop/06x_gehenna_chains.anm2"); local_14 = 0xc; ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); color = (ColorMod *)FUN_0070c570(local_c0); Sprite::SetColor((Sprite *)&detail->_sprite,color); uVar7 = RNG::RandomInt((RNG *)local_dc.y,2); ANM2::SetFrame(&detail->_sprite,&(detail->_sprite)._animDefaultName,uVar7); layerName = (byte *)0x0; (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = 0; detail->_renderZOffset = 0x40000000; if ((detail->_sprite)._layerCount == 0) { ExceptionList = local_1c; return; } do { uVar7 = RNG::RandomInt((RNG *)local_dc.y,3); isLayerVisible = uVar7 == 0; layer = ANM2::GetLayer(&detail->_sprite,layerName); layerName = layerName + 1; layer->_visible = isLayerVisible; } while (layerName < (byte *)(detail->_sprite)._layerCount); ExceptionList = local_1c; return; } uVar7 = (uint)local_c4 >> 8; local_c4 = (float)CONCAT31((int3)uVar7,1); } if (in_stack_0000000c != 1) { if (in_stack_0000000c == 2) { if (in_stack_00000004 != 0) { ExceptionList = local_1c; return; } if (in_stack_00000008 != 0) { ExceptionList = local_1c; return; } FUN_0093b530(); uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&local_f8,&g_vectorZero,(Entity *)0x0,0,uVar7); if ((byte)local_c4 == 0) { std::string::string_from_cstr (anm2Path._buf,(byte *)"gfx/backdrop/03x_mines_bg_details.anm2"); local_14 = 6; ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); } else { anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/backdrop/03x_mines_bg_details_dark.anm2",0x2b ); local_14 = 5; ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar7 = anm2Path._capacity + 1; ptr = (void *)anm2Path._buf._0_4_; if (0xfff < uVar7) { ptr = *(void **)(anm2Path._buf._0_4_ + -4); uVar7 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; } color = (ColorMod *)FUN_0070c570(local_68); Sprite::SetColor((Sprite *)&detail->_sprite,color); ANM2::Play(&detail->_sprite,&DAT_00b63104,1); *(uint *)&detail->_flags = (uint)detail->_flags | 8; (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = isFlipY; *(undefined4 *)((int)&detail->_flags + 4) = *(undefined4 *)((int)&detail->_flags + 4); ExceptionList = local_1c; return; } if (in_stack_0000000c != 0) { ExceptionList = local_1c; return; } if (in_stack_00000004 != 2) { ExceptionList = local_1c; return; } if (isFlipY != 0) { ExceptionList = local_1c; return; } uVar7 = RNG::RandomInt((RNG *)((int)in_ECX + 0x4f28),4); if (uVar7 != 0) { ExceptionList = local_1c; return; } if (isFlipX == 0) { pVVar9 = &local_dc; detailPos.x = *in_stack_00000014 - 52.0; detailPos.y = in_stack_00000014[1] - 0.0; } else { pVVar9 = &local_f8; detailPos.x = in_stack_00000014[2] + 52.0; detailPos.y = in_stack_00000014[3] + 0.0; } pVVar9 = backdrop_detail_to_world_pos(pVVar9,&detailPos); spawnPos.x = pVVar9->x; spawnPos.y = pVVar9->y; uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar7); flags = detail->_flags; puVar1 = (uint *)((int)&detail->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detail->_flags = (int)flags; if ((byte)local_c4 == 0) { std::string::string_from_cstr(anm2Path._buf,(byte *)"gfx/backdrop/03x_mines_lanterns.anm2"); local_14 = 8; } else { std::string::string_from_cstr (anm2Path._buf,(byte *)"gfx/backdrop/03x_mines_lanterns_dark.anm2"); local_14 = 7; } ANM2::Load(&detail->_sprite,&anm2Path,1); local_14 = 0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); color = (ColorMod *)FUN_0070c570(local_68); Sprite::SetColor((Sprite *)&detail->_sprite,color); ANM2::SetFrame(&detail->_sprite,&(detail->_sprite)._animDefaultName,0); (detail->_sprite)._flipX = isFlipX; (detail->_sprite)._flipY = 0; detail->_renderZOffset = 0x40000000; spawn_detail_effects(in_stack_00000018,0); ExceptionList = local_1c; return; } if (in_stack_00000004 != 0) { ExceptionList = local_1c; return; } if (in_stack_00000008 != 0) { ExceptionList = local_1c; return; } FUN_0093b530(); uVar7 = Random(); detail = Game::Spawn(g_game,1000,0x8c,&spawnPos,&g_vectorZero,(Entity *)0x0,0,uVar7); anm2Path._size = 0; anm2Path._capacity = 0xf; pAVar5 = &detail->_sprite; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; local_dc.y = (float)detail; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._capacity = 0x2f; if ((byte)local_c4 == 0) { anm2Path._size = 0x26; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/backdrop/03x_mines_bg_details.anm2",0x27); local_14 = 4; ANM2::Load(pAVar5,&anm2Path,1); local_14 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0093cf41; uVar7 = anm2Path._capacity + 1; pcVar10 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar7) { pcVar10 = *(char **)(anm2Path._buf._0_4_ + -4); uVar7 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } else { anm2Path._size = 0x2b; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/backdrop/03x_mines_bg_details_dark.anm2",0x2c); local_14 = 3; ANM2::Load(pAVar5,&anm2Path,1); local_14 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0093cf41; uVar7 = anm2Path._capacity + 1; pcVar10 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar7) { uVar7 = anm2Path._capacity + 0x24; pcVar10 = *(char **)(anm2Path._buf._0_4_ + -4); if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)*(char **)(anm2Path._buf._0_4_ + -4)))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } } local_14 = 0xffffffff; operator_delete(pcVar10,uVar7); LAB_0093cf41: anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; anm2Path._capacity = 0xf; anm2Path._size = 0; bVar6 = ANM2::SetAnimation(pAVar5,&DAT_00b670e4,1); flipTarget = detail; if (bVar6 != 0) { AnimationState::Rewind(&(detail->_sprite)._animState); (detail->_sprite)._animState._isPlaying = 1; flipTarget = (Entity *)local_dc.y; } (detail->_sprite)._flipX = isFlipX; (flipTarget->_sprite)._flipY = isFlipY; color = (ColorMod *)FUN_0070c570(local_68); Sprite::SetColor((Sprite *)pAVar5,color); spawn_detail_effects(in_stack_00000018,in_stack_0000001c); uVar3 = *(undefined4 *)((int)&flipTarget->_flags + 4); *(uint *)&flipTarget->_flags = (uint)flipTarget->_flags | 0x2008; *(undefined4 *)((int)&flipTarget->_flags + 4) = uVar3; ExceptionList = local_1c; return; } //@@ 0093d510 Backdrop::render_wall_detail /* DB: ? ECX = Backdrop (ANM2 at +0x4f3c), 6 calls from Backdrop::pre_render_walls: randomizes layer visibility/frames by layer name prefix 'h'/'v' with the RNG arg and a chance, renders (AnimationState::Render), then for nulls named "*" spawns at backdrop_detail_to_world_pos via Game::SpawnEx; strings "%s: No null with Id %d", "LayerId out of bounds" prototype: db/protos.zhl, confirmed by RET 28 */ void __thiscall Backdrop::render_wall_detail (Backdrop *this,RNG *rng,Vector *position,byte isFlipX,byte isFlipY,byte isHorizontal, byte isVertical,float chance) { uint *puVar1; code *pcVar2; ANM2 *pAVar3; qword qVar4; LayerState *pLVar5; char *nullName; Backdrop *nullTrack; Entity *detailEffect; byte *layerName; AnimationState *this_00; char *nullNameChars; uint uVar6; float *nullFrame; int iVar7; Backdrop layerId; float offsetX; float offsetY; int *local_20; Vector local_14; Backdrop count; Backdrop animData; void *layerData; count = this[0x13ef]; local_14.x = *(float *)(this + 0x13dc); if (this[0x54] == (Backdrop)0x2a) { if (isFlipY == 0) { chance = 1.0; } else { chance = 0.0; } } layerId = (Backdrop)0x0; if (count != (Backdrop)0x0) { local_20 = (int *)((int)local_14.x + 0x38); do { pLVar5 = ANM2::GetLayer((ANM2 *)(this + 0x13cf),(byte *)layerId); layerData = pLVar5->_layerData; if (layerData == (void *)0x0) { layerName = &s_empty; } else { layerName = (byte *)((int)layerData + 8); if (0xf < *(uint *)((int)layerData + 0x1c)) { layerName = *(byte **)layerName; } } if (*layerName == 0x68) { if (isHorizontal != 0) goto LAB_0093d61e; LAB_0093d5a4: pLVar5->_visible = 0; } else { if ((*layerName != 0x76) || (isVertical == 0)) goto LAB_0093d5a4; LAB_0093d61e: uVar6 = rng->_seed; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = rng->_seed; if (uVar6 == 0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } uVar6 = uVar6 >> ((byte)rng->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)rng->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)rng->_shift3 & 0x1f) ^ uVar6; rng->_seed = uVar6; if (chance <= (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283062e-10) goto LAB_0093d5a4; pLVar5->_visible = 1; uVar6 = RNG::RandomInt(rng,*(uint *)(*(int *)((int)local_14.x + 0x18) + 8 + *local_20 * 0x10 )); ANM2::SetLayerFrame((ANM2 *)(this + 0x13cf),(int)layerId,uVar6); } local_20 = local_20 + 1; layerId = (Backdrop)((int)layerId + 1); } while ((uint)layerId < (uint)count); } *(byte *)(this + 0x140f) = isFlipX; this[0x140f].field_0x1 = isFlipY; if (this[0x1411].field_0x1 != '\0') { this_00 = (AnimationState *)(this + 0x13e3); if (*(char *)(this + 0x13eb) == '\0') { AnimationState::Render((AnimationState *)(this + 0x13db),position,&g_vectorZero,&g_vectorZero) ; } else { AnimationState::Render(this_00,position,&g_vectorZero,&g_vectorZero); this_00 = (AnimationState *)(this + 0x13db); } AnimationState::Render(this_00,position,&g_vectorZero,&g_vectorZero); } if (((this[0x54] != (Backdrop)0x3a) && (this[0x54] != (Backdrop)0x3b)) && ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 9 & 1) == 0)) { count = this[0x13f1]; layerId = (Backdrop)0x0; if (count != (Backdrop)0x0) { local_20 = (int *)0x0; do { if (((int)layerId < 0) || ((int)this[0x13f1] <= (int)layerId)) { KAGE_LogMessage(0x10,(byte *)"%s: No null with Id %d\n"); } nullName = (char *)((int)this[0x13f0] + (int)local_20); nullNameChars = nullName; if (0xf < *(uint *)(nullName + 0x14)) { nullNameChars = *(char **)nullName; } if (*nullNameChars == '*') { if (0xf < *(uint *)(nullName + 0x14)) { nullName = *(char **)nullName; } layerName = (byte *)atoi(nullName + 1); pLVar5 = ANM2::GetLayer((ANM2 *)(this + 0x13cf),layerName); if ((pLVar5->_visible != 0) && (this[0x13dc] != (Backdrop)0x0)) { if (((((int)layerName < 0) || (*(int *)((int)this[0x13db] + 0x80) <= (int)layerName)) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), (int)layerName < 0)) || (*(int *)((int)this[0x13db] + 0x80) <= (int)layerName)) { iVar7 = 0; } else { iVar7 = *(int *)((int)this[0x13dd] + *(int *)((int)this[0x13dc] + 0x38 + (int)layerName * 4) * 4); } animData = this[0x13dc]; if (((animData != (Backdrop)0x0) && (-1 < (int)layerId)) && ((int)layerId < (int)this[0x13f1])) { uVar6 = 0; if (*(uint *)((int)animData + 0x24) != 0) { nullTrack = *(Backdrop **)((int)animData + 0x20); do { if (((*nullTrack == layerId) && (-1 < iVar7)) && (iVar7 < (int)nullTrack[3])) { nullFrame = (float *)(iVar7 * 0x54 + (int)nullTrack[2]); if ((nullFrame != (float *)0x0) && (*(char *)(nullFrame + 3) != '\0')) { offsetX = *nullFrame / 0.65; offsetY = nullFrame[1] / 0.65; backdrop_detail_to_world_pos(&local_14,position); if (isFlipX != 0) { offsetX = -offsetX; } local_14.x = offsetX + local_14.x; if (isFlipY != 0) { offsetY = -offsetY; } local_14.y = offsetY + local_14.y; uVar6 = Random(); detailEffect = Game::SpawnEx(g_game,1000,0x79,&local_14,&g_vectorZero, (Entity *)0x0,0,uVar6,0); qVar4 = detailEffect->_flags; iVar7 = *(int *)detailEffect; puVar1 = (uint *)((int)&detailEffect->_flags + 4); *puVar1 = *puVar1 | 0x40; *(int *)&detailEffect->_flags = (int)qVar4; pAVar3 = &detailEffect[1]._sprite; (pAVar3->_animDefaultName)._buf[0xc] = '\0'; (pAVar3->_animDefaultName)._buf[0xd] = '\0'; (pAVar3->_animDefaultName)._buf[0xe] = '@'; (pAVar3->_animDefaultName)._buf[0xf] = '@'; (**(code **)(iVar7 + 0x3c))(nullFrame + 6,0xffffffff,0xff,0,1); (detailEffect->_sprite)._scale.x = nullFrame[4]; (detailEffect->_sprite)._scale.y = nullFrame[5]; } break; } uVar6 = uVar6 + 1; nullTrack = nullTrack + 4; } while (uVar6 < *(uint *)((int)animData + 0x24)); } } } } local_20 = (int *)((int)local_20 + 0x18); layerId = (Backdrop)((int)layerId + 1); } while ((uint)layerId < (uint)count); } } return; } //@@ 0093d960 Backdrop::Init /* ZHL [exact] __thiscall void Backdrop::Init(uint32_t backdropId, bool LoadGraphics); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Backdrop::Init(Backdrop *this,uint backdropId,byte LoadGraphics) { int iVar1; Game *pGVar2; if (((int)backdropId < 0) || (0x3e < (int)backdropId)) { backdropId = 1; } this[0x54] = (Backdrop)backdropId; pGVar2 = g_game; this[0x13c6] = (Backdrop)0x42500000; this[0x13c7] = (Backdrop)0x42500000; iVar1 = *(int *)((int)pGVar2->_room + 0x10); this[0x13c8] = (Backdrop)((float)(*(int *)((int)pGVar2->_room + 0xc) + -2) * 26.0 + 52.0); this[0x13c9] = (Backdrop)((float)(iVar1 + -2) * 26.0 + 52.0); if (LoadGraphics != 0) { load_details(this); } return; } //@@ 0093da00 Backdrop::load_details /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: gfx/backdrop *_details anm2; Backdrop::Init/Dogma prototype: db/protos.zhl */ void __thiscall Backdrop::load_details(Backdrop *this) { int iVar1; int iVar2; byte bVar3; undefined4 *renderTargetEntry; LayerState *layer; void *loadedImage; byte *pbVar4; int newBlendMode1; Backdrop BVar5; char *freeBlock; std_string *detailsPath; Backdrop BVar6; uint uVar7; Game *game; bool isLess; int iVar8; Vector local_80; byte isLayerVisible; undefined1 imageRef [4]; Backdrop local_70; std_string gehennaPath; std_string imagePath; std_string tmpString; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int savedBlendMode2; char strChar; puStack_20 = imageRef + 0x70; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b3e5; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(imageRef + 100); ExceptionList = &local_1c; *(undefined1 *)(this + 8) = 0; ANM2::Reset((ANM2 *)(this + 0xf)); ANM2::Reset((ANM2 *)(this + 0x13cf)); if (this[0x1456].field_0x1 == '\0') { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x20); tmpString._size = 0x1a; tmpString._capacity = 0x1f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/backdrop/controls.anm2",0x1b); local_14 = 0; ANM2::Load((ANM2 *)(this + 0x1414),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } } if (this[0x149b].field_0x1 == '\0') { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x22; tmpString._capacity = 0x2f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/backdrop/controls_buttons.anm2",0x23); local_14 = 1; ANM2::Load((ANM2 *)(this + 0x1459),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } } local_80.x = 0.0; local_80.y = 0.0; std::vector::resize(&local_80); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; if (this[0xb] != (Backdrop)0x0) { KAGE::SmartPointer::reset(this + 0xb,(void *)0x0); } BVar5 = this[0x54]; if ((BVar5 == (Backdrop)0x1a) || (BVar5 == (Backdrop)0x12)) { BVar5 = (Backdrop)(this + (int)BVar5 * 0x4f + 0x56); if (0xf < (uint)*(Backdrop *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = (char *)0x0; BVar6 = BVar5; do { strChar = *(char *)BVar6; BVar6 = (Backdrop)((int)BVar6 + 1); } while (strChar != '\0'); std::string::assign(tmpString._buf,(byte *)BVar5,(int)BVar6 - (int)((int)BVar5 + 1)); local_14 = 2; ANM2::Load((ANM2 *)(this + 0xf),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_0093e16c; } operator_delete(freeBlock,uVar7); } if (this[0x54] != (Backdrop)0x12) goto LAB_0093e713; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*this,0); RenderTarget::Clear(&DAT_00c798e0); tmpString._size = g_graphicsManager_blendMode[3]; savedBlendMode2 = g_graphicsManager_blendMode[2]; iVar8 = g_graphicsManager_blendMode[0]; local_70 = (Backdrop)g_graphicsManager_blendMode[4]; newBlendMode1 = 1; if ((g_graphicsManager_flags & 4) == 0) { newBlendMode1 = 6; } g_graphicsManager_blendMode[0] = 0; iVar1 = g_graphicsManager_blendMode[0]; g_graphicsManager_blendMode[2] = 7; iVar2 = g_graphicsManager_blendMode[2]; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; BVar5 = this[0x1c]; g_graphicsManager_blendMode[0]._0_1_ = (undefined1)iVar8; g_graphicsManager_blendMode[0]._1_1_ = SUB41(iVar8,1); g_graphicsManager_blendMode[0]._2_1_ = SUB41(iVar8,2); g_graphicsManager_blendMode[0]._3_1_ = SUB41(iVar8,3); tmpString._buf[4] = (undefined1)g_graphicsManager_blendMode[0]; tmpString._buf[5] = g_graphicsManager_blendMode[0]._1_1_; tmpString._buf[6] = g_graphicsManager_blendMode[0]._2_1_; tmpString._buf[7] = g_graphicsManager_blendMode[0]._3_1_; tmpString._buf[8] = (undefined1)g_graphicsManager_blendMode[1]; tmpString._buf[9] = g_graphicsManager_blendMode[1]._1_1_; tmpString._buf[10] = g_graphicsManager_blendMode[1]._2_1_; tmpString._buf[0xb] = g_graphicsManager_blendMode[1]._3_1_; g_graphicsManager_blendMode[2]._0_1_ = (undefined1)savedBlendMode2; g_graphicsManager_blendMode[2]._1_1_ = SUB41(savedBlendMode2,1); g_graphicsManager_blendMode[2]._2_1_ = SUB41(savedBlendMode2,2); g_graphicsManager_blendMode[2]._3_1_ = SUB41(savedBlendMode2,3); tmpString._buf[0xc] = (undefined1)g_graphicsManager_blendMode[2]; tmpString._buf[0xd] = g_graphicsManager_blendMode[2]._1_1_; tmpString._buf[0xe] = g_graphicsManager_blendMode[2]._2_1_; tmpString._buf[0xf] = g_graphicsManager_blendMode[2]._3_1_; g_graphicsManager_blendMode[0] = iVar1; g_graphicsManager_blendMode[1] = newBlendMode1; g_graphicsManager_blendMode[2] = iVar2; if (BVar5 == (Backdrop)0x0) { LAB_0093e5fc: bVar3 = ANM2::SetAnimation((ANM2 *)(this + 0xf),s_Idle2,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x1b)); *(undefined1 *)(this + 0x20) = 1; } } else { if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } pbVar4 = s_Idle2; do { bVar3 = *(byte *)BVar5; isLess = bVar3 < *pbVar4; if (bVar3 != *pbVar4) { LAB_0093e5e4: uVar7 = -(uint)isLess | 1; goto LAB_0093e5e9; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)BVar5 + 1); isLess = bVar3 < pbVar4[1]; if (bVar3 != pbVar4[1]) goto LAB_0093e5e4; BVar5 = (Backdrop)((int)BVar5 + 2); pbVar4 = pbVar4 + 2; } while (bVar3 != 0); uVar7 = 0; LAB_0093e5e9: if ((uVar7 != 0) || ((*(char *)((int)this[0x1c] + 0x34) != '\0' && (*(char *)(this + 0x20) == '\0')))) goto LAB_0093e5fc; } g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; local_80.y = DAT_00c35e74 + (float)this[0x13c7]; local_80.x = DAT_00c35e70 + (float)this[0x13c6]; ANM2::Render((ANM2 *)(this + 0xf),&local_80,&g_vectorZero,&g_vectorZero); g_graphicsManager_flags = g_graphicsManager_flags | 2; g_graphicsManager_blendMode[0]._0_1_ = tmpString._buf[4]; g_graphicsManager_blendMode[0]._1_1_ = tmpString._buf[5]; g_graphicsManager_blendMode[0]._2_1_ = tmpString._buf[6]; g_graphicsManager_blendMode[0]._3_1_ = tmpString._buf[7]; g_graphicsManager_blendMode[1]._0_1_ = tmpString._buf[8]; g_graphicsManager_blendMode[1]._1_1_ = tmpString._buf[9]; g_graphicsManager_blendMode[1]._2_1_ = tmpString._buf[10]; g_graphicsManager_blendMode[1]._3_1_ = tmpString._buf[0xb]; g_graphicsManager_blendMode[2]._0_1_ = tmpString._buf[0xc]; g_graphicsManager_blendMode[2]._1_1_ = tmpString._buf[0xd]; g_graphicsManager_blendMode[2]._2_1_ = tmpString._buf[0xe]; g_graphicsManager_blendMode[2]._3_1_ = tmpString._buf[0xf]; g_graphicsManager_blendMode[3] = tmpString._size; g_graphicsManager_blendMode[4] = (int)local_70; _glfw_context_reset(1); BVar5 = this[0x1c]; if (BVar5 != (Backdrop)0x0) { BVar6 = BVar5; if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar6 = *(Backdrop *)BVar5; } pbVar4 = &DAT_00b601c4; do { bVar3 = *(byte *)BVar6; isLess = bVar3 < *pbVar4; if (bVar3 != *pbVar4) { LAB_0093e6e2: uVar7 = -(uint)isLess | 1; goto LAB_0093e6e7; } if (bVar3 == 0) break; bVar3 = *(byte *)((int)BVar6 + 1); isLess = bVar3 < pbVar4[1]; if (bVar3 != pbVar4[1]) goto LAB_0093e6e2; BVar6 = (Backdrop)((int)BVar6 + 2); pbVar4 = pbVar4 + 2; } while (bVar3 != 0); uVar7 = 0; LAB_0093e6e7: if ((uVar7 == 0) && ((*(byte *)((int)BVar5 + 0x34) == 0 || (*(char *)(this + 0x20) != '\0')))) goto LAB_0093e713; } bVar3 = ANM2::SetAnimation((ANM2 *)(this + 0xf),&DAT_00b601c4,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x1b)); *(undefined1 *)(this + 0x20) = 1; } goto LAB_0093e713; } if (BVar5 == (Backdrop)0x23) { BVar5 = (Backdrop)(this + 0xb23); if (0xf < (uint)this[0xb28]) { BVar5 = *(Backdrop *)BVar5; } std::string::string_from_cstr(tmpString._buf,(byte *)BVar5); local_14 = 3; ANM2::Load((ANM2 *)(this + 0xf),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } bVar3 = ANM2::SetAnimation((ANM2 *)(this + 0xf),s_Idle,1); if (((bVar3 != 0) && (this[0x1c] != (Backdrop)0x0)) && (AnimationState::SetFrameFloat((AnimationState *)(this + 0x1b),0.0), this[0x1c] != (Backdrop)0x0)) { *(undefined1 *)(this + 0x20) = 0; } iVar8 = *(int *)((int)g_game->_room + 4); if ((iVar8 == 0) || (iVar8 = *(int *)(iVar8 + 0x10), iVar8 == 0)) { local_70 = (Backdrop)0x1; } else { local_70 = *(Backdrop *)(iVar8 + 0x48); } BVar5 = (Backdrop)0x0; if (this[0x2f] != (Backdrop)0x0) { do { BVar6 = (Backdrop)((int)BVar5 + 1); isLayerVisible = BVar6 == local_70; layer = ANM2::GetLayer((ANM2 *)(this + 0xf),(byte *)BVar5); layer->_visible = isLayerVisible; BVar5 = BVar6; } while ((uint)BVar6 < (uint)this[0x2f]); } goto LAB_0093e713; } if ((BVar5 == (Backdrop)0x34) || (BVar5 == (Backdrop)0x35)) { BVar5 = (Backdrop)(this + (int)BVar5 * 0x4f + 0x56); if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } std::string::string_from_cstr(tmpString._buf,(byte *)BVar5); local_14 = 4; ANM2::Load((ANM2 *)(this + 0xf),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_0093e16c; } operator_delete(freeBlock,uVar7); } tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf._0_4_ = tmpString._buf._0_4_ & 0xffffff00; iVar8 = *(int *)(*(int *)(*(int *)((int)g_game->_room + 4) + 0x10) + 0x10) + -10; LAB_0093ddb8: ANM2::SetFrame((ANM2 *)(this + 0xf),(std_string *)s_Idle,iVar8); g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; render_ashpit_ash(); g_graphicsManager_flags = g_graphicsManager_flags | 2; goto LAB_0093e713; } if (BVar5 == (Backdrop)0x36) { BVar5 = (Backdrop)(this + 0x1100); if (0xf < (uint)this[0x1105]) { BVar5 = *(Backdrop *)BVar5; } std::string::string_from_cstr(tmpString._buf,(byte *)BVar5); local_14 = 5; ANM2::Load((ANM2 *)(this + 0xf),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } iVar8 = 0; goto LAB_0093ddb8; } std::string::string(imagePath._buf,this + (int)BVar5 * 0x4f + 0x56); local_14 = 6; if (imagePath._size != 0) { detailsPath = &imagePath; if (0xf < imagePath._capacity) { detailsPath = (std_string *)imagePath._buf._0_4_; } loadedImage = Manager::LoadImage(&local_80,(byte *)detailsPath); local_14._0_1_ = 7; KAGE::SmartPointer::operator_assign(this + 9,loadedImage); local_14 = CONCAT31(local_14._1_3_,6); FUN_0040c440(); } BVar5 = this[0x54]; if (this[(int)BVar5 * 0x4f + 0x60] != (Backdrop)0x0) { BVar5 = (Backdrop)(this + (int)BVar5 * 0x4f + 0x5c); if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } loadedImage = Manager::LoadImage(imageRef,(byte *)BVar5); local_14._0_1_ = 8; KAGE::SmartPointer::operator_assign(this + 0xb,loadedImage); local_14 = CONCAT31(local_14._1_3_,6); FUN_0040c440(); FUN_00a123f0(0,0); BVar5 = this[0x54]; } game = g_game; if ((*(int *)(*(int *)((int)g_game->_room->_descriptor + 0x10) + 0x48) - 9U < 4) && (this[(int)BVar5 * 0x4f + 0x66] != (Backdrop)0x0)) { BVar5 = (Backdrop)(this + (int)BVar5 * 0x4f + 0x62); if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } loadedImage = Manager::LoadImage(imageRef,(byte *)BVar5); local_14._0_1_ = 9; LAB_0093df32: KAGE::SmartPointer::operator_assign(this + 0xd,loadedImage); local_14 = CONCAT31(local_14._1_3_,6); FUN_0040c440(); game = g_game; } else { local_70 = (Backdrop)((int)BVar5 * 0x13c); if ((*(int *)((byte *)((int)local_70 + 0x1b0) + (int)this) != 0) && ((((iVar8 = Room::GetRoomShape(g_game->_room), iVar8 == 2 || (iVar8 == 3)) || (iVar8 == 5)) || (iVar8 == 7)))) { pbVar4 = (byte *)((int)local_70 + 0x1a0) + (int)this; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } loadedImage = Manager::LoadImage(imageRef,pbVar4); local_14._0_1_ = 10; goto LAB_0093df32; } } BVar5 = this[0x54]; switch(BVar5) { case (Backdrop)0x1f: tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x24; tmpString._capacity = 0x2f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/backdrop/01x_downpour_pipes.anm2",0x25); local_14._0_1_ = 0xb; ANM2::Load((ANM2 *)(this + 0x13cf),&tmpString,1); local_14 = CONCAT31(local_14._1_3_,6); if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } local_70 = (Backdrop)(this + 0x13d5); if (0xf < (uint)this[0x13da]) { local_70 = *(Backdrop *)local_70; } BVar5 = this[0x13dc]; if (BVar5 != (Backdrop)0x0) { if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } BVar6 = local_70; do { bVar3 = *(byte *)BVar5; isLess = bVar3 < *(byte *)BVar6; if (bVar3 != *(byte *)BVar6) goto LAB_0093e060; if (bVar3 == 0) break; bVar3 = *(byte *)((int)BVar5 + 1); isLess = bVar3 < *(byte *)((int)BVar6 + 1); if (bVar3 != *(byte *)((int)BVar6 + 1)) goto LAB_0093e060; BVar5 = (Backdrop)((int)BVar5 + 2); BVar6 = (Backdrop)((int)BVar6 + 2); } while (bVar3 != 0); LAB_0093e05c: uVar7 = 0; LAB_0093e065: if ((uVar7 == 0) && ((*(char *)((int)this[0x13dc] + 0x34) == '\0' || (*(char *)(this + 0x13e0) != '\0')))) goto switchD_0093df66_caseD_21; } break; case (Backdrop)0x20: case (Backdrop)0x3a: if (((*(uint *)(*(int *)((int)game->_room + 4) + 0x44) >> 9 & 1) == 0) && (BVar5 != (Backdrop)0x3a)) { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x23; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/backdrop/03x_mines_details.anm2",0x24); local_14._0_1_ = 0xd; } else { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x28; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/backdrop/03x_mines_details_dark.anm2",0x29); local_14._0_1_ = 0xc; } tmpString._capacity = 0x2f; ANM2::Load((ANM2 *)(this + 0x13cf),&tmpString,1); local_14 = CONCAT31(local_14._1_3_,6); if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_0093e16c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar7); } local_70 = (Backdrop)(this + 0x13d5); if (0xf < (uint)this[0x13da]) { local_70 = *(Backdrop *)local_70; } BVar5 = this[0x13dc]; if (BVar5 != (Backdrop)0x0) { if (0xf < *(uint *)((int)BVar5 + 0x14)) { BVar5 = *(Backdrop *)BVar5; } BVar6 = local_70; do { bVar3 = *(byte *)BVar5; isLess = bVar3 < *(byte *)BVar6; if (bVar3 != *(byte *)BVar6) goto LAB_0093e060; if (bVar3 == 0) goto LAB_0093e05c; bVar3 = *(byte *)((int)BVar5 + 1); isLess = bVar3 < *(byte *)((int)BVar6 + 1); if (bVar3 != *(byte *)((int)BVar6 + 1)) goto LAB_0093e060; BVar5 = (Backdrop)((int)BVar5 + 2); BVar6 = (Backdrop)((int)BVar6 + 2); } while (bVar3 != 0); uVar7 = 0; goto LAB_0093e065; } break; default: goto switchD_0093df66_caseD_21; case (Backdrop)0x2a: std::string::string_from_cstr(tmpString._buf,(byte *)"gfx/backdrop/05x_mausoleum_chains.anm2"); local_14 = CONCAT31(local_14._1_3_,0x10); ANM2::Load((ANM2 *)(this + 0x13cf),&tmpString,1); detailsPath = &tmpString; goto LAB_0093e391; case (Backdrop)0x2e: case (Backdrop)0x3b: if (((*(uint *)(*(int *)((int)game->_room + 4) + 0x44) >> 9 & 1) == 0) && (BVar5 != (Backdrop)0x3b)) { std::string::string_from_cstr(tmpString._buf,(byte *)"gfx/backdrop/04x_ashpit_details.anm2"); local_14._0_1_ = 0xf; ANM2::Load((ANM2 *)(this + 0x13cf),&tmpString,1); local_14 = CONCAT31(local_14._1_3_,6); std::string::_Tidy_deallocate(tmpString._buf); } else { tmpString._size = 0; tmpString._capacity = 0xf; tmpString._buf[0] = '\0'; tmpString._buf[1] = '\0'; tmpString._buf[2] = '\0'; tmpString._buf[3] = '\0'; tmpString._buf._0_4_ = std::_Allocate(0x30); tmpString._size = 0x29; tmpString._capacity = 0x2f; builtin_strncpy((char *)tmpString._buf._0_4_,"gfx/backdrop/04x_ashpit_details_dark.anm2",0x2a) ; local_14._0_1_ = 0xe; ANM2::Load((ANM2 *)(this + 0x13cf),&tmpString,1); local_14 = CONCAT31(local_14._1_3_,6); if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; freeBlock = (char *)tmpString._buf._0_4_; if (0xfff < uVar7) { freeBlock = *(char **)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((char *)0x1f < (char *)(tmpString._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_0093e16c; } operator_delete(freeBlock,uVar7); } } goto LAB_0093e3a0; case (Backdrop)0x2f: std::string::string_from_cstr(gehennaPath._buf,(byte *)"gfx/backdrop/06x_gehenna_details.anm2"); local_14 = CONCAT31(local_14._1_3_,0x11); ANM2::Load((ANM2 *)(this + 0x13cf),&gehennaPath,1); detailsPath = &gehennaPath; LAB_0093e391: local_14 = CONCAT31(local_14._1_3_,6); std::string::_Tidy_deallocate(detailsPath->_buf); LAB_0093e3a0: Sprite::Play(this + 0x13d5,0); goto switchD_0093df66_caseD_21; } bVar3 = ANM2::SetAnimation((ANM2 *)(this + 0x13cf),(byte *)local_70,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x13db)); *(undefined1 *)(this + 0x13e0) = 1; } switchD_0093df66_caseD_21: if (this[9] != (Backdrop)0x0) { g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; render_ashpit_ash(); pre_render_walls(); g_graphicsManager_flags = g_graphicsManager_flags | 2; KAGE::SmartPointer::reset(this + 9,(void *)0x0); KAGE::SmartPointer::reset(this + 0xd,(void *)0x0); } local_14 = 0xffffffff; std::string::_Tidy_deallocate(imagePath._buf); LAB_0093e713: pop_render_target(); ExceptionList = local_1c; return; LAB_0093e060: uVar7 = -(uint)isLess | 1; goto LAB_0093e065; } //@@ 0093e770 Backdrop::render_wall_borders /* DB: ? Backdrop::RenderWalls: draws black (0,0,0,1) uniform-color quads from the room edges to the screen edges, adjusted by room shape (+0x48: 2/7 +-52, 3/5 +-104) */ void Backdrop::render_wall_borders(Vector *param_1,float *param_2) { int iVar1; float top; float local_1ec [4]; float local_1dc; undefined1 local_17c [20]; float local_168; float local_160; undefined1 local_10c [8]; float local_104; float local_f4; undefined1 local_9c [4]; float local_98; float local_90; KColor local_28; Vector local_14; Vector local_c; top = 0.0; local_28._red = 0.0; local_28._green = 0.0; local_28._blue = 0.0; local_28._alpha = 1.0; local_28._unk = 0; render_quad_set_uniform_color(local_10c,0.0,0.0,param_1->x,g_screenHeight,&local_28); render_quad_set_uniform_color(local_17c,param_1->x,top,param_1->x + *param_2,param_1->y,&local_28) ; render_quad_set_uniform_color (local_1ec,param_1->x + *param_2,top,g_screenWidth,g_screenHeight,&local_28); render_quad_set_uniform_color (local_9c,param_1->x,param_1->y + param_2[1],param_1->x + *param_2,g_screenHeight, &local_28); iVar1 = *(int *)((int)g_game->_room + 4); if ((iVar1 == 0) || (iVar1 = *(int *)(iVar1 + 0x10), iVar1 == 0)) { iVar1 = 1; } else { iVar1 = *(int *)(iVar1 + 0x48); if ((iVar1 == 2) || (iVar1 == 7)) { local_168 = local_160 + 52.0; local_98 = local_90 - 52.0; local_160 = local_168; local_90 = local_98; } else if ((iVar1 == 3) || (iVar1 == 5)) { local_104 = local_f4 + 104.0; local_1ec[0] = local_1ec[0] - 104.0; local_1dc = local_1ec[0]; local_f4 = local_104; } } render_color_shader_pass(local_10c); render_color_shader_pass(local_17c); render_color_shader_pass(local_1ec); render_color_shader_pass(local_9c); local_14.x = 364.0; local_14.y = 208.0; if (iVar1 != 9) { if (iVar1 == 10) { local_c.x = *param_2 * 0.5 + param_1->x + 26.0; local_c.y = param_1->y; } else { if (iVar1 == 0xb) { local_c.x = param_1->x; } else { if (iVar1 != 0xc) { return; } local_c.x = *param_2 * 0.5 + param_1->x + 26.0; } local_c.y = param_2[1] * 0.5 + param_1->y + 26.0; } param_1 = &local_c; } render_quad_set_rect(local_9c,param_1,&local_14,&local_28); render_color_shader_pass(local_9c); return; } //@@ 0093ea00 Backdrop::RenderFloor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0093ec5a) */ /* DB: Room::Render passes (&offset, Room+0x72a4 _floorColor ColorMod 10 dwords), same shape as the Backdrop::RenderWalls call; otherAnimState=Backdrop (in_ECX[0x54]=0x150 backdropId==0x1c, in_ECX[0x13c6..]=0x4f18 unkVec); ANM2::Render, shader_cache_find, render_quad_set_rect */ void Backdrop::RenderFloor(Vector *param_1,ColorMod param_2) { byte bVar1; byte *curAnimName; uint uVar2; ColorMod *color; undefined *shader; undefined4 *in_ECX; AnimationState *otherAnimState; undefined4 *extraout_ECX; undefined4 *unused; byte *unused_00; KColor *color_00; undefined4 *extraout_ECX_00; undefined4 *extraout_ECX_01; undefined4 *extraout_ECX_02; KColor *color_01; undefined4 *extraout_ECX_03; bool isLess; float fVar3; float fVar4; float fVar5; undefined1 auStackY_1dc [128]; Vector *pVVar6; void *imageRefCount; KColor *imageRefCount_00; undefined1 auStack_148 [12]; Vector local_13c; Vector local_134; float tileX; Vector *renderOffset; float tileY; int savedBlendMode4; int savedBlendMode0; int savedBlendMode1; int savedBlendMode2; int savedBlendMode3; KColor white; undefined1 quad [36]; undefined1 renderQuad [112]; Color defaultColor; uint local_14; int backdropType; local_14 = __security_cookie ^ (uint)auStack_148; renderOffset = param_1; savedBlendMode0 = g_graphicsManager_blendMode[0]; savedBlendMode1 = g_graphicsManager_blendMode[1]; savedBlendMode2 = g_graphicsManager_blendMode[2]; savedBlendMode3 = g_graphicsManager_blendMode[3]; savedBlendMode4 = g_graphicsManager_blendMode[4]; if (in_ECX[0x54] == 0x1c) { g_graphicsManager_blendMode[1] = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[4] = 7; unused = (undefined4 *)&DAT_00000006; } else { g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 0; g_graphicsManager_blendMode[4] = 0; unused = in_ECX; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[0] = 0; backdropType = in_ECX[0x54]; if (backdropType == 0x1a) { fVar4 = (float)in_ECX[0x13c9]; fVar3 = (float)in_ECX[0x13c7]; tileX = (float)in_ECX[0x13c6]; DAT_00c33910 = 0; tileY = fVar3; if (fVar3 < fVar4 - 0.001) { fVar5 = (float)in_ECX[0x13c8]; do { local_13c.x = (tileX - fVar5) + 100.0; if (local_13c.x <= 0.0) { local_13c.x = 0.0; } local_13c.y = (fVar3 - fVar4) + 100.0; if (local_13c.y <= 0.0) { local_13c.y = 0.0; } local_134.x = tileX + param_1->x; local_134.y = fVar3 + param_1->y; if (*(char *)((int)in_ECX + 0x145) != '\0') { if (*(char *)(in_ECX + 0x2b) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x1b),&local_134,&g_vectorZero,&local_13c); otherAnimState = (AnimationState *)(in_ECX + 0x23); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x23),&local_134,&g_vectorZero,&local_13c); otherAnimState = (AnimationState *)(in_ECX + 0x1b); } AnimationState::Render(otherAnimState,&local_134,&g_vectorZero,&local_13c); unused = extraout_ECX; param_1 = renderOffset; fVar3 = tileY; } fVar5 = (float)in_ECX[0x13c8]; tileX = tileX + 100.0; if (fVar5 - 0.001 < tileX) { tileX = (float)in_ECX[0x13c6]; fVar3 = fVar3 + 100.0; tileY = fVar3; } fVar4 = (float)in_ECX[0x13c9]; } while (fVar3 < fVar4 - 0.001); DAT_00c33910 = 1; goto LAB_0093ef9f; } } else { if (backdropType != 0x12) { if (backdropType == 0x23) { DAT_00c33910 = 0; ANM2::Render((ANM2 *)(in_ECX + 0xf),param_1,&g_vectorZero,&g_vectorZero); DAT_00c33910 = 1; unused = extraout_ECX_02; } else { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_13c.x = 52.0; local_13c.y = 52.0; local_134.x = ((float)in_ECX[0x13c8] - (float)in_ECX[0x13c6]) + 0.0; local_134.y = ((float)in_ECX[0x13c9] - (float)in_ECX[0x13c7]) + 26.0; g_currentShader = shader; quad_set_rect(quad,&local_13c,&local_134,(int)unused); KColor::SetFromARGB(&white,0xffffffff); local_13c.x = param_1->x + 52.0; pVVar6 = &local_134; local_13c.y = param_1->y + 52.0; imageRefCount_00 = color_01; render_quad_set_rect(renderQuad,&local_13c,pVVar6,color_01); KAGE::SmartPointer::operator_assign(auStackY_1dc + 0x84,in_ECX); apply_sprite_shader_params(¶m_2,1,pVVar6,imageRefCount_00); (**(code **)(*(int *)*in_ECX + 0x14))(quad); unused = extraout_ECX_03; } goto LAB_0093ef9f; } DAT_00c33910 = 0; if ((in_ECX[0x1c] != 0) && (*(char *)(in_ECX + 0x20) == '\0')) { curAnimName = (byte *)in_ECX[0x1c]; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } unused_00 = s_Idle2; do { bVar1 = *curAnimName; isLess = bVar1 < *unused_00; if (bVar1 != *unused_00) { LAB_0093eca2: uVar2 = -(uint)isLess | 1; goto LAB_0093eca7; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < unused_00[1]; if (bVar1 != unused_00[1]) goto LAB_0093eca2; curAnimName = curAnimName + 2; unused_00 = unused_00 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0093eca7: if (uVar2 == 0) { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } fVar5 = g_vectorOne.x * 26.0 * 0.5; fVar4 = 52.0; fVar3 = g_vectorOne.y * 26.0 * 0.5; local_134.x = fVar5 + fVar5 + ((float)in_ECX[0x13c8] - (float)in_ECX[0x13c6]); local_134.y = ((float)in_ECX[0x13c9] - (float)in_ECX[0x13c7]) + fVar3 + fVar3; local_13c.x = (52.0 - fVar5) + DAT_00c35e70; local_13c.y = (52.0 - fVar3) + DAT_00c35e74; g_currentShader = shader; quad_set_rect(quad,&local_13c,&local_134,(int)unused_00); KColor::SetFromARGB(&white,0xffffffff); pVVar6 = &local_134; local_13c.x = ((param_1->x + fVar4) - fVar5) + DAT_00c35e70; local_13c.y = ((param_1->y + fVar4) - fVar3) + DAT_00c35e74; render_quad_set_rect(renderQuad,&local_13c,pVVar6,color_00); imageRefCount = (void *)0x93ede7; Color::Color(&defaultColor); KAGE::SmartPointer::operator_assign(auStackY_1dc + 0x84,in_ECX); apply_sprite_shader_params(color,1,pVVar6,imageRefCount); (**(code **)(*(int *)*in_ECX + 0x14))(quad); DAT_00c33910 = 1; unused = extraout_ECX_00; goto LAB_0093ef9f; } } local_134.x = param_1->x + (float)in_ECX[0x13c6] + DAT_00c35e70; local_134.y = param_1->y + (float)in_ECX[0x13c7] + DAT_00c35e74; ANM2::Render((ANM2 *)(in_ECX + 0xf),&local_134,&g_vectorZero,&g_vectorZero); unused = extraout_ECX_01; } DAT_00c33910 = 1; LAB_0093ef9f: g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = savedBlendMode2; g_graphicsManager_blendMode[3] = savedBlendMode3; g_graphicsManager_blendMode[4] = savedBlendMode4; shader_cache_find((int)unused); return; } //@@ 0093f000 Backdrop::render_floor_surface /* DB: ? ECX=Room+0x1bc8 (Backdrop) from Room::Render right after Backdrop::RenderFloor when a room flag is set: draws the render target +0x10 as a quad sized from +0x4f18..+0x4f24 (+52 margins) at the render offset with blend state saved/restored */ void Backdrop::render_floor_surface(float *param_1,ColorMod param_2) { int iVar1; int iVar2; undefined *puVar3; int in_ECX; KColor *color; int unusedArg; float fVar4; undefined1 auStackY_180 [128]; Vector *size; KColor *imageRefCount; Vector local_e4; Vector local_dc; undefined4 local_d4; undefined4 local_d0; float local_cc; undefined4 local_c8; undefined4 local_c4; float local_c0; float local_bc; float local_b8; int local_b4; int local_b0; int iStack_ac; int iStack_a8; int iStack_a4; KColor local_94; undefined1 local_80 [124]; iVar1 = g_graphicsManager_blendMode[4]; iVar2 = 1; fVar4 = 52.0; local_b0 = g_graphicsManager_blendMode[0]; iStack_ac = g_graphicsManager_blendMode[1]; iStack_a8 = g_graphicsManager_blendMode[2]; iStack_a4 = g_graphicsManager_blendMode[3]; g_graphicsManager_blendMode[0] = 0; if (((byte)g_graphicsManager_flags & 4) == 0) { iVar2 = 6; } g_graphicsManager_blendMode[2] = 7; puVar3 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar3 = g_currentShader; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_c4 = 0x42500000; local_c8 = 0x42500000; local_e4.x = (*(float *)(in_ECX + 0x4f20) - *(float *)(in_ECX + 0x4f18)) + 0.0; local_e4.y = (*(float *)(in_ECX + 0x4f24) - *(float *)(in_ECX + 0x4f1c)) + 26.0; local_d4 = 0x42500000; local_d0 = 0x42500000; local_b4 = CONCAT31(local_b4._1_3_,1); local_cc = local_e4.x + 52.0; local_c0 = local_e4.y + 52.0; g_currentShader = puVar3; g_graphicsManager_blendMode[1] = iVar2; local_bc = local_cc; local_b8 = local_c0; KColor::SetFromARGB(&local_94,0xffffffff); local_dc.x = *param_1 + fVar4; local_dc.y = param_1[1] + fVar4; size = &local_e4; imageRefCount = color; render_quad_set_rect(local_80,&local_dc,size,color); KAGE::SmartPointer::operator_assign(auStackY_180 + 0x88,(undefined4 *)(in_ECX + 0x10)); apply_sprite_shader_params(¶m_2,1,size,imageRefCount); (**(code **)(**(int **)(in_ECX + 0x10) + 0x14))(&local_d4); g_graphicsManager_blendMode[0] = (int)local_bc; g_graphicsManager_blendMode[1] = (int)local_b8; g_graphicsManager_blendMode[2] = local_b4; g_graphicsManager_blendMode[3] = local_b0; g_graphicsManager_blendMode[4] = iVar1; shader_cache_find(unusedArg); return; } //@@ 0093f1d0 Backdrop::RenderWalls /* DB: Room::Render passes (&offset, Room._wallColor ColorMod 10 dwords); this=Backdrop (0x150 backdropId, 0x2c waterGfx, 0x4f18 unkVec1); zhl Backdrop::RenderWalls(Vector const& renderOffset, ColorMod color) prototype: db/protos.zhl, confirmed by RET 48 */ void __thiscall Backdrop::RenderWalls(Backdrop *this,Vector *renderOffset,ColorMod color) { undefined4 uVar1; Backdrop *extraout_EAX; undefined4 *extraout_EAX_00; Vector *position; undefined4 *extraout_EAX_01; Backdrop *extraout_EAX_02; undefined4 *extraout_EAX_03; Backdrop *extraout_EAX_04; undefined4 *extraout_EAX_05; Backdrop *extraout_EAX_06; undefined4 *extraout_EAX_07; Backdrop BVar2; int extraout_ECX; KColor *color_00; int extraout_ECX_00; KColor *color_01; int extraout_ECX_01; KColor *color_02; int extraout_ECX_02; KColor *color_03; int extraout_ECX_03; KColor *color_04; KColor *color_05; KColor *color_06; KColor *color_07; KColor *color_08; KColor *color_09; KColor *color_10; KColor *color_11; int iVar3; KColor *color_12; KColor *extraout_ECX_04; KColor *color_13; KColor *color_14; KColor *color_15; KColor *extraout_ECX_05; KColor *color_16; KColor *color_17; KColor *color_18; KColor *color_19; int extraout_ECX_06; Backdrop BVar4; Backdrop *unaff_ESI; undefined4 *puVar5; Backdrop **ppBVar6; Backdrop BVar7; float fVar8; Backdrop *pBVar9; Backdrop *pBVar10; float fVar11; undefined1 auVar12 [4]; Vector aVStackY_610 [128]; Vector *pVVar13; KColor *color_20; float *pfVar14; void *imageRefCount; float *pfVar15; Backdrop animation; Backdrop *pBVar16; undefined1 auStack_1d8 [8]; undefined1 local_1d0 [4]; undefined1 local_1cc [16]; Backdrop *pBStack_1bc; Backdrop *pBStack_1b8; Backdrop *pBStack_1b4; Backdrop *pBStack_1b0; Backdrop *pBStack_1ac; float fStack_1a8; Backdrop *pBStack_1a4; Backdrop *pBStack_1a0; Backdrop *pBStack_19c; Backdrop *pBStack_198; Backdrop *pBStack_194; Backdrop *pBStack_190; Vector *pVStack_18c; Backdrop *local_188; Backdrop *local_184; Backdrop *local_180; Vector *local_17c; Backdrop *local_178; Backdrop *local_174; Backdrop *local_170; Backdrop *local_16c; Backdrop *local_168; Vector local_164; Backdrop *pBStack_15c; Vector VStack_158; Backdrop *pBStack_150; Vector VStack_14c; Backdrop *local_144; Vector local_140; Vector *local_138; Backdrop *local_134 [5]; float local_120; Backdrop local_11c [3]; undefined1 local_110 [108]; undefined1 auStack_a4 [4]; int savedBlendMode; int iStack_9c; int iStack_98; int iStack_94; undefined1 auStack_8c [136]; local_138 = renderOffset; if (this[0xb] != (Backdrop)0x0) { RenderWater(this,renderOffset); } BVar7 = this[0x54]; if (BVar7 == (Backdrop)0x12) { fVar11 = g_vectorOne.x * 26.0 * 0.5; fVar8 = g_vectorOne.y * 26.0 * 0.5; auStack_1d8._4_4_ = fVar11 + fVar11 + ((float)this[0x13c8] - (float)this[0x13c6]); local_1d0 = (undefined1 [4])(((float)this[0x13c9] - (float)this[0x13c7]) + fVar8 + fVar8); local_120 = ((renderOffset->x + 52.0) - fVar11) + DAT_00c35e70; local_11c[0] = (Backdrop)(((renderOffset->y + 52.0) - fVar8) + DAT_00c35e74); render_wall_borders(); return; } if (BVar7 == (Backdrop)0x23) { DAT_00c33910 = 0; ANM2::Render((ANM2 *)(this + 0xf),renderOffset,&g_vectorZero,&g_vectorZero); DAT_00c33910 = 1; return; } if (((BVar7 == (Backdrop)0x34) || (BVar7 == (Backdrop)0x35)) || (BVar7 == (Backdrop)0x36)) { BVar7 = (Backdrop)0x1; DAT_00c33910 = 0; if (1 < (uint)this[0x2f]) { local_1cc._8_4_ = 8.40779e-44; do { if (this[0x51].field_0x1 != '\0') { if (*(char *)(this + 0x2b) == '\0') { BVar4 = this[0x1c]; if (((BVar4 != (Backdrop)0x0) && (-1 < (int)BVar7)) && (((int)BVar7 < *(int *)((int)this[0x1b] + 0x80) && (iVar3 = *(int *)(local_1cc._8_4_ + (int)BVar4), -1 < iVar3)))) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)BVar4 + 0x18)),local_138, *(int *)((int)this[0x1d] + iVar3 * 4),&g_vectorZero,&g_vectorZero, (ANM2 *)this[0x1b]); } BVar4 = this[0x24]; if (((BVar4 != (Backdrop)0x0) && (-1 < (int)BVar7)) && (((int)BVar7 < *(int *)((int)this[0x23] + 0x80) && (iVar3 = *(int *)(local_1cc._8_4_ + (int)BVar4), -1 < iVar3)))) { animation = this[0x23]; BVar2 = this[0x25]; goto LAB_00940ce6; } } else { BVar4 = this[0x24]; if ((((BVar4 != (Backdrop)0x0) && (-1 < (int)BVar7)) && ((int)BVar7 < *(int *)((int)this[0x23] + 0x80))) && (iVar3 = *(int *)(local_1cc._8_4_ + (int)BVar4), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)BVar4 + 0x18)),local_138, *(int *)((int)this[0x25] + iVar3 * 4),&g_vectorZero,&g_vectorZero, (ANM2 *)this[0x23]); } BVar4 = this[0x1c]; if (((BVar4 != (Backdrop)0x0) && (-1 < (int)BVar7)) && (((int)BVar7 < *(int *)((int)this[0x1b] + 0x80) && (iVar3 = *(int *)(local_1cc._8_4_ + (int)BVar4), -1 < iVar3)))) { animation = this[0x1b]; BVar2 = this[0x1d]; LAB_00940ce6: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)BVar4 + 0x18)),local_138, *(int *)((int)BVar2 + iVar3 * 4),&g_vectorZero,&g_vectorZero, (ANM2 *)animation); } } } BVar7 = (Backdrop)((int)BVar7 + 1); local_1cc._8_4_ = local_1cc._8_4_ + 4; } while ((uint)BVar7 < (uint)this[0x2f]); } DAT_00c33910 = 1; return; } if (this[(int)BVar7 * 0x4f + 0x6e] == (Backdrop)0x0) { return; } savedBlendMode = g_graphicsManager_blendMode[0]; iStack_9c = g_graphicsManager_blendMode[1]; iStack_98 = g_graphicsManager_blendMode[2]; iStack_94 = g_graphicsManager_blendMode[3]; local_120 = (float)g_graphicsManager_blendMode[4]; set_blend_mode(&DAT_00c798e0,1); local_134[0] = (Backdrop *)((float)this[0x13c8] - (float)this[0x13c6]); local_184 = (Backdrop *)((float)this[0x13c9] - (float)this[0x13c7]); local_1cc._0_4_ = Room::GetRoomShape(g_game->_room); auStack_1d8._4_4_ = g_vectorOne.x * 52.0 + g_vectorOne.x * 52.0 + (float)local_134[0]; local_1d0 = (undefined1 [4])(g_vectorOne.y * 52.0 + g_vectorOne.y * 52.0 + (float)local_184); pVVar13 = renderOffset; render_wall_borders(); imageRefCount = (void *)0x93f3f1; FUN_00682260(); pBVar10 = this + 2; local_188 = pBVar10; KAGE::SmartPointer::operator_assign(auStack_1d8 + -0x10,pBVar10); apply_sprite_shader_params(&color,1,pVVar13,imageRefCount); uVar1 = local_1cc._0_4_; if (*(int *)(*(int *)(*(int *)((int)g_game->_room + 4) + 0x10) + 0x48) - 9U < 4) { if (((Backdrop *)local_1cc._0_4_ == (Backdrop *)0xa) || ((Backdrop *)local_1cc._0_4_ == (Backdrop *)0xc)) { pBVar10 = (Backdrop *)((float)local_184 + 104.0); local_170 = (Backdrop *)0x0; local_180 = (Backdrop *)0x0; local_174 = (Backdrop *)0x0; local_17c = (Vector *)0x0; local_168 = (Backdrop *)0x42500000; local_178 = (Backdrop *)0x42500000; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_1cc._8_4_ = pBVar10; local_16c = pBVar10; local_164.x = (float)pBVar10; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = (Backdrop *)0x42500000; local_1d0 = (undefined1 [4])pBVar10; render_quad_set_rect(local_110,renderOffset,(Vector *)(auStack_1d8 + 4),color_00); (**(code **)(*(int *)*local_188 + 0x14))(); iVar3 = extraout_ECX_00; } else { local_1cc._8_4_ = (float)local_184 + 104.0; iVar3 = extraout_ECX; } fVar8 = 0.0; if (((Backdrop *)uVar1 == (Backdrop *)&DAT_00000009) || ((Backdrop *)uVar1 == (Backdrop *)&DAT_0000000b)) { local_174 = (Backdrop *)0x0; pBVar9 = (Backdrop *)((float)local_134[0] + 52.0); local_178 = (Backdrop *)((float)local_134[0] + 104.0); local_17c = (Vector *)0x0; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); pBVar10 = (Backdrop *)local_1cc._8_4_; local_180 = pBVar9; local_170 = pBVar9; local_16c = (Backdrop *)local_1cc._8_4_; local_168 = local_178; local_164.x = (float)local_1cc._8_4_; local_144 = pBVar9; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = (Backdrop *)0x42500000; local_1cc._0_4_ = (float)pBVar9 + renderOffset->x; local_1cc._4_4_ = renderOffset->y + fVar8; local_1d0 = (undefined1 [4])pBVar10; render_quad_set_rect(local_110,(Vector *)local_1cc,(Vector *)(auStack_1d8 + 4),color_01); (**(code **)(*(int *)*local_188 + 0x14))(); iVar3 = extraout_ECX_01; if ((Backdrop *)uVar1 != (Backdrop *)&DAT_0000000b) goto LAB_0093f60b; LAB_0093f61d: local_170 = (Backdrop *)0x42500000; local_180 = (Backdrop *)0x42500000; local_174 = (Backdrop *)0x0; local_17c = (Vector *)0x0; local_164.x = 52.0; local_16c = (Backdrop *)0x42500000; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_178 = local_144; local_168 = local_144; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = local_134[0]; local_1cc._0_4_ = renderOffset->x + 52.0; local_1d0 = (undefined1 [4])0x42500000; local_1cc._4_4_ = renderOffset->y + 0.0; render_quad_set_rect(local_110,(Vector *)local_1cc,(Vector *)(auStack_1d8 + 4),color_02); (**(code **)(*(int *)*local_188 + 0x14))(); iVar3 = extraout_ECX_02; } else { local_144 = (Backdrop *)((float)local_134[0] + 52.0); LAB_0093f60b: if ((Backdrop *)uVar1 == (Backdrop *)0xc) goto LAB_0093f61d; } if (((Backdrop *)uVar1 == (Backdrop *)&DAT_00000009) || ((Backdrop *)uVar1 == (Backdrop *)0xa)) { pBVar10 = (Backdrop *)((float)local_184 + 52.0); local_170 = (Backdrop *)0x42500000; local_180 = (Backdrop *)0x42500000; local_164.x = (float)local_1cc._8_4_; local_16c = (Backdrop *)local_1cc._8_4_; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_17c = (Vector *)pBVar10; local_178 = local_144; local_174 = pBVar10; local_168 = local_144; local_134[3] = pBVar10; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = local_134[0]; local_1cc._0_4_ = renderOffset->x + 52.0; local_1d0 = (undefined1 [4])0x42500000; local_1cc._4_4_ = (float)pBVar10 + renderOffset->y; render_quad_set_rect(local_110,(Vector *)local_1cc,(Vector *)(auStack_1d8 + 4),color_03); (**(code **)(*(int *)*local_188 + 0x14))(); if ((Backdrop *)uVar1 == (Backdrop *)&DAT_00000009) { fVar8 = (float)local_184 * 0.5; local_170 = (Backdrop *)0x0; local_180 = (Backdrop *)0x0; local_168 = (Backdrop *)0x42500000; local_178 = (Backdrop *)0x42500000; local_164.x = (float)local_1cc._8_4_; local_16c = (Backdrop *)local_1cc._8_4_; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_184 = (Backdrop *)fVar8; local_17c = (Vector *)fVar8; local_174 = (Backdrop *)fVar8; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = 52.0; local_1d0 = (undefined1 [4])(fVar8 + 104.0); local_1cc._0_4_ = renderOffset->x + 0.0; local_1cc._4_4_ = fVar8 + renderOffset->y; render_quad_set_rect(local_110,(Vector *)local_1cc,(Vector *)(auStack_1d8 + 4),color_04); (**(code **)(*(int *)*local_188 + 0x14))(); pBVar10 = (Backdrop *)(local_140.x * 0.5); local_1cc._12_4_ = 0.0; local_1cc._4_4_ = 0.0; local_1cc._8_4_ = (float)pBVar10 + 52.0; pBStack_1ac = (Backdrop *)CONCAT31(pBStack_1ac._1_3_,1); local_188 = (Backdrop *)0x0; local_180 = (Backdrop *)0x0; local_16c = pBStack_1ac; local_1cc._0_4_ = pBVar10; pBStack_1bc = pBVar10; pBStack_1b8 = unaff_ESI; pBStack_1b4 = (Backdrop *)local_1cc._8_4_; pBStack_1b0 = unaff_ESI; pVStack_18c = (Vector *)pBVar10; local_184 = (Backdrop *)local_1cc._8_4_; local_17c = (Vector *)pBVar10; local_174 = (Backdrop *)local_1cc._8_4_; local_170 = unaff_ESI; local_140.x = (float)pBVar10; local_134[0] = (Backdrop *)local_1cc._8_4_; KColor::SetFromARGB((KColor *)local_1cc,0xffffffff); auStack_1d8._0_4_ = (float)pBVar10 + renderOffset->x; auStack_1d8._4_4_ = renderOffset->y + 0.0; render_quad_set_rect(auStack_8c,(Vector *)auStack_1d8,(Vector *)(auStack_1d8 + -8),color_05) ; pBVar10 = extraout_EAX; pBVar9 = local_11c; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *pBVar9 = *pBVar10; pBVar10 = pBVar10 + 1; pBVar9 = pBVar9 + 1; } (**(code **)(*(int *)*pBStack_194 + 0x14))(); local_1cc._8_4_ = (float)pBStack_19c + 52.0; auStack_1d8._0_4_ = 52.0; local_1cc._0_4_ = pBStack_19c; auStack_1d8._4_4_ = pBStack_19c; local_1d0 = (undefined1 [4])local_140.x; local_1cc._4_4_ = 52.0; local_1cc._12_4_ = local_140.x; pBStack_198 = (Backdrop *)0x42500000; pBStack_194 = pBStack_19c; pBStack_190 = (Backdrop *)local_140.x; pVStack_18c = (Vector *)pBStack_19c; pBStack_1b8 = (Backdrop *)CONCAT31(pBStack_1b8._1_3_,1); local_188 = (Backdrop *)0x42500000; local_180 = (Backdrop *)local_140.x; local_178 = pBStack_1b8; pBStack_1bc = (Backdrop *)local_1cc._8_4_; local_184 = (Backdrop *)local_1cc._8_4_; local_17c = (Vector *)local_1cc._8_4_; KColor::SetFromARGB((KColor *)auStack_1d8,0xffffffff); render_quad_set_rect (&iStack_98,(Vector *)(auStack_1d8 + -0xc),(Vector *)(auStack_1d8 + -0x14), color_06); puVar5 = extraout_EAX_00; ppBVar6 = local_134 + 3; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *ppBVar6 = (Backdrop *)*puVar5; puVar5 = puVar5 + 1; ppBVar6 = ppBVar6 + 1; } (**(code **)(*(int *)*pBStack_1a0 + 0x14))(&pBStack_198,local_134 + 3,g_drawRectUnset); auStack_1d8._4_4_ = VStack_14c.x; auStack_1d8._0_4_ = (Backdrop *)0x0; local_1cc._0_4_ = local_168; local_1cc._4_4_ = (Backdrop *)0x42500000; local_1d0 = (undefined1 [4])0x42500000; local_1cc[8] = 1; pBStack_1a4 = (Backdrop *)VStack_14c.x; pBStack_1a0 = (Backdrop *)0x0; pBStack_19c = local_168; pBStack_198 = (Backdrop *)0x0; pBStack_194 = (Backdrop *)VStack_14c.x; pBStack_190 = (Backdrop *)0x42500000; pVStack_18c = (Vector *)local_168; local_188 = (Backdrop *)0x42500000; local_184 = (Backdrop *)local_1cc._8_4_; KColor::SetFromARGB((KColor *)(auStack_1d8 + -0xc),0xffffffff); } else { if ((Backdrop *)uVar1 != (Backdrop *)0xa) { iVar3 = extraout_ECX_03; goto LAB_0093ff6f; } local_178 = (Backdrop *)((float)local_134[0] + 104.0); fVar8 = (float)local_184 * 0.5; local_170 = local_144; local_180 = local_144; local_164.x = (float)local_1cc._8_4_; local_16c = (Backdrop *)local_1cc._8_4_; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); pBVar10 = local_144; local_184 = (Backdrop *)fVar8; local_17c = (Vector *)fVar8; local_174 = (Backdrop *)fVar8; local_168 = local_178; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = 52.0; local_1d0 = (undefined1 [4])(fVar8 + 104.0); local_1cc._0_4_ = (float)pBVar10 + renderOffset->x; local_1cc._4_4_ = fVar8 + renderOffset->y; render_quad_set_rect(local_110,(Vector *)local_1cc,(Vector *)(auStack_1d8 + 4),color_07); (**(code **)(*(int *)*local_188 + 0x14))(); local_140.x = local_140.x * 0.5; local_1cc._12_4_ = 0.0; local_1cc._4_4_ = 0.0; local_1cc._8_4_ = local_140.x + 104.0; pBVar10 = (Backdrop *)(local_140.x + 52.0); pBStack_1ac = (Backdrop *)CONCAT31(pBStack_1ac._1_3_,1); local_188 = (Backdrop *)0x0; local_180 = (Backdrop *)0x0; local_16c = pBStack_1ac; local_1cc._0_4_ = pBVar10; pBStack_1bc = pBVar10; pBStack_1b8 = unaff_ESI; pBStack_1b4 = (Backdrop *)local_1cc._8_4_; pBStack_1b0 = unaff_ESI; pVStack_18c = (Vector *)pBVar10; local_184 = (Backdrop *)local_1cc._8_4_; local_17c = (Vector *)pBVar10; local_174 = (Backdrop *)local_1cc._8_4_; local_170 = unaff_ESI; local_134[0] = pBVar10; KColor::SetFromARGB((KColor *)local_1cc,0xffffffff); auStack_1d8._0_4_ = (float)pBVar10 + renderOffset->x; auStack_1d8._4_4_ = renderOffset->y + 0.0; render_quad_set_rect(auStack_8c,(Vector *)auStack_1d8,(Vector *)(auStack_1d8 + -8),color_08) ; pBVar10 = extraout_EAX_02; pBVar9 = local_11c; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *pBVar9 = *pBVar10; pBVar10 = pBVar10 + 1; pBVar9 = pBVar9 + 1; } (**(code **)(*(int *)*pBStack_194 + 0x14))(); local_1cc._8_4_ = (float)pBStack_19c + 52.0; auStack_1d8._0_4_ = local_140.x; local_1cc._0_4_ = pBStack_19c; auStack_1d8._4_4_ = pBStack_19c; local_1d0 = (undefined1 [4])pBStack_15c; local_1cc._4_4_ = local_140.x; local_1cc._12_4_ = pBStack_15c; pBStack_198 = (Backdrop *)local_140.x; pBStack_194 = pBStack_19c; pBStack_190 = pBStack_15c; pVStack_18c = (Vector *)pBStack_19c; pBStack_1b8 = (Backdrop *)CONCAT31(pBStack_1b8._1_3_,1); local_188 = (Backdrop *)local_140.x; local_180 = pBStack_15c; local_178 = pBStack_1b8; pBStack_1bc = (Backdrop *)local_1cc._8_4_; local_184 = (Backdrop *)local_1cc._8_4_; local_17c = (Vector *)local_1cc._8_4_; KColor::SetFromARGB((KColor *)auStack_1d8,0xffffffff); render_quad_set_rect (&iStack_98,(Vector *)(auStack_1d8 + -0xc),(Vector *)(auStack_1d8 + -0x14), color_09); puVar5 = extraout_EAX_03; ppBVar6 = local_134 + 3; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *ppBVar6 = (Backdrop *)*puVar5; puVar5 = puVar5 + 1; ppBVar6 = ppBVar6 + 1; } (**(code **)(*(int *)*pBStack_1a0 + 0x14))(&pBStack_198,local_134 + 3,g_drawRectUnset); auStack_1d8._4_4_ = (Backdrop *)0x42500000; auStack_1d8._0_4_ = (Backdrop *)0x0; local_1cc._0_4_ = VStack_14c.x; local_1cc._4_4_ = (Backdrop *)0x42500000; local_1d0 = (undefined1 [4])0x42500000; pBStack_1a4 = (Backdrop *)0x42500000; pBStack_1a0 = (Backdrop *)0x0; pBStack_19c = (Backdrop *)VStack_14c.x; pBStack_198 = (Backdrop *)0x0; local_1cc[8] = 1; pBStack_194 = (Backdrop *)0x42500000; pBStack_190 = (Backdrop *)0x42500000; pVStack_18c = (Vector *)VStack_14c.x; local_188 = (Backdrop *)0x42500000; local_184 = (Backdrop *)local_1cc._8_4_; KColor::SetFromARGB((KColor *)(auStack_1d8 + -0xc),0xffffffff); } color_20 = (KColor *)(auStack_1d8 + -0xc); pVVar13 = aVStackY_610 + 0x83; position = (Vector *)(auStack_1d8 + -0x18); } else { local_134[3] = (Backdrop *)((float)local_184 + 52.0); LAB_0093ff6f: if ((Backdrop *)uVar1 == (Backdrop *)&DAT_0000000b) { pBVar10 = (Backdrop *)((float)local_134[0] * 0.5); fVar8 = (float)local_184 * 0.5; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_178 = (Backdrop *)((float)pBVar10 + 52.0); local_164.x = (float)local_1cc._8_4_; local_16c = (Backdrop *)local_1cc._8_4_; local_184 = (Backdrop *)fVar8; local_180 = pBVar10; local_17c = (Vector *)fVar8; local_174 = (Backdrop *)fVar8; local_170 = pBVar10; local_168 = local_178; local_134[0] = pBVar10; local_134[2] = local_178; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); local_1cc._0_4_ = 52.0; local_1cc._4_4_ = fVar8 + 104.0; auStack_1d8._4_4_ = (float)pBVar10 + renderOffset->x; local_1d0 = (undefined1 [4])(fVar8 + renderOffset->y); render_quad_set_rect(local_110,(Vector *)(auStack_1d8 + 4),(Vector *)local_1cc,color_10); (**(code **)(*(int *)*local_188 + 0x14))(); local_1cc._0_4_ = 0.0; local_1cc._12_4_ = 0.0; local_1cc._4_4_ = 0.0; local_1cc._8_4_ = 52.0; pBStack_1bc = (Backdrop *)0x0; pBStack_1b4 = (Backdrop *)0x42500000; pBStack_1b0 = (Backdrop *)auStack_1d8._4_4_; pBStack_1b8 = (Backdrop *)auStack_1d8._4_4_; pVStack_18c = (Vector *)0x0; local_188 = (Backdrop *)0x0; local_184 = (Backdrop *)0x42500000; local_180 = (Backdrop *)0x0; pBStack_1ac = (Backdrop *)CONCAT31(pBStack_1ac._1_3_,1); local_17c = (Vector *)0x0; local_178 = (Backdrop *)auStack_1d8._4_4_; local_174 = (Backdrop *)0x42500000; local_170 = (Backdrop *)auStack_1d8._4_4_; local_16c = pBStack_1ac; KColor::SetFromARGB((KColor *)local_1cc,0xffffffff); VStack_14c.x = renderOffset->x + 0.0; pBVar16 = (Backdrop *)0x42500000; VStack_14c.y = renderOffset->y + 0.0; render_quad_set_rect(auStack_8c,&VStack_14c,(Vector *)(auStack_1d8 + -8),color_11); pBVar10 = extraout_EAX_04; pBVar9 = local_11c; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *pBVar9 = *pBVar10; pBVar10 = pBVar10 + 1; pBVar9 = pBVar9 + 1; } (**(code **)(*(int *)*pBStack_194 + 0x14))(); fVar8 = (float)pBStack_19c + 52.0; local_1cc._12_4_ = local_144; local_1d0 = (undefined1 [4])local_144; auStack_1d8._0_4_ = 52.0; local_1cc._4_4_ = 52.0; pBStack_198 = (Backdrop *)0x42500000; pBStack_190 = local_144; pBStack_1b8 = (Backdrop *)CONCAT31(pBStack_1b8._1_3_,1); local_188 = (Backdrop *)0x42500000; local_180 = local_144; local_178 = pBStack_1b8; auStack_1d8._4_4_ = fVar8; local_1cc._0_4_ = fVar8; local_1cc._8_4_ = pBVar16; pBStack_1bc = pBVar16; pBStack_194 = (Backdrop *)fVar8; pVStack_18c = (Vector *)fVar8; local_184 = pBVar16; local_17c = (Vector *)pBVar16; KColor::SetFromARGB((KColor *)auStack_1d8,0xffffffff); VStack_158.x = VStack_14c.x; VStack_158.y = 52.0; pBVar10 = (Backdrop *)(fVar8 + (float)pBStack_150[1]); render_quad_set_rect(&iStack_98,(Vector *)(auStack_1d8 + -0x14),&VStack_158,color_12); puVar5 = extraout_EAX_05; ppBVar6 = local_134 + 3; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *ppBVar6 = (Backdrop *)*puVar5; puVar5 = puVar5 + 1; ppBVar6 = ppBVar6 + 1; } (**(code **)(*(int *)*pBStack_1a0 + 0x14))(&pBStack_198,local_134 + 3,g_drawRectUnset); auStack_1d8._4_4_ = pBStack_150; auStack_1d8._0_4_ = VStack_14c.x; local_1cc._0_4_ = local_168; local_1cc[8] = 1; pBStack_1a4 = pBStack_150; pBStack_1a0 = (Backdrop *)VStack_14c.x; pBStack_19c = local_168; pBStack_198 = (Backdrop *)VStack_14c.x; pBStack_194 = pBStack_150; pVStack_18c = (Vector *)local_168; local_184 = (Backdrop *)local_1cc._8_4_; local_1d0 = (undefined1 [4])pBVar10; local_1cc._4_4_ = pBVar10; pBStack_190 = pBVar10; local_188 = pBVar10; KColor::SetFromARGB((KColor *)(auStack_1d8 + -0xc),0xffffffff); local_164.x = VStack_158.x; local_164.y = 52.0; pVVar13 = &local_164; position = aVStackY_610 + 0x83; color_20 = extraout_ECX_04; } else { if ((Backdrop *)uVar1 != (Backdrop *)0xc) goto LAB_00940b5f; local_1cc._0_4_ = (float)local_134[0] * 0.5; fVar8 = (float)local_184 * 0.5; local_164.y = (float)CONCAT31(local_164.y._1_3_,1); local_178 = (Backdrop *)((float)local_1cc._0_4_ + 104.0); pBVar10 = (Backdrop *)((float)local_1cc._0_4_ + 52.0); local_164.x = (float)local_1cc._8_4_; local_16c = (Backdrop *)local_1cc._8_4_; local_184 = (Backdrop *)fVar8; local_180 = pBVar10; local_17c = (Vector *)fVar8; local_174 = (Backdrop *)fVar8; local_170 = pBVar10; local_168 = local_178; local_134[2] = pBVar10; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); auStack_1d8._4_4_ = 52.0; local_1d0 = (undefined1 [4])(fVar8 + 104.0); local_140.x = (float)pBVar10 + renderOffset->x; local_140.y = fVar8 + renderOffset->y; render_quad_set_rect(local_110,&local_140,(Vector *)(auStack_1d8 + 4),color_13); pfVar15 = g_drawRectUnset; (**(code **)(*(int *)*local_188 + 0x14))(); local_1cc._8_4_ = local_140.x + 104.0; local_1cc._0_4_ = pBStack_150; local_1cc._12_4_ = 0.0; local_1cc._4_4_ = 0.0; pBStack_1bc = pBStack_150; pVStack_18c = (Vector *)pBStack_150; local_188 = (Backdrop *)0x0; local_180 = (Backdrop *)0x0; pBStack_1ac = (Backdrop *)CONCAT31(pBStack_1ac._1_3_,1); local_17c = (Vector *)pBStack_150; local_16c = pBStack_1ac; pBVar10 = unaff_ESI; pBVar9 = pBStack_150; pBStack_1b8 = unaff_ESI; pBStack_1b4 = (Backdrop *)local_1cc._8_4_; pBStack_1b0 = unaff_ESI; local_184 = (Backdrop *)local_1cc._8_4_; local_174 = (Backdrop *)local_1cc._8_4_; local_170 = unaff_ESI; KColor::SetFromARGB((KColor *)local_1cc,0xffffffff); VStack_14c.x = 52.0; local_140.x = (float)pBVar9 + renderOffset->x; local_140.y = renderOffset->y + 0.0; VStack_14c.y = (float)pBVar10; render_quad_set_rect(auStack_8c,&local_140,&VStack_14c,color_14); pBVar10 = local_11c; pBVar9 = extraout_EAX_06; pBVar16 = local_11c; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *pBVar16 = *pBVar9; pBVar9 = pBVar9 + 1; pBVar16 = pBVar16 + 1; } pfVar14 = g_drawRectUnset; (**(code **)(*(int *)*pBStack_194 + 0x14))(); local_1cc._12_4_ = local_144; local_1d0 = (undefined1 [4])local_144; auStack_1d8._0_4_ = 52.0; local_1cc._0_4_ = local_140.x; auStack_1d8._4_4_ = local_140.x; local_1cc._4_4_ = 52.0; pBStack_198 = (Backdrop *)0x42500000; pBStack_194 = (Backdrop *)local_140.x; pBStack_190 = local_144; pVStack_18c = (Vector *)local_140.x; pBStack_1b8 = (Backdrop *)CONCAT31(pBStack_1b8._1_3_,1); local_188 = (Backdrop *)0x42500000; local_180 = local_144; local_178 = pBStack_1b8; local_1cc._8_4_ = unaff_ESI; pBStack_1bc = unaff_ESI; local_17c = (Vector *)unaff_ESI; KColor::SetFromARGB((KColor *)auStack_1d8,0xffffffff); VStack_158.y = 52.0; local_140.y = local_140.x + (float)pBStack_150[1]; local_140.x = (float)*pBStack_150 + 52.0; VStack_158.x = (float)pfVar15; render_quad_set_rect(&iStack_98,&local_140,&VStack_158,color_15); puVar5 = extraout_EAX_07; ppBVar6 = local_134 + 3; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *ppBVar6 = (Backdrop *)*puVar5; puVar5 = puVar5 + 1; ppBVar6 = ppBVar6 + 1; } (**(code **)(*(int *)*pBStack_1a0 + 0x14))(&pBStack_198,local_134 + 3,g_drawRectUnset); auStack_1d8._0_4_ = fStack_1a8 + 52.0; auStack_1d8._4_4_ = pBStack_150; local_1cc._0_4_ = local_168; pBStack_1a4 = pBStack_150; pBStack_19c = local_168; local_1cc[8] = 1; pBStack_194 = pBStack_150; pVStack_18c = (Vector *)local_168; local_184 = (Backdrop *)local_1cc._8_4_; local_1d0 = (undefined1 [4])pBVar10; local_1cc._4_4_ = pBVar10; pBStack_1a0 = (Backdrop *)auStack_1d8._0_4_; pBStack_198 = (Backdrop *)auStack_1d8._0_4_; pBStack_190 = pBVar10; local_188 = pBVar10; KColor::SetFromARGB((KColor *)(auStack_1d8 + -0xc),0xffffffff); local_164.y = 52.0; pVVar13 = &local_164; position = aVStackY_610 + 0x83; color_20 = extraout_ECX_05; local_164.x = (float)pfVar14; } } render_quad_set_rect(auStack_a4,position,pVVar13,color_20); puVar5 = extraout_EAX_01; ppBVar6 = local_134; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *ppBVar6 = (Backdrop *)*puVar5; puVar5 = puVar5 + 1; ppBVar6 = ppBVar6 + 1; } BVar7 = *pBStack_1ac; } else { local_144 = (Backdrop *)g_vectorZero.x; local_1cc._8_4_ = g_vectorZero.y; if (((Backdrop *)local_1cc._0_4_ == (Backdrop *)0x2) || ((Backdrop *)local_1cc._0_4_ == (Backdrop *)&DAT_00000007)) { local_144 = (Backdrop *)0x0; local_1cc._8_4_ = (Backdrop *)0x42500000; local_184 = (Backdrop *)((float)local_184 - 104.0); } else if (((Backdrop *)local_1cc._0_4_ == (Backdrop *)0x3) || ((Backdrop *)local_1cc._0_4_ == (Backdrop *)&DAT_00000005)) { local_144 = (Backdrop *)0x42d00000; local_134[0] = (Backdrop *)((float)local_134[0] - 208.0); local_1cc._8_4_ = (Backdrop *)0x0; } fVar8 = (float)local_184 + 104.0; local_1cc._0_4_ = (float)local_144 + 52.0; local_16c = (Backdrop *)((float)local_1cc._8_4_ + fVar8); local_164.y = (float)CONCAT31(local_164.y._1_3_,1); pBVar9 = (Backdrop *)local_1cc._8_4_; pBVar16 = local_144; local_180 = local_144; local_17c = (Vector *)local_1cc._8_4_; local_178 = (Backdrop *)local_1cc._0_4_; local_174 = (Backdrop *)local_1cc._8_4_; local_170 = local_144; local_168 = (Backdrop *)local_1cc._0_4_; local_164.x = (float)local_16c; local_138 = (Vector *)fVar8; local_134[3] = local_16c; KColor::SetFromARGB((KColor *)(local_1cc + 0xc),0xffffffff); local_140.x = 52.0; auStack_1d8._4_4_ = (float)pBVar16 + renderOffset->x; local_1d0 = (undefined1 [4])((float)pBVar9 + renderOffset->y); local_140.y = fVar8; render_quad_set_rect(local_110,(Vector *)(auStack_1d8 + 4),&local_140,color_16); pfVar14 = g_drawRectUnset; (**(code **)(*(int *)*pBVar10 + 0x14))(); local_180 = (Backdrop *)local_1d0; local_184 = (Backdrop *)(local_140.x + 104.0 + (float)pBStack_150); local_188 = (Backdrop *)local_1d0; pVStack_18c = (Vector *)((float)pBStack_150 + local_140.x + 52.0); local_16c = (Backdrop *)CONCAT31(local_16c._1_3_,1); local_170 = local_134[0]; local_178 = local_134[0]; auVar12 = local_1d0; local_17c = pVStack_18c; local_174 = local_184; local_138 = pVStack_18c; KColor::SetFromARGB((KColor *)local_1cc,0xffffffff); VStack_14c.y = (float)local_144; VStack_14c.x = 52.0; fVar8 = renderOffset->y + 0.0 + (float)auVar12; render_quad_set_rect(local_11c,(Vector *)(auStack_1d8 + -8),&VStack_14c,color_17); pfVar15 = g_drawRectUnset; (**(code **)(*(int *)*pBVar10 + 0x14))(); local_184 = (Backdrop *)(fVar8 + 52.0); local_180 = local_144; pBStack_190 = local_144; local_178 = (Backdrop *)CONCAT31(local_178._1_3_,1); pBStack_198 = (Backdrop *)pfVar14; pBStack_194 = (Backdrop *)fVar8; pVStack_18c = (Vector *)fVar8; local_188 = (Backdrop *)pfVar14; local_17c = (Vector *)local_184; KColor::SetFromARGB((KColor *)auStack_1d8,0xffffffff); VStack_158.x = VStack_14c.x; VStack_158.y = 52.0; fVar8 = renderOffset->y + 0.0 + fVar8; render_quad_set_rect(local_134 + 3,(Vector *)(auStack_1d8 + -0x14),&VStack_158,color_18); (**(code **)(*(int *)*pBVar10 + 0x14))(&pBStack_198,local_134 + 3,g_drawRectUnset); pBStack_1a0 = (Backdrop *)(fVar8 + fStack_1a8 + 52.0); local_184 = (Backdrop *)CONCAT31(local_184._1_3_,1); pVStack_18c = (Vector *)pBStack_150; pBStack_19c = pBStack_150; local_188 = (Backdrop *)VStack_14c.x; pBStack_190 = (Backdrop *)VStack_14c.x; pBStack_1a4 = (Backdrop *)pfVar15; pBStack_198 = pBStack_1a0; pBStack_194 = (Backdrop *)pfVar15; KColor::SetFromARGB((KColor *)(auStack_1d8 + -0xc),0xffffffff); local_164.x = VStack_158.x; local_164.y = 52.0; render_quad_set_rect(local_134,aVStackY_610 + 0x83,&local_164,color_19); BVar7 = *pBVar10; } (**(code **)(*(int *)BVar7 + 0x14))(&pBStack_1a4,local_134,g_drawRectUnset); iVar3 = extraout_ECX_06; LAB_00940b5f: g_graphicsManager_blendMode[0] = savedBlendMode; g_graphicsManager_blendMode[1] = iStack_9c; g_graphicsManager_blendMode[2] = iStack_98; g_graphicsManager_blendMode[3] = iStack_94; g_graphicsManager_blendMode[4] = (int)local_120; shader_cache_find(iVar3); return; } //@@ 00940d30 Backdrop::RenderWater /* DB: called at top of Backdrop::RenderWalls only when Backdrop+0x2c waterGfx != 0, with the render offset; zhl Backdrop::RenderWater(Vector const& offset) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Backdrop::RenderWater(Backdrop *this,Vector *renderOffset) { int iVar1; float *vertexField; int savedBlendMode0; KColor *color; int vertexLeft; KColor *color_00; KColor *color_01; KColor *color_02; KColor *color_03; KColor *color_04; KColor *color_05; KColor *color_06; KColor *color_07; KColor *color_08; KColor *color_09; KColor *color_10; KColor *color_11; KColor *color_12; KColor *color_13; KColor *color_14; KColor *color_15; KColor *color_16; KColor *color_17; KColor *extraout_ECX; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; KColor *color_18; undefined1 quadSource [116]; int savedBlendMode4; KColor quadColor; Vector local_7c; Vector local_74; Vector local_6c; Vector local_64; float local_5c; DestinationQuad uvQuad; undefined1 local_38; Vector local_34; Vector local_2c; Vector local_24; float local_1c; float uvRight; float uvLeft; void *room; int savedBlendMode0; int savedBlendMode1; int savedBlendMode2; int savedBlendMode3; savedBlendMode4 = g_graphicsManager_blendMode[4]; savedBlendMode3 = g_graphicsManager_blendMode[3]; savedBlendMode2 = g_graphicsManager_blendMode[2]; savedBlendMode1 = g_graphicsManager_blendMode[1]; savedBlendMode0 = g_graphicsManager_blendMode[0]; g_graphicsManager_blendMode[4] = 0; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 0; g_graphicsManager_blendMode[3] = 1; uvQuad._topLeft.x = (float)g_game->_frameCount * 0.5; if (this[(int)this[0x54] * 0x4f + 0xa3].field_0x1 != '\0') { uvQuad._topLeft.x = uvQuad._topLeft.x * -1.0; } room = g_game->_room; fVar7 = 104.0; fVar6 = 182.0; fVar3 = *(float *)((int)room + 0x10); local_7c.y = *(float *)((int)room + 0xc); local_6c.y = (float)this; local_24.y = fVar3; if ((*(int *)((int)room + 4) == 0) || (savedBlendMode0 = *(int *)(*(int *)((int)room + 4) + 0x10), savedBlendMode0 == 0)) { savedBlendMode0 = 1; LAB_0094130a: fVar5 = 52.0; local_5c = (float)((int)fVar3 + -2); uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; local_38 = 1; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; uvQuad._topRight.x = 52.0 - uvQuad._topLeft.x; uvQuad._topLeft.x = -uvQuad._topLeft.x; uvQuad._bottomLeft.x = uvQuad._topLeft.x; uvQuad._bottomRight.x = uvQuad._topRight.x; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; uvRight = uvQuad._topRight.x; uvLeft = uvQuad._topLeft.x; KColor::SetFromARGB(&quadColor,0xffffffff); fVar7 = renderOffset->x; fVar4 = fVar7 + fVar5; fVar6 = (float)(int)fVar3 * 26.0 + renderOffset->y; fVar5 = renderOffset->y + fVar5; LAB_009413ab: local_1c = (float)(int)fVar3; render_quad_set_uniform_color(quadSource,fVar7,fVar5,fVar4,fVar6,&quadColor); FUN_009426b0(&uvQuad,quadSource); LAB_009413db: if (savedBlendMode0 != 10) { if (savedBlendMode0 != 0xc) { if ((savedBlendMode0 == 2) || (savedBlendMode0 == 7)) { uvQuad._bottomLeft.x = uvRight; uvQuad._topLeft.x = uvRight; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; uvQuad._bottomRight.y = 78.0; uvQuad._bottomLeft.y = 78.0; local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_74.y = (float)(int)local_7c.y; render_quad_set_uniform_color (quadSource,local_74.y * 26.0 + renderOffset->x,renderOffset->y + 104.0, (float)((int)local_7c.y + 2) * 26.0 + renderOffset->x,renderOffset->y + 182.0, color_10); FUN_009426b0(&uvQuad,quadSource); local_5c = local_1c * 26.0; } else { if ((savedBlendMode0 != 3) && (savedBlendMode0 != 5)) goto LAB_00941941; fVar3 = 26.0; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; local_38 = 1; uvQuad._bottomLeft.x = uvRight; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; uvQuad._topLeft.x = uvRight; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; fVar7 = local_1c; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_5c = fVar7 * fVar3; render_quad_set_uniform_color (quadSource,(float)((int)local_7c.y + -4) * fVar3 + renderOffset->x, renderOffset->y + 52.0,(float)((int)local_7c.y + -2) * fVar3 + renderOffset->x, local_5c + renderOffset->y,color_09); FUN_009426b0(&uvQuad,quadSource); local_74.y = (float)(int)local_7c.y; } goto LAB_00941bd2; } uvQuad._bottomLeft.x = uvRight; uvQuad._topLeft.x = uvRight; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; uvQuad._bottomRight.y = 234.0; uvQuad._bottomLeft.y = 234.0; local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_74.y = (float)(int)local_7c.y; local_24.y = (float)((int)local_7c.y + 2) * 26.0; local_2c.y = local_74.y * 26.0; render_quad_set_uniform_color (quadSource,local_2c.y + renderOffset->x,renderOffset->y + 52.0, renderOffset->x + local_24.y,renderOffset->y + 234.0,&quadColor); FUN_009426b0(&uvQuad,quadSource); uvQuad._topRight.y = 234.0; uvQuad._topLeft.y = 234.0; local_38 = 1; uvQuad._bottomLeft.x = uvRight; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; uvQuad._topLeft.x = uvRight; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_5c = local_1c * 26.0; render_quad_set_uniform_color (quadSource,(local_2c.y + renderOffset->x) - 338.0,renderOffset->y + 234.0, (renderOffset->x + local_24.y) - 338.0,local_5c + renderOffset->y,color_07); FUN_009426b0(&uvQuad,quadSource); fVar7 = local_74.y; LAB_00941e21: local_64.x = uvRight; local_24.y = (float)(2 - (int)local_7c.y); local_34.x = uvRight; local_34.y = 0.0; local_74.y = 0.0; local_2c.x = uvLeft; local_64.y = (float)(int)local_24.y * 26.0; local_74.x = uvLeft; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_74,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); fVar3 = renderOffset->y; local_74.y = fVar7 * 26.0; fVar7 = fVar3 + 52.0; LAB_00942022: render_quad_set_uniform_color (quadSource,renderOffset->x + 52.0,fVar3,renderOffset->x + local_74.y,fVar7, &quadColor); FUN_009426b0(&uvQuad,quadSource); goto LAB_00942072; } uvQuad._bottomLeft.x = uvRight; uvQuad._topLeft.x = uvRight; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; uvQuad._bottomRight.y = 182.0; uvQuad._bottomLeft.y = 182.0; local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_74.y = (float)(int)local_7c.y * 26.0; local_24.y = (float)((int)local_7c.y + 2) * 26.0; render_quad_set_uniform_color (quadSource,(local_74.y + renderOffset->x) - 338.0,renderOffset->y + 52.0, (renderOffset->x + local_24.y) - 338.0,renderOffset->y + 182.0,&quadColor); fVar7 = local_6c.y; savedBlendMode0 = (**(code **)(*(int *)*(Backdrop *)((int)local_6c.y + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (savedBlendMode0 != 0) { vertexField = (float *)(savedBlendMode0 + 8); savedBlendMode0 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; savedBlendMode0 = savedBlendMode0 + -1; } while (savedBlendMode0 != 0); } uvQuad._topRight.y = 182.0; uvQuad._topLeft.y = 182.0; local_38 = 1; uvQuad._bottomLeft.x = uvRight; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; uvQuad._topLeft.x = uvRight; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_5c = local_1c * 26.0; render_quad_set_uniform_color (quadSource,local_74.y + renderOffset->x,renderOffset->y + 182.0, renderOffset->x + local_24.y,renderOffset->y + local_5c,color_04); savedBlendMode0 = (**(code **)(*(int *)*(Backdrop *)((int)fVar7 + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (savedBlendMode0 != 0) { vertexField = (float *)(savedBlendMode0 + 8); savedBlendMode0 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; savedBlendMode0 = savedBlendMode0 + -1; } while (savedBlendMode0 != 0); } local_2c.x = uvRight; local_2c.y = -390.0; local_24.x = uvRight; local_24.y = 0.0; local_6c.x = uvLeft; local_6c.y = -390.0; local_34.x = uvLeft; local_34.y = 0.0; DestinationQuad::DestinationQuad(&uvQuad,&local_34,&local_6c,&local_24,&local_2c); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 52.0,renderOffset->y,renderOffset->x + 390.0, renderOffset->y + 52.0,color_05); FUN_009426b0(&uvQuad,quadSource); local_34.x = uvRight; local_24.y = (float)(2 - (int)local_7c.y); local_2c.x = uvRight; local_2c.y = 15.0; local_6c.y = 15.0; local_7c.x = uvLeft; local_7c.y = (float)(int)local_24.y * 26.0; local_6c.x = uvLeft; local_34.y = local_7c.y; DestinationQuad::DestinationQuad(&uvQuad,&local_6c,&local_7c,&local_2c,&local_34); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 390.0,renderOffset->y + 182.0, renderOffset->x + local_74.y,renderOffset->y + 52.0 + 182.0,color_06); FUN_009426b0(&uvQuad,quadSource); } else { savedBlendMode0 = *(int *)(savedBlendMode0 + 0x48); if (savedBlendMode0 == 9) { fVar7 = 52.0; uvQuad._topRight.y = 0.0; uvQuad._topRight.x = 52.0 - uvQuad._topLeft.x; uvQuad._topLeft.y = 0.0; uvQuad._bottomRight.y = 182.0; uvQuad._topLeft.x = -uvQuad._topLeft.x; uvQuad._bottomLeft.y = 182.0; local_38 = 1; uvQuad._bottomLeft.x = uvQuad._topLeft.x; uvQuad._bottomRight.x = uvQuad._topRight.x; uvRight = uvQuad._topRight.x; uvLeft = uvQuad._topLeft.x; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 338.0,renderOffset->y + fVar7, renderOffset->x + fVar7 + 338.0,renderOffset->y + fVar6,color); iVar1 = (**(code **)(*(int *)*(Backdrop *)((int)local_6c.y + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (iVar1 != 0) { vertexLeft = 4; vertexField = (float *)(iVar1 + 8); do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; vertexLeft = vertexLeft + -1; } while (vertexLeft != 0); } local_5c = (float)((int)local_24.y + -2); uvQuad._bottomLeft.x = uvLeft; uvQuad._topLeft.x = uvLeft; uvQuad._topRight.y = 182.0; uvQuad._topLeft.y = 182.0; uvQuad._bottomRight.x = uvRight; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; local_38 = 1; uvQuad._topRight.x = uvRight; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_1c = (float)(int)local_24.y; render_quad_set_uniform_color (quadSource,renderOffset->x,renderOffset->y + 182.0,renderOffset->x + 52.0, local_1c * 26.0 + renderOffset->y,color_00); iVar1 = (**(code **)(*(int *)*(Backdrop *)((int)local_6c.y + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (iVar1 != 0) { vertexField = (float *)(iVar1 + 8); iVar1 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; iVar1 = iVar1 + -1; } while (iVar1 != 0); } } else { if (savedBlendMode0 != 0xb) { if ((savedBlendMode0 != 2) && (savedBlendMode0 != 7)) { if ((savedBlendMode0 != 3) && (savedBlendMode0 != 5)) goto LAB_0094130a; local_5c = (float)((int)fVar3 + -2); uvQuad._topRight.x = 52.0 - uvQuad._topLeft.x; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; local_38 = 1; uvQuad._topLeft.x = -uvQuad._topLeft.x; uvQuad._bottomLeft.x = uvQuad._topLeft.x; uvQuad._bottomRight.x = uvQuad._topRight.x; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; uvRight = uvQuad._topRight.x; uvLeft = uvQuad._topLeft.x; KColor::SetFromARGB(&quadColor,0xffffffff); fVar4 = renderOffset->x + 156.0; fVar7 = renderOffset->x + fVar7; fVar6 = (float)(int)fVar3 * 26.0 + renderOffset->y; fVar5 = renderOffset->y + 52.0; goto LAB_009413ab; } uvQuad._topRight.x = 52.0 - uvQuad._topLeft.x; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; uvQuad._topLeft.x = -uvQuad._topLeft.x; uvQuad._bottomRight.y = 78.0; uvQuad._bottomLeft.y = 78.0; local_38 = 1; uvQuad._bottomLeft.x = uvQuad._topLeft.x; uvQuad._bottomRight.x = uvQuad._topRight.x; uvRight = uvQuad._topRight.x; uvLeft = uvQuad._topLeft.x; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x,renderOffset->y + fVar7,renderOffset->x + 52.0, renderOffset->y + fVar6,color_03); FUN_009426b0(&uvQuad,quadSource); local_5c = (float)((int)local_24.y + -2); local_1c = (float)(int)local_24.y; goto LAB_009413db; } fVar7 = 52.0; uvQuad._topRight.y = 0.0; uvQuad._topRight.x = 52.0 - uvQuad._topLeft.x; uvQuad._topLeft.y = 0.0; uvQuad._bottomRight.y = 234.0; uvQuad._topLeft.x = -uvQuad._topLeft.x; uvQuad._bottomLeft.y = 234.0; local_38 = 1; uvQuad._bottomLeft.x = uvQuad._topLeft.x; uvQuad._bottomRight.x = uvQuad._topRight.x; uvRight = uvQuad._topRight.x; uvLeft = uvQuad._topLeft.x; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x,renderOffset->y + fVar7,renderOffset->x + fVar7, renderOffset->y + 234.0,color_01); FUN_009426b0(&uvQuad,quadSource); local_5c = (float)((int)local_24.y + -2); uvQuad._bottomLeft.x = uvLeft; uvQuad._topLeft.x = uvLeft; uvQuad._topRight.y = 234.0; uvQuad._topLeft.y = 234.0; uvQuad._bottomRight.x = uvRight; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; local_38 = 1; uvQuad._topRight.x = uvRight; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_1c = (float)(int)local_24.y; render_quad_set_uniform_color (quadSource,renderOffset->x + 338.0,renderOffset->y + 234.0, renderOffset->x + 52.0 + 338.0,local_1c * 26.0 + renderOffset->y,color_02); FUN_009426b0(&uvQuad,quadSource); } LAB_00941941: fVar7 = 26.0; uvQuad._topRight.y = 0.0; uvQuad._topLeft.y = 0.0; local_38 = 1; uvQuad._bottomLeft.x = uvRight; uvQuad._bottomLeft.y = (float)(int)local_5c * 26.0; uvQuad._topLeft.x = uvRight; uvQuad._bottomRight.x = uvLeft; uvQuad._topRight.x = uvLeft; uvQuad._bottomRight.y = uvQuad._bottomLeft.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_5c = local_1c * fVar7; local_74.y = (float)(int)local_7c.y; render_quad_set_uniform_color (quadSource,local_74.y * fVar7 + renderOffset->x,renderOffset->y + 52.0, (float)((int)local_7c.y + 2) * fVar7 + renderOffset->x,local_5c + renderOffset->y, color_08); FUN_009426b0(&uvQuad,quadSource); LAB_00941bd2: fVar7 = local_74.y; fVar3 = 26.0; local_2c.y = local_74.y; if (savedBlendMode0 != 9) { if ((savedBlendMode0 == 2) || (savedBlendMode0 == 7)) { local_24.y = (float)(2 - (int)local_7c.y); local_64.x = uvRight; local_34.x = uvRight; local_34.y = 0.0; local_74.y = 0.0; local_2c.x = uvLeft; local_64.y = (float)(int)local_24.y * 26.0; local_74.x = uvLeft; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_74,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_74.y = fVar7 * fVar3; fVar7 = renderOffset->y + 104.0; fVar3 = renderOffset->y + 52.0; goto LAB_00942022; } if ((savedBlendMode0 != 3) && (savedBlendMode0 != 5)) goto LAB_00941e21; local_64.x = uvRight; local_34.x = uvRight; local_64.y = -130.0; local_34.y = 0.0; local_24.x = uvLeft; local_24.y = -130.0; local_74.x = uvLeft; local_74.y = 0.0; DestinationQuad::DestinationQuad(&uvQuad,&local_74,&local_24,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 156.0,renderOffset->y, (float)((int)local_7c.y + -4) * fVar3 + renderOffset->x,renderOffset->y + 52.0, color_13); FUN_009426b0(&uvQuad,quadSource); local_24.y = (float)(2 - (int)local_7c.y); local_74.y = local_2c.y * 26.0; LAB_00942072: fVar7 = 26.0; if (savedBlendMode0 == 0xb) { local_64.x = uvLeft; local_64.y = -338.0; local_34.x = uvLeft; local_34.y = 0.0; local_2c.x = uvRight; local_2c.y = -338.0; local_7c.x = uvRight; local_7c.y = 0.0; fVar3 = local_5c; DestinationQuad::DestinationQuad(&uvQuad,&local_7c,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_1c = (local_1c + 2.0) * fVar7; render_quad_set_uniform_color (quadSource,renderOffset->x + 52.0,(fVar3 + renderOffset->y) - 182.0, renderOffset->x + 338.0,(renderOffset->y + local_1c) - 182.0,color_14); fVar7 = local_6c.y; savedBlendMode0 = (**(code **)(*(int *)*(Backdrop *)((int)local_6c.y + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (savedBlendMode0 != 0) { vertexField = (float *)(savedBlendMode0 + 8); savedBlendMode0 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; savedBlendMode0 = savedBlendMode0 + -1; } while (savedBlendMode0 != 0); } local_64.y = (float)(int)local_24.y; local_34.y = 13.0; local_24.y = 13.0; local_64.x = uvLeft; local_64.y = local_64.y * 26.0; local_34.x = uvLeft; local_2c.x = uvRight; local_24.x = uvRight; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_24,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 338.0,local_5c + renderOffset->y, renderOffset->x + local_74.y,renderOffset->y + local_1c,color_15); savedBlendMode0 = (**(code **)(*(int *)*(Backdrop *)((int)fVar7 + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (savedBlendMode0 == 0) { g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = savedBlendMode2; g_graphicsManager_blendMode[3] = savedBlendMode3; g_graphicsManager_blendMode[4] = savedBlendMode4; return; } vertexField = (float *)(savedBlendMode0 + 8); savedBlendMode0 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; savedBlendMode0 = savedBlendMode0 + -1; } while (savedBlendMode0 != 0); g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = savedBlendMode2; g_graphicsManager_blendMode[3] = savedBlendMode3; g_graphicsManager_blendMode[4] = savedBlendMode4; return; } if (savedBlendMode0 == 0xc) { local_64.x = uvLeft; local_64.y = -390.0; local_34.x = uvLeft; local_34.y = 0.0; local_2c.x = uvRight; local_2c.y = -390.0; local_7c.x = uvRight; local_7c.y = 0.0; fVar3 = local_5c; DestinationQuad::DestinationQuad(&uvQuad,&local_7c,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_1c = (local_1c + 2.0) * fVar7; render_quad_set_uniform_color (quadSource,renderOffset->x + 52.0,fVar3 + renderOffset->y,renderOffset->x + 390.0 ,renderOffset->y + local_1c,color_16); FUN_009426b0(&uvQuad,quadSource); local_64.y = (float)(int)local_24.y; local_34.y = 15.0; local_24.y = 15.0; local_64.x = uvLeft; local_64.y = local_64.y * 26.0; local_34.x = uvLeft; local_2c.x = uvRight; local_24.x = uvRight; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_24,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); fVar3 = (renderOffset->y + local_1c) - 182.0; fVar5 = renderOffset->x + local_74.y; fVar4 = renderOffset->x + 390.0; fVar6 = (renderOffset->y + local_5c) - 182.0; LAB_00942641: color_18 = &quadColor; } else { if ((savedBlendMode0 == 2) || (savedBlendMode0 == 7)) { local_64.y = (float)(int)local_24.y; local_34.y = 0.0; local_24.y = 0.0; local_64.x = uvLeft; local_64.y = local_64.y * 26.0; local_34.x = uvLeft; local_2c.x = uvRight; local_24.x = uvRight; fVar3 = local_5c; fVar5 = local_74.y; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_24,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); fVar4 = renderOffset->x + 52.0; fVar5 = renderOffset->x + fVar5; fVar3 = renderOffset->y + fVar3; fVar6 = (local_1c - 2.0) * fVar7 + renderOffset->y; goto LAB_00942641; } if ((savedBlendMode0 != 3) && (savedBlendMode0 != 5)) goto LAB_00942444; local_64.x = uvLeft; local_34.x = uvLeft; local_64.y = -130.0; local_34.y = 0.0; local_2c.x = uvRight; local_2c.y = -130.0; local_24.x = uvRight; local_24.y = 0.0; fVar6 = local_5c; DestinationQuad::DestinationQuad(&uvQuad,&local_24,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); fVar3 = (local_1c + 2.0) * fVar7 + renderOffset->y; fVar6 = renderOffset->y + fVar6; fVar5 = (float)((int)local_7c.y + -4) * fVar7 + renderOffset->x; fVar4 = renderOffset->x + 156.0; color_18 = extraout_ECX; } render_quad_set_uniform_color(quadSource,fVar4,fVar6,fVar5,fVar3,color_18); goto LAB_00942659; } local_34.x = uvRight; local_34.y = -338.0; local_2c.x = uvRight; local_2c.y = 0.0; local_24.x = uvLeft; local_24.y = -338.0; local_64.x = uvLeft; local_64.y = 0.0; DestinationQuad::DestinationQuad(&uvQuad,&local_64,&local_24,&local_2c,&local_34); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 52.0,renderOffset->y + 182.0,renderOffset->x + 338.0, renderOffset->y + 52.0 + 182.0,color_11); fVar7 = local_6c.y; savedBlendMode0 = (**(code **)(*(int *)*(Backdrop *)((int)local_6c.y + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (savedBlendMode0 != 0) { vertexField = (float *)(savedBlendMode0 + 8); savedBlendMode0 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; savedBlendMode0 = savedBlendMode0 + -1; } while (savedBlendMode0 != 0); } local_64.x = uvRight; local_24.y = (float)(2 - (int)local_7c.y); local_34.x = uvRight; local_34.y = -338.0; local_7c.y = -338.0; local_2c.x = uvLeft; local_64.y = (float)(int)local_24.y * 26.0; local_7c.x = uvLeft; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_7c,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); local_74.y = local_74.y * 26.0; render_quad_set_uniform_color (quadSource,renderOffset->x + 338.0,renderOffset->y,renderOffset->x + local_74.y, renderOffset->y + 52.0,color_12); savedBlendMode0 = (**(code **)(*(int *)*(Backdrop *)((int)fVar7 + 0x2c) + 0x14)) (&uvQuad,quadSource,g_drawRectUnset); if (savedBlendMode0 != 0) { vertexField = (float *)(savedBlendMode0 + 8); savedBlendMode0 = 4; do { *vertexField = *vertexField + 0.04 + 0.04 + 0.04 + 0.04; vertexField = vertexField + 9; savedBlendMode0 = savedBlendMode0 + -1; } while (savedBlendMode0 != 0); } } LAB_00942444: local_64.y = (float)(int)local_24.y; local_34.y = 0.0; local_24.y = 0.0; local_64.x = uvLeft; local_64.y = local_64.y * 26.0; local_34.x = uvLeft; local_2c.x = uvRight; local_24.x = uvRight; fVar7 = local_5c; local_2c.y = local_64.y; DestinationQuad::DestinationQuad(&uvQuad,&local_24,&local_2c,&local_34,&local_64); local_38 = 1; KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color (quadSource,renderOffset->x + 52.0,renderOffset->y + fVar7,renderOffset->x + local_74.y, (local_1c + 2.0) * 26.0 + renderOffset->y,color_17); LAB_00942659: FUN_009426b0(&uvQuad,quadSource); g_graphicsManager_blendMode[0] = savedBlendMode0; g_graphicsManager_blendMode[1] = savedBlendMode1; g_graphicsManager_blendMode[2] = savedBlendMode2; g_graphicsManager_blendMode[3] = savedBlendMode3; g_graphicsManager_blendMode[4] = savedBlendMode4; return; } //@@ 009426b0 FUN_009426b0 void FUN_009426b0(undefined4 param_1,undefined4 param_2) { int iVar1; float *pfVar2; int in_ECX; iVar1 = (**(code **)(**(int **)(in_ECX + 0x2c) + 0x14))(param_1,param_2,g_drawRectUnset); if (iVar1 != 0) { pfVar2 = (float *)(iVar1 + 8); iVar1 = 4; do { *pfVar2 = *pfVar2 + 0.04 + 0.04 + 0.04 + 0.04; pfVar2 = pfVar2 + 9; iVar1 = iVar1 + -1; } while (iVar1 != 0); } return; } //@@ 00942710 std::vector<36byte>::_Insert_range /* DB: inserts [param_2,param_3) of 0x24-byte elements at param_1 (max 0x71c71c7, ICF FileSymbolInfo helpers); Backdrop::render_floor_to_target */ void std::vector<36byte>::_Insert_range(undefined4 *param_1,int param_2,int param_3) { uint uVar1; undefined4 *puVar2; uint uVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; uint uVar8; FileSymbolInfo *pFVar9; int iVar10; int *in_ECX; undefined4 extraout_ECX; undefined4 *puVar11; iVar10 = *in_ECX; uVar3 = (param_3 - param_2) / 0x24; puVar2 = (undefined4 *)in_ECX[1]; if (uVar3 != 0) { if ((uint)((in_ECX[2] - (int)puVar2) / 0x24) < uVar3) { iVar4 = ((int)puVar2 - iVar10) / 0x24; if (0x71c71c7U - iVar4 < uVar3) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar4 + uVar3; uVar8 = FUN_0041ff00(uVar1); if (0x71c71c7 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pFVar9 = _Allocate(uVar8 * 0x24); iVar4 = ((int)param_1 - iVar10) / 0x24; _Uninitialized_move(pFVar9 + iVar4 * 0x24,(int)param_1 - iVar10); if ((uVar3 == 1) && (param_1 == puVar2)) { _Uninitialized_move(pFVar9,extraout_ECX); } else { _Uninitialized_copy(iVar10,param_1,pFVar9); _Uninitialized_copy(param_1,puVar2,pFVar9 + (iVar4 + uVar3) * 0x24); } FID_conflict__Change_array(in_ECX,pFVar9,uVar1,uVar8); return; } if (uVar3 < (uint)(((int)puVar2 - (int)param_1) / 0x24)) { puVar11 = puVar2 + uVar3 * -9; iVar10 = _Uninitialized_copy(puVar11,puVar2,puVar2); in_ECX[1] = iVar10; for (; puVar11 != param_1; puVar11 = puVar11 + -9) { uVar5 = puVar11[-8]; uVar6 = puVar11[-7]; uVar7 = puVar11[-6]; puVar2[-9] = puVar11[-9]; puVar2[-8] = uVar5; puVar2[-7] = uVar6; puVar2[-6] = uVar7; uVar5 = puVar11[-4]; uVar6 = puVar11[-3]; uVar7 = puVar11[-2]; puVar2[-5] = puVar11[-5]; puVar2[-4] = uVar5; puVar2[-3] = uVar6; puVar2[-2] = uVar7; puVar2[-1] = puVar11[-1]; puVar2 = puVar2 + -9; } } else { iVar10 = _Uninitialized_copy(param_1,puVar2,param_1 + uVar3 * 9); in_ECX[1] = iVar10; } _Uninitialized_move(param_1,in_ECX); } return; } //@@ 009428d0 Camera::constructor /* ZHL [exact] __thiscall void Camera::constructor(Room* room); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Camera::constructor(Camera *this,Room *room) { void *pvVar1; Vector position; Vector position_00; Vector *resultPos; float *softClampedPos; int iVar2; int writeSlot; float fVar3; Vector scratchPos; Camera *local_3c; Vector local_38; Vector local_30; undefined1 softClampOut [4]; float bufferCapacity; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Room *currentRoom; uint enterDoor; Game *game; puStack_20 = softClampOut + 0x24; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b454; local_1c = ExceptionList; ExceptionList = &local_1c; local_3c = this; CircularBuffer::constructor(0x3c); local_14 = 0; CircularBuffer::constructor(0x5a); local_14._0_1_ = 1; CircularBuffer::constructor(300); local_14._0_1_ = 2; CircularBuffer::constructor(0xf); local_14._0_1_ = 3; CircularBuffer::constructor(4); local_14._0_1_ = 4; CircularBuffer::constructor(0x78); local_14 = CONCAT31(local_14._1_3_,5); (this->_playersCenter).y = 0.0; (this->_playersCenter).x = 0.0; (this->_position).y = 0.0; (this->_position).x = 0.0; (this->_screenAnchor).y = 0.0; (this->_screenAnchor).x = 0.0; (this->_unk7c).y = 0.0; (this->_unk7c).x = 0.0; (this->_unk84).y = 0.0; (this->_unk84).x = 0.0; this->_room = room; fVar3 = g_vectorOne.y * 0.5; (this->_screenAnchor).x = g_vectorOne.x * 0.5; (this->_screenAnchor).y = fVar3; position.y = g_vectorZero.y; position.x = g_vectorZero.x; resultPos = ClampedToRoom(this,&scratchPos,position); (this->_position).x = resultPos->x; (this->_position).y = resultPos->y; (this->_unk7c).x = g_vectorZero.x; (this->_unk7c).y = g_vectorZero.y; (this->_unk84).x = g_vectorZero.x; (this->_unk84).y = g_vectorZero.y; fVar3 = *(float *)(this->_aimOffsetBuffer + 8); while ((int)fVar3 < 0x3c) { bufferCapacity = *(float *)(this->_aimOffsetBuffer + 4); if (fVar3 == bufferCapacity) { if ((int)fVar3 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); bufferCapacity = *(float *)(this->_aimOffsetBuffer + 4); fVar3 = *(float *)(this->_aimOffsetBuffer + 8); } iVar2 = (*(int *)(this->_aimOffsetBuffer + 0xc) + 1) % (int)bufferCapacity; fVar3 = (float)((int)fVar3 + -1); *(int *)(this->_aimOffsetBuffer + 0xc) = iVar2; *(float *)(this->_aimOffsetBuffer + 8) = fVar3; } else { iVar2 = *(int *)(this->_aimOffsetBuffer + 0xc); } writeSlot = ((int)fVar3 + iVar2) % (int)bufferCapacity; iVar2 = *(int *)this->_aimOffsetBuffer; *(float *)(iVar2 + writeSlot * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + writeSlot * 8) = g_vectorZero.y; *(int *)(this->_aimOffsetBuffer + 8) = *(int *)(this->_aimOffsetBuffer + 8) + 1; fVar3 = *(float *)(this->_aimOffsetBuffer + 8); } if (*(int *)(this->_velocityOffsetBuffer + 8) < 0x5a) { local_30.y = *(float *)(this->_velocityOffsetBuffer + 8); do { bufferCapacity = *(float *)(this->_velocityOffsetBuffer + 4); if (local_30.y == bufferCapacity) { if ((int)local_30.y < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); bufferCapacity = *(float *)(this->_velocityOffsetBuffer + 4); local_30.y = *(float *)(this->_velocityOffsetBuffer + 8); } iVar2 = (*(int *)(this->_velocityOffsetBuffer + 0xc) + 1) % (int)bufferCapacity; local_30.y = (float)((int)local_30.y + -1); *(int *)(this->_velocityOffsetBuffer + 0xc) = iVar2; *(float *)(this->_velocityOffsetBuffer + 8) = local_30.y; } else { iVar2 = *(int *)(this->_velocityOffsetBuffer + 0xc); } writeSlot = ((int)local_30.y + iVar2) % (int)bufferCapacity; iVar2 = *(int *)this->_velocityOffsetBuffer; *(float *)(iVar2 + writeSlot * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + writeSlot * 8) = g_vectorZero.y; *(int *)(this->_velocityOffsetBuffer + 8) = *(int *)(this->_velocityOffsetBuffer + 8) + 1; local_30.y = *(float *)(this->_velocityOffsetBuffer + 8); } while (*(int *)(this->_velocityOffsetBuffer + 8) < 0x5a); } if (*(int *)(this->_enemyOffsetBuffer + 8) < 300) { local_30.y = *(float *)(this->_enemyOffsetBuffer + 8); do { bufferCapacity = *(float *)(this->_enemyOffsetBuffer + 4); if (local_30.y == bufferCapacity) { if ((int)local_30.y < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); bufferCapacity = *(float *)(this->_enemyOffsetBuffer + 4); local_30.y = *(float *)(this->_enemyOffsetBuffer + 8); } iVar2 = (*(int *)(this->_enemyOffsetBuffer + 0xc) + 1) % (int)bufferCapacity; local_30.y = (float)((int)local_30.y + -1); *(int *)(this->_enemyOffsetBuffer + 0xc) = iVar2; *(float *)(this->_enemyOffsetBuffer + 8) = local_30.y; } else { iVar2 = *(int *)(this->_enemyOffsetBuffer + 0xc); } writeSlot = ((int)local_30.y + iVar2) % (int)bufferCapacity; iVar2 = *(int *)this->_enemyOffsetBuffer; *(float *)(iVar2 + writeSlot * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + writeSlot * 8) = g_vectorZero.y; *(int *)(this->_enemyOffsetBuffer + 8) = *(int *)(this->_enemyOffsetBuffer + 8) + 1; local_30.y = *(float *)(this->_enemyOffsetBuffer + 8); } while (*(int *)(this->_enemyOffsetBuffer + 8) < 300); } if (*(int *)(this->_playerSpreadBuffer + 8) < 0xf) { local_30.y = *(float *)(this->_playerSpreadBuffer + 8); do { bufferCapacity = *(float *)(this->_playerSpreadBuffer + 4); if (local_30.y == bufferCapacity) { if ((int)local_30.y < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); bufferCapacity = *(float *)(this->_playerSpreadBuffer + 4); local_30.y = *(float *)(this->_playerSpreadBuffer + 8); } iVar2 = (*(int *)(this->_playerSpreadBuffer + 0xc) + 1) % (int)bufferCapacity; local_30.y = (float)((int)local_30.y + -1); *(int *)(this->_playerSpreadBuffer + 0xc) = iVar2; *(float *)(this->_playerSpreadBuffer + 8) = local_30.y; } else { iVar2 = *(int *)(this->_playerSpreadBuffer + 0xc); } writeSlot = ((int)local_30.y + iVar2) % (int)bufferCapacity; iVar2 = *(int *)this->_playerSpreadBuffer; *(float *)(iVar2 + writeSlot * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + writeSlot * 8) = g_vectorZero.y; *(int *)(this->_playerSpreadBuffer + 8) = *(int *)(this->_playerSpreadBuffer + 8) + 1; local_30.y = *(float *)(this->_playerSpreadBuffer + 8); } while (*(int *)(this->_playerSpreadBuffer + 8) < 0xf); } if (*(int *)(this->_shakeOffsetBuffer + 8) < 4) { fVar3 = *(float *)(this->_shakeOffsetBuffer + 8); do { bufferCapacity = *(float *)(this->_shakeOffsetBuffer + 4); if (fVar3 == bufferCapacity) { if ((int)fVar3 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); bufferCapacity = *(float *)(this->_shakeOffsetBuffer + 4); fVar3 = *(float *)(this->_shakeOffsetBuffer + 8); } iVar2 = (*(int *)(this->_shakeOffsetBuffer + 0xc) + 1) % (int)bufferCapacity; fVar3 = (float)((int)fVar3 + -1); *(int *)(this->_shakeOffsetBuffer + 0xc) = iVar2; *(float *)(this->_shakeOffsetBuffer + 8) = fVar3; } else { iVar2 = *(int *)(this->_shakeOffsetBuffer + 0xc); } writeSlot = (iVar2 + (int)fVar3) % (int)bufferCapacity; iVar2 = *(int *)this->_shakeOffsetBuffer; *(float *)(iVar2 + writeSlot * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + writeSlot * 8) = g_vectorZero.y; *(int *)(this->_shakeOffsetBuffer + 8) = *(int *)(this->_shakeOffsetBuffer + 8) + 1; fVar3 = *(float *)(this->_shakeOffsetBuffer + 8); } while ((int)fVar3 < 4); } if (*(int *)(this->_focusPositionBuffer + 8) < 0x78) { fVar3 = *(float *)(this->_focusPositionBuffer + 8); do { local_30.y = -g_vectorOne.x; bufferCapacity = *(float *)(this->_focusPositionBuffer + 4); local_38.y = -g_vectorOne.y; if (fVar3 == bufferCapacity) { if ((int)fVar3 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); bufferCapacity = *(float *)(this->_focusPositionBuffer + 4); fVar3 = *(float *)(this->_focusPositionBuffer + 8); } iVar2 = (*(int *)(this->_focusPositionBuffer + 0xc) + 1) % (int)bufferCapacity; fVar3 = (float)((int)fVar3 + -1); *(int *)(this->_focusPositionBuffer + 0xc) = iVar2; *(float *)(this->_focusPositionBuffer + 8) = fVar3; } else { iVar2 = *(int *)(this->_focusPositionBuffer + 0xc); } writeSlot = ((int)fVar3 + iVar2) % (int)bufferCapacity; iVar2 = *(int *)this->_focusPositionBuffer; *(float *)(iVar2 + writeSlot * 8) = local_30.y; *(float *)(iVar2 + 4 + writeSlot * 8) = local_38.y; *(int *)(this->_focusPositionBuffer + 8) = *(int *)(this->_focusPositionBuffer + 8) + 1; fVar3 = *(float *)(this->_focusPositionBuffer + 8); } while ((int)fVar3 < 0x78); } game = g_game; this->_shouldOverride = 0; this->_followLerp = 0.1; enterDoor = game->_enterDoor; if (enterDoor != 0xffffffff) { currentRoom = this->_room; if (enterDoor < 8) { local_38.x = (float)(currentRoom->_doorGridPositions[enterDoor] % currentRoom->_gridWidth) * 40.0 + 40.0; local_38.y = (float)(currentRoom->_doorGridPositions[enterDoor] / currentRoom->_gridWidth) * 40.0 + 120.0; } else { local_38.x = g_vectorZero.x; local_38.y = g_vectorZero.y; } Room::GetClampedPositionImpl(currentRoom,&local_30,&local_38,20.0,20.0,20.0,20.0); local_38.x = local_30.x; local_38.y = local_30.y; position_00.y = local_30.y; position_00.x = local_30.x; resultPos = ClampedToRoom(this,&local_38,position_00); (this->_position).x = resultPos->x; (this->_position).y = resultPos->y; } resultPos = Level::GetEnterPosition((Level *)g_game,&local_30); if ((resultPos->x != g_vectorZero.x) || (resultPos->y != g_vectorZero.y)) { resultPos = Level::GetEnterPosition((Level *)g_game,&scratchPos); resultPos = ClampedToRoom(this,&local_38,*resultPos); softClampedPos = (float *)soft_clamp_position(softClampOut,resultPos->x,resultPos->y); (this->_position).x = *softClampedPos; (this->_position).y = softClampedPos[1]; } pvVar1 = this->_room; *(float *)((int)pvVar1 + 0x1204) = (this->_position).x; *(float *)((int)pvVar1 + 0x1208) = (this->_position).y; ExceptionList = local_1c; return; } //@@ 00942f20 Camera::get_enemy_focus_offset /* DB: returns Vector: for visible active enemies (type>=10, vfunc +0x48) in the room entity list (+0x68 -> +0x125c/+0x1264) within 550 of players_center_position, sums 0.4*offset*falloff (weight 0.6 if vfunc +0x4c); Camera::update_focus_position */ float * __thiscall Camera::get_enemy_focus_offset(Camera *this,float *param_2) { Entity *this_00; float *pfVar1; char cVar2; uint uVar3; uint uVar4; int iVar5; float fVar6; float fVar7; float fVar8; Vector local_38; float local_30; uint local_2c; float local_28; float local_24; float local_20; int local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pfVar1 = param_2; fVar7 = g_vectorZero.y; fVar6 = g_vectorZero.x; puStack_c = &LAB_00b0b48d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; fVar8 = 0.0; iVar5 = *(int *)((int)this->_room + 0x125c); uVar4 = *(uint *)((int)this->_room + 0x1264); *param_2 = g_vectorZero.x; param_2[1] = fVar7; param_2 = (float *)0x0; local_8 = 0; local_2c = 0; if (uVar4 != 0) { local_1c = iVar5; local_18 = uVar4; do { this_00 = *(Entity **)(iVar5 + local_2c * 4); if ((*(int *)&g_game->_deathmatchManager < 2) || (this_00->_type != 1)) { if (this_00->_type - 10U < 0x3de) goto LAB_00942fe8; } else { LAB_00942fe8: cVar2 = (**(code **)(*(int *)this_00 + 0x48))(uVar3); if ((cVar2 != '\0') && (this_00->_visible != 0)) { local_20 = (this_00->_pos).x; local_24 = (this_00->_pos).y; players_center_position(&g_game->_playerManager,&local_38,1); local_20 = local_20 - local_38.x; local_24 = local_24 - local_38.y; fVar6 = sqrtf(local_20 * local_20 + local_24 * local_24); if (fVar6 < 550.0) { local_30 = (fVar6 - 550.0) / -550.0; cVar2 = (**(code **)(*(int *)this_00 + 0x4c))(); if (cVar2 == '\0') { local_28 = 1.0; } else { local_28 = 0.6; } if (((this_00->_type == 0x112) || (this_00->_type == 0x197)) && (this_00->_variant == 0) ) { Entity::IsVulnerableEnemy(this_00,(Entity *)0x0); } param_2 = (float *)(local_28 + (float)param_2); *pfVar1 = local_20 * local_30 * 0.4 + *pfVar1; pfVar1[1] = local_24 * local_30 * 0.4 + pfVar1[1]; } } uVar4 = local_18; iVar5 = local_1c; fVar8 = (float)param_2; } local_2c = local_2c + 1; } while (local_2c < uVar4); fVar6 = g_vectorZero.x; fVar7 = g_vectorZero.y; } if (fVar8 == 0.0) { pfVar1[1] = fVar7; } else { fVar6 = (1.0 / fVar8) * *pfVar1; pfVar1[1] = (1.0 / fVar8) * pfVar1[1]; } *pfVar1 = fVar6; ExceptionList = local_10; return pfVar1; } //@@ 00943190 vector_ring_buffer_weighted_average /* DB: (out, ring): linearly weighted average of the Vectors in a ring buffer {data, capacity, count, start} (inlined remap logs "Start and End parameters cannot be the same!"); result goes to Game _screenShakeOffset-area (+0x2650c) in Camera::update_follow and Camera::update_focus_position (camera smoothing) */ float * vector_ring_buffer_weighted_average(float *param_1,int *param_2) { float *pfVar1; float *pfVar2; int iVar3; int iVar4; int iVar5; float fVar6; float fVar7; float fVar8; undefined1 *puVar9; float fVar10; float in_XMM3_Da; float fVar11; pfVar2 = param_1; fVar11 = 0.0; iVar3 = param_2[2]; param_1 = (float *)0x0; *pfVar2 = g_vectorZero.x; pfVar2[1] = g_vectorZero.y; fVar6 = (float)iVar3; if (iVar3 < 1) { fVar10 = *pfVar2; fVar8 = pfVar2[1]; } else { fVar7 = (float)(int)(fVar6 * in_XMM3_Da); iVar4 = 0; do { if ((int)(fVar6 * in_XMM3_Da) < iVar4) { puVar9 = (undefined1 *)((float)iVar3 + 1.0); if ((float)puVar9 == fVar7) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } } else { puVar9 = &DAT_bf800000; if (fVar7 == -1.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); puVar9 = &DAT_bf800000; } } iVar5 = iVar4 + 1; pfVar1 = (float *)(*param_2 + ((param_2[3] + iVar4) % param_2[1]) * 8); iVar3 = param_2[2]; fVar8 = ((float)iVar4 - (float)puVar9) / (fVar7 - (float)puVar9); fVar11 = (float)param_1 + fVar8; fVar10 = *pfVar1 * fVar8 + *pfVar2; fVar8 = pfVar1[1] * fVar8 + pfVar2[1]; *pfVar2 = fVar10; pfVar2[1] = fVar8; iVar4 = iVar5; param_1 = (float *)fVar11; } while (iVar5 < iVar3); } pfVar2[1] = (1.0 / fVar11) * fVar8; *pfVar2 = (1.0 / fVar11) * fVar10; return pfVar2; } //@@ 009432f0 Camera::get_clamp_bounds /* DB: ? room bounds -> camera min/max with the 0.65 scale; Beast room zeroes the extra margins (beast.md) */ void __thiscall Camera::get_clamp_bounds(Camera *this,float *param_2,float *param_3) { void *pvVar1; int *piVar2; float fVar3; float fVar4; float fVar5; float fVar6; float local_20; float local_1c; float local_18; float local_14; pvVar1 = this->_room; local_18 = g_vectorOne.x * 80.0; local_20 = g_vectorOne.y * 80.0; fVar5 = *(float *)((int)pvVar1 + 0x11fc); fVar3 = *(float *)((int)pvVar1 + 0x1200); piVar2 = *(int **)(*(int *)((int)pvVar1 + 4) + 0x10); local_1c = fVar5; local_14 = fVar3; if (((piVar2 != (int *)0x0) && (piVar2[2] == 0x10)) && (*piVar2 == 0x23)) { local_18 = g_vectorZero.x; local_20 = g_vectorZero.y; local_1c = g_vectorZero.x; local_14 = g_vectorZero.y; } fVar6 = -fVar5 - (((*(float *)((int)pvVar1 + 0x14) - -20.0) - local_18) * 0.65 - local_1c); fVar5 = -fVar3 - (((*(float *)((int)pvVar1 + 0x18) - 60.0) - local_20) * 0.65 - local_14); fVar4 = (g_screenWidth - *(float *)((int)pvVar1 + 0x11fc)) - (((*(float *)((int)pvVar1 + 0x1c) - -20.0) + local_18) * 0.65 + local_1c); fVar3 = (g_screenHeight - *(float *)((int)pvVar1 + 0x1200)) - (((*(float *)((int)pvVar1 + 0x20) - 60.0) + local_20) * 0.65 + local_14); if (fVar6 < fVar4) { fVar4 = (fVar6 + fVar4) * 0.5; fVar6 = fVar4; } if (fVar5 < fVar3) { fVar3 = (fVar5 + fVar3) * 0.5; fVar5 = fVar3; } *param_2 = fVar4; param_2[1] = fVar3; *param_3 = fVar6; param_3[1] = fVar5; return; } //@@ 00943490 Camera::ClampedToRoom /* ZHL [exact] __thiscall Vector* Camera::ClampedToRoom(Vector& pos); prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Camera::ClampedToRoom(Camera *this,Vector *outPosition,Vector position) { int *piVar1; float *pfVar2; int extraout_EDX; float fVar3; float fVar4; float local_20; float local_1c; float local_18; float local_14; float local_10; float local_c [2]; local_14 = 0.0; local_18 = 0.0; local_1c = 0.0; local_20 = 0.0; get_clamp_bounds(this,&local_18,&local_20); local_10 = g_screenWidth * *(float *)(extraout_EDX + 0x74) - ((g_screenWidth - 338.0) * 0.5 + (position.x - 60.0) * 0.65); local_c[0] = g_screenHeight * *(float *)(extraout_EDX + 0x78) - ((g_screenHeight - 182.0) * 0.5 + (position.y - 140.0) * 0.65); if ((*(uint *)(*(int *)(*(int *)(extraout_EDX + 0x68) + 4) + 0x44) >> 0xf & 1) != 0) { outPosition->x = local_10; outPosition->y = local_c[0]; return outPosition; } pfVar2 = &local_10; if (local_20 <= local_10) { pfVar2 = &local_20; } fVar4 = *pfVar2; if (fVar4 <= local_18) { fVar4 = local_18; } pfVar2 = local_c; if (local_1c <= local_c[0]) { pfVar2 = &local_1c; } fVar3 = *pfVar2; if (fVar3 <= local_14) { fVar3 = local_14; } piVar1 = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10); if ((((piVar1 != (int *)0x0) && (piVar1[2] == 0x10)) && (*piVar1 == 0x23)) && ((*(char *)(extraout_EDX + 0x8c) != '\0' && (0 < *(int *)(extraout_EDX + 0x58))))) { fVar4 = local_10; } outPosition->x = fVar4; outPosition->y = fVar3; return outPosition; } //@@ 00943610 Camera::soft_clamp_position /* DB: thiscall Camera, (out Vector*, x, y): Camera::get_clamp_bounds then remaps each axis into the bounds with a smoothstep-like polynomial (6t^5-15t^4+...); logs "Start and End parameters cannot be the same!" for an empty range; Camera::constructor, Camera::update_focus_position */ void Camera::soft_clamp_position(float *param_1,float param_2,float param_3) { Camera *in_ECX; float fVar1; float local_18; float local_14; float local_10; float local_c; local_c = 0.0; local_10 = 0.0; local_14 = 0.0; local_18 = 0.0; get_clamp_bounds(in_ECX,&local_10,&local_18); if (param_2 <= local_10) { fVar1 = local_10; } else { fVar1 = local_18; if (param_2 < local_18) { if (local_10 == local_18) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar1 = (param_2 - local_10) / (local_18 - local_10); fVar1 = (local_18 - local_10) * (((fVar1 * 6.0 * fVar1 * fVar1 - fVar1 * 15.0 * fVar1) + fVar1 * 14.0) - 6.0) * -(fVar1 * fVar1) + local_10; } } if (param_3 <= local_c) { local_14 = local_c; } else if (param_3 < local_14) { if (local_c == local_14) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } *param_1 = fVar1; fVar1 = (param_3 - local_c) / (local_14 - local_c); param_1[1] = (local_14 - local_c) * (((fVar1 * 4.0 * fVar1 * fVar1 - fVar1 * 10.0 * fVar1) + fVar1 * 10.0) - 5.0) * -(fVar1 * fVar1) + local_c; return; } *param_1 = fVar1; param_1[1] = local_14; return; } //@@ 009437e0 Camera::DoUpdate /* ZHL [exact] __thiscall void Camera::DoUpdate(bool unk); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Camera::DoUpdate(Camera *this,byte unk) { int iVar1; iVar1 = (g_manager->_optionsConfig)._cameraStyle; if ((iVar1 == 1) || (iVar1 != 2)) { update_focus_position(this,unk); this->_shouldOverride = 0; } else { update_follow(this); if (unk != 0) { this->_shouldOverride = 0; return; } } return; } //@@ 00943830 FUN_00943830 void FUN_00943830(void) { float fVar1; int iVar2; float fVar3; int in_ECX; int iVar4; float fVar5; float fVar6; float fVar7; Vector local_10; players_center_position(&g_game->_playerManager,&local_10,0); fVar3 = g_vectorZero.y; fVar7 = g_screenHeight; if ((*(char *)(in_ECX + 0x8c) != '\0') && (0 < *(int *)(in_ECX + 0x58))) { iVar4 = (*(int *)(in_ECX + 0x58) + -1 + *(int *)(in_ECX + 0x5c)) % *(int *)(in_ECX + 0x54); local_10.x = *(float *)(*(int *)(in_ECX + 0x50) + iVar4 * 8); local_10.y = *(float *)(*(int *)(in_ECX + 0x50) + iVar4 * 8 + 4); } iVar4 = *(int *)(in_ECX + 0x68); iVar2 = *(int *)(iVar4 + 0x10); fVar1 = *(float *)(iVar4 + 0x1200); fVar6 = g_screenWidth * *(float *)(in_ECX + 0x74) - ((g_screenWidth - 338.0) * 0.5 + (local_10.x - 60.0) * 0.65); fVar5 = -(((float)*(int *)(iVar4 + 0xc) + 2.0) * 26.0 + *(float *)(iVar4 + 0x11fc) + *(float *)(iVar4 + 0x11fc)) + g_screenWidth; if (fVar6 <= fVar5) { fVar6 = fVar5; } if (g_vectorZero.x <= fVar6) { fVar6 = g_vectorZero.x; } fVar5 = *(float *)(in_ECX + 0x78) * g_screenHeight - ((g_screenHeight - 182.0) * 0.5 + (local_10.y - 140.0) * 0.65); fVar6 = fVar6 + *(float *)(in_ECX + 0x6c); *(float *)(in_ECX + 0x6c) = fVar6; fVar7 = -(fVar1 + fVar1 + ((float)iVar2 + 2.0) * 26.0) + fVar7; if (fVar5 <= fVar7) { fVar5 = fVar7; } if (fVar3 <= fVar5) { fVar5 = fVar3; } *(float *)(in_ECX + 0x70) = fVar5 + *(float *)(in_ECX + 0x70); iVar4 = *(int *)(in_ECX + 0x68); *(float *)(iVar4 + 0x1204) = fVar6; *(undefined4 *)(iVar4 + 0x1208) = *(undefined4 *)(in_ECX + 0x70); return; } //@@ 009439d0 Camera::update_focus_position /* DB: ? real body of Camera::DoUpdate (called unless camera mode 2); "No main player detected when trying to update camera", Epic Fetus target/knife/laser focus, position ring buffers, Camera::ClampedToRoom prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Camera::update_focus_position(Camera *this,byte isSkipFocusBuffer) { Vector position; qword qVar1; byte isLudovico; Entity_Player *shakeBuffer; int iVar2; int *playerSlot; float *pfVar3; Vector *element; void *pvVar4; undefined4 *puVar5; int iVar6; int bufferHead; qword *allocCounter; uint uVar7; Game *game; PlayerManager *playerManager; float fVar8; float fVar9; undefined1 auVar10 [12]; undefined4 *focusCopy; int focusCopyCapacity; float focusCopyCount; int focusCopyHead; Vector playersCenter; undefined1 local_54 [12]; Entity *local_48; Vector local_44; float enemyOffsetX; float local_38; Camera *local_34; float spreadOffsetX; undefined4 *local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int enemyBufferData; byte *shakeBuffer; puStack_20 = local_54 + 0x50; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b4e6; local_1c = ExceptionList; ExceptionList = &local_1c; local_34 = this; shakeBuffer = PlayerManager::get_first_local_main_player(&g_game->_playerManager); if (shakeBuffer == (Entity_Player *)0x0) { KAGE_LogMessage(8,(byte *)"No main player detected when trying to update camera \n"); ExceptionList = local_1c; return; } players_center_position(&g_game->_playerManager,&playersCenter,1); if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 == 1) { local_2c = (undefined4 *)0x420c0000; } else { local_2c = (undefined4 *)0x0; } local_24 = (float)local_2c * (shakeBuffer->_aimDirection).x; local_28 = (float)local_2c * (shakeBuffer->_aimDirection).y; local_48 = Entity_Player::GetFocusEntity(shakeBuffer); if (local_48 != (Entity *)0x0) { local_44.y = ((local_48->_pos).y - (shakeBuffer->_pos).y) * 0.2; local_38 = ((local_48->_pos).x - (shakeBuffer->_pos).x) * 0.2; fVar8 = sqrtf(local_44.y * local_44.y + local_38 * local_38); if (((float)local_2c < fVar8) && (fVar8 = sqrtf(local_24 * local_24 + local_28 * local_28), 0.0 < fVar8)) { local_28 = ((float)local_2c / fVar8) * local_28; local_24 = ((float)local_2c / fVar8) * local_24; } if ((shakeBuffer->field_0x13f4 == '\0') || (isLudovico = Entity_Player::HasCollectible(shakeBuffer,0x149,0), isLudovico != 0)) { local_24 = local_38; local_28 = local_44.y; } else { iVar2 = __RTDynamicCast(local_48,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0); if ((iVar2 != 0) && (*(char *)(iVar2 + 0x464) != '\0')) { local_24 = local_38 + (float)local_2c * (shakeBuffer->_lastDirection).x; local_28 = local_44.y + (float)local_2c * (shakeBuffer->_lastDirection).y; } } } if ((shakeBuffer->_itemState == 0x31) || ((((shakeBuffer->field_0x13f2 != '\0' && (isLudovico = Entity_Player::HasCollectible(shakeBuffer,0x149,0), isLudovico == 0)) && (shakeBuffer->_isPlayingExtraAnimation == 0)) && (shakeBuffer->_isPlayingItemAnimation == 0)))) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_54,7,-1,-1,0,0); local_14 = 0; if (local_48 != (Entity *)0x0) { uVar7 = 0; do { iVar2 = __RTDynamicCast(*(undefined4 *)(local_54._4_4_ + uVar7 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); if ((((iVar2 != 0) && ((*(int *)(iVar2 + 0x2c) == 1 || (*(int *)(iVar2 + 0x2c) == 3)))) && (*(int *)(iVar2 + 0x34) == 1)) && (*(int *)(iVar2 + 0x38) == 0)) { local_24 = (float)local_2c * (shakeBuffer->_lastDirection).x; local_28 = (float)local_2c * (shakeBuffer->_lastDirection).y; } uVar7 = uVar7 + 1; } while (uVar7 < local_48); this = local_34; } local_14 = 0xffffffff; if (local_54[0] == '\0') { local_14 = 1; tracked_alloc(1,(void *)local_54._4_4_,0); local_14 = 0xffffffff; } } local_2c = *(undefined4 **)(this->_aimOffsetBuffer + 4); iVar2 = *(int *)(this->_aimOffsetBuffer + 8); if ((undefined4 *)iVar2 == local_2c) { if (iVar2 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_2c = *(undefined4 **)(this->_aimOffsetBuffer + 4); iVar2 = *(int *)(this->_aimOffsetBuffer + 8); } iVar6 = (*(int *)(this->_aimOffsetBuffer + 0xc) + 1) % (int)local_2c; iVar2 = iVar2 + -1; *(int *)(this->_aimOffsetBuffer + 0xc) = iVar6; *(int *)(this->_aimOffsetBuffer + 8) = iVar2; } else { iVar6 = *(int *)(this->_aimOffsetBuffer + 0xc); } iVar6 = (iVar6 + iVar2) % (int)local_2c; iVar2 = *(int *)this->_aimOffsetBuffer; *(float *)(iVar2 + iVar6 * 8) = local_24; *(float *)(iVar2 + 4 + iVar6 * 8) = local_28; game = g_game; *(int *)(this->_aimOffsetBuffer + 8) = *(int *)(this->_aimOffsetBuffer + 8) + 1; if ((int)(game->_playerManager)._playerList._end - (int)(game->_playerManager)._playerList._begin >> 2 == 1) { fVar8 = 4.5; } else { fVar8 = 0.0; } iVar2 = *(int *)(this->_velocityOffsetBuffer + 8); iVar6 = *(int *)(this->_velocityOffsetBuffer + 4); local_48 = (Entity *)((shakeBuffer->_velocity).x * fVar8); local_44.y = (shakeBuffer->_velocity).y * fVar8; if (iVar2 == iVar6) { if (iVar2 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar6 = *(int *)(this->_velocityOffsetBuffer + 4); iVar2 = *(int *)(this->_velocityOffsetBuffer + 8); } bufferHead = (*(int *)(this->_velocityOffsetBuffer + 0xc) + 1) % iVar6; iVar2 = iVar2 + -1; *(int *)(this->_velocityOffsetBuffer + 0xc) = bufferHead; *(int *)(this->_velocityOffsetBuffer + 8) = iVar2; } else { bufferHead = *(int *)(this->_velocityOffsetBuffer + 0xc); } iVar6 = (bufferHead + iVar2) % iVar6; iVar2 = *(int *)this->_velocityOffsetBuffer; *(Entity **)(iVar2 + iVar6 * 8) = local_48; *(float *)(iVar2 + 4 + iVar6 * 8) = local_44.y; *(int *)(this->_velocityOffsetBuffer + 8) = *(int *)(this->_velocityOffsetBuffer + 8) + 1; local_44.y = (float)get_enemy_focus_offset(this,&enemyOffsetX); iVar2 = *(int *)(this->_enemyOffsetBuffer + 8); iVar6 = *(int *)(this->_enemyOffsetBuffer + 4); if (iVar2 == iVar6) { if (iVar2 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar6 = *(int *)(this->_enemyOffsetBuffer + 4); iVar2 = *(int *)(this->_enemyOffsetBuffer + 8); } bufferHead = (*(int *)(this->_enemyOffsetBuffer + 0xc) + 1) % iVar6; iVar2 = iVar2 + -1; *(int *)(this->_enemyOffsetBuffer + 0xc) = bufferHead; *(int *)(this->_enemyOffsetBuffer + 8) = iVar2; } else { bufferHead = *(int *)(this->_enemyOffsetBuffer + 0xc); } enemyBufferData = *(int *)this->_enemyOffsetBuffer; iVar6 = (bufferHead + iVar2) % iVar6; *(undefined4 *)(enemyBufferData + iVar6 * 8) = *(undefined4 *)local_44.y; *(undefined4 *)(enemyBufferData + 4 + iVar6 * 8) = *(undefined4 *)((int)local_44.y + 4); *(int *)(this->_enemyOffsetBuffer + 8) = *(int *)(this->_enemyOffsetBuffer + 8) + 1; local_2c = (undefined4 *)g_vectorZero.x; local_28 = g_vectorZero.y; players_center_position(&g_game->_playerManager,(Vector *)(local_54 + 8),1); playerManager = &g_game->_playerManager; local_24 = 0.0; local_44.y = 0.0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { game = g_game; do { pvVar4 = (playerManager->_playerList)._end; if ((int)pvVar4 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if ((uint)local_44.y < (uint)((int)pvVar4 - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_44.y; } iVar2 = *playerSlot; if (*(int *)(iVar2 + 0x2c) == 1) { local_24 = (float)((int)local_24 + 1); local_28 = (*(float *)(iVar2 + 0x340) - (float)local_48) * 0.25 + local_28; local_2c = (undefined4 *) ((float)local_2c + (*(float *)(iVar2 + 0x33c) - (float)local_54._8_4_) * 0.25); } playerManager = &game->_playerManager; local_44.y = (float)((int)local_44.y + 1); } while ((uint)local_44.y < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); this = local_34; if (0 < (int)local_24) { local_28 = (1.0 / (float)(int)local_24) * local_28; local_2c = (undefined4 *)((1.0 / (float)(int)local_24) * (float)local_2c); } } local_24 = *(float *)(this->_playerSpreadBuffer + 4); iVar2 = *(int *)(this->_playerSpreadBuffer + 8); if ((float)iVar2 == local_24) { if (iVar2 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_24 = *(float *)(this->_playerSpreadBuffer + 4); iVar2 = *(int *)(this->_playerSpreadBuffer + 8); } iVar6 = (*(int *)(this->_playerSpreadBuffer + 0xc) + 1) % (int)local_24; iVar2 = iVar2 + -1; *(int *)(this->_playerSpreadBuffer + 0xc) = iVar6; *(int *)(this->_playerSpreadBuffer + 8) = iVar2; } else { iVar6 = *(int *)(this->_playerSpreadBuffer + 0xc); } iVar6 = (iVar6 + iVar2) % (int)local_24; iVar2 = *(int *)this->_playerSpreadBuffer; *(float *)(iVar2 + 4 + iVar6 * 8) = local_28; *(undefined4 **)(iVar2 + iVar6 * 8) = local_2c; *(int *)(this->_playerSpreadBuffer + 8) = *(int *)(this->_playerSpreadBuffer + 8) + 1; if (isSkipFocusBuffer == 0) { if (this->_shouldOverride == 0) { local_48 = (Entity *)-g_vectorOne.x; local_2c = *(undefined4 **)(this->_focusPositionBuffer + 4); local_44.y = -g_vectorOne.y; fVar8 = *(float *)(this->_focusPositionBuffer + 8); if ((undefined4 *)fVar8 == local_2c) { if ((int)fVar8 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_2c = *(undefined4 **)(this->_focusPositionBuffer + 4); fVar8 = *(float *)(this->_focusPositionBuffer + 8); } iVar2 = (*(int *)(this->_focusPositionBuffer + 0xc) + 1) % (int)local_2c; fVar8 = (float)((int)fVar8 + -1); *(int *)(this->_focusPositionBuffer + 0xc) = iVar2; *(float *)(this->_focusPositionBuffer + 8) = fVar8; } else { iVar2 = *(int *)(this->_focusPositionBuffer + 0xc); } iVar6 = (iVar2 + (int)fVar8) % (int)local_2c; iVar2 = *(int *)this->_focusPositionBuffer; *(Entity **)(iVar2 + iVar6 * 8) = local_48; *(float *)(iVar2 + 4 + iVar6 * 8) = local_44.y; *(int *)(this->_focusPositionBuffer + 8) = *(int *)(this->_focusPositionBuffer + 8) + 1; this->_shouldOverride = 1; } } else if (this->_shouldOverride == 0) { ring_buffer_push(this->_focusPositionBuffer, (Vector *) (*(int *)this->_focusPositionBuffer + ((*(int *)(this->_focusPositionBuffer + 8) + *(int *)(this->_focusPositionBuffer + 0xc) + -1) % *(int *)(this->_focusPositionBuffer + 4)) * 8)); } vector_ring_buffer_weighted_average(local_54 + 8,this); vector_ring_buffer_weighted_average(&local_44,this->_velocityOffsetBuffer); vector_ring_buffer_weighted_average(&enemyOffsetX,this->_enemyOffsetBuffer); vector_ring_buffer_weighted_average(&spreadOffsetX,this->_playerSpreadBuffer); fVar9 = playersCenter.y + (float)local_48; fVar8 = *(float *)(this->_focusPositionBuffer + 4); local_48 = (Entity *) (spreadOffsetX + enemyOffsetX + local_44.x + playersCenter.x + (float)local_54._8_4_); local_38 = (float)local_2c + local_38 + local_44.y + fVar9; local_44.y = fVar8; local_2c = operator_new_tracked (-(uint)((int)((ulonglong)(uint)fVar8 * 8 >> 0x20) != 0) | (uint)((ulonglong)(uint)fVar8 * 8)); puVar5 = local_2c; if (local_2c == (undefined4 *)0x0) { local_2c = (undefined4 *)0x0; } else { for (; fVar8 != 0.0; fVar8 = (float)((int)fVar8 - 1)) { puVar5[1] = 0; *puVar5 = 0; puVar5 = puVar5 + 2; } } focusCopyCapacity = *(int *)(this->_focusPositionBuffer + 4); focusCopyCount = *(float *)(this->_focusPositionBuffer + 8); focusCopyHead = *(int *)(this->_focusPositionBuffer + 0xc); focusCopy = local_2c; local_44.y = focusCopyCount; local_28 = (float)focusCopyHead; local_24 = (float)focusCopyCapacity; memcpy(local_2c,*(void **)this->_focusPositionBuffer,focusCopyCapacity * 8); iVar2 = 0; local_14 = 3; if (0 < (int)local_44.y) { do { pfVar3 = (float *)(local_2c + (((int)local_28 + iVar2) % (int)local_24) * 2); if ((*pfVar3 == -g_vectorOne.x) && (pfVar3[1] == -g_vectorOne.y)) { *pfVar3 = (float)local_48; pfVar3[1] = local_38; } iVar2 = iVar2 + 1; } while (iVar2 < (int)local_44.y); this = local_34; } vector_ring_buffer_weighted_average(local_54 + 8,&focusCopy); if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_2c != (undefined4 *)0x0) { uVar7 = local_2c[-1]; qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar7; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar7); free(local_2c + -1); } local_14 = 0xffffffff; fVar8 = g_screenHeight - 182.0; fVar9 = g_screenHeight * (this->_screenAnchor).y; (this->_position).x = g_screenWidth * (this->_screenAnchor).x - ((g_screenWidth - 338.0) * 0.5 + ((float)local_54._8_4_ - 60.0) * 0.65); (this->_position).y = fVar9 - (fVar8 * 0.5 + ((float)local_48 - 140.0) * 0.65); pfVar3 = (float *)soft_clamp_position(local_54 + 8,(this->_position).x,(this->_position).y); shakeBuffer = this->_shakeOffsetBuffer; (this->_position).x = *pfVar3; (this->_position).y = pfVar3[1]; if (g_game->_screenShakeTimer < 1) { local_2c = *(undefined4 **)(this->_shakeOffsetBuffer + 4); puVar5 = *(undefined4 **)(this->_shakeOffsetBuffer + 8); if (puVar5 == local_2c) { if ((int)puVar5 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); local_2c = *(undefined4 **)(this->_shakeOffsetBuffer + 4); puVar5 = *(undefined4 **)(this->_shakeOffsetBuffer + 8); } iVar2 = (*(int *)(this->_shakeOffsetBuffer + 0xc) + 1) % (int)local_2c; puVar5 = (undefined4 *)((int)puVar5 + -1); *(int *)(this->_shakeOffsetBuffer + 0xc) = iVar2; *(undefined4 **)(this->_shakeOffsetBuffer + 8) = puVar5; } else { iVar2 = *(int *)(this->_shakeOffsetBuffer + 0xc); } iVar6 = (iVar2 + (int)puVar5) % (int)local_2c; iVar2 = *(int *)shakeBuffer; *(float *)(iVar2 + iVar6 * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + iVar6 * 8) = g_vectorZero.y; *(int *)(this->_shakeOffsetBuffer + 8) = *(int *)(this->_shakeOffsetBuffer + 8) + 1; } else { if (g_game->_frameCount % 3 == 0) { uVar7 = Random(); fVar8 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_48 = (Entity *)(fVar8 + fVar8); local_44.x = cos((float)local_48); local_44.x = local_44.x * 10.0; fVar8 = sin((float)local_48); local_44.y = fVar8 * 10.0; element = &local_44; } else { iVar2 = (*(int *)(this->_shakeOffsetBuffer + 8) + *(int *)(this->_shakeOffsetBuffer + 0xc) + -1) % *(int *)(this->_shakeOffsetBuffer + 4); local_38 = *(float *)(*(int *)shakeBuffer + iVar2 * 8); local_34 = *(Camera **)(*(int *)shakeBuffer + iVar2 * 8 + 4); uVar7 = Random(); fVar8 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_48 = (Entity *)(fVar8 + fVar8); local_44.y = cos((float)local_48); fVar8 = sin((float)local_48); element = (Vector *)(local_54 + 8); local_48 = (Entity *)((fVar8 + fVar8) - (float)local_34); local_54._8_4_ = (local_44.y + local_44.y) - local_38; } ring_buffer_push(shakeBuffer,element); pfVar3 = (float *)(*(int *)shakeBuffer + ((*(int *)(this->_shakeOffsetBuffer + 8) + -1 + *(int *)(this->_shakeOffsetBuffer + 0xc)) % *(int *)(this->_shakeOffsetBuffer + 4)) * 8); fVar8 = ((float)g_game->_screenShakeTimer - 0.0) / 11.0; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } pfVar3[1] = fVar8 * pfVar3[1]; *pfVar3 = fVar8 * *pfVar3; } vector_ring_buffer_weighted_average(local_54 + 8,shakeBuffer); game = g_game; iVar2 = 0x744; (g_game->_screenShakeOffset).x = (float)local_54._8_4_; (game->_screenShakeOffset).y = (float)local_48; uVar7 = 0; do { local_48 = (Entity *)(uVar7 + 1); if (local_48 < 9) { pvVar4 = this->_room; if (*(int *)(iVar2 + -0x20 + (int)pvVar4) != 0) { if (uVar7 < 8) { local_44.y = (float)(*(int *)(iVar2 + (int)pvVar4) / *(int *)((int)pvVar4 + 0xc)) * 40.0 + 120.0; local_44.x = (float)(*(int *)(iVar2 + (int)pvVar4) % *(int *)((int)pvVar4 + 0xc)) * 40.0 + 40.0; } else { local_44.y = g_vectorZero.y; local_44.x = g_vectorZero.x; } fVar8 = sqrtf((local_44.y - playersCenter.y) * (local_44.y - playersCenter.y) + (local_44.x - playersCenter.x) * (local_44.x - playersCenter.x)); if (fVar8 < 30.0) { auVar10 = ZEXT812(0x3f800000); fVar8 = (fVar8 - 30.0) / -20.0; if (fVar8 <= auVar10._0_4_) { auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar8; } local_48 = auVar10._0_4_; position.y = local_44.y; position.x = local_44.x; ClampedToRoom(this,&local_44,position); fVar8 = (3.0 - ((float)local_48 + (float)local_48)) * (float)local_48 * (float)local_48; (this->_position).x = (local_44.x - (this->_position).x) * fVar8 + (this->_position).x; (this->_position).y = (local_44.y - (this->_position).y) * fVar8 + (this->_position).y; goto LAB_00944696; } } } uVar7 = (uint)local_48; iVar2 = iVar2 + 4; if (7 < (int)uVar7) { LAB_00944696: pvVar4 = this->_room; *(float *)((int)pvVar4 + 0x1204) = (this->_position).x; *(float *)((int)pvVar4 + 0x1208) = (this->_position).y; (this->_playersCenter).x = playersCenter.x; (this->_playersCenter).y = playersCenter.y; ExceptionList = local_1c; return; } } while( true ); } //@@ 009446e0 Camera::update_follow /* DB: Camera::DoUpdate non-override branch: computes target, ring_buffer_push ('Cannot erase from empty buffer'), Camera::ClampedToRoom prototype: db/protos.zhl */ void __thiscall Camera::update_follow(Camera *this) { Vector position; uint rngResult; Vector *pVVar1; int iVar2; int iVar3; int iVar4; bool bVar5; bool bVar6; float fVar7; float fVar8; Vector local_24; Vector local_1c; Vector local_14; float shakeCos; float shakeAngle; Game *game; float *newestShake; void *room; byte *shakeBuffer; players_center_position(&g_game->_playerManager,&local_24,1); if ((this->_shouldOverride != 0) && (0 < *(int *)(this->_focusPositionBuffer + 8))) { iVar2 = (*(int *)(this->_focusPositionBuffer + 8) + -1 + *(int *)(this->_focusPositionBuffer + 0xc)) % *(int *)(this->_focusPositionBuffer + 4); local_24.x = *(float *)(*(int *)this->_focusPositionBuffer + iVar2 * 8); local_24.y = *(float *)(*(int *)this->_focusPositionBuffer + iVar2 * 8 + 4); } shakeBuffer = this->_shakeOffsetBuffer; if (g_game->_screenShakeTimer < 1) { iVar2 = *(int *)(this->_shakeOffsetBuffer + 8); iVar4 = *(int *)(this->_shakeOffsetBuffer + 4); if (iVar2 == iVar4) { if (iVar2 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar4 = *(int *)(this->_shakeOffsetBuffer + 4); iVar2 = *(int *)(this->_shakeOffsetBuffer + 8); } iVar3 = (*(int *)(this->_shakeOffsetBuffer + 0xc) + 1) % iVar4; iVar2 = iVar2 + -1; *(int *)(this->_shakeOffsetBuffer + 0xc) = iVar3; *(int *)(this->_shakeOffsetBuffer + 8) = iVar2; } else { iVar3 = *(int *)(this->_shakeOffsetBuffer + 0xc); } iVar4 = (iVar2 + iVar3) % iVar4; iVar2 = *(int *)shakeBuffer; *(float *)(iVar2 + iVar4 * 8) = g_vectorZero.x; *(float *)(iVar2 + 4 + iVar4 * 8) = g_vectorZero.y; *(int *)(this->_shakeOffsetBuffer + 8) = *(int *)(this->_shakeOffsetBuffer + 8) + 1; } else { if (g_game->_frameCount % 3 == 0) { rngResult = Random(); shakeAngle = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; shakeAngle = shakeAngle + shakeAngle; local_1c.x = cos(shakeAngle); local_1c.x = local_1c.x * 10.0; local_1c.y = sin(shakeAngle); local_1c.y = local_1c.y * 10.0; pVVar1 = &local_1c; } else { iVar2 = (*(int *)(this->_shakeOffsetBuffer + 8) + *(int *)(this->_shakeOffsetBuffer + 0xc) + -1) % *(int *)(this->_shakeOffsetBuffer + 4); local_14.y = *(float *)(*(int *)shakeBuffer + iVar2 * 8); local_1c.y = *(float *)(*(int *)shakeBuffer + iVar2 * 8 + 4); rngResult = Random(); shakeAngle = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; shakeAngle = shakeAngle + shakeAngle; shakeCos = cos(shakeAngle); fVar7 = sin(shakeAngle); pVVar1 = &local_14; local_14.x = (shakeCos + shakeCos) - local_14.y; local_14.y = (fVar7 + fVar7) - local_1c.y; } ring_buffer_push(shakeBuffer,pVVar1); newestShake = (float *)(*(int *)shakeBuffer + ((*(int *)(this->_shakeOffsetBuffer + 8) + -1 + *(int *)(this->_shakeOffsetBuffer + 0xc)) % *(int *)(this->_shakeOffsetBuffer + 4)) * 8); fVar7 = ((float)g_game->_screenShakeTimer - 0.0) / 11.0; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } newestShake[1] = fVar7 * newestShake[1]; *newestShake = fVar7 * *newestShake; } vector_ring_buffer_weighted_average(&local_1c,shakeBuffer); game = g_game; (g_game->_screenShakeOffset).x = local_1c.x; (game->_screenShakeOffset).y = local_1c.y; position.y = local_24.y; position.x = local_24.x; ClampedToRoom(this,&local_24,position); fVar7 = (this->_position).x; local_24.y = local_24.y - (this->_position).y; local_24.x = local_24.x - fVar7; fVar8 = local_24.y * local_24.y + local_24.x * local_24.x; if (fVar8 <= 676.0) { if (338.0 <= fVar8) goto LAB_009449f3; local_1c.y = this->_followLerp - 0.01; local_14.y = 0.1; bVar6 = local_1c.y == 0.1; bVar5 = local_1c.y < 0.1; } else { local_1c.y = this->_followLerp + 0.01; local_14.y = 0.5; bVar6 = local_1c.y == 0.5; bVar5 = 0.5 < local_1c.y; } pVVar1 = &local_1c; if (bVar5 || bVar6) { pVVar1 = &local_14; } this->_followLerp = pVVar1->y; LAB_009449f3: fVar8 = this->_followLerp; room = this->_room; fVar7 = fVar8 * local_24.x + fVar7; (this->_position).x = fVar7; (this->_position).y = fVar8 * local_24.y + (this->_position).y; *(float *)((int)room + 0x1204) = fVar7; *(float *)((int)room + 0x1208) = (this->_position).y; return; } //@@ 00944a40 Camera::IsPosVisible /* ZHL [exact] __thiscall bool Camera::IsPosVisible(Vector * Pos); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Camera::IsPosVisible(Camera *this,Vector *Pos) { float fVar1; int *piVar2; void *pvVar3; int iVar4; PlayerManager *pPVar5; uint uVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { fVar9 = -(this->_position).x * 1.5384616 - ((g_screenWidth - 338.0) * 0.5 + (g_vectorZero.x - 60.0) * 0.65) / 0.65; fVar7 = -(this->_position).y * 1.5384616 - ((g_screenHeight - 182.0) * 0.5 + (g_vectorZero.y - 140.0) * 0.65) / 0.65; if ((((fVar9 < Pos->x) && (Pos->x < g_screenWidth * 1.5384616 + fVar9)) && (fVar7 < Pos->y)) && (Pos->y < g_screenHeight * 1.5384616 + fVar7)) { return 1; } } else { uVar6 = 0; pPVar5 = &g_game->_playerManager; pvVar3 = g_game->_room; fVar7 = (*(float *)((int)pvVar3 + 0x14) - 80.0) + 369.23077; fVar9 = (*(float *)((int)pvVar3 + 0x18) - 80.0) + 207.6923; fVar12 = (*(float *)((int)pvVar3 + 0x1c) + 80.0) - 369.23077; fVar13 = (*(float *)((int)pvVar3 + 0x20) + 80.0) - 207.6923; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar5->_playerList)._begin >> 2 != 0 ) { do { pvVar3 = (pPVar5->_playerList)._end; if ((int)pvVar3 - (int)(pPVar5->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (pPVar5->_playerList)._end; } piVar2 = (pPVar5->_playerList)._begin; if (uVar6 < (uint)((int)pvVar3 - (int)piVar2 >> 2)) { piVar2 = piVar2 + uVar6; } fVar10 = *(float *)(*piVar2 + 0x33c); fVar11 = *(float *)(*piVar2 + 0x340); if ((this->_shouldOverride != 0) && (0 < *(int *)(this->_focusPositionBuffer + 8))) { iVar4 = (*(int *)(this->_focusPositionBuffer + 8) + -1 + *(int *)(this->_focusPositionBuffer + 0xc)) % *(int *)(this->_focusPositionBuffer + 4); fVar10 = *(float *)(*(int *)this->_focusPositionBuffer + iVar4 * 8); fVar11 = *(float *)(*(int *)this->_focusPositionBuffer + iVar4 * 8 + 4); } if (fVar10 <= fVar7) { fVar10 = fVar7; } if (fVar11 <= fVar9) { fVar11 = fVar9; } if (fVar12 <= fVar10) { fVar10 = fVar12; } fVar1 = Pos->y; if (fVar13 <= fVar11) { fVar11 = fVar13; } fVar8 = Pos->x; if (Pos->x <= fVar10 - 369.23077) { fVar8 = fVar10 - 369.23077; } if (fVar10 + 369.23077 <= fVar8) { fVar8 = fVar10 + 369.23077; } fVar10 = fVar1; if (fVar1 <= fVar11 - 207.6923) { fVar10 = fVar11 - 207.6923; } if (fVar11 + 207.6923 <= fVar10) { fVar10 = fVar11 + 207.6923; } if ((fVar8 == Pos->x) && (fVar10 == fVar1)) { return 1; } uVar6 = uVar6 + 1; pPVar5 = &g_game->_playerManager; } while (uVar6 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar5->_playerList)._begin >> 2)); } } return 0; } //@@ 00944d10 Camera::SetFocusPosition /* ZHL [exact] __thiscall void Camera::SetFocusPosition(Vector* pos); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Camera::SetFocusPosition(Camera *this,Vector *pos) { if (this->_shouldOverride == 0) { ring_buffer_push(this->_focusPositionBuffer,pos); this->_shouldOverride = 1; } return; } //@@ 00944d40 Camera::SnapToPosition /* ZHL [exact] __thiscall void Camera::SnapToPosition(const Vector& pos); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Camera::SnapToPosition(Camera *this,Vector *pos) { int ringStart; int iVar1; int ringStart; Vector local_20; float local_18; int entriesLeft; void *room; entriesLeft = 0x3c; ringStart = *(int *)(this->_aimOffsetBuffer + 8); do { iVar1 = *(int *)(this->_aimOffsetBuffer + 4); if (ringStart == iVar1) { if (ringStart < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar1 = *(int *)(this->_aimOffsetBuffer + 4); ringStart = *(int *)(this->_aimOffsetBuffer + 8); } ringStart = (*(int *)(this->_aimOffsetBuffer + 0xc) + 1) % iVar1; ringStart = ringStart + -1; *(int *)(this->_aimOffsetBuffer + 0xc) = ringStart; *(int *)(this->_aimOffsetBuffer + 8) = ringStart; } else { ringStart = *(int *)(this->_aimOffsetBuffer + 0xc); } iVar1 = (ringStart + ringStart) % iVar1; ringStart = *(int *)this->_aimOffsetBuffer; *(float *)(ringStart + iVar1 * 8) = g_vectorZero.x; *(float *)(ringStart + 4 + iVar1 * 8) = g_vectorZero.y; *(int *)(this->_aimOffsetBuffer + 8) = *(int *)(this->_aimOffsetBuffer + 8) + 1; entriesLeft = entriesLeft + -1; ringStart = *(int *)(this->_aimOffsetBuffer + 8); } while (entriesLeft != 0); ringStart = *(int *)(this->_velocityOffsetBuffer + 8); entriesLeft = 0x5a; do { iVar1 = *(int *)(this->_velocityOffsetBuffer + 4); if (ringStart == iVar1) { if (ringStart < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar1 = *(int *)(this->_velocityOffsetBuffer + 4); ringStart = *(int *)(this->_velocityOffsetBuffer + 8); } ringStart = (*(int *)(this->_velocityOffsetBuffer + 0xc) + 1) % iVar1; ringStart = ringStart + -1; *(int *)(this->_velocityOffsetBuffer + 0xc) = ringStart; *(int *)(this->_velocityOffsetBuffer + 8) = ringStart; } else { ringStart = *(int *)(this->_velocityOffsetBuffer + 0xc); } iVar1 = (ringStart + ringStart) % iVar1; ringStart = *(int *)this->_velocityOffsetBuffer; *(float *)(ringStart + iVar1 * 8) = g_vectorZero.x; *(float *)(ringStart + 4 + iVar1 * 8) = g_vectorZero.y; *(int *)(this->_velocityOffsetBuffer + 8) = *(int *)(this->_velocityOffsetBuffer + 8) + 1; entriesLeft = entriesLeft + -1; ringStart = *(int *)(this->_velocityOffsetBuffer + 8); } while (entriesLeft != 0); ringStart = *(int *)(this->_enemyOffsetBuffer + 8); entriesLeft = 300; do { iVar1 = *(int *)(this->_enemyOffsetBuffer + 4); if (ringStart == iVar1) { if (ringStart < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar1 = *(int *)(this->_enemyOffsetBuffer + 4); ringStart = *(int *)(this->_enemyOffsetBuffer + 8); } ringStart = (*(int *)(this->_enemyOffsetBuffer + 0xc) + 1) % iVar1; ringStart = ringStart + -1; *(int *)(this->_enemyOffsetBuffer + 0xc) = ringStart; *(int *)(this->_enemyOffsetBuffer + 8) = ringStart; } else { ringStart = *(int *)(this->_enemyOffsetBuffer + 0xc); } iVar1 = (ringStart + ringStart) % iVar1; ringStart = *(int *)this->_enemyOffsetBuffer; *(float *)(ringStart + iVar1 * 8) = g_vectorZero.x; *(float *)(ringStart + 4 + iVar1 * 8) = g_vectorZero.y; *(int *)(this->_enemyOffsetBuffer + 8) = *(int *)(this->_enemyOffsetBuffer + 8) + 1; entriesLeft = entriesLeft + -1; ringStart = *(int *)(this->_enemyOffsetBuffer + 8); } while (entriesLeft != 0); ringStart = *(int *)(this->_playerSpreadBuffer + 8); entriesLeft = 0xf; do { iVar1 = *(int *)(this->_playerSpreadBuffer + 4); if (ringStart == iVar1) { if (ringStart < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar1 = *(int *)(this->_playerSpreadBuffer + 4); ringStart = *(int *)(this->_playerSpreadBuffer + 8); } ringStart = (*(int *)(this->_playerSpreadBuffer + 0xc) + 1) % iVar1; ringStart = ringStart + -1; *(int *)(this->_playerSpreadBuffer + 0xc) = ringStart; *(int *)(this->_playerSpreadBuffer + 8) = ringStart; } else { ringStart = *(int *)(this->_playerSpreadBuffer + 0xc); } iVar1 = (ringStart + ringStart) % iVar1; ringStart = *(int *)this->_playerSpreadBuffer; *(float *)(ringStart + iVar1 * 8) = g_vectorZero.x; *(float *)(ringStart + 4 + iVar1 * 8) = g_vectorZero.y; *(int *)(this->_playerSpreadBuffer + 8) = *(int *)(this->_playerSpreadBuffer + 8) + 1; entriesLeft = entriesLeft + -1; ringStart = *(int *)(this->_playerSpreadBuffer + 8); } while (entriesLeft != 0); ringStart = *(int *)(this->_shakeOffsetBuffer + 8); entriesLeft = 4; do { iVar1 = *(int *)(this->_shakeOffsetBuffer + 4); if (ringStart == iVar1) { if (ringStart < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar1 = *(int *)(this->_shakeOffsetBuffer + 4); ringStart = *(int *)(this->_shakeOffsetBuffer + 8); } ringStart = (*(int *)(this->_shakeOffsetBuffer + 0xc) + 1) % iVar1; ringStart = ringStart + -1; *(int *)(this->_shakeOffsetBuffer + 0xc) = ringStart; *(int *)(this->_shakeOffsetBuffer + 8) = ringStart; } else { ringStart = *(int *)(this->_shakeOffsetBuffer + 0xc); } iVar1 = (ringStart + ringStart) % iVar1; ringStart = *(int *)this->_shakeOffsetBuffer; *(float *)(ringStart + iVar1 * 8) = g_vectorZero.x; *(float *)(ringStart + 4 + iVar1 * 8) = g_vectorZero.y; *(int *)(this->_shakeOffsetBuffer + 8) = *(int *)(this->_shakeOffsetBuffer + 8) + 1; entriesLeft = entriesLeft + -1; ringStart = *(int *)(this->_shakeOffsetBuffer + 8); } while (entriesLeft != 0); ringStart = *(int *)(this->_focusPositionBuffer + 8); entriesLeft = 0x78; do { local_18 = -g_vectorOne.x; iVar1 = *(int *)(this->_focusPositionBuffer + 4); local_20.y = -g_vectorOne.y; if (ringStart == iVar1) { if (ringStart < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar1 = *(int *)(this->_focusPositionBuffer + 4); ringStart = *(int *)(this->_focusPositionBuffer + 8); } ringStart = (*(int *)(this->_focusPositionBuffer + 0xc) + 1) % iVar1; ringStart = ringStart + -1; *(int *)(this->_focusPositionBuffer + 0xc) = ringStart; *(int *)(this->_focusPositionBuffer + 8) = ringStart; } else { ringStart = *(int *)(this->_focusPositionBuffer + 0xc); } iVar1 = (ringStart + ringStart) % iVar1; ringStart = *(int *)this->_focusPositionBuffer; *(float *)(ringStart + iVar1 * 8) = local_18; *(float *)(ringStart + 4 + iVar1 * 8) = local_20.y; *(int *)(this->_focusPositionBuffer + 8) = *(int *)(this->_focusPositionBuffer + 8) + 1; entriesLeft = entriesLeft + -1; ringStart = *(int *)(this->_focusPositionBuffer + 8); } while (entriesLeft != 0); this->_shouldOverride = 0; ClampedToRoom(this,&local_20,*pos); room = this->_room; (this->_position).x = local_20.x; (this->_position).y = local_20.y; *(float *)((int)room + 0x1204) = (this->_position).x; *(float *)((int)room + 0x1208) = (this->_position).y; return; } //@@ 00945080 CircularBuffer::constructor /* DB: ? ECX={buf,capacity,head,count}: allocates param*8 bytes zeroed; Camera::constructor builds six of them (capacity 60, 90, 300, 15, 4, 120) at +0..+0x50 */ void CircularBuffer::constructor(uint param_1) { undefined4 *puVar1; uint uVar2; undefined4 *_Dst; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b0b536; local_10 = ExceptionList; ExceptionList = &local_10; _Dst = operator_new_tracked (-(uint)((int)((ulonglong)param_1 * 8 >> 0x20) != 0) | (uint)((ulonglong)param_1 * 8)); puVar1 = _Dst; uVar2 = param_1; if (_Dst == (undefined4 *)0x0) { _Dst = (undefined4 *)0x0; } else { for (; uVar2 != 0; uVar2 = uVar2 - 1) { puVar1[1] = 0; *puVar1 = 0; puVar1 = puVar1 + 2; } } *in_ECX = _Dst; in_ECX[1] = param_1; in_ECX[2] = 0; in_ECX[3] = 0; memset(_Dst,0,param_1 * 8); ExceptionList = local_10; return; } //@@ 00945130 ring_buffer_push /* DB: circular buffer of 8-byte elems, overwrites oldest prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall ring_buffer_push(void *this,Vector *element) { float *pfVar1; int iVar2; int iVar3; int iVar4; iVar4 = *(int *)((int)this + 8); iVar2 = *(int *)((int)this + 4); if (iVar4 == iVar2) { if (iVar4 < 1) { KAGE_LogMessage(0x10,(byte *)"Cannot erase from empty buffer"); iVar2 = *(int *)((int)this + 4); iVar4 = *(int *)((int)this + 8); } iVar3 = (*(int *)((int)this + 0xc) + 1) % iVar2; iVar4 = iVar4 + -1; *(int *)((int)this + 0xc) = iVar3; *(int *)((int)this + 8) = iVar4; } else { iVar3 = *(int *)((int)this + 0xc); } pfVar1 = (float *)(*(int *)this + ((iVar4 + iVar3) % iVar2) * 8); *pfVar1 = element->x; pfVar1[1] = element->y; *(int *)((int)this + 8) = *(int *)((int)this + 8) + 1; return; } //@@ 00945190 Capsule::constructor /* ZHL [exact] __thiscall void Capsule::constructor(Vector* Position, Vector* Multiplier, float Rotation, float size); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Capsule::constructor(Capsule *this,Vector *position,Vector *multiplier,float rotation,float size) { Capsule CVar1; Capsule CVar2; Capsule CVar3; Capsule CVar4; this[1] = (Capsule)0x0; *this = (Capsule)0x0; this[3] = (Capsule)0x0; this[2] = (Capsule)0x0; this[5] = (Capsule)0x0; this[4] = (Capsule)0x0; this[7] = (Capsule)0x0; this[6] = (Capsule)0x0; *this = (Capsule)position->x; this[1] = (Capsule)position->y; CVar3 = (Capsule)(size * multiplier->x); CVar4 = (Capsule)(size * multiplier->y); CVar1 = (Capsule)sin(rotation * 0.017453292); CVar2 = (Capsule)cos(rotation * 0.017453292); if ((float)CVar3 <= (float)CVar4) { this[8] = CVar3; this[9] = (Capsule)((float)CVar4 - (float)CVar3); this[6] = CVar1; this[7] = CVar2; CVar3 = CVar2; } else { this[8] = CVar4; this[9] = (Capsule)((float)CVar3 - (float)CVar4); this[6] = CVar2; this[7] = CVar1; CVar3 = CVar1; CVar1 = CVar2; } this[2] = (Capsule)((float)*this - (float)this[9] * (float)CVar1); this[3] = (Capsule)((float)this[1] - (float)this[9] * (float)CVar3); this[5] = (Capsule)((float)this[9] * (float)this[7] + (float)this[1]); this[4] = (Capsule)((float)this[9] * (float)this[6] + (float)*this); return; } //@@ 009452e0 Capsule::constructor2 /* ZHL [exact] __thiscall void Capsule::constructor2(Vector* Position, Vector* TargetPosition, float size); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Capsule::constructor2(Capsule *this,Vector *Position,Vector *TargetPosition,float size) { float fVar1; Capsule CVar2; float fVar3; Capsule CVar4; float fVar5; this[3] = (Capsule)0x0; this[2] = (Capsule)0x0; this[5] = (Capsule)0x0; this[4] = (Capsule)0x0; this[1] = (Capsule)0x0; *this = (Capsule)0x0; this[7] = (Capsule)0x0; this[6] = (Capsule)0x0; this[2] = (Capsule)Position->x; this[3] = (Capsule)Position->y; this[4] = (Capsule)TargetPosition->x; this[5] = (Capsule)TargetPosition->y; fVar3 = TargetPosition->y - Position->y; fVar5 = TargetPosition->x - Position->x; fVar1 = sqrtf(fVar3 * fVar3 + fVar5 * fVar5); if (fVar1 <= 0.0) { CVar2 = (Capsule)g_vectorZero.x; CVar4 = (Capsule)g_vectorZero.y; } else { CVar2 = (Capsule)(fVar5 / fVar1); CVar4 = (Capsule)(fVar3 / fVar1); } this[6] = CVar2; this[7] = CVar4; this[8] = (Capsule)size; this[9] = (Capsule)(fVar1 * 0.5); *this = (Capsule)(((float)this[4] + (float)this[2]) * 0.5); this[1] = (Capsule)(((float)this[3] + (float)this[5]) * 0.5); return; } //@@ 00945400 Capsule::get_bounding_box /* DB: (outMin, outMax): extent = |dir.xy| (+0x18/+0x1c) * halfLength (+0x24) + radius (+0x20) around the capsule center (+0/+4); sits between Capsule::constructor2 and Capsule::Collide; callers EntityList::query_player_capsule_hits and Entity_Familiar::ai_umbilical_baby */ void Capsule::get_bounding_box(float *param_1,float *param_2) { float fVar1; float *in_ECX; float fVar2; float fVar3; fVar3 = ABS(in_ECX[6]) * in_ECX[9] + in_ECX[8]; fVar2 = ABS(in_ECX[7]) * in_ECX[9] + in_ECX[8]; fVar1 = in_ECX[1]; *param_1 = *in_ECX - fVar3; param_1[1] = fVar1 - fVar2; fVar1 = in_ECX[1]; *param_2 = fVar3 + *in_ECX; param_2[1] = fVar2 + fVar1; return; } //@@ 00945470 Capsule::Collide /* DB: static ecx/edx capsules, retHit param; sqrt, next to Capsule::constructor prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte __cdecl Capsule::Collide(Capsule *a,Capsule *b,Vector *outHit) { Capsule *pCVar1; float *pfVar2; float fVar3; float fVar4; float fVar5; double dVar6; Capsule CVar7; float fVar8; float fVar9; Capsule local_64; float local_60; Capsule local_5c; Capsule local_58; Capsule local_54; Capsule local_50; Capsule local_4c; Capsule local_44; Capsule local_3c; float local_38; Capsule local_34; Capsule local_30; float local_2c; float local_28; Capsule local_24; float local_20; Capsule *local_1c; float local_18; float local_14; float local_10; float local_c; local_64 = (Capsule)g_vectorZero.y; local_60 = g_vectorZero.x; local_58 = a[4]; local_34 = a[2]; local_5c = a[3]; fVar3 = (float)local_58 - (float)local_34; local_44 = b[4]; local_3c = b[2]; local_50 = a[5]; fVar4 = (float)local_50 - (float)local_5c; local_4c = b[5]; local_54 = b[3]; fVar8 = ((float)local_44 - (float)local_3c) * fVar4 - ((float)b[5] - (float)local_54) * fVar3; local_1c = a; if (fVar8 != 0.0) { fVar5 = (((float)local_34 - (float)local_3c) * fVar4 + ((float)b[3] - (float)local_5c) * fVar3) / fVar8; local_2c = (((float)local_5c - (float)b[3]) * ((float)local_44 - (float)local_3c) + ((float)local_3c - (float)local_34) * ((float)b[5] - (float)local_54)) / -fVar8; local_44 = b[4]; if ((((0.0 <= fVar5) && (fVar5 <= 1.0)) && (local_58 = a[4], 0.0 <= local_2c)) && (local_2c <= 1.0)) { fVar8 = fVar4 * fVar5 + (float)local_5c; fVar9 = fVar3 * fVar5 + (float)local_34; local_60 = fVar9 - (float)local_34; local_64 = (Capsule)(fVar8 - (float)local_5c); fVar5 = fVar9 - (float)local_58; fVar3 = (float)local_64 * (float)local_64 + local_60 * local_60; local_30 = a[8]; local_24 = (Capsule)(fVar8 - (float)a[5]); fVar4 = (float)local_24 * (float)local_24 + fVar5 * fVar5; if (fVar4 < fVar3) { fVar3 = fVar4; local_64 = local_24; local_60 = fVar5; } fVar5 = (float)local_3c - fVar9; CVar7 = (Capsule)((float)b[3] - fVar8); fVar4 = (float)CVar7 * (float)CVar7 + fVar5 * fVar5; if (fVar4 < fVar3) { local_30 = b[8]; fVar3 = fVar4; local_64 = CVar7; local_60 = fVar5; } fVar9 = (float)local_44 - fVar9; CVar7 = (Capsule)((float)b[5] - fVar8); fVar4 = (float)CVar7 * (float)CVar7 + fVar9 * fVar9; if (fVar4 < fVar3) { local_30 = b[8]; fVar3 = fVar4; local_64 = CVar7; local_60 = fVar9; } dVar6 = (double)fVar3; if (dVar6 < 0.0) { libm_sse2_sqrt_precise(); } else { dVar6 = SQRT(dVar6); } local_24 = (Capsule)((float)dVar6 + (float)local_30); fVar3 = sqrtf((float)local_64 * (float)local_64 + local_60 * local_60); if (0.0 < fVar3) { local_60 = local_60 * (1.0 / fVar3); local_64 = (Capsule)((float)local_64 * (1.0 / fVar3)); } local_60 = local_60 * (float)local_24; local_64 = (Capsule)((float)local_64 * (float)local_24); local_34 = a[2]; local_58 = a[4]; local_3c = b[2]; local_44 = b[4]; } } if ((local_60 != g_vectorZero.x) || ((float)local_64 != g_vectorZero.y)) { local_50 = (Capsule)((float)a[5] + (float)local_64); local_58 = (Capsule)((float)local_58 + local_60); local_3c = (Capsule)((float)local_3c + local_60); local_44 = (Capsule)((float)local_44 + local_60); local_5c = (Capsule)((float)local_5c + (float)local_64); local_34 = (Capsule)((float)local_34 + local_60); local_4c = (Capsule)((float)b[5] + (float)local_64); local_54 = (Capsule)((float)b[3] + (float)local_64); } local_30 = (Capsule)((float)local_44 - (float)local_3c); local_c = (float)local_5c - (float)local_54; fVar4 = (float)local_4c - (float)local_54; fVar3 = fVar4 * fVar4 + (float)local_30 * (float)local_30; local_10 = (float)local_34 - (float)local_3c; if ((0.0001 <= ABS(fVar3)) && (fVar8 = (fVar4 * local_c + (float)local_30 * local_10) / fVar3, 0.0 <= fVar8)) { if (fVar8 < 1.0) { local_10 = (float)local_34 - ((float)local_30 * fVar8 + (float)local_3c); local_c = (float)local_5c - (fVar4 * fVar8 + (float)local_54); } else { local_c = (float)local_5c - (float)local_4c; local_10 = (float)local_34 - (float)local_44; } } local_10 = -local_10; local_18 = (float)local_58 - (float)local_3c; local_14 = (float)local_50 - (float)local_54; local_c = -local_c; if ((0.0001 <= ABS(fVar3)) && (fVar3 = (fVar4 * local_14 + (float)local_30 * local_18) / fVar3, 0.0 <= fVar3)) { if (fVar3 < 1.0) { local_18 = (float)local_58 - ((float)local_30 * fVar3 + (float)local_3c); local_14 = (float)local_50 - (fVar4 * fVar3 + (float)local_54); } else { local_18 = (float)local_58 - (float)local_44; local_14 = (float)local_50 - (float)local_4c; } } local_18 = -local_18; fVar3 = (float)local_50 - (float)local_5c; local_14 = -local_14; fVar4 = (float)local_58 - (float)local_34; local_28 = fVar3 * fVar3 + fVar4 * fVar4; local_2c = ABS(local_28); CVar7 = (Capsule)((float)local_3c - (float)local_34); local_38 = (float)local_54 - (float)local_5c; if ((0.0001 <= local_2c) && (fVar8 = ((float)CVar7 * fVar4 + fVar3 * local_38) / local_28, 0.0 <= fVar8)) { if (fVar8 < 1.0) { CVar7 = (Capsule)((float)local_3c - (fVar4 * fVar8 + (float)local_34)); local_38 = (float)local_54 - (fVar3 * fVar8 + (float)local_5c); } else { CVar7 = (Capsule)((float)local_3c - (float)local_58); local_38 = (float)local_54 - (float)local_50; } } local_24 = (Capsule)((float)local_44 - (float)local_34); local_20 = (float)local_4c - (float)local_5c; local_3c = CVar7; if (0.0001 <= local_2c) { local_30 = (Capsule)(fVar4 * (float)local_24 + fVar3 * local_20); fVar8 = (float)local_30 / local_28; if (0.0 <= fVar8) { if (fVar8 < 1.0) { local_24 = (Capsule)((float)local_44 - (fVar4 * fVar8 + (float)local_34)); local_20 = (float)local_4c - (fVar3 * fVar8 + (float)local_5c); } else { local_24 = (Capsule)((float)local_44 - (float)local_58); local_20 = (float)local_4c - (float)local_50; } } } fVar3 = local_c * local_c + local_10 * local_10; fVar5 = local_14 * local_14 + local_18 * local_18; fVar8 = local_38 * local_38 + (float)CVar7 * (float)CVar7; fVar4 = local_20 * local_20 + (float)local_24 * (float)local_24; pfVar2 = &local_10; if (fVar5 <= fVar3) { pfVar2 = &local_18; fVar3 = fVar5; } pCVar1 = &local_24; if (fVar8 < fVar4) { pCVar1 = &local_3c; fVar4 = fVar8; } if (fVar4 <= fVar3) { if (outHit == (Vector *)0x0) goto LAB_00945cf6; outHit->x = (float)*pCVar1; CVar7 = pCVar1[1]; } else { fVar4 = fVar3; if (outHit == (Vector *)0x0) goto LAB_00945cf6; outHit->x = *pfVar2; CVar7 = *(Capsule *)(pfVar2 + 1); } outHit->y = (float)CVar7; LAB_00945cf6: local_1c = (Capsule *)((float)local_1c[8] + (float)b[8]); if ((float)local_1c * (float)local_1c <= fVar4) { return 0; } if (fVar4 == 0.0) { if (outHit != (Vector *)0x0) { outHit->x = local_60; outHit->y = (float)local_64; return 1; } } else { dVar6 = (double)fVar4; if (dVar6 < 0.0) { libm_sse2_sqrt_precise(); } else { dVar6 = SQRT(dVar6); } fVar3 = (float)dVar6; if (outHit != (Vector *)0x0) { outHit->x = (outHit->x / fVar3) * ((float)local_1c - fVar3) + local_60; outHit->y = (outHit->y / fVar3) * ((float)local_1c - fVar3) + (float)local_64; } } return 1; } //@@ 00945db0 Menu_Challenge::destructor /* DB: ECX=MenuManager+0x2688 in MenuManager destructor 00986f30: releases image +0x128, ANM2 +0x14 */ void Menu_Challenge::destructor(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 300) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 300) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x128); } } local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x14)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 100)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x14)); ExceptionList = local_10; return; } //@@ 00945e50 Menu_Challenge::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=MenuManager+0x2688 (_menuChallenge) from MenuManager::Update */ void Menu_Challenge::Update(void) { Seeds unk; KColor fadeColor; std_string seed; char isActionPressed; byte isUnlocked; uint challengeIdx; Seeds *seeds; undefined4 *in_ECX; Manager *this; uint uVar1; PersistentGameData *extraout_ECX; PersistentGameData *persistentData; PersistentGameData *extraout_ECX_00; int unused; uint uVar2; int extraout_EDX; int extraout_EDX_00; float scrollY; Seeds aSStackY_2f08 [128]; undefined1 in_stack_ffffff54 [48]; undefined4 in_stack_ffffff84; undefined4 in_stack_ffffff88; undefined4 in_stack_ffffff8c; undefined4 in_stack_ffffff90; undefined4 in_stack_ffffff94; undefined4 uVar3; undefined4 in_stack_ffffff98; undefined4 uVar4; undefined4 in_stack_ffffff9c; int iVar5; undefined4 in_stack_ffffffa0; undefined4 in_stack_ffffffa4; undefined4 in_stack_ffffffa8; void *in_stack_ffffffac; uint in_stack_ffffffb0; int difficulty; char acStack_4a [2]; void *seedText [4]; undefined4 seedTextSize; uint seedTextCapacity; uint stackCookie; void *local_10; undefined1 *puStack_c; void *local_8; void *challengeParams; Manager *manager; MenuManager *menuManager; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)(seedText + 10); ExceptionList = &local_10; if (((g_manager->_framecount & 1) == 0) && (*(char *)((int)in_ECX + 0x11d) != '\0')) { AnimationState::Update((AnimationState *)(in_ECX + 0x11)); in_stack_ffffffb0 = 0x945ea5; AnimationState::Update((AnimationState *)(in_ECX + 0x19)); } menuManager = g_menuManager; if (g_menuManager->_fadeOutActive == 0) { iVar5 = 0x945fd4; isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (isActionPressed == '\0') { isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionPressed == '\0') { isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionPressed == '\0') { isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isActionPressed == '\0') { isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if ((isActionPressed != '\0') && (iVar5 = FUN_0098aef0(), iVar5 != 0x15)) { MenuManager::push_menu(0xf,unused); } } else { iVar5 = FUN_0098aef0(); if ((iVar5 == 0x15) && ((g_manager->_lobbySettings)._challenge == 0)) { (g_manager->_lobbySettings)._gameMode = 0; } FUN_0098aec0(); } } else { iVar5 = in_ECX[2]; if ((iVar5 == 0) || ((0x31 < iVar5 && (iVar5 % 10 == 0)))) { iVar5 = in_ECX[1]; persistentData = &g_manager->_persistentGameData; do { uVar1 = iVar5 + 1; in_ECX[1] = uVar1; if ((int)uVar1 < 0x2e) { if (uVar1 < 0x2e) { iVar5 = *(int *)(&DAT_00b7b0b0 + uVar1 * 4); } else { iVar5 = 0; } } else { in_ECX[1] = 1; iVar5 = 0; } isUnlocked = PersistentGameData::Unlocked(persistentData,iVar5); persistentData = extraout_ECX_00; iVar5 = extraout_EDX_00; } while (isUnlocked == 0); } } } else { iVar5 = in_ECX[2]; if ((iVar5 == 0) || ((0x31 < iVar5 && (iVar5 % 10 == 0)))) { iVar5 = in_ECX[1]; persistentData = &g_manager->_persistentGameData; do { uVar1 = iVar5 - 1; in_ECX[1] = uVar1; if ((int)uVar1 < 1) { in_ECX[1] = 0x2d; iVar5 = 0x204; } else if (uVar1 < 0x2e) { iVar5 = *(int *)(&DAT_00b7b0b0 + uVar1 * 4); } else { iVar5 = 0; } isUnlocked = PersistentGameData::Unlocked(persistentData,iVar5); persistentData = extraout_ECX; iVar5 = extraout_EDX; } while (isUnlocked == 0); } } } else { uVar1 = (int)(g_menuManager->_menuStateHistory)._end - (int)(g_menuManager->_menuStateHistory)._begin >> 2; if ((uVar1 < 2) || (*(int *)((int)(g_menuManager->_menuStateHistory)._begin + uVar1 * 4 + -8) != 0x15)) { KColor::SetFromARGB((KColor *)(acStack_4a + -0x2a),0xff000000); fadeColor._green = (float)in_stack_ffffff90; fadeColor._red = (float)in_stack_ffffff8c; fadeColor._blue = (float)in_stack_ffffff94; fadeColor._alpha = (float)in_stack_ffffff98; fadeColor._unk = iVar5; MenuManager::start_game(fadeColor); } else { (g_manager->_lobbySettings)._challenge = in_ECX[1]; (manager->_lobbySettings)._gameMode = 4; FUN_0098aec0(); } } isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if ((isActionPressed == '\0') && (isActionPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(), isActionPressed == '\0')) { in_ECX[2] = 0; } else { in_ECX[2] = in_ECX[2] + 1; } menuManager = g_menuManager; iVar5 = in_ECX[1]; if (iVar5 < 5) { scrollY = -216.0; } else if (iVar5 < 0x2b) { scrollY = -216.0 - (float)((iVar5 + -4) * 0x16); } else { scrollY = -1074.0; } g_menuManager->_viewPositionSet[7].y = scrollY; menuManager->_state = 1; *in_ECX = 0; } else if (1.0 <= g_menuManager->_fadeOutProgress) { uVar1 = in_ECX[1]; challengeParams = (g_manager->_challengeParams)._begin; seedTextCapacity = 0xf; uVar2 = ((int)(g_manager->_challengeParams)._end - (int)challengeParams) / 0xa4 - 1; seedTextSize = 0; seedText[0] = (void *)0x0; challengeIdx = -(uint)(uVar1 != 0) & uVar1; if (uVar2 <= challengeIdx) { challengeIdx = uVar2; } iVar5 = *(int *)(challengeIdx * 0xa4 + 0x44 + (int)challengeParams); local_8 = (void *)0x0; uVar3 = 0x945f3b; std::string::string(acStack_4a + -0x1a,seedText); uVar4 = 0x945f46; seed._buf[4] = (char)in_stack_ffffffa0; seed._buf[5] = (char)((uint)in_stack_ffffffa0 >> 8); seed._buf[6] = (char)((uint)in_stack_ffffffa0 >> 0x10); seed._buf[7] = (char)((uint)in_stack_ffffffa0 >> 0x18); seed._buf[0] = (char)in_stack_ffffff9c; seed._buf[1] = (char)((uint)in_stack_ffffff9c >> 8); seed._buf[2] = (char)((uint)in_stack_ffffff9c >> 0x10); seed._buf[3] = (char)((uint)in_stack_ffffff9c >> 0x18); seed._buf[8] = (char)in_stack_ffffffa4; seed._buf[9] = (char)((uint)in_stack_ffffffa4 >> 8); seed._buf[10] = (char)((uint)in_stack_ffffffa4 >> 0x10); seed._buf[0xb] = (char)((uint)in_stack_ffffffa4 >> 0x18); seed._buf[0xc] = (char)in_stack_ffffffa8; seed._buf[0xd] = (char)((uint)in_stack_ffffffa8 >> 8); seed._buf[0xe] = (char)((uint)in_stack_ffffffa8 >> 0x10); seed._buf[0xf] = (char)((uint)in_stack_ffffffa8 >> 0x18); seed._size = (uint)in_stack_ffffffac; seed._capacity = in_stack_ffffffb0; Seeds::SetStartSeed(&menuManager->_seedsObject,seed); local_8 = (void *)0xffffffff; if (0xf < seedTextCapacity) { uVar2 = seedTextCapacity + 1; in_stack_ffffffac = seedText[0]; if (0xfff < uVar2) { in_stack_ffffffac = *(void **)((int)seedText[0] + -4); uVar2 = seedTextCapacity + 0x24; if (0x1f < (uint)((int)seedText[0] + (-4 - (int)in_stack_ffffffac))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } in_stack_ffffffa8 = 0x945f80; operator_delete(in_stack_ffffffac,uVar2); } seeds = &g_menuManager->_seedsObject; seeds->_isCustomRun = 1; difficulty = *(int *)(challengeIdx * 0xa4 + 0x70 + (int)challengeParams); Seeds::construct_from_copy(aSStackY_2f08 + 0x81,seeds); unk._stageSeeds[6] = in_stack_ffffff84; unk._isCustomRun = in_stack_ffffff54[0]; unk._1_3_ = in_stack_ffffff54._1_3_; unk._gameStartSeed = in_stack_ffffff54._4_4_; unk._rng._seed = in_stack_ffffff54._8_4_; unk._rng._shift1 = in_stack_ffffff54._12_4_; unk._rng._shift2 = in_stack_ffffff54._16_4_; unk._rng._shift3 = in_stack_ffffff54._20_4_; unk._stageSeeds[0] = in_stack_ffffff54._24_4_; unk._stageSeeds[1] = in_stack_ffffff54._28_4_; unk._stageSeeds[2] = in_stack_ffffff54._32_4_; unk._stageSeeds[3] = in_stack_ffffff54._36_4_; unk._stageSeeds[4] = in_stack_ffffff54._40_4_; unk._stageSeeds[5] = in_stack_ffffff54._44_4_; unk._stageSeeds[7] = in_stack_ffffff88; unk._stageSeeds[8] = in_stack_ffffff8c; unk._stageSeeds[9] = in_stack_ffffff90; unk._stageSeeds[10] = uVar3; unk._stageSeeds[0xb] = uVar4; unk._stageSeeds[0xc] = in_stack_ffffff9c; unk._stageSeeds[0xd] = in_stack_ffffffa0; unk._playerInitSeed = in_stack_ffffffa4; unk._seedEffects = (void *)in_stack_ffffffa8; unk._seedEffectsCount = (int)in_stack_ffffffac; Manager::StartNewGame(this,iVar5,uVar1,unk,difficulty); } ExceptionList = local_10; return; } //@@ 009462c0 Menu_Challenge::Render /* DB: MenuManager::Render calls it with LEA ECX,[ESI+0x2688] (_menuChallenge), next to Menu_Challenge::Update; 008ce430 Menu_CustomChallenge::Render +0xd848) is the real Menu_CustomChallenge::Render prototype: REPENTOGON */ void __thiscall Menu_Challenge::Render(Menu_Challenge *this) { Vector pos; Vector scale; LayerState *layer; void *pvVar1; float *customButtonFrame; uint uVar2; AnimationState *secondAnimState; AnimationLayer *animLayer; int iVar3; ANM2 *pAVar4; Vector menuPos; ANM2 *challengeSprite; Vector local_24; int prevMenuState; uint challengeIndex; byte isChallengeDone; byte isLayerVisible; uVar2 = (int)(g_menuManager->_menuStateHistory)._end - (int)(g_menuManager->_menuStateHistory)._begin >> 2; if (uVar2 < 2) { prevMenuState = 0; } else { prevMenuState = *(int *)((int)(g_menuManager->_menuStateHistory)._begin + uVar2 * 4 + -8); } if ((g_menuControllerIndex != 0) || (isLayerVisible = 1, prevMenuState == 0x15)) { isLayerVisible = 0; } challengeSprite = &this->ChallengeMenuSprite; layer = ANM2::GetLayer(challengeSprite,(byte *)"CustomTab"); pAVar4 = &this->ChallengeMenuSprite; layer->_visible = isLayerVisible; layer = ANM2::GetLayer(pAVar4,(byte *)0x2); layer->_visible = 0; layer = ANM2::GetLayer(pAVar4,&DAT_0000000e); layer->_visible = 0; layer = ANM2::GetLayer(pAVar4,&DAT_0000000f); layer->_visible = 0; layer = ANM2::GetLayer(pAVar4,&DAT_0000000d); layer->_visible = 0; menuPos.x = (g_menuManager->_ViewPosition).x + this->PositionX; menuPos.y = (g_menuManager->_ViewPosition).y + this->PositionY; if ((this->ChallengeMenuSprite)._loaded != 0) { if ((this->ChallengeMenuSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->ChallengeMenuSprite)._animState,&menuPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->ChallengeMenuSprite)._overlayAnimState; } else { AnimationState::Render (&(this->ChallengeMenuSprite)._overlayAnimState,&menuPos,&g_vectorZero,&g_vectorZero ); secondAnimState = &(this->ChallengeMenuSprite)._animState; } AnimationState::Render(secondAnimState,&menuPos,&g_vectorZero,&g_vectorZero); } layer = ANM2::GetLayer(&this->ChallengeMenuSprite,(byte *)0x2); layer->_visible = 1; challengeIndex = 1; do { if (challengeIndex < 0x2e) { uVar2 = *(uint *)(&DAT_00b7b0b0 + challengeIndex * 4); if (uVar2 == 0xfffffffe) { isLayerVisible = 0; } else { if ((int)uVar2 < 0) goto LAB_00946450; if (uVar2 < 0x282) { if (((uVar2 == 0) || ((g_manager->_persistentGameData)._achievements[uVar2] != 0)) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) goto LAB_00946450; isLayerVisible = 0; } else { isLayerVisible = 0; } } } else { LAB_00946450: isLayerVisible = 1; } if ((this->ChallengeMenuSprite)._animState._animData != (void *)0x0) { if ((0xe < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80)) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0xe < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80))) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; local_24.y = *(float *)((int)pvVar1 + 0x70); if ((pvVar1 == (void *)0x0) || (((int)local_24.y < 0 || (*(int *)((int)pvVar1 + 0x1c) <= (int)local_24.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(this->ChallengeMenuSprite)._animState._layerFrames + (int)local_24.y * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ChallengeMenuSprite)._animState,(int)local_24.y, (float)(int)(challengeIndex - 1)); } if ((this->ChallengeMenuSprite)._animState._animData != (void *)0x0) { if ((0xf < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80)) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0xf < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80))) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; local_24.y = *(float *)((int)pvVar1 + 0x74); if ((pvVar1 == (void *)0x0) || (((int)local_24.y < 0 || (*(int *)((int)pvVar1 + 0x1c) <= (int)local_24.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(this->ChallengeMenuSprite)._animState._layerFrames + (int)local_24.y * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ChallengeMenuSprite)._animState,(int)local_24.y, (float)(int)(challengeIndex - 1)); } if (((this->ChallengeMenuSprite)._animState._animData != (void *)0x0) && ((0xd < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0xd < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80))))) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; local_24.y = *(float *)((int)pvVar1 + 0x6c); if ((pvVar1 == (void *)0x0) || (((int)local_24.y < 0 || (*(int *)((int)pvVar1 + 0x1c) <= (int)local_24.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(this->ChallengeMenuSprite)._animState._layerFrames + (int)local_24.y * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ChallengeMenuSprite)._animState,(int)local_24.y, (float)(int)(challengeIndex - 1)); } } } layer = ANM2::GetLayer(&this->ChallengeMenuSprite,&DAT_0000000e); layer->_visible = isLayerVisible; isChallengeDone = *(byte *)((int)(g_manager->_persistentGameData)._cutsceneCounters + (challengeIndex - 0x31) ); layer = ANM2::GetLayer(&this->ChallengeMenuSprite,&DAT_0000000f); isLayerVisible = isLayerVisible ^ 1; layer->_visible = isChallengeDone; layer = ANM2::GetLayer(&this->ChallengeMenuSprite,&DAT_0000000d); layer->_visible = isLayerVisible; if ((this->ChallengeMenuSprite)._loaded != 0) { if ((this->ChallengeMenuSprite)._overlayRenderFirst == 0) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 0xe < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x70), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&menuPos, *(int *)((int)(this->ChallengeMenuSprite)._animState._layerFrames + iVar3 * 4), &g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 0xe < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x70), -1 < iVar3)) { animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._layerFrames; goto LAB_009466e1; } } else { pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 0xe < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x70), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&menuPos, *(int *)((int)(this->ChallengeMenuSprite)._overlayAnimState._layerFrames + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 0xe < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x70), -1 < iVar3)) { animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._animState._layerFrames; LAB_009466e1: AnimationLayer::RenderFrame (animLayer,&menuPos,*(int *)((int)pvVar1 + iVar3 * 4),&g_vectorZero, &g_vectorZero,pAVar4); } } if ((this->ChallengeMenuSprite)._loaded != 0) { if ((this->ChallengeMenuSprite)._overlayRenderFirst == 0) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 0xf < pAVar4->_layerCount )) && (iVar3 = *(int *)((int)pvVar1 + 0x74), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&menuPos, *(int *)((int)(this->ChallengeMenuSprite)._animState._layerFrames + iVar3 * 4 ),&g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 0xf < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x74), -1 < iVar3)) { animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._layerFrames; goto LAB_009467de; } } else { pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 0xf < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x74), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&menuPos, *(int *)((int)(this->ChallengeMenuSprite)._overlayAnimState._layerFrames + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 0xf < pAVar4->_layerCount )) && (iVar3 = *(int *)((int)pvVar1 + 0x74), -1 < iVar3)) { animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._animState._layerFrames; LAB_009467de: AnimationLayer::RenderFrame (animLayer,&menuPos,*(int *)((int)pvVar1 + iVar3 * 4),&g_vectorZero, &g_vectorZero,pAVar4); } } if ((this->ChallengeMenuSprite)._loaded != 0) { if ((this->ChallengeMenuSprite)._overlayRenderFirst == 0) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 0xd < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x6c), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&menuPos, *(int *)((int)(this->ChallengeMenuSprite)._animState._layerFrames + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 0xd < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x6c), -1 < iVar3)) { animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._layerFrames; goto LAB_009468db; } } else { pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 0xd < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x6c), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&menuPos, *(int *)((int)(this->ChallengeMenuSprite)._overlayAnimState._layerFrames + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 0xd < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x6c), -1 < iVar3)) { animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._animState._layerFrames; LAB_009468db: AnimationLayer::RenderFrame (animLayer,&menuPos,*(int *)((int)pvVar1 + iVar3 * 4),&g_vectorZero, &g_vectorZero,pAVar4); } } } } } challengeIndex = challengeIndex + 1; } while ((int)challengeIndex < 0x2e); challengeIndex = this->SelectedChallengeID + -1; if (((this->ChallengeMenuSprite)._animState._animData != (void *)0x0) && ((2 < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 2 < *(int *)((int)(this->ChallengeMenuSprite)._animState._animation + 0x80))))) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; local_24.y = *(float *)((int)pvVar1 + 0x40); if ((pvVar1 == (void *)0x0) || (((int)local_24.y < 0 || (*(int *)((int)pvVar1 + 0x1c) <= (int)local_24.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->ChallengeMenuSprite)._animState._layerFrames + (int)local_24.y * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ChallengeMenuSprite)._animState,(int)local_24.y,(float)(int)challengeIndex); } local_24.x = (g_menuManager->_ViewPosition).x + this->PositionX; local_24.y = (g_menuManager->_ViewPosition).y + this->PositionY; if ((this->ChallengeMenuSprite)._loaded != 0) { if ((this->ChallengeMenuSprite)._overlayRenderFirst == 0) { pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, 2 < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x40), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&local_24, *(int *)((int)(this->ChallengeMenuSprite)._animState._layerFrames + iVar3 * 4), &g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 == (void *)0x0) || (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, pAVar4->_layerCount < 3)) || (iVar3 = *(int *)((int)pvVar1 + 0x40), iVar3 < 0)) goto LAB_00946a99; animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._layerFrames; } else { pvVar1 = (this->ChallengeMenuSprite)._overlayAnimState._animData; if (((pvVar1 != (void *)0x0) && (pAVar4 = (this->ChallengeMenuSprite)._overlayAnimState._animation, 2 < pAVar4->_layerCount)) && (iVar3 = *(int *)((int)pvVar1 + 0x40), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)),&local_24, *(int *)((int)(this->ChallengeMenuSprite)._overlayAnimState._layerFrames + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar4); } pvVar1 = (this->ChallengeMenuSprite)._animState._animData; if (((pvVar1 == (void *)0x0) || (pAVar4 = (this->ChallengeMenuSprite)._animState._animation, pAVar4->_layerCount < 3)) || (iVar3 = *(int *)((int)pvVar1 + 0x40), iVar3 < 0)) goto LAB_00946a99; animLayer = (AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar1 + 0x18)); pvVar1 = (this->ChallengeMenuSprite)._animState._layerFrames; } AnimationLayer::RenderFrame (animLayer,&local_24,*(int *)((int)pvVar1 + iVar3 * 4),&g_vectorZero,&g_vectorZero, pAVar4); } LAB_00946a99: iVar3 = prevMenuState; if (((g_menuControllerIndex != 0) && (prevMenuState != 0x15)) && (((this->ChallengeMenuSprite)._animState._animData != (void *)0x0 && (customButtonFrame = AnimationState::GetNullFrame (&(this->ChallengeMenuSprite)._animState,(byte *)"CustomButton"), customButtonFrame != (float *)0x0)))) { menuPos.y = customButtonFrame[1] + menuPos.y; menuPos.x = *customButtonFrame + menuPos.x; pos.y = menuPos.y; pos.x = menuPos.x; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x1c,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); } isLayerVisible = iVar3 != 0x15; layer = ANM2::GetLayer(challengeSprite,(byte *)"CustomPaper"); layer->_visible = isLayerVisible; layer = ANM2::GetLayer(challengeSprite,(byte *)"CustomText"); layer->_visible = isLayerVisible; return; } //@@ 00946b80 Menu_Challenge::reset /* DB: ECX=MenuManager+0x2688 (_menuChallenge) from MenuManager::LoadGraphics/SetState: sprite +0x14 to Idle, selection +4 = last challenge (Manager+0x4b0e0) when coming from state 0x15, then advances to the next unlocked challenge 1..0x2d (DAT_00b7b0b0 achievement table) prototype: db/protos.zhl */ void __thiscall Menu_Challenge::reset(Menu_Challenge *this) { byte *pbVar1; int iVar2; Game *pGVar3; Manager *pMVar4; MenuManager *pMVar5; byte bVar6; byte *pbVar7; uint uVar8; byte *pbVar9; bool bVar10; int local_8; uVar8 = (int)(g_menuManager->_menuStateHistory)._end - (int)(g_menuManager->_menuStateHistory)._begin >> 2; if (uVar8 < 2) { local_8 = 0; } else { local_8 = *(int *)((int)(g_menuManager->_menuStateHistory)._begin + uVar8 * 4 + -8); } pbVar1 = (this->ChallengeMenuSprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar7 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar7 = *(byte **)pbVar1; } pbVar9 = s_Idle; do { bVar6 = *pbVar7; bVar10 = bVar6 < *pbVar9; if (bVar6 != *pbVar9) { LAB_00946be4: uVar8 = -(uint)bVar10 | 1; goto LAB_00946be9; } if (bVar6 == 0) break; bVar6 = pbVar7[1]; bVar10 = bVar6 < pbVar9[1]; if (bVar6 != pbVar9[1]) goto LAB_00946be4; pbVar7 = pbVar7 + 2; pbVar9 = pbVar9 + 2; } while (bVar6 != 0); uVar8 = 0; LAB_00946be9: if ((uVar8 == 0) && ((pbVar1[0x34] == 0 || ((this->ChallengeMenuSprite)._animState._isPlaying != 0)))) goto LAB_00946c23; } bVar6 = ANM2::SetAnimation(&this->ChallengeMenuSprite,s_Idle,1); if (bVar6 != 0) { AnimationState::Rewind(&(this->ChallengeMenuSprite)._animState); (this->ChallengeMenuSprite)._animState._isPlaying = 1; } LAB_00946c23: pMVar5 = g_menuManager; pMVar4 = g_manager; this->SelectedChallengeID = 0; if ((local_8 == 0x15) && (iVar2 = (pMVar4->_lobbySettings)._challenge, 0 < iVar2)) { this->SelectedChallengeID = iVar2 + -1; } pGVar3 = g_game; this->HoldInputTimer = 1; pMVar5->_viewPositionSet[7].y = -216.0; pMVar5->_state = 1; do { this->SelectedChallengeID = this->SelectedChallengeID + 1; uVar8 = this->SelectedChallengeID; if ((int)uVar8 < 0x2e) { if (0x2d < uVar8) { return; } } else { this->SelectedChallengeID = 1; uVar8 = 1; } uVar8 = *(uint *)(&DAT_00b7b0b0 + uVar8 * 4); } while ((uVar8 == 0xfffffffe) || ((-1 < (int)uVar8 && ((0x281 < uVar8 || (((uVar8 != 0 && ((pMVar4->_persistentGameData)._achievements[uVar8] == 0)) && (((pMVar4->_state != 2 || (pGVar3 == (Game *)0x0)) || (((pGVar3->_dailyChallenge)._id == 0 && (pGVar3->_isDebug == 0)))))))))))); return; } //@@ 00946cd0 Menu_Character_Entry::IsCharacterAvailable /* ZHL [exact] __thiscall bool Menu_Character_Entry::IsCharacterAvailable(int unused); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Menu_Character_Entry::IsCharacterAvailable(Menu_Character_Entry *this,int unused) { Menu_Character_Entry MVar1; Manager *pMVar2; byte bVar3; void *pvVar4; pMVar2 = g_manager; MVar1 = this[1]; if (((int)MVar1 < 0) || (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= (int)MVar1)) { pvVar4 = (void *)0x0; } else { pvVar4 = (void *)((int)MVar1 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); } if (-1 < *(int *)((int)pvVar4 + 0xe8)) { bVar3 = PersistentGameData::Unlocked (&g_manager->_persistentGameData,*(int *)((int)pvVar4 + 0xe8)); if ((bVar3 == 0) || (((MVar1 == (Menu_Character_Entry)0x9 || (MVar1 == (Menu_Character_Entry)0x1e)) && ((pMVar2->_persistentGameData)._eventCounters[0x15] == 0)))) { return 0; } } return 1; } //@@ 00946d50 portrait_list_sort /* DB: ? recursive quicksort over the global 16-byte entry vector g_characterPortraitOrder by the float at +8 (EDX=lo, param=hi); Menu_Character::render_portraits (depth sort) */ void portrait_list_sort(int param_1) { float *pfVar1; undefined4 *puVar2; float fVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; float fVar8; float *pfVar9; void *pvVar10; int in_EDX; int iVar11; if (in_EDX < param_1) { do { fVar8 = *(float *)((int)g_characterPortraitOrder + param_1 * 0x10 + 8); pvVar10 = g_characterPortraitOrder; iVar11 = param_1; do { pfVar9 = (float *)(in_EDX * 0x10 + 8 + (int)pvVar10); if (*pfVar9 <= fVar8 && fVar8 != *pfVar9) { do { pfVar9 = pfVar9 + 4; in_EDX = in_EDX + 1; } while (*pfVar9 <= fVar8 && fVar8 != *pfVar9); } pfVar9 = (float *)(iVar11 * 0x10 + 8 + (int)pvVar10); fVar3 = *pfVar9; while (fVar8 < fVar3) { pfVar1 = pfVar9 + -4; pfVar9 = pfVar9 + -4; iVar11 = iVar11 + -1; fVar3 = *pfVar1; } if (*(float *)((int)pvVar10 + in_EDX * 0x10 + 8) == *(float *)((int)pvVar10 + iVar11 * 0x10 + 8)) { in_EDX = in_EDX + 1; } else { if (iVar11 <= in_EDX) break; puVar2 = (undefined4 *)((int)pvVar10 + in_EDX * 0x10); uVar4 = *puVar2; uVar5 = puVar2[1]; uVar6 = puVar2[2]; uVar7 = puVar2[3]; *(undefined4 *)((int)pvVar10 + in_EDX * 0x10) = *(undefined4 *)((int)pvVar10 + iVar11 * 0x10); *(undefined4 *)((int)pvVar10 + in_EDX * 0x10 + 4) = *(undefined4 *)((int)pvVar10 + iVar11 * 0x10 + 4); *(undefined4 *)((int)pvVar10 + in_EDX * 0x10 + 8) = *(undefined4 *)((int)pvVar10 + iVar11 * 0x10 + 8); *(undefined4 *)((int)pvVar10 + in_EDX * 0x10 + 0xc) = *(undefined4 *)((int)pvVar10 + iVar11 * 0x10 + 0xc); pvVar10 = g_characterPortraitOrder; *(undefined4 *)((int)g_characterPortraitOrder + iVar11 * 0x10 + 4) = uVar5; *(undefined4 *)((int)pvVar10 + iVar11 * 0x10) = uVar4; *(undefined4 *)((int)pvVar10 + iVar11 * 0x10 + 8) = uVar6; *(undefined4 *)((int)pvVar10 + iVar11 * 0x10 + 0xc) = uVar7; pvVar10 = g_characterPortraitOrder; } } while (in_EDX < iVar11); portrait_list_sort(iVar11 + -1); in_EDX = iVar11 + 1; } while (in_EDX < param_1); } return; } //@@ 00946e70 Menu_Character::constructor /* DB: MenuManager::constructor calls it with ECX=this+0x1534 (_menuCharacter per db/fields.tsv): ANM2::constructor at +0x40,+0x154,...,+0xc50, strings +0xd64.. (seed buffer) */ Menu_Character * __thiscall Menu_Character::constructor(Menu_Character *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0b65e; local_10 = ExceptionList; ExceptionList = &local_10; this->_PositionY = 0.0; this->_PositionX = 0.0; ANM2::constructor(&this->_BigCharPageSprite); local_8 = 0; ANM2::constructor(&this->_DifficultyOverlaySprite); local_8._0_1_ = 1; ANM2::constructor(&this->_GreedDecoOverlaySprite); local_8._0_1_ = 2; ANM2::constructor(&this->_CharacterMenuBGSprite); local_8._0_1_ = 3; ANM2::constructor((ANM2 *)&this->field_0x494); local_8._0_1_ = 4; ANM2::constructor(&this->_DifficultyPageSprite); local_8._0_1_ = 5; ANM2::constructor(&this->_SeedPageSprite); local_8._0_1_ = 6; ANM2::constructor(&this->_WinStreakPageSprite); local_8._0_1_ = 7; ANM2::constructor(&this->_EastereggPageSprite); local_8._0_1_ = 8; (this->_eastereggPagePosition).y = 0.0; (this->_eastereggPagePosition).x = 0.0; ANM2::constructor(&this->_SeedUnlockPageSprite); local_8._0_1_ = 9; ANM2::constructor(&this->_CharacterPortraitsSprite); (this->_portraitPositions)._begin = (void *)0x0; (this->_portraitPositions)._end = (void *)0x0; (this->_portraitPositions)._capacity = (void *)0x0; (this->_portraitScales)._begin = (void *)0x0; (this->_portraitScales)._end = (void *)0x0; (this->_portraitScales)._capacity = (void *)0x0; local_8._0_1_ = 0xc; ANM2::constructor(&this->_SeedEntrySprite); (this->_seedText)._buf[0] = '\0'; (this->_seedText)._buf[1] = '\0'; (this->_seedText)._buf[2] = '\0'; (this->_seedText)._buf[3] = '\0'; (this->_seedText)._size = 0; (this->_seedText)._capacity = 0xf; (this->_seedText)._buf[0] = '\0'; *(undefined4 *)&this->field_0xd84 = 0; *(undefined4 *)&this->field_0xd94 = 0; *(undefined4 *)&this->field_0xd98 = 0xf; this->field_0xd84 = 0; *(undefined4 *)&this->field_0xd9c = 0; *(undefined4 *)&this->field_0xdac = 0; *(undefined4 *)&this->field_0xdb0 = 0xf; this->field_0xd9c = 0; local_8._0_1_ = 0x10; ANM2::constructor(&this->_PageSwapWidgetSprite); local_8 = CONCAT31(local_8._1_3_,0x11); ANM2::constructor(&this->_TaintedMenuBGDecoSprite); this[1].Status = 0; *(undefined4 *)&this[1].field_0x4 = 0; ExceptionList = local_10; return this; } //@@ 00947070 Menu_Character::destructor /* DB: ECX=MenuManager+0x1534 (_menuCharacter) in MenuManager destructor 00986f30: releases render target +0xfe0, ANM2s +0xecc/+0xdb8/+0xc50/+0xb20/+0xa04..., strings, vectors */ void __thiscall Menu_Character::destructor(Menu_Character *this) { char isLastRef; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0b680; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)&this[1].field_0x4 != (int *)0x0) { isLastRef = (**(code **)(**(int **)&this[1].field_0x4 + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(this + 1); } } local_8 = 1; ANM2::Reset(&this->_TaintedMenuBGDecoSprite); AnimationState::~AnimationState(&(this->_TaintedMenuBGDecoSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_TaintedMenuBGDecoSprite)._animState); std::string::_Tidy_deallocate((this->_TaintedMenuBGDecoSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_TaintedMenuBGDecoSprite); local_8 = 2; ANM2::Reset(&this->_PageSwapWidgetSprite); AnimationState::~AnimationState(&(this->_PageSwapWidgetSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_PageSwapWidgetSprite)._animState); std::string::_Tidy_deallocate((this->_PageSwapWidgetSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_PageSwapWidgetSprite); std::string::_Tidy_deallocate(&this->field_0xd9c); std::string::_Tidy_deallocate(&this->field_0xd84); std::string::_Tidy_deallocate((this->_seedText)._buf); local_8 = 3; ANM2::Reset(&this->_SeedEntrySprite); AnimationState::~AnimationState(&(this->_SeedEntrySprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_SeedEntrySprite)._animState); std::string::_Tidy_deallocate((this->_SeedEntrySprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_SeedEntrySprite); FID_conflict__Tidy(&this->_portraitScales); std::vector::_Tidy(); local_8 = 4; ANM2::Reset(&this->_CharacterPortraitsSprite); AnimationState::~AnimationState(&(this->_CharacterPortraitsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_CharacterPortraitsSprite)._animState); std::string::_Tidy_deallocate((this->_CharacterPortraitsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_CharacterPortraitsSprite); local_8 = 5; ANM2::Reset(&this->_SeedUnlockPageSprite); AnimationState::~AnimationState(&(this->_SeedUnlockPageSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_SeedUnlockPageSprite)._animState); std::string::_Tidy_deallocate((this->_SeedUnlockPageSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_SeedUnlockPageSprite); local_8 = 6; ANM2::Reset(&this->_EastereggPageSprite); AnimationState::~AnimationState(&(this->_EastereggPageSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_EastereggPageSprite)._animState); std::string::_Tidy_deallocate((this->_EastereggPageSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_EastereggPageSprite); local_8 = 7; ANM2::Reset(&this->_WinStreakPageSprite); AnimationState::~AnimationState(&(this->_WinStreakPageSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_WinStreakPageSprite)._animState); std::string::_Tidy_deallocate((this->_WinStreakPageSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_WinStreakPageSprite); local_8 = 8; ANM2::Reset(&this->_SeedPageSprite); AnimationState::~AnimationState(&(this->_SeedPageSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_SeedPageSprite)._animState); std::string::_Tidy_deallocate((this->_SeedPageSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_SeedPageSprite); local_8 = 9; ANM2::Reset(&this->_DifficultyPageSprite); AnimationState::~AnimationState(&(this->_DifficultyPageSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_DifficultyPageSprite)._animState); std::string::_Tidy_deallocate((this->_DifficultyPageSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_DifficultyPageSprite); local_8 = 10; ANM2::Reset((ANM2 *)&this->field_0x494); AnimationState::~AnimationState((AnimationState *)&this->field_0x4e4); AnimationState::~AnimationState((AnimationState *)&this->field_0x4c4); std::string::_Tidy_deallocate(&this->field_0x4ac); std::string::_Tidy_deallocate(&this->field_0x494); local_8 = 0xb; ANM2::Reset(&this->_CharacterMenuBGSprite); AnimationState::~AnimationState(&(this->_CharacterMenuBGSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_CharacterMenuBGSprite)._animState); std::string::_Tidy_deallocate((this->_CharacterMenuBGSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_CharacterMenuBGSprite); local_8 = 0xc; ANM2::Reset(&this->_GreedDecoOverlaySprite); AnimationState::~AnimationState(&(this->_GreedDecoOverlaySprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_GreedDecoOverlaySprite)._animState); std::string::_Tidy_deallocate((this->_GreedDecoOverlaySprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_GreedDecoOverlaySprite); local_8 = 0xd; ANM2::Reset(&this->_DifficultyOverlaySprite); AnimationState::~AnimationState(&(this->_DifficultyOverlaySprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_DifficultyOverlaySprite)._animState); std::string::_Tidy_deallocate((this->_DifficultyOverlaySprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_DifficultyOverlaySprite); local_8 = 0xe; ANM2::Reset(&this->_BigCharPageSprite); AnimationState::~AnimationState(&(this->_BigCharPageSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_BigCharPageSprite)._animState); std::string::_Tidy_deallocate((this->_BigCharPageSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_BigCharPageSprite); ExceptionList = local_10; return; } //@@ 00948200 Menu_Character::LoadGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from MenuManager::LoadGraphics (00988d80); loads gfx/ui/main menu/CharacterMenu*.anm2, DifficultyWidget, SeedEntry, SeedWidget, WinStreakWidget, PageSwapWidget prototype: db/protos.zhl */ void __thiscall Menu_Character::LoadGraphics(Menu_Character *this) { byte bVar1; LayerState *layer; byte *nameCursor; byte *expectedName; uint uVar2; byte *nameCursor; ANM2 *sprite; bool bVar4; undefined1 auStackY_f8 [128]; void *pvVar5; char *pcVar6; void *textureRefCount; std_string seedUnlockPath; std_string anmPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = auStackY_f8 + 0xf4; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b7c5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(auStackY_f8 + 0xe8); ExceptionList = &local_1c; sprite = &this->_CharacterMenuBGSprite; anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x30); anmPath._size = 0x25; anmPath._capacity = 0x2f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/CharacterMenuBG.anm2",0x26); local_14 = 0; ANM2::Load(sprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } textureRefCount = (void *)0x3; pvVar5 = (void *)0x948303; layer = ANM2::GetLayer(sprite,(byte *)0x3); KAGE::SmartPointer::operator_assign(auStackY_f8 + 0x84,this + 1); LayerState::SetTexture(layer,pvVar5,textureRefCount); layer = ANM2::GetLayer(sprite,(byte *)0x3); if (layer->_layerData == (void *)0x0) { anmPath._capacity = 0xf; anmPath._size = 0; anmPath._buf._0_4_ = (char *)0x0; } else { std::string::string(anmPath._buf,(void *)((int)layer->_layerData + 0x20)); } local_14 = 1; TextureCache::Release(); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } nameCursor = (this->_CharacterMenuBGSprite)._animState._animData; if (nameCursor == (byte *)0x0) { LAB_009483f9: bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._animState); (this->_CharacterMenuBGSprite)._animState._isPlaying = 1; } } else { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } expectedName = s_Idle; do { bVar1 = *nameCursor; bVar4 = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_009483e6: uVar2 = -(uint)bVar4 | 1; goto LAB_009483eb; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009483e6; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009483eb: if ((uVar2 != 0) || ((nameCursor[0x34] != 0 && ((this->_CharacterMenuBGSprite)._animState._isPlaying == 0)))) goto LAB_009483f9; } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x30); anmPath._size = 0x24; anmPath._capacity = 0x2f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/PageSwapWidget.anm2",0x25); local_14 = 2; ANM2::Load(&this->_PageSwapWidgetSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } nameCursor = (this->_PageSwapWidgetSprite)._animState._animData; if (nameCursor == (byte *)0x0) { LAB_00948513: bVar1 = ANM2::SetAnimation(&this->_PageSwapWidgetSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_PageSwapWidgetSprite)._animState); (this->_PageSwapWidgetSprite)._animState._isPlaying = 1; } } else { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } expectedName = s_Idle; do { bVar1 = *nameCursor; bVar4 = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_00948500: uVar2 = -(uint)bVar4 | 1; goto LAB_00948505; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00948500; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00948505: if ((uVar2 != 0) || ((nameCursor[0x34] != 0 && ((this->_PageSwapWidgetSprite)._animState._isPlaying == 0)))) goto LAB_00948513; } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x30); anmPath._size = 0x2a; anmPath._capacity = 0x2f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/CharacterMenuBGExtra.anm2",0x2b); local_14 = 3; ANM2::Load(&this->_TaintedMenuBGDecoSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } nameCursor = (this->_TaintedMenuBGDecoSprite)._animState._animData; anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = anmPath._buf._0_4_ & 0xffffff00; if (nameCursor == (byte *)0x0) { LAB_00948653: bVar1 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } } else { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } expectedName = s_Idle; do { bVar1 = *nameCursor; bVar4 = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_00948640: uVar2 = -(uint)bVar4 | 1; goto LAB_00948645; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00948640; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00948645: if ((uVar2 != 0) || ((nameCursor[0x34] != 0 && ((this->_TaintedMenuBGDecoSprite)._animState._isPlaying == 0)))) goto LAB_00948653; } if ((g_manager->_persistentGameData)._characterMenuShown < 1) { pcVar6 = "Disappear"; } else { pcVar6 = "Appear"; } bVar1 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,(byte *)pcVar6,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } if ((this->_TaintedMenuBGDecoSprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_TaintedMenuBGDecoSprite)._animState, *(int *)((int)(this->_TaintedMenuBGDecoSprite)._animState._animData + 0x30) + -1); } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = (void *)0x0; nameCursor = (&PTR_s_gfx_ui_main_menu_CharacterMenu_a_00b24120)[this->_characterMenuShown * 3]; nameCursor = nameCursor; do { bVar1 = *nameCursor; nameCursor = nameCursor + 1; } while (bVar1 != 0); std::string::assign(anmPath._buf,nameCursor,(int)nameCursor - (int)(nameCursor + 1)); local_14 = 4; ANM2::Load(&this->_BigCharPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pvVar5 = (void *)anmPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if (0x1f < (uint)(anmPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } if ((uint)this->SelectedCharacterID < 0x12) { ANM2::Play(&this->_BigCharPageSprite, (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6],0); } UpdateRotations(this); sprite = &this->_DifficultyOverlaySprite; anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = (void *)0x0; nameCursor = (&PTR_s_gfx_ui_main_menu_CharacterMenu_a_00b24120)[this->_characterMenuShown * 3]; nameCursor = nameCursor; do { bVar1 = *nameCursor; nameCursor = nameCursor + 1; } while (bVar1 != 0); std::string::assign(anmPath._buf,nameCursor,(int)nameCursor - (int)(nameCursor + 1)); local_14 = 5; ANM2::Load(sprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pvVar5 = (void *)anmPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if (0x1f < (uint)(anmPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } nameCursor = (this->_DifficultyOverlaySprite)._animState._animData; if (nameCursor == (byte *)0x0) { LAB_00948883: bVar1 = ANM2::SetAnimation(sprite,(byte *)"BloodStain",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_DifficultyOverlaySprite)._animState); (this->_DifficultyOverlaySprite)._animState._isPlaying = 1; } } else { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } pcVar6 = "BloodStain"; do { bVar1 = *nameCursor; bVar4 = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_00948870: uVar2 = -(uint)bVar4 | 1; goto LAB_00948875; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_00948870; nameCursor = nameCursor + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00948875: if ((uVar2 != 0) || ((nameCursor[0x34] != 0 && ((this->_DifficultyOverlaySprite)._animState._isPlaying == 0)))) goto LAB_00948883; } nameCursor = (byte *)0x0; if ((this->_DifficultyOverlaySprite)._layerCount != 0) { do { layer = ANM2::GetLayer(sprite,nameCursor); nameCursor = nameCursor + 1; layer->_blendMode[0] = DAT_00c35e78; layer->_blendMode[1] = DAT_00c35e7c; layer->_blendMode[2] = DAT_00c35e80; layer->_blendMode[3] = DAT_00c35e84; layer->_blendMode[4] = DAT_00c35e88; } while (nameCursor < (byte *)(this->_DifficultyOverlaySprite)._layerCount); } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x30); anmPath._size = 0x23; anmPath._capacity = 0x2f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/CharacterMenu.anm2",0x24); local_14 = 6; ANM2::Load(&this->_GreedDecoOverlaySprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } nameCursor = (this->_GreedDecoOverlaySprite)._animState._animData; if (nameCursor == (byte *)0x0) { LAB_00948a03: bVar1 = ANM2::SetAnimation(&this->_GreedDecoOverlaySprite,(byte *)"Greed",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_GreedDecoOverlaySprite)._animState); (this->_GreedDecoOverlaySprite)._animState._isPlaying = 1; } } else { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } pcVar6 = "Greed"; do { bVar1 = *nameCursor; bVar4 = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_009489f0: uVar2 = -(uint)bVar4 | 1; goto LAB_009489f5; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_009489f0; nameCursor = nameCursor + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009489f5: if ((uVar2 != 0) || ((nameCursor[0x34] != 0 && ((this->_GreedDecoOverlaySprite)._animState._isPlaying == 0)))) goto LAB_00948a03; } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = (void *)0x0; nameCursor = (&PTR_s_gfx_ui_main_menu_CharacterPortra_00b24124)[this->_characterMenuShown * 3]; nameCursor = nameCursor; do { bVar1 = *nameCursor; nameCursor = nameCursor + 1; } while (bVar1 != 0); std::string::assign(anmPath._buf,nameCursor,(int)nameCursor - (int)(nameCursor + 1)); local_14 = 7; ANM2::Load(&this->_CharacterPortraitsSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pvVar5 = (void *)anmPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if (0x1f < (uint)(anmPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } nameCursor = (this->_CharacterPortraitsSprite)._animState._animData; if (nameCursor == (byte *)0x0) { LAB_00948b05: bVar1 = ANM2::SetAnimation(&this->_CharacterPortraitsSprite,&DAT_00b7bbf0,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_CharacterPortraitsSprite)._animState); (this->_CharacterPortraitsSprite)._animState._isPlaying = 1; } } else { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } expectedName = &DAT_00b7bbf0; do { bVar1 = *nameCursor; bVar4 = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_00948af2: uVar2 = -(uint)bVar4 | 1; goto LAB_00948af7; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00948af2; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00948af7: if ((uVar2 != 0) || ((nameCursor[0x34] != 0 && ((this->_CharacterPortraitsSprite)._animState._isPlaying == 0)))) goto LAB_00948b05; } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x20); anmPath._size = 0x1f; anmPath._capacity = 0x1f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/SeedEntry.anm2",0x20); local_14 = 8; ANM2::Load(&this->_SeedEntrySprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } nameCursor = (this->_SeedEntrySprite)._animState._animData; if (nameCursor != (byte *)0x0) { nameCursor = nameCursor; if (0xf < *(uint *)(nameCursor + 0x14)) { nameCursor = *(byte **)nameCursor; } expectedName = s_Idle; do { bVar1 = *nameCursor; bVar4 = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_00948c20: uVar2 = -(uint)bVar4 | 1; goto LAB_00948c25; } if (bVar1 == 0) break; bVar1 = nameCursor[1]; bVar4 = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00948c20; nameCursor = nameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00948c25: if ((uVar2 == 0) && ((nameCursor[0x34] == 0 || ((this->_SeedEntrySprite)._animState._isPlaying != 0)))) goto LAB_00948c51; } bVar1 = ANM2::SetAnimation(&this->_SeedEntrySprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_SeedEntrySprite)._animState); (this->_SeedEntrySprite)._animState._isPlaying = 1; } LAB_00948c51: anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x30); anmPath._size = 0x26; anmPath._capacity = 0x2f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/DifficultyWidget.anm2",0x27); local_14 = 9; ANM2::Load(&this->_DifficultyPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pcVar6 = (char *)anmPath._buf._0_4_; if (0xfff < uVar2) { pcVar6 = *(char **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar6,uVar2); } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = anmPath._buf._0_4_ & 0xffffff00; if (((g_manager->_persistentGameData)._achievements[0x155] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { bVar4 = false; } else { bVar4 = true; } pcVar6 = "Unlocked"; if (bVar4) { pcVar6 = &DAT_00b7bdc8; } ANM2::Play(&this->_DifficultyPageSprite,(byte *)pcVar6,0); anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = (void *)0x0; std::string::assign(anmPath._buf,(byte *)"gfx/ui/main menu/SeedWidget.anm2",0x20); local_14 = 10; ANM2::Load(&this->_SeedPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pvVar5 = (void *)anmPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if (0x1f < (uint)(anmPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } ANM2::Play(&this->_SeedPageSprite,s_Idle,0); anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = (void *)0x0; std::string::assign(anmPath._buf,(byte *)"gfx/ui/main menu/WinStreakWidget.anm2",0x25); local_14 = 0xb; ANM2::Load(&this->_WinStreakPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pvVar5 = (void *)anmPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if (0x1f < (uint)(anmPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } ANM2::Play(&this->_WinStreakPageSprite,s_Idle,0); anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf._0_4_ = (void *)0x0; std::string::assign(anmPath._buf,(byte *)"gfx/ui/main menu/SeedSelectionWidget.anm2",0x29); local_14 = 0xc; ANM2::Load(&this->_EastereggPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar2 = anmPath._capacity + 1; pvVar5 = (void *)anmPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(anmPath._buf._0_4_ + -4); uVar2 = anmPath._capacity + 0x24; if (0x1f < (uint)(anmPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } ANM2::Play(&this->_EastereggPageSprite,&DAT_00b7bd88,0); seedUnlockPath._size = 0; seedUnlockPath._capacity = 0xf; seedUnlockPath._buf._0_4_ = (void *)0x0; std::string::assign(seedUnlockPath._buf,(byte *)"gfx/ui/main menu/SeedUnlockPaper.anm2",0x25); local_14 = 0xd; ANM2::Load(&this->_SeedUnlockPageSprite,&seedUnlockPath,1); if (0xf < seedUnlockPath._capacity) { uVar2 = seedUnlockPath._capacity + 1; pvVar5 = (void *)seedUnlockPath._buf._0_4_; if (0xfff < uVar2) { pvVar5 = *(void **)(seedUnlockPath._buf._0_4_ + -4); uVar2 = seedUnlockPath._capacity + 0x24; if (0x1f < (uint)(seedUnlockPath._buf._0_4_ + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } ExceptionList = local_1c; return; } //@@ 00948fc0 Menu_Character::Reset /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Menu_Character (sets Status=0, _DifficultyPageSprite), anims Appear/Disappear/Unlocked/"AB+", Seeds::String2Seed+set_start_seed, DoPageSwap, IsCharacterAvailable; zhl lists Reset() as the only no-arg method left unnamed prototype: REPENTOGON */ void __thiscall Menu_Character::Reset(Menu_Character *this) { byte bVar1; byte *curAnimName; uint uVar2; int *playerConfig; void *pvVar3; char *pcVar4; byte *extraout_ECX; byte *extraout_ECX_00; byte *extraout_ECX_01; std_string *seedTextBuf; undefined **characterEntry; int *modCharactersEnd; undefined4 *fillSrc; int iVar5; std_vector *playerConfigs; undefined4 *fillDst; bool isLess; undefined1 auVar6 [12]; undefined1 auVar7 [16]; float fVar8; float fVar9; void *seedString [4]; uint seedStringSize; uint seedStringCapacity; undefined4 defaultPortraitX; Menu_Character *local_3c; float local_38; void *emptyString [4]; undefined4 emptyStringSize; uint emptyStringCapacity; int modCharacterId; float local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; byte *animData; Manager *manager; MenuManager *menuManager; undefined4 *portraitPositions; manager = g_manager; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0b805; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(emptyString + 0xc); ExceptionList = &local_10; this->Status = 0; local_3c = this; if (((manager->_persistentGameData)._achievements[0x155] == 0) && (((manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { animData = (this->_DifficultyPageSprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } pcVar4 = "Unlocked"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_00949062: uVar2 = -(uint)isLess | 1; goto LAB_00949067; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)pcVar4[1]; if (bVar1 != pcVar4[1]) goto LAB_00949062; curAnimName = curAnimName + 2; pcVar4 = pcVar4 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00949067: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_DifficultyPageSprite)._animState._isPlaying != 0)))) goto LAB_00949100; } pcVar4 = "Unlocked"; } else { animData = (this->_DifficultyPageSprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } pcVar4 = &DAT_00b7bdc8; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*pcVar4; if (bVar1 != *pcVar4) { LAB_009490c2: uVar2 = -(uint)isLess | 1; goto LAB_009490c7; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)pcVar4[1]; if (bVar1 != pcVar4[1]) goto LAB_009490c2; curAnimName = curAnimName + 2; pcVar4 = pcVar4 + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009490c7: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_DifficultyPageSprite)._animState._isPlaying != 0)))) goto LAB_00949100; } pcVar4 = &DAT_00b7bdc8; } bVar1 = ANM2::SetAnimation(&this->_DifficultyPageSprite,(byte *)pcVar4,1); pcVar4 = (char *)extraout_ECX; if (bVar1 != 0) { AnimationState::Rewind(&(this->_DifficultyPageSprite)._animState); (this->_DifficultyPageSprite)._animState._isPlaying = 1; pcVar4 = (char *)extraout_ECX_00; } LAB_00949100: menuManager = g_menuManager; auVar6 = ZEXT812(0); if (this->Status == 1) { auVar6 = ZEXT812(0xc3f00000); } auVar7._12_4_ = 0; auVar7._0_12_ = auVar6; g_menuManager->_viewPositionSet[5].x = auVar6._0_4_; characterEntry = &PTR_s_00_Random_00b24140; menuManager->_state = 1; iVar5 = 0x12; this->SelectedCharacterID = 1; this->_numCharacters = 0; do { if ((*(char *)(characterEntry + 2) == '\0') || (bVar1 = Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *)characterEntry,(int)pcVar4), pcVar4 = (char *)extraout_ECX_01, bVar1 != 0)) { this->_numCharacters = this->_numCharacters + 1; } characterEntry = characterEntry + 6; iVar5 = iVar5 + -1; } while (iVar5 != 0); playerConfigs = &(g_manager->_entityConfig)._players; DAT_00c79888 = g_modCharacters; local_38 = 5.74532e-44; modCharactersEnd = g_modCharacters; if (0x29 < (uint)(((int)(g_manager->_entityConfig)._players._end - (int)playerConfigs->_begin) / 0x148)) { iVar5 = 0x3488; do { playerConfig = (int *)((int)playerConfigs->_begin + iVar5); if (((char)playerConfig[0x4a] == '\0') && (playerConfig[0x47] == 0)) { modCharacterId = *playerConfig; local_18 = (float)playerConfig[0x49]; if (modCharactersEnd == DAT_00c7988c) { std::vector<8byte>::_Emplace_reallocate_global(modCharactersEnd,&modCharacterId); modCharactersEnd = DAT_00c79888; } else { *modCharactersEnd = modCharacterId; modCharactersEnd[1] = (int)local_18; DAT_00c79888 = DAT_00c79888 + 2; modCharactersEnd = DAT_00c79888; } } local_38 = (float)((int)local_38 + 1); playerConfigs = &(g_manager->_entityConfig)._players; iVar5 = iVar5 + 0x148; } while ((uint)local_38 < (uint)(((int)(g_manager->_entityConfig)._players._end - (int)playerConfigs->_begin) / 0x148)); this = local_3c; } iVar5 = ((int)modCharactersEnd - (int)g_modCharacters >> 3) + this->_numCharacters; this->_numCharacters = iVar5; FUN_0094e3b0(); fVar8 = (float)auVar7._0_8_ * 0.01 + 2.0; this->_characterWheelDepth = fVar8; local_38 = (fVar8 - 1.0) * 0.5; local_18 = local_38 + 1.0; local_3c = (Menu_Character *)(local_38 / local_18); fVar8 = sqrtf(1.0 - (float)local_3c * (float)local_3c); portraitPositions = (this->_portraitPositions)._begin; (this->_portraitPositions)._end = portraitPositions; fVar9 = local_18 - (float)local_3c * local_38; local_18 = (float)this->_numCharacters; fVar8 = (fVar9 * 1.3) / fVar8; this->_characterWheelWidth = fVar8; defaultPortraitX = 0x43700000; this->_scrollSpeed = (360.0 / (float)iVar5) / (fVar8 * 50.0); local_3c = (Menu_Character *)0x43070000; if (local_18 != 0.0) { if ((uint)((int)(this->_portraitPositions)._capacity - (int)portraitPositions >> 3) < (uint)local_18) { std::vector::_Resize_reallocate(local_18,&defaultPortraitX); } else { *portraitPositions = 0x43700000; portraitPositions[1] = 0x43070000; fillSrc = portraitPositions; fillDst = portraitPositions + 2; for (uVar2 = (int)local_18 * 8 - 5U >> 2; uVar2 != 0; uVar2 = uVar2 - 1) { *fillDst = *fillSrc; fillSrc = fillSrc + 1; fillDst = fillDst + 1; } (this->_portraitPositions)._end = portraitPositions + (int)local_18 * 2; } } pvVar3 = (this->_portraitScales)._begin; (this->_portraitScales)._end = pvVar3; uVar2 = this->_numCharacters; local_38 = 1.0; if (uVar2 != 0) { if ((uint)((int)(this->_portraitScales)._capacity - (int)pvVar3 >> 2) < uVar2) { std::vector::_Resize_reallocate(uVar2,&local_38); } else { pvVar3 = (void *)std::fill_n<4byte>(pvVar3,uVar2,&local_38); (this->_portraitScales)._end = pvVar3; } } this->IsCharacterUnlocked = 1; this->IsInputPossible = 1; this->CooldownWhenHoldDirection = 10; *(undefined4 *)&this->field_0x14 = 0; iVar5 = this->_numCharacters + -1; seedTextBuf = &this->_seedText; this->_numCharacters_MINUS_SelectedEntry = iVar5; manager = g_manager; this->_randomRotationVelocity = 0.0; this->_horizontalScrollPosition = ((float)iVar5 * 360.0) / (float)this->_numCharacters; this->Difficulty = (manager->_persistentGameData)._lastDifficulty; if (0xf < (this->_seedText)._capacity) { seedTextBuf = *(std_string **)(this->_seedText)._buf; } (this->_seedText)._size = 0; seedTextBuf->_buf[0] = '\0'; menuManager = g_menuManager; emptyStringCapacity = 0xf; emptyStringSize = 0; emptyString[0] = (void *)0x0; local_8 = (void *)0x0; std::string::string((char *)seedString,emptyString); local_8._0_1_ = 1; uVar2 = Seeds::String2Seed((std_string *)seedString); Seeds::set_start_seed(&menuManager->_seedsObject,uVar2); local_8 = (void *)((uint)local_8._1_3_ << 8); if (0xf < seedStringCapacity) { uVar2 = seedStringCapacity + 1; pvVar3 = seedString[0]; if (0xfff < uVar2) { pvVar3 = *(void **)((int)seedString[0] + -4); uVar2 = seedStringCapacity + 0x24; if (0x1f < (uint)((int)seedString[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } local_8 = (void *)0xffffffff; seedStringSize = 0; seedStringCapacity = 0xf; seedString[0] = (void *)((uint)seedString[0] & 0xffffff00); if (0xf < emptyStringCapacity) { uVar2 = emptyStringCapacity + 1; pvVar3 = emptyString[0]; if (0xfff < uVar2) { pvVar3 = *(void **)((int)emptyString[0] + -4); uVar2 = emptyStringCapacity + 0x24; if (0x1f < (uint)((int)emptyString[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar2); } set_character_menu_shown(this,(g_manager->_persistentGameData)._characterMenuShown); if ((g_manager->_persistentGameData)._characterMenuShown < 1) { pcVar4 = "Disappear"; } else { pcVar4 = "Appear"; } bVar1 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,(byte *)pcVar4,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } if ((this->_TaintedMenuBGDecoSprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_TaintedMenuBGDecoSprite)._animState, *(int *)((int)(this->_TaintedMenuBGDecoSprite)._animState._animData + 0x30) + -1); } if (((this->_PageSwapWidgetSprite)._color._tint[3] == 0.0) && (this->_characterMenuShown != 0)) { DoPageSwap(this); } this->_seedUnlockPageState = 0; this->_seedUnlockPageTimer = 0; std::string::assign(&this->field_0xd84,&s_empty,0); std::string::assign(&this->field_0xd9c,&s_empty,0); ExceptionList = local_10; return; } //@@ 009495f0 Menu_Character::set_character_menu_shown /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: writes _characterMenuShown=param_1, loads CharacterMenu anm2 from table 00b24120[param*3] into _BigCharPageSprite and plays the selected character's page anim; Menu_Character::Reset/Update, MenuManager::SetState prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Menu_Character::set_character_menu_shown(Menu_Character *this,int characterMenuShown) { HWND hWnd; byte bVar1; LayerState *layer; std_string *psVar2; int iconHeight; int iconWidth; HMODULE module; LPARAM smallIcon; byte *strCursor; char *expectedName; void *freeBlock; byte *expectedAnim; Manager *extraout_ECX; Manager *manager; uint uVar3; code *loadImageFn; byte *pbVar4; bool isLess; std_string local_50; HANDLE bigIcon; HWND window; std_string local_30; uint stackCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; ANM2 *difficultyOverlaySprite; int *enabledLayers; undefined4 iconResourceId; local_8 = 0xffffffff; puStack_c = &LAB_00b0b84d; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)((int)register0x00000010 + 0xfffffffcU); ExceptionList = &local_10; this->_characterMenuShown = characterMenuShown; local_30._size = 0; local_30._capacity = 0xf; pbVar4 = (&PTR_s_gfx_ui_main_menu_CharacterMenu_a_00b24120)[characterMenuShown * 3]; local_30._buf._0_4_ = (void *)0x0; strCursor = pbVar4; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); std::string::assign(local_30._buf,pbVar4,(int)strCursor - (int)(pbVar4 + 1)); local_8 = 0; ANM2::Load(&this->_BigCharPageSprite,&local_30,1); local_8 = 0xffffffff; if (0xf < local_30._capacity) { uVar3 = local_30._capacity + 1; freeBlock = (void *)local_30._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(void **)(local_30._buf._0_4_ + -4); uVar3 = local_30._capacity + 0x24; if (0x1f < (uint)(local_30._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } if ((uint)this->SelectedCharacterID < 0x12) { ANM2::Play(&this->_BigCharPageSprite, (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6],0); } else { pbVar4 = (this->_BigCharPageSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { strCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { strCursor = *(byte **)pbVar4; } expectedAnim = &DAT_00b7bbf0; do { bVar1 = *strCursor; isLess = bVar1 < *expectedAnim; if (bVar1 != *expectedAnim) { LAB_00949715: uVar3 = -(uint)isLess | 1; goto LAB_0094971a; } if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < expectedAnim[1]; if (bVar1 != expectedAnim[1]) goto LAB_00949715; strCursor = strCursor + 2; expectedAnim = expectedAnim + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094971a: if ((uVar3 == 0) && ((pbVar4[0x34] == 0 || ((this->_BigCharPageSprite)._animState._isPlaying != 0)))) goto LAB_0094974d; } bVar1 = ANM2::SetAnimation(&this->_BigCharPageSprite,&DAT_00b7bbf0,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_BigCharPageSprite)._animState); (this->_BigCharPageSprite)._animState._isPlaying = 1; } } LAB_0094974d: UpdateRotations(this); difficultyOverlaySprite = &this->_DifficultyOverlaySprite; local_30._size = 0; local_30._capacity = 0xf; local_30._buf._0_4_ = (void *)0x0; pbVar4 = (&PTR_s_gfx_ui_main_menu_CharacterMenu_a_00b24120)[this->_characterMenuShown * 3]; strCursor = pbVar4; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); std::string::assign(local_30._buf,pbVar4,(int)strCursor - (int)(pbVar4 + 1)); local_8 = 1; ANM2::Load(difficultyOverlaySprite,&local_30,1); local_8 = 0xffffffff; if (0xf < local_30._capacity) { uVar3 = local_30._capacity + 1; freeBlock = (void *)local_30._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(void **)(local_30._buf._0_4_ + -4); uVar3 = local_30._capacity + 0x24; if (0x1f < (uint)(local_30._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } pbVar4 = (this->_DifficultyOverlaySprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_00949835: bVar1 = ANM2::SetAnimation(difficultyOverlaySprite,(byte *)"BloodStain",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_DifficultyOverlaySprite)._animState); (this->_DifficultyOverlaySprite)._animState._isPlaying = 1; } } else { strCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { strCursor = *(byte **)pbVar4; } expectedName = "BloodStain"; do { bVar1 = *strCursor; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_00949822: uVar3 = -(uint)isLess | 1; goto LAB_00949827; } if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_00949822; strCursor = strCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00949827: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((this->_DifficultyOverlaySprite)._animState._isPlaying == 0)))) goto LAB_00949835; } pbVar4 = (byte *)0x0; if ((this->_DifficultyOverlaySprite)._layerCount != 0) { do { layer = ANM2::GetLayer(difficultyOverlaySprite,pbVar4); pbVar4 = pbVar4 + 1; layer->_blendMode[0] = DAT_00c35e78; layer->_blendMode[1] = DAT_00c35e7c; layer->_blendMode[2] = DAT_00c35e80; layer->_blendMode[3] = DAT_00c35e84; layer->_blendMode[4] = DAT_00c35e88; } while (pbVar4 < (byte *)(this->_DifficultyOverlaySprite)._layerCount); } local_30._size = 0; local_30._capacity = 0xf; local_30._buf._0_4_ = (void *)0x0; pbVar4 = (&PTR_s_gfx_ui_main_menu_CharacterPortra_00b24124)[this->_characterMenuShown * 3]; strCursor = pbVar4; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); std::string::assign(local_30._buf,pbVar4,(int)strCursor - (int)(pbVar4 + 1)); local_8 = 2; ANM2::Load(&this->_CharacterPortraitsSprite,&local_30,1); local_8 = 0xffffffff; if (0xf < local_30._capacity) { uVar3 = local_30._capacity + 1; freeBlock = (void *)local_30._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(void **)(local_30._buf._0_4_ + -4); uVar3 = local_30._capacity + 0x24; if (0x1f < (uint)(local_30._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } pbVar4 = (this->_CharacterPortraitsSprite)._animState._animData; local_30._size = 0; local_30._capacity = 0xf; local_30._buf._0_4_ = local_30._buf._0_4_ & 0xffffff00; if (pbVar4 != (byte *)0x0) { strCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { strCursor = *(byte **)pbVar4; } expectedAnim = &DAT_00b7bbf0; do { bVar1 = *strCursor; isLess = bVar1 < *expectedAnim; if (bVar1 != *expectedAnim) { LAB_00949990: uVar3 = -(uint)isLess | 1; goto LAB_00949995; } if (bVar1 == 0) break; bVar1 = strCursor[1]; isLess = bVar1 < expectedAnim[1]; if (bVar1 != expectedAnim[1]) goto LAB_00949990; strCursor = strCursor + 2; expectedAnim = expectedAnim + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00949995: if ((uVar3 == 0) && ((pbVar4[0x34] == 0 || ((this->_CharacterPortraitsSprite)._animState._isPlaying != 0)))) goto LAB_009499c1; } bVar1 = ANM2::SetAnimation(&this->_CharacterPortraitsSprite,&DAT_00b7bbf0,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_CharacterPortraitsSprite)._animState); (this->_CharacterPortraitsSprite)._animState._isPlaying = 1; } LAB_009499c1: manager = g_manager; (g_manager->_persistentGameData)._characterMenuShown = characterMenuShown; *(undefined1 *)&manager->_persistentGameData = 1; if (characterMenuShown < 1) { local_50._buf[0] = '\0'; local_50._buf[1] = '\0'; local_50._buf[2] = -0x80; local_50._buf[3] = '?'; local_50._buf[4] = '\0'; local_50._buf[5] = '\0'; local_50._buf[6] = -0x80; local_50._buf[7] = '?'; local_50._buf[8] = '\0'; local_50._buf[9] = '\0'; local_50._buf[10] = -0x80; local_50._buf[0xb] = '?'; local_50._buf[0xc] = '\0'; local_50._buf[0xd] = '\0'; local_50._buf[0xe] = '\0'; local_50._buf[0xf] = '\0'; local_50._size = 0; local_50._capacity = 0x3f800000; enabledLayers = &(manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]. _enabledLayers; *enabledLayers = *enabledLayers & 0xfffffffe; psVar2 = &local_50; } else { MusicManager::EnableLayer(&manager->_musicManager,0,0); psVar2 = &local_30; local_30._buf._0_4_ = (void *)0x3f800000; local_30._buf[4] = '\n'; local_30._buf[5] = -0x29; local_30._buf[6] = -0x7d; local_30._buf[7] = '?'; local_30._buf[8] = -0x33; local_30._buf[9] = -0x34; local_30._buf[10] = -0x74; local_30._buf[0xb] = '?'; local_30._buf[0xc] = -0x66; local_30._buf[0xd] = -0x67; local_30._buf[0xe] = -0x67; local_30._buf[0xf] = '>'; local_30._size = 0xbe19999a; local_30._capacity = 0x3f666666; manager = extraout_ECX; } FUN_0098afa0(psVar2,manager); if (_glfw == 0) { _glfwInputError(0x10001,0); window = (HWND)0x0; } else if (DAT_00c73694 == 0x60001) { window = *(HWND *)((int)g_glfwWindow + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized"); window = (HWND)0x0; } iconHeight = GetSystemMetrics(0xc); iconWidth = GetSystemMetrics(0xb); if (characterMenuShown < 1) { module = GetModuleHandleA((LPCSTR)0x0); loadImageFn = LoadImageA_exref; bigIcon = LoadImageA(module,&DAT_00000065,1,iconWidth,iconHeight,0); iconHeight = GetSystemMetrics(0x32); iconWidth = GetSystemMetrics(0x31); module = GetModuleHandleA((LPCSTR)0x0); iconResourceId = 0x65; } else { module = GetModuleHandleA((LPCSTR)0x0); loadImageFn = LoadImageA_exref; bigIcon = LoadImageA(module,&DAT_00000068,1,iconWidth,iconHeight,0); iconHeight = GetSystemMetrics(0x32); iconWidth = GetSystemMetrics(0x31); module = GetModuleHandleA((LPCSTR)0x0); iconResourceId = 0x68; } smallIcon = (*loadImageFn)(module,iconResourceId,1,iconWidth,iconHeight,0); hWnd = window; SendMessageA(window,0x80,0,smallIcon); SendMessageA(hWnd,0x80,1,(LPARAM)bigIcon); ExceptionList = local_10; return; } //@@ 00949b70 FUN_00949b70 void FUN_00949b70(void) { uint in_ECX; int in_EDX; Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *) (&PTR_s_00_Random_00b24140 + (in_EDX + (in_ECX & 0xff) * 0x12) * 6),in_ECX); return; } //@@ 00949b90 FUN_00949b90 int FUN_00949b90(void) { uint in_ECX; int in_EDX; if (in_EDX < 0x12) { return *(int *)(&DAT_00b24144 + (in_EDX + (in_ECX & 0xff) * 0x12) * 0x18); } return g_modCharacters[(in_ECX & 0xff) + in_EDX * 2 + -0x24]; } //@@ 00949bc0 FUN_00949bc0 void FUN_00949bc0(undefined4 param_1) { int *piVar1; int in_ECX; uint *in_EDX; int *piVar2; int iVar3; uint uVar4; uint uVar5; iVar3 = 0; piVar2 = &DAT_00b2415c; uVar5 = 0; do { uVar4 = 1; piVar1 = piVar2; do { if (*piVar1 == in_ECX) { *in_EDX = uVar4; *(bool *)param_1 = iVar3 == 1; return; } uVar4 = uVar4 + 1; piVar1 = piVar1 + 6; } while (uVar4 < 0x12); uVar5 = uVar5 + 0x1b0; iVar3 = iVar3 + 1; piVar2 = piVar2 + 0x6c; } while (uVar5 < 0x360); return; } //@@ 00949c20 Menu_Character::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Menu_Character::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Character::Update(Menu_Character *this) { Seeds unk; byte bVar1; int *steamContext; std_string *a; byte *animNameCursor; Manager *this_00; void *ptr; char *expectedNameText; int iVar2; byte *expectedName; uint uVar3; PersistentGameData *persistentGameData; bool isLess; float frame; Seeds aSStackY_2ef0 [128]; undefined1 in_stack_ffffff6c [68]; undefined4 in_stack_ffffffb0; int in_stack_ffffffb4; undefined4 in_stack_ffffffb8; undefined4 in_stack_ffffffbc; undefined4 in_stack_ffffffc0; int in_stack_ffffffc4; byte *pbVar4; int difficulty; int soundId; void *animName [5]; uint animNameCapacity; void *local_8; uint *animNameSize; Manager *manager; local_8 = (void *)(__security_cookie ^ (uint)(animName + 7)); if ((g_manager->_framecount & 1) == 0) { if ((this->_BigCharPageSprite)._loaded != 0) { AnimationState::Update(&(this->_BigCharPageSprite)._animState); AnimationState::Update(&(this->_BigCharPageSprite)._overlayAnimState); } if ((this->_CharacterMenuBGSprite)._loaded != 0) { AnimationState::Update(&(this->_CharacterMenuBGSprite)._animState); AnimationState::Update(&(this->_CharacterMenuBGSprite)._overlayAnimState); } if ((this->_DifficultyPageSprite)._loaded != 0) { AnimationState::Update(&(this->_DifficultyPageSprite)._animState); AnimationState::Update(&(this->_DifficultyPageSprite)._overlayAnimState); } if ((this->_SeedPageSprite)._loaded != 0) { AnimationState::Update(&(this->_SeedPageSprite)._animState); AnimationState::Update(&(this->_SeedPageSprite)._overlayAnimState); } if ((this->_WinStreakPageSprite)._loaded != 0) { AnimationState::Update(&(this->_WinStreakPageSprite)._animState); AnimationState::Update(&(this->_WinStreakPageSprite)._overlayAnimState); } if ((this->_DifficultyOverlaySprite)._loaded != 0) { AnimationState::Update(&(this->_DifficultyOverlaySprite)._animState); AnimationState::Update(&(this->_DifficultyOverlaySprite)._overlayAnimState); } if ((this->_EastereggPageSprite)._loaded != 0) { AnimationState::Update(&(this->_EastereggPageSprite)._animState); AnimationState::Update(&(this->_EastereggPageSprite)._overlayAnimState); } if ((this->_SeedUnlockPageSprite)._loaded != 0) { AnimationState::Update(&(this->_SeedUnlockPageSprite)._animState); AnimationState::Update(&(this->_SeedUnlockPageSprite)._overlayAnimState); } switch(this->Difficulty) { case 0: if ((this->_DifficultyPageSprite)._animState._animData != (void *)0x0) { frame = 0.0; code_r0x00949d90: AnimationState::SetFrameFloat(&(this->_DifficultyPageSprite)._animState,frame); } break; case 1: if ((this->_DifficultyPageSprite)._animState._animData != (void *)0x0) { frame = 1.0; goto code_r0x00949d90; } break; case 2: if ((this->_DifficultyPageSprite)._animState._animData != (void *)0x0) { frame = 2.0; goto code_r0x00949d90; } break; case 3: if ((this->_DifficultyPageSprite)._animState._animData != (void *)0x0) { frame = 3.0; goto code_r0x00949d90; } } if ((this->Status == 1) && ((this->_SeedEntrySprite)._loaded != 0)) { AnimationState::Update(&(this->_SeedEntrySprite)._animState); AnimationState::Update(&(this->_SeedEntrySprite)._overlayAnimState); } if ((this->_TaintedMenuBGDecoSprite)._loaded != 0) { AnimationState::Update(&(this->_TaintedMenuBGDecoSprite)._animState); AnimationState::Update(&(this->_TaintedMenuBGDecoSprite)._overlayAnimState); } if ((this->_PageSwapWidgetSprite)._loaded != 0) { AnimationState::Update(&(this->_PageSwapWidgetSprite)._animState); AnimationState::Update(&(this->_PageSwapWidgetSprite)._overlayAnimState); } if ((this->_CharacterMenuBGSprite)._animState._animData != (void *)0x0) { in_stack_ffffffc4 = 0x949e16; bVar1 = AnimationState::IsEventTriggered (&(this->_CharacterMenuBGSprite)._animState,(byte *)"Sound"); manager = g_manager; if (bVar1 != 0) { soundId = 0x23b; seed_fart_sound_override(&soundId); in_stack_ffffffc4 = 0x3f800000; in_stack_ffffffc0 = 0; in_stack_ffffffbc = 2; in_stack_ffffffb8 = 0x3f800000; in_stack_ffffffb0 = 0x949e5b; in_stack_ffffffb4 = soundId; SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); } } } if (this->Status == 3) { if (1.0 < g_menuManager->_fadeOutProgress) { if (this->SelectedCharacterID == 10) { in_stack_ffffffc4 = 0x15; in_stack_ffffffc0 = 0x949ea9; PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x15,-1); } if ((g_manager->_gamestate)._isSaveAvailable != 0) { in_stack_ffffffc4 = 0x16; in_stack_ffffffc0 = 0x949ecb; PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,0x16, -(g_manager->_persistentGameData)._eventCounters[0x16]); } persistentGameData = &g_manager->_persistentGameData; if ((*(char *)persistentGameData != '\0') && ((g_manager->_persistentGameData)._isFileLoaded != 0)) { *(undefined1 *)persistentGameData = 0; Manager::BackupSaveFile((Manager *)persistentGameData); manager = g_manager; in_stack_ffffffc4 = 0x949efd; steamContext = (int *)SteamInternal_ContextInit(); if ((*steamContext == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(persistentGameData); } else { PersistentGameData::SaveToSteamCloud(persistentGameData); } } iVar2 = this->SelectedCharacterID; if (iVar2 < 0x12) { iVar2 = *(int *)(&DAT_00b24144 + ((-(uint)(this->_characterMenuShown != 0) & 0x12) + iVar2) * 0x18); } else { iVar2 = *(int *)((int)g_modCharacters + ((-(uint)(this->_characterMenuShown != 0) & 4) - 0x90) + iVar2 * 8); } difficulty = this->Difficulty; Seeds::construct_from_copy(aSStackY_2ef0 + 0x81,&g_menuManager->_seedsObject); unk._stageSeeds[0xb] = in_stack_ffffffb0; unk._isCustomRun = in_stack_ffffff6c[0]; unk._1_3_ = in_stack_ffffff6c._1_3_; unk._gameStartSeed = in_stack_ffffff6c._4_4_; unk._rng._seed = in_stack_ffffff6c._8_4_; unk._rng._shift1 = in_stack_ffffff6c._12_4_; unk._rng._shift2 = in_stack_ffffff6c._16_4_; unk._rng._shift3 = in_stack_ffffff6c._20_4_; unk._stageSeeds[0] = in_stack_ffffff6c._24_4_; unk._stageSeeds[1] = in_stack_ffffff6c._28_4_; unk._stageSeeds[2] = in_stack_ffffff6c._32_4_; unk._stageSeeds[3] = in_stack_ffffff6c._36_4_; unk._stageSeeds[4] = in_stack_ffffff6c._40_4_; unk._stageSeeds[5] = in_stack_ffffff6c._44_4_; unk._stageSeeds[6] = in_stack_ffffff6c._48_4_; unk._stageSeeds[7] = in_stack_ffffff6c._52_4_; unk._stageSeeds[8] = in_stack_ffffff6c._56_4_; unk._stageSeeds[9] = in_stack_ffffff6c._60_4_; unk._stageSeeds[10] = in_stack_ffffff6c._64_4_; unk._stageSeeds[0xc] = in_stack_ffffffb4; unk._stageSeeds[0xd] = in_stack_ffffffb8; unk._playerInitSeed = in_stack_ffffffbc; unk._seedEffects = (void *)in_stack_ffffffc0; unk._seedEffectsCount = in_stack_ffffffc4; Manager::StartNewGame(this_00,iVar2,0,unk,difficulty); } } else { if (this->Status != 2) { handle_input(this); } UpdateRotations(this); } if ((this->Status == 4) && (((this->_CharacterMenuBGSprite)._animState._animData == (void *)0x0 || ((this->_CharacterMenuBGSprite)._animState._isPlaying == 0)))) { a = ANM2::GetAnimation((ANM2 *)&(this->_CharacterMenuBGSprite)._animState,(std_string *)animName ); animNameSize = &a->_size; if (0xf < a->_capacity) { a = *(std_string **)a->_buf; } bVar1 = str_eq((byte *)a,*animNameSize,(byte *)"SwapOut",7); if (0xf < animNameCapacity) { uVar3 = animNameCapacity + 1; ptr = animName[0]; if (0xfff < uVar3) { ptr = *(void **)((int)animName[0] + -4); uVar3 = animNameCapacity + 0x24; if (0x1f < (uint)((int)animName[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } if (bVar1 == 0) { ANM2::Play(&this->_CharacterMenuBGSprite,s_Idle,0); } else { set_character_menu_shown(this,1 - this->_characterMenuShown); render_page_snapshot(); ANM2::Play(&this->_CharacterMenuBGSprite,(byte *)"SwapIn",0); manager = g_manager; soundId = 8; seed_fart_sound_override(&soundId); SoundEffects::Play(&manager->_sfxManager,soundId,1.0,2,0,1.0,0.0); } this->Status = 0; } if (((this->_CharacterMenuBGSprite)._animState._animData == (void *)0x0) || ((this->_CharacterMenuBGSprite)._animState._isPlaying == 0)) { pbVar4 = (this->_CharacterMenuBGSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedName = s_Idle; do { bVar1 = *animNameCursor; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0094a0d8: uVar3 = -(uint)isLess | 1; goto LAB_0094a0dd; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0094a0d8; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a0dd: if ((uVar3 == 0) && ((pbVar4[0x34] == 0 || ((this->_CharacterMenuBGSprite)._animState._isPlaying != 0)))) goto LAB_0094a116; } bVar1 = ANM2::SetAnimation(&this->_CharacterMenuBGSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._animState); (this->_CharacterMenuBGSprite)._animState._isPlaying = 1; } } else { render_page_snapshot(); } LAB_0094a116: iVar2 = this->_seedUnlockPageState; if (iVar2 == 1) { pbVar4 = (this->_SeedUnlockPageSprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0094a176: bVar1 = ANM2::SetAnimation(&this->_SeedUnlockPageSprite,(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_SeedUnlockPageSprite)._animState); (this->_SeedUnlockPageSprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedNameText = "Appear"; do { bVar1 = *animNameCursor; isLess = bVar1 < (byte)*expectedNameText; if (bVar1 != *expectedNameText) { LAB_0094a160: uVar3 = -(uint)isLess | 1; goto LAB_0094a165; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < (byte)expectedNameText[1]; if (bVar1 != expectedNameText[1]) goto LAB_0094a160; animNameCursor = animNameCursor + 2; expectedNameText = expectedNameText + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a165: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((this->_SeedUnlockPageSprite)._animState._isPlaying == 0)))) goto LAB_0094a176; } if (((this->_SeedUnlockPageSprite)._animState._animData == (void *)0x0) || ((this->_SeedUnlockPageSprite)._animState._isPlaying == 0)) { this->_seedUnlockPageState = 2; } } else if (iVar2 == 2) { pbVar4 = (this->_SeedUnlockPageSprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0094a21b: bVar1 = ANM2::SetAnimation(&this->_SeedUnlockPageSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_SeedUnlockPageSprite)._animState); (this->_SeedUnlockPageSprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedName = s_Idle; do { bVar1 = *animNameCursor; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0094a205: uVar3 = -(uint)isLess | 1; goto LAB_0094a20a; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0094a205; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a20a: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((this->_SeedUnlockPageSprite)._animState._isPlaying == 0)))) goto LAB_0094a21b; } iVar2 = this->_seedUnlockPageTimer; if ((g_manager->_framecount & 1) == 0) { iVar2 = iVar2 + 1; this->_seedUnlockPageTimer = iVar2; } if (0x3c < iVar2) { this->_seedUnlockPageState = 3; this->_seedUnlockPageTimer = 0; } } else if (iVar2 == 3) { pbVar4 = (this->_SeedUnlockPageSprite)._animState._animData; if (pbVar4 == (byte *)0x0) { LAB_0094a2d8: bVar1 = ANM2::SetAnimation(&this->_SeedUnlockPageSprite,(byte *)"Dissappear",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_SeedUnlockPageSprite)._animState); (this->_SeedUnlockPageSprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedNameText = "Dissappear"; do { bVar1 = *animNameCursor; isLess = bVar1 < (byte)*expectedNameText; if (bVar1 != *expectedNameText) { LAB_0094a2c2: uVar3 = -(uint)isLess | 1; goto LAB_0094a2c7; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < (byte)expectedNameText[1]; if (bVar1 != expectedNameText[1]) goto LAB_0094a2c2; animNameCursor = animNameCursor + 2; expectedNameText = expectedNameText + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a2c7: if ((uVar3 != 0) || ((pbVar4[0x34] != 0 && ((this->_SeedUnlockPageSprite)._animState._isPlaying == 0)))) goto LAB_0094a2d8; } if (((this->_SeedUnlockPageSprite)._animState._animData == (void *)0x0) || ((this->_SeedUnlockPageSprite)._animState._isPlaying == 0)) { this->_seedUnlockPageState = 0; } } pbVar4 = (this->_EastereggPageSprite)._animState._animData; if ((g_menuManager->_seedsObject)._seedEffectsCount == 0) { if (pbVar4 != (byte *)0x0) { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedName = &DAT_00b7bd88; do { bVar1 = *animNameCursor; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0094a3b5: uVar3 = -(uint)isLess | 1; goto LAB_0094a3ba; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0094a3b5; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a3ba: if ((uVar3 == 0) && ((pbVar4[0x34] == 0 || ((this->_EastereggPageSprite)._animState._isPlaying != 0)))) goto LAB_0094a3e6; } pbVar4 = &DAT_00b7bd88; } else { if (pbVar4 != (byte *)0x0) { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedName = &DAT_00b7bde8; do { bVar1 = *animNameCursor; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0094a366: uVar3 = -(uint)isLess | 1; goto LAB_0094a36b; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0094a366; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a36b: if ((uVar3 == 0) && ((pbVar4[0x34] == 0 || ((this->_EastereggPageSprite)._animState._isPlaying != 0)))) goto LAB_0094a3e6; } pbVar4 = &DAT_00b7bde8; } bVar1 = ANM2::SetAnimation(&this->_EastereggPageSprite,pbVar4,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_EastereggPageSprite)._animState); (this->_EastereggPageSprite)._animState._isPlaying = 1; } LAB_0094a3e6: if ((g_manager->_persistentGameData)._eventCounters[0x71] == 0) { if ((g_manager->_persistentGameData)._eventCounters[0x16] == 0) { return; } pbVar4 = (this->_WinStreakPageSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedName = &DAT_00b7bf30; do { bVar1 = *animNameCursor; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0094a4a0: uVar3 = -(uint)isLess | 1; goto LAB_0094a4a5; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0094a4a0; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a4a5: if (uVar3 == 0) { if (pbVar4[0x34] == 0) { return; } if ((this->_WinStreakPageSprite)._animState._isPlaying != 0) { return; } } } pbVar4 = &DAT_00b7bf30; } else { pbVar4 = (this->_WinStreakPageSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { animNameCursor = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { animNameCursor = *(byte **)pbVar4; } expectedName = &DAT_00b7bf2c; do { bVar1 = *animNameCursor; isLess = bVar1 < *expectedName; if (bVar1 != *expectedName) { LAB_0094a430: uVar3 = -(uint)isLess | 1; goto LAB_0094a435; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; isLess = bVar1 < expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_0094a430; animNameCursor = animNameCursor + 2; expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0094a435: if (uVar3 == 0) { if (pbVar4[0x34] == 0) { return; } if ((this->_WinStreakPageSprite)._animState._isPlaying != 0) { return; } } } pbVar4 = &DAT_00b7bf2c; } bVar1 = ANM2::SetAnimation(&this->_WinStreakPageSprite,pbVar4,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_WinStreakPageSprite)._animState); (this->_WinStreakPageSprite)._animState._isPlaying = 1; } return; } //@@ 0094a500 Menu_Character::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: called in menu render sequence (0098a040) next to Menu_DailyChallenge::Render; right after Menu_Character::Update (00949c20); CompletionWidget::Render, Seeds::CountUnlockedSeedEffects/AchievementUnlocksDisallowed, ButtonIcon layer, Font::DrawString prototype: REPENTOGON */ void __thiscall Menu_Character::Render(Menu_Character *this) { float fVar1; float fVar2; char cVar3; Vector pos; Vector pos_00; Vector scale; Vector scale_00; Vector pos_01; byte bVar4; byte *pbVar5; uint uVar6; void *pvVar7; float *nullFrame; LayerState *pLVar8; std_string *seedTextChars; std_string *seedText; undefined4 extraout_EAX; undefined4 extraout_EAX_00; int iVar9; Font *pFVar10; Font *pFVar11; AnimationLayer *bgLayer; byte *pbVar12; int iVar13; undefined4 extraout_ECX; Font **ppFVar14; void **ppvVar15; undefined4 extraout_ECX_00; Seeds *seeds; AnimationState *secondAnimState; ANM2 *bgAnimation; bool bVar16; undefined4 uStack_114; undefined4 uStack_110; undefined4 uStack_10c; float greedDecoAlpha; undefined4 local_f4; undefined4 uStack_f0; undefined4 local_ec; FontSettings fontSettings; undefined4 local_d4; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; undefined4 local_c4; undefined4 local_c0; undefined4 local_b8; undefined4 local_b4; KColor local_b0; Menu_Character *local_9c; undefined4 local_98; undefined4 local_94; KColor local_90; byte isAchievementsDisallowed; float glyphX; Font *local_74; Font *local_70; Vector renderPos; Vector basePos; Font *textBuf [4]; int textBufSize; uint textBufCapacity; short local_44 [8]; undefined4 local_34; void *pvStack_30; void *pvStack_2c; void *pvStack_28; uint local_24; void *pvStack_20; std_map local_1c; undefined4 local_14; ColorMod *greedDecoColor; Manager *manager; pvStack_20 = local_44 + 0x20; local_14 = -1; local_1c._size = (uint)&LAB_00b0b8da; local_1c._head = ExceptionList; local_24 = __security_cookie ^ (uint)(local_44 + 0x1a); ExceptionList = &((Font *)textBuf)->_charsBlock; basePos.x = (g_menuManager->_ViewPosition).x + this->_PositionX; basePos.y = (g_menuManager->_ViewPosition).y + this->_PositionY; renderPos.x = basePos.x + 480.0; renderPos.y = basePos.y + 0.0; local_9c = this; pvVar7 = local_44 + 0x20; if ((this->_SeedEntrySprite)._loaded != 0) { if ((this->_SeedEntrySprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_SeedEntrySprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_SeedEntrySprite)._overlayAnimState; } else { pvStack_20 = local_44 + 0x20; AnimationState::Render (&(this->_SeedEntrySprite)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero) ; secondAnimState = &(this->_SeedEntrySprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); pvVar7 = pvStack_20; } pvStack_20 = pvVar7; if ((this->_CharacterMenuBGSprite)._loaded != 0) { if ((this->_CharacterMenuBGSprite)._overlayRenderFirst == 0) { pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 0 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x38), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._animState._layerFrames + iVar13 * 4 ),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 0 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x38), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames; goto LAB_0094a6ef; } } else { pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 0 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x38), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 0 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x38), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._animState._layerFrames; LAB_0094a6ef: AnimationLayer::RenderFrame (bgLayer,&basePos,*(int *)((int)pvVar7 + iVar13 * 4),&g_vectorZero,&g_vectorZero, bgAnimation); } } } if ((this->_TaintedMenuBGDecoSprite)._loaded != 0) { if ((this->_TaintedMenuBGDecoSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_TaintedMenuBGDecoSprite)._animState,&basePos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_TaintedMenuBGDecoSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_TaintedMenuBGDecoSprite)._overlayAnimState,&basePos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_TaintedMenuBGDecoSprite)._animState; } AnimationState::Render(secondAnimState,&basePos,&g_vectorZero,&g_vectorZero); } if ((this->_CharacterMenuBGSprite)._loaded != 0) { if ((this->_CharacterMenuBGSprite)._overlayRenderFirst == 0) { pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 1 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x3c), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._animState._layerFrames + iVar13 * 4 ),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 1 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x3c), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames; goto LAB_0094a86f; } } else { pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 1 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x3c), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 1 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x3c), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._animState._layerFrames; LAB_0094a86f: AnimationLayer::RenderFrame (bgLayer,&basePos,*(int *)((int)pvVar7 + iVar13 * 4),&g_vectorZero,&g_vectorZero, bgAnimation); } } if ((this->_CharacterMenuBGSprite)._loaded != 0) { if ((this->_CharacterMenuBGSprite)._overlayRenderFirst == 0) { pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 4 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x48), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._animState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 4 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x48), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames; goto LAB_0094a994; } } else { pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 4 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x48), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 4 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x48), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._animState._layerFrames; LAB_0094a994: AnimationLayer::RenderFrame (bgLayer,&basePos,*(int *)((int)pvVar7 + iVar13 * 4),&g_vectorZero,&g_vectorZero ,bgAnimation); } } } } if (this->Status == 4) { LAB_0094aa0a: if ((this->_CharacterMenuBGSprite)._loaded != 0) { if ((this->_CharacterMenuBGSprite)._overlayRenderFirst == 0) { pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 3 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x44), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._animState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 3 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x44), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames; goto LAB_0094ab18; } } else { pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 3 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x44), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 3 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x44), -1 < iVar13)) { bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._animState._layerFrames; LAB_0094ab18: AnimationLayer::RenderFrame (bgLayer,&basePos,*(int *)((int)pvVar7 + iVar13 * 4),&g_vectorZero,&g_vectorZero ,bgAnimation); } } } if ((this->_CharacterMenuBGSprite)._animState._animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)((int)(this->_CharacterMenuBGSprite)._animState._animation + 0x80) < 4) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (2 < *(int *)((int)(this->_CharacterMenuBGSprite)._animState._animation + 0x80))) && ((iVar13 = *(int *)((int)pvVar7 + 0x44), -1 < iVar13 && (iVar13 < *(int *)((int)pvVar7 + 0x1c))))) { iVar9 = iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18); iVar13 = *(int *)((int)(this->_CharacterMenuBGSprite)._animState._layerFrames + iVar13 * 4); if (((-1 < iVar13) && (iVar13 < *(int *)(iVar9 + 8))) && ((iVar13 = iVar13 * 0x6c + *(int *)(iVar9 + 4), iVar13 != 0 && (*(char *)(iVar13 + 0x2c) != '\0')))) { renderPos.x = *(float *)(iVar13 + 0x10) - *(float *)(iVar13 + 0x20) * ((Vector *)(iVar13 + 0x18))->x; renderPos.y = *(float *)(iVar13 + 0x14) - *(float *)(iVar13 + 0x1c) * *(float *)(iVar13 + 0x24); render_portraits(this,&basePos,&renderPos,(Vector *)(iVar13 + 0x18)); } } } else { pbVar5 = (this->_CharacterMenuBGSprite)._animState._animData; if (pbVar5 == (byte *)0x0) { pbVar5 = &s_empty; } else if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar12 = s_Idle; do { bVar4 = *pbVar5; bVar16 = bVar4 < *pbVar12; if (bVar4 != *pbVar12) { LAB_0094a9f0: uVar6 = -(uint)bVar16 | 1; goto LAB_0094a9f5; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar16 = bVar4 < pbVar12[1]; if (bVar4 != pbVar12[1]) goto LAB_0094a9f0; pbVar5 = pbVar5 + 2; pbVar12 = pbVar12 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_0094a9f5: if (uVar6 != 0) goto LAB_0094aa0a; render_wheel(this,&basePos,0); } if ((this->_CharacterMenuBGSprite)._loaded != 0) { if ((this->_CharacterMenuBGSprite)._overlayRenderFirst == 0) { pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, 2 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x40), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._animState._layerFrames + iVar13 * 4 ),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 == (void *)0x0) || (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, bgAnimation->_layerCount < 3)) || (iVar13 = *(int *)((int)pvVar7 + 0x40), iVar13 < 0)) goto LAB_0094ad1d; bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames; } else { pvVar7 = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; if (((pvVar7 != (void *)0x0) && (bgAnimation = (this->_CharacterMenuBGSprite)._overlayAnimState._animation, 2 < bgAnimation->_layerCount)) && (iVar13 = *(int *)((int)pvVar7 + 0x40), -1 < iVar13)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)),&basePos, *(int *)((int)(this->_CharacterMenuBGSprite)._overlayAnimState._layerFrames + iVar13 * 4),&g_vectorZero,&g_vectorZero,bgAnimation); } pvVar7 = (this->_CharacterMenuBGSprite)._animState._animData; if (((pvVar7 == (void *)0x0) || (bgAnimation = (this->_CharacterMenuBGSprite)._animState._animation, bgAnimation->_layerCount < 3)) || (iVar13 = *(int *)((int)pvVar7 + 0x40), iVar13 < 0)) goto LAB_0094ad1d; bgLayer = (AnimationLayer *)(iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18)); pvVar7 = (this->_CharacterMenuBGSprite)._animState._layerFrames; } AnimationLayer::RenderFrame (bgLayer,&basePos,*(int *)((int)pvVar7 + iVar13 * 4),&g_vectorZero,&g_vectorZero, bgAnimation); } LAB_0094ad1d: if (0.0 < (this->_PageSwapWidgetSprite)._color._tint[3]) { renderPos.x = basePos.x + 54.0; renderPos.y = basePos.y + 50.0; Sprite::RenderLayer((Sprite *)&this->_PageSwapWidgetSprite,0,&renderPos,&g_vectorZero, &g_vectorZero); Sprite::RenderLayer((Sprite *)&this->_PageSwapWidgetSprite,1,&renderPos,&g_vectorZero, &g_vectorZero); nullFrame = AnimationState::GetNullFrameById(&(this->_PageSwapWidgetSprite)._animState,0); local_74 = (Font *)(renderPos.y + nullFrame[1]); glyphX = renderPos.x + *nullFrame; local_c0 = 0; pos.y = (float)local_74; pos.x = glyphX; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; bVar4 = Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x19,0,1, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos, scale); if (bVar4 == 0) { Sprite::RenderLayer((Sprite *)&this->_PageSwapWidgetSprite,2,&renderPos,&g_vectorZero, &g_vectorZero); } } if ((this->SelectedCharacterID < 0x12) && (this->SelectedCharacterID != 0)) { renderPos.x = basePos.x + 80.0; renderPos.y = basePos.y + 50.0; CompletionWidget::Render(&this->_completionWidget,&renderPos,&g_vectorOne); } renderPos.x = basePos.x + 365.0; renderPos.y = basePos.y + 120.0; if ((this->_DifficultyPageSprite)._loaded != 0) { if ((this->_DifficultyPageSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_DifficultyPageSprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_DifficultyPageSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_DifficultyPageSprite)._overlayAnimState,&renderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_DifficultyPageSprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } renderPos.x = basePos.x + 350.0; renderPos.y = basePos.y + 45.0; if ((this->_SeedPageSprite)._loaded != 0) { if ((this->_SeedPageSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_SeedPageSprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_SeedPageSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_SeedPageSprite)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_SeedPageSprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } greedDecoAlpha = this->_greedDecoAlpha; if ((1.0 <= greedDecoAlpha) || ((this->Difficulty != 2 && (this->Difficulty != 3)))) { if ((0.0 < greedDecoAlpha) && ((this->Difficulty != 2 && (this->Difficulty != 3)))) { greedDecoAlpha = greedDecoAlpha - 0.05; this->_greedDecoAlpha = greedDecoAlpha; } } else { greedDecoAlpha = greedDecoAlpha + 0.05; this->_greedDecoAlpha = greedDecoAlpha; } greedDecoColor = &(this->_GreedDecoOverlaySprite)._color; uStack_114 = 0x3f800000; uStack_110 = 0x3f800000; uStack_10c = 0x3f800000; local_f4 = 0; uStack_f0 = 0; local_ec = 0; if (greedDecoColor != (ColorMod *)&uStack_114) { (this->_GreedDecoOverlaySprite)._color._colorize[0] = 0.0; (this->_GreedDecoOverlaySprite)._color._colorize[1] = 0.0; (this->_GreedDecoOverlaySprite)._color._colorize[2] = 0.0; (this->_GreedDecoOverlaySprite)._color._colorize[3] = 0.0; greedDecoColor->_tint[0] = 1.0; (this->_GreedDecoOverlaySprite)._color._tint[1] = 1.0; (this->_GreedDecoOverlaySprite)._color._tint[2] = 1.0; (this->_GreedDecoOverlaySprite)._color._tint[3] = greedDecoAlpha; (this->_GreedDecoOverlaySprite)._color._offset[0] = 0.0; (this->_GreedDecoOverlaySprite)._color._offset[1] = 0.0; (this->_GreedDecoOverlaySprite)._color._offset[2] = 0.0; } if ((this->_GreedDecoOverlaySprite)._loaded != 0) { if ((this->_GreedDecoOverlaySprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_GreedDecoOverlaySprite)._animState,&basePos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_GreedDecoOverlaySprite)._overlayAnimState; } else { AnimationState::Render (&(this->_GreedDecoOverlaySprite)._overlayAnimState,&basePos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_GreedDecoOverlaySprite)._animState; } AnimationState::Render(secondAnimState,&basePos,&g_vectorZero,&g_vectorZero); } if ((this->_seedText)._size == 0) { pLVar8 = ANM2::GetLayer(&this->_SeedPageSprite,(byte *)0x1); local_70 = (Font *)0x43b28000; local_74 = (Font *)0x42380000; pLVar8->_visible = 1; if (*(int *)&g_manager->_stringTable == 2) { local_70 = (Font *)0x43b68000; local_74 = (Font *)0x42440000; } if ((this->_SeedPageSprite)._animState._animData == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)((int)(this->_SeedPageSprite)._animState._animation + 0x80) < 3) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } pvVar7 = (this->_SeedPageSprite)._animState._animData; pFVar11 = local_74; pFVar10 = local_70; if ((((pvVar7 != (void *)0x0) && (1 < *(int *)((int)(this->_SeedPageSprite)._animState._animation + 0x80))) && (iVar13 = *(int *)((int)pvVar7 + 0x40), -1 < iVar13)) && (iVar13 < *(int *)((int)pvVar7 + 0x1c))) { iVar9 = *(int *)((int)(this->_SeedPageSprite)._animState._layerFrames + iVar13 * 4); iVar13 = iVar13 * 0x10 + *(int *)((int)pvVar7 + 0x18); if (((-1 < iVar9) && (iVar9 < *(int *)(iVar13 + 8))) && (iVar13 = iVar9 * 0x6c + *(int *)(iVar13 + 4), iVar13 != 0)) { pFVar11 = (Font *)((float)local_74 + *(float *)(iVar13 + 0x14)); pFVar10 = (Font *)((float)local_70 + *(float *)(iVar13 + 0x10)); } } renderPos.y = (float)pFVar11 + basePos.y; renderPos.x = (float)pFVar10 + basePos.x; local_c0 = 0; pos_00.y = renderPos.y; pos_00.x = renderPos.x; scale_00.y = g_vectorOne.y; scale_00.x = g_vectorOne.x; bVar4 = Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x1c,0,1, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_00,scale_00); if (bVar4 == 0) { pLVar8 = ANM2::GetLayer(&this->_SeedPageSprite,(byte *)0x2); pLVar8->_visible = 1; } else { pLVar8 = ANM2::GetLayer(&this->_SeedPageSprite,(byte *)0x2); pLVar8->_visible = 0; } } else { pLVar8 = ANM2::GetLayer(&this->_SeedPageSprite,(byte *)0x1); pLVar8->_visible = 0; pLVar8 = ANM2::GetLayer(&this->_SeedPageSprite,(byte *)0x2); local_98 = 0; local_94 = 0xffff; local_90._red = 0.0; pLVar8->_visible = 0; local_74 = &g_manager->_font1_TeamMeatEx10; local_90._green = 1.0; local_90._blue = -NAN; local_90._alpha = 0.0; local_90._unk = 0; local_14 = 0; KColor::SetFromARGB(&local_b0,0xff362f2d); seedText = &this->_seedText; seedTextChars = seedText; if (0xf < (this->_seedText)._capacity) { seedTextChars = *(std_string **)seedText->_buf; } Font::get_string_width_n(local_74,(byte *)seedTextChars,-1); seedTextChars = seedText; if (0xf < (this->_seedText)._capacity) { seedTextChars = *(std_string **)seedText->_buf; } Font::DrawString(seedTextChars,&local_b0,&local_98); local_74 = (Font *)(this->_seedText)._size; local_70 = (Font *)0x4; ppFVar14 = &local_74; if ((Font *)0x3 < local_74) { ppFVar14 = &local_70; } local_34 = (void *)0x0; pvStack_30 = (void *)0x0; pvStack_2c = (void *)0x0; pvStack_28 = (void *)0x0; if (0xf < (this->_seedText)._capacity) { seedText = *(std_string **)seedText->_buf; } memcpy(&((Font *)textBuf)->_chars,seedText,(size_t)*ppFVar14); local_98 = 0; local_94 = 0xffff; local_90._red = 0.0; local_90._green = 1.0; local_90._blue = -NAN; local_90._alpha = 0.0; local_90._unk = 0; local_14 = 1; KColor::SetFromARGB(&local_b0,0xff362f2d); renderPos.y = basePos.x + 480.0 + 185.0; Font::DrawString(&((Font *)textBuf)->_chars,extraout_ECX,&local_98); local_14 = -1; uVar6 = (this->_seedText)._size; if (4 < uVar6) { local_74 = (Font *)(uVar6 - 4); local_70 = (Font *)0x4; seedText = &this->_seedText; ppFVar14 = &local_74; if ((Font *)0x3 < local_74) { ppFVar14 = &local_70; } local_34 = (void *)0x0; pvStack_30 = (void *)0x0; pvStack_2c = (void *)0x0; pvStack_28 = (void *)0x0; if (0xf < (this->_seedText)._capacity) { seedText = *(std_string **)seedText->_buf; } memcpy(&((Font *)textBuf)->_chars,seedText->_buf + 5,(size_t)*ppFVar14); ppvVar15 = &((Font *)textBuf)->_chars; do { cVar3 = *(char *)ppvVar15; ppvVar15 = (void **)((int)ppvVar15 + 1); } while (cVar3 != '\0'); if (ppvVar15 != (void **)((int)&((Font *)textBuf)->_chars + 1U)) { FontSettings::constructor(&fontSettings); local_14 = 2; KColor::SetFromARGB(&local_b0,0xff362f2d); Font::DrawString(&((Font *)textBuf)->_chars,extraout_ECX_00,extraout_EAX); local_14 = -1; local_c4 = 0; local_c0 = 0; this = local_9c; } } } renderPos.x = (g_menuManager->_ViewPosition).x + this->_PositionX + 45.0; renderPos.y = (g_menuManager->_ViewPosition).y + this->_PositionY + 140.0; if ((this->_WinStreakPageSprite)._loaded != 0) { if ((this->_WinStreakPageSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_WinStreakPageSprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_WinStreakPageSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_WinStreakPageSprite)._overlayAnimState,&renderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_WinStreakPageSprite)._animState; } AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } if (((g_manager->_persistentGameData)._eventCounters[0x16] != 0) || (pbVar5 = &DAT_00b7bf38, (g_manager->_persistentGameData)._eventCounters[0x71] == 0)) { pbVar5 = &DAT_00b66130; } sprintf((byte *)&((Font *)textBuf)->_scaleW,pbVar5); manager = g_manager; local_98 = 0; local_94 = 0xffff; local_90._red = 0.0; local_90._green = 1.0; local_90._blue = -NAN; local_90._alpha = 0.0; local_90._unk = 0; local_14 = 3; KColor::SetFromARGB(&local_b0,0xff362f2d); Font::get_string_width_n(&manager->_font1_TeamMeatEx10,(byte *)&((Font *)textBuf)->_scaleW,-1); Font::DrawString(&((Font *)textBuf)->_scaleW,&local_b0,&local_98); local_14 = -1; iVar13 = Seeds::CountUnlockedSeedEffects(); if (0 < iVar13) { fVar1 = (g_menuManager->_ViewPosition).y; seeds = &g_menuManager->_seedsObject; fVar2 = this->_PositionY; (this->_eastereggPagePosition).x = (g_menuManager->_ViewPosition).x + this->_PositionX + 404.0; (this->_eastereggPagePosition).y = fVar1 + fVar2 + 238.0; isAchievementsDisallowed = Seeds::AchievementUnlocksDisallowed(seeds); pLVar8 = ANM2::GetLayer(&this->_EastereggPageSprite,(byte *)0x3); pLVar8->_visible = isAchievementsDisallowed; ANM2::Render(&this->_EastereggPageSprite,&this->_eastereggPagePosition,&g_vectorZero, &g_vectorZero); if (((this->_EastereggPageSprite)._animState._animData != (void *)0x0) && (nullFrame = AnimationState::GetNullFrame (&(this->_EastereggPageSprite)._animState,(byte *)"ButtonIcon"), nullFrame != (float *)0x0)) { basePos.y = nullFrame[1] + (this->_eastereggPagePosition).y; basePos.x = *nullFrame + (this->_eastereggPagePosition).x; pos_01.y = basePos.y; pos_01.x = basePos.x; bVar4 = render_input_button_icon (g_menuControllerIndex,0x18,0,1, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_01); if (bVar4 == 0) { pLVar8 = ANM2::GetLayer(&this->_EastereggPageSprite,&DAT_00000004); pLVar8->_visible = 1; } else { pLVar8 = ANM2::GetLayer(&this->_EastereggPageSprite,&DAT_00000004); pLVar8->_visible = 0; } } if ((g_menuManager->_seedsObject)._seedEffectsCount != 0) { sprintf((byte *)&((Font *)textBuf)->_chars,s__d); local_b8 = 0; local_b4 = 0xffff; local_b0._red = 0.0; local_b0._green = 1.0; local_b0._blue = -NAN; local_b0._alpha = 0.0; local_b0._unk = 0; local_14 = 4; KColor::SetFromARGB(&local_90,0xff3d3234); Font::DrawString(&((Font *)textBuf)->_chars,extraout_EAX_00,&local_b8); local_14 = -1; } } if (this->_seedUnlockPageState != 0) { basePos.y = g_screenHeight * 0.5; basePos.x = g_screenWidth * 0.5; if ((this->_SeedUnlockPageSprite)._loaded != 0) { if ((this->_SeedUnlockPageSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_SeedUnlockPageSprite)._animState,&basePos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_SeedUnlockPageSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_SeedUnlockPageSprite)._overlayAnimState,&basePos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_SeedUnlockPageSprite)._animState; } AnimationState::Render(secondAnimState,&basePos,&g_vectorZero,&g_vectorZero); } if (this->_seedUnlockPageState == 2) { local_70 = &g_manager->_font1_TeamMeatEx10; std::string::string((char *)textBuf,&this->field_0xd84); local_14 = 5; pFVar11 = (Font *)textBuf; if (0xf < textBufCapacity) { pFVar11 = textBuf[0]; } local_74 = (Font *)(&pFVar11->_isLoaded + textBufSize); pFVar10 = (Font *)textBuf; if (0xf < textBufCapacity) { pFVar10 = textBuf[0]; } if (pFVar10 != (Font *)(&pFVar11->_isLoaded + textBufSize)) { iVar13 = (int)pFVar11 - (int)pFVar10; do { iVar9 = toupper((int)(char)pFVar10->_isLoaded); *(byte *)((int)pFVar10 + iVar13) = (byte)iVar9; pFVar10 = (Font *)&pFVar10->field_0x1; } while (pFVar10 != local_74); this = local_9c; } pFVar11 = local_70; pFVar10 = (Font *)textBuf; if (0xf < textBufCapacity) { pFVar10 = textBuf[0]; } Font::get_string_width_n(local_70,&pFVar10->_isLoaded,-1); fontSettings = (FontSettings)0x0; local_d4 = 0xffff; local_d0 = 0; local_cc = 0x3f800000; local_c8 = 0xffffffff; local_c4 = 0; local_c0 = 0; local_14._0_1_ = 6; KColor::SetFromARGB(&local_b0,0xff362f2d); pFVar10 = (Font *)textBuf; if (0xf < textBufCapacity) { pFVar10 = textBuf[0]; } Font::DrawString(pFVar10,&local_b0,&fontSettings); pbVar5 = &this->field_0xd9c; local_14._0_1_ = 5; if ((Font *)textBuf != (Font *)pbVar5) { if (0xf < *(uint *)&this->field_0xdb0) { pbVar5 = *(byte **)pbVar5; } std::string::assign((char *)textBuf,pbVar5,*(uint *)&this->field_0xdac); } pFVar10 = (Font *)textBuf; if (0xf < textBufCapacity) { pFVar10 = textBuf[0]; } Font::get_string_width_n(pFVar11,&pFVar10->_isLoaded,-1); fontSettings = (FontSettings)0x0; local_d4 = 0xffff; local_d0 = 0; local_cc = 0x3f800000; local_c8 = 0xffffffff; local_c4 = 0; local_c0 = 0; local_14 = CONCAT31(local_14._1_3_,7); KColor::SetFromARGB(&local_b0,0xff362f2d); pFVar11 = (Font *)textBuf; if (0xf < textBufCapacity) { pFVar11 = textBuf[0]; } Font::DrawString(pFVar11,&local_b0,&fontSettings); if (0xf < textBufCapacity) { uVar6 = textBufCapacity + 1; pFVar11 = textBuf[0]; if (0xfff < uVar6) { pFVar11 = (Font *)textBuf[0][-1]._missingCharacter; uVar6 = textBufCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)textBuf[0] + (-4 - (int)pFVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pFVar11,uVar6); } } } ExceptionList = local_1c._head; return; } //@@ 0094bbd0 Menu_Character::render_wheel /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Menu_Character::Render: draws the character sprite +0x40 (modded character via FUN_008f8d00 when +0x10 >= 0x12), Menu_Character::render_portraits unless param_2, the #EDEN_TOKENS_COUNT text, then more AnimationState renders */ void __thiscall Menu_Character::render_wheel(Menu_Character *this,Vector *param_2,char param_3) { Font *this_00; ColorMod *pCVar1; byte *format; AnimationState *this_01; KColor local_10c; undefined4 local_f8; undefined4 uStack_f4; undefined4 uStack_f0; float fStack_ec; undefined4 local_d8; undefined4 uStack_d4; undefined4 local_d0; undefined4 local_cc; undefined4 local_c8; undefined4 local_c4; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; Menu_Character *local_b0; Vector *local_ac; byte local_a8 [132]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_a8 + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b920; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_a8 + 0x98); ExceptionList = &local_1c; local_ac = param_2; local_b0 = this; if (this->SelectedCharacterID < 0x12) { puStack_20 = local_a8 + 0xa4; ANM2::Render(&this->_BigCharPageSprite,param_2,&g_vectorZero,&g_vectorZero); } else { ModManager::RenderCustomCharacterMenu (*(undefined4 *) ((int)g_modCharacters + ((-(uint)(this->_characterMenuShown != 0) & 4) - 0x90) + this->SelectedCharacterID * 8),param_2,&this->_BigCharPageSprite); } if (param_3 == '\0') { render_portraits(this,param_2,&g_vectorZero,&g_vectorOne); } if (this->SelectedCharacterID == 10) { this_00 = &g_manager->_font2_TeamMeatEx12; format = string_table_translate(&g_manager->_stringTable,(byte *)"#EDEN_TOKENS_COUNT"); sprintf(local_a8,format); local_cc = 0; local_c8 = 0xffff; local_c4 = 0; local_c0 = 0x3f800000; local_bc = 0xffffffff; local_b8 = 0; local_b4 = 0; local_14 = 0; KColor::SetFromARGB(&local_10c,0xff362f2d); Font::get_string_width_n(this_00,local_a8,-1); Font::DrawString(local_a8,&local_10c,&local_cc); local_14 = 0xffffffff; this = local_b0; param_2 = local_ac; } fStack_ec = *(float *)&this->field_0x30; if ((1.0 <= fStack_ec) || ((this->Difficulty != 1 && (this->Difficulty != 3)))) { if ((0.0 < fStack_ec) && ((this->Difficulty != 1 && (this->Difficulty != 3)))) { fStack_ec = fStack_ec - 0.05; *(float *)&this->field_0x30 = fStack_ec; } } else { fStack_ec = fStack_ec + 0.05; *(float *)&this->field_0x30 = fStack_ec; } pCVar1 = &(this->_DifficultyOverlaySprite)._color; local_f8 = 0x3f800000; uStack_f4 = 0x3f800000; uStack_f0 = 0x3f800000; local_d8 = 0; uStack_d4 = 0; local_d0 = 0; if (pCVar1 != (ColorMod *)&local_f8) { (this->_DifficultyOverlaySprite)._color._colorize[0] = 0.0; (this->_DifficultyOverlaySprite)._color._colorize[1] = 0.0; (this->_DifficultyOverlaySprite)._color._colorize[2] = 0.0; (this->_DifficultyOverlaySprite)._color._colorize[3] = 0.0; pCVar1->_tint[0] = 1.0; (this->_DifficultyOverlaySprite)._color._tint[1] = 1.0; (this->_DifficultyOverlaySprite)._color._tint[2] = 1.0; (this->_DifficultyOverlaySprite)._color._tint[3] = fStack_ec; (this->_DifficultyOverlaySprite)._color._offset[0] = 0.0; (this->_DifficultyOverlaySprite)._color._offset[1] = 0.0; (this->_DifficultyOverlaySprite)._color._offset[2] = 0.0; } if ((this->_DifficultyOverlaySprite)._loaded != 0) { if ((this->_DifficultyOverlaySprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_DifficultyOverlaySprite)._animState,param_2,&g_vectorZero,&g_vectorZero); this_01 = &(this->_DifficultyOverlaySprite)._overlayAnimState; } else { AnimationState::Render (&(this->_DifficultyOverlaySprite)._overlayAnimState,param_2,&g_vectorZero, &g_vectorZero); this_01 = &(this->_DifficultyOverlaySprite)._animState; } AnimationState::Render(this_01,param_2,&g_vectorZero,&g_vectorZero); } ExceptionList = local_1c; return; } //@@ 0094bee0 Menu_Character::render_portraits /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=MenuManager+0x1534 (zhl _menuCharacter 0x1530+4) via 0094a500; ModManager::RenderCustomCharacterPortraits, Menu_Character_Entry::IsCharacterAvailable, entry sprites +0xb50 prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Menu_Character::render_portraits(Menu_Character *this,Vector *position,Vector *offset,Vector *scale) { uint uVar1; byte bVar2; void *orderList; void *extraout_ECX; void *extraout_ECX_00; int iVar4; int iVar5; int iVar6; float fVar7; float fVar8; void *local_84; void *local_80; Vector local_7c; Vector local_74; Vector customPortraitPos; float local_64; float fStack_60; float fStack_5c; undefined4 uStack_58; float offsetR; float offsetG; float offsetB; ColorMod customPortraitColor; uint local_c; ModManager *characterIndex; void *orderList; ColorMod *portraitColor; local_c = __security_cookie ^ (uint)&local_84; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94174) && (_Init_thread_header(&DAT_00c94174), DAT_00c94174 == -1)) { _atexit((_func_4879 *)&LAB_00b16750); _Init_thread_footer(&DAT_00c94174); } DAT_00c9417c = g_characterPortraitOrder; uVar1 = this->_numCharacters; local_84 = g_characterPortraitOrder; orderList = g_characterPortraitOrder; if (uVar1 != 0) { if ((uint)(DAT_00c94180 - (int)g_characterPortraitOrder >> 4) < uVar1) { std::vector<16byte>::_Resize_reallocate(uVar1,&local_80); orderList = extraout_ECX; } else { DAT_00c9417c = (void *)FUN_0094e520(g_characterPortraitOrder,uVar1,local_80); orderList = extraout_ECX_00; } } local_80 = (void *)0x12; local_74.x = 0.0; iVar6 = 0; local_7c.x = (float)&PTR_s_00_Random_00b24140; iVar4 = 0; local_84 = g_characterPortraitOrder; do { if ((*(char *)((int)local_7c.x + 8) == '\0') || (bVar2 = Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *)local_7c.x,(int)orderList), bVar2 != 0)) { *(float *)(iVar4 + (int)local_84) = local_74.x; orderList = g_characterPortraitOrder; orderList = (this->_portraitPositions)._begin; *(undefined4 *)(iVar4 + 4 + (int)g_characterPortraitOrder) = *(undefined4 *)((int)orderList + iVar6 * 8); *(undefined4 *)(iVar4 + 8 + (int)orderList) = *(undefined4 *)((int)orderList + iVar6 * 8 + 4); iVar5 = iVar6 * 4; iVar6 = iVar6 + 1; *(undefined4 *)(iVar4 + 0xc + (int)g_characterPortraitOrder) = *(undefined4 *)((int)(this->_portraitScales)._begin + iVar5); iVar4 = iVar4 + 0x10; local_84 = g_characterPortraitOrder; } local_74.x = (float)((int)local_74.x + 1); local_7c.x = (float)((int)local_7c.x + 0x18); local_80 = (void *)((int)local_80 + -1); orderList = local_84; } while (local_80 != (void *)0x0); iVar4 = this->_numCharacters; local_80 = (void *)0x0; if (iVar6 < iVar4) { local_80 = (void *)(0x12 - iVar6); iVar5 = iVar6 << 4; while( true ) { *(int *)(iVar5 + (int)orderList) = (int)local_80 + iVar6; orderList = g_characterPortraitOrder; orderList = (this->_portraitPositions)._begin; *(undefined4 *)(iVar5 + 4 + (int)g_characterPortraitOrder) = *(undefined4 *)((int)orderList + iVar6 * 8); *(undefined4 *)(iVar5 + 8 + (int)orderList) = *(undefined4 *)((int)orderList + iVar6 * 8 + 4); iVar4 = iVar6 * 4; iVar6 = iVar6 + 1; *(undefined4 *)(iVar5 + 0xc + (int)g_characterPortraitOrder) = *(undefined4 *)((int)(this->_portraitScales)._begin + iVar4); iVar4 = this->_numCharacters; if (iVar4 <= iVar6) break; orderList = g_characterPortraitOrder; iVar5 = iVar5 + 0x10; } } portrait_list_sort(iVar4 + -1); local_84 = (void *)0x0; if (0 < this->_numCharacters) { iVar4 = 0; do { if (*(int *)(iVar4 + (int)g_characterPortraitOrder) < 0x12) { iVar6 = *(int *)(iVar4 + (int)g_characterPortraitOrder) + this->_characterMenuShown * 0x12; local_80 = (void *)(iVar6 * 3); bVar2 = ANM2::SetAnimation(&this->_CharacterPortraitsSprite, (&PTR_s_00_Random_00b24140)[iVar6 * 6],1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_CharacterPortraitsSprite)._animState); (this->_CharacterPortraitsSprite)._animState._isPlaying = 1; } iVar6 = *(int *)(&DAT_00b24144 + (int)local_80 * 8); if ((iVar6 < 0) || (local_80 = (g_manager->_entityConfig)._players._begin, ((int)(g_manager->_entityConfig)._players._end - (int)local_80) / 0x148 <= iVar6)) { orderList = (void *)0x0; } else { orderList = (void *)(iVar6 * 0x148 + (int)local_80); } uVar1 = *(uint *)((int)orderList + 0xe8); if (((int)uVar1 < 0) || (((uVar1 < 0x282 && (((uVar1 == 0 || ((g_manager->_persistentGameData)._achievements[uVar1] != 0)) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) && (((iVar6 != 9 && (iVar6 != 0x1e)) || ((g_manager->_persistentGameData)._eventCounters[0x15] != 0)))))) { iVar6 = 0; } else { iVar6 = 1; } if ((this->_CharacterPortraitsSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_CharacterPortraitsSprite)._animState,(float)iVar6); } } characterIndex = *(ModManager **)(iVar4 + (int)g_characterPortraitOrder); fVar7 = *(float *)(iVar4 + 0xc + (int)g_characterPortraitOrder); if ((int)characterIndex < 0x12) { portraitColor = &(this->_CharacterPortraitsSprite)._color; uStack_58 = 0x3f800000; fVar8 = scale->y; (this->_CharacterPortraitsSprite)._scale.x = fVar7 * scale->x; (this->_CharacterPortraitsSprite)._scale.y = fVar7 * fVar8; local_64 = *(float *)(iVar4 + 0xc + (int)g_characterPortraitOrder); fVar7 = 1.0 - local_64; offsetR = (fVar7 * 231.0) / 255.0; offsetB = (fVar7 * 220.0) / 255.0; offsetG = (fVar7 * 221.0) / 255.0; if (portraitColor != (ColorMod *)&local_64) { (this->_CharacterPortraitsSprite)._color._colorize[0] = 0.0; (this->_CharacterPortraitsSprite)._color._colorize[1] = 0.0; (this->_CharacterPortraitsSprite)._color._colorize[2] = 0.0; (this->_CharacterPortraitsSprite)._color._colorize[3] = 0.0; portraitColor->_tint[0] = local_64; (this->_CharacterPortraitsSprite)._color._tint[1] = local_64; (this->_CharacterPortraitsSprite)._color._tint[2] = local_64; (this->_CharacterPortraitsSprite)._color._tint[3] = 1.0; *(ulonglong *)(this->_CharacterPortraitsSprite)._color._offset = CONCAT44(offsetG,offsetR) ; (this->_CharacterPortraitsSprite)._color._offset[2] = offsetB; } local_7c.x = scale->x * *(float *)(iVar4 + 4 + (int)g_characterPortraitOrder) + position->x + offset->x; local_7c.y = *(float *)(iVar4 + 8 + (int)g_characterPortraitOrder) * scale->y + offset->y + position->y; fStack_60 = local_64; fStack_5c = local_64; if ((this->_CharacterPortraitsSprite)._loaded != 0) { if ((this->_CharacterPortraitsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_CharacterPortraitsSprite)._animState,&local_7c,&g_vectorZero, &g_vectorZero); AnimationState::Render (&(this->_CharacterPortraitsSprite)._overlayAnimState,&local_7c,&g_vectorZero, &g_vectorZero); } else { AnimationState::Render (&(this->_CharacterPortraitsSprite)._overlayAnimState,&local_7c,&g_vectorZero, &g_vectorZero); AnimationState::Render (&(this->_CharacterPortraitsSprite)._animState,&local_7c,&g_vectorZero, &g_vectorZero); } } } else { fVar8 = 1.0 - fVar7; local_74.x = scale->x * fVar7; customPortraitColor._tint[3] = 1.0; local_74.y = scale->y * fVar7; customPortraitColor._colorize[0] = 0.0; customPortraitColor._colorize[1] = 0.0; customPortraitColor._colorize[2] = 0.0; customPortraitColor._colorize[3] = 0.0; customPortraitColor._offset[0] = (fVar8 * 231.0) / 255.0; customPortraitColor._offset[1] = (fVar8 * 221.0) / 255.0; customPortraitColor._offset[2] = (fVar8 * 220.0) / 255.0; customPortraitPos.x = position->x + offset->x + scale->x * *(float *)(iVar4 + 4 + (int)g_characterPortraitOrder); customPortraitPos.y = scale->y * *(float *)(iVar4 + 8 + (int)g_characterPortraitOrder) + offset->y + position->y; customPortraitColor._tint[0] = fVar7; customPortraitColor._tint[1] = fVar7; customPortraitColor._tint[2] = fVar7; ModManager::RenderCustomCharacterPortraits (characterIndex, *(int *)((int)g_modCharacters + (int)characterIndex * 8 + ((-(uint)(this->_characterMenuShown != 0) & 4) - 0x90)), &customPortraitPos,&customPortraitColor,&local_74); } local_84 = (void *)((int)local_84 + 1); iVar4 = iVar4 + 0x10; } while ((int)local_84 < this->_numCharacters); } return; } //@@ 0094c4e0 Menu_Character::seed_add_char /* DB: upper-cases the char, accepts A-Z and digits except 5, inserts a space after 4 chars (+0xd74 == 4), maps I->1, O->0, U->V, std::string::push_back; Menu_Character::handle_input */ void __thiscall Menu_Character::seed_add_char(Menu_Character *this,byte param_2) { std_string *this_00; byte c; c = param_2 - 0x20; if (0x19 < (byte)(param_2 + 0x9f)) { c = param_2; } if ((('@' < (char)c) && ((char)c < '[')) || (((byte)(c - 0x30) < 10 && (c != 0x35)))) { this_00 = &this->_seedText; if ((this->_seedText)._size == 4) { std::string::push_back(this_00->_buf,0x20); } if (c != 0x49) { if (c == 0x4f) { std::string::push_back(this_00->_buf,0x30); return; } if (c == 0x55) { std::string::push_back(this_00->_buf,0x56); return; } std::string::push_back(this_00->_buf,c); return; } std::string::push_back(this_00->_buf,0x31); } return; } //@@ 0094c580 Menu_Character::handle_input /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x0094c7ae) */ /* DB: called from Menu_Character::Update when Status != 2 before UpdateRotations; polls menu input actions (0xe,0x14-0x17 confirm/back/left/right) via the input vftable, DoPageSwap, SetStartSeed, IsCharacterAvailable, SoundEffects::Play prototype: db/protos.zhl */ void __thiscall Menu_Character::handle_input(Menu_Character *this) { int *piVar1; std_string seed; KColor fadeColor; char cVar2; byte bVar3; char isSeedEffectsPressed; char isPageSwapPressed; char isSeedEffectsPressed; char isKeyPressed; int wrappedEntry; MenuManager *menuManager; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int unused; std_string *seedBuf; void *ptr; Menu_Character_Entry *entry; Manager *manager; int characterId; char *pcVar5; char *pcVar6; float viewOffsetX; char acStackY_138 [128]; undefined4 uVar7; undefined4 uVar8; uint uVar9; undefined4 uVar10; code *pcVar11; char **ppcVar12; undefined4 uVar13; int iVar14; int local_34; char *local_30; void *emptySeed [4]; undefined4 emptySeedSize; uint emptySeedCapacity; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00afd29d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(emptySeed + 10); ExceptionList = &local_10; if (this->Status == 0) { ppcVar12 = &local_30; iVar14 = 0; uVar13 = 0; pcVar11 = FUN_00a209e0; uVar10 = 0xffffffff; local_30 = (char *)0xe; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); menuManager = g_menuManager; manager = g_manager; if (cVar2 == '\0') { cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (cVar2 == '\0') { cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (cVar2 == '\0') { cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar2 == '\0') { local_30 = (char *)0x14; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (((cVar2 != '\0') && (this->IsInputPossible != 0)) && (iVar14 = this->CooldownWhenHoldDirection, this->CooldownWhenHoldDirection = iVar14 + -1, iVar14 < 1)) goto LAB_0094c9ac; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); iVar14 = extraout_ECX; if (cVar2 == '\0') { local_30 = (char *)0x15; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if ((cVar2 != '\0') && (this->IsInputPossible != 0)) { iVar14 = this->CooldownWhenHoldDirection; this->CooldownWhenHoldDirection = iVar14 + -1; if (iVar14 < 1) goto LAB_0094c92d; } cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar2 != '\0') { FUN_00929660(); FUN_0098aec0(); } goto LAB_0094ca89; } LAB_0094c92d: characterId = this->SelectedCharacterID + 1; this->CooldownWhenHoldDirection = 10; piVar1 = &this->_numCharacters_MINUS_SelectedEntry; *piVar1 = *piVar1 + -1; this->SelectedCharacterID = characterId; if (*piVar1 < 0) { this->_numCharacters_MINUS_SelectedEntry = this->_numCharacters + -1; } if (characterId < 0x12) { entry = (Menu_Character_Entry *)(&PTR_s_00_Random_00b24140 + characterId * 6); local_34 = characterId; do { characterId = local_34; if ((*(char *)(entry + 2) == '\0') || (bVar3 = Menu_Character_Entry::IsCharacterAvailable(entry,iVar14), bVar3 != 0)) break; entry = entry + 6; characterId = local_34 + 1; this->SelectedCharacterID = characterId; iVar14 = extraout_ECX_00; local_34 = characterId; } while (characterId < 0x12); } if ((DAT_00c79888 - (int)g_modCharacters >> 3) + 0x12 <= characterId) { this->SelectedCharacterID = 0; } local_34 = 0xc3; } else { LAB_0094c9ac: piVar1 = &this->SelectedCharacterID; *piVar1 = *piVar1 + -1; characterId = this->SelectedCharacterID; this->CooldownWhenHoldDirection = 10; iVar14 = this->_numCharacters_MINUS_SelectedEntry + 1; this->_numCharacters_MINUS_SelectedEntry = iVar14; if (*piVar1 < 0) { characterId = (DAT_00c79888 - (int)g_modCharacters >> 3) + 0x11; this->SelectedCharacterID = characterId; } wrappedEntry = iVar14; if (this->_numCharacters <= iVar14) { wrappedEntry = 0; } this->_numCharacters_MINUS_SelectedEntry = wrappedEntry; if (characterId < 0x12) { entry = (Menu_Character_Entry *)(&PTR_s_00_Random_00b24140 + characterId * 6); do { if ((*(char *)(entry + 2) == '\0') || (bVar3 = Menu_Character_Entry::IsCharacterAvailable(entry,iVar14), bVar3 != 0)) break; characterId = characterId + -1; entry = entry + -6; this->SelectedCharacterID = characterId; iVar14 = extraout_ECX_01; } while (characterId < 0x12); } local_34 = 0xc2; } manager = g_manager; seed_fart_sound_override(&local_34); SoundEffects::Play(&manager->_sfxManager,local_34,1.0,0,0,1.0,0.0); if (this->SelectedCharacterID < 0x12) { ANM2::Play(&this->_BigCharPageSprite, (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6],0); } goto LAB_0094ca89; } switch(this->Difficulty) { case 0: goto switchD_0094c6c7_caseD_2; case 1: goto switchD_0094c6c7_caseD_3; case 2: if (((g_manager->_persistentGameData)._achievements[0x155] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { this->Difficulty = 0; } else { this->Difficulty = 3; } break; case 3: goto switchD_0094c6c7_caseD_1; } } else { switch(this->Difficulty) { case 0: if (((g_manager->_persistentGameData)._achievements[0x155] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { this->Difficulty = 2; } else { this->Difficulty = 3; } break; case 1: switchD_0094c6c7_caseD_1: manager = g_manager; this->Difficulty = 0; break; case 2: switchD_0094c6c7_caseD_2: manager = g_manager; this->Difficulty = 1; break; case 3: switchD_0094c6c7_caseD_3: manager = g_manager; this->Difficulty = 2; } } local_34 = 0x11a; seed_fart_sound_override(&local_34); SoundEffects::Play(&manager->_sfxManager,local_34,1.0,2,0,1.0,0.0); manager = g_manager; (g_manager->_persistentGameData)._lastDifficulty = this->Difficulty; *(undefined1 *)&manager->_persistentGameData = 1; } else if (this->SelectedCharacterID == 0) { this->Status = 2; menuManager->_viewPositionSet[5].x = 0.0; menuManager->_state = 1; SelectRandomChar(this); input_poll_active_device(); } else if (this->IsCharacterUnlocked == 0) { local_34 = 0xbb; seed_fart_sound_override(&local_34); SoundEffects::Play(&manager->_sfxManager,local_34,1.0,2,0,1.0,0.0); } else { g_manager->_selectedDifficulty = this->Difficulty; KColor::SetFromARGB((KColor *)(emptySeed + -0xf),0xff000000); fadeColor._green = (float)pcVar11; fadeColor._red = (float)uVar10; fadeColor._blue = (float)ppcVar12; fadeColor._alpha = (float)uVar13; fadeColor._unk = iVar14; MenuManager::start_game(fadeColor); this->Status = 3; } } LAB_0094ca89: cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); isPageSwapPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (this->Status != 1) goto LAB_0094ceb0; local_30 = (char *)0xe; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isSeedEffectsPressed == '\0') { local_30 = (char *)0xf; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (isSeedEffectsPressed == '\0') { local_30 = (char *)0x155; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (isSeedEffectsPressed == '\0') { local_30 = (char *)0x159; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_30,0); if (isSeedEffectsPressed != '\0') goto LAB_0094cc67; LAB_0094cc94: local_30 = (char *)0x157; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_30,0); if (isSeedEffectsPressed == '\0') { local_30 = (char *)0x15b; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_30,0); if (isSeedEffectsPressed != '\0') goto LAB_0094cce6; } else { LAB_0094cce6: local_30 = (char *)0x56; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_30,0); if (isSeedEffectsPressed != '\0') goto LAB_0094cdef; } if ((this->_seedText)._size < 9) { isSeedEffectsPressed = 'A'; pcVar5 = (char *)0x41; local_34 = CONCAT31(local_34._1_3_,0x41); do { local_30 = pcVar5; isKeyPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_30,0); if (isKeyPressed != '\0') { seed_add_char(this); } isSeedEffectsPressed = isSeedEffectsPressed + '\x01'; pcVar5 = pcVar5 + 1; local_34 = CONCAT31(local_34._1_3_,isSeedEffectsPressed); } while (isSeedEffectsPressed < '['); pcVar5 = (char *)0x30; do { local_30 = pcVar5; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_30,0); if (isSeedEffectsPressed != '\0') { seed_add_char(this); } pcVar5 = pcVar5 + 1; } while ((int)pcVar5 < 0x3a); pcVar5 = (char *)0x140; do { local_30 = pcVar5; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_30,0); if (isSeedEffectsPressed != '\0') { seed_add_char(this); } pcVar5 = pcVar5 + 1; } while ((int)pcVar5 < 0x14a); } } else { LAB_0094cc67: local_30 = (char *)0x56; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a207d0,&local_30,0); if (isSeedEffectsPressed == '\0') goto LAB_0094cc94; LAB_0094cdef: if (_glfw == 0) { _glfwInputError(0x10001); } else { local_30 = (char *)(*DAT_00c736d0)(); if (local_30 != (char *)0x0) { pcVar5 = local_30 + 1; pcVar6 = local_30; do { isSeedEffectsPressed = *pcVar6; pcVar6 = pcVar6 + 1; } while (isSeedEffectsPressed != '\0'); if (pcVar6 != pcVar5) { FUN_0040c2f0(); uVar9 = 0; do { if (8 < (this->_seedText)._size) break; seed_add_char(this); uVar9 = uVar9 + 1; } while (uVar9 < (uint)((int)pcVar6 - (int)pcVar5)); } } } } local_30 = (char *)0x103; isSeedEffectsPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_30,0); if ((isSeedEffectsPressed != '\0') && ((this->_seedText)._size != 0)) { FUN_00684ee0(); } goto LAB_0094ceb0; } local_34 = 8; seed_fart_sound_override(&local_34); SoundEffects::Play(&manager->_sfxManager,local_34,1.0,0,0,1.0,0.0); menuManager = g_menuManager; seedBuf = &this->_seedText; if (0xf < (this->_seedText)._capacity) { seedBuf = *(std_string **)(this->_seedText)._buf; } (this->_seedText)._size = 0; seedBuf->_buf[0] = '\0'; (menuManager->_seedsObject)._isCustomRun = 0; } else { submit_seed(this); menuManager = g_menuManager; } this->Status = 0; menuManager->_viewPositionSet[5].x = 0.0; menuManager->_state = 1; g_manager->_isHotkeysEnabled = 1; LAB_0094ceb0: if (this->Status == 0) { if ((isSeedEffectsPressed != '\0') && (iVar14 = Seeds::CountUnlockedSeedEffects(), 0 < iVar14)) { MenuManager::push_menu(6,unused); } manager = g_manager; if (cVar2 != '\0') { this->Status = 1; local_34 = 8; seed_fart_sound_override(&local_34); uVar9 = 0; uVar8 = 0x3f800000; uVar7 = 0; uVar13 = 0; uVar10 = 0x3f800000; iVar14 = local_34; SoundEffects::Play(&manager->_sfxManager,local_34,1.0,0,0,1.0,0.0); menuManager = g_menuManager; if (this->Status == 1) { viewOffsetX = -480.0; } else { viewOffsetX = 0.0; } g_menuManager->_viewPositionSet[5].x = viewOffsetX; manager = g_manager; seedBuf = &this->_seedText; menuManager->_state = 1; manager->_isHotkeysEnabled = 0; if (0xf < (this->_seedText)._capacity) { seedBuf = *(std_string **)(this->_seedText)._buf; } (this->_seedText)._size = 0; seedBuf->_buf[0] = '\0'; emptySeedCapacity = 0xf; emptySeedSize = 0; emptySeed[0] = (void *)0x0; local_8 = (void *)0x0; std::string::string(acStackY_138 + 0x90,emptySeed); seed._buf[4] = (char)uVar10; seed._buf[5] = (char)((uint)uVar10 >> 8); seed._buf[6] = (char)((uint)uVar10 >> 0x10); seed._buf[7] = (char)((uint)uVar10 >> 0x18); seed._buf[0] = (char)iVar14; seed._buf[1] = (char)((uint)iVar14 >> 8); seed._buf[2] = (char)((uint)iVar14 >> 0x10); seed._buf[3] = (char)((uint)iVar14 >> 0x18); seed._buf[8] = (char)uVar13; seed._buf[9] = (char)((uint)uVar13 >> 8); seed._buf[10] = (char)((uint)uVar13 >> 0x10); seed._buf[0xb] = (char)((uint)uVar13 >> 0x18); seed._buf[0xc] = (char)uVar7; seed._buf[0xd] = (char)((uint)uVar7 >> 8); seed._buf[0xe] = (char)((uint)uVar7 >> 0x10); seed._buf[0xf] = (char)((uint)uVar7 >> 0x18); seed._size = uVar8; seed._capacity = uVar9; Seeds::SetStartSeed(&menuManager->_seedsObject,seed); local_8 = (void *)0xffffffff; if (0xf < emptySeedCapacity) { uVar9 = emptySeedCapacity + 1; ptr = emptySeed[0]; if (0xfff < uVar9) { ptr = *(void **)((int)emptySeed[0] + -4); uVar9 = emptySeedCapacity + 0x24; if (0x1f < (uint)((int)emptySeed[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } } if ((isPageSwapPressed != '\0') && (0.0 < (this->_PageSwapWidgetSprite)._color._tint[3])) { DoPageSwap(this); } } ExceptionList = local_10; return; } //@@ 0094d040 Menu_Character::submit_seed /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: copies the typed seed string +0xd64, Seeds::GetSeedEffect / String2Seed, plays sound 8, Seeds::SetStartSeed, MenuManager seeds flag +0x178; "Seed %d added to SaveState", "SeedMenu"; Menu_Character::handle_input */ void __thiscall Menu_Character::submit_seed(Menu_Character *this) { byte bVar1; int iVar2; std_string seedString; std_string seedString_00; std_string seed; int seedEffect; byte *localizedText; void *ptr; std_string *seedTextPtr; byte *strCursor; uint size; int iVar3; void *pvVar4; undefined4 *seedTitleText; int specialSeedEntry; uint uVar5; char acStackY_d8 [128]; undefined4 in_stack_ffffffac; Menu_Character *pMVar6; undefined4 in_stack_ffffffb0; undefined4 uVar7; undefined4 in_stack_ffffffb4; undefined4 uVar8; undefined4 in_stack_ffffffb8; undefined4 uVar9; undefined4 in_stack_ffffffbc; undefined4 uVar10; uint in_stack_ffffffc0; Menu_Character *local_28; byte local_21; void *tmpText; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 tmpTextSize; uint tmpTextCapacity; undefined4 local_8; Manager *manager; MenuManager *menuManager; undefined1 *seedNameText; local_8 = __security_cookie ^ (uint)(acStackY_d8 + 0xd4); local_28 = this; std::string::string(acStackY_d8 + 0x84,&this->_seedText); seedString._buf[4] = (char)in_stack_ffffffb0; seedString._buf[5] = (char)((uint)in_stack_ffffffb0 >> 8); seedString._buf[6] = (char)((uint)in_stack_ffffffb0 >> 0x10); seedString._buf[7] = (char)((uint)in_stack_ffffffb0 >> 0x18); seedString._buf[0] = (char)in_stack_ffffffac; seedString._buf[1] = (char)((uint)in_stack_ffffffac >> 8); seedString._buf[2] = (char)((uint)in_stack_ffffffac >> 0x10); seedString._buf[3] = (char)((uint)in_stack_ffffffac >> 0x18); seedString._buf[8] = (char)in_stack_ffffffb4; seedString._buf[9] = (char)((uint)in_stack_ffffffb4 >> 8); seedString._buf[10] = (char)((uint)in_stack_ffffffb4 >> 0x10); seedString._buf[0xb] = (char)((uint)in_stack_ffffffb4 >> 0x18); seedString._buf[0xc] = (char)in_stack_ffffffb8; seedString._buf[0xd] = (char)((uint)in_stack_ffffffb8 >> 8); seedString._buf[0xe] = (char)((uint)in_stack_ffffffb8 >> 0x10); seedString._buf[0xf] = (char)((uint)in_stack_ffffffb8 >> 0x18); seedString._size = in_stack_ffffffbc; seedString._capacity = in_stack_ffffffc0; seedEffect = Seeds::GetSeedEffect(seedString); seedTextPtr = &this->_seedText; if (seedEffect == 0) { uVar5 = Seeds::String2Seed(seedTextPtr); manager = g_manager; if (uVar5 != 0) { local_28 = (Menu_Character *)0x8; seed_fart_sound_override((int *)&local_28); uVar5 = 0; uVar10 = 0x3f800000; uVar9 = 0; uVar8 = 0; uVar7 = 0x3f800000; pMVar6 = local_28; SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,0,0,1.0,0.0); menuManager = g_menuManager; std::string::string(acStackY_d8 + 0x84,seedTextPtr); seed._buf[4] = (char)uVar7; seed._buf[5] = (char)((uint)uVar7 >> 8); seed._buf[6] = (char)((uint)uVar7 >> 0x10); seed._buf[7] = (char)((uint)uVar7 >> 0x18); seed._buf._0_4_ = pMVar6; seed._buf[8] = (char)uVar8; seed._buf[9] = (char)((uint)uVar8 >> 8); seed._buf[10] = (char)((uint)uVar8 >> 0x10); seed._buf[0xb] = (char)((uint)uVar8 >> 0x18); seed._buf[0xc] = (char)uVar9; seed._buf[0xd] = (char)((uint)uVar9 >> 8); seed._buf[0xe] = (char)((uint)uVar9 >> 0x10); seed._buf[0xf] = (char)((uint)uVar9 >> 0x18); seed._size = uVar10; seed._capacity = uVar5; Seeds::SetStartSeed(&menuManager->_seedsObject,seed); (g_menuManager->_seedsObject)._isCustomRun = 1; return; } local_28 = (Menu_Character *)0xbb; seed_fart_sound_override((int *)&local_28); SoundEffects::Play(&manager->_sfxManager,(int)local_28,1.0,2,0,1.0,0.0); if (0xf < (this->_seedText)._capacity) { seedTextPtr = *(std_string **)seedTextPtr->_buf; } (this->_seedText)._size = 0; seedTextPtr->_buf[0] = '\0'; (g_menuManager->_seedsObject)._isCustomRun = 0; return; } std::string::string(acStackY_d8 + 0x84,seedTextPtr); seedString_00._buf[4] = (char)in_stack_ffffffb0; seedString_00._buf[5] = (char)((uint)in_stack_ffffffb0 >> 8); seedString_00._buf[6] = (char)((uint)in_stack_ffffffb0 >> 0x10); seedString_00._buf[7] = (char)((uint)in_stack_ffffffb0 >> 0x18); seedString_00._buf[0] = (char)in_stack_ffffffac; seedString_00._buf[1] = (char)((uint)in_stack_ffffffac >> 8); seedString_00._buf[2] = (char)((uint)in_stack_ffffffac >> 0x10); seedString_00._buf[3] = (char)((uint)in_stack_ffffffac >> 0x18); seedString_00._buf[8] = (char)in_stack_ffffffb4; seedString_00._buf[9] = (char)((uint)in_stack_ffffffb4 >> 8); seedString_00._buf[10] = (char)((uint)in_stack_ffffffb4 >> 0x10); seedString_00._buf[0xb] = (char)((uint)in_stack_ffffffb4 >> 0x18); seedString_00._buf[0xc] = (char)in_stack_ffffffb8; seedString_00._buf[0xd] = (char)((uint)in_stack_ffffffb8 >> 8); seedString_00._buf[0xe] = (char)((uint)in_stack_ffffffb8 >> 0x10); seedString_00._buf[0xf] = (char)((uint)in_stack_ffffffb8 >> 0x18); seedString_00._size = in_stack_ffffffbc; seedString_00._capacity = in_stack_ffffffc0; seedEffect = Seeds::GetSeedEffect(seedString_00); manager = g_manager; local_21 = *(byte *)((int)(g_manager->_persistentGameData)._cutsceneCounters + seedEffect + 0x74); if ((g_manager->_persistentGameData)._isReadOnly == 0) { *(undefined1 *)((int)(g_manager->_persistentGameData)._cutsceneCounters + seedEffect + 0x74) = 1 ; (manager->_persistentGameData).field_0xf14 = 0; *(undefined1 *)&manager->_persistentGameData = 1; KAGE_LogMessage(1,(byte *)"Seed %d added to SaveState\n"); } PersistentGameData::Save(&g_manager->_persistentGameData); Seeds::RemoveBlockingSeedEffects(&g_menuManager->_seedsObject,seedEffect); Seeds::AddSeedEffect(&g_menuManager->_seedsObject,seedEffect); Menu_SpecialSeeds::Reset(&g_menuManager->_menuSpecialSeeds); manager = g_manager; if (local_21 == 0) { localizedText = &g_menuManager->field_0x264c; if (0xf < *(uint *)&g_menuManager->field_0x2660) { localizedText = *(byte **)localizedText; } if (*localizedText == 0x23) { local_21 = 0; StringTable::get_string (&g_manager->_stringTable,(byte *)"SeedMenu",*(int *)&g_manager->_stringTable, localizedText + 1,&local_21); if (local_21 == 0) { local_21 = 0; localizedText = StringTable::get_string (&manager->_stringTable,(byte *)"SeedMenu",*(int *)&manager->_stringTable, localizedText + 1,&local_21); } } tmpText = (void *)0x0; tmpTextSize = 0; tmpTextCapacity = 0xf; strCursor = localizedText; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); std::string::assign((char *)&tmpText,localizedText,(int)strCursor - (int)(localizedText + 1)); pMVar6 = local_28; seedTitleText = (undefined4 *)&local_28->field_0xd84; if ((void **)seedTitleText != &tmpText) { uVar5 = *(uint *)&local_28->field_0xd98; if (0xf < uVar5) { pvVar4 = (void *)*seedTitleText; size = uVar5 + 1; ptr = pvVar4; if (0xfff < size) { ptr = *(void **)((int)pvVar4 + -4); size = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) goto LAB_0094d3a4; } operator_delete(ptr,size); } *(undefined4 *)&pMVar6->field_0xd94 = 0; *(undefined4 *)&pMVar6->field_0xd98 = 0xf; goto LAB_0094d2b9; } LAB_0094d2cc: if (0xf < tmpTextCapacity) { uVar5 = tmpTextCapacity + 1; pvVar4 = tmpText; if (0xfff < uVar5) { pvVar4 = *(void **)((int)tmpText + -4); uVar5 = tmpTextCapacity + 0x24; if (0x1f < (uint)((int)tmpText + (-4 - (int)pvVar4))) goto LAB_0094d3a4; } operator_delete(pvVar4,uVar5); } } else { localizedText = &g_menuManager->field_0x2664; if (0xf < *(uint *)&g_menuManager->field_0x2678) { localizedText = *(byte **)localizedText; } if (*localizedText == 0x23) { local_21 = 0; StringTable::get_string (&g_manager->_stringTable,(byte *)"SeedMenu",*(int *)&g_manager->_stringTable, localizedText + 1,&local_21); if (local_21 == 0) { local_21 = 0; localizedText = StringTable::get_string (&manager->_stringTable,(byte *)"SeedMenu",*(int *)&manager->_stringTable, localizedText + 1,&local_21); } } tmpText = (void *)0x0; tmpTextSize = 0; tmpTextCapacity = 0xf; strCursor = localizedText; do { bVar1 = *strCursor; strCursor = strCursor + 1; } while (bVar1 != 0); std::string::assign((char *)&tmpText,localizedText,(int)strCursor - (int)(localizedText + 1)); seedTitleText = (undefined4 *)&local_28->field_0xd84; if ((void **)seedTitleText == &tmpText) goto LAB_0094d2cc; std::string::_Tidy_deallocate((char *)seedTitleText); LAB_0094d2b9: *seedTitleText = tmpText; seedTitleText[1] = uStack_1c; seedTitleText[2] = uStack_18; seedTitleText[3] = uStack_14; *(ulonglong *)(seedTitleText + 4) = CONCAT44(tmpTextCapacity,tmpTextSize); } uVar5 = 0; specialSeedEntry = *(int *)&g_menuManager->field_0x267c; iVar3 = *(int *)&g_menuManager->field_0x2680 - specialSeedEntry; iVar2 = iVar3 >> 0x1f; iVar3 = iVar3 / 0x28 + iVar2; if (iVar3 != iVar2) { do { if (*(int *)(specialSeedEntry + 0xc) == seedEffect) { SpecialSeed::get_display_name(); goto LAB_0094d345; } uVar5 = uVar5 + 1; specialSeedEntry = specialSeedEntry + 0x28; } while (uVar5 < (uint)(iVar3 - iVar2)); } tmpText = (void *)0x0; tmpTextCapacity = 0xf; tmpTextSize = 0; LAB_0094d345: pMVar6 = local_28; seedNameText = &local_28->field_0xd9c; if ((void **)seedNameText == &tmpText) { if (0xf < tmpTextCapacity) { uVar5 = tmpTextCapacity + 1; pvVar4 = tmpText; if (0xfff < uVar5) { pvVar4 = *(void **)((int)tmpText + -4); uVar5 = tmpTextCapacity + 0x24; if (0x1f < (uint)((int)tmpText + (-4 - (int)pvVar4))) { LAB_0094d3a4: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } } else { std::string::_Tidy_deallocate(seedNameText); *(void **)seedNameText = tmpText; *(undefined4 *)&pMVar6->field_0xda0 = uStack_1c; *(undefined4 *)&pMVar6->field_0xda4 = uStack_18; *(undefined4 *)&pMVar6->field_0xda8 = uStack_14; *(ulonglong *)&pMVar6->field_0xdac = CONCAT44(tmpTextCapacity,tmpTextSize); } pMVar6->_seedUnlockPageState = 1; seedTextPtr = &pMVar6->_seedText; pMVar6->_seedUnlockPageTimer = 0; if (0xf < (pMVar6->_seedText)._capacity) { seedTextPtr = *(std_string **)(pMVar6->_seedText)._buf; } (pMVar6->_seedText)._size = 0; seedTextPtr->_buf[0] = '\0'; (g_menuManager->_seedsObject)._isCustomRun = 0; return; } //@@ 0094d500 Menu_Character::UpdateRotations /* WARNING: Unable to use type for symbol portraitIdx */ /* ZHL [exact] __thiscall void Menu_Character::UpdateRotations(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Character::UpdateRotations(Menu_Character *this) { KColor fadeColor; byte bVar1; void *pvVar2; LayerState *layer; int iVar3; byte *curAnimName; uint uVar4; int extraout_ECX; Menu_Character_Entry *wantedAnimName; byte *pbVar5; int nextCharacterId; bool isLess; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; byte isMarkUnlocked; Manager *cachedManager; float local_1c; uint local_18; Menu_Character_Entry *local_14; void *local_10; float cosPortraitAngle; float portraitIdx; ANM2 *bigCharSprite; Manager *manager; MenuManager *menuManager; int *randomRotationAmount; manager = g_manager; fVar9 = 0.0; cachedManager = g_manager; (this->_PageSwapWidgetSprite)._color._tint[3] = 0.0; local_18 = 0; do { iVar3 = *(int *)((int)&DAT_00b242f4 + local_18); if ((iVar3 < 0) || (local_10 = (manager->_entityConfig)._players._begin, ((int)(manager->_entityConfig)._players._end - (int)local_10) / 0x148 <= iVar3)) { pvVar2 = (void *)0x0; } else { pvVar2 = (void *)(iVar3 * 0x148 + (int)local_10); } uVar4 = *(uint *)((int)pvVar2 + 0xe8); fVar10 = 1.0; if (((int)uVar4 < 0) || ((uVar4 < 0x282 && ((((uVar4 == 0 || ((manager->_persistentGameData)._achievements[uVar4] != 0)) || (((manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) && (((iVar3 != 9 && (iVar3 != 0x1e)) || ((manager->_persistentGameData)._eventCounters[0x15] != 0)))))))) { (this->_PageSwapWidgetSprite)._color._tint[3] = 1.0; break; } local_18 = local_18 + 0x18; } while (local_18 < 0x1b0); uVar4 = 0; if (DAT_00c79888 - (int)g_modCharacters >> 3 != 0) { do { if (g_modCharacters[uVar4 * 2] != g_modCharacters[uVar4 * 2 + 1]) { (this->_PageSwapWidgetSprite)._color._tint[3] = 1.0; break; } uVar4 = uVar4 + 1; } while (uVar4 < (uint)(DAT_00c79888 - (int)g_modCharacters >> 3)); } iVar3 = this->SelectedCharacterID; if ((iVar3 < 0x12) && (bVar1 = Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *) (&PTR_s_00_Random_00b24140 + (iVar3 + this->_characterMenuShown * 0x12) * 6 ),uVar4), bVar1 == 0)) { this->IsCharacterUnlocked = 0; pbVar5 = &DAT_00000004; bigCharSprite = &this->_BigCharPageSprite; do { layer = ANM2::GetLayer(bigCharSprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while ((int)pbVar5 < 0x10); layer = ANM2::GetLayer(bigCharSprite,(byte *)0x10); layer->_visible = 1; layer = ANM2::GetLayer(bigCharSprite,(byte *)0x3); layer->_visible = 1; if (((this->_BigCharPageSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(this->_BigCharPageSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(this->_BigCharPageSprite)._animState._animation + 0x80))))) { pvVar2 = (this->_BigCharPageSprite)._animState._animData; local_10 = *(void **)((int)pvVar2 + 0x44); if ((pvVar2 == (void *)0x0) || (((int)local_10 < 0 || (*(int *)((int)pvVar2 + 0x1c) <= (int)local_10)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar9 = 1.0; LAB_0094d92f: *(undefined4 *)((int)(this->_BigCharPageSprite)._animState._layerFrames + (int)local_10 * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->_BigCharPageSprite)._animState,(int)local_10,fVar9); } } else { this->IsCharacterUnlocked = 1; if (0x11 < iVar3) goto LAB_0094d956; pbVar5 = &DAT_00000004; do { layer = ANM2::GetLayer(&this->_BigCharPageSprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 1; } while ((int)pbVar5 < 0x10); if (this->SelectedCharacterID < 0x12) { iVar3 = (this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 0x18; uVar4 = *(uint *)(&DAT_00b2414c + iVar3); if ((uVar4 == 0) || ((uVar4 != 0xfffffffe && (((int)uVar4 < 0 || ((uVar4 < 0x282 && (((g_manager->_persistentGameData)._achievements[uVar4] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))))))) { isMarkUnlocked = 1; } else { isMarkUnlocked = 0; } bigCharSprite = &this->_BigCharPageSprite; layer = ANM2::GetLayer(bigCharSprite,&DAT_00000008); layer->_visible = isMarkUnlocked; layer = ANM2::GetLayer(bigCharSprite,&DAT_00000007); layer->_visible = isMarkUnlocked; uVar4 = *(uint *)(&DAT_00b24150 + iVar3); if ((uVar4 == 0) || ((uVar4 != 0xfffffffe && (((int)uVar4 < 0 || ((uVar4 < 0x282 && (((g_manager->_persistentGameData)._achievements[uVar4] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))))))) { isMarkUnlocked = 1; } else { isMarkUnlocked = 0; } layer = ANM2::GetLayer(bigCharSprite,&DAT_0000000d); layer->_visible = isMarkUnlocked; layer = ANM2::GetLayer(bigCharSprite,(byte *)0xc); layer->_visible = isMarkUnlocked; uVar4 = *(uint *)(&DAT_00b24154 + iVar3); if ((uVar4 == 0) || ((uVar4 != 0xfffffffe && (((int)uVar4 < 0 || ((uVar4 < 0x282 && (((g_manager->_persistentGameData)._achievements[uVar4] != 0 || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))))))) { isMarkUnlocked = 1; } else { isMarkUnlocked = 0; } layer = ANM2::GetLayer(bigCharSprite,&DAT_0000000f); layer->_visible = isMarkUnlocked; layer = ANM2::GetLayer(bigCharSprite,&DAT_0000000e); layer->_visible = isMarkUnlocked; } layer = ANM2::GetLayer(&this->_BigCharPageSprite,(byte *)0x10); layer->_visible = 0; layer = ANM2::GetLayer(&this->_BigCharPageSprite,(byte *)0x3); layer->_visible = 1; if (((this->_BigCharPageSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(this->_BigCharPageSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(this->_BigCharPageSprite)._animState._animation + 0x80))))) { pvVar2 = (this->_BigCharPageSprite)._animState._animData; local_10 = *(void **)((int)pvVar2 + 0x44); if ((pvVar2 == (void *)0x0) || (((int)local_10 < 0 || (*(int *)((int)pvVar2 + 0x1c) <= (int)local_10)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar9 = 0.0; goto LAB_0094d92f; } } fVar9 = 0.0; fVar10 = 1.0; cachedManager = g_manager; LAB_0094d956: local_18 = this->_numCharacters; this->IsInputPossible = 0; local_1c = 0.0; if (0 < (int)local_18) { do { portraitIdx = local_1c; fVar8 = this->_scrollSpeed; local_10 = (void *)-(((float)(int)local_1c * 6.2831855) / (float)(int)local_18); fVar7 = (360.0 / (float)(int)local_18) * (float)this->_numCharacters_MINUS_SelectedEntry; if (this->Status == 2) { fVar6 = ((float)this->_randomRotationAmount - 60.0) / -60.0; if (fVar6 <= fVar9) { fVar6 = fVar9; } if (fVar10 <= fVar6) { fVar6 = fVar10; } fVar8 = (fVar8 / 6.0 - this->_randomRotationVelocity) * fVar6 + this->_randomRotationVelocity; } local_1c = this->_horizontalScrollPosition; if (fVar7 <= local_1c) { if (local_1c <= fVar7) { if (this->Status == 2) { randomRotationAmount = &this->_randomRotationAmount; *randomRotationAmount = *randomRotationAmount + -1; if (*randomRotationAmount < 0) { fadeColor._alpha = 1.0; fadeColor._red = 0.0; fadeColor._green = 0.0; fadeColor._blue = 0.0; fadeColor._unk = 0; MenuManager::start_game(fadeColor); menuManager = g_menuManager; this->Status = 3; menuManager->_viewPositionSet[5].x = 0.0; menuManager->_state = 1; } else { iVar3 = this->_numCharacters_MINUS_SelectedEntry + -1; nextCharacterId = this->SelectedCharacterID + 1; this->_numCharacters_MINUS_SelectedEntry = iVar3; this->SelectedCharacterID = nextCharacterId; if (iVar3 < 0) { this->_numCharacters_MINUS_SelectedEntry = local_18 + -1; } local_18 = nextCharacterId; if (nextCharacterId < 0x12) { local_14 = (Menu_Character_Entry *)(&PTR_s_00_Random_00b24140 + nextCharacterId * 6) ; iVar3 = 2; do { if ((*(char *)(local_14 + 2) == '\0') || (bVar1 = Menu_Character_Entry::IsCharacterAvailable(local_14,iVar3), bVar1 != 0 )) break; local_18 = local_18 + 1; local_14 = local_14 + 6; this->SelectedCharacterID = local_18; iVar3 = extraout_ECX; } while ((int)local_18 < 0x12); } if ((DAT_00c79888 - (int)g_modCharacters >> 3) + 0x12 <= (int)local_18) { this->SelectedCharacterID = 0; } local_14 = (Menu_Character_Entry *)0xc3; seed_fart_sound_override((int *)&local_14); SoundEffects::Play(&cachedManager->_sfxManager,(int)local_14,1.0,0,0,1.0,0.0); if (this->SelectedCharacterID < 0x12) { pbVar5 = (this->_BigCharPageSprite)._animState._animData; local_14 = (Menu_Character_Entry *) (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6]; if (pbVar5 != (byte *)0x0) { curAnimName = pbVar5; wantedAnimName = local_14; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnimName = *(byte **)pbVar5; } do { bVar1 = *curAnimName; isLess = bVar1 < *(byte *)wantedAnimName; if (bVar1 != *(byte *)wantedAnimName) { LAB_0094dc27: uVar4 = -(uint)isLess | 1; goto LAB_0094dc2c; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)wantedAnimName->field_0x1; if (bVar1 != wantedAnimName->field_0x1) goto LAB_0094dc27; curAnimName = curAnimName + 2; wantedAnimName = (Menu_Character_Entry *)&wantedAnimName->field_0x2; } while (bVar1 != 0); uVar4 = 0; LAB_0094dc2c: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((this->_BigCharPageSprite)._animState._isPlaying != 0)) )) goto LAB_0094dc62; } bVar1 = ANM2::SetAnimation(&this->_BigCharPageSprite,(byte *)local_14,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_BigCharPageSprite)._animState); (this->_BigCharPageSprite)._animState._isPlaying = 1; } } } LAB_0094dc62: local_1c = this->_horizontalScrollPosition; cachedManager = g_manager; } else { this->IsInputPossible = 1; } } else { fVar7 = local_1c - fVar7; fVar9 = fVar7; if (fVar8 <= fVar7) { fVar9 = fVar8; } if (180.0 <= fVar7) { local_1c = local_1c + fVar9; this->_horizontalScrollPosition = local_1c; } else { local_1c = local_1c - fVar9; this->_horizontalScrollPosition = local_1c; } } } else { fVar7 = fVar7 - local_1c; fVar9 = fVar7; if (fVar8 <= fVar7) { fVar9 = fVar8; } if (180.0 <= fVar7) { local_1c = local_1c - fVar9; this->_horizontalScrollPosition = local_1c; } else { local_1c = fVar9 + local_1c; this->_horizontalScrollPosition = local_1c; } } if (0.0 <= local_1c) { if (360.0 < local_1c) { this->_horizontalScrollPosition = 0.0; local_1c = 0.0; } } else { this->_horizontalScrollPosition = 360.0; local_1c = 360.0; } cosPortraitAngle = cos((float)local_10); fVar9 = sin((float)local_10); local_10 = (void *)((90.0 - local_1c) * 0.017453292); local_14 = (Menu_Character_Entry *)cos((float)local_10); fVar10 = sin((float)local_10); fVar7 = (float)local_14 * fVar9 + fVar10 * cosPortraitAngle; fVar8 = (fVar7 - 1.0) * -0.5; if (fVar8 <= 0.0) { fVar8 = 0.0; } if (1.0 <= fVar8) { fVar8 = 1.0; } fVar6 = (this->_characterWheelDepth - 1.0) * fVar8 + 1.0; fVar8 = this->_characterWheelWidth; *(float *)((int)(this->_portraitScales)._begin + (int)portraitIdx * 4) = 1.0 / fVar6; pvVar2 = (this->_portraitPositions)._begin; *(float *)((int)pvVar2 + (int)portraitIdx * 8) = ((((float)local_14 * cosPortraitAngle - fVar10 * fVar9) * 70.0) / fVar6) * fVar8 + 240.0; fVar10 = 1.0; *(float *)((int)pvVar2 + (int)portraitIdx * 8 + 4) = ((fVar7 * 70.0) / fVar6) * 0.4 + 85.0; local_1c = (float)((int)portraitIdx + 1); local_18 = this->_numCharacters; fVar9 = 0.0; } while ((int)local_1c < (int)local_18); } if (this->SelectedCharacterID < 0x12) { this->_completionWidget = *(CompletionWidget *) (&DAT_00b24144 + ((-(uint)(this->_characterMenuShown != 0) & 0x12) + this->SelectedCharacterID) * 0x18); CompletionMarks::update_layers(); } return; } //@@ 0094de50 Menu_Character::SelectRandomChar /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON name; called from Menu_Character::handle_input, builds a list of unlocked characters from the menu table DAT_00b24144 (+0xdb4 tainted page, Manager+0x2a678 PlayerConfig 0x148 stride, achievement check +0x4c) and logs "random: %s" */ void __thiscall Menu_Character::SelectRandomChar(Menu_Character *this) { byte isAvailable; undefined8 *candidates; void *pvVar1; int extraout_ECX; int iVar2; EntityConfig_Player *playerConfig; uint uVar3; qword *heapBytes; uint uVar4; undefined **menuEntry; int iVar5; int entryIndex; void *displayName [4]; uint displayNameSize; uint displayNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; longlong allocBytes; qword prevBytes; puStack_20 = (undefined1 *)(displayName + 0xe); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0b95d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(displayName + 0xb); ExceptionList = &local_1c; uVar4 = 0; allocBytes = (ulonglong)((DAT_00c79888 - (int)g_modCharacters >> 3) + 0x12) * 4; candidates = operator_new_tracked (-(uint)((int)((ulonglong)allocBytes >> 0x20) != 0) | (uint)allocBytes); iVar5 = 1; *candidates = 0xffffffffffffffff; candidates[1] = 0xffffffffffffffff; candidates[2] = 0xffffffffffffffff; candidates[3] = 0xffffffffffffffff; candidates[4] = 0xffffffffffffffff; candidates[5] = 0xffffffffffffffff; candidates[6] = 0xffffffffffffffff; candidates[7] = 0xffffffffffffffff; candidates[8] = 0xffffffffffffffff; do { iVar2 = *(int *)(&DAT_00b24144 + (iVar5 + this->_characterMenuShown * 0x12) * 0x18); if ((iVar2 < 0) || (pvVar1 = (g_manager->_entityConfig)._players._begin, ((int)(g_manager->_entityConfig)._players._end - (int)pvVar1) / 0x148 <= iVar2)) { pvVar1 = (void *)0x0; } else { pvVar1 = (void *)(iVar2 * 0x148 + (int)pvVar1); } uVar3 = *(uint *)((int)pvVar1 + 0xe8); if (((int)uVar3 < 0) || (((uVar3 < 0x282 && (((uVar3 == 0 || ((g_manager->_persistentGameData)._achievements[uVar3] != 0)) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) && (((iVar2 != 9 && (iVar2 != 0x1e)) || ((g_manager->_persistentGameData)._eventCounters[0x15] != 0)))))) { *(int *)((int)candidates + uVar4 * 4) = iVar5; uVar4 = uVar4 + 1; } iVar5 = iVar5 + 1; } while (iVar5 < 0x12); iVar5 = 0x12; if (0x12 < (DAT_00c79888 - (int)g_modCharacters >> 3) + 0x12) { do { *(int *)((int)candidates + uVar4 * 4) = iVar5; iVar5 = iVar5 + 1; uVar4 = uVar4 + 1; } while (iVar5 < (DAT_00c79888 - (int)g_modCharacters >> 3) + 0x12); } if (uVar4 == 0) { uVar3 = 0; } else { uVar3 = Random(); uVar3 = uVar3 % uVar4; } entryIndex = 0; iVar5 = *(int *)((int)candidates + uVar3 * 4); iVar2 = this->_numCharacters; *(int *)&this->field_0x14 = iVar5; this->_randomRotationAmount = iVar5 + iVar2 * 2 + iVar2; this->_randomRotationVelocity = (360.0 / (float)iVar2) / 30.0; if (0 < iVar5) { menuEntry = &PTR_s_00_Random_00b24140; do { if (0xb242ef < (int)menuEntry) break; if ((*(char *)(menuEntry + 2) != '\0') && (isAvailable = Menu_Character_Entry::IsCharacterAvailable ((Menu_Character_Entry *)menuEntry,iVar2), iVar2 = extraout_ECX, isAvailable == 0)) { this->_randomRotationAmount = this->_randomRotationAmount + -1; } entryIndex = entryIndex + 1; menuEntry = menuEntry + 6; } while (entryIndex < iVar5); } if (iVar5 < 0x12) { iVar5 = *(int *)(&DAT_00b24144 + ((-(uint)(this->_characterMenuShown != 0) & 0x12) + iVar5) * 0x18); } else { iVar5 = *(int *)((int)g_modCharacters + ((-(uint)(this->_characterMenuShown != 0) & 4) - 0x90) + iVar5 * 8); } playerConfig = (EntityConfig_Player *) (iVar5 * 0x148 + (int)(g_manager->_entityConfig)._players._begin); EntityConfig_Player::GetDisplayName(playerConfig,(std_string *)displayName,playerConfig); local_14 = (void *)0x0; KAGE_LogMessage(1,(byte *)"random: %s\n"); if (0xf < displayNameCapacity) { uVar4 = displayNameCapacity + 1; pvVar1 = displayName[0]; if (0xfff < uVar4) { pvVar1 = *(void **)((int)displayName[0] + -4); uVar4 = displayNameCapacity + 0x24; if (0x1f < (uint)((int)displayName[0] + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,uVar4); } displayNameSize = 0; displayNameCapacity = 0xf; displayName[0] = (void *)((uint)displayName[0] & 0xffffff00); if (g_mainHeap == (void *)0x0) { heapBytes = &g_allocatedBytesNoHeap; } else { heapBytes = (qword *)((int)g_mainHeap + 0x30); } if (candidates != (undefined8 *)0x0) { uVar4 = *(uint *)((int)candidates + -4); prevBytes = *heapBytes; *(uint *)heapBytes = (uint)*heapBytes - uVar4; *(uint *)((int)heapBytes + 4) = *(uint *)((int)heapBytes + 4) - (uint)((uint)prevBytes < uVar4); free((uint *)((int)candidates + -4)); } ExceptionList = local_1c; return; } //@@ 0094e170 Menu_Character::render_page_snapshot /* DB: ? ECX=Menu_Character: pushes the current render target, binds and clears the target at +0xfe0, resets blend state, draws the page (FUN_0094bbd0(&Vector::Zero, 1)) and pops the target; callers Menu_Character::Update and Menu_Character::DoPageSwap (page-swap transition image) */ void Menu_Character::render_page_snapshot(void) { undefined4 *puVar1; int in_ECX; undefined8 local_c; local_c = 0; std::vector::resize(&local_c); puVar1 = std::deque::back(); if ((byte *)(puVar1 + 1) != (byte *)0x0) { *(byte *)(puVar1 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar1 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)(in_ECX + 0xfe0),0); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 6; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 1; render_wheel(); _glfw_context_reset(1); pop_render_target(); return; } //@@ 0094e210 Menu_Character::DoPageSwap /* ZHL [exact] __thiscall void Menu_Character::DoPageSwap(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Character::DoPageSwap(Menu_Character *this) { byte wantedChar; byte *curAnimName; uint cmpResult; char *wantedAnimName; byte *faceNameCursor; bool isLess; Menu_Character *local_8; byte *animData; Manager *manager; this->Status = 4; animData = (this->_CharacterMenuBGSprite)._animState._animData; if (animData == (byte *)0x0) { LAB_0094e273: local_8 = this; wantedChar = ANM2::SetAnimation(&this->_CharacterMenuBGSprite,(byte *)"SwapOut",1); if (wantedChar != 0) { AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._animState); (this->_CharacterMenuBGSprite)._animState._isPlaying = 1; } } else { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } wantedAnimName = "SwapOut"; do { wantedChar = *curAnimName; isLess = wantedChar < (byte)*wantedAnimName; if (wantedChar != *wantedAnimName) { LAB_0094e260: cmpResult = -(uint)isLess | 1; goto LAB_0094e265; } if (wantedChar == 0) break; wantedChar = curAnimName[1]; isLess = wantedChar < (byte)wantedAnimName[1]; if (wantedChar != wantedAnimName[1]) goto LAB_0094e260; curAnimName = curAnimName + 2; wantedAnimName = wantedAnimName + 2; } while (wantedChar != 0); cmpResult = 0; LAB_0094e265: if ((cmpResult != 0) || ((animData[0x34] != 0 && ((this->_CharacterMenuBGSprite)._animState._isPlaying == 0)))) goto LAB_0094e273; } animData = (this->_CharacterMenuBGSprite)._overlayAnimState._animData; local_8 = (Menu_Character *)(&PTR_s_Face1_00b24134)[this->_characterMenuShown * -3]; if (animData != (byte *)0x0) { curAnimName = animData; faceNameCursor = (byte *)local_8; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } do { wantedChar = *curAnimName; isLess = wantedChar < *faceNameCursor; if (wantedChar != *faceNameCursor) { LAB_0094e2e0: cmpResult = -(uint)isLess | 1; goto LAB_0094e2e5; } if (wantedChar == 0) break; wantedChar = curAnimName[1]; isLess = wantedChar < faceNameCursor[1]; if (wantedChar != faceNameCursor[1]) goto LAB_0094e2e0; curAnimName = curAnimName + 2; faceNameCursor = faceNameCursor + 2; } while (wantedChar != 0); cmpResult = 0; LAB_0094e2e5: if ((cmpResult == 0) && ((animData[0x34] == 0 || ((this->_CharacterMenuBGSprite)._overlayAnimState._isPlaying != 0))) ) goto LAB_0094e310; } wantedChar = ANM2::SetOverlayAnimation(&this->_CharacterMenuBGSprite,(byte *)local_8,1); if (wantedChar != 0) { AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._overlayAnimState); (this->_CharacterMenuBGSprite)._overlayAnimState._isPlaying = 1; } LAB_0094e310: render_page_snapshot(); if (this->_characterMenuShown == 0) { wantedChar = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,(byte *)"Appear",1); if (wantedChar != 0) { AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } local_8 = (Menu_Character *)0x23a; } else { wantedChar = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,(byte *)"Disappear",1); if (wantedChar != 0) { AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } local_8 = (Menu_Character *)0x239; } manager = g_manager; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&manager->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); return; } //@@ 0094e3b0 FUN_0094e3b0 void FUN_0094e3b0(void) { libm_sse2_pow_precise(); return; } //@@ 0094e3d0 std::vector<8byte>::_Emplace_reallocate_global /* DB: ? global vector g_modCharacters..8c (8-byte {id,float} character entries); Menu_Character::Reset pushes {entry[0], entry[0x49]} for each unlocked character */ int * std::vector<8byte>::_Emplace_reallocate_global(int *param_1,int *param_2) { uint uVar1; int *piVar2; int iVar3; int *_Dst; int *ptr; uint uVar4; uint uVar5; int iVar6; iVar3 = (int)DAT_00c79888 - (int)g_modCharacters >> 3; iVar6 = (int)param_1 - (int)g_modCharacters; if (iVar3 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar3 + 1; uVar4 = (int)DAT_00c7988c - (int)g_modCharacters >> 3; if (0x1fffffff - (uVar4 >> 1) < uVar4) { uVar5 = 0x1fffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; uVar5 = uVar1; if (uVar1 <= uVar4) { uVar5 = uVar4; } if (0x1fffffff < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar5 * 8); piVar2 = _Dst + (iVar6 >> 3) * 2; iVar3 = param_2[1]; *piVar2 = *param_2; piVar2[1] = iVar3; if (param_1 == DAT_00c79888) { memmove(_Dst,g_modCharacters,(int)DAT_00c79888 - (int)g_modCharacters); } else { memmove(_Dst,g_modCharacters,(int)param_1 - (int)g_modCharacters); memmove(piVar2 + 2,param_1,(int)DAT_00c79888 - (int)param_1); } if (g_modCharacters != (int *)0x0) { uVar4 = (int)DAT_00c7988c - (int)g_modCharacters & 0xfffffff8; ptr = g_modCharacters; if (0xfff < uVar4) { ptr = (int *)g_modCharacters[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)g_modCharacters + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } g_modCharacters = _Dst; DAT_00c79888 = _Dst + uVar1 * 2; DAT_00c7988c = _Dst + uVar5 * 2; return piVar2; } //@@ 0094e520 FUN_0094e520 void FUN_0094e520(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[2] = 0; param_1[1] = 0; param_1 = param_1 + 4; } return; } //@@ 0094e550 std::vector<16byte>::_Resize_reallocate /* DB: global vector g_characterPortraitOrder..80 of 16-byte entries (portrait render list); Menu_Character::render_portraits */ void std::vector<16byte>::_Resize_reallocate(uint param_1,undefined1 *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; void *ptr; uint uVar8; uint size; int iVar9; if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar8 = (int)DAT_00c94180 - (int)g_characterPortraitOrder >> 4; iVar9 = (int)DAT_00c9417c - (int)g_characterPortraitOrder >> 4; if (0xfffffff - (uVar8 >> 1) < uVar8) { uVar8 = 0xfffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; if (uVar8 < param_1) { uVar8 = param_1; } else if (0xfffffff < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = _Allocate(uVar8 * 0x10); FUN_0094e520(puVar6 + iVar9 * 4,param_1 - iVar9,*param_2); puVar5 = DAT_00c9417c; puVar4 = puVar6; for (puVar7 = g_characterPortraitOrder; puVar7 != puVar5; puVar7 = puVar7 + 4) { uVar1 = puVar7[1]; uVar2 = puVar7[2]; uVar3 = puVar7[3]; *puVar4 = *puVar7; puVar4[1] = uVar1; puVar4[2] = uVar2; puVar4[3] = uVar3; puVar4 = puVar4 + 4; } if (g_characterPortraitOrder != (void *)0x0) { size = (int)DAT_00c94180 - (int)g_characterPortraitOrder & 0xfffffff0; ptr = g_characterPortraitOrder; if (0xfff < size) { ptr = *(void **)((int)g_characterPortraitOrder + -4); size = size + 0x23; if (0x1f < (uint)((int)g_characterPortraitOrder + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } g_characterPortraitOrder = puVar6; DAT_00c9417c = puVar6 + param_1 * 4; DAT_00c94180 = puVar6 + uVar8 * 4; return; } //@@ 0094e670 std::vector::_Resize_reallocate /* DB: 4-byte elements (max 0x3fffffff), fills with param (FUN_007de420 uninitialized_fill_n); Menu_Character::Reset resizes the per-character float vector to _numCharacters */ void std::vector::_Resize_reallocate(uint param_1,undefined4 param_2) { uint *_Dst; int *in_ECX; uint uVar1; int iVar2; if (0x3fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar2 = in_ECX[1] - *in_ECX >> 2; uVar1 = in_ECX[2] - *in_ECX >> 2; if (0x3fffffff - (uVar1 >> 1) < uVar1) { uVar1 = 0x3fffffff; } else { uVar1 = (uVar1 >> 1) + uVar1; if (uVar1 < param_1) { uVar1 = param_1; } else if (0x3fffffff < uVar1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar1 * 4); fill_n<4byte>(_Dst + iVar2,param_1 - iVar2,param_2); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,param_1,uVar1); return; } //@@ 0094e720 std::vector::_Resize_reallocate /* DB: 8-byte elements (max 0x1fffffff), grows x1.5, fills new slots with *param_2; Menu_Character::Reset resizes the +0xc38 vector */ void std::vector::_Resize_reallocate(uint param_1,uint *param_2) { uint uVar1; uint *puVar2; uint *puVar3; uint *puVar4; int *in_ECX; uint uVar5; uint *puVar6; int iVar7; int iVar8; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar8 = in_ECX[1] - *in_ECX >> 3; uVar5 = in_ECX[2] - *in_ECX >> 3; if (0x1fffffff - (uVar5 >> 1) < uVar5) { uVar5 = 0x1fffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; if (uVar5 < param_1) { uVar5 = param_1; } else if (0x1fffffff < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = _Allocate(uVar5 * 8); puVar2 = puVar4 + iVar8 * 2; for (iVar7 = param_1 - iVar8; iVar7 != 0; iVar7 = iVar7 + -1) { uVar1 = param_2[1]; *puVar2 = *param_2; puVar2[1] = uVar1; puVar2 = puVar2 + 2; } puVar2 = (uint *)in_ECX[1]; puVar3 = puVar4; for (puVar6 = (uint *)*in_ECX; puVar6 != puVar2; puVar6 = puVar6 + 2) { uVar1 = puVar6[1]; *puVar3 = *puVar6; puVar3[1] = uVar1; puVar3 = puVar3 + 2; } FID_conflict__Change_array(in_ECX,puVar4,param_1,uVar5); return; } //@@ 0094e800 Menu_Collection::destructor /* DB: ECX=MenuManager+0x27b8 in MenuManager destructor 00986f30: frees the 0x2dd vector +0x250, image +0x240, ANM2 +0x128 and +0x14 */ void Menu_Collection::destructor(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afb440; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((uint)(*(int *)(in_ECX + 600) - *(int *)(in_ECX + 0x250) >> 2) < 0x2dd) { std::vector::_Reallocate(0x2dd); } FID_conflict__Tidy((void *)(in_ECX + 0x250)); local_8 = 0; if (*(int **)(in_ECX + 0x244) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x244) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x240); } } local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x128)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x178)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x158)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x140)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x128)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x14)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 100)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x14)); ExceptionList = local_10; return; } //@@ 0094e910 Menu_Collection::Update /* DB: MenuManager update FUN_009897d0 case 8 (MainMenuType COLLECTION); pages of 0x78 items, ItemConfig::GetCollectible + Manager::LoadImage */ void Menu_Collection::Update(void) { undefined1 *page; char cVar2; uint uVar3; uint newSlot; int *clampedSlot; ItemConfig_Item *collectible; std_string *gfxPath; LayerState *arrowLayer; uint *in_ECX; int lastSlot; void *pvVar4; bool isRepeatTick; undefined1 loadedImage [4]; int *local_3c; undefined4 backAction; undefined4 inputAction; uint lastPage; float inputY; float inputX; byte isArrowVisible; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; MenuManager *menuManager; uint *page; puStack_20 = loadedImage + 0x3c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b99d; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(loadedImage + 0x30); ExceptionList = &local_1c; lastPage = in_ECX[0x97] / 0x78; lastSlot = (in_ECX[0x97] - 1) % 0x78; page = loadedImage + 0x3c; if (((g_manager->_framecount & 1) == 0) && (page = loadedImage + 0x3c, *(char *)((int)in_ECX + 0x11d) != '\0')) { AnimationState::Update((AnimationState *)(in_ECX + 0x11)); AnimationState::Update((AnimationState *)(in_ECX + 0x19)); page = puStack_20; } puStack_20 = page; inputX = g_vectorZero.x; inputY = g_vectorZero.y; inputAction = 0x14; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&inputAction,0,0,uVar3) ; if (cVar2 != '\0') { inputX = inputX - 1.0; } inputAction = 0x15; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&inputAction,0,0); if (cVar2 != '\0') { inputX = inputX + 1.0; } inputAction = 0x16; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&inputAction,0,0); if (cVar2 != '\0') { inputY = inputY - 1.0; } inputAction = 0x17; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&inputAction,0,0); if (cVar2 != '\0') { inputY = inputY + 1.0; } if ((inputX != g_vectorZero.x) || (inputY != g_vectorZero.y)) { if (ABS(inputX) <= ABS(inputY)) { if (0.0 <= inputY) { inputY = 1.0; } else { inputY = (float)&DAT_bf800000; } inputX = 0.0; } else { inputY = 0.0; if (0.0 <= inputX) { inputY = 0.0; inputX = 1.0; } else { inputX = (float)&DAT_bf800000; } } } backAction = 0xf; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&backAction,0,0); menuManager = g_menuManager; if (cVar2 != '\0') { pvVar4 = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)pvVar4 - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { pvVar4 = (void *)((int)pvVar4 + -4); (g_menuManager->_menuStateHistory)._end = pvVar4; } MenuManager::SetState(menuManager,*(int *)((int)pvVar4 + -4),0); goto LAB_0094ed66; } if (inputX < -0.5) { uVar3 = *in_ECX; if (uVar3 == 0) { LAB_0094eba6: uVar3 = in_ECX[4]; newSlot = uVar3 - 1; in_ECX[4] = newSlot; if ((int)newSlot < 0) { page = in_ECX + 1; *page = *page - 1; in_ECX[4] = uVar3 + 0x77; if ((int)*page < 0) { in_ECX[1] = lastPage; in_ECX[4] = lastSlot; } } *(undefined1 *)(in_ECX + 0x8f) = 1; } else if (0x13 < (int)uVar3) { uVar3 = uVar3 & 0x80000003; isRepeatTick = uVar3 == 0; if ((int)uVar3 < 0) { isRepeatTick = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if (isRepeatTick) goto LAB_0094eba6; } } if (0.5 < inputX) { uVar3 = *in_ECX; if (uVar3 == 0) { LAB_0094ebf5: uVar3 = in_ECX[4]; newSlot = uVar3 + 1; in_ECX[4] = newSlot; if ((0x77 < (int)newSlot) || ((in_ECX[1] == lastPage && (lastSlot < (int)newSlot)))) { in_ECX[4] = uVar3 - 0x77; uVar3 = in_ECX[1]; in_ECX[1] = uVar3 + 1; if ((int)lastPage < (int)(uVar3 + 1)) { in_ECX[1] = 0; in_ECX[4] = 0; } } *(undefined1 *)(in_ECX + 0x8f) = 1; } else if (0x13 < (int)uVar3) { uVar3 = uVar3 & 0x80000003; isRepeatTick = uVar3 == 0; if ((int)uVar3 < 0) { isRepeatTick = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if (isRepeatTick) goto LAB_0094ebf5; } } inputAction = 0x14; if (inputY < -0.5) { uVar3 = *in_ECX; if (uVar3 == 0) { LAB_0094ec64: local_3c = (int *)in_ECX[4]; in_ECX[4] = (uint)(local_3c + -5); if ((int)(local_3c + -5) < 0) { page = in_ECX + 1; *page = *page - 1; if ((int)*page < 0) { in_ECX[1] = lastPage; clampedSlot = (int *)((int)local_3c % 0x14 + ((uint)lastSlot / 0x14) * 0x14); if (lastSlot < (int)clampedSlot) { clampedSlot = (int *)lastSlot; } } else { clampedSlot = local_3c + 0x19; } in_ECX[4] = (uint)clampedSlot; } *(undefined1 *)(in_ECX + 0x8f) = 1; } else if (0x13 < (int)uVar3) { uVar3 = uVar3 & 0x80000003; isRepeatTick = uVar3 == 0; if ((int)uVar3 < 0) { isRepeatTick = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if (isRepeatTick) goto LAB_0094ec64; } } if (inputY <= 0.5) goto LAB_0094ed66; uVar3 = *in_ECX; if (uVar3 != 0) { if ((int)uVar3 < 0x14) goto LAB_0094ed66; uVar3 = uVar3 & 0x80000003; isRepeatTick = uVar3 == 0; if ((int)uVar3 < 0) { isRepeatTick = (uVar3 - 1 | 0xfffffffc) == 0xffffffff; } if (!isRepeatTick) goto LAB_0094ed66; } local_3c = (int *)(in_ECX[4] + 0x14); in_ECX[4] = (uint)local_3c; if ((in_ECX[1] == lastPage) && (lastSlot < (int)local_3c)) { if ((int *)((int)local_3c / 0x14) != (int *)((uint)lastSlot / 0x14)) { in_ECX[1] = 0; lastSlot = (int)local_3c % 0x14; } in_ECX[4] = lastSlot; local_3c = (int *)((int)local_3c / 0x14); } else if (0x77 < (int)local_3c) { uVar3 = in_ECX[1] + 1; in_ECX[1] = uVar3; in_ECX[4] = (int)local_3c % 0x14; if (uVar3 == lastPage) { uVar3 = in_ECX[4]; if (((int)local_3c % 0x14) / lastSlot != 0) { uVar3 = lastSlot; } in_ECX[4] = uVar3; } } *(undefined1 *)(in_ECX + 0x8f) = 1; LAB_0094ed66: if ((char)in_ECX[0x8f] != '\0') { local_3c = *(int **)(in_ECX[0x94] + (in_ECX[4] + (in_ECX[1] * 0x10 - in_ECX[1]) * 8) * 4); if ((0x2dc < (int)local_3c) || ((&(g_manager->_persistentGameData).field_0xae8)[(int)local_3c] != '\0')) { if (in_ECX[0x90] != 0) { KAGE::SmartPointer::reset(in_ECX + 0x90,(void *)0x0); } collectible = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_3c); if (collectible != (ItemConfig_Item *)0x0) { gfxPath = &collectible->gfxFilename; if (0xf < (collectible->gfxFilename)._capacity) { gfxPath = *(std_string **)gfxPath->_buf; } pvVar4 = Manager::LoadImage(loadedImage,(byte *)gfxPath); local_14 = 0; KAGE::SmartPointer::operator_assign(in_ECX + 0x90,pvVar4); local_14 = 1; if (((local_3c != (int *)0x0) && (cVar2 = (**(code **)(*local_3c + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImage); } local_14 = 0xffffffff; } } *(undefined1 *)(in_ECX + 0x8f) = 0; } if (((inputX == g_vectorZero.x) && (inputY == g_vectorZero.y)) || (((inputX != (float)in_ECX[0x92] || (inputY != (float)in_ECX[0x93])) && (((float)in_ECX[0x92] != g_vectorZero.x || ((float)in_ECX[0x93] != g_vectorZero.y)))))) { *in_ECX = 0; } else { *in_ECX = *in_ECX + 1; } in_ECX[0x92] = (uint)inputX; in_ECX[0x93] = (uint)inputY; isArrowVisible = in_ECX[1] != 0; arrowLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 5),&DAT_00000004); arrowLayer->_visible = isArrowVisible; isArrowVisible = in_ECX[1] != lastPage; arrowLayer = ANM2::GetLayer((ANM2 *)(in_ECX + 5),(byte *)0x3); arrowLayer->_visible = isArrowVisible; ExceptionList = local_1c; return; } //@@ 0094ef10 Menu_Collection::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: item collection page render: "Diary" anim, item ids < 0x2dd, 120 items per page, ItemConfig_Item::GetLocalizedName, ModManager::RenderCustomCollectionItem, KAGE_ColorTextureShader prototype: db/protos.zhl */ void __thiscall Menu_Collection::Render(Menu_Collection *font) { undefined1 *other; code *pcVar1; float *pfVar2; KColor color; byte *pbVar3; char cVar4; void *pvVar5; void *pvVar6; LayerState *layer; uint uVar7; undefined *savedShader; undefined4 *texture; int *piVar8; AnimationState *pageAnim; AnimationLayer *animLayer; std_string *extraout_ECX; std_string *extraout_ECX_00; std_string *psVar9; std_string *text; byte lowerChar; uint allocSize; std_string *textCursor; int iVar10; ANM2 *pageAnm; char *pcVar11; float fVar12; float fVar13; Menu_Collection *pMVar14; undefined1 auStack_40a [2]; undefined1 local_400 [116]; float local_38c; float local_388; float local_384; float local_380; float local_37c; float local_378; float local_374; float local_370; undefined1 local_36c; Vector iconPos; Font *local_360; undefined1 local_35c [8]; Vector local_354; Vector local_34c; float local_344; int local_340; Menu_Collection *local_33c; uint local_338; uint local_334; float local_330; float *local_32c; float originY; Vector local_324; float originX; char isLayerTextured; Menu_Collection *local_314; float local_310; float local_30c; Vector local_308; float local_300; float fStack_2fc; float fStack_2f8; float fStack_2f4; float local_2f0; float local_2ec; float local_2e8; undefined1 local_2e4; float local_2e0; float fStack_2dc; float fStack_2d8; float fStack_2d4; float local_2d0; float fStack_2cc; float fStack_2c8; float fStack_2c4; undefined8 local_2c0; float local_2b8; float local_2b4; undefined1 local_2b0; float local_2ac; float local_2a8; ColorMod renderColor; undefined4 local_274; void *tmpString; KColor local_26c; std_string nameStrings; std_string local_240; byte textBuffer [516]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Font *font; byte shaderNameChar; puStack_20 = textBuffer + 0x224; local_14 = 0xffffffff; puStack_18 = &LAB_00b0b9fc; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(textBuffer + 0x218); ExceptionList = &local_1c; local_338 = 0; local_324.x = (g_menuManager->_ViewPosition).x + font->PositionX; originY = (g_menuManager->_ViewPosition).y + font->PositionY; local_33c = font; local_324.y = originY; originX = local_324.x; pbVar3 = textBuffer + 0x224; if ((font->CollectionMenuSprite)._loaded != 0) { if ((font->CollectionMenuSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(font->CollectionMenuSprite)._animState,&local_324,&g_vectorZero,&g_vectorZero); pageAnim = &(font->CollectionMenuSprite)._overlayAnimState; } else { puStack_20 = textBuffer + 0x224; AnimationState::Render (&(font->CollectionMenuSprite)._overlayAnimState,&local_324,&g_vectorZero, &g_vectorZero); pageAnim = &(font->CollectionMenuSprite)._animState; } AnimationState::Render(pageAnim,&local_324,&g_vectorZero,&g_vectorZero); originX = local_324.x; pbVar3 = puStack_20; } puStack_20 = pbVar3; fVar12 = local_324.y; fVar13 = originX; originY = local_324.y; local_324.x = originX; pvVar5 = ANM2::GetAnimationData(&font->CollectionMenuSprite,s_Idle); pvVar6 = ANM2::GetAnimationData(&font->DeathScreenSprite,(byte *)"Diary"); local_32c = *(float **)(*(int *)((int)pvVar5 + 0x18) + 4 + *(int *)((int)pvVar5 + 0x4c) * 0x10); iVar10 = *(int *)(*(int *)((int)pvVar6 + 0x18) + 4 + *(int *)((int)pvVar6 + 0x50) * 0x10); local_360 = (Font *)(local_32c[4] - *(float *)(iVar10 + 0x10)); local_314 = (Menu_Collection *)((font->SelectedPage * 0x10 - font->SelectedPage) * 8); local_324.y = local_32c[5] - *(float *)(iVar10 + 0x14); if ((int)local_314 < font->NumItems) { while (iVar10 = font->SelectedPage * 0x10 - font->SelectedPage, (int)local_314 < iVar10 * 8 + 0x78) { local_334 = *(uint *)(*(int *)&font->field_0x250 + (int)local_314 * 4); if (((int)local_334 < 0x2dd) && (*(char *)((int)(g_manager->_persistentGameData)._eventCounters + local_334 + 0x82c) == '\0')) { layer = ANM2::GetLayer(&font->CollectionMenuSprite,&DAT_00000005); layer->_visible = 1; if (((font->CollectionMenuSprite)._animState._animData != (void *)0x0) && ((5 < *(int *)((int)(font->CollectionMenuSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)((int)(font->CollectionMenuSprite)._animState._animation + 0x80))))) { pvVar5 = (font->CollectionMenuSprite)._animState._animData; local_340 = *(int *)((int)pvVar5 + 0x4c); if ((pvVar5 == (void *)0x0) || ((local_340 < 0 || (*(int *)((int)pvVar5 + 0x1c) <= local_340)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->CollectionMenuSprite)._animState._layerFrames + local_340 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->CollectionMenuSprite)._animState,local_340,2.0); } iconPos.y = (float)(((int)local_314 + (font->SelectedPage * 0x10 - font->SelectedPage) * -8) / 0x14) * 16.0 + originY; iconPos.x = (float)((int)local_314 % 0x14) * 16.0 + originX; if ((font->CollectionMenuSprite)._loaded != 0) { if ((font->CollectionMenuSprite)._overlayRenderFirst == 0) { pvVar5 = (font->CollectionMenuSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->CollectionMenuSprite)._animState._animation, 5 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x4c), -1 < iVar10)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)),&iconPos, *(int *)((int)(font->CollectionMenuSprite)._animState._layerFrames + iVar10 * 4),&g_vectorZero,&g_vectorZero,pageAnm); } pvVar5 = (font->CollectionMenuSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->CollectionMenuSprite)._overlayAnimState._animation, 5 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x4c), -1 < iVar10)) { animLayer = (AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (font->CollectionMenuSprite)._overlayAnimState._layerFrames; goto LAB_0094f2e6; } } else { pvVar5 = (font->CollectionMenuSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->CollectionMenuSprite)._overlayAnimState._animation, 5 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x4c), -1 < iVar10)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)),&iconPos, *(int *)((int)(font->CollectionMenuSprite)._overlayAnimState._layerFrames + iVar10 * 4),&g_vectorZero,&g_vectorZero,pageAnm); } pvVar5 = (font->CollectionMenuSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->CollectionMenuSprite)._animState._animation, 5 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x4c), -1 < iVar10)) { animLayer = (AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (font->CollectionMenuSprite)._animState._layerFrames; LAB_0094f2e6: AnimationLayer::RenderFrame (animLayer,&iconPos,*(int *)((int)pvVar5 + iVar10 * 4),&g_vectorZero, &g_vectorZero,pageAnm); } } } layer = ANM2::GetLayer(&font->CollectionMenuSprite,&DAT_00000005); layer->_visible = 0; } else { local_330 = (float)((int)local_314 % 0x14); local_340 = ((int)local_314 + iVar10 * -8) / 0x14; if ((int)local_334 < 0x2dd) { if (((font->DeathScreenSprite)._animState._animData != (void *)0x0) && ((6 < *(int *)((int)(font->DeathScreenSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)((int)(font->DeathScreenSprite)._animState._animation + 0x80))))) { pvVar5 = (font->DeathScreenSprite)._animState._animData; local_344 = *(float *)((int)pvVar5 + 0x50); if ((pvVar5 == (void *)0x0) || (((int)local_344 < 0 || (*(int *)((int)pvVar5 + 0x1c) <= (int)local_344)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(font->DeathScreenSprite)._animState._layerFrames + (int)local_344 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->DeathScreenSprite)._animState,(int)local_344, (float)(int)(local_334 - 1)); } local_34c.x = (float)(int)local_330 * 16.0 + (float)local_360 + originX; local_34c.y = (float)local_340 * 16.0 + local_324.y + originY; if ((font->DeathScreenSprite)._loaded != 0) { if ((font->DeathScreenSprite)._overlayRenderFirst == 0) { pvVar5 = (font->DeathScreenSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->DeathScreenSprite)._animState._animation, 6 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x50), -1 < iVar10) ) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)), &local_34c, *(int *)((int)(font->DeathScreenSprite)._animState._layerFrames + iVar10 * 4),&g_vectorZero,&g_vectorZero,pageAnm); } pvVar5 = (font->DeathScreenSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->DeathScreenSprite)._overlayAnimState._animation, 6 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x50), -1 < iVar10) ) { animLayer = (AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (font->DeathScreenSprite)._overlayAnimState._layerFrames; goto LAB_0094f63c; } } else { pvVar5 = (font->DeathScreenSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->DeathScreenSprite)._overlayAnimState._animation, 6 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x50), -1 < iVar10) ) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)), &local_34c, *(int *)((int)(font->DeathScreenSprite)._overlayAnimState._layerFrames + iVar10 * 4),&g_vectorZero,&g_vectorZero,pageAnm); } pvVar5 = (font->DeathScreenSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (pageAnm = (font->DeathScreenSprite)._animState._animation, 6 < pageAnm->_layerCount)) && (iVar10 = *(int *)((int)pvVar5 + 0x50), -1 < iVar10) ) { animLayer = (AnimationLayer *)(iVar10 * 0x10 + *(int *)((int)pvVar5 + 0x18)); pvVar5 = (font->DeathScreenSprite)._animState._layerFrames; LAB_0094f63c: AnimationLayer::RenderFrame (animLayer,&local_34c,*(int *)((int)pvVar5 + iVar10 * 4),&g_vectorZero, &g_vectorZero,pageAnm); } } } } else { local_26c._unk = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { local_26c._green = 8.40779e-45; } else { local_26c._green = 1.4013e-45; } local_26c._red = 0.0; local_26c._blue = 9.80909e-45; local_26c._alpha = 1.4013e-45; renderColor._offset[0] = 0.0; renderColor._tint[0] = 1.0; renderColor._tint[1] = 1.0; renderColor._tint[2] = 1.0; renderColor._tint[3] = 1.0; renderColor._offset[1] = 0.0; renderColor._offset[2] = 0.0; renderColor._colorize[0] = 0.0; renderColor._colorize[1] = 0.0; renderColor._colorize[2] = 0.0; renderColor._colorize[3] = 0.0; local_354.x = (float)(int)local_330 * 16.0 + fVar13 + local_32c[4]; local_354.y = (float)local_340 * 16.0 + fVar12 + local_32c[5]; ModManager::RenderCustomCollectionItem (&g_manager->_modManager,local_334,&local_354,&g_vectorOne,&renderColor, &local_26c); } } local_314 = (Menu_Collection *)((int)&local_314->HoldInputTimer + 1); if (font->NumItems <= (int)local_314) break; fVar12 = originY; fVar13 = originX; } } local_26c._unk = 0; fVar13 = ((originX + local_32c[4]) - 8.0) + (float)(font->SelectedElement % 0x14) * 16.0; fVar12 = ((originY + local_32c[5]) - 8.0) + (float)(font->SelectedElement / 0x14) * 16.0; local_26c._red = 0.21176471; local_26c._green = 0.18431373; local_26c._blue = 0.1764706; local_26c._alpha = 1.0; render_quad_set_uniform_color(&local_310,fVar13,fVar12,fVar13 + 16.0,fVar12 + 16.0,&local_26c); render_quad_draw_color_shader(&local_310,2.0); uVar7 = *(uint *)(*(int *)&font->field_0x250 + (font->SelectedElement + (font->SelectedPage * 0x10 - font->SelectedPage) * 8) * 4); if ((0x2dc < (int)uVar7) || (*(char *)((int)(g_manager->_persistentGameData)._eventCounters + uVar7 + 0x82c) != '\0')) { local_360 = &g_manager->_font2_TeamMeatEx12; _eh_vector_constructor_iterator_(&nameStrings,0x18,2,FUN_0040c380,std::string::_Tidy_deallocate) ; local_14 = 0; if (g_game == (Game *)0x0) { if (-1 < (int)uVar7) goto LAB_0094f7c9; } else { if ((int)uVar7 < 0) { if (((int)uVar7 < 0) && (pvVar5 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~uVar7 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar5 >> 2)) { local_314 = (Menu_Collection *)**(undefined4 **)((int)pvVar5 + ~uVar7 * 4); } else { local_314 = (Menu_Collection *)0x0; } } else { LAB_0094f7c9: pvVar5 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar5 >> 2 <= (int)uVar7) goto LAB_0094f92f; local_314 = *(Menu_Collection **)((int)pvVar5 + uVar7 * 4); } if (local_314 != (Menu_Collection *)0x0) { local_324.y = (float)ItemConfig_Item::GetLocalizedName ((ItemConfig_Item *)local_314,(std_string *)&tmpString,0x14); psVar9 = &nameStrings; if (psVar9 != (std_string *)local_324.y) { std::string::_Tidy_deallocate(psVar9->_buf); nameStrings._buf._0_4_ = *(undefined4 *)(char *)local_324.y; nameStrings._buf._4_4_ = *(undefined4 *)((char *)local_324.y + 4); nameStrings._buf._8_4_ = *(undefined4 *)((char *)local_324.y + 8); nameStrings._buf._12_4_ = *(undefined4 *)((char *)local_324.y + 0xc); nameStrings._16_8_ = *(undefined8 *)((int)local_324.y + 0x10); *(uint *)((int)local_324.y + 0x10) = 0; *(uint *)((int)local_324.y + 0x14) = 0xf; *(char *)local_324.y = '\0'; psVar9 = extraout_ECX; } if (0xf < (uint)local_26c._unk) { allocSize = local_26c._unk + 1; pvVar5 = tmpString; if (0xfff < allocSize) { pvVar5 = *(void **)((int)tmpString + -4); allocSize = local_26c._unk + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,allocSize); psVar9 = extraout_ECX_00; } local_324.y = (float)ItemConfig_Item::get_localized_description ((ItemConfig_Item *)local_314,(std_string *)&tmpString, (int)psVar9); if (&local_240 != (std_string *)local_324.y) { std::string::_Tidy_deallocate(local_240._buf); local_240._buf._0_4_ = *(undefined4 *)(char *)local_324.y; local_240._buf._4_4_ = *(undefined4 *)((char *)local_324.y + 4); local_240._buf._8_4_ = *(undefined4 *)((char *)local_324.y + 8); local_240._buf._12_4_ = *(undefined4 *)((char *)local_324.y + 0xc); local_240._16_8_ = *(undefined8 *)((int)local_324.y + 0x10); *(uint *)((int)local_324.y + 0x10) = 0; *(uint *)((int)local_324.y + 0x14) = 0xf; *(char *)local_324.y = '\0'; } if (0xf < (uint)local_26c._unk) { allocSize = local_26c._unk + 1; pvVar5 = tmpString; if (0xfff < allocSize) { pvVar5 = *(void **)((int)tmpString + -4); allocSize = local_26c._unk + 0x24; if (0x1f < (uint)((int)tmpString + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,allocSize); } local_26c._alpha = 0.0; local_26c._unk = 0xf; tmpString = (void *)((uint)tmpString & 0xffffff00); } } LAB_0094f92f: if ((font->CollectionMenuSprite)._animState._animData != (void *)0x0) { pvVar6 = (void *)0x1; pvVar5 = (void *)0x94f943; local_32c = AnimationState::GetNullFrameById(&(font->CollectionMenuSprite)._animState,1); other = &font->field_0x240; local_324.y = (float)other; if (local_32c != (float *)0x0) { if (*(int *)other != 0) { iVar10 = 0; local_37c = g_vectorZero.x; local_380 = g_vectorZero.y; if (uVar7 == 0x279) { iVar10 = 0xa0; } local_38c = g_vectorZero.x; local_388 = g_vectorZero.y; local_36c = 1; local_384 = g_vectorZero.x + 32.0; local_378 = g_vectorZero.y + 32.0; if ((&g_shaders + iVar10 != (undefined *)0x0) && (((&DAT_00c7911c)[iVar10] & 1) != 0)) { g_currentShader = &g_shaders + iVar10; } renderColor._offset[0] = 0.0; renderColor._offset[1] = 0.0; renderColor._offset[2] = 0.0; renderColor._tint[0] = 1.0; renderColor._tint[1] = 1.0; renderColor._tint[2] = 1.0; renderColor._tint[3] = 1.0; renderColor._colorize[0] = 0.0; renderColor._colorize[1] = 0.0; renderColor._colorize[2] = 0.0; renderColor._colorize[3] = 0.0; if (uVar7 == 0x279) { uVar7 = g_manager->_framecount / 2 & 0x800000ff; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xffffff00) + 1; } renderColor._colorize[3] = (float)(int)uVar7 * 0.00390625; } local_374 = local_384; local_370 = local_378; KAGE::SmartPointer::operator_assign(auStack_40a + -10,other); apply_sprite_shader_params(&renderColor,1,pvVar5,pvVar6); pcVar1 = *(code **)(**(int **)other + 0x18); KColor::SetFromARGB(&local_26c,0xffffffff); local_354.x = (originX + *local_32c) - 16.0; local_354.y = (originY + local_32c[1]) - 16.0; (*pcVar1)(&local_38c); } font = local_360; psVar9 = &nameStrings; fVar12 = *local_32c; pfVar2 = local_32c + 1; local_32c = (float *)0x2; local_344 = originX + fVar12 + 18.0; local_314 = (Menu_Collection *)((originY + *pfVar2) - 16.0); do { if (psVar9->_size != 0) { text = psVar9; if (0xf < psVar9->_capacity) { text = *(std_string **)psVar9->_buf; } if (text == (std_string *)0x0) { iVar10 = 0; } else { local_324.y = (float)(text->_buf + 1); textCursor = text; do { pcVar11 = textCursor->_buf; textCursor = (std_string *)(textCursor->_buf + 1); } while (*pcVar11 != 0); iVar10 = (int)textCursor - (int)local_324.y; } text_convert_encoding((byte *)text,iVar10,0,textBuffer,0x100,1); local_274 = 0; tmpString = (void *)0xffff; local_26c._red = 0.0; local_26c._green = 1.0; local_26c._blue = -NAN; local_26c._alpha = 0.0; local_26c._unk = 0; local_14._0_1_ = 1; pvVar5 = Font::layout_glyphs(font,local_35c,textBuffer,&local_274,&g_vectorOne); local_14._0_1_ = 2; color._blue = 0.38039216; color._red = 0.47058824; color._green = 0.44705883; color._alpha = 1.0; color._unk = 0; Font::draw_glyph_run(font,local_344,(float)local_314,pvVar5,1.0,1.0,color,&local_274); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_14 = (uint)local_14._1_3_ << 8; } local_314 = (Menu_Collection *)((float)local_314 + 15.0); psVar9 = psVar9 + 1; local_32c = (float *)((int)local_32c + -1); } while (local_32c != (float *)0x0); local_32c = (float *)0x0; font = local_33c; } } local_14 = 0xffffffff; _eh_vector_destructor_iterator_(&nameStrings,0x18,2,std::string::_Tidy_deallocate); } uVar7 = (uint)font->NumItems / 0x78; local_334 = uVar7; if ((font->CollectionMenuSprite)._animState._animData == (void *)0x0) { local_314 = (Menu_Collection *)0x0; local_330 = 100.0 / (float)(uVar7 + 3); } else { local_33c = AnimationState::GetNullFrameById(&(font->CollectionMenuSprite)._animState,0); local_330 = 100.0 / (float)(uVar7 + 3); local_314 = local_33c; if (local_33c != (Menu_Collection *)0x0) { layer = ANM2::GetLayer(&font->CollectionMenuSprite,(byte *)0x0); piVar8 = LayerState::GetTexture(layer,&local_354); local_338 = 1; local_314 = local_33c; if (*piVar8 != 0) { isLayerTextured = '\x01'; goto LAB_0094fd15; } } } isLayerTextured = '\0'; LAB_0094fd15: if ((local_338 & 1) != 0) { local_14 = 3; if ((((int *)local_354.y != (int *)0x0) && (cVar4 = (**(code **)(*(int *)local_354.y + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14 = 0xffffffff; } if (isLayerTextured != '\0') { iVar10 = 0; originX = originX + (float)local_314->HoldInputTimer + 0.0; local_33c = (Menu_Collection *) (-local_330 * (float)uVar7 * 0.5 + originY + (float)local_314->SelectedPage); if (-1 < (int)local_334) { do { pMVar14 = local_33c; pvVar5 = ANM2::GetAnimationData(&font->CollectionMenuSprite,s_Idle); pfVar2 = *(float **)(*(int *)((int)pvVar5 + 0x18) + 4 + *(int *)((int)pvVar5 + 0x50) * 0x10) ; local_300 = pfVar2[0x1f]; fStack_2fc = pfVar2[0x20]; fStack_2f8 = pfVar2[0x21]; fStack_2f4 = pfVar2[0x22]; local_2e8 = pfVar2[0x25]; local_310 = pfVar2[0x1b]; local_30c = pfVar2[0x1c]; local_308.x = pfVar2[0x1d]; local_308.y = pfVar2[0x1e]; local_2f0 = pfVar2[0x23]; local_2ec = pfVar2[0x24]; local_2e0 = pfVar2[0x27]; fStack_2dc = pfVar2[0x28]; fStack_2d8 = pfVar2[0x29]; fStack_2d4 = pfVar2[0x2a]; local_2e4 = *(undefined1 *)(pfVar2 + 0x26); local_2b8 = pfVar2[0x31]; local_2d0 = pfVar2[0x2b]; fStack_2cc = pfVar2[0x2c]; fStack_2c8 = pfVar2[0x2d]; fStack_2c4 = pfVar2[0x2e]; local_2b0 = *(undefined1 *)(pfVar2 + 0x33); local_2ac = pfVar2[0x34]; local_2c0 = *(undefined8 *)(pfVar2 + 0x2f); local_2a8 = pfVar2[0x35]; local_2b4 = pfVar2[0x32]; if (iVar10 == font->SelectedPage) { local_2e8 = pfVar2[10]; local_300 = pfVar2[4]; fStack_2fc = pfVar2[5]; fStack_2f8 = pfVar2[6]; fStack_2f4 = pfVar2[7]; local_2e4 = *(undefined1 *)(pfVar2 + 0xb); local_310 = *pfVar2; local_30c = pfVar2[1]; local_308.x = pfVar2[2]; local_308.y = pfVar2[3]; local_2f0 = pfVar2[8]; local_2ec = pfVar2[9]; if (&local_2e0 != pfVar2 + 0xc) { local_2e0 = pfVar2[0xc]; fStack_2dc = pfVar2[0xd]; fStack_2d8 = pfVar2[0xe]; fStack_2d4 = pfVar2[0xf]; local_2d0 = pfVar2[0x10]; fStack_2cc = pfVar2[0x11]; fStack_2c8 = pfVar2[0x12]; fStack_2c4 = pfVar2[0x13]; local_2c0 = *(undefined8 *)(pfVar2 + 0x14); local_2b8 = pfVar2[0x16]; } local_2b0 = *(undefined1 *)(pfVar2 + 0x18); local_2b4 = pfVar2[0x17]; local_2ac = pfVar2[0x19]; local_2a8 = pfVar2[0x1a]; } local_384 = local_308.x + local_310; local_378 = local_308.y + local_30c; local_36c = 1; local_26c._unk = 0; local_354.y = (((float)iVar10 * local_330 + (float)pMVar14) - local_2ec) + ((float)iVar10 * -1.0) / (float)(int)local_334; local_354.x = originX - local_2f0; local_26c._red = 1.0; local_26c._green = 1.0; local_26c._blue = 1.0; local_26c._alpha = 1.0; local_38c = local_310; local_388 = local_30c; local_380 = local_30c; local_37c = local_310; local_374 = local_384; local_370 = local_378; render_quad_set_rect(local_400,&local_354,&local_308,&local_26c); renderColor._tint[0] = 1.0; renderColor._tint[1] = 1.0; renderColor._tint[2] = 1.0; renderColor._tint[3] = 1.0; savedShader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { savedShader = g_currentShader; } pvVar6 = (void *)0x0; renderColor._colorize[0] = 0.0; renderColor._colorize[1] = 0.0; renderColor._colorize[2] = 0.0; renderColor._colorize[3] = 0.0; renderColor._offset[0] = 0.0; renderColor._offset[1] = 0.0; renderColor._offset[2] = 0.0; pvVar5 = (void *)0x9500cf; g_currentShader = savedShader; layer = ANM2::GetLayer(&font->CollectionMenuSprite,(byte *)0x0); LayerState::GetTexture(layer,auStack_40a + -10); apply_sprite_shader_params(&renderColor,1,pvVar5,pvVar6); layer = ANM2::GetLayer(&font->CollectionMenuSprite,(byte *)0x0); texture = LayerState::GetTexture(layer,&local_34c); local_14 = 4; (**(code **)(*(int *)*texture + 0x14))(&local_38c); local_14 = 5; if ((((int *)local_34c.y != (int *)0x0) && (cVar4 = (**(code **)(*(int *)local_34c.y + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } iVar10 = iVar10 + 1; local_14 = 0xffffffff; } while (iVar10 <= (int)local_334); } } uVar7 = 0x1505; pcVar11 = "KAGE_ColorTextureShader"; shaderNameChar = 0x4b; do { pcVar11 = pcVar11 + 1; lowerChar = shaderNameChar + 0x20; if (0x19 < (byte)(shaderNameChar + 0xbf)) { lowerChar = shaderNameChar; } allocSize = (uint)lowerChar; if (lowerChar == 0x5c) { allocSize = 0x2f; } uVar7 = uVar7 * 0x21 + allocSize; shaderNameChar = *pcVar11; } while (shaderNameChar != 0); local_338 = uVar7; _Find_lower_bound<>(); if (((*(char *)((int)local_354.y + 0xd) == '\0') && (*(uint *)((int)local_354.y + 0x10) <= uVar7)) && ((int *)local_354.y != DAT_00c379bc)) { piVar8 = (int *)std::map::operator_index(); pvVar5 = (void *)*piVar8; if ((pvVar5 != (void *)0x0) && ((*(byte *)((int)pvVar5 + 4) & 1) != 0)) { g_currentShader = pvVar5; } } ExceptionList = local_1c; return; } //@@ 009502c0 Menu_Collection::reset /* DB: ECX=MenuManager+0x27b8 (_menuCollection per db/fields) from MenuManager::LoadGraphics: zeroes +4, sets the sprite +0x14 to Idle (Rewind, +0x58=1), "Diary" anim handling */ void Menu_Collection::reset(void) { byte bVar1; byte *curAnimName; uint uVar2; LayerState *layer; int itemConfig; undefined4 *in_ECX; byte *idleName; char *diaryName; Manager *manager; Game *game; byte *pbVar3; bool bVar4; uint collectibleId; void *collectibleConfigs; ANM2 *diarySprite; uint *idListEnd; in_ECX[1] = 0; pbVar3 = (byte *)in_ECX[0x12]; if (pbVar3 == (byte *)0x0) { LAB_00950319: bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 5),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x11)); *(undefined1 *)(in_ECX + 0x16) = 1; } } else { curAnimName = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { curAnimName = *(byte **)pbVar3; } idleName = s_Idle; do { bVar1 = *curAnimName; bVar4 = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_00950306: uVar2 = -(uint)bVar4 | 1; goto LAB_0095030b; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar4 = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_00950306; curAnimName = curAnimName + 2; idleName = idleName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0095030b: if ((uVar2 != 0) || ((pbVar3[0x34] != 0 && (*(char *)(in_ECX + 0x16) == '\0')))) goto LAB_00950319; } layer = ANM2::GetLayer((ANM2 *)(in_ECX + 5),&DAT_00000005); diarySprite = (ANM2 *)(in_ECX + 0x4a); layer->_visible = 0; pbVar3 = (byte *)in_ECX[0x57]; if (pbVar3 != (byte *)0x0) { curAnimName = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { curAnimName = *(byte **)pbVar3; } diaryName = "Diary"; do { bVar1 = *curAnimName; bVar4 = bVar1 < (byte)*diaryName; if (bVar1 != *diaryName) { LAB_00950382: uVar2 = -(uint)bVar4 | 1; goto LAB_00950387; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar4 = bVar1 < (byte)diaryName[1]; if (bVar1 != diaryName[1]) goto LAB_00950382; curAnimName = curAnimName + 2; diaryName = diaryName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00950387: if ((uVar2 == 0) && ((pbVar3[0x34] == 0 || (*(char *)(in_ECX + 0x5b) != '\0')))) goto LAB_009503b3; } bVar1 = ANM2::SetAnimation(diarySprite,(byte *)"Diary",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x56)); *(undefined1 *)(in_ECX + 0x5b) = 1; } LAB_009503b3: pbVar3 = (byte *)0x0; do { layer = ANM2::GetLayer(diarySprite,pbVar3); pbVar3 = pbVar3 + 1; layer->_visible = 0; } while ((int)pbVar3 < 7); layer = ANM2::GetLayer(diarySprite,&DAT_00000006); manager = g_manager; uVar2 = 0; layer->_visible = 1; in_ECX[4] = 0; *in_ECX = 0; in_ECX[0x92] = g_vectorZero.x; in_ECX[0x93] = g_vectorZero.y; in_ECX[0x97] = 0; in_ECX[0x95] = in_ECX[0x94]; *(undefined1 *)(in_ECX + 0x8f) = 1; if ((int)(manager->_itemConfig)._collectibles._end - (int)(manager->_itemConfig)._collectibles._begin >> 2 != 0) { game = g_game; do { if (game == (Game *)0x0) { if (-1 < (int)uVar2) goto LAB_0095047b; } else { if ((int)uVar2 < 0) { if (((int)uVar2 < 0) && ((int)~uVar2 < (int)(game->_proceduralItemManager)._proceduralItems._end - (int)(game->_proceduralItemManager)._proceduralItems._begin >> 2)) { itemConfig = **(int **)((int)(game->_proceduralItemManager)._proceduralItems._begin + ~uVar2 * 4); } else { itemConfig = 0; } } else { LAB_0095047b: collectibleConfigs = (manager->_itemConfig)._collectibles._begin; if ((int)(manager->_itemConfig)._collectibles._end - (int)collectibleConfigs >> 2 <= (int)uVar2) goto LAB_009504e4; itemConfig = *(int *)((int)collectibleConfigs + uVar2 * 4); } if (((itemConfig != 0) && (*(int *)(itemConfig + 0x48) != 0)) && (*(char *)(itemConfig + 0xb3) == '\0')) { idListEnd = (uint *)in_ECX[0x95]; if (idListEnd == (uint *)in_ECX[0x96]) { collectibleId = uVar2; std::vector::_Emplace_reallocate(idListEnd,&collectibleId); manager = g_manager; game = g_game; } else { *idListEnd = uVar2; in_ECX[0x95] = in_ECX[0x95] + 4; } in_ECX[0x97] = in_ECX[0x97] + 1; } } LAB_009504e4: uVar2 = uVar2 + 1; } while (uVar2 < (uint)((int)(manager->_itemConfig)._collectibles._end - (int)(manager->_itemConfig)._collectibles._begin >> 2)); } return; } //@@ 00950510 InfoDisplay::~InfoDisplay /* DB: ? destroys four std::map (0x128-byte nodes, FUN_008565e0 erase: collectibles/trinkets/pills/cards), a string and three std::vector; Manager::destructor member just before ItemConfig's */ void InfoDisplay::~InfoDisplay(void) { int *in_ECX; std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); std::string::_Tidy_deallocate((char *)(in_ECX + 10)); std::map::_Erase_tree(in_ECX + 6,*(undefined4 *)(in_ECX[6] + 4)); operator_delete((void *)in_ECX[6],0x128); std::map::_Erase_tree(in_ECX + 4,*(undefined4 *)(in_ECX[4] + 4)); operator_delete((void *)in_ECX[4],0x128); std::map::_Erase_tree(in_ECX + 2,*(undefined4 *)(in_ECX[2] + 4)); operator_delete((void *)in_ECX[2],0x128); std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x128); return; } //@@ 009505c0 FUN_009505c0 void FUN_009505c0(void) { int *in_ECX; std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x128); return; } //@@ 009505e0 FUN_009505e0 undefined1 FUN_009505e0(void) { int in_ECX; if (((*(int *)(in_ECX + 0x1918) == 0) || (*(char *)(in_ECX + 0x1928) == '\0')) && ((*(int *)(in_ECX + 0x1b6c) == 0 || (*(char *)(in_ECX + 0x1b7c) == '\0')))) { return 0; } return 1; } //@@ 00950610 Manager::constructor /* WARNING: Removing unreachable block (ram,0x00950e8e) */ /* DB: PersistentGameData::constructor at this+0x14 (Manager.zhl _persistentGameData : 0x14), ModManager at +0x2a6c0, Seeds::constructor, CutsceneEntry array; object is g_Manager (g_manager) prototype: db/protos.zhl */ Manager * __thiscall Manager::constructor(Manager *this) { std_map *psVar1; AchievementOverlay *pAVar2; OptionsConfig *pOVar3; int *containerProxy; int remaining; void *headNode; MusicChannel *entry; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined1 *container; local_8 = 0xffffffff; puStack_c = &LAB_00b0bd34; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined1 *)this = 0; this->_state = 0; PersistentGameData::constructor(&this->_persistentGameData); local_8 = 0; GameState::constructor(&this->_gamestate); local_8._0_1_ = 1; this->_isSavingGameState = 0; _eh_vector_constructor_iterator_ (&(this->_cutsceneManager).field_0x4,0x4c,0x1b,CutsceneEntry::Constructor, CutsceneEntry::Destructor); *(undefined4 *)&(this->_cutsceneManager).field_0x80c = 0; *(undefined4 *)&(this->_cutsceneManager).field_0x810 = 0; (this->_cutsceneManager).field_0x81c = 0; *(undefined4 *)&(this->_cutsceneManager).field_0x814 = 0; *(undefined4 *)&(this->_cutsceneManager).field_0x818 = 0; *(undefined4 *)&(this->_cutsceneManager).field_0x824 = 0; *(undefined4 *)&(this->_cutsceneManager).field_0x820 = 0; *(undefined4 *)&(this->_nightmareScene).field_0x8 = 0; *(undefined4 *)&(this->_nightmareScene).field_0xc = 0; *(undefined4 *)&(this->_nightmareScene).field_0x10 = 0; *(undefined4 *)&(this->_nightmareScene).field_0x14 = 0; *(undefined4 *)&(this->_nightmareScene).field_0x18 = 0; *(undefined4 *)&(this->_nightmareScene).field_0x1c = 0; local_8._0_1_ = 4; ANM2::constructor((ANM2 *)&(this->_nightmareScene).field_0x20); local_8._0_1_ = 5; ANM2::constructor((ANM2 *)&(this->_nightmareScene).field_0x134); local_8._0_1_ = 6; ANM2::constructor((ANM2 *)&(this->_nightmareScene).field_0x248); local_8._0_1_ = 7; ANM2::constructor((ANM2 *)&this->field_0x219d0); local_8._0_1_ = 8; container = &this->field_0x21ae8; *(undefined4 *)container = 0; *(undefined4 *)&this->field_0x21aec = 0; *(undefined4 *)&this->field_0x21af0 = 0; *(undefined4 *)&this->field_0x21af4 = 0; *(undefined4 *)&this->field_0x21af8 = 0; containerProxy = operator_new(8); containerProxy[1] = 0; *(int **)container = containerProxy; *containerProxy = (int)container; local_8._0_1_ = 9; ANM2::constructor((ANM2 *)&this->field_0x21afc); pAVar2 = &this->_achievementOverlay; local_8._0_1_ = 10; (pAVar2->_queue)._proxy = (void *)0x0; (this->_achievementOverlay)._queue._map = (void *)0x0; (this->_achievementOverlay)._queue._mapSize = 0; (this->_achievementOverlay)._queue._offset = 0; (this->_achievementOverlay)._queue._size = 0; containerProxy = operator_new(8); containerProxy[1] = 0; (pAVar2->_queue)._proxy = containerProxy; *containerProxy = (int)pAVar2; local_8._0_1_ = 0xb; ANM2::constructor(&(this->_achievementOverlay)._sprite); local_8._0_1_ = 0xc; _eh_vector_constructor_iterator_ ((this->_achievementOverlay)._entries,0x34,0x282,(_func_void_void_ptr *)&LAB_00931490, FUN_00420b00); (this->_achievementOverlay)._currentEntry = 0; (this->_achievementOverlay)._state = 0; local_8._0_1_ = 0xd; entry = (this->_musicManager)._channels; _eh_vector_constructor_iterator_(entry,0x184,2,FUN_007df300,FUN_007df3f0); (this->_musicManager)._entries._begin = (void *)0x0; (this->_musicManager)._entries._end = (void *)0x0; (this->_musicManager)._entries._capacity = (void *)0x0; local_8._0_1_ = 0xf; SoundInstance::SoundInstance(&this->field_0x2a2e8); *(undefined4 *)&this->field_0x2a300 = 0x3f800000; remaining = 2; *(undefined4 *)&this->field_0x2a304 = 0x3f800000; *(undefined4 *)&this->field_0x2a308 = 0x3f800000; *(undefined4 *)&this->field_0x2a30c = 0x3da3d70a; this->field_0x2a310 = 0; *(undefined4 *)&this->field_0x2a314 = 0; *(undefined4 *)&this->field_0x2a318 = 0; (this->_musicManager)._currentChannel = 0; (this->_musicManager)._queuedMusicID = 0; (this->_musicManager)._pitch = 1.0; (this->_musicManager)._targetPitch = 1.0; (this->_musicManager)._currentMusicID = 0; (this->_musicManager)._isEnabled = 1; *(undefined4 *)&this->field_0x2a320 = 0; *(undefined4 *)&this->field_0x2a31c = 0x3f800000; do { *(MusicChannel **)&entry->field_0x30 = entry; *(MusicChannel **)&entry->field_0x64 = entry; *(MusicChannel **)&entry->field_0x98 = entry; *(MusicChannel **)&entry->field_0xcc = entry; *(MusicChannel **)&entry->field_0x100 = entry; *(MusicChannel **)&entry->field_0x134 = entry; *(MusicChannel **)&entry->field_0x168 = entry; entry = entry + 1; remaining = remaining + -1; } while (remaining != 0); (this->_sfxManager)._sounds._begin = (void *)0x0; (this->_sfxManager)._sounds._end = (void *)0x0; (this->_sfxManager)._sounds._capacity = (void *)0x0; (this->_sfxManager)._volumeModifier = 1.0; (this->_sfxManager)._volumeModifierStep = 0.005; pOVar3 = &this->_optionsConfig; (pOVar3->_optionsIniFilePath)._buf[0] = '\0'; (pOVar3->_optionsIniFilePath)._buf[1] = '\0'; (pOVar3->_optionsIniFilePath)._buf[2] = '\0'; (pOVar3->_optionsIniFilePath)._buf[3] = '\0'; (this->_optionsConfig)._optionsIniFilePath._size = 0; (this->_optionsConfig)._optionsIniFilePath._capacity = 0xf; (pOVar3->_optionsIniFilePath)._buf[0] = '\0'; local_8._0_1_ = 0x12; OptionsConfig::reset_defaults(); local_8._0_1_ = 0x13; ItemConfig::constructor(); local_8._0_1_ = 0x14; (this->_infoDisplay)._collectibles._head = (void *)0x0; (this->_infoDisplay)._collectibles._size = 0; headNode = operator_new(0x128); *(void **)headNode = headNode; *(void **)((int)headNode + 4) = headNode; *(void **)((int)headNode + 8) = headNode; *(undefined2 *)((int)headNode + 0xc) = 0x101; (this->_infoDisplay)._collectibles._head = headNode; local_8._0_1_ = 0x15; psVar1 = &(this->_infoDisplay)._trinkets; psVar1->_head = (void *)0x0; (this->_infoDisplay)._trinkets._size = 0; headNode = operator_new(0x128); *(void **)headNode = headNode; *(void **)((int)headNode + 4) = headNode; *(void **)((int)headNode + 8) = headNode; *(undefined2 *)((int)headNode + 0xc) = 0x101; psVar1->_head = headNode; local_8._0_1_ = 0x16; container = &(this->_infoDisplay).field_0x10; *(undefined4 *)container = 0; *(undefined4 *)&(this->_infoDisplay).field_0x14 = 0; headNode = operator_new(0x128); *(void **)headNode = headNode; *(void **)((int)headNode + 4) = headNode; *(void **)((int)headNode + 8) = headNode; *(undefined2 *)((int)headNode + 0xc) = 0x101; *(void **)container = headNode; local_8._0_1_ = 0x17; container = &(this->_infoDisplay).field_0x18; *(undefined4 *)container = 0; *(undefined4 *)&(this->_infoDisplay).field_0x1c = 0; headNode = operator_new(0x128); *(void **)headNode = headNode; *(void **)((int)headNode + 4) = headNode; *(void **)((int)headNode + 8) = headNode; *(undefined2 *)((int)headNode + 0xc) = 0x101; *(void **)container = headNode; local_8._0_1_ = 0x18; InfoDisplayEntry::InfoDisplayEntry(&(this->_infoDisplay)._defaultEntry); (this->_challengeParams)._begin = (void *)0x0; (this->_challengeParams)._end = (void *)0x0; (this->_challengeParams)._capacity = (void *)0x0; local_8._0_1_ = 0x1a; (this->_entityConfig)._entities._head = (void *)0x0; (this->_entityConfig)._entities._size = 0; headNode = operator_new(0x180); *(void **)headNode = headNode; *(void **)((int)headNode + 4) = headNode; *(void **)((int)headNode + 8) = headNode; *(undefined2 *)((int)headNode + 0xc) = 0x101; (this->_entityConfig)._entities._head = headNode; (this->_entityConfig)._players._begin = (void *)0x0; (this->_entityConfig)._players._end = (void *)0x0; (this->_entityConfig)._players._capacity = (void *)0x0; (this->_entityConfig)._babies._begin = (void *)0x0; (this->_entityConfig)._babies._end = (void *)0x0; (this->_entityConfig)._babies._capacity = (void *)0x0; (this->_entityConfig)._bosses._begin = (void *)0x0; (this->_entityConfig)._bosses._end = (void *)0x0; (this->_entityConfig)._bosses._capacity = (void *)0x0; (this->_entityConfig)._edenHair._begin = (void *)0x0; (this->_entityConfig)._edenHair._end = (void *)0x0; (this->_entityConfig)._edenHair._capacity = (void *)0x0; *(undefined4 *)&this->field_0x2a6a8 = 0; *(undefined4 *)&this->field_0x2a6ac = 0; *(undefined4 *)&this->field_0x2a6b0 = 0; *(undefined4 *)&this->field_0x2a6b4 = 0; *(undefined4 *)&this->field_0x2a6b8 = 0; *(undefined4 *)&this->field_0x2a6bc = 0; this->_modManager = (ModManager)0x0; *(undefined4 *)&this->field_0x2a6c4 = 0; *(undefined4 *)&this->field_0x2a6c8 = 0; memset(&this->field_0x2a6cc,0,0x20000); this->field_0x4a6d0 = 0; *(undefined ***)&this->field_0x4a6cc = KAGE::Thread::vftable; *(undefined4 *)&this->field_0x4a6d4 = 0; this->field_0x4a6d8 = 0; *(undefined4 *)&this->field_0x4a6dc = 0; *(undefined4 *)&this->field_0x4a6ec = 0; *(undefined4 *)&this->field_0x4a6f0 = 0xf; this->field_0x4a6dc = 0; local_8._0_1_ = 0x1f; ANM2::constructor((ANM2 *)&this->field_0x4a6f4); local_8._0_1_ = 0x20; ANM2::constructor((ANM2 *)&this->field_0x4a808); *(undefined4 *)&this->field_0x4a91c = 0; if (DAT_00c79860 != 0) { *(undefined4 *)&this->field_0x4a91c = 3; } local_8._0_1_ = 0x21; StringTable::constructor(); local_8._0_1_ = 0x22; StringTable::constructor(); local_8._0_1_ = 0x23; _eh_vector_constructor_iterator_(&this->_popupButtons,0x130,2,FUN_00951130,FUN_008ba170); (this->_popupButtons)._callback = (void *)0x0; (this->_popupButtons)._callbackContext = (void *)0x0; *(undefined4 *)&this->field_0x4abc8 = 0xffffffff; *(undefined4 *)&this->field_0x4abcc = 0xffffffff; this->field_0x4abd0 = 0; *(undefined4 *)&this->field_0x4abd8 = 0; *(undefined4 *)&this->field_0x4abdc = 0; *(undefined4 *)&this->field_0x4abe0 = 0; local_8._0_1_ = 0x25; ANM2::constructor(&this->_buttonsSprite); local_8._0_1_ = 0x26; ANM2::constructor(&this->_platformIconsSprite); local_8._0_1_ = 0x27; _eh_vector_constructor_iterator_ (&this->field_0x4ae0c,8,2,(_func_void_void_ptr *)&LAB_0040c5b0,FUN_0040c440); local_8._0_1_ = 0x28; *(undefined4 *)&this->field_0x4ae20 = 0; *(undefined4 *)&this->field_0x4ae24 = 0; Font::Font(&this->_font1_TeamMeatEx10); local_8._0_1_ = 0x29; Font::Font(&this->_font2_TeamMeatEx12); local_8._0_1_ = 0x2a; Font::Font(&this->_font3_TeamMeatEx16); local_8._0_1_ = 0x2b; Font::Font(&this->_font4_terminus); local_8._0_1_ = 0x2c; Font::Font(&this->_font5_terminus8); local_8._0_1_ = 0x2d; Font::Font(&this->_font6_PFTempestaSevenCondensed); local_8._0_1_ = 0x2e; Font::Font(&this->_font7_Upheaval); local_8._0_1_ = 0x2f; Font::Font(&this->_font8_LuaMiniOutlined); local_8._0_1_ = 0x30; Font::Font(&this->_font9_PFTempestaSevenCondensedAgain); local_8._0_1_ = 0x31; LobbySettings::reset(&this->_lobbySettings); local_8._0_1_ = 0x32; Seeds::constructor(); *(undefined4 *)&this->field_0x4b1a8 = 0; *(undefined4 *)&this->field_0x4b1b8 = 0; *(undefined4 *)&this->field_0x4b1bc = 0xf; this->field_0x4b1a8 = 0; local_8._0_1_ = 0x34; ChallengeParams::ChallengeParams(&(this->_dailyChallenge)._params); (this->_dailyChallenge)._id = 0; (this->_dailyChallenge)._seed = 0; (this->_dailyChallenge)._specialDailyId = 0; (this->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(this->_dailyChallenge)._params); (this->_lobbyMembers)._begin = (void *)0x0; (this->_lobbyMembers)._end = (void *)0x0; (this->_lobbyMembers)._capacity = (void *)0x0; local_8._0_1_ = 0x35; (this->_pendingMenuFadeColor)._unk = 0; (this->_pendingMenuFadeColor)._red = 0.0; (this->_pendingMenuFadeColor)._green = 0.0; (this->_pendingMenuFadeColor)._blue = 0.0; (this->_pendingMenuFadeColor)._alpha = 0.0; ANM2::constructor(&this->_cursorSprite); local_8._0_1_ = 0x36; (this->_lastMousePosition).y = 0.0; (this->_lastMousePosition).x = 0.0; *(undefined4 *)&this->field_0x4b3d0 = 0; *(undefined4 *)&this->field_0x4b3cc = 0; SaveSlotManager::constructor(); local_8._0_1_ = 0x37; container = &this[1]._gamestate.field_0xcf0; *(undefined4 *)container = 0; *(undefined4 *)&this[1]._gamestate.field_0xcf4 = 0; headNode = operator_new(0xc); *(void **)headNode = headNode; *(void **)((int)headNode + 4) = headNode; *(void **)container = headNode; this[1]._gamestate.field_0xcfc = 0; *(undefined ***)&this[1]._gamestate.field_0xcf8 = KAGE::Mutex::vftable; *(undefined4 *)&this[1]._gamestate.field_0xd00 = 0; local_8 = CONCAT31(local_8._1_3_,0x39); FUN_00a15770(); this->field_0x4b3d4 = DAT_00c71673; ExceptionList = local_10; return this; } //@@ 00950eb0 FUN_00950eb0 void FUN_00950eb0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; VideoPlayer::unload(__security_cookie ^ (int)register0x00000010 - 4U); _eh_vector_destructor_iterator_((void *)(in_ECX + 4),0x4c,0x1b,CutsceneEntry::Destructor); ExceptionList = local_10; return; } //@@ 00950f10 NightmareScene::~NightmareScene /* DB: destroys ANM2s at +0x20/+0x134/+0x248/+0x3a8/+0x4d4, the same sprite offsets Manager::constructor builds at Manager+0x21628 (_nightmareScene, db/fields.tsv), plus a vector and vector; called from Manager::destructor */ void NightmareScene::~NightmareScene(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0bd60; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x4d4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x524)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x504)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x4ec)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x4d4)); std::deque<32byte>::_Tidy(); local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x3a8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3f8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3d8)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x3c0)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x3a8)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x248)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x298)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x278)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x260)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x248)); local_8 = 3; ANM2::Reset((ANM2 *)(in_ECX + 0x134)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x184)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x164)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x14c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x134)); local_8 = 4; ANM2::Reset((ANM2 *)(in_ECX + 0x20)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x70)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x50)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); FID_conflict__Tidy((void *)(in_ECX + 0x14)); std::vector::_Tidy(); ExceptionList = local_10; return; } //@@ 00951090 FUN_00951090 void FUN_00951090(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)((int)in_ECX + 0x264) = 0; *(undefined4 *)((int)in_ECX + 0x268) = 0; _eh_vector_destructor_iterator_(in_ECX,0x130,2,FUN_008ba170); ExceptionList = local_10; return; } //@@ 009510f0 FUN_009510f0 void FUN_009510f0(void) { int in_ECX; undefined4 *this; std::vector::_Tidy(); FUN_004269f0(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x78)); this = (undefined4 *)(in_ECX + 0x60); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 0x60) + 4)); operator_delete((void *)*this,0x14); return; } //@@ 00951130 FUN_00951130 void FUN_00951130(void) { ANM2 *in_ECX; ANM2::constructor(in_ECX); in_ECX[1]._animDefaultName._buf[0] = '\0'; in_ECX[1]._animDefaultName._buf[1] = '\0'; in_ECX[1]._animDefaultName._buf[2] = '\0'; in_ECX[1]._animDefaultName._buf[3] = '\0'; in_ECX[1]._filename._capacity = 0; return; } //@@ 00951160 Manager::destructor /* ZHL [exact] __thiscall void Manager::destructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Manager::destructor(Manager *this) { void **seedEffectsTree; std_map *fontCharsTree; undefined1 *stringTableIndexTree; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; ANM2 *popupButtonSprite; int buttonsLeft; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 *saveFile; local_8 = 0xffffffff; puStack_c = &LAB_00b0bd80; local_10 = ExceptionList; ExceptionList = &local_10; popupButtonSprite = (ANM2 *)&this->_popupButtons; buttonsLeft = 2; do { ANM2::Reset(popupButtonSprite); popupButtonSprite = (ANM2 *)(popupButtonSprite[1]._animDefaultName._buf + 4); buttonsLeft = buttonsLeft + -1; } while (buttonsLeft != 0); KAGE::SmartPointer::reset(extraout_ECX); KAGE::SmartPointer::reset(extraout_ECX_00); KAGE::SmartPointer::reset(extraout_ECX_01); KAGE::SmartPointer::reset(extraout_ECX_02); StringTable::clear(&this->_stringTable); StringTable::clear(&this->_stringTablePc); FUN_008f5960(); if (this->_netplayManager != *(NetplayManager *)(this + 1)) { NetplayManager::reset(&this->_netplayManager,1); } PopupQueue::destructor(); NetplayManager::~NetplayManager(); local_8 = 0; ANM2::Reset(&this->_cursorSprite); AnimationState::~AnimationState(&(this->_cursorSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_cursorSprite)._animState); std::string::_Tidy_deallocate((this->_cursorSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_cursorSprite); local_8 = 0xffffffff; std::vector::_Tidy(); FUN_004269f0(); std::string::_Tidy_deallocate(&this->field_0x4b1a8); seedEffectsTree = &(this->_startSeeds)._seedEffects; FID_conflict__Erase_tree_>_> (seedEffectsTree,(fuzzer_allocator_> *)seedEffectsTree, *(_Tree_node **)((int)(this->_startSeeds)._seedEffects + 4)); operator_delete(*seedEffectsTree,0x14); std::vector::_Tidy(); std::string::_Tidy_deallocate((this->_lobbySettings)._password._buf); std::string::_Tidy_deallocate((this->_lobbySettings)._seed._buf); Font::Unload(&this->_font9_PFTempestaSevenCondensedAgain); fontCharsTree = &(this->_font9_PFTempestaSevenCondensedAgain)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font9_PFTempestaSevenCondensedAgain)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font8_LuaMiniOutlined); fontCharsTree = &(this->_font8_LuaMiniOutlined)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font8_LuaMiniOutlined)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font7_Upheaval); fontCharsTree = &(this->_font7_Upheaval)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font7_Upheaval)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font6_PFTempestaSevenCondensed); fontCharsTree = &(this->_font6_PFTempestaSevenCondensed)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font6_PFTempestaSevenCondensed)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font5_terminus8); fontCharsTree = &(this->_font5_terminus8)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font5_terminus8)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font4_terminus); fontCharsTree = &(this->_font4_terminus)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font4_terminus)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font3_TeamMeatEx16); fontCharsTree = &(this->_font3_TeamMeatEx16)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font3_TeamMeatEx16)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font2_TeamMeatEx12); fontCharsTree = &(this->_font2_TeamMeatEx12)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font2_TeamMeatEx12)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); Font::Unload(&this->_font1_TeamMeatEx10); fontCharsTree = &(this->_font1_TeamMeatEx10)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, *(_Tree_node **) ((int)(this->_font1_TeamMeatEx10)._charsBlock._head + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); _eh_vector_destructor_iterator_(&this->field_0x4ae0c,8,2,FUN_0040c440); local_8 = 1; ANM2::Reset(&this->_platformIconsSprite); AnimationState::~AnimationState(&(this->_platformIconsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_platformIconsSprite)._animState); std::string::_Tidy_deallocate((this->_platformIconsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_platformIconsSprite); local_8 = 2; ANM2::Reset(&this->_buttonsSprite); AnimationState::~AnimationState(&(this->_buttonsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_buttonsSprite)._animState); std::string::_Tidy_deallocate((this->_buttonsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_buttonsSprite); std::vector<260byte>::~vector(); local_8 = 3; (this->_popupButtons)._callback = (void *)0x0; (this->_popupButtons)._callbackContext = (void *)0x0; _eh_vector_destructor_iterator_(&this->_popupButtons,0x130,2,FUN_008ba170); StringTable::clear(&this->_stringTablePc); fontCharsTree = &(this->_stringTablePc)._categories; std::map::_Erase_tree (fontCharsTree,*(undefined4 *)((int)(this->_stringTablePc)._categories._head + 4)); operator_delete(fontCharsTree->_head,0x28); stringTableIndexTree = &(this->_stringTablePc).field_0x4; FID_conflict__Erase_tree_>_> (stringTableIndexTree,(fuzzer_allocator_> *)stringTableIndexTree, *(_Tree_node **)(*(int *)&(this->_stringTablePc).field_0x4 + 4)); operator_delete(*(void **)stringTableIndexTree,0x18); StringTable::clear(&this->_stringTable); fontCharsTree = &(this->_stringTable)._categories; std::map::_Erase_tree (fontCharsTree,*(undefined4 *)((int)(this->_stringTable)._categories._head + 4)); operator_delete(fontCharsTree->_head,0x28); stringTableIndexTree = &(this->_stringTable).field_0x4; FID_conflict__Erase_tree_>_> (stringTableIndexTree,(fuzzer_allocator_> *)stringTableIndexTree, *(_Tree_node **)(*(int *)&(this->_stringTable).field_0x4 + 4)); operator_delete(*(void **)stringTableIndexTree,0x18); ModManager::~ModManager(); FUN_00694ea0(); std::vector<164byte>::_Tidy(); InfoDisplay::~InfoDisplay(); ItemConfig::destructor(&this->_itemConfig); std::string::_Tidy_deallocate((char *)&this->_optionsConfig); std::vector::_Tidy(); MusicManager::~MusicManager(); AchievementOverlay::~AchievementOverlay(&this->_achievementOverlay); NightmareScene::~NightmareScene(); local_8 = 4; VideoPlayer::unload(); _eh_vector_destructor_iterator_ (&(this->_cutsceneManager).field_0x4,0x4c,0x1b,CutsceneEntry::Destructor); GameState::~GameState(&this->_gamestate); local_8 = 5; saveFile = (this->_persistentGameData)._saveFile; if (saveFile != (undefined4 *)0x0) { (**(code **)*saveFile)(1); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)&(this->_persistentGameData)._bestiaryEncounters); std::string::_Tidy_deallocate(&(this->_persistentGameData).field_0x20); std::string::_Tidy_deallocate(&(this->_persistentGameData).field_0x8); ExceptionList = local_10; return; } //@@ 00951730 Manager::create_render_surfaces /* DB: strings "Render Surface (Manager)", "Color Correction Surface", "HQ4X size: %dx%d"; (re)creates the manager's render targets via FUN_00a11f30 when missing and the matching options are on (+0x2a3c2 color correction, +0x2a3c6 HQ4X); Manager::Init, Manager::Render */ void Manager::create_render_surfaces(void) { int *piVar1; char cVar2; uint uVar3; void *pvVar4; int in_ECX; KColor *clearColor; KColor *clearColor_00; KColor *clearColor_01; KColor local_34; undefined1 local_20 [4]; int *local_1c; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0bdbd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; if ((DAT_00c79890 == (int *)0x0) && (*(char *)(in_ECX + 0x2a3c6) != '\0')) { KAGE_LogMessage(1,(byte *)"HQ4X size: %dx%d\n"); KColor::SetFromARGB(&local_34,0); pvVar4 = KAGE_Graphics::create_render_target (local_18,g_framebufferWidth,DAT_00c79114,(byte *)"HQ4X Surface (Manager)", clearColor); local_8 = 0; shared_ptr::operator_assign(&DAT_00c79890,pvVar4); local_8 = 1; if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_18); } } piVar1 = DAT_00c79890; local_8 = 0xffffffff; if ((DAT_00c79890[0xe] != 0) || (DAT_00c79890[0xf] != 0)) { (**(code **)(*DAT_00c79890 + 0x48))(0,0); piVar1[0xe] = 0; piVar1[0xf] = 0; } } if ((DAT_00c798a8 == 0) && ((g_manager->_optionsConfig)._enableColorCorrection != 0)) { KColor::SetFromARGB(&local_34,0); pvVar4 = KAGE_Graphics::create_render_target (local_18,g_framebufferWidth,DAT_00c79114,(byte *)"Color Correction Surface", clearColor_00); local_8 = 2; shared_ptr::operator_assign(&DAT_00c798a8,pvVar4); local_8 = 3; if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 0xc))(); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_18); } } local_8 = 0xffffffff; } if (DAT_00c798a0 == 0) { KColor::SetFromARGB(&local_34,0); pvVar4 = KAGE_Graphics::create_render_target (local_20,g_framebufferWidth,DAT_00c79114,(byte *)"Render Surface (Manager)", clearColor_01); local_8 = 4; shared_ptr::operator_assign(&DAT_00c798a0,pvVar4); local_8 = 5; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_20); } } } ExceptionList = local_10; return; } //@@ 00951920 Manager::load_fonts /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: loads font/TeamMeatEx/TeamMeatEx10/12/16.fnt, Upheaval, PFTempestaSevenCondensed, CJK/LanaPixel, KR_MeatFont14, MPlus_12b into Manager fonts (+0x4ae70..), ModManager::TryRedirectPath prototype: db/protos.zhl */ void __thiscall Manager::load_fonts(Manager *this) { byte bVar1; byte *extraout_EAX; byte *extraout_EAX_00; byte *extraout_EAX_01; byte *extraout_EAX_02; byte *extraout_EAX_03; int fallbackGlyph; byte *pbVar2; void *freeBlock; char *pcVar3; uint freeSize; char *secondaryFontPath; ModManager *local_70; void *redirectedPathB [4]; uint redirectedPathBSize; uint redirectedPathBCapacity; void *redirectedPathA [4]; uint redirectedPathASize; uint redirectedPathACapacity; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; Manager *manager; puStack_20 = (undefined1 *)(redirectedPathA + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0be35; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(redirectedPathA + 0x11); ExceptionList = &local_1c; Font::Unload(&this->_font9_PFTempestaSevenCondensedAgain); Font::Unload(&this->_font7_Upheaval); fallbackGlyph = *(int *)&g_manager->_stringTable; if (fallbackGlyph == 2) { pcVar3 = "font/MPlus_12b.fnt"; LAB_009519b0: secondaryFontPath = "font/CJK/LanaPixel.fnt"; } else { if (fallbackGlyph == 0xb) { pcVar3 = "font/KR_MeatFont14.fnt"; goto LAB_009519b0; } if (fallbackGlyph == 0xd) { pcVar3 = "font/UpheavalExtended.fnt"; goto LAB_009519b0; } pcVar3 = "font/Upheaval.fnt"; secondaryFontPath = "font/PFTempestaSevenCondensed.fnt"; } local_70 = &g_manager->_modManager; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar2 = (byte *)pcVar3; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(local_3c._buf,(byte *)pcVar3,(int)pbVar2 - (int)(pcVar3 + 1)); local_14 = (void *)0x0; ModManager::TryRedirectPath(local_70,(std_string *)redirectedPathA,&local_3c); local_14._0_1_ = 1; pbVar2 = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { pbVar2 = *(byte **)extraout_EAX; } Font::Load(&this->_font7_Upheaval,pbVar2,0); local_14 = (void *)((uint)local_14._1_3_ << 8); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; freeBlock = redirectedPathA[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)redirectedPathA[0] + -4); freeSize = redirectedPathACapacity + 0x24; if (0x1f < (uint)((int)redirectedPathA[0] + (-4 - (int)freeBlock))) goto LAB_00951a98; } operator_delete(freeBlock,freeSize); } local_14 = (void *)0xffffffff; redirectedPathASize = 0; redirectedPathACapacity = 0xf; redirectedPathA[0] = (void *)((uint)redirectedPathA[0] & 0xffffff00); if (0xf < local_3c._capacity) { freeSize = local_3c._capacity + 1; freeBlock = (void *)local_3c._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(local_3c._buf._0_4_ + -4); freeSize = local_3c._capacity + 0x24; if ((void *)0x1f < (void *)(local_3c._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_00951a98: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } local_70 = &g_manager->_modManager; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = (void *)0x0; pbVar2 = (byte *)secondaryFontPath; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(local_3c._buf,(byte *)secondaryFontPath, (int)pbVar2 - (int)(secondaryFontPath + 1)); local_14 = (void *)0x2; ModManager::TryRedirectPath(local_70,(std_string *)redirectedPathB,&local_3c); local_14._0_1_ = 3; pbVar2 = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { pbVar2 = *(byte **)extraout_EAX_00; } Font::Load(&this->_font9_PFTempestaSevenCondensedAgain,pbVar2,0); local_14 = (void *)CONCAT31(local_14._1_3_,2); if (0xf < redirectedPathBCapacity) { freeSize = redirectedPathBCapacity + 1; freeBlock = redirectedPathB[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)redirectedPathB[0] + -4); freeSize = redirectedPathBCapacity + 0x24; if (0x1f < (uint)((int)redirectedPathB[0] + (-4 - (int)freeBlock))) goto LAB_00951b8a; } operator_delete(freeBlock,freeSize); } local_14 = (void *)0xffffffff; redirectedPathBSize = 0; redirectedPathBCapacity = 0xf; redirectedPathB[0] = (void *)((uint)redirectedPathB[0] & 0xffffff00); if (0xf < local_3c._capacity) { freeSize = local_3c._capacity + 1; freeBlock = (void *)local_3c._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(local_3c._buf._0_4_ + -4); freeSize = local_3c._capacity + 0x24; if ((void *)0x1f < (void *)(local_3c._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_00951b8a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x20; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"font/TeamMeatEx/TeamMeatEx10.fnt",0x21); local_14 = (void *)0x4; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)redirectedPathA,&local_3c); local_14._0_1_ = 5; pbVar2 = extraout_EAX_01; if (0xf < *(uint *)(extraout_EAX_01 + 0x14)) { pbVar2 = *(byte **)extraout_EAX_01; } Font::Load(&this->_font1_TeamMeatEx10,pbVar2,0); local_14 = (void *)CONCAT31(local_14._1_3_,4); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; freeBlock = redirectedPathA[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)redirectedPathA[0] + -4); freeSize = redirectedPathACapacity + 0x24; if (0x1f < (uint)((int)redirectedPathA[0] + (-4 - (int)freeBlock))) goto LAB_00951c7b; } operator_delete(freeBlock,freeSize); } local_14 = (void *)0xffffffff; redirectedPathASize = 0; redirectedPathACapacity = 0xf; redirectedPathA[0] = (void *)((uint)redirectedPathA[0] & 0xffffff00); if (0xf < local_3c._capacity) { freeSize = local_3c._capacity + 1; pcVar3 = (char *)local_3c._buf._0_4_; if (0xfff < freeSize) { pcVar3 = *(char **)(local_3c._buf._0_4_ + -4); freeSize = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar3))) { LAB_00951c7b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,freeSize); } manager = g_manager; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x20; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"font/TeamMeatEx/TeamMeatEx12.fnt",0x21); local_14 = (void *)0x6; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)redirectedPathB,&local_3c); local_14._0_1_ = 7; pbVar2 = extraout_EAX_02; if (0xf < *(uint *)(extraout_EAX_02 + 0x14)) { pbVar2 = *(byte **)extraout_EAX_02; } Font::Load(&this->_font2_TeamMeatEx12,pbVar2,0); local_14 = (void *)CONCAT31(local_14._1_3_,6); if (0xf < redirectedPathBCapacity) { freeSize = redirectedPathBCapacity + 1; freeBlock = redirectedPathB[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)redirectedPathB[0] + -4); freeSize = redirectedPathBCapacity + 0x24; if (0x1f < (uint)((int)redirectedPathB[0] + (-4 - (int)freeBlock))) goto LAB_00951d6c; } operator_delete(freeBlock,freeSize); } local_14 = (void *)0xffffffff; redirectedPathBSize = 0; redirectedPathBCapacity = 0xf; redirectedPathB[0] = (void *)((uint)redirectedPathB[0] & 0xffffff00); if (0xf < local_3c._capacity) { freeSize = local_3c._capacity + 1; pcVar3 = (char *)local_3c._buf._0_4_; if (0xfff < freeSize) { pcVar3 = *(char **)(local_3c._buf._0_4_ + -4); freeSize = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar3))) { LAB_00951d6c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,freeSize); } manager = g_manager; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x20; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"font/TeamMeatEx/TeamMeatEx16.fnt",0x21); local_14 = (void *)0x8; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)redirectedPathA,&local_3c); local_14 = (void *)CONCAT31(local_14._1_3_,9); pbVar2 = extraout_EAX_03; if (0xf < *(uint *)(extraout_EAX_03 + 0x14)) { pbVar2 = *(byte **)extraout_EAX_03; } Font::Load(&this->_font3_TeamMeatEx16,pbVar2,0); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; freeBlock = redirectedPathA[0]; if (0xfff < freeSize) { freeBlock = *(void **)((int)redirectedPathA[0] + -4); freeSize = redirectedPathACapacity + 0x24; if (0x1f < (uint)((int)redirectedPathA[0] + (-4 - (int)freeBlock))) goto LAB_00951e52; } operator_delete(freeBlock,freeSize); } redirectedPathASize = 0; redirectedPathACapacity = 0xf; redirectedPathA[0] = (void *)((uint)redirectedPathA[0] & 0xffffff00); if ((void *)0xf < local_3c._capacity) { freeSize = local_3c._capacity + 1; pcVar3 = (char *)local_3c._buf._0_4_; if (0xfff < freeSize) { pcVar3 = *(char **)(local_3c._buf._0_4_ + -4); freeSize = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar3))) { LAB_00951e52: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,freeSize); } (this->_font1_TeamMeatEx10)._missingCharacter = -1; local_70 = (ModManager *)0x3f; _Find_lower_bound<>((undefined1 *)((int)&local_3c + 0xc),&local_70); if (((*(char *)(local_3c._capacity + 0xd) == '\0') && (*(uint *)(local_3c._capacity + 0x10) < 0x40)) && ((void *)local_3c._capacity != (this->_font1_TeamMeatEx10)._charsBlock._head)) { fallbackGlyph = *(int *)(local_3c._capacity + 0x14); } else { fallbackGlyph = -1; } (this->_font1_TeamMeatEx10)._missingCharacter = fallbackGlyph; (this->_font2_TeamMeatEx12)._missingCharacter = -1; local_70 = (ModManager *)0x3f; _Find_lower_bound<>((undefined1 *)((int)&local_3c + 0xc),&local_70); if (((*(char *)(local_3c._capacity + 0xd) == '\0') && (*(uint *)(local_3c._capacity + 0x10) < 0x40)) && ((void *)local_3c._capacity != (this->_font2_TeamMeatEx12)._charsBlock._head)) { fallbackGlyph = *(int *)(local_3c._capacity + 0x14); } else { fallbackGlyph = -1; } (this->_font2_TeamMeatEx12)._missingCharacter = fallbackGlyph; (this->_font3_TeamMeatEx16)._missingCharacter = -1; local_70 = (ModManager *)0x3f; _Find_lower_bound<>((undefined1 *)((int)&local_3c + 0xc),&local_70); if (((*(char *)(local_3c._capacity + 0xd) == '\0') && (*(uint *)(local_3c._capacity + 0x10) < 0x40)) && ((void *)local_3c._capacity != (this->_font3_TeamMeatEx16)._charsBlock._head)) { fallbackGlyph = *(int *)(local_3c._capacity + 0x14); } else { fallbackGlyph = -1; } (this->_font3_TeamMeatEx16)._missingCharacter = fallbackGlyph; ExceptionList = local_1c; return; } //@@ 00951f60 loading_images_load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (seed): picks loadimages-%03u.png / _2.png (or greedmode loadimages-g%03u when Manager+0x4b0d4 is 2/3, seed%0x14+1) and stores them via Manager::LoadImage into smart pointers; called by MenuManager::start_game */ void loading_images_load(void) { longlong lVar1; longlong lVar2; Manager *pMVar3; char cVar4; uint uVar5; void *pvVar6; undefined1 *puVar7; uint uVar8; uint uVar9; ulonglong uVar10; undefined1 local_a8 [4]; int *local_a4; undefined1 local_a0 [4]; int *local_9c; byte local_98 [128]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar3 = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0be91; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_98 + 0x94); ExceptionList = &local_10; local_18 = uVar5; if ((g_manager->_selectedDifficulty == 2) || (g_manager->_selectedDifficulty == 3)) { sprintf_s(local_98,0x80,(byte *)"gfx/ui/loadimages/greedmode/loadimages-g%03u.png"); KAGE::SmartPointer::reset(&pMVar3->field_0x4ae0c,(void *)0x0); pvVar6 = Manager::LoadImage(local_a0,local_98); local_8 = 0; KAGE::SmartPointer::operator_assign(&pMVar3->field_0x4ae0c,pvVar6); local_8 = 1; if (local_9c != (int *)0x0) { cVar4 = (**(code **)(*local_9c + 0xc))(uVar5); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_a0); } } local_8 = 0xffffffff; sprintf_s(local_98,0x80,(byte *)"gfx/ui/loadimages/greedmode/loadimages-g%03u_2.png"); KAGE::SmartPointer::reset(&pMVar3->field_0x4ae14,(void *)0x0); pvVar6 = Manager::LoadImage(local_a0,local_98); local_8 = 2; KAGE::SmartPointer::operator_assign(&pMVar3->field_0x4ae14,pvVar6); local_8 = 3; if (local_9c == (int *)0x0) goto LAB_009521fd; cVar4 = (**(code **)(*local_9c + 0xc))(); if ((cVar4 == '\0') || (g_imageReleaseFn == (void *)0x0)) goto LAB_009521fd; puVar7 = local_a0; } else { sprintf_s(local_98,0x80,(byte *)"gfx/ui/loadimages/loadimages-%03u.png"); KAGE::SmartPointer::reset(&pMVar3->field_0x4ae0c,(void *)0x0); pvVar6 = Manager::LoadImage(local_a0,local_98); local_8 = 4; KAGE::SmartPointer::operator_assign(&pMVar3->field_0x4ae0c,pvVar6); local_8 = 5; if (local_9c != (int *)0x0) { cVar4 = (**(code **)(*local_9c + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_a0); } } local_8 = 0xffffffff; sprintf_s(local_98,0x80,(byte *)"gfx/ui/loadimages/loadimages-%03u_2.png"); KAGE::SmartPointer::reset(&pMVar3->field_0x4ae14,(void *)0x0); pvVar6 = Manager::LoadImage(local_a8,local_98); local_8 = 6; KAGE::SmartPointer::operator_assign(&pMVar3->field_0x4ae14,pvVar6); local_8 = 7; if (local_a4 == (int *)0x0) goto LAB_009521fd; cVar4 = (**(code **)(*local_a4 + 0xc))(); if ((cVar4 == '\0') || (g_imageReleaseFn == (void *)0x0)) goto LAB_009521fd; puVar7 = local_a8; } (*g_imageReleaseFn)(puVar7); LAB_009521fd: uVar10 = GetTimeNs(); uVar8 = (uint)(uVar10 >> 0x20); lVar1 = (uVar10 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar8 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); uVar9 = (uint)((ulonglong)lVar2 >> 0x20); uVar5 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar8 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar5),uVar9 + uVar5); uVar5 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)&pMVar3->field_0x4ae20 = (uint)lVar1 >> 0x12 | uVar5 * 0x4000; *(uint *)&pMVar3->field_0x4ae24 = uVar5 >> 0x12; ExceptionList = local_10; return; } //@@ 009522b0 Manager::render_loading_icon /* DB: draws one of the two images at Manager+0x4ae0c (slot chosen by _framecount % 16 > 7, i.e. blinking) centered on screen (g_screenWidth/Height minus image size, halved); Game::Render calls it only when _isFadeInIconShown, MenuManager::Render during its fade */ void Manager::render_loading_icon(void) { char cVar1; uint uVar2; uint uVar3; uint uVar4; undefined4 in_XMM1_Da; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; float local_24; float local_20; int *local_1c; int *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05d9d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar3 = g_manager->_framecount & 0x8000000f; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff0) + 1; } uVar4 = 0; if (*(int *)((int)(&g_manager->_platformIconsSprite + 1) + (uint)(7 < (int)uVar3) * 8) != 0) { uVar4 = (uint)(7 < (int)uVar3); } local_14 = in_XMM1_Da; KAGE::SmartPointer::operator_assign (&local_1c,(void *)((int)(&g_manager->_platformIconsSprite + 1) + uVar4 * 8)); local_8 = 0; if (local_1c != (int *)0x0) { local_2c = local_14; local_28 = 0; local_38 = 0x3f800000; local_34 = 0x3f800000; local_30 = 0x3f800000; local_20 = (g_screenHeight - (float)((double)local_1c[5] + __uint_to_double_fixup[-(local_1c[5] >> 0x1f)])) * 0.5; local_24 = (g_screenWidth - (float)((double)local_1c[4] + __uint_to_double_fixup[-(local_1c[4] >> 0x1f)])) * 0.5; (**(code **)(*local_1c + 0x20))(&local_24,&local_38,uVar2); } local_8 = 1; if (local_18 != (int *)0x0) { cVar1 = (**(code **)(*local_18 + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_1c); } } ExceptionList = local_10; return; } //@@ 00952410 Manager::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? zhl has Manager::Init but its sig missed; loads stringtable.sta/stringtable_pc.sta, options.ini (falls back through Repentance/Afterbirth+/Afterbirth/Rebirth dirs), SteamCloud check, Game::constructor, ModManager::ListMods, Seeds::InitSeedInfo prototype: REPENTOGON */ void __cdecl Manager::Init(void) { char cVar1; byte bVar2; byte *pbVar3; int *piVar4; Game *extraout_EAX; byte *animNameChar; int unused; char *pathEnd; int extraout_ECX; int extraout_ECX_00; byte *wantedAnimNameChar; char *pcVar5; uint uVar6; int iVar7; Manager *manager; bool isLess; ANM2 *device; int *deviceRefCount; ANM2 *deviceCopy; int *deviceCopyRefCount; Manager *savedManager; char isOptionsIniFound; Game *local_230; std_string anm2Path; byte optionsIniPath [255]; char cStack_115; char oldOptionsIniPath [256]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *buttonsSprite; StringTable *stringTable; manager = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0bf11; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(oldOptionsIniPath + 0x110); ExceptionList = &local_10; savedManager = g_manager; stringTable = &g_manager->_stringTable; g_manager->_isSavingGameState = 0; StringTable::Load(stringTable,(byte *)"stringtable.sta"); StringTable::Load(&manager->_stringTablePc,(byte *)"stringtable_pc.sta"); validate_language(manager,unused); manager->_selectedDifficulty = 0; manager->_isWindowFocused = 1; sprintf_s(optionsIniPath,0x100,&DAT_00b60c28); pbVar3 = FileSystem::ResolvePath(optionsIniPath); isOptionsIniFound = pbVar3 != (byte *)0x0; if (pbVar3 != (byte *)0x0) { local_8 = 0; tracked_alloc(1,pbVar3,0); local_8 = 0xffffffff; } if (isOptionsIniFound == '\0') { memset(oldOptionsIniPath,0,0x100); pbVar3 = optionsIniPath; do { bVar2 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar2 != 0); strncpy(oldOptionsIniPath,(char *)optionsIniPath, (size_t)(pbVar3 + (-0x28 - (int)(optionsIniPath + 1)))); pcVar5 = oldOptionsIniPath; do { local_230 = (Game *)pcVar5; pcVar5 = (char *)((int)local_230 + 1); } while (*(char *)local_230 != '\0'); strncpy((char *)local_230,"Binding of Isaac Repentance",0x1c); pcVar5 = &cStack_115; do { pathEnd = pcVar5 + 1; pcVar5 = pcVar5 + 1; } while (*pathEnd != '\0'); pcVar5[0] = '/'; pcVar5[1] = '\0'; pcVar5 = &cStack_115; do { pathEnd = pcVar5; pcVar5 = pathEnd + 1; } while (pathEnd[1] != '\0'); builtin_strncpy(pathEnd + 1,"options.ini",0xc); cVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath); if (cVar1 == '\0') { strncpy((char *)local_230,"Binding of Isaac Afterbirth+",0x1d); pcVar5 = &cStack_115; do { pathEnd = pcVar5 + 1; pcVar5 = pcVar5 + 1; } while (*pathEnd != '\0'); pcVar5[0] = '/'; pcVar5[1] = '\0'; pcVar5 = &cStack_115; do { pathEnd = pcVar5; pcVar5 = pathEnd + 1; } while (pathEnd[1] != '\0'); builtin_strncpy(pathEnd + 1,"options.ini",0xc); cVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath); if (cVar1 == '\0') { strncpy((char *)local_230,"Binding of Isaac Afterbirth",0x1c); pcVar5 = &cStack_115; do { pathEnd = pcVar5 + 1; pcVar5 = pcVar5 + 1; } while (*pathEnd != '\0'); pcVar5[0] = '/'; pcVar5[1] = '\0'; pcVar5 = &cStack_115; do { pathEnd = pcVar5; pcVar5 = pathEnd + 1; } while (pathEnd[1] != '\0'); builtin_strncpy(pathEnd + 1,"options.ini",0xc); cVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath); if (cVar1 == '\0') { strncpy((char *)local_230,"Binding of Isaac Rebirth",0x19); pcVar5 = &cStack_115; do { pathEnd = pcVar5 + 1; pcVar5 = pcVar5 + 1; } while (*pathEnd != '\0'); pcVar5[0] = '/'; pcVar5[1] = '\0'; pcVar5 = &cStack_115; do { pathEnd = pcVar5; pcVar5 = pathEnd + 1; } while (pathEnd[1] != '\0'); builtin_strncpy(pathEnd + 1,"options.ini",0xc); cVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath); if (cVar1 == '\0') { KAGE_LogMessage(8,(byte *)"Couldn\'t retrieve previous version of options config\n"); } } } } manager = savedManager; } OptionsConfig::load_config_ini(&manager->_optionsConfig); OptionsConfig::Load(&manager->_optionsConfig,optionsIniPath); piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar4 == 0) || (iVar7 = extraout_ECX, (manager->_optionsConfig)._enableSteamCloud == 0)) { KAGE_LogMessage(1,(byte *) "[warn] SteamCloud is either not available or disabled in Options.ini.\n"); iVar7 = extraout_ECX_00; } validate_language(manager,iVar7); PopupButtons::Init(); ModManager::ListMods(&manager->_modManager); ModManager::LoadShaders(&manager->_modManager); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)0x0,0); RenderTarget::Clear(&DAT_00c798e0); _glfw_context_reset(1); Seeds::InitSeedInfo(); manager->_isConsoleEnabled = (manager->_optionsConfig)._enableDebugConsole; create_render_surfaces(); manager->_previousState = 0; manager->_state = 0; manager->_currentSaveSlot = 0; manager->_framecount = 0; *(undefined2 *)&manager->field_0x4abc4 = 0; manager->_consecutiveResetCount = 0; load_configs(manager); local_230 = operator_new(0x68e88); local_8 = 1; if (local_230 == (Game *)0x0) { g_game = (Game *)0x0; } else { Game::constructor(local_230); g_game = extraout_EAX; } local_8 = 0xffffffff; Game::LoadConfigXmls(); bVar2 = (manager->_optionsConfig)._enableMouseControl; manager->_framecount = 0; manager->_activeControllerIndex = 0; if (bVar2 != 0) { anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x12; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/cursor.anm2",0x13); local_8 = 2; ANM2::Load(&manager->_cursorSprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; pcVar5 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar6) { pcVar5 = *(char **)(anm2Path._buf._0_4_ + -4); uVar6 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar6); } pbVar3 = (manager->_cursorSprite)._animState._animData; if (pbVar3 == (byte *)0x0) { LAB_00952994: bVar2 = ANM2::SetAnimation(&manager->_cursorSprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(manager->_cursorSprite)._animState); (manager->_cursorSprite)._animState._isPlaying = 1; } } else { animNameChar = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { animNameChar = *(byte **)pbVar3; } wantedAnimNameChar = s_Idle; do { bVar2 = *animNameChar; isLess = bVar2 < *wantedAnimNameChar; if (bVar2 != *wantedAnimNameChar) { LAB_00952970: uVar6 = -(uint)isLess | 1; goto LAB_00952975; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; isLess = bVar2 < wantedAnimNameChar[1]; if (bVar2 != wantedAnimNameChar[1]) goto LAB_00952970; animNameChar = animNameChar + 2; wantedAnimNameChar = wantedAnimNameChar + 2; } while (bVar2 != 0); uVar6 = 0; LAB_00952975: if ((uVar6 != 0) || ((pbVar3[0x34] != 0 && ((manager->_cursorSprite)._animState._isPlaying == 0)))) goto LAB_00952994; } manager->_cursorVisibleTimer = 0; } if ((DAT_00c796bc & 1) == 0) { (manager->_optionsConfig)._enableWaterSurface = 0; } manager->_isMenuPending = 0; manager->_starting = 0; (manager->_cutsceneManager).field_0x848 = 0; manager->_isNightmarePending = 0; *(undefined1 *)manager = 0; manager->_isHotkeysEnabled = 1; manager->_isRenderSurfaceResetPending = 0; *(float *)&manager->field_0x4b3cc = g_vectorZero.x; *(float *)&manager->field_0x4b3d0 = g_vectorZero.y; *(undefined2 *)&manager->_isSaveOnExit = 0; input_configs_load(); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; local_230 = (Game *)&manager->_buttonsSprite; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x13; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/Buttons.anm2",0x14); local_8 = 3; ANM2::Load(&manager->_buttonsSprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; pcVar5 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar6) { pcVar5 = *(char **)(anm2Path._buf._0_4_ + -4); uVar6 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar6); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x19; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PlatformIcons.anm2",0x1a); local_8 = 4; ANM2::Load(&manager->_platformIconsSprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; pcVar5 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar6) { pcVar5 = *(char **)(anm2Path._buf._0_4_ + -4); uVar6 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,uVar6); } buttonsSprite = local_230; pbVar3 = ((AnimationState *)((int)local_230 + 0x30))->_animData; if (pbVar3 != (byte *)0x0) { animNameChar = pbVar3; if (0xf < *(uint *)(pbVar3 + 0x14)) { animNameChar = *(byte **)pbVar3; } wantedAnimNameChar = &DAT_00b7b76c; do { bVar2 = *animNameChar; isLess = bVar2 < *wantedAnimNameChar; if (bVar2 != *wantedAnimNameChar) { LAB_00952c05: uVar6 = -(uint)isLess | 1; goto LAB_00952c0a; } if (bVar2 == 0) break; bVar2 = animNameChar[1]; isLess = bVar2 < wantedAnimNameChar[1]; if (bVar2 != wantedAnimNameChar[1]) goto LAB_00952c05; animNameChar = animNameChar + 2; wantedAnimNameChar = wantedAnimNameChar + 2; } while (bVar2 != 0); uVar6 = 0; LAB_00952c0a: if ((uVar6 == 0) && ((pbVar3[0x34] == 0 || (((AnimationState *)((int)local_230 + 0x30))->_isPlaying != 0)))) goto LAB_00952c36; } bVar2 = ANM2::SetAnimation((ANM2 *)local_230,&DAT_00b7b76c,1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)((int)buttonsSprite + 0x30)); ((AnimationState *)((int)buttonsSprite + 0x30))->_isPlaying = 1; } LAB_00952c36: std::list>::push_back(FUN_0095b290,0); uVar6 = 0; while( true ) { (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff); iVar7 = DAT_00c57b24 - _DAT_00c57b20; local_8 = 5; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_8 = 0xffffffff; if ((uint)(iVar7 >> 3) <= uVar6) break; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&device,uVar6); piVar4 = deviceRefCount; local_8 = 6; local_230 = (Game *)device; if (device != (ANM2 *)0x0) { deviceCopy = (ANM2 *)0x0; deviceCopyRefCount = (int *)0x0; if ((deviceRefCount != (int *)0x0) && (cVar1 = (**(code **)(*deviceRefCount + 4))(), cVar1 != '\0')) { if ((deviceCopyRefCount != (int *)0x0) && ((cVar1 = (**(code **)(*deviceCopyRefCount + 0xc))(), cVar1 != '\0' && (g_inputDeviceRelease != (void *)0x0)))) { (*g_inputDeviceRelease)(&deviceCopy); } deviceCopyRefCount = piVar4; deviceCopy = (ANM2 *)local_230; } local_8._0_1_ = 7; KeyConfigs::apply_to_device(*(undefined4 *)((deviceCopy->_filename)._buf + 0xc)); local_8 = CONCAT31(local_8._1_3_,8); if (((deviceCopyRefCount != (int *)0x0) && (cVar1 = (**(code **)(*deviceCopyRefCount + 0xc))(), cVar1 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&deviceCopy); } } local_8 = 9; if (((deviceRefCount != (int *)0x0) && (cVar1 = (**(code **)(*deviceRefCount + 0xc))(), cVar1 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } local_8 = 0xffffffff; uVar6 = uVar6 + 1; } ModManager::LoadModContent(); NetplayManager::Init(); ExceptionList = local_10; return; } //@@ 00952df0 Manager::load_configs /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: itemConfig=Manager (zeroes 0x21628/0x21984 fields); ModManager::TryRedirectPath + load of achievements.xml, babies.xml, entities2.xml (EntityConfig::LoadEntities), items.xml, players.xml ... and the 4 .fnt fonts prototype: db/protos.zhl */ void __thiscall Manager::load_configs(Manager *itemConfig) { byte *extraout_EAX; byte *extraout_EAX_00; undefined4 *extraout_EAX_01; undefined4 *extraout_EAX_02; undefined4 *extraout_EAX_03; undefined4 *extraout_EAX_04; byte *extraout_EAX_05; byte *extraout_EAX_06; byte *extraout_EAX_07; undefined4 *extraout_EAX_08; byte *extraout_EAX_09; byte *extraout_EAX_10; byte *extraout_EAX_11; byte *extraout_EAX_12; undefined4 *extraout_EAX_13; undefined4 *extraout_EAX_14; undefined4 *extraout_EAX_15; undefined4 *extraout_EAX_16; byte *extraout_EAX_17; undefined4 *extraout_EAX_18; undefined4 *pathText; byte *extraout_EAX_19; byte *extraout_EAX_20; byte *extraout_EAX_21; byte *extraout_EAX_22; byte *pathBytes; char *freeChars; void *freeBlock; uint freeSize; ItemConfig *itemConfig; std_string fontPath; std_string redirectedPath; std_string tmpPath; std_string fileName; uint local_24; char **ppcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; ppcStack_20 = (char **)((int)&tmpPath + 0x50); puStack_18 = &LAB_00b0c0c5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&tmpPath + 0x44U; ExceptionList = &local_1c; fileName._capacity = 0xf; fileName._size = 9; builtin_strncpy(fileName._buf,"music.xm",8); fileName._buf[8] = 'l'; fileName._buf[9] = '\0'; local_14 = 0; ModManager::TryRedirectPath(&g_manager->_modManager,&redirectedPath,&fileName); local_14._0_1_ = 1; pathBytes = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { pathBytes = *(byte **)extraout_EAX; } Music::LoadConfig((Music *)&itemConfig->_musicManager,pathBytes,0); local_14 = (uint)local_14._1_3_ << 8; if (0xf < redirectedPath._capacity) { freeSize = redirectedPath._capacity + 1; freeBlock = (void *)redirectedPath._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(redirectedPath._buf._0_4_ + -4); freeSize = redirectedPath._capacity + 0x24; if (0x1f < (uint)(redirectedPath._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_00952f07; } operator_delete(freeBlock,freeSize); } local_14 = -1; redirectedPath._size = 0; redirectedPath._capacity = 0xf; redirectedPath._buf._0_4_ = redirectedPath._buf._0_4_ & 0xffffff00; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_00952f07: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } builtin_strncpy(fileName._buf + 8,"s.xml",6); fileName._capacity = 0xf; fileName._size = 0xd; builtin_strncpy(fileName._buf,"cutscene",8); local_14 = 2; ModManager::TryRedirectPath(&g_manager->_modManager,&tmpPath,&fileName); local_14._0_1_ = 3; pathBytes = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { pathBytes = *(byte **)extraout_EAX_00; } Cutscene::load_xml(&itemConfig->_cutsceneManager,pathBytes); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < tmpPath._capacity) { freeSize = tmpPath._capacity + 1; freeChars = (char *)tmpPath._buf._0_4_; if (0xfff < freeSize) { freeChars = *(char **)(tmpPath._buf._0_4_ + -4); freeSize = tmpPath._capacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._buf._0_4_ + (-4 - (int)freeChars))) goto LAB_00952ff1; } operator_delete(freeChars,freeSize); } local_14 = 0xffffffff; tmpPath._size = 0; tmpPath._capacity = 0xf; tmpPath._buf._0_4_ = tmpPath._buf._0_4_ & 0xffffff00; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_00952ff1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } AchievementOverlay::load_graphics(&itemConfig->_achievementOverlay); manager = g_manager; tmpPath._buf._0_4_ = std::_Allocate(0x20); tmpPath._size = 0x10; tmpPath._capacity = 0x1f; builtin_strncpy((char *)tmpPath._buf._0_4_,"achievements.xml",0x11); local_14 = 4; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&tmpPath); local_14 = CONCAT31(local_14._1_3_,5); pathText = extraout_EAX_01; if (0xf < (uint)extraout_EAX_01[5]) { pathText = (undefined4 *)*extraout_EAX_01; } AchievementOverlay::load_xml(pathText); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < tmpPath._capacity) { freeSize = tmpPath._capacity + 1; freeChars = (char *)tmpPath._buf._0_4_; if (0xfff < freeSize) { freeChars = *(char **)(tmpPath._buf._0_4_ + -4); freeSize = tmpPath._capacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._buf._0_4_ + (-4 - (int)freeChars))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeChars,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"sounds.xml",10); local_14 = 6; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,7); pathText = extraout_EAX_02; if (0xf < (uint)extraout_EAX_02[5]) { pathText = (undefined4 *)*extraout_EAX_02; } SFXManager::load_xml(pathText,0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } *(undefined4 *)&itemConfig->_nightmareScene = 0; *(undefined4 *)&(itemConfig->_nightmareScene).field_0x4 = 0; *(undefined4 *)&(itemConfig->_nightmareScene).field_0x35c = 0; *(undefined4 *)&(itemConfig->_nightmareScene).field_0x360 = 0; FUN_0042f0c0(); *(undefined4 *)&(itemConfig->_nightmareScene).field_0x18 = *(undefined4 *)&(itemConfig->_nightmareScene).field_0x14; itemConfig->field_0x21c10 = 0; (itemConfig->_nightmareScene)._stageBarIcons[0] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[1] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[2] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[3] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[4] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[5] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[6] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[7] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[8] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[9] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[10] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[0xb] = 0x11; (itemConfig->_nightmareScene)._stageBarIcons[0xc] = 0x11; manager = g_manager; (itemConfig->_nightmareScene)._stageBarIcons[0xd] = 0x11; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"nightmares.xml",0xe); local_14 = 8; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,9); pathText = extraout_EAX_03; if (0xf < (uint)extraout_EAX_03[5]) { pathText = (undefined4 *)*extraout_EAX_03; } NightmareScene::load_nightmares_xml(pathText); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; itemConfig = &itemConfig->_itemConfig; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"items.xml",9); local_14 = 10; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0xb); pathText = extraout_EAX_04; if (0xf < (uint)extraout_EAX_04[5]) { pathText = (undefined4 *)*extraout_EAX_04; } ItemConfig::Load(pathText,0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"costumes2.xml",0xd); local_14 = 0xc; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0xd); pathBytes = extraout_EAX_05; if (0xf < *(uint *)(extraout_EAX_05 + 0x14)) { pathBytes = *(byte **)extraout_EAX_05; } ItemConfig::load_costumes_xml(itemConfig,pathBytes,(void *)0x0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"items_metadata.xml",0x12); local_14 = 0xe; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0xf); pathBytes = extraout_EAX_06; if (0xf < *(uint *)(extraout_EAX_06 + 0x14)) { pathBytes = *(byte **)extraout_EAX_06; } ItemConfig::load_metadata_xml(itemConfig,pathBytes,(void *)0x0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"pocketitems.xml",0xf); local_14 = 0x10; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x11); pathBytes = extraout_EAX_07; if (0xf < *(uint *)(extraout_EAX_07 + 0x14)) { pathBytes = *(byte **)extraout_EAX_07; } ItemConfig::load_pocketitems_xml(itemConfig,pathBytes,(void *)0x0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"playerforms.xml",0xf); local_14 = 0x12; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x13); pathText = extraout_EAX_08; if (0xf < (uint)extraout_EAX_08[5]) { pathText = (undefined4 *)*extraout_EAX_08; } playerforms_xml_load(pathText); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"bombcostumes.xml",0x10); local_14 = 0x14; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x15); pathBytes = extraout_EAX_09; if (0xf < *(uint *)(extraout_EAX_09 + 0x14)) { pathBytes = *(byte **)extraout_EAX_09; } ItemConfig::LoadBombCostumes(itemConfig,pathBytes,0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"wisps.xml",9); local_14 = 0x16; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x17); pathBytes = extraout_EAX_10; if (0xf < *(uint *)(extraout_EAX_10 + 0x14)) { pathBytes = *(byte **)extraout_EAX_10; } ItemConfig::load_wisps_xml(itemConfig,pathBytes,(void *)0x0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"locusts.xml",0xb); local_14 = 0x18; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x19); pathBytes = extraout_EAX_11; if (0xf < *(uint *)(extraout_EAX_11 + 0x14)) { pathBytes = *(byte **)extraout_EAX_11; } ItemConfig::LoadLocustConfig(itemConfig,pathBytes,(ModEntry *)0x0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"recipes.xml",0xb); local_14 = 0x1a; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x1b); pathBytes = extraout_EAX_12; if (0xf < *(uint *)(extraout_EAX_12 + 0x14)) { pathBytes = *(byte **)extraout_EAX_12; } ItemConfig::load_recipes_xml(itemConfig,pathBytes,(void *)0x0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } *(undefined4 *)&itemConfig->field_0x2a554 = 0; std::string::assign(&itemConfig->field_0x2a558,(byte *)"Unknown",7); (itemConfig->_infoDisplay)._defaultEntry = 0; InfoDisplay::load_xml("info_display.xml",0); manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"challenges.xml",0xe); local_14 = 0x1c; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x1d); pathText = extraout_EAX_13; if (0xf < (uint)extraout_EAX_13[5]) { pathText = (undefined4 *)*extraout_EAX_13; } challenges_xml_load(pathText,0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"entities2.xml",0xd); local_14 = 0x1e; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x1f); pathText = extraout_EAX_14; if (0xf < (uint)extraout_EAX_14[5]) { pathText = (undefined4 *)*extraout_EAX_14; } EntityConfig::LoadEntities(pathText,0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"bosscolors.xml",0xe); local_14 = 0x20; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x21); pathText = extraout_EAX_15; if (0xf < (uint)extraout_EAX_15[5]) { pathText = (undefined4 *)*extraout_EAX_15; } EntityConfig::load_boss_colors(pathText); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"players.xml",0xb); local_14 = 0x22; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x23); pathText = extraout_EAX_16; if (0xf < (uint)extraout_EAX_16[5]) { pathText = (undefined4 *)*extraout_EAX_16; } EntityConfig::load_players_xml(pathText,0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"babies.xml",10); local_14 = 0x24; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x25); pathBytes = extraout_EAX_17; if (0xf < *(uint *)(extraout_EAX_17 + 0x14)) { pathBytes = *(byte **)extraout_EAX_17; } EntityConfig::LoadBabies(&itemConfig->_entityConfig,pathBytes); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"bossportraits.xml",0x11); local_14 = 0x26; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x27); pathText = extraout_EAX_18; if (0xf < (uint)extraout_EAX_18[5]) { pathText = (undefined4 *)*extraout_EAX_18; } load_bossportraits_xml(pathText); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"font/terminus.fnt",0x11); local_14 = 0x28; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x29); pathBytes = extraout_EAX_19; if (0xf < *(uint *)(extraout_EAX_19 + 0x14)) { pathBytes = *(byte **)extraout_EAX_19; } Font::Load(&itemConfig->_font4_terminus,pathBytes,0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"font/terminus8.fnt",0x12); local_14 = 0x2a; ModManager::TryRedirectPath(&manager->_modManager,&redirectedPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x2b); pathBytes = extraout_EAX_20; if (0xf < *(uint *)(extraout_EAX_20 + 0x14)) { pathBytes = *(byte **)extraout_EAX_20; } Font::Load(&itemConfig->_font5_terminus8,pathBytes,0); std::string::_Tidy_deallocate(redirectedPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"font/PFTempestaSevenCondensed.fnt",0x21); local_14 = 0x2c; ModManager::TryRedirectPath(&manager->_modManager,&tmpPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x2d); pathBytes = extraout_EAX_21; if (0xf < *(uint *)(extraout_EAX_21 + 0x14)) { pathBytes = *(byte **)extraout_EAX_21; } Font::Load(&itemConfig->_font6_PFTempestaSevenCondensed,pathBytes,0); std::string::_Tidy_deallocate(tmpPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } manager = g_manager; fileName._size = 0; fileName._capacity = 0xf; fileName._buf._0_8_ = fileName._buf._0_8_ & 0xffffffff00000000; std::string::assign(fileName._buf,(byte *)"font/LuaMiniOutlined.fnt",0x18); local_14 = 0x2e; ModManager::TryRedirectPath(&manager->_modManager,&fontPath,&fileName); local_14 = CONCAT31(local_14._1_3_,0x2f); pathBytes = extraout_EAX_22; if (0xf < *(uint *)(extraout_EAX_22 + 0x14)) { pathBytes = *(byte **)extraout_EAX_22; } Font::Load(&itemConfig->_font8_LuaMiniOutlined,pathBytes,0); std::string::_Tidy_deallocate(fontPath._buf); local_14 = 0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; freeBlock = (void *)fileName._buf._0_4_; if (0xfff < freeSize) { freeBlock = *(void **)(fileName._buf._0_4_ + -4); freeSize = fileName._capacity + 0x24; if (0x1f < (uint)(fileName._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,freeSize); } load_fonts(itemConfig); *(undefined1 *)itemConfig = 0; *(undefined4 *)&itemConfig->field_0x4 = 3; ExceptionList = local_1c; return; } //@@ 00953f10 Manager::unload_configs /* DB: ? on g_manager: frees the 27 CutsceneEntry clip lists of Cutscene (Manager+0x20dd0), destroys the Theora clip +0x215e0, clears NightmareScene (+0x21628) vectors, resets ANM2 +0x21870/+0x219d0 and the ChallengeParams vector +0x2a664; Menu_Options::Update right after ModManager::LoadShaders on mod reload */ void Manager::unload_configs(void) { int *piVar1; undefined4 extraout_ECX; uint size; Manager *manager; int *clipSlot; char *stringCursor; void *challengeCursor; int *clipList; void *pvVar2; int emptyVector [3]; void *challengeCapacity; Manager *savedManager; int entriesLeft; void *challengeBegin; std_vector *challengeParams; char *stringsEnd; manager = g_manager; savedManager = g_manager; *(undefined4 *)&g_manager->_cutsceneManager = 0; clipList = (int *)&(manager->_cutsceneManager).field_0x70; entriesLeft = 0x1a; do { clipSlot = (int *)clipList[-1]; if (clipSlot != (int *)*clipList) { do { piVar1 = (int *)*clipSlot; if ((piVar1[0xc] != 0) && ((void *)piVar1[9] != (void *)0x0)) { operator_delete((void *)piVar1[9],0x1c); piVar1 = (int *)*clipSlot; } (**(code **)(*piVar1 + 8))(); if ((undefined4 *)*clipSlot != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*clipSlot)(1); } clipSlot = clipSlot + 1; } while (clipSlot != (int *)*clipList); } clipList = clipList + 0x13; entriesLeft = entriesLeft + -1; } while (entriesLeft != 0); TheoraVideoManager::destroyVideoClip(*(void **)&(manager->_cutsceneManager).field_0x810); *(undefined4 *)&(manager->_cutsceneManager).field_0x810 = 0; *(undefined4 *)&(manager->_cutsceneManager).field_0x80c = 0; (manager->_cutsceneManager).field_0x81c = 0; KAGE::SmartPointer::reset(extraout_ECX); *(undefined4 *)&manager->_nightmareScene = 0; *(undefined4 *)&(manager->_nightmareScene).field_0x4 = 0; *(undefined4 *)&(manager->_nightmareScene).field_0x360 = 0; stringsEnd = *(char **)&(manager->_nightmareScene).field_0xc; stringCursor = *(char **)&(manager->_nightmareScene).field_0x8; if (stringCursor != stringsEnd) { do { std::string::_Tidy_deallocate(stringCursor); stringCursor = stringCursor + 0x18; } while (stringCursor != stringsEnd); stringCursor = *(char **)&(manager->_nightmareScene).field_0x8; } *(char **)&(manager->_nightmareScene).field_0xc = stringCursor; *(undefined4 *)&(manager->_nightmareScene).field_0x18 = *(undefined4 *)&(manager->_nightmareScene).field_0x14; (manager->_nightmareScene)._stageBarIcons[0] = 0x11; (manager->_nightmareScene)._stageBarIcons[1] = 0x11; (manager->_nightmareScene)._stageBarIcons[2] = 0x11; (manager->_nightmareScene)._stageBarIcons[3] = 0x11; (manager->_nightmareScene)._stageBarIcons[4] = 0x11; (manager->_nightmareScene)._stageBarIcons[5] = 0x11; (manager->_nightmareScene)._stageBarIcons[6] = 0x11; (manager->_nightmareScene)._stageBarIcons[7] = 0x11; (manager->_nightmareScene)._stageBarIcons[8] = 0x11; (manager->_nightmareScene)._stageBarIcons[9] = 0x11; (manager->_nightmareScene)._stageBarIcons[10] = 0x11; (manager->_nightmareScene)._stageBarIcons[0xb] = 0x11; (manager->_nightmareScene)._stageBarIcons[0xc] = 0x11; (manager->_nightmareScene)._stageBarIcons[0xd] = 0x11; ANM2::Reset((ANM2 *)&(manager->_nightmareScene).field_0x248); ANM2::Reset((ANM2 *)&manager->field_0x219d0); ItemConfig::clear(); ItemConfig::reset(&manager->_itemConfig); challengeParams = &manager->_challengeParams; if ((std_vector *)emptyVector != challengeParams) { challengeBegin = challengeParams->_begin; challengeCapacity = (manager->_challengeParams)._capacity; pvVar2 = (manager->_challengeParams)._end; challengeParams->_begin = (void *)0x0; (manager->_challengeParams)._end = (void *)0x0; (manager->_challengeParams)._capacity = (void *)0x0; if (challengeBegin != (void *)0x0) { challengeCursor = challengeBegin; if (challengeBegin != pvVar2) { do { FUN_004269f0(); challengeCursor = (void *)((int)challengeCursor + 0xa4); } while (challengeCursor != pvVar2); manager = savedManager; } size = (((int)challengeCapacity - (int)challengeBegin) / 0xa4) * 0xa4; pvVar2 = challengeBegin; if (0xfff < size) { pvVar2 = *(void **)((int)challengeBegin + -4); size = size + 0x23; if (0x1f < (uint)((int)challengeBegin + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } } FUN_0069bbf0(); Font::Unload(&manager->_font5_terminus8); Font::Unload(&manager->_font6_PFTempestaSevenCondensed); Font::Unload(&manager->_font7_Upheaval); Font::Unload(&manager->_font8_LuaMiniOutlined); Font::Unload(&manager->_font9_PFTempestaSevenCondensedAgain); load_configs(manager); return; } //@@ 00954150 Manager::update_screen_scale /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: (width, height, isFill): from GraphicsWindow framebuffer size and the current display mode (Manager+0x215d8 x 0x4c records) computes the scale, writes g_displayPixelRatio, g_screenWidth/g_screenHeight, g_screenPointScale and letterbox offsets Manager+0x215f0/+0x215f4, sets Game _triggerWindowResize (+0x26534); callers Manager::ResizeWindowCallback and Manager::update_state_loading */ void Manager::update_screen_scale(int param_1,int param_2,char param_3) { int iVar1; Manager *pMVar2; int iVar3; int iVar4; int iVar5; int iVar6; undefined4 extraout_ECX; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; pMVar2 = g_manager; iVar3 = GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); iVar4 = Window::get_framebuffer_height(&DAT_00c798e0); fVar7 = (float)iVar3 / (float)param_1 + 0.5; FUN_008370b0(); iVar6 = (pMVar2->_cutsceneManager)._currentCutsceneId; iVar5 = (pMVar2->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e0]; g_displayPixelRatio = fVar7; if ((iVar5 < 0) || (iVar1 = (pMVar2->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e9], (pMVar2->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e8] - iVar1 >> 2 <= iVar5)) { iVar5 = 0x1e0; iVar6 = 0x10e; } else { iVar5 = (**(code **)(**(int **)(iVar1 + iVar5 * 4) + 0x24))(); iVar6 = (**(code **)(**(int **)((pMVar2->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e9] + (pMVar2->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e0] * 4) + 0x28))(); } fVar10 = (float)param_2; fVar9 = (float)iVar6 / fVar10; fVar11 = (float)param_1; fVar8 = (float)iVar5 / fVar11; fVar7 = fVar9; if (param_3 == '\0') { if (fVar8 <= fVar9) { fVar7 = fVar8; } } else if (fVar9 <= fVar8) { fVar7 = fVar8; } g_screenHeight = fVar10 * fVar7; g_screenWidth = fVar11 * fVar7; g_screenPointScale = 1.0 / fVar7; _DAT_00bf9420 = g_screenPointScale; g_framebufferWidth = iVar3; DAT_00c79114 = iVar4; DAT_00c7997c = g_screenWidth; DAT_00c79980 = g_screenHeight; *(float *)&(pMVar2->_cutsceneManager).field_0x820 = (fVar7 - fVar8) * fVar11 * 0.5; *(float *)&(pMVar2->_cutsceneManager).field_0x824 = (fVar7 - fVar9) * fVar10 * 0.5; _DAT_00c79994 = iVar3; _DAT_00c79998 = iVar4; DAT_00c799a8 = iVar3; DAT_00c799ac = iVar4; KAGE_Graphics::update_depth_renderbuffer(&DAT_00c798e0,0); if (g_game != (Game *)0x0) { g_game->_triggerWindowResize = 1; } if (g_menuManager != (MenuManager *)0x0) { KAGE::SmartPointer::reset(extraout_ECX); create_menu_colormod_surface(); } pMVar2->_isRenderSurfaceResetPending = 1; return; } //@@ 00954320 Manager::set_viewport_size /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: (width,height): reads the framebuffer size (GraphicsWindow::get_framebuffer_width/height), computes the pixel scale min(w/400, h/240) and stores it in the global screen scale g_displayPixelRatio, logs "Viewport: %dx%d"; Manager::ResizeWindowCallback, Manager::update_state_loading */ void Manager::set_viewport_size(int param_1,int param_2) { Manager *pMVar1; int iVar2; float *pfVar3; float fVar4; float fVar5; double dVar6; double dVar7; float local_4c; Manager *local_48; float local_44; pMVar1 = g_manager; local_48 = g_manager; iVar2 = GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); Window::get_framebuffer_height(&DAT_00c798e0); fVar4 = (float)iVar2 / (float)param_1 + 0.5; FUN_008370b0(); fVar5 = (float)param_2 / 240.0; if ((float)param_1 / 400.0 <= (float)param_2 / 240.0) { fVar5 = (float)param_1 / 400.0; } local_44 = fVar5 + 1e-05; if (5.0 <= local_44) { local_44 = fVar5 - 1e-05; } local_4c = fVar4 * local_44; g_displayPixelRatio = fVar4; dVar6 = floor((double)local_4c); local_4c = 1.0 / fVar4; iVar2 = (pMVar1->_optionsConfig)._maxScale; pfVar3 = &g_screenPointScale; if ((float)dVar6 / fVar4 <= 1.0 / fVar4) { pfVar3 = &local_4c; } fVar5 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]); g_screenPointScale = *pfVar3; if (fVar5 <= g_screenPointScale) { g_screenPointScale = fVar5; } local_4c = (float)param_1 / g_screenPointScale; _DAT_00bf9420 = g_screenPointScale; dVar6 = floor((double)local_4c); local_4c = (float)param_2 / g_screenPointScale; g_screenWidth = (float)dVar6; dVar7 = floor((double)local_4c); g_screenHeight = (float)dVar7; DAT_00c7997c = (float)dVar6; DAT_00c79980 = g_screenHeight; local_4c = g_screenHeight; DAT_00c799a8 = __ftoui3(); DAT_00c799ac = __ftoui3(); KAGE_LogMessage(1,(byte *)"Viewport: %dx%d\n"); iVar2 = (local_48->_optionsConfig)._maxRenderScale; fVar5 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) / g_displayPixelRatio; if (fVar5 <= g_screenPointScale) { g_screenPointScale = fVar5; } local_4c = g_screenPointScale * g_displayPixelRatio; iVar2 = __ftoui3(); g_framebufferWidth = iVar2; DAT_00c79114 = __ftoui3(); _DAT_00c79994 = iVar2; _DAT_00c79998 = DAT_00c79114; KAGE_Graphics::update_depth_renderbuffer(&DAT_00c798e0,0); g_graphicsManager_flags = g_graphicsManager_flags & 0xffffff7f | 0x40; DAT_00c79984 = g_vectorZero.x; DAT_00c79988 = g_vectorZero.y; if (g_game != (Game *)0x0) { g_game->_triggerWindowResize = 1; } if (g_menuManager != (MenuManager *)0x0) { KAGE::SmartPointer::reset(); create_menu_colormod_surface(); } local_48->_isRenderSurfaceResetPending = 1; KAGE_LogMessage(1,(byte *) "Framebuffer Width: %d \n Render Width: %d \n Window Width: %d \n Multiplier: %f \n DP per point: %f \n Point Scale: %f \n" ); return; } //@@ 00954690 pause_screen_unload_sprites /* DB: ? no ECX: when g_game, ANM2::Reset on Game+0x23aa0..+0x246c4 (inside PauseScreen at Game+0x23a74) and clears +0x24020; Menu_Options::Update when mods changed (in_ECX[0x96]), next to MenuManager reload FUN_00988ba0 */ void pause_screen_unload_sprites(void) { Game *pGVar1; pGVar1 = g_game; if (g_game != (Game *)0x0) { ANM2::Reset((ANM2 *)&(g_game->_pauseScreen).field_0x2c); ANM2::Reset((ANM2 *)&(pGVar1->_pauseScreen).field_0x140); ANM2::Reset((ANM2 *)&(pGVar1->_pauseScreen).field_0x254); ANM2::Reset((ANM2 *)&(pGVar1->_pauseScreen).field_0x368); ANM2::Reset(&(pGVar1->_pauseScreen)._genericPrompt._sprite); (pGVar1->_pauseScreen)._genericPrompt._isOnlineVote = 0; KAGE::SmartPointer::reset(&(pGVar1->_pauseScreen).field_0xe88,(void *)0x0); ANM2::Reset((ANM2 *)&(pGVar1->_pauseScreen).field_0x5d4); ANM2::Reset((ANM2 *)&(pGVar1->_pauseScreen).field_0xc50); } return; } //@@ 00954710 FUN_00954710 void FUN_00954710(void) { Manager *this; this = g_manager; if (g_game != (Game *)0x0) { PauseScreen::load_graphics(); } PopupButtons::load_graphics(); Manager::load_fonts(this); AchievementOverlay::load_graphics(&this->_achievementOverlay); return; } //@@ 00954760 Manager::validate_language /* DB: ? thiscall Manager: if the language id at +0x4a920 is not in the available set (+0x4a924 head) resets it to 0, same for +0x4a938/+0x4a93c, then FUN_009abbd0; callers OptionsConfig::Load, Manager::Init, Menu_Options::Update (Manager+0x4a920 is the language passed to StringTable::get_string) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Manager::validate_language(Manager *this,int unused) { undefined1 local_14 [8]; int local_c; undefined4 local_8; local_8 = 0; std::set::find_node(local_14,&local_8); if (((*(char *)(local_c + 0xd) == '\0') && (*(int *)(local_c + 0x10) < 1)) && (local_c != *(int *)&(this->_stringTable).field_0x4)) { *(undefined4 *)&this->_stringTable = 0; } local_8 = 0; std::set::find_node(local_14,&local_8); if (((*(char *)(local_c + 0xd) == '\0') && (*(int *)(local_c + 0x10) < 1)) && (local_c != *(int *)&(this->_stringTablePc).field_0x4)) { *(undefined4 *)&this->_stringTablePc = 0; } reload_resource_paths(); return; } //@@ 009547f0 Manager::GetLanguage /* ZHL [exact] static char* Manager::GetLanguage(); prototype: REPENTOGON */ byte * __cdecl Manager::GetLanguage(void) { switch(*(undefined4 *)&g_manager->_stringTable) { case 0: case 1: return &DAT_00b9fbd0; case 2: return &DAT_00b9fbdc; case 3: return &DAT_00b9fbe0; case 4: return &DAT_00b9fbd4; case 5: return &DAT_00b9fbd8; case 6: return &DAT_00b9fbb8; case 7: return &DAT_00b9fbbc; case 8: case 9: return &DAT_00b9fbb0; case 10: return &DAT_00b9fbb4; case 0xb: return &DAT_00b9fbc8; case 0xc: case 0xd: return &DAT_00b9fbcc; case 0xe: return &DAT_00b9fbc0; case 0xf: return &DAT_00b6d518; case 0x10: return &DAT_00b9fbc4; case 0x11: return &DAT_00b9fbec; case 0x12: return &DAT_00b9fbf0; case 0x13: return &DAT_00b9fbe4; default: return &DAT_00b9fbe8; } } //@@ 009548d0 Manager::update_hotkeys /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=Manager (from Manager::Update): action 0x11 toggles +0x2a2e4 (mute: saves volume +0x2a354), syncs OptionsConfig::set_fullscreen with the window style and toggles it on action 0x10, plus a key combo (0x156+0x123 on stats menu 9) that re-reads Steam achievements 1..0x281 */ void Manager::update_hotkeys(void) { byte bVar1; char cVar2; HWND hWnd; LONG windowStyle; int *steamContext; undefined4 *statsContext; void *in_ECX; int extraout_ECX; int iVar3; uint newMax; uint uVar4; int nIndex; undefined4 local_40; char isAchieved; int achievementIds [4]; byte local_28 [32]; undefined4 local_8; Manager *manager; local_8 = __security_cookie ^ (uint)(local_28 + 0x24); if (*(char *)((int)in_ECX + 0x4abc7) == '\0') goto LAB_009549c7; bVar1 = input_is_action_triggered(in_ECX,0x11,-1,(Entity *)0x0,0); manager = g_manager; iVar3 = extraout_ECX; if (bVar1 != 0) { if (*(char *)((int)in_ECX + 0x2a2e4) == '\0') { *(undefined1 *)((int)in_ECX + 0x2a2e4) = 1; *(float *)(*(int *)((int)in_ECX + 0x29fbc) * 0x184 + 0x2a134 + (int)in_ECX) = (manager->_optionsConfig)._musicVolume; iVar3 = *(int *)((int)in_ECX + 0x29fbc) * 0x184; *(float *)(iVar3 + 0x2a138 + (int)in_ECX) = (manager->_optionsConfig)._musicVolume; } else { *(undefined1 *)((int)in_ECX + 0x2a2e4) = 0; } } if ((g_graphicsManager_flags & 0x100) == 0) { nIndex = -0x10; hWnd = (HWND)FUN_00a5f090(iVar3); windowStyle = GetWindowLongA(hWnd,nIndex); if (windowStyle < 0) goto LAB_0095497c; bVar1 = 0; } else { LAB_0095497c: bVar1 = 1; } local_40 = CONCAT31(local_40._1_3_,bVar1); if (bVar1 != *(byte *)((int)in_ECX + 0x2a360)) { OptionsConfig::set_fullscreen((OptionsConfig *)((int)in_ECX + 0x2a33c),bVar1); } bVar1 = input_is_action_triggered(g_manager,0x10,-1,(Entity *)0x0,0); if (bVar1 != 0) { OptionsConfig::set_fullscreen ((OptionsConfig *)((int)in_ECX + 0x2a33c),*(char *)((int)in_ECX + 0x2a360) == '\0'); } LAB_009549c7: local_40 = 0x156; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_40,0,0); if (cVar2 != '\0') { local_40 = 0x123; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_40,0,0); if (((cVar2 != '\0') && (*(int *)((int)in_ECX + 8) == 1)) && (g_menuManager->_selectedMenuID == 9)) { steamContext = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*steamContext != 0) { uVar4 = 1; do { sprintf_s(local_28,0x20,s__d); statsContext = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); cVar2 = (**(code **)(*(int *)*statsContext + 0x14))(local_28,&isAchieved); if ((cVar2 != '\0') && (isAchieved != '\0')) { *(undefined1 *)((int)in_ECX + uVar4 + 0x4c) = 1; } uVar4 = uVar4 + 1; } while (uVar4 < 0x282); achievementIds[0] = 0; achievementIds[1] = 0x51; achievementIds[2] = 0x96; achievementIds[3] = 8; uVar4 = 1; local_28[0] = 0x8b; local_28[1] = 0; local_28[2] = 0; local_28[3] = 0; local_28[4] = 0x21; local_28[5] = 0; local_28[6] = 0; local_28[7] = 0; local_28[8] = 0x8c; local_28[9] = 0; local_28[10] = 0; local_28[0xb] = 0; local_28[0xc] = 0x8d; local_28[0xd] = 0; local_28[0xe] = 0; local_28[0xf] = 0; local_28[0x10] = 10; local_28[0x11] = 0; local_28[0x12] = 0; local_28[0x13] = 0; local_28[0x14] = 0xb; local_28[0x15] = 0; local_28[0x16] = 0; local_28[0x17] = 0; local_28[0x18] = 0x20; local_28[0x19] = 0; local_28[0x1a] = 0; local_28[0x1b] = 0; local_28[0x1c] = 0x22; local_28[0x1d] = 0; local_28[0x1e] = 0; local_28[0x1f] = 0; do { if (*(char *)(achievementIds[uVar4] + 0x4c + (int)in_ECX) != '\0') { newMax = uVar4; if (uVar4 < *(uint *)((int)in_ECX + 0x2d4)) { newMax = *(uint *)((int)in_ECX + 0x2d4); } *(uint *)((int)in_ECX + 0x2d4) = newMax; } uVar4 = uVar4 + 1; } while (uVar4 < 0xb); } BackupSaveFile((Manager *)((int)in_ECX + 0x14)); cVar2 = FUN_00956750(); if (cVar2 != '\0') { PersistentGameData::SaveToSteamCloud((PersistentGameData *)((int)in_ECX + 0x14)); return; } PersistentGameData::Save((PersistentGameData *)((int)in_ECX + 0x14)); } } return; } //@@ 00954b40 input_poll_active_device /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: loops all input devices (FUN_00a20240), first with any pressed action (vtable +0x3c != -1) becomes Manager+0x4abd4 and, in mode 2, Entity_Player::SetControllerIndex on player 0 and g_menuControllerIndex; returns 1 when found; Manager::update_ingame_input, Menu_Character::handle_input prototype: db/protos.zhl */ byte __cdecl input_poll_active_device(void) { Game *pGVar1; Manager *pMVar2; char cVar3; uint uVar4; undefined4 *puVar5; int iVar6; uint index; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar2 = g_manager; puStack_c = &LAB_00b0c0fd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; index = 0; do { local_8 = 0xffffffff; (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff,uVar4); iVar6 = DAT_00c57b24 - _DAT_00c57b20; local_8 = 0; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_8 = 0xffffffff; if ((uint)(iVar6 >> 3) <= index) { ExceptionList = local_10; return 0; } KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&local_18,index); local_8 = 1; if (local_18 == (int *)0x0) { local_8 = 2; } else { iVar6 = (**(code **)(*local_18 + 0x3c))(0); if (iVar6 != -1) { g_manager->_activeControllerIndex = local_18[3]; pGVar1 = g_game; if (pMVar2->_state == 2) { puVar5 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)puVar5 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); puVar5 = (pGVar1->_playerManager)._playerList._begin; } Entity_Player::SetControllerIndex((Entity_Player *)*puVar5,local_18[3],1); g_menuControllerIndex = local_18[3]; } local_8 = 3; if (local_14 != (int *)0x0) { cVar3 = (**(code **)(*local_14 + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_18); } } ExceptionList = local_10; return 1; } local_8 = 4; } if (local_14 != (int *)0x0) { cVar3 = (**(code **)(*local_14 + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_18); } } index = index + 1; } while( true ); } //@@ 00954cd0 Manager::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: main loop */ void Manager::Update(char param_1) { float fVar1; void *pvVar2; float fVar3; char cVar4; byte bVar5; uint uVar6; int iVar7; Camera **ppCVar8; int iVar9; int extraout_ECX; CoopJoinSlot *coopSlot; MenuManager *this; Camera **ppCVar10; char *anim; float *buttonSlide; bool isShortOfTarget; Camera *pCVar11; float fVar12; float fVar13; undefined1 auStack_488 [4]; Camera *local_484; PopupButtons *local_480; Manager *local_47c; Camera *local_478; Camera *local_474; double cursorY; double cursorX; float local_460; float fStack_45c; float fStack_458; float fStack_454; KColor fadeColor; undefined1 local_420 [8]; byte screenshotDir [1028]; uint stackCookie; int *cutsceneFadeColor; Game *game; Manager *manager; manager = g_manager; stackCookie = __security_cookie ^ (uint)auStack_488; local_47c = g_manager; uVar6 = g_manager->_framecount & 0x80000001; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xfffffffe) + 1; } if ((uVar6 == 1) && ((g_manager->_optionsConfig)._enableInterpolation == 0)) { if ((g_manager->field_0x4abc4 == '\0') || (g_manager->field_0x4abc5 != '\0')) { g_manager->_framecount = g_manager->_framecount + 1; return; } return; } if (*(char *)g_manager != '\0') { g_manager->_state = 4; *(undefined1 *)manager = 0; } start_pending_game(); start_pending_menu(manager); if ((manager->_cutsceneManager).field_0x848 == '\0') { iVar7 = manager->_state; } else { if ((manager->_cutsceneManager)._isQueuedCleanup != 0) { manager->_isSaveOnExit = 0; unload_state(manager); } Cutscene::Show(&manager->_cutsceneManager,(manager->_cutsceneManager)._queuedCutsceneId); manager->_previousState = manager->_state; iVar7 = 3; manager->_state = 3; (manager->_cutsceneManager).field_0x848 = 0; } if (manager->_isNightmarePending == 0) { if (iVar7 == 3) { iVar9 = *(int *)&manager->_cutsceneManager; goto joined_r0x00954dfc; } if (iVar7 == 5) goto LAB_00954e0c; } else { NightmareScene::Show(&manager->_nightmareScene,manager->field_0x4b2a5); manager->_previousState = manager->_state; iVar7 = 5; manager->_state = 5; manager->_isNightmarePending = 0; LAB_00954e0c: iVar9 = *(int *)&manager->_nightmareScene; joined_r0x00954dfc: if (iVar9 == 0) { (manager->_achievementOverlay)._isPopupBlocked = 0; if ((iVar7 == 3) && ((manager->_cutsceneManager)._isQueuedCleanup != 0)) { manager->_state = manager->_previousState; iVar7 = (manager->_cutsceneManager)._currentCutsceneId; cutsceneFadeColor = (manager->_nightmareScene)._stageBarIcons + iVar7 * 0x13 + -0x2e5; fVar12 = (float)*cutsceneFadeColor; fVar13 = (float)cutsceneFadeColor[1]; fVar1 = (float)cutsceneFadeColor[2]; fVar3 = (float)cutsceneFadeColor[3]; iVar7 = (manager->_nightmareScene)._stageBarIcons[iVar7 * 0x13 + -0x2e1]; manager->_pendingMenuState = manager->_cutsceneNextMenuState; (manager->_pendingMenuFadeColor)._red = fVar12; (manager->_pendingMenuFadeColor)._green = fVar13; (manager->_pendingMenuFadeColor)._blue = fVar1; (manager->_pendingMenuFadeColor)._alpha = fVar3; (manager->_pendingMenuFadeColor)._unk = iVar7; manager->_isMenuPending = 1; start_pending_menu(manager); } else { bVar5 = manager[1]._persistentGameData._achievements[0]; iVar7 = manager->_previousState; manager->_state = iVar7; if (bVar5 != 0) { input_poll_active_device(); KColor::SetFromARGB(&fadeColor,0xff000000); game = g_game; local_460 = fadeColor._red; fStack_454 = (g_game->_fadeOutColor)._alpha; fStack_45c = fadeColor._green; fStack_458 = fadeColor._blue; g_game->_fadeSpeed = 1.0; game->_fadeOutTarget = 8; (game->_fadeOutColor)._red = fadeColor._red; (game->_fadeOutColor)._green = fadeColor._green; (game->_fadeOutColor)._blue = fadeColor._blue; (game->_fadeOutColor)._alpha = fStack_454; (game->_fadeOutColor)._unk = 0; (game->_fadeOutColor)._alpha = (game->_fadeOutColor)._alpha + 1.0; iVar7 = manager->_state; } if (iVar7 == 1) { KAGE_LogMessage(1,(byte *)"Cutscene End\n"); MusicManager::Crossfade(&g_manager->_musicManager,0x3f,0.08); } } manager[1]._persistentGameData._achievements[0] = 0; } } if (param_1 != '\0') { if (_glfw == 0) { _glfwInputError(0x10001,0); } else { (*DAT_00c7378c)(); } Gamepad_processEvents(); KAGE::Input::Manager::update_devices(); } update_controller_popups(manager); PopupQueue::Update(); local_480 = &manager->_popupButtons; FUN_00424220(); uVar6 = 0; fVar12 = 6.0; buttonSlide = &local_480->_buttons[0]._slideOffset; do { local_484 = (Camera *)buttonSlide[1]; fVar13 = *buttonSlide; if (fVar13 <= (float)local_484) { pCVar11 = (Camera *)(fVar13 + fVar12); ppCVar10 = &local_474; local_474 = pCVar11; isShortOfTarget = (float)pCVar11 < (float)local_484; } else { pCVar11 = (Camera *)(fVar13 - fVar12); ppCVar10 = &local_478; local_478 = pCVar11; isShortOfTarget = (float)local_484 < (float)pCVar11; } ppCVar8 = &local_484; if (isShortOfTarget || (float)local_484 == (float)pCVar11) { ppCVar8 = ppCVar10; } *buttonSlide = (float)*ppCVar8; if (buttonSlide[4] != 4.48416e-44) { FUN_00424130(local_420,uVar6); } manager = local_47c; uVar6 = uVar6 + 1; buttonSlide = buttonSlide + 0x4c; } while (uVar6 < 2); local_47c->field_0x4abc5 = 0; if ((*(int *)&local_47c[1]._gamestate.field_0x290 == 0) && (*(int *)&local_47c[1]._gamestate.field_0x2d8 < 1)) { update_hotkeys(); local_47c = (Manager *)0x12a; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_47c,0,0); if (cVar4 != '\0') { sprintf(screenshotDir,(byte *)"%sscreenshots"); CreateDirectoryA((LPCSTR)screenshotDir,(LPSECURITY_ATTRIBUTES)0x0); save_screenshot(); } } cVar4 = NetplayManager::Update(); if ((cVar4 == '\0') && (((manager->_state == 2 || (manager->_state == 5)) && (g_game != (Game *)0x0)))) { Console::Update(&g_game->_console); Console::update_state(); cVar4 = FUN_006f9730(); if (cVar4 == '\0') { return; } PauseScreen::Update((PauseScreen *)(extraout_ECX + 0x23a74)); netplay_lobby_menu_update(); return; } if ((manager->field_0x4abc4 != '\0') && (manager->field_0x4abc5 == '\0')) { return; } iVar7 = (manager->_achievementOverlay)._state; if (iVar7 != 0) { if ((manager->_achievementOverlay)._isPopupBlocked == 0) { AchievementOverlay::Update(&manager->_achievementOverlay); iVar7 = (manager->_achievementOverlay)._state; } if (((iVar7 != 0) && ((manager->_achievementOverlay)._isPopupBlocked == 0)) && (((manager->_optionsConfig)._popupsMode == 1 && (manager->_netplayManager == *(NetplayManager *)(manager + 1))))) goto switchD_0095519c_caseD_4; } switch(manager->_state) { case 1: cVar4 = FUN_009c3990(); if (((g_menuManager->_selectedMenuID == 0x11) || (cVar4 == '\0')) && (cVar4 = FUN_009505e0(), cVar4 == '\0')) { MenuManager::Update(this); } break; case 2: cVar4 = FUN_009c3990(); if ((cVar4 == '\0') && (cVar4 = FUN_009505e0(), cVar4 == '\0')) { update_ingame_input(); } if (manager->_starting != 0) break; if ((manager->_framecount & 1) == 0) { uVar6 = 0; pvVar2 = g_game->_room; if (*(int *)((int)pvVar2 + 0x1264) != 0) { do { iVar7 = *(int *)(*(int *)((int)pvVar2 + 0x125c) + uVar6 * 4); if (*(char *)(iVar7 + 0x175) != '\0') { *(undefined4 *)(iVar7 + 0x33c) = *(undefined4 *)(iVar7 + 0x344); *(undefined4 *)(iVar7 + 0x340) = *(undefined4 *)(iVar7 + 0x348); *(undefined1 *)(iVar7 + 0x175) = 0; } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar2 + 0x1264)); } Game::Update(g_game); } else if ((manager->_optionsConfig)._enableInterpolation != 0) { Game::interpolate_update(); } game = g_game; local_484 = *(Camera **)((int)g_game->_room + 0x11f8); local_480 = (PopupButtons *)(CONCAT31(local_480._1_3_,(char)manager->_framecount) & 0xffffff01); bVar5 = Game::IsPaused(g_game); pCVar11 = local_484; if ((bVar5 == 0) || ((*(int *)&game->_roomTransition != 0 && ((game->_roomTransition)._animation == 0x13)))) { iVar7 = (g_manager->_optionsConfig)._cameraStyle; if ((iVar7 == 1) || (iVar7 != 2)) { Camera::update_focus_position(local_484,(byte)local_480); } else { Camera::update_follow(local_484); if ((char)local_480 == '\0') goto LAB_009552c4; } pCVar11->_shouldOverride = 0; } LAB_009552c4: game = g_game; iVar7 = 4; coopSlot = (g_game->_playerManager)._coopSlots; do { if (-1 < coopSlot->_controllerIndex) { iVar9 = (int)(game->_playerManager)._coopPlayerTypes._end - (int)(game->_playerManager)._coopPlayerTypes._begin; fVar13 = (float)((double)(iVar9 >> 2) + __uint_to_double_fixup[-(iVar9 >> 0x1f)]); for (fVar12 = (float)coopSlot->_state - coopSlot->_menuPosition; fVar13 * 0.5 <= fVar12; fVar12 = fVar12 - fVar13) { } for (; fVar12 < -fVar13 * 0.5; fVar12 = fVar12 + fVar13) { } if (0.25 <= ABS(fVar12)) { if (fVar12 <= 0.0) { fVar12 = -0.25; } else { fVar12 = 0.25; } coopSlot->_menuPosition = fVar12 + coopSlot->_menuPosition; } else { coopSlot->_menuPosition = (float)coopSlot->_state; } } coopSlot = coopSlot + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); break; case 3: update_state_loading(); break; case 5: NightmareScene::Update(); } switchD_0095519c_caseD_4: if ((g_game != (Game *)0x0) && (bVar5 = Game::IsPaused(g_game), bVar5 == 0)) { fVar12 = (manager->_sfxManager)._volumeModifier; fVar13 = 1.0; if ((fVar12 != 1.0) && (fVar1 = (manager->_sfxManager)._volumeModifierStep, fVar1 != 0.0)) { if (fVar1 < ABS(fVar12 - 1.0)) { if (1.0 <= fVar12) { fVar13 = fVar12 - fVar1; } else { fVar13 = fVar12 + fVar1; } } (manager->_sfxManager)._volumeModifier = fVar13; SoundEffects::ClearVolumeModifier(&manager->_sfxManager); } } Music::Update(); if ((manager->_optionsConfig)._enableMouseControl != 0) { iVar7 = glfwGetMouseButton(); anim = "Clicked"; if (iVar7 == 0) { anim = (char *)s_Idle; } ANM2::Play(&manager->_cursorSprite,(byte *)anim,0); pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x310); } cursorX = 0.0; cursorY = 0.0; if (_glfw == 0) { _glfwInputError(0x10001,0); } else if (*(int *)((int)pvVar2 + 0x70) == 0x34003) { cursorX = *(double *)((int)pvVar2 + 0x1e0); cursorY = *(double *)((int)pvVar2 + 0x1e8); } else { (*DAT_00c736a0)(pvVar2,&cursorX,&cursorY); } if (((float)cursorX == (manager->_lastMousePosition).x) && ((float)cursorY == (manager->_lastMousePosition).y)) { if (0 < manager->_cursorVisibleTimer) { manager->_cursorVisibleTimer = manager->_cursorVisibleTimer + -1; } } else { manager->_cursorVisibleTimer = 300; } (manager->_lastMousePosition).x = (float)cursorX; (manager->_lastMousePosition).y = (float)cursorY; } manager->_framecount = manager->_framecount + 1; return; } //@@ 009555c0 Manager::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? sits right after Manager::Update (FUN_00954cd0, 2223 bytes); renders Game::Render then menu render dispatcher FUN_0098a040 into targets with Exposure/Gamma/ScreenSizePow2 shader uniforms, Font::DrawString; caller FUN_008fb120 (main loop, "Updating mod") prototype: REPENTOGON */ void __thiscall Manager::Render(Manager *this) { uint uVar1; HWND hWnd; LONG windowStyle; int *piVar2; undefined4 *renderTargetEntry; int iVar3; void *colorQuad; undefined4 extraout_EAX; LayerState *overlayLayer; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; int unused; int unused_00; MenuManager *extraout_ECX_03; MenuManager *extraout_ECX_04; MenuManager *extraout_ECX_05; MenuManager *extraout_ECX_06; MenuManager *extraout_ECX_07; MenuManager *this_00; MenuManager *extraout_ECX_08; KColor *color; int extraout_ECX_09; AnimationState *secondAnimState; int unused_01; int unused_02; int extraout_ECX_10; int unused_03; int unused_04; KColor *color_00; int extraout_ECX_11; KColor *color_01; int extraout_ECX_12; KColor *color_02; undefined *puVar4; undefined1 *puVar5; float cursorScaleX; int iVar6; undefined1 cutsceneQuadBuffer [112]; undefined1 upscaleQuadBuffer [112]; undefined1 quadBuffer [112]; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined1 local_70; int windowSize; int *local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; uint local_44; float local_40; char isFramebufferResized; char isFilterEnabled; undefined1 local_38 [12]; Vector scratchVec; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ANM2 *achievementSprite; Manager *manager; manager = g_manager; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b0c12d; local_1c = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_38 + 0x28); if (((g_manager->_framecount & 1) == 0) && ((g_manager->_optionsConfig)._enableInterpolation == 0) ) { return; } ExceptionList = &local_1c; local_24 = uVar1; puVar5 = local_38 + 0x34; if (g_manager->_isRenderSurfaceResetPending != 0) { KAGE::SmartPointer::reset(this); KAGE::SmartPointer::reset(extraout_ECX); KAGE::SmartPointer::reset(extraout_ECX_00); KAGE::SmartPointer::reset(extraout_ECX_01); create_render_surfaces(uVar1); if ((g_graphicsManager_flags & 0x100) == 0) { iVar6 = -0x10; hWnd = (HWND)FUN_00a5f090(extraout_ECX_02); windowStyle = GetWindowLongA(hWnd,iVar6); if (-1 < windowStyle) { piVar2 = glfw_get_window_size((int *)&scratchVec,unused); (manager->_optionsConfig)._windowWidth = *piVar2; piVar2 = glfw_get_window_size((int *)&scratchVec,unused_00); (manager->_optionsConfig)._windowHeight = piVar2[1]; } } manager->_isRenderSurfaceResetPending = 0; puVar5 = puStack_20; } puStack_20 = puVar5; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)0x0,0); this_00 = extraout_ECX_03; if (manager->_state != 3) { iVar6 = GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); this_00 = extraout_ECX_04; if (iVar6 != g_framebufferWidth) { isFramebufferResized = '\x01'; scratchVec.x = 0.0; scratchVec.y = 0.0; std::vector::resize(&scratchVec); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c798a0,1); this_00 = extraout_ECX_05; goto LAB_00955727; } } isFramebufferResized = '\0'; LAB_00955727: if ((((manager->_optionsConfig)._enableFilter == 0) || ((manager->_optionsConfig)._filterEnabled == 0)) || (((*(int *)&manager->_cutsceneManager == 1 && (iVar6 = *(int *)&(manager->_cutsceneManager).field_0x810, iVar6 != 0)) && ((*(char *)(iVar6 + 0x74) == '\0' || ((iVar3 = FUN_00aaa450(), iVar3 != 0 && (this_00 = extraout_ECX_06, *(float *)(iVar3 + 4) < *(float *)(iVar6 + 0x58))))))))) { isFilterEnabled = '\0'; } else { isFilterEnabled = '\x01'; scratchVec.x = 0.0; scratchVec.y = 0.0; std::vector::resize(&scratchVec); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c79890,1); this_00 = extraout_ECX_07; } if ((g_manager->_optionsConfig)._enableColorCorrection != 0) { FUN_00683680(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c798a8,1); this_00 = extraout_ECX_08; } if (manager->field_0x4a6d8 == '\0') { switch(manager->_state) { case 1: MenuManager::Render(this_00); break; case 2: Game::Render(g_game); break; case 3: RenderTarget::Clear(&DAT_00c798e0); iVar6 = (manager->_cutsceneManager)._currentCutsceneId; colorQuad = render_quad_set_uniform_color (quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight, (KColor *) ((manager->_nightmareScene)._stageBarIcons + iVar6 * 0x13 + -0x2e5)); render_color_shader_pass(colorQuad); iVar3 = (manager->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e0]; piVar2 = (manager->_nightmareScene)._stageBarIcons + iVar6 * 0x13 + -0x2e9; if ((iVar3 < 0) || (local_68 = piVar2 + 1, *local_68 - *piVar2 >> 2 <= iVar3)) { local_40 = (float)*piVar2; local_68 = piVar2 + 1; scratchVec.y = (float)piVar2; if (local_40 != (float)*local_68) { (**(code **)(**(int **)((int)local_40 + -4 + (*local_68 - (int)local_40 >> 2) * 4) + 0x14) )(&(manager->_cutsceneManager).field_0x820); piVar2 = (int *)scratchVec.y; } } else { (**(code **)(**(int **)(*piVar2 + iVar3 * 4) + 0x14)) (&(manager->_cutsceneManager).field_0x820); piVar2 = (manager->_nightmareScene)._stageBarIcons + iVar6 * 0x13 + -0x2e9; } if ((((char)(manager->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e6] != '\0') && (((char)(manager->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2de] != '\0' || (*local_68 - *piVar2 >> 2 <= (manager->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e0])))) || (*(char *)((int)(manager->_nightmareScene)._stageBarIcons + iVar6 * 0x4c + -0xb97) != '\0') ) { (manager->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2e2] = (manager->_nightmareScene)._stageBarIcons[iVar6 * 0x13 + -0x2df]; g_graphicsManager_blendMode[1] = 1; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; colorQuad = render_quad_set_uniform_color (cutsceneQuadBuffer,0.0,0.0,g_screenWidth,g_screenHeight, (KColor *) ((manager->_nightmareScene)._stageBarIcons + iVar6 * 0x13 + -0x2e5)); render_color_shader_pass(colorQuad); } break; case 5: NightmareScene::Render(&manager->_nightmareScene); } if (((manager->_achievementOverlay)._state != 0) && ((manager->_achievementOverlay)._isPopupBlocked == 0)) { scratchVec.y = g_screenHeight * 0.5; scratchVec.x = g_screenWidth * 0.5; if (((g_manager->_optionsConfig)._popupsMode == 2) || (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) { achievementSprite = &(manager->_achievementOverlay)._sprite; scratchVec.y = g_screenHeight * 0.5 * 1.75; scratchVec.x = g_screenWidth * 0.5 * 0.25; overlayLayer = ANM2::GetLayer(achievementSprite,(byte *)0x3); overlayLayer->_minFilterMode = 1; overlayLayer = ANM2::GetLayer(achievementSprite,(byte *)0x3); overlayLayer->_magFilterMode = 1; } else { achievementSprite = &(manager->_achievementOverlay)._sprite; overlayLayer = ANM2::GetLayer(achievementSprite,(byte *)0x3); overlayLayer->_minFilterMode = 0; overlayLayer = ANM2::GetLayer(achievementSprite,(byte *)0x3); overlayLayer->_magFilterMode = 0; } if ((manager->_achievementOverlay)._sprite._loaded != 0) { if ((manager->_achievementOverlay)._sprite._overlayRenderFirst == 0) { AnimationState::Render (&(manager->_achievementOverlay)._sprite._animState,&scratchVec,&g_vectorZero, &g_vectorZero); secondAnimState = &(manager->_achievementOverlay)._sprite._overlayAnimState; } else { AnimationState::Render (&(manager->_achievementOverlay)._sprite._overlayAnimState,&scratchVec, &g_vectorZero,&g_vectorZero); secondAnimState = &(manager->_achievementOverlay)._sprite._animState; } AnimationState::Render(secondAnimState,&scratchVec,&g_vectorZero,&g_vectorZero); } } NetplayManager::Render(); FUN_009c3890(3); PopupButtons::Render(); iVar6 = unused_01; if (((manager->_optionsConfig)._enableMouseControl != 0) && (((manager->_state == 2 || (manager->_state == 1)) && (0 < manager->_cursorVisibleTimer)))) { local_40 = DAT_00c79980; piVar2 = glfw_get_window_size((int *)&scratchVec,unused_01); iVar6 = piVar2[1]; scratchVec.y = DAT_00c7997c; piVar2 = glfw_get_window_size(&windowSize,unused_02); cursorScaleX = scratchVec.y / (float)((double)*piVar2 + __uint_to_double_fixup[-(*piVar2 >> 0x1f)]); scratchVec.y = (local_40 / (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)])) * (manager->_lastMousePosition).y; scratchVec.x = cursorScaleX * (manager->_lastMousePosition).x; ANM2::Render(&manager->_cursorSprite,&scratchVec,&g_vectorZero,&g_vectorZero); iVar6 = extraout_ECX_10; } } else { RenderTarget::Clear(&DAT_00c798e0); 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; KColor::SetFromARGB((KColor *)local_38,0xff000000); colorQuad = render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color) ; render_color_shader_pass(colorQuad); scratchVec.y = (g_screenHeight - 270.0) * 0.5; scratchVec.x = (g_screenWidth - 480.0) * 0.5; if (manager->field_0x4a7fd != '\0') { if (manager->field_0x4a764 == '\0') { AnimationState::Render ((AnimationState *)&manager->field_0x4a724,&scratchVec,&g_vectorZero,&g_vectorZero ); secondAnimState = (AnimationState *)&manager->field_0x4a744; } else { AnimationState::Render ((AnimationState *)&manager->field_0x4a744,&scratchVec,&g_vectorZero,&g_vectorZero ); secondAnimState = (AnimationState *)&manager->field_0x4a724; } AnimationState::Render(secondAnimState,&scratchVec,&g_vectorZero,&g_vectorZero); } local_5c = 1; local_58 = 0xffff; local_54 = 0; local_50 = 0x3f800000; local_4c = 0xffffffff; local_48 = 0; local_44 = 0; local_14 = 0; KColor::SetFromARGB((KColor *)local_38,0xffffffff); puVar5 = &manager->field_0x4a6dc; if (0xf < *(uint *)&manager->field_0x4a6f0) { puVar5 = *(undefined1 **)puVar5; } Font::DrawString(puVar5,extraout_EAX,&local_5c); local_14 = 0xffffffff; iVar6 = extraout_ECX_09; } if ((g_manager->_optionsConfig)._enableColorCorrection != 0) { _glfw_context_reset(1); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); puVar4 = &DAT_00c79398; if ((DAT_00c7939c & 1) == 0) { puVar4 = g_currentShader; } scratchVec.y = (g_manager->_optionsConfig)._exposure; local_40 = 1.0 / (g_manager->_optionsConfig)._gamma; g_currentShader = puVar4; Shader::set_uniform(puVar4,(byte *)"Exposure",8,&scratchVec.y,unused_03); Shader::set_uniform(puVar4,(byte *)"Gamma",8,&local_40,unused_04); local_54 = 0; local_64 = 0; local_58 = 0; local_60 = 0; local_4c = 0x3f800000; local_5c = 0x3f800000; local_48 = 0x3f800000; local_50 = 0x3f800000; local_44 = local_44 & 0xffffff00; KColor::SetFromARGB((KColor *)local_38,0xffffffff); render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_00); (**(code **)(*DAT_00c798a8 + 0x14))(&local_64,quadBuffer,g_drawRectUnset); iVar6 = extraout_ECX_11; } if (isFilterEnabled != '\0') { _glfw_context_reset(1); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); 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; puVar4 = &DAT_00c793e8; if ((DAT_00c793ec & 1) == 0) { puVar4 = g_currentShader; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_38._8_4_ = (BADTYPE)((double)DAT_00c79890[6] + __uint_to_double_fixup[-(DAT_00c79890[6] >> 0x1f)]); scratchVec.y = g_displayPixelRatio * g_screenPointScale * 0.5; scratchVec.x = (float)((double)DAT_00c79890[7] + __uint_to_double_fixup[-(DAT_00c79890[7] >> 0x1f)]); g_currentShader = puVar4; Shader::set_uniform(puVar4,(byte *)"ScreenSizePow2",10,local_38 + 8,(int)DAT_00c79890); local_54 = 0; local_64 = 0; local_58 = 0; local_60 = 0; local_4c = 0x3f800000; local_5c = 0x3f800000; local_48 = 0x3f800000; local_50 = 0x3f800000; local_44 = local_44 & 0xffffff00; KColor::SetFromARGB((KColor *)local_38,0xffffffff); render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_01); (**(code **)(*DAT_00c79890 + 0x14))(&local_64,quadBuffer,g_drawRectUnset); iVar6 = extraout_ECX_12; } shader_cache_find(iVar6); if (isFramebufferResized != '\0') { _glfw_context_reset(1); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); 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; local_80 = 0; local_90 = 0; local_84 = 0; local_8c = 0; local_78 = 0x3f800000; local_88 = 0x3f800000; local_74 = 0x3f800000; local_7c = 0x3f800000; local_70 = 0; KColor::SetFromARGB((KColor *)local_38,0xffffffff); render_quad_set_uniform_color(upscaleQuadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_02); (**(code **)(*DAT_00c798a0 + 0x14))(&local_90,upscaleQuadBuffer,g_drawRectUnset); } _glfw_context_reset(1); ExceptionList = local_1c; return; } //@@ 00956110 input_is_action_pressed /* DB: game-level wrapper: Lua hook, then each controller vfunc or Input::IsActionPressed callback FUN_00a20940 prototype: db/protos.zhl, confirmed by RET 16 */ byte input_is_action_pressed(int action,int controllerIndex,Entity *entity,int unused) { Manager *pMVar1; int iVar2; byte bVar3; char cVar4; NetplayManager NVar5; uint uVar6; iVar2 = action; pMVar1 = g_manager; if ((g_manager->_state == 2) && (g_luaEngine != (void *)0x0)) { bVar3 = lua_run_input_action_callback(entity,0,action,(byte *)((int)&action + 3)); if (bVar3 != 0) { return action._3_1_; } } NVar5 = pMVar1->_netplayManager; if ((NVar5 == *(NetplayManager *)(pMVar1 + 1)) || (controllerIndex != -1)) { action = iVar2; bVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a20940,&action,0,0); return bVar3; } uVar6 = 0; if ((int)*(NetplayManager *)(pMVar1 + 1) - (int)NVar5 >> 2 != 0) { do { cVar4 = (**(code **)(**(int **)((int)NVar5 + uVar6 * 4) + 0x30))(iVar2); if (cVar4 != '\0') { return 1; } uVar6 = uVar6 + 1; NVar5 = pMVar1->_netplayManager; } while (uVar6 < (uint)(*(int *)(pMVar1 + 1) - (int)NVar5 >> 2)); } return 0; } //@@ 009561e0 input_is_action_triggered /* DB: same wrapper as input_is_action_pressed but with IsActionTriggered callback FUN_00a209e0 prototype: db/protos.zhl, confirmed by RET 16 */ byte __thiscall input_is_action_triggered (void *this,int buttonAction,int controllerId,Entity *entity,byte isSkipOverrides) { int iVar1; byte bVar2; char cVar3; int iVar4; int iVar5; uint uVar6; undefined3 in_stack_00000011; code *pcVar7; iVar1 = buttonAction; if ((*(int *)((int)this + 8) == 2) && (g_luaEngine != (void *)0x0)) { bVar2 = lua_run_input_action_callback(entity,1,buttonAction,(byte *)((int)&buttonAction + 3)); if (bVar2 != 0) { return buttonAction._3_1_; } } if (iVar1 == 0x21) { _isSkipOverrides = 0x60; pcVar7 = FUN_00a207d0; } else { iVar5 = *(int *)((int)this + 0x4b3d8); if ((((iVar5 != *(int *)((int)this + 0x4b3dc)) && (iVar4 = *(int *)((int)this + 0x4b3dc) - iVar5 >> 2, iVar4 != 0)) && (controllerId == -1)) && (isSkipOverrides == 0)) { uVar6 = 0; if (iVar4 != 0) { do { cVar3 = (**(code **)(**(int **)(iVar5 + uVar6 * 4) + 0x34))(iVar1); if (cVar3 != '\0') { return 1; } uVar6 = uVar6 + 1; iVar5 = *(int *)((int)this + 0x4b3d8); } while (uVar6 < (uint)(*(int *)((int)this + 0x4b3dc) - iVar5 >> 2)); } return 0; } _isSkipOverrides = iVar1; pcVar7 = FUN_00a209e0; } bVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerId,pcVar7,&isSkipOverrides,0,0); return bVar2; } //@@ 009562d0 InputManager::GetActionValue /* DB: (action, controllerIndex, entity) -> float; same InputManager vtable +0x74 call with callback FUN_00a20ab0 as the Lua Input::GetActionValue (0086fd70) plus a netplay path (FUN_00864d80) and controllerIndex -1 polling all devices; Entity_Player::GetShootingJoystick calls it with actions 4..7 prototype: db/protos.zhl, confirmed by RET 16 */ float InputManager::GetActionValue(int action,int controllerIndex,Entity *entity,int unused) { Manager *pMVar1; int iVar2; char cVar3; undefined4 in_ECX; NetplayManager NVar4; uint uVar5; float10 fVar6; iVar2 = action; pMVar1 = g_manager; if (((g_manager->_state != 2) || (g_luaEngine == (void *)0x0)) || (cVar3 = FUN_00864d80(entity,in_ECX,action,&action), cVar3 == '\0')) { NVar4 = pMVar1->_netplayManager; if ((NVar4 != *(NetplayManager *)(pMVar1 + 1)) && (controllerIndex == -1)) { uVar5 = 0; if ((int)*(NetplayManager *)(pMVar1 + 1) - (int)NVar4 >> 2 != 0) { do { action = *(undefined4 *)(**(int **)((int)NVar4 + uVar5 * 4) + 0x38); fVar6 = (float10)(*(code *)action)(iVar2); if ((float)fVar6 != 0.0) { return (float)fVar6; } uVar5 = uVar5 + 1; NVar4 = pMVar1->_netplayManager; } while (uVar5 < (uint)(*(int *)(pMVar1 + 1) - (int)NVar4 >> 2)); } return 0.0; } entity = (Entity *)iVar2; action = 0; (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a20ab0,&entity,&action,0); } return (float)action; } //@@ 009563b0 is_any_player_restart_held /* DB: ? returns bool: for each main player gets its input device (NetInputDevice via RTDynamicCast for netplay) and tests action 0x12 (vtable +0x30 / input vtable +0x74 FUN_00a20940); Manager::update_ingame_input uses the result to drive the hold-to-restart counter (+0x26d8/+0x26dc, Player_stats_add 8) */ uint is_any_player_restart_held(void) { int iVar1; bool bVar2; Manager *pMVar3; char cVar4; undefined1 uVar5; uint uVar6; int iVar7; Entity_Player *pEVar8; int *piVar9; int *piVar10; uint uVar11; uint unaff_EBX; uint uVar12; PlayerManager *this; uint uVar13; int local_4c [2]; undefined1 local_44 [4]; int *local_40; int local_3c; int *local_38; int *local_34; int *local_30; int local_2c; int *local_28; undefined4 local_24; undefined4 local_20; Manager *local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c17d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_44 + 0x40); ExceptionList = &local_10; uVar12 = unaff_EBX & 0xffffff00; this = &g_game->_playerManager; uVar13 = 0; local_1c = g_manager; local_18 = 0; local_14 = uVar12; iVar7 = PlayerManager::count_main_players(this); if (iVar7 != 0) { do { pEVar8 = PlayerManager::get_main_player(this,uVar13); if (pEVar8 != (Entity_Player *)0x0) { iVar7 = pEVar8->_controllerIndex; (**(code **)(PTR_vftable_00c57b18 + 0x28))(&local_2c,iVar7,uVar6); local_8 = 0; if (local_2c == 0) { LAB_009566de: local_8 = 4; if (local_28 != (int *)0x0) { cVar4 = (**(code **)(*local_28 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_2c); } } } else { piVar9 = (int *)__RTDynamicCast(local_2c,0, &KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor ,0); if (piVar9 != (int *)0x0) { if (piVar9[0xde] == 0) { iVar7 = -0x21524111; } else { iVar7 = *(int *)(piVar9[0xde] + 0xc); } (**(code **)(PTR_vftable_00c57b18 + 0x28))(&local_3c,iVar7); local_8._0_1_ = 1; if (local_3c == 0) { cVar4 = (**(code **)(*piVar9 + 0x30))(0x12); uVar12 = uVar12 & 0xff; if (cVar4 != '\0') { uVar12 = 1; } local_14 = uVar12; } piVar10 = (int *)FUN_00902d60(&local_3c); piVar9 = (int *)piVar10[1]; piVar10[1] = (int)local_28; iVar1 = *piVar10; *piVar10 = local_2c; local_8._0_1_ = 2; local_2c = iVar1; local_28 = piVar9; if (((local_40 != (int *)0x0) && (cVar4 = (**(code **)(*local_40 + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_44); } local_8._0_1_ = 3; if (((local_38 != (int *)0x0) && (cVar4 = (**(code **)(*local_38 + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_3c); } local_8 = (uint)local_8._1_3_ << 8; } pMVar3 = local_1c; if (local_2c == 0) { uVar13 = local_18; goto LAB_009566de; } uVar13 = uVar12 & 0xffffff00; bVar2 = false; if (iVar7 == 0) { if ((local_1c->_netplayManager == *(NetplayManager *)(local_1c + 1)) || ((*(int *)&local_1c[1]._gamestate.field_0x290 == 0 && (*(int *)&local_1c[1]._gamestate.field_0x2d8 < 1)))) { local_20 = 0x12; uVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a20940,&local_20,0,0); local_14 = CONCAT31((int3)((uint)pMVar3 >> 8),uVar5); } uVar12 = local_14; local_8 = 5; if (((local_28 != (int *)0x0) && (cVar4 = (**(code **)(*local_28 + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_2c); } LAB_009565b0: uVar13 = local_18; } else { local_24 = 0x12; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a20940,&local_24,0,0); if ((cVar4 != '\0') && ((local_1c->_netplayManager == *(NetplayManager *)(local_1c + 1) || ((*(int *)&local_1c[1]._gamestate.field_0x290 == 0 && (*(int *)&local_1c[1]._gamestate.field_0x2d8 < 1)))))) { uVar13 = CONCAT31((int3)(uVar12 >> 8),1); bVar2 = true; } local_4c[0] = 0xc; local_4c[1] = 0xd; InputManager::get_device(&PTR_vftable_00c57b18,&local_34,iVar7); local_8 = CONCAT31(local_8._1_3_,6); if (local_34 != (int *)0x0) { if (!bVar2) { uVar12 = 0; do { iVar7 = local_4c[uVar12]; if (iVar7 == 0x11) { iVar7 = 7; } else if (iVar7 == 0x12) { iVar7 = 5; } cVar4 = (**(code **)(*local_34 + 0x24))(iVar7); if (cVar4 == '\0') goto LAB_0095667a; uVar12 = uVar12 + 1; } while (uVar12 < 2); } (**(code **)(*local_34 + 0x48))(0x12,1); local_14 = CONCAT31((int3)(uVar13 >> 8),1); } LAB_0095667a: uVar12 = local_14; local_8 = CONCAT31(local_8._1_3_,7); if (((local_30 != (int *)0x0) && (cVar4 = (**(code **)(*local_30 + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_34); } local_8 = 8; if (((local_28 == (int *)0x0) || (cVar4 = (**(code **)(*local_28 + 0xc))(), cVar4 == '\0')) || (g_inputDeviceRelease == (void *)0x0)) goto LAB_009565b0; (*g_inputDeviceRelease)(&local_2c); uVar13 = local_18; } } local_8 = 0xffffffff; } uVar13 = uVar13 + 1; this = &g_game->_playerManager; local_18 = uVar13; uVar11 = PlayerManager::count_main_players(this); } while (uVar13 < uVar11); } ExceptionList = local_10; return uVar12 & 0xff; } //@@ 00956750 FUN_00956750 undefined4 FUN_00956750(void) { int *piVar1; int in_ECX; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar1 == 0) || (*(char *)(in_ECX + 0x2a3a4) == '\0')) { return 0; } return 1; } //@@ 00956780 seed_fart_sound_override /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: if SEED_FART_SOUNDS(7) active, replaces sound id with 37 (fart) or 1/20 301 prototype: db/protos.zhl */ void __fastcall seed_fart_sound_override(int *soundId) { code *pcVar1; Seeds *pSVar2; uint uVar3; undefined1 local_20 [8]; void *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c1b1; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; if (g_game != (Game *)0x0) { pSVar2 = &g_game->_seedEffects; local_14 = 7; std::set::find_node(local_20,&local_14); if (((*(char *)((int)local_18 + 0xd) == '\0') && (*(int *)((int)local_18 + 0x10) < 8)) && (local_18 != pSVar2->_seedEffects)) { if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94184) { _Init_thread_header(&DAT_00c94184,uVar3); if (DAT_00c94184 == -1) { _DAT_00c5d2b4 = 0x700000002; DAT_00c5d2bc = 7; _atexit((_func_4879 *)&DAT_00b16970); local_8 = 0xffffffff; _Init_thread_footer(&DAT_00c94184); } } *soundId = 0x25; if (DAT_00c5d2b0 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); if (DAT_00c5d2b0 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = DAT_00c5d2b0 >> ((byte)_DAT_00c5d2b4 & 0x1f) ^ DAT_00c5d2b0; uVar3 = uVar3 << ((byte)((ulonglong)_DAT_00c5d2b4 >> 0x20) & 0x1f) ^ uVar3; DAT_00c5d2b0 = uVar3 >> ((byte)DAT_00c5d2bc & 0x1f) ^ uVar3; if (DAT_00c5d2b0 == (DAT_00c5d2b0 / 0x14) * 0x14) { *soundId = 0x12d; } } } ExceptionList = local_10; return; } //@@ 009568e0 SoundEffects::PlayWithFartOverride /* DB: ? seed_fart_sound_override then SoundEffects::Play prototype: db/protos.zhl, confirmed by RET 16 */ void SoundEffects::PlayWithFartOverride (int soundId,float volume,int frameDelay,byte isLoop,float pitch) { Manager *pMVar1; undefined3 in_stack_0000000d; pMVar1 = g_manager; seed_fart_sound_override(&soundId); Play(&pMVar1->_sfxManager,soundId,volume,frameDelay,(byte)_isLoop,pitch,0.0); return; } //@@ 00956940 SoundEffects::PlayWithFartOverride2 /* DB: ? seed_fart_sound_override then Play, extra arg variant prototype: db/protos.zhl, confirmed by RET 20 */ void SoundEffects::PlayWithFartOverride2 (int soundId,int unused,int frameDelay,byte isLoop,float pitch,float volume) { Manager *pMVar1; undefined3 in_stack_00000011; pMVar1 = g_manager; seed_fart_sound_override(&soundId); Play(&pMVar1->_sfxManager,soundId,volume,frameDelay,(byte)_isLoop,pitch,0.0); return; } //@@ 009569a0 Manager::GetChallengeParams /* ZHL [exact] __thiscall ChallengeParam* Manager::GetChallengeParams(int challengeID); prototype: REPENTOGON, confirmed by RET 4 */ ChallengeParam * __thiscall Manager::GetChallengeParams(Manager *this,int challengeID) { void *pvVar1; uint uVar2; uint uVar3; pvVar1 = (g_manager->_challengeParams)._begin; uVar3 = ((int)(g_manager->_challengeParams)._end - (int)pvVar1) / 0xa4 - 1; uVar2 = -(uint)(challengeID != 0) & challengeID; if (uVar2 < uVar3) { uVar3 = uVar2; } return (ChallengeParam *)(uVar3 * 0xa4 + (int)pvVar1); } //@@ 009569f0 challenges_xml_load /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: arg path (FileSystem::Open), bool; parses challenges.xml root challenges/challenge/version attrs (startingitems, playertype, endstage, megasatan...), fills ChallengeParams array stride 0xa4 at +0x2a664; callers load items.xml/costumes2.xml (mod content loaders) */ undefined4 challenges_xml_load(byte *param_1,char param_2) { byte bVar1; int iVar2; byte bVar3; char cVar4; uint uVar5; int *piVar6; int iVar7; void *pvVar8; undefined4 extraout_EAX; void *pvVar9; byte *pbVar10; int *piVar11; int *******pppppppiVar12; int *******pppppppiVar13; byte *pbVar14; byte *pbVar15; uint uVar16; byte *pbVar17; code *pcVar18; int iVar19; bool bVar20; double dVar21; undefined4 uVar22; char *pcVar23; int iVar24; undefined1 auStack_10220 [8]; uint uStack_10218; int *piStack_10214; int *piStack_10210; int iStack_1020c; int *piStack_10208; int *piStack_10204; int iStack_10200; int *piStack_101fc; int *piStack_101f8; int iStack_101f4; int *piStack_101f0; int *piStack_101ec; int iStack_101e8; int *piStack_101e4; int *piStack_101e0; int iStack_101dc; byte *pbStack_101d8; int iStack_101d4; undefined4 uStack_101d0; void *pvStack_101cc; byte *pbStack_101c8; undefined1 auStack_101c4 [48]; undefined1 auStack_10194 [65560]; undefined1 local_17c [168]; ChallengeParam local_d4; int *******local_2c [4]; int local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; int ******local_8; local_8 = (int ******)0xffffffff; puStack_c = &LAB_00b0c24a; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; pbStack_101c8 = param_1; local_14 = uVar5; piVar6 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar6 == (int *)0x0) { ExceptionList = local_10; return 0; } iVar7 = (**(code **)(*piVar6 + 4))(uVar5); pbStack_101d8 = operator_new_tracked(iVar7 + 1); uVar22 = 1; iVar24 = iVar7; (**(code **)(*piVar6 + 0x14))(pbStack_101d8,1,iVar7); pbStack_101d8[iVar7] = 0; (**(code **)*piVar6)(1); iVar7 = iStack_101d4; if (param_2 != '\0') goto LAB_00956b62; piVar6 = (int *)(iStack_101d4 + 0x2a664); iVar2 = *(int *)(iStack_101d4 + 0x2a668); iVar19 = *piVar6; if (iVar19 != iVar2) { do { iVar24 = 0x956aa9; FUN_004269f0(); iVar19 = iVar19 + 0xa4; } while (iVar19 != iVar2); iVar19 = *piVar6; } *(int *)(iVar7 + 0x2a668) = iVar19; uVar5 = (iVar19 - *piVar6) / 0xa4; if (uVar5 < 0x2f) { if (uVar5 < 0x2e) { if (0x2d < (uint)((*(int *)(iVar7 + 0x2a66c) - *piVar6) / 0xa4)) { pvVar8 = (void *)std::vector::_Udefault(iVar19,0x2e - uVar5,uStack_10218); goto LAB_00956b3b; } std::vector::_Resize_reallocate(uVar22,iVar24); } } else { pvVar8 = (void *)(*piVar6 + 0x1d78); pvStack_101cc = pvVar8; if (pvVar8 != (void *)iVar19) { do { FUN_004269f0(); pvVar8 = (void *)((int)pvVar8 + 0xa4); } while (pvVar8 != (void *)iVar19); pvVar8 = pvStack_101cc; } LAB_00956b3b: *(void **)(iVar7 + 0x2a668) = pvVar8; } ChallengeParams::ChallengeParams(local_17c); ChallengeParams::operator_assign_move(extraout_EAX); FUN_004269f0(); param_1 = pbStack_101c8; LAB_00956b62: FUN_00413b90(); local_8 = (int ******)0x0; pcVar23 = (char *)0x956b85; pbVar17 = pbStack_101d8; rapidxml::xml_document::parse(auStack_101c4,pbStack_101d8); bVar3 = (byte)pbVar17; pvVar8 = xml_node::first_node(auStack_101c4,(byte *)"challenges",(int)pcVar23,bVar3); if (pvVar8 == (void *)0x0) { pcVar23 = "Could not find root node \'challenges\' in %s\n"; bVar3 = (byte)param_1; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'challenges\' in %s\n"); } pvVar9 = xml_node::first_attribute(pvVar8,(byte *)"version",(uint)pcVar23,bVar3); pbVar14 = &DAT_00b63104; pbVar17 = &g_xmlNullStr; if (*(byte **)((int)pvVar9 + 4) != (byte *)0x0) { pbVar17 = *(byte **)((int)pvVar9 + 4); } pbVar10 = pbVar17; do { bVar1 = *pbVar10; bVar20 = bVar1 < *pbVar14; if (bVar1 != *pbVar14) { LAB_00956bf1: uVar5 = -(uint)bVar20 | 1; goto LAB_00956bf6; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar20 = bVar1 < pbVar14[1]; if (bVar1 != pbVar14[1]) goto LAB_00956bf1; pbVar10 = pbVar10 + 2; pbVar14 = pbVar14 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00956bf6: if (uVar5 != 0) { bVar3 = (byte)param_1; KAGE_LogMessage(0x10,(byte *)"Invalid version %s for %s\n"); pcVar23 = (char *)pbVar17; } pvStack_101cc = xml_node::first_node(pvVar8,(byte *)"challenge",(int)pcVar23,bVar3); if (pvStack_101cc != (void *)0x0) { pcVar18 = atoi_exref; do { pvVar8 = pvStack_101cc; ChallengeParams::ChallengeParams(&local_d4); local_8._0_1_ = 1; pbStack_101c8 = *(byte **)((int)pvVar8 + 0x20); local_d4._isPathTypeSet = 1; if (pbStack_101c8 != (byte *)0x0) { do { pbVar14 = pbStack_101c8; pbVar17 = *(byte **)pbStack_101c8; pbVar15 = s_id; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < *pbVar15; if (bVar3 != *pbVar15) { LAB_00956c85: uVar5 = -(uint)bVar20 | 1; goto LAB_00956c8a; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < pbVar15[1]; if (bVar3 != pbVar15[1]) goto LAB_00956c85; pbVar10 = pbVar10 + 2; pbVar15 = pbVar15 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00956c8a: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } uStack_10218 = (*pcVar18)(pbVar17); } else { pbVar15 = s_name; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < *pbVar15; if (bVar3 != *pbVar15) { LAB_00956ce0: uVar5 = -(uint)bVar20 | 1; goto LAB_00956ce5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < pbVar15[1]; if (bVar3 != pbVar15[1]) goto LAB_00956ce0; pbVar15 = pbVar15 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00956ce5: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } pbVar10 = pbVar17; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)&local_d4,pbVar17,(int)pbVar10 - (int)(pbVar17 + 1)); } else { pcVar23 = "startingitems"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00956d50: uVar5 = -(uint)bVar20 | 1; goto LAB_00956d55; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00956d50; pcVar23 = pcVar23 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00956d55: if (uVar5 == 0) { local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; local_2c[0] = (int *******)0x0; pbVar10 = pbVar17; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17,(int)pbVar10 - (int)(pbVar17 + 1)); local_8._0_1_ = 2; string_split(0x2c); local_8._0_1_ = 3; piVar6 = piStack_101e4; if (piStack_101e4 != piStack_101e0) { do { if (piVar6[4] != 0) { piVar11 = piVar6; if (0xf < (uint)piVar6[5]) { piVar11 = (int *)*piVar6; } uStack_101d0 = (*pcVar18)(piVar11); if (local_d4._collectibleList._end == local_d4._collectibleList._capacity) { std::vector::_Emplace_reallocate (local_d4._collectibleList._end,&uStack_101d0); } else { *(undefined4 *)local_d4._collectibleList._end = uStack_101d0; local_d4._collectibleList._end = (void *)((int)local_d4._collectibleList._end + 4); } } piVar6 = piVar6 + 6; } while (piVar6 != piStack_101e0); } piVar11 = piStack_101e0; local_8._0_1_ = 2; piVar6 = piStack_101e4; if (piStack_101e4 != (int *)0x0) { for (; piVar6 != piVar11; piVar6 = piVar6 + 6) { uVar5 = piVar6[5]; if (0xf < uVar5) { pvVar8 = (void *)*piVar6; uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_0095849a; } operator_delete(pvVar9,uVar16); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar5 = ((iStack_101dc - (int)piStack_101e4) / 0x18) * 0x18; piVar6 = piStack_101e4; if (0xfff < uVar5) { piVar6 = (int *)piStack_101e4[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)piStack_101e4 + (-4 - (int)piVar6))) goto LAB_0095849a; } operator_delete(piVar6,uVar5); piStack_101e4 = (int *)0x0; piStack_101e0 = (int *)0x0; iStack_101dc = 0; pbVar14 = pbStack_101c8; } local_8._0_1_ = 1; if (0xf < local_18) { uVar5 = local_18 + 1; pppppppiVar12 = local_2c[0]; if (0xfff < uVar5) { pppppppiVar12 = (int *******)local_2c[0][-1]; uVar5 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pppppppiVar12))) goto LAB_0095849a; } operator_delete(pppppppiVar12,uVar5); } } else { pcVar23 = "startingitems2"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00956f60: uVar5 = -(uint)bVar20 | 1; goto LAB_00956f65; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00956f60; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00956f65: if (uVar5 == 0) { local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; local_2c[0] = (int *******)0x0; pbVar10 = pbVar17; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17,(int)pbVar10 - (int)(pbVar17 + 1)); local_8._0_1_ = 4; string_split(0x2c); local_8._0_1_ = 5; piVar6 = piStack_101f0; if (piStack_101f0 != piStack_101ec) { do { if (piVar6[4] != 0) { piVar11 = piVar6; if (0xf < (uint)piVar6[5]) { piVar11 = (int *)*piVar6; } uStack_101d0 = (*pcVar18)(piVar11); if (local_d4._collectibleTwinList._end == local_d4._collectibleTwinList._capacity) { std::vector::_Emplace_reallocate (local_d4._collectibleTwinList._end,&uStack_101d0); } else { *(undefined4 *)local_d4._collectibleTwinList._end = uStack_101d0; local_d4._collectibleTwinList._end = (void *)((int)local_d4._collectibleTwinList._end + 4); } } piVar6 = piVar6 + 6; } while (piVar6 != piStack_101ec); } piVar11 = piStack_101ec; local_8._0_1_ = 4; piVar6 = piStack_101f0; if (piStack_101f0 != (int *)0x0) { for (; piVar6 != piVar11; piVar6 = piVar6 + 6) { uVar5 = piVar6[5]; if (0xf < uVar5) { pvVar8 = (void *)*piVar6; uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_0095849a; } operator_delete(pvVar9,uVar16); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar5 = ((iStack_101e8 - (int)piStack_101f0) / 0x18) * 0x18; piVar6 = piStack_101f0; if (0xfff < uVar5) { piVar6 = (int *)piStack_101f0[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)piStack_101f0 + (-4 - (int)piVar6))) goto LAB_0095849a; } operator_delete(piVar6,uVar5); piStack_101f0 = (int *)0x0; piStack_101ec = (int *)0x0; iStack_101e8 = 0; pbVar14 = pbStack_101c8; } local_8._0_1_ = 1; if (0xf < local_18) { uVar5 = local_18 + 1; pppppppiVar12 = local_2c[0]; if (0xfff < uVar5) { pppppppiVar12 = (int *******)local_2c[0][-1]; uVar5 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pppppppiVar12))) goto LAB_0095849a; } operator_delete(pppppppiVar12,uVar5); } } else { pcVar23 = "startingtrinkets"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957163: uVar5 = -(uint)bVar20 | 1; goto LAB_00957168; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957163; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957168: if (uVar5 == 0) { local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; local_2c[0] = (int *******)0x0; pbVar10 = pbVar17; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17,(int)pbVar10 - (int)(pbVar17 + 1)); local_8._0_1_ = 6; string_split(0x2c); local_8._0_1_ = 7; piVar6 = piStack_101fc; if (piStack_101fc != piStack_101f8) { do { if (piVar6[4] != 0) { piVar11 = piVar6; if (0xf < (uint)piVar6[5]) { piVar11 = (int *)*piVar6; } uStack_101d0 = (*pcVar18)(piVar11); if (local_d4._trinketList._end == local_d4._trinketList._capacity) { std::vector::_Emplace_reallocate (local_d4._trinketList._end,&uStack_101d0); } else { *(undefined4 *)local_d4._trinketList._end = uStack_101d0; local_d4._trinketList._end = (void *)((int)local_d4._trinketList._end + 4); } } piVar6 = piVar6 + 6; } while (piVar6 != piStack_101f8); } piVar11 = piStack_101f8; local_8._0_1_ = 6; piVar6 = piStack_101fc; if (piStack_101fc != (int *)0x0) { for (; piVar6 != piVar11; piVar6 = piVar6 + 6) { uVar5 = piVar6[5]; if (0xf < uVar5) { pvVar8 = (void *)*piVar6; uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_0095849a; } operator_delete(pvVar9,uVar16); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar5 = ((iStack_101f4 - (int)piStack_101fc) / 0x18) * 0x18; piVar6 = piStack_101fc; if (0xfff < uVar5) { piVar6 = (int *)piStack_101fc[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)piStack_101fc + (-4 - (int)piVar6))) goto LAB_0095849a; } operator_delete(piVar6,uVar5); piStack_101fc = (int *)0x0; piStack_101f8 = (int *)0x0; iStack_101f4 = 0; pbVar14 = pbStack_101c8; } local_8._0_1_ = 1; if (0xf < local_18) { uVar5 = local_18 + 1; pppppppiVar12 = local_2c[0]; if (0xfff < uVar5) { pppppppiVar12 = (int *******)local_2c[0][-1]; uVar5 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pppppppiVar12))) goto LAB_0095849a; } operator_delete(pppppppiVar12,uVar5); } } else { pcVar23 = "achievements"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957380: uVar5 = -(uint)bVar20 | 1; goto LAB_00957385; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957380; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957385: if (uVar5 == 0) { local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; local_2c[0] = (int *******)0x0; pbVar10 = pbVar17; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17,(int)pbVar10 - (int)(pbVar17 + 1) ); local_8._0_1_ = 8; string_split(0x2c); local_8._0_1_ = 9; piVar6 = piStack_10208; if (piStack_10208 != piStack_10204) { do { if (piVar6[4] != 0) { piVar11 = piVar6; if (0xf < (uint)piVar6[5]) { piVar11 = (int *)*piVar6; } uStack_101d0 = (*pcVar18)(piVar11); if (local_d4._achievementList._end == local_d4._achievementList._capacity) { std::vector<4byte>::_Emplace_reallocate (local_d4._achievementList._end,&uStack_101d0); } else { *(undefined4 *)local_d4._achievementList._end = uStack_101d0; local_d4._achievementList._end = (void *)((int)local_d4._achievementList._end + 4); } } piVar6 = piVar6 + 6; } while (piVar6 != piStack_10204); } piVar11 = piStack_10204; local_8._0_1_ = 8; piVar6 = piStack_10208; if (piStack_10208 != (int *)0x0) { for (; piVar6 != piVar11; piVar6 = piVar6 + 6) { uVar5 = piVar6[5]; if (0xf < uVar5) { pvVar8 = (void *)*piVar6; uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_0095849a; } operator_delete(pvVar9,uVar16); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar5 = ((iStack_10200 - (int)piStack_10208) / 0x18) * 0x18; piVar6 = piStack_10208; if (0xfff < uVar5) { piVar6 = (int *)piStack_10208[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)piStack_10208 + (-4 - (int)piVar6))) goto LAB_0095849a; } operator_delete(piVar6,uVar5); piStack_10208 = (int *)0x0; piStack_10204 = (int *)0x0; iStack_10200 = 0; pbVar14 = pbStack_101c8; } local_8._0_1_ = 1; if (0xf < local_18) { uVar5 = local_18 + 1; pppppppiVar12 = local_2c[0]; if (0xfff < uVar5) { pppppppiVar12 = (int *******)local_2c[0][-1]; uVar5 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pppppppiVar12))) goto LAB_0095849a; } operator_delete(pppppppiVar12,uVar5); } } else { pcVar23 = "endstage"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957590: uVar5 = -(uint)bVar20 | 1; goto LAB_00957595; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957590; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957595: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._endStage = (*pcVar18)(pbVar17); } else { pcVar23 = "roomfilter"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_009575e6: uVar5 = -(uint)bVar20 | 1; goto LAB_009575eb; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_009575e6; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009575eb: if (uVar5 == 0) { local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; local_2c[0] = (int *******)0x0; pbVar14 = pbVar17; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17, (int)pbVar14 - (int)(pbVar17 + 1)); local_8._0_1_ = 10; string_split(0x2c); local_8._0_1_ = 0xb; piVar6 = piStack_10214; piVar11 = piStack_10210; if (piStack_10214 != piStack_10210) { do { if (piVar6[4] != 0) { piVar11 = piVar6; if (0xf < (uint)piVar6[5]) { piVar11 = (int *)*piVar6; } uStack_101d0 = (*pcVar18)(piVar11); FUN_00428560(auStack_10220,&uStack_101d0); piVar11 = piStack_10210; } piVar6 = piVar6 + 6; } while (piVar6 != piVar11); } local_8._0_1_ = 10; piVar6 = piStack_10214; if (piStack_10214 != (int *)0x0) { for (; piVar6 != piVar11; piVar6 = piVar6 + 6) { uVar5 = piVar6[5]; if (0xf < uVar5) { pvVar8 = (void *)*piVar6; uVar16 = uVar5 + 1; pvVar9 = pvVar8; if (0xfff < uVar16) { pvVar9 = *(void **)((int)pvVar8 + -4); uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar9))) goto LAB_0095849a; } operator_delete(pvVar9,uVar16); } piVar6[4] = 0; piVar6[5] = 0xf; *(undefined1 *)piVar6 = 0; } uVar5 = ((iStack_1020c - (int)piStack_10214) / 0x18) * 0x18; piVar6 = piStack_10214; if (0xfff < uVar5) { piVar6 = (int *)piStack_10214[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)piStack_10214 + (-4 - (int)piVar6))) goto LAB_0095849a; } operator_delete(piVar6,uVar5); piStack_10214 = (int *)0x0; piStack_10210 = (int *)0x0; iStack_1020c = 0; } local_8._0_1_ = 1; if (0xf < local_18) { uVar16 = local_18 + 1; pppppppiVar13 = local_2c[0]; if (0xfff < uVar16) { pppppppiVar13 = (int *******)local_2c[0][-1]; uVar16 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pppppppiVar13))) goto LAB_0095849a; } LAB_0095779e: operator_delete(pppppppiVar13,uVar16); } LAB_009577a6: pbVar14 = pbStack_101c8; } else { pcVar23 = "cursefilter"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957837: uVar5 = -(uint)bVar20 | 1; goto LAB_0095783c; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957837; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0095783c: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._curseFilter = (*pcVar18)(pbVar17); } else { pcVar23 = "getcurse"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957890: uVar5 = -(uint)bVar20 | 1; goto LAB_00957895; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957890; pcVar23 = pcVar23 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957895: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._getCurse = (*pcVar18)(pbVar17); } else { pcVar23 = "startingpill"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_009578e3: uVar5 = -(uint)bVar20 | 1; goto LAB_009578e8; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_009578e3; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009578e8: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._startingPill = (*pcVar18)(pbVar17); } else { pcVar23 = "startingcard"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957940: uVar5 = -(uint)bVar20 | 1; goto LAB_00957945; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957940; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957945: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._startingCard = (*pcVar18)(pbVar17); } else { pbVar15 = &DAT_00b7c540; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < *pbVar15; if (bVar3 != *pbVar15) { LAB_00957996: uVar5 = -(uint)bVar20 | 1; goto LAB_0095799b; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < pbVar15[1]; if (bVar3 != pbVar15[1]) goto LAB_00957996; pbVar10 = pbVar10 + 2; pbVar15 = pbVar15 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0095799b: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._soulHearts = (*pcVar18)(pbVar17); } else { pbVar15 = &DAT_00b7c548; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < *pbVar15; if (bVar3 != *pbVar15) { LAB_009579f0: uVar5 = -(uint)bVar20 | 1; goto LAB_009579f5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < pbVar15[1]; if (bVar3 != pbVar15[1]) goto LAB_009579f0; pbVar10 = pbVar10 + 2; pbVar15 = pbVar15 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009579f5: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._blackHearts = (*pcVar18)(pbVar17); } else { pbVar15 = &DAT_00b7c550; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < *pbVar15; if (bVar3 != *pbVar15) { LAB_00957a43: uVar5 = -(uint)bVar20 | 1; goto LAB_00957a48; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < pbVar15[1]; if (bVar3 != pbVar15[1]) goto LAB_00957a43; pbVar10 = pbVar10 + 2; pbVar15 = pbVar15 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957a48: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._hearts = (*pcVar18)(pbVar17); } else { pbVar15 = &DAT_00b7c558; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < *pbVar15; if (bVar3 != *pbVar15) { LAB_00957a96: uVar5 = -(uint)bVar20 | 1; goto LAB_00957a9b; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < pbVar15[1]; if (bVar3 != pbVar15[1]) goto LAB_00957a96; pbVar10 = pbVar10 + 2; pbVar15 = pbVar15 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957a9b: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._maxHearts = (*pcVar18)(pbVar17); } else { pcVar23 = "coins"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957af0: uVar5 = -(uint)bVar20 | 1; goto LAB_00957af5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957af0; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957af5: if (uVar5 != 0) { pcVar23 = "canshoot"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957b43: uVar5 = -(uint)bVar20 | 1; goto LAB_00957b48; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957b43; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957b48: if (uVar5 == 0) { local_2c[0] = (int *******)0x0; local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; pbVar14 = pbVar17; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17, (int)pbVar14 - (int)(pbVar17 + 1)) ; pcVar18 = atoi_exref; if (local_1c == 0) { LAB_00957c56: local_d4._canShoot = 0; LAB_00957c5a: pppppppiVar12 = local_2c[0]; uVar5 = local_18; } else { pppppppiVar12 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar12 = local_2c[0]; } if (local_1c == 4) { if ((*pppppppiVar12 == (int ******)0x65757274) || ((((bVar3 = (byte)*pppppppiVar12, bVar20 = bVar3 < 0x74, bVar3 == 0x74 && (bVar20 = *(byte *)((int)pppppppiVar12 + 1) < 0x72, *(byte *)((int)pppppppiVar12 + 1) == 0x72)) && (bVar20 = *(byte *)((int)pppppppiVar12 + 2 ) < 0x75, *(byte *)((int)pppppppiVar12 + 2) == 0x75) ) && (bVar20 = *(byte *)((int)pppppppiVar12 + 3) < 0x65, *(byte *)((int)pppppppiVar12 + 3) == 0x65)))) { uVar5 = 0; } else { uVar5 = -(uint)bVar20 | 1; } if (uVar5 != 0) goto LAB_00957bdd; LAB_00957c44: local_d4._canShoot = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; } else { LAB_00957bdd: pppppppiVar12 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar12 = local_2c[0]; } if (local_1c == 4) { if ((*pppppppiVar12 == (int ******)0x65757254) || (((bVar3 = (byte)*pppppppiVar12, bVar20 = bVar3 < 0x54, bVar3 == 0x54 && (bVar20 = *(byte *)((int)pppppppiVar12 + 1) < 0x72, *(byte *)((int)pppppppiVar12 + 1) == 0x72)) && ((bVar20 = *(byte *)((int)pppppppiVar12 + 2) < 0x75, *(byte *)((int)pppppppiVar12 + 2) == 0x75 && (bVar20 = *(byte *)((int) pppppppiVar12 + 3) < 0x65, *(byte *)((int)pppppppiVar12 + 3) == 0x65)))))) { uVar5 = 0; } else { uVar5 = -(uint)bVar20 | 1; } if (uVar5 == 0) goto LAB_00957c44; } pppppppiVar12 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar12 = local_2c[0]; } iVar7 = atoi((char *)pppppppiVar12); if (iVar7 == 0) goto LAB_00957c56; local_d4._canShoot = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; } } } else { pcVar23 = "altpath"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957cc0: uVar5 = -(uint)bVar20 | 1; goto LAB_00957cc5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957cc0; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957cc5: if (uVar5 == 0) { local_2c[0] = (int *******)0x0; local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; pbVar14 = pbVar17; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17, (int)pbVar14 - (int)(pbVar17 + 1)); pcVar18 = atoi_exref; if (local_1c == 0) goto LAB_00957c5a; pppppppiVar12 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar12 = local_2c[0]; } if (local_1c == 4) { if ((*pppppppiVar12 == (int ******)0x65757274) || (((bVar3 = (byte)*pppppppiVar12, bVar20 = bVar3 < 0x74, bVar3 == 0x74 && (bVar20 = *(byte *)((int)pppppppiVar12 + 1) < 0x72, *(byte *)((int)pppppppiVar12 + 1) == 0x72)) && ((bVar20 = *(byte *)((int)pppppppiVar12 + 2 ) < 0x75, *(byte *)((int)pppppppiVar12 + 2) == 0x75 && (bVar20 = *(byte *)((int)pppppppiVar12 + 3) < 0x65, *(byte *)((int)pppppppiVar12 + 3) == 0x65)))))) { uVar5 = 0; } else { uVar5 = -(uint)bVar20 | 1; } if (uVar5 != 0) goto LAB_00957d5a; LAB_00957dcb: local_d4._pathType = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; } else { LAB_00957d5a: pppppppiVar12 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar12 = local_2c[0]; } if (local_1c == 4) { if ((*pppppppiVar12 == (int ******)0x65757254) || ((((bVar3 = (byte)*pppppppiVar12, bVar20 = bVar3 < 0x54, bVar3 == 0x54 && (bVar20 = *(byte *)((int)pppppppiVar12 + 1) < 0x72, *(byte *)((int)pppppppiVar12 + 1) == 0x72)) && (bVar20 = *(byte *)((int)pppppppiVar12 + 2) < 0x75, *(byte *)((int)pppppppiVar12 + 2) == 0x75)) && (bVar20 = *(byte *)((int)pppppppiVar12 + 3) < 0x65, *(byte *)((int)pppppppiVar12 + 3) == 0x65 )))) { uVar5 = 0; } else { uVar5 = -(uint)bVar20 | 1; } if (uVar5 == 0) goto LAB_00957dcb; } pppppppiVar12 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar12 = local_2c[0]; } iVar7 = atoi((char *)pppppppiVar12); if (iVar7 == 0) goto LAB_00957c5a; local_d4._pathType = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; } } else { pcVar23 = "maxdamage"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957e17: uVar5 = -(uint)bVar20 | 1; goto LAB_00957e1c; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957e17; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957e1c: if (uVar5 != 0) { pcVar23 = "adddamage"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957f25: uVar5 = -(uint)bVar20 | 1; goto LAB_00957f2a; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957f25; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957f2a: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0 ) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } dVar21 = atof((char *)pbVar17); local_d4._addDamage = (float)dVar21; } else { pcVar23 = "minfirerate"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957f80: uVar5 = -(uint)bVar20 | 1; goto LAB_00957f85; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957f80; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957f85: if (uVar5 != 0) { pcVar23 = "minshotspeed"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00957fd7: uVar5 = -(uint)bVar20 | 1; goto LAB_00957fdc; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00957fd7; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00957fdc: if (uVar5 == 0) { local_2c[0] = (int *******)0x0; local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; pbVar14 = pbVar17; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17 ,(int)pbVar14 - (int)(pbVar17 + 1)); uVar5 = local_18; iVar7 = local_1c; pppppppiVar12 = local_2c[0]; if (local_1c == 0) { pcVar18 = atoi_exref; LAB_009580ad: local_d4._minShotSpeed = 0; goto LAB_00957c5a; } pppppppiVar13 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar13 = local_2c[0]; } if ((local_1c != 4) || (iVar24 = memcmp_eq(pppppppiVar13, &DAT_00b64fe8,4), iVar24 != 0)) { pppppppiVar13 = (int *******)local_2c; if (0xf < uVar5) { pppppppiVar13 = pppppppiVar12; } if ((iVar7 != 4) || (iVar7 = memcmp_eq(pppppppiVar13, &DAT_00b64ff0,4), iVar7 != 0)) { pcVar18 = atoi_exref; pppppppiVar13 = (int *******)local_2c; if (0xf < uVar5) { pppppppiVar13 = pppppppiVar12; } iVar7 = atoi((char *)pppppppiVar13); if (iVar7 == 0) goto LAB_009580ad; local_d4._minShotSpeed = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; goto LAB_00957c60; } } local_d4._minShotSpeed = 1; pcVar18 = atoi_exref; } else { pcVar23 = "bigrange"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_009580e5: uVar5 = -(uint)bVar20 | 1; goto LAB_009580ea; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_009580e5; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009580ea: if (uVar5 != 0) { pcVar23 = "playertype"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_009581f5: uVar5 = -(uint)bVar20 | 1; goto LAB_009581fa; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_009581f5; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009581fa: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4 ); } local_d4._playerType = (*pcVar18)(pbVar17); } else { pcVar23 = "difficulty"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00958250: uVar5 = -(uint)bVar20 | 1; goto LAB_00958255; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00958250; pcVar23 = pcVar23 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00958255: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._difficulty = (*pcVar18)(pbVar17); } else { pcVar23 = "megasatan"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_009582a3: uVar5 = -(uint)bVar20 | 1; goto LAB_009582a8; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_009582a3; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009582a8: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } std::string::string_from_cstr ((char *)local_2c,pbVar17) ; local_d4._isMegaSatan = string_to_bool(); std::string::_Tidy_deallocate ((char *)local_2c); } else { pcVar23 = "secretpath"; pbVar10 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar10 = pbVar17; } do { bVar3 = *pbVar10; bVar20 = bVar3 < (byte)*pcVar23; if (bVar3 != *pcVar23) { LAB_00958310: uVar5 = -(uint)bVar20 | 1; goto LAB_00958315; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar20 = bVar3 < (byte)pcVar23[1]; if (bVar3 != pcVar23[1]) goto LAB_00958310; pbVar10 = pbVar10 + 2; pcVar23 = pcVar23 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_00958315: if (uVar5 == 0) { pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)( pbStack_101c8 + 4); } std::string::string_from_cstr ((char *)local_2c,pbVar17); cVar4 = string_to_bool(); std::string::_Tidy_deallocate((char *)local_2c); pcVar18 = atoi_exref; if (cVar4 != '\0') { local_d4._pathType = 2; } } else { KAGE_LogMessage(0x10,(byte *) "Got invald parameter %s when reading challenges!\n" ); } } } } goto LAB_009577ac; } local_2c[0] = (int *******)0x0; local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; pbVar14 = pbVar17; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17, (int)pbVar14 - (int)(pbVar17 + 1)); uVar5 = local_18; iVar7 = local_1c; pppppppiVar12 = local_2c[0]; if (local_1c == 0) { pcVar18 = atoi_exref; LAB_009581bd: local_d4._bigRange = 0; goto LAB_00957c5a; } pppppppiVar13 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar13 = local_2c[0]; } if ((local_1c != 4) || (iVar24 = memcmp_eq(pppppppiVar13,&DAT_00b64fe8 ,4), iVar24 != 0)) { pppppppiVar13 = (int *******)local_2c; if (0xf < uVar5) { pppppppiVar13 = pppppppiVar12; } if ((iVar7 != 4) || (iVar7 = memcmp_eq(pppppppiVar13, &DAT_00b64ff0,4), iVar7 != 0)) { pcVar18 = atoi_exref; pppppppiVar13 = (int *******)local_2c; if (0xf < uVar5) { pppppppiVar13 = pppppppiVar12; } iVar7 = atoi((char *)pppppppiVar13); if (iVar7 != 0) { local_d4._bigRange = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; goto LAB_00957c60; } goto LAB_009581bd; } } local_d4._bigRange = 1; pcVar18 = atoi_exref; } goto LAB_00957c60; } pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } dVar21 = atof((char *)pbVar17); local_d4._minFireRate = (float)dVar21; } goto LAB_009577ac; } local_2c[0] = (int *******)0x0; local_1c = 0; pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_18 = 0xf; pbVar14 = pbVar17; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)local_2c,pbVar17, (int)pbVar14 - (int)(pbVar17 + 1)); uVar5 = local_18; iVar7 = local_1c; pppppppiVar12 = local_2c[0]; if (local_1c == 0) { pcVar18 = atoi_exref; LAB_00957eed: local_d4._maxDamage = 0; goto LAB_00957c5a; } pppppppiVar13 = (int *******)local_2c; if (0xf < local_18) { pppppppiVar13 = local_2c[0]; } if ((local_1c != 4) || (iVar24 = memcmp_eq(pppppppiVar13,&DAT_00b64fe8,4 ), iVar24 != 0)) { pppppppiVar13 = (int *******)local_2c; if (0xf < uVar5) { pppppppiVar13 = pppppppiVar12; } if ((iVar7 != 4) || (iVar7 = memcmp_eq(pppppppiVar13,&DAT_00b64ff0, 4), iVar7 != 0)) { pcVar18 = atoi_exref; pppppppiVar13 = (int *******)local_2c; if (0xf < uVar5) { pppppppiVar13 = pppppppiVar12; } iVar7 = atoi((char *)pppppppiVar13); if (iVar7 != 0) { local_d4._maxDamage = 1; pppppppiVar12 = local_2c[0]; uVar5 = local_18; goto LAB_00957c60; } goto LAB_00957eed; } } local_d4._maxDamage = 1; pcVar18 = atoi_exref; } } LAB_00957c60: if (0xf < uVar5) { uVar16 = uVar5 + 1; pppppppiVar13 = pppppppiVar12; if (0xfff < uVar16) { pppppppiVar13 = (int *******)pppppppiVar12[-1]; uVar16 = uVar5 + 0x24; if (0x1f < (uint)((int)pppppppiVar12 + (-4 - (int)pppppppiVar13))) { LAB_0095849a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto LAB_0095779e; } goto LAB_009577a6; } pbVar17 = &g_xmlNullStr; if (*(byte **)(pbStack_101c8 + 4) != (byte *)0x0) { pbVar17 = *(byte **)(pbStack_101c8 + 4); } local_d4._coins = (*pcVar18)(pbVar17); } } } } } } } } } } } } } } } } LAB_009577ac: } while ((*(int *)(pbVar14 + 0x10) != 0) && (pbStack_101c8 = *(byte **)(pbVar14 + 0x18), pbStack_101c8 != (byte *)0x0)); pvVar8 = pvStack_101cc; } iVar7 = iStack_101d4; if (param_2 == '\0') { if (-1 < (int)uStack_10218) { if (uStack_10218 < (uint)((*(int *)(iStack_101d4 + 0x2a668) - *(int *)(iStack_101d4 + 0x2a664)) / 0xa4)) { daily_challenge_params_assign(&local_d4); } goto LAB_009583cf; } } else { pvVar8 = *(void **)(iStack_101d4 + 0x2a668); if (pvVar8 == *(void **)(iStack_101d4 + 0x2a66c)) { std::vector::_Emplace_reallocate(pvVar8,&local_d4); } else { ChallengeParams::copy_constructor(pvVar8,&local_d4); *(int *)(iVar7 + 0x2a668) = *(int *)(iVar7 + 0x2a668) + 0xa4; } LAB_009583cf: pvVar8 = pvStack_101cc; } local_8 = (int ******)((uint)local_8._1_3_ << 8); FID_conflict__Tidy(&local_d4._seedEffects); FID_conflict__Tidy(&local_d4._collectibleTwinList); FID_conflict__Tidy(&local_d4._achievementList); FID_conflict__Tidy(&local_d4._trinketList); FID_conflict__Tidy(&local_d4._collectibleList); FID_conflict__Erase_tree_>_> (&local_d4._roomset, (fuzzer_allocator_> *)&local_d4._roomset, *(_Tree_node **)((int)local_d4._roomset._head + 4)); operator_delete(local_d4._roomset._head,0x14); std::string::_Tidy_deallocate((char *)&local_d4); pvStack_101cc = *(void **)((int)pvVar8 + 0x2c); } while (pvStack_101cc != (void *)0x0); } local_8 = (int ******)0xc; xml_memory_pool::clear(auStack_10194); local_8 = (int ******)0xd; tracked_alloc(1,pbStack_101d8,0); ExceptionList = local_10; return 1; } //@@ 009584b0 ChallengeParams::operator_assign_move /* DB: move-assign: steals strings/trees/vectors field by field from param (resets source SSO to 0/0xf); challenges_xml_load calls it on a fresh ChallengeParams::ChallengeParams() before FUN_004269f0 destroys the temp */ void ChallengeParams::operator_assign_move(char *param_1) { int *this; char *pcVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; char *in_ECX; char *pcVar6; if (in_ECX != param_1) { std::string::_Tidy_deallocate(in_ECX); uVar3 = *(undefined4 *)(param_1 + 4); uVar4 = *(undefined4 *)(param_1 + 8); uVar5 = *(undefined4 *)(param_1 + 0xc); *(undefined4 *)in_ECX = *(undefined4 *)param_1; *(undefined4 *)(in_ECX + 4) = uVar3; *(undefined4 *)(in_ECX + 8) = uVar4; *(undefined4 *)(in_ECX + 0xc) = uVar5; *(undefined8 *)(in_ECX + 0x10) = *(undefined8 *)(param_1 + 0x10); param_1[0x10] = '\0'; param_1[0x11] = '\0'; param_1[0x12] = '\0'; param_1[0x13] = '\0'; param_1[0x14] = '\x0f'; param_1[0x15] = '\0'; param_1[0x16] = '\0'; param_1[0x17] = '\0'; *param_1 = '\0'; } this = (int *)(in_ECX + 0x18); if (this != (int *)(param_1 + 0x18)) { iVar2 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; in_ECX[0x1c] = '\0'; in_ECX[0x1d] = '\0'; in_ECX[0x1e] = '\0'; in_ECX[0x1f] = '\0'; uVar3 = *(undefined4 *)(in_ECX + 0x18); *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)(param_1 + 0x18); *(undefined4 *)(param_1 + 0x18) = uVar3; uVar3 = *(undefined4 *)(in_ECX + 0x1c); *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(param_1 + 0x1c); *(undefined4 *)(param_1 + 0x1c) = uVar3; } pcVar1 = param_1 + 0x20; if (in_ECX + 0x20 != pcVar1) { FID_conflict__Tidy(in_ECX + 0x20); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)pcVar1; *(undefined4 *)(in_ECX + 0x24) = *(undefined4 *)(param_1 + 0x24); *(undefined4 *)(in_ECX + 0x28) = *(undefined4 *)(param_1 + 0x28); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; param_1[0x24] = '\0'; param_1[0x25] = '\0'; param_1[0x26] = '\0'; param_1[0x27] = '\0'; param_1[0x28] = '\0'; param_1[0x29] = '\0'; param_1[0x2a] = '\0'; param_1[0x2b] = '\0'; } pcVar1 = param_1 + 0x2c; if (in_ECX + 0x2c != pcVar1) { FID_conflict__Tidy(in_ECX + 0x2c); *(undefined4 *)(in_ECX + 0x2c) = *(undefined4 *)pcVar1; *(undefined4 *)(in_ECX + 0x30) = *(undefined4 *)(param_1 + 0x30); *(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)(param_1 + 0x34); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; param_1[0x30] = '\0'; param_1[0x31] = '\0'; param_1[0x32] = '\0'; param_1[0x33] = '\0'; param_1[0x34] = '\0'; param_1[0x35] = '\0'; param_1[0x36] = '\0'; param_1[0x37] = '\0'; } pcVar1 = param_1 + 0x48; *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(param_1 + 0x38); *(undefined4 *)(in_ECX + 0x3c) = *(undefined4 *)(param_1 + 0x3c); *(undefined4 *)(in_ECX + 0x40) = *(undefined4 *)(param_1 + 0x40); *(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(param_1 + 0x44); if (in_ECX + 0x48 != pcVar1) { FID_conflict__Tidy(in_ECX + 0x48); *(undefined4 *)(in_ECX + 0x48) = *(undefined4 *)pcVar1; *(undefined4 *)(in_ECX + 0x4c) = *(undefined4 *)(param_1 + 0x4c); *(undefined4 *)(in_ECX + 0x50) = *(undefined4 *)(param_1 + 0x50); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; param_1[0x4c] = '\0'; param_1[0x4d] = '\0'; param_1[0x4e] = '\0'; param_1[0x4f] = '\0'; param_1[0x50] = '\0'; param_1[0x51] = '\0'; param_1[0x52] = '\0'; param_1[0x53] = '\0'; } pcVar1 = param_1 + 0x8c; *(undefined4 *)(in_ECX + 0x54) = *(undefined4 *)(param_1 + 0x54); *(undefined4 *)(in_ECX + 0x58) = *(undefined4 *)(param_1 + 0x58); *(undefined4 *)(in_ECX + 0x5c) = *(undefined4 *)(param_1 + 0x5c); *(undefined4 *)(in_ECX + 0x60) = *(undefined4 *)(param_1 + 0x60); *(undefined4 *)(in_ECX + 100) = *(undefined4 *)(param_1 + 100); *(undefined4 *)(in_ECX + 0x68) = *(undefined4 *)(param_1 + 0x68); in_ECX[0x6c] = param_1[0x6c]; *(undefined4 *)(in_ECX + 0x70) = *(undefined4 *)(param_1 + 0x70); in_ECX[0x74] = param_1[0x74]; *(undefined4 *)(in_ECX + 0x78) = *(undefined4 *)(param_1 + 0x78); in_ECX[0x7c] = param_1[0x7c]; in_ECX[0x7d] = param_1[0x7d]; in_ECX[0x7e] = param_1[0x7e]; in_ECX[0x7f] = param_1[0x7f]; *(undefined4 *)(in_ECX + 0x80) = *(undefined4 *)(param_1 + 0x80); *(undefined4 *)(in_ECX + 0x84) = *(undefined4 *)(param_1 + 0x84); *(undefined4 *)(in_ECX + 0x88) = *(undefined4 *)(param_1 + 0x88); if (in_ECX + 0x8c != pcVar1) { FID_conflict__Tidy(in_ECX + 0x8c); *(undefined4 *)(in_ECX + 0x8c) = *(undefined4 *)pcVar1; *(undefined4 *)(in_ECX + 0x90) = *(undefined4 *)(param_1 + 0x90); *(undefined4 *)(in_ECX + 0x94) = *(undefined4 *)(param_1 + 0x94); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; param_1[0x90] = '\0'; param_1[0x91] = '\0'; param_1[0x92] = '\0'; param_1[0x93] = '\0'; param_1[0x94] = '\0'; param_1[0x95] = '\0'; param_1[0x96] = '\0'; param_1[0x97] = '\0'; } pcVar6 = param_1 + 0x98; pcVar1 = in_ECX + 0x98; if (pcVar1 != pcVar6) { FID_conflict__Tidy(pcVar1); *(undefined4 *)pcVar1 = *(undefined4 *)pcVar6; *(undefined4 *)(in_ECX + 0x9c) = *(undefined4 *)(param_1 + 0x9c); *(undefined4 *)(in_ECX + 0xa0) = *(undefined4 *)(param_1 + 0xa0); pcVar6[0] = '\0'; pcVar6[1] = '\0'; pcVar6[2] = '\0'; pcVar6[3] = '\0'; param_1[0x9c] = '\0'; param_1[0x9d] = '\0'; param_1[0x9e] = '\0'; param_1[0x9f] = '\0'; param_1[0xa0] = '\0'; param_1[0xa1] = '\0'; param_1[0xa2] = '\0'; param_1[0xa3] = '\0'; } return; } //@@ 009586f0 string_table_translate /* DB: if text starts with '#' looks key up in string table (e.g. "#YOU_FEEL_BLESSED"), else returns as-is prototype: db/protos.zhl, confirmed by RET 8 */ byte * string_table_translate(StringTable *stringTable,byte *text) { StringTable *this; byte *category; char *pcVar1; int language; byte *pbVar2; byte *key; void *local_10; undefined1 *puStack_c; undefined4 local_8; pbVar2 = text; this = stringTable; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; if (*text != 0x23) { return text; } text = text + 1; ExceptionList = &local_10; category = path_join(text,(byte *)0x0,1,0); pcVar1 = strchr((char *)category,0x2f); stringTable = (StringTable *)((uint)stringTable & 0xffffff); if (pcVar1 == (char *)0x0) { language = *(int *)this; key = category; LAB_0095876e: StringTable::get_string(this,*(byte **)(this + 1),language,key,(byte *)((int)&stringTable + 3)); if (category == (byte *)0x0) goto LAB_009587a0; } else { *pcVar1 = '\0'; language = *(int *)this; key = (byte *)(pcVar1 + 1); if (category == (byte *)0x0) goto LAB_0095876e; StringTable::get_string (this,category,language,(byte *)(pcVar1 + 1),(byte *)((int)&stringTable + 3)); } local_8 = 0; tracked_alloc(1,category,0); local_8 = 0xffffffff; LAB_009587a0: if (stringTable._3_1_ == '\0') { pbVar2 = (byte *)StringTable::translate(text); ExceptionList = local_10; return pbVar2; } ExceptionList = local_10; return pbVar2; } //@@ 009587e0 FUN_009587e0 byte * FUN_009587e0(StringTable *param_1,byte *param_2,byte *param_3) { byte *key; byte *pbVar1; pbVar1 = param_3; if (*param_3 == 0x23) { key = param_3 + 1; param_3 = (byte *)((uint)param_3 & 0xffffff); StringTable::get_string(param_1,param_2,*(int *)param_1,key,(byte *)((int)¶m_3 + 3)); if (param_3._3_1_ == '\0') { param_3 = (byte *)((uint)param_3 & 0xffffff); pbVar1 = StringTable::get_string (param_1,param_2,*(int *)param_1,key,(byte *)((int)¶m_3 + 3)); return pbVar1; } } return pbVar1; } //@@ 00958840 FUN_00958840 byte * FUN_00958840(StringTable *param_1,byte *param_2,int param_3,byte *param_4) { byte *key; byte *pbVar1; pbVar1 = param_4; if (*param_4 == 0x23) { key = param_4 + 1; param_4 = (byte *)((uint)param_4 & 0xffffff); StringTable::get_string(param_1,param_2,param_3,key,(byte *)((int)¶m_4 + 3)); if (param_4._3_1_ == '\0') { param_4 = (byte *)((uint)param_4 & 0xffffff); pbVar1 = StringTable::get_string(param_1,param_2,param_3,key,(byte *)((int)¶m_4 + 3)); return pbVar1; } } return pbVar1; } //@@ 009588a0 Manager::LoadImage /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] static KAGE_SmartPointer_ImageBase* Manager::LoadImage(KAGE_SmartPointer_ImageBase* result, const char* path, KAGE_Graphics_ImageBase_VertexAttributeDescriptor* descriptor, bool unk); prototype: db/protos.zhl, confirmed by RET 8 */ void * Manager::LoadImage(void *outImage,byte *path) { byte bVar1; Manager *pMVar2; std_string *psVar3; byte *pbVar4; undefined4 extraout_ECX; void *ptr; undefined4 extraout_ECX_00; undefined4 uVar5; uint uVar6; std_string *local_44 [5]; uint local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar2 = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0c295; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)&local_2c + 0x28U; ExceptionList = &local_10; local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; pbVar4 = path; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign(local_2c._buf,path,(int)pbVar4 - (int)(path + 1)); local_8 = 1; ModManager::TryRedirectPath(&pMVar2->_modManager,(std_string *)local_44,&local_2c); local_8 = CONCAT31(local_8._1_3_,3); uVar5 = extraout_ECX; if (0xf < local_2c._capacity) { uVar6 = local_2c._capacity + 1; ptr = (void *)local_2c._buf._0_4_; if (0xfff < uVar6) { ptr = *(void **)(local_2c._buf._0_4_ + -4); uVar6 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)ptr))) goto LAB_00958992; } operator_delete(ptr,uVar6); uVar5 = extraout_ECX_00; } psVar3 = (std_string *)local_44; if (0xf < local_30) { psVar3 = local_44[0]; } KAGE_Graphics_ImageManager::load_image_file(outImage,psVar3,uVar5); if (0xf < local_30) { uVar6 = local_30 + 1; psVar3 = local_44[0]; if (0xfff < uVar6) { psVar3 = (std_string *)local_44[0][-1]._capacity; uVar6 = local_30 + 0x24; if (0x1f < (uint)((int)local_44[0] + (-4 - (int)psVar3))) { LAB_00958992: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar3,uVar6); } ExceptionList = local_10; return outImage; } //@@ 009589d0 Manager::queue_achievement_popup /* DB: pushes achievement id onto deque at g_Manager+0x21c20 (block size 4) when +0x2a378 enabled, then updates overlay (FUN_00931ba0); called right after PersistentGameData::UnlockSteamAchievement(0x184/0x144) in TryUnlock/TryAddBestiaryEncounter prototype: db/protos.zhl, confirmed by RET 4 */ void Manager::queue_achievement_popup(int achievementId) { uint *puVar1; int iVar2; uint uVar3; Manager *pMVar4; char cVar5; uint uVar6; void *pvVar7; uint uVar8; pMVar4 = g_manager; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (cVar5 = FUN_0091b510(), cVar5 == '\0')) { return; } if ((pMVar4->_optionsConfig)._popupsMode != 0) { uVar8 = (pMVar4->_achievementOverlay)._queue._size; uVar6 = (pMVar4->_achievementOverlay)._queue._offset; if (((uVar6 + uVar8 & 3) == 0) && ((pMVar4->_achievementOverlay)._queue._mapSize <= uVar8 + 4 >> 2)) { std::deque<4byte>::_Growmap(uVar8); uVar6 = (pMVar4->_achievementOverlay)._queue._offset; uVar8 = (pMVar4->_achievementOverlay)._queue._size; } uVar3 = (pMVar4->_achievementOverlay)._queue._mapSize; uVar6 = uVar3 * 4 - 1 & uVar6; (pMVar4->_achievementOverlay)._queue._offset = uVar6; uVar8 = uVar8 + uVar6; pvVar7 = (pMVar4->_achievementOverlay)._queue._map; uVar6 = uVar3 - 1 & uVar8 >> 2; iVar2 = uVar6 * 4; if (*(int *)((int)pvVar7 + uVar6 * 4) == 0) { pvVar7 = operator_new(0x10); *(void **)(iVar2 + (int)(pMVar4->_achievementOverlay)._queue._map) = pvVar7; pvVar7 = (pMVar4->_achievementOverlay)._queue._map; } *(int *)(*(int *)(iVar2 + (int)pvVar7) + (uVar8 & 3) * 4) = achievementId; puVar1 = &(pMVar4->_achievementOverlay)._queue._size; *puVar1 = *puVar1 + 1; AchievementOverlay::Update(&pMVar4->_achievementOverlay); } return; } //@@ 00958aa0 Manager::StartNewGame /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Manager::StartNewGame(int playerType, int challenge, Seeds unk, int difficulty); prototype: REPENTOGON, confirmed by RET 104 */ void __thiscall Manager::StartNewGame(Manager *this,int playerType,int challenge,Seeds unk,int difficulty) { Manager *pMVar1; Seeds *other; Seeds local_70; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; pMVar1 = g_manager; puStack_c = &LAB_00b0c2d5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_70)[1]._rng._shift2; ExceptionList = &local_10; local_8 = 0; g_manager->_startPlayerType = playerType; pMVar1->_startChallenge = challenge; pMVar1->_rerunAvailable = 0; pMVar1->_startingFromRerun = 0; pMVar1->_debugStart = 0; Seeds::construct_from_copy(&local_70,&unk); local_8 = CONCAT31(local_8._1_3_,1); Seeds::operator_assign(&pMVar1->_startSeeds,other); FID_conflict__Erase_tree_>_> (&local_70._seedEffects, (fuzzer_allocator_> *)&local_70._seedEffects, *(_Tree_node **)((int)local_70._seedEffects + 4)); operator_delete(local_70._seedEffects,0x14); pMVar1->_startDifficulty = difficulty; (pMVar1->_dailyChallenge)._id = 0; (pMVar1->_dailyChallenge)._seed = 0; (pMVar1->_dailyChallenge)._specialDailyId = 0; (pMVar1->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&(pMVar1->_dailyChallenge)._params); pMVar1->_starting = 1; pMVar1->_networkPlay = 0; pMVar1->_consecutiveResetCount = 0; FID_conflict__Erase_tree_>_> (&unk._seedEffects, (fuzzer_allocator_> *)&unk._seedEffects, *(_Tree_node **)((int)unk._seedEffects + 4)); operator_delete(unk._seedEffects,0x14); ExceptionList = local_10; return; } //@@ 00958bc0 get_server_time /* DB: Steam ISteamUtils (SteamInternal_ContextInit vfunc +0xc, GetServerRealTime) or 1, _gmtime64 into a tm-like struct, hour -10; daily challenge date prototype: db/protos.zhl, confirmed by RET 4 */ void * get_server_time(void *outTime) { int iVar1; int iVar2; int iVar3; int *piVar4; undefined4 uVar5; undefined4 *puVar6; tm *ptVar7; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); if (*piVar4 == 0) { uVar5 = 1; } else { puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); uVar5 = (**(code **)(*(int *)*puVar6 + 0xc))(); } *(undefined4 *)((int)outTime + 8) = uVar5; *(undefined1 *)outTime = 1; *(undefined4 *)((int)outTime + 0xc) = 0; ptVar7 = _gmtime64((__time64_t *)((int)outTime + 8)); iVar1 = ptVar7->tm_min; iVar2 = ptVar7->tm_hour; iVar3 = ptVar7->tm_mday; *(int *)((int)outTime + 0x10) = ptVar7->tm_sec; *(int *)((int)outTime + 0x14) = iVar1; *(int *)((int)outTime + 0x18) = iVar2; *(int *)((int)outTime + 0x1c) = iVar3; iVar1 = ptVar7->tm_year; iVar2 = ptVar7->tm_wday; iVar3 = ptVar7->tm_yday; *(int *)((int)outTime + 0x20) = ptVar7->tm_mon; *(int *)((int)outTime + 0x24) = iVar1; *(int *)((int)outTime + 0x28) = iVar2; *(int *)((int)outTime + 0x2c) = iVar3; *(int *)((int)outTime + 0x30) = ptVar7->tm_isdst; *(int *)((int)outTime + 0x18) = *(int *)((int)outTime + 0x18) + -10; *(byte *)outTime = *(byte *)outTime & 0xfe | 2; return outTime; } //@@ 00958c40 daily_challenge_refresh /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: DailyChallenge::Init(Manager+0x4b1c0, date from get_server_time 00958bc0); Menu_OnlineLobby::Update when the daily id changed, daily menus 008cf610/008d0ea0 prototype: db/protos.zhl */ void __cdecl daily_challenge_refresh(void) { Manager *pMVar1; undefined4 *puVar2; uint dailyDate; undefined1 auStack_4c [4]; undefined1 local_48 [60]; uint local_c; pMVar1 = g_manager; local_c = __security_cookie ^ (uint)auStack_4c; puVar2 = get_server_time(local_48); dailyDate = date_to_yyyymmdd((byte)*puVar2,puVar2[1],*(longlong *)(puVar2 + 2),puVar2[4],puVar2[5] ,puVar2[6],puVar2[7],puVar2[8],puVar2[9],puVar2[10],puVar2[0xb], (int)*(undefined8 *)(puVar2 + 0xc)); DailyChallenge::Init(&pMVar1->_dailyChallenge,dailyDate); return; } //@@ 00958cb0 Manager::RestartGame /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static void Manager::RestartGame(Seeds seeds, bool clearSeedEffects, bool progresScaredHeart); */ void Manager::RestartGame(void) { void *pvVar1; Game *pGVar2; Manager *pMVar3; Seeds *other; uint seed; void **this; Seeds SStack00000004; char in_stack_00000060; char in_stack_00000064; Seeds local_70; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; pMVar3 = g_manager; puStack_c = &LAB_00b0c315; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_70)[1]._rng._shift2; ExceptionList = &local_10; local_8 = 0; if (g_game == (Game *)0x0) { KAGE_LogMessage(0x10,(byte *)"Game must not be NULL"); } Seeds::construct_from_copy(&local_70,&SStack00000004); local_8._0_1_ = 1; Seeds::operator_assign(&pMVar3->_startSeeds,other); local_8 = (uint)local_8._1_3_ << 8; FID_conflict__Erase_tree_>_> (&local_70._seedEffects, (fuzzer_allocator_> *)&local_70._seedEffects, *(_Tree_node **)((int)local_70._seedEffects + 4)); operator_delete(local_70._seedEffects,0x14); if (((pMVar3->_startSeeds)._isCustomRun == 0) || (g_game->_challenge != 0)) { seed = 0; } else { seed = (pMVar3->_startSeeds)._gameStartSeed; } Seeds::set_start_seed(&pMVar3->_startSeeds,seed); pGVar2 = g_game; if ((in_stack_00000060 != '\0') && (g_game != (Game *)0x0)) { pvVar1 = (g_game->_seedEffects)._seedEffects; this = &(g_game->_seedEffects)._seedEffects; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; (pGVar2->_seedEffects)._seedEffectsCount = 0; } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pMVar3->_starting = 1; } else { NetplayManager::process_pending_joins(1); } *(undefined2 *)&pMVar3->_isSaveOnExit = 0; if (in_stack_00000064 == '\0') { pMVar3->_consecutiveResetCount = 0; } else { pMVar3->_consecutiveResetCount = pMVar3->_consecutiveResetCount + 1; if (6 < pMVar3->_consecutiveResetCount) { PersistentGameData::TryUnlock(&pMVar3->_persistentGameData,0x148); } } (pMVar3->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (pMVar3->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; PersistentGameData::set_run_mask(0,0); FID_conflict__Erase_tree_>_> ((undefined4 *)((int)register0x00000010 + 0x58), (fuzzer_allocator_> *) ((int)register0x00000010 + 0x58), *(_Tree_node **)((int)SStack00000004._seedEffects + 4)); operator_delete(SStack00000004._seedEffects,0x14); ExceptionList = local_10; return; } //@@ 00958e60 Manager::ShowCutscene /* ZHL [exact] __thiscall void Manager::ShowCutscene(uint32_t cutsceneID, bool shouldCleanup, unsigned int UNKNOWN); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall Manager::ShowCutscene(Manager *this,uint cutsceneID,byte shouldCleanup,uint UNKNOWN) { int *piVar1; Manager *pMVar2; pMVar2 = g_manager; if (0x1a < cutsceneID) { KAGE_LogMessage(8,(byte *)"Invalid cutscene ID \"%d\" \n"); return; } piVar1 = (g_manager->_persistentGameData)._cutsceneCounters + cutsceneID; *piVar1 = *piVar1 + 1; *(undefined1 *)&pMVar2->_persistentGameData = 1; if (cutsceneID != 1) { piVar1 = (pMVar2->_persistentGameData)._cutsceneCounters + 2; *piVar1 = *piVar1 + 1; *(undefined1 *)&pMVar2->_persistentGameData = 1; } (pMVar2->_cutsceneManager)._isQueuedCleanup = shouldCleanup; (pMVar2->_cutsceneManager).field_0x848 = 1; pMVar2->_cutsceneNextMenuState = UNKNOWN; (pMVar2->_cutsceneManager)._queuedCutsceneId = cutsceneID; (pMVar2->_achievementOverlay)._isPopupBlocked = 1; return; } //@@ 00958ed0 Manager::save_game_state /* DB: "[warn] Cannot save game state while not in game.", "[warn] GameState::Save: no filename specified."; Game::store_game_state into Manager+0xfa4 (GameState), GameState::DeleteRerun, SaveDataManager::open_file_write (or Steam cloud FUN_009cad40), then Manager::BackupSaveFile + PersistentGameData::Save/SaveToSteamCloud; callers Game::Exit and StageTransition::Update */ void Manager::save_game_state(void) { GameState *state; Game *this; Manager *pMVar1; undefined1 uVar2; char isFileOpen; Entity_Player *player; int iVar3; int *piVar4; byte *path; undefined1 *saveFileName; void *saveWriter; undefined1 *writerFileName; undefined4 local_1c; undefined4 local_18; undefined1 local_14; undefined4 local_10; undefined4 local_c; int *saveFile; Manager *manager; undefined4 *oldSaveFile; manager = g_manager; if (g_manager->_state != 2) { KAGE_LogMessage(1,(byte *)"[warn] Cannot save game state while not in game.\n"); return; } if (((g_game->_dailyChallenge)._id == 0) && (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) { player = Game::GetPlayer(g_game,0); if (player->_dead != 0) { player = Game::GetPlayer(g_game,0); iVar3 = Entity_Player::GetExtraLives(player); if (iVar3 < 1) { return; } } this = g_game; state = &manager->_gamestate; manager->_isSavingGameState = 1; Game::store_game_state(this,state); *(int *)&(manager->_gamestate).field_0x19d70 = manager->_startPlayerType; uVar2 = FUN_008f8cd0(); (manager->_gamestate).field_0x19d74 = uVar2; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar4 == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) { if (*(int *)&(manager->_gamestate).field_0x1fdbc == 0) { KAGE_LogMessage(1,(byte *)"[warn] GameState::Save: no filename specified.\n"); } else { GameState::DeleteRerun(state); oldSaveFile = (manager->_gamestate)._saveFile; if (oldSaveFile != (undefined4 *)0x0) { (**(code **)*oldSaveFile)(1); } saveFileName = &(manager->_gamestate).field_0x1fdac; path = saveFileName; if (0xf < *(uint *)&(manager->_gamestate).field_0x1fdc0) { path = *(byte **)saveFileName; } saveFile = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,path,0); (manager->_gamestate)._saveFile = saveFile; if (saveFile != (int *)0x0) { isFileOpen = (**(code **)(*saveFile + 0x30))(); if ((isFileOpen != '\0') && (iVar3 = _fileno((FILE *)saveFile[3]), -1 < iVar3)) { flock(iVar3,2); } if (0xf < *(uint *)&(manager->_gamestate).field_0x1fdc0) { saveFileName = *(undefined1 **)saveFileName; } saveWriter = (manager->_gamestate)._saveFile; local_1c = 0; local_c = 1; local_18 = 0; local_14 = 0; local_10 = 0xfedcba76; writerFileName = saveFileName; GameState::write(state,&saveWriter); piVar4 = (manager->_gamestate)._saveFile; isFileOpen = (**(code **)(*piVar4 + 0x30))(); if ((isFileOpen != '\0') && (iVar3 = _fileno((FILE *)piVar4[3]), -1 < iVar3)) { flock(iVar3,8); } (**(code **)(*(int *)(manager->_gamestate)._saveFile + 0x34))(); } } } else { FUN_009cad40(); } *(undefined4 *)&(manager->_persistentGameData).field_0xf84 = *(undefined4 *)&(manager->_gamestate).field_0x1fda4; *(undefined1 *)&manager->_persistentGameData = 1; if ((manager->_persistentGameData)._isFileLoaded != 0) { *(undefined1 *)&manager->_persistentGameData = 0; BackupSaveFile((Manager *)&manager->_persistentGameData); pMVar1 = g_manager; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar4 != 0) && ((pMVar1->_optionsConfig)._enableSteamCloud != 0)) { PersistentGameData::SaveToSteamCloud(&manager->_persistentGameData); manager->_isSavingGameState = 0; return; } PersistentGameData::Save(&manager->_persistentGameData); } manager->_isSavingGameState = 0; } return; } //@@ 00959130 Game::DeleteSaveState /* DB: non-netplay: GameState::Delete(manager+0xfa4), clears flag; called from End/Exit/FinishChallenge prototype: db/protos.zhl */ void __cdecl Game::DeleteSaveState(void) { Manager *pMVar1; pMVar1 = g_manager; if (((g_game->_dailyChallenge)._id == 0) && (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) { GameState::Delete(&g_manager->_gamestate); *(undefined4 *)&(pMVar1->_persistentGameData).field_0xf84 = 0; *(undefined1 *)&pMVar1->_persistentGameData = 1; pMVar1->_isSaveOnExit = 0; } return; } //@@ 00959180 save_rerun_to_steam_cloud /* DB: Game::End callee: GameState::write_rerun (Manager+0xfa4), "[warn] GameState::SaveRerunToSteamCloud could not open %s for writing", "[warn] GameState::Save: no filename specified", GetExtraLives */ void save_rerun_to_steam_cloud(void) { qword qVar1; Game *pGVar2; Manager *pMVar3; undefined1 uVar4; char cVar5; Entity_Player *this; int iVar6; int *piVar7; undefined4 *puVar8; undefined1 *puVar9; byte *path; undefined4 *puVar10; qword *pqVar11; undefined1 *puVar12; void *pvStack_24; undefined1 *puStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined1 uStack_14; undefined4 uStack_10; undefined4 uStack_c; pMVar3 = g_manager; pGVar2 = g_game; piVar7 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar7 = (pGVar2->_playerManager)._playerList._begin; } if (*(char *)(*piVar7 + 0x173) != '\0') { this = Game::GetPlayer(g_game,0); iVar6 = Entity_Player::GetExtraLives(this); if (iVar6 < 1) { return; } } if ((((pMVar3->_persistentGameData)._achievements[0x151] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) || (pMVar3->_netplayManager != *(NetplayManager *)(pMVar3 + 1))) { return; } Game::store_game_state(g_game,&pMVar3->_gamestate); if ((pMVar3->_gamestate).field_0x4 != '\0') { return; } uVar4 = FUN_008f8cd0(); (pMVar3->_gamestate).field_0x19d74 = uVar4; piVar7 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar7 == 0) || ((pMVar3->_optionsConfig)._enableSteamCloud == 0)) { if (*(int *)&(pMVar3->_gamestate).field_0x1fdd4 == 0) { KAGE_LogMessage(1,(byte *)"[warn] GameState::Save: no filename specified.\n"); return; } puVar8 = (pMVar3->_gamestate)._saveFile; if (puVar8 != (undefined4 *)0x0) { (**(code **)*puVar8)(1); (pMVar3->_gamestate)._saveFile = (void *)0x0; } puVar12 = &(pMVar3->_gamestate).field_0x1fdc4; path = puVar12; if (0xf < *(uint *)&(pMVar3->_gamestate).field_0x1fdd8) { path = *(byte **)puVar12; } piVar7 = SaveDataManager::open_file_write(&PTR_vftable_00c5aa80,path,0); (pMVar3->_gamestate)._saveFile = piVar7; if (piVar7 == (int *)0x0) { return; } cVar5 = (**(code **)(*piVar7 + 0x30))(); if ((cVar5 != '\0') && (iVar6 = _fileno((FILE *)piVar7[3]), -1 < iVar6)) { flock(iVar6,2); } if (0xf < *(uint *)&(pMVar3->_gamestate).field_0x1fdd8) { puVar12 = *(undefined1 **)puVar12; } pvStack_24 = (pMVar3->_gamestate)._saveFile; uStack_1c = 0; uStack_c = 1; uStack_18 = 0; uStack_14 = 0; uStack_10 = 0xfedcba76; puStack_20 = puVar12; GameState::write_rerun(&pMVar3->_gamestate,&pvStack_24); piVar7 = (pMVar3->_gamestate)._saveFile; cVar5 = (**(code **)(*piVar7 + 0x30))(); if ((cVar5 != '\0') && (iVar6 = _fileno((FILE *)piVar7[3]), -1 < iVar6)) { flock(iVar6,8); } (**(code **)(*(int *)(pMVar3->_gamestate)._saveFile + 0x34))(); return; } puVar8 = (pMVar3->_gamestate)._saveFile; if (puVar8 != (undefined4 *)0x0) { (**(code **)*puVar8)(1); } if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } puVar8 = malloc(0x28); if (puVar8 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 + 0x28; puVar10 = puVar8 + 1; *puVar8 = 0x28; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) + (uint)(0xffffffd7 < (uint)qVar1); if (puVar10 != (undefined4 *)0x0) { puVar8[2] = 2; puVar8[3] = 0; *puVar10 = IsaacRepentancePlus::SteamCloudFile::vftable; puVar8[5] = 0; puVar8[7] = 0; puVar8[8] = 0; *(undefined2 *)(puVar8 + 9) = 0; goto LAB_009592d3; } } puVar10 = (undefined4 *)0x0; LAB_009592d3: puVar12 = &(pMVar3->_gamestate).field_0x1fe0c; (pMVar3->_gamestate)._saveFile = puVar10; puVar9 = puVar12; if (0xf < *(uint *)&(pMVar3->_gamestate).field_0x1fe20) { puVar9 = *(undefined1 **)puVar12; } cVar5 = FUN_00683930(puVar9,0x100000); if ((cVar5 == '\0') || (cVar5 = (**(code **)(*(int *)(pMVar3->_gamestate)._saveFile + 0x30))(), cVar5 == '\0')) { KAGE_LogMessage(1,(byte *) "[warn] GameState::SaveRerunToSteamCloud could not open %s for writing.\n"); (**(code **)(*(int *)(pMVar3->_gamestate)._saveFile + 0x34))(); return; } if (0xf < *(uint *)&(pMVar3->_gamestate).field_0x1fe20) { puVar12 = *(undefined1 **)puVar12; } pvStack_24 = (pMVar3->_gamestate)._saveFile; uStack_1c = 0; uStack_c = 1; uStack_18 = 0; uStack_14 = 0; uStack_10 = 0xfedcba76; puStack_20 = puVar12; GameState::write_rerun(&pMVar3->_gamestate,&pvStack_24); (**(code **)(*(int *)(pMVar3->_gamestate)._saveFile + 0x34))(); return; } //@@ 00959500 FUN_00959500 void FUN_00959500(void) { Entity_Player *pEVar1; int iVar2; int in_ECX; int *piVar3; int iVar4; int iVar5; undefined4 local_1c; undefined4 local_18; undefined8 local_14; uint local_8; iVar2 = *(int *)(in_ECX + 0x4b278); iVar4 = *(int *)(in_ECX + 0x4b27c) - iVar2; local_8 = 0; iVar5 = iVar4 >> 0x1f; if (iVar4 / 0x14 + iVar5 != iVar5) { iVar5 = 0; do { iVar2 = *(int *)(iVar5 + 4 + iVar2); if (iVar2 == 0) { local_14 = 0; local_14._4_4_ = 0; local_14._0_4_ = 0; local_18 = local_14._4_4_; local_1c = (undefined4)local_14; } else { local_18 = *(undefined4 *)(iVar2 + 0xc); local_1c = *(undefined4 *)(iVar2 + 8); } pEVar1 = PlayerManager::get_player_by_user_id ((PlayerManager *)(in_ECX + 0x4b3d8),(ulonglong *)&local_1c); iVar2 = 0; piVar3 = (int *)&(g_game->_playerManager).field_0x60; do { if ((void *)*piVar3 == (pEVar1->_damageEvents)._end) goto LAB_00959592; iVar2 = iVar2 + 1; piVar3 = piVar3 + 1; } while (iVar2 < 4); iVar2 = 5; LAB_00959592: local_8 = local_8 + 1; *(int *)(iVar5 + 0x10 + *(int *)(in_ECX + 0x4b278)) = iVar2; iVar5 = iVar5 + 0x14; iVar2 = *(int *)(in_ECX + 0x4b278); } while (local_8 < (uint)((*(int *)(in_ECX + 0x4b27c) - iVar2) / 0x14)); } return; } //@@ 009595e0 Manager::IsGameplayInputActive /* DB: ? Manager state checks (pause/menus), callers Game::Start, AddCharmed prototype: db/protos.zhl, confirmed by RET 4 */ byte Manager::IsGameplayInputActive(int unusedArg) { Manager *pMVar1; char cVar2; byte bVar3; pMVar1 = g_manager; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) || ((g_manager->_starting != 0 && (g_manager->_networkPlay != 0)))) { bVar3 = FUN_0091b510(); return bVar3 ^ 1; } cVar2 = FUN_008f8cd0(); if ((((cVar2 == '\0') && ((pMVar1->_optionsConfig)._enableDebugConsole == 0)) || ((pMVar1->_persistentGameData)._achievements[4] != 0)) || (((pMVar1->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { return 0; } return 1; } //@@ 00959670 Manager::unload_state /* DB: state +8 == 1: MenuManager destructor + delete g_menuManager; == 2: Game::Exit, resets SFX volume modifier; then TextureCache::Purge; Manager::Update and the two start_pending helpers prototype: db/protos.zhl */ void __thiscall Manager::unload_state(Manager *this) { MenuManager *ptr; ptr = g_menuManager; if (this->_state == 1) { if (g_menuManager != (MenuManager *)0x0) { MenuManager::~MenuManager(); operator_delete(ptr,0xf930); g_menuManager = (MenuManager *)0x0; } } else if (this->_state == 2) { if (g_game != (Game *)0x0) { Game::Exit(this->_isSaveOnExit); this->field_0x4b285 = 0; if ((this->_sfxManager)._volumeModifier != 1.0) { (this->_sfxManager)._volumeModifier = 1.0; SoundEffects::ClearVolumeModifier(&this->_sfxManager); } (this->_sfxManager)._volumeModifierStep = 0.005; } FUN_00429170(); TextureCache::Purge(); return; } TextureCache::Purge(); return; } //@@ 00959720 Manager::start_pending_game /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Manager::Update when +0x4b130 set (and netplay ready): Manager::unload_state then creates g_game (operator_new Game) and starts the run */ void Manager::start_pending_game(void) { undefined1 *this; HUD *this_00; int *piVar1; int iVar2; char cVar3; byte bVar4; Game *pGVar5; Game *extraout_EAX; int iVar6; Seeds *other; Seeds *other_00; uint uVar7; byte bVar8; Manager *in_ECX; void *pvVar9; NetplayManager *this_01; Manager *pMVar10; undefined1 auStack_174 [56]; int iStack_13c; int iStack_138; int iStack_134; char acStack_12c [8]; int iStack_124; void *pvStack_120; KColor local_100; undefined8 local_ec; void *local_e4; Manager *local_e0; void *local_d8; Seeds local_d4; Seeds local_74; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c36d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_74)[1]._rng._shift3; ExceptionList = &local_10; if ((in_ECX->_starting != 0) && ((local_e0 = in_ECX, in_ECX->_networkPlay == 0 || (cVar3 = FUN_0090c400(), cVar3 != '\0')))) { if ((in_ECX->_framecount & 1U) != 0) { in_ECX->_framecount = in_ECX->_framecount + 1; } unload_state(in_ECX); if (g_game == (Game *)0x0) { pGVar5 = operator_new(0x68e88); local_ec = CONCAT44(pGVar5,(void *)local_ec); local_8 = 0; if (pGVar5 == (Game *)0x0) { g_game = (Game *)0x0; } else { Game::constructor(pGVar5); g_game = extraout_EAX; } local_8 = 0xffffffff; Game::LoadConfigXmls(); } this_01 = &in_ECX->_netplayManager; if (in_ECX->_netplayManager != *(NetplayManager *)(in_ECX + 1)) { NetplayManager::reset(&g_manager->_netplayManager,0); } pMVar10 = g_manager; if (in_ECX->_networkPlay != 0) { *(undefined4 *)&g_manager[1]._gamestate.field_0x2e0 = 0; this = &pMVar10[1]._gamestate.field_0x288; *(undefined4 *)&pMVar10[1]._gamestate.field_0x2dc = 0; piVar1 = *(int **)&pMVar10[1]._gamestate.field_0x288; local_d8 = (void *)*piVar1; if (local_d8 != piVar1) { do { pvVar9 = local_d8; iVar6 = *(int *)((int)local_d8 + 0x20); if ((iVar6 == 0) || (*(int *)(iVar6 + 8) == 0 && *(int *)(iVar6 + 0xc) == 0)) { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_d8); pvVar9 = std::_Tree::_Extract(this,pvVar9); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); *(undefined ***)((int)pvVar9 + 0x1c) = KAGE::System::UserProfileBase::vftable; pvStack_120 = (void *)0x95989c; operator_delete(pvVar9,0x48); } else { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_d8); } } while (local_d8 != *(void **)this); in_ECX = local_e0; } pvVar9 = (in_ECX->_lobbyMembers)._begin; if (pvVar9 != (in_ECX->_lobbyMembers)._end) { do { if ((*(int *)((int)pvVar9 + 0xc) == 9) || (*(int *)((int)pvVar9 + 0xc) == 0x1e)) { iVar6 = *(int *)((int)pvVar9 + 4); if (iVar6 == 0) { local_ec = 0; local_ec._4_4_ = (Manager *)0x0; local_ec._0_4_ = (void *)0x0; local_e4 = (void *)local_ec; pMVar10 = local_ec._4_4_; } else { local_e4 = *(void **)(iVar6 + 8); pMVar10 = *(Manager **)(iVar6 + 0xc); } pvStack_120 = (void *)0x959929; local_e0 = pMVar10; local_d8 = local_e4; FUN_00731ee0(); if ((((*(char *)(local_100._unk + 0xd) == '\0') && (*(Manager **)(local_100._unk + 0x14) <= pMVar10)) && ((*(Manager **)(local_100._unk + 0x14) < pMVar10 || (*(void **)(local_100._unk + 0x10) <= local_d8)))) && (((local_100._unk != *(int *)&in_ECX[1]._gamestate.field_0xc0 && (iVar6 = FUN_00914150(), iVar6 != 0)) && (*(int *)(iVar6 + 0x310) == 0)))) { *(undefined4 *)((int)pvVar9 + 0xc) = 0; } } pvVar9 = (void *)((int)pvVar9 + 0x14); } while (pvVar9 != (in_ECX->_lobbyMembers)._end); } this_01 = &in_ECX->_netplayManager; if (((in_ECX->_networkPlay != 0) && ((in_ECX->_startSeeds)._gameStartSeed != 0)) && (in_ECX[1]._state == 0)) { FUN_006eef20(); online_session_reset(); } } bVar8 = in_ECX->_networkPlay; in_ECX->_state = 2; if ((bVar8 == 0) || (bVar4 = in_ECX->_rerunAvailable, bVar4 == 0)) { FUN_00923450(); bVar8 = in_ECX->_networkPlay; bVar4 = in_ECX->_rerunAvailable; } pGVar5 = g_game; if (bVar8 == 0) { if (bVar4 == 0) { if (in_ECX->_startingFromRerun == 0) { if ((in_ECX->_dailyChallenge)._id == 0) { local_e0 = (Manager *)in_ECX->_startDifficulty; if (in_ECX->_debugStart == 0) { Seeds::construct_from_copy((Seeds *)auStack_174,&in_ECX->_startSeeds); Game::Start(); } else { iVar6 = *(int *)&in_ECX->field_0x4b1a4; iVar2 = *(int *)&in_ECX->field_0x4b1a0; iStack_134 = 0x959c77; std::string::string(acStack_12c,&in_ECX->field_0x4b1a8); iStack_13c = 0x959c84; iStack_138 = iVar2; iStack_134 = iVar6; Game::StartDebug(); } } else { in_ECX->_startPlayerType = (in_ECX->_dailyChallenge)._params._playerType; Game::StartDailyChallenge(); } } else { in_ECX->_startPlayerType = *(int *)&(in_ECX->_gamestate).field_0x19d70; in_ECX->_startChallenge = *(int *)&in_ECX->_gamestate; in_ECX->_startDifficulty = *(int *)&(in_ECX->_gamestate).field_0x8; in_ECX->_startingFromRerun = 0; Seeds::construct_from_copy(&local_d4,(Seeds *)&(in_ECX->_gamestate).field_0x1e724); local_8 = 2; Seeds::operator_assign(&in_ECX->_startSeeds,other_00); local_8 = 0xffffffff; pvStack_120 = (void *)0x959c0a; FID_conflict__Erase_tree_>_> (&local_d4._seedEffects, (fuzzer_allocator_> *) &local_d4._seedEffects, *(_Tree_node **)((int)local_d4._seedEffects + 4)); pvStack_120 = (void *)0x959c14; operator_delete(local_d4._seedEffects,0x14); Game::StartFromRerunState(); } } else { in_ECX->_startPlayerType = *(int *)&(in_ECX->_gamestate).field_0x19d70; in_ECX->_startChallenge = *(int *)&in_ECX->_gamestate; in_ECX->_startDifficulty = *(int *)&(in_ECX->_gamestate).field_0x8; in_ECX->_rerunAvailable = 0; Seeds::construct_from_copy(&local_74,(Seeds *)&(in_ECX->_gamestate).field_0x1e724); local_8 = 1; Seeds::operator_assign(&in_ECX->_startSeeds,other); local_8 = 0xffffffff; pvStack_120 = (void *)0x959af0; FID_conflict__Erase_tree_>_> (&local_74._seedEffects, (fuzzer_allocator_> *)&local_74._seedEffects, *(_Tree_node **)((int)local_74._seedEffects + 4)); pvStack_120 = (void *)0x959afa; operator_delete(local_74._seedEffects,0x14); pGVar5 = g_game; this_00 = &g_game->_hud; g_game->_isStarted = 1; pGVar5->_isStartingFromState = 1; HUD::LoadGraphics(this_00); pvStack_120 = (void *)0x959b26; Game::restore_game_state(pGVar5,&in_ECX->_gamestate,1); PlayerManager::restore_controller_assignment(&pGVar5->_playerManager); PlayerManager::enter_level(&pGVar5->_playerManager); PlayerManager::trigger_new_room_effects(&pGVar5->_playerManager); Room::Update(); KColor::SetFromARGB(&local_100,0xff000000); pvStack_120 = (void *)0x3d23d70a; iStack_124 = 0x959b76; Game::Fadein(pGVar5); pGVar5->_framesSinceRoomTransition = 0; LuaEngine::PostGameStart(1); pGVar5->_isStartingFromState = 0; } } else { if (bVar4 == 0) { FUN_00429170(); NetplayManager::reset(this_01,0); } else { in_ECX->_rerunAvailable = 0; *(undefined4 *)&pGVar5->_stageTransition = 2; (pGVar5->_stageTransition)._duration = 0x32; (pGVar5->_stageTransition)._frame = 0x31; pGVar5->field_0x1ba84 = 0; } iVar6 = in_ECX->_startChallenge; Seeds::construct_from_copy((Seeds *)(auStack_174 + -4),&in_ECX->_startSeeds); FUN_006f5850(&in_ECX->_lobbyMembers,&in_ECX->_dailyChallenge,iVar6); FUN_00959500(); } uVar7 = in_ECX->_framecount & 0x80000001; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffe) + 1; } if (uVar7 == 1) { in_ECX->_framecount = in_ECX->_framecount + 1; } in_ECX->_starting = 0; *(undefined2 *)&in_ECX->_isSaveOnExit = 1; } ExceptionList = local_10; return; } //@@ 00959d00 Manager::start_pending_menu /* DB: ? Manager::Update when +0x4b288 set: netplay teardown (NetplayManager::reset, netplay_leave_lobby), Manager::unload_state, online_session_reset, state 1, creates/Inits g_menuManager (0xf930) and MenuManager::SetState(+0x4b28c) */ void __thiscall Manager::start_pending_menu(Manager *this) { float fVar1; float fVar2; float fVar3; MenuManager *pMVar4; MenuManager *extraout_EAX; int iVar5; int unused2; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c3b7; local_10 = ExceptionList; ExceptionList = &local_10; if (this->_isMenuPending != 0) { if ((this->_state == 2) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) { if ((g_game->_challenge != 0) || (local_14 = 1, (g_game->_dailyChallenge)._id != 0)) { local_14 = 0; } FUN_0090cd10(0,local_14,__security_cookie ^ (int)register0x00000010 - 4U); unused2 = 1; iVar5 = 0x959d8c; NetplayManager::reset(&this->_netplayManager,1); if (this->_pendingMenuState != 0x11) { netplay_leave_lobby(&this->_netplayManager,iVar5,unused2); } } unload_state(this); online_session_reset(); pMVar4 = g_menuManager; this->_state = 1; if (pMVar4 == (MenuManager *)0x0) { pMVar4 = operator_new(0xf930); local_8 = 0; if (pMVar4 == (MenuManager *)0x0) { g_menuManager = (MenuManager *)0x0; } else { MenuManager::constructor(pMVar4); g_menuManager = extraout_EAX; } local_8 = 0xffffffff; MenuManager::Init(g_menuManager); pMVar4 = g_menuManager; } MenuManager::SetState(pMVar4,this->_pendingMenuState,1); pMVar4 = g_menuManager; fVar1 = (this->_pendingMenuFadeColor)._green; fVar2 = (this->_pendingMenuFadeColor)._blue; fVar3 = (this->_pendingMenuFadeColor)._alpha; iVar5 = (this->_pendingMenuFadeColor)._unk; (g_menuManager->_fadeInColor)._red = (this->_pendingMenuFadeColor)._red; (pMVar4->_fadeInColor)._green = fVar1; (pMVar4->_fadeInColor)._blue = fVar2; (pMVar4->_fadeInColor)._alpha = fVar3; (pMVar4->_fadeInColor)._unk = iVar5; pMVar4->_fadeInActive = 1; this->_isMenuPending = 0; } ExceptionList = local_10; return; } //@@ 00959e70 Manager::SetSaveSlot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void Manager::SetSaveSlot(unsigned int slot); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Manager::SetSaveSlot(Manager *this,uint slot) { byte bVar1; char cVar2; int *piVar3; byte *pbVar4; byte abStack_410 [1028]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); PersistentGameData::Clear(&this->_persistentGameData,1); if (slot != 0) { piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar3 == 0) || ((this->_optionsConfig)._enableSteamCloud == 0)) { KAGE_LogMessage(1,(byte *)"Loading PersistentData %d from local folder!\n"); sprintf_s(abStack_410,0x400,(byte *)"%spersistentgamedata%d.dat"); cVar2 = PersistentGameData::Load(&this->_persistentGameData,abStack_410); } else { KAGE_LogMessage(1,(byte *)"Loading PersistentData %d from SteamCloud!\n"); sprintf_s(abStack_410,0x400,(byte *)"rep+persistentgamedata%d.dat"); pbVar4 = abStack_410; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign(&(this->_persistentGameData).field_0x20,abStack_410, (int)pbVar4 - (int)(abStack_410 + 1)); cVar2 = PersistentGameData::LoadFromSteamCloud(); } if (cVar2 == '\0') { GameState::Clear(&this->_gamestate); KAGE_LogMessage(1,(byte *)"Cannot load GameState if PersistentData is missing!\n"); } else { (g_manager->_optionsConfig)._tryImportSave = 0; FUN_00959fa0(slot); } } this->_currentSaveSlot = slot; return; } //@@ 00959fa0 FUN_00959fa0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00959fa0(void) { byte bVar1; char cVar2; int *piVar3; int iVar4; int in_ECX; byte *pbVar5; byte *pbVar6; undefined1 auStack_434 [7]; byte bStack_42d; void *pvStack_42c; byte *pbStack_428; undefined4 uStack_424; undefined4 uStack_420; undefined1 uStack_41c; undefined4 uStack_418; undefined4 uStack_414; byte abStack_410 [1028]; uint local_c; local_c = __security_cookie ^ (uint)auStack_434; GameState::Clear((GameState *)(in_ECX + 0xfa4)); piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar3 == 0) || (*(char *)(in_ECX + 0x2a3a4) == '\0')) { KAGE_LogMessage(1,(byte *)"Loading GameState %d from local folder!\n"); sprintf_s(abStack_410,0x400,(byte *)"%sgamestate%d.dat"); pbVar5 = abStack_410; *(undefined1 *)(in_ECX + 0x20d90) = 0; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); pbVar6 = (byte *)(in_ECX + 0x20d50); std::string::assign((char *)pbVar6,abStack_410,(int)pbVar5 - (int)(abStack_410 + 1)); if (*(undefined4 **)(in_ECX + 0x20dc8) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 0x20dc8))(1); } pbVar5 = pbVar6; if (0xf < *(uint *)(in_ECX + 0x20d64)) { pbVar5 = *(byte **)pbVar6; } piVar3 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,pbVar5); *(int **)(in_ECX + 0x20dc8) = piVar3; if (piVar3 != (int *)0x0) { cVar2 = (**(code **)(*piVar3 + 0x30))(); if ((cVar2 != '\0') && (iVar4 = _fileno((FILE *)piVar3[3]), -1 < iVar4)) { flock(iVar4,1); } if (0xf < *(uint *)(in_ECX + 0x20d64)) { pbVar6 = *(byte **)pbVar6; } pvStack_42c = *(void **)(in_ECX + 0x20dc8); uStack_424 = 0; uStack_414 = 1; uStack_420 = 0; uStack_41c = 0; uStack_418 = 0xfedcba76; pbStack_428 = pbVar6; GameState::read(&pvStack_42c,1); piVar3 = *(int **)(in_ECX + 0x20dc8); cVar2 = (**(code **)(*piVar3 + 0x30))(); if ((cVar2 != '\0') && (iVar4 = _fileno((FILE *)piVar3[3]), -1 < iVar4)) { flock(iVar4,8); } (**(code **)(**(int **)(in_ECX + 0x20dc8) + 0x34))(); if (bStack_42d != 0) { *(undefined1 *)(in_ECX + 0x20d90) = 1; sprintf_s(abStack_410,0x400,(byte *)"%srep+rerunstate%d.dat"); pbVar5 = abStack_410; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x20d68),abStack_410, (int)pbVar5 - (int)(abStack_410 + 1)); goto LAB_0095a42a; } GameState::Delete((GameState *)(in_ECX + 0xfa4)); } sprintf_s(abStack_410,0x400,(byte *)"%srep+rerunstate%d.dat"); if ((*(char *)(in_ECX + 0x19d) != '\0') || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { pbVar5 = abStack_410; *(undefined1 *)(in_ECX + 0x20d91) = 0; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); pbVar6 = (byte *)(in_ECX + 0x20d68); std::string::assign((char *)pbVar6,abStack_410,(int)pbVar5 - (int)(abStack_410 + 1)); if (*(undefined4 **)(in_ECX + 0x20dc8) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 0x20dc8))(1); } pbVar5 = pbVar6; if (0xf < *(uint *)(in_ECX + 0x20d7c)) { pbVar5 = *(byte **)pbVar6; } piVar3 = SaveDataManager::open_file_read(&PTR_vftable_00c5aa80,pbVar5); *(int **)(in_ECX + 0x20dc8) = piVar3; if (piVar3 != (int *)0x0) { cVar2 = (**(code **)(*piVar3 + 0x30))(); if ((cVar2 != '\0') && (iVar4 = _fileno((FILE *)piVar3[3]), -1 < iVar4)) { flock(iVar4,1); } if (0xf < *(uint *)(in_ECX + 0x20d7c)) { pbVar6 = *(byte **)pbVar6; } pvStack_42c = *(void **)(in_ECX + 0x20dc8); uStack_424 = 0; uStack_414 = 1; uStack_420 = 0; uStack_41c = 0; uStack_418 = 0xfedcba76; pbStack_428 = pbVar6; bStack_42d = GameState::read_rerun((GameState *)(in_ECX + 0xfa4),&pvStack_42c); piVar3 = *(int **)(in_ECX + 0x20dc8); cVar2 = (**(code **)(*piVar3 + 0x30))(); if ((cVar2 != '\0') && (iVar4 = _fileno((FILE *)piVar3[3]), -1 < iVar4)) { flock(iVar4,8); } (**(code **)(**(int **)(in_ECX + 0x20dc8) + 0x34))(); if (bStack_42d == 0) { GameState::DeleteRerun((GameState *)(in_ECX + 0xfa4)); } else { *(undefined1 *)(in_ECX + 0x20d91) = 1; } } } } else { KAGE_LogMessage(1,(byte *)"Loading GameState %d from SteamCloud!\n"); sprintf_s(abStack_410,0x400,(byte *)"rep+gamestate%d.dat"); pbVar5 = abStack_410; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x20d98),abStack_410,(int)pbVar5 - (int)(abStack_410 + 1)) ; cVar2 = FUN_009ce5a0(); if (cVar2 == '\0') { sprintf_s(abStack_410,0x400,(byte *)"rep+rerunstate%d.dat"); pbVar5 = abStack_410; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x20db0),abStack_410, (int)pbVar5 - (int)(abStack_410 + 1)); if ((*(char *)(in_ECX + 0x19d) != '\0') || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { FUN_009caea0(); } } else { sprintf_s(abStack_410,0x400,(byte *)"rep+rerunstate%d.dat"); pbVar5 = abStack_410; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x20db0),abStack_410, (int)pbVar5 - (int)(abStack_410 + 1)); } } LAB_0095a42a: piVar3 = *(int **)(in_ECX + 0x2a6c0); do { if (piVar3 == *(int **)(in_ECX + 0x2a6c4)) { cVar2 = '\0'; LAB_0095a454: if (*(char *)(in_ECX + 0x1ad18) != cVar2) { KAGE_LogMessage(1,(byte *) "Cannot continue a game that doesn\'t have the same modding state (%s)!\n" ); GameState::Clear((GameState *)(in_ECX + 0xfa4)); } return; } if (*(char *)(*piVar3 + 0xfd) != '\0') { cVar2 = '\x01'; goto LAB_0095a454; } piVar3 = piVar3 + 1; } while( true ); } //@@ 0095a4a0 Game::end_save_progress /* DB: ? Game::End: netplay end report (FUN_0090cd10, Manager+0x4cc98 = 0x25), then unless Seeds::AchievementUnlocksDisallowed "Setting PersistentGameData ReadOnly to %s" False and saves */ void Game::end_save_progress(void) { NetplayManager *pNVar1; uint uVar2; Game *pGVar3; Manager *pMVar4; Manager *pMVar5; byte bVar6; Entity_Player *pEVar7; int unusedArg; uint uVar8; uint uVar9; undefined8 uStack_c; pMVar4 = g_manager; pNVar1 = &g_manager->_netplayManager; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) goto LAB_0095a502; if (g_game->_challenge == 0) { uStack_c = CONCAT35(uStack_c._5_3_,0x100000000); if ((g_game->_dailyChallenge)._id != 0) goto LAB_0095a4db; } else { LAB_0095a4db: uStack_c._4_4_ = uStack_c._4_4_ & 0xffffff00; } FUN_0090cd10(1,uStack_c._4_4_); *(undefined4 *)&pMVar4[1]._gamestate.field_0x918 = 0x25; NetplayManager::update_lobby_stage_info(); LAB_0095a502: pMVar5 = g_manager; pGVar3 = g_game; if (((((g_game->_seedEffects)._isCustomRun == 0) && (bVar6 = Seeds::AchievementUnlocksDisallowed(&g_game->_seedEffects), bVar6 == 0)) && (bVar6 = Manager::IsGameplayInputActive(unusedArg), bVar6 == 0)) && (pGVar3->_isRerun == 0)) { bVar6 = (pMVar5->_persistentGameData)._isReadOnly; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar5->_persistentGameData)._isReadOnly = 0; if (*pNVar1 == *(NetplayManager *)(pMVar4 + 1)) { PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,0x71, -(g_manager->_persistentGameData)._eventCounters[0x71]); PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x16,1); uVar2 = (g_manager->_persistentGameData)._eventCounters[0x16]; uVar8 = (g_manager->_persistentGameData)._eventCounters[0x17]; if (uVar8 < uVar2) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x17,uVar2 - uVar8) ; } } pMVar4 = g_manager; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); pMVar5 = g_manager; (pMVar4->_persistentGameData)._isReadOnly = bVar6; if (2 < (uint)(pMVar5->_persistentGameData)._eventCounters[0x16]) { PersistentGameData::TryUnlock(&pMVar5->_persistentGameData,0x142); } pEVar7 = GetPlayer(g_game,0); if (pEVar7->_playerType < 0x29) { uStack_c._4_4_ = (g_manager->_persistentGameData)._eventCounters[0x1f0]; uStack_c._0_4_ = (g_manager->_persistentGameData)._eventCounters[0xbc]; pEVar7 = GetPlayer(g_game,0); uVar2 = pEVar7->_playerType; uVar8 = 1 << (uVar2 & 0x1f); uVar9 = 0; if (0x1f < uVar2) { uVar9 = uVar8; } uVar8 = uVar8 ^ uVar9; if (0x3f < uVar2) { uVar9 = uVar8; } if ((uVar8 & (uint)uStack_c) != 0 || (uVar9 & uStack_c._4_4_) != 0) { uStack_c._4_4_ = 0; uStack_c._0_4_ = 0; } PersistentGameData::set_run_mask(uVar8 | (uint)uStack_c,uVar9 | uStack_c._4_4_); } } return; } //@@ 0095a680 persistent_game_data_set_writable /* DB: ? if netplay (Manager+0x4b3d8 vector non-empty) calls FUN_0090cd10(2, ...); then unless custom run / achievements disallowed / gameplay input active, logs "Setting PersistentGameData ReadOnly to False" and clears the read-only state; callers Game::End and Entity_Player::Update */ void persistent_game_data_set_writable(void) { Manager *pMVar1; Manager *pMVar2; byte bVar3; int iVar4; int unusedArg; int eEventCounters; undefined4 local_c; pMVar1 = g_manager; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { if ((g_game->_challenge != 0) || (local_c = 1, (g_game->_dailyChallenge)._id != 0)) { local_c = 0; } FUN_0090cd10(2,local_c); } pMVar2 = g_manager; if ((g_game->_seedEffects)._isCustomRun == 0) { bVar3 = Seeds::AchievementUnlocksDisallowed(&g_game->_seedEffects); if (bVar3 == 0) { bVar3 = Manager::IsGameplayInputActive(unusedArg); if (((bVar3 == 0) && (g_game->_isRerun == 0)) && (pMVar1->field_0x4b285 == '\0')) { bVar3 = (pMVar2->_persistentGameData)._isReadOnly; KAGE_LogMessage(1,(byte *)"Setting PersistentGameData ReadOnly to %s\n"); (pMVar2->_persistentGameData)._isReadOnly = 0; if (pMVar1->_netplayManager == *(NetplayManager *)(pMVar1 + 1)) { iVar4 = (g_manager->_persistentGameData)._eventCounters[0x16]; if (iVar4 == 0) { iVar4 = 1; eEventCounters = 0x71; } else { iVar4 = -iVar4; eEventCounters = 0x16; } PersistentGameData::IncreaseEventCounter (&g_manager->_persistentGameData,eEventCounters,iVar4); FUN_009299e0(bVar3); } PersistentGameData::set_run_mask(0,0); pMVar1->field_0x4b285 = 1; } } } return; } //@@ 0095a7b0 PlayerManager::unlock_completion_mark /* DB: ? param ending id (14 mega satan/3 ...), TryUnlock per player */ void PlayerManager::unlock_completion_mark(int param_1) { undefined1 *puVar1; bool bVar2; byte bVar3; void *pvVar4; int unusedArg; uint queuedCount; int queueMap; uint queueMapSize; int achievementId; PlayerManager *playerManager; int *piVar5; int iVar6; int iVar7; uint playerIndex; Manager *manager; undefined8 *queuedMark; int slotOffset; if (g_game != (Game *)0x0) { playerManager = &g_game->_playerManager; playerIndex = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar4 = (playerManager->_playerList)._end; if ((int)pvVar4 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; } piVar5 = (playerManager->_playerList)._begin; if (playerIndex < (uint)((int)pvVar4 - (int)piVar5 >> 2)) { piVar5 = piVar5 + playerIndex; } iVar7 = *piVar5; if (((*(int *)(iVar7 + 0x2c) == 0) && ((((iVar6 = *(int *)(iVar7 + 0x1e68), iVar6 == 0 || (*(int *)(iVar6 + 0x161c) == -1)) || (*(int *)(iVar7 + 0x161c) <= *(int *)(iVar6 + 0x161c))) || (iVar6 == iVar7)))) && (*(int *)(iVar7 + 0x3bc) == 0)) { iVar6 = *(int *)(iVar7 + 0x13c0); if ((iVar6 == 8) && (*(char *)(iVar7 + 0x1519) == '\0')) { for (piVar5 = *(int **)(iVar7 + 0x150c); piVar5 != *(int **)(iVar7 + 0x1510); piVar5 = piVar5 + 4) { if ((*(int *)*piVar5 == 0) && (((int *)*piVar5)[1] == 0x31)) { iVar6 = 0xb; break; } } } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { unlock_completion_mark_for_player_type(param_1,iVar6,g_game->_difficulty); } else { bVar3 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar7 + 0x1618)); if (bVar3 != 0) { iVar7 = g_game->_difficulty; bVar3 = Manager::IsGameplayInputActive(unusedArg); manager = g_manager; if ((bVar3 == 0) && ((g_manager->_persistentGameData)._isReadOnly == 0)) { queuedCount = *(uint *)&g_manager[1]._gamestate.field_0xe0; queueMapSize = *(uint *)&g_manager[1]._gamestate.field_0xd8; if (queueMapSize <= queuedCount + 1) { std_deque_growmap(&g_manager[1]._gamestate.field_0xd0,queuedCount); queueMapSize = *(uint *)&manager[1]._gamestate.field_0xd8; queuedCount = *(uint *)&manager[1]._gamestate.field_0xe0; } puVar1 = &manager[1]._gamestate.field_0xdc; *(uint *)puVar1 = *(uint *)puVar1 & queueMapSize - 1; slotOffset = (queuedCount + *(int *)&manager[1]._gamestate.field_0xdc & queueMapSize - 1) * 4; queueMap = *(int *)&manager[1]._gamestate.field_0xd4; if (*(int *)(queueMap + slotOffset) == 0) { pvVar4 = operator_new(0xc); *(void **)(slotOffset + *(int *)&manager[1]._gamestate.field_0xd4) = pvVar4; queueMap = *(int *)&manager[1]._gamestate.field_0xd4; } queuedMark = *(undefined8 **)(slotOffset + queueMap); *queuedMark = CONCAT44(iVar6,param_1); *(int *)(queuedMark + 1) = iVar7; puVar1 = &manager[1]._gamestate.field_0xe0; *(int *)puVar1 = *(int *)puVar1 + 1; if ((iVar7 == 1) || (iVar7 == 3)) { bVar2 = true; } else { bVar2 = false; } if ((param_1 != 0) || (bVar2)) { bVar2 = false; } else { bVar2 = true; } if ((((iVar6 < 0x29) && (iVar6 * 0x90 != -0xc35ed0)) && (!bVar2)) && ((iVar7 = *(int *)(iVar6 * 0x90 + 0xc35ed4 + param_1 * 8), iVar7 != 0 && (bVar3 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,iVar7), bVar3 == 0)))) { Manager::queue_achievement_popup(achievementId); } } } } } playerManager = &g_game->_playerManager; playerIndex = playerIndex + 1; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } if (param_1 == 6) { iVar7 = 0x154; } else { if (param_1 != 0xd) { return; } PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x195); iVar7 = 0x27b; } PersistentGameData::TryUnlock(&g_manager->_persistentGameData,iVar7); } return; } //@@ 0095aa30 unlock_completion_mark_for_player_type /* DB: ? PlayerManager::unlock_completion_mark (non-netplay path): table DAT_00c35ed0 (0x29 player types x 0x90), entry param_1*8 = {event counter, achievement}; PersistentGameData::TryUnlock / IncreaseEventCounter, hard/greedier (difficulty 1/3) variants */ void unlock_completion_mark_for_player_type(int param_1,int param_2,int param_3) { int *piVar1; bool bVar2; bool bVar3; Manager *pMVar4; int eEventCounters; undefined *puVar5; PersistentGameData *this; pMVar4 = g_manager; if (param_2 < 0x29) { puVar5 = &DAT_00c35ed0 + param_2 * 0x90; } else { puVar5 = (undefined *)0x0; } if ((param_3 == 1) || (param_3 == 3)) { bVar2 = true; } else { bVar2 = false; } if ((param_1 != 0) || (bVar2)) { bVar3 = false; } else { bVar3 = true; } if (puVar5 != (undefined *)0x0) { piVar1 = (int *)(puVar5 + param_1 * 8); this = &g_manager->_persistentGameData; if ((!bVar3) && (piVar1[1] != 0)) { PersistentGameData::TryUnlock(this,piVar1[1]); } eEventCounters = *piVar1; if (eEventCounters != 0) { if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { if (((pMVar4->_persistentGameData)._eventCounters[eEventCounters] & 4) == 0) { PersistentGameData::IncreaseEventCounter(this,eEventCounters,4); eEventCounters = *piVar1; } if ((((pMVar4->_persistentGameData)._eventCounters[eEventCounters] & 8) == 0) && (bVar2)) { PersistentGameData::IncreaseEventCounter(this,eEventCounters,8); eEventCounters = *piVar1; } } if (((pMVar4->_persistentGameData)._eventCounters[eEventCounters] & 1) == 0) { PersistentGameData::IncreaseEventCounter(this,eEventCounters,1); eEventCounters = *piVar1; } if ((((pMVar4->_persistentGameData)._eventCounters[eEventCounters] & 2) == 0) && (bVar2)) { PersistentGameData::IncreaseEventCounter(this,eEventCounters,2); } } } if (((param_2 == 8) && (bVar2)) && ((((param_1 == 0 || (((param_1 == 1 || (param_1 == 2)) || (param_1 == 4)))) || (((param_1 == 5 || (param_1 == 6)) || (param_1 == 9)))) || ((param_1 == 0xd || (param_1 == 0xe)))))) { PersistentGameData::TryUnlock(&g_manager->_persistentGameData,0x194); } if (((param_1 == 7) || (param_1 == 0)) || (param_1 == 0xe)) { PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0x15,1); } return; } //@@ 0095aba0 controller_button_to_glyph_frame /* DB: switch mapping input button ids (0..0xf, 0x11/0x12, 0xabab..) to the controller glyph frame; Backdrop::render_control_icon, Manager::render_controller_action_glyph */ undefined4 controller_button_to_glyph_frame(int param_1) { if (param_1 == 0x11) { param_1 = 7; } else if (param_1 == 0x12) { param_1 = 5; } if (param_1 < 0xabac) { if (param_1 == 0xabab) { return 0x13; } switch(param_1) { case 0: return 7; case 1: return 6; case 2: return 5; case 3: return 4; case 4: return 3; case 5: return 2; case 6: return 0; case 7: return 1; case 8: return 10; case 9: return 0xc; case 10: return 8; case 0xb: return 0xb; case 0xc: return 0xd; case 0xd: return 9; case 0xe: return 0xf; case 0xf: return 0xe; } } else { switch(param_1) { case 0xabac: return 0x12; case 0xabad: return 0x11; case 0xabae: return 0x10; case 0xabaf: return 0x17; case 0xabb0: return 0x16; case 0xabb1: return 0x15; case 0xabb2: return 0x14; } } return 0xffffffff; } //@@ 0095ad30 Manager::render_button_sprite /* DB: ? renders Manager's shared button ANM2 (+0x4ac14 anim, scale +0x4ac80 = 1) at (param_2,param_3); GameOver::RenderItemSprite at the "PlayerNextRightButton" null frame */ void Manager::render_button_sprite(int param_1,float param_2,float param_3) { float fVar1; Manager *pMVar2; AnimationState *this; Vector local_10; pMVar2 = g_manager; fVar1 = g_vectorOne.y; local_10.x = param_2; local_10.y = param_3; (g_manager->_buttonsSprite)._scale.x = g_vectorOne.x; (pMVar2->_buttonsSprite)._scale.y = fVar1; if ((pMVar2->_buttonsSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(pMVar2->_buttonsSprite)._animState,(float)param_1); } if ((pMVar2->_buttonsSprite)._loaded != 0) { if ((pMVar2->_buttonsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(pMVar2->_buttonsSprite)._animState,&local_10,&g_vectorZero,&g_vectorZero); this = &(pMVar2->_buttonsSprite)._overlayAnimState; } else { AnimationState::Render (&(pMVar2->_buttonsSprite)._overlayAnimState,&local_10,&g_vectorZero,&g_vectorZero); this = &(pMVar2->_buttonsSprite)._animState; } AnimationState::Render(this,&local_10,&g_vectorZero,&g_vectorZero); } return; } //@@ 0095adf0 render_input_button_icon /* DB: ? forwards all args to FUN_0095af30 plus g_vectorOne/40 (1.0f,1.0f: default scale); 0095af30 dynamic_casts the device to KAGE::Input::InputDeviceGamepad, picks the anim by pad type (+900), ANM2::Play/Render on ECX+0x4abe4; GameOver::RenderItemSprite passes action ids 0x1c/0x19 prototype: db/protos.zhl, confirmed by RET 68 */ byte render_input_button_icon (int controllerIndex,int action,int bindingIndex,byte isTryFallback,ColorMod color, Vector pos) { Vector scale; byte bVar1; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; bVar1 = Manager::render_controller_action_glyph (g_manager,controllerIndex,action,bindingIndex,isTryFallback,color,pos,scale); return bVar1; } //@@ 0095ae60 render_online_icon /* DB: ? sets Manager+0x4acf8 ANM2 animation "Icons" to frame param_1 and renders its layers at pos param_2 (offset stored at Manager+0x4ad94); called per lobby/player row by Menu_LobbyList::render_lobbies, Menu_OnlineLobby::render_lobby_list, GameOver::RenderItemSprite prototype: db/protos.zhl, confirmed by RET 20 */ void render_online_icon(int frame,Vector position,float scaleX,float scaleY) { Manager *pMVar1; byte bVar2; AnimationState *this; pMVar1 = g_manager; (g_manager->_platformIconsSprite)._scale.x = scaleX; (pMVar1->_platformIconsSprite)._scale.y = scaleY; bVar2 = ANM2::SetAnimation(&pMVar1->_platformIconsSprite,(byte *)"Icons",1); if ((bVar2 != 0) && ((pMVar1->_platformIconsSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pMVar1->_platformIconsSprite)._animState,(float)frame); if ((pMVar1->_platformIconsSprite)._animState._animData != (void *)0x0) { (pMVar1->_platformIconsSprite)._animState._isPlaying = 0; } } if ((pMVar1->_platformIconsSprite)._loaded != 0) { if ((pMVar1->_platformIconsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(pMVar1->_platformIconsSprite)._animState,&position,&g_vectorZero,&g_vectorZero); this = &(pMVar1->_platformIconsSprite)._overlayAnimState; } else { AnimationState::Render (&(pMVar1->_platformIconsSprite)._overlayAnimState,&position,&g_vectorZero, &g_vectorZero); this = &(pMVar1->_platformIconsSprite)._animState; } AnimationState::Render(this,&position,&g_vectorZero,&g_vectorZero); } return; } //@@ 0095af30 Manager::render_controller_action_glyph /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: looks up input device (00a20390) and, for InputDeviceGamepad, plays "XboxOne"/"PS4"/"WiiU" on Manager+0x4abe4 ANM2, maps button (FUN_0095aba0) to frame and renders; returns 0 so callers (Menu_*::Render) fall back to keyboard sprite prototype: db/protos.zhl, confirmed by RET 76 */ byte __thiscall Manager::render_controller_action_glyph (Manager *this,int controllerIndex,int action,int bindingIndex,byte isTryFallback, ColorMod color,Vector pos,Vector scale) { char isLastRef; uint uVar1; int iVar2; byte *padAnimName; byte isRendered; int local_38; int *deviceRefCount; int bindingDevice; int *bindingDeviceRefCount; undefined4 buttonBindings [4]; uint local_18; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c3f5; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(buttonBindings + 9); ExceptionList = &local_10; local_18 = uVar1; InputManager::get_device(&PTR_vftable_00c57b18,&local_38,controllerIndex); local_8 = 0; if (local_38 != 0) { iVar2 = __RTDynamicCast(local_38,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0,uVar1); if ((iVar2 != 0) && ((*(byte *)(iVar2 + 8) & 0x20) == 0)) { iVar2 = *(int *)(iVar2 + 900); if (iVar2 == 0) { padAnimName = &DAT_00b7b76c; } else if (iVar2 == 1) { padAnimName = &DAT_00b7c788; } else { if (iVar2 != 2) goto LAB_0095b129; padAnimName = &DAT_00b7c78c; } ANM2::Play(&this->_buttonsSprite,padAnimName,0); InputManager::get_device(&PTR_vftable_00c57b18,&bindingDevice,controllerIndex); local_8._0_1_ = 1; if (bindingDevice != 0) { FUN_00a243c0(action,buttonBindings); if (1 < bindingIndex) { local_8._0_1_ = 3; if (bindingDeviceRefCount != (int *)0x0) { isLastRef = (**(code **)(*bindingDeviceRefCount + 0xc))(); if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&bindingDevice); local_8 = (uint)local_8._1_3_ << 8; goto LAB_0095b0ae; } } goto LAB_0095b029; } iVar2 = controller_button_to_glyph_frame(buttonBindings[bindingIndex]); local_8._0_1_ = 4; if (bindingDeviceRefCount != (int *)0x0) { isLastRef = (**(code **)(*bindingDeviceRefCount + 0xc))(); if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&bindingDevice); } } local_8 = (uint)local_8._1_3_ << 8; if (iVar2 == -1) goto LAB_0095b0ae; LAB_0095b0c8: (this->_buttonsSprite)._scale.x = scale.x; (this->_buttonsSprite)._scale.y = scale.y; if ((this->_buttonsSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_buttonsSprite)._animState,(float)iVar2); } Sprite::SetColor((Sprite *)&this->_buttonsSprite,&color); ANM2::Render(&this->_buttonsSprite,&pos,&g_vectorZero,&g_vectorZero); isRendered = 1; goto LAB_0095b12b; } local_8._0_1_ = 2; if (bindingDeviceRefCount != (int *)0x0) { isLastRef = (**(code **)(*bindingDeviceRefCount + 0xc))(); if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&bindingDevice); } } LAB_0095b029: local_8 = (uint)local_8._1_3_ << 8; LAB_0095b0ae: if (isTryFallback != 0) { iVar2 = FUN_00a24370(action,0); if (iVar2 != -1) goto LAB_0095b0c8; } } } LAB_0095b129: isRendered = 0; LAB_0095b12b: local_8 = 5; if (deviceRefCount != (int *)0x0) { isLastRef = (**(code **)(*deviceRefCount + 0xc))(); if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_38); } } ExceptionList = local_10; return isRendered; } //@@ 0095b180 Manager::apply_device_key_config /* DB: ? InputManager::get_device(param_1), looks up the device name in the saved list Manager+0x4abd8 and applies that mapping (FUN_00835ba0) else defaults (FUN_00836370); Menu_KeyConfig::Update */ void Manager::apply_device_key_config(int param_1) { byte bVar1; Manager *pMVar2; char cVar3; uint uVar4; int iVar5; byte *pbVar6; uint uVar7; undefined4 *puVar8; byte *pbVar9; bool bVar10; int *local_1c; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar2 = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0c42d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; InputManager::get_device(&PTR_vftable_00c57b18,&local_1c,param_1); local_8 = 0; if (local_1c == (int *)0x0) { local_8 = 1; } else { puVar8 = *(undefined4 **)&pMVar2->field_0x4abd8; if (puVar8 != *(undefined4 **)&pMVar2->field_0x4abdc) { do { iVar5 = (**(code **)(*local_1c + 0xc))(uVar4); if (iVar5 != 0) { pbVar9 = (byte *)*puVar8; pbVar6 = (byte *)(**(code **)(*local_1c + 0xc))(); do { bVar1 = *pbVar6; bVar10 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_0095b217: uVar7 = -(uint)bVar10 | 1; goto LAB_0095b21c; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar10 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_0095b217; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_0095b21c: if (uVar7 == 0) { FUN_00835ba0(param_1); break; } } puVar8 = puVar8 + 0x41; } while (puVar8 != *(undefined4 **)&pMVar2->field_0x4abdc); } input_configs_save(); local_8 = 2; } if (((local_18 != (int *)0x0) && (cVar3 = (**(code **)(*local_18 + 0xc))(), cVar3 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_1c); } ExceptionList = local_10; return; } //@@ 0095b290 FUN_0095b290 void FUN_0095b290(int param_1,int *param_2) { char cVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c45d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; KeyConfigs::apply_to_device(*(undefined4 *)(param_1 + 0xc)); local_8 = 1; if (param_2 != (int *)0x0) { cVar1 = (**(code **)(*param_2 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return; } //@@ 0095b310 Manager::update_controller_popups /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ##GAME###CONTROLLER_DISCONNECTED_* / RESELECT_CONTROLLER_* / ##PLATFORM###UNRECOGNIZED_CONTROLLER_* strings, SetControllerIndex; called from main loop 00954cd0 prototype: db/protos.zhl */ void __thiscall Manager::update_controller_popups(Manager *menuManager) { NetplayManager NVar1; ulonglong uVar2; longlong lVar3; longlong lVar4; longlong lVar5; char cVar6; uint uVar7; int *piVar8; Entity_Player *player; int *piVar9; void *pvVar10; Game *game; undefined4 *playerIt; uint uVar11; int iVar12; int iVar13; PlayerManager *playerManager; undefined1 *puVar14; ulonglong timeNs; undefined1 popup [20]; undefined4 local_140; undefined1 local_100 [12]; undefined1 local_f4 [12]; undefined4 local_e8; undefined4 local_e4; undefined4 local_e0; undefined4 local_dc; undefined4 local_d8; undefined4 local_d4; undefined4 local_ac; undefined1 device [4]; int *deviceCtrl; Vector popupPos; undefined1 defaultDevice [4]; int *defaultDeviceCtrl; uint deviceIdx; int popupResult; int *openPopup; int local_7c; char *lineText; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; int local_5c; float local_58; float local_54; undefined4 local_50; undefined4 local_4c; void *idsBegin; int *idsEnd; int *idsCapacity; Vector local_3c; int local_34; int *local_30; int *controllerCount; uint slot; int deviceId; void *controllerIds; int *popupIdSlot; int local_18; Manager *manager; void *local_10; undefined1 *puStack_c; undefined4 local_8; MenuManager *menuManager; puStack_c = &LAB_00b0c4b3; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; manager = menuManager; if (*(int *)&menuManager->field_0x4abc8 == -1) { uVar11 = 0; while( true ) { local_8 = 0xffffffff; (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff,uVar7); iVar12 = DAT_00c57b24 - _DAT_00c57b20; local_8 = 0; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_8 = 0xffffffff; if ((uint)(iVar12 >> 3) <= uVar11) break; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&local_34,uVar11); local_8 = 1; if (local_34 == 0) { local_8 = 2; } else { iVar12 = __RTDynamicCast(local_34,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0); if ((iVar12 != 0) && (((*(byte *)(iVar12 + 8) & 0x20) != 0 || (*(int *)(iVar12 + 900) == 3)))) { iVar13 = *(int *)(iVar12 + 0x10); if ((uint)(*(int *)(iVar12 + 0x14) - iVar13 >> 4) < 0xf) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar13 = *(int *)(iVar12 + 0x10); } if ((*(int *)(iVar13 + 0xe0) == -1) && (*(int *)(iVar13 + 0xe4) == -1)) { local_3c.x = (float)&DAT_bf800000; local_3c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_3c); local_8 = CONCAT31(local_8._1_3_,3); local_140 = 3; MessagePopup::add_blank_footer(popup); iVar12 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,popup); *(int *)&menuManager->field_0x4abc8 = iVar12; FUN_00420710(); FUN_004242b0(); ExceptionList = local_10; return; } } local_8 = 4; } if (((local_30 != (int *)0x0) && (cVar6 = (**(code **)(*local_30 + 0xc))(), cVar6 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_34); } uVar11 = uVar11 + 1; } } controllerIds = (void *)0x0; idsBegin = (void *)0x0; idsEnd = (int *)0x0; idsCapacity = (int *)0x0; local_8._0_1_ = 5; local_8._1_3_ = 0; if (g_menuManager == (MenuManager *)0x0) { if (g_game != (Game *)0x0) { NVar1 = menuManager->_netplayManager; if ((NVar1 == *(NetplayManager *)(menuManager + 1)) || ((uint)((int)*(NetplayManager *)(menuManager + 1) - (int)NVar1) < 4)) { if (g_game->_fadeOutTarget == 0) { playerManager = &g_game->_playerManager; uVar7 = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { piVar9 = idsEnd; pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar10 = (playerManager->_playerList)._end; game = g_game; } piVar8 = (playerManager->_playerList)._begin; if (uVar7 < (uint)((int)pvVar10 - (int)piVar8 >> 2)) { piVar8 = piVar8 + uVar7; } local_18 = *(int *)(*piVar8 + 0x1618); if (piVar9 == idsCapacity) { std::vector::_Emplace_reallocate(piVar9,&local_18); game = g_game; } else { *piVar9 = local_18; idsEnd = piVar9 + 1; } playerManager = &game->_playerManager; uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); controllerIds = idsBegin; menuManager = manager; controllerCount = idsEnd; } } } else { local_18 = InputManager::FirstLocalDeviceID(&menuManager->_netplayManager); std::vector::_Emplace_reallocate(0,&local_18); controllerIds = idsBegin; } } } else if (g_menuControllerIndex != -1) { local_18 = g_menuControllerIndex; std::vector::_Emplace_reallocate(0,&local_18); controllerIds = idsBegin; } piVar8 = idsEnd; piVar9 = (int *)&menuManager->field_0x4abcc; idsBegin = controllerIds; popupIdSlot = piVar9; if ((*(int *)&menuManager->field_0x4abcc != -1) && ((uint)((int)idsEnd - (int)controllerIds) < 4)) { local_18 = -1; PopupManager::close(&menuManager[1]._gamestate.field_0xcf0,piVar9,&local_18); *piVar9 = 0xffffffff; menuManager->field_0x4abd0 = 0; } slot = 0; controllerCount = (int *)((int)piVar8 - (int)controllerIds >> 2); if (controllerCount != (int *)0x0) { do { local_18 = -1; if (*piVar9 == -1) { piVar8 = (int *)(**(code **)(PTR_vftable_00c57b18 + 0x28))(defaultDevice); iVar12 = *piVar8; local_8._0_1_ = 6; if (((defaultDeviceCtrl != (int *)0x0) && (cVar6 = (**(code **)(*defaultDeviceCtrl + 0xc))(), cVar6 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(defaultDevice); } local_8._0_1_ = 5; if (iVar12 == 0) { popupPos.x = (float)&DAT_bf800000; popupPos.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&popupPos); local_8 = CONCAT31(local_8._1_3_,7); local_6c = 0x3e5cdcdd; uStack_68 = 0x3e2cacad; uStack_64 = 0x3e34b4b5; uStack_60 = 0x3f800000; local_58 = g_vectorZero.x; local_74 = 0xffffffff; local_70 = 0xffffffff; local_50 = 1; local_54 = g_vectorZero.y; local_7c = iVar12; local_5c = iVar12; if (menuManager->field_0x4abd0 == '\0') { local_140 = 3; lineText = "##GAME###CONTROLLER_DISCONNECTED_HEADER"; std::vector<48byte>::push_back(&local_7c); lineText = "##GAME###CONTROLLER_DISCONNECTED_MESSAGE"; } else { lineText = "##GAME###RESELECT_CONTROLLER_HEADER"; std::vector<48byte>::push_back(&local_7c); lineText = "##GAME###RESELECT_CONTROLLER_MESSAGE"; } local_7c = 0; local_74 = 0xffffffff; local_70 = 0xffffffff; local_6c = 0x3e5cdcdd; uStack_68 = 0x3e2cacad; uStack_64 = 0x3e34b4b5; uStack_60 = 0x3f800000; local_5c = 0; local_58 = 0.0; local_54 = 20.0; local_50 = 1; std::vector<48byte>::push_back(&local_7c); iVar12 = PopupQueue::push(&menuManager[1]._gamestate.field_0xcf0,popup); menuManager = g_menuManager; *piVar9 = iVar12; if (menuManager == (MenuManager *)0x0) { if (g_game != (Game *)0x0) { if (menuManager->_netplayManager == *(NetplayManager *)(menuManager + 1)) { player = Game::GetPlayer(g_game,slot); Entity_Player::SetControllerIndex(player,0xffffffff,1); } else { FUN_0090af30(0xffffffff); } } } else if (menuManager->_selectedMenuID == 0xc) { g_manager->_isHotkeysEnabled = 1; pvVar10 = (menuManager->_menuStateHistory)._end; if (1 < (uint)((int)pvVar10 - (int)(menuManager->_menuStateHistory)._begin >> 2)) { pvVar10 = (void *)((int)pvVar10 + -4); (menuManager->_menuStateHistory)._end = pvVar10; } MenuManager::SetState(menuManager,*(int *)((int)pvVar10 + -4),0); } local_8._0_1_ = 5; local_d8 = 0; local_d4 = 0; local_e0 = 0; local_dc = 0; local_e8 = 0; local_e4 = 0; FID_conflict__Tidy(local_f4); FID_conflict__Tidy(local_100); } } else { piVar8 = (int *)(**(code **)(PTR_vftable_00c57b18 + 0x28)) (device,*(undefined4 *)((int)controllerIds + slot * 4)); iVar12 = *piVar8; local_8._0_1_ = 8; if (((deviceCtrl != (int *)0x0) && (cVar6 = (**(code **)(*deviceCtrl + 0xc))(), cVar6 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(device); } local_8._0_1_ = 5; if (iVar12 == 0) { uVar7 = 0; while( true ) { local_8._0_1_ = 5; deviceIdx = uVar7; (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff); iVar13 = DAT_00c57b24 - _DAT_00c57b20; local_8._0_1_ = 9; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); iVar12 = local_18; game = g_game; local_8._0_1_ = 5; if ((uint)(iVar13 >> 3) <= uVar7) break; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&local_3c,uVar7); local_8 = CONCAT31(local_8._1_3_,10); if ((int *)local_3c.x == (int *)0x0) { local_8._0_1_ = 0xb; if ((int *)local_3c.y == (int *)0x0) goto LAB_0095bc03; cVar6 = (**(code **)(*(int *)local_3c.y + 0xc))(); if ((cVar6 == '\0') || (g_inputDeviceRelease == (void *)0x0)) goto LAB_0095bc03; (*g_inputDeviceRelease)(&local_3c); uVar7 = uVar7 + 1; } else { iVar12 = *(int *)((int)local_3c.x + 0xc); deviceId = iVar12; if (menuManager->field_0x4abd0 == '\0') { cVar6 = (**(code **)(*(int *)local_3c.x + 0x1c))(); if (cVar6 != '\0') goto LAB_0095b9fd; if (menuManager->field_0x4abd0 != '\0') goto LAB_0095b9ee; } else { LAB_0095b9ee: cVar6 = (**(code **)(*(int *)local_3c.x + 0x20))(); if (cVar6 != '\0') { LAB_0095b9fd: if (g_game != (Game *)0x0) { playerManager = &g_game->_playerManager; uVar7 = 0; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar10 = (playerManager->_playerList)._end; if ((int)pvVar10 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n" ); pvVar10 = (playerManager->_playerList)._end; game = g_game; } piVar9 = (playerManager->_playerList)._begin; if (uVar7 < (uint)((int)pvVar10 - (int)piVar9 >> 2)) { piVar9 = piVar9 + uVar7; } if (*(int *)(*piVar9 + 0x1618) == iVar12) { menuManager = manager; goto LAB_0095bbd5; } playerManager = &game->_playerManager; uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } menuManager = manager; } popupResult = -1; piVar9 = (int *)&menuManager->field_0x4abcc; local_18 = iVar12; if (*(int *)&menuManager->field_0x4abcc != -1) { puVar14 = &menuManager[1]._gamestate.field_0xcf8; (**(code **)(*(int *)&menuManager[1]._gamestate.field_0xcf8 + 0xc))(0xffffffff); openPopup = (int *)0x0; piVar9 = *(int **)&manager[1]._gamestate.field_0xcf0; piVar8 = (int *)*piVar9; if (piVar8 == piVar9) { LAB_0095bae2: piVar9 = openPopup; (**(code **)(*(int *)puVar14 + 0x10))(); if ((piVar9 != (int *)0x0) && (piVar9[1] < 3)) { timeNs = GetTimeNs(); piVar9 = openPopup; uVar7 = (uint)(timeNs >> 0x20); uVar2 = (timeNs & 0xffffffff) * 0xd7b634db; local_34 = (int)uVar2; lVar3 = (timeNs & 0xffffffff) * 0x431bde82; local_30 = (int *)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar7 * 0x431bde82; local_4c = (undefined4)lVar4; lVar5 = (ulonglong)uVar7 * 0xd7b634db + (uVar2 >> 0x20); local_ac = (undefined4)(lVar5 + lVar3); lVar4 = lVar4 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar5 >> 0x20), (int)local_30 + (uint)CARRY4((uint)lVar3,(uint)lVar5)), (int)((ulonglong)(lVar5 + lVar3) >> 0x20)); uVar11 = (uint)((ulonglong)lVar4 >> 0x20); uVar7 = (uint)lVar4 >> 0x12 | uVar11 * 0x4000; if (((uVar11 >> 0x12) - openPopup[5] == (uint)(uVar7 < (uint)openPopup[4])) && (uVar7 - openPopup[4] < (uint)openPopup[0x15])) { openPopup[6] = popupResult; } else { openPopup[6] = -0x1010102; if ((code *)openPopup[0x28] != (code *)0x0) { (*(code *)openPopup[0x28])(&popupResult,openPopup[0x29]); } Popup::set_state(piVar9,3); } } } else { do { openPopup = (int *)piVar8[2]; if (*openPopup == *popupIdSlot) goto LAB_0095bae2; piVar8 = (int *)*piVar8; } while (piVar8 != piVar9); (**(code **)(*(int *)puVar14 + 0x10))(); } piVar9 = popupIdSlot; iVar12 = deviceId; menuManager = manager; } *piVar9 = -1; menuManager->field_0x4abd0 = 0; if (menuManager->_netplayManager != *(NetplayManager *)(menuManager + 1)) { FUN_0090af30(iVar12); } } } LAB_0095bbd5: local_8._0_1_ = 0xc; if ((((int *)local_3c.y != (int *)0x0) && (cVar6 = (**(code **)(*(int *)local_3c.y + 0xc))(), cVar6 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_3c); } uVar7 = deviceIdx; LAB_0095bc03: uVar7 = uVar7 + 1; } } if (local_18 != -1) { if (g_menuManager == (MenuManager *)0x0) { if (g_game != (Game *)0x0) { if (menuManager->_netplayManager == *(NetplayManager *)(menuManager + 1)) { pvVar10 = (g_game->_playerManager)._playerList._end; playerIt = (g_game->_playerManager)._playerList._begin; if ((int)pvVar10 - (int)playerIt >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); pvVar10 = (game->_playerManager)._playerList._end; playerIt = (game->_playerManager)._playerList._begin; } uVar7 = slot; if (slot < (uint)((int)pvVar10 - (int)playerIt >> 2)) { playerIt = playerIt + slot; } Entity_Player::SetControllerIndex((Entity_Player *)*playerIt,iVar12,1); if (uVar7 == 0) { g_menuControllerIndex = iVar12; } } else { FUN_0090af30(local_18); g_menuControllerIndex = iVar12; } game = g_game; (g_game->_playerManager)._coopSlots[0]._controllerIndex = -1; (game->_playerManager)._coopSlots[1]._controllerIndex = -1; (game->_playerManager)._coopSlots[0]._state = -1; (game->_playerManager)._coopSlots[0]._menuPosition = 0.0; (game->_playerManager)._coopSlots[0]._playerType = 0; (game->_playerManager)._coopSlots[1]._state = -1; (game->_playerManager)._coopSlots[1]._menuPosition = 0.0; (game->_playerManager)._coopSlots[1]._playerType = 0; (game->_playerManager)._coopSlots[2]._controllerIndex = -1; (game->_playerManager)._coopSlots[2]._state = -1; (game->_playerManager)._coopSlots[2]._menuPosition = 0.0; (game->_playerManager)._coopSlots[2]._playerType = 0; (game->_playerManager)._coopSlots[3]._controllerIndex = -1; (game->_playerManager)._coopSlots[3]._state = -1; (game->_playerManager)._coopSlots[3]._menuPosition = 0.0; (game->_playerManager)._coopSlots[3]._playerType = 0; } } else { g_menuControllerIndex = local_18; } FUN_00a21cb0(); } piVar9 = (int *)&menuManager->field_0x4abcc; } } slot = slot + 1; } while (slot < controllerCount); } if (controllerIds != (void *)0x0) { uVar7 = (int)idsCapacity - (int)controllerIds & 0xfffffffc; pvVar10 = controllerIds; if (0xfff < uVar7) { pvVar10 = *(void **)((int)controllerIds + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)controllerIds + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar7); } ExceptionList = local_10; return; } //@@ 0095bdd0 std::vector<164byte>::_Tidy /* DB: destroys 0xa4-byte elements with FUN_004269f0 (string + set + 5 vectors) and frees storage; called from Manager::destructor */ void std::vector<164byte>::_Tidy(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FUN_004269f0(); pvVar1 = (void *)((int)pvVar1 + 0xa4); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0xa4) * 0xa4; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 0095be60 FUN_0095be60 void FUN_0095be60(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0xa4) { FUN_004269f0(); } return; } //@@ 0095be90 FUN_0095be90 void FUN_0095be90(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0xa4; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 0095bed0 std::vector::_Emplace_reallocate /* DB: 0xa4-byte elements (max 0x18f9c18), copy via ChallengeParams::copy_constructor; challenges_xml_load */ void * std::vector::_Emplace_reallocate(int param_1,ChallengeParam *param_2) { uint uVar1; int iVar2; int iVar3; void *pvVar4; void *this; int *in_ECX; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c4e0; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0xa4; if (iVar3 == 0x18f9c18) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0xa4; if (0x18f9c18 - (uVar1 >> 1) < uVar1) { uVar5 = 0x18f9c18; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0x18f9c18 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = _Allocate(uVar5 * 0xa4); local_8 = 0; this = (void *)(((param_1 - iVar2) / 0xa4) * 0xa4 + (int)pvVar4); ChallengeParams::copy_constructor(this,param_2); if (param_1 == in_ECX[1]) { _Uninitialized_copy(*in_ECX,in_ECX[1],pvVar4); } else { FUN_0095c430(*in_ECX,param_1,pvVar4); FUN_0095c430(param_1,in_ECX[1],(int)this + 0xa4); } _Change_array(pvVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return this; } //@@ 0095c01b Catch_All@0095c01b void Catch_All_0095c01b(void) { int unaff_EBP; FUN_0095be60(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_0095be90(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0095c050 ChallengeParams::copy_constructor /* DB: copies string, std::set (std_set_uint_copy +0x18), std::vector (+0x20) and the rest of a ChallengeParams; challenges_xml_load and the vector helpers 0095bed0/0095c3b0 prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall ChallengeParams::copy_constructor(void *this,ChallengeParam *other) { undefined4 *this_00; void *pvVar1; size_t sVar2; uint uVar3; void *pvVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c54f; local_10 = ExceptionList; ExceptionList = &local_10; std::string::string(this,other); local_8 = 0; this_00 = (undefined4 *)((int)this + 0x18); *this_00 = 0; *(undefined4 *)((int)this + 0x1c) = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *this_00 = pvVar1; local_8._0_1_ = 1; std_set_uint_copy(this_00,&other->_roomset,(int)other); local_8._0_1_ = 2; std::vector::copy_constructor(&other->_collectibleList); local_8._0_1_ = 3; *(undefined4 *)((int)this + 0x2c) = 0; *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 0; pvVar1 = (other->_trinketList)._begin; pvVar4 = (other->_trinketList)._end; if (pvVar1 != pvVar4) { sVar2 = (int)pvVar4 - (int)pvVar1; uVar3 = (int)sVar2 >> 2; if (0x3fffffff < uVar3) goto LAB_0095c2fe; uVar3 = uVar3 * 4; pvVar4 = std::_Allocate(uVar3); *(void **)((int)this + 0x2c) = pvVar4; *(void **)((int)this + 0x30) = pvVar4; *(void **)((int)this + 0x34) = (void *)((int)pvVar4 + uVar3); pvVar4 = *(void **)((int)this + 0x2c); memmove(pvVar4,pvVar1,sVar2); *(void **)((int)this + 0x30) = (void *)(uVar3 + (int)pvVar4); } local_8._0_1_ = 4; *(int *)((int)this + 0x38) = other->_startingPill; *(int *)((int)this + 0x3c) = other->_startingCard; *(int *)((int)this + 0x40) = other->_endStage; *(int *)((int)this + 0x44) = other->_playerType; *(undefined4 *)((int)this + 0x48) = 0; *(undefined4 *)((int)this + 0x4c) = 0; *(undefined4 *)((int)this + 0x50) = 0; pvVar1 = (other->_achievementList)._begin; pvVar4 = (other->_achievementList)._end; if (pvVar1 != pvVar4) { sVar2 = (int)pvVar4 - (int)pvVar1; uVar3 = (int)sVar2 >> 2; if (0x3fffffff < uVar3) goto LAB_0095c2fe; uVar3 = uVar3 * 4; pvVar4 = std::_Allocate(uVar3); *(void **)((int)this + 0x48) = pvVar4; *(void **)((int)this + 0x4c) = pvVar4; *(void **)((int)this + 0x50) = (void *)((int)pvVar4 + uVar3); pvVar4 = *(void **)((int)this + 0x48); memmove(pvVar4,pvVar1,sVar2); *(void **)((int)this + 0x4c) = (void *)(uVar3 + (int)pvVar4); } local_8._0_1_ = 5; *(int *)((int)this + 0x54) = other->_soulHearts; *(int *)((int)this + 0x58) = other->_blackHearts; *(int *)((int)this + 0x5c) = other->_hearts; *(int *)((int)this + 0x60) = other->_maxHearts; *(int *)((int)this + 100) = other->_coins; *(float *)((int)this + 0x68) = other->_addDamage; *(byte *)((int)this + 0x6c) = other->_canShoot; *(int *)((int)this + 0x70) = other->_difficulty; *(byte *)((int)this + 0x74) = other->_isMegaSatan; *(float *)((int)this + 0x78) = other->_minFireRate; *(byte *)((int)this + 0x7c) = other->_maxDamage; *(byte *)((int)this + 0x7d) = other->_minShotSpeed; *(byte *)((int)this + 0x7e) = other->_bigRange; *(byte *)((int)this + 0x7f) = other->_isPathTypeSet; *(int *)((int)this + 0x80) = other->_pathType; *(int *)((int)this + 0x84) = other->_getCurse; *(int *)((int)this + 0x88) = other->_curseFilter; std::vector::copy_constructor(&other->_collectibleTwinList); local_8._0_1_ = 6; *(undefined4 *)((int)this + 0x98) = 0; *(undefined4 *)((int)this + 0x9c) = 0; *(undefined4 *)((int)this + 0xa0) = 0; pvVar1 = (other->_seedEffects)._begin; pvVar4 = (other->_seedEffects)._end; if (pvVar1 != pvVar4) { sVar2 = (int)pvVar4 - (int)pvVar1; uVar3 = (int)sVar2 >> 2; if (0x3fffffff < uVar3) { LAB_0095c2fe: /* WARNING: Subroutine does not return */ FUN_0040cee0(); } uVar3 = uVar3 * 4; pvVar4 = std::_Allocate(uVar3); *(void **)((int)this + 0x98) = pvVar4; *(void **)((int)this + 0x9c) = pvVar4; *(void **)((int)this + 0xa0) = (void *)((int)pvVar4 + uVar3); pvVar4 = *(void **)((int)this + 0x98); memmove(pvVar4,pvVar1,sVar2); *(void **)((int)this + 0x9c) = (void *)((int)pvVar4 + uVar3); } ExceptionList = local_10; return this; } //@@ 0095c310 std::vector::_Change_array /* DB: destroys old 0xa4-byte elements (FUN_004269f0), frees, installs new buffer; _Emplace_reallocate/_Resize_reallocate */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FUN_004269f0(); pvVar1 = (void *)((int)pvVar1 + 0xa4); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0xa4) * 0xa4; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0xa4 + param_1; in_ECX[2] = param_3 * 0xa4 + param_1; return; } //@@ 0095c3b0 std::_Uninitialized_copy /* DB: ChallengeParams::copy_constructor over the range; std::vector::_Emplace_reallocate/_Resize_reallocate */ void std::_Uninitialized_copy (ChallengeParam *param_1,ChallengeParam *param_2,void *param_3) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c57d; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 1) { ChallengeParams::copy_constructor(param_3,param_1); param_3 = (void *)((int)param_3 + 0xa4); ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 0095c430 FUN_0095c430 int FUN_0095c430(int param_1,int param_2,int param_3) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c57d; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 0xa4) { ChallengeParams::ChallengeParams(param_1); param_3 = param_3 + 0xa4; ppvVar1 = ExceptionList; } ExceptionList = local_10; return param_3; } //@@ 0095c4b0 std::vector::_Udefault /* DB: default-constructs n ChallengeParams (0xa4 stride) at param_1; challenges_xml_load */ void * std::vector::_Udefault(void *param_1,int param_2) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c5ad; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_2 != 0; param_2 = param_2 + -1) { ChallengeParams::ChallengeParams(param_1); param_1 = (void *)((int)param_1 + 0xa4); ppvVar1 = ExceptionList; } ExceptionList = local_10; return param_1; } //@@ 0095c520 std::vector::_Resize_reallocate /* DB: 0xa4-byte ChallengeParams, grows to 0x2e (46) default-constructed entries; challenges_xml_load */ void std::vector::_Resize_reallocate(void) { void *pvVar1; int *in_ECX; uint uVar2; int iVar3; void *this; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c5dd; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = (in_ECX[1] - *in_ECX) / 0xa4; uVar2 = (in_ECX[2] - *in_ECX) / 0xa4; if (0x18f9c18 - (uVar2 >> 1) < uVar2) { uVar2 = 0x18f9c18; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < 0x2e) { uVar2 = 0x2e; } else if (0x18f9c18 < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar1 = _Allocate(uVar2 * 0xa4); this = (void *)(iVar3 * 0xa4 + (int)pvVar1); local_8 = 1; for (iVar3 = 0x2e - iVar3; iVar3 != 0; iVar3 = iVar3 + -1) { ChallengeParams::ChallengeParams(this); this = (void *)((int)this + 0xa4); } local_8 = local_8 & 0xffffff00; _Uninitialized_copy(*in_ECX,in_ECX[1],pvVar1); _Change_array(pvVar1,0x2e,uVar2); ExceptionList = local_10; return; } //@@ 0095c63e Catch_All@0095c63e void Catch_All_0095c63e(void) { int unaff_EBP; FUN_0095be60(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x1c)); FUN_0095be90(*(undefined4 *)(unaff_EBP + -0x20),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 0095c670 FUN_0095c670 void FUN_0095c670(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; for (iVar2 = *in_ECX; iVar2 != iVar1; iVar2 = iVar2 + 0xa4) { FUN_004269f0(); } return; } //@@ 0095c6a0 ChallengeParams::ChallengeParams /* DB: ? move constructor: only caller FUN_0095c430 (uninitialized move of 0xa4-byte elements) from std::vector::_Emplace_reallocate; moves the leading std::string (source reset to cap 0xf), swaps a tree head (+0x18/+0x1c, fresh 0x14-byte head), steals three vectors (+0x20.., +0x2c..) */ void ChallengeParams::ChallengeParams(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; void *pvVar4; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ac3d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; local_8 = 0; in_ECX[6] = 0; in_ECX[7] = 0; pvVar4 = operator_new(0x14); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; *(undefined2 *)((int)pvVar4 + 0xc) = 0x101; in_ECX[6] = pvVar4; in_ECX[6] = param_1[6]; param_1[6] = pvVar4; uVar1 = in_ECX[7]; in_ECX[7] = param_1[7]; param_1[7] = uVar1; uVar1 = param_1[10]; uVar2 = param_1[9]; uVar3 = param_1[8]; param_1[10] = 0; param_1[9] = 0; param_1[8] = 0; in_ECX[8] = uVar3; in_ECX[9] = uVar2; in_ECX[10] = uVar1; uVar1 = param_1[0xd]; uVar2 = param_1[0xc]; uVar3 = param_1[0xb]; param_1[0xd] = 0; param_1[0xc] = 0; param_1[0xb] = 0; in_ECX[0xb] = uVar3; in_ECX[0xc] = uVar2; in_ECX[0xd] = uVar1; in_ECX[0xe] = param_1[0xe]; in_ECX[0xf] = param_1[0xf]; in_ECX[0x10] = param_1[0x10]; in_ECX[0x11] = param_1[0x11]; uVar1 = param_1[0x12]; uVar2 = param_1[0x14]; uVar3 = param_1[0x13]; param_1[0x14] = 0; param_1[0x13] = 0; param_1[0x12] = 0; in_ECX[0x12] = uVar1; in_ECX[0x13] = uVar3; in_ECX[0x14] = uVar2; in_ECX[0x15] = param_1[0x15]; in_ECX[0x16] = param_1[0x16]; in_ECX[0x17] = param_1[0x17]; in_ECX[0x18] = param_1[0x18]; in_ECX[0x19] = param_1[0x19]; in_ECX[0x1a] = param_1[0x1a]; *(undefined1 *)(in_ECX + 0x1b) = *(undefined1 *)(param_1 + 0x1b); in_ECX[0x1c] = param_1[0x1c]; *(undefined1 *)(in_ECX + 0x1d) = *(undefined1 *)(param_1 + 0x1d); in_ECX[0x1e] = param_1[0x1e]; *(undefined1 *)(in_ECX + 0x1f) = *(undefined1 *)(param_1 + 0x1f); *(undefined1 *)((int)in_ECX + 0x7d) = *(undefined1 *)((int)param_1 + 0x7d); *(undefined1 *)((int)in_ECX + 0x7e) = *(undefined1 *)((int)param_1 + 0x7e); *(undefined1 *)((int)in_ECX + 0x7f) = *(undefined1 *)((int)param_1 + 0x7f); in_ECX[0x20] = param_1[0x20]; in_ECX[0x21] = param_1[0x21]; in_ECX[0x22] = param_1[0x22]; uVar1 = param_1[0x25]; uVar2 = param_1[0x24]; uVar3 = param_1[0x23]; param_1[0x25] = 0; param_1[0x24] = 0; param_1[0x23] = 0; in_ECX[0x23] = uVar3; in_ECX[0x24] = uVar2; in_ECX[0x25] = uVar1; uVar1 = param_1[0x26]; uVar2 = param_1[0x28]; uVar3 = param_1[0x27]; param_1[0x28] = 0; param_1[0x27] = 0; param_1[0x26] = 0; in_ECX[0x26] = uVar1; in_ECX[0x27] = uVar3; in_ECX[0x28] = uVar2; ExceptionList = local_10; return; } //@@ 0095c8f0 FUN_0095c8f0 void FUN_0095c8f0(void) { undefined4 *in_ECX; *in_ECX = IsaacRepentancePlus::Cutscene::PartBase::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 3)); return; } //@@ 0095c900 FUN_0095c900 undefined4 FUN_0095c900(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x78); } //@@ 0095c910 FUN_0095c910 undefined4 FUN_0095c910(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x7c); } //@@ 0095c930 FUN_0095c930 int FUN_0095c930(void) { int iVar1; int iVar2; int in_ECX; iVar1 = *(int *)(*(int *)(in_ECX + 0x5c) + 4); if (iVar1 == 0) { return 0; } iVar2 = *(int *)(iVar1 + 0x60) / 2; if (*(char *)(iVar1 + 0x40) == '\0') { iVar2 = *(int *)(iVar1 + 0x60); } return iVar2; } //@@ 0095c960 FUN_0095c960 undefined4 FUN_0095c960(void) { int iVar1; int in_ECX; iVar1 = *(int *)(*(int *)(in_ECX + 0x5c) + 4); if (iVar1 == 0) { return 0; } return *(undefined4 *)(iVar1 + 100); } //@@ 0095c980 FUN_0095c980 undefined4 FUN_0095c980(void) { return 0x1e0; } //@@ 0095c990 FUN_0095c990 undefined4 FUN_0095c990(void) { return 0x10e; } //@@ 0095c9a0 FUN_0095c9a0 void FUN_0095c9a0(byte param_1) { undefined4 *in_ECX; *in_ECX = IsaacRepentancePlus::Cutscene::PartBase::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 3)); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x40); } return; } //@@ 0095c9d0 FUN_0095c9d0 void FUN_0095c9d0(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x20)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x34)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x2c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x26)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x16)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); *in_ECX = IsaacRepentancePlus::Cutscene::PartBase::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 3)); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x1a0); } ExceptionList = local_10; return; } //@@ 0095ca80 FUN_0095ca80 void FUN_0095ca80(byte param_1) { undefined4 *in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); *in_ECX = IsaacRepentancePlus::Cutscene::PartBase::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 3)); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } return; } //@@ 0095cac0 FUN_0095cac0 void FUN_0095cac0(byte param_1) { undefined4 *puVar1; undefined4 *in_ECX; std::string::_Tidy_deallocate((char *)(in_ECX + 0x3c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x36)); Font::Unload((Font *)(in_ECX + 0x23)); puVar1 = in_ECX + 0x33; FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(in_ECX[0x33] + 4)); operator_delete((void *)*puVar1,0x18); FUN_004b3950(); Font::Unload((Font *)(in_ECX + 0x10)); puVar1 = in_ECX + 0x20; FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(in_ECX[0x20] + 4)); operator_delete((void *)*puVar1,0x18); FUN_004b3950(); *in_ECX = IsaacRepentancePlus::Cutscene::PartBase::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 3)); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x108); } return; } //@@ 0095cb80 FUN_0095cb80 void FUN_0095cb80(void) { __ftoui3(); return; } //@@ 0095cc00 Cutscene::load_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: parses cutscenes.xml ("cutscenes"/"cutscene"/"anm2part"/"videopart"/"letterbox"/"subtitles"), builds CutsceneEntry array (CutsceneEntry::Destructor callee); called from manager config loader 0x952df0 prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Cutscene::load_xml(Cutscene *this,byte *path) { undefined4 *puVar1; int ****ppppiVar2; byte bVar3; uint uVar4; int *file; int iVar5; byte *text; void *cutsceneNode; void *rootAttr; int iVar6; byte *****pppppbVar7; int ****ptr; int *****pppppiVar8; int *****pppppiVar9; byte *pbVar10; byte *pbVar11; char *pcVar12; uint valueLength; byte *pbVar13; byte *pbVar14; std_string *psVar15; undefined4 *puVar16; void **destParts; uint deleteSize; bool bVar17; byte *pbStack_10114; void *destPartsBegin; byte *pbStack_100f8; byte *part; CutsceneEntry entry; byte *****entryName [4]; uint entryNameSize; uint entryNameCapacity; void *entryPartsBegin; int entryPartsEnd; undefined4 entryPartsCapacity; undefined2 uStack_100c8; KColor fadeColor; undefined4 uStack_100ac; undefined1 uStack_100a8; undefined1 auStack_100a0 [48]; undefined1 auStack_10070 [65564]; byte *****rootPath [4]; uint rootPathSize; uint rootPathCapacity; int *****fullPath; KColor KStack_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; float *destFadeColor; puStack_20 = (undefined1 *)(rootPath + 0x14); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00b0c69e; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(rootPath + 0x11); ExceptionList = &local_1c; *(undefined4 *)this = 0; local_24 = uVar4; file = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (file == (int *)0x0) { bVar3 = 0; } else { iVar5 = (**(code **)(*file + 4))(uVar4); text = operator_new_tracked(iVar5 + 1); (**(code **)(*file + 0x14))(text,1,iVar5); text[iVar5] = 0; (**(code **)*file)(1); KColor::SetFromARGB(&KStack_38,0xffffc0cb); *(float *)&this->field_0x30 = KStack_38._red; *(float *)&this->field_0x34 = KStack_38._green; *(float *)&this->field_0x38 = KStack_38._blue; *(float *)&this->field_0x3c = KStack_38._alpha; *(int *)&this->field_0x40 = KStack_38._unk; FUN_00413b90(); local_14 = (byte ****)0x0; uVar4 = 0x95ccfe; pbVar14 = text; rapidxml::xml_document::parse(auStack_100a0,text); bVar3 = (byte)pbVar14; cutsceneNode = xml_node::first_node(auStack_100a0,(byte *)"cutscenes",uVar4,bVar3); rootAttr = xml_node::first_attribute(cutsceneNode,&DAT_00b66f40,uVar4,bVar3); rootPathSize = 0; rootPathCapacity = 0xf; rootPath[0] = (byte *****)0x0; pbVar14 = &g_xmlNullStr; if (*(byte **)((int)rootAttr + 4) != (byte *)0x0) { pbVar14 = *(byte **)((int)rootAttr + 4); } pbVar10 = pbVar14; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); uVar4 = (int)pbVar10 - (int)(pbVar14 + 1); std::string::assign((char *)rootPath,pbVar14,uVar4); for (cutsceneNode = xml_node::first_node (cutsceneNode,(byte *)"cutscene",(int)pbVar14,(byte)uVar4); cutsceneNode != (void *)0x0; cutsceneNode = *(void **)((int)cutsceneNode + 0x2c)) { entry = (CutsceneEntry)0x0; entryNameSize = 0; entryNameCapacity = 0xf; entryName[0] = (byte *****)0x0; entryPartsBegin = (void *)0x0; entryPartsEnd = 0; entryPartsCapacity = 0; uStack_100c8 = 0; fadeColor._unk = 0; fadeColor._red = 0.0; fadeColor._green = 0.0; fadeColor._blue = 0.0; fadeColor._alpha = 1.0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14 = (byte ****)CONCAT31(local_14._1_3_,2); puVar16 = *(undefined4 **)((int)cutsceneNode + 0x20); if (puVar16 == (undefined4 *)0x0) { LAB_0095d00e: iVar5 = (int)entry * 0x4c; *(CutsceneEntry *)(&this->field_0x4 + iVar5) = entry; if ((byte ******)(&this->field_0x8 + iVar5) != entryName) { pppppbVar7 = (byte *****)entryName; if (0xf < entryNameCapacity) { pppppbVar7 = entryName[0]; } std::string::assign(&this->field_0x8 + iVar5,(byte *)pppppbVar7,entryNameSize); } destParts = (void **)(&this->field_0x20 + iVar5); if (destParts != &entryPartsBegin) { pbStack_100f8 = (byte *)(entryPartsEnd - (int)entryPartsBegin); destPartsBegin = *destParts; if ((uint)((int)destParts[2] - (int)destPartsBegin >> 2) < (uint)((int)pbStack_100f8 >> 2) ) { std::vector::reserve_clear((int)pbStack_100f8 >> 2); destPartsBegin = *destParts; } memmove(destPartsBegin,entryPartsBegin,(size_t)pbStack_100f8); destParts[1] = pbStack_100f8 + (int)destPartsBegin; } (&this->field_0x2c)[iVar5] = (undefined1)uStack_100c8; (&this->field_0x2d)[iVar5] = uStack_100c8._1_1_; destFadeColor = (float *)(&this->field_0x30 + iVar5); *destFadeColor = fadeColor._red; destFadeColor[1] = fadeColor._green; destFadeColor[2] = fadeColor._blue; destFadeColor[3] = fadeColor._alpha; *(int *)(&this->field_0x40 + iVar5) = fadeColor._unk; *(undefined4 *)(&this->field_0x44 + iVar5) = 0xffffffff; (&this->field_0x4c)[iVar5] = uStack_100a8; (&this->field_0x4d)[iVar5] = 0; iVar6 = (int)entry * 0x4c; *(undefined4 *)(&this->field_0x48 + iVar5) = uStack_100ac; for (puVar16 = *(undefined4 **)((int)cutsceneNode + 0x18); puVar16 != (undefined4 *)0x0; puVar16 = (undefined4 *)puVar16[0xb]) { pcVar12 = "anm2part"; pbVar14 = &g_xmlNullStr; if ((byte *)*puVar16 != (byte *)0x0) { pbVar14 = (byte *)*puVar16; } pbVar10 = pbVar14; do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d168: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d16d; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d168; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d16d: if (uVar4 == 0) { pbStack_10114 = operator_new(0x1a0); if (pbStack_10114 == (byte *)0x0) { part = (byte *)0x0; } else { pbStack_10114[8] = 0; pbStack_10114[0xc] = 0; pbStack_10114[0xd] = 0; pbStack_10114[0xe] = 0; pbStack_10114[0xf] = 0; pbStack_10114[0x1c] = 0; pbStack_10114[0x1d] = 0; pbStack_10114[0x1e] = 0; pbStack_10114[0x1f] = 0; pbStack_10114[0x20] = 0xf; pbStack_10114[0x21] = 0; pbStack_10114[0x22] = 0; pbStack_10114[0x23] = 0; pbStack_10114[0xc] = 0; pbStack_10114[0x24] = 0; pbStack_10114[0x25] = 0; pbStack_10114[0x26] = 0; pbStack_10114[0x27] = 0; pbStack_10114[0x28] = 0; pbStack_10114[0x29] = 0; pbStack_10114[0x2a] = 0; pbStack_10114[0x2b] = 0; pbStack_10114[0x2c] = 0; pbStack_10114[0x2d] = 0; pbStack_10114[0x2e] = 0; pbStack_10114[0x2f] = 0; pbStack_10114[0x30] = 0; pbStack_10114[0x31] = 0; pbStack_10114[0x32] = 0; pbStack_10114[0x33] = 0; pbStack_10114[0x34] = 0; pbStack_10114[0x35] = 0; pbStack_10114[0x36] = 0x80; pbStack_10114[0x37] = 0x3f; *(undefined ***)pbStack_10114 = IsaacRepentancePlus::Cutscene::ANM2Part::vftable; pbStack_10114[0x40] = 0; pbStack_10114[0x41] = 0; pbStack_10114[0x42] = 0; pbStack_10114[0x43] = 0; pbStack_10114[0x50] = 0; pbStack_10114[0x51] = 0; pbStack_10114[0x52] = 0; pbStack_10114[0x53] = 0; pbStack_10114[0x54] = 0xf; pbStack_10114[0x55] = 0; pbStack_10114[0x56] = 0; pbStack_10114[0x57] = 0; pbStack_10114[0x40] = 0; pbStack_10114[0x58] = 0; pbStack_10114[0x59] = 0; pbStack_10114[0x5a] = 0; pbStack_10114[0x5b] = 0; pbStack_10114[0x68] = 0; pbStack_10114[0x69] = 0; pbStack_10114[0x6a] = 0; pbStack_10114[0x6b] = 0; pbStack_10114[0x6c] = 0xf; pbStack_10114[0x6d] = 0; pbStack_10114[0x6e] = 0; pbStack_10114[0x6f] = 0; pbStack_10114[0x58] = 0; local_14 = (byte ****)CONCAT31(local_14._1_3_,6); pbStack_10114[0x70] = 0; pbStack_10114[0x71] = 0; pbStack_10114[0x72] = 0; pbStack_10114[0x73] = 0; pbStack_10114[0x74] = 0; pbStack_10114[0x75] = 0; pbStack_10114[0x76] = 0; pbStack_10114[0x77] = 0; pbStack_10114[0x78] = 0; pbStack_10114[0x79] = 0; pbStack_10114[0x7a] = 0; pbStack_10114[0x7b] = 0; pbStack_10114[0x7c] = 0; pbStack_10114[0x7d] = 0; pbStack_10114[0x7e] = 0; pbStack_10114[0x7f] = 0; part = pbStack_10114; ANM2::constructor((ANM2 *)(pbStack_10114 + 0x80)); part[0x194] = 0; part[0x195] = 0; part[0x196] = 0; part[0x197] = 0; part[0x198] = 0; part[0x199] = 0; part[0x19a] = 0; part[0x19b] = 0; } local_14 = (byte ****)CONCAT31(local_14._1_3_,2); for (puVar1 = (undefined4 *)puVar16[8]; puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)puVar1[6]) { pbVar14 = (byte *)*puVar1; pbVar11 = &DAT_00b1bff4; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < *pbVar11; if (bVar3 != *pbVar11) { LAB_0095d2a1: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d2a6; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < pbVar11[1]; if (bVar3 != pbVar11[1]) goto LAB_0095d2a1; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d2a6: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar14 = (byte *)puVar1[1]; } pbVar10 = pbVar14; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); valueLength = (int)pbVar10 - (int)(pbVar14 + 1); if (0x7fffffff - rootPathSize < valueLength) goto LAB_0095decb; pppppbVar7 = (byte *****)rootPath; if (0xf < rootPathCapacity) { pppppbVar7 = rootPath[0]; } std::string::concat((char *)&fullPath,(int)pbStack_10114,(std_string *)valueLength, (byte *)pppppbVar7,rootPathSize,pbVar14,valueLength); pbVar14 = part; pppppiVar8 = (int *****)(part + 0x40); if ((int ******)pppppiVar8 == &fullPath) { if (0xf < (uint)KStack_38._unk) { uVar4 = KStack_38._unk + 1; pppppiVar8 = fullPath; if (0xfff < uVar4) { pppppiVar8 = (int *****)fullPath[-1]; uVar4 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)fullPath + (-4 - (int)pppppiVar8))) goto LAB_0095dbaf; } operator_delete(pppppiVar8,uVar4); } } else { std::string::_Tidy_deallocate((char *)pppppiVar8); *pppppiVar8 = (int ****)fullPath; *(float *)(pbVar14 + 0x44) = KStack_38._red; *(float *)(pbVar14 + 0x48) = KStack_38._green; *(float *)(pbVar14 + 0x4c) = KStack_38._blue; *(float *)(pbVar14 + 0x50) = KStack_38._alpha; *(int *)(pbVar14 + 0x54) = KStack_38._unk; } } else { pbVar11 = &DAT_00b1bffc; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < *pbVar11; if (bVar3 != *pbVar11) { LAB_0095d3f0: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d3f5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < pbVar11[1]; if (bVar3 != pbVar11[1]) goto LAB_0095d3f0; pbVar11 = pbVar11 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d3f5: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar14 = (byte *)puVar1[1]; } pbVar10 = pbVar14; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)(part + 0x58),pbVar14, (int)pbVar10 - (int)(pbVar14 + 1)); } else { pcVar12 = "music"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d460: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d465; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d460; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d465: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar14 = (byte *)puVar1[1]; } iVar5 = atoi((char *)pbVar14); *(int *)(part + 0x70) = iVar5; } else { pcVar12 = "musicDelay"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d4c0: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d4c5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d4c0; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d4c5: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar14 = (byte *)puVar1[1]; } iVar5 = atoi((char *)pbVar14); *(int *)(part + 0x74) = iVar5; } else { pcVar12 = "width"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d520: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d525; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d520; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d525: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar14 = (byte *)puVar1[1]; } iVar5 = atoi((char *)pbVar14); *(int *)(part + 0x78) = iVar5; } else { pcVar12 = "height"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d580: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d585; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d580; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d585: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar14 = (byte *)puVar1[1]; } iVar5 = atoi((char *)pbVar14); *(int *)(part + 0x7c) = iVar5; } } } } } } if (puVar1[4] == 0) break; } if ((*(int *)(part + 0x50) != 0) && (*(int *)(part + 0x68) != 0)) { puVar1 = *(undefined4 **)(&this->field_0x24 + iVar6); if (puVar1 == *(undefined4 **)(&this->field_0x28 + iVar6)) { pbStack_100f8 = part; std::vector<4byte>::_Emplace_reallocate(puVar1,&pbStack_100f8); } else { *puVar1 = part; *(int *)(&this->field_0x24 + iVar6) = *(int *)(&this->field_0x24 + iVar6) + 4; } } LAB_0095d9e0: for (pbVar14 = (byte *)puVar16[8]; pbStack_100f8 = pbVar14, pbVar14 != (byte *)0x0; pbVar14 = *(byte **)(pbVar14 + 0x18)) { pbVar10 = *(byte **)pbVar14; pcVar12 = "letterbox"; pbVar11 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar11 = pbVar10; } do { bVar3 = *pbVar11; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095da28: uVar4 = -(uint)bVar17 | 1; goto LAB_0095da2d; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095da28; pbVar11 = pbVar11 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095da2d: if (uVar4 == 0) { fullPath = (int *****)0x0; KStack_38._alpha = 0.0; pbVar10 = &g_xmlNullStr; if (*(byte **)(pbVar14 + 4) != (byte *)0x0) { pbVar10 = *(byte **)(pbVar14 + 4); } KStack_38._unk = 0xf; pbVar14 = pbVar10; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)&fullPath,pbVar10,(int)pbVar14 - (int)(pbVar10 + 1)); uVar4 = KStack_38._unk; pppppiVar8 = fullPath; if (KStack_38._alpha == 0.0) { LAB_0095dae4: bVar3 = 0; pppppiVar8 = fullPath; uVar4 = KStack_38._unk; } else { pppppiVar9 = (int *****)&fullPath; if (0xf < (uint)KStack_38._unk) { pppppiVar9 = fullPath; } if (KStack_38._alpha == 5.60519e-45) { iVar5 = memcmp_eq(pppppiVar9,&DAT_00b64fe8,4); if (iVar5 != 0) goto LAB_0095daa3; } else { LAB_0095daa3: pppppiVar9 = (int *****)&fullPath; if (0xf < uVar4) { pppppiVar9 = pppppiVar8; } if (KStack_38._alpha == 5.60519e-45) { iVar5 = memcmp_eq(pppppiVar9,&DAT_00b64ff0,4); if (iVar5 == 0) goto LAB_0095dae0; } pppppiVar9 = (int *****)&fullPath; if (0xf < uVar4) { pppppiVar9 = pppppiVar8; } iVar5 = atoi((char *)pppppiVar9); if (iVar5 == 0) goto LAB_0095dae4; pppppiVar8 = fullPath; uVar4 = KStack_38._unk; } LAB_0095dae0: bVar3 = 1; } part[8] = bVar3; if (0xf < uVar4) { deleteSize = uVar4 + 1; pppppiVar9 = pppppiVar8; if (0xfff < deleteSize) { pppppiVar9 = (int *****)pppppiVar8[-1]; deleteSize = uVar4 + 0x24; if (0x1f < (uint)((int)pppppiVar8 + (-4 - (int)pppppiVar9))) goto LAB_0095dbaf; } operator_delete(pppppiVar9,deleteSize); } pbVar14 = pbStack_100f8; } else { pcVar12 = "subtitles"; pbVar11 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar11 = pbVar10; } do { bVar3 = *pbVar11; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095dbe4: uVar4 = -(uint)bVar17 | 1; goto LAB_0095dbe9; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095dbe4; pbVar11 = pbVar11 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095dbe9: if (uVar4 == 0) { pbVar10 = &g_xmlNullStr; if (*(byte **)(pbVar14 + 4) != (byte *)0x0) { pbVar10 = *(byte **)(pbVar14 + 4); } pbVar11 = pbVar10; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); psVar15 = (std_string *)(pbVar11 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - rootPathSize) < psVar15) { LAB_0095decb: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppbVar7 = (byte *****)rootPath; if (0xf < rootPathCapacity) { pppppbVar7 = rootPath[0]; } std::string::concat((char *)&fullPath,(int)pbStack_10114,psVar15, (byte *)pppppbVar7,rootPathSize,pbVar10,(uint)psVar15); pbVar10 = part; pppppiVar8 = (int *****)(part + 0xc); if ((int ******)pppppiVar8 != &fullPath) { std::string::_Tidy_deallocate((char *)pppppiVar8); pppppiVar9 = fullPath; fullPath = (int *****)((uint)fullPath & 0xffffff00); *pppppiVar8 = (int ****)pppppiVar9; *(float *)(pbVar10 + 0x10) = KStack_38._red; *(float *)(pbVar10 + 0x14) = KStack_38._green; *(float *)(pbVar10 + 0x18) = KStack_38._blue; *(float *)(pbVar10 + 0x1c) = KStack_38._alpha; *(int *)(pbVar10 + 0x20) = KStack_38._unk; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; } std::string::_Tidy_deallocate((char *)&fullPath); } } if (*(int *)(pbVar14 + 0x10) == 0) break; } } else { pcVar12 = "videopart"; pbVar10 = pbVar14; do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d5f0: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d5f5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d5f0; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d5f5: if (uVar4 == 0) { part = operator_new(0x60); if (part == (byte *)0x0) { part = (byte *)0x0; } else { part[8] = 0; part[0xc] = 0; part[0xd] = 0; part[0xe] = 0; part[0xf] = 0; part[0x1c] = 0; part[0x1d] = 0; part[0x1e] = 0; part[0x1f] = 0; part[0x20] = 0xf; part[0x21] = 0; part[0x22] = 0; part[0x23] = 0; part[0xc] = 0; part[0x24] = 0; part[0x25] = 0; part[0x26] = 0; part[0x27] = 0; part[0x28] = 0; part[0x29] = 0; part[0x2a] = 0; part[0x2b] = 0; part[0x2c] = 0; part[0x2d] = 0; part[0x2e] = 0; part[0x2f] = 0; part[0x30] = 0; part[0x31] = 0; part[0x32] = 0; part[0x33] = 0; part[0x34] = 0; part[0x35] = 0; part[0x36] = 0x80; part[0x37] = 0x3f; *(undefined ***)part = IsaacRepentancePlus::Cutscene::VideoPart::vftable; part[0x40] = 0; part[0x41] = 0; part[0x42] = 0; part[0x43] = 0; part[0x50] = 0; part[0x51] = 0; part[0x52] = 0; part[0x53] = 0; part[0x54] = 0xf; part[0x55] = 0; part[0x56] = 0; part[0x57] = 0; part[0x40] = 0; part[0x58] = 0; *(undefined1 **)(part + 0x5c) = &this->field_0x80c; } pbVar14 = (byte *)puVar16[8]; while (pbVar14 != (byte *)0x0) { pbVar10 = *(byte **)pbVar14; pbVar13 = &DAT_00b7c82c; pbVar11 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar11 = pbVar10; } do { bVar3 = *pbVar11; bVar17 = bVar3 < *pbVar13; if (bVar3 != *pbVar13) { LAB_0095d6e1: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d6e6; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar17 = bVar3 < pbVar13[1]; if (bVar3 != pbVar13[1]) goto LAB_0095d6e1; pbVar11 = pbVar11 + 2; pbVar13 = pbVar13 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d6e6: pbStack_100f8 = pbVar14; if (uVar4 == 0) { pbVar10 = &g_xmlNullStr; if (*(byte **)(pbVar14 + 4) != (byte *)0x0) { pbVar10 = *(byte **)(pbVar14 + 4); } pbVar11 = pbVar10; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); psVar15 = (std_string *)(pbVar11 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - rootPathSize) < psVar15) goto LAB_0095decb; pppppbVar7 = (byte *****)rootPath; if (0xf < rootPathCapacity) { pppppbVar7 = rootPath[0]; } std::string::concat((char *)&fullPath,(int)pbStack_10114,psVar15, (byte *)pppppbVar7,rootPathSize,pbVar10,(uint)psVar15); pbVar10 = part; pppppiVar8 = (int *****)(part + 0x40); if ((int ******)pppppiVar8 == &fullPath) { if (0xf < (uint)KStack_38._unk) { uVar4 = KStack_38._unk + 1; pppppiVar8 = fullPath; if (0xfff < uVar4) { pppppiVar8 = (int *****)fullPath[-1]; uVar4 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)fullPath + (-4 - (int)pppppiVar8))) goto LAB_0095dbaf; } operator_delete(pppppiVar8,uVar4); } } else { uVar4 = *(uint *)(part + 0x54); if (0xf < uVar4) { ppppiVar2 = *pppppiVar8; deleteSize = uVar4 + 1; ptr = ppppiVar2; if (0xfff < deleteSize) { ptr = (int ****)ppppiVar2[-1]; deleteSize = uVar4 + 0x24; if (0x1f < (uint)((int)ppppiVar2 + (-4 - (int)ptr))) goto LAB_0095dbaf; } operator_delete(ptr,deleteSize); } pbVar10[0x50] = 0; pbVar10[0x51] = 0; pbVar10[0x52] = 0; pbVar10[0x53] = 0; pbVar10[0x54] = 0xf; pbVar10[0x55] = 0; pbVar10[0x56] = 0; pbVar10[0x57] = 0; *pppppiVar8 = (int ****)fullPath; *(float *)(pbVar10 + 0x44) = KStack_38._red; *(float *)(pbVar10 + 0x48) = KStack_38._green; *(float *)(pbVar10 + 0x4c) = KStack_38._blue; *(float *)(pbVar10 + 0x50) = KStack_38._alpha; *(int *)(pbVar10 + 0x54) = KStack_38._unk; } LAB_0095d7a6: pbStack_100f8 = pbVar14; } else { pcVar12 = "keepMusic"; pbVar11 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar11 = pbVar10; } do { bVar3 = *pbVar11; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095d865: uVar4 = -(uint)bVar17 | 1; goto LAB_0095d86a; } if (bVar3 == 0) break; bVar3 = pbVar11[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095d865; pbVar11 = pbVar11 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095d86a: if (uVar4 != 0) goto LAB_0095d7a6; fullPath = (int *****)0x0; KStack_38._alpha = 0.0; pbVar10 = &g_xmlNullStr; if (*(byte **)(pbVar14 + 4) != (byte *)0x0) { pbVar10 = *(byte **)(pbVar14 + 4); } KStack_38._unk = 0xf; pbVar14 = pbVar10; do { bVar3 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar3 != 0); std::string::assign((char *)&fullPath,pbVar10,(int)pbVar14 - (int)(pbVar10 + 1)); if (KStack_38._alpha == 0.0) { LAB_0095d96c: bVar3 = 0; } else { pppppiVar8 = (int *****)&fullPath; if (0xf < (uint)KStack_38._unk) { pppppiVar8 = fullPath; } if (KStack_38._alpha == 5.60519e-45) { if ((*pppppiVar8 == (int ****)0x65757274) || ((((bVar3 = (byte)*pppppiVar8, bVar17 = bVar3 < 0x74, bVar3 == 0x74 && (bVar17 = *(byte *)((int)pppppiVar8 + 1) < 0x72, *(byte *)((int)pppppiVar8 + 1) == 0x72)) && (bVar17 = *(byte *)((int)pppppiVar8 + 2) < 0x75, *(byte *)((int)pppppiVar8 + 2) == 0x75)) && (bVar17 = *(byte *)((int)pppppiVar8 + 3) < 0x65, *(byte *)((int)pppppiVar8 + 3) == 0x65)))) { uVar4 = 0; } else { uVar4 = -(uint)bVar17 | 1; } if (uVar4 != 0) goto LAB_0095d909; } else { LAB_0095d909: pppppiVar8 = (int *****)&fullPath; if (0xf < (uint)KStack_38._unk) { pppppiVar8 = fullPath; } if (KStack_38._alpha == 5.60519e-45) { if ((*pppppiVar8 == (int ****)0x65757254) || (((bVar3 = (byte)*pppppiVar8, bVar17 = bVar3 < 0x54, bVar3 == 0x54 && (bVar17 = *(byte *)((int)pppppiVar8 + 1) < 0x72, *(byte *)((int)pppppiVar8 + 1) == 0x72)) && ((bVar17 = *(byte *)((int)pppppiVar8 + 2) < 0x75, *(byte *)((int)pppppiVar8 + 2) == 0x75 && (bVar17 = *(byte *)((int)pppppiVar8 + 3) < 0x65, *(byte *)((int)pppppiVar8 + 3) == 0x65)))))) { uVar4 = 0; } else { uVar4 = -(uint)bVar17 | 1; } if (uVar4 == 0) goto LAB_0095d968; } pppppiVar8 = (int *****)&fullPath; if (0xf < (uint)KStack_38._unk) { pppppiVar8 = fullPath; } iVar5 = atoi((char *)pppppiVar8); if (iVar5 == 0) goto LAB_0095d96c; } LAB_0095d968: bVar3 = 1; } part[0x58] = bVar3; if (0xf < (uint)KStack_38._unk) { uVar4 = KStack_38._unk + 1; pppppiVar8 = fullPath; if (0xfff < uVar4) { pppppiVar8 = (int *****)fullPath[-1]; uVar4 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)fullPath + (-4 - (int)pppppiVar8))) goto LAB_0095dbaf; } operator_delete(pppppiVar8,uVar4); pbVar14 = pbStack_100f8; goto LAB_0095d7a6; } } if (*(int *)(pbStack_100f8 + 0x10) == 0) break; pbVar14 = *(byte **)(pbStack_100f8 + 0x18); } if (*(int *)(part + 0x50) != 0) { puVar1 = *(undefined4 **)(&this->field_0x24 + iVar6); if (puVar1 == *(undefined4 **)(&this->field_0x28 + iVar6)) { pbStack_100f8 = part; std::vector<4byte>::_Emplace_reallocate(puVar1,&pbStack_100f8); } else { *puVar1 = part; *(int *)(&this->field_0x24 + iVar6) = *(int *)(&this->field_0x24 + iVar6) + 4; } (&this->field_0x4d)[iVar6] = 1; } part[0x34] = 0; part[0x35] = 0; part[0x36] = 0; part[0x37] = 0x40; goto LAB_0095d9e0; } pcVar12 = "temporary"; do { bVar3 = *pbVar14; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095dcb1: uVar4 = -(uint)bVar17 | 1; goto LAB_0095dcb6; } if (bVar3 == 0) break; bVar3 = pbVar14[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095dcb1; pbVar14 = pbVar14 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095dcb6: if (uVar4 == 0) { pbVar14 = operator_new(0x108); if (pbVar14 == (byte *)0x0) { pbVar14 = (byte *)0x0; } else { pbVar14[8] = 0; pbVar14[0xc] = 0; pbVar14[0xd] = 0; pbVar14[0xe] = 0; pbVar14[0xf] = 0; pbVar14[0x1c] = 0; pbVar14[0x1d] = 0; pbVar14[0x1e] = 0; pbVar14[0x1f] = 0; pbVar14[0x20] = 0xf; pbVar14[0x21] = 0; pbVar14[0x22] = 0; pbVar14[0x23] = 0; pbVar14[0xc] = 0; pbVar14[0x24] = 0; pbVar14[0x25] = 0; pbVar14[0x26] = 0; pbVar14[0x27] = 0; pbVar14[0x28] = 0; pbVar14[0x29] = 0; pbVar14[0x2a] = 0; pbVar14[0x2b] = 0; pbVar14[0x2c] = 0; pbVar14[0x2d] = 0; pbVar14[0x2e] = 0; pbVar14[0x2f] = 0; pbVar14[0x30] = 0; pbVar14[0x31] = 0; pbVar14[0x32] = 0; pbVar14[0x33] = 0; pbVar14[0x34] = 0; pbVar14[0x35] = 0; pbVar14[0x36] = 0x80; pbVar14[0x37] = 0x3f; local_14._0_1_ = 8; *(undefined ***)pbVar14 = IsaacRepentancePlus::Cutscene::TemporaryPart::vftable; Font::Font((Font *)(pbVar14 + 0x40)); local_14._0_1_ = 9; Font::Font((Font *)(pbVar14 + 0x8c)); local_14 = (byte ****)CONCAT31(local_14._1_3_,10); std::string::string((char *)(pbVar14 + 0xd8),&this->field_0x8 + iVar6); pbVar14[0xf0] = 0; pbVar14[0xf1] = 0; pbVar14[0xf2] = 0; pbVar14[0xf3] = 0; pbVar14[0x100] = 0; pbVar14[0x101] = 0; pbVar14[0x102] = 0; pbVar14[0x103] = 0; pbVar14[0x104] = 0xf; pbVar14[0x105] = 0; pbVar14[0x106] = 0; pbVar14[0x107] = 0; pbVar14[0xf0] = 0; } local_14 = (byte ****)CONCAT31(local_14._1_3_,2); for (puVar1 = (undefined4 *)puVar16[8]; puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)puVar1[6]) { pbVar10 = &g_xmlNullStr; if ((byte *)*puVar1 != (byte *)0x0) { pbVar10 = (byte *)*puVar1; } pbVar11 = &DAT_00b6e37c; do { bVar3 = *pbVar10; bVar17 = bVar3 < *pbVar11; if (bVar3 != *pbVar11) { LAB_0095ddd1: uVar4 = -(uint)bVar17 | 1; goto LAB_0095ddd6; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < pbVar11[1]; if (bVar3 != pbVar11[1]) goto LAB_0095ddd1; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095ddd6: if (uVar4 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)puVar1[1] != (byte *)0x0) { pbVar10 = (byte *)puVar1[1]; } pbStack_100f8 = pbVar10 + 1; pbVar11 = pbVar10; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); std::string::assign((char *)(pbVar14 + 0xf0),pbVar10, (int)pbVar11 - (int)pbStack_100f8); } if (puVar1[4] == 0) break; } puVar1 = *(undefined4 **)(&this->field_0x24 + iVar6); pbStack_100f8 = pbVar14; if (puVar1 == *(undefined4 **)(&this->field_0x28 + iVar6)) { std::vector<4byte>::_Emplace_reallocate(puVar1,&pbStack_100f8); } else { *puVar1 = pbVar14; *(int *)(&this->field_0x24 + iVar6) = *(int *)(&this->field_0x24 + iVar6) + 4; } } else { KAGE_LogMessage(1,(byte *)"[warn] %s unknown tag %s.\n"); } } } } else { do { pbVar14 = (byte *)*puVar16; pbVar11 = s_id; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < *pbVar11; if (bVar3 != *pbVar11) { LAB_0095ce26: uVar4 = -(uint)bVar17 | 1; goto LAB_0095ce2b; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < pbVar11[1]; if (bVar3 != pbVar11[1]) goto LAB_0095ce26; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095ce2b: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar16[1] != (byte *)0x0) { pbVar14 = (byte *)puVar16[1]; } entry = (CutsceneEntry)atoi((char *)pbVar14); } else { pbVar11 = s_name; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < *pbVar11; if (bVar3 != *pbVar11) { LAB_0095ce80: uVar4 = -(uint)bVar17 | 1; goto LAB_0095ce85; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < pbVar11[1]; if (bVar3 != pbVar11[1]) goto LAB_0095ce80; pbVar10 = pbVar10 + 2; pbVar11 = pbVar11 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095ce85: if (uVar4 == 0) { pbVar14 = &g_xmlNullStr; if ((byte *)puVar16[1] != (byte *)0x0) { pbVar14 = (byte *)puVar16[1]; } pbVar10 = pbVar14; do { bVar3 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar3 != 0); std::string::assign((char *)entryName,pbVar14,(int)pbVar10 - (int)(pbVar14 + 1)); } else { pcVar12 = "fadeout"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095cef0: uVar4 = -(uint)bVar17 | 1; goto LAB_0095cef5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095cef0; pcVar12 = pcVar12 + 2; pbVar10 = pbVar10 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095cef5: if (uVar4 == 0) { uStack_100c8 = CONCAT11(uStack_100c8._1_1_,1); } else { pcVar12 = "fadecolor"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095cf34: uVar4 = -(uint)bVar17 | 1; goto LAB_0095cf39; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095cf34; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095cf39: if (uVar4 == 0) { pbVar14 = (byte *)puVar16[1]; pcVar12 = "white"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095cf73: uVar4 = -(uint)bVar17 | 1; goto LAB_0095cf78; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095cf73; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095cf78: if (uVar4 == 0) { uVar4 = 0xffffffff; } else { pcVar12 = "black"; pbVar10 = &g_xmlNullStr; if (pbVar14 != (byte *)0x0) { pbVar10 = pbVar14; } do { bVar3 = *pbVar10; bVar17 = bVar3 < (byte)*pcVar12; if (bVar3 != *pcVar12) { LAB_0095cfb0: uVar4 = -(uint)bVar17 | 1; goto LAB_0095cfb5; } if (bVar3 == 0) break; bVar3 = pbVar10[1]; bVar17 = bVar3 < (byte)pcVar12[1]; if (bVar3 != pcVar12[1]) goto LAB_0095cfb0; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0095cfb5: if (uVar4 != 0) goto LAB_0095cfe0; uVar4 = 0xff000000; } KColor::SetFromARGB(&KStack_38,uVar4); fadeColor._unk = KStack_38._unk; fadeColor._red = KStack_38._red; fadeColor._green = KStack_38._green; fadeColor._blue = KStack_38._blue; fadeColor._alpha = KStack_38._alpha; } } } } LAB_0095cfe0: } while ((puVar16[4] != 0) && (puVar16 = (undefined4 *)puVar16[6], puVar16 != (undefined4 *)0x0)); if ((-1 < (int)entry) && ((int)entry < 0x1b)) goto LAB_0095d00e; } CutsceneEntry::Destructor(&entry); } local_14 = (byte ****)((uint)local_14 & 0xffffff00); if (0xf < rootPathCapacity) { uVar4 = rootPathCapacity + 1; pppppbVar7 = rootPath[0]; if (0xfff < uVar4) { pppppbVar7 = (byte *****)rootPath[0][-1]; uVar4 = rootPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)rootPath[0] + (-4 - (int)pppppbVar7))) { LAB_0095dbaf: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar7,uVar4); } local_14 = (byte ****)0xb; xml_memory_pool::clear(auStack_10070); local_14 = (byte ****)0xc; tracked_alloc(1,text,0); bVar3 = 1; } ExceptionList = local_1c; return bVar3; } //@@ 0095df20 Manager::update_state_loading /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? Manager update loop FUN_00954cd0 case 3 (menu=1, game=2); "##GAME###Online/WAITING_FOR_PLAYERS", CutsceneEntry::Unload, TextureCache::Purge, netplay message 0x11, "Attempting to create a message when there is no multiplayer service" */ void Manager::update_state_loading(void) { longlong lVar1; longlong lVar2; longlong lVar3; byte isCallbackHandled; char cVar4; uint uVar5; int iVar6; float *pfVar7; int iVar8; int *piVar9; int *in_ECX; Manager *manager; int unused; int unused_00; int unused_01; int unused_02; uint uVar10; uint uVar11; int *piVar12; ulonglong uVar13; ulonglong nowNs; undefined1 *message; undefined1 *messageRefCount; undefined1 waitingPopup [172]; undefined4 textColor; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 local_54; undefined1 messageRef [4]; int *local_4c; undefined4 local_48; float local_44 [2]; int *loader; Vector local_38; float local_2c; float local_28; byte isMenuConfirm; byte isMenuBack; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; float cutsceneEntryOffset; uint *entryStartTime; undefined4 *firstCutsceneEntry; manager = g_manager; lVar1 = CONCAT44(local_38.y,local_28); puStack_20 = (undefined1 *)(local_44 + 0x10); local_14 = -NAN; puStack_18 = &LAB_00b0c6e8; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_44 + 0xd); iVar6 = *in_ECX; loader = in_ECX; if ((iVar6 != 1) && (iVar6 != 2)) { if (iVar6 != 3) { return; } local_2c = DAT_00c7997c / _DAT_00c5d2c0; local_28 = DAT_00c79980 / _DAT_00c5d2c4; pfVar7 = &local_28; if (DAT_00c7997c / _DAT_00c5d2c0 <= DAT_00c79980 / _DAT_00c5d2c4) { pfVar7 = &local_2c; } ExceptionList = &local_1c; (g_manager->_popupButtons)._scale = *pfVar7; if (manager[1]._gamestate.field_0x278 == '\0') { piVar9 = in_ECX + 0x20e; puStack_20 = (undefined1 *)(local_44 + 0x10); if (in_ECX[0x20e] == -1) goto LAB_0095e179; puStack_20 = (undefined1 *)(local_44 + 0x10); } else { piVar9 = in_ECX + 0x20e; puStack_20 = (undefined1 *)(local_44 + 0x10); if (in_ECX[0x20e] == -1) { puStack_20 = (undefined1 *)(local_44 + 0x10); uVar13 = GetTimeNs(); uVar5 = (uint)(uVar13 >> 0x20); lVar1 = (uVar13 & 0xffffffff) * 0x431bde82; local_4c = (int *)((ulonglong)lVar1 >> 0x20); lVar2 = (ulonglong)uVar5 * 0xd7b634db; local_28 = (float)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar5 * 0x431bde82; local_44[0] = (float)((ulonglong)lVar3 >> 0x20); local_2c = (float)lVar3; uVar13 = lVar2 + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20); uVar10 = (uint)(uVar13 >> 0x20); lVar1 = lVar1 + (uVar13 & 0xffffffff); local_38.x = (float)lVar1; uVar5 = (uint)((ulonglong)lVar1 >> 0x20); lVar1 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar10,uVar5),uVar10 + uVar5); uVar5 = (uint)((ulonglong)lVar1 >> 0x20); uVar10 = (uint)lVar1 >> 0x12 | uVar5 * 0x4000; if (((uVar5 >> 0x12) - loader[0x20d] == (uint)(uVar10 < (uint)loader[0x20c])) && (uVar10 - loader[0x20c] < 0x1f5)) { local_38.y = 0.0; } else { local_38.x = (float)&DAT_bf800000; local_38.y = 80.0; MessagePopup::MessagePopup (waitingPopup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_38) ; local_14 = 2.8026e-45; local_54 = 0; local_44[0] = 1.4013e-45; textColor = 0x3e5cdcdd; uStack_60 = 0x3e2cacad; uStack_5c = 0x3e34b4b5; uStack_58 = 0x3f800000; local_38.x = 0.0; local_38.y = 16.0; FUN_009c2700("##GAME###Online/WAITING_FOR_PLAYERS",&local_38,local_44,&textColor); iVar6 = PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,waitingPopup); local_14 = -NAN; loader[0x20e] = iVar6; FUN_00420710(); lVar3 = CONCAT44(local_44[0],local_2c); } local_44[0] = (float)((ulonglong)lVar3 >> 0x20); local_2c = (float)lVar3; piVar9 = loader + 0x20e; manager = g_manager; in_ECX = loader; } } if (manager[1]._gamestate.field_0x278 != '\0') { ExceptionList = local_1c; return; } if (*piVar9 != -1) { local_44[0] = -NAN; PopupManager::close(&manager[1]._gamestate.field_0xcf0,piVar9,(int *)local_44); manager = g_manager; *piVar9 = -1; } LAB_0095e179: if (manager[1]._gamestate.field_0x278 != '\0') { ExceptionList = local_1c; return; } if (*piVar9 != -1) { ExceptionList = local_1c; return; } *in_ECX = 0; if ((manager->_netplayManager != *(NetplayManager *)(manager + 1)) && ((manager->_cutsceneManager)._isQueuedCleanup != 0)) { FUN_008fd750(); } online_session_reset(); ExceptionList = local_1c; return; } iVar6 = in_ECX[0x202]; local_2c = (float)(iVar6 * 0x4c); ExceptionList = &local_1c; pfVar7 = local_44 + 0x10; if ((uint)in_ECX[iVar6 * 0x13 + 0x11] < (uint)(in_ECX[iVar6 * 0x13 + 9] - in_ECX[iVar6 * 0x13 + 8] >> 2)) { nowNs = GetTimeNs(); uVar10 = (uint)(nowNs >> 0x20); uVar13 = (nowNs & 0xffffffff) * 0xd7b634db; local_38.x = (float)uVar13; lVar2 = (nowNs & 0xffffffff) * 0x431bde82; local_4c = (int *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar10 * 0xd7b634db; local_44[0] = (float)((ulonglong)lVar3 >> 0x20); lVar1 = (ulonglong)uVar10 * 0x431bde82; uVar13 = lVar3 + (uVar13 >> 0x20); uVar11 = (uint)(uVar13 >> 0x20); lVar2 = lVar2 + (uVar13 & 0xffffffff); local_48 = (undefined4)lVar2; uVar10 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = lVar1 + (ulonglong)CONCAT14(CARRY4(uVar11,uVar10),uVar11 + uVar10); uVar10 = (uint)((ulonglong)lVar2 >> 0x20); uVar11 = (uint)lVar2 >> 0x12 | uVar10 * 0x4000; iVar6 = *(int *)(*(int *)((int)local_2c + 0x20 + (int)loader) + loader[loader[0x202] * 0x13 + 0x11] * 4); entryStartTime = (uint *)(iVar6 + 0x38); pfVar7 = (float *)puStack_20; if (((uVar10 >> 0x12) - *(int *)(iVar6 + 0x3c) != (uint)(uVar11 < *entryStartTime)) || (piVar9 = loader, (uint)loader[0x20a] <= uVar11 - *entryStartTime)) goto LAB_0095e290; } else { LAB_0095e290: puStack_20 = (undefined1 *)pfVar7; piVar9 = loader; local_38.y = (float)((ulonglong)lVar1 >> 0x20); local_28 = (float)lVar1; if ((g_manager->_state != 2) || ((g_luaEngine == (void *)0x0 || (isCallbackHandled = lua_run_input_action_callback((Entity *)0x0,1,0xe,&isMenuConfirm), isCallbackHandled == 0)))) { local_38.y = 1.96182e-44; isMenuConfirm = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_38.y,0,0,uVar5) ; } isMenuConfirm = isMenuConfirm != 0; if (((g_manager->_state != 2) || (g_luaEngine == (void *)0x0)) || (isCallbackHandled = lua_run_input_action_callback((Entity *)0x0,1,0xf,&isMenuBack), isCallbackHandled == 0)) { local_4c = (int *)0xf; isMenuBack = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_4c,0,0) ; } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { isMenuBack = 0; isMenuConfirm = 0; iVar6 = FUN_0090b070(); if (iVar6 != 0) { if (*(int *)(iVar6 + 0x378) == 0) { iVar8 = -0x21524111; } else { iVar8 = *(int *)(*(int *)(iVar6 + 0x378) + 0xc); } isMenuConfirm = input_is_action_pressed(0xe,iVar8,(Entity *)0x0,unused); if (*(int *)(iVar6 + 0x378) == 0) { iVar6 = -0x21524111; } else { iVar6 = *(int *)(*(int *)(iVar6 + 0x378) + 0xc); } isMenuBack = input_is_action_pressed(0xf,iVar6,(Entity *)0x0,unused_00); } } manager = g_manager; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (1 < (uint)((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2))) { iVar6 = online_vote_get_local_choice(); (manager->_popupButtons)._buttons[1]._isVisible = iVar6 == 2; manager = g_manager; local_28 = DAT_00c7997c / _DAT_00c5d2c0; local_44[0] = DAT_00c79980 / _DAT_00c5d2c4; pfVar7 = local_44; if (DAT_00c7997c / _DAT_00c5d2c0 <= DAT_00c79980 / _DAT_00c5d2c4) { pfVar7 = &local_28; } (g_manager->_popupButtons)._scale = *pfVar7; } lVar1 = CONCAT44(local_38.y,local_28); if ((isMenuConfirm != 0) || (isMenuBack != 0)) { if ((manager->_netplayManager == *(NetplayManager *)(manager + 1)) || ((uint)((int)*(NetplayManager *)(manager + 1) - (int)manager->_netplayManager >> 2) < 2)) { *(undefined1 *)((int)local_2c + 0x4c + (int)piVar9) = 1; } else { online_vote_send(0); lVar1 = CONCAT44(local_38.y,local_28); } } } cutsceneEntryOffset = local_2c; local_38.y = (float)((ulonglong)lVar1 >> 0x20); local_28 = (float)lVar1; if ((*(char *)((int)local_2c + 0x4c + (int)piVar9) != '\0') || (((*(char *)((int)piVar9 + (int)local_2c + 0x2c) != '\0' && (*(int *)((int)piVar9 + (int)local_2c + 0x24) - *(int *)((int)piVar9 + (int)local_2c + 0x20) >> 2 <= *(int *)((int)piVar9 + (int)local_2c + 0x44))) || (*(char *)((int)piVar9 + (int)local_2c + 0x2d) != '\0')))) { *(float *)((int)piVar9 + (int)local_2c + 0x48) = *(float *)((int)piVar9 + (int)local_2c + 0x48) + 0.05; } iVar6 = *(int *)((int)piVar9 + (int)local_2c + 0x44); piVar12 = piVar9; if (iVar6 < 0) { firstCutsceneEntry = *(undefined4 **)((int)piVar9 + (int)local_2c + 0x20); if (firstCutsceneEntry == *(undefined4 **)((int)piVar9 + (int)local_2c + 0x24)) goto LAB_0095e570; *(undefined4 *)((int)piVar9 + (int)local_2c + 0x44) = 0; (**(code **)(*(int *)*firstCutsceneEntry + 0xc))(); iVar6 = *(int *)(*(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x20) + *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x44) * 4); local_38.y = (float)CONCAT31((int3)((uint)iVar6 >> 8),*(undefined1 *)(iVar6 + 8)); iVar6 = Window::get_framebuffer_height(&DAT_00c798e0); iVar8 = GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); } else { iVar8 = *(int *)((int)piVar9 + (int)local_2c + 0x20); if (*(int *)((int)piVar9 + (int)local_2c + 0x24) - iVar8 >> 2 <= iVar6) goto LAB_0095e570; (**(code **)(**(int **)(iVar8 + iVar6 * 4) + 0x10))(); cVar4 = (**(code **)(**(int **)(*(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x20) + *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x44) * 4) + 0x18))(); lVar1 = CONCAT44(local_38.y,local_28); if (cVar4 == '\0') goto LAB_0095e570; iVar8 = *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x44) + 1; *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x44) = iVar8; iVar6 = *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x20); lVar1 = CONCAT44(local_38.y,local_28); if (*(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x24) - iVar6 >> 2 <= iVar8) goto LAB_0095e570; (**(code **)(**(int **)(iVar6 + iVar8 * 4) + 0xc))(); iVar6 = *(int *)(*(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x20) + *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x44) * 4); local_38.y = (float)CONCAT31((int3)((uint)iVar6 >> 8),*(undefined1 *)(iVar6 + 8)); iVar6 = Window::get_framebuffer_height(&DAT_00c798e0); iVar8 = GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); } update_screen_scale(iVar8,iVar6,local_38.y); piVar12 = loader; lVar1 = CONCAT44(local_38.y,local_28); LAB_0095e570: local_38.y = (float)((ulonglong)lVar1 >> 0x20); local_28 = (float)lVar1; iVar6 = *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x20); iVar8 = *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x24); if ((((iVar6 == iVar8) || ((iVar8 - iVar6 >> 2 <= *(int *)((int)piVar9 + (int)cutsceneEntryOffset + 0x44) && ((*(char *)((int)piVar9 + (int)cutsceneEntryOffset + 0x2c) == '\0' || (1.0 <= *(float *)((int)piVar9 + (int)cutsceneEntryOffset + 0x48))))))) || ((*(char *)((int)piVar9 + (int)cutsceneEntryOffset + 0x4c) != '\0' && (1.0 <= *(float *)((int)piVar9 + (int)cutsceneEntryOffset + 0x48))))) || ((*(char *)((int)piVar9 + (int)cutsceneEntryOffset + 0x2d) != '\0' && (1.0 <= *(float *)((int)piVar9 + (int)cutsceneEntryOffset + 0x48))))) { CutsceneEntry::Unload((CutsceneEntry *)((int)piVar9 + (int)cutsceneEntryOffset + 4)); if (*(char *)((int)piVar9 + (int)cutsceneEntryOffset + 0x4d) != '\0') { TheoraVideoManager::destroyVideoClip((void *)piVar12[0x204]); piVar12[0x204] = 0; piVar12[0x203] = 0; *(undefined1 *)(piVar12 + 0x207) = 0; KAGE::SmartPointer::reset(piVar12 + 0x205); } TextureCache::Purge(); piVar9 = glfw_get_window_size((int *)&local_38,unused_01); iVar6 = piVar9[1]; piVar9 = glfw_get_window_size((int *)&local_38,unused_02); set_viewport_size(*piVar9,iVar6); lVar1 = CONCAT44(local_28,local_4c); if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || ((uint)((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2) < 2)) { iVar6 = 0; } else { uVar13 = GetTimeNs(); uVar5 = (uint)(uVar13 >> 0x20); lVar2 = (uVar13 & 0xffffffff) * 0x431bde82; local_44[0] = (float)((ulonglong)lVar2 >> 0x20); lVar1 = (ulonglong)uVar5 * 0x431bde82; uVar13 = (ulonglong)uVar5 * 0xd7b634db + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20); uVar10 = (uint)(uVar13 >> 0x20); lVar2 = lVar2 + (uVar13 & 0xffffffff); local_38.x = (float)lVar2; uVar5 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = lVar1 + (ulonglong)CONCAT14(CARRY4(uVar10,uVar5),uVar10 + uVar5); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); loader[0x20c] = (uint)lVar2 >> 0x12 | uVar5 * 0x4000; iVar6 = 3; loader[0x20d] = uVar5 >> 0x12; } local_28 = (float)((ulonglong)lVar1 >> 0x20); local_4c = (int *)lVar1; *loader = iVar6; if ((g_manager[1]._gamestate.field_0x278 != '\0') && (g_manager[1]._gamestate.field_0x284 == '\0')) { local_38.y = 0.0; if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n" ); lVar1 = CONCAT44(local_28,local_4c); } local_28 = (float)((ulonglong)lVar1 >> 0x20); local_4c = (int *)lVar1; messageRefCount = &DAT_00000004; message = &DAT_00000004; NetConnection::send_message(g_multiplayerService,messageRef,1,&local_38.y,4,4); manager = g_manager; local_14 = 0.0; FUN_008ef1d0(messageRef); NetplayManager::send_message(&manager->_netplayManager,0x11,message,messageRefCount); local_14 = 1.4013e-45; if (((local_4c != (int *)0x0) && (cVar4 = (**(code **)(*local_4c + 0xc))(), cVar4 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(messageRef); } } manager = g_manager; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; } ExceptionList = local_1c; return; } //@@ 0095e7c0 Cutscene::Show /* ZHL [exact] __thiscall void Cutscene::Show(int cutsceneid); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Cutscene::Show(Cutscene *this,int cutsceneid) { code *pcVar1; char isOnline; LayerState *layer; int extraout_ECX; int extraout_EDX; uint uVar2; uint layerOffset; int iVar3; undefined8 rngShifts; uint partIndex; Game *game; Manager *manager; ANM2 *partSprite; byte *shownLayerName; manager = g_manager; if (0x1a < (uint)cutsceneid) { KAGE_LogMessage(8,(byte *)"Invalid cutscene ID \"%d\" \n"); return; } (g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]._targetVolume = 0.0; (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._fadeRate = 0.08; (manager->_musicManager)._queuedMusicID = 0; if (*(int *)this != 0) { CutsceneEntry::Unload((CutsceneEntry *)(&this->field_0x4 + this->_currentCutsceneId * 0x4c)); TextureCache::Purge(); } this->_currentCutsceneId = cutsceneid; *(undefined4 *)&this->field_0x828 = 0; if (cutsceneid != 0) { iVar3 = cutsceneid * 0x4c; KAGE_LogMessage(1,(byte *)"playing cutscene %d (%s).\n"); isOnline = func_0x0095ead0(); if (isOnline != '\0') { online_vote_start(this,0,1); *(undefined4 *)&this->field_0x840 = 0xffffffff; *(undefined4 *)&this->field_0x83c = 0xffffffff; FUN_008fd750(); PopupButtons::reset(1); *(undefined4 *)(extraout_ECX + 0x118) = 0x42c00000; *(undefined4 *)(extraout_ECX + 0x114) = 0x42c00000; *(undefined4 *)(extraout_EDX + 0x4ab9c) = 6; *(code **)(extraout_EDX + 0x4abb4) = cutscene_render_skip_vote_count; *(Cutscene **)(extraout_EDX + 0x4abb8) = this; } *(undefined4 *)(&this->field_0x44 + iVar3) = 0xffffffff; uVar2 = 0; *(undefined4 *)(&this->field_0x48 + iVar3) = 0; (&this->field_0x4c)[iVar3] = 0; (&this->field_0x2d)[iVar3] = 0; if (*(int *)(&this->field_0x24 + iVar3) - *(int *)(&this->field_0x20 + iVar3) >> 2 != 0) { do { (**(code **)(**(int **)(*(int *)(&this->field_0x20 + iVar3) + uVar2 * 4) + 4))(); uVar2 = uVar2 + 1; } while (uVar2 < (uint)(*(int *)(&this->field_0x24 + iVar3) - *(int *)(&this->field_0x20 + iVar3) >> 2)); } *(undefined4 *)this = 1; if (cutsceneid == 2) { uVar2 = Random(); rngShifts = 0x900000005; cutsceneid._0_1_ = 7; iVar3 = rand(); game = g_game; *(int *)&this->field_0x828 = iVar3 % 6000 + 6000; if ((game != (Game *)0x0) && ((game->_seedEffects)._gameStartSeed != 0)) { uVar2 = Seeds::GetStartSeed(); rngShifts = 0xf00000002; cutsceneid._0_1_ = 0x11; } if (this->field_0xe5 == '\0') { iVar3 = *(int *)&this->field_0xb8; partIndex = 0; if (*(int *)&this->field_0xbc - iVar3 >> 2 != 0) { do { iVar3 = __RTDynamicCast(*(undefined4 *)(iVar3 + partIndex * 4),0, &IsaacRepentancePlus::Cutscene::PartBase::RTTI_Type_Descriptor, &IsaacRepentancePlus::Cutscene::ANM2Part::RTTI_Type_Descriptor,0 ); if (iVar3 != 0) { partSprite = (ANM2 *)(iVar3 + 0x80); layerOffset = 0; do { if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar2 = uVar2 >> (sbyte)rngShifts ^ uVar2; uVar2 = uVar2 << (sbyte)((ulonglong)rngShifts >> 0x20) ^ uVar2; uVar2 = uVar2 >> (sbyte)cutsceneid ^ uVar2; if ((uVar2 & 1) == 0) { layer = ANM2::GetLayer(partSprite,*(byte **)(&UNK_00b7c970 + layerOffset)); shownLayerName = *(byte **)(&UNK_00b7c930 + layerOffset); } else { layer = ANM2::GetLayer(partSprite,*(byte **)(&UNK_00b7c930 + layerOffset)); shownLayerName = *(byte **)(&UNK_00b7c970 + layerOffset); } layer->_visible = 0; layer = ANM2::GetLayer(partSprite,shownLayerName); layerOffset = layerOffset + 4; layer->_visible = 1; } while (layerOffset < 0x3c); } iVar3 = *(int *)&this->field_0xb8; partIndex = partIndex + 1; } while (partIndex < (uint)(*(int *)&this->field_0xbc - iVar3 >> 2)); } } } } *(undefined4 *)&this->field_0x838 = 0xffffffff; return; } //@@ 0095eb00 FUN_0095eb00 void FUN_0095eb00(undefined4 param_1,int param_2) { Manager *pMVar1; pMVar1 = g_manager; *(undefined1 *)(*(int *)(param_2 + 0x808) * 0x4c + 0x2d + param_2) = 1; *(undefined4 *)(param_2 + 0x83c) = DAT_00c79880; *(int *)(param_2 + 0x840) = ((int)(pMVar1->_lobbyMembers)._end - (int)(pMVar1->_lobbyMembers)._begin) / 0x14; (pMVar1->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; return; } //@@ 0095eb60 cutscene_render_skip_vote_count /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? render callback stored by Cutscene::Show (mov [edx+0x4abb4],0x95eb60 at 0x95e8dc); counts lobby members (/0x14) vs votes (+0x83c/+0x840), sprintf string_table_translate('#Online/VOTE_COUNT_STRING'), Font::DrawString */ void cutscene_render_skip_vote_count(int param_1,int param_2) { Manager *pMVar1; byte *format; float *pfVar2; Vector *position; float fVar3; undefined1 local_7c [8]; KColor local_74; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; Vector local_44; Vector local_3c; byte local_34 [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pMVar1 = g_manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0c725; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_3c.y = *(float *)(param_1 + 0x260); if (*(int *)(param_2 + 0x83c) < DAT_00c79880) { *(int *)(param_2 + 0x83c) = DAT_00c79880; *(int *)(param_2 + 0x840) = ((int)(pMVar1->_lobbyMembers)._end - (int)(pMVar1->_lobbyMembers)._begin) / 0x14; } format = string_table_translate(&g_manager->_stringTable,(byte *)"#Online/VOTE_COUNT_STRING"); sprintf(local_34,format); pMVar1 = g_manager; fVar3 = local_3c.y * 0.8; local_5c = 0xffff; local_58 = 0; local_54 = 0x3f800000; local_50 = 0xffffffff; local_4c = 0; local_48 = 0; if (*(char *)(param_1 + 0x250) == '\0') { local_60 = 1; local_8 = 1; KColor::SetFromARGB(&local_74,0xff362f2d); local_3c.x = fVar3; local_3c.y = fVar3; position = (Vector *)FUN_004240b0(&local_44,1); } else { local_60 = 4; local_8 = 0; KColor::SetFromARGB(&local_74,0xff362f2d); local_3c.x = fVar3; local_3c.y = fVar3; pfVar2 = (float *)FUN_004240b0(local_7c,1); local_44.y = *(float *)(param_1 + 0x260) * 26.0 + pfVar2[1]; local_44.x = *(float *)(param_1 + 0x260) * 6.0 + *pfVar2; position = &local_44; } Font::DrawString(&pMVar1->_font2_TeamMeatEx12,local_34,position,&local_3c,&local_74,&local_60); pMVar1 = g_manager; fVar3 = *(float *)(param_1 + 0x260); (g_manager->_popupButtons)._buttons[1]._offset.x = fVar3 * -8.0; (pMVar1->_popupButtons)._buttons[1]._offset.y = fVar3 * -14.0; ExceptionList = local_10; return; } //@@ 0095ed70 CutscenePart::load_subtitles /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX+0xc = subtitle path: FileSystem::Open, reads lines (vfunc +0x18), lines > 28 chars are SRT "hh:mm:ss,mmm --> hh:mm:ss,mmm" timestamps parsed by FUN_0095cb80, up to 4 following text lines -> utf8_to_utf16_alloc; 0x1c-byte cue vector at +0x24; from the anm2part loader FUN_0095f4b0 (ANM2::Load then this) and a vtable thunk 0095c920 (Cutscene::load_xml parses "subtitles") prototype: db/protos.zhl */ void __thiscall CutscenePart::load_subtitles(void *this) { byte bVar1; qword qVar2; void *pvVar3; char cVar4; uint uVar5; int *file; undefined4 timestamp; short *lineUtf16; undefined4 *puVar6; void *cueArray; byte *pbVar7; qword *allocCounter; undefined4 *puVar8; int iVar9; undefined4 newCue; undefined4 uStack_178; undefined4 uStack_174; undefined4 uStack_170; undefined8 local_16c; undefined4 local_164; undefined4 local_160; undefined4 local_15c; undefined4 local_158; void *part; undefined4 *cuesBegin; undefined4 *cuesEnd; undefined4 *cuesCapacity; undefined4 *textLineSlot; undefined4 *cuesCapacityCache; int textLineCount; undefined4 *local_138; byte lineBuf [8]; undefined4 local_12c; undefined8 local_123; undefined4 local_11b; undefined8 local_34; undefined4 local_2c; undefined1 local_28; undefined4 local_1c; undefined1 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c76b; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; part = this; local_14 = uVar5; if (*(void **)((int)this + 0x24) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)((int)this + 0x24),0); *(undefined4 *)((int)this + 0x24) = 0; } local_8 = 0xffffffff; pbVar7 = (byte *)((int)this + 0xc); *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 0; *(undefined4 *)((int)this + 0x30) = 0; if (0xf < *(uint *)((int)this + 0x20)) { pbVar7 = *(byte **)pbVar7; } file = FileSystem::Open(&PTR_vftable_00c37a10,pbVar7,(int *)0x0); if (file != (int *)0x0) { puVar8 = (undefined4 *)0x0; local_138 = (undefined4 *)0x0; cuesBegin = (undefined4 *)0x0; cuesEnd = (undefined4 *)0x0; cuesCapacityCache = (undefined4 *)0x0; cuesCapacity = (undefined4 *)0x0; local_8 = 1; cVar4 = (**(code **)(*file + 0x10))(uVar5); if (cVar4 == '\0') { do { memset(lineBuf,0,0x100); cVar4 = (**(code **)(*file + 0x10))(); while ((cVar4 == '\0' && (lineBuf[0] == 0))) { (**(code **)(*file + 0x18))(lineBuf,0x100); FUN_00684450(); cVar4 = (**(code **)(*file + 0x10))(); } (**(code **)(*file + 0x18))(lineBuf,0x100); cVar4 = (**(code **)(*file + 0x10))(); if (cVar4 == '\0') { pbVar7 = lineBuf; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); if (0x1c < (uint)((int)pbVar7 - (int)(lineBuf + 1))) { local_1c = local_12c; local_34 = local_123; local_2c = local_11b; local_18 = 0; local_28 = 0; newCue = 0; uStack_178 = 0; uStack_174 = 0; uStack_170 = 0; local_164 = 0; local_16c = 0; if (puVar8 == cuesCapacityCache) { FUN_00960880(puVar8,&newCue); cuesCapacityCache = cuesCapacity; } else { *puVar8 = 0; puVar8[1] = 0; puVar8[2] = 0; puVar8[3] = 0; *(undefined8 *)(puVar8 + 4) = 0; puVar8[6] = 0; cuesEnd = puVar8 + 7; } puVar8 = cuesEnd; local_138 = cuesEnd; timestamp = FUN_0095cb80(); puVar8[-7] = timestamp; timestamp = FUN_0095cb80(); puVar8[-6] = timestamp; local_160 = 0; local_15c = 0; local_158 = 0; local_8 = CONCAT31(local_8._1_3_,2); (**(code **)(*file + 0x18))(lineBuf,0x100); FUN_00684450(); textLineCount = 0; cVar4 = (**(code **)(*file + 0x10))(); if (cVar4 == '\0') { textLineSlot = puVar8 + -5; iVar9 = textLineCount; do { if ((lineBuf[0] == 0) || (3 < iVar9)) break; lineUtf16 = utf8_to_utf16_alloc(lineBuf); iVar9 = iVar9 + 1; *textLineSlot = lineUtf16; textLineSlot = textLineSlot + 1; (**(code **)(*file + 0x18))(lineBuf,0x100); FUN_00684450(); cVar4 = (**(code **)(*file + 0x10))(); } while (cVar4 == '\0'); puVar8 = local_138; textLineCount = iVar9; } puVar8[-1] = textLineCount; local_8 = CONCAT31(local_8._1_3_,1); } } cVar4 = (**(code **)(*file + 0x10))(); } while (cVar4 == '\0'); local_138 = cuesBegin; puVar6 = cuesBegin; } else { puVar6 = (undefined4 *)0x0; } pvVar3 = part; uVar5 = ((int)puVar8 - (int)puVar6) / 0x1c; iVar9 = *(int *)((int)part + 0x24); *(uint *)((int)part + 0x30) = uVar5; if (iVar9 != 0) { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar9 + -4); qVar2 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar5; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar2 < uVar5); free((void *)(iVar9 + -4)); uVar5 = *(uint *)((int)pvVar3 + 0x30); local_8 = CONCAT31(local_8._1_3_,1); *(undefined4 *)((int)pvVar3 + 0x24) = 0; } cueArray = operator_new_tracked (-(uint)((int)((ulonglong)uVar5 * 0x1c >> 0x20) != 0) | (uint)((ulonglong)uVar5 * 0x1c)); puVar8 = local_138; *(void **)((int)pvVar3 + 0x24) = cueArray; memcpy(cueArray,local_138,*(int *)((int)pvVar3 + 0x30) * 0x1c); (**(code **)*file)(1); if (puVar8 != (undefined4 *)0x0) { uVar5 = (((int)cuesCapacityCache - (int)puVar8) / 0x1c) * 0x1c; puVar6 = puVar8; if (0xfff < uVar5) { puVar6 = (undefined4 *)puVar8[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)puVar8 + (-4 - (int)puVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar6,uVar5); } } ExceptionList = local_10; return; } //@@ 0095f1a0 FUN_0095f1a0 void FUN_0095f1a0(uint param_1) { uint uVar1; int in_ECX; uint *puVar2; if (*(int *)(in_ECX + 0x24) != 0) { uVar1 = *(uint *)(in_ECX + 0x2c); *(uint *)(in_ECX + 0x28) = param_1; if (uVar1 < *(uint *)(in_ECX + 0x30)) { puVar2 = (uint *)(*(int *)(in_ECX + 0x24) + (uVar1 * 7 + 1) * 4); do { if (param_1 <= *puVar2) { return; } uVar1 = uVar1 + 1; puVar2 = puVar2 + 7; *(uint *)(in_ECX + 0x2c) = uVar1; } while (uVar1 < *(uint *)(in_ECX + 0x30)); } } return; } //@@ 0095f1f0 CutscenePart::render_subtitles /* DB: ? draws the current cue (vector +0x24 of 0x1c-byte cues, index +0x2c, time +0x28 between cue start/end) lines with Font::get_string_width_utf16 + Font::draw_string_wide centred; same cue layout as CutscenePart::load_subtitles 0095ed70 CutscenePart::load_subtitles void CutscenePart::render_subtitles(void) { float fVar1; int iVar2; KColor *color; int in_ECX; uint uVar3; undefined4 *puVar4; float10 fVar5; float fVar6; double dVar7; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; KColor local_5c; int local_48; int iStack_44; int iStack_40; int iStack_3c; int local_34; float local_30; float local_2c; float local_28; float local_24; float local_20; Font *local_1c; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c7ad; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)&g_manager->_stringTable != 0) { local_24 = *(float *)(in_ECX + 0x34) * g_screenPointScale; fVar5 = (float10)roundf(); local_24 = (float)fVar5; local_18 = local_24 / g_screenPointScale; iVar2 = *(int *)(in_ECX + 0x24); if ((((iVar2 != 0) && (uVar3 = *(uint *)(in_ECX + 0x2c), uVar3 < *(uint *)(in_ECX + 0x30))) && (*(uint *)(iVar2 + uVar3 * 0x1c) <= *(uint *)(in_ECX + 0x28))) && (*(uint *)(in_ECX + 0x28) <= *(uint *)(iVar2 + 4 + uVar3 * 0x1c))) { local_48 = g_graphicsManager_blendMode[0]; iStack_44 = g_graphicsManager_blendMode[1]; iStack_40 = g_graphicsManager_blendMode[2]; iStack_3c = g_graphicsManager_blendMode[3]; local_34 = g_graphicsManager_blendMode[4]; set_blend_mode(&DAT_00c798e0,1); uVar3 = g_graphicsManager_flags & 0xfffffffd; local_1c = &g_manager->_font9_PFTempestaSevenCondensedAgain; local_20 = g_screenWidth * 0.5; local_14 = (float)(*(int *)(in_ECX + 0x2c) * 7); local_24 = *(float *)(in_ECX + 0x24); g_graphicsManager_flags = uVar3; dVar7 = floor((double)local_20); fVar1 = local_14; local_2c = (float)dVar7; iVar2 = *(int *)((int)local_24 + 0x18 + (int)local_14 * 4); local_20 = 0.0; if (0 < iVar2) { local_30 = local_18 * 12.0; puVar4 = (undefined4 *)((int)local_24 + ((int)local_14 + 2) * 4); local_14 = g_screenHeight - (float)(iVar2 + 1) * 12.0 * local_18; do { fVar6 = local_18; iVar2 = Font::get_string_width_utf16(local_1c,(short *)*puVar4,-1); local_28 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * fVar6 * 0.5 ; dVar7 = floor((double)local_28); local_28 = (float)dVar7; fVar6 = local_2c - local_28; local_78 = 0; local_74 = 0xffff; local_70 = 0; local_6c = 0x3f800000; local_68 = 0xffffffff; local_64 = 0; local_60 = 0; local_8 = 0; KColor::SetFromARGB(&local_5c,0xffffffff); Font::draw_string_wide (local_1c,(short *)*puVar4,fVar6,local_14,local_18,local_18,color,&local_78); puVar4 = puVar4 + 1; local_14 = local_30 + local_14; local_20 = (float)((int)local_20 + 1); local_8 = 0xffffffff; } while ((int)local_20 < *(int *)((int)local_24 + 0x18 + (int)fVar1 * 4)); uVar3 = g_graphicsManager_flags; } g_graphicsManager_flags = uVar3 | 2; g_graphicsManager_blendMode[0] = local_48; g_graphicsManager_blendMode[1] = iStack_44; g_graphicsManager_blendMode[2] = iStack_40; g_graphicsManager_blendMode[3] = iStack_3c; g_graphicsManager_blendMode[4] = local_34; } } ExceptionList = local_10; return; } //@@ 0095f4b0 FUN_0095f4b0 void FUN_0095f4b0(void) { void *in_ECX; ANM2::Reset((ANM2 *)((int)in_ECX + 0x80)); ANM2::Load((ANM2 *)((int)in_ECX + 0x80),(std_string *)((int)in_ECX + 0x40),1); CutscenePart::load_subtitles(in_ECX); return; } //@@ 0095f4e0 FUN_0095f4e0 void FUN_0095f4e0(void) { int in_ECX; ANM2::Reset((ANM2 *)(in_ECX + 0x80)); return; } //@@ 0095f4f0 Cutscene::ANM2Part::start /* DB: ? vtable slot 3 of Cutscene::ANM2Part (slot 1 0095f4b0 = ANM2::Reset+Load of the part, 2 = Reset, 4 = per-frame update, 5 = Render); resets the timer (+0x28/+0x2c), ANM2::SetAnimation(this+0x80, anim name +0x58) + AnimationState::Rewind, then Music::Play of the part music id (+0x70), swapping 0x3c for 0x46/0x47 by achievements 0x20/0x27d, music volume from OptionsConfig */ void Cutscene::ANM2Part::start(void) { longlong lVar1; longlong lVar2; Manager *pMVar3; byte bVar4; byte *anim; int in_ECX; uint uVar5; uint uVar6; uint uVar7; MusicManager *this; int musicid; ulonglong uVar8; float local_8; if (*(int *)(in_ECX + 0x24) != 0) { *(undefined4 *)(in_ECX + 0x2c) = 0; *(undefined4 *)(in_ECX + 0x28) = 0; } anim = (byte *)(in_ECX + 0x58); if (0xf < *(uint *)(in_ECX + 0x6c)) { anim = *(byte **)anim; } bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x80),anim,1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0xb0)); *(undefined1 *)(in_ECX + 0xc4) = 1; } pMVar3 = g_manager; if (*(int *)(in_ECX + 0x74) == 0) { local_8 = 0.0; if ((g_manager->_musicManager)._isEnabled != 0) { local_8 = (g_manager->_optionsConfig)._musicVolume; } if (*(int *)(in_ECX + 0x70) == 0x3c) { if (((g_manager->_persistentGameData)._achievements[0x27d] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0x20] == 0) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { musicid = *(int *)(in_ECX + 0x70); if (musicid < 0) goto LAB_0095f67a; } else { *(undefined4 *)(in_ECX + 0x70) = 0x46; musicid = 0x46; } } else { *(undefined4 *)(in_ECX + 0x70) = 0x47; musicid = 0x47; } this = &pMVar3->_musicManager; if (musicid < ((int)(pMVar3->_musicManager)._entries._end - (int)(pMVar3->_musicManager)._entries._begin) / 0x60) { Music::Play((Music *)this,musicid,0.0); this->_channels[this->_currentChannel]._volume = 0.0; this->_channels[this->_currentChannel]._targetVolume = local_8; this->_channels[this->_currentChannel]._fadeRate = 0.08; } } else { Music::Play((Music *)&g_manager->_musicManager,*(int *)(in_ECX + 0x70),local_8 + local_8); } } LAB_0095f67a: uVar8 = GetTimeNs(); uVar6 = (uint)(uVar8 >> 0x20); lVar1 = (uVar8 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar6 * 0xd7b634db + ((uVar8 & 0xffffffff) * 0xd7b634db >> 0x20); uVar7 = (uint)((ulonglong)lVar2 >> 0x20); uVar5 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar6 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar7,uVar5),uVar7 + uVar5); uVar5 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(in_ECX + 0x38) = (uint)lVar1 >> 0x12 | uVar5 * 0x4000; *(uint *)(in_ECX + 0x3c) = uVar5 >> 0x12; return; } //@@ 0095f6f0 Cutscene::ANM2Part::Update /* DB: slot 4 of the Cutscene::ANM2Part vtable (was a ZHL exact match Manager::ResizeWindow) */ void __thiscall Cutscene::ANM2Part::Update(void *this) { int iVar1; longlong lVar2; longlong lVar3; uint uVar4; uint uVar5; int iVar6; float volume; ulonglong uVar7; double dVar8; int local_5c; if ((g_manager->_framecount & 1) != 0) { return; } uVar7 = GetTimeNs(); uVar5 = (uint)(uVar7 >> 0x20); lVar2 = (uVar7 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar5 * 0xd7b634db + ((uVar7 & 0xffffffff) * 0xd7b634db >> 0x20); lVar2 = (ulonglong)uVar5 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar2) >> 0x20)); uVar5 = (((((uint)lVar2 >> 0x12 | (int)((ulonglong)lVar2 >> 0x20) * 0x4000) - *(int *)((int)this + 0x198)) - *(int *)((int)this + 0x38)) * 0x1e) / 1000; if (*(int *)((int)this + 0xb4) == 0) { local_5c = 0; iVar6 = -1; } else { local_5c = *(int *)(*(int *)((int)this + 0xb4) + 0x30); dVar8 = floor((double)*(float *)((int)this + 0xc0)); iVar6 = (int)dVar8; } uVar4 = (int)(iVar6 - uVar5) >> 0x1f; if (((int)((iVar6 - uVar5 ^ uVar4) - uVar4) < 3) || (local_5c <= (int)uVar5)) { if (*(char *)((int)this + 0x189) != '\0') { AnimationState::Update((AnimationState *)((int)this + 0xb0)); AnimationState::Update((AnimationState *)((int)this + 0xd0)); } } else { ANM2::GetFrame((ANM2 *)((int)this + 0x80)); KAGE_LogMessage(1,(byte *)"Cutscene: correct anm2 timing: f%d -> f%d\n"); if (*(int *)((int)this + 0xb4) == 0) goto LAB_0095f882; AnimationState::SetFrameFloat((AnimationState *)((int)this + 0xb0),(float)uVar5); } if (*(int *)((int)this + 0xb4) != 0) { floor((double)*(float *)((int)this + 0xc0)); } LAB_0095f882: FUN_0095f1a0(); iVar1 = *(int *)((int)this + 0x74); if (iVar6 < iVar1) { if (*(int *)((int)this + 0xb4) == 0) { iVar6 = -1; } else { dVar8 = floor((double)*(float *)((int)this + 0xc0)); iVar6 = (int)dVar8; } if (iVar1 <= iVar6) { if ((g_manager->_musicManager)._isEnabled == 0) { volume = 0.0; } else { volume = (g_manager->_optionsConfig)._musicVolume; } Music::Play((Music *)&g_manager->_musicManager,*(int *)((int)this + 0x70),volume); } } return; } //@@ 0095f900 FUN_0095f900 void FUN_0095f900(Vector *param_1) { int in_ECX; AnimationState *this; if (*(char *)(in_ECX + 0x189) != '\0') { if (*(char *)(in_ECX + 0xf0) == '\0') { AnimationState::Render((AnimationState *)(in_ECX + 0xb0),param_1,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0xd0); } else { AnimationState::Render((AnimationState *)(in_ECX + 0xd0),param_1,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0xb0); } AnimationState::Render(this,param_1,&g_vectorZero,&g_vectorZero); } CutscenePart::render_subtitles(); return; } //@@ 0095f970 FUN_0095f970 bool FUN_0095f970(void) { int in_ECX; if (*(int *)(in_ECX + 0xb4) == 0) { return true; } return *(char *)(in_ECX + 0xc4) == '\0'; } //@@ 0095f990 FUN_0095f990 void FUN_0095f990(void) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; if (*(int *)(in_ECX + 0x194) == 0) { uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); *(uint *)(in_ECX + 0x194) = (uint)lVar1 >> 0x12 | (int)((ulonglong)lVar1 >> 0x20) * 0x4000; } return; } //@@ 0095fa20 FUN_0095fa20 void FUN_0095fa20(void) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; if (*(int *)(in_ECX + 0x194) != 0) { uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); *(int *)(in_ECX + 0x198) = *(int *)(in_ECX + 0x198) + (((uint)lVar1 >> 0x12 | (int)((ulonglong)lVar1 >> 0x20) * 0x4000) - *(int *)(in_ECX + 0x194)); *(undefined4 *)(in_ECX + 0x194) = 0; } return; } //@@ 0095fac0 FUN_0095fac0 void FUN_0095fac0(void) { longlong lVar1; longlong lVar2; Manager *pMVar3; int *piVar4; int in_ECX; uint uVar5; uint uVar6; uint uVar7; ulonglong uVar8; if (*(int *)(in_ECX + 0x24) != 0) { *(undefined4 *)(in_ECX + 0x2c) = 0; *(undefined4 *)(in_ECX + 0x28) = 0; } piVar4 = (int *)(in_ECX + 0x40); if (0xf < *(uint *)(in_ECX + 0x54)) { piVar4 = (int *)*piVar4; } VideoPlayer::play(piVar4); pMVar3 = g_manager; if (*(char *)(in_ECX + 0x58) == '\0') { (g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]._targetVolume = 0.0; (pMVar3->_musicManager)._channels[(pMVar3->_musicManager)._currentChannel]._fadeRate = 0.08; (pMVar3->_musicManager)._queuedMusicID = 0; } uVar8 = GetTimeNs(); uVar6 = (uint)(uVar8 >> 0x20); lVar1 = (uVar8 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar6 * 0xd7b634db + ((uVar8 & 0xffffffff) * 0xd7b634db >> 0x20); uVar7 = (uint)((ulonglong)lVar2 >> 0x20); uVar5 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar6 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar7,uVar5),uVar7 + uVar5); uVar5 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(in_ECX + 0x38) = (uint)lVar1 >> 0x12 | uVar5 * 0x4000; *(uint *)(in_ECX + 0x3c) = uVar5 >> 0x12; return; } //@@ 0095fbd0 FUN_0095fbd0 void FUN_0095fbd0(void) { int iVar1; longlong lVar2; longlong lVar3; char cVar4; int iVar5; int in_ECX; uint uVar6; ulonglong uVar7; iVar1 = *(int *)(in_ECX + 0x5c); if ((*(int *)(iVar1 + 4) != 0) && (*(char *)(iVar1 + 0x10) != '\0')) { cVar4 = (**(code **)(**(int **)(*(int *)(iVar1 + 4) + 0x28) + 0x10))(); if ((cVar4 != '\0') && (*(int *)(*(int *)(iVar1 + 4) + 0x88) == -1)) { iVar5 = FUN_00aaa4a0(); if (1 < iVar5) { (**(code **)(**(int **)(*(int *)(iVar1 + 4) + 0x28) + 0x18))(); } } } if ((g_manager->_framecount & 1) == 0) { uVar7 = GetTimeNs(); uVar6 = (uint)(uVar7 >> 0x20); lVar2 = (uVar7 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar6 * 0xd7b634db + ((uVar7 & 0xffffffff) * 0xd7b634db >> 0x20); lVar2 = (ulonglong)uVar6 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3)) ,(int)((ulonglong)(lVar3 + lVar2) >> 0x20)); FUN_0095f1a0((int)((((uint)lVar2 >> 0x12 | (int)((ulonglong)lVar2 >> 0x20) * 0x4000) - *(int *)(in_ECX + 0x38)) * 0x1e) / 1000); } return; } //@@ 0095fcd0 FUN_0095fcd0 void FUN_0095fcd0(undefined4 *param_1) { g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; VideoPlayer::render(*param_1,param_1[1]); CutscenePart::render_subtitles(); return; } //@@ 0095fd40 FUN_0095fd40 undefined4 FUN_0095fd40(void) { int iVar1; int iVar2; int in_ECX; iVar1 = *(int *)(*(int *)(in_ECX + 0x5c) + 4); if (iVar1 == 0) { return 1; } if (*(char *)(iVar1 + 0x74) != '\0') { iVar2 = FUN_00aaa450(); if (iVar2 == 0) { return 1; } if (*(float *)(iVar1 + 0x58) <= *(float *)(iVar2 + 4)) { return 1; } } return 0; } //@@ 0095fd70 Cutscene::TemporaryPart::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Cutscene::TemporaryPart vtable slot 1 (RTTI); Font::Load font/TeamMeatFont20Bold.fnt and font/terminus.fnt via ModManager::TryRedirectPath */ void Cutscene::TemporaryPart::Init(void) { byte *extraout_EAX; byte *extraout_EAX_00; byte *fontPath; int in_ECX; void *ptr; char *pcVar1; uint uVar2; char *terminusPath [4]; uint terminusPathSize; uint terminusPathCapacity; void *redirectedPath [4]; uint redirectedPathSize; uint redirectedPathCapacity; char *pathText [4]; uint pathTextSize; uint pathTextCapacity; uint local_14; void *local_10; undefined1 *puStack_c; char *local_8; Manager *manager; manager = g_manager; local_8 = (char *)0xffffffff; puStack_c = &LAB_00b0c7f5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(pathText + 10); ExceptionList = &local_10; pathText[0] = std::_Allocate(0x20); pathTextSize = 0x1b; pathTextCapacity = 0x1f; builtin_strncpy(pathText[0],"font/TeamMeatFont20Bold.fnt",0x1c); local_8 = (char *)0x0; ModManager::TryRedirectPath (&manager->_modManager,(std_string *)redirectedPath,(std_string *)pathText); local_8._0_1_ = 1; fontPath = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { fontPath = *(byte **)extraout_EAX; } Font::Load((Font *)(in_ECX + 0x40),fontPath,0); local_8 = (char *)((uint)local_8._1_3_ << 8); if (0xf < redirectedPathCapacity) { uVar2 = redirectedPathCapacity + 1; ptr = redirectedPath[0]; if (0xfff < uVar2) { ptr = *(void **)((int)redirectedPath[0] + -4); uVar2 = redirectedPathCapacity + 0x24; if (0x1f < (uint)((int)redirectedPath[0] + (-4 - (int)ptr))) goto LAB_0095fe96; } operator_delete(ptr,uVar2); } local_8 = (char *)0xffffffff; redirectedPathSize = 0; redirectedPathCapacity = 0xf; redirectedPath[0] = (void *)((uint)redirectedPath[0] & 0xffffff00); if (0xf < pathTextCapacity) { uVar2 = pathTextCapacity + 1; pcVar1 = pathText[0]; if (0xfff < uVar2) { pcVar1 = *(char **)(pathText[0] + -4); uVar2 = pathTextCapacity + 0x24; if ((char *)0x1f < pathText[0] + (-4 - (int)pcVar1)) { LAB_0095fe96: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,uVar2); } manager = g_manager; terminusPath[0] = std::_Allocate(0x20); terminusPathSize = 0x11; terminusPathCapacity = 0x1f; builtin_strncpy(terminusPath[0],"font/terminus.fnt",0x12); local_8 = (char *)0x2; ModManager::TryRedirectPath (&manager->_modManager,(std_string *)pathText,(std_string *)terminusPath); local_8 = (char *)CONCAT31(local_8._1_3_,3); fontPath = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { fontPath = *(byte **)extraout_EAX_00; } Font::Load((Font *)(in_ECX + 0x8c),fontPath,0); if (0xf < pathTextCapacity) { uVar2 = pathTextCapacity + 1; pcVar1 = pathText[0]; if (0xfff < uVar2) { pcVar1 = *(char **)(pathText[0] + -4); uVar2 = pathTextCapacity + 0x24; if ((char *)0x1f < pathText[0] + (-4 - (int)pcVar1)) goto LAB_0095ff7d; } operator_delete(pcVar1,uVar2); } pathTextSize = 0; pathTextCapacity = 0xf; pathText[0] = (char *)((uint)pathText[0] & 0xffffff00); if (0xf < terminusPathCapacity) { uVar2 = terminusPathCapacity + 1; pcVar1 = terminusPath[0]; if (0xfff < uVar2) { pcVar1 = *(char **)(terminusPath[0] + -4); uVar2 = terminusPathCapacity + 0x24; if ((char *)0x1f < terminusPath[0] + (-4 - (int)pcVar1)) { LAB_0095ff7d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,uVar2); } ExceptionList = local_10; return; } //@@ 0095ffb0 Entity_Player::CheckPoopSpellQueue /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix23/45] __thiscall void Entity_Player::CheckPoopSpellQueue(); */ void __thiscall Entity_Player::CheckPoopSpellQueue(Entity_Player *this,Vector *param_2) { KColor color; KColor color_00; float fVar1; uint uVar2; void *quad; int *piVar3; undefined4 ******ppppppuVar4; byte ******ppppppbVar5; void *pvVar6; void *pvVar7; uint uVar8; Font *pFVar9; int framePhase; Font *line; int framePhase; undefined1 overlayQuad [112]; Vector *drawOffset; Font *titleFont; int *titleText; int lineWidth; undefined1 glyphQuads [4]; int *wordsBegin; int *wordsEnd; int wordsCapacity; Vector local_7c; KColor local_74; int *local_60; Font *local_5c; Font *linesCapacity; Font *linesBegin; uint local_50; ColorMod *local_4c; byte ******word; int iStack_44; int iStack_40; int iStack_3c; uint wordSize; uint wordCapacity; undefined4 local_30; undefined4 ******local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; int local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Font *bodyFont; ColorMod *subtitleText; local_8 = 0xffffffff; puStack_c = &LAB_00b0c86e; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; drawOffset = param_2; local_74._unk = 0; framePhase = g_manager->_framecount % 0x3c; local_74._alpha = 1.0; framePhase = 0x3c - framePhase; if (framePhase < 0x1f) { framePhase = framePhase; } local_74._red = (float)framePhase / 300.0 + 0.4; local_7c.x = g_screenWidth; local_7c.y = g_screenHeight; local_74._green = local_74._red; local_74._blue = local_74._red; local_14 = uVar2; render_quad_set_rect(overlayQuad,param_2,&local_7c,&local_74); render_color_shader_pass(quad); titleText = &(this->_sprite)._numEvents; if (0xf < (uint)(this->_sprite)._rotation) { titleText = (int *)*titleText; } subtitleText = &(this->_sprite)._color; local_4c = subtitleText; if (0xf < (uint)(this->_sprite)._color._colorize[1]) { local_4c = (ColorMod *)subtitleText->_tint[0]; } titleFont = (Font *)&this->field_0x40; local_7c.y = (float)Font::get_string_width_n(titleFont,(byte *)titleText,-1); local_5c = (Font *)&(this->_sprite)._animState._isPlaying; piVar3 = (int *)Font::get_string_width_n(local_5c,(byte *)local_4c,-1); linesBegin = (Font *)0x0; local_74._blue = 0.0; local_74._alpha = 0.0; linesCapacity = (Font *)0x0; local_74._unk = 0; local_8._0_1_ = 0; local_8._1_3_ = 0; local_60 = (int *)((int)g_screenWidth + -0x28); if (local_60 < piVar3) { string_split(0x20,uVar2); lineWidth = 0; local_1c = 0; local_18 = 0xf; local_2c = (undefined4 ******)0x0; local_8._0_1_ = 2; piVar3 = wordsBegin; pFVar9 = (Font *)0x0; if (wordsBegin != wordsEnd) { do { local_50 = piVar3[4]; word = (byte ******)0x0; wordSize = 0; wordCapacity = 0; local_4c = (ColorMod *)piVar3; if (0xf < (uint)piVar3[5]) { local_4c = (ColorMod *)*piVar3; } if (local_50 < 0x10) { word = *(byte *******)local_4c; iStack_44 = *(int *)((int)local_4c + 4); iStack_40 = *(int *)((int)local_4c + 8); iStack_3c = *(int *)((int)local_4c + 0xc); uVar2 = 0xf; } else { uVar2 = local_50 | 0xf; if (0x7fffffff < uVar2) { uVar2 = 0x7fffffff; } word = std::_Allocate(uVar2 + 1); memcpy(word,local_4c,local_50 + 1); } piVar3 = piVar3 + 6; local_8 = CONCAT31(local_8._1_3_,3); wordSize = local_50; wordCapacity = uVar2; if (piVar3 != wordsEnd) { std::string::append((char *)&word,&DAT_00b656ec,1); } ppppppbVar5 = (byte ******)&word; if (0xf < wordCapacity) { ppppppbVar5 = word; } local_4c = (ColorMod *)Font::get_string_width_n(local_5c,(byte *)ppppppbVar5,-1); fVar1 = local_74._alpha; framePhase = lineWidth; if (local_60 < (int *)((int)local_4c->_tint + lineWidth)) { if ((Font *)local_74._alpha == linesCapacity) { vector_string_emplace_reallocate (&local_74._blue,(std_string *)local_74._alpha,&local_2c); linesCapacity = (Font *)local_74._unk; } else { std::string::string((char *)local_74._alpha,&local_2c); local_74._alpha = (float)((int)fVar1 + 0x18); } local_1c = 0; ppppppuVar4 = &local_2c; if (0xf < local_18) { ppppppuVar4 = local_2c; } framePhase = 0; *(undefined1 *)ppppppuVar4 = 0; } ppppppbVar5 = (byte ******)&word; if (0xf < wordCapacity) { ppppppbVar5 = word; } std::string::append((char *)&local_2c,(byte *)ppppppbVar5,wordSize); lineWidth = (int)local_4c->_tint + framePhase; local_8._0_1_ = 2; if (0xf < wordCapacity) { uVar2 = wordCapacity + 1; ppppppbVar5 = word; if (0xfff < uVar2) { ppppppbVar5 = (byte ******)word[-1]; uVar2 = wordCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)word + (-4 - (int)ppppppbVar5))) goto LAB_009603a7; } operator_delete(ppppppbVar5,uVar2); } fVar1 = local_74._alpha; } while (piVar3 != wordsEnd); if (local_1c != 0) { if ((Font *)local_74._alpha == linesCapacity) { vector_string_emplace_reallocate(&local_74._blue,(std_string *)local_74._alpha,&local_2c); linesCapacity = (Font *)local_74._unk; } else { std::string::string((char *)local_74._alpha,&local_2c); local_74._alpha = (float)((int)fVar1 + 0x18); } } linesBegin = (Font *)local_74._blue; pFVar9 = (Font *)local_74._alpha; } local_8._0_1_ = 1; if (0xf < local_18) { uVar2 = local_18 + 1; ppppppuVar4 = local_2c; if (0xfff < uVar2) { ppppppuVar4 = (undefined4 ******)local_2c[-1]; uVar2 = local_18 + 0x24; if ((undefined1 *)0x1f < (undefined1 *)((int)local_2c + (-4 - (int)ppppppuVar4))) goto LAB_009603a7; } operator_delete(ppppppuVar4,uVar2); } local_8._0_1_ = 0; if (wordsBegin != (int *)0x0) { local_60 = wordsEnd; piVar3 = wordsBegin; if (wordsBegin != wordsEnd) { do { uVar2 = piVar3[5]; if (0xf < uVar2) { pvVar6 = (void *)*piVar3; uVar8 = uVar2 + 1; pvVar7 = pvVar6; if (0xfff < uVar8) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar8 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) goto LAB_009603a7; } operator_delete(pvVar7,uVar8); wordsEnd = local_60; } piVar3[4] = 0; piVar3[5] = 0xf; *(undefined1 *)piVar3 = 0; piVar3 = piVar3 + 6; } while (piVar3 != wordsEnd); } uVar2 = ((wordsCapacity - (int)wordsBegin) / 0x18) * 0x18; piVar3 = wordsBegin; if (0xfff < uVar2) { piVar3 = (int *)wordsBegin[-1]; uVar2 = uVar2 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)wordsBegin + (-4 - (int)piVar3))) { LAB_009603a7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar3,uVar2); } } else { vector_string_emplace_reallocate(&local_74._blue,(std_string *)0x0,subtitleText); linesCapacity = (Font *)local_74._unk; linesBegin = (Font *)local_74._blue; pFVar9 = (Font *)local_74._alpha; } line = linesBegin; g_graphicsManager_blendMode[1] = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; local_4c = (ColorMod *)(((int)pFVar9 - (int)linesBegin) / 0x18); g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_30 = 0; local_2c = (undefined4 ******)0xffff; local_28 = 0; local_24 = 0x3f800000; local_20 = 0xffffffff; local_1c = 0; local_18 = 0; local_50 = (uint)(((g_screenHeight * 0.5 - (float)((double)((int)local_4c * 8) + __uint_to_double_fixup[-((int)local_4c * 8 >> 0x1f)])) - 64.0) + drawOffset->y); local_8._0_1_ = 4; local_7c.y = (float)((int)g_screenWidth - (int)local_7c.y) * 0.5; pvVar6 = Font::measure_string(titleFont,glyphQuads,(byte *)titleText,&local_30,&g_vectorOne); local_8._0_1_ = 5; color._blue = 1.0; color._red = 1.0; color._green = 1.0; color._alpha = 1.0; color._unk = 0; Font::render_glyph_quads(titleFont,pvVar6,local_7c.y,(float)(int)local_50,1.0,1.0,color,&local_30) ; std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); bodyFont = local_5c; local_50 = local_50 + 0x40; if (local_4c != (ColorMod *)0x0) { do { local_8._0_1_ = 0; local_5c = line; if (0xf < *(uint *)&line->_lineHeight) { local_5c = *(Font **)line; } framePhase = Font::get_string_width_n(bodyFont,&local_5c->_isLoaded,-1); local_30 = 0; local_2c = (undefined4 ******)0xffff; local_28 = 0; local_24 = 0x3f800000; local_20 = 0xffffffff; local_1c = 0; local_18 = 0; local_8._0_1_ = 6; local_7c.y = (float)((int)g_screenWidth - framePhase) * 0.5 + drawOffset->x; pvVar6 = Font::measure_string(bodyFont,glyphQuads,&local_5c->_isLoaded,&local_30,&g_vectorOne) ; local_8._0_1_ = 7; color_00._blue = 0.8235294; color_00._red = 0.98039216; color_00._green = 0.98039216; color_00._alpha = 1.0; color_00._unk = 0; Font::render_glyph_quads (bodyFont,pvVar6,local_7c.y,(float)(int)local_50,1.0,1.0,color_00,&local_30); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); local_50 = local_50 + 0x10; line = (Font *)&line->_scaleW; local_4c = (ColorMod *)((int)local_4c + -1); } while (local_4c != (ColorMod *)0x0); local_4c = (ColorMod *)0x0; pFVar9 = (Font *)local_74._alpha; } local_8._0_1_ = 0; line = linesBegin; if (linesBegin != (Font *)0x0) { for (; line != pFVar9; line = (Font *)&line->_scaleW) { uVar2 = *(uint *)&line->_lineHeight; if (0xf < uVar2) { pvVar6 = *(void **)line; uVar8 = uVar2 + 1; pvVar7 = pvVar6; if (0xfff < uVar8) { pvVar7 = *(void **)((int)pvVar6 + -4); uVar8 = uVar2 + 0x24; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)pvVar7))) goto LAB_00960720; } operator_delete(pvVar7,uVar8); } *(uint *)&line->_spacingVert = 0; *(uint *)&line->_lineHeight = 0xf; line->_isLoaded = 0; } uVar2 = (((int)linesCapacity - (int)linesBegin) / 0x18) * 0x18; pFVar9 = linesBegin; if (0xfff < uVar2) { pFVar9 = (Font *)linesBegin[-1]._missingCharacter; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)linesBegin + (-4 - (int)pFVar9))) { LAB_00960720: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pFVar9,uVar2); } ExceptionList = local_10; return; } //@@ 00960750 CutsceneEntry::Constructor /* ZHL [exact] __thiscall CutsceneEntry* CutsceneEntry::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ CutsceneEntry * __thiscall CutsceneEntry::Constructor(CutsceneEntry *this) { *this = (CutsceneEntry)0x0; this[1] = (CutsceneEntry)0x0; this[5] = (CutsceneEntry)0x0; this[6] = (CutsceneEntry)0xf; this[7] = (CutsceneEntry)0x0; this[8] = (CutsceneEntry)0x0; this[9] = (CutsceneEntry)0x0; *(undefined2 *)(this + 10) = 0; KColor::SetFromARGB((KColor *)(this + 0xb),0xff000000); this[0x10] = (CutsceneEntry)0xffffffff; this[0x12].field_0x1 = 0; return this; } //@@ 009607b0 CutsceneEntry::Destructor /* ZHL [exact] __thiscall void CutsceneEntry::Destructor(); */ void __thiscall CutsceneEntry::Destructor(CutsceneEntry *this) { undefined4 *puVar1; CutsceneEntry CVar2; CutsceneEntry ptr; uint uVar3; uVar3 = 0; CVar2 = this[7]; if ((int)this[8] - (int)CVar2 >> 2 != 0) { do { puVar1 = *(undefined4 **)((int)CVar2 + uVar3 * 4); if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); } uVar3 = uVar3 + 1; CVar2 = this[7]; } while (uVar3 < (uint)((int)this[8] - (int)CVar2 >> 2)); } if (CVar2 != (CutsceneEntry)0x0) { uVar3 = (int)this[9] - (int)CVar2 & 0xfffffffc; ptr = CVar2; if (0xfff < uVar3) { ptr = *(CutsceneEntry *)((int)CVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)CVar2 - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)ptr,uVar3); this[7] = (CutsceneEntry)0x0; this[8] = (CutsceneEntry)0x0; this[9] = (CutsceneEntry)0x0; } std::string::_Tidy_deallocate((char *)(this + 1)); return; } //@@ 00960840 CutsceneEntry::Unload /* ZHL [exact] __thiscall void CutsceneEntry::Unload(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall CutsceneEntry::Unload(CutsceneEntry *this) { uint uVar1; uVar1 = 0; this[0x10] = (CutsceneEntry)0xffffffff; if ((int)this[8] - (int)this[7] >> 2 != 0) { do { (**(code **)(**(int **)((int)this[7] + uVar1 * 4) + 8))(); uVar1 = uVar1 + 1; } while (uVar1 < (uint)((int)this[8] - (int)this[7] >> 2)); } return; } //@@ 00960880 FUN_00960880 undefined4 * FUN_00960880(void *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; void *pvVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; void *_Dst; int *in_ECX; uint uVar8; uint uVar9; void *ptr; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x1c; if (iVar4 == 0x9249249) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar9 = (in_ECX[2] - *in_ECX) / 0x1c; if (0x9249249 - (uVar9 >> 1) < uVar9) { uVar8 = 0x9249249; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar8 = iVar4 + 1U; if (iVar4 + 1U <= uVar9) { uVar8 = uVar9; } if (0x9249249 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar8 * 0x1c); puVar1 = (undefined4 *)((int)_Dst + (((int)param_1 - iVar2) / 0x1c) * 0x1c); uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_2 + 4); puVar1[6] = param_2[6]; pvVar3 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar3,in_ECX[1] - (int)pvVar3); } else { memmove(_Dst,pvVar3,(int)param_1 - (int)pvVar3); memmove(puVar1 + 7,param_1,in_ECX[1] - (int)param_1); } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar9 = ((in_ECX[2] - (int)pvVar3) / 0x1c) * 0x1c; ptr = pvVar3; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar3 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + (iVar4 + 1) * 0x1c); in_ECX[2] = (int)(uVar8 * 0x1c + (int)_Dst); return puVar1; } //@@ 00960a20 Entity_Knife::GetBaseVariant /* DB: maps variant 2/3/4/8/9->1, 5->0, 11->10 prototype: db/protos.zhl */ int __thiscall Entity_Knife::GetBaseVariant(Entity_Knife *this) { switch(this->_variant) { case 2: case 3: case 4: case 8: case 9: return 1; case 5: return 0; default: return this->_variant; case 0xb: return 10; } } //@@ 00960a70 Entity_Knife::Constructor /* ZHL [exact] __thiscall void Entity_Knife::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Knife::Constructor(Entity_Knife *this) { Entity::constructor((Entity *)this); *(undefined ***)this = IsaacRepentancePlus::Entity_Knife::vftable; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; *(undefined4 *)&(this->_usedTearFlags)._l = 0; *(undefined4 *)((int)&(this->_usedTearFlags)._l + 4) = 0; *(undefined4 *)&(this->_usedTearFlags)._h = 0; *(undefined4 *)((int)&(this->_usedTearFlags)._h + 4) = 0; (this->_anchorPosition).y = 0.0; (this->_anchorPosition).x = 0.0; (this->_initPosition).y = 0.0; (this->_initPosition).x = 0.0; HomingLaser::HomingLaser(); (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; this[1]._collisionIndex = 0; this[1]._index = 0; return; } //@@ 00960b50 Entity_Knife::Free /* ZHL [vtable slot 0] */ Entity_Knife * __thiscall Entity_Knife::Free(Entity_Knife *this,byte param_2) { *(undefined ***)this = IsaacRepentancePlus::Entity_Knife::vftable; FID_conflict__Tidy(&this->_hitList); FID_conflict__Tidy(&(this->_homingLaser)._bezier); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); Entity::destructor((Entity *)this); if ((param_2 & 1) != 0) { operator_delete(this,0x520); } return this; } //@@ 00960bc0 FUN_00960bc0 void FUN_00960bc0(void) { Entity *in_ECX; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Knife::vftable; FID_conflict__Tidy(&in_ECX[1]._sprite._nullLayerNames); FID_conflict__Tidy(&in_ECX[1]._sprite._overlayAnimState._nullLayerFrames); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); Entity::destructor(in_ECX); return; } //@@ 00960c10 Entity_Knife::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 1] prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Entity_Knife::Init(Entity_Knife *this,int type,int variant,int subType,uint initSeed) { double dVar1; undefined4 uVar2; float fVar3; byte bVar4; ANM2 *extraout_EAX; LayerState *layer; byte *curAnimName; char *ptr; int iVar5; byte *cmpName; ANM2 *pAVar6; uint uVar7; bool isLess; ANM2 *local_34; byte isLayerVisible; std_string anm2Path; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; byte *animData; byte cmpChar; local_8 = 0xffffffff; puStack_c = &LAB_00b0c8bf; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&anm2Path)[1]._size; ExceptionList = &local_10; if (DAT_00c72214 == (ANM2 *)0x0) { local_34 = operator_new(0x114); local_8 = 0; if (local_34 == (ANM2 *)0x0) { local_34 = (ANM2 *)0x0; } else { ANM2::constructor(local_34); local_34 = extraout_EAX; } local_8 = 0xffffffff; if (DAT_00c78da8 == DAT_00c78dac) { FUN_004156c0(DAT_00c78da8,&local_34); } else { *DAT_00c78da8 = local_34; DAT_00c78da8 = DAT_00c78da8 + 1; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; DAT_00c72214 = local_34; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1a; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/DeadEyeTearEffect.anm2",0x1b); local_8 = 1; ANM2::Load(DAT_00c72214,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar7 = anm2Path._capacity + 1; ptr = (char *)anm2Path._buf._0_4_; if (0xfff < uVar7) { ptr = *(char **)(anm2Path._buf._0_4_ + -4); uVar7 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } uVar7 = g_graphicsManager_flags; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; layer = ANM2::GetLayer(DAT_00c72214,(byte *)0x0); pAVar6 = DAT_00c72214; iVar5 = 1; if ((uVar7 & 4) == 0) { iVar5 = 6; } local_34 = DAT_00c72214; layer->_blendMode[0] = 0; layer->_blendMode[1] = iVar5; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; animData = (pAVar6->_animState)._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } cmpName = s_Idle; do { bVar4 = *curAnimName; isLess = bVar4 < *cmpName; if (bVar4 != *cmpName) { LAB_00960df0: uVar7 = -(uint)isLess | 1; goto LAB_00960df5; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; isLess = bVar4 < cmpName[1]; if (bVar4 != cmpName[1]) goto LAB_00960df0; curAnimName = curAnimName + 2; cmpName = cmpName + 2; } while (bVar4 != 0); uVar7 = 0; LAB_00960df5: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((pAVar6->_animState)._isPlaying != 0)))) goto LAB_00960e29; } bVar4 = ANM2::SetAnimation(pAVar6,s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind(&pAVar6->_animState); (pAVar6->_animState)._isPlaying = 1; } } LAB_00960e29: Entity::Init((Entity *)this,type,variant,subType,initSeed); if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); local_34 = (ANM2 *)&(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { local_34 = *(ANM2 **)((std_string *)local_34)->_buf; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; pAVar6 = local_34; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } do { bVar4 = *curAnimName; cmpChar = (pAVar6->_filename)._buf[0]; isLess = bVar4 < cmpChar; if (bVar4 != cmpChar) { LAB_00960ea0: uVar7 = -(uint)isLess | 1; goto LAB_00960ea5; } if (bVar4 == 0) break; bVar4 = curAnimName[1]; cmpChar = (pAVar6->_filename)._buf[1]; isLess = bVar4 < cmpChar; if (bVar4 != cmpChar) goto LAB_00960ea0; curAnimName = curAnimName + 2; pAVar6 = (ANM2 *)((pAVar6->_filename)._buf + 2); } while (bVar4 != 0); uVar7 = 0; LAB_00960ea5: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00960eda; } bVar4 = ANM2::SetAnimation(&this->_sprite,(byte *)local_34,1); if (bVar4 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_00960eda: this->_collisionDamage = 22.0; this->_scale = 1.0; this->_rotation = 0.0; this->_displayRotation = 0.0; this->_knifeDepthOffset = 0.0; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; this->_rotationOffset = 0.0; this->_entityGridCollisionClass = 0; this->_knifeDistance = 0.0; this->_knifeVelocity = 0.0; this->_maxDistance = 100.0; this->_charge = 0.0; this->_isFlying = 0; (this->_anchorPosition).x = g_vectorZero.x; (this->_anchorPosition).y = g_vectorZero.y; (this->_initPosition).x = (this->_pos).x; (this->_initPosition).y = (this->_pos).y; this->_prismApplied = 0; this->_multidimensionalApplied = 0; this->_isUsingParentHitList = 0; this->_pathSegment = 0; uVar7 = Random(); this->_pathProgress = -100.0; this->_pathFollowSpeed = 0.1; this->_height = 0.0; this->_fallingSpeed = 0.0; this->_isDeadEyeHit = 0; *(undefined2 *)&this->_isSwinging = 0; *(undefined2 *)&this->field_0x4e8 = 0; this->_isSpinAttack = 0; dVar1 = __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]; *(undefined1 **)&this[1]._pendingDamageFlags = &DAT_bf800000; *(undefined4 *)(this + 1) = 0; *(undefined2 *)&this[1].field_0x4 = 0; this[1]._damageEvents._capacity = (void *)0x0; this[1]._pendingDamage = 0.0; this[1]._damageEvents._begin = (void *)0x0; this[1]._damageEvents._end = (void *)0x0; *(undefined4 *)((int)&this[1]._pendingDamageFlags + 4) = 0; this->_pathOffset = (float)((double)(int)uVar7 + dVar1) * 2.3283064e-10 * 50.0 - 25.0; this[1]._index = (int)g_vectorZero.x; fVar3 = g_vectorZero.y; *(uint *)&this->_flags = (uint)this->_flags | 0x4000000; this->_isPrimaryClub = 0; this[1]._variant = 0; uVar2 = *(undefined4 *)((int)&this->_flags + 4); this[1]._collisionIndex = (int)fVar3; *(undefined4 *)((int)&this->_flags + 4) = uVar2; this[1]._type = (int)&DAT_bf800000; (this->_hitList)._end = (this->_hitList)._begin; iVar5 = this->_variant; switch(iVar5) { case 5: goto LAB_00961187; default: if (iVar5 != 1) { if (iVar5 != 10) goto LAB_00961187; goto code_r0x00961110; } case 2: case 3: case 4: case 8: case 9: isLayerVisible = this->_subtype != 4; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_visible = isLayerVisible; isLayerVisible = this->_subtype == 4; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); break; case 0xb: code_r0x00961110: isLayerVisible = this->_subtype != 4; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_visible = isLayerVisible; isLayerVisible = this->_subtype == 4; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); layer->_visible = isLayerVisible; isLayerVisible = this->_subtype == 4; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x2); } layer->_visible = isLayerVisible; LAB_00961187: LuaEngine::PostKnifeInit(this); ExceptionList = local_10; return; } //@@ 009611d0 Entity_Knife::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_Knife::ClearReferences(Entity_Knife *this) { float *pfVar1; std_vector *psVar2; EntityPtr EVar3; int *piVar4; void **ppvVar5; Entity_Knife *local_8; EVar3 = this->_parent; local_8 = this; if ((EVar3 != (EntityPtr)0x0) && (*(int *)((int)EVar3 + 0x28) == 2)) { if ((*(Entity_Knife **)((int)EVar3 + 0x49c) == this) && (*(Entity_Knife **)((int)EVar3 + 0x49c) != (Entity_Knife *)0x0)) { local_8 = (Entity_Knife *)((int)EVar3 + 0x49c); std::multiset::erase(&local_8); *(undefined4 *)((int)EVar3 + 0x49c) = 0; } } Entity::ClearReferences((Entity *)this); piVar4 = this[1]._damageEvents._capacity; ppvVar5 = &this[1]._damageEvents._capacity; if (piVar4 != (int *)0x0) { (**(code **)(*piVar4 + 0x28))(); } pfVar1 = &this[1]._pendingDamage; if ((int *)this[1]._pendingDamage != (int *)0x0) { (**(code **)(*(int *)this[1]._pendingDamage + 0x28))(); } if (*ppvVar5 != (void *)0x0) { local_8 = (Entity_Knife *)ppvVar5; std::multiset::erase(&local_8); } *ppvVar5 = (void *)0x0; if (*pfVar1 != 0.0) { local_8 = (Entity_Knife *)pfVar1; std::multiset::erase(&local_8); } *pfVar1 = 0.0; psVar2 = &this[1]._damageEvents; if (psVar2->_begin != (void *)0x0) { local_8 = (Entity_Knife *)psVar2; std::multiset::erase(&local_8); } ppvVar5 = &this[1]._damageEvents._end; psVar2->_begin = (void *)0x0; if (*ppvVar5 != (void *)0x0) { local_8 = (Entity_Knife *)ppvVar5; std::multiset::erase(&local_8); } *ppvVar5 = (void *)0x0; return; } //@@ 009612e0 Entity_Knife::GetHitEntities /* ZHL [exact] __thiscall std_vector_uint * Entity_Knife::GetHitEntities(); prototype: REPENTOGON, confirmed by RET 0 */ void * __thiscall Entity_Knife::GetHitEntities(Entity_Knife *this) { byte bVar1; EntityPtr EVar2; bVar1 = this->_isUsingParentHitList; while (((bVar1 != 0 && (EVar2 = *(EntityPtr *)((int)this + 0x3bc), EVar2 != (EntityPtr)0x0)) && (*(int *)((int)EVar2 + 0x28) == 8))) { bVar1 = *(byte *)((int)EVar2 + 0x4e7); this = (Entity_Knife *)EVar2; } return (void *)((int)this + 0x4d8); } //@@ 00961320 Entity_Knife::InitHomingPath /* ZHL [exact] __thiscall void Entity_Knife::InitHomingPath(Vector direction, Entity* source, float pathOffset); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Entity_Knife::InitHomingPath(Entity_Knife *this,Vector direction,Entity *source,float pathOffset) { uint uVar1; uint uVar2; Vector local_10; (this->_homingLaser)._samples._end = (this->_homingLaser)._samples._begin; *(undefined4 *)&(this->_homingLaser).field_0x38 = *(undefined4 *)&(this->_homingLaser).field_0x34; (this->_homingLaser)._nonOptimizedSamples._end = (this->_homingLaser)._nonOptimizedSamples._begin; (this->_homingLaser)._bezier._end = (this->_homingLaser)._bezier._begin; this->_pathSegment = 0; this->_pathOffset = pathOffset; this->_pathProgress = -100.0; *(undefined4 *)&(this->_homingLaser).field_0x18 = 0x1e; *(undefined4 *)&(this->_homingLaser).field_0x40 = 0; *(undefined4 *)&(this->_homingLaser).field_0x14 = 0x43160000; Entity_Laser::CalculateEndPoint(&local_10,&this->_pos,&direction,&g_vectorZero,(Entity *)0x0,20.0) ; *(float *)&(this->_homingLaser).field_0x4 = (this->_pos).x; *(float *)&(this->_homingLaser).field_0x8 = (this->_pos).y; *(float *)&(this->_homingLaser).field_0xc = direction.x * 200.0 + local_10.x; *(float *)&(this->_homingLaser).field_0x10 = direction.y * 200.0 + local_10.y; uVar2 = *(uint *)((int)&(this->_tearFlags)._h + 4); local_10.x = (float)(uVar2 & DAT_00c34b6c); uVar1 = (uint)(this->_tearFlags)._h; if ((((uint)(this->_tearFlags)._l & DAT_00c34b60) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b64) != 0) || ((uVar1 & DAT_00c34b68) != 0 || local_10.x != 0.0)) { HomingLaser::build_curl_path(); uVar1 = (uint)(this->_tearFlags)._h; uVar2 = *(uint *)((int)&(this->_tearFlags)._h + 4); } if ((((uint)(this->_tearFlags)._l & (uint)g_tearFlagHoming._l) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagHoming._l._4_4_) == 0) && ((uVar1 & (uint)g_tearFlagHoming._h) == 0 && (uVar2 & g_tearFlagHoming._h._4_4_) == 0)) { HomingLaser::build_bezier_path(0,source); return; } HomingLaser::build_bezier_path(1,source); return; } //@@ 009614d0 Entity_Knife::copy_parent_state /* DB: copies from the source knife: position-ish +0x34c/0x350, colour via vtable +0x3c (SetColor), TearFlags +0x410..0x41c, vtable +0x40 with +0x388, rotation +0x43c wrapped to [-180,180], +0xe4/0xe8, bytes +0x4e5/0x4e6; Entity_Knife::spawn_child_knife, Entity_Familiar::multidimensional_baby_copy_knife prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Knife::copy_parent_state(Entity_Knife *this,Entity_Knife *source) { int iVar1; undefined4 uVar2; undefined4 uVar3; qword qVar4; float x; iVar1 = *(int *)this; (this->_posOffset).x = (source->_posOffset).x; (this->_posOffset).y = (source->_posOffset).y; (**(code **)(iVar1 + 0x3c))(&source->_color,0xffffffff,0xff,0,1); uVar2 = *(undefined4 *)((int)&(source->_tearFlags)._l + 4); qVar4 = (source->_tearFlags)._h; uVar3 = *(undefined4 *)((int)&(source->_tearFlags)._h + 4); iVar1 = *(int *)this; *(int *)&(this->_tearFlags)._l = (int)(source->_tearFlags)._l; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = uVar2; *(int *)&(this->_tearFlags)._h = (int)qVar4; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = uVar3; (**(code **)(iVar1 + 0x40))(source->_collisionDamage); x = source->_rotationOffset; if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } this->_rotationOffset = x; (this->_sprite)._scale.x = (source->_sprite)._scale.x; (this->_sprite)._scale.y = (source->_sprite)._scale.y; this->_multidimensionalApplied = source->_multidimensionalApplied; this->_prismApplied = source->_prismApplied; return; } //@@ 009615e0 Entity_Familiar::multidimensional_baby_copy_knife /* DB: Entity_Familiar::Update case 0x65 (MULTIDIMENSIONAL_BABY 101) when Entity_Knife::IsFlying: SpawnEx(8, knife variant) + Entity_Knife::InitHomingPath/GetRootParent */ undefined4 Entity_Familiar::multidimensional_baby_copy_knife(void) { float fVar1; double dVar2; Vector direction; Entity *pEVar3; uint uVar4; Entity_Knife *this; EntityPtr in_ECX; float fVar5; float fVar6; uint local_1c; EntityPtr *local_18; float local_14; EntityPtr *local_10; float local_c; if ((((*(char *)((int)in_ECX + 0x4e6) != '\0') || (*(char *)((int)in_ECX + 0x171) == '\0')) || (*(float *)((int)in_ECX + 0x448) <= 0.0)) || ((*(int *)((int)in_ECX + 0x30) != 0 && (*(int *)((int)in_ECX + 0x30) != 1)))) { return 0; } *(undefined1 *)((int)in_ECX + 0x171) = 0; *(undefined4 *)((int)in_ECX + 0x514) = *(undefined4 *)((int)in_ECX + 0x444); *(undefined1 *)((int)in_ECX + 0x4e6) = 1; pEVar3 = Entity_Knife::GetRootParent((Entity_Knife *)in_ECX); *(float *)&pEVar3[1].field_0x3c = *(float *)&pEVar3[1].field_0x3c + 5.0; local_1c = 0; do { if (local_1c == 0) { fVar5 = 10.0; } else { fVar5 = -10.0; } uVar4 = Random(); this = (Entity_Knife *) Game::SpawnEx(g_game,8,*(uint *)((int)in_ECX + 0x2c),(Vector *)((int)in_ECX + 0x33c), &g_vectorZero,(Entity *)in_ECX,0,uVar4,1); if (this == (Entity_Knife *)0x0) break; if (this->_parent != (EntityPtr)0x0) { local_18 = &this->_parent; std::multiset::erase(&local_18); } this->_parent = in_ECX; std::multiset::insert(&this->_parent); Entity_Knife::copy_parent_state(this,(Entity_Knife *)in_ECX); if (*(int *)((int)in_ECX + 0x30) == 1) { local_18 = (EntityPtr *)(*(float *)((int)in_ECX + 0x438) * 0.017453292); local_14 = cos((float)local_18); fVar6 = sin((float)local_18); fVar1 = *(float *)((int)in_ECX + 0x340); (this->_pos).x = (local_14 * 0.0 - fVar6 * fVar5) + *(float *)((int)in_ECX + 0x33c); (this->_pos).y = local_14 * fVar5 + fVar6 * 0.0 + fVar1; uVar4 = Random(); dVar2 = __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]; local_14 = *(float *)((int)in_ECX + 0x438) * 0.017453292; local_18 = (EntityPtr *)cos(local_14); local_c = sin(local_14); local_10 = local_18; direction.y = local_c; direction.x = (float)local_18; Entity_Knife::InitHomingPath (this,direction,(Entity *)in_ECX, (float)((double)(int)uVar4 + dVar2) * 2.3283064e-10 * 50.0 - 25.0); } else { *(undefined4 *)&this[1]._pendingDamageFlags = *(undefined4 *)((int)in_ECX + 0x444); this[1]._index = 0; this[1]._collisionIndex = (int)fVar5; } (**(code **)(*(int *)this + 0xc))(); local_1c = local_1c + 1; } while (local_1c < 2); if (*(int *)((int)in_ECX + 0x30) == 1) { (**(code **)(*(int *)in_ECX + 0x28))(); } return 1; } //@@ 00961870 Entity_Knife::spawn_child_knife /* DB: ? ECX=knife (+0x4e5 once-flag, subtype 0/1): SpawnEx(8, same variant, pos, parent=this), child+0x3bc=this, Entity_Knife::InitHomingPath; called from Entity_Familiar::Update when knife IsFlying within 25px */ undefined4 __thiscall Entity_Knife::spawn_child_knife(Entity_Knife *this) { double dVar1; Vector direction; Entity *pEVar2; uint uVar3; Entity_Knife *this_00; float fVar4; int iVar5; undefined *local_24; float local_20; EntityPtr *local_1c [6]; if ((((this->_prismApplied != 0) || (this->_visible == 0)) || (this->_knifeVelocity <= 0.0)) || ((this->_subtype != 0 && (this->_subtype != 1)))) { return 0; } this->_visible = 0; this[1]._type = (int)this->_knifeDistance; this->_prismApplied = 1; pEVar2 = GetRootParent(this); local_24 = &DAT_00c5d2c8; local_20 = 0.0; *(float *)&pEVar2[1].field_0x3c = *(float *)&pEVar2[1].field_0x3c + 2.0; do { uVar3 = Random(); this_00 = (Entity_Knife *) Game::SpawnEx(g_game,8,this->_variant,&this->_pos,&g_vectorZero,(Entity *)this, this->_subtype,uVar3,1); if (this_00 == (Entity_Knife *)0x0) break; if (this_00->_parent != (EntityPtr)0x0) { local_1c[0] = &this_00->_parent; std::multiset::erase(local_1c); } this_00->_parent = (EntityPtr)this; std::multiset::insert(&this_00->_parent); copy_parent_state(this_00,this); iVar5 = 0xff; (**(code **)(*(int *)this_00 + 0x3c))(local_24,0xffffffff,0xff,0,1); fVar4 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * 20.0; if (this->_subtype == 1) { uVar3 = Random(); dVar1 = __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]; fVar4 = ((this->_rotation - 30.0) + fVar4) * 0.017453292; local_24 = (undefined *)cos(fVar4); local_20 = sin(fVar4); direction.y = local_20; direction.x = (float)local_24; InitHomingPath(this_00,direction,(Entity *)this, (float)((double)(int)uVar3 + dVar1) * 2.3283064e-10 * 50.0 - 25.0); } else { *(float *)&this_00[1]._pendingDamageFlags = this->_knifeDistance; *(float *)((int)&this_00[1]._pendingDamageFlags + 4) = fVar4 - 30.0; } (**(code **)(*(int *)this_00 + 0xc))(); local_20 = (float)((int)local_20 + 0x2c); local_24 = local_24 + 0x2c; } while ((uint)local_20 < 0xb0); if (this->_subtype == 1) { (**(code **)(*(int *)this + 0x28))(); } return 1; } //@@ 00961ad0 FUN_00961ad0 uint FUN_00961ad0(void) { byte bVar1; uint in_EAX; Entity_Player *this; undefined3 extraout_var; Entity_Knife *in_ECX; if (in_ECX->_variant == 9) { this = Entity_Knife::GetPlayer(in_ECX); in_EAX = 0; if (this != (Entity_Player *)0x0) { bVar1 = Entity_Player::HasCollectible(this,0x3b,0); in_EAX = CONCAT31(extraout_var,bVar1); if (bVar1 != 0) { return CONCAT31(extraout_var,1); } } } return in_EAX & 0xffffff00; } //@@ 00961b00 Entity_Knife::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Knife::Update(Entity_Knife *this) { undefined8 uVar1; undefined4 uVar2; code *pcVar3; int *piVar4; void *pvVar5; void *pvVar6; undefined4 uVar7; Vector direction; BitSet128 flags; Vector sizeMulti; Vector direction_00; ANM2 *pAVar8; qword qVar9; byte bVar10; char cVar11; uint uVar12; Entity_Player *ownerPlayer; LayerState *layer; BitSet128 *pBVar13; EntityPtr EVar14; float *pfVar15; float *extraout_EAX; Entity_Tear *spawnedTear; BitSet128 *tearFlagsTmp; int iVar16; byte *anim; Entity_Knife *rootParent; RNG *spawnedTear; RNG *this_01; RNG *this_02; Vector *pVVar17; Entity *tmpEntity; EntityPtr *pEVar18; Entity_Laser *techLaser; ColorMod *color; int iVar19; EntityPtr EVar20; void *pvVar21; Vector *this_03; int extraout_EDX; code *extraout_EDX_00; int extraout_EDX_01; Entity_NPC *laser; bool bVar22; float fVar23; float fVar24; float fVar25; float fVar26; float fVar27; float fVar28; float fVar29; float fVar30; float fVar31; undefined1 uVar32; undefined1 uVar33; undefined2 uVar34; BitSet128 *b; BitSet128 local_1f0; BitSet128 local_1e0; BitSet128 local_1d0; BitSet128 local_1c0; undefined1 local_1ac [12]; float local_1a0; BitSet128 local_180; undefined1 local_170 [16]; Entity_Knife *knife; EntityPtr local_15c; RNG local_158; undefined1 local_148 [8]; Vector local_140; Entity_Player *player; Vector local_134; float local_12c; undefined1 local_128 [8]; Vector local_120; Vector local_118; undefined1 local_110 [8]; Vector local_108; undefined1 local_100 [12]; EntityPtr local_f4 [2]; float local_ec; Vector local_e8; float local_e0; char isSwingWeapon; char isSword; byte local_d9; undefined1 local_d8 [108]; undefined1 local_6c [44]; void *local_40 [2]; BitSet128 local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; Room *room; short spinsLeft; puStack_20 = (undefined1 *)(local_40 + 0xf); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0c913; local_1c = ExceptionList; uVar12 = __security_cookie ^ (uint)(local_40 + 0xc); ExceptionList = &local_1c; if (this->_isInterpolating == 0) { this->_friction = this->_friction * 0.7; } iVar16 = this->_variant; local_134.y = 5.60519e-45; isSwingWeapon = '\0'; isSword = '\0'; switch(iVar16) { case 2: case 3: case 4: case 8: case 9: switchD_00961b98_caseD_2: isSwingWeapon = '\x01'; local_134.y = 1.4013e-44; break; case 5: break; default: if (iVar16 == 1) goto switchD_00961b98_caseD_2; if (iVar16 == 10) goto switchD_00961b98_caseD_b; break; case 0xb: switchD_00961b98_caseD_b: isSword = '\x01'; local_134.y = 1.82169e-44; } knife = this; local_24 = uVar12; player = GetPlayer(this); EVar14 = this->_parent; if (EVar14 == (EntityPtr)0x0) { LAB_009652a2: iVar16 = *(int *)this; LAB_009652a6: (**(code **)(iVar16 + 0x28))(); } else { iVar16 = this->_subtype; if (iVar16 == 0) { local_12c = 30.0; if (isSwingWeapon != '\0') { local_12c = 4.0; } if (isSword != '\0') { local_12c = 0.1; } if (((*(int *)((int)EVar14 + 0x28) == 2) && (isSwingWeapon == '\0')) && (isSword == '\0')) { local_12c = *(float *)((int)EVar14 + 0x420) * 20.0; } if (extraout_EDX == 9) { ownerPlayer = GetPlayer(this); if ((ownerPlayer == (Entity_Player *)0x0) || (bVar10 = Entity_Player::HasCollectible(ownerPlayer,0x3b,0), bVar10 == 0)) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); (layer->_color)._offset[0] = 0.0; (layer->_color)._offset[1] = 0.0; (layer->_color)._offset[2] = 0.0; } else { local_108.y = (float)g_game->_frameCount * 0.2; fVar23 = sin(local_108.y + 0.5); local_120.y = fVar23 * 0.17 + 0.17; fVar23 = sin(local_108.y + 0.25); local_e8.y = fVar23 * 0.1 + 0.1; fVar23 = sin(local_108.y + 0.0); local_108.y = fVar23 * 0.25 + 0.25; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); (layer->_color)._offset[0] = local_120.y; *(float *)((layer->_color)._offset + 1) = local_e8.y; *(float *)((layer->_color)._offset + 2) = local_108.y; } } tearFlagsTmp = &this->_tearFlags; local_140.y = (float)tearFlagsTmp; pBVar13 = BitSet128::operator_and(&local_1d0,tearFlagsTmp,&g_tearFlagLudovico); if (((int)pBVar13->_l == 0 && *(int *)((int)&pBVar13->_l + 4) == 0) && ((int)pBVar13->_h == 0 && *(int *)((int)&pBVar13->_h + 4) == 0)) { EVar14 = (EntityPtr)GetRootParent(this); iVar16 = this->_variant; local_15c = *(EntityPtr *)((int)EVar14 + 0x3bc); local_170._12_4_ = EVar14; if ((iVar16 != 9) && ((iVar16 != 8 && (iVar16 != 4)))) { if (local_15c == (EntityPtr)0x0) goto LAB_00961f38; if (*(int *)((int)local_15c + 0x28) == 1) { bVar10 = Entity_Player::HasWeaponType((Entity_Player *)local_15c,(int)local_134.y); } else { if ((*(int *)((int)local_15c + 0x28) != 3) || ((((*(int *)((int)local_15c + 0x2c) != 0x50 && (*(int *)((int)local_15c + 0x2c) == 0xe7)) && (iVar16 = __RTDynamicCast(*(int *)((int)local_15c + 0xee0),0, &IsaacRepentancePlus::Entity_Familiar::ExtraData:: RTTI_Type_Descriptor,0,0), local_134.y == 5.60519e-45)) && (*(int *)(iVar16 + 0x4c) != 0)))) goto LAB_00961e18; bVar10 = *(byte *)(*(int *)((int)local_15c + 0x410) + 0x13f0 + (int)local_134.y); } if (bVar10 == 0) goto LAB_00961f38; } LAB_00961e18: if (EVar14 != (EntityPtr)this) { if (((isSwingWeapon != '\0') || (isSword != '\0')) && (g_game->_frameCount - this->_spawnFrame < 2)) { local_120.y = (float)&this->_sprite; local_108.y = (float)ANM2::GetAnimation((ANM2 *)((int)EVar14 + 0x78), (std_string *)local_40); local_14 = (void *)0x0; if (0xf < (uint)*(float *)((int)local_108.y + 0x14)) { local_108.y = *(float *)local_108.y; } pfVar15 = *(float **)((int)local_120.y + 0x34); if (pfVar15 == (float *)0x0) { LAB_00961f64: bVar10 = ANM2::SetAnimation(&this->_sprite,(byte *)local_108.y,1); if (bVar10 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; EVar14 = (EntityPtr)local_170._12_4_; } } else { if (0xf < (uint)pfVar15[5]) { pfVar15 = (float *)*pfVar15; } EVar20 = (EntityPtr)local_108.y; do { bVar10 = *(byte *)pfVar15; bVar22 = bVar10 < *(byte *)EVar20; if (bVar10 != *(byte *)EVar20) { LAB_00961f44: uVar12 = -(uint)bVar22 | 1; goto LAB_00961f49; } if (bVar10 == 0) break; bVar10 = *(byte *)((int)pfVar15 + 1); bVar22 = bVar10 < *(byte *)((int)EVar20 + 1); if (bVar10 != *(byte *)((int)EVar20 + 1)) goto LAB_00961f44; pfVar15 = (float *)((int)pfVar15 + 2); EVar20 = (EntityPtr)((int)EVar20 + 2); } while (bVar10 != 0); uVar12 = 0; LAB_00961f49: if ((uVar12 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00961f64; } local_14 = (void *)0xffffffff; if (0xf < local_38._h._4_4_) { uVar12 = local_38._h._4_4_ + 1; pvVar21 = local_40[0]; if (0xfff < uVar12) { pvVar21 = *(void **)((int)local_40[0] + -4); uVar12 = local_38._h._4_4_ + 0x24; if (0x1f < (uint)((int)local_40[0] + (-4 - (int)pvVar21))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar21,uVar12); } local_38._h._0_4_ = 0; local_38._h._4_4_ = 0xf; local_40[0] = (void *)((uint)local_40[0] & 0xffffff00); } this->_rotation = *(float *)((int)EVar14 + 0x438); this->_displayRotation = (this->_rotationOffset + *(float *)((int)EVar14 + 0x440)) - *(float *)((int)EVar14 + 0x43c); this->_charge = *(float *)((int)EVar14 + 0x460); if ((this->_isFlying == 0) && (*(char *)((int)EVar14 + 0x464) != '\0')) { this->_height = *(float *)((int)EVar14 + 0x4cc); this->_fallingSpeed = (float)*(void **)((int)EVar14 + 0x4d0); this->_basePosOffsetY = *(float *)((int)EVar14 + 0x4d4); UpdateHomingPath(this); } } local_d9 = 0; if (isSword != '\0') { if ((((this->_sprite)._animState._animData == (void *)0x0) || (bVar10 = AnimationState::IsEventTriggered (&(this->_sprite)._animState,(byte *)"SwingEnd"), bVar10 == 0)) || (this->_isInterpolating != 0)) { if (((EVar14 != (EntityPtr)this) && (*(byte *)((int)EVar14 + 0x4ea) != 0)) && (this->_isSpinAttack == 0)) { SpinAttack(this,*(short *)&((Vector *)((int)EVar14 + 0x4f0))->x,0); local_d9 = 1; } } else { bVar10 = Entity::HasEntityFlags((Entity *)this,0x400000); if ((bVar10 != 0) || (this->_isSpinAttack != 0)) { local_120.y = this->_displayRotation * 0.017453292; uVar2 = *(undefined4 *)((int)&this->_flags + 4); *(uint *)&this->_flags = (uint)this->_flags & 0xffbfffff; *(undefined4 *)((int)&this->_flags + 4) = uVar2; local_108.y = sin(local_120.y); fVar23 = cos(local_120.y); ownerPlayer = player; local_120.y = fVar23 * 10.0; local_108.y = local_108.y * 10.0; local_100._8_4_ = local_120.y; local_f4[0] = (EntityPtr)local_108.y; if (player != (Entity_Player *)0x0) { Entity_Player::GetTearMovementInheritance (player,&local_e8,(Vector *)(local_100 + 8),0); local_100._8_4_ = (local_120.y + *extraout_EAX) * ownerPlayer->_shotspeed; local_f4[0] = (EntityPtr)((local_108.y + extraout_EAX[1]) * ownerPlayer->_shotspeed) ; } if (this->_isSpinAttack != 0) { local_100._8_4_ = (float)local_100._8_4_ + (float)local_100._8_4_; local_f4[0] = (EntityPtr)((float)local_f4[0] + (float)local_f4[0]); } iVar16 = this->_variant; uVar12 = Random(); spawnedTear = (Entity_Tear *) Game::Spawn(g_game,2,(uint)(iVar16 == 0xb) * 2 + 0x2f,&this->_pos, (Vector *)(local_100 + 8),(Entity *)this->_spawnerEntity,0, uVar12); if (player != (Entity_Player *)0x0) { spawnedTear->_fallingAccel = player->_tearfallaccel; uVar12 = Random(); spawnedTear->_fallingSpeed = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.2 - player->_tearfallspeed; Entity_Projectile::SetHeight((Entity_Projectile *)spawnedTear,player->_tearheight); } local_e8.y = *(float *)&this->_spawnerEntity; if (spawnedTear->_parent != (EntityPtr)0x0) { local_120.y = (float)&spawnedTear->_parent; std::multiset::erase(&local_120.y); } spawnedTear->_parent = (EntityPtr)local_e8.y; if ((EntityPtr)local_e8.y != (EntityPtr)0x0) { std::multiset::insert(&spawnedTear->_parent); } tearFlagsTmp = BitSet128::__bnot((BitSet128 *)&DAT_00c34780,(BitSet128 *)&local_158); tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)local_100,&this->_tearFlags,tearFlagsTmp); flags._h._1_1_ = (char)(tearFlagsTmp->_h >> 8); flags._0_9_ = *(unkbyte9 *)tearFlagsTmp; flags._h._2_2_ = (short)(tearFlagsTmp->_h >> 0x10); flags._h._4_4_ = *(undefined4 *)((int)&tearFlagsTmp->_h + 4); Entity_Tear::SetTearFlags(spawnedTear,flags); pcVar3 = *(code **)(*(int *)spawnedTear + 0x3c); spawnedTear->_isFireSoundMuted = 1; (*pcVar3)(&this->_color,0xffffffff,0xff,0,1); if (this->_isSpinAttack == 0) { fVar23 = this->_collisionDamage + 2.0; } else { fVar23 = this->_collisionDamage * 4.0 + 4.0; } (**(code **)(*(int *)spawnedTear + 0x40))(fVar23); local_120.y = (this->_sprite)._scale.x; local_e8.y = 0.01; pVVar17 = &local_120; if (local_120.y <= 0.01) { pVVar17 = &local_e8; } fVar23 = pVVar17->y; spawnedTear->_baseScale = fVar23; spawnedTear->_fScale = fVar23; Entity_Tear::ResetSpriteScale(spawnedTear); (**(code **)(*(int *)spawnedTear + 0xc))(); EVar14 = (EntityPtr)local_170._12_4_; if ((this->_isSpinAttack != 0) && (spinsLeft = *(short *)&this[1].field_0x4, 1 < spinsLeft)) { piVar4 = this[1]._damageEvents._end; if (piVar4 != (int *)0x0) { (**(code **)(*piVar4 + 0x28))(); spinsLeft = *(short *)&this[1].field_0x4; } *(short *)&this[1].field_0x4 = spinsLeft + -1; SpinAttack(this,spinsLeft + -1,2); local_d9 = 1; } } } } if (((*(byte *)((int)EVar14 + 0x465) != 0) && (*(char *)((int)EVar14 + 0x464) == '\0')) && (local_d9 == 0)) { UpdateSwingHits(this); local_d9 = 1; } if ((isSword != '\0') && (*(byte *)((int)EVar14 + 0x465) == 0)) { if (*(char *)((int)EVar14 + 0x466) != '\0') { local_108.y = this->_displayRotation * 0.017453292; local_120.y = sin(local_108.y); local_100._8_4_ = cos(local_108.y); bVar10 = 0; local_f4[0] = (EntityPtr)local_120.y; iVar16 = vector_to_direction((Vector *)(local_100 + 8)); if (*(char *)&((Vector *)((int)EVar14 + 0x4e8))->x == '\0') { anim = (&PTR_s_IdleLeft_00b61560)[iVar16]; } else { anim = (&PTR_s_ChargedLeft_00b7cb28)[iVar16]; } ANM2::Play(&this->_sprite,anim,bVar10); } if (local_d9 == 0) { UpdateSwingHits(this); } } if (*(char *)((int)EVar14 + 0x464) == '\0') { if (EVar14 == (EntityPtr)this) { if ((g_game->_frameCount - this->_spawnFrame < 2) || (ABS(this->_displayRotation - this->_rotation) <= 0.1)) { this->_displayRotation = this->_rotationOffset + this->_rotation; } else { if ((player == (Entity_Player *)0x0) || (bVar10 = Entity_Player::HasCollectible(player,0x18d,0), bVar10 == 0)) { fVar23 = 0.3; } else { fVar23 = 1.0; } fVar23 = LerpAngleDeg(this->_displayRotation,this->_rotationOffset + this->_rotation, fVar23); this->_displayRotation = fVar23; } } else { this->_isFlying = 0; } (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; Entity::SetTarget((Entity *)this,(Entity *)0x0); if ((0.0 <= *(float *)&this[1]._pendingDamageFlags) && (EVar14 != (EntityPtr)this)) { (**(code **)(*(int *)this + 0x28))(); } EVar14 = local_15c; *(undefined1 **)&this[1]._pendingDamageFlags = &DAT_bf800000; if (0.0 <= (float)this[1]._type) { this->_visible = 1; } this[1]._type = (int)&DAT_bf800000; local_e8.y = *(float *)((int)local_15c + 0x33c); local_108.y = *(float *)((int)local_15c + 0x340); local_f4[0] = (EntityPtr)(this->_displayRotation * 0.017453292); local_120.y = sin((float)local_f4[0]); fVar23 = cos((float)local_f4[0]); (this->_pos).x = local_e8.y + fVar23 * local_12c; (this->_pos).y = local_108.y + local_120.y * local_12c; fVar23 = ((Vector *)((int)EVar14 + 0x33c))->x; (this->_anchorPosition).y = *(float *)((int)EVar14 + 0x340); (this->_anchorPosition).x = fVar23; local_120.y = (this->_pos).x; local_12c = (this->_pos).y; this->_basePosOffsetY = (this->_posOffset).y; local_ec = atan2f((this->_pos).y - *(float *)((int)EVar14 + 0x340), local_120.y - ((Vector *)((int)EVar14 + 0x33c))->x); local_ec = local_ec * 57.295776; } else { fVar23 = 0.8; if (EVar14 == (EntityPtr)this) { EVar20 = (EntityPtr)this->_speedMultiplier; local_108.y = (float)EVar20; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c348e0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 == 0) { tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c348a0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { local_108.y = (float)EVar20 * 0.75; } } else { local_108.y = (float)EVar20 * 0.5; } fVar24 = LerpAngleDeg(this->_displayRotation,this->_rotationOffset + this->_rotation, fVar23); fVar23 = this->_knifeVelocity; fVar25 = -2.0; fVar28 = -5.0; this->_displayRotation = fVar24; fVar24 = local_108.y * fVar23 * 0.5 + this->_knifeDistance; this->_knifeDistance = fVar24; EVar20 = (EntityPtr)local_108.y; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c34b60); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { fVar25 = -0.5; fVar28 = -0.75; } if (isSwingWeapon != '\0') { fVar25 = fVar25 * 0.75; fVar28 = fVar28 * 0.75; } if (this->_isInterpolating == 0) { if (fVar23 <= 0.0) { fVar25 = fVar28; } fVar25 = fVar25 * (float)EVar20 + fVar23; this->_knifeVelocity = fVar25; if (((0.0 < fVar23) && (fVar25 <= 0.0)) && (isSwingWeapon != '\0')) { std::vector::clear(&this->_hitList,0); fVar24 = this->_knifeDistance; } } if (0.0 <= fVar24) goto LAB_00962723; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; Entity::SetTarget((Entity *)this,(Entity *)0x0); this->_knifeDistance = 0.0; this->_isFlying = 0; this->_prismApplied = 0; this->_multidimensionalApplied = 0; (this->_posOffset).y = this->_basePosOffsetY; if (isSwingWeapon != '\0') { if (isSword == '\0') { ANM2::Play(&this->_sprite,s_Idle,0); } LAB_009626f7: if (this->_parent == (EntityPtr)player) { SoundEffects::PlayWithFartOverride(0xf9,1.0,2,0,1.0); } goto LAB_00962723; } if (isSword != '\0') goto LAB_009626f7; } else { LAB_00962723: if (((isSwingWeapon != '\0') || (isSword != '\0')) && (EVar14 != (EntityPtr)this)) { if (this->_isFlying == 0) { if (isSword == '\0') { (this->_sprite)._rotation = 0.0; ANM2::Play(&this->_sprite,&DAT_00b602e8,0); iVar16 = AnimationState::GetAnimationLength(&(this->_sprite)._animState); iVar16 = Isaac::Random(iVar16); Sprite::SetFrame_1((Sprite *)&this->_sprite,iVar16); EVar14 = (EntityPtr)local_170._12_4_; } std::vector::clear(&this->_hitList,0); } if ((0.0 < this->_knifeVelocity) && (*(float *)((int)EVar14 + 0x448) <= 0.0)) { std::vector::clear(&this->_hitList,0); } } } fVar23 = 0.0; bVar10 = Vector::operator_eq(&this->_anchorPosition,&g_vectorZero); pVVar17 = &this->_anchorPosition; if (bVar10 != 0) { fVar24 = *(float *)((int)local_15c + 0x340); pVVar17->x = ((Vector *)((int)local_15c + 0x33c))->x; (this->_anchorPosition).y = fVar24; } if (EVar14 == (EntityPtr)this) { fVar28 = this->_knifeDistance; fVar24 = this->_maxDistance; fVar25 = this->_charge; } else { this->_isFlying = 1; fVar28 = *(float *)((int)EVar14 + 0x444); this->_knifeDistance = fVar28; fVar24 = *(float *)((int)EVar14 + 0x45c); this->_maxDistance = fVar24; fVar25 = *(float *)((int)EVar14 + 0x460); this->_charge = fVar25; this->_knifeVelocity = *(float *)((int)EVar14 + 0x448); } fVar26 = fVar28 / fVar24; if (fVar28 / fVar24 <= fVar23) { fVar26 = fVar23; } if (1.0 <= fVar26) { fVar26 = 1.0; } fVar23 = 1.0 - fVar25 * fVar26 * 0.8; local_e0 = (*(float *)((int)local_15c + 0x340) - (this->_anchorPosition).y) * fVar23 + (this->_anchorPosition).y; local_108.y = fVar23 * (((Vector *)((int)local_15c + 0x33c))->x - pVVar17->x) + pVVar17->x ; (this->_anchorPosition).y = local_e0; pVVar17->x = local_108.y; fVar23 = this->_displayRotation; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c34b60); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 == 0) { local_120.y = fVar23 * 0.017453292; local_118.y = sin(local_120.y); local_e8.y = this->_knifeDistance + local_12c; fVar23 = cos(local_120.y); (this->_pos).x = fVar23 * local_e8.y + local_108.y; (this->_pos).y = local_118.y * local_e8.y + local_e0; } else { local_120.y = normalize_angle_degrees(this->_rotationOffset); fVar23 = this->_knifeDistance * 3.1415927; local_e8.y = ((fVar23 + fVar23) * (local_120.y * 0.002 + 1.0) + this->_displayRotation) * 0.017453292; local_118.y = sin(local_e8.y); local_120.y = (1.0 - local_120.y * 0.02) * this->_knifeDistance * 0.25 + local_12c; fVar23 = cos(local_e8.y); (this->_pos).x = fVar23 * local_120.y + local_108.y; (this->_pos).y = local_118.y * local_120.y + local_e0; local_e8.y = this->_knifeDistance * 0.0002 * ABS(this->_knifeVelocity) + 1.0; local_120.y = this->_knifeDistance * 0.0014 * ABS(this->_knifeVelocity) + 1.0; pVVar17 = &local_120; if (local_120.y <= local_e8.y) { pVVar17 = &local_e8; } fVar23 = pVVar17->y; local_f4[0] = (EntityPtr)(local_120.y / fVar23); local_100._8_4_ = local_e8.y / fVar23; sizeMulti.y._0_1_ = local_f4[0]._0_1_; sizeMulti.x = (float)local_100._8_4_; sizeMulti.y._1_1_ = local_f4[0]._1_1_; sizeMulti.y._2_2_ = local_f4[0]._2_2_; Entity::SetSize((Entity *)this,fVar23 * *(float *)((int)this->_config + 0x38),sizeMulti, -1); } fVar23 = atan2f((this->_pos).y - *(float *)((int)local_15c + 0x340), (this->_pos).x - ((Vector *)((int)local_15c + 0x33c))->x); fVar23 = fVar23 * 57.295776; local_ec = fVar23; local_e0 = fVar23; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c34b60); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { local_ec = fVar23 + 90.0; local_e0 = local_ec; } fVar23 = *(float *)&this[1]._pendingDamageFlags; fVar24 = (this->_pos).y; if (0.0 <= fVar23) { if (this->_knifeDistance <= fVar23) { if ((this->_knifeDistance < fVar23) && (EVar14 != (EntityPtr)this)) { LAB_00961f38: (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } } else { local_108.y = (float)this; while( true ) { EVar14 = *(EntityPtr *)((int)local_108.y + 0x504); local_118.y = (float)EVar14; if ((float)EVar14 < 0.0) break; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c34b60); if (((int)tearFlagsTmp->_l == 0 && *(int *)((int)&tearFlagsTmp->_l + 4) == 0) && ((int)tearFlagsTmp->_h == 0 && *(int *)((int)&tearFlagsTmp->_h + 4) == 0)) { local_120.y = this->_displayRotation * 0.017453292; local_134.y = sin(local_120.y); } else { local_120.y = ((float)EVar14 * 3.1415927 * 0.5 + this->_displayRotation) * 0.017453292; local_134.y = sin(local_120.y); local_118.y = local_118.y * 0.7; } local_118.y = local_118.y + local_12c; fVar23 = cos(local_120.y); local_134.y = local_134.y * local_118.y; local_118.y = fVar23 * local_118.y + (this->_anchorPosition).x; local_134.y = local_134.y + (this->_anchorPosition).y; local_e0 = (this->_pos).x - local_118.y; local_f4[0] = (EntityPtr)((this->_pos).y - local_134.y); local_120.y = *(float *)((int)local_108.y + 0x508) * 0.017453292; local_e8.y = cos(local_120.y); fVar23 = sin(local_120.y); local_118.y = local_118.y + (local_e8.y * local_e0 - fVar23 * (float)local_f4[0]); local_134.y = local_134.y + local_e8.y * (float)local_f4[0] + fVar23 * local_e0; (this->_pos).x = local_118.y; (this->_pos).y = local_134.y; local_ec = local_ec + *(float *)((int)local_108.y + 0x508); local_f4[0] = (EntityPtr)(local_ec * 0.017453292); local_e0 = local_ec; local_120.y = cos((float)local_f4[0]); fVar28 = sin((float)local_f4[0]); fVar23 = *(float *)((int)local_108.y + 0x50c); fVar25 = *(float *)((int)local_108.y + 0x510); fVar24 = fVar23 * fVar28 + fVar25 * local_120.y + local_134.y; (this->_pos).y = fVar24; (this->_pos).x = local_118.y + (fVar23 * local_120.y - fVar25 * fVar28); local_108.y = *(float *)((int)local_108.y + 0x3bc); if (((EntityPtr)local_108.y == (EntityPtr)0x0) || (*(float *)((int)local_108.y + 0x28) != 1.12104e-44)) break; } EVar14 = (EntityPtr)local_170._12_4_; } } fVar23 = (float)this[1]._type; local_12c = fVar24; if (((0.0 <= fVar23) && (this->_visible == 0)) && (this->_knifeDistance <= fVar23 && fVar23 != this->_knifeDistance)) { this->_visible = 1; local_12c = (this->_pos).y; } local_120.y = (this->_pos).x; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c348d0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { screen_wrap(this); } tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags,&g_tearFlagHoming); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { update_target(this,&local_e0); local_ec = local_e0; } fVar23 = local_ec; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c34870); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { apply_wiggle(this,&local_e0); local_ec = local_e0; fVar23 = local_e0; } tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c348e0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 == 0) { tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c348a0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { rootParent = (Entity_Knife *)GetRootParent(this); if (rootParent == this) { local_108.y = 0.0; } else { RNG::game_constructor(&local_158,this->_initSeed,0x23); fVar23 = RNG::RandomFloat(this_01); local_108.y = fVar23 * 360.0; fVar23 = local_ec; } local_f4[0] = (EntityPtr)(fVar23 * 0.017453292); local_118.y = sin((float)local_f4[0]); local_e0 = cos((float)local_f4[0]); local_134.y = this->_knifeDistance; local_f4[0] = (EntityPtr)((local_134.y * 3.0 + local_108.y) * 0.017453292); local_e8.y = cos((float)local_f4[0]); fVar23 = sin((float)local_f4[0]); fVar24 = local_134.y * 0.5; if (fVar24 <= 0.0) { fVar24 = 0.0; } if (50.0 <= fVar24) { fVar24 = 50.0; } (this->_pos).y = fVar24 * (fVar23 * local_e0 + local_e8.y * local_118.y) + (this->_pos).y; (this->_pos).x = fVar24 * (local_e8.y * local_e0 - fVar23 * local_118.y) + (this->_pos).x; local_ec = this->_knifeDistance * 3.0 + 90.0 + local_108.y + local_ec; } } else { rootParent = (Entity_Knife *)GetRootParent(this); if (rootParent == this) { local_108.y = 0.0; } else { RNG::game_constructor(&local_158,this->_initSeed,0x23); fVar23 = RNG::RandomFloat(spawnedTear); local_108.y = fVar23 * 360.0; fVar23 = local_ec; } local_f4[0] = (EntityPtr)(fVar23 * 0.017453292); local_118.y = sin((float)local_f4[0]); local_e0 = cos((float)local_f4[0]); local_134.y = this->_knifeDistance; local_f4[0] = (EntityPtr)((local_134.y + local_134.y + local_108.y) * 0.017453292); local_e8.y = cos((float)local_f4[0]); fVar23 = sin((float)local_f4[0]); fVar24 = local_134.y * 0.5; if (fVar24 <= 0.0) { fVar24 = 0.0; } if (180.0 <= fVar24) { fVar24 = 180.0; } (this->_pos).y = fVar24 * (fVar23 * local_e0 + local_e8.y * local_118.y) + (this->_pos).y; (this->_pos).x = fVar24 * (local_e8.y * local_e0 - fVar23 * local_118.y) + (this->_pos).x; local_ec = this->_knifeDistance + this->_knifeDistance + 90.0 + local_108.y + local_ec; } EVar20 = (EntityPtr)0x0; tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c348c0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { rootParent = (Entity_Knife *)GetRootParent(this); if (rootParent != this) { RNG::game_constructor((RNG *)local_100,this->_initSeed,0x23); fVar23 = RNG::RandomFloat(this_02); EVar20 = (EntityPtr)(fVar23 * 120.0); } local_f4[0] = (EntityPtr)(local_ec * 0.017453292); local_e8.y = (float)EVar20; local_118.y = sin((float)local_f4[0]); local_e0 = cos((float)local_f4[0]); local_f4[0] = (EntityPtr)cos(1.5707964); fVar23 = sin(1.5707964); local_134.y = fVar23 * local_e0 + (float)local_f4[0] * local_118.y; local_108.y = (float)local_f4[0] * local_e0 - fVar23 * local_118.y; fVar23 = fmodf(local_e8.y + this->_knifeDistance,120.0); if (40.0 <= fVar23) { if (60.0 <= fVar23) { if (fVar23 < 100.0) { fVar24 = ((fVar23 - 60.0) * 20.0) / 40.0; fVar23 = fVar24 * local_e0 + local_108.y * 15.0; fVar24 = fVar24 * local_118.y + local_134.y * 15.0; goto LAB_0096357e; } fVar24 = ((120.0 - fVar23) * 20.0) / 20.0; fVar23 = 15.0 - ((fVar23 - 100.0) * 30.0) / 20.0; (this->_pos).y = fVar23 * local_134.y + fVar24 * local_118.y + (this->_pos).y; (this->_pos).x = fVar23 * local_108.y + fVar24 * local_e0 + (this->_pos).x; local_ec = local_ec - 90.0; } else { fVar24 = ((60.0 - fVar23) * 20.0) / 20.0; fVar23 = 15.0 - ((fVar23 - 40.0) * 30.0) / 20.0; (this->_pos).x = (fVar24 * local_e0 - local_108.y * fVar23) + (this->_pos).x; local_ec = local_ec + 90.0; (this->_pos).y = (fVar24 * local_118.y - local_134.y * fVar23) + (this->_pos).y; } } else { fVar24 = (fVar23 * 20.0) / 40.0; fVar23 = fVar24 * local_e0 - local_108.y * 15.0; fVar24 = fVar24 * local_118.y - local_134.y * 15.0; LAB_0096357e: (this->_pos).x = fVar23 + (this->_pos).x; (this->_pos).y = fVar24 + (this->_pos).y; } } if ((EVar14 == (EntityPtr)this) && (player != (Entity_Player *)0x0)) { bVar10 = Entity_Player::HasCollectible(player,0x76,0); if ((bVar10 != 0) && (this->_knifeVelocity <= 0.0 && this->_knifeVelocity != 0.0)) { bVar10 = Entity::IsFrame((Entity *)this,2,0); if (bVar10 != 0) { uVar12 = Random(); local_108.y = *(float *)((int)this->_parent + 0x33c); local_e0 = *(float *)((int)this->_parent + 0x340); local_f4[0] = (EntityPtr)(this->_rotation * 0.017453292); local_e8.y = sin((float)local_f4[0]); fVar23 = cos((float)local_f4[0]); local_118.x = local_108.y + fVar23 * 30.0; local_118.y = local_e0 + local_e8.y * 30.0; EVar14 = (EntityPtr) Game::SpawnEx(g_game,8,0,&local_118,&g_vectorZero,(Entity *)player,1,uVar12 ,1); local_108.y = (float)EVar14; if (EVar14 != (EntityPtr)0x0) { iVar16 = *(int *)EVar14; ((Vector *)((int)EVar14 + 0x34c))->x = 0.0; *(float *)((int)EVar14 + 0x350) = -10.0; (**(code **)(iVar16 + 0x40))(this->_collisionDamage * 0.4); (**(code **)(*(int *)EVar14 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); HomingLaser::operator_assign ((HomingLaser *)((int)EVar14 + 0x468),&this->_homingLaser); Entity::SetParent((Entity *)EVar14,(Entity *)this); pvVar21 = *(void **)((int)&(this->_tearFlags)._l + 4); pvVar5 = *(void **)&(this->_tearFlags)._h; pvVar6 = *(void **)((int)&(this->_tearFlags)._h + 4); *(int *)&((BitSet128 *)((int)local_108.y + 0x410))->_l = (int)(this->_tearFlags)._l; ((std_vector *)((int)local_108.y + 0x414))->_begin = pvVar21; *(void **)((int)local_108.y + 0x418) = pvVar5; *(void **)((int)local_108.y + 0x41c) = pvVar6; uVar12 = Random(); local_e0 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 50.0 - 25.0; local_f4[0] = (EntityPtr)(this->_rotation * 0.017453292); local_e8.y = sin((float)local_f4[0]); local_100._8_4_ = cos((float)local_f4[0]); local_f4[0] = (EntityPtr)local_e8.y; direction.y = local_e8.y; direction.x = (float)local_100._8_4_; InitHomingPath((Entity_Knife *)local_108.y,direction,(Entity *)this,local_e0); ((Vector *)((int)local_108.y + 0xe4))->x = (this->_sprite)._scale.x; *(float *)((int)local_108.y + 0xe8) = (this->_sprite)._scale.y; (**(code **)((int)*(float *)local_108.y + 0xc))(); } } } } } if (isSwingWeapon == '\0') { if (isSword != '\0') goto LAB_00963b53; fVar23 = normalize_angle_degrees(local_ec - 90.0); (this->_sprite)._rotation = fVar23; local_d9 = 0.0 < fVar23; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_flipX = local_d9; } else { if (isSword == '\0') { if (this->_isFlying != 0) goto LAB_00963c34; } else { LAB_00963b53: if (this->_isFlying != 0) { fVar23 = normalize_angle_degrees(local_ec - 90.0); (this->_sprite)._rotation = fVar23; goto LAB_00963c34; } } fVar23 = atan2f(local_12c - *(float *)((int)local_15c + 0x340), local_120.y - ((Vector *)((int)local_15c + 0x33c))->x); fVar23 = normalize_angle_degrees(fVar23 * 57.295776 - 90.0); (this->_sprite)._rotation = fVar23; local_e8.y = (float)ANM2::GetLayerFrame(&this->_sprite,0); if ((EntityPtr)local_e8.y != (EntityPtr)0x0) { local_f4[0] = (EntityPtr)((this->_sprite)._rotation * 0.017453292); local_120.y = cos((float)local_f4[0]); fVar23 = sin((float)local_f4[0]); this->_knifeDepthOffset = local_120.y * *(float *)((int)local_e8.y + 4) + fVar23 * *(float *)local_e8.y; } } LAB_00963c34: bVar10 = this->_isFlying; this[1]._variant = (int)local_ec; if ((bVar10 != 0) && (this->_visible != 0)) { tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)local_110,&this->_tearFlags, (BitSet128 *)&DAT_00c34ac0); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if ((bVar10 != 0) && ((bVar10 = Entity::IsFrame((Entity *)this,2,0), bVar10 != 0 && (uVar12 = Random(), (uVar12 & 1) == 0)))) { local_e8.x = (this->_pos).x; local_e8.y = (this->_pos).y; pVVar17 = Room::GetClampedPosition (g_game->_room,(Vector *)(local_100 + 8),&local_e8,15.0); local_e8.x = pVVar17->x; local_e8.y = pVVar17->y; uVar12 = Random(); tmpEntity = Game::Spawn(g_game,1000,0x35,&local_e8,&g_vectorZero, (Entity *)this->_spawnerEntity,0,uVar12); fVar23 = (this->_sprite)._scale.x; fVar24 = g_vectorOne.x * 0.4; iVar16 = *(int *)tmpEntity; fVar25 = g_vectorOne.y * 0.4; pAVar8 = &tmpEntity[1]._sprite; (pAVar8->_filename)._buf[8] = '\x1e'; (pAVar8->_filename)._buf[9] = '\0'; (pAVar8->_filename)._buf[10] = '\0'; (pAVar8->_filename)._buf[0xb] = '\0'; pAVar8 = &tmpEntity[1]._sprite; (pAVar8->_filename)._buf[0xc] = '\x1e'; (pAVar8->_filename)._buf[0xd] = '\0'; (pAVar8->_filename)._buf[0xe] = '\0'; (pAVar8->_filename)._buf[0xf] = '\0'; (tmpEntity->_sprite)._scale.x = fVar23 * fVar24; (tmpEntity->_sprite)._scale.y = fVar23 * fVar25; (**(code **)(iVar16 + 0xc))(); } } if ((((((Entity_Knife *)local_170._12_4_ != this) || (this->_variant == 8)) || (this->_variant == 4)) && ((*(char *)(local_170._12_4_ + 0x464) == '\0' && (*(char *)(local_170._12_4_ + 0x466) == '\0')))) && (*(byte *)(local_170._12_4_ + 0x465) == 0)) { (**(code **)(*(int *)this + 0x28))(); } } else if (*(int *)((int)this->_parent + 0x28) == 1) { ownerPlayer = (Entity_Player *) __RTDynamicCast(this->_parent,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,0xdc,0); bVar10 = Entity_Player::HasWeaponType(ownerPlayer,(int)local_134.y); if (bVar10 == 0) { (**(code **)(*(int *)this + 0x28))(); } this->_isFlying = 0; fVar23 = (this->_velocity).y; fVar24 = (this->_velocity).x; if (fVar24 * fVar24 + fVar23 * fVar23 <= 0.1) { fVar23 = (this->_sprite)._rotation; } else { fVar23 = atan2f(fVar23,fVar24); fVar23 = LerpAngleDeg((this->_sprite)._rotation,fVar23 * 57.295776 - 90.0,0.24); (this->_sprite)._rotation = fVar23; } local_d9 = 0.0 < fVar23; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_flipX = local_d9; pBVar13 = BitSet128::operator_and ((BitSet128 *)&local_158,tearFlagsTmp,(BitSet128 *)&DAT_00c348d0); bVar10 = BitSet128::IsNonZero(pBVar13); if (bVar10 != 0) { screen_wrap(this); } tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,tearFlagsTmp,&g_tearFlagHoming); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { EVar14 = this->_target; if (EVar14 == (EntityPtr)0x0) { local_120.y = 22500.0; local_108.y = (float)EVar14; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&local_158, &this->_pos,150.0,8); local_14 = (void *)0x1; local_e8.y = 0.0; if ((EntityPtr)local_158._shift3 != (EntityPtr)0x0) { do { EVar14 = *(EntityPtr *)(local_158._shift1 + (int)local_e8.y * 4); bVar10 = Entity::IsVulnerableEnemy((Entity *)EVar14,(Entity *)0x0); if (bVar10 != 0) { fVar23 = (this->_pos).x - ((Vector *)((int)EVar14 + 0x33c))->x; fVar24 = (this->_pos).y - *(float *)((int)EVar14 + 0x340); EVar20 = (EntityPtr)(fVar24 * fVar24 + fVar23 * fVar23); if (*(float *)((int)EVar14 + 0x14) < *(float *)((int)EVar14 + 0x380)) { if ((float)EVar20 < local_120.y) { local_120.y = (float)EVar20; local_108.y = (float)EVar14; } } } local_e8.y = (float)((int)local_e8.y + 1); } while ((uint)local_e8.y < (uint)local_158._shift3); } Entity::SetTarget((Entity *)this,(Entity *)local_108.y); EntityList_Query::~EntityList_Query(&local_158); } else { local_100._8_4_ = (this->_pos).x - ((Vector *)((int)EVar14 + 0x33c))->x; local_f4[0] = (EntityPtr)((this->_pos).y - *(float *)((int)EVar14 + 0x340)); pVVar17 = Vector::Normalized((Vector *)(local_100 + 8),&local_120); fVar23 = pVVar17->y; EVar14 = this->_target; (this->_velocity).x = (this->_velocity).x - pVVar17->x; (this->_velocity).y = (this->_velocity).y - fVar23; fVar23 = (this->_pos).y - *(float *)((int)EVar14 + 0x340); fVar24 = (this->_pos).x - *(float *)((int)EVar14 + 0x33c); if (22500.0 < fVar23 * fVar23 + fVar24 * fVar24) { Entity::SetTarget((Entity *)this,(Entity *)0x0); } } } tearFlagsTmp = BitSet128::operator_and ((BitSet128 *)&local_158,&this->_tearFlags, (BitSet128 *)&DAT_00c34870); if (((int)tearFlagsTmp->_l != 0 || *(int *)((int)&tearFlagsTmp->_l + 4) != 0) || ((int)tearFlagsTmp->_h != 0 || *(int *)((int)&tearFlagsTmp->_h + 4) != 0)) { local_e8.x = (this->_velocity).y; local_e8.y = (float)((uint)(this->_velocity).x ^ 0x80000000); Vector::Normalize(&local_e8); fVar23 = (this->_velocity).y; fVar24 = (this->_velocity).x; fVar23 = sqrtf(fVar24 * fVar24 + fVar23 * fVar23); local_f4[0] = (EntityPtr)(fVar23 * 0.5); local_120.y = 30.0; pEVar18 = local_f4; if (30.0 <= (float)local_f4[0]) { pEVar18 = (EntityPtr *)&local_120.y; } fVar23 = sin((float)g_game->_frameCount * 0.4); EVar14 = *pEVar18; (this->_pos).x = local_e8.x * fVar23 * (float)EVar14 + (this->_pos).x; (this->_pos).y = local_e8.y * fVar23 * (float)EVar14 + (this->_pos).y; } tearFlagsTmp = BitSet128::operator_and (&local_1e0,&this->_tearFlags,(BitSet128 *)&DAT_00c348d0); if (((int)tearFlagsTmp->_l == 0 && *(int *)((int)&tearFlagsTmp->_l + 4) == 0) && ((int)tearFlagsTmp->_h == 0 && *(int *)((int)&tearFlagsTmp->_h + 4) == 0)) { pVVar17 = Room::GetClampedPosition(g_game->_room,&local_134,&this->_pos,0.0); (this->_pos).x = pVVar17->x; (this->_pos).y = pVVar17->y; } EVar14 = (EntityPtr)0x0; local_158._shift1 = 0; local_118.y = 0.0; local_158._shift2 = 0; local_158._shift3 = 0; local_14 = (void *)0x2; local_108.y = *(float *)&this->_child; if ((EntityPtr)local_108.y != (EntityPtr)0x0) { do { if ((EntityPtr)local_158._shift2 == EVar14) { std::vector::_Emplace_reallocate((char)local_158._shift2,&local_108.y); EVar14 = (EntityPtr)local_158._shift3; } else { *(float *)local_158._shift2 = local_108.y; local_158._shift2 = local_158._shift2 + 4; } local_108.y = *(float *)&((EntityPtr *)((int)local_108.y + 0x3c0))->field_0x0; } while ((EntityPtr)local_108.y != (EntityPtr)0x0); local_108.y = 0.0; local_118.y = (float)EVar14; } local_e0 = (float)g_game->_frameCount; if (this->_isInterpolating != 0) { local_e0 = local_e0 + 0.5; } iVar16 = local_158._shift2 - local_158._shift1; local_e8.y = 0.0; EVar14 = (EntityPtr)(iVar16 >> 2); if (EVar14 != (EntityPtr)0x0) { local_12c = local_e0 * 6.0; do { local_170._12_4_ = *(EntityPtr *)(local_158._shift1 + (int)local_e8.y * 4); ((Vector *)(local_170._12_4_ + 0x360))->x = (this->_velocity).x; *(float *)(local_170._12_4_ + 0x364) = (this->_velocity).y; local_108.y = this->_size * 5.0; EVar20 = (EntityPtr) (((float)((double)(int)local_e8.y + __uint_to_double_fixup[-((int)local_e8.y >> 0x1f)]) * 360.0) / (float)((double)(int)EVar14 + __uint_to_double_fixup[-(iVar16 >> 0x1f)]) + local_12c); fVar23 = local_e0; local_120.y = (float)EVar20; tearFlagsTmp = BitSet128::operator_and (&local_1c0,&this->_tearFlags,(BitSet128 *)&DAT_00c34890); if (((int)tearFlagsTmp->_l != 0 || *(int *)((int)&tearFlagsTmp->_l + 4) != 0) || ((int)tearFlagsTmp->_h != 0 || *(int *)((int)&tearFlagsTmp->_h + 4) != 0)) { fVar23 = sin(fVar23 * 0.3); local_108.y = ((fVar23 + 1.0) * 0.5 * 0.5 + 1.0) * local_108.y; EVar20 = (EntityPtr)local_120.y; } local_f4[0] = (EntityPtr)((float)EVar20 * 0.017453292); local_15c = (EntityPtr)sin((float)local_f4[0]); fVar24 = cos((float)local_f4[0]); fVar23 = (this->_pos).y; ((Vector *)(local_170._12_4_ + 0x33c))->x = fVar24 * local_108.y + (this->_pos).x; fVar24 = local_120.y - 90.0; *(float *)(local_170._12_4_ + 0x340) = (float)local_15c * local_108.y + fVar23; if (360.0 < ABS(fVar24)) { fVar24 = fmodf(fVar24,360.0); } if (fVar24 <= 180.0) { if (fVar24 < -180.0) { fVar24 = fVar24 + 360.0; } } else { fVar24 = fVar24 - 360.0; } *(float *)(local_170._12_4_ + 0xec) = fVar24; (**(code **)((int)*(float *)local_170._12_4_ + 0x3c)) (&(this->_sprite)._color,0xffffffff,0xff,0,1); pvVar21 = *(void **)((int)&(this->_tearFlags)._l + 4); pvVar5 = *(void **)&(this->_tearFlags)._h; pvVar6 = *(void **)((int)&(this->_tearFlags)._h + 4); fVar23 = *(float *)local_170._12_4_; *(float *)&((BitSet128 *)(local_170._12_4_ + 0x410))->_l = *(float *)&(this->_tearFlags)._l; ((std_vector *)(local_170._12_4_ + 0x414))->_begin = pvVar21; *(void **)(local_170._12_4_ + 0x418) = pvVar5; *(void **)(local_170._12_4_ + 0x41c) = pvVar6; (**(code **)((int)fVar23 + 0x40))(this->_collisionDamage); local_e8.y = (float)((int)local_e8.y + 1); } while ((uint)local_e8.y < (uint)EVar14); } local_14 = (void *)0xffffffff; if ((void *)local_158._shift1 != (void *)0x0) { deallocate((void *)local_158._shift1,(int)local_118.y - local_158._shift1 >> 2); } } if ((this->_isFlying != 0) && ((tearFlagsTmp = BitSet128::operator_and (&local_1c0,&this->_tearFlags,(BitSet128 *)&DAT_00c345e0), (int)tearFlagsTmp->_l != 0 || *(int *)((int)&tearFlagsTmp->_l + 4) != 0 || ((int)tearFlagsTmp->_h != 0 || *(int *)((int)&tearFlagsTmp->_h + 4) != 0)))) { fVar23 = this->_height; EVar14 = (EntityPtr)&this->_fallingSpeed; if ((fVar23 < 0.0) || (*(float *)EVar14 <= 0.0 && *(float *)EVar14 != 0.0)) { fVar24 = *(float *)EVar14; local_120.y = (float)EVar14; fVar23 = fVar23 + fVar24; this->_height = fVar23; if (this->_knifeVelocity <= 0.0) { local_f4[0] = (EntityPtr)(fVar23 * -0.1); pEVar18 = local_f4; if (fVar23 * -0.1 < fVar24) { pEVar18 = (EntityPtr *)&this->_fallingSpeed; } EVar20 = *pEVar18; } else { EVar20 = (EntityPtr)(fVar24 + 1.5); } this->_fallingSpeed = (float)EVar20; if (0.0 <= fVar23) { this->_height = 0.0; if ((this->_knifeVelocity <= 0.0) || ((float)EVar20 <= 0.5)) { fVar23 = 0.0; } else { fVar23 = (float)EVar20 * -0.8; } *(float *)EVar14 = fVar23; uVar12 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xe,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar12 ); fVar23 = g_vectorOne.y * 0.75; pcVar3 = *(code **)(*(int *)tmpEntity + 0x3c); (tmpEntity->_sprite)._scale.x = g_vectorOne.x * 0.75; (tmpEntity->_sprite)._scale.y = fVar23; (*pcVar3)(&(knife->_sprite)._color,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); SoundEffects::PlayWithFartOverride(0x96,0.5,2,0,1.0); tear_flags_area_apply (*(float *)local_140.y,*(float *)((int)local_140.y + 4), (char)((std_vector *)((int)local_140.y + 8))->_begin, *(void **)((int)local_140.y + 0xc)); fVar23 = knife->_height; EVar14 = (EntityPtr)local_120.y; this = knife; } } (this->_posOffset).y = fVar23 + this->_basePosOffsetY; if ((isSwingWeapon == '\0') && (isSword == '\0')) { local_f4[0] = (EntityPtr)this->_knifeVelocity; local_140.y = atan2f(-*(float *)EVar14,(float)local_f4[0]); fVar23 = sin((this->_sprite)._rotation * 0.017453292); (this->_sprite)._rotation = local_140.y * 57.295776 * fVar23 + (this->_sprite)._rotation; if ((float)local_f4[0] < 0.0) { layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); local_d9 = layer->_flipX == 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_flipX = local_d9; } } } if (this->_isInterpolating == 0) { if ((this->_isFlying == 0) || (this->_dead != 0)) { pvVar21 = this[1]._damageEvents._capacity; if (pvVar21 != (void *)0x0) { iVar16 = *(int *)((int)pvVar21 + 0x458); if (iVar16 < 9) { Color::operator_assign((Color *)local_1ac,(ColorMod *)((int)pvVar21 + 0xf0)); iVar19 = 8; if (iVar16 < 8) { iVar19 = iVar16; } local_1a0 = (float)iVar19 * (this->_color)._tint[3] * 0.125; Sprite::SetColor((Sprite *)(extraout_EDX_01 + 0x48),(ColorMod *)local_1ac); pvVar21 = this[1]._damageEvents._capacity; *(float *)((int)pvVar21 + 0x4bc) = *(float *)((int)pvVar21 + 0x4bc) + 4.0; } else { *(undefined4 *)((int)pvVar21 + 0x458) = 8; } } } else if ((player != (Entity_Player *)0x0) && (bVar10 = Entity_Player::HasCollectible(player,0x44,0), bVar10 != 0)) { laser = (Entity_NPC *)this[1]._pendingDamage; local_d9 = 0; if (laser == (Entity_NPC *)0x0) { local_100._8_4_ = (player->_pos).x; local_f4[0] = (EntityPtr)(player->_pos).y; local_140.x = (player->_posOffset).x + 0.0; local_140.y = (player->_posOffset).y - 8.0; techLaser = Entity_Laser::ShootAngle (2,(Vector *)(local_100 + 8),0.0,-1,&local_140,(Entity *)player,0) ; b = (BitSet128 *)&DAT_00c34b60; uVar32 = 0xe0; uVar33 = 0x48; uVar34 = 0xc3; pBVar13 = (BitSet128 *)&DAT_00c348a0; tearFlagsTmp = BitSet128::operator_or ((BitSet128 *)local_148,(BitSet128 *)&DAT_00c34870, (BitSet128 *)&DAT_00c348c0); tearFlagsTmp = BitSet128::operator_or((BitSet128 *)local_128,tearFlagsTmp,pBVar13); tearFlagsTmp = BitSet128::operator_or ((BitSet128 *)local_170,tearFlagsTmp, (BitSet128 *)CONCAT22(uVar34,CONCAT11(uVar33,uVar32))); tearFlagsTmp = BitSet128::operator_or(&local_1f0,tearFlagsTmp,b); tearFlagsTmp = BitSet128::__bnot(tearFlagsTmp,&local_180); tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,tearFlagsTmp); uVar2 = *(undefined4 *)((int)&tearFlagsTmp->_l + 4); qVar9 = tearFlagsTmp->_h; uVar7 = *(undefined4 *)((int)&tearFlagsTmp->_h + 4); *(int *)&(techLaser->_tearFlags)._l = (int)tearFlagsTmp->_l; *(undefined4 *)((int)&(techLaser->_tearFlags)._l + 4) = uVar2; *(int *)&(techLaser->_tearFlags)._h = (int)qVar9; *(undefined4 *)((int)&(techLaser->_tearFlags)._h + 4) = uVar7; color = Entity_Player::get_laser_color_copy(player,(ColorMod *)local_6c); (*extraout_EDX_00)(color,0xffffffff,0xff,0,1); (**(code **)(*(int *)techLaser + 0x40))(this->_charge * this->_collisionDamage); techLaser->_mass = 0.0; EntityPtr::SetReference((EntityPtr *)&this[1]._pendingDamage,(Entity *)techLaser); laser = (Entity_NPC *)this[1]._pendingDamage; local_d9 = 1; if (laser != (Entity_NPC *)0x0) goto LAB_0096499b; } else { LAB_0096499b: local_140.y = (this->_pos).x - (laser->_pos).x; local_120.y = (this->_pos).y - (laser->_pos).y; fVar23 = atan2f(local_120.y,local_140.y); Entity_NPC::SetAimAngle(laser,fVar23 * 57.295776); fVar23 = this[1]._pendingDamage; fVar24 = sqrtf(local_140.y * local_140.y + local_120.y * local_120.y); *(float *)((int)fVar23 + 0x4d0) = fVar24; if (-0.5 <= local_120.y) { *(undefined4 *)((int)this[1]._pendingDamage + 0x358) = 0x453b8000; } else { *(undefined4 *)((int)this[1]._pendingDamage + 0x358) = 0xc1200000; } } if (local_d9 != 0) { (**(code **)(*(int *)this[1]._pendingDamage + 0xc))(); } } if (((this->_isFlying == 0) || (this->_dead != 0)) && ((int *)this[1]._pendingDamage != (int *)0x0)) { iVar16 = *(int *)this[1]._pendingDamage; goto LAB_009652a6; } } } else if (iVar16 == 1) { local_108.y = -100.0; EVar14 = (EntityPtr)this->_pathSegment; local_118.y = 0.0; local_120.y = 1e+07; if ((uint)EVar14 < (uint)(((int)(this->_homingLaser)._bezier._end - (int)(this->_homingLaser)._bezier._begin) / 0x18 + -1)) { local_170._12_4_ = (int)EVar14 * 0x18; do { pvVar21 = (void *)(local_170._12_4_ + (int)(this->_homingLaser)._bezier._begin); EVar20 = (EntityPtr) bezier_closest_point (&this->_pos,pvVar21,(void *)((int)pvVar21 + 0x18),&local_140.y); if ((float)EVar20 < local_120.y) { if (EVar14 == (EntityPtr)this->_pathSegment) { if (!(this->_pathProgress <= local_140.y && local_140.y != this->_pathProgress)) goto LAB_00964bdf; } local_108.y = local_140.y; local_120.y = (float)EVar20; local_118.y = (float)EVar14; } LAB_00964bdf: EVar14 = (EntityPtr)((int)EVar14 + 1); local_170._12_4_ = local_170._12_4_ + 0x18; } while ((uint)EVar14 < (uint)(((int)(this->_homingLaser)._bezier._end - (int)(this->_homingLaser)._bezier._begin) / 0x18 + -1)); } EVar14 = (EntityPtr)&this->_tearFlags; local_140.y = (float)EVar14; tearFlagsTmp = BitSet128::operator_and (&local_38,(BitSet128 *)EVar14,(BitSet128 *)&DAT_00c345e0); if (((int)tearFlagsTmp->_l != 0 || *(int *)((int)&tearFlagsTmp->_l + 4) != 0) || ((int)tearFlagsTmp->_h != 0 || *(int *)((int)&tearFlagsTmp->_h + 4) != 0)) { if (g_game->_frameCount - this->_spawnFrame == 1) { uVar12 = Random(); this->_fallingSpeed = -5.0 - (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.0; } fVar23 = this->_height; if ((fVar23 < 0.0) || (this->_fallingSpeed <= 0.0 && this->_fallingSpeed != 0.0)) { fVar24 = this->_fallingSpeed + 1.5; fVar23 = fVar23 + this->_fallingSpeed; this->_fallingSpeed = fVar24; this->_height = fVar23; if (0.0 <= fVar23) { this->_height = 0.0; if (fVar24 <= 0.5) { fVar24 = 0.0; } else { fVar24 = fVar24 * -0.8; } this->_fallingSpeed = fVar24; uVar12 = Random(); tmpEntity = Game::Spawn(g_game,1000,0xe,&this->_pos,&g_vectorZero,(Entity *)0x0,0,uVar12 ); fVar23 = g_vectorOne.y * 0.75; pcVar3 = *(code **)(*(int *)tmpEntity + 0x3c); (tmpEntity->_sprite)._scale.x = g_vectorOne.x * 0.75; (tmpEntity->_sprite)._scale.y = fVar23; (*pcVar3)(&(knife->_sprite)._color,0xffffffff,0xff,0,1); (**(code **)(*(int *)tmpEntity + 0xc))(); SoundEffects::PlayWithFartOverride(0x96,0.5,2,0,1.0); EVar14 = (EntityPtr)local_140.y; tear_flags_area_apply (*(float *)local_140.y,*(float *)((int)local_140.y + 4), (char)((std_vector *)((int)local_140.y + 8))->_begin, *(void **)((int)local_140.y + 0xc)); fVar23 = knife->_height; this = knife; } } (this->_posOffset).y = fVar23 + this->_basePosOffsetY; } if (local_108.y <= -99.0) { (**(code **)(*(int *)this + 0x28))(); } else { fVar23 = 1.0 - local_108.y; pvVar21 = (this->_homingLaser)._bezier._begin; fVar26 = fVar23 * fVar23 * fVar23; fVar24 = fVar23 * fVar23 * 3.0 * local_108.y; fVar29 = fVar23 * 3.0 * local_108.y * local_108.y; fVar30 = local_108.y * local_108.y * local_108.y; local_170._12_4_ = fVar29 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x24) + fVar26 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 4) + fVar24 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x14) + fVar30 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x1c); fVar23 = local_108.y + this->_pathFollowSpeed; fVar25 = 1.0 - fVar23; fVar27 = fVar25 * fVar25 * fVar25; fVar28 = fVar25 * 3.0 * fVar23 * fVar23; fVar31 = fVar23 * fVar23 * fVar23; fVar23 = fVar25 * fVar25 * 3.0 * fVar23; local_e0 = fVar31 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x1c) + fVar27 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 4) + fVar23 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x14) + fVar28 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x24); local_f4[0] = (EntityPtr) (fVar27 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18) + fVar23 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x10) + fVar28 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x20) + fVar31 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x18)); local_140.y = local_e0 - (float)local_170._12_4_; local_140.x = (float)local_f4[0] - (fVar29 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x20) + fVar24 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x10) + fVar26 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18) + fVar30 * *(float *)((int)pvVar21 + (int)local_118.y * 0x18 + 0x18)); Vector::Normalized(&local_140,&local_120); bVar10 = 0; local_140.x = (local_120.y * this->_pathOffset + (float)local_f4[0]) - (this->_pos).x; local_140.y = (-local_120.x * this->_pathOffset + local_e0) - (this->_pos).y; pVVar17 = Vector::Resized(&local_140,(Vector *)(local_100 + 8),8.0); Entity::AddVelocity_divided((Entity *)this,pVVar17,bVar10); fVar23 = atan2f(this->_fallingSpeed + (this->_velocity).y,(this->_velocity).x + 0.0); fVar23 = normalize_angle_degrees(fVar23 * 57.295776 - 90.0); (this->_sprite)._rotation = fVar23; local_d9 = 0.0 < fVar23; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_flipX = local_d9; this->_pathSegment = (int)local_118.y; this->_pathProgress = local_108.y; } Room::GetClampedPositionImpl(g_game->_room,&local_140,&this->_pos,-200.0,-200.0,-200.0,-200.0) ; fVar23 = (this->_pos).y - local_140.y; fVar24 = (this->_pos).x - local_140.x; if (1.0 < fVar23 * fVar23 + fVar24 * fVar24) { tearFlagsTmp = BitSet128::operator_and (&local_38,(BitSet128 *)EVar14,(BitSet128 *)&DAT_00c348d0); if (((int)tearFlagsTmp->_l == 0 && *(int *)((int)&tearFlagsTmp->_l + 4) == 0) && ((int)tearFlagsTmp->_h == 0 && *(int *)((int)&tearFlagsTmp->_h + 4) == 0)) { (**(code **)(*(int *)this + 0x28))(); } else { pfVar15 = (float *)Room::ScreenWrapPosition(&local_140,(char)this + '<',0xc3480000); (this->_pos).x = *pfVar15; (this->_pos).y = pfVar15[1]; tearFlagsTmp = BitSet128::__bnot((BitSet128 *)&DAT_00c348d0,&local_38); tearFlagsTmp = BitSet128::operator_and(&local_180,(BitSet128 *)EVar14,tearFlagsTmp); uVar2 = *(undefined4 *)((int)&tearFlagsTmp->_l + 4); pvVar21 = *(void **)&tearFlagsTmp->_h; pvVar5 = *(void **)((int)&tearFlagsTmp->_h + 4); *(int *)EVar14 = (int)tearFlagsTmp->_l; *(undefined4 *)((int)EVar14 + 4) = uVar2; ((std_vector *)((int)EVar14 + 8))->_begin = pvVar21; *(void **)((int)EVar14 + 0xc) = pvVar5; tearFlagsTmp = BitSet128::__bnot((BitSet128 *)&DAT_00c34b60,&local_38); tearFlagsTmp = BitSet128::operator_and(&local_180,(BitSet128 *)EVar14,tearFlagsTmp); uVar2 = *(undefined4 *)((int)&tearFlagsTmp->_l + 4); pvVar21 = *(void **)&tearFlagsTmp->_h; pvVar5 = *(void **)((int)&tearFlagsTmp->_h + 4); EVar20 = this->_parent; *(int *)EVar14 = (int)tearFlagsTmp->_l; *(undefined4 *)((int)EVar14 + 4) = uVar2; ((std_vector *)((int)EVar14 + 8))->_begin = pvVar21; *(void **)((int)EVar14 + 0xc) = pvVar5; tmpEntity = *(Entity **)((int)EVar20 + 0x3bc); uVar12 = Random(); local_140.y = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)] ) * 2.3283064e-10 * 50.0 - 25.0; pVVar17 = Vector::Normalized(&this->_velocity,&local_120); local_100._8_4_ = pVVar17->x; local_f4[0] = (EntityPtr)pVVar17->y; direction_00.y._1_1_ = local_f4[0]._1_1_; direction_00._0_5_ = *(undefined5 *)pVVar17; direction_00.y._2_2_ = local_f4[0]._2_2_; InitHomingPath(this,direction_00,tmpEntity,local_140.y); } } if (300 < g_game->_frameCount - this->_spawnFrame) goto LAB_009652a2; } else if (iVar16 == 3) { local_140.y = *(float *)((int)EVar14 + 0x33c); local_f4[0] = *(EntityPtr *)((int)EVar14 + 0x340); local_108.x = local_140.y - (this->_pos).x; local_120.y = (float)local_f4[0] - (this->_pos).y; local_108.y = local_120.y; local_e8.y = local_108.x; if (900.0 < local_108.x * local_108.x + local_120.y * local_120.y) { pVVar17 = Vector::Resized(&local_108,(Vector *)(local_170 + 8),30.0); fVar23 = pVVar17->y; (this->_pos).x = local_140.y - pVVar17->x; (this->_pos).y = (float)local_f4[0] - fVar23; } fVar23 = atan2f(local_120.y,local_e8.y); fVar23 = normalize_angle_degrees(fVar23 * 57.295776 + 90.0); (this->_sprite)._rotation = fVar23; local_d9 = 0.0 < fVar23; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_flipX = local_d9; this->_friction = this->_friction * 0.7; } else if (iVar16 == 4) { if (this->_isSwinging != 0) { UpdateSwingHits(this,uVar12); EVar14 = this->_parent; if (EVar14 == (EntityPtr)0x0) goto LAB_009652a2; } fVar23 = 0.017453292; local_f4[0] = *(EntityPtr *)((int)EVar14 + 0x33c); local_170._12_4_ = *(EntityPtr *)((int)EVar14 + 0x340); tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34b40) ; bVar10 = BitSet128::IsZero(tearFlagsTmp); if (((bVar10 == 0) && (4 < g_game->_frameCount - this->_spawnFrame)) || (bVar10 = Vector::operator_ne(&this->_targetPosition,&g_vectorZero), bVar10 == 0)) { tearFlagsTmp = BitSet128::operator_and (&local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34b40); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if (bVar10 != 0) { iVar16 = ANM2::GetFrame(&this->_sprite); if (iVar16 < 5) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; } else { local_140.y = this->_displayRotation * 0.017453292; local_f4[0] = (EntityPtr)sin(local_140.y); fVar23 = cos(local_140.y); (this->_velocity).x = fVar23 * 16.0; (this->_velocity).y = (float)local_f4[0] * 16.0; } } } else { pvVar21 = this[1]._damageEvents._begin; local_108.y = this->_rotation * fVar23; EVar14 = (EntityPtr)sin(local_108.y); if (pvVar21 == (void *)0x0) { local_140.y = (float)EVar14; fVar24 = cos(local_108.y); fVar23 = (this->_targetPosition).x; fVar24 = (((float)local_f4[0] + fVar24 * fVar23) - (this->_pos).x) / this->_friction; fVar23 = (((float)local_170._12_4_ + fVar23 * local_140.y) - (this->_pos).y) / this->_friction; } else { local_170._12_4_ = EVar14; fVar24 = cos(local_108.y); fVar23 = (this->_targetPosition).x; fVar24 = (fVar24 * fVar23 + *(float *)((int)pvVar21 + 0x33c)) - (this->_pos).x; fVar23 = ((float)local_170._12_4_ * fVar23 + *(float *)((int)pvVar21 + 0x340)) - (this->_pos).y; } (this->_velocity).x = fVar24; (this->_velocity).y = fVar23; this->_displayRotation = this->_rotation; (this->_sprite)._rotation = this->_rotation - 90.0; pfVar15 = ANM2::GetLayerFrame(&this->_sprite,0); if (pfVar15 != (float *)0x0) { local_140.y = (this->_sprite)._rotation * 0.017453292; local_f4[0] = (EntityPtr)cos(local_140.y); fVar23 = sin(local_140.y); this->_knifeDepthOffset = (float)local_f4[0] * pfVar15[1] + fVar23 * *pfVar15; } } if ((this->_isSwinging == 0) && ((**(code **)(*(int *)this + 0x28))(), this[1]._damageEvents._begin != (void *)0x0)) { std::vector::assign(&this->_hitList); } } } local_d9 = this->_isInterpolating; if ((local_d9 == 0) && (this->_multidimensionalApplied != 0)) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94188) && (_Init_thread_header(&DAT_00c94188), DAT_00c94188 == -1)) { Color::Color(0x3f800000,0,0x3f800000); Color::Color(0x3f28f5c3,0xc3,0x3f28f5c3); Color::Color(0x3ea8f5c3,0xc3,0x3ea8f5c3); Color::Color(0,0,0); Color::Color(0x3ea8f5c3,0xc3,0x3ea8f5c3); Color::Color(0x3f28f5c3,0xc3,0x3f28f5c3); _Init_thread_footer(&DAT_00c94188); } uVar1 = *(undefined8 *)(knife->_color)._offset; color = (ColorMod *) FUN_004072e0((knife->_color)._tint[0],(knife->_color)._tint[1],(knife->_color)._tint[2], (knife->_color)._tint[3],(knife->_color)._colorize[0], (knife->_color)._colorize[1],(knife->_color)._colorize[2], (knife->_color)._colorize[3],(int)uVar1,(char)((ulonglong)uVar1 >> 0x20), (knife->_color)._offset[2]); Sprite::SetColor((Sprite *)&this->_sprite,color); local_d9 = knife->_isInterpolating; this = knife; } tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34b20); if ((((int)tearFlagsTmp->_l != 0 || *(int *)((int)&tearFlagsTmp->_l + 4) != 0) || ((int)tearFlagsTmp->_h != 0 || *(int *)((int)&tearFlagsTmp->_h + 4) != 0)) && (local_d9 == 0)) { if (this->_subtype == 4) { fVar23 = 20.0; } else if (this->_isFlying == 0) { fVar23 = 1.0; } else { fVar23 = (this->_knifeDistance - 0.0) / 100.0; if (fVar23 <= 0.0) { fVar23 = 0.0; } if (1.0 <= fVar23) { fVar23 = 1.0; } fVar23 = fVar23 * 29.0 + 1.0; } Game::AttractEntities(g_game,&this->_pos,(void *)0x0,(void *)0x0,fVar23,250.0); } if ((isSwingWeapon == '\0') && (isSword == '\0')) { LAB_009658dd: bVar10 = 3; LAB_009658e1: bVar10 = Entity::IsFrame((Entity *)this,(uint)bVar10,0); if (bVar10 != 0) { std::vector::clear(&this->_hitList,0); } } else { if (this->_isFlying != 0) { this->_size = *(float *)((int)this->_config + 0x38) * (this->_sprite)._scale.x; } if (isSwingWeapon == '\0') { if (isSword == '\0') goto LAB_009658dd; } else if (this->_variant == 2) { tearFlagsTmp = BitSet128::operator_and (&local_180,&this->_tearFlags,(BitSet128 *)&DAT_00c34b40); if (((int)tearFlagsTmp->_l == 0 && *(int *)((int)&tearFlagsTmp->_l + 4) == 0) && ((int)tearFlagsTmp->_h == 0 && *(int *)((int)&tearFlagsTmp->_h + 4) == 0)) { bVar22 = false; } else { bVar22 = true; } bVar10 = 5; if (bVar22) { bVar10 = 10; } goto LAB_009658e1; } } FUN_00861970(this); if (this->_isInterpolating != 0) { ExceptionList = local_1c; return; } if ((((isSwingWeapon == '\0') && (isSword == '\0')) || (this->_isFlying != 0)) && (this->_visible != 0)) { room = g_game->_room; local_140.y = (float)Room::GetGridIndex(room,&this->_pos); if (-1 < (int)local_140.y) { if ((int)local_140.y < 0x1c0) { EVar14 = *(EntityPtr *)(room->_gridEntities + (int)local_140.y); local_120.y = (float)EVar14; if (((EVar14 != (EntityPtr)0x0) && (*(float *)((int)EVar14 + 0x3c) != 1.4013e-45)) && ((*(float *)((int)EVar14 + 0x3c) != 0.0 && (uVar12 = Random(), (uVar12 & 3) == 0)))) { local_158._seed = (int)(this->_tearFlags)._l; local_158._shift1 = *(uint *)((int)&(this->_tearFlags)._l + 4); local_158._shift2 = *(int *)&(this->_tearFlags)._h; local_158._shift3 = *(int *)((int)&(this->_tearFlags)._h + 4); if (player != (Entity_Player *)0x0) { iVar16 = Entity_Player::GetTearHitParams(local_d8,4,0x3f800000,0,this->_spawnerEntity); local_158._seed = local_158._seed | *(uint *)(iVar16 + 0x38); local_158._shift1 = local_158._shift1 | *(uint *)(iVar16 + 0x3c); local_158._shift2 = local_158._shift2 | *(uint *)(iVar16 + 0x40); local_158._shift3 = local_158._shift3 | *(uint *)(iVar16 + 0x44); } tearFlagsTmp = BitSet128::operator_or (&local_38,(BitSet128 *)&DAT_00c34a30,(BitSet128 *)&DAT_00c34980) ; tearFlagsTmp = BitSet128::operator_and(&local_180,(BitSet128 *)&local_158,tearFlagsTmp); bVar10 = BitSet128::IsNonZero(tearFlagsTmp); if ((bVar10 != 0) && (cVar11 = (**(code **)((int)*(float *)EVar14 + 0x1c))(), cVar11 != '\0')) { pcVar3 = *(code **)((int)*(float *)EVar14 + 0x14); EntityRef::constructor((EntityRef *)(local_6c + 4),(Entity *)this); cVar11 = (*pcVar3)(0,local_6c + 4); if (cVar11 != '\0') { local_140.y = ((this->_sprite)._rotation + 90.0) * 0.017453292; local_100._8_4_ = cos(local_140.y); local_f4[0] = (EntityPtr)sin(local_140.y); Vector::ToCardinal(&local_140,(Vector *)(local_100 + 8)); bVar10 = Vector::operator_ne(this_03,&g_vectorZero); fVar23 = local_120.y; if (bVar10 != 0) { pVVar17 = GridEntity::Position((GridEntity *)local_120.y,&local_e8); local_100._8_4_ = local_140.x * 40.0 + pVVar17->x; local_f4[0] = (EntityPtr)(local_140.y * 40.0 + pVVar17->y); local_120.y = (float)g_game->_room; iVar16 = Room::GetGridIndex((Room *)local_120.y,(Vector *)(local_100 + 8)); if (-1 < iVar16) { if (iVar16 < 0x1c0) { Room::TryMakeBridge((Room *)local_120.y, *(GridEntity **)((int)local_120.y + 0x24 + iVar16 * 4), (GridEntity *)fVar23); } else { Room::TryMakeBridge((Room *)local_120.y,(GridEntity *)0x0,(GridEntity *)fVar23); } } } goto LAB_00965b8b; } } } } room = g_game->_room; EntityRef::constructor((EntityRef *)(local_1ac + 4),(Entity *)this); Room::DamageGridWithSource(room,(int)local_140.y,1,(EntityRef *)(local_1ac + 4)); } } LAB_00965b8b: Entity::Update((Entity *)this); ExceptionList = local_1c; return; } //@@ 00965d30 Entity_Knife::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 5] prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Entity_Knife::Render(Entity_Knife *this,Vector *offset) { Entity_Player *player; int iVar1; Entity *rootParent; Vector *position; AnimationState *secondAnimState; int deadEyeLevel; float extraout_EDX; float *pfVar2; float savedColorizeR; float savedColorizeG; float savedColorizeB; float savedColorizeA; float savedTintR; float savedTintG; float savedTintB; float savedTintA; Vector savedColorOffset; float fVar3; float savedRotation; double dVar4; float local_e8; float local_e4; float *local_e0; float local_dc; float local_d8; float local_d4; EntityPtr local_d0; float rotationOffset; float trailDistanceBase; int trailIndex; Vector trailRenderPos; Vector local_b8; float local_b0; float fStack_ac; float fStack_a8; float fStack_a4; float local_a0; float fStack_9c; float fStack_98; float fStack_94; float local_90; float fStack_8c; float fStack_88; float fStack_84; float local_64; float fStack_60; float fStack_5c; float fStack_58; ColorMod deadEyeColor; uint local_c; Sprite *deadEyeSprite; ColorMod *spriteColor; local_c = __security_cookie ^ (uint)&local_e8; if (this->_visible != 0) { player = GetPlayer(this); if ((player == (Entity_Player *)0x0) || (*(int *)&g_game->_stageTransition == 0)) { fVar3 = 0.5; if ((((DAT_00c34b60 & (uint)(this->_tearFlags)._l) != 0 || (DAT_00c34b64 & *(uint *)((int)&(this->_tearFlags)._l + 4)) != 0) || (((uint)(this->_tearFlags)._h & DAT_00c34b68) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b6c) != 0)) && ((this->_isFlying != 0 && (this->_subtype == 0)))) { savedTintR = (this->_sprite)._color._tint[0]; savedTintG = (this->_sprite)._color._tint[1]; savedTintB = (this->_sprite)._color._tint[2]; savedTintA = (this->_sprite)._color._tint[3]; local_e0 = (float *)(this->_sprite)._color._offset[2]; spriteColor = &(this->_sprite)._color; savedColorizeR = (this->_sprite)._color._colorize[0]; savedColorizeG = (this->_sprite)._color._colorize[1]; savedColorizeB = (this->_sprite)._color._colorize[2]; savedColorizeA = (this->_sprite)._color._colorize[3]; savedColorOffset.x = (this->_sprite)._color._offset[0]; savedColorOffset.y = (this->_sprite)._color._offset[1]; savedRotation = (this->_sprite)._rotation; local_e4 = savedRotation; local_b8 = savedColorOffset; local_b0 = savedTintR; fStack_ac = savedTintG; fStack_a8 = savedTintB; fStack_a4 = savedTintA; local_a0 = savedColorizeR; fStack_9c = savedColorizeG; fStack_98 = savedColorizeB; fStack_94 = savedColorizeA; local_64 = savedTintR; fStack_60 = savedTintG; fStack_5c = savedTintB; fStack_58 = savedTintA; iVar1 = GetBaseVariant(this); if (iVar1 == 1) { trailDistanceBase = 4.0; } else { trailDistanceBase = 30.0; } rootParent = GetRootParent(this); local_d0 = rootParent->_parent; pfVar2 = (float *)extraout_EDX; if (local_d0 != (EntityPtr)0x0) { trailIndex = 1; do { fStack_84 = (0.6 - (float)trailIndex * 0.3) * fStack_58; fVar3 = this->_rotationOffset; local_d4 = ABS(fVar3); local_d8 = this->_knifeDistance - (float)(trailIndex + 1) * this->_knifeVelocity * 0.2; rotationOffset = fVar3; local_90 = savedTintR; fStack_8c = savedTintG; fStack_88 = savedTintB; if (360.0 < local_d4) { fVar3 = fmodf(fVar3,360.0); } if (fVar3 <= 180.0) { if (fVar3 < -180.0) { fVar3 = fVar3 + 360.0; } } else { fVar3 = fVar3 - 360.0; } local_dc = ((local_d8 * 3.1415927 + local_d8 * 3.1415927) * (fVar3 * 0.002 + 1.0) + this->_displayRotation) * 0.017453292; local_e8 = cos(local_dc); local_dc = sin(local_dc); fVar3 = rotationOffset; if (360.0 < local_d4) { fVar3 = fmodf(rotationOffset,360.0); } if (fVar3 <= 180.0) { if (fVar3 < -180.0) { fVar3 = fVar3 + 360.0; } } else { fVar3 = fVar3 - 360.0; } fVar3 = (1.0 - fVar3 * 0.02) * local_d8 * 0.25 + trailDistanceBase; local_d4 = fVar3 * local_dc + (this->_anchorPosition).y; local_e8 = fVar3 * local_e8 + (this->_anchorPosition).x; fVar3 = atan2f(local_d4 - *(float *)((int)local_d0 + 0x340), local_e8 - *(float *)((int)local_d0 + 0x33c)); if (spriteColor != (ColorMod *)&local_90) { spriteColor->_tint[0] = local_90; (this->_sprite)._color._tint[1] = fStack_8c; (this->_sprite)._color._tint[2] = fStack_88; (this->_sprite)._color._tint[3] = fStack_84; (this->_sprite)._color._colorize[0] = local_a0; (this->_sprite)._color._colorize[1] = fStack_9c; (this->_sprite)._color._colorize[2] = fStack_98; (this->_sprite)._color._colorize[3] = fStack_94; (this->_sprite)._color._offset[0] = local_b8.x; (this->_sprite)._color._offset[1] = local_b8.y; (this->_sprite)._color._offset[2] = (float)local_e0; } local_d8 = g_displayPixelRatio; (this->_sprite)._rotation = fVar3 * 57.295776; local_d8 = local_d8 * g_screenPointScale; local_e8 = (((local_e8 + (this->_posOffset).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_d8 + 0.5; dVar4 = floor((double)local_e8); local_dc = (float)dVar4 / local_d8; local_e8 = (((local_d4 + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_d8 + 0.5; dVar4 = floor((double)local_e8); local_e8 = (float)dVar4; trailRenderPos.x = local_dc + offset->x; trailRenderPos.y = local_e8 / local_d8 + offset->y; if ((this->_sprite)._loaded != 0) { if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_sprite)._animState,&trailRenderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&trailRenderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_sprite)._animState; } AnimationState::Render(secondAnimState,&trailRenderPos,&g_vectorZero,&g_vectorZero); } trailIndex = trailIndex + -1; savedTintR = local_b0; savedTintG = fStack_ac; savedTintB = fStack_a8; } while (-1 < trailIndex); fVar3 = 0.5; pfVar2 = local_e0; savedRotation = local_e4; savedColorOffset = local_b8; savedTintA = fStack_a4; savedColorizeR = local_a0; savedColorizeG = fStack_9c; savedColorizeB = fStack_98; savedColorizeA = fStack_94; } if (spriteColor != (ColorMod *)&local_64) { (this->_sprite)._color._offset[0] = savedColorOffset.x; (this->_sprite)._color._offset[1] = savedColorOffset.y; spriteColor->_tint[0] = savedTintR; (this->_sprite)._color._tint[1] = savedTintG; (this->_sprite)._color._tint[2] = savedTintB; (this->_sprite)._color._tint[3] = savedTintA; (this->_sprite)._color._offset[2] = (float)pfVar2; (this->_sprite)._color._colorize[0] = savedColorizeR; (this->_sprite)._color._colorize[1] = savedColorizeG; (this->_sprite)._color._colorize[2] = savedColorizeB; (this->_sprite)._color._colorize[3] = savedColorizeA; } (this->_sprite)._rotation = savedRotation; } local_e0 = (float *)(g_displayPixelRatio * g_screenPointScale); local_e4 = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * fVar3) * (float)local_e0 + fVar3; dVar4 = floor((double)local_e4); local_d0 = (EntityPtr)((float)dVar4 / (float)local_e0); local_e4 = ((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_e0 + 0.5; dVar4 = floor((double)local_e4); local_e4 = (float)dVar4; fVar3 = offset->y; (this->_renderPosition).x = (float)local_d0 + offset->x; (this->_renderPosition).y = local_e4 / (float)local_e0 + fVar3; ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); iVar1 = GetBaseVariant(this); if ((iVar1 == 1) && (this->_subtype != 4)) { player = GetPlayer(this); if ((player != (Entity_Player *)0x0) && (iVar1 = player->_deadEyeCharges, 0 < iVar1)) { local_e0 = ANM2::GetLayerFrame(&this->_sprite,0); deadEyeSprite = DAT_00c72214; deadEyeColor._tint[0] = 1.0; deadEyeColor._tint[1] = 1.0; deadEyeLevel = 8; if (iVar1 < 8) { deadEyeLevel = iVar1; } deadEyeColor._tint[2] = 1.0; deadEyeColor._colorize[0] = 0.0; deadEyeColor._colorize[1] = 0.0; deadEyeColor._colorize[2] = 0.0; deadEyeColor._colorize[3] = 0.0; deadEyeColor._offset[0] = 0.0; deadEyeColor._offset[1] = 0.0; deadEyeColor._offset[2] = 0.0; deadEyeColor._tint[3] = (float)deadEyeLevel * 0.125; Sprite::SetColor(DAT_00c72214,&deadEyeColor); if ((this->_isFlying == 0) && (local_e0 != (float *)0x0)) { local_e4 = (this->_sprite)._rotation * 0.017453292; local_d0 = (EntityPtr)cos(local_e4); local_d4 = sin(local_e4); local_dc = (this->_sprite)._scale.x; local_e8 = local_e0[1]; local_e4 = *local_e0; local_e0 = (float *)(this->_sprite)._scale.y; fVar3 = atan2f(local_e8,local_e4); position = &local_b8; deadEyeSprite->_rotation = fVar3 * 57.295776 + (this->_sprite)._rotation; fVar3 = (this->_sprite)._scale.y; (deadEyeSprite->_scale).x = (this->_sprite)._scale.x * 0.9; (deadEyeSprite->_scale).y = fVar3 * 0.5; local_b8.y = (local_e8 * (float)local_d0 + local_e4 * local_d4) * (float)local_e0 * 0.5 + (this->_renderPosition).y; local_b8.x = (local_e4 * (float)local_d0 - local_e8 * local_d4) * local_dc * 0.5 + (this->_renderPosition).x; } else { deadEyeSprite->_rotation = 0.0; (deadEyeSprite->_scale).x = (this->_sprite)._scale.x; (deadEyeSprite->_scale).y = (this->_sprite)._scale.y; position = &this->_renderPosition; } ANM2::Render((ANM2 *)deadEyeSprite,position,&g_vectorZero,&g_vectorZero); } } FUN_00861a50(this,offset); } } return; } //@@ 009665e0 Entity_Knife::GetRenderZ /* ZHL [vtable slot 13] */ void __thiscall Entity_Knife::GetRenderZ(Entity_Knife *this) { floor((double)((this->_knifeDepthOffset + (this->_pos).y) * 100.0 + 10030.0 + 0.5)); __ftoui3(); return; } //@@ 00966650 Entity_Knife::GetPlayer /* ZHL [exact] __thiscall Entity_Player* Entity_Knife::GetPlayer(); prototype: REPENTOGON, confirmed by RET 0 */ Entity_Player * __thiscall Entity_Knife::GetPlayer(Entity_Knife *this) { int iVar1; EntityPtr EVar2; EVar2 = this->_parent; if ((EVar2 != (EntityPtr)0x0) && ((*(int *)((int)EVar2 + 0x28) != 8 || (EVar2 = *(EntityPtr *)((int)EVar2 + 0x3bc), EVar2 != (EntityPtr)0x0)))) { iVar1 = *(int *)((int)EVar2 + 0x28); if (iVar1 == 1) { return (Entity_Player *)EVar2; } if (iVar1 == 3) { return *(Entity_Player **)((int)EVar2 + 0x410); } if (iVar1 == 1000) { EVar2 = *(EntityPtr *)((int)EVar2 + 0x3bc); if ((EVar2 != (EntityPtr)0x0) && (*(int *)((int)EVar2 + 0x28) == 1)) { return (Entity_Player *)EVar2; } } else if (((iVar1 == 2) && (EVar2 = *(EntityPtr *)((int)EVar2 + 0x3c8), EVar2 != (EntityPtr)0x0)) && (*(int *)((int)EVar2 + 0x28) == 1)) { return (Entity_Player *)EVar2; } } return (Entity_Player *)0x0; } //@@ 009666c0 Entity_Knife::GetRootParent /* DB: walks +0x3bc while type 8 prototype: db/protos.zhl */ Entity * __thiscall Entity_Knife::GetRootParent(Entity_Knife *this) { EntityPtr EVar1; EntityPtr EVar2; EVar2 = this->_parent; while ((EVar1 = EVar2, EVar1 != (EntityPtr)0x0 && (*(int *)((int)EVar1 + 0x28) == 8))) { this = (Entity_Knife *)EVar1; EVar2 = *(EntityPtr *)((int)EVar1 + 0x3bc); } return (Entity *)this; } //@@ 009666f0 Entity_Knife::HandleCollision /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool Entity_Knife::HandleCollision(Entity* collider, bool low); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall Entity_Knife::HandleCollision(Entity_Knife *this,Entity *collider,byte low) { float fVar1; BitSet128 tearFlags; BitSet128 flags; byte bVar2; int iVar3; EntityList *hitList; void *hitListVec; uint uVar4; int iVar5; uint uVar6; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int iVar7; int extraout_EDX; int extraout_EDX_00; int extraout_EDX_01; float fVar8; float fVar9; float fVar10; undefined3 in_stack_00000009; float fStack_e8; undefined1 auStack_e4 [8]; uint uStack_dc; uint uStack_d8; EntityPtr EStack_d0; undefined8 uStack_cc; Entity *local_c4; int iStack_c0; int iStack_bc; int iStack_b8; float fStack_b4; float fStack_b0; float fStack_ac; float fStack_a8; uint uStack_a4; Entity_Knife *pEStack_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined1 tearHitParams [56]; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; float fStack_44; uint local_14; local_14 = __security_cookie ^ (uint)&fStack_e8; local_c4 = collider; iVar3 = LuaEngine::PreKnifeCollision((LuaEngine *)this,this,collider,_low); if (iVar3 == 1) { return 1; } if (iVar3 == -1) { return 0; } fStack_e8 = (float)GetBaseVariant(this); iVar3 = GetBaseVariant(this); if (iVar3 == 10) { return 1; } if ((extraout_EDX == 1) && (this->_isFlying == 0)) { return 1; } if (this->_visible == 0) { return 1; } bVar2 = Entity::IsEnemy(collider); if ((bVar2 != 0) && (bVar2 = Entity::HasEntityFlags(collider,0x20000000), bVar2 != 0)) { return 1; } if (((collider->_type == 4) && (this->_isFlying != 0)) && (0.0 < this->_knifeVelocity)) { fVar8 = (float)this[1]._variant * 0.017453292; fVar10 = this->_knifeVelocity * 0.6; uStack_cc = CONCAT44(uStack_cc._4_4_,fVar8); fVar8 = cos(fVar8); auStack_e4._0_4_ = fVar8 * fVar10 - (collider->_velocity).x * 0.8; fVar9 = sin((float)uStack_cc); fVar8 = collider->_friction; if (fVar8 != 0.0) { fVar1 = collider->_speedMultiplier; (collider->_velocity).x = ((float)auStack_e4._0_4_ * fVar1) / fVar8 + (collider->_velocity).x; (collider->_velocity).y = ((fVar9 * fVar10 - (collider->_velocity).y * 0.8) * fVar1) / fVar8 + (collider->_velocity).y; } } bVar2 = Entity::IsVulnerableEnemy(collider,(Entity *)0x0); if (((bVar2 != 0) && (bVar2 = Entity::IsDescendantOf((Entity *)this,collider), bVar2 == 0)) || ((iVar3 = collider->_type, iVar3 == 0x21 || ((iVar3 == 0x124 || (iVar3 == 0xf5)))))) { hitList = GetHitEntities(this); iVar3 = 0x9668d2; bVar2 = EntityList::HitListContains(hitList,collider); if (bVar2 == 0) { auStack_e4._0_4_ = (uint)(this->_tearFlags)._l & (uint)g_tearFlagLudovico._l; auStack_e4._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagLudovico._l._4_4_; uStack_dc = (uint)(this->_tearFlags)._h & (uint)g_tearFlagLudovico._h; uStack_d8 = *(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagLudovico._h._4_4_; bVar2 = BitSet128::IsNonZero((BitSet128 *)auStack_e4); if (bVar2 != 0) { iVar3 = 5; bVar2 = Entity::IsFrame((Entity *)this,5,this->_index); if (bVar2 == 0) { return 1; } } if ((this->_subtype == 3) && (collider->_type == 0x124)) { return 1; } if ((fStack_e8 != 1.4013e-45) || (((iVar7 = collider->_type, iVar7 != 0x21 && (iVar7 != 0x124)) && (iVar7 != 0xf5)))) { hitListVec = GetHitEntities(this); uVar4 = Entity::GetHitListIndex((Entity *)EStack_d0); iVar3 = 0x966985; sorted_vector_insert_unique(hitListVec,uVar4); collider = (Entity *)EStack_d0; } auStack_e4._0_4_ = GetPlayer(this); uStack_9c = (undefined4)(this->_tearFlags)._l; uStack_98 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); uStack_94 = (undefined4)(this->_tearFlags)._h; uStack_90 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); EStack_d0 = this->_spawnerEntity; fVar8 = this->_collisionDamage; uStack_cc = 0; iVar7 = extraout_ECX; if (fStack_e8 == 1.4013e-45) { if (this->_variant == 2) { fVar9 = (this->_charge * this->_knifeVelocity - 0.0) / 3.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } fVar9 = (fVar9 * 0.4 + 0.4) * fVar8; } else { fVar9 = fVar8 * 1.5; if (fVar8 * 1.5 <= fVar8 + 1.75) { fVar9 = fVar8 + 1.75; } } if (EStack_d0 != (EntityPtr)0x0) { auStack_e4._0_4_ = (uint)(this->_tearFlags)._l & DAT_00c34b30; auStack_e4._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b34; uStack_dc = (uint)(this->_tearFlags)._h & DAT_00c34b38; uStack_d8 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b3c; bVar2 = BitSet128::IsNonZero((BitSet128 *)auStack_e4); if (bVar2 != 0) { fVar8 = (this->_pos).y - *(float *)(extraout_EDX_00 + 0x340); fVar10 = (this->_pos).x - *(float *)(extraout_EDX_00 + 0x33c); fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); if (1800.0 <= fVar8) { fVar8 = 1800.0; } fVar9 = ((fVar8 * 4.0) / 1800.0 + 1.0) * fVar9; } auStack_e4._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34c44; auStack_e4._0_4_ = (uint)(this->_tearFlags)._l & DAT_00c34c40; uStack_d8 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34c4c; uStack_dc = (uint)(this->_tearFlags)._h & DAT_00c34c48; bVar2 = BitSet128::IsNonZero((BitSet128 *)auStack_e4); iVar7 = extraout_ECX_01; if (bVar2 != 0) { fVar8 = (this->_pos).x - *(float *)(extraout_EDX_01 + 0x33c); fVar10 = (this->_pos).y - *(float *)(extraout_EDX_01 + 0x340); fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10); if (200.0 <= fVar8) { fVar8 = 200.0; } fVar10 = 1.0 - fVar8 / 200.0; fVar8 = 0.1; if (0.1 <= fVar10) { fVar8 = fVar10; } fVar9 = fVar8 * fVar9; iVar7 = extraout_ECX_02; } } } else { if ((Entity_Player *)auStack_e4._0_4_ != (Entity_Player *)0x0) { uVar4 = Random(); iVar3 = (uVar4 & 1) * 2 + -1; Entity_Player::GetTearHitParams(tearHitParams,4,0x3f800000,iVar3,EStack_d0); fStack_e8 = fStack_44; iVar5 = Isaac::Random((uint)(this->_isFlying == 0) * 4 + 2); iVar7 = extraout_ECX_00; fVar8 = fStack_e8; if (iVar5 == 0) { uStack_9c = uStack_54; uStack_98 = uStack_50; uStack_94 = uStack_4c; uStack_90 = uStack_48; } } fVar9 = (this->_charge * this->_knifeVelocity - 0.0) / 3.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } fVar9 = (fVar9 * 4.0 + 2.0) * fVar8; } tearFlags._l._4_4_ = uStack_98; tearFlags._l._0_4_ = uStack_9c; tearFlags._h._0_4_ = uStack_94; tearFlags._h._4_4_ = uStack_90; get_tear_flags_from_player(&uStack_cc,iVar7,tearFlags,iVar3,(Entity *)this); fStack_b4 = (this->_pos).x; fStack_b0 = (this->_pos).y; auStack_e4._0_4_ = *(undefined4 *)(*(int *)collider + 0x20); local_c4 = (Entity *)this->_type; iStack_c0 = this->_variant; iStack_bc = this->_spawnerType; iStack_b8 = this->_spawnerVariant; fStack_ac = (this->_velocity).x; fStack_a8 = (this->_velocity).y; fStack_e8 = (float)(uint)((this->_flags & 0x100) != 0); if ((this->_flags & 0x20000000) == 0) { uVar4 = 0; } else { uVar4 = 2; } if ((this->_flags & 0x40000000000000) == 0) { uVar6 = 0; } else { uVar6 = 4; } uStack_a4 = uVar6 | uVar4 | (uint)fStack_e8; pEStack_a0 = this; (*(code *)auStack_e4._0_4_)(fVar9,(float)uStack_cc,uStack_cc._4_4_,&local_c4,0x1e); if (collider->_type == 0x21) { return 1; } flags._l._4_4_ = uStack_98; flags._l._0_4_ = uStack_9c; flags._h._0_4_ = uStack_94; flags._h._4_4_ = uStack_90; Entity_Tear::ApplyTearFlagEffects(collider,&this->_pos,flags,(Entity *)this,fVar9); auStack_e4._0_4_ = (collider->_pos).x; auStack_e4._4_4_ = (collider->_pos).y; apply_hit_effects(this,&this->_pos,collider,(Vector *)auStack_e4,collider->_size,fVar9,0, this->_isFlying); return 1; } } if (collider->_type != 9) { return 1; } if ((collider[1]._variant & 0x80000000U) != 0) { return 1; } auStack_e4._0_4_ = (uint)(this->_tearFlags)._l & DAT_00c34c60; auStack_e4._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34c64; uStack_dc = (uint)(this->_tearFlags)._h & DAT_00c34c68; uStack_d8 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34c6c; bVar2 = BitSet128::IsNonZero((BitSet128 *)auStack_e4); if (bVar2 == 0) { return 1; } uVar4 = Random(); if (uVar4 % 5 == 0) { auStack_e4._0_4_ = (uint)(this->_tearFlags)._l & (uint)g_tearFlagLudovico._l; auStack_e4._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagLudovico._l._4_4_; uStack_dc = (uint)(this->_tearFlags)._h & (uint)g_tearFlagLudovico._h; uStack_d8 = *(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagLudovico._h._4_4_; bVar2 = BitSet128::IsZero((BitSet128 *)auStack_e4); if (bVar2 != 0) goto LAB_00966eba; } uVar4 = Random(); if (uVar4 % 0x14 != 0) { return 1; } LAB_00966eba: collider[1]._variant = 0; collider[1]._subtype = 0; collider->_dead = 1; return 1; } //@@ 00966ef0 Entity_Knife::Shoot /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [lua] Lua binding EntityKnife:Shoot prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Knife::Shoot(Entity_Knife *this,float charge,float range) { byte bVar1; byte *curAnimChar; uint uVar2; uint startFrame; void *curAnimData; byte *wantAnimChar; bool bVar3; double launchSpeed; float gravity; float savedGravity; byte *animData; int variant; gravity = -2.0; savedGravity = -2.0; this->_maxDistance = charge * range; uVar2 = (uint)(this->_tearFlags)._h; if ((((uint)(this->_tearFlags)._l & DAT_00c34b60) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b64) != 0) || ((uVar2 & DAT_00c34b68) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b6c) != 0)) { gravity = (float)&DAT_bf800000; savedGravity = (float)&DAT_bf800000; } variant = this->_variant; switch(variant) { case 2: case 3: case 4: case 8: case 9: switchD_00966f89_caseD_2: gravity = gravity * 0.75; savedGravity = gravity; break; case 5: case 0xb: break; default: if (variant == 1) goto switchD_00966f89_caseD_2; } if ((((uint)(this->_tearFlags)._l & _DAT_00c345e0) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c345e4) != 0) || ((uVar2 & _DAT_00c345e8) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & _DAT_00c345ec) != 0)) { gravity = gravity * 0.75; this->_height = 0.0; this->_fallingSpeed = -10.0; savedGravity = gravity; } launchSpeed = (double)ABS((charge * range) / (gravity * -0.5)); if (launchSpeed < 0.0) { libm_sse2_sqrt_precise(); } else { launchSpeed = SQRT(launchSpeed); } this->_knifeDistance = 0.0; this->_isFlying = 1; this->_knifeVelocity = (float)launchSpeed * -savedGravity; this->_charge = charge; switch(variant) { case 2: case 3: case 4: case 8: case 9: break; case 5: case 0xb: goto switchD_00967064_caseD_5; default: if (this->_variant != 1) goto switchD_00967064_caseD_5; } (this->_sprite)._rotation = 0.0; this->_knifeDepthOffset = 0.0; (this->_hitList)._end = (this->_hitList)._begin; animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_009670ee: bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b602e8,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } wantAnimChar = &DAT_00b602e8; do { bVar1 = *curAnimChar; bVar3 = bVar1 < *wantAnimChar; if (bVar1 != *wantAnimChar) { LAB_009670d0: uVar2 = -(uint)bVar3 | 1; goto LAB_009670d5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; bVar3 = bVar1 < wantAnimChar[1]; if (bVar1 != wantAnimChar[1]) goto LAB_009670d0; curAnimChar = curAnimChar + 2; wantAnimChar = wantAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009670d5: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_009670ee; } curAnimData = (this->_sprite)._animState._animData; if ((curAnimData == (void *)0x0) || (uVar2 = *(uint *)((int)curAnimData + 0x30), uVar2 == 0)) { startFrame = 0; } else { startFrame = Random(); startFrame = startFrame % uVar2; curAnimData = (this->_sprite)._animState._animData; } if (curAnimData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)startFrame); } switchD_00967064_caseD_5: UpdateHomingPath(this); return; } //@@ 00967180 Entity_Knife::UpdateHomingPath /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? knife homing path, InitHomingPath, spawns */ void __thiscall Entity_Knife::UpdateHomingPath(Entity_Knife *this) { double dVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int iVar5; int iVar6; Vector direction; byte bVar7; Entity_Player *player; int iVar8; uint rngResult; uint seed; Entity *spawned; Entity_Knife *spawnedKnife; int *laser; char extraout_DL; int unaff_EDI; float fVar9; float fVar10; EntityPtr EVar11; undefined1 auVar12 [12]; float fVar13; undefined1 auStack_5e [2]; EntityPtr local_5c; int knifeCount; Vector spawnPos; ColorMod laserColor; *(undefined4 *)&(this->_usedTearFlags)._l = 0; *(undefined4 *)((int)&(this->_usedTearFlags)._l + 4) = 0; *(undefined4 *)&(this->_usedTearFlags)._h = 0; *(undefined4 *)((int)&(this->_usedTearFlags)._h + 4) = 0; player = GetPlayer(this); if (player != (Entity_Player *)0x0) { iVar8 = GetBaseVariant(this); if ((((iVar8 != 1) && (iVar8 = GetBaseVariant(this), iVar8 != 10)) && (extraout_DL != '\0')) && ((bVar7 = Entity_Player::HasCollectible(player,0xe5,0), bVar7 != 0 && (0.25 < this->_charge)) )) { rngResult = Random(); knifeCount = (int)(((float)(rngResult % 3 + 3) + 0.0) * this->_charge); local_5c = (EntityPtr)this; if (0 < knifeCount) { do { rngResult = Random(); dVar1 = __uint_to_double_fixup[-((int)rngResult >> 0x1f)]; seed = Random(); iVar8 = *(int *)((int)this + 0x3bc); fVar13 = *(float *)(iVar8 + 0x340); fVar9 = ((float)((double)(int)rngResult + dVar1) * 2.3283064e-10 * 360.0 - 180.0) * 0.017453292; fVar10 = cos(fVar9); spawnPos.x = fVar10 * 30.0 + *(float *)(iVar8 + 0x33c); fVar9 = sin(fVar9); spawnPos.y = fVar9 * 30.0 + fVar13; spawned = Game::SpawnEx(g_game,8,0,&spawnPos,&g_vectorZero,(Entity *)player,1,seed,0); spawnedKnife = (Entity_Knife *)__RTDynamicCast(spawned,0); iVar8 = *(int *)spawnedKnife; (spawnedKnife->_posOffset).x = 0.0; (spawnedKnife->_posOffset).y = -10.0; (**(code **)(iVar8 + 0x40))(); fVar13 = 1.4013e-45; (**(code **)(*(int *)spawnedKnife + 0x3c))((int)local_5c + 0xf0,0xffffffff,0xff); HomingLaser::operator_assign (&spawnedKnife->_homingLaser,(HomingLaser *)((int)local_5c + 0x468)); if (spawnedKnife->_parent != (EntityPtr)0x0) { std::multiset::erase(auStack_5e + -0xe); } spawnedKnife->_parent = local_5c; std::multiset::insert(&spawnedKnife->_parent); uVar2 = *(undefined4 *)((int)local_5c + 0x414); uVar3 = *(undefined4 *)((int)local_5c + 0x418); uVar4 = *(undefined4 *)((int)local_5c + 0x41c); *(undefined4 *)&(spawnedKnife->_tearFlags)._l = *(undefined4 *)((int)local_5c + 0x410); *(undefined4 *)((int)&(spawnedKnife->_tearFlags)._l + 4) = uVar2; *(undefined4 *)&(spawnedKnife->_tearFlags)._h = uVar3; *(undefined4 *)((int)&(spawnedKnife->_tearFlags)._h + 4) = uVar4; fVar9 = cos(fVar13); EVar11 = (EntityPtr)sin(fVar13); direction.y = (float)EVar11; direction.x = fVar9; InitHomingPath(spawnedKnife,direction,(Entity *)local_5c,0.0); spawnedKnife->_pathFollowSpeed = 0.05; (**(code **)(*(int *)spawnedKnife + 0xc))(); knifeCount = knifeCount + -1; this = (Entity_Knife *)local_5c; local_5c = EVar11; } while (knifeCount != 0); } } bVar7 = Entity_Player::HasCollectible(player,0x18b,0); if (bVar7 != 0) { if (*(int **)((int)this + 0x4fc) != (int *)0x0) { (**(code **)(**(int **)((int)this + 0x4fc) + 0x28))(); } rngResult = Random(); spawned = Game::SpawnEx(g_game,7,2,(Vector *)((int)this + 0x33c),&g_vectorZero, (Entity *)player,3,rngResult,0); laser = (int *)__RTDynamicCast(spawned,0); laserColor._tint[0] = (player->_laserColor)._tint[0]; laserColor._tint[1] = (player->_laserColor)._tint[1]; laserColor._tint[2] = (player->_laserColor)._tint[2]; laserColor._tint[3] = (player->_laserColor)._tint[3]; laserColor._colorize[0] = (player->_laserColor)._colorize[0]; laserColor._colorize[1] = (player->_laserColor)._colorize[1]; laserColor._colorize[2] = (player->_laserColor)._colorize[2]; laserColor._colorize[3] = (player->_laserColor)._colorize[3]; laserColor._offset._0_8_ = *(undefined8 *)(player->_laserColor)._offset; laserColor._offset[2] = (player->_laserColor)._offset[2]; (**(code **)(*laser + 0x3c))(&laserColor,0xffffffff); laser[0xd3] = *(int *)((int)this + 0x34c); laser[0xd4] = *(int *)((int)this + 0x350); if (laser[0xef] != 0) { std::multiset::erase(auStack_5e + -0x12); } *(EntityPtr *)(laser + 0xef) = (EntityPtr)this; std::multiset::insert((EntityPtr *)(laser + 0xef)); laser[0xd6] = 0x453b8000; iVar8 = *(int *)((int)this + 0x414); iVar5 = *(int *)((int)this + 0x418); iVar6 = *(int *)((int)this + 0x41c); laser[0x10a] = *(int *)((int)this + 0x410); laser[0x10b] = iVar8; laser[0x10c] = iVar5; laser[0x10d] = iVar6; auVar12 = ZEXT812(0x3ea8f5c3); if (auVar12._0_4_ < *(float *)((int)this + 0x460)) { auVar12._4_8_ = auVar12._4_8_; auVar12._0_4_ = *(float *)((int)this + 0x460); } (**(code **)(*laser + 0x40))(auVar12._0_4_ * *(float *)((int)this + 0x388)); laser[0x116] = 600; fVar13 = *(float *)((int)this + 0x460); if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } laser[0x12f] = (int)(fVar13 * 60.0 + 20.0); if (laser[0xf2] != 0) { std::multiset::erase(auStack_5e + -0x16); } laser[0xf2] = unaff_EDI; std::multiset::insert(laser + 0xf2); (**(code **)(*laser + 0xc))(); if (*(int *)((int)this + 0x4fc) != 0) { std::multiset::erase(); } *(int *)((int)this + 0x4fc) = (int)laser; std::multiset::insert(); } } return; } //@@ 00967650 Entity_Knife::update_target /* DB: ? called from Entity_Knife::Update; scans room entity list for Entity::IsVulnerableEnemy not IsDescendantOf parent (+0x3c8) within range, atan2f, stores +0x3c4 */ void __thiscall Entity_Knife::update_target(Entity_Knife *this,float *param_2) { byte bVar1; EntityPtr targetEntity; uint entityIndex; bool bVar2; float fVar3; float fVar4; float fVar5; EntityPtr *pEVar6; float fVar7; EntityPtr *local_24; float local_20; float local_1c; EntityPtr local_18; char isVulnerable; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0c94d; local_10 = ExceptionList; ExceptionList = &local_10; targetEntity = this->_target; local_1c = 22500.0; bVar2 = false; if (targetEntity == (EntityPtr)0x0) { local_24 = *(EntityPtr **)((int)g_game->_room + 0x125c); local_20 = *(float *)((int)g_game->_room + 0x1264); entityIndex = 0; local_8 = 0; local_18 = (EntityPtr)0x0; if (local_20 != 0.0) { do { targetEntity = local_24[entityIndex]; bVar1 = Entity::IsVulnerableEnemy((Entity *)targetEntity,(Entity *)this); if ((bVar1 == 0) || (isVulnerable = '\x01', (*(uint *)((int)targetEntity + 0x168) & 0x20000010) != 0)) { isVulnerable = '\0'; } if ((((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)targetEntity + 0x28) != 3) ) || (*(int *)((int)targetEntity + 0x2c) != 0x43)) || (bVar1 = Entity::IsDescendantOf((Entity *)targetEntity,(Entity *)this->_spawnerEntity), bVar1 != 0)) { bVar2 = false; } else { bVar2 = true; } if (((isVulnerable != '\0') || (bVar2)) && ((fVar3 = (this->_pos).x - ((Vector *)((int)targetEntity + 0x33c))->x, fVar5 = (this->_pos).y - *(float *)((int)targetEntity + 0x340), fVar3 = fVar5 * fVar5 + fVar3 * fVar3, *(float *)((int)targetEntity + 0x14) < *(float *)((int)targetEntity + 0x380) && (fVar3 < local_1c)))) { local_1c = fVar3; local_18 = targetEntity; } entityIndex = entityIndex + 1; } while (entityIndex < (uint)local_20); if (this->_target != (EntityPtr)0x0) { local_24 = &this->_target; std::multiset::erase(&local_24); } } pEVar6 = &this->_target; *pEVar6 = local_18; bVar2 = local_18 == (EntityPtr)0x0; targetEntity = (EntityPtr)0x0; if (!bVar2) { std::multiset::insert(pEVar6); targetEntity = *pEVar6; bVar2 = targetEntity == (EntityPtr)0x0; } } if (!bVar2) { fVar3 = (this->_targetPosition).x; if ((fVar3 == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) { fVar4 = this->_knifeDistance / this->_maxDistance; fVar3 = (this->_pos).y; fVar5 = *(float *)((int)targetEntity + 0x33c); if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } fVar7 = (this->_pos).x; (this->_targetPosition).y = (*(float *)((int)targetEntity + 0x340) - fVar3) * (1.0 - fVar4) + fVar3; (this->_targetPosition).x = (fVar5 - fVar7) * (1.0 - fVar4) + fVar7; } else { fVar5 = (this->_targetPosition).y; fVar4 = *(float *)((int)targetEntity + 0x340); (this->_targetPosition).x = (*(float *)((int)targetEntity + 0x33c) - fVar3) * 0.04 + fVar3; (this->_targetPosition).y = (fVar4 - fVar5) * 0.04 + fVar5; } } local_20 = (this->_targetPosition).x; if (((local_20 != g_vectorZero.x) || ((this->_targetPosition).y != g_vectorZero.y)) && (0.0 < this->_knifeDistance)) { fVar3 = (this->_anchorPosition).x; local_20 = local_20 - fVar3; fVar5 = (this->_anchorPosition).y; local_18 = (EntityPtr)((this->_pos).x - fVar3); local_1c = (this->_pos).y - fVar5; local_24 = (EntityPtr *)((this->_targetPosition).y - fVar5); fVar3 = sqrtf(local_20 * local_20 + (float)local_24 * (float)local_24); if (0.0001 < fVar3) { fVar4 = this->_maxDistance * 0.25; fVar5 = local_20; pEVar6 = local_24; if (fVar3 < fVar4) { pEVar6 = (EntityPtr *)((float)local_24 * (fVar4 / fVar3)); fVar5 = local_20 * (fVar4 / fVar3); fVar3 = fVar4; } fVar3 = this->_knifeDistance / fVar3; local_18 = (EntityPtr)((float)local_18 / fVar3); local_1c = local_1c / fVar3; fVar7 = (1.0 - fVar3) * fVar3; fVar4 = (this->_anchorPosition).y; (this->_pos).x = (float)local_18 * fVar7 + (this->_anchorPosition).x + fVar5 * fVar3 * fVar3; (this->_pos).y = local_1c * fVar7 + fVar4 + (float)pEVar6 * fVar3 * fVar3; fVar3 = atan2f((((float)pEVar6 - local_1c) + ((float)pEVar6 - local_1c)) * fVar3 + local_1c, ((fVar5 - (float)local_18) + (fVar5 - (float)local_18)) * fVar3 + (float)local_18); *param_2 = fVar3 * 57.295776; } } ExceptionList = local_10; return; } //@@ 00967a70 Entity_Knife::apply_wiggle /* DB: ? called from Entity_Knife::Update when tear flags & DAT_00c34870 (bit 10 TEAR_WIGGLE); offsets the knife position relative to its parent player (+0x3bc parent, type 1 or knife 8 -> player) */ void __thiscall Entity_Knife::apply_wiggle(Entity_Knife *this,float *param_2) { EntityPtr *pEVar1; int iVar2; code *pcVar3; Vector *pVVar4; BitSet128 *pBVar5; EntityPtr EVar6; uint uVar7; EntityPtr EVar8; float fVar9; float fVar10; double dVar11; float fVar12; BitSet128 local_24; float local_14; Vector local_10; float local_8; EVar8 = this->_parent; if (EVar8 == (EntityPtr)0x0) { return; } local_14 = 0.0; local_8 = 0.0; fVar9 = 0.0; if (*(int *)((int)EVar8 + 0x28) == 1) { local_8 = *(float *)((int)EVar8 + 0x33c) - (this->_pos).x; local_10.y = *(float *)((int)EVar8 + 0x340) - (this->_pos).y; fVar9 = sqrtf(local_8 * local_8 + local_10.y * local_10.y); if (fVar9 <= 0.0) { fVar9 = local_10.y; goto LAB_00967b6b; } local_8 = local_8 * (1.0 / fVar9); fVar9 = local_10.y * (1.0 / fVar9); } else { if ((*(int *)((int)EVar8 + 0x28) != 8) || (iVar2 = *(int *)((int)EVar8 + 0x3bc), *(int *)(iVar2 + 0x28) != 1)) goto LAB_00967b6b; local_10.x = *(float *)(iVar2 + 0x33c) - (this->_pos).x; local_10.y = *(float *)(iVar2 + 0x340) - (this->_pos).y; pVVar4 = Vector::Normalized(&local_10,(Vector *)&local_24._h); local_8 = pVVar4->x; fVar9 = pVVar4->y; } LAB_00967b6b: fVar12 = 0.0; fVar10 = local_8; pBVar5 = BitSet128::operator_and(&local_24,&this->_tearFlags,(BitSet128 *)&DAT_00c34b60); if (((int)pBVar5->_l == 0 && *(int *)((int)&pBVar5->_l + 4) == 0) && ((int)pBVar5->_h == 0 && *(int *)((int)&pBVar5->_h + 4) == 0)) { fVar10 = -fVar9; } else { local_8 = fVar9; } EVar6 = (EntityPtr)this; do { if (*(int *)((int)EVar8 + 0x28) != 8) break; pEVar1 = (EntityPtr *)((int)EVar8 + 0x3bc); EVar6 = EVar8; EVar8 = *pEVar1; } while (*pEVar1 != (EntityPtr)0x0); local_10.y = fVar10; if (EVar6 != (EntityPtr)this) { uVar7 = this->_initSeed; local_24._4_8_ = 0x900000005; local_14 = 9.80909e-45; if (uVar7 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar7 = uVar7 >> 5 ^ uVar7; uVar7 = uVar7 << 9 ^ uVar7; uVar7 = uVar7 >> 7 ^ uVar7; fVar9 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283062e-10; fVar12 = (fVar9 + fVar9) * 3.1415927; local_14 = fVar12; } fVar9 = sin(this->_knifeDistance / 20.0 + fVar12); fVar9 = ((fVar9 * 30.0 * this->_knifeDistance) / this->_maxDistance) * this->_charge; (this->_pos).x = local_10.y * fVar9 + (this->_pos).x; (this->_pos).y = local_8 * fVar9 + (this->_pos).y; fVar9 = cos(this->_knifeDistance / 20.0 + local_14); dVar11 = (double)((((fVar9 / 20.0) * 30.0 * this->_knifeDistance) / this->_maxDistance) * this->_charge); libm_sse2_atan_precise(); *param_2 = *param_2 - ((float)dVar11 * 180.0) / 3.1415927; return; } //@@ 00967d20 Entity_Knife::screen_wrap /* DB: up to 4 Room::ScreenWrapPositionImpl passes on _pos (+0x33c/+0x340, margin -100); Entity_Knife::Update when the tear flags include the wrap flag (Continuum) */ void __thiscall Entity_Knife::screen_wrap(Entity_Knife *this) { Vector *position; Game *pGVar1; uint uVar2; Vector local_10; pGVar1 = g_game; uVar2 = 0; position = &this->_pos; while ((Room::ScreenWrapPositionImpl(pGVar1->_room,&local_10,position,-100.0,-100.0,-100.0,-100.0) , local_10.x != position->x || (local_10.y != (this->_pos).y))) { uVar2 = uVar2 + 1; position->x = local_10.x; (this->_pos).y = local_10.y; if (3 < uVar2) { return; } } return; } //@@ 00967db0 Entity_Knife::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_Knife::Interpolate(Entity_Knife *this) { float fVar1; float fVar2; int iVar3; EntityPtr EVar4; Vector *pVVar5; LayerState *pLVar6; float y; float fVar7; float x; Vector local_18; Vector local_10; iVar3 = this->_subtype; if (iVar3 == 0) { if ((((uint)(this->_tearFlags)._l & (uint)g_tearFlagLudovico._l) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagLudovico._l._4_4_) == 0) && (((uint)(this->_tearFlags)._h & (uint)g_tearFlagLudovico._h) == 0 && (*(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagLudovico._h._4_4_) == 0)) { this->_isInterpolating = 1; (**(code **)(*(int *)this + 0xc))(); (this->_preInterpolatePos).x = (this->_pos).x; (this->_preInterpolatePos).y = (this->_pos).y; return; } this->_isInterpolating = 1; (**(code **)(*(int *)this + 0xc))(); } else { if ((iVar3 != 1) && (iVar3 != 4)) { if (iVar3 != 3) { return; } EVar4 = this->_parent; if (EVar4 == (EntityPtr)0x0) { return; } fVar7 = *(float *)((int)EVar4 + 0x340); fVar1 = *(float *)((int)EVar4 + 0x33c); y = fVar7 - (this->_pos).y; x = fVar1 - (this->_pos).x; local_18.x = x; local_18.y = y; if (900.0 < y * y + x * x) { pVVar5 = Vector::Resized(&local_18,&local_10,30.0); fVar2 = pVVar5->y; (this->_pos).x = fVar1 - pVVar5->x; (this->_pos).y = fVar7 - fVar2; } fVar7 = atan2f(y,x); fVar7 = normalize_angle_degrees(fVar7 * 57.295776 + 90.0); (this->_sprite)._rotation = fVar7; pLVar6 = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pLVar6->_flipX = 0.0 < fVar7; return; } this->_isInterpolating = 1; } (this->_preInterpolatePos).x = (this->_pos).x; (this->_preInterpolatePos).y = (this->_pos).y; fVar7 = this->_friction; (this->_pos).x = fVar7 * (this->_velocity).x * 0.5 + (this->_pos).x; (this->_pos).y = fVar7 * (this->_velocity).y * 0.5 + (this->_pos).y; return; } //@@ 00967fc0 Entity_Knife::Reset /* ZHL [lua] Lua binding EntityKnife:Reset */ void __thiscall Entity_Knife::Reset(Entity_Knife *this) { EntityPtr *pEVar1; byte bVar2; byte *pbVar3; uint uVar4; byte *pbVar5; bool bVar6; EntityPtr *local_8; (this->_targetPosition).x = g_vectorZero.x; pEVar1 = &this->_target; (this->_targetPosition).y = g_vectorZero.y; if (*pEVar1 != (EntityPtr)0x0) { local_8 = pEVar1; std::multiset::erase(&local_8); } *pEVar1 = (EntityPtr)0x0; this->_knifeDistance = 0.0; this->_isFlying = 0; this->_knifeVelocity = 0.0; this->_prismApplied = 0; this->_multidimensionalApplied = 0; switch(this->_variant) { default: if (this->_variant != 1) { return; } case 2: case 3: case 4: case 8: case 9: if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { pbVar3 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar3 + 0x14)) { pbVar3 = *(byte **)pbVar3; } pbVar5 = &DAT_00b602e8; do { bVar2 = *pbVar3; bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_00968090: uVar4 = -(uint)bVar6 | 1; goto LAB_00968095; } if (bVar2 == 0) break; bVar2 = pbVar3[1]; bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_00968090; pbVar3 = pbVar3 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00968095: if (uVar4 == 0) { ANM2::Play(&this->_sprite,s_Idle,0); } } case 5: case 0xb: return; } } //@@ 009680d0 Entity_Knife::SetAttackAnimation /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? picks AttackUp/Down/Left/Right / Swing by rotation (this+0x440) for variants 10/11 prototype: db/protos.zhl */ void __thiscall Entity_Knife::SetAttackAnimation(Entity_Knife *this) { byte isAnimSet; char *animName; byte *****pppppbVar1; uint size; float fVar2; float fVar3; float cosRot; float sinRot; byte *****curAnim [4]; uint curAnimSize; uint curAnimCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; void *animData; EntityPtr parent; puStack_20 = (undefined1 *)(curAnim + 0xe); local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(curAnim + 0xb); ExceptionList = &local_1c; if (g_game->_frameCount == this->_spawnFrame) { this->_displayRotation = this->_rotation; } switch(this->_variant) { case 2: case 3: case 4: case 5: case 8: case 9: break; default: if (this->_variant == 10) goto LAB_00968177; break; case 0xb: LAB_00968177: fVar2 = this->_displayRotation * 0.017453292; fVar3 = cos(fVar2); fVar2 = sin(fVar2); if (ABS(fVar3) <= ABS(fVar2)) { animName = "AttackDown"; if (fVar2 < 0.0) { animName = "AttackUp"; } } else { animName = "AttackRight"; if (fVar3 < 0.0) { animName = "AttackLeft"; } } isAnimSet = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (isAnimSet != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0096829f; } animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { curAnimSize = 0; curAnimCapacity = 0xf; curAnim[0] = (byte *****)0x0; puStack_20 = (undefined1 *)(curAnim + 0xe); } else { puStack_20 = (undefined1 *)(curAnim + 0xe); std::string::string((char *)curAnim,animData); } local_14 = (byte ****)0x0; pppppbVar1 = (byte *****)curAnim; if (0xf < curAnimCapacity) { pppppbVar1 = curAnim[0]; } isAnimSet = str_eq((byte *)pppppbVar1,curAnimSize,(byte *)"Swing",5); animName = "Swing2"; if (isAnimSet == 0) { animName = "Swing"; } isAnimSet = ANM2::SetAnimation(&this->_sprite,(byte *)animName,1); if (isAnimSet != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if (0xf < curAnimCapacity) { size = curAnimCapacity + 1; pppppbVar1 = curAnim[0]; if (0xfff < size) { pppppbVar1 = (byte *****)curAnim[0][-1]; size = curAnimCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)curAnim[0] + (-4 - (int)pppppbVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar1,size); } LAB_0096829f: parent = this->_parent; if ((parent != (EntityPtr)0x0) && ((*(int *)((int)parent + 0x28) == 1 || (*(int *)((int)parent + 0x28) == 3)))) { fVar3 = this->_displayRotation * 0.017453292; cosRot = cos(fVar3); fVar2 = *(float *)((int)parent + 0x33c); sinRot = sin(fVar3); fVar3 = *(float *)((int)parent + 0x340); (this->_pos).x = cosRot * 5.0 + fVar2; (this->_pos).y = sinRot * 5.0 + fVar3; fVar2 = *(float *)((int)parent + 0x340); (this->_anchorPosition).x = *(float *)((int)parent + 0x33c); (this->_anchorPosition).y = fVar2; fVar2 = atan2f((this->_pos).y - *(float *)((int)parent + 0x340), (this->_pos).x - *(float *)((int)parent + 0x33c)); fVar2 = fVar2 * 57.295776 - 90.0; if (360.0 < ABS(fVar2)) { fVar2 = fmodf(fVar2,360.0); } if (fVar2 <= 180.0) { if (fVar2 < -180.0) { fVar2 = fVar2 + 360.0; } } else { fVar2 = fVar2 - 360.0; } (this->_sprite)._rotation = fVar2; } this->_isDeadEyeHit = 0; *(undefined2 *)&this->_isSwinging = 0x101; this->_isSpinAttack = 0; (this->_hitList)._end = (this->_hitList)._begin; ExceptionList = local_1c; return; } //@@ 00968430 Entity_Knife::SpinAttack /* DB: "Tried to use spin attack..." Spin* anims prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Knife::SpinAttack(Entity_Knife *this,short remainingSpins,int startFrame) { Manager *pMVar1; byte bVar2; char *anim; uint uVar3; float fVar4; float local_10; float local_c; if (g_game->_frameCount == this->_spawnFrame) { this->_displayRotation = this->_rotation; } switch(this->_variant) { case 2: case 3: case 4: case 5: case 8: case 9: goto switchD_0096846e_caseD_2; default: if (this->_variant == 10) goto switchD_0096846e_caseD_b; switchD_0096846e_caseD_2: KAGE_LogMessage(4,(byte *)"Tried to use spin attack on an unsupported knife variant! (%d)\n"); return; case 0xb: switchD_0096846e_caseD_b: local_10 = this->_displayRotation * 0.017453292; local_c = cos(local_10); fVar4 = sin(local_10); if (ABS(local_c) <= ABS(fVar4)) { anim = "SpinDown"; if (fVar4 < 0.0) { anim = "SpinUp"; } } else { anim = "SpinRight"; if (local_c < 0.0) { anim = "SpinLeft"; } } bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)anim,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if ((0 < startFrame) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)startFrame); } local_c = 1.0 / ((this->_sprite)._scale.x * 0.5 + 0.5); uVar3 = Random(); pMVar1 = g_manager; if (local_c <= 0.5) { local_c = 0.5; } local_10 = 7.53899e-43; local_c = ((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9) * local_c; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_10,1.0,2,0,local_c,0.0); this->_isDeadEyeHit = 0; *(undefined2 *)&this->_isSwinging = 1; this->_isSpinAttack = 1; *(undefined4 *)(this + 1) = 1; *(short *)&this[1].field_0x4 = remainingSpins; (this->_hitList)._end = (this->_hitList)._begin; UpdateSwingHits(this); return; } } //@@ 00968660 Entity_Knife::drain_notched_axe /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Entity_Knife::UpdateSwingHits: when the swing hits a rock grid (+0x28 == 8) AddActiveCharge(-param_1) on active 0x93 (Notched Axe) slot, DischargeActiveItem when empty, TemporaryEffects::RemoveCollectibleEffect(0x93) */ uint Entity_Knife::drain_notched_axe(int param_1) { Manager *pMVar1; char cVar2; Entity_Player *this; void *pvVar3; uint uVar4; ColorMod *color; ColorMod *color_00; Entity_Knife *in_ECX; float local_3c; Color local_38; uint local_c; local_c = __security_cookie ^ (uint)&local_3c; this = GetPlayer(in_ECX); pvVar3 = (void *)0x0; if ((((this == (Entity_Player *)0x0) || (pvVar3 = in_ECX[1]._damageEvents._begin, pvVar3 == (void *)0x0)) || (*(int *)((int)pvVar3 + 0x28) != 8)) || (*(char *)((int)pvVar3 + 0x171) == '\0')) { LAB_009688aa: return (uint)pvVar3 & 0xffffff00; } cVar2 = FUN_00961ad0(); if (cVar2 != '\0') { pvVar3 = (void *)Random(); if (((uint)pvVar3 & 3) != 0) goto LAB_009688aa; } uVar4 = Entity_Player::GetActiveItemSlot(this,0x93); if (-1 < (int)uVar4) { Entity_Player::AddActiveCharge(this,-param_1,uVar4,0,0,0); pvVar3 = (void *)Entity_Player::GetActiveItem(this,uVar4); if (0 < (int)pvVar3) goto LAB_009688aa; Entity_Player::DischargeActiveItem(this,uVar4,0); } TemporaryEffects::RemoveCollectibleEffect(&this->_temporaryeffects,0x93,-1); pMVar1 = g_manager; local_3c = 6.474e-43; seed_fart_sound_override((int *)&local_3c); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_3c,1.0,2,0,1.0,0.0); pMVar1 = g_manager; local_3c = 1.93379e-43; seed_fart_sound_override((int *)&local_3c); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_3c,1.0,2,0,1.0,0.0); Color::Color(&local_38); uVar4 = Random(); Game::SpawnParticles (g_game,&in_ECX->_pos,0x1b,2, (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 4.0 + 3.0,color,100000.0,0); Color::Color(&local_38); uVar4 = Random(); local_3c = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.0 + 2.0; uVar4 = Random(); Game::SpawnParticles(g_game,&in_ECX->_pos,0x56,(uVar4 & 1) + 2,local_3c,color_00,100000.0,0); pvVar3 = in_ECX[1]._damageEvents._begin; if ((pvVar3 != (void *)0x0) && (*(int *)((int)pvVar3 + 0x28) == 8)) { *(undefined1 *)((int)pvVar3 + 0x171) = 0; } return CONCAT31((int3)((uint)pvVar3 >> 8),1); } //@@ 009688d0 Entity_Knife::UpdateSwingHits /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Entity_Knife::Update when _isSwinging && !_isFlying; QueryRadius, HitListContains, AddKnockback/AddBurn, Reflect projectiles, GetTearHitParams; Swing/Swing2/SwingEnd anims */ void __thiscall Entity_Knife::UpdateSwingHits(Entity_Knife *this) { uint *puVar1; float fVar2; float fVar3; code *pcVar4; EntityPtr EVar5; BitSet128 flags; bool bVar6; byte bVar7; char cVar8; short sVar9; BitSet128 *pBVar10; int iVar11; EntityRef *pEVar12; int iVar13; uint uVar14; GridEntity *gridEntity; Capsule *entityCapsule; EntityList *hitList; void *pvVar15; Vector *pVVar16; Entity_Player *ownerPlayer; int *piVar17; std_string *curAnimName; Entity *spawnedEntity; Entity_Knife *pEVar18; char *anim; ColorMod *laserColor; EntityPtr EVar19; int iVar20; Room *room; Entity *unused; int extraout_EDX; float fVar21; float fVar22; float fVar23; undefined1 auVar24 [12]; undefined1 *puVar25; undefined1 *puVar26; double dVar27; undefined4 uVar28; TypeDescriptor *pTVar29; TypeDescriptor *pTVar30; undefined4 uVar31; Capsule gridCapsule [10]; BitSet128 local_1c0; EntityList_EL queryResults; Vector tipPos; EntityRef extraCapsule; undefined1 local_170 [8]; Vector local_168; Vector local_15c; EntityRef tipCapsule; float scaleY; Vector local_128; BitSet128 local_120; float tipDistance; float tipRadius; float local_104; Vector local_100; Vector local_f8; Vector local_f0; float local_e8; Vector *local_e4; Vector local_e0; uint local_d8; EntityPtr local_d4; EntityPtr local_d0; int baseVariant; float damage; float local_c4; Entity_Knife *local_c0; GridEntity *local_bc; undefined8 local_b8; char local_a9; undefined8 local_a8; Room *local_9c; float local_98; void *local_94; char local_8d; Entity_Knife *knife; Entity_Player *player; float local_84; char local_7d; uint local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined1 local_68 [8]; float local_60; float local_5c; uint local_58; uint local_54; undefined1 local_50 [44]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; ANM2 *spawnedSprite; qword tearFlagsHigh; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0c980; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); local_e8 = 0.0; if (this->_isInterpolating != 0) { return; } if (this->_dead != 0) { return; } ExceptionList = &local_1c; knife = this; ownerPlayer = GetPlayer(this); local_d4 = (EntityPtr)0x0; EVar19 = this->_parent; if (EVar19 != (EntityPtr)0x0) { if (*(int *)((int)EVar19 + 0x28) == 8) { EVar19 = *(EntityPtr *)((int)EVar19 + 0x3bc); if (EVar19 == (EntityPtr)0x0) goto LAB_00968980; } iVar11 = *(int *)((int)EVar19 + 0x28); if (((iVar11 == 1) || (iVar11 == 3)) || (iVar11 == 2)) { local_d4 = EVar19; } } LAB_00968980: player = ownerPlayer; baseVariant = GetBaseVariant(this); fVar21 = this->_mass; if (this->_variant == 2) { tipDistance = 40.0; tipRadius = 45.0; local_c4 = fVar21 * 9.0; } else { tipDistance = 28.0; tipRadius = 30.0; local_c4 = fVar21 * 18.0; } local_c4 = local_c4 / 3.0; local_104 = 4.0; scaleY = (this->_sprite)._scale.y; local_d0 = (EntityPtr)((fVar21 * 4.0) / 3.0); local_94 = DebugRenderer::Get(&g_game->_debugRenderer,this->_index,1); if ((baseVariant == 10) && (this->_isSwinging == 0)) { local_7d = '\x01'; } else { local_7d = '\0'; } iVar11 = this->_variant; if (((iVar11 == 4) || (iVar11 == 5)) || ((iVar11 == 9 || (iVar11 == 8)))) { local_a9 = '\x01'; if (iVar11 == 4) { local_c4 = 36.0; local_a9 = '\x01'; } } else { local_a9 = '\0'; } if ((ownerPlayer != (Entity_Player *)0x0) && (ownerPlayer->_playerType == 0x23)) { local_d0 = (EntityPtr)0x0; } if ((this->_subtype == 4) || (local_7d != '\0')) { pBVar10 = BitSet128::operator_and(&local_1c0,&this->_tearFlags,(BitSet128 *)&DAT_00c34b40); if ((((int)pBVar10->_l == 0 && *(int *)((int)&pBVar10->_l + 4) == 0) && ((int)pBVar10->_h == 0 && *(int *)((int)&pBVar10->_h + 4) == 0)) || ((iVar11 = ANM2::GetFrame(&this->_sprite), iVar11 < 5 || (0x1d < g_game->_frameCount - this->_spawnFrame)))) { LAB_00968b38: if ((this->_sprite)._animState._animData == (void *)0x0) goto LAB_00968b3e; local_c0 = (Entity_Knife *)(this->_sprite)._animState._animFrame; dVar27 = floor((double)(float)local_c0); local_c0 = (Entity_Knife *)(float)dVar27; local_a8 = CONCAT44((int)dVar27,(GridEntity *)local_a8); if (5 < (int)dVar27 - 2U) goto LAB_00968b48; bVar6 = true; } else { if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,4.0); goto LAB_00968b38; } LAB_00968b3e: local_a8 = CONCAT44(0xffffffff,(GridEntity *)local_a8); LAB_00968b48: bVar6 = false; } if ((baseVariant == 10) || (bVar6)) { if (this->_variant == 9) { DAT_00c7ac6c = ownerPlayer; LAB_00968b6e: damage = 3.0; } else { if (this->_variant != 2) goto LAB_00968b6e; damage = 1.5; } damage = damage * this->_collisionDamage; local_d8 = local_d8 & 0xffffff00; local_1c0._l._0_4_ = (uint)(this->_tearFlags)._l; local_1c0._l._4_4_ = *(uint *)((int)&(this->_tearFlags)._l + 4); local_1c0._h._0_4_ = (uint)(this->_tearFlags)._h; local_1c0._h._4_4_ = *(uint *)((int)&(this->_tearFlags)._h + 4); if (ownerPlayer == (Entity_Player *)0x0) { local_f8.x = (this->_pos).x; local_f8.y = (this->_pos).y; } else { local_f8.x = (ownerPlayer->_pos).x; local_f8.y = (ownerPlayer->_pos).y; } local_84 = this->_displayRotation * 0.017453292; local_e4 = &local_f8; local_120._l._0_4_ = (uint)local_1c0._l; local_120._l._4_4_ = local_1c0._l._4_4_; local_120._h._0_4_ = (uint)local_1c0._h; local_120._h._4_4_ = local_1c0._h._4_4_; local_c0 = (Entity_Knife *)&this->_pos; local_100.y = sin(local_84); fVar21 = cos(local_84); tipPos.x = fVar21 * tipDistance * scaleY + (this->_pos).x; local_f0.x = 1.0; tipPos.y = local_100.y * tipDistance * scaleY + (this->_pos).y; local_f0.y = 1.0; Capsule::constructor((Capsule *)&tipCapsule,&tipPos,&local_f0,0.0,scaleY * tipRadius); Capsule::constructor((Capsule *)&extraCapsule,&g_vectorZero,&g_vectorZero,0.0,0.0); if ((*(int *)&g_game->_deathmatchManager < 2) || (this->_variant != 3)) { if (this->_variant == 0xb) { local_1c0._l._0_4_ = (uint)local_120._l | DAT_00c34c60; local_1c0._l._4_4_ = local_120._l._4_4_ | DAT_00c34c64; local_1c0._h._0_4_ = (uint)local_120._h | DAT_00c34c68; local_1c0._h._4_4_ = local_120._h._4_4_ | DAT_00c34c6c; local_120._l._0_4_ = (uint)local_1c0._l; local_120._l._4_4_ = local_1c0._l._4_4_; local_120._h._0_4_ = (uint)local_1c0._h; local_120._h._4_4_ = local_1c0._h._4_4_; } } else { damage = this->_collisionDamage * 1.5; } if (baseVariant == 10) { pEVar12 = (EntityRef *) Entity::GetNullCapsule((Entity *)this,(Capsule *)(local_50 + 4),&DAT_00b1d3b0); EntityRef::operator_(&tipCapsule,pEVar12); pEVar12 = (EntityRef *) Entity::GetNullCapsule((Entity *)this,(Capsule *)(local_50 + 4),&DAT_00b7cb20); EntityRef::operator_(&extraCapsule,pEVar12); damage = this->_collisionDamage; if (local_7d == '\0') { if (this->_isSpinAttack == 0) { damage = damage * 3.0 + 3.5; goto LAB_00968f51; } local_98 = 1.8; damage = damage * 8.0 + 10.0; } else { local_98 = 0.8; } tipCapsule._entity = (void *)(((float)tipCapsule._flags + (float)tipCapsule._entity) * local_98 - (float)tipCapsule._flags); extraCapsule._entity = (void *)(((float)extraCapsule._flags + (float)extraCapsule._entity) * local_98 - (float)extraCapsule._flags); tipCapsule._spawnerType = (int)((float)tipCapsule._type - (float)tipCapsule._entity * tipCapsule._velocity.x); tipCapsule._spawnerVariant = (int)((float)tipCapsule._variant - (float)tipCapsule._entity * tipCapsule._velocity.y); tipCapsule._position.x = (float)tipCapsule._type + (float)tipCapsule._entity * tipCapsule._velocity.x; tipCapsule._position.y = (float)tipCapsule._variant + (float)tipCapsule._entity * tipCapsule._velocity.y; extraCapsule._spawnerType = (int)((float)extraCapsule._type - (float)extraCapsule._entity * extraCapsule._velocity.x); extraCapsule._spawnerVariant = (int)((float)extraCapsule._variant - (float)extraCapsule._entity * extraCapsule._velocity.y); extraCapsule._position.x = (float)extraCapsule._type + (float)extraCapsule._entity * extraCapsule._velocity.x; extraCapsule._position.y = (float)extraCapsule._variant + (float)extraCapsule._entity * extraCapsule._velocity.y; } LAB_00968f51: pvVar15 = local_94; if (((uint)g_game->_debugFlags >> 5 & 1) != 0) { if (0.0 < (float)tipCapsule._flags) { push_shape_points(local_94,(Capsule *)&tipCapsule); } if (0.0 < (float)extraCapsule._flags) { push_shape_points(pvVar15,(Capsule *)&extraCapsule); } } if ((float)extraCapsule._flags <= 0.0) { local_98 = (float)tipCapsule._flags + (float)tipCapsule._entity; uVar14 = g_game->_debugFlags; local_e0.x = (float)tipCapsule._type; local_e0.y = (float)tipCapsule._variant; } else { local_100.y = (float)extraCapsule._variant - (float)tipCapsule._variant; local_84 = (float)extraCapsule._type - (float)tipCapsule._type; fVar21 = sqrtf(local_100.y * local_100.y + local_84 * local_84); local_e0.x = (float)tipCapsule._type; local_e0.y = (float)tipCapsule._variant; local_98 = (fVar21 + (float)tipCapsule._flags + (float)tipCapsule._entity + (float)extraCapsule._flags + (float)extraCapsule._entity) * 0.5; if (0.0 < fVar21) { fVar22 = (local_98 - (float)tipCapsule._flags) - (float)tipCapsule._entity; local_e0.y = (float)tipCapsule._variant + (fVar22 * local_100.y) / fVar21; local_e0.x = (float)tipCapsule._type + (fVar22 * local_84) / fVar21; } uVar14 = g_game->_debugFlags; } if ((uVar14 >> 5 & 1) != 0) { FUN_0042ede0(&local_e0); } local_f0.y = 0.0; local_f0.x = 0.0; room = g_game->_room; local_9c = room; iVar11 = Room::GetGridIndex(room,&local_e0); if (-1 < iVar11) { local_94 = (void *)room->_gridWidth; local_84 = local_98 / 40.0; iVar13 = iVar11 / (int)local_94; iVar11 = iVar11 % (int)local_94; dVar27 = ceil((double)local_84); iVar20 = (int)dVar27; uVar14 = iVar11 - iVar20; local_7c = 0; if (0 < (int)uVar14) { local_7c = uVar14; } fVar22 = (float)(iVar13 - iVar20); fVar21 = 0.0; if (0 < (int)fVar22) { fVar21 = fVar22; } pvVar15 = (void *)(iVar20 + iVar11); if ((int)pvVar15 < (int)local_94) { local_94 = pvVar15; } fVar22 = (float)(iVar20 + iVar13); fVar23 = (float)local_9c->_gridHeight; if ((int)fVar22 < local_9c->_gridHeight) { fVar23 = fVar22; } local_100.y = fVar23; local_84 = fVar21; if ((int)local_7c <= (int)local_94) { room = local_9c; do { uVar14 = local_7c; local_128.y = fVar21; if ((int)fVar21 <= (int)fVar23) { do { if (((((int)uVar14 < 0) || (room->_gridWidth <= (int)uVar14)) || ((int)local_128.y < 0)) || ((room->_gridHeight <= (int)local_128.y || (iVar11 = room->_gridWidth * (int)local_128.y + uVar14, iVar11 < 0)))) { gridEntity = (GridEntity *)0x0; } else { gridEntity = room->_gridEntities[iVar11]; } local_bc = gridEntity; if (gridEntity != (GridEntity *)0x0) { iVar11 = *(int *)((int)g_game->_room + 0xc); local_168.x = (float)(gridEntity->_gridIndex % iVar11) * 40.0 + 40.0; local_168.y = (float)(gridEntity->_gridIndex / iVar11) * 40.0 + 120.0; Capsule::constructor(gridCapsule,&local_168,&g_vectorOne,0.0,20.0); bVar7 = Capsule::Collide(gridCapsule,(Capsule *)&tipCapsule,&local_f0); if ((bVar7 != 0) || ((0.0 < (float)extraCapsule._flags && (bVar7 = Capsule::Collide(gridCapsule,(Capsule *)&extraCapsule,&local_f0), bVar7 != 0)))) { pEVar18 = knife; if (knife->_variant == 9) { if (0 < gridEntity->_collisionClass) { pcVar4 = *(code **)(*(int *)gridEntity + 0x14); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)knife); cVar8 = (*pcVar4)(0,local_50 + 4); if (cVar8 != '\0') { local_15c.y = ((pEVar18->_sprite)._rotation + 90.0) * 0.017453292; fVar21 = sin(local_15c.y); local_b8 = CONCAT44(fVar21,(undefined4)local_b8); fVar21 = cos(local_15c.y); if (ABS(fVar21) <= ABS(local_b8._4_4_)) { puVar25 = (undefined1 *)0x0; if (0.0 <= local_b8._4_4_) { puVar26 = (undefined1 *)0x3f800000; } else { puVar26 = &DAT_bf800000; } } else { puVar26 = (undefined1 *)0x0; if (0.0 <= fVar21) { puVar25 = (undefined1 *)0x3f800000; } else { puVar25 = &DAT_bf800000; } } if (((float)puVar25 != g_vectorZero.x) || ((float)puVar26 != g_vectorZero.y)) { room = g_game->_room; fVar21 = (((float)(local_bc->_gridIndex % room->_gridWidth) * 40.0 + 40.0 + (float)puVar25 * 40.0) - 40.0) / 40.0 + 0.5; iVar13 = (int)fVar21; iVar11 = (int)((((float)(local_bc->_gridIndex / room->_gridWidth) * 40.0 + 120.0 + (float)puVar26 * 40.0) - 120.0) / 40.0 + 0.5) ; local_b8 = CONCAT44(iVar13,(undefined4)local_b8); if (((-1 < iVar13) && (((iVar13 < room->_gridWidth && (-1 < iVar11)) && (iVar11 < room->_gridHeight)))) && (iVar11 = iVar11 * room->_gridWidth + (int)fVar21, -1 < iVar11)) { if (iVar11 < 0x1c0) { gridEntity = room->_gridEntities[iVar11]; } else { gridEntity = (GridEntity *)0x0; } Room::TryMakeBridge(room,gridEntity,local_bc); } } cVar8 = drain_notched_axe(1); if (cVar8 != '\0') { if (pEVar18->_variant == 9) { DAT_00c7ac6c = (Entity_Player *)0x0; ExceptionList = local_1c; return; } ExceptionList = local_1c; return; } local_d8 = CONCAT31(local_d8._1_3_,1); } } } else { local_78 = 0; local_74 = 0; local_70 = 0; local_6c = 0; local_68._0_4_ = g_vectorZero.x; local_68._4_4_ = g_vectorZero.y; local_60 = g_vectorZero.x; local_5c = g_vectorZero.y; local_58 = 0; local_54 = 0; cVar8 = (**(code **)(*(int *)gridEntity + 0x10))(1,&local_78); local_d8 = local_d8 & 0xff; if (cVar8 != '\0') { local_d8 = 1; } } } room = local_9c; uVar14 = local_7c; } local_128.y = (float)((int)local_128.y + 1); } while ((int)local_128.y <= (int)local_100.y); fVar23 = local_100.y; fVar21 = local_84; } local_7c = uVar14 + 1; } while ((int)local_7c <= (int)local_94); } this = knife; } uVar14 = 0x1d; pBVar10 = BitSet128::operator_and ((BitSet128 *)local_170,&local_120,(BitSet128 *)&DAT_00c34c60); if ((((((int)pBVar10->_l != 0 || *(int *)((int)&pBVar10->_l + 4) != 0) || ((int)pBVar10->_h != 0 || *(int *)((int)&pBVar10->_h + 4) != 0)) || ((this->_variant == 4 || (this->_variant == 3)))) || ((baseVariant == 10 && (this->_isSpinAttack != 0)))) && ((int)local_a8._4_4_ < 5)) { uVar14 = 0x1f; } EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&queryResults,&local_e0,local_98,uVar14 ); local_14 = 0; local_7c = 0; if (queryResults._size != 0) { fVar21 = 0.0; do { EVar19 = *(EntityPtr *)((int)queryResults._data + local_7c * 4); if ((*(float *)((int)EVar19 + 0x370) != fVar21) && (*(int *)((int)EVar19 + 0x188) != 0)) { if (fVar21 < (float)tipCapsule._entity) { entityCapsule = Entity::GetCollisionCapsule((Entity *)EVar19,local_50 + 4,&g_vectorZero); bVar7 = Capsule::Collide(entityCapsule,(Capsule *)&tipCapsule,&local_f0); fVar21 = 0.0; if ((bVar7 == 0) && (0.0 < (float)extraCapsule._flags)) { entityCapsule = Entity::GetCollisionCapsule((Entity *)EVar19,local_50 + 4,&g_vectorZero); bVar7 = Capsule::Collide(entityCapsule,(Capsule *)&extraCapsule,&local_f0); fVar21 = 0.0; if (bVar7 == 0) goto LAB_0096a6af; } } piVar17 = (int *)((int)EVar19 + 0x28); if (*(int *)&g_game->_deathmatchManager < 2) { LAB_00969714: iVar11 = *piVar17; local_a8 = CONCAT44(piVar17,(GridEntity *)local_a8); if (iVar11 - 10U < 0x3de) { if (iVar11 == 1) goto LAB_0096972f; goto LAB_0096973b; } LAB_00969f92: if (local_7d == '\0') { if (iVar11 == 4) { if (((*(EntityPtr *)((int)EVar19 + 0x3bc) != (EntityPtr)player) || (*(char *)((int)EVar19 + 0x448) == '\0')) || (fVar21 < *(float *)((int)EVar19 + 0x350) || fVar21 == *(float *)((int)EVar19 + 0x350))) { hitList = GetHitEntities(this); bVar7 = EntityList::HitListContains(hitList,(Entity *)EVar19); if (bVar7 == 0) { pvVar15 = GetHitEntities(this); uVar14 = Entity::GetHitListIndex((Entity *)EVar19); sorted_vector_insert_unique(pvVar15,uVar14); fVar21 = ((Vector *)((int)EVar19 + 0x33c))->x - local_e4->x; local_84 = *(float *)((int)EVar19 + 0x340) - local_e4->y; local_a8 = CONCAT44(fVar21,(GridEntity *)local_a8); fVar22 = sqrtf(fVar21 * fVar21 + local_84 * local_84); fVar21 = 0.0; if (fVar22 <= 0.0) { fVar23 = (float)local_a8._4_4_; fVar22 = local_84; } else { fVar23 = (float)local_a8._4_4_ * (1.0 / fVar22); fVar22 = (1.0 / fVar22) * local_84; } fVar2 = *(float *)((int)EVar19 + 0x36c); if (fVar2 != 0.0) { fVar3 = *(float *)((int)EVar19 + 0x364); ((Vector *)((int)EVar19 + 0x360))->x = (fVar23 * local_c4) / fVar2 + ((Vector *)((int)EVar19 + 0x360))->x; *(float *)((int)EVar19 + 0x364) = (fVar22 * local_c4) / fVar2 + fVar3; } } } else { LAB_0096a33e: if ((player == (Entity_Player *)0x0) || (iVar11 != 2)) { if ((((iVar11 == 5) && (*(int *)((int)EVar19 + 0x2c) != 100)) && ((((*(int *)((int)EVar19 + 0x534) == 0 || (this->_variant == 4)) && (*(byte *)((int)EVar19 + 0x173) == 0)) && ((*(int *)((int)EVar19 + 0x188) != 0 && ((*(uint *)((int)EVar19 + 0x168) & 0x4000000) == 0)))))) && ((local_d4 == (EntityPtr)0x0 || (*(int *)((int)local_d4 + 0x28) != 2)))) { hitList = GetHitEntities(this); bVar7 = EntityList::HitListContains(hitList,(Entity *)EVar19); if (bVar7 == 0) { pvVar15 = GetHitEntities(this); uVar14 = Entity::GetHitListIndex((Entity *)EVar19); sorted_vector_insert_unique(pvVar15,uVar14); fVar21 = ((Vector *)((int)EVar19 + 0x33c))->x - *(float *)local_c0; local_84 = *(float *)((int)EVar19 + 0x340) - *(float *)&local_c0->field_0x4; local_a8 = CONCAT44(fVar21,(GridEntity *)local_a8); fVar22 = sqrtf(fVar21 * fVar21 + local_84 * local_84); fVar21 = 0.0; if (fVar22 <= 0.0) { fVar23 = local_84; fVar22 = (float)local_a8._4_4_; } else { fVar23 = local_84 * (1.0 / fVar22); fVar22 = (float)local_a8._4_4_ * (1.0 / fVar22); } fVar2 = *(float *)((int)EVar19 + 0x36c); if (fVar2 != 0.0) { fVar3 = *(float *)((int)EVar19 + 0x364); ((Vector *)((int)EVar19 + 0x360))->x = (fVar22 * local_c4) / fVar2 + ((Vector *)((int)EVar19 + 0x360))->x; *(float *)((int)EVar19 + 0x364) = (fVar23 * local_c4) / fVar2 + fVar3; } if (player != (Entity_Player *)0x0) { iVar11 = knife->_variant; bVar7 = Entity_Pickup::CanBePickedUp ((Entity_Pickup *)EVar19,iVar11 == 4); if ((bVar7 != 0) || (bVar7 = Entity_Pickup::IsChest(*(int *)((int)EVar19 + 0x2c)), bVar7 != 0)) { ownerPlayer = player; if ((iVar11 != 4) || (cVar8 = Entity_Player::bag_of_crafting_collect(EVar19), cVar8 == '\0')) { g_forceCollideDepth = g_forceCollideDepth + 1; (**(code **)(*(int *)ownerPlayer + 0x5c))(EVar19,1); (**(code **)(*(int *)EVar19 + 0x5c))(ownerPlayer,0); g_forceCollideDepth = g_forceCollideDepth + -1; } fVar21 = 0.0; } } bVar7 = Entity_Pickup::IsChest(*(int *)((int)EVar19 + 0x2c)); if (bVar7 != 0) { local_b8 = 0; if (*(int *)(extraout_EDX + 0x2c) == 9) { local_84 = 2.3509887e-38; } else { local_84 = 0.0; } local_a8 = local_a8 & 0xffffffff; pcVar4 = *(code **)(*(int *)EVar19 + 0x20); EntityRef::constructor ((EntityRef *)(local_50 + 4), *(Entity **)(extraout_EDX + 0x3bc)); (*pcVar4)(damage,local_84,local_a8._4_4_,local_50 + 4,0x1e); goto LAB_0096a6a9; } } } } else if (*(EntityPtr *)((int)EVar19 + 0x3bc) == (EntityPtr)player) { local_120._l._0_4_ = *(uint *)((std_string *)((int)EVar19 + 0x428))->_buf; local_120._l._4_4_ = *(uint *)((int)EVar19 + 0x42c); local_120._h._0_4_ = *(uint *)((int)EVar19 + 0x430); local_120._h._4_4_ = *(uint *)((int)EVar19 + 0x434); pBVar10 = BitSet128::operator_and ((BitSet128 *)&local_60,&local_120,&g_tearFlagLudovico); if (((int)pBVar10->_l != 0 || *(int *)((int)&pBVar10->_l + 4) != 0) || ((int)pBVar10->_h != 0 || *(int *)((int)&pBVar10->_h + 4) != 0)) { hitList = GetHitEntities(this); bVar7 = EntityList::HitListContains(hitList,(Entity *)EVar19); if (bVar7 == 0) { pvVar15 = GetHitEntities(this); uVar14 = Entity::GetHitListIndex((Entity *)EVar19); sorted_vector_insert_unique(pvVar15,uVar14); fVar21 = *(float *)((int)EVar19 + 0x340) - *(float *)&local_c0->field_0x4; local_84 = ((Vector *)((int)EVar19 + 0x33c))->x - *(float *)local_c0; local_a8 = CONCAT44(fVar21,(GridEntity *)local_a8); fVar22 = sqrtf(fVar21 * fVar21 + local_84 * local_84); fVar21 = 0.0; if (fVar22 <= 0.0) { fVar23 = local_84; fVar22 = (float)local_a8._4_4_; } else { fVar23 = local_84 * (1.0 / fVar22); fVar22 = (float)local_a8._4_4_ * (1.0 / fVar22); } ((Vector *)((int)EVar19 + 0x360))->x = fVar23 * local_c4 * 1.25; *(float *)((int)EVar19 + 0x364) = fVar22 * local_c4 * 1.25; } } } } } else if (iVar11 == 3) { if (*(int *)((int)EVar19 + 0x2c) == 0xef) { hitList = GetHitEntities(this); bVar7 = EntityList::HitListContains(hitList,(Entity *)EVar19); if (bVar7 == 0) { pvVar15 = GetHitEntities(this); uVar14 = Entity::GetHitListIndex((Entity *)EVar19); sorted_vector_insert_unique(pvVar15,uVar14); local_84 = ((Vector *)((int)EVar19 + 0x33c))->x - local_e4->x; fVar21 = *(float *)((int)EVar19 + 0x340) - local_e4->y; local_a8._4_4_ = (Room *)fVar21; fVar22 = sqrtf(local_84 * local_84 + fVar21 * fVar21); fVar21 = local_84; if (0.0 < fVar22) { local_a8._4_4_ = (Room *)((float)local_a8._4_4_ * (1.0 / fVar22)); fVar21 = local_84 * (1.0 / fVar22); } fVar22 = *(float *)((int)EVar19 + 0x364); fVar23 = ((Vector *)((int)EVar19 + 0x360))->x * 0.25; ((Vector *)((int)EVar19 + 0x360))->x = fVar23; *(float *)((int)EVar19 + 0x364) = fVar22 * 0.25; fVar22 = *(float *)((int)EVar19 + 0x36c); if (fVar22 != 0.0) { fVar2 = *(float *)((int)EVar19 + 0x364); ((Vector *)((int)EVar19 + 0x360))->x = fVar23 + (fVar21 * local_c4) / fVar22 ; *(float *)((int)EVar19 + 0x364) = ((float)local_a8._4_4_ * local_c4) / fVar22 + fVar2; } manager = g_manager; local_a8 = CONCAT44(0x354,(GridEntity *)local_a8); seed_fart_sound_override((int *)((int)&local_a8 + 4)); SoundEffects::Play(&manager->_sfxManager,(int)local_a8._4_4_,1.0,2,0,1.0,0.0); goto LAB_0096a6a9; } } } else { if (iVar11 != 9) goto LAB_0096a33e; if (((player != (Entity_Player *)0x0) && (*(byte *)((int)EVar19 + 0x173) == 0)) && (-50.0 < *(float *)(((ANM2 *)((int)EVar19 + 0x410))->_filename)._buf)) { local_84 = *(float *)((int)EVar19 + 0x340) - local_e4->y; fVar21 = ((Vector *)((int)EVar19 + 0x33c))->x - local_e4->x; local_a8 = CONCAT44(fVar21,(GridEntity *)local_a8); fVar22 = sqrtf(local_84 * local_84 + fVar21 * fVar21); fVar21 = 0.0; if (fVar22 <= 0.0) { fVar23 = (float)local_a8._4_4_; fVar22 = local_84; } else { fVar23 = (float)local_a8._4_4_ * (1.0 / fVar22); fVar22 = local_84 * (1.0 / fVar22); } if (this->_variant != 4) { local_128.x = fVar23 * local_c4; local_128.y = fVar22 * local_c4; Entity_Projectile::Reflect((Entity_Projectile *)EVar19,unused,&local_128); goto LAB_0096a6a9; } *(uint *)((int)EVar19 + 0x438) = 0; *(uint *)((int)EVar19 + 0x43c) = 0; *(byte *)((int)EVar19 + 0x173) = 1; } } } } else { local_a8 = CONCAT44(piVar17,(GridEntity *)local_a8); if (*piVar17 != 1) goto LAB_00969714; iVar11 = 1; LAB_0096972f: if (EVar19 == this->_spawnerEntity) goto LAB_00969f92; LAB_0096973b: if ((*(uint *)((int)EVar19 + 0x168) & 0x20000000) != 0) goto LAB_00969f92; hitList = GetHitEntities(this); bVar7 = EntityList::HitListContains(hitList,(Entity *)EVar19); if (bVar7 != 0) goto LAB_0096a6af; iVar11 = *(int *)local_a8._4_4_; if ((iVar11 != 0xf5) && (iVar11 != 0x124)) { pvVar15 = GetHitEntities(this); uVar14 = Entity::GetHitListIndex((Entity *)EVar19); sorted_vector_insert_unique(pvVar15,uVar14); iVar11 = *(int *)((int)EVar19 + 0x28); this = knife; } ownerPlayer = player; if (iVar11 == 0x21) { if (*(int *)((int)EVar19 + 0x2c) == 0xb) goto LAB_009699e7; pcVar4 = *(code **)(*(int *)EVar19 + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)knife->_parent); (*pcVar4)(0x447a0000,0,0,local_50 + 4,0x1e); local_d8 = CONCAT31(local_d8._1_3_,1); } else if (iVar11 == 0x3c3) { g_forceCollideDepth = g_forceCollideDepth + 1; (**(code **)(*(int *)player + 0x5c))(EVar19,1); (**(code **)(*(int *)EVar19 + 0x5c))(ownerPlayer,0); g_forceCollideDepth = g_forceCollideDepth + -1; } else { if (iVar11 == 0x390) { if (*(int *)((int)EVar19 + 0x2c) == 100) { fVar21 = 0.0; if ((0.0 < *(float *)((int)EVar19 + 0x364)) && (*(float *)((int)EVar19 + 0x340) < (this->_pos).y)) { EVar5 = *(EntityPtr *)((int)EVar19 + 0x3bc); *(undefined4 *)((int)EVar19 + 0xb64) = 0x10; if (EVar5 == (EntityPtr)0x0) { pVVar16 = &local_e0; local_e0.x = ((Vector *)((int)EVar19 + 0x33c))->x - (this->_pos).x; local_e0.y = *(float *)((int)EVar19 + 0x340) - (this->_pos).y; } else { pVVar16 = &local_168; local_168.x = *(float *)((int)EVar5 + 0x33c) - (this->_pos).x; local_168.y = *(float *)((int)EVar5 + 0x340) - (this->_pos).y; } local_94 = (void *)pVVar16->x; local_98 = pVVar16->y; fVar21 = sqrtf((float)local_94 * (float)local_94 + local_98 * local_98); local_b8 = CONCAT44(fVar21,(undefined4)local_b8); if (fVar21 <= 0.0) { fVar22 = local_98; pvVar15 = local_94; } else { fVar22 = local_98 * (18.0 / fVar21); pvVar15 = (void *)((float)local_94 * (18.0 / fVar21)); } ((Vector *)((int)EVar19 + 0x360))->x = (float)pvVar15; *(float *)((int)EVar19 + 0x364) = fVar22; fVar21 = ((Vector *)((int)EVar19 + 0x334))->x; fVar22 = sqrtf(fVar21 * fVar21 + *(float *)((int)EVar19 + 0x338) * *(float *)((int)EVar19 + 0x338)); fVar21 = 0.0; if (local_b8._4_4_ <= 0.0) { pvVar15 = local_94; fVar22 = local_98; } else { fVar22 = (fVar22 + 0.1) / local_b8._4_4_; pvVar15 = (void *)((float)local_94 * fVar22); fVar22 = local_98 * fVar22; } ((Vector *)((int)EVar19 + 0x334))->x = (float)pvVar15; *(float *)((int)EVar19 + 0x338) = fVar22; *(float *)((int)EVar19 + 0x37c) = *(float *)((int)EVar19 + 0x37c) + 1.0; } goto LAB_0096a6af; } } else if (iVar11 == 0x11) goto LAB_0096a6a9; LAB_009699e7: if (*(byte *)((int)EVar19 + 0x173) == 0) { local_98 = ((Vector *)((int)EVar19 + 0x33c))->x - local_e4->x; local_94 = (void *)(*(float *)((int)EVar19 + 0x340) - local_e4->y); fVar21 = sqrtf(local_98 * local_98 + (float)local_94 * (float)local_94); if (0.0 < fVar21) { local_98 = (1.0 / fVar21) * local_98; local_94 = (void *)((float)local_94 * (1.0 / fVar21)); } if (((this->_variant == 9) && (ownerPlayer = GetPlayer(this), ownerPlayer != (Entity_Player *)0x0)) && (bVar7 = Entity_Player::HasCollectible(ownerPlayer,0x3b,0), bVar7 != 0)) { local_8d = '\x01'; } else { local_8d = '\0'; } if ((*(uint *)((int)EVar19 + 0x168) & 0x4000000) == 0) { fVar21 = *(float *)((int)EVar19 + 0x36c); fVar22 = (local_c4 * 50.0) / (*(float *)((int)EVar19 + 0x37c) + 50.0); if (fVar21 != 0.0) { fVar23 = ((Vector *)((int)EVar19 + 0x360))->x; *(float *)((int)EVar19 + 0x364) = (*(float *)((int)EVar19 + 0x39c) * (float)local_94 * fVar22) / fVar21 + *(float *)((int)EVar19 + 0x364); ((Vector *)((int)EVar19 + 0x360))->x = (*(float *)((int)EVar19 + 0x39c) * local_98 * fVar22) / fVar21 + fVar23; } if (local_8d != '\0') { fVar21 = (*(float *)((int)EVar19 + 0x37c) - 10.0) / 70.0; if (fVar21 <= 0.0) { fVar21 = 0.0; } if (1.0 <= fVar21) { fVar21 = 1.0; } fVar21 = 20.0 - fVar21 * 19.0; local_b8 = CONCAT44(fVar21,(undefined4)local_b8); dVar27 = floor((double)fVar21); local_15c.x = local_98 * 16.0; local_15c.y = (float)local_94 * 16.0; local_b8 = CONCAT44((float)dVar27,(undefined4)local_b8); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)player); Entity::AddKnockback ((Entity *)EVar19,(EntityRef *)(local_50 + 4),&local_15c,(int)dVar27 ,1); this = knife; } } local_a8 = 0; local_b8 = CONCAT44((uint)(*(int *)&g_game->_deathmatchManager < 2) * 2 + 4, (undefined4)local_b8); bVar7 = Entity::IsVulnerableEnemy((Entity *)EVar19,(Entity *)0x0); if ((bVar7 == 0) || (player == (Entity_Player *)0x0)) { LAB_00969c8e: local_9c = local_a8._4_4_; local_bc = (GridEntity *)local_a8; } else { if ((player->_hasCurseMistEffect != 0) || ((player->_isCoopGhost != 0 || (player->_playerForms[0] < 3)))) { bVar7 = Entity_Player::HasCollectible(player,0x97,0); if (bVar7 != 0) { uVar14 = Random(); if (uVar14 % (uint)local_b8._4_4_ == 0) goto LAB_00969c7c; } goto LAB_00969c8e; } LAB_00969c7c: if (0x1d < player->_numBlueFlies) goto LAB_00969c8e; local_9c = (Room *)0x0; local_bc = (GridEntity *)0x4000; } if (this->_variant == 9) { local_bc = (GridEntity *)((uint)local_bc | 0x1000000); } if ((this->_flags & 0x400000000) != 0) { local_bc = (GridEntity *)((uint)local_bc | 0x20000000); } if (local_8d != '\0') { local_9c = (Room *)((uint)local_9c | 2); } pcVar4 = *(code **)(*(int *)EVar19 + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)knife->_parent); cVar8 = (*pcVar4)(damage,local_bc,local_9c,local_50 + 4,0x1e); if (cVar8 == '\0') { pEVar18 = knife; } else { bVar7 = Entity::IsVulnerableEnemy((Entity *)EVar19,(Entity *)0x0); manager = g_manager; if (bVar7 == 0) { pEVar18 = knife; } else { local_a8 = CONCAT44(0x4d,(GridEntity *)local_a8); seed_fart_sound_override((int *)((int)&local_a8 + 4)); SoundEffects::Play(&manager->_sfxManager,(int)local_a8._4_4_,1.0,10,0,1.5,0.0) ; pEVar18 = knife; flags._l._4_4_ = local_1c0._l._4_4_; flags._l._0_4_ = (uint)local_1c0._l; flags._h._0_4_ = (uint)local_1c0._h; flags._h._4_4_ = local_1c0._h._4_4_; Entity_Tear::ApplyTearFlagEffects ((Entity *)EVar19,&knife->_pos,flags,(Entity *)knife,damage); if (pEVar18->_variant == 3) { iVar11 = player->_damageCooldown; if (iVar11 < 1) { *(int *)&player->_flags = (int)player->_flags; puVar1 = (uint *)((int)&player->_flags + 4); *puVar1 = *puVar1 | 0x10; pEVar18 = knife; } local_b8 = CONCAT44(0xf,(undefined4)local_b8); piVar17 = (int *)((int)&local_b8 + 4); if (0xe < iVar11) { piVar17 = &player->_damageCooldown; } player->_damageCooldown = *piVar17; } if (local_8d != '\0') { EntityRef::constructor((EntityRef *)(local_50 + 4),(Entity *)player); Entity::AddBurn((Entity *)EVar19,(EntityRef *)(local_50 + 4),0x5a,0.0,0); } } if ((pEVar18->_variant == 9) && (cVar8 = drain_notched_axe(2), cVar8 != '\0')) { DAT_00c7ac6c = (Entity_Player *)0x0; EntityList_Query::~EntityList_Query(&queryResults); ExceptionList = local_1c; return; } local_100.x = ((Vector *)((int)EVar19 + 0x33c))->x; local_100.y = *(float *)((int)EVar19 + 0x340); apply_hit_effects(pEVar18,&tipPos,(Entity *)EVar19,&local_100, *(float *)((int)EVar19 + 0x370),damage, CONCAT44(local_9c,local_bc),0); } if ((((*(float *)((int)EVar19 + 0x14) < *(float *)((int)EVar19 + 0x380)) && (pEVar18->field_0x4e9 == '\0')) && (pEVar18->_isFlying == 0)) && (fVar21 = 0.0, local_d4 != (EntityPtr)0x0)) { fVar22 = *(float *)((int)local_d4 + 0x36c); if (fVar22 != 0.0) { *(float *)((int)local_d4 + 0x360) = (-local_98 * (float)local_d0) / fVar22 + *(float *)((int)local_d4 + 0x360); *(float *)((int)local_d4 + 0x364) = (-(float)local_94 * (float)local_d0) / fVar22 + *(float *)((int)local_d4 + 0x364); } pEVar18->field_0x4e9 = 1; if ((local_7d != '\0') && (*(int *)((int)local_d4 + 0x28) != 2)) { pEVar18->field_0x466 = 0; local_d8 = CONCAT31(local_d8._1_3_,1); goto LAB_0096a6af; } } fVar21 = 0.0; local_d8 = CONCAT31(local_d8._1_3_,1); goto LAB_0096a6af; } } LAB_0096a6a9: fVar21 = 0.0; } } LAB_0096a6af: local_7c = local_7c + 1; if ((uint)queryResults._size <= local_7c) break; this = knife; } while( true ); } if (((char)local_d8 == '\0') || (player == (Entity_Player *)0x0)) { this = knife; } else { bVar7 = Entity_Player::HasCollectible(player,0x175,0); this = knife; if (bVar7 != 0) { pvVar15 = knife[1]._damageEvents._begin; if (pvVar15 != (void *)0x0) { if (*(char *)((int)pvVar15 + 0x4e4) == '\0') { Entity_Player::AddDeadEyeCharge(player); } *(undefined1 *)((int)pvVar15 + 0x4e4) = 1; } } } local_14 = 0xffffffff; if (this->_variant == 9) { DAT_00c7ac6c = (Entity_Player *)0x0; } if (queryResults._0_1_ == '\0') { local_14 = 1; tracked_alloc(1,queryResults._data,0); local_14 = 0xffffffff; } } } if (this->_subtype == 4) goto LAB_0096ae0c; if (0 < *(short *)(this + 1)) { sVar9 = *(short *)&this[1].field_0x2; if (((int)sVar9 & 1U) == 0) { local_d0 = this->_parent; if ((local_d0 != (EntityPtr)0x0) && (*(int *)((int)local_d0 + 0x28) == 8)) { local_d0 = *(EntityPtr *)((int)local_d0 + 0x3bc); } EVar19 = local_d0; local_d4 = (EntityPtr)((int)sVar9 / 2 & 0xffffff01); if (baseVariant == 1) { curAnimName = ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState,(std_string *)local_68) ; local_e8 = 1.4013e-45; puVar1 = &curAnimName->_size; if (0xf < curAnimName->_capacity) { curAnimName = *(std_string **)curAnimName->_buf; } bVar7 = str_eq((byte *)curAnimName,*puVar1,(byte *)"Swing2",6); local_7d = '\x01'; if (bVar7 == 0) goto LAB_0096a80d; } else { LAB_0096a80d: local_7d = '\0'; } if (((uint)local_e8 & 1) != 0) { std::string::_Tidy_deallocate(local_68); } if (local_7d != '\0') { local_d4 = (EntityPtr)((uint)local_d4 ^ 1); } if (EVar19 != (EntityPtr)0x0) { if (*(int *)((int)EVar19 + 0x28) == 1) { local_e8 = (*(float *)((int)EVar19 + 0x1480) - 260.0) * 0.15; if (local_e8 <= 0.0) { local_e8 = 0.0; } local_e8 = local_e8 + 4.0; local_104 = local_e8; } else { local_e8 = 4.0; } if (this->_variant == 3) { auVar24 = ZEXT812(0x41a00000); if (auVar24._0_4_ <= local_e8) { auVar24._4_8_ = auVar24._4_8_; auVar24._0_4_ = local_e8; } local_104 = auVar24._0_4_; local_e8 = local_104; } local_b8 = CONCAT44((this->_sprite)._scale.x,(undefined4)local_b8); uVar14 = Random(); local_168.x = *(float *)((int)EVar19 + 0x33c); local_168.y = *(float *)((int)EVar19 + 0x340); uVar31 = 0; pTVar30 = &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor; pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar28 = 0; spawnedEntity = Game::Spawn(g_game,8,this->_variant,&local_168,&g_vectorZero, (Entity *)this->_spawnerEntity,4,uVar14); pEVar18 = (Entity_Knife *)__RTDynamicCast(spawnedEntity,uVar28,pTVar29,pTVar30,uVar31); local_c0 = pEVar18; if (pEVar18 == this) { (**(code **)(*(int *)this + 0x28))(); ExceptionList = local_1c; return; } Entity::SetParent((Entity *)pEVar18,(Entity *)local_d0); sVar9 = *(short *)&this[1].field_0x2; (pEVar18->_targetPosition).y = 0.0; if (sVar9 == 0) { (pEVar18->_targetPosition).x = local_104; pEVar18->_rotation = this->_rotation + this->_rotationOffset; } else { (pEVar18->_targetPosition).x = local_b8._4_4_ * 5.0 * (float)(int)sVar9 + local_e8; uVar14 = Random(); pEVar18->_rotation = ((float)((double)(int)uVar14 + __uint_to_double_fixup[-((int)uVar14 >> 0x1f)]) * 2.3283064e-10 * 30.0 - 15.0) + this->_rotation + this->_rotationOffset; uVar14 = Random(); SoundEffects::PlayWithFartOverride (0xfc,1.0,1,0, (float)((double)(int)uVar14 + __uint_to_double_fixup[-((int)uVar14 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); } pEVar18->_mass = this->_mass; (pEVar18->_posOffset).x = (this->_posOffset).x; (pEVar18->_posOffset).y = (this->_posOffset).y; (**(code **)(*(int *)pEVar18 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); (pEVar18->_sprite)._scale.x = (this->_sprite)._scale.x; (pEVar18->_sprite)._scale.y = (this->_sprite)._scale.y; uVar28 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); tearFlagsHigh = (this->_tearFlags)._h; uVar31 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); iVar11 = *(int *)pEVar18; *(int *)&(pEVar18->_tearFlags)._l = (int)(this->_tearFlags)._l; *(undefined4 *)((int)&(pEVar18->_tearFlags)._l + 4) = uVar28; *(int *)&(pEVar18->_tearFlags)._h = (int)tearFlagsHigh; *(undefined4 *)((int)&(pEVar18->_tearFlags)._h + 4) = uVar31; (**(code **)(iVar11 + 0x40))(this->_collisionDamage); EntityPtr::SetReference((EntityPtr *)&pEVar18[1]._damageEvents,(Entity *)this); EntityPtr::SetReference((EntityPtr *)&this[1]._damageEvents._end,(Entity *)pEVar18); if (baseVariant == 1) { anim = "Swing"; if (local_d4._0_1_ == '\0') { anim = "Swing2"; } ANM2::Play(&pEVar18->_sprite,(byte *)anim,1); SetAttackAnimation(pEVar18); } else if (baseVariant == 10) { if (this->_isFlying != 0) { (pEVar18->_pos).x = (this->_pos).x; (pEVar18->_pos).y = (this->_pos).y; } if (this->_isSpinAttack == 0) { SetAttackAnimation(pEVar18); } else { iVar11 = ANM2::GetFrame(&this->_sprite); SpinAttack(pEVar18,1,iVar11); } (pEVar18->_sprite)._rotation = (this->_sprite)._rotation; } (**(code **)(*(int *)pEVar18 + 0xc))(); if (player != (Entity_Player *)0x0) { bVar7 = Entity_Player::HasCollectible(player,0x44,0); if (bVar7 != 0) { fVar21 = normalize_angle_degrees(this->_rotationOffset); local_b8 = CONCAT44(((fVar21 * 60.0) / 180.0 + tipRadius + tipDistance) * scaleY, (undefined4)local_b8); uVar14 = Random(); ownerPlayer = player; local_f8.x = (pEVar18->_pos).x; local_f8.y = (pEVar18->_pos).y; uVar31 = 0; pTVar30 = &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor; pTVar29 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar28 = 0; spawnedEntity = Game::Spawn(g_game,7,2,&local_f8,&g_vectorZero,(Entity *)player,3,uVar14); spawnedEntity = (Entity *)__RTDynamicCast(spawnedEntity,uVar28,pTVar29,pTVar30,uVar31); laserColor = Entity_Player::get_laser_color_copy(ownerPlayer,(ColorMod *)local_50); (**(code **)(*(int *)spawnedEntity + 0x3c))(laserColor,0xffffffff,0xff,0,1); this = knife; (spawnedEntity->_posOffset).x = (knife->_posOffset).x; (spawnedEntity->_posOffset).y = (knife->_posOffset).y; Entity::SetParent(spawnedEntity,(Entity *)local_c0); iVar11 = *(int *)spawnedEntity; spawnedEntity->_renderDepthOffset = 3000.0; iVar13 = *(int *)((int)&(this->_tearFlags)._l + 4); tearFlagsHigh = (this->_tearFlags)._h; iVar20 = *(int *)((int)&(this->_tearFlags)._h + 4); *(int *)((int)&spawnedEntity[1]._pendingDamageFlags + 4) = (int)(this->_tearFlags)._l; spawnedEntity[1]._index = iVar13; spawnedEntity[1]._collisionIndex = (int)tearFlagsHigh; spawnedEntity[1]._type = iVar20; (**(code **)(iVar11 + 0x40))(this->_collisionDamage); *(undefined1 *)((int)spawnedEntity[1]._sprite._color._colorize + 9) = 1; spawnedSprite = &spawnedEntity[1]._sprite; (spawnedSprite->_filename)._buf[4] = '\x03'; (spawnedSprite->_filename)._buf[5] = '\0'; (spawnedSprite->_filename)._buf[6] = '\0'; (spawnedSprite->_filename)._buf[7] = '\0'; spawnedEntity[1]._sprite._overlayAnimState._currentlyTriggeredEvents = (int)local_b8._4_4_; Entity::SetSpawnerEntity(spawnedEntity,(Entity *)player); (**(code **)(*(int *)spawnedEntity + 0xc))(); pEVar18 = local_c0; } if ((((EntityPtr)player == local_d0) && (local_a9 == '\0')) && (bVar7 = Entity_Player::HasCollectible(player,0x19a,0), bVar7 != 0)) { iVar13 = 0xf - (int)player->_luck; iVar11 = 5; if (5 < iVar13) { iVar11 = iVar13; } iVar11 = Isaac::Random(iVar11); if (iVar11 == 0) { uVar14 = Random(); fVar21 = pEVar18->_rotation * 0.017453292; local_b8 = CONCAT44(fVar21,(undefined4)local_b8); local_f8.x = cos(fVar21); local_f8.x = local_f8.x * 3.0; local_f8.y = sin(local_b8._4_4_); this = knife; local_f0.x = (pEVar18->_pos).x; local_f8.y = local_f8.y * 3.0; local_f0.y = (pEVar18->_pos).y; spawnedEntity = Game::Spawn(g_game,1000,0x54,&local_f0,&local_f8,(Entity *)knife->_spawnerEntity, 10,uVar14); Entity::SetParent(spawnedEntity,(Entity *)player); } } } } *(short *)(this + 1) = *(short *)(this + 1) + -1; sVar9 = *(short *)&this[1].field_0x2; } *(short *)&this[1].field_0x2 = sVar9 + 1; } if ((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) && ((player != (Entity_Player *)0x0 && (this->_isPrimaryClub != 0)))) { if (this->_isDeadEyeHit == 0) { Entity_Player::ClearDeadEyeCharge(player); } this->_isDeadEyeHit = 0; } LAB_0096ae0c: if ((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) || ((baseVariant == 10 && ((this->field_0x466 != '\0' && (bVar7 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,(byte *)"SwingEnd"), bVar7 != 0)))))) { this->_isSwinging = 0; } ExceptionList = local_1c; return; } //@@ 0096ae70 Entity_Knife::apply_hit_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (pos, Entity target, targetPos, size, damage, 0, 0, isFlying) from Entity_Knife::HandleCollision after ApplyTearFlagEffects: Bone Club (GetBaseVariant==1) bomb tear flags -> BombTearflagEffects/BombDamage, gfx/tears_brokenbone.png shards, Game::Spawn prototype: db/protos.zhl, confirmed by RET 32 */ void __thiscall Entity_Knife::apply_hit_effects (Entity_Knife *this,Vector *pos,Entity *target,Vector *targetPos,float targetSize, float damage,ulonglong damageFlags,byte isFlying) { qword *pqVar1; ColorMod *pCVar2; ColorMod *pCVar3; void *pvVar4; void *pvVar5; float fVar6; float fVar7; BitSet128 flags; byte bVar8; uint uVar9; int iVar10; BitSet128 *pBVar11; BitSet128 *pBVar12; Entity *pEVar13; int *spawnedEffect; Vector *randomDir; Entity_Knife **ppEVar14; uint rngValue; Entity_Knife *pEVar15; Entity_Tear *spawnedTear; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; void *pvVar16; BitSet128 *a; EntityPtr EVar17; float fVar18; uint *puVar19; undefined4 rngValue; TypeDescriptor *pTVar21; TypeDescriptor *pTVar22; BitSet128 *pBVar23; undefined4 uVar24; BitSet128 *pBVar25; BitSet128 *pBVar26; BitSet128 *pBVar27; BitSet128 *pBVar28; BitSet128 local_150; BitSet128 local_140; BitSet128 local_130; BitSet128 local_120; BitSet128 local_110; BitSet128 local_100; BitSet128 local_f0; undefined1 local_e0 [8]; Vector VStack_d8; Vector shardSpawnPos; BitSet128 local_c8; undefined1 local_b8 [8]; Vector local_b0; Vector hitPos; float local_a0; float local_9c; Entity *local_98; float shardSpeed; float tearHeight; float hitDirY; float hitDirX; byte isGuppy; Entity_Knife *local_80; EntityPtr player; Entity_Knife *local_78; Vector local_74; Entity *local_6c; char isProcEffects; Entity_Knife *local_64; Entity_Knife *local_60; Entity_Knife *local_5c; Entity_Knife *local_58; Entity_Tear *local_54; undefined1 local_50 [32]; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; code *setColorFn; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0c9cd; local_1c = ExceptionList; uVar9 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; local_98 = target; local_a0 = damage; local_64 = this; local_24 = uVar9; player = (EntityPtr)GetPlayer(this); local_78 = (Entity_Knife *)(this->_sprite)._scale.y; tearHeight = -15.0; if (player == (EntityPtr)0x0) { local_80 = (Entity_Knife *)0x0; local_9c = 0.0; shardSpeed = 10.0; } else { tearHeight = *(float *)((int)player + 0x1474); local_80 = *(Entity_Knife **)((int)player + 0x1478); local_9c = *(float *)((int)player + 0x147c); shardSpeed = *(float *)((int)player + 0x1464) * 10.0; } hitDirX = targetPos->x - pos->x; hitDirY = targetPos->y - pos->y; fVar18 = sqrtf(hitDirX * hitDirX + hitDirY * hitDirY); if (0.0 < fVar18) { hitDirY = hitDirY * (1.0 / fVar18); hitDirX = hitDirX * (1.0 / fVar18); } hitPos.y = targetPos->y - hitDirY * targetSize; hitPos.x = targetPos->x - hitDirX * targetSize; shardSpawnPos.y = hitPos.y - hitDirY * 8.0 * (float)local_78; shardSpawnPos.x = hitPos.x - hitDirX * 8.0 * (float)local_78; if ((isFlying == 0) && (iVar10 = GetBaseVariant(this), iVar10 == 1)) { pBVar12 = &this->_tearFlags; pBVar11 = BitSet128::operator_and((BitSet128 *)local_b8,pBVar12,&g_tearFlagExplosive); if (((int)pBVar11->_l != 0 || *(int *)((int)&pBVar11->_l + 4) != 0) || ((int)pBVar11->_h != 0 || *(int *)((int)&pBVar11->_h + 4) != 0)) { Game::BombTearflagEffects (&hitPos,0x42700000,(int)pBVar12->_l, *(undefined4 *)((int)&(this->_tearFlags)._l + 4),(int)(this->_tearFlags)._h, *(undefined4 *)((int)&(this->_tearFlags)._h + 4),this,0x3f800000,uVar9); Game::BombDamage(g_game,&hitPos,local_a0 * 0.5,60.0,1,(Entity *)this,*pBVar12,damageFlags | 4, 0); pBVar12 = BitSet128::operator_and((BitSet128 *)local_b8,pBVar12,&g_tearFlagPoison); if (((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) { uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,1000,7,&hitPos,&g_vectorZero,(Entity *)0x0,0,uVar9); spawnedEffect = (int *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); uVar9 = Random(); setColorFn = *(code **)(*spawnedEffect + 0x3c); fVar18 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 + 1.0; spawnedEffect[0x39] = (int)fVar18; spawnedEffect[0x3a] = (int)fVar18; Color::Reset((Color *)local_50); local_30 = 0.0; local_50._0_4_ = 0.02; local_50._4_4_ = 0.9; local_50._8_4_ = 0.02; local_50._12_4_ = 1.0; local_2c = 0.33333334; local_28 = 0.0; (*setColorFn)(local_50,0xffffffff,0xff,0,1); (**(code **)(*spawnedEffect + 0xc))(); this = local_64; } uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,1000,1,&hitPos,&g_vectorZero,(Entity *)0x0,0,uVar9); spawnedEffect = (int *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); spawnedEffect[0xd3] = (int)(this->_posOffset).x; spawnedEffect[0xd4] = (int)(this->_posOffset).y; (**(code **)(*spawnedEffect + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); pBVar12 = &this->_tearFlags; } pBVar11 = BitSet128::operator_and((BitSet128 *)local_b8,pBVar12,(BitSet128 *)&DAT_00c34960); if (((int)pBVar11->_l == 0 && *(int *)((int)&pBVar11->_l + 4) == 0) && ((int)pBVar11->_h == 0 && *(int *)((int)&pBVar11->_h + 4) == 0)) { pBVar12 = BitSet128::operator_and((BitSet128 *)local_b8,pBVar12,(BitSet128 *)&DAT_00c34880); if (((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) { randomDir = MusicManager::RandomVector(&local_b0); EVar17 = player; local_60 = (Entity_Knife *)(shardSpeed * randomDir->x); local_58 = (Entity_Knife *)(shardSpeed * randomDir->y); local_6c = (Entity *)0x0; do { if ((int)local_6c < 2) { local_74.x = (float)local_60; local_74.y = (float)local_58; } else { local_74.y = (float)((uint)local_60 ^ 0x80000000); local_74.x = (float)local_58; } if (((uint)local_6c & 1) != 0) { local_74.x = (float)((uint)local_74.x ^ 0x80000000); local_74.y = (float)((uint)local_74.y ^ 0x80000000); } uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,2,0x1d,&shardSpawnPos,&local_74,(Entity *)EVar17,0,uVar9); local_54 = (Entity_Tear *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); local_5c = (Entity_Knife *)&local_54->_sprite; local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = (void *)0x0; std::string::assign(local_50 + 0x14,(byte *)"gfx/tears_brokenbone.png",0x18); local_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)local_5c,0,(std_string *)(local_50 + 0x14)); local_14 = 0xffffffff; bVar8 = extraout_CL; if (0xf < (uint)local_28) { uVar9 = (int)local_28 + 1; pvVar16 = (void *)local_50._20_4_; if (0xfff < uVar9) { pvVar16 = *(void **)(local_50._20_4_ + -4); uVar9 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar16))) goto LAB_0096c66a; } operator_delete(pvVar16,uVar9); bVar8 = extraout_CL_00; } ANM2::LoadGraphics((ANM2 *)local_5c,bVar8); Entity_Projectile::SetHeight((Entity_Projectile *)local_54,tearHeight * 0.65); local_54->_fallingAccel = local_9c; local_5c = local_80; if (0.0 < (float)local_80) { local_5c = (Entity_Knife *)((float)local_80 * 0.3); } uVar9 = Random(); local_54->_fallingSpeed = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.2 - (float)local_5c; (**(code **)(*(int *)local_54 + 0x40))(this->_collisionDamage * 0.5); pBVar28 = (BitSet128 *)&DAT_00c34780; pBVar27 = (BitSet128 *)&DAT_00c345e0; pBVar26 = (BitSet128 *)&DAT_00c34b40; pBVar25 = (BitSet128 *)&DAT_00c345c0; pBVar23 = (BitSet128 *)&DAT_00c348f0; pBVar11 = &g_tearFlagLudovico; puVar19 = &DAT_00c34850; pBVar12 = BitSet128::operator_or ((BitSet128 *)local_b8,&g_tearFlagExplosive,(BitSet128 *)&DAT_00c34880 ); pBVar12 = BitSet128::operator_or((BitSet128 *)local_e0,pBVar12,(BitSet128 *)puVar19); pBVar12 = BitSet128::operator_or(&local_150,pBVar12,pBVar11); pBVar12 = BitSet128::operator_or(&local_140,pBVar12,pBVar23); pBVar12 = BitSet128::operator_or(&local_110,pBVar12,pBVar25); pBVar12 = BitSet128::operator_or(&local_120,pBVar12,pBVar26); pBVar12 = BitSet128::operator_or(&local_130,pBVar12,pBVar27); pBVar12 = BitSet128::operator_or(&local_f0,pBVar12,pBVar28); pBVar12 = BitSet128::__bnot(pBVar12,&local_100); pBVar12 = BitSet128::operator_and(&local_c8,&this->_tearFlags,pBVar12); Entity_Tear::SetTearFlags(local_54,*pBVar12); local_64 = local_78; local_5c = (Entity_Knife *)0x3c23d70a; ppEVar14 = &local_64; if ((float)local_78 <= 0.01) { ppEVar14 = &local_5c; } pEVar15 = *ppEVar14; local_54->_baseScale = (float)pEVar15; local_54->_fScale = (float)pEVar15; Entity_Tear::ResetSpriteScale(local_54); (**(code **)(*(int *)local_54 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); local_5c = (Entity_Knife *)&local_54->_parent; if (*(EntityPtr *)local_5c != (EntityPtr)0x0) { local_64 = local_5c; std::multiset::erase(&local_64); } *(EntityPtr *)local_5c = EVar17; if (EVar17 != (EntityPtr)0x0) { std::multiset::insert(local_5c); } (**(code **)(*(int *)local_54 + 0xc))(); local_6c = (Entity *)&local_6c->field_0x1; } while ((int)local_6c < 4); goto LAB_0096c089; } } else { uVar9 = Random(); local_9c = (float)(uVar9 % 6 + 6); if (local_9c != 0.0) { local_64 = (Entity_Knife *)((float)local_78 / 1.5); local_5c = (Entity_Knife *)0x3c23d70a; local_54 = (Entity_Tear *)(tearHeight * 0.5); do { uVar9 = Random(); rngValue = Random(); fVar18 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_58 = (Entity_Knife *)(fVar18 + fVar18); local_60 = (Entity_Knife *)sin((float)local_58); fVar18 = cos((float)local_58); local_74.x = fVar18 * shardSpeed; uVar24 = 0; local_74.y = (float)local_60 * shardSpeed; pTVar22 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,2,1,&shardSpawnPos,&local_74,(Entity *)player,0,uVar9); spawnedTear = (Entity_Tear *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); pBVar26 = (BitSet128 *)&DAT_00c34780; pBVar25 = &g_tearFlagExplosive; pBVar23 = (BitSet128 *)&DAT_00c34960; pBVar11 = (BitSet128 *)&DAT_00c34b40; pBVar12 = BitSet128::operator_or(&local_c8,(BitSet128 *)&DAT_00c345c0,&g_tearFlagLudovico) ; pBVar12 = BitSet128::operator_or(&local_100,pBVar12,pBVar11); pBVar12 = BitSet128::operator_or(&local_f0,pBVar12,pBVar23); pBVar12 = BitSet128::operator_or(&local_130,pBVar12,pBVar25); pBVar12 = BitSet128::operator_or(&local_120,pBVar12,pBVar26); pBVar12 = BitSet128::__bnot(pBVar12,&local_110); pBVar12 = BitSet128::operator_and(&local_140,&this->_tearFlags,pBVar12); Entity_Tear::SetTearFlags(spawnedTear,*pBVar12); uVar9 = Random(); local_58 = (Entity_Knife *) ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.75); (**(code **)(*(int *)spawnedTear + 0x40)) ((this->_collisionDamage / 1.5) * (float)local_58); local_58 = (Entity_Knife *)((float)local_64 * (float)local_58); ppEVar14 = &local_58; if ((float)local_58 <= 0.01) { ppEVar14 = &local_5c; } pEVar15 = *ppEVar14; spawnedTear->_baseScale = (float)pEVar15; spawnedTear->_fScale = (float)pEVar15; Entity_Tear::ResetSpriteScale(spawnedTear); Entity_Projectile::SetHeight((Entity_Projectile *)spawnedTear,-15.0); uVar9 = Random(); spawnedTear->_fallingAccel = 1.3; spawnedTear->_fallingSpeed = ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.75 + 0.5) * (float)local_54; (**(code **)(*(int *)spawnedTear + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); (**(code **)(*(int *)spawnedTear + 0xc))(); uVar9 = Random(); VStack_d8.x = (spawnedTear->_velocity).x * 1.1; local_b0.y = (spawnedTear->_pos).y; VStack_d8.y = (spawnedTear->_velocity).y * 1.1; local_b0.x = (spawnedTear->_pos).x; local_6c = Game::Spawn(g_game,1000,0x6f,&local_b0,&VStack_d8,(Entity *)0x0,0,uVar9); uVar9 = Random(); (local_6c->_sprite)._playbackSpeed = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.5; local_60 = (Entity_Knife *)(spawnedTear->_fScale * g_vectorOne.y * 0.5); local_58 = (Entity_Knife *)(spawnedTear->_fScale * g_vectorOne.x * 0.5); uVar9 = Random(); pCVar2 = &(local_6c->_sprite)._color; fVar18 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.6; (local_6c->_sprite)._scale.y = fVar18 * (float)local_60; (local_6c->_sprite)._scale.x = fVar18 * (float)local_58; (local_6c->_posOffset).x = (spawnedTear->_posOffset).x; (local_6c->_posOffset).y = (spawnedTear->_posOffset).y; pCVar3 = &(this->_sprite)._color; local_6c->_renderZOffset = -400; if (pCVar2 != pCVar3) { pvVar16 = ((std_vector *)((this->_sprite)._color._tint + 1))->_begin; pvVar4 = (void *)(this->_sprite)._color._tint[2]; pvVar5 = (void *)(this->_sprite)._color._tint[3]; pCVar2->_tint[0] = pCVar3->_tint[0]; (local_6c->_sprite)._color._tint[1] = (float)pvVar16; (local_6c->_sprite)._color._tint[2] = (float)pvVar4; (local_6c->_sprite)._color._tint[3] = (float)pvVar5; fVar18 = (this->_sprite)._color._colorize[1]; fVar6 = (this->_sprite)._color._colorize[2]; fVar7 = (this->_sprite)._color._colorize[3]; (local_6c->_sprite)._color._colorize[0] = (this->_sprite)._color._colorize[0]; (local_6c->_sprite)._color._colorize[1] = fVar18; (local_6c->_sprite)._color._colorize[2] = fVar6; (local_6c->_sprite)._color._colorize[3] = fVar7; *(undefined8 *)(local_6c->_sprite)._color._offset = *(undefined8 *)(this->_sprite)._color._offset; (local_6c->_sprite)._color._offset[2] = (this->_sprite)._color._offset[2]; } (**(code **)(*(int *)local_6c + 0xc))(); local_9c = (float)((int)local_9c + -1); } while (local_9c != 0.0); local_9c = 0.0; } } } else { if ((this->_variant == 2) || (this->_variant == 0)) { uVar9 = Random(); isProcEffects = '\0'; if ((uVar9 & 3) == 0) goto LAB_0096ba99; } else { LAB_0096ba99: isProcEffects = '\x01'; } if ((isFlying != 0) && (0.0 < this->_knifeVelocity)) { pBVar12 = &this->_usedTearFlags; pBVar11 = BitSet128::__bnot(pBVar12,&local_c8); BitSet128::operator_and((BitSet128 *)local_b8,&this->_tearFlags,pBVar11); pBVar11 = BitSet128::operator_and(&local_c8,a,(BitSet128 *)&DAT_00c34850); if ((((int)pBVar11->_l != 0 || *(int *)((int)&pBVar11->_l + 4) != 0) || ((int)pBVar11->_h != 0 || *(int *)((int)&pBVar11->_h + 4) != 0)) && (iVar10 = GetBaseVariant(this), iVar10 == 0)) { *(uint *)&pBVar12->_l = (uint)pBVar12->_l | DAT_00c34850; puVar19 = (uint *)((int)&(this->_usedTearFlags)._l + 4); *puVar19 = *puVar19 | DAT_00c34854; pqVar1 = &(this->_usedTearFlags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | DAT_00c34858; puVar19 = (uint *)((int)&(this->_usedTearFlags)._h + 4); *puVar19 = *puVar19 | DAT_00c3485c; local_54 = (Entity_Tear *)0x0; do { uVar9 = Random(); pEVar15 = (Entity_Knife *) Game::SpawnEx(g_game,8,0,&this->_pos,&g_vectorZero,(Entity *)this,0,uVar9,1); if (pEVar15 != (Entity_Knife *)0x0) { if (pEVar15->_parent != (EntityPtr)0x0) { local_58 = (Entity_Knife *)&pEVar15->_parent; std::multiset::erase(&local_58); } pEVar15->_parent = (EntityPtr)this; std::multiset::insert(&pEVar15->_parent); copy_parent_state(pEVar15,this); *(float *)&pEVar15[1]._pendingDamageFlags = this->_knifeDistance; if (local_54 == (Entity_Tear *)0x0) { rngValue = 0x42b40000; } else { rngValue = 0xc2b40000; } *(undefined4 *)((int)&pEVar15[1]._pendingDamageFlags + 4) = rngValue; pEVar15->_isUsingParentHitList = 1; fVar18 = (this->_sprite)._scale.y; (pEVar15->_sprite)._scale.x = (this->_sprite)._scale.x * 0.8; (pEVar15->_sprite)._scale.y = fVar18 * 0.8; } local_54 = (Entity_Tear *)((int)local_54 + 1); } while (local_54 < 2); } pBVar12 = BitSet128::operator_and(&local_c8,(BitSet128 *)local_b8,&g_tearFlagExplosive); if ((((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) && (iVar10 = GetBaseVariant(this), iVar10 != 10)) { *(uint *)&(this->_usedTearFlags)._l = (uint)(this->_usedTearFlags)._l | (uint)g_tearFlagExplosive._l; puVar19 = (uint *)((int)&(this->_usedTearFlags)._l + 4); *puVar19 = *puVar19 | g_tearFlagExplosive._l._4_4_; pqVar1 = &(this->_usedTearFlags)._h; *(uint *)pqVar1 = (uint)*pqVar1 | (uint)g_tearFlagExplosive._h; puVar19 = (uint *)((int)&(this->_usedTearFlags)._h + 4); *puVar19 = *puVar19 | g_tearFlagExplosive._h._4_4_; local_58 = (Entity_Knife *)(this->_rotation * 0.017453292); local_60 = (Entity_Knife *)sin((float)local_58); fVar18 = cos((float)local_58); local_74.x = fVar18 * 8.0 + (this->_pos).x; local_74.y = (float)local_60 * 8.0 + (this->_pos).y; Game::BombTearflagEffects (&local_74,0x42700000,(int)(this->_tearFlags)._l, *(undefined4 *)((int)&(this->_tearFlags)._l + 4),(int)(this->_tearFlags)._h, *(undefined4 *)((int)&(this->_tearFlags)._h + 4),this,0x3f800000); EVar17 = this->_spawnerEntity; local_6c = (Entity *)&DAT_00000004; fVar18 = this->_charge * 4.0 + 2.0; if (fVar18 <= 2.0) { fVar18 = 2.0; } if (6.0 <= fVar18) { fVar18 = 6.0; } local_54 = (Entity_Tear *)(fVar18 * this->_collisionDamage + 10.0); if ((((EVar17 != (EntityPtr)0x0) && (*(int *)((int)EVar17 + 0x28) == 1)) && ((isGuppy = Entity_Player::HasPlayerForm((Entity_Player *)EVar17,0), isGuppy != 0 || (bVar8 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x97,0), bVar8 != 0)))) && (((this->_spawnerType != 3 && (uVar9 = Random(), uVar9 % 6 == 0)) || ((isGuppy != 0 && (*(int *)((int)EVar17 + 0x136c) < 0x1e)))))) { local_6c = (Entity *)0x4004; } fVar18 = sqrtf((float)local_54 / 31.0); local_60 = (Entity_Knife *)0x428c0000; local_58 = (Entity_Knife *)(fVar18 * 60.0); ppEVar14 = &local_58; if (70.0 <= fVar18 * 60.0) { ppEVar14 = &local_60; } fVar18 = (this->_sprite)._scale.x * (float)*ppEVar14; local_5c = (Entity_Knife *)(fVar18 / 60.0); Game::BombDamage(g_game,&local_74,(float)local_54,fVar18,1,(Entity *)this,this->_tearFlags, ZEXT48(local_6c),0); pBVar12 = BitSet128::operator_and(&local_c8,&this->_tearFlags,&g_tearFlagPoison); if (((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) { uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,1000,7,&local_74,&g_vectorZero,(Entity *)0x0,0,uVar9); spawnedEffect = (int *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); uVar9 = Random(); setColorFn = *(code **)(*spawnedEffect + 0x3c); fVar18 = ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 + 1.0) * (float)local_5c; spawnedEffect[0x39] = (int)fVar18; spawnedEffect[0x3a] = (int)fVar18; Color::Reset((Color *)local_50); local_30 = 0.0; local_50._0_4_ = 0.02; local_50._4_4_ = 0.9; local_50._8_4_ = 0.02; local_50._12_4_ = 1.0; local_2c = 0.33333334; local_28 = 0.0; (*setColorFn)(local_50,0xffffffff,0xff,0,1); (**(code **)(*spawnedEffect + 0xc))(); uVar9 = Random(); pEVar13 = Game::Spawn(g_game,1000,2,&local_74,&g_vectorZero,(Entity *)0x0,4,uVar9); setColorFn = *(code **)(*(int *)pEVar13 + 0x3c); Color::Reset((Color *)local_50); local_30 = 0.039215688; local_50._0_4_ = 0.02; local_50._4_4_ = 0.9; local_50._8_4_ = 0.02; local_50._12_4_ = 1.0; local_2c = 0.3921569; local_28 = 0.0; (*setColorFn)(local_50,0xffffffff,0xff,0,1); iVar10 = *(int *)pEVar13; (pEVar13->_sprite)._scale.x = (float)local_5c; pEVar13->_renderDepthOffset = -5.0; (pEVar13->_sprite)._scale.y = (float)local_5c * 0.4; (**(code **)(iVar10 + 0xc))(); this = local_64; } uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,1000,1,&local_74,&g_vectorZero,(Entity *)0x0,0,uVar9); spawnedEffect = (int *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); spawnedEffect[0xd3] = (int)(this->_posOffset).x; spawnedEffect[0xd4] = (int)(this->_posOffset).y; if ((float)local_5c != 1.0) { spawnedEffect[0x3a] = (int)((float)local_5c * (float)spawnedEffect[0x3a]); spawnedEffect[0x39] = (int)((float)local_5c * (float)spawnedEffect[0x39]); } (**(code **)(*spawnedEffect + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); } } if (isProcEffects == '\0') { ExceptionList = local_1c; return; } } EVar17 = player; LAB_0096c089: pBVar12 = BitSet128::operator_and(&local_c8,&this->_tearFlags,(BitSet128 *)&DAT_00c34850); if ((((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) && (iVar10 = GetBaseVariant(this), iVar10 != 0)) { hitDirY = hitDirY * shardSpeed; local_6c = (Entity *)0x0; hitDirX = -hitDirX * shardSpeed; do { local_74.x = hitDirY; local_74.y = hitDirX; if (local_6c == (Entity *)0x1) { local_74.x = (float)((uint)hitDirY ^ 0x80000000); local_74.y = (float)((uint)hitDirX ^ 0x80000000); } uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,2,0x1d,&shardSpawnPos,&local_74,(Entity *)EVar17,0,uVar9); local_54 = (Entity_Tear *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); local_64 = (Entity_Knife *)&local_54->_sprite; local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = (void *)0x0; std::string::assign(local_50 + 0x14,(byte *)"gfx/tears_brokenbone.png",0x18); local_14 = 1; Sprite::ReplaceSpritesheet((Sprite *)local_64,0,(std_string *)(local_50 + 0x14)); local_14 = 0xffffffff; bVar8 = extraout_CL_01; if (0xf < (uint)local_28) { uVar9 = (int)local_28 + 1; pvVar16 = (void *)local_50._20_4_; if (0xfff < uVar9) { pvVar16 = *(void **)(local_50._20_4_ + -4); uVar9 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar16))) goto LAB_0096c66a; } operator_delete(pvVar16,uVar9); bVar8 = extraout_CL_02; } ANM2::LoadGraphics((ANM2 *)local_64,bVar8); Entity_Projectile::SetHeight((Entity_Projectile *)local_54,tearHeight / 1.5); local_54->_fallingSpeed = (float)local_80; (**(code **)(*(int *)local_54 + 0x40))(this->_collisionDamage * 0.5); local_60 = (Entity_Knife *)0x3c23d70a; local_58 = local_78; ppEVar14 = &local_58; if ((float)local_78 <= 0.01) { ppEVar14 = &local_60; } pEVar15 = *ppEVar14; local_54->_baseScale = (float)pEVar15; local_54->_fScale = (float)pEVar15; Entity_Tear::ResetSpriteScale(local_54); pBVar25 = (BitSet128 *)&DAT_00c34780; pBVar23 = &g_tearFlagExplosive; pBVar11 = (BitSet128 *)&DAT_00c34b40; pBVar12 = BitSet128::operator_or(&local_c8,(BitSet128 *)&DAT_00c345c0,&g_tearFlagLudovico); pBVar12 = BitSet128::operator_or(&local_100,pBVar12,pBVar11); pBVar12 = BitSet128::operator_or(&local_f0,pBVar12,pBVar23); pBVar12 = BitSet128::operator_or(&local_130,pBVar12,pBVar25); pBVar12 = BitSet128::__bnot(pBVar12,&local_120); pBVar12 = BitSet128::operator_and(&local_110,&this->_tearFlags,pBVar12); Entity_Tear::SetTearFlags(local_54,*pBVar12); (**(code **)(*(int *)local_54 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); local_60 = (Entity_Knife *)&local_54->_parent; if (*(EntityPtr *)local_60 != (EntityPtr)0x0) { local_58 = local_60; std::multiset::erase(&local_58); } *(EntityPtr *)local_60 = EVar17; if (EVar17 != (EntityPtr)0x0) { std::multiset::insert(local_60); } (**(code **)(*(int *)local_54 + 0xc))(); local_6c = (Entity *)&local_6c->field_0x1; } while ((int)local_6c < 2); } pBVar12 = BitSet128::operator_and(&local_c8,&this->_tearFlags,(BitSet128 *)&DAT_00c348f0); if (((int)pBVar12->_l == 0 && *(int *)((int)&pBVar12->_l + 4) == 0) && ((int)pBVar12->_h == 0 && *(int *)((int)&pBVar12->_h + 4) == 0)) { LAB_0096c670: pBVar12 = BitSet128::operator_and(&local_c8,&this->_tearFlags,(BitSet128 *)&DAT_00c34900); if (((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) { pEVar13 = spawn_chain_lightning (&hitPos,this->_tearFlags,(Entity *)this->_spawnerEntity,local_a0 * 0.5); std::vector::assign(&this->_hitList); (**(code **)(*(int *)pEVar13 + 0xc))(); } pBVar12 = BitSet128::operator_and(&local_c8,&this->_tearFlags,(BitSet128 *)&DAT_00c34970); if ((((int)pBVar12->_l != 0 || *(int *)((int)&pBVar12->_l + 4) != 0) || ((int)pBVar12->_h != 0 || *(int *)((int)&pBVar12->_h + 4) != 0)) && (bVar8 = Room::IsPositionInRoom(g_game->_room,&hitPos,-10.0), bVar8 != 0)) { local_58 = (Entity_Knife *)(this->_collisionDamage * 0.5); Room::GetClampedPositionImpl(g_game->_room,&local_b0,&hitPos,0.0,0.0,0.0,0.0); uVar9 = Random(); pEVar13 = Game::Spawn(g_game,1000,0xb4,&local_b0,&g_vectorZero,(Entity *)this->_spawnerEntity, 0,uVar9); fVar18 = this->_scale * g_vectorOne.x; iVar10 = *(int *)pEVar13; (pEVar13->_sprite)._scale.y = this->_scale * g_vectorOne.y; (pEVar13->_sprite)._scale.x = fVar18; (**(code **)(iVar10 + 0x40))(local_58); rngValue = 0x3c; iVar10 = *(int *)pEVar13; if (1 < *(int *)&g_game->_deathmatchManager) { rngValue = 0x1e; } *(undefined4 *)(pEVar13[1]._sprite._filename._buf + 8) = rngValue; *(undefined4 *)(pEVar13[1]._sprite._filename._buf + 0xc) = rngValue; (**(code **)(iVar10 + 0xc))(); manager = g_manager; local_a0 = 1.52461e-42; seed_fart_sound_override((int *)&local_a0); SoundEffects::Play(&manager->_sfxManager,(int)local_a0,1.0,2,0,1.0,0.0); } pBVar12 = &this->_tearFlags; bVar8 = Entity::IsActiveEnemy(local_98,0); if (bVar8 != 0) { pBVar23 = (BitSet128 *)&DAT_00c34630; pBVar11 = BitSet128::operator_or (&local_c8,(BitSet128 *)&DAT_00c34930,(BitSet128 *)&DAT_00c34a50); pBVar11 = BitSet128::operator_or(&local_100,pBVar11,pBVar23); pBVar11 = BitSet128::operator_and(&local_f0,pBVar12,pBVar11); if (((int)pBVar11->_l != 0 || *(int *)((int)&pBVar11->_l + 4) != 0) || ((int)pBVar11->_h != 0 || *(int *)((int)&pBVar11->_h + 4) != 0)) { local_80 = (Entity_Knife *)(hitPos.y - (local_98->_pos).y); local_5c = (Entity_Knife *)(hitPos.x - (local_98->_pos).x); fVar18 = sqrtf((float)local_80 * (float)local_80 + (float)local_5c * (float)local_5c); if ((local_98->_size < fVar18) && (0.0 < fVar18)) { fVar18 = local_98->_size / fVar18; local_5c = (Entity_Knife *)((float)local_5c * fVar18); local_80 = (Entity_Knife *)((float)local_80 * fVar18); } pBVar11 = BitSet128::operator_and(&local_c8,pBVar12,(BitSet128 *)&DAT_00c34a50); if (((int)pBVar11->_l == 0 && *(int *)((int)&pBVar11->_l + 4) == 0) && ((int)pBVar11->_h == 0 && *(int *)((int)&pBVar11->_h + 4) == 0)) { pBVar11 = BitSet128::operator_and(&local_c8,pBVar12,(BitSet128 *)&DAT_00c34630); if (((int)pBVar11->_l == 0 && *(int *)((int)&pBVar11->_l + 4) == 0) && ((int)pBVar11->_h == 0 && *(int *)((int)&pBVar11->_h + 4) == 0)) { local_78 = (Entity_Knife *)0x13; } else { local_78 = (Entity_Knife *)0x30; } } else { local_78 = (Entity_Knife *)0x1a; } pBVar28 = (BitSet128 *)&DAT_00c34780; pBVar27 = (BitSet128 *)&DAT_00c345e0; pBVar26 = (BitSet128 *)&DAT_00c345c0; pBVar25 = (BitSet128 *)&DAT_00c348f0; pBVar23 = &g_tearFlagLudovico; pBVar11 = BitSet128::operator_or (&local_c8,(BitSet128 *)&DAT_00c34880,(BitSet128 *)&DAT_00c34850); pBVar11 = BitSet128::operator_or(&local_100,pBVar11,pBVar23); pBVar11 = BitSet128::operator_or(&local_f0,pBVar11,pBVar25); pBVar11 = BitSet128::operator_or(&local_130,pBVar11,pBVar26); pBVar11 = BitSet128::operator_or(&local_120,pBVar11,pBVar27); pBVar11 = BitSet128::operator_or(&local_110,pBVar11,pBVar28); pBVar11 = BitSet128::__bnot(pBVar11,&local_140); BitSet128::operator_and((BitSet128 *)local_e0,pBVar12,pBVar11); uVar9 = Random(); local_b0.x = (float)local_5c + (local_98->_pos).x; local_b0.y = (float)local_80 + (local_98->_pos).y; spawnedTear = (Entity_Tear *) Game::Spawn(g_game,2,(uint)local_78,&local_b0,&g_vectorZero, (Entity *)this->_spawnerEntity,0,uVar9); (**(code **)(*(int *)spawnedTear + 0xc))(); flags._l._4_4_ = local_e0._4_4_; flags._l._0_4_ = local_e0._0_4_; flags._h._0_4_ = VStack_d8.x; flags._h._4_4_ = VStack_d8.y; Entity_Tear::SetTearFlags(spawnedTear,flags); (**(code **)(*(int *)spawnedTear + 0x40))(this->_collisionDamage); fVar18 = this->_scale; if (fVar18 <= 0.01) { fVar18 = 0.01; } spawnedTear->_baseScale = fVar18; spawnedTear->_fScale = fVar18; Entity_Tear::ResetSpriteScale(spawnedTear); pEVar13 = local_98; g_forceCollideDepth = g_forceCollideDepth + 1; (**(code **)(*(int *)spawnedTear + 0x5c))(local_98,1); (**(code **)(*(int *)pEVar13 + 0x5c))(spawnedTear,0); g_forceCollideDepth = g_forceCollideDepth + -1; } } ExceptionList = local_1c; return; } local_64 = (Entity_Knife *)0x0; do { uVar9 = Random(); fVar18 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_58 = (Entity_Knife *)(fVar18 + fVar18); local_60 = (Entity_Knife *)sin((float)local_58); local_b0.x = cos((float)local_58); local_b0.x = local_b0.x * shardSpeed; local_b0.y = (float)local_60 * shardSpeed; uVar9 = Random(); uVar24 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; rngValue = 0; pEVar13 = Game::Spawn(g_game,2,0x1d,&shardSpawnPos,&local_b0,(Entity *)EVar17,0,uVar9); spawnedTear = (Entity_Tear *)__RTDynamicCast(pEVar13,rngValue,pTVar21,pTVar22,uVar24); local_2c = 0.0; local_28 = 2.10195e-44; local_50._20_4_ = (void *)0x0; std::string::assign(local_50 + 0x14,(byte *)"gfx/tears_brokenbone.png",0x18); local_14 = 2; Sprite::ReplaceSpritesheet((Sprite *)&spawnedTear->_sprite,0,(std_string *)(local_50 + 0x14)); local_14 = 0xffffffff; bVar8 = extraout_CL_03; if (0xf < (uint)local_28) { uVar9 = (int)local_28 + 1; pvVar16 = (void *)local_50._20_4_; if (0xfff < uVar9) { pvVar16 = *(void **)(local_50._20_4_ + -4); uVar9 = (int)local_28 + 0x24; if (0x1f < (uint)(local_50._20_4_ + (-4 - (int)pvVar16))) { LAB_0096c66a: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar16,uVar9); bVar8 = extraout_CL_04; } ANM2::LoadGraphics(&spawnedTear->_sprite,bVar8); spawnedTear->_height = tearHeight; fVar18 = Entity_Tear::get_height_offset_y(spawnedTear,tearHeight); game = g_game; (spawnedTear->_posOffset).y = fVar18; if ((*(int *)((int)game->_room + 8) == 0x10) && ((spawnedTear->_posOffset).y = -18.0, -5.1 < tearHeight)) { spawnedTear->_height = -5.1; } spawnedTear->_fallingSpeed = (float)local_80; (**(code **)(*(int *)spawnedTear + 0x40))(this->_collisionDamage * 0.5); pEVar15 = local_78; if ((float)local_78 <= 0.01) { pEVar15 = (Entity_Knife *)0x3c23d70a; } spawnedTear->_baseScale = (float)pEVar15; spawnedTear->_fScale = (float)pEVar15; Entity_Tear::ResetSpriteScale(spawnedTear); pBVar25 = (BitSet128 *)&DAT_00c34780; pBVar23 = &g_tearFlagExplosive; pBVar11 = (BitSet128 *)&DAT_00c34b40; pBVar12 = BitSet128::operator_or (&local_c8,(BitSet128 *)&DAT_00c345c0,(BitSet128 *)&DAT_00c348f0); pBVar12 = BitSet128::operator_or(&local_100,pBVar12,pBVar11); pBVar12 = BitSet128::operator_or(&local_f0,pBVar12,pBVar23); pBVar12 = BitSet128::operator_or(&local_130,pBVar12,pBVar25); pBVar12 = BitSet128::__bnot(pBVar12,&local_120); pBVar12 = BitSet128::operator_and(&local_110,&this->_tearFlags,pBVar12); Entity_Tear::SetTearFlags(spawnedTear,*pBVar12); (**(code **)(*(int *)spawnedTear + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); if (spawnedTear->_parent != (EntityPtr)0x0) { local_58 = (Entity_Knife *)&spawnedTear->_parent; std::multiset::erase(&local_58); } spawnedTear->_parent = player; if (player != (EntityPtr)0x0) { std::multiset::insert(&spawnedTear->_parent); } (**(code **)(*(int *)spawnedTear + 0xc))(); local_64 = (Entity_Knife *)&local_64->field_0x1; if (1 < (int)local_64) goto LAB_0096c670; EVar17 = player; } while( true ); } //@@ 0096cb60 Entity_Laser::Constructor /* ZHL [exact] __thiscall void Entity_Laser::Constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Laser::Constructor(Entity_Laser *this) { uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ca37; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; Entity::constructor((Entity *)this); local_8 = 0; *(undefined ***)this = IsaacRepentancePlus::Entity_Laser::vftable; (this->_parentOffset).y = 0.0; (this->_parentOffset).x = 0.0; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; *(undefined4 *)&(this->_activeTearFlags)._l = 0; *(undefined4 *)((int)&(this->_activeTearFlags)._l + 4) = 0; *(undefined4 *)&(this->_activeTearFlags)._h = 0; *(undefined4 *)((int)&(this->_activeTearFlags)._h + 4) = 0; *(undefined4 *)&(this->_heldTearFlags)._l = 0; *(undefined4 *)((int)&(this->_heldTearFlags)._l + 4) = 0; *(undefined4 *)&(this->_heldTearFlags)._h = 0; *(undefined4 *)((int)&(this->_heldTearFlags)._h + 4) = 0; HomingLaser::HomingLaser(uVar1); (this->_endPoint).y = 0.0; (this->_endPoint).x = 0.0; (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; this->_parentLaser = (EntityPtr)0x0; local_8 = CONCAT31(local_8._1_3_,3); _eh_vector_constructor_iterator_(this->_subLasers,4,2,FUN_0042a020,FUN_00579700); (this->_impactPosition).y = 0.0; (this->_impactPosition).x = 0.0; this->_continuumLaser = (EntityPtr)0x0; this->_tearWaitEffect = (EntityPtr)0x0; (this->_impactDirection).y = 0.0; (this->_impactDirection).x = 0.0; *(Entity_Laser **)&this->_homingLaser = this; ExceptionList = local_10; return; } //@@ 0096ccf0 Entity_Laser::Free /* ZHL [vtable slot 0] */ Entity_Laser * __thiscall Entity_Laser::Free(Entity_Laser *this,byte param_2) { destructor(); if ((param_2 & 1) != 0) { operator_delete(this,0x568); } return this; } //@@ 0096cd20 Entity_Laser::destructor /* DB: sets Entity_Laser::vftable, erases three multiset refs, destroys arrays/vectors; only caller Entity_Laser::Free */ void Entity_Laser::destructor(void) { Entity *pEVar1; float *pfVar2; Entity *in_ECX; Entity *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6770; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)in_ECX = IsaacRepentancePlus::Entity_Laser::vftable; pEVar1 = (Entity *)(in_ECX[1]._sprite._championColor._colorize + 1); local_14 = in_ECX; if (*(int *)pEVar1 != 0) { local_14 = pEVar1; std::multiset::erase(&local_14); *(int *)pEVar1 = 0; } pfVar2 = in_ECX[1]._sprite._championColor._colorize; if (*pfVar2 != 0.0) { local_14 = (Entity *)pfVar2; std::multiset::erase(&local_14); *pfVar2 = 0.0; } local_8 = 0xffffffff; _eh_vector_destructor_iterator_(in_ECX[1]._sprite._championColor._tint + 2,4,2,FUN_00579700); pEVar1 = (Entity *)(in_ECX[1]._sprite._championColor._tint + 1); if (*(int *)pEVar1 != 0) { local_14 = pEVar1; std::multiset::erase(&local_14); *(int *)pEVar1 = 0; } FID_conflict__Tidy(in_ECX[1]._sprite._color._offset + 1); FID_conflict__Tidy(&in_ECX[1]._sprite._overlayAnimState._layerFrames); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); Entity::destructor(in_ECX); ExceptionList = local_10; return; } //@@ 0096ce30 Entity_Laser::is_thick_variant /* DB: ? variants 1,3,6,9,11-15 true; laser update/render prototype: db/protos.zhl */ byte __thiscall Entity_Laser::is_thick_variant(Entity_Laser *this) { switch(this->_variant) { case 1: case 3: case 6: case 9: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return 1; default: return 0; } } //@@ 0096ce70 FUN_0096ce70 int FUN_0096ce70(void) { int in_ECX; while (*(int *)(in_ECX + 0x52c) != 0) { in_ECX = *(int *)(in_ECX + 0x52c); } return in_ECX + 0x520; } //@@ 0096ce90 Entity_NPC::SetAimAngle /* DB: ? sets 0x418/0x41c (prev to 0x420) and 0xec=angle-90; Pin/Vis/Raglich prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_NPC::SetAimAngle(Entity_NPC *this,float angle) { float fVar1; fVar1 = (this->_pathfinder)._movementTarget.y; (this->_pathfinder)._movementTarget.x = angle; (this->_pathfinder)._movementTarget.y = angle; (this->_pathfinder)._moveDirection.x = fVar1; (this->_sprite)._rotation = angle - 90.0; return; } //@@ 0096ced0 Entity_Laser::GetRenderZ /* ZHL [vtable slot 13] */ void __thiscall Entity_Laser::GetRenderZ(Entity_Laser *this) { floor((double)((this->_renderDepthOffset + (this->_pos).y) * 100.0 + 10030.0 + 0.5)); __ftoui3(); return; } //@@ 0096cf40 FUN_0096cf40 uint FUN_0096cf40(void) { int iVar1; uint uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 0x3bc); if (iVar1 != 0) { uVar2 = *(uint *)(iVar1 + 0x28); if ((uVar2 == 2) || (uVar2 == 1000)) { if (*(int *)(iVar1 + 0x34) == 1) goto LAB_0096cf58; } else if ((uVar2 == 1) || (uVar2 == 3)) goto LAB_0096cf58; } uVar2 = *(uint *)(in_ECX + 0x34); if ((uVar2 != 1) && (uVar2 != 3)) { return uVar2 & 0xffffff00; } LAB_0096cf58: return CONCAT31((int3)(uVar2 >> 8),1); } //@@ 0096cf80 Entity_Laser::CanDamageEntity /* ZHL [exact] __thiscall bool Entity_Laser::CanDamageEntity(Entity* entity); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Entity_Laser::CanDamageEntity(Entity_Laser *this,Entity *entity) { int iVar1; EntityPtr EVar2; int iVar3; bool bVar4; bool bVar5; byte bVar6; char cVar7; byte bVar8; EntityList *this_00; int local_c; iVar1 = entity->_type; if (iVar1 == 0x11) { return 0; } EVar2 = this->_parent; if (EVar2 == (EntityPtr)0x0) { local_c = 0; } else { local_c = *(int *)((int)EVar2 + 0x28); if ((*(uint *)((int)EVar2 + 0x168) & 0x100) != 0) { bVar4 = true; goto LAB_0096cfc9; } } bVar4 = false; LAB_0096cfc9: if ((iVar1 == 3) && ((((iVar3 = entity->_variant, iVar3 == 0x3e || (iVar3 == 0x43)) || (iVar3 == 0xd3)) || ((iVar3 == 100 || ((iVar3 == 0xce && (entity->_subtype == 0x1ab)))))))) { bVar5 = true; } else { bVar5 = false; } if ((((((EntityPtr)entity != EVar2) && (entity->_dead == 0)) && ((entity->_entityCollisionClass != 0 && (0.0 < entity->_maxHitPoints)))) || (bVar5)) && ((((local_c == 1 && (1 < *(int *)&g_game->_deathmatchManager)) || (local_c != iVar1)) || (bVar4)))) { EVar2 = this->_parentLaser; if (EVar2 == (EntityPtr)0x0) { this_00 = (EntityList *)&this->_hitList; } else if (*(int *)((int)EVar2 + 0x52c) == 0) { this_00 = (EntityList *)((int)EVar2 + 0x520); } else { this_00 = (EntityList *)FUN_0096ce70(); } bVar6 = EntityList::HitListContains(this_00,entity); if (bVar6 == 0) { cVar7 = FUN_0096cf40(); if ((cVar7 == '\0') || ((local_c == 3 && (bVar4)))) { bVar4 = false; } else { bVar4 = true; } bVar8 = Entity::IsEnemy(entity); bVar6 = bVar8; if ((1 < *(int *)&g_game->_deathmatchManager) && ((bVar8 != 0 || (entity->_type == 1)))) { bVar6 = 1; } if (bVar4) { if ((bVar6 != 0) && (bVar6 = Entity::HasEntityFlags(entity,0x20000000), bVar6 == 0)) { return 1; } if ((entity->_entityCollisionClass != 0) && (((iVar1 = entity->_type, iVar1 == 0x21 || (iVar1 == 0x124)) || (iVar1 == 0xf5)))) { return 1; } } else { if (entity->_type == 1) { return 1; } if (bVar8 != 0) { return 1; } if (bVar5) { return 1; } } } } return 0; } //@@ 0096d120 FUN_0096d120 void FUN_0096d120(int *param_1) { int *piVar1; int *piVar2; int in_ECX; piVar2 = param_1; piVar1 = (int *)(in_ECX + 0x52c); if ((int *)*piVar1 != param_1) { if ((int *)*piVar1 != (int *)0x0) { param_1 = piVar1; std::multiset::erase(¶m_1); } *piVar1 = (int)piVar2; if (piVar2 != (int *)0x0) { std::multiset::insert(piVar1); } } return; } //@@ 0096d160 Entity_Laser::get_segment_start_dir /* DB: ? (outPos, outDir): default pos +0x33c, else interpolates between stored sample points; followed by Vector::GetAngleDegrees in update_laser */ undefined4 __thiscall Entity_Laser::get_segment_start_dir(Entity_Laser *this,float *param_2,float *param_3) { float fVar1; float *pfVar2; void *pvVar3; short sVar4; int iVar5; uint uVar6; uint uVar7; float fVar8; float fVar9; float in_XMM1_Da; float fVar10; float local_1c; float local_18; pfVar2 = (this->_homingLaser)._samples._begin; uVar6 = (int)(this->_homingLaser)._samples._end - (int)pfVar2 >> 3; if (uVar6 < 2) { *param_2 = (this->_pos).x; param_2[1] = (this->_pos).y; fVar8 = this->_angleDegrees * 0.017453292; fVar9 = cos(fVar8); fVar8 = sin(fVar8); *param_3 = fVar9; param_3[1] = fVar8; return 0; } if (0.0 < in_XMM1_Da) { sVar4 = fdclass(); if (sVar4 < 1) { uVar7 = 0; local_1c = 0.0; if (uVar6 != 1) { do { fVar9 = pfVar2[uVar7 * 2 + 3] - pfVar2[uVar7 * 2 + 1]; fVar10 = pfVar2[uVar7 * 2 + 2] - pfVar2[uVar7 * 2]; fVar8 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); if (in_XMM1_Da < fVar8 + local_1c) { local_1c = this->_subLaserDistance - local_1c; fVar1 = pfVar2[uVar7 * 2 + 1]; *param_2 = (local_1c * fVar10) / fVar8 + pfVar2[uVar7 * 2]; param_2[1] = (local_1c * fVar9) / fVar8 + fVar1; *param_3 = fVar10 / fVar8; param_3[1] = fVar9 / fVar8; return 1; } uVar7 = uVar7 + 1; local_1c = fVar8 + local_1c; } while (uVar7 < uVar6 - 1); } } *param_2 = pfVar2[uVar6 * 2 + -2]; param_2[1] = pfVar2[uVar6 * 2 + -1]; pvVar3 = (this->_homingLaser)._samples._begin; iVar5 = (int)(this->_homingLaser)._samples._end - (int)pfVar2 >> 3; fVar9 = *(float *)((int)pvVar3 + iVar5 * 8 + -8) - *(float *)((int)pvVar3 + iVar5 * 8 + -0x10); local_18 = *(float *)((int)pvVar3 + iVar5 * 8 + -4) - *(float *)((int)pvVar3 + iVar5 * 8 + -0xc) ; fVar8 = sqrtf(fVar9 * fVar9 + local_18 * local_18); } else { *param_2 = *pfVar2; param_2[1] = pfVar2[1]; fVar9 = pfVar2[2] - *pfVar2; local_18 = pfVar2[3] - pfVar2[1]; fVar8 = sqrtf(fVar9 * fVar9 + local_18 * local_18); } if (0.0 < fVar8) { fVar9 = fVar9 * (1.0 / fVar8); local_18 = local_18 * (1.0 / fVar8); } *param_3 = fVar9; param_3[1] = local_18; return 0; } //@@ 0096d3f0 Entity_Laser::impact_tear_flag_effects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: (pos, dir) at the laser end: BombTearflagEffects + BombDamage (explosive), 1000.1 explosion, split tears with SetTearFlags, random pickups; called from UpdateHits and update_laser prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Laser::impact_tear_flag_effects(Entity_Laser *this,Vector *position,Vector *direction) { uint *puVar1; qword *pqVar2; code *pcVar3; longlong lVar4; longlong lVar5; longlong lVar6; BitSet128 flags; byte bVar7; char cVar8; int iVar9; float fVar10; int *piVar11; float seed; uint uVar12; Entity_Tear *splitTear; Entity *pEVar13; EntityPtr EVar14; int unusedArg; int unusedArg_00; void *pvVar15; undefined4 uVar16; uint uVar17; uint uVar18; uint uVar19; PlayerManager *playerManager; uint uVar20; bool bVar21; float fVar22; ulonglong uVar23; ulonglong uVar24; ulonglong uVar25; float type; Entity *pEVar26; Game *pGVar27; Entity_Laser *pEVar28; undefined1 auStack_186 [2]; uint uStack_184; float fStack_180; float fStack_17c; uint uStack_178; Entity_Laser *local_174; float fStack_170; uint effectVariant; Vector VStack_168; float fStack_160; float fStack_15c; Game *spawnGame; Vector VStack_154; uint uStack_14c; Vector VStack_148; uint poisonEffectSeed; void *local_13c; uint uStack_138; float fStack_134; undefined8 uStack_130; uint uStack_128; Vector *impactPos; uint uStack_120; uint uStack_11c; Vector VStack_110; Vector VStack_108; uint splitFlagsLow; undefined8 uStack_fc; uint uStack_f4; int iStack_f0; Color CStack_ec; undefined4 uStack_c0; undefined4 uStack_bc; float fStack_b8; float fStack_b4; undefined1 auStack_b0 [8]; float fStack_a8; float fStack_a4; float fStack_a0; float fStack_9c; undefined8 uStack_98; float fStack_90; ColorMod explosionColor; Game *game; Manager *manager; EntityPtr *spawnerSlot; impactPos = position; local_13c = (void *)0x3f800000; EVar14 = this->_spawnerEntity; if (EVar14 != (EntityPtr)0x0) { do { EVar14 = *(EntityPtr *)((int)EVar14 + 0x3c8); } while (EVar14 != (EntityPtr)0x0); } local_174 = this; iVar9 = __RTDynamicCast(); if (((iVar9 != 0) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) && (bVar7 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar9 + 0x1618)), bVar7 == 0)) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { local_13c = (void *)((float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1); } else { local_13c = (void *)0x3f800000; } } VStack_168.y = (float)(*(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagExplosive._h._4_4_); if (((((uint)(this->_tearFlags)._l & (uint)g_tearFlagExplosive._l) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagExplosive._l._4_4_) == 0) && (((uint)(this->_tearFlags)._h & (uint)g_tearFlagExplosive._h) == 0 && VStack_168.y == 0.0)) || ((this->_isFirstUpdate == 0 && (iVar9 = Entity::GetIntervalTicks((Entity *)this,4.0,0.0), iVar9 == 0)))) goto LAB_0096e506; iVar9 = this->_subtype; if (((iVar9 == 1) || (iVar9 == 2)) || (iVar9 == 3)) { if (iVar9 == 1) { if (30.0 <= this->_updateTime) goto LAB_0096d590; } else if (5.0 <= this->_updateTime) goto LAB_0096d590; } else { LAB_0096d590: fStack_180 = this->_scale; if (1.0 <= fStack_180) { fVar22 = fStack_180 * 10.0 + 30.0; fStack_180 = 60.0; if (60.0 <= fVar22) { fStack_180 = fVar22; } } else { fStack_180 = fStack_180 * 60.0; if (fStack_180 <= 30.0) { fStack_180 = 30.0; } } fStack_15c = fStack_180 / 60.0; pEVar28 = (Entity_Laser *)0x3f800000; fStack_134 = direction->x * 10.0 + impactPos->x; uStack_130 = CONCAT44(uStack_130._4_4_,direction->y * 10.0 + impactPos->y); fVar22 = *(float *)&(this->_tearFlags)._h; Game::BombTearflagEffects(); Game::BombDamage(g_game,&VStack_154,this->_collisionDamage + this->_collisionDamage + 10.0, fVar22,1,(Entity *)this,this->_tearFlags,4,0); if ((((uint)(this->_tearFlags)._l & (uint)g_tearFlagPoison._l) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & g_tearFlagPoison._l._4_4_) != 0) || (((uint)(this->_tearFlags)._h & (uint)g_tearFlagPoison._h) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & g_tearFlagPoison._h._4_4_) != 0)) { poisonEffectSeed = Random(); spawnGame = g_game; uStack_178 = 0; fStack_134 = 9.80909e-45; uStack_138 = 1000; lua_callback_run_pre_entity_spawn ((int *)&uStack_138,(int *)&fStack_134,&VStack_154,&g_vectorZero,(Entity *)0x0, (int *)&uStack_178,&poisonEffectSeed); fVar22 = fStack_134; if (*(int *)&g_game->_deathmatchManager < 2) { LAB_0096d990: uVar19 = uStack_178; } else { piVar11 = (g_game->_deathmatchManager)._type; fVar10 = (float)Random(); uVar12 = uStack_178; uStack_fc = 0x900000005; local_174 = (Entity_Laser *)&DAT_00000007; uStack_f4 = 7; if (uStack_138 != 5) goto LAB_0096d990; if (300 < (uint)fVar22) { if (fVar22 == 4.90454e-43) { do { if (uStack_178 != 0) { uVar19 = uStack_178; cVar8 = (**(code **)(*piVar11 + 0x2c))(uStack_178); if (cVar8 == '\0') goto LAB_0096d998; } uStack_178 = ItemPool::GetTrinket(&g_game->_itemPool,0); } while( true ); } goto LAB_0096d990; } if (fVar22 == 4.2039e-43) { do { if (uStack_178 != 0) { uVar19 = uStack_178; cVar8 = (**(code **)(*piVar11 + 0x24))(uStack_178); if (cVar8 == '\0') goto LAB_0096d998; } if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar12 = (uint)fVar10 >> ((byte)uStack_fc & 0x1f) ^ (uint)fVar10; uVar12 = uVar12 << ((byte)((ulonglong)uStack_fc >> 0x20) & 0x1f) ^ uVar12; fVar10 = (float)(uVar12 >> ((byte)local_174 & 0x1f) ^ uVar12); iVar9 = ItemPool::GetCardEx((int)fVar10,0x19,10,10,1); fStack_a8 = 7.00649e-45; fStack_a4 = 1.26117e-44; fStack_a0 = 9.80909e-45; auStack_b0._4_4_ = fVar10; uStack_178 = lua_callback_run_get_card((RNG *)(auStack_b0 + 4),iVar9,1,1,0); } while( true ); } if (fVar22 == 9.80909e-44) { uStack_14c = uStack_178 >> 0xb; fVar22 = fVar10; do { if (uStack_178 != 0) { pcVar3 = *(code **)(*piVar11 + 0x28); uVar19 = uStack_178; iVar9 = ItemPool::GetPillEffect(&g_game->_itemPool,uStack_178,(Entity_Player *)0x0); fVar10 = fVar22; cVar8 = (*pcVar3)(iVar9); if (cVar8 == '\0') goto LAB_0096d998; } if (fVar10 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar12 = (uint)fVar10 >> ((byte)uStack_fc & 0x1f) ^ (uint)fVar10; uVar12 = uVar12 << ((byte)((ulonglong)uStack_fc >> 0x20) & 0x1f) ^ uVar12; fVar10 = (float)(uVar12 >> ((byte)local_174 & 0x1f) ^ uVar12); fVar22 = fVar10; uStack_178 = ItemPool::GetPill((uint)fVar10); uStack_178 = uStack_178 | (uStack_14c & 1) << 0xb; } while( true ); } if (fVar22 != 1.4013e-43) goto LAB_0096d990; uVar19 = uStack_178; if (uStack_178 == 0x19) { LAB_0096d7d2: bVar21 = false; } else { uStack_14c = uStack_178; std::set::find_node(&iStack_f0,&uStack_14c); if (((*(char *)((int)CStack_ec._tint[1] + 0xd) == '\0') && (*(int *)((int)CStack_ec._tint[1] + 0x10) <= (int)uVar12)) && (CStack_ec._tint[1] != (float)piVar11[8])) goto LAB_0096d7d2; bVar21 = true; } if ((uVar12 == 0) || (bVar21)) { uStack_178 = (**(code **)(*piVar11 + 0x84))(0); uVar19 = uStack_178; } } LAB_0096d998: pEVar13 = EntityFactory::Create(spawnGame->_entityFactory,uStack_138,0); uVar25 = (ulonglong)(uint)fStack_170; this = pEVar28; if (pEVar13 != (Entity *)0x0) { uVar23 = GetTimeNs(); uVar20 = (uint)(uVar23 >> 0x20); lVar4 = (ulonglong)uVar20 * 0xd7b634db; uStack_184 = (uint)((ulonglong)lVar4 >> 0x20); uVar25 = lVar4 + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar25 >> 0x20); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82 + (uVar25 & 0xffffffff); VStack_168.x = (float)lVar4; uVar12 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = (ulonglong)uVar20 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar12),uVar17 + uVar12); uVar12 = (uint)((ulonglong)lVar4 >> 0x20); uVar20 = (uint)lVar4 >> 0x12 | uVar12 * 0x4000; spawnerSlot = &pEVar13->_spawnerEntity; pEVar13->_spawnerType = 0; pEVar13->_spawnerVariant = 0; pEVar26 = pEVar13; this = pEVar28; if (*spawnerSlot != (EntityPtr)0x0) { VStack_148.x = (float)spawnerSlot; std::multiset::erase(&VStack_148); this = pEVar28; } iVar9 = *(int *)pEVar13; *spawnerSlot = (EntityPtr)0x0; (pEVar13->_pos).x = VStack_154.x; (pEVar13->_pos).y = VStack_154.y; (pEVar13->_velocity).x = g_vectorZero.x; (pEVar13->_velocity).y = g_vectorZero.y; (**(code **)(iVar9 + 4))(uStack_138,fStack_134,uVar19,poisonEffectSeed); game = spawnGame; pvVar15 = spawnGame->_room; iVar9 = *(int *)((int)pvVar15 + 0x1214); *(int *)((int)pvVar15 + 0x1214) = iVar9 + 1; pEVar13->_index = iVar9; EntityList::AddEntity((EntityList *)((int)pvVar15 + 0x1218),pEVar13); bVar7 = Game::ShouldEraseEnemy(pEVar13); if (bVar7 != 0) { Entity::RemoveWithPoof(pEVar13,unusedArg); } if ((pEVar13->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { VStack_110.y = (float)pEVar13->_variant; VStack_110.x = (float)pEVar13->_type; std::map::find(&local_13c,&VStack_110); pvVar15 = (game->_proceduralItemManager)._spawnTriggerTargets._head; if (local_13c == pvVar15) { VStack_108.x = VStack_110.x; VStack_108.y = -NAN; piVar11 = (int *)std::map::find(&uStack_130,&VStack_108); local_13c = (void *)*piVar11; if (local_13c == pvVar15) goto LAB_0096dc14; } uVar19 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar15 = (playerManager->_playerList)._end; if ((int)pvVar15 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar15 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (uVar19 < (uint)((int)pvVar15 - (int)piVar11 >> 2)) { piVar11 = piVar11 + uVar19; } trigger_set_dispatch((void *)(*piVar11 + 0x1fc8),6,pEVar26,&VStack_154,&g_vectorZero); uVar19 = uVar19 + 1; playerManager = &g_game->_playerManager; } while (uVar19 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0096dc14: pEVar13 = pEVar26; uVar24 = GetTimeNs(); uVar19 = (uint)(uVar24 >> 0x20); lVar4 = (ulonglong)uVar19 * 0xd7b634db; uStack_184 = (uint)((ulonglong)lVar4 >> 0x20); uVar25 = (ulonglong)uVar19 * 0x431bde82; uVar23 = lVar4 + ((uVar24 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar23 >> 0x20); lVar4 = (uVar24 & 0xffffffff) * 0x431bde82 + (uVar23 & 0xffffffff); VStack_168.x = (float)lVar4; uVar19 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = uVar25 + CONCAT14(CARRY4(uVar17,uVar19),uVar17 + uVar19); uVar18 = (uint)((ulonglong)lVar4 >> 0x20); uVar19 = (uint)lVar4 >> 0x12 | uVar18 * 0x4000; uVar17 = uVar19 - uVar20; bVar21 = CARRY4((uint)g_entitySpawnTimeMs,uVar17); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar17; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar18 >> 0x12) - (uVar12 >> 0x12)) - (uint)(uVar19 < uVar20)) + (uint)bVar21; } fStack_170 = (float)uVar25; piVar11 = (int *)__RTDynamicCast(pEVar13,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); uVar12 = Random(); fStack_b8 = 0.0; fStack_b4 = 0.33333334; auStack_b0._0_4_ = 0.0; fVar22 = ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 + 1.0) * fStack_17c; piVar11[0x39] = (int)fVar22; piVar11[0x3a] = (int)fVar22; CStack_ec._offset[1] = 0.0; CStack_ec._offset[2] = 0.0; uStack_c0 = 0; uStack_bc = 0; CStack_ec._colorize[1] = 0.02; CStack_ec._colorize[2] = 0.9; CStack_ec._colorize[3] = 0.02; CStack_ec._offset[0] = 1.0; (**(code **)(*piVar11 + 0x3c))(CStack_ec._colorize + 1,0xffffffff,0xff,0,1); (**(code **)(*piVar11 + 0xc))(); uStack_184 = Random(); fVar10 = 5.60519e-45; effectVariant = 2; type = 1.4013e-42; game = g_game; lua_callback_run_pre_entity_spawn ((int *)(auStack_186 + -0x1e),(int *)&effectVariant,&VStack_168,&g_vectorZero, (Entity *)0x0,(int *)(auStack_186 + -0x26),&uStack_184); uVar12 = effectVariant; fVar22 = fVar10; if (1 < *(int *)&g_game->_deathmatchManager) { piVar11 = (g_game->_deathmatchManager)._type; seed = (float)Random(); uStack_130 = 0x900000005; uStack_128 = 7; fVar22 = fVar10; if (type == 7.00649e-45) { if (uVar12 < 0x12d) { if (uVar12 == 300) { while ((fVar22 == 0.0 || (cVar8 = (**(code **)(*piVar11 + 0x24))(fVar22), cVar8 != '\0'))) { if (seed == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar12 = (uint)seed >> ((byte)uStack_130 & 0x1f) ^ (uint)seed; uVar12 = uVar12 << ((byte)((ulonglong)uStack_130 >> 0x20) & 0x1f) ^ uVar12; seed = (float)(uVar12 >> 7 ^ uVar12); iVar9 = ItemPool::GetCardEx((int)seed,0x19,10,10,1); auStack_b0._4_4_ = 7.00649e-45; fStack_a8 = 1.26117e-44; fStack_a4 = 9.80909e-45; auStack_b0._0_4_ = seed; fVar22 = (float)lua_callback_run_get_card((RNG *)auStack_b0,iVar9,1,1,0); } } else { if (uVar12 == 0x46) { fStack_180 = (float)((uint)fVar10 >> 0xb); fVar10 = seed; do { if (fVar22 != 0.0) { pcVar3 = *(code **)(*piVar11 + 0x28); iVar9 = ItemPool::GetPillEffect (&g_game->_itemPool,(uint)fVar22,(Entity_Player *)0x0); seed = fVar10; cVar8 = (*pcVar3)(iVar9); if (cVar8 == '\0') goto LAB_0096e030; } if (seed == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar12 = (uint)seed >> ((byte)uStack_130 & 0x1f) ^ (uint)seed; uVar12 = uVar12 << ((byte)((ulonglong)uStack_130 >> 0x20) & 0x1f) ^ uVar12; seed = (float)(uVar12 >> 7 ^ uVar12); fVar10 = seed; uVar12 = ItemPool::GetPill((uint)seed); fVar22 = (float)(uVar12 | ((uint)fStack_180 & 1) << 0xb); } while( true ); } if (uVar12 == 100) { if (fVar10 == 3.50325e-44) { LAB_0096de6a: bVar21 = false; } else { fStack_180 = fVar10; std::set::find_node((int)&uStack_fc + 4,&fStack_180); if (((*(char *)(iStack_f0 + 0xd) == '\0') && (*(int *)(iStack_f0 + 0x10) <= (int)fVar10)) && (iStack_f0 != piVar11[8])) goto LAB_0096de6a; bVar21 = true; } if ((fVar10 == 0.0) || (bVar21)) { fVar22 = (float)(**(code **)(*piVar11 + 0x84))(0); } } } } else if (uVar12 == 0x15e) { while ((fVar22 == 0.0 || (cVar8 = (**(code **)(*piVar11 + 0x2c))(fVar22), cVar8 != '\0') )) { fVar22 = (float)ItemPool::GetTrinket(&g_game->_itemPool,0); } } } } LAB_0096e030: pEVar13 = EntityFactory::Create(game->_entityFactory,(uint)type,0); lVar4 = CONCAT44(fStack_160,fStack_15c); if (pEVar13 != (Entity *)0x0) { uVar23 = GetTimeNs(); uVar19 = (uint)(uVar23 >> 0x20); uVar25 = (ulonglong)uVar19 * 0xd7b634db + ((uVar23 & 0xffffffff) * 0xd7b634db >> 0x20); uVar20 = (uint)(uVar25 >> 0x20); lVar4 = (uVar23 & 0xffffffff) * 0x431bde82 + (uVar25 & 0xffffffff); fStack_17c = (float)lVar4; uVar12 = (uint)((ulonglong)lVar4 >> 0x20); lVar4 = (ulonglong)uVar19 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar20,uVar12),uVar20 + uVar12); pEVar13->_spawnerType = 0; uVar12 = (uint)((ulonglong)lVar4 >> 0x20); pEVar13->_spawnerVariant = 0; uVar19 = (uint)lVar4 >> 0x12 | uVar12 * 0x4000; uVar12 = uVar12 >> 0x12; pEVar26 = pEVar13; if (pEVar13->_spawnerEntity != (EntityPtr)0x0) { std::multiset::erase(auStack_186 + -0xe); } iVar9 = *(int *)pEVar13; pEVar13->_spawnerEntity = (EntityPtr)0x0; (pEVar13->_pos).x = VStack_168.x; (pEVar13->_pos).y = VStack_168.y; (pEVar13->_velocity).x = g_vectorZero.x; (pEVar13->_velocity).y = g_vectorZero.y; (**(code **)(iVar9 + 4))(type,effectVariant,fVar22,uStack_184); pvVar15 = game->_room; iVar9 = *(int *)((int)pvVar15 + 0x1214); *(int *)((int)pvVar15 + 0x1214) = iVar9 + 1; pEVar13->_index = iVar9; pGVar27 = game; EntityList::AddEntity((EntityList *)((int)pvVar15 + 0x1218),pEVar13); bVar7 = Game::ShouldEraseEnemy(pEVar13); if (bVar7 != 0) { Entity::RemoveWithPoof(pEVar13,unusedArg_00); } if ((pEVar13->_exists != 0) && ((game->_proceduralItemManager)._proceduralItems._begin != (game->_proceduralItemManager)._proceduralItems._end)) { uStack_138 = pEVar13->_variant; local_13c = (void *)pEVar13->_type; std::map::find(auStack_186 + -0x16,&local_13c); if (pGVar27 == (game->_proceduralItemManager)._spawnTriggerTargets._head) { fStack_17c = (float)pEVar13->_type; uStack_178 = 0xffffffff; piVar11 = (int *)std::map::find(auStack_186 + -0x2a,&fStack_17c); if ((void *)*piVar11 == (game->_proceduralItemManager)._spawnTriggerTargets._head) goto LAB_0096e2b2; } playerManager = &g_game->_playerManager; uVar20 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar15 = (playerManager->_playerList)._end; if ((int)pvVar15 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar15 = (playerManager->_playerList)._end; } piVar11 = (playerManager->_playerList)._begin; if (uVar20 < (uint)((int)pvVar15 - (int)piVar11 >> 2)) { piVar11 = piVar11 + uVar20; } trigger_set_dispatch((void *)(*piVar11 + 0x1fc8),6,pEVar13,&VStack_168,&g_vectorZero); playerManager = &g_game->_playerManager; uVar20 = uVar20 + 1; } while (uVar20 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } LAB_0096e2b2: pEVar13 = pEVar26; uVar25 = GetTimeNs(); uVar20 = (uint)(uVar25 >> 0x20); lVar5 = (uVar25 & 0xffffffff) * 0x431bde82; fStack_180 = (float)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar20 * 0xd7b634db; this = (Entity_Laser *)((ulonglong)lVar6 >> 0x20); lVar4 = (ulonglong)uVar20 * 0x431bde82; uVar25 = lVar6 + ((uVar25 & 0xffffffff) * 0xd7b634db >> 0x20); uVar17 = (uint)(uVar25 >> 0x20); lVar5 = lVar5 + (uVar25 & 0xffffffff); fStack_17c = (float)lVar5; uVar20 = (uint)((ulonglong)lVar5 >> 0x20); lVar5 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar17,uVar20),uVar17 + uVar20); uVar18 = (uint)((ulonglong)lVar5 >> 0x20); uVar20 = (uint)lVar5 >> 0x12 | uVar18 * 0x4000; uVar17 = uVar20 - uVar19; bVar21 = CARRY4((uint)g_entitySpawnTimeMs,uVar17); g_entitySpawnTimeMs._0_4_ = (uint)g_entitySpawnTimeMs + uVar17; g_entitySpawnTimeMs._4_4_ = g_entitySpawnTimeMs._4_4_ + (((uVar18 >> 0x12) - uVar12) - (uint)(uVar20 < uVar19)) + (uint)bVar21; } fStack_160 = (float)((ulonglong)lVar4 >> 0x20); fStack_15c = (float)lVar4; Color::Reset(&CStack_ec); CStack_ec._tint[0] = 0.02; CStack_ec._tint[1] = 0.9; CStack_ec._tint[2] = 0.02; CStack_ec._tint[3] = fStack_170; CStack_ec._offset[0] = 0.039215688; CStack_ec._offset[1] = 0.3921569; CStack_ec._offset[2] = 0.0; (**(code **)(*(int *)pEVar13 + 0x3c))(&CStack_ec,0xffffffff,0xff,0,1); iVar9 = *(int *)pEVar13; pEVar13->_renderDepthOffset = -5.0; (pEVar13->_sprite)._scale.x = type; (pEVar13->_sprite)._scale.y = type * 0.4; (**(code **)(iVar9 + 0xc))(); } uVar12 = Random(); pEVar13 = Game::SpawnEx(g_game,1000,1,&VStack_154,&g_vectorZero,(Entity *)0x0,0,uVar12,0); piVar11 = (int *)__RTDynamicCast(pEVar13,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0); if (fStack_17c != 1.0) { piVar11[0x3a] = (int)(fStack_17c * (float)piVar11[0x3a]); piVar11[0x39] = (int)(fStack_17c * (float)piVar11[0x39]); } explosionColor._tint[0] = (this->_sprite)._color._tint[0]; explosionColor._tint[1] = (this->_sprite)._color._tint[1]; explosionColor._tint[2] = (this->_sprite)._color._tint[2]; explosionColor._offset[2] = (this->_sprite)._color._offset[2]; explosionColor._colorize[0] = (this->_sprite)._color._colorize[0]; explosionColor._colorize[1] = (this->_sprite)._color._colorize[1]; explosionColor._colorize[2] = (this->_sprite)._color._colorize[2]; explosionColor._colorize[3] = (this->_sprite)._color._colorize[3]; explosionColor._tint[3] = (this->_sprite)._color._tint[3] * fStack_15c; explosionColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; (**(code **)(*piVar11 + 0x3c))(&explosionColor,0xffffffff,0xff,0,1); uVar12 = g_tearFlagExplosive._h._4_4_; uVar20 = ~(uint)g_tearFlagExplosive._h; uVar19 = ~g_tearFlagExplosive._l._4_4_; *(uint *)&(this->_activeTearFlags)._l = (uint)(this->_activeTearFlags)._l & ~(uint)g_tearFlagExplosive._l; puVar1 = (uint *)((int)&(this->_activeTearFlags)._l + 4); *puVar1 = *puVar1 & uVar19; pqVar2 = &(this->_activeTearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 & uVar20; puVar1 = (uint *)((int)&(this->_activeTearFlags)._h + 4); *puVar1 = *puVar1 & ~uVar12; } LAB_0096e506: local_174 = (Entity_Laser *)(DAT_00c34858 | DAT_00c34888); uVar12 = (uint)(this->_tearFlags)._h; fVar22 = *(float *)((int)&(this->_tearFlags)._h + 4); fStack_160 = (float)(DAT_00c3485c | DAT_00c3488c); if ((!(((DAT_00c34850 | DAT_00c34880) & (uint)(this->_tearFlags)._l) == 0 && ((DAT_00c34854 | DAT_00c34884) & *(uint *)((int)&(this->_tearFlags)._l + 4)) == 0)) || (!((uVar12 & (uint)local_174) == 0 && ((uint)fVar22 & (uint)fStack_160) == 0))) { fStack_15c = fVar22; if ((this->_isFirstUpdate == 0) && (iVar9 = Entity::GetIntervalTicks((Entity *)this,4.0,0.0), iVar9 == 0)) { fVar22 = fStack_15c; } else { Room::GetClampedPositionImpl(g_game->_room,&VStack_148,impactPos,1.0,1.0,1.0,1.0); uVar12 = Random(); fVar22 = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_174 = (Entity_Laser *)(fVar22 + fVar22); VStack_168.x = cos((float)local_174); VStack_168.x = VStack_168.x * 10.0; VStack_110.x = VStack_168.x; VStack_154.y = sin((float)local_174); splitFlagsLow = ~(DAT_00c34780 | _DAT_00c345d0 | _DAT_00c345e0 | _DAT_00c345c0 | DAT_00c348f0 | (uint)g_tearFlagLudovico._l | DAT_00c34850 | DAT_00c34880) & ((uint)(this->_tearFlags)._l | DAT_00c34b50); VStack_154.y = VStack_154.y * 10.0; uStack_f4 = ~(DAT_00c3478c | _DAT_00c345dc | _DAT_00c345ec | _DAT_00c345cc | DAT_00c348fc | g_tearFlagLudovico._h._4_4_ | DAT_00c3485c | DAT_00c3488c) & (*(uint *)((int)&(this->_tearFlags)._h + 4) | DAT_00c34b5c); uStack_fc = CONCAT44(~(DAT_00c34788 | _DAT_00c345d8 | _DAT_00c345e8 | _DAT_00c345c8 | DAT_00c348f8 | (uint)g_tearFlagLudovico._h | DAT_00c34858 | DAT_00c34888) & ((uint)(this->_tearFlags)._h | DAT_00c34b58), ~(DAT_00c34784 | _DAT_00c345d4 | _DAT_00c345e4 | _DAT_00c345c4 | DAT_00c348f4 | g_tearFlagLudovico._l._4_4_ | DAT_00c34854 | DAT_00c34884) & (*(uint *)((int)&(this->_tearFlags)._l + 4) | DAT_00c34b54)); VStack_110.y = VStack_154.y; get_tear_spawn_color(this); uVar12 = *(uint *)((int)&(this->_tearFlags)._l + 4); uStack_11c = DAT_00c34880; uStack_128 = DAT_00c34884; VStack_168.y = (float)(DAT_00c34858 | DAT_00c34888); uStack_120 = DAT_00c34888; fStack_160 = (float)(DAT_00c3485c | DAT_00c3488c); uStack_14c = DAT_00c3488c; fStack_15c = (float)(uVar12 & (DAT_00c34854 | DAT_00c34884)); uVar19 = (uint)(this->_tearFlags)._h; if ((((((uint)(this->_tearFlags)._l & (DAT_00c34850 | DAT_00c34880)) == (DAT_00c34850 | DAT_00c34880)) && (fStack_15c == (float)(DAT_00c34854 | DAT_00c34884))) && ((float)(uVar19 & (uint)VStack_168.y) == VStack_168.y)) && ((float)(*(uint *)((int)&(this->_tearFlags)._h + 4) & (uint)fStack_160) == fStack_160)) { fVar22 = 60.0; fStack_170 = 8.40779e-45; LAB_0096e8c5: local_174 = (Entity_Laser *)(fVar22 * 0.017453292); fStack_160 = cos((float)local_174); local_174 = (Entity_Laser *)sin((float)local_174); do { uVar12 = Random(); VStack_108.x = VStack_148.x - direction->x * 4.0; VStack_108.y = VStack_148.y - direction->y * 4.0; splitTear = (Entity_Tear *) Game::SpawnEx(g_game,2,0,&VStack_108,&VStack_110, (Entity *)this->_spawnerEntity,0,uVar12,0); splitTear->_height = -11.875; fVar22 = Entity_Tear::get_height_offset_y(splitTear,-11.875); game = g_game; (splitTear->_posOffset).y = fVar22; if (*(int *)((int)game->_room + 8) == 0x10) { (splitTear->_posOffset).y = -18.0; } flags._l._4_4_ = (undefined4)uStack_fc; flags._l._0_4_ = splitFlagsLow; flags._h._0_4_ = uStack_fc._4_4_; flags._h._4_4_ = uStack_f4; Entity_Tear::SetTearFlags(splitTear,flags); (**(code **)(*(int *)splitTear + 0x40))(); fVar22 = this->_scale * 0.6; if (fVar22 <= 0.01) { fVar22 = 0.01; } splitTear->_baseScale = fVar22; splitTear->_fScale = fVar22; Entity_Tear::ResetSpriteScale(splitTear); (**(code **)(*(int *)splitTear + 0x3c))(); (**(code **)(*(int *)splitTear + 0xc))(); fStack_170 = (float)((int)fStack_170 + -1); fVar22 = VStack_168.x * (float)local_174; VStack_168.x = VStack_168.x * fStack_160 - VStack_154.y * (float)local_174; VStack_154.y = VStack_154.y * fStack_160 + fVar22; VStack_110.x = VStack_168.x; VStack_110.y = VStack_154.y; } while (fStack_170 != 0.0); fStack_170 = 0.0; } else { if ((((uint)(this->_tearFlags)._l & DAT_00c34850) != 0 || (uVar12 & DAT_00c34854) != 0) || ((uVar19 & DAT_00c34858) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3485c) != 0)) { fVar22 = 180.0; fStack_170 = 2.8026e-45; goto LAB_0096e8c5; } fStack_170 = (float)(uVar12 & DAT_00c34884); if ((((uint)(this->_tearFlags)._l & DAT_00c34880) != 0 || fStack_170 != 0.0) || ((uVar19 & DAT_00c34888) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c3488c) != 0)) { fVar22 = 90.0; fStack_170 = 5.60519e-45; goto LAB_0096e8c5; } } uVar19 = DAT_00c34884; uVar12 = DAT_00c34880; uVar20 = ~DAT_00c3488c; pqVar2 = &(this->_activeTearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 & ~DAT_00c34888; *(uint *)&(this->_activeTearFlags)._l = (uint)(this->_activeTearFlags)._l & ~uVar12; puVar1 = (uint *)((int)&(this->_activeTearFlags)._l + 4); *puVar1 = *puVar1 & ~uVar19; puVar1 = (uint *)((int)&(this->_activeTearFlags)._h + 4); *puVar1 = *puVar1 & uVar20; uVar12 = (uint)(this->_tearFlags)._h; fVar22 = *(float *)((int)&(this->_tearFlags)._h + 4); } } local_174 = (Entity_Laser *)(uVar12 & _DAT_00c34908); fStack_160 = (float)(DAT_00c3490c & (uint)fVar22); if ((((uint)(this->_tearFlags)._l & _DAT_00c34900) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c34904) != 0) || (local_174 != (Entity_Laser *)0x0 || fStack_160 != 0.0)) { if (this->_isFirstUpdate == 0) { fStack_15c = fVar22; iVar9 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0); fVar22 = fStack_15c; if (iVar9 == 0) goto LAB_0096ec0c; } pEVar13 = spawn_chain_lightning (impactPos,this->_tearFlags,(Entity *)this->_spawnerEntity, this->_collisionDamage * 0.5); std::vector::assign(); fStack_b8 = (pEVar13->_sprite)._color._tint[0]; fStack_b4 = (pEVar13->_sprite)._color._tint[1]; auStack_b0._0_4_ = (pEVar13->_sprite)._color._tint[2]; fStack_a8 = (pEVar13->_sprite)._color._colorize[0]; fStack_a4 = (pEVar13->_sprite)._color._colorize[1]; fStack_a0 = (pEVar13->_sprite)._color._colorize[2]; fStack_9c = (pEVar13->_sprite)._color._colorize[3]; auStack_b0._4_4_ = (pEVar13->_sprite)._color._tint[3] * (float)local_13c; uStack_98 = *(undefined8 *)(pEVar13->_sprite)._color._offset; fStack_90 = (pEVar13->_sprite)._color._offset[2]; (**(code **)(*(int *)pEVar13 + 0x3c))(); (**(code **)(*(int *)pEVar13 + 0xc))(); uVar12 = (uint)(this->_tearFlags)._h; fVar22 = *(float *)((int)&(this->_tearFlags)._h + 4); } LAB_0096ec0c: if (((((uint)(this->_tearFlags)._l & DAT_00c34970) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34974) != 0) || ((uVar12 & DAT_00c34978) != 0 || ((uint)fVar22 & DAT_00c3497c) != 0)) && ((this->_isFirstUpdate != 0 || (iVar9 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar9 != 0)))) { game = g_game; bVar7 = Room::IsPositionInRoom(g_game->_room,impactPos,-10.0); if (bVar7 != 0) { local_174 = (Entity_Laser *)(this->_collisionDamage * 0.5); Room::GetClampedPositionImpl(game->_room,&VStack_148,impactPos,0.0,0.0,0.0,0.0); uVar12 = Random(); pEVar13 = Game::SpawnEx(g_game,1000,0xb4,&VStack_148,&g_vectorZero, (Entity *)this->_spawnerEntity,0,uVar12,0); fVar22 = this->_scale * g_vectorOne.x; iVar9 = *(int *)pEVar13; (pEVar13->_sprite)._scale.y = this->_scale * g_vectorOne.y; (pEVar13->_sprite)._scale.x = fVar22; (**(code **)(iVar9 + 0x40))(); uVar16 = 0x3c; iVar9 = *(int *)pEVar13; if (1 < *(int *)&g_game->_deathmatchManager) { uVar16 = 0x1e; } *(undefined4 *)(pEVar13[1]._sprite._filename._buf + 8) = uVar16; *(undefined4 *)(pEVar13[1]._sprite._filename._buf + 0xc) = uVar16; (**(code **)(iVar9 + 0xc))(); uVar12 = DAT_00c34974; uVar20 = ~DAT_00c34978; uVar19 = ~DAT_00c3497c; *(uint *)&(this->_activeTearFlags)._l = (uint)(this->_activeTearFlags)._l & ~DAT_00c34970; pqVar2 = &(this->_activeTearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 & uVar20; puVar1 = (uint *)((int)&(this->_activeTearFlags)._l + 4); *puVar1 = *puVar1 & ~uVar12; puVar1 = (uint *)((int)&(this->_activeTearFlags)._h + 4); *puVar1 = *puVar1 & uVar19; manager = g_manager; VStack_168.y = 1.52461e-42; seed_fart_sound_override((int *)&VStack_168.y); SoundEffects::Play(&manager->_sfxManager,(int)VStack_168.y,1.0,2,0,1.0,0.0); } } return; } //@@ 0096ee00 Entity_Laser::get_tear_spawn_color /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? result passed to Entity::SetColor (vtable+0x3c) on the tear spawned by Entity_Laser::update_laser; Color::apply_to_kcolor, Color::__mul */ undefined4 * __thiscall Entity_Laser::get_tear_spawn_color(Entity_Laser *this,undefined4 *param_2) { ColorMod *color; float fVar1; int iVar2; float *extraout_EAX; float *extraout_EAX_00; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; KColor local_88; Color local_74; KColor local_48; ColorMod local_34; float local_8; local_8 = (float)(__security_cookie ^ (uint)((&local_34)[1]._tint + 1)); iVar2 = this->_variant; if ((iVar2 == 3) || (iVar2 == 10)) { fVar1 = (this->_sprite)._color._colorize[3]; fVar5 = (this->_sprite)._color._tint[0] * 0.85; fVar6 = (this->_sprite)._color._tint[1] * 0.9; fVar7 = (this->_sprite)._color._tint[2]; fVar3 = (this->_sprite)._color._tint[3]; if (fVar1 != 0.0) { fVar4 = fVar5 * 0.212671 + fVar6 * 0.71516 + fVar7 * 0.072169; fVar5 = fVar5 + (fVar4 * (this->_sprite)._color._colorize[0] - fVar5) * fVar1; fVar6 = fVar6 + (fVar4 * (this->_sprite)._color._colorize[1] - fVar6) * fVar1; fVar7 = fVar7 + (fVar4 * (this->_sprite)._color._colorize[2] - fVar7) * fVar1; } fVar5 = fVar5 + (this->_sprite)._color._offset[0]; fVar6 = fVar6 + (this->_sprite)._color._offset[1]; fVar7 = fVar7 + (this->_sprite)._color._offset[2]; } else { local_48._unk = 0; color = &(this->_sprite)._color; if (iVar2 == 2) { local_48._red = 1.0; local_48._green = 0.0; local_48._blue = 0.0; local_48._alpha = 1.0; Color::apply_to_kcolor(&local_88,color,&local_48); fVar5 = *extraout_EAX; fVar6 = extraout_EAX[1]; fVar7 = extraout_EAX[2]; fVar3 = extraout_EAX[3]; } else { local_74._offset[2] = (this->_sprite)._color._offset[2]; local_48._red = 0.85; local_48._green = 0.9; local_48._blue = 1.0; local_48._alpha = 1.0; local_34._colorize[0] = 0.0; local_34._colorize[1] = 0.0; local_34._colorize[2] = 0.0; local_34._colorize[3] = 0.0; local_34._tint[0] = 1.0; local_34._tint[1] = 0.0; local_34._tint[2] = 0.0; local_34._tint[3] = 1.0; local_34._offset[0] = 0.0; local_34._offset[1] = 0.0; local_74._tint[0] = color->_tint[0]; local_74._tint[1] = (this->_sprite)._color._tint[1]; local_74._tint[2] = (this->_sprite)._color._tint[2]; local_74._tint[3] = (this->_sprite)._color._tint[3]; local_34._offset[2] = 0.0; local_74._colorize[0] = (this->_sprite)._color._colorize[0]; local_74._colorize[1] = (this->_sprite)._color._colorize[1]; local_74._colorize[2] = (this->_sprite)._color._colorize[2]; local_74._colorize[3] = (this->_sprite)._color._colorize[3]; local_74._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; Color::__mul(&local_74,&local_34); local_34._offset[2] = local_74._offset[2]; local_34._tint[0] = local_74._tint[0]; local_34._tint[1] = local_74._tint[1]; local_34._tint[2] = local_74._tint[2]; local_34._tint[3] = local_74._tint[3]; local_34._colorize[0] = local_74._colorize[0]; local_34._colorize[1] = local_74._colorize[1]; local_34._colorize[2] = local_74._colorize[2]; local_34._colorize[3] = local_74._colorize[3]; local_34._offset[0] = local_74._offset[0]; local_34._offset[1] = local_74._offset[1]; Color::apply_to_kcolor(&local_88,&local_34,&local_48); fVar5 = *extraout_EAX_00; fVar6 = extraout_EAX_00[1]; fVar7 = extraout_EAX_00[2]; fVar3 = extraout_EAX_00[3]; } } *param_2 = 0x3f800000; param_2[3] = fVar3; param_2[1] = 0x3f800000; param_2[2] = 0x3f800000; param_2[7] = 0x3f800000; param_2[4] = fVar5 * 0.5; param_2[5] = fVar6 * 0.5; param_2[6] = fVar7 * 0.5; param_2[8] = fVar5 * 0.5; param_2[9] = fVar6 * 0.5; param_2[10] = fVar7 * 0.5; return param_2; } //@@ 0096f070 Entity_Laser::copy_from_parent /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? called from Entity_Laser::update_laser; copies timeout/flags/offset fields from param laser (+0x3dc,+0x4d4,+0x4e0,+0x500..0x515) then Entity_Laser::ResetSpriteScale */ void Entity_Laser::copy_from_parent(int param_1,char param_2) { EntityPtr *pEVar1; uint uVar2; Entity_Laser *in_ECX; uint uVar3; uint uVar4; EntityPtr *local_10; EntityPtr local_c; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c94298) { _Init_thread_header(&DAT_00c94298); if (DAT_00c94298 == -1) { DAT_00c942a0 = ~(DAT_00c345b0 | _DAT_00c345c0 | DAT_00c34850 | DAT_00c34950); _DAT_00c942a4 = ~(DAT_00c345b4 | _DAT_00c345c4 | DAT_00c34854 | DAT_00c34954); DAT_00c942a8 = ~(DAT_00c345b8 | _DAT_00c345c8 | DAT_00c34858 | DAT_00c34958); _DAT_00c942ac = ~(DAT_00c345bc | _DAT_00c345cc | DAT_00c3485c | DAT_00c3495c); _Init_thread_footer(&DAT_00c94298); } } if (param_2 != '\0') { pEVar1 = &in_ECX->_spawnerEntity; (in_ECX->_dropRNG)._seed = *(int *)(param_1 + 0x3dc); (in_ECX->_dropRNG)._shift1 = 4; (in_ECX->_dropRNG)._shift2 = 3; (in_ECX->_dropRNG)._shift3 = 0x11; in_ECX->_homingType = *(int *)(param_1 + 0x4d4); in_ECX->_spawnerType = *(int *)(param_1 + 0x34); in_ECX->_spawnerVariant = *(int *)(param_1 + 0x38); local_c = *(EntityPtr *)(param_1 + 0x3c8); if (*pEVar1 != (EntityPtr)0x0) { local_10 = pEVar1; std::multiset::erase(&local_10); } *pEVar1 = local_c; if (local_c != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } in_ECX->_oneHit = *(byte *)(param_1 + 0x515); in_ECX->_multidimensionalTouched = *(byte *)(param_1 + 0x500); in_ECX->_prismTouched = *(byte *)(param_1 + 0x514); in_ECX->_scale = *(float *)(param_1 + 0x4e0); ResetSpriteScale(in_ECX); in_ECX->_chainedLasers = *(int *)(param_1 + 0x560); } (**(code **)(*(int *)in_ECX + 0x3c))(param_1 + 0xf0,0xffffffff,0xff,0,1); uVar2 = *(uint *)(param_1 + 0x43c) & _DAT_00c942a4; uVar4 = DAT_00c942a8 & *(uint *)(param_1 + 0x440); uVar3 = *(uint *)(param_1 + 0x444) & _DAT_00c942ac; *(uint *)&(in_ECX->_tearFlags)._l = DAT_00c942a0 & *(uint *)(param_1 + 0x438); *(uint *)((int)&(in_ECX->_tearFlags)._l + 4) = uVar2; *(uint *)&(in_ECX->_tearFlags)._h = uVar4; *(uint *)((int)&(in_ECX->_tearFlags)._h + 4) = uVar3; (**(code **)(*(int *)in_ECX + 0x40))(*(undefined4 *)(param_1 + 0x388)); in_ECX->_blackHpDropChance = *(float *)(param_1 + 0x4f4); in_ECX->_maxDistance = *(float *)(param_1 + 0x4d0); in_ECX->_visible = *(byte *)(param_1 + 0x171); in_ECX->_renderDepthOffset = *(float *)(param_1 + 0x358); in_ECX->_entityGridCollisionClass = *(int *)(param_1 + 0x184); in_ECX->_entityCollisionClass = *(int *)(param_1 + 0x188); in_ECX->_mass = *(float *)(param_1 + 0x37c); if ((param_2 != '\0') || (in_ECX->_oneHit == 0)) { in_ECX->_timeout = *(int *)(param_1 + 0x458); in_ECX->_shrink = *(byte *)(param_1 + 0x45e); } return; } //@@ 0096f310 Entity_Laser::ShootAngle /* ZHL [lua] Lua binding EntityLaser:ShootAngle prototype: db/protos.zhl, confirmed by RET 0 */ Entity_Laser * __cdecl Entity_Laser::ShootAngle (int variant,Vector *sourcePos,float angleDegrees,int timeout,Vector *posOffset, Entity *source,byte isSpawnFlag) { EntityPtr *pEVar1; float fVar2; float fVar3; uint seed; Entity_Laser *pEVar4; EntityPtr *local_c [2]; seed = Random(); pEVar4 = (Entity_Laser *) Game::SpawnEx(g_game,7,variant,sourcePos,&g_vectorZero,source,0,seed,(uint)isSpawnFlag); if (pEVar4 == (Entity_Laser *)0x0) { return (Entity_Laser *)0x0; } pEVar4->_angleDegrees = angleDegrees; pEVar4->_startAngleDegrees = angleDegrees; pEVar4->_timeout = timeout; (pEVar4->_posOffset).x = posOffset->x; (pEVar4->_posOffset).y = posOffset->y; if (source != (Entity *)0x0) { pEVar1 = &pEVar4->_spawnerEntity; if (pEVar4->_spawnerEntity != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)source; std::multiset::insert(pEVar1); pEVar1 = &pEVar4->_parent; if (pEVar4->_parent != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = (EntityPtr)source; std::multiset::insert(pEVar1); fVar2 = (pEVar4->_pos).y; fVar3 = (source->_pos).y; (pEVar4->_parentOffset).x = (pEVar4->_pos).x - (source->_pos).x; (pEVar4->_parentOffset).y = fVar2 - fVar3; } return pEVar4; } //@@ 0096f420 Entity_Laser::SetActiveRotation /* ZHL [lua] Lua binding EntityLaser:SetActiveRotation */ void __thiscall Entity_Laser::SetActiveRotation (Entity_Laser *this,int param_2,float param_3,float param_4,char param_5) { int iVar1; this->_isActiveRotating = 1; this->_rotationDelay = param_2; this->_rotationDegrees = param_3; this->_rotationSpd = param_4; if (param_5 != '\0') { iVar1 = __ftoui3(); this->_timeout = iVar1 + 1 + param_2; } return; } //@@ 0096f470 Entity_Laser::RotateToAngle /* ZHL [exact] __thiscall void Entity_Laser::RotateToAngle(float angle, float speed); prototype: REPENTOGON */ void __thiscall Entity_Laser::RotateToAngle(Entity_Laser *this,float angle,float speed) { float fVar1; this->_isActiveRotating = 1; this->_rotationDelay = 0; fVar1 = angle_difference(this->_angleDegrees,angle); this->_rotationDegrees = fVar1; if (fVar1 < 0.0) { speed = -speed; } this->_rotationSpd = speed; return; } //@@ 0096f4e0 Entity_Laser::ClearLaserSamples /* ZHL [exact] __thiscall void Entity_Laser::ClearLaserSamples(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Laser::ClearLaserSamples(Entity_Laser *this) { void *pvVar1; void *pvVar2; void *pvVar3; undefined4 uVar4; int iVar5; undefined4 uVar6; undefined4 uVar7; pvVar1 = (this->_homingLaser)._bezier._begin; pvVar2 = (this->_homingLaser)._nonOptimizedSamples._begin; pvVar3 = (this->_homingLaser)._samples._begin; uVar4 = *(undefined4 *)&(this->_homingLaser).field_0x34; (this->_homingLaser)._bezier._end = pvVar1; (this->_homingLaser)._samples._end = pvVar3; *(undefined4 *)&(this->_homingLaser).field_0x38 = uVar4; (this->_homingLaser)._nonOptimizedSamples._end = pvVar2; iVar5 = this->_subtype; if (((iVar5 == 1) || (iVar5 == 2)) || (iVar5 == 3)) { uVar7 = 0x42700000; uVar6 = 1; this->_entityGridCollisionClass = 0; } else { uVar7 = 0x42f00000; uVar6 = 0; } (this->_homingLaser)._bezier._end = pvVar1; (this->_homingLaser)._samples._end = pvVar3; *(undefined4 *)&(this->_homingLaser).field_0x38 = uVar4; (this->_homingLaser)._nonOptimizedSamples._end = pvVar2; *(undefined4 *)&(this->_homingLaser).field_0x18 = 0x32; *(undefined4 *)&(this->_homingLaser).field_0x40 = uVar6; *(undefined4 *)&(this->_homingLaser).field_0x14 = uVar7; if (this->_homingType == 1) { *(undefined4 *)&(this->_homingLaser).field_0x14 = 0x43c80000; } return; } //@@ 0096f590 Entity_Laser::Init /* ZHL [exact] void Init(uint32_t type, uint32_t variant, uint32_t subtype, uint32_t seed); */ void __thiscall Entity_Laser::Init(Entity_Laser *this,int param_2,int param_3,int param_4,uint param_5) { byte bVar1; byte *pbVar2; uint uVar3; std_string *psVar4; bool bVar5; std_string *defaultAnimName; byte *animData; Entity::Init((Entity *)this,param_2,param_3,param_4,param_5); if (this->_config != (void *)0x0) { ANM2::Load(&this->_sprite,(std_string *)((int)this->_config + 0x74),1); defaultAnimName = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { defaultAnimName = *(std_string **)defaultAnimName->_buf; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { pbVar2 = animData; psVar4 = defaultAnimName; if (0xf < *(uint *)(animData + 0x14)) { pbVar2 = *(byte **)animData; } do { bVar1 = *pbVar2; bVar5 = bVar1 < (byte)psVar4->_buf[0]; if (bVar1 != psVar4->_buf[0]) { LAB_0096f610: uVar3 = -(uint)bVar5 | 1; goto LAB_0096f615; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar5 = bVar1 < (byte)psVar4->_buf[1]; if (bVar1 != psVar4->_buf[1]) goto LAB_0096f610; pbVar2 = pbVar2 + 2; psVar4 = (std_string *)(psVar4->_buf + 2); } while (bVar1 != 0); uVar3 = 0; LAB_0096f615: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0096f648; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)defaultAnimName,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_0096f648: *(undefined2 *)&this->field_0x517 = 0; this->_damageMultiplier = 1.0; this->_waitFrames = 0; (this->_parentOffset).x = g_vectorZero.x; (this->_parentOffset).y = g_vectorZero.y; this->_scale = 1.0; this->_angleDegrees = 0.0; this->_startAngleDegrees = 0.0; this->_lastAngleDegrees = 0.0; this->_renderDepthOffset = 0.0; *(undefined4 *)&(this->_tearFlags)._l = 0; *(undefined4 *)((int)&(this->_tearFlags)._l + 4) = 0; *(undefined4 *)&(this->_tearFlags)._h = 0; *(undefined4 *)((int)&(this->_tearFlags)._h + 4) = 0; *(undefined4 *)&(this->_activeTearFlags)._l = 0; *(undefined4 *)((int)&(this->_activeTearFlags)._l + 4) = 0; *(undefined4 *)&(this->_activeTearFlags)._h = 0; *(undefined4 *)((int)&(this->_activeTearFlags)._h + 4) = 0; *(undefined4 *)&(this->_heldTearFlags)._l = 0; *(undefined4 *)((int)&(this->_heldTearFlags)._l + 4) = 0; *(undefined4 *)&(this->_heldTearFlags)._h = 0; *(undefined4 *)((int)&(this->_heldTearFlags)._h + 4) = 0; this->_multidimensionalLasers[1] = (EntityPtr)0x0; this->_multidimensionalLasers[0] = (EntityPtr)0x0; this->_timeout = 0; this->_isFirstUpdate = 1; this->_sampleLaser = 0xff; this->_entityGridCollisionClass = 3; this->_laserLength = 0.0; this->_curveStrength = 0.0; this->_shrink = 0; this->_isActiveRotating = 0; this->_homingType = 0; this->_maxDistance = 0.0; this->_radius = 80.0; this->_disableFollowParent = 0; this->_bounceLaser = (void *)0x0; this->_multidimensionalTouched = 0; this->_prismTouched = 0; this->_oneHit = 0; *(undefined4 *)&this->field_0x4f0 = 0; this->_childLaser = (EntityPtr)0x0; this->_prismLasers[0] = (EntityPtr)0x0; this->_prismLasers[1] = (EntityPtr)0x0; this->_prismLasers[2] = (EntityPtr)0x0; this->_prismLasers[3] = (EntityPtr)0x0; (this->_hitList)._end = (this->_hitList)._begin; (this->_homingLaser)._bezier._end = (this->_homingLaser)._bezier._begin; (this->_homingLaser)._samples._end = (this->_homingLaser)._samples._begin; *(undefined4 *)&(this->_homingLaser).field_0x38 = *(undefined4 *)&(this->_homingLaser).field_0x34; (this->_homingLaser)._nonOptimizedSamples._end = (this->_homingLaser)._nonOptimizedSamples._begin; this->_blackHpDropChance = 0.0; this->_impactDistance = INFINITY; this->_subLaserDistance = INFINITY; this->_subLaserAngle = 0.0; this->_chainedLasers = 0; FUN_008615e0(this); return; } //@@ 0096f880 Entity_Laser::PlayInitSound /* ZHL [exact] __thiscall void Entity_Laser::PlayInitSound(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Entity_Laser::PlayInitSound(Entity_Laser *this) { int spawnerType; uint pitchRoll; Manager *manager; float volume; Entity_Laser *local_8; byte isLoop; int spawnerType; manager = g_manager; if (this->_disableInitSound != 0) { return; } if ((this->_parent != (EntityPtr)0x0) && (*(int *)((int)this->_parent + 0x28) == 7)) { return; } if (this->_visible == 0) { return; } switch(this->_variant) { case 1: case 8: case 9: if (this->_spawnerEntity == (EntityPtr)0x0) goto switchD_0096f8c9_caseD_3; local_8 = (Entity_Laser *)this->_scale; spawnerType = *(int *)((int)this->_spawnerEntity + 0x28); if (spawnerType < 0x3d) { if (spawnerType == 0x3c) { local_8 = (Entity_Laser *)0x87; } else { if ((spawnerType != 0x2b) && (spawnerType != 0x31)) goto LAB_0096f92b; local_8 = (Entity_Laser *)0x7; } break; } if (spawnerType == 0x54) { local_8 = (Entity_Laser *)0xd3; break; } if (spawnerType != 0x193) { LAB_0096f92b: if (this->_subtype == 0) { SoundEffects::PlayWithFartOverride(((float)local_8 < 0.75) + 5,1.0,2,0,1.0); return; } if (this->_subtype == 2) { SoundEffects::PlayWithFartOverride(((float)local_8 < 0.75) + 5,0.6,2,0,1.0); SoundEffects::PlayWithFartOverride((uint)(0.75 <= (float)local_8) * 2 + 0x10f,1.0,2,0,1.0); return; } return; } local_8 = (Entity_Laser *)0x3cb; seed_fart_sound_override((int *)&local_8); isLoop = 1; goto LAB_0096fc15; case 2: local_8 = (Entity_Laser *)this->_scale; pitchRoll = Random(); if (this->_subtype == 2) { spawnerType = 0x10f; if ((float)local_8 < 0.75) { spawnerType = 0x110; volume = 0.85; goto LAB_0096fb3b; } if (1.45 < (float)local_8) { volume = 1.1; spawnerType = 0x111; goto LAB_0096fb3b; } } else { spawnerType = 0x85; if ((float)local_8 < 0.75) { volume = 0.5; spawnerType = 0x86; goto LAB_0096fb3b; } if (1.45 < (float)local_8) { volume = 1.1; spawnerType = 0x87; goto LAB_0096fb3b; } } volume = 1.0; LAB_0096fb3b: if (this->_spawnerEntity != (EntityPtr)0x0) { spawnerType = *(int *)((int)this->_spawnerEntity + 0x28); if ((spawnerType == 1) || (spawnerType == 3)) { volume = volume * 0.9; } else if (spawnerType == 0xc9) { volume = volume * 0.4; } } SoundEffects::PlayWithFartOverride (spawnerType,volume,1,0, (float)((double)(int)pitchRoll + __uint_to_double_fixup[-((int)pitchRoll >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.85); return; case 3: switchD_0096f8c9_caseD_3: local_8 = (Entity_Laser *)0x5; break; default: goto switchD_0096f8c9_caseD_4; case 5: local_8 = (Entity_Laser *)0x114; break; case 6: case 0xf: local_8 = (Entity_Laser *)0x116; break; case 10: local_8 = this; pitchRoll = Random(); SoundEffects::PlayWithFartOverride (0x86,0.6,2,0, (float)((double)(int)pitchRoll + __uint_to_double_fixup[-((int)pitchRoll >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9); return; case 0xb: case 0xe: if (this->_subtype == 2) { local_8 = (Entity_Laser *)0xa; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&manager->_sfxManager,(int)local_8,0.6,2,0,1.0,0.0); local_8 = (Entity_Laser *)0x111; } else { if (this->_subtype == 1) { return; } local_8 = (Entity_Laser *)0xa; } break; case 0xc: local_8 = (Entity_Laser *)0x24d; } manager = g_manager; seed_fart_sound_override((int *)&local_8); isLoop = 0; LAB_0096fc15: SoundEffects::Play(&manager->_sfxManager,(int)local_8,1.0,2,isLoop,1.0,0.0); switchD_0096f8c9_caseD_4: return; } //@@ 0096fc70 Entity_Laser::calc_end_point /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: picks max distance 20.0 (140.0 with TearFlags mask DAT_00c348d0, 100.0/inf when room flag bit15 or variant 5) then Entity_Laser::CalculateEndPoint(out, .., ECX+0x34c pos, ECX+0x3bc angle, dist); Entity_Laser::update_laser, update_first_frame prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Entity_Laser::calc_end_point(Entity_Laser *this,Vector *outEndPoint,Vector *start,Vector *direction) { uint uVar1; uint uVar2; float margin; margin = 20.0; uVar1 = (uint)(this->_tearFlags)._l; uVar2 = (uint)(this->_tearFlags)._h; if (((uVar1 & _DAT_00c348d0) != 0 || (*(uint *)((int)&(this->_tearFlags)._l + 4) & _DAT_00c348d4) != 0) || ((uVar2 & _DAT_00c348d8) != 0 || (*(uint *)((int)&(this->_tearFlags)._h + 4) & _DAT_00c348dc) != 0)) { margin = 140.0; } if (((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 0xf & 1) != 0) || (this->_variant == 5)) { if (((uVar1 & DAT_00c34b70) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b74) == 0) && ((uVar2 & DAT_00c34b78) == 0 && (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b7c) == 0)) { margin = INFINITY; } else { margin = 100.0; } } CalculateEndPoint(outEndPoint,start,direction,&this->_posOffset,(Entity *)this->_parent,margin); return outEndPoint; } //@@ 0096fd60 Entity_Laser::CalculateEndPoint /* ZHL [lua] Lua binding EntityLaser:CalculateEndPoint prototype: db/protos.zhl, confirmed by RET 0 */ Vector * __cdecl Entity_Laser::CalculateEndPoint (Vector *outEndPoint,Vector *start,Vector *direction,Vector *positionOffset,Entity *parent ,float margin) { int iVar1; short marginClass; int *playerSlot; void *pvVar2; PlayerManager *playerManager; Game *game; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float local_48; float local_44; float nearestDist; uint playerIndex; undefined1 lRoomArea [36]; Room *room; game = g_game; iVar1 = g_game->_challenge; pvVar2 = g_game->_room; nearestDist = 1200.0; fVar5 = (*(float *)((int)pvVar2 + 0x14) - positionOffset->x) - margin; fVar3 = (*(float *)((int)pvVar2 + 0x20) - positionOffset->y) + margin; fVar6 = (*(float *)((int)pvVar2 + 0x18) - positionOffset->y) - margin; fVar7 = (*(float *)((int)pvVar2 + 0x1c) - positionOffset->x) + margin; local_48 = start->x; local_44 = start->y; outEndPoint->x = direction->x * 1200.0 + local_48; outEndPoint->y = direction->y * 1200.0 + local_44; if (iVar1 == 0x1e) { if (parent != (Entity *)0x0) { if ((parent->_type == 1) || (parent->_type == 3)) goto LAB_0096ff8f; } playerManager = &game->_playerManager; playerIndex = 0; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar2 = (playerManager->_playerList)._end; if ((int)pvVar2 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar2 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (playerIndex < (uint)((int)pvVar2 - (int)playerSlot >> 2)) { playerSlot = playerSlot + playerIndex; } local_48 = start->x; local_44 = start->y; fVar8 = *(float *)(*playerSlot + 0x33c) - local_48; fVar4 = *(float *)(*playerSlot + 0x340) - local_44; fVar9 = direction->x; fVar11 = fVar8 * fVar9 + fVar4 * direction->y; fVar10 = direction->y; if (((ABS(fVar8 * fVar10 - fVar4 * fVar9) < margin) && (0.0 < fVar11)) && (fVar11 < nearestDist)) { outEndPoint->x = fVar9 * fVar11 + local_48; outEndPoint->y = fVar10 * fVar11 + local_44; nearestDist = fVar11; } playerIndex = playerIndex + 1; playerManager = &g_game->_playerManager; } while (playerIndex < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } game = g_game; } LAB_0096ff8f: marginClass = fdclass(margin); if (marginClass < 1) { fVar9 = outEndPoint->x - local_48; fVar10 = outEndPoint->y - local_44; if (fVar5 < local_48) { fVar4 = fVar5 - local_48; fVar8 = fVar9 * fVar4 + fVar10 * 0.0; fVar4 = fVar4 * fVar4 + 0.0; if (fVar4 <= fVar8) { fVar4 = fVar4 / fVar8; fVar10 = fVar10 * fVar4; fVar9 = fVar9 * fVar4; } } if (local_48 < fVar7) { fVar4 = fVar7 - local_48; fVar8 = fVar9 * fVar4 + fVar10 * 0.0; fVar4 = fVar4 * fVar4 + 0.0; if (fVar4 <= fVar8) { fVar4 = fVar4 / fVar8; fVar9 = fVar9 * fVar4; fVar10 = fVar10 * fVar4; } } if (fVar6 < local_44) { fVar4 = fVar6 - local_44; fVar8 = fVar10 * fVar4 + fVar9 * 0.0; fVar4 = fVar4 * fVar4 + 0.0; if (fVar4 <= fVar8) { fVar4 = fVar4 / fVar8; fVar9 = fVar9 * fVar4; fVar10 = fVar10 * fVar4; } } if (local_44 < fVar3) { fVar4 = fVar3 - local_44; fVar8 = fVar10 * fVar4 + fVar9 * 0.0; fVar4 = fVar4 * fVar4 + 0.0; if (fVar4 <= fVar8) { fVar4 = fVar4 / fVar8; fVar9 = fVar9 * fVar4; fVar10 = fVar10 * fVar4; } } room = game->_room; pvVar2 = room->_descriptor; outEndPoint->x = fVar9 + local_48; outEndPoint->y = fVar10 + local_44; if (*(int *)(*(int *)((int)pvVar2 + 0x10) + 0x48) - 9U < 4) { local_48 = local_48 - (fVar9 + local_48); local_44 = local_44 - (fVar10 + local_44); Room::GetLRoomAreaDesc(room,lRoomArea); iVar1 = *(int *)((int)game->_room + 4); if ((iVar1 != 0) && (iVar1 = *(int *)(iVar1 + 0x10), iVar1 != 0)) { switch(*(undefined4 *)(iVar1 + 0x48)) { case 9: if ((outEndPoint->x < fVar5 + 520.0) && (fVar6 = fVar6 + 280.0, outEndPoint->y <= fVar6 && fVar6 != outEndPoint->y)) { fVar3 = (fVar5 + 520.0) - outEndPoint->x; fVar5 = fVar3 * fVar3 + 0.0; fVar3 = fVar3 * local_48 + local_44 * 0.0; if (fVar5 <= fVar3) { fVar5 = fVar5 / fVar3; local_44 = fVar5 * local_44; local_48 = fVar5 * local_48; } fVar6 = fVar6 - outEndPoint->y; fVar3 = local_44 * fVar6 + local_48 * 0.0; fVar5 = fVar6 * fVar6 + 0.0; if (fVar5 <= fVar3) { fVar5 = fVar5 / fVar3; local_48 = local_48 * fVar5; local_44 = local_44 * fVar5; } } break; case 10: if ((fVar7 - 520.0 < outEndPoint->x) && (fVar6 = fVar6 + 280.0, outEndPoint->y <= fVar6 && fVar6 != outEndPoint->y)) { fVar3 = (fVar7 - 520.0) - outEndPoint->x; fVar5 = fVar3 * fVar3 + 0.0; fVar3 = fVar3 * local_48 + local_44 * 0.0; if (fVar5 <= fVar3) { fVar5 = fVar5 / fVar3; local_44 = fVar5 * local_44; local_48 = fVar5 * local_48; } fVar6 = fVar6 - outEndPoint->y; fVar3 = local_44 * fVar6 + local_48 * 0.0; fVar5 = fVar6 * fVar6 + 0.0; if (fVar5 <= fVar3) { fVar5 = fVar5 / fVar3; local_48 = local_48 * fVar5; local_44 = local_44 * fVar5; } } break; case 0xb: if ((outEndPoint->x < fVar5 + 520.0) && (fVar3 - 280.0 < outEndPoint->y)) { fVar5 = (fVar5 + 520.0) - outEndPoint->x; fVar6 = fVar5 * fVar5 + 0.0; fVar5 = fVar5 * local_48 + local_44 * 0.0; if (fVar6 <= fVar5) { fVar6 = fVar6 / fVar5; local_44 = fVar6 * local_44; local_48 = fVar6 * local_48; } fVar5 = (fVar3 - 280.0) - outEndPoint->y; fVar3 = local_44 * fVar5 + local_48 * 0.0; fVar5 = fVar5 * fVar5 + 0.0; if (fVar5 <= fVar3) { fVar5 = fVar5 / fVar3; local_48 = local_48 * fVar5; local_44 = local_44 * fVar5; } } break; case 0xc: if ((fVar7 - 520.0 < outEndPoint->x) && (fVar3 - 280.0 < outEndPoint->y)) { fVar5 = (fVar7 - 520.0) - outEndPoint->x; fVar6 = fVar5 * fVar5 + 0.0; fVar5 = fVar5 * local_48 + local_44 * 0.0; if (fVar6 <= fVar5) { fVar6 = fVar6 / fVar5; local_44 = fVar6 * local_44; local_48 = fVar6 * local_48; } fVar5 = (fVar3 - 280.0) - outEndPoint->y; fVar3 = local_44 * fVar5 + local_48 * 0.0; fVar5 = fVar5 * fVar5 + 0.0; if (fVar5 <= fVar3) { fVar5 = fVar5 / fVar3; local_48 = local_48 * fVar5; local_44 = local_44 * fVar5; } } } } local_48 = local_48 + outEndPoint->x; local_44 = local_44 + outEndPoint->y; fVar5 = start->x - local_48; fVar3 = start->y - local_44; if (0.01 < fVar3 * fVar3 + fVar5 * fVar5) { outEndPoint->x = local_48; outEndPoint->y = local_44; return outEndPoint; } } } return outEndPoint; } //@@ 009704a0 Entity_Laser::update_first_frame /* DB: ? called from Entity_Laser::Update in the two first-frame paths (then +0x45c=0); variant 4 (Tech X ring) sets end point 300 units, else direction from angle +0x41c, FUN_0097f820, GetGridCollision, update_laser, UpdateHits, PlayInitSound, ClearLaserSamples prototype: db/protos.zhl */ void __thiscall Entity_Laser::update_first_frame(Entity_Laser *room) { int stepY; char isCircleLaser; byte isSampleLaser; int gridX; uint gridCollision; Vector *pVVar2; Vector *clampedOffset; int unused; Entity_Laser *this_00; void *gridEntity; float *endPointSrc; uint index; float fVar3; float fVar4; float fVar5; undefined1 auVar6 [12]; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float rayT; int cellX; int gridY; int cellY; float rayX; float rayY; Vector local_30; float hitX; float hitY; Vector local_20; undefined1 local_18 [8]; uint local_10; uint local_c; EntityPtr parent; Room *room; int stepY; PlayInitSound(room); fVar7 = room->_angleDegrees * 0.017453292; if (room->_variant == 4) { (room->_sprite)._rotation = room->_angleDegrees; room->_laserLength = 300.0; fVar3 = cos(fVar7); fVar11 = (room->_pos).x; fVar9 = (room->_posOffset).x; fVar4 = sin(fVar7); fVar7 = (room->_posOffset).y; fVar10 = (room->_pos).y; (room->_endPoint).x = fVar3 * 300.0 + fVar11 + fVar9; (room->_endPoint).y = fVar4 * 300.0 + fVar7 + fVar10; room->_sampleLaser = 0; return; } local_30.x = cos(fVar7); local_30.y = sin(fVar7); if (ABS(local_30.x) < 0.0001) { local_30.x = 0.0; } if (ABS(local_30.y) < 0.0001) { local_30.y = 0.0; } (room->_sprite)._flipX = (byte)((uint)room->_initSeed >> 8) & 1; ResetSpriteScale(room); spawn_impact_effect(room,unused); isSampleLaser = room->_sampleLaser; if ((char)isSampleLaser < '\0') { parent = room->_parent; if (parent == (EntityPtr)0x0) { LAB_00970730: isSampleLaser = 0; } else { stepY = *(int *)((int)parent + 0x28); if (((stepY != 1) && (room->_spawnerType != 1)) && (stepY != 0x3e)) { if (stepY == 1000) { if (*(int *)((int)parent + 0x2c) != 0xb2) goto LAB_009706c5; } else if (((stepY != 0x107) && (stepY != 0x10c)) && (stepY != 0x19a)) { if (stepY == 0x104) { if (*(int *)((int)parent + 0x30) != 2) { LAB_009706c5: if ((room->_isActiveRotating == 0) && (isCircleLaser = IsCircleLaser(room), isCircleLaser == '\0')) { local_18._0_4_ = (uint)(room->_tearFlags)._l & DAT_00c34b70; local_18._4_4_ = *(uint *)((int)&(room->_tearFlags)._l + 4) & DAT_00c34b74; local_10 = (uint)(room->_tearFlags)._h & DAT_00c34b78; local_c = *(uint *)((int)&(room->_tearFlags)._h + 4) & DAT_00c34b7c; isSampleLaser = BitSet128::IsNonZero((BitSet128 *)local_18); if (isSampleLaser == 0) goto LAB_00970730; } } } else { if (stepY != 3) goto LAB_009706c5; if ((*(int *)((int)parent + 0x2c) != 0x50) && (*(int *)((int)parent + 0x2c) != 0x78)) { local_18._0_4_ = (uint)(room->_tearFlags)._l & (uint)g_tearFlagHoming._l; local_18._4_4_ = *(uint *)((int)&(room->_tearFlags)._l + 4) & g_tearFlagHoming._l._4_4_; local_10 = (uint)(room->_tearFlags)._h & (uint)g_tearFlagHoming._h; local_c = *(uint *)((int)&(room->_tearFlags)._h + 4) & g_tearFlagHoming._h._4_4_; isSampleLaser = BitSet128::IsNonZero((BitSet128 *)local_18); if (isSampleLaser == 0) goto LAB_009706c5; } } } } if (room->_variant == 7) goto LAB_00970730; isSampleLaser = 1; } room->_sampleLaser = isSampleLaser; } if (isSampleLaser != 0) { ClearLaserSamples(room); stepY = room->_subtype; if (((stepY == 1) || (stepY == 2)) || (stepY == 3)) { UpdateHits(this_00); return; } goto LAB_00970ca5; } fVar11 = (room->_posOffset).x + (room->_pos).x; fVar7 = (room->_posOffset).y + (room->_pos).y; local_20.x = fVar11; local_20.y = fVar7; if (room->_entityGridCollisionClass == 6) { local_18._0_4_ = local_30.x * 10000.0 + fVar11; fVar10 = fVar11 - local_30.x * 4.0; room = g_game->_room; local_18._4_4_ = local_30.y * 10000.0 + fVar7; fVar9 = fVar7 - local_30.y * 4.0; hitX = fVar10; fVar4 = (float)local_18._0_4_ - fVar10; fVar3 = (float)local_18._4_4_ - fVar9; hitY = fVar9; gridX = (int)((fVar10 - 40.0) / 40.0 + 0.5); gridY = (int)((fVar9 - 120.0) / 40.0 + 0.5); stepY = (uint)(0.0 < fVar4) * 2 + -1; rayT = 0.0; stepY = (uint)(0.0 < fVar3) * 2 + -1; if ((fVar4 != g_vectorZero.x) || (fVar8 = 0.0, fVar3 != g_vectorZero.y)) { cellY = gridY * 0x28; cellX = gridX * 0x28; rayX = fVar10; rayY = fVar9; do { hitX = rayX; hitY = rayY; if (((gridX < 0) || (room->_gridWidth <= gridX)) || ((gridY < 0 || (room->_gridHeight <= gridY)))) { gridCollision = Room::GetGridCollision(room,-1); LAB_0097095e: gridEntity = (void *)0x0; } else { index = gridY * room->_gridWidth + gridX; gridCollision = Room::GetGridCollision(room,index); if (0x1bf < index) goto LAB_0097095e; gridEntity = room->_gridEntities[index]; } if (((((gridCollision == 2) || (gridCollision == 3)) || (gridCollision == 4)) || (gridCollision == 5)) && ((fVar8 = rayT, gridEntity == (void *)0x0 || ((*(int *)((int)gridEntity + 4) != 0xf && (*(int *)((int)gridEntity + 4) != 0x10)))))) break; if (fVar4 == 0.0) { fVar8 = INFINITY; } else { fVar8 = ((float)(cellX + (stepY * 5 + 10) * 4) - rayX) / fVar4; } if (fVar3 == 0.0) { fVar5 = INFINITY; } else { fVar5 = ((float)(cellY + (stepY * 5 + 0x1e) * 4) - rayY) / fVar3; } if (fVar5 <= fVar8) { gridY = gridY + stepY; cellY = cellY + stepY * 0x28; } else { gridX = gridX + stepY; cellX = cellX + stepY * 0x28; fVar5 = fVar8; } rayT = fVar5 + rayT; rayY = fVar3 * rayT + fVar9; rayX = fVar4 * rayT + fVar10; hitY = rayY; hitX = rayX; fVar8 = rayT; } while (rayT < 1.0); } if (&room->_endPoint != (Vector *)0x0) { endPointSrc = (float *)local_18; if (fVar8 < 1.0) { endPointSrc = &hitX; } (room->_endPoint).x = *endPointSrc; (room->_endPoint).y = endPointSrc[1]; } if (1.0 <= fVar8) { pVVar2 = calc_end_point(room,(Vector *)local_18,&local_20,&local_30); fVar10 = (room->_posOffset).x + pVVar2->x; fVar9 = (room->_posOffset).y + pVVar2->y; LAB_00970af5: (room->_endPoint).x = fVar10; (room->_endPoint).y = fVar9; } } else { if (room->_entityGridCollisionClass == 3) { pVVar2 = calc_end_point(room,(Vector *)local_18,&local_20,&local_30); fVar10 = (room->_posOffset).x + pVVar2->x; fVar9 = (room->_posOffset).y + pVVar2->y; goto LAB_00970af5; } (room->_endPoint).x = local_30.x * 1000.0 + fVar11; (room->_endPoint).y = local_30.y * 1000.0 + fVar7; } pVVar2 = &room->_endPoint; fVar9 = room->_maxDistance; if (0.0 < fVar9) { fVar10 = (room->_endPoint).y; fVar3 = fVar11 - pVVar2->x; fVar4 = fVar7 - fVar10; if (fVar9 * fVar9 < fVar4 * fVar4 + fVar3 * fVar3) { local_18._0_4_ = pVVar2->x - fVar11; local_18._4_4_ = fVar10 - fVar7; clampedOffset = Vector::Resized((Vector *)local_18,&local_20,fVar9); fVar9 = clampedOffset->y; pVVar2->x = fVar11 + clampedOffset->x; (room->_endPoint).y = fVar7 + fVar9; } } fVar11 = pVVar2->x - fVar11; fVar7 = (room->_endPoint).y - fVar7; fVar7 = sqrtf(fVar7 * fVar7 + fVar11 * fVar11); room->_laserLength = fVar7; if ((room->_variant == 6) || (room->_variant == 0xf)) { if (room->_spawnerType == 0x19a) { auVar6 = ZEXT812(0x42b00000); if (auVar6._0_4_ <= fVar7) { auVar6._4_8_ = auVar6._4_8_; auVar6._0_4_ = fVar7; } room->_laserLength = auVar6._0_4_; } else { room->_laserLength = fVar7 + 100.0; } } (room->_sprite)._rotation = room->_angleDegrees - 90.0; LAB_00970ca5: update_laser(); return; } //@@ 00970cb0 Entity_Laser::find_nearest_grid_hit /* WARNING: Type propagation algorithm not settling */ /* DB: ? ECX=laser: walks sample vector +0x48c..+0x490 offset by param_2, Room::GetGridCollision/IsPositionInRoom, stores min distance +0x544 and point +0x548/+0x54c; caller 009737b0 Entity_Laser::update_endpoint_and_hits update_laser/UpdateHits) presets +0x544 = +inf prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Entity_Laser::find_nearest_grid_hit(Entity_Laser *this,int unusedFlag,Vector *offset) { byte isInRoom; int iVar1; BitSet128 *maskedFlags; Room *extraout_ECX; Room *extraout_ECX_00; Room *extraout_ECX_01; Room *extraout_ECX_02; Room *extraout_ECX_03; Room *pRVar2; Room *extraout_ECX_04; void *pvVar3; int iVar4; uint uVar5; Room *node; float dirY; float relY; float relX; float alongDistance; float maxReach; BitSet128 local_e0; BitSet128 local_d0; undefined1 local_bc [8]; undefined1 local_b4 [8]; int hitEntryLeft; float local_a8; float local_a4; int hitEntryRight; float local_9c; float local_98; Vector lastSamplePos; uint sampleCount; float sideOffsetY; float sideOffsetX; float perpY; Vector checkPos; float lastInRoomDirY; float lastInRoomDirX; float lastInRoomY; float lastInRoomX; float lastInRoomDistance; uint sampleIndex; float local_5c; float prevSampleX; Vector local_54; float widthOffset; float local_48; float local_44; Room *hitGridSet; undefined4 local_3c; float sampleY; float sampleX; float local_30; float travelled; float segmentDirX; float segmentDirY; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; char isNil; Room *nextNode; EntityPtr parent; float *samples; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0ca6d; local_1c = ExceptionList; ExceptionList = &local_1c; if (this->_sampleLaser != 0) { hitGridSet = (Room *)0x0; local_3c = 0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); hitGridSet = operator_new(0x1c); *(Room **)hitGridSet = hitGridSet; hitGridSet->_descriptor = hitGridSet; hitGridSet->_roomType = (int)hitGridSet; *(undefined2 *)&hitGridSet->_gridWidth = 0x101; local_14 = 0; samples = (this->_homingLaser)._nonOptimizedSamples._begin; uVar5 = (int)(this->_homingLaser)._nonOptimizedSamples._end - (int)samples >> 3; sampleCount = uVar5; if (1 < uVar5) { lastInRoomDirY = 0.0; lastInRoomX = *samples + offset->x; lastInRoomY = samples[1] + offset->y; lastInRoomDirX = 0.0; lastInRoomDistance = 0.0; sampleIndex = 0; travelled = 0.0; prevSampleX = lastInRoomX; local_30 = lastInRoomY; do { pvVar3 = (this->_homingLaser)._nonOptimizedSamples._begin; if (sampleIndex < uVar5) { sampleX = *(float *)((int)pvVar3 + sampleIndex * 8) + offset->x; sampleY = *(float *)((int)pvVar3 + sampleIndex * 8 + 4) + offset->y; if (sampleIndex < uVar5 - 1) { segmentDirY = *(float *)((int)pvVar3 + sampleIndex * 8 + 0xc) - *(float *)((int)pvVar3 + sampleIndex * 8 + 4); segmentDirX = *(float *)((int)pvVar3 + sampleIndex * 8 + 8) - *(float *)((int)pvVar3 + sampleIndex * 8); } else { segmentDirY = *(float *)((int)pvVar3 + sampleIndex * 8 + 4) - *(float *)((int)pvVar3 + sampleIndex * 8 + -4); segmentDirX = *(float *)((int)pvVar3 + sampleIndex * 8) - *(float *)((int)pvVar3 + sampleIndex * 8 + -8); } } else { segmentDirX = *(float *)((int)pvVar3 + uVar5 * 8 + -8) - *(float *)((int)pvVar3 + uVar5 * 8 + -0x10); sampleX = (*(float *)((int)pvVar3 + uVar5 * 8 + -8) - *(float *)((int)pvVar3 + uVar5 * 8 + -0x10)) + *(float *)((int)pvVar3 + uVar5 * 8 + -8) + offset->x; sampleY = (*(float *)((int)pvVar3 + uVar5 * 8 + -4) - *(float *)((int)pvVar3 + uVar5 * 8 + -0xc)) + *(float *)((int)pvVar3 + uVar5 * 8 + -4) + offset->y; segmentDirY = *(float *)((int)pvVar3 + uVar5 * 8 + -4) - *(float *)((int)pvVar3 + uVar5 * 8 + -0xc); } local_54.x = sampleX; local_54.y = sampleY; local_5c = sqrtf(segmentDirX * segmentDirX + segmentDirY * segmentDirY); segmentDirY = segmentDirY / local_5c; segmentDirX = segmentDirX / local_5c; perpY = -segmentDirX; isInRoom = Room::IsPositionInRoom(g_game->_room,&local_54,0.0); if (isInRoom != 0) { lastInRoomDistance = travelled; lastInRoomX = sampleX; lastInRoomY = sampleY; lastInRoomDirX = segmentDirX; lastInRoomDirY = segmentDirY; } widthOffset = 0.0; pRVar2 = extraout_ECX; if (0.0 < this->_size) { do { game = g_game; sideOffsetX = segmentDirY * widthOffset; sideOffsetY = perpY * widthOffset; checkPos.x = sampleX + sideOffsetX; checkPos.y = sideOffsetY + sampleY; local_48 = checkPos.x; local_44 = checkPos.y; isInRoom = Room::IsPositionInRoom(g_game->_room,&checkPos,-8.0); if (isInRoom == 0) { maskedFlags = BitSet128::operator_and (&local_d0,&this->_tearFlags,(BitSet128 *)&DAT_00c348d0); pRVar2 = (Room *)((uint)maskedFlags->_l | *(uint *)((int)&maskedFlags->_l + 4)); if ((pRVar2 != (Room *)0x0) || (pRVar2 = (Room *)((uint)maskedFlags->_h | *(uint *)((int)&maskedFlags->_h + 4)), pRVar2 != (Room *)0x0)) { LAB_00971074: if (travelled < this->_impactDistance) { this->_impactDistance = travelled; (this->_impactPosition).x = prevSampleX; (this->_impactPosition).y = local_30; (this->_impactDirection).x = segmentDirX; (this->_impactDirection).y = segmentDirY; } } } else { pRVar2 = game->_room; iVar4 = (int)((local_48 - 40.0) / 40.0 + 0.5); iVar1 = (int)((local_44 - 120.0) / 40.0 + 0.5); if (((-1 < iVar4) && (((iVar4 < pRVar2->_gridWidth && (-1 < iVar1)) && (iVar1 < pRVar2->_gridHeight)))) && (iVar4 = pRVar2->_gridWidth * iVar1 + iVar4, -1 < iVar4)) { uVar5 = Room::GetGridCollision(pRVar2,iVar4); pRVar2 = extraout_ECX_00; if ((uVar5 != 1) && (uVar5 != 0)) { local_9c = segmentDirX; local_98 = segmentDirY; hitEntryRight = iVar4; std::set::insert(local_b4,&hitEntryRight); pRVar2 = extraout_ECX_01; goto LAB_00971074; } } } game = g_game; if (widthOffset != 0.0) { checkPos.x = sampleX - sideOffsetX; checkPos.y = sampleY - sideOffsetY; local_48 = checkPos.y; local_44 = checkPos.x; isInRoom = Room::IsPositionInRoom(g_game->_room,&checkPos,-8.0); if (isInRoom == 0) { maskedFlags = BitSet128::operator_and (&local_e0,&this->_tearFlags,(BitSet128 *)&DAT_00c348d0); pRVar2 = (Room *)((uint)maskedFlags->_l | *(uint *)((int)&maskedFlags->_l + 4)); if ((pRVar2 != (Room *)0x0) || (pRVar2 = (Room *)((uint)maskedFlags->_h | *(uint *)((int)&maskedFlags->_h + 4)), pRVar2 != (Room *)0x0)) { LAB_009711e5: if (travelled < this->_impactDistance) { this->_impactDistance = travelled; (this->_impactPosition).x = local_44; (this->_impactPosition).y = local_48; (this->_impactDirection).x = segmentDirX; (this->_impactDirection).y = segmentDirY; } } } else { pRVar2 = game->_room; iVar4 = (int)((local_44 - 40.0) / 40.0 + 0.5); iVar1 = (int)((local_48 - 120.0) / 40.0 + 0.5); if (((-1 < iVar4) && (((iVar4 < pRVar2->_gridWidth && (-1 < iVar1)) && (iVar1 < pRVar2->_gridHeight)) )) && (iVar4 = pRVar2->_gridWidth * iVar1 + iVar4, -1 < iVar4)) { uVar5 = Room::GetGridCollision(pRVar2,iVar4); pRVar2 = extraout_ECX_02; if ((uVar5 != 1) && (uVar5 != 0)) { local_a8 = segmentDirX; local_a4 = segmentDirY; hitEntryLeft = iVar4; std::set::insert(local_bc,&hitEntryLeft); pRVar2 = extraout_ECX_03; goto LAB_009711e5; } } } } widthOffset = widthOffset + 20.0; } while (widthOffset < this->_size); uVar5 = sampleCount; } travelled = travelled + local_5c; sampleIndex = sampleIndex + 1; prevSampleX = sampleX; lastSamplePos.x = sampleX; local_30 = sampleY; lastSamplePos.y = sampleY; } while (sampleIndex <= uVar5); node = *(Room **)hitGridSet; if (node != hitGridSet) { do { damage_grid_entity(node->_gridHeight,pRVar2,&node->_topLeftPos); pRVar2 = (Room *)node->_roomType; if (*(char *)((int)&pRVar2->_gridWidth + 1) == '\0') { isNil = *(char *)((int)&(*(Room **)pRVar2)->_gridWidth + 1); node = pRVar2; pRVar2 = *(Room **)pRVar2; while (isNil == '\0') { isNil = *(char *)((int)&(*(Room **)pRVar2)->_gridWidth + 1); node = pRVar2; pRVar2 = *(Room **)pRVar2; } } else { isNil = *(char *)((int)&node->_descriptor->_gridWidth + 1); nextNode = node->_descriptor; pRVar2 = node; while ((node = nextNode, isNil == '\0' && (pRVar2 == (Room *)node->_roomType))) { isNil = *(char *)((int)&node->_descriptor->_gridWidth + 1); nextNode = node->_descriptor; pRVar2 = node; } pRVar2 = extraout_ECX_04; } } while (node != hitGridSet); } isInRoom = Room::IsPositionInRoom(g_game->_room,&lastSamplePos,0.0); if ((((isInRoom == 0) && (lastInRoomDistance < this->_impactDistance)) && (iVar1 = this->_subtype, iVar1 != 1)) && ((iVar1 != 2 && (iVar1 != 3)))) { (this->_impactDirection).x = lastInRoomDirX; this->_impactDistance = lastInRoomDistance; (this->_impactPosition).x = lastInRoomX; (this->_impactPosition).y = lastInRoomY; (this->_impactDirection).y = lastInRoomDirY; } } FID_conflict__Erase_tree_>_> (&hitGridSet,(fuzzer_allocator_> *)&hitGridSet, hitGridSet->_descriptor); operator_delete(hitGridSet,0x1c); ExceptionList = local_1c; return; } local_5c = this->_angleDegrees * 0.017453292; local_54.x = cos(local_5c); dirY = sin(local_5c); parent = this->_parent; if (parent != (EntityPtr)0x0) { iVar1 = *(int *)((int)parent + 0x28); if (iVar1 == 2) { iVar1 = *(int *)((int)parent + 0x34); } else { if (iVar1 != 1000) { if ((iVar1 == 1) || (iVar1 == 3)) goto LAB_0097143e; goto LAB_0097142d; } iVar1 = *(int *)((int)parent + 0x34); } if (iVar1 == 1) goto LAB_0097143e; } LAB_0097142d: if ((this->_spawnerType != 1) && (this->_spawnerType != 3)) { ExceptionList = local_1c; return; } LAB_0097143e: uVar5 = 0; pvVar3 = g_game->_room; if (0 < *(int *)((int)pvVar3 + 0x10) * *(int *)((int)pvVar3 + 0xc)) { local_30 = 5.04467e-44; local_54.y = dirY; do { if ((uVar5 < 0x1c0) && (*(int *)((int)pvVar3 + (int)local_30) != 0)) { relX = (((float)((int)uVar5 % *(int *)((int)pvVar3 + 0xc)) * 40.0 + 40.0) - (this->_pos).x) + offset->x; relY = (((float)((int)uVar5 / *(int *)((int)pvVar3 + 0xc)) * 40.0 + 120.0) - (this->_pos).y) + offset->y; if (0.0 < this->_maxDistance) { maxReach = this->_size + this->_maxDistance; } else { maxReach = INFINITY; } alongDistance = relY * dirY + relX * local_54.x; if (((ABS(relY * local_54.x + relX * dirY) < this->_size + 15.0) && (0.0 < alongDistance)) && (alongDistance <= maxReach)) { damage_grid_entity(uVar5,offset,&local_54); dirY = local_54.y; } } uVar5 = uVar5 + 1; local_30 = (float)((int)local_30 + 4); pvVar3 = g_game->_room; } while ((int)uVar5 < *(int *)((int)pvVar3 + 0x10) * *(int *)((int)pvVar3 + 0xc)); } ExceptionList = local_1c; return; } //@@ 00971590 Entity_Laser::damage_grid_entity /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (grid index): grid collision class not 0/1 and 1/4 Random(): ORs player GetTearHitParams tear flags, grid vfunc +0x14 hurt with EntityRef(laser), Room::TryMakeBridge for rock breaking, else vfunc +0x10; Entity_Laser::find_nearest_grid_hit */ undefined4 Entity_Laser::damage_grid_entity(uint param_1,undefined4 param_2,Vector *param_3) { GridEntity *this; EntityPtr EVar1; code *pcVar2; Room *this_00; byte bVar3; char cVar4; uint uVar5; int iVar6; BitSet128 *pBVar7; Vector *pVVar8; undefined4 uVar9; Entity *in_ECX; EntityRef local_d0; undefined1 local_a8 [8]; Vector local_a0; undefined1 local_98 [8]; Vector local_90; undefined1 local_88 [8]; Vector VStack_80; undefined1 local_78 [108]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if ((0x1bf < param_1) || (this = *(GridEntity **)((int)g_game->_room + param_1 * 4 + 0x24), this == (GridEntity *)0x0)) { return 0; } if (((this->_collisionClass != 1) && (this->_collisionClass != 0)) && (uVar5 = Random(), (uVar5 & 3) == 0)) { local_88._0_4_ = *(uint *)((int)&in_ECX[1]._pendingDamageFlags + 4); local_88._4_4_ = in_ECX[1]._index; VStack_80.x = (float)in_ECX[1]._collisionIndex; VStack_80.y = (float)in_ECX[1]._type; EVar1 = in_ECX->_spawnerEntity; if ((EVar1 != (EntityPtr)0x0) && ((*(int *)((int)EVar1 + 0x28) == 1 || (((EVar1 != (EntityPtr)0x0 && (*(int *)((int)EVar1 + 0x28) == 3)) && ((*(int *)((int)EVar1 + 0x2c) == 0x50 && (*(int *)((int)EVar1 + 0x410) != 0)))))))) { iVar6 = Entity_Player::GetTearHitParams(local_78,3,0x3f800000,0,EVar1); local_88._0_4_ = local_88._0_4_ | *(uint *)(iVar6 + 0x38); local_88._4_4_ = local_88._4_4_ | *(uint *)(iVar6 + 0x3c); VStack_80.x = (float)((uint)VStack_80.x | *(uint *)(iVar6 + 0x40)); VStack_80.y = (float)((uint)VStack_80.y | *(uint *)(iVar6 + 0x44)); } pBVar7 = BitSet128::operator_or ((BitSet128 *)local_a8,(BitSet128 *)&DAT_00c34a30,(BitSet128 *)&DAT_00c34980) ; pBVar7 = BitSet128::operator_and((BitSet128 *)local_98,(BitSet128 *)local_88,pBVar7); bVar3 = BitSet128::IsNonZero(pBVar7); if ((bVar3 != 0) && (cVar4 = (**(code **)(*(int *)this + 0x1c))(), cVar4 != '\0')) { pcVar2 = *(code **)(*(int *)this + 0x14); EntityRef::constructor(&local_d0,in_ECX); cVar4 = (*pcVar2)(0,&local_d0); if (cVar4 != '\0') { Vector::ToCardinal(&local_90,param_3); if ((local_90.x != g_vectorZero.x) || (local_90.y != g_vectorZero.y)) { pVVar8 = GridEntity::Position(this,&VStack_80); local_a0.x = local_90.x * 40.0 + pVVar8->x; local_a0.y = local_90.y * 40.0 + pVVar8->y; this_00 = g_game->_room; iVar6 = Room::GetGridIndex(this_00,&local_a0); if (-1 < iVar6) { if (iVar6 < 0x1c0) { Room::TryMakeBridge(this_00,this_00->_gridEntities[iVar6],this); return 1; } Room::TryMakeBridge(this_00,(GridEntity *)0x0,this); } } return 1; } } } pcVar2 = *(code **)(*(int *)this + 0x10); EntityRef::constructor(&local_d0,in_ECX); uVar9 = (*pcVar2)(1,&local_d0); return uVar9; } //@@ 00971810 Entity_Laser::update_line_hits /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=Entity_Laser, !_sampleLaser path: loops room entity list, CanDamageEntity, perpendicular distance to beam angle (+0x41c) vs entity size, FUN_0097e3c0(entity) records hit, tear-flag effects; called twice from 009737b0 Entity_Laser::update_endpoint_and_hits helper) prototype: db/protos.zhl */ void __thiscall Entity_Laser::update_line_hits(Entity_Laser *this) { float fVar1; float fVar2; BitSet128 flags; byte bVar3; char cVar4; BitSet128 *maskedFlags; int iVar5; uint uVar6; int *impactEffect; void *pvVar7; LayerState *layer; uint uVar8; int extraout_ECX; Entity_Tear *extraout_EDX; float *extraout_EDX_00; float *extraout_EDX_01; Entity_Laser *extraout_EDX_02; Entity_Laser *pEVar9; float *pfVar10; bool bVar11; float in_XMM0_Da; float fVar12; float *pfVar13; float *pfVar14; float *in_XMM1_Da; Entity_Tear *pEVar15; Entity *pEVar16; Entity_Tear *pEVar17; float fVar18; float fVar19; BitSet128 *b; BitSet128 *b_00; undefined4 uVar20; TypeDescriptor *pTVar21; BitSet128 *b_01; TypeDescriptor *pTVar22; undefined4 uVar23; BitSet128 *pBVar24; BitSet128 *b_02; BitSet128 local_270; BitSet128 local_260; BitSet128 local_250; BitSet128 local_240; BitSet128 local_230; BitSet128 local_220; BitSet128 local_210; BitSet128 local_200; BitSet128 local_1f0; BitSet128 local_1e0; BitSet128 local_1d0; BitSet128 local_1c0; BitSet128 local_1b0; BitSet128 local_1a0; BitSet128 local_190; BitSet128 local_180; BitSet128 local_170; float candidatePosX; float candidatePosY; Vector splashPos; Vector splashVelocity; Vector tearSpawnPos; Vector clampedImpactPos; Color scratchColor; Vector local_104; Vector local_fc; Vector impactPos; Entity_Tear *local_ec; Entity_Tear *local_e8; float *local_e4; float local_e0; float local_dc; float local_d8; Entity *local_d4; float *local_d0; float *candidates; float *candidatesEnd; float *candidatesCapacity; BitSet128 *tearFlags; float local_bc; float local_b8; char isHitsProjectiles; Entity_Tear *local_b0; ColorMod *local_ac; void *local_a8; ColorMod *local_a4; Entity *local_a0; float *local_9c; Entity_Tear *local_98; Entity_Tear *local_94; Entity_Tear *local_90; Entity_Laser *laser; Entity_Tear *local_88; ColorMod splashColor; Color scratchColor2; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; EntityPtr laserParent; puStack_20 = (undefined1 *)((&scratchColor2)[1]._offset + 2); local_14 = -NAN; puStack_18 = &LAB_00b0caa0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&scratchColor2)[1]._colorize + 3); ExceptionList = &local_1c; laser = this; if (this->_sampleLaser == 0) { local_ac = (ColorMod *)(this->_angleDegrees * 0.017453292); local_9c = (float *)cos((float)local_ac); local_90 = (Entity_Tear *)sin((float)local_ac); local_a0 = (Entity *)0x0; local_a8 = g_game->_room; if (*(int *)((int)local_a8 + 0x1264) != 0) { do { pEVar16 = *(Entity **)(*(int *)((int)local_a8 + 0x125c) + (int)local_a0 * 4); bVar3 = CanDamageEntity(this,pEVar16); if (bVar3 != 0) { fVar18 = (pEVar16->_pos).x - (this->_pos).x; fVar12 = (pEVar16->_pos).y - (this->_pos).y; fVar19 = pEVar16->_size + this->_size; local_88 = (Entity_Tear *)((float)local_90 * fVar12 + (float)local_9c * fVar18); local_ac = (ColorMod *)ABS((float)local_90 * fVar18 - (float)local_9c * fVar12); if (this->_variant == 4) { fVar19 = sqrtf(fVar12 * fVar12 + fVar18 * fVar18); fVar19 = fVar19 * 0.1; } if ((float)local_ac < fVar19) { if (0.0 < (float)local_88) { if ((float)local_88 < ABS((this->_posOffset).y) + this->_laserLength) { damage_entity(this,pEVar16); pEVar15 = local_90; pfVar10 = local_9c; if ((pEVar16->_flags & 0x4000000) == 0) { iVar5 = pEVar16->_type; if ((iVar5 == 1) && (this->_spawnerEntity != (EntityPtr)0x0)) { if ((*(uint *)((int)this->_spawnerEntity + 0x168) & 0x20000000) != 0) goto LAB_00973251; iVar5 = 1; } LAB_009736b9: fVar19 = pEVar16->_mass; fVar12 = 0.0; pEVar17 = local_90; pfVar14 = local_9c; if (0.0 < fVar19) { pfVar14 = (float *)((float)local_9c / fVar19); pEVar17 = (Entity_Tear *)((float)local_90 / fVar19); } fVar19 = this->_mass * 1.8000001; fVar18 = fVar19 * (float)pEVar17; fVar19 = fVar19 * (float)pfVar14; if ((iVar5 == 1) || (iVar5 == 3)) { fVar19 = fVar19 * 0.2; fVar18 = fVar18 * 0.2; } maskedFlags = BitSet128::operator_and (&local_180,&this->_tearFlags,(BitSet128 *)&DAT_00c34ae0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { fVar19 = fVar19 + fVar19; fVar18 = fVar18 + fVar18; } fVar1 = pEVar16->_friction; if (fVar1 != fVar12) { fVar12 = pEVar16->_speedMultiplier; (pEVar16->_velocity).x = (fVar19 * fVar12) / fVar1 + (pEVar16->_velocity).x; (pEVar16->_velocity).y = (fVar18 * fVar12) / fVar1 + (pEVar16->_velocity).y; } } else if (((pEVar16->_type == 4) && (this->_spawnerEntity != (EntityPtr)0x0)) && (iVar5 = 4, *(int *)((int)this->_spawnerEntity + 0x28) == 1)) goto LAB_009736b9; LAB_00973251: bVar3 = is_thick_variant(this); if (bVar3 != 0) { fVar19 = (float)local_88 * (float)pfVar10; local_88 = (Entity_Tear *)((float)local_88 * (float)pEVar15 + (this->_pos).y); local_e0 = -(float)pfVar10; local_d4 = (Entity *)(fVar19 + (this->_pos).x); fVar19 = this->_size; local_bc = ((pEVar16->_pos).y - (float)local_88) * (float)pEVar15 + ((pEVar16->_pos).x - (float)local_d4) * (float)pfVar10; local_b8 = local_bc + pEVar16->_size; local_bc = local_bc - pEVar16->_size; if (local_bc <= -fVar19) { local_bc = -fVar19; } if (fVar19 <= local_b8) { local_b8 = fVar19; } if (local_bc + 2.0 < local_b8) { pvVar7 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); scratchColor._tint[0] = (this->_sprite)._color._tint[0]; scratchColor._tint[1] = (this->_sprite)._color._tint[1]; scratchColor._tint[2] = (this->_sprite)._color._tint[2]; scratchColor._tint[3] = (this->_sprite)._color._tint[3]; scratchColor._offset[2] = (this->_sprite)._color._offset[2]; scratchColor._colorize[0] = (this->_sprite)._color._colorize[0]; scratchColor._colorize[1] = (this->_sprite)._color._colorize[1]; scratchColor._colorize[2] = (this->_sprite)._color._colorize[2]; scratchColor._colorize[3] = (this->_sprite)._color._colorize[3]; scratchColor._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; Color::__mul(&scratchColor,&layer->_color); scratchColor2._tint[0] = scratchColor._tint[0]; scratchColor2._tint[1] = scratchColor._tint[1]; scratchColor2._tint[2] = scratchColor._tint[2]; scratchColor2._tint[3] = scratchColor._tint[3]; scratchColor2._offset[2] = scratchColor._offset[2]; scratchColor2._colorize[0] = scratchColor._colorize[0]; scratchColor2._colorize[1] = scratchColor._colorize[1]; scratchColor2._colorize[2] = scratchColor._colorize[2]; scratchColor2._colorize[3] = scratchColor._colorize[3]; scratchColor2._offset[0] = scratchColor._offset[0]; scratchColor2._offset[1] = scratchColor._offset[1]; Color::__mul(&scratchColor2,(ColorMod *)((int)pvVar7 + 0x30)); splashColor._offset[2] = scratchColor2._offset[2]; splashColor._tint[0] = scratchColor2._tint[0]; splashColor._tint[1] = scratchColor2._tint[1]; splashColor._tint[2] = scratchColor2._tint[2]; splashColor._tint[3] = scratchColor2._tint[3]; splashColor._colorize[0] = scratchColor2._colorize[0]; splashColor._colorize[1] = scratchColor2._colorize[1]; splashColor._colorize[2] = scratchColor2._colorize[2]; splashColor._colorize[3] = scratchColor2._colorize[3]; splashColor._offset[0] = scratchColor2._offset[0]; splashColor._offset[1] = scratchColor2._offset[1]; local_d8 = (this->_posOffset).y; uVar6 = Random(); fVar19 = (float)(uVar6 & 3); local_ac = (ColorMod *)fVar19; if (fVar19 != 0.0) { local_b8 = local_b8 - local_bc; local_a4 = (ColorMod *)((float)local_9c * 3.0); local_dc = (float)local_90 * 3.0; do { uVar6 = Random(); uVar8 = Random(); local_d0 = (float *)((float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 4.0); uVar8 = Random(); fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_ac = (ColorMod *)(fVar12 + fVar12); local_104.x = cos((float)local_ac); local_104.x = local_104.x + (float)local_d0 * (float)local_9c; local_104.y = sin((float)local_ac); local_104.y = local_104.y + (float)local_d0 * (float)local_90; uVar8 = Random(); local_ac = (ColorMod *) (local_b8 * (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 + local_bc); uVar8 = Random(); fVar12 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10; local_fc.x = (float)local_ac * (float)local_90 + (float)local_d4 + (float)local_a4 * fVar12; local_fc.y = (float)local_ac * local_e0 + (float)local_88 + local_dc * fVar12; pEVar16 = Game::Spawn(g_game,1000,99,&local_fc,&local_104,(Entity *)0x0,1, uVar6); fVar12 = (pEVar16->_sprite)._scale.x; fVar18 = (pEVar16->_sprite)._scale.y; iVar5 = *(int *)pEVar16; (pEVar16->_sprite)._scale.x = fVar12 + fVar12; (pEVar16->_sprite)._scale.y = fVar18 + fVar18; (**(code **)(iVar5 + 0x3c))(&splashColor,0xffffffff,0xff,0,1); (pEVar16->_posOffset).x = 0.0; (pEVar16->_posOffset).y = local_d8; (**(code **)(*(int *)pEVar16 + 0xc))(); fVar19 = (float)((int)fVar19 - 1); } while (fVar19 != 0.0); this = laser; } } } } } } } local_a0 = (Entity *)((int)local_a0 + 1); } while (local_a0 < *(uint *)((int)local_a8 + 0x1264)); } } else { candidates = (float *)0x0; candidatesEnd = (float *)0x0; candidatesCapacity = (float *)0x0; local_14 = 0.0; local_e4 = in_XMM1_Da; puStack_20 = (undefined1 *)((&scratchColor2)[1]._offset + 2); std::vector::_Reallocate(10); tearFlags = &this->_tearFlags; maskedFlags = BitSet128::operator_and(&local_170,tearFlags,(BitSet128 *)&DAT_00c34c60); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || (isHitsProjectiles = '\0', (int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { isHitsProjectiles = '\x01'; } local_b0 = (Entity_Tear *)0x0; local_a0 = g_game->_room; pfVar10 = candidatesEnd; if (local_a0[4]._burnCountdown != 0) { do { local_98 = *(Entity_Tear **)(local_a0[4]._midasFreezeCountdown + (int)local_b0 * 4); local_90 = local_98; if (((local_98->_type == 1000) && ((((iVar5 = local_98->_variant, iVar5 == 0x15 || (iVar5 == 0x21)) || (iVar5 == 0x3f)) || ((iVar5 == 0x40 || (iVar5 == 0x9f)))))) || (bVar3 = CanDamageEntity(this,(Entity *)local_98), bVar3 != 0)) { joined_r0x00971bfa: if (pfVar10 == candidatesCapacity) { LAB_0097195e: std::vector::_Emplace_reallocate(pfVar10,&local_90); local_98 = local_90; pfVar10 = candidatesEnd; } else { *pfVar10 = (float)local_98; pfVar10 = pfVar10 + 1; candidatesEnd = pfVar10; } } else { iVar5 = local_98->_type; if (iVar5 == 4) { laserParent = this->_parent; if (laserParent == (EntityPtr)0x0) { LAB_00971b64: if ((this->_spawnerType != 1) && (this->_spawnerType != 3)) { iVar5 = local_98->_type; goto LAB_00971b90; } } else { iVar5 = *(int *)((int)laserParent + 0x28); if (iVar5 == 2) { if (*(int *)((int)laserParent + 0x34) == 1) goto LAB_00971b71; goto LAB_00971b64; } if (iVar5 == 1000) { if (*(int *)((int)laserParent + 0x34) != 1) goto LAB_00971b64; } else if ((iVar5 != 1) && (iVar5 != 3)) goto LAB_00971b64; } LAB_00971b71: if (pfVar10 == candidatesCapacity) goto LAB_0097195e; *pfVar10 = (float)local_98; pfVar10 = pfVar10 + 1; candidatesEnd = pfVar10; } else { LAB_00971b90: if ((((isHitsProjectiles != '\0') && (iVar5 == 9)) && ((local_98->_waitFrames & 0x80000000U) == 0)) && (((((iVar5 = this->_subtype, iVar5 == 1 || (iVar5 == 2)) || (iVar5 == 3)) && (uVar6 = Random(), uVar6 % 0x32 == 0)) || (uVar6 = Random(), uVar6 % 5 == 0)))) goto joined_r0x00971bfa; } } maskedFlags = BitSet128::operator_and (&local_170,&this->_tearFlags,(BitSet128 *)&DAT_00c34b20); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && ((bVar3 = Entity::IsVulnerableEnemy((Entity *)local_98,(Entity *)0x0), bVar3 != 0 || (local_98->_type == 5)))) { pEVar15 = local_98; if ((local_98 == (Entity_Tear *)0x0) || (local_98->_type != 5)) { LAB_009719f7: local_bc = (float)(((int)(this->_homingLaser)._samples._end - (int)(this->_homingLaser)._samples._begin >> 3) + -1); local_b8 = 1e+06; local_88 = (Entity_Tear *)g_vectorZero.x; local_94 = (Entity_Tear *)g_vectorZero.y; local_a8 = (void *)0x0; if (local_bc != 0.0) { local_e8 = (Entity_Tear *)(pEVar15->_pos).y; local_ec = (Entity_Tear *)(pEVar15->_pos).x; local_9c = (float *)((int)(this->_homingLaser)._samples._begin + 8); do { segment_project_point(local_9c,&local_d0); fVar19 = 40000.0; if ((40000.0 <= in_XMM0_Da) || (fVar19 = local_b8, local_b8 <= in_XMM0_Da)) { } else { local_88 = (Entity_Tear *) (((*local_9c - *extraout_EDX_00) * (float)local_d0 + *extraout_EDX_00) - (local_98->_pos).x); local_94 = (Entity_Tear *) (((local_9c[1] - local_9c[-1]) * (float)local_d0 + local_9c[-1]) - (local_98->_pos).y); local_b8 = in_XMM0_Da; } in_XMM0_Da = fVar19; if (((float)local_88 != g_vectorZero.x) || ((float)local_94 != g_vectorZero.y)) { fVar19 = sqrtf((float)local_94 * (float)local_94 + (float)local_88 * (float)local_88); pEVar15 = local_88; pEVar17 = local_94; if (0.0 < fVar19) { pEVar15 = (Entity_Tear *)((float)local_88 * (1.0 / fVar19)); pEVar17 = (Entity_Tear *)((float)local_94 * (1.0 / fVar19)); } in_XMM0_Da = 0.0; fVar12 = 10.0; if (((1 < *(int *)&g_game->_deathmatchManager) && (local_98->_type == 1)) || ((9 < local_98->_type && (local_98->_type < 1000)))) { fVar12 = 40.0; } if (10.0 <= fVar19) { fVar18 = ((float)pEVar15 * fVar12) / fVar19; fVar19 = ((float)pEVar17 * fVar12) / fVar19; } else { fVar18 = (float)pEVar15 * fVar12 * (fVar19 / 100.0); fVar19 = (float)pEVar17 * fVar12 * (fVar19 / 100.0); } fVar12 = local_98->_friction; if (fVar12 != 0.0) { in_XMM0_Da = local_98->_speedMultiplier; (local_98->_velocity).y = (fVar19 * in_XMM0_Da) / fVar12 + (local_98->_velocity).y; (local_98->_velocity).x = (fVar18 * in_XMM0_Da) / fVar12 + (local_98->_velocity).x; } break; } local_9c = local_9c + 2; local_a8 = (void *)((int)local_a8 + 1); } while (local_a8 < (uint)local_bc); } } else if ((local_98->_tearHaloANM2)._numNullLayers == 0) { bVar3 = Entity_Pickup::IsChest(local_98->_variant); pEVar15 = extraout_EDX; if ((bVar3 == 0) || (extraout_EDX->_subtype != 0)) goto LAB_009719f7; } } local_b0 = (Entity_Tear *)&local_b0->field_0x1; } while (local_b0 < (undefined1 *)local_a0[4]._burnCountdown); } local_d0 = candidates; if (candidates != pfVar10) { fVar19 = 0.0; pEVar9 = laser; pfVar14 = candidates; do { local_88 = (pEVar9->_homingLaser)._samples._begin; local_bc = (float)((int)(pEVar9->_homingLaser)._samples._end - (int)local_88 >> 3); local_9c = (float *)0x0; local_a4 = (ColorMod *)((int)local_bc + -1); local_a8 = (void *)fVar19; if (local_a4 != (ColorMod *)0x0) { local_94 = (Entity_Tear *)*pfVar14; candidatePosX = (local_94->_pos).x; candidatePosY = (local_94->_pos).y; local_e0 = local_94->_size + pEVar9->_size; local_d0 = pfVar14; LAB_00971e12: local_ec = *(Entity_Tear **) ((local_88->_sprite)._filename._buf + (int)local_9c * 8 + -0x40); pEVar15 = *(Entity_Tear **) ((local_88->_sprite)._filename._buf + (int)local_9c * 8 + -0x3c); local_e8 = pEVar15; local_98 = pEVar15; local_90 = local_ec; cVar4 = IsCircleLaser(pEVar9); if (cVar4 == '\0') { if (local_9c == (float *)((int)local_bc + -2)) { if (laser->_isGridHit == 0) { pEVar15 = (Entity_Tear *)0x0; if (laser->_maxDistance <= 0.0) { pfVar13 = (float *)((int)(&(local_88->_sprite)._filename + -3) + (int)local_9c * 8 ); local_a0 = (Entity *)((float)local_98 - pfVar13[1]); local_b0 = (Entity_Tear *)((float)local_90 - *pfVar13); fVar19 = sqrtf((float)local_a0 * (float)local_a0 + (float)local_b0 * (float)local_b0); if (fVar19 <= 0.0) { pEVar16 = local_a0; local_ec = local_b0; } else { pEVar16 = (Entity *)((40.0 / fVar19) * (float)local_a0); local_ec = (Entity_Tear *)((40.0 / fVar19) * (float)local_b0); } local_ec = (Entity_Tear *)((float)local_ec + (float)local_90); pEVar15 = (Entity_Tear *)((float)pEVar16 + (float)local_98); local_e8 = pEVar15; local_98 = pEVar15; local_90 = local_ec; } } } } segment_project_point(&local_ec,&local_b8); local_b0 = pEVar15; local_a0 = (Entity *) sqrtf(((float)local_98 - extraout_EDX_01[1]) * ((float)local_98 - extraout_EDX_01[1]) + ((float)local_90 - *extraout_EDX_01) * ((float)local_90 - *extraout_EDX_01)); pEVar15 = local_b0; if (local_9c == (float *)0x0) { bVar3 = is_thick_variant(laser); pEVar15 = local_b0; if (bVar3 != 0) { local_d8 = *(float *)(extraout_ECX + 0x41c) * 0.017453292; fVar19 = cos(local_d8); local_dc = (local_94->_pos).x - (*(float *)local_88 - fVar19 * 16.0); fVar19 = sin(local_d8); fVar19 = (local_94->_pos).y - (*(float *)&local_88->field_0x4 - fVar19 * 16.0); pEVar17 = (Entity_Tear *)(fVar19 * fVar19 + local_dc * local_dc); pEVar15 = local_b0; if ((float)pEVar17 < (float)local_b0) { local_b8 = 0.0; pEVar15 = pEVar17; } } } fVar19 = 0.0; if (local_e0 * local_e0 <= (float)pEVar15) goto code_r0x0097207c; if (local_94->_type == 9) { local_94->_waitFrames = 0; (local_94->_continueVelocity).x = 0.0; local_94->_dead = 1; goto LAB_00973070; } if (local_94->_type == 1000) { local_94->_dead = 1; goto LAB_00973070; } local_a4 = (ColorMod *)(local_94->_size * local_94->_size); fVar19 = sqrtf((float)pEVar15); fVar19 = fVar19 - laser->_size; fVar19 = fVar19 * fVar19; if ((float)local_a4 <= fVar19) { fVar19 = 0.0; } else { fVar19 = sqrtf((float)local_a4 - fVar19); } pfVar13 = (float *)((int)(&(local_88->_sprite)._filename + -3) + (int)local_9c * 8); pEVar16 = (Entity *)((float)local_a0 * local_b8 + (float)local_a8); fVar12 = (float)local_a0 * local_b8 - fVar19; local_90 = (Entity_Tear *)(((float)local_90 - *pfVar13) / (float)local_a0); fVar19 = (float)pEVar16 - fVar19; local_98 = (Entity_Tear *)(((float)local_98 - pfVar13[1]) / (float)local_a0); pEVar15 = (Entity_Tear *)((float)local_90 * fVar12 + *pfVar13); pEVar17 = (Entity_Tear *)((float)local_98 * fVar12 + pfVar13[1]); if (fVar19 < laser->_impactDistance) { laser->_impactDistance = fVar19; (laser->_impactPosition).x = (float)pEVar15; (laser->_impactPosition).y = (float)pEVar17; (laser->_impactDirection).x = (float)local_90; (laser->_impactDirection).y = (float)local_98; } local_a0 = pEVar16; local_94 = pEVar17; local_88 = pEVar15; maskedFlags = BitSet128::operator_and(&local_250,tearFlags,(BitSet128 *)&DAT_00c34ac0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { if (laser->_isFirstUpdate == 0) { iVar5 = Entity::GetIntervalTicks((Entity *)laser,4.0,0.0); if (iVar5 == 0) goto LAB_00972346; pEVar15 = local_88; pEVar17 = local_94; } impactPos.x = (float)pEVar15; impactPos.y = (float)pEVar17; Room::GetClampedPositionImpl (g_game->_room,&clampedImpactPos,&impactPos,15.0,15.0,15.0,15.0); impactPos.x = clampedImpactPos.x; impactPos.y = clampedImpactPos.y; uVar6 = Random(); uVar23 = 0; pTVar22 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar21 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar20 = 0; pEVar16 = Game::Spawn(g_game,1000,0x35,&impactPos,&g_vectorZero, (Entity *)laser->_spawnerEntity,0,uVar6); impactEffect = (int *)__RTDynamicCast(pEVar16,uVar20,pTVar21,pTVar22,uVar23); fVar19 = g_vectorOne.y * 0.4; impactEffect[0x39] = (int)(g_vectorOne.x * 0.4); impactEffect[0x3a] = (int)fVar19; (**(code **)(*impactEffect + 0xc))(); } LAB_00972346: fVar19 = *pfVar14; if ((*(int *)&g_game->_deathmatchManager < 2) || (*(int *)((int)fVar19 + 0x28) != 1)) { iVar5 = *(int *)((int)fVar19 + 0x28); if ((iVar5 - 10U < 0x3de) && (((iVar5 != 0x21 && (iVar5 != 0x11)) && (iVar5 != 0x124)))) { if (iVar5 == 0x375) { bVar11 = *(int *)((int)fVar19 + 0x2c) == 10; } else { if ((iVar5 == 0x3c0) || (iVar5 == 0x3c5)) goto LAB_009726e0; bVar11 = iVar5 == 0xf5; } if (!bVar11) goto LAB_009723bd; } } else { LAB_009723bd: if (*(char *)((int)fVar19 + 0x173) == '\0') { pBVar24 = (BitSet128 *)&DAT_00c34630; maskedFlags = BitSet128::operator_or (&local_260,(BitSet128 *)&DAT_00c34930, (BitSet128 *)&DAT_00c34a50); maskedFlags = BitSet128::operator_or(&local_190,maskedFlags,pBVar24); maskedFlags = BitSet128::operator_and(&local_1a0,tearFlags,maskedFlags); if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && ((laser->_isFirstUpdate != 0 || (iVar5 = Entity::GetIntervalTicks((Entity *)laser,4.0,0.0), iVar5 != 0)))) { local_94 = (Entity_Tear *)((float)local_94 - *(float *)((int)*pfVar14 + 0x340)); local_88 = (Entity_Tear *)((float)local_88 - *(float *)((int)*pfVar14 + 0x33c)); fVar19 = sqrtf((float)local_94 * (float)local_94 + (float)local_88 * (float)local_88 ); if ((*(float *)((int)*pfVar14 + 0x370) < fVar19) && (0.0 < fVar19)) { fVar19 = *(float *)((int)*pfVar14 + 0x370) / fVar19; local_88 = (Entity_Tear *)((float)local_88 * fVar19); local_94 = (Entity_Tear *)((float)local_94 * fVar19); } maskedFlags = BitSet128::operator_and (&local_1b0,tearFlags,(BitSet128 *)&DAT_00c34a50); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { maskedFlags = BitSet128::operator_and (&local_1c0,tearFlags,(BitSet128 *)&DAT_00c34630); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { local_a8 = (void *)0x13; } else { local_a8 = (void *)0x30; } } else { local_a8 = (void *)0x1a; } b_02 = (BitSet128 *)&DAT_00c345d0; b_01 = (BitSet128 *)&DAT_00c345e0; b_00 = (BitSet128 *)&DAT_00c345c0; b = (BitSet128 *)&DAT_00c348f0; pBVar24 = &g_tearFlagLudovico; maskedFlags = BitSet128::operator_or (&local_220,(BitSet128 *)&DAT_00c34880, (BitSet128 *)&DAT_00c34850); maskedFlags = BitSet128::operator_or(&local_1d0,maskedFlags,pBVar24); maskedFlags = BitSet128::operator_or(&local_1e0,maskedFlags,b); maskedFlags = BitSet128::operator_or(&local_1f0,maskedFlags,b_00); maskedFlags = BitSet128::operator_or(&local_200,maskedFlags,b_01); maskedFlags = BitSet128::operator_or(&local_210,maskedFlags,b_02); maskedFlags = BitSet128::__bnot(maskedFlags,&local_270); BitSet128::operator_and(&local_170,tearFlags,maskedFlags); uVar6 = Random(); tearSpawnPos.x = (float)local_88 + *(float *)((int)*pfVar14 + 0x33c); tearSpawnPos.y = (float)local_94 + *(float *)((int)*pfVar14 + 0x340); local_88 = (Entity_Tear *) Game::Spawn(g_game,2,(uint)local_a8,&tearSpawnPos,&g_vectorZero, (Entity *)laser->_spawnerEntity,0,uVar6); (**(code **)(*(int *)local_88 + 0xc))(); flags._l._4_4_ = local_170._l._4_4_; flags._l._0_4_ = (undefined4)local_170._l; flags._h._0_4_ = (undefined4)local_170._h; flags._h._4_4_ = local_170._h._4_4_; Entity_Tear::SetTearFlags(local_88,flags); (**(code **)(*(int *)local_88 + 0x40))(laser->_collisionDamage); fVar19 = laser->_scale; if (fVar19 <= 0.01) { fVar19 = 0.01; } local_88->_baseScale = fVar19; local_88->_fScale = fVar19; Entity_Tear::ResetSpriteScale(local_88); local_a4 = (ColorMod *)*pfVar14; g_forceCollideDepth = g_forceCollideDepth + 1; (**(code **)((int)*(float *)local_88 + 0x5c))(local_a4,1); (**(code **)(*(int *)local_a4 + 0x5c))(local_88,0); g_forceCollideDepth = g_forceCollideDepth + -1; } } } LAB_009726e0: local_a4 = (ColorMod *)local_e4; cVar4 = IsCircleLaser(laser); if (cVar4 == '\0') { BitSet128::operator_and(&local_230,tearFlags,(BitSet128 *)&DAT_00c34b30); BitSet128::operator_and(&local_240,tearFlags,(BitSet128 *)&DAT_00c34c40); } damage_entity(laser,*pfVar14); cVar4 = IsCircleLaser(laser); if ((cVar4 == '\0') || (laser->_subtype == 2)) { pEVar16 = (Entity *)*pfVar14; if ((pEVar16->_flags & 0x4000000) != 0) { if ((pEVar16->_type == 4) && (laser->_spawnerEntity != (EntityPtr)0x0)) { bVar11 = *(int *)((int)laser->_spawnerEntity + 0x28) == 1; goto LAB_00972846; } goto LAB_009729ca; } if ((pEVar16->_type == 1) && (laser->_spawnerEntity != (EntityPtr)0x0)) { bVar11 = (*(uint *)((int)laser->_spawnerEntity + 0x168) & 0x20000000) == 0; LAB_00972846: if (!bVar11) goto LAB_009729ca; } local_88 = local_90; local_94 = local_98; if (laser->_subtype == 2) { local_88 = (Entity_Tear *)(laser->_velocity).x; local_94 = (Entity_Tear *)(laser->_velocity).y; fVar19 = sqrtf((float)local_88 * (float)local_88 + (float)local_94 * (float)local_94); if (0.0 < fVar19) { local_88 = (Entity_Tear *)((float)local_88 * (1.0 / fVar19)); local_94 = (Entity_Tear *)((float)local_94 * (1.0 / fVar19)); } pEVar16 = (Entity *)*pfVar14; } fVar12 = Entity::IsCollisionIgnored(pEVar16,(Entity *)laser); fVar19 = 0.0; pEVar17 = local_94; pEVar15 = local_88; if (0.0 < fVar12) { pEVar15 = (Entity_Tear *)((float)local_88 / fVar12); pEVar17 = (Entity_Tear *)((float)local_94 / fVar12); } fVar12 = laser->_mass * 1.8000001; fVar18 = fVar12 * (float)pEVar17; fVar12 = fVar12 * (float)pEVar15; if ((*(int *)((int)*pfVar14 + 0x28) == 1) || (*(int *)((int)*pfVar14 + 0x28) == 3)) { fVar12 = fVar12 * 0.2; fVar18 = fVar18 * 0.2; } maskedFlags = BitSet128::operator_and(&local_180,tearFlags,(BitSet128 *)&DAT_00c34ae0); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { fVar12 = fVar12 + fVar12; fVar18 = fVar18 + fVar18; } fVar2 = *pfVar14; fVar1 = *(float *)((int)fVar2 + 0x36c); if (fVar1 != fVar19) { *(float *)((int)fVar2 + 0x364) = (*(float *)((int)fVar2 + 0x39c) * fVar18) / fVar1 + *(float *)((int)fVar2 + 0x364); *(float *)((int)fVar2 + 0x360) = (*(float *)((int)fVar2 + 0x39c) * fVar12) / fVar1 + *(float *)((int)fVar2 + 0x360); } } else { LAB_009729ca: fVar19 = 0.0; } bVar3 = is_thick_variant(laser); pEVar9 = extraout_EDX_02; if (bVar3 != 0) { pvVar7 = (extraout_EDX_02->_homingLaser)._samples._begin; fVar12 = *pfVar14; local_94 = (Entity_Tear *)-(float)local_90; pfVar13 = (float *)((*(float *)((int)pvVar7 + (int)local_9c * 8 + 0xc) - *(float *)((int)pvVar7 + (int)local_9c * 8 + 4)) * local_b8 + *(float *)((int)pvVar7 + (int)local_9c * 8 + 4)); local_88 = (Entity_Tear *) ((*(float *)((int)pvVar7 + (int)local_9c * 8 + 8) - *(float *)((int)pvVar7 + (int)local_9c * 8)) * local_b8 + *(float *)((int)pvVar7 + (int)local_9c * 8)); pEVar15 = (Entity_Tear *)laser->_size; fVar18 = (*(float *)((int)fVar12 + 0x340) - (float)pfVar13) * (float)local_94 + (*(float *)((int)fVar12 + 0x33c) - (float)local_88) * (float)local_98; local_a8 = (void *)(fVar18 - *(float *)((int)fVar12 + 0x370)); local_b0 = (Entity_Tear *)(*(float *)((int)fVar12 + 0x370) + fVar18); if ((float)local_a8 <= -(float)pEVar15) { local_a8 = (void *)-(float)pEVar15; } if ((float)pEVar15 <= (float)local_b0) { local_b0 = pEVar15; } pEVar9 = laser; local_9c = pfVar13; if ((float)local_a8 + 2.0 < (float)local_b0) { pvVar7 = AnimationState::GetLayerFrame(&(laser->_sprite)._animState,0); local_a4 = (ColorMod *)((int)pvVar7 + 0x30); layer = ANM2::GetLayer(&laser->_sprite,(byte *)0x0); local_ac = &(laser->_sprite)._color; scratchColor2._tint[0] = local_ac->_tint[0]; scratchColor2._tint[1] = (laser->_sprite)._color._tint[1]; scratchColor2._tint[2] = (laser->_sprite)._color._tint[2]; scratchColor2._tint[3] = (laser->_sprite)._color._tint[3]; scratchColor2._colorize[0] = (laser->_sprite)._color._colorize[0]; scratchColor2._colorize[1] = (laser->_sprite)._color._colorize[1]; scratchColor2._colorize[2] = (laser->_sprite)._color._colorize[2]; scratchColor2._colorize[3] = (laser->_sprite)._color._colorize[3]; scratchColor2._offset._0_8_ = *(undefined8 *)(laser->_sprite)._color._offset; scratchColor2._offset[2] = (laser->_sprite)._color._offset[2]; Color::__mul(&scratchColor2,&layer->_color); scratchColor._tint[0] = scratchColor2._tint[0]; scratchColor._tint[1] = scratchColor2._tint[1]; scratchColor._tint[2] = scratchColor2._tint[2]; scratchColor._tint[3] = scratchColor2._tint[3]; scratchColor._offset[2] = scratchColor2._offset[2]; scratchColor._colorize[0] = scratchColor2._colorize[0]; scratchColor._colorize[1] = scratchColor2._colorize[1]; scratchColor._colorize[2] = scratchColor2._colorize[2]; scratchColor._colorize[3] = scratchColor2._colorize[3]; scratchColor._offset[0] = scratchColor2._offset[0]; scratchColor._offset[1] = scratchColor2._offset[1]; Color::__mul(&scratchColor,local_a4); splashColor._offset[2] = scratchColor._offset[2]; splashColor._tint[0] = scratchColor._tint[0]; splashColor._tint[1] = scratchColor._tint[1]; splashColor._tint[2] = scratchColor._tint[2]; splashColor._tint[3] = scratchColor._tint[3]; splashColor._colorize[0] = scratchColor._colorize[0]; splashColor._colorize[1] = scratchColor._colorize[1]; splashColor._colorize[2] = scratchColor._colorize[2]; splashColor._colorize[3] = scratchColor._colorize[3]; splashColor._offset[0] = scratchColor._offset[0]; splashColor._offset[1] = scratchColor._offset[1]; local_bc = (laser->_posOffset).y; uVar6 = Random(); pfVar13 = (float *)(uVar6 & 3); local_a4 = (ColorMod *)pfVar13; if (pfVar13 != (float *)0x0) { local_e0 = (float)local_b0 - (float)local_a8; local_dc = (float)local_90 * 3.0; local_d8 = (float)local_98 * 3.0; do { local_d4 = (Entity *)Random(); uVar6 = Random(); local_a0 = (Entity *) ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 6.0 + 4.0); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_a4 = (ColorMod *)(fVar19 + fVar19); splashVelocity.x = cos((float)local_a4); splashVelocity.x = splashVelocity.x + (float)local_a0 * (float)local_90; splashVelocity.y = sin((float)local_a4); splashVelocity.y = splashVelocity.y + (float)local_a0 * (float)local_98; uVar6 = Random(); local_a4 = (ColorMod *) (local_e0 * (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + (float)local_a8); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; splashPos.y = (float)local_a4 * (float)local_94 + (float)local_9c + fVar19 * local_d8; splashPos.x = (float)local_a4 * (float)local_98 + (float)local_88 + fVar19 * local_dc; local_d4 = Game::Spawn(g_game,1000,99,&splashPos,&splashVelocity,(Entity *)0x0,1, (uint)local_d4); fVar19 = (local_d4->_sprite)._scale.x; fVar12 = (local_d4->_sprite)._scale.y; iVar5 = *(int *)local_d4; (local_d4->_sprite)._scale.x = fVar19 + fVar19; (local_d4->_sprite)._scale.y = fVar12 + fVar12; (**(code **)(iVar5 + 0x3c))(&splashColor,0xffffffff,0xff,0,1); (local_d4->_posOffset).x = 0.0; (local_d4->_posOffset).y = local_bc; (**(code **)(*(int *)local_d4 + 0xc))(); pfVar13 = (float *)((int)pfVar13 + -1); } while (pfVar13 != (float *)0x0); pfVar14 = local_d0; } if ((*(uint *)((int)*pfVar14 + 0x16c) & 0x1000000) != 0) { Color::Reset(&scratchColor); scratchColor._tint[0] = 2.0; scratchColor._tint[1] = 1.0; scratchColor._tint[2] = 1.0; scratchColor._tint[3] = 1.0; Color::__mul(&scratchColor,local_ac); scratchColor2._offset[2] = scratchColor._offset[2]; scratchColor2._tint[0] = scratchColor._tint[0]; scratchColor2._tint[1] = scratchColor._tint[1]; scratchColor2._tint[2] = scratchColor._tint[2]; scratchColor2._tint[3] = scratchColor._tint[3]; scratchColor2._colorize[0] = scratchColor._colorize[0]; scratchColor2._colorize[1] = scratchColor._colorize[1]; scratchColor2._colorize[2] = scratchColor._colorize[2]; scratchColor2._colorize[3] = scratchColor._colorize[3]; scratchColor2._offset[0] = scratchColor._offset[0]; scratchColor2._offset[1] = scratchColor._offset[1]; local_d4 = (Entity *)Random(); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_a0 = (Entity *)(fVar19 + fVar19 + 2.0); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_ac = (ColorMod *)(fVar19 + fVar19); local_fc.x = cos((float)local_ac); local_fc.x = local_fc.x + (float)local_a0 * (float)local_90; local_fc.y = sin((float)local_ac); local_fc.y = local_fc.y + (float)local_a0 * (float)local_98; uVar6 = Random(); fVar19 = ((float)local_b0 - (float)local_a8) * (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + (float)local_a8; local_104.y = fVar19 * (float)local_94 + (float)local_9c; local_104.x = fVar19 * (float)local_98 + (float)local_88; local_a0 = Game::Spawn(g_game,1000,2,&local_104,&local_fc,(Entity *)0x0,2, (uint)local_d4); (**(code **)(*(int *)local_a0 + 0x3c))(&scratchColor2,0xffffffff,0xff,0,1); (local_a0->_posOffset).x = 0.0; (local_a0->_posOffset).y = local_bc; uVar6 = Random(); iVar5 = *(int *)local_a0; *(float *)(local_a0[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0; (**(code **)(iVar5 + 0xc))(); } LAB_00973070: fVar19 = 0.0; pEVar9 = laser; } } } LAB_00973073: pfVar14 = pfVar14 + 1; local_d0 = pfVar14; } while (pfVar14 != pfVar10); } if (candidates != (float *)0x0) { deallocate(candidates,(int)candidatesCapacity - (int)candidates >> 2); } } ExceptionList = local_1c; return; code_r0x0097207c: local_a8 = (void *)((float)local_a0 + (float)local_a8); local_9c = (float *)((int)local_9c + 1); pEVar9 = laser; if (local_a4 <= local_9c) goto LAB_00973073; goto LAB_00971e12; } //@@ 009737b0 Entity_Laser::update_endpoint_and_hits /* DB: ? ECX=laser: resets +0x544 to +inf, takes the last two sample points of the vector at +0x480 as end position (+0x548) and normalized end direction (+0x550), Entity_Laser::find_nearest_grid_hit when not a continuous laser, then Entity_Laser::update_line_hits (branch on tear-flag masks and variant); called from Entity_Laser::update_laser and Entity_Laser::UpdateHits */ void __thiscall Entity_Laser::update_endpoint_and_hits(Entity_Laser *this) { void *pvVar1; uint uVar2; uint uVar3; uint uVar4; int iVar5; EntityPtr EVar6; uint uVar7; uint uVar8; float fVar9; float fVar10; float fVar11; Vector local_10; this->_impactDistance = INFINITY; pvVar1 = (this->_homingLaser)._samples._begin; uVar4 = (int)(this->_homingLaser)._samples._end - (int)pvVar1 >> 3; if (1 < uVar4) { (this->_impactPosition).x = *(float *)((int)pvVar1 + uVar4 * 8 + -8); (this->_impactPosition).y = *(float *)((int)pvVar1 + uVar4 * 8 + -4); iVar5 = (int)(this->_homingLaser)._samples._end - (int)pvVar1 >> 3; fVar10 = *(float *)((int)pvVar1 + iVar5 * 8 + -8) - *(float *)((int)pvVar1 + iVar5 * 8 + -0x10); fVar11 = *(float *)((int)pvVar1 + iVar5 * 8 + -4) - *(float *)((int)pvVar1 + iVar5 * 8 + -0xc); fVar9 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11); if (0.0 < fVar9) { fVar10 = fVar10 * (1.0 / fVar9); fVar11 = fVar11 * (1.0 / fVar9); } (this->_impactDirection).x = fVar10; (this->_impactDirection).y = fVar11; } if ((this->_oneHit == 0) || (this->_isFirstUpdate != 0)) { local_10.x = (this->_posOffset).x * 0.4; local_10.y = (this->_posOffset).y * 0.4; find_nearest_grid_hit(this,1,&local_10); } local_10.x = this->_collisionDamage; EVar6 = this->_spawnerEntity; if ((EVar6 != (EntityPtr)0x0) && (*(int *)((int)EVar6 + 0x28) != 1)) { EVar6 = (EntityPtr)0x0; } uVar2 = *(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34c44; uVar7 = (uint)(this->_tearFlags)._l & DAT_00c34c40; uVar4 = (uint)(this->_tearFlags)._h; uVar8 = uVar4 & DAT_00c34c48; uVar3 = *(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34c4c; if ((uVar7 == 0 && uVar2 == 0) && (uVar8 == 0 && uVar3 == 0)) { if ((((uint)(this->_tearFlags)._l & DAT_00c34b30) == 0 && (*(uint *)((int)&(this->_tearFlags)._l + 4) & DAT_00c34b34) == 0) && ((uVar4 & DAT_00c34b38) == 0 && (*(uint *)((int)&(this->_tearFlags)._h + 4) & DAT_00c34b3c) == 0)) goto LAB_00973a3a; } if ((this->_subtype == 1) || (this->_subtype == 2)) { if (EVar6 != (EntityPtr)0x0) { fVar9 = (this->_pos).y - *(float *)((int)EVar6 + 0x340); fVar11 = (this->_pos).x - *(float *)((int)EVar6 + 0x33c); sqrtf(fVar9 * fVar9 + fVar11 * fVar11); } if ((uVar7 == 0 && uVar2 == 0) && (uVar8 == 0 && uVar3 == 0)) { update_line_hits(this); return; } } LAB_00973a3a: update_line_hits(this); return; } //@@ 00973a50 Entity_Laser::refresh_tear_params /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=laser: when +0x517 set and the _spawnerEntity (+0x3c8) is a player or a familiar variant 80/235/238/240 (its player at +0x410), recomputes Entity_Player::GetTearHitParams(3 = laser, ...) into the laser's tear flags (+0x428..+0x434, masked by +0x448..) and _collisionDamage (+0x388, halved in some coop mode); called at the start of Entity_Laser::UpdateHits and from Entity_Laser::update_laser */ void __thiscall Entity_Laser::refresh_tear_params(Entity_Laser *this) { uint *puVar1; qword *pqVar2; EntityPtr EVar3; qword qVar4; qword qVar5; Game *pGVar6; int iVar7; uint uVar8; uint uVar9; uint uVar10; float fVar11; undefined1 auStack_98 [4]; EntityPtr local_94; undefined1 local_80 [56]; uint uStack_48; uint uStack_44; uint uStack_40; uint uStack_3c; float fStack_38; uint local_14; local_14 = __security_cookie ^ (uint)auStack_98; if (((this->field_0x517 != '\0') && (this->_oneHit == 0)) && (this->_isInterpolating == 0)) { if ((this->_isFirstUpdate == 0) && (iVar7 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar7 == 0)) { return; } EVar3 = this->_spawnerEntity; if (EVar3 != (EntityPtr)0x0) { if (*(int *)((int)EVar3 + 0x28) == 1) { local_94 = EVar3; } else { if (EVar3 == (EntityPtr)0x0) { return; } if (*(int *)((int)EVar3 + 0x28) != 3) { return; } iVar7 = *(int *)((int)EVar3 + 0x2c); if (((iVar7 != 0x50) && (iVar7 != 0xeb)) && ((iVar7 != 0xf0 && (iVar7 != 0xee)))) { return; } local_94 = *(EntityPtr *)((int)EVar3 + 0x410); if (local_94 == (EntityPtr)0x0) { return; } } uVar8 = Random(); Entity_Player::GetTearHitParams(local_80,3,this->_damageMultiplier,(uVar8 & 1) * 2 + -1,EVar3) ; uVar8 = ~DAT_00c34b44; uVar10 = ~DAT_00c34b48; uVar9 = ~DAT_00c34b4c; iVar7 = this->_timeout; *(uint *)&(this->_tearFlags)._l = ~DAT_00c34b40 & uStack_48; *(uint *)((int)&(this->_tearFlags)._l + 4) = uVar8 & uStack_44; *(uint *)&(this->_tearFlags)._h = uVar10 & uStack_40; *(uint *)((int)&(this->_tearFlags)._h + 4) = uVar9 & uStack_3c; uVar8 = g_tearFlagExplosive._h._4_4_; if (iVar7 < 0) { uVar10 = ~(uint)g_tearFlagExplosive._h; uVar9 = ~g_tearFlagExplosive._l._4_4_; *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l & ~(uint)g_tearFlagExplosive._l; puVar1 = (uint *)((int)&(this->_tearFlags)._l + 4); *puVar1 = *puVar1 & uVar9; pqVar2 = &(this->_tearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 & uVar10; puVar1 = (uint *)((int)&(this->_tearFlags)._h + 4); *puVar1 = *puVar1 & ~uVar8; } qVar4 = (this->_heldTearFlags)._h; uVar8 = *(uint *)((int)&(this->_heldTearFlags)._h + 4); qVar5 = (this->_heldTearFlags)._l; puVar1 = (uint *)((int)&(this->_tearFlags)._l + 4); *puVar1 = *puVar1 & ~*(uint *)((int)&(this->_heldTearFlags)._l + 4); pGVar6 = g_game; *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l & ~(uint)qVar5; pqVar2 = &(this->_tearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 & ~(uint)qVar4; puVar1 = (uint *)((int)&(this->_tearFlags)._h + 4); *puVar1 = *puVar1 & ~uVar8; if ((*(int *)&pGVar6->_deathmatchManager < 2) || (this->_subtype != 2)) { fVar11 = 1.0; } else { fVar11 = 0.5; } this->_collisionDamage = fStack_38 * fVar11; } } return; } //@@ 00973c60 Entity_Laser::update_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: Droplets/Fade, non variant 1-3 path in Update */ void __thiscall Entity_Laser::update_laser(Entity_Laser *this) { float *pfVar1; code *pcVar2; undefined4 uVar3; ANM2 other; BitSet128 flags; Vector pos; qword qVar4; qword qVar5; undefined1 uVar6; byte bVar7; char cVar8; int iVar9; float *rotationStep; void *pvVar10; uint pulseFrame; int iVar11; EntityPtr EVar12; EntityPtr *pEVar13; EntityPtr EVar14; BitSet128 *pBVar15; Vector *pVVar16; uint uVar17; int *piVar18; ColorMod *other_00; Entity_Laser *bounceLaser; Vector *randomOffset; EntityPtr EVar19; Entity_Laser *spawnedLaser; int extraout_ECX; Color *this_00; int extraout_ECX_00; Vector *this_01; int extraout_ECX_01; ANM2 *this_02; Vector *other_01; int extraout_EDX; int iVar20; float fVar21; EntityPtr EVar22; undefined1 extraout_var [12]; undefined1 extraout_var_00 [12]; undefined1 auVar23 [16]; float fVar24; undefined1 auVar25 [16]; undefined1 auVar26 [16]; undefined1 auVar27 [16]; ANM2 aAStackY_8ecc [128]; undefined1 in_stack_fffffc48 [228]; float in_stack_fffffd2c; float in_stack_fffffd30; float in_stack_fffffd34; float in_stack_fffffd38; BitSet128 *pBVar28; float fVar29; BitSet128 *b; undefined4 uVar30; BitSet128 *b_00; BitSet128 *b_01; BitSet128 local_298; BitSet128 local_288; BitSet128 local_278; BitSet128 local_268; BitSet128 local_258; BitSet128 local_248; Color local_234; Color local_208; Color local_1dc; BitSet128 local_1b0; BitSet128 local_1a0; BitSet128 local_190; undefined1 local_180 [8]; Vector local_178; BitSet128 local_170; EntityList_EL local_160; Vector local_150; undefined1 local_148 [8]; Vector local_140; undefined1 local_138 [8]; Vector local_130; undefined1 local_128 [8]; Vector local_120; Vector local_114; Vector local_10c; Vector local_104; float local_fc; undefined1 local_f8 [8]; Vector local_f0; char isSamplesRebuilt; byte local_e1; undefined1 local_e0 [12]; EntityPtr local_d4 [2]; Vector local_cc; bool local_c1; Vector local_c0; char isRedirected; EntityPtr local_b4; Color bounceLaserColor; Color prismLaserColor; undefined1 local_58 [24]; float fStack_40; float fStack_3c; float local_38; float local_34; float local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Room *room; puStack_20 = local_58 + 0x54; local_14 = 0xffffffff; puStack_18 = &LAB_00b0cae8; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_58 + 0x48); ExceptionList = &local_1c; local_150.y = (float)this; refresh_tear_params(); bVar7 = this->_isFirstUpdate; if ((bVar7 != 0) || (this->_oneHit == 0)) { uVar30 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); qVar4 = (this->_tearFlags)._h; uVar3 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); *(int *)&(this->_activeTearFlags)._l = (int)(this->_tearFlags)._l; *(undefined4 *)((int)&(this->_activeTearFlags)._l + 4) = uVar30; *(int *)&(this->_activeTearFlags)._h = (int)qVar4; *(undefined4 *)((int)&(this->_activeTearFlags)._h + 4) = uVar3; } if ((((this->_variant == 7) || (this->_isInterpolating != 0)) || (this->_dead != 0)) || ((bVar7 == 0 && (iVar9 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar9 == 0)))) { local_e1 = 0; } else { local_e1 = 1; if ((this->_parentLaser == (EntityPtr)0x0) && (this->_oneHit == 0)) { (this->_hitList)._end = (this->_hitList)._begin; } } EVar19 = this->_parent; if ((EVar19 != (EntityPtr)0x0) && (this->_disableFollowParent == 0)) { fVar21 = *(float *)((int)EVar19 + 0x33c); fVar24 = *(float *)((int)EVar19 + 0x340); if (*(int *)((int)EVar19 + 0x28) == 1) { fVar21 = fVar21 + (this->_parentOffset).x + *(float *)((int)EVar19 + 0x164c); fVar24 = fVar24 + (this->_parentOffset).y + *(float *)((int)EVar19 + 0x1650); } else if (this->_spawnerType != 1) { fVar21 = fVar21 + (this->_parentOffset).x; fVar24 = fVar24 + (this->_parentOffset).y; } (this->_pos).y = fVar24; (this->_pos).x = fVar21; } local_fc = (float)((uint)EVar19 & 0xffffff00); isSamplesRebuilt = '\0'; isRedirected = '\0'; local_104.y = (float)((uint)local_104.y & 0xffffff00); local_114.y = (float)((uint)local_114.y & 0xffffff00); if ((this->_isInterpolating == 0) && (this->_timeout != 0)) { iVar9 = this->_variant; if ((iVar9 == 6) || (iVar9 == 0xf)) { iVar9 = 4; } else if (((iVar9 == 0xb) || (iVar9 == 0xe)) && (g_game->_frameCount - this->_spawnFrame == 1)) { iVar9 = 10; } else { if (iVar9 != 0xd) goto LAB_00973e19; iVar9 = 10; } Game::ShakeScreen(g_game,iVar9); } LAB_00973e19: if (this->_isActiveRotating != 0) { if (this->_rotationDelay == 0) { EVar19 = (EntityPtr)this->_rotationDegrees; pfVar1 = &this->_rotationDegrees; if (0.0 <= (float)EVar19) { if (0.0 < (float)EVar19) { local_c0.y = this->_rotationSpd * 0.5; rotationStep = &local_c0.y; if ((float)EVar19 < local_c0.y) { rotationStep = pfVar1; } local_b4 = (EntityPtr)((float)EVar19 - *rotationStep); fVar21 = *rotationStep + this->_angleDegrees; this->_angleDegrees = fVar21; *pfVar1 = (float)local_b4; fVar21 = normalize_angle_degrees(fVar21 - 90.0); (this->_sprite)._rotation = fVar21; EVar19 = local_b4; } if ((float)EVar19 <= 0.0) { this->_isActiveRotating = 0; } } else { if ((float)EVar19 < 0.0) { local_c0.y = this->_rotationSpd * 0.5; rotationStep = &local_c0.y; if (local_c0.y < (float)EVar19) { rotationStep = pfVar1; } local_b4 = (EntityPtr)((float)EVar19 - *rotationStep); fVar21 = *rotationStep + this->_angleDegrees; this->_angleDegrees = fVar21; *pfVar1 = (float)local_b4; fVar21 = normalize_angle_degrees(fVar21 - 90.0); (this->_sprite)._rotation = fVar21; EVar19 = local_b4; } if (0.0 <= (float)EVar19) { this->_isActiveRotating = 0; } } } else { this->_rotationDelay = this->_rotationDelay + -1; } } if (this->_sampleLaser == 0) { this->_isGridHit = 0; bVar7 = is_thick_variant(this); if ((((bVar7 != 0) || (iVar9 = this->_variant, iVar9 == 2)) || ((iVar9 == 10 || ((iVar9 == 5 || (iVar9 == 7)))))) || (iVar9 == 8)) { Vector::__add(&this->_pos,&local_120,&this->_posOffset); Vector::FromAngle(&local_f0,this->_angleDegrees); if (this->_entityGridCollisionClass == 6) { local_d4[0] = (EntityPtr)0x40800000; room = g_game->_room; pVVar16 = Vector::operator_mul((Vector *)&local_1a0._h,(float *)local_d4,&local_f0); pVVar16 = Vector::__sub(&local_120,&local_140,pVVar16); pVVar16 = Room::GetLaserTarget(room,(Vector *)&local_190._h,pVVar16,&local_f0); LAB_0097663d: local_b4 = (EntityPtr)&this->_endPoint; } else { local_b4 = (EntityPtr)&this->_endPoint; if (this->_entityGridCollisionClass != 3) { local_d4[0] = (EntityPtr)0x447a0000; pVVar16 = Vector::__mul(&local_f0,(Vector *)&local_1a0._h,(float *)local_d4); pVVar16 = Vector::__add(&local_120,&local_140,pVVar16); goto LAB_0097663d; } pVVar16 = calc_end_point(this,(Vector *)&local_1a0._h,&this->_pos,&local_f0); pVVar16 = Vector::__add(pVVar16,&local_140,&this->_posOffset); } EVar19 = (EntityPtr)&this->_endPoint; ((Vector *)EVar19)->x = pVVar16->x; (this->_endPoint).y = pVVar16->y; if (0.0 < this->_maxDistance) { local_d4[0] = (EntityPtr)Vector::DistanceSquared((Vector *)EVar19,&local_120); if (this->_maxDistance * this->_maxDistance < (float)local_d4[0]) { pVVar16 = Vector::__sub(&this->_endPoint,&local_178,&local_120); pVVar16 = Vector::Resized(pVVar16,&local_cc,this->_maxDistance); pVVar16 = Vector::__add(&local_120,(Vector *)(local_e0 + 8),pVVar16); (this->_endPoint).x = pVVar16->x; (this->_endPoint).y = pVVar16->y; EVar19 = local_b4; } } iVar9 = this->_variant; if ((((iVar9 == 6) || (iVar9 == 0xf)) && (this->_spawnerType == 0x112)) || (iVar9 == 0xd)) { pVVar16 = Vector::__sub((Vector *)EVar19,&local_c0,&local_120); pVVar16 = Vector::Resized(pVVar16,&local_114,100.0); Vector::operator_add_assign((Vector *)EVar19,pVVar16); } if ((this->_spawnerType != 1) && (this->_spawnerType != 3)) { local_130.y = 0.0; local_f0.y = 0.0; local_f0.x = 0.0; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_160,1000,0xbc,-1,0,0); local_14 = 0; local_c0.y = 0.0; if ((EntityPtr)local_160._size == (EntityPtr)0x0) { LAB_00976cc2: if (this->_bounceLaser != (int *)0x0) { (**(code **)(*(int *)this->_bounceLaser + 0x28))(); } } else { do { EVar19 = (EntityPtr)FUN_004a2920(); if (EVar19 != (EntityPtr)0x0) { Vector::FromAngle(&local_cc,(float)*(EntityPtr *)((int)EVar19 + 0x474)); pVVar16 = Vector::__sub(&this->_endPoint,(Vector *)&local_1a0._h,&local_120); if (local_cc.y * pVVar16->y + local_cc.x * pVVar16->x < 0.0) { local_178.x = *(float *)((int)EVar19 + 0x33c); local_178.y = *(float *)((int)EVar19 + 0x340); local_d4[0] = (EntityPtr)0x41a00000; pVVar16 = Vector::operator_mul((Vector *)&local_1b0._h,(float *)local_d4,&local_cc); Vector::__add(&local_178,&local_140,pVVar16); pVVar16 = Vector::Rotated(&local_cc,(Vector *)&local_170._h,90.0); local_d4[0] = *(EntityPtr *)((int)EVar19 + 0x370); Vector::__mul(pVVar16,(Vector *)&local_190._h,(float *)local_d4); cVar8 = segment_intersect(); if (cVar8 != '\0') { (this->_endPoint).x = local_114.y; (this->_endPoint).y = local_10c.y; local_f0.x = local_cc.x; local_f0.y = local_cc.y; local_130.y = (float)EVar19; } } } fVar21 = local_130.y; local_c0.y = (float)((int)local_c0.y + 1); } while ((uint)local_c0.y < (uint)local_160._size); if ((EntityPtr)local_130.y == (EntityPtr)0x0) goto LAB_00976cc2; Vector::__sub((Vector *)local_b4,&local_cc,&local_120); local_d4[0] = (EntityPtr)0x40000000; pVVar16 = Vector::operator_mul((Vector *)&local_170._h,(float *)local_d4,&local_f0); local_d4[0] = (EntityPtr)(local_cc.y * local_f0.y + local_cc.x * local_f0.x); pVVar16 = Vector::__mul(pVVar16,(Vector *)&local_1b0._h,(float *)local_d4); Vector::__sub(&local_cc,&local_140,pVVar16); local_c0.y = Vector::GetAngleDegrees(&local_140); Color::Color(&bounceLaserColor); if ((this->_variant != 5) && (this->_variant != 10)) { other_00 = (ColorMod *)Color::Color(); Color::operator_assign(&bounceLaserColor,other_00); } local_d4[0] = (EntityPtr)Entity::ToPlayer((Entity *)*(EntityPtr *)((int)fVar21 + 0x3bc)); if (this->_bounceLaser == (void *)0x0) { pVVar16 = Vector::__sub(&this->_endPoint,(Vector *)&local_170._h,&this->_posOffset); spawnedLaser = ShootAngle(this->_variant,pVVar16,local_c0.y,this->_timeout, &this->_posOffset,(Entity *)local_d4[0],1); if (spawnedLaser == (Entity_Laser *)0x0) goto LAB_00976cb2; pcVar2 = *(code **)(*(int *)spawnedLaser + 0x3c); spawnedLaser->_disableFollowParent = 1; spawnedLaser->_prismTouched = 1; (*pcVar2)(); (**(code **)(*(int *)spawnedLaser + 0x40))(); spawnedLaser->_renderDepthOffset = this->_renderDepthOffset + 100.0; spawnedLaser->_timeout = this->_timeout; if ((this->_shrink == 0) && (this->_dead == 0)) { bVar7 = 0; } else { bVar7 = 1; } spawnedLaser->_shrink = bVar7; (**(code **)(*(int *)spawnedLaser + 0xc))(); EntityPtr::SetReference((EntityPtr *)&this->_bounceLaser,(Entity *)spawnedLaser); isRedirected = '\x01'; local_104.y = (float)CONCAT31(local_104.y._1_3_,1); } else { bounceLaser = (Entity_Laser *)__RTDynamicCast(); (**(code **)(*(int *)bounceLaser + 0x3c))(); (**(code **)(*(int *)bounceLaser + 0x40))(); bounceLaser->_renderDepthOffset = this->_renderDepthOffset + 100.0; bounceLaser->_timeout = this->_timeout; if ((this->_shrink == 0) && (this->_dead == 0)) { bVar7 = 0; } else { bVar7 = 1; } bounceLaser->_shrink = bVar7; Entity_NPC::SetAimAngle((Entity_NPC *)bounceLaser,local_c0.y); pVVar16 = Vector::__sub(&this->_endPoint,(Vector *)&local_170._h,&this->_posOffset); (bounceLaser->_pos).x = pVVar16->x; (bounceLaser->_pos).y = pVVar16->y; LAB_00976cb2: isRedirected = '\x01'; local_104.y = (float)CONCAT31(local_104.y._1_3_,1); } } local_14 = 0xffffffff; EntityList_Query::~EntityList_Query(&local_160); } Vector::__sub((Vector *)local_b4,&local_140,&local_120); fVar21 = Vector::Length(&local_140); this->_laserLength = fVar21; update_sample_points(this); local_fc = (float)CONCAT31(local_fc._1_3_,isRedirected); } } else { if (((this->_homingType == 1) || (this->_oneHit != 0)) && (this->_isFirstUpdate == 0)) { isSamplesRebuilt = '\0'; } else { fVar21 = this->_angleDegrees; isSamplesRebuilt = '\x01'; this->_isGridHit = 0; if (((fVar21 != this->_lastAngleDegrees) && (bVar7 = is_thick_variant(this), bVar7 == 0)) && (this->_variant != 5)) { (this->_homingLaser)._bezier._end = (this->_homingLaser)._bezier._begin; (this->_homingLaser)._samples._end = (this->_homingLaser)._samples._begin; *(undefined4 *)&(this->_homingLaser).field_0x38 = *(undefined4 *)&(this->_homingLaser).field_0x34; (this->_homingLaser)._nonOptimizedSamples._end = (this->_homingLaser)._nonOptimizedSamples._begin; fVar21 = this->_angleDegrees; } local_b4 = (EntityPtr)(fVar21 * 0.017453292); local_c0.y = sin((float)local_b4); local_f0.x = cos((float)local_b4); local_f0.y = local_c0.y; local_10c.y = g_vectorZero.x; local_104.y = g_vectorZero.y; if ((1 < (uint)(this->_sprite)._layerCount) && (pvVar10 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0), pvVar10 != (void *)0x0)) { fVar24 = *(float *)((int)pvVar10 + 0x14) + *(float *)((int)pvVar10 + 0xc); fVar21 = (this->_sprite)._scale.y; local_104.y = local_c0.y * fVar24 * fVar21; local_10c.y = fVar24 * local_f0.x * fVar21; } EVar19 = this->_spawnerEntity; local_130.y = local_10c.y + (this->_pos).x; local_cc.y = local_104.y + (this->_pos).y; if ((EVar19 == (EntityPtr)0x0) || (*(int *)((int)EVar19 + 0x28) != 1)) { EVar19 = (EntityPtr)0x0; } local_cc.x = local_130.y; local_b4 = (EntityPtr)local_cc.y; pVVar16 = calc_end_point(this,&local_140,&local_cc,&local_f0); fVar21 = pVVar16->x; (this->_endPoint).x = fVar21; fVar24 = pVVar16->y; (this->_endPoint).y = fVar24; fVar29 = this->_maxDistance; if ((0.0 < fVar29) && (fVar29 * fVar29 < ((float)local_b4 - fVar24) * ((float)local_b4 - fVar24) + (local_130.y - fVar21) * (local_130.y - fVar21))) { local_cc.x = fVar21 - local_130.y; local_cc.y = fVar24 - (float)local_b4; pVVar16 = Vector::Resized(&local_cc,&local_140,fVar29); fVar21 = pVVar16->y; (this->_endPoint).x = local_130.y + pVVar16->x; (this->_endPoint).y = (float)local_b4 + fVar21; } (this->_homingLaser)._bezier._end = (this->_homingLaser)._bezier._begin; if (((this->_variant == 6) || (this->_variant == 0xf)) && (this->_spawnerType == 1)) { if ((((this->_endPoint).y - (float)local_b4) - local_c0.y * 50.0) * local_104.y + (((this->_endPoint).x - local_130.y) - local_f0.x * 50.0) * local_10c.y < 0.0) { local_c0.y = local_130.y + local_10c.y; local_d4[0] = (EntityPtr)((float)local_b4 + local_104.y); fVar24 = sqrtf(local_104.y * local_104.y + local_10c.y * local_10c.y); EVar14 = local_d4[0]; if (fVar24 <= 0.0) { fVar21 = local_c0.y + local_10c.y; EVar12 = (EntityPtr)local_104.y; } else { fVar21 = local_c0.y + (0.1 / fVar24) * local_10c.y; EVar12 = (EntityPtr)((0.1 / fVar24) * local_104.y); } goto LAB_009743d3; } } else if (((this->_endPoint).y - (float)local_b4) * local_104.y + ((this->_endPoint).x - local_130.y) * local_10c.y < 0.0) { local_d4[0] = (EntityPtr)(local_130.y + local_10c.y); local_c0.y = (float)local_b4 + local_104.y; fVar21 = sqrtf(local_104.y * local_104.y + local_10c.y * local_10c.y); if (fVar21 <= 0.0) { pEVar13 = (EntityPtr *)local_10c.y; EVar12 = (EntityPtr)local_104.y; } else { pEVar13 = (EntityPtr *)((0.1 / fVar21) * local_10c.y); EVar12 = (EntityPtr)((0.1 / fVar21) * local_104.y); } fVar21 = (float)local_d4[0] + (float)pEVar13; EVar14 = (EntityPtr)local_c0.y; LAB_009743d3: (this->_endPoint).y = (float)EVar14 + (float)EVar12; (this->_endPoint).x = fVar21; } *(float *)&(this->_homingLaser).field_0x4 = local_130.y; *(EntityPtr *)&(this->_homingLaser).field_0x8 = local_b4; *(float *)&(this->_homingLaser).field_0xc = (this->_endPoint).x; *(float *)&(this->_homingLaser).field_0x10 = (this->_endPoint).y; pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c34b60); if (((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) { HomingLaser::build_curl_path(); } pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c34860); if (((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) { HomingLaser::build_wiggle_bezier(); pvVar10 = (this->_homingLaser)._bezier._end; if ((this->_homingLaser)._bezier._begin != pvVar10) { (this->_endPoint).x = *(float *)((int)pvVar10 + -0x18); (this->_endPoint).y = *(float *)((int)pvVar10 + -0x14); } } pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c34950); if (((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) { laser_sample_trace_entities(); pvVar10 = (this->_homingLaser)._bezier._end; if ((this->_homingLaser)._bezier._begin != pvVar10) { (this->_endPoint).x = *(float *)((int)pvVar10 + -0x18); (this->_endPoint).y = *(float *)((int)pvVar10 + -0x14); } } BitSet128::operator_and((BitSet128 *)&local_160,&this->_tearFlags,&g_tearFlagHoming); HomingLaser::build_bezier_path(); if ((this->_variant == 2) || (this->_variant == 10)) { fVar21 = 0.7; } else if (this->_homingType == 2) { fVar21 = 1.0; } else if (this->_maxDistance <= 0.0) { fVar21 = 0.9; } else { fVar21 = 0.63; } HomingLaser::CalculateSamples(&this->_homingLaser,fVar21); pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c348c0); if (((((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) && (pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c34b60 ), (int)pBVar15->_l == 0 && *(int *)((int)&pBVar15->_l + 4) == 0)) && ((int)pBVar15->_h == 0 && *(int *)((int)&pBVar15->_h + 4) == 0)) { local_d4[0] = (EntityPtr) (float)((double)this->_index + __uint_to_double_fixup[-(this->_index >> 0x1f)] ); if (EVar19 != (EntityPtr)0x0) { get_tear_trinket_multiplier((Entity_Player *)EVar19,0x1e); } HomingLaser::apply_sample_wiggle(); } pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c34870); if (((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) { local_d4[0] = (EntityPtr) (float)((double)this->_index + __uint_to_double_fixup[-(this->_index >> 0x1f)] ); if (EVar19 != (EntityPtr)0x0) { get_tear_trinket_multiplier((Entity_Player *)EVar19,10); } HomingLaser::apply_sine_offset(); } pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c348e0); if (((int)pBVar15->_l == 0 && *(int *)((int)&pBVar15->_l + 4) == 0) && ((int)pBVar15->_h == 0 && *(int *)((int)&pBVar15->_h + 4) == 0)) { pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,&this->_tearFlags,(BitSet128 *)&DAT_00c348a0); if (((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) { local_d4[0] = (EntityPtr) (float)((double)this->_index + __uint_to_double_fixup[-(this->_index >> 0x1f)]); if (EVar19 != (EntityPtr)0x0) { get_tear_trinket_multiplier((Entity_Player *)EVar19,0x1a); } goto LAB_009747b1; } } else { local_d4[0] = (EntityPtr) (float)((double)this->_index + __uint_to_double_fixup[-(this->_index >> 0x1f)] ); if (EVar19 != (EntityPtr)0x0) { get_tear_trinket_multiplier((Entity_Player *)EVar19,0x2e); } LAB_009747b1: update_wiggle_path(); } pBVar15 = BitSet128::operator_or (&local_170,(BitSet128 *)&DAT_00c345b0,(BitSet128 *)&DAT_00c345c0); pBVar15 = BitSet128::operator_and(&local_1b0,&this->_tearFlags,pBVar15); if (((int)pBVar15->_l != 0 || *(int *)((int)&pBVar15->_l + 4) != 0) || ((int)pBVar15->_h != 0 || *(int *)((int)&pBVar15->_h + 4) != 0)) { local_fc = (float)HomingLaser::truncate_samples(); local_114.y = (float)CONCAT31(local_114.y._1_3_,SUB41(local_fc,0)); } if (((this->_entityGridCollisionClass != 0) && (pBVar15 = BitSet128::operator_and(&local_1a0,&this->_tearFlags,&g_tearFlagSpectral), (int)pBVar15->_l == 0 && *(int *)((int)&pBVar15->_l + 4) == 0)) && ((int)pBVar15->_h == 0 && *(int *)((int)&pBVar15->_h + 4) == 0)) { local_f0.x = (this->_posOffset).x * 0.4; local_f0.y = (this->_posOffset).y * 0.4; bVar7 = HomingLaser::clip_samples_to_grid(); local_fc = (float)((uint)local_fc & 0xff); this->_isGridHit = bVar7; if (bVar7 != 0) { local_fc = 0.0; } local_114.y = (float)CONCAT31(local_114.y._1_3_,SUB41(local_fc,0)); if (this->_homingType == 2) { HomingLaser::truncate_samples_at_obstacle(); } } if ((g_game->_challenge == 0x1e) && ((this->_parent == (EntityPtr)0x0 || ((iVar9 = *(int *)((int)this->_parent + 0x28), iVar9 != 1 && (iVar9 != 3)))))) { HomingLaser::truncate_samples_at_player(); } if (((this->_spawnerType == 1) || ((this->_spawnerType == 3 && (this->_spawnerVariant != 0x7b)))) && (this->_multidimensionalTouched == 0)) { local_120.y = 0.0; local_120.x = 0.0; pEVar13 = this->_multidimensionalLasers; local_cc.y = 0.0; local_cc.x = 0.0; local_10c.y = (float)pEVar13; iVar9 = HomingLaser::find_targets(); if (iVar9 == 0) { local_c0.y = 2.8026e-45; do { if (*pEVar13 != (EntityPtr)0x0) { (**(code **)(*(int *)*pEVar13 + 0x28))(); } pEVar13 = pEVar13 + 1; local_c0.y = (float)((int)local_c0.y + -1); } while ((EntityPtr)local_c0.y != (EntityPtr)0x0); EVar19 = this->_child; iVar9 = 0; if (EVar19 != (EntityPtr)0x0) { if ((((this->_bounceLaser == (void *)0x0) || (*(int *)((int)EVar19 + 0x28) != 1000)) || (*(int *)((int)EVar19 + 0x2c) != 0x32)) || ((*(int *)((int)EVar19 + 0x30) == 4 || ((this->_variant != 6 && (this->_variant != 0xf)))))) goto LAB_00974ed9; (**(code **)(*(int *)EVar19 + 0x28))(); iVar9 = extraout_ECX; } spawn_impact_effect(this,iVar9); } else { local_130.y = (float)((uint)local_cc.x ^ 0x80000000); local_b4 = (EntityPtr)local_cc.y; if ((*pEVar13 == (EntityPtr)0x0) || (this->_multidimensionalLasers[1] == (EntityPtr)0x0)) { local_c0.y = 2.8026e-45; EVar19 = (EntityPtr)local_cc.x; EVar12 = (EntityPtr)local_cc.y; local_104.y = (float)pEVar13; EVar14 = (EntityPtr)local_130.y; EVar22 = (EntityPtr)local_cc.y; do { if (*(int *)local_104.y == 0) { local_f0.x = local_120.x + (float)EVar22 * 5.0; local_f0.y = local_120.y + (float)EVar14 * 5.0; fVar21 = atan2f((float)EVar12,(float)EVar19); spawnedLaser = ShootAngle(this->_variant,&local_f0,fVar21 * 57.295776,this->_timeout ,&this->_posOffset,(Entity *)this->_parent,1); if (spawnedLaser != (Entity_Laser *)0x0) { spawnedLaser->_disableFollowParent = 1; copy_from_parent(); pBVar15 = BitSet128::__bnot((BitSet128 *)&DAT_00c345a0,(BitSet128 *)local_148); local_160._0_4_ = *(undefined4 *)&(this->_tearFlags)._l; local_160._data = *(void **)((int)&(this->_tearFlags)._l + 4); local_160._capacity = (int)(this->_tearFlags)._h; local_160._size = *(int *)((int)&(this->_tearFlags)._h + 4); pBVar15 = BitSet128::operator_and(&local_190,(BitSet128 *)&local_160,pBVar15); EVar19 = spawnedLaser->_parent; qVar4 = pBVar15->_l; uVar30 = *(undefined4 *)((int)&pBVar15->_l + 4); qVar5 = pBVar15->_h; uVar3 = *(undefined4 *)((int)&pBVar15->_h + 4); spawnedLaser->_multidimensionalTouched = 1; *(int *)&(spawnedLaser->_tearFlags)._l = (int)qVar4; *(undefined4 *)((int)&(spawnedLaser->_tearFlags)._l + 4) = uVar30; *(int *)&(spawnedLaser->_tearFlags)._h = (int)qVar5; *(undefined4 *)((int)&(spawnedLaser->_tearFlags)._h + 4) = uVar3; if (EVar19 != (EntityPtr)0x0) { local_d4[0] = (EntityPtr)&spawnedLaser->_parent; std::multiset::erase(); } spawnedLaser->_parent = (EntityPtr)this; std::multiset::insert(); (**(code **)(*(int *)spawnedLaser + 0xc))(); if (*(int *)local_104.y != 0) { local_d4[0] = (EntityPtr)local_104.y; std::multiset::erase(); } *(Entity_Laser **)local_104.y = spawnedLaser; std::multiset::insert(); } local_b4 = (EntityPtr)((uint)local_b4 ^ 0x80000000); local_130.y = (float)((uint)local_130.y ^ 0x80000000); EVar19 = (EntityPtr)local_cc.x; EVar12 = (EntityPtr)local_cc.y; EVar14 = (EntityPtr)local_130.y; EVar22 = local_b4; } local_104.y = (float)((int)local_104.y + 4); local_c0.y = (float)((int)local_c0.y + -1); } while (local_c0.y != 0.0); this->_chainedLasers = 0; } else { fVar21 = atan2f(local_cc.y,local_cc.x); local_104.y = 2.8026e-45; local_d4[0] = (EntityPtr)(fVar21 * 57.295776); local_fc = (float)local_d4[0] - 90.0; local_c0.y = (float)pEVar13; do { EVar19 = *(EntityPtr *)local_c0.y; if ((EVar19 == (EntityPtr)0x0) || (*(int *)((int)EVar19 + 0x28) != 7)) { EVar19 = (EntityPtr)0x0; } copy_from_parent(); fVar24 = local_130.y * 5.0; *(undefined4 *)((int)EVar19 + 0x420) = *(undefined4 *)((int)EVar19 + 0x41c); local_130.y = (float)((uint)local_130.y ^ 0x80000000); local_c0.y = (float)((int)local_c0.y + 4); local_104.y = (float)((int)local_104.y + -1); *(EntityPtr *)((int)EVar19 + 0x418) = local_d4[0]; *(EntityPtr *)((int)EVar19 + 0x41c) = local_d4[0]; *(float *)((int)EVar19 + 0xec) = local_fc; fVar21 = (float)local_b4 * 5.0; local_b4 = (EntityPtr)((uint)local_b4 ^ 0x80000000); *(float *)((int)EVar19 + 0x33c) = local_120.x + fVar21; *(float *)((int)EVar19 + 0x340) = local_120.y + fVar24; } while (local_104.y != 0.0); local_104.y = 0.0; } pEVar13 = this->_multidimensionalLasers; local_c0.y = 2.8026e-45; do { EVar19 = *pEVar13; if ((EVar19 == (EntityPtr)0x0) || (*(int *)((int)EVar19 + 0x28) != 7)) { EVar19 = (EntityPtr)0x0; } if (EVar19 != (EntityPtr)0x0) { uVar17 = g_game->_frameCount - this->_spawnFrame & 0x8000000f; if ((int)uVar17 < 0) { uVar17 = (uVar17 - 1 | 0xfffffff0) + 1; } local_58._0_4_ = 1.0; local_58._4_4_ = 1.0; local_58._8_4_ = 1.0; local_58._12_4_ = 1.0; pulseFrame = 0x10 - uVar17; if ((int)uVar17 < 8) { pulseFrame = uVar17; } fVar21 = (float)(int)pulseFrame * 0.125; local_38 = fVar21 * 0.4 - 0.2; local_58._20_4_ = fVar21 + fVar21 + 0.3; local_58._16_4_ = local_58._20_4_; fStack_40 = (float)local_58._20_4_; fStack_3c = 1.0; local_34 = local_38; local_30 = local_38; (**(code **)(*(int *)EVar19 + 0x3c))(); if (*(int **)((int)EVar19 + 0x3c0) != (int *)0x0) { (**(code **)(**(int **)((int)EVar19 + 0x3c0) + 0x3c))(); } if (*(int **)((int)EVar19 + 0x53c) != (int *)0x0) { (**(code **)(**(int **)((int)EVar19 + 0x53c) + 0x3c))(); } } pEVar13 = (EntityPtr *)((int)local_10c.y + 4); local_c0.y = (float)((int)local_c0.y + -1); local_10c.y = (float)pEVar13; } while (local_c0.y != 0.0); isRedirected = '\x01'; local_fc = 0.0; local_114.y = (float)((uint)local_114.y & 0xffffff00); local_c0.y = 0.0; } } LAB_00974ed9: local_c1 = false; if (((this->_spawnerType != 1) && (this->_spawnerType != 3)) || (1 < *(int *)&g_game->_deathmatchManager)) { local_f0.y = 0.0; local_f0.x = 0.0; local_cc.y = 0.0; local_cc.x = 0.0; EVar19 = (EntityPtr)HomingLaser::find_targets(); local_b4 = EVar19; if (EVar19 == (EntityPtr)0x0) { piVar18 = this->_bounceLaser; if (((piVar18 != (int *)0x0) && (piVar18[0xef] != 0)) && (*(int *)(piVar18[0xef] + 0x28) == 1)) { (**(code **)(*piVar18 + 0x28))(); } } else { local_d4[0] = (EntityPtr)((float)*(EntityPtr *)((int)EVar19 + 0x474) * 0.017453292); local_c0.y = sin((float)local_d4[0]); fVar21 = cos((float)local_d4[0]); fVar24 = fVar21 * local_cc.x + local_c0.y * local_cc.y; fVar21 = atan2f(local_cc.y - fVar24 * (local_c0.y + local_c0.y), local_cc.x - fVar24 * (fVar21 + fVar21)); auVar25._4_4_ = extraout_var._0_4_; auVar25._0_4_ = fVar21; auVar25._8_4_ = extraout_var._4_4_; auVar25._12_4_ = extraout_var._8_4_; auVar26._4_12_ = auVar25._4_12_; auVar26._0_4_ = (EntityPtr)(fVar21 * 57.295776); local_d4[0] = auVar26._0_4_; Color::Color(&bounceLaserColor); fVar21 = auVar26._0_4_; iVar9 = this->_variant; if ((iVar9 != 5) && (iVar9 != 10)) { local_58._0_4_ = 1.0; local_58._4_4_ = 1.0; local_58._8_4_ = 1.0; local_58._12_4_ = 1.0; local_58._16_4_ = _DAT_00bac9e0; local_58._20_4_ = _UNK_00bac9e4; fStack_40 = _UNK_00bac9e8; fStack_3c = _UNK_00bac9ec; local_38 = 0.0; local_34 = 0.0; local_30 = 0.0; Color::operator_assign(this_00,(ColorMod *)local_58); fVar21 = auVar26._0_4_; iVar9 = extraout_EDX; } EVar19 = *(EntityPtr *)((int)EVar19 + 0x3bc); if ((EVar19 == (EntityPtr)0x0) || (*(int *)((int)EVar19 + 0x28) != 1)) { EVar19 = (EntityPtr)0x0; } if (this->_bounceLaser == (void *)0x0) { spawnedLaser = ShootAngle(iVar9,&local_f0,fVar21,this->_timeout,&this->_posOffset, (Entity *)EVar19,1); if (spawnedLaser != (Entity_Laser *)0x0) { pcVar2 = *(code **)(*(int *)spawnedLaser + 0x3c); spawnedLaser->_disableFollowParent = 1; spawnedLaser->_prismTouched = 1; (*pcVar2)(); (**(code **)(*(int *)spawnedLaser + 0x40))(); spawnedLaser->_renderDepthOffset = this->_renderDepthOffset + 100.0; spawnedLaser->_timeout = this->_timeout; if ((this->_shrink == 0) && (this->_dead == 0)) { bVar7 = 0; } else { bVar7 = 1; } spawnedLaser->_shrink = bVar7; (**(code **)(*(int *)spawnedLaser + 0xc))(); EntityPtr::SetReference((EntityPtr *)&this->_bounceLaser,(Entity *)spawnedLaser); } } else { piVar18 = (int *)__RTDynamicCast(); (**(code **)(*piVar18 + 0x3c))(); (**(code **)(*piVar18 + 0x40))(); piVar18[0xd6] = (int)(this->_renderDepthOffset + 100.0); piVar18[0x116] = this->_timeout; if ((this->_shrink == 0) && (this->_dead == 0)) { uVar6 = 0; } else { uVar6 = 1; } *(undefined1 *)((int)piVar18 + 0x45e) = uVar6; iVar9 = piVar18[0x107]; *(EntityPtr *)(piVar18 + 0x106) = local_d4[0]; *(EntityPtr *)(piVar18 + 0x107) = local_d4[0]; piVar18[0x108] = iVar9; piVar18[0x3b] = (int)((float)local_d4[0] - 90.0); *(float *)(piVar18 + 0xcf) = local_f0.x; *(float *)(piVar18 + 0xd0) = local_f0.y; } EVar19 = (EntityPtr)(g_game->_frameCount - (int)*(EntityPtr *)((int)local_b4 + 0x328)); if ((int)EVar19 < 0x96) { EVar19 = *(EntityPtr *)((int)local_b4 + 0x45c); EVar12 = (EntityPtr)0x1e; if (0x1e < (int)EVar19) { EVar12 = EVar19; } *(EntityPtr *)((int)local_b4 + 0x45c) = EVar12; *(EntityPtr *)((int)local_b4 + 0x460) = EVar12; } local_fc = (float)CONCAT31(EVar19._1_3_,1); isRedirected = '\x01'; local_114.y = (float)CONCAT31(local_114.y._1_3_,1); local_c1 = true; } } if (((this->_spawnerType == 1) || ((this->_spawnerType == 3 && (this->_spawnerVariant != 0x65)))) && (this->_prismTouched == 0)) { local_f0.y = 0.0; local_f0.x = 0.0; local_cc.y = 0.0; local_cc.x = 0.0; pEVar13 = this->_prismLasers; iVar9 = HomingLaser::find_targets(); if (iVar9 == 0) { local_c0.y = 5.60519e-45; do { if (*pEVar13 != (EntityPtr)0x0) { (**(code **)(*(int *)*pEVar13 + 0x28))(); } pEVar13 = pEVar13 + 1; local_c0.y = (float)((int)local_c0.y + -1); } while ((EntityPtr)local_c0.y != (EntityPtr)0x0); EVar19 = this->_child; iVar9 = 0; if (EVar19 != (EntityPtr)0x0) { if (((((this->_bounceLaser == (void *)0x0) || (*(int *)((int)EVar19 + 0x28) != 1000)) || (*(int *)((int)EVar19 + 0x2c) != 0x32)) || (*(int *)((int)EVar19 + 0x30) == 4)) || ((this->_variant != 6 && (this->_variant != 0xf)))) goto LAB_00975711; (**(code **)(*(int *)EVar19 + 0x28))(); iVar9 = extraout_ECX_00; } spawn_impact_effect(this,iVar9); } else if (((*pEVar13 == (EntityPtr)0x0) || (this->_prismLasers[1] == (EntityPtr)0x0)) || ((this->_prismLasers[2] == (EntityPtr)0x0 || (this->_prismLasers[3] == (EntityPtr)0x0)))) { local_c0.y = 0.0; do { fVar21 = local_c0.y; EVar19 = (EntityPtr)(this->_prismLasers + (int)local_c0.y); local_b4 = EVar19; if (this->_prismLasers[(int)local_c0.y] == (EntityPtr)0x0) { fVar24 = atan2f(local_cc.y,local_cc.x); fVar24 = fVar24 * 57.295776; if ((EntityPtr)fVar21 == (EntityPtr)0x0) { fVar24 = fVar24 - 30.0; } else if ((EntityPtr)fVar21 == (EntityPtr)0x1) { fVar24 = fVar24 - 10.0; } else if ((EntityPtr)fVar21 == (EntityPtr)0x2) { fVar24 = fVar24 + 10.0; } else if ((EntityPtr)fVar21 == (EntityPtr)0x3) { fVar24 = fVar24 + 30.0; } EVar12 = (EntityPtr) ShootAngle(this->_variant,&local_f0,fVar24,this->_timeout,&this->_posOffset, (Entity *)this->_parent,1); EVar19 = (EntityPtr)0x0; if (EVar12 != (EntityPtr)0x0) { *(undefined1 *)((int)EVar12 + 0x4e4) = 1; copy_from_parent(); *(undefined1 *)((int)EVar12 + 0x514) = 1; (**(code **)(*(int *)EVar12 + 0xc))(); if (*(EntityPtr *)local_b4 != (EntityPtr)0x0) { local_d4[0] = local_b4; std::multiset::erase(); } *(EntityPtr *)local_b4 = EVar12; EVar19 = (EntityPtr)std::multiset::insert(); } } local_c0.y = (float)((int)local_c0.y + 1); } while ((int)local_c0.y < 4); local_fc = (float)((uint)EVar19 & 0xffffff00); this->_chainedLasers = 0; isRedirected = '\x01'; local_114.y = (float)((uint)local_114.y & 0xffffff00); } else { EVar19 = (EntityPtr)0x0; local_c0.y = 0.0; fVar21 = atan2f(local_cc.y,local_cc.x); auVar27._4_4_ = extraout_var_00._0_4_; auVar27._0_4_ = fVar21; auVar27._8_4_ = extraout_var_00._4_4_; auVar27._12_4_ = extraout_var_00._8_4_; auVar23._4_12_ = auVar27._4_12_; auVar23._0_4_ = (EntityPtr)(fVar21 * 57.295776); local_d4[0] = auVar23._0_4_; do { fVar24 = 30.0; local_b4 = auVar23._0_4_; Color::Color(&prismLaserColor); fVar21 = auVar23._0_4_; if (EVar19 == (EntityPtr)0x0) { local_b4 = (EntityPtr)(fVar21 - fVar24); } else { if (EVar19 == (EntityPtr)0x1) { local_b4 = (EntityPtr)(fVar21 - 10.0); Color::Reset(&local_1dc); fVar21 = 0.7843138; prismLaserColor._tint[1] = 2.0; prismLaserColor._tint[2] = 1.0; local_1dc._offset[2] = 0.0; prismLaserColor._offset[2] = 0.0; prismLaserColor._colorize[0] = local_1dc._colorize[0]; prismLaserColor._colorize[1] = local_1dc._colorize[1]; prismLaserColor._colorize[2] = local_1dc._colorize[2]; prismLaserColor._colorize[3] = local_1dc._colorize[3]; fVar24 = 0.3921569; } else { if (EVar19 == (EntityPtr)0x2) { local_b4 = (EntityPtr)(fVar21 + 10.0); Color::Reset(&local_208); fVar21 = 0.7843138; local_208._offset[2] = 0.3921569; prismLaserColor._offset[2] = 0.3921569; prismLaserColor._tint[1] = 2.0; prismLaserColor._tint[2] = 1.0; prismLaserColor._colorize[0] = local_208._colorize[0]; prismLaserColor._colorize[1] = local_208._colorize[1]; prismLaserColor._colorize[2] = local_208._colorize[2]; prismLaserColor._colorize[3] = local_208._colorize[3]; } else { if (EVar19 != (EntityPtr)0x3) goto LAB_0097548c; local_b4 = (EntityPtr)(fVar21 + fVar24); Color::Reset(&local_234); fVar21 = 0.3921569; local_234._offset[2] = 0.7843138; prismLaserColor._offset[2] = 0.7843138; prismLaserColor._tint[1] = 1.0; prismLaserColor._tint[2] = 2.0; prismLaserColor._colorize[0] = local_234._colorize[0]; prismLaserColor._colorize[1] = local_234._colorize[1]; prismLaserColor._colorize[2] = local_234._colorize[2]; prismLaserColor._colorize[3] = local_234._colorize[3]; } fVar24 = -0.7843138; } prismLaserColor._tint[3] = 1.0; prismLaserColor._tint[0] = 1.0; prismLaserColor._offset[1] = fVar21; prismLaserColor._offset[0] = fVar24; } LAB_0097548c: piVar18 = (int *)__RTDynamicCast(); copy_from_parent(); (**(code **)(*piVar18 + 0x3c))(); uVar17 = piVar18[0x107]; auVar23 = ZEXT416((uint)local_d4[0]); *(EntityPtr *)(piVar18 + 0x106) = local_b4; *(EntityPtr *)(piVar18 + 0x107) = local_b4; piVar18[0x108] = uVar17; piVar18[0x3b] = (int)((float)local_b4 - 90.0); *(float *)(piVar18 + 0xcf) = local_f0.x; *(float *)(piVar18 + 0xd0) = local_f0.y; EVar19 = (EntityPtr)((int)local_c0.y + 1); local_c0.y = (float)EVar19; } while ((int)EVar19 < 4); local_fc = (float)(uVar17 & 0xffffff00); isRedirected = '\x01'; local_114.y = (float)((uint)local_114.y & 0xffffff00); } } LAB_00975711: pBVar15 = &this->_tearFlags; pBVar28 = BitSet128::operator_and((BitSet128 *)&local_160,pBVar15,(BitSet128 *)&DAT_00c348d0); if (((((int)pBVar28->_l == 0 && *(int *)((int)&pBVar28->_l + 4) == 0) && ((int)pBVar28->_h == 0 && *(int *)((int)&pBVar28->_h + 4) == 0)) || (isRedirected != '\0')) || (this->_isGridHit != 0)) { if (this->_continuumLaser != (EntityPtr)0x0) { (**(code **)(*(int *)this->_continuumLaser + 0x28))(); } } else { pfVar1 = (this->_homingLaser)._samples._begin; pvVar10 = *(void **)((int)local_150.y + 0x4b0); iVar9 = (int)((AnimationState *)((int)local_150.y + 0x484))->_animation - (int)pfVar1 >> 3; local_cc.x = *(float *)((int)pvVar10 + -8) - *(float *)((int)pvVar10 + -0x10); local_cc.y = *(float *)((int)pvVar10 + -4) - *(float *)((int)pvVar10 + -0xc); local_120.x = pfVar1[iVar9 * 2 + -2]; local_120.y = pfVar1[iVar9 * 2 + -1]; local_c0.y = sqrtf((pfVar1[1] - local_120.y) * (pfVar1[1] - local_120.y) + (*pfVar1 - local_120.x) * (*pfVar1 - local_120.x)); game = g_game; local_d4[0] = (EntityPtr)((int)local_150.y + 0x34c); local_f0.x = pfVar1[iVar9 * 2 + -2] + *(float *)local_d4[0]; local_f0.y = pfVar1[iVar9 * 2 + -1] + *(float *)((int)local_150.y + 0x350); Room::GetClampedPositionImpl(g_game->_room,&local_130,&local_f0,-131.0,-131.0,-131.0,-131.0) ; uVar17 = 0; do { Room::ScreenWrapPositionImpl(game->_room,&local_f0,&local_130,-130.0,-130.0,-130.0,-130.0) ; bVar7 = Vector::operator_eq(&local_f0,&local_130); if (bVar7 != 0) break; uVar17 = uVar17 + 1; local_130.x = local_f0.x; local_130.y = local_f0.y; } while (uVar17 < 4); Vector::operator__(&local_130,(Vector *)local_d4[0]); this = (Entity_Laser *)local_150.y; EVar19 = *(EntityPtr *)((int)local_150.y + 0x538); bVar7 = Vector::operator_ne(this_01,&local_120); if (bVar7 == 0) { if (EVar19 != (EntityPtr)0x0) { (**(code **)(*(int *)EVar19 + 0x28))(); } } else if (EVar19 == (EntityPtr)0x0) { local_d4[0] = (EntityPtr)Vector::GetAngleDegrees(&local_cc); spawnedLaser = ShootAngle(*(int *)((int)this + 0x2c),&local_130,(float)local_d4[0], *(int *)((int)this + 0x458),(Vector *)((int)this + 0x34c), (Entity *)*(EntityPtr *)((int)this + 0x3bc),1); EntityPtr::Set((EntityPtr *)((int)this + 0x538),(Entity *)spawnedLaser); if (*(EntityPtr *)((int)this + 0x538) != (EntityPtr)0x0) { *(undefined1 *)((int)*(EntityPtr *)((int)this + 0x538) + 0x518) = 1; *(undefined1 *)((int)*(EntityPtr *)((int)this + 0x538) + 0x4e4) = 1; copy_from_parent(); FUN_0096d120(); if (*(byte *)((int)this + 0x515) == 0) { EVar19 = (EntityPtr)this; } else { EVar19 = *(EntityPtr *)((int)this + 0x3bc); } Entity::SetParent((Entity *)*(EntityPtr *)((int)this + 0x538),(Entity *)EVar19); *(int *)((int)this + 0x560) = 0; if (*(EntityPtr *)((int)this + 0x538) != (EntityPtr)0x0) goto LAB_009759d5; } } else { LAB_009759d5: copy_from_parent(); pBVar15 = BitSet128::__bnot((BitSet128 *)&DAT_00c348d0,(BitSet128 *)&local_160); EVar19 = *(EntityPtr *)((int)this + 0x538); pBVar15 = BitSet128::operator_and(&local_170,(BitSet128 *)((int)EVar19 + 0x428),pBVar15); uVar30 = *(undefined4 *)((int)&pBVar15->_l + 4); qVar4 = pBVar15->_h; uVar3 = *(undefined4 *)((int)&pBVar15->_h + 4); *(int *)((int)EVar19 + 0x428) = (int)pBVar15->_l; *(undefined4 *)((int)EVar19 + 0x42c) = uVar30; *(int *)((int)EVar19 + 0x430) = (int)qVar4; *(undefined4 *)((int)EVar19 + 0x434) = uVar3; EVar19 = *(EntityPtr *)((int)this + 0x538); *(float *)((int)EVar19 + 0x33c) = local_130.x; *(float *)((int)EVar19 + 0x340) = local_130.y; local_d4[0] = (EntityPtr)Vector::GetAngleDegrees(&local_cc); Entity_NPC::SetAimAngle ((Entity_NPC *)*(EntityPtr *)((int)this + 0x538),(float)local_d4[0]); EVar19 = (EntityPtr)((int)this + 0x538); EVar12 = *(EntityPtr *)EVar19; if ((float)*(void **)((int)this + 0x4d0) <= 0.0) { EVar14 = (EntityPtr)0x0; } else { local_d4[0] = (EntityPtr)((float)*(void **)((int)this + 0x4d0) - local_c0.y); local_c0.y = 10.0; EVar19 = (EntityPtr)local_d4; if ((float)local_d4[0] <= 10.0) { EVar19 = (EntityPtr)&local_c0.y; } EVar14 = *(EntityPtr *)EVar19; } *(EntityPtr *)((int)EVar12 + 0x4d0) = EVar14; if (*(byte *)((int)this + 0x515) != 0) { *(undefined4 *)((int)*(EntityPtr *)((int)this + 0x538) + 0x540) = 2; EVar19 = *(EntityPtr *)((int)this + 0x538); *(undefined1 *)((int)EVar19 + 0x171) = 0; } if (*(char *)((int)*(EntityPtr *)((int)this + 0x538) + 0x45c) != '\0') { EVar19 = (EntityPtr)(**(code **)(*(int *)*(EntityPtr *)((int)this + 0x538) + 0xc))(); } local_fc = (float)((uint)EVar19 & 0xffffff00); isRedirected = '\x01'; local_114.y = (float)((uint)local_114.y & 0xffffff00); } pBVar15 = (BitSet128 *)((int)this + 0x428); } if (local_c1 == false) { pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,pBVar15,(BitSet128 *)&DAT_00c34b80); bVar7 = BitSet128::IsNonZero(pBVar15); if ((bVar7 == 0) || (isRedirected != '\0')) { iVar9 = 0; if (*(int **)((int)this + 0x4e8) != (int *)0x0) { (**(code **)(**(int **)((int)this + 0x4e8) + 0x28))(); iVar9 = extraout_ECX_01; } spawn_impact_effect(this,iVar9); } else { local_d4[0] = (EntityPtr)0x3ecccccd; Vector::__mul((Vector *)((int)this + 0x34c),&local_140,(float *)local_d4); local_c0.y = (float)__RTDynamicCast(); pVVar16 = ((std_vector *)((int)this + 0x480))->_begin; iVar9 = (int)*(void **)((int)this + 0x484) - (int)pVVar16 >> 3; local_cc.x = pVVar16[iVar9 + -1].x; local_cc.y = pVVar16[iVar9 + -1].y; local_130.y = Vector::Distance(&local_cc,pVVar16); iVar9 = 0; local_120.x = g_vectorZero.x; local_b4 = (EntityPtr)&g_game->_room; local_120.y = g_vectorZero.y; local_d4[0] = (EntityPtr)0x41a00000; do { pVVar16 = Vector::FromAngle((Vector *)&local_190._h,(float)iVar9); Vector::__mul(pVVar16,&local_10c,(float *)local_d4); pvVar10 = ((std_vector *)((int)this + 0x480))->_begin; iVar11 = (int)*(void **)((int)this + 0x484) - (int)pvVar10 >> 3; local_f0.x = *(float *)((int)pvVar10 + iVar11 * 8 + -8); local_f0.y = *(float *)((int)pvVar10 + iVar11 * 8 + -4); pVVar16 = Room::GetClampedPosition(*(Room **)local_b4,&local_178,&local_f0,0.0); local_f0.x = pVVar16->x; local_f0.y = pVVar16->y; pVVar16 = Vector::__add(&local_f0,(Vector *)&local_1a0._h,&local_10c); Vector::__add(pVVar16,&local_104,&local_140); local_b4 = (EntityPtr)&g_game->_room; pos.y = local_104.y; pos.x = local_104.x; Room::GetGridCollisionAtPos(*(Room **)local_b4,pos); cVar8 = FUN_0070be60(); if (cVar8 != '\0') { Vector::operator_add_assign(&local_120,&local_10c); } iVar9 = iVar9 + 6; } while (iVar9 < 0x168); pvVar10 = ((std_vector *)((int)this + 0x480))->_begin; iVar9 = (int)*(void **)((int)this + 0x484) - (int)pvVar10 >> 3; Vector::__sub((Vector *)((int)pvVar10 + (iVar9 + -1) * 8),&local_f0, (Vector *)((int)pvVar10 + iVar9 * 8 + -0x10)); Vector::Normalize(&local_120); EVar12 = (EntityPtr)local_c0.y; EVar19 = *(EntityPtr *)((int)this + 0x3bc); local_b4 = (EntityPtr)0x40000000; if (((EVar19 != (EntityPtr)0x0) && (*(int *)((int)EVar19 + 0x28) == 0x104)) && (*(int *)((int)EVar19 + 0x30) == 2)) { local_d4[0] = (EntityPtr)Vector::Distance((Vector *)((int)this + 0x33c),&local_cc); fVar24 = 250.0; fVar21 = Math::clamp(0.0,250.0,(float)local_d4[0]); local_b4 = (EntityPtr)(2.0 - (1.0 - fVar21 / fVar24)); } local_d4[0] = (EntityPtr)(local_f0.x * local_120.x + local_f0.y * local_120.y); pVVar16 = Vector::__mul(&local_120,(Vector *)&local_1a0._h,(float *)local_d4); pVVar16 = Vector::__mul(pVVar16,(Vector *)&local_190._h,(float *)&local_b4); Vector::__sub(&local_f0,&local_140,pVVar16); local_b4 = (EntityPtr)Vector::GetAngleDegrees(&local_140); if (EVar12 == (EntityPtr)0x0) { bVar7 = Vector::operator_ne(&local_120,&g_vectorZero); if (bVar7 != 0) { EVar12 = (EntityPtr) ShootAngle(*(int *)((int)this + 0x2c),&local_cc,(float)local_b4, *(int *)((int)this + 0x458),(Vector *)((int)this + 0x34c), (Entity *)*(EntityPtr *)((int)this + 0x3bc),1); local_c0.y = (float)EVar12; if (EVar12 != (EntityPtr)0x0) { EntityPtr::SetReference((EntityPtr *)((int)this + 0x4e8),(Entity *)EVar12); *(undefined1 *)((int)EVar12 + 0x4e4) = 1; *(undefined1 *)((int)EVar12 + 0x518) = 1; copy_from_parent(); FUN_0096d120(); if (*(byte *)((int)this + 0x515) == 0) { EVar19 = (EntityPtr)this; } else { EVar19 = *(EntityPtr *)((int)this + 0x3bc); } Entity::SetParent((Entity *)EVar12,(Entity *)EVar19); *(undefined4 *)((int)this + 0x560) = 0; goto LAB_00975f41; } } } else { LAB_00975f41: copy_from_parent(); pBVar15 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b80,(BitSet128 *)&local_160); pBVar15 = BitSet128::operator_and(&local_170,(BitSet128 *)((int)EVar12 + 0x428),pBVar15) ; fVar21 = local_c0.y; EVar19 = *(EntityPtr *)((int)&pBVar15->_l + 4); EVar14 = *(EntityPtr *)&pBVar15->_h; EVar22 = *(EntityPtr *)((int)&pBVar15->_h + 4); *(EntityPtr *)((int)EVar12 + 0x428) = *(EntityPtr *)&pBVar15->_l; *(EntityPtr *)((int)EVar12 + 0x42c) = EVar19; *(EntityPtr *)((int)EVar12 + 0x430) = EVar14; *(EntityPtr *)((int)EVar12 + 0x434) = EVar22; *(float *)((int)local_c0.y + 0x33c) = local_cc.x; *(float *)((int)local_c0.y + 0x340) = local_cc.y; Entity_NPC::SetAimAngle((Entity_NPC *)local_c0.y,(float)local_b4); if (*(float *)((int)this + 0x4d0) <= 0.0) { EVar19 = (EntityPtr)0x0; } else { local_d4[0] = (EntityPtr)(*(float *)((int)this + 0x4d0) - local_130.y); local_c0.y = 10.0; pEVar13 = local_d4; if ((float)local_d4[0] <= 10.0) { pEVar13 = (EntityPtr *)&local_c0.y; } EVar19 = *pEVar13; } *(EntityPtr *)((int)fVar21 + 0x4d0) = EVar19; if (*(char *)((int)this + 0x515) != '\0') { *(undefined4 *)((int)fVar21 + 0x540) = 2; *(undefined1 *)((int)fVar21 + 0x171) = 0; } if (*(char *)((int)fVar21 + 0x45c) != '\0') { (**(code **)(*(int *)fVar21 + 0xc))(); } } } } if (*(char *)((int)this + 0x516) == '\0') { local_fc = (float)((uint)local_fc & 0xff); if (0 < *(int *)((int)this + 0x560)) { local_fc = 1.4013e-45; } local_114.y = (float)CONCAT31(local_114.y._1_3_,SUB41(local_fc,0)); } else { *(undefined4 *)((int)this + 0x560) = 0; } update_sample_points(this); iVar9 = *(int *)((int)this + 0x3c0); iVar11 = 0; if (iVar9 != 0) { local_f0.y = *(float *)(iVar9 + 0x340); room = g_game->_room; local_f0.x = *(float *)(iVar9 + 0x33c); pVVar16 = Vector::__add(&local_f0,(Vector *)&local_1a0._h,(Vector *)(iVar9 + 0x34c)); local_f0.x = pVVar16->x; local_f0.y = pVVar16->y; iVar11 = Room::GetGridCollisionAtPos(room,*pVVar16); } iVar9 = *(int *)((int)this + 0x2c); if ((((((iVar9 == 1) || (iVar9 == 6)) || (iVar9 == 9)) || (((iVar9 == 0xb || (iVar9 == 0xc)) || ((iVar9 == 0xe || (iVar9 == 0xf)))))) && ((0.5 < *(float *)((int)this + 0xe4) && (*(int *)((int)this + 0x34) == 1)))) && (((*(float *)((int)this + 0x4d0) == 0.0 || ((iVar11 != 0 && (iVar11 != 1)))) && ((*(char *)((int)this + 0x175) == '\0' && (cVar8 = _has_flag_0x110(), cVar8 == '\0')))))) { iVar9 = *(int *)((int)this + 0x480); uVar17 = *(int *)((int)this + 0x484) - iVar9 >> 3; if (1 < uVar17) { pVVar16 = Vector::__sub((Vector *)(iVar9 + (uVar17 - 2) * 8),&local_140, (Vector *)(iVar9 + -8 + uVar17 * 8)); local_d4[0] = (EntityPtr)Vector::GetAngleDegrees(pVVar16); uVar17 = Random(); local_d4[0] = (EntityPtr) normalize_angle_degrees (((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 180.0 + (float)local_d4[0]) - 90.0); local_c0.y = (float)Random(); pVVar16 = Vector::FromAngle(&local_140,(float)local_d4[0]); uVar17 = Random(); local_d4[0] = (EntityPtr) ((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 10.0 + 1.0); local_b4 = (EntityPtr)Vector::__mul(pVVar16,(Vector *)&local_190._h,(float *)local_d4); iVar9 = *(int *)((int)this + 0x484); iVar11 = *(int *)((int)this + 0x480); pVVar16 = MusicManager::RandomVector(&local_178); uVar17 = Random(); local_d4[0] = (EntityPtr) ((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 20.0); pVVar16 = Vector::__mul(pVVar16,&local_f0,(float *)local_d4); pVVar16 = Vector::__add((Vector *)(iVar11 + (iVar9 - iVar11 >> 3) * 8 + -8),&local_cc, pVVar16); iVar9 = 0; uVar30._0_1_ = 0; uVar30._1_1_ = 0; uVar30._2_2_ = 0; fVar29 = 9.80909e-44; fVar24 = 1.4013e-42; fVar21 = 1.3902761e-38; EVar19 = local_b4; EVar12 = (EntityPtr)local_c0.y; EVar14 = (EntityPtr) Game::Spawn(g_game,1000,0x46,pVVar16,(Vector *)local_b4,(Entity *)0x0,0, (uint)local_c0.y); this = (Entity_Laser *)local_150.y; local_d4[0] = EVar14; if (*(EntityPtr *)((int)local_150.y + 0x3c0) != (EntityPtr)0x0) { ANM2::ANM2((ANM2 *)((int)register0x00000010 + -0x3b8), (ANM2 *)((int)*(EntityPtr *)((int)local_150.y + 0x3c0) + 0x48)); other._championColor._colorize[0] = in_stack_fffffd2c; other._filename._buf[0] = in_stack_fffffc48[0]; other._filename._buf[1] = in_stack_fffffc48[1]; other._filename._buf[2] = in_stack_fffffc48[2]; other._filename._buf[3] = in_stack_fffffc48[3]; other._filename._buf[4] = in_stack_fffffc48[4]; other._filename._buf[5] = in_stack_fffffc48[5]; other._filename._buf[6] = in_stack_fffffc48[6]; other._filename._buf[7] = in_stack_fffffc48[7]; other._filename._buf[8] = in_stack_fffffc48[8]; other._filename._buf[9] = in_stack_fffffc48[9]; other._filename._buf[10] = in_stack_fffffc48[10]; other._filename._buf[0xb] = in_stack_fffffc48[0xb]; other._filename._buf[0xc] = in_stack_fffffc48[0xc]; other._filename._buf[0xd] = in_stack_fffffc48[0xd]; other._filename._buf[0xe] = in_stack_fffffc48[0xe]; other._filename._buf[0xf] = in_stack_fffffc48[0xf]; other._filename._size = in_stack_fffffc48._16_4_; other._filename._capacity = in_stack_fffffc48._20_4_; other._animDefaultName._buf[0] = in_stack_fffffc48[0x18]; other._animDefaultName._buf[1] = in_stack_fffffc48[0x19]; other._animDefaultName._buf[2] = in_stack_fffffc48[0x1a]; other._animDefaultName._buf[3] = in_stack_fffffc48[0x1b]; other._animDefaultName._buf[4] = in_stack_fffffc48[0x1c]; other._animDefaultName._buf[5] = in_stack_fffffc48[0x1d]; other._animDefaultName._buf[6] = in_stack_fffffc48[0x1e]; other._animDefaultName._buf[7] = in_stack_fffffc48[0x1f]; other._animDefaultName._buf[8] = in_stack_fffffc48[0x20]; other._animDefaultName._buf[9] = in_stack_fffffc48[0x21]; other._animDefaultName._buf[10] = in_stack_fffffc48[0x22]; other._animDefaultName._buf[0xb] = in_stack_fffffc48[0x23]; other._animDefaultName._buf[0xc] = in_stack_fffffc48[0x24]; other._animDefaultName._buf[0xd] = in_stack_fffffc48[0x25]; other._animDefaultName._buf[0xe] = in_stack_fffffc48[0x26]; other._animDefaultName._buf[0xf] = in_stack_fffffc48[0x27]; other._animDefaultName._size = in_stack_fffffc48._40_4_; other._animDefaultName._capacity = in_stack_fffffc48._44_4_; other._animState._animation = (void *)in_stack_fffffc48._48_4_; other._animState._animData = (void *)in_stack_fffffc48._52_4_; other._animState._layerFrames = (void *)in_stack_fffffc48._56_4_; other._animState._nullLayerFrames = (void *)in_stack_fffffc48._60_4_; other._animState._animFrame = (float)in_stack_fffffc48._64_4_; other._animState._isPlaying = in_stack_fffffc48[0x44]; other._animState._21_3_ = in_stack_fffffc48._69_3_; other._animState._currentlyTriggeredEvents = in_stack_fffffc48._72_4_; other._animState._previouslyTriggeredEvents = in_stack_fffffc48._76_4_; other._overlayAnimState._animation = (void *)in_stack_fffffc48._80_4_; other._overlayAnimState._animData = (void *)in_stack_fffffc48._84_4_; other._overlayAnimState._layerFrames = (void *)in_stack_fffffc48._88_4_; other._overlayAnimState._nullLayerFrames = (void *)in_stack_fffffc48._92_4_; other._overlayAnimState._animFrame = (float)in_stack_fffffc48._96_4_; other._overlayAnimState._isPlaying = in_stack_fffffc48[100]; other._overlayAnimState._21_3_ = in_stack_fffffc48._101_3_; other._overlayAnimState._currentlyTriggeredEvents = in_stack_fffffc48._104_4_; other._overlayAnimState._previouslyTriggeredEvents = in_stack_fffffc48._108_4_; other._overlayRenderFirst = in_stack_fffffc48[0x70]; other._113_3_ = in_stack_fffffc48._113_3_; other._animData = (void *)in_stack_fffffc48._116_4_; other._animCount = in_stack_fffffc48._120_4_; other._layerState = (void *)in_stack_fffffc48._124_4_; other._layerCount = in_stack_fffffc48._128_4_; other._nullLayerNames = (void *)in_stack_fffffc48._132_4_; other._numNullLayers = in_stack_fffffc48._136_4_; other._eventNames = (void *)in_stack_fffffc48._140_4_; other._numEvents = in_stack_fffffc48._144_4_; other._offset.x = (float)in_stack_fffffc48._148_4_; other._offset.y = (float)in_stack_fffffc48._152_4_; other._scale.x = (float)in_stack_fffffc48._156_4_; other._scale.y = (float)in_stack_fffffc48._160_4_; other._rotation = (float)in_stack_fffffc48._164_4_; other._color._tint[0] = (float)in_stack_fffffc48._168_4_; other._color._tint[1] = (float)in_stack_fffffc48._172_4_; other._color._tint[2] = (float)in_stack_fffffc48._176_4_; other._color._tint[3] = (float)in_stack_fffffc48._180_4_; other._color._colorize[0] = (float)in_stack_fffffc48._184_4_; other._color._colorize[1] = (float)in_stack_fffffc48._188_4_; other._color._colorize[2] = (float)in_stack_fffffc48._192_4_; other._color._colorize[3] = (float)in_stack_fffffc48._196_4_; other._color._offset[0] = (float)in_stack_fffffc48._200_4_; other._color._offset[1] = (float)in_stack_fffffc48._204_4_; other._color._offset[2] = (float)in_stack_fffffc48._208_4_; other._championColor._tint[0] = (float)in_stack_fffffc48._212_4_; other._championColor._tint[1] = (float)in_stack_fffffc48._216_4_; other._championColor._tint[2] = (float)in_stack_fffffc48._220_4_; other._championColor._tint[3] = (float)in_stack_fffffc48._224_4_; other._championColor._colorize[1] = in_stack_fffffd30; other._championColor._colorize[2] = in_stack_fffffd34; other._championColor._colorize[3] = in_stack_fffffd38; other._championColor._offset[0] = fVar21; other._championColor._offset[1] = fVar24; other._championColor._offset[2] = fVar29; other._256_4_ = pVVar16; other._playbackSpeed = (float)EVar19; other._264_1_ = (char)uVar30; other._loaded = SUB41(uVar30,1); other._266_2_ = SUB42(uVar30,2); other._shadowLayerIndex = iVar9; other._bitflags = (int)EVar12; ANM2::operator_assign((ANM2 *)((int)EVar14 + 0x48),other); iVar9 = Isaac::Random(3); ANM2::SetFrame((ANM2 *)((int)EVar14 + 0x48),(std_string *)"Droplets",iVar9); } *(float *)((int)EVar14 + 0x34c) = ((Vector *)((int)this + 0x34c))->x; *(float *)((int)EVar14 + 0x350) = *(float *)((int)this + 0x350); (**(code **)(*(int *)EVar14 + 0x3c))(); (**(code **)(*(int *)EVar14 + 0xc))(); } } } if (*(byte *)((int)this + 0x45d) != 0) { pBVar15 = BitSet128::operator_and (&local_298,(BitSet128 *)((int)this + 0x428),(BitSet128 *)&DAT_00c34ac0); bVar7 = BitSet128::IsNonZero(pBVar15); if ((bVar7 != 0) && (bVar7 = Entity::IsFrame((Entity *)this,5,*(int *)((int)this + 0x20)), bVar7 != 0)) { local_cc.x = *(float *)((int)*(void **)((int)this + 0x484) + -8); local_cc.y = *(float *)((int)*(void **)((int)this + 0x484) + -4); pVVar16 = Room::GetClampedPosition(g_game->_room,&local_140,&local_cc,15.0); local_cc.x = pVVar16->x; local_cc.y = pVVar16->y; uVar17 = Random(); Game::Spawn(g_game,1000,0x35,&local_cc,&g_vectorZero, (Entity *)*(EntityPtr *)((int)this + 0x3c8),0,uVar17); piVar18 = (int *)__RTDynamicCast(); local_d4[0] = (EntityPtr)0x3ecccccd; pVVar16 = Vector::__mul(&g_vectorOne,&local_140,(float *)local_d4); piVar18[0x39] = (int)pVVar16->x; piVar18[0x3a] = (int)pVVar16->y; (**(code **)(*piVar18 + 0xc))(); } } } iVar9 = *(int *)((int)this + 0x3bc); if ((((iVar9 != 0) && (*(char *)(iVar9 + 0x173) != '\0')) && (*(int *)(iVar9 + 0x28) != 1000)) && ((*(undefined1 *)((int)this + 0x173) = 1, *(int *)(iVar9 + 0x28) == *(int *)((int)this + 0x28) && (*(char *)(iVar9 + 0x172) == '\0')))) { (**(code **)(*(int *)this + 0x28))(); } if ((*(char *)((int)this + 0x173) != '\0') || (*(char *)((int)this + 0x45e) != '\0')) { iVar9 = *(int *)((int)this + 0x2c); if (iVar9 == 2) { bVar7 = AnimationState::IsLoopingAnimation((AnimationState *)((int)this + 0x78)); if (bVar7 != 0) { ANM2::GetAnimation(this_02,(std_string *)(local_58 + 0x14)); local_14 = 1; SimpleString::operator=((SimpleString *)(local_58 + 0x14),"Fade"); Sprite::Play(); if (*(int *)((int)this + 0x3c0) != 0) { ANM2::Play((ANM2 *)(*(int *)((int)this + 0x3c0) + 0x48),&DAT_00b1c00c,0); } if ((*(uint *)((int)this + 0x3ec) & 0x1000) != 0) { Sprite::SetFrame_1((Sprite *)((int)this + 0x48),1); } local_14 = 0xffffffff; std::string::_Tidy_deallocate(local_58 + 0x14); } bVar7 = ANM2::IsFinishedImpl((ANM2 *)((int)this + 0x48),&s_empty); if (bVar7 == 0) goto LAB_00976e53; } else if ((iVar9 != 10) && (iVar9 != 4)) { *(int *)((int)this + 0x458) = *(int *)((int)this + 0x458) + -1; *(undefined4 *)((int)this + 0xe8) = *(undefined4 *)((int)this + 0xe8); *(float *)((int)this + 0xe4) = *(float *)((int)this + 0xe4) * 0.895; if (-0x13 < *(int *)((int)this + 0x458)) goto LAB_00976e53; } (**(code **)(*(int *)this + 0x28))(); } LAB_00976e53: if (isSamplesRebuilt != '\0') { HomingLaser::remove_collinear_samples(); } if (local_e1 != 0) { update_endpoint_and_hits(this); } if ((*(char *)((int)this + 0x45d) == '\0') || (*(char *)((int)this + 0x172) == '\0')) goto LAB_00977beb; if (isSamplesRebuilt != '\0') { local_d4[0] = *(EntityPtr *)((int)this + 0x544); cVar8 = FUN_007dd460(); if (((cVar8 == '\0') && (*(char *)((int)this + 0x516) == '\0')) && ((SUB41(local_fc,0) != '\0' || ((*(int *)((int)this + 0x3bc) != 0 && (*(int *)(*(int *)((int)this + 0x3bc) + 0x28) == 2)))) )) { local_c1 = false; } else { local_c1 = true; } if (local_e1 != 0) { if (local_c1 != false) { impact_tear_flag_effects(this,(Vector *)((int)this + 0x548),(Vector *)((int)this + 0x550)); } cVar8 = FUN_007dd460(); if (((cVar8 != '\0') || (*(char *)((int)this + 0x516) != '\0')) || (*(int *)((int)this + 0x560) == 0)) { pBVar15 = BitSet128::operator_or (&local_248,(BitSet128 *)&DAT_00c345b0,(BitSet128 *)&DAT_00c345c0); pBVar15 = BitSet128::operator_and ((BitSet128 *)&fStack_40,(BitSet128 *)((int)this + 0x438),pBVar15); bVar7 = BitSet128::IsNonZero(pBVar15); if (((bVar7 != 0) && (isRedirected == '\0')) && (*(char *)((int)this + 0x516) == '\0')) { iVar11 = *(int *)((int)this + 0x480); iVar20 = (int)((AnimationState *)((int)local_150.y + 0x484))->_animation - iVar11 >> 3; iVar9 = iVar20 + -1; local_140.x = *(float *)(iVar11 + iVar9 * 8); pVVar16 = (Vector *)(iVar11 + iVar9 * 8); local_140.y = pVVar16->y; pVVar16 = Vector::__sub(pVVar16,(Vector *)&local_170._h, (Vector *)(iVar11 + -0x10 + iVar20 * 8)); Vector::Normalized(pVVar16,&local_f0); fVar21 = local_150.y; local_d4[0] = (EntityPtr)0x41a00000; local_c0.y = *(float *)((int)local_150.y + 0x4e0); Vector::operator_mul_assign(&local_f0,(float *)local_d4); bVar7 = is_thick_variant((Entity_Laser *)fVar21); if (bVar7 != 0) { uVar17 = Random(); local_c0.y = ((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 1.1 + 0.9) * local_c0.y; uVar17 = Random(); local_d4[0] = (EntityPtr) ((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.8); Vector::operator_mul_assign(&local_f0,(float *)local_d4); } b_01 = (BitSet128 *)&DAT_00c345d0; b_00 = (BitSet128 *)&DAT_00c345e0; b = (BitSet128 *)&DAT_00c348f0; pBVar28 = &g_tearFlagLudovico; pBVar15 = BitSet128::operator_or (&local_170,(BitSet128 *)&DAT_00c34880,(BitSet128 *)&DAT_00c34850); pBVar15 = BitSet128::operator_or(&local_1b0,pBVar15,pBVar28); pBVar15 = BitSet128::operator_or(&local_190,pBVar15,b); pBVar15 = BitSet128::operator_or((BitSet128 *)local_180,pBVar15,b_00); pBVar15 = BitSet128::operator_or((BitSet128 *)local_128,pBVar15,b_01); pBVar15 = BitSet128::__bnot(pBVar15,(BitSet128 *)local_e0); pBVar28 = BitSet128::operator_or ((BitSet128 *)local_138,(BitSet128 *)((int)fVar21 + 0x438), (BitSet128 *)&DAT_00c34b50); BitSet128::operator_and((BitSet128 *)&local_160,pBVar28,pBVar15); pBVar15 = BitSet128::operator_and (&local_170,(BitSet128 *)((int)fVar21 + 0x438), (BitSet128 *)&DAT_00c345c0); local_e1 = BitSet128::IsNonZero(pBVar15); local_130.y = (float)Random(); local_114.y = *(float *)((int)fVar21 + 0x3c8); local_d4[0] = (EntityPtr)0x3f333333; pVVar16 = Vector::operator_mul((Vector *)&local_170._h,(float *)local_d4,&local_f0); pVVar16 = Vector::__sub(&local_140,(Vector *)&local_1b0._h,pVVar16); randomOffset = MusicManager::RandomVector((Vector *)&local_190._h); uVar17 = Random(); local_d4[0] = (EntityPtr) ((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10); randomOffset = Vector::__mul(randomOffset,&local_178,(float *)local_d4); local_b4 = (EntityPtr)0x0; local_d4[0] = (EntityPtr)(*(float *)((int)local_150.y + 0x370) - 6.0); pEVar13 = local_d4; if ((float)local_d4[0] <= 0.0) { pEVar13 = &local_b4; } randomOffset = Vector::__mul(randomOffset,&local_120,(float *)pEVar13); pVVar16 = Vector::__add(pVVar16,&local_10c,randomOffset); uVar17 = 0x24; if (local_e1 == 0) { uVar17 = 0x21; } EVar19 = (EntityPtr) Game::Spawn(g_game,2,uVar17,pVVar16,&local_f0,(Entity *)local_114.y,0, (uint)local_130.y); flags._l._4_4_ = local_160._data; flags._l._0_4_ = local_160._0_4_; flags._h._0_4_ = local_160._capacity; flags._h._4_4_ = local_160._size; local_b4 = EVar19; Entity_Tear::SetTearFlags((Entity_Tear *)EVar19,flags); this = (Entity_Laser *)local_150.y; pcVar2 = *(code **)(*(int *)EVar19 + 0x3c); get_tear_spawn_color((Entity_Laser *)local_150.y); (*pcVar2)(); EVar19 = local_b4; (**(code **)(*(int *)local_b4 + 0x40))(); Entity_Tear::SetScale((Entity_Tear *)EVar19,local_c0.y); *(uint *)((int)EVar19 + 0x168) = *(uint *)((int)EVar19 + 0x168) | 0x80000; *(undefined4 *)((int)EVar19 + 0x16c) = *(undefined4 *)((int)EVar19 + 0x16c); local_d4[0] = (EntityPtr)FUN_0096ce70(); EVar12 = local_b4; EVar19 = *(EntityPtr *)local_d4[0]; if (EVar19 != *(EntityPtr *)((int)local_d4[0] + 4)) { do { sorted_vector_insert_unique((EntityPtr *)((int)EVar12 + 0x444),*(uint *)EVar19); EVar19 = (EntityPtr)((int)EVar19 + 4); } while (EVar19 != *(EntityPtr *)((int)local_d4[0] + 4)); this = (Entity_Laser *)local_150.y; } } } } if (local_c1 == false) { LAB_0097777a: piVar18 = (int *)((int)this + 0x530); local_c0.y = 2.8026e-45; do { if ((int *)*piVar18 != (int *)0x0) { (**(code **)(*(int *)*piVar18 + 0x28))(); } piVar18 = piVar18 + 1; local_c0.y = (float)((int)local_c0.y + -1); } while ((EntityPtr)local_c0.y != (EntityPtr)0x0); } else { pBVar15 = BitSet128::operator_and ((BitSet128 *)&local_160,(BitSet128 *)((int)this + 0x438), (BitSet128 *)&DAT_00c34850); bVar7 = BitSet128::IsNonZero(pBVar15); if (bVar7 == 0) goto LAB_0097777a; local_120.y = 0.0; local_120.x = 0.0; local_f0.y = 0.0; local_f0.x = 0.0; cVar8 = FUN_007dd460(); if (cVar8 == '\0') { *(undefined4 *)((int)this + 0x558) = 0x7f800000; get_segment_start_dir(this); local_b4 = (EntityPtr)Vector::GetAngleDegrees(&local_f0); LAB_0097754c: EVar19 = local_b4; LAB_00977554: *(EntityPtr *)((int)this + 0x55c) = EVar19; pVVar16 = Vector::FromAngle((Vector *)&local_170._h,(float)EVar19); local_d4[0] = (EntityPtr)0x3e800000; pVVar16 = Vector::__mul(pVVar16,(Vector *)&local_1b0._h,(float *)local_d4); pVVar16 = Vector::__mul(pVVar16,(Vector *)&local_190._h,(float *)((int)this + 0x370)); Vector::operator__(&local_120,pVVar16); local_c0.y = 0.0; do { pEVar13 = (EntityPtr *)((int)this + (int)((int)local_c0.y + 0x14c) * 4); if (*(int *)((int)this + ((int)local_c0.y + 0x14c) * 4) == 0) { spawnedLaser = ShootAngle(*(int *)((int)this + 0x2c),&local_120,0.0, *(int *)((int)this + 0x458),(Vector *)((int)this + 0x34c), *(Entity **)((int)this + 0x3bc),1); EntityPtr::Set(pEVar13,(Entity *)spawnedLaser); if (*pEVar13 != (EntityPtr)0x0) { *(undefined1 *)((int)*pEVar13 + 0x518) = 1; *(undefined1 *)((int)*pEVar13 + 0x4e4) = 1; copy_from_parent(); FUN_0096d120(); if (*(char *)((int)this + 0x515) == '\0') { EVar19 = (EntityPtr)this; } else { EVar19 = *(EntityPtr *)((int)this + 0x3bc); } Entity::SetParent((Entity *)*pEVar13,(Entity *)EVar19); EVar19 = *pEVar13; *(float *)((int)EVar19 + 0x4e0) = *(float *)((int)this + 0x4e0) * 0.8; ResetSpriteScale((Entity_Laser *)EVar19); if (*pEVar13 != (EntityPtr)0x0) goto LAB_00977677; } EVar12 = (EntityPtr)local_c0.y; } else { LAB_00977677: copy_from_parent(); pBVar15 = BitSet128::operator_or ((BitSet128 *)local_148,(BitSet128 *)&DAT_00c348d0, (BitSet128 *)&DAT_00c34b80); pBVar15 = BitSet128::__bnot(pBVar15,(BitSet128 *)local_180); EVar19 = *pEVar13; pBVar15 = BitSet128::operator_and ((BitSet128 *)local_f8,(BitSet128 *)((int)EVar19 + 0x428),pBVar15); EVar12 = (EntityPtr)local_c0.y; uVar30 = *(undefined4 *)((int)&pBVar15->_l + 4); qVar4 = pBVar15->_h; uVar3 = *(undefined4 *)((int)&pBVar15->_h + 4); *(int *)((int)EVar19 + 0x428) = (int)pBVar15->_l; *(undefined4 *)((int)EVar19 + 0x42c) = uVar30; *(int *)((int)EVar19 + 0x430) = (int)qVar4; *(undefined4 *)((int)EVar19 + 0x434) = uVar3; iVar9 = *(int *)((int)this + 0x530 + (int)local_c0.y * 4); *(float *)(iVar9 + 0x33c) = local_120.x; *(float *)(iVar9 + 0x340) = local_120.y; if ((EntityPtr)local_c0.y == (EntityPtr)0x0) { fVar21 = -90.0; } else { fVar21 = 90.0; } Entity_NPC::SetAimAngle (*(Entity_NPC **)((int)this + 0x530 + (int)local_c0.y * 4), fVar21 + (float)local_b4); if (*(char *)((int)this + 0x515) != '\0') { *(undefined4 *)(*(int *)((int)this + 0x530 + (int)EVar12 * 4) + 0x540) = 2; *(undefined1 *)(*(int *)((int)this + 0x530 + (int)EVar12 * 4) + 0x171) = 0; } piVar18 = *(int **)((int)this + 0x530 + (int)EVar12 * 4); if ((char)piVar18[0x117] != '\0') { (**(code **)(*piVar18 + 0xc))(); } } local_c0.y = (float)((int)EVar12 + 1); } while ((uint)local_c0.y < 2); goto LAB_009777b9; } cVar8 = FUN_007dd460(); if (cVar8 == '\0') { fVar21 = *(float *)((int)this + 0x544); } else { fVar21 = Math::lerp(*(float *)((int)this + 0x558),*(float *)((int)this + 0x544),0.3,0); } local_c1 = cVar8 != '\0'; *(float *)((int)this + 0x558) = fVar21; if (0.0 < fVar21) { get_segment_start_dir(this); local_b4 = (EntityPtr)Vector::GetAngleDegrees(&local_f0); if (local_c1 == false) goto LAB_0097754c; fVar21 = angle_difference(*(float *)((int)this + 0x55c),(float)local_b4); EVar19 = (EntityPtr) approach_angle(*(float *)((int)this + 0x55c),(float)local_b4,fVar21 * 0.4); goto LAB_00977554; } piVar18 = (int *)((int)this + 0x530); local_c0.y = 2.8026e-45; do { if ((int *)*piVar18 != (int *)0x0) { (**(code **)(*(int *)*piVar18 + 0x28))(); } piVar18 = piVar18 + 1; local_c0.y = (float)((int)local_c0.y + -1); } while (local_c0.y != 0.0); local_c0.y = 0.0; } *(undefined4 *)((int)this + 0x558) = 0x7f800000; } LAB_009777b9: if ((1 < g_game->_frameCount - *(int *)((int)this + 0x328)) && (0 < *(int *)((int)this + 0x560))) { pvVar10 = ((std_vector *)((int)this + 0x480))->_begin; uVar17 = (int)((AnimationState *)((int)this + 0x484))->_animation - (int)pvVar10 >> 3; if (1 < uVar17) { local_104.x = *(float *)((int)pvVar10 + uVar17 * 8 + -8); local_104.y = *(float *)((int)pvVar10 + uVar17 * 8 + -4); pVVar16 = Vector::__sub((Vector *)((int)pvVar10 + uVar17 * 8 + -8),&local_140, (Vector *) ((int)((std_vector *)((int)this + 0x480))->_begin + uVar17 * 8 + -0x10 )); Vector::Normalized(pVVar16,&local_10c); local_d4[0] = (EntityPtr)0x42200000; pVVar16 = Vector::__mul(&local_10c,&local_140,(float *)local_d4); randomOffset = MusicManager::RandomVector(&local_178); uVar17 = Random(); local_d4[0] = (EntityPtr) ((float)((double)(int)uVar17 + __uint_to_double_fixup[-((int)uVar17 >> 0x1f)]) * 2.3283064e-10 * 39.0); randomOffset = Vector::operator_mul(&local_c0,(float *)local_d4,randomOffset); Vector::__add(pVVar16,&local_f0,randomOffset); this = (Entity_Laser *)local_150.y; pBVar15 = BitSet128::operator_and ((BitSet128 *)local_148,(BitSet128 *)((int)local_150.y + 0x428), &g_tearFlagHoming); bVar7 = BitSet128::IsNonZero(pBVar15); if (bVar7 != 0) { local_c0.y = 1e+08; local_130.y = (float)g_game->_room; local_114.x = g_vectorZero.x; local_114.y = g_vectorZero.y; local_b4 = (EntityPtr)0x0; if (*(EntityPtr *)((int)local_130.y + 0x1264) != (EntityPtr)0x0) { do { EVar19 = *(EntityPtr *) ((int)*(EntityPtr *)((int)local_130.y + 0x125c) + (int)local_b4 * 4); bVar7 = Entity::IsVulnerableEnemy((Entity *)EVar19,(Entity *)0x0); if (((bVar7 != 0) && (bVar7 = Entity::HasEntityFlags((Entity *)EVar19,0x20000010), bVar7 == 0)) && (EVar19 != *(EntityPtr *)((int)this + 0x3bc))) { local_140.x = ((Vector *)((int)EVar19 + 0x33c))->x; local_140.y = *(float *)((int)EVar19 + 0x340); Vector::__sub(&local_140,&local_150,&local_104); if ((0.0 < local_10c.y * local_150.y + local_150.x * local_10c.x) && (local_d4[0] = (EntityPtr)Vector::Length(&local_150), (float)local_d4[0] < local_c0.y)) { local_114.y = *(float *)((int)EVar19 + 0x340); local_114.x = ((Vector *)((int)EVar19 + 0x33c))->x; local_c0.y = (float)local_d4[0]; } } local_b4 = (EntityPtr)((int)local_b4 + 1); } while ((uint)local_b4 < (uint)*(EntityPtr *)((int)local_130.y + 0x1264)); } bVar7 = Vector::operator_ne(&local_114,&g_vectorZero); if (bVar7 != 0) { pVVar16 = Vector::__add(&local_f0,&local_140,other_01); pVVar16 = Vector::__sub(pVVar16,&local_178,&local_104); fVar21 = Vector::Length(&local_f0); pVVar16 = Vector::Resized(pVVar16,(Vector *)(local_e0 + 8),fVar21); local_f0.x = pVVar16->x; local_f0.y = pVVar16->y; } } bVar7 = 1; EVar19 = *(EntityPtr *)((int)this + 0x3bc); pVVar16 = (Vector *)((int)this + 0x34c); fVar24 = 4.2039e-45; fVar21 = Vector::GetAngleDegrees(&local_f0); spawnedLaser = ShootAngle(*(int *)((int)this + 0x2c),&local_104,fVar21,(int)fVar24,pVVar16, (Entity *)EVar19,bVar7); if (spawnedLaser != (Entity_Laser *)0x0) { spawnedLaser->_disableFollowParent = 1; copy_from_parent(); pBVar28 = (BitSet128 *)&DAT_00c34860; spawnedLaser->_disableInitSound = 1; pBVar15 = BitSet128::operator_or (&local_258,(BitSet128 *)&DAT_00c34b60,(BitSet128 *)&DAT_00c34600); pBVar15 = BitSet128::operator_or(&local_268,pBVar15,pBVar28); pBVar15 = BitSet128::__bnot(pBVar15,&local_278); pBVar15 = BitSet128::operator_and(&local_288,(BitSet128 *)((int)this + 0x438),pBVar15); qVar4 = pBVar15->_l; uVar30 = *(undefined4 *)((int)&pBVar15->_l + 4); qVar5 = pBVar15->_h; uVar3 = *(undefined4 *)((int)&pBVar15->_h + 4); spawnedLaser->_timeout = 3; *(int *)&(spawnedLaser->_tearFlags)._l = (int)qVar4; *(undefined4 *)((int)&(spawnedLaser->_tearFlags)._l + 4) = uVar30; *(int *)&(spawnedLaser->_tearFlags)._h = (int)qVar5; *(undefined4 *)((int)&(spawnedLaser->_tearFlags)._h + 4) = uVar3; Entity::SetParent((Entity *)spawnedLaser,(Entity *)*(EntityPtr *)((int)this + 0x3bc)); fVar21 = Vector::Length(&local_f0); spawnedLaser->_maxDistance = fVar21; spawnedLaser->_chainedLasers = *(int *)((int)this + 0x560) + -1; (**(code **)(*(int *)spawnedLaser + 0xc))(); SoundEffects::PlayWithFartOverride(0x86,(float)*(int *)((int)this + 0x560) * 0.15,2,0,1.0); } } *(int *)((int)this + 0x560) = 0; } LAB_00977beb: if (((0 < *(int *)((int)this + 0x458)) && (*(char *)((int)this + 0x175) == '\0')) && (iVar9 = *(int *)((int)this + 0x458) + -1, *(int *)((int)this + 0x458) = iVar9, iVar9 < 1)) { if ((((*(int *)((int)this + 0x2c) == 6) || (*(int *)((int)this + 0x2c) == 0xf)) && (*(char *)((int)this + 0x45e) == '\0')) && (*(char *)((int)this + 0x173) == '\0')) { SoundEffects::PlayWithFartOverride(0x118,1.0,2,0,1.0); } bVar7 = is_thick_variant(this); if (((bVar7 == 0) || (iVar9 = *(int *)((int)this + 0x2c), iVar9 == 0xd)) || (((iVar9 == 6 || (iVar9 == 0xf)) && (*(int *)((int)this + 0x34) != 1)))) { *(undefined1 *)((int)this + 0x173) = 1; } else { *(undefined1 *)((int)this + 0x45e) = 1; *(undefined4 *)((int)this + 0x458) = 0; } } *(undefined4 *)((int)this + 0x420) = *(undefined4 *)((int)this + 0x41c); ExceptionList = local_1c; return; } //@@ 00977cc0 Entity_Laser::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall Entity_Laser::Update(Entity_Laser *this) { uint *puVar1; qword *pqVar2; EntityPtr *pEVar3; undefined4 uVar4; undefined4 uVar5; qword qVar6; byte bVar7; BitSet128 *maskedFlags; BitSet128 *pBVar8; int iVar9; byte *curAnimChar; uint uVar10; EntityPtr tmpEntity; char *freePtr; std_string *defaultAnimChar; uint extraout_EDX; bool isLess; float scaleY; EntityPtr local_4c; EntityPtr local_48; std_string *local_44; undefined1 local_40 [24]; undefined1 local_28 [8]; float fStack_20; float fStack_1c; float fStack_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; EntityPtr chainLaser; Manager *manager; EntityPtr nextLaser; int *spriteFlags; local_8 = 0xffffffff; puStack_c = &LAB_00b0cb35; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; pBVar8 = &this->_tearFlags; maskedFlags = BitSet128::operator_and ((BitSet128 *)(local_28 + 4),pBVar8,(BitSet128 *)&DAT_00c34b40); if (((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && (iVar9 = this->_subtype, iVar9 != 1)) && (((iVar9 != 2 && (iVar9 != 3)) && (0 < this->_timeout)))) { maskedFlags = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,(BitSet128 *)(local_28 + 4)); local_44 = (std_string *)this->_scale; *(uint *)&pBVar8->_l = (uint)pBVar8->_l & (uint)maskedFlags->_l; puVar1 = (uint *)((int)&(this->_tearFlags)._l + 4); *puVar1 = *puVar1 & *(uint *)((int)&maskedFlags->_l + 4); pqVar2 = &(this->_tearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 & (uint)maskedFlags->_h; puVar1 = (uint *)((int)&(this->_tearFlags)._h + 4); *puVar1 = *puVar1 & *(uint *)((int)&maskedFlags->_h + 4); *(uint *)&(this->_heldTearFlags)._l = (uint)(this->_heldTearFlags)._l | DAT_00c34b40; puVar1 = (uint *)((int)&(this->_heldTearFlags)._l + 4); *puVar1 = *puVar1 | DAT_00c34b44; pqVar2 = &(this->_heldTearFlags)._h; *(uint *)pqVar2 = (uint)*pqVar2 | DAT_00c34b48; puVar1 = (uint *)((int)&(this->_heldTearFlags)._h + 4); *puVar1 = *puVar1 | DAT_00c34b4c; iVar9 = this->_variant; if ((iVar9 == 0xb) || (iVar9 == 0xe)) { local_44 = (std_string *)((float)local_44 + (float)local_44); } else if ((iVar9 == 6) || (iVar9 == 0xf)) { local_44 = (std_string *)((float)local_44 * 3.0); } else if (iVar9 == 0xd) { local_44 = (std_string *)((float)local_44 * 5.0); } bVar7 = is_thick_variant(this); uVar10 = 0x47; if (bVar7 == 0) { uVar10 = 0x7e; } local_4c = (EntityPtr) Game::Spawn(g_game,1000,uVar10,&this->_pos,&g_vectorZero, (Entity *)this->_spawnerEntity,0,this->_initSeed); tmpEntity = this->_tearWaitEffect; pEVar3 = &this->_tearWaitEffect; if (tmpEntity != local_4c) { if (tmpEntity != (EntityPtr)0x0) { local_48 = (EntityPtr)pEVar3; std::multiset::erase(&local_48); } *pEVar3 = local_4c; tmpEntity = (EntityPtr)0x0; if (local_4c != (EntityPtr)0x0) { std::multiset::insert(pEVar3); tmpEntity = this->_tearWaitEffect; } } local_48 = (EntityPtr)((int)tmpEntity + 0x3c0); if (*(EntityPtr *)local_48 != (EntityPtr)0x0) { local_4c = local_48; std::multiset::erase(&local_4c); } *(Entity_Laser **)local_48 = this; std::multiset::insert(local_48); tmpEntity = *pEVar3; *(float *)((int)tmpEntity + 0x34c) = (this->_posOffset).x; *(float *)((int)tmpEntity + 0x350) = (this->_posOffset).y; tmpEntity = *pEVar3; scaleY = (float)local_44 * g_vectorOne.y; *(float *)((int)tmpEntity + 0xe4) = (float)local_44 * g_vectorOne.x; *(float *)((int)tmpEntity + 0xe8) = scaleY; (**(code **)(*(int *)*pEVar3 + 0x3c))(&this->_color,0xffffffff,0xff,0,1); (**(code **)(*(int *)*pEVar3 + 0x40))(this->_collisionDamage); tmpEntity = *pEVar3; uVar4 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); qVar6 = (this->_tearFlags)._h; uVar5 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); *(int *)((int)tmpEntity + 0x420) = (int)(this->_tearFlags)._l; *(undefined4 *)((int)tmpEntity + 0x424) = uVar4; *(int *)((int)tmpEntity + 0x428) = (int)qVar6; *(undefined4 *)((int)tmpEntity + 0x42c) = uVar5; if ((this->_parent != (EntityPtr)0x0) && (*(int *)((int)this->_parent + 0x28) == 7)) { *(undefined1 *)((int)*pEVar3 + 0x171) = 0; } (**(code **)(*(int *)*pEVar3 + 0xc))(); local_48 = *pEVar3; pEVar3 = &this->_parent; if (*pEVar3 != (EntityPtr)0x0) { local_4c = (EntityPtr)pEVar3; std::multiset::erase(&local_4c); } *pEVar3 = local_48; if (local_48 != (EntityPtr)0x0) { std::multiset::insert(pEVar3); } this->_waitFrames = 2; this->_visible = 0; this->_disableFollowParent = 1; } if (((this->_tearWaitEffect != (EntityPtr)0x0) && (*(int *)((int)this->_tearWaitEffect + 0x450) == 0)) && (this->_waitFrames < 2)) { this->_waitFrames = 2; } nextLaser = this->_parentLaser; tmpEntity = (EntityPtr)this; while (chainLaser = nextLaser, chainLaser != (EntityPtr)0x0) { tmpEntity = chainLaser; nextLaser = *(EntityPtr *)((int)chainLaser + 0x52c); } pBVar8 = BitSet128::operator_and ((BitSet128 *)(local_28 + 4),(BitSet128 *)((int)tmpEntity + 0x428), (BitSet128 *)&DAT_00c347f0); if (((int)pBVar8->_l == 0 && *(int *)((int)&pBVar8->_l + 4) == 0) && ((int)pBVar8->_h == 0 && *(int *)((int)&pBVar8->_h + 4) == 0)) { pBVar8 = BitSet128::operator_and ((BitSet128 *)(local_28 + 4),(BitSet128 *)((int)tmpEntity + 0x428), (BitSet128 *)&DAT_00c348d0); if (((int)pBVar8->_l != 0 || *(int *)((int)&pBVar8->_l + 4) != 0) || ((int)pBVar8->_h != 0 || *(int *)((int)&pBVar8->_h + 4) != 0)) { Color::Color((Color *)local_40); uVar10 = extraout_EDX & 0x80000007; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xfffffff8) + 1; } switch(uVar10) { case 0: local_40._16_4_ = 2.5; local_40._20_4_ = (char *)0x0; local_28._0_4_ = 2.5; local_28._4_4_ = 1.0; break; case 1: case 7: local_40._16_4_ = 2.5; local_40._20_4_ = (char *)0x3f200000; local_28._0_4_ = 2.5; local_28._4_4_ = 1.0; break; case 2: case 6: local_40._16_4_ = 2.5; local_40._20_4_ = (char *)0x3fa00000; local_28._0_4_ = 2.5; local_28._4_4_ = 1.0; break; case 3: case 5: local_40._16_4_ = 2.5; local_40._20_4_ = (char *)0x3ff00000; local_28._0_4_ = 2.5; local_28._4_4_ = 1.0; break; case 4: local_40._16_4_ = 2.5; local_40._20_4_ = (char *)0x40200000; local_28._0_4_ = 2.5; local_28._4_4_ = 1.0; } goto LAB_00978138; } } else { hsv_to_rgb((KColor *)local_28,((float)(g_game->_frameCount % 0x1e) * 360.0) / 30.0,0.9,1.0,1.0); local_40._16_4_ = (float)local_28._0_4_ * 4.0; local_40._20_4_ = (float)local_28._4_4_ * 4.0; local_28._0_4_ = fStack_20 * 4.0; local_40._0_4_ = 1.0; local_40._4_4_ = 1.0; local_40._8_4_ = 1.0; local_40._12_4_ = 1.0; local_28._4_4_ = 1.0; fStack_20 = 0.0; fStack_1c = 0.0; fStack_18 = 0.0; LAB_00978138: (**(code **)(*(int *)this + 0x3c))(local_40,0xffffffff,0xff,0,1); if (this->_child != (EntityPtr)0x0) { (**(code **)(*(int *)this->_child + 0x3c))(local_40,0xffffffff,0xff,0,1); } if (this->_tearWaitEffect != (EntityPtr)0x0) { (**(code **)(*(int *)this->_tearWaitEffect + 0x3c))(local_40,0xffffffff,0xff,0,1); } } if (0 < this->_waitFrames) { iVar9 = this->_waitFrames + -1; this->_waitFrames = iVar9; if (0 < iVar9) { ExceptionList = local_10; return; } this->_visible = 1; } if (this->_isFirstUpdate == 0) { iVar9 = this->_subtype; if (((iVar9 == 1) || (iVar9 == 2)) || (iVar9 == 3)) { UpdateHits(this); } else { update_laser(this); } if (((this->_variant == 1) && (this->_spawnerEntity != (EntityPtr)0x0)) && (*(int *)((int)this->_spawnerEntity + 0x28) == 0x193)) { if (this->_dead == 0) { bVar7 = SFXManager::IsPlaying(&g_manager->_sfxManager,0x3cb); manager = g_manager; if (bVar7 == 0) { local_44 = (std_string *)0x3cb; seed_fart_sound_override((int *)&local_44); SoundEffects::Play(&manager->_sfxManager,(int)local_44,1.0,2,1,1.0,0.0); } } else { SFXManager::Stop(&g_manager->_sfxManager,0x3cb); } } Entity::Update((Entity *)this); FUN_008616c0(this); ExceptionList = local_10; return; } iVar9 = this->_spawnerType; if (iVar9 == 0x27) { if (this->_parent == (EntityPtr)0x0) goto LAB_009784c5; if (*(int *)((int)this->_parent + 0x34) != 0x109) { update_first_frame(this); this->_isFirstUpdate = 0; ExceptionList = local_10; return; } } else { if (iVar9 != 0x44) { if ((iVar9 != 0x3b6) || (this->_variant != 1)) goto LAB_009784c5; fStack_1c = 0.0; fStack_18 = 2.10195e-44; local_40._20_4_ = 0.0; local_40._20_4_ = std::_Allocate(0x20); fStack_1c = 4.06377e-44; fStack_18 = 4.34403e-44; builtin_strncpy((char *)local_40._20_4_,"gfx/007.001_Static Laser.anm2",0x1e); local_8 = 1; ANM2::Load(&this->_sprite,(std_string *)(local_40 + 0x14),1); local_8 = 0xffffffff; if (0xf < (uint)fStack_18) { uVar10 = (int)fStack_18 + 1; freePtr = (char *)local_40._20_4_; if (0xfff < uVar10) { freePtr = *(char **)(local_40._20_4_ + -4); uVar10 = (int)fStack_18 + 0x24; if ((char *)0x1f < (char *)(local_40._20_4_ + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar10); } local_44 = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { local_44 = *(std_string **)local_44->_buf; } animData = (this->_sprite)._animState._animData; if (animData == (byte *)0x0) { LAB_009784a4: bVar7 = ANM2::SetAnimation(&this->_sprite,(byte *)local_44,1); if (bVar7 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { curAnimChar = animData; defaultAnimChar = local_44; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar7 = *curAnimChar; isLess = bVar7 < (byte)defaultAnimChar->_buf[0]; if (bVar7 != defaultAnimChar->_buf[0]) { LAB_00978480: uVar10 = -(uint)isLess | 1; goto LAB_00978485; } if (bVar7 == 0) break; bVar7 = curAnimChar[1]; isLess = bVar7 < (byte)defaultAnimChar->_buf[1]; if (bVar7 != defaultAnimChar->_buf[1]) goto LAB_00978480; curAnimChar = curAnimChar + 2; defaultAnimChar = (std_string *)(defaultAnimChar->_buf + 2); } while (bVar7 != 0); uVar10 = 0; LAB_00978485: if ((uVar10 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))) ) goto LAB_009784a4; } spriteFlags = &(this->_sprite)._bitflags; *spriteFlags = *spriteFlags | 0x20; goto LAB_009784c5; } tmpEntity = this->_parent; if ((((tmpEntity == (EntityPtr)0x0) || (*(int *)((int)tmpEntity + 0x28) != 0x44)) || (*(int *)((int)tmpEntity + 0x2c) != 1)) || (*(int *)((int)tmpEntity + 0x30) != 1)) goto LAB_009784c5; } fStack_1c = 0.0; fStack_18 = 2.10195e-44; local_40._20_4_ = 0.0; local_40._20_4_ = std::_Allocate(0x20); fStack_1c = 4.06377e-44; fStack_18 = 4.34403e-44; builtin_strncpy((char *)local_40._20_4_,"gfx/007.006_CageVisLaser.anm2",0x1e); local_8 = 0; ANM2::Load(&this->_sprite,(std_string *)(local_40 + 0x14),1); local_8 = 0xffffffff; if (0xf < (uint)fStack_18) { uVar10 = (int)fStack_18 + 1; freePtr = (char *)local_40._20_4_; if (0xfff < uVar10) { freePtr = *(char **)(local_40._20_4_ + -4); uVar10 = (int)fStack_18 + 0x24; if ((char *)0x1f < (char *)(local_40._20_4_ + (-4 - (int)freePtr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freePtr,uVar10); } local_44 = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { local_44 = *(std_string **)local_44->_buf; } animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimChar = animData; defaultAnimChar = local_44; if (0xf < *(uint *)(animData + 0x14)) { curAnimChar = *(byte **)animData; } do { bVar7 = *curAnimChar; isLess = bVar7 < (byte)defaultAnimChar->_buf[0]; if (bVar7 != defaultAnimChar->_buf[0]) { LAB_00978314: uVar10 = -(uint)isLess | 1; goto LAB_00978319; } if (bVar7 == 0) break; bVar7 = curAnimChar[1]; isLess = bVar7 < (byte)defaultAnimChar->_buf[1]; if (bVar7 != defaultAnimChar->_buf[1]) goto LAB_00978314; curAnimChar = curAnimChar + 2; defaultAnimChar = (std_string *)(defaultAnimChar->_buf + 2); } while (bVar7 != 0); uVar10 = 0; LAB_00978319: if ((uVar10 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009784c5; } bVar7 = ANM2::SetAnimation(&this->_sprite,(byte *)local_44,1); if (bVar7 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; update_first_frame(this); this->_isFirstUpdate = 0; ExceptionList = local_10; return; } LAB_009784c5: update_first_frame(this); this->_isFirstUpdate = 0; ExceptionList = local_10; return; } //@@ 009785d0 Entity_Laser::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 5] */ void __thiscall Entity_Laser::Render(Entity_Laser *this,float *param_2) { ANM2 *this_00; byte bVar1; char cVar2; Entity_Player *player; LayerState *layer; float *pfVar3; AnimationState *layerFrame; BitSet128 *maskedTearFlags; float *pfVar4; uint uVar5; undefined4 *texture; Vector *renderPos; int extraout_EAX; int extraout_EAX_00; int extraout_EAX_01; int extraout_EAX_02; KColor *color; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int iVar6; KColor *fromColor; KColor *fromColor_00; KColor *fromColor_01; KColor *fromColor_02; KColor *fromColor_03; KColor *fromColor_04; float fVar7; float fVar8; float fVar9; float fVar10; byte *pbVar11; double dVar12; undefined1 auStack_338 [20]; float fStack_324; void *pvVar13; ColorMod *other; undefined8 uVar14; undefined8 uVar15; undefined8 uVar16; undefined1 auStack_30a [2]; undefined1 quad [112]; BitSet128 tmpTearFlags; ColorMod local_280; float local_254; float local_250; AnimationState *local_24c; float local_248; undefined4 local_244; AnimationState *local_240; float local_23c; AnimationState *local_238; float local_234; AnimationState *local_230; float local_22c; AnimationState *local_228; float local_224; undefined1 local_220; KColor quadColor; Color local_208; float local_1dc; float local_1d8; KColor vertexColor; Vector quadCorner1; Vector quadCorner2; Vector local_1b0; float scaledOffsetY; float alphaMultiplier; float scaledOffsetX; float local_19c; int shaderMode; float local_194; float local_190; float local_18c; Vector local_188; Vector local_180; float *verticesBegin; float *verticesEnd; float *verticesCapacity; float local_16c; float local_168; byte *local_164; Vector quadCorner3; float local_158; float local_154; float local_150; float local_14c; Vector local_148; float local_140; float local_13c; float *local_138; float local_134; float local_130; int *local_12c; float local_128; AnimationState *local_124; float local_120; undefined1 segmentQuad [4]; undefined1 firstLayerFrame [108]; undefined1 frameCopy [24]; float local_94; float local_90; float local_7c; float fStack_78; float fStack_74; float fStack_70; float local_6c; float fStack_68; float fStack_64; float fStack_60; float local_5c [2]; float local_54; ColorMod shaderColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; float renderOffsetX; char *warnMessage; local_8 = -NAN; puStack_c = &LAB_00b0cb9c; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&shaderColor)[1]._colorize; if (this->_visible == 0) { return; } if ((char)this->_sampleLaser < '\0') { return; } if ((this->_sprite)._loaded == 0) { return; } local_14c = (g_game->_screenShakeOffset).x; local_150 = (g_game->_screenShakeOffset).y; local_130 = (this->_posOffset).y + (this->_pos).y; local_13c = (g_screenHeight - 182.0) * 0.5; local_12c = (int *)(g_displayPixelRatio * g_screenPointScale); local_120 = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_12c + 0.5; ExceptionList = &local_10; dVar12 = floor((double)local_120); local_134 = (float)dVar12; local_120 = ((local_130 - 140.0) * 0.65 + local_13c) * (float)local_12c + 0.5; dVar12 = floor((double)local_120); local_120 = (float)dVar12; fVar8 = param_2[1]; (this->_renderPosition).x = local_134 / (float)local_12c + *param_2; (this->_renderPosition).y = local_120 / (float)local_12c + fVar8; fVar8 = 1.0; alphaMultiplier = 1.0; Entity::GetLastParent((Entity *)this); fStack_324 = 1.3915841e-38; player = (Entity_Player *)__RTDynamicCast(); if (player != (Entity_Player *)0x0) { bVar1 = Entity_Player::IsLocalPlayer(player); if (bVar1 == 0) { FUN_00925df0(); alphaMultiplier = fVar8; } } this_00 = &this->_sprite; layer = ANM2::GetLayer(this_00,(byte *)0x0); pfVar3 = LayerState::GetTexture(layer,&local_1b0); local_120 = *pfVar3; local_8 = 0.0; if ((((int *)local_1b0.y != (int *)0x0) && (cVar2 = (**(code **)(*(int *)local_1b0.y + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_8 = -NAN; if (local_120 == 0.0) { warnMessage = "[warn] Laser::Render sprite sheet is not loaded\n"; KAGE_LogMessage(1,(byte *)"[warn] Laser::Render sprite sheet is not loaded\n"); shader_cache_find((int)warnMessage); ExceptionList = local_10; return; } uVar5 = (this->_sprite)._layerCount; shaderMode = ((uint)(this->_sprite)._bitflags >> 5 & 1) * 2; if (this->_sampleLaser == 0) { if ((uVar5 < 2) || (((bVar1 = is_thick_variant(this), bVar1 == 0 && (iVar6 = this->_variant, iVar6 != 2)) && ((iVar6 != 5 && (iVar6 != 8)))))) { iVar6 = this->_variant; if (((iVar6 == 2) || (iVar6 == 10)) || (iVar6 == 7)) { layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); if (layerFrame == (AnimationState *)0x0) goto LAB_0097ab0f; AnimationState::copy_assign((AnimationState *)frameCopy,layerFrame); local_208._offset[2] = (float)CONCAT31(local_208._offset[2]._1_3_,1); local_208._colorize[3] = this->_laserLength * 0.65 + (float)frameCopy._4_4_; local_208._colorize[2] = (float)frameCopy._0_4_; local_208._colorize[1] = (float)frameCopy._4_4_; local_208._tint[3] = (float)frameCopy._4_4_; local_208._colorize[0] = (float)frameCopy._8_4_ + (float)frameCopy._0_4_; if ((this->_sprite)._flipX != 0) { local_208._colorize[0] = (float)frameCopy._0_4_; local_208._colorize[2] = (float)((float)frameCopy._8_4_ + (float)frameCopy._0_4_); } local_208._offset[1] = local_208._colorize[3]; local_208._offset[0] = local_208._colorize[0]; local_134 = (float)frameCopy._8_4_ * 0.5; local_124 = (AnimationState *)(this->_angleDegrees * 0.017453292); local_208._tint[2] = local_208._colorize[2]; local_154 = sin((float)local_124); fVar8 = cos((float)local_124); local_124 = (AnimationState *)(fVar8 * this->_laserLength); local_188.x = this->_laserLength * local_154; local_188.y = -(float)local_124; local_12c = (int *)local_188.x; Vector::Normalize(&local_188); KColor::SetFromARGB(&quadColor,0xffffffff); local_13c = (this->_pos).x + (this->_posOffset).x; local_140 = (this->_posOffset).y + (this->_pos).y; local_12c = (int *)((float)local_12c + local_140); local_180.y = (g_screenWidth - 338.0) * 0.5; local_120 = (g_screenHeight - 182.0) * 0.5; local_130 = g_displayPixelRatio * g_screenPointScale; local_124 = (AnimationState *) (((((float)local_124 + local_13c) - 60.0) * 0.65 + local_180.y) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_154 = (float)dVar12 / local_130; local_124 = (AnimationState *) ((((float)local_12c - 140.0) * 0.65 + local_120) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_12c = (int *)(local_188.x * local_134); local_164 = (byte *)(local_188.y * local_134); quadCorner3.x = (float)local_12c + local_154 + *param_2 + local_14c; quadCorner3.y = (float)local_164 + (float)dVar12 / local_130 + param_2[1] + local_150; local_134 = -local_134; quadCorner1.x = local_14c + *param_2 + local_154 + local_188.x * local_134; quadCorner1.y = local_150 + param_2[1] + (float)dVar12 / local_130 + local_188.y * local_134 ; local_124 = (AnimationState *)(((local_13c - 60.0) * 0.65 + local_180.y) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_154 = (float)dVar12; local_124 = (AnimationState *)(((local_140 - 140.0) * 0.65 + local_120) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_124 = (AnimationState *)(float)dVar12; quadCorner2.x = local_14c + *param_2 + local_154 / local_130 + (float)local_12c; quadCorner2.y = local_150 + param_2[1] + (float)local_124 / local_130 + (float)local_164; local_148.x = local_13c; local_148.y = local_140; renderPos = Isaac::GetRenderPosition(&local_1b0,&local_148,1); local_148.x = local_14c + *param_2 + local_188.x * local_134 + renderPos->x; local_148.y = local_150 + param_2[1] + local_188.y * local_134 + renderPos->y; fStack_324 = 1.393063e-38; set_quad_corner_colors(quad,&local_148,&quadCorner2,&quadCorner1,&quadCorner3,&quadColor); ANM2::GetLayer(this_00,(byte *)0x0); fStack_324 = 1.3930686e-38; FUN_00a13560(); FUN_00682260(); Color::operator_assign((Color *)auStack_338,&(this->_sprite)._color); FUN_004072e0(); if (shaderMode == 2) { uVar5 = g_game->_frameCount & 0x800000ff; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xffffff00) + 1; } shaderColor._colorize[3] = (float)(int)uVar5 * 0.00390625; } vertexColor._red = shaderColor._tint[0]; vertexColor._green = shaderColor._tint[1]; vertexColor._blue = shaderColor._tint[2]; vertexColor._alpha = shaderColor._tint[3] * alphaMultiplier; vertexColor._unk = 0; layer = ANM2::GetLayer(this_00,(byte *)0x0); layer->_wrapSMode = 0; layer = ANM2::GetLayer(this_00,(byte *)0x0); layer->_wrapTMode = 0; uVar16._0_4_ = 1.3930976e-38; uVar16._4_4_ = 0.0; layer = ANM2::GetLayer(this_00,(byte *)0x0); LayerState::GetTexture(layer,auStack_30a + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar16,SUB84(uVar16,4)); layer = ANM2::GetLayer(this_00,(byte *)0x0); texture = LayerState::GetTexture(layer,&local_148); local_8 = 8.40779e-45; goto LAB_0097b218; } Color::operator_assign((Color *)&local_280,&(this->_sprite)._color); (this->_sprite)._color._tint[3] = local_280._tint[3] * alphaMultiplier; ANM2::Render(this_00,&this->_renderPosition,&g_vectorZero,&g_vectorZero); (this->_sprite)._color._tint[3] = local_280._tint[3]; iVar6 = extraout_ECX_00; } else { local_124 = (AnimationState *)(this->_sprite)._rotation; if ((this->_sprite)._flipX != 0) { (this->_sprite)._rotation = -(float)local_124; } Color::operator_assign((Color *)&local_280,&(this->_sprite)._color); (this->_sprite)._color._tint[3] = alphaMultiplier * (this->_sprite)._color._tint[3]; Sprite::RenderLayer((Sprite *)this_00,0,&this->_renderPosition,&g_vectorZero,&g_vectorZero); Sprite::SetColor((Sprite *)this_00,&local_280); (this->_sprite)._rotation = (float)local_124; iVar6 = extraout_ECX; if (15.0 < this->_laserLength) { local_124 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,1); if ((local_124 == (AnimationState *)0x0) || (layerFrame == (AnimationState *)0x0)) { LAB_0097ab0f: warnMessage = "[warn] Laser::Render current frame is NULL\n"; KAGE_LogMessage(1,(byte *)"[warn] Laser::Render current frame is NULL\n"); shader_cache_find((int)warnMessage); ExceptionList = local_10; return; } AnimationState::copy_assign((AnimationState *)firstLayerFrame,local_124); AnimationState::copy_assign((AnimationState *)frameCopy,layerFrame); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x1); local_208._offset[2] = (float)CONCAT31(local_208._offset[2]._1_3_,1); local_120 = local_94 * (layer->_size).x * (this->_sprite)._scale.x; local_90 = local_90 * (layer->_size).y * (this->_sprite)._scale.y; local_208._colorize[3] = (float)frameCopy._4_4_ + (this->_laserLength / local_90) * 0.65; local_208._colorize[2] = (float)frameCopy._0_4_; local_208._colorize[1] = (float)frameCopy._4_4_; local_208._tint[3] = (float)frameCopy._4_4_; local_208._colorize[0] = (float)frameCopy._8_4_ + (float)frameCopy._0_4_; if ((this->_sprite)._flipX != 0) { local_208._colorize[0] = (float)frameCopy._0_4_; local_208._colorize[2] = (float)((float)frameCopy._8_4_ + (float)frameCopy._0_4_); } local_208._offset[1] = local_208._colorize[3]; local_208._offset[0] = local_208._colorize[0]; local_130 = (float)frameCopy._8_4_ * 0.5; local_124 = (AnimationState *)(this->_angleDegrees * 0.017453292); local_208._tint[2] = local_208._colorize[2]; local_94 = local_120; local_154 = sin((float)local_124); fVar8 = cos((float)local_124); local_13c = (this->_sprite)._scale.y; local_124 = (AnimationState *) (((float)firstLayerFrame._20_4_ + (float)firstLayerFrame._12_4_) * fVar8 * local_13c); local_13c = ((float)firstLayerFrame._20_4_ + (float)firstLayerFrame._12_4_) * local_154 * local_13c; fVar7 = this->_laserLength - ((float)firstLayerFrame._12_4_ / 0.65) * 0.5; local_1b0.x = fVar7 * local_154; local_154 = fVar7 * fVar8; local_1b0.y = -local_154; local_12c = (int *)local_1b0.x; Vector::Normalize(&local_1b0); local_134 = local_14c + (float)local_124 + local_120 * -local_130 * local_1b0.x + *param_2; local_140 = local_150 + local_13c + local_120 * -local_130 * local_1b0.y + param_2[1]; local_150 = local_150 + local_13c + local_120 * local_130 * local_1b0.y + param_2[1]; local_14c = local_14c + (float)local_124 + local_120 * local_130 * local_1b0.x + *param_2; local_130 = local_130 * local_1b0.y; KColor::SetFromARGB(&quadColor,0xffffffff); local_180.y = (this->_posOffset).x + (this->_pos).x; local_164 = (byte *)((this->_posOffset).y + (this->_pos).y); local_12c = (int *)((float)local_12c + (float)local_164); local_120 = (g_screenHeight - 182.0) * 0.5; local_13c = (g_screenWidth - 338.0) * 0.5; local_130 = g_displayPixelRatio * g_screenPointScale; local_124 = (AnimationState *) ((((local_154 + local_180.y) - 60.0) * 0.65 + local_13c) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_154 = (float)dVar12 / local_130; local_124 = (AnimationState *) ((((float)local_12c - 140.0) * 0.65 + local_120) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_148.y = (float)dVar12 / local_130 + local_150; local_148.x = local_154 + local_14c; quadCorner3.x = local_154 + local_134; quadCorner3.y = local_140 + (float)dVar12 / local_130; local_124 = (AnimationState *)(((local_180.y - 60.0) * 0.65 + local_13c) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_154 = (float)dVar12 / local_130; local_124 = (AnimationState *) ((((float)local_164 - 140.0) * 0.65 + local_120) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_124 = (AnimationState *)(float)dVar12; quadCorner1.y = (float)local_124 / local_130 + local_150; quadCorner1.x = local_154 + local_14c; quadCorner2.x = local_154 + local_134; quadCorner2.y = local_140 + (float)local_124 / local_130; fStack_324 = 1.3928041e-38; set_quad_corner_colors(quad,&quadCorner2,&quadCorner1,&quadCorner3,&local_148,&quadColor); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); g_graphicsManager_blendMode[0] = layer->_blendMode[0]; g_graphicsManager_blendMode[1] = layer->_blendMode[1]; g_graphicsManager_blendMode[2] = layer->_blendMode[2]; g_graphicsManager_blendMode[3] = layer->_blendMode[3]; g_graphicsManager_blendMode[4] = layer->_blendMode[4]; FUN_00682260(); Color::operator_assign((Color *)auStack_338,&(this->_sprite)._color); FUN_004072e0(); if (shaderMode == 2) { uVar5 = g_game->_frameCount & 0x800000ff; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xffffff00) + 1; } shaderColor._colorize[3] = (float)(int)uVar5 * 0.00390625; } vertexColor._red = shaderColor._tint[0]; vertexColor._green = shaderColor._tint[1]; vertexColor._blue = shaderColor._tint[2]; vertexColor._alpha = shaderColor._tint[3] * alphaMultiplier; vertexColor._unk = 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_wrapSMode = 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_wrapTMode = 0; uVar15._0_4_ = 1.3928444e-38; uVar15._4_4_ = 0.0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); LayerState::GetTexture(layer,auStack_30a + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar15,SUB84(uVar15,4)); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); texture = LayerState::GetTexture(layer,&local_148); local_8 = 7.00649e-45; LAB_0097b218: (**(code **)(*(int *)*texture + 0x14))(); local_8 = -NAN; FUN_0040c440(); iVar6 = extraout_ECX_01; } } shader_cache_find(iVar6); goto LAB_0097b24c; } local_164 = (byte *)(uint)(1 < uVar5); layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,(int)local_164); if (layerFrame == (AnimationState *)0x0) { warnMessage = "[warn] Laser::Render current laser frame is NULL\n"; KAGE_LogMessage(1,(byte *)"[warn] Laser::Render current laser frame is NULL\n"); shader_cache_find((int)warnMessage); ExceptionList = local_10; return; } AnimationState::copy_assign((AnimationState *)frameCopy,layerFrame); layer = ANM2::GetLayer(this_00,local_164); verticesBegin = (float *)0x0; verticesEnd = (float *)0x0; verticesCapacity = (float *)0x0; local_130 = local_94 * (layer->_size).x * (this->_sprite)._scale.x; local_8 = 1.4013e-45; std::vector<8byte>::reserve(); layer = ANM2::GetLayer(this_00,(byte *)0x0); layer->_wrapSMode = 0; layer = ANM2::GetLayer(this_00,(byte *)0x0); layer->_wrapTMode = 0; layer = ANM2::GetLayer(this_00,(byte *)0x0); LayerState::GetTexture(layer,&local_1b0); local_8 = (float)CONCAT31(local_8._1_3_,2); scaledOffsetX = (this->_posOffset).x * 0.65; local_12c = (this->_homingLaser)._samples._begin; local_19c = (float)frameCopy._8_4_ * 0.5; scaledOffsetY = (this->_posOffset).y * 0.65; local_13c = 0.0; if ((int)(this->_homingLaser)._samples._end - (int)local_12c >> 3 == 1) { local_138 = verticesEnd; } else { local_190 = -local_19c; local_138 = verticesEnd; do { fVar8 = local_13c; local_140 = *(float *)((int)local_12c + (int)local_13c * 8 + 8) - *(float *)((int)local_12c + (int)local_13c * 8); local_134 = *(float *)((int)local_12c + (int)local_13c * 8 + 0xc) - *(float *)((int)local_12c + (int)local_13c * 8 + 4); verticesEnd = local_138; fVar7 = sqrtf(local_134 * local_134 + local_140 * local_140); local_134 = local_134 / fVar7; local_140 = -(local_140 / fVar7); pfVar3 = (float *)((int)local_12c + (int)fVar8 * 8); local_188.y = (*(float *)((int)local_12c + (int)fVar8 * 8 + 4) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_12c = (int *)(g_displayPixelRatio * g_screenPointScale); local_120 = ((*pfVar3 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_12c + 0.5 ; dVar12 = floor((double)local_120); local_168 = (float)dVar12 / (float)local_12c; local_120 = local_188.y * (float)local_12c + 0.5; dVar12 = floor((double)local_120); local_120 = (float)dVar12; local_194 = local_130 * local_134 * local_19c; local_18c = local_130 * local_140 * local_19c; local_128 = local_168 + local_194; local_124 = (AnimationState *)(local_18c + local_120 / (float)local_12c); if (local_138 == verticesCapacity) { std::vector::_Emplace_reallocate(); } else { *local_138 = local_128; local_138[1] = (float)local_124; verticesEnd = local_138 + 2; } pvVar13 = (this->_homingLaser)._samples._begin; local_188.y = (*(float *)((int)pvVar13 + (int)fVar8 * 8 + 4) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_12c = (int *)(g_displayPixelRatio * g_screenPointScale); local_120 = ((*(float *)((int)pvVar13 + (int)fVar8 * 8) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_12c + 0.5; local_138 = verticesEnd; dVar12 = floor((double)local_120); local_168 = (float)dVar12 / (float)local_12c; local_120 = local_188.y * (float)local_12c + 0.5; dVar12 = floor((double)local_120); local_120 = (float)dVar12; local_188.y = local_130 * local_190 * local_134; local_16c = local_130 * local_190 * local_140; local_158 = local_168 + local_188.y; local_154 = local_120 / (float)local_12c + local_16c; if (local_138 == verticesCapacity) { std::vector::_Emplace_reallocate(); } else { *local_138 = local_158; local_138[1] = local_154; verticesEnd = local_138 + 2; } pvVar13 = (this->_homingLaser)._samples._begin; local_134 = (*(float *)((int)pvVar13 + (int)fVar8 * 8 + 0xc) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_12c = (int *)(g_displayPixelRatio * g_screenPointScale); local_120 = ((*(float *)((int)pvVar13 + (int)fVar8 * 8 + 8) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_12c + 0.5; local_138 = verticesEnd; dVar12 = floor((double)local_120); local_140 = (float)dVar12 / (float)local_12c; local_120 = local_134 * (float)local_12c + 0.5; dVar12 = floor((double)local_120); local_120 = (float)dVar12; local_180.y = local_18c + local_120 / (float)local_12c; local_180.x = local_194 + local_140; if (local_138 == verticesCapacity) { std::vector::_Emplace_reallocate(); } else { *local_138 = local_180.x; local_138[1] = local_180.y; verticesEnd = local_138 + 2; } pvVar13 = (this->_homingLaser)._samples._begin; local_134 = (*(float *)((int)pvVar13 + (int)fVar8 * 8 + 0xc) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_12c = (int *)(g_displayPixelRatio * g_screenPointScale); local_120 = ((*(float *)((int)pvVar13 + (int)fVar8 * 8 + 8) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_12c + 0.5; local_138 = verticesEnd; dVar12 = floor((double)local_120); local_140 = (float)dVar12 / (float)local_12c; local_120 = local_134 * (float)local_12c + 0.5; dVar12 = floor((double)local_120); local_120 = (float)dVar12; local_1d8 = local_16c + local_120 / (float)local_12c; local_1dc = local_188.y + local_140; if (local_138 == verticesCapacity) { std::vector::_Emplace_reallocate(); } else { *local_138 = local_1dc; local_138[1] = local_1d8; verticesEnd = local_138 + 2; } local_12c = (this->_homingLaser)._samples._begin; local_13c = (float)((int)local_13c + 1); local_138 = verticesEnd; } while ((uint)local_13c < ((int)(this->_homingLaser)._samples._end - (int)local_12c >> 3) - 1U) ; } iVar6 = this->_subtype; if (((iVar6 == 1) || (iVar6 == 2)) || (iVar6 == 3)) { verticesEnd = local_138; std::vector::erase(); std::vector::_Insert_n(); iVar6 = this->_subtype; if (((iVar6 != 1) && (iVar6 != 2)) && (iVar6 != 3)) { local_138 = verticesEnd; goto LAB_00979179; } local_138 = verticesEnd; local_190 = (float)(g_game->_frameCount - this->_spawnFrame) * 5.0 + 0.0; } else { LAB_00979179: local_190 = 0.0; } verticesEnd = local_138; layer = ANM2::GetLayer(&this->_sprite,local_164); g_graphicsManager_blendMode[0] = layer->_blendMode[0]; g_graphicsManager_blendMode[1] = layer->_blendMode[1]; g_graphicsManager_blendMode[2] = layer->_blendMode[2]; g_graphicsManager_blendMode[3] = layer->_blendMode[3]; g_graphicsManager_blendMode[4] = layer->_blendMode[4]; FUN_00682260(); pfVar3 = verticesBegin; local_138 = (float *)((int)local_138 - (int)verticesBegin); if (((uint)local_138 & 0x18) != 0) { KAGE_LogMessage(0x10,(byte *)"Vertices size is not a multiple of 4.\n"); } local_138 = (float *)((int)local_138 >> 3); local_120 = 0.0; if (local_138 != (float *)0x0) { pfVar3 = pfVar3 + 0xb; local_124 = (AnimationState *)((float)frameCopy._0_4_ + (float)frameCopy._8_4_); do { if ((uint)local_120 < (uint)((int)local_138 + -4)) { pfVar3[-7] = (pfVar3[-3] + pfVar3[-7]) * 0.5; pfVar3[-6] = (pfVar3[-2] + pfVar3[-6]) * 0.5; pfVar3[-5] = (pfVar3[-1] + pfVar3[-5]) * 0.5; pfVar3[-4] = (pfVar3[-4] + *pfVar3) * 0.5; } if (local_120 == 0.0) { local_19c = pfVar3[-0xb]; } else { local_19c = pfVar3[-0xf]; pfVar3[-0xb] = local_19c; pfVar3[-10] = pfVar3[-0xe]; pfVar3[-9] = pfVar3[-0xd]; pfVar3[-8] = pfVar3[-0xc]; } local_16c = pfVar3[-9]; local_164 = (byte *)pfVar3[-10]; local_134 = pfVar3[-8]; local_168 = pfVar3[-5]; local_18c = pfVar3[-7]; local_140 = pfVar3[-4]; local_194 = pfVar3[-6]; local_13c = (local_19c + local_16c) * 0.5; local_130 = (local_168 + local_18c) * 0.5; local_188.y = ((float)local_164 + local_134) * 0.5; local_1d8 = (local_140 + local_194) * 0.5; local_12c = (int *)sqrtf((local_1d8 - local_188.y) * (local_1d8 - local_188.y) + (local_130 - local_13c) * (local_130 - local_13c)); maskedTearFlags = BitSet128::operator_and(&tmpTearFlags,&this->_tearFlags,(BitSet128 *)&DAT_00c34b30); fVar8 = local_19c; pbVar11 = local_164; if (((!((int)maskedTearFlags->_l == 0 && *(int *)((int)&maskedTearFlags->_l + 4) == 0)) || (!((int)maskedTearFlags->_h == 0 && *(int *)((int)&maskedTearFlags->_h + 4) == 0))) && ((iVar6 = this->_subtype, iVar6 != 1 && ((iVar6 != 2 && (iVar6 != 3)))))) { local_154 = 1.0; local_180.y = local_190 / 1000.0; pfVar4 = &local_180.y; if (1.0 <= local_190 / 1000.0) { pfVar4 = &local_154; } local_180.y = 1.0; fVar7 = *pfVar4 * 1.5 + 1.0; local_134 = fVar7 * (local_134 - local_188.y) + local_188.y; local_16c = fVar7 * (local_16c - local_13c) + local_13c; local_154 = ((float)local_12c + local_190) / 1000.0; pfVar4 = &local_154; if (1.0 <= local_154) { pfVar4 = &local_180.y; } fVar8 = *pfVar4 * 1.5 + 1.0; local_18c = fVar8 * (local_18c - local_130) + local_130; local_194 = fVar8 * (local_194 - local_1d8) + local_1d8; local_140 = fVar8 * (local_140 - local_1d8) + local_1d8; local_168 = fVar8 * (local_168 - local_130) + local_130; fVar8 = fVar7 * (local_19c - local_13c) + local_13c; pbVar11 = (byte *)(fVar7 * ((float)local_164 - local_188.y) + local_188.y); } fVar9 = 1.0; fVar7 = local_18c; fVar10 = local_16c; maskedTearFlags = BitSet128::operator_and ((BitSet128 *)&local_250,&this->_tearFlags,(BitSet128 *)&DAT_00c34c40); if (((((int)maskedTearFlags->_l == 0 && *(int *)((int)&maskedTearFlags->_l + 4) == 0) && ((int)maskedTearFlags->_h == 0 && *(int *)((int)&maskedTearFlags->_h + 4) == 0)) || (iVar6 = this->_subtype, iVar6 == 1)) || ((iVar6 == 2 || (iVar6 == 3)))) { fVar10 = local_194; } else { local_180.y = 1.0; local_154 = local_190 / 300.0; pfVar4 = &local_154; if (fVar9 <= local_190 / 300.0) { pfVar4 = &local_180.y; } local_180.y = 1.0; fVar7 = fVar9 - *pfVar4 * 0.5; fVar8 = fVar7 * (fVar8 - local_13c) + local_13c; local_134 = fVar7 * (local_134 - local_188.y) + local_188.y; pbVar11 = (byte *)(fVar7 * ((float)pbVar11 - local_188.y) + local_188.y); local_16c = fVar7 * (fVar10 - local_13c) + local_13c; local_154 = ((float)local_12c + local_190) / 300.0; pfVar4 = &local_154; if (fVar9 <= local_154) { pfVar4 = &local_180.y; } fVar9 = fVar9 - *pfVar4 * 0.5; fVar7 = fVar9 * (local_18c - local_130) + local_130; local_168 = fVar9 * (local_168 - local_130) + local_130; local_140 = fVar9 * (local_140 - local_1d8) + local_1d8; fVar10 = fVar9 * (local_194 - local_1d8) + local_1d8; } local_22c = (float)local_12c + local_190; local_234 = local_190; local_23c = local_190; local_230 = (AnimationState *)frameCopy._0_4_; local_228 = local_124; local_220 = 1; if ((this->_sprite)._flipX != 0) { local_230 = local_124; local_228 = (AnimationState *)frameCopy._0_4_; } local_240 = local_230; local_238 = local_228; local_224 = local_22c; local_190 = local_22c; KColor::SetFromARGB(&quadColor,0xffffffff); fVar9 = param_2[1]; renderOffsetX = *param_2; quadCorner2.y = local_150 + fVar9 + scaledOffsetY + fVar10; quadCorner2.x = local_14c + renderOffsetX + scaledOffsetX + fVar7; quadCorner1.y = local_150 + fVar9 + scaledOffsetY + local_140; quadCorner1.x = local_14c + renderOffsetX + scaledOffsetX + local_168; quadCorner3.x = local_14c + renderOffsetX + scaledOffsetX + fVar8; quadCorner3.y = local_150 + fVar9 + scaledOffsetY + (float)pbVar11; local_148.y = local_150 + fVar9 + scaledOffsetY + local_134; local_148.x = local_14c + renderOffsetX + scaledOffsetX + local_16c; fStack_324 = 1.3922479e-38; set_quad_corner_colors(segmentQuad,&local_148,&quadCorner3,&quadCorner1,&quadCorner2,color); local_280._offset[2] = local_54; local_280._tint[0] = local_7c; local_280._tint[1] = fStack_78; local_280._tint[2] = fStack_74; local_280._tint[3] = fStack_70; local_280._colorize[0] = local_6c; local_280._colorize[1] = fStack_68; local_280._colorize[2] = fStack_64; local_280._colorize[3] = fStack_60; local_280._offset[0] = local_5c[0]; local_280._offset[1] = local_5c[1]; local_208._tint[0] = (this->_sprite)._color._tint[0]; local_208._tint[1] = (this->_sprite)._color._tint[1]; local_208._tint[2] = (this->_sprite)._color._tint[2]; local_208._tint[3] = (this->_sprite)._color._tint[3]; local_208._offset[2] = (this->_sprite)._color._offset[2]; other = &local_280; local_208._colorize[0] = (this->_sprite)._color._colorize[0]; local_208._colorize[1] = (this->_sprite)._color._colorize[1]; local_208._colorize[2] = (this->_sprite)._color._colorize[2]; local_208._colorize[3] = (this->_sprite)._color._colorize[3]; local_208._offset._0_8_ = *(undefined8 *)(this->_sprite)._color._offset; pvVar13 = (void *)0x979aab; Color::__mul(&local_208,other); shaderColor._offset[2] = local_208._offset[2]; shaderColor._tint[0] = local_208._tint[0]; shaderColor._tint[1] = local_208._tint[1]; shaderColor._tint[2] = local_208._tint[2]; shaderColor._tint[3] = local_208._tint[3]; shaderColor._colorize[0] = local_208._colorize[0]; shaderColor._colorize[1] = local_208._colorize[1]; shaderColor._colorize[2] = local_208._colorize[2]; shaderColor._colorize[3] = local_208._colorize[3]; shaderColor._offset[0] = local_208._offset[0]; shaderColor._offset[1] = local_208._offset[1]; if (shaderMode == 2) { uVar5 = g_game->_frameCount & 0x800000ff; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xffffff00) + 1; } shaderColor._colorize[3] = (float)(int)uVar5 * 0.00390625; } vertexColor._red = local_208._tint[0]; vertexColor._green = local_208._tint[1]; vertexColor._blue = local_208._tint[2]; vertexColor._alpha = local_208._tint[3] * alphaMultiplier; vertexColor._unk = 0; KAGE::SmartPointer::operator_assign(auStack_30a + -10,&local_1b0); apply_sprite_shader_params(&shaderColor,1,pvVar13,other); (**(code **)(*(int *)local_1b0.x + 0x14))(); pfVar3 = pfVar3 + 8; local_120 = (float)((int)local_120 + 4); } while ((uint)local_120 < local_138); pfVar3 = verticesBegin; } if ((1 < (uint)(this->_sprite)._layerCount) && (this->_subtype == 0)) { layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); if (layerFrame == (AnimationState *)0x0) { warnMessage = "[warn] Laser::Render current frame is NULL\n"; KAGE_LogMessage(1,(byte *)"[warn] Laser::Render current frame is NULL\n"); shader_cache_find((int)warnMessage); FUN_0040c440(); if (pfVar3 == (float *)0x0) { ExceptionList = local_10; return; } uVar5 = (int)verticesCapacity - (int)pfVar3 & 0xfffffff8; pfVar4 = pfVar3; if (uVar5 < 0x1000) { LAB_00979c35: operator_delete(pfVar4,uVar5); ExceptionList = local_10; return; } pfVar4 = (float *)pfVar3[-1]; uVar5 = uVar5 + 0x23; if ((uint)((int)pfVar3 + (-4 - (int)pfVar4)) < 0x20) goto LAB_00979c35; goto LAB_0097a2b3; } AnimationState::copy_assign((AnimationState *)frameCopy,layerFrame); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pfVar4 = (this->_homingLaser)._samples._begin; local_94 = local_94 * (layer->_size).x * (this->_sprite)._scale.x; local_90 = local_90 * (layer->_size).y * (this->_sprite)._scale.y; local_148.y = pfVar4[1] - (this->_pos).y; local_148.x = *pfVar4 - (this->_pos).x; Vector::Normalized(&local_148,&local_180); local_13c = -local_180.x; fVar8 = 0.5; local_130 = (float)frameCopy._8_4_ * 0.5; local_124 = (AnimationState *)((this->_pos).x + local_180.x * (float)frameCopy._20_4_); local_12c = (int *)((this->_pos).y + local_180.y * (float)frameCopy._20_4_); if (0 < *(int *)&this->field_0x4f0) { local_12c = (int *)((float)local_12c - (this->_posOffset).y); } local_208._colorize[3] = (float)frameCopy._12_4_ + (float)frameCopy._4_4_; local_208._colorize[2] = (float)frameCopy._0_4_; local_208._tint[3] = (float)frameCopy._4_4_ + 0.01; local_208._offset[2] = (float)CONCAT31(local_208._offset[2]._1_3_,1); local_208._colorize[0] = (float)frameCopy._0_4_ + (float)frameCopy._8_4_; if ((this->_sprite)._flipX != 0) { local_208._colorize[0] = (float)frameCopy._0_4_; local_208._colorize[2] = (float)((float)frameCopy._0_4_ + (float)frameCopy._8_4_); } local_208._offset[1] = local_208._colorize[3]; local_208._offset[0] = local_208._colorize[0]; fVar7 = local_180.x; local_208._tint[2] = local_208._colorize[2]; local_208._colorize[1] = local_208._tint[3]; KColor::SetFromARGB(&quadColor,0xffffffff); local_148.y = local_180.y * 0.025 + local_150 + param_2[1] + scaledOffsetY + pfVar3[1]; local_148.x = fVar7 * 0.025 + local_14c + *param_2 + scaledOffsetX + *pfVar3; quadCorner3.x = fVar7 * 0.025 + local_14c + *param_2 + scaledOffsetX + pfVar3[2]; local_120 = g_displayPixelRatio * g_screenPointScale; quadCorner3.y = local_180.y * 0.025 + local_150 + param_2[1] + scaledOffsetY + pfVar3[3]; local_124 = (AnimationState *) (((g_screenWidth - 338.0) * fVar8 + ((float)local_124 - 60.0) * 0.65) * local_120 + fVar8); dVar12 = floor((double)(float)local_124); local_154 = (float)dVar12 / local_120; local_124 = (AnimationState *) (((g_screenHeight - 182.0) * 0.5 + ((float)local_12c - 140.0) * 0.65) * local_120 + 0.5); dVar12 = floor((double)(float)local_124); local_124 = (AnimationState *)(float)dVar12; quadCorner1.x = local_14c + *param_2 + scaledOffsetX + local_130 * local_180.y * local_94 + local_154; quadCorner1.y = local_150 + param_2[1] + scaledOffsetY + local_13c * local_130 * local_94 + (float)local_124 / local_120; quadCorner2.x = local_14c + *param_2 + scaledOffsetX + -local_130 * local_180.y * local_94 + local_154; quadCorner2.y = local_150 + param_2[1] + scaledOffsetY + -local_130 * local_13c * local_94 + (float)local_124 / local_120; fStack_324 = 1.3925018e-38; set_quad_corner_colors(quad,&quadCorner2,&quadCorner1,&quadCorner3,&local_148,&quadColor); FUN_00682260(); Color::operator_assign((Color *)auStack_338,&(this->_sprite)._color); FUN_004072e0(); if (shaderMode == 2) { uVar5 = g_game->_frameCount & 0x800000ff; if ((int)uVar5 < 0) { uVar5 = (uVar5 - 1 | 0xffffff00) + 1; } shaderColor._colorize[3] = (float)(int)uVar5 * 0.00390625; } local_254 = shaderColor._tint[0]; local_250 = shaderColor._tint[1]; local_24c = (AnimationState *)shaderColor._tint[2]; local_248 = shaderColor._tint[3] * alphaMultiplier; local_244 = 0; uVar14._0_4_ = 1.3925265e-38; uVar14._4_4_ = 0.0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); LayerState::GetTexture(layer,auStack_30a + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar14,SUB84(uVar14,4)); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); texture = LayerState::GetTexture(layer,&local_148); local_8 = (float)CONCAT31(local_8._1_3_,3); (**(code **)(*(int *)*texture + 0x14))(); FUN_0040c440(); } local_8 = (float)CONCAT31(local_8._1_3_,4); if ((((int *)local_1b0.y != (int *)0x0) && (cVar2 = (**(code **)(*(int *)local_1b0.y + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_8 = -NAN; if (pfVar3 != (float *)0x0) { uVar5 = (int)verticesCapacity - (int)pfVar3 & 0xfffffff8; pfVar4 = pfVar3; if (0xfff < uVar5) { pfVar4 = (float *)pfVar3[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pfVar3 + (-4 - (int)pfVar4))) { LAB_0097a2b3: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pfVar4,uVar5); } LAB_0097b24c: FUN_008617a0(); if ((g_game->_debugFlags & 1) != 0) { local_120 = g_displayPixelRatio * g_screenPointScale; local_124 = (AnimationState *) (((g_screenWidth - 338.0) * 0.5 + ((this->_pos).x - 60.0) * 0.65) * local_120 + 0.5) ; dVar12 = floor((double)(float)local_124); local_12c = (int *)((float)dVar12 / local_120); local_124 = (AnimationState *) ((((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_120 + 0.5); dVar12 = floor((double)(float)local_124); fVar8 = (float)dVar12 / local_120; local_124 = (AnimationState *)fVar8; KColor::SetFromARGB(&vertexColor,0xffffa500); local_148.x = (float)local_12c + 2.0; local_148.y = fVar8 + 0.0; quadCorner3.x = (float)local_12c - 2.0; quadCorner3.y = fVar8 - 0.0; fStack_324 = 1.3931744e-38; render_color_quad(&quadCorner3,&local_148,fromColor,fromColor,1.0); KColor::SetFromARGB(&vertexColor,0xffffa500); local_148.x = (float)local_12c + 0.0; local_148.y = (float)local_124 + 2.0; quadCorner3.y = (float)local_124 - 2.0; quadCorner3.x = (float)local_12c - 0.0; fStack_324 = 1.3931924e-38; render_color_quad(&quadCorner3,&local_148,fromColor_00,fromColor_00,1.0); if (this->_sampleLaser != 0) { pfVar3 = (this->_homingLaser)._samples._begin; local_12c = (int *)0x0; if ((int)(this->_homingLaser)._samples._end - (int)pfVar3 >> 3 != 0) { do { local_120 = g_displayPixelRatio * g_screenPointScale; local_124 = (AnimationState *) (((g_screenWidth - 338.0) * 0.5 + (pfVar3[(int)local_12c * 2] - 60.0) * 0.65) * local_120 + 0.5); dVar12 = floor((double)(float)local_124); local_130 = (float)dVar12 / local_120; local_124 = (AnimationState *) (((pfVar3[(int)local_12c * 2 + 1] - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_120 + 0.5); dVar12 = floor((double)(float)local_124); fVar8 = (float)dVar12 / local_120; local_124 = (AnimationState *)fVar8; KColor::SetFromARGB(&vertexColor,0xffffffff); local_148.x = local_130 + 2.0; local_148.y = fVar8 + 0.0; quadCorner3.x = local_130 - 2.0; quadCorner3.y = fVar8 - 0.0; fStack_324 = 1.3932584e-38; render_color_quad(&quadCorner3,&local_148,fromColor_01,fromColor_01,0.95); if (extraout_EAX != 0) { *(float *)(extraout_EAX + 8) = *(float *)(extraout_EAX + 8) - 1.0; *(float *)(extraout_EAX + 0x24) = *(float *)(extraout_EAX + 0x24) - 1.0; *(float *)(extraout_EAX + 0x40) = *(float *)(extraout_EAX + 0x40) - 1.0; *(float *)(extraout_EAX + 0x5c) = *(float *)(extraout_EAX + 0x5c) - 1.0; } KColor::SetFromARGB(&vertexColor,0xffffffff); quadCorner1.x = local_130 + 0.0; quadCorner2.x = local_130 - 0.0; quadCorner1.y = (float)local_124 + 2.0; quadCorner2.y = (float)local_124 - 2.0; fStack_324 = 1.3932854e-38; render_color_quad(&quadCorner2,&quadCorner1,fromColor_02,fromColor_02,0.95); if (extraout_EAX_00 != 0) { *(float *)(extraout_EAX_00 + 8) = *(float *)(extraout_EAX_00 + 8) - 1.0; *(float *)(extraout_EAX_00 + 0x24) = *(float *)(extraout_EAX_00 + 0x24) - 1.0; *(float *)(extraout_EAX_00 + 0x40) = *(float *)(extraout_EAX_00 + 0x40) - 1.0; *(float *)(extraout_EAX_00 + 0x5c) = *(float *)(extraout_EAX_00 + 0x5c) - 1.0; } pfVar3 = (this->_homingLaser)._samples._begin; local_12c = (int *)((int)local_12c + 1); } while (local_12c < (uint)((int)(this->_homingLaser)._samples._end - (int)pfVar3 >> 3)); } local_154 = this->_angleDegrees * 0.017453292; local_130 = g_displayPixelRatio * g_screenPointScale; fVar8 = cos(local_154); local_124 = (AnimationState *) ((((*pfVar3 - fVar8 * 16.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); local_124 = (AnimationState *)(float)dVar12; local_120 = (float)local_124 / local_130; fVar8 = sin(local_154); local_124 = (AnimationState *) ((((pfVar3[1] - fVar8 * 16.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_130 + 0.5); dVar12 = floor((double)(float)local_124); fVar8 = (float)dVar12 / local_130; local_124 = (AnimationState *)fVar8; KColor::SetFromARGB(&vertexColor,0xffadff2f); local_148.x = local_120 + 2.0; local_148.y = fVar8 + 0.0; quadCorner3.x = local_120 - 2.0; quadCorner3.y = fVar8 - 0.0; fStack_324 = 1.3933677e-38; render_color_quad(&quadCorner3,&local_148,fromColor_03,fromColor_03,0.95); if (extraout_EAX_01 != 0) { *(float *)(extraout_EAX_01 + 8) = *(float *)(extraout_EAX_01 + 8) - 1.0; *(float *)(extraout_EAX_01 + 0x24) = *(float *)(extraout_EAX_01 + 0x24) - 1.0; *(float *)(extraout_EAX_01 + 0x40) = *(float *)(extraout_EAX_01 + 0x40) - 1.0; *(float *)(extraout_EAX_01 + 0x5c) = *(float *)(extraout_EAX_01 + 0x5c) - 1.0; } KColor::SetFromARGB(&vertexColor,0xffadff2f); local_148.x = local_120 + 0.0; quadCorner3.x = local_120 - 0.0; local_148.y = (float)local_124 + 2.0; quadCorner3.y = (float)local_124 - 2.0; fStack_324 = 1.3933951e-38; render_color_quad(&quadCorner3,&local_148,fromColor_04,fromColor_04,0.95); if (extraout_EAX_02 != 0) { *(float *)(extraout_EAX_02 + 8) = *(float *)(extraout_EAX_02 + 8) - 1.0; *(float *)(extraout_EAX_02 + 0x24) = *(float *)(extraout_EAX_02 + 0x24) - 1.0; *(float *)(extraout_EAX_02 + 0x40) = *(float *)(extraout_EAX_02 + 0x40) - 1.0; *(float *)(extraout_EAX_02 + 0x5c) = *(float *)(extraout_EAX_02 + 0x5c) - 1.0; } } } ExceptionList = local_10; return; } //@@ 0097baa0 Entity_Laser::UpdateHits /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? laser Update/Interpolate: QueryRadius, IsVulnerableEnemy, flag bitset tests prototype: db/protos.zhl */ void __thiscall Entity_Laser::UpdateHits(Entity_Laser *this) { undefined4 uVar1; qword qVar2; byte bVar3; short impactDistanceClass; int iVar4; BitSet128 *maskedFlags; byte *pbVar5; uint uVar6; float *clampedValue; undefined4 uVar7; byte *wantedAnimChar; undefined1 *puVar8; void *animData; qword *pqVar9; EntityPtr EVar10; bool bVar11; float fVar12; float fVar13; undefined4 fadeColor; undefined4 uStack_c0; undefined4 uStack_bc; float fadeAlpha; undefined4 local_a4; undefined4 uStack_a0; undefined4 local_9c; undefined1 local_98 [12]; float local_8c; Entity_Laser *savedLaser; float widthScale; Vector local_80; undefined1 local_78 [8]; Vector local_70; EntityPtr ownerPlayer; float local_60; char isHitFrame; float radius; byte *local_54; undefined1 local_50 [24]; undefined1 local_38 [20]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint *flagWord; Vector *pos; ColorMod *spriteColor; code *takeDamageFn; int *timeout; Vector *velocity; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b0cbe8; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; savedLaser = this; refresh_tear_params(this,local_24); bVar3 = this->_isFirstUpdate; if ((bVar3 != 0) || (this->_oneHit == 0)) { uVar7 = *(undefined4 *)((int)&(this->_tearFlags)._l + 4); qVar2 = (this->_tearFlags)._h; uVar1 = *(undefined4 *)((int)&(this->_tearFlags)._h + 4); *(int *)&(this->_activeTearFlags)._l = (int)(this->_tearFlags)._l; *(undefined4 *)((int)&(this->_activeTearFlags)._l + 4) = uVar7; *(int *)&(this->_activeTearFlags)._h = (int)qVar2; *(undefined4 *)((int)&(this->_activeTearFlags)._h + 4) = uVar1; } if ((((this->_dead == 0) && (this->_isInterpolating == 0)) && (this->_variant != 8)) && ((bVar3 != 0 || (iVar4 = Entity::GetIntervalTicks((Entity *)this,2.0,0.0), iVar4 != 0)))) { isHitFrame = '\x01'; if (this->_parentLaser == (EntityPtr)0x0) { (this->_hitList)._end = (this->_hitList)._begin; } } else { isHitFrame = '\0'; } if ((this->_isInterpolating == 0) && (this->_subtype == 1)) { this->_friction = this->_friction * 0.8; } (this->_homingLaser)._bezier._end = (this->_homingLaser)._bezier._begin; *(float *)&(this->_homingLaser).field_0x4 = (this->_pos).x; *(float *)&(this->_homingLaser).field_0x8 = (this->_pos).y; *(float *)&(this->_homingLaser).field_0xc = g_vectorZero.x; *(float *)&(this->_homingLaser).field_0x10 = g_vectorZero.y; radius = this->_radius; EVar10 = this->_parent; local_60 = 1.0; widthScale = 1.0; if ((EVar10 != (EntityPtr)0x0) && (*(int *)((int)EVar10 + 0x28) == 3)) { radius = radius * 0.75; } ownerPlayer = this->_spawnerEntity; if ((ownerPlayer != (EntityPtr)0x0) && (*(int *)((int)ownerPlayer + 0x28) != 1)) { ownerPlayer = (EntityPtr)0x0; } fVar12 = radius; maskedFlags = BitSet128::operator_and ((BitSet128 *)local_98,&this->_tearFlags,(BitSet128 *)&DAT_00c34890); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { fVar12 = sin(this->_updateTime * 0.1); fVar12 = fVar12 * 20.0 + radius; radius = fVar12; } if ((this->_subtype == 3) && (EVar10 == ownerPlayer)) { LAB_0097bdfd: if ((EVar10 != (EntityPtr)0x0) && (*(char *)((int)EVar10 + 0x173) == '\0')) goto LAB_0097c1af; if (this->_dead == 0) { this->_dead = 1; this->_timeout = 0; goto LAB_0097c1af; } LAB_0097c1bc: if (this->_variant == 2) { animData = (this->_sprite)._animState._animData; if ((animData == (void *)0x0) || (*(char *)((int)animData + 0x34) == '\0')) { if ((this->_sprite)._animState._animData == (void *)0x0) { puVar8 = &DAT_bf800000; } else { puVar8 = (undefined1 *)(this->_sprite)._animState._animFrame; } widthScale = (float)puVar8 * 0.2 + local_60; } else { ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState,(std_string *)(local_50 + 0x10)); local_14 = 0; std::string::append(local_50 + 0x10,&DAT_00b61844,4); local_54 = local_50 + 0x10; if (&DAT_0000000f < (uint)local_38._12_4_) { local_54 = (byte *)local_50._16_4_; } pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == (byte *)0x0) { LAB_0097c25f: bVar3 = ANM2::SetAnimation(&this->_sprite,local_54,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; this = savedLaser; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } wantedAnimChar = local_54; do { bVar3 = *pbVar5; bVar11 = bVar3 < *wantedAnimChar; if (bVar3 != *wantedAnimChar) { LAB_0097c244: uVar6 = -(uint)bVar11 | 1; goto LAB_0097c249; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar11 = bVar3 < wantedAnimChar[1]; if (bVar3 != wantedAnimChar[1]) goto LAB_0097c244; pbVar5 = pbVar5 + 2; wantedAnimChar = wantedAnimChar + 2; } while (bVar3 != 0); uVar6 = 0; LAB_0097c249: if ((uVar6 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0097c25f; } local_14 = 0xffffffff; if (&DAT_0000000f < (uint)local_38._12_4_) { puVar8 = (undefined1 *)(local_38._12_4_ + 1); pbVar5 = (byte *)local_50._16_4_; if ((undefined1 *)0xfff < puVar8) { pbVar5 = *(byte **)(local_50._16_4_ + -4); puVar8 = (undefined1 *)(local_38._12_4_ + 0x24); if ((byte *)0x1f < (byte *)(local_50._16_4_ + (-4 - (int)pbVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar5,(uint)puVar8); } animData = (this->_sprite)._animState._animData; } if ((animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) goto LAB_0097c301; } (**(code **)(*(int *)this + 0x28))(); } else { maskedFlags = BitSet128::operator_and ((BitSet128 *)local_78,&this->_tearFlags,(BitSet128 *)&DAT_00c34b30); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { if (ownerPlayer == (EntityPtr)0x0) { local_54 = (byte *)0x0; } else { fVar12 = (this->_pos).y - *(float *)((int)ownerPlayer + 0x340); fVar13 = (this->_pos).x - *(float *)((int)ownerPlayer + 0x33c); local_54 = (byte *)sqrtf(fVar12 * fVar12 + fVar13 * fVar13); } local_80.y = 500.0; clampedValue = &local_80.y; if ((float)local_54 <= 500.0) { clampedValue = (float *)&local_54; } fVar12 = (*clampedValue * 50.0) / 500.0 + radius; radius = fVar12; } fVar13 = 500.0; maskedFlags = BitSet128::operator_and ((BitSet128 *)local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34c40); if ((!((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0)) || (!((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0))) { if (ownerPlayer == (EntityPtr)0x0) { local_54 = (byte *)0x0; } else { fVar12 = (this->_pos).y - *(float *)((int)ownerPlayer + 0x340); fVar13 = (this->_pos).x - *(float *)((int)ownerPlayer + 0x33c); local_54 = (byte *)sqrtf(fVar12 * fVar12 + fVar13 * fVar13); fVar13 = 500.0; } local_80.y = 500.0; clampedValue = &local_80.y; if ((float)local_54 <= fVar13) { clampedValue = (float *)&local_54; } fVar12 = radius + (local_60 - *clampedValue / fVar13) * 50.0; radius = fVar12; } if (this->_subtype != 2) { radius = fVar12; if (this->_subtype != 3) goto LAB_0097c3ac; goto LAB_0097bdfd; } iVar4 = g_game->_frameCount - this->_spawnFrame; if (iVar4 < 10) { local_54 = (byte *)(local_60 - (float)iVar4 / 10.0); fVar12 = sin((float)local_54 * 3.1415927); local_80.y = 5.0; local_54 = (byte *)((local_60 - ((float)local_54 * (float)local_54 * (float)local_54 - fVar12 * (float)local_54)) * radius); clampedValue = (float *)&local_54; if ((float)local_54 <= 5.0) { clampedValue = &local_80.y; } pbVar5 = (byte *)*clampedValue; if ((float)pbVar5 <= radius) { radius = (float)pbVar5; } else { widthScale = (float)pbVar5 / radius; } } pos = &this->_pos; Room::GetClampedPositionImpl(g_game->_room,&local_70,pos,radius,radius,radius,radius); maskedFlags = BitSet128::operator_and ((BitSet128 *)local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34b80); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { maskedFlags = BitSet128::operator_and ((BitSet128 *)local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c348d0); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { local_80.y = local_70.x - pos->x; local_54 = (byte *)(local_70.y - (this->_pos).y); fVar12 = sqrtf(local_80.y * local_80.y + (float)local_54 * (float)local_54); if (0.0 < fVar12) { local_80.y = local_80.y * (local_60 / fVar12); local_54 = (byte *)((float)local_54 * (local_60 / fVar12)); } local_8c = (this->_velocity).x; local_70.y = (this->_velocity).y; fVar12 = sqrtf(local_8c * local_8c + local_70.y * local_70.y); if (fVar12 <= 0.0) { fVar13 = local_8c; fVar12 = local_70.y; } else { fVar13 = (this->_velocity).x * (local_60 / fVar12); fVar12 = (this->_velocity).y * (local_60 / fVar12); } if ((local_80.y * fVar13 + (float)local_54 * fVar12 < -0.75) && (this->_timeout == 0)) { this->_timeout = 5; } } } else { velocity = &this->_velocity; if (((local_70.x < pos->x) && (fVar12 = velocity->x, 0.0 < fVar12)) || ((pos->x < local_70.x && (fVar12 = velocity->x, fVar12 < 0.0)))) { pos->x = local_70.x; velocity->x = fVar12 * -1.0; maskedFlags = BitSet128::__bnot((BitSet128 *)&DAT_00c34b80,(BitSet128 *)local_38); *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l & (uint)maskedFlags->_l; flagWord = (uint *)((int)&(this->_tearFlags)._l + 4); *flagWord = *flagWord & *(uint *)((int)&maskedFlags->_l + 4); pqVar9 = &(this->_tearFlags)._h; *(uint *)pqVar9 = (uint)*pqVar9 & (uint)maskedFlags->_h; flagWord = (uint *)((int)&(this->_tearFlags)._h + 4); *flagWord = *flagWord & *(uint *)((int)&maskedFlags->_h + 4); *(uint *)&(this->_heldTearFlags)._l = (uint)(this->_heldTearFlags)._l | DAT_00c34b80; flagWord = (uint *)((int)&(this->_heldTearFlags)._l + 4); *flagWord = *flagWord | DAT_00c34b84; pqVar9 = &(this->_heldTearFlags)._h; *(uint *)pqVar9 = (uint)*pqVar9 | DAT_00c34b88; flagWord = (uint *)((int)&(this->_heldTearFlags)._h + 4); *flagWord = *flagWord | DAT_00c34b8c; } fVar12 = (this->_pos).y; clampedValue = &(this->_velocity).y; if (((local_70.y < fVar12) && (fVar13 = *clampedValue, 0.0 < fVar13)) || ((fVar12 < local_70.y && (fVar13 = *clampedValue, fVar13 < 0.0)))) { (this->_pos).y = local_70.y; *clampedValue = fVar13 * -1.0; maskedFlags = BitSet128::__bnot((BitSet128 *)&DAT_00c34b80,(BitSet128 *)local_38); *(uint *)&(this->_tearFlags)._l = (uint)(this->_tearFlags)._l & (uint)maskedFlags->_l; flagWord = (uint *)((int)&(this->_tearFlags)._l + 4); *flagWord = *flagWord & *(uint *)((int)&maskedFlags->_l + 4); pqVar9 = &(this->_tearFlags)._h; *(uint *)pqVar9 = (uint)*pqVar9 & (uint)maskedFlags->_h; flagWord = (uint *)((int)&(this->_tearFlags)._h + 4); *flagWord = *flagWord & *(uint *)((int)&maskedFlags->_h + 4); *(uint *)&(this->_heldTearFlags)._l = (uint)(this->_heldTearFlags)._l | DAT_00c34b80; flagWord = (uint *)((int)&(this->_heldTearFlags)._l + 4); *flagWord = *flagWord | DAT_00c34b84; pqVar9 = &(this->_heldTearFlags)._h; *(uint *)pqVar9 = (uint)*pqVar9 | DAT_00c34b88; flagWord = (uint *)((int)&(this->_heldTearFlags)._h + 4); *flagWord = *flagWord | DAT_00c34b8c; } } LAB_0097c1af: if (this->_dead != 0) goto LAB_0097c1bc; } LAB_0097c301: iVar4 = this->_timeout; timeout = &this->_timeout; if ((0 < iVar4) && (this->_isInterpolating == 0)) { if ((this->_variant != 2) && (this->_subtype == 2)) { widthScale = (float)(5 - iVar4) * 0.2 + local_60; Sprite::SetColor((Sprite *)&this->_sprite,&this->_color); iVar4 = *timeout; local_70.y = 7.00649e-45; clampedValue = &local_70.y; if (iVar4 < 5) { clampedValue = (float *)timeout; } (this->_sprite)._color._tint[3] = ((float)(int)*clampedValue * (this->_sprite)._color._tint[3]) / 5.0; } *timeout = iVar4 + -1; if (iVar4 + -1 < 1) { this->_dead = 1; } } LAB_0097c3ac: local_54 = (byte *)0x3e99999a; if (this->_subtype == 3) { EVar10 = this->_parent; if ((EVar10 != (EntityPtr)0x0) && (this->_disableFollowParent == 0)) { fVar12 = *(float *)((int)EVar10 + 0x340); fVar13 = (this->_parentOffset).y; (this->_pos).x = *(float *)((int)EVar10 + 0x33c) + (this->_parentOffset).x; (this->_pos).y = fVar12 + fVar13; fVar12 = *(float *)((int)this->_parent + 0x364); (this->_velocity).x = *(float *)((int)this->_parent + 0x360); (this->_velocity).y = fVar12; } iVar4 = this->_variant; if ((((iVar4 == 1) || (iVar4 == 9)) || (iVar4 == 0xb)) || (iVar4 == 0xe)) { local_70.y = 2.8026e-44; clampedValue = &local_70.y; if (this->_timeout < 0x14) { clampedValue = (float *)&this->_timeout; } fadeColor = 0x3f800000; uStack_c0 = 0x3f800000; uStack_bc = 0x3f800000; local_a4 = 0; spriteColor = &(this->_sprite)._color; uStack_a0 = 0; local_9c = 0; fadeAlpha = (float)(int)*clampedValue / 20.0; if (spriteColor != (ColorMod *)&fadeColor) { (this->_sprite)._color._colorize[0] = 0.0; (this->_sprite)._color._colorize[1] = 0.0; (this->_sprite)._color._colorize[2] = 0.0; (this->_sprite)._color._colorize[3] = 0.0; spriteColor->_tint[0] = 1.0; (this->_sprite)._color._tint[1] = 1.0; (this->_sprite)._color._tint[2] = 1.0; (this->_sprite)._color._tint[3] = fadeAlpha; (this->_sprite)._color._offset[0] = 0.0; (this->_sprite)._color._offset[1] = 0.0; (this->_sprite)._color._offset[2] = 0.0; } } } else { fVar12 = radius; maskedFlags = BitSet128::operator_and ((BitSet128 *)local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c348d0); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { Room::GetClampedPositionImpl(g_game->_room,&local_70,&this->_pos,fVar12,fVar12,fVar12,fVar12); (this->_pos).x = local_70.x; (this->_pos).y = local_70.y; } else if (this->_isInterpolating == 0) { local_70.y = (this->_pos).x; pos = &this->_pos; local_8c = (this->_pos).y; Room::ScreenWrapPositionImpl(g_game->_room,&local_80,pos,-200.0,-200.0,-200.0,-200.0); pos->x = local_80.x; (this->_pos).y = local_80.y; if (((pos->x != local_70.y) || ((this->_pos).y != local_8c)) && ((local_54 = (byte *)local_60, this->_subtype == 2 && (this->_timeout == 0)))) { this->_timeout = 0x2d; } } } if (((this->_variant == 2) || (this->_variant == 10)) && (EVar10 = this->_child, EVar10 != (EntityPtr)0x0)) { fVar12 = (this->_pos).x; fVar13 = (this->_pos).y; if (this->_isInterpolating == 0) { maskedFlags = BitSet128::operator_and ((BitSet128 *)local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c348d0); if ((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) { if ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0) { if (this->_subtype != 3) { local_70.x = this->_friction * (this->_velocity).x + fVar12; local_70.y = this->_friction * (this->_velocity).y + fVar13; Room::GetClampedPositionImpl (g_game->_room,(Vector *)(local_98 + 8),&local_70,radius,radius,radius,radius) ; EVar10 = this->_child; fVar13 = local_8c; fVar12 = (float)local_98._8_4_; } } } } if (this->_subtype == 2) { fVar13 = fVar13 - (this->_velocity).y; fVar12 = fVar12 - (this->_velocity).x; } *(float *)((int)EVar10 + 0x33c) = fVar12; *(float *)((int)EVar10 + 0x340) = fVar13; (**(code **)(*(int *)this->_child + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); EVar10 = this->_child; *(float *)((int)EVar10 + 0x34c) = (this->_posOffset).x; *(float *)((int)EVar10 + 0x350) = (this->_posOffset).y; } maskedFlags = BitSet128::operator_and((BitSet128 *)local_38,&this->_tearFlags,&g_tearFlagHoming); if (((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) { uVar7 = 0; } else { uVar7 = 1; } HomingLaser::build_ring_bezier(&this->_pos,uVar7,this->_parent); HomingLaser::CalculateSamples(&this->_homingLaser,(float)local_54); HomingLaser::remove_collinear_samples(); maskedFlags = BitSet128::operator_and ((BitSet128 *)local_38,&this->_tearFlags,(BitSet128 *)&DAT_00c34870); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { if ((this->_parent == (EntityPtr)0x0) || (*(int *)((int)this->_parent + 0x28) != 8)) { if (ownerPlayer != (EntityPtr)0x0) { get_tear_trinket_multiplier((Entity_Player *)ownerPlayer,10); } } else { local_70.y = (float)g_game->_frameCount * 1.6; if (ownerPlayer != (EntityPtr)0x0) { local_60 = get_tear_trinket_multiplier((Entity_Player *)ownerPlayer,10); } } HomingLaser::apply_sine_offset(); } this->_isGridHit = 0; if (this->_entityGridCollisionClass != 0) { local_70.x = (this->_posOffset).x * 0.8; local_70.y = (this->_posOffset).y * 0.8; bVar3 = HomingLaser::clip_samples_to_grid(&local_70,this->_entityGridCollisionClass); this->_isGridHit = bVar3; } if (isHitFrame == '\0') { if ((((this->_dead == 0) && (this->_isInterpolating == 0)) && (this->_variant == 8)) && (iVar4 = Entity::GetIntervalTicks((Entity *)this,30.0,0.0), iVar4 != 0)) { EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_98,&this->_pos, this->_radius,8); local_14 = 1; local_54 = (byte *)0x0; if (local_8c != 0.0) { do { pbVar5 = local_54; bVar3 = Entity::IsVulnerableEnemy (*(Entity **)(local_98._4_4_ + (int)local_54 * 4),(Entity *)0x0); if (bVar3 != 0) { bVar3 = Entity::IsDescendantOf ((Entity *)this,*(Entity **)(local_98._4_4_ + (int)pbVar5 * 4)); if (bVar3 == 0) { takeDamageFn = *(code **)(**(int **)(local_98._4_4_ + (int)pbVar5 * 4) + 0x20); EntityRef::constructor((EntityRef *)local_50,(Entity *)savedLaser); (*takeDamageFn)(savedLaser->_collisionDamage,0,0,local_50,0x1e); this = savedLaser; pbVar5 = local_54; } } local_54 = (byte *)((int)pbVar5 + 1); } while (local_54 < (uint)local_8c); } local_14 = 0xffffffff; if (local_98[0] == '\0') { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } if ((void *)local_98._4_4_ != (void *)0x0) { uVar6 = *(uint *)(local_98._4_4_ + -4); qVar2 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar6; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar2 < uVar6); free((void *)(local_98._4_4_ + -4)); } local_14 = 0xffffffff; } } } else { update_endpoint_and_hits(this); } local_70.y = this->_impactDistance; impactDistanceClass = fdclass(local_70.y); if ((impactDistanceClass < 1) || (this->_isGridHit != 0)) { bVar11 = true; } else { bVar11 = false; } if ((isHitFrame != '\0') && (bVar11)) { impact_tear_flag_effects(this,&this->_impactPosition,&this->_impactDirection); } ExceptionList = local_1c; return; } //@@ 0097ca90 Entity_Laser::RenderShadowLayer /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 6] prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Entity_Laser::RenderShadowLayer(Entity_Laser *this,Vector *offset) { byte *layerName; byte bVar1; char isLastRef; int iVar2; LayerState *layer; int *sheetTexture; AnimationState *layerFrame; float *pfVar3; undefined *shader; BitSet128 *maskedFlags; BitSet128 **clampedRatio; undefined4 *layerTexture; EntityPtr spawnerRoot; KColor *color; uint size; float *pfVar4; float fVar5; float fVar6; float fVar7; float fVar8; float shrinkScale; float fVar9; float fVar10; double dVar11; Vector *bottomRight; KColor *imageRefCount; undefined8 uVar12; undefined1 auStack_21e [2]; undefined1 quad [112]; BitSet128 shrinkFlagTest; BitSet128 growFlagTest; void *local_184; float local_180; float local_17c; float local_178; void *local_174; float local_170; float local_16c; float local_168; undefined1 local_164; Vector quadCorner1; Vector quadCorner2; Vector quadCorner3; int *shadowTexture; int *local_144; KColor vertexColor; ANM2 *laserSprite; float shadowAlpha; float endLeftX; BitSet128 *local_120; Vector local_11c; float endRightX; float local_110; float startRightX; BitSet128 *local_108; Entity_Laser *local_104; float local_100; float offsetX; Vector VStack_f8; float local_f0; float local_ec; float local_e8; float local_e4; float local_e0; float local_dc; BitSet128 *local_d8; float local_d4; float *points; float *pointsEnd; float *pointsCapacity; float local_c4; float local_c0; float local_bc; float local_b8; void *local_b4; float local_b0; undefined1 frameCopy [24]; float local_94; ColorMod shaderColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; void *samplesBegin; local_8 = -NAN; puStack_c = &LAB_00b0cc46; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&shaderColor)[1]._colorize; if (this->_visible == 0) { return 1; } if ((char)this->_sampleLaser < '\0') { return 1; } fVar5 = 1.0; spawnerRoot = this->_spawnerEntity; shadowAlpha = 1.0; if (spawnerRoot != (EntityPtr)0x0) { for (; *(EntityPtr *)((int)spawnerRoot + 0x3c8) != (EntityPtr)0x0; spawnerRoot = *(EntityPtr *)((int)spawnerRoot + 0x3c8)) { } } ExceptionList = &local_10; local_104 = this; iVar2 = __RTDynamicCast(spawnerRoot,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor); if (iVar2 != 0) { if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(iVar2 + 0x1618)); if (bVar1 == 0) { FUN_00925df0(); shadowAlpha = fVar5; } } } if (this->_sampleLaser == 0) { ExceptionList = local_10; return 1; } laserSprite = &this->_sprite; layer = ANM2::GetLayer(laserSprite,(byte *)0x0); sheetTexture = LayerState::GetTexture(layer,&local_dc); iVar2 = *sheetTexture; local_8 = 0.0; if (((local_d8 != (BitSet128 *)0x0) && (isLastRef = (**(code **)((int)local_d8->_l + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_8 = -NAN; if (iVar2 == 0) { KAGE_LogMessage(1,(byte *)"[warn] Laser::RenderShadowLayer sprite sheet is not loaded\n"); ExceptionList = local_10; return 1; } layerName = (byte *)(uint)(1 < (uint)(this->_sprite)._layerCount); layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,(int)layerName); if (layerFrame == (AnimationState *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] Laser::Render current laser frame is NULL\n"); ExceptionList = local_10; return 1; } AnimationState::copy_assign((AnimationState *)frameCopy,layerFrame); layer = ANM2::GetLayer(&this->_sprite,layerName); points = (float *)0x0; pointsEnd = (float *)0x0; pointsCapacity = (float *)0x0; local_c4 = local_94 * (this->_sprite)._scale.x * (layer->_size).x; local_8 = 1.4013e-45; std::vector<8byte>::reserve(); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_wrapSMode = 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); layer->_wrapTMode = 0; layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); LayerState::GetTexture(layer,&shadowTexture); local_8 = (float)CONCAT31(local_8._1_3_,2); local_b4 = (this->_homingLaser)._samples._begin; offsetX = (this->_posOffset).x * 0.65; local_100 = (float)frameCopy._8_4_ * 0.5; local_f0 = 0.0; if ((int)(this->_homingLaser)._samples._end - (int)local_b4 >> 3 != 1) { local_ec = -local_100; do { pfVar3 = pointsEnd; VStack_f8.y = (float)((int)local_f0 * 8); local_b8 = *(float *)((int)local_b4 + (int)local_f0 * 8 + 8) - *(float *)((int)local_b4 + (int)VStack_f8.y); local_bc = *(float *)((int)local_b4 + (int)VStack_f8.y + 0xc) - *(float *)((int)local_b4 + (int)VStack_f8.y + 4); fVar5 = sqrtf(local_bc * local_bc + local_b8 * local_b8); local_bc = local_bc / fVar5; local_b8 = -(local_b8 / fVar5); pfVar4 = (float *)((int)local_b4 + (int)VStack_f8.y); local_c0 = (*(float *)((int)local_b4 + (int)VStack_f8.y + 4) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_b4 = (void *)(g_displayPixelRatio * g_screenPointScale); local_b0 = ((*pfVar4 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_d4 = (float)dVar11 / (float)local_b4; local_b0 = local_c0 * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_b0 = (float)dVar11; local_e8 = local_bc * local_100 * local_c4; local_e4 = local_b8 * local_100 * local_c4; local_dc = local_e8 + local_d4; local_d8 = (BitSet128 *)(local_e4 + local_b0 / (float)local_b4); if (pfVar3 == pointsCapacity) { std::vector::_Emplace_reallocate(); } else { *pfVar3 = local_dc; pfVar3[1] = (float)local_d8; pointsEnd = pfVar3 + 2; } pfVar4 = pointsEnd; pfVar3 = (float *)((int)(this->_homingLaser)._samples._begin + (int)VStack_f8.y); local_c0 = (pfVar3[1] - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_b4 = (void *)(g_displayPixelRatio * g_screenPointScale); local_b0 = ((*pfVar3 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_d4 = (float)dVar11 / (float)local_b4; local_b0 = local_c0 * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_b0 = (float)dVar11; local_bc = local_bc * local_ec * local_c4; local_b8 = local_b8 * local_ec * local_c4; startRightX = local_bc + local_d4; local_108 = (BitSet128 *)(local_b8 + local_b0 / (float)local_b4); if (pfVar4 == pointsCapacity) { std::vector::_Emplace_reallocate(); } else { *pfVar4 = startRightX; pfVar4[1] = (float)local_108; pointsEnd = pfVar4 + 2; } pfVar4 = pointsEnd; samplesBegin = (this->_homingLaser)._samples._begin; local_c0 = (*(float *)((int)VStack_f8.y + 0xc + (int)samplesBegin) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_b4 = (void *)(g_displayPixelRatio * g_screenPointScale); local_b0 = ((*(float *)((int)VStack_f8.y + 8 + (int)samplesBegin) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_d4 = (float)dVar11 / (float)local_b4; local_b0 = local_c0 * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_b0 = (float)dVar11; local_120 = (BitSet128 *)(local_e4 + local_b0 / (float)local_b4); endLeftX = local_e8 + local_d4; if (pfVar4 == pointsCapacity) { std::vector::_Emplace_reallocate(); } else { *pfVar4 = endLeftX; pfVar4[1] = (float)local_120; pointsEnd = pfVar4 + 2; } pfVar4 = pointsEnd; samplesBegin = (this->_homingLaser)._samples._begin; iVar2 = (int)VStack_f8.y + 8; VStack_f8.y = (*(float *)((int)VStack_f8.y + 0xc + (int)samplesBegin) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5; local_b4 = (void *)(g_displayPixelRatio * g_screenPointScale); local_b0 = ((*(float *)(iVar2 + (int)samplesBegin) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_c0 = (float)dVar11 / (float)local_b4; local_b0 = VStack_f8.y * (float)local_b4 + 0.5; dVar11 = floor((double)local_b0); local_b0 = (float)dVar11; local_110 = local_b8 + local_b0 / (float)local_b4; endRightX = local_bc + local_c0; if (pfVar4 == pointsCapacity) { std::vector::_Emplace_reallocate(); } else { *pfVar4 = endRightX; pfVar4[1] = local_110; pointsEnd = pfVar4 + 2; } local_b4 = (this->_homingLaser)._samples._begin; local_f0 = (float)((int)local_f0 + 1); } while ((uint)local_f0 < ((int)(this->_homingLaser)._samples._end - (int)local_b4 >> 3) - 1U); } iVar2 = this->_subtype; if (((iVar2 == 1) || (iVar2 == 2)) || (iVar2 == 3)) { std::vector::erase(&local_d8); std::vector::_Insert_n(pointsEnd,points); } pfVar4 = pointsEnd; local_ec = 0.0; bVar1 = is_thick_variant(this); if (((bVar1 != 0) || (this->_variant == 5)) || (this->_variant == 8)) { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } fVar5 = (float)((int)pfVar4 - (int)points >> 3); local_b0 = 0.0; g_currentShader = shader; if (fVar5 != 0.0) { pfVar4 = points + 0xb; do { if ((uint)local_b0 < (int)fVar5 - 4U) { pfVar4[-7] = (pfVar4[-3] + pfVar4[-7]) * 0.5; pfVar4[-6] = (pfVar4[-2] + pfVar4[-6]) * 0.5; pfVar4[-5] = (pfVar4[-1] + pfVar4[-5]) * 0.5; pfVar4[-4] = (*pfVar4 + pfVar4[-4]) * 0.5; } if (local_b0 == 0.0) { local_e4 = pfVar4[-10]; } else { pfVar4[-0xb] = pfVar4[-0xf]; local_e4 = pfVar4[-0xe]; pfVar4[-10] = local_e4; pfVar4[-9] = pfVar4[-0xd]; pfVar4[-8] = pfVar4[-0xc]; } local_c4 = g_displayPixelRatio * g_screenPointScale; local_b4 = (void *)((((*(float *)((int)g_game->_room + 0x20) + 20.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_c4 + 0.5); dVar11 = floor((double)(float)local_b4); local_b4 = (void *)(float)dVar11; if ((local_e4 <= (float)local_b4 / local_c4) && (local_d4 = pfVar4[-8], local_d4 <= (float)local_b4 / local_c4)) { local_b8 = pfVar4[-0xb]; local_bc = pfVar4[-9]; local_100 = pfVar4[-6]; local_e0 = pfVar4[-5]; local_c0 = pfVar4[-4]; local_e8 = pfVar4[-7]; local_c4 = (local_b8 + local_bc) * 0.5; local_f0 = (local_e4 + local_d4) * 0.5; VStack_f8.y = (local_e0 + local_e8) * 0.5; local_110 = (local_100 + local_c0) * 0.5; local_b4 = (void *)sqrtf((local_110 - local_f0) * (local_110 - local_f0) + (VStack_f8.y - local_c4) * (VStack_f8.y - local_c4)); local_d8 = &local_104->_tearFlags; maskedFlags = BitSet128::operator_and(&growFlagTest,local_d8,(BitSet128 *)&DAT_00c34b30); if ((((int)maskedFlags->_l == 0 && *(int *)((int)&maskedFlags->_l + 4) == 0) && ((int)maskedFlags->_h == 0 && *(int *)((int)&maskedFlags->_h + 4) == 0)) || (((iVar2 = local_104->_subtype, iVar2 == 1 || (iVar2 == 2)) || (iVar2 == 3)))) { fVar9 = local_e4; fVar6 = local_d4; fVar10 = local_100; fVar7 = local_c0; } else { local_108 = (BitSet128 *)0x3f800000; local_120 = (BitSet128 *)(local_ec / 1000.0); clampedRatio = &local_120; if (1.0 <= local_ec / 1000.0) { clampedRatio = &local_108; } local_120 = (BitSet128 *)0x3f800000; fVar6 = (float)*clampedRatio * 1.5 + 1.0; local_b8 = fVar6 * (local_b8 - local_c4) + local_c4; local_bc = fVar6 * (local_bc - local_c4) + local_c4; local_108 = (BitSet128 *)(((float)local_b4 + local_ec) / 1000.0); clampedRatio = &local_108; if (1.0 <= (float)local_108) { clampedRatio = &local_120; } fVar7 = (float)*clampedRatio * 1.5 + 1.0; local_e8 = fVar7 * (local_e8 - VStack_f8.y) + VStack_f8.y; local_e0 = fVar7 * (local_e0 - VStack_f8.y) + VStack_f8.y; fVar9 = fVar6 * (local_e4 - local_f0) + local_f0; fVar6 = fVar6 * (local_d4 - local_f0) + local_f0; fVar10 = fVar7 * (local_100 - local_110) + local_110; fVar7 = fVar7 * (local_c0 - local_110) + local_110; } fVar8 = local_e8; maskedFlags = BitSet128::operator_and(&shrinkFlagTest,local_d8,(BitSet128 *)&DAT_00c34c40) ; if ((((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) && ((iVar2 = local_104->_subtype, iVar2 != 1 && ((iVar2 != 2 && (iVar2 != 3)))))) { local_108 = (BitSet128 *)0x3f800000; local_d8 = (BitSet128 *)(local_ec / 300.0); clampedRatio = &local_d8; if (1.0 <= local_ec / 300.0) { clampedRatio = &local_108; } local_108 = (BitSet128 *)0x3f800000; fVar8 = 1.0 - (float)*clampedRatio * 0.5; local_b8 = fVar8 * (local_b8 - local_c4) + local_c4; fVar9 = fVar8 * (fVar9 - local_f0) + local_f0; local_bc = fVar8 * (local_bc - local_c4) + local_c4; fVar6 = fVar8 * (fVar6 - local_f0) + local_f0; local_d8 = (BitSet128 *)(((float)local_b4 + local_ec) / 300.0); clampedRatio = &local_d8; if (1.0 <= (float)local_d8) { clampedRatio = &local_108; } shrinkScale = 1.0 - (float)*clampedRatio * 0.5; fVar8 = shrinkScale * (local_e8 - VStack_f8.y) + VStack_f8.y; fVar10 = shrinkScale * (fVar10 - local_110) + local_110; local_e0 = shrinkScale * (local_e0 - VStack_f8.y) + VStack_f8.y; fVar7 = shrinkScale * (fVar7 - local_110) + local_110; } local_170 = (float)local_b4 + local_ec; local_17c = (float)frameCopy._0_4_ + (float)frameCopy._8_4_; local_174 = (void *)frameCopy._0_4_; local_184 = (void *)frameCopy._0_4_; local_178 = local_ec; local_180 = local_ec; local_164 = 1; local_16c = local_17c; local_168 = local_170; local_ec = local_170; KColor::SetFromARGB(&vertexColor,0xffffffff); local_11c.x = offset->x; local_11c.y = offset->y; quadCorner3.x = local_11c.x + offsetX + fVar8; quadCorner3.y = local_11c.y + fVar10 + 0.0; bottomRight = &quadCorner3; quadCorner2.x = local_11c.x + offsetX + local_e0; quadCorner2.y = local_11c.y + fVar7 + 0.0; quadCorner1.x = local_11c.x + offsetX + local_b8; quadCorner1.y = local_11c.y + fVar9 + 0.0; local_11c.y = local_11c.y + fVar6 + 0.0; local_11c.x = local_11c.x + offsetX + local_bc; imageRefCount = color; set_quad_corner_colors(quad,&local_11c,&quadCorner1,&quadCorner2,bottomRight,color); shaderColor._tint[0] = 0.0; shaderColor._colorize[0] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._colorize[2] = 0.0; shaderColor._colorize[3] = 0.0; shaderColor._tint[1] = 0.0; shaderColor._tint[3] = shadowAlpha * 0.5; shaderColor._tint[2] = 0.0; shaderColor._offset[0] = 0.0; shaderColor._offset[1] = 0.0; shaderColor._offset[2] = 0.0; KAGE::SmartPointer::operator_assign(auStack_21e + -10,&shadowTexture); apply_sprite_shader_params(&shaderColor,1,bottomRight,imageRefCount); vertexColor._unk = 0; vertexColor._red = shaderColor._tint[0]; vertexColor._green = shaderColor._tint[1]; vertexColor._blue = shaderColor._tint[2]; vertexColor._alpha = shaderColor._tint[3]; (**(code **)(*shadowTexture + 0x14))(&local_184); } pfVar4 = pfVar4 + 8; local_b0 = (float)((int)local_b0 + 4); } while ((uint)local_b0 < (uint)fVar5); this = local_104; } } if ((uint)(this->_sprite)._layerCount < 2) { LAB_0097e2ff: pfVar4 = points; } else { switch(this->_variant) { case 1: case 3: case 6: case 9: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: if (this->_subtype != 0) goto LAB_0097e2ff; layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); if (layerFrame == (AnimationState *)0x0) { KAGE_LogMessage(1,(byte *)"[warn] Laser::Render current frame is NULL\n"); FUN_0040c440(); if (points == (float *)0x0) { ExceptionList = local_10; return 1; } size = (int)pointsCapacity - (int)points & 0xfffffff8; pfVar3 = points; if (0xfff < size) { pfVar3 = (float *)points[-1]; size = size + 0x23; if (0x1f < (uint)((int)points + (-4 - (int)pfVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto code_r0x0097e364; } AnimationState::copy_assign((AnimationState *)frameCopy,layerFrame); layer = ANM2::GetLayer(&this->_sprite,(byte *)0x0); pfVar4 = (this->_homingLaser)._samples._begin; local_180 = (float)frameCopy._4_4_ + 0.01; local_170 = (float)frameCopy._12_4_ + (float)frameCopy._4_4_; local_c4 = local_94 * (layer->_size).x * (this->_sprite)._scale.x; local_164 = 1; local_17c = (float)frameCopy._8_4_ + (float)frameCopy._0_4_; local_174 = (void *)frameCopy._0_4_; local_184 = (void *)frameCopy._0_4_; local_11c.x = *pfVar4 - (this->_pos).x; local_11c.y = pfVar4[1] - (this->_pos).y; local_178 = local_180; local_16c = local_17c; local_168 = local_170; Vector::Normalized(&local_11c,&VStack_f8); local_104 = (Entity_Laser *)((uint)VStack_f8.x ^ 0x80000000); local_108 = (BitSet128 *)(VStack_f8.y * (float)frameCopy._20_4_); fVar9 = VStack_f8.x * (float)frameCopy._20_4_; local_b4 = (void *)((float)frameCopy._8_4_ * 0.5); fVar5 = VStack_f8.y; KColor::SetFromARGB(&vertexColor,0xffffffff); pfVar4 = points; local_11c.x = VStack_f8.x * 0.005 + offset->x + offsetX + *points; local_11c.y = fVar5 * 0.005 + offset->y + points[1] + 0.0; quadCorner1.x = VStack_f8.x * 0.005 + offset->x + offsetX + points[2]; quadCorner1.y = fVar5 * 0.005 + offset->y + points[3] + 0.0; local_b0 = g_displayPixelRatio * g_screenPointScale; local_d8 = (BitSet128 *) ((((fVar9 + (this->_pos).x) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_b0 + 0.5); dVar11 = floor((double)(float)local_d8); local_120 = (BitSet128 *)((float)dVar11 / local_b0); local_d8 = (BitSet128 *) (((((float)local_108 + (this->_pos).y) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_b0 + 0.5); dVar11 = floor((double)(float)local_d8); local_d8 = (BitSet128 *)(float)dVar11; quadCorner2.x = offset->x + offsetX + (float)local_120 + local_c4 * (float)local_b4 * VStack_f8.y; quadCorner2.y = offset->y + (float)local_d8 / local_b0 + local_c4 * (float)local_104 * (float)local_b4 + 0.0; quadCorner3.x = offset->x + offsetX + (float)local_120 + local_c4 * -(float)local_b4 * VStack_f8.y; quadCorner3.y = offset->y + (float)local_d8 / local_b0 + local_c4 * (float)local_104 * -(float)local_b4 + 0.0; set_quad_corner_colors(quad,&quadCorner3,&quadCorner2,&quadCorner1,&local_11c,&vertexColor); FUN_00682260(); shaderColor._colorize[0] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._colorize[2] = 0.0; shaderColor._colorize[3] = 0.0; shaderColor._tint[3] = shadowAlpha * 0.5; shaderColor._tint[0] = 0.0; shaderColor._tint[1] = 0.0; shaderColor._tint[2] = 0.0; shaderColor._offset[0] = 0.0; shaderColor._offset[1] = 0.0; shaderColor._offset[2] = 0.0; uVar12 = 0x97e28d; layer = ANM2::GetLayer(laserSprite,(byte *)0x0); LayerState::GetTexture(layer,auStack_21e + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar12,(void *)((ulonglong)uVar12 >> 0x20)); layer = ANM2::GetLayer(laserSprite,(byte *)0x0); layerTexture = LayerState::GetTexture(layer,&local_11c); local_8 = (float)CONCAT31(local_8._1_3_,3); vertexColor._unk = 0; vertexColor._red = shaderColor._tint[0]; vertexColor._green = shaderColor._tint[1]; vertexColor._blue = shaderColor._tint[2]; vertexColor._alpha = shaderColor._tint[3]; (**(code **)(*(int *)*layerTexture + 0x14))(&local_184); FUN_0040c440(); break; default: goto LAB_0097e2ff; } } local_8 = (float)CONCAT31(local_8._1_3_,4); if (((local_144 != (int *)0x0) && (isLastRef = (**(code **)(*local_144 + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } if (pfVar4 == (float *)0x0) { ExceptionList = local_10; return 1; } size = (int)pointsCapacity - (int)pfVar4 & 0xfffffff8; pfVar3 = pfVar4; if (0xfff < size) { pfVar3 = (float *)pfVar4[-1]; size = size + 0x23; if (0x1f < (uint)((int)pfVar4 + (-4 - (int)pfVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } code_r0x0097e364: operator_delete(pfVar3,size); ExceptionList = local_10; return 1; } //@@ 0097e3b0 Entity_Laser::GetSamples /* ZHL [lua] Lua binding EntityLaser:GetSamples */ int Entity_Laser::GetSamples(void) { int in_ECX; return in_ECX + 0x480; } //@@ 0097e3c0 Entity_Laser::damage_entity /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: adds the entity to the hit list, then TakeDamage: player (1 player) 1.0 DAMAGE_LASER source = spawner, countdown 30; others laser damage with tear flag effects (dogma_effects.md) */ void __thiscall Entity_Laser::damage_entity(Entity_Laser *this,Entity *param_2) { uint *puVar1; byte bVar2; std_vector *hitList; uint uVar3; int *piVar4; int iVar5; BitSet128 *maskedFlags; EntityPtr extraout_ECX; EntityPtr unused; code *takeDamageFn; float in_XMM2_Da; float fVar6; uint uVar7; int unused2; EntityRef sourceRef; RNG local_38; BitSet128 *tearFlags; uint damageFlagsLo; uint damageFlagsHi; EntityPtr local_18; float local_14; uint local_10; uint securityCookie; undefined1 auStack_8 [4]; qword flags; Manager *manager; securityCookie = __security_cookie ^ (uint)(auStack_8 + 4); local_14 = in_XMM2_Da; if (this->_parentLaser == (EntityPtr)0x0) { hitList = &this->_hitList; } else { hitList = (std_vector *)FUN_0096ce70(); } uVar3 = Entity::GetHitListIndex(param_2); unused2 = 0x97e405; sorted_vector_insert_unique(hitList,uVar3); iVar5 = param_2->_type; if (iVar5 == 4) { return; } local_18 = (EntityPtr)this; if (this->_spawnerEntity != (EntityPtr)0x0) { local_18 = this->_spawnerEntity; } if (iVar5 == 1) { if (*(int *)&g_game->_deathmatchManager < 2) { piVar4 = (int *)__RTDynamicCast(param_2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); takeDamageFn = *(code **)(*piVar4 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)local_18); uVar3 = 8; fVar6 = 1.0; uVar7 = 0; goto LAB_0097e6ba; } unused2 = 0x97e480; bVar2 = Entity::IsDescendantOf((Entity *)this,param_2); unused = extraout_ECX; if (bVar2 != 0) { return; } } else { unused = local_18; if ((iVar5 == 3) && (((unused = (EntityPtr)param_2->_variant, unused == (EntityPtr)0x3e || ((g_game->_challenge == 0x1e && (unused == (EntityPtr)0x43)))) && (*(int *)&g_game->_deathmatchManager < 2)))) { iVar5 = __RTDynamicCast(param_2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); takeDamageFn = *(code **)(**(int **)(iVar5 + 0x410) + 0x20); EntityRef::constructor(&sourceRef,(Entity *)local_18); uVar7 = 0; uVar3 = 0x808; fVar6 = 1.0; goto LAB_0097e6ba; } } damageFlagsLo = 8; damageFlagsHi = 0; tearFlags = &this->_tearFlags; get_tear_flags_from_player ((ulonglong *)&damageFlagsLo,(int)unused,this->_tearFlags,unused2,(Entity *)this); Entity_Tear::ApplyTearFlagEffects(param_2,&this->_pos,this->_tearFlags,(Entity *)this,local_14); if (((param_2->_flags & 0x100000000000000) != 0) && (bVar2 = is_thick_variant(this), manager = g_manager, bVar2 != 0)) { local_10 = 0x4d; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,local_10,0.7,8,0,1.0,0.0); flags = param_2->_flags; puVar1 = (uint *)((int)¶m_2->_flags + 4); *puVar1 = *puVar1 | 0x800000; *(int *)¶m_2->_flags = (int)flags; local_14 = local_14 + local_14 + 3.0; } if ((this->_blackHpDropChance <= 0.0) || (bVar2 = Entity::IsActiveEnemy(param_2,0), bVar2 == 0)) { LAB_0097e656: uVar3 = damageFlagsLo; } else { local_38._seed = param_2->_initSeed; local_38._shift1 = 1; local_38._shift2 = 5; local_38._shift3 = 0x13; fVar6 = RNG::RandomFloat(&local_38); if (this->_blackHpDropChance <= fVar6) goto LAB_0097e656; uVar3 = damageFlagsLo | 0x800000; } uVar7 = damageFlagsHi; local_10 = damageFlagsHi; if ((1 < *(int *)&g_game->_deathmatchManager) && ((maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_38,tearFlags,(BitSet128 *)&DAT_00c345d0), (int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0 || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)))) { local_10 = uVar7 | 8; } takeDamageFn = *(code **)(*(int *)param_2 + 0x20); EntityRef::constructor(&sourceRef,(Entity *)local_18); fVar6 = local_14; uVar7 = local_10; LAB_0097e6ba: (*takeDamageFn)(fVar6,uVar3,uVar7,&sourceRef,0x1e); return; } //@@ 0097e6e0 Entity_Laser::GetNonOptimizedSamples /* ZHL [lua] Lua binding EntityLaser:GetNonOptimizedSamples */ int Entity_Laser::GetNonOptimizedSamples(void) { int in_ECX; return in_ECX + 0x48c; } //@@ 0097e6f0 Entity_Laser::Interpolate /* ZHL [vtable slot 4] */ void __thiscall Entity_Laser::Interpolate(Entity_Laser *this) { float fVar1; int iVar2; if ((this->_waitFrames < 1) && (this->_isFirstUpdate == 0)) { this->_isInterpolating = 1; (this->_preInterpolatePos).x = (this->_pos).x; (this->_preInterpolatePos).y = (this->_pos).y; iVar2 = this->_subtype; if ((iVar2 == 1) || (iVar2 == 2)) { fVar1 = this->_friction; (this->_pos).x = fVar1 * (this->_velocity).x * 0.5 + (this->_pos).x; (this->_pos).y = fVar1 * (this->_velocity).y * 0.5 + (this->_pos).y; } else if (iVar2 != 3) { update_laser(); return; } UpdateHits(this); } return; } //@@ 0097e7a0 Entity_Laser::CanOverwrite /* ZHL [vtable slot 14] */ uint __thiscall Entity_Laser::CanOverwrite(Entity_Laser *this) { uint uVar1; uVar1 = (uint)this->_flags & 0x200000; if ((uVar1 == 0) && (this->_isFirstUpdate == 0)) { return 1; } return uVar1; } //@@ 0097e7c0 FUN_0097e7c0 undefined4 FUN_0097e7c0(void) { int iVar1; Entity *in_ECX; if (((in_ECX->_variant == 7) || (in_ECX->_isInterpolating != 0)) || (in_ECX->_dead != 0)) { return 0; } if ((in_ECX[1]._sprite._filename._buf[8] == '\0') && (iVar1 = Entity::GetIntervalTicks(in_ECX,2.0,0.0), iVar1 == 0)) { return 0; } return 1; } //@@ 0097e800 Entity_Laser::ClearReferences /* ZHL [vtable slot 17] */ void __thiscall Entity_Laser::ClearReferences(Entity_Laser *this) { EntityPtr *pEVar1; int iVar2; Entity_Laser *pEVar3; Entity_Laser *local_8; local_8 = this; Entity::ClearReferences((Entity *)this); pEVar3 = (Entity_Laser *)this->_multidimensionalLasers; iVar2 = 2; do { if ((this->_removedByFactory != 0) && (*(int **)pEVar3 != (int *)0x0)) { (**(code **)(**(int **)pEVar3 + 0x28))(); (**(code **)(**(int **)pEVar3 + 0x44))(); } if (*(int *)pEVar3 != 0) { local_8 = pEVar3; std::multiset::erase(&local_8); } *(int *)pEVar3 = 0; pEVar3 = (Entity_Laser *)&pEVar3->field_0x4; iVar2 = iVar2 + -1; } while (iVar2 != 0); pEVar3 = (Entity_Laser *)this->_prismLasers; iVar2 = 4; do { if ((this->_removedByFactory != 0) && (*(int **)pEVar3 != (int *)0x0)) { (**(code **)(**(int **)pEVar3 + 0x28))(); (**(code **)(**(int **)pEVar3 + 0x44))(); } if (*(int *)pEVar3 != 0) { local_8 = pEVar3; std::multiset::erase(&local_8); } *(int *)pEVar3 = 0; pEVar3 = (Entity_Laser *)&pEVar3->field_0x4; iVar2 = iVar2 + -1; } while (iVar2 != 0); if ((this->_removedByFactory != 0) && (this->_bounceLaser != (int *)0x0)) { (**(code **)(*(int *)this->_bounceLaser + 0x28))(); (**(code **)(*(int *)this->_bounceLaser + 0x44))(); } if (this->_bounceLaser != (void *)0x0) { local_8 = (Entity_Laser *)&this->_bounceLaser; std::multiset::erase(&local_8); } this->_bounceLaser = (void *)0x0; if ((this->_removedByFactory != 0) && (this->_childLaser != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_childLaser + 0x28))(); (**(code **)(*(int *)this->_childLaser + 0x44))(); } if (this->_childLaser != (EntityPtr)0x0) { local_8 = (Entity_Laser *)&this->_childLaser; std::multiset::erase(&local_8); } this->_childLaser = (EntityPtr)0x0; pEVar1 = &this->_parentLaser; if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Entity_Laser *)pEVar1; std::multiset::erase(&local_8); *pEVar1 = (EntityPtr)0x0; } pEVar3 = (Entity_Laser *)this->_subLasers; iVar2 = 2; do { if ((this->_removedByFactory != 0) && (*(int **)pEVar3 != (int *)0x0)) { (**(code **)(**(int **)pEVar3 + 0x28))(); (**(code **)(**(int **)pEVar3 + 0x44))(); } if (*(int *)pEVar3 != 0) { local_8 = pEVar3; std::multiset::erase(&local_8); *(int *)pEVar3 = 0; } pEVar3 = (Entity_Laser *)&pEVar3->field_0x4; iVar2 = iVar2 + -1; } while (iVar2 != 0); if ((this->_removedByFactory != 0) && (this->_continuumLaser != (EntityPtr)0x0)) { (**(code **)(*(int *)this->_continuumLaser + 0x28))(); (**(code **)(*(int *)this->_continuumLaser + 0x44))(); } if (this->_continuumLaser != (EntityPtr)0x0) { local_8 = (Entity_Laser *)&this->_continuumLaser; std::multiset::erase(&local_8); this->_continuumLaser = (EntityPtr)0x0; } if (this->_tearWaitEffect != (EntityPtr)0x0) { local_8 = (Entity_Laser *)&this->_tearWaitEffect; std::multiset::erase(&local_8); this->_tearWaitEffect = (EntityPtr)0x0; } return; } //@@ 0097ea30 Entity_Laser::Remove /* ZHL [exact] void Remove(); */ void __thiscall Entity_Laser::Remove(Entity_Laser *this) { EntityPtr EVar1; int *piVar2; EntityPtr *pEVar3; int iVar4; Entity::Remove((Entity *)this); pEVar3 = this->_multidimensionalLasers; iVar4 = 2; do { EVar1 = *pEVar3; if ((EVar1 != (EntityPtr)0x0) && (*(char *)((int)EVar1 + 0x172) != '\0')) { (**(code **)(*(int *)EVar1 + 0x28))(); } pEVar3 = pEVar3 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); pEVar3 = this->_prismLasers; iVar4 = 4; do { EVar1 = *pEVar3; if ((EVar1 != (EntityPtr)0x0) && (*(char *)((int)EVar1 + 0x172) != '\0')) { (**(code **)(*(int *)EVar1 + 0x28))(); } pEVar3 = pEVar3 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); if (this->_oneHit == 0) { piVar2 = this->_bounceLaser; if ((piVar2 != (int *)0x0) && (*(char *)((int)piVar2 + 0x172) != '\0')) { (**(code **)(*piVar2 + 0x28))(); } EVar1 = this->_childLaser; if ((EVar1 != (EntityPtr)0x0) && (*(char *)((int)EVar1 + 0x172) != '\0')) { (**(code **)(*(int *)EVar1 + 0x28))(); } pEVar3 = this->_subLasers; iVar4 = 2; do { EVar1 = *pEVar3; if ((EVar1 != (EntityPtr)0x0) && (*(char *)((int)EVar1 + 0x172) != '\0')) { (**(code **)(*(int *)EVar1 + 0x28))(); } pEVar3 = pEVar3 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); EVar1 = this->_continuumLaser; if ((EVar1 != (EntityPtr)0x0) && (*(char *)((int)EVar1 + 0x172) != '\0')) { (**(code **)(*(int *)EVar1 + 0x28))(); } } EVar1 = this->_child; if ((EVar1 != (EntityPtr)0x0) && (*(char *)((int)EVar1 + 0x172) != '\0')) { (**(code **)(*(int *)EVar1 + 0x28))(); } if ((this->_variant == 1) && (this->_spawnerType == 0x193)) { SFXManager::Stop(&g_manager->_sfxManager,0x3cb); } return; } //@@ 0097eb50 Entity_Laser::PostRender /* ZHL [vtable slot 7] */ void __thiscall Entity_Laser::PostRender(Entity_Laser *this) { void *pvVar1; int circleSegments; KColor *fromColor; int segment; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; double dVar12; double dVar13; uint sampleIndex; float nextSampleX; float nextSampleY; Vector circlePrevPoint; Vector leftEdgeEnd; Vector leftEdgeStart; Vector rightEdgeEnd; Vector edgeStart; Vector edgeEnd; uint collisionClass; float *firstSample; void *samples; if ((((((uint)g_game->_debugFlags >> 5 & 1) != 0) && (0.0 < this->_size)) && (this->_entityCollisionClass != 0)) && (-1 < (char)this->_sampleLaser)) { if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c942b0) && (_Init_thread_header(), DAT_00c942b0 == -1)) { KColor::SetFromARGB((KColor *)&DAT_00c942b8,0xff000000); KColor::SetFromARGB((KColor *)&DAT_00c942cc,0xffffa500); KColor::SetFromARGB((KColor *)&DAT_00c942e0,0xffffc0cb); KColor::SetFromARGB((KColor *)&DAT_00c942f4,0xff00ff00); KColor::SetFromARGB((KColor *)&DAT_00c94308,0xffff0000); _Init_thread_footer(); } collisionClass = this->_entityCollisionClass; if (((int)collisionClass < 1) || (4 < collisionClass)) { fromColor = (KColor *)&DAT_00c942b8; } else { fromColor = (KColor *)(&DAT_00c942b8 + collisionClass * 0x14); } if (this->_sampleLaser == 0) { fVar2 = this->_angleDegrees * 0.017453292; fVar3 = cos(fVar2); fVar2 = sin(fVar2); fVar6 = ABS((this->_posOffset).y) + this->_laserLength; fVar10 = cos(1.5707964); fVar5 = sin(1.5707964); fVar8 = g_displayPixelRatio * g_screenPointScale; fVar4 = (g_screenHeight - 182.0) * 0.5; fVar7 = (g_screenWidth - 338.0) * 0.5; fVar9 = (fVar10 * fVar3 - fVar5 * fVar2) * this->_size * 0.65; fVar11 = (fVar5 * fVar3 + fVar10 * fVar2) * this->_size * 0.65; dVar12 = floor((double)((((this->_pos).x - 60.0) * 0.65 + fVar7) * fVar8 + 0.5)); dVar13 = floor((double)((((this->_pos).y - 140.0) * 0.65 + fVar4) * fVar8 + 0.5)); pvVar1 = g_game->_room; fVar10 = (float)dVar13 / fVar8 + *(float *)((int)pvVar1 + 0x1208); fVar5 = (float)dVar12 / fVar8 + *(float *)((int)pvVar1 + 0x1204); dVar12 = floor((double)((((fVar6 * fVar3 + (this->_pos).x) - 60.0) * 0.65 + fVar7) * fVar8 + 0.5)); dVar13 = floor((double)((((fVar6 * fVar2 + (this->_pos).y) - 140.0) * 0.65 + fVar4) * fVar8 + 0.5)); fVar2 = (float)dVar12 / fVar8 + *(float *)((int)pvVar1 + 0x1204); edgeEnd.x = fVar2 - fVar9; fVar3 = (float)dVar13 / fVar8 + *(float *)((int)pvVar1 + 0x1208); edgeEnd.y = fVar3 - fVar11; edgeStart.x = fVar5 - fVar9; edgeStart.y = fVar10 - fVar11; render_color_quad(&edgeStart,&edgeEnd,fromColor,fromColor,1.0); edgeEnd.x = fVar2 + fVar9; edgeStart.x = fVar9 + fVar5; edgeEnd.y = fVar3 + fVar11; edgeStart.y = fVar11 + fVar10; render_color_quad(&edgeStart,&edgeEnd,fromColor,fromColor,1.0); } else { sampleIndex = 0; if ((int)(this->_homingLaser)._samples._end - (int)(this->_homingLaser)._samples._begin >> 3 != 1) { fVar2 = cos(1.5707964); fVar3 = sin(1.5707964); pvVar1 = (this->_homingLaser)._samples._end; do { samples = (this->_homingLaser)._samples._begin; fVar6 = *(float *)((int)samples + sampleIndex * 8); fVar10 = *(float *)((int)samples + sampleIndex * 8 + 4); nextSampleX = *(float *)((int)samples + sampleIndex * 8 + 8); nextSampleY = *(float *)((int)samples + sampleIndex * 8 + 0xc); if (((((this->_subtype != 1) && (this->_subtype != 2)) && (this->_subtype != 3)) && ((sampleIndex == ((int)pvVar1 - (int)samples >> 3) - 2U && (this->_isGridHit == 0)))) && (this->_maxDistance <= 0.0)) { fVar5 = nextSampleY - fVar10; fVar7 = nextSampleX - fVar6; fVar4 = sqrtf(fVar5 * fVar5 + fVar7 * fVar7); if (0.0 < fVar4) { fVar5 = (40.0 / fVar4) * fVar5; fVar7 = (40.0 / fVar4) * fVar7; } nextSampleX = nextSampleX + fVar7; nextSampleY = nextSampleY + fVar5; } fVar4 = (g_screenHeight - 182.0) * 0.5; fVar5 = (g_screenWidth - 338.0) * 0.5; fVar7 = g_displayPixelRatio * g_screenPointScale; dVar12 = floor((double)(((fVar6 - 60.0) * 0.65 + fVar5) * fVar7 + 0.5)); dVar13 = floor((double)(((fVar10 - 140.0) * 0.65 + fVar4) * fVar7 + 0.5)); fVar6 = *(float *)((int)g_game->_room + 0x1204); fVar8 = fVar6 + (float)dVar12 / fVar7; fVar10 = *(float *)((int)g_game->_room + 0x1208); fVar9 = fVar10 + (float)dVar13 / fVar7; dVar12 = floor((double)(((nextSampleX - 60.0) * 0.65 + fVar5) * fVar7 + 0.5)); dVar13 = floor((double)(((nextSampleY - 140.0) * 0.65 + fVar4) * fVar7 + 0.5)); fVar6 = fVar6 + (float)dVar12 / fVar7; fVar10 = fVar10 + (float)dVar13 / fVar7; fVar4 = fVar6 - fVar8; fVar7 = fVar10 - fVar9; fVar5 = sqrtf(fVar4 * fVar4 + fVar7 * fVar7); if (0.0 < fVar5) { fVar7 = fVar7 * (1.0 / fVar5); fVar4 = fVar4 * (1.0 / fVar5); } fVar11 = (fVar2 * fVar4 - fVar3 * fVar7) * this->_size * 0.65; leftEdgeEnd.x = fVar6 - fVar11; leftEdgeStart.x = fVar8 - fVar11; fVar5 = (fVar3 * fVar4 + fVar2 * fVar7) * this->_size * 0.65; leftEdgeEnd.y = fVar10 - fVar5; leftEdgeStart.y = fVar9 - fVar5; render_color_quad(&leftEdgeStart,&leftEdgeEnd,fromColor,fromColor,1.0); rightEdgeEnd.x = fVar6 + fVar11; rightEdgeEnd.y = fVar10 + fVar5; edgeStart.y = fVar5 + fVar9; edgeStart.x = fVar8 + fVar11; render_color_quad(&edgeStart,&rightEdgeEnd,fromColor,fromColor,1.0); if (sampleIndex == 0) { switch(this->_variant) { case 1: case 3: case 6: case 9: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: fVar6 = this->_angleDegrees * 0.017453292; firstSample = (this->_homingLaser)._samples._begin; fVar5 = g_displayPixelRatio * g_screenPointScale; fVar10 = cos(fVar6); dVar12 = floor((double)((((*firstSample - fVar10 * 16.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar5 + 0.5)); fVar6 = sin(fVar6); dVar13 = floor((double)((((firstSample[1] - fVar6 * 16.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar5 + 0.5)); fVar6 = (float)dVar12 / fVar5 + *(float *)((int)g_game->_room + 0x1204); fVar5 = (float)dVar13 / fVar5 + *(float *)((int)g_game->_room + 0x1208); fVar10 = cos(0.0); circlePrevPoint.x = fVar10 * this->_size * 0.65 + fVar6; fVar10 = sin(0.0); fVar4 = (this->_size * 6.2831855) / 10.0; circlePrevPoint.y = fVar10 * this->_size * 0.65 + fVar5; if (fVar4 <= 2.0) { fVar4 = 2.0; } if (12.0 <= fVar4) { fVar4 = 12.0; } circleSegments = (int)fVar4; segment = 1; if (0 < circleSegments * 4) { do { fVar4 = (((float)segment * 180.0) / (float)(circleSegments * 2)) * 0.017453292; fVar10 = cos(fVar4); fVar10 = fVar10 * this->_size * 0.65 + fVar6; edgeEnd.x = fVar10; fVar4 = sin(fVar4); fVar4 = fVar4 * this->_size * 0.65 + fVar5; edgeEnd.y = fVar4; render_color_quad(&circlePrevPoint,&edgeEnd,fromColor,fromColor,1.0); segment = segment + 1; circlePrevPoint.x = fVar10; circlePrevPoint.y = fVar4; } while (segment <= circleSegments << 2); } } } pvVar1 = (this->_homingLaser)._samples._end; sampleIndex = sampleIndex + 1; } while (sampleIndex < ((int)pvVar1 - (int)(this->_homingLaser)._samples._begin >> 3) - 1U); return; } } } return; } //@@ 0097f820 Entity_Laser::spawn_impact_effect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: loads gfx/1000.050_brimstoneimpact_static.anm2, Spawn; callers update_laser and 009704a0 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Entity_Laser::spawn_impact_effect(Entity_Laser *this,int unused) { void **ppvVar1; undefined1 *puVar2; byte bVar3; uint seed; Entity *spawned; EntityPtr *pEVar4; byte *curAnimName; char *ptr; byte *wantedAnim; uint uVar5; EntityPtr EVar6; bool bVar7; undefined4 uVar8; TypeDescriptor *pTVar9; TypeDescriptor *pTVar10; undefined4 uVar11; byte *defaultAnim; EntityPtr *local_44; EntityPtr impactEffect; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int variant; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af85cd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; if (this->_exists == 0) { return; } variant = this->_variant; uVar5 = 0xffffffff; if ((variant == 2) && (this->_subtype != 4)) { uVar5 = -(uint)(this->_subtype != 0) & 5; } else { switch(variant) { case 1: case 3: case 6: case 9: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: if ((this->_spawnerType != 0x112) && (this->_subtype == 0)) { uVar5 = 1; if (variant == 3) { uVar5 = 2; } else { EVar6 = this->_parent; if ((EVar6 == (EntityPtr)0x0) || (((*(int *)((int)EVar6 + 0x28) != 0x27 || (*(int *)((int)EVar6 + 0x34) != 0x109)) && ((*(int *)((int)EVar6 + 0x28) != 0x44 || ((*(int *)((int)EVar6 + 0x2c) != 1 || (*(int *)((int)EVar6 + 0x30) != 1)))))))) { if ((variant == 0xb) || (((variant == 6 || (variant == 0xe)) || (variant == 0xf)))) { uVar5 = 6; } else if (variant == 0xc) { uVar5 = 7; } } else { uVar5 = 3; } } } } } EVar6 = this->_child; ppvVar1 = &local_1c; puVar2 = (undefined1 *)((int)register0x00000010 + -4); if (EVar6 != (EntityPtr)0x0) { if (*(uint *)((int)EVar6 + 0x30) == uVar5) { return; } ExceptionList = &local_1c; (**(code **)(*(int *)EVar6 + 0x28))(local_24); ppvVar1 = ExceptionList; puVar2 = puStack_20; if (this->_child != (EntityPtr)0x0) { ExceptionList = local_1c; return; } } puStack_20 = puVar2; ExceptionList = ppvVar1; if ((int)uVar5 < 0) { ExceptionList = local_1c; return; } seed = Random(); uVar11 = 0; pTVar10 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar9 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar8 = 0; spawned = Game::Spawn(g_game,1000,0x32,&this->_pos,&g_vectorZero,(Entity *)this,uVar5,seed); impactEffect = (EntityPtr)__RTDynamicCast(spawned,uVar8,pTVar9,pTVar10,uVar11); if (this->_child != (EntityPtr)0x0) { local_44 = &this->_child; std::multiset::erase(&local_44); } this->_child = impactEffect; if (impactEffect != (EntityPtr)0x0) { std::multiset::insert(&this->_child); } pEVar4 = (EntityPtr *)((int)impactEffect + 0x3bc); if (*(int *)((int)impactEffect + 0x3bc) != 0) { local_44 = pEVar4; std::multiset::erase(&local_44); } *pEVar4 = (EntityPtr)this; std::multiset::insert(pEVar4); EVar6 = impactEffect; if (uVar5 == 1) { if (this->_spawnerType == 0x3b6) { local_44 = (EntityPtr *)((int)impactEffect + 0x48); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x28; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/1000.050_brimstoneimpact_static.anm2",0x29); local_14 = 0; ANM2::Load((ANM2 *)((int)EVar6 + 0x48),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar5 = anm2Path._capacity + 1; ptr = (char *)anm2Path._buf._0_4_; if (0xfff < uVar5) { ptr = *(char **)(anm2Path._buf._0_4_ + -4); uVar5 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } defaultAnim = (byte *)((int)EVar6 + 0x60); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = anm2Path._buf._0_4_ & 0xffffff00; if (0xf < *(uint *)((int)EVar6 + 0x74)) { defaultAnim = *(byte **)defaultAnim; } curAnimName = *(byte **)&local_44[0xd].field_0x0; if (curAnimName == (byte *)0x0) { LAB_0097fb40: bVar3 = ANM2::SetAnimation((ANM2 *)((int)EVar6 + 0x48),defaultAnim,1); pEVar4 = local_44; if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(local_44 + 0xc)); *(undefined1 *)(pEVar4 + 0x11) = 1; EVar6 = impactEffect; } } else { if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } wantedAnim = defaultAnim; do { bVar3 = *curAnimName; bVar7 = bVar3 < *wantedAnim; if (bVar3 != *wantedAnim) { LAB_0097fb20: uVar5 = -(uint)bVar7 | 1; goto LAB_0097fb25; } if (bVar3 == 0) break; bVar3 = curAnimName[1]; bVar7 = bVar3 < wantedAnim[1]; if (bVar3 != wantedAnim[1]) goto LAB_0097fb20; curAnimName = curAnimName + 2; wantedAnim = wantedAnim + 2; } while (bVar3 != 0); uVar5 = 0; LAB_0097fb25: if ((uVar5 != 0) || ((*(char *)(*(int *)((int)EVar6 + 0x7c) + 0x34) != '\0' && (*(char *)((int)EVar6 + 0x8c) == '\0')))) goto LAB_0097fb40; } *(uint *)((int)EVar6 + 0x158) = *(uint *)((int)EVar6 + 0x158) | 0x20; } } else if ((uVar5 == 0) || (uVar5 == 5)) { if (this->_subtype == 3) { *(int *)((int)impactEffect + 0x358) = -0x3f600000; } goto LAB_0097fba2; } *(float *)((int)EVar6 + 0x358) = this->_renderDepthOffset + 5.0; LAB_0097fba2: (**(code **)(*(int *)EVar6 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1); *(byte *)((int)EVar6 + 0x171) = this->_visible; (**(code **)(*(int *)EVar6 + 0xc))(); ExceptionList = local_1c; return; } //@@ 0097fc10 Entity_Laser::ResetSpriteScale /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: sets 0xe4/0xe8 scale from 0x4e0, plays "Laser%d"; FireBrimstone callers prototype: REPENTOGON */ void __thiscall Entity_Laser::ResetSpriteScale(Entity_Laser *this) { float fVar1; code *pcVar2; byte bVar3; uint uVar4; byte *pbVar5; byte *pbVar6; byte *pbVar7; uint frame; int sizeIndex; bool isLess; float fVar8; byte animName [16]; undefined4 local_8; void *animData; local_8 = __security_cookie ^ (uint)(animName + 0x14); if (this->_variant != 2) { fVar1 = this->_scale; fVar8 = *(float *)((int)this->_config + 0x38); (this->_sprite)._scale.x = fVar1; (this->_sprite)._scale.y = fVar1; this->_size = fVar1 * fVar8; return; } sizeIndex = 0; uVar4 = 0; do { if (this->_scale < *(float *)((int)&DAT_00b7cd30 + uVar4)) break; uVar4 = uVar4 + 4; sizeIndex = sizeIndex + 1; } while (uVar4 < 0xc); this->_size = this->_scale * *(float *)((int)this->_config + 0x38); sprintf(animName,(byte *)"Laser%d"); fVar1 = *(float *)(&UNK_00b7cd20 + sizeIndex * 4); fVar8 = this->_scale * g_vectorOne.y; (this->_sprite)._scale.x = (this->_scale * g_vectorOne.x) / fVar1; (this->_sprite)._scale.y = fVar8 / fVar1; if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { if (animName[0] == 0) { return; } pbVar5 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pbVar6 = animName; do { bVar3 = *pbVar5; isLess = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_0097fd00: uVar4 = -(uint)isLess | 1; goto LAB_0097fd05; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; isLess = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_0097fd00; pbVar5 = pbVar5 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0097fd05: if (uVar4 == 0) { return; } } pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 != (byte *)0x0) { pbVar6 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar6 = *(byte **)pbVar5; } pbVar7 = animName; do { bVar3 = *pbVar6; isLess = bVar3 < *pbVar7; if (bVar3 != *pbVar7) { LAB_0097fd41: uVar4 = -(uint)isLess | 1; goto LAB_0097fd46; } if (bVar3 == 0) break; bVar3 = pbVar6[1]; isLess = bVar3 < pbVar7[1]; if (bVar3 != pbVar7[1]) goto LAB_0097fd41; pbVar6 = pbVar6 + 2; pbVar7 = pbVar7 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_0097fd46: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0097fd78; } bVar3 = ANM2::SetAnimation(&this->_sprite,animName,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0097fd78: animData = (this->_sprite)._animState._animData; uVar4 = this->_initSeed; if (animData == (void *)0x0) { frame = 0; } else { frame = *(uint *)((int)animData + 0x30); } if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar4 = uVar4 >> 4 ^ uVar4; uVar4 = uVar4 ^ uVar4 << 3; if (frame == 0) { frame = 0; } else { frame = (uVar4 >> 0x1b ^ uVar4) % frame; } if (animData == (void *)0x0) { return; } AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)frame); return; } //@@ 0097fe50 Entity_Laser::set_scale /* DB: writes +0x4e0 (_scale) from XMM1 then ResetSpriteScale (dogma_effects.md) */ void Entity_Laser::set_scale(void) { Entity_Laser *in_ECX; float in_XMM1_Da; in_ECX->_scale = in_XMM1_Da; ResetSpriteScale(in_ECX); return; } //@@ 0097fe60 Entity_Laser::update_sample_points /* DB: ? update_laser helper: walks +0x480 8-byte vector, angle +0x41c deg->rad, normalize_angle_degrees/atan2 */ void __thiscall Entity_Laser::update_sample_points(Entity_Laser *this,char param_2) { float *pfVar1; void *pvVar2; undefined1 isEffectVisible; uint sampleCount; int iVar3; float fVar4; float sinAngle; float fVar5; Vector VStack_2c; float fStack_24; Entity_Laser *colorSource; EntityPtr impactEffect; void *samplesBegin; impactEffect = this->_child; if (impactEffect == (EntityPtr)0x0) { return; } if (*(int *)((int)impactEffect + 0x28) != 1000) { return; } if ((this->_visible == 0) || (param_2 != '\0')) { isEffectVisible = 0; } else { isEffectVisible = 1; } *(undefined1 *)((int)impactEffect + 0x171) = isEffectVisible; fStack_24 = 1.4013e-45; VStack_2c.y = 0.0; VStack_2c.x = 3.57331e-43; colorSource = this->_bounceLaser; if (this->_bounceLaser == (Entity_Laser *)0x0) { colorSource = this; } (**(code **)(*(int *)impactEffect + 0x3c))(&(colorSource->_sprite)._color,0xffffffff); if (*(int *)((int)impactEffect + 0x30) == 0) { pvVar2 = (this->_homingLaser)._samples._begin; sampleCount = (int)(this->_homingLaser)._samples._end - (int)pvVar2 >> 3; if (sampleCount < 2) { fStack_24 = this->_angleDegrees * 0.017453292; fVar4 = cos(fStack_24); VStack_2c.x = fVar4 * this->_laserLength + (this->_pos).x; sinAngle = sin(fStack_24); fVar4 = this->_laserLength; fVar5 = (this->_pos).y; *(float *)((int)impactEffect + 0x33c) = VStack_2c.x; *(float *)((int)impactEffect + 0x340) = sinAngle * fVar4 + fVar5; *(float *)((int)impactEffect + 0x34c) = (this->_posOffset).x; *(float *)((int)impactEffect + 0x350) = (this->_posOffset).y; fVar4 = this->_angleDegrees - 90.0; goto LAB_0098039e; } *(int *)((int)impactEffect + 0x33c) = *(int *)((int)pvVar2 + sampleCount * 8 + -8); *(int *)((int)impactEffect + 0x340) = *(int *)((int)pvVar2 + sampleCount * 8 + -4); *(float *)((int)impactEffect + 0x34c) = (this->_posOffset).x; *(float *)((int)impactEffect + 0x350) = (this->_posOffset).y; samplesBegin = (this->_homingLaser)._samples._begin; iVar3 = (int)(this->_homingLaser)._samples._end - (int)pvVar2 >> 3; VStack_2c.x = *(float *)((int)samplesBegin + iVar3 * 8 + -0x10) - *(float *)((int)samplesBegin + iVar3 * 8 + -8); fStack_24 = *(float *)((int)samplesBegin + iVar3 * 8 + -0xc) - *(float *)((int)samplesBegin + iVar3 * 8 + -4); fVar4 = sqrtf(fStack_24 * fStack_24 + VStack_2c.x * VStack_2c.x); if (fVar4 <= 0.0) { fVar5 = fStack_24; fVar4 = VStack_2c.x; } else { fVar5 = fStack_24 * (1.0 / fVar4); fVar4 = VStack_2c.x * (1.0 / fVar4); } fVar4 = atan2f(fVar5,fVar4); fVar4 = fVar4 * 57.295776 + 90.0; } else { fVar4 = (this->_sprite)._scale.x; fVar5 = (this->_sprite)._scale.y; if (fVar4 <= 0.04) { *(undefined1 *)((int)impactEffect + 0x171) = 0; } else { fVar4 = fVar4 * 0.75 + 0.25; if ((this->_variant == 6) || (this->_variant == 0xf)) { if (*(int *)((int)impactEffect + 0x30) == 4) { fVar5 = fVar4; } else { fVar4 = fVar4 * 1.5; } } *(byte *)((int)impactEffect + 0x171) = this->_visible; *(float *)((int)impactEffect + 0xe4) = fVar4; *(float *)((int)impactEffect + 0xe8) = fVar5; } pvVar2 = this->_bounceLaser; if ((pvVar2 != (void *)0x0) && (fVar4 = *(float *)((int)pvVar2 + 0x340), pfVar1 = &(this->_pos).y, *pfVar1 <= fVar4 && fVar4 != *pfVar1)) { *(int *)((int)impactEffect + 0x33c) = *(int *)((int)pvVar2 + 0x33c); *(float *)((int)impactEffect + 0x340) = fVar4; *(float *)((int)impactEffect + 0x34c) = (this->_posOffset).x; *(float *)((int)impactEffect + 0x350) = (this->_posOffset).y; iVar3 = __RTDynamicCast(this->_bounceLaser,0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0); *(float *)((int)impactEffect + 0x358) = *(float *)(iVar3 + 0x358) + 5.0; pvVar2 = (this->_homingLaser)._samples._begin; sampleCount = (int)(this->_homingLaser)._samples._end - (int)pvVar2 >> 3; if (sampleCount < 2) { *(float *)((int)impactEffect + 0xec) = this->_angleDegrees + 90.0; return; } fStack_24 = *(float *)((int)pvVar2 + sampleCount * 8 + -0x10) - *(float *)((int)pvVar2 + sampleCount * 8 + -8); Vector::Normalized((Vector *)&fStack_24,&VStack_2c); fVar4 = atan2f(VStack_2c.y,VStack_2c.x); fVar4 = normalize_angle_degrees(fVar4 * 57.295776 - 90.0); *(float *)((int)impactEffect + 0xec) = fVar4; return; } pvVar2 = (this->_homingLaser)._samples._begin; sampleCount = (int)(this->_homingLaser)._samples._end - (int)pvVar2 >> 3; if (sampleCount < 2) { fStack_24 = this->_angleDegrees * 0.017453292; fVar4 = cos(fStack_24); VStack_2c.x = fVar4 * this->_laserLength + (this->_pos).x; sinAngle = sin(fStack_24); fVar4 = this->_laserLength; fVar5 = (this->_pos).y; *(float *)((int)impactEffect + 0x33c) = VStack_2c.x; *(float *)((int)impactEffect + 0x340) = sinAngle * fVar4 + fVar5; *(float *)((int)impactEffect + 0x34c) = (this->_posOffset).x; *(float *)((int)impactEffect + 0x350) = (this->_posOffset).y; fVar4 = this->_angleDegrees + 90.0; goto LAB_0098039e; } *(int *)((int)impactEffect + 0x33c) = *(int *)((int)pvVar2 + sampleCount * 8 + -8); *(int *)((int)impactEffect + 0x340) = *(int *)((int)pvVar2 + sampleCount * 8 + -4); *(float *)((int)impactEffect + 0x34c) = (this->_posOffset).x; *(float *)((int)impactEffect + 0x350) = (this->_posOffset).y; samplesBegin = (this->_homingLaser)._samples._begin; iVar3 = (int)(this->_homingLaser)._samples._end - (int)pvVar2 >> 3; fStack_24 = *(float *)((int)samplesBegin + iVar3 * 8 + -0x10) - *(float *)((int)samplesBegin + iVar3 * 8 + -8); VStack_2c.x = *(float *)((int)samplesBegin + iVar3 * 8 + -0xc) - *(float *)((int)samplesBegin + iVar3 * 8 + -4); fVar4 = sqrtf(fStack_24 * fStack_24 + VStack_2c.x * VStack_2c.x); if (fVar4 <= 0.0) { fVar5 = VStack_2c.x; fVar4 = fStack_24; } else { fVar5 = VStack_2c.x * (1.0 / fVar4); fVar4 = fStack_24 * (1.0 / fVar4); } fVar4 = atan2f(fVar5,fVar4); fVar4 = fVar4 * 57.295776 - 90.0; } if (360.0 < ABS(fVar4)) { fVar4 = fmodf(fVar4,360.0); } if (fVar4 <= 180.0) { if (fVar4 < -180.0) { fVar4 = fVar4 + 360.0; } } else { fVar4 = fVar4 - 360.0; } LAB_0098039e: *(float *)((int)impactEffect + 0xec) = fVar4; *(float *)((int)impactEffect + 0x358) = (this->_renderDepthOffset + 5.0 + (this->_pos).y) - *(float *)((int)impactEffect + 0x340); return; } //@@ 009803e0 std::vector::erase /* DB: 8-byte elements */ void std::vector::erase(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; int in_ECX; undefined4 *puVar2; if (param_2 != param_3) { puVar1 = *(undefined4 **)(in_ECX + 4); puVar2 = param_2; for (; param_3 != puVar1; param_3 = param_3 + 2) { *puVar2 = *param_3; puVar2[1] = param_3[1]; puVar2 = puVar2 + 2; } *(undefined4 **)(in_ECX + 4) = puVar2; } *param_1 = param_2; return; } //@@ 00980430 std::vector::_Insert_n /* DB: grow/insert 8-byte elems; laser render */ void std::vector::_Insert_n(int param_1,int param_2,int param_3) { uint uVar1; uint uVar2; uint *puVar3; int iVar4; int *in_ECX; int iVar5; uint uVar6; int iVar7; uint local_14; uVar6 = param_3 - param_2 >> 3; iVar7 = *in_ECX; iVar4 = in_ECX[1]; if (uVar6 != 0) { if ((uint)(in_ECX[2] - iVar4 >> 3) < uVar6) { iVar5 = iVar4 - iVar7 >> 3; if (0x1fffffffU - iVar5 < uVar6) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar5 + uVar6; uVar2 = in_ECX[2] - iVar7 >> 3; if (0x1fffffff - (uVar2 >> 1) < uVar2) { local_14 = 0x1fffffff; } else { uVar2 = uVar2 + (uVar2 >> 1); local_14 = uVar1; if (uVar1 <= uVar2) { local_14 = uVar2; } if (0x1fffffff < local_14) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar3 = _Allocate(local_14 << 3); iVar5 = param_1 - iVar7 >> 3; FUN_0042f550(param_2,param_3,puVar3 + iVar5 * 2); if ((uVar6 == 1) && (param_1 == iVar4)) { FUN_0042f6f0(iVar7,iVar4,puVar3); } else { FUN_0042f550(iVar7,param_1,puVar3); FUN_0042f550(param_1,iVar4,puVar3 + (iVar5 + uVar6) * 2); } FID_conflict__Change_array(in_ECX,puVar3,uVar1,local_14); return; } iVar7 = uVar6 * 8; if (uVar6 < (uint)(iVar4 - param_1 >> 3)) { iVar5 = iVar4 + uVar6 * -8; iVar4 = FUN_0042f550(iVar5,iVar4,iVar4); in_ECX[1] = iVar4; while (iVar5 != param_1) { iVar4 = iVar5 + -8; *(undefined4 *)(iVar7 + iVar4) = *(undefined4 *)(iVar5 + -8); *(undefined4 *)(iVar7 + 4 + iVar4) = *(undefined4 *)(iVar5 + -4); iVar5 = iVar4; } } else { iVar7 = FUN_0042f550(param_1,iVar4,iVar7 + param_1); in_ECX[1] = iVar7; } FUN_0042f550(param_2,param_3,param_1); } return; } //@@ 009805b0 std::set::insert /* DB: tree lower-bound on int key, returns {node, inserted}; Entity_Laser::find_nearest_grid_hit collects hit grid indices */ void std::set::insert(undefined4 *param_1,int *param_2) { char cVar1; int *piVar2; int iVar3; int *piVar4; bool bVar5; int *piVar6; int *piVar7; undefined4 *in_ECX; int *piVar8; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0cc7d; local_10 = ExceptionList; ExceptionList = &local_10; piVar2 = (int *)*in_ECX; bVar5 = false; local_14 = (int *)piVar2[1]; piVar7 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar6 = local_14; do { local_14 = piVar6; if (local_14[4] < *param_2) { piVar6 = (int *)local_14[2]; } else { piVar6 = (int *)*local_14; piVar7 = local_14; } bVar5 = *param_2 <= local_14[4]; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if ((*(char *)((int)piVar7 + 0xd) == '\0') && (piVar7[4] <= *param_2)) { *(undefined1 *)(param_1 + 1) = 0; } else { if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; piVar7 = operator_new(0x1c); piVar7[4] = *param_2; iVar3 = param_2[2]; piVar7[5] = param_2[1]; piVar7[6] = iVar3; *piVar7 = (int)piVar2; piVar7[1] = (int)piVar2; piVar7[2] = (int)piVar2; *(undefined2 *)(piVar7 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar7[1] = (int)local_14; if (local_14 == piVar2) { *piVar2 = (int)piVar7; piVar2[1] = (int)piVar7; piVar2[2] = (int)piVar7; *(undefined1 *)(piVar7 + 3) = 1; } else { if (bVar5) { *local_14 = (int)piVar7; if (local_14 == (int *)*piVar2) { *piVar2 = (int)piVar7; } } else { local_14[2] = (int)piVar7; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)piVar7; } } cVar1 = *(char *)(piVar7[1] + 0xc); piVar6 = piVar7; while (cVar1 == '\0') { piVar4 = (int *)piVar6[1]; piVar8 = *(int **)piVar4[1]; if (piVar4 == piVar8) { piVar8 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar8[3] == '\0') goto LAB_0098071a; if (piVar6 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar6 = piVar4; } *(undefined1 *)(piVar6[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar6[1] + 4)); } else if ((char)piVar8[3] == '\0') { LAB_0098071a: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; piVar6 = *(int **)(piVar6[1] + 4); } else { if (piVar6 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar6 = piVar4; } *(undefined1 *)(piVar6[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar6[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar6[1] + 4)); } cVar1 = *(char *)(piVar6[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; } *param_1 = piVar7; ExceptionList = local_10; return; } //@@ 009807a0 Game::ShowFortuneText /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: picks random line of string category ("Fortune_General") via string table RNG and shows it; ShowFortune/ShowRule prototype: db/protos.zhl, confirmed by RET 4 */ 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 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b0ccc5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(curLine + 0xb); ExceptionList = &local_10; local_40 = category; local_44 = rng; pbVar4 = (byte *)FUN_00a62e10(local_18); local_4c = pbVar4; std::map::find(&local_48,&local_4c); stringCount = (undefined4 ***)0x0; if (local_48 != (manager->_stringTable)._categories._head) { stringCount = local_48[6]; } if (pbVar4 != (byte *)0x0) { local_8 = (undefined4 ***)0x0; tracked_alloc(1,pbVar4,0); local_8 = (undefined4 ***)0xffffffff; } uVar5 = RNG::RandomInt(local_44,(uint)stringCount); pbVar4 = (byte *)StringTable::get_string_by_index (local_40,*(undefined4 *)&g_manager->_stringTable,uVar5); lines = (undefined4 *)0x0; lineCount = 0; local_4c = pbVar4; lines = operator_new(0x20); *lines = lines; lines[1] = lines; curLineSize = 0; curLineCapacity = 0xf; curLine[0] = (undefined4 ****)0x0; local_8 = (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; local_8._0_1_ = 3; newNode = operator_new(0x20); std::string::string((char *)(newNode + 2),curLine); local_8 = (undefined4 ***)CONCAT31(local_8._1_3_,2); lineCount = lineCount + 1; puVar2 = (undefined4 *)puVar3[1]; *newNode = puVar3; newNode[1] = puVar2; puVar3[1] = newNode; *puVar2 = newNode; ppppuVar6 = curLine; if (0xf < curLineCapacity) { ppppuVar6 = curLine[0]; } curLineSize = 0; *(undefined1 *)ppppuVar6 = 0; uVar5 = curLineCapacity; } else if (curLineSize < uVar9) { ppppuVar6 = curLine; if (0xf < uVar9) { ppppuVar6 = curLine[0]; } pbVar4 = (byte *)((int)ppppuVar6 + curLineSize); curLineSize = curLineSize + 1; *pbVar4 = ch; *(undefined1 *)((int)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 = (byte *)((int)local_48 + uVar7); local_44 = (RNG *)(uVar7 + 1 + (int)local_48); curLineCapacity = uVar5; if (uVar9 < 0x10) { memcpy(local_48,curLine,uVar7); *local_40 = ch; *(undefined1 *)&local_44->_seed = 0; } else { memcpy(local_48,ppppuVar6,uVar7); *local_40 = ch; uVar7 = uVar9 + 1; *(undefined1 *)&local_44->_seed = 0; ppppuVar8 = ppppuVar6; if (0xfff < uVar7) { ppppuVar8 = (undefined4 ****)ppppuVar6[-1]; uVar7 = uVar9 + 0x24; if ((undefined1 *)0x1f < (undefined1 *)((int)ppppuVar6 + (-4 - (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"); } local_8._0_1_ = 4; newNode = operator_new(0x20); std::string::string((char *)(newNode + 2),curLine); local_8 = (undefined4 ***)CONCAT31(local_8._1_3_,2); lineCount = lineCount + 1; puVar2 = (undefined4 *)puVar3[1]; *newNode = puVar3; newNode[1] = puVar2; puVar3[1] = newNode; *puVar2 = newNode; uVar5 = curLineCapacity; } } ppppuVar6 = curLine[0]; HUD::render_fortune_text(&g_game->_hud,&lines); if (0xf < uVar5) { uVar9 = uVar5 + 1; ppppuVar8 = ppppuVar6; if (0xfff < uVar9) { ppppuVar8 = (undefined4 ****)ppppuVar6[-1]; uVar9 = uVar5 + 0x24; if ((undefined1 *)0x1f < (undefined1 *)((int)ppppuVar6 + (-4 - (int)ppppuVar8))) { LAB_00980ad1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar8,uVar9); } *(undefined4 *)lines[1] = 0; puVar3 = (undefined4 *)*lines; while (puVar3 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar3; std::string::_Tidy_deallocate((char *)(puVar3 + 2)); operator_delete(puVar3,0x20); puVar3 = puVar2; } operator_delete(lines,0x20); ExceptionList = local_10; return; } //@@ 00980b40 Menu_Game::destructor /* DB: destroys the same ANM2s Menu_Game::LoadGraphics loads (+0x124, +0x10) and render target +0x238; MenuManager destructor 00986f30 MenuManager::~MenuManager void Menu_Game::destructor(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afb440; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 0x23c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x23c) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 0x238); } } local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x124)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x174)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x154)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x13c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x124)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x10)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x60)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x40)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x28)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x10)); ExceptionList = local_10; return; } //@@ 00980eb0 Menu_Game::LoadGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager::LoadGraphics: ANM2::Load gfx/ui/main menu/GameMenu.anm2 at +0x10 and ContinueProgress_Widget.anm2 at +0x124 */ void Menu_Game::LoadGraphics(void) { byte bVar1; byte *curAnimName; int in_ECX; byte *idleName; char *freeBlock; uint uVar2; bool bVar3; std_string menuAnmPath; std_string widgetAnmPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *animData; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af1f85; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; menuAnmPath._size = 0; menuAnmPath._capacity = 0xf; menuAnmPath._buf[0] = '\0'; menuAnmPath._buf[1] = '\0'; menuAnmPath._buf[2] = '\0'; menuAnmPath._buf[3] = '\0'; menuAnmPath._buf._0_4_ = std::_Allocate(0x20); menuAnmPath._size = 0x1e; menuAnmPath._capacity = 0x1f; builtin_strncpy((char *)menuAnmPath._buf._0_4_,"gfx/ui/main menu/GameMenu.anm2",0x1f); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x10),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar2 = menuAnmPath._capacity + 1; freeBlock = (char *)menuAnmPath._buf._0_4_; if (0xfff < uVar2) { freeBlock = *(char **)(menuAnmPath._buf._0_4_ + -4); uVar2 = menuAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuAnmPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); } animData = *(byte **)(in_ECX + 0x44); if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } idleName = s_Idle; do { bVar1 = *curAnimName; bVar3 = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_00980fe1: uVar2 = -(uint)bVar3 | 1; goto LAB_00980fe6; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; bVar3 = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_00980fe1; curAnimName = curAnimName + 2; idleName = idleName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00980fe6: if ((uVar2 == 0) && ((animData[0x34] == 0 || (*(char *)(in_ECX + 0x54) != '\0')))) goto LAB_00981012; } bVar1 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x10),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x40)); *(undefined1 *)(in_ECX + 0x54) = 1; } LAB_00981012: widgetAnmPath._size = 0; widgetAnmPath._capacity = 0xf; widgetAnmPath._buf[0] = '\0'; widgetAnmPath._buf[1] = '\0'; widgetAnmPath._buf[2] = '\0'; widgetAnmPath._buf[3] = '\0'; widgetAnmPath._buf._0_4_ = std::_Allocate(0x30); widgetAnmPath._size = 0x2d; widgetAnmPath._capacity = 0x2f; builtin_strncpy((char *)widgetAnmPath._buf._0_4_,"gfx/ui/main menu/ContinueProgress_Widget.anm2", 0x2e); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x124),&widgetAnmPath,1); local_14 = 0xffffffff; if (0xf < widgetAnmPath._capacity) { uVar2 = widgetAnmPath._capacity + 1; freeBlock = (char *)widgetAnmPath._buf._0_4_; if (0xfff < uVar2) { freeBlock = *(char **)(widgetAnmPath._buf._0_4_ + -4); uVar2 = widgetAnmPath._capacity + 0x24; if ((char *)0x1f < (char *)(widgetAnmPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); } widgetAnmPath._size = 0; widgetAnmPath._capacity = 0xf; widgetAnmPath._buf._0_4_ = widgetAnmPath._buf._0_4_ & 0xffffff00; ANM2::SetAnimation((ANM2 *)(in_ECX + 0x124),(byte *)"Dissapear",1); if (*(int *)(in_ECX + 0x158) != 0) { AnimationState::AdvancePosition ((AnimationState *)(in_ECX + 0x154),*(int *)(*(int *)(in_ECX + 0x158) + 0x30) + -1); } ExceptionList = local_1c; return; } //@@ 00981140 Menu_Game::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: MenuManager::Update case 3; "ModsKey", Online/CONNECTING_TO_SERVER; ZHL had put the name on 00a8ab60 prototype: REPENTOGON */ void __thiscall Menu_Game::Update(Menu_Game *this) { int *piVar1; KColor fadeColor; int *ptr; char cVar2; byte bVar3; Seeds *other; float fVar4; byte *animName; uint cmpResult; LayerState *modsKeyLayer; int unused; int unused_00; int iVar5; char *pcVar6; Manager *manager; bool bVar7; KColor aKStackY_b90 [128]; undefined4 uVar8; code *pcVar9; undefined4 cmpResult; void *pvVar11; Seeds local_148; undefined4 local_e8; Vector local_e4; float local_dc; byte isModsKeyVisible; Manager *local_d4; undefined1 connectingPopup [48]; undefined4 popupTimeout; Seeds seedsCopy; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; ChallengeParam *challengeParams; MenuManager *menuManager; int *nextNode; float *popup; undefined1 *popupCount; puStack_20 = (undefined1 *)((&seedsCopy)[1]._stageSeeds + 4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0cd63; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&seedsCopy)[1]._stageSeeds + 1); ExceptionList = &local_1c; piVar1 = (&seedsCopy)[1]._stageSeeds + 4; if ((g_menuManager->_selectedMenuID != 3) && (ANM2::SetAnimation(&this->ContinueWidgetSprite,(byte *)"Dissapear",1), piVar1 = (int *)puStack_20, (this->ContinueWidgetSprite)._animState._animData != (void *)0x0)) { AnimationState::AdvancePosition (&(this->ContinueWidgetSprite)._animState, *(int *)((int)(this->ContinueWidgetSprite)._animState._animData + 0x30) + -1); piVar1 = (int *)puStack_20; } puStack_20 = (undefined1 *)piVar1; if ((g_manager->_framecount & 1) == 0) { if ((this->GameMenuSprite)._loaded != 0) { AnimationState::Update(&(this->GameMenuSprite)._animState); AnimationState::Update(&(this->GameMenuSprite)._overlayAnimState); } if ((this->ContinueWidgetSprite)._loaded != 0) { AnimationState::Update(&(this->ContinueWidgetSprite)._animState); AnimationState::Update(&(this->ContinueWidgetSprite)._overlayAnimState); } } manager = g_manager; if (g_menuManager->_fadeOutActive != 0) { if (g_menuManager->_fadeOutProgress < 1.0) { ExceptionList = local_1c; return; } if ((g_manager->_framecount & 1) != 0) { ExceptionList = local_1c; return; } bVar3 = (g_manager->_gamestate)._isSaveAvailable; challengeParams = &(g_manager->_dailyChallenge)._params; g_manager->_debugStart = 0; if (bVar3 == 0) { manager->_rerunAvailable = 0; manager->_startingFromRerun = 1; (manager->_dailyChallenge)._id = 0; (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(challengeParams); manager->_starting = 1; manager->_networkPlay = 0; manager->_consecutiveResetCount = 0; ExceptionList = local_1c; return; } manager->_rerunAvailable = 1; manager->_startingFromRerun = 0; (manager->_dailyChallenge)._id = 0; (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(challengeParams); manager->_starting = 1; manager->_networkPlay = 0; manager->_consecutiveResetCount = 0; ExceptionList = local_1c; return; } local_d4 = (Manager *)&DAT_0000001c; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar2 == '\0') { pcVar9 = FUN_00a209e0; uVar8 = 0xffffffff; local_d4 = (Manager *)&DAT_0000000e; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (cVar2 == '\0') { local_dc = 3.08286e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (cVar2 == '\0') { local_dc = 3.22299e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); manager = g_manager; if (cVar2 == '\0') { local_dc = 2.10195e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar2 != '\0') { FUN_0098aec0(); } } else { iVar5 = this->KeyDownTimer; if ((iVar5 == 0) || ((0x31 < iVar5 && (iVar5 % 10 == 0)))) { iVar5 = this->SelectedElement + 1; this->SelectedElement = iVar5; if ((iVar5 != 1) || (((manager->_gamestate)._isSaveAvailable != 0 || ((manager->_gamestate)._isRerunAvailable != 0)))) { if (5 < iVar5) { iVar5 = 0; } goto LAB_00981778; } this->SelectedElement = 2; goto LAB_0098177b; } } } else { iVar5 = this->KeyDownTimer; if ((iVar5 == 0) || ((0x31 < iVar5 && (iVar5 % 10 == 0)))) { iVar5 = this->SelectedElement + -1; this->SelectedElement = iVar5; if ((iVar5 == 1) && (((manager->_gamestate)._isSaveAvailable == 0 && ((manager->_gamestate)._isRerunAvailable == 0)))) { this->SelectedElement = 0; } else { if (iVar5 < 0) { iVar5 = 5; } LAB_00981778: this->SelectedElement = iVar5; } LAB_0098177b: local_d4 = (Manager *)0x11a; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); } } } else { switch(this->SelectedElement) { case 0: MenuManager::push_menu(5,unused_00); break; case 1: g_manager->_selectedDifficulty = *(int *)&(g_manager->_gamestate).field_0x8; Seeds::construct_from_copy(&local_148,(Seeds *)&(manager->_gamestate).field_0x1e724); menuManager = g_menuManager; local_14 = 0; Seeds::construct_from_copy(&seedsCopy,&local_148); local_14 = CONCAT31(local_14._1_3_,1); Seeds::operator_assign(&menuManager->_seedsObject,other); FID_conflict__Erase_tree_>_> (&seedsCopy._seedEffects, (fuzzer_allocator_> *)&seedsCopy._seedEffects ,*(_Tree_node **)((int)seedsCopy._seedEffects + 4)); operator_delete(seedsCopy._seedEffects,0x14); local_14 = 0xffffffff; FID_conflict__Erase_tree_>_> (&local_148._seedEffects, (fuzzer_allocator_> *)&local_148._seedEffects ,*(_Tree_node **)((int)local_148._seedEffects + 4)); iVar5 = 0x14; cmpResult = 0x98141e; pvVar11 = local_148._seedEffects; operator_delete(local_148._seedEffects,0x14); KColor::SetFromARGB(aKStackY_b90 + 0x81,0xff000000); fadeColor._green = (float)pcVar9; fadeColor._red = (float)uVar8; fadeColor._blue = (float)cmpResult; fadeColor._alpha = (float)pvVar11; fadeColor._unk = iVar5; MenuManager::start_game(fadeColor); break; case 2: cVar2 = online_check_mods_allowed(); if ((cVar2 == '\0') && (bVar3 = show_beta_disclaimer_popup(1,&LAB_00983100,this), bVar3 == 0)) { FUN_00907200(); local_e4.x = (float)&DAT_bf800000; local_e4.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (connectingPopup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0, &local_e4); local_14 = 2; local_148._stageSeeds[9] = 0x3e5cdcdd; local_148._stageSeeds[10] = 0x3e2cacad; local_148._stageSeeds[0xb] = 0x3e34b4b5; local_148._stageSeeds[0xc] = 0x3f800000; local_148._playerInitSeed = (int)g_vectorZero.x; local_148._stageSeeds[5] = 0; local_148._stageSeeds[6] = 0xb78894; local_148._stageSeeds[7] = -1; local_148._stageSeeds[8] = -1; local_148._stageSeeds[0xd] = 0; local_148._seedEffects = (void *)g_vectorZero.y; local_148._seedEffectsCount = 1; std::vector<48byte>::push_back(); popupTimeout = 2000; fVar4 = (float)PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,connectingPopup); this[1].PositionX = fVar4; local_dc = fVar4; if (g_multiplayerService == (void *)0x0) { on_online_connect_result(); LAB_0098158b: local_d4 = g_manager; if (fVar4 != -NAN) { (**(code **)(*(int *)&g_manager[1]._gamestate.field_0xcf8 + 0xc))(); piVar1 = *(int **)&local_d4[1]._gamestate.field_0xcf0; nextNode = (int *)*piVar1; do { ptr = nextNode; if (ptr == piVar1) goto LAB_00981607; popup = (float *)ptr[2]; nextNode = (int *)*ptr; } while (*popup != local_dc); *(int **)ptr[1] = (int *)*ptr; *(int *)(*ptr + 4) = ptr[1]; popupCount = &local_d4[1]._gamestate.field_0xcf4; *(int *)popupCount = *(int *)popupCount + -1; operator_delete(ptr,0xc); if (popup != (float *)0x0) { Popup::destroy(); } LAB_00981607: (**(code **)(*(int *)&local_d4[1]._gamestate.field_0xcf8 + 0x10))(); } this[1].PositionX = -NAN; } else { _DAT_00c5abc4 = _DAT_00c5abc4 | 2; DAT_00c5abd0 = on_online_connect_result; DAT_00c5abd4 = this; cVar2 = (**(code **)(*(int *)g_multiplayerService + 0xc))(); if (cVar2 == '\0') goto LAB_0098158b; } local_14 = 0xffffffff; FUN_00420710(); } break; case 3: MenuManager::push_menu(7,unused_00); break; case 4: MenuManager::push_menu(9,unused_00); break; case 5: MenuManager::push_menu(10,unused_00); } } } else { MenuManager::push_menu(0x10,unused); } local_dc = 3.08286e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar2 == '\0') { local_e8 = 0x17; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(); if (cVar2 != '\0') goto LAB_0098185b; this->KeyDownTimer = 0; } else { LAB_0098185b: this->KeyDownTimer = this->KeyDownTimer + 1; } if (this->SelectedElement == 1) { if (((g_manager->_gamestate)._isSaveAvailable == 0) && ((g_manager->_gamestate)._isRerunAvailable == 0)) { this->SelectedElement = 0; goto LAB_00981881; } if ((g_manager->_gamestate)._isRerunAvailable != 0) goto LAB_00981881; if (((this->ContinueWidgetSprite)._animState._animData == (void *)0x0) || ((this->ContinueWidgetSprite)._animState._isPlaying != 0)) { LAB_00981912: animName = (this->ContinueWidgetSprite)._animState._animData; if ((animName == (byte *)0x0) || ((this->ContinueWidgetSprite)._animState._isPlaying != 0)) goto LAB_00981a25; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pcVar6 = "Dissapear"; do { bVar3 = *animName; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_00981960: cmpResult = -(uint)bVar7 | 1; goto LAB_00981965; } if (bVar3 == 0) break; bVar3 = animName[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_00981960; animName = animName + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); cmpResult = 0; LAB_00981965: if (cmpResult != 0) goto LAB_00981a25; PreRenderContinueImg(this); ANM2::Play(&this->ContinueWidgetSprite,(byte *)"Appear",0); local_d4 = (Manager *)0x11b; goto LAB_009819e5; } animName = (this->ContinueWidgetSprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pcVar6 = "Appear"; do { bVar3 = *animName; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_009818f3: cmpResult = -(uint)bVar7 | 1; goto LAB_009818f8; } if (bVar3 == 0) break; bVar3 = animName[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_009818f3; animName = animName + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); cmpResult = 0; LAB_009818f8: if (cmpResult != 0) goto LAB_00981912; ANM2::Play(&this->ContinueWidgetSprite,s_Idle,0); } else { LAB_00981881: animName = (this->ContinueWidgetSprite)._animState._animData; if (animName == (byte *)0x0) { animName = &s_empty; } else if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } pcVar6 = "Dissapear"; do { bVar3 = *animName; bVar7 = bVar3 < (byte)*pcVar6; if (bVar3 != *pcVar6) { LAB_009819c0: cmpResult = -(uint)bVar7 | 1; goto LAB_009819c5; } if (bVar3 == 0) break; bVar3 = animName[1]; bVar7 = bVar3 < (byte)pcVar6[1]; if (bVar3 != pcVar6[1]) goto LAB_009819c0; animName = animName + 2; pcVar6 = pcVar6 + 2; } while (bVar3 != 0); cmpResult = 0; LAB_009819c5: if (cmpResult != 0) { ANM2::Play(&this->ContinueWidgetSprite,(byte *)"Dissapear",0); local_d4 = (Manager *)0x11c; LAB_009819e5: manager = g_manager; seed_fart_sound_override((int *)&local_d4); SoundEffects::Play(&manager->_sfxManager,(int)local_d4,1.0,2,0,1.0,0.0); } } LAB_00981a25: local_e4.y = (float)this->SelectedElement; if (((this->GameMenuSprite)._animState._animData != (void *)0x0) && ((6 < *(int *)((int)(this->GameMenuSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)((int)(this->GameMenuSprite)._animState._animation + 0x80))))) { pvVar11 = (this->GameMenuSprite)._animState._animData; local_d4 = *(Manager **)((int)pvVar11 + 0x50); if ((pvVar11 == (void *)0x0) || (((int)local_d4 < 0 || (*(int *)((int)pvVar11 + 0x1c) <= (int)local_d4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->GameMenuSprite)._animState._layerFrames + (int)local_d4 * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->GameMenuSprite)._animState,(int)local_d4,(float)(int)local_e4.y); } if ((g_manager->_gamestate)._isSaveAvailable == 0) { if ((this->GameMenuSprite)._animState._animData == (void *)0x0) goto LAB_00981c09; pvVar11 = (this->GameMenuSprite)._animState._animation; if ((g_manager->_gamestate)._isRerunAvailable == 0) { if ((*(int *)((int)pvVar11 + 0x80) < 3) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->GameMenuSprite)._animState._animation + 0x80) < 3)) goto LAB_00981c09; pvVar11 = (this->GameMenuSprite)._animState._animData; local_e4.y = *(float *)((int)pvVar11 + 0x40); if ((pvVar11 == (void *)0x0) || (((int)local_e4.y < 0 || (*(int *)((int)pvVar11 + 0x1c) <= (int)local_e4.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar4 = 1.0; } else { if ((*(int *)((int)pvVar11 + 0x80) < 3) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->GameMenuSprite)._animState._animation + 0x80) < 3)) goto LAB_00981c09; pvVar11 = (this->GameMenuSprite)._animState._animData; local_e4.y = *(float *)((int)pvVar11 + 0x40); if ((pvVar11 == (void *)0x0) || (((int)local_e4.y < 0 || (*(int *)((int)pvVar11 + 0x1c) <= (int)local_e4.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar4 = 2.0; } } else { if (((this->GameMenuSprite)._animState._animData == (void *)0x0) || ((*(int *)((int)(this->GameMenuSprite)._animState._animation + 0x80) < 3 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->GameMenuSprite)._animState._animation + 0x80) < 3)))) goto LAB_00981c09; pvVar11 = (this->GameMenuSprite)._animState._animData; local_e4.y = *(float *)((int)pvVar11 + 0x40); if ((pvVar11 == (void *)0x0) || (((int)local_e4.y < 0 || (*(int *)((int)pvVar11 + 0x1c) <= (int)local_e4.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } fVar4 = 0.0; } *(undefined4 *)((int)(this->GameMenuSprite)._animState._layerFrames + (int)local_e4.y * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->GameMenuSprite)._animState,(int)local_e4.y,fVar4); LAB_00981c09: if ((g_menuControllerIndex == 0) || (isModsKeyVisible = 0, g_menuControllerIndex == -1)) { isModsKeyVisible = 1; } modsKeyLayer = ANM2::GetLayer(&this->GameMenuSprite,(byte *)"ModsKey"); if (modsKeyLayer != (LayerState *)0x0) { modsKeyLayer->_visible = isModsKeyVisible; } ExceptionList = local_1c; return; } //@@ 00981c80 Menu_Game::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager::Render between Menu_Character::Render and Menu_SpecialSeeds::Render; layers ModsButton/Guide, "Dissapear" prototype: REPENTOGON */ void __thiscall Menu_Game::Render(Menu_Game *this) { Menu_Game *other; byte bVar1; ColorMod color; undefined1 auVar2 [32]; Vector pos; Vector scale; float *nullFrame; byte *animName; uint cmpResult; undefined *shader; byte *extraout_ECX; char *unusedArg; KColor *color_00; byte *extraout_ECX_00; bool bVar3; float imageHeight; float imageWidth; float guideScaleX; float guideScaleY; Vector *size; KColor *imageRefCount; undefined1 auStack_126 [6]; undefined1 destQuad [112]; undefined1 sourceQuad [36]; KColor quadColor; Vector local_78; float guideOffsetY; float guideOffsetX; float menuY; float menuX; undefined4 uStack_60; undefined4 uStack_5c; Vector scratchVec [2]; ColorMod guideColor; float local_14; int continueImage; local_14 = (float)(__security_cookie ^ (uint)((&guideColor)[1]._tint + 3)); menuX = (g_menuManager->_ViewPosition).x + this->PositionX; menuY = (g_menuManager->_ViewPosition).y + this->PositionY; if ((this->GameMenuSprite)._loaded != 0) { scratchVec[0].x = menuX; scratchVec[0].y = menuY; if ((this->GameMenuSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->GameMenuSprite)._animState,scratchVec,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->GameMenuSprite)._overlayAnimState,scratchVec,&g_vectorZero,&g_vectorZero); menuY = scratchVec[0].y; } else { AnimationState::Render (&(this->GameMenuSprite)._overlayAnimState,scratchVec,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->GameMenuSprite)._animState,scratchVec,&g_vectorZero,&g_vectorZero); menuY = scratchVec[0].y; } menuX = scratchVec[0].x; } uStack_60 = 0; uStack_5c = 0; scratchVec[0].x = 0.0; scratchVec[0].y = 0.0; unusedArg = (char *)g_menuControllerIndex; if ((g_menuControllerIndex != 0) && (g_menuControllerIndex != -1)) { if ((this->GameMenuSprite)._animState._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame (&(this->GameMenuSprite)._animState,(byte *)"ModsButton"); } scratchVec[0].y = menuY + nullFrame[1]; scratchVec[0].x = menuX + *nullFrame; guideColor._offset[2] = 0.0; color._offset[1] = (float)uStack_60; color._offset[0] = (float)uStack_60; auVar2 = ZEXT1632(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))); color._tint[0] = (float)auVar2._0_4_; color._tint[1] = (float)auVar2._4_4_; color._tint[2] = (float)auVar2._8_4_; color._tint[3] = (float)auVar2._12_4_; color._colorize[0] = (float)auVar2._16_4_; color._colorize[1] = (float)auVar2._20_4_; color._colorize[2] = (float)auVar2._24_4_; color._colorize[3] = (float)auVar2._28_4_; color._offset[2] = 0.0; pos.y = scratchVec[0].y; pos.x = scratchVec[0].x; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; Manager::render_controller_action_glyph (g_manager,g_menuControllerIndex,0x1c,0,1,color,pos,scale); unusedArg = (char *)extraout_ECX; } if (((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) && ((this->ContinueWidgetSprite)._animState._isPlaying == 0)) { animName = (this->ContinueWidgetSprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } unusedArg = "Dissapear"; do { bVar1 = *animName; bVar3 = bVar1 < (byte)*unusedArg; if (bVar1 != *unusedArg) { LAB_00981e47: cmpResult = -(uint)bVar3 | 1; goto LAB_00981e4c; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar3 = bVar1 < (byte)unusedArg[1]; if (bVar1 != unusedArg[1]) goto LAB_00981e47; animName = animName + 2; unusedArg = unusedArg + 2; } while (bVar1 != 0); cmpResult = 0; LAB_00981e4c: if (cmpResult == 0) goto LAB_00982038; } if ((g_menuManager->_selectedMenuID == 3) && (other = this + 1, this[1].KeyDownTimer != 0)) { shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } guideColor._colorize[0] = 0.0; guideColor._colorize[1] = 0.0; guideColor._colorize[2] = 0.0; guideColor._colorize[3] = 0.0; guideColor._tint[0] = 1.0; guideColor._tint[1] = 0.5; guideColor._tint[2] = 0.5; guideColor._tint[3] = 0.5; guideColor._offset[0] = 0.0; guideOffsetX = g_vectorZero.x; guideColor._offset[1] = 0.0; guideColor._offset[2] = 0.0; guideOffsetY = g_vectorZero.y; local_78.y = g_vectorOne.x; scratchVec[0].y = g_vectorOne.y; guideScaleX = g_vectorOne.x; guideScaleY = g_vectorOne.y; g_currentShader = shader; if ((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) { nullFrame = AnimationState::GetNullFrame (&(this->ContinueWidgetSprite)._animState,(byte *)"Guide"); if (nullFrame == (float *)0x0) { guideScaleX = local_78.y; guideScaleY = scratchVec[0].y; } else { guideOffsetX = *nullFrame; guideScaleX = nullFrame[4]; guideScaleY = nullFrame[5]; guideOffsetY = nullFrame[1]; } } continueImage = other->KeyDownTimer; imageWidth = (float)((double)*(int *)(continueImage + 0x10) + __uint_to_double_fixup[-(*(int *)(continueImage + 0x10) >> 0x1f)]) * guideScaleX; imageHeight = (float)((double)*(int *)(continueImage + 0x14) + __uint_to_double_fixup[-(*(int *)(continueImage + 0x14) >> 0x1f)]) * guideScaleY; scratchVec[0].x = imageWidth; scratchVec[0].y = imageHeight; quad_set_rect(sourceQuad,&g_vectorZero,scratchVec,continueImage); KColor::SetFromARGB(&quadColor,0xffffffff); scratchVec[0].x = guideScaleX * imageWidth; size = scratchVec; scratchVec[0].y = imageHeight * guideScaleY; local_78.x = (menuX + 72.0 + guideOffsetX) - imageWidth * 0.5; local_78.y = (menuY + 124.0 + guideOffsetY) - imageHeight * 0.5; imageRefCount = color_00; render_quad_set_rect(destQuad,&local_78,size,color_00); KAGE::SmartPointer::operator_assign(auStack_126 + -0x12,other); apply_sprite_shader_params(&guideColor,1,size,imageRefCount); (**(code **)(*(int *)other->KeyDownTimer + 0x14))(sourceQuad); unusedArg = (char *)extraout_ECX_00; } LAB_00982038: shader_cache_find((int)unusedArg); return; } //@@ 00982060 FUN_00982060 void FUN_00982060(void) { byte *pbVar1; Manager *pMVar2; byte bVar3; byte *pbVar4; uint uVar5; Menu_Game *in_ECX; byte *pbVar6; bool bVar7; pbVar1 = (in_ECX->GameMenuSprite)._animState._animData; if (pbVar1 != (byte *)0x0) { pbVar4 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar4 = *(byte **)pbVar1; } pbVar6 = s_Idle; do { bVar3 = *pbVar4; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_009820a0: uVar5 = -(uint)bVar7 | 1; goto LAB_009820a5; } if (bVar3 == 0) break; bVar3 = pbVar4[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_009820a0; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009820a5: if ((uVar5 == 0) && ((pbVar1[0x34] == 0 || ((in_ECX->GameMenuSprite)._animState._isPlaying != 0)))) goto LAB_009820d2; } bVar3 = ANM2::SetAnimation(&in_ECX->GameMenuSprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(in_ECX->GameMenuSprite)._animState); (in_ECX->GameMenuSprite)._animState._isPlaying = 1; } LAB_009820d2: pMVar2 = g_manager; in_ECX->SelectedElement = 0; if ((pMVar2->_gamestate)._isSaveAvailable != 0) { in_ECX->SelectedElement = 1; Menu_Game::PreRenderContinueImg(in_ECX); } in_ECX->KeyDownTimer = 0; return; } //@@ 00982100 Menu_Game::PreRenderContinueImg /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON name; called from Menu_Game::Update body 00981140 Menu_Game::Update update dispatch case 3) before "Appear"; draws Character/Stage anims and %02d:%02d:%02d run time into a RenderTarget, ModManager::RenderCustomCharacterPortraits prototype: REPENTOGON */ void __thiscall Menu_Game::PreRenderContinueImg(Menu_Game *this) { char cVar1; void *pvVar2; int iVar3; PersistentGameData *pPVar4; Vector pos; undefined1 uVar5; byte bVar6; undefined1 uVar7; byte bVar8; undefined4 *renderTargetEntry; float *pfVar9; uint uVar10; LayerState *layer; ColorMod *color; int iVar11; KColor *color_00; undefined4 uVar12; std_string *psVar13; byte *****pppppbVar14; NetplayManager NVar15; void *pvVar16; KColor *color_01; KColor *color_02; char *expectedAnimName; AnimationState *secondAnimState; ModManager *secondAnimState; int iVar17; std_string *psVar18; byte *pbVar19; uint size; int id; NetplayManager NVar20; byte *pbVar21; NetplayManager NVar22; NetplayManager NVar23; bool bVar24; float fVar25; float fVar26; int local_2b4; byte *local_2b0; Vector imageCenter; Menu_Game *local_2a4; float local_2a0; float *local_29c; NetplayManager local_298; NetplayManager local_294; Color local_290; FontSettings timeFontSettings; std_string local_260; byte *****local_248; KColor local_244; short stageNameWide [256]; NetplayManager local_30; NetplayManager stageLinesEnd; int stageLinesCapacityEnd; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = (undefined1 *)(stageNameWide + 0x116); local_14 = 0xffffffff; puStack_18 = &LAB_00b0cdea; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(stageNameWide + 0x110); ExceptionList = &local_1c; imageCenter.x = 0.0; imageCenter.y = 0.0; local_2a4 = this; std::vector::resize(&imageCenter); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)this[1].KeyDownTimer,0); RenderTarget::Clear(&DAT_00c798e0); NVar23 = (NetplayManager)g_manager; local_298 = (NetplayManager)g_manager; if ((g_manager->_gamestate)._isSaveAvailable == 0) goto LAB_00983081; iVar11 = *(int *)(this[1].KeyDownTimer + 0x14); iVar17 = *(int *)(this[1].KeyDownTimer + 0x10); local_29c = (this->ContinueWidgetSprite)._animState._animData; imageCenter.y = (float)((double)iVar11 + __uint_to_double_fixup[-(iVar11 >> 0x1f)]) * 0.5; imageCenter.x = (float)((double)iVar17 + __uint_to_double_fixup[-(iVar17 >> 0x1f)]) * 0.5; if (local_29c == (float *)0x0) { LAB_0098228c: bVar8 = ANM2::SetAnimation(&this->ContinueWidgetSprite,(byte *)"Character",1); if (bVar8 != 0) { AnimationState::Rewind(&(this->ContinueWidgetSprite)._animState); (this->ContinueWidgetSprite)._animState._isPlaying = 1; } } else { pfVar9 = local_29c; if (0xf < (uint)local_29c[5]) { pfVar9 = (float *)*local_29c; } expectedAnimName = "Character"; do { bVar8 = *(byte *)pfVar9; bVar24 = bVar8 < (byte)*expectedAnimName; if (bVar8 != *expectedAnimName) { LAB_00982260: uVar10 = -(uint)bVar24 | 1; goto LAB_00982265; } if (bVar8 == 0) break; bVar8 = *(byte *)((int)pfVar9 + 1); bVar24 = bVar8 < (byte)expectedAnimName[1]; if (bVar8 != expectedAnimName[1]) goto LAB_00982260; pfVar9 = (float *)((int)pfVar9 + 2); expectedAnimName = expectedAnimName + 2; } while (bVar8 != 0); uVar10 = 0; LAB_00982265: if ((uVar10 != 0) || ((*(char *)(local_29c + 0xd) != '\0' && ((this->ContinueWidgetSprite)._animState._isPlaying == 0)))) goto LAB_0098228c; } local_294 = *(NetplayManager *)&(((Manager *)NVar23)->_gamestate).field_0x19d7c; if ((uint)local_294 < 0x29) { if (((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) && ((0 < *(int *)((int)(this->ContinueWidgetSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0 < *(int *)((int)(this->ContinueWidgetSprite)._animState._animation + 0x80))))) { pvVar2 = (this->ContinueWidgetSprite)._animState._animData; local_29c = *(float **)((int)pvVar2 + 0x38); if ((pvVar2 == (void *)0x0) || (((int)local_29c < 0 || (*(int *)((int)pvVar2 + 0x1c) <= (int)local_29c)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(this->ContinueWidgetSprite)._animState._layerFrames + (int)local_29c * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ContinueWidgetSprite)._animState,(int)local_29c,(float)(int)local_294); } layer = ANM2::GetLayer(&this->ContinueWidgetSprite,(byte *)0x0); layer->_visible = 1; local_294 = *(NetplayManager *)&(((Manager *)NVar23)->_gamestate).field_0x19d7c; if (((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(this->ContinueWidgetSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(this->ContinueWidgetSprite)._animState._animation + 0x80))))) { pvVar2 = (this->ContinueWidgetSprite)._animState._animData; local_29c = *(float **)((int)pvVar2 + 0x44); if ((pvVar2 == (void *)0x0) || (((int)local_29c < 0 || (*(int *)((int)pvVar2 + 0x1c) <= (int)local_29c)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(this->ContinueWidgetSprite)._animState._layerFrames + (int)local_29c * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ContinueWidgetSprite)._animState,(int)local_29c,(float)(int)local_294); } layer = ANM2::GetLayer(&this->ContinueWidgetSprite,(byte *)0x3); layer->_visible = 1; } else { layer = ANM2::GetLayer(&this->ContinueWidgetSprite,(byte *)0x0); layer->_visible = 0; layer = ANM2::GetLayer(&this->ContinueWidgetSprite,(byte *)0x3); layer->_visible = 0; } local_294 = *(NetplayManager *)&(((Manager *)NVar23)->_gamestate).field_0x8; if (((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) && ((2 < *(int *)((int)(this->ContinueWidgetSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 2 < *(int *)((int)(this->ContinueWidgetSprite)._animState._animation + 0x80))))) { pvVar2 = (this->ContinueWidgetSprite)._animState._animData; local_29c = *(float **)((int)pvVar2 + 0x40); if ((pvVar2 == (void *)0x0) || (((int)local_29c < 0 || (*(int *)((int)pvVar2 + 0x1c) <= (int)local_29c)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->ContinueWidgetSprite)._animState._layerFrames + (int)local_29c * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->ContinueWidgetSprite)._animState,(int)local_29c,(float)(int)local_294); } if ((this->ContinueWidgetSprite)._loaded != 0) { if ((this->ContinueWidgetSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->ContinueWidgetSprite)._animState,&imageCenter,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->ContinueWidgetSprite)._overlayAnimState; } else { AnimationState::Render (&(this->ContinueWidgetSprite)._overlayAnimState,&imageCenter,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->ContinueWidgetSprite)._animState; } AnimationState::Render(secondAnimState,&imageCenter,&g_vectorZero,&g_vectorZero); } if (0x28 < *(uint *)&(((Manager *)NVar23)->_gamestate).field_0x19d7c) { Color::Color(&local_290); ModManager::RenderCustomCharacterPortraits(secondAnimState,id,&imageCenter,color,&g_vectorOne); } if ((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) { local_29c = AnimationState::GetNullFrame(&(this->ContinueWidgetSprite)._animState,&DAT_00b6837c) ; if (local_29c != (float *)0x0) { sprintf_s((byte *)&local_30,9,(byte *)"%02d:%02d:%02d"); pfVar9 = local_29c; manager = g_manager; fVar25 = imageCenter.x + *local_29c; fVar26 = imageCenter.y + local_29c[1]; iVar11 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,(byte *)&local_30,-1); fVar26 = fVar26 - 6.0; timeFontSettings = (FontSettings)0x0; local_260._buf._0_4_ = (std_string *)0xffff; local_260._buf[4] = '\0'; local_260._buf[5] = '\0'; local_260._buf[6] = '\0'; local_260._buf[7] = '\0'; local_260._buf[8] = '\0'; local_260._buf[9] = '\0'; local_260._buf[10] = -0x80; local_260._buf[0xb] = '?'; local_260._buf[0xc] = -1; local_260._buf[0xd] = -1; local_260._buf[0xe] = -1; local_260._buf[0xf] = -1; local_260._size = 0; local_260._capacity = 0; fVar25 = (float)-(iVar11 / 2) + fVar25; local_14 = 0; KColor::SetFromARGB(&local_244,0xff372b2d); pos.y = fVar26; pos.x = fVar25; Font::DrawString(&manager->_font2_TeamMeatEx12,(byte *)&local_30,pos,*(Vector *)(pfVar9 + 4), color_00,&timeFontSettings); local_14 = 0xffffffff; NVar23 = local_298; this = local_2a4; } if (((this->ContinueWidgetSprite)._animState._animData == (void *)0x0) || (local_29c = AnimationState::GetNullFrame (&(this->ContinueWidgetSprite)._animState,(byte *)"Stage"), local_29c == (float *)0x0)) goto LAB_00983081; if ((*(int *)((int)NVar23 + 0xfac) == 2) || (*(int *)((int)NVar23 + 0xfac) == 3)) { iVar11 = 1; } else { iVar11 = 0; } bVar8 = Seeds::HasSeedEffect((Seeds *)((int)NVar23 + 0x1f6c8),9); local_294._0_1_ = bVar8; bVar8 = Seeds::HasSeedEffect((Seeds *)((int)NVar23 + 0x1f6c8),0x10); if (bVar8 == 0) { iVar17 = 0; } else { iVar17 = *(int *)((int)local_298 + 0x1024); } Level::get_stage_display_name (&local_260,*(int *)((int)local_298 + 0x1088),*(int *)((int)local_298 + 0x108c), *(uint *)((int)local_298 + 0x1098),iVar17,local_294._0_1_,iVar11); local_30 = (NetplayManager)0x0; stageLinesEnd = (NetplayManager)0x0; stageLinesCapacityEnd = 0; local_14 = 2; local_2a4 = (Menu_Game *)&g_manager->_font2_TeamMeatEx12; psVar18 = &local_260; if (0xf < local_260._capacity) { psVar18 = (std_string *)local_260._buf._0_4_; } uVar10 = Font::get_string_width_n((Font *)local_2a4,(byte *)psVar18,-1); if (uVar10 < 0x58) { vector_string_emplace_reallocate(&local_30,(std_string *)0x0,&local_260); NVar23 = local_30; NVar22 = stageLinesEnd; } else { uVar12 = string_split(0x20); FUN_00651a50(uVar12); std::vector::_Tidy(); local_2a0 = 0.0; local_298 = stageLinesEnd; iVar11 = (int)stageLinesEnd - (int)local_30 >> 0x1f; NVar23 = local_30; NVar22 = stageLinesEnd; if (((int)stageLinesEnd - (int)local_30) / 0x18 + iVar11 != iVar11) { local_294 = (NetplayManager)0x0; do { if (local_2a0 == 0.0) { LAB_009829b7: local_2a0 = (float)((int)local_2a0 + 1); local_294 = (NetplayManager)((int)local_294 + 0x18); } else { uVar10 = *(uint *)((int)((int)local_294 + 0x10) + (int)NVar23); local_2b0 = (byte *)((int)local_294 + (int)NVar23); if (2 < uVar10) goto LAB_009829b7; if (uVar10 == 0x7fffffff) goto LAB_009830f2; pbVar19 = local_2b0; if (0xf < *(uint *)(local_2b0 + 0x14)) { pbVar19 = *(byte **)local_2b0; } std::string::concat((char *)&local_248,(int)local_2b0,(std_string *)local_2b0, &DAT_00b656ec,1,pbVar19,uVar10); pbVar19 = local_2b0; local_14._0_1_ = 3; pppppbVar14 = (byte *****)&local_248; if (0xf < (uint)local_244._unk) { pppppbVar14 = local_248; } std::string::append((char *)(local_2b0 + -0x18),(byte *)pppppbVar14, (uint)local_244._alpha); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < (uint)local_244._unk) { uVar10 = local_244._unk + 1; pppppbVar14 = local_248; if (0xfff < uVar10) { pppppbVar14 = (byte *****)local_248[-1]; uVar10 = local_244._unk + 0x24; if ((byte *)0x1f < (byte *)((int)local_248 + (-4 - (int)pppppbVar14))) goto LAB_00983056; } operator_delete(pppppbVar14,uVar10); } std::vector::erase(&local_2b4,pbVar19); local_298 = stageLinesEnd; NVar23 = local_30; NVar22 = stageLinesEnd; } } while ((uint)local_2a0 < (uint)(((int)NVar22 - (int)NVar23) / 0x18)); } if (2 < (uint)(((int)NVar22 - (int)NVar23) / 0x18)) { uVar10 = *(uint *)((int)NVar23 + 0x28); local_2a0 = (float)(local_260._size >> 1); NVar15 = NVar22; if (*(int *)((int)NVar23 + 0x10) + 1 + uVar10 < (uint)local_2a0) { do { psVar18 = (std_string *)((int)NVar23 + 0x18); if (uVar10 == 0x7fffffff) goto LAB_009830f2; psVar13 = psVar18; if (0xf < *(uint *)((int)NVar23 + 0x2c)) { psVar13 = *(std_string **)psVar18->_buf; } std::string::concat((char *)&local_248,local_2b4,psVar18,&DAT_00b656ec,1,(byte *)psVar13 ,uVar10); local_14._0_1_ = 4; pppppbVar14 = (byte *****)&local_248; if (0xf < (uint)local_244._unk) { pppppbVar14 = local_248; } std::string::append((char *)NVar23,(byte *)pppppbVar14,(uint)local_244._alpha); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < (uint)local_244._unk) { uVar10 = local_244._unk + 1; pppppbVar14 = local_248; if (0xfff < uVar10) { pppppbVar14 = (byte *****)local_248[-1]; uVar10 = local_244._unk + 0x24; if ((byte *)0x1f < (byte *)((int)local_248 + (-4 - (int)pppppbVar14))) goto LAB_00983056; } operator_delete(pppppbVar14,uVar10); } local_294 = (NetplayManager)((int)NVar23 + 0x30); if (local_294 != NVar15) { do { NVar22 = (NetplayManager)((int)NVar23 + 0x18); if (NVar22 != local_294) { std::string::_Tidy_deallocate((char *)NVar22); iVar11 = *(int *)((int)local_294 + 4); iVar17 = *(int *)((int)local_294 + 8); iVar3 = *(int *)((int)local_294 + 0xc); *(int *)NVar22 = *(int *)local_294; *(int *)((int)NVar23 + 0x1c) = iVar11; *(int *)((int)NVar23 + 0x20) = iVar17; *(int *)((int)NVar23 + 0x24) = iVar3; iVar11 = *(int *)((int)local_294 + 0x14); *(int *)((int)NVar23 + 0x28) = *(int *)((int)local_294 + 0x10); *(int *)((int)NVar23 + 0x2c) = iVar11; *(int *)((int)NVar23 + 0x40) = 0; *(int *)((int)NVar23 + 0x44) = 0xf; *(undefined1 *)local_294 = 0; } local_294 = (NetplayManager)((int)local_294 + 0x18); NVar23 = NVar22; } while (local_294 != NVar15); NVar23 = local_30; } NVar20 = *(NetplayManager *)((int)NVar15 + -4); NVar22 = (NetplayManager)((int)NVar15 + -0x18); local_298 = NVar22; if (0xf < (uint)NVar20) { pvVar2 = *(void **)NVar22; uVar10 = (int)NVar20 + 1; pvVar16 = pvVar2; if (0xfff < uVar10) { pvVar16 = *(void **)((int)pvVar2 + -4); uVar10 = (int)NVar20 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar16))) goto LAB_00983056; } operator_delete(pvVar16,uVar10); } ((Vector *)((int)NVar15 + -8))->x = 0.0; *(NetplayManager *)((int)NVar15 + -4) = (NetplayManager)0xf; *(undefined1 *)NVar22 = 0; uVar10 = *(uint *)((int)NVar23 + 0x28); NVar15 = NVar22; stageLinesEnd = NVar22; } while (*(int *)((int)NVar23 + 0x10) + 1 + uVar10 < (uint)local_2a0); } if (2 < (uint)(((int)NVar22 - (int)NVar23) / 0x18)) { do { psVar18 = (std_string *)((int)NVar23 + 0x30); if (*(uint *)((int)NVar23 + 0x40) == 0x7fffffff) { LAB_009830f2: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } psVar13 = psVar18; if (0xf < *(uint *)((int)NVar23 + 0x44)) { psVar13 = *(std_string **)psVar18->_buf; } std::string::concat((char *)&local_248,local_2b4,psVar18,&DAT_00b656ec,1,(byte *)psVar13 ,*(uint *)((int)NVar23 + 0x40)); local_14._0_1_ = 5; pppppbVar14 = (byte *****)&local_248; if (0xf < (uint)local_244._unk) { pppppbVar14 = local_248; } std::string::append((char *)((int)NVar23 + 0x18),(byte *)pppppbVar14, (uint)local_244._alpha); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < (uint)local_244._unk) { uVar10 = local_244._unk + 1; pppppbVar14 = local_248; if (0xfff < uVar10) { pppppbVar14 = (byte *****)local_248[-1]; uVar10 = local_244._unk + 0x24; if ((byte *)0x1f < (byte *)((int)local_248 + (-4 - (int)pppppbVar14))) goto LAB_00983056; } operator_delete(pppppbVar14,uVar10); } NVar22 = (NetplayManager)((int)NVar23 + 0x48); if (NVar22 != local_298) { NVar23 = (NetplayManager)((int)NVar23 + 0x30); NVar15 = local_298; do { if (NVar23 != NVar22) { std::string::_Tidy_deallocate((char *)NVar23); iVar11 = *(int *)((int)NVar22 + 4); iVar17 = *(int *)((int)NVar22 + 8); iVar3 = *(int *)((int)NVar22 + 0xc); *(int *)NVar23 = *(int *)NVar22; *(int *)((int)NVar23 + 4) = iVar11; *(int *)((int)NVar23 + 8) = iVar17; *(int *)((int)NVar23 + 0xc) = iVar3; pPVar4 = (PersistentGameData *)((int)NVar22 + 0x14); uVar5 = pPVar4->field_0x0; bVar8 = pPVar4->_isReadOnly; bVar6 = pPVar4->_isSteamAchievementsEnabled; uVar7 = pPVar4->field_0x3; *(int *)((int)NVar23 + 0x10) = *(int *)((int)NVar22 + 0x10); pPVar4 = (PersistentGameData *)((int)NVar23 + 0x14); pPVar4->field_0x0 = uVar5; pPVar4->_isReadOnly = bVar8; pPVar4->_isSteamAchievementsEnabled = bVar6; pPVar4->field_0x3 = uVar7; *(int *)((int)NVar23 + 0x28) = 0; *(int *)((int)NVar23 + 0x2c) = 0xf; *(undefined1 *)NVar22 = 0; NVar15 = local_298; } NVar22 = (NetplayManager)((int)NVar22 + 0x18); NVar23 = (NetplayManager)((int)NVar23 + 0x18); } while (NVar22 != NVar15); NVar23 = local_30; } NVar20 = local_298; NVar22 = (NetplayManager)((int)local_298 + -0x18); NVar15 = *(NetplayManager *)((int)local_298 + -4); local_298 = NVar22; if (0xf < (uint)NVar15) { pvVar2 = *(void **)NVar22; uVar10 = (int)NVar15 + 1; pvVar16 = pvVar2; if (0xfff < uVar10) { pvVar16 = *(void **)((int)pvVar2 + -4); uVar10 = (int)NVar15 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar16))) goto LAB_00983056; } operator_delete(pvVar16,uVar10); } *(int *)((int)NVar20 + -8) = 0; *(NetplayManager *)((int)NVar20 + -4) = (NetplayManager)0xf; *(undefined1 *)NVar22 = 0; stageLinesEnd = NVar22; } while (2 < (uint)(((int)NVar22 - (int)NVar23) / 0x18)); } } } local_298 = (NetplayManager)(imageCenter.x + *local_29c + 0.0); local_2a0 = (imageCenter.y + local_29c[1]) - 6.0; NVar15 = NVar23; if (0xf < *(uint *)((int)NVar23 + 0x14)) { NVar15 = *(NetplayManager *)NVar23; } if (NVar15 == (NetplayManager)0x0) { iVar11 = 0; } else { NVar20 = NVar15; do { cVar1 = *(char *)NVar20; NVar20 = (NetplayManager)((int)NVar20 + 1); } while (cVar1 != '\0'); iVar11 = (int)NVar20 - (int)((int)NVar15 + 1); } local_294 = NVar23; text_convert_encoding((byte *)NVar15,iVar11,0,stageNameWide,0x100,1); local_290._colorize[0] = 0.0; local_290._colorize[1] = 9.18341e-41; local_290._colorize[2] = 0.0; local_290._colorize[3] = 1.0; local_290._offset[0] = -NAN; local_290._offset[1] = 0.0; local_290._offset[2] = 0.0; local_14._0_1_ = 6; KColor::SetFromARGB(&local_244,0xff372b2d); fVar25 = local_29c[5]; fVar26 = local_29c[4]; uVar10 = Font::get_string_width_utf16((Font *)local_2a4,stageNameWide,-1); Font::draw_string_wide ((Font *)local_2a4,stageNameWide,(float)local_298 - ((float)(uVar10 >> 1) + 0.0), local_2a0,fVar26,fVar25,color_01,local_290._colorize); local_14._0_1_ = 2; if (1 < (uint)(((int)NVar22 - (int)local_294) / 0x18)) { local_298 = (NetplayManager)((float)local_298 + 4.0); pbVar19 = (byte *)((int)local_30 + 0x18); local_2a0 = local_2a0 + 14.0; if (0xf < *(uint *)((int)local_30 + 0x2c)) { pbVar19 = *(byte **)pbVar19; } if (pbVar19 == (byte *)0x0) { iVar11 = 0; } else { pbVar21 = pbVar19; do { bVar8 = *pbVar21; pbVar21 = pbVar21 + 1; } while (bVar8 != 0); iVar11 = (int)pbVar21 - (int)(pbVar19 + 1); } text_convert_encoding(pbVar19,iVar11,0,stageNameWide,0x100,1); local_290._colorize[0] = 0.0; local_290._colorize[1] = 9.18341e-41; local_290._colorize[2] = 0.0; local_290._colorize[3] = 1.0; local_290._offset[0] = -NAN; local_290._offset[1] = 0.0; local_290._offset[2] = 0.0; local_14._0_1_ = 7; KColor::SetFromARGB(&local_244,0xff372b2d); fVar25 = local_29c[5]; fVar26 = local_29c[4]; uVar10 = Font::get_string_width_utf16((Font *)local_2a4,stageNameWide,-1); Font::draw_string_wide ((Font *)local_2a4,stageNameWide,(float)local_298 - ((float)(uVar10 >> 1) + 0.0), local_2a0,fVar26,fVar25,color_02,local_290._colorize); } local_14 = CONCAT31(local_14._1_3_,1); for (NVar23 = local_294; NVar23 != NVar22; NVar23 = (NetplayManager)((int)NVar23 + 0x18)) { uVar10 = *(uint *)((int)NVar23 + 0x14); if (0xf < uVar10) { pvVar2 = *(void **)NVar23; size = uVar10 + 1; pvVar16 = pvVar2; if (0xfff < size) { pvVar16 = *(void **)((int)pvVar2 + -4); size = uVar10 + 0x24; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar16))) goto LAB_00983056; } operator_delete(pvVar16,size); } *(int *)((int)NVar23 + 0x10) = 0; *(int *)((int)NVar23 + 0x14) = 0xf; *(undefined1 *)NVar23 = 0; } uVar10 = ((stageLinesCapacityEnd - (int)local_30) / 0x18) * 0x18; NVar23 = local_30; if (0xfff < uVar10) { NVar23 = *(NetplayManager *)((int)local_30 + -4); uVar10 = uVar10 + 0x23; if (0x1f < ((int)local_30 - (int)NVar23) - 4U) goto LAB_00983056; } operator_delete((void *)NVar23,uVar10); local_14 = 0xffffffff; if (0xf < local_260._capacity) { uVar10 = local_260._capacity + 1; psVar18 = (std_string *)local_260._buf._0_4_; if (0xfff < uVar10) { psVar18 = (std_string *)((std_string *)(local_260._buf._0_4_ + -0x18))->_capacity; uVar10 = local_260._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_260._buf._0_4_ + (-4 - (int)psVar18))) { LAB_00983056: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar18,uVar10); } local_260._size = 0; local_260._capacity = 0xf; local_260._buf._0_4_ = local_260._buf._0_4_ & 0xffffff00; } LAB_00983081: _glfw_context_reset(1); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } ExceptionList = local_1c; return; } //@@ 00983190 Menu_Game::on_online_connect_result /* DB: ? Menu_Game::Update callback: closes popup id param_2+0x240 (PopupManager::close); result 0 -> MenuManager::push_menu(0x13 online menu), else OK popup "##PLATFORM###NOT_CONNECTED_TO_SERVER" */ void Menu_Game::on_online_connect_result(int param_1,int param_2) { int unused; undefined1 local_c4 [84]; undefined1 local_70 [12]; undefined1 local_64 [12]; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; Vector local_1c; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b09400; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = -1; PopupManager::close(&g_manager[1]._gamestate.field_0xcf0,(int *)(param_2 + 0x240),&local_14); *(int *)(param_2 + 0x240) = -1; if (param_1 == 0) { MenuManager::push_menu(0x13,unused); ExceptionList = local_10; return; } local_1c.x = (float)&DAT_bf800000; local_1c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_c4,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_1c); local_8 = 0; MessagePopup::add_ok_button((byte *)"##PLATFORM###NOT_CONNECTED_TO_SERVER",local_c4); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_c4); local_48 = 0; local_44 = 0; local_50 = 0; local_4c = 0; local_58 = 0; local_54 = 0; FID_conflict__Tidy(local_64); FID_conflict__Tidy(local_70); ExceptionList = local_10; return; } //@@ 009832b0 std::vector::erase /* DB: erase one 0x18-byte std::string at param_2 by shifting the rest down; Menu_Game::PreRenderContinueImg */ void std::vector::erase(undefined4 *param_1,char *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; char *pcVar4; char *pcVar5; char *this; pcVar4 = *(char **)(in_ECX + 4); pcVar5 = param_2 + 0x18; this = param_2; if (pcVar5 != pcVar4) { do { if (this != pcVar5) { string::_Tidy_deallocate(this); uVar1 = *(undefined4 *)(pcVar5 + 4); uVar2 = *(undefined4 *)(pcVar5 + 8); uVar3 = *(undefined4 *)(pcVar5 + 0xc); *(undefined4 *)this = *(undefined4 *)pcVar5; *(undefined4 *)(this + 4) = uVar1; *(undefined4 *)(this + 8) = uVar2; *(undefined4 *)(this + 0xc) = uVar3; uVar1 = *(undefined4 *)(pcVar5 + 0x14); *(undefined4 *)(this + 0x10) = *(undefined4 *)(pcVar5 + 0x10); *(undefined4 *)(this + 0x14) = uVar1; pcVar5[0x10] = '\0'; pcVar5[0x11] = '\0'; pcVar5[0x12] = '\0'; pcVar5[0x13] = '\0'; pcVar5[0x14] = '\x0f'; pcVar5[0x15] = '\0'; pcVar5[0x16] = '\0'; pcVar5[0x17] = '\0'; *pcVar5 = '\0'; } pcVar5 = pcVar5 + 0x18; this = this + 0x18; } while (pcVar5 != pcVar4); pcVar4 = *(char **)(in_ECX + 4); } string::_Tidy_deallocate(pcVar4 + -0x18); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -0x18; *param_1 = param_2; return; } //@@ 00983330 GridEntity_PressurePlate::Update /* ZHL [exact] void Update(); */ void __thiscall GridEntity_PressurePlate::Update(GridEntity_PressurePlate *this) { uint uVar1; if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } if ((this->_desc)._variant == 2) { update_greed_button(this); } else { update_press(); } uVar1 = this->_gridIndex; if ((((0x1bf < uVar1) || (*(int *)((int)g_game->_room + uVar1 * 4 + 0x76c) < 300)) && ((this->_desc)._state == 0)) && (uVar1 < 0x1c0)) { *(undefined4 *)((int)g_game->_room + uVar1 * 4 + 0x76c) = 300; } return; } //@@ 009833c0 GridEntity_PressurePlate::update_press /* DB: player within 30 presses it (Switched, state 3) then Reward; trap plate sets room+0x11ec = 10 (room-features) */ void __thiscall GridEntity_PressurePlate::update_press(GridEntity_PressurePlate *this) { byte bVar1; byte *pbVar2; byte *animNameCursor; uint uVar3; int iVar4; char *pcVar5; byte *offNameCursor; qword *allocCounter; bool bVar6; float dx; float dy; float pressRadiusSq; float gridOriginY; EntityList_EL nearbyEntities; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; qword oldAllocated; Entity_Player *presser; local_8 = 0xffffffff; puStack_c = &LAB_00af245d; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = *(int *)((int)g_game->_room + 0xc); local_18.x = (float)(this->_gridIndex % iVar4) * 40.0 + 40.0; local_18.y = (float)(this->_gridIndex / iVar4) * 40.0 + 120.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&local_18,60.0,0x28); local_8 = 0; local_18.y = 0.0; if ((float)nearbyEntities._size != 0.0) { pressRadiusSq = 900.0; gridOriginY = 120.0; do { presser = *(Entity_Player **)((int)nearbyEntities._data + (int)local_18.y * 4); iVar4 = presser->_type; if (((iVar4 == 1) && (presser->_isCoopGhost != 0)) || ((presser->_dead == 0 && ((((iVar4 == 1 && (presser->_isCoopGhost == 0)) && (bVar1 = Entity_Player::IsHologram(presser), bVar1 == 0)) || (((*(int *)&g_game->_deathmatchManager < 2 || (iVar4 != 1)) && ((iVar4 - 10U < 0x3de && ((iVar4 == 0x36d || (iVar4 == 0x35)))))))))))) { manager = g_manager; iVar4 = *(int *)((int)g_game->_room + 0xc); dy = ((float)(this->_gridIndex / iVar4) * 40.0 + gridOriginY) - (presser->_pos).y; dx = ((float)(this->_gridIndex % iVar4) * 40.0 + 40.0) - (presser->_pos).x; if (((this->_desc)._state == 0) && (dy * dy + dx * dx < pressRadiusSq)) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) goto LAB_00983599; pbVar2 = (this->_sprite)._animState._animData; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pcVar5 = "Switched"; goto LAB_00983570; } } local_18.y = (float)((int)local_18.y + 1); } while ((uint)local_18.y < (uint)nearbyEntities._size); } goto LAB_00983648; while( true ) { bVar1 = pbVar2[1]; bVar6 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_00983590; pbVar2 = pbVar2 + 2; pcVar5 = pcVar5 + 2; if (bVar1 == 0) break; LAB_00983570: bVar1 = *pbVar2; bVar6 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_00983590: uVar3 = -(uint)bVar6 | 1; goto LAB_00983595; } if (bVar1 == 0) break; } uVar3 = 0; LAB_00983595: if (uVar3 != 0) { LAB_00983599: local_18.y = 6.57209e-43; seed_fart_sound_override((int *)&local_18.y); SoundEffects::Play(&manager->_sfxManager,(int)local_18.y,1.0,2,0,1.0,0.0); } pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != (byte *)0x0) { animNameCursor = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { animNameCursor = *(byte **)pbVar2; } pcVar5 = "Switched"; do { bVar1 = *animNameCursor; bVar6 = bVar1 < (byte)*pcVar5; if (bVar1 != *pcVar5) { LAB_00983610: uVar3 = -(uint)bVar6 | 1; goto LAB_00983615; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; bVar6 = bVar1 < (byte)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_00983610; animNameCursor = animNameCursor + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00983615: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00983648; } bVar1 = ANM2::SetAnimation(&this->_sprite,(byte *)"Switched",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00983648: if ((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) && ((this->_desc)._state == 0)) { (this->_desc)._state = 3; pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 == (byte *)0x0) { LAB_009836b8: bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b7cf1c,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { animNameCursor = *(byte **)pbVar2; } offNameCursor = &DAT_00b7cf1c; do { bVar1 = *animNameCursor; bVar6 = bVar1 < *offNameCursor; if (bVar1 != *offNameCursor) { LAB_009836a2: uVar3 = -(uint)bVar6 | 1; goto LAB_009836a7; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; bVar6 = bVar1 < offNameCursor[1]; if (bVar1 != offNameCursor[1]) goto LAB_009836a2; animNameCursor = animNameCursor + 2; offNameCursor = offNameCursor + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009836a7: if ((uVar3 != 0) || ((pbVar2[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_009836b8; } Reward(this); } game = g_game; iVar4 = (this->_desc)._state; if (iVar4 == 0) { if ((this->_desc)._variant != 0) goto LAB_00983750; *(undefined4 *)((int)g_game->_room + 0x11ec) = 10; iVar4 = (this->_desc)._state; } if (((iVar4 == 4) && ((this->_desc)._variant == 1)) && (pcVar5 = game->_room, *pcVar5 != '\0')) { iVar4 = game->_frameCount - *(int *)(pcVar5 + 0x11f0); if (iVar4 == 4) { Reward(this); } else if ((4 < iVar4) && ((*(byte *)(*(int *)(pcVar5 + 4) + 0x44) & 1) != 0)) { (this->_desc)._state = 3; } } LAB_00983750: if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { uVar3 = *(uint *)((int)nearbyEntities._data + -4); oldAllocated = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar3; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)oldAllocated < uVar3); free((void *)((int)nearbyEntities._data + -4)); } } ExceptionList = local_10; return; } //@@ 009837b0 GridEntity_PressurePlate::update_greed_button_anim /* DB: switch on _desc._state (+0xc) picks the anim name stored at +0x268: "Switched"/"SwitchedRed"/"SwitchedSkull"/"SwitchedPentagram", "On"/"OnSkull"/"OnPentagram", "Off*" by Game::IsGreedBoss/IsGreedFinalBoss; update_greed_button, BeginBatches */ void __thiscall GridEntity_PressurePlate::update_greed_button_anim(GridEntity_PressurePlate *this,char param_2) { byte bVar1; char *pcVar2; switch((this->_desc)._state) { case 0: break; case 1: case 2: if (param_2 != '\0') { this->_nextGreedAnimation = "SwitchedRed"; return; } bVar1 = Game::IsGreedFinalBoss(); if (bVar1 != 0) { this->_nextGreedAnimation = "SwitchedPentagram"; return; } bVar1 = Game::IsGreedBoss(); pcVar2 = "SwitchedSkull"; if (bVar1 == 0) { pcVar2 = "Switched"; } this->_nextGreedAnimation = pcVar2; return; case 3: bVar1 = Game::IsGreedFinalBoss(); if (bVar1 != 0) { this->_nextGreedAnimation = "OnPentagram"; return; } bVar1 = Game::IsGreedBoss(); pcVar2 = "OnSkull"; if (bVar1 == 0) { pcVar2 = "On"; } this->_nextGreedAnimation = pcVar2; default: return; } if (param_2 != '\0') { ANM2::Play(&this->_sprite,(byte *)"OffRedStart",0); this->_nextGreedAnimation = "OffRed"; return; } bVar1 = Game::IsGreedFinalBoss(); if (bVar1 != 0) { this->_nextGreedAnimation = "OffPentagram"; return; } bVar1 = Game::IsGreedBoss(); pcVar2 = "OffSkull"; if (bVar1 == 0) { pcVar2 = "Off"; } this->_nextGreedAnimation = pcVar2; return; } //@@ 009838c0 GridEntity_PressurePlate::play_pending_animation /* DB: ? thiscall: if the current animation name (+0x74) differs from the target name (+0x268) and it is not "OffRedStart" while +0x84 is set, ANM2::Play(sprite +0x40, target); GridEntity_PressurePlate::update_greed_button, BeginBatches */ void __thiscall GridEntity_PressurePlate::play_pending_animation(GridEntity_PressurePlate *this) { byte bVar1; byte *pbVar2; uint uVar3; byte *pbVar4; byte *pbVar5; char *pcVar6; bool bVar7; pbVar4 = (this->_sprite)._animState._animData; if (pbVar4 == (byte *)0x0) { pbVar2 = &s_empty; } else { pbVar2 = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar2 = *(byte **)pbVar4; } } pbVar5 = this->_nextGreedAnimation; do { bVar1 = *pbVar2; bVar7 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_00983903: uVar3 = -(uint)bVar7 | 1; goto LAB_00983908; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar7 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_00983903; pbVar2 = pbVar2 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00983908: if (uVar3 != 0) { if ((pbVar4 != (byte *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { if (pbVar4 == (byte *)0x0) { pbVar4 = &s_empty; } else if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar6 = "OffRedStart"; do { bVar1 = *pbVar4; bVar7 = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_00983953: uVar3 = -(uint)bVar7 | 1; goto LAB_00983958; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar7 = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_00983953; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00983958: if (uVar3 == 0) { return; } } ANM2::Play(&this->_sprite,this->_nextGreedAnimation,0); } return; } //@@ 00983970 Game::IsGreedBoss /* ZHL [exact] static bool Game::IsGreedBoss(); prototype: REPENTOGON */ byte __cdecl Game::IsGreedBoss(void) { int iVar1; iVar1 = g_game->_difficulty; if ((g_game->_greedModeWave + 1U < (iVar1 == 3) + 9) || ((iVar1 != 2 && (iVar1 != 3)))) { return 0; } return 1; } //@@ 009839b0 Game::IsGreedFinalBoss /* ZHL [exact] static bool Game::IsGreedFinalBoss(); prototype: REPENTOGON */ byte __cdecl Game::IsGreedFinalBoss(void) { int iVar1; iVar1 = g_game->_difficulty; if ((g_game->_greedModeWave + 1U < (iVar1 == 3) + 0xb) || ((iVar1 != 2 && (iVar1 != 3)))) { return 0; } return 1; } //@@ 009839f0 GridEntity_PressurePlate::update_greed_button /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: greed button (plate state 2 branch of Update): pressed mid-wave damages 1 heart (half), or sets state flag 11 (0x1839c|0x800) for health type 2 / instant death curse */ void __thiscall GridEntity_PressurePlate::update_greed_button(GridEntity_PressurePlate *this) { byte bVar1; undefined4 *playerSlot; byte *animNameChar; uint uVar2; int iVar3; Entity_Player *this_00; char *switchedAnimChar; void *pvVar4; PlayerManager *playerManager; Game *game; bool isLess; float fVar5; float deltaY; undefined1 auStack_84 [5]; char isPlayerOnButton; char isAllPlayersAway; byte isRoomClear; uint local_7c; undefined4 isWaveActive; int waveTimer; int effectEntry [3]; undefined4 uStack_64; undefined4 damageSource; undefined4 local_5c; undefined4 local_58; undefined4 local_54; float local_50; float local_4c; float local_48; float local_44; undefined4 local_40; undefined4 local_3c; undefined4 flashColor; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; uint local_c; Manager *manager; Entity_Player *player; int waveTimerNow; local_c = __security_cookie ^ (uint)auStack_84; playerManager = &g_game->_playerManager; isPlayerOnButton = '\0'; isAllPlayersAway = '\x01'; waveTimer = *(int *)((int)g_game->_room + 0x723c); isWaveActive = CONCAT31(isWaveActive._1_3_,0 < waveTimer); local_7c = 0; isRoomClear = *(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1; game = g_game; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar4 = (playerManager->_playerList)._end; if ((int)pvVar4 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (local_7c < (uint)((int)pvVar4 - (int)playerSlot >> 2)) { playerSlot = playerSlot + local_7c; } player = (Entity_Player *)*playerSlot; if ((player->_variant == 0) && (player->_isCoopGhost == 0)) { iVar3 = *(int *)((int)game->_room + 0xc); deltaY = ((float)(this->_gridIndex / iVar3) * 40.0 + 120.0) - (player->_pos).y; fVar5 = ((float)(this->_gridIndex % iVar3) * 40.0 + 40.0) - (player->_pos).x; fVar5 = deltaY * deltaY + fVar5 * fVar5; if ((isPlayerOnButton != '\0') || (isPlayerOnButton = '\0', fVar5 < 625.0)) { isPlayerOnButton = '\x01'; } if ((isAllPlayersAway == '\0') || (isAllPlayersAway = '\x01', fVar5 <= 900.0)) { isAllPlayersAway = '\0'; } if ((fVar5 < 625.0) && ((this->_desc)._state == 0)) { if (0 < waveTimer) { iVar3 = Entity_Player::GetHealthType(player); if ((iVar3 == 2) || (bVar1 = Entity_Player::HasInstantDeathCurse(this_00), bVar1 != 0)) { game->_levelStateFlags = game->_levelStateFlags | 0x800; } else { damageSource = 0; local_5c = 0; local_58 = 0; local_54 = 0; local_50 = g_vectorZero.x; local_4c = g_vectorZero.y; local_48 = g_vectorZero.x; local_44 = g_vectorZero.y; local_40 = 0; local_3c = 0; (**(code **)(*(int *)player + 0x20))(0x3f800000,0x10000080,0,&damageSource,0x1e); game = g_game; } } break; } } playerManager = &game->_playerManager; local_7c = local_7c + 1; } while (local_7c < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } iVar3 = (this->_desc)._state; if ((iVar3 == 0) && (isPlayerOnButton != '\0')) { (this->_desc)._state = 1; manager = g_manager; if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { LAB_00983c89: local_7c = 0x1d5; seed_fart_sound_override((int *)&local_7c); SoundEffects::Play(&manager->_sfxManager,local_7c,1.0,2,0,1.0,0.0); } else { animNameChar = (this->_sprite)._animState._animData; if (0xf < *(uint *)(animNameChar + 0x14)) { animNameChar = *(byte **)animNameChar; } switchedAnimChar = "Switched"; do { bVar1 = *animNameChar; isLess = bVar1 < (byte)*switchedAnimChar; if (bVar1 != *switchedAnimChar) { LAB_00983c80: uVar2 = -(uint)isLess | 1; goto LAB_00983c85; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < (byte)switchedAnimChar[1]; if (bVar1 != switchedAnimChar[1]) goto LAB_00983c80; animNameChar = animNameChar + 2; switchedAnimChar = switchedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_00983c85: if (uVar2 != 0) goto LAB_00983c89; } update_greed_button_anim(this,isWaveActive); iVar3 = (this->_desc)._state; game = g_game; } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { if (iVar3 == 1) { if (waveTimer < 1) { Room::SpawnGreedModeWave(game->_room,0); uVar2 = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar4 = (playerManager->_playerList)._end; if ((int)pvVar4 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (uVar2 < (uint)((int)pvVar4 - (int)playerSlot >> 2)) { playerSlot = playerSlot + uVar2; } player = (Entity_Player *)*playerSlot; bVar1 = Entity_Player::HasCollectible(player,299,0); if (((bVar1 != 0) || (iVar3 = Entity_Player::GetZodiacEffect(player), iVar3 == 299)) && (bVar1 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,299), bVar1 == 0)) { player->_taurusSpeedBonus = 0.0; uStack_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_18 = 0; uStack_14 = 0; uStack_10 = 0; flashColor = 0x3f800000; uStack_34 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x3f800000; (**(code **)(*(int *)player + 0x3c))(&flashColor,0xffffffff,0xff,0,1); pvVar4 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4ac < (int)((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 & 0xfffffffcU)) && (iVar3 = *(int *)((int)pvVar4 + 0x4ac), iVar3 != 0) ) { effectEntry[2] = *(undefined4 *)(iVar3 + 0x78); effectEntry[1] = 0; uStack_64 = 0; effectEntry[0] = iVar3; TemporaryEffects::AddEffect(&player->_temporaryeffects,effectEntry,1,1); } } uVar2 = uVar2 + 1; playerManager = &g_game->_playerManager; } while (uVar2 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } else { *(undefined4 *)((int)game->_room + 0x723c) = 0xffffffff; } } else if (iVar3 != 2) goto LAB_00983ea2; (this->_desc)._state = 3; update_greed_button_anim(this,isWaveActive); iVar3 = (this->_desc)._state; game = g_game; } LAB_00983ea2: waveTimerNow = *(int *)((int)game->_room + 0x723c); isWaveActive = CONCAT31(isWaveActive._1_3_,0 < waveTimerNow); if (iVar3 == 3) { if (((isAllPlayersAway == '\0') || ((game->_difficulty == 3) + 0xb <= (uint)game->_greedModeWave)) || ((waveTimerNow < 1 && (isRoomClear == 0)))) goto LAB_00983f0b; (this->_desc)._state = 0; } else { if (((iVar3 != 0) || (0 < waveTimerNow)) || (isRoomClear != 0)) goto LAB_00983f0b; (this->_desc)._state = 2; } update_greed_button_anim(this,isWaveActive); LAB_00983f0b: play_pending_animation(this); return; } //@@ 00983f30 pressure_plate_kill_enemies_timer_callback /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: timer callback: GridEntity_PressurePlate::Reward passes it to Entity_Effect::CreateTimer(cb,1,-1) after PlayWithFartOverride(0x10b)/ShakeScreen; it loops room entities, TakeDamage(1000) from the timer's parent, spawns effect 1000.15 poofs, Removes the timer after 4 empty ticks */ void pressure_plate_kill_enemies_timer_callback(int *param_1) { int *piVar1; bool bVar2; char cVar3; uint uVar4; Entity *pEVar5; uint uVar6; uint uVar7; int iVar8; uint local_fc; int *local_f8; int local_f4; code *pcStack_f0; int local_ec; int local_e8; void *local_e4; undefined4 uStack_e0; undefined4 uStack_dc; undefined4 uStack_d8; undefined4 uStack_d4; float fStack_d0; float fStack_cc; float fStack_c8; float fStack_c4; uint uStack_c0; int iStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined4 uStack_b0; undefined4 uStack_ac; float fStack_a8; float fStack_a4; float fStack_a0; float fStack_9c; uint uStack_98; int iStack_94; Vector VStack_90; undefined4 uStack_88; undefined4 uStack_84; undefined4 uStack_80; undefined4 uStack_7c; float fStack_78; float fStack_74; float fStack_70; float fStack_6c; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; float fStack_50; float fStack_4c; float fStack_48; float fStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; uint local_c; local_c = __security_cookie ^ (uint)&local_fc; local_e4 = g_game->_room; bVar2 = true; local_e8 = g_game->_frameCount; local_ec = param_1[0xca]; local_f8 = param_1; local_f4 = 0; local_fc = 0; if (*(int *)((int)local_e4 + 0x1264) != 0) { do { piVar1 = *(int **)(*(int *)((int)local_e4 + 0x125c) + local_fc * 4); if (((*(int *)&g_game->_deathmatchManager < 2) || (piVar1[10] != 1)) && (0x3dd < piVar1[10] - 10U)) { LAB_00984300: if (piVar1[10] == 9) { if (*(char *)((int)local_f8 + 0x173) != '\0') goto LAB_009844e4; fStack_50 = g_vectorZero.x; fStack_48 = g_vectorZero.x; fStack_4c = g_vectorZero.y; fStack_44 = g_vectorZero.y; uStack_60 = 0; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; uStack_40 = 0; uStack_3c = 0; (**(code **)(*piVar1 + 0x24))(&uStack_60); } else { if ((piVar1[10] != 0x21) || (piVar1[0xb] != 10)) goto LAB_009844e4; piVar1[0xe0] = 0x3dcccccd; iStack_94 = local_f8[0xef]; pcStack_f0 = *(code **)(*piVar1 + 0x20); if (iStack_94 == 0) { uStack_b8 = 0; uStack_b4 = 0; uStack_b0 = 0; uStack_ac = 0; fStack_a8 = g_vectorZero.x; fStack_a4 = g_vectorZero.y; fStack_a0 = g_vectorZero.x; fStack_9c = g_vectorZero.y; LAB_00984479: uStack_98 = 0; if (iStack_94 != 0) goto LAB_0098447f; uStack_98 = 0; LAB_00984498: uVar7 = 0; if (iStack_94 != 0) goto LAB_0098449e; LAB_009844b7: uVar4 = 0; } else { uStack_b8 = *(undefined4 *)(iStack_94 + 0x28); uStack_b4 = *(undefined4 *)(iStack_94 + 0x2c); uStack_b0 = *(undefined4 *)(iStack_94 + 0x34); uStack_ac = *(undefined4 *)(iStack_94 + 0x38); fStack_a8 = *(float *)(iStack_94 + 0x33c); fStack_a4 = *(float *)(iStack_94 + 0x340); fStack_a0 = *(float *)(iStack_94 + 0x360); fStack_9c = *(float *)(iStack_94 + 0x364); if ((*(uint *)(iStack_94 + 0x168) & 0x100) == 0) goto LAB_00984479; uStack_98 = 1; LAB_0098447f: if ((*(uint *)(iStack_94 + 0x168) & 0x20000000) == 0) goto LAB_00984498; uVar7 = 2; LAB_0098449e: if ((*(uint *)(iStack_94 + 0x16c) & 0x400000) == 0) goto LAB_009844b7; uVar4 = 4; } uStack_98 = uVar4 | uVar7 | uStack_98; (*pcStack_f0)(0x447a0000,0,0,&uStack_b8,0x1e); } LAB_009844de: bVar2 = false; } else { cVar3 = (**(code **)(*piVar1 + 0x48))(); iVar8 = local_f4; if (cVar3 == '\0') goto LAB_00984300; uVar7 = piVar1[0x5a]; uVar4 = piVar1[0x5b]; if ((((uVar7 & 0x20000000) != 0) || (piVar1[10] == 0x322)) || (piVar1[10] == 0x362)) goto LAB_00984300; if ((*(char *)((int)piVar1 + 0x173) == '\0') && (local_f4 < 10)) { uVar6 = uVar4 | 0x200000; piVar1[0x5a] = uVar7; piVar1[0x5b] = uVar6; if (local_e8 != local_ec) { uVar6 = uVar4 | 0x200800; piVar1[0x5a] = uVar7; piVar1[0x5b] = uVar6; } if ((float)piVar1[0xe0] <= 0.0) { fStack_78 = g_vectorZero.x; fStack_70 = g_vectorZero.x; fStack_74 = g_vectorZero.y; fStack_6c = g_vectorZero.y; uStack_88 = 0; uStack_84 = 0; uStack_80 = 0; uStack_7c = 0; uStack_68 = 0; uStack_64 = 0; (**(code **)(*piVar1 + 0x24))(&uStack_88); } else { piVar1[0x5b] = uVar6; piVar1[0xe0] = 0; pcStack_f0 = *(code **)(*piVar1 + 0x20); *(undefined1 *)(piVar1 + 0xec) = 0; piVar1[0x5a] = uVar7 & 0xfffffffe; iStack_bc = local_f8[0xef]; if (iStack_bc == 0) { uStack_e0 = 0; uStack_dc = 0; uStack_d8 = 0; uStack_d4 = 0; fStack_d0 = g_vectorZero.x; fStack_cc = g_vectorZero.y; fStack_c8 = g_vectorZero.x; fStack_c4 = g_vectorZero.y; LAB_0098415a: uStack_c0 = 0; if (iStack_bc != 0) goto LAB_00984160; uStack_c0 = 0; LAB_00984179: uVar7 = 0; if (iStack_bc != 0) goto LAB_0098417f; LAB_00984198: uVar4 = 0; } else { uStack_e0 = *(undefined4 *)(iStack_bc + 0x28); uStack_dc = *(undefined4 *)(iStack_bc + 0x2c); uStack_d8 = *(undefined4 *)(iStack_bc + 0x34); uStack_d4 = *(undefined4 *)(iStack_bc + 0x38); fStack_d0 = *(float *)(iStack_bc + 0x33c); fStack_cc = *(float *)(iStack_bc + 0x340); fStack_c8 = *(float *)(iStack_bc + 0x360); fStack_c4 = *(float *)(iStack_bc + 0x364); if ((*(uint *)(iStack_bc + 0x168) & 0x100) == 0) goto LAB_0098415a; uStack_c0 = 1; LAB_00984160: if ((*(uint *)(iStack_bc + 0x168) & 0x20000000) == 0) goto LAB_00984179; uVar7 = 2; LAB_0098417f: if ((*(uint *)(iStack_bc + 0x16c) & 0x400000) == 0) goto LAB_00984198; uVar4 = 4; } uStack_c0 = uVar4 | uVar7 | uStack_c0; (*pcStack_f0)(0x447a0000,0,0,&uStack_e0,0x1e); iVar8 = local_f4; } if (local_e8 == local_ec) { uStack_38 = 0x3f800000; uStack_34 = 0x3e99999a; uStack_30 = 0x3e99999a; uStack_2c = 0x3f800000; uStack_18 = 0; uStack_14 = 0; uStack_28 = 0; uStack_24 = 0; uStack_20 = 0; uStack_1c = 0; uStack_10 = 0; uVar7 = Random(); VStack_90.x = (float)piVar1[0xcf]; VStack_90.y = (float)piVar1[0xd0]; pEVar5 = Game::SpawnEx(g_game,1000,0xf,&VStack_90,&g_vectorZero,(Entity *)0x0,0,uVar7,0) ; (**(code **)(*(int *)pEVar5 + 0x3c))(&uStack_38,0xffffffff,0xff,0,1); (**(code **)(*(int *)pEVar5 + 0xc))(); } local_f4 = iVar8 + 1; goto LAB_009844de; } } LAB_009844e4: local_fc = local_fc + 1; } while (local_fc < *(uint *)((int)local_e4 + 0x1264)); } if (bVar2) { iVar8 = local_f8[0x114]; local_f8[0x114] = iVar8 + 1; if (4 < iVar8 + 1) { (**(code **)(*local_f8 + 0x28))(); return; } } else { local_f8[0x114] = 0; } return; } //@@ 00984550 GridEntity_PressurePlate::Reward /* ZHL [lua] Lua binding GridEntityPressurePlate:Reward prototype: db/protos.zhl */ void __thiscall GridEntity_PressurePlate::Reward(GridEntity_PressurePlate *door) { code *pcVar1; Vector pos; Vector pos_00; Vector pos_01; Vector pos_02; Vector pos_03; Vector pos_04; Vector pos_05; Vector pos_06; GridEntity *pGVar2; ANM2 *pAVar3; byte isTrapDoorAllowed; int targetRoomType; GridEntity *poop; Vector *tmpPos; uint rngValue; float fVar5; Entity_Player *player; RoomDescriptor *roomDesc; Entity_Effect *timerEffect; void *pvVar6; int iVar7; uint uVar8; Game *game; float *positionsEnd; float *positionsCapacity; float fVar9; RNG rng; float *spawnPositions; float *spawnPositionsEnd; float *spawnPositionsCapacity; Vector local_68; Vector local_60; Vector local_58; Vector local_4c; Vector local_44; float local_3c; void *local_38; float local_34; void *local_30; float *local_2c; uint enemyVariant; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; GridEntity_Door *door; Manager *manager; undefined4 *oldGridEntity; Room *room; uint *roomFlags; int targetRoomType; manager = g_manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0ce51; local_1c = ExceptionList; uVar8 = (door->_desc)._variant; local_58.y = (float)door; if (uVar8 != 1) { if (9 < uVar8) { if (uVar8 < 0xe) { ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); Room::TriggerOutput(g_game->_room,uVar8 - 10); ExceptionList = local_1c; return; } return; } if (uVar8 != 9) { if (uVar8 == 3) { ExceptionList = &local_1c; Level::raise_mineshaft_rail((Level *)g_game); ExceptionList = local_1c; return; } return; } ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); tmpPos = GridEntity::Position((GridEntity *)door,&local_68); player = Game::GetNearestPlayerEx(tmpPos,1,0,0); if (player == (Entity_Player *)0x0) { player = Game::GetPlayer(g_game,0); } iVar7 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); targetRoomType = 0; if (0 < iVar7) { targetRoomType = iVar7; } if (targetRoomType < 1) { ExceptionList = local_1c; return; } SoundEffects::PlayWithFartOverride(0x10b,1.0,0x14,0,1.0); SoundEffects::PlayWithFartOverride(0x21,1.0,0x14,0,1.0); Game::ShakeScreen(g_game,0xf); timerEffect = Entity_Effect::CreateTimer (pressure_plate_kill_enemies_timer_callback,1,0xffffffff,0); Entity::SetParent((Entity *)timerEffect,(Entity *)player); ExceptionList = local_1c; return; } uVar8 = (door->_desc)._spawnSeed; rng._shift1 = 5; rng._shift2 = 9; local_2c = (float *)0x7; rng._shift3 = 7; if (uVar8 == 0) { ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; rng._seed = uVar8 >> 7 ^ uVar8; local_38 = (void *)rng._seed; if ((rng._seed & 1U) == 0) { local_30 = (void *)0x10c; ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,2,0,1.0,0.0); targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; Room::FindFreePickupSpawnPosition(g_game->_room,&local_4c,&local_58,0.0,1,0,0); if (local_38 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = (uint)local_38 >> ((byte)rng._shift1 & 0x1f) ^ (uint)local_38; uVar8 = uVar8 << ((byte)rng._shift2 & 0x1f) ^ uVar8; rng._seed = uVar8 >> ((byte)local_2c & 0x1f) ^ uVar8; uVar8 = (uint)rng._seed % 100; if (uVar8 < 5) { isTrapDoorAllowed = Level::CanSpawnTrapDoor((Level *)g_game); if (isTrapDoorAllowed != 0) { room = g_game->_room; uVar8 = RNG::Next(&rng); targetRoomType = Room::GetGridIndex(g_game->_room,&local_4c); Room::SpawnGridEntity(room,targetRoomType,0x11,0,uVar8,0); ExceptionList = local_1c; return; } } else if (9 < uVar8) { if (uVar8 < 0xb) { pvVar6 = g_game->_room; local_30 = pvVar6; local_38 = (void *)RNG::Next(&rng); uVar8 = Room::GetGridIndex(g_game->_room,&local_4c); if (((int)uVar8 < 0) || (0x1bf < (int)uVar8)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (0x1bf < uVar8) { ExceptionList = local_1c; return; } if (900 < *(int *)((int)pvVar6 + uVar8 * 4 + 0x76c)) { ExceptionList = local_1c; return; } poop = operator_new(0x19c); local_14 = 0x1e; local_58.y = (float)poop; if (poop == (GridEntity *)0x0) { poop = (GridEntity *)0x0; } else { GridEntity::GridEntity(poop); *(undefined ***)poop = IsaacRepentancePlus::GridEntity_Poop::vftable; poop[1]._desc._type = 0; poop[1]._desc._spawnSeed = 0; poop[1]._desc._varData = 0xf; *(undefined1 *)&poop[1]._desc._type = 0; poop[1]._desc._variableSeed = 0; poop[1]._gridIndex = 0; poop[1]._spawnFrame = 0; poop[1]._rng._seed = 0; fVar5 = g_vectorZero.y; poop[1]._rng._shift1 = (int)g_vectorZero.x; poop[1]._rng._shift2 = (int)fVar5; fVar5 = g_vectorZero.y; poop[1]._rng._shift3 = (int)g_vectorZero.x; poop[1]._collisionClass = (int)fVar5; pGVar2 = poop + 1; (pGVar2->_sprite)._filename._buf[0] = '\0'; (pGVar2->_sprite)._filename._buf[1] = '\0'; (pGVar2->_sprite)._filename._buf[2] = '\0'; (pGVar2->_sprite)._filename._buf[3] = '\0'; pAVar3 = &poop[1]._sprite; (pAVar3->_filename)._buf[4] = '\0'; (pAVar3->_filename)._buf[5] = '\0'; (pAVar3->_filename)._buf[6] = '\0'; (pAVar3->_filename)._buf[7] = '\0'; } local_14 = 0xffffffff; if (poop == (GridEntity *)0x0) { ExceptionList = local_1c; return; } (poop->_desc)._type = 0xe; poop->_gridIndex = uVar8; oldGridEntity = *(undefined4 **)((int)local_30 + uVar8 * 4 + 0x24); if (oldGridEntity != (undefined4 *)0x0) { (**(code **)*oldGridEntity)(1); } *(GridEntity **)((int)local_30 + uVar8 * 4 + 0x24) = poop; (poop->_desc)._variant = 0; goto LAB_009848ac; } if (uVar8 < 0xc) { uVar8 = RNG::Next(&rng); Game::Spawn(g_game,5,100,&local_4c,&g_vectorZero,(Entity *)0x0,0,uVar8); ExceptionList = local_1c; return; } if (uVar8 < 0x1e) { uVar8 = RNG::RandomInt(&rng,3); local_30 = (void *)(uVar8 + 1); if ((int)local_30 < 1) { ExceptionList = local_1c; return; } do { targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_58,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; uVar8 = RNG::Next(&rng); Game::Spawn(g_game,5,0x14,&local_4c,&g_vectorZero,(Entity *)0x0,0,uVar8); local_30 = (void *)((int)local_30 + -1); } while (local_30 != (void *)0x0); ExceptionList = local_1c; return; } if (uVar8 < 0x32) { uVar8 = RNG::RandomInt(&rng,2); local_30 = (void *)(uVar8 + 1); if ((int)local_30 < 1) { ExceptionList = local_1c; return; } do { targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_58,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; uVar8 = RNG::Next(&rng); Game::Spawn(g_game,5,10,&local_4c,&g_vectorZero,(Entity *)0x0,0,uVar8); local_30 = (void *)((int)local_30 + -1); } while (local_30 != (void *)0x0); ExceptionList = local_1c; return; } if (uVar8 < 0x46) { uVar8 = RNG::RandomInt(&rng,2); local_30 = (void *)(uVar8 + 1); if ((int)local_30 < 1) { ExceptionList = local_1c; return; } do { targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_58,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; uVar8 = RNG::Next(&rng); Game::Spawn(g_game,5,0x28,&local_4c,&g_vectorZero,(Entity *)0x0,0,uVar8); local_30 = (void *)((int)local_30 + -1); } while (local_30 != (void *)0x0); ExceptionList = local_1c; return; } if (uVar8 < 0x50) { uVar8 = RNG::Next(&rng); rngValue = RNG::RandomInt(&rng,4); Game::Spawn(g_game,5,*(uint *)(&DAT_00b7cfa0 + rngValue * 4),&local_4c,&g_vectorZero, (Entity *)0x0,0,uVar8); ExceptionList = local_1c; return; } if (0x54 < uVar8) { if (0x59 < uVar8) { uVar8 = RNG::Next(&rng); Game::Spawn(g_game,4,3,&local_4c,&g_vectorZero,(Entity *)0x0,0,uVar8); ExceptionList = local_1c; return; } local_58.y = local_4c.y + 0.0; local_58.x = local_4c.x + 40.0; room = g_game->_room; pos_03.y = local_58.y; pos_03.x = local_58.x; local_38 = (void *)local_58.y; targetRoomType = Room::GetGridCollisionAtPos(room,pos_03); if (targetRoomType == 0) { LAB_00984f49: local_58.x = local_4c.x + 0.0; local_58.y = local_4c.y + 40.0; pos_05.y = local_58.y; pos_05.x = local_58.x; local_38 = (void *)local_58.x; targetRoomType = Room::GetGridCollisionAtPos(room,pos_05); if (targetRoomType == 0) goto LAB_00984fe7; local_58.y = local_4c.y - 40.0; local_58.x = (float)local_38; pos_06.y = local_58.y; pos_06.x = (float)local_38; targetRoomType = Room::GetGridCollisionAtPos(room,pos_06); if (targetRoomType == 0) goto LAB_00984fe7; } else { local_58.x = local_4c.x - 40.0; local_58.y = (float)local_38; pos_04.y = (float)local_38; pos_04.x = local_58.x; targetRoomType = Room::GetGridCollisionAtPos(room,pos_04); if (targetRoomType == 0) goto LAB_00984f49; } tmpPos = Room::GetCenterPos(&local_60); tmpPos = Room::FindFreePickupSpawnPosition(room,&local_58,tmpPos,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; LAB_00984fe7: uVar8 = RNG::Next(&rng); Game::Spawn(g_game,6,8,&local_4c,&g_vectorZero,(Entity *)0x0,0,uVar8); ExceptionList = local_1c; return; } local_58.y = local_4c.y + 0.0; local_58.x = local_4c.x + 40.0; room = g_game->_room; pos.y = local_58.y; pos.x = local_58.x; local_38 = (void *)local_58.y; targetRoomType = Room::GetGridCollisionAtPos(room,pos); if (targetRoomType == 0) { LAB_00984de5: local_58.x = local_4c.x + 0.0; local_58.y = local_4c.y + 40.0; pos_01.y = local_58.y; pos_01.x = local_58.x; local_38 = (void *)local_58.x; targetRoomType = Room::GetGridCollisionAtPos(room,pos_01); if (targetRoomType == 0) goto LAB_00984e83; local_58.y = local_4c.y - 40.0; local_58.x = (float)local_38; pos_02.y = local_58.y; pos_02.x = (float)local_38; targetRoomType = Room::GetGridCollisionAtPos(room,pos_02); if (targetRoomType == 0) goto LAB_00984e83; } else { local_58.x = local_4c.x - 40.0; local_58.y = (float)local_38; pos_00.y = (float)local_38; pos_00.x = local_58.x; targetRoomType = Room::GetGridCollisionAtPos(room,pos_00); if (targetRoomType == 0) goto LAB_00984de5; } tmpPos = Room::GetCenterPos(&local_60); tmpPos = Room::FindFreePickupSpawnPosition(room,&local_58,tmpPos,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; LAB_00984e83: uVar8 = RNG::Next(&rng); rngValue = RNG::RandomInt(&rng,2); Game::Spawn(g_game,6,(-(uint)(rngValue != 0) & 2) + 1,&local_4c,&g_vectorZero,(Entity *)0x0,0, uVar8); ExceptionList = local_1c; return; } pvVar6 = g_game->_room; local_30 = pvVar6; local_38 = (void *)RNG::Next(&rng); uVar8 = Room::GetGridIndex(g_game->_room,&local_4c); if (((int)uVar8 < 0) || (0x1bf < (int)uVar8)) { KAGE_LogMessage(0x10,(byte *)"SpawnGridEntity: Grid index invalid\n"); } if (0x1bf < uVar8) { ExceptionList = local_1c; return; } if (900 < *(int *)((int)pvVar6 + uVar8 * 4 + 0x76c)) { ExceptionList = local_1c; return; } poop = operator_new(0x19c); local_14 = 7; local_58.y = (float)poop; if (poop == (GridEntity *)0x0) { poop = (GridEntity *)0x0; } else { GridEntity::GridEntity(poop); *(undefined ***)poop = IsaacRepentancePlus::GridEntity_Poop::vftable; poop[1]._desc._type = 0; poop[1]._desc._spawnSeed = 0; poop[1]._desc._varData = 0xf; *(undefined1 *)&poop[1]._desc._type = 0; poop[1]._desc._variableSeed = 0; poop[1]._gridIndex = 0; poop[1]._spawnFrame = 0; poop[1]._rng._seed = 0; fVar5 = g_vectorZero.y; poop[1]._rng._shift1 = (int)g_vectorZero.x; poop[1]._rng._shift2 = (int)fVar5; fVar5 = g_vectorZero.y; poop[1]._rng._shift3 = (int)g_vectorZero.x; poop[1]._collisionClass = (int)fVar5; pGVar2 = poop + 1; (pGVar2->_sprite)._filename._buf[0] = '\0'; (pGVar2->_sprite)._filename._buf[1] = '\0'; (pGVar2->_sprite)._filename._buf[2] = '\0'; (pGVar2->_sprite)._filename._buf[3] = '\0'; pAVar3 = &poop[1]._sprite; (pAVar3->_filename)._buf[4] = '\0'; (pAVar3->_filename)._buf[5] = '\0'; (pAVar3->_filename)._buf[6] = '\0'; (pAVar3->_filename)._buf[7] = '\0'; } local_14 = 0xffffffff; if (poop == (GridEntity *)0x0) { ExceptionList = local_1c; return; } (poop->_desc)._type = 0xe; poop->_gridIndex = uVar8; oldGridEntity = *(undefined4 **)((int)local_30 + uVar8 * 4 + 0x24); if (oldGridEntity != (undefined4 *)0x0) { (**(code **)*oldGridEntity)(1); } *(GridEntity **)((int)local_30 + uVar8 * 4 + 0x24) = poop; (poop->_desc)._variant = 3; LAB_009848ac: (poop->_desc)._varData = 0; GridEntity::Init(poop,(uint)local_38); ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); if ((door->_desc)._state != 4) { local_30 = (void *)0x10b; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); seed_fart_sound_override((int *)&local_30); SoundEffects::Play(&manager->_sfxManager,(int)local_30,1.0,2,0,1.0,0.0); } fVar5 = (float)(*(int *)((int)g_game->_room + 0x12c0) + *(int *)((int)g_game->_room + 0x12c4)); local_4c.y = 0.0; if (0 < (int)fVar5) { local_4c.y = fVar5; } local_24 = 0; enemyVariant = 0; uVar8 = RNG::RandomInt(&rng,3); local_3c = (float)(uVar8 + 2); if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { switch(g_game->_stage) { default: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_0; case 1: goto switchD_0098532f_caseD_1; case 2: goto switchD_0098532f_caseD_2; case 3: goto switchD_0098532f_caseD_3; case 4: goto switchD_0098532f_caseD_4; case 5: goto switchD_0098532f_caseD_5; default: break; } case 2: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_4; case 1: goto switchD_00985120_caseD_1; case 2: goto switchD_00985120_caseD_2; case 3: goto switchD_00985120_caseD_3; case 4: goto switchD_00985120_caseD_4; case 5: goto switchD_00985120_caseD_5; default: break; } case 3: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098513a_caseD_0; case 1: goto switchD_0098513a_caseD_1; case 2: goto switchD_0098513a_caseD_2; case 3: goto switchD_0098513a_caseD_3; case 4: goto switchD_0098513a_caseD_4; case 5: goto switchD_0098513a_caseD_5; default: break; } case 4: uVar8 = RNG::RandomInt(&rng,5); switch(uVar8) { case 0: goto switchD_00985154_caseD_0; case 1: goto switchD_00985154_caseD_1; case 2: goto switchD_00985154_caseD_2; case 3: goto switchD_00985154_caseD_3; case 4: goto switchD_00985154_caseD_4; default: break; } case 5: switchD_00985342_caseD_5: LAB_00985444: uVar8 = RNG::RandomInt(&rng,3); if (uVar8 != 0) { if (uVar8 == 1) { local_24 = 0x32; } else if (uVar8 == 2) { local_24 = 0x195; } break; } switchD_00985482_caseD_2: local_24 = 0x194; break; case 6: uVar8 = RNG::RandomInt(&rng,4); switch(uVar8) { case 0: goto switchD_00985482_caseD_0; case 1: goto switchD_00985482_caseD_1; case 2: goto switchD_00985482_caseD_2; case 3: switchD_00985482_caseD_3: local_24 = 0xfc; default: break; } case 7: local_24 = 0x66; } } else { switch(g_game->_stage) { default: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: switchD_0098532f_caseD_0: local_24 = 0x12; break; case 1: switchD_0098532f_caseD_1: local_24 = 0xde; break; case 2: switchD_0098532f_caseD_2: local_24 = 0x100; break; case 3: switchD_0098532f_caseD_3: local_24 = 0xc; break; case 4: switchD_0098532f_caseD_4: local_24 = 0x17; break; case 5: switchD_0098532f_caseD_5: local_24 = 0x55; default: break; } goto switchD_0098532f_default; case 3: case 4: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_4; case 1: switchD_00985120_caseD_1: local_24 = 0x19; goto switchD_0098532f_default; case 2: switchD_00985120_caseD_2: local_24 = 0x16; goto switchD_0098532f_default; case 3: switchD_00985120_caseD_3: local_24 = 0xcd; goto switchD_0098532f_default; case 4: switchD_00985120_caseD_4: local_24 = 0x1a; goto switchD_0098532f_default; case 5: switchD_00985120_caseD_5: local_24 = 0xea; default: goto switchD_0098532f_default; } case 5: case 6: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: switchD_0098513a_caseD_0: local_24 = 0x26; break; case 1: switchD_0098513a_caseD_1: local_24 = 0x18; break; case 2: switchD_0098513a_caseD_2: local_24 = 0xe3; break; case 3: switchD_0098513a_caseD_3: local_24 = 0x29; break; case 4: switchD_0098513a_caseD_4: local_24 = 0xd1; break; case 5: switchD_0098513a_caseD_5: local_24 = 0xed; default: break; } goto switchD_0098532f_default; case 7: case 8: uVar8 = RNG::RandomInt(&rng,5); switch(uVar8) { case 0: switchD_00985154_caseD_0: local_24 = 0x39; break; case 1: switchD_00985154_caseD_1: local_24 = 0xdf; break; case 2: switchD_00985154_caseD_2: local_24 = 0x38; break; case 3: switchD_00985154_caseD_3: local_24 = 0xd5; break; case 4: switchD_00985154_caseD_4: local_24 = 0xd8; default: break; } goto switchD_0098532f_default; case 9: switchD_00985106_caseD_9: uVar8 = RNG::RandomInt(&rng,2); if (uVar8 == 0) { local_24 = 0x17; enemyVariant = 1; } else if (uVar8 == 1) { enemyVariant = 1; local_24 = 0x101; } goto switchD_0098532f_default; case 10: if (g_game->_stageType == 0) goto LAB_00985444; LAB_0098519e: uVar8 = RNG::RandomInt(&rng,3); if (uVar8 != 0) { if (uVar8 == 1) { local_24 = 0x4f; } else if (uVar8 == 2) { local_24 = 0x43; } goto switchD_0098532f_default; } break; case 0xb: if (g_game->_stageType == 0) { LAB_009852f0: uVar8 = RNG::RandomInt(&rng,2); if (uVar8 != 0) { if (uVar8 != 1) goto switchD_0098532f_default; goto switchD_00985482_caseD_3; } goto switchD_00985482_caseD_2; } LAB_009851e5: uVar8 = RNG::RandomInt(&rng,2); if (uVar8 != 0) { if (uVar8 != 1) goto switchD_0098532f_default; switchD_00985482_caseD_1: local_24 = 0x33; enemyVariant = 1; goto switchD_0098532f_default; } break; case 0xc: switch(*(undefined4 *)((int)g_game->_room + 0x1d18)) { case 1: case 2: case 3: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_0; case 1: goto switchD_0098532f_caseD_1; case 2: goto switchD_0098532f_caseD_2; case 3: goto switchD_0098532f_caseD_3; case 4: goto switchD_0098532f_caseD_4; case 5: goto switchD_0098532f_caseD_5; default: goto switchD_0098532f_default; } case 4: case 5: case 6: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_4; case 1: goto switchD_00985120_caseD_1; case 2: goto switchD_00985120_caseD_2; case 3: goto switchD_00985120_caseD_3; case 4: goto switchD_00985120_caseD_4; case 5: goto switchD_00985120_caseD_5; default: goto switchD_0098532f_default; } case 7: case 8: case 9: uVar8 = RNG::RandomInt(&rng,6); switch(uVar8) { case 0: goto switchD_0098513a_caseD_0; case 1: goto switchD_0098513a_caseD_1; case 2: goto switchD_0098513a_caseD_2; case 3: goto switchD_0098513a_caseD_3; case 4: goto switchD_0098513a_caseD_4; case 5: goto switchD_0098513a_caseD_5; default: goto switchD_0098532f_default; } case 10: case 0xb: case 0xc: uVar8 = RNG::RandomInt(&rng,5); switch(uVar8) { case 0: goto switchD_00985154_caseD_0; case 1: goto switchD_00985154_caseD_1; case 2: goto switchD_00985154_caseD_2; case 3: goto switchD_00985154_caseD_3; case 4: goto switchD_00985154_caseD_4; default: goto switchD_0098532f_default; } case 0xd: goto switchD_00985106_caseD_9; case 0xe: goto switchD_00985342_caseD_5; case 0xf: goto LAB_0098519e; default: goto LAB_009852f0; case 0x11: goto LAB_009851e5; } } switchD_00985482_caseD_0: local_24 = 0x14; } switchD_0098532f_default: spawnPositions = (float *)0x0; positionsEnd = (float *)0x0; spawnPositionsEnd = (float *)0x0; spawnPositionsCapacity = (float *)0x0; local_14 = 0x2e; pvVar6 = (void *)((int)g_game->_room + 0x724); local_2c = (float *)0x0; positionsCapacity = (float *)0x0; local_30 = pvVar6; do { targetRoomType = *(int *)((int)pvVar6 + (int)local_2c * 4); if (targetRoomType != 0) { targetRoomType = *(int *)(targetRoomType + 0x24); iVar7 = *(int *)((int)g_game->_room + 0xc); local_44.x = (float)(targetRoomType % iVar7) * 40.0 + 40.0; local_44.y = (float)(targetRoomType / iVar7) * 40.0 + 120.0; local_38 = (void *)local_44.x; local_34 = local_44.y; player = Game::GetNearestPlayer(g_game,&local_44); fVar5 = local_34 - (player->_pos).y; fVar9 = (float)local_38 - (player->_pos).x; pvVar6 = local_30; if (6400.0 < fVar5 * fVar5 + fVar9 * fVar9) { targetRoomType = *(int *)(*(int *)((int)local_30 + (int)local_2c * 4) + 0x24); iVar7 = *(int *)((int)g_game->_room + 0xc); local_60.x = (float)(targetRoomType % iVar7) * 40.0 + 40.0; local_60.y = (float)(targetRoomType / iVar7) * 40.0 + 120.0; if (positionsEnd == positionsCapacity) { std::vector::_Emplace_reallocate(positionsEnd,&local_60); positionsCapacity = spawnPositionsCapacity; } else { *positionsEnd = local_60.x; positionsEnd[1] = local_60.y; spawnPositionsEnd = positionsEnd + 2; } pvVar6 = local_30; positionsEnd = spawnPositionsEnd; } } uVar8 = local_24; local_2c = (float *)((int)local_2c + 1); } while (local_2c < 8); local_2c = positionsCapacity; if (spawnPositions == positionsEnd) { tmpPos = Room::GetCenterPos(&local_60); if (positionsEnd == local_2c) { std::vector::_Emplace_reallocate(positionsEnd,tmpPos); local_2c = spawnPositionsCapacity; positionsEnd = spawnPositionsEnd; } else { fVar5 = tmpPos->y; *positionsEnd = tmpPos->x; positionsEnd[1] = fVar5; spawnPositionsEnd = positionsEnd + 2; positionsEnd = spawnPositionsEnd; } } RNG::Next(&rng); local_24 = rng._seed & 3; local_44.y = (float)((int)local_3c + local_24); local_30 = (void *)rng._seed; if ((int)local_24 < (int)local_44.y) { do { if (local_30 == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } rngValue = (uint)local_30 >> ((byte)rng._shift1 & 0x1f) ^ (uint)local_30; rngValue = rngValue << ((byte)rng._shift2 & 0x1f) ^ rngValue; local_30 = (void *)(rngValue >> ((byte)rng._shift3 & 0x1f) ^ rngValue); tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_68, (Vector *) (spawnPositions + (local_24 % (uint)((int)positionsEnd - (int)spawnPositions >> 3)) * 2),0.0 ,0,0,0); rngValue = Random(); local_34 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_34 = local_34 + local_34; rngValue = Random(); local_38 = (void *)((float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10); fVar5 = sin(local_34); local_3c = fVar5 * (float)local_38 * 20.0 + tmpPos->y; fVar5 = cos(local_34); local_60.x = fVar5 * (float)local_38 * 20.0 + tmpPos->x; local_60.y = local_3c; Game::Spawn(g_game,uVar8,enemyVariant,&local_60,&g_vectorZero,(Entity *)0x0,0,(uint)local_30); local_24 = local_24 + 1; positionsEnd = spawnPositionsEnd; } while ((int)local_24 < (int)local_44.y); } pvVar6 = g_game->_room; iVar7 = *(int *)((int)pvVar6 + 0x12c4) + *(int *)((int)pvVar6 + 0x12c0); targetRoomType = 0; if (0 < iVar7) { targetRoomType = iVar7; } if ((int)local_4c.y < targetRoomType) { local_30 = (void *)0x0; targetRoomType = 0x724; game = g_game; do { local_30 = (void *)((int)local_30 + 1); if (local_30 < (void *)0x9) { door = *(GridEntity_Door **)(targetRoomType + (int)game->_room); if ((door != (GridEntity_Door *)0x0) && ((door->_desc)._state != 1)) { (door->_desc)._state = 1; GridEntity_Door::UpdateAnimation(door); iVar7 = door->_currentRoomType; if (((iVar7 == 7) || (((targetRoomType = door->_targetRoomType, targetRoomType == 7 || (iVar7 == 8)) || (targetRoomType == 8)))) || ((iVar7 == 0x1d || (targetRoomType == 0x1d)))) { std::string::assign((door->_openAnimation)._buf,s_Open,4); } game = g_game; } } targetRoomType = targetRoomType + 4; } while (targetRoomType < 0x744); if ((*(byte *)(*(int *)((int)game->_room + 4) + 0x44) & 1) != 0) { roomDesc = Level::GetRoomByIdx((Level *)game,game->_currentRoomIdx,-1); game = g_game; roomDesc->Flags = roomDesc->Flags | 0x80; } roomFlags = (uint *)(*(int *)((int)game->_room + 4) + 0x44); *roomFlags = *roomFlags & 0xfffffffe; pvVar6 = game->_room; } if ((*(byte *)(*(int *)((int)pvVar6 + 4) + 0x44) & 1) == 0) { ((GridEntityDesc *)((int)local_58.y + 4))->_state = 4; } if (spawnPositions == (float *)0x0) { ExceptionList = local_1c; return; } deallocate(spawnPositions,(int)local_2c - (int)spawnPositions >> 3); ExceptionList = local_1c; return; } //@@ 00985c10 GridEntity_PressurePlate::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 3] */ void __thiscall GridEntity_PressurePlate::Render(GridEntity_PressurePlate *this,float *param_2) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; Vector *renderPos; uint blinkPhase; AnimationState *animState; undefined4 local_ac [11]; KColor textColor; undefined4 fontSettings; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; Vector local_50; Font *font; float renderY; float renderX; Vector local_3c; byte timerText [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; void *room; ColorMod *spriteColor; int timerSeconds; local_8 = 0xffffffff; puStack_c = &LAB_00b0ce7d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(timerText + 0x30); ExceptionList = &local_10; font = &g_manager->_font4_terminus; renderPos = GridEntity::get_render_position((GridEntity *)this,&local_50); renderX = renderPos->x + *param_2; renderY = renderPos->y + param_2[1]; room = g_game->_room; fVar2 = *(float *)((int)room + 0x72a4); fVar3 = *(float *)((int)room + 0x72a8); fVar4 = *(float *)((int)room + 0x72ac); fVar5 = *(float *)((int)room + 0x72b0); fVar1 = *(float *)((int)room + 0x72cc); fVar6 = *(float *)((int)room + 0x72b4); fVar7 = *(float *)((int)room + 0x72b8); fVar8 = *(float *)((int)room + 0x72bc); fVar9 = *(float *)((int)room + 0x72c0); spriteColor = &(this->_sprite)._color; if (spriteColor != (ColorMod *)local_ac) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)room + 0x72c4); spriteColor->_tint[0] = fVar2; (this->_sprite)._color._tint[1] = fVar3; (this->_sprite)._color._tint[2] = fVar4; (this->_sprite)._color._tint[3] = fVar5; (this->_sprite)._color._offset[2] = fVar1; (this->_sprite)._color._colorize[0] = fVar6; (this->_sprite)._color._colorize[1] = fVar7; (this->_sprite)._color._colorize[2] = fVar8; (this->_sprite)._color._colorize[3] = fVar9; } if ((this->_sprite)._loaded != 0) { local_3c.x = renderX; local_3c.y = renderY; if ((this->_sprite)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_sprite)._animState,&local_3c,&g_vectorZero,&g_vectorZero); animState = &(this->_sprite)._overlayAnimState; } else { AnimationState::Render (&(this->_sprite)._overlayAnimState,&local_3c,&g_vectorZero,&g_vectorZero); animState = &(this->_sprite)._animState; } AnimationState::Render(animState,&local_3c,&g_vectorZero,&g_vectorZero); renderX = local_3c.x; renderY = local_3c.y; } local_3c.x = renderX + 0.0; local_3c.y = renderY + 21.0; if ((this->_timerPlate)._loaded != 0) { if ((this->_timerPlate)._overlayRenderFirst == 0) { AnimationState::Render(&(this->_timerPlate)._animState,&local_3c,&g_vectorZero,&g_vectorZero); animState = &(this->_timerPlate)._overlayAnimState; } else { AnimationState::Render (&(this->_timerPlate)._overlayAnimState,&local_3c,&g_vectorZero,&g_vectorZero); animState = &(this->_timerPlate)._animState; } AnimationState::Render(animState,&local_3c,&g_vectorZero,&g_vectorZero); } if ((this->_desc)._variant != 2) { ExceptionList = local_10; return; } local_3c.y = *(float *)((int)g_game->_room + 0x723c); timerSeconds = ((int)local_3c.y + -1) / 0x1e; local_50.y = (float)(timerSeconds % 0x3c); sprintf_s(timerText,0x20,(byte *)"%02d:%02d"); Font::get_string_width_n(font,timerText,-1); game = g_game; KColor::SetFromARGB(&textColor,0xffffffff); if ((timerSeconds / 0x3c < 1) && ((int)local_50.y < 1)) { blinkPhase = game->_frameCount & 0x80000003; if ((int)blinkPhase < 0) { blinkPhase = (blinkPhase - 1 | 0xfffffffc) + 1; } if (1 < (int)blinkPhase) goto LAB_00985e7c; } else { LAB_00985e7c: if (0 < (int)local_3c.y) goto LAB_00985e94; } textColor._red = 0.3; textColor._green = 0.3; textColor._blue = 0.3; textColor._alpha = 1.0; textColor._unk = 0; LAB_00985e94: fontSettings = 0; local_68 = 0xffff; local_64 = 0; local_60 = 0x3f800000; local_5c = 0xffffffff; local_58 = 0; local_54 = 0; local_8 = 0; Font::DrawString(timerText,&textColor,&fontSettings); ExceptionList = local_10; return; } //@@ 00985f00 GridEntity_PressurePlate::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_PressurePlate::BeginBatches(GridEntity_PressurePlate *this) { byte bVar1; int iVar2; byte *curAnimName; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; byte extraout_CL_03; byte extraout_CL_04; byte extraout_CL_05; byte extraout_CL_06; char *freeBlock; byte *expectedAnimName; uint uVar3; bool isLess; std_string gfxPath; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; byte *animData; local_8 = 0xffffffff; puStack_c = &LAB_00b0cee5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&gfxPath)[1]._size; ExceptionList = &local_10; gfxPath._size = 0; gfxPath._capacity = 0xf; gfxPath._buf[0] = '\0'; gfxPath._buf[1] = '\0'; gfxPath._buf[2] = '\0'; gfxPath._buf[3] = '\0'; gfxPath._buf._0_4_ = std::_Allocate(0x30); gfxPath._size = 0x20; gfxPath._capacity = 0x2f; builtin_strncpy((char *)gfxPath._buf._0_4_,"gfx/grid/grid_pressureplate.anm2",0x21); local_8 = 0; ANM2::Load(&this->_sprite,&gfxPath,0); local_8 = 0xffffffff; bVar1 = extraout_CL; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (char *)gfxPath._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(gfxPath._buf._0_4_ + -4); uVar3 = gfxPath._capacity + 0x24; if ((char *)0x1f < (char *)(gfxPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_00; } iVar2 = (this->_desc)._variant; this->_nextGreedAnimation = &s_empty; switch(iVar2) { case 0: gfxPath._buf._0_4_ = std::_Allocate(0x30); gfxPath._size = 0x26; gfxPath._capacity = 0x2f; builtin_strncpy((char *)gfxPath._buf._0_4_,"gfx/grid/grid_pressureplate_silver.png",0x27); local_8 = 1; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&gfxPath); local_8 = 0xffffffff; bVar1 = extraout_CL_01; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (char *)gfxPath._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(gfxPath._buf._0_4_ + -4); uVar3 = gfxPath._capacity + 0x24; if ((char *)0x1f < (char *)(gfxPath._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_0098631e; } operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_02; } if ((this->_desc)._state == 0) { *(undefined4 *)((int)g_game->_room + 0x11ec) = 10; } break; case 2: gfxPath._size = 0; gfxPath._capacity = 0xf; gfxPath._buf[0] = '\0'; gfxPath._buf[1] = '\0'; gfxPath._buf[2] = '\0'; gfxPath._buf[3] = '\0'; gfxPath._buf._0_4_ = std::_Allocate(0x20); gfxPath._size = 0x18; gfxPath._capacity = 0x1f; builtin_strncpy((char *)gfxPath._buf._0_4_,"gfx/grid/TimerPlate.anm2",0x19); local_8 = 2; ANM2::Load(&this->_timerPlate,&gfxPath,1); local_8 = 0xffffffff; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (char *)gfxPath._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(gfxPath._buf._0_4_ + -4); uVar3 = gfxPath._capacity + 0x24; if ((char *)0x1f < (char *)(gfxPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } ANM2::Play(&this->_timerPlate,s_Idle,0); bVar1 = extraout_CL_03; break; case 3: gfxPath._buf._0_4_ = std::_Allocate(0x20); builtin_strncpy((char *)gfxPath._buf._0_4_,"gfx/grid/grid_button_rail.png",0x1e); local_8 = 3; goto LAB_009861b7; case 9: gfxPath._buf._0_4_ = std::_Allocate(0x20); builtin_strncpy((char *)gfxPath._buf._0_4_,"gfx/grid/grid_button_kill.png",0x1e); local_8 = 4; LAB_009861b7: gfxPath._capacity = 0x1f; gfxPath._size = 0x1d; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&gfxPath); local_8 = 0xffffffff; bVar1 = extraout_CL_04; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (char *)gfxPath._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(gfxPath._buf._0_4_ + -4); iVar2 = gfxPath._buf._0_4_ - (int)freeBlock; joined_r0x00986318: uVar3 = gfxPath._capacity + 0x24; if (0x1f < iVar2 - 4U) { LAB_0098631e: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_009861f6: local_8 = 0xffffffff; operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_05; } break; case 10: case 0xb: case 0xc: case 0xd: gfxPath._buf._0_4_ = std::_Allocate(0x20); gfxPath._size = 0x1f; gfxPath._capacity = 0x1f; builtin_strncpy((char *)gfxPath._buf._0_4_,"gfx/grid/grid_button_output.png",0x20); local_8 = 5; Sprite::ReplaceSpritesheet((Sprite *)&this->_sprite,0,&gfxPath); local_8 = 0xffffffff; bVar1 = extraout_CL_06; if (gfxPath._capacity < 0x10) break; uVar3 = gfxPath._capacity + 1; freeBlock = (char *)gfxPath._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(gfxPath._buf._0_4_ + -4); iVar2 = gfxPath._buf._0_4_ - (int)freeBlock; goto joined_r0x00986318; } goto LAB_009861f6; } ANM2::LoadGraphics(&this->_sprite,bVar1); if ((this->_desc)._variant == 2) { update_greed_button_anim(this,0); play_pending_animation(this); } else { iVar2 = (this->_desc)._state; if (iVar2 == 0) { ANM2::Play(&this->_sprite,&DAT_00b7cf20,0); } else if ((iVar2 == 3) || (iVar2 == 4)) { animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } expectedAnimName = &DAT_00b7cf1c; do { bVar1 = *curAnimName; isLess = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00986374: uVar3 = -(uint)isLess | 1; goto LAB_00986379; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00986374; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00986379: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009863c1; } bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b7cf1c,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } LAB_009863c1: (this->_greedModeRNG)._seed = (this->_desc)._spawnSeed; (this->_greedModeRNG)._shift1 = 4; (this->_greedModeRNG)._shift2 = 3; (this->_greedModeRNG)._shift3 = 0x1b; ExceptionList = local_10; return; } //@@ 00986430 GridEntity_PressurePlate::GetWaterClipInfo /* ZHL [exact] WaterClipInfo* GetWaterClipInfo(WaterClipInfo* out); */ void GridEntity_PressurePlate::GetWaterClipInfo(undefined4 *param_1) { *param_1 = 0x19; param_1[1] = 0; return; } //@@ 00986450 MenuManager::constructor /* ZHL [exact] __thiscall void MenuManager::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall MenuManager::constructor(MenuManager *this) { void *mapHead; Vector *viewPosition; int viewPositionsLeft; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b0d1fb; local_1c = ExceptionList; ExceptionList = &local_1c; (this->_menuStateHistory)._begin = (void *)0x0; (this->_menuStateHistory)._end = (void *)0x0; (this->_menuStateHistory)._capacity = (void *)0x0; local_14 = 0; KColor::SetFromARGB(&this->_fadeInColor,0xff000000); this->_selectedMenuID = 0; (this->_ViewPosition).y = 0.0; (this->_ViewPosition).x = 0.0; ANM2::constructor(&this->_MenuShadowSprite); *(undefined4 *)&this->field_0x160 = 0; *(undefined4 *)&this->field_0x164 = 0; *(undefined4 *)&this->field_0x168 = 0; *(undefined4 *)&this->field_0x16c = 0; *(undefined4 *)&this->field_0x170 = 0; *(undefined4 *)&this->field_0x174 = 0; local_14._0_1_ = 4; Seeds::constructor(); local_14._0_1_ = 5; (this->_menuTitle).PositionY = 0.0; (this->_menuTitle).PositionX = 0.0; ANM2::constructor(&(this->_menuTitle).TitleScreenSprite); *(undefined2 *)&this->field_0x2f0 = 0; local_14._0_1_ = 6; *(undefined4 *)&this->field_0x308 = 0; *(undefined4 *)&this->field_0x304 = 0; ANM2::constructor((ANM2 *)&this->field_0x30c); local_14._0_1_ = 7; _eh_vector_constructor_iterator_(&this->field_0x420,0x114,3,ANM2::constructor,ANM2::~ANM2); local_14._0_1_ = 8; ANM2::constructor((ANM2 *)&this->field_0x764); local_14._0_1_ = 9; ANM2::constructor((ANM2 *)&this->field_0x878); local_14._0_1_ = 10; *(undefined ***)&this->field_0x98c = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(&this->field_0x990); local_14._0_1_ = 0xb; ANM2::constructor((ANM2 *)&this->field_0x998); this->field_0xac8 = 0; *(undefined4 *)&this->field_0xaac = 0; *(undefined4 *)&this->field_0xab0 = 0; *(undefined4 *)&this->field_0xab4 = 0; *(undefined4 *)&this->field_0xab8 = 0; *(undefined4 *)&this->field_0xabc = 0; local_14._0_1_ = 0xc; (this->_menuGame).PositionY = 0.0; (this->_menuGame).PositionX = 0.0; ANM2::constructor(&(this->_menuGame).GameMenuSprite); local_14._0_1_ = 0xd; ANM2::constructor(&(this->_menuGame).ContinueWidgetSprite); *(undefined4 *)&this->field_0xdc8 = 0; *(undefined4 *)&this->field_0xdcc = 0; *(undefined4 *)&this->field_0xdd0 = 0xffffffff; local_14._0_1_ = 0xe; this->_menuDailyChallenge = (Menu_DailyChallenge)0x0; *(undefined4 *)&this->field_0xdd8 = 0; *(undefined4 *)&this->field_0xddc = 0; *(undefined4 *)&this->field_0xde4 = 0; *(undefined4 *)&this->field_0xde0 = 0; ANM2::constructor((ANM2 *)&this->field_0xde8); local_14._0_1_ = 0xf; *(undefined4 *)&this->field_0xefc = 0; *(undefined4 *)&this->field_0xf00 = 0; *(undefined4 *)&this->field_0xf04 = 0; *(undefined4 *)&this->field_0xf08 = 0; this->field_0xf0c = 0; ANM2::constructor((ANM2 *)&this->field_0xf10); KColor::SetFromARGB((KColor *)&this->field_0x1024,0xffffffff); *(undefined4 *)&this->field_0x1038 = 0; *(undefined4 *)&this->field_0x103c = 0; *(undefined4 *)&this->field_0x1040 = 0; local_14._0_1_ = 0x10; ANM2::constructor((ANM2 *)&this->field_0x1044); this->field_0x1174 = 0; *(undefined4 *)&this->field_0x1158 = 0; *(undefined4 *)&this->field_0x115c = 0; *(undefined4 *)&this->field_0x1160 = 0; *(undefined4 *)&this->field_0x1164 = 0; *(undefined4 *)&this->field_0x1168 = 0; local_14._0_1_ = 0x11; Leaderboard::constructor(); *(undefined4 *)&this->field_0x152c = 0; *(undefined4 *)&this->field_0x1530 = 0; local_14._0_1_ = 0x12; Menu_Character::constructor(&this->_menuCharacter); local_14._0_1_ = 0x13; (this->_menuSpecialSeeds).SelectedElement = 0; (this->_menuSpecialSeeds).State = 0; *(undefined4 *)&(this->_menuSpecialSeeds).field_0x18 = 0; *(undefined4 *)&(this->_menuSpecialSeeds).field_0x14 = 0; ANM2::constructor(&(this->_menuSpecialSeeds).SpecialSeedsSprite); *(undefined4 *)&this->field_0x264c = 0; *(undefined4 *)&this->field_0x265c = 0; *(undefined4 *)&this->field_0x2660 = 0xf; this->field_0x264c = 0; *(undefined4 *)&this->field_0x2664 = 0; *(undefined4 *)&this->field_0x2674 = 0; *(undefined4 *)&this->field_0x2678 = 0xf; this->field_0x2664 = 0; *(undefined4 *)&this->field_0x267c = 0; *(undefined4 *)&this->field_0x2680 = 0; *(undefined4 *)&this->field_0x2684 = 0; (this->_menuSpecialSeeds).HoldInputTimer = 0; (this->_menuSpecialSeeds).State = (int)g_vectorZero.x; (this->_menuSpecialSeeds).SelectedElement = (int)g_vectorZero.y; local_14._0_1_ = 0x14; (this->_menuChallenge).PositionY = 0.0; (this->_menuChallenge).PositionX = 0.0; ANM2::constructor(&(this->_menuChallenge).ChallengeMenuSprite); *(undefined4 *)&this->field_0x27b0 = 0; *(undefined4 *)&this->field_0x27b4 = 0; local_14._0_1_ = 0x15; (this->_menuCollection).PositionY = 0.0; (this->_menuCollection).PositionX = 0.0; ANM2::constructor(&(this->_menuCollection).CollectionMenuSprite); local_14._0_1_ = 0x16; ANM2::constructor(&(this->_menuCollection).DeathScreenSprite); *(undefined4 *)&(this->_menuCollection).field_0x240 = 0; *(undefined4 *)&(this->_menuCollection).field_0x244 = 0; (this->_menuCollection).MoveYAxisDirection = 0.0; (this->_menuCollection).MoveXAxisDirection = 0.0; *(undefined4 *)&(this->_menuCollection).field_0x250 = 0; *(undefined4 *)&(this->_menuCollection).field_0x254 = 0; *(undefined4 *)&(this->_menuCollection).field_0x258 = 0; local_14._0_1_ = 0x17; (this->_menuStats)._PositionY = 0.0; (this->_menuStats)._PositionX = 0.0; ANM2::constructor(&(this->_menuStats)._StatsMenuSprite); local_14._0_1_ = 0x18; ANM2::constructor(&(this->_menuStats)._achievementsSprite); local_14._0_1_ = 0x19; _eh_vector_constructor_iterator_ (&(this->_menuStats)._achievementMiniSprite1,0x114,0xb,ANM2::constructor,ANM2::~ANM2); local_14._0_1_ = 0x1a; _eh_vector_constructor_iterator_ ((this->_menuStats)._achievementOverlayEntries,0x34,0x282, (_func_void_void_ptr *)&LAB_009ec190,FUN_00420b00); local_14._0_1_ = 0x1b; Menu_Options::constructor(); local_14._0_1_ = 0x1c; (this->_menuControllerSelect).PositionY = 0.0; (this->_menuControllerSelect).PositionX = 0.0; ANM2::constructor(&(this->_menuControllerSelect).ControllerSelectSprite); *(undefined4 *)&this->field_0xd278 = 0; *(undefined4 *)&this->field_0xd27c = 0; *(undefined4 *)&this->field_0xd280 = 0; local_14._0_1_ = 0x1d; (this->_menuKeyConfig).PositionY = 0.0; (this->_menuKeyConfig).PositionX = 0.0; ANM2::constructor(&(this->_menuKeyConfig).KeyConfigSprite); local_14._0_1_ = 0x1e; (this->_menuCutscenes).PositionY = 0.0; (this->_menuCutscenes).PositionX = 0.0; ANM2::constructor(&(this->_menuCutscenes).CutscenesMenuSprite); local_14._0_1_ = 0x1f; *(undefined4 *)&this->field_0xd4d4 = 0; this->_menuBestiary = (Menu_Bestiary)0x0; ANM2::constructor((ANM2 *)&this->field_0xd4d8); local_14._0_1_ = 0x20; ANM2::constructor((ANM2 *)&this->field_0xd5ec); local_14._0_1_ = 0x21; ANM2::constructor((ANM2 *)&this->field_0xd700); *(undefined4 *)&this->field_0xd820 = 0; *(undefined4 *)&this->field_0xd824 = 0; *(undefined4 *)&this->field_0xd828 = 0; *(undefined4 *)&this->field_0xd82c = 0; *(undefined4 *)&this->field_0xd830 = 0; *(undefined4 *)&this->field_0xd834 = 0; local_14._0_1_ = 0x22; *(undefined4 *)&this->field_0xd854 = 0; *(undefined4 *)&this->field_0xd850 = 0; ANM2::constructor((ANM2 *)&this->field_0xd858); local_14._0_1_ = 0x23; *(undefined4 *)&this->field_0xd978 = 0; *(undefined4 *)&this->field_0xd974 = 0; ANM2::constructor((ANM2 *)&this->field_0xd97c); *(undefined4 *)&this->field_0xda94 = 0; local_14._0_1_ = 0x24; *(char **)&this->_menuOnline = "gfx/ui/main menu/OnlineMenu.anm2"; ANM2::constructor(&(this->_menuOnline)._anm2); local_14._0_1_ = 0x25; ANM2::constructor((ANM2 *)&(this->_menuOnline).field_0x118); local_14._0_1_ = 0x26; (this->_menuOnline)._prevState = 1; (this->_menuOnline)._state = 0; *(undefined4 *)&this->field_0xdcd0 = 0; *(undefined4 *)&this->field_0xdccc = 0; *(undefined4 *)&this->field_0xdcd4 = 0xffffffff; *(undefined ***)&this->field_0xdcd8 = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(&this->field_0xdcdc); local_14._0_1_ = 0x27; *(undefined4 *)&this->field_0xdcf4 = 0; *(undefined4 *)&this->field_0xdcf0 = 0; ANM2::constructor((ANM2 *)&this->field_0xdcf8); local_14._0_1_ = 0x28; _eh_vector_constructor_iterator_(&this->field_0xde0c,0x114,3,ANM2::constructor,ANM2::~ANM2); local_14._0_1_ = 0x29; ANM2::constructor((ANM2 *)&this->field_0xe148); local_14._0_1_ = 0x2a; ANM2::constructor((ANM2 *)&this->field_0xe25c); local_14._0_1_ = 0x2b; *(undefined4 *)&this->field_0xe370 = 0xffffffff; *(undefined4 *)&this->field_0xe374 = 0xffffffff; *(undefined4 *)&this->field_0xe378 = 0xffffffff; *(undefined4 *)&this->field_0xe37c = 0; *(undefined4 *)&this->field_0xe380 = 0; mapHead = operator_new(0x28); *(void **)mapHead = mapHead; *(void **)((int)mapHead + 4) = mapHead; *(void **)((int)mapHead + 8) = mapHead; *(undefined2 *)((int)mapHead + 0xc) = 0x101; *(void **)&this->field_0xe37c = mapHead; local_14._0_1_ = 0x2c; *(undefined4 *)&this->field_0xe388 = 0; *(undefined4 *)&this->field_0xe38c = 0; this->field_0xe390 = 0; *(undefined4 *)&this->field_0xe394 = 0; *(undefined4 *)&this->field_0xe398 = 0; *(undefined4 *)&this->field_0xe39c = 0; *(undefined4 *)&this->field_0xe3a0 = 0; *(undefined4 *)&this->field_0xe3a4 = 0; *(undefined2 *)&this->field_0xe3a8 = 0; *(undefined4 *)&this->field_0xe3ac = 3; *(undefined2 *)&this->field_0xe3b0 = 0; *(undefined4 *)&this->field_0xe3b4 = 0x26; *(undefined4 *)&this->field_0xe3b8 = 0; *(undefined4 *)&this->field_0xe3bc = 0; *(undefined4 *)&this->field_0xe3c0 = 0; *(undefined4 *)&this->field_0xe3c4 = 0; *(undefined4 *)&this->field_0xe3c8 = 0; MenuDialog::constructor(); local_14._0_1_ = 0x2d; *(undefined4 *)&this->field_0xe634 = 0; *(undefined4 *)&this->field_0xe638 = 0; *(undefined4 *)&this->field_0xe63c = 0; *(undefined4 *)&this->field_0xe640 = 0; *(undefined4 *)&this->field_0xe644 = 0; std::list>::push_back(FUN_008ee4d0,&this->field_0xdce8); std::list>::push_back (online_lobby_members_changed_callback,&this->field_0xdce8); local_14._0_1_ = 0x2e; Menu_LobbyListFilters::constructor(); local_14._0_1_ = 0x2f; Menu_Options::constructor(); local_14._0_1_ = 0x30; ANM2::constructor((ANM2 *)&this->field_0xedd8); local_14._0_1_ = 0x31; _eh_vector_constructor_iterator_(&this->field_0xeeec,0x120,6,FUN_008cb780,FUN_005cc630); this->field_0xf5ac = 1; *(undefined4 *)&this->field_0xf5b0 = 0; *(undefined4 *)&this->field_0xf5b8 = 0; *(undefined4 *)&this->field_0xf5b4 = 0; this->field_0xf5bc = 0; *(undefined4 *)&this->field_0xf5c0 = 0x3f800000; *(undefined4 *)&this->field_0xf5c4 = 0; *(undefined4 *)&this->field_0xf5c8 = 0; local_14._0_1_ = 0x32; ANM2::constructor(&this->_onlineStatsMenuSprite); *(undefined4 *)&this->field_0xf6f0 = 0; *(undefined4 *)&this->field_0xf6f8 = 0; *(undefined4 *)&this->field_0xf6f4 = 0; *(undefined4 *)&this->field_0xf6e0 = 0; *(undefined4 *)&this->field_0xf6e4 = 0; *(undefined4 *)&this->field_0xf6e8 = 0; *(undefined4 *)&this->field_0xf6ec = 0; local_14._0_1_ = 0x33; *(undefined4 *)&this->field_0xf6fc = 0; viewPositionsLeft = 0x17; *(undefined4 *)&this->field_0xf700 = 0xc4a8c000; viewPosition = this->_viewPositionSet; do { viewPosition->y = 0.0; viewPosition->x = 0.0; viewPositionsLeft = viewPositionsLeft + -1; viewPosition = viewPosition + 1; } while (viewPositionsLeft != 0); (this->_currentColorModState)._amount = 0.0; (this->_currentColorModState)._brightness = 0.0; (this->_currentColorModState)._red = 1.0; (this->_currentColorModState)._green = 1.0; (this->_currentColorModState)._blue = 1.0; (this->_currentColorModState)._contrast = 1.0; (this->_targetColorModState)._amount = 0.0; (this->_targetColorModState)._brightness = 0.0; (this->_targetColorModState)._red = 1.0; (this->_targetColorModState)._green = 1.0; (this->_targetColorModState)._blue = 1.0; (this->_targetColorModState)._contrast = 1.0; (this->_lerpColorModState)._amount = 0.0; (this->_lerpColorModState)._brightness = 0.0; (this->_lerpColorModState)._red = 1.0; (this->_lerpColorModState)._green = 1.0; (this->_lerpColorModState)._blue = 1.0; (this->_lerpColorModState)._contrast = 1.0; this->_scrollinterpolationY = 0.0; this->_scrollinterpolationX = 0.0; *(undefined4 *)&this->field_0xf814 = 0; *(undefined4 *)&this->field_0xf810 = 0; ANM2::constructor(&this->_flySprite); local_14 = CONCAT31(local_14._1_3_,0x34); create_menu_colormod_surface(); (this->_currentColorModState)._red = 1.0; (this->_currentColorModState)._green = 1.0; (this->_currentColorModState)._blue = 1.0; (this->_currentColorModState)._amount = 0.0; this->_shouldLerpColorModState = 0; (this->_currentColorModState)._brightness = 0.0; (this->_currentColorModState)._contrast = 1.0; ExceptionList = local_1c; return; } //@@ 00986f30 MenuManager::~MenuManager /* DB: Manager::unload_state calls it on g_menuManager then operator_delete(0xf930); resets _flySprite (+0xf818) and calls Menu_Options/Menu_Stats destructors */ void MenuManager::~MenuManager(void) { ANM2 *this; undefined4 *stringSet; char isLastRef; void *in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d220; local_10 = ExceptionList; ExceptionList = &local_10; KAGE::SmartPointer::reset((void *)((int)in_ECX + 0x168),(void *)0x0); KAGE::SmartPointer::reset((void *)((int)in_ECX + 0x160),(void *)0x0); KAGE::SmartPointer::reset(extraout_ECX); local_8 = 0; ANM2::Reset((ANM2 *)((int)in_ECX + 0xf818)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xf868)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xf848)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xf830)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xf818)); local_8 = 1; ANM2::Reset((ANM2 *)((int)in_ECX + 0xf5cc)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xf61c)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xf5fc)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xf5e4)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xf5cc)); local_8 = 2; _eh_vector_destructor_iterator_((void *)((int)in_ECX + 0xeeec),0x120,6,FUN_005cc630); local_8 = CONCAT31(local_8._1_3_,3); ANM2::Reset((ANM2 *)((int)in_ECX + 0xedd8)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xee28)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xee08)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xedf0)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xedd8)); Menu_Options::~Menu_Options((Menu_Options *)((int)in_ECX + 0xeb50)); FUN_008dc3c0(); FUN_008e7630(); FUN_008e4a20(); local_8 = 4; ANM2::Reset((ANM2 *)((int)in_ECX + 0xd97c)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd9cc)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd9ac)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd994)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd97c)); local_8 = 5; ANM2::Reset((ANM2 *)((int)in_ECX + 0xd858)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd8a8)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd888)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd870)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd858)); FUN_008c5d70(); local_8 = 6; ANM2::Reset((ANM2 *)((int)in_ECX + 0xd3bc)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd40c)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd3ec)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd3d4)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd3bc)); this = (ANM2 *)((int)in_ECX + 0xd298); local_8 = 7; ANM2::Reset(this); local_8 = CONCAT31(local_8._1_3_,8); ANM2::Reset(this); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd2e8)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd2c8)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd2b0)); std::string::_Tidy_deallocate((char *)this); FUN_008c9e10(); local_8 = 9; ANM2::Reset((ANM2 *)((int)in_ECX + 0xd164)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd1b4)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0xd194)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd17c)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0xd164)); Menu_Options::~Menu_Options((Menu_Options *)((int)in_ECX + 0xcecc)); Menu_Stats::~Menu_Stats((Menu_Stats *)((int)in_ECX + 0x2a18)); Menu_Collection::destructor(); Menu_Challenge::destructor(); FUN_008f0120(); Menu_Character::destructor((Menu_Character *)((int)in_ECX + 0x1534)); FUN_008cf510(); Menu_Game::destructor(); Menu_Save::~Menu_Save(); local_8 = 10; ANM2::Reset((ANM2 *)((int)in_ECX + 0x1dc)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x22c)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x20c)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 500)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x1dc)); stringSet = (undefined4 *)((int)in_ECX + 0x1cc); FID_conflict__Erase_tree_>_> (stringSet,(fuzzer_allocator_> *)stringSet, *(_Tree_node **)(*(int *)((int)in_ECX + 0x1cc) + 4)); operator_delete((void *)*stringSet,0x14); local_8 = 0xb; if (*(int **)((int)in_ECX + 0x174) != (int *)0x0) { isLastRef = (**(code **)(**(int **)((int)in_ECX + 0x174) + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)in_ECX + 0x170); } } local_8 = 0xc; if (*(int **)((int)in_ECX + 0x16c) != (int *)0x0) { isLastRef = (**(code **)(**(int **)((int)in_ECX + 0x16c) + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((void *)((int)in_ECX + 0x168)); } } local_8 = 0xd; if (*(int **)((int)in_ECX + 0x164) != (int *)0x0) { isLastRef = (**(code **)(**(int **)((int)in_ECX + 0x164) + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)in_ECX + 0x160); } } local_8 = 0xe; ANM2::Reset((ANM2 *)((int)in_ECX + 0x4c)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x9c)); AnimationState::~AnimationState((AnimationState *)((int)in_ECX + 0x7c)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 100)); std::string::_Tidy_deallocate((char *)((int)in_ECX + 0x4c)); FID_conflict__Tidy(in_ECX); ExceptionList = local_10; return; } //@@ 00987360 create_menu_colormod_surface /* DB: creates the 1x1 "Menu Colormod Surface" render target into DAT_00c798b0 if missing (KAGE_Graphics::create_render_target); MenuManager::constructor, 00954150 Manager::update_screen_scale void create_menu_colormod_surface(void) { int *piVar1; char cVar2; uint uVar3; void *other; KColor *clearColor; KColor local_2c; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d24d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; if (DAT_00c798b0 == (int *)0x0) { KColor::SetFromARGB(&local_2c,0); other = KAGE_Graphics::create_render_target (local_18,g_framebufferWidth,DAT_00c79114,(byte *)"Menu Colormod Surface", clearColor); local_8 = 0; shared_ptr::operator_assign(&DAT_00c798b0,other); local_8 = 1; if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_18); } } piVar1 = DAT_00c798b0; local_8 = 0xffffffff; if ((DAT_00c798b0[0xe] != 1) || (DAT_00c798b0[0xf] != 1)) { (**(code **)(*DAT_00c798b0 + 0x48))(1,1); piVar1[0xe] = 1; piVar1[0xf] = 1; } } ExceptionList = local_10; return; } //@@ 00987450 MenuManager::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void MenuManager::Init(); */ void __thiscall MenuManager::Init(void) { char isImageReleasable; byte bVar1; Seeds *other; void *pvVar2; byte *animNameChar; byte *expectedAnimName; undefined4 extraout_ECX; char *freeBlock; uint uVar3; bool isLess; float viewOffsetY; undefined1 overlayImageRef [4]; int *piStack_c4; Vector aVStack_c0 [11]; void *tmpSeeds [4]; void *onlineStatsPath [4]; uint onlineStatsPathSize; uint onlineStatsPathCapacity; std_string anm2Path; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *pvStack_14; byte *animData; Manager *manager; MenuManager *menuManager; MenuManager *menuManager2; int *overlayImage; int selectedMenuId; float selectedViewY; ANM2 *titleSprite; menuManager = g_menuManager; puStack_20 = (undefined1 *)(tmpSeeds + 0x18); pvStack_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0d316; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(tmpSeeds + 0x15); ExceptionList = &local_1c; g_menuManager->_selectedMenuID = 0; KAGE_LogMessage(1,(byte *)"Menu Manager preCrossfade\n"); MusicManager::Crossfade(&g_manager->_musicManager,0x3f,0.08); if ((g_manager->_persistentGameData)._characterMenuShown == 1) { MusicManager::EnableLayer(&g_manager->_musicManager,0,1); } KAGE_LogMessage(1,(byte *)"Menu Manager Init\n"); PopupButtons::reset(0); Seeds::constructor(); pvStack_14 = (void *)0x0; Seeds::operator_assign(&menuManager->_seedsObject,other); pvStack_14 = (void *)0xffffffff; FID_conflict__Erase_tree_>_> (tmpSeeds,(fuzzer_allocator_> *)tmpSeeds, *(_Tree_node **)((int)tmpSeeds[0] + 4)); operator_delete(tmpSeeds[0],0x14); menuManager->_viewPositionSet[0].x = 0.0; menuManager->_viewPositionSet[0].y = 0.0; menuManager->_viewPositionSet[1].x = 0.0; menuManager->_viewPositionSet[1].y = 0.0; menuManager->_viewPositionSet[2].x = 0.0; menuManager->_viewPositionSet[2].y = -270.0; menuManager->_viewPositionSet[3].x = 0.0; menuManager->_viewPositionSet[3].y = -540.0; menuManager->_viewPositionSet[4].x = -960.0; menuManager->_viewPositionSet[4].y = -810.0; menuManager->_viewPositionSet[5].x = 0.0; menuManager->_viewPositionSet[5].y = -810.0; menuManager->_viewPositionSet[6].x = *(float *)&menuManager->field_0xf6fc; menuManager->_viewPositionSet[6].y = *(float *)&menuManager->field_0xf700; selectedMenuId = menuManager->_selectedMenuID; menuManager->_viewPositionSet[7].x = 480.0; menuManager->_viewPositionSet[7].y = -405.0; menuManager->_viewPositionSet[8].x = 0.0; menuManager->_viewPositionSet[8].y = -1080.0; menuManager->_viewPositionSet[0x10].x = 1440.0; menuManager->_viewPositionSet[0x10].y = -290.0; menuManager->_viewPositionSet[9].x = 480.0; menuManager->_viewPositionSet[9].y = -1350.0; menuManager->_viewPositionSet[10].x = -480.0; menuManager->_viewPositionSet[10].y = -1080.0; menuManager->_viewPositionSet[0xd].x = -480.0; menuManager->_viewPositionSet[0xd].y = -270.0; menuManager->_viewPositionSet[0xb].x = -480.0; menuManager->_viewPositionSet[0xb].y = -1755.0; menuManager->_viewPositionSet[0xc].x = -960.0; menuManager->_viewPositionSet[0xc].y = -1890.0; menuManager->_viewPositionSet[0xe].x = 480.0; menuManager->_viewPositionSet[0xe].y = -1670.0; menuManager->_viewPositionSet[0xf].x = 950.0; menuManager->_viewPositionSet[0xf].y = -290.0; menuManager->_viewPositionSet[0x11].x = -960.0; menuManager->_viewPositionSet[0x11].y = -270.0; menuManager->_viewPositionSet[0x12].x = -960.0; menuManager->_viewPositionSet[0x12].y = -540.0; menuManager->_viewPositionSet[0x13].x = -480.0; menuManager->_viewPositionSet[0x13].y = -540.0; menuManager->_viewPositionSet[0x14].x = -960.0; menuManager->_viewPositionSet[0x14].y = -1350.0; menuManager->_viewPositionSet[0x15].x = -1440.0; menuManager->_viewPositionSet[0x15].y = -540.0; menuManager->_viewPositionSet[0x16].x = 480.0; menuManager->_viewPositionSet[0x16].y = -2160.0; viewOffsetY = g_screenHeight - 270.0; selectedViewY = menuManager->_viewPositionSet[selectedMenuId].y; (menuManager->_ViewPosition).x = (g_screenWidth - 480.0) * 0.5 + menuManager->_viewPositionSet[selectedMenuId].x; (menuManager->_ViewPosition).y = viewOffsetY * 0.5 + selectedViewY; pvVar2 = Manager::LoadImage(aVStack_c0,(byte *)"gfx/ui/main menu/EmptyScreen.png"); pvStack_14 = (void *)0x1; KAGE::SmartPointer::operator_assign(&menuManager->field_0x160,pvVar2); pvStack_14 = (void *)0x2; if ((((int *)aVStack_c0[0].y != (int *)0x0) && (isImageReleasable = (**(code **)(*(int *)aVStack_c0[0].y + 0xc))(), isImageReleasable != '\0' )) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(aVStack_c0); } pvStack_14 = (void *)0xffffffff; pvVar2 = Manager::LoadImage(overlayImageRef,(byte *)"gfx/ui/main menu/MenuOverlay.png"); pvStack_14 = (void *)0x3; KAGE::SmartPointer::operator_assign(&menuManager->field_0x168,pvVar2); pvStack_14 = (void *)0x4; if (((piStack_c4 != (int *)0x0) && (isImageReleasable = (**(code **)(*piStack_c4 + 0xc))(), isImageReleasable != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(overlayImageRef); } pvStack_14 = (void *)0xffffffff; overlayImage = *(int **)&menuManager->field_0x168; if ((overlayImage[0xc] != 1) || (overlayImage[0xd] != 1)) { (**(code **)(*overlayImage + 0x44))(1,1); overlayImage[0xc] = 1; overlayImage[0xd] = 1; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x20; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/MenuShadow.anm2",0x21); pvStack_14 = (void *)0x5; ANM2::Load(&menuManager->_MenuShadowSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } animData = (menuManager->_MenuShadowSprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00987942: bVar1 = ANM2::SetAnimation(&menuManager->_MenuShadowSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(menuManager->_MenuShadowSprite)._animState); (menuManager->_MenuShadowSprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimName = s_Idle; do { bVar1 = *animNameChar; isLess = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00987924: uVar3 = -(uint)isLess | 1; goto LAB_00987929; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00987924; animNameChar = animNameChar + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00987929: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((menuManager->_MenuShadowSprite)._animState._isPlaying == 0)))) goto LAB_00987942; } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x19; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/fly.anm2",0x1a); pvStack_14 = (void *)0x6; ANM2::Load(&menuManager->_flySprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } animData = (menuManager->_flySprite)._animState._animData; if (animData == (byte *)0x0) { LAB_00987a6a: bVar1 = ANM2::SetAnimation(&menuManager->_flySprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(menuManager->_flySprite)._animState); (menuManager->_flySprite)._animState._isPlaying = 1; } } else { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimName = s_Idle; do { bVar1 = *animNameChar; isLess = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00987a46: uVar3 = -(uint)isLess | 1; goto LAB_00987a4b; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00987a46; animNameChar = animNameChar + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00987a4b: if ((uVar3 != 0) || ((animData[0x34] != 0 && ((menuManager->_flySprite)._animState._isPlaying == 0)))) goto LAB_00987a6a; } KAGE_LogMessage(1,(byte *)"Menu Title Init\n"); titleSprite = &(menuManager->_menuTitle).TitleScreenSprite; piStack_c4 = (int *)-menuManager->_viewPositionSet[1].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[1].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1f; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/TitleMenu.anm2",0x20); pvStack_14 = (void *)0x7; ANM2::Load(titleSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } animData = (menuManager->_menuTitle).TitleScreenSprite._animState._animData; if (animData != (byte *)0x0) { animNameChar = animData; if (0xf < *(uint *)(animData + 0x14)) { animNameChar = *(byte **)animData; } expectedAnimName = s_Idle; do { bVar1 = *animNameChar; isLess = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00987bc4: uVar3 = -(uint)isLess | 1; goto LAB_00987bc9; } if (bVar1 == 0) break; bVar1 = animNameChar[1]; isLess = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00987bc4; animNameChar = animNameChar + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00987bc9: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((menuManager->_menuTitle).TitleScreenSprite._animState._isPlaying != 0)))) goto LAB_00987c03; } bVar1 = ANM2::SetAnimation(titleSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(menuManager->_menuTitle).TitleScreenSprite._animState); (menuManager->_menuTitle).TitleScreenSprite._animState._isPlaying = 1; } LAB_00987c03: FUN_009ef5c0(); (menuManager->_menuTitle).PositionX = (float)piStack_c4; (menuManager->_menuTitle).PositionY = aVStack_c0[0].y; KAGE_LogMessage(1,(byte *)"Menu Save Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[2].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[2].y; func_0x009d8ee0(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Game Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[3].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[3].y; func_0x00980c20(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Daily Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[4].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[4].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x23; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/Menu_DailyRun.anm2",0x24); pvStack_14 = (void *)0x8; ANM2::Load((ANM2 *)&menuManager->field_0xde8,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } ScoreSheet::LoadAnm2(); FUN_008370f0(); FUN_00837740(extraout_ECX); GenericPrompt::Initialize((GenericPrompt *)&menuManager->field_0x1044,0); FUN_008d0730(); manager = g_manager; *(float *)&menuManager->field_0xde0 = aVStack_c0[0].y; *(int **)&menuManager->field_0xde4 = piStack_c4; uVar3 = (manager->_persistentGameData)._eventCounters[0xc0]; if ((uint)(manager->_persistentGameData)._eventCounters[0x209] < uVar3) { (manager->_persistentGameData)._eventCounters[0x209] = uVar3; } KAGE_LogMessage(1,(byte *)"Menu Character Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[5].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[5].y; func_0x00947470(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu SpecialSeed Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[6].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[6].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1f; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/SeedsMenu.anm2",0x20); pvStack_14 = (void *)0x9; ANM2::Load(&(menuManager->_menuSpecialSeeds).SpecialSeedsSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } *(float *)&(menuManager->_menuSpecialSeeds).field_0x14 = aVStack_c0[0].y; *(int **)&(menuManager->_menuSpecialSeeds).field_0x18 = piStack_c4; Menu_SpecialSeeds::Reset(&menuManager->_menuSpecialSeeds); KAGE_LogMessage(1,(byte *)"Menu Challenge Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[7].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[7].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x23; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/ChallengeMenu.anm2",0x24); pvStack_14 = (void *)0xa; ANM2::Load(&(menuManager->_menuChallenge).ChallengeMenuSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } (menuManager->_menuChallenge).PositionX = aVStack_c0[0].y; (menuManager->_menuChallenge).PositionY = (float)piStack_c4; *(undefined4 *)&menuManager->_menuChallenge = 0; Menu_Challenge::reset(&menuManager->_menuChallenge); KAGE_LogMessage(1,(byte *)"Menu Collection Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[8].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[8].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/CollectionMenu.anm2",0x24); pvStack_14 = (void *)0xb; ANM2::Load(&(menuManager->_menuCollection).CollectionMenuSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/Death Screen.anm2",0x18); pvStack_14 = (void *)0xc; ANM2::Load(&(menuManager->_menuCollection).DeathScreenSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } Menu_Collection::reset(); (menuManager->_menuCollection).PositionX = aVStack_c0[0].y; (menuManager->_menuCollection).PositionY = (float)piStack_c4; KAGE_LogMessage(1,(byte *)"Menu Stats Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[9].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[9].y; func_0x009ec2b0(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Mods Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0x10].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0x10].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/ModsMenu.anm2",0x1e); pvStack_14 = (void *)0xd; ANM2::Load((ANM2 *)&menuManager->field_0xd97c,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } *(float *)&menuManager->field_0xd974 = aVStack_c0[0].y; *(int **)&menuManager->field_0xd978 = piStack_c4; Menu_Mods::reset(); *(ModManager *)&menuManager->field_0xda94 = g_manager->_modManager; KAGE_LogMessage(1,(byte *)"Menu Options Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[10].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[10].y; Menu_Options::Init(&menuManager->_menuOptions,aVStack_c0,0); KAGE_LogMessage(1,(byte *)"Menu Controller Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0xb].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0xb].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/ControllerSelectMenu.anm2",0x2a); pvStack_14 = (void *)0xe; ANM2::Load(&(menuManager->_menuControllerSelect).ControllerSelectSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } ANM2::Play(&(menuManager->_menuControllerSelect).ControllerSelectSprite,s_Idle,0); FUN_008c9dd0(); (menuManager->_menuControllerSelect).PositionX = aVStack_c0[0].y; (menuManager->_menuControllerSelect).PositionY = (float)piStack_c4; KAGE_LogMessage(1,(byte *)"Menu Key Config Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0xc].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0xc].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/KeyConfigMenu.anm2",0x23); pvStack_14 = (void *)0xf; ANM2::Load(&(menuManager->_menuKeyConfig).KeyConfigSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } ANM2::Play(&(menuManager->_menuKeyConfig).KeyConfigSprite,s_Idle,0); menuManager2 = g_menuManager; (menuManager->_menuKeyConfig).PositionX = aVStack_c0[0].y; (menuManager->_menuKeyConfig).PositionY = (float)piStack_c4; (menuManager->_menuKeyConfig).SelectedElement = 0; (menuManager->_menuKeyConfig).SelectedColumn = 0; *(undefined1 *)&(menuManager->_menuKeyConfig).State = 0; menuManager2->_viewPositionSet[0xc].y = -1890.0; menuManager2->_state = 1; KAGE_LogMessage(1,(byte *)"Menu Cutscene Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0xd].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0xd].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/EndingsMenu.anm2",0x21); pvStack_14 = (void *)0x10; ANM2::Load(&(menuManager->_menuCutscenes).CutscenesMenuSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } FUN_008cf480(); (menuManager->_menuCutscenes).PositionX = aVStack_c0[0].y; (menuManager->_menuCutscenes).PositionY = (float)piStack_c4; KAGE_LogMessage(1,(byte *)"Menu Bestiary Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[0xe].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[0xe].y; func_0x008c5e70(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Custom Challenge Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0xf].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0xf].y; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/ChallengeMenuCustom.anm2",0x29); pvStack_14 = (void *)0x11; ANM2::Load((ANM2 *)&menuManager->field_0xd858,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } *(float *)&menuManager->field_0xd850 = aVStack_c0[0].y; *(int **)&menuManager->field_0xd854 = piStack_c4; Menu_ModChallenges::reset(); KAGE_LogMessage(1,(byte *)"Menu Online Lobby Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[0x11].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[0x11].y; func_0x008e77a0(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Friend Lobbies Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[0x12].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[0x12].y; func_0x008dc510(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Multiplayer Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0x13].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0x13].y; std::string::string_from_cstr(anm2Path._buf,*(byte **)&menuManager->_menuOnline); pvStack_14 = (void *)0x12; ANM2::Load(&(menuManager->_menuOnline)._anm2,&anm2Path,1); pvStack_14 = (void *)0xffffffff; std::string::_Tidy_deallocate(anm2Path._buf); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/OnlineMenuSketches.anm2",0x28); pvStack_14 = (void *)0x13; ANM2::Load((ANM2 *)&(menuManager->_menuOnline).field_0x118,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pvVar2 = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pvVar2 = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } Menu_Online::enter(); *(float *)&menuManager->field_0xdccc = aVStack_c0[0].y; *(int **)&menuManager->field_0xdcd0 = piStack_c4; (menuManager->_menuOnline)._prevState = 1; KAGE_LogMessage(1,(byte *)"Menu Options Online Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[0x14].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[0x14].y; Menu_Options::Init((Menu_Options *)&menuManager->field_0xeb50,aVStack_c0,3); KAGE_LogMessage(1,(byte *)"Menu Create Lobby Init\n"); aVStack_c0[0].x = -menuManager->_viewPositionSet[0x15].x; aVStack_c0[0].y = -menuManager->_viewPositionSet[0x15].y; func_0x008cb820(aVStack_c0); KAGE_LogMessage(1,(byte *)"Menu Online Awards Init\n"); aVStack_c0[0].y = -menuManager->_viewPositionSet[0x16].x; piStack_c4 = (int *)-menuManager->_viewPositionSet[0x16].y; onlineStatsPathSize = 0; onlineStatsPathCapacity = 0xf; onlineStatsPath[0] = (void *)0x0; std::string::assign((char *)onlineStatsPath,(byte *)"gfx/ui/main menu/OnlineStatsMenu.anm2",0x25); pvStack_14 = (void *)0x14; ANM2::Load(&menuManager->_onlineStatsMenuSprite,(std_string *)onlineStatsPath,1); pvStack_14 = (void *)0xffffffff; if (0xf < onlineStatsPathCapacity) { uVar3 = onlineStatsPathCapacity + 1; pvVar2 = onlineStatsPath[0]; if (0xfff < uVar3) { pvVar2 = *(void **)((int)onlineStatsPath[0] + -4); uVar3 = onlineStatsPathCapacity + 0x24; if (0x1f < (uint)((int)onlineStatsPath[0] + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } onlineStatsPathSize = 0; onlineStatsPathCapacity = 0xf; onlineStatsPath[0] = (void *)((uint)onlineStatsPath[0] & 0xffffff00); FUN_008e71c0(); *(float *)&menuManager->field_0xf6f4 = aVStack_c0[0].y; *(int **)&menuManager->field_0xf6f8 = piStack_c4; menuManager->_state = 0; menuManager->_fadeOutActive = 0; menuManager->_fadeOutProgress = 0.0; menuManager->_fadeInActive = 0; menuManager->_fadeInProgress = 1.0; menuManager->_vingnetteIntensity = 0.0; *(undefined4 *)&menuManager->field_0x38 = 0x42b40000; *(undefined4 *)&menuManager->field_0x3c = 0x42b40000; menuManager->field_0x30 = 1; ExceptionList = local_1c; return; } //@@ 00988ba0 MenuManager::unload_graphics /* DB: ANM2::Reset of every MenuManager sprite (g_menuManager+0x1dc .. +0xe650) and sub-menu unloads; Menu_Options::Update (language reload), counterpart of MenuManager::LoadGraphics */ void MenuManager::unload_graphics(void) { MenuManager *pMVar1; pMVar1 = g_menuManager; ANM2::Reset(&(g_menuManager->_menuTitle).TitleScreenSprite); Menu_Save::unload_graphics(); ANM2::Reset(&(pMVar1->_menuGame).GameMenuSprite); ANM2::Reset(&(pMVar1->_menuGame).ContinueWidgetSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._BigCharPageSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._CharacterMenuBGSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._DifficultyOverlaySprite); ANM2::Reset(&(pMVar1->_menuCharacter)._GreedDecoOverlaySprite); ANM2::Reset(&(pMVar1->_menuCharacter)._CharacterPortraitsSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._SeedEntrySprite); ANM2::Reset(&(pMVar1->_menuCharacter)._DifficultyPageSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._SeedPageSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._WinStreakPageSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._EastereggPageSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._SeedUnlockPageSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._PageSwapWidgetSprite); ANM2::Reset(&(pMVar1->_menuCharacter)._TaintedMenuBGDecoSprite); ANM2::Reset(&(pMVar1->_menuSpecialSeeds).SpecialSeedsSprite); ANM2::Reset(&(pMVar1->_menuChallenge).ChallengeMenuSprite); ANM2::Reset(&(pMVar1->_menuCollection).CollectionMenuSprite); ANM2::Reset(&(pMVar1->_menuCollection).DeathScreenSprite); Menu_Stats::unload_graphics(&pMVar1->_menuStats); ANM2::Reset(&(pMVar1->_menuOptions).OptionsSprite); ANM2::Reset(&(pMVar1->_menuControllerSelect).ControllerSelectSprite); ANM2::Reset(&(pMVar1->_menuKeyConfig).KeyConfigSprite); ANM2::Reset(&(pMVar1->_menuCutscenes).CutscenesMenuSprite); ANM2::Reset((ANM2 *)&pMVar1->field_0xde8); ANM2::Reset((ANM2 *)&pMVar1->field_0xf10); ANM2::Reset((ANM2 *)&pMVar1->field_0x1044); pMVar1->field_0x1174 = 0; ANM2::Reset((ANM2 *)&pMVar1->field_0xd4d8); ANM2::Reset((ANM2 *)&pMVar1->field_0xd5ec); ANM2::Reset((ANM2 *)&pMVar1->field_0xd700); ANM2::Reset((ANM2 *)&pMVar1->field_0xd858); ANM2::Reset((ANM2 *)&pMVar1->field_0xd97c); Menu_OnlineLobby::unload_graphics(); ANM2::Reset((ANM2 *)&pMVar1->field_0xe650); ANM2::Reset((ANM2 *)&pMVar1->field_0xe9d4); ANM2::Reset(&(pMVar1->_menuOnline)._anm2); ANM2::Reset((ANM2 *)&pMVar1->field_0xeb74); Menu_CreateLobby::unload_graphics(); ANM2::Reset(&pMVar1->_onlineStatsMenuSprite); return; } //@@ 00988d80 MenuManager::LoadGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: loads gfx/ui/main menu/TitleMenu.anm2, ChallengeMenu, CollectionMenu, Death Screen anm2s then calls each menu loader (009ef740, 009d9560, 00980eb0, 00948200); separate from MenuManager::constructor 00986450 */ void MenuManager::LoadGraphics(void) { byte *pbVar1; byte bVar2; byte *strCursor; byte *expectedName; char *freeBlock; void *freeBuf; uint uVar3; bool isLess; std_string statsMenuAnm2Path; std_string anm2Path; uint stackCookie; void **ppvStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; MenuManager *temp_3fe6ccf943; ANM2 *titleSprite; temp_3fe6ccf943 = g_menuManager; ppvStack_20 = (void **)((int)&statsMenuAnm2Path + 0x50); local_14 = 0xffffffff; puStack_18 = &LAB_00b0d3a5; local_1c = ExceptionList; stackCookie = __security_cookie ^ (int)&statsMenuAnm2Path + 0x44U; ExceptionList = &local_1c; anm2Path._size = 0; anm2Path._capacity = 0xf; titleSprite = &(g_menuManager->_menuTitle).TitleScreenSprite; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1f; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/TitleMenu.anm2",0x20); local_14 = 0; ANM2::Load(titleSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } pbVar1 = (temp_3fe6ccf943->_menuTitle).TitleScreenSprite._animState._animData; if (pbVar1 == (byte *)0x0) { LAB_00988edb: bVar2 = ANM2::SetAnimation(titleSprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(temp_3fe6ccf943->_menuTitle).TitleScreenSprite._animState); (temp_3fe6ccf943->_menuTitle).TitleScreenSprite._animState._isPlaying = 1; } } else { strCursor = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { strCursor = *(byte **)pbVar1; } expectedName = s_Idle; do { bVar2 = *strCursor; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_00988ec0: uVar3 = -(uint)isLess | 1; goto LAB_00988ec5; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_00988ec0; strCursor = strCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00988ec5: if ((uVar3 != 0) || ((pbVar1[0x34] != 0 && ((temp_3fe6ccf943->_menuTitle).TitleScreenSprite._animState._isPlaying == 0)))) goto LAB_00988edb; } Menu_Title::load_graphics(&temp_3fe6ccf943->_menuTitle); Menu_Save::LoadGraphics(); Menu_Game::LoadGraphics(); Menu_Character::LoadGraphics(&temp_3fe6ccf943->_menuCharacter); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1f; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/SeedsMenu.anm2",0x20); local_14 = 1; ANM2::Load(&(temp_3fe6ccf943->_menuSpecialSeeds).SpecialSeedsSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x23; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/ChallengeMenu.anm2",0x24); local_14 = 2; ANM2::Load(&(temp_3fe6ccf943->_menuChallenge).ChallengeMenuSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } Menu_Challenge::reset(&temp_3fe6ccf943->_menuChallenge); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x24; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/CollectionMenu.anm2",0x25); local_14 = 3; ANM2::Load(&(temp_3fe6ccf943->_menuCollection).CollectionMenuSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x18; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14 = 4; ANM2::Load(&(temp_3fe6ccf943->_menuCollection).DeathScreenSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } Menu_Collection::reset(); Menu_Stats::LoadGraphics(&temp_3fe6ccf943->_menuStats); Menu_Options::load_menu_anm2(); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x2a; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/ControllerSelectMenu.anm2",0x2b); local_14 = 5; ANM2::Load(&(temp_3fe6ccf943->_menuControllerSelect).ControllerSelectSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } pbVar1 = (temp_3fe6ccf943->_menuControllerSelect).ControllerSelectSprite._animState._animData; if (pbVar1 != (byte *)0x0) { strCursor = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { strCursor = *(byte **)pbVar1; } expectedName = s_Idle; do { bVar2 = *strCursor; isLess = bVar2 < *expectedName; if (bVar2 != *expectedName) { LAB_00989310: uVar3 = -(uint)isLess | 1; goto LAB_00989315; } if (bVar2 == 0) break; bVar2 = strCursor[1]; isLess = bVar2 < expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_00989310; strCursor = strCursor + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_00989315: if ((uVar3 == 0) && ((pbVar1[0x34] == 0 || ((temp_3fe6ccf943->_menuControllerSelect).ControllerSelectSprite._animState._isPlaying != 0) ))) goto LAB_00989352; } bVar2 = ANM2::SetAnimation(&(temp_3fe6ccf943->_menuControllerSelect).ControllerSelectSprite,s_Idle ,1); if (bVar2 != 0) { AnimationState::Rewind (&(temp_3fe6ccf943->_menuControllerSelect).ControllerSelectSprite._animState); (temp_3fe6ccf943->_menuControllerSelect).ControllerSelectSprite._animState._isPlaying = 1; } LAB_00989352: anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x30); anm2Path._size = 0x23; anm2Path._capacity = 0x2f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/main menu/KeyConfigMenu.anm2",0x24); local_14 = 6; ANM2::Load(&(temp_3fe6ccf943->_menuKeyConfig).KeyConfigSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBlock = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBlock = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/EndingsMenu.anm2",0x21); local_14 = 7; ANM2::Load(&(temp_3fe6ccf943->_menuCutscenes).CutscenesMenuSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBuf = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBuf = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)freeBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBuf,uVar3); } ANM2::Play(&(temp_3fe6ccf943->_menuCutscenes).CutscenesMenuSprite,s_Idle,0); Menu_DailyChallenge::load_graphics(); Menu_Bestiary::load_graphics(); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/ChallengeMenuCustom.anm2",0x29); local_14 = 8; ANM2::Load((ANM2 *)&temp_3fe6ccf943->field_0xd858,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBuf = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBuf = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)freeBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBuf,uVar3); } Menu_ModChallenges::reset(); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; std::string::assign(anm2Path._buf,(byte *)"gfx/ui/main menu/ModsMenu.anm2",0x1e); local_14 = 9; ANM2::Load((ANM2 *)&temp_3fe6ccf943->field_0xd97c,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBuf = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBuf = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)freeBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBuf,uVar3); } Menu_Mods::reset(); Menu_OnlineLobby::load_graphics(); Menu_OnlineLobbyList::load_graphics(&temp_3fe6ccf943->field_0xe648); pbVar1 = *(byte **)&temp_3fe6ccf943->_menuOnline; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf._0_4_ = (void *)0x0; strCursor = pbVar1; do { bVar2 = *strCursor; strCursor = strCursor + 1; } while (bVar2 != 0); std::string::assign(anm2Path._buf,pbVar1,(int)strCursor - (int)(pbVar1 + 1)); local_14 = 10; ANM2::Load(&(temp_3fe6ccf943->_menuOnline)._anm2,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; freeBuf = (void *)anm2Path._buf._0_4_; if (0xfff < uVar3) { freeBuf = *(void **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if (0x1f < (uint)(anm2Path._buf._0_4_ + (-4 - (int)freeBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBuf,uVar3); } ANM2::Play(&(temp_3fe6ccf943->_menuOnline)._anm2,s_Idle,0); Menu_Options::load_menu_anm2(); Menu_CreateLobby::load_graphics(); statsMenuAnm2Path._size = 0; statsMenuAnm2Path._capacity = 0xf; statsMenuAnm2Path._buf._0_4_ = (void *)0x0; std::string::assign(statsMenuAnm2Path._buf,(byte *)"gfx/ui/main menu/OnlineStatsMenu.anm2",0x25); local_14 = 0xb; ANM2::Load(&temp_3fe6ccf943->_onlineStatsMenuSprite,&statsMenuAnm2Path,1); local_14 = 0xffffffff; if (0xf < statsMenuAnm2Path._capacity) { uVar3 = statsMenuAnm2Path._capacity + 1; freeBuf = (void *)statsMenuAnm2Path._buf._0_4_; if (0xfff < uVar3) { freeBuf = *(void **)(statsMenuAnm2Path._buf._0_4_ + -4); uVar3 = statsMenuAnm2Path._capacity + 0x24; if (0x1f < (uint)(statsMenuAnm2Path._buf._0_4_ + (-4 - (int)freeBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBuf,uVar3); } statsMenuAnm2Path._size = 0; statsMenuAnm2Path._capacity = 0xf; statsMenuAnm2Path._buf._0_4_ = statsMenuAnm2Path._buf._0_4_ & 0xffffff00; ANM2::Play(&temp_3fe6ccf943->_onlineStatsMenuSprite,s_Idle,0); ExceptionList = local_1c; return; } //@@ 00989750 MenuManager::start_game /* DB: writes 5 start params to g_MenuManager (g_menuManager)+0x1c..+0x2c, sets +0xd, crossfades music, "Error: Game Start Seed was not set." if +0x17c == 0, then starts with that seed (FUN_00951f60); Menu_Character::handle_input, Menu_CustomChallenge::Update, Menu_Game::Update prototype: db/protos.zhl, confirmed by RET 20 */ void MenuManager::start_game(KColor fadeColor) { MenuManager *pMVar1; int iVar2; pMVar1 = g_menuManager; (g_menuManager->_fadeInColor)._red = fadeColor._red; (pMVar1->_fadeInColor)._green = fadeColor._green; (pMVar1->_fadeInColor)._blue = fadeColor._blue; (pMVar1->_fadeInColor)._alpha = fadeColor._alpha; (pMVar1->_fadeInColor)._unk = fadeColor._unk; pMVar1->_fadeOutActive = 1; input_poll_active_device(); iVar2 = 0x5f; if ((g_manager->_persistentGameData)._characterMenuShown == 1) { iVar2 = 0x40; } MusicManager::Crossfade(&g_manager->_musicManager,iVar2,0.08); iVar2 = (pMVar1->_seedsObject)._gameStartSeed; if (iVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); iVar2 = (pMVar1->_seedsObject)._gameStartSeed; } loading_images_load(iVar2); return; } //@@ 009897d0 MenuManager::Update /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: per-state switch: Menu_Character/Stats/CustomChallenge::Update prototype: REPENTOGON */ void __thiscall MenuManager::Update(MenuManager *this) { Manager *pMVar1; undefined1 *puVar2; byte bVar3; char cVar4; LayerState *pLVar5; float *pfVar6; int unused; float *extraout_ECX; int iVar7; uint index; MenuManager *pMVar8; float fVar9; float fVar10; float fVar11; undefined1 local_e8 [84]; undefined1 local_94 [12]; undefined1 local_88 [12]; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; int *local_3c; float local_38; float local_34; MenuManager *local_30; Vector local_2c; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pMVar8 = g_menuManager; puStack_20 = local_88 + 0x84; local_14 = 0xffffffff; puStack_18 = &LAB_00b0d3f0; local_1c = ExceptionList; ExceptionList = &local_1c; local_30 = g_menuManager; puVar2 = local_88 + 0x84; if ((g_menuManager->_MenuShadowSprite)._loaded != 0) { AnimationState::Update(&(g_menuManager->_MenuShadowSprite)._animState); AnimationState::Update(&(pMVar8->_MenuShadowSprite)._overlayAnimState); puVar2 = puStack_20; } puStack_20 = puVar2; fVar10 = (pMVar8->_viewPositionSet[1].x + (g_screenWidth - 480.0) * 0.5) - (pMVar8->_ViewPosition).x; fVar9 = (pMVar8->_viewPositionSet[1].y + (g_screenHeight - 270.0) * 0.5) - (pMVar8->_ViewPosition).y; fVar10 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10); pMVar1 = g_manager; fVar9 = pMVar8->_viewPositionSet[1].x; pMVar8->_scrollinterpolationY = fVar10 * 0.004 + 176.0 + pMVar8->_viewPositionSet[1].y; pMVar8->_scrollinterpolationX = fVar10 * 0.004 * fVar10 + 364.0 + fVar9; local_24 = sin(((float)(pMVar1->_framecount % 0x50) * 6.2831855) / 80.0); local_24 = local_24 + 8.0; local_38 = -local_24; pLVar5 = ANM2::GetLayer(&pMVar8->_flySprite,(byte *)0x0); (pLVar5->_pos).y = local_38; local_24 = local_24 * 0.4; pLVar5 = ANM2::GetLayer(&pMVar8->_flySprite,(byte *)0x1); (pLVar5->_pos).x = local_24; (pLVar5->_pos).y = local_24; if ((pMVar8->_flySprite)._loaded != 0) { AnimationState::Update(&(pMVar8->_flySprite)._animState); AnimationState::Update(&(pMVar8->_flySprite)._overlayAnimState); } iVar7 = pMVar8->_selectedMenuID; if (pMVar8->_state == 0) { fVar10 = g_screenHeight - 270.0; fVar9 = pMVar8->_viewPositionSet[iVar7].y; (pMVar8->_ViewPosition).x = (g_screenWidth - 480.0) * 0.5 + pMVar8->_viewPositionSet[iVar7].x; (pMVar8->_ViewPosition).y = fVar10 * 0.5 + fVar9; } else { local_38 = (g_screenWidth - 480.0) * 0.5 + pMVar8->_viewPositionSet[iVar7].x; local_2c.y = (g_screenHeight - 270.0) * 0.5 + pMVar8->_viewPositionSet[iVar7].y; local_24 = local_38 - (pMVar8->_ViewPosition).x; local_34 = local_2c.y - (pMVar8->_ViewPosition).y; fVar9 = sqrtf(local_24 * local_24 + local_34 * local_34); if (1.0 < fVar9) { fVar10 = local_24; fVar11 = local_34; if (0.0 < fVar9) { fVar10 = local_24 * (1.0 / fVar9); fVar11 = local_34 * (1.0 / fVar9); } local_2c.y = 1.0; local_38 = fVar9 * 0.1; pfVar6 = &local_2c.y; if (1.0 <= fVar9 * 0.1) { pfVar6 = &local_38; } fVar9 = *pfVar6; (pMVar8->_ViewPosition).y = fVar9 * fVar11 + (pMVar8->_ViewPosition).y; (pMVar8->_ViewPosition).x = fVar9 * fVar10 + (pMVar8->_ViewPosition).x; } else { (pMVar8->_ViewPosition).x = local_38; (pMVar8->_ViewPosition).y = local_2c.y; pMVar8->_state = 0; } } if ((((pMVar8->field_0x30 != '\0') && (1 < pMVar8->_selectedMenuID)) && (bVar3 = InputManager::is_device_connected(&PTR_vftable_00c57b18,g_menuControllerIndex), bVar3 != 0)) && ((pMVar8->_state == 0 || (2 < pMVar8->_selectedMenuID)))) { InputManager::get_device(&PTR_vftable_00c57b18,&local_3c,g_menuControllerIndex); local_14 = 0; if ((local_3c != (int *)0x0) && (cVar4 = (**(code **)(*local_3c + 0x1c))(), cVar4 != '\0')) { pMVar8->field_0x30 = 0; } local_14 = 0xffffffff; FUN_004242b0(); } if (pMVar8->_selectedMenuID != 0xc) { index = 0; while( true ) { (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff); iVar7 = DAT_00c57b24 - _DAT_00c57b20; local_14 = 1; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_14 = 0xffffffff; if ((uint)(iVar7 >> 3) <= index) break; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&local_2c,index); local_14 = 2; if ((int *)local_2c.x == (int *)0x0) { local_14 = 3; } else { cVar4 = (**(code **)(*(int *)local_2c.x + 0x20))(); if (cVar4 != '\0') { g_menuControllerIndex = *(int *)((int)local_2c.x + 0xc); } local_14 = 4; } if ((((int *)local_2c.y != (int *)0x0) && (cVar4 = (**(code **)(*(int *)local_2c.y + 0xc))(), cVar4 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_2c); } local_14 = 0xffffffff; index = index + 1; } pMVar8 = local_30; } if (pMVar8->_fadeOutActive != 0) { pMVar8->_fadeOutProgress = pMVar8->_fadeOutProgress + 0.025; } if (pMVar8->_fadeInActive != 0) { pMVar8->_fadeInProgress = pMVar8->_fadeInProgress - 0.025; } switch(pMVar8->_selectedMenuID) { case 0: goto switchD_00989c53_caseD_0; case 1: if (((g_manager->_framecount & 1) == 0) && ((pMVar8->_menuTitle).TitleScreenSprite._loaded != 0) ) { AnimationState::Update(&(pMVar8->_menuTitle).TitleScreenSprite._animState); AnimationState::Update(&(pMVar8->_menuTitle).TitleScreenSprite._overlayAnimState); } local_34 = -NAN; local_30 = (MenuManager *)0xe; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&local_30,0,&local_34); if (cVar4 != '\0') { g_menuControllerIndex = (int)local_34; push_menu(2,unused); } local_30 = (MenuManager *)&DAT_0000000f; cVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_30,0,0); if (cVar4 != '\0') { local_2c.x = 300.0; local_2c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_e8,&g_manager->_font2_TeamMeatEx12,FUN_009ef550,(void *)0x0,&local_2c); local_14 = 5; MessagePopup::add_yes_no_buttons((byte *)"##PLATFORM###CONFIRM_EXIT_GAME",local_e8); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_e8); local_6c = 0; local_68 = 0; local_74 = 0; local_70 = 0; local_7c = 0; local_78 = 0; FID_conflict__Tidy(local_88); FID_conflict__Tidy(local_94); } break; case 2: Menu_Save::Update(&pMVar8->_menuSave); break; case 3: Menu_Game::Update(&pMVar8->_menuGame); break; case 4: Menu_DailyChallenge::Update(&pMVar8->_menuDailyChallenge); break; case 5: Menu_Character::Update(&pMVar8->_menuCharacter); break; case 6: Menu_SpecialSeeds::Update(&pMVar8->_menuSpecialSeeds); break; case 7: Menu_Challenge::Update(); break; case 8: Menu_Collection::Update(); break; case 9: Menu_Stats::Update(&pMVar8->_menuStats); break; case 10: Menu_Options::Update(&pMVar8->_menuOptions); break; case 0xb: Menu_ControllerSelect::Update(); break; case 0xc: Menu_KeyConfig::Update(&pMVar8->_menuKeyConfig); break; case 0xd: Menu_Cutscenes::Update(); break; case 0xe: Menu_Bestiary::Update(); break; case 0xf: Menu_CustomChallenge::Update(&pMVar8->_menuCustomChallenge); break; case 0x10: Menu_Mods::Update(&pMVar8->_menuMods); break; case 0x11: Menu_OnlineLobby::Update(); break; case 0x12: Menu_OnlineLobbyList::Update(&pMVar8->field_0xe648); break; case 0x13: Menu_Online::Update(&pMVar8->_menuOnline); break; case 0x14: Menu_Options::Update((Menu_Options *)&pMVar8->field_0xeb50); break; case 0x15: Menu_OnlineMode::Update(); break; case 0x16: if (((g_manager->_framecount & 1) == 0) && ((pMVar8->_onlineStatsMenuSprite)._loaded != 0)) { AnimationState::Update(&(pMVar8->_onlineStatsMenuSprite)._animState); AnimationState::Update(&(pMVar8->_onlineStatsMenuSprite)._overlayAnimState); } Menu_OnlineAwards::Update(); pLVar5 = ANM2::GetLayer(&pMVar8->_onlineStatsMenuSprite,(byte *)"Cursor"); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(&pMVar8->_onlineStatsMenuSprite,*(int *)pLVar5->_layerData, *(int *)&pMVar8->field_0xf6f0); } } if (((((pMVar8->_shouldLerpColorModState != 0) && (ColorModState::move_toward(&pMVar8->_targetColorModState,&pMVar8->_lerpColorModState), *extraout_ECX == (pMVar8->_targetColorModState)._red)) && (extraout_ECX[1] == (pMVar8->_targetColorModState)._green)) && ((extraout_ECX[2] == (pMVar8->_targetColorModState)._blue && (extraout_ECX[3] == (pMVar8->_targetColorModState)._amount)))) && ((extraout_ECX[4] == (pMVar8->_targetColorModState)._brightness && (extraout_ECX[5] == (pMVar8->_targetColorModState)._contrast)))) { pMVar8->_shouldLerpColorModState = 0; } switchD_00989c53_caseD_0: ExceptionList = local_1c; return; } //@@ 0098a040 MenuManager::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? sub-menu render list (MenuManager+0xdd4/0x2688/0x27b8/0xd4d0) prototype: REPENTOGON */ void __thiscall MenuManager::Render(MenuManager *this) { undefined4 *puVar1; KColor *color; void *pvVar2; undefined *shader; ColorMod *color_00; KColor *color_01; ColorMod *extraout_ECX; AnimationState *secondAnimState; ColorMod *extraout_ECX_00; KColor *color_02; int unused; int unused_00; KColor *color_03; ColorMod *unusedArg; undefined1 *other; MenuManager *menuManager; int iVar3; float vignetteIntensity; undefined1 auStackY_1e8 [128]; Vector *image; Vector *image_00; Vector *imageRefCount; undefined1 quad [2]; undefined1 auStack_146 [110]; undefined4 local_d8 [8]; undefined4 local_b8; undefined4 uStack_b4; undefined4 local_b0; undefined4 local_ac; undefined4 uStack_a8; undefined4 uStack_a4; float fStack_a0; undefined4 local_8c; undefined4 uStack_88; undefined4 local_84; KColor scratchKColor; undefined4 *overlayImageRef; ColorMod *shadowColor; MenuManager *savedMenuManager; KColor quadColor; byte isColorModifierEnabled; Vector renderPos; ColorMod shaderColor; float local_14; code *drawFn; byte isAchievementScreenVisible; Manager *manager; float prevVignetteIntensity; menuManager = g_menuManager; local_14 = (float)(__security_cookie ^ (uint)((&shaderColor)[1]._tint + 1)); isColorModifierEnabled = (g_manager->_optionsConfig)._enableColorModifier; savedMenuManager = g_menuManager; if (isColorModifierEnabled != 0) { renderPos.x = 0.0; renderPos.y = 0.0; std::vector::resize(&renderPos); puVar1 = std::deque::back(); if ((byte *)(puVar1 + 1) != (byte *)0x0) { *(byte *)(puVar1 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar1 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,DAT_00c798b0,1); } RenderTarget::Clear(&DAT_00c798e0); 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; KColor::SetFromARGB(&scratchKColor,0xffccbebb); pvVar2 = render_quad_set_uniform_color(quad,0.0,0.0,g_screenWidth,g_screenHeight,color); image_00 = (Vector *)0x98a14f; render_color_shader_pass(pvVar2); renderPos.y = (g_menuManager->_ViewPosition).y + (menuManager->_menuTitle).PositionY; renderPos.x = (g_menuManager->_ViewPosition).x + (menuManager->_menuTitle).PositionX; if ((menuManager->_menuTitle).TitleScreenSprite._loaded != 0) { if ((menuManager->_menuTitle).TitleScreenSprite._overlayRenderFirst == 0) { AnimationState::Render (&(menuManager->_menuTitle).TitleScreenSprite._animState,&renderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(menuManager->_menuTitle).TitleScreenSprite._overlayAnimState; } else { AnimationState::Render (&(menuManager->_menuTitle).TitleScreenSprite._overlayAnimState,&renderPos, &g_vectorZero,&g_vectorZero); secondAnimState = &(menuManager->_menuTitle).TitleScreenSprite._animState; } image_00 = &g_vectorZero; AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } Menu_Challenge::Render(&menuManager->_menuChallenge); Menu_DailyChallenge::Render(&menuManager->_menuDailyChallenge); Menu_Collection::Render(&menuManager->_menuCollection); Menu_Bestiary::Render(&menuManager->_menuBestiary); Menu_Stats::Render(&menuManager->_menuStats); Menu_Character::Render(&menuManager->_menuCharacter); Menu_Game::Render(&menuManager->_menuGame); Menu_SpecialSeeds::Render(&menuManager->_menuSpecialSeeds); Menu_ControllerSelect::Render(&menuManager->_menuControllerSelect); Menu_KeyConfig::Render(&menuManager->_menuKeyConfig); Menu_Options::Render(&menuManager->_menuOptions); Menu_Cutscenes::Render(); Menu_CustomChallenge::Render(&menuManager->_menuCustomChallenge); AnimationLayer::RenderFrame((AnimationLayer *)&menuManager->_menuMods); Menu_OnlineLobby::Render(&menuManager->field_0xe648); Menu_OnlineLobby::Render(&menuManager->field_0xdce8); Menu_Online::Render(&menuManager->_menuOnline); Menu_Options::Render((Menu_Options *)&menuManager->field_0xeb50); Menu_Online::render_mode_select(); Menu_Online::render_descriptions(); Menu_Save::Render(&menuManager->_menuSave); imageRefCount = (Vector *)0x98a2c5; Leaderboard::Render(); renderPos.y = (menuManager->_ViewPosition).y + menuManager->_scrollinterpolationY; renderPos.x = (menuManager->_ViewPosition).x + menuManager->_scrollinterpolationX; if ((menuManager->_flySprite)._loaded != 0) { if ((menuManager->_flySprite)._overlayRenderFirst == 0) { AnimationState::Render (&(menuManager->_flySprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero); secondAnimState = &(menuManager->_flySprite)._overlayAnimState; } else { AnimationState::Render (&(menuManager->_flySprite)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero ); secondAnimState = &(menuManager->_flySprite)._animState; } imageRefCount = &g_vectorZero; image_00 = &g_vectorZero; AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); } manager = g_manager; if (menuManager->field_0x30 == '\0') { switchD_0098a35a_caseD_1: (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; goto LAB_0098a3c0; } switch(menuManager->_selectedMenuID) { case 1: goto switchD_0098a35a_caseD_1; case 2: case 3: case 5: case 6: case 7: case 10: case 0xb: case 0xc: (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 0.0; (manager->_popupButtons)._buttons[1]._targetSlideOffset = 0.0; goto switchD_0098a35a_default; case 4: case 8: case 0xd: case 0xe: (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 25.0; break; case 9: isAchievementScreenVisible = (menuManager->_menuStats)._isAchievementScreenVisible; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 0.0; if (isAchievementScreenVisible == 0) { (manager->_popupButtons)._buttons[1]._targetSlideOffset = 0.0; goto switchD_0098a35a_default; } break; default: goto switchD_0098a35a_default; } LAB_0098a3c0: (manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; switchD_0098a35a_default: iVar3 = (menuManager->_menuCharacter).Difficulty; if ((iVar3 == 1) || (iVar3 == 3)) { vignetteIntensity = 0.5; } else { vignetteIntensity = 0.0; } prevVignetteIntensity = menuManager->_vingnetteIntensity; if (0.025 < ABS(prevVignetteIntensity - vignetteIntensity)) { if (vignetteIntensity <= prevVignetteIntensity) { vignetteIntensity = prevVignetteIntensity - 0.025; } else { vignetteIntensity = prevVignetteIntensity + 0.025; } } menuManager->_vingnetteIntensity = vignetteIntensity; shaderColor._tint[0] = 1.0; shaderColor._tint[1] = 1.0; shaderColor._tint[2] = 1.0; shaderColor._tint[3] = 1.0; shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } other = &menuManager->field_0x168; shaderColor._offset[0] = 0.0; shaderColor._offset[1] = 0.0; shaderColor._colorize[0] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._colorize[2] = 0.0; shaderColor._colorize[3] = 0.0; shaderColor._offset[2] = 0.0; g_currentShader = shader; overlayImageRef = (undefined4 *)other; KAGE::SmartPointer::operator_assign(quad + -0x10,other); image = (Vector *)0x98a47b; apply_sprite_shader_params(&shaderColor,1,image_00,imageRefCount); drawFn = *(code **)(**(int **)other + 0x1c); KColor::SetFromARGB(&quadColor,0xffffffff); render_quad_set_uniform_color(quad,-0.5,-0.5,g_screenWidth + 0.5,g_screenHeight + 0.5,color_01); (*drawFn)(); menuManager = savedMenuManager; renderPos = (Vector)((ulonglong)(uint)(g_screenHeight - 148.0) << 0x20); unusedArg = extraout_ECX; if ((savedMenuManager->_MenuShadowSprite)._loaded != 0) { if ((savedMenuManager->_MenuShadowSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(savedMenuManager->_MenuShadowSprite)._animState,&renderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(menuManager->_MenuShadowSprite)._overlayAnimState; } else { AnimationState::Render (&(savedMenuManager->_MenuShadowSprite)._overlayAnimState,&renderPos,&g_vectorZero, &g_vectorZero); secondAnimState = &(menuManager->_MenuShadowSprite)._animState; } image = &g_vectorZero; AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero); unusedArg = extraout_ECX_00; } vignetteIntensity = menuManager->_vingnetteIntensity; if (0.0 < vignetteIntensity) { shadowColor = &(menuManager->_MenuShadowSprite)._color; local_ac = 0x3f800000; uStack_a8 = 0x3f800000; uStack_a4 = 0x3f800000; local_8c = 0; uStack_88 = 0; local_84 = 0; if (shadowColor != (ColorMod *)&local_ac) { (menuManager->_MenuShadowSprite)._color._colorize[0] = 0.0; (menuManager->_MenuShadowSprite)._color._colorize[1] = 0.0; (menuManager->_MenuShadowSprite)._color._colorize[2] = 0.0; (menuManager->_MenuShadowSprite)._color._colorize[3] = 0.0; shadowColor->_tint[0] = 1.0; (menuManager->_MenuShadowSprite)._color._tint[1] = 1.0; (menuManager->_MenuShadowSprite)._color._tint[2] = 1.0; (menuManager->_MenuShadowSprite)._color._tint[3] = vignetteIntensity; (menuManager->_MenuShadowSprite)._color._offset[0] = 0.0; (menuManager->_MenuShadowSprite)._color._offset[1] = 0.0; (menuManager->_MenuShadowSprite)._color._offset[2] = 0.0; } shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } pvVar2 = (void *)0x98a5ea; g_currentShader = shader; fStack_a0 = vignetteIntensity; Color::Color((Color *)&shaderColor); puVar1 = overlayImageRef; KAGE::SmartPointer::operator_assign(auStackY_1e8 + 0x88,overlayImageRef); apply_sprite_shader_params(color_00,1,image,pvVar2); quadColor._unk = 0; quadColor._red = 1.0; quadColor._green = 1.0; drawFn = *(code **)(*(int *)*puVar1 + 0x1c); quadColor._blue = 1.0; quadColor._alpha = savedMenuManager->_vingnetteIntensity; KColor::SetFromARGB(&scratchKColor,0xffffffff); render_quad_set_uniform_color(quad,-0.5,-0.5,g_screenWidth + 0.5,g_screenHeight + 0.5,color_02); (*drawFn)(); local_b8 = 0; uStack_b4 = 0; local_b0 = 0; unusedArg = shadowColor; menuManager = savedMenuManager; if (shadowColor != (ColorMod *)local_d8) { shadowColor->_colorize[0] = 0.0; shadowColor->_colorize[1] = 0.0; shadowColor->_colorize[2] = 0.0; shadowColor->_colorize[3] = 0.0; shadowColor->_offset[0] = 0.0; shadowColor->_offset[1] = 0.0; shadowColor->_tint[0] = 1.0; shadowColor->_tint[1] = 1.0; shadowColor->_tint[2] = 1.0; shadowColor->_tint[3] = 1.0; shadowColor->_offset[2] = 0.0; } } if (isColorModifierEnabled != 0) { _glfw_context_reset(); pop_render_target(); RenderTarget::Clear(&DAT_00c798e0); 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; Shader::set_uniform(shader,(byte *)"Amount",8,&(menuManager->_currentColorModState)._amount, (int)shader); Shader::set_uniform(g_currentShader,(byte *)"Brightness",8, &(menuManager->_currentColorModState)._brightness,unused); Shader::set_uniform(g_currentShader,(byte *)"Contrast",8, &(menuManager->_currentColorModState)._contrast,unused_00); shaderColor._colorize[2] = 0.0; shaderColor._tint[2] = 0.0; shaderColor._colorize[1] = 0.0; shaderColor._tint[3] = 0.0; shaderColor._offset[0] = 1.0; shaderColor._colorize[0] = 1.0; shaderColor._offset[1] = 1.0; shaderColor._colorize[3] = 1.0; shaderColor._offset[2] = (float)((uint)shaderColor._offset[2] & 0xffffff00); KColor::SetFromARGB(&scratchKColor,0xffffffff); render_quad_set_uniform_color(quad,0.0,0.0,g_screenWidth,g_screenHeight,color_03); quadColor._red = (menuManager->_currentColorModState)._red; quadColor._green = (menuManager->_currentColorModState)._green; quadColor._blue = (menuManager->_currentColorModState)._blue; quadColor._unk = 0; quadColor._alpha = 1.0; (**(code **)(*DAT_00c798b0 + 0x14))(shaderColor._tint + 2); g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; unusedArg = (ColorMod *)&DAT_00000006; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; } iVar3 = 1; shader_cache_find((int)unusedArg); if (menuManager->_fadeOutActive != 0) { g_graphicsManager_blendMode[1] = 1; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; quadColor._alpha = menuManager->_fadeOutProgress; quadColor._unk = 0; quadColor._red = 0.0; quadColor._green = 0.0; quadColor._blue = 0.0; render_quad_set_uniform_color(quad,0.0,0.0,g_screenWidth,g_screenHeight,&quadColor); render_color_shader_pass(quad); Manager::render_loading_icon(); } if (menuManager->_fadeInActive != 0) { g_graphicsManager_blendMode[0] = 0; if ((g_graphicsManager_flags & 4) == 0) { iVar3 = 6; } g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; quadColor._red = (menuManager->_fadeInColor)._red; quadColor._unk = (menuManager->_fadeInColor)._unk; quadColor._green = (menuManager->_fadeInColor)._green; quadColor._blue = (menuManager->_fadeInColor)._blue; quadColor._alpha = menuManager->_fadeInProgress; g_graphicsManager_blendMode[1] = iVar3; render_quad_set_uniform_color(quad,0.0,0.0,g_screenWidth,g_screenHeight,&quadColor); render_color_shader_pass(quad); if (menuManager->_fadeInProgress <= 0.0) { menuManager->_fadeInActive = 0; menuManager->_fadeInProgress = 0.0; } } return; } //@@ 0098aa30 MenuManager::SetState /* DB: ECX = g_MenuManager (g_menuManager) whose +0 is a vector menu-state stack; param_2==0 just switches (logs "Setting the intitial menu state to %d, are you sure about that?"), else rebuilds the stack 1..N ("Unhandled Menu State trying to create a menu stack"); Menu_KeyConfig::Update pops the stack then calls it with the new top prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall MenuManager::SetState(MenuManager *this,int state,byte isRebuildStack) { void **ppvVar1; void *pvVar2; byte isAllMarks; undefined4 *stackEnd; int slotStatus; byte unk; Menu_Save *extraout_ECX; Menu_Save *extraout_ECX_00; Menu_Save *extraout_ECX_01; Menu_Save *extraout_ECX_02; Menu_Save *extraout_ECX_03; Menu_Save *this_00; Menu_Save *extraout_ECX_04; Menu_Save *extraout_ECX_05; int iVar3; int local_10 [3]; int *historyEnd; Manager *manager; MenuManager *menuManager; pvVar2 = (this->_menuStateHistory)._end; this_00 = (this->_menuStateHistory)._begin; if (isRebuildStack == 0) { if ((((int)pvVar2 - (int)this_00 & 0xfffffffcU) == 0) && (state != 1)) { KAGE_LogMessage(4,(byte *)"Setting the intitial menu state to %d, are you sure about that? \n" ); this_00 = extraout_ECX_03; } } else { if (((int)pvVar2 - (int)this_00 >> 2 != 0) && (*(int *)((int)pvVar2 + -4) == 4)) { FUN_008d0730(); this_00 = (this->_menuStateHistory)._begin; } iVar3 = 1; (this->_menuStateHistory)._end = this_00; do { if (state < iVar3) break; historyEnd = (this->_menuStateHistory)._end; local_10[0] = iVar3; if (historyEnd == (this->_menuStateHistory)._capacity) { std::vector::_Emplace_reallocate(historyEnd,local_10); this_00 = extraout_ECX; } else { *historyEnd = iVar3; ppvVar1 = &(this->_menuStateHistory)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } iVar3 = iVar3 + 1; } while (iVar3 < 4); if (3 < state) { if (state == 0x11) { stackEnd = (this->_menuStateHistory)._end; local_10[0] = 0x13; if (stackEnd == (this->_menuStateHistory)._capacity) { std::vector::_Emplace_reallocate(stackEnd,local_10); this_00 = extraout_ECX_00; } else { *stackEnd = 0x13; ppvVar1 = &(this->_menuStateHistory)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } stackEnd = (this->_menuStateHistory)._end; local_10[0] = 0x11; if (stackEnd == (this->_menuStateHistory)._capacity) { LAB_0098ab0d: std::vector::_Emplace_reallocate(stackEnd,local_10); this_00 = extraout_ECX_01; } else { *stackEnd = 0x11; ppvVar1 = &(this->_menuStateHistory)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } } else if (state == 0x13) { stackEnd = (this->_menuStateHistory)._end; local_10[0] = state; if (stackEnd == (this->_menuStateHistory)._capacity) goto LAB_0098ab0d; *stackEnd = 0x13; ppvVar1 = &(this->_menuStateHistory)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } else { KAGE_LogMessage(0x10,(byte *)"Unhandled Menu State trying to create a menu stack"); this_00 = extraout_ECX_02; } } } manager = g_manager; iVar3 = this->_selectedMenuID; if ((iVar3 != 0) && (state != 0)) { local_10[0] = 8; seed_fart_sound_override(local_10); SoundEffects::Play(&manager->_sfxManager,local_10[0],1.0,0,0,1.0,0.0); iVar3 = this->_selectedMenuID; this->_state = 1; this_00 = extraout_ECX_04; } if (iVar3 == 0x10) { if (state != 3) goto LAB_0098ac76; if (this->field_0xda90 != '\0') { ModManager::Reset(&g_manager->_modManager); FUN_00959fa0(g_manager->_currentSaveSlot); iVar3 = this->_selectedMenuID; this_00 = extraout_ECX_05; goto LAB_0098abe2; } LAB_0098adf4: if (this->_selectedMenuID != 6) goto LAB_0098ae05; } else { LAB_0098abe2: if (iVar3 == 2) { if (state == 3) { Menu_Character::Reset(&this->_menuCharacter); FUN_00982060(); pvVar2 = (this->_seedsObject)._seedEffects; ppvVar1 = &(this->_seedsObject)._seedEffects; FID_conflict__Erase_tree_>_> (ppvVar1,(fuzzer_allocator_> *)ppvVar1, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; (this->_seedsObject)._seedEffectsCount = 0; goto LAB_0098adf4; } LAB_0098ac76: menuManager = g_menuManager; if ((state == 7) || (iVar3 == 7)) { Menu_Challenge::reset(&this->_menuChallenge); } else { if (iVar3 != 0xc) { if ((iVar3 == 3) && (state == 2)) { iVar3 = g_manager->_currentSaveSlot; Menu_Save::replace_slot_graphics (this_00,(ANM2 *)((int)(&this->_menuTitle + 1) + iVar3 * 0x114 + 0x1c)); slotStatus = save_slot_get_status(); (this->_menuGame).GameMenuSprite._filename._buf[iVar3 + -0x445] = (char)slotStatus; isAllMarks = has_all_completion_marks(); (this->_menuGame).GameMenuSprite._filename._buf[iVar3 + -0x442] = isAllMarks; Menu_Save::update_save_drawings(&this->_menuSave); ANM2::LoadGraphics((ANM2 *)((int)(&this->_menuTitle + 1) + iVar3 * 0x114 + 0x1c),unk); Menu_Character::set_character_menu_shown(&this->_menuCharacter,0); } else if (state == 4) { FUN_008d0730(); } else if (state == 0xe) { FUN_008c8760(); } else if (state == 0xf) { Menu_ModChallenges::reset(); } else if (state == 0x10) { Menu_Mods::reset(); } else if (state == 0x12) { Menu_OnlineLobbyList::reset(); } else if (state == 0x13) { Menu_Online::enter(); } else if (state == 10) { Menu_Options::reload(); } else if (state == 0x14) { Menu_Options::reload(); } else if (state == 0x15) { FUN_008cc530(); } else { if (state != 0x16) goto LAB_0098adef; FUN_008e71c0(); } goto LAB_0098adf4; } (this->_menuKeyConfig).SelectedElement = 0; (this->_menuKeyConfig).SelectedColumn = 0; *(undefined1 *)&(this->_menuKeyConfig).State = 0; menuManager->_viewPositionSet[0xc].y = -1890.0; menuManager->_state = 1; } } else { if (iVar3 != 5) goto LAB_0098ac76; (this->_menuCharacter)._seedUnlockPageState = 0; (this->_menuCharacter)._seedUnlockPageTimer = 0; std::string::assign(&(this->_menuCharacter).field_0xd84,&s_empty,0); std::string::assign(&(this->_menuCharacter).field_0xd9c,&s_empty,0); } LAB_0098adef: if (state != 6) goto LAB_0098adf4; } Menu_SpecialSeeds::Reset(&this->_menuSpecialSeeds); LAB_0098ae05: this->_selectedMenuID = state; return; } //@@ 0098ae20 MenuManager::push_menu /* DB: ? uses MenuManager global g_menuManager: if (+0x40 current menu) != id, pushes id onto the history vector at +4, then calls the menu transition FUN_0098aa30(id,0); callers Menu_Game::Update, Menu_Character::handle_input, Menu_Online* prototype: db/protos.zhl, confirmed by RET 8 */ void MenuManager::push_menu(int menuId,int unused) { void **ppvVar1; int *piVar2; MenuManager *this; int state; Vector local_10; state = menuId; this = g_menuManager; if (g_menuManager->_selectedMenuID != menuId) { if (g_menuManager->_selectedMenuID == 2) { local_10.x = -g_menuManager->_viewPositionSet[10].x; local_10.y = -g_menuManager->_viewPositionSet[10].y; Menu_Options::Init(&g_menuManager->_menuOptions,&local_10,0); } piVar2 = (this->_menuStateHistory)._end; if (piVar2 == (this->_menuStateHistory)._capacity) { std::vector::_Emplace_reallocate(piVar2,&menuId); state = menuId; } else { *piVar2 = state; ppvVar1 = &(this->_menuStateHistory)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } } if (this->_selectedMenuID != state) { SetState(this,state,0); } return; } //@@ 0098aec0 FUN_0098aec0 void FUN_0098aec0(void) { MenuManager *this; void *pvVar1; this = g_menuManager; pvVar1 = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)pvVar1 - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { pvVar1 = (void *)((int)pvVar1 + -4); (g_menuManager->_menuStateHistory)._end = pvVar1; } MenuManager::SetState(this,*(int *)((int)pvVar1 + -4),0); return; } //@@ 0098aef0 FUN_0098aef0 undefined4 FUN_0098aef0(void) { void *pvVar1; uint uVar2; pvVar1 = (g_menuManager->_menuStateHistory)._begin; uVar2 = (int)(g_menuManager->_menuStateHistory)._end - (int)pvVar1 >> 2; if (uVar2 < 2) { return 0; } return *(undefined4 *)((int)pvVar1 + uVar2 * 4 + -8); } //@@ 0098af10 MenuManager::scroll_options_menu /* DB: ? "Unknown options menu specified"; options menu 10 (MenuManager+0xf758) or 0x14 (+0xf7a8): sets the base y, shifts +0xf708+menu*8 by 20 px per row past 3, marks dirty +0xc; Menu_Options::Update */ void MenuManager::scroll_options_menu(int param_1,int param_2,int param_3) { MenuManager *pMVar1; pMVar1 = g_menuManager; if (param_1 == 10) { g_menuManager->_viewPositionSet[10].y = -1080.0; } else if (param_1 == 0x14) { g_menuManager->_viewPositionSet[0x14].y = -1350.0; } else { KAGE_LogMessage(0x10,(byte *)"Unknown options menu specified\n"); } if (3 < param_2) { if (param_3 + -4 < param_2) { param_2 = param_3 + -4; } pMVar1->_viewPositionSet[param_1].y = pMVar1->_viewPositionSet[param_1].y - (float)(param_2 + -3) * 20.0; } pMVar1->_state = 1; return; } //@@ 0098afa0 FUN_0098afa0 void FUN_0098afa0(float *param_1) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; MenuManager *pMVar11; float in_XMM3_Da; pMVar11 = g_menuManager; fVar1 = param_1[1]; fVar2 = param_1[2]; fVar3 = param_1[3]; (g_menuManager->_targetColorModState)._red = *param_1; (pMVar11->_targetColorModState)._green = fVar1; (pMVar11->_targetColorModState)._blue = fVar2; (pMVar11->_targetColorModState)._amount = fVar3; fVar1 = param_1[5]; (pMVar11->_targetColorModState)._brightness = param_1[4]; (pMVar11->_targetColorModState)._contrast = fVar1; fVar1 = (pMVar11->_targetColorModState)._contrast; fVar2 = (pMVar11->_targetColorModState)._brightness; fVar3 = (pMVar11->_targetColorModState)._amount; fVar4 = (pMVar11->_targetColorModState)._blue; fVar5 = (pMVar11->_targetColorModState)._red; fVar6 = (pMVar11->_currentColorModState)._contrast; fVar7 = (pMVar11->_currentColorModState)._brightness; fVar8 = (pMVar11->_currentColorModState)._amount; fVar9 = (pMVar11->_currentColorModState)._blue; fVar10 = (pMVar11->_currentColorModState)._red; (pMVar11->_lerpColorModState)._green = ABS((pMVar11->_targetColorModState)._green - (pMVar11->_currentColorModState)._green) * in_XMM3_Da; (pMVar11->_lerpColorModState)._blue = ABS(fVar4 - fVar9) * in_XMM3_Da; (pMVar11->_lerpColorModState)._red = ABS(fVar5 - fVar10) * in_XMM3_Da; (pMVar11->_lerpColorModState)._amount = ABS(fVar3 - fVar8) * in_XMM3_Da; (pMVar11->_lerpColorModState)._brightness = ABS(fVar2 - fVar7) * in_XMM3_Da; (pMVar11->_lerpColorModState)._contrast = ABS(fVar1 - fVar6) * in_XMM3_Da; pMVar11->_shouldLerpColorModState = 1; return; } //@@ 0098b0a0 FUN_0098b0a0 void FUN_0098b0a0(void) { ANM2 *pAVar1; ANM2 *in_ECX; ANM2::constructor(in_ECX); pAVar1 = in_ECX + 1; (pAVar1->_filename)._buf[0xc] = '\0'; (pAVar1->_filename)._buf[0xd] = '\0'; (pAVar1->_filename)._buf[0xe] = '\0'; (pAVar1->_filename)._buf[0xf] = '\0'; pAVar1 = in_ECX + 1; (pAVar1->_filename)._buf[8] = '\0'; (pAVar1->_filename)._buf[9] = '\0'; (pAVar1->_filename)._buf[10] = '\0'; (pAVar1->_filename)._buf[0xb] = '\0'; in_ECX[1]._filename._capacity = 0; in_ECX[1]._filename._size = 0; in_ECX[1]._animState._animation = (void *)0x0; in_ECX[1]._animDefaultName._capacity = 0; in_ECX[1]._animState._layerFrames = (void *)0x0; in_ECX[1]._animState._animData = (void *)0x0; in_ECX[1]._filename._buf[0] = '\0'; in_ECX[1]._filename._buf[1] = '\0'; in_ECX[1]._filename._buf[2] = '\0'; in_ECX[1]._filename._buf[3] = '\0'; pAVar1 = in_ECX + 1; (pAVar1->_filename)._buf[4] = '\0'; (pAVar1->_filename)._buf[5] = '\0'; (pAVar1->_filename)._buf[6] = '\0'; (pAVar1->_filename)._buf[7] = '\0'; in_ECX[1]._animState._animFrame = 0.0; in_ECX[1]._animState._nullLayerFrames = (void *)0x0; return; } //@@ 0098b130 FUN_0098b130 void FUN_0098b130(void) { int *piVar1; char cVar2; ANM2 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; piVar1 = *(int **)(in_ECX[1]._filename._buf + 4); if (piVar1 != (int *)0x0) { cVar2 = (**(code **)(*piVar1 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 1); } } local_8 = 1; ANM2::Reset(in_ECX); AnimationState::~AnimationState(&in_ECX->_overlayAnimState); AnimationState::~AnimationState(&in_ECX->_animState); std::string::_Tidy_deallocate((in_ECX->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)in_ECX); ExceptionList = local_10; return; } //@@ 0098b1d0 Minimap::~Minimap /* DB: Game::~Game member; resets the ANM2s at +0x500 (_iconsSprite), +0x3ec (_hudPickupSprite), +0x2d8 (_itemIconsSprite) and frees their heap blocks, releases the image ref at +0x614 and render-target SmartPointers, matching Minimap::Init's layout */ void __thiscall Minimap::~Minimap(Minimap *this) { char isLastRef; uint uVar1; undefined4 extraout_ECX; undefined4 uVar2; undefined4 extraout_ECX_00; qword *allocatedBytes; int i; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *frameBlock; qword prevAllocatedBytes; local_8 = 0xffffffff; puStack_c = &LAB_00b0d410; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE::SmartPointer::reset(&this->field_0x614,(void *)0x0); i = 2; uVar2 = extraout_ECX; do { KAGE::SmartPointer::reset(uVar2); i = i + -1; uVar2 = extraout_ECX_00; } while (i != 0); if (*(int **)&this->field_0x618 != (int *)0x0) { local_8 = i; isLastRef = (**(code **)(**(int **)&this->field_0x618 + 0xc))(uVar1); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&this->field_0x614); } } local_8 = 1; ANM2::Reset(&this->_iconsSprite); frameBlock = (this->_iconsSprite)._overlayAnimState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_iconsSprite)._overlayAnimState._layerFrames = (void *)0x0; } frameBlock = (this->_iconsSprite)._overlayAnimState._nullLayerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_iconsSprite)._overlayAnimState._nullLayerFrames = (void *)0x0; } frameBlock = (this->_iconsSprite)._animState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_iconsSprite)._animState._layerFrames = (void *)0x0; } frameBlock = (this->_iconsSprite)._animState._nullLayerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_iconsSprite)._animState._nullLayerFrames = (void *)0x0; } std::string::_Tidy_deallocate((this->_iconsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_iconsSprite); local_8 = 6; ANM2::Reset(&this->_hudPickupSprite); frameBlock = (this->_hudPickupSprite)._overlayAnimState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_hudPickupSprite)._overlayAnimState._layerFrames = (void *)0x0; } frameBlock = (this->_hudPickupSprite)._overlayAnimState._nullLayerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_hudPickupSprite)._overlayAnimState._nullLayerFrames = (void *)0x0; } frameBlock = (this->_hudPickupSprite)._animState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_hudPickupSprite)._animState._layerFrames = (void *)0x0; } frameBlock = (this->_hudPickupSprite)._animState._nullLayerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_hudPickupSprite)._animState._nullLayerFrames = (void *)0x0; } std::string::_Tidy_deallocate((this->_hudPickupSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_hudPickupSprite); local_8 = 0xb; ANM2::Reset(&this->_itemIconsSprite); frameBlock = (this->_itemIconsSprite)._overlayAnimState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_itemIconsSprite)._overlayAnimState._layerFrames = (void *)0x0; } frameBlock = (this->_itemIconsSprite)._overlayAnimState._nullLayerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_itemIconsSprite)._overlayAnimState._nullLayerFrames = (void *)0x0; } frameBlock = (this->_itemIconsSprite)._animState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_itemIconsSprite)._animState._layerFrames = (void *)0x0; } frameBlock = (this->_itemIconsSprite)._animState._nullLayerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)frameBlock + -4); prevAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar1; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)prevAllocatedBytes < uVar1); free((void *)((int)frameBlock + -4)); (this->_itemIconsSprite)._animState._nullLayerFrames = (void *)0x0; } std::string::_Tidy_deallocate((this->_itemIconsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_itemIconsSprite); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(this->_config,0x160,2,FUN_0098b130); ExceptionList = local_10; return; } //@@ 0098b570 Minimap::GetDisplayedSize /* ZHL [exact] __thiscall Vector* Minimap::GetDisplayedSize(Vector &buffer); prototype: REPENTOGON, confirmed by RET 4 */ Vector * __thiscall Minimap::GetDisplayedSize(Minimap *this,Vector *buffer) { float fVar1; fVar1 = RoomTransition::get_hud_alpha(&g_game->_roomTransition); if (0.0 < fVar1 * *(float *)&this->field_0x2d0) { buffer->x = this->_config[1]._size2.y - this->_config[1]._size1.y; buffer->y = this->_config[1]._alpha - this->_config[1]._size2.x; return buffer; } buffer->x = 47.0; buffer->y = 47.0; return buffer; } //@@ 0098b5e0 Minimap::refresh_room_icons /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Icon* room strings; Minimap::Refresh prototype: db/protos.zhl */ void __thiscall Minimap::refresh_room_icons(Minimap *this) { void **ppvVar1; RoomDescriptor *pRVar2; RoomDescriptor *pRVar3; Minimap *pMVar4; byte bVar5; undefined4 *renderTargetEntry; uint uVar6; undefined1 *puVar7; RoomDescriptor *pRVar8; uint uVar9; float fVar10; byte *pbVar11; byte *pbVar12; uint extraout_ECX; int iVar13; AnimationState *lastState; float fVar14; void *pvVar15; int *savedEntry; Minimap *pMVar16; undefined1 *puVar17; int iVar18; char *roomIconName; bool isOutlineVisible; void *pvVar19; float fVar20; double dVar21; undefined8 uVar22; undefined1 local_c8 [28]; float local_ac; Vector roomIconPos; ANM2 *iconSpriteRef; uint keyIconFrame; uint pillIconFrame; uint chestIconFrame; uint heartIconFrame; uint local_8c; RoomDescriptor *local_88; undefined1 *startRow; float iconSlot; undefined1 *local_7c; RoomDescriptor *local_78; Vector local_74; byte *local_6c; int *local_68; undefined1 *local_64; void *cellStepY; undefined1 *local_5c; Vector local_58; void *roomGrid; byte *local_4c; byte *local_48; uint iconSpriteOwner; float cellX; void *cellStepX; byte *startCol; RoomDescriptor *local_34; Minimap *local_30; byte *local_2c; void *local_28; float local_24; float local_20; float local_1c; void *local_18; void *local_14; float local_10; void *local_c; undefined4 local_8; float cellHeight; float cellWidth; ANM2 *iconSprite; float maxIcons; int roomShape; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; pRVar8 = g_game->_roomList; DAT_00c33910 = 0; roomGrid = g_game->_currentRoomMap; iconSpriteOwner = *(uint *)&this->_config[0].field_0x144; iconSpriteRef = (ANM2 *)(iconSpriteOwner + 0x500); local_c8._16_4_ = (void *)0x0; local_c8._20_4_ = (void *)0x0; local_78 = pRVar8; local_30 = this; std::vector::resize(local_c8 + 0x10); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)this->_config[0]._mapSprite._championColor._offset[2],0); RenderTarget::Clear(&DAT_00c798e0); 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; pvVar15 = (void *)g_game->_currentRoomIdx; if ((int)pvVar15 < 0) { _glfw_context_reset(); pop_render_target(); } else { if (g_game->_challenge == 0x20) { iVar13 = *(int *)((int)g_game->_room + 4); local_c8._0_4_ = (void *)0x0; if (iVar13 != 0) { local_c8._0_4_ = *(float *)(iVar13 + 0x58); } local_c8._4_4_ = 1; local_c8._8_4_ = 5; local_c8._12_4_ = (void *)0x10; uVar6 = RNG::RandomInt((RNG *)local_c8,g_game->_nbRooms); pvVar15 = (void *)pRVar8[uVar6].SafeGridIndex; } fVar10 = this->_config[0]._vec1.x; if ((int)pvVar15 < 1) { pvVar15 = (void *)0x0; } local_5c = (void *)0xa9; if ((int)pvVar15 < 0xa9) { local_5c = pvVar15; } local_88 = pRVar8 + *(int *)((int)roomGrid + (int)local_5c * 4); if (0xd < (int)fVar10) { fVar10 = 1.82169e-44; } this->_config[0]._vec1.x = fVar10; fVar14 = this->_config[0]._vec1.y; if (0xd < (int)fVar14) { fVar14 = 1.82169e-44; } this->_config[0]._vec1.y = fVar14; pbVar11 = (byte *)((((int)local_5c / 0xd) * -0xd - (int)fVar10 / 2) + (int)local_5c); if (0xd - (int)fVar10 < (int)pbVar11) { pbVar11 = (byte *)(0xd - (int)fVar10); } startCol = (byte *)0x0; if (0 < (int)pbVar11) { startCol = pbVar11; } fVar10 = *(float *)&local_30->_config[0].field_0x118; cellStepX = (void *)(fVar10 + (float)local_30->_config[0]._mapSprite._shadowLayerIndex); puVar17 = (undefined1 *)((int)local_5c / 0xd - (int)fVar14 / 2); pvVar15 = (void *)(fVar10 + (float)local_30->_config[0]._mapSprite._bitflags); if (0xd - (int)fVar14 < (int)puVar17) { puVar17 = (undefined1 *)(0xd - (int)fVar14); } fVar10 = local_30->_config[0]._mapSprite._championColor._offset[2]; puVar7 = (undefined1 *)0x0; if (0 < (int)puVar17) { puVar7 = puVar17; } iVar13 = *(int *)((int)fVar10 + 0x10); iVar18 = *(int *)((int)fVar10 + 0x14); local_30->_config[0]._borderScale = (float)((double)iVar13 + __uint_to_double_fixup[-(iVar13 >> 0x1f)]); local_30->_config[0]._i1 = (int)(float)((double)iVar18 + __uint_to_double_fixup[-(iVar18 >> 0x1f)]); local_30->_config[0]._i2 = (int)g_vectorZero.x; local_30->_config[0]._minimapIconNum = (int)g_vectorZero.y; fVar10 = local_30->_config[0]._vec1.y; local_34 = (RoomDescriptor *)0x0; pMVar16 = local_30; startRow = puVar7; local_7c = puVar7; cellStepY = pvVar15; if ((int)puVar7 < (int)(puVar7 + (int)fVar10)) { do { local_4c = (void *)0x0; local_58.y = (float)startCol; pRVar8 = local_34; if ((int)startCol < (int)(startCol + (int)pMVar16->_config[0]._vec1.x)) { local_8c = (int)local_7c * 0xd; pbVar11 = startCol; pvVar15 = cellStepX; local_74.y = (float)local_34; do { pMVar4 = local_30; pbVar12 = (byte *)((int)local_58.y + local_8c); if ((-1 < (int)pbVar12) && (pbVar12 < (byte *)0xa9)) { iVar13 = *(int *)((int)roomGrid + (int)pbVar12 * 4); if (-1 < iVar13) { pvVar19 = local_78[iVar13].Data; pMVar16 = pMVar4; if ((pvVar19 != (void *)0x0) && (local_78[iVar13].DisplayFlags != 0)) { isOutlineVisible = true; if ((g_game->_stage == 0xc) && (*(int *)((int)pvVar19 + 8) == 5)) { iVar18 = *(int *)((int)pvVar19 + 0x48); if (iVar18 == 4) { local_5c = (undefined1 *)local_78[iVar13].AllowedDoors; if (((uint)local_5c & 7) != 0) { pbVar11 = pbVar12 + 0xd; if (((int)pbVar11 < 0) || ((byte *)0xa8 < pbVar11)) { isOutlineVisible = false; } else { isOutlineVisible = *(int *)((int)roomGrid + (int)pbVar11 * 4) == iVar13; } } if (((uint)local_5c & 0x58) != 0) { if (((int)(pbVar12 + -0xd) < 0) || ((byte *)0xa8 < pbVar12 + -0xd)) goto LAB_0098ba08; isOutlineVisible = *(int *)((int)roomGrid + (int)(pbVar12 + -0xd) * 4) == iVar13; } } else if (iVar18 == 6) { uVar6 = local_78[iVar13].AllowedDoors; if ((uVar6 & 0xb) == 0) { if (((uVar6 & 0x24) != 0) || ((uVar6 >> 7 & 1) != 0)) { if (((int)pbVar12 < 1) || ((byte *)0xa8 < pbVar12 + -1)) goto LAB_0098ba08; isOutlineVisible = *(int *)((int)roomGrid + (int)pbVar12 * 4 + -4) == iVar13; } } else { if (((int)(pbVar12 + 1) < 0) || ((byte *)0xa8 < pbVar12 + 1)) goto LAB_0098ba08; isOutlineVisible = *(int *)((int)roomGrid + (int)pbVar12 * 4 + 4) == iVar13; } } else if (iVar18 == 8) { local_5c = (undefined1 *)local_78[iVar13].AllowedDoors; if (((uint)local_5c & 3) == 0) { if (((uint)local_5c & 0x24) == 0) { if (((uint)local_5c & 0x18) == 0) { if ((((uint)local_5c >> 7 & 1) != 0) || (((uint)local_5c >> 6 & 1) != 0) ) { if (((int)pbVar12 < 1) || (((((byte *)0xa8 < pbVar12 + -1 || (*(int *)((int)roomGrid + (int)pbVar12 * 4 + -4) != iVar13)) || ((int)(pbVar12 + -0xd) < 0)) || (((byte *)0xa8 < pbVar12 + -0xd || (*(int *)((int)roomGrid + (int)(pbVar12 + -0xd) * 4) != iVar13))) ))) goto LAB_0098ba08; isOutlineVisible = true; } } else { if ((((int)(pbVar12 + 1) < 0) || ((byte *)0xa8 < pbVar12 + 1)) || ((*(int *)((int)roomGrid + (int)pbVar12 * 4 + 4) != iVar13 || ((((int)(pbVar12 + -0xd) < 0 || ((byte *)0xa8 < pbVar12 + -0xd)) || (*(int *)((int)roomGrid + (int)(pbVar12 + -0xd) * 4) != iVar13))))) ) goto LAB_0098ba08; isOutlineVisible = true; } goto LAB_0098ba0a; } if ((0 < (int)pbVar12) && (pbVar12 + -1 < (byte *)0xa9)) { iVar18 = *(int *)((int)roomGrid + (int)pbVar12 * 4 + -4); goto LAB_0098b9f4; } } else if ((-1 < (int)(pbVar12 + 1)) && (pbVar12 + 1 < (byte *)0xa9)) { iVar18 = *(int *)((int)roomGrid + (int)pbVar12 * 4 + 4); LAB_0098b9f4: if ((((iVar18 == iVar13) && (pbVar12 = pbVar12 + 0xd, -1 < (int)pbVar12)) && (pbVar12 < (byte *)0xa9)) && (*(int *)((int)roomGrid + (int)pbVar12 * 4) == iVar13)) goto LAB_0098ba0a; } LAB_0098ba08: isOutlineVisible = false; } } LAB_0098ba0a: pvVar15 = (void *)local_30->_config[0]._borderScale; pbVar11 = local_4c; if ((float)pvVar15 <= (float)local_4c) { pbVar11 = pvVar15; } local_30->_config[0]._borderScale = (float)pbVar11; pRVar2 = (RoomDescriptor *)local_30->_config[0]._i1; pRVar3 = pRVar8; if ((float)pRVar2 <= (float)pRVar8) { pRVar3 = pRVar2; } fVar20 = *(float *)&local_30->_config[0].field_0x114 + *(float *)&local_30->_config[0].field_0x118; fVar10 = (float)local_30->_config[0]._mapSprite._shadowLayerIndex; local_30->_config[0]._i1 = (int)pRVar3; fVar14 = (float)local_30->_config[0]._i2; fVar20 = fVar20 + fVar20; fVar10 = (float)local_4c + fVar10 + fVar20; if (fVar10 <= fVar14) { fVar10 = fVar14; } local_30->_config[0]._i2 = (int)fVar10; fVar10 = (float)local_30->_config[0]._minimapIconNum; fVar20 = (float)pRVar8 + (float)local_30->_config[0]._mapSprite._bitflags + fVar20 ; if (fVar20 <= fVar10) { fVar20 = fVar10; } local_30->_config[0]._minimapIconNum = (int)fVar20; local_74.x = (float)local_4c; bVar5 = ANM2::SetAnimation((ANM2 *)local_30,(byte *)"RoomOutline",1); if (((bVar5 != 0) && (*(int *)(pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4) != 0)) && (AnimationState::SetFrameFloat ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName, 0.0), *(int *)(pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4) != 0)) { *(undefined1 *)&pMVar4->_config[0]._mapSprite._animDefaultName._capacity = 0; } if ((!isOutlineVisible) || (*(char *)((int)pMVar4->_config[0]._mapSprite._championColor._colorize + 0xd) == '\0')) { pRVar8 = local_34; pvVar15 = cellStepX; } else { ppvVar1 = &pMVar4->_config[0]._mapSprite._animState._layerFrames; if (*(char *)&pMVar4->_config[0]._mapSprite._overlayAnimState._layerFrames == '\0') { AnimationState::Render ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName, &local_74,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)ppvVar1,&local_74,&g_vectorZero,&g_vectorZero); local_34 = (RoomDescriptor *)local_74.y; pRVar8 = (RoomDescriptor *)local_74.y; pvVar15 = cellStepX; local_4c = (byte *)local_74.x; } else { AnimationState::Render ((AnimationState *)ppvVar1,&local_74,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName, &local_74,&g_vectorZero,&g_vectorZero); local_34 = (RoomDescriptor *)local_74.y; pRVar8 = (RoomDescriptor *)local_74.y; pvVar15 = cellStepX; local_4c = (byte *)local_74.x; } } } } pbVar11 = startCol; } local_4c = (byte *)((float)local_4c + (float)pvVar15); local_58.y = (float)((int)local_58.y + 1); } while ((int)local_58.y < (int)(pbVar11 + (int)pMVar16->_config[0]._vec1.x)); puVar7 = startRow; pvVar15 = cellStepY; } fVar10 = pMVar16->_config[0]._vec1.y; local_34 = (RoomDescriptor *)((float)pRVar8 + (float)pvVar15); local_7c = local_7c + 1; } while ((int)local_7c < (int)(puVar7 + (int)fVar10)); } local_4c = (byte *)0x0; local_74.x = 0.0; cellX = 0.0; local_2c = (byte *)0x0; if (0 < (int)puVar7) { local_2c = (byte *)(0.0 - (float)pvVar15); } if (0 < (int)startCol) { cellX = 0.0 - (float)cellStepX; } if ((int)puVar7 < 1) { local_64 = puVar7; } else { local_64 = puVar7 + -1; } local_74.y = (float)local_34; if ((int)local_64 < (int)(puVar7 + (int)fVar10)) { local_5c = (undefined1 *)((int)local_64 * 0xd); pMVar16 = local_30; do { local_4c = startCol; if (0 < (int)startCol) { local_4c = startCol + -1; } pbVar11 = local_2c; pvVar19 = cellStepX; if ((int)local_4c < (int)(startCol + (int)pMVar16->_config[0]._vec1.x)) { local_6c = (byte *)((int)local_5c + (int)local_4c); local_68 = (int *)((int)roomGrid + (int)local_6c * 4); pbVar12 = startCol; do { pRVar8 = local_78; if ((-1 < (int)local_6c) && (local_6c < (byte *)0xa9)) { iVar13 = *local_68; if (-1 < iVar13) { if ((byte *)local_78[iVar13].GridIndex == local_6c) { LAB_0098bdb8: pvVar15 = local_78[iVar13].Data; iVar18 = *(int *)((int)pvVar15 + 0x48) + -1; if (iVar18 < 0) { KAGE_LogMessage(0x10,(byte *)"invalid room shape id: %d\n"); pvVar15 = pRVar8[iVar13].Data; } local_48 = (byte *)g_vectorOne.x; local_34 = (RoomDescriptor *)g_vectorOne.y; switch(*(undefined4 *)((int)pvVar15 + 0x48)) { case 1: case 2: case 3: break; case 4: case 5: local_48 = (byte *)0x3f800000; local_34 = (RoomDescriptor *)0x40000000; break; case 6: case 7: local_48 = (byte *)0x40000000; local_34 = (RoomDescriptor *)0x3f800000; break; case 8: case 10: case 0xb: case 0xc: local_34 = (RoomDescriptor *)0x40000000; local_48 = (byte *)0x40000000; break; case 9: local_48 = (byte *)0x0; local_34 = (RoomDescriptor *)0x40000000; break; default: KAGE_LogMessage(0x10,(byte *)"invalid room shape id: %d\n"); pvVar15 = pRVar8[iVar13].Data; } pMVar4 = local_30; roomShape = *(int *)((int)pvVar15 + 0x48); local_58.x = cellX; local_58.y = (float)local_2c; if (roomShape == 9) { local_58.x = cellX - (float)cellStepX; } if ((g_game->_stage == 0xc) && (*(int *)((int)pvVar15 + 8) == 5)) { if (roomShape == 4) { if ((pRVar8[iVar13].AllowedDoors & 0x58) != 0) { LAB_0098bef9: local_58.y = (float)local_2c + (float)cellStepY; } } else { if (roomShape == 6) { if ((pRVar8[iVar13].AllowedDoors & 0xa4) == 0) goto LAB_0098bf06; } else { if (roomShape != 8) goto LAB_0098bf22; uVar6 = pRVar8[iVar13].AllowedDoors; if ((uVar6 & 0x24) == 0) { if ((uVar6 & 0x18) == 0) { if ((uVar6 & 0xc0) == 0) goto LAB_0098bf06; local_58.x = local_58.x + (float)cellStepX; } goto LAB_0098bef9; } } local_58.x = local_58.x + (float)cellStepX; } LAB_0098bf06: iVar18 = 0; local_48 = (byte *)g_vectorOne.x; local_34 = (RoomDescriptor *)g_vectorOne.y; } LAB_0098bf22: uVar6 = (uint)pRVar8[iVar13].Flags >> 10; if ((uVar6 & 1) != 0) { local_30->_config[0]._mapSprite._numEvents = 0x3f800000; local_30->_config[0]._mapSprite._offset.x = 0.29411766; local_30->_config[0]._mapSprite._offset.y = 0.29411766; local_30->_config[0]._mapSprite._scale.x = 1.0; } if (local_88->ListIndex == local_78[iVar13].ListIndex) { bVar5 = ANM2::SetAnimation((ANM2 *)local_30,(byte *)"RoomCurrent",1); if (((bVar5 != 0) && (*(int *)(pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4) != 0)) && (AnimationState::SetFrameFloat ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName ,(float)iVar18), *(int *)(pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4) != 0)) { *(undefined1 *)&pMVar4->_config[0]._mapSprite._animDefaultName._capacity = 0; } if (*(char *)((int)pMVar4->_config[0]._mapSprite._championColor._colorize + 0xd) != '\0') { lastState = (AnimationState *) &pMVar4->_config[0]._mapSprite._animState._layerFrames; if (*(char *)&pMVar4->_config[0]._mapSprite._overlayAnimState._layerFrames == '\0') { AnimationState::Render ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName ,&local_58,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render(lastState,&local_58,&g_vectorZero,&g_vectorZero); lastState = (AnimationState *) &pMVar4->_config[0]._mapSprite._animDefaultName; } AnimationState::Render(lastState,&local_58,&g_vectorZero,&g_vectorZero); } fVar14 = *(float *)&pMVar4->_config[0].field_0x114 + *(float *)&pMVar4->_config[0].field_0x118; fVar20 = fVar14 * g_vectorOne.y; fVar10 = (float)pMVar4->_config[0]._mapSprite._bitflags; pMVar4->_config[0]._borderPadding.y = (float)local_48 * (float)pMVar4->_config[0]._mapSprite._shadowLayerIndex * 0.5 + cellX + fVar14 * g_vectorOne.x; pMVar4->_config[0]._posOffsetX = (float)local_34 * fVar10 * 0.5 + (float)local_2c + fVar20; } else { if (((local_78[iVar13].Flags & 1) == 0) || ((local_78[iVar13].DisplayFlags & 1) == 0)) { if ((((local_78[iVar13].Data == (void *)0x0) || (((local_78[iVar13].DisplayFlags & 1) == 0 || (iVar13 = *(int *)((int)local_78[iVar13].Data + 8), iVar13 == 7)))) || (iVar13 == 8)) || (iVar13 == 0x1d)) goto LAB_0098c150; uVar22 = 0x100b7d3e0; } else { uVar22 = 0x100b7d350; } bVar5 = ANM2::SetAnimation((ANM2 *)local_30,(byte *)uVar22, (byte)((ulonglong)uVar22 >> 0x20)); if (((bVar5 != 0) && (*(int *)(pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4) != 0)) && (AnimationState::SetFrameFloat ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName ,(float)iVar18), *(int *)(pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4) != 0)) { *(undefined1 *)&pMVar4->_config[0]._mapSprite._animDefaultName._capacity = 0; } if (*(char *)((int)pMVar4->_config[0]._mapSprite._championColor._colorize + 0xd) != '\0') { ppvVar1 = &pMVar4->_config[0]._mapSprite._animState._layerFrames; if (*(char *)&pMVar4->_config[0]._mapSprite._overlayAnimState._layerFrames == '\0') { AnimationState::Render ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName ,&local_58,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)ppvVar1,&local_58,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render ((AnimationState *)ppvVar1,&local_58,&g_vectorZero,&g_vectorZero); AnimationState::Render ((AnimationState *)&pMVar4->_config[0]._mapSprite._animDefaultName ,&local_58,&g_vectorZero,&g_vectorZero); } } } LAB_0098c150: pMVar16 = local_30; pbVar11 = local_2c; pvVar19 = cellStepX; if ((uVar6 & 1) != 0) { pMVar4->_config[0]._mapSprite._numEvents = 0x3f800000; pMVar4->_config[0]._mapSprite._offset.x = 1.0; pMVar4->_config[0]._mapSprite._offset.y = 1.0; pMVar4->_config[0]._mapSprite._scale.x = 1.0; } } else if ((byte *)local_78[iVar13].GridIndex + 1 == local_6c) { if (*(int *)((int)local_78[iVar13].Data + 0x48) == 9) goto LAB_0098bdb8; } pbVar12 = startCol; } } cellX = cellX + (float)pvVar19; local_4c = local_4c + 1; local_6c = local_6c + 1; local_68 = local_68 + 1; } while ((int)local_4c < (int)(pbVar12 + (int)pMVar16->_config[0]._vec1.x)); pvVar15 = cellStepY; } cellX = 0.0; if (0 < (int)startCol) { cellX = 0.0 - (float)pvVar19; } local_2c = (byte *)((float)pbVar11 + (float)pvVar15); fVar10 = pMVar16->_config[0]._vec1.y; local_64 = local_64 + 1; local_5c = (undefined1 *)((int)local_5c + 0xd); } while ((int)local_64 < (int)(startRow + (int)fVar10)); pMVar16 = local_30; puVar7 = startRow; } cellX = 0.0; local_6c = (byte *)0x0; if (0 < (int)puVar7) { local_6c = (byte *)(0.0 - (float)pvVar15); } if (0 < (int)startCol) { cellX = 0.0 - (float)cellStepX; } if ((int)puVar7 < 1) { local_5c = puVar7; } else { local_5c = puVar7 + -1; } if ((int)local_5c < (int)(puVar7 + (int)fVar10)) { do { if ((int)startCol < 1) { local_48 = startCol; } else { local_48 = startCol + -1; } pvVar19 = cellStepX; if ((int)local_48 < (int)(startCol + (int)pMVar16->_config[0]._vec1.x)) { local_4c = (byte *)((int)local_5c * 0xd); do { pbVar11 = local_4c + (int)local_48; if (-1 < (int)pbVar11) { if (pbVar11 < (byte *)0xa9) { iVar13 = *(int *)((int)roomGrid + (int)pbVar11 * 4); if (-1 < iVar13) { roomIconName = (char *)0x0; local_2c = (byte *)0x0; local_34 = local_78 + iVar13; pvVar15 = local_34->Data; if ((pvVar15 == (void *)0x0) || ((local_34->DisplayFlags & 4) == 0)) { switchD_0098c2e6_caseD_3: if (local_34->Data != (void *)0x0) { iVar13 = *(int *)((int)local_34->Data + 8); if (((iVar13 != 1) && (local_34->VisitedCount == 0)) && ((local_34->DisplayFlags & 2) != 0)) { switch(iVar13) { case 2: case 9: case 0xc: case 0x12: case 0x13: case 0x14: case 0x15: case 0x18: roomIconName = "IconLockedRoom"; goto LAB_0098c47d; } } } } else { switch(*(undefined4 *)((int)pvVar15 + 8)) { case 1: if ((local_34->VisitedCount == 0) || (g_game->_currentDimensionIdx == 2)) goto switchD_0098c2e6_caseD_3; if (*(int *)((int)pvVar15 + 0x10) == 0x22) { bVar5 = Level::HasMirrorDimension((Level *)g_game); if (bVar5 == 0) goto switchD_0098c2e6_caseD_3; roomIconName = "IconMirrorRoom"; } else { if ((*(int *)((int)pvVar15 + 0x10) != 10) || (bVar5 = Level::HasAbandonedMineshaft((Level *)g_game), bVar5 == 0)) goto switchD_0098c2e6_caseD_3; roomIconName = "IconMinecartRoom"; } break; case 2: roomIconName = "IconShop"; break; default: goto switchD_0098c2e6_caseD_3; case 4: if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) && (g_game->_greedModeTreasureRoomIdx != local_34->GridIndex)) { roomIconName = "IconTreasureRoomGreed"; } else { roomIconName = "IconTreasureRoomRed"; if (((uint)local_34->Flags >> 0xb & 1) == 0) { roomIconName = "IconTreasureRoom"; } } break; case 5: roomIconName = "IconBoss"; break; case 6: roomIconName = "IconMiniboss"; break; case 7: roomIconName = "IconSecretRoom"; break; case 8: roomIconName = "IconSuperSecretRoom"; break; case 9: roomIconName = "IconArcade"; break; case 10: roomIconName = "IconCurseRoom"; break; case 0xb: roomIconName = "IconBossAmbushRoom"; if (*(int *)((int)pvVar15 + 0x10) != 1) { roomIconName = "IconAmbushRoom"; } break; case 0xc: roomIconName = "IconLibrary"; break; case 0xd: roomIconName = "IconSacrificeRoom"; break; case 0xe: roomIconName = "IconDevilRoom"; break; case 0xf: roomIconName = "IconAngelRoom"; break; case 0x12: roomIconName = "IconIsaacsRoom"; break; case 0x13: roomIconName = "IconBarrenRoom"; break; case 0x14: roomIconName = "IconChestRoom"; break; case 0x15: roomIconName = "IconDiceRoom"; break; case 0x18: roomIconName = "IconPlanetarium"; break; case 0x19: case 0x1a: roomIconName = "IconTeleporterRoom"; break; case 0x1d: roomIconName = "IconUltraSecretRoom"; } LAB_0098c47d: local_2c = (byte *)roomIconName; } uVar6 = 0; heartIconFrame = 0; chestIconFrame = 0; fVar10 = (float)(uint)((byte *)roomIconName != (byte *)0x0); keyIconFrame = 0; local_74.y = 0.0; local_58.y = 0.0; local_7c = (undefined1 *)0x0; pillIconFrame = 0; local_88 = (RoomDescriptor *)0x0; local_8c = 0; iconSlot = fVar10; if (local_34->DisplayFlags != 0) { pRVar8 = Level::GetRoomByIdx((Level *)g_game,(int)(local_48 + (int)local_4c),-1) ; savedEntry = (pRVar8->SavedEntities)._begin; pRVar8 = Level::GetRoomByIdx((Level *)g_game,(int)(local_48 + (int)local_4c),-1) ; if (savedEntry != (pRVar8->SavedEntities)._end) { do { iVar13 = *savedEntry; if (iVar13 == 5) { if (savedEntry[5] == 0) { if ((float)savedEntry[10] == g_vectorZero.x) { if ((float)savedEntry[0xb] == g_vectorZero.y) goto switchD_0098c8f3_caseD_34; } iVar13 = savedEntry[1]; if (iVar13 == 10) { if ((uVar6 & 1) == 0) { uVar6 = uVar6 | 1; fVar10 = (float)((int)fVar10 + 1); } switch(savedEntry[2]) { case 2: break; case 3: uVar9 = 5; if (4 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 4: uVar9 = 9; if (8 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; default: uVar9 = 1; if (heartIconFrame != 0) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 6: uVar9 = 6; if (5 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 7: uVar9 = 8; if (7 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 8: uVar9 = 3; if (2 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 10: uVar9 = 4; if (3 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 0xb: uVar9 = 7; if (6 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; break; case 0xc: uVar9 = 2; if (1 < heartIconFrame) { uVar9 = heartIconFrame; } heartIconFrame = uVar9; } } else if (iVar13 == 0x14) { if ((uVar6 & 2) == 0) { uVar6 = uVar6 | 2; fVar10 = (float)((int)fVar10 + 1); } switch(savedEntry[2]) { case 2: case 6: pRVar8 = (RoomDescriptor *)0x1; if (local_88 != (RoomDescriptor *)0x0) { pRVar8 = local_88; } local_88 = pRVar8; break; case 3: pRVar8 = (RoomDescriptor *)0x2; if ((RoomDescriptor *)0x1 < local_88) { pRVar8 = local_88; } local_88 = pRVar8; break; default: break; case 7: pRVar8 = (RoomDescriptor *)0x3; if ((RoomDescriptor *)0x2 < local_88) { pRVar8 = local_88; } local_88 = pRVar8; } } else if (iVar13 == 0x2a) { if ((uVar6 & 4) == 0) { uVar6 = uVar6 | 4; goto LAB_0098ca30; } } else if (iVar13 == 0x28) { if ((uVar6 & 0x10) == 0) { uVar6 = uVar6 | 0x10; fVar10 = (float)((int)fVar10 + 1); } if ((uint)local_74.y < (RoomDescriptor *)(uint)(savedEntry[2] == 4)) { local_74.y = (float)(uint)(savedEntry[2] == 4); } } else if (iVar13 == 0x1e) { if ((uVar6 & 8) == 0) { uVar6 = uVar6 | 8; fVar10 = (float)((int)fVar10 + 1); } if (savedEntry[2] == 2) { uVar9 = 1; if (keyIconFrame != 0) { uVar9 = keyIconFrame; } keyIconFrame = uVar9; } else if (savedEntry[2] == 4) { uVar9 = 2; if (1 < keyIconFrame) { uVar9 = keyIconFrame; } keyIconFrame = uVar9; } else { } } else if (iVar13 == 300) { iVar13 = savedEntry[2]; if (((iVar13 < 0) || (pvVar15 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar15 >> 2 <= iVar13)) || ((iVar13 = *(int *)((int)pvVar15 + iVar13 * 4), iVar13 == 0 || (*(int *)(iVar13 + 0x58) != 2)))) { if ((uVar6 & 0x20) == 0) { uVar6 = uVar6 | 0x20; goto LAB_0098ca30; } } else if ((uVar6 & 0x1000) == 0) { uVar6 = uVar6 | 0x1000; goto LAB_0098ca30; } } else if (iVar13 == 100) { if ((uVar6 & 0x40) == 0) { uVar6 = uVar6 | 0x40; goto LAB_0098ca30; } LAB_0098c8c3: bVar5 = Entity_Pickup::IsChest(iVar13); if (bVar5 == 0) { if (extraout_ECX != 0x45) goto switchD_0098c8f3_caseD_34; } if ((uVar6 & 0x200) == 0) { uVar6 = uVar6 | 0x200; fVar10 = (float)((int)fVar10 + 1); } if (extraout_ECX < 0x46) { if (extraout_ECX == 0x45) { uVar9 = (savedEntry[2] == 2) + 2; } else { switch(extraout_ECX) { case 0x33: uVar9 = 1; break; case 0x34: goto switchD_0098c8f3_caseD_34; case 0x35: uVar9 = 7; break; default: goto switchD_0098c8f3_caseD_36; case 0x38: uVar9 = 6; break; case 0x39: uVar9 = 9; break; case 0x3c: uVar9 = 8; } } } else if (extraout_ECX == 0x168) { uVar9 = 5; } else { switchD_0098c8f3_caseD_36: uVar9 = 4; } if (chestIconFrame < uVar9) { chestIconFrame = uVar9; } } else if (iVar13 == 0x15e) { if ((uVar6 & 0x400) != 0) goto LAB_0098c8c3; uVar6 = uVar6 | 0x400; LAB_0098ca30: fVar10 = (float)((int)fVar10 + 1); } else if (iVar13 == 0x5a) { if ((uVar6 & 0x100) == 0) { uVar6 = uVar6 | 0x100; fVar10 = (float)((int)fVar10 + 1); } if (local_8c < (savedEntry[2] == 4)) { local_8c = (uint)(savedEntry[2] == 4); } } else { if (iVar13 != 0x46) goto LAB_0098c8c3; if (-1 < (char)uVar6) { uVar6 = uVar6 | 0x80; fVar10 = (float)((int)fVar10 + 1); } uVar9 = (uint)((savedEntry[2] & 0x7ffU) == 0xe); if (pillIconFrame < uVar9) { pillIconFrame = uVar9; } } } goto switchD_0098c8f3_caseD_34; } if (iVar13 != 6) { if (iVar13 == 1000) { if (savedEntry[1] == 0xa1) { if (savedEntry[2] == 0x3d4) { if ((uVar6 & 0x8000) == 0) { uVar6 = uVar6 | 0x8000; goto LAB_0098ca30; } } } } goto switchD_0098c8f3_caseD_34; } if (savedEntry[1] == 0xe) goto switchD_0098c8f3_caseD_34; switch(savedEntry[1]) { default: pbVar11 = (byte *)0x2; break; case 2: pbVar11 = (byte *)0x3; break; case 3: pbVar11 = &DAT_00000004; break; case 4: case 6: puVar17 = (undefined1 *)0x0; goto LAB_0098c9d2; case 5: case 0xf: puVar17 = (undefined1 *)0x2; goto LAB_0098c9d2; case 7: puVar17 = (undefined1 *)0x3; goto LAB_0098c9d2; case 8: case 0xb: pbVar11 = (byte *)0x1; break; case 9: puVar17 = &DAT_00000004; goto LAB_0098c9d2; case 10: pbVar11 = &DAT_00000006; break; case 0xc: pbVar11 = (byte *)0x0; break; case 0xd: puVar17 = &DAT_00000005; goto LAB_0098c9d2; case 0x10: pbVar11 = &DAT_00000005; break; case 0x11: pbVar11 = &DAT_00000007; break; case 0x12: puVar17 = (undefined1 *)0x1; LAB_0098c9d2: if ((uVar6 & 0x2000) == 0) { uVar6 = uVar6 | 0x2000; fVar10 = (float)((int)fVar10 + 1); } if (local_7c < puVar17) { local_7c = puVar17; } goto switchD_0098c8f3_caseD_34; case 0x13: pbVar11 = &DAT_00000008; } if ((uVar6 & 0x800) == 0) { uVar6 = uVar6 | 0x800; fVar10 = (float)((int)fVar10 + 1); } if ((uint)local_58.y < pbVar11) { local_58.y = (float)pbVar11; } switchD_0098c8f3_caseD_34: savedEntry = savedEntry + 0x1e; pRVar8 = Level::GetRoomByIdx((Level *)g_game,(int)(local_48 + (int)local_4c) ,-1); } while (savedEntry != (pRVar8->SavedEntities)._end); } savedEntry = (local_34->SavedGridEntities)._begin; for (iVar13 = (int)(local_34->SavedGridEntities)._end - (int)savedEntry >> 5; iVar13 != 0; iVar13 = iVar13 + -1) { if ((*savedEntry == 0x12) && ((uVar6 & 0x4000) == 0)) { uVar6 = uVar6 | 0x4000; fVar10 = (float)((int)fVar10 + 1); } savedEntry = savedEntry + 8; } } if (((byte *)local_34->GridIndex == local_48 + (int)local_4c) || (((byte *)local_34->GridIndex + 1 == local_48 + (int)local_4c && (*(int *)((int)local_34->Data + 0x48) == 9)))) { fVar14 = *(float *)&local_30->_config[0].field_0x114 + *(float *)&local_30->_config[0].field_0x118; local_64 = (undefined1 *)cellX; fVar20 = fVar14 * g_vectorOne.x; fVar14 = fVar14 * g_vectorOne.y; local_68 = (int *)local_6c; if ((g_game->_stage == 0xc) && (*(int *)((int)local_34->Data + 8) == 5)) { iVar13 = *(int *)((int)local_34->Data + 0x48); if (iVar13 == 4) { if ((local_34->AllowedDoors & 0x58) != 0) { LAB_0098cb43: local_68 = (int *)((float)local_6c + (float)cellStepY); } } else if (iVar13 == 6) { if ((local_34->AllowedDoors & 0xa4) != 0) { LAB_0098cb31: local_64 = (undefined1 *)(cellX + (float)cellStepX); } } else { if (iVar13 != 8) goto LAB_0098cb4f; uVar9 = local_34->AllowedDoors; if ((uVar9 & 0x24) != 0) goto LAB_0098cb31; if ((uVar9 & 0x18) != 0) goto LAB_0098cb43; if ((uVar9 & 0xc0) != 0) { local_64 = (undefined1 *)(cellX + (float)cellStepX); local_68 = (int *)((float)local_6c + (float)cellStepY); } } } else { LAB_0098cb4f: iVar13 = *(int *)((int)local_34->Data + 0x48); if (iVar13 == 4) { LAB_0098cb7c: fVar14 = fVar14 + (float)local_30->_config[0]._mapSprite._bitflags * 0.5; } else if (iVar13 == 6) { fVar20 = fVar20 + (float)local_30->_config[0]._mapSprite._shadowLayerIndex * 0.5; } else if (iVar13 == 8) { fVar20 = fVar20 + (float)local_30->_config[0]._mapSprite._shadowLayerIndex * 0.5; goto LAB_0098cb7c; } } cellWidth = (float)local_30->_config[0]._mapSprite._shadowLayerIndex; cellHeight = (float)local_30->_config[0]._mapSprite._bitflags; maxIcons = local_30->_config[0]._borderPadding.x; if ((uint)maxIcons < (uint)fVar10) { fVar10 = maxIcons; } local_c8._0_4_ = cellWidth * 0.25 + fVar20; local_20 = cellWidth * 0.75 + fVar20; local_c8._12_4_ = cellHeight * 0.5 + fVar14; local_c8._20_4_ = local_c8._12_4_; local_c8._16_4_ = (void *)(cellWidth * 0.5 + fVar20); local_c8._8_4_ = local_20; local_c8._4_4_ = local_c8._12_4_; local_24 = cellHeight * 0.25 + fVar14; local_14 = (void *)(cellHeight * 0.75 + fVar14); local_28 = (void *)local_c8._0_4_; local_1c = local_24; local_18 = (void *)local_c8._0_4_; local_10 = local_20; local_c = local_14; if ((uint)fVar10 < 5) { if ((uint)fVar10 < 2) { local_34 = (RoomDescriptor *)(local_c8 + 0x10); } else { if (2 < (uint)fVar10) goto LAB_0098cc6f; local_34 = (RoomDescriptor *)local_c8; } } else { KAGE_LogMessage(0x10,(byte *) "currently there are no more than 4 minimap icons supported\n" ); LAB_0098cc6f: local_34 = (RoomDescriptor *)&local_28; } iconSprite = iconSpriteRef; pbVar11 = (byte *)0x0; if (local_2c != (byte *)0x0) { bVar5 = ANM2::SetAnimation(iconSpriteRef,local_2c,1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), (iconSprite->_animState)._animData != (void *)0x0)) { (iconSprite->_animState)._isPlaying = 0; } local_2c = (byte *)(((float)local_64 + (float)local_34->GridIndex) - 6.0); dVar21 = floor((double)(float)local_2c); roomIconPos.x = (float)dVar21; local_2c = (byte *)(((float)local_68 + (float)local_34->SafeGridIndex) - 6.0); dVar21 = floor((double)(float)local_2c); roomIconPos.y = (float)dVar21; pbVar11 = local_2c; if (iconSprite->_loaded != 0) { if (iconSprite->_overlayRenderFirst == 0) { AnimationState::Render (&iconSprite->_animState,&roomIconPos,&g_vectorZero, &g_vectorZero); lastState = &iconSprite->_overlayAnimState; } else { AnimationState::Render (&iconSprite->_overlayAnimState,&roomIconPos,&g_vectorZero, &g_vectorZero); lastState = &iconSprite->_animState; } AnimationState::Render(lastState,&roomIconPos,&g_vectorZero,&g_vectorZero); pbVar11 = local_2c; } } while ((local_2c = pbVar11, (uint)iconSlot < (uint)fVar10 && (uVar6 != 0))) { if ((uVar6 & 1) == 0) { if ((uVar6 & 0x40) == 0) { if ((uVar6 & 0x400) == 0) { if ((uVar6 & 0x200) == 0) { if ((uVar6 & 0x1000) == 0) { if ((uVar6 & 0x20) == 0) { if ((char)uVar6 < '\0') { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconPill",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,(float)(int)pillIconFrame ), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffff7f; } else if ((uVar6 & 8) == 0) { if ((uVar6 & 0x10) == 0) { if ((uVar6 & 4) == 0) { if ((uVar6 & 2) == 0) { if ((uVar6 & 0x100) == 0) { if ((uVar6 & 0x2000) == 0) { if ((uVar6 & 0x800) == 0) { if ((uVar6 & 0x4000) == 0) { if ((uVar6 & 0x8000) != 0) { bVar5 = ANM2::SetAnimation(iconSprite, (byte *)"IconPortal", 1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffff7fff; } } else { bVar5 = ANM2::SetAnimation(iconSprite, (byte *)"IconLadder",1) ; if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffbfff; } } else { bVar5 = ANM2::SetAnimation(iconSprite, (byte *)"IconSlot",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState, (float)(int)local_58.y), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffff7ff; } } else { bVar5 = ANM2::SetAnimation(iconSprite, (byte *)"IconBeggar",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0 )) && (AnimationState::SetFrameFloat (&iconSprite->_animState, (float)(int)local_7c), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffdfff; } } else { bVar5 = ANM2::SetAnimation(iconSprite, (byte *)"IconBattery",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState, (float)(int)local_8c), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffeff; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconCoin",1 ); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState, (float)(int)local_88), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffffd; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconPoop",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffffb; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconBomb",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,(float)(int)local_74.y) , *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffffef; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconKey",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,(float)(int)keyIconFrame) , *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffff7; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconCard",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffffdf; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconRune",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffefff; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconChest",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,(float)(int)chestIconFrame), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffdff; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconTrinket",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0) ) && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffbff; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconItem",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xffffffbf; } } else { bVar5 = ANM2::SetAnimation(iconSprite,(byte *)"IconHeart",1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,(float)(int)heartIconFrame), *(int *)(iconSpriteOwner + 0x534) != 0)) { (iconSprite->_animState)._isPlaying = 0; } uVar6 = uVar6 & 0xfffffffe; } local_2c = (byte *)(((float)local_64 + (float)local_34->_doors[(int)iconSlot * 2 + -7]) - 6.0); dVar21 = floor((double)(float)local_2c); local_c8._24_4_ = (BADTYPE)dVar21; local_2c = (byte *)(((float)local_68 + (float)local_34->_doors[(int)iconSlot * 2 + -6]) - 6.0); dVar21 = floor((double)(float)local_2c); local_ac = (float)dVar21; if (iconSprite->_loaded != 0) { if (iconSprite->_overlayRenderFirst == 0) { AnimationState::Render (&iconSprite->_animState,(Vector *)(local_c8 + 0x18), &g_vectorZero,&g_vectorZero); lastState = &iconSprite->_overlayAnimState; } else { AnimationState::Render (&iconSprite->_overlayAnimState,(Vector *)(local_c8 + 0x18), &g_vectorZero,&g_vectorZero); lastState = &iconSprite->_animState; } AnimationState::Render (lastState,(Vector *)(local_c8 + 0x18),&g_vectorZero,&g_vectorZero ); } iconSlot = (float)((int)iconSlot + 1); pbVar11 = local_2c; } } pMVar16 = local_30; pvVar19 = cellStepX; } } } local_48 = local_48 + 1; cellX = cellX + (float)pvVar19; } while ((int)local_48 < (int)(startCol + (int)pMVar16->_config[0]._vec1.x)); puVar7 = startRow; pvVar15 = cellStepY; } cellX = 0.0; if (0 < (int)startCol) { cellX = 0.0 - (float)pvVar19; } local_6c = (byte *)((float)local_6c + (float)pvVar15); local_5c = local_5c + 1; } while ((int)local_5c < (int)(puVar7 + (int)pMVar16->_config[0]._vec1.y)); } _glfw_context_reset(); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } } DAT_00c33910 = 1; return; } //@@ 0098d560 Minimap::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from Game::LoadConfigXmls; loads gfx/ui/minimap1/2.anm2, minimap_icons, mapitemicons, hudpickups, minimap_questionmark.png, creates "Minimap Surface" render image prototype: db/protos.zhl */ void __thiscall Minimap::Init(Minimap *this) { int iVar1; Minimap *pMVar2; MinimapConfig *pMVar3; char cVar4; int iVar5; int iVar6; int iVar7; int iVar8; void *pvVar9; undefined1 auVar10 [4]; char *ptr; uint uVar11; undefined1 tmpHandle [4]; int *tmpRefCount; Minimap *minimap; int layersLeft; MinimapConfig *mapLayer; std_string iconsPath; undefined1 anm2Path [4]; KColor local_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = anm2Path + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00b0d46d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(anm2Path + 0x2c); ExceptionList = &local_1c; local_38._alpha = 0.0; local_38._unk = 0xf; anm2Path[0] = '\0'; anm2Path[1] = '\0'; anm2Path[2] = '\0'; anm2Path[3] = '\0'; minimap = this; anm2Path = (undefined1 [4])std::_Allocate(0x20); local_38._alpha = 2.8026e-44; local_38._unk = 0x1f; builtin_strncpy((char *)anm2Path,"gfx/ui/minimap1.anm2",0x15); local_14 = 0; ANM2::Load(&this->_config[0]._mapSprite,(std_string *)anm2Path,1); local_14 = 0xffffffff; if (0xf < (uint)local_38._unk) { uVar11 = local_38._unk + 1; auVar10 = anm2Path; if (0xfff < uVar11) { auVar10 = *(undefined1 (*) [4])((int)anm2Path + -4); uVar11 = local_38._unk + 0x24; if ((char *)0x1f < (char *)((int)anm2Path + (-4 - (int)auVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar10,uVar11); } this->_config[0]._vec1.x = 16.0; this->_config[0]._vec1.y = 16.0; this->_config[0]._borderPadding.x = 7.0; this->_config[0]._borderPadding.y = 6.0; this->_config[0]._posOffsetX = 2.0; this->_config[0]._borderScale = 1.0; this->_config[0]._i1 = 7; this->_config[0]._i2 = 7; this->_config[0]._minimapIconNum = 1; local_38._alpha = 0.0; local_38._unk = 0xf; anm2Path[0] = '\0'; anm2Path[1] = '\0'; anm2Path[2] = '\0'; anm2Path[3] = '\0'; anm2Path = (undefined1 [4])std::_Allocate(0x20); local_38._alpha = 2.8026e-44; local_38._unk = 0x1f; builtin_strncpy((char *)anm2Path,"gfx/ui/minimap2.anm2",0x15); local_14 = 1; ANM2::Load((ANM2 *)(this->_config[1]._mapSprite._filename._buf + 4),(std_string *)anm2Path,1); local_14 = 0xffffffff; if (0xf < (uint)local_38._unk) { uVar11 = local_38._unk + 1; auVar10 = anm2Path; if (0xfff < uVar11) { auVar10 = *(undefined1 (*) [4])((int)anm2Path + -4); uVar11 = local_38._unk + 0x24; if ((char *)0x1f < (char *)((int)anm2Path + (-4 - (int)auVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar10,uVar11); } mapLayer = this->_config + 1; this->_config[1]._vec1.y = (float)&DAT_42000000; this->_config[1]._borderPadding.x = (float)&DAT_42000000; this->_config[1]._borderPadding.y = 16.0; this->_config[1]._posOffsetX = 14.0; this->_config[1]._borderScale = 4.0; this->_config[1]._i1 = 0x3f800000; this->_config[1]._i2 = 0xd; this->_config[1]._minimapIconNum = 0xd; *(undefined4 *)&this->_config[1].field_0x140 = 4; layersLeft = 2; do { *(Minimap **)(mapLayer->_mapSprite)._filename._buf = this; iVar5 = __ftoui3(); iVar6 = __ftoui3(); iVar7 = __ftoui3(); iVar1 = mapLayer[-1]._i1; iVar8 = __ftoui3(); local_38._unk = 0; local_38._red = 0.0; local_38._green = 0.0; local_38._blue = 0.0; local_38._alpha = 0.0; pvVar9 = KAGE_Graphics::create_render_target (tmpHandle,(iVar7 + iVar5) * iVar1 + iVar6 * 2 + iVar5, (iVar8 + iVar5) * mapLayer[-1]._i2 + iVar6 * 2 + iVar5, (byte *)"Minimap Surface",&local_38); pMVar3 = mapLayer; local_14 = 2; shared_ptr::operator_assign(&mapLayer[-1].field_0x114,pvVar9); local_14 = 3; if (tmpRefCount != (int *)0x0) { cVar4 = (**(code **)(*tmpRefCount + 0xc))(); if ((cVar4 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(tmpHandle); } } pMVar2 = minimap; local_14 = 0xffffffff; *(float *)&pMVar3[-1].field_0x140 = g_vectorZero.x; *(float *)&pMVar3[-1].field_0x144 = g_vectorZero.y; pMVar3[-1]._alpha = 0.0; mapLayer = (MinimapConfig *)((int)(pMVar3 + 1) + 4); layersLeft = layersLeft + -1; this = minimap; } while (layersLeft != 0); local_38._alpha = 0.0; local_38._unk = 0xf; anm2Path[0] = '\0'; anm2Path[1] = '\0'; anm2Path[2] = '\0'; anm2Path[3] = '\0'; anm2Path = (undefined1 [4])std::_Allocate(0x20); local_38._alpha = 3.36312e-44; local_38._unk = 0x1f; builtin_strncpy((char *)anm2Path,"gfx/ui/mapitemicons.anm2",0x19); local_14 = 4; ANM2::Load(&pMVar2->_itemIconsSprite,(std_string *)anm2Path,1); local_14 = 0xffffffff; if (0xf < (uint)local_38._unk) { uVar11 = local_38._unk + 1; auVar10 = anm2Path; if (0xfff < uVar11) { auVar10 = *(undefined1 (*) [4])((int)anm2Path + -4); uVar11 = local_38._unk + 0x24; if ((char *)0x1f < (char *)((int)anm2Path + (-4 - (int)auVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar10,uVar11); } local_38._alpha = 0.0; local_38._unk = 0xf; anm2Path[0] = '\0'; anm2Path[1] = '\0'; anm2Path[2] = '\0'; anm2Path[3] = '\0'; anm2Path = (undefined1 [4])std::_Allocate(0x20); local_38._alpha = 3.08286e-44; local_38._unk = 0x1f; builtin_strncpy((char *)anm2Path,"gfx/ui/hudpickups.anm2",0x17); local_14 = 5; ANM2::Load(&pMVar2->_hudPickupSprite,(std_string *)anm2Path,1); local_14 = 0xffffffff; if (0xf < (uint)local_38._unk) { uVar11 = local_38._unk + 1; auVar10 = anm2Path; if (0xfff < uVar11) { auVar10 = *(undefined1 (*) [4])((int)anm2Path + -4); uVar11 = local_38._unk + 0x24; if ((char *)0x1f < (char *)((int)anm2Path + (-4 - (int)auVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)auVar10,uVar11); } local_38._alpha = 0.0; local_38._unk = 0xf; anm2Path = (undefined1 [4])((uint)anm2Path & 0xffffff00); pvVar9 = Manager::LoadImage(tmpHandle,(byte *)"gfx/ui/minimap_questionmark.png"); local_14 = 6; KAGE::SmartPointer::operator_assign(&pMVar2->field_0x614,pvVar9); local_14 = 7; if (tmpRefCount != (int *)0x0) { cVar4 = (**(code **)(*tmpRefCount + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpHandle); } } local_14 = 0xffffffff; iconsPath._size = 0; iconsPath._capacity = 0xf; iconsPath._buf[0] = '\0'; iconsPath._buf[1] = '\0'; iconsPath._buf[2] = '\0'; iconsPath._buf[3] = '\0'; iconsPath._buf._0_4_ = std::_Allocate(0x20); iconsPath._size = 0x19; iconsPath._capacity = 0x1f; builtin_strncpy((char *)iconsPath._buf._0_4_,"gfx/ui/minimap_icons.anm2",0x1a); local_14 = 8; ANM2::Load(&pMVar2->_iconsSprite,&iconsPath,1); if (0xf < iconsPath._capacity) { uVar11 = iconsPath._capacity + 1; ptr = (char *)iconsPath._buf._0_4_; if (0xfff < uVar11) { ptr = *(char **)(iconsPath._buf._0_4_ + -4); uVar11 = iconsPath._capacity + 0x24; if ((char *)0x1f < (char *)(iconsPath._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar11); } pMVar2->_state = 0; pMVar2->_holdTime = 0; pMVar2->_unkBool = 0; pMVar2->_unkFloat = 1.0; pMVar2->_shakeDuration = 0; (pMVar2->_shakeOffset).x = g_vectorZero.x; (pMVar2->_shakeOffset).y = g_vectorZero.y; ExceptionList = local_1c; return; } //@@ 0098db50 Minimap::Refresh /* ZHL [exact] __thiscall void Minimap::Refresh(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Minimap::Refresh(Minimap *this) { Game *pGVar1; refresh_room_icons((Minimap *)this->_config); refresh_room_icons((Minimap *)(this->_config[1]._mapSprite._filename._buf + 4)); pGVar1 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar1->_hud)._hudRefreshCountdown = 2; } return; } //@@ 0098dba0 Game::update_map_input /* DB: ? Game::Update helper: per local player input_is_action_pressed(0xd ACTION_MAP), Level::ShowName(1), HUD_Message::text_out */ void Game::update_map_input(void) { 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 ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_20 = in_ECX; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); } isMapHeld = false; playerManager = &g_game->_playerManager; local_18 = 0.0; piVar6 = in_ECX; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playersEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; if ((int)playersEnd - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playersEnd = (playerManager->_playerList)._end; playerSlot = (playerManager->_playerList)._begin; } if ((uint)local_18 < (uint)((int)playersEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + (int)local_18; } pEVar5 = (Entity *)*playerSlot; local_14 = pEVar5; if (isMapHeld) { LAB_0098dcbe: isMapHeld = true; } else { peer = g_manager->_netplayManager; if (peer != *(NetplayManager *)(g_manager + 1)) { peerCount = (int)*(NetplayManager *)(g_manager + 1) - (int)peer >> 2; peerIndex = 0; if (peerCount != 0) { do { if (*(float *)(*(int *)peer + 0xc) == pEVar5[5]._color._offset[1]) { cVar2 = (**(code **)(*(int *)(*(int *)peer + 0x370) + 0x14))(uVar3); peer = extraout_ECX; if (cVar2 == '\0') { pEVar5 = local_14; goto LAB_0098dd0a; } break; } peerIndex = peerIndex + 1; peer = (NetplayManager)((int)peer + 4); } while (peerIndex < peerCount); } } pEVar5 = local_14; bVar1 = input_is_action_pressed(0xd,(int)local_14[5]._color._offset[1],local_14,(int)peer); if (bVar1 != 0) goto LAB_0098dcbe; LAB_0098dd0a: isMapHeld = false; } in_ECX = local_20; peer = g_manager->_netplayManager; if (peer != *(NetplayManager *)(g_manager + 1)) { local_1c = pEVar5[5]._color._offset[1]; peerIndex = 0; peerCount = (int)*(NetplayManager *)(g_manager + 1) - (int)peer >> 2; if (peerCount != 0) { do { piVar6 = in_ECX; if (*(float *)(*(int *)peer + 0xc) == local_1c) { cVar2 = (**(code **)(*(int *)(*(int *)peer + 0x370) + 0x14))(); if (cVar2 == '\0') goto LAB_0098de0e; break; } peerIndex = peerIndex + 1; peer = (NetplayManager)((int)peer + 4); } while (peerIndex < peerCount); } } pEVar5 = local_14; in_ECX = piVar6; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { InputManager::get_device(&PTR_vftable_00c57b18,&device,(int)local_14[5]._color._offset[1]); 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)) && (*(int *)((int)local_1c + 0x378) != 0)) { if (isMapHeld) { LAB_0098ddda: isMapHeld = true; } else { netplay = &g_manager->_netplayManager; if (*netplay == *(NetplayManager *)(g_manager + 1)) { LAB_0098ddb1: if (*(int *)((int)local_1c + 0x378) == 0) { iVar4 = -0x21524111; } else { iVar4 = *(int *)(*(int *)((int)local_1c + 0x378) + 0xc); } bVar1 = input_is_action_pressed(0xd,iVar4,pEVar5,(int)netplay); if (bVar1 != 0) goto LAB_0098ddda; } else { bVar1 = NetplayManager::IsIdxLocalPlayer(netplay,(uint)pEVar5[5]._color._offset[1]); netplay = extraout_ECX_00; if (bVar1 != 0) goto LAB_0098ddb1; } isMapHeld = false; } } local_8 = 1; if (((deviceRefCount != (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)((int)local_18 + 1); piVar6 = in_ECX; } while ((uint)local_18 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); if ((isMapHeld) && (in_ECX[2] = in_ECX[2] + 1, in_ECX[2] == 10)) { Level::ShowName((Level *)game,1); } } if (0 < in_ECX[0x187]) { in_ECX[0x187] = in_ECX[0x187] + -1; local_20 = (int *)in_ECX[0x188]; local_14 = (Entity *)in_ECX[0x189]; uVar3 = Random(); local_1c = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((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 = (int *)(fVar7 * local_18 + (float)local_20 * 0.5); fVar7 = sin(local_1c); in_ECX[0x188] = (int)local_20; in_ECX[0x189] = (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] = (int)fVar7; if ((float)in_ECX[0xb4] <= 0.2) { fVar7 = 0.0; } else { fVar7 = (float)in_ECX[0xb4] - 0.2; } in_ECX[0xb4] = (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] = (int)fVar7; if ((uint)in_ECX[2] < 9) { if (isMapHeld) goto LAB_0098e0cd; *in_ECX = 2; *(undefined1 *)(in_ECX + 1) = 1; } else { in_ECX[0xb4] = 0x3f800000; if (isMapHeld) goto LAB_0098df73; *in_ECX = 0; } } else { in_ECX[0x5c] = 0; if ((uint)in_ECX[2] < 9) { if (isMapHeld) { LAB_0098e0cd: in_ECX[0xb4] = (int)((float)in_ECX[0xb4] + 0.1); goto LAB_0098df73; } *in_ECX = 0; *(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] = (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] = (int)targetOpacity; } else { in_ECX[0xb4] = (int)(fVar7 + 0.1); } } else { in_ECX[0xb4] = (int)(fVar7 - 0.1); } goto LAB_0098e157; } if (isMapHeld) goto LAB_0098df73; } game = g_game; in_ECX[2] = 0; if ((game->_hud).field_0x3ce5 == '\0') { HUD_Message::text_out(&(game->_hud)._messageMain); } LAB_0098df73: fVar7 = (float)in_ECX[0x5c]; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } in_ECX[0x5c] = (int)fVar7; fVar7 = (float)in_ECX[0xb4]; if (fVar7 <= 0.0) { fVar7 = 0.0; } if (1.0 <= fVar7) { fVar7 = 1.0; } in_ECX[0xb4] = (int)fVar7; ExceptionList = local_10; return; } //@@ 0098e170 Minimap::render_icons /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Minimap::Render (twice, large and small map): "icons"/"curses" layers; item icons for The Mind 0x14d, Compass 0x15, Blue Map 0xf6, Treasure Map 0x36, 0x178 via FirstCollectibleOwner; curses = (Game+0xc | +0x26550 | Seeds::GetForcedCurses) & ~GetPreventedCurses */ void __thiscall Minimap::render_icons(Minimap *this,float *param_2) { uint uVar1; Minimap *pMVar2; byte isAnimSet; Entity_Player *itemOwner; uint forcedCurses; uint preventedCurses; uint uVar3; ColorMod *iconColor; AnimationState *lastAnimState; uint iconCount; ANM2 *iconsSprite; float in_XMM2_Da; undefined4 local_70; undefined4 uStack_6c; undefined4 uStack_68; undefined4 local_50; undefined4 uStack_4c; undefined4 local_48; AnimationState *overlayAnimState; uint iconIndex; float iconSpacing; Minimap *minimap; Vector iconPos; uint iconFrames [8]; uint local_c; undefined1 auStack_8 [4]; void *animData; local_c = __security_cookie ^ (uint)(auStack_8 + 4); iconColor = &(this->_itemIconsSprite)._color; iconPos.x = *param_2; iconPos.y = param_2[1]; local_70 = 0x3f800000; uStack_6c = 0x3f800000; uStack_68 = 0x3f800000; local_50 = 0; uStack_4c = 0; local_48 = 0; if (iconColor != (ColorMod *)&local_70) { (this->_itemIconsSprite)._color._colorize[0] = 0.0; (this->_itemIconsSprite)._color._colorize[1] = 0.0; (this->_itemIconsSprite)._color._colorize[2] = 0.0; (this->_itemIconsSprite)._color._colorize[3] = 0.0; iconColor->_tint[0] = 1.0; (this->_itemIconsSprite)._color._tint[1] = 1.0; (this->_itemIconsSprite)._color._tint[2] = 1.0; (this->_itemIconsSprite)._color._tint[3] = in_XMM2_Da; (this->_itemIconsSprite)._color._offset[0] = 0.0; (this->_itemIconsSprite)._color._offset[1] = 0.0; (this->_itemIconsSprite)._color._offset[2] = 0.0; } iconSpacing = -16.0; minimap = this; itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x14d,(RNG **)&g_game->_playerManager,1); if (itemOwner == (Entity_Player *)0x0) { itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x15,(RNG **)&g_game->_playerManager,1); if (itemOwner != (Entity_Player *)0x0) { iconFrames[0] = 0; } iconCount = (uint)(itemOwner != (Entity_Player *)0x0); itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0xf6,(RNG **)&g_game->_playerManager,1); if (itemOwner != (Entity_Player *)0x0) { iconFrames[iconCount] = 1; iconCount = iconCount + 1; } itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x36,(RNG **)&g_game->_playerManager,1); if (itemOwner != (Entity_Player *)0x0) { iconFrames[iconCount] = 2; iconCount = iconCount + 1; } } else { iconFrames[0] = 5; iconCount = 1; } itemOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x178,(RNG **)&g_game->_playerManager,1); if ((itemOwner != (Entity_Player *)0x0) && (iconCount < 7)) { iconFrames[iconCount] = 4; iconCount = iconCount + 1; } uVar3 = g_game->_debugCurses; uVar1 = g_game->_curses; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); pMVar2 = minimap; uVar3 = ~preventedCurses & (forcedCurses | uVar3 | uVar1); if (((uVar3 & 1) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xffffffff; iconCount = iconCount + 1; } if (((uVar3 & 2) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffffe; iconCount = iconCount + 1; } if (((uVar3 & 4) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffffd; iconCount = iconCount + 1; } if (((uVar3 & 8) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffffc; iconCount = iconCount + 1; } if (((uVar3 & 0x10) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffffb; iconCount = iconCount + 1; } if (((uVar3 & 0x20) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffffa; iconCount = iconCount + 1; } if (((uVar3 & 0x40) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffff9; iconCount = iconCount + 1; } if (((char)uVar3 < '\0') && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffff8; iconCount = iconCount + 1; } if (((uVar3 & 0x100) != 0) && (iconCount < 7)) { iconFrames[iconCount] = 0xfffffff7; iconCount = iconCount + 1; } if (iconCount < 4) { if (iconCount == 0) { return; } } else { iconSpacing = (float)((double)(int)(iconCount - 3) + __uint_to_double_fixup[-((int)(iconCount - 3) >> 0x1f)]) - 16.0; } iconsSprite = &minimap->_itemIconsSprite; iconIndex = 0; do { uVar3 = iconFrames[iconIndex]; if ((int)uVar3 < 0) { isAnimSet = ANM2::SetAnimation(iconsSprite,(byte *)"curses",1); if ((isAnimSet != 0) && ((pMVar2->_itemIconsSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pMVar2->_itemIconsSprite)._animState,(float)(int)~uVar3); animData = (pMVar2->_itemIconsSprite)._animState._animData; LAB_0098e430: if (animData != (void *)0x0) { (pMVar2->_itemIconsSprite)._animState._isPlaying = 0; } } } else { isAnimSet = ANM2::SetAnimation(iconsSprite,(byte *)"icons",1); if ((isAnimSet != 0) && ((pMVar2->_itemIconsSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(pMVar2->_itemIconsSprite)._animState,(float)(int)uVar3); animData = (pMVar2->_itemIconsSprite)._animState._animData; goto LAB_0098e430; } } if ((minimap->_itemIconsSprite)._loaded != 0) { overlayAnimState = &(minimap->_itemIconsSprite)._overlayAnimState; lastAnimState = &(minimap->_itemIconsSprite)._animState; if ((minimap->_itemIconsSprite)._overlayRenderFirst == 0) { AnimationState::Render(lastAnimState,&iconPos,&g_vectorZero,&g_vectorZero); lastAnimState = overlayAnimState; } else { AnimationState::Render(overlayAnimState,&iconPos,&g_vectorZero,&g_vectorZero); } AnimationState::Render(lastAnimState,&iconPos,&g_vectorZero,&g_vectorZero); } iconPos.x = iconSpacing + iconPos.x; iconIndex = iconIndex + 1; iconPos.y = iconPos.y + 0.0; if (iconCount <= iconIndex) { return; } } while( true ); } //@@ 0098e4d0 Minimap::Render /* DB: called from HUD::Render (non-greed); this=Minimap (+0x620 _shakeOffset, +0x18 MinimapConfig: +0x13c borderPadding, +0x148 borderScale); renders map ANM2, Seeds::GetForcedCurses/GetPreventedCurses (curse of the lost), Room::IsMirrorWorld, "Frame" anim prototype: REPENTOGON */ void __thiscall Minimap::Render(Minimap *this) { int *piVar1; code *pcVar2; int iVar3; byte isMirrorWorld; uint forcedCurses; uint uVar4; ColorMod *color; int iVar5; KColor *color_00; Game *game; Minimap *pMVar6; float fVar7; float fVar8; float fVar9; double dVar10; Minimap *local_150; float local_14c; float local_148; float local_144; float local_140; float local_13c; float local_138; float screenShakeX; float screenShakeY; float hudAlpha; Minimap *local_128; float hudOffsetY; float local_120; float local_11c; float local_118; KColor local_114; KColor local_100; float fStack_ec; Minimap *pMStack_e8; float fStack_e4; float local_e0; ColorMod local_d0; undefined4 local_94; undefined4 local_90; undefined4 local_8c; float local_88; undefined4 local_84; undefined1 quad [124]; uint curses; float mirroredOffsetX; game = g_game; if ((g_game->_hud)._isVisible != 0) { local_144 = 1.4013e-44; local_150 = this; std::set::find_node(&local_114,&local_144); if (((*(char *)((int)local_114._blue + 0xd) != '\0') || (10 < *(int *)((int)local_114._blue + 0x10))) || ((void *)local_114._blue == (game->_seedEffects)._seedEffects)) { screenShakeX = (game->_screenShakeOffset).x; fVar7 = 1.0 - (g_manager->_optionsConfig)._hudOffset; screenShakeY = (game->_screenShakeOffset).y; uVar4 = game->_debugCurses; fVar8 = fVar7 * -14.0; curses = g_game->_curses; fVar7 = fVar7 * 24.0; local_13c = fVar7; hudOffsetY = fVar8; forcedCurses = Seeds::GetForcedCurses(); local_144 = (float)((forcedCurses | uVar4 | curses) >> 2); uVar4 = Seeds::GetPreventedCurses(); game = g_game; local_144 = (float)(CONCAT31((uint3)(~uVar4 >> 10),(byte)(~uVar4 >> 2) & local_144._0_1_) & 0xffffff01); hudAlpha = RoomTransition::get_hud_alpha(&g_game->_roomTransition); local_118 = hudAlpha * this->_config[0]._alpha; piVar1 = *(int **)(*(int *)((int)game->_room + 4) + 0x10); if (((piVar1 == (int *)0x0) || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) { if (0.0 < local_118) { local_d0._tint[0] = 1.0; local_d0._colorize[0] = 0.0; local_d0._colorize[1] = 0.0; local_d0._colorize[2] = 0.0; local_d0._colorize[3] = 0.0; local_d0._tint[1] = 1.0; local_d0._tint[2] = 1.0; local_d0._offset[0] = 0.0; local_d0._offset[1] = 0.0; local_d0._offset[2] = 0.0; local_84 = 0; local_114._red = (g_screenWidth - 80.0) + (this->_shakeOffset).x + fVar7; local_94 = 0x3f800000; local_90 = 0x3f800000; local_8c = 0x3f800000; local_114._green = (this->_shakeOffset).y + 16.0 + fVar8; local_d0._tint[3] = local_118; local_88 = local_118; ANM2::SetFrame(&this->_config[0]._mapSprite,(std_string *)"Frame",0); Sprite::SetColor((Sprite *)this->_config,&local_d0); ANM2::Render(&this->_config[0]._mapSprite,(Vector *)&local_114,&g_vectorZero,&g_vectorZero ); if (local_144._0_1_ == '\0') { Color::Color((Color *)&local_d0); Sprite::SetColor((Sprite *)this->_config,color); dVar10 = floor((double)*(float *)&this->_config[0].field_0x140); local_128 = (Minimap *)(float)dVar10; fVar8 = this->_config[0]._borderScale; local_138 = ((float)(this->_config[0]._i1 + -1) * (fVar8 + this->_config[0]._borderPadding.x) + fVar8) * 0.5; dVar10 = floor((double)local_138); local_150 = (Minimap *)((float)local_128 - (float)dVar10); dVar10 = floor((double)*(float *)&this->_config[0].field_0x144); local_120 = (float)dVar10; fVar8 = this->_config[0]._borderScale; local_148 = ((float)(this->_config[0]._i2 + -1) * (fVar8 + this->_config[0]._borderPadding.y) + fVar8) * 0.5; dVar10 = floor((double)local_148); local_140 = local_120 - (float)dVar10; dVar10 = ceil((double)local_138); local_138 = (float)dVar10; iVar5 = *(int *)&this->_config[0].field_0x114; local_128 = (Minimap *)(local_138 + (float)local_128); dVar10 = ceil((double)local_148); local_148 = (float)dVar10; iVar3 = *(int *)(iVar5 + 0x14); iVar5 = *(int *)(iVar5 + 0x10); fVar8 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]); fStack_ec = local_148 + local_120; if (fVar8 <= local_148 + local_120) { fStack_ec = fVar8; } local_100._green = local_140; if (local_140 <= 0.0) { local_100._green = 0.0; } local_e0 = (float)CONCAT31(local_e0._1_3_,1); pMVar6 = (Minimap *)(float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]); local_100._blue = (float)local_128; if ((float)pMVar6 <= (float)local_128) { local_100._blue = (float)pMVar6; } local_100._red = (float)local_150; if ((float)local_150 <= 0.0) { local_100._red = 0.0; } local_100._alpha = local_100._green; local_100._unk = (int)local_100._red; pMStack_e8 = (Minimap *)local_100._blue; fStack_e4 = fStack_ec; isMirrorWorld = Room::IsMirrorWorld(g_game->_room); fVar8 = local_100._red; piVar1 = *(int **)&this->_config[0].field_0x114; if (isMirrorWorld == 0) { fVar8 = this->_config[0]._posOffsetX; iVar5 = *piVar1; fVar7 = fVar8 * g_vectorOne.x + local_114._red + (local_100._red - (float)local_150); local_14c = fVar8 * g_vectorOne.y + local_114._green + (local_100._green - local_140); } else { fVar7 = (float)pMStack_e8 - local_100._red; local_d0._colorize[0] = (float)pMStack_e8; fVar9 = (float)local_128 - local_100._red; local_d0._tint[0] = (float)pMStack_e8; local_d0._colorize[3] = fStack_e4; local_d0._colorize[1] = fStack_e4; local_d0._tint[3] = local_100._green; local_d0._tint[1] = local_100._green; mirroredOffsetX = this->_config[0]._posOffsetX; local_d0._tint[2] = local_100._red; local_100._red = (float)pMStack_e8; local_100._blue = fVar8; local_100._alpha = local_100._green; local_d0._colorize[2] = fVar8; local_100._unk = (int)pMStack_e8; fStack_ec = fStack_e4; pMStack_e8 = (Minimap *)fVar8; local_d0._offset[0] = (float)CONCAT31(local_d0._offset[0]._1_3_,1); local_e0 = local_d0._offset[0]; iVar5 = *piVar1; fVar7 = mirroredOffsetX * g_vectorOne.x + local_114._red + (fVar9 - fVar7); local_14c = mirroredOffsetX * g_vectorOne.y + local_114._green + (local_100._green - local_140); } local_14c = local_14c + screenShakeY; local_150 = (Minimap *)(fVar7 + screenShakeX); (**(code **)(iVar5 + 0x18))(&local_100,&local_150); } else { pcVar2 = *(code **)(**(int **)&this->field_0x614 + 0x20); KColor::SetFromARGB(&local_100,0xffffffff); local_120 = local_114._red + 8.0 + screenShakeX; local_11c = local_114._green + 8.0 + screenShakeY; (*pcVar2)(&local_120); this = local_150; } local_150 = (Minimap *)((local_114._red + 53.0) - 8.0); local_14c = local_114._green + 47.0 + 8.0; render_icons(this); game = g_game; fVar8 = hudOffsetY; fVar7 = local_13c; } hudAlpha = hudAlpha * *(float *)&this->field_0x2d0; if (0.0 < hudAlpha) { hudOffsetY = fVar8 + 0.0; fVar8 = this->_config[1]._size2.x; local_13c = fVar7 + g_screenWidth; local_100._unk = 0; local_100._red = 1.0; local_118 = this->_config[1]._size2.y; local_148 = this->_config[1]._alpha - fVar8; local_100._green = 1.0; local_100._blue = 1.0; local_100._alpha = hudAlpha; if (local_144._0_1_ == '\0') { iVar5 = *(int *)&this->_config[1].field_0x118; iVar3 = *(int *)(iVar5 + 0x10); iVar5 = *(int *)(iVar5 + 0x14); fVar7 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]); local_120 = (fVar7 - fVar7 * this->_unkFloat) * 0.5; fVar7 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]); local_144 = hudOffsetY - fVar8; local_150 = (Minimap *)((fVar7 - fVar7 * this->_unkFloat) * 0.5); isMirrorWorld = Room::IsMirrorWorld(game->_room); fVar8 = local_144 + 14.0 + *(float *)&this->field_0x14 + (this->_shakeOffset).y + screenShakeY; if (isMirrorWorld == 0) { fVar7 = ((local_13c - local_118) - 24.0) + *(float *)&this->field_0x10 + (this->_shakeOffset).x + screenShakeX; KColor::SetFromARGB(&local_114,0xffffffff); iVar5 = *(int *)&this->_config[1].field_0x118; iVar3 = *(int *)(iVar5 + 0x14); iVar5 = *(int *)(iVar5 + 0x10); render_quad_set_uniform_color (quad,local_120 + fVar7,fVar8 + (float)local_150, ((float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) + fVar7) - local_120, ((float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) + fVar8) - (float)local_150,&local_114); (**(code **)(**(int **)&this->_config[1].field_0x118 + 0x1c))(quad,&local_100); } else { iVar5 = *(int *)&this->_config[1].field_0x118; local_d0._colorize[0] = 1.0; local_d0._tint[0] = 1.0; local_d0._tint[3] = 0.0; local_d0._tint[1] = 0.0; local_d0._colorize[2] = 0.0; local_d0._tint[2] = 0.0; local_d0._colorize[3] = 1.0; local_d0._colorize[1] = 1.0; local_d0._offset[0] = (float)((uint)local_d0._offset[0] & 0xffffff00); fVar7 = ((local_13c - ((float)((double)*(int *)(iVar5 + 0x10) + __uint_to_double_fixup[-(*(int *)(iVar5 + 0x10) >> 0x1f)]) - this->_config[1]._size1.y)) - 24.0) + *(float *)&this->field_0x10 + (this->_shakeOffset).x + screenShakeX; KColor::SetFromARGB(&local_114,0xffffffff); render_quad_set_uniform_color (quad,local_120 + fVar7,fVar8 + (float)local_150, ((float)((double)*(int *)(iVar5 + 0x10) + __uint_to_double_fixup[-(*(int *)(iVar5 + 0x10) >> 0x1f)]) + fVar7) - local_120, ((float)((double)*(int *)(iVar5 + 0x14) + __uint_to_double_fixup[-(*(int *)(iVar5 + 0x14) >> 0x1f)]) + fVar8) - (float)local_150,color_00); (**(code **)(**(int **)&this->_config[1].field_0x118 + 0x14)) (&local_d0,quad,&local_100); } } local_114._red = local_13c - 32.0; local_114._green = local_148 + 16.0 + 8.0 + hudOffsetY; render_icons(this); } fVar8 = hudAlpha; if (((g_manager->_optionsConfig)._historyHudMode == 1) && (fVar8 = 0.5, 0.5 <= hudAlpha)) { fVar8 = hudAlpha; } if (0.0 < fVar8) { render_score_time(); } } else if ((game->_dailyChallenge)._id != 0) { render_score_time(); return; } } } return; } //@@ 0098ef30 Minimap::render_score_time /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? caller FUN_0098e4d0 (HUD::Render -> minimap render, "Frame"); #MINIMAP_SCORE_LABEL/#MINIMAP_TIME_LABEL, "%02d:%02d:%02d", ScoreSheet::Calculate, GetExtraLives */ void Minimap::render_score_time(void) { int iVar1; byte *labelText; int iVar2; StringTable **maxWidthPtr; uint forcedCurses; uint preventedCurses; Entity_Player *player; float *heartsWidthPtr; uint uVar3; undefined4 extraout_EAX; undefined4 extraout_EAX_00; Font *fontCopy; float hudAlpha; undefined4 in_XMM1_Da; float spaceRight; float fVar4; StringTable *pSVar5; StringTable *textRightX; float minimapWidth; float minimapMarginX; FontSettings local_e4 [7]; float maxHeartsWidth; undefined4 local_c4; float hudInset; undefined4 local_bc; undefined4 uStack_b8; undefined4 auStack_b4 [2]; void *local_ac; FontSettings local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 local_90; float local_8c; float local_88; float shakeX; Font *font; float local_7c; StringTable *local_78; StringTable *local_74; float textY; StringTable *local_6c; byte valueText [68]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; uint curses; Game *game; game = g_game; puStack_20 = valueText + 100; local_14 = 0xffffffff; puStack_18 = &LAB_00b0d501; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(valueText + 0x58); if ((g_game->_hud)._isVisible == 0) { return; } local_88 = 1.4013e-44; ExceptionList = &local_1c; local_c4 = in_XMM1_Da; std::set::find_node(auStack_b4,&local_88); if (((*(char *)((int)local_ac + 0xd) == '\0') && (*(int *)((int)local_ac + 0x10) < 0xb)) && (local_ac != (game->_seedEffects)._seedEffects)) { ExceptionList = local_1c; return; } local_74 = &g_manager->_stringTable; font = &g_manager->_font2_TeamMeatEx12; if (*(int *)&g_manager->_stringTable == 0) { font = &g_manager->_font1_TeamMeatEx10; } fontCopy = font; hudInset = 1.0 - (g_manager->_optionsConfig)._hudOffset; textY = hudInset * -24.0; shakeX = (game->_screenShakeOffset).x; local_88 = (game->_screenShakeOffset).y; iVar1 = Font::get_string_width_n(font,(byte *)" 00:00:00",-1); labelText = string_table_translate(local_74,(byte *)"#MINIMAP_TIME_LABEL"); iVar2 = Font::get_string_width_n(fontCopy,labelText,-1); pSVar5 = &g_manager->_stringTable; local_78 = (StringTable *) ((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) + (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])); local_6c = local_78; iVar1 = Font::get_string_width_n(fontCopy,(byte *)" 000000",-1); labelText = string_table_translate(pSVar5,(byte *)"#MINIMAP_TIME_LABEL"); iVar2 = Font::get_string_width_n(font,labelText,-1); local_74 = (StringTable *) ((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) + (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])); maxWidthPtr = &local_74; if ((float)local_74 <= (float)local_6c) { maxWidthPtr = &local_78; } uVar3 = g_game->_debugCurses; pSVar5 = (StringTable *)((g_screenWidth - (float)*maxWidthPtr) * 0.5); curses = g_game->_curses; textRightX = (StringTable *)((float)*maxWidthPtr + (float)pSVar5); local_78 = textRightX; local_6c = pSVar5; forcedCurses = Seeds::GetForcedCurses(); preventedCurses = Seeds::GetPreventedCurses(); fVar4 = local_8c; game = g_game; if ((~preventedCurses & (forcedCurses | uVar3 | curses) & 4) == 0) { spaceRight = g_screenWidth - (float)textRightX; minimapWidth = *(float *)((int)local_8c + 0x2c8) - *(float *)((int)local_8c + 0x2c0); minimapMarginX = *(float *)((int)local_8c + 0x29c); if (spaceRight < minimapMarginX + minimapWidth) { hudAlpha = RoomTransition::get_hud_alpha(&g_game->_roomTransition); local_74 = (StringTable *)0x0; if (0.0 < hudAlpha * *(float *)((int)fVar4 + 0x2d0)) { local_7c = 1.0 - hudInset; fVar4 = ((spaceRight - minimapWidth) - minimapMarginX) - local_7c * 24.0; local_78 = (StringTable *)((float)textRightX + fVar4); local_6c = (StringTable *)((float)pSVar5 + fVar4); player = Game::GetPlayer(game,0); iVar1 = Entity_Player::GetExtraLives(player); if (0 < iVar1) { local_74 = (StringTable *)0x41800000; } player = Game::GetPlayer(g_game,0); iVar1 = Entity_Player::GetEffectiveMaxHearts(player); player = Game::GetPlayer(g_game,0); maxHeartsWidth = 72.0; local_8c = (float)(iVar1 + player->_soulHearts) * 6.0; heartsWidthPtr = &local_8c; if (72.0 <= local_8c) { heartsWidthPtr = &maxHeartsWidth; } pSVar5 = local_6c; if (((float)local_6c <= ((*heartsWidthPtr + 60.0) - hudInset * 20.0) + (float)local_74) && (uVar3 = Level::GetCurses((Level *)g_game), pSVar5 = local_6c, (uVar3 & 8) == 0)) { textY = (24.0 - local_7c * 12.0) + textY; } } } } uStack_b8 = 0x3f800000; auStack_b4[0] = 0x3f800000; if (g_game->_challenge == 0x16) { local_a0 = 0x3f800000; iVar2 = 0x7080 - g_game->_timeCounter; uStack_9c = 0x3f000000; uStack_98 = 0x3f000000; uStack_94 = local_c4; iVar1 = 0; if (0 < iVar2) { iVar1 = iVar2; } uStack_b8 = 0x3f000000; auStack_b4[0] = 0x3f000000; } else { iVar1 = g_game->_timeCounter; } local_ac = (void *)0x0; local_bc = 0x3f800000; local_7c = (float)((iVar1 % 0x1a5e0) / 0x708); if (iVar1 < 1) { uVar3 = g_game->_frameCount & 0x80000007; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffff8) + 1; } if (3 < (int)uVar3) { local_6c = (StringTable *)((float)pSVar5 + shakeX); fontCopy = font; goto LAB_0098f558; } } sprintf_s(valueText,0x40,(byte *)"%02d:%02d:%02d"); fontCopy = font; Font::get_string_width_n(font,valueText,-1); local_a8 = (FontSettings)0x0; local_a4 = 0xffff; local_a0 = 0; uStack_9c = 0x3f800000; uStack_98 = 0xffffffff; uStack_94 = 0; local_90 = 0; local_14 = 0; labelText = string_table_translate(&g_manager->_stringTable,(byte *)"#MINIMAP_TIME_LABEL"); local_6c = (StringTable *)(shakeX + (float)local_6c); local_7c = textY + 30.0 + local_88; Font::DrawString(labelText,&local_bc,&local_a8); local_a8 = (FontSettings)0x0; local_a4 = 0xffff; local_a0 = 0; uStack_9c = 0x3f800000; uStack_98 = 0xffffffff; uStack_94 = 0; local_90 = 0; local_14 = 1; Font::DrawString(valueText,&local_bc,&local_a8); local_14 = 0xffffffff; LAB_0098f558: if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && ((g_game->_dailyChallenge)._id != 0)) { local_ac = (void *)0x0; local_bc = 0x3f800000; uStack_b8 = 0x3f800000; auStack_b4[0] = 0x3f800000; FontSettings::constructor(&local_a8); local_14 = 2; labelText = string_table_translate(&g_manager->_stringTable,(byte *)"#MINIMAP_SCORE_LABEL"); textY = textY + 46.0 + local_88; Font::DrawString(labelText,&local_bc,extraout_EAX); local_14 = 0xffffffff; uStack_94 = 0; local_90 = 0; ScoreSheet::Calculate(&g_game->_scoreSheet); sprintf_s(valueText,0x40,s__d); Font::get_string_width_n(fontCopy,valueText,-1); FontSettings::constructor(local_e4); local_14 = 3; Font::DrawString(valueText,&local_bc,extraout_EAX_00); } ExceptionList = local_1c; return; } //@@ 0098f6c0 FUN_0098f6c0 void FUN_0098f6c0(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0x3f800000; in_ECX[7] = 0; in_ECX[8] = 0x3f800000; in_ECX[9] = 0; *(undefined1 *)(in_ECX + 0xc) = 0; in_ECX[0xb] = 0; in_ECX[10] = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; return; } //@@ 0098f720 FXParams::FXParams /* DB: default ctor matching REPENTOGON FXParams layout (size 0xa0): roomColor KColor(1,1,1,0) at 0, brightness 0 +0x14, contrast 1.0 +0x18, useWaterV2 false +0x1c, waterColor (0.04,0.04,0.04,0.6) +0x20, waterColorMultiplier 1.0 +0x34, shadowAlpha 0.5 +0x48, shadowColor/lightColor, water effect ColorMod; Room::constructor, FXLayers::LoadConfig prototype: db/protos.zhl */ void * __thiscall FXParams::FXParams(FXParams *this) { *(undefined4 *)&this->field_0x10 = 0; *(undefined4 *)this = 0x3f800000; *(undefined4 *)&this->field_0x4 = 0x3f800000; *(undefined4 *)&this->field_0x8 = 0x3f800000; *(undefined4 *)&this->field_0xc = 0; this->brightness = 0.0; this->contrast = 1.0; this->useWaterV2 = 0; *(undefined4 *)&this->field_0x30 = 0; *(undefined4 *)&this->field_0x20 = 0x3d23d70a; *(undefined4 *)&this->field_0x24 = 0x3d23d70a; *(undefined4 *)&this->field_0x28 = 0x3d23d70a; *(undefined4 *)&this->field_0x2c = 0x3f19999a; *(undefined4 *)&this->field_0x44 = 0; *(undefined4 *)&this->field_0x34 = 0x3f800000; *(undefined4 *)&this->field_0x38 = 0x3f800000; *(undefined4 *)&this->field_0x3c = 0x3f800000; *(undefined4 *)&this->field_0x40 = 0x3f800000; this->shadowAlpha = 0.5; *(undefined4 *)&this[1].field_0x10 = 0; *(undefined4 *)(this + 1) = 0x3d75c28f; *(undefined4 *)&this[1].field_0x4 = 0x3da3d70a; *(undefined4 *)&this[1].field_0x8 = 0x3e051eb8; *(undefined4 *)&this[1].field_0xc = 0x3f800000; *(undefined4 *)&this[1].field_0x24 = 0; this[1].brightness = 1.0; this[1].contrast = 1.0; *(undefined4 *)&this[1].useWaterV2 = 0x3f800000; *(undefined4 *)&this[1].field_0x20 = 0x3f19999a; *(undefined4 *)&this[1].field_0x28 = 0x3f800000; *(undefined4 *)&this[1].field_0x2c = 0x3f800000; *(undefined4 *)&this[1].field_0x30 = 0x3f800000; *(undefined4 *)&this[1].field_0x34 = 0x3f800000; *(undefined4 *)&this[1].field_0x38 = 0; *(undefined4 *)&this[1].field_0x3c = 0; *(undefined4 *)&this[1].field_0x40 = 0; *(undefined4 *)&this[1].field_0x44 = 0; this[1].shadowAlpha = 0.0; *(undefined4 *)(this + 2) = 0; *(undefined4 *)&this[2].field_0x4 = 0; return this; } //@@ 0098f850 image_ref_vector_holder_destroy /* DB: ? dtor of a small struct {?, image ref at +4/+8 released via g_imageReleaseFn, vector at +0xc}; unwind-only callers */ void image_ref_vector_holder_destroy(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FID_conflict__Tidy((void *)(in_ECX + 0xc)); local_8 = 0; if (*(int **)(in_ECX + 8) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 8) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 4); } } ExceptionList = local_10; return; } //@@ 0098f8c0 FXLayers::destructor /* DB: destroys ANM2[2] at +0x2c8 (stride 0x114), string +0x44, image +0x3c/+0x40, then std::vector<44byte> and std::vector (_Tidy 00997410/00997490) */ void FXLayers::destructor(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x2c8),0x114,2,ANM2::~ANM2); FID_conflict__Tidy((void *)(in_ECX + 0x44)); local_8 = 0; if (*(int **)(in_ECX + 0x40) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x40) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x3c); } } std::vector<44byte>::_Tidy(); std::vector::_Tidy(); ExceptionList = local_10; return; } //@@ 0098f960 FXParams::FXParams /* DB: ? zero-inits a 0x4c-byte param block (+0x44 = 1); Room::constructor at Room+0x38 and a stack local in FXLayers::LoadConfig prototype: db/protos.zhl */ void * __thiscall FXParams::FXParams(FXParams *this) { *(undefined4 *)&this->field_0x4 = 0; *(undefined4 *)&this->field_0x8 = 0; *(undefined4 *)&this->field_0xc = 0; *(undefined4 *)&this->field_0x10 = 0; this->brightness = 0.0; this->contrast = 0.0; *(undefined4 *)&this->useWaterV2 = 0; *(undefined4 *)&this->field_0x20 = 0; *(undefined4 *)&this->field_0x24 = 0; *(undefined4 *)&this->field_0x28 = 0; *(undefined4 *)&this->field_0x30 = 0; *(undefined4 *)&this->field_0x34 = 0; this->field_0x38 = 0; *(undefined4 *)&this->field_0x40 = 0; *(undefined4 *)&this->field_0x44 = 1; *(undefined1 *)&this->shadowAlpha = 0; return this; } //@@ 0098f9d0 FXLayers::stage_matches /* DB: ? ECX = layer stage, EDX = stage-type bitmask, (param_1 current stage, param_2 stage type): stage 0 always; stages 1-8 compared by chapter ((s-1)/2), 9+ exact, Blue Womb special case with Game flag 0x10000; then requires bit param_2 in the mask; FXLayers::LoadConfig, parse_fx_params_node */ uint FXLayers::stage_matches(int param_1,byte param_2) { int in_ECX; uint uVar1; uint in_EDX; bool bVar2; uVar1 = g_game->_stage; if (((((int)uVar1 < 1) || (6 < (int)uVar1)) || (uVar1 = *(uint *)((int)&g_game->_gameStateFlags + 4) & 0x10000, uVar1 == 0)) || (in_ECX != 9) ) { if (in_ECX == 0) goto LAB_0098fa24; if (8 < in_ECX) goto LAB_0098fa07; uVar1 = (param_1 + -1) / 2; bVar2 = uVar1 == (in_ECX + -1) / 2; } else { if ((in_EDX & 0x10) != 0) goto LAB_0098fa24; LAB_0098fa07: bVar2 = param_1 == in_ECX; } if ((!bVar2) || (uVar1 = 1 << (param_2 & 0x1f), (in_EDX & uVar1) == 0)) { return uVar1 & 0xffffff00; } LAB_0098fa24: return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 0098fa60 FXLayers::parse_fx_params_node /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: parses stage/fxParams xml attributes (backdrop, brightness, contrast, colorModifier, lightColor, shadowAlpha, shadowColor, waterColor, waterEffectColor, waterv2, altStages) into FXLayers+0x4f8 _fxParams (writes +0x504..); recursive on child "fxParams"; called from fxlayers.xml loader 00990a40 FXLayers::LoadConfig void FXLayers::parse_fx_params_node(void *param_1) { char cVar1; byte bVar2; undefined1 uVar3; byte *pbVar4; uint uVar5; int *******pppppppiVar6; byte *pbVar7; byte *pbVar8; int iVar9; undefined4 *puVar10; undefined4 *puVar11; char *pcVar12; char *pcVar13; int iVar14; bool bVar15; double dVar16; int in_stack_ffffffa8; byte in_stack_ffffffac; undefined1 auStack_44 [4]; int local_40; undefined4 *local_3c; undefined4 *local_38; void *local_34; int local_30; undefined4 local_2c; int local_28; int *******local_24 [4]; int local_14; uint local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_44; local_34 = xml_node::first_node(param_1,(byte *)"params",in_stack_ffffffa8,in_stack_ffffffac); do { if (local_34 == (void *)0x0) { return; } local_2c = 0; local_30 = -1; local_28 = 0; pcVar12 = "stage"; do { pcVar13 = pcVar12; pcVar12 = pcVar13 + 1; } while (*pcVar12 != '\0'); local_3c = *(undefined4 **)((int)local_34 + 0x20); for (local_38 = local_3c; local_38 != (undefined4 *)0x0; local_38 = (undefined4 *)local_38[6]) { pbVar7 = (byte *)*local_38; if (pbVar7 == (byte *)0x0) { pcVar12 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar12 = (char *)local_38[2]; } if (pcVar12 == pcVar13 + -0xb65867) { pbVar4 = (byte *)(pcVar12 + (int)pbVar7); if (pbVar4 <= pbVar7) goto LAB_0098fb2d; iVar9 = (int)"stage" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar4 <= pbVar7) goto LAB_0098fb2d; } } } local_38 = (undefined4 *)0x0; LAB_0098fb2d: pcVar12 = "altStages"; do { pcVar13 = pcVar12; pcVar12 = pcVar13 + 1; } while (*pcVar12 != '\0'); for (puVar10 = local_3c; puVar10 != (undefined4 *)0x0; puVar10 = (undefined4 *)puVar10[6]) { pbVar7 = (byte *)*puVar10; if (pbVar7 == (byte *)0x0) { pcVar12 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar12 = (char *)puVar10[2]; } if (pcVar12 == pcVar13 + -0xb7d6bf) { pbVar4 = (byte *)(pcVar12 + (int)pbVar7); if (pbVar4 <= pbVar7) goto LAB_0098fb87; iVar9 = (int)"altStages" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar4 <= pbVar7) goto LAB_0098fb87; } } } puVar10 = (undefined4 *)0x0; LAB_0098fb87: pcVar12 = "backdrop"; do { pcVar13 = pcVar12; pcVar12 = pcVar13 + 1; } while (*pcVar12 != '\0'); for (; local_3c != (undefined4 *)0x0; local_3c = (undefined4 *)local_3c[6]) { pbVar7 = (byte *)*local_3c; if (pbVar7 == (byte *)0x0) { pcVar12 = (char *)0x0; pbVar7 = &g_xmlNullStr; } else { pcVar12 = (char *)local_3c[2]; } if (pcVar12 == pcVar13 + -0xb6cd2b) { pbVar4 = (byte *)(pcVar12 + (int)pbVar7); if (pbVar4 <= pbVar7) { LAB_0098fbd0: puVar11 = local_3c; goto LAB_0098fbe7; } iVar9 = (int)"backdrop" - (int)pbVar7; while (*pbVar7 == pbVar7[iVar9]) { pbVar7 = pbVar7 + 1; if (pbVar4 <= pbVar7) goto LAB_0098fbd0; } } } puVar11 = (undefined4 *)0x0; LAB_0098fbe7: if (local_38 != (undefined4 *)0x0) { pbVar7 = &g_xmlNullStr; if ((byte *)local_38[1] != (byte *)0x0) { pbVar7 = (byte *)local_38[1]; } atoi((char *)pbVar7); } if (puVar10 != (undefined4 *)0x0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } local_30 = atoi((char *)pbVar7); } if (puVar11 == (undefined4 *)0x0) { iVar9 = local_28; } else { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } iVar9 = atoi((char *)pbVar7); } iVar14 = local_40; cVar1 = stage_matches(*(undefined4 *)(local_40 + 0xc),*(undefined4 *)(local_40 + 0x10)); if ((cVar1 != '\0') && ((iVar9 == 0 || (*(int *)(iVar14 + 0x14) == iVar9)))) { local_38 = *(undefined4 **)((int)local_34 + 0x20); if (local_38 != (undefined4 *)0x0) { do { puVar10 = local_38; pbVar7 = (byte *)*local_38; pcVar12 = "waterv2"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_0098fce6: uVar5 = -(uint)bVar15 | 1; goto LAB_0098fceb; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_0098fce6; pbVar4 = pbVar4 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0098fceb: if (uVar5 == 0) { local_24[0] = (int *******)0x0; local_14 = 0; pbVar7 = &g_xmlNullStr; if ((byte *)local_38[1] != (byte *)0x0) { pbVar7 = (byte *)local_38[1]; } local_10 = 0xf; pbVar4 = pbVar7; do { bVar2 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar2 != 0); std::string::assign((char *)local_24,pbVar7,(int)pbVar4 - (int)(pbVar7 + 1)); if (local_14 == 0) { LAB_0098fdf2: uVar3 = 0; } else { pppppppiVar6 = (int *******)local_24; if (0xf < local_10) { pppppppiVar6 = local_24[0]; } if (local_14 == 4) { if ((*pppppppiVar6 == (int ******)0x65757274) || ((((bVar2 = (byte)*pppppppiVar6, bVar15 = bVar2 < 0x74, bVar2 == 0x74 && (bVar15 = *(byte *)((int)pppppppiVar6 + 1) < 0x72, *(byte *)((int)pppppppiVar6 + 1) == 0x72)) && (bVar15 = *(byte *)((int)pppppppiVar6 + 2) < 0x75, *(byte *)((int)pppppppiVar6 + 2) == 0x75)) && (bVar15 = *(byte *)((int)pppppppiVar6 + 3) < 0x65, *(byte *)((int)pppppppiVar6 + 3) == 0x65)))) { uVar5 = 0; } else { uVar5 = -(uint)bVar15 | 1; } if (uVar5 != 0) goto LAB_0098fd8b; } else { LAB_0098fd8b: pppppppiVar6 = (int *******)local_24; if (0xf < local_10) { pppppppiVar6 = local_24[0]; } if (local_14 == 4) { if ((*pppppppiVar6 == (int ******)0x65757254) || (((bVar2 = (byte)*pppppppiVar6, bVar15 = bVar2 < 0x54, bVar2 == 0x54 && (bVar15 = *(byte *)((int)pppppppiVar6 + 1) < 0x72, *(byte *)((int)pppppppiVar6 + 1) == 0x72)) && ((bVar15 = *(byte *)((int)pppppppiVar6 + 2) < 0x75, *(byte *)((int)pppppppiVar6 + 2) == 0x75 && (bVar15 = *(byte *)((int)pppppppiVar6 + 3) < 0x65, *(byte *)((int)pppppppiVar6 + 3) == 0x65)))))) { uVar5 = 0; } else { uVar5 = -(uint)bVar15 | 1; } if (uVar5 == 0) goto LAB_0098fdee; } pppppppiVar6 = (int *******)local_24; if (0xf < local_10) { pppppppiVar6 = local_24[0]; } iVar9 = atoi((char *)pppppppiVar6); if (iVar9 == 0) goto LAB_0098fdf2; } LAB_0098fdee: uVar3 = 1; } *(undefined1 *)(local_40 + 0x514) = uVar3; if (0xf < local_10) { uVar5 = local_10 + 1; pppppppiVar6 = local_24[0]; if (0xfff < uVar5) { pppppppiVar6 = (int *******)local_24[0][-1]; uVar5 = local_10 + 0x24; if (0x1f < (uint)((int)local_24[0] + (-4 - (int)pppppppiVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppiVar6,uVar5); } puVar10 = local_38; } else { pcVar12 = "shadowAlpha"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_0098fec2: uVar5 = -(uint)bVar15 | 1; goto LAB_0098fec7; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_0098fec2; pbVar4 = pbVar4 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0098fec7: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)local_38[1] != (byte *)0x0) { pbVar7 = (byte *)local_38[1]; } dVar16 = atof((char *)pbVar7); *(float *)(iVar14 + 0x540) = (float)dVar16; } } if ((puVar10[4] == 0) || (local_38 = (undefined4 *)puVar10[6], local_38 == (undefined4 *)0x0)) break; iVar14 = local_40; } while( true ); } for (puVar10 = *(undefined4 **)((int)local_34 + 0x18); puVar10 != (undefined4 *)0x0; puVar10 = (undefined4 *)puVar10[0xb]) { pbVar7 = (byte *)*puVar10; pcVar12 = "colorModifier"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_0098fef1: uVar5 = -(uint)bVar15 | 1; goto LAB_0098fef6; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_0098fef1; pbVar4 = pbVar4 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0098fef6: local_3c = puVar10; if (uVar5 == 0) { for (puVar11 = (undefined4 *)puVar10[8]; puVar11 != (undefined4 *)0x0; puVar11 = (undefined4 *)puVar11[6]) { pbVar7 = (byte *)*puVar11; pbVar8 = &DAT_00b6617c; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_0098ff41: uVar5 = -(uint)bVar15 | 1; goto LAB_0098ff46; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_0098ff41; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0098ff46: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x4f8) = (float)dVar16; } else { pbVar8 = &DAT_00b66178; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_0098ffa0: uVar5 = -(uint)bVar15 | 1; goto LAB_0098ffa5; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_0098ffa0; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0098ffa5: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x4fc) = (float)dVar16; } else { pbVar8 = &DAT_00b69bc4; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990000: uVar5 = -(uint)bVar15 | 1; goto LAB_00990005; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990000; pbVar8 = pbVar8 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990005: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x500) = (float)dVar16; } else { pbVar8 = &DAT_00b656e8; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990060: uVar5 = -(uint)bVar15 | 1; goto LAB_00990065; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990060; pbVar8 = pbVar8 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990065: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x504) = (float)dVar16; } else { pcVar12 = "brightness"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_009900c0: uVar5 = -(uint)bVar15 | 1; goto LAB_009900c5; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_009900c0; pcVar12 = pcVar12 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009900c5: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x50c) = (float)dVar16; } else { pcVar12 = "contrast"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00990118: uVar5 = -(uint)bVar15 | 1; goto LAB_0099011d; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00990118; pbVar4 = pbVar4 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0099011d: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x510) = (float)dVar16; } } } } } } if (puVar11[4] == 0) break; } goto LAB_009909f7; } pcVar12 = "waterColor"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00990190: uVar5 = -(uint)bVar15 | 1; goto LAB_00990195; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00990190; pcVar12 = pcVar12 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990195: if (uVar5 == 0) { for (puVar10 = (undefined4 *)puVar10[8]; puVar10 != (undefined4 *)0x0; puVar10 = (undefined4 *)puVar10[6]) { pbVar7 = (byte *)*puVar10; pbVar8 = &DAT_00b6617c; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009901e1: uVar5 = -(uint)bVar15 | 1; goto LAB_009901e6; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009901e1; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009901e6: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x518) = (float)dVar16; } else { pbVar8 = &DAT_00b66178; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990240: uVar5 = -(uint)bVar15 | 1; goto LAB_00990245; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990240; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990245: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x51c) = (float)dVar16; } else { pbVar8 = &DAT_00b69bc4; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009902a0: uVar5 = -(uint)bVar15 | 1; goto LAB_009902a5; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009902a0; pbVar8 = pbVar8 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009902a5: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x520) = (float)dVar16; } else { pbVar8 = &DAT_00b656e8; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990300: uVar5 = -(uint)bVar15 | 1; goto LAB_00990305; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990300; pbVar8 = pbVar8 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990305: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x524) = (float)dVar16; } else { if (pbVar7 == (byte *)0x0) { pbVar7 = &g_xmlNullStr; pbVar4 = (byte *)0x0; } else { pbVar4 = pbVar7; } pbVar8 = &DAT_00b7d664; do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990360: uVar5 = -(uint)bVar15 | 1; goto LAB_00990365; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990360; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990365: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x52c) = (float)dVar16; } else { pbVar8 = &DAT_00b7d66c; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009903c0: uVar5 = -(uint)bVar15 | 1; goto LAB_009903c5; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009903c0; pbVar8 = pbVar8 + 2; pbVar7 = pbVar7 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009903c5: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x530) = (float)dVar16; } else { pbVar8 = &DAT_00b7d674; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990418: uVar5 = -(uint)bVar15 | 1; goto LAB_0099041d; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990418; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_0099041d: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar10[1] != (byte *)0x0) { pbVar7 = (byte *)puVar10[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x534) = (float)dVar16; } } } } } } } if (puVar10[4] == 0) break; } LAB_009909f3: puVar10 = local_3c; } else { pcVar12 = "shadowColor"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00990490: uVar5 = -(uint)bVar15 | 1; goto LAB_00990495; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00990490; pcVar12 = pcVar12 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990495: if (uVar5 == 0) { puVar11 = (undefined4 *)puVar10[8]; if (puVar11 == (undefined4 *)0x0) goto LAB_009909f7; do { pbVar7 = (byte *)*puVar11; pbVar8 = &DAT_00b6617c; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009904e1: uVar5 = -(uint)bVar15 | 1; goto LAB_009904e6; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009904e1; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009904e6: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x544) = (float)dVar16; } else { if (pbVar7 == (byte *)0x0) { pbVar7 = &g_xmlNullStr; pbVar4 = (byte *)0x0; } else { pbVar4 = pbVar7; } pbVar8 = &DAT_00b66178; do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990541: uVar5 = -(uint)bVar15 | 1; goto LAB_00990546; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990541; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990546: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x548) = (float)dVar16; } else { pbVar8 = &DAT_00b69bc4; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009905a0: uVar5 = -(uint)bVar15 | 1; goto LAB_009905a5; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009905a0; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009905a5: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x54c) = (float)dVar16; } else { pbVar8 = &DAT_00b656e8; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009905f8: uVar5 = -(uint)bVar15 | 1; goto LAB_009905fd; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009905f8; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009905fd: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x550) = (float)dVar16; } } } } } while ((puVar11[4] != 0) && (puVar11 = (undefined4 *)puVar11[6], puVar11 != (undefined4 *)0x0)); goto LAB_009909f3; } pcVar12 = "lightColor"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00990670: uVar5 = -(uint)bVar15 | 1; goto LAB_00990675; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00990670; pcVar12 = pcVar12 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990675: if (uVar5 == 0) { puVar11 = (undefined4 *)puVar10[8]; if (puVar11 != (undefined4 *)0x0) { do { pbVar7 = (byte *)*puVar11; pbVar8 = &DAT_00b6617c; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009906c1: uVar5 = -(uint)bVar15 | 1; goto LAB_009906c6; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009906c1; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009906c6: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x558) = (float)dVar16; } else { if (pbVar7 == (byte *)0x0) { pbVar7 = &g_xmlNullStr; pbVar4 = (byte *)0x0; } else { pbVar4 = pbVar7; } pbVar8 = &DAT_00b66178; do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990721: uVar5 = -(uint)bVar15 | 1; goto LAB_00990726; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990721; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990726: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x55c) = (float)dVar16; } else { pbVar8 = &DAT_00b69bc4; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990780: uVar5 = -(uint)bVar15 | 1; goto LAB_00990785; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990780; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990785: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x560) = (float)dVar16; } else { pbVar8 = &DAT_00b656e8; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009907d8: uVar5 = -(uint)bVar15 | 1; goto LAB_009907dd; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009907d8; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009907dd: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x564) = (float)dVar16; } } } } } while ((puVar11[4] != 0) && (puVar11 = (undefined4 *)puVar11[6], puVar11 != (undefined4 *)0x0)); goto LAB_009909f3; } } else { pcVar12 = "waterEffectColor"; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00990850: uVar5 = -(uint)bVar15 | 1; goto LAB_00990855; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00990850; pcVar12 = pcVar12 + 2; pbVar4 = pbVar4 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990855: if ((uVar5 == 0) && (puVar11 = (undefined4 *)puVar10[8], puVar11 != (undefined4 *)0x0)) { do { pbVar7 = (byte *)*puVar11; pbVar8 = &DAT_00b6617c; pbVar4 = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { pbVar4 = pbVar7; } do { bVar2 = *pbVar4; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009908a1: uVar5 = -(uint)bVar15 | 1; goto LAB_009908a6; } if (bVar2 == 0) break; bVar2 = pbVar4[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009908a1; pbVar4 = pbVar4 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009908a6: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x56c) = (float)dVar16; } else { if (pbVar7 == (byte *)0x0) { pbVar7 = &g_xmlNullStr; pbVar4 = (byte *)0x0; } else { pbVar4 = pbVar7; } pbVar8 = &DAT_00b66178; do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990901: uVar5 = -(uint)bVar15 | 1; goto LAB_00990906; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990901; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990906: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x570) = (float)dVar16; } else { pbVar8 = &DAT_00b69bc4; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_00990960: uVar5 = -(uint)bVar15 | 1; goto LAB_00990965; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_00990960; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_00990965: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x574) = (float)dVar16; } else { pbVar8 = &DAT_00b656e8; pbVar7 = &g_xmlNullStr; if (pbVar4 != (byte *)0x0) { pbVar7 = pbVar4; } do { bVar2 = *pbVar7; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009909b8: uVar5 = -(uint)bVar15 | 1; goto LAB_009909bd; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009909b8; pbVar7 = pbVar7 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar5 = 0; LAB_009909bd: if (uVar5 == 0) { pbVar7 = &g_xmlNullStr; if ((byte *)puVar11[1] != (byte *)0x0) { pbVar7 = (byte *)puVar11[1]; } dVar16 = atof((char *)pbVar7); *(float *)(local_40 + 0x578) = (float)dVar16; } } } } } while ((puVar11[4] != 0) && (puVar11 = (undefined4 *)puVar11[6], puVar11 != (undefined4 *)0x0)); goto LAB_009909f3; } } } LAB_009909f7: } } local_34 = *(void **)((int)local_34 + 0x2c); } while( true ); } //@@ 00990a40 FXLayers::LoadConfig /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: this=FXLayers (stores stage/stageType at +0xc/+0x10), arg xml path: parses fxlayers.xml nodes stage/backdrop/fxLayers/layer/rayGroup/fxParams, "[warn] failed to load %s", loads gfx/Veins.anm2; caller 007f1380 Room::LoadBackdropGraphics "fxlayers.xml" */ void FXLayers::LoadConfig(float *param_1,float param_2,float param_3) { undefined4 uVar1; int iVar2; code *pcVar3; byte *******pppppppbVar4; byte bVar5; char cVar6; float fVar7; int iVar8; uint uVar9; int *piVar10; void *pvVar11; void *pvVar12; byte *******pppppppbVar13; std_string *psVar14; undefined4 *puVar15; int *piVar16; LayerState *pLVar17; byte bVar18; byte bVar19; float *in_ECX; byte *pbVar20; byte *pbVar21; byte *pbVar22; std_string *psVar23; void *extraout_EDX; undefined1 *puVar24; float *pfVar25; float fVar26; int *piVar27; Game *pGVar28; ANM2 *this; float *pfVar29; float *pfVar30; char *pcVar31; undefined4 *puVar32; char *pcVar33; bool bVar34; float fVar35; float fVar36; float fVar37; float fVar38; double dVar39; double dVar40; undefined8 uVar41; undefined1 auStack_102ec [8]; undefined1 auStack_102e4 [8]; undefined1 auStack_102dc [8]; undefined1 auStack_102d4 [8]; undefined1 auStack_102cc [8]; undefined1 auStack_102c4 [8]; char *pcStack_102bc; undefined4 uStack_102b8; char *pcStack_102b4; undefined4 uStack_102b0; char *pcStack_102ac; undefined4 uStack_102a8; char *pcStack_102a4; undefined4 uStack_102a0; char *pcStack_1029c; undefined4 uStack_10298; char *pcStack_10294; undefined4 uStack_10290; uint uStack_1028c; undefined1 auStack_10288 [4]; int *piStack_10284; undefined1 auStack_10280 [4]; int *piStack_1027c; undefined1 auStack_10278 [12]; undefined1 auStack_1026c [12]; float fStack_10260; float fStack_1025c; float fStack_10258; float fStack_10254; float fStack_10250; float fStack_1024c; float fStack_10248; float fStack_10244; undefined4 uStack_10240; float fStack_1023c; float *pfStack_10238; float *pfStack_10234; undefined2 uStack_10230; float fStack_10224; int *piStack_10220; byte *pbStack_1021c; uint uStack_10218; void *pvStack_10214; std_string *psStack_10210; std_string *psStack_1020c; std_string *psStack_10208; std_string *psStack_10204; float fStack_10200; RNG RStack_101fc; float *pfStack_101ec; float *pfStack_101e8; float *pfStack_101e4; float *pfStack_101e0; int *piStack_101dc; undefined4 *puStack_101d8; byte bStack_101d1; undefined1 auStack_101d0 [48]; undefined1 auStack_101a0 [65560]; FXParams local_188 [2]; void *local_e4 [3]; undefined1 local_d8 [4]; undefined4 local_d4; undefined1 *local_d0; byte *******local_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 local_bc; uint uStack_b8; byte *******local_b4; undefined4 uStack_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined4 local_a4; uint uStack_a0; byte *******local_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 local_8c; uint uStack_88; byte *******local_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; uint local_74; uint uStack_70; std_string local_6c; std_string local_54; byte *******local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; uint local_2c; uint uStack_28; uint local_24; std_string **ppsStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ppsStack_20 = (std_string **)((int)&local_54 + 0x50); local_14 = 0xffffffff; puStack_18 = &LAB_00b0d5ea; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)&local_54 + 0x44U; ExceptionList = &local_1c; pfStack_101e8 = param_1; in_ECX[3] = param_2; uStack_10218 = 0; in_ECX[4] = param_3; pfStack_101e0 = in_ECX; RStack_101fc._seed = Random(); pGVar28 = g_game; RStack_101fc._shift3 = 0x19; RStack_101fc._shift1 = 2; RStack_101fc._shift2 = 7; DAT_00c35e90 = 2; DAT_00c35e94 = 7; DAT_00c35e98 = 0x19; pvVar11 = g_game->_room; DAT_00c35e8c = (float)RStack_101fc._seed; in_ECX[0x2c] = *(float *)((int)pvVar11 + 0x14); in_ECX[0x2d] = *(float *)((int)pvVar11 + 0x18); in_ECX[0x2e] = *(float *)((int)pvVar11 + 0x1c); in_ECX[0x2f] = *(float *)((int)pvVar11 + 0x20); fVar26 = in_ECX[3]; uStack_1028c = RoomConfig::GetStageID((uint)fVar26,(uint)pfStack_101e0[4],-1); pfVar25 = pfStack_101e0; if ((pGVar28->_difficulty == 2) || (pGVar28->_difficulty == 3)) { if ((int)fVar26 < 5) { pfStack_101e0[3] = (float)((int)fVar26 * 2 + -1); } else { fVar7 = 0.0; if (fVar26 == 7.00649e-45) { fVar7 = 1.4013e-44; } pfStack_101e0[3] = fVar7; } } pfStack_101e0[5] = *(float *)((int)pGVar28->_room + 0x1d18); iVar8 = Level::get_secret_exit_kind((Level *)pGVar28); if ((iVar8 == 4) && (pGVar28->_currentRoomIdx == -10)) { pfVar25[3] = 9.80909e-45; pfVar25[4] = 0.0; } else { bVar5 = Level::IsMausoleumHeartStage((Level *)pGVar28); pGVar28 = g_game; if (bVar5 != 0) { pfVar25[5] = 5.46506e-44; } } if (pGVar28->_challenge == 0x2d) { uVar9 = pGVar28->_dungeonPlacementSeed; pbStack_1021c = (byte *)0xf; RStack_101fc._shift1 = 2; RStack_101fc._shift2 = 9; if ((int)pfStack_101e0[3] - 1U < 0xb) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = uVar9 >> 2 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; uVar9 = uVar9 >> 0xf ^ uVar9; pfStack_101e0[3] = (float)(uVar9 % 0xb + 1); } if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = uVar9 >> 2 ^ uVar9; uVar9 = uVar9 << 9 ^ uVar9; fVar26 = (float)((uVar9 >> 0xf ^ uVar9) % 5); if (fVar26 == 4.2039e-45) { fVar26 = 5.60519e-45; } pfStack_101e0[4] = fVar26; pfVar25 = pfStack_101e0; } iVar8 = *(int *)((int)pGVar28->_room + 4); if ((iVar8 == 0) || (iVar8 = *(int *)(iVar8 + 0x10), iVar8 == 0)) { switchD_00990cde_caseD_1: piStack_10220 = (int *)0x1; } else { switch(*(undefined4 *)(iVar8 + 0x48)) { case 1: case 2: case 3: goto switchD_00990cde_caseD_1; case 4: case 5: piStack_10220 = (int *)&DAT_00000004; break; case 6: case 7: piStack_10220 = (int *)&DAT_00000006; break; case 8: case 9: case 10: case 0xb: case 0xc: piStack_10220 = (int *)&DAT_00000008; break; default: piStack_10220 = (int *)&DAT_0000000d; } } clear(); *pfVar25 = g_vectorZero.x; pfVar25[1] = g_vectorZero.y; piVar10 = FileSystem::Open(&PTR_vftable_00c37a10,(byte *)pfStack_101e8,(int *)0x0); if (piVar10 == (int *)0x0) { ExceptionList = local_1c; return; } iVar8 = (**(code **)(*piVar10 + 4))(); pbStack_1021c = operator_new_tracked(iVar8 + 1); (**(code **)(*piVar10 + 0x14))(pbStack_1021c,1); pbStack_1021c[iVar8] = 0; (**(code **)*piVar10)(1); FUN_00413b90(); local_14 = 0; uVar41 = CONCAT44(pbStack_1021c,0x990db8); rapidxml::xml_document::parse(auStack_101d0,pbStack_1021c); pvVar11 = xml_node::first_node (auStack_101d0,(byte *)"fxLayers",(int)uVar41, (byte)((ulonglong)uVar41 >> 0x20)); local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_4_ = (std_string *)0x0; local_14 = CONCAT31(local_14._1_3_,1); pvVar12 = xml_node::first_attribute (pvVar11,&DAT_00b6987c,(uint)uVar41,(byte)((ulonglong)uVar41 >> 0x20)); if (pvVar12 != (void *)0x0) { pbVar22 = &g_xmlNullStr; if (*(byte **)((int)pvVar12 + 4) != (byte *)0x0) { pbVar22 = *(byte **)((int)pvVar12 + 4); } pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); uVar41 = CONCAT44((int)pbVar20 - (int)(pbVar22 + 1),pbVar22); std::string::assign(local_54._buf,pbVar22,(int)pbVar20 - (int)(pbVar22 + 1)); } pvStack_10214 = xml_node::first_node(pvVar11,&DAT_00b7d6b4,(int)uVar41,(byte)((ulonglong)uVar41 >> 0x20)); joined_r0x00990e3c: if (pvStack_10214 != (void *)0x0) { psStack_10210 = (std_string *)0x0; psStack_1020c = (std_string *)0x0; psStack_10204 = (std_string *)0x0; psStack_10208 = (std_string *)0x0; local_bc = 0; uStack_b8 = 0xf; local_cc = (byte *******)0x0; FXParams::FXParams((FXParams *)auStack_10278); local_14._0_1_ = 4; piStack_101dc = *(int **)((int)extraout_EDX + 0x20); auStack_10278._0_4_ = -1; uStack_10240._0_2_ = (ushort)(byte)uStack_10240; fStack_10260 = 1.4013e-45; fStack_10244 = 1.4013e-45; pvVar11 = extraout_EDX; if (piStack_101dc != (int *)0x0) { LAB_00990ec5: piVar10 = piStack_101dc; pbVar22 = (byte *)*piStack_101dc; pbVar21 = s_id; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_00990ef6: uVar9 = -(uint)bVar34 | 1; goto LAB_00990efb; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_00990ef6; pbVar20 = pbVar20 + 2; pbVar21 = pbVar21 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00990efb: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } auStack_10278._0_4_ = atoi((char *)pbVar22); goto LAB_009918f8; } pbVar21 = &DAT_00b66e0c; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_00990f50: uVar9 = -(uint)bVar34 | 1; goto LAB_00990f55; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_00990f50; pbVar20 = pbVar20 + 2; pbVar21 = pbVar21 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00990f55: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); psVar23 = (std_string *)(pbVar20 + -(int)(pbVar22 + 1)); if ((std_string *)(0x7fffffff - local_54._size) < psVar23) { LAB_00993701: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } psVar14 = &local_54; if (0xf < local_54._capacity) { psVar14 = (std_string *)local_54._buf._0_4_; } std::string::concat((char *)&local_9c,(int)pfStack_101ec,psVar23,(byte *)psVar14, local_54._size,pbVar22,(uint)psVar23); uStack_10218 = uStack_10218 | 1; if (0xf < uStack_b8) { uVar9 = uStack_b8 + 1; pppppppbVar13 = local_cc; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_cc[-1]; uVar9 = uStack_b8 + 0x24; if ((byte *)0x1f < (byte *)((int)local_cc + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } operator_delete(pppppppbVar13,uVar9); } local_cc = local_9c; local_9c = (byte *******)((uint)local_9c & 0xffffff00); uStack_c8 = uStack_98; uStack_c4 = uStack_94; uStack_c0 = uStack_90; local_bc = local_8c; uStack_b8 = uStack_88; local_8c = 0; uStack_88 = 0xf; goto LAB_009918f8; } pcVar31 = "numLayers"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00991053: uVar9 = -(uint)bVar34 | 1; goto LAB_00991058; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00991053; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991058: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } fStack_10260 = (float)atoi((char *)pbVar22); goto LAB_009918f8; } pbVar21 = &DAT_00b7d790; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_009910b0: uVar9 = -(uint)bVar34 | 1; goto LAB_009910b5; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_009910b0; pbVar20 = pbVar20 + 2; pbVar21 = pbVar21 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009910b5: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } dVar40 = atof((char *)pbVar22); fStack_1025c = (float)dVar40; goto LAB_009918f8; } pbVar21 = &DAT_00b7d798; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_00991110: uVar9 = -(uint)bVar34 | 1; goto LAB_00991115; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_00991110; pbVar21 = pbVar21 + 2; pbVar20 = pbVar20 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991115: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } dVar40 = atof((char *)pbVar22); fStack_10258 = (float)dVar40; goto LAB_009918f8; } pbVar21 = &DAT_00b7d7a0; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_00991170: uVar9 = -(uint)bVar34 | 1; goto LAB_00991175; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_00991170; pbVar21 = pbVar21 + 2; pbVar20 = pbVar20 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991175: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } dVar40 = atof((char *)pbVar22); fStack_10254 = (float)dVar40; goto LAB_009918f8; } pbVar21 = &DAT_00b7d7a8; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_009911d0: uVar9 = -(uint)bVar34 | 1; goto LAB_009911d5; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_009911d0; pbVar21 = pbVar21 + 2; pbVar20 = pbVar20 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009911d5: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } dVar40 = atof((char *)pbVar22); fStack_10250 = (float)dVar40; goto LAB_009918f8; } pcVar31 = "layer"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00991230: uVar9 = -(uint)bVar34 | 1; goto LAB_00991235; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00991230; pcVar31 = pcVar31 + 2; pbVar20 = pbVar20 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991235: if (uVar9 == 0) { local_2c = 0; pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } uStack_28 = 0xf; local_3c = (byte *******)0x0; pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); std::string::assign((char *)&local_3c,pbVar22,(int)pbVar20 - (int)(pbVar22 + 1)); local_14._0_1_ = 5; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c9431c) && (_Init_thread_header(), DAT_00c9431c == -1)) { local_14._0_1_ = 6; DAT_00c94320 = (undefined1 *)0x0; DAT_00c94324 = 0; DAT_00c94320 = operator_new(0x2c); *(undefined1 **)DAT_00c94320 = DAT_00c94320; *(undefined1 **)(DAT_00c94320 + 4) = DAT_00c94320; *(undefined1 **)(DAT_00c94320 + 8) = DAT_00c94320; *(undefined2 *)(DAT_00c94320 + 0xc) = 0x101; _atexit(FUN_00b16a00); local_14._0_1_ = 5; _Init_thread_footer(); } if (DAT_00c94324 == 0) { pcStack_102bc = "foreground"; uStack_102b8 = 1; FUN_00998240(auStack_102c4,&pcStack_102bc); pcStack_102b4 = "background"; uStack_102b0 = 2; FUN_00998240(auStack_102cc,&pcStack_102b4); pcStack_102ac = "behind"; uStack_102a8 = 3; FUN_00998240(auStack_102d4,&pcStack_102ac); pcStack_102a4 = "lighting"; uStack_102a0 = 4; FUN_00998240(auStack_102dc,&pcStack_102a4); pcStack_1029c = "underwater"; uStack_10298 = 5; FUN_00998240(auStack_102e4,&pcStack_1029c); pcStack_10294 = "overlay"; uStack_10290 = 6; FUN_00998240(auStack_102ec,&pcStack_10294); } std::map::lower_bound(local_d8,&local_3c); pppppppbVar4 = local_3c; puVar24 = local_d0; if (local_d0[0xd] == '\0') { pbVar22 = local_d0 + 0x10; if (0xf < *(uint *)(local_d0 + 0x24)) { pbVar22 = *(byte **)pbVar22; } pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } iVar8 = string_compare((byte *)pppppppbVar13,local_2c,pbVar22,*(uint *)(local_d0 + 0x20)); if (iVar8 < 0) goto LAB_009913e4; } else { LAB_009913e4: puVar24 = DAT_00c94320; } if (puVar24 == DAT_00c94320) { fStack_1024c = 0.0; } else { fStack_1024c = *(float *)(puVar24 + 0x28); } local_14._0_1_ = 4; if (0xf < uStack_28) { uVar9 = uStack_28 + 1; pppppppbVar13 = pppppppbVar4; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)pppppppbVar4[-1]; uVar9 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)pppppppbVar4 + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } goto LAB_009918d8; } } else { pcVar31 = "stage"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00991460: uVar9 = -(uint)bVar34 | 1; goto LAB_00991465; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00991460; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991465: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } iVar8 = atoi((char *)pbVar22); if (iVar8 == 0) { fStack_10248 = 0.0; } else if (iVar8 < 5) { fStack_10248 = (float)(iVar8 * 2 + -1); } else { fStack_10248 = (float)(iVar8 + 4); } goto LAB_009918f8; } pcVar31 = "altStages"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_009914e3: uVar9 = -(uint)bVar34 | 1; goto LAB_009914e8; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_009914e3; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009914e8: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } fStack_10244 = (float)atoi((char *)pbVar22); goto LAB_009918f8; } pcVar31 = "parallax"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00991540: uVar9 = -(uint)bVar34 | 1; goto LAB_00991545; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00991540; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991545: if (uVar9 == 0) { uStack_10240._0_2_ = CONCAT11(1,(byte)uStack_10240); pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } dVar40 = atof((char *)pbVar22); fStack_1023c = (float)dVar40; goto LAB_009918f8; } pcVar31 = "onlyDefaultBackdrop"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_009915a1: uVar9 = -(uint)bVar34 | 1; goto LAB_009915a6; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_009915a1; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009915a6: if (uVar9 != 0) { pcVar31 = "backdrop"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_009916e4: uVar9 = -(uint)bVar34 | 1; goto LAB_009916e9; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_009916e4; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009916e9: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } pfStack_10238 = (float *)atoi((char *)pbVar22); } else { pcVar31 = "blendMode"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00991740: uVar9 = -(uint)bVar34 | 1; goto LAB_00991745; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00991740; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991745: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } pfStack_10234 = (float *)atoi((char *)pbVar22); } else { pcVar31 = "useBGShader"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_009917a0: uVar9 = -(uint)bVar34 | 1; goto LAB_009917a5; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_009917a0; pcVar31 = pcVar31 + 2; pbVar20 = pbVar20 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009917a5: if (uVar9 == 0) { local_3c = (byte *******)0x0; local_2c = 0; pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } uStack_28 = 0xf; pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); std::string::assign((char *)&local_3c,pbVar22,(int)pbVar20 - (int)(pbVar22 + 1)); if (local_2c == 0) { LAB_009918a5: uStack_10230 = uStack_10230 & 0xff00; } else { pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } if (local_2c == 4) { if ((*pppppppbVar13 == (byte ******)0x65757274) || ((((bVar5 = (byte)*pppppppbVar13, bVar34 = bVar5 < 0x74, bVar5 == 0x74 && (bVar34 = *(byte *)((int)pppppppbVar13 + 1) < 0x72, *(byte *)((int)pppppppbVar13 + 1) == 0x72)) && (bVar34 = *(byte *)((int)pppppppbVar13 + 2) < 0x75, *(byte *)((int)pppppppbVar13 + 2) == 0x75)) && (bVar34 = *(byte *)((int)pppppppbVar13 + 3) < 0x65, *(byte *)((int)pppppppbVar13 + 3) == 0x65)))) { uVar9 = 0; } else { uVar9 = -(uint)bVar34 | 1; } if (uVar9 != 0) goto LAB_0099183d; } else { LAB_0099183d: pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } if (local_2c == 4) { if ((*pppppppbVar13 == (byte ******)0x65757254) || (((bVar5 = (byte)*pppppppbVar13, bVar34 = bVar5 < 0x54, bVar5 == 0x54 && (bVar34 = *(byte *)((int)pppppppbVar13 + 1) < 0x72, *(byte *)((int)pppppppbVar13 + 1) == 0x72)) && ((bVar34 = *(byte *)((int)pppppppbVar13 + 2) < 0x75, *(byte *)((int)pppppppbVar13 + 2) == 0x75 && (bVar34 = *(byte *)((int)pppppppbVar13 + 3) < 0x65, *(byte *)((int)pppppppbVar13 + 3) == 0x65)))))) { uVar9 = 0; } else { uVar9 = -(uint)bVar34 | 1; } if (uVar9 == 0) goto LAB_0099189c; } pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } iVar8 = atoi((char *)pppppppbVar13); if (iVar8 == 0) goto LAB_009918a5; } LAB_0099189c: uStack_10230 = CONCAT11(uStack_10230._1_1_,1); } goto LAB_009918b2; } } } goto LAB_009918f8; } local_3c = (byte *******)0x0; local_2c = 0; pbVar22 = &g_xmlNullStr; if ((byte *)piStack_101dc[1] != (byte *)0x0) { pbVar22 = (byte *)piStack_101dc[1]; } uStack_28 = 0xf; pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); std::string::assign((char *)&local_3c,pbVar22,(int)pbVar20 - (int)(pbVar22 + 1)); if (local_2c == 0) { LAB_009916a9: uStack_10240 = (float)((uint)uStack_10240 & 0xffffff00); } else { pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } if (local_2c == 4) { if ((*pppppppbVar13 == (byte ******)0x65757274) || (((bVar5 = (byte)*pppppppbVar13, bVar34 = bVar5 < 0x74, bVar5 == 0x74 && (bVar34 = *(byte *)((int)pppppppbVar13 + 1) < 0x72, *(byte *)((int)pppppppbVar13 + 1) == 0x72)) && ((bVar34 = *(byte *)((int)pppppppbVar13 + 2) < 0x75, *(byte *)((int)pppppppbVar13 + 2) == 0x75 && (bVar34 = *(byte *)((int)pppppppbVar13 + 3) < 0x65, *(byte *)((int)pppppppbVar13 + 3) == 0x65)))))) { uVar9 = 0; } else { uVar9 = -(uint)bVar34 | 1; } if (uVar9 != 0) goto LAB_0099163e; } else { LAB_0099163e: pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } if (local_2c == 4) { if ((*pppppppbVar13 == (byte ******)0x65757254) || ((((bVar5 = (byte)*pppppppbVar13, bVar34 = bVar5 < 0x54, bVar5 == 0x54 && (bVar34 = *(byte *)((int)pppppppbVar13 + 1) < 0x72, *(byte *)((int)pppppppbVar13 + 1) == 0x72)) && (bVar34 = *(byte *)((int)pppppppbVar13 + 2) < 0x75, *(byte *)((int)pppppppbVar13 + 2) == 0x75)) && (bVar34 = *(byte *)((int)pppppppbVar13 + 3) < 0x65, *(byte *)((int)pppppppbVar13 + 3) == 0x65)))) { uVar9 = 0; } else { uVar9 = -(uint)bVar34 | 1; } if (uVar9 == 0) goto LAB_0099169d; } pppppppbVar13 = (byte *******)&local_3c; if (0xf < uStack_28) { pppppppbVar13 = local_3c; } iVar8 = atoi((char *)pppppppbVar13); if (iVar8 == 0) goto LAB_009916a9; } LAB_0099169d: uStack_10240 = (float)CONCAT31(uStack_10240._1_3_,1); } LAB_009918b2: if (uStack_28 < 0x10) goto LAB_009918e0; uVar9 = uStack_28 + 1; pppppppbVar13 = local_3c; if (uVar9 < 0x1000) goto LAB_009918d8; pppppppbVar13 = (byte *******)local_3c[-1]; uVar9 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)pppppppbVar13))) goto LAB_00993307; LAB_009918d8: operator_delete(pppppppbVar13,uVar9); } LAB_009918e0: local_2c = 0; uStack_28 = 0xf; local_3c = (byte *******)((uint)local_3c & 0xffffff00); piVar10 = piStack_101dc; LAB_009918f8: if ((piVar10[4] == 0) || (piStack_101dc = (int *)piVar10[6], piStack_101dc == (int *)0x0)) goto LAB_0099190f; goto LAB_00990ec5; } goto LAB_00991915; } pfVar25 = pfStack_101e0 + 9; uVar41 = CONCAT44(0x9925b4,(int)uVar41); pfStack_101e4 = pfVar25; FUN_009973e0(); pvVar11 = xml_node::first_node (auStack_101d0,(byte *)"fxRays",(int)uVar41,(byte)((ulonglong)uVar41 >> 0x20)) ; psStack_10204 = xml_node::first_node (pvVar11,(byte *)"rayGroup",(int)uVar41,(byte)((ulonglong)uVar41 >> 0x20)); pGVar28 = g_game; joined_r0x009925de: g_game = pGVar28; if (psStack_10204 != (std_string *)0x0) { fStack_10258 = -100.0; fStack_10254 = 100.0; fStack_10250 = 0.1; fStack_1024c = 0.3; fStack_10248 = 100.0; fStack_10244 = 15.0; fStack_1023c = 0.0; pfStack_10238 = (float *)0x0; pfStack_10234 = (float *)0x0; uStack_10230 = 0; local_d4 = 0; local_d0 = &DAT_0000000f; local_e4[0] = (void *)0x0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14._0_1_ = 0xe; for (puVar32 = *(undefined4 **)(psStack_10204[1]._buf + 8); puVar32 != (undefined4 *)0x0; puVar32 = (undefined4 *)puVar32[6]) { pbVar20 = &DAT_00b7d790; pbVar22 = &g_xmlNullStr; if ((byte *)*puVar32 != (byte *)0x0) { pbVar22 = (byte *)*puVar32; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < *pbVar20; pbVar21 = (byte *)*puVar32; if (bStack_101d1 != *pbVar20) { LAB_009926bb: uVar9 = -(uint)bVar34 | 1; goto LAB_009926c0; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < pbVar20[1]; pbVar21 = (byte *)*puVar32; if (bStack_101d1 != pbVar20[1]) goto LAB_009926bb; pbVar22 = pbVar22 + 2; pbVar20 = pbVar20 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_009926c0: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_10258 = (float)dVar40; } else { pbVar20 = &DAT_00b7d798; pbVar22 = &g_xmlNullStr; if (pbVar21 != (byte *)0x0) { pbVar22 = pbVar21; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < *pbVar20; pbVar21 = (byte *)*puVar32; if (bStack_101d1 != *pbVar20) { LAB_0099272f: uVar9 = -(uint)bVar34 | 1; goto LAB_00992734; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < pbVar20[1]; pbVar21 = (byte *)*puVar32; if (bStack_101d1 != pbVar20[1]) goto LAB_0099272f; pbVar22 = pbVar22 + 2; pbVar20 = pbVar20 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_00992734: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_10254 = (float)dVar40; } else { pcVar31 = "topParallax"; pbVar22 = &g_xmlNullStr; if (pbVar21 != (byte *)0x0) { pbVar22 = pbVar21; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < (byte)*pcVar31; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != *pcVar31) { LAB_009927aa: uVar9 = -(uint)bVar34 | 1; goto LAB_009927af; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < (byte)pcVar31[1]; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != pcVar31[1]) goto LAB_009927aa; pbVar22 = pbVar22 + 2; pcVar31 = pcVar31 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_009927af: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_10250 = (float)dVar40; } else { pcVar31 = "bottomParallax"; pbVar22 = &g_xmlNullStr; if (pbVar20 != (byte *)0x0) { pbVar22 = pbVar20; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < (byte)*pcVar31; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != *pcVar31) { LAB_0099281e: uVar9 = -(uint)bVar34 | 1; goto LAB_00992823; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < (byte)pcVar31[1]; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != pcVar31[1]) goto LAB_0099281e; pbVar22 = pbVar22 + 2; pcVar31 = pcVar31 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_00992823: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_1024c = (float)dVar40; } else { pcVar31 = "rayLength"; pbVar22 = &g_xmlNullStr; if (pbVar20 != (byte *)0x0) { pbVar22 = pbVar20; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < (byte)*pcVar31; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != *pcVar31) { LAB_0099289a: uVar9 = -(uint)bVar34 | 1; goto LAB_0099289f; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < (byte)pcVar31[1]; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != pcVar31[1]) goto LAB_0099289a; pcVar31 = pcVar31 + 2; pbVar22 = pbVar22 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_0099289f: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_10248 = (float)dVar40; } else { pcVar31 = "raySpacing"; pbVar22 = &g_xmlNullStr; if (pbVar20 != (byte *)0x0) { pbVar22 = pbVar20; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < (byte)*pcVar31; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != *pcVar31) { LAB_0099290e: uVar9 = -(uint)bVar34 | 1; goto LAB_00992913; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < (byte)pcVar31[1]; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != pcVar31[1]) goto LAB_0099290e; pbVar22 = pbVar22 + 2; pcVar31 = pcVar31 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_00992913: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_10244 = (float)dVar40; } else { pcVar31 = "perspective"; pbVar22 = &g_xmlNullStr; if (pbVar20 != (byte *)0x0) { pbVar22 = pbVar20; } do { bStack_101d1 = *pbVar22; bVar34 = bStack_101d1 < (byte)*pcVar31; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != *pcVar31) { LAB_0099298a: uVar9 = -(uint)bVar34 | 1; goto LAB_0099298f; } if (bStack_101d1 == 0) break; bStack_101d1 = pbVar22[1]; bVar34 = bStack_101d1 < (byte)pcVar31[1]; pbVar20 = (byte *)*puVar32; if (bStack_101d1 != pcVar31[1]) goto LAB_0099298a; pcVar31 = pcVar31 + 2; pbVar22 = pbVar22 + 2; } while (bStack_101d1 != 0); uVar9 = 0; LAB_0099298f: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); uStack_10240 = (float)dVar40; } else { pcVar31 = "stages"; pbVar22 = &g_xmlNullStr; if (pbVar20 != (byte *)0x0) { pbVar22 = pbVar20; } do { bVar5 = *pbVar22; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_009929e1: uVar9 = -(uint)bVar34 | 1; goto LAB_009929e6; } if (bVar5 == 0) break; bVar5 = pbVar22[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_009929e1; pbVar22 = pbVar22 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_009929e6: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); std::string::assign((char *)local_e4,pbVar22,(int)pbVar20 - (int)(pbVar22 + 1) ); } } } } } } } } if (puVar32[4] == 0) break; } string_split(); local_14._0_1_ = 0xf; pvStack_10214 = (void *)0x0; iVar8 = (int)psStack_1020c - (int)psStack_10210 >> 0x1f; if (((int)psStack_1020c - (int)psStack_10210) / 0x18 + iVar8 != iVar8) { iVar8 = 0; do { pcVar31 = psStack_10210->_buf + iVar8; uVar9 = *(uint *)(pcVar31 + 0x10); pfStack_101e8 = (float *)0x0; if (0xf < *(uint *)(psStack_10210->_buf + iVar8 + 0x14)) { pcVar31 = *(char **)pcVar31; } if (pcVar31[uVar9 - 1] == 'b') { if (uVar9 < uVar9 - 1) goto LAB_00993706; FUN_00684f70(uVar9 - 1,1); uStack_10230 = CONCAT11(1,(char)uStack_10230); } pcVar31 = psStack_10210->_buf + iVar8; uVar9 = *(uint *)(pcVar31 + 0x10); if (0xf < *(uint *)(psStack_10210->_buf + iVar8 + 0x14)) { pcVar31 = *(char **)pcVar31; } if (pcVar31[uVar9 - 1] == 'a') { if (uVar9 < uVar9 - 1) { LAB_00993706: /* WARNING: Subroutine does not return */ FUN_00499950(); } FUN_00684f70(uVar9 - 1,1); pfStack_101e8 = (float *)0x1; } pcVar31 = psStack_10210->_buf + iVar8; if (0xf < *(uint *)(psStack_10210->_buf + iVar8 + 0x14)) { pcVar31 = *(char **)pcVar31; } atoi(pcVar31); cVar6 = stage_matches(); if (cVar6 != '\0') { uStack_10230 = CONCAT11(uStack_10230._1_1_,1); break; } iVar8 = iVar8 + 0x18; pvStack_10214 = (void *)((int)pvStack_10214 + 1); } while (pvStack_10214 < (void *)(((int)psStack_1020c - (int)psStack_10210) / 0x18)); } pcVar31 = "fxRay"; do { pcVar33 = pcVar31; pcVar31 = pcVar33 + 1; } while (*pcVar31 != '\0'); for (piStack_101dc = *(int **)psStack_10204[1]._buf; pfVar25 = pfStack_101e4, piStack_101dc != (int *)0x0; piStack_101dc = (int *)piStack_101dc[0xb]) { pbVar22 = (byte *)*piStack_101dc; if (pbVar22 == (byte *)0x0) { pcVar31 = (char *)0x0; pbVar22 = &g_xmlNullStr; } else { pcVar31 = (char *)piStack_101dc[2]; } if (pcVar31 == pcVar33 + -0xb7d853) { pbVar20 = pbVar22 + (int)pcVar31; if (pbVar20 <= pbVar22) goto joined_r0x00992bf5; iVar8 = (int)&DAT_00b7d854 - (int)pbVar22; while (*pbVar22 == pbVar22[iVar8]) { pbVar22 = pbVar22 + 1; if (pbVar20 <= pbVar22) goto joined_r0x00992bf5; } } } piStack_101dc = (int *)0x0; joined_r0x00992bf5: do { pfStack_101e4 = pfVar25; if (piStack_101dc == (int *)0x0) goto LAB_00993141; local_a4 = 0; uStack_a0 = 0xf; local_b4 = (byte *******)0x0; fStack_10200 = 0.5; RStack_101fc._seed = 0x3dcccccd; RStack_101fc._shift1 = 0; RStack_101fc._shift2 = 0; RStack_101fc._shift3 = 0; local_14._0_1_ = 0x11; if ((DAT_00c35e8c == 0.0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), DAT_00c35e8c == 0.0)) { pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = (uint)DAT_00c35e8c >> ((byte)DAT_00c35e90 & 0x1f) ^ (uint)DAT_00c35e8c; uVar9 = uVar9 << ((byte)DAT_00c35e94 & 0x1f) ^ uVar9; DAT_00c35e8c = (float)(uVar9 >> ((byte)DAT_00c35e98 & 0x1f) ^ uVar9); puVar32 = (undefined4 *)piStack_101dc[8]; RStack_101fc._shift1 = (int)((float)((double)(int)DAT_00c35e8c + __uint_to_double_fixup[-((int)DAT_00c35e8c >> 0x1f)]) * 2.3283062e-10 * 3.1415927); for (; puVar32 != (undefined4 *)0x0; puVar32 = (undefined4 *)puVar32[6]) { pbVar22 = (byte *)*puVar32; pbVar21 = &DAT_00b66e0c; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_00992d21: uVar9 = -(uint)bVar34 | 1; goto LAB_00992d26; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_00992d21; pbVar20 = pbVar20 + 2; pbVar21 = pbVar21 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00992d26: if (uVar9 == 0) { local_2c = 0; pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } uStack_28 = 0xf; local_3c = (byte *******)0x0; std::string::assign((char *)&local_3c,&DAT_00b7d85c,4); local_14._0_1_ = 0x12; pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); std::string::append((char *)&local_3c,pbVar22,(int)pbVar20 - (int)(pbVar22 + 1)); FUN_00417100(); uStack_10218 = uStack_10218 | 8; if (0xf < uStack_a0) { uVar9 = uStack_a0 + 1; pppppppbVar13 = local_b4; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_b4[-1]; uVar9 = uStack_a0 + 0x24; if ((byte *)0x1f < (byte *)((int)local_b4 + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } operator_delete(pppppppbVar13,uVar9); } local_b4 = local_9c; local_9c = (byte *******)((uint)local_9c & 0xffffff00); uStack_b0 = uStack_98; uStack_ac = uStack_94; uStack_a8 = uStack_90; local_a4 = local_8c; uStack_a0 = uStack_88; local_8c = 0; uStack_88 = 0xf; std::string::_Tidy_deallocate((char *)&local_9c); local_14._0_1_ = 0x11; if (0xf < uStack_28) { uVar9 = uStack_28 + 1; pppppppbVar13 = local_3c; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_3c[-1]; uVar9 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } operator_delete(pppppppbVar13,uVar9); } local_2c = 0; uStack_28 = 0xf; local_3c = (byte *******)((uint)local_3c & 0xffffff00); } else { pcVar31 = "opacity"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00992e90: uVar9 = -(uint)bVar34 | 1; goto LAB_00992e95; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00992e90; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00992e95: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); fStack_10200 = (float)dVar40; } else { pcVar31 = "animationSpeed"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00992ee4: uVar9 = -(uint)bVar34 | 1; goto LAB_00992ee9; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00992ee4; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00992ee9: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } dVar40 = atof((char *)pbVar22); RStack_101fc._seed = (int)(float)dVar40; } } } if (puVar32[4] == 0) break; } pppppppbVar13 = (byte *******)&local_b4; if (0xf < uStack_a0) { pppppppbVar13 = local_b4; } pvVar11 = Manager::LoadImage(auStack_10288,(byte *)pppppppbVar13); local_14._0_1_ = 0x13; piVar16 = KAGE::SmartPointer::operator_assign(auStack_10280,pvVar11); piVar10 = (int *)piVar16[1]; piVar16[1] = RStack_101fc._shift3; piVar27 = (int *)*piVar16; *piVar16 = RStack_101fc._shift2; RStack_101fc._shift2 = (int)piVar27; local_14._0_1_ = 0x14; RStack_101fc._shift3 = (int)piVar10; if (piStack_1027c != (int *)0x0) { cVar6 = (**(code **)(*piStack_1027c + 0xc))(); if ((cVar6 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } piVar27 = (int *)RStack_101fc._shift2; } local_14._0_1_ = 0x15; if (piStack_10284 != (int *)0x0) { cVar6 = (**(code **)(*piStack_10284 + 0xc))(); if ((cVar6 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } piVar27 = (int *)RStack_101fc._shift2; } local_14 = CONCAT31(local_14._1_3_,0x11); if ((piVar27 != (int *)0x0) && ((piVar27[0xe] != 1 || (piVar27[0xf] != 1)))) { (**(code **)(*piVar27 + 0x48))(1); piVar27[0xe] = 1; piVar27[0xf] = 1; } iVar8 = RStack_101fc._shift3; pfVar25 = pfStack_10238; if (pfStack_10238 == pfStack_10234) { std::vector<20byte>::_Emplace_reallocate(pfStack_10238,&fStack_10200); } else { pfVar29 = pfStack_10238 + 3; *pfStack_10238 = fStack_10200; pfStack_10238[1] = (float)RStack_101fc._seed; pfStack_10238[2] = (float)RStack_101fc._shift1; *pfVar29 = 0.0; pfStack_10238[4] = 0.0; pfStack_101ec = (float *)RStack_101fc._shift2; if (((int *)RStack_101fc._shift3 != (int *)0x0) && (cVar6 = (**(code **)(*(int *)RStack_101fc._shift3 + 4))(), cVar6 != '\0')) { piVar10 = (int *)pfVar25[4]; if ((piVar10 != (int *)0x0) && ((cVar6 = (**(code **)(*piVar10 + 0xc))(), cVar6 != '\0' && (g_imageReleaseFn != (void *)0x0)))) { (*g_imageReleaseFn)(); } pfVar25[4] = (float)iVar8; *pfVar29 = (float)pfStack_101ec; } pfStack_10238 = pfStack_10238 + 5; } local_14._0_1_ = 0x16; if ((((int *)RStack_101fc._shift3 != (int *)0x0) && (cVar6 = (**(code **)(*(int *)RStack_101fc._shift3 + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 0xf; if (0xf < uStack_a0) { uVar9 = uStack_a0 + 1; pppppppbVar13 = local_b4; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_b4[-1]; uVar9 = uStack_a0 + 0x24; if ((byte *)0x1f < (byte *)((int)local_b4 + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } operator_delete(pppppppbVar13,uVar9); } piStack_101dc = (int *)piStack_101dc[0xb]; pfVar25 = pfStack_101e4; } while( true ); } pfStack_101e0[0xc] = -NAN; iVar8 = *(int *)((int)pGVar28->_room + 4); RStack_101fc._seed = 0; if (iVar8 != 0) { RStack_101fc._seed = *(int *)(iVar8 + 0x58); } RStack_101fc._shift3 = (int)&DAT_00000007; RStack_101fc._shift1 = 5; RStack_101fc._shift2 = 9; uVar9 = ((int)pfVar25[1] - (int)*pfVar25) / 0x2c; if (uVar9 != 0) { fVar26 = (float)RNG::RandomInt(&RStack_101fc,uVar9); pGVar28 = g_game; pfStack_101e0[0xc] = fVar26; } pfVar25 = pfStack_101e0; if (((*(int *)((int)pGVar28->_room + 8) == 1) && (uVar9 = RNG::RandomInt(&RStack_101fc,((int)pfStack_101e0[3] < 3) + 2), uVar9 != 0)) && ((pfVar25[3] != 1.4013e-44 || (g_game->_stageType == 0)))) { pfVar25[0xc] = -NAN; } pvVar11 = FXParams::FXParams(local_188); uVar41 = CONCAT44(pvVar11,0x9932bc); FXParams::operator_assign(); pvVar11 = xml_node::first_node (auStack_101d0,(byte *)"fxParams",(int)uVar41, (byte)((ulonglong)uVar41 >> 0x20)); if (pvVar11 != (void *)0x0) { parse_fx_params_node(); } local_14._0_1_ = 0; if (0xf < local_54._capacity) { uVar9 = local_54._capacity + 1; psVar23 = (std_string *)local_54._buf._0_4_; if (0xfff < uVar9) { psVar23 = (std_string *)((std_string *)(local_54._buf._0_4_ + -0x18))->_capacity; uVar9 = local_54._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_54._buf._0_4_ + (-4 - (int)psVar23))) goto LAB_00993307; } operator_delete(psVar23,uVar9); } local_14 = 0x17; xml_memory_pool::clear(auStack_101a0); local_14 = 0x18; tracked_alloc(1,pbStack_1021c,0); iVar8 = 0; local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; this = (ANM2 *)(pfStack_101e0 + 0xb2); do { local_54._size = 0; local_54._capacity = 0xf; local_54._buf._0_4_ = (std_string *)0x0; std::string::assign(local_54._buf,(byte *)"gfx/Veins.anm2",0xe); local_14 = 0x19; ANM2::Load(this,&local_54,1); local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (0xf < local_54._capacity) { uVar9 = local_54._capacity + 1; psVar23 = (std_string *)local_54._buf._0_4_; if (0xfff < uVar9) { psVar23 = (std_string *)((std_string *)(local_54._buf._0_4_ + -0x18))->_capacity; uVar9 = local_54._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_54._buf._0_4_ + (-4 - (int)psVar23))) { LAB_00993307: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar23,uVar9); } pLVar17 = ANM2::GetLayer(this,(byte *)0x0); pLVar17->_minFilterMode = 1; pLVar17 = ANM2::GetLayer(this,(byte *)0x0); pfVar25 = pfStack_101e0; iVar8 = iVar8 + 1; this = this + 1; pLVar17->_magFilterMode = 1; if (1 < iVar8) { ANM2::Play((ANM2 *)(pfStack_101e0 + 0xb2),(byte *)"Vein1",0); ANM2::Play((ANM2 *)(pfVar25 + 0xf7),(byte *)"Vein2",0); pfStack_101e8 = (float *)0x0; pfStack_101e4 = pfVar25 + 0x3b; pfVar25[0x13c] = (pfVar25[0x2e] + pfVar25[0x2c]) * 0.5; pfVar25[0x13d] = (pfVar25[0x2d] + pfVar25[0x2f]) * 0.5; do { pfVar29 = pfStack_101e4; pfVar30 = pfStack_101e8; pfStack_101ec = (float *)pfVar25[0x2f]; fVar26 = pfVar25[0x2c]; fVar7 = pfVar25[0x2d]; fVar37 = pfVar25[0x2e] - fVar26; fVar36 = (float)pfStack_101ec - fVar7; fVar38 = fVar37 + fVar37; fVar35 = (fVar36 + fVar36 + fVar38) * ((float)(int)pfStack_101e8 / 10.0); if (fVar37 <= fVar35) { if (fVar36 + fVar37 <= fVar35) { if (fVar36 + fVar38 <= fVar35) { pfStack_101e4[-1] = fVar26; *pfStack_101e4 = (((fVar35 - fVar38) - fVar36) / fVar36) * fVar36 + fVar7; pfStack_101e4[-7] = 90.0; } else { *pfStack_101e4 = (float)pfStack_101ec; pfStack_101e4[-1] = (((fVar35 - fVar37) - fVar36) / fVar37) * fVar37 + fVar26; pfStack_101e4[-7] = 0.0; } } else { pfStack_101e4[-1] = pfVar25[0x2e]; *pfStack_101e4 = ((fVar35 - fVar37) / fVar36) * fVar36 + fVar7; pfStack_101e4[-7] = -90.0; } } else { *pfStack_101e4 = fVar7; pfStack_101e4[-1] = (fVar35 / fVar37) * fVar37 + fVar26; pfStack_101e4[-7] = 180.0; } RNG::Next((RNG *)&DAT_00c35e8c); pfStack_101ec = pfVar29 + -0xb; *pfStack_101ec = (float)((uint)DAT_00c35e8c & 1); if (pfVar29 != (float *)&DAT_0000002c) { pfVar29 = pfVar29 + -10; iVar8 = 3; do { FUN_00996e40(); operator_delete((void *)*pfVar29,0x34); *pfVar29 = 0.0; pfVar29 = pfVar29 + 1; iVar8 = iVar8 + -1; } while (iVar8 != 0); pfVar30 = pfStack_101e8; pfVar29 = pfStack_101e4; } if (((pfStack_101e0[3] == 1.26117e-44) && (pfStack_101e0[4] == 0.0)) && (*(int *)((int)g_game->_room + 8) == 5)) { grow_vein_branches(); } pfStack_101e8 = (float *)((int)pfVar30 + 1); pfStack_101e4 = pfVar29 + 0xd; pfVar25 = pfStack_101e0; } while ((int)pfStack_101e8 < 10); pfStack_101e0[0xd] = 0.0; Color::Reset((Color *)(pfStack_101e0 + 0x21)); *(undefined1 *)(pfStack_101e0 + 2) = 1; ExceptionList = local_1c; return; } } while( true ); LAB_0099190f: pvVar11 = pvStack_10214; LAB_00991915: pcVar31 = "gfx"; do { pcVar33 = pcVar31; pcVar31 = pcVar33 + 1; } while (*pcVar31 != '\0'); for (puStack_101d8 = *(undefined4 **)((int)pvVar11 + 0x18); puStack_101d8 != (undefined4 *)0x0; puStack_101d8 = (undefined4 *)puStack_101d8[0xb]) { pbVar22 = (byte *)*puStack_101d8; if (pbVar22 == (byte *)0x0) { pcVar31 = (char *)0x0; pbVar22 = &g_xmlNullStr; } else { pcVar31 = (char *)puStack_101d8[2]; } if (pcVar31 == pcVar33 + -0xb66feb) { pbVar20 = (byte *)(pcVar31 + (int)pbVar22); if (pbVar20 <= pbVar22) goto LAB_00991993; iVar8 = (int)&DAT_00b66fec - (int)pbVar22; while (*pbVar22 == pbVar22[iVar8]) { pbVar22 = pbVar22 + 1; if (pbVar20 <= pbVar22) goto LAB_00991993; } } } puStack_101d8 = (undefined4 *)0x0; LAB_00991993: if (puStack_101d8 != (undefined4 *)0x0) { do { uStack_70 = 0xf; local_74 = 0; local_84 = (byte *******)0x0; local_14._0_1_ = 7; puVar32 = (undefined4 *)puStack_101d8[8]; piStack_101dc = (int *)0x1; if (puVar32 != (undefined4 *)0x0) { do { pbVar22 = (byte *)*puVar32; pbVar21 = &DAT_00b66e0c; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < *pbVar21; if (bVar5 != *pbVar21) { LAB_00991a06: uVar9 = -(uint)bVar34 | 1; goto LAB_00991a0b; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < pbVar21[1]; if (bVar5 != pbVar21[1]) goto LAB_00991a06; pbVar20 = pbVar20 + 2; pbVar21 = pbVar21 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991a0b: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } pbVar20 = pbVar22; do { bVar5 = *pbVar20; pbVar20 = pbVar20 + 1; } while (bVar5 != 0); psVar23 = (std_string *)(pbVar20 + -(int)(pbVar22 + 1)); if ((std_string *)(0x7fffffff - local_54._size) < psVar23) goto LAB_00993701; psVar14 = &local_54; if (0xf < local_54._capacity) { psVar14 = (std_string *)local_54._buf._0_4_; } std::string::concat((char *)&local_3c,(int)pfStack_101ec,psVar23,(byte *)psVar14, local_54._size,pbVar22,(uint)psVar23); uStack_10218 = uStack_10218 | 2; if (0xf < uStack_70) { uVar9 = uStack_70 + 1; pppppppbVar13 = local_84; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_84[-1]; uVar9 = uStack_70 + 0x24; if ((byte *)0x1f < (byte *)((int)local_84 + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } operator_delete(pppppppbVar13,uVar9); } local_84 = local_3c; local_3c = (byte *******)((uint)local_3c & 0xffffff00); uStack_80 = uStack_38; uStack_7c = uStack_34; uStack_78 = uStack_30; local_74 = local_2c; uStack_70 = uStack_28; local_2c = 0; uStack_28 = 0xf; std::string::_Tidy_deallocate((char *)&local_3c); } else { pcVar31 = "roomshape"; pbVar20 = &g_xmlNullStr; if (pbVar22 != (byte *)0x0) { pbVar20 = pbVar22; } do { bVar5 = *pbVar20; bVar34 = bVar5 < (byte)*pcVar31; if (bVar5 != *pcVar31) { LAB_00991b46: uVar9 = -(uint)bVar34 | 1; goto LAB_00991b4b; } if (bVar5 == 0) break; bVar5 = pbVar20[1]; bVar34 = bVar5 < (byte)pcVar31[1]; if (bVar5 != pcVar31[1]) goto LAB_00991b46; pbVar20 = pbVar20 + 2; pcVar31 = pcVar31 + 2; } while (bVar5 != 0); uVar9 = 0; LAB_00991b4b: if (uVar9 == 0) { pbVar22 = &g_xmlNullStr; if ((byte *)puVar32[1] != (byte *)0x0) { pbVar22 = (byte *)puVar32[1]; } piStack_101dc = (int *)atoi((char *)pbVar22); } } } while ((puVar32[4] != 0) && (puVar32 = (undefined4 *)puVar32[6], puVar32 != (undefined4 *)0x0)); } puVar32 = puStack_101d8; psVar23 = psStack_1020c; if (piStack_10220 == piStack_101dc) { if (psStack_1020c == psStack_10204) { vector_string_emplace_reallocate(&psStack_10210,psStack_1020c,&local_84); psStack_10204 = psStack_10208; } else { std::string::string(psStack_1020c->_buf,&local_84); psStack_1020c = psVar23 + 1; } } local_14._0_1_ = 4; if (0xf < uStack_70) { uVar9 = uStack_70 + 1; pppppppbVar13 = local_84; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_84[-1]; uVar9 = uStack_70 + 0x24; if ((byte *)0x1f < (byte *)((int)local_84 + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } operator_delete(pppppppbVar13,uVar9); } puStack_101d8 = (undefined4 *)puVar32[0xb]; } while (puStack_101d8 != (undefined4 *)0x0); } psVar23 = psStack_1020c; iVar8 = (int)psStack_1020c - (int)psStack_10210 >> 0x1f; if (((int)psStack_1020c - (int)psStack_10210) / 0x18 + iVar8 == iVar8) { if (psStack_1020c == psStack_10204) { vector_string_emplace_reallocate(&psStack_10210,psStack_1020c,&local_cc); psStack_10204 = psStack_10208; } else { std::string::string(psStack_1020c->_buf,&local_cc); psStack_1020c = psVar23 + 1; } } pfVar25 = pfStack_101e0; pcVar31 = (char *)*(undefined8 *)(pfStack_101e0 + 3); cVar6 = stage_matches(); if (((cVar6 == '\0') || ((pfStack_10238 != (float *)0x0 && ((float *)pfVar25[5] != pfStack_10238)))) || (((byte)uStack_10240 != '\0' && (*(float *)(g_game->_ventricleRazorPortals + uStack_1028c * 0xc4 + 0x658) != pfVar25[5])))) goto LAB_009924a0; iVar8 = *(int *)((int)g_game->_room + 4); fVar26 = 0.0; if (iVar8 != 0) { fVar26 = *(float *)(iVar8 + 0x58); } piStack_101dc = (int *)&DAT_00000007; RStack_101fc._shift3 = (int)&DAT_00000007; pvVar11 = (void *)pfVar25[7]; RStack_101fc._shift1 = 5; RStack_101fc._shift2 = 9; RStack_101fc._seed = (int)fVar26; if (pvVar11 == (void *)pfVar25[8]) { std::vector::_Emplace_reallocate(pvVar11,auStack_10278); } else { FXLayer::copy_constructor(pvVar11,auStack_10278); pfVar25[7] = (float)((int)pfVar25[7] + 0x4c); } local_6c._size = 0; puStack_101d8 = (undefined4 *)pfVar25[7]; local_6c._capacity = 0xf; local_6c._buf._0_4_ = (std_string *)0x0; std::string::assign(local_6c._buf,&s_empty,0); psVar23 = psStack_10210; local_14._0_1_ = 8; uVar9 = ((int)psStack_1020c - (int)psStack_10210) / 0x18; if (uVar9 != 0) { uVar9 = RNG::RandomInt(&RStack_101fc,uVar9); psVar23 = psVar23 + uVar9; if (&local_6c != psVar23) { iVar8 = (int)&psVar23->_size; if (0xf < psVar23->_capacity) { psVar23 = *(std_string **)psVar23->_buf; } std::string::assign(local_6c._buf,(byte *)psVar23,*(uint *)iVar8); } piStack_101dc = (int *)RStack_101fc._shift3; fVar26 = (float)RStack_101fc._seed; } psVar23 = &local_6c; if (0xf < local_6c._capacity) { psVar23 = (std_string *)local_6c._buf._0_4_; } pvVar11 = Manager::LoadImage(auStack_10280,(byte *)psVar23); local_14._0_1_ = 9; dVar40 = (double)CONCAT44(pvVar11,0x991db0); puVar15 = KAGE::SmartPointer::operator_assign(auStack_10288,pvVar11); puVar32 = puStack_101d8; uVar1 = puVar15[1]; puVar15[1] = puStack_101d8[-0x11]; puStack_101d8[-0x11] = uVar1; uVar1 = *puVar15; *puVar15 = puStack_101d8[-0x12]; puStack_101d8[-0x12] = uVar1; local_14._0_1_ = 10; if (piStack_10284 != (int *)0x0) { dVar40 = (double)CONCAT44(0x991de9,SUB84(dVar40,0)); cVar6 = (**(code **)(*piStack_10284 + 0xc))(); if ((cVar6 != '\0') && (g_imageReleaseFn != (void *)0x0)) { dVar40 = 4.95779411346976e-317; (*g_imageReleaseFn)(); } } local_14._0_1_ = 0xb; if (piStack_1027c != (int *)0x0) { dVar40 = (double)CONCAT44(0x991e17,SUB84(dVar40,0)); cVar6 = (**(code **)(*piStack_1027c + 0xc))(); if ((cVar6 != '\0') && (g_imageReleaseFn != (void *)0x0)) { dVar40 = 4.95781684048947e-317; (*g_imageReleaseFn)(); } } local_14 = CONCAT31(local_14._1_3_,8); pfStack_101e8 = (float *)puVar32[-0x12]; if (pfStack_101e8 == (float *)0x0) { pcVar31 = "[warn] failed to load %s\n"; KAGE_LogMessage(1,(byte *)"[warn] failed to load %s\n"); } else { if ((pfStack_101e8[0xe] != 0.0) || (pfStack_101e8[0xf] != 0.0)) { dVar40 = 0.0; (**(code **)((int)*pfStack_101e8 + 0x48))(); pfStack_101e8[0xe] = 0.0; pfStack_101e8[0xf] = 0.0; } if (((*(char *)(puVar32 + -1) == '\0') && ((float)puVar32[-4] != 0.0)) && ((pfStack_101e8 = (float *)puVar32[-0x12], pfStack_101e8[0xc] != 1.4013e-45 || (pfStack_101e8[0xd] != 1.4013e-45)))) { dVar40 = 2.12199579145934e-314; (**(code **)((int)*pfStack_101e8 + 0x44))(); pfStack_101e8[0xc] = 1.4013e-45; pfStack_101e8[0xd] = 1.4013e-45; } pfStack_101e4 = (float *)puStack_101d8[-0xd]; pfStack_101e8 = (float *)((int)(puVar32[-0xf] - puVar32[-0x10]) / 0x14); if (pfStack_101e4 < pfStack_101e8) { iVar8 = puVar32[-0x10] + (int)pfStack_101e4 * 0x14; LAB_00991f42: puVar32[-0xf] = iVar8; } else if (pfStack_101e8 < pfStack_101e4) { if (pfStack_101e4 <= (float *)((int)(puVar32[-0xe] - puVar32[-0x10]) / 0x14)) { dVar40 = (double)CONCAT44(pfStack_101e8,(int)pfStack_101e4 - (int)pfStack_101e8); iVar8 = FUN_009981d0(puVar32[-0xf],(int)pfStack_101e4 - (int)pfStack_101e8,pfStack_101e8); goto LAB_00991f42; } dVar40 = (double)CONCAT44(&pfStack_101e8,pfStack_101e4); std::vector<20byte>::_Resize_reallocate(pfStack_101e4,&pfStack_101e8); } pcVar31 = SUB84(dVar40,0); pfStack_101e8 = (float *)0x0; if (0 < (int)puStack_101d8[-0xd]) { iVar8 = 0; do { if (fVar26 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } bVar5 = (byte)RStack_101fc._shift1; uVar9 = (uint)fVar26 >> (bVar5 & 0x1f) ^ (uint)fVar26; bVar18 = (byte)RStack_101fc._shift2; uVar9 = uVar9 << (bVar18 & 0x1f) ^ uVar9; bVar19 = (byte)piStack_101dc; uVar9 = uVar9 >> (bVar19 & 0x1f) ^ uVar9; *(float *)(puStack_101d8[-0x10] + 8 + iVar8) = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283062e-10 * ((float)puStack_101d8[-0xb] - (float)puStack_101d8[-0xc]) + (float)puStack_101d8[-0xc]; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = uVar9 >> (bVar5 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar18 & 0x1f) ^ uVar9; fVar26 = (float)(uVar9 >> (bVar19 & 0x1f) ^ uVar9); *(float *)(puStack_101d8[-0x10] + 0xc + iVar8) = ((float)puStack_101d8[-9] - (float)puStack_101d8[-10]) * (float)((double)(int)fVar26 + __uint_to_double_fixup[-((int)fVar26 >> 0x1f)]) * 2.3283062e-10 + (float)puStack_101d8[-10]; if (*(char *)((int)puStack_101d8 + -0x13) == '\0') { if (*(char *)(puStack_101d8 + -1) == '\0') { if (fVar26 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = (uint)fVar26 >> (bVar5 & 0x1f) ^ (uint)fVar26; uVar9 = uVar9 << (bVar18 & 0x1f) ^ uVar9; pfStack_101e4 = (float *)(uVar9 >> (bVar19 & 0x1f) ^ uVar9); piVar10 = puStack_101d8 + -0x10; *(float *)(*piVar10 + iVar8) = (float)((double)(int)pfStack_101e4 + __uint_to_double_fixup[-((int)pfStack_101e4 >> 0x1f)]) * 2.3283062e-10 * (float)((double)*(int *)(puStack_101d8[-0x12] + 0x10) + __uint_to_double_fixup[-(*(int *)(puStack_101d8[-0x12] + 0x10) >> 0x1f)]); if (pfStack_101e4 == (float *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = (uint)pfStack_101e4 >> (bVar5 & 0x1f) ^ (uint)pfStack_101e4; uVar9 = uVar9 << (bVar18 & 0x1f) ^ uVar9; pfStack_101e4 = (float *)(uVar9 >> (bVar19 & 0x1f) ^ uVar9); *(float *)(*piVar10 + 4 + iVar8) = (float)((double)(int)pfStack_101e4 + __uint_to_double_fixup[-((int)pfStack_101e4 >> 0x1f)]) * 2.3283062e-10 * (float)((double)*(int *)(puStack_101d8[-0x12] + 0x14) + __uint_to_double_fixup[-(*(int *)(puStack_101d8[-0x12] + 0x14) >> 0x1f)]); if (pfStack_101e4 == (float *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = (uint)pfStack_101e4 >> (bVar5 & 0x1f) ^ (uint)pfStack_101e4; uVar9 = uVar9 << (bVar18 & 0x1f) ^ uVar9; pfStack_101e4 = (float *)(uVar9 >> (bVar19 & 0x1f) ^ uVar9); *(bool *)(*piVar10 + 0x10 + iVar8) = (float)((double)(int)pfStack_101e4 + __uint_to_double_fixup[-((int)pfStack_101e4 >> 0x1f)]) * 2.3283062e-10 < 0.5 ; if (pfStack_101e4 == (float *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } uVar9 = (uint)pfStack_101e4 >> (bVar5 & 0x1f) ^ (uint)pfStack_101e4; uVar9 = uVar9 << (bVar18 & 0x1f) ^ uVar9; fVar26 = (float)(uVar9 >> (bVar19 & 0x1f) ^ uVar9); *(bool *)(puStack_101d8[-0x10] + 0x11 + iVar8) = (float)((double)(int)fVar26 + __uint_to_double_fixup[-((int)fVar26 >> 0x1f)]) * 2.3283062e-10 < 0.5; } else { *(undefined4 *)(puStack_101d8[-0x10] + iVar8) = 0; *(undefined4 *)(puStack_101d8[-0x10] + 4 + iVar8) = 0; *(undefined1 *)(puStack_101d8[-0x10] + 0x10 + iVar8) = 0; *(undefined1 *)(puStack_101d8[-0x10] + 0x11 + iVar8) = 0; } } else if (*(char *)((int)puStack_101d8 + -0x13) == '\x01') { *(undefined4 *)(puStack_101d8[-0x10] + 8 + iVar8) = 0; *(undefined4 *)(puStack_101d8[-0x10] + 0xc + iVar8) = 0; pfStack_101ec = (float *)((pfStack_101e0[1] - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5); pfStack_101e4 = (float *)(g_displayPixelRatio * g_screenPointScale); fStack_10224 = ((*pfStack_101e0 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * (float)pfStack_101e4 + 0.5; dVar40 = floor((double)fStack_10224); fStack_10224 = (float)dVar40 / (float)pfStack_101e4; pfStack_101ec = (float *)((float)pfStack_101ec * (float)pfStack_101e4 + 0.5); dVar40 = (double)(float)pfStack_101ec; dVar39 = floor(dVar40); pfStack_101ec = (float *)(float)dVar39; iVar2 = puStack_101d8[-0x10]; fVar7 = (float)puStack_101d8[-4]; *(float *)(iVar8 + iVar2) = fStack_10224 * (float)puStack_101d8[-4] + *(float *)(iVar8 + 8 + iVar2); *(float *)(iVar8 + 4 + iVar2) = ((float)pfStack_101ec / (float)pfStack_101e4) * fVar7 + *(float *)(iVar8 + 0xc + iVar2); } pcVar31 = SUB84(dVar40,0); iVar8 = iVar8 + 0x14; pfStack_101e8 = (float *)((int)pfStack_101e8 + 1); } while ((int)pfStack_101e8 < (int)puStack_101d8[-0xd]); } } local_14._0_1_ = 4; if (0xf < local_6c._capacity) { uVar9 = local_6c._capacity + 1; pcVar31 = (char *)local_6c._buf._0_4_; if (0xfff < uVar9) { pcVar31 = (char *)((std_string *)(local_6c._buf._0_4_ + -0x18))->_capacity; uVar9 = local_6c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_6c._buf._0_4_ + (-4 - (int)pcVar31))) goto LAB_00993307; } operator_delete(pcVar31,uVar9); } local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = local_6c._buf._0_4_ & 0xffffff00; LAB_009924a0: uVar41 = CONCAT44(0x9924ab,pcVar31); FID_conflict__Tidy(auStack_1026c); local_14._0_1_ = 0xc; if ((int *)auStack_10278._8_4_ != (int *)0x0) { uVar41 = CONCAT44(0x9924c0,(int)uVar41); cVar6 = (**(code **)(*(int *)auStack_10278._8_4_ + 0xc))(); if ((cVar6 != '\0') && (g_imageReleaseFn != (void *)0x0)) { uVar41 = 0x9924d6; (*g_imageReleaseFn)(); } } local_14._0_1_ = 2; if (0xf < uStack_b8) { uVar9 = uStack_b8 + 1; pppppppbVar13 = local_cc; if (0xfff < uVar9) { pppppppbVar13 = (byte *******)local_cc[-1]; uVar9 = uStack_b8 + 0x24; if ((byte *)0x1f < (byte *)((int)local_cc + (-4 - (int)pppppppbVar13))) goto LAB_00993307; } uVar41 = CONCAT44(uVar9,pppppppbVar13); operator_delete(pppppppbVar13,uVar9); } psVar14 = psStack_1020c; local_14 = CONCAT31(local_14._1_3_,1); psVar23 = psStack_10210; if (psStack_10210 != (std_string *)0x0) { for (; psVar23 != psVar14; psVar23 = psVar23 + 1) { std::string::_Tidy_deallocate(psVar23->_buf); } uVar9 = ((int)psStack_10204 - (int)psStack_10210) / 0x18; uVar41 = CONCAT44(uVar9,psStack_10210); deallocate(psStack_10210,uVar9); psStack_10210 = (std_string *)0x0; psStack_1020c = (std_string *)0x0; psStack_10208 = (std_string *)0x0; } pvStack_10214 = *(void **)((int)pvStack_10214 + 0x2c); goto joined_r0x00990e3c; LAB_00993141: if ((char)uStack_10230 != '\0') { if (pfVar25[1] == pfVar25[2]) { std::vector<44byte>::_Emplace_reallocate(pfVar25[1],&fStack_10258); } else { FXLayerGroup::copy_constructor(); pfVar25[1] = (float)((int)pfVar25[1] + 0x2c); } } std::vector::_Tidy(); local_14._0_1_ = 0xd; if (&DAT_0000000f < local_d0) { puVar24 = local_d0 + 1; pvVar11 = local_e4[0]; if ((undefined1 *)0xfff < puVar24) { pvVar11 = *(void **)((int)local_e4[0] + -4); puVar24 = local_d0 + 0x24; if (0x1f < (uint)((int)local_e4[0] + (-4 - (int)pvVar11))) goto LAB_00993307; } operator_delete(pvVar11,(uint)puVar24); } local_14 = CONCAT31(local_14._1_3_,1); std::vector<20byte>::_Tidy(); psStack_10204 = (std_string *)psStack_10204[1]._capacity; pGVar28 = g_game; goto joined_r0x009925de; } //@@ 00993730 FUN_00993730 void FUN_00993730(void) { std::vector<20byte>::_Tidy(); return; } //@@ 00993740 FUN_00993740 void FUN_00993740(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 0x10) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x10) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0xc); } } ExceptionList = local_10; return; } //@@ 009937b0 FXParams::operator_assign /* DB: member-wise copy of the 0xa0-byte FXParams (0x28 dwords); FXLayers::clear and LoadConfig assign a fresh FXParams::FXParams() to this */ void FXParams::operator_assign(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; in_ECX[4] = param_1[4]; in_ECX[5] = param_1[5]; in_ECX[6] = param_1[6]; *(undefined1 *)(in_ECX + 7) = *(undefined1 *)(param_1 + 7); uVar1 = param_1[9]; uVar2 = param_1[10]; uVar3 = param_1[0xb]; in_ECX[8] = param_1[8]; in_ECX[9] = uVar1; in_ECX[10] = uVar2; in_ECX[0xb] = uVar3; in_ECX[0xc] = param_1[0xc]; uVar1 = param_1[0xe]; uVar2 = param_1[0xf]; uVar3 = param_1[0x10]; in_ECX[0xd] = param_1[0xd]; in_ECX[0xe] = uVar1; in_ECX[0xf] = uVar2; in_ECX[0x10] = uVar3; in_ECX[0x11] = param_1[0x11]; in_ECX[0x12] = param_1[0x12]; uVar1 = param_1[0x14]; uVar2 = param_1[0x15]; uVar3 = param_1[0x16]; in_ECX[0x13] = param_1[0x13]; in_ECX[0x14] = uVar1; in_ECX[0x15] = uVar2; in_ECX[0x16] = uVar3; in_ECX[0x17] = param_1[0x17]; uVar1 = param_1[0x19]; uVar2 = param_1[0x1a]; uVar3 = param_1[0x1b]; in_ECX[0x18] = param_1[0x18]; in_ECX[0x19] = uVar1; in_ECX[0x1a] = uVar2; in_ECX[0x1b] = uVar3; in_ECX[0x1c] = param_1[0x1c]; if (in_ECX + 0x1d != param_1 + 0x1d) { uVar1 = param_1[0x1e]; uVar2 = param_1[0x1f]; uVar3 = param_1[0x20]; in_ECX[0x1d] = param_1[0x1d]; in_ECX[0x1e] = uVar1; in_ECX[0x1f] = uVar2; in_ECX[0x20] = uVar3; uVar1 = param_1[0x22]; uVar2 = param_1[0x23]; uVar3 = param_1[0x24]; in_ECX[0x21] = param_1[0x21]; in_ECX[0x22] = uVar1; in_ECX[0x23] = uVar2; in_ECX[0x24] = uVar3; *(undefined8 *)(in_ECX + 0x25) = *(undefined8 *)(param_1 + 0x25); in_ECX[0x27] = param_1[0x27]; } return; } //@@ 00993840 FXLayers::clear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: releases every layer's texture smart pointers (FUN_0040c7f0(0)) in the 0x2c-byte layer vector (+0x24) and its 0x14-byte entries, destroys the layers (FUN_009975c0), clears the 0x4c-byte vector at +0x18 and the 10x3 0x34-byte objects at +0xc0; Room::LoadBackdropGraphics, FXLayers::LoadConfig */ void FXLayers::clear(void) { void *pvVar1; int in_ECX; int iVar2; int *piVar3; uint uVar4; int iVar5; undefined4 *puVar6; int iVar7; undefined1 auStack_c4 [4]; undefined4 *local_c0; int local_bc; int local_b8; uint local_b4; FXParams local_b0 [2]; uint local_c; local_c = __security_cookie ^ (uint)auStack_c4; *(undefined1 *)(in_ECX + 8) = 0; iVar7 = *(int *)(in_ECX + 0x28); iVar5 = *(int *)(in_ECX + 0x24); local_c0 = (undefined4 *)0x0; iVar2 = iVar7 - iVar5 >> 0x1f; if ((iVar7 - iVar5) / 0x2c + iVar2 != iVar2) { local_b8 = 0; do { local_b4 = 0; iVar2 = *(int *)(local_b8 + 0x20 + iVar5) - *(int *)(local_b8 + 0x1c + iVar5); iVar7 = iVar2 >> 0x1f; if (iVar2 / 0x14 + iVar7 != iVar7) { local_bc = 0; do { piVar3 = (int *)(local_bc + 0xc + *(int *)(local_b8 + 0x1c + iVar5)); if (*piVar3 != 0) { KAGE::SmartPointer::reset(piVar3,(void *)0x0); iVar5 = *(int *)(in_ECX + 0x24); } local_bc = local_bc + 0x14; local_b4 = local_b4 + 1; } while (local_b4 < (uint)((*(int *)(local_b8 + 0x20 + iVar5) - *(int *)(local_b8 + 0x1c + iVar5)) / 0x14)); } iVar7 = *(int *)(in_ECX + 0x28); local_c0 = (undefined4 *)((int)local_c0 + 1); local_b8 = local_b8 + 0x2c; } while (local_c0 < (uint)((iVar7 - iVar5) / 0x2c)); local_bc = iVar7; } if (iVar5 != iVar7) { do { std::vector<20byte>::_Tidy(); iVar5 = iVar5 + 0x2c; } while (iVar5 != iVar7); iVar5 = *(int *)(in_ECX + 0x24); } *(int *)(in_ECX + 0x28) = iVar5; iVar7 = *(int *)(in_ECX + 0x18); local_c0 = (undefined4 *)0x0; uVar4 = *(int *)(in_ECX + 0x1c) - iVar7; if ((int)uVar4 / 0x4c + ((int)uVar4 >> 0x1f) != (int)uVar4 >> 0x1f) { iVar5 = 0; do { piVar3 = (int *)(iVar7 + 4 + iVar5); if (*piVar3 != 0) { KAGE::SmartPointer::reset(piVar3,(void *)0x0); } iVar7 = *(int *)(in_ECX + 0x18); iVar5 = iVar5 + 0x4c; uVar4 = (int)local_c0 + 1; local_c0 = (undefined4 *)uVar4; } while (uVar4 < (uint)((*(int *)(in_ECX + 0x1c) - iVar7) / 0x4c)); } std::_Destroy_range(uVar4); *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(in_ECX + 0x18); local_c0 = (undefined4 *)(in_ECX + 0xc0); local_bc = 10; do { if (local_c0 != (undefined4 *)0x0) { iVar7 = 3; puVar6 = local_c0; do { puVar6 = puVar6 + 1; FUN_00996e40(*puVar6); operator_delete((void *)*puVar6,0x34); *puVar6 = 0; iVar7 = iVar7 + -1; } while (iVar7 != 0); } local_c0 = local_c0 + 0xd; local_bc = local_bc + -1; } while (local_bc != 0); pvVar1 = FXParams::FXParams(local_b0); FXParams::operator_assign(pvVar1); return; } //@@ 00993a70 Camera::Update /* DB: ? LerpAngleDeg/atan2, Room::Update and generate_greed prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Camera::Update(Camera *this,byte isSnap) { int iVar1; uint entityIndex; int iVar2; float *pfVar3; byte *fxSprite; float fVar4; float fVar5; float veinScale; double dVar6; float local_2c; int local_28; uint local_24; int particleIndex; float *local_1c; Vector scratchVec; uint entityCount; Game *game; char layerMode; if (this->_aimOffsetBuffer[8] != 0) { local_1c = *(float **)(this->_velocityOffsetBuffer + 8); iVar2 = *(int *)(this->_velocityOffsetBuffer + 0xc) - (int)local_1c; local_24 = 0; iVar1 = iVar2 >> 0x1f; if (iVar2 / 0x4c + iVar1 != iVar1) { local_2c = 0.0; do { pfVar3 = local_1c; layerMode = *(char *)((int)local_1c + 0x39 + (int)local_2c); if (layerMode == '\0') { particleIndex = 0; if (0 < *(int *)((int)local_1c + 0x18 + (int)local_2c)) { local_28 = 0; do { iVar1 = *(int *)((int)local_1c + 0xc + (int)local_2c); iVar2 = *(int *)(*(int *)((int)local_1c + 4 + (int)local_2c) + 0x10); fVar4 = fmodf(*(float *)(local_28 + iVar1) - *(float *)(local_28 + 8 + iVar1), (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])); *(float *)(local_28 + iVar1) = fVar4; iVar1 = *(int *)((int)local_1c + 0xc + (int)local_2c); iVar2 = *(int *)(*(int *)((int)local_1c + 4 + (int)local_2c) + 0x14); fVar4 = fmodf(*(float *)(local_28 + 0xc + iVar1) + *(float *)(local_28 + 4 + iVar1), (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])); particleIndex = particleIndex + 1; *(float *)(local_28 + 4 + iVar1) = fVar4; local_28 = local_28 + 0x14; } while (particleIndex < *(int *)((int)local_1c + 0x18 + (int)local_2c)); } } else if ((layerMode == '\x01') && (local_28 = 0, 0 < *(int *)((int)local_1c + 0x18 + (int)local_2c))) { local_1c = (float *)(*(int *)((int)local_1c + 0xc + (int)local_2c) + 8); do { fVar5 = g_displayPixelRatio * g_screenPointScale; dVar6 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (*(float *)this->_aimOffsetBuffer - 60.0) * 0.65) * fVar5 + 0.5)) ; scratchVec.x = (float)dVar6 / fVar5; dVar6 = floor((double)(((g_screenHeight - 182.0) * 0.5 + (*(float *)(this->_aimOffsetBuffer + 4) - 140.0) * 0.65) * fVar5 + 0.5)); local_28 = local_28 + 1; fVar4 = *(float *)((int)pfVar3 + 0x3c + (int)local_2c); local_1c[-2] = scratchVec.x * *(float *)((int)pfVar3 + 0x3c + (int)local_2c) + *local_1c ; local_1c[-1] = ((float)dVar6 / fVar5) * fVar4 + local_1c[1]; local_1c = local_1c + 5; } while (local_28 < *(int *)((int)pfVar3 + 0x18 + (int)local_2c)); } local_1c = *(float **)(this->_velocityOffsetBuffer + 8); local_2c = (float)((int)local_2c + 0x4c); local_24 = local_24 + 1; } while (local_24 < (uint)((*(int *)(this->_velocityOffsetBuffer + 0xc) - (int)local_1c) / 0x4c)); } if (0 < *(int *)(this->_playerSpreadBuffer + 4)) { local_1c = (float *)0x0; iVar1 = *(int *)this->_focusPositionBuffer; *(int *)(this->_playerSpreadBuffer + 4) = *(int *)(this->_playerSpreadBuffer + 4) + -1; if (0 < iVar1) { local_24 = 0; do { iVar1 = *(int *)(this->_shakeOffsetBuffer + 4); iVar2 = *(int *)(*(int *)(this->_playerSpreadBuffer + 0xc) + 0x10); fVar4 = fmodf(*(float *)(iVar1 + local_24) - *(float *)(iVar1 + 8 + local_24), (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])); *(float *)(iVar1 + local_24) = fVar4; iVar1 = *(int *)(this->_shakeOffsetBuffer + 4); iVar2 = *(int *)(*(int *)(this->_playerSpreadBuffer + 0xc) + 0x14); fVar4 = fmodf(*(float *)(iVar1 + 0xc + local_24) + *(float *)(iVar1 + 4 + local_24), (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])); local_1c = (float *)((int)local_1c + 1); *(float *)(iVar1 + 4 + local_24) = fVar4; local_24 = local_24 + 0x14; } while ((int)local_1c < *(int *)this->_focusPositionBuffer); } } game = g_game; if (*(int *)this[1]._playerSpreadBuffer != 0) { fVar4 = *(float *)this[8]._focusPositionBuffer; fVar5 = *(float *)this->_aimOffsetBuffer; local_2c = 0.0; *(float *)(this[8]._focusPositionBuffer + 4) = (*(float *)(this->_aimOffsetBuffer + 4) - *(float *)(this[8]._focusPositionBuffer + 4)) * 0.03 + *(float *)(this[8]._focusPositionBuffer + 4); *(float *)this[8]._focusPositionBuffer = (fVar5 - fVar4) * 0.03 + fVar4; entityIndex = 0; entityCount = *(uint *)((int)game->_room + 0x1264); if (entityCount != 0) { do { iVar1 = *(int *)(*(int *)((int)game->_room + 0x125c) + entityIndex * 4); if ((*(int *)(iVar1 + 0x28) == 0x197) && (*(int *)(iVar1 + 0x2c) == 0)) { local_2c = 1.0 - *(float *)(iVar1 + 0x380) / *(float *)(iVar1 + 900); if (local_2c <= 0.0) { local_2c = 0.0; } if (1.0 <= local_2c) { local_2c = 1.0; } break; } entityIndex = entityIndex + 1; } while (entityIndex < entityCount); } local_1c = (float *)0xa; pfVar3 = (float *)(this[1]._focusPositionBuffer + 4); do { fVar5 = *(float *)(this[8]._focusPositionBuffer + 4) - pfVar3[1]; scratchVec.x = *(float *)this[8]._focusPositionBuffer - *pfVar3; fVar4 = sqrtf(fVar5 * fVar5 + scratchVec.x * scratchVec.x); veinScale = fVar4 * 0.004; if (veinScale <= 1.0) { veinScale = 1.0; } if (10.0 <= veinScale) { veinScale = 10.0; } pfVar3[-4] = veinScale; fVar5 = atan2f(fVar5,scratchVec.x); fVar5 = fVar5 * 57.295776 + 90.0; if (360.0 < ABS(fVar5)) { fVar5 = fmodf(fVar5,360.0); } if (fVar5 <= 180.0) { if (fVar5 < -180.0) { fVar5 = fVar5 + 360.0; } } else { fVar5 = fVar5 - 360.0; } fVar5 = LerpAngleDeg(pfVar3[-6],fVar5,0.3); pfVar3[-5] = fVar5; pfVar3[-3] = 1.0; fVar4 = (fVar4 - 5.0) * 0.002; if (fVar4 <= 0.2) { fVar4 = 0.2; } if (2.0 <= fVar4) { fVar4 = 2.0; } pfVar3[-2] = fVar4 * local_2c * local_2c; FXLayers::update_vein_branch(); pfVar3 = pfVar3 + 0xd; local_1c = (float *)((int)local_1c + -1); } while (local_1c != (float *)0x0); fxSprite = this[6]._focusPositionBuffer + 9; if (local_2c <= 0.25) { local_2c = 0.25; } local_1c = (float *)0x2; do { *(float *)(fxSprite + -5) = local_2c; if (*fxSprite != 0) { AnimationState::Update((AnimationState *)(fxSprite + -0xd9)); AnimationState::Update((AnimationState *)(fxSprite + -0xb9)); } fxSprite = fxSprite + 0x114; local_1c = (float *)((int)local_1c + -1); } while (local_1c != (float *)0x0); } if (((*(float *)this->_aimOffsetBuffer != g_vectorZero.x) || (*(float *)(this->_aimOffsetBuffer + 4) != g_vectorZero.y)) && (isSnap == 0)) { players_center_position(&g_game->_playerManager,&scratchVec,1); *(float *)this->_aimOffsetBuffer = (scratchVec.x - *(float *)this->_aimOffsetBuffer) * 0.1 + *(float *)this->_aimOffsetBuffer; *(float *)(this->_aimOffsetBuffer + 4) = (scratchVec.y - *(float *)(this->_aimOffsetBuffer + 4)) * 0.1 + *(float *)(this->_aimOffsetBuffer + 4); return; } players_center_position(&g_game->_playerManager,&scratchVec,0); *(float *)this->_aimOffsetBuffer = scratchVec.x; *(float *)(this->_aimOffsetBuffer + 4) = scratchVec.y; } return; } //@@ 00994120 FXLayers::render_layer /* DB: (layer index) the shared draw of one _fxLayers entry ("WrapSize" null frame); callers FXLayers::Render (type 1) and the type 2/3/6 render passes prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall FXLayers::render_layer(FXLayers *this,int layerIndex) { char cVar1; int iVar2; char *pcVar3; int iVar4; Game *pGVar5; undefined *puVar6; int iVar7; int iVar8; void *pvVar9; float fVar10; double dVar11; undefined1 local_118 [112]; undefined4 local_a8; undefined4 uStack_a4; undefined4 uStack_a0; undefined4 uStack_9c; undefined4 local_98; float local_94; float local_90; Vector local_8c; KColor local_84; float local_70; float fStack_6c; float fStack_68; float fStack_64; float local_60; float fStack_5c; float fStack_58; float fStack_54; undefined4 local_50; void *local_4c; float local_48; float local_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; undefined4 local_20; float local_1c; FXLayers *local_18; float local_14; local_18 = this; local_48 = Room::GetLightingAlpha(g_game->_room); local_48 = local_48 * 0.1; local_4c = g_currentShader; iVar8 = layerIndex * 0x4c + *(int *)&local_18->field_0x18; if (*(char *)(iVar8 + 0x48) != '\0') { puVar6 = &DAT_00c79528; if ((DAT_00c7952c & 1) == 0) { puVar6 = g_currentShader; } g_currentShader = puVar6; } pvVar9 = g_currentShader; local_1c = g_displayPixelRatio * g_screenPointScale; local_14 = (((*(float *)&local_18->field_0xb8 + *(float *)&local_18->field_0xb0) * 0.5 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_1c + 0.5; dVar11 = floor((double)local_14); local_44 = (float)dVar11 / local_1c; local_14 = (((*(float *)&local_18->field_0xbc + *(float *)&local_18->field_0xb4) * 0.5 - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_1c + 0.5; dVar11 = floor((double)local_14); local_14 = (float)dVar11 / local_1c; local_1c = 0.0; if (0 < *(int *)(iVar8 + 0x18)) { local_18 = (FXLayers *)0x0; do { pGVar5 = g_game; iVar7 = *(int *)(iVar8 + 4); dVar11 = (double)*(int *)(iVar7 + 0x10); iVar4 = *(int *)(iVar7 + 0x10) >> 0x1f; if (*(int *)(iVar8 + 0x2c) == 6) { local_30 = g_vectorZero.x; fStack_34 = g_vectorZero.y; fStack_68 = (float)(dVar11 + __uint_to_double_fixup[-iVar4]) + g_vectorZero.x; fStack_5c = (float)((double)*(int *)(iVar7 + 0x14) + __uint_to_double_fixup[-(*(int *)(iVar7 + 0x14) >> 0x1f)]) + g_vectorZero.y; } else { iVar2 = *(int *)(iVar8 + 0xc); local_30 = ((*(float *)((int)g_game->_room + 0x1204) + (g_game->_screenShakeOffset).x) - (float)(dVar11 + __uint_to_double_fixup[-iVar4]) * 0.5) + local_44; cVar1 = *(char *)(iVar2 + 0x10 + (int)local_18); fStack_34 = (((g_game->_screenShakeOffset).y + *(float *)((int)g_game->_room + 0x1208)) - (float)((double)*(int *)(iVar7 + 0x14) + __uint_to_double_fixup[-(*(int *)(iVar7 + 0x14) >> 0x1f)]) * 0.5) + local_14; if (cVar1 != '\0') { local_30 = local_30 * -1.0; } if (*(char *)(iVar2 + 0x11 + (int)local_18) == '\0') { fStack_5c = g_screenHeight; } else { fStack_34 = fStack_34 * -1.0; fStack_5c = -g_screenHeight; } fStack_68 = g_screenWidth; if (cVar1 != '\0') { fStack_68 = -g_screenWidth; } local_30 = *(float *)(iVar2 + (int)local_18) - local_30; fStack_34 = *(float *)(iVar2 + 4 + (int)local_18) - fStack_34; fStack_68 = local_30 + fStack_68; fStack_5c = fStack_34 + fStack_5c; } fVar10 = 0.0; local_20 = CONCAT31(local_20._1_3_,1); local_70 = local_30; fStack_6c = fStack_34; fStack_64 = fStack_34; local_50 = local_20; local_84._unk = 0; local_60 = local_30; local_84._red = 1.0; local_84._green = 1.0; local_84._blue = 1.0; local_84._alpha = 1.0; local_8c.x = g_screenWidth; local_8c.y = g_screenHeight; fStack_58 = fStack_68; fStack_54 = fStack_5c; local_40 = local_30; fStack_3c = fStack_34; fStack_38 = fStack_68; fStack_2c = fStack_5c; fStack_28 = fStack_68; fStack_24 = fStack_5c; render_quad_set_rect(local_118,&g_vectorZero,&local_8c,&local_84); if (*(char *)(iVar8 + 0x48) == '\0') { if ((*(float *)(iVar8 + 0x3c) == fVar10) || (local_48 <= 0.9)) goto LAB_0099461a; iVar7 = **(int **)(iVar8 + 4); local_98 = 0; local_a8 = 0x3f800000; uStack_a4 = 0x3f800000; uStack_a0 = 0x3f800000; uStack_9c = 0x3f000000; } else { local_84._unk = 0; local_84._blue = 1.0; local_84._alpha = 1.0; if (*(int *)(iVar8 + 0x40) == 0x23) { pcVar3 = pGVar5->_room; if (*pcVar3 == '\0') { iVar7 = -1; } else { iVar7 = pGVar5->_frameCount - *(int *)(pcVar3 + 0x11f0); } local_84._blue = (float)iVar7 / 30.0; if ((float)iVar7 / 30.0 <= fVar10) { local_84._blue = fVar10; } if (1.0 <= local_84._blue) { local_84._blue = 1.0; } } iVar7 = *(int *)(iVar8 + 4); local_94 = (float)((double)*(int *)(iVar7 + 0x10) + __uint_to_double_fixup[-(*(int *)(iVar7 + 0x10) >> 0x1f)]) / (float)((double)*(int *)(iVar7 + 0x18) + __uint_to_double_fixup[-(*(int *)(iVar7 + 0x18) >> 0x1f)]); local_90 = (float)((double)*(int *)(iVar7 + 0x14) + __uint_to_double_fixup[-(*(int *)(iVar7 + 0x14) >> 0x1f)]) / (float)((double)*(int *)(iVar7 + 0x1c) + __uint_to_double_fixup[-(*(int *)(iVar7 + 0x1c) >> 0x1f)]); local_84._red = local_84._blue; local_84._green = local_84._blue; Shader::set_uniform(g_currentShader,(byte *)"WrapSize",9,&local_94,iVar7); LAB_0099461a: iVar7 = **(int **)(iVar8 + 4); } (**(code **)(iVar7 + 0x14))(&local_70,local_118); local_18 = (FXLayers *)((int)local_18 + 0x14); local_1c = (float)((int)local_1c + 1); } while ((int)local_1c < *(int *)(iVar8 + 0x18)); pvVar9 = g_currentShader; } if ((local_4c != (void *)0x0) && (g_currentShader = pvVar9, (*(byte *)((int)local_4c + 4) & 1) != 0)) { g_currentShader = local_4c; } return; } //@@ 00994670 FXLayers::render_behind_layers /* DB: Room::Render: layers with type 3 ("behind") via BlendMode::SetMode + FXLayers::render_layer */ void FXLayers::render_behind_layers(void) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int *extraout_EAX; FXLayers *in_ECX; int iVar7; int iVar8; uint local_68; int local_64; undefined1 local_24 [32]; iVar6 = g_graphicsManager_blendMode[4]; iVar5 = g_graphicsManager_blendMode[3]; iVar4 = g_graphicsManager_blendMode[2]; iVar3 = g_graphicsManager_blendMode[1]; iVar2 = g_graphicsManager_blendMode[0]; if (in_ECX->_loaded != 0) { iVar8 = *(int *)&in_ECX->field_0x18; iVar7 = *(int *)&in_ECX->field_0x1c - iVar8; local_68 = 0; iVar1 = iVar7 >> 0x1f; if (iVar7 / 0x4c + iVar1 != iVar1) { local_64 = 0; do { if (*(int *)(local_64 + 0x2c + iVar8) == 3) { BlendMode::SetMode(local_24,*(int *)(local_64 + iVar8 + 0x44),local_68); g_graphicsManager_blendMode[0] = *extraout_EAX; g_graphicsManager_blendMode[1] = extraout_EAX[1]; g_graphicsManager_blendMode[2] = extraout_EAX[2]; g_graphicsManager_blendMode[3] = extraout_EAX[3]; g_graphicsManager_blendMode[4] = extraout_EAX[4]; render_layer(in_ECX,local_68); } iVar8 = *(int *)&in_ECX->field_0x18; local_64 = local_64 + 0x4c; local_68 = local_68 + 1; } while (local_68 < (uint)((*(int *)&in_ECX->field_0x1c - iVar8) / 0x4c)); } } g_graphicsManager_blendMode[0] = iVar2; g_graphicsManager_blendMode[1] = iVar3; g_graphicsManager_blendMode[2] = iVar4; g_graphicsManager_blendMode[3] = iVar5; g_graphicsManager_blendMode[4] = iVar6; return; } //@@ 009947b0 FXLayers::render_background_layers /* DB: Room::Render: layers with type 2 ("background") via BlendMode::SetMode + FXLayers::render_layer */ void FXLayers::render_background_layers(void) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int *extraout_EAX; FXLayers *in_ECX; int iVar7; int iVar8; uint local_68; int local_64; undefined1 local_24 [32]; iVar6 = g_graphicsManager_blendMode[4]; iVar5 = g_graphicsManager_blendMode[3]; iVar4 = g_graphicsManager_blendMode[2]; iVar3 = g_graphicsManager_blendMode[1]; iVar2 = g_graphicsManager_blendMode[0]; if (in_ECX->_loaded != 0) { iVar8 = *(int *)&in_ECX->field_0x18; iVar7 = *(int *)&in_ECX->field_0x1c - iVar8; local_68 = 0; iVar1 = iVar7 >> 0x1f; if (iVar7 / 0x4c + iVar1 != iVar1) { local_64 = 0; do { if (*(int *)(local_64 + 0x2c + iVar8) == 2) { BlendMode::SetMode(local_24,*(int *)(local_64 + iVar8 + 0x44),local_68); g_graphicsManager_blendMode[0] = *extraout_EAX; g_graphicsManager_blendMode[1] = extraout_EAX[1]; g_graphicsManager_blendMode[2] = extraout_EAX[2]; g_graphicsManager_blendMode[3] = extraout_EAX[3]; g_graphicsManager_blendMode[4] = extraout_EAX[4]; render_layer(in_ECX,local_68); } iVar8 = *(int *)&in_ECX->field_0x18; local_64 = local_64 + 0x4c; local_68 = local_68 + 1; } while (local_68 < (uint)((*(int *)&in_ECX->field_0x1c - iVar8) / 0x4c)); } } g_graphicsManager_blendMode[0] = iVar2; g_graphicsManager_blendMode[1] = iVar3; g_graphicsManager_blendMode[2] = iVar4; g_graphicsManager_blendMode[3] = iVar5; g_graphicsManager_blendMode[4] = iVar6; return; } //@@ 009948f0 FXLayers::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: this=FXLayers: +0x8 _loaded gate, _fxLayers vector +0x18/+0x1c (stride 0x4c, [0x2c]==1 -> BlendMode::SetMode + FUN_00994120 draw), _poopFxCountdown +0x34 fade (150 in / 30 out), poop fx array +0x44 count +0x50 with flip bytes, KAGE_ColorTextureShader, Seeds forced/prevented curses; Beast room (backdrop 0x39, entity 1000.166.951) special; called from Room::Render */ void FXLayers::Render(void) { byte bVar1; FXLayers *pFVar2; FXLayers *pFVar3; float *pfVar4; char cVar5; int *extraout_EAX; undefined *puVar6; uint uVar7; uint uVar8; int *piVar9; FXLayers *in_ECX; int iVar10; int iVar11; uint uVar12; byte bVar13; int iVar14; uint uVar15; char *pcVar16; float fVar17; float fVar18; float fVar19; float fVar20; float fVar21; double dVar22; float afStackY_3e8 [128]; void *pvVar23; void *imageRefCount; undefined8 uVar24; undefined1 auStack_1c8 [4]; float *apfStack_1c4 [2]; int *piStack_1bc; float *local_1b8; float fStack_1b4; FXLayers *local_1b0; float local_1ac; float fStack_1a8; int iStack_1a4; int *piStack_1a0; float fStack_19c; void *pvStack_198; float fStack_194; KColor KStack_190; float fStack_17c; undefined4 uStack_15c; undefined4 uStack_158; float fStack_154; float fStack_150; float fStack_14c; float fStack_148; float fStack_144; float fStack_140; float fStack_13c; float fStack_138; float fStack_134; undefined1 uStack_130; Vector VStack_11c; Vector VStack_114; int iStack_10c; float fStack_108; undefined4 uStack_104; int local_100; Vector VStack_e8; Vector VStack_e0; Vector VStack_d8; int local_d0; int iStack_cc; int iStack_c8; int iStack_c4; undefined1 auStack_b0 [100]; undefined1 auStack_4c [16]; float fStack_3c; float fStack_38; float fStack_34; float fStack_30; float fStack_2c; float fStack_28; float fStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; uint local_14; local_14 = __security_cookie ^ (uint)auStack_1c8; pvVar23 = g_game->_room; local_1b0 = in_ECX; if ((*(int *)((int)pvVar23 + 0x1d18) == 0x39) && (local_1ac = 0.0, *(int *)((int)pvVar23 + 0x1264) != 0)) { do { piVar9 = *(int **)(*(int *)((int)pvVar23 + 0x125c) + (int)local_1ac * 4); if ((piVar9[10] == 1000) && ((piVar9[0xb] == 0xa6 && (piVar9[0xd] == 0x3b7)))) { (**(code **)(*piVar9 + 0x14))(); } local_1ac = (float)((int)local_1ac + 1); } while ((uint)local_1ac < (uint)*(float *)((int)pvVar23 + 0x1264)); } pFVar2 = local_1b0; if (local_1b0->_loaded != 0) { iVar14 = *(int *)&local_1b0->field_0x18; iVar10 = *(int *)&local_1b0->field_0x1c - iVar14; local_100 = g_graphicsManager_blendMode[4]; local_1b8 = (float *)0x0; local_d0 = g_graphicsManager_blendMode[0]; iStack_cc = g_graphicsManager_blendMode[1]; iStack_c8 = g_graphicsManager_blendMode[2]; iStack_c4 = g_graphicsManager_blendMode[3]; iVar11 = iVar10 >> 0x1f; if (iVar10 / 0x4c + iVar11 != iVar11) { fStack_1b4 = 0.0; do { if (*(int *)((int)fStack_1b4 + 0x2cU + iVar14) == 1) { BlendMode::SetMode(&KStack_190,*(int *)((int)fStack_1b4 + 0x44U + iVar14),(int)local_1b8); g_graphicsManager_blendMode[0] = *extraout_EAX; g_graphicsManager_blendMode[1] = extraout_EAX[1]; g_graphicsManager_blendMode[2] = extraout_EAX[2]; g_graphicsManager_blendMode[3] = extraout_EAX[3]; g_graphicsManager_blendMode[4] = extraout_EAX[4]; render_layer(pFVar2,(int)local_1b8); } iVar14 = *(int *)&pFVar2->field_0x18; fStack_1b4 = (float)((int)fStack_1b4 + 0x4c); local_1b8 = (float *)((int)local_1b8 + 1); } while (local_1b8 < (float *)((*(int *)&pFVar2->field_0x1c - iVar14) / 0x4c)); } if (0 < pFVar2->_poopFxCountdown) { g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; if (((byte)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; fVar17 = (float)pFVar2->_poopFxCountdown; if (pFVar2->_poopFxCountdown < 0x97) { local_1ac = fVar17 / 150.0; } else { local_1ac = (fVar17 - 180.0) / -30.0; } fStack_1b4 = 0.0; if (0 < *(int *)&pFVar2->field_0x50) { fStack_1a8 = 0.0; do { fStack_150 = (g_game->_screenShakeOffset).x + *(float *)((int)g_game->_room + 0x1204); fStack_14c = (g_game->_screenShakeOffset).y + *(float *)((int)g_game->_room + 0x1208); iVar14 = *(int *)&pFVar2->field_0x44; cVar5 = *(char *)((int)fStack_1a8 + 0x10 + iVar14); if (cVar5 != '\0') { fStack_150 = fStack_150 * -1.0; } fStack_13c = g_screenHeight; if (*(char *)((int)fStack_1a8 + 0x11 + iVar14) != '\0') { fStack_14c = fStack_14c * -1.0; fStack_13c = -g_screenHeight; } fStack_148 = g_screenWidth; if (cVar5 != '\0') { fStack_148 = -g_screenWidth; } fStack_150 = *(float *)((int)fStack_1a8 + iVar14) - fStack_150; KStack_190._unk = 0; fStack_14c = *(float *)((int)fStack_1a8 + 4 + iVar14) - fStack_14c; uStack_130 = 1; VStack_11c.x = g_screenWidth; fStack_148 = fStack_150 + fStack_148; fStack_13c = fStack_14c + fStack_13c; KStack_190._red = 1.0; KStack_190._green = 1.0; KStack_190._blue = 1.0; KStack_190._alpha = 1.0; VStack_11c.y = g_screenHeight; fStack_144 = fStack_14c; fStack_140 = fStack_150; fStack_138 = fStack_148; fStack_134 = fStack_13c; render_quad_set_rect(auStack_b0,&g_vectorZero,&VStack_11c,&KStack_190); puVar6 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar6 = g_currentShader; } pvVar23 = (void *)0x0; piVar9 = (int *)0x0; piStack_1bc = *(int **)&pFVar2->field_0x40; pvStack_198 = *(void **)&pFVar2->field_0x3c; g_currentShader = puVar6; if (piStack_1bc != (int *)0x0) { cVar5 = (**(code **)(*piStack_1bc + 4))(); if (cVar5 != '\0') { if (((piVar9 != (int *)0x0) && (cVar5 = (**(code **)(*piVar9 + 0xc))(), cVar5 != '\0') ) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } pvVar23 = pvStack_198; piVar9 = piStack_1bc; } } apply_sprite_shader_params((ColorMod *)&pFVar2->field_0x84,1,pvVar23,piVar9); uStack_104 = 0; VStack_114.x = 1.0; VStack_114.y = 1.0; iStack_10c = 0x3f800000; fStack_108 = local_1ac; (**(code **)(**(int **)&pFVar2->field_0x3c + 0x14))(); fStack_1b4 = (float)((int)fStack_1b4 + 1); fStack_1a8 = (float)((int)fStack_1a8 + 0x14); } while ((int)fStack_1b4 < *(int *)&pFVar2->field_0x50); } } pFVar2 = local_1b0; if ((g_manager->_optionsConfig)._enableLighting != 0) { uVar15 = g_game->_debugCurses; uVar12 = g_game->_curses; uVar7 = Seeds::GetForcedCurses(); uVar8 = Seeds::GetPreventedCurses(); pFVar3 = local_1b0; pFVar2 = local_1b0; if ((~uVar8 & (uVar7 | uVar15 | uVar12) & 1) == 0) { pFVar2 = *(FXLayers **)&local_1b0->field_0x30; if (-1 < (int)pFVar2) { g_graphicsManager_blendMode[1] = 1; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 1; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 1; pvVar23 = g_game->_room; piStack_1a0 = (int *)((g_game->_screenShakeOffset).y + *(float *)((int)pvVar23 + 0x1208)); local_1b8 = (float *)(g_displayPixelRatio * g_screenPointScale); fStack_19c = (g_screenWidth - 338.0) * 0.5; fStack_1b4 = (g_screenHeight - 182.0) * 0.5; piStack_1bc = (int *)((((*(float *)&local_1b0->field_0xb8 + *(float *)&local_1b0->field_0xb0) * 0.5 - 60.0) * 0.65 + fStack_19c) * (float)local_1b8 + 0.5); local_1b0 = pFVar2; dVar22 = floor((double)(float)piStack_1bc); fStack_1a8 = (float)dVar22 / (float)local_1b8; piStack_1bc = (int *)((((*(float *)&pFVar3->field_0xbc + *(float *)&pFVar3->field_0xb4) * 0.5 - 140.0) * 0.65 + fStack_1b4) * (float)local_1b8 + 0.5); dVar22 = floor((double)(float)piStack_1bc); fStack_1a8 = fStack_1a8 + *(float *)((int)pvVar23 + 0x1204); pvStack_198 = (void *)((float)dVar22 / (float)local_1b8 + *(float *)((int)pvVar23 + 0x1208)); piStack_1bc = (int *)(((*(float *)pFVar3 - 60.0) * 0.65 + fStack_19c) * (float)local_1b8 + 0.5); dVar22 = floor((double)(float)piStack_1bc); local_1ac = (float)dVar22 / (float)local_1b8; piStack_1bc = (int *)(((*(float *)&pFVar3->field_0x4 - 140.0) * 0.65 + fStack_1b4) * (float)local_1b8 + 0.5); dVar22 = floor((double)(float)piStack_1bc); piStack_1bc = (int *)(float)dVar22; fStack_19c = ((float)piStack_1bc / (float)local_1b8 - (float)pvStack_198) + *(float *)((int)pvVar23 + 0x1208); fVar17 = (local_1ac - fStack_1a8) + *(float *)((int)pvVar23 + 0x1204); iStack_1a4 = (int)local_1b0 * 0x2c; iVar11 = (*(int *)(iStack_1a4 + 0x20 + *(int *)&pFVar3->field_0x24) - *(int *)(iStack_1a4 + 0x1c + *(int *)&pFVar3->field_0x24)) / 0x14; iVar14 = *(int *)&pFVar3->field_0x24; fStack_154 = ((*(float *)(iStack_1a4 + 4 + iVar14) - *(float *)(iStack_1a4 + iVar14)) - (float)((double)(iVar11 + -1) + __uint_to_double_fixup[-(iVar11 + -1 >> 0x1f)]) * *(float *)(iStack_1a4 + 0x14 + iVar14)) / (float)((double)iVar11 + __uint_to_double_fixup[-(iVar11 >> 0x1f)]); if ((DAT_00c7911c & 1) != 0) { g_currentShader = &g_shaders; iVar14 = *(int *)&pFVar3->field_0x24; } fStack_1b4 = 0.0; iVar11 = *(int *)(iVar14 + 0x20 + iStack_1a4) - *(int *)(iVar14 + 0x1c + iStack_1a4); iVar14 = iVar11 >> 0x1f; pFVar2 = local_1b0; local_1ac = fVar17; if (iVar11 / 0x14 + iVar14 != iVar14) { fVar20 = fStack_154 * 0.5; iVar14 = 0; VStack_114.y = (float)piStack_1a0; VStack_d8.y = (float)piStack_1a0; fVar21 = fStack_1a8; VStack_11c.x = fVar20; do { iVar11 = *(int *)&pFVar3->field_0x24; KStack_190._unk = 0; VStack_d8.x = fVar17 * *(float *)(iVar11 + 8 + iStack_1a4); fVar19 = (fStack_154 + *(float *)(iVar11 + 0x14 + iStack_1a4)) * (float)((double)(int)fStack_1b4 + __uint_to_double_fixup[-((int)fStack_1b4 >> 0x1f)]) + *(float *)(iVar11 + iStack_1a4); fVar18 = fVar21 + fVar19; VStack_114.x = VStack_d8.x + fVar18; VStack_d8.x = fVar18 + fStack_154 + VStack_d8.x; VStack_e0.x = fVar17 * *(float *)(iVar11 + 0xc + iStack_1a4); fVar18 = (fVar20 + fVar19) * *(float *)(iVar11 + 0x18 + iStack_1a4) + fVar21; VStack_e8.x = fVar18 + fVar20 + VStack_e0.x; VStack_e0.x = (fVar18 - fVar20) + VStack_e0.x; VStack_e8.y = fStack_19c * *(float *)(iVar11 + 0xc + iStack_1a4) + *(float *)(iVar11 + 0x10 + iStack_1a4); fStack_140 = 0.0; fStack_150 = 0.0; fStack_144 = 0.0; fStack_14c = 0.0; fStack_138 = 1.0; fStack_148 = 1.0; fStack_134 = 1.0; fStack_13c = 1.0; uStack_130 = 0; KStack_190._red = 1.0; KStack_190._green = 1.0; KStack_190._blue = 1.0; KStack_190._alpha = 1.0; VStack_e0.y = VStack_e8.y; set_quad_corner_colors (auStack_b0,&VStack_114,&VStack_d8,&VStack_e0,&VStack_e8,&KStack_190); iVar11 = *(int *)&pFVar3->field_0x24; piStack_1bc = *(int **)(iStack_1a4 + 0x1c + iVar11); if (*(int *)((int)piStack_1bc + 0xc + iVar14) != 0) { fVar17 = 1.0 - ABS(fVar17) / fVar21; if (fVar17 <= 0.0) { fVar17 = 0.0; } dVar22 = (double)fVar17; libm_sse2_pow_precise(); local_1b0 = (FXLayers *)(float)dVar22; fVar17 = 1.0 - ABS(fStack_19c) / (float)pvStack_198; if (fVar17 <= 0.0) { fVar17 = 0.0; } dVar22 = (double)fVar17; libm_sse2_pow_precise(); local_1b0 = (FXLayers *) ((float)local_1b0 * (float)dVar22 * *(float *)((int)piStack_1bc + iVar14)); fVar17 = sin(*(float *)((int)piStack_1bc + 8 + iVar14)); local_1b8 = (float *)(auStack_1c8 + -0x10); auStack_4c._12_4_ = 1.0; fStack_3c = 1.0; fStack_30 = 0.0; fStack_2c = 0.0; fStack_28 = 0.0; fStack_24 = 0.0; fStack_38 = 1.0; fStack_194 = (fVar17 + 1.0) * 0.5; uVar24 = 0; fStack_34 = fStack_194 * (float)local_1b0; uStack_20 = 0; piStack_1a0 = *(int **)((int)piStack_1bc + 0x10 + iVar14); piStack_1bc = *(int **)((int)piStack_1bc + 0xc + iVar14); uStack_1c = 0; uStack_18 = 0; pfVar4 = (float *)(auStack_1c8 + -0x10); if (piStack_1a0 != (int *)0x0) { cVar5 = (**(code **)(*piStack_1a0 + 4))(); pfVar4 = local_1b8; if (cVar5 != '\0') { if ((((int *)local_1b8[1] != (int *)0x0) && (cVar5 = (**(code **)(*(int *)local_1b8[1] + 0xc))(), cVar5 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_1b8[1] = (float)piStack_1a0; *local_1b8 = (float)piStack_1bc; pfVar4 = local_1b8; } } local_1b8 = pfVar4; apply_sprite_shader_params ((ColorMod *)(auStack_4c + 0xc),1,(void *)uVar24, (void *)((ulonglong)uVar24 >> 0x20)); KStack_190._unk = 0; KStack_190._red = (float)auStack_4c._12_4_; KStack_190._green = fStack_3c; KStack_190._blue = fStack_38; KStack_190._alpha = fStack_34; (**(code **)(**(int **)(*(int *)(iStack_1a4 + 0x1c + *(int *)&pFVar3->field_0x24) + 0xc + iVar14) + 0x14))(); apfStack_1c4[0] = afStackY_3e8 + 0x81; fStack_19c = 1.0; KStack_190._red = 0.0; pvStack_198 = (void *)0x0; fStack_194 = 0.0; uStack_15c = 0x3f800000; uStack_158 = 0; fStack_154 = 0.0; fStack_150 = 0.0; KStack_190._green = 1.0; KStack_190._alpha = 0.0; KStack_190._unk = 0x3f800000; KStack_190._blue = 1.0; fStack_14c = 1.0; fStack_148 = 1.0; fStack_144 = 0.0; fStack_140 = 1.0; fStack_17c = (float)((uint)fStack_17c & 0xffffff00); fStack_13c = fStack_17c; auStack_4c._12_4_ = (1.0 - (float)piStack_1a0) * (float)piStack_1bc; pvVar23 = (void *)0x0; imageRefCount = (void *)0x0; piStack_1a0 = *(int **)(*(int *)(&local_1b0->field_0x1c + *(int *)&pFVar3->field_0x24) + 0x10 + iVar14); local_1ac = *(float *)(*(int *)(&local_1b0->field_0x1c + *(int *)&pFVar3->field_0x24 ) + 0xc + iVar14); pfVar4 = afStackY_3e8 + 0x81; if (piStack_1a0 != (int *)0x0) { cVar5 = (**(code **)(*piStack_1a0 + 4))(); pfVar4 = apfStack_1c4[0]; if (cVar5 != '\0') { if ((((int *)apfStack_1c4[0][1] != (int *)0x0) && (cVar5 = (**(code **)(*(int *)apfStack_1c4[0][1] + 0xc))(), cVar5 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(apfStack_1c4[0]); } apfStack_1c4[0][1] = (float)piStack_1a0; *apfStack_1c4[0] = local_1ac; pfVar4 = apfStack_1c4[0]; } } apfStack_1c4[0] = pfVar4; apply_sprite_shader_params((ColorMod *)auStack_4c,1,pvVar23,imageRefCount); KStack_190._green = 0.0; fStack_19c = (float)auStack_4c._0_4_; pvStack_198 = (void *)auStack_4c._4_4_; fStack_194 = (float)auStack_4c._8_4_; KStack_190._red = (float)auStack_4c._12_4_; (**(code **)(**(int **)(*(int *)(&local_1b0->field_0x1c + *(int *)&pFVar3->field_0x24) + 0xc + iVar14) + 0x14) )(&uStack_15c); iVar11 = *(int *)&pFVar3->field_0x24; fVar20 = VStack_11c.x; fVar17 = local_1ac; fVar21 = fStack_1a8; } iVar10 = *(int *)(iVar11 + 0x1c + iStack_1a4); fStack_1b4 = (float)((int)fStack_1b4 + 1); *(float *)(iVar14 + 8 + iVar10) = *(float *)(iVar14 + 4 + iVar10) + *(float *)(iVar14 + 8 + iVar10); iVar14 = iVar14 + 0x14; pFVar2 = local_1b0; } while ((uint)fStack_1b4 < (uint)((*(int *)(iVar11 + 0x20 + iStack_1a4) - *(int *)(*(int *)&pFVar3->field_0x24 + 0x1c + iStack_1a4)) / 0x14)); } } } } local_1b0 = pFVar2; uVar15 = 0x1505; g_graphicsManager_blendMode[0] = local_d0; pcVar16 = "KAGE_ColorTextureShader"; g_graphicsManager_blendMode[1] = iStack_cc; g_graphicsManager_blendMode[2] = iStack_c8; g_graphicsManager_blendMode[3] = iStack_c4; g_graphicsManager_blendMode[4] = local_100; bVar1 = 0x4b; do { pcVar16 = pcVar16 + 1; bVar13 = bVar1 + 0x20; if (0x19 < (byte)(bVar1 + 0xbf)) { bVar13 = bVar1; } uVar12 = (uint)bVar13; if (bVar13 == 0x5c) { uVar12 = 0x2f; } uVar15 = uVar15 * 0x21 + uVar12; bVar1 = *pcVar16; } while (bVar1 != 0); piStack_1bc = (int *)uVar15; _Find_lower_bound<>(); if (((*(char *)(iStack_10c + 0xd) == '\0') && (*(uint *)(iStack_10c + 0x10) <= uVar15)) && (iStack_10c != DAT_00c379bc)) { piVar9 = (int *)std::map::operator_index(); pvVar23 = (void *)*piVar9; if ((pvVar23 != (void *)0x0) && ((*(byte *)((int)pvVar23 + 4) & 1) != 0)) { g_currentShader = pvVar23; } } } return; } //@@ 009956e0 render_color_quad_list /* DB: ? renders list of 0x4c-byte entries (+0x18..+0x1c) with 'KAGE_ColorShader' via render_quad_set_rect; Room::Render and 0080ea80 Room::render_lighting target pop) */ void render_color_quad_list(KColor *param_1) { char cVar1; int *piVar2; bool bVar3; float fVar4; float fVar5; void *this; int in_ECX; int iVar6; int unused; int iVar7; int iVar8; float fVar9; double dVar10; int local_c0; int local_bc; uint local_b8; Vector local_ac; float local_a4; int local_a0; float local_9c; float local_98; float local_94; float local_90; float local_8c; float local_88; float local_84; float local_80; undefined1 local_7c; undefined1 local_78 [44]; float local_4c; float local_38; float local_24; float local_10; fVar5 = g_screenHeight; fVar4 = g_screenWidth; if (*(char *)(in_ECX + 8) != '\0') { bVar3 = false; local_ac.x = g_screenWidth; local_ac.y = g_screenHeight; local_a0 = in_ECX; render_quad_set_rect(local_78,&g_vectorZero,&local_ac,param_1); iVar8 = *(int *)(in_ECX + 0x18); iVar6 = *(int *)(in_ECX + 0x1c) - iVar8; local_b8 = 0; iVar7 = iVar6 >> 0x1f; if (iVar6 / 0x4c + iVar7 != iVar7) { local_c0 = 0; do { if (*(int *)(iVar8 + 0x2c + local_c0) == 4) { fVar9 = g_displayPixelRatio * g_screenPointScale; dVar10 = floor((double)((((*(float *)(in_ECX + 0xb8) + *(float *)(in_ECX + 0xb0)) * 0.5 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar9 + 0.5)); local_a4 = (float)dVar10 / fVar9; dVar10 = floor((double)((((*(float *)(in_ECX + 0xb4) + *(float *)(in_ECX + 0xbc)) * 0.5 - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar9 + 0.5)); local_ac.x = (float)dVar10 / fVar9; local_bc = 0; if (0 < *(int *)(iVar8 + 0x18 + local_c0)) { bVar3 = true; iVar7 = 0; do { piVar2 = *(int **)(iVar8 + 4 + local_c0); local_9c = (*(float *)((int)g_game->_room + 0x1204) + (g_game->_screenShakeOffset).x) - ((float)((double)piVar2[4] + __uint_to_double_fixup[-(piVar2[4] >> 0x1f)] ) * 0.5 - local_a4); iVar6 = *(int *)(iVar8 + 0xc + local_c0); cVar1 = *(char *)(iVar6 + 0x10 + iVar7); local_98 = ((g_game->_screenShakeOffset).y + *(float *)((int)g_game->_room + 0x1208)) - ((float)((double)piVar2[5] + __uint_to_double_fixup[-(piVar2[5] >> 0x1f)] ) * 0.5 - local_ac.x); if (cVar1 != '\0') { local_9c = local_9c * -1.0; } local_88 = fVar5; if (*(char *)(iVar6 + 0x11 + iVar7) != '\0') { local_98 = local_98 * -1.0; local_88 = -fVar5; } local_94 = fVar4; if (cVar1 != '\0') { local_94 = -fVar4; } local_9c = *(float *)(iVar6 + iVar7) - local_9c; local_98 = *(float *)(iVar6 + 4 + iVar7) - local_98; local_7c = 1; local_94 = local_9c + local_94; local_88 = local_98 + local_88; local_90 = local_98; local_8c = local_9c; local_84 = local_94; local_80 = local_88; (**(code **)(*piVar2 + 0x14))(&local_9c,local_78); iVar7 = iVar7 + 0x14; local_bc = local_bc + 1; in_ECX = local_a0; } while (local_bc < *(int *)(iVar8 + 0x18 + local_c0)); } } iVar8 = *(int *)(in_ECX + 0x18); local_c0 = local_c0 + 0x4c; local_b8 = local_b8 + 1; } while (local_b8 < (uint)((*(int *)(in_ECX + 0x1c) - iVar8) / 0x4c)); if (bVar3) { return; } } if ((local_4c + local_38 + local_24 + local_10) * 0.25 != 0.0) { shader_push((byte *)"KAGE_ColorShader"); FUN_00a11080(); this = kage_graphics_flush((void *)0x0); render_quad_draw(this,&local_9c,local_78,1,unused); FUN_00a14200(); } } return; } //@@ 00995af0 FXLayers::render_underwater_layers /* DB: Room::render_water: layers with type 5 ("underwater"), gated on +8 _loaded */ void FXLayers::render_underwater_layers(void) { char cVar1; int iVar2; int iVar3; int in_ECX; int iVar4; int iVar5; int iVar6; undefined1 local_f0 [116]; KColor local_7c; float local_68; float local_64; float local_60; float local_5c; float local_58; float local_54; float local_50; float local_4c; undefined1 local_48; Vector local_44; Vector local_3c; int local_34; float local_30; float local_2c; float local_28; float local_24; int local_20; int local_1c; void *local_18; uint local_14; if (*(char *)(in_ECX + 8) != '\0') { g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; if (((byte)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; iVar5 = *(int *)(in_ECX + 0x18); local_18 = g_game->_room; local_14 = 0; iVar4 = *(int *)(in_ECX + 0x1c) - iVar5; iVar6 = iVar4 >> 0x1f; if (iVar4 / 0x4c + iVar6 != iVar6) { iVar6 = 0; local_34 = in_ECX; do { if (*(int *)(iVar5 + 0x2c + iVar6) == 5) { local_1c = 0; local_28 = *(float *)((int)local_18 + 0x6ae8) - *(float *)((int)local_18 + 0x6ae0); local_2c = *(float *)((int)local_18 + 0x6aec) - *(float *)((int)local_18 + 0x6ae4); local_24 = (*(float *)((int)local_18 + 0x6ae4) + *(float *)((int)local_18 + 0x6aec)) * 0.5 ; local_30 = (*(float *)((int)local_18 + 0x6ae0) + *(float *)((int)local_18 + 0x6ae8)) * 0.5 ; if (0 < *(int *)(iVar5 + 0x18 + iVar6)) { local_3c.x = local_28 + 104.0; local_20 = 0; local_3c.y = local_2c + 104.0; do { iVar4 = *(int *)(iVar5 + 4 + iVar6); iVar2 = *(int *)(iVar4 + 0x10); iVar4 = *(int *)(iVar4 + 0x14); iVar3 = *(int *)(iVar5 + 0xc + iVar6); local_68 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 0.5 + local_30; cVar1 = *(char *)(local_20 + 0x10 + iVar3); local_64 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * 0.5 + local_24; if (cVar1 != '\0') { local_68 = local_68 * -1.0; } if (*(char *)(local_20 + 0x11 + iVar3) == '\0') { local_54 = local_2c; } else { local_64 = local_64 * -1.0; local_54 = -local_2c; } local_60 = local_28; if (cVar1 != '\0') { local_60 = -local_28; } local_64 = *(float *)(local_20 + 4 + iVar3) - local_64; local_68 = *(float *)(local_20 + iVar3) - local_68; local_48 = 1; local_7c._unk = 0; local_54 = local_64 + local_54; local_60 = local_68 + local_60; local_44.y = *(float *)((int)local_18 + 0x6ae4) - 52.0; local_7c._red = 1.0; local_7c._green = 1.0; local_7c._blue = 1.0; local_7c._alpha = 1.0; local_44.x = *(float *)((int)local_18 + 0x6ae0) - 52.0; local_5c = local_64; local_58 = local_68; local_50 = local_60; local_4c = local_54; render_quad_set_rect(local_f0,&local_44,&local_3c,&local_7c); (**(code **)(**(int **)(iVar5 + 4 + iVar6) + 0x14)) (&local_68,local_f0,g_drawRectUnset); local_1c = local_1c + 1; local_20 = local_20 + 0x14; } while (local_1c < *(int *)(iVar5 + 0x18 + iVar6)); } } iVar6 = iVar6 + 0x4c; local_14 = local_14 + 1; iVar5 = *(int *)(local_34 + 0x18); } while (local_14 < (uint)((*(int *)(local_34 + 0x1c) - iVar5) / 0x4c)); } } return; } //@@ 00995e00 FXLayers::render_overlay_layers /* DB: Room::Render: for each _fxLayers entry (+0x18, 0x4c) with type +0x2c == 6 ("overlay" in LoadConfig's type map) BlendMode::SetMode + FXLayers::render_layer, restores the global blend mode */ void FXLayers::render_overlay_layers(void) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int *extraout_EAX; FXLayers *in_ECX; int iVar7; int iVar8; uint local_68; int local_64; undefined1 local_24 [32]; iVar6 = g_graphicsManager_blendMode[4]; iVar5 = g_graphicsManager_blendMode[3]; iVar4 = g_graphicsManager_blendMode[2]; iVar3 = g_graphicsManager_blendMode[1]; iVar2 = g_graphicsManager_blendMode[0]; if (in_ECX->_loaded != 0) { iVar8 = *(int *)&in_ECX->field_0x18; iVar7 = *(int *)&in_ECX->field_0x1c - iVar8; local_68 = 0; iVar1 = iVar7 >> 0x1f; if (iVar7 / 0x4c + iVar1 != iVar1) { local_64 = 0; do { if (*(int *)(local_64 + 0x2c + iVar8) == 6) { BlendMode::SetMode(local_24,*(int *)(local_64 + iVar8 + 0x44),local_68); g_graphicsManager_blendMode[0] = *extraout_EAX; g_graphicsManager_blendMode[1] = extraout_EAX[1]; g_graphicsManager_blendMode[2] = extraout_EAX[2]; g_graphicsManager_blendMode[3] = extraout_EAX[3]; g_graphicsManager_blendMode[4] = extraout_EAX[4]; render_layer(in_ECX,local_68); } iVar8 = *(int *)&in_ECX->field_0x18; local_64 = local_64 + 0x4c; local_68 = local_68 + 1; } while (local_68 < (uint)((*(int *)&in_ECX->field_0x1c - iVar8) / 0x4c)); } } g_graphicsManager_blendMode[0] = iVar2; g_graphicsManager_blendMode[1] = iVar3; g_graphicsManager_blendMode[2] = iVar4; g_graphicsManager_blendMode[3] = iVar5; g_graphicsManager_blendMode[4] = iVar6; return; } //@@ 00995f40 FUN_00995f40 undefined4 * FUN_00995f40(undefined4 *param_1) { int iVar1; undefined4 uVar2; int in_ECX; int iVar3; uint uVar4; int iVar5; if (*(char *)(in_ECX + 8) != '\0') { iVar5 = *(int *)(in_ECX + 0x18); uVar4 = 0; iVar3 = *(int *)(in_ECX + 0x1c) - iVar5; iVar1 = iVar3 >> 0x1f; iVar3 = iVar3 / 0x4c + iVar1; if (iVar3 != iVar1) { do { if ((*(int *)(iVar5 + 0x2c) == 4) && (0 < *(int *)(iVar5 + 0x18))) { iVar5 = **(int **)(iVar5 + 4); uVar2 = __ftoui3(); uVar2 = __ftoui3(uVar2); (**(code **)(iVar5 + 0x2c))(param_1,uVar2); return param_1; } uVar4 = uVar4 + 1; iVar5 = iVar5 + 0x4c; } while (uVar4 < (uint)(iVar3 - iVar1)); } } param_1[4] = 0; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0x3f800000; return param_1; } //@@ 009960b0 Game::start_poop_cloud_screen_effect /* DB: ? loads gfx/backdrop/pooclouds.png, called from UsePill/bomb tearflags with colors prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Game::start_poop_cloud_screen_effect(Game *this,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 ((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 = (uint)fVar5; this->_roomList[0].SavedEffects._begin = pvVar7; this->_roomList[0].SavedEffects._end = pvVar3; *(undefined8 *)&this->_roomList[0].SavedEffects._capacity = *(undefined8 *)color->_offset; *(float *)&this->_roomList[0].field_0x98 = color->_offset[2]; } game = g_game; iVar1 = this->_roomList[0]._doors[1]; if (iVar1 < 1) { this->_roomList[0]._doors[1] = 0xb4; *(undefined1 *)((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 = *(int *)((int)game->_room + 4); seed = 0; if (iVar1 != 0) { seed = *(uint *)(iVar1 + 0x58); } rngShift3 = 7; puVar6 = loadedImage + 0x34; if (this->_roomList[0]._doors[3] == 0) { pvVar7 = Manager::LoadImage(loadedImage,(byte *)"gfx/backdrop/pooclouds.png"); local_14 = 0; KAGE::SmartPointer::operator_assign(this->_roomList[0]._doors + 3,pvVar7); local_14 = 1; if (loadedImageRef != (int *)0x0) { isLastRef = (**(code **)(*loadedImageRef + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImage); } } local_14 = 0xffffffff; local_30 = (int *)this->_roomList[0]._doors[3]; if (local_30 == (int *)0x0) { this->_roomList[0]._doors[1] = 0; KAGE_LogMessage(1,(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 = (int *)0x0; if (0 < this->_roomList[0].DisplayFlags) { cloudOffset = 0; do { if (seed == 0) { KAGE_LogMessage(0x10,(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; *(float *)(this->_roomList[0]._doors[5] + 8 + cloudOffset) = (float)((double)(int)seed + __uint_to_double_fixup[-((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,(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; *(float *)(this->_roomList[0]._doors[5] + 0xc + cloudOffset) = ((float)this->_roomList[0].GreedSubType - *(float *)&this->_roomList[0].TotalMoneySpent ) * (float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10 + *(float *)&this->_roomList[0].TotalMoneySpent; if (seed == 0) { KAGE_LogMessage(0x10,(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 = *(int *)(this->_roomList[0]._doors[3] + 0x10); *(float *)(cloudOffset + this->_roomList[0]._doors[5]) = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) * (float)((double)(int)local_2c + __uint_to_double_fixup[-((int)local_2c >> 0x1f)]) * 2.3283062e-10; if (local_2c == 0) { KAGE_LogMessage(0x10,(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 = *(int *)(this->_roomList[0]._doors[3] + 0x14); *(float *)(this->_roomList[0]._doors[5] + 4 + cloudOffset) = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) * (float)((double)(int)local_2c + __uint_to_double_fixup[-((int)local_2c >> 0x1f)]) * 2.3283062e-10; if (local_2c == 0) { KAGE_LogMessage(0x10,(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; *(bool *)(this->_roomList[0]._doors[5] + 0x10 + cloudOffset) = (float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10 < 0.5; if (seed == 0) { KAGE_LogMessage(0x10,(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; *(bool *)(this->_roomList[0]._doors[5] + 0x11 + cloudOffset) = (float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10 < 0.5; cloudOffset = cloudOffset + 0x14; local_30 = (int *)((int)local_30 + 1); } while ((int)local_30 < this->_roomList[0].DisplayFlags); } } else if (iVar1 < 0x96) { this->_roomList[0]._doors[1] = (int)(180.0 - (((float)iVar1 - 0.0) / 150.0) * 30.0); } ExceptionList = local_1c; return; } //@@ 00996580 FXLayers::render_veins /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Room::Render callee: 10 vein entries at +0xd8 (count at +0xc4) set scale/offset of ANM2[idx] at +0x364 (stride 0x114, FXLayers._veinANM2) then AnimationState::Render */ void FXLayers::render_veins(void) { float fVar1; float *pfVar2; int in_ECX; undefined4 *puVar3; int iVar4; float fVar5; int iVar6; float fVar7; double dVar8; undefined1 auStack_b4 [40]; float local_8c; float local_88; float *local_84; int local_80; Vector local_7c; float local_74; undefined4 local_70; undefined4 uStack_6c; undefined4 uStack_68; float fStack_64; undefined4 local_50; undefined4 uStack_4c; undefined4 local_48; uint local_44; local_44 = __security_cookie ^ (uint)auStack_b4; if (*(int *)(in_ECX + 0xc4) != 0) { local_84 = (float *)(in_ECX + 0xd8); local_80 = 10; do { pfVar2 = local_84; if (local_84 != (float *)0x18) { fVar1 = local_84[-6]; local_70 = 0x3f800000; fVar7 = *local_84 * g_vectorOne.y; uStack_6c = 0x3f800000; uStack_68 = 0x3f800000; fVar5 = local_84[1]; local_50 = 0; *(float *)((int)fVar1 * 0x114 + 0x364 + in_ECX) = *local_84 * g_vectorOne.x * local_84[1]; *(float *)((int)fVar1 * 0x114 + 0x368 + in_ECX) = fVar7 * fVar5; uStack_4c = 0; local_48 = 0; *(float *)((int)local_84[-6] * 0x114 + 0x36c + in_ECX) = local_84[-1]; fVar5 = local_84[-6]; puVar3 = (undefined4 *)(in_ECX + 0x370 + (int)fVar5 * 0x114); fStack_64 = ((1.0 - (float)(int)local_84[3] * 0.25) * 0.7 + 0.3) * local_84[2] * local_84[1] ; if (puVar3 != &local_70) { puVar3[4] = 0; puVar3[5] = 0; puVar3[6] = 0; puVar3[7] = 0; *puVar3 = 0x3f800000; puVar3[1] = 0x3f800000; puVar3[2] = 0x3f800000; puVar3[3] = fStack_64; *(undefined8 *)(puVar3 + 8) = 0; puVar3[10] = 0; fVar5 = local_84[-6]; } local_88 = g_displayPixelRatio * g_screenPointScale; iVar6 = (int)fVar5 * 0x114; local_8c = ((g_screenWidth - 338.0) * 0.5 + (local_84[4] - 60.0) * 0.65) * local_88 + 0.5; dVar8 = floor((double)local_8c); local_74 = (float)dVar8 / local_88; local_8c = ((g_screenHeight - 182.0) * 0.5 + (pfVar2[5] - 140.0) * 0.65) * local_88 + 0.5; dVar8 = floor((double)local_8c); local_8c = (float)dVar8; local_7c.x = local_74 + *(float *)((int)g_game->_room + 0x1204) + (g_game->_screenShakeOffset).x; local_7c.y = local_8c / local_88 + *(float *)((int)g_game->_room + 0x1208) + (g_game->_screenShakeOffset).y; if (*(char *)(iVar6 + 0x3d1 + in_ECX) != '\0') { if (*(char *)(iVar6 + 0x338 + in_ECX) == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x2f8 + iVar6),&local_7c,&g_vectorZero, &g_vectorZero); iVar4 = in_ECX + 0x318; } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x318 + iVar6),&local_7c,&g_vectorZero, &g_vectorZero); iVar4 = in_ECX + 0x2f8; } AnimationState::Render ((AnimationState *)(iVar4 + iVar6),&local_7c,&g_vectorZero,&g_vectorZero); } iVar6 = 3; do { render_vein_branch(); iVar6 = iVar6 + -1; } while (iVar6 != 0); } local_84 = local_84 + 0xd; local_80 = local_80 + -1; } while (local_80 != 0); } return; } //@@ 009968b0 FXLayers::render_vein_branch /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: recursive: sets scale/rotation/colour of vein ANM2[idx] (this+0x364 + idx*0x114, FXLayers._veinANM2) from the node then renders it and children; FXLayers::render_veins */ void FXLayers::render_vein_branch(int *param_1) { float fVar1; int in_ECX; undefined4 *puVar2; int iVar3; float fVar4; double dVar5; Vector local_48; float local_40; float local_3c; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; float fStack_2c; undefined4 local_18; undefined4 uStack_14; undefined4 local_10; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); if (param_1 != (int *)0x0) { fVar1 = (float)param_1[7]; local_38 = 0x3f800000; fVar4 = (float)param_1[6] * g_vectorOne.x; uStack_34 = 0x3f800000; iVar3 = *param_1; uStack_30 = 0x3f800000; local_18 = 0; uStack_14 = 0; local_10 = 0; *(float *)(iVar3 * 0x114 + 0x368 + in_ECX) = fVar1 * (float)param_1[6] * g_vectorOne.y; *(float *)(iVar3 * 0x114 + 0x364 + in_ECX) = fVar4 * fVar1; *(int *)(*param_1 * 0x114 + 0x36c + in_ECX) = param_1[5]; iVar3 = *param_1; puVar2 = (undefined4 *)(in_ECX + 0x370 + iVar3 * 0x114); fStack_2c = ((1.0 - (float)param_1[9] * 0.25) * 0.7 + 0.3) * (float)param_1[8] * (float)param_1[7]; if (puVar2 != &local_38) { puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0; puVar2[7] = 0; *puVar2 = 0x3f800000; puVar2[1] = 0x3f800000; puVar2[2] = 0x3f800000; puVar2[3] = fStack_2c; *(undefined8 *)(puVar2 + 8) = 0; puVar2[10] = 0; iVar3 = *param_1; } local_40 = g_displayPixelRatio * g_screenPointScale; local_3c = ((g_screenWidth - 338.0) * 0.5 + ((float)param_1[10] - 60.0) * 0.65) * local_40 + 0.5 ; dVar5 = floor((double)local_3c); local_48.y = (float)dVar5 / local_40; local_3c = ((g_screenHeight - 182.0) * 0.5 + ((float)param_1[0xb] - 140.0) * 0.65) * local_40 + 0.5; dVar5 = floor((double)local_3c); local_3c = (float)dVar5; local_48.x = local_48.y + *(float *)((int)g_game->_room + 0x1204) + (g_game->_screenShakeOffset).x; local_48.y = local_3c / local_40 + *(float *)((int)g_game->_room + 0x1208) + (g_game->_screenShakeOffset).y; ANM2::Render((ANM2 *)(in_ECX + 0x2c8 + iVar3 * 0x114),&local_48,&g_vectorZero,&g_vectorZero); iVar3 = 3; do { render_vein_branch(); iVar3 = iVar3 + -1; } while (iVar3 != 0); } return; } //@@ 00996b30 FXLayers::grow_vein_branches /* DB: recursive (depth > 4 stops): uses the vein ANM2 null frames (this+0x2f8 + idx*0x114), RNG, creates child nodes with 0.75x length; FXLayers::LoadConfig */ void FXLayers::grow_vein_branches(int *param_1) { float fVar1; float fVar2; float fVar3; float fVar4; int iVar5; code *pcVar6; qword qVar7; float *pfVar8; undefined4 *puVar9; uint uVar10; int in_ECX; qword *pqVar11; uint *puVar12; float x; float fVar13; float fVar14; float fVar15; float fVar16; int *local_28; int local_1c; if (param_1 != (int *)0x0) { local_28 = param_1 + 1; if (4 < param_1[9]) { *local_28 = 0; param_1[2] = 0; param_1[3] = 0; return; } local_1c = 0; do { if (*(int *)(*param_1 * 0x114 + 0x2fc + in_ECX) == 0) { pfVar8 = (float *)0x0; } else { pfVar8 = AnimationState::GetNullFrameById ((AnimationState *)(*param_1 * 0x114 + 0x2f8 + in_ECX),local_1c); } x = pfVar8[0x11] + (float)param_1[5]; if (360.0 < ABS(x)) { x = fmodf(x,360.0); } if (x <= 180.0) { if (x < -180.0) { x = x + 360.0; } } else { x = x - 360.0; } fVar13 = (x - 90.0) * 0.017453292; fVar14 = sin(fVar13); fVar1 = *(float *)(in_ECX + 0x4f4); fVar2 = (float)param_1[0xb]; fVar13 = cos(fVar13); if (0.0 <= fVar14 * (fVar1 - fVar2) + fVar13 * (*(float *)(in_ECX + 0x4f0) - (float)param_1[10])) { if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } puVar9 = malloc(0x38); if (puVar9 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); LAB_00996cad: puVar12 = (uint *)0x0; } else { *puVar9 = 0x38; qVar7 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 + 0x38; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) + (uint)(0xffffffc7 < (uint)qVar7); if (puVar9 == (undefined4 *)0xfffffffc) goto LAB_00996cad; puVar12 = (uint *)FUN_0098f6c0(); } if (DAT_00c35e8c == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); if (DAT_00c35e8c == 0) { pcVar6 = (code *)swi(3); (*pcVar6)(); return; } } uVar10 = DAT_00c35e8c >> ((byte)DAT_00c35e90 & 0x1f) ^ DAT_00c35e8c; uVar10 = uVar10 << ((byte)DAT_00c35e94 & 0x1f) ^ uVar10; DAT_00c35e8c = uVar10 >> ((byte)DAT_00c35e98 & 0x1f) ^ uVar10; *puVar12 = DAT_00c35e8c & 1; fVar1 = *pfVar8; fVar2 = pfVar8[1]; fVar13 = (float)param_1[5]; fVar15 = cos(fVar13 * 0.017453292); fVar16 = sin(fVar13 * 0.017453292); fVar13 = (float)param_1[6]; fVar14 = (float)param_1[6]; fVar3 = (float)param_1[10]; fVar4 = (float)param_1[0xb]; puVar12[5] = (uint)x; puVar12[10] = (uint)(((fVar1 / 0.65) * fVar15 - (fVar2 / 0.65) * fVar16) * fVar13 + fVar3); puVar12[0xb] = (uint)(((fVar2 / 0.65) * fVar15 + (fVar1 / 0.65) * fVar16) * fVar14 + fVar4); puVar12[4] = param_1[4]; puVar12[6] = (uint)((float)param_1[6] * 0.75); puVar12[8] = param_1[8]; iVar5 = param_1[9]; puVar12[7] = 0x3f800000; puVar12[9] = iVar5 + 1; *local_28 = (int)puVar12; grow_vein_branches(puVar12); } else { *local_28 = 0; } local_28 = local_28 + 1; local_1c = local_1c + 1; } while (local_1c < 3); } return; } //@@ 00996e40 FUN_00996e40 void FUN_00996e40(undefined4 *param_1) { int iVar1; if (param_1 != (undefined4 *)0x0) { iVar1 = 3; do { param_1 = param_1 + 1; FUN_00996e40(*param_1); operator_delete((void *)*param_1,0x34); *param_1 = 0; iVar1 = iVar1 + -1; } while (iVar1 != 0); } return; } //@@ 00996e90 FXLayers::update_vein_branch /* DB: recursive over a vein node tree (3 child pointers +4/+8/+0xc, depth +0x24): fades alpha +0x1c by 0.05 toward 1 depending on which side of the node's angle the point this+0x4f0/+0x4f4 lies; called from FXLayers::Update (00993a70) */ void FXLayers::update_vein_branch(int *param_1) { code *pcVar1; bool bVar2; qword qVar3; int *piVar4; float *pfVar5; undefined4 *puVar6; uint uVar7; int in_ECX; int iVar8; qword *pqVar9; uint *puVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; int *local_28; int local_14; if (param_1 == (int *)0x0) { return; } local_28 = param_1 + 1; bVar2 = false; iVar8 = 0; piVar4 = local_28; do { if (*piVar4 != 0) { bVar2 = true; break; } iVar8 = iVar8 + 1; piVar4 = piVar4 + 1; } while (iVar8 < 3); if ((char)param_1[0xc] == '\0') { fVar11 = ((float)param_1[5] - 90.0) * 0.017453292; fVar12 = sin(fVar11); fVar15 = *(float *)(in_ECX + 0x4f4); fVar13 = (float)param_1[0xb]; fVar11 = cos(fVar11); if (0.0 <= fVar12 * (fVar15 - fVar13) + fVar11 * (*(float *)(in_ECX + 0x4f0) - (float)param_1[10])) { fVar15 = (float)param_1[7]; param_1[7] = (int)(fVar15 + 0.05); if (1.0 < fVar15 + 0.05) { param_1[7] = 0x3f800000; } if (param_1[1] != 0) { *(undefined1 *)(param_1[1] + 0x30) = 0; } if (param_1[2] != 0) { *(undefined1 *)(param_1[2] + 0x30) = 0; } if (param_1[3] != 0) { *(undefined1 *)(param_1[3] + 0x30) = 0; } goto LAB_00996fdb; } } if (bVar2) { if (param_1[1] != 0) { *(undefined1 *)(param_1[1] + 0x30) = 1; } if (param_1[2] != 0) { *(undefined1 *)(param_1[2] + 0x30) = 1; } if (param_1[3] != 0) { *(undefined1 *)(param_1[3] + 0x30) = 1; } } else { fVar15 = (float)param_1[7]; param_1[7] = (int)(fVar15 - 0.05); if (fVar15 - 0.05 < -1.0) { param_1[7] = (int)&DAT_bf800000; } } LAB_00996fdb: local_14 = 0; do { if (*(int *)(*param_1 * 0x114 + 0x2fc + in_ECX) == 0) { pfVar5 = (float *)0x0; } else { pfVar5 = AnimationState::GetNullFrameById ((AnimationState *)(*param_1 * 0x114 + 0x2f8 + in_ECX),local_14); } fVar15 = (float)param_1[5]; fVar13 = fVar15 + pfVar5[0x11]; if (360.0 < ABS(fVar13)) { fVar13 = fmodf(fVar13,360.0); } if (fVar13 <= 180.0) { if (fVar13 < -180.0) { fVar13 = fVar13 + 360.0; } } else { fVar13 = fVar13 - 360.0; } fVar11 = *pfVar5; fVar15 = fVar15 * 0.017453292; fVar12 = pfVar5[1]; fVar14 = cos(fVar15); fVar15 = sin(fVar15); puVar6 = (undefined4 *)*local_28; fVar16 = ((fVar11 / 0.65) * fVar14 - (fVar12 / 0.65) * fVar15) * (float)param_1[6] + (float)param_1[10]; fVar15 = ((fVar12 / 0.65) * fVar14 + (fVar11 / 0.65) * fVar15) * (float)param_1[6] + (float)param_1[0xb]; if (puVar6 == (undefined4 *)0x0) { if ((param_1[9] < 4) && (1.0 <= (float)param_1[7])) { fVar12 = (fVar13 - 90.0) * 0.017453292; fVar14 = sin(fVar12); fVar11 = *(float *)(in_ECX + 0x4f4); fVar12 = cos(fVar12); if (0.0 <= fVar14 * (fVar11 - fVar15) + fVar12 * (*(float *)(in_ECX + 0x4f0) - fVar16)) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } puVar6 = malloc(0x38); if (puVar6 == (undefined4 *)0x0) { piVar4 = *(int **)g_memoryManager_oomHandlers; if (piVar4 != g_memoryManager_oomHandlers) { do { (*(code *)piVar4[2])(0x7fcb9dd6,piVar4[3]); piVar4 = (int *)*piVar4; } while (piVar4 != g_memoryManager_oomHandlers); } LAB_009972ba: puVar10 = (uint *)0x0; } else { *puVar6 = 0x38; qVar3 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 + 0x38; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) + (uint)(0xffffffc7 < (uint)qVar3); puVar10 = puVar6 + 1; if (puVar10 == (uint *)0x0) goto LAB_009972ba; *puVar10 = 0; puVar6[5] = 0; puVar6[6] = 0; puVar6[7] = 0x3f800000; puVar6[8] = 0; puVar6[9] = 0x3f800000; puVar6[10] = 0; puVar6[0xc] = 0; puVar6[0xb] = 0; *(undefined1 *)(puVar6 + 0xd) = 0; *(undefined8 *)(puVar6 + 2) = 0; puVar6[4] = 0; } if ((DAT_00c35e8c == 0) && (KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"), DAT_00c35e8c == 0)) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar7 = DAT_00c35e8c >> ((byte)DAT_00c35e90 & 0x1f) ^ DAT_00c35e8c; uVar7 = uVar7 << ((byte)DAT_00c35e94 & 0x1f) ^ uVar7; DAT_00c35e8c = uVar7 >> ((byte)DAT_00c35e98 & 0x1f) ^ uVar7; uVar7 = DAT_00c35e8c & 1; puVar10[10] = (uint)fVar16; puVar10[0xb] = (uint)fVar15; *puVar10 = uVar7; puVar10[5] = (uint)fVar13; puVar10[6] = (uint)((float)param_1[6] * 0.85); puVar10[8] = param_1[8]; iVar8 = param_1[9]; puVar10[7] = 0; puVar10[9] = iVar8 + 1; *local_28 = (int)puVar10; } } } else if (0.0 < (float)puVar6[7] || (float)puVar6[7] == 0.0) { puVar6[10] = fVar16; puVar6[0xb] = fVar15; *(float *)(*local_28 + 0x14) = fVar13; *(float *)(*local_28 + 0x18) = (float)param_1[6] * 0.75; *(int *)(*local_28 + 0x20) = param_1[8]; update_vein_branch(*local_28); } else { iVar8 = 3; do { puVar6 = puVar6 + 1; FUN_00996e40(*puVar6); operator_delete((void *)*puVar6,0x34); *puVar6 = 0; iVar8 = iVar8 + -1; } while (iVar8 != 0); operator_delete((void *)*local_28,0x34); *local_28 = 0; } local_28 = local_28 + 1; local_14 = local_14 + 1; if (2 < local_14) { return; } } while( true ); } //@@ 009973e0 FUN_009973e0 void FUN_009973e0(void) { int iVar1; int *in_ECX; int iVar2; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (iVar2 == iVar1) { in_ECX[1] = iVar2; return; } do { std::vector<20byte>::_Tidy(); iVar2 = iVar2 + 0x2c; } while (iVar2 != iVar1); in_ECX[1] = *in_ECX; return; } //@@ 00997410 std::vector<44byte>::_Tidy /* DB: destroys each 0x2c-byte group (inner vector<20byte>::_Tidy) and frees; FXLayers::destructor 0098f8c0 FXLayers::destructor void std::vector<44byte>::_Tidy(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { vector<20byte>::_Tidy(); pvVar1 = (void *)((int)pvVar1 + 0x2c); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x2c) * 0x2c; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00997490 std::vector::_Tidy /* DB: destroys 0x4c-byte elements (FUN_00997de0) and frees; FXLayers::destructor 0098f8c0 FXLayers::destructor void std::vector::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { _Destroy_range(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x4c) * 0x4c; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00997510 std::vector<20byte>::resize /* DB: shrink sets end, grow fills (FUN_009981d0) or reallocates (00998300); Game::start_poop_cloud_screen_effect */ int std::vector<20byte>::resize(uint param_1) { uint uVar1; int iVar2; int *in_ECX; int iVar3; iVar3 = in_ECX[1] - *in_ECX; iVar2 = iVar3 * 0x66666667; uVar1 = iVar3 / 0x14; if (param_1 < uVar1) { iVar2 = *in_ECX + param_1 * 0x14; in_ECX[1] = iVar2; return iVar2; } if (uVar1 < param_1) { if ((uint)((in_ECX[2] - *in_ECX) / 0x14) < param_1) { iVar2 = _Resize_reallocate(param_1,¶m_1); return iVar2; } iVar2 = FUN_009981d0(in_ECX[1],param_1 - uVar1,param_1); in_ECX[1] = iVar2; } return iVar2; } //@@ 00997590 FUN_00997590 void FUN_00997590(int param_1,int param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x2c) { std::vector<20byte>::_Tidy(); } return; } //@@ 009975c0 std::vector<20byte>::_Tidy /* DB: destroys 0x14-byte elements (FUN_00997e70) and frees; FXLayers::clear and the 44-byte group helpers */ void std::vector<20byte>::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { _Destroy_range(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x14) * 0x14; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00997640 FUN_00997640 void FUN_00997640(void) { std::_Destroy_range(); return; } //@@ 00997660 FUN_00997660 void FUN_00997660(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x2c; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 009976a0 FUN_009976a0 void FUN_009976a0(void) { std::_Destroy_range(); return; } //@@ 009976c0 FUN_009976c0 void FUN_009976c0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x4c; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 00997700 FXLayerGroup::copy_constructor /* DB: ? EDX = dest: copies 7 dwords and the vector<20byte> at +0x1c of a 0x2c-byte FXLayers group element; FXLayers::LoadConfig, std::vector<44byte>::_Emplace_reallocate */ void FXLayerGroup::copy_constructor(undefined4 *param_1) { undefined4 *puVar1; uint uVar2; void *pvVar3; undefined4 uVar4; undefined4 *in_EDX; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d65d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_EDX = *param_1; in_EDX[1] = param_1[1]; in_EDX[2] = param_1[2]; in_EDX[3] = param_1[3]; in_EDX[4] = param_1[4]; in_EDX[5] = param_1[5]; in_EDX[6] = param_1[6]; in_EDX[7] = 0; in_EDX[8] = 0; in_EDX[9] = 0; if (param_1[7] != param_1[8]) { uVar5 = (int)(param_1[8] - param_1[7]) / 0x14; if (0xccccccc < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar2); } uVar5 = uVar5 * 0x14; pvVar3 = std::_Allocate(uVar5); puVar1 = in_EDX + 7; *puVar1 = pvVar3; in_EDX[8] = pvVar3; in_EDX[9] = (void *)((int)pvVar3 + uVar5); local_8 = 0; uVar4 = std::_Uninitialized_move(*puVar1,puVar1); in_EDX[8] = uVar4; } *(undefined1 *)(in_EDX + 10) = *(undefined1 *)(param_1 + 10); *(undefined1 *)((int)in_EDX + 0x29) = *(undefined1 *)((int)param_1 + 0x29); ExceptionList = local_10; return; } //@@ 00997800 std::vector<44byte>::_Emplace_reallocate /* DB: 0x2c-byte elements (max 0x5d1745d), copy via 00997700, destroy via 009975c0; FXLayers::LoadConfig (layer-group vector +0x24) */ void * std::vector<44byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { int iVar1; uint uVar2; void *pvVar3; void *pvVar4; int *in_ECX; uint uVar5; void *pvVar6; uint uVar7; void *pvVar8; int iVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d680; local_10 = ExceptionList; ExceptionList = &local_10; iVar9 = *in_ECX; iVar1 = (in_ECX[1] - iVar9) / 0x2c; if (iVar1 == 0x5d1745d) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = iVar1 + 1; uVar7 = (in_ECX[2] - iVar9) / 0x2c; if (0x5d1745d - (uVar7 >> 1) < uVar7) { uVar5 = 0x5d1745d; } else { uVar7 = (uVar7 >> 1) + uVar7; uVar5 = uVar2; if (uVar2 <= uVar7) { uVar5 = uVar7; } if (0x5d1745d < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = _Allocate(uVar5 * 0x2c); local_8 = 0; pvVar6 = (void *)(((param_1 - iVar9) / 0x2c) * 0x2c + (int)pvVar3); FXLayerGroup::copy_constructor(param_2); iVar9 = *in_ECX; pvVar4 = pvVar3; if (param_1 != in_ECX[1]) { FUN_009983f0(pvVar3,iVar9); pvVar4 = (void *)((int)pvVar6 + 0x2c); } FUN_009983f0(pvVar4,iVar9); pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { pvVar8 = (void *)in_ECX[1]; if (pvVar4 != pvVar8) { do { vector<20byte>::_Tidy(); pvVar4 = (void *)((int)pvVar4 + 0x2c); } while (pvVar4 != pvVar8); pvVar4 = (void *)*in_ECX; } uVar7 = ((in_ECX[2] - (int)pvVar4) / 0x2c) * 0x2c; pvVar8 = pvVar4; if (0xfff < uVar7) { pvVar8 = *(void **)((int)pvVar4 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar7); } *in_ECX = (int)pvVar3; in_ECX[1] = (int)(uVar2 * 0x2c + (int)pvVar3); in_ECX[2] = (int)(uVar5 * 0x2c + (int)pvVar3); ExceptionList = local_10; return pvVar6; } //@@ 009979a9 Catch_All@009979a9 void Catch_All_009979a9(void) { int unaff_EBP; FUN_00997590(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x24)); FUN_00997660(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009979e0 std::vector<20byte>::_Emplace_reallocate /* DB: 0x14-byte elements, max 0xccccccc; FXLayers::LoadConfig */ undefined4 * std::vector<20byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; void *pvVar3; int iVar4; void *pvVar5; int *in_ECX; uint uVar6; uint uVar7; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d6a0; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x14; if (iVar4 == 0xccccccc) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar7 = (in_ECX[2] - *in_ECX) / 0x14; if (0xccccccc - (uVar7 >> 1) < uVar7) { uVar6 = 0xccccccc; } else { uVar7 = (uVar7 >> 1) + uVar7; uVar6 = iVar4 + 1U; if (iVar4 + 1U <= uVar7) { uVar6 = uVar7; } if (0xccccccc < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(uVar6 * 0x14); local_8 = 0; puVar1 = (undefined4 *)((int)pvVar5 + ((param_1 - iVar2) / 0x14) * 0x14); *puVar1 = *param_2; puVar1[1] = param_2[1]; puVar1[2] = param_2[2]; KAGE::SmartPointer::operator_assign(puVar1 + 3,param_2 + 3); if (param_1 == in_ECX[1]) { _Uninitialized_move(pvVar5); } else { FUN_00998030(*in_ECX,param_1,pvVar5); FUN_00998030(param_1,in_ECX[1],puVar1 + 5); } if (*in_ECX != 0) { _Destroy_range(*in_ECX); pvVar3 = (void *)*in_ECX; uVar7 = ((in_ECX[2] - (int)pvVar3) / 0x14) * 0x14; ptr = pvVar3; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar3 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)pvVar5; in_ECX[1] = (int)((int)pvVar5 + (iVar4 + 1) * 0x14); in_ECX[2] = (int)(uVar6 * 0x14 + (int)pvVar5); ExceptionList = local_10; return puVar1; } //@@ 00997ba4 Catch_All@00997ba4 void Catch_All_00997ba4(void) { int unaff_EBP; FUN_009976a0(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x28)); deallocate(*(void **)(unaff_EBP + -0x2c),*(uint *)(unaff_EBP + -0x18)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00997be0 std::vector::_Emplace_reallocate /* DB: 0x4c-byte elements (max 0x35e50d7), element copy via 00997ef0; FXLayers::LoadConfig (_fxLayers +0x18) */ void * std::vector::_Emplace_reallocate(void *param_1,void *param_2) { int iVar1; void *pvVar2; int iVar3; uint uVar4; void *pvVar5; int *in_ECX; void *extraout_ECX; uint uVar6; void *this; void *this_00; void *pvVar7; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d6cd; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; iVar3 = (in_ECX[1] - iVar1) / 0x4c; if (iVar3 == 0x35e50d7) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar4 = iVar3 + 1; uVar6 = (in_ECX[2] - iVar1) / 0x4c; if (0x35e50d7 - (uVar6 >> 1) < uVar6) { local_20 = 0x35e50d7; } else { uVar6 = (uVar6 >> 1) + uVar6; local_20 = uVar4; if (uVar4 <= uVar6) { local_20 = uVar6; } if (0x35e50d7 < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(local_20 * 0x4c); local_8 = 0; this_00 = (void *)((((int)param_1 - iVar1) / 0x4c) * 0x4c + (int)pvVar5); FXLayer::copy_constructor(this_00,param_2); pvVar2 = (void *)in_ECX[1]; pvVar7 = (void *)*in_ECX; if (param_1 == pvVar2) { local_8 = CONCAT31(local_8._1_3_,1); this = pvVar5; for (; pvVar7 != pvVar2; pvVar7 = (void *)((int)pvVar7 + 0x4c)) { FXLayer::copy_constructor(this,pvVar7); this = (void *)((int)this + 0x4c); param_1 = extraout_ECX; } _Destroy_range(param_1); } else { FUN_009980d0(pvVar7,param_1,pvVar5); FUN_009980d0(param_1,in_ECX[1],(int)this_00 + 0x4c); } if (*in_ECX != 0) { _Destroy_range(*in_ECX); pvVar2 = (void *)*in_ECX; uVar6 = ((in_ECX[2] - (int)pvVar2) / 0x4c) * 0x4c; pvVar7 = pvVar2; if (0xfff < uVar6) { pvVar7 = *(void **)((int)pvVar2 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar6); } *in_ECX = (int)pvVar5; in_ECX[1] = (int)(uVar4 * 0x4c + (int)pvVar5); in_ECX[2] = (int)(local_20 * 0x4c + (int)pvVar5); ExceptionList = local_10; return this_00; } //@@ 00997db6 Catch_All@00997db6 void Catch_All_00997db6(void) { int unaff_EBP; FUN_00997640(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x2c)); FUN_009976c0(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x24)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00997de0 std::_Destroy_range /* DB: ECX..EDX range of 0x4c-byte FXLayer: _Tidy the vector at +0xc and releases the image SmartPointer at +4 (g_imageReleaseFn); std::vector::_Tidy/_Emplace_reallocate, FXLayers::clear */ void std::_Destroy_range(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; void *this; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { this = (void *)(in_ECX + 0xc); do { local_8 = 0xffffffff; FID_conflict__Tidy(this); local_8 = 0; if (*(int **)((int)this + -4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)((int)this + -4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)this + -8); } } iVar1 = (int)this + 0x40; this = (void *)((int)this + 0x4c); } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00997e70 std::_Destroy_range /* DB: ? ECX..EDX range of 0x14-byte elements: releases the image SmartPointer at +0xc (g_imageReleaseFn); std::vector<20byte>::_Tidy/_Emplace_reallocate */ void std::_Destroy_range(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { iVar4 = in_ECX + 0xc; do { local_8 = 0; if (*(int **)(iVar4 + 4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar4 + 4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(iVar4); } } iVar1 = iVar4 + 8; iVar4 = iVar4 + 0x14; } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00997ef0 FXLayer::copy_constructor /* DB: copies a 0x4c-byte _fxLayers element: dword +0, KAGE::SmartPointer +4, vector at +0xc..; used by std::vector::_Emplace_reallocate 00997be0 std::vector::_Emplace_reallocate FXLayers::LoadConfig prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall FXLayer::copy_constructor(void *this,void *other) { undefined4 *puVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; uint uVar6; void *pvVar7; undefined4 *puVar8; uint uVar9; undefined4 *puVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d700; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)this = *(undefined4 *)other; KAGE::SmartPointer::operator_assign((void *)((int)this + 4),(void *)((int)other + 4)); local_8 = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0; puVar2 = *(undefined4 **)((int)other + 0x10); puVar10 = *(undefined4 **)((int)other + 0xc); if (puVar10 != puVar2) { uVar9 = ((int)puVar2 - (int)puVar10) / 0x14; if (0xccccccc < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(uVar6); } uVar9 = uVar9 * 0x14; pvVar7 = std::_Allocate(uVar9); *(void **)((int)this + 0xc) = pvVar7; *(void **)((int)this + 0x10) = pvVar7; *(void **)((int)this + 0x14) = (void *)((int)pvVar7 + uVar9); puVar8 = *(undefined4 **)((int)this + 0xc); do { uVar3 = puVar10[1]; uVar4 = puVar10[2]; uVar5 = puVar10[3]; *puVar8 = *puVar10; puVar8[1] = uVar3; puVar8[2] = uVar4; puVar8[3] = uVar5; puVar1 = puVar10 + 4; puVar10 = puVar10 + 5; puVar8[4] = *puVar1; puVar8 = puVar8 + 5; } while (puVar10 != puVar2); *(undefined4 **)((int)this + 0x10) = puVar8; } *(undefined4 *)((int)this + 0x18) = *(undefined4 *)((int)other + 0x18); *(undefined4 *)((int)this + 0x1c) = *(undefined4 *)((int)other + 0x1c); *(undefined4 *)((int)this + 0x20) = *(undefined4 *)((int)other + 0x20); *(undefined4 *)((int)this + 0x24) = *(undefined4 *)((int)other + 0x24); *(undefined4 *)((int)this + 0x28) = *(undefined4 *)((int)other + 0x28); *(undefined4 *)((int)this + 0x2c) = *(undefined4 *)((int)other + 0x2c); *(undefined4 *)((int)this + 0x30) = *(undefined4 *)((int)other + 0x30); *(undefined4 *)((int)this + 0x34) = *(undefined4 *)((int)other + 0x34); *(undefined1 *)((int)this + 0x38) = *(undefined1 *)((int)other + 0x38); *(undefined1 *)((int)this + 0x39) = *(undefined1 *)((int)other + 0x39); *(undefined4 *)((int)this + 0x3c) = *(undefined4 *)((int)other + 0x3c); *(undefined4 *)((int)this + 0x40) = *(undefined4 *)((int)other + 0x40); *(undefined4 *)((int)this + 0x44) = *(undefined4 *)((int)other + 0x44); *(undefined1 *)((int)this + 0x48) = *(undefined1 *)((int)other + 0x48); ExceptionList = local_10; return this; } //@@ 00998030 FUN_00998030 undefined4 * FUN_00998030(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; undefined4 *puVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0d72d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (param_1 != param_2) { puVar3 = param_1 + 2; do { *param_3 = puVar3[-2]; param_3[1] = puVar3[-1]; param_3[2] = *puVar3; KAGE::SmartPointer::operator_assign(param_3 + 3,puVar3 + 1); param_3 = param_3 + 5; puVar1 = puVar3 + 3; in_ECX = extraout_ECX; puVar3 = puVar3 + 5; } while (puVar1 != param_2); } std::_Destroy_range(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 009980d0 FUN_009980d0 void * FUN_009980d0(void *param_1,void *param_2,void *param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0d75d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = (void *)((int)param_1 + 0x4c)) { FXLayer::copy_constructor(param_3,param_1); param_3 = (void *)((int)param_3 + 0x4c); ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } std::_Destroy_range(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 00998150 FID_conflict:_Change_array /* Library Function - Multiple Matches With Different Base Names private: void __thiscall std::vector >::_Change_array(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(struct GSISymbolEntry * const,unsigned int,unsigned int) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Change_array(void *this,FileSymbolInfo *param_1,uint param_2,uint param_3) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x14) * 0x14; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(FileSymbolInfo **)this = param_1; *(FileSymbolInfo **)((int)this + 4) = param_1 + param_2 * 0x14; *(FileSymbolInfo **)((int)this + 8) = param_1 + param_3 * 0x14; return; } //@@ 009981d0 FUN_009981d0 void FUN_009981d0(float *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = g_vectorZero.x; param_1[1] = g_vectorZero.y; param_1[2] = g_vectorZero.x; param_1[3] = g_vectorZero.y; *(undefined2 *)(param_1 + 4) = 0; param_1 = param_1 + 5; } return; } //@@ 00998230 FUN_00998230 void FUN_00998230(void) { void *pvVar1; int *piVar2; uint size; undefined4 *in_ECX; void *ptr; piVar2 = (int *)*in_ECX; if (piVar2 == (int *)0x0) { return; } if (*piVar2 != 0) { std::_Destroy_range(*piVar2); pvVar1 = (void *)*piVar2; size = ((piVar2[2] - (int)pvVar1) / 0x14) * 0x14; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *piVar2 = 0; piVar2[1] = 0; piVar2[2] = 0; } return; } //@@ 00998240 FUN_00998240 void FUN_00998240(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; std::map::insert(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00998270 std::map::lower_bound /* DB: lower bound by string_compare on the global map head DAT_00c94320; FXLayers::LoadConfig looks up the layer type names (foreground/background/behind/lighting/underwater/overlay -> 1..6) */ int * std::map::lower_bound(int *param_1,byte *param_2) { char cVar1; uint uVar2; uint lengthB; byte *b; int iVar3; byte *a; undefined4 *puVar4; iVar3 = DAT_00c94320; puVar4 = *(undefined4 **)(DAT_00c94320 + 4); *param_1 = (int)puVar4; cVar1 = *(char *)((int)puVar4 + 0xd); param_1[1] = 0; param_1[2] = iVar3; if (cVar1 == '\0') { uVar2 = *(uint *)(param_2 + 0x14); lengthB = *(uint *)(param_2 + 0x10); do { *param_1 = (int)puVar4; a = (byte *)(puVar4 + 4); b = param_2; if (0xf < uVar2) { b = *(byte **)param_2; } if (0xf < (uint)puVar4[9]) { a = *(byte **)a; } iVar3 = string_compare(a,puVar4[8],b,lengthB); if (-1 < iVar3) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(-1 < iVar3); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 00998300 std::vector<20byte>::_Resize_reallocate /* DB: grow to param_1 elements of 0x14 bytes filled from param_2 (FUN_009981d0), max 0xccccccc; FXLayers::LoadConfig and std::vector<20byte>::resize 00997510 std::vector<20byte>::resize void std::vector<20byte>::_Resize_reallocate(uint param_1,undefined1 *param_2) { undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 *puVar6; FileSymbolInfo *pFVar7; undefined4 *puVar8; int *in_ECX; undefined4 *extraout_EDX; uint uVar9; if (0xccccccc < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar2 = (in_ECX[1] - *in_ECX) / 0x14; uVar9 = (in_ECX[2] - *in_ECX) / 0x14; if (0xccccccc - (uVar9 >> 1) < uVar9) { uVar9 = 0xccccccc; } else { uVar9 = (uVar9 >> 1) + uVar9; if (uVar9 < param_1) { uVar9 = param_1; } else if (0xccccccc < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pFVar7 = _Allocate(uVar9 * 0x14); FUN_009981d0(pFVar7 + iVar2 * 0x14,param_1 - iVar2,*param_2); puVar1 = (undefined4 *)in_ECX[1]; puVar6 = extraout_EDX; for (puVar8 = (undefined4 *)*in_ECX; puVar8 != puVar1; puVar8 = puVar8 + 5) { uVar3 = puVar8[1]; uVar4 = puVar8[2]; uVar5 = puVar8[3]; *puVar6 = *puVar8; puVar6[1] = uVar3; puVar6[2] = uVar4; puVar6[3] = uVar5; puVar6[4] = puVar8[4]; puVar6 = puVar6 + 5; } FID_conflict__Change_array(in_ECX,pFVar7,param_1,uVar9); return; } //@@ 009983f0 FUN_009983f0 undefined4 * FUN_009983f0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 8; do { *puVar6 = puVar5[-8]; puVar6[1] = puVar5[-7]; puVar6[2] = puVar5[-6]; puVar6[3] = puVar5[-5]; puVar6[4] = puVar5[-4]; puVar6[5] = puVar5[-3]; puVar6[6] = puVar5[-2]; uVar2 = *puVar5; uVar3 = puVar5[-1]; uVar4 = puVar5[1]; puVar5[1] = 0; *puVar5 = 0; puVar5[-1] = 0; *(undefined4 *)((int)param_1 + (-0x2c - (int)in_ECX) + (int)(puVar5 + 0xb)) = uVar2; puVar6[7] = uVar3; puVar6[9] = uVar4; *(undefined1 *)(puVar6 + 10) = *(undefined1 *)(puVar5 + 2); *(undefined1 *)((int)puVar6 + 0x29) = *(undefined1 *)((int)puVar5 + 9); puVar1 = puVar5 + 3; puVar6 = puVar6 + 0xb; puVar5 = puVar5 + 0xb; } while (puVar1 != in_EDX); } return puVar6; } //@@ 00998490 std::_Uninitialized_move /* DB: ? copies 0x14-byte {3 dwords, SmartPointer} elements then destroys the source (00997e70); FXLayerGroup::copy_constructor, std::vector<20byte>::_Emplace_reallocate */ undefined4 * std::_Uninitialized_move(undefined4 *param_1) { undefined4 *puVar1; uint uVar2; undefined4 *in_ECX; undefined4 *extraout_ECX; undefined4 *in_EDX; undefined4 *puVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0d72d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (in_ECX != in_EDX) { puVar3 = in_ECX + 2; do { *param_1 = puVar3[-2]; param_1[1] = puVar3[-1]; param_1[2] = *puVar3; KAGE::SmartPointer::operator_assign(param_1 + 3,puVar3 + 1); param_1 = param_1 + 5; puVar1 = puVar3 + 3; in_ECX = extraout_ECX; puVar3 = puVar3 + 5; } while (puVar1 != in_EDX); } _Destroy_range(in_ECX,uVar2); ExceptionList = local_10; return param_1; } //@@ 00998530 FUN_00998530 void FUN_00998530(void) { std::_Destroy_range(); return; } //@@ 00998540 FUN_00998540 void FUN_00998540(void) { std::_Destroy_range(); return; } //@@ 00998550 std::map::insert /* DB: ? builds a 0x2c-byte tree node (std::string key at +0x10, int value at +0x28) for the global map head DAT_00c94320, lower_bound (00998270) + string_compare, insert/rebalance; only caller FUN_00998240 */ int * std::map::insert(int *param_1,undefined4 *param_2) { byte *this; byte bVar1; char cVar2; int iVar3; void *pvVar4; int *piVar5; int *piVar6; uint uVar7; int *ptr; undefined8 *puVar8; byte *pbVar9; int iVar10; void *ptr_00; byte *pbVar11; uint size; int *piVar12; int *piVar13; undefined1 local_34 [12]; undefined8 local_28; int **local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af187d; local_10 = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_14 = DAT_00c94320; local_1c = &DAT_00c94320; local_8 = 0; local_18 = (int *)0x0; ptr = operator_new(0x2c); local_8 = 1; this = (byte *)(ptr + 4); pbVar9 = (byte *)*param_2; this[0] = 0; this[1] = 0; this[2] = 0; this[3] = 0; ptr[8] = 0; ptr[9] = 0xf; pbVar11 = pbVar9; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); local_18 = ptr; string::assign((char *)this,pbVar9,(int)pbVar11 - (int)(pbVar9 + 1)); ptr[10] = param_2[1]; *ptr = (int)local_14; ptr[1] = (int)local_14; ptr[2] = (int)local_14; *(undefined2 *)(ptr + 3) = 0; local_8 = 2; puVar8 = (undefined8 *)lower_bound(local_34,this); local_28 = *puVar8; iVar3 = *(int *)(puVar8 + 1); if (*(char *)(iVar3 + 0xd) == '\0') { pbVar9 = (byte *)(iVar3 + 0x10); if (0xf < *(uint *)(iVar3 + 0x24)) { pbVar9 = *(byte **)pbVar9; } pbVar11 = this; if (0xf < (uint)ptr[9]) { pbVar11 = *(byte **)this; } iVar10 = string_compare(pbVar11,ptr[8],pbVar9,*(uint *)(iVar3 + 0x20)); if (-1 < iVar10) { uVar7 = ptr[9]; *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; if (0xf < uVar7) { pvVar4 = *(void **)this; size = uVar7 + 1; ptr_00 = pvVar4; if (0xfff < size) { ptr_00 = *(void **)((int)pvVar4 + -4); size = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); } ptr[8] = 0; ptr[9] = 0xf; *this = 0; operator_delete(ptr,0x2c); ExceptionList = local_10; return param_1; } } piVar6 = DAT_00c94320; if (DAT_00c94324 == 0x5d1745d) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar7); } DAT_00c94324 = DAT_00c94324 + 1; ptr[1] = (int)(int *)local_28; if ((int *)local_28 == piVar6) { *piVar6 = (int)ptr; piVar6[1] = (int)ptr; piVar6[2] = (int)ptr; *(undefined1 *)(ptr + 3) = 1; } else { if (local_28._4_4_ == 0) { ((int *)local_28)[2] = (int)ptr; if ((int *)local_28 == (int *)piVar6[2]) { piVar6[2] = (int)ptr; } } else { *(int *)local_28 = (int)ptr; if ((int *)local_28 == (int *)*piVar6) { *piVar6 = (int)ptr; } } cVar2 = *(char *)(ptr[1] + 0xc); piVar13 = ptr; while (cVar2 == '\0') { piVar5 = (int *)piVar13[1]; piVar12 = *(int **)piVar5[1]; if (piVar5 == piVar12) { piVar12 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar12[3] == '\0') goto LAB_00998773; if (piVar13 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar13 = piVar5; } *(undefined1 *)(piVar13[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar13[1] + 4)); } else if ((char)piVar12[3] == '\0') { LAB_00998773: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar12 + 3) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; piVar13 = *(int **)(piVar13[1] + 4); } else { if (piVar13 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar13 = piVar5; } *(undefined1 *)(piVar13[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar13[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar13[1] + 4)); } cVar2 = *(char *)(piVar13[1] + 0xc); } *(undefined1 *)(piVar6[1] + 0xc) = 1; } *param_1 = (int)ptr; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return param_1; } //@@ 00998800 netplay_player_list_destructor /* DB: ? only an unwind funclet; destroys vector of 0x38-byte string entries (FUN_008cb2e0, the Game::~Game call before ANM2 Game+0x1d528) then ANM2 at +8: the Game+0x1d520 online overlay object */ void netplay_player_list_destructor(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; std::vector<56byte_string>::_Tidy(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x58)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x38)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 00998880 GameOver::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=Game+0x1d520 (zhl _gameOver 0x1d4c8 + drift) in Game::Render; anm2 at smallFont+8 (zhl GameOver.anm2 0x8), Seeds::Seed2String at "SeedPos" null, "Player%d Text", "DeedsMe" layer, ModManager::RenderCustomCollectionItem prototype: db/protos.zhl */ void __thiscall GameOver::Render(GameOver *smallFont) { byte bVar1; char cVar2; uint uVar3; void *pvVar4; LayerState *pLVar5; int iVar6; EntityPtr netplayPlayer; ItemConfig_Item *itemConfig; float extraout_EAX; float *nullFrame; char *text; Font *smallFont; byte *translatedText; byte *******pppppppbVar7; size_t copyLen; AnimationLayer *animLayer; int iVar8; byte *pbVar9; undefined4 extraout_ECX; undefined4 extraout_ECX_00; std_string *ptr; int layerEntry; uint uVar10; ANM2 *pAVar11; char *memberEntry; byte *deedName; KColor tmpColor; Vector drawPos; float local_124; Vector local_120; Vector screenCenter; float local_110; float local_10c; std_string *local_108; uint local_104; float local_100; EntityPtr local_fc; undefined4 local_f8; std_string *local_f4; char local_f0 [12]; uint local_e4; uint local_e0; byte *******deedText [2]; undefined4 seedHalf; undefined4 uStack_d0; undefined4 uStack_cc; uint uStack_c8; ColorMod tmpColorMod; undefined1 quad [48]; byte nullName [68]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *collectibleConfigs; Game *game; puStack_20 = nullName + 100; local_14 = 0xffffffff; puStack_18 = &LAB_00b0d7dd; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(nullName + 0x58); ExceptionList = &local_1c; local_124 = 0.0; if (*(int *)smallFont != 0) { tmpColor._red = 0.0; tmpColor._green = 0.0; tmpColor._blue = 0.0; tmpColor._alpha = 0.5019608; tmpColor._unk = 0; local_24 = uVar3; pvVar4 = render_quad_set_uniform_color(quad,0.0,0.0,g_screenWidth,g_screenHeight,&tmpColor); render_color_shader_pass(pvVar4); screenCenter.x = g_screenWidth * 0.5 + 16.0; screenCenter.y = g_screenHeight * 0.5 + 16.0; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { screenCenter.x = screenCenter.x - 112.0; } pLVar5 = ANM2::GetLayer((ANM2 *)&smallFont->field_0x8,&DAT_00000006); pLVar5->_visible = 0; local_fc = *(EntityPtr *)&(g_game->_playerManager).field_0x7c; if (local_fc == (EntityPtr)0x0) { local_fc = (EntityPtr)Game::GetPlayer(g_game,0); } if (*(int *)((int)local_fc + 0x13c0) == 0x28) { local_fc = *(EntityPtr *)((int)local_fc + 0x1e68); } if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (iVar6 = FUN_0090b070(uVar3), iVar6 != 0)) { FUN_0090b070(); netplayPlayer = (EntityPtr)FUN_004253d0(); if (netplayPlayer != (EntityPtr)0x0) { local_fc = netplayPlayer; } } local_108 = *(std_string **)((int)local_fc + 0x13c0); if ((int)local_108 < 0x29) { ANM2::Render((ANM2 *)&smallFont->field_0x8,&screenCenter,&g_vectorZero,&g_vectorZero); } else { pLVar5 = ANM2::GetLayer((ANM2 *)&smallFont->field_0x8,&DAT_00000004); pLVar5->_visible = 0; ANM2::Render((ANM2 *)&smallFont->field_0x8,&screenCenter,&g_vectorZero,&g_vectorZero); ModManager::RenderCustomGameOver(local_108,&screenCenter); } local_10c = g_vectorZero.x; local_110 = g_vectorZero.y; pLVar5 = ANM2::GetLayer((ANM2 *)&smallFont->field_0x8,&DAT_00000006); local_104 = 0x10; pLVar5->_visible = 1; pvVar4 = (((History *)((int)local_fc + 0x1dec))->_historyItems)._begin; if (pvVar4 != *(void **)((int)local_fc + 0x1df0)) { do { if (local_104 == 0) break; if (*(char *)((int)pvVar4 + 4) == '\0') { local_100 = *(float *)((int)pvVar4 + 8); } else { local_100 = 0.0; } if (g_game == (Game *)0x0) { if (-1 < (int)local_100) goto LAB_00998b3f; } else { if ((int)local_100 < 0) { if (((int)local_100 < 0) && (local_108 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)local_100 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)local_108 >> 2)) { itemConfig = (ItemConfig_Item *) **(undefined4 **)((int)local_108 + ~(uint)local_100 * 4); } else { itemConfig = (ItemConfig_Item *)0x0; } } else { LAB_00998b3f: collectibleConfigs = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)collectibleConfigs >> 2 <= (int)local_100) goto LAB_00998f1b; itemConfig = *(ItemConfig_Item **)((int)collectibleConfigs + (int)local_100 * 4); } if ((itemConfig != (ItemConfig_Item *)0x0) && ((itemConfig->type != 3 || (itemConfig->id == ((ActiveItemDesc *)((int)local_fc + 0x1580))->_item)))) { if ((int)local_100 < 0x2dd) { if ((int)local_100 < 1) { local_100 = 1.02715e-42; } else { local_100 = (float)((int)local_100 - 1); } if ((*(int *)&smallFont->field_0x3c != 0) && ((6 < *(int *)(*(int *)&smallFont->field_0x38 + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)(*(int *)&smallFont->field_0x38 + 0x80))))) { iVar6 = *(int *)&smallFont->field_0x3c; local_108 = *(std_string **)(iVar6 + 0x50); if ((iVar6 == 0) || (((int)local_108 < 0 || (*(int *)(iVar6 + 0x1c) <= (int)local_108)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)&smallFont->field_0x40 + (int)local_108 * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)&smallFont->field_0x38,(int)local_108,(float)(int)local_100) ; } local_120.x = local_10c + screenCenter.x; local_120.y = local_110 + screenCenter.y; if (smallFont->field_0x111 != '\0') { if (smallFont->field_0x78 == '\0') { iVar6 = *(int *)&smallFont->field_0x3c; if (((iVar6 != 0) && (6 < *(int *)(*(int *)&smallFont->field_0x38 + 0x80))) && (iVar8 = *(int *)(iVar6 + 0x50), -1 < iVar8)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar8 * 0x10 + *(int *)(iVar6 + 0x18)),&local_120, *(int *)(*(int *)&smallFont->field_0x40 + iVar8 * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)&smallFont->field_0x38); } iVar6 = *(int *)&smallFont->field_0x5c; if (((iVar6 != 0) && (6 < *(int *)(*(int *)&smallFont->field_0x58 + 0x80))) && (iVar8 = *(int *)(iVar6 + 0x50), -1 < iVar8)) { pAVar11 = *(ANM2 **)&smallFont->field_0x58; animLayer = (AnimationLayer *)(iVar8 * 0x10 + *(int *)(iVar6 + 0x18)); iVar6 = *(int *)&smallFont->field_0x60; goto LAB_00998e94; } } else { iVar6 = *(int *)&smallFont->field_0x5c; if (((iVar6 != 0) && (6 < *(int *)(*(int *)&smallFont->field_0x58 + 0x80))) && (iVar8 = *(int *)(iVar6 + 0x50), -1 < iVar8)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar8 * 0x10 + *(int *)(iVar6 + 0x18)),&local_120, *(int *)(*(int *)&smallFont->field_0x60 + iVar8 * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)&smallFont->field_0x58); } iVar6 = *(int *)&smallFont->field_0x3c; if (((iVar6 != 0) && (6 < *(int *)(*(int *)&smallFont->field_0x38 + 0x80))) && (iVar8 = *(int *)(iVar6 + 0x50), -1 < iVar8)) { pAVar11 = *(ANM2 **)&smallFont->field_0x38; animLayer = (AnimationLayer *)(iVar8 * 0x10 + *(int *)(iVar6 + 0x18)); iVar6 = *(int *)&smallFont->field_0x40; LAB_00998e94: AnimationLayer::RenderFrame (animLayer,&local_120,*(int *)(iVar6 + iVar8 * 4),&g_vectorZero, &g_vectorZero,pAVar11); } } } } else { if (*(int *)&smallFont->field_0x3c == 0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)(*(int *)&smallFont->field_0x38 + 0x80) < 7) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } iVar6 = *(int *)&smallFont->field_0x3c; if (((iVar6 == 0) || (*(int *)(*(int *)&smallFont->field_0x38 + 0x80) < 6)) || ((iVar8 = *(int *)(iVar6 + 0x50), iVar8 < 0 || (*(int *)(iVar6 + 0x1c) <= iVar8)))) { LAB_00998bff: iVar6 = 0; } else { layerEntry = iVar8 * 0x10 + *(int *)(*(int *)&smallFont->field_0x3c + 0x18); iVar6 = *(int *)(*(int *)&smallFont->field_0x40 + iVar8 * 4); if ((iVar6 < 0) || (*(int *)(layerEntry + 8) <= iVar6)) goto LAB_00998bff; iVar6 = iVar6 * 0x6c + *(int *)(layerEntry + 4); } if (iVar6 != 0) { tmpColor._unk = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { tmpColor._green = 8.40779e-45; } else { tmpColor._green = 1.4013e-45; } tmpColor._red = 0.0; tmpColor._blue = 9.80909e-45; tmpColor._alpha = 1.4013e-45; tmpColorMod._offset[0] = 0.0; tmpColorMod._tint[0] = 1.0; tmpColorMod._tint[1] = 1.0; tmpColorMod._tint[2] = 1.0; tmpColorMod._tint[3] = 1.0; tmpColorMod._offset[1] = 0.0; drawPos.x = screenCenter.x + *(float *)(iVar6 + 0x10) + local_10c; tmpColorMod._offset[2] = 0.0; tmpColorMod._colorize[0] = 0.0; tmpColorMod._colorize[1] = 0.0; tmpColorMod._colorize[2] = 0.0; tmpColorMod._colorize[3] = 0.0; drawPos.y = screenCenter.y + *(float *)(iVar6 + 0x14) + local_110; ModManager::RenderCustomCollectionItem (&g_manager->_modManager,(uint)local_100,&drawPos,&g_vectorOne, &tmpColorMod,&tmpColor); } } local_10c = local_10c + 16.0; local_110 = local_110 + 2.5; if (128.0 <= local_10c) { local_10c = local_10c - 132.0; local_110 = local_110 - 4.0; } local_104 = local_104 - 1; } } LAB_00998f1b: pvVar4 = (void *)((int)pvVar4 + 0x1c); } while (pvVar4 != *(void **)((int)local_fc + 0x1df0)); } if (*(int *)&smallFont[1].field_0xc != 0) { if (*(int *)&smallFont->field_0x3c == 0) { KAGE_LogMessage(0x10,(byte *)"AnimationData is NULL\n"); } if (*(int *)(*(int *)&smallFont->field_0x38 + 0x80) < 6) { KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"); } iVar6 = *(int *)&smallFont->field_0x3c; if ((((iVar6 != 0) && (4 < *(int *)(*(int *)&smallFont->field_0x38 + 0x80))) && (iVar8 = *(int *)(iVar6 + 0x4c), -1 < iVar8)) && (iVar8 < *(int *)(iVar6 + 0x1c))) { layerEntry = iVar8 * 0x10 + *(int *)(iVar6 + 0x18); iVar6 = *(int *)(*(int *)&smallFont->field_0x40 + iVar8 * 4); if (((-1 < iVar6) && (iVar6 < *(int *)(layerEntry + 8))) && (iVar6 = iVar6 * 0x6c + *(int *)(layerEntry + 4), iVar6 != 0)) { drawPos.x = screenCenter.x + *(float *)(iVar6 + 0x10); iVar8 = *(int *)&smallFont[1].field_0xc; tmpColorMod._offset[0] = 0.0; tmpColorMod._offset[1] = 0.0; tmpColorMod._offset[2] = 0.0; tmpColorMod._tint[0] = 1.0; tmpColorMod._tint[1] = 1.0; tmpColorMod._tint[2] = 1.0; tmpColorMod._tint[3] = 1.0; tmpColorMod._colorize[0] = 0.0; tmpColorMod._colorize[1] = 0.0; tmpColorMod._colorize[2] = 0.0; tmpColorMod._colorize[3] = 0.0; drawPos.y = screenCenter.y + *(float *)(iVar6 + 0x14); if (((iVar8 != 0) && (iVar6 = *(int *)(iVar8 + 0x160), iVar6 != 0)) && (pAVar11 = (ANM2 *)(iVar6 + 0xdf0), *(char *)(iVar6 + 0xef9) != '\0')) { ANM2::SetFrame(pAVar11,(std_string *)(iVar6 + 0xe08),*(int *)(iVar8 + 100)); Sprite::SetColor((Sprite *)pAVar11,&tmpColorMod); *(float *)(iVar6 + 0xe8c) = g_vectorOne.x; *(float *)(iVar6 + 0xe90) = g_vectorOne.y; ANM2::Render(pAVar11,&drawPos,&g_vectorZero,&g_vectorZero); } } } } game = g_game; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { uVar3 = (g_game->_seedEffects)._gameStartSeed; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar3 = (game->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)&local_f4,uVar3); uVar3 = local_e0; local_14 = 5; local_108 = (std_string *)&local_f4; if (0xf < local_e0) { local_108 = local_f4; } if (*(int *)&smallFont->field_0x3c != 0) { nullFrame = AnimationState::GetNullFrame ((AnimationState *)&smallFont->field_0x38,(byte *)"SeedPos"); uVar10 = local_e4; if (nullFrame != (float *)0x0) { local_124 = g_screenHeight * 0.5 + nullFrame[1]; local_100 = g_screenWidth * 0.5 + *nullFrame; copyLen = 4; if (local_e4 < 4) { copyLen = local_e4; } seedHalf = 0; uStack_d0 = 0; uStack_cc = 0; uStack_c8 = 0; memcpy(&seedHalf,local_108,copyLen); tmpColorMod._colorize[0] = 0.0; tmpColorMod._colorize[1] = 9.18341e-41; tmpColorMod._colorize[2] = 0.0; tmpColorMod._colorize[3] = 1.0; tmpColorMod._offset[0] = -NAN; tmpColorMod._offset[1] = 0.0; tmpColorMod._offset[2] = 0.0; local_14._0_1_ = 6; KColor::SetFromARGB(&tmpColor,0xff362f2d); local_100 = local_100 - 4.0; Font::DrawString(&seedHalf,extraout_ECX,tmpColorMod._colorize); seedHalf = 0; uStack_d0 = 0; uStack_cc = 0; uStack_c8 = 0; copyLen = 4; if (uVar10 - 4 < 4) { copyLen = uVar10 - 4; } memcpy(&seedHalf,local_108->_buf + 5,copyLen); tmpColorMod._colorize[0] = 0.0; tmpColorMod._colorize[1] = 9.18341e-41; tmpColorMod._colorize[2] = 0.0; tmpColorMod._colorize[3] = 1.0; tmpColorMod._offset[0] = -NAN; tmpColorMod._offset[1] = 0.0; tmpColorMod._offset[2] = 0.0; local_14 = CONCAT31(local_14._1_3_,7); KColor::SetFromARGB(&tmpColor,0xff362f2d); Font::DrawString(&seedHalf,extraout_ECX_00,tmpColorMod._colorize); uVar3 = local_e0; } } if (0xf < uVar3) { uVar10 = uVar3 + 1; ptr = local_f4; if (0xfff < uVar10) { ptr = (std_string *)local_f4[-1]._capacity; uVar10 = uVar3 + 0x24; if (0x1f < (uint)((int)local_f4 + (-4 - (int)ptr))) { LAB_0099978e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar10); } } else { local_108 = *(std_string **)(smallFont + 1); iVar8 = *(int *)&smallFont[1].field_0x4 - (int)local_108; local_104 = 0; iVar6 = iVar8 >> 0x1f; if (iVar8 / 0x38 + iVar6 != iVar6) { local_fc = (EntityPtr)0x0; do { if (0xdf < (uint)local_fc) { ExceptionList = local_1c; return; } memberEntry = local_108->_buf + (int)local_fc; local_120.x = (float)KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(memberEntry); local_14 = 0; local_120.x = (float)KAGE::System::UserProfile::vftable; local_120.y = extraout_EAX; if (((extraout_EAX != 0.0) && (*(int *)((int)extraout_EAX + 8) != 0 || *(int *)((int)extraout_EAX + 0xc) != 0)) && (*(int *)((int)extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_120); } local_14 = 1; cVar2 = (**(code **)((int)local_120.x + 0x14))(); local_14 = 0xffffffff; local_120.x = (float)KAGE::System::UserProfileBase::vftable; if (cVar2 != '\0') { pLVar5 = ANM2::GetLayer((ANM2 *)&smallFont->field_0x8,(byte *)"DeedsMe"); if (pLVar5 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame((ANM2 *)&smallFont->field_0x8,*(int *)pLVar5->_layerData,local_104); } } local_104 = local_104 + 1; sprintf_s(nullName,0x40,(byte *)"Player%d Text"); if (*(int *)&smallFont->field_0x3c == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame((AnimationState *)&smallFont->field_0x38,nullName); } drawPos.y = screenCenter.y + nullFrame[1]; drawPos.x = screenCenter.x + *nullFrame; local_f4 = (std_string *)0x55ffff; local_f0[4] = '\0'; local_f0[5] = '\0'; local_f0[6] = -0x80; local_f0[7] = '?'; local_f0[8] = -1; local_f0[9] = -1; local_f0[10] = -1; local_f0[0xb] = -1; local_e4 = 0; local_e0 = 0; local_14 = 2; text = memberEntry + 8; local_f8 = 1; local_f0[0] = '\x02'; local_f0[1] = '\0'; local_f0[2] = '\0'; local_f0[3] = '\0'; tmpColor._unk = 0; tmpColor._red = 0.21176471; tmpColor._green = 0.18431373; tmpColor._blue = 0.1764706; tmpColor._alpha = 1.0; if (0xf < *(uint *)(memberEntry + 0x1c)) { text = *(char **)text; } local_110 = drawPos.y; Font::DrawStringScaled (&g_manager->_font2_TeamMeatEx12,(byte *)text,&drawPos,&tmpColor,&local_f8); deedName = (byte *)&DAT_00c78f08; drawPos.y = local_110 + 18.0; smallFont = &g_manager->_font1_TeamMeatEx10; local_10c = 0.0; local_100 = 0.0; local_110 = drawPos.y; do { if (2 < (int)local_10c) break; cVar2 = FUN_008ca1d0(*(undefined4 *)(local_108->_buf + (int)local_fc), *(undefined4 *)((undefined1 *)((int)local_fc + 4) + (int)local_108) ,local_100); if (cVar2 != '\0') { pbVar9 = deedName; if (0xf < *(uint *)(deedName + 0x14)) { pbVar9 = *(byte **)deedName; } translatedText = string_table_translate(&g_manager->_stringTable,pbVar9); uStack_cc = 0; uStack_c8 = 0xf; deedText[0] = (byte *******)0x0; pbVar9 = translatedText; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); std::string::assign((char *)deedText,translatedText, (int)pbVar9 - (int)(translatedText + 1)); local_124 = (float)((uint)local_124 | 1); tmpColorMod._colorize[0] = 1.4013e-45; tmpColorMod._colorize[1] = 9.18341e-41; tmpColorMod._colorize[2] = 0.0; tmpColorMod._colorize[3] = 1.0; tmpColorMod._offset[0] = -NAN; tmpColorMod._offset[1] = 0.0; tmpColorMod._offset[2] = 0.0; local_14._0_1_ = 4; pppppppbVar7 = (byte *******)deedText; if (0xf < uStack_c8) { pppppppbVar7 = deedText[0]; } tmpColor._unk = 0; tmpColor._red = 0.21176471; tmpColor._green = 0.18431373; tmpColor._blue = 0.1764706; tmpColor._alpha = 1.0; Font::DrawStringScaled (smallFont,(byte *)pppppppbVar7,&drawPos,&tmpColor,tmpColorMod._colorize); drawPos.y = local_110 + 15.0; local_10c = (float)((int)local_10c + 1); local_14 = CONCAT31(local_14._1_3_,2); local_110 = drawPos.y; if (0xf < uStack_c8) { uVar3 = uStack_c8 + 1; pppppppbVar7 = deedText[0]; if (0xfff < uVar3) { pppppppbVar7 = (byte *******)deedText[0][-1]; uVar3 = uStack_c8 + 0x24; if ((byte *)0x1f < (byte *)((int)deedText[0] + (-4 - (int)pppppppbVar7))) goto LAB_0099978e; } operator_delete(pppppppbVar7,uVar3); } } deedName = deedName + 0x18; local_100 = (float)((int)local_100 + 1); } while ((int)deedName < 0xc79100); local_fc = (EntityPtr)((int)local_fc + 0x38); local_14 = 0xffffffff; local_108 = *(std_string **)(smallFont + 1); } while (local_104 < (uint)((*(int *)&smallFont[1].field_0x4 - (int)local_108) / 0x38)); } } } ExceptionList = local_1c; return; } //@@ 009997c0 GameOver::Show /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX = Game+0x1d520 (Game::_gameOver) (was DeathScreen::Show) */ void GameOver::Show(void) { byte isBossKiller; undefined4 uVar2; Entity_Player *deadPlayer; LayerState *layer; undefined4 *in_ECX; int extraout_ECX; byte *pbVar3; int layerId; void *pvVar4; int extraout_EDX; uint uVar5; byte *nameEnd; char *anm2Path; int iVar6; int iVar7; Game *game; uint uStack_88; EntityConfig_Entity *pEStack_84; int stageFrame; undefined8 uStack_74; void *pvStack_6c; undefined4 uStack_5c; uint uStack_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined4 uStack_44; undefined4 uStack_40; std_string anm2File; byte playerLabel [12]; int playerType; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isBossKiller; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0d825; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(playerLabel + 0x20); ExceptionList = &local_10; if ((g_game->_pauseScreen)._state != 0) { PopupWindow::hide(&g_game->_pauseScreen); } *in_ECX = 2; *(undefined1 *)(in_ECX + 0x47) = 1; PopupButtons::reset(1); if (*(int *)(extraout_EDX + 0x4b3d8) == *(int *)(extraout_EDX + 0x4b3dc)) { *(undefined4 *)(extraout_ECX + 0x11c) = 3; uVar2 = 2; } else { *(code **)(extraout_ECX + 0x264) = FUN_008cb190; uVar2 = 6; *(undefined4 **)(extraout_ECX + 0x268) = in_ECX; *(undefined4 *)(extraout_ECX + 0x118) = 0x42c00000; *(undefined4 *)(extraout_ECX + 0x114) = 0x42c00000; } *(undefined4 *)(extraout_ECX + 0x24c) = uVar2; anm2Path = "gfx/ui/DeedsDeathScreen.anm2"; if (*(int *)(extraout_EDX + 0x4b3d8) == *(int *)(extraout_EDX + 0x4b3dc)) { anm2Path = "gfx/ui/Death Screen.anm2"; } anm2File._size = 0; anm2File._capacity = 0xf; anm2File._buf._0_4_ = (void *)0x0; pbVar3 = (byte *)anm2Path; do { isBossKiller = *pbVar3; pbVar3 = pbVar3 + 1; } while (isBossKiller != 0); std::string::assign(anm2File._buf,(byte *)anm2Path,(int)pbVar3 - (int)(anm2Path + 1)); local_8 = 0; ANM2::Load((ANM2 *)(in_ECX + 2),&anm2File,1); local_8 = 0xffffffff; if (0xf < anm2File._capacity) { uVar5 = anm2File._capacity + 1; pvVar4 = (void *)anm2File._buf._0_4_; if (0xfff < uVar5) { pvVar4 = *(void **)(anm2File._buf._0_4_ + -4); uVar5 = anm2File._capacity + 0x24; if (0x1f < (uint)(anm2File._buf._0_4_ + (-4 - (int)pvVar4))) { LAB_009998fd: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar5); } anm2File._size = 0; anm2File._capacity = 0xf; anm2File._buf._0_4_ = anm2File._buf._0_4_ & 0xffffff00; iVar6 = g_game->_stage; if ((g_game->_difficulty == 2) || (iVar7 = iVar6, g_game->_difficulty == 3)) { if (iVar6 < 5) { iVar7 = iVar6 * 2 + -1; } else { iVar7 = 0; if (iVar6 == 5) { iVar7 = 10; } } } isBossKiller = ANM2::SetAnimation((ANM2 *)(in_ECX + 2),(byte *)"Diary",1); if (((isBossKiller != 0) && (in_ECX[0xf] != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0xe),0.0), in_ECX[0xf] != 0)) { *(undefined1 *)(in_ECX + 0x13) = 0; } if ((iVar7 < 9) && ((g_game->_stageType == 4 || (g_game->_stageType == 5)))) { switch(iVar7) { case 1: case 2: stageFrame = 7; break; case 3: case 4: stageFrame = 8; break; case 5: case 6: stageFrame = 9; break; case 7: case 8: stageFrame = 10; break; default: goto code_r0x009999d4; } } else { code_r0x009999d4: switch(iVar7) { case 1: case 2: stageFrame = 0; break; case 3: case 4: stageFrame = 1; break; case 5: case 6: stageFrame = 2; break; case 7: case 8: stageFrame = 3; break; case 9: stageFrame = 5; break; default: stageFrame = 4; break; case 0xc: stageFrame = 6; break; case 0xd: stageFrame = 0xb; } } if (((0 < g_game->_stage) && (g_game->_stage < 7)) && ((g_game->_gameStateFlags & 0x1000000000000) != 0)) { stageFrame = 0xc; } deadPlayer = *(Entity_Player **)&(g_game->_playerManager).field_0x7c; if ((EntityPtr)deadPlayer == (EntityPtr)0x0) { deadPlayer = Game::GetPlayer(g_game,0); } if (*(int *)((int)deadPlayer + 0x13c0) == 0x28) { deadPlayer = *(Entity_Player **)((int)deadPlayer + 0x1e68); } KAGE_LogMessage(1,(byte *)"Game Over. Killed by (%d.%d) spawned by (%d.%d) damage flags (%d)\n"); iVar7 = ((EntityRef *)((int)deadPlayer + 0x167c))->_type; pEStack_84 = (EntityConfig_Entity *)0x0; iVar6 = -1; if ((((iVar7 == 0) || (pEStack_84 = EntityConfig::GetEntity (&g_manager->_entityConfig,iVar7,*(int *)((int)deadPlayer + 0x1680),0 ), pEStack_84 == (EntityConfig_Entity *)0x0)) || (iVar6 = pEStack_84->portrait, iVar6 == -1)) && (((*(int *)((int)deadPlayer + 0x1684) == 0 || (pEStack_84 = EntityConfig::GetEntity (&g_manager->_entityConfig,*(int *)((int)deadPlayer + 0x1684), *(int *)((int)deadPlayer + 0x1688),0), pEStack_84 == (EntityConfig_Entity *)0x0)) || (iVar6 = pEStack_84->portrait, iVar6 == -1)))) { iVar7 = ((EntityRef *)((int)deadPlayer + 0x167c))->_type; if (iVar7 == 4) { iVar6 = 0x41; } else if ((iVar7 == 0) && (*(int *)((int)deadPlayer + 0x1680) != 0)) { iVar7 = *(int *)((int)deadPlayer + 0x1680); LAB_00999b62: if (iVar7 == 0x19) { iVar6 = 0xca; } else if (iVar7 == 10000) { iVar6 = 0xe5; } else if (iVar7 == 0x2711) { iVar6 = 0xeb; } else if (iVar7 == 0x2712) { iVar6 = 0xef; } else { if (iVar7 != 0x2713) goto LAB_00999bb5; iVar6 = 0xfd; } } else { if ((*(int *)((int)deadPlayer + 0x1684) == 0) && (*(int *)((int)deadPlayer + 0x1688) != 0)) { if ((iVar7 != 0) || (iVar7 = *(int *)((int)deadPlayer + 0x1680), iVar7 == 0)) { iVar7 = *(int *)((int)deadPlayer + 0x1688); } goto LAB_00999b62; } LAB_00999bb5: uVar5 = *(uint *)((int)deadPlayer + 0x16a8); if ((uVar5 & 0x80) == 0) { if ((uVar5 & 0x10000) == 0) { if ((uVar5 & 0x200) == 0) { if ((uVar5 & 0x1000) == 0) { if ((uVar5 & 2) == 0) { if ((uVar5 & 0x400) == 0) { if ((uVar5 & 4) == 0) { if ((uVar5 & 0x20000) == 0) { if ((uVar5 & 0x40000) != 0) { iVar6 = 0x72; } } else { iVar6 = 0x70; } } else { iVar6 = 0x41; } } else { iVar6 = 0x6e; } } else { iVar6 = 0x44; } } else { iVar6 = 0x71; } } else { iVar6 = 0x43; } } else { iVar6 = 0x75; } } else { iVar6 = 0x42; } } if (pEStack_84 != (EntityConfig_Entity *)0x0) goto LAB_00999c6f; LAB_00999c79: isBossKiller = false; } else { LAB_00999c6f: isBossKiller = true; if (pEStack_84->isBoss == 0) goto LAB_00999c79; } game = g_game; playerType = *(int *)((int)deadPlayer + 0x13c0); if (iVar6 < 0) { iVar6 = 0x95; } uStack_88 = (g_game->_seedEffects)._gameStartSeed; if (uStack_88 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uStack_88 = (game->_seedEffects)._gameStartSeed; } if ((in_ECX[0xf] != 0) && ((1 < *(int *)(in_ECX[0xe] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 1 < *(int *)(in_ECX[0xe] + 0x80))))) { iVar7 = in_ECX[0xf]; layerId = *(int *)(iVar7 + 0x3c); if ((iVar7 == 0) || ((layerId < 0 || (*(int *)(iVar7 + 0x1c) <= layerId)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x10] + layerId * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)(in_ECX + 0xe),layerId,(float)(uStack_88 % 0xc)); } if ((in_ECX[0xf] != 0) && ((2 < *(int *)(in_ECX[0xe] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 2 < *(int *)(in_ECX[0xe] + 0x80))))) { iVar7 = in_ECX[0xf]; layerId = *(int *)(iVar7 + 0x40); if ((iVar7 == 0) || ((layerId < 0 || (*(int *)(iVar7 + 0x1c) <= layerId)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x10] + layerId * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xe),layerId,(float)stageFrame) ; } if (((8 < (uint)in_ECX[0x22]) && (in_ECX[0xf] != 0)) && ((8 < *(int *)(in_ECX[0xe] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 8 < *(int *)(in_ECX[0xe] + 0x80))))) { iVar7 = in_ECX[0xf]; layerId = *(int *)(iVar7 + 0x58); if (((iVar7 == 0) || (layerId < 0)) || (*(int *)(iVar7 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x10] + layerId * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xe),layerId,(float)stageFrame) ; } layer = ANM2::GetLayer((ANM2 *)(in_ECX + 2),(byte *)0x3); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)(in_ECX + 2),&DAT_00000005); layer->_visible = 0; if (isBossKiller) { layer = ANM2::GetLayer((ANM2 *)(in_ECX + 2),(byte *)0x3); layer->_visible = 1; if ((in_ECX[0xf] == 0) || ((*(int *)(in_ECX[0xe] + 0x80) < 4 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)(in_ECX[0xe] + 0x80) < 4)) )) goto LAB_00999f34; iVar7 = in_ECX[0xf]; layerId = *(int *)(iVar7 + 0x44); } else { layer = ANM2::GetLayer((ANM2 *)(in_ECX + 2),&DAT_00000005); layer->_visible = 1; if ((in_ECX[0xf] == 0) || ((*(int *)(in_ECX[0xe] + 0x80) < 6 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)(in_ECX[0xe] + 0x80) < 6)) )) goto LAB_00999f34; iVar7 = in_ECX[0xf]; layerId = *(int *)(iVar7 + 0x4c); } if (((iVar7 == 0) || (layerId < 0)) || (*(int *)(iVar7 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x10] + layerId * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xe),layerId,(float)iVar6); LAB_00999f34: if (((pEStack_84 != (EntityConfig_Entity *)0x0) && (pEStack_84->modEntry != (void *)0x0)) && (pEStack_84->isPortraitModded != 0)) { layer = ANM2::GetLayer((ANM2 *)(in_ECX + 2),(byte *)0x3); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)(in_ECX + 2),&DAT_00000005); layer->_visible = 0; if ((in_ECX[0xf] != 0) && ((5 < *(int *)(in_ECX[0xe] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)(in_ECX[0xe] + 0x80))) )) { iVar6 = in_ECX[0xf]; iVar7 = *(int *)(iVar6 + 0x4c); if ((iVar6 == 0) || ((iVar7 < 0 || (*(int *)(iVar6 + 0x1c) <= iVar7)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x10] + iVar7 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xe),iVar7,0.0); } in_ECX[0x4b] = pEStack_84; } if ((in_ECX[0xf] != 0) && ((4 < *(int *)(in_ECX[0xe] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)(in_ECX[0xe] + 0x80))))) { iVar6 = in_ECX[0xf]; iVar7 = *(int *)(iVar6 + 0x48); if ((iVar6 == 0) || ((iVar7 < 0 || (*(int *)(iVar6 + 0x1c) <= iVar7)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0x10] + iVar7 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xe),iVar7,(float)playerType); } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { online_vote_start(); } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar6 = in_ECX[0x49]; iVar7 = in_ECX[0x48]; if (iVar7 != iVar6) { do { std::string::_Tidy_deallocate((char *)(iVar7 + 8)); iVar7 = iVar7 + 0x38; } while (iVar7 != iVar6); iVar7 = in_ECX[0x48]; } in_ECX[0x49] = iVar7; pEStack_84 = (EntityConfig_Entity *)0x0; iVar7 = (int)(g_game->_onlinePlayerStats)._end - (int)(g_game->_onlinePlayerStats)._begin; iVar6 = iVar7 >> 0x1f; if (iVar7 / 0x68 + iVar6 != iVar6) { uStack_88 = 0; do { game = g_game; uStack_74 = 0; uStack_5c = 0; uStack_58 = 0xf; pvStack_6c = (void *)0x0; uStack_44 = 0; uStack_54 = 0x3f800000; uStack_50 = 0x3f800000; uStack_4c = 0x3f800000; uStack_48 = 0x3f800000; uStack_40 = 1; local_8 = 1; if (in_ECX[0x49] == in_ECX[0x4a]) { std::vector<56byte>::_Emplace_reallocate(in_ECX[0x49],&uStack_74); game = g_game; } else { FUN_008cb3a0(); in_ECX[0x49] = in_ECX[0x49] + 0x38; } local_8 = 0xffffffff; if (0xf < uStack_58) { uVar5 = uStack_58 + 1; pvVar4 = pvStack_6c; if (0xfff < uVar5) { pvVar4 = *(void **)((int)pvStack_6c + -4); uVar5 = uStack_58 + 0x24; if (0x1f < (uint)((int)pvStack_6c + (-4 - (int)pvVar4))) goto LAB_009998fd; } operator_delete(pvVar4,uVar5); game = g_game; } pvVar4 = (game->_onlinePlayerStats)._begin; uVar2 = *(undefined4 *)(uStack_88 + 4 + (int)pvVar4); iVar6 = in_ECX[0x49]; *(undefined4 *)(iVar6 + -0x38) = *(undefined4 *)(uStack_88 + (int)pvVar4); manager = g_manager; *(undefined4 *)(iVar6 + -0x34) = uVar2; if (manager->_netplayManager == *(NetplayManager *)(manager + 1)) { PlayerManager::GetPlayerSlotFromController (&game->_playerManager,*(int *)(in_ECX[0x49] + -0x38)); sprintf_s(playerLabel,0x10,(byte *)"Player %d"); pbVar3 = playerLabel; do { isBossKiller = *pbVar3; pbVar3 = pbVar3 + 1; } while (isBossKiller != 0); uVar5 = (int)pbVar3 - (int)(playerLabel + 1); pbVar3 = playerLabel; } else { pbVar3 = user_profile_format_display_name (*(ulonglong *)(in_ECX[0x49] + -0x38),&manager->_font1_TeamMeatEx10, 0x50); nameEnd = pbVar3; do { isBossKiller = *nameEnd; nameEnd = nameEnd + 1; } while (isBossKiller != 0); uVar5 = (int)nameEnd - (int)(pbVar3 + 1); } std::string::assign((char *)(in_ECX[0x49] + -0x30),pbVar3,uVar5); pEStack_84 = (EntityConfig_Entity *)((int)pEStack_84 + 1); uStack_88 = uStack_88 + 0x68; } while (pEStack_84 < (uint)(((int)(g_game->_onlinePlayerStats)._end - (int)(g_game->_onlinePlayerStats)._begin) / 0x68)); } } ExceptionList = local_10; return; } //@@ 0099a300 GameOver::render_collectible_icon /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX = Game+0x1d520 (= Game::_gameOver, db/fields.tsv) from Entity_Familiar::Render (625ebe lea ecx,[ecx+0x1d520]); param_1 collectible id (<0x2dd), lazy-loads gfx/ui/Death Screen.anm2 "Diary" into ANM2 +8, copies the item texture into layer 6 and Sprite::RenderLayer(6) at pos/scale/color prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall GameOver::render_collectible_icon (GameOver *sprite,int collectibleId,Vector *position,ColorMod *color,Vector *scale, int *blendMode) { float fVar1; float fVar2; float fVar3; GameOver *pGVar4; AnimationState *pAVar5; byte bVar6; char cVar7; LayerState *iconLayer; LayerState *pLVar8; char *ptr; uint uVar9; undefined1 *sprite; void *pvVar10; undefined1 *textureRefCount; undefined1 auStack_be [2]; int local_b4 [11]; float savedColorizeR; float savedColorizeG; float savedColorizeB; float savedColorizeA; float savedTintR; float savedTintG; float savedTintB; float savedTintA; undefined8 savedOffsetRG; int savedBlendMode4; float savedOffsetB; float savedSizeY; float savedSizeX; float savedRotation; float savedPosY; float savedPosX; undefined1 savedTexture [4]; ColorMod *local_40; Vector *renderPos; GameOver *self; AnimationState *local_34; int *local_30; std_string local_2c; uint stackCookie; void *local_10; undefined1 *puStack_c; uint local_8; int animData; ColorMod *layerColor; local_8 = 0xffffffff; puStack_c = &LAB_00b0d865; local_10 = ExceptionList; stackCookie = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; local_34 = (AnimationState *)collectibleId; renderPos = position; local_40 = color; local_30 = blendMode; if (collectibleId != 0) { self = sprite; if ((uint)collectibleId < 0x2dd) { if (sprite->field_0x111 == '\0') { local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x18; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_8 = 0; ANM2::Load((ANM2 *)&sprite->field_0x8,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar9 = local_2c._capacity + 1; ptr = (char *)local_2c._buf._0_4_; if (0xfff < uVar9) { ptr = *(char **)(local_2c._buf._0_4_ + -4); uVar9 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } bVar6 = ANM2::SetAnimation((ANM2 *)&sprite->field_0x8,(byte *)"Diary",1); if (((bVar6 != 0) && (*(int *)&sprite->field_0x3c != 0)) && (AnimationState::SetFrameFloat((AnimationState *)&sprite->field_0x38,0.0), *(int *)&sprite->field_0x3c != 0)) { sprite->field_0x4c = 0; } } pAVar5 = local_34; iconLayer = ANM2::GetLayer((ANM2 *)&sprite->field_0x8,&DAT_00000006); pGVar4 = self; savedOffsetB = (iconLayer->_color)._offset[2]; layerColor = &iconLayer->_color; savedPosX = (iconLayer->_pos).x; savedBlendMode4 = iconLayer->_blendMode[4]; savedPosY = (iconLayer->_pos).y; savedRotation = iconLayer->_rotation; savedSizeX = (iconLayer->_size).x; savedSizeY = (iconLayer->_size).y; savedTintR = layerColor->_tint[0]; savedTintG = (iconLayer->_color)._tint[1]; savedTintB = (iconLayer->_color)._tint[2]; savedTintA = (iconLayer->_color)._tint[3]; savedColorizeR = (iconLayer->_color)._colorize[0]; savedColorizeG = (iconLayer->_color)._colorize[1]; savedColorizeB = (iconLayer->_color)._colorize[2]; savedColorizeA = (iconLayer->_color)._colorize[3]; savedOffsetRG = *(undefined8 *)(iconLayer->_color)._offset; local_2c._buf._4_4_ = iconLayer->_blendMode[0]; local_2c._buf._8_4_ = iconLayer->_blendMode[1]; local_2c._buf._12_4_ = iconLayer->_blendMode[2]; local_2c._size = iconLayer->_blendMode[3]; (iconLayer->_pos).x = 84.0; (iconLayer->_pos).y = -20.0; iconLayer->_rotation = 0.0; (iconLayer->_size).x = scale->x; (iconLayer->_size).y = scale->y; if (layerColor != local_40) { fVar1 = local_40->_tint[1]; fVar2 = local_40->_tint[2]; fVar3 = local_40->_tint[3]; layerColor->_tint[0] = local_40->_tint[0]; (iconLayer->_color)._tint[1] = fVar1; (iconLayer->_color)._tint[2] = fVar2; (iconLayer->_color)._tint[3] = fVar3; fVar1 = local_40->_colorize[1]; fVar2 = local_40->_colorize[2]; fVar3 = local_40->_colorize[3]; (iconLayer->_color)._colorize[0] = local_40->_colorize[0]; (iconLayer->_color)._colorize[1] = fVar1; (iconLayer->_color)._colorize[2] = fVar2; (iconLayer->_color)._colorize[3] = fVar3; *(undefined8 *)(iconLayer->_color)._offset = *(undefined8 *)local_40->_offset; (iconLayer->_color)._offset[2] = local_40->_offset[2]; } iconLayer->_blendMode[0] = *local_30; iconLayer->_blendMode[1] = local_30[1]; iconLayer->_blendMode[2] = local_30[2]; iconLayer->_blendMode[3] = local_30[3]; iconLayer->_blendMode[4] = local_30[4]; if ((int)pAVar5 < 0) { pLVar8 = ANM2::GetLayer((ANM2 *)&self->field_0x8,&DAT_00000006); LayerState::GetTexture(pLVar8,savedTexture); sprite = &DAT_00000006; local_8 = 1; pvVar10 = (void *)0x99a56e; pLVar8 = ANM2::GetLayer((ANM2 *)&pGVar4->field_0x8,&DAT_00000006); local_30 = (int *)(auStack_be + -10); KAGE::SmartPointer::operator_assign (auStack_be + -10,&(g_game->_proceduralItemManager).field_0x14); LayerState::SetTexture(pLVar8,pvVar10,sprite); uVar9 = ~(uint)local_34; pLVar8 = ANM2::GetLayer((ANM2 *)&self->field_0x8,&DAT_00000006); pGVar4 = self; (pLVar8->_cropOffset).x = (float)(uVar9 & 0x1f) * 16.0; (pLVar8->_cropOffset).y = (float)(uVar9 >> 5) * 16.0; if ((*(int *)&self->field_0x3c != 0) && ((sprite = &self->field_0x38, 6 < *(int *)(*(int *)sprite + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)(*(int *)sprite + 0x80))))) { animData = *(int *)&pGVar4->field_0x3c; local_30 = *(int **)(animData + 0x50); if ((animData == 0) || (((int)local_30 < 0 || (*(int *)(animData + 0x1c) <= (int)local_30)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)&pGVar4->field_0x40 + (int)local_30 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)sprite,(int)local_30,0.0); } sprite = &self->field_0x8; Sprite::RenderLayer((Sprite *)sprite,6,renderPos,&g_vectorZero,&g_vectorZero); pLVar8 = ANM2::GetLayer((ANM2 *)sprite,&DAT_00000006); textureRefCount = &DAT_00000006; (pLVar8->_cropOffset).x = g_vectorZero.x; (pLVar8->_cropOffset).y = g_vectorZero.y; pvVar10 = (void *)0x99a697; pLVar8 = ANM2::GetLayer((ANM2 *)sprite,&DAT_00000006); KAGE::SmartPointer::operator_assign(auStack_be + -10,savedTexture); LayerState::SetTexture(pLVar8,pvVar10,textureRefCount); local_8 = 2; if (((local_40 != (ColorMod *)0x0) && (cVar7 = (**(code **)((int)local_40->_tint[0] + 0xc))(), cVar7 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } else { if ((*(int *)&self->field_0x3c != 0) && ((local_34 = (AnimationState *)&self->field_0x38, 6 < *(int *)(*(int *)&self->field_0x38 + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)((int)local_34->_animation + 0x80))))) { pvVar10 = local_34->_animData; local_30 = *(int **)((int)pvVar10 + 0x50); if ((pvVar10 == (void *)0x0) || (((int)local_30 < 0 || (*(int *)((int)pvVar10 + 0x1c) <= (int)local_30)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)local_34->_layerFrames + (int)local_30 * 4) = 0; AnimationState::AdvanceLayerPosition (local_34,(int)local_30, (float)(int)((int)&pAVar5[-1]._previouslyTriggeredEvents + 3)); } Sprite::RenderLayer((Sprite *)&self->field_0x8,6,renderPos,&g_vectorZero,&g_vectorZero); } (iconLayer->_pos).x = savedPosX; (iconLayer->_pos).y = savedPosY; iconLayer->_rotation = savedRotation; (iconLayer->_size).x = savedSizeX; (iconLayer->_size).y = savedSizeY; if (&iconLayer->_color != (ColorMod *)local_b4) { (iconLayer->_color)._tint[0] = savedTintR; (iconLayer->_color)._tint[1] = savedTintG; (iconLayer->_color)._tint[2] = savedTintB; (iconLayer->_color)._tint[3] = savedTintA; (iconLayer->_color)._colorize[0] = savedColorizeR; (iconLayer->_color)._colorize[1] = savedColorizeG; (iconLayer->_color)._colorize[2] = savedColorizeB; (iconLayer->_color)._colorize[3] = savedColorizeA; *(undefined8 *)(iconLayer->_color)._offset = savedOffsetRG; (iconLayer->_color)._offset[2] = savedOffsetB; } iconLayer->_blendMode[0] = local_2c._buf._4_4_; iconLayer->_blendMode[1] = local_2c._buf._8_4_; iconLayer->_blendMode[2] = local_2c._buf._12_4_; iconLayer->_blendMode[3] = local_2c._size; iconLayer->_blendMode[4] = savedBlendMode4; } else { ModManager::RenderCustomCollectionItem (&g_manager->_modManager,collectibleId,position,scale,color,blendMode); } } ExceptionList = local_10; return; } //@@ 0099a830 FUN_0099a830 void FUN_0099a830(void) { float fVar1; Game *pGVar2; Manager *pMVar3; KColor local_2c [2]; KColor::SetFromARGB(local_2c,0xff000000); pGVar2 = g_game; fVar1 = (g_game->_fadeOutColor)._alpha; g_game->_fadeSpeed = 0.08; pGVar2->_fadeOutTarget = 0xb; (pGVar2->_fadeOutColor)._red = local_2c[0]._red; (pGVar2->_fadeOutColor)._green = local_2c[0]._green; (pGVar2->_fadeOutColor)._blue = local_2c[0]._blue; (pGVar2->_fadeOutColor)._alpha = fVar1; (pGVar2->_fadeOutColor)._unk = 0; (pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08; pMVar3 = g_manager; (g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0; (pMVar3->_popupButtons)._buttons[1]._targetSlideOffset = 96.0; return; } //@@ 0099a8e0 GridEntity_Decoration::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 2] */ void __thiscall GridEntity_Decoration::Update(GridEntity_Decoration *this) { byte isSecondFoot; uint uVar1; Entity_Player *player; Vector *renderPos; std_string *psVar2; std_string *animNameData; double dVar3; Vector renderPosBuf; float texelR; float texelG; float texelB; float texelA; float local_60; float sampleY; float decoRenderX; float decoRenderY; ANM2 *sprite; float sampleX; GridEntity_Decoration *decoration; float pixelScale; float scaledCoord; std_string *animName [4]; uint animNameSize; uint animNameCapacity; uint securityCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; std_string *local_14; puStack_20 = (undefined1 *)(animName + 0xe); local_14 = (std_string *)0xffffffff; puStack_18 = &LAB_00af462d; local_1c = ExceptionList; securityCookie = __security_cookie ^ (uint)(animName + 0xb); ExceptionList = &local_1c; if (((this->_desc)._variant != 1000) && ((this->_sprite)._loaded != 0)) { decoration = this; AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); ANM2::GetAnimation((ANM2 *)&(this->_sprite)._animState,(std_string *)animName); animNameData = animName[0]; local_14 = (std_string *)0x0; psVar2 = (std_string *)animName; if (0xf < animNameCapacity) { psVar2 = animName[0]; } uVar1 = std::string::find((byte *)psVar2,animNameSize,0,(byte *)"Puddle",6); if (uVar1 != 0xffffffff) { sprite = &this->_sprite; if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } uVar1 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { player = Game::GetPlayer(g_game,uVar1); if (player->_entityGridCollisionClass == 5) { renderPos = GridEntity::get_render_position((GridEntity *)decoration,&renderPosBuf); decoRenderX = renderPos->x; pixelScale = g_displayPixelRatio * g_screenPointScale; decoRenderY = renderPos->y; scaledCoord = ((g_screenWidth - 338.0) * 0.5 + ((player->_pos).x - 60.0) * 0.65) * pixelScale + 0.5; dVar3 = floor((double)scaledCoord); sampleX = (float)dVar3 / pixelScale; scaledCoord = ((g_screenHeight - 182.0) * 0.5 + ((player->_pos).y - 140.0) * 0.65) * pixelScale + 0.5; dVar3 = floor((double)scaledCoord); scaledCoord = (float)dVar3; sampleY = scaledCoord / pixelScale; local_60 = sampleX; Sprite::GetTexel(&texelR,sampleX,sampleY,decoRenderX,decoRenderY,0x3c23d70a,0xffffffff); if (0.0 < texelA) { Entity_Player::is_footstep_triggered(player,-1); if (player->_canFly == 0) { isSecondFoot = Entity_Player::is_footstep_triggered(player,0); if (isSecondFoot == 0) { (player->_footprintColor1)._offset[0] = texelR; (player->_footprintColor1)._offset[1] = texelG; (player->_footprintColor1)._offset[2] = texelB; } else { (player->_footprintColor2)._offset[0] = texelR; (player->_footprintColor2)._offset[1] = texelG; (player->_footprintColor2)._offset[2] = texelB; } } } } uVar1 = uVar1 + 1; } while (uVar1 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); animNameData = animName[0]; } } if (0xf < animNameCapacity) { uVar1 = animNameCapacity + 1; psVar2 = animNameData; if (0xfff < uVar1) { psVar2 = (std_string *)animNameData[-1]._capacity; uVar1 = animNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)animNameData + (-4 - (int)psVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar2,uVar1); } } ExceptionList = local_1c; return; } //@@ 0099ac00 GridEntity_Decoration::Render /* ZHL [exact] void Render(Vector& Offset); */ void __thiscall GridEntity_Decoration::Render(GridEntity_Decoration *this,float *param_2) { ColorMod *pCVar1; void *pvVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; Vector *pVVar12; Vector local_44; Vector local_3c; undefined4 local_34 [12]; if (((this->_desc)._variant != 1000) && ((this->_sprite)._loaded != 0)) { pvVar2 = g_game->_room; fVar4 = *(float *)((int)pvVar2 + 0x72a4); fVar5 = *(float *)((int)pvVar2 + 0x72a8); fVar6 = *(float *)((int)pvVar2 + 0x72ac); fVar7 = *(float *)((int)pvVar2 + 0x72b0); fVar3 = *(float *)((int)pvVar2 + 0x72cc); fVar8 = *(float *)((int)pvVar2 + 0x72b4); fVar9 = *(float *)((int)pvVar2 + 0x72b8); fVar10 = *(float *)((int)pvVar2 + 0x72bc); fVar11 = *(float *)((int)pvVar2 + 0x72c0); pCVar1 = &(this->_sprite)._color; if (pCVar1 != (ColorMod *)local_34) { *(undefined8 *)(this->_sprite)._color._offset = *(undefined8 *)((int)pvVar2 + 0x72c4); pCVar1->_tint[0] = fVar4; (this->_sprite)._color._tint[1] = fVar5; (this->_sprite)._color._tint[2] = fVar6; (this->_sprite)._color._tint[3] = fVar7; (this->_sprite)._color._offset[2] = fVar3; (this->_sprite)._color._colorize[0] = fVar8; (this->_sprite)._color._colorize[1] = fVar9; (this->_sprite)._color._colorize[2] = fVar10; (this->_sprite)._color._colorize[3] = fVar11; } pVVar12 = GridEntity::get_render_position((GridEntity *)this,&local_3c); local_44.x = pVVar12->x + *param_2; local_44.y = pVVar12->y + param_2[1]; ANM2::Render(&this->_sprite,&local_44,&g_vectorZero,&g_vectorZero); } return; } //@@ 0099acc0 GridEntity_Decoration::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Decoration::BeginBatches(GridEntity_Decoration *this) { code *pcVar1; byte bVar2; uint uVar3; byte *puddleMatch; std_string *psVar4; int iVar5; std_string *psVar6; byte *pbVar7; void *pvVar8; char *pcVar9; int iVar10; GridEntity_Decoration *decoration; uint uVar11; bool bVar12; RNG decorRng; int attemptsLeft; uint animSeed; std_string *local_78; undefined4 rngShift3; GridEntity_Decoration *savedThis; int backdropType; std_string *animNameHeap; std_string *local_64; char isAnimAccepted; void *curAnimName [4]; uint curAnimNameSize; uint curAnimNameCapacity; std_string anm2Path; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; uint *animNameSize; int *puddleCount; local_8 = 0xffffffff; puStack_c = &LAB_00b0d8bd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; iVar5 = (this->_desc)._variant; if (iVar5 == 1000) { return; } if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { bVar12 = true; } else { bVar12 = false; } pvVar8 = g_game->_room; backdropType = *(int *)((int)pvVar8 + 0x1d18); iVar10 = 0; if (*(int *)((int)pvVar8 + 4) != 0) { iVar10 = *(int *)(*(int *)((int)pvVar8 + 4) + 0x58); } uVar11 = this->_gridIndex + iVar10; decorRng._shift1 = 5; decorRng._shift2 = 9; rngShift3 = 7; decorRng._shift3 = 7; ExceptionList = &local_10; decorRng._seed = uVar11; savedThis = this; if (*(int *)((int)pvVar8 + 8) == 0x10) { local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; if (backdropType == 0x38) { local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x1a; local_2c._capacity = 0x1f; builtin_strncpy((char *)local_2c._buf._0_4_,"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 0; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar11 = local_2c._capacity + 1; pcVar9 = (char *)local_2c._buf._0_4_; if (0xfff < uVar11) { pcVar9 = *(char **)(local_2c._buf._0_4_ + -4); uVar11 = local_2c._capacity + 0x24; if ((char *)0x1f < (char *)(local_2c._buf._0_4_ + (-4 - (int)pcVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar9,uVar11); } iVar5 = (this->_desc)._variant; if (iVar5 == 10) { ANM2::SetFrame(&this->_sprite,(std_string *)"Ladder",0); iVar5 = (this->_desc)._variant; } if (iVar5 == 0x14) { ANM2::SetFrame(&this->_sprite,(std_string *)"Ladder",1); iVar5 = (this->_desc)._variant; } if (iVar5 == 0x1e) { ANM2::SetFrame(&this->_sprite,(std_string *)"Ladder",2); ExceptionList = local_10; return; } ExceptionList = local_10; return; } if (backdropType == 0x37) { local_2c._buf._0_4_ = std::_Allocate(0x30); local_2c._size = 0x26; local_2c._capacity = 0x2f; builtin_strncpy(((std_string *)local_2c._buf._0_4_)->_buf,"gfx/grid/Tiles_I",0x10); ((std_string *)local_2c._buf._0_4_)->_size = 0x646d6574; ((std_string *)local_2c._buf._0_4_)->_capacity = 0x65676e75; builtin_strncpy(((std_string *)(local_2c._buf._0_4_ + 0x18))->_buf,"on_Gideon.anm2",0xf); local_8 = 1; } else { local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x1f; local_2c._capacity = 0x1f; builtin_strncpy(((std_string *)local_2c._buf._0_4_)->_buf,"gfx/grid/Tiles_I",0x10); ((std_string *)local_2c._buf._0_4_)->_size = 0x646d6574; ((std_string *)local_2c._buf._0_4_)->_capacity = 0x65676e75; builtin_strncpy(((std_string *)(local_2c._buf._0_4_ + 0x18))->_buf,"on.anm2",8); local_8 = 2; } ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar11 = local_2c._capacity + 1; psVar4 = (std_string *)local_2c._buf._0_4_; if (0xfff < uVar11) { psVar4 = (std_string *)((std_string *)(local_2c._buf._0_4_ + -0x18))->_capacity; uVar11 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)psVar4))) goto LAB_0099af04; } operator_delete(psVar4,uVar11); } iVar5 = (this->_desc)._variant; if (iVar5 == 10) { ANM2::Play(&this->_sprite,(byte *)"Ladder1",0); iVar5 = (this->_desc)._variant; } if (iVar5 == 0x14) { ANM2::Play(&this->_sprite,(byte *)"Ladder2",0); iVar5 = (this->_desc)._variant; } if (iVar5 == 0x1e) { ANM2::Play(&this->_sprite,(byte *)"Ladder3",0); ExceptionList = local_10; return; } ExceptionList = local_10; return; } if ((bVar12) && ((iVar5 == 10 || (backdropType == 0x14)))) { local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; local_2c._buf._0_4_ = std::_Allocate(0x20); local_2c._size = 0x1c; local_2c._capacity = 0x1f; builtin_strncpy(((std_string *)local_2c._buf._0_4_)->_buf,"gfx/grid/Props_1",0x10); ((std_string *)local_2c._buf._0_4_)->_size = 0x72475f32; ((std_string *)local_2c._buf._0_4_)->_capacity = 0x2e646565; builtin_strncpy(((std_string *)(local_2c._buf._0_4_ + 0x18))->_buf,"anm2",5); local_8 = 3; ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar11 = local_2c._capacity + 1; psVar4 = (std_string *)local_2c._buf._0_4_; if (0xfff < uVar11) { psVar4 = (std_string *)((std_string *)(local_2c._buf._0_4_ + -0x18))->_capacity; uVar11 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)psVar4))) goto LAB_0099af04; } operator_delete(psVar4,uVar11); } uVar11 = RNG::Next(&decorRng); Sprite::PlayRandom(uVar11); ExceptionList = local_10; return; } std::string::string(anm2Path._buf, (void *)((int)pvVar8 + *(int *)((int)pvVar8 + 0x1d18) * 0x13c + 0x1d94)); local_8 = 4; iVar5 = g_game->_stage; bVar2 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if ((bVar2 != 0) && ((((iVar5 == 3 || (iVar5 == 4)) || (iVar5 == 0xb)) || ((1 < iVar5 && (uVar11 == (uVar11 / 5) * 5)))))) { std::string::assign(anm2Path._buf,(byte *)"gfx/promo/gfuel/grid/props_gfuel.anm2",0x25); } decoration = savedThis; if (anm2Path._size != 0) { ANM2::Load(&savedThis->_sprite,&anm2Path,1); attemptsLeft = 0x14; LAB_0099b160: iVar5 = attemptsLeft + -1; bVar12 = 0 < attemptsLeft; attemptsLeft = iVar5; if (bVar12) { if (uVar11 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar11 = uVar11 >> ((byte)decorRng._shift1 & 0x1f) ^ uVar11; uVar11 = uVar11 << ((byte)decorRng._shift2 & 0x1f) ^ uVar11; animSeed = uVar11 >> ((byte)rngShift3 & 0x1f) ^ uVar11; Sprite::PlayRandom(animSeed); pvVar8 = (decoration->_sprite)._animState._animData; if (pvVar8 == (void *)0x0) { local_2c._capacity = 0xf; local_2c._buf._0_4_ = (std_string *)0x0; local_2c._size = 0; } else { std::string::string(local_2c._buf,pvVar8); } local_64 = &local_2c; if (0xf < local_2c._capacity) { local_64 = (std_string *)local_2c._buf._0_4_; } animNameHeap = (std_string *)local_2c._buf._0_4_; if (4 < local_2c._size) { iVar5 = -1; if (local_2c._size - 5 != -1) { iVar5 = local_2c._size - 5; } psVar4 = (std_string *)(local_64->_buf + iVar5); do { if (psVar4->_buf[0] == 'C') { pcVar9 = "Caves"; iVar5 = 1; psVar6 = psVar4; if (*(int *)psVar4->_buf == 0x65766143) { psVar6 = (std_string *)(psVar4->_buf + 4); iVar5 = -3; pcVar9 = "s"; } bVar12 = (byte)psVar6->_buf[0] < (byte)*pcVar9; if ((psVar6->_buf[0] == *pcVar9) && ((iVar5 == -3 || (((bVar12 = (byte)psVar6->_buf[1] < (byte)pcVar9[1], psVar6->_buf[1] == pcVar9[1] && (bVar12 = (byte)psVar6->_buf[2] < (byte)pcVar9[2], psVar6->_buf[2] == pcVar9[2])) && (bVar12 = (byte)psVar6->_buf[3] < (byte)pcVar9[3], psVar6->_buf[3] == pcVar9[3]) ))))) { uVar11 = 0; } else { uVar11 = -(uint)bVar12 | 1; } if (uVar11 == 0) { if (((int)psVar4 - (int)local_64 != -1) && (backdropType != 4)) goto LAB_0099b501; break; } } if (psVar4 == local_64) break; psVar4 = (std_string *)((int)&psVar4[-1]._capacity + 3); } while( true ); } local_64 = &local_2c; if (0xf < local_2c._capacity) { local_64 = (std_string *)local_2c._buf._0_4_; } if (8 < local_2c._size) { iVar5 = -1; if (local_2c._size - 9 != -1) { iVar5 = local_2c._size - 9; } psVar4 = (std_string *)(local_64->_buf + iVar5); do { if (psVar4->_buf[0] == 'C') { pcVar9 = "Catacombs"; uVar11 = 5; psVar6 = psVar4; do { if (*(int *)psVar6->_buf != *(int *)pcVar9) break; psVar6 = (std_string *)(psVar6->_buf + 4); pcVar9 = pcVar9 + 4; bVar12 = 3 < uVar11; uVar11 = uVar11 - 4; } while (bVar12); bVar12 = (byte)psVar6->_buf[0] < (byte)*pcVar9; if ((psVar6->_buf[0] == *pcVar9) && ((uVar11 == 0xfffffffd || (((bVar12 = (byte)psVar6->_buf[1] < (byte)pcVar9[1], psVar6->_buf[1] == pcVar9[1] && (bVar12 = (byte)psVar6->_buf[2] < (byte)pcVar9[2], psVar6->_buf[2] == pcVar9[2])) && (bVar12 = (byte)psVar6->_buf[3] < (byte)pcVar9[3], psVar6->_buf[3] == pcVar9[3]) ))))) { uVar11 = 0; } else { uVar11 = -(uint)bVar12 | 1; } if (uVar11 == 0) { if (((int)psVar4 - (int)local_64 != -1) && (backdropType != 5)) goto LAB_0099b501; break; } } if (psVar4 == local_64) break; psVar4 = (std_string *)((int)&psVar4[-1]._capacity + 3); } while( true ); } local_78 = &local_2c; if (0xf < local_2c._capacity) { local_78 = (std_string *)local_2c._buf._0_4_; } if (5 < local_2c._size) { local_64 = (std_string *)(local_78->_buf + (local_2c._size - 5)); for (puddleMatch = memchr(local_78,0x50,(int)local_64 - (int)local_78); puddleMatch != (byte *)0x0; puddleMatch = memchr(puddleMatch + 1,0x50,(int)local_64 - (int)(puddleMatch + 1))) { pcVar9 = "Puddle"; iVar5 = 2; pbVar7 = puddleMatch; if (*(int *)puddleMatch == 0x64647550) { pbVar7 = puddleMatch + 4; iVar5 = -2; pcVar9 = "le"; } bVar12 = *pbVar7 < (byte)*pcVar9; if (((*pbVar7 == *pcVar9) && (bVar12 = pbVar7[1] < (byte)pcVar9[1], pbVar7[1] == pcVar9[1])) && ((iVar5 == -2 || ((bVar12 = pbVar7[2] < (byte)pcVar9[2], pbVar7[2] == pcVar9[2] && (bVar12 = pbVar7[3] < (byte)pcVar9[3], pbVar7[3] == pcVar9[3])))))) { uVar11 = 0; } else { uVar11 = -(uint)bVar12 | 1; } if (uVar11 == 0) { if (((int)puddleMatch - (int)local_78 != -1) && (*(int *)((int)g_game->_room + 0x721c) != 0)) goto LAB_0099b501; break; } } } isAnimAccepted = '\x01'; goto LAB_0099b3bd; } goto LAB_0099b406; } if (anm2Path._capacity < 0x10) { ExceptionList = local_10; return; } uVar11 = anm2Path._capacity + 1; if (uVar11 < 0x1000) goto LAB_0099b4b8; uVar3 = anm2Path._buf._0_4_ + (-4 - (int)*(void **)(anm2Path._buf._0_4_ + -4)); anm2Path._buf._0_4_ = *(void **)(anm2Path._buf._0_4_ + -4); joined_r0x0099b4b2: uVar11 = anm2Path._capacity + 0x24; if (0x1f < uVar3) { LAB_0099af04: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } LAB_0099b4b8: operator_delete((void *)anm2Path._buf._0_4_,uVar11); ExceptionList = local_10; return; LAB_0099b501: isAnimAccepted = '\0'; LAB_0099b3bd: if (0xf < local_2c._capacity) { uVar11 = local_2c._capacity + 1; psVar4 = animNameHeap; if (0xfff < uVar11) { psVar4 = (std_string *)animNameHeap[-1]._capacity; uVar11 = local_2c._capacity + 0x24; if (0x1f < (uint)((int)animNameHeap + (-4 - (int)psVar4))) goto LAB_0099af04; } operator_delete(psVar4,uVar11); } decoration = savedThis; uVar11 = animSeed; if (isAnimAccepted != '\0') goto LAB_0099b406; goto LAB_0099b160; LAB_0099b406: psVar4 = ANM2::GetAnimation((ANM2 *)&(decoration->_sprite)._animState,(std_string *)curAnimName); animNameSize = &psVar4->_size; if (0xf < psVar4->_capacity) { psVar4 = *(std_string **)psVar4->_buf; } uVar11 = std::string::find((byte *)psVar4,*animNameSize,0,(byte *)"Puddle",6); if (0xf < curAnimNameCapacity) { uVar3 = curAnimNameCapacity + 1; pvVar8 = curAnimName[0]; if (0xfff < uVar3) { pvVar8 = *(void **)((int)curAnimName[0] + -4); uVar3 = curAnimNameCapacity + 0x24; if (0x1f < (uint)((int)curAnimName[0] + (-4 - (int)pvVar8))) goto LAB_0099af04; } operator_delete(pvVar8,uVar3); } curAnimNameSize = 0; curAnimNameCapacity = 0xf; curAnimName[0] = (void *)((uint)curAnimName[0] & 0xffffff00); if (uVar11 != 0xffffffff) { puddleCount = (int *)((int)g_game->_room + 0x721c); *puddleCount = *puddleCount + 1; } if (anm2Path._capacity < 0x10) { ExceptionList = local_10; return; } uVar11 = anm2Path._capacity + 1; if (uVar11 < 0x1000) goto LAB_0099b4b8; uVar3 = anm2Path._buf._0_4_ + (-4 - (int)*(void **)(anm2Path._buf._0_4_ + -4)); anm2Path._buf._0_4_ = *(void **)(anm2Path._buf._0_4_ + -4); goto joined_r0x0099b4b2; } //@@ 0099b510 GridEntity_Gravity::BeginBatches /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Gravity::BeginBatches(GridEntity_Gravity *this) { this->_collisionClass = 0; return; } //@@ 0099b520 GridEntity_Gravity::PostInit /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GridEntity_Gravity vtable slot 1; Tiles_Itemdungeon(_Gideon).anm2; ZHL exact sig said Entity_Player::InitPreLevelInitStats */ void __thiscall GridEntity_Gravity::PostInit(GridEntity_Gravity *this) { void *pvVar1; int iVar2; code *pcVar3; byte isAnimSet; int belowRow; char *freeBlock; int column; uint uVar4; ANM2 *floorSprite; RNG rng; undefined4 local_6c; ANM2 *sprite; std_string itemDungeonPath; std_string tilesPath; byte floorAnimName [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d90d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(floorAnimName + 0x30); ExceptionList = &local_10; pvVar1 = g_game->_room; iVar2 = *(int *)((int)pvVar1 + 0xc); column = (int)((((float)(this->_gridIndex % iVar2) * 40.0 + 40.0 + 0.0) - 40.0) / 40.0 + 0.5); belowRow = (int)((((float)(this->_gridIndex / iVar2) * 40.0 + 120.0 + 40.0) - 120.0) / 40.0 + 0.5) ; if (((((-1 < column) && (column < iVar2)) && (-1 < belowRow)) && ((belowRow < *(int *)((int)pvVar1 + 0x10) && (uVar4 = iVar2 * belowRow + column, uVar4 < 0x1c0)))) && ((iVar2 = *(int *)((int)pvVar1 + uVar4 * 4 + 0x24), iVar2 != 0 && ((iVar2 = *(int *)(iVar2 + 4), iVar2 == 3 || (iVar2 == 0xf)))))) { iVar2 = (this->_desc)._spawnSeed; local_6c = 0xc; rng._shift3 = 0xc; sprite = &this->_sprite; rng._shift1 = 5; rng._shift2 = 0x15; rng._seed = iVar2; if (*(int *)((int)pvVar1 + 0x1d18) == 0x38) { tilesPath._size = 0; tilesPath._capacity = 0xf; tilesPath._buf[0] = '\0'; tilesPath._buf[1] = '\0'; tilesPath._buf[2] = '\0'; tilesPath._buf[3] = '\0'; tilesPath._buf._0_4_ = std::_Allocate(0x20); tilesPath._size = 0x1a; tilesPath._capacity = 0x1f; builtin_strncpy((char *)tilesPath._buf._0_4_,"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 0; ANM2::Load(&this->_sprite,&tilesPath,1); local_8 = 0xffffffff; if (0xf < tilesPath._capacity) { uVar4 = tilesPath._capacity + 1; freeBlock = (char *)tilesPath._buf._0_4_; if (0xfff < uVar4) { freeBlock = *(char **)(tilesPath._buf._0_4_ + -4); uVar4 = tilesPath._capacity + 0x24; if ((char *)0x1f < (char *)(tilesPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); } isAnimSet = ANM2::SetAnimation(&this->_sprite,(byte *)"Floor",1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } pvVar1 = (this->_sprite)._animState._animData; if (pvVar1 == (void *)0x0) { uVar4 = 0; } else { uVar4 = *(uint *)((int)pvVar1 + 0x30); } uVar4 = RNG::RandomInt(&rng,uVar4); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(int)uVar4); } } else { if (*(int *)((int)pvVar1 + 0x1d18) == 0x37) { tilesPath._size = 0; tilesPath._capacity = 0xf; tilesPath._buf[0] = '\0'; tilesPath._buf[1] = '\0'; tilesPath._buf[2] = '\0'; tilesPath._buf[3] = '\0'; tilesPath._buf._0_4_ = std::_Allocate(0x30); floorSprite = sprite; tilesPath._size = 0x26; tilesPath._capacity = 0x2f; builtin_strncpy((char *)tilesPath._buf._0_4_,"gfx/grid/Tiles_Itemdungeon_Gideon.anm2",0x27); local_8 = 1; ANM2::Load(sprite,&tilesPath,1); local_8 = 0xffffffff; if (0xf < tilesPath._capacity) { uVar4 = tilesPath._capacity + 1; freeBlock = (char *)tilesPath._buf._0_4_; if (0xfff < uVar4) { freeBlock = *(char **)(tilesPath._buf._0_4_ + -4); uVar4 = tilesPath._capacity + 0x24; if ((char *)0x1f < (char *)(tilesPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); } tilesPath._size = 0; tilesPath._capacity = 0xf; tilesPath._buf._0_4_ = tilesPath._buf._0_4_ & 0xffffff00; } else { itemDungeonPath._size = 0; itemDungeonPath._capacity = 0xf; itemDungeonPath._buf[0] = '\0'; itemDungeonPath._buf[1] = '\0'; itemDungeonPath._buf[2] = '\0'; itemDungeonPath._buf[3] = '\0'; itemDungeonPath._buf._0_4_ = std::_Allocate(0x20); floorSprite = sprite; itemDungeonPath._size = 0x1f; itemDungeonPath._capacity = 0x1f; builtin_strncpy((char *)itemDungeonPath._buf._0_4_,"gfx/grid/Tiles_Itemdungeon.anm2",0x20); local_8 = 2; ANM2::Load(sprite,&itemDungeonPath,1); local_8 = 0xffffffff; if (0xf < itemDungeonPath._capacity) { uVar4 = itemDungeonPath._capacity + 1; freeBlock = (char *)itemDungeonPath._buf._0_4_; if (0xfff < uVar4) { freeBlock = *(char **)(itemDungeonPath._buf._0_4_ + -4); uVar4 = itemDungeonPath._capacity + 0x24; if ((char *)0x1f < (char *)(itemDungeonPath._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar4); } itemDungeonPath._size = 0; itemDungeonPath._capacity = 0xf; itemDungeonPath._buf._0_4_ = itemDungeonPath._buf._0_4_ & 0xffffff00; } if (iVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } sprintf_s(floorAnimName,0x1f,(byte *)"Floor%u"); ANM2::Play(floorSprite,floorAnimName,0); } } ExceptionList = local_10; return; } //@@ 0099b980 GridEntity_Gravity::Update /* ZHL [exact] void Update(); */ void __thiscall GridEntity_Gravity::Update(GridEntity_Gravity *this) { int iVar1; int iVar2; int *piVar3; void *pvVar4; int iVar5; PlayerManager *pPVar6; int iVar7; uint uVar8; pPVar6 = &g_game->_playerManager; uVar8 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { do { pvVar4 = (pPVar6->_playerList)._end; if ((int)pvVar4 - (int)(pPVar6->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (pPVar6->_playerList)._end; } piVar3 = (pPVar6->_playerList)._begin; if (uVar8 < (uint)((int)pvVar4 - (int)piVar3 >> 2)) { piVar3 = piVar3 + uVar8; } iVar1 = *piVar3; iVar7 = (int)((*(float *)(iVar1 + 0x33c) - 40.0) / 40.0 + 0.5); iVar5 = (int)((*(float *)(iVar1 + 0x340) - 120.0) / 40.0 + 0.5); if ((((iVar7 < 0) || (iVar2 = *(int *)((int)g_game->_room + 0xc), iVar2 <= iVar7)) || (iVar5 < 0)) || (*(int *)((int)g_game->_room + 0x10) <= iVar5)) { iVar7 = -1; } else { iVar7 = iVar2 * iVar5 + iVar7; } if (iVar7 == this->_gridIndex) { *(uint *)(iVar1 + 0x168) = *(uint *)(iVar1 + 0x168) | 0x8000; *(undefined4 *)(iVar1 + 0x16c) = *(undefined4 *)(iVar1 + 0x16c); } uVar8 = uVar8 + 1; pPVar6 = &g_game->_playerManager; } while (uVar8 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2)); } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } //@@ 0099bad0 GridEntity_Stairs::BeginBatches /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [vtable slot 8] */ void __thiscall GridEntity_Stairs::BeginBatches(GridEntity_Stairs *this) { byte bVar1; byte *curAnimName; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; byte extraout_CL_02; char *pcVar2; uint uVar3; bool isLess; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined1 local_2c [8]; float local_24; float local_20; uint pathSize; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; byte *animData; ANM2 *sprite; local_8 = 0xffffffff; puStack_c = &LAB_00afcc05; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; pathSize = 0; if ((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 0xd & 1) == 0) { sprite = &this->_sprite; local_18 = 0xf; local_2c[0] = '\0'; local_2c[1] = '\0'; local_2c[2] = '\0'; local_2c[3] = '\0'; local_2c._0_4_ = std::_Allocate(0x30); pathSize = 0x24; local_18 = 0x2f; builtin_strncpy((char *)local_2c._0_4_,"gfx/grid/door_20_secrettrapdoor.anm2",0x25); local_8 = 0; ANM2::Load(sprite,(std_string *)local_2c,0); local_8 = 0xffffffff; bVar1 = extraout_CL; if (0xf < local_18) { uVar3 = local_18 + 1; pcVar2 = (char *)local_2c._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(local_2c._0_4_ + -4); uVar3 = local_18 + 0x24; if ((char *)0x1f < (char *)(local_2c._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); bVar1 = extraout_CL_00; } (this->_desc)._state = 0; if ((this->_desc)._variant == 2) { local_2c._0_4_ = std::_Allocate(0x30); pathSize = 0x20; local_18 = 0x2f; builtin_strncpy((char *)local_2c._0_4_,"gfx/grid/secretshop_trapdoor.png",0x21); local_8 = 1; Sprite::ReplaceSpritesheet((Sprite *)sprite,0,(std_string *)local_2c); local_8 = 0xffffffff; bVar1 = extraout_CL_01; if (0xf < local_18) { uVar3 = local_18 + 1; pcVar2 = (char *)local_2c._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(local_2c._0_4_ + -4); uVar3 = local_18 + 0x24; if ((char *)0x1f < (char *)(local_2c._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); bVar1 = extraout_CL_02; } } ANM2::LoadGraphics(sprite,bVar1); animData = (this->_sprite)._animState._animData; if (animData != (byte *)0x0) { curAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { curAnimName = *(byte **)animData; } pcVar2 = "Closed"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_0099bcf0: uVar3 = -(uint)isLess | 1; goto LAB_0099bcf5; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_0099bcf0; curAnimName = curAnimName + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_0099bcf5: if (uVar3 == 0) { if (animData[0x34] == 0) { ExceptionList = local_10; return; } if ((this->_sprite)._animState._isPlaying != 0) { ExceptionList = local_10; return; } } } bVar1 = ANM2::SetAnimation(sprite,(byte *)"Closed",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { local_3c = 0; local_38 = 0; local_34 = 0; local_30 = 0; local_2c._0_4_ = g_vectorZero.x; local_2c._4_4_ = g_vectorZero.y; local_24 = g_vectorZero.x; local_20 = g_vectorZero.y; local_18 = 0; (**(code **)(*(int *)this + 0x14))(1,&local_3c,local_14); } ExceptionList = local_10; return; } //@@ 0099bd50 GridEntity_Stairs::Update /* ZHL [vtable slot 2] */ void __thiscall GridEntity_Stairs::Update(GridEntity_Stairs *this) { qword qVar1; byte bVar2; byte *curAnimChar; int returnRoomIdx; char cVar3; uint extraout_ECX; undefined4 extraout_ECX_00; char *expectedName; uint uVar4; qword *allocatedBytes; Game *game; bool isLess; float fVar5; float deltaX; double dVar6; int iVar7; EntityList_EL nearbyEntities; Vector stairsPos; Vector local_24; float playerDistance; float local_18; char isGreedLocked; void *local_10; undefined1 *puStack_c; undefined4 local_8; int gridWidth; local_8 = 0xffffffff; puStack_c = &LAB_00b0d94d; local_10 = ExceptionList; ExceptionList = &local_10; if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) || (*(int *)((int)g_game->_room + 8) != 1)) || (isGreedLocked = '\x01', (*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) != 0)) { isGreedLocked = '\0'; } iVar7 = *(int *)((int)g_game->_room + 0xc); local_24.x = (float)(this->_gridIndex % iVar7) * 40.0 + 40.0; local_24.y = (float)(this->_gridIndex / iVar7) * 40.0 + 120.0; local_24.y = (float)Game::GetNearestPlayerEx(&local_24,1,0,0); local_18 = (float)(extraout_ECX & 0xffffff00); playerDistance = 1e+09; if ((Entity_Player *)local_24.y != (Entity_Player *)0x0) { iVar7 = *(int *)((int)g_game->_room + 0xc); deltaX = ((float)(this->_gridIndex % iVar7) * 40.0 + 40.0) - (((Entity_Player *)local_24.y)->_pos).x; fVar5 = ((float)(this->_gridIndex / iVar7) * 40.0 + 120.0) - (((Entity_Player *)local_24.y)->_pos).y; playerDistance = sqrtf(fVar5 * fVar5 + deltaX * deltaX); local_18 = (float)CONCAT31((int3)((uint)extraout_ECX_00 >> 8),playerDistance < 50.0); } iVar7 = *(int *)((int)g_game->_room + 0xc); stairsPos.x = (float)(this->_gridIndex % iVar7) * 40.0 + 40.0; stairsPos.y = (float)(this->_gridIndex / iVar7) * 40.0 + 120.0; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),&nearbyEntities,&stairsPos,20.0,1); game = g_game; cVar3 = SUB41(local_18,0); uVar4 = 0; local_8 = 0; fVar5 = local_18; if (nearbyEntities._size != 0) { do { cVar3 = SUB41(fVar5,0); if (cVar3 != '\0') break; iVar7 = *(int *)((int)nearbyEntities._data + uVar4 * 4); if ((*(int *)(iVar7 + 0x28) == 3) && (fVar5 = (float)((uint)fVar5 & 0xff), *(int *)(iVar7 + 0x2c) == 900)) { fVar5 = 1.4013e-45; } cVar3 = SUB41(fVar5,0); uVar4 = uVar4 + 1; } while (uVar4 < (uint)nearbyEntities._size); } if (((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0) || (cVar3 != '\0')) { if ((this->_sprite)._animState._animData != (void *)0x0) { local_18 = (this->_sprite)._animState._animFrame; dVar6 = floor((double)local_18); local_18 = (float)dVar6; if (9 < (int)dVar6) goto LAB_0099bf89; } LAB_0099c032: curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == (byte *)0x0) { LAB_0099c083: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"Closed",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } game = g_game; } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } expectedName = "Closed"; do { bVar2 = *curAnimChar; isLess = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_0099c068: uVar4 = -(uint)isLess | 1; goto LAB_0099c06d; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_0099c068; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0099c06d: if ((uVar4 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0099c083; } (this->_desc)._state = 0; } else { LAB_0099bf89: if (isGreedLocked != '\0') goto LAB_0099c032; curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == (byte *)0x0) { LAB_0099bfeb: bVar2 = ANM2::SetAnimation(&this->_sprite,(byte *)"Open Animation",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } game = g_game; } else { if (0xf < *(uint *)(curAnimChar + 0x14)) { curAnimChar = *(byte **)curAnimChar; } expectedName = "Open Animation"; do { bVar2 = *curAnimChar; isLess = bVar2 < (byte)*expectedName; if (bVar2 != *expectedName) { LAB_0099bfd0: uVar4 = -(uint)isLess | 1; goto LAB_0099bfd5; } if (bVar2 == 0) break; bVar2 = curAnimChar[1]; isLess = bVar2 < (byte)expectedName[1]; if (bVar2 != expectedName[1]) goto LAB_0099bfd0; curAnimChar = curAnimChar + 2; expectedName = expectedName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_0099bfd5: if ((uVar4 != 0) || ((*(char *)((int)(this->_sprite)._animState._animData + 0x34) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0099bfeb; } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { (this->_desc)._state = 1; } } if (((((Entity_Player *)local_24.y != (Entity_Player *)0x0) && (playerDistance < 21.0)) && ((this->_desc)._state == 1)) && (((*(byte *)((int)local_24.y + 0x1398) == 0 && (*(byte *)((int)local_24.y + 0x139a) == 0)) || ((*(EntityPtr *)((int)local_24.y + 0x1410) != (EntityPtr)0x0 && (*(EntityPtr *)((int)local_24.y + 0x1410) == *(EntityPtr *)((int)local_24.y + 0x1e68))))))) { switch((this->_desc)._variant) { case 0: iVar7 = -4; break; case 1: iVar7 = -0xb; break; case 2: iVar7 = -0xd; break; case 3: Game::StartRoomTransition(game,game->_startingRoomIdx,-1,2,(Entity_Player *)local_24.y,-1); goto LAB_0099c224; default: goto LAB_0099c12a; } Game::StartRoomTransition(game,iVar7,-1,2,(Entity_Player *)local_24.y,-1); game = g_game; LAB_0099c12a: fVar5 = g_vectorZero.y; local_24.y = (float)game->_currentRoomIdx; returnRoomIdx = game->_lastRoomIdx; if ((int)local_24.y < 0) { (game->_dungeonReturnPosition).x = g_vectorZero.x; (game->_dungeonReturnPosition).y = fVar5; if (returnRoomIdx < -0x13) { returnRoomIdx = -0x14; } else if (0xa7 < returnRoomIdx) { returnRoomIdx = 0xa8; } } else { iVar7 = this->_gridIndex; gridWidth = *(int *)((int)game->_room + 0xc); returnRoomIdx = (int)(Entity_Player *)0xa8; if ((int)local_24.y < 0xa8) { returnRoomIdx = (int)local_24.y; } (game->_dungeonReturnPosition).x = (float)(iVar7 % gridWidth) * 40.0 + 40.0; (game->_dungeonReturnPosition).y = (float)(iVar7 / gridWidth) * 40.0 + 120.0; } game->_dungeonReturnRoomIndex = returnRoomIdx; } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } LAB_0099c224: if (nearbyEntities._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (nearbyEntities._data != (void *)0x0) { uVar4 = *(uint *)((int)nearbyEntities._data + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar4; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < uVar4); free((void *)((int)nearbyEntities._data + -4)); } } ExceptionList = local_10; return; } //@@ 0099c290 HomingLaser::HomingLaser /* DB: zero-inits the vectors/fields (+0..+0x10, +0x1c..+0x3c, +0x48..+0x50); called at Entity_Laser+0x464 and Entity_Knife+0x468 (_homingLaser per db/fields.tsv) from their constructors */ void HomingLaser::HomingLaser(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[2] = 0; in_ECX[1] = 0; in_ECX[4] = 0; in_ECX[3] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; return; } //@@ 0099c310 FUN_0099c310 void FUN_0099c310(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 0x48)); std::vector::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); return; } //@@ 0099c340 segment_project_point /* DB: ECX = point P, EDX = segment start A, param_1 = segment end B: t = dot(P-A,B-A)/|B-A|^2 clamped to [0,1] (0 for a zero-length segment) written to *param_2; Entity_Laser::update_line_hits, HomingLaser::find_targets */ void segment_project_point(float *param_1,float *param_2) { float *in_ECX; float *in_EDX; float fVar1; float fVar2; float fVar3; float fVar4; fVar2 = 0.0; fVar3 = *param_1 - *in_EDX; fVar4 = param_1[1] - in_EDX[1]; fVar1 = fVar4 * fVar4 + fVar3 * fVar3; if (((fVar1 != 0.0) && (fVar1 = (fVar4 * (in_ECX[1] - in_EDX[1]) + fVar3 * (*in_ECX - *in_EDX)) / fVar1, 0.0 <= fVar1 )) && (fVar2 = 1.0, fVar1 <= 1.0)) { fVar2 = fVar1; } if (param_2 != (float *)0x0) { *param_2 = fVar2; } return; } //@@ 0099c430 bezier_closest_point /* DB: pure math: samples a cubic Bezier (p0=EDX, p1=EDX+4, p2=param_1, p3=param_1+2) in 5 steps and tracks the closest point/distance to ECX point; callers Entity_Knife::Update, 0099c790, HomingLaser 009a0850 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ float __cdecl bezier_closest_point(Vector *point,void *segmentStart,void *segmentEnd,float *outT) { uint uVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float local_20; float local_18; float local_c; fVar10 = 1e+06; fVar11 = 0.0; local_c = 0.0; uVar1 = 1; local_20 = *(float *)((int)segmentStart + 0x10) * 0.0 + *(float *)segmentStart + *(float *)((int)segmentEnd + 8) * 0.0 + *(float *)segmentEnd * 0.0; local_18 = *(float *)((int)segmentStart + 0x14) * 0.0 + *(float *)((int)segmentStart + 4) + *(float *)((int)segmentEnd + 0xc) * 0.0 + *(float *)((int)segmentEnd + 4) * 0.0; do { fVar2 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) / 5.0; fVar6 = 1.0 - fVar2; fVar3 = fVar6 * fVar6 * fVar6; fVar4 = fVar6 * fVar6 * 3.0 * fVar2; fVar7 = fVar6 * 3.0 * fVar2 * fVar2; fVar6 = fVar2 * fVar2 * fVar2; fVar9 = *(float *)segmentStart * fVar3 + *(float *)((int)segmentStart + 0x10) * fVar4 + *(float *)((int)segmentEnd + 8) * fVar7 + *(float *)segmentEnd * fVar6; fVar8 = fVar9 - local_20; fVar5 = point->y - local_18; fVar6 = *(float *)((int)segmentStart + 4) * fVar3 + *(float *)((int)segmentStart + 0x14) * fVar4 + *(float *)((int)segmentEnd + 0xc) * fVar7 + *(float *)((int)segmentEnd + 4) * fVar6; fVar7 = fVar6 - local_18; fVar3 = fVar7 * fVar7 + fVar8 * fVar8; fVar4 = point->x - local_20; if ((fVar3 == 0.0) || (fVar3 = (fVar8 * fVar4 + fVar7 * fVar5) / fVar3, fVar3 < 0.0)) { fVar3 = 0.0; fVar4 = fVar4 * fVar4 + fVar5 * fVar5; } else { if (fVar3 <= 1.0) { local_20 = fVar8 * fVar3 + local_20; local_18 = fVar7 * fVar3 + local_18; } else { fVar3 = 1.0; local_18 = fVar6; local_20 = fVar9; } local_20 = point->x - local_20; local_18 = point->y - local_18; fVar4 = local_18 * local_18 + local_20 * local_20; } if (fVar4 < fVar10) { fVar11 = (fVar2 - local_c) * fVar3 + local_c; fVar10 = 1.0 - fVar11; fVar3 = fVar10 * fVar10 * fVar10; fVar4 = fVar10 * fVar10 * 3.0 * fVar11; fVar7 = fVar10 * 3.0 * fVar11 * fVar11; fVar5 = fVar11 * fVar11 * fVar11; fVar10 = point->x - (*(float *)segmentStart * fVar3 + *(float *)((int)segmentStart + 0x10) * fVar4 + *(float *)((int)segmentEnd + 8) * fVar7 + *(float *)segmentEnd * fVar5); fVar3 = point->y - (*(float *)((int)segmentStart + 4) * fVar3 + *(float *)((int)segmentStart + 0x14) * fVar4 + *(float *)((int)segmentEnd + 0xc) * fVar7 + *(float *)((int)segmentEnd + 4) * fVar5); fVar10 = fVar3 * fVar3 + fVar10 * fVar10; } uVar1 = uVar1 + 1; local_20 = fVar9; local_18 = fVar6; local_c = fVar2; } while (uVar1 < 6); if (outT != (float *)0x0) { *outT = fVar11; } return fVar10; } //@@ 0099c790 HomingLaser::build_bezier_path /* DB: (isHoming, source): this=HomingLaser (_origin 0x4, _endPoint 0xc, _bezier vector 0x48 of 0x18 HomingLaser_Bezier); straight segment when empty, else targets via room entity list (IsVulnerableEnemy/IsDescendantOf, CalculateEndPoint); called by Entity_Knife::InitHomingPath and Entity_Laser::update_laser */ void HomingLaser::build_bezier_path(int param_1,Entity *param_2) { int *piVar1; int iVar2; Entity *pEVar3; Entity *pEVar4; void *pvVar5; bool bVar6; undefined1 *puVar7; byte bVar8; uint uVar9; BitSet128 *pBVar10; undefined4 *puVar11; Vector *pVVar12; float *pfVar13; undefined4 *in_ECX; EntityPtr EVar14; EntityPtr *pEVar15; int iVar16; void *pvVar17; EntityPtr *pEVar18; undefined4 *puVar19; uint uVar20; RNG *pRVar21; int *this; Entity *pEVar22; float fVar23; float fVar24; float fVar25; float fVar26; float fVar27; float fVar28; Entity *pEVar29; Entity *pEVar30; undefined1 local_c8 [8]; Vector local_c0; float local_b4; float local_b0; Vector local_ac; Vector local_a4; Vector local_9c; undefined4 *local_94; undefined1 local_90 [8]; Vector VStack_88; float local_7c; float fStack_78; float fStack_74; int *piStack_70; undefined4 *local_6c; undefined4 *puStack_68; Entity *local_64; undefined4 *local_60; Entity *local_5c; Entity *pEStack_58; Entity *pEStack_54; Entity *pEStack_50; Entity *local_4c; Entity *pEStack_48; Entity *local_44; Entity *local_40; Entity *local_3c; Entity *local_38; Entity *local_34; undefined4 *local_30; Entity *local_2c; char local_25; Entity *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0d97d; local_1c = ExceptionList; uVar9 = __security_cookie ^ (uint)(local_90 + 0x80); ExceptionList = &local_1c; pfVar13 = (float *)in_ECX[0x13]; this = in_ECX + 0x12; iVar16 = (int)pfVar13 - *this >> 0x1f; local_ac.y = (float)this; local_30 = in_ECX; puVar7 = (undefined1 *)((int)register0x00000010 + -4); if (((int)pfVar13 - *this) / 0x18 + iVar16 == iVar16) { local_7c = (float)in_ECX[1]; fStack_78 = (float)in_ECX[2]; local_6c = (undefined4 *)((local_7c + (float)in_ECX[3]) * 0.5); puStack_68 = (undefined4 *)((fStack_78 + (float)in_ECX[4]) * 0.5); if (pfVar13 == (float *)in_ECX[0x14]) { fStack_74 = local_7c; piStack_70 = (int *)fStack_78; vector_LaserSample_emplace_reallocate(this,pfVar13,&local_7c); } else { *pfVar13 = local_7c; pfVar13[1] = fStack_78; pfVar13[2] = local_7c; pfVar13[3] = fStack_78; *(ulonglong *)(pfVar13 + 4) = CONCAT44(puStack_68,local_6c); in_ECX[0x13] = in_ECX[0x13] + 0x18; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } local_7c = (float)in_ECX[3]; fStack_78 = (float)in_ECX[4]; pfVar13 = (float *)in_ECX[0x13]; fStack_74 = (local_7c + (float)in_ECX[1]) * 0.5; piStack_70 = (int *)((fStack_78 + (float)in_ECX[2]) * 0.5); if (pfVar13 == (float *)in_ECX[0x14]) { local_6c = (undefined4 *)local_7c; puStack_68 = (undefined4 *)fStack_78; vector_LaserSample_emplace_reallocate(this,pfVar13,&local_7c); puVar7 = puStack_20; } else { *pfVar13 = local_7c; pfVar13[1] = fStack_78; pfVar13[2] = fStack_74; pfVar13[3] = (float)piStack_70; pfVar13[4] = local_7c; pfVar13[5] = fStack_78; in_ECX[0x13] = in_ECX[0x13] + 0x18; puVar7 = puStack_20; } } puStack_20 = puVar7; puVar19 = (undefined4 *)0x0; piStack_70 = (int *)0x0; local_60 = (undefined4 *)0x0; local_6c = (undefined4 *)0x0; local_94 = (undefined4 *)0x0; puStack_68 = (undefined4 *)0x0; local_14 = 0; if (param_1 != 0) { local_2c = g_game->_room; if (*(int *)((int)local_2c + 0x1264) != 0) { uVar20 = 0; do { local_44 = *(Entity **)(*(int *)((int)local_2c + 0x125c) + uVar20 * 4); local_24 = local_44; bVar8 = Entity::IsVulnerableEnemy(local_44,(Entity *)0x0); if ((((bVar8 == 0) || ((local_44->_flags & 0x20000010) != 0)) || (local_44 == param_2)) || ((param_1 == 4 && (local_44->_type == param_2->_type)))) { local_25 = '\0'; } else { local_25 = '\x01'; } if (((*(int *)&g_game->_deathmatchManager < 2) || (local_44->_type != 3)) || ((local_44->_variant != 0x43 || (bVar8 = Entity::IsDescendantOf(local_44,(Entity *)param_2->_spawnerEntity), bVar8 != 0) ))) { bVar6 = false; } else { bVar6 = true; } pEVar29 = local_44; if ((local_25 != '\0') || (bVar6)) { if (puVar19 == local_94) { std::vector::_Emplace_reallocate(puVar19,&local_24); local_94 = puStack_68; pEVar29 = local_24; puVar19 = local_6c; } else { *puVar19 = local_44; local_6c = puVar19 + 1; puVar19 = local_6c; } } if (((param_1 == 5) && (pEVar29->_type == 1)) && (pEVar29 != param_2)) { if (puVar19 == local_94) { std::vector::_Emplace_reallocate(puVar19,&local_24); local_94 = puStack_68; puVar19 = local_6c; } else { *puVar19 = pEVar29; local_6c = puVar19 + 1; puVar19 = local_6c; } } uVar20 = uVar20 + 1; } while (uVar20 < *(uint *)((int)local_2c + 0x1264)); this = (int *)local_ac.y; local_60 = puVar19; } } puVar19 = local_60; local_2c = (Entity *)*local_30; if (local_2c != (Entity *)0x0) { local_90._0_4_ = *(undefined4 *)((int)&local_2c[1]._pendingDamageFlags + 4); local_90._4_4_ = local_2c[1]._index; VStack_88.x = (float)local_2c[1]._collisionIndex; VStack_88.y = (float)local_2c[1]._type; pBVar10 = BitSet128::operator_and ((BitSet128 *)local_c8,(BitSet128 *)local_90,(BitSet128 *)&DAT_00c34b70); if (((int)pBVar10->_l != 0 || *(int *)((int)&pBVar10->_l + 4) != 0) || ((int)pBVar10->_h != 0 || *(int *)((int)&pBVar10->_h + 4) != 0)) { local_3c = (Entity *)(local_2c->_targetPosition).x; local_44 = (Entity *)(local_2c->_targetPosition).y; EVar14 = local_2c->_spawnerEntity; if ((EVar14 == (EntityPtr)0x0) || (*(int *)((int)EVar14 + 0x28) != 1)) { EVar14 = (EntityPtr)0x0; } else { iVar16 = *(int *)((int)EVar14 + 0x140c); if (iVar16 != 0) { local_3c = *(Entity **)(iVar16 + 0x33c); local_44 = *(Entity **)(iVar16 + 0x340); } } local_c0.x = (float)local_3c; local_c0.y = (float)local_44; if (((float)local_3c != g_vectorZero.x) || ((float)local_44 != g_vectorZero.y)) { if (EVar14 == (EntityPtr)0x0) { local_24 = (Entity *)((float)local_3c - (float)local_30[1]); local_2c = (Entity *)((float)local_30[3] - (float)local_30[1]); VStack_88.y = (float)local_30[4] - (float)local_30[2]; local_38 = (Entity *)((float)local_44 - (float)local_30[2]); local_34 = (Entity *)sqrtf(VStack_88.y * VStack_88.y + (float)local_2c * (float)local_2c); if (0.0 < (float)local_34) { fVar23 = sqrtf((float)local_38 * (float)local_38 + (float)local_24 * (float)local_24); local_2c = (Entity *)((float)local_2c * (fVar23 / (float)local_34)); VStack_88.y = VStack_88.y * (fVar23 / (float)local_34); } fVar23 = (float)local_30[1]; fVar26 = (float)local_30[2]; fVar25 = (fVar23 + (float)local_2c) - fVar23; fVar28 = (fVar26 + VStack_88.y) - fVar26; fVar24 = fVar25 * 0.333 + fVar23; fVar27 = fVar28 * 0.333 + fVar26; local_34 = (Entity *)((((float)local_24 * 0.333 + fVar23) - fVar24) * 0.333 + fVar24); local_2c = (Entity *)((((float)local_38 * 0.333 + fVar26) - fVar27) * 0.333 + fVar27); fVar24 = fVar25 * 0.666 + fVar23; fVar27 = fVar28 * 0.666 + fVar26; local_24 = (Entity *)((((float)local_24 * 0.666 + fVar23) - fVar24) * 0.666 + fVar24); local_38 = (Entity *)((((float)local_38 * 0.666 + fVar26) - fVar27) * 0.666 + fVar27); VStack_88.x = (float)local_3c - (float)local_24; VStack_88.y = (float)local_44 - (float)local_38; pVVar12 = Entity_Laser::CalculateEndPoint (&local_a4,&local_c0,&VStack_88,&g_vectorZero,(Entity *)0x0,20.0); local_30[3] = pVVar12->x; local_30[4] = pVVar12->y; puVar11 = (undefined4 *)*this; this[1] = (int)puVar11; pEStack_58 = (Entity *)local_30[2]; local_5c = (Entity *)local_30[1]; local_4c = local_34; pEStack_48 = local_2c; if (puVar11 == (undefined4 *)this[2]) { pEStack_54 = local_5c; pEStack_50 = pEStack_58; vector_LaserSample_emplace_reallocate(this,puVar11,&local_5c); pfVar13 = (float *)local_30[0x13]; } else { *puVar11 = local_5c; puVar11[1] = pEStack_58; puVar11[2] = local_5c; puVar11[3] = pEStack_58; *(ulonglong *)(puVar11 + 4) = CONCAT44(local_2c,local_34); this[1] = this[1] + 0x18; pfVar13 = (float *)this[1]; } pEStack_54 = local_24; local_5c = local_3c; local_4c = (Entity *)(((float)local_30[3] - (float)local_3c) * 0.333 + (float)local_3c); pEStack_58 = local_44; pEStack_50 = local_38; pEStack_48 = (Entity *)(((float)local_30[4] - (float)local_44) * 0.333 + (float)local_44); if (pfVar13 == (float *)this[2]) { vector_LaserSample_emplace_reallocate(this,pfVar13,&local_5c); } else { *pfVar13 = (float)local_3c; pfVar13[1] = (float)local_44; pfVar13[2] = (float)local_24; pfVar13[3] = (float)local_38; *(ulonglong *)(pfVar13 + 4) = CONCAT44(pEStack_48,local_4c); this[1] = this[1] + 0x18; } local_5c = (Entity *)local_30[3]; pEStack_58 = (Entity *)local_30[4]; pEStack_54 = (Entity *)(((float)local_5c - (float)local_3c) * 0.666 + (float)local_3c); pEStack_50 = (Entity *)(((float)pEStack_58 - (float)local_44) * 0.666 + (float)local_44); local_4c = local_5c; pEStack_48 = pEStack_58; FUN_009a1770(&local_5c); } else { local_9c.y = (float)((this[1] - *this) / 0x18); iVar16 = (int)local_9c.y * 0x18; if ((uint)local_9c.y < 2) { local_38 = (Entity *)local_30[1]; local_24 = (Entity *)local_30[2]; if (local_9c.y == 0.0) { puVar11 = local_30 + 3; } else { puVar11 = (undefined4 *)(*this + -0x18 + iVar16); } } else { iVar2 = *this; local_38 = *(Entity **)(iVar2 + -0x30 + iVar16); local_24 = *(Entity **)(iVar2 + -0x2c + iVar16); puVar11 = (undefined4 *)(iVar2 + -0x18 + iVar16); } local_c0.y = (float)*puVar11; local_2c = (Entity *)puVar11[1]; local_b0 = (float)local_3c - (float)local_38; local_b4 = (float)local_44 - (float)local_24; fVar23 = sqrtf(local_b0 * local_b0 + local_b4 * local_b4); if (0.0 < fVar23) { local_b0 = (1.0 / fVar23) * local_b0; local_b4 = local_b4 * (1.0 / fVar23); } local_a4.y = local_c0.y - (float)local_3c; VStack_88.y = (float)local_2c - (float)local_44; fVar23 = sqrtf(local_a4.y * local_a4.y + VStack_88.y * VStack_88.y); if (0.0 < fVar23) { local_a4.y = local_a4.y * (1.0 / fVar23); VStack_88.y = VStack_88.y * (1.0 / fVar23); } local_64 = (Entity *)(local_c0.y - (float)local_38); local_40 = (Entity *)((float)local_2c - (float)local_24); fVar23 = sqrtf((float)local_64 * (float)local_64 + (float)local_40 * (float)local_40); if (0.0 < fVar23) { local_64 = (Entity *)((float)local_64 * (1.0 / fVar23)); local_40 = (Entity *)((float)local_40 * (1.0 / fVar23)); } if (1 < (uint)local_9c.y) { local_30[0x13] = local_30[0x13] + -0x18; } if (*this == this[1]) { local_9c.y = (float)local_64 * 50.0; pEStack_48 = (Entity *)((float)local_40 * 50.0 + (float)local_24); local_5c = local_38; local_4c = (Entity *)(local_9c.y + (float)local_38); pEStack_58 = local_24; pEStack_54 = local_38; pEStack_50 = local_24; FUN_009a1770(&local_5c); } else { local_9c.y = (float)local_64 * 50.0; } local_34 = (Entity *)cos(1.5707964); fVar23 = sin(1.5707964); pfVar13 = (float *)this[1]; local_5c = (Entity *) (((float)local_34 * (float)local_64 - fVar23 * (float)local_40) + (float)local_64 * 35.0 + (float)local_38); pEStack_58 = (Entity *) (fVar23 * (float)local_64 + (float)local_34 * (float)local_40 + (float)local_40 * 35.0 + (float)local_24); local_4c = (Entity *)(local_b0 * 50.0 + (float)local_5c); local_40 = (Entity *)((float)local_40 * 50.0); pEStack_48 = (Entity *)(local_b4 * 50.0 + (float)pEStack_58); pEStack_54 = (Entity *)((float)local_5c - local_9c.y); pEStack_50 = (Entity *)((float)pEStack_58 - (float)local_40); if (pfVar13 == (float *)this[2]) { vector_LaserSample_emplace_reallocate(this,pfVar13,&local_5c); pfVar13 = (float *)local_30[0x13]; } else { *pfVar13 = (float)local_5c; pfVar13[1] = (float)pEStack_58; pfVar13[2] = (float)pEStack_54; pfVar13[3] = (float)pEStack_50; *(ulonglong *)(pfVar13 + 4) = CONCAT44(pEStack_48,local_4c); this[1] = this[1] + 0x18; pfVar13 = (float *)this[1]; } pEStack_48 = (Entity *)((float)local_40 + (float)local_44); local_4c = (Entity *)(local_9c.y + (float)local_3c); pEStack_50 = (Entity *)((float)local_44 - (float)local_40); local_5c = local_3c; pEStack_54 = (Entity *)((float)local_3c - local_9c.y); pEStack_58 = local_44; if (pfVar13 == (float *)this[2]) { vector_LaserSample_emplace_reallocate(this,pfVar13,&local_5c); puVar11 = (undefined4 *)local_30[0x13]; } else { *pfVar13 = (float)local_3c; pfVar13[1] = (float)local_44; pfVar13[2] = (float)pEStack_54; pfVar13[3] = (float)pEStack_50; *(ulonglong *)(pfVar13 + 4) = CONCAT44(pEStack_48,local_4c); this[1] = this[1] + 0x18; puVar11 = (undefined4 *)this[1]; } pEStack_54 = (Entity *)(local_c0.y - local_a4.y * 50.0); local_5c = (Entity *)local_c0.y; pEStack_58 = local_2c; pEStack_50 = (Entity *)((float)local_2c - VStack_88.y * 50.0); local_4c = (Entity *)local_c0.y; pEStack_48 = local_2c; if (puVar11 == (undefined4 *)this[2]) { vector_LaserSample_emplace_reallocate(this,puVar11,&local_5c); compute_axis_bezier_handles(); } else { *puVar11 = local_c0.y; puVar11[1] = local_2c; puVar11[2] = pEStack_54; puVar11[3] = pEStack_50; puVar11[4] = local_c0.y; puVar11[5] = local_2c; this[1] = this[1] + 0x18; compute_axis_bezier_handles(); } } } } } if (param_1 == 1) { local_44 = (Entity *)this[1]; local_24 = (Entity *)*this; if (((int)local_44 - (int)local_24) - 0x30U < 0x18) { do { VStack_88.y = 0.0; local_25 = '\0'; if (((int)local_44 - (int)local_24) / 0x18 == 1) break; local_a4.y = 0.0; do { pEVar29 = (Entity *)local_a4.y; if (local_25 != '\0') goto LAB_0099d600; fVar26 = *(float *)((int)((int)local_a4.y + 0x18) + (int)local_24) - *(float *)((int)(&(local_24->_sprite)._filename + 5) + (int)((ANM2 *)((int)local_a4.y + 0x48) + -1) + 0xc); fVar23 = *(float *)((undefined1 *)((int)((int)local_a4.y + 0x18) + 4) + (int)local_24) - *(float *)((undefined1 *)((int)local_a4.y + 4) + (int)local_24); if (14400.0 <= fVar23 * fVar23 + fVar26 * fVar26) { local_34 = (Entity *)((int)local_60 - (int)piStack_70 >> 2); local_2c = (Entity *)0x0; if (local_34 != (Entity *)0x0) { LAB_0099d384: pvVar17 = (void *)((int)(&((ANM2 *)((int)pEVar29 + 0x48))->_filename + -3) + *this); local_9c.x = *(float *)(piStack_70[(int)local_2c] + 0x33c); local_9c.y = *(float *)(piStack_70[(int)local_2c] + 0x340); fVar24 = bezier_closest_point (&local_9c,pvVar17,(void *)((int)pvVar17 + 0x18),(float *)0x0); fVar26 = g_vectorZero.y; fVar23 = g_vectorZero.x; if ((float)local_30[5] * (float)local_30[5] <= fVar24) goto LAB_0099d46a; iVar16 = *this; fVar24 = *(float *)((((ANM2 *)((int)pEVar29 + 0x48))->_filename)._buf + iVar16 + -0x44 ); fVar27 = *(float *)((int)(&((ANM2 *)((int)pEVar29 + 0x48))->_filename + -3) + iVar16); if ((((*(float *)((((ANM2 *)((int)pEVar29 + 0x48))->_filename)._buf + iVar16 + -0x34) - fVar24) * (local_9c.y - fVar24) + (local_9c.x - fVar27) * (*(float *)((((ANM2 *)((int)pEVar29 + 0x48))->_filename)._buf + iVar16 + -0x38) - fVar27) <= 0.0) || ((local_9c.y - fVar24) * (local_9c.y - fVar24) + (local_9c.x - fVar27) * (local_9c.x - fVar27) <= 6400.0)) || (fVar24 = local_9c.y - *(float *)((((ANM2 *)((int)pEVar29 + 0x48))->_filename)._buf + iVar16 + -0x2c), fVar27 = local_9c.x - *(float *)((int)(&((ANM2 *)((int)pEVar29 + 0x48))->_filename + -2) + iVar16), fVar24 * fVar24 + fVar27 * fVar27 <= 6400.0)) goto LAB_0099d46a; local_c0.y = (float)((int)(&((ANM2 *)((int)pEVar29 + 0x48))->_filename + -2) + iVar16) ; pEVar30 = (Entity *)this[1]; local_5c = (Entity *)local_9c.x; pEStack_58 = (Entity *)local_9c.y; pEStack_54 = (Entity *)g_vectorZero.x; pEStack_50 = (Entity *)g_vectorZero.y; local_4c = (Entity *)g_vectorZero.x; pEStack_48 = (Entity *)g_vectorZero.y; if (pEVar30 == (Entity *)this[2]) { vector_LaserSample_emplace_reallocate(this,(void *)local_c0.y,&local_5c); } else if ((Entity *)local_c0.y == pEVar30) { *(float *)pEVar30 = local_9c.x; *(float *)&pEVar30->field_0x4 = local_9c.y; (pEVar30->_damageEvents)._begin = (void *)fVar23; (pEVar30->_damageEvents)._end = (void *)fVar26; (pEVar30->_damageEvents)._capacity = (void *)fVar23; pEVar30->_pendingDamage = fVar26; this[1] = this[1] + 0x18; } else { fVar24 = pEVar30[-1]._holdPosition.y; pvVar17 = (void *)pEVar30[-1]._pitfallState; pvVar5 = (void *)pEVar30[-1]._pitfallTimer; local_34 = (Entity *)&pEVar30[-1]._holdPosition; *(float *)pEVar30 = pEVar30[-1]._holdPosition.x; *(float *)&pEVar30->field_0x4 = fVar24; (pEVar30->_damageEvents)._begin = pvVar17; (pEVar30->_damageEvents)._end = pvVar5; pvVar17 = pEVar30[-1]._luaBridgeRef; (pEVar30->_damageEvents)._capacity = (void *)pEVar30[-1]._scoreMultiplier; pEVar30->_pendingDamage = (float)pvVar17; this[1] = this[1] + 0x18; if (local_34 != (Entity *)local_c0.y) { pEVar15 = (EntityPtr *)&pEVar30->_pendingDamage; pEVar18 = (EntityPtr *)&pEVar30[-1]._holdCountdown; pRVar21 = (RNG *)local_34; do { pEVar15[-0xb] = pEVar18[-5]; pRVar21 = (RNG *)((EntityPtr *)(pRVar21 + -2) + 2); pEVar15[-10] = pEVar18[-4]; pEVar15[-9] = pEVar18[-3]; pEVar15[-8] = pEVar18[-2]; pEVar15[-7] = pEVar18[-1]; pEVar15[-6] = *pEVar18; pEVar15 = pEVar15 + -6; pEVar18 = pEVar18 + -6; } while (pRVar21 != (RNG *)local_c0.y); pEVar29 = (Entity *)local_a4.y; this = (int *)local_ac.y; } *(float *)local_c0.y = local_9c.x; *(float *)&((Entity *)local_c0.y)->field_0x4 = local_9c.y; (((Entity *)local_c0.y)->_damageEvents)._begin = (void *)fVar23; (((Entity *)local_c0.y)->_damageEvents)._end = (void *)fVar26; (((Entity *)local_c0.y)->_damageEvents)._capacity = (void *)fVar23; ((Entity *)local_c0.y)->_pendingDamage = fVar26; } piVar1 = piStack_70 + (int)local_2c; memmove(piVar1,piVar1 + 1,(int)local_60 - (int)(piVar1 + 1)); local_6c = local_60 + -1; local_25 = '\x01'; local_60 = local_6c; compute_axis_bezier_handles(); } } LAB_0099d5b3: local_24 = (Entity *)*this; local_a4.y = (float)&pEVar29->_pendingDamageFlags; pEVar29 = (Entity *)this[1]; VStack_88.y = (float)((int)VStack_88.y + 1); local_44 = (Entity *)this[1]; local_34 = local_24; } while ((uint)VStack_88.y < (undefined1 *)(((int)pEVar29 - (int)local_24) / 0x18 + -1)); local_44 = pEVar29; if (local_25 == '\0') break; LAB_0099d600: } while ((uint)(((int)local_44 - (int)local_24) / 0x18) < 6); } else { local_38 = (Entity *)0x1; VStack_88.y = -NAN; if (1 < ((int)local_44 - (int)local_24) / 0x18 - 1U) { local_24 = (Entity *)0x18; do { local_34 = (Entity *)((int)puVar19 - (int)piStack_70 >> 2); local_2c = (Entity *)0x0; if (local_34 != (Entity *)0x0) { do { local_ac.x = *(float *)(piStack_70[(int)local_2c] + 0x33c); local_ac.y = *(float *)(piStack_70[(int)local_2c] + 0x340); pvVar17 = (void *)((int)(&(local_24->_sprite)._filename + -3) + *this); fVar23 = bezier_closest_point (&local_ac,pvVar17,(void *)((int)pvVar17 + 0x18),(float *)0x0); if (fVar23 < (float)local_30[5] * (float)local_30[5]) { pfVar13 = (float *)((int)(&(local_24->_sprite)._filename + -3) + *this); *pfVar13 = local_ac.x; pfVar13[1] = local_ac.y; piVar1 = piStack_70 + (int)local_2c; memmove(piVar1,piVar1 + 1,(int)puVar19 - (int)(piVar1 + 1)); puVar19 = puVar19 + -1; if ((Entity *)VStack_88.y == (Entity *)0xffffffff) { VStack_88.y = (float)local_38; } local_6c = puVar19; break; } local_2c = (Entity *)&local_2c->field_0x1; } while (local_2c < local_34); } local_38 = (Entity *)&local_38->field_0x1; local_24 = (Entity *)&local_24->_pendingDamageFlags; } while (local_38 < (undefined1 *)((this[1] - *this) / 0x18 + -1)); if (-1 < (int)VStack_88.y) { compute_axis_bezier_handles(); } } } } else if (param_1 == 4) { if ((this[1] - *this) - 0x30U < 0x18) { if ((int)puVar19 - (int)piStack_70 >> 2 != 0) { local_34 = (Entity *)(piStack_70 + 1); do { local_5c = *(Entity **)(*piStack_70 + 0x33c); pEStack_58 = *(Entity **)(*piStack_70 + 0x340); pEStack_54 = (Entity *)g_vectorZero.x; pEStack_50 = (Entity *)g_vectorZero.y; local_4c = (Entity *)g_vectorZero.x; pEStack_48 = (Entity *)g_vectorZero.y; std::vector::insert (&local_ac.y,*this + (((local_30[0x13] - *this) / 0x18) * 3 + -3) * 8,&local_5c) ; puVar19 = local_60; memmove(piStack_70,local_34,(int)local_60 - (int)local_34); local_6c = puVar19 + -1; local_60 = local_6c; } while ((int)local_6c - (int)piStack_70 >> 2 != 0); } compute_axis_bezier_handles(uVar9); } } else if (param_1 == 5) { pfVar13 = (float *)*this; if ((this[1] - (int)pfVar13) - 0x30U < 0x18) { iVar16 = local_30[0x13]; pEVar29 = (Entity *)(*(float *)(iVar16 + -0x18) - *pfVar13); pEVar30 = (Entity *)(*(float *)(iVar16 + -0x14) - pfVar13[1]); local_40 = pEVar30; local_3c = pEVar29; if (0.01 <= (float)pEVar30 * (float)pEVar30 + (float)pEVar29 * (float)pEVar29) { vector_LaserSample_erase(&local_34,iVar16 + -0x18); local_60 = (undefined4 *)((int)puVar19 - (int)piStack_70 >> 2); do { fVar27 = local_ac.y; fVar24 = INFINITY; pEVar3 = (Entity *)local_30[0x13]; local_34 = (Entity *)0x0; fVar23 = pEVar3[-1]._holdPosition.x; fVar26 = pEVar3[-1]._holdPosition.y; VStack_88.y = (float)pEVar3; if (local_60 == (undefined4 *)0x0) break; local_2c = (Entity *)0x0; pEVar22 = local_2c; do { pEVar4 = (Entity *)piStack_70[(int)pEVar22]; fVar28 = fVar26 - (pEVar4->_pos).y; fVar25 = fVar23 - (pEVar4->_pos).x; fVar25 = fVar28 * fVar28 + fVar25 * fVar25; if (fVar25 < fVar24) { local_2c = pEVar4; fVar24 = fVar25; } pEVar22 = (Entity *)&pEVar22->field_0x1; } while (pEVar22 < local_60); if (local_2c == (Entity *)0x0) break; local_24 = (Entity *)((local_2c->_pos).x - fVar23); local_38 = (Entity *)((local_2c->_pos).y - fVar26); local_64 = pEVar29; local_2c = pEVar30; fVar23 = sqrtf((float)pEVar29 * (float)pEVar29 + (float)pEVar30 * (float)pEVar30); if (0.0 < fVar23) { local_2c = (Entity *)((1.0 / fVar23) * (float)local_40); local_64 = (Entity *)((1.0 / fVar23) * (float)local_3c); } local_34 = local_24; VStack_88.y = (float)local_38; local_c0.y = sqrtf((float)local_24 * (float)local_24 + (float)local_38 * (float)local_38); if (local_c0.y <= 0.0) { pEVar29 = local_34; } else { VStack_88.y = (1.0 / local_c0.y) * (float)local_38; pEVar29 = (Entity *)((1.0 / local_c0.y) * (float)local_24); } uVar9 = (*(int *)((int)fVar27 + 4) - *(int *)fVar27) / 0x18; local_64 = (Entity *) (((float)local_64 * (float)pEVar29 + (float)local_2c * VStack_88.y + 1.0) * 0.5 ); if (1 < uVar9) { iVar16 = *(int *)fVar27; local_3c = (Entity *) (*(float *)(iVar16 + -0x18 + uVar9 * 0x18) - *(float *)(iVar16 + -0x30 + uVar9 * 0x18)); local_40 = (Entity *) (*(float *)(iVar16 + -0x14 + uVar9 * 0x18) - *(float *)(iVar16 + -0x2c + uVar9 * 0x18)); } fVar23 = sqrtf((float)local_3c * (float)local_3c + (float)local_40 * (float)local_40); if (0.0 < fVar23) { local_40 = (Entity *)((float)local_40 * (1.0 / fVar23)); local_3c = (Entity *)((float)local_3c * (1.0 / fVar23)); } if (local_c0.y <= 0.0) { pEVar30 = local_38; pEVar29 = local_24; } else { pEVar30 = (Entity *)((1.0 / local_c0.y) * (float)local_38); pEVar29 = (Entity *)((1.0 / local_c0.y) * (float)local_24); } local_40 = (Entity *)((float)pEVar30 * 0.3 * (float)local_64 + (float)local_40); local_3c = (Entity *)((float)local_3c + (float)pEVar29 * 0.3 * (float)local_64); fVar24 = sqrtf((float)local_40 * (float)local_40 + (float)local_3c * (float)local_3c); fVar26 = g_vectorZero.y; fVar23 = g_vectorZero.x; if (0.0 < fVar24) { local_3c = (Entity *)((float)local_3c * (1.0 / fVar24)); local_40 = (Entity *)((float)local_40 * (1.0 / fVar24)); } puVar19 = *(undefined4 **)((int)fVar27 + 4); local_a4.x = (float)local_3c * 40.0 + pEVar3[-1]._holdPosition.x; local_a4.y = (float)local_40 * 40.0 + pEVar3[-1]._holdPosition.y; pEStack_54 = (Entity *)g_vectorZero.x; pEStack_50 = (Entity *)g_vectorZero.y; local_4c = (Entity *)g_vectorZero.x; pEStack_48 = (Entity *)g_vectorZero.y; local_5c = (Entity *)local_a4.x; pEStack_58 = (Entity *)local_a4.y; if (puVar19 == *(undefined4 **)((int)fVar27 + 8)) { vector_LaserSample_emplace_reallocate((void *)fVar27,puVar19,&local_5c); } else { *puVar19 = local_a4.x; puVar19[1] = local_a4.y; puVar19[2] = fVar23; puVar19[3] = fVar26; *(ulonglong *)(puVar19 + 4) = CONCAT44(fVar26,fVar23); *(int *)((int)fVar27 + 4) = *(int *)((int)fVar27 + 4) + 0x18; } bVar8 = Room::IsPositionInRoom(g_game->_room,&local_a4,0.0); if (bVar8 == 0) break; pEVar29 = local_3c; pEVar30 = local_40; } while ((uint)((*(int *)((int)fVar27 + 4) - *(int *)fVar27) / 0x18) < 0x19); compute_bezier_handles(); } } } if (piStack_70 != (int *)0x0) { deallocate(piStack_70,(int)local_94 - (int)piStack_70 >> 2); } ExceptionList = local_1c; return; LAB_0099d46a: local_2c = (Entity *)&local_2c->field_0x1; if (local_34 <= local_2c) goto LAB_0099d5b3; goto LAB_0099d384; } //@@ 0099dca0 HomingLaser::compute_axis_bezier_handles /* DB: ? sets the control points of every _bezier (+0x48, 0x18 stride) entry snapped to the dominant axis (+-1,0)/(0,+-1) at half the segment length; HomingLaser::build_bezier_path after pushing segments */ void HomingLaser::compute_axis_bezier_handles(void) { float fVar1; int iVar2; int in_ECX; float *pfVar3; int iVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; undefined1 *puVar10; float fVar11; float x; undefined1 *puVar12; undefined1 *local_38; undefined1 *local_34; float local_30; float local_2c; uint local_20; pfVar3 = *(float **)(in_ECX + 0x48); if ((uint)((*(int *)(in_ECX + 0x4c) - (int)pfVar3) / 0x18) < 2) { return; } fVar1 = pfVar3[1]; fVar9 = pfVar3[4] - *pfVar3; local_34 = (undefined1 *)0x3f800000; if (ABS(fVar9) <= ABS(pfVar3[5] - fVar1)) { puVar10 = (undefined1 *)0x0; if (pfVar3[5] - fVar1 < 0.0) { local_34 = &DAT_bf800000; } } else { if (0.0 <= fVar9) { puVar10 = (undefined1 *)0x3f800000; } else { puVar10 = &DAT_bf800000; } local_34 = (undefined1 *)0x0; } fVar9 = pfVar3[6] - *pfVar3; fVar9 = sqrtf((pfVar3[7] - fVar1) * (pfVar3[7] - fVar1) + fVar9 * fVar9); fVar11 = (float)puVar10 * fVar9 * 0.5; fVar9 = (float)local_34 * fVar9 * 0.5; pfVar3[4] = fVar11 + *pfVar3; local_20 = 1; pfVar3[5] = fVar9 + fVar1; pfVar3[9] = pfVar3[7] - fVar9; pfVar3[8] = pfVar3[6] - fVar11; if ((*(int *)(in_ECX + 0x4c) - (int)pfVar3) / 0x18 - 1U < 2) { iVar4 = *(int *)(in_ECX + 0x48); } else { pfVar3 = (float *)(*(int *)(in_ECX + 0x48) + 4); do { fVar1 = pfVar3[5]; fVar9 = pfVar3[6]; fVar11 = pfVar3[-1] - fVar1; local_2c = pfVar3[0xc] - fVar9; local_30 = pfVar3[0xb] - fVar1; fVar5 = *pfVar3 - fVar9; fVar6 = sqrtf(local_2c * local_2c + local_30 * local_30); if (0.0 < fVar6) { local_30 = (1.0 / fVar6) * local_30; local_2c = local_2c * (1.0 / fVar6); } x = fVar5 * fVar5 + fVar11 * fVar11; fVar7 = sqrtf(x); if (fVar7 <= 0.0) { fVar8 = fVar5; fVar7 = fVar11; } else { fVar8 = (1.0 / fVar7) * fVar5; fVar7 = (1.0 / fVar7) * fVar11; } if (ABS(local_30 + fVar7) <= ABS(local_2c + fVar8)) { puVar10 = (undefined1 *)0x0; if (0.0 <= local_2c + fVar8) { puVar12 = (undefined1 *)0x3f800000; local_38 = (undefined1 *)0x3f800000; } else { puVar12 = &DAT_bf800000; local_38 = &DAT_bf800000; } } else { puVar12 = (undefined1 *)0x0; local_38 = (undefined1 *)0x0; if (0.0 <= local_30 + fVar7) { puVar10 = (undefined1 *)0x3f800000; } else { puVar10 = &DAT_bf800000; } } local_2c = -(float)puVar10; if (fVar11 * (float)puVar12 + local_2c * fVar5 < 0.0) { puVar12 = (undefined1 *)((uint)puVar12 ^ 0x80000000); local_2c = -local_2c; local_38 = puVar12; } if ((pfVar3[3] - pfVar3[-1]) * (fVar1 - pfVar3[-1]) + (pfVar3[4] - *pfVar3) * (fVar9 - *pfVar3) < 0.0) { puVar12 = (undefined1 *)((float)puVar12 + (float)puVar12); local_2c = local_2c + local_2c; local_38 = puVar12; } pfVar3[10] = -fVar6 * local_2c * 0.5 + fVar9; pfVar3[9] = -fVar6 * (float)puVar12 * 0.5 + fVar1; fVar11 = sqrtf(x); local_20 = local_20 + 1; pfVar3[7] = fVar11 * (float)local_38 * 0.5 + fVar1; pfVar3[8] = fVar11 * local_2c * 0.5 + fVar9; pfVar3 = pfVar3 + 6; iVar4 = *(int *)(in_ECX + 0x48); } while (local_20 < (*(int *)(in_ECX + 0x4c) - iVar4) / 0x18 - 1U); } iVar2 = (*(int *)(in_ECX + 0x4c) - iVar4) / 0x18; fVar1 = *(float *)(iVar4 + -0x18 + iVar2 * 0x18); fVar9 = *(float *)(iVar4 + -0x14 + iVar2 * 0x18); fVar11 = *(float *)(iVar4 + -0x30 + iVar2 * 0x18) - fVar1; fVar5 = *(float *)(iVar4 + -0x2c + iVar2 * 0x18) - fVar9; if (ABS(fVar11) <= ABS(fVar5)) { fVar11 = 0.0; } else { fVar5 = 0.0; } *(float *)(iVar4 + -0x10 + iVar2 * 0x18) = fVar11 * 0.5 + fVar1; *(float *)(iVar4 + -0xc + iVar2 * 0x18) = fVar5 * 0.5 + fVar9; return; } //@@ 0099e160 HomingLaser::compute_bezier_handles /* DB: over the 0x18-byte bezier points (+0x48 vector: pos, in-handle, out-handle) sets each handle to pos -/+ (prev delta + next delta) * tension (XMM1), halved for interior points, treating the path as closed when first and last points coincide (< 0.1); HomingLaser::build_bezier_path, build_ring_bezier */ void HomingLaser::compute_bezier_handles(void) { float *pfVar1; int iVar2; bool bVar3; bool bVar4; int in_ECX; uint uVar5; int iVar6; float *pfVar7; uint uVar8; float fVar9; float in_XMM1_Da; float fVar10; float fVar11; float fVar12; iVar6 = *(int *)(in_ECX + 0x4c); pfVar1 = *(float **)(in_ECX + 0x48); fVar9 = *(float *)(iVar6 + -0x18) - *pfVar1; fVar10 = *(float *)(iVar6 + -0x14) - pfVar1[1]; if ((0.01 <= fVar10 * fVar10 + fVar9 * fVar9) || ((uint)((iVar6 - (int)pfVar1) / 0x18) < 3)) { bVar4 = false; iVar2 = iVar6 - (int)pfVar1 >> 0x1f; if ((iVar6 - (int)pfVar1) / 0x18 + iVar2 == iVar2) { return; } bVar3 = false; } else { bVar3 = true; bVar4 = true; } pfVar7 = pfVar1; uVar8 = 0; do { fVar9 = g_vectorZero.x; fVar10 = g_vectorZero.y; if (bVar3) { iVar2 = (iVar6 - (int)pfVar7) / 0x18; if (uVar8 != 0) { if (uVar8 == iVar2 - 1U) { fVar9 = pfVar7[6] - pfVar7[uVar8 * 6]; fVar10 = pfVar7[7] - pfVar7[uVar8 * 6 + 1]; } goto LAB_0099e26a; } fVar11 = *pfVar7 - pfVar7[iVar2 * 6 + -0xc]; fVar12 = pfVar7[1] - pfVar7[iVar2 * 6 + -0xb]; } else { LAB_0099e26a: fVar11 = g_vectorZero.x; fVar12 = g_vectorZero.y; if (uVar8 != 0) { fVar11 = pfVar7[uVar8 * 6] - pfVar7[uVar8 * 6 + -6]; fVar12 = pfVar7[uVar8 * 6 + 1] - pfVar7[uVar8 * 6 + -5]; } } uVar5 = (iVar6 - (int)pfVar7) / 0x18 - 1; if (uVar8 < uVar5) { fVar9 = pfVar7[uVar8 * 6 + 6] - pfVar7[uVar8 * 6]; fVar10 = pfVar7[uVar8 * 6 + 7] - pfVar7[uVar8 * 6 + 1]; } fVar9 = (fVar11 + fVar9) * in_XMM1_Da; fVar10 = (fVar12 + fVar10) * in_XMM1_Da; if ((bVar4) || ((uVar8 != 0 && (uVar8 < uVar5)))) { fVar9 = fVar9 * 0.5; fVar10 = fVar10 * 0.5; } uVar5 = uVar8 + 1; pfVar1[uVar8 * 6 + 2] = pfVar1[uVar8 * 6] - fVar9; pfVar1[uVar8 * 6 + 3] = pfVar1[uVar8 * 6 + 1] - fVar10; pfVar1[uVar8 * 6 + 4] = fVar9 + pfVar1[uVar8 * 6]; pfVar1[uVar8 * 6 + 5] = fVar10 + pfVar1[uVar8 * 6 + 1]; iVar6 = *(int *)(in_ECX + 0x4c); pfVar7 = *(float **)(in_ECX + 0x48); uVar8 = uVar5; bVar3 = bVar4; if ((uint)((iVar6 - (int)pfVar7) / 0x18) <= uVar5) { return; } } while( true ); } //@@ 0099e360 HomingLaser::CalculateSamples /* DB: REPENTOGON name HomingLaser::CalculateSamples(float): this=HomingLaser (_bezier vector at 0x48/0x4c stride 0x18, _sampleNum +0x18, +0x44), "Bezier Path Size is less than 2!", in_XMM1 arg; called from Entity_Laser::update_laser and UpdateHits prototype: REPENTOGON */ void __thiscall HomingLaser::CalculateSamples(HomingLaser *this,float param_2) { undefined1 *puVar1; float fVar2; float fVar3; undefined4 *puVar4; uint uVar5; uint uVar6; int iVar7; float *pfVar8; void *ptr; int iVar9; undefined4 *puVar10; float *pfVar11; HomingLaser *pHVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; float fVar19; float fVar20; void *local_68; float *local_64; float *local_60; float *local_5c; undefined4 *local_58; undefined4 *local_54; undefined4 *local_50; float local_4c; float local_48; float local_44; undefined4 *local_40; float local_3c; float local_38; float local_34; float local_30; float local_2c; HomingLaser *local_28; int local_24; float *local_20; float local_1c; float *local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0d9b5; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_28 = this; local_1c = param_2; if ((uint)(((int)(this->_bezier)._end - (int)(this->_bezier)._begin) / 0x18) < 2) { KAGE_LogMessage(0x10,(byte *)"Bezier Path Size is less than 2!\n"); } local_68 = (void *)0x0; local_64 = (float *)0x0; local_20 = (float *)0x0; local_60 = (float *)0x0; local_8 = 0; uVar6 = *(uint *)&this->field_0x18; if (uVar6 != 0) { if (0x1fffffff < uVar6) { /* WARNING: Subroutine does not return */ std::_Xlen(uVar5); } std::vector<8byte>::_Reallocate_exactly(uVar6); local_20 = local_60; } this->_totalLength = 0.0; local_18 = (float *)0x0; local_5c = (float *)0x0; local_58 = (undefined4 *)0x0; local_14 = (undefined4 *)0x0; local_54 = (undefined4 *)0x0; local_8 = CONCAT31(local_8._1_3_,1); uVar6 = ((int)(this->_bezier)._end - (int)(this->_bezier)._begin) / 0x18; local_60 = local_20; if (uVar6 != 0) { if (0x3fffffff < uVar6) { /* WARNING: Subroutine does not return */ std::_Xlen(uVar5); } std::vector::_Reallocate(uVar6); local_14 = local_54; local_18 = local_5c; } local_40 = (undefined4 *)0x0; if (local_58 == local_14) { local_5c = local_18; local_54 = local_14; std::vector::_Emplace_reallocate(local_58,&local_40); local_14 = local_54; local_18 = local_5c; } else { *local_58 = 0; local_58 = local_58 + 1; } local_38 = 0.0; puVar10 = local_58; local_5c = local_18; local_54 = local_14; if (((int)(this->_bezier)._end - (int)(this->_bezier)._begin) / 0x18 != 1) { local_24 = 0; pfVar8 = local_18; do { local_40 = (undefined4 *)0x0; if (puVar10 == local_14) { std::vector::_Emplace_reallocate(puVar10,&local_40); local_14 = local_54; pfVar8 = local_5c; } else { *puVar10 = 0; local_58 = puVar10 + 1; } iVar7 = local_24; fVar13 = local_38; local_48 = 0.0; local_50 = (this->_bezier)._begin; local_3c = 1.4013e-45; local_40 = local_58; do { fVar14 = 1.0 - local_48; fVar18 = (float)((double)(int)local_3c + __uint_to_double_fixup[-((int)local_3c >> 0x1f)]) / 10.0; local_30 = fVar14 * fVar14 * fVar14; fVar19 = 1.0 - fVar18; local_34 = fVar14 * 3.0 * local_48 * local_48; local_38 = local_48 * local_48 * local_48; local_2c = fVar14 * fVar14 * 3.0 * local_48; fVar14 = *(float *)((int)local_50 + iVar7 + 0x20); local_44 = fVar19 * fVar19 * fVar19; fVar15 = fVar19 * fVar19 * 3.0 * fVar18; fVar20 = fVar19 * 3.0 * fVar18 * fVar18; fVar17 = fVar18 * fVar18 * fVar18; fVar19 = *(float *)((int)local_50 + iVar7 + 0x18); local_18 = (float *)(*(float *)((int)local_50 + iVar7 + 0x10) * local_2c + *(float *)((int)local_50 + iVar7) * local_30); fVar16 = *(float *)((int)local_50 + iVar7 + 0x1c); fVar2 = *(float *)((int)local_50 + iVar7 + 4); fVar3 = *(float *)((int)local_50 + iVar7 + 0x24); fVar19 = (*(float *)((int)local_50 + iVar7 + 0x10) * fVar15 + *(float *)((int)local_50 + iVar7) * local_44 + fVar14 * fVar20 + fVar19 * fVar17) - ((float)local_18 + fVar14 * local_34 + fVar19 * local_38); fVar14 = (*(float *)((int)local_50 + iVar7 + 0x14) * fVar15 + fVar2 * local_44 + fVar3 * fVar20 + fVar16 * fVar17) - (*(float *)((int)local_50 + iVar7 + 0x14) * local_2c + fVar2 * local_30 + fVar3 * local_34 + fVar16 * local_38); local_48 = fVar18; fVar19 = sqrtf(fVar14 * fVar14 + fVar19 * fVar19); fVar14 = pfVar8[(int)fVar13 + 1]; local_3c = (float)((int)local_3c + 1); pfVar8[(int)fVar13 + 1] = fVar19 + fVar14; } while ((uint)local_3c < 0xb); local_24 = local_24 + 0x18; local_38 = (float)((int)fVar13 + 1); local_28->_totalLength = fVar19 + fVar14 + local_28->_totalLength; puVar10 = local_40; this = local_28; } while ((uint)local_38 < ((int)(local_28->_bezier)._end - (int)(local_28->_bezier)._begin) / 0x18 - 1U); local_18 = pfVar8; } pfVar8 = local_18; if ((this->_totalLength != 0.0) && (uVar5 = (int)puVar10 - (int)local_18 >> 2, uVar5 != 0)) { uVar6 = 1; *local_18 = *local_18 / this->_totalLength; if (1 < uVar5) { do { fVar13 = local_18[uVar6] / this->_totalLength; local_18[uVar6] = fVar13; local_18[uVar6] = fVar13 + local_18[uVar6 - 1]; uVar6 = uVar6 + 1; } while (uVar6 < uVar5); } } local_40 = (undefined4 *)0x0; local_38 = 0.0; local_50 = (undefined4 *)(((int)puVar10 - (int)local_18 >> 2) - 1); uVar5 = *(uint *)&this->field_0x18; do { fVar13 = (float)((double)(int)local_38 + __uint_to_double_fixup[-((int)local_38 >> 0x1f)]) / (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]); local_3c = fVar13; puVar10 = local_40; while ((puVar4 = puVar10, puVar4 < local_50 && (fVar14 = pfVar8[(int)puVar4], fVar14 < fVar13))) { local_3c = ((fVar13 - fVar14) / (pfVar8[(int)puVar4 + 1] - fVar14)) / (float)((double)(int)local_50 + __uint_to_double_fixup[-((int)local_50 >> 0x1f)]) + (float)((double)(int)puVar4 + __uint_to_double_fixup[-((int)puVar4 >> 0x1f)]) / (float)((double)(int)local_50 + __uint_to_double_fixup[-((int)local_50 >> 0x1f)]); local_40 = puVar4; puVar10 = (undefined4 *)((int)puVar4 + 1); } if ((uint)(((int)(this->_bezier)._end - (int)(this->_bezier)._begin) / 0x18) < 2) { KAGE_LogMessage(0x10,(byte *)"Bezier Path Size less than 2!\n"); } pfVar11 = (this->_bezier)._begin; iVar7 = ((int)(this->_bezier)._end - (int)pfVar11) / 0x18; fVar13 = (float)((double)(iVar7 + -1) + __uint_to_double_fixup[-(iVar7 + -1 >> 0x1f)]) * local_3c; iVar9 = (int)fVar13; fVar13 = fVar13 - (float)iVar9; if (iVar9 < 0) { local_4c = *pfVar11; local_48 = pfVar11[1]; } else if (iVar9 < iVar7 + -1) { fVar19 = 1.0 - fVar13; fVar14 = fVar19 * fVar19 * fVar19; fVar16 = fVar19 * fVar19 * 3.0 * fVar13; fVar19 = fVar19 * 3.0 * fVar13 * fVar13; fVar13 = fVar13 * fVar13 * fVar13; local_4c = fVar14 * pfVar11[iVar9 * 6] + fVar16 * pfVar11[iVar9 * 6 + 4] + fVar19 * pfVar11[iVar9 * 6 + 8] + fVar13 * pfVar11[iVar9 * 6 + 6]; local_48 = fVar16 * pfVar11[iVar9 * 6 + 5] + fVar14 * pfVar11[iVar9 * 6 + 1] + fVar19 * pfVar11[iVar9 * 6 + 9] + fVar13 * pfVar11[iVar9 * 6 + 7]; } else { local_4c = pfVar11[iVar7 * 6 + -6]; local_48 = pfVar11[iVar7 * 6 + -5]; } if (local_64 == local_20) { std::vector::_Emplace_reallocate(local_64,&local_4c); local_20 = local_60; } else { *local_64 = local_4c; local_64[1] = local_48; local_64 = local_64 + 2; } uVar5 = *(uint *)&this->field_0x18; local_38 = (float)((int)local_38 + 1); } while ((uint)local_38 <= uVar5); local_40 = *(undefined4 **)&this->field_0x34; puVar1 = &this->field_0x34; local_24 = *(int *)&this->field_0x38 - (int)local_40 >> 3; pHVar12 = this; if (local_24 == (int)local_64 - (int)local_68 >> 3) { if (*(int *)&this->field_0x40 == 1) { if (local_24 != 0) { local_50 = (undefined4 *)((int)local_68 - (int)local_40); uVar5 = 0; pfVar8 = (float *)(local_40 + 1); do { iVar7 = uVar5 * 8; uVar5 = uVar5 + 1; fVar13 = *(float *)((int)local_50 + (int)pfVar8); pfVar8[-1] = (*(float *)((int)local_68 + iVar7) - pfVar8[-1]) * local_1c + pfVar8[-1]; *pfVar8 = (fVar13 - *pfVar8) * local_1c + *pfVar8; pfVar8 = pfVar8 + 2; } while (uVar5 < (uint)(*(int *)&this->field_0x38 - *(int *)puVar1 >> 3)); pfVar8 = local_18; goto LAB_0099eb5f; } } else { fVar13 = this->_totalLength / 200.0; uVar5 = 0; if (fVar13 <= 0.0) { fVar13 = 0.0; } if (1.0 <= fVar13) { fVar13 = 1.0; } local_1c = (local_1c - 0.0) * fVar13 + 0.0; if (local_24 != 0) { do { uVar6 = -(uint)(uVar5 != 0) & uVar5; iVar7 = (*(int *)&this->field_0x38 - *(int *)puVar1 >> 3) + -1; fVar13 = *(float *)((int)local_68 + uVar5 * 8 + 4); fVar14 = (float)local_40[uVar5 * 2 + 1]; fVar16 = 1.0 - ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)] ) / (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)])) * local_1c; fVar19 = (float)local_40[uVar5 * 2 + 1]; local_40[uVar5 * 2] = (*(float *)((int)local_68 + uVar5 * 8) - (float)local_40[uVar5 * 2]) * fVar16 + (float)local_40[uVar5 * 2]; local_40[uVar5 * 2 + 1] = (fVar13 - fVar14) * fVar16 + fVar19; uVar5 = uVar5 + 1; } while (uVar5 < (uint)(*(int *)&this->field_0x38 - *(int *)puVar1 >> 3)); LAB_0099eb5f: pHVar12 = local_28; } } } else if ((void **)puVar1 != &local_68) { std::vector::assign(local_68,local_64,local_50); } if (&pHVar12->_samples != (std_vector *)puVar1) { std::vector::assign(*(undefined4 *)puVar1,*(undefined4 *)&this->field_0x38,local_50); } if (pfVar8 != (float *)0x0) { uVar5 = (int)local_14 - (int)pfVar8 & 0xfffffffc; pfVar11 = pfVar8; if (0xfff < uVar5) { pfVar11 = (float *)pfVar8[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pfVar8 + (-4 - (int)pfVar11))) goto LAB_0099ebcf; } operator_delete(pfVar11,uVar5); } if (local_68 != (void *)0x0) { uVar5 = (int)local_20 - (int)local_68 & 0xfffffff8; ptr = local_68; if (0xfff < uVar5) { ptr = *(void **)((int)local_68 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_68 + (-4 - (int)ptr))) { LAB_0099ebcf: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } ExceptionList = local_10; return; } //@@ 0099ec00 HomingLaser::apply_sine_offset /* DB: ? ECX = Entity_Laser+0x464: mode +0x40 == 1 offsets each sample radially from origin (+4/+8) by sin(i*12pi/n - frame*0.1 - phase)*10*amp; else offsets perpendicular to origin->end (+4..+0x10) line; Entity_Laser::update_laser/UpdateHits */ void HomingLaser::apply_sine_offset(void) { int iVar1; int in_ECX; int iVar2; uint uVar3; float fVar4; float fVar5; float fVar6; float in_XMM1_Da; float in_XMM2_Da; float fVar7; float local_2c; float local_28; float local_24; int local_20; float *local_18; if (*(int *)(in_ECX + 0x40) == 1) { iVar2 = *(int *)(in_ECX + 0x1c); uVar3 = 0; if (*(int *)(in_ECX + 0x20) - iVar2 >> 3 != 0) { do { local_2c = *(float *)(iVar2 + uVar3 * 8) - *(float *)(in_ECX + 4); fVar5 = *(float *)(iVar2 + 4 + uVar3 * 8); local_28 = fVar5 - *(float *)(in_ECX + 8); fVar4 = sqrtf(local_2c * local_2c + local_28 * local_28); if (0.0 < fVar4) { local_2c = local_2c * (1.0 / fVar4); local_28 = local_28 * (1.0 / fVar4); } iVar1 = (*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3) + -1; fVar4 = sin((((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 37.699112) / (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) - (float)g_game->_frameCount * 0.1) - in_XMM2_Da); fVar4 = fVar4 * 10.0 * in_XMM1_Da; *(float *)(iVar2 + uVar3 * 8) = local_2c * fVar4 + *(float *)(iVar2 + uVar3 * 8); *(float *)(iVar2 + 4 + uVar3 * 8) = local_28 * fVar4 + fVar5; uVar3 = uVar3 + 1; } while (uVar3 < (uint)(*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3)); return; } } else { fVar5 = *(float *)(in_ECX + 0x10) - *(float *)(in_ECX + 8); fVar4 = *(float *)(in_ECX + 0xc) - *(float *)(in_ECX + 4); fVar5 = sqrtf(fVar5 * fVar5 + fVar4 * fVar4); uVar3 = 0; iVar2 = *(int *)(in_ECX + 0x20); local_20 = *(int *)(in_ECX + 0x1c); if (iVar2 - local_20 >> 3 != 1) { local_18 = (float *)(local_20 + 4); do { fVar4 = *local_18; local_24 = local_18[2] - fVar4; fVar7 = local_18[1] - local_18[-1]; fVar6 = sqrtf(local_24 * local_24 + fVar7 * fVar7); if (0.0 < fVar6) { local_24 = local_24 * (1.0 / fVar6); fVar7 = fVar7 * (1.0 / fVar6); } if (uVar3 < 0x14) { iVar2 = iVar2 - local_20; fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) / 20.0 ; LAB_0099eedf: local_28 = fVar6 * in_XMM1_Da * 20.0; } else { iVar2 = iVar2 - local_20; local_28 = in_XMM1_Da * 20.0; if ((iVar2 >> 3) - 0x16U < uVar3) { iVar1 = ((iVar2 >> 3) - uVar3) + 1; fVar6 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) / 22.0; goto LAB_0099eedf; } } iVar2 = (iVar2 >> 3) + -2; fVar6 = sin((((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) / (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])) * (fVar5 / 200.0) * 15.0 - (float)g_game->_frameCount * 0.1) - in_XMM2_Da); uVar3 = uVar3 + 1; local_18[-1] = local_24 * fVar6 * local_28 + local_18[-1]; *local_18 = -fVar7 * fVar6 * local_28 + fVar4; local_18 = local_18 + 2; local_20 = *(int *)(in_ECX + 0x1c); iVar2 = *(int *)(in_ECX + 0x20); } while (uVar3 < (iVar2 - local_20 >> 3) - 1U); } } return; } //@@ 0099efc0 Entity_Laser::update_wiggle_path /* DB: ? called from Entity_Laser::update_laser when tear flags & DAT_00c348e0 or DAT_00c348a0 (with get_tear_trinket_multiplier 0x2e/0x1a Hook Worm); this=Laser (+0x40 mode, +0x1c/+0x20 sample vector, +0x4..0x10 endpoints), sin/cos/pow displacement of the path samples */ void Entity_Laser::update_wiggle_path(void) { float fVar1; double dVar2; int iVar3; int iVar4; int in_ECX; float *pfVar5; uint uVar6; int iVar7; float fVar8; float fVar9; float fVar10; float fVar11; double dVar12; float in_XMM1_Da; float fVar13; float in_XMM2_Da; float fVar14; float local_3c; float local_38; if (*(int *)(in_ECX + 0x40) != 1) { fVar8 = *(float *)(in_ECX + 0x10) - *(float *)(in_ECX + 8); fVar14 = *(float *)(in_ECX + 0xc) - *(float *)(in_ECX + 4); fVar8 = sqrtf(fVar8 * fVar8 + fVar14 * fVar14); uVar6 = 0; iVar4 = *(int *)(in_ECX + 0x1c); iVar7 = *(int *)(in_ECX + 0x20) - iVar4 >> 3; iVar3 = g_game->_frameCount; if (iVar7 != 1) { fVar14 = cos(1.5707964); fVar9 = sin(1.5707964); pfVar5 = (float *)(iVar4 + 4); dVar2 = __uint_to_double_fixup[-(iVar7 + -2 >> 0x1f)]; do { local_3c = pfVar5[1] - pfVar5[-1]; fVar1 = *pfVar5; local_38 = pfVar5[2] - fVar1; fVar10 = sqrtf(local_3c * local_3c + local_38 * local_38); if (0.0 < fVar10) { local_38 = (1.0 / fVar10) * local_38; local_3c = local_3c * (1.0 / fVar10); } fVar10 = 1.0; if (uVar6 < 0x14) { fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]); fVar10 = fVar11 / 20.0; } else { if (iVar7 - 0x16U < uVar6) { iVar4 = (iVar7 - uVar6) + 1; fVar10 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 22.0; } fVar11 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]); } dVar12 = (double)(1.0 - fVar10); libm_sse2_pow_precise(); fVar13 = (1.0 - (float)dVar12) * 30.0 * in_XMM1_Da; fVar10 = ((fVar11 / (float)((double)(iVar7 + -2) + dVar2)) * (fVar8 / 200.0) * 15.0) / in_XMM1_Da - ((float)iVar3 * 0.1 - in_XMM2_Da); fVar11 = sin(fVar10); fVar10 = cos(fVar10); uVar6 = uVar6 + 1; pfVar5[-1] = fVar10 * (local_3c * fVar14 - fVar9 * local_38) * fVar13 + fVar11 * local_3c * fVar13 + pfVar5[-1]; *pfVar5 = fVar10 * (local_3c * fVar9 + fVar14 * local_38) * fVar13 + fVar11 * local_38 * fVar13 + fVar1; pfVar5 = pfVar5 + 2; } while (uVar6 < iVar7 - 1U); } } return; } //@@ 0099f2c0 laser_sample_trace_entities /* DB: ? called from Entity_Laser::update_laser; ECX struct {laser*, x0,y0,x1,y1,...}: Entity::IsDescendantOf filter, Room::CheckLine(…,3), steps +0x13 by 24px and rewrites end point [3],[4] */ void laser_sample_trace_entities(void) { Entity *this; bool bVar1; byte bVar2; float *pfVar3; Vector *pVVar4; int *in_ECX; int iVar5; float fVar6; float fVar7; float local_88; float fStack_84; float fStack_80; float fStack_7c; float local_78; float fStack_74; Vector local_70; Vector local_68; Vector local_60; float local_54; float local_50; uint local_4c; Entity *local_48; float local_44; float local_40; float local_3c; Entity *local_38; float local_34; undefined1 *local_30; float local_2c; float local_28; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); uStack_14 = 0xffffffff; puStack_18 = &LAB_00b0d9e0; local_1c = ExceptionList; ExceptionList = &local_1c; local_44 = (float)in_ECX[3]; local_28 = local_44 - (float)in_ECX[1]; local_38 = (Entity *)in_ECX[4]; local_2c = (float)local_38 - (float)in_ECX[2]; fVar6 = sqrtf(local_28 * local_28 + local_2c * local_2c); if (0.0 < fVar6) { local_28 = local_28 * (1.0 / fVar6); local_2c = local_2c * (1.0 / fVar6); } local_48 = (Entity *)cos(1.5707964); fVar6 = sin(1.5707964); local_40 = local_28 * (float)local_48 - local_2c * fVar6; local_3c = local_28 * fVar6 + local_2c * (float)local_48; local_34 = sqrtf(((float)in_ECX[2] - (float)local_38) * ((float)in_ECX[2] - (float)local_38) + ((float)in_ECX[1] - local_44) * ((float)in_ECX[1] - local_44)); local_30 = (undefined1 *)0x3f800000; local_38 = (Entity *)0x0; local_48 = *(Entity **)(*in_ECX + 0x3c8); local_44 = 0.0; local_60.y = (float)g_game->_room; if (*(int *)((int)local_60.y + 0x1264) != 0) { do { this = *(Entity **)(*(int *)((int)local_60.y + 0x125c) + (int)local_44 * 4); if (((this == local_48) || ((((*(int *)&g_game->_deathmatchManager < 2 || (iVar5 = 1, this->_type != 1)) && (iVar5 = this->_type, 0x3dd < iVar5 - 10U)) || ((this->_entityCollisionClass == 1 || (this->_entityCollisionClass == 0)))))) || ((this->_isInvicible != 0 || (this->_dead != 0)))) { LAB_0099f4ba: local_21 = '\0'; } else { local_54 = *(float *)((int)&this->_flags + 4); if (((((this->_flags & 0x10) != 0) && (iVar5 != 0x322)) && (iVar5 != 0x362)) || (local_21 = '\x01', (this->_flags & 0x20000010) != 0)) goto LAB_0099f4ba; } if ((((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 3)) || (this->_variant != 0x43)) || (bVar2 = Entity::IsDescendantOf(this,local_48), bVar2 != 0)) { bVar1 = false; } else { bVar1 = true; } if ((local_21 != '\0') || (bVar1)) { local_68.x = (this->_pos).x; local_68.y = (this->_pos).y; fVar6 = local_68.x - (float)in_ECX[1]; fVar7 = local_68.y - (float)in_ECX[2]; local_50 = local_2c * fVar7 + local_28 * fVar6; local_54 = fVar7 * local_3c + fVar6 * local_40; if ((80.0 < local_50) && ((local_50 < local_34 && (iVar5 = *in_ECX, *(float *)(iVar5 + 0x370) + this->_size < ABS(local_54))))) { if ((*(int *)(iVar5 + 0x184) != 0) && (*(int *)(iVar5 + 0x184) != 3)) { local_4c = *(uint *)(iVar5 + 0x434) & g_tearFlagSpectral._h._4_4_; if (((*(uint *)(iVar5 + 0x428) & (uint)g_tearFlagSpectral._l) == 0 && (*(uint *)(iVar5 + 0x42c) & g_tearFlagSpectral._l._4_4_) == 0) && ((*(uint *)(iVar5 + 0x430) & (uint)g_tearFlagSpectral._h) == 0 && local_4c == 0)) { local_70.x = local_28 * local_50 + (float)in_ECX[1]; local_70.y = local_2c * local_50 + (float)in_ECX[2]; bVar2 = Room::CheckLine(g_game->_room,&local_70,&local_68,3,0,0,0,(Vector *)0x0); if (bVar2 == 0) goto LAB_0099f68b; } } local_38 = this; local_34 = local_50; if (local_54 <= 0.0) { local_30 = &DAT_bf800000; } else { local_30 = (undefined1 *)0x3f800000; } } } LAB_0099f68b: local_44 = (float)((int)local_44 + 1); } while ((uint)local_44 < *(uint *)((int)local_60.y + 0x1264)); if (local_38 != (Entity *)0x0) { local_48 = (Entity *)in_ECX[0x12]; local_88 = (float)in_ECX[1]; fStack_84 = (float)in_ECX[2]; local_70.x = local_40 * (float)local_30; local_68.y = local_2c * local_34 + fStack_84; local_70.y = local_3c * (float)local_30; local_68.x = local_28 * local_34 + local_88; if (1 < (uint)((in_ECX[0x13] - (int)local_48) / 0x18)) { in_ECX[0x13] = in_ECX[0x13] + -0x18; } if (1 < (uint)((in_ECX[0x13] - (int)local_48) / 0x18)) { in_ECX[0x13] = in_ECX[0x13] + -0x18; } pfVar3 = (float *)in_ECX[0x13]; local_44 = local_68.y; local_40 = local_70.x; local_3c = local_70.y; local_38 = (Entity *)local_68.x; if (local_48 == (Entity *)pfVar3) { local_78 = local_28 * 50.0 + local_88; fStack_74 = local_2c * 50.0 + fStack_84; if (pfVar3 == (float *)in_ECX[0x14]) { fStack_80 = local_88; fStack_7c = fStack_84; vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar3,&local_88); } else { *pfVar3 = local_88; pfVar3[1] = fStack_84; pfVar3[2] = local_88; pfVar3[3] = fStack_84; *(ulonglong *)(pfVar3 + 4) = CONCAT44(fStack_74,local_78); in_ECX[0x13] = in_ECX[0x13] + 0x18; } pfVar3 = (float *)in_ECX[0x13]; } fVar6 = local_28 * 20.0; local_78 = (float)local_38 - local_28 * 5.0; fStack_74 = local_44 - local_2c * 5.0; fStack_80 = (float)local_38 - local_28 * 60.0; fStack_7c = local_44 - local_2c * 60.0; local_88 = (float)local_38 - fVar6; fStack_84 = local_44 - local_2c * 20.0; local_28 = fVar6; if (pfVar3 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar3,&local_88); } else { *pfVar3 = local_88; pfVar3[1] = fStack_84; pfVar3[2] = fStack_80; pfVar3[3] = fStack_7c; *(ulonglong *)(pfVar3 + 4) = CONCAT44(fStack_74,local_78); in_ECX[0x13] = in_ECX[0x13] + 0x18; } pfVar3 = (float *)in_ECX[0x13]; local_78 = local_40 * 60.0 + (float)local_38; fStack_74 = local_3c * 60.0 + local_44; fStack_80 = local_40 * 5.0 + (float)local_38; fStack_7c = local_3c * 5.0 + local_44; local_88 = local_40 * 20.0 + (float)local_38; fStack_84 = local_3c * 20.0 + local_44; if (pfVar3 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar3,&local_88); } else { *pfVar3 = local_88; pfVar3[1] = fStack_84; pfVar3[2] = fStack_80; pfVar3[3] = fStack_7c; *(ulonglong *)(pfVar3 + 4) = CONCAT44(fStack_74,local_78); in_ECX[0x13] = in_ECX[0x13] + 0x18; } pVVar4 = Entity_Laser::calc_end_point((Entity_Laser *)*in_ECX,&local_60,&local_68,&local_70); local_88 = pVVar4->x; in_ECX[3] = (int)local_88; fStack_84 = pVVar4->y; fStack_80 = local_88 - local_40 * 50.0; in_ECX[4] = (int)fStack_84; pfVar3 = (float *)in_ECX[0x13]; fStack_7c = fStack_84 - local_3c * 50.0; local_78 = local_88; fStack_74 = fStack_84; if (pfVar3 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar3,&local_88); } else { *pfVar3 = local_88; pfVar3[1] = fStack_84; pfVar3[2] = fStack_80; pfVar3[3] = fStack_7c; *(ulonglong *)(pfVar3 + 4) = CONCAT44(fStack_84,local_88); in_ECX[0x13] = in_ECX[0x13] + 0x18; } if ((in_ECX[0xd] != in_ECX[0xe]) && (fVar6 = (float)in_ECX[4] - *(float *)(in_ECX[0xe] + -4), fVar7 = (float)in_ECX[3] - *(float *)(in_ECX[0xe] + -8), fVar6 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7), 40.0 < fVar6)) { in_ECX[8] = in_ECX[7]; in_ECX[0xe] = in_ECX[0xd]; in_ECX[0xb] = in_ECX[10]; } } } ExceptionList = local_1c; return; } //@@ 0099fa60 HomingLaser::build_curl_path /* DB: ? thiscall on the homing-path object (start +4, end +0xc, sample vector +0x4c): pushes the start sample, then generates curling samples by atan2(end-start) - 0.7 - i/5*1.5*pi with radius from xmm1*1.05; Entity_Knife::InitHomingPath, Entity_Laser::update_laser */ void HomingLaser::build_curl_path(void) { float *pfVar1; int in_ECX; float10 fVar2; float fVar3; float fVar4; double dVar5; double dVar6; float in_XMM1_Da; float fVar7; float fVar8; float fVar9; uint uStack_48; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float fStack_1c; fVar7 = *(float *)(in_ECX + 0xc) - *(float *)(in_ECX + 4); fVar9 = *(float *)(in_ECX + 0x10) - *(float *)(in_ECX + 8); fVar3 = sqrtf(fVar7 * fVar7 + fVar9 * fVar9); if (0.0 < fVar3) { fVar9 = (1.0 / fVar3) * fVar9; fVar7 = fVar7 * (1.0 / fVar3); } pfVar1 = *(float **)(in_ECX + 0x4c); local_30 = *(float *)(in_ECX + 4); local_20 = fVar7 * 50.0 + local_30; fStack_2c = *(float *)(in_ECX + 8); fStack_1c = fVar9 * 50.0 + fStack_2c; fStack_28 = local_30; fStack_24 = fStack_2c; if (pfVar1 == *(float **)(in_ECX + 0x50)) { vector_LaserSample_emplace_reallocate((void *)(in_ECX + 0x48),pfVar1,&local_30); } else { *pfVar1 = local_30; pfVar1[1] = fStack_2c; pfVar1[2] = local_30; pfVar1[3] = fStack_2c; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + 0x18; } fVar3 = *(float *)(in_ECX + 0x10) - *(float *)(in_ECX + 8); fVar9 = *(float *)(in_ECX + 0xc) - *(float *)(in_ECX + 4); fVar2 = (float10)_CIatan2(); fVar7 = in_XMM1_Da * 1.05; uStack_48 = 0; do { fVar8 = ((float)fVar2 - 0.7) - ((float)((double)(int)uStack_48 + __uint_to_double_fixup[-((int)uStack_48 >> 0x1f)]) / 5.0) * 3.1415927 * 6.0 * 0.25; dVar5 = (double)(fVar8 + 0.25); dVar6 = dVar5; libm_sse2_cos_precise(); fVar4 = *(float *)(in_ECX + 4); libm_sse2_sin_precise(); fStack_24 = (float)dVar5 * fVar7 + *(float *)(in_ECX + 8); dVar5 = (double)fVar8; fStack_28 = (float)dVar6 * fVar7 + fVar4; libm_sse2_cos_precise(); fVar4 = *(float *)(in_ECX + 4); dVar6 = (double)fVar8; libm_sse2_sin_precise(); fStack_2c = (float)dVar6 * in_XMM1_Da + *(float *)(in_ECX + 8); dVar6 = (double)(fVar8 - 0.25); local_30 = (float)dVar5 * in_XMM1_Da + fVar4; libm_sse2_cos_precise(); fVar4 = (float)dVar6 * fVar7 + *(float *)(in_ECX + 4); dVar6 = (double)(fVar8 - 0.25); libm_sse2_sin_precise(); pfVar1 = *(float **)(in_ECX + 0x4c); fStack_1c = (float)dVar6 * fVar7 + *(float *)(in_ECX + 8); local_20 = fVar4; if (pfVar1 == *(float **)(in_ECX + 0x50)) { vector_LaserSample_emplace_reallocate((void *)(in_ECX + 0x48),pfVar1,&local_30); } else { *pfVar1 = local_30; pfVar1[1] = fStack_2c; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,fVar4); *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + 0x18; } pfVar1 = *(float **)(in_ECX + 0x4c); uStack_48 = uStack_48 + 1; } while (uStack_48 < 6); fStack_2c = *(float *)(in_ECX + 0x10); local_30 = *(float *)(in_ECX + 0xc); fStack_1c = fStack_2c - fVar3 * 0.25; fStack_28 = local_30 - fVar9 * 0.75; local_20 = local_30 - fVar9 * 0.25; fStack_24 = fStack_2c - fVar3 * 0.75; local_30 = local_30 - fVar9 * 0.5; fStack_2c = fStack_2c - fVar3 * 0.5; if (pfVar1 == *(float **)(in_ECX + 0x50)) { vector_LaserSample_emplace_reallocate((void *)(in_ECX + 0x48),pfVar1,&local_30); } else { *pfVar1 = local_30; pfVar1[1] = fStack_2c; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + 0x18; } local_30 = *(float *)(in_ECX + 0xc); fStack_2c = *(float *)(in_ECX + 0x10); local_20 = local_30 + fVar9; pfVar1 = *(float **)(in_ECX + 0x4c); fStack_1c = fStack_2c + fVar3; fStack_28 = local_30 - fVar9 * 0.25; fStack_24 = fStack_2c - fVar3 * 0.25; if (pfVar1 == *(float **)(in_ECX + 0x50)) { vector_LaserSample_emplace_reallocate((void *)(in_ECX + 0x48),pfVar1,&local_30); return; } *pfVar1 = local_30; pfVar1[1] = fStack_2c; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + 0x18; return; } //@@ 0099fed0 HomingLaser::build_wiggle_bezier /* DB: (tearFlags): this=HomingLaser; perpendicular (cos/sin pi/2) offsets scaled by amplitude pushed as 0x18 bezier entries into _bezier (0x48); called from Entity_Laser::update_laser when the laser's tear flags & mask 0xc34860 */ void HomingLaser::build_wiggle_bezier(void) { float *pfVar1; int iVar2; Vector *pVVar3; undefined4 *in_ECX; float fVar4; float fVar5; float in_XMM1_Da; float fVar6; float in_XMM2_Da; float fVar7; float in_XMM3_Da; float fVar8; float fVar9; float local_7c; float local_78; float local_74; undefined1 local_60 [4]; float local_5c; float local_58; float local_54; float local_50; Vector local_4c; Vector local_44; float local_3c; Vector local_38; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float fStack_1c; local_7c = (float)in_ECX[3] - (float)in_ECX[1]; local_38.x = (float)in_ECX[1]; local_74 = (float)in_ECX[2]; local_78 = (float)in_ECX[4] - local_74; local_3c = in_XMM3_Da; local_38.y = local_74; fVar4 = sqrtf(local_7c * local_7c + local_78 * local_78); if (0.0 < fVar4) { local_7c = local_7c * (1.0 / fVar4); local_78 = local_78 * (1.0 / fVar4); } fVar4 = cos(1.5707964); fVar5 = sin(1.5707964); local_54 = local_7c * in_XMM1_Da; local_50 = local_78 * in_XMM1_Da; fVar8 = local_54 * 0.2; local_4c.x = (fVar4 * local_7c - fVar5 * local_78) * in_XMM2_Da * 0.5; local_44.x = (fVar5 * local_7c + fVar4 * local_78) * in_XMM2_Da * 0.5; fVar9 = local_50 * 0.2; local_5c = local_54 * 0.5 - local_4c.x; local_58 = local_50 * 0.5 - local_44.x; iVar2 = (int)(in_ECX[0x13] - in_ECX[0x12]) >> 0x1f; fVar7 = local_4c.x + local_54 * 0.5; fVar6 = local_44.x + local_50 * 0.5; fVar4 = fVar8; fVar5 = fVar9; if ((int)(in_ECX[0x13] - in_ECX[0x12]) / 0x18 + iVar2 == iVar2) { local_20 = fVar8 + local_38.x; local_30 = (float)in_ECX[1]; fStack_2c = (float)in_ECX[2]; fStack_1c = local_74 + fVar9; pfVar1 = (float *)in_ECX[0x13]; if (pfVar1 == (float *)in_ECX[0x14]) { fStack_28 = local_30; fStack_24 = fStack_2c; vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar1,&local_30); } else { *pfVar1 = local_30; pfVar1[1] = fStack_2c; pfVar1[2] = local_30; pfVar1[3] = fStack_2c; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); in_ECX[0x13] = in_ECX[0x13] + 0x18; } } else { vector_LaserSample_erase(local_60,in_ECX[0x13] + -0x18); iVar2 = in_ECX[0x13]; local_38.x = *(float *)(iVar2 + -0x18); local_74 = *(float *)(iVar2 + -0x14); *(float *)(iVar2 + -8) = fVar4 + local_38.x; *(float *)(iVar2 + -4) = local_74 + fVar5; local_38.y = local_74; } pfVar1 = (float *)in_ECX[0x13]; local_54 = local_38.x + local_54; fStack_2c = local_74 + local_58; local_30 = local_38.x + local_5c; local_50 = local_74 + local_50; local_20 = fVar4 + local_30; fStack_28 = local_30 - fVar4; local_58 = local_38.x + fVar7; fStack_1c = fVar5 + fStack_2c; local_5c = local_74 + fVar6; fStack_24 = fStack_2c - fVar5; if (pfVar1 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar1,&local_30); } else { *pfVar1 = local_30; pfVar1[1] = fStack_2c; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); in_ECX[0x13] = in_ECX[0x13] + 0x18; } local_20 = local_4c.x + local_54; fStack_28 = local_54 - local_4c.x; fStack_24 = local_50 - local_44.x; pfVar1 = (float *)in_ECX[0x13]; fStack_1c = local_44.x + local_50; local_30 = local_54; fStack_2c = local_50; if (pfVar1 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar1,&local_30); } else { *pfVar1 = local_54; pfVar1[1] = local_50; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); in_ECX[0x13] = in_ECX[0x13] + 0x18; } local_20 = local_58 - fVar8; pfVar1 = (float *)in_ECX[0x13]; fStack_1c = local_5c - fVar9; fStack_28 = fVar8 + local_58; local_30 = local_58; fStack_24 = fVar9 + local_5c; fStack_2c = local_5c; if (pfVar1 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar1,&local_30); } else { *pfVar1 = local_58; pfVar1[1] = local_5c; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); in_ECX[0x13] = in_ECX[0x13] + 0x18; } fVar7 = fVar7 * 0.5; pfVar1 = (float *)in_ECX[0x13]; fVar6 = fVar6 * 0.5; local_20 = local_38.x - fVar7; fStack_28 = fVar7 + local_38.x; fStack_1c = local_74 - fVar6; fStack_24 = local_74 + fVar6; local_30 = local_38.x; fStack_2c = local_74; if (pfVar1 == (float *)in_ECX[0x14]) { vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar1,&local_30); } else { *pfVar1 = local_38.x; pfVar1[1] = local_74; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); in_ECX[0x13] = in_ECX[0x13] + 0x18; } local_44.x = -local_7c; local_44.y = -local_78; pVVar3 = Entity_Laser::calc_end_point((Entity_Laser *)*in_ECX,&local_4c,&local_38,&local_44); fVar4 = pVVar3->x; in_ECX[3] = fVar4; fVar5 = pVVar3->y; in_ECX[4] = fVar5; fVar6 = sqrtf((fVar5 - local_74) * (fVar5 - local_74) + (fVar4 - local_38.x) * (fVar4 - local_38.x)); if ((local_3c != 0.0) && (local_3c < fVar6)) { fVar4 = local_38.x - local_7c * local_3c; fVar5 = local_74 - local_78 * local_3c; in_ECX[3] = fVar4; in_ECX[4] = fVar5; fVar6 = local_3c; } pfVar1 = (float *)in_ECX[0x13]; fStack_28 = local_7c * fVar6 * 0.5; fStack_24 = local_78 * fVar6 * 0.5; local_20 = fVar4 - fStack_28; fStack_28 = fStack_28 + fVar4; fStack_1c = fVar5 - fStack_24; fStack_24 = fStack_24 + fVar5; if (pfVar1 == (float *)in_ECX[0x14]) { local_30 = fVar4; fStack_2c = fVar5; vector_LaserSample_emplace_reallocate(in_ECX + 0x12,pfVar1,&local_30); return; } *pfVar1 = fVar4; pfVar1[1] = fVar5; pfVar1[2] = fStack_28; pfVar1[3] = fStack_24; *(ulonglong *)(pfVar1 + 4) = CONCAT44(fStack_1c,local_20); in_ECX[0x13] = in_ECX[0x13] + 0x18; return; } //@@ 009a0520 HomingLaser::clip_samples_to_grid /* DB: (pos, gridCollision): unless mode 0/3, walks the sample offsets (+0x1c vector) converting pos+offset to a room grid index (40px cells, origin 40/120), Room::GetGridCollision + FUN_0070be60 test; on a hit erases the remaining samples (std::vector::erase) and refines the last one with Room::check_line_collision; returns 1 when clipped; Entity_Laser::update_laser, UpdateHits */ undefined4 HomingLaser::clip_samples_to_grid(float *param_1,int param_2) { float *pfVar1; float fVar2; char cVar3; float in_ECX; int iVar4; uint uVar5; int iVar6; float fVar7; Room *local_24; float local_20; float local_1c; float local_18; float local_14; float local_10; float local_c; if ((param_2 != 3) && (param_2 != 0)) { iVar6 = *(int *)((int)in_ECX + 0x20); pfVar1 = (float *)((int)in_ECX + 0x1c); local_14 = *pfVar1; uVar5 = 0; if (iVar6 - (int)local_14 >> 3 != 0) { local_24 = g_game->_room; local_1c = in_ECX; do { fVar7 = ((*param_1 + *(float *)((int)local_14 + uVar5 * 8)) - 40.0) / 40.0 + 0.5; iVar4 = (int)fVar7; if ((((iVar4 < 0) || (local_24->_gridWidth <= iVar4)) || (iVar4 = (int)(((param_1[1] + *(float *)((int)local_14 + 4 + uVar5 * 8)) - 120.0) / 40.0 + 0.5), iVar4 < 0)) || (local_24->_gridHeight <= iVar4)) { iVar4 = -1; } else { iVar4 = local_24->_gridWidth * iVar4 + (int)fVar7; } Room::GetGridCollision(local_24,iVar4); cVar3 = FUN_0070be60(); fVar7 = local_1c; if (cVar3 != '\0') { if (uVar5 < 2) { if (2 < (uint)(iVar6 - (int)local_14 >> 3)) { std::vector::erase (&local_14,(int)local_14 + 0x10,*(undefined4 *)((int)local_1c + 0x20)); } if (uVar5 == 0) { return 1; } } else { std::vector::erase (&local_14,(int)local_14 + uVar5 * 8,*(undefined4 *)((int)local_1c + 0x20)); } fVar2 = *pfVar1; uVar5 = *(int *)((int)in_ECX + 0x20) - (int)fVar2 >> 3; if (1 < uVar5) { local_18 = 0.0; local_1c = 0.0; local_24 = (Room *)(*param_1 + *(float *)((int)fVar2 + -8 + uVar5 * 8)); local_14 = param_1[1]; local_20 = local_14 + *(float *)((int)fVar2 + -4 + uVar5 * 8); local_10 = *param_1 + *(float *)((int)fVar2 + -0x10 + uVar5 * 8); local_c = local_14 + *(float *)((int)fVar2 + -0xc + uVar5 * 8); Room::check_line_collision(&local_10,&local_24,param_2,1,fVar2,&local_1c); iVar6 = *(int *)((int)fVar7 + 0x20); *(float *)(iVar6 + -8) = local_1c - *param_1; *(float *)(iVar6 + -4) = local_18 - local_14; } return 1; } iVar6 = *(int *)((int)in_ECX + 0x20); uVar5 = uVar5 + 1; local_14 = *pfVar1; } while (uVar5 < (uint)(iVar6 - (int)local_14 >> 3)); } } return 0; } //@@ 009a0740 HomingLaser::truncate_samples_at_player /* DB: from sample 2 on, cuts _samples at the first point within 10 px (dist^2 < 100) of any player; Entity_Laser::update_laser */ void HomingLaser::truncate_samples_at_player(void) { int *piVar1; int in_ECX; void *pvVar2; int iVar3; Game *pGVar4; uint uVar5; PlayerManager *pPVar6; uint uVar7; float fVar8; float fVar9; uVar5 = 2; iVar3 = *(int *)(in_ECX + 0x1c); if ((uint)(*(int *)(in_ECX + 0x20) - iVar3 >> 3) < 3) { return; } pGVar4 = g_game; do { pPVar6 = &pGVar4->_playerManager; uVar7 = 0; if ((int)(pGVar4->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2 != 0 ) { do { pvVar2 = (pPVar6->_playerList)._end; if ((int)pvVar2 - (int)(pPVar6->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar2 = (pPVar6->_playerList)._end; pGVar4 = g_game; } piVar1 = (pPVar6->_playerList)._begin; if (uVar7 < (uint)((int)pvVar2 - (int)piVar1 >> 2)) { piVar1 = piVar1 + uVar7; } iVar3 = *(int *)(in_ECX + 0x1c); fVar8 = *(float *)(*piVar1 + 0x33c) - *(float *)(iVar3 + uVar5 * 8); fVar9 = *(float *)(*piVar1 + 0x340) - *(float *)(iVar3 + 4 + uVar5 * 8); if (fVar9 * fVar9 + fVar8 * fVar8 < 100.0) { iVar3 = iVar3 + uVar5 * 8; if (iVar3 == *(int *)(in_ECX + 0x20)) { return; } *(int *)(in_ECX + 0x20) = iVar3; return; } pPVar6 = &pGVar4->_playerManager; uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(pGVar4->_playerManager)._playerList._end - (int)(pPVar6->_playerList)._begin >> 2)); } uVar5 = uVar5 + 1; if ((uint)(*(int *)(in_ECX + 0x20) - iVar3 >> 3) <= uVar5) { return; } } while( true ); } //@@ 009a0850 HomingLaser::build_ring_bezier /* DB: (center, mode, radius): 6 bezier segments around a circle (angles k/6*2pi) pushed into _bezier (0x48/0x4c); Entity_Laser::UpdateHits calls it with the laser pos and laser+0x3bc radius (Tech X ring) */ void HomingLaser::build_ring_bezier(float *param_1,int param_2,Entity *param_3) { void *_Dst; Entity *this; bool bVar1; byte bVar2; float *pfVar3; int in_ECX; void *pvVar4; uint size; int *piVar5; int iVar6; undefined4 *puVar7; float fVar8; float in_XMM2_Da; float local_60; float fStack_5c; float fStack_58; void *pvStack_54; undefined4 *local_50; undefined4 *puStack_4c; int *local_48; Vector local_44; undefined4 *local_3c; float local_38; void *local_34; int local_30; void *local_2c; float local_28; char local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0da0d; local_1c = ExceptionList; ExceptionList = &local_1c; local_2c = (void *)(in_XMM2_Da * 0.3466); piVar5 = (int *)(in_ECX + 0x48); iVar6 = 0; local_48 = piVar5; local_3c = (undefined4 *)in_XMM2_Da; local_30 = in_ECX; do { fVar8 = ((float)iVar6 / 6.0) * 3.1415927; local_34 = (void *)(0.0 - (fVar8 + fVar8)); fVar8 = sin((float)local_34); local_38 = fVar8 * (float)local_3c; fVar8 = cos((float)local_34); local_60 = fVar8 * (float)local_3c + *param_1; fStack_5c = local_38 + param_1[1]; local_34 = (void *)((float)local_34 - 1.5707964); local_38 = fStack_5c; local_28 = local_60; fVar8 = sin((float)local_34); local_44.y = fVar8 * (float)local_2c; fVar8 = cos((float)local_34); fStack_58 = local_28 - fVar8 * (float)local_2c; local_50 = (undefined4 *)(fVar8 * (float)local_2c + local_28); pfVar3 = *(float **)(local_30 + 0x4c); pvStack_54 = (void *)(local_38 - local_44.y); puStack_4c = (undefined4 *)(local_44.y + local_38); if (pfVar3 == *(float **)(local_30 + 0x50)) { vector_LaserSample_emplace_reallocate(piVar5,pfVar3,&local_60); } else { *pfVar3 = local_60; pfVar3[1] = fStack_5c; pfVar3[2] = fStack_58; pfVar3[3] = (float)pvStack_54; *(ulonglong *)(pfVar3 + 4) = CONCAT44(puStack_4c,local_50); *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + 0x18; } iVar6 = iVar6 + 1; } while (iVar6 < 7); if (param_2 == 1) { puVar7 = (undefined4 *)0x0; local_34 = (void *)0x0; pvStack_54 = (void *)0x0; local_50 = (undefined4 *)0x0; local_3c = (undefined4 *)0x0; puStack_4c = (undefined4 *)0x0; local_14 = 0; local_38 = 0.0; local_2c = g_game->_room; if (*(int *)((int)local_2c + 0x1264) != 0) { do { this = *(Entity **)(*(int *)((int)local_2c + 0x125c) + (int)local_38 * 4); local_44.y = (float)this; bVar2 = Entity::IsVulnerableEnemy(this,(Entity *)0x0); if (((bVar2 == 0) || ((this->_flags & 0x20000010) != 0)) || (local_21 = '\x01', this == param_3)) { local_21 = '\0'; } if (((*(int *)&g_game->_deathmatchManager < 2) || (this->_type != 3)) || ((this->_variant != 0x43 || (bVar2 = Entity::IsDescendantOf(this,(Entity *)param_3->_spawnerEntity), bVar2 != 0)))) { bVar1 = false; } else { bVar1 = true; } if ((local_21 != '\0') || (bVar1)) { if (puVar7 == local_3c) { std::vector::_Emplace_reallocate(puVar7,&local_44.y); local_3c = puStack_4c; puVar7 = local_50; } else { *puVar7 = this; local_50 = puVar7 + 1; puVar7 = local_50; } } local_38 = (float)((int)local_38 + 1); } while ((uint)local_38 < *(uint *)((int)local_2c + 0x1264)); local_34 = pvStack_54; piVar5 = local_48; } local_38 = -NAN; local_2c = (void *)0x1; pvStack_54 = local_34; if (1 < (piVar5[1] - *piVar5) / 0x18 - 1U) { local_28 = 3.36312e-44; do { piVar5 = (int *)0x0; local_48 = (int *)((int)puVar7 - (int)local_34 >> 2); if (local_48 != (int *)0x0) { do { iVar6 = *(int *)((int)local_34 + (int)piVar5 * 4); local_44.x = *(float *)(iVar6 + 0x33c); local_44.y = *(float *)(iVar6 + 0x340); pvVar4 = (void *)((int)local_28 + *(int *)(local_30 + 0x48)); fVar8 = bezier_closest_point(&local_44,pvVar4,(void *)((int)pvVar4 + 0x18),(float *)0x0) ; if (fVar8 < *(float *)(local_30 + 0x14) * *(float *)(local_30 + 0x14)) { pfVar3 = (float *)(*(int *)(local_30 + 0x48) + (int)local_28); *pfVar3 = local_44.x; pfVar3[1] = local_44.y; _Dst = (void *)((int)local_34 + (int)piVar5 * 4); pvVar4 = (void *)((int)_Dst + 4); memmove(_Dst,pvVar4,(int)puVar7 - (int)pvVar4); puVar7 = puVar7 + -1; if (local_38 == -NAN) { local_38 = (float)local_2c; } local_50 = puVar7; goto LAB_009a0b64; } piVar5 = (int *)((int)piVar5 + 1); } while (piVar5 < local_48); } LAB_009a0b64: local_2c = (void *)((int)local_2c + 1); local_28 = (float)((int)local_28 + 0x18); } while (local_2c < (*(int *)(local_30 + 0x4c) - *(int *)(local_30 + 0x48)) / 0x18 - 1U); if (-1 < (int)local_38) { compute_bezier_handles(); } } if (local_34 != (void *)0x0) { size = (int)local_3c - (int)local_34 & 0xfffffffc; pvVar4 = local_34; if (0xfff < size) { pvVar4 = *(void **)((int)local_34 + -4); size = size + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,size); } } ExceptionList = local_1c; return; } //@@ 009a0c50 HomingLaser::truncate_samples_at_obstacle /* DB: ? per segment Entity_Laser::CalculateEndPoint(start, dir, param_1, 0, 20.0f) and cuts _samples at the first blocked segment; Entity_Laser::update_laser */ void HomingLaser::truncate_samples_at_obstacle(Vector *param_1) { float fVar1; float fVar2; int iVar3; int in_ECX; uint uVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; Vector local_20; Vector local_18; Vector local_10; iVar3 = *(int *)(in_ECX + 0x1c); if ((iVar3 != *(int *)(in_ECX + 0x20)) && (uVar4 = 1, 1 < (*(int *)(in_ECX + 0x20) - iVar3 >> 3) - 1U)) { while( true ) { fVar1 = *(float *)(iVar3 + uVar4 * 8); fVar9 = *(float *)(iVar3 + 8 + uVar4 * 8); fVar2 = *(float *)(iVar3 + 4 + uVar4 * 8); fVar8 = *(float *)(iVar3 + 0xc + uVar4 * 8); fVar7 = fVar9 - fVar1; fVar6 = fVar8 - fVar2; local_20.x = fVar7; local_20.y = fVar6; local_18.x = fVar1; local_18.y = fVar2; fVar5 = sqrtf(fVar6 * fVar6 + fVar7 * fVar7); if (0.0 < fVar5) { local_20.x = fVar7 * (1.0 / fVar5); local_20.y = fVar6 * (1.0 / fVar5); } Entity_Laser::CalculateEndPoint(&local_10,&local_18,&local_20,param_1,(Entity *)0x0,20.0); fVar8 = fVar2 - fVar8; fVar9 = fVar1 - fVar9; if ((fVar2 - local_10.y) * (fVar2 - local_10.y) + (fVar1 - local_10.x) * (fVar1 - local_10.x) < fVar8 * fVar8 + fVar9 * fVar9) break; uVar4 = uVar4 + 1; iVar3 = *(int *)(in_ECX + 0x1c); if ((*(int *)(in_ECX + 0x20) - iVar3 >> 3) - 1U <= uVar4) { return; } } iVar3 = *(int *)(in_ECX + 0x1c); *(float *)(iVar3 + uVar4 * 8) = local_10.x; *(float *)(iVar3 + 4 + uVar4 * 8) = local_10.y; iVar3 = iVar3 + uVar4 * 8 + 8; if (iVar3 != *(int *)(in_ECX + 0x20)) { *(int *)(in_ECX + 0x20) = iVar3; } } return; } //@@ 009a0de0 HomingLaser::remove_collinear_samples /* DB: ECX = Entity_Laser+0x464 (_homingLaser): copies samples (+0x1c vector), then drops each point whose in/out directions dot within XMM1 tolerance of 1; Entity_Laser::update_laser/UpdateHits */ void HomingLaser::remove_collinear_samples(void) { int *piVar1; float *pfVar2; int iVar3; int in_ECX; float *pfVar4; uint uVar5; float fVar6; float in_XMM1_Da; float fVar7; float fVar8; float local_28; float local_24; uint local_20; piVar1 = (int *)(in_ECX + 0x1c); if ((int *)(in_ECX + 0x28) != piVar1) { std::vector::assign(*piVar1,*(undefined4 *)(in_ECX + 0x20),in_ECX); } iVar3 = *(int *)(in_ECX + 0x20) - *piVar1 >> 3; if (iVar3 != 0) { local_20 = iVar3 - 1; uVar5 = 1; if (1 < local_20) { do { iVar3 = *piVar1; local_28 = *(float *)(iVar3 + uVar5 * 8) - *(float *)(iVar3 + -8 + uVar5 * 8); local_24 = *(float *)(iVar3 + 4 + uVar5 * 8) - *(float *)(iVar3 + -4 + uVar5 * 8); fVar6 = sqrtf(local_28 * local_28 + local_24 * local_24); if (0.0 < fVar6) { local_28 = local_28 * (1.0 / fVar6); local_24 = local_24 * (1.0 / fVar6); } iVar3 = iVar3 + uVar5 * 8; pfVar4 = (float *)(iVar3 + 8); fVar7 = *pfVar4 - *(float *)(*piVar1 + uVar5 * 8); fVar8 = *(float *)(iVar3 + 0xc) - *(float *)(*piVar1 + 4 + uVar5 * 8); fVar6 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (0.0 < fVar6) { fVar7 = fVar7 * (1.0 / fVar6); fVar8 = fVar8 * (1.0 / fVar6); } if (ABS(1.0 - (local_28 * fVar7 + local_24 * fVar8)) < in_XMM1_Da) { pfVar2 = *(float **)(in_ECX + 0x20); for (; pfVar4 != pfVar2; pfVar4 = pfVar4 + 2) { pfVar4[-2] = *pfVar4; pfVar4[-1] = pfVar4[1]; } uVar5 = uVar5 - 1; *(float **)(in_ECX + 0x20) = pfVar2 + -2; local_20 = local_20 - 1; } uVar5 = uVar5 + 1; } while (uVar5 < local_20); } } return; } //@@ 009a0fa0 HomingLaser::apply_sample_wiggle /* DB: ? this=HomingLaser: _samples (0x1c/0x20) offset along their direction by sin(k*2pi/n - frame*0.16)*10 when _unkInt (0x40)==1, else by _unkFloat2/500; called from Entity_Laser::update_laser after get_tear_trinket_multiplier(0x1e) */ void HomingLaser::apply_sample_wiggle(void) { int iVar1; int iVar2; int in_ECX; int iVar3; float *pfVar4; float fVar5; float in_XMM1_Da; float fVar6; float fVar7; float in_XMM2_Da; float local_28; float local_24; float local_20; iVar1 = *(int *)(in_ECX + 0x1c); if (iVar1 != *(int *)(in_ECX + 0x20)) { iVar2 = *(int *)(in_ECX + 0x20) - iVar1 >> 3; if (*(int *)(in_ECX + 0x40) == 1) { local_20 = 0.0; if (iVar2 != 0) { do { local_28 = *(float *)(iVar1 + (int)local_20 * 8) - *(float *)(in_ECX + 4); fVar6 = *(float *)(iVar1 + 4 + (int)local_20 * 8); local_24 = fVar6 - *(float *)(in_ECX + 8); fVar5 = sqrtf(local_28 * local_28 + local_24 * local_24); if (0.0 < fVar5) { local_28 = local_28 * (1.0 / fVar5); local_24 = local_24 * (1.0 / fVar5); } iVar2 = (*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3) + -1; fVar5 = sin(((float)((double)(int)local_20 + __uint_to_double_fixup[-((int)local_20 >> 0x1f)]) * 25.132742) / (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) - (float)g_game->_frameCount * 0.16); *(float *)(iVar1 + (int)local_20 * 8) = local_28 * fVar5 * 10.0 * in_XMM1_Da + *(float *)(iVar1 + (int)local_20 * 8); *(float *)(iVar1 + 4 + (int)local_20 * 8) = local_24 * fVar5 * 10.0 * in_XMM1_Da + fVar6; local_20 = (float)((int)local_20 + 1); } while ((uint)local_20 < (uint)(*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3)); return; } } else { fVar6 = *(float *)(in_ECX + 0x44) / 500.0; local_24 = 2.8026e-45; if (fVar6 <= 0.0) { fVar6 = 0.0; } if (1.0 <= fVar6) { fVar6 = 1.0; } iVar3 = (int)(15.0 - fVar6 * 11.0); if (2 < iVar2 - 3U) { pfVar4 = (float *)(iVar1 + 0x14); do { fVar7 = pfVar4[1] - pfVar4[-1]; fVar6 = *pfVar4; local_20 = pfVar4[2] - fVar6; fVar5 = sqrtf(fVar7 * fVar7 + local_20 * local_20); if (0.0 < fVar5) { fVar7 = fVar7 * (1.0 / fVar5); local_20 = local_20 * (1.0 / fVar5); } fVar5 = sin((float)g_game->_frameCount * 0.1 + in_XMM2_Da); fVar5 = fVar5 * 20.0 * in_XMM1_Da; if ((int)local_24 % (iVar3 * 2) < iVar3) { fVar5 = -fVar5; } local_24 = (float)((int)local_24 + 1); pfVar4[-1] = local_20 * fVar5 + pfVar4[-1]; *pfVar4 = -fVar7 * fVar5 + fVar6; pfVar4 = pfVar4 + 2; } while ((uint)local_24 < (*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3) - 3U); } } } return; } //@@ 009a12b0 HomingLaser::find_targets /* DB: ? this=HomingLaser (_samples +0x1c/+0x20), args (pos, dir, ..., flag): EntityList::QuerySublist, Entity::IsDescendantOf/GetPlayerAncestor, bezier_closest_point 0099c340; called from Entity_Laser::update_laser */ undefined4 HomingLaser::find_targets(float *param_1,float *param_2,int param_3,uint param_4,Entity *param_5) { float *pfVar1; Entity *this; int iVar2; int iVar3; qword qVar4; byte bVar5; uint uVar6; Entity *ancestor; int in_ECX; uint uVar7; uint uVar8; qword *pqVar9; void *pvVar10; undefined4 uVar11; float in_XMM0_Da; float fVar12; float fVar13; float fVar14; EntityList_EL local_34; undefined4 local_24; undefined4 local_20; float local_1c; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0da3d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; if (*(int *)(in_ECX + 0x1c) == *(int *)(in_ECX + 0x20)) { return 0; } ExceptionList = &local_10; local_18 = in_ECX; EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&local_34,param_3,param_4,-1,0,0); local_8 = 0; param_4 = 1; if (1 < (*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3) - 1U) { uVar7 = local_34._size; pvVar10 = local_34._data; do { uVar8 = 0; if (uVar7 != 0) { do { if (param_5 == (Entity *)0x0) { LAB_009a1371: iVar2 = *(int *)(in_ECX + 0x1c); iVar3 = *(int *)((int)local_34._data + uVar8 * 4); local_24 = *(undefined4 *)(iVar3 + 0x33c); local_20 = *(undefined4 *)(iVar3 + 0x340); segment_project_point(iVar2 + param_4 * 8 + 8,&local_1c,uVar6); if (in_XMM0_Da < *(float *)(iVar3 + 0x370) * *(float *)(iVar3 + 0x370)) { fVar13 = *(float *)(iVar2 + 8 + param_4 * 8) - *(float *)(iVar2 + param_4 * 8); fVar14 = *(float *)(iVar2 + 0xc + param_4 * 8) - *(float *)(iVar2 + 4 + param_4 * 8); fVar12 = sqrtf(fVar13 * fVar13 + fVar14 * fVar14); if (0.0 < fVar12) { fVar13 = fVar13 * (1.0 / fVar12); fVar14 = fVar14 * (1.0 / fVar12); } pfVar1 = (float *)(iVar2 + (param_4 + 1) * 8); param_2[1] = fVar14; *param_2 = fVar13; fVar12 = *(float *)(iVar2 + param_4 * 8); fVar13 = *(float *)(iVar2 + 4 + param_4 * 8); fVar14 = pfVar1[1]; fVar12 = fVar12 + (*pfVar1 - fVar12) * local_1c; *param_1 = fVar12; param_1[1] = fVar13 + (fVar14 - fVar13) * local_1c; *pfVar1 = fVar12; pfVar1[1] = param_1[1]; if (pfVar1 != *(float **)(local_18 + 0x20)) { *(float **)(local_18 + 0x20) = pfVar1; } uVar11 = *(undefined4 *)((int)local_34._data + uVar8 * 4); goto LAB_009a13e5; } pvVar10 = local_34._data; } else { this = *(Entity **)((int)pvVar10 + uVar8 * 4); ancestor = Entity::GetPlayerAncestor(param_5); bVar5 = Entity::IsDescendantOf(this,ancestor); if (bVar5 == 0) { in_ECX = local_18; goto LAB_009a1371; } } uVar8 = uVar8 + 1; uVar7 = local_34._size; in_ECX = local_18; } while (uVar8 < (uint)local_34._size); } param_4 = param_4 + 1; } while (param_4 < (*(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x1c) >> 3) - 1U); } uVar11 = 0; LAB_009a13e5: if (local_34._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } if (local_34._data != (void *)0x0) { uVar6 = *(uint *)((int)local_34._data + -4); qVar4 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar6; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar4 < uVar6); free((void *)((int)local_34._data + -4)); } } ExceptionList = local_10; return uVar11; } //@@ 009a1520 HomingLaser::truncate_samples /* DB: walks _samples (+0x1c/+0x20, Vector) accumulating segment length; cuts the path at max length (XMM1 arg) with an interpolated end point; Entity_Laser::update_laser */ uint HomingLaser::truncate_samples(void) { float fVar1; float *pfVar2; float *extraout_EAX; float *pfVar3; int in_ECX; int iVar4; uint uVar5; float fVar6; float in_XMM1_Da; float fVar7; float fVar8; float local_1c; pfVar3 = *(float **)(in_ECX + 0x1c); if (pfVar3 != *(float **)(in_ECX + 0x20)) { uVar5 = 0; iVar4 = (int)*(float **)(in_ECX + 0x20) - (int)pfVar3 >> 3; if (iVar4 != 1) { pfVar2 = pfVar3; local_1c = in_XMM1_Da; do { fVar1 = pfVar2[1]; fVar7 = pfVar2[3] - fVar1; fVar8 = pfVar2[2] - *pfVar2; fVar6 = sqrtf(fVar7 * fVar7 + fVar8 * fVar8); if (local_1c <= fVar6) { iVar4 = *(int *)(in_ECX + 0x1c) + uVar5 * 8; pfVar3 = (float *)(iVar4 + 8); *pfVar3 = (fVar8 * local_1c) / fVar6 + *pfVar2; *(float *)(iVar4 + 0xc) = (fVar7 * local_1c) / fVar6 + fVar1; if (pfVar3 != *(float **)(in_ECX + 0x20)) { *(float **)(in_ECX + 0x20) = pfVar3; } return CONCAT31((int3)((uint)pfVar3 >> 8),1); } local_1c = local_1c - fVar6; uVar5 = uVar5 + 1; pfVar3 = extraout_EAX; pfVar2 = pfVar2 + 2; } while (uVar5 < iVar4 - 1U); } } return (uint)pfVar3 & 0xffffff00; } //@@ 009a1610 vector_LaserSample_erase /* DB: std::vector<0x18-byte element>::erase(iter): shifts the following 6-dword elements down, end -= 0x18, returns iter; same element type as vector_LaserSample_emplace_reallocate 009a17b0; HomingLaser::build_bezier_path/build_wiggle_bezier */ void vector_LaserSample_erase(int *param_1,int param_2) { undefined4 *puVar1; int in_ECX; undefined4 *puVar2; undefined4 *puVar3; undefined4 *puVar4; puVar1 = *(undefined4 **)(in_ECX + 4); puVar4 = (undefined4 *)(param_2 + 0x18); if (puVar4 != puVar1) { puVar2 = (undefined4 *)(param_2 + 0x14); puVar3 = (undefined4 *)(param_2 + 0x2c); do { puVar2[-5] = *puVar4; puVar4 = puVar4 + 6; puVar2[-4] = puVar3[-4]; puVar2[-3] = puVar3[-3]; puVar2[-2] = puVar3[-2]; puVar2[-1] = puVar3[-1]; *puVar2 = *puVar3; puVar2 = puVar2 + 6; puVar3 = puVar3 + 6; } while (puVar4 != puVar1); } *(undefined4 **)(in_ECX + 4) = puVar1 + -6; *param_1 = param_2; return; } //@@ 009a1680 std::vector::insert /* DB: 0x18-byte element insert at position (shift up), falls back to vector_LaserSample_emplace_reallocate when full; HomingLaser::build_bezier_path */ undefined4 * std::vector::insert(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined8 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; void *pvVar6; void *in_ECX; undefined4 *puVar7; undefined4 *puVar8; undefined4 *puVar9; undefined4 local_c; undefined4 uStack_8; puVar8 = *(undefined4 **)((int)in_ECX + 4); if (puVar8 == *(undefined4 **)((int)in_ECX + 8)) { pvVar6 = vector_LaserSample_emplace_reallocate(in_ECX,param_2,param_3); *param_1 = pvVar6; return param_1; } uVar2 = *param_3; uVar3 = param_3[1]; uVar4 = param_3[2]; uVar5 = param_3[3]; if (param_2 == puVar8) { *puVar8 = uVar2; puVar8[1] = uVar3; puVar8[2] = uVar4; puVar8[3] = uVar5; *(undefined8 *)(puVar8 + 4) = *(undefined8 *)(param_3 + 4); *(int *)((int)in_ECX + 4) = *(int *)((int)in_ECX + 4) + 0x18; *param_1 = param_2; return param_1; } uVar1 = *(undefined8 *)(param_3 + 4); puVar9 = puVar8 + -6; *puVar8 = *puVar9; puVar8[1] = puVar8[-5]; puVar8[2] = puVar8[-4]; puVar8[3] = puVar8[-3]; *(undefined8 *)(puVar8 + 4) = *(undefined8 *)(puVar8 + -2); *(int *)((int)in_ECX + 4) = *(int *)((int)in_ECX + 4) + 0x18; if (puVar9 != param_2) { puVar7 = puVar8 + 5; puVar8 = puVar8 + -7; do { puVar7[-0xb] = puVar8[-5]; puVar9 = puVar9 + -6; puVar7[-10] = puVar8[-4]; puVar7[-9] = puVar8[-3]; puVar7[-8] = puVar8[-2]; puVar7[-7] = puVar8[-1]; puVar7[-6] = *puVar8; puVar7 = puVar7 + -6; puVar8 = puVar8 + -6; } while (puVar9 != param_2); } *param_2 = uVar2; param_2[1] = uVar3; param_2[2] = uVar4; param_2[3] = uVar5; local_c = (undefined4)uVar1; param_2[4] = local_c; uStack_8 = (undefined4)((ulonglong)uVar1 >> 0x20); param_2[5] = uStack_8; *param_1 = param_2; return param_1; } //@@ 009a1770 FUN_009a1770 void FUN_009a1770(undefined4 *param_1) { undefined4 *where; undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; void *in_ECX; where = *(undefined4 **)((int)in_ECX + 4); if (where == *(undefined4 **)((int)in_ECX + 8)) { vector_LaserSample_emplace_reallocate(in_ECX,where,param_1); return; } uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *where = *param_1; where[1] = uVar1; where[2] = uVar2; where[3] = uVar3; *(undefined8 *)(where + 4) = *(undefined8 *)(param_1 + 4); *(int *)((int)in_ECX + 4) = *(int *)((int)in_ECX + 4) + 0x18; return; } //@@ 009a17b0 vector_LaserSample_emplace_reallocate /* DB: ? std::vector<0x18-byte element>::_Emplace_reallocate (max 0xaaaaaaa, copies 6 dwords of param_2); callers HomingLaser::build_bezier_path/build_ring_bezier/laser_sample_trace_entities, so the element is a laser sample point prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall vector_LaserSample_emplace_reallocate(void *this,void *where,void *value) { FileSymbolInfo *pFVar1; uint uVar2; int iVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; FileSymbolInfo *pFVar8; uint uVar9; iVar3 = *(int *)this; iVar4 = (*(int *)((int)this + 4) - iVar3) / 0x18; if (iVar4 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (*(int *)((int)this + 8) - iVar3) / 0x18; if (0xaaaaaaa - (uVar2 >> 1) < uVar2) { uVar9 = 0xaaaaaaa; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar9 = iVar4 + 1U; if (iVar4 + 1U <= uVar2) { uVar9 = uVar2; } if (0xaaaaaaa < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pFVar8 = std::_Allocate(uVar9 * 0x18); pFVar1 = pFVar8 + (((int)where - iVar3) / 0x18) * 0x18; uVar5 = *(undefined4 *)((int)value + 4); uVar6 = *(undefined4 *)((int)value + 8); uVar7 = *(undefined4 *)((int)value + 0xc); *(undefined4 *)pFVar1 = *(undefined4 *)value; *(undefined4 *)(pFVar1 + 4) = uVar5; *(undefined4 *)(pFVar1 + 8) = uVar6; *(undefined4 *)(pFVar1 + 0xc) = uVar7; *(undefined8 *)(pFVar1 + 0x10) = *(undefined8 *)((int)value + 0x10); if (where == *(void **)((int)this + 4)) { FUN_009a1940(*(undefined4 *)this,*(void **)((int)this + 4),pFVar8); } else { FUN_005cc6e0(*(undefined4 *)this,where,pFVar8); FUN_005cc6e0(where,*(undefined4 *)((int)this + 4),pFVar1 + 0x18); } FID_conflict__Change_array(this,pFVar8,iVar4 + 1,uVar9); return pFVar1; } //@@ 009a18c0 FID_conflict:_Change_array /* Library Function - Multiple Matches With Different Base Names private: void __thiscall std::vector >::_Change_array(struct `protected: int __thiscall GSI1::readHash(unsigned short,long,long)'::`2'::FileSymbolInfo * const,unsigned int,unsigned int) private: void __thiscall std::vector >::_Change_array(struct GSISymbolEntry * const,unsigned int,unsigned int) Library: Visual Studio 2019 Release */ void __thiscall FID_conflict__Change_array(void *this,FileSymbolInfo *param_1,uint param_2,uint param_3) { void *pvVar1; uint size; void *ptr; pvVar1 = *(void **)this; if (pvVar1 != (void *)0x0) { size = ((*(int *)((int)this + 8) - (int)pvVar1) / 0x18) * 0x18; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *(FileSymbolInfo **)this = param_1; *(FileSymbolInfo **)((int)this + 4) = param_1 + param_2 * 0x18; *(FileSymbolInfo **)((int)this + 8) = param_1 + param_3 * 0x18; return; } //@@ 009a1940 FUN_009a1940 void FUN_009a1940(undefined4 *param_1,undefined4 *param_2,int param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; if (param_1 != param_2) { param_3 = param_3 - (int)param_1; do { uVar2 = param_1[1]; uVar3 = param_1[2]; uVar4 = param_1[3]; puVar1 = (undefined4 *)(param_3 + (int)param_1); *puVar1 = *param_1; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; *(undefined8 *)(param_3 + 0x10 + (int)param_1) = *(undefined8 *)(param_1 + 4); param_1 = param_1 + 6; } while (param_1 != param_2); } return; } //@@ 009a1970 FUN_009a1970 void FUN_009a1970(void) { HUD *in_ECX; in_ECX->_isGraphicsLoaded = 0; HUD::LoadGraphics(in_ECX); FUN_009a19a0(); HUD::load_item_info_graphics((HUD *)(in_ECX[1]._playerHUD + 0x28)); return; } //@@ 009a19a0 FUN_009a19a0 void FUN_009a19a0(void) { int in_ECX; int *piVar1; uint uVar2; uVar2 = 0; *(undefined1 **)(in_ECX + 0x5490) = &DAT_bf800000; piVar1 = (int *)(in_ECX + 4); *(undefined4 *)(in_ECX + 0x5494) = 0xffffffff; *(undefined4 *)(in_ECX + 0x5498) = 0xffffffff; *(undefined1 *)(in_ECX + 0x549c) = 0; *(undefined4 *)(in_ECX + 0x54d0) = 2; *(undefined4 *)(in_ECX + 0x54d8) = 2; *(undefined1 *)(in_ECX + 0x54d4) = 0; do { *(short *)(piVar1 + 1) = (short)uVar2; *piVar1 = in_ECX; PlayerHUD::reset((PlayerHUD *)(piVar1 + -1)); uVar2 = uVar2 + 1; piVar1 = piVar1 + 0x1b7; } while (uVar2 < 8); text_image_cache_clear((void *)(in_ECX + 0x5c54)); *(undefined1 *)(in_ECX + 0x54cc) = 1; text_image_cache_reset((void *)(in_ECX + 0x59a4)); return; } //@@ 009a1a30 HUD::LoadGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: loads ui_hearts/hudpickups/chargebar anm2 and fonts prototype: REPENTOGON */ void __thiscall HUD::LoadGraphics(HUD *this) { char isLastRef; byte isAnimSet; byte *extraout_EAX; byte *extraout_EAX_00; byte *redirectedPathChars; void *pvVar1; KColor *clearColor; char *freeBlock; uint allocatedBytes; int remaining; undefined4 local_ac [8]; undefined4 local_8c; undefined4 uStack_88; undefined4 local_84; HUD *hud; undefined1 tmpImage2 [4]; int *tmpImage2Ref; undefined1 tmpImage [4]; int *tmpImageRef; void *redirectedFontPath [4]; uint redirectedFontPathSize; uint redirectedFontPathCapacity; std_string path; undefined1 tmpPath [16]; uint tmpPathSize; uint tmpPathCapacity; uint stackCookie; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int *coopMenuImage; Manager *manager; HUD *self; ColorMod *statsColor; manager = g_manager; puStack_20 = tmpPath + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00b0db25; local_1c = ExceptionList; stackCookie = __security_cookie ^ (uint)(tmpPath + 0x2c); ExceptionList = &local_1c; if (this->_isGraphicsLoaded == 0) { hud = this; path._buf._0_4_ = std::_Allocate(0x20); path._size = 0x12; path._capacity = 0x1f; builtin_strncpy((char *)path._buf._0_4_,"font/MPlus_12b.fnt",0x13); local_14 = 0; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)tmpPath,&path); local_14._0_1_ = 1; redirectedPathChars = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { redirectedPathChars = *(byte **)extraout_EAX; } Font::Load(&this->_font,redirectedPathChars,0); local_14 = (uint)local_14._1_3_ << 8; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; pvVar1 = (void *)tmpPath._0_4_; if (0xfff < allocatedBytes) { pvVar1 = *(void **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if (0x1f < (uint)(tmpPath._0_4_ + (-4 - (int)pvVar1))) goto LAB_009a1b64; } operator_delete(pvVar1,allocatedBytes); } local_14 = -1; tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath._0_4_ = tmpPath._0_4_ & 0xffffff00; if (0xf < path._capacity) { allocatedBytes = path._capacity + 1; freeBlock = (char *)path._buf._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(path._buf._0_4_ + -4); allocatedBytes = path._capacity + 0x24; if ((char *)0x1f < (char *)(path._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_009a1b64: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } manager = g_manager; path._buf._0_4_ = std::_Allocate(0x20); path._size = 0x12; path._capacity = 0x1f; builtin_strncpy((char *)path._buf._0_4_,"font/KR_Font14.fnt",0x13); local_14 = 2; ModManager::TryRedirectPath(&manager->_modManager,(std_string *)redirectedFontPath,&path); local_14._0_1_ = 3; redirectedPathChars = extraout_EAX_00; if (0xf < *(uint *)(extraout_EAX_00 + 0x14)) { redirectedPathChars = *(byte **)extraout_EAX_00; } Font::Load(&this->_fontKR,redirectedPathChars,0); local_14 = CONCAT31(local_14._1_3_,2); if (0xf < redirectedFontPathCapacity) { allocatedBytes = redirectedFontPathCapacity + 1; pvVar1 = redirectedFontPath[0]; if (0xfff < allocatedBytes) { pvVar1 = *(void **)((int)redirectedFontPath[0] + -4); allocatedBytes = redirectedFontPathCapacity + 0x24; if (0x1f < (uint)((int)redirectedFontPath[0] + (-4 - (int)pvVar1))) goto LAB_009a1c55; } operator_delete(pvVar1,allocatedBytes); } local_14 = 0xffffffff; redirectedFontPathSize = 0; redirectedFontPathCapacity = 0xf; redirectedFontPath[0] = (void *)((uint)redirectedFontPath[0] & 0xffffff00); if (0xf < path._capacity) { allocatedBytes = path._capacity + 1; freeBlock = (char *)path._buf._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(path._buf._0_4_ + -4); allocatedBytes = path._capacity + 0x24; if ((char *)0x1f < (char *)(path._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_009a1c55: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x15; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/ui_hearts.anm2",0x16); local_14 = 4; ANM2::Load(&this->_heartsSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x16; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/hudpickups.anm2",0x17); local_14 = 5; ANM2::Load(&this->_pickupHUDSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x18; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/ui_chargebar.anm2",0x19); local_14 = 6; ANM2::Load(&this->_chargeBarSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x1e; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/ui_chargebar_small.anm2",0x1f); local_14 = 7; ANM2::Load(&this->_chargeBarSmallSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x19; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/ui_cardspills.anm2",0x1a); local_14 = 8; ANM2::Load(&this->_cardsPillsSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x14; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/hudstats.anm2",0x15); local_14 = 9; ANM2::Load(&this->_statsSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } statsColor = &(this->_statsSprite)._color; tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath._0_4_ = tmpPath._0_4_ & 0xffffff00; local_8c = 0; uStack_88 = 0; local_84 = 0; if (statsColor != (ColorMod *)local_ac) { (this->_statsSprite)._color._colorize[0] = 0.0; (this->_statsSprite)._color._colorize[1] = 0.0; (this->_statsSprite)._color._colorize[2] = 0.0; (this->_statsSprite)._color._colorize[3] = 0.0; (this->_statsSprite)._color._offset[0] = 0.0; (this->_statsSprite)._color._offset[1] = 0.0; statsColor->_tint[0] = 1.0; (this->_statsSprite)._color._tint[1] = 1.0; (this->_statsSprite)._color._tint[2] = 1.0; (this->_statsSprite)._color._tint[3] = 0.5; (this->_statsSprite)._color._offset[2] = 0.0; } pvVar1 = Manager::LoadImage(tmpImage,(byte *)"gfx/ui/ui_bosshealthbar.png"); local_14 = 10; KAGE::SmartPointer::operator_assign(&this->field_0x54a0,pvVar1); local_14 = 0xb; if (tmpImageRef != (int *)0x0) { isLastRef = (**(code **)(*tmpImageRef + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage); } } local_14 = 0xffffffff; pvVar1 = Manager::LoadImage(tmpImage2,(byte *)"gfx/ui/ui_bosshealthbar_mini.png"); local_14 = 0xc; KAGE::SmartPointer::operator_assign(&this->field_0x54a8,pvVar1); local_14 = 0xd; if (tmpImage2Ref != (int *)0x0) { isLastRef = (**(code **)(*tmpImage2Ref + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage2); } } local_14 = 0xffffffff; pvVar1 = Manager::LoadImage(tmpImage,(byte *)"gfx/ui/ui_bosshealthbar_static.png"); local_14 = 0xe; KAGE::SmartPointer::operator_assign(&this->field_0x54b0,pvVar1); local_14 = 0xf; if (tmpImageRef != (int *)0x0) { isLastRef = (**(code **)(*tmpImageRef + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage); } } local_14 = 0xffffffff; pvVar1 = Manager::LoadImage(tmpImage2,(byte *)"gfx/ui/ui_bosshealthbar_stone.png"); local_14 = 0x10; KAGE::SmartPointer::operator_assign(&this->field_0x54bc,pvVar1); local_14 = 0x11; if (tmpImage2Ref != (int *)0x0) { isLastRef = (**(code **)(*tmpImage2Ref + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage2); } } local_14 = 0xffffffff; pvVar1 = Manager::LoadImage(tmpImage,(byte *)"gfx/ui/ui_bosshealthbar_rush.png"); local_14 = 0x12; KAGE::SmartPointer::operator_assign(&this->field_0x54c4,pvVar1); local_14 = 0x13; if (tmpImageRef != (int *)0x0) { isLastRef = (**(code **)(*tmpImageRef + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage); } } local_14 = 0xffffffff; tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath[0] = '\0'; tmpPath[1] = '\0'; tmpPath[2] = '\0'; tmpPath[3] = '\0'; tmpPath._0_4_ = std::_Allocate(0x20); tmpPathSize = 0x1b; tmpPathCapacity = 0x1f; builtin_strncpy((char *)tmpPath._0_4_,"gfx/ui/ui_FortunePaper.anm2",0x1c); local_14 = 0x14; ANM2::Load(&this->_fortuneSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; freeBlock = (char *)tmpPath._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if ((char *)0x1f < (char *)(tmpPath._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath._0_4_ = (void *)0x0; std::string::assign(tmpPath,(byte *)"gfx/ui/coop menu.anm2",0x15); local_14 = 0x15; ANM2::Load(&this->_coopMenuSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; pvVar1 = (void *)tmpPath._0_4_; if (0xfff < allocatedBytes) { pvVar1 = *(void **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if (0x1f < (uint)(tmpPath._0_4_ + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,allocatedBytes); } ANM2::Play(&this->_coopMenuSprite,&DAT_00b6767c,0); ANM2::PlayOverlay(&this->_coopMenuSprite,(byte *)"Arrows",0); tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath._0_4_ = (void *)0x0; std::string::assign(tmpPath,(byte *)"gfx/ui/ui_inventory.anm2",0x18); local_14 = 0x16; ANM2::Load(&this->_inventorySprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; pvVar1 = (void *)tmpPath._0_4_; if (0xfff < allocatedBytes) { pvVar1 = *(void **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if (0x1f < (uint)(tmpPath._0_4_ + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,allocatedBytes); } ANM2::Play(&this->_inventorySprite,s_Idle,0); tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath._0_4_ = (void *)0x0; std::string::assign(tmpPath,(byte *)"gfx/ui/ui_crafting.anm2",0x17); local_14 = 0x17; ANM2::Load(&this->_craftingTableSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; pvVar1 = (void *)tmpPath._0_4_; if (0xfff < allocatedBytes) { pvVar1 = *(void **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if (0x1f < (uint)(tmpPath._0_4_ + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,allocatedBytes); } ANM2::Play(&this->_craftingTableSprite,s_Idle,0); tmpPathSize = 0; tmpPathCapacity = 0xf; tmpPath._0_4_ = (void *)0x0; std::string::assign(tmpPath,(byte *)"gfx/ui/ui_poops.anm2",0x14); local_14 = 0x18; ANM2::Load(&this->_poopSpellsSprite,(std_string *)tmpPath,1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; pvVar1 = (void *)tmpPath._0_4_; if (0xfff < allocatedBytes) { pvVar1 = *(void **)(tmpPath._0_4_ + -4); allocatedBytes = tmpPathCapacity + 0x24; if (0x1f < (uint)(tmpPath._0_4_ + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,allocatedBytes); } ANM2::Play(&this->_poopSpellsSprite,s_Idle,0); HUD_Message::load_graphics(); remaining = 6; do { HUD_Message::load_graphics(); remaining = remaining + -1; } while (remaining != 0); remaining = 4; do { HUD_Message::load_graphics(); remaining = remaining + -1; } while (remaining != 0); pvVar1 = Manager::LoadImage(tmpImage2,(byte *)"gfx/Spidermod_Healthbar.png"); self = hud; local_14 = 0x19; KAGE::SmartPointer::operator_assign(&hud->field_0x5488,pvVar1); local_14 = 0x1a; if (tmpImage2Ref != (int *)0x0) { isLastRef = (**(code **)(*tmpImage2Ref + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage2); } } local_14 = 0xffffffff; KColor::SetFromARGB((KColor *)(tmpPath + 4),0); pvVar1 = KAGE_Graphics::create_render_target (tmpImage2,400,0x80,(byte *)"Fortune Text Surface",clearColor); local_14 = 0x1b; shared_ptr::operator_assign(&self->field_0x536c,pvVar1); local_14 = 0x1c; if (tmpImage2Ref != (int *)0x0) { isLastRef = (**(code **)(*tmpImage2Ref + 0xc))(); if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(tmpImage2); } } local_14 = 0xffffffff; pvVar1 = Manager::LoadImage(tmpImage,(byte *)"gfx/ui/coop menu.png"); local_14 = 0x1d; KAGE::SmartPointer::operator_assign(&self->field_0x592c,pvVar1); local_14 = 0x1e; if (tmpImageRef != (int *)0x0) { isLastRef = (**(code **)(*tmpImageRef + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(tmpImage); } } local_14 = 0xffffffff; coopMenuImage = *(int **)&self->field_0x592c; if ((coopMenuImage[0xc] != 1) || (coopMenuImage[0xd] != 1)) { (**(code **)(*coopMenuImage + 0x44))(1,1); coopMenuImage[0xc] = 1; coopMenuImage[0xd] = 1; } path._size = 0; path._capacity = 0xf; path._buf._0_4_ = (char *)0x0; std::string::assign(path._buf,(byte *)"gfx/ui/hudstats2.anm2",0x15); local_14 = 0x1f; ANM2::Load((ANM2 *)&self->_statHUD,&path,1); local_14 = 0xffffffff; if (0xf < path._capacity) { allocatedBytes = path._capacity + 1; freeBlock = (char *)path._buf._0_4_; if (0xfff < allocatedBytes) { freeBlock = *(char **)(path._buf._0_4_ + -4); allocatedBytes = path._capacity + 0x24; if ((char *)0x1f < (char *)(path._buf._0_4_ + (-4 - (int)freeBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,allocatedBytes); } path._size = 0; path._capacity = 0xf; path._buf._0_4_ = path._buf._0_4_ & 0xffffff00; isAnimSet = ANM2::SetAnimation((ANM2 *)&self->_statHUD,s_Idle,1); if ((isAnimSet != 0) && (*(int *)&self->field_0x59d8 != 0)) { AnimationState::SetFrameFloat((AnimationState *)&self->field_0x59d4,0.0); if (*(int *)&self->field_0x59d8 != 0) { self->field_0x59e8 = 0; } } self->_isGraphicsLoaded = 1; } ExceptionList = local_1c; return; } //@@ 009a27d0 HUD::unload_graphics /* DB: counterpart of HUD::LoadGraphics: Font::Unload +0x36e0/+0x372c, ANM2::Reset of all HUD sprites, render targets reset, 6x and 4x text slot arrays; Menu_Options::Update (language/option reload) */ void __thiscall HUD::unload_graphics(HUD *this) { undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined1 *puVar1; HUD *this_00; int iVar2; Font::Unload(&this->_font); Font::Unload(&this->_fontKR); ANM2::Reset(&this->_chargeBarSprite); ANM2::Reset(&this->_chargeBarSmallSprite); ANM2::Reset(&this->_heartsSprite); ANM2::Reset(&this->_pickupHUDSprite); ANM2::Reset(&this->_statsSprite); KAGE::SmartPointer::reset(&this->field_0x54a0,(void *)0x0); KAGE::SmartPointer::reset(&this->field_0x54a8,(void *)0x0); KAGE::SmartPointer::reset(&this->field_0x54b0,(void *)0x0); KAGE::SmartPointer::reset(&this->field_0x54bc,(void *)0x0); KAGE::SmartPointer::reset(&this->field_0x54c4,(void *)0x0); ANM2::Reset(&this->_cardsPillsSprite); ANM2::Reset(&this->_fortuneSprite); ANM2::Reset(&this->_inventorySprite); ANM2::Reset(&this->_craftingTableSprite); ANM2::Reset(&this->_poopSpellsSprite); ANM2::Reset(&this->_coopMenuSprite); HUD_Message::free_text_buffers(&this->_messageMain); ANM2::Reset((ANM2 *)&this->field_0x3cfc); KAGE::SmartPointer::reset(extraout_ECX); this->field_0x3ce4 = 0; puVar1 = &this->field_0x3ee8; iVar2 = 6; do { HUD_Message::free_text_buffers((HUD_Message *)(puVar1 + -0x18)); ANM2::Reset((ANM2 *)(puVar1 + 8)); KAGE::SmartPointer::reset(extraout_ECX_00); *(undefined1 *)(puVar1 + -0x10) = 0; puVar1 = puVar1 + 500; iVar2 = iVar2 + -1; } while (iVar2 != 0); puVar1 = &this->field_0x4aa0; iVar2 = 4; do { HUD_Message::free_text_buffers((HUD_Message *)(puVar1 + -0x18)); ANM2::Reset((ANM2 *)(puVar1 + 8)); KAGE::SmartPointer::reset(extraout_ECX_01); *(undefined1 *)(puVar1 + -0x10) = 0; puVar1 = puVar1 + 500; iVar2 = iVar2 + -1; } while (iVar2 != 0); iVar2 = 8; this_00 = this; do { PlayerHUD::reset((PlayerHUD *)this_00); this_00 = (HUD *)(this_00->_playerHUD + 0x6dc); iVar2 = iVar2 + -1; } while (iVar2 != 0); KAGE::SmartPointer::reset(extraout_ECX_02); KAGE::SmartPointer::reset(&this->field_0x592c,(void *)0x0); this->_isGraphicsLoaded = 0; text_image_cache_clear(&this->_historyHUD); text_image_cache_reset(&this->_statHUD); return; } //@@ 009a2990 HUD::Update /* ZHL [lua] Lua binding HUD:Update prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall HUD::Update(HUD *this) { AnimationState *this_00; byte bVar1; int iVar2; Manager *pMVar3; float Pitch; HUD *local_8; if (this->_isRefreshTick != 0) { this->_hudRefreshCountdown = this->_hudRefreshCountdown + -1; this->_isRefreshTick = 0; if (this->_hudRefreshCountdown < 1) { this->_hudRefreshType = 0; } } if (-1 < this->_bossHPBarDamageFlash) { this->_bossHPBarDamageFlash = this->_bossHPBarDamageFlash + -1; } if (-1 < this->_bossHPBarHealFlash) { this->_bossHPBarHealFlash = this->_bossHPBarHealFlash + -1; } local_8 = this; FUN_00840ce0(); iVar2 = 6; do { FUN_00840ce0(); iVar2 = iVar2 + -1; } while (iVar2 != 0); iVar2 = 4; do { FUN_00840ce0(); iVar2 = iVar2 + -1; } while (iVar2 != 0); this_00 = &(this->_fortuneSprite)._animState; if ((this->_fortuneSprite)._loaded != 0) { AnimationState::Update(this_00); AnimationState::Update(&(this->_fortuneSprite)._overlayAnimState); } if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a; bVar1 = AnimationState::IsEventTriggered(this_00,(byte *)"SlideIn"); pMVar3 = g_manager; if (bVar1 == 0) { LAB_009a2aae: if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a; bVar1 = AnimationState::IsEventTriggered(this_00,(byte *)"SlideOut"); pMVar3 = g_manager; if (((bVar1 == 0) || ((this->_fortuneSprite)._animState._animData == (void *)0x0)) || ((this->_fortuneSprite)._animState._isPlaying == 0)) goto LAB_009a2b1a; local_8 = (HUD *)0xfc; seed_fart_sound_override((int *)&local_8); Pitch = 1.0; } else { if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a; if ((this->_fortuneSprite)._animState._isPlaying == 0) goto LAB_009a2aae; local_8 = (HUD *)0xfc; seed_fart_sound_override((int *)&local_8); Pitch = 1.5; } SoundEffects::Play(&pMVar3->_sfxManager,(int)local_8,0.5,2,0,Pitch,0.0); LAB_009a2b1a: update_item_info(); return; } //@@ 009a2b30 HUD::PostUpdate /* ZHL [exact] __thiscall void HUD::PostUpdate(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall HUD::PostUpdate(HUD *this) { HUD *pHVar1; uint playerIdx; int iVar2; iVar2 = 8; pHVar1 = this; do { if (*(int *)pHVar1->_playerHUD != 0) { PlayerHUD::Update((PlayerHUD *)pHVar1); } pHVar1 = (HUD *)(pHVar1->_playerHUD + 0x6dc); iVar2 = iVar2 + -1; } while (iVar2 != 0); if (0 < (g_manager->_optionsConfig)._historyHudMode) { if (this[1]._playerHUD[0x24] == 0) { this[1]._playerHUD[0x24] = 1; update_player_hud_slots((HUD *)&this->_historyHUD,0); } playerIdx = 0; pHVar1 = this + 1; do { if (pHVar1->_playerHUD[0] != 0) { rebuild_player_item_icons(&this->_historyHUD,playerIdx,1); } playerIdx = playerIdx + 1; pHVar1 = (HUD *)(pHVar1->_playerHUD + 0x14); } while ((int)playerIdx < 2); } FUN_0084c170(); return; } //@@ 009a2bc0 HUD::FlashChargeBar /* ZHL [lua] Lua binding HUD:FlashChargeBar prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall HUD::FlashChargeBar(HUD *this,Entity_Player *player,int activeSlot) { byte *pbVar1; uint uVar2; uVar2 = 0; do { if (*(Entity_Player **)this->_playerHUD == player) { if ((-1 < activeSlot) && ((uint)activeSlot < 4)) { pbVar1 = this->_playerHUD + activeSlot * 0x1c + 0x1a8; pbVar1[0] = 8; pbVar1[1] = 0; pbVar1[2] = 0; pbVar1[3] = 0; } return; } uVar2 = uVar2 + 1; this = (HUD *)(this->_playerHUD + 0x6dc); } while (uVar2 < 8); return; } //@@ 009a2c00 HUD::InvalidateActiveItem /* ZHL [lua] Lua binding HUD:InvalidateActiveItem */ void __thiscall HUD::InvalidateActiveItem(HUD *this,int param_2,int param_3) { byte *pbVar1; uint uVar2; uVar2 = 0; do { if (*(int *)this->_playerHUD == param_2) { if (param_3 < 4) { if (param_3 < 0) { this->_playerHUD[400] = 0; this->_playerHUD[0x191] = 0; this->_playerHUD[0x192] = 0; this->_playerHUD[0x193] = 0; this->_playerHUD[0x1ac] = 0; this->_playerHUD[0x1ad] = 0; this->_playerHUD[0x1ae] = 0; this->_playerHUD[0x1af] = 0; this->_playerHUD[0x1c8] = 0; this->_playerHUD[0x1c9] = 0; this->_playerHUD[0x1ca] = 0; this->_playerHUD[0x1cb] = 0; this->_playerHUD[0x1e4] = 0; this->_playerHUD[0x1e5] = 0; this->_playerHUD[0x1e6] = 0; this->_playerHUD[0x1e7] = 0; return; } pbVar1 = this->_playerHUD + param_3 * 0x1c + 400; pbVar1[0] = 0; pbVar1[1] = 0; pbVar1[2] = 0; pbVar1[3] = 0; } return; } uVar2 = uVar2 + 1; this = (HUD *)(this->_playerHUD + 0x6dc); } while (uVar2 < 8); return; } //@@ 009a2c70 HUD::InvalidateCraftingItem /* ZHL [exact] __thiscall void HUD::InvalidateCraftingItem(Entity_Player * player); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall HUD::InvalidateCraftingItem(HUD *this,Entity_Player *player) { uint uVar1; if (player == (Entity_Player *)0x0) { if (*(int *)this->_playerHUD != 0) { this->_playerHUD[0x6ad] = 1; } if (*(int *)(this->_playerHUD + 0x6dc) != 0) { this->_playerHUD[0xd89] = 1; } if (*(int *)(this->_playerHUD + 0xdb8) != 0) { this->_playerHUD[0x1465] = 1; } if (*(int *)(this->_playerHUD + 0x1494) != 0) { this->_playerHUD[0x1b41] = 1; } if (*(int *)(this->_playerHUD + 0x1b70) != 0) { this->_playerHUD[0x221d] = 1; } if (*(int *)(this->_playerHUD + 0x224c) != 0) { this->_playerHUD[0x28f9] = 1; } if (*(int *)(this->_playerHUD + 0x2928) != 0) { this->_playerHUD[0x2fd5] = 1; } if (*(int *)(this->_playerHUD + 0x3004) != 0) { this->_playerHUD[0x36b1] = 1; } return; } uVar1 = 0; do { if (*(Entity_Player **)this->_playerHUD == player) { this->_playerHUD[0x6ad] = 1; return; } uVar1 = uVar1 + 1; this = (HUD *)(this->_playerHUD + 0x6dc); } while (uVar1 < 8); return; } //@@ 009a2d20 HUD::ShowItemText /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall void HUD::ShowItemText(Entity_Player* player, ItemConfig_Item* item); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall HUD::ShowItemText(HUD *this,Entity_Player *player,ItemConfig_Item *item) { wchar_t wVar1; int *piVar2; int *piVar3; qword qVar4; byte bVar5; uint uVar6; int iVar7; char *scrambledText; wchar_t *title; ItemConfig_Item *pIVar8; LayerState *layer; int unused; byte *pbVar9; uint charIndex; byte *******pppppppbVar10; undefined1 *size; byte *******pppppppbVar11; qword *heapCounter; byte *pbVar12; uint descriptionLength; wchar_t *pwVar13; HUD_Message *hudMessage; char acStackY_178 [128]; void *in_stack_ffffff0c; int in_stack_ffffff10; char *in_stack_ffffff14; byte unused2; ItemConfig_Item **textCapacity; ItemConfig_Item *local_c0; byte local_b9; std_string itemDescription; std_string itemName; byte *******tmpString [3]; byte *****local_7c; undefined4 local_78; undefined1 *local_74; wchar_t zzazzPattern; undefined1 local_6e [74]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; puStack_20 = local_6e + 0x6a; local_14 = 0xffffffff; puStack_18 = &LAB_00b0db73; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_6e + 0x5e); ExceptionList = &local_1c; local_c0 = item; ItemConfig_Item::GetLocalizedName(item,&itemName,0x14); local_14 = 0; ItemConfig_Item::get_localized_description(item,&itemDescription,unused); local_14 = CONCAT31(local_14._1_3_,1); iVar7 = item->type; if (((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) { if (item->id == 0x7b) { uVar6 = Random(); if (uVar6 % 3 == 0) { pbVar12 = (byte *)&itemName; if (0xf < itemName._capacity) { pbVar12 = (byte *)itemName._buf._0_4_; } bVar5 = str_eq(pbVar12,itemName._size,(byte *)"Monster Manual",0xe); if (bVar5 != 0) { std::string::assign(itemName._buf,(byte *)"Monster Manuel",0xe); } } } if ((item->id == 0x26b) && (player != (Entity_Player *)0x0)) { iVar7 = FUN_0069bd10(); manager = g_manager; if (*(int *)(iVar7 + 0x104) == 0) { pbVar12 = &s_empty; } else { pbVar12 = (byte *)(iVar7 + 0xf4); if (0xf < *(uint *)(iVar7 + 0x108)) { pbVar12 = *(byte **)pbVar12; } if (*pbVar12 == 0x23) { local_b9 = 0; in_stack_ffffff14 = "Players"; in_stack_ffffff10 = 0x9a2e92; StringTable::get_string (&g_manager->_stringTable,(byte *)"Players",*(int *)&g_manager->_stringTable, pbVar12 + 1,&local_b9); if (local_b9 == 0) { local_b9 = 0; in_stack_ffffff14 = "Players"; in_stack_ffffff10 = 0x9a2ec5; pbVar12 = StringTable::get_string (&manager->_stringTable,(byte *)"Players", *(int *)&manager->_stringTable,pbVar12 + 1,&local_b9); } } item = local_c0; } tmpString[0] = (byte *******)0x0; local_78 = 0; local_74 = &DAT_0000000f; pbVar9 = pbVar12; do { bVar5 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar5 != 0); std::string::assign((char *)tmpString,pbVar12,(int)pbVar9 - (int)(pbVar12 + 1)); FUN_004215a0(); if (&DAT_0000000f < local_74) { size = local_74 + 1; pppppppbVar10 = tmpString[0]; if ((undefined1 *)0xfff < size) { pppppppbVar10 = (byte *******)tmpString[0][-1]; size = local_74 + 0x24; if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pppppppbVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar10,(uint)size); } } } game = g_game; textCapacity = &local_c0; pppppppbVar10 = (byte *******)&local_7c; local_c0 = (ItemConfig_Item *)0x9; iVar7 = 0x9a2f65; std::set::find_node(); if (((local_74[0xd] == '\0') && (*(int *)(local_74 + 0x10) < 10)) && (local_74 != (game->_seedEffects)._seedEffects)) { std::string::string(acStackY_178 + 0x84,&itemName); scrambledText = string_scramble_seeded (tmpString,in_stack_ffffff0c,in_stack_ffffff10,(int)in_stack_ffffff14,iVar7, (uint)pppppppbVar10,(uint)textCapacity); if (&itemName != (std_string *)scrambledText) { textCapacity = (ItemConfig_Item **)0x9a2fb7; std::string::_Tidy_deallocate(itemName._buf); itemName._buf._0_4_ = *(undefined4 *)scrambledText; itemName._buf._4_4_ = *(undefined4 *)(scrambledText + 4); itemName._buf._8_4_ = *(undefined4 *)(scrambledText + 8); itemName._buf._12_4_ = *(undefined4 *)(scrambledText + 0xc); itemName._16_8_ = *(undefined8 *)(scrambledText + 0x10); scrambledText[0x10] = '\0'; scrambledText[0x11] = '\0'; scrambledText[0x12] = '\0'; scrambledText[0x13] = '\0'; scrambledText[0x14] = '\x0f'; scrambledText[0x15] = '\0'; scrambledText[0x16] = '\0'; scrambledText[0x17] = '\0'; *scrambledText = '\0'; } if (&DAT_0000000f < local_74) { textCapacity = (ItemConfig_Item **)(local_74 + 1); pppppppbVar10 = tmpString[0]; if ((ItemConfig_Item **)0xfff < textCapacity) { pppppppbVar10 = (byte *******)tmpString[0][-1]; textCapacity = (ItemConfig_Item **)(local_74 + 0x24); if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pppppppbVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } iVar7 = 0x9a300f; operator_delete(pppppppbVar10,(uint)textCapacity); } std::string::string(acStackY_178 + 0x84,&itemDescription); scrambledText = string_scramble_seeded (tmpString,in_stack_ffffff0c,in_stack_ffffff10,(int)in_stack_ffffff14,iVar7, (uint)pppppppbVar10,(uint)textCapacity); if (&itemDescription != (std_string *)scrambledText) { textCapacity = (ItemConfig_Item **)0x9a3041; std::string::_Tidy_deallocate(itemDescription._buf); itemDescription._buf._0_4_ = *(undefined4 *)scrambledText; itemDescription._buf._4_4_ = *(undefined4 *)(scrambledText + 4); itemDescription._buf._8_4_ = *(undefined4 *)(scrambledText + 8); itemDescription._buf._12_4_ = *(undefined4 *)(scrambledText + 0xc); itemDescription._16_8_ = *(undefined8 *)(scrambledText + 0x10); scrambledText[0x10] = '\0'; scrambledText[0x11] = '\0'; scrambledText[0x12] = '\0'; scrambledText[0x13] = '\0'; scrambledText[0x14] = '\x0f'; scrambledText[0x15] = '\0'; scrambledText[0x16] = '\0'; scrambledText[0x17] = '\0'; *scrambledText = '\0'; } if (&DAT_0000000f < local_74) { textCapacity = (ItemConfig_Item **)(local_74 + 1); pppppppbVar10 = tmpString[0]; if ((ItemConfig_Item **)0xfff < textCapacity) { pppppppbVar10 = (byte *******)tmpString[0][-1]; textCapacity = (ItemConfig_Item **)(local_74 + 0x24); if (0x1f < (uint)((int)tmpString[0] + (-4 - (int)pppppppbVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar10,(uint)textCapacity); } } unused2 = (byte)textCapacity; bVar5 = (byte)pppppppbVar10; pbVar12 = (byte *)&itemName; if (0xf < itemName._capacity) { pbVar12 = (byte *)itemName._buf._0_4_; } title = utf8_to_utf16_alloc(pbVar12); pbVar12 = (byte *)&itemDescription; if (0xf < itemDescription._capacity) { pbVar12 = (byte *)itemDescription._buf._0_4_; } pIVar8 = (ItemConfig_Item *)utf8_to_utf16_alloc(pbVar12); local_c0 = pIVar8; if (item->id == 0x2d1) { pbVar9 = string_table_translate(&g_manager->_stringTable,(byte *)"#ZZAZZ_PATTERN"); local_78 = 0; local_74 = (undefined1 *)0xf; tmpString[0] = (byte *******)0x0; pbVar12 = pbVar9; do { bVar5 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar5 != 0); std::string::assign((char *)tmpString,pbVar9,(int)pbVar12 - (int)(pbVar9 + 1)); local_14._0_1_ = 2; pppppppbVar10 = (byte *******)tmpString; if ((local_74 < 0x10) || (pppppppbVar10 = tmpString[0], tmpString[0] != (byte *******)0x0)) { pppppppbVar11 = pppppppbVar10; do { bVar5 = *(byte *)pppppppbVar11; pppppppbVar11 = (byte *******)((int)pppppppbVar11 + 1); } while (bVar5 != 0); iVar7 = (int)pppppppbVar11 - (int)((int)pppppppbVar10 + 1); } else { iVar7 = 0; } unused2 = 1; bVar5 = 0x21; text_convert_encoding((byte *)pppppppbVar10,iVar7,0,&zzazzPattern,0x21,1); pwVar13 = &zzazzPattern; do { wVar1 = *pwVar13; pwVar13 = pwVar13 + 1; } while (wVar1 != L'\0'); uVar6 = (int)pwVar13 - (int)local_6e >> 1; piVar2 = &pIVar8->type; if (0x20 < uVar6) { uVar6 = 0x20; } do { piVar3 = &pIVar8->type; pIVar8 = (ItemConfig_Item *)((int)&pIVar8->type + 2); } while ((wchar_t)*piVar3 != L'\0'); descriptionLength = (int)pIVar8 - (int)((int)piVar2 + 2) >> 1; if (100 < descriptionLength) { descriptionLength = 100; } charIndex = 0; if (descriptionLength != 0) { do { if (*(short *)(local_6e + (charIndex % uVar6) * 2 + -2) != 0x2e) { *(short *)((local_c0->name)._buf + charIndex * 2 + -8) = *(short *)(local_6e + (charIndex % uVar6) * 2 + -2); } charIndex = charIndex + 1; } while (charIndex < descriptionLength); } local_14 = CONCAT31(local_14._1_3_,1); if (0xf < local_74) { uVar6 = (int)local_74 + 1; pppppppbVar10 = tmpString[0]; if (0xfff < uVar6) { pppppppbVar10 = (byte *******)tmpString[0][-1]; uVar6 = (int)local_74 + 0x24; if ((byte *)0x1f < (byte *)((int)tmpString[0] + (-4 - (int)pppppppbVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar10,uVar6); unused2 = (byte)uVar6; bVar5 = (byte)pppppppbVar10; } local_78 = 0; local_74 = &DAT_0000000f; tmpString[0] = (byte *******)((uint)tmpString[0] & 0xffffff00); } pIVar8 = local_c0; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { ShowStackedItemTextCustomUTF16(this,title,(wchar_t *)local_c0,bVar5,unused2); } else { iVar7 = GetPlayerHudIndex(this); hudMessage = this->_messagePlayerHUD + iVar7 * 0x7d; if (title == (wchar_t *)0x0) { KAGE_LogMessage(8,(byte *) "HUD_Message::Show() recieved NULL messageText (This will have no effect) \n" ); } else { HUD_Message::text_out(hudMessage); HUD_Message::set_text_line(hudMessage,title,0); if (pIVar8 != (ItemConfig_Item *)0x0) { HUD_Message::set_text_line(hudMessage,(short *)pIVar8,1); } *(undefined2 *)&hudMessage[2].field_0x1 = 1; bVar5 = ANM2::SetAnimation((ANM2 *)(hudMessage + 8),&DAT_00b1c208,1); if (bVar5 != 0) { AnimationState::Rewind((AnimationState *)(hudMessage + 0x14)); *(undefined1 *)(hudMessage + 0x19) = 1; pIVar8 = local_c0; } local_b9 = hudMessage[2].field_0x2; layer = ANM2::GetLayer((ANM2 *)(hudMessage + 8),(byte *)0x1); layer->_visible = local_b9; HUD_Message::UpdateTextImage(hudMessage); *(undefined1 *)(hudMessage + 2) = 1; } } heapCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } if (title != (wchar_t *)0x0) { uVar6 = *(uint *)(title + -2); qVar4 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar6; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar4 < uVar6); free(title + -2); } heapCounter = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } if (pIVar8 != (ItemConfig_Item *)0x0) { uVar6 = pIVar8[-1]._initCharge; qVar4 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar6; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar4 < uVar6); free(&pIVar8[-1]._initCharge); } if (0xf < itemDescription._capacity) { uVar6 = itemDescription._capacity + 1; pbVar12 = (byte *)itemDescription._buf._0_4_; if (0xfff < uVar6) { pbVar12 = *(byte **)(itemDescription._buf._0_4_ + 0xfffffffc); uVar6 = itemDescription._capacity + 0x24; if ((byte *)0x1f < (byte *)(itemDescription._buf._0_4_ + (-4 - (int)pbVar12))) goto LAB_009a33db; } operator_delete(pbVar12,uVar6); } itemDescription._size = 0; itemDescription._capacity = 0xf; itemDescription._buf._0_4_ = itemDescription._buf._0_4_ & 0xffffff00; if (0xf < itemName._capacity) { uVar6 = itemName._capacity + 1; pbVar12 = (byte *)itemName._buf._0_4_; if (0xfff < uVar6) { pbVar12 = *(byte **)(itemName._buf._0_4_ + 0xfffffffc); uVar6 = itemName._capacity + 0x24; if ((byte *)0x1f < (byte *)(itemName._buf._0_4_ + (-4 - (int)pbVar12))) { LAB_009a33db: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar12,uVar6); } ExceptionList = local_1c; return; } //@@ 009a3410 PlayerHUD::show_pill_name /* DB: ? pill use / pickup, netplay branch */ void PlayerHUD::show_pill_name(undefined4 param_1,byte *param_2,byte *param_3) { int iVar1; uint uVar2; int in_ECX; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (*(int *)&g_game->_deathmatchManager < 2)) { iVar1 = HUD::GetPlayerHudIndex(); HUD_Message::Show((HUD_Message *)(in_ECX + 0x4a88 + iVar1 * 500),param_2,param_3,1,0); return; } uVar2 = 0; do { if (*(char *)(in_ECX + 0x3ed8) == '\0') { HUD_Message::Show((HUD_Message *)(in_ECX + 0x3ed0),param_2,param_3,1,0); return; } uVar2 = uVar2 + 1; in_ECX = in_ECX + 500; } while (uVar2 < 6); return; } //@@ 009a34a0 HUD::ShowStackedItemTextCustomUTF16 /* ZHL [exact] __thiscall void HUD::ShowStackedItemTextCustomUTF16(wchar_t* title, wchar_t* subtitle, bool unused1, bool unused2); prototype: REPENTOGON, confirmed by RET 16 */ void __thiscall HUD::ShowStackedItemTextCustomUTF16 (HUD *this,wchar_t *title,wchar_t *subtitle,byte unused1,byte unused2) { byte bVar1; uint uVar2; LayerState *pLVar3; HUD_Message *pHVar4; uVar2 = 0; pHVar4 = this->_messageStack + 2; do { if (*(char *)pHVar4 == '\0') { pHVar4 = this->_messageStack + uVar2 * 0x7d; if (title == (wchar_t *)0x0) { KAGE_LogMessage(8,(byte *) "HUD_Message::Show() recieved NULL messageText (This will have no effect) \n" ); return; } HUD_Message::text_out(pHVar4); HUD_Message::set_text_line(pHVar4,title,0); if (subtitle != (wchar_t *)0x0) { HUD_Message::set_text_line(pHVar4,subtitle,1); } *(undefined2 *)&pHVar4[2].field_0x1 = 1; bVar1 = ANM2::SetAnimation((ANM2 *)(pHVar4 + 8),&DAT_00b1c208,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(pHVar4 + 0x14)); *(undefined1 *)(pHVar4 + 0x19) = 1; } bVar1 = pHVar4[2].field_0x2; pLVar3 = ANM2::GetLayer((ANM2 *)(pHVar4 + 8),(byte *)0x1); pLVar3->_visible = bVar1; HUD_Message::UpdateTextImage(pHVar4); *(undefined1 *)(pHVar4 + 2) = 1; return; } uVar2 = uVar2 + 1; pHVar4 = pHVar4 + 0x7d; } while (uVar2 < 6); return; } //@@ 009a3560 FUN_009a3560 void FUN_009a3560(void) { int in_ECX; char *pcVar1; int iVar2; pcVar1 = (char *)(in_ECX + 0x3ed8); iVar2 = 6; do { if (*pcVar1 != '\0') { HUD_Message::free_text_buffers((HUD_Message *)(pcVar1 + -8)); *pcVar1 = '\0'; } pcVar1 = pcVar1 + 500; iVar2 = iVar2 + -1; } while (iVar2 != 0); return; } //@@ 009a3590 HUD::show_fortune_line /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: builds a one-element std::list from param_1 (FUN_00693470 push) and calls HUD::render_fortune_text, then frees the list; Level::AddCurse (curse name banner), Entity_Player::room_enter */ void HUD::show_fortune_line(byte *param_1) { byte bVar1; undefined4 *puVar2; undefined4 *ptr; HUD *in_ECX; byte *pbVar3; void *ptr_00; uint size; undefined4 *local_38; undefined4 local_34; void *local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0dbb5; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; local_38 = (undefined4 *)0x0; local_34 = 0; local_38 = operator_new(0x20); *local_38 = local_38; local_38[1] = local_38; local_8 = (void *)0x0; local_20 = 0; local_1c = 0xf; local_30[0] = (void *)0x0; pbVar3 = param_1; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign((char *)local_30,param_1,(int)pbVar3 - (int)(param_1 + 1)); local_8._0_1_ = 1; list_string_push_back_move(local_30); local_8 = (void *)((uint)local_8._1_3_ << 8); if (0xf < local_1c) { size = local_1c + 1; ptr_00 = local_30[0]; if (0xfff < size) { ptr_00 = *(void **)((int)local_30[0] + -4); size = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)ptr_00))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr_00,size); } render_fortune_text(in_ECX,&local_38); *(undefined4 *)local_38[1] = 0; ptr = (undefined4 *)*local_38; while (ptr != (undefined4 *)0x0) { puVar2 = (undefined4 *)*ptr; std::string::_Tidy_deallocate((char *)(ptr + 2)); operator_delete(ptr,0x20); ptr = puVar2; } operator_delete(local_38,0x20); ExceptionList = local_10; return; } //@@ 009a36d0 HUD::show_fortune_text_impl /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX=Game::GetHUD(); Entity_Slot::Update passes string_table_translate("#YOU_FEEL_BLESSED"); converts to wide chars (0x100 buf), std::list "list too long"; 0085eca0/00912560 NetplayManager::receive_vote_end_message the ShowFortuneText entry points */ void HUD::show_fortune_text_impl(byte *param_1) { byte bVar1; undefined4 *puVar2; qword qVar3; wint_t *wideText; int iVar4; byte *pbVar5; undefined4 *puVar6; HUD *in_ECX; void *ptr; qword *allocatedBytes; wint_t *lineEnd; uint uVar7; wint_t *cursor; wint_t *lastSpace; Font *font; undefined4 charBuffer; wint_t *lineStart; undefined4 *lines; int lineCount; undefined4 *local_144; void *lineText; undefined4 uStack_13c; undefined4 uStack_138; undefined4 uStack_134; undefined4 lineTextSize; uint lineTextCapacity; byte lineBuffer [260]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; wint_t currentChar; puStack_20 = lineBuffer + 0x124; local_14 = 0xffffffff; puStack_18 = &LAB_00b0dc11; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(lineBuffer + 0x118); ExceptionList = &local_1c; font = &in_ECX->_font; if (((in_ECX->_font)._isLoaded == 0) && (font = &in_ECX->_fontKR, (in_ECX->_fontKR)._isLoaded == 0)) { font = &g_manager->_font7_Upheaval; } wideText = (wint_t *)utf8_to_utf16_alloc(param_1); lines = (undefined4 *)0x0; lineCount = 0; lines = operator_new(0x20); *lines = lines; lines[1] = lines; local_14 = 0; local_144 = (undefined4 *)0x0; charBuffer = 0; currentChar = *wideText; cursor = wideText; lastSpace = wideText; lineStart = wideText; do { if (currentChar == 0) { text_convert_encoding ((byte *)lineStart,(int)cursor - (int)lineStart >> 1,1,lineBuffer,0x100,0); pbVar5 = lineBuffer; lineTextSize = 0; lineTextCapacity = 0xf; lineText = (void *)0x0; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)&lineText,lineBuffer,(int)pbVar5 - (int)(lineBuffer + 1)); local_14._0_1_ = 3; list_string_push_back_move(&lineText); local_14 = (uint)local_14._1_3_ << 8; if (0xf < lineTextCapacity) { uVar7 = lineTextCapacity + 1; ptr = lineText; if (0xfff < uVar7) { ptr = *(void **)((int)lineText + -4); uVar7 = lineTextCapacity + 0x24; if (0x1f < (uint)((int)lineText + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } uVar7 = *(uint *)(wideText + -2); qVar3 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar3 < uVar7); free(wideText + -2); local_14 = local_14 & 0xffffff00; render_fortune_text(in_ECX,&lines); *(undefined4 *)lines[1] = 0; puVar2 = (undefined4 *)*lines; while (puVar2 != (undefined4 *)0x0) { puVar6 = (undefined4 *)*puVar2; std::string::_Tidy_deallocate((char *)(puVar2 + 2)); operator_delete(puVar2,0x20); puVar2 = puVar6; } operator_delete(lines,0x20); ExceptionList = local_1c; return; } iVar4 = iswspace(currentChar); charBuffer = CONCAT22(charBuffer._2_2_,*cursor); if (iVar4 != 0) { lastSpace = cursor; } iVar4 = Font::get_string_width_utf16(font,(short *)&charBuffer,-1); local_144 = (undefined4 *)((int)local_144 + iVar4); if (0x10e < local_144) { lineEnd = cursor; if (lastSpace != lineStart) { lineEnd = lastSpace; } text_convert_encoding ((byte *)lineStart,(int)lineEnd - (int)lineStart >> 1,0,lineBuffer,0x100,1); pbVar5 = lineBuffer; lineTextSize = 0; lineTextCapacity = 0xf; lineText = (void *)0x0; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; } while (bVar1 != 0); std::string::assign((char *)&lineText,lineBuffer,(int)pbVar5 - (int)(lineBuffer + 1)); local_14 = CONCAT31(local_14._1_3_,1); local_144 = lines; if (lineCount == 0x7ffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_14._0_1_ = 2; puVar6 = operator_new(0x20); puVar6[6] = 0; puVar6[7] = 0; puVar6[2] = lineText; puVar6[3] = uStack_13c; puVar6[4] = uStack_138; puVar6[5] = uStack_134; puVar6[6] = lineTextSize; puVar6[7] = lineTextCapacity; lineCount = lineCount + 1; puVar2 = (undefined4 *)local_144[1]; cursor = cursor + -1; if (lastSpace != lineStart) { cursor = lastSpace; } *puVar6 = local_144; puVar6[1] = puVar2; local_144[1] = puVar6; *puVar2 = puVar6; lastSpace = cursor + 1; local_14 = (uint)local_14._1_3_ << 8; local_144 = (undefined4 *)0x0; lineStart = lastSpace; } currentChar = cursor[1]; cursor = cursor + 1; } while( true ); } //@@ 009a3ac0 HUD::render_fortune_text /* DB: ? this=HUD (anim state +0x5288 near zhl _fortuneSprite 0x5278, render target +0x536c); picks Text/Text2/Text3 by line count and pre-renders into the fortune render target; called from HUD::ShowFortuneText and Game::ShowFortuneText prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall HUD::render_fortune_text(HUD *this,void *lines) { KColor color; HUD *pHVar1; byte isAnimChanged; undefined4 *renderTargetEntry; uint lineWidth; byte *lineText; void *glyphs; uint maxWidth; int iVar2; Font *font; int *piVar3; int *lineNode; uint prevMaxWidth; float textHeight; float fullLineHeight; char *anim; undefined4 drawSettings; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined1 glyphBuffer [16]; Vector local_2c; float local_24; float lineHeight; float textScale; HUD *hud; void *local_10; undefined1 *puStack_c; undefined4 local_8; void *lineList; lineList = lines; local_8 = 0xffffffff; puStack_c = &LAB_00b0dc55; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *(int *)((int)lines + 4); hud = this; if (iVar2 == 0) { isAnimChanged = ANM2::SetAnimation(&this->_fortuneSprite,&DAT_00b1c208,1); if (isAnimChanged != 0) { AnimationState::Rewind(&(this->_fortuneSprite)._animState); (this->_fortuneSprite)._animState._isPlaying = 1; } local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); renderTargetEntry = std::deque::back(); if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)&this->field_0x536c,0); RenderTarget::Clear(&DAT_00c798e0); pop_render_target(); ExceptionList = local_10; return; } font = &this->_font; textScale = 1.0; if (((this->_font)._isLoaded == 0) && (font = &this->_fontKR, (this->_fontKR)._isLoaded == 0)) { font = &g_manager->_font7_Upheaval; } fullLineHeight = 21.0; maxWidth = 0; lineHeight = 21.0; piVar3 = (int *)**(int **)lines; prevMaxWidth = 0; if (piVar3 != *(int **)lines) { do { lineText = (byte *)(piVar3 + 2); if (0xf < (uint)piVar3[7]) { lineText = *(byte **)lineText; } lineWidth = Font::get_string_width_n(font,lineText,-1); maxWidth = prevMaxWidth; if (prevMaxWidth < lineWidth) { maxWidth = lineWidth; } piVar3 = (int *)*piVar3; prevMaxWidth = maxWidth; } while (piVar3 != (int *)*(int *)lines); iVar2 = *(int *)((int)lines + 4); local_24 = (float)maxWidth; } pHVar1 = hud; textHeight = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * fullLineHeight; if ((0x111 < maxWidth) || (63.0 < textHeight)) { textScale = 0.5; lineHeight = 10.5; textHeight = textHeight * 0.5; } if (textHeight <= 42.0) { if (textHeight <= fullLineHeight) { anim = &DAT_00b1c208; } else { anim = "Text2"; } } else { anim = "Text3"; } isAnimChanged = ANM2::SetAnimation(&hud->_fortuneSprite,(byte *)anim,1); if (isAnimChanged != 0) { AnimationState::Rewind(&(pHVar1->_fortuneSprite)._animState); (pHVar1->_fortuneSprite)._animState._isPlaying = 1; } local_2c.x = 0.0; local_2c.y = 0.0; std::vector::resize(&local_2c); renderTargetEntry = std::deque::back(); pHVar1 = hud; if ((byte *)(renderTargetEntry + 1) != (byte *)0x0) { *(byte *)(renderTargetEntry + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *renderTargetEntry = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)&hud->field_0x536c,0); RenderTarget::Clear(&DAT_00c798e0); g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; iVar2 = *(int *)(*(int *)&pHVar1->field_0x536c + 0x10); piVar3 = *(int **)lines; lineNode = (int *)*piVar3; local_24 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 0.5; lines = (void *)0x0; if (lineNode != piVar3) { local_2c.y = textScale; local_2c.x = textScale; do { drawSettings = 1; local_54 = 0xffff; local_50 = 0; local_4c = 0x3f800000; local_48 = 0xffffffff; local_44 = 0; local_40 = 0; lineText = (byte *)(lineNode + 2); local_8 = 0; if (0xf < (uint)lineNode[7]) { lineText = *(byte **)lineText; } glyphs = Font::measure_string(font,glyphBuffer,lineText,&drawSettings,&local_2c); local_8 = CONCAT31(local_8._1_3_,1); color._alpha = 1.0; color._red = 0.0; color._green = 0.0; color._blue = 0.0; color._unk = 0; Font::render_glyph_quads (font,glyphs,local_24,(float)lines,textScale,textScale,color,&drawSettings); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); lines = (void *)((float)lines + lineHeight); local_8 = 0xffffffff; lineNode = (int *)*lineNode; } while (lineNode != (int *)*(int *)lineList); } _glfw_context_reset(1); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } renderTargetEntry = std::deque::back(); KAGE_Graphics::SetRenderTarget (&DAT_00c798e0,(void *)*renderTargetEntry,*(byte *)(renderTargetEntry + 1)); g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } ExceptionList = local_10; return; } //@@ 009a3eb0 HUD::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding HUD:Render prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall HUD::Render(HUD *this) { code *pcVar1; ANM2 *animation; Vector VVar2; Vector pos; Vector pos_00; Vector pos_01; Vector pos_02; Vector pos_03; Vector pos_04; Vector barPos; byte bVar3; char cVar4; uint uVar5; Vector *pVVar6; undefined4 extraout_EAX; int iVar7; Entity_Player *pEVar8; KColor *color; KColor *color_00; KColor *color_01; KColor *color_02; KColor *color_03; KColor *color_04; RoomDescriptor *currentRoomDesc; PersistentGameData *profileData; byte *pbVar9; ChallengeParam *challengeParams; Entity_Player *extraout_EAX_00; KColor *color_05; KColor *color_06; undefined4 extraout_ECX; int unused; byte *pbVar10; AnimationState *this_00; int unusedArg; AnimationState *secondAnimState; undefined4 extraout_ECX_00; char *pcVar11; int iVar12; byte *pbVar13; undefined4 extraout_ECX_01; byte *******pppppppbVar14; Game *pGVar15; char extraout_DL; void *pvVar16; PlayerManager *playerManager; void *pvVar17; PersistentGameData *data; bool bVar18; int *piVar19; void *pvVar20; undefined1 auVar21 [16]; float fVar22; float fVar23; undefined8 uVar24; undefined1 quadBuffer [116]; float portraitScaleX; float portraitScaleY; undefined1 local_134 [4]; Vector local_130; Vector local_128; KColor local_120; FontSettings local_10c; undefined4 local_108; undefined4 local_104; undefined4 local_100; undefined4 local_fc; undefined4 local_f8; undefined4 local_f4; FontSettings local_f0; undefined4 local_ec; KColor local_e8; Vector local_d4; int *iconFrames; int *local_c8; int *local_c4; void *local_c0; void *local_bc; Entity_Player *local_b8; char isStatHudHidden; char isAchievementsDisabled; char isHardMode; void *local_b0; Entity_Player *local_ac; Vector local_a8; char isInClearedGreedBossRoom; HUD *local_98; float local_94; float local_90; Game *local_8c; Vector cursorPos; byte local_7e; char isGreedMode; Entity_Player *local_7c; void *local_78; float local_74; Color local_70; byte *******statusText; KColor local_40; byte ambushText [4]; int coopPlayerType; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; pvVar17 = ExceptionList; puStack_20 = ambushText + 0x28; local_14 = 0xffffffff; puStack_18 = &LAB_00b0dd45; local_1c = ExceptionList; uVar5 = __security_cookie ^ (uint)(ambushText + 0x1c); ExceptionList = &local_1c; this->_playerHUD[0x6bc] = 0x80; this->_playerHUD[0x6bd] = 0x96; this->_playerHUD[0x6be] = 0x18; this->_playerHUD[0x6bf] = 0x4b; this->_playerHUD[0x6c0] = 0x80; this->_playerHUD[0x6c1] = 0x96; this->_playerHUD[0x6c2] = 0x18; this->_playerHUD[0x6c3] = 0x4b; this->_playerHUD[0x6c4] = 0x80; this->_playerHUD[0x6c5] = 0x96; this->_playerHUD[0x6c6] = 0x18; this->_playerHUD[0x6c7] = 0xcb; this->_playerHUD[0x6c8] = 0x80; this->_playerHUD[0x6c9] = 0x96; this->_playerHUD[0x6ca] = 0x18; this->_playerHUD[0x6cb] = 0xcb; this->_playerHUD[0xd98] = 0x80; this->_playerHUD[0xd99] = 0x96; this->_playerHUD[0xd9a] = 0x18; this->_playerHUD[0xd9b] = 0x4b; this->_playerHUD[0xd9c] = 0x80; this->_playerHUD[0xd9d] = 0x96; this->_playerHUD[0xd9e] = 0x18; this->_playerHUD[0xd9f] = 0x4b; this->_playerHUD[0xda0] = 0x80; this->_playerHUD[0xda1] = 0x96; this->_playerHUD[0xda2] = 0x18; this->_playerHUD[0xda3] = 0xcb; this->_playerHUD[0xda4] = 0x80; this->_playerHUD[0xda5] = 0x96; this->_playerHUD[0xda6] = 0x18; this->_playerHUD[0xda7] = 0xcb; this->_playerHUD[0x1474] = 0x80; this->_playerHUD[0x1475] = 0x96; this->_playerHUD[0x1476] = 0x18; this->_playerHUD[0x1477] = 0x4b; this->_playerHUD[0x1478] = 0x80; this->_playerHUD[0x1479] = 0x96; this->_playerHUD[0x147a] = 0x18; this->_playerHUD[0x147b] = 0x4b; this->_playerHUD[0x147c] = 0x80; this->_playerHUD[0x147d] = 0x96; this->_playerHUD[0x147e] = 0x18; this->_playerHUD[0x147f] = 0xcb; this->_playerHUD[0x1480] = 0x80; this->_playerHUD[0x1481] = 0x96; this->_playerHUD[0x1482] = 0x18; this->_playerHUD[0x1483] = 0xcb; this->_playerHUD[0x1b50] = 0x80; this->_playerHUD[0x1b51] = 0x96; this->_playerHUD[0x1b52] = 0x18; this->_playerHUD[0x1b53] = 0x4b; this->_playerHUD[0x1b54] = 0x80; this->_playerHUD[0x1b55] = 0x96; this->_playerHUD[0x1b56] = 0x18; this->_playerHUD[6999] = 0x4b; this->_playerHUD[7000] = 0x80; this->_playerHUD[0x1b59] = 0x96; this->_playerHUD[0x1b5a] = 0x18; this->_playerHUD[0x1b5b] = 0xcb; this->_playerHUD[0x1b5c] = 0x80; this->_playerHUD[0x1b5d] = 0x96; this->_playerHUD[0x1b5e] = 0x18; this->_playerHUD[0x1b5f] = 0xcb; this->_playerHUD[0x222c] = 0x80; this->_playerHUD[0x222d] = 0x96; this->_playerHUD[0x222e] = 0x18; this->_playerHUD[0x222f] = 0x4b; this->_playerHUD[0x2230] = 0x80; this->_playerHUD[0x2231] = 0x96; this->_playerHUD[0x2232] = 0x18; this->_playerHUD[0x2233] = 0x4b; this->_playerHUD[0x2234] = 0x80; this->_playerHUD[0x2235] = 0x96; this->_playerHUD[0x2236] = 0x18; this->_playerHUD[0x2237] = 0xcb; this->_playerHUD[0x2238] = 0x80; this->_playerHUD[0x2239] = 0x96; this->_playerHUD[0x223a] = 0x18; this->_playerHUD[0x223b] = 0xcb; this->_playerHUD[0x2908] = 0x80; this->_playerHUD[0x2909] = 0x96; this->_playerHUD[0x290a] = 0x18; this->_playerHUD[0x290b] = 0x4b; this->_playerHUD[0x290c] = 0x80; this->_playerHUD[0x290d] = 0x96; this->_playerHUD[0x290e] = 0x18; this->_playerHUD[0x290f] = 0x4b; this->_playerHUD[0x2910] = 0x80; this->_playerHUD[0x2911] = 0x96; this->_playerHUD[0x2912] = 0x18; this->_playerHUD[0x2913] = 0xcb; this->_playerHUD[0x2914] = 0x80; this->_playerHUD[0x2915] = 0x96; this->_playerHUD[0x2916] = 0x18; this->_playerHUD[0x2917] = 0xcb; this->_playerHUD[0x2fe4] = 0x80; this->_playerHUD[0x2fe5] = 0x96; this->_playerHUD[0x2fe6] = 0x18; this->_playerHUD[0x2fe7] = 0x4b; this->_playerHUD[0x2fe8] = 0x80; this->_playerHUD[0x2fe9] = 0x96; this->_playerHUD[0x2fea] = 0x18; this->_playerHUD[0x2feb] = 0x4b; this->_playerHUD[0x2fec] = 0x80; this->_playerHUD[0x2fed] = 0x96; this->_playerHUD[0x2fee] = 0x18; this->_playerHUD[0x2fef] = 0xcb; this->_playerHUD[0x2ff0] = 0x80; this->_playerHUD[0x2ff1] = 0x96; this->_playerHUD[0x2ff2] = 0x18; this->_playerHUD[0x2ff3] = 0xcb; this->_playerHUD[0x36c0] = 0x80; this->_playerHUD[0x36c1] = 0x96; this->_playerHUD[0x36c2] = 0x18; this->_playerHUD[0x36c3] = 0x4b; this->_playerHUD[0x36c4] = 0x80; this->_playerHUD[0x36c5] = 0x96; this->_playerHUD[0x36c6] = 0x18; this->_playerHUD[0x36c7] = 0x4b; this->_playerHUD[0x36c8] = 0x80; this->_playerHUD[0x36c9] = 0x96; this->_playerHUD[0x36ca] = 0x18; this->_playerHUD[0x36cb] = 0xcb; this->_playerHUD[0x36cc] = 0x80; pGVar15 = g_game; this->_playerHUD[0x36cd] = 0x96; this->_playerHUD[0x36ce] = 0x18; this->_playerHUD[0x36cf] = 0xcb; if (this->_isVisible == 0) { ExceptionList = pvVar17; return; } local_ac = (Entity_Player *)0xa; local_98 = this; local_24 = uVar5; std::set::find_node(&local_120._blue,&local_ac); if ((*(char *)(local_120._unk + 0xd) != '\0') || (piVar19 = (int *)local_120._unk, 10 < *(int *)(local_120._unk + 0x10))) { piVar19 = (pGVar15->_seedEffects)._seedEffects; } if (piVar19 != (pGVar15->_seedEffects)._seedEffects) { ExceptionList = local_1c; return; } piVar19 = *(int **)(*(int *)((int)pGVar15->_room + 4) + 0x10); if (((piVar19 == (int *)0x0) || (piVar19[2] != 0x10)) || (*piVar19 != 0x23)) { isStatHudHidden = '\0'; } else { isStatHudHidden = '\x01'; } local_90 = (pGVar15->_screenShakeOffset).x; local_94 = (pGVar15->_screenShakeOffset).y; update_hud_offset(uVar5); local_ac = (Entity_Player *)(g_manager->_optionsConfig)._historyHudMode; if ((0 < (int)local_ac) && (extraout_DL == '\0')) { fVar22 = 1.0 - (g_manager->_optionsConfig)._hudOffset; fVar23 = fVar22 * -14.0; fVar22 = fVar22 * 24.0; pVVar6 = Minimap::GetDisplayedSize(&pGVar15->_minimap,&local_130); local_a8.y = fVar23 + pVVar6->y + 32.0; local_a8.x = (g_screenWidth - 87.0) + fVar22; render_extra_hud((HUD *)&this->_historyHUD,&local_a8,local_ac == (Entity_Player *)0x2); pGVar15 = g_game; } if (*(int *)&pGVar15->_deathmatchManager < 2) { Minimap::Render(&pGVar15->_minimap); pGVar15 = g_game; if (((g_game->_ambush)._isActive != 0) && (*(int *)((int)g_game->_room + 8) == 0x11)) { local_a8.x = 64.0; local_a8.y = 32.0; local_d4.x = (g_screenWidth - 64.0) * 0.5 + local_90; local_7c = (Entity_Player *) ((1.0 - (g_manager->_optionsConfig)._hudOffset) * -24.0 + 20.0 + local_94); if (0.0 < *(float *)&(g_game->_minimap).field_0x2d0) { local_7c = (Entity_Player *)((float)local_7c + 20.0); } if ((g_game->_dailyChallenge)._id != 0) { local_7c = (Entity_Player *)((float)local_7c + 20.0); } local_d4.y = (float)local_7c; local_ac = (Entity_Player *)local_d4.x; KColor::SetFromARGB(&local_120,0xffffffff); render_quad_set_rect(quadBuffer,&local_d4,&local_a8,color_06); pcVar1 = *(code **)(**(int **)&this->field_0x54c4 + 0x1c); KColor::SetFromARGB(&local_120,0xffffffff); (*pcVar1)(quadBuffer,extraout_ECX); sprintf_s(ambushText,8,(byte *)"%d/%d"); manager = g_manager; FontSettings::constructor((FontSettings *)local_70._colorize); local_14 = 0; KColor::SetFromARGB(&local_120,0xffffffff); Font::get_string_width_n(&manager->_font6_PFTempestaSevenCondensed,ambushText,-1); Font::DrawString(ambushText,&local_120,extraout_EAX); local_14 = 0xffffffff; local_70._offset[1] = 0.0; local_70._offset[2] = 0.0; pGVar15 = g_game; this = local_98; } } cursorPos.x = *(float *)&this->field_0x5934 + 20.0; piVar19 = (pGVar15->_playerManager)._playerList._begin; local_8c = (Game *)&g_manager->_font6_PFTempestaSevenCondensed; cursorPos.y = *(float *)&this->field_0x5938 + 46.0; local_7c = (Entity_Player *)0x41400000; local_78 = (void *)cursorPos.y; if ((int)(pGVar15->_playerManager)._playerList._end - (int)piVar19 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar19 = (pGVar15->_playerManager)._playerList._begin; pGVar15 = g_game; } local_bc = (void *)*piVar19; if (1 < *(int *)&pGVar15->_deathmatchManager) { iVar7 = FUN_0090b070(); if (iVar7 != 0) { local_bc = (void *)FUN_004253d0(); } pGVar15 = g_game; } if (local_bc == (void *)0x0) { ExceptionList = local_1c; return; } if (*(int *)((int)local_bc + 0x13c0) == 0x13) { cursorPos.y = (float)local_78 + 14.0; local_78 = (void *)cursorPos.y; } playerManager = &pGVar15->_playerManager; local_98 = (HUD *)PlayerManager::FirstPlayerByType(playerManager,0x12); local_b8 = PlayerManager::FirstPlayerByType(playerManager,0x24); local_7e = PlayerManager::are_all_players_tainted_blue_baby(playerManager,unused); local_ac = PlayerManager::FirstPlayerByType(playerManager,0x19); if (((local_98 != (HUD *)0x0) || (local_b8 != (Entity_Player *)0x0)) || ((local_ac != (Entity_Player *)0x0 && (local_7e == 0)))) { local_7c = (Entity_Player *)0x41300000; } bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,s_Idle,1); if (((bVar3 != 0) && ((this->_pickupHUDSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,0.0), (this->_pickupHUDSprite)._animState._animData != (void *)0x0)) { (this->_pickupHUDSprite)._animState._isPlaying = 0; } if ((this->_pickupHUDSprite)._loaded == 0) { pvVar17 = local_78; } else if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_pickupHUDSprite)._animState,&cursorPos,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->_pickupHUDSprite)._overlayAnimState,&cursorPos,&g_vectorZero,&g_vectorZero); pvVar17 = (void *)cursorPos.y; } else { AnimationState::Render (&(this->_pickupHUDSprite)._overlayAnimState,&cursorPos,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->_pickupHUDSprite)._animState,&cursorPos,&g_vectorZero,&g_vectorZero); pvVar17 = (void *)cursorPos.y; } local_78 = (void *)(local_90 + cursorPos.x); local_74 = local_94 + (float)pvVar17; pEVar8 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x1a0,(RNG **)&g_game->_playerManager,1); pbVar10 = &DAT_00b6d170; if (pEVar8 == (Entity_Player *)0x0) { pbVar10 = &DAT_00b7ddac; } sprintf_s(&DAT_00c94328,0x10,pbVar10); local_f0 = (FontSettings)0x0; local_ec = 0xffff; local_e8._red = 0.0; local_e8._green = 1.0; local_e8._blue = -NAN; local_e8._alpha = 0.0; local_e8._unk = 0; local_14 = 1; KColor::SetFromARGB(&local_120,0xffffffff); VVar2.y = local_74 + 1.0; VVar2.x = (float)local_78 + 16.0; Font::DrawString((Font *)local_8c,&DAT_00c94328,VVar2,(Vector)0x3f8000003f800000,color,&local_f0); local_14 = 0xffffffff; cursorPos.x = (float)local_78 - local_90; cursorPos.y = (local_74 - local_94) + (float)local_7c; if (local_7e == 0) { if (*(int *)((int)local_bc + 0x1dd4) == 0) { if (*(char *)((int)local_bc + 0x1361) == '\0') { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 2.0; goto LAB_009a4737; } } else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 6.0; LAB_009a4737: AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar22); } } else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 14.0; goto LAB_009a4737; } ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = (void *)(local_90 + cursorPos.x); local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); local_f0 = (FontSettings)0x0; local_ec = 0xffff; local_e8._red = 0.0; local_e8._green = 1.0; local_e8._blue = -NAN; local_e8._alpha = 0.0; local_e8._unk = 0; local_14 = 2; KColor::SetFromARGB(&local_120,0xffffffff); pos.y = local_74 + 1.0; pos.x = (float)local_78 + 16.0; Font::DrawString((Font *)local_8c,&DAT_00c94328,pos,(Vector)0x3f8000003f800000,color_00, &local_f0); cursorPos.x = (float)local_78 - local_90; cursorPos.y = (local_74 - local_94) + (float)local_7c; } local_14 = 0xffffffff; if (local_ac != (Entity_Player *)0x0) { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,16.0); } ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = (void *)(local_90 + cursorPos.x); local_74 = local_94 + cursorPos.y; pEVar8 = PlayerManager::FirstBirthrightOwner(&g_game->_playerManager,0x19); pbVar10 = &DAT_00b7ddac; if (pEVar8 == (Entity_Player *)0x0) { pbVar10 = s__d; } sprintf_s(&DAT_00c94328,0x10,pbVar10); local_f0 = (FontSettings)0x0; local_ec = 0xffff; local_e8._red = 0.0; local_e8._green = 1.0; local_e8._blue = -NAN; local_e8._alpha = 0.0; local_e8._unk = 0; local_14 = 3; KColor::SetFromARGB(&local_120,0xffffffff); pos_00.y = local_74 + 1.0; pos_00.x = (float)local_78 + 16.0; Font::DrawString((Font *)local_8c,&DAT_00c94328,pos_00,(Vector)0x3f8000003f800000,color_01, &local_f0); cursorPos.x = (float)local_78 - local_90; cursorPos.y = (local_74 - local_94) + (float)local_7c; } local_14 = 0xffffffff; secondAnimState = &(this->_pickupHUDSprite)._animState; if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { if (*(char *)((int)local_bc + 0x1360) == '\0') { fVar22 = 1.0; } else { fVar22 = 3.0; } AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar22); } if ((this->_pickupHUDSprite)._loaded != 0) { if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) { AnimationState::Render(secondAnimState,&cursorPos,&g_vectorZero,&g_vectorZero); this_00 = &(this->_pickupHUDSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_pickupHUDSprite)._overlayAnimState,&cursorPos,&g_vectorZero,&g_vectorZero) ; this_00 = secondAnimState; } AnimationState::Render(this_00,&cursorPos,&g_vectorZero,&g_vectorZero); } local_78 = (void *)(local_90 + cursorPos.x); local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); local_f0 = (FontSettings)0x0; local_ec = 0xffff; local_e8._red = 0.0; local_e8._green = 1.0; local_e8._blue = -NAN; local_e8._alpha = 0.0; local_e8._unk = 0; local_14 = 4; KColor::SetFromARGB(&local_120,0xffffffff); pos_01.y = local_74 + 1.0; pos_01.x = (float)local_78 + 16.0; Font::DrawString((Font *)local_8c,&DAT_00c94328,pos_01,(Vector)0x3f8000003f800000,color_02, &local_f0); local_14 = 0xffffffff; cursorPos.x = (float)local_78 - local_90; local_74 = local_74 - local_94; local_78 = (void *)cursorPos.x; if (local_b8 != (Entity_Player *)0x0) { cursorPos.y = local_74 + (float)local_7c; if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(secondAnimState,15.0); } ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = (void *)(local_90 + cursorPos.x); local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); local_f0 = (FontSettings)0x0; local_ec = 0xffff; local_e8._red = 0.0; local_e8._green = 1.0; local_e8._blue = -NAN; local_e8._alpha = 0.0; local_e8._unk = 0; local_14 = 5; KColor::SetFromARGB(&local_40,0xffffffff); pos_02.y = local_74 + 1.0; pos_02.x = (float)local_78 + 16.0; Font::DrawString((Font *)local_8c,&DAT_00c94328,pos_02,(Vector)0x3f8000003f800000,color_03, &local_f0); local_78 = (void *)((float)local_78 - local_90); local_74 = local_74 - local_94; } local_14 = 0xffffffff; if (local_98 != (HUD *)0x0) { cursorPos.y = (float)local_7c + local_74; cursorPos.x = (float)local_78; if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(secondAnimState,12.0); } ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = (void *)(local_90 + cursorPos.x); local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); local_10c = (FontSettings)0x0; local_108 = 0xffff; local_104 = 0; local_100 = 0x3f800000; local_fc = 0xffffffff; local_f8 = 0; local_f4 = 0; local_14 = 6; KColor::SetFromARGB(&local_e8,0xffffffff); pos_03.y = local_74 + 1.0; pos_03.x = (float)local_78 + 16.0; Font::DrawString((Font *)local_8c,&DAT_00c94328,pos_03,(Vector)0x3f8000003f800000,color_04, &local_10c); local_78 = (void *)((float)local_78 - local_90); local_74 = local_74 - local_94; } pGVar15 = g_game; local_14 = 0xffffffff; cursorPos.x = (float)local_78; cursorPos.y = local_74; if ((((g_game->_seedEffects)._isCustomRun != 0) || (bVar3 = Seeds::AchievementUnlocksDisallowed(&g_game->_seedEffects), bVar3 != 0)) || ((bVar3 = Manager::IsGameplayInputActive(unusedArg), bVar3 != 0 || ((pGVar15->_isRerun != 0 || (isAchievementsDisabled = '\0', pGVar15->_challenge != 0)))))) { isAchievementsDisabled = '\x01'; } local_98 = (HUD *)(pGVar15->_dailyChallenge)._id; if ((local_98 == (void *)0x0) && (pGVar15->_challenge == 0)) { local_7e = '\0'; } else { local_7e = '\x01'; } iVar7 = pGVar15->_difficulty; if ((iVar7 == 1) && (local_7e == '\0')) { isHardMode = '\x01'; LAB_009a4ece: isGreedMode = '\0'; LAB_009a4ed3: isInClearedGreedBossRoom = '\0'; } else { isHardMode = '\0'; if (((iVar7 != 2) && (iVar7 != 3)) || (1 < *(int *)&pGVar15->_deathmatchManager)) goto LAB_009a4ece; isGreedMode = '\x01'; currentRoomDesc = Level::GetRoomByIdx((Level *)pGVar15,pGVar15->_currentRoomIdx,-1); if (((currentRoomDesc->ListIndex != g_game->_lastBossRoomListIdx) || ((*(byte *)(*(int *)((int)g_game->_room + 4) + 0x44) & 1) == 0)) || (g_game->_stage != 7)) goto LAB_009a4ed3; isInClearedGreedBossRoom = '\x01'; } iconFrames = (int *)0x0; local_c8 = (int *)0x0; local_c4 = (int *)0x0; local_14._0_1_ = 7; local_14._1_3_ = 0; std::vector::_Reallocate(3); if (isHardMode != '\0') { local_ac = (Entity_Player *)&DAT_00000004; if (local_c8 == local_c4) { std::vector::_Emplace_reallocate(local_c8,&local_ac); } else { *local_c8 = 4; local_c8 = local_c8 + 1; } } if (isAchievementsDisabled == '\0') { if (local_98 != (void *)0x0) goto LAB_009a500e; } else { if (local_98 == (void *)0x0) { local_ac = (Entity_Player *)&DAT_00000005; if (local_c8 != local_c4) { *local_c8 = 5; local_c8 = local_c8 + 1; goto LAB_009a504a; } } else { LAB_009a500e: local_ac = (Entity_Player *)&DAT_00000008; if (local_c8 != local_c4) { *local_c8 = 8; local_c8 = local_c8 + 1; goto LAB_009a504a; } } std::vector::_Emplace_reallocate(local_c8,&local_ac); } LAB_009a504a: if (isGreedMode != '\0') { if (isInClearedGreedBossRoom == '\0') { local_ac = (Entity_Player *)((uint)(g_game->_difficulty == 3) * 4 + 7); if (local_c8 == local_c4) goto LAB_009a50b3; *local_c8 = (int)local_ac; local_c8 = local_c8 + 1; } else { local_ac = (Entity_Player *)&DAT_00000009; if (local_c8 == local_c4) { LAB_009a50b3: std::vector::_Emplace_reallocate(local_c8,&local_ac); } else { *local_c8 = 9; local_c8 = local_c8 + 1; } } } local_7c = (Entity_Player *)g_vectorZero.x; local_b8 = (Entity_Player *)g_vectorZero.y; local_bc = local_78; if (iconFrames != local_c8) { cursorPos.y = local_74 + 16.0; pvVar17 = (void *)((int)local_c8 - (int)iconFrames >> 2); local_74 = cursorPos.y; if (pvVar17 == (void *)0x1) { if ((local_7e == '\0') && ((isGreedMode == '\0' || (6 < g_game->_stage)))) { local_7c = (Entity_Player *)0x40800000; local_b8 = (Entity_Player *)0x0; } } else if (pvVar17 == (void *)0x0) goto LAB_009a5258; local_ac = (Entity_Player *)(cursorPos.y + (float)local_b8); local_98 = (void *)0x0; pEVar8 = local_7c; do { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat (&(this->_pickupHUDSprite)._animState,(float)iconFrames[(int)local_98]); pEVar8 = local_7c; } local_d4.x = (float)pEVar8 + (float)local_78; local_d4.y = (float)local_ac; if ((this->_pickupHUDSprite)._loaded != 0) { if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_pickupHUDSprite)._animState,&local_d4,&g_vectorZero,&g_vectorZero); secondAnimState = &(this->_pickupHUDSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_pickupHUDSprite)._overlayAnimState,&local_d4,&g_vectorZero, &g_vectorZero); secondAnimState = &(this->_pickupHUDSprite)._animState; } AnimationState::Render(secondAnimState,&local_d4,&g_vectorZero,&g_vectorZero); pEVar8 = local_7c; } cursorPos.x = (float)local_78 + 16.0; local_98 = (HUD *)((int)local_98 + 1); local_78 = (void *)cursorPos.x; } while (local_98 < pvVar17); } LAB_009a5258: if (isGreedMode == '\0') { if (local_7e == '\0') { if (0 < g_game->_victoryLap) { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,10.0); } ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,s__d); local_10c = (FontSettings)0x0; local_108 = 0xffff; local_104 = 0; local_100 = 0x3f800000; local_fc = 0xffffffff; local_f8 = 0; local_f4 = 0; local_14._0_1_ = 0xb; KColor::SetFromARGB(&local_120,0xffffffff); Font::DrawString(&DAT_00c94328,extraout_ECX_01,&local_10c); local_14._0_1_ = 7; fVar22 = local_74 - local_94; cursorPos.y = fVar22; goto LAB_009a5660; } } else { pbVar10 = (this->_pickupHUDSprite)._animState._animData; if (pbVar10 == (byte *)0x0) { LAB_009a54b9: bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,(byte *)"Destination",1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_pickupHUDSprite)._animState); (this->_pickupHUDSprite)._animState._isPlaying = 1; } } else { pbVar9 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar9 = *(byte **)pbVar10; } pcVar11 = "Destination"; do { bVar3 = *pbVar9; bVar18 = bVar3 < (byte)*pcVar11; if (bVar3 != *pcVar11) { LAB_009a5498: uVar5 = -(uint)bVar18 | 1; goto LAB_009a549d; } if (bVar3 == 0) break; bVar3 = pbVar9[1]; bVar18 = bVar3 < (byte)pcVar11[1]; if (bVar3 != pcVar11[1]) goto LAB_009a5498; pbVar9 = pbVar9 + 2; pcVar11 = pcVar11 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009a549d: if ((uVar5 != 0) || ((pbVar10[0x34] != 0 && ((this->_pickupHUDSprite)._animState._isPlaying == 0)))) goto LAB_009a54b9; } challengeParams = Game::GetChallengeParams(g_game); if (challengeParams->_isMegaSatan == 0) { iVar7 = challengeParams->_pathType; if (iVar7 == 3) { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 12.0; goto LAB_009a55b3; } } else if (challengeParams->_endStage == 0xc) { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 9.0; goto LAB_009a55b3; } } else { switch(challengeParams->_endStage) { case 6: if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 0.0; goto LAB_009a55b3; } break; case 8: if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { iVar12 = 1; if (iVar7 == 2) { iVar12 = 0xb; } LAB_009a55b0: fVar22 = (float)iVar12; goto LAB_009a55b3; } break; case 10: if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { iVar12 = 3 - (uint)(iVar7 != 1); goto LAB_009a55b0; } break; case 0xb: if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { iVar12 = 5 - (uint)(iVar7 != 1); goto LAB_009a55b0; } } } } else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar22 = 6.0; LAB_009a55b3: AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar22); } local_a8.y = (float)local_b8 + local_74; local_a8.x = (float)local_7c + (float)local_78; ANM2::Render(&this->_pickupHUDSprite,&local_a8,&g_vectorZero,&g_vectorZero); pbVar10 = (this->_pickupHUDSprite)._animState._animData; if (pbVar10 != (byte *)0x0) { pbVar9 = pbVar10; if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar9 = *(byte **)pbVar10; } pbVar13 = s_Idle; do { bVar3 = *pbVar9; bVar18 = bVar3 < *pbVar13; if (bVar3 != *pbVar13) { LAB_009a5637: uVar5 = -(uint)bVar18 | 1; goto LAB_009a563c; } if (bVar3 == 0) break; bVar3 = pbVar9[1]; bVar18 = bVar3 < pbVar13[1]; if (bVar3 != pbVar13[1]) goto LAB_009a5637; pbVar9 = pbVar9 + 2; pbVar13 = pbVar13 + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009a563c: if ((uVar5 == 0) && ((pbVar10[0x34] == 0 || ((this->_pickupHUDSprite)._animState._isPlaying != 0)))) goto LAB_009a565b; } bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind(&(this->_pickupHUDSprite)._animState); (this->_pickupHUDSprite)._animState._isPlaying = 1; } } LAB_009a565b: fVar22 = local_74; goto LAB_009a5660; } local_90 = local_90 + (float)local_78; local_74 = local_94 + local_74; if (g_game->_stage < 7) { sprintf_s(&DAT_00c94328,0x10,(byte *)"%d/%d"); local_14._0_1_ = 8; LAB_009a5404: local_f4 = 0; local_f8 = 0; local_fc = 0xffffffff; local_100 = 0x3f800000; local_104 = 0; local_108 = 0xffff; local_10c = (FontSettings)0x0; KColor::SetFromARGB(&local_120,0xffffffff); Font::DrawString(&DAT_00c94328,extraout_ECX_00,&local_10c); local_14._0_1_ = 7; } else if (isInClearedGreedBossRoom != '\0') { data = &g_manager->_persistentGameData; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { local_130.y = (float)g_userProfile; local_130.x = (float)KAGE::System::UserProfile::vftable; local_14._0_1_ = 9; if (g_userProfile == (void *)0x0) { local_a8.y = 0.0; local_a8.x = 0.0; } else { local_a8.x = *(float *)((int)g_userProfile + 8); local_a8.y = *(float *)((int)g_userProfile + 0xc); } profileData = (PersistentGameData *)FUN_0090c300(&local_a8); local_14._0_1_ = 7; if (profileData != (PersistentGameData *)0x0) { data = profileData; } } pEVar8 = Game::GetPlayer(g_game,0); Entity_Player::GetGreedDonationJamChance(pEVar8,data); sprintf_s(&DAT_00c94328,0x10,&DAT_00b6d148); local_14._0_1_ = 10; goto LAB_009a5404; } fVar22 = local_74 - local_94; cursorPos.y = local_74 - local_94; LAB_009a5660: cursorPos.x = (float)local_bc; if (isStatHudHidden == '\0') { local_a8.y = fVar22 + 16.0; local_a8.x = (float)local_bc + 0.0; StatHUD::Render(&local_a8); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; if (iconFrames != (int *)0x0) { uVar5 = ((int)local_c4 - (int)iconFrames >> 2) * 4; piVar19 = iconFrames; if (0xfff < uVar5) { piVar19 = (int *)iconFrames[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)iconFrames + (-4 - (int)piVar19))) { LAB_009a56f1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar19,uVar5); } render_streak_texts(this); local_7c = (Entity_Player *)0x0; uVar5 = 0; local_8c = (Game *)this; do { pGVar15 = local_8c; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_009a5887: if (*(Entity_Player **)((HUD *)pGVar15)->_playerHUD != (Entity_Player *)0x0) { iVar7 = GetPlayerHUDLayout(this,uVar5,*(Entity_Player **)((HUD *)pGVar15)->_playerHUD); render_player_hud(uVar5,iVar7); pGVar15 = local_8c; if (uVar5 < 4) { local_7c = (Entity_Player *)((int)local_7c + 1); } } } else { uVar24 = FUN_009a84c0(); pGVar15 = (Game *)((ulonglong)uVar24 >> 0x20); if ((((int)uVar24 != 3) || (uVar5 == 0)) || (uVar5 == 4)) goto LAB_009a5887; } uVar5 = uVar5 + 1; local_8c = (Game *)(((HUD *)pGVar15)->_playerHUD + 0x6dc); } while (uVar5 < 8); if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { local_b8 = (Entity_Player *)&g_manager[1]._gamestate.field_0x8bc; local_120._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_120._alpha = 0.0; local_120._unk = 0; local_14 = 0xc; std::shared_ptr::assign(&local_120._alpha,&g_multiplayerLobbyPtr); local_120._blue = (float)KAGE::Network::Multiplayer::Lobby::vftable; local_14._1_3_ = 0; local_8c = (Game *)0x0; while (((local_14._0_1_ = 0xd, local_120._alpha != 0.0 && (local_8c < (Font *)(*(int *)((int)local_120._alpha + 0x14) - *(int *)((int)local_120._alpha + 0x10) >> 3))) && (local_7c < 4))) { local_d4.x = (float)KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create ((void *)(*(int *)((int)local_120._alpha + 0x10) + (int)local_8c * 8)); local_14._0_1_ = 0xe; local_d4.x = (float)KAGE::System::UserProfile::vftable; local_d4.y = (float)extraout_EAX_00; if (((extraout_EAX_00 != (Entity_Player *)0x0) && ((extraout_EAX_00->_damageEvents)._begin != (void *)0x0 || (extraout_EAX_00->_damageEvents)._end != (void *)0x0)) && (extraout_EAX_00->_pendingDamage == 0.0)) { KAGE::System::UserProfile::load_steam_avatar(&local_d4); } fVar22 = local_d4.y; if ((Entity_Player *)local_d4.y == (Entity_Player *)0x0) { local_a8.x = 0.0; local_a8.y = 0.0; VVar2 = local_a8; local_a8.y = 0.0; local_a8.x = 0.0; local_b0 = (void *)local_a8.x; local_ac = (Entity_Player *)local_a8.y; local_a8 = VVar2; } else { local_b0 = ((std_vector *)((int)local_d4.y + 8))->_begin; local_ac = ((std_vector *)((int)local_d4.y + 8))->_end; } pEVar8 = PlayerManager::get_player_by_user_id ((PlayerManager *)&g_manager->_netplayManager,(ulonglong *)&local_b0); if (pEVar8 == (Entity_Player *)0x0) { local_40._unk = 0xf; local_40._alpha = 1.12104e-44; statusText = (byte *******)0x4c204e49; local_40._red = (float)0x5942424f; local_40._green._0_1_ = 0; local_14 = CONCAT31(local_14._1_3_,0x10); if ((Entity_Player *)fVar22 == (Entity_Player *)0x0) { local_a8.x = 0.0; local_a8.y = 0.0; VVar2 = local_a8; local_a8.y = 0.0; local_a8.x = 0.0; local_c0 = (void *)local_a8.x; pvVar17 = (void *)local_a8.y; local_a8 = VVar2; } else { local_c0 = ((std_vector *)((int)fVar22 + 8))->_begin; pvVar17 = ((std_vector *)((int)fVar22 + 8))->_end; } local_bc = pvVar17; local_98 = local_c0; FUN_00731ee0(local_134,&local_c0); if ((((*(char *)((int)local_130.y + 0xd) == '\0') && (*(void **)((int)local_130.y + 0x14) <= pvVar17)) && ((*(void **)((int)local_130.y + 0x14) < pvVar17 || (*(void **)((int)local_130.y + 0x10) <= local_98)))) && ((void *)local_130.y != *(void **)local_b8)) { local_40._alpha = 9.80909e-45; memmove(&statusText,"WAITING",7); local_40._red = (float)((uint)local_40._red & 0xffffff); uVar5 = g_manager->_framecount & 0x78; if (0x1d < uVar5) { if (uVar5 < 0x3c) { iVar7 = 1; } else { if (0x59 < uVar5) goto LAB_009a5af4; iVar7 = 2; } do { std::string::append((char *)&statusText,&DAT_00b1cebc,1); iVar7 = iVar7 + -1; } while (iVar7 != 0); } } LAB_009a5af4: pEVar8 = local_7c; get_player_hud_position(this,&local_128,(int)local_7c,4); render_player_net_status (pEVar8,KAGE::System::UserProfile::vftable,local_d4.y,local_128.x,local_128.y); manager = g_manager; local_128.y = local_128.y + 8.0; auVar21 = ZEXT416((uint)local_128.y); local_10c = (FontSettings)0x0; local_108 = 0xffff; local_104 = 0; local_100 = 0x3f800000; local_fc = 0xffffffff; local_f8 = 0; local_f4 = 0; local_14._0_1_ = 0x11; KColor::SetFromARGB(&local_e8,0xffffffff); pppppppbVar14 = (byte *******)&statusText; if (0xf < (uint)local_40._unk) { pppppppbVar14 = statusText; } pos_04.y = auVar21._0_4_ - 14.0; pos_04.x = local_128.x; Font::DrawString(&manager->_font1_TeamMeatEx10,(byte *)pppppppbVar14,pos_04, (Vector)0x3f8000003f800000,color_05,&local_10c); local_7c = (Entity_Player *)((int)local_7c + 1); local_14._0_1_ = 0xf; if (0xf < (uint)local_40._unk) { uVar5 = local_40._unk + 1; pppppppbVar14 = statusText; if (0xfff < uVar5) { pppppppbVar14 = (byte *******)statusText[-1]; uVar5 = local_40._unk + 0x24; if ((byte *)0x1f < (byte *)((int)statusText + (-4 - (int)pppppppbVar14))) goto LAB_009a56f1; } operator_delete(pppppppbVar14,uVar5); } local_40._alpha = 0.0; local_40._unk = 0xf; statusText = (byte *******)((uint)statusText & 0xffffff00); } local_8c = (Game *)((int)local_8c + 1); local_d4.x = (float)KAGE::System::UserProfileBase::vftable; } local_120._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 0x12; if ((((int *)local_120._unk != (int *)0x0) && (cVar4 = (**(code **)(*(int *)local_120._unk + 0xc))(), cVar4 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_120._alpha); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; } local_ac = (Entity_Player *)&this->field_0x5954; local_bc = (void *)0x0; local_8c = g_game; pGVar15 = g_game; do { pvVar17 = local_bc; if ((-1 < *(int *)((int)&(pGVar15->_playerManager)._coopSlots[0]._controllerIndex + (int)local_bc)) && (-1 < *(int *)((int)&(pGVar15->_playerManager)._coopSlots[0]._state + (int)local_bc))) { local_94 = *(float *)&local_ac->field_0x0; local_90 = *(float *)&local_ac->field_0x4; local_a8.x = *(float *)&local_ac->field_0x0; local_a8.y = *(float *)&local_ac->field_0x4; if (local_94 < 0.0) { local_94 = local_94 + g_screenWidth; local_a8.x = local_94; } if (local_90 < 0.0) { local_90 = local_90 + g_screenHeight; local_a8.y = local_90; } fVar22 = *(float *)((int)&(pGVar15->_playerManager)._coopSlots[0]._menuPosition + (int)local_bc); fVar23 = fVar22 + 1.0; local_78 = (void *)(int)fVar23; pvVar16 = (void *)(int)fVar23; local_7c = (Entity_Player *)(int)(fVar22 - 1.0); if ((int)local_7c <= (int)pvVar16) { do { fVar22 = (float)(int)local_7c - *(float *)((int)&(pGVar15->_playerManager)._coopSlots[0]._menuPosition + (int)pvVar17); local_74 = fVar22 * 24.0; fVar22 = ABS(fVar22); pvVar20 = (void *)(1.0 - fVar22 * 0.5); piVar19 = (int *)(1.0 - fVar22 * 0.25); local_98 = (void *)0x0; if (0.0 <= (float)pvVar20) { local_98 = pvVar20; } local_b8 = (Entity_Player *)(int *)0x3f000000; if (0.5 <= (float)piVar19) { local_b8 = (Entity_Player *)piVar19; } if (0.0 < (float)local_98) { pvVar17 = (pGVar15->_playerManager)._coopPlayerTypes._begin; uVar5 = (int)(pGVar15->_playerManager)._coopPlayerTypes._end - (int)pvVar17 >> 2; iVar7 = *(int *)((int)pvVar17 + (((int)local_7c + uVar5) % uVar5) * 4); coopPlayerType = iVar7; if (iVar7 < 0x29) { if (((this->_coopMenuSprite)._animState._animData != (void *)0x0) && ((0 < *(int *)((int)(this->_coopMenuSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 0 < *(int *)((int)(this->_coopMenuSprite)._animState._animation + 0x80))))) { pvVar17 = (this->_coopMenuSprite)._animState._animData; local_128.y = *(float *)((int)pvVar17 + 0x38); if ((pvVar17 == (void *)0x0) || (((int)local_128.y < 0 || (*(int *)((int)pvVar17 + 0x1c) <= (int)local_128.y)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(this->_coopMenuSprite)._animState._layerFrames + (int)local_128.y * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->_coopMenuSprite)._animState,(int)local_128.y, (float)(coopPlayerType + 1)); } (this->_coopMenuSprite)._color._tint[3] = (float)local_98; fVar22 = (float)local_b8 * g_vectorOne.y; (this->_coopMenuSprite)._scale.x = (float)local_b8 * g_vectorOne.x; local_130.x = local_74 + local_94; (this->_coopMenuSprite)._scale.y = fVar22; pvVar17 = (this->_coopMenuSprite)._animState._animData; local_130.y = local_90 + 0.0; if (((pvVar17 != (void *)0x0) && (animation = (this->_coopMenuSprite)._animState._animation, 0 < animation->_layerCount)) && (iVar7 = *(int *)((int)pvVar17 + 0x38), -1 < iVar7)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar7 * 0x10 + *(int *)((int)pvVar17 + 0x18)), &local_130, *(int *)((int)(this->_coopMenuSprite)._animState._layerFrames + iVar7 * 4 ),&g_vectorZero,&g_vectorZero,animation); } } else { Color::Reset(&local_70); local_70._tint[3] = (float)local_98; portraitScaleX = (float)local_b8 * g_vectorOne.x; portraitScaleY = (float)local_b8 * g_vectorOne.y; local_c8 = (int *)(local_74 + local_94); local_70._tint[0] = 1.0; local_70._tint[1] = 1.0; local_c4 = (int *)(local_90 + 0.0); local_70._tint[2] = 1.0; render_modded_coop_portrait(iVar7,&local_c8,&portraitScaleX,&local_70); } pGVar15 = local_8c; pvVar16 = local_78; pvVar17 = local_bc; } local_7c = (Entity_Player *)((int)local_7c + 1); } while ((int)local_7c <= (int)pvVar16); pGVar15 = g_game; } (this->_coopMenuSprite)._color._tint[3] = 1.0; (this->_coopMenuSprite)._scale.x = g_vectorOne.x; (this->_coopMenuSprite)._scale.y = g_vectorOne.y; if ((this->_coopMenuSprite)._overlayAnimState._animData != (void *)0x0) { AnimationState::SetFrameFloat (&(this->_coopMenuSprite)._overlayAnimState, (float)(9 < pGVar15->_frameCount % 0x14)); } AnimationState::Render (&(this->_coopMenuSprite)._overlayAnimState,&local_a8,&g_vectorZero,&g_vectorZero); local_8c = g_game; pGVar15 = g_game; } local_bc = (void *)((int)pvVar17 + 0x14); local_ac = (Entity_Player *)&local_ac->_damageEvents; } while (local_bc < 0x50); barPos.y = cursorPos.y; barPos.x = cursorPos.x; render_boss_health_bar(this,barPos); ExceptionList = local_1c; return; } //@@ 009a6110 FUN_009a6110 void FUN_009a6110(int param_1) { int in_ECX; if ((*(int *)(in_ECX + 0x54d0) != 2) || (param_1 == 2)) { *(int *)(in_ECX + 0x54d0) = param_1; *(undefined4 *)(in_ECX + 0x54d8) = 2; } return; } //@@ 009a6140 HUD::get_player_hud_position /* DB: returns Vector for player hud param_2 from HUD+0x5954/+0x5934 tables (stride 8, hud stride 0x6dc), layout param_3 adjustments, negative coords wrap by screen size (g_screenWidth/edc), netplay offset +24; HUD::Render, render_player_hud prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall HUD::get_player_hud_position(HUD *this,Vector *outPosition,int hudIndex,int layout) { int iVar1; float fVar2; float fVar3; iVar1 = hudIndex * 0x6dc; fVar2 = *(float *)((int)(&this->_poopSpellsSprite + 1) + hudIndex * 8 + 0x28); outPosition->y = *(float *)((int)(&this->_poopSpellsSprite + 1) + hudIndex * 8 + 0x2c); outPosition->x = fVar2; if ((*(short *)(this->_playerHUD + iVar1 + 8) < 4) || (*(char *)(*(int *)(this->_playerHUD + iVar1) + 0x20a9) != '\0')) { LAB_009a61ba: if (((layout != 3) || (*(char *)(*(int *)(this->_playerHUD + iVar1) + 0x20a9) != '\0')) || ((hudIndex != 2 && (((hudIndex != 3 && (hudIndex != 6)) && (hudIndex != 7)))))) goto LAB_009a6204; fVar2 = outPosition->y - (*(float *)&this->field_0x5994 * 6.0 + 16.0); } else { if (layout != 1) { outPosition->x = *(float *)((int)(&this->_poopSpellsSprite + 1) + hudIndex * 8 + 8); outPosition->y = *(float *)((int)(&this->_poopSpellsSprite + 1) + hudIndex * 8 + 0xc); goto LAB_009a61ba; } fVar2 = *(float *)&this->field_0x5950 - 33.0; outPosition->x = *(float *)&this->field_0x594c - 64.0; } outPosition->y = fVar2; LAB_009a6204: fVar2 = outPosition->x; if (fVar2 < 0.0) { fVar2 = fVar2 + g_screenWidth; outPosition->x = fVar2; } fVar3 = outPosition->y; if (fVar3 < 0.0) { fVar3 = fVar3 + g_screenHeight; outPosition->y = fVar3; } if ((((hudIndex & 1U) != 0) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) && ((*(int *)&g_game->_deathmatchManager < 2 && ((g_manager->_optionsConfig)._onlineHud == 1))) ) { fVar2 = fVar2 + 24.0; outPosition->x = fVar2; } if (1 < *(int *)&g_game->_deathmatchManager) { if ((hudIndex & 1U) == 0) { fVar2 = fVar2 + 12.0; } else { fVar2 = fVar2 - 12.0; } outPosition->x = fVar2; } iVar1 = *(int *)(this->_playerHUD + iVar1); if (((iVar1 != 0) && (1 < (uint)hudIndex)) && (*(char *)(iVar1 + 0x20a9) == '\0')) { iVar1 = *(int *)(iVar1 + 0x13c0); if (iVar1 == 0x15) { outPosition->y = outPosition->y - 22.0; } else { if (iVar1 == 0x19) { outPosition->y = fVar3 - 22.0; return outPosition; } if (iVar1 == 0x17) { outPosition->y = fVar3 - 18.0; return outPosition; } } } return outPosition; } //@@ 009a6320 FUN_009a6320 float * FUN_009a6320(float *param_1,int param_2,int param_3) { int iVar1; int *in_ECX; uint uVar2; int *piVar3; float fVar4; float fVar5; param_1[1] = 0.0; uVar2 = 0; *param_1 = 0.0; piVar3 = in_ECX; while (iVar1 = *piVar3, iVar1 != param_2) { uVar2 = uVar2 + 1; piVar3 = piVar3 + 0x1b7; if (7 < uVar2) { return param_1; } } fVar5 = (float)in_ECX[uVar2 * 2 + 0x1655]; fVar4 = (float)in_ECX[uVar2 * 2 + 0x1656]; if (((short)(in_ECX + uVar2 * 0x1b7)[2] < 4) || (*(char *)(iVar1 + 0x20a9) != '\0')) { LAB_009a63c6: if (((param_3 == 3) && (*(char *)(iVar1 + 0x20a9) == '\0')) && ((uVar2 == 2 || (((uVar2 == 3 || (uVar2 == 6)) || (uVar2 == 7)))))) { fVar4 = fVar4 - ((float)in_ECX[0x1665] * 6.0 + 16.0); } } else { if (param_3 != 1) { fVar5 = (float)in_ECX[uVar2 * 2 + 0x164d]; fVar4 = (float)in_ECX[uVar2 * 2 + 0x164e]; goto LAB_009a63c6; } fVar5 = (float)in_ECX[0x1653] - 64.0; fVar4 = (float)in_ECX[0x1654] - 33.0; } if (fVar5 < 0.0) { fVar5 = fVar5 + g_screenWidth; } if (fVar4 < 0.0) { fVar4 = fVar4 + g_screenHeight; } if (((uVar2 & 1) == 0) || (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1))) { if (*(int *)&g_game->_deathmatchManager < 2) goto LAB_009a6483; if ((uVar2 & 1) == 0) { fVar5 = fVar5 + 12.0; goto LAB_009a6483; } } else if (*(int *)&g_game->_deathmatchManager < 2) { if ((g_manager->_optionsConfig)._onlineHud == 1) { fVar5 = fVar5 + 24.0; } goto LAB_009a6483; } fVar5 = fVar5 - 12.0; LAB_009a6483: if (((iVar1 != 0) && (1 < uVar2)) && (*(char *)(in_ECX[uVar2 * 0x1b7] + 0x20a9) == '\0')) { iVar1 = *(int *)(iVar1 + 0x13c0); if ((iVar1 == 0x15) || (iVar1 == 0x19)) { *param_1 = fVar5; param_1[1] = fVar4 - 22.0; return param_1; } if (iVar1 == 0x17) { fVar4 = fVar4 - 18.0; } } *param_1 = fVar5; param_1[1] = fVar4; return param_1; } //@@ 009a64f0 HUD::GetPlayerHudIndex /* DB: strings "HUD::GetPlayerHudIndex() recieved NULL player entity!" / "could not for a Player HUD for the giveiten player entity"; maps a twin to its main player then scans the 4 PlayerHUDs (stride 0x6dc) for it; HUD::ShowItemText, PlayerHUD::show_pill_name */ uint __thiscall HUD::GetPlayerHudIndex(HUD *this,int param_2) { uint uVar1; int iVar2; if (param_2 == 0) { KAGE_LogMessage(8,(byte *)"HUD::GetPlayerHudIndex() recieved NULL player entity! \n"); uVar1 = 0xffffffff; } else { iVar2 = *(int *)(param_2 + 0x1e68); if (((iVar2 == 0) || (*(int *)(iVar2 + 0x161c) == -1)) || (*(int *)(param_2 + 0x161c) <= *(int *)(iVar2 + 0x161c))) { iVar2 = param_2; } uVar1 = 0; while (*(int *)this->_playerHUD != iVar2) { uVar1 = uVar1 + 1; this = (HUD *)(this->_playerHUD + 0x6dc); if (3 < uVar1) { KAGE_LogMessage(4,(byte *) "HUD::GetPlayerHudIndex() could not for a Player HUD for the giveiten player entity \n" ); return 0xffffffff; } } } return uVar1; } //@@ 009a6570 HUD::GetPlayerHUDLayout /* ZHL [exact] __thiscall int HUD::GetPlayerHUDLayout(int playerHudIndex, Entity_Player* player); prototype: REPENTOGON, confirmed by RET 8 */ int __thiscall HUD::GetPlayerHUDLayout(HUD *this,int playerHudIndex,Entity_Player *player) { NetplayManager NVar1; NetplayManager NVar2; bool bVar3; byte bVar4; int iVar5; NVar1 = g_manager->_netplayManager; NVar2 = *(NetplayManager *)(g_manager + 1); if (NVar1 == NVar2) { LAB_009a65a9: bVar3 = false; if ((NVar1 != NVar2) || ((playerHudIndex != 0 && (playerHudIndex != 4)))) { LAB_009a661a: if ((player == (Entity_Player *)0x0) || ((player->_playerType != 0x13 && (player->_playerType != 0x14)))) { return 2; } bVar4 = count_player_huds(); if (2 < bVar4) { return 3; } goto joined_r0x009a663e; } } else { if (1 < *(int *)&g_game->_deathmatchManager) goto LAB_009a661a; if ((g_manager->_optionsConfig)._onlineHud != 3) goto LAB_009a65a9; bVar3 = true; } if ((player == (Entity_Player *)0x0) || ((player->_playerType != 0x13 && (player->_playerType != 0x14)))) { if (bVar3) { return 0; } iVar5 = 0; bVar4 = count_player_huds(); if (2 < bVar4) { iVar5 = 2; } return iVar5; } if (bVar3) { return 1; } bVar4 = count_player_huds(); if (3 < bVar4) { return 3; } joined_r0x009a663e: if (NVar1 == NVar2) { return 1; } return 3; } //@@ 009a6660 HUD::render_player_type_icon /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX HUD (texture at +0x592c, set up in HUD::LoadGraphics): maps player type 0..0x28 through a 41-entry table to a cell of a 6-column 32px atlas, scales x1.8 in co-op, draws a backing quad then the icon via render_quad_set_rect/apply_sprite_shader_params; Entity_Player::Render passes this->_playerType for the co-op marker, OnlinePlayerInfo::render_items */ void HUD::render_player_type_icon (uint param_1,float *param_2,float param_3,float param_4,float param_5) { int *piVar1; undefined *shader; int in_ECX; KColor *color; KColor *color_00; int *textureSlot; float unaff_ESI; int iconCell; float fStack00000018; float in_stack_00000038; float in_stack_0000003c; int in_stack_00000040; undefined1 auStackY_268 [128]; Vector *pVVar2; KColor *pKVar3; float fStack_1c4; undefined1 local_1c0 [8]; undefined1 auStack_1b8 [8]; float fStack_1b0; undefined1 local_1ac [12]; float fStack_1a0; int iStack_19c; float local_198; float local_194; float cellLeft; float cellTop; float cellRight; float local_184; float local_180; float cellBottom; float local_178; float local_174; undefined4 local_170; float fStack_16c; undefined4 uStack_168; undefined1 auStack_158 [104]; ColorMod iconColorMod; undefined1 auStack_c4 [12]; int playerIconCells [43]; uint local_c; int filterMode; filterMode = in_stack_00000040; local_c = __security_cookie ^ (uint)&fStack_1c4; playerIconCells[4] = 4; playerIconCells[5] = 5; playerIconCells[6] = 6; playerIconCells[7] = 7; playerIconCells[0x15] = 0x18; playerIconCells[0x16] = 0x19; playerIconCells[0x17] = 0x1a; playerIconCells[0x18] = 0x1b; playerIconCells[0] = 0; playerIconCells[1] = 1; playerIconCells[2] = 2; playerIconCells[3] = 3; playerIconCells[8] = 8; playerIconCells[9] = 9; playerIconCells[10] = 10; playerIconCells[0xb] = 8; playerIconCells[0xc] = 3; playerIconCells[0xd] = 0xb; playerIconCells[0xe] = 0xc; playerIconCells[0xf] = 0xd; playerIconCells[0x10] = 0xe; playerIconCells[0x11] = 0xe; playerIconCells[0x12] = 0xf; playerIconCells[0x13] = 0x10; playerIconCells[0x14] = 0x10; playerIconCells[0x25] = 0x28; playerIconCells[0x27] = 0x28; playerIconCells[0x19] = 0x1c; playerIconCells[0x1a] = 0x1d; playerIconCells[0x1b] = 0x1e; playerIconCells[0x1c] = 0x1f; playerIconCells[0x26] = 0x20; playerIconCells[0x21] = 0x24; playerIconCells[0x22] = 0x25; playerIconCells[0x23] = 0x26; playerIconCells[0x24] = 0x27; playerIconCells[0x28] = 0x26; playerIconCells[0x1d] = 0x20; playerIconCells[0x1e] = 0x21; playerIconCells[0x1f] = 0x22; playerIconCells[0x20] = 0x23; if (param_1 < 0x29) { iconCell = playerIconCells[param_1]; } else { iconCell = 0; } local_170 = CONCAT31(local_170._1_3_,1); cellTop = (float)(iconCell / 6) * 32.0; cellLeft = (float)(iconCell % 6) * 32.0; cellBottom = cellTop + 32.0; cellRight = cellLeft + 32.0; local_1c0._0_4_ = in_stack_00000038; if (1 < *(int *)&g_game->_deathmatchManager) { local_1c0._0_4_ = in_stack_00000038 * 1.8; } local_1c0._0_4_ = (float)local_1c0._0_4_ * 16.0; textureSlot = (int *)(in_ECX + 0x592c); fStack00000018 = in_stack_0000003c; piVar1 = (int *)*textureSlot; local_198 = (float)local_1c0._0_4_; local_194 = (float)local_1c0._0_4_; local_184 = cellTop; local_180 = cellLeft; local_178 = cellRight; local_174 = cellBottom; if ((in_stack_00000040 != piVar1[0xc]) || (in_stack_00000040 != piVar1[0xd])) { (**(code **)(*piVar1 + 0x44))(); piVar1[0xc] = filterMode; piVar1[0xd] = filterMode; } shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } g_currentShader = shader; KColor::SetFromARGB((KColor *)local_1ac,0xffffffff); auStack_1b8._4_4_ = (float)local_1c0._0_4_ + 4.0; local_1c0._0_4_ = (float)local_1c0._0_4_ * 0.5; pVVar2 = (Vector *)(auStack_1b8 + 4); local_1c0._4_4_ = (*param_2 - (float)local_1c0._0_4_) - 2.0; auStack_1b8._0_4_ = (param_2[1] - (float)local_1c0._0_4_) - 2.0; pKVar3 = color; fStack_1b0 = (float)auStack_1b8._4_4_; render_quad_set_rect(auStack_158,(Vector *)(local_1c0 + 4),pVVar2,color); KAGE::SmartPointer::operator_assign(auStackY_268 + 0x90,textureSlot); apply_sprite_shader_params((ColorMod *)¶m_3,1,pVVar2,pKVar3); iStack_19c = 0; local_1ac._0_4_ = param_3; local_1ac._4_4_ = param_4; local_1ac._8_4_ = param_5; fStack_1a0 = fStack00000018; (**(code **)(*(int *)*textureSlot + 0x14))(); KColor::SetFromARGB((KColor *)auStack_1b8,0xffffffff); pVVar2 = (Vector *)(local_1ac + 8); fStack_1c4 = param_2[1] - unaff_ESI; pKVar3 = color_00; render_quad_set_rect(auStack_c4,(Vector *)(local_1c0 + -8),pVVar2,color_00); fStack_16c = in_stack_0000003c; uStack_168 = 0; iconColorMod._colorize[0] = 0.0; iconColorMod._colorize[1] = 0.0; iconColorMod._colorize[2] = 0.0; iconColorMod._colorize[3] = 0.0; local_178 = 1.0; local_174 = 1.0; local_170 = 0x3f800000; iconColorMod._tint[0] = 1.0; iconColorMod._tint[1] = 1.0; iconColorMod._tint[2] = 1.0; iconColorMod._tint[3] = 1.0; iconColorMod._offset[0] = 0.0; iconColorMod._offset[1] = 0.0; iconColorMod._offset[2] = 0.0; KAGE::SmartPointer::operator_assign(auStackY_268 + 0x84,textureSlot); apply_sprite_shader_params(&iconColorMod,1,pVVar2,pKVar3); (**(code **)(*(int *)*textureSlot + 0x14))(&iStack_19c); return; } //@@ 009a6a70 HUD::render_streak_texts /* DB: ? HUD::Render: per-player text slots (FUN_00840e10 set position, 35 px rows from screen top/bottom 48), player colours via PlayerManager::GetPlayerColorValue, flag mainAnimState+0xf39*4 prototype: db/protos.zhl */ void __thiscall HUD::render_streak_texts(HUD *mainAnimState) { char *pcVar1; byte bVar2; int iVar3; int *controllerIdPtr; uint uVar4; uint uVar5; AnimationState *laterAnimState; float *nullFrame; uint i; HUD_Message *message; HUD *pHVar6; float fVar7; Vector textPos; HUD *hud; HUD *local_b8; Vector local_b4; float centerX; Vector local_a8; KColor color; undefined1 quad [124]; bool isJacobOrEsau; AnimationState *mainAnimState; int texHeight; centerX = g_screenWidth * 0.5; pHVar6 = (HUD *)0x42400000; local_b8 = (HUD *)0x42400000; hud = mainAnimState; if (mainAnimState->field_0x3ce4 != '\0') { if (mainAnimState->field_0x3ce5 == '\0') { local_b4.y = g_screenHeight - 48.0; } else { local_b4.y = 48.0; } textPos.y = local_b4.y; textPos.x = centerX; local_b4.x = centerX; FUN_00840e10(centerX,local_b4.y); if (mainAnimState->field_0x3ce5 == '\0') { pHVar6 = (HUD *)0x42a60000; local_b8 = (HUD *)0x42a60000; } else { pHVar6 = (HUD *)0x42400000; } } i = 0; message = mainAnimState->_messageStack; do { if (*(char *)(message + 2) != '\0') { textPos.x = centerX + 0.0; textPos.y = (float)((double)(int)i + __uint_to_double_fixup[-((int)i >> 0x1f)]) * 35.0 + (float)pHVar6; FUN_00840e10(textPos.x,textPos.y); } i = i + 1; message = message + 0x7d; pHVar6 = local_b8; } while (i < 6); i = 0; local_a8.x = (float)(hud->_messagePlayerHUD + 2); pHVar6 = hud; local_b8 = hud; do { message = (HUD_Message *)local_a8.x; fVar7 = 35.0; if (*(char *)local_a8.x != '\0') { if (*(int *)local_b8->_playerHUD == 0) { HUD_Message::free_text_buffers((HUD_Message *)((int)local_a8.x + -8)); *(char *)message = '\0'; } else { get_player_hud_position(pHVar6,&textPos,i,2); iVar3 = *(int *)(*(int *)local_b8->_playerHUD + 0x13c0); if ((iVar3 == 0x13) || (iVar3 == 0x14)) { isJacobOrEsau = true; } else { isJacobOrEsau = false; } if (i < 2) { iVar3 = 0x23; if (isJacobOrEsau) { iVar3 = 0x41; } textPos.y = (float)iVar3 + textPos.y; if (i != 0) goto LAB_009a6dfc; LAB_009a6c53: textPos.x = textPos.x + fVar7; } else { iVar3 = 0x1e; if (isJacobOrEsau) { iVar3 = 0x32; } textPos.y = textPos.y - (float)iVar3; LAB_009a6dfc: if (i == 2) goto LAB_009a6c53; textPos.x = textPos.x + 20.0; } iVar3 = 0; controllerIdPtr = (int *)&(g_game->_playerManager).field_0x60; do { if (*controllerIdPtr == *(int *)(*(int *)local_b8->_playerHUD + 0x1618)) goto LAB_009a6c87; iVar3 = iVar3 + 1; controllerIdPtr = controllerIdPtr + 1; } while (iVar3 < 4); iVar3 = 5; LAB_009a6c87: PlayerManager::GetPlayerColorValue(&color,iVar3); uVar4 = __ftoui3(); iVar3 = __ftoui3(); uVar5 = __ftoui3(); local_b4.x = (float)(((uVar4 & 0xff | iVar3 << 8) << 8 | uVar5 & 0xff) << 8); bVar2 = __ftoui3(); message = (HUD_Message *)local_a8.x; color._red = ((float)(uVar4 & 0xff) + 0.0) / 255.0; color._green = ((float)(uVar5 & 0xff) + 0.0) / 255.0; color._blue = ((float)bVar2 + 0.0) / 255.0; color._alpha = ((float)((iVar3 << 8 & 0xffffU) >> 8) + 0.0) / 255.0; *(float *)((int)local_a8.x + 300) = color._red; *(float *)((int)local_a8.x + 0x130) = color._green; *(float *)((int)local_a8.x + 0x134) = color._blue; *(float *)((int)local_a8.x + 0x138) = color._alpha; pcVar1 = (char *)((int)local_a8.x + 0x13c); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; FUN_00840e10(textPos.x,textPos.y); } pHVar6 = hud; } i = i + 1; local_b8 = (HUD *)(local_b8->_playerHUD + 0x6dc); local_a8.x = (float)(message + 0x7d); if (3 < i) { if (((pHVar6->_fortuneSprite)._animState._animData != (void *)0x0) && ((pHVar6->_fortuneSprite)._animState._isPlaying != 0)) { textPos.x = centerX; textPos.y = 64.0; if ((pHVar6->_fortuneSprite)._loaded != 0) { mainAnimState = &(pHVar6->_fortuneSprite)._animState; laterAnimState = &(pHVar6->_fortuneSprite)._overlayAnimState; if ((pHVar6->_fortuneSprite)._overlayRenderFirst == 0) { AnimationState::Render(mainAnimState,&textPos,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render(laterAnimState,&textPos,&g_vectorZero,&g_vectorZero); laterAnimState = mainAnimState; } AnimationState::Render(laterAnimState,&textPos,&g_vectorZero,&g_vectorZero); pHVar6 = hud; } if ((pHVar6->_fortuneSprite)._animState._animData == (void *)0x0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrameById(&(pHVar6->_fortuneSprite)._animState,0); pHVar6 = hud; } color._unk = 0; iVar3 = *(int *)(*(int *)&pHVar6->field_0x536c + 0x10); texHeight = *(int *)(*(int *)&pHVar6->field_0x536c + 0x14); local_b4.x = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * nullFrame[4]; local_b4.y = (float)((double)texHeight + __uint_to_double_fixup[-(texHeight >> 0x1f)]) * nullFrame[5]; local_a8.x = ((textPos.x + *nullFrame) - local_b4.x * 0.5) + (g_game->_screenShakeOffset).x; local_a8.y = ((textPos.y + nullFrame[1]) - 16.0) + (g_game->_screenShakeOffset).y; color._red = 1.0; color._green = 1.0; color._blue = 1.0; color._alpha = 1.0; render_quad_set_rect(quad,&local_a8,&local_b4,&color); (**(code **)(**(int **)&hud->field_0x536c + 0x1c))(quad,g_drawRectUnset); } return; } } while( true ); } //@@ 009a6fe0 HUD::render_player_hud /* DB: ? HUD::Render calls it per player index; this+idx*0x6dc PlayerHUD, draws hearts (00843df0), RenderSpellQueue, coop ghost alpha */ void HUD::render_player_hud(int param_1,int param_2) { void *pvVar1; Vector pos; char cVar2; int iVar3; HUD *in_ECX; PlayerHUD *this; uint trinketSlot; float fVar4; Vector *alpha; float fVar5; float unused; Vector *local_40; int *trinketEntry; int *trinketEntrySmall; Vector local_30; Vector local_28; Vector hudPos; Vector trinket1Pos; Vector heartsExtent; bool isAnyTrinketDrawn; bool isNetplayCompactHud; void *twinPlayer; get_player_hud_position(in_ECX,&hudPos,param_1,param_2); this = (PlayerHUD *)(in_ECX->_playerHUD + param_1 * 0x6dc); local_30.x = (float)(uint)(ushort)this->_playerHudIndex; pvVar1 = this->_player; if (pvVar1 == (void *)0x0) { return; } local_28.x = local_30.x; if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (((((twinPlayer = *(void **)((int)pvVar1 + 0x1e68), twinPlayer == (void *)0x0 || (*(int *)((int)twinPlayer + 0x161c) == -1)) || (*(int *)((int)pvVar1 + 0x161c) <= *(int *)((int)twinPlayer + 0x161c))) || (twinPlayer == pvVar1)) && (iVar3 = FUN_0090b010(*(undefined4 *)((int)pvVar1 + 0x1618)), iVar3 != 0)))) { render_player_net_status (param_1,KAGE::System::UserProfile::vftable,*(undefined4 *)(iVar3 + 0x374),hudPos.x, hudPos.y); } pos.y = hudPos.y; pos.x = hudPos.x; PlayerHUD::RenderHearts(this,&heartsExtent,&in_ECX->_heartsSprite,param_2,1.0,pos); if (((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (*(int *)&g_game->_deathmatchManager < 2)) && (((g_manager->_optionsConfig)._onlineHud == 2 && ((param_1 != 0 && (param_1 != 4)))))) { return; } if (*(int *)((int)pvVar1 + 0x2c) != 0) { return; } fVar4 = 1.0; local_40 = (Vector *)0x3f800000; if ((*(int *)((int)pvVar1 + 0x13c0) == 0x13) || (*(int *)((int)pvVar1 + 0x13c0) == 0x14)) { if ((g_manager->_optionsConfig)._jacobEsauControls == 0) { if (*(int *)((int)pvVar1 + 0x1e68) != 0) { local_40 = (Vector *)(1.0 - *(float *)&this[1]._playerHudIndex * 0.7); } } else { fVar5 = *(float *)&this[1]._playerHudIndex * 0.7; cVar2 = FUN_00753bf0(); if (cVar2 == '\0') { local_40 = (Vector *)(fVar5 + 0.3); } else { local_40 = (Vector *)(fVar4 - fVar5); } } } if (*(char *)((int)pvVar1 + 0x202c) != '\0') { local_40 = (Vector *)0x3e4ccccd; } alpha = local_40; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_009a71e5: isNetplayCompactHud = false; } else { iVar3 = FUN_009a84c0(); if (((iVar3 != 1) || (param_1 == 0)) || (param_1 == 4)) goto LAB_009a71e5; isNetplayCompactHud = true; } if (param_2 == 0) { local_28.x = hudPos.x - 53.0; local_30.x = hudPos.y - 12.0; local_28.y = local_30.x; PlayerHUD::RenderActiveItem(this,1,&local_28,0,1.0,(float)alpha,0); hudPos.x = hudPos.x - 44.0; hudPos.y = local_30.x; fVar4 = 1.0; PlayerHUD::RenderActiveItem(this,0,&hudPos,0,1.0,(float)local_40,0); trinketSlot = 1; hudPos.x = *(float *)&in_ECX->field_0x5944 + 44.0; trinket1Pos.x = *(float *)&in_ECX->field_0x5944 + 20.0; local_40 = &trinket1Pos; hudPos.y = ((g_screenHeight - 28.0) - 16.0) + *(float *)&in_ECX->field_0x5948; trinket1Pos.y = ((g_screenHeight - 52.0) - 16.0) + *(float *)&in_ECX->field_0x5948; do { PlayerHUD::RenderTrinket(this,trinketSlot,local_40,fVar4,1.0,0); local_40 = local_40 + -1; trinketSlot = trinketSlot - 1; } while (-1 < (int)trinketSlot); if (*(int *)((int)pvVar1 + 0x13c0) == 0x15) { hudPos.x = *(float *)&in_ECX->field_0x5934 + 58.0; hudPos.y = *(float *)&in_ECX->field_0x5938 + 45.0; PlayerHUD::render_inventory(); } else if (*(int *)((int)pvVar1 + 0x13c0) == 0x19) { hudPos.x = *(float *)&in_ECX->field_0x5934 + 58.0; hudPos.y = *(float *)&in_ECX->field_0x5938 + 49.0; PlayerHUD::RenderSpellQueue(this,&hudPos,1.0); } hudPos.x = (g_screenWidth - 28.0) + *(float *)&in_ECX->field_0x594c; hudPos.y = (g_screenHeight - 18.0) + *(float *)&in_ECX->field_0x5950; PlayerHUD::RenderPocketItems(); return; } if ((local_30.x._0_2_ < 4) || (param_2 != 1)) { if (param_2 == 3) { if (local_28.x._0_2_ < 4) { fVar4 = hudPos.x; fVar5 = hudPos.y; } else { fVar4 = hudPos.x + 0.0; fVar5 = hudPos.y + 32.0; } local_30.x = fVar4 - 34.0; local_30.y = fVar5 - 8.0; local_28.x = local_30.y; PlayerHUD::RenderActiveItem(this,1,&local_30,3,0.5,(float)alpha,0); local_30.x = fVar4 - 25.0; local_30.y = local_28.x; unused = 0.5; PlayerHUD::RenderActiveItem(this,0,&local_30,3,0.5,(float)local_40,0); fVar4 = fVar4 - 12.0; fVar5 = fVar5 + 20.0; hudPos.x = fVar4; hudPos.y = fVar5; iVar3 = FUN_009a84c0(); if (((iVar3 == 1) && (param_1 != 0)) && (param_1 != 4)) { hudPos.y = fVar5 - 8.0; fVar4 = fVar4 + 0.0; hudPos.x = fVar4; } trinketEntrySmall = (int *)&this->field_0x218; trinketSlot = 1; do { if (*trinketEntrySmall != 0) { PlayerHUD::RenderTrinket(this,trinketSlot,&hudPos,unused,0.5,1); fVar4 = hudPos.x + 16.0; hudPos.x = fVar4; } trinketEntrySmall = trinketEntrySmall + -6; trinketSlot = trinketSlot - 1; } while (-1 < (int)trinketSlot); hudPos.x = fVar4 - 2.0; hudPos.y = hudPos.y + 1.0; goto LAB_009a7996; } local_30.x = hudPos.x - 45.0; local_30.y = hudPos.y - 16.0; PlayerHUD::RenderActiveItem(this,1,&local_30,param_2,1.0,(float)alpha,0); local_30.x = hudPos.x - 44.0; local_30.y = hudPos.y - 12.0; fVar4 = 1.0; PlayerHUD::RenderActiveItem(this,0,&local_30,param_2,1.0,(float)local_40,0); local_30.x = hudPos.x + 0.0; isAnyTrinketDrawn = false; local_28.y = hudPos.y + 22.0; if (isNetplayCompactHud) { local_28.y = local_28.y - 9.0; } local_40 = (Vector *)&this->field_0x218; trinketSlot = 1; local_28.x = local_30.x; do { if (*(int *)local_40 != 0) { PlayerHUD::RenderTrinket(this,trinketSlot,&local_28,fVar4,0.5,1); local_28.x = local_28.x + 16.0; isAnyTrinketDrawn = true; } local_40 = (Vector *)((int)local_40 + -0x18); trinketSlot = trinketSlot - 1; } while (-1 < (int)trinketSlot); if (*(int *)((int)pvVar1 + 0x13c0) == 0x15) { local_30.x = local_30.x + *(float *)&in_ECX->field_0x5934; local_30.y = hudPos.y + 33.0 + *(float *)&in_ECX->field_0x5938; PlayerHUD::render_inventory(); } else if (*(int *)((int)pvVar1 + 0x13c0) == 0x19) { local_30.x = local_30.x + *(float *)&in_ECX->field_0x5934; local_30.y = hudPos.y + 39.0 + *(float *)&in_ECX->field_0x5938; PlayerHUD::RenderSpellQueue(this,&local_30,1.0); } local_28.x = local_28.x - 3.0; if (isAnyTrinketDrawn) { local_28.x = local_28.x - 3.0; } } else { local_30.x = hudPos.x + 28.0; local_30.y = hudPos.y - 16.0; PlayerHUD::RenderActiveItem(this,1,&local_30,1,1.0,(float)alpha,0); local_30.x = hudPos.x + 12.0; local_30.y = hudPos.y - 12.0; fVar5 = 1.0; PlayerHUD::RenderActiveItem(this,0,&local_30,1,1.0,(float)local_40,0); trinketEntry = (int *)&this->field_0x218; fVar4 = hudPos.x + 0.0; trinketSlot = 1; local_28.y = hudPos.y + 20.0; local_28.x = fVar4; do { if (*trinketEntry != 0) { PlayerHUD::RenderTrinket(this,trinketSlot,&local_28,fVar5,0.5,1); fVar4 = local_28.x - 16.0; local_28.x = fVar4; } trinketEntry = trinketEntry + -6; trinketSlot = trinketSlot - 1; } while (-1 < (int)trinketSlot); local_28.x = fVar4 + 0.0; if (((*(int *)((int)pvVar1 + 0x17a4) == 0) || (*(int *)((int)pvVar1 + 0x17a4) == 1)) && (*(int *)((int)pvVar1 + 0x17a0) == 0)) { return; } } local_28.y = local_28.y + 1.0; LAB_009a7996: PlayerHUD::RenderPocketItems(); return; } //@@ 009a79b0 HUD::render_player_net_status /* DB: ECX = HUD, player hud stride 0x6dc: in netplay, for a remote player (peer vslot 0x14 false) lazily loads "gfx/ui/online/colored_dots.png" and draws an 8x8 dot frame (FUN_00902530 index) at the hud position; HUD::Render, HUD::render_player_hud */ void HUD::render_player_net_status (int param_1,undefined4 param_2,int param_3,float param_4,float param_5) { Vector VVar1; char isLocalPeer; uint uVar2; int iVar3; void *dotsImage; int dotIndex; byte *displayName; KColor *color; int in_ECX; undefined4 extraout_ECX; float fVar4; int *playerHud; Font *font; float fVar5; float local_60; float local_5c; float local_58; float local_54; float local_50; float local_4c; float local_48; float local_44; undefined4 local_40; KColor drawColor; Vector local_28; Vector drawPos; void *local_10; undefined1 *puStack_c; undefined4 local_8; code *renderFn; puStack_c = &LAB_00b0dd8d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; playerHud = (int *)(param_1 * 0x6dc + in_ECX); local_8 = 0; if ((*playerHud != 0) && (iVar3 = FUN_0090b010(*(undefined4 *)(*playerHud + 0x1618)), iVar3 != 0)) { if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (isLocalPeer = (**(code **)(*(int *)(iVar3 + 0x370) + 0x14))(uVar2), isLocalPeer == '\0')) { if (playerHud[0x1b3] == 0) { dotsImage = Manager::LoadImage(&local_28,(byte *)"gfx/ui/online/colored_dots.png"); local_8._0_1_ = 1; KAGE::SmartPointer::operator_assign(playerHud + 0x1b3,dotsImage); local_8 = (uint)local_8._1_3_ << 8; FUN_0040c440(); } local_50 = 0.0; local_60 = 0.0; local_54 = 0.0; local_5c = 0.0; local_48 = 14.0; local_58 = 14.0; local_44 = 8.0; local_4c = 8.0; local_40 = CONCAT31(local_40._1_3_,1); dotIndex = FUN_00902530(); local_60 = local_60 + 0.0; fVar5 = (float)(dotIndex << 3); local_5c = fVar5 + local_5c; local_58 = local_58 + 0.0; local_54 = fVar5 + local_54; local_50 = local_50 + 0.0; local_4c = fVar5 + local_4c; local_44 = fVar5 + local_44; local_48 = local_48 + 0.0; renderFn = *(code **)(*(int *)playerHud[0x1b3] + 0x18); KColor::SetFromARGB(&drawColor,0xffffffff); drawPos.x = param_4 - 7.0; drawPos.y = param_5 - 18.0; (*renderFn)(&local_60,&drawPos,extraout_ECX); } isLocalPeer = (**(code **)(*(int *)(iVar3 + 0x370) + 0x14))(); param_4 = (float)(int)((uint)(isLocalPeer == '\0') * 8 + -6) + param_4; } drawPos.y = param_5 - 16.0; drawPos.x = param_4; if (param_1 != 0) { drawPos.x = param_4 + 8.0; } font = &g_manager->_font1_TeamMeatEx10; if (param_3 == 0) { local_28.x = 0.0; local_28.y = 0.0; VVar1 = local_28; local_28.y = 0.0; local_28.x = 0.0; fVar5 = local_28.y; fVar4 = local_28.x; local_28 = VVar1; } else { fVar5 = *(float *)(param_3 + 0xc); fVar4 = *(float *)(param_3 + 8); } displayName = user_profile_format_display_name(CONCAT44(fVar5,fVar4),font,0x8c); local_58 = 0.0; local_54 = 9.18341e-41; local_50 = 0.0; local_4c = 1.0; local_48 = -NAN; local_44 = 0.0; local_40 = 0; local_8 = CONCAT31(local_8._1_3_,2); KColor::SetFromARGB(&drawColor,0xffffffff); local_28.x = 0.5; local_28.y = 0.5; Font::DrawString(font,displayName,&drawPos,&local_28,color,&local_58); ExceptionList = local_10; return; } //@@ 009a7c90 HUD::render_boss_health_bar /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? last call of HUD::Render: centred (screen-148)/2 bar 110 px * fill +0x5490, top/bottom by +0x5998, sprites +0x54a0/+0x54a8, skips Home (stage 0x23) room; optional "%d/%d" counter from shorts +0x54b8/+0x54ba prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall HUD::render_boss_health_bar(HUD *this,Vector barPos) { int iVar1; code *pcVar2; char cVar3; uint uVar4; KColor *color; int unused; KColor *color_00; KColor *color_01; float fillYOffset; undefined1 auStackY_2d4 [128]; void *in_stack_fffffdb0; void *pvVar5; void *other; undefined1 auStack_23a [2]; undefined1 fillQuad [112]; undefined1 frameQuad [112]; undefined1 counterQuad [116]; undefined1 fillSourceQuad [36]; undefined1 frameSourceQuad [36]; undefined4 fontSettings; undefined4 local_8c; float local_88; float fStack_84; float fStack_80; float fStack_7c; undefined4 local_78; KColor whiteColor; Vector local_60; int *barImage; int *barImageRefCount; Vector local_50; Color barColor; Vector local_1c; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Manager *manager; int *roomConfig; local_8 = -NAN; puStack_c = &LAB_00b0ddc8; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)((&barColor)[1]._colorize + 2); fillYOffset = 0.0; if (0.0 <= this->_bossHPBarFill) { iVar1 = *(int *)((int)g_game->_room + 0x1bb0); if (((iVar1 != 0x37) && (iVar1 != 0x58)) && ((roomConfig = *(int **)(*(int *)((int)g_game->_room + 4) + 0x10), roomConfig == (int *)0x0 || ((roomConfig[2] != 0x10 || (*roomConfig != 0x23)))))) { local_50.y = (float)&DAT_42000000; ExceptionList = &local_10; if (iVar1 == 0x53) { local_50.x = 64.0; barPos.x = (g_screenWidth - 64.0) * 0.5; if ((this->field_0x549c == '\0') && ((g_manager->_optionsConfig)._bossHpOnBottom == 0)) { barPos.y = 8.0 - *(float *)&this->field_0x5998; } else { barPos.y = ((g_screenHeight - 32.0) - 8.0) + *(float *)&this->field_0x5998; } KColor::SetFromARGB(&whiteColor,0xffffffff); render_quad_set_rect(counterQuad,&barPos,&local_50,color); pcVar2 = *(code **)(**(int **)&this->field_0x54bc + 0x1c); KColor::SetFromARGB(&whiteColor,0xffffffff); (*pcVar2)(); sprintf_s((byte *)&local_1c,8,(byte *)"%d/%d"); manager = g_manager; fontSettings = 0; local_8c = 0xffff; local_88 = 0.0; fStack_84 = 1.0; fStack_80 = -NAN; fStack_7c = 0.0; local_78 = 0; local_8 = 0.0; KColor::SetFromARGB(&whiteColor,0xffffffff); Font::get_string_width_n(&manager->_font6_PFTempestaSevenCondensed,(byte *)&local_1c,-1); Font::DrawString(); ExceptionList = local_10; return; } local_50.x = 148.0; barPos.x = (g_screenWidth - 148.0) * 0.5; if ((this->field_0x549c == '\0') && ((g_manager->_optionsConfig)._bossHpOnBottom == 0)) { barPos.y = 8.0 - *(float *)&this->field_0x5998; } else { barPos.y = ((g_screenHeight - 32.0) - 8.0) + *(float *)&this->field_0x5998; } local_1c.x = 0.0; local_1c.y = (float)&DAT_42000000; quad_set_rect(frameSourceQuad,&local_1c,&local_50,iVar1); local_1c.x = this->_bossHPBarFill * 110.0; local_1c.y = (float)&DAT_42000000; local_60.x = 20.0; local_60.y = 0.0; quad_set_rect(fillSourceQuad,&local_60,&local_1c,unused); KColor::SetFromARGB(&whiteColor,0xffffffff); render_quad_set_rect(frameQuad,&barPos,&local_50,color_00); KColor::SetFromARGB(&whiteColor,0xffffffff); local_60.x = this->_bossHPBarFill * 110.0; local_50.x = barPos.x + 20.0; local_50.y = barPos.y + fillYOffset; local_60.y = (float)&DAT_42000000; render_quad_set_rect(fillQuad,&local_50,&local_60,color_01); Color::Color(&barColor); pvVar5 = (void *)0x9a800c; KAGE::SmartPointer::operator_assign(&barImage,&this->field_0x54a0); local_8 = 1.4013e-45; iVar1 = *(int *)((int)g_game->_room + 8); if (((iVar1 != 5) && (iVar1 != 0x11)) && (iVar1 != 0xb)) { pvVar5 = (void *)0x9a8037; uVar4 = Game::GetStageID(g_game,(byte)g_game); if (uVar4 != 0x23) { pvVar5 = (void *)0x9a804b; KAGE::SmartPointer::operator_assign(&barImage,&this->field_0x54a8); } } local_1c.y = *(float *)((int)g_game->_room + 0x1d18); if (local_1c.y == 7.56701e-44) { shader_stack_push(); uVar4 = g_game->_frameCount & 0x800000ff; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xffffff00) + 1; } other = &this->field_0x54b0; barColor._colorize[3] = (float)(int)uVar4 * 0.00390625; pvVar5 = (void *)0x9a80a9; KAGE::SmartPointer::operator_assign(&barImage,other); } else { other = (void *)0x9a80b2; shader_stack_push(); } KAGE::SmartPointer::operator_assign(auStack_23a + -10,&barImage); apply_sprite_shader_params((ColorMod *)&barColor,1,pvVar5,other); pcVar2 = *(code **)(*barImage + 0x14); KColor::SetFromARGB(&whiteColor,0xffffffff); pvVar5 = (void *)0x9a80f1; (*pcVar2)(); if (this->_bossHPBarHealFlash < 1) { if (-1 < this->_bossHPBarDamageFlash) { uVar4 = this->_bossHPBarDamageFlash & 0x80000001; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffe) + 1; } if (uVar4 != 1) { if (local_1c.y == 7.56701e-44) { barColor._tint[0] = 1.0; barColor._tint[1] = 0.6; barColor._tint[2] = 0.6; } else { barColor._tint[0] = 0.48; barColor._tint[1] = 0.0; barColor._tint[2] = 0.0; } goto LAB_009a8185; } } if (local_1c.y == 7.56701e-44) { barColor._tint[0] = 1.0; barColor._tint[1] = 1.0; barColor._tint[2] = 1.0; } else { barColor._tint[0] = 0.8; barColor._tint[1] = 0.0; barColor._tint[2] = 0.0; } } else { uVar4 = this->_bossHPBarHealFlash & 0x80000001; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffffe) + 1; } if (uVar4 == 1) { if (local_1c.y == 7.56701e-44) { barColor._tint[0] = 1.0; barColor._tint[1] = 0.8; barColor._tint[2] = 0.6; } else { barColor._tint[0] = 0.87; barColor._tint[1] = 0.4; barColor._tint[2] = 0.0; } } else if (local_1c.y == 7.56701e-44) { barColor._tint[0] = 1.0; barColor._tint[1] = 0.95; barColor._tint[2] = 0.8; } else { barColor._tint[0] = 0.6; barColor._tint[1] = 0.25; barColor._tint[2] = 0.0; } } LAB_009a8185: barColor._tint[3] = 1.0; KAGE::SmartPointer::operator_assign(auStackY_2d4 + 0x84,&barImage); apply_sprite_shader_params((ColorMod *)&barColor,1,in_stack_fffffdb0,pvVar5); local_78 = 0; local_88 = barColor._tint[0]; fStack_84 = barColor._tint[1]; fStack_80 = barColor._tint[2]; fStack_7c = barColor._tint[3]; (**(code **)(*barImage + 0x14))(fillSourceQuad); FUN_00682350(); local_8 = 2.8026e-45; if (barImageRefCount == (int *)0x0) { ExceptionList = local_10; return; } cVar3 = (**(code **)(*barImageRefCount + 0xc))(); if (cVar3 == '\0') { ExceptionList = local_10; return; } if (g_imageReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } (*g_imageReleaseFn)(); ExceptionList = local_10; return; } } this->field_0x549c = 0; return; } //@@ 009a8230 HUD::update_hud_offset /* DB: recomputes the HUD corner offsets +0x5934..+0x5998 from 1 - Manager+0x2a388 (Options HUD offset) times 12/14/16/20/22/24; HUD::Render */ void HUD::update_hud_offset(void) { float fVar1; int in_ECX; float fVar2; float fVar3; float fVar4; fVar2 = 1.0 - (g_manager->_optionsConfig)._hudOffset; *(float *)(in_ECX + 0x5994) = fVar2; *(float *)(in_ECX + 0x5940) = fVar2 * -12.0; fVar1 = *(float *)(in_ECX + 0x5994); *(float *)(in_ECX + 0x5938) = fVar2 * -12.0; fVar3 = fVar1 * 6.0; fVar4 = fVar1 * 16.0; *(float *)(in_ECX + 0x5998) = fVar1 * 12.0; *(float *)(in_ECX + 0x5958) = fVar2 * -12.0 + 30.0; *(float *)(in_ECX + 0x59a0) = fVar1 * -14.0; *(float *)(in_ECX + 0x5960) = *(float *)(in_ECX + 0x5938) + 30.0; *(float *)(in_ECX + 0x5934) = fVar2 * -20.0; *(float *)(in_ECX + 0x593c) = fVar2 * 24.0; *(float *)(in_ECX + 0x5944) = fVar1 * -22.0; *(float *)(in_ECX + 0x5968) = fVar3 - 33.0; *(float *)(in_ECX + 0x5948) = fVar4; *(float *)(in_ECX + 0x594c) = fVar4; *(float *)(in_ECX + 0x5950) = fVar3; *(float *)(in_ECX + 0x599c) = fVar4; *(float *)(in_ECX + 0x5954) = fVar2 * -20.0 + 68.0; *(float *)(in_ECX + 0x595c) = fVar2 * 24.0 - 151.0; *(float *)(in_ECX + 0x5964) = fVar1 * -22.0 + 80.0; *(float *)(in_ECX + 0x596c) = fVar4 - 151.0; *(float *)(in_ECX + 0x5970) = fVar3 - 33.0; *(float *)(in_ECX + 0x5974) = fVar4 - 64.0; *(float *)(in_ECX + 0x5978) = fVar3 - 33.0; *(float *)(in_ECX + 0x597c) = g_vectorZero.x; *(float *)(in_ECX + 0x5980) = g_vectorZero.y; *(float *)(in_ECX + 0x5984) = g_vectorZero.x; *(float *)(in_ECX + 0x5988) = g_vectorZero.y; *(float *)(in_ECX + 0x598c) = g_vectorZero.x; *(float *)(in_ECX + 0x5990) = g_vectorZero.y; return; } //@@ 009a8430 HUD::count_player_huds /* DB: counts non-null entries in the 8 PlayerHUD slots (stride 0x1b7 dwords = 0x6dc); HUD::GetPlayerHUDLayout */ char HUD::count_player_huds(void) { char cVar1; int *in_ECX; char cVar2; cVar1 = (*in_ECX != 0) + '\x01'; if (in_ECX[0x1b7] == 0) { cVar1 = *in_ECX != 0; } cVar2 = cVar1 + '\x01'; if (in_ECX[0x36e] == 0) { cVar2 = cVar1; } cVar1 = cVar2 + '\x01'; if (in_ECX[0x525] == 0) { cVar1 = cVar2; } cVar2 = cVar1 + '\x01'; if (in_ECX[0x6dc] == 0) { cVar2 = cVar1; } cVar1 = cVar2 + '\x01'; if (in_ECX[0x893] == 0) { cVar1 = cVar2; } cVar2 = cVar1 + '\x01'; if (in_ECX[0xa4a] == 0) { cVar2 = cVar1; } cVar1 = cVar2 + '\x01'; if (in_ECX[0xc01] == 0) { cVar1 = cVar2; } return cVar1; } //@@ 009a84c0 FUN_009a84c0 int FUN_009a84c0(void) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { return 3; } if (*(int *)&g_game->_deathmatchManager < 2) { return (g_manager->_optionsConfig)._onlineHud; } return 0; } //@@ 009a8500 PlayerHUD::make_ref /* DB: Entity_Player::Update: operator_new 0x6dc + PlayerHUD constructor FUN_006efc70, wraps it in ReferenceCount (0x18 bytes) into a smart pointer out param */ int * PlayerHUD::make_ref(int *param_1,void *param_2) { PlayerHUD *this; char cVar1; uint uVar2; void *pvVar3; int iVar4; ReferenceCountBase *this_00; undefined4 in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0de3f; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; pvVar3 = operator_new(0x6dc); local_8 = 1; if (pvVar3 == (void *)0x0) { iVar4 = 0; } else { iVar4 = FUN_006efc70(uVar2); } local_8 = local_8 & 0xffffff00; *param_1 = 0; param_1[1] = 0; this_00 = operator_new(0x18); local_8 = 2; if (this_00 == (ReferenceCountBase *)0x0) { this_00 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this_00); *(undefined ***)this_00 = ReferenceCount::vftable; *(int *)(this_00 + 0x14) = iVar4; } local_8 = local_8 & 0xffffff00; if ((int *)param_1[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)param_1[1] + 0xc))(); if ((cVar1 != '\0') && (DAT_00c7f480 != (code *)0x0)) { (*DAT_00c7f480)(param_1); } } param_1[1] = (int)this_00; *param_1 = iVar4; local_8 = 0; *(undefined4 *)(iVar4 + 4) = in_ECX; *(undefined2 *)(*param_1 + 8) = 0xffff; this = (PlayerHUD *)*param_1; if (param_2 != this->_player) { reset(this); this->_player = param_2; *(undefined2 *)&this->field_0x6ac = 0x101; } ExceptionList = local_10; return param_1; } //@@ 009a8620 HUD::AssignPlayerHUDs /* ZHL [lua] Lua binding HUD:AssignPlayerHUDs prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall HUD::AssignPlayerHUDs(HUD *this) { int iVar1; int iVar2; void *pvVar3; uint i; PlayerHUD *playerHud; PlayerManager *playerManager; PlayerHUD *hud; int iVar4; int *playerSlot; Game *game; void *twinPlayer; iVar4 = 8; playerHud = (PlayerHUD *)this; do { if (playerHud->_player != (void *)0x0) { PlayerHUD::reset(playerHud); playerHud->_player = (void *)0x0; *(undefined2 *)&playerHud->field_0x6ac = 0x101; } game = g_game; playerHud = (PlayerHUD *)&playerHud[1].field_0x2c; iVar4 = iVar4 + -1; } while (iVar4 != 0); if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { (g_game->_playerManager)._coopSlots[0]._controllerIndex = -1; i = 0; (game->_playerManager)._coopSlots[1]._controllerIndex = -1; (game->_playerManager)._coopSlots[0]._state = -1; (game->_playerManager)._coopSlots[0]._menuPosition = 0.0; (game->_playerManager)._coopSlots[0]._playerType = 0; (game->_playerManager)._coopSlots[1]._state = -1; (game->_playerManager)._coopSlots[1]._menuPosition = 0.0; (game->_playerManager)._coopSlots[1]._playerType = 0; (game->_playerManager)._coopSlots[2]._controllerIndex = -1; (game->_playerManager)._coopSlots[2]._state = -1; (game->_playerManager)._coopSlots[2]._menuPosition = 0.0; (game->_playerManager)._coopSlots[2]._playerType = 0; (game->_playerManager)._coopSlots[3]._controllerIndex = -1; (game->_playerManager)._coopSlots[3]._state = -1; (game->_playerManager)._coopSlots[3]._menuPosition = 0.0; (game->_playerManager)._coopSlots[3]._playerType = 0; pvVar3 = (game->_playerManager)._playerList._begin; if ((int)(game->_playerManager)._playerList._end - (int)pvVar3 >> 2 != 0) { do { iVar4 = *(int *)((int)pvVar3 + i * 4); iVar1 = *(int *)(iVar4 + 0x1e68); if (((((iVar1 == 0) || (*(int *)(iVar1 + 0x161c) == -1)) || (*(int *)(iVar4 + 0x161c) <= *(int *)(iVar1 + 0x161c))) || (iVar1 == iVar4)) && ((*(int *)(iVar4 + 0x3bc) == 0 && (*(char *)(iVar4 + 0x172) != '\0')))) { PlayerManager::GetPlayerSlotFromController (&g_game->_playerManager,*(int *)(iVar4 + 0x1618)); pvVar3 = (game->_playerManager)._playerList._begin; } i = i + 1; } while (i < (uint)((int)(game->_playerManager)._playerList._end - (int)pvVar3 >> 2)); } } i = 0; playerManager = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { pvVar3 = (playerManager->_playerList)._end; if ((int)pvVar3 - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (i < (uint)((int)pvVar3 - (int)playerSlot >> 2)) { playerSlot = playerSlot + i; } pvVar3 = (void *)*playerSlot; twinPlayer = *(void **)((int)pvVar3 + 0x1e68); if ((((twinPlayer == (void *)0x0) || (*(int *)((int)twinPlayer + 0x161c) == -1)) || ((*(int *)((int)pvVar3 + 0x161c) <= *(int *)((int)twinPlayer + 0x161c) || (twinPlayer == pvVar3)))) && ((*(int *)((int)pvVar3 + 0x3bc) == 0 && (*(char *)((int)pvVar3 + 0x172) != '\0')))) { iVar4 = PlayerManager::GetPlayerSlotFromController (&g_game->_playerManager,*(int *)((int)pvVar3 + 0x1618)); if (iVar4 < 0) { KAGE_LogMessage(8,(byte *) "HUD::AssignPlayerHUDs() could not determine player HUD slot for player entity %d (ControlerIndex = %d) \n" ); } else { KAGE_LogMessage(1,(byte *) "Assinging player entity %d (ControlerIndex = %d) to HUD slot %d \n"); hud = (PlayerHUD *)(this->_playerHUD + iVar4 * 0x6dc); if (pvVar3 != hud->_player) { PlayerHUD::reset(hud); hud->_player = pvVar3; *(undefined2 *)&hud->field_0x6ac = 0x101; } iVar1 = *(int *)((int)pvVar3 + 0x1e68); if ((((iVar1 != 0) && (*(char *)(iVar1 + 0x172) != '\0')) && (iVar2 = *(int *)(iVar1 + 0x13c0), iVar2 != 0x28)) && ((((iVar2 != 0x1d && (iVar2 != 0x26)) || ((iVar2 = *(int *)(iVar1 + 0x1e68), iVar2 == 0 || ((*(int *)(iVar2 + 0x161c) == -1 || (*(int *)(iVar1 + 0x161c) <= *(int *)(iVar2 + 0x161c))))))) || (iVar2 == iVar1)))) { KAGE_LogMessage(1,(byte *) "Assinging player entity %d\'s twin (ControlerIndex = %d) to HUD slot %d \n" ); pvVar3 = *(void **)((int)pvVar3 + 0x1e68); hud = (PlayerHUD *)(this->_playerHUD + iVar4 * 0x6dc + 0x1b70); if (pvVar3 != hud->_player) { PlayerHUD::reset(hud); hud->_player = pvVar3; *(undefined2 *)&hud->field_0x6ac = 0x101; } } } } i = i + 1; playerManager = &g_game->_playerManager; } while (i < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } return; } //@@ 009a8970 HUD::mark_all_slots_dirty /* DB: ECX is the HUD (Game+0x1da04) prototype: db/protos.zhl, confirmed by RET 8 */ void HUD::mark_all_slots_dirty(HUD *hud,byte isRebuildIcons,byte isClearTextCache) { undefined4 *this; undefined3 in_stack_00000005; if (*(int *)hud->_playerHUD != 0) { hud->_playerHUD[0x6ac] = 1; } if (*(int *)(hud->_playerHUD + 0x6dc) != 0) { hud->_playerHUD[0xd88] = 1; } if (*(int *)(hud->_playerHUD + 0xdb8) != 0) { hud->_playerHUD[0x1464] = 1; } if (*(int *)(hud->_playerHUD + 0x1494) != 0) { hud->_playerHUD[0x1b40] = 1; } if (*(int *)(hud->_playerHUD + 0x1b70) != 0) { hud->_playerHUD[0x221c] = 1; } if (*(int *)(hud->_playerHUD + 0x224c) != 0) { hud->_playerHUD[0x28f8] = 1; } if (*(int *)(hud->_playerHUD + 0x2928) != 0) { hud->_playerHUD[0x2fd4] = 1; } if (*(int *)(hud->_playerHUD + 0x3004) != 0) { hud->_playerHUD[14000] = 1; } this = &hud->_historyHUD; if ((g_manager->_optionsConfig)._historyHudMode == 0) { if (*this != 0) { text_image_cache_clear(this); } return; } if (isClearTextCache != 0) { text_image_cache_clear(this); } update_player_hud_slots((HUD *)this,_isRebuildIcons); return; } //@@ 009a8a40 FUN_009a8a40 void FUN_009a8a40(void) { StatHUD *this; int iVar1; void *pvVar2; int in_ECX; int iVar3; undefined4 *puVar4; int *piVar5; int *piVar6; int *piVar7; PlayerManager *pPVar8; uint uVar9; uint flags; int local_ec [53]; int *local_18; int local_14; uint local_10; int *local_c; StatHUD *local_8; local_8 = (StatHUD *)(in_ECX + 0x59a4); local_c = (int *)(in_ECX + 0x5b84); local_10 = 2; local_14 = 2; do { piVar5 = local_c; uVar9 = local_10; iVar3 = local_14; piVar6 = piVar5; if (((*local_c != 0) && (iVar1 = FUN_0084bf30(*local_c), iVar1 < 0)) && (*piVar5 = 0, uVar9 < 2) ) { local_18 = piVar5; iVar1 = 2 - uVar9; do { piVar6 = piVar5; piVar7 = local_ec; for (iVar3 = 0x33; iVar3 != 0; iVar3 = iVar3 + -1) { *piVar7 = *piVar6; piVar6 = piVar6 + 1; piVar7 = piVar7 + 1; } piVar6 = piVar5 + 0x33; piVar7 = piVar5; for (iVar3 = 0x33; iVar3 != 0; iVar3 = iVar3 + -1) { *piVar7 = *piVar6; piVar6 = piVar6 + 1; piVar7 = piVar7 + 1; } piVar6 = piVar5 + 0x33; piVar5 = piVar5 + 0x33; piVar7 = local_ec; for (iVar3 = 0x33; iVar3 != 0; iVar3 = iVar3 + -1) { *piVar6 = *piVar7; piVar7 = piVar7 + 1; piVar6 = piVar6 + 1; } iVar1 = iVar1 + -1; piVar6 = local_c; uVar9 = local_10; iVar3 = local_14; } while (iVar1 != 0); } this = local_8; local_c = piVar6 + -0x33; local_10 = uVar9 - 1; local_14 = iVar3 + -1; } while (local_14 != 0); uVar9 = 0; pPVar8 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar8->_playerList)._begin >> 2 != 0) { local_14 = 0; do { pvVar2 = (pPVar8->_playerList)._end; if ((int)pvVar2 - (int)(pPVar8->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar2 = (pPVar8->_playerList)._end; } puVar4 = (pPVar8->_playerList)._begin; if (uVar9 < (uint)((int)pvVar2 - (int)puVar4 >> 2)) { puVar4 = puVar4 + uVar9; } flags = 0xffffffff; iVar3 = FUN_0084bf30(*puVar4); StatHUD::RecomputeStats(this,iVar3,flags,(byte)puVar4); uVar9 = uVar9 + 1; pPVar8 = &g_game->_playerManager; } while (uVar9 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar8->_playerList)._begin >> 2)); } return; } //@@ 009a8b90 Entity_NPC::render_debug /* DB: ? called from Entity_NPC::Render; hsv_to_rgb colored render_quad_set_rect quads, no sprite work */ void Entity_NPC::render_debug(float *param_1,int param_2) { int stageNum; undefined4 extraout_EAX; undefined4 extraout_EAX_00; int in_ECX; KColor *color; KColor *color_00; KColor *color_01; float fVar1; double dVar2; float fVar3; float fVar4; undefined1 auStack_ee [2]; undefined1 local_ec [8]; undefined4 local_e4; Vector local_e0; undefined1 *local_d8; int local_d4; float local_d0; float local_cc; undefined1 *local_c8; undefined1 local_c4 [16]; undefined1 local_b4; undefined1 local_b0 [8]; float hpStageRatio; float maxHitPoints; KColor local_a0; undefined1 auStack_84 [12]; undefined1 local_78 [116]; code *renderQuadFn; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; local_d8 = *(undefined1 **)(param_2 + 0x380); maxHitPoints = *(float *)(param_2 + 900); if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) { stageNum = g_game->_stage + 1; } else { stageNum = g_game->_stage; } hpStageRatio = maxHitPoints / ((float)stageNum + (float)stageNum + 6.0); dVar2 = (double)hpStageRatio; libm_sse2_log10_precise(); local_ec._0_4_ = ((float)dVar2 + 1.0) * 24.0 + 0.5; dVar2 = floor((double)(float)local_ec._0_4_); local_ec._0_4_ = (BADTYPE)dVar2; fVar3 = (float)local_ec._0_4_; if ((float)local_ec._0_4_ <= 8.0) { fVar3 = 8.0; } if (48.0 <= fVar3) { fVar3 = 48.0; } renderQuadFn = *(code **)(**(int **)(in_ECX + 0x5488) + 0x14); local_b0._4_4_ = fVar3; KColor::SetFromARGB(&local_a0,0xffffffff); local_ec._0_4_ = -fVar3 * 0.5; local_ec._4_4_ = 4.0; local_e4 = 0x41000000; local_e0.x = ((float)local_ec._0_4_ - 4.0) + *param_1; local_e0.y = param_1[1] - 4.0; render_quad_set_rect(local_78,&local_e0,(Vector *)(local_ec + 4),color); local_c4._0_4_ = 0.0; local_c8 = (undefined1 *)0x0; local_d4 = 0; local_d0 = 0.0; local_cc = 4.0; local_c4._4_4_ = 8.0; local_c4._8_4_ = 4.0; local_c4._12_4_ = 8.0; local_b4 = 1; (*renderQuadFn)(); renderQuadFn = *(code **)(**(int **)(local_c4._8_4_ + 0x5488) + 0x14); KColor::SetFromARGB((KColor *)(local_b0 + 4),0xffffffff); local_ec._0_4_ = 4.0; local_ec._4_4_ = 8.0; render_quad_set_rect(auStack_84,(Vector *)(auStack_ee + -6),(Vector *)local_ec,color_00); local_d0 = 28.0; local_d4 = 0; local_e0.x = 28.0; local_e0.y = 0.0; local_d8 = &DAT_42000000; local_cc = 8.0; local_c8 = &DAT_42000000; local_c4._0_4_ = 8.0; local_c4[4] = 1; (*renderQuadFn)(&local_e0); renderQuadFn = *(code **)(**(int **)(local_c8 + 0x5488) + 0x14); KColor::SetFromARGB((KColor *)(local_c4 + 0xc),0xffffffff); fVar3 = param_1[1] - 4.0; render_quad_set_rect (&local_a0._unk,(Vector *)(auStack_ee + -0x12),(Vector *)(auStack_ee + -10),color_01); local_e0.y = 4.0; local_e0.x = 0.0; local_ec._0_4_ = 4.0; local_ec._4_4_ = 0.0; local_e4 = 0x41e00000; local_d8 = (undefined1 *)0x41000000; local_d4 = 0x41e00000; local_d0 = 8.0; local_cc = (float)CONCAT31(local_cc._1_3_,1); (*renderQuadFn)(local_ec,extraout_EAX,g_drawRectUnset); fVar3 = fVar3 / (float)local_c8; fVar4 = (local_cc - 1.0) / 5.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } fVar1 = (fVar3 - 0.2) / 0.8; if (fVar1 <= 0.0) { fVar1 = 0.0; } if (1.0 <= fVar1) { fVar1 = 1.0; } fVar1 = ((fVar4 * 80.0 + 120.0) - 0.0) * fVar1 + 0.0; fVar4 = (ABS(fVar1 - 120.0) - 0.0) / 120.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } hsv_to_rgb((KColor *)local_b0,fVar1,0.9 - fVar4 * 0.099999964,1.0,1.0); renderQuadFn = *(code **)(**(int **)(local_d4 + 0x5488) + 0x14); KColor::SetFromARGB((KColor *)local_c4,0xffffffff); local_cc = fVar3 * local_d0; ceil((double)local_cc); render_quad_set_rect (&local_a0._green,(Vector *)(auStack_ee + -0x1e),(Vector *)(auStack_ee + -0x16), (KColor *)local_c4); local_ec._4_4_ = 4.0; local_e0.x = fVar3 * 24.0 + 4.0; local_ec._0_4_ = 8.0; local_e4 = 0x41800000; local_e0.y = 16.0; local_d8 = (undefined1 *)CONCAT31(local_d8._1_3_,1); (*renderQuadFn)(auStack_ee + -10,extraout_EAX_00,local_b0); return; } //@@ 009a90b0 _player_hud_set_heart_anim_state /* DB: ? ? finds player in 8 entries stride 0x6dc, sets byte 4 */ void _player_hud_set_heart_anim_state(int param_1) { uint uVar1; int *in_ECX; uVar1 = 0; do { if (*in_ECX == param_1) { *(undefined1 *)(in_ECX + 3) = 4; return; } uVar1 = uVar1 + 1; in_ECX = in_ECX + 0x1b7; } while (uVar1 < 8); return; } //@@ 009a90e0 move_directory_files /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: FindFirstFileA on "%s*", skips "."/"..", MoveFileExA(..., MOVEFILE_WRITE_THROUGH 8) each file; SetupSaveDirectories for online_logs */ void move_directory_files(void) { byte bVar1; HANDLE hFindFile; CHAR *pCVar2; uint uVar3; BOOL BVar4; byte *pbVar5; bool bVar6; undefined1 auStack_36c [12]; _WIN32_FIND_DATAA local_360; byte local_220 [264]; byte local_118 [268]; uint local_c; local_c = __security_cookie ^ (uint)auStack_36c; sprintf(local_220,&DAT_00b7df08); hFindFile = FindFirstFileA((LPCSTR)local_220,&local_360); if (hFindFile != (HANDLE)0xffffffff) { do { pbVar5 = &DAT_00b1cebc; pCVar2 = local_360.cFileName; do { bVar1 = *pCVar2; bVar6 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009a9180: uVar3 = -(uint)bVar6 | 1; goto LAB_009a9185; } if (bVar1 == 0) break; bVar1 = pCVar2[1]; bVar6 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009a9180; pCVar2 = pCVar2 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009a9185: if (uVar3 != 0) { pbVar5 = &DAT_00b1ceb8; pCVar2 = local_360.cFileName; do { bVar1 = *pCVar2; bVar6 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009a91b6: uVar3 = -(uint)bVar6 | 1; goto LAB_009a91bb; } if (bVar1 == 0) break; bVar1 = pCVar2[1]; bVar6 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009a91b6; pCVar2 = pCVar2 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009a91bb: if (uVar3 != 0) { sprintf(local_220,&DAT_00b60c28); sprintf(local_118,&DAT_00b60c28); BVar4 = MoveFileExA((LPCSTR)local_220,(LPCSTR)local_118,8); if (BVar4 == 0) { GetLastError(); } } } BVar4 = FindNextFileA(hFindFile,&local_360); } while (BVar4 != 0); FindClose(hFindFile); } return; } //@@ 009a9250 delete_directory_recursive /* DB: ECX = path; FindFirstFileA/FindNextFileA, DeleteFileA files, recurses into subdirectories then RemoveDirectoryA; SetupSaveDirectories on "%s/mods/" */ bool delete_directory_recursive(void) { CHAR *pCVar1; byte bVar2; qword qVar3; char cVar4; undefined4 *puVar5; HANDLE hFindFile; BOOL BVar6; LPCSTR in_ECX; uint uVar7; byte *pbVar8; char *pcVar9; LPCSTR pCVar10; LPCSTR lpFileName; qword *pqVar11; LPCSTR pCVar12; CHAR *pCVar13; LPWIN32_FIND_DATAA lpFindFileData; CHAR *pCVar14; bool bVar15; bool local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0de60; local_10 = ExceptionList; ExceptionList = &local_10; if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } puVar5 = malloc(0x108); if (puVar5 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); lpFileName = (LPCSTR)0x0; } else { *puVar5 = 0x108; lpFileName = (LPCSTR)(puVar5 + 1); qVar3 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 + 0x108; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) + (uint)(0xfffffef7 < (uint)qVar3); } if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } puVar5 = malloc(0x144); if (puVar5 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); lpFindFileData = (LPWIN32_FIND_DATAA)0x0; } else { *puVar5 = 0x144; lpFindFileData = (LPWIN32_FIND_DATAA)(puVar5 + 1); qVar3 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 + 0x144; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) + (uint)(0xfffffebb < (uint)qVar3); } hFindFile = FindFirstFileA(in_ECX,lpFindFileData); if (hFindFile == (HANDLE)0xffffffff) { if (lpFileName != (LPCSTR)0x0) { local_8 = 0; tracked_alloc(1,lpFileName,0); } if (lpFindFileData != (LPWIN32_FIND_DATAA)0x0) { operator_delete(lpFindFileData,0x140); } ExceptionList = local_10; return true; } pCVar1 = lpFindFileData->cFileName; local_11 = true; do { *lpFileName = '\0'; pCVar10 = in_ECX; do { cVar4 = *pCVar10; pCVar10 = pCVar10 + 1; } while (cVar4 != '\0'); pCVar14 = lpFileName + -1; do { pcVar9 = pCVar14 + 1; pCVar14 = pCVar14 + 1; } while (*pcVar9 != '\0'); pCVar12 = in_ECX; for (uVar7 = (uint)((int)pCVar10 - (int)in_ECX) >> 2; uVar7 != 0; uVar7 = uVar7 - 1) { *(undefined4 *)pCVar14 = *(undefined4 *)pCVar12; pCVar12 = pCVar12 + 4; pCVar14 = pCVar14 + 4; } for (uVar7 = (int)pCVar10 - (int)in_ECX & 3; uVar7 != 0; uVar7 = uVar7 - 1) { *pCVar14 = *pCVar12; pCVar12 = pCVar12 + 1; pCVar14 = pCVar14 + 1; } pCVar10 = in_ECX; do { cVar4 = *pCVar10; pCVar10 = pCVar10 + 1; } while (cVar4 != '\0'); lpFileName[(int)(pCVar10 + (-1 - (int)(in_ECX + 1)))] = '\0'; pCVar14 = pCVar1; do { cVar4 = *pCVar14; pCVar14 = pCVar14 + 1; } while (cVar4 != '\0'); pCVar10 = lpFileName + -1; do { pcVar9 = pCVar10 + 1; pCVar10 = pCVar10 + 1; } while (*pcVar9 != '\0'); pCVar13 = pCVar1; for (uVar7 = (uint)((int)pCVar14 - (int)pCVar1) >> 2; uVar7 != 0; uVar7 = uVar7 - 1) { *(undefined4 *)pCVar10 = *(undefined4 *)pCVar13; pCVar13 = pCVar13 + 4; pCVar10 = pCVar10 + 4; } for (uVar7 = (int)pCVar14 - (int)pCVar1 & 3; uVar7 != 0; uVar7 = uVar7 - 1) { *pCVar10 = *pCVar13; pCVar13 = pCVar13 + 1; pCVar10 = pCVar10 + 1; } if ((lpFindFileData->dwFileAttributes & 0x10) == 0) { BVar6 = DeleteFileA(lpFileName); local_11 = (bool)(local_11 & -(BVar6 != 0)); } else { pbVar8 = &DAT_00b1cebc; pCVar14 = lpFindFileData->cFileName; do { bVar2 = *pCVar14; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009a9410: uVar7 = -(uint)bVar15 | 1; goto LAB_009a9415; } if (bVar2 == 0) break; bVar2 = pCVar14[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009a9410; pCVar14 = pCVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_009a9415: if (uVar7 != 0) { pbVar8 = &DAT_00b1ceb8; pCVar14 = lpFindFileData->cFileName; do { bVar2 = *pCVar14; bVar15 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009a9445: uVar7 = -(uint)bVar15 | 1; goto LAB_009a944a; } if (bVar2 == 0) break; bVar2 = pCVar14[1]; bVar15 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009a9445; pCVar14 = pCVar14 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_009a944a: if (uVar7 != 0) { pCVar10 = lpFileName + -1; do { pCVar12 = pCVar10; pCVar10 = pCVar12 + 1; } while (pCVar12[1] != '\0'); pCVar10[0] = '/'; pCVar10[1] = '*'; pCVar12[3] = '\0'; cVar4 = delete_directory_recursive(); if (cVar4 == '\0') { local_11 = false; } else { pCVar10 = lpFileName; do { pcVar9 = pCVar10; pCVar10 = pcVar9 + 1; } while (*pcVar9 != '\0'); pcVar9[-1] = '\0'; BVar6 = RemoveDirectoryA(lpFileName); local_11 = BVar6 != 0; } } } } BVar6 = FindNextFileA(hFindFile,lpFindFileData); if (BVar6 == 0) { local_8 = 1; tracked_alloc(1,lpFileName,0); operator_delete(lpFindFileData,0x140); FindClose(hFindFile); ExceptionList = local_10; return local_11; } } while( true ); } //@@ 009a9510 FontKerningPair::SetupSaveDirectories /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __stdcall void SetupSaveDirectories(); */ void FontKerningPair::SetupSaveDirectories(void) { byte bVar1; std_string *psVar2; qword qVar3; char cVar4; HMODULE hModule; FARPROC pFVar5; HANDLE ProcessHandle; BOOL BVar6; void *pvVar7; DWORD DVar8; void *ptr; byte *pbVar9; HWND pHVar10; int iVar11; FILE *_File; uint uVar12; byte *pbVar13; uint uVar14; qword *pqVar15; std_string *psVar16; code *pcVar17; char *lpCaption; char *pcVar18; UINT UVar19; undefined4 local_1944; HANDLE local_1940; void *local_193c; char acStack_1938 [4]; char acStack_1934 [4]; char acStack_1930 [4]; uint local_192c; uint uStack_1928; std_string *local_1924; std_string *local_1920; std_string *local_191c; byte local_1918 [1024]; byte local_1518 [1024]; byte local_1118 [1024]; byte local_d18 [1024]; byte local_918 [1024]; byte local_518 [1024]; CHAR local_118 [260]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0deb1; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_118 + 0x114); ExceptionList = &local_10; memset(g_userDataDir,0,0x400); memset(g_modsDirectory,0,0x400); memset(&DAT_00c73228,0,0x400); hModule = LoadLibraryA("userenv"); pFVar5 = GetProcAddress(hModule,"GetUserProfileDirectoryA"); if (pFVar5 != (FARPROC)0x0) { ProcessHandle = GetCurrentProcess(); local_1940 = (HANDLE)0x0; BVar6 = OpenProcessToken(ProcessHandle,8,&local_1940); if (BVar6 != 0) { local_1944 = 0x400; pvVar7 = operator_new_tracked(0x400); (*pFVar5)(local_1940,pvVar7,&local_1944); CloseHandle(local_1940); sprintf_s(g_userDataDir,0x400,&DAT_00b7dea4); local_8 = 0; tracked_alloc(1,pvVar7,0); local_8 = 0xffffffff; } } FreeLibrary(hModule); if (((g_userDataDir[0] == 0) || (DVar8 = GetFileAttributesA((LPCSTR)g_userDataDir), DVar8 == 0xffffffff)) || (((byte)DVar8 & 0x11) != 0x10)) { local_1924 = (std_string *)0x0; local_1920 = (std_string *)0x0; local_191c = (std_string *)0x0; local_8 = 1; local_192c = 0; uStack_1928 = 0xf; local_193c = (void *)0x0; pbVar13 = g_userDataDir; do { pbVar9 = pbVar13; pbVar13 = pbVar9 + 1; } while (*pbVar9 != 0); std::string::assign((char *)&local_193c,g_userDataDir,(uint)(pbVar9 + -0xc72a28)); local_8._0_1_ = 2; vector_string_emplace_reallocate_move(&local_1924,(std_string *)0x0,(std_string *)&local_193c); local_8 = CONCAT31(local_8._1_3_,1); if (0xf < uStack_1928) { uVar14 = uStack_1928 + 1; pvVar7 = local_193c; if (0xfff < uVar14) { pvVar7 = *(void **)((int)local_193c + -4); uVar14 = uStack_1928 + 0x24; if (0x1f < (uint)((int)local_193c + (-4 - (int)pvVar7))) goto LAB_009a9a86; } operator_delete(pvVar7,uVar14); } getenv("USERPROFILE"); sprintf_s(g_userDataDir,0x400,&DAT_00b7dea4); if (((g_userDataDir[0] == 0) || (DVar8 = GetFileAttributesA((LPCSTR)g_userDataDir), DVar8 == 0xffffffff)) || (((byte)DVar8 & 0x11) != 0x10)) { local_192c = 0; uStack_1928 = 0xf; local_193c = (void *)0x0; pbVar13 = g_userDataDir; do { pbVar9 = pbVar13; pbVar13 = pbVar9 + 1; } while (*pbVar9 != 0); std::string::assign((char *)&local_193c,g_userDataDir,(uint)(pbVar9 + -0xc72a28)); local_8._0_1_ = 3; if (local_1920 == local_191c) { vector_string_emplace_reallocate_move(&local_1924,local_1920,(std_string *)&local_193c); uVar14 = uStack_1928; } else { local_1920->_buf[0] = '\0'; local_1920->_buf[1] = '\0'; local_1920->_buf[2] = '\0'; local_1920->_buf[3] = '\0'; local_1920->_size = 0; local_1920->_capacity = 0; *(void **)local_1920->_buf = local_193c; *(char (*) [4])(local_1920->_buf + 4) = acStack_1938; *(char (*) [4])(local_1920->_buf + 8) = acStack_1934; *(char (*) [4])(local_1920->_buf + 0xc) = acStack_1930; local_193c = (void *)((uint)local_193c & 0xffffff00); local_1920->_size = local_192c; local_1920->_capacity = uStack_1928; local_1920 = local_1920 + 1; uVar14 = 0xf; } psVar16 = local_1920; local_8 = CONCAT31(local_8._1_3_,1); if (0xf < uVar14) { uVar12 = uVar14 + 1; pvVar7 = local_193c; if (0xfff < uVar12) { pvVar7 = *(void **)((int)local_193c + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)local_193c + (-4 - (int)pvVar7))) goto LAB_009a9a86; } operator_delete(pvVar7,uVar12); } getenv("HOMEDRIVE"); getenv("HOMEPATH"); sprintf_s(g_userDataDir,0x400,(byte *)"%s%s/"); if (((g_userDataDir[0] == 0) || (DVar8 = GetFileAttributesA((LPCSTR)g_userDataDir), DVar8 == 0xffffffff)) || (((byte)DVar8 & 0x11) != 0x10)) { local_192c = 0; uStack_1928 = 0xf; local_193c = (void *)0x0; pbVar13 = g_userDataDir; do { pbVar9 = pbVar13; pbVar13 = pbVar9 + 1; } while (*pbVar9 != 0); std::string::assign((char *)&local_193c,g_userDataDir,(uint)(pbVar9 + -0xc72a28)); local_8._0_1_ = 4; if (psVar16 == local_191c) { vector_string_emplace_reallocate_move(&local_1924,psVar16,(std_string *)&local_193c); uVar14 = uStack_1928; psVar16 = local_1920; } else { psVar16->_buf[0] = '\0'; psVar16->_buf[1] = '\0'; psVar16->_buf[2] = '\0'; psVar16->_buf[3] = '\0'; psVar16->_size = 0; psVar16->_capacity = 0; *(void **)psVar16->_buf = local_193c; *(char (*) [4])(psVar16->_buf + 4) = acStack_1938; *(char (*) [4])(psVar16->_buf + 8) = acStack_1934; *(char (*) [4])(psVar16->_buf + 0xc) = acStack_1930; local_193c = (void *)((uint)local_193c & 0xffffff00); psVar16->_size = local_192c; psVar16->_capacity = uStack_1928; uVar14 = 0xf; psVar16 = psVar16 + 1; } local_8 = CONCAT31(local_8._1_3_,1); if (0xf < uVar14) { uVar12 = uVar14 + 1; pvVar7 = local_193c; if (0xfff < uVar12) { pvVar7 = *(void **)((int)local_193c + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)local_193c + (-4 - (int)pvVar7))) goto LAB_009a9a86; } operator_delete(pvVar7,uVar12); } sprintf_s(g_userDataDir,0x400,&DAT_00b7ded4); if (((g_userDataDir[0] == 0) || (DVar8 = GetFileAttributesA((LPCSTR)g_userDataDir), DVar8 == 0xffffffff)) || (((byte)DVar8 & 0x11) != 0x10)) { UVar19 = 0; lpCaption = "Error"; pcVar18 = "Failed to obtain writable save data directory!"; pHVar10 = GetActiveWindow(); MessageBoxA(pHVar10,pcVar18,lpCaption,UVar19); } } } else { psVar16 = local_1920; } local_8 = 0xffffffff; psVar2 = local_1924; if (local_1924 != (std_string *)0x0) { for (; psVar2 != psVar16; psVar2 = psVar2 + 1) { uVar14 = psVar2->_capacity; if (0xf < uVar14) { pvVar7 = *(void **)psVar2->_buf; uVar12 = uVar14 + 1; ptr = pvVar7; if (0xfff < uVar12) { ptr = *(void **)((int)pvVar7 + -4); uVar12 = uVar14 + 0x24; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)ptr))) goto LAB_009a9a86; } operator_delete(ptr,uVar12); } psVar2->_size = 0; psVar2->_capacity = 0xf; psVar2->_buf[0] = '\0'; } uVar14 = (((int)local_191c - (int)local_1924) / 0x18) * 0x18; psVar16 = local_1924; if (0xfff < uVar14) { psVar16 = (std_string *)local_1924[-1]._capacity; uVar14 = uVar14 + 0x23; if (0x1f < (uint)((int)local_1924 + (-4 - (int)psVar16))) { LAB_009a9a86: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar16,uVar14); } } uVar14 = 0; local_1924 = (std_string *)0xb7e034; local_1920 = (std_string *)0xb7e040; local_191c = (std_string *)0xb7e04c; do { sprintf_s(local_1118,0x400,&DAT_00b62fdc); sprintf_s(g_userDataDir,0x400,&DAT_00b60c28); CreateDirectoryA((LPCSTR)g_userDataDir,(LPSECURITY_ATTRIBUTES)0x0); pcVar17 = GetFileAttributesA_exref; uVar14 = uVar14 + 1; } while (uVar14 < 3); if (((g_userDataDir[0] == 0) || (DVar8 = GetFileAttributesA((LPCSTR)g_userDataDir), DVar8 == 0xffffffff)) || (((byte)DVar8 & 0x11) != 0x10)) { pbVar9 = operator_new_tracked(0x400); sprintf_s(pbVar9,0x400,(byte *)"Save data path %s is not a writable directory!"); UVar19 = 0; pcVar18 = "Error"; pbVar13 = pbVar9; pHVar10 = GetActiveWindow(); MessageBoxA(pHVar10,(LPCSTR)pbVar13,pcVar18,UVar19); if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } if (pbVar9 != (byte *)0x0) { uVar14 = *(uint *)(pbVar9 + -4); qVar3 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar3 < uVar14); free(pbVar9 + -4); } local_8 = 0xffffffff; pcVar17 = GetFileAttributesA_exref; } GetCurrentDirectoryA(0x104,local_118); sprintf_s(g_modsDirectory,0x400,&DAT_00b7dea4); sprintf_s((byte *)&DAT_00c73228,0x400,&DAT_00b7dea4); sprintf_s(local_918,0x400,&DAT_00b62fdc); sprintf_s(g_modsDirectory,0x400,&DAT_00b60c28); CreateDirectoryA((LPCSTR)g_modsDirectory,(LPSECURITY_ATTRIBUTES)0x0); if (((g_modsDirectory[0] == 0) || (iVar11 = (*pcVar17)(g_modsDirectory), iVar11 == -1)) || (((byte)iVar11 & 0x11) != 0x10)) { pbVar9 = operator_new_tracked(0x400); sprintf_s(pbVar9,0x400,(byte *)"Modding data path %s is not a writable directory!"); UVar19 = 0; pcVar18 = "Error"; pbVar13 = pbVar9; pHVar10 = GetActiveWindow(); MessageBoxA(pHVar10,(LPCSTR)pbVar13,pcVar18,UVar19); if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } if (pbVar9 != (byte *)0x0) { uVar14 = *(uint *)(pbVar9 + -4); qVar3 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar3 < uVar14); free(pbVar9 + -4); } local_8 = 0xffffffff; pcVar17 = GetFileAttributesA_exref; } sprintf_s(local_918,0x400,&DAT_00b62fdc); sprintf_s((byte *)&DAT_00c73228,0x400,&DAT_00b60c28); CreateDirectoryA(&DAT_00c73228,(LPSECURITY_ATTRIBUTES)0x0); if (((DAT_00c73228 == '\0') || (iVar11 = (*pcVar17)(&DAT_00c73228), iVar11 == -1)) || (((byte)iVar11 & 0x11) != 0x10)) { pbVar9 = operator_new_tracked(0x400); sprintf_s(pbVar9,0x400,(byte *)"Modding save data path %s is not a writable directory!"); UVar19 = 0; pcVar18 = "Error"; pbVar13 = pbVar9; pHVar10 = GetActiveWindow(); MessageBoxA(pHVar10,(LPCSTR)pbVar13,pcVar18,UVar19); if (g_mainHeap == (void *)0x0) { pqVar15 = &g_allocatedBytesNoHeap; } else { pqVar15 = (qword *)((int)g_mainHeap + 0x30); } if (pbVar9 != (byte *)0x0) { uVar14 = *(uint *)(pbVar9 + -4); qVar3 = *pqVar15; *(uint *)pqVar15 = (uint)*pqVar15 - uVar14; *(uint *)((int)pqVar15 + 4) = *(uint *)((int)pqVar15 + 4) - (uint)((uint)qVar3 < uVar14); free(pbVar9 + -4); } local_8 = 0xffffffff; pcVar17 = GetFileAttributesA_exref; } sprintf(local_1518,(byte *)"%s/mods/"); sprintf(local_518,&DAT_00b7df08); cVar4 = delete_directory_recursive(); if (cVar4 != '\0') { pbVar13 = local_518; do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; } while (bVar1 != 0); if ((byte *)0x3ff < pbVar13 + (-1 - (int)(local_518 + 1))) { FUN_00aef86f(); pcVar17 = (code *)swi(3); (*pcVar17)(); return; } local_918[(int)(pbVar13 + (-1 - (int)(local_518 + 1)) + 0x400)] = 0; RemoveDirectoryA((LPCSTR)local_518); } sprintf(local_d18,(byte *)"%s/online_logs/desyncs/"); iVar11 = (*pcVar17)(local_d18); if (iVar11 == -1) { CreateDirectoryA((LPCSTR)local_d18,(LPSECURITY_ATTRIBUTES)0x0); sprintf(local_1918,(byte *)"%s/online_logs/"); move_directory_files(); } _File = fopen("savedatapath.txt","w"); if (_File != (FILE *)0x0) { FUN_008c5d50(_File, "This file is purely informational. Changing it will have no effect on saving or loading data.\n\n" ); FUN_008c5d50(_File,"Save Data Path: %s\n",g_userDataDir); FUN_008c5d50(_File,"Modding Data Path: %s\n",g_modsDirectory); fclose(_File); } ExceptionList = local_10; return; } //@@ 009a9ef0 Manager::ResizeWindowCallback /* ZHL [exact] __thiscall void Manager::ResizeWindowCallback(int windowWidth,int windowHeight); */ void __thiscall Manager::ResizeWindowCallback(undefined4 param_1,int param_2,int param_3) { int *piVar1; int iVar2; int iVar3; int *piVar4; if (((param_2 != 0) && (param_3 != 0)) && ((param_2 != DAT_00c7b638 || (param_3 != DAT_00c7b63c))) ) { DAT_00c7b638 = param_2; DAT_00c7b63c = param_3; iVar2 = GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); iVar3 = Window::get_framebuffer_height(&DAT_00c798e0); if ((iVar2 != 0) && (iVar3 != 0)) { if (g_manager->_state == 3) { piVar4 = (g_manager->_nightmareScene)._stageBarIcons + (g_manager->_cutsceneManager)._currentCutsceneId * 0x13 + -0x2f1; iVar2 = piVar4[0x11]; if (-1 < iVar2) { piVar1 = piVar4 + 8; piVar4 = (int *)(piVar4[9] - *piVar1 >> 2); if (iVar2 < (int)piVar4) { iVar2 = *(int *)(*piVar1 + iVar2 * 4); update_screen_scale(param_2,param_3, CONCAT31((int3)((uint)iVar2 >> 8),*(undefined1 *)(iVar2 + 8))); return; } } update_screen_scale(param_2,param_3,(uint)piVar4 & 0xffffff00); return; } set_viewport_size(param_2,param_3); } } return; } //@@ 009a9fc0 FUN_009a9fc0 void FUN_009a9fc0(int param_1,int param_2) { int iVar1; int iVar2; Manager *pMVar3; int *piVar4; int in_ECX; int unused; int local_10 [3]; piVar4 = glfw_get_window_size(local_10,in_ECX); iVar1 = *piVar4; piVar4 = glfw_get_window_size(local_10,unused); pMVar3 = g_manager; iVar2 = piVar4[1]; if ((g_manager->_optionsConfig)._isFullscreen == 0) { (g_manager->_optionsConfig)._windowPosX = param_1; (pMVar3->_optionsConfig)._windowPosY = param_2; } Manager::ResizeWindowCallback(pMVar3,iVar1,iVar2,0); return; } //@@ 009aa020 FUN_009aa020 void FUN_009aa020(char param_1) { g_manager->_isWindowFocused = param_1 != '\0'; return; } //@@ 009aa040 FontKerningPair::IsaacStartup /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] __x86_64 void IsaacStartup(int param_1, int param_2, int param_3); */ undefined4 FontKerningPair::IsaacStartup(int param_1) { undefined *puVar1; longlong lVar2; longlong lVar3; longlong lVar4; DailyChallenge *pDVar5; undefined **ppuVar6; char cVar7; byte bVar8; byte *pbVar9; uint uVar10; char *****pppppcVar11; LuaEngine *this; int *piVar12; undefined4 *puVar13; Manager *pMVar14; int iVar15; byte *pbVar16; void *pvVar17; byte *****pppppbVar18; float *pfVar19; MenuManager *this_00; MenuManager *extraout_EAX; byte isFillValue; char *pcVar20; uint uVar21; char *****pppppcVar22; int *piVar23; byte *****pppppbVar24; void *pvVar25; int in_EDX; undefined **ppuVar26; int *piVar27; byte *pbVar28; uint uVar29; bool bVar30; __time64_t _Var31; ulonglong uVar32; undefined1 auStack_202 [2]; KColor KStack_1f8; byte *pbStack_1e4; byte *pbStack_1e0; byte *pbStack_1dc; int *piStack_1d8; int *piStack_1d4; int *piStack_1d0; int local_1cc; int local_1c8; undefined **ppuStack_1c4; undefined **ppuStack_1c0; undefined **ppuStack_1bc; uint local_1b8; int *local_1b4; undefined8 local_1b0; int *local_1a8; char *****pppppcStack_1a4; int local_1a0; undefined8 local_19c; char cStack_191; char acStack_190 [24]; void *apvStack_178 [4]; undefined4 uStack_168; uint uStack_164; void *apvStack_160 [4]; undefined4 uStack_150; uint uStack_14c; byte *****pppppbStack_148; float fStack_144; float fStack_140; float fStack_13c; undefined8 uStack_138; char *****local_130 [4]; uint local_120; uint local_11c; byte abStack_118 [260]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; puStack_c = &LAB_00b0e009; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(abStack_118 + 0x114); ExceptionList = &local_10; uVar29 = 0; local_1c8 = param_1; local_1b8 = 0; local_19c._0_4_ = (uint)local_19c & 0xffffff00; local_19c = CONCAT44(0x40000000,(uint)local_19c); local_1cc = in_EDX; if (1 < in_EDX) { local_1a0 = 1; do { pbVar16 = *(byte **)(local_1c8 + local_1a0 * 4); pcVar20 = "--luadebug"; pbVar9 = pbVar16; do { bVar8 = *pbVar9; bVar30 = bVar8 < (byte)*pcVar20; if (bVar8 != *pcVar20) { LAB_009aa0e0: uVar10 = -(uint)bVar30 | 1; goto LAB_009aa0e5; } if (bVar8 == 0) break; bVar8 = pbVar9[1]; bVar30 = bVar8 < (byte)pcVar20[1]; if (bVar8 != pcVar20[1]) goto LAB_009aa0e0; pbVar9 = pbVar9 + 2; pcVar20 = pcVar20 + 2; } while (bVar8 != 0); uVar10 = 0; LAB_009aa0e5: if (uVar10 == 0) { local_19c = CONCAT71(local_19c._1_7_,1); } else { uVar10 = strncmp((char *)pbVar16,"--luaheapsize=",0xe); pbVar16 = *(byte **)(local_1c8 + local_1a0 * 4); if (uVar10 == 0) { local_11c = 0xf; local_130[0] = (char *****)0x0; pbVar9 = pbVar16; do { bVar8 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar8 != 0); local_120 = uVar10; std::string::assign((char *)local_130,pbVar16,(int)pbVar9 - (int)(pbVar16 + 1)); local_8 = 1; local_1b4 = (int *)0x0; local_1b0 = 0; local_19c = CONCAT44(uVar29,(uint)local_19c) | 0x100000000; string_split(); local_8._0_1_ = 2; if (0xf < local_11c) { uVar10 = local_11c + 1; pppppcVar11 = local_130[0]; if (0xfff < uVar10) { pppppcVar11 = (char *****)local_130[0][-1]; uVar10 = local_11c + 0x24; if ((char *)0x1f < (char *)((int)local_130[0] + (-4 - (int)pppppcVar11))) goto LAB_009ab6a1; } operator_delete(pppppcVar11,uVar10); } piVar12 = local_1b4; pbVar16 = (byte *)(local_1b4 + 6); local_1a8 = local_1b4; pbVar9 = pbVar16; if (0xf < (uint)local_1b4[0xb]) { pbVar9 = *(byte **)pbVar16; } iVar15 = toupper((int)(char)pbVar9[local_1b4[10] + -1]); if (iVar15 == 0x47) { uVar10 = piVar12[10]; local_130[0] = (char *****)0x0; local_120 = 0; local_11c = 0xf; uVar21 = uVar10 - 1; if (uVar10 < uVar10 - 1) { uVar21 = uVar10; } if (0xf < (uint)piVar12[0xb]) { pbVar16 = *(byte **)pbVar16; } std::string::assign((char *)local_130,pbVar16,uVar21); uVar29 = uVar29 | 3; pppppcVar11 = (char *****)local_130; if (0xf < local_11c) { pppppcVar11 = local_130[0]; } iVar15 = atoi((char *)pppppcVar11); iVar15 = iVar15 << 0x1e; } else { pbVar9 = pbVar16; if (0xf < (uint)piVar12[0xb]) { pbVar9 = *(byte **)pbVar16; } iVar15 = toupper((int)(char)pbVar9[piVar12[10] + -1]); if (iVar15 == 0x4d) { uVar10 = piVar12[10]; local_130[0] = (char *****)0x0; local_120 = 0; local_11c = 0xf; uVar21 = uVar10 - 1; if (uVar10 < uVar10 - 1) { uVar21 = uVar10; } if (0xf < (uint)piVar12[0xb]) { pbVar16 = *(byte **)pbVar16; } std::string::assign((char *)local_130,pbVar16,uVar21); uVar29 = uVar29 | 5; pppppcVar11 = (char *****)local_130; if (0xf < local_11c) { pppppcVar11 = local_130[0]; } iVar15 = atoi((char *)pppppcVar11); iVar15 = iVar15 << 0x14; } else { pbVar9 = pbVar16; if (0xf < (uint)piVar12[0xb]) { pbVar9 = *(byte **)pbVar16; } iVar15 = toupper((int)(char)pbVar9[piVar12[10] + -1]); uVar21 = piVar12[10]; local_130[0] = (char *****)0x0; local_120 = 0; local_11c = 0xf; uVar10 = uVar21 - 1; if (iVar15 == 0x4b) { if (uVar21 < uVar10) { uVar10 = uVar21; } if (0xf < (uint)piVar12[0xb]) { pbVar16 = *(byte **)pbVar16; } std::string::assign((char *)local_130,pbVar16,uVar10); uVar29 = uVar29 | 9; pppppcVar11 = (char *****)local_130; if (0xf < local_11c) { pppppcVar11 = local_130[0]; } iVar15 = atoi((char *)pppppcVar11); iVar15 = iVar15 << 10; } else { if (uVar21 < uVar10) { uVar10 = uVar21; } if (0xf < (uint)piVar12[0xb]) { pbVar16 = *(byte **)pbVar16; } std::string::assign((char *)local_130,pbVar16,uVar10); uVar29 = uVar29 | 0x11; pppppcVar11 = (char *****)local_130; if (0xf < local_11c) { pppppcVar11 = local_130[0]; } iVar15 = atoi((char *)pppppcVar11); } } } local_19c = CONCAT44(iVar15,(uint)local_19c); if (0xf < local_11c) { uVar10 = local_11c + 1; pppppcVar11 = local_130[0]; if (0xfff < uVar10) { pppppcVar11 = (char *****)local_130[0][-1]; uVar10 = local_11c + 0x24; if ((char *)0x1f < (char *)((int)local_130[0] + (-4 - (int)pppppcVar11))) goto LAB_009ab6a1; } operator_delete(pppppcVar11,uVar10); } uVar29 = uVar29 & 0xfffffffe; local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; local_1b8 = uVar29; if (local_1a8 != (int *)0x0) { piVar12 = (int *)local_1b0; piVar23 = local_1a8; if (local_1a8 != (int *)local_1b0) { do { uVar10 = piVar23[5]; if (0xf < uVar10) { pvVar25 = (void *)*piVar23; uVar21 = uVar10 + 1; pvVar17 = pvVar25; if (0xfff < uVar21) { pvVar17 = *(void **)((int)pvVar25 + -4); uVar21 = uVar10 + 0x24; if (0x1f < (uint)((int)pvVar25 + (-4 - (int)pvVar17))) goto LAB_009ab6a1; } operator_delete(pvVar17,uVar21); piVar12 = (int *)local_1b0; } piVar23[4] = 0; piVar23[5] = 0xf; *(undefined1 *)piVar23 = 0; piVar23 = piVar23 + 6; } while (piVar23 != piVar12); } uVar10 = ((local_1b0._4_4_ - (int)local_1a8) / 0x18) * 0x18; piVar12 = local_1a8; if (0xfff < uVar10) { piVar12 = (int *)local_1a8[-1]; uVar10 = uVar10 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)local_1a8 + (-4 - (int)piVar12))) goto LAB_009ab6a1; } operator_delete(piVar12,uVar10); local_1b4 = (int *)0x0; local_1b0 = 0; } } else { pcVar20 = "--networktest"; do { bVar8 = *pbVar16; bVar30 = bVar8 < (byte)*pcVar20; if (bVar8 != *pcVar20) { LAB_009aa500: uVar10 = -(uint)bVar30 | 1; goto LAB_009aa505; } if (bVar8 == 0) break; bVar8 = pbVar16[1]; bVar30 = bVar8 < (byte)pcVar20[1]; if (bVar8 != pcVar20[1]) goto LAB_009aa500; pbVar16 = pbVar16 + 2; pcVar20 = pcVar20 + 2; } while (bVar8 != 0); uVar10 = 0; LAB_009aa505: if (uVar10 == 0) { DAT_00c71673 = 1; } } } local_1a0 = local_1a0 + 1; } while (local_1a0 < local_1cc); } this = operator_new(0x268); local_1b0 = CONCAT44(this,(int *)local_1b0); if (this == (LuaEngine *)0x0) { this = (LuaEngine *)0x0; } else { *this = (LuaEngine)0x0; this[1] = (LuaEngine)0x0; this[2] = (LuaEngine)0x0; this[3] = (LuaEngine)0x0; local_8 = 4; *(undefined1 *)(this + 7) = 0; this[6] = (LuaEngine)0x0; this[9] = (LuaEngine)0x32; this[10] = (LuaEngine)0x0; this[0xb] = (LuaEngine)0x0; this[0xc] = (LuaEngine)0x0; this[0xd] = (LuaEngine)0x0; this[0xe] = (LuaEngine)0x0; this[0xf] = (LuaEngine)0x0; this[0x10] = (LuaEngine)0x0; this[0x11] = (LuaEngine)0x0; this[0x12] = (LuaEngine)0x0; this[0x13] = (LuaEngine)0x0; this[0x14] = (LuaEngine)0x0; this[0x15] = (LuaEngine)0x0; this[0x16] = (LuaEngine)0xffffffff; this[0x97] = (LuaEngine)0x0; this[0x98] = (LuaEngine)0x0; this[0x99] = (LuaEngine)0x0; this[4] = (LuaEngine)0x0; this[5] = (LuaEngine)0x0; vector_bool_resize(this,0x4a,isFillValue); if (local_19c._4_4_ == (char *****)0x0) { DAT_00c7168c = (int)local_19c._4_4_; } else if (DAT_00c7168c == 0) { iVar15 = mi_reserve_os_memory_ex(local_19c._4_4_,0); if (iVar15 == 0) { KAGE_LogMessage(1,(byte *)"Successfully reserved %u bytes of memory for Lua\n"); DAT_00c7168c = FUN_00ae6b80(local_1a0); } else { KAGE_LogMessage(1,(byte *) "Failed to reserve %u bytes of memory for Lua, attempting to reserve 512 MB instead\n" ); iVar15 = mi_reserve_os_memory_ex(0x20000000,0,1,1,&local_1a0); if (iVar15 == 0) { KAGE_LogMessage(1,(byte *)"Successfully reserved %u bytes of memory for Lua\n"); DAT_00c7168c = FUN_00ae6b80(local_1a0); } else { KAGE_LogMessage(1,(byte *) "Could not reserve memory for Lua, defaulting to legacy behavior\n"); } } } } local_8 = 0xffffffff; g_luaEngine = this; LuaEngine::Init(this,(byte)local_19c); g_screenWidth = 480.0; g_screenHeight = 270.0; g_framebufferWidth = 0x1e0; DAT_00c79114 = 0x10e; DAT_00c7997c = 0x43f00000; DAT_00c79980 = 0x43870000; DAT_00c7b638 = 0; DAT_00c7b63c = 0; reload_resource_paths(); FileSystem::load_mount_points(&PTR_vftable_00c379e0); KAGE_LogMessage(1,(byte *)"Binding of Isaac: Repentance+ v1.9.7.17.J460\n"); _Var31 = _time64((__time64_t *)0x0); pppppcStack_1a4 = (char *****)_Var31; local_1b0._4_4_ = (int)((ulonglong)_Var31 >> 0x20); uVar32 = GetTimeNs(); uVar29 = (uint)(uVar32 >> 0x20); lVar2 = (uVar32 & 0xffffffff) * 0x431bde82; local_1a0 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar29 * 0xd7b634db; local_1a8 = (int *)((ulonglong)lVar3 >> 0x20); local_19c = (ulonglong)uVar29 * 0x431bde82; local_1b0 = CONCAT44(local_1b0._4_4_, (int)lVar2 + (int)lVar3 + (int)((uVar32 & 0xffffffff) * 0xd7b634db >> 0x20)); FUN_006eef20(); piVar12 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*piVar12 != 0) { puVar13 = (undefined4 *)SteamInternal_ContextInit(); cVar7 = (**(code **)(*(int *)*puVar13 + 4))(); if ((cVar7 != '\0') && (pppppcStack_1a4 != (char *****)0x3e8)) { KAGE_LogMessage(1,(byte *)"Upgrading from an unsupported version. Deleting all Steam stats.\n" ); puVar13 = (undefined4 *)SteamInternal_ContextInit(); (**(code **)(*(int *)*puVar13 + 0x50))(); puVar13 = (undefined4 *)SteamInternal_ContextInit(); (**(code **)(*(int *)*puVar13 + 0xc))(); puVar13 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar13 + 0x24))(); } } std::list>::push_back(); std::list>::push_back(); std::list>::push_back(); g_graphicsManager_flags = g_graphicsManager_flags | 4; uVar32 = GetTimeNs(); uVar29 = (uint)(uVar32 >> 0x20); local_1b0._4_4_ = (int)((ulonglong)local_1b0 >> 0x20); lVar2 = (uVar32 & 0xffffffff) * 0x431bde82; local_1a8 = (int *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar29 * 0xd7b634db; pppppcStack_1a4 = (char *****)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar29 * 0x431bde82; uVar32 = lVar3 + ((uVar32 & 0xffffffff) * 0xd7b634db >> 0x20); ppuVar26 = &PTR_PTR_00bfae60; uVar10 = (uint)(uVar32 >> 0x20); lVar2 = lVar2 + (uVar32 & 0xffffffff); local_1b0._0_4_ = (int *)lVar2; uVar29 = (uint)((ulonglong)lVar2 >> 0x20); lVar2 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar10,uVar29),uVar10 + uVar29); _DAT_00c71664 = (uint)((ulonglong)lVar2 >> 0x20); _DAT_00c71660 = (uint)lVar2 >> 0x12 | _DAT_00c71664 * 0x4000; _DAT_00c71664 = _DAT_00c71664 >> 0x12; puVar1 = PTR_PTR_00bfae60; while( true ) { local_19c._0_4_ = (uint)lVar4; local_1a0 = (int)((ulonglong)lVar4 >> 0x20); if (puVar1 == (undefined *)0x0) break; KAGE_Filesys_FileManager::LoadArchiveFile(); lVar4 = CONCAT44(local_1a0,(uint)local_19c); puVar1 = ppuVar26[1]; ppuVar26 = ppuVar26 + 1; } KAGE_Filesys_FileManager::LoadArchiveFile(); uVar32 = GetTimeNs(); uVar29 = (uint)(uVar32 >> 0x20); lVar2 = (uVar32 & 0xffffffff) * 0x431bde82; local_1a8 = (int *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar29 * 0xd7b634db; pppppcStack_1a4 = (char *****)((ulonglong)lVar3 >> 0x20); lVar4 = (ulonglong)uVar29 * 0x431bde82; local_1a0 = (int)((ulonglong)lVar4 >> 0x20); uVar32 = lVar3 + ((uVar32 & 0xffffffff) * 0xd7b634db >> 0x20); uVar10 = (uint)(uVar32 >> 0x20); local_19c = CONCAT44(local_19c._4_4_,(int)lVar4); lVar2 = lVar2 + (uVar32 & 0xffffffff); uVar29 = (uint)((ulonglong)lVar2 >> 0x20); local_1b0 = CONCAT44(local_1b0._4_4_,(int)lVar2); lVar4 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar10,uVar29),uVar10 + uVar29); uVar29 = (uint)((ulonglong)lVar4 >> 0x20); uVar10 = (uint)lVar4 >> 0x12 | uVar29 * 0x4000; bVar30 = uVar10 < _DAT_00c71660; _DAT_00c71660 = uVar10 - _DAT_00c71660; _DAT_00c71664 = ((uVar29 >> 0x12) - _DAT_00c71664) - (uint)bVar30; KAGE_LogMessage(1,(byte *)"%s: %ld milliseconds\n"); FUN_00680080(); FUN_00902fd0(); pMVar14 = operator_new(0x4d088); local_1b0 = CONCAT44(pMVar14,(int *)local_1b0); local_8 = 5; if (pMVar14 == (Manager *)0x0) { g_manager = (Manager *)0x0; } else { g_manager = Manager::constructor(pMVar14); } local_8 = 0xffffffff; Manager::Init(); Window::get_framebuffer_height(&DAT_00c798e0); GraphicsWindow::get_framebuffer_width(&DAT_00c798e0); Manager::set_viewport_size(); ModManager::UpdateWorkshopMods(&g_manager->_modManager); if (((g_manager->_optionsConfig)._eosCrossplay == 3) && (DAT_00c5abfc == 0)) { (**(code **)(PTR_vftable_00c5abf0 + 4))(); FUN_00a60050(); } local_1a8 = (int *)0x1; cStack_191 = '\0'; local_1a0 = 0; uStack_138 = 0xf00000000; pppppbStack_148 = (byte *****)0x0; iVar15 = 1; local_8._0_1_ = 6; local_8._1_3_ = 0; local_19c = CONCAT44(local_19c._4_4_,1); if (1 < local_1cc) { LAB_009aab70: local_120 = 0; local_11c = 0xf; pbVar16 = *(byte **)(local_1c8 + iVar15 * 4); local_130[0] = (char *****)0x0; pbVar9 = pbVar16; do { bVar8 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar8 != 0); std::string::assign((char *)local_130,pbVar16,(int)pbVar9 - (int)(pbVar16 + 1)); pppppcVar11 = local_130[0]; pppppcVar22 = (char *****)local_130; if (0xf < local_11c) { pppppcVar22 = local_130[0]; } local_19c = CONCAT44(local_130[0],(uint)local_19c); local_1b0 = CONCAT44(pppppcVar22,(int *)local_1b0); if (0xb < local_120) { pppppcStack_1a4 = (char *****)((int)pppppcVar22 + (local_120 - 0xb)); piVar12 = memchr(pppppcVar22,0x2d,(int)pppppcStack_1a4 - (int)pppppcVar22); if (piVar12 != (int *)0x0) { do { uVar29 = local_1b8; pcVar20 = "--set-stage="; uVar10 = 8; piVar23 = piVar12; do { if (*piVar23 != *(int *)pcVar20) { bVar8 = (byte)*piVar23; bVar30 = bVar8 < (byte)*pcVar20; if ((((bVar8 == *pcVar20) && (bVar30 = *(byte *)((int)piVar23 + 1) < (byte)pcVar20[1], *(byte *)((int)piVar23 + 1) == pcVar20[1])) && (bVar30 = *(byte *)((int)piVar23 + 2) < (byte)pcVar20[2], *(byte *)((int)piVar23 + 2) == pcVar20[2])) && (bVar30 = *(byte *)((int)piVar23 + 3) < (byte)pcVar20[3], *(byte *)((int)piVar23 + 3) == pcVar20[3])) { uVar10 = 0; } else { uVar10 = -(uint)bVar30 | 1; } goto LAB_009aac5a; } piVar23 = piVar23 + 1; pcVar20 = pcVar20 + 4; bVar30 = 3 < uVar10; uVar10 = uVar10 - 4; } while (bVar30); uVar10 = 0; LAB_009aac5a: if (uVar10 == 0) { piVar12 = (int *)((int)piVar12 - local_1b0._4_4_); if (piVar12 == (int *)0x0) { local_8._0_1_ = 8; local_19c = CONCAT44(local_1b8,(uint)local_19c) | 0x2000000000; piStack_1d8 = piVar12; piStack_1d4 = piVar12; piStack_1d0 = piVar12; string_split(); piVar23 = piStack_1d8; piVar12 = piStack_1d8 + 6; if (0xf < (uint)piStack_1d8[0xb]) { piVar12 = (int *)*piVar12; } local_1a8 = (int *)atoi((char *)piVar12); local_1b8 = uVar29 & 0xffffffdf; cStack_191 = '\x01'; local_8._0_1_ = 7; if (piVar23 == (int *)0x0) goto LAB_009aae76; piVar12 = piStack_1d4; piVar27 = piVar23; if (piVar23 == piStack_1d4) goto LAB_009aae11; goto LAB_009aadc0; } break; } piVar12 = memchr((void *)((int)piVar12 + 1),0x2d,(int)pppppcStack_1a4 - ((int)piVar12 + 1) ); } while (piVar12 != (int *)0x0); pppppcVar11 = local_19c._4_4_; } } pppppcStack_1a4 = (char *****)local_130; if (0xf < local_11c) { pppppcStack_1a4 = pppppcVar11; } if (0x10 < local_120) { pcVar20 = (char *)((int)pppppcStack_1a4 + (local_120 - 0x10)); local_1b0 = CONCAT44(pcVar20,(int *)local_1b0); pbVar16 = memchr(pppppcStack_1a4,0x2d,(int)pcVar20 - (int)pppppcStack_1a4); if (pbVar16 != (byte *)0x0) { do { uVar29 = local_1b8; pcVar20 = "--set-stage-type="; uVar10 = 0xd; pbVar9 = pbVar16; do { if (*(int *)pbVar9 != *(int *)pcVar20) break; pbVar9 = pbVar9 + 4; pcVar20 = pcVar20 + 4; bVar30 = 3 < uVar10; uVar10 = uVar10 - 4; } while (bVar30); bVar30 = *pbVar9 < (byte)*pcVar20; if ((*pbVar9 == *pcVar20) && ((uVar10 == 0xfffffffd || (((bVar30 = pbVar9[1] < (byte)pcVar20[1], pbVar9[1] == pcVar20[1] && (bVar30 = pbVar9[2] < (byte)pcVar20[2], pbVar9[2] == pcVar20[2])) && (bVar30 = pbVar9[3] < (byte)pcVar20[3], pbVar9[3] == pcVar20[3])))))) { uVar10 = 0; } else { uVar10 = -(uint)bVar30 | 1; } if (uVar10 == 0) { pbVar16 = pbVar16 + -(int)pppppcStack_1a4; if (pbVar16 == (byte *)0x0) { local_8._0_1_ = 9; local_19c = CONCAT44(local_1b8,(uint)local_19c) | 0x4000000000; pbStack_1e4 = pbVar16; pbStack_1e0 = pbVar16; pbStack_1dc = pbVar16; string_split(); pbVar9 = pbStack_1e4; pbVar16 = pbStack_1e4 + 0x18; if (0xf < *(uint *)(pbStack_1e4 + 0x2c)) { pbVar16 = *(byte **)pbVar16; } local_1a0 = atoi((char *)pbVar16); local_1b8 = uVar29 & 0xffffffbf; cStack_191 = '\x01'; local_8._0_1_ = 7; if (pbVar9 == (byte *)0x0) goto LAB_009aae76; pbVar16 = pbStack_1e0; pbVar28 = pbVar9; if (pbVar9 == pbStack_1e0) goto LAB_009ab011; goto LAB_009aafc0; } break; } pbVar16 = memchr(pbVar16 + 1,0x2d,local_1b0._4_4_ - (int)(pbVar16 + 1)); } while (pbVar16 != (byte *)0x0); pppppcVar11 = local_19c._4_4_; } } pppppcStack_1a4 = (char *****)local_130; if (0xf < local_11c) { pppppcStack_1a4 = pppppcVar11; } if (0xb < local_120) { pcVar20 = (char *)((int)pppppcStack_1a4 + (local_120 - 0xb)); local_1b0 = CONCAT44(pcVar20,(int *)local_1b0); piVar12 = memchr(pppppcStack_1a4,0x2d,(int)pcVar20 - (int)pppppcStack_1a4); if (piVar12 != (int *)0x0) { LAB_009aaf00: uVar29 = local_1b8; pcVar20 = "--load-room="; uVar10 = 8; piVar23 = piVar12; do { if (*piVar23 != *(int *)pcVar20) { bVar8 = (byte)*piVar23; bVar30 = bVar8 < (byte)*pcVar20; if (((bVar8 == *pcVar20) && (bVar30 = *(byte *)((int)piVar23 + 1) < (byte)pcVar20[1], *(byte *)((int)piVar23 + 1) == pcVar20[1])) && ((bVar30 = *(byte *)((int)piVar23 + 2) < (byte)pcVar20[2], *(byte *)((int)piVar23 + 2) == pcVar20[2] && (bVar30 = *(byte *)((int)piVar23 + 3) < (byte)pcVar20[3], *(byte *)((int)piVar23 + 3) == pcVar20[3])))) { uVar10 = 0; } else { uVar10 = -(uint)bVar30 | 1; } goto LAB_009ab0a3; } piVar23 = piVar23 + 1; pcVar20 = pcVar20 + 4; bVar30 = 3 < uVar10; uVar10 = uVar10 - 4; } while (bVar30); uVar10 = 0; LAB_009ab0a3: if (uVar10 != 0) goto code_r0x009ab0ab; ppuVar26 = (undefined **)((int)piVar12 - (int)pppppcStack_1a4); if (ppuVar26 == (undefined **)0x0) { local_8._0_1_ = 10; local_19c = CONCAT44(local_1b8,(uint)local_19c) | 0x8000000000; ppuStack_1c4 = ppuVar26; ppuStack_1c0 = ppuVar26; ppuStack_1bc = ppuVar26; string_split(); ppuVar26 = ppuStack_1c4; pppppbVar18 = (byte *****)(ppuStack_1c4 + 6); if (&pppppbStack_148 != (byte ******)pppppbVar18) { if ((undefined *)0xf < ppuStack_1c4[0xb]) { pppppbVar18 = (byte *****)*pppppbVar18; } std::string::assign((char *)&pppppbStack_148,(byte *)pppppbVar18,(uint)ppuStack_1c4[10]) ; } cStack_191 = '\x01'; if (2 < (uint)uStack_138) { pppppbVar18 = (byte *****)&pppppbStack_148; if (0xf < uStack_138._4_4_) { pppppbVar18 = pppppbStack_148; } if (*(byte *)((int)pppppbVar18 + 1) == 0x3a) { pppppbVar18 = (byte *****)&pppppbStack_148; if (0xf < uStack_138._4_4_) { pppppbVar18 = pppppbStack_148; } if (*(byte *)((int)pppppbVar18 + 2) == 0x5c) goto LAB_009ab4a7; pppppbVar18 = (byte *****)&pppppbStack_148; if (0xf < uStack_138._4_4_) { pppppbVar18 = pppppbStack_148; } if (*(byte *)((int)pppppbVar18 + 2) == 0x2f) goto LAB_009ab4a7; } } GetCurrentDirectoryA(0x104,(LPSTR)abStack_118); uStack_164 = 0xf; uStack_168 = 1; apvStack_178[0] = (void *)0x5c; local_8._0_1_ = 0xb; pbVar16 = abStack_118; uStack_150 = 0; uStack_14c = 0xf; apvStack_160[0] = (void *)0x0; do { bVar8 = *pbVar16; pbVar16 = pbVar16 + 1; } while (bVar8 != 0); std::string::assign((char *)apvStack_160,abStack_118,(int)pbVar16 - (int)(abStack_118 + 1) ); local_8._0_1_ = 0xc; std::string::concat_move(acStack_190,local_1b0._4_4_,apvStack_160,apvStack_178); local_19c = CONCAT44(uVar29,(uint)local_19c) | 0x18000000000; local_8._0_1_ = 0xd; pppppbVar18 = (byte *****)&pppppbStack_148; if (0xf < uStack_138._4_4_) { pppppbVar18 = pppppbStack_148; } pfVar19 = std::string::append(acStack_190,(byte *)pppppbVar18,(uint)uStack_138); uVar29 = uVar29 | 0x380; local_1b0 = *(undefined8 *)(pfVar19 + 4); KStack_1f8._green = *pfVar19; KStack_1f8._blue = pfVar19[1]; KStack_1f8._alpha = pfVar19[2]; KStack_1f8._unk = (int)pfVar19[3]; pfVar19[4] = 0.0; pfVar19[5] = 2.10195e-44; *(undefined1 *)pfVar19 = 0; if (0xf < uStack_138._4_4_) { uVar10 = uStack_138._4_4_ + 1; pppppbVar18 = pppppbStack_148; if (0xfff < uVar10) { pppppbVar18 = (byte *****)pppppbStack_148[-1]; uVar10 = uStack_138._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbStack_148 + (-4 - (int)pppppbVar18))) goto LAB_009ab6a1; } operator_delete(pppppbVar18,uVar10); } pppppbStack_148 = (byte *****)KStack_1f8._green; fStack_144 = KStack_1f8._blue; fStack_140 = KStack_1f8._alpha; fStack_13c = (float)KStack_1f8._unk; uStack_138 = local_1b0; std::string::_Tidy_deallocate(acStack_190); local_8._0_1_ = 0xb; if (0xf < uStack_14c) { uVar10 = uStack_14c + 1; pvVar25 = apvStack_160[0]; if (0xfff < uVar10) { pvVar25 = *(void **)((int)apvStack_160[0] + -4); uVar10 = uStack_14c + 0x24; if (0x1f < (uint)((int)apvStack_160[0] + (-4 - (int)pvVar25))) goto LAB_009ab6a1; } operator_delete(pvVar25,uVar10); } local_8._0_1_ = 10; if (0xf < uStack_164) { uVar10 = uStack_164 + 1; pvVar25 = apvStack_178[0]; if (0xfff < uVar10) { pvVar25 = *(void **)((int)apvStack_178[0] + -4); uVar10 = uStack_164 + 0x24; if (0x1f < (uint)((int)apvStack_178[0] + (-4 - (int)pvVar25))) goto LAB_009ab6a1; } operator_delete(pvVar25,uVar10); } LAB_009ab4a7: ppuVar6 = ppuStack_1c0; local_1b8 = uVar29 & 0xffffff7f; if (ppuVar26 == (undefined **)0x0) goto LAB_009aae76; for (; ppuVar26 != ppuVar6; ppuVar26 = ppuVar26 + 6) { std::string::_Tidy_deallocate((char *)ppuVar26); } deallocate(ppuStack_1c4,((int)ppuStack_1bc - (int)ppuStack_1c4) / 0x18); ppuStack_1c4 = (undefined **)0x0; ppuStack_1c0 = (undefined **)0x0; ppuStack_1bc = (undefined **)0x0; pppppcVar11 = local_130[0]; goto LAB_009ab0d0; } goto LAB_009ab0ca; } } goto LAB_009ab0d0; } LAB_009ab524: pppppbVar18 = pppppbStack_148; iVar15 = LobbySteam::find_by_id_string(); local_8 = CONCAT31(local_8._1_3_,0xe); if (*(int **)(iVar15 + 4) == (int *)0x0) { LAB_009ab553: cStack_191 = '\0'; } else { cVar7 = (**(code **)(**(int **)(iVar15 + 4) + 0xc))(); cStack_191 = '\x01'; if (cVar7 == '\0') goto LAB_009ab553; } ppuStack_1c4 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 0xf; if (((ppuStack_1bc != (undefined **)0x0) && (cVar7 = (**(code **)(*ppuStack_1bc + 0xc))(), cVar7 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } pMVar14 = g_manager; local_8._0_1_ = 6; if (cStack_191 == '\0') { piVar12 = (g_manager->_persistentGameData)._cutsceneCounters + 1; *piVar12 = *piVar12 + 1; *(undefined1 *)&pMVar14->_persistentGameData = 1; (pMVar14->_cutsceneManager).field_0x848 = 1; (pMVar14->_cutsceneManager)._isQueuedCleanup = 1; pMVar14->_cutsceneNextMenuState = 1; (pMVar14->_cutsceneManager)._queuedCutsceneId = 1; (pMVar14->_achievementOverlay)._isPopupBlocked = 1; } else { if (g_menuManager == (MenuManager *)0x0) { this_00 = operator_new(0xf930); local_1b0 = CONCAT44(this_00,(int *)local_1b0); local_8._0_1_ = 0x10; if (this_00 == (MenuManager *)0x0) { g_menuManager = (MenuManager *)0x0; } else { MenuManager::constructor(this_00); g_menuManager = extraout_EAX; } local_8._0_1_ = 6; MenuManager::Init(g_menuManager); } KColor::SetFromARGB(&KStack_1f8,0xffffffff); pMVar14 = g_manager; (g_manager->_pendingMenuFadeColor)._red = KStack_1f8._red; (pMVar14->_pendingMenuFadeColor)._green = KStack_1f8._green; (pMVar14->_pendingMenuFadeColor)._blue = KStack_1f8._blue; (pMVar14->_pendingMenuFadeColor)._alpha = KStack_1f8._alpha; pMVar14->_pendingMenuState = 2; (pMVar14->_pendingMenuFadeColor)._unk = KStack_1f8._unk; pMVar14->_isMenuPending = 1; LobbySteam::find_by_id_string(auStack_202 + -0xe); FUN_009db250(); pppppbVar18 = pppppbStack_148; } LAB_009ab67b: if (0xf < uStack_138._4_4_) { uVar29 = uStack_138._4_4_ + 1; pppppbVar24 = pppppbVar18; if (0xfff < uVar29) { pppppbVar24 = (byte *****)pppppbVar18[-1]; uVar29 = uStack_138._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)pppppbVar18 + (-4 - (int)pppppbVar24))) { LAB_009ab6a1: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar24,uVar29); } ExceptionList = local_10; return 1; LAB_009aadc0: do { uVar29 = piVar27[5]; if (0xf < uVar29) { pvVar25 = (void *)*piVar27; uVar10 = uVar29 + 1; pvVar17 = pvVar25; if (0xfff < uVar10) { pvVar17 = *(void **)((int)pvVar25 + -4); uVar10 = uVar29 + 0x24; if (0x1f < (uint)((int)pvVar25 + (-4 - (int)pvVar17))) goto LAB_009ab6a1; } operator_delete(pvVar17,uVar10); piVar12 = piStack_1d4; } piVar27[4] = 0; piVar27[5] = 0xf; *(undefined1 *)piVar27 = 0; piVar27 = piVar27 + 6; } while (piVar27 != piVar12); LAB_009aae11: uVar29 = (((int)piStack_1d0 - (int)piVar23) / 0x18) * 0x18; piVar12 = piVar23; if (0xfff < uVar29) { piVar12 = (int *)piVar23[-1]; uVar29 = uVar29 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar23 + (-4 - (int)piVar12))) goto LAB_009ab6a1; } operator_delete(piVar12,uVar29); piStack_1d8 = (int *)0x0; piStack_1d4 = (int *)0x0; piStack_1d0 = (int *)0x0; LAB_009aae76: pppppcVar11 = local_130[0]; LAB_009ab0d0: local_8._0_1_ = 6; if (0xf < local_11c) { uVar29 = local_11c + 1; pppppcVar22 = pppppcVar11; if (0xfff < uVar29) { pppppcVar22 = (char *****)pppppcVar11[-1]; uVar29 = local_11c + 0x24; if ((char *)0x1f < (char *)((int)pppppcVar11 + (-4 - (int)pppppcVar22))) goto LAB_009ab6a1; } operator_delete(pppppcVar22,uVar29); } pMVar14 = g_manager; iVar15 = (uint)local_19c + 1; local_19c = CONCAT44(local_19c._4_4_,iVar15); if (local_1cc <= iVar15) goto code_r0x009ab123; goto LAB_009aab70; LAB_009aafc0: do { uVar29 = *(uint *)(pbVar28 + 0x14); if (0xf < uVar29) { pvVar25 = *(void **)pbVar28; uVar10 = uVar29 + 1; pvVar17 = pvVar25; if (0xfff < uVar10) { pvVar17 = *(void **)((int)pvVar25 + -4); uVar10 = uVar29 + 0x24; if (0x1f < (uint)((int)pvVar25 + (-4 - (int)pvVar17))) goto LAB_009ab6a1; } operator_delete(pvVar17,uVar10); pbVar16 = pbStack_1e0; } pbVar28[0x10] = 0; pbVar28[0x11] = 0; pbVar28[0x12] = 0; pbVar28[0x13] = 0; pbVar28[0x14] = 0xf; pbVar28[0x15] = 0; pbVar28[0x16] = 0; pbVar28[0x17] = 0; *pbVar28 = 0; pbVar28 = pbVar28 + 0x18; } while (pbVar28 != pbVar16); LAB_009ab011: uVar29 = (((int)pbStack_1dc - (int)pbVar9) / 0x18) * 0x18; pbVar16 = pbVar9; if (0xfff < uVar29) { pbVar16 = *(byte **)(pbVar9 + -4); uVar29 = uVar29 + 0x23; if ((byte *)0x1f < pbVar9 + (-4 - (int)pbVar16)) goto LAB_009ab6a1; } operator_delete(pbVar16,uVar29); pbStack_1e4 = (byte *)0x0; pbStack_1e0 = (byte *)0x0; pbStack_1dc = (byte *)0x0; pppppcVar11 = local_130[0]; goto LAB_009ab0d0; code_r0x009ab0ab: piVar12 = memchr((void *)((int)piVar12 + 1),0x2d,local_1b0._4_4_ - ((int)piVar12 + 1)); if (piVar12 == (int *)0x0) goto LAB_009ab0ca; goto LAB_009aaf00; LAB_009ab0ca: pppppcVar11 = local_19c._4_4_; goto LAB_009ab0d0; code_r0x009ab123: if (cStack_191 != '\0') { pppppbVar18 = (byte *****)&pppppbStack_148; if (0xf < uStack_138._4_4_) { pppppbVar18 = pppppbStack_148; } pDVar5 = &g_manager->_dailyChallenge; pMVar14->_rerunAvailable = 0; pMVar14->_startingFromRerun = 0; pMVar14->_debugStart = 1; (pMVar14->_dailyChallenge)._id = 0; (pMVar14->_dailyChallenge)._seed = 0; (pMVar14->_dailyChallenge)._specialDailyId = 0; (pMVar14->_dailyChallenge)._isPractice = 0; ChallengeParam::Reset(&pDVar5->_params); *(int **)&pMVar14->field_0x4b1a0 = local_1a8; *(int *)&pMVar14->field_0x4b1a4 = local_1a0; pppppbVar24 = pppppbVar18; do { cVar7 = *(char *)pppppbVar24; pppppbVar24 = (byte *****)((int)pppppbVar24 + 1); } while (cVar7 != '\0'); std::string::assign(&pMVar14->field_0x4b1a8,(byte *)pppppbVar18, (int)pppppbVar24 - ((int)pppppbVar18 + 1)); pMVar14->_starting = 1; pMVar14->_startDifficulty = 0; pMVar14->_networkPlay = 0; pMVar14->_consecutiveResetCount = 0; pppppbVar18 = pppppbStack_148; goto LAB_009ab67b; } goto LAB_009ab524; } //@@ 009ab700 Isaac::Shutdown /* ZHL [exact] static __cdecl void Isaac::Shutdown(); */ void Isaac::Shutdown(void) { Game *ptr; void *this; Manager *pMVar1; MenuManager *ptr_00; uint uVar2; int *piVar3; PersistentGameData *pPVar4; undefined *this_00; int iVar5; undefined4 uStack_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Isaac is shutting down...\n"); if ((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (*(int *)&g_game->_gameOver == 0)) { if ((g_game->_challenge != 0) || (uStack_14 = 1, (g_game->_dailyChallenge)._id != 0)) { uStack_14 = 0; } FUN_0090cd10(0,uStack_14,uVar2); } if ((((g_game != (Game *)0x0) && ((g_game->_dailyChallenge)._id != 0)) && ((g_game->_dailyChallenge)._isPractice == 0)) && (*(int *)&g_game->field_0x2673c == 0)) { pPVar4 = &g_manager->_persistentGameData; (g_manager->_persistentGameData)._eventCounters[0xc0] = 0; PersistentGameData::IncreaseEventCounter(pPVar4,0x20a,1); PersistentGameData::Save(&g_manager->_persistentGameData); } OptionsConfig::Save(&g_manager->_optionsConfig); if (((g_manager->_currentSaveSlot != 0) && (pPVar4 = &g_manager->_persistentGameData, *(char *)&g_manager->_persistentGameData != '\0')) && ((g_manager->_persistentGameData)._isFileLoaded != 0)) { *(undefined1 *)pPVar4 = 0; Manager::BackupSaveFile((Manager *)pPVar4); pMVar1 = g_manager; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar3 == 0) || ((pMVar1->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(pPVar4); } else { PersistentGameData::SaveToSteamCloud(pPVar4); } } if (g_manager->_state == 2) { Game::Exit(1); } ptr_00 = g_menuManager; if (g_menuManager != (MenuManager *)0x0) { MenuManager::~MenuManager(); operator_delete(ptr_00,0xf930); g_menuManager = (MenuManager *)0x0; } ptr = g_game; if (g_game != (Game *)0x0) { Game::~Game(); operator_delete(ptr,0x68e88); g_game = (Game *)0x0; } pMVar1 = g_manager; if (g_manager != (Manager *)0x0) { Manager::destructor(g_manager); operator_delete(pMVar1,0x4d088); g_manager = (Manager *)0x0; } AnmCache::~AnmCache(); this_00 = &g_shaders; iVar5 = 0x14; do { (*(code *)epoxy_glDeleteProgram)(*(undefined4 *)(this_00 + 0x4c)); KAGE::Graphics::ShaderBase::free_uniforms(this_00); this = g_luaEngine; this_00 = this_00 + 0x50; iVar5 = iVar5 + -1; } while (iVar5 != 0); if (g_luaEngine != (void *)0x0) { uStack_8 = iVar5; LuaEngine::destroy(g_luaEngine); FID_conflict__Tidy(this); uStack_8 = 0xffffffff; operator_delete(this,0x268); } g_luaEngine = (void *)0x0; KAGE_LogMessage(1,(byte *)"Isaac has shut down successfully \n"); ExceptionList = local_10; return; } //@@ 009ab970 resources_mount_language /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? from reload_resource_paths: path_join, then when a language is set builds "resources" + "." + Manager::GetLanguage suffix and mounts it (FUN_0060c790) */ void resources_mount_language(void) { byte *pbVar1; void *pvVar2; byte ****ppppbVar3; uint uVar4; byte *local_7c; int local_78; byte ****local_74 [5]; uint local_60; void *local_5c [4]; undefined4 local_4c; uint local_48; void *local_44 [4]; undefined4 local_34; uint local_30; void *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0e075; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_78 = -1; pbVar1 = path_join((byte *)"resources",&s_empty,0,1); local_8 = (void *)0x0; local_7c = pbVar1; FUN_00a15f10(&local_7c); if (pbVar1 != (byte *)0x0) { local_8 = (void *)0x1; tracked_alloc(1,pbVar1,0); } local_8 = (void *)0xffffffff; if ((g_manager != (Manager *)0x0) && (*(int *)&g_manager->_stringTable != 0)) { pbVar1 = Manager::GetLanguage(); local_18 = 0xf; local_1c = 1; local_2c[0] = (void *)0x2e; local_8 = (void *)0x2; pvVar2 = std::string::string_from_cstr((char *)local_5c,(byte *)"resources"); local_8._0_1_ = 3; std::string::concat_move((char *)local_44,local_78,pvVar2,local_2c); local_8._0_1_ = 4; FUN_0060c790(pbVar1); local_8._0_1_ = 6; if (0xf < local_30) { uVar4 = local_30 + 1; pvVar2 = local_44[0]; if (0xfff < uVar4) { pvVar2 = *(void **)((int)local_44[0] + -4); uVar4 = local_30 + 0x24; if (0x1f < (uint)((int)local_44[0] + (-4 - (int)pvVar2))) goto LAB_009abb2a; } operator_delete(pvVar2,uVar4); } local_34 = 0; local_30 = 0xf; local_44[0] = (void *)((uint)local_44[0] & 0xffffff00); local_8._0_1_ = 7; if (0xf < local_48) { uVar4 = local_48 + 1; pvVar2 = local_5c[0]; if (0xfff < uVar4) { pvVar2 = *(void **)((int)local_5c[0] + -4); uVar4 = local_48 + 0x24; if (0x1f < (uint)((int)local_5c[0] + (-4 - (int)pvVar2))) goto LAB_009abb2a; } operator_delete(pvVar2,uVar4); } local_4c = 0; local_48 = 0xf; local_5c[0] = (void *)((uint)local_5c[0] & 0xffffff00); local_8._0_1_ = 8; if (0xf < local_18) { uVar4 = local_18 + 1; pvVar2 = local_2c[0]; if (0xfff < uVar4) { pvVar2 = *(void **)((int)local_2c[0] + -4); uVar4 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar2))) { LAB_009abb2a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar4); } ppppbVar3 = (byte ****)local_74; if (0xf < local_60) { ppppbVar3 = local_74[0]; } local_78 = 0xffffffff; local_7c = path_join((byte *)ppppbVar3,&s_empty,0,1); local_8 = (void *)CONCAT31(local_8._1_3_,9); FUN_00a15f10(&local_7c); FUN_00a15c00(); if (0xf < local_60) { uVar4 = local_60 + 1; ppppbVar3 = local_74[0]; if (0xfff < uVar4) { ppppbVar3 = (byte ****)local_74[0][-1]; uVar4 = local_60 + 0x24; if ((byte *)0x1f < (byte *)((int)local_74[0] + (-4 - (int)ppppbVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar3,uVar4); } } ExceptionList = local_10; return; } //@@ 009abbd0 reload_resource_paths /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? Manager::validate_language and IsaacStartup: rebuilds the resources mount list (FUN_009ab970 "resources"), the archive vector DAT_00c379e8 and g_mountPrefixes from FileSystem::GetMountPrefixes */ void reload_resource_paths(void) { uint uVar1; byte *ptr; int iVar2; byte ***pppbVar3; undefined4 uVar4; undefined1 local_24 [12]; byte *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af3860; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; local_14 = -1; uVar4 = 1; ptr = path_join(&s_empty,&s_empty,0,1); local_18 = ptr; iVar2 = FUN_00a16e00(uVar4,uVar1); local_14 = iVar2; if (ptr != (byte *)0x0) { local_8 = 0; tracked_alloc(1,ptr,0); local_8 = 0xffffffff; } DAT_00c379ec = DAT_00c379e8; if (iVar2 != 0) { if (DAT_00c379e8 == DAT_00c379f0) { std::vector<4byte>::_Emplace_reallocate(DAT_00c379e8,&local_14); } else { *DAT_00c379e8 = iVar2; DAT_00c379ec = DAT_00c379ec + 1; } } resources_mount_language(); pppbVar3 = FileSystem::GetMountPrefixes(local_24); if (pppbVar3 != &g_mountPrefixes) { FID_conflict__Tidy(&g_mountPrefixes); g_mountPrefixes = *pppbVar3; g_mountPrefixesEnd = pppbVar3[1]; _DAT_00c798c0 = pppbVar3[2]; *pppbVar3 = (byte **)0x0; pppbVar3[1] = (byte **)0x0; pppbVar3[2] = (byte **)0x0; } FID_conflict__Tidy(local_24); ExceptionList = local_10; return; } //@@ 009abd50 FUN_009abd50 void FUN_009abd50(void) { int in_ECX; FUN_009ad470(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x34)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c)); std::string::_Tidy_deallocate((char *)(in_ECX + 4)); return; } //@@ 009abd80 ItemOverlay::~ItemOverlay /* DB: Game::~Game member at Game+0x1c034 (_itemOverlay): ANM2 at +8 (= Game ctor's ANM2 at 0x1c03c), vector of 0x30 x 0x58 at +0x11c (= Game ctor's _eh_vector at 0x1c150 with dtor 009abd50), ANM2 at +0x11a4 (= 0x1d1d8), multiset +0x11a0 */ void __thiscall ItemOverlay::~ItemOverlay(ItemOverlay *this) { EntityPtr *pEVar1; EntityPtr *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afa3c0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset(&this->_megaMushPlayerSprite); AnimationState::~AnimationState(&(this->_megaMushPlayerSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_megaMushPlayerSprite)._animState); std::string::_Tidy_deallocate((this->_megaMushPlayerSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_megaMushPlayerSprite); pEVar1 = &this->_player; if (*pEVar1 != (EntityPtr)0x0) { local_14 = pEVar1; std::multiset::erase(&local_14); *pEVar1 = (EntityPtr)0x0; } local_8 = 0xffffffff; _eh_vector_destructor_iterator_(&this->field_0x11c,0x58,0x30,FUN_009abd50); local_8 = 2; ANM2::Reset(&this->_sprite); AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_sprite)._animState); std::string::_Tidy_deallocate((this->_sprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_sprite); ExceptionList = local_10; return; } //@@ 009abe70 load_giantbook_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? giantbook.xml: root giantbook, anm2root attribute, entry/layer nodes; path redirected by ModManager::TryRedirectPath in Game::LoadConfigXmls; this[0x467] = entry count */ undefined4 load_giantbook_xml(byte *param_1) { qword qVar1; int *piVar2; float fVar3; float fVar4; float fVar5; float fVar6; uint uVar7; int *piVar8; undefined4 uVar9; int iVar10; byte *text; void *pvVar11; void *pvVar12; byte ******ppppppbVar13; void *ptr; undefined4 *in_ECX; byte *pbVar14; byte *pbVar15; std_string *psVar16; byte *pbVar17; uint size; char *pcVar19; char *pcVar18; qword *pqVar20; undefined4 *puVar21; bool bVar22; byte bVar23; undefined4 *puStack_1016c; uint uStack_10168; byte ******ppppppbStack_10164; undefined4 uStack_10160; undefined4 uStack_1015c; undefined4 uStack_10158; uint uStack_10154; uint uStack_10150; byte ******appppppbStack_1014c [4]; uint uStack_1013c; uint uStack_10138; byte ******ppppppbStack_10134; undefined4 uStack_10130; undefined4 uStack_1012c; undefined4 uStack_10128; uint uStack_10124; uint uStack_10120; int *piStack_1011c; int *piStack_10118; int *piStack_10114; undefined1 auStack_10110 [48]; undefined1 auStack_100e0 [65560]; char local_c8 [24]; float local_b0; float fStack_ac; float fStack_a8; float fStack_a4; undefined4 local_a0; undefined4 uStack_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 local_90; undefined4 uStack_8c; undefined4 local_88; float local_80; float fStack_7c; float fStack_78; float fStack_74; undefined4 local_60; undefined4 uStack_5c; undefined4 local_58; byte ******local_54 [4]; uint local_44; uint local_40; byte ******local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; uint local_2c; uint uStack_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte *****local_14; puStack_20 = (undefined1 *)(local_54 + 0x14); local_14 = (byte *****)0xffffffff; puStack_18 = &LAB_00b0e0d6; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_54 + 0x11); ExceptionList = &local_1c; *in_ECX = 0; in_ECX[0x467] = 0; local_24 = uVar7; piVar8 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar8 == (int *)0x0) { uVar9 = 0; } else { iVar10 = (**(code **)(*piVar8 + 4))(uVar7); text = operator_new_tracked(iVar10 + 1); (**(code **)(*piVar8 + 0x14))(text,1,iVar10); text[iVar10] = 0; (**(code **)*piVar8)(1); FUN_00413b90(); local_14 = (byte *****)0x0; uVar7 = 0x9abf4f; pbVar17 = text; rapidxml::xml_document::parse(auStack_10110,text); bVar23 = (byte)pbVar17; pvVar11 = xml_node::first_node(auStack_10110,(byte *)"giantbook",uVar7,bVar23); pvVar12 = xml_node::first_attribute(pvVar11,(byte *)"anm2root",uVar7,bVar23); local_44 = 0; local_40 = 0xf; local_54[0] = (byte ******)0x0; pbVar17 = &g_xmlNullStr; if (*(byte **)((int)pvVar12 + 4) != (byte *)0x0) { pbVar17 = *(byte **)((int)pvVar12 + 4); } pbVar14 = pbVar17; do { bVar23 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar23 != 0); uVar7 = (int)pbVar14 - (int)(pbVar17 + 1); std::string::assign((char *)local_54,pbVar17,uVar7); for (pvVar11 = xml_node::first_node(pvVar11,(byte *)"entry",(int)pbVar17,(byte)uVar7); pvVar11 != (void *)0x0; pvVar11 = *(void **)((int)pvVar11 + 0x2c)) { uStack_10154 = 0; uStack_10150 = 0xf; ppppppbStack_10164 = (byte ******)0x0; uStack_1013c = 0; uStack_10138 = 0xf; appppppbStack_1014c[0] = (byte ******)0x0; uStack_10124 = 0; uStack_10120 = 0xf; ppppppbStack_10134 = (byte ******)0x0; piStack_1011c = (int *)0x0; piStack_10118 = (int *)0x0; piStack_10114 = (int *)0x0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14 = (byte *****)CONCAT31(local_14._1_3_,2); puVar21 = *(undefined4 **)((int)pvVar11 + 0x20); if (puVar21 != (undefined4 *)0x0) { do { pbVar17 = (byte *)*puVar21; pbVar15 = s_id; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac095: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac09a; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac095; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac09a: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } uStack_10168 = atoi((char *)pbVar17); } else { pbVar15 = &DAT_00b1bff4; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac0f0: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac0f5; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac0f0; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac0f5: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } pbVar14 = pbVar17; do { bVar23 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar23 != 0); psVar16 = (std_string *)(pbVar14 + -(int)(pbVar17 + 1)); if ((std_string *)(0x7fffffff - local_44) < psVar16) { LAB_009aca82: /* WARNING: Subroutine does not return */ std::string::_Xlen(); } ppppppbVar13 = (byte ******)local_54; if (0xf < local_40) { ppppppbVar13 = local_54[0]; } std::string::concat((char *)&local_3c,(int)in_ECX,psVar16,(byte *)ppppppbVar13, local_44,pbVar17,(uint)psVar16); if (0xf < uStack_10150) { uVar7 = uStack_10150 + 1; ppppppbVar13 = ppppppbStack_10164; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)ppppppbStack_10164[-1]; uVar7 = uStack_10150 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_10164 + (-4 - (int)ppppppbVar13))) goto LAB_009aca0b; } operator_delete(ppppppbVar13,uVar7); } ppppppbStack_10164 = local_3c; uStack_10160 = uStack_38; uStack_1015c = uStack_34; uStack_10158 = uStack_30; uStack_10154 = local_2c; uStack_10150 = uStack_28; } else { pbVar15 = &DAT_00b1bffc; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac1d6: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac1db; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac1d6; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac1db: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } pbVar14 = pbVar17; do { bVar23 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar23 != 0); std::string::assign((char *)appppppbStack_1014c,pbVar17, (int)pbVar14 - (int)(pbVar17 + 1)); } else { pbVar15 = &DAT_00b66fec; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac240: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac245; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac240; pbVar15 = pbVar15 + 2; pbVar14 = pbVar14 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac245: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } pbVar14 = pbVar17; do { bVar23 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar23 != 0); psVar16 = (std_string *)(pbVar14 + -(int)(pbVar17 + 1)); if ((std_string *)(0x7fffffff - local_44) < psVar16) goto LAB_009aca82; ppppppbVar13 = (byte ******)local_54; if (0xf < local_40) { ppppppbVar13 = local_54[0]; } std::string::concat((char *)&local_3c,(int)in_ECX,psVar16,(byte *)ppppppbVar13, local_44,pbVar17,(uint)psVar16); if (0xf < uStack_10120) { uVar7 = uStack_10120 + 1; ppppppbVar13 = ppppppbStack_10134; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)ppppppbStack_10134[-1]; uVar7 = uStack_10120 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_10134 + (-4 - (int)ppppppbVar13))) goto LAB_009aca0b; } operator_delete(ppppppbVar13,uVar7); } ppppppbStack_10134 = local_3c; uStack_10130 = uStack_38; uStack_1012c = uStack_34; uStack_10128 = uStack_30; uStack_10124 = local_2c; uStack_10120 = uStack_28; } } } } } while ((puVar21[4] != 0) && (puVar21 = (undefined4 *)puVar21[6], puVar21 != (undefined4 *)0x0)); } pcVar18 = "layer"; do { pcVar19 = pcVar18; pcVar18 = pcVar19 + 1; } while (*pcVar18 != '\0'); for (puStack_1016c = *(undefined4 **)((int)pvVar11 + 0x18); puStack_1016c != (undefined4 *)0x0 ; puStack_1016c = (undefined4 *)puStack_1016c[0xb]) { pbVar17 = (byte *)*puStack_1016c; if (pbVar17 == (byte *)0x0) { pcVar18 = (char *)0x0; pbVar17 = &g_xmlNullStr; } else { pcVar18 = (char *)puStack_1016c[2]; } if (pcVar18 == pcVar19 + -0xb69bd7) { pbVar14 = pbVar17 + (int)pcVar18; if (pbVar14 <= pbVar17) goto joined_r0x009ac38e; iVar10 = (int)"layer" - (int)pbVar17; while (*pbVar17 == pbVar17[iVar10]) { pbVar17 = pbVar17 + 1; if (pbVar14 <= pbVar17) goto joined_r0x009ac38e; } } } puStack_1016c = (undefined4 *)0x0; joined_r0x009ac38e: if (puStack_1016c != (undefined4 *)0x0) { local_2c = 0; uStack_28 = 0xf; local_3c = (byte ******)0x0; local_14._1_3_ = (undefined3)((uint)local_14 >> 8); local_14._0_1_ = 3; puVar21 = (undefined4 *)puStack_1016c[8]; local_60 = 0; uStack_5c = 0; local_58 = 0; local_80 = 1.0; fStack_7c = 1.0; fStack_78 = 1.0; fStack_74 = 1.0; if (puVar21 != (undefined4 *)0x0) { do { pbVar17 = (byte *)*puVar21; pbVar15 = s_name; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac412: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac417; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac412; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac417: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } pbVar14 = pbVar17; do { bVar23 = *pbVar14; pbVar14 = pbVar14 + 1; } while (bVar23 != 0); std::string::assign((char *)&local_3c,pbVar17,(int)pbVar14 - (int)(pbVar17 + 1)); } else { pbVar15 = &DAT_00b6617c; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac477: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac47c; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac477; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac47c: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } iVar10 = atoi((char *)pbVar17); local_80 = (float)iVar10 / 255.0; } else { pbVar15 = &DAT_00b66178; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac4e0: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac4e5; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac4e0; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac4e5: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } iVar10 = atoi((char *)pbVar17); fStack_7c = (float)iVar10 / 255.0; } else { pbVar15 = &DAT_00b69bc4; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac545: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac54a; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac545; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac54a: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } iVar10 = atoi((char *)pbVar17); fStack_78 = (float)iVar10 / 255.0; } else { pbVar15 = &DAT_00b656e8; pbVar14 = &g_xmlNullStr; if (pbVar17 != (byte *)0x0) { pbVar14 = pbVar17; } do { bVar23 = *pbVar14; bVar22 = bVar23 < *pbVar15; if (bVar23 != *pbVar15) { LAB_009ac5a7: uVar7 = -(uint)bVar22 | 1; goto LAB_009ac5ac; } if (bVar23 == 0) break; bVar23 = pbVar14[1]; bVar22 = bVar23 < pbVar15[1]; if (bVar23 != pbVar15[1]) goto LAB_009ac5a7; pbVar14 = pbVar14 + 2; pbVar15 = pbVar15 + 2; } while (bVar23 != 0); uVar7 = 0; LAB_009ac5ac: if (uVar7 == 0) { pbVar17 = &g_xmlNullStr; if ((byte *)puVar21[1] != (byte *)0x0) { pbVar17 = (byte *)puVar21[1]; } iVar10 = atoi((char *)pbVar17); fStack_74 = (float)iVar10 / 255.0; } } } } } } while ((puVar21[4] != 0) && (puVar21 = (undefined4 *)puVar21[6], puVar21 != (undefined4 *)0x0)); } fVar6 = fStack_74; fVar5 = fStack_78; fVar4 = fStack_7c; fVar3 = local_80; if (local_2c != 0) { std::string::string(local_c8,&local_3c); local_b0 = fVar3; fStack_ac = fVar4; fStack_a8 = fVar5; fStack_a4 = fVar6; local_88 = local_58; local_a0 = 0; uStack_9c = 0; uStack_98 = 0; uStack_94 = 0; local_90 = local_60; uStack_8c = uStack_5c; local_14._0_1_ = 4; if (piStack_10118 == piStack_10114) { std::vector<68byte>::_Emplace_reallocate(piStack_10118,local_c8); } else { FUN_009ad580(); piStack_10118 = piStack_10118 + 0x11; } std::string::_Tidy_deallocate(local_c8); } local_14 = (byte *****)CONCAT31(local_14._1_3_,2); if (0xf < uStack_28) { uVar7 = uStack_28 + 1; ppppppbVar13 = local_3c; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)local_3c[-1]; uVar7 = uStack_28 + 0x24; if ((byte *)0x1f < (byte *)((int)local_3c + (-4 - (int)ppppppbVar13))) goto LAB_009aca0b; } operator_delete(ppppppbVar13,uVar7); } pcVar18 = "layer"; do { pcVar19 = pcVar18; pcVar18 = pcVar19 + 1; } while (*pcVar18 != '\0'); for (puStack_1016c = (undefined4 *)puStack_1016c[0xb]; puStack_1016c != (undefined4 *)0x0; puStack_1016c = (undefined4 *)puStack_1016c[0xb]) { pbVar17 = (byte *)*puStack_1016c; if (pbVar17 == (byte *)0x0) { pcVar18 = (char *)0x0; pbVar17 = &g_xmlNullStr; } else { pcVar18 = (char *)puStack_1016c[2]; } if (pcVar18 == pcVar19 + -0xb69bd7) { pbVar14 = (byte *)(pcVar18 + (int)pbVar17); if (pbVar14 <= pbVar17) goto joined_r0x009ac38e; iVar10 = (int)"layer" - (int)pbVar17; while (*pbVar17 == pbVar17[iVar10]) { pbVar17 = pbVar17 + 1; if (pbVar14 <= pbVar17) goto joined_r0x009ac38e; } } } puStack_1016c = (undefined4 *)0x0; goto joined_r0x009ac38e; } if (uStack_10168 < 0x30) { in_ECX[uStack_10168 * 0x16 + 0x47] = uStack_10168; if ((byte *******)(in_ECX + uStack_10168 * 0x16 + 0x48) != &ppppppbStack_10164) { ppppppbVar13 = (byte ******)&ppppppbStack_10164; if (0xf < uStack_10150) { ppppppbVar13 = ppppppbStack_10164; } std::string::assign((char *)(in_ECX + uStack_10168 * 0x16 + 0x48),(byte *)ppppppbVar13, uStack_10154); } if ((byte *******)(in_ECX + uStack_10168 * 0x16 + 0x4e) != appppppbStack_1014c) { ppppppbVar13 = (byte ******)appppppbStack_1014c; if (0xf < uStack_10138) { ppppppbVar13 = appppppbStack_1014c[0]; } std::string::assign((char *)(in_ECX + uStack_10168 * 0x16 + 0x4e),(byte *)ppppppbVar13, uStack_1013c); } if ((byte *******)(in_ECX + uStack_10168 * 0x16 + 0x54) != &ppppppbStack_10134) { ppppppbVar13 = (byte ******)&ppppppbStack_10134; if (0xf < uStack_10120) { ppppppbVar13 = ppppppbStack_10134; } std::string::assign((char *)(in_ECX + uStack_10168 * 0x16 + 0x54),(byte *)ppppppbVar13, uStack_10124); } if ((int **)(in_ECX + uStack_10168 * 0x16 + 0x5a) != &piStack_1011c) { std::vector<68byte>::assign(piStack_1011c,piStack_10118,in_ECX); } } piVar2 = piStack_10118; local_14 = (byte *****)CONCAT31(local_14._1_3_,1); piVar8 = piStack_1011c; if (piStack_1011c != (int *)0x0) { for (; piVar8 != piVar2; piVar8 = piVar8 + 0x11) { uVar7 = piVar8[5]; if (0xf < uVar7) { pvVar12 = (void *)*piVar8; size = uVar7 + 1; ptr = pvVar12; if (0xfff < size) { ptr = *(void **)((int)pvVar12 + -4); size = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)ptr))) goto LAB_009aca0b; } operator_delete(ptr,size); } piVar8[4] = 0; piVar8[5] = 0xf; *(undefined1 *)piVar8 = 0; } uVar7 = (((int)piStack_10114 - (int)piStack_1011c) / 0x44) * 0x44; piVar8 = piStack_1011c; if (0xfff < uVar7) { piVar8 = (int *)piStack_1011c[-1]; uVar7 = uVar7 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piStack_1011c + (-4 - (int)piVar8))) goto LAB_009aca0b; } operator_delete(piVar8,uVar7); piStack_1011c = (int *)0x0; piStack_10118 = (int *)0x0; piStack_10114 = (int *)0x0; } if (0xf < uStack_10120) { uVar7 = uStack_10120 + 1; ppppppbVar13 = ppppppbStack_10134; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)ppppppbStack_10134[-1]; uVar7 = uStack_10120 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_10134 + (-4 - (int)ppppppbVar13))) goto LAB_009aca0b; } operator_delete(ppppppbVar13,uVar7); } uStack_10124 = 0; uStack_10120 = 0xf; ppppppbStack_10134 = (byte ******)((uint)ppppppbStack_10134 & 0xffffff00); if (0xf < uStack_10138) { uVar7 = uStack_10138 + 1; ppppppbVar13 = appppppbStack_1014c[0]; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)appppppbStack_1014c[0][-1]; uVar7 = uStack_10138 + 0x24; if ((byte *)0x1f < (byte *)((int)appppppbStack_1014c[0] + (-4 - (int)ppppppbVar13))) goto LAB_009aca0b; } operator_delete(ppppppbVar13,uVar7); } uStack_1013c = 0; uStack_10138 = 0xf; appppppbStack_1014c[0] = (byte ******)((uint)appppppbStack_1014c[0] & 0xffffff00); if (0xf < uStack_10150) { uVar7 = uStack_10150 + 1; ppppppbVar13 = ppppppbStack_10164; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)ppppppbStack_10164[-1]; uVar7 = uStack_10150 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbStack_10164 + (-4 - (int)ppppppbVar13))) goto LAB_009aca0b; } operator_delete(ppppppbVar13,uVar7); } } local_14 = (byte *****)((uint)local_14 & 0xffffff00); if (0xf < local_40) { uVar7 = local_40 + 1; ppppppbVar13 = local_54[0]; if (0xfff < uVar7) { ppppppbVar13 = (byte ******)local_54[0][-1]; uVar7 = local_40 + 0x24; if ((byte *)0x1f < (byte *)((int)local_54[0] + (-4 - (int)ppppppbVar13))) { LAB_009aca0b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar13,uVar7); } local_14 = (byte *****)0x5; xml_memory_pool::clear(auStack_100e0); if (g_mainHeap == (void *)0x0) { pqVar20 = &g_allocatedBytesNoHeap; } else { pqVar20 = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar7 = *(uint *)(text + -4); qVar1 = *pqVar20; *(uint *)pqVar20 = (uint)*pqVar20 - uVar7; *(uint *)((int)pqVar20 + 4) = *(uint *)((int)pqVar20 + 4) - (uint)((uint)qVar1 < uVar7); free(text + -4); } uVar9 = 1; } ExceptionList = local_1c; return uVar9; } //@@ 009aca90 ItemOverlay::Update /* ZHL [exact] __thiscall void ItemOverlay::Update(bool unk); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall ItemOverlay::Update(ItemOverlay *this,byte unk) { int *piVar1; Game *this_00; Manager *pMVar2; AnimationState *this_01; byte bVar3; int iVar4; undefined4 *puVar5; int iVar6; void *pvVar7; Entity_Player *this_02; Entity_Player *this_03; int extraout_EDX; byte bVar8; uint uVar9; PlayerManager *pPVar10; undefined3 in_stack_00000005; float Pitch; int local_c; AnimationState *local_8; bVar8 = unk; if (this->_state == 1) { this->_delay = this->_delay + -1; if (this->_delay < 1) { this->_state = 2; return; } return; } if (this->_state == 0) { return; } if ((this->_megaMushPlayerSprite)._loaded != 0) { if (unk == 0) { ANM2::Update(&this->_megaMushPlayerSprite); } else if ((this->_megaMushPlayerSprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_megaMushPlayerSprite)._animState, *(int *)((int)(this->_megaMushPlayerSprite)._animState._animData + 0x30) + -1); } if (((this->_player != (EntityPtr)0x0) && (bVar3 = ANM2::IsPlaying(&this->_megaMushPlayerSprite,(byte *)"Transform"), bVar3 != 0)) && (bVar8 == 0)) { iVar4 = ANM2::GetFrame(&this->_megaMushPlayerSprite); pMVar2 = g_manager; if (iVar4 == 1) { local_8 = (AnimationState *)0x9d; seed_fart_sound_override((int *)&local_8); Pitch = 1.0; iVar4 = 2; } else { if (iVar4 == 6) { local_8 = (AnimationState *)0x10c; seed_fart_sound_override((int *)&local_8); Pitch = 0.8; } else if (iVar4 == 0xb) { local_8 = (AnimationState *)0x10c; seed_fart_sound_override((int *)&local_8); Pitch = 1.0; } else { if (iVar4 != 0x10) goto LAB_009acc1b; local_8 = (AnimationState *)0x10c; seed_fart_sound_override((int *)&local_8); Pitch = 1.2; } iVar4 = 1; } SoundEffects::Play(&pMVar2->_sfxManager,(int)local_8,1.0,iVar4,0,Pitch,0.0); } } LAB_009acc1b: if ((this->_sprite)._loaded == 0) { if (this->_state != 2) { return; } if (((this->_megaMushPlayerSprite)._animState._animData != (void *)0x0) && ((this->_megaMushPlayerSprite)._animState._isPlaying != 0)) { return; } if (this->_player != (EntityPtr)0x0) { *(undefined1 *)((int)this->_player + 0x171) = 1; } this->_state = 0; return; } if ((this->_state == 2) && (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { this->_state = 0; } if (bVar8 == 0) { ANM2::Update(&this->_sprite); } else { if ((this->_sprite)._animState._animData == (void *)0x0) goto LAB_009accdf; AnimationState::AdvancePosition (&(this->_sprite)._animState, *(int *)((int)(this->_sprite)._animState._animData + 0x30) + -1); } if ((((this->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,(byte *)"Sound"), pMVar2 = g_manager, bVar3 != 0)) && (this->_overlayID == 0x27)) { local_8 = (AnimationState *)0x51; seed_fart_sound_override((int *)&local_8); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_8,1.0,2,0,1.0,0.0); } LAB_009accdf: local_8 = &(this->_sprite)._animState; if (((this->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(local_8,(byte *)"SleepFillHP"), bVar3 != 0)) { uVar9 = 0; pPVar10 = &g_game->_playerManager; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar10->_playerList)._begin >> 2 != 0) { do { pvVar7 = (pPVar10->_playerList)._end; if ((int)pvVar7 - (int)(pPVar10->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (pPVar10->_playerList)._end; } puVar5 = (pPVar10->_playerList)._begin; if (uVar9 < (uint)((int)pvVar7 - (int)puVar5 >> 2)) { puVar5 = puVar5 + uVar9; } if (((Entity_Player *)*puVar5)->_playerType != 0x28) { iVar4 = Entity_Player::GetHealthType((Entity_Player *)*puVar5); if ((iVar4 == 1) || (iVar4 == 2)) { iVar4 = this_02->_maxHearts; } else { iVar4 = this_02->_maxHearts + this_02->_boneHearts * 2; } if (iVar4 < 1) { Entity_Player::AddSoulHearts(this_02,6,0); } else { iVar6 = Entity_Player::GetHealthType(this_02); iVar4 = extraout_EDX; if ((iVar6 != 1) && (iVar6 != 2)) { iVar4 = extraout_EDX + this_03->_boneHearts * 2; } if (iVar4 <= this_03->_redHearts) goto LAB_009ace00; Entity_Player::SetFullHearts(this_03); } pMVar2 = g_manager; if (unk == 0) { local_c = 0x80; seed_fart_sound_override(&local_c); SoundEffects::Play(&pMVar2->_sfxManager,local_c,1.0,2,0,1.0,0.0); } } LAB_009ace00: uVar9 = uVar9 + 1; pPVar10 = &g_game->_playerManager; } while (uVar9 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar10->_playerList)._begin >> 2)); } PersistentGameData::IncreaseEventCounter(&g_manager->_persistentGameData,0xca,1); bVar8 = (byte)_unk; } this_01 = local_8; if ((this->_overlayID == 0x2c) && ((this->_sprite)._animState._animData != (void *)0x0)) { bVar3 = AnimationState::IsEventTriggered(local_8,(byte *)"Transition"); pMVar2 = g_manager; this_00 = g_game; if (bVar3 == 0) { if ((((this->_sprite)._animState._animData != (void *)0x0) && (bVar3 = AnimationState::IsEventTriggered(this_01,(byte *)"Static"), pMVar2 = g_manager, bVar3 != 0)) && (bVar8 == 0)) { _unk = 0x51; seed_fart_sound_override((int *)&unk); SoundEffects::Play(&pMVar2->_sfxManager,_unk,1.0,2,0,1.0,0.0); Room::PlayMusic(g_game->_room); MusicManager::EnableLayer(&g_manager->_musicManager,0,1); return; } } else { if (bVar8 == 0) { g_manager->field_0x21c10 = 0; if ((this_00->_difficulty == 2) || (this_00->_difficulty == 3)) { iVar4 = 0x12; } else { iVar4 = 0x1b; pMVar2->field_0x21c10 = 1; } (pMVar2->_nightmareScene)._stageBarIcons[0xd] = iVar4; *(undefined2 *)&pMVar2->_isNightmarePending = 0x101; } piVar1 = *(int **)(*(int *)((int)this_00->_room + 4) + 0x10); if (((piVar1 != (int *)0x0) && (this_00->_stage == 0xd)) && ((this_00->_stageType == 0 && ((*piVar1 == 0x23 && (piVar1[4] == 2)))))) { Level::SetStage((Level *)this_00,0xd,1); Room::reload_backdrop(); return; } } } return; } //@@ 009acfe0 ItemOverlay::Render /* DB: ECX = Game+0x1c034 (Game::Render LEA ECX,[EDI+0x1c034], structs.hpp _itemOverlay); REPENTOGON ItemOverlay::Render; overlay id this+4 (0x2d special full-screen tint), ANM2 at +8 / +0x11a4 prototype: REPENTOGON */ void __thiscall ItemOverlay::Render(ItemOverlay *this) { EntityPtr EVar1; void *quad; ItemOverlay *extraout_ECX; ANM2 *this_00; ItemOverlay *extraout_ECX_00; ItemOverlay *unusedArg; double dVar2; Vector local_d0; float local_c8; KColor local_c4; undefined1 local_b0 [172]; if (this->_state == 0) { return; } if (this->_state == 1) { return; } if ((this->_sprite)._loaded == 0) { unusedArg = this; if (this->_overlayID != 0x2d) goto LAB_009ad1ff; set_blend_mode(&DAT_00c798e0,1); local_c4._red = 0.0; local_c4._green = 0.0; local_c4._blue = 0.0; local_c4._alpha = 0.4; local_c4._unk = 0; local_d0.x = g_screenWidth; local_d0.y = g_screenHeight; render_quad_set_rect(local_b0,&g_vectorZero,&local_d0,&local_c4); render_color_shader_pass(quad); FUN_00682260(); unusedArg = extraout_ECX; if (((this->_megaMushPlayerSprite)._loaded == 0) || (EVar1 = this->_player, EVar1 == (EntityPtr)0x0)) goto LAB_009ad1ff; local_c8 = g_displayPixelRatio * g_screenPointScale; dVar2 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (*(float *)((int)EVar1 + 0x33c) - 60.0) * 0.65) * local_c8 + 0.5)); local_d0.x = (float)dVar2 / local_c8; dVar2 = floor((double)(((g_screenHeight - 182.0) * 0.5 + (*(float *)((int)EVar1 + 0x340) - 140.0) * 0.65) * local_c8 + 0.5)); this_00 = &this->_megaMushPlayerSprite; local_d0.y = (float)dVar2 / local_c8 + *(float *)((int)g_game->_room + 0x1208); local_d0.x = local_d0.x + *(float *)((int)g_game->_room + 0x1204); } else { this_00 = &this->_sprite; local_d0.y = g_screenHeight * 0.5; local_d0.x = g_screenWidth * 0.5; } ANM2::Render(this_00,&local_d0,&g_vectorZero,&g_vectorZero); unusedArg = extraout_ECX_00; LAB_009ad1ff: shader_cache_find((int)unusedArg); return; } //@@ 009ad210 ItemOverlay::Show /* ZHL [exact] __thiscall void ItemOverlay::Show(int eOverlayID, int delay, Entity_Player *player); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall ItemOverlay::Show(ItemOverlay *this,int eOverlayID,int delay,Entity_Player *player) { ANM2 *this_00; EntityPtr *pEVar1; void *pvVar2; int iVar3; float fVar4; float fVar5; float fVar6; Entity_Player *pEVar7; byte bVar8; LayerState *pLVar9; byte *pbVar10; uint uVar11; byte extraout_CL; byte extraout_CL_00; int iVar12; byte *pbVar13; int iVar14; byte *pbVar15; byte *pbVar16; bool bVar17; uint local_10; byte *local_c; if (0x2f < (uint)eOverlayID) { return; } this_00 = &this->_sprite; if (*(int *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x14) == 0) { ANM2::Reset(this_00); } else { ANM2::Load(this_00,(std_string *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 4),0); bVar8 = extraout_CL; if (*(int *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x44) != 0) { Sprite::ReplaceSpritesheet ((Sprite *)this_00,0, (std_string *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x34)); bVar8 = extraout_CL_00; } ANM2::LoadGraphics(this_00,bVar8); } pEVar7 = player; this->_overlayID = eOverlayID; pEVar1 = &this->_player; if (*pEVar1 != (EntityPtr)player) { if (*pEVar1 != (EntityPtr)0x0) { player = (Entity_Player *)pEVar1; std::multiset::erase(&player); } *pEVar1 = (EntityPtr)pEVar7; if (pEVar7 != (Entity_Player *)0x0) { std::multiset::insert(pEVar1); } } if ((this->_sprite)._loaded != 0) { local_10 = 0; iVar14 = *(int *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x4c); iVar12 = *(int *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x50) - iVar14; iVar3 = iVar12 >> 0x1f; if (iVar12 / 0x44 + iVar3 != iVar3) { player = (Entity_Player *)0x0; do { pbVar16 = (byte *)((int)(&(player->_sprite)._filename + -3) + iVar14); local_c = pbVar16; if (0xf < *(uint *)((player->_sprite)._filename._buf + iVar14 + -0x34)) { local_c = *(byte **)pbVar16; } pbVar15 = (byte *)0x0; if ((this->_sprite)._layerCount != 0) { do { pLVar9 = ANM2::GetLayer(this_00,pbVar15); pvVar2 = pLVar9->_layerData; if (pvVar2 == (void *)0x0) { pbVar13 = &s_empty; } else { pbVar13 = (byte *)((int)pvVar2 + 8); if (0xf < *(uint *)((int)pvVar2 + 0x1c)) { pbVar13 = *(byte **)pbVar13; } } pbVar10 = local_c; do { bVar8 = *pbVar13; bVar17 = bVar8 < *pbVar10; if (bVar8 != *pbVar10) { LAB_009ad360: uVar11 = -(uint)bVar17 | 1; goto LAB_009ad365; } if (bVar8 == 0) break; bVar8 = pbVar13[1]; bVar17 = bVar8 < pbVar10[1]; if (bVar8 != pbVar10[1]) goto LAB_009ad360; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar8 != 0); uVar11 = 0; LAB_009ad365: if ((uVar11 == 0) && (&pLVar9->_color != (ColorMod *)(pbVar16 + 0x18))) { fVar4 = *(float *)(pbVar16 + 0x1c); fVar5 = *(float *)(pbVar16 + 0x20); fVar6 = *(float *)(pbVar16 + 0x24); (pLVar9->_color)._tint[0] = *(float *)(pbVar16 + 0x18); (pLVar9->_color)._tint[1] = fVar4; (pLVar9->_color)._tint[2] = fVar5; (pLVar9->_color)._tint[3] = fVar6; fVar4 = *(float *)(pbVar16 + 0x2c); fVar5 = *(float *)(pbVar16 + 0x30); fVar6 = *(float *)(pbVar16 + 0x34); (pLVar9->_color)._colorize[0] = *(float *)(pbVar16 + 0x28); (pLVar9->_color)._colorize[1] = fVar4; (pLVar9->_color)._colorize[2] = fVar5; (pLVar9->_color)._colorize[3] = fVar6; fVar4 = *(float *)(pbVar16 + 0x3c); (pLVar9->_color)._offset[0] = *(float *)(pbVar16 + 0x38); (pLVar9->_color)._offset[1] = fVar4; (pLVar9->_color)._offset[2] = *(float *)(pbVar16 + 0x40); } pbVar15 = pbVar15 + 1; } while (pbVar15 < (byte *)(this->_sprite)._layerCount); } player = (Entity_Player *)&player->field_0x44; local_10 = local_10 + 1; iVar14 = *(int *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x4c); } while (local_10 < (uint)((*(int *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x50) - iVar14) / 0x44)); } pbVar16 = (byte *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x1c); if (0xf < *(uint *)((int)(&this->_sprite + 1) + eOverlayID * 0x58 + 0x30)) { pbVar16 = *(byte **)pbVar16; } pbVar15 = (this->_sprite)._animState._animData; if (pbVar15 != (byte *)0x0) { pbVar13 = pbVar15; if (0xf < *(uint *)(pbVar15 + 0x14)) { pbVar13 = *(byte **)pbVar15; } pbVar10 = pbVar16; do { bVar8 = *pbVar13; bVar17 = bVar8 < *pbVar10; if (bVar8 != *pbVar10) { LAB_009ad424: uVar11 = -(uint)bVar17 | 1; goto LAB_009ad429; } if (bVar8 == 0) break; bVar8 = pbVar13[1]; bVar17 = bVar8 < pbVar10[1]; if (bVar8 != pbVar10[1]) goto LAB_009ad424; pbVar13 = pbVar13 + 2; pbVar10 = pbVar10 + 2; } while (bVar8 != 0); uVar11 = 0; LAB_009ad429: if ((uVar11 == 0) && ((pbVar15[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009ad452; } bVar8 = ANM2::SetAnimation(&this->_sprite,pbVar16,1); if (bVar8 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } LAB_009ad452: this->_state = 2 - (uint)(delay != 0); this->_delay = delay; return; } //@@ 009ad470 FUN_009ad470 void FUN_009ad470(void) { int *in_ECX; uint size; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { std::string::_Tidy_deallocate(this); this = this + 0x44; } while (this != pcVar1); this = (char *)*in_ECX; } size = ((in_ECX[2] - (int)this) / 0x44) * 0x44; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009ad500 FUN_009ad500 void FUN_009ad500(char *param_1,char *param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x44) { std::string::_Tidy_deallocate(param_1); } return; } //@@ 009ad530 FUN_009ad530 void FUN_009ad530(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x44; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 009ad580 FUN_009ad580 void FUN_009ad580(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_EDX; *in_EDX = 0; in_EDX[4] = 0; in_EDX[5] = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_EDX = *param_1; in_EDX[1] = uVar1; in_EDX[2] = uVar2; in_EDX[3] = uVar3; *(undefined8 *)(in_EDX + 4) = *(undefined8 *)(param_1 + 4); param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; uVar1 = param_1[7]; uVar2 = param_1[8]; uVar3 = param_1[9]; in_EDX[6] = param_1[6]; in_EDX[7] = uVar1; in_EDX[8] = uVar2; in_EDX[9] = uVar3; uVar1 = param_1[0xb]; uVar2 = param_1[0xc]; uVar3 = param_1[0xd]; in_EDX[10] = param_1[10]; in_EDX[0xb] = uVar1; in_EDX[0xc] = uVar2; in_EDX[0xd] = uVar3; *(undefined8 *)(in_EDX + 0xe) = *(undefined8 *)(param_1 + 0xe); in_EDX[0x10] = param_1[0x10]; return; } //@@ 009ad5e0 std::vector<68byte>::_Emplace_reallocate /* DB: 0x44-byte elements, max 0x3c3c3c3, constructs via FUN_009ad580; load_giantbook_xml */ void * std::vector<68byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { uint uVar1; void *pvVar2; int *in_ECX; uint uVar3; int extraout_ECX; int iVar4; uint uVar5; int iVar6; int iVar7; char *this; char *pcVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e100; local_10 = ExceptionList; ExceptionList = &local_10; iVar6 = param_1 - *in_ECX; iVar7 = (in_ECX[1] - *in_ECX) / 0x44; if (iVar7 == 0x3c3c3c3) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar7 + 1; uVar5 = (in_ECX[2] - *in_ECX) / 0x44; if (0x3c3c3c3 - (uVar5 >> 1) < uVar5) { uVar3 = 0x3c3c3c3; } else { uVar5 = (uVar5 >> 1) + uVar5; uVar3 = uVar1; if (uVar1 <= uVar5) { uVar3 = uVar5; } if (0x3c3c3c3 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar2 = _Allocate(uVar3 * 0x44); local_8 = 0; FUN_009ad580(param_2); iVar7 = in_ECX[1]; iVar4 = *in_ECX; if (param_1 == iVar7) { _Uninitialized_copy<68byte>(pvVar2); } else { if (iVar4 != param_1) { do { FUN_009ad580(iVar4); iVar4 = extraout_ECX + 0x44; } while (iVar4 != param_1); iVar7 = in_ECX[1]; } for (; param_1 != iVar7; param_1 = param_1 + 0x44) { FUN_009ad580(param_1); } } this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar8 = (char *)in_ECX[1]; if (this != pcVar8) { do { string::_Tidy_deallocate(this); this = this + 0x44; } while (this != pcVar8); this = (char *)*in_ECX; } uVar5 = ((in_ECX[2] - (int)this) / 0x44) * 0x44; pcVar8 = this; if (0xfff < uVar5) { pcVar8 = *(char **)(this + -4); uVar5 = uVar5 + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar8)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar8,uVar5); } *in_ECX = (int)pvVar2; in_ECX[1] = (int)((int)pvVar2 + uVar1 * 0x44); in_ECX[2] = (int)(uVar3 * 0x44 + (int)pvVar2); ExceptionList = local_10; return (void *)((int)pvVar2 + (iVar6 / 0x44) * 0x44); } //@@ 009ad7da Catch_All@009ad7da void Catch_All_009ad7da(void) { int unaff_EBP; FUN_009ad500(*(undefined4 *)(unaff_EBP + 0xc),*(undefined4 *)(unaff_EBP + -0x20)); FUN_009ad530(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009ad800 std::vector<68byte>::assign /* DB: range assign for 0x44-byte elements (string members, max 0x3c3c3c3); load_giantbook_xml */ void std::vector<68byte>::assign(int param_1,int param_2) { char *pcVar1; uint uVar2; int iVar3; int *in_ECX; char *this; char *this_00; uint local_8; uVar2 = (param_2 - param_1) / 0x44; pcVar1 = (char *)in_ECX[1]; this = (char *)*in_ECX; if (uVar2 <= (uint)(((int)pcVar1 - (int)this) / 0x44)) { FUN_009ada70(this); pcVar1 = (char *)in_ECX[1]; for (this_00 = this + uVar2 * 0x44; this_00 != pcVar1; this_00 = this_00 + 0x44) { string::_Tidy_deallocate(this_00); } in_ECX[1] = (int)(this + uVar2 * 0x44); return; } local_8 = (in_ECX[2] - (int)this) / 0x44; if (local_8 < uVar2) { if (0x3c3c3c3 < uVar2) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x3c3c3c3 - (local_8 >> 1) < local_8) { local_8 = 0x3c3c3c3; } else { local_8 = (local_8 >> 1) + local_8; if (local_8 < uVar2) { local_8 = uVar2; } } if (this != (char *)0x0) { if (this != pcVar1) { do { string::_Tidy_deallocate(this); this = this + 0x44; } while (this != pcVar1); this = (char *)*in_ECX; } FUN_009ad530(this,(in_ECX[2] - (int)this) / 0x44); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x3c3c3c3 < local_8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } this = _Allocate(local_8 * 0x44); *in_ECX = (int)this; in_ECX[1] = (int)this; in_ECX[2] = (int)(this + local_8 * 0x44); } FUN_009ada70(this); iVar3 = _Uninitialized_copy<68byte>(in_ECX[1]); in_ECX[1] = iVar3; return; } //@@ 009ad9a0 std::_Uninitialized_copy<68byte> /* DB: copies 0x44-byte elements (std::string + 11 dwords), ECX/EDX range; std::vector<68byte>::_Emplace_reallocate/assign */ char * std::_Uninitialized_copy<68byte>(char *param_1) { int iVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int in_ECX; int in_EDX; undefined8 *puVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0e12d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (in_ECX != in_EDX) { puVar5 = (undefined8 *)(in_ECX + 0x38); do { string::string(param_1,puVar5 + -7); uVar2 = *(undefined4 *)((int)puVar5 + -0x1c); uVar3 = *(undefined4 *)(puVar5 + -3); uVar4 = *(undefined4 *)((int)puVar5 + -0x14); *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(puVar5 + -4); *(undefined4 *)(param_1 + 0x1c) = uVar2; *(undefined4 *)(param_1 + 0x20) = uVar3; *(undefined4 *)(param_1 + 0x24) = uVar4; uVar2 = *(undefined4 *)((int)puVar5 + -0xc); uVar3 = *(undefined4 *)(puVar5 + -1); uVar4 = *(undefined4 *)((int)puVar5 + -4); *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(puVar5 + -2); *(undefined4 *)(param_1 + 0x2c) = uVar2; *(undefined4 *)(param_1 + 0x30) = uVar3; *(undefined4 *)(param_1 + 0x34) = uVar4; *(undefined8 *)(param_1 + 0x38) = *puVar5; *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(puVar5 + 1); param_1 = param_1 + 0x44; iVar1 = (int)puVar5 + 0xc; puVar5 = (undefined8 *)((int)puVar5 + 0x44); } while (iVar1 != in_EDX); } ExceptionList = local_10; return param_1; } //@@ 009ada40 FUN_009ada40 void FUN_009ada40(void) { char *pcVar1; undefined4 *in_ECX; char *this; pcVar1 = (char *)in_ECX[1]; for (this = (char *)*in_ECX; this != pcVar1; this = this + 0x44) { std::string::_Tidy_deallocate(this); } return; } //@@ 009ada70 FUN_009ada70 char * FUN_009ada70(char *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; byte *text; undefined4 *in_ECX; undefined4 *in_EDX; char *pcVar5; undefined4 *puVar6; if (in_ECX == in_EDX) { return param_1; } pcVar5 = param_1 + 0x18; puVar6 = in_ECX + 0xe; do { if (param_1 != (char *)(puVar6 + -0xe)) { text = (byte *)(puVar6 + -0xe); if (0xf < (uint)puVar6[-9]) { text = *(byte **)text; } std::string::assign(param_1,text,puVar6[-10]); } if (pcVar5 != (char *)(puVar6 + -8)) { uVar2 = puVar6[-7]; uVar3 = puVar6[-6]; uVar4 = puVar6[-5]; *(undefined4 *)pcVar5 = puVar6[-8]; *(undefined4 *)(pcVar5 + 4) = uVar2; *(undefined4 *)(pcVar5 + 8) = uVar3; *(undefined4 *)(pcVar5 + 0xc) = uVar4; uVar2 = puVar6[-3]; uVar3 = puVar6[-2]; uVar4 = puVar6[-1]; *(undefined4 *)(pcVar5 + 0x10) = puVar6[-4]; *(undefined4 *)(pcVar5 + 0x14) = uVar2; *(undefined4 *)(pcVar5 + 0x18) = uVar3; *(undefined4 *)(pcVar5 + 0x1c) = uVar4; uVar2 = puVar6[1]; *(undefined4 *)(pcVar5 + 0x20) = *puVar6; *(undefined4 *)(pcVar5 + 0x24) = uVar2; *(undefined4 *)(pcVar5 + 0x28) = puVar6[2]; } param_1 = param_1 + 0x44; pcVar5 = pcVar5 + 0x44; puVar1 = puVar6 + 3; puVar6 = puVar6 + 0x11; } while (puVar1 != in_EDX); return param_1; } //@@ 009adaf0 RoomDescriptor::Init /* DB: ? sets defaults (-1 grid arrays, 0x900000005 rng shifts); Level::generate_dungeon prototype: db/protos.zhl, confirmed by RET 4 */ RoomDescriptor * __thiscall RoomDescriptor::Init(RoomDescriptor *this,uint seed) { int iVar1; void **ppvVar2; this[4].RestrictedGridIndexes._size = 0; this[4].SavedEffects._begin = (void *)0x0; this[4].SavedEffects._end = (void *)0x0; this[4].SavedEffects._capacity = (void *)0x0; *(undefined4 *)&this[4].field_0x94 = 0; *(undefined4 *)&this[4].field_0x98 = 0; *(undefined4 *)&this[4].field_0x9c = 0; *(undefined4 *)&this[4].field_0xa0 = 0; *(undefined4 *)&this[4].field_0xa4 = 0; ppvVar2 = &this->OverrideData; for (iVar1 = 0xa9; iVar1 != 0; iVar1 = iVar1 + -1) { *ppvVar2 = (void *)0xffffffff; ppvVar2 = ppvVar2 + 1; } this->GridIndex = seed; this->SafeGridIndex = 5; this->ListIndex = 9; this->Dimension = 7; this->Data = (void *)0xffffffff; this->Data = (void *)((uint)this->Data & 0x1fff); memset(&this[3].SavedEffects._capacity,0,0xa9); return this; } //@@ 009adbb0 LevelGenerator::Generate /* ZHL [exact] __thiscall void LevelGenerator::Generate(int unk, bool unk2, bool unk3, bool unk4, const unsigned int &allowedShapes, uint32_t numDeadEnds, LevelGenerator_Room* startRoom); prototype: REPENTOGON, confirmed by RET 28 */ void __thiscall LevelGenerator::Generate (LevelGenerator *this,int unk,byte unk2,byte unk3,byte unk4,uint *allowedShapes, uint numDeadEnds,LevelGenerator_Room *startRoom) { LevelGenerator LVar1; LevelGenerator LVar2; LevelGenerator LVar3; int iVar4; LevelGenerator LVar5; LevelGenerator *pLVar6; *(byte *)(this + 0xe4) = unk3; this[0xe4].field_0x2 = unk4; this[0xe4].field_0x1 = unk2; this[4] = (LevelGenerator)*allowedShapes; pLVar6 = this + 5; for (iVar4 = 0xa9; iVar4 != 0; iVar4 = iVar4 + -1) { *pLVar6 = (LevelGenerator)0xffffffff; pLVar6 = pLVar6 + 1; } this[0xe2] = (LevelGenerator)0xffffffff; this[0xdd] = this[0xdc]; this[0xe0] = this[0xdf]; this[0xe3] = (LevelGenerator)0x0; this[0xe4].field_0x3 = 1; FUN_00752e40(0); this[0xda] = this[0xd9]; generate_rooms(unk,startRoom); update_dead_end_lists(this); _unk3 = this[0xdc]; iVar4 = 5; if ((int)this[0xdd] - (int)_unk3 >> 2 < (int)numDeadEnds) { do { if (iVar4 < 1) break; KAGE_LogMessage(1,(byte *)"not enough dead ends, trying to make new one\n"); FUN_009af1e0(); update_dead_end_lists(this); _unk3 = this[0xdc]; iVar4 = iVar4 + -1; } while ((int)this[0xdd] - (int)_unk3 >> 2 < (int)numDeadEnds); } _unk4 = this[0xdd]; if (_unk3 != _unk4) { do { LVar1 = (LevelGenerator)((int)_unk3 + 4); LVar5 = _unk3; if (LVar1 != _unk4) { LVar3 = LVar1; do { LVar2 = LVar3; if (*(int *)((int)this[0xd9] + 0x40 + *(int *)LVar3 * 0x48) <= *(int *)((int)this[0xd9] + 0x40 + *(int *)LVar5 * 0x48)) { LVar2 = LVar5; } LVar5 = LVar2; LVar3 = (LevelGenerator)((int)LVar3 + 4); } while (LVar3 != _unk4); } iVar4 = *(int *)_unk3; *(int *)_unk3 = *(int *)LVar5; *(int *)LVar5 = iVar4; _unk4 = this[0xdd]; _unk3 = LVar1; } while (LVar1 != _unk4); } return; } //@@ 009add30 LevelGenerator::CreateRoom /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall LevelGenerator_Room* LevelGenerator::CreateRoom(int x, int y, int shape, int connectX, int connectY, Direction connectDir); prototype: db/protos.zhl, confirmed by RET 24 */ void * __thiscall LevelGenerator::CreateRoom (LevelGenerator *this,int x,int y,int shape,int connectX,int connectY,int connectDir) { byte bVar1; LevelGenerator_Room *room; undefined3 extraout_var; void *pvVar2; LevelGenerator_Room local_5c [12]; void *local_2c [6]; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0e15d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; room = LevelGenerator_Room::constructor(local_5c,x,y,shape); local_8 = (void *)0x0; bVar1 = place_room(this,room); pvVar2 = (void *)CONCAT31(extraout_var,bVar1); local_8 = (void *)0xffffffff; FID_conflict__Erase_tree_>_> (local_2c,(fuzzer_allocator_> *)local_2c, *(_Tree_node **)((int)local_2c[0] + 4)); operator_delete(local_2c[0],0x14); *(int *)((int)pvVar2 + 0x20) = connectDir; *(int *)((int)pvVar2 + 0x28) = connectX; *(int *)((int)pvVar2 + 0x2c) = connectY; update_dead_end_lists(this); ExceptionList = local_10; return pvVar2; } //@@ 009addf0 LevelGenerator::try_add_dead_end /* DB: ? scans get_neighbor_candidates of every candidate for a 1x1 can_place_room spot with count_neighbor_rooms == 1 not in the excluded set, place_room + update_dead_end_lists; Level::place_special_rooms */ byte LevelGenerator::try_add_dead_end(undefined4 param_1,int *param_2) { int iVar1; byte bVar2; RNG *in_ECX; int iVar3; int iVar4; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 uVar5; int *piVar6; LevelGenerator_Room LVar7; uint uVar8; LevelGenerator_Room candidate; int *candidateGridIndex; undefined1 local_40 [8]; int local_38; int *roomOrder; int *local_30; int *roomOrderCapacityEnd; LevelGenerator_Room candidates; LevelGenerator_Room candidatesLast; int candidatesCapacityEnd; int *local_18; RNG *generator; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e1a5; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = in_ECX[0x36]._shift2; uVar8 = (iVar3 - in_ECX[0x36]._shift1) / 0x48; roomOrder = (int *)0x0; local_18 = (int *)0x0; local_30 = (int *)0x0; roomOrderCapacityEnd = (int *)0x0; generator = in_ECX; if (uVar8 != 0) { if (0x3fffffff < uVar8) { /* WARNING: Subroutine does not return */ std::_Xlen(__security_cookie ^ (uint)(local_40 + 0x3c)); } roomOrder = std::_Allocate(uVar8 * 4); piVar6 = roomOrder + uVar8; roomOrderCapacityEnd = piVar6; local_18 = piVar6; memset(roomOrder,0,uVar8 * 4); iVar3 = in_ECX[0x36]._shift2; local_30 = piVar6; } local_8._0_1_ = 0; local_8._1_3_ = 0; iVar3 = iVar3 - in_ECX[0x36]._shift1; uVar8 = 0; iVar1 = iVar3 >> 0x1f; if (iVar3 / 0x48 + iVar1 != iVar1) { do { roomOrder[uVar8] = uVar8; uVar8 = uVar8 + 1; } while (uVar8 < (uint)((in_ECX[0x36]._shift2 - in_ECX[0x36]._shift1) / 0x48)); } RNG::Shuffle(in_ECX,roomOrder,local_18); piVar6 = param_2; iVar3 = in_ECX[0x36]._shift1; iVar4 = in_ECX[0x36]._shift2 - iVar3; local_18 = (int *)0x0; iVar1 = iVar4 >> 0x1f; if (iVar4 / 0x48 + iVar1 != iVar1) { do { get_neighbor_candidates ((LevelGenerator *)in_ECX,&candidates, *(uint *)(iVar3 + 4 + roomOrder[(int)local_18] * 0x48),1); local_8._0_1_ = 1; uVar5 = extraout_ECX; LVar7 = candidatesLast; candidate = candidates; if (candidates != candidatesLast) { do { if (*(LevelGenerator_Room *)((int)candidate + 0x18) == (LevelGenerator_Room)0x1) { bVar2 = can_place_room((LevelGenerator *)generator,(int *)((int)candidate + 8),1); uVar5 = extraout_ECX_00; if ((bVar2 != 0) && (iVar3 = count_neighbor_rooms ((LevelGenerator *)generator,(int *)((int)candidate + 0x28)), uVar5 = extraout_ECX_01, iVar3 < 2)) { if (piVar6 != (int *)0x0) { LVar7 = *(LevelGenerator_Room *)((int)candidate + 8); if (((uint)LVar7 < 0xd) && (*(uint *)((int)candidate + 0xc) < 0xd)) { candidateGridIndex = (int *)(*(uint *)((int)candidate + 0xc) * 0xd + (int)LVar7); } else { candidateGridIndex = (int *)0xffffffff; } param_2 = candidateGridIndex; std::set::find_node(local_40,¶m_2); if (((*(char *)(local_38 + 0xd) == '\0') && (*(int *)(local_38 + 0x10) <= (int)candidateGridIndex)) && (uVar5 = extraout_ECX_02, local_38 != *piVar6)) goto LAB_009adfbd; } bVar2 = place_room((LevelGenerator *)generator,(LevelGenerator_Room *)candidate); update_dead_end_lists((LevelGenerator *)generator); vector_LevelGenerator_Room_tidy(&candidates); goto LAB_009ae06b; } LAB_009adfbd: LVar7 = candidatesLast; } candidate = (LevelGenerator_Room)((int)candidate + 0x48); } while (candidate != LVar7); in_ECX = generator; } local_8._0_1_ = 0; if (candidates != (LevelGenerator_Room)0x0) { FUN_00752e40(uVar5); uVar8 = ((candidatesCapacityEnd - (int)candidates) / 0x48) * 0x48; LVar7 = candidates; if (0xfff < uVar8) { LVar7 = *(LevelGenerator_Room *)((int)candidates + -4); uVar8 = uVar8 + 0x23; if (0x1f < ((int)candidates - (int)LVar7) - 4U) goto LAB_009ae094; } operator_delete((void *)LVar7,uVar8); candidates = (LevelGenerator_Room)0x0; candidatesLast = (LevelGenerator_Room)0x0; candidatesCapacityEnd = 0; } iVar3 = in_ECX[0x36]._shift1; local_18 = (int *)((int)local_18 + 1); } while (local_18 < (uint)((in_ECX[0x36]._shift2 - iVar3) / 0x48)); } bVar2 = 0; LAB_009ae06b: if (roomOrder != (int *)0x0) { uVar8 = (int)roomOrderCapacityEnd - (int)roomOrder & 0xfffffffc; piVar6 = roomOrder; if (0xfff < uVar8) { piVar6 = (int *)roomOrder[-1]; uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)roomOrder + (-4 - (int)piVar6))) { LAB_009ae094: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar6,uVar8); } ExceptionList = local_10; return bVar2; } //@@ 009ae0e0 LevelGenerator::GetNewEndRoom /* ZHL [exact] __thiscall LevelGenerator_Room* LevelGenerator::GetNewEndRoom(int roomShape, const unsigned int &possibleDoors); prototype: REPENTOGON, confirmed by RET 8 */ LevelGenerator_Room * __thiscall LevelGenerator::GetNewEndRoom(LevelGenerator *this,int roomShape,uint *possibleDoors) { LevelGenerator _Src; LevelGenerator_Room *room; byte bVar1; LevelGenerator _Dst; _Dst = this[0xdc]; if (_Dst != this[0xdd]) { do { _Src = (LevelGenerator)((int)_Dst + 4); room = (LevelGenerator_Room *)((int)this[0xd9] + *(int *)_Dst * 0x48); bVar1 = try_resize_room(this,room,roomShape,possibleDoors); if (bVar1 != 0) { memmove((void *)_Dst,(void *)_Src,(int)this[0xdd] - (int)_Src); this[0xdd] = (LevelGenerator)((int)this[0xdd] + -4); return room; } _Dst = _Src; } while (_Src != this[0xdd]); } return (LevelGenerator_Room *)0x0; } //@@ 009ae170 LevelGenerator::place_secret_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Level::place_special_rooms calls it once per secret room (1 + Fragmented Card 0x66 + Luna 0x24d): scores each empty cell by adjacent rooms (-100 next to a room's dead door), picks a best cell via the generator RNG, places a 1x1 LevelGenerator_Room and update_room_neighbors on it and its neighbours prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall LevelGenerator::place_secret_room(LevelGenerator *this,void *excludedIndices) { code *pcVar1; uint *puVar2; void *pvVar3; uint uVar4; LevelGenerator rngState; int iVar5; int *doorTarget; uint uVar6; uint *puVar7; int iVar8; uint dir; LevelGenerator *pLVar9; int doorTargetPos [2]; undefined1 local_c0 [8]; int foundNode; uint cellIndex; int bestScore; int cellScore; uint *bestCells; uint *bestCellsEnd; uint *bestCellsCapacity; void *local_9c; uint local_98; uint *cellsCapacity; uint local_90; LevelGenerator *cellSlot; uint *cellsBegin; uint *local_84; LevelGenerator_Room newRoom [12]; void *local_50 [5]; undefined1 local_3c; int neighborOffsets [10]; void *local_10; undefined1 *puStack_c; int local_8; puStack_c = &LAB_00b0e1e8; local_10 = ExceptionList; neighborOffsets[8] = __security_cookie ^ (uint)(neighborOffsets + 0xd); ExceptionList = &local_10; puVar7 = (uint *)0x0; neighborOffsets[0] = -1; neighborOffsets[1] = 0; neighborOffsets[2] = 0; neighborOffsets[3] = 0xffffffff; puVar2 = (uint *)0x0; neighborOffsets[4] = 1; neighborOffsets[5] = 0; neighborOffsets[6] = 0; neighborOffsets[7] = 1; bestScore = 0; cellsBegin = (uint *)0x0; bestCells = (uint *)0x0; local_84 = (uint *)0x0; bestCellsEnd = (uint *)0x0; cellsCapacity = (uint *)0x0; bestCellsCapacity = (uint *)0x0; local_8 = 0; cellSlot = this + 5; cellIndex = 0; do { pLVar9 = cellSlot; uVar4 = cellIndex; if ((int)*cellSlot < 0) { local_98 = cellIndex; std::set::find_node(local_c0,&local_98); if ((((*(char *)(foundNode + 0xd) == '\0') && (*(int *)(foundNode + 0x10) <= (int)uVar4)) && (foundNode != *(int *)excludedIndices)) || ((&this[0xae].field_0x0)[uVar4] != '\0')) { puVar2 = local_84; puVar7 = cellsBegin; } else { rngState = *this; local_90 = uVar4 / 0xd; local_9c = (void *)(uVar4 % 0xd); if (rngState == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); rngState = *this; if (rngState == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); pvVar3 = (void *)(*pcVar1)(); return pvVar3; } } uVar4 = (uint)rngState >> (SUB41(this[1],0) & 0x1f) ^ (uint)rngState; local_98 = 0; uVar4 = uVar4 << (SUB41(this[2],0) & 0x1f) ^ uVar4; rngState = (LevelGenerator)(uVar4 >> (SUB41(this[3],0) & 0x1f) ^ uVar4); *this = rngState; iVar8 = (uint)rngState % 5 + 10; dir = 0; cellScore = iVar8; do { uVar6 = local_98; if ((uint)((int)local_9c + neighborOffsets[dir * 2]) < 0xd) { if (neighborOffsets[dir * 2 + 1] + local_90 < 0xd) { iVar5 = (neighborOffsets[dir * 2 + 1] + local_90) * 0xd + (int)local_9c + neighborOffsets[dir * 2]; if (-1 < iVar5) { if (-1 < (int)this[iVar5 + 5]) { iVar8 = (int)this[0xd9] + (int)this[iVar5 + 5] * 0x48; doorTarget = get_door_target_position (doorTargetPos,(int *)(iVar8 + 8),*(int *)(iVar8 + 0x18), dir - 2 & 3,0); if ((*doorTarget == g_levelGenInvalidPos[0]) && (doorTarget[1] == g_levelGenInvalidPos[1])) { cellScore = cellScore + -100; iVar8 = cellScore; } else { uVar6 = uVar6 + 1; iVar8 = cellScore; local_98 = uVar6; } } } } } uVar4 = cellIndex; dir = dir + 1; } while (dir < 4); if ((uVar6 != 0) && (-1 < iVar8)) { iVar5 = iVar8 + -3; if (2 < (int)local_98) { iVar5 = iVar8; } iVar8 = iVar5 + -3; if (1 < (int)local_98) { iVar8 = iVar5; } if (bestScore < iVar8) { bestCellsEnd = cellsBegin; local_90 = cellIndex; bestScore = iVar8; if (cellsBegin == cellsCapacity) { std::vector::_Emplace_reallocate(cellsBegin,&local_90); cellsCapacity = bestCellsCapacity; local_84 = bestCellsEnd; cellsBegin = bestCells; } else { bestCellsEnd = cellsBegin + 1; *cellsBegin = cellIndex; local_84 = bestCellsEnd; } } else if (iVar8 == bestScore) { local_90 = cellIndex; if (local_84 == cellsCapacity) { std::vector::_Emplace_reallocate(local_84,&local_90); cellsCapacity = bestCellsCapacity; local_84 = bestCellsEnd; cellsBegin = bestCells; } else { *local_84 = cellIndex; bestCellsEnd = local_84 + 1; local_84 = bestCellsEnd; } } } puVar2 = local_84; puVar7 = cellsBegin; pLVar9 = cellSlot; } } cellIndex = uVar4 + 1; cellSlot = pLVar9 + 1; } while (cellIndex < 0xa9); local_84 = (uint *)((int)puVar2 - (int)puVar7 >> 2); if (local_84 == (uint *)0x0) { pvVar3 = (void *)0x0; } else { rngState = *this; if (rngState == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); rngState = *this; if (rngState == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); pvVar3 = (void *)(*pcVar1)(); return pvVar3; } } uVar4 = (uint)rngState >> (SUB41(this[1],0) & 0x1f) ^ (uint)rngState; uVar4 = uVar4 ^ uVar4 << (SUB41(this[2],0) & 0x1f); rngState = (LevelGenerator)(uVar4 ^ uVar4 >> (SUB41(this[3],0) & 0x1f)); *this = rngState; uVar4 = cellsBegin[(uint)rngState % (uint)local_84]; local_90 = (int)uVar4 % 0xd; LevelGenerator_Room::constructor(newRoom,local_90,(int)uVar4 / 0xd,1); local_8 = CONCAT31(local_8._1_3_,1); local_3c = 1; place_room(this,newRoom); local_9c = (void *)((int)this[0xd9] + (int)this[uVar4 + 5] * 0x48); update_room_neighbors(this,local_9c); dir = 0; do { uVar6 = neighborOffsets[dir * 2 + 1] + (int)uVar4 / 0xd; if ((((local_90 + neighborOffsets[dir * 2] < 0xd) && (uVar6 < 0xd)) && (iVar8 = uVar6 * 0xd + local_90 + neighborOffsets[dir * 2], -1 < iVar8)) && (-1 < (int)this[iVar8 + 5])) { update_room_neighbors(this,(void *)((int)this[0xd9] + (int)this[iVar8 + 5] * 0x48)); } dir = dir + 1; } while (dir < 4); FID_conflict__Erase_tree_>_> (local_50,(fuzzer_allocator_> *)local_50, *(_Tree_node **)((int)local_50[0] + 4)); operator_delete(local_50[0],0x14); puVar7 = cellsBegin; pvVar3 = local_9c; } if (puVar7 != (uint *)0x0) { uVar4 = (int)cellsCapacity - (int)puVar7 & 0xfffffffc; puVar2 = puVar7; if (0xfff < uVar4) { puVar2 = (uint *)puVar7[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)puVar7 + (-4 - (int)puVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar4); } ExceptionList = local_10; return pvVar3; } //@@ 009ae640 LevelGenerator::try_place_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from level generator FUN_00739370; LevelGenerator_Room::constructor + get_door_target_position + place_room, returns success prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall LevelGenerator::try_place_room(LevelGenerator *this,void *allowedIndices) { code *pcVar1; uint *puVar2; void *result; uint uVar3; LevelGenerator seed; int iVar4; int iVar5; uint *puVar6; uint uVar7; uint uVar8; undefined1 local_128 [8]; int local_120; undefined1 local_11c [8]; int local_114; uint doorTargetX; uint doorTargetY; uint column; LevelGenerator *local_104; uint neighborDir; uint *local_fc; uint *local_f8; uint *local_f4; void *local_f0; uint score; int offsetX; int neighborRoom; uint local_e0; uint *candidatesCapacity; uint local_d8; LevelGenerator *gridSlot; uint gridIndex; uint local_cc; uint *candidatesBegin; uint *local_c4; LevelGenerator_Room newRoom [12]; void *local_90 [5]; undefined1 local_7c; int neighborOffsets [26]; void *local_10; undefined1 *puStack_c; int local_8; puStack_c = &LAB_00b0e23b; local_10 = ExceptionList; neighborOffsets[0x18] = __security_cookie ^ (uint)(neighborOffsets + 0x1d); ExceptionList = &local_10; puVar6 = (uint *)0x0; neighborOffsets[0x10] = 0xffffffff; neighborOffsets[0x11] = 0; neighborOffsets[0x12] = 0; neighborOffsets[0x13] = 0xffffffff; puVar2 = (uint *)0x0; neighborOffsets[0x14] = 1; neighborOffsets[0x15] = 0; neighborOffsets[0x16] = 0; neighborOffsets[0x17] = 1; local_e0 = 0; neighborOffsets[0] = -2; neighborOffsets[1] = 0; neighborOffsets[2] = 0xffffffff; neighborOffsets[3] = 0xffffffff; candidatesBegin = (uint *)0x0; neighborOffsets[4] = 0; neighborOffsets[5] = 0xfffffffe; neighborOffsets[6] = 1; neighborOffsets[7] = 0xffffffff; local_fc = (uint *)0x0; neighborOffsets[8] = 2; neighborOffsets[9] = 0; neighborOffsets[10] = 1; neighborOffsets[0xb] = 1; local_c4 = (uint *)0x0; neighborOffsets[0xc] = 0; neighborOffsets[0xd] = 2; neighborOffsets[0xe] = 0xffffffff; neighborOffsets[0xf] = 1; local_f8 = (uint *)0x0; candidatesCapacity = (uint *)0x0; local_f4 = (uint *)0x0; gridSlot = this + 5; local_8 = 0; gridIndex = 0; local_104 = this; do { uVar3 = gridIndex; if ((int)*gridSlot < 0) { if (*(char *)((int)&this[0xae].field_0x0 + gridIndex) == '\0') { if (allowedIndices == (void *)0x0) { LAB_009ae755: seed = *this; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *this; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); result = (void *)(*pcVar1)(); return result; } } uVar3 = (uint)seed >> (SUB41(this[1],0) & 0x1f) ^ (uint)seed; uVar3 = uVar3 << (SUB41(this[2],0) & 0x1f) ^ uVar3; seed = (LevelGenerator)(uVar3 >> (SUB41(this[3],0) & 0x1f) ^ uVar3); *this = seed; uVar7 = (uint)seed % 5; score = uVar7 + 10; local_d8 = 0; local_f0 = (void *)(gridIndex / 0xd); column = gridIndex % 0xd; uVar3 = 0; do { if (((column + neighborOffsets[uVar3 * 2 + 0x10] < 0xd) && ((uint)(neighborOffsets[uVar3 * 2 + 0x11] + (int)local_f0) < 0xd)) && ((iVar4 = (neighborOffsets[uVar3 * 2 + 0x11] + (int)local_f0) * 0xd + column + neighborOffsets[uVar3 * 2 + 0x10], -1 < iVar4 && ((-1 < (int)this[iVar4 + 5] || (*(char *)((int)this + iVar4 + 0x2b8) != '\0')))))) { score = uVar7 - 0x5a; if ((int)score < 0) goto LAB_009aeaab; break; } uVar3 = uVar3 + 1; } while (uVar3 < 4); neighborDir = 0; do { if ((int)score < 0) break; iVar4 = neighborOffsets[neighborDir * 2]; offsetX = iVar4; if ((column + iVar4 < 0xd) && ((uint)(neighborOffsets[neighborDir * 2 + 1] + (int)local_f0) < 0xd)) { iVar5 = (neighborOffsets[neighborDir * 2 + 1] + (int)local_f0) * 0xd + column + iVar4; if (-1 < iVar5) { if (-1 < (int)this[iVar5 + 5]) { uVar3 = 0; iVar5 = (int)this[0xd9] + (int)this[iVar5 + 5] * 0x48; neighborRoom = iVar5; do { if (0 < neighborOffsets[uVar3 * 2 + 0x11] * neighborOffsets[neighborDir * 2 + 1] + neighborOffsets[uVar3 * 2 + 0x10] * iVar4) { get_door_target_position ((int *)&doorTargetX,(int *)(iVar5 + 8),*(int *)(iVar5 + 0x18), uVar3 - 2 & 3,0); if ((doorTargetX < 0xd) && (doorTargetY < 0xd)) { uVar7 = doorTargetY * 0xd + doorTargetX; local_cc = uVar7; if ((-1 < (int)uVar7) && ((((allowedIndices == (void *)0x0 || (std::set::find_node(local_128,&local_cc), *(char *)(local_120 + 0xd) != '\0')) || ((int)uVar7 < *(int *)(local_120 + 0x10))) || (local_120 == *(int *)allowedIndices)))) { iVar5 = neighborRoom; iVar4 = offsetX; goto LAB_009ae936; } } else { local_cc = 0xffffffff; } score = score - 100; break; } LAB_009ae936: uVar3 = uVar3 + 1; } while (uVar3 < 4); local_d8 = local_d8 + 1; this = local_104; } } } neighborDir = neighborDir + 1; } while (neighborDir < 8); uVar3 = gridIndex; if ((local_d8 != 0) && (-1 < (int)score)) { uVar7 = score - 3; if (2 < (int)local_d8) { uVar7 = score; } uVar8 = uVar7 - 3; if (1 < (int)local_d8) { uVar8 = uVar7; } if ((int)uVar8 <= (int)local_e0) { if (uVar8 == local_e0) { local_cc = gridIndex; if (local_c4 == candidatesCapacity) { std::vector::_Emplace_reallocate(local_c4,&local_cc); candidatesCapacity = local_f4; local_c4 = local_f8; candidatesBegin = local_fc; } else { *local_c4 = gridIndex; local_f8 = local_c4 + 1; local_c4 = local_f8; } } goto LAB_009aeab1; } local_f8 = candidatesBegin; local_cc = gridIndex; local_e0 = uVar8; if (candidatesBegin == candidatesCapacity) { std::vector::_Emplace_reallocate(candidatesBegin,&local_cc); candidatesCapacity = local_f4; local_c4 = local_f8; candidatesBegin = local_fc; } else { *candidatesBegin = gridIndex; local_f8 = candidatesBegin + 1; local_c4 = local_f8; } } LAB_009aeaab: uVar3 = gridIndex; } else { local_cc = gridIndex; std::set::find_node(local_11c,&local_cc); if (((*(char *)(local_114 + 0xd) != '\0') || ((int)uVar3 < *(int *)(local_114 + 0x10))) || (local_114 == *(int *)allowedIndices)) goto LAB_009ae755; } LAB_009aeab1: puVar2 = local_c4; puVar6 = candidatesBegin; } } gridIndex = uVar3 + 1; gridSlot = gridSlot + 1; if (0xa8 < gridIndex) { local_c4 = (uint *)((int)puVar2 - (int)puVar6 >> 2); if (local_c4 == (uint *)0x0) { result = (void *)0x0; } else { seed = *this; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *this; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); result = (void *)(*pcVar1)(); return result; } } uVar3 = (uint)seed >> (SUB41(this[1],0) & 0x1f) ^ (uint)seed; uVar3 = uVar3 ^ uVar3 << (SUB41(this[2],0) & 0x1f); seed = (LevelGenerator)(uVar3 ^ uVar3 >> (SUB41(this[3],0) & 0x1f)); *this = seed; uVar3 = candidatesBegin[(uint)seed % (uint)local_c4]; uVar7 = (int)uVar3 / 0xd; local_d8 = (int)uVar3 % 0xd; local_e0 = uVar7; LevelGenerator_Room::constructor(newRoom,local_d8,uVar7,1); local_8 = CONCAT31(local_8._1_3_,1); local_7c = 1; place_room(this,newRoom); local_f0 = (void *)((int)this[0xd9] + (int)this[uVar3 + 5] * 0x48); update_room_neighbors(this,local_f0); local_cc = 0; uVar3 = local_d8; do { if (neighborOffsets[local_cc * 2] + uVar3 < 0xd) { if (neighborOffsets[local_cc * 2 + 1] + uVar7 < 0xd) { iVar4 = (neighborOffsets[local_cc * 2 + 1] + uVar7) * 0xd + neighborOffsets[local_cc * 2] + uVar3; if (-1 < iVar4) { if (-1 < (int)this[iVar4 + 5]) { uVar3 = 0; iVar4 = (int)this[0xd9] + (int)this[iVar4 + 5] * 0x48; do { get_door_target_position ((int *)&doorTargetX,(int *)(iVar4 + 8),*(int *)(iVar4 + 0x18),uVar3,0 ); if (((doorTargetX < 0xd) && (doorTargetY < 0xd)) && ((iVar5 = doorTargetY * 0xd + doorTargetX, -1 < iVar5 && (((int)local_104[iVar5 + 5] < 0 && (uVar7 = (int)(doorTargetY - local_e0) >> 0x1f, uVar8 = (int)(doorTargetX - local_d8) >> 0x1f, ((doorTargetY - local_e0 ^ uVar7) - uVar7) + ((doorTargetX - local_d8 ^ uVar8) - uVar8) == 1)))))) { if (7 < uVar3) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } puVar2 = (uint *)(iVar4 + (uVar3 >> 5) * 4 + 0x1c); *puVar2 = *puVar2 | 1 << ((byte)uVar3 & 0x1f); } uVar3 = uVar3 + 1; } while ((int)uVar3 < 8); uVar7 = local_e0; uVar3 = local_d8; this = local_104; } } } } local_cc = local_cc + 1; } while (local_cc < 8); FID_conflict__Erase_tree_>_> (local_90,(fuzzer_allocator_> *)local_90, *(_Tree_node **)((int)local_90[0] + 4)); operator_delete(local_90[0],0x14); puVar6 = candidatesBegin; result = local_f0; } if (puVar6 != (uint *)0x0) { uVar3 = (int)candidatesCapacity - (int)puVar6 & 0xfffffffc; puVar2 = puVar6; if (0xfff < uVar3) { puVar2 = (uint *)puVar6[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)puVar6 + (-4 - (int)puVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar3); } ExceptionList = local_10; return result; } } while( true ); } //@@ 009aed50 LevelGenerator::DetermineBossRoom /* ZHL [exact] __thiscall void LevelGenerator::DetermineBossRoom(int shape, const unsigned int &possibleDoors); prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall LevelGenerator::DetermineBossRoom(LevelGenerator *this,int shape,uint *possibleDoors) { void *room; LevelGenerator LVar1; bool bVar2; byte bVar3; int iVar4; int *piVar5; bool bVar6; int iVar7; uint uVar8; uint uVar9; int local_20; LevelGenerator local_1c; local_1c = this[0xdc]; if (local_1c == this[0xdd]) { return; } do { LVar1 = *(LevelGenerator *)local_1c; room = (void *)((int)this[0xd9] + (int)LVar1 * 0x48); if (1 < *(int *)((int)this[0xd9] + 0x40 + (int)LVar1 * 0x48)) { uVar9 = *(uint *)((int)room + 0x28); uVar8 = *(uint *)((int)room + 0x2c); if (*(char *)(this + 0xe4) != '\0') { bVar6 = true; local_20 = 3; do { uVar8 = uVar8 + (&DAT_00c5d3e4)[*(int *)((int)room + 0x20) * 2]; uVar9 = uVar9 + (&DAT_00c5d3e0)[*(int *)((int)room + 0x20) * 2]; if (((((int)uVar9 < 0) || (0xc < (int)uVar9)) || ((int)uVar8 < 0)) || ((0xc < (int)uVar8 || (iVar4 = uVar8 * 0xd + uVar9, iVar4 < 0)))) { LAB_009aee2e: bVar2 = false; } else { if ((uVar9 < 0xd) && (uVar8 < 0xd)) { iVar7 = iVar4; } else { iVar7 = -1; } bVar2 = bVar6; if (this[iVar7 + 5] != LVar1) { if ((0xc < uVar9) || (0xc < uVar8)) { iVar4 = -1; } if (-1 < (int)this[iVar4 + 5]) goto LAB_009aee2e; } } iVar4 = 0; piVar5 = &DAT_00c5d3e0; do { if ((((*piVar5 + uVar9 < 0xd) && (piVar5[1] + uVar8 < 0xd)) && (iVar7 = (piVar5[1] + uVar8) * 0xd + *piVar5 + uVar9, -1 < iVar7)) && ((-1 < (int)this[iVar7 + 5] && (this[iVar7 + 5] != LVar1)))) { iVar4 = iVar4 + 1; } piVar5 = piVar5 + 2; } while ((int)piVar5 < 0xc5d400); bVar6 = false; if (iVar4 < 1) { bVar6 = bVar2; } local_20 = local_20 + -1; } while (local_20 != 0); if (!bVar6) goto LAB_009aeebf; } bVar3 = try_resize_room(this,room,shape,possibleDoors); if (bVar3 != 0) { this[0xe2] = LVar1; memmove((void *)local_1c,(int *)((int)local_1c + 4),(int)this[0xdd] - ((int)local_1c + 4)); this[0xdd] = (LevelGenerator)((int)this[0xdd] + -4); return; } } LAB_009aeebf: local_1c = (LevelGenerator)((int)local_1c + 4); if (local_1c == this[0xdd]) { return; } } while( true ); } //@@ 009aef10 LevelGenerator::place_boss_room /* DB: thiscall LevelGenerator: LevelGenerator::DetermineBossRoom, then try_resize_room on room index this[0xe2] (0x48-byte LevelGenerator_Room array this[0xd9]); with the XL flag (+0xe4) places a second adjacent boss room from get_neighbor_candidates via place_room + update_room_neighbors and sets the door bit; returns the boss room; Level::place_special_rooms, Level::generate_boss_room */ int LevelGenerator::place_boss_room(int param_1,uint *param_2,char param_3) { uint *puVar1; LevelGenerator LVar2; LevelGenerator LVar3; byte bVar4; uint uVar5; int iVar6; undefined3 extraout_var; void *room; LevelGenerator *in_ECX; int iVar7; LevelGenerator_Room *room_00; LevelGenerator_Room *local_1c; LevelGenerator_Room *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e27d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (((*(char *)(in_ECX + 0xe4) == '\0') || ((int)in_ECX[0xe3] < 1)) || (param_3 != '\0')) { DetermineBossRoom(in_ECX,param_1,param_2); } if (((int)in_ECX[0xe2] < 0) || (bVar4 = try_resize_room(in_ECX,(void *)((int)in_ECX[0xd9] + (int)in_ECX[0xe2] * 0x48),param_1, param_2), bVar4 == 0)) { ExceptionList = local_10; return 0; } LVar2 = in_ECX[0xe3]; LVar3 = in_ECX[0xe2]; in_ECX[0xe3] = (LevelGenerator)((int)LVar2 + 1); in_ECX[0xe2] = (LevelGenerator)0xffffffff; if ((*(char *)(in_ECX + 0xe4) != '\0') && ((int)LVar2 + 1 < 2)) { iVar7 = (int)LVar3 * 0x48; get_neighbor_candidates(in_ECX,&local_1c,*(uint *)((int)in_ECX[0xd9] + 4 + iVar7),0); local_8 = 0; level_generator_rooms_shuffle(local_1c,local_18,uVar5); room_00 = local_1c; if (local_1c != local_18) { do { bVar4 = can_place_room(in_ECX,(int *)(room_00 + 2),(int)room_00[6]); if (((bVar4 != 0) && (iVar6 = count_neighbor_rooms(in_ECX,(int *)(room_00 + 10)), iVar6 < 2) ) && ((param_2[(uint)room_00[9] >> 5] & 1 << (SUB41(room_00[9],0) & 0x1f)) != 0)) { bVar4 = place_room(in_ECX,room_00); room = (void *)CONCAT31(extraout_var,bVar4); in_ECX[0xe2] = *(LevelGenerator *)((int)room + 4); *(undefined1 *)((int)room + 0x3c) = 1; update_room_neighbors(in_ECX,room); uVar5 = *(uint *)((int)room + 0x24); if (7 < uVar5) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(); } puVar1 = (uint *)((int)in_ECX[0xd9] + iVar7 + 0x1c + (uVar5 >> 5) * 4); *puVar1 = *puVar1 | 1 << ((byte)uVar5 & 0x1f); break; } room_00 = room_00 + 0x12; } while (room_00 != local_18); } vector_LevelGenerator_Room_tidy(&local_1c); } ExceptionList = local_10; return (int)in_ECX[0xd9] + (int)LVar3 * 0x48; } //@@ 009af0e0 LevelGenerator::get_all_rooms /* DB: ? returns vector of LevelGenerator_Room* (this+0x364 + idx*0x48) built from index lists +0x37c..+0x380 then +0x370..+0x374; Level::place_special_rooms, generate_boss_room, try_place_random_room prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall LevelGenerator::get_all_rooms(LevelGenerator *this,void *outRooms) { int *piVar1; LevelGenerator LVar2; int local_18 [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0e2be; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)outRooms = 0; *(undefined4 *)((int)outRooms + 4) = 0; *(undefined4 *)((int)outRooms + 8) = 0; local_8 = 0; LVar2 = this[0xdf]; local_18[1] = 1; if (LVar2 != this[0xe0]) { do { local_18[0] = (int)this[0xd9] + *(int *)LVar2 * 0x48; piVar1 = *(int **)((int)outRooms + 4); if (piVar1 == *(int **)((int)outRooms + 8)) { std::vector<4byte>::_Emplace_reallocate(piVar1,local_18); } else { *piVar1 = local_18[0]; *(int *)((int)outRooms + 4) = *(int *)((int)outRooms + 4) + 4; } LVar2 = (LevelGenerator)((int)LVar2 + 4); } while (LVar2 != this[0xe0]); } LVar2 = this[0xdc]; if (LVar2 != this[0xdd]) { do { local_18[0] = (int)this[0xd9] + *(int *)LVar2 * 0x48; piVar1 = *(int **)((int)outRooms + 4); if (piVar1 == *(int **)((int)outRooms + 8)) { std::vector<4byte>::_Emplace_reallocate(piVar1,local_18); } else { *piVar1 = local_18[0]; *(int *)((int)outRooms + 4) = *(int *)((int)outRooms + 4) + 4; } LVar2 = (LevelGenerator)((int)LVar2 + 4); } while (LVar2 != this[0xdd]); } ExceptionList = local_10; return outRooms; } //@@ 009af1e0 FUN_009af1e0 undefined4 FUN_009af1e0(void) { byte bVar1; uint uVar2; int iVar3; LevelGenerator *in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar4; uint size; int iVar5; LevelGenerator LVar6; LevelGenerator_Room LVar7; LevelGenerator_Room local_24; LevelGenerator_Room local_20; int local_1c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e2ed; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; LVar6 = in_ECX[0xd9]; local_14 = 0; if (((int)in_ECX[0xda] - (int)LVar6) / 0x48 != 0) { iVar5 = 0; do { LevelGenerator::get_neighbor_candidates(in_ECX,&local_24,*(uint *)(iVar5 + 4 + (int)LVar6),1); local_8 = 0; uVar4 = extraout_ECX; LVar7 = local_24; if (local_24 != local_20) { do { bVar1 = LevelGenerator::can_place_room (in_ECX,(int *)((int)LVar7 + 8), (int)*(LevelGenerator_Room *)((int)LVar7 + 0x18)); uVar4 = extraout_ECX_00; if ((bVar1 != 0) && (iVar3 = LevelGenerator::count_neighbor_rooms(in_ECX,(int *)((int)LVar7 + 0x28)), uVar4 = extraout_ECX_01, iVar3 < 2)) { LevelGenerator::place_room(in_ECX,(LevelGenerator_Room *)LVar7); vector_LevelGenerator_Room_tidy(&local_24); ExceptionList = local_10; return 1; } LVar7 = (LevelGenerator_Room)((int)LVar7 + 0x48); } while (LVar7 != local_20); } local_8 = 0xffffffff; if (local_24 != (LevelGenerator_Room)0x0) { FUN_00752e40(uVar4,uVar2); size = ((local_1c - (int)local_24) / 0x48) * 0x48; LVar7 = local_24; if (0xfff < size) { LVar7 = *(LevelGenerator_Room *)((int)local_24 + -4); size = size + 0x23; if (0x1f < ((int)local_24 - (int)LVar7) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)LVar7,size); local_24 = (LevelGenerator_Room)0x0; local_20 = (LevelGenerator_Room)0x0; local_1c = 0; } LVar6 = in_ECX[0xd9]; iVar5 = iVar5 + 0x48; local_14 = local_14 + 1; } while (local_14 < (uint)(((int)in_ECX[0xda] - (int)LVar6) / 0x48)); } ExceptionList = local_10; return 0; } //@@ 009af370 LevelGenerator::has_shape_slot /* ZHL [exact] static cleanup bool LevelGenerator::has_shape_slot(int shape, int doorSlot, bool ignoreThinShapesRestrictions); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ byte __cdecl LevelGenerator::has_shape_slot(int shape,int doorSlot,byte ignoreThinShapesRestrictions) { if ((((*(int *)(&DAT_00c5d37c + shape * 8) == 1) && ((doorSlot == 4 || (doorSlot == 6)))) || (((*(int *)(&DAT_00c5d378 + shape * 8) == 1 && ((doorSlot == 5 || (doorSlot == 7)))) || ((((shape == 3 || (shape == 5)) && (ignoreThinShapesRestrictions == 0)) && ((((doorSlot == 0 || (doorSlot == 2)) || (doorSlot == 4)) || (doorSlot == 6)))))))) || ((((shape == 2 || (shape == 7)) && (ignoreThinShapesRestrictions == 0)) && (((doorSlot == 1 || (doorSlot == 3)) || ((doorSlot == 5 || (doorSlot == 7)))))))) { return 0; } return 1; } //@@ 009af3f0 LevelGenerator::get_door_source_position /* ZHL [exact] static cleanup XY* LevelGenerator::get_door_source_position(XY* ret, XY* position, int shape, int doorSlot); prototype: REPENTOGON, caller cleans up (RET n cannot check it) */ void * __cdecl LevelGenerator::get_door_source_position(void *ret,void *position,int shape,int doorSlot) { undefined4 uVar1; int iVar2; byte isHasSlot; undefined4 extraout_ECX; int extraout_EDX; isHasSlot = has_shape_slot(shape,doorSlot,0); if (isHasSlot == 0) { switchD_009af41e_default: *(int *)ret = g_levelGenInvalidPos[0]; *(int *)((int)ret + 4) = g_levelGenInvalidPos[1]; return ret; } switch(extraout_ECX) { case 1: case 2: case 3: break; case 4: case 5: if (((extraout_EDX == 3) || (extraout_EDX == 4)) || (extraout_EDX == 6)) { iVar2 = *(int *)((int)position + 4); *(undefined4 *)ret = *(undefined4 *)position; *(int *)((int)ret + 4) = iVar2 + 1; return ret; } uVar1 = *(undefined4 *)((int)position + 4); *(undefined4 *)ret = *(undefined4 *)position; *(undefined4 *)((int)ret + 4) = uVar1; return ret; case 6: case 7: if (((extraout_EDX != 2) && (extraout_EDX != 5)) && (extraout_EDX != 7)) { uVar1 = *(undefined4 *)position; *(undefined4 *)((int)ret + 4) = *(undefined4 *)((int)position + 4); *(undefined4 *)ret = uVar1; return ret; } goto LAB_009af488; case 8: if ((extraout_EDX != 5) && (extraout_EDX != 2)) { if ((extraout_EDX != 4) && (extraout_EDX != 3)) { if ((extraout_EDX != 6) && (extraout_EDX != 7)) { *(undefined4 *)ret = *(undefined4 *)position; *(undefined4 *)((int)ret + 4) = *(undefined4 *)((int)position + 4); return ret; } LAB_009af57c: iVar2 = *(int *)((int)position + 4); *(int *)ret = *(int *)position + 1; *(int *)((int)ret + 4) = iVar2 + 1; return ret; } LAB_009af5bb: iVar2 = *(int *)((int)position + 4); *(undefined4 *)ret = *(undefined4 *)position; *(int *)((int)ret + 4) = iVar2 + 1; return ret; } goto LAB_009af488; case 9: if (((extraout_EDX != 0) && (extraout_EDX != 5)) && (extraout_EDX != 2)) { if (((extraout_EDX != 4) && (extraout_EDX != 1)) && (extraout_EDX != 3)) { iVar2 = *(int *)((int)position + 4); *(int *)ret = *(int *)position + 1; *(int *)((int)ret + 4) = iVar2 + 1; return ret; } goto LAB_009af5bb; } LAB_009af488: iVar2 = *(int *)position; *(undefined4 *)((int)ret + 4) = *(undefined4 *)((int)position + 4); *(int *)ret = iVar2 + 1; return ret; case 10: if (((extraout_EDX != 0) && (extraout_EDX != 1)) && (extraout_EDX != 2)) { if ((extraout_EDX != 4) && (extraout_EDX != 3)) { iVar2 = *(int *)((int)position + 4); *(int *)ret = *(int *)position + 1; *(int *)((int)ret + 4) = iVar2 + 1; return ret; } goto LAB_009af5bb; } break; case 0xb: if ((extraout_EDX != 0) && ((extraout_EDX != 1 && (extraout_EDX != 3)))) { if ((extraout_EDX != 5) && (extraout_EDX != 2)) goto LAB_009af57c; goto LAB_009af488; } break; case 0xc: if ((extraout_EDX != 0) && (extraout_EDX != 1)) { if ((extraout_EDX != 5) && ((extraout_EDX != 2 && (extraout_EDX != 7)))) goto LAB_009af5bb; goto LAB_009af488; } break; default: goto switchD_009af41e_default; } *(undefined4 *)ret = *(undefined4 *)position; *(undefined4 *)((int)ret + 4) = *(undefined4 *)((int)position + 4); return ret; } //@@ 009af620 LevelGenerator::get_door_target_position /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static cleanup XY* LevelGenerator::get_door_target_position(XY* ret, XY* position, int shape, int doorSlot, bool unk); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int * __cdecl LevelGenerator::get_door_target_position (int *outPosition,int *position,int shape,int doorSlot,byte isUnk) { byte isValidSlot; int iVar1; int *outPos; int shapeHeight; int roomShape; int ltlTargets [4]; int local_140; int local_13c; int local_138; int local_134; int local_130; int local_12c; int local_128; int local_124; int local_120; int local_11c; int local_118; int local_114; int ltrTargets [4]; int local_100; int local_fc; int local_f8; int local_f4; int local_f0; int local_ec; int local_e8; int local_e4; int local_e0; int local_dc; int local_d8; int local_d4; int lblTargets [4]; int local_c0; int local_bc; int local_b8; int local_b4; int local_b0; int local_ac; int local_a8; int local_a4; int local_a0; int local_9c; int local_98; int local_94; int lbrTargets [4]; int local_80; int local_7c; int local_78; int local_74; int local_70; int local_6c; int local_68; int local_64; int local_60; int local_5c; int local_58; int local_54; int defaultTargets [4]; int local_40; int local_3c; int local_38; int local_34; int local_30; int local_2c; int local_28; int local_24; int local_20; int local_1c; int local_18; int local_14; uint local_c; local_c = __security_cookie ^ (uint)&outPos; roomShape = shape; shapeHeight = *(int *)(&DAT_00c5d37c + shape * 8); iVar1 = *(int *)(&DAT_00c5d378 + shape * 8); outPos = outPosition; isValidSlot = has_shape_slot(shape,doorSlot,isUnk); if (isValidSlot == 0) { *outPosition = g_levelGenInvalidPos[0]; outPosition[1] = g_levelGenInvalidPos[1]; return outPosition; } defaultTargets[2] = *position; defaultTargets[1] = position[1]; local_3c = defaultTargets[1]; local_40 = iVar1 + defaultTargets[2]; local_20 = iVar1 + defaultTargets[2]; defaultTargets[3] = defaultTargets[1] + -1; local_140 = defaultTargets[2] + 2; local_34 = shapeHeight + defaultTargets[1]; local_130 = defaultTargets[2] + -1; local_124 = defaultTargets[1] + -1; local_120 = defaultTargets[2] + 2; local_14 = shapeHeight + defaultTargets[1]; local_134 = defaultTargets[1] + 2; ltrTargets[0] = defaultTargets[2] + -1; local_2c = defaultTargets[1] + 1; local_114 = local_134; ltrTargets[3] = defaultTargets[1] + -1; local_f4 = local_134; local_d4 = local_134; defaultTargets[0] = defaultTargets[2] + -1; local_30 = defaultTargets[2] + -1; local_28 = defaultTargets[2] + 1; local_24 = defaultTargets[1] + -1; local_1c = defaultTargets[1] + 1; local_f0 = defaultTargets[2] + -1; local_e0 = defaultTargets[2] + 2; lblTargets[0] = defaultTargets[2] + -1; local_38 = defaultTargets[2]; local_18 = local_28; ltlTargets[0] = defaultTargets[2]; ltlTargets[1] = defaultTargets[1]; ltlTargets[2] = defaultTargets[2]; ltlTargets[3] = defaultTargets[1]; local_13c = defaultTargets[1]; local_138 = defaultTargets[2]; local_12c = local_1c; local_128 = local_28; local_11c = local_1c; local_118 = local_28; ltrTargets[1] = defaultTargets[1]; ltrTargets[2] = defaultTargets[2]; local_100 = local_28; local_fc = defaultTargets[1]; local_f8 = defaultTargets[2]; local_ec = local_1c; local_e8 = local_28; local_e4 = defaultTargets[1]; local_dc = local_1c; local_d8 = local_28; lblTargets[1] = defaultTargets[1]; lblTargets[2] = defaultTargets[2]; lblTargets[3] = defaultTargets[1] + -1; local_c0 = local_e0; local_bc = defaultTargets[1]; local_b8 = defaultTargets[2]; local_b4 = local_1c; local_b0 = defaultTargets[2]; local_ac = local_1c; local_a8 = local_28; local_a4 = defaultTargets[1] + -1; local_94 = defaultTargets[1] + 2; local_74 = defaultTargets[1] + 2; local_98 = local_28; local_70 = defaultTargets[2] + -1; lbrTargets[0] = defaultTargets[2] + -1; local_64 = defaultTargets[1] + -1; lbrTargets[3] = defaultTargets[1] + -1; local_a0 = local_e0; local_68 = defaultTargets[2] + 1; local_9c = local_1c; lbrTargets[1] = defaultTargets[1]; lbrTargets[2] = defaultTargets[2]; local_80 = local_e0; local_7c = defaultTargets[1]; local_78 = defaultTargets[2]; local_6c = local_1c; local_60 = local_68; local_5c = local_1c; local_58 = local_68; local_54 = local_1c; switch(roomShape) { case 9: *outPos = ltlTargets[doorSlot * 2]; iVar1 = ltlTargets[doorSlot * 2 + 1]; break; case 10: *outPos = ltrTargets[doorSlot * 2]; iVar1 = ltrTargets[doorSlot * 2 + 1]; break; case 0xb: *outPos = lblTargets[doorSlot * 2]; iVar1 = lblTargets[doorSlot * 2 + 1]; break; case 0xc: *outPos = lbrTargets[doorSlot * 2]; iVar1 = lbrTargets[doorSlot * 2 + 1]; break; default: *outPos = defaultTargets[doorSlot * 2]; iVar1 = defaultTargets[doorSlot * 2 + 1]; } outPos[1] = iVar1; return outPos; } //@@ 009af980 LevelGenerator::update_room_neighbors /* DB: ? for room param (+0x18 shape/pos) clears its neighbour set (+0x30) and door mask (+0x1c), then for the 8 door slots LevelGenerator::get_door_target_position -> 13x13 grid cell; if occupied sets door bit and inserts the neighbour room index into the set; copies count to +0x38; LevelGenerator::try_place_room/try_resize_room prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall LevelGenerator::update_room_neighbors(LevelGenerator *this,void *room) { int *this_00; LevelGenerator *pLVar1; undefined4 uVar2; uint uVar3; int iVar4; undefined8 *puVar5; undefined4 *newNode; uint doorSlot; undefined1 local_40 [12]; undefined8 local_34; int local_28; undefined4 local_24; uint local_20; uint local_1c; undefined4 *local_18; LevelGenerator *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e31d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_40 + 0x3c); ExceptionList = &local_10; local_18 = (undefined4 *)((int)room + 0x1c); this_00 = (int *)((int)room + 0x30); *local_18 = 0; iVar4 = *this_00; local_14 = this; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(iVar4 + 4)); *(int *)(iVar4 + 4) = iVar4; *(int *)iVar4 = iVar4; *(int *)(iVar4 + 8) = iVar4; doorSlot = 0; *(undefined4 *)((int)room + 0x34) = 0; do { get_door_target_position ((int *)&local_20,(int *)((int)room + 8),*(int *)((int)room + 0x18),doorSlot,0); if ((((local_20 < 0xd) && (local_1c < 0xd)) && (iVar4 = local_1c * 0xd + local_20, -1 < iVar4)) && (pLVar1 = local_14 + iVar4 + 5, -1 < (int)local_14[iVar4 + 5])) { if (7 < doorSlot) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(uVar3); } local_18[doorSlot >> 5] = local_18[doorSlot >> 5] | 1 << ((byte)doorSlot & 0x1f); puVar5 = (undefined8 *)std::set::find_node(local_40,pLVar1); local_34 = *puVar5; if ((*(char *)(*(int *)(puVar5 + 1) + 0xd) != '\0') || ((int)*pLVar1 < *(int *)(*(int *)(puVar5 + 1) + 0x10))) { if (*(int *)((int)room + 0x34) == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } uVar2 = *(undefined4 *)((int)room + 0x30); local_28 = (int)room + 0x30; local_8 = 0; local_24 = 0; newNode = operator_new(0x14); local_8 = 0xffffffff; *(LevelGenerator *)(newNode + 4) = *pLVar1; *newNode = uVar2; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; local_24 = 0; std::_Tree::_Insert_node((void *)((int)room + 0x30),(void *)local_34,local_34._4_4_,newNode) ; } } doorSlot = doorSlot + 1; } while ((int)doorSlot < 8); *(undefined4 *)((int)room + 0x38) = *(undefined4 *)((int)room + 0x34); ExceptionList = local_10; return; } //@@ 009afb10 LevelGenerator::mark_dead_ends /* ZHL [exact] __thiscall void LevelGenerator::mark_dead_ends(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall LevelGenerator::mark_dead_ends(LevelGenerator *this) { int iVar1; LevelGenerator LVar2; uint uVar3; uint uVar4; uint uVar5; LevelGenerator LVar6; int local_8; uVar5 = 0; LVar2 = this[0xda]; LVar6 = this[0xd9]; iVar1 = (int)LVar2 - (int)LVar6 >> 0x1f; if (((int)LVar2 - (int)LVar6) / 0x48 + iVar1 != iVar1) { local_8 = 0; do { if (uVar5 != 0) { iVar1 = count_neighbor_rooms(this,(int *)(local_8 + 0x28 + (int)LVar6)); if (iVar1 < 2) { *(undefined1 *)(local_8 + 0x3c + (int)LVar6) = 1; } } local_8 = local_8 + 0x48; LVar6 = this[0xd9]; uVar5 = uVar5 + 1; } while (uVar5 < (uint)(((int)this[0xda] - (int)LVar6) / 0x48)); LVar2 = this[0xda]; } uVar5 = 0; iVar1 = (int)LVar2 - (int)LVar6 >> 0x1f; if (((int)LVar2 - (int)LVar6) / 0x48 + iVar1 != iVar1) { local_8 = 0; do { if ((uVar5 != 0) && ((iVar1 = *(int *)(local_8 + 0x28 + (int)LVar6), iVar1 != g_levelGenInvalidPos[0] || (*(int *)(local_8 + 0x2c + (int)LVar6) != g_levelGenInvalidPos[1])))) { uVar3 = *(int *)(local_8 + 0x20 + (int)LVar6) + 2U & 0x80000003; if ((int)uVar3 < 0) { uVar3 = (uVar3 - 1 | 0xfffffffc) + 1; } uVar4 = iVar1 + (&DAT_00c5d3e0)[uVar3 * 2]; uVar3 = *(int *)(local_8 + 0x2c + (int)LVar6) + (&DAT_00c5d3e4)[uVar3 * 2]; if ((uVar4 < 0xd) && (uVar3 < 0xd)) { iVar1 = uVar3 * 0xd + uVar4; } else { iVar1 = -1; } LVar2 = this[iVar1 + 5]; if ((int)LVar2 < 0) { KAGE_LogMessage(0x10,(byte *)"invalid connecting neighbor\n"); } *(undefined1 *)((int)this[0xd9] + 0x3c + (int)LVar2 * 0x48) = 0; } LVar6 = this[0xd9]; local_8 = local_8 + 0x48; uVar5 = uVar5 + 1; } while (uVar5 < (uint)(((int)this[0xda] - (int)LVar6) / 0x48)); } return; } //@@ 009afc70 LevelGenerator::update_dead_end_lists /* DB: resets the two index vectors at +0x370/+0x37c, LevelGenerator::mark_dead_ends, then for each 0x48-byte room (+0x364 vector) FUN_009af980 and pushes its index into the dead-end list (room+0x3c set) or the other list; LevelGenerator::Generate, LevelGenerator::CreateRoom prototype: db/protos.zhl */ void __thiscall LevelGenerator::update_dead_end_lists(LevelGenerator *this) { int iVar1; LevelGenerator LVar2; uint uVar3; int local_10; uint local_c [2]; this[0xdd] = this[0xdc]; this[0xe0] = this[0xdf]; mark_dead_ends(this); LVar2 = this[0xd9]; uVar3 = 0; iVar1 = (int)this[0xda] - (int)LVar2 >> 0x1f; if (((int)this[0xda] - (int)LVar2) / 0x48 + iVar1 != iVar1) { local_10 = 0; do { update_room_neighbors(this,(void *)((int)LVar2 + local_10)); local_c[0] = uVar3; if (*(char *)((int)LVar2 + local_10 + 0x3c) == '\0') { LVar2 = this[0xe0]; if (LVar2 == this[0xe1]) goto LAB_009afd26; *(uint *)LVar2 = uVar3; this[0xe0] = (LevelGenerator)((int)this[0xe0] + 4); } else { LVar2 = this[0xdd]; if (LVar2 == this[0xde]) { LAB_009afd26: std::vector::_Emplace_reallocate(LVar2,local_c); } else { *(uint *)LVar2 = uVar3; this[0xdd] = (LevelGenerator)((int)this[0xdd] + 4); } } LVar2 = this[0xd9]; uVar3 = uVar3 + 1; local_10 = local_10 + 0x48; } while (uVar3 < (uint)(((int)this[0xda] - (int)LVar2) / 0x48)); } return; } //@@ 009afd70 FUN_009afd70 int FUN_009afd70(void) { uint *in_ECX; if ((*in_ECX < 0xd) && (in_ECX[1] < 0xd)) { return in_ECX[1] * 0xd + *in_ECX; } return -1; } //@@ 009afdb0 LevelGenerator::get_room_placement_offsets /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* ZHL [exact] static __fastcall int** LevelGenerator::get_room_placement_offsets(int shape); prototype: REPENTOGON, confirmed by RET 0 */ int ** __fastcall LevelGenerator::get_room_placement_offsets(int shape) { int threadLocals; threadLocals = *(int *)ThreadLocalStoragePointer; if (*(int *)(threadLocals + 0xc) < DAT_00c94338) { _Init_thread_header(&DAT_00c94338); if (DAT_00c94338 == -1) { _DAT_00c7f5f4 = g_levelGenInvalidPos[0]; _DAT_00c7f5f8 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94338); } } if (*(int *)(threadLocals + 0xc) < DAT_00c9433c) { _Init_thread_header(&DAT_00c9433c); if (DAT_00c9433c == -1) { _DAT_00c7f5ec = g_levelGenInvalidPos[0]; _DAT_00c7f5e4 = 0; _DAT_00c7f5e8 = 0; _DAT_00c7f5f0 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c9433c); } } if (*(int *)(threadLocals + 0xc) < DAT_00c94340) { _Init_thread_header(&DAT_00c94340); if (DAT_00c94340 == -1) { _DAT_00c7f5dc = g_levelGenInvalidPos[0]; _DAT_00c7f5cc = 0; uRam00c7f5d0 = 0; uRam00c7f5d4 = 0; uRam00c7f5d8 = 1; _DAT_00c7f5e0 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94340); } } if (*(int *)(threadLocals + 0xc) < DAT_00c94344) { _Init_thread_header(&DAT_00c94344); if (DAT_00c94344 == -1) { _DAT_00c7f5c4 = g_levelGenInvalidPos[0]; _DAT_00c7f5b4 = 0; uRam00c7f5b8 = 0; uRam00c7f5bc = 1; uRam00c7f5c0 = 0; _DAT_00c7f5c8 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94344); } } if (*(int *)(threadLocals + 0xc) < DAT_00c94348) { _Init_thread_header(&DAT_00c94348); if (DAT_00c94348 == -1) { _DAT_00c7f58c = 0; uRam00c7f590 = 0; uRam00c7f594 = 1; uRam00c7f598 = 0; _DAT_00c7f5ac = g_levelGenInvalidPos[0]; _DAT_00c7f59c = 0; uRam00c7f5a0 = 1; uRam00c7f5a4 = 1; uRam00c7f5a8 = 1; _DAT_00c7f5b0 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94348); } } if (*(int *)(threadLocals + 0xc) < DAT_00c9434c) { _Init_thread_header(&DAT_00c9434c); if (DAT_00c9434c == -1) { _DAT_00c7f584 = g_levelGenInvalidPos[0]; _DAT_00c7f56c = 1; uRam00c7f570 = 0; uRam00c7f574 = 0; uRam00c7f578 = 1; _DAT_00c7f57c = 1; _DAT_00c7f580 = 1; _DAT_00c7f588 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c9434c); } } if (*(int *)(threadLocals + 0xc) < DAT_00c94350) { _Init_thread_header(&DAT_00c94350); if (DAT_00c94350 == -1) { _DAT_00c7f564 = g_levelGenInvalidPos[0]; _DAT_00c7f54c = 0; uRam00c7f550 = 0; uRam00c7f554 = 0; uRam00c7f558 = 1; _DAT_00c7f55c = 1; _DAT_00c7f560 = 1; _DAT_00c7f568 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94350); } } if (*(int *)(threadLocals + 0xc) < DAT_00c94354) { _Init_thread_header(&DAT_00c94354); if (DAT_00c94354 == -1) { _DAT_00c7f544 = g_levelGenInvalidPos[0]; _DAT_00c7f52c = 0; uRam00c7f530 = 0; uRam00c7f534 = 1; uRam00c7f538 = 0; _DAT_00c7f53c = 1; _DAT_00c7f540 = 1; _DAT_00c7f548 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94354); } } if (*(int *)(threadLocals + 0xc) < DAT_00c94358) { _Init_thread_header(&DAT_00c94358); if (DAT_00c94358 == -1) { _DAT_00c7f524 = g_levelGenInvalidPos[0]; _DAT_00c7f50c = 0; uRam00c7f510 = 0; uRam00c7f514 = 1; uRam00c7f518 = 0; _DAT_00c7f51c = 0; _DAT_00c7f520 = 1; _DAT_00c7f528 = g_levelGenInvalidPos[1]; _Init_thread_footer(&DAT_00c94358); } } return (int **)(&PTR_DAT_00c5c4a0 + shape); } //@@ 009b0180 LevelGenerator::can_place_room /* DB: for each cell offset of the shape (LevelGenerator::get_room_placement_offsets, terminated by g_levelGenInvalidPos/24 sentinel) checks 13x13 bounds, grid slot ECX+0x14+idx*4 < 0 (empty), blocked flags +0x2b8, and not the last placed room cell when +0x391; returns 1 if all free; Level::try_place_random_room, LevelGenerator::get_neighbor_candidates prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall LevelGenerator::can_place_room(LevelGenerator *this,int *gridPos,int shape) { LevelGenerator LVar1; uint uVar2; int **ppiVar3; int iVar4; int *piVar5; int iVar6; LVar1 = this[0xd9]; if (LVar1 != this[0xda]) { uVar2 = *(int *)((int)LVar1 + 0xc) - 1; if ((*(uint *)((int)LVar1 + 8) < 0xd) && (uVar2 < 0xd)) { iVar6 = uVar2 * 0xd + *(uint *)((int)LVar1 + 8); goto LAB_009b01b5; } } iVar6 = -1; LAB_009b01b5: ppiVar3 = get_room_placement_offsets(shape); piVar5 = *ppiVar3 + 1; while( true ) { if ((piVar5[-1] == g_levelGenInvalidPos[0]) && (*piVar5 == g_levelGenInvalidPos[1])) { return 1; } uVar2 = *gridPos + piVar5[-1]; if ((uVar2 < 0xd) && ((uint)(*piVar5 + gridPos[1]) < 0xd)) { iVar4 = (*piVar5 + gridPos[1]) * 0xd + uVar2; } else { iVar4 = -1; } if ((((this[0xe4].field_0x1 != '\0') && (iVar4 == iVar6)) || (iVar4 < 0)) || ((-1 < (int)this[iVar4 + 5] || ((&this[0xae].field_0x0)[iVar4] != '\0')))) break; piVar5 = piVar5 + 2; } return 0; } //@@ 009b0240 LevelGenerator::is_placement_valid /* ZHL [exact] __thiscall bool LevelGenerator::is_placement_valid(uint32_t* position, uint32_t shape); prototype: REPENTOGON, confirmed by RET 8 */ byte __thiscall LevelGenerator::is_placement_valid(LevelGenerator *this,uint *position,uint shape) { int iVar1; int iVar2; int *piVar3; int doorSlot; int doorSlot_00; int local_20; int local_1c; uint local_18; uint local_14; int local_10 [3]; doorSlot = 0; do { get_door_source_position(&local_20,position,shape,doorSlot); get_door_target_position((int *)&local_18,(int *)position,shape,doorSlot,1); iVar1 = local_1c; if ((((local_18 < 0xd) && (local_14 < 0xd)) && (iVar2 = local_14 * 0xd + local_18, -1 < iVar2)) && (-1 < (int)this[iVar2 + 5])) { if ((local_20 == g_levelGenInvalidPos[0]) && (local_1c == g_levelGenInvalidPos[1])) { return 0; } doorSlot_00 = 0; iVar2 = (int)this[0xd9] + (int)this[iVar2 + 5] * 0x48; while ((piVar3 = get_door_target_position (local_10,(int *)(iVar2 + 8),*(int *)(iVar2 + 0x18),doorSlot_00,0), *piVar3 != local_20 || (piVar3[1] != iVar1))) { doorSlot_00 = doorSlot_00 + 1; if (7 < doorSlot_00) { return 0; } } } doorSlot = doorSlot + 1; if (7 < doorSlot) { return 1; } } while( true ); } //@@ 009b0330 LevelGenerator::place_room /* ZHL [exact] __thiscall bool LevelGenerator::place_room(LevelGenerator_Room *room); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall LevelGenerator::place_room(LevelGenerator *this,LevelGenerator_Room *room) { LevelGenerator this_00; int *piVar1; LevelGenerator LVar2; int **ppiVar3; uint uVar4; uint uVar5; int iVar6; int iVar7; this_00 = this[0xda]; LVar2 = (LevelGenerator)(((int)this_00 - (int)this[0xd9]) / 0x48); if (this_00 == this[0xdb]) { std::vector::_Emplace_reallocate(this_00,room); } else { LevelGenerator_Room::LevelGenerator_Room((LevelGenerator_Room *)this_00,room); this[0xda] = (LevelGenerator)((int)this[0xda] + 0x48); } *(LevelGenerator *)((int)this[0xda] + -0x44) = LVar2; ppiVar3 = get_room_placement_offsets((int)room[6]); if (room[6] != (LevelGenerator_Room)0x1) { KAGE_LogMessage(1,(byte *)"place_room: shape %d\n"); } iVar7 = 0; do { piVar1 = *ppiVar3; if ((*(int *)((int)piVar1 + iVar7) == g_levelGenInvalidPos[0]) && (*(int *)((int)piVar1 + iVar7 + 4) == g_levelGenInvalidPos[1])) { return SUB41(this[0xda],0) + 0xb8; } uVar5 = *(int *)((int)piVar1 + iVar7) + (int)room[2]; uVar4 = (int)room[3] + *(int *)((int)piVar1 + iVar7 + 4); if ((uVar5 < 0xd) && (uVar4 < 0xd)) { iVar6 = uVar4 * 0xd + uVar5; if (iVar6 < 0) goto LAB_009b03fb; } else { iVar6 = -1; LAB_009b03fb: KAGE_LogMessage(0x10,(byte *)"[LevelGenerator] place_room: invalid room\n"); } iVar7 = iVar7 + 8; this[iVar6 + 5] = LVar2; } while( true ); } //@@ 009b0440 LevelGenerator::count_neighbor_rooms /* DB: for the 4 direction offsets DAT_00c5d3e0..c5d400 counts cells inside the 13x13 grid that are occupied (ECX+0x14 slot >= 0) by a room other than the one at the cell itself (FUN_009afd70); LevelGenerator::mark_dead_ends, Level::generate_boss_room prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall LevelGenerator::count_neighbor_rooms(LevelGenerator *this,int *gridPos) { int iVar1; int iVar2; LevelGenerator LVar3; int iVar4; int iVar5; int *piVar6; iVar1 = *gridPos; iVar5 = 0; iVar2 = gridPos[1]; piVar6 = &DAT_00c5d3e0; do { if (((((uint)(iVar1 + *piVar6) < 0xd) && ((uint)(piVar6[1] + iVar2) < 0xd)) && (iVar4 = (piVar6[1] + iVar2) * 0xd + iVar1 + *piVar6, -1 < iVar4)) && ((LVar3 = this[iVar4 + 5], -1 < (int)LVar3 && (iVar4 = FUN_009afd70(), LVar3 != this[iVar4 + 5])))) { iVar5 = iVar5 + 1; } piVar6 = piVar6 + 2; } while ((int)piVar6 < 0xc5d400); return iVar5; } //@@ 009b04d0 LevelGenerator::generate_rooms /* DB: the main layout loop called by LevelGenerator::Generate: place_room(startRoom) then grows rooms; strings "%d rooms in %d loops", "[LevelGenerator] fail %d/%d in %d loops" */ void LevelGenerator::generate_rooms(uint param_1,LevelGenerator_Room *param_2) { code *pcVar1; int *ptr; byte bVar2; undefined3 extraout_var; int neighborCount; LevelGenerator seed; undefined3 extraout_var_00; void *pvVar3; LevelGenerator *in_ECX; uint uVar4; void *pvVar5; uint uVar6; LevelGenerator_Room candidate; int *queueProxy; void *queueMap; uint queueMapSize; uint queueOffset; int queueSize; LevelGenerator_Room candidatesBegin; LevelGenerator_Room candidatesEnd; int candidatesCapacity; uint local_28; uint local_24; int blockOffset; uint startRoomIdx; uint branchLimit; uint roomCount; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e355; local_10 = ExceptionList; ExceptionList = &local_10; uVar6 = 0; roomCount = 0; queueProxy = (int *)0x0; queueMap = (void *)0x0; queueMapSize = 0; queueOffset = 0; queueSize = 0; queueProxy = operator_new(8); queueProxy[1] = 0; *queueProxy = (int)&queueProxy; local_8 = 0; bVar2 = place_room(in_ECX,param_2); startRoomIdx = *(uint *)(CONCAT31(extraout_var,bVar2) + 4); FUN_009b1a90(&startRoomIdx); if (queueSize == 0) { if (param_1 == 0) { LAB_009b0a10: KAGE_LogMessage(1,(byte *)"%d rooms in %d loops\n"); goto LAB_009b0a21; } } else { do { if (param_1 <= uVar6) goto LAB_009b0a10; uVar4 = *(uint *)(*(int *)((int)queueMap + (queueOffset >> 2 & queueMapSize - 1) * 4) + (queueOffset & 3) * 4); queueSize = queueSize + -1; if (queueSize == 0) { queueOffset = 0; } else { queueOffset = queueOffset + 1; } get_neighbor_candidates(in_ECX,&candidatesBegin,uVar4,0); local_8 = CONCAT31(local_8._1_3_,1); level_generator_rooms_shuffle(candidatesBegin,candidatesEnd); if (uVar4 == startRoomIdx) { if (param_1 < 0x10) { seed = *in_ECX; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar4 = uVar4 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar4; seed = (LevelGenerator)(uVar4 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar4); *in_ECX = seed; branchLimit = ((uint)seed & 1) + 2; } else { branchLimit = ((int)candidatesEnd - (int)candidatesBegin) / 0x48; } } else { seed = *in_ECX; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar6 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar6 = uVar6 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar6; seed = (LevelGenerator)(uVar6 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar6); *in_ECX = seed; local_24 = (uint)seed & 1; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar6 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar6 = uVar6 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar6; seed = (LevelGenerator)(uVar6 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar6); *in_ECX = seed; local_28 = (uint)seed & 1; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar6 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar6 = uVar6 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar6; seed = (LevelGenerator)(uVar6 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar6); *in_ECX = seed; uVar6 = (uint)seed & 1; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar4 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar4 = uVar4 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar4; seed = (LevelGenerator)(uVar4 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar4); *in_ECX = seed; uVar6 = uVar6 + ((uint)seed & 1) + local_28 + local_24; branchLimit = ((int)candidatesEnd - (int)candidatesBegin) / 0x48; if (uVar6 < branchLimit) { branchLimit = uVar6; } uVar6 = roomCount; } local_28 = 0; candidate = candidatesBegin; if (candidatesBegin != candidatesEnd) { do { bVar2 = can_place_room(in_ECX,(int *)((int)candidate + 8), (int)*(LevelGenerator_Room *)((int)candidate + 0x18)); if (bVar2 != 0) { neighborCount = count_neighbor_rooms(in_ECX,(int *)((int)candidate + 0x28)); if (neighborCount < 2) { LAB_009b07d8: bVar2 = is_placement_valid(in_ECX,(uint *)((int)candidate + 8), (uint)*(LevelGenerator_Room *)((int)candidate + 0x18)); if (bVar2 != 0) { bVar2 = place_room(in_ECX,(LevelGenerator_Room *)candidate); seed = *in_ECX; local_24 = *(uint *)(CONCAT31(extraout_var_00,bVar2) + 4); if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar6 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar6 = uVar6 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar6; seed = (LevelGenerator)(uVar6 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar6); *in_ECX = seed; if ((uint)seed % 3 == 0) { if (((queueOffset + queueSize & 3) == 0) && (queueMapSize <= queueSize + 4U >> 2)) { std::deque<4byte>::_Growmap(queueOffset); } queueOffset = queueOffset & queueMapSize * 4 - 1; uVar6 = queueSize + queueOffset; blockOffset = (queueMapSize - 1 & uVar6 >> 2) * 4; if (*(int *)(blockOffset + (int)queueMap) == 0) { pvVar3 = operator_new(0x10); *(void **)(blockOffset + (int)queueMap) = pvVar3; } *(uint *)(*(int *)(blockOffset + (int)queueMap) + (uVar6 & 3) * 4) = local_24; } else { if (((queueOffset & 3) == 0) && (queueMapSize <= queueSize + 4U >> 2)) { std::deque<4byte>::_Growmap(3); } queueOffset = queueOffset & queueMapSize * 4 - 1; uVar6 = queueOffset; if (queueOffset == 0) { uVar6 = queueMapSize * 4; } uVar6 = uVar6 - 1; blockOffset = (queueMapSize - 1 & uVar6 >> 2) * 4; if (*(int *)(blockOffset + (int)queueMap) == 0) { pvVar3 = operator_new(0x10); *(void **)(blockOffset + (int)queueMap) = pvVar3; } *(uint *)(*(int *)(blockOffset + (int)queueMap) + (uVar6 & 3) * 4) = local_24; queueOffset = uVar6; } local_28 = local_28 + 1; queueSize = queueSize + 1; roomCount = roomCount + 1; if (((int)branchLimit <= (int)local_28) || (param_1 <= roomCount)) break; } } else if ((*(char *)(in_ECX + 0xe4) != '\0') || (in_ECX[0xe4].field_0x2 != '\0')) { seed = *in_ECX; if (seed == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); seed = *in_ECX; if (seed == (LevelGenerator)0x0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar6 = (uint)seed >> (SUB41(in_ECX[1],0) & 0x1f) ^ (uint)seed; uVar6 = uVar6 << (SUB41(in_ECX[2],0) & 0x1f) ^ uVar6; seed = (LevelGenerator)(uVar6 >> (SUB41(in_ECX[3],0) & 0x1f) ^ uVar6); *in_ECX = seed; if ((uint)seed % 10 == 0) goto LAB_009b07d8; } } candidate = (LevelGenerator_Room)((int)candidate + 0x48); } while (candidate != candidatesEnd); uVar6 = roomCount; } local_8 = local_8 & 0xffffff00; if (param_1 <= uVar6) { vector_LevelGenerator_Room_tidy(&candidatesBegin); goto LAB_009b0a10; } if (candidatesBegin != (LevelGenerator_Room)0x0) { FUN_00752e40(param_1); uVar4 = ((candidatesCapacity - (int)candidatesBegin) / 0x48) * 0x48; candidate = candidatesBegin; if (0xfff < uVar4) { candidate = *(LevelGenerator_Room *)((int)candidatesBegin + -4); uVar4 = uVar4 + 0x23; if (0x1f < ((int)candidatesBegin - (int)candidate) - 4U) goto LAB_009b0a8f; } operator_delete((void *)candidate,uVar4); candidatesBegin = (LevelGenerator_Room)0x0; candidatesEnd = (LevelGenerator_Room)0x0; candidatesCapacity = 0; } } while (queueSize != 0); } KAGE_LogMessage(1,(byte *)"[LevelGenerator] fail %d/%d in %d loops\n"); LAB_009b0a21: if (queueSize != 0) { do { queueSize = queueSize + -1; } while (queueSize != 0); queueOffset = 0; queueSize = 0; } pvVar3 = queueMap; uVar6 = queueMapSize; if (queueMapSize != 0) { do { pvVar5 = *(void **)((int)pvVar3 + uVar6 * 4 + -4); uVar6 = uVar6 - 1; if (pvVar5 != (void *)0x0) { operator_delete(pvVar5,0x10); pvVar3 = queueMap; } } while (uVar6 != 0); } if (pvVar3 != (void *)0x0) { uVar6 = queueMapSize * 4; pvVar5 = pvVar3; if (0xfff < uVar6) { pvVar5 = *(void **)((int)pvVar3 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)pvVar5))) { LAB_009b0a8f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar6); } ptr = queueProxy; queueMapSize = 0; queueMap = (void *)0x0; queueProxy = (int *)0x0; operator_delete(ptr,8); ExceptionList = local_10; return; } //@@ 009b0b00 LevelGenerator::get_neighbor_candidates /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x009b0d65) */ /* ZHL [exact] __thiscall void LevelGenerator::get_neighbor_candidates(vector_LevelGenRoom* neighbors, uint32_t generationIndex, bool unk); prototype: REPENTOGON, confirmed by RET 12 */ void __thiscall LevelGenerator::get_neighbor_candidates (LevelGenerator *this,void *neighbors,uint generationIndex,byte unk) { uint uVar1; code *pcVar2; bool bVar3; byte isPlaceable; uint doorDir; int offsetX; uint rngState; LevelGenerator LVar4; undefined4 local_15c; undefined4 local_158; undefined4 local_154; undefined4 local_150; uint doorSlot; uint targetX; uint targetY; uint *local_13c; char isAllowed; int local_134; LevelGenerator_Room newRoom [8]; uint local_110; uint local_10c; uint local_108; uint local_104; void *local_100 [4]; int local_f0; uint candidatePositions; int local_e4; uint local_e0; uint local_dc; int local_d8; int local_d4; uint local_d0; int local_cc; int local_c8; int local_c4; uint local_c0; int local_bc; int local_b8; int local_b4; uint local_b0; int local_ac; int local_a8; int local_a4; uint local_a0; int local_9c; int local_98; int local_94; uint local_90; uint local_8c; uint local_88; int local_84; uint candidateShapes [6]; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; int local_54; undefined4 local_50; uint shapeChanceDivisors [15]; void *local_10; undefined1 *puStack_c; uint local_8; int sourceRoom; puStack_c = &LAB_00b0e3bd; local_10 = ExceptionList; shapeChanceDivisors[0xd] = __security_cookie ^ (uint)(shapeChanceDivisors + 0x12); ExceptionList = &local_10; local_8 = 0; if ((uint)(((int)this[0xda] - (int)this[0xd9]) / 0x48) <= generationIndex) { KAGE_LogMessage(0x10,(byte *)"[LevelGenerator] get_neighbor_candidates: out of bounds\n"); } LVar4 = this[0xd9]; *(undefined4 *)neighbors = 0; *(undefined4 *)((int)neighbors + 4) = 0; *(undefined4 *)((int)neighbors + 8) = 0; sourceRoom = (int)LVar4 + generationIndex * 0x48; bVar3 = false; local_8 = 0; doorSlot = 0; do { get_door_target_position ((int *)&targetX,(int *)(sourceRoom + 8),*(int *)(sourceRoom + 0x18),doorSlot,0); if (((0xc < targetX) || (0xc < targetY)) || (targetY * 0xd + targetX == -1)) goto LAB_009b11cf; doorDir = doorSlot & 3; if ((doorDir == 2) || (doorDir == 3)) { offsetX = 0; local_e4 = 0; } else { local_e4 = (&DAT_00c5d3e4)[doorDir * 2]; offsetX = (&DAT_00c5d3e0)[doorDir * 2]; } if ((doorDir == 0) || (doorDir == 2)) { local_c8 = 0; local_13c = (uint *)0xffffffff; } else { local_c8 = -1; local_13c = (uint *)0x0; } local_e0 = targetX; candidatePositions = targetX + offsetX; local_e4 = local_e4 + targetY; local_dc = targetY; local_d8 = targetX + local_c8; local_d4 = (int)local_13c + targetY; local_c4 = (int)local_13c + local_e4; local_c8 = local_c8 + candidatePositions; local_90 = targetX; local_8c = targetY; if ((doorDir == 0) || (doorDir == 2)) { candidateShapes[1] = 4; candidateShapes[0] = 6; } else { candidateShapes[0] = 4; candidateShapes[1] = 6; } switch(doorDir) { case 0: local_150 = 0xc; local_154 = 10; local_158 = 0xb; local_15c = 9; goto LAB_009b0daa; case 1: local_150 = 0xc; local_154 = 0xb; local_158 = 10; local_15c = 9; local_134 = 3; break; case 2: local_150 = 0xb; local_154 = 9; local_158 = 10; local_15c = 0xc; LAB_009b0daa: local_134 = 2; break; case 3: local_150 = 10; local_154 = 9; local_158 = 0xb; local_15c = 0xc; local_134 = 3; } if ((doorDir == 0) || (local_50 = 5, doorDir == 2)) { local_50 = 7; } candidateShapes[5] = local_150; local_68 = local_154; local_64 = local_158; local_60 = local_158; local_5c = local_15c; local_58 = local_15c; local_54 = local_134; candidateShapes[3] = 8; candidateShapes[4] = 8; shapeChanceDivisors[0] = 0x30; shapeChanceDivisors[1] = 0x18; shapeChanceDivisors[2] = 0x18; shapeChanceDivisors[3] = 0x18; shapeChanceDivisors[4] = 0x18; shapeChanceDivisors[5] = 0x48; shapeChanceDivisors[6] = 0x48; shapeChanceDivisors[7] = 0x24; shapeChanceDivisors[8] = 0x24; shapeChanceDivisors[9] = 0x24; shapeChanceDivisors[10] = 0x24; shapeChanceDivisors[0xb] = 0x18; shapeChanceDivisors[0xc] = 0x18; local_d0 = candidatePositions; local_cc = local_e4; local_c0 = candidatePositions; local_bc = local_e4; local_b8 = local_c8; local_b4 = local_c4; local_b0 = candidatePositions; local_ac = local_e4; local_a8 = local_c8; local_a4 = local_c4; local_a0 = candidatePositions; local_9c = local_e4; local_98 = local_c8; local_94 = local_c4; local_88 = candidatePositions; local_84 = local_e4; candidateShapes[2] = candidateShapes[1]; isPlaceable = can_place_room(this,(int *)&targetX,1); if (isPlaceable != 0) { if ((*(byte *)(this + 4) & 2) != 0) { LevelGenerator_Room::constructor(newRoom,targetX,targetY,1); local_8 = 1; local_108 = targetX; local_104 = targetY; local_10c = doorSlot; newRoom[0]._0_1_ = 1; local_f0 = *(int *)(sourceRoom + 0x40) + 1; if (*(int *)((int)neighbors + 4) == *(int *)((int)neighbors + 8)) { local_110 = doorDir; std::vector::_Emplace_reallocate (*(int *)((int)neighbors + 4),newRoom); } else { local_110 = doorDir; LevelGenerator_Room::LevelGenerator_Room (*(LevelGenerator_Room **)((int)neighbors + 4),newRoom); *(int *)((int)neighbors + 4) = *(int *)((int)neighbors + 4) + 0x48; } local_8 = local_8 & 0xffffff00; FID_conflict__Erase_tree_>_> (local_100,(fuzzer_allocator_> *)local_100, *(_Tree_node **)((int)local_100[0] + 4)); operator_delete(local_100[0],0x14); } local_13c = &candidatePositions; local_134 = 0; do { uVar1 = *(uint *)((int)shapeChanceDivisors + local_134); LVar4 = *this; if (LVar4 == (LevelGenerator)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); LVar4 = *this; if (LVar4 == (LevelGenerator)0x0) { pcVar2 = (code *)swi(3); (*pcVar2)(); return; } } rngState = (uint)LVar4 >> (SUB41(this[1],0) & 0x1f) ^ (uint)LVar4; rngState = rngState << (SUB41(this[2],0) & 0x1f) ^ rngState; LVar4 = (LevelGenerator)(rngState >> (SUB41(this[3],0) & 0x1f) ^ rngState); *this = LVar4; if ((((uVar1 == 0) || ((uint)LVar4 % uVar1 == 0)) || (bVar3 = true, (*(byte *)(this + 4) & 2) == 0)) || (isAllowed = '\0', unk != 0)) { isAllowed = '\x01'; } if (bVar3) { bVar3 = false; } uVar1 = *(uint *)((int)candidateShapes + local_134); if (((((uint)this[(uVar1 >> 5) + 4] & 1 << ((byte)uVar1 & 0x1f)) != 0) && (isAllowed != '\0')) && (isPlaceable = can_place_room(this,(int *)local_13c,uVar1), isPlaceable != 0)) { LevelGenerator_Room::constructor(newRoom,*local_13c,local_13c[1],uVar1); local_8 = 2; local_108 = targetX; local_104 = targetY; local_10c = doorSlot; newRoom[0]._0_1_ = 1; local_f0 = *(int *)(sourceRoom + 0x40) + 1; if (*(int *)((int)neighbors + 4) == *(int *)((int)neighbors + 8)) { local_110 = doorDir; std::vector::_Emplace_reallocate (*(int *)((int)neighbors + 4),newRoom); } else { local_110 = doorDir; LevelGenerator_Room::LevelGenerator_Room (*(LevelGenerator_Room **)((int)neighbors + 4),newRoom); *(int *)((int)neighbors + 4) = *(int *)((int)neighbors + 4) + 0x48; } local_8 = local_8 & 0xffffff00; FID_conflict__Erase_tree_>_> (local_100,(fuzzer_allocator_> *)local_100, *(_Tree_node **)((int)local_100[0] + 4)); operator_delete(local_100[0],0x14); } local_13c = local_13c + 2; local_134 = local_134 + 4; } while (local_134 < 0x34); } LAB_009b11cf: doorSlot = doorSlot + 1; if (7 < (int)doorSlot) { ExceptionList = local_10; return; } } while( true ); } //@@ 009b1220 LevelGenerator::try_resize_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x009b13e7) */ /* DB: logs "[LevelGenerator] try_resize_room: invalid room" and, in its end-room branch, "try_resize_endroom: invalid room"; (room, uint shape, int) params; callers LevelGenerator::GetNewEndRoom, DetermineBossRoom prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall LevelGenerator::try_resize_room(LevelGenerator *this,void *room,int roomShape,uint *possibleDoors) { undefined4 uVar1; int iVar2; uint uVar3; uint *doorTargetPos; char isPlacementValid; int *offset; uint neighborCount; int *piVar4; LevelGenerator *generator; uint uVar5; uint doorSlot; int gridIdx; undefined1 auStack_114 [7]; char isFits; LevelGenerator local_10c; int local_108; int *local_104; void *roomCopy; int shapeCopy; LevelGenerator *generatorCopy; int **newShapeOffsets; int **local_f0 [2]; int candidatePositions [4]; int local_d8; int local_d4; int local_d0; int local_cc; int local_c8; int local_c4; int local_c0; int local_bc; int local_b8; int local_b4; int local_b0; int local_ac; int local_a8; int local_a4; int local_a0; int local_9c; int local_98; int local_94; int local_90; int local_8c; int local_88; int local_84; int local_80; int local_7c; int candidateShapes [2]; LevelGenerator local_70; LevelGenerator local_6c; undefined4 local_68; undefined4 local_64; LevelGenerator local_60; LevelGenerator local_5c; LevelGenerator local_58; LevelGenerator local_54; LevelGenerator local_50; LevelGenerator local_4c; undefined4 local_48; undefined4 local_44; uint candidateDoorSlots [4]; int local_30; uint local_2c; int local_28; uint local_24; int local_20; uint local_1c; int local_18; uint local_14; uint local_10; uint local_c; LevelGenerator cellRoomIdx; void *resizedRoom; local_c = __security_cookie ^ (uint)auStack_114; roomCopy = room; shapeCopy = roomShape; iVar2 = *(int *)((int)room + 0x20); candidateDoorSlots[0] = iVar2 + 2U & 0x80000003; if ((int)candidateDoorSlots[0] < 0) { candidateDoorSlots[0] = (candidateDoorSlots[0] - 1 | 0xfffffffc) + 1; } if ((iVar2 == 2) || (iVar2 == 3)) { candidatePositions[2] = 0; candidatePositions[3] = 0; } else { candidatePositions[3] = (&DAT_00c5d3e4)[iVar2 * 2]; candidatePositions[2] = (&DAT_00c5d3e0)[iVar2 * 2]; } if ((iVar2 == 0) || (iVar2 == 2)) { local_c0 = 0; local_108 = -1; } else { local_c0 = -1; local_108 = 0; } candidatePositions[0] = *(int *)((int)room + 0x28); candidatePositions[1] = *(int *)((int)room + 0x2c); candidatePositions[3] = candidatePositions[3] + candidatePositions[1]; candidatePositions[2] = candidatePositions[2] + candidatePositions[0]; local_d0 = local_c0 + candidatePositions[0]; local_cc = local_108 + candidatePositions[1]; local_c0 = local_c0 + candidatePositions[2]; local_bc = local_108 + candidatePositions[3]; candidateDoorSlots[2] = candidateDoorSlots[0] + 4; iVar2 = *(int *)((int)room + 0x20); if ((iVar2 == 0) || (iVar2 == 2)) { local_10c = (LevelGenerator)0x4; candidateShapes[1] = 6; } else { candidateShapes[1] = 4; local_10c = (LevelGenerator)0x6; } switch(iVar2) { case 0: local_60 = (LevelGenerator)0xc; local_5c = (LevelGenerator)0xa; local_58 = (LevelGenerator)0xb; local_50 = (LevelGenerator)0x9; break; case 1: local_60 = (LevelGenerator)0xc; local_104 = (int *)0x3; local_5c = (LevelGenerator)0xb; local_58 = (LevelGenerator)0xa; local_50 = (LevelGenerator)0x9; goto LAB_009b1491; case 2: local_60 = (LevelGenerator)0xb; local_5c = (LevelGenerator)0x9; local_58 = (LevelGenerator)0xa; local_50 = (LevelGenerator)0xc; break; case 3: local_60 = (LevelGenerator)0xa; local_104 = (int *)0x3; local_5c = (LevelGenerator)0x9; local_58 = (LevelGenerator)0xb; local_50 = (LevelGenerator)0xc; goto LAB_009b1491; default: local_58 = local_10c; local_50 = local_10c; local_60 = local_10c; local_5c = local_10c; if ((iVar2 != 0) && (iVar2 != 2)) { local_104 = (int *)0x3; goto LAB_009b1491; } } local_104 = (int *)0x2; LAB_009b1491: if ((iVar2 == 0) || (local_108 = 5, iVar2 == 2)) { local_108 = 7; } local_70 = local_10c; local_6c = local_10c; local_48 = local_104; candidateShapes[0] = 1; local_68 = 8; local_64 = 8; local_44 = local_108; generatorCopy = this; local_d8 = candidatePositions[0]; local_d4 = candidatePositions[1]; local_c8 = candidatePositions[2]; local_c4 = candidatePositions[3]; local_b8 = candidatePositions[2]; local_b4 = candidatePositions[3]; local_b0 = local_c0; local_ac = local_bc; local_a8 = candidatePositions[2]; local_a4 = candidatePositions[3]; local_a0 = local_c0; local_9c = local_bc; local_98 = candidatePositions[2]; local_94 = candidatePositions[3]; local_90 = local_c0; local_8c = local_bc; local_88 = candidatePositions[0]; local_84 = candidatePositions[1]; local_80 = candidatePositions[2]; local_7c = candidatePositions[3]; local_54 = local_58; local_4c = local_50; candidateDoorSlots[1] = candidateDoorSlots[0]; candidateDoorSlots[3] = candidateDoorSlots[0]; local_30 = candidateDoorSlots[2]; local_2c = candidateDoorSlots[0]; local_28 = candidateDoorSlots[2]; local_24 = candidateDoorSlots[0]; local_20 = candidateDoorSlots[2]; local_1c = candidateDoorSlots[0]; local_18 = candidateDoorSlots[2]; local_14 = candidateDoorSlots[0]; local_10 = candidateDoorSlots[0]; iVar2 = FUN_009afd70(); if (iVar2 < 0) { KAGE_LogMessage(0x10,(byte *)"[LevelGenerator] try_resize_room: invalid room\n"); } if ((*(uint *)((int)room + 0x28) < 0xd) && (*(uint *)((int)room + 0x2c) < 0xd)) { iVar2 = *(uint *)((int)room + 0x2c) * 0xd + *(uint *)((int)room + 0x28); } else { iVar2 = -1; } local_104 = candidatePositions; local_108 = 0; local_10c = generatorCopy[iVar2 + 5]; iVar2 = shapeCopy; generator = generatorCopy; do { piVar4 = local_104; if (candidateShapes[local_108] == iVar2) { if ((possibleDoors[candidateDoorSlots[local_108] >> 5] & 1 << ((byte)candidateDoorSlots[local_108] & 0x1f)) != 0) { isFits = '\x01'; newShapeOffsets = get_room_placement_offsets(shapeCopy); for (offset = *newShapeOffsets + 1; (offset[-1] != g_levelGenInvalidPos[0] || (*offset != g_levelGenInvalidPos[1])); offset = offset + 2) { uVar5 = *piVar4 + offset[-1]; uVar3 = *offset + piVar4[1]; if (((0xc < uVar5) || ((0xc < uVar3 || (iVar2 = uVar3 * 0xd + uVar5, iVar2 < 0)))) || ((-1 < (int)generator[iVar2 + 5] && (generator[iVar2 + 5] != local_10c)))) { isFits = '\0'; } } doorSlot = 0; uVar5 = 1; uVar3 = 0; do { doorTargetPos = (uint *)get_door_target_position ((int *)local_f0,local_104,candidateShapes[local_108],doorSlot,0); neighborCount = uVar3; if ((((*doorTargetPos < 0xd) && (doorTargetPos[1] < 0xd)) && (iVar2 = doorTargetPos[1] * 0xd + *doorTargetPos, -1 < iVar2)) && ((cellRoomIdx = generatorCopy[iVar2 + 5], -1 < (int)cellRoomIdx && (cellRoomIdx != local_10c)))) { neighborCount = uVar3 + 1; if (*(char *)((int)generatorCopy[0xd9] + 0x44 + (int)cellRoomIdx * 0x48) != '\0') { neighborCount = uVar3; } if ((possibleDoors[doorSlot >> 5] & uVar5) == 0) { isFits = '\0'; } } doorSlot = doorSlot + 1; uVar5 = uVar5 << 1 | (uint)((int)uVar5 < 0); uVar3 = neighborCount; } while (doorSlot < 8); isPlacementValid = '\0'; if (neighborCount < 2) { isPlacementValid = isFits; } if (isPlacementValid != '\0') { local_f0[0] = get_room_placement_offsets(*(int *)((int)roomCopy + 0x18)); generator = generatorCopy; iVar2 = 0; break; } generator = generatorCopy; } iVar2 = shapeCopy; } local_108 = local_108 + 1; local_104 = local_104 + 2; if (0xd < local_108) { return 0; } } while( true ); LAB_009b1700: resizedRoom = roomCopy; piVar4 = (int *)((int)*local_f0[0] + iVar2); if ((*piVar4 == g_levelGenInvalidPos[0]) && (piVar4[1] == g_levelGenInvalidPos[1])) { for (iVar2 = 0; (piVar4 = (int *)((int)*newShapeOffsets + iVar2), *piVar4 != g_levelGenInvalidPos[0] || (piVar4[1] != g_levelGenInvalidPos[1])); iVar2 = iVar2 + 8) { if (((uint)(*piVar4 + candidatePositions[local_108 * 2]) < 0xd) && ((uint)(candidatePositions[local_108 * 2 + 1] + piVar4[1]) < 0xd)) { gridIdx = (candidatePositions[local_108 * 2 + 1] + piVar4[1]) * 0xd + *piVar4 + candidatePositions[local_108 * 2]; } else { gridIdx = -1; } generator[gridIdx + 5] = local_10c; } iVar2 = candidatePositions[local_108 * 2 + 1]; *(int *)((int)roomCopy + 8) = candidatePositions[local_108 * 2]; *(int *)((int)roomCopy + 0xc) = iVar2; uVar1 = *(undefined4 *)(&DAT_00c5d37c + shapeCopy * 8); *(undefined4 *)((int)roomCopy + 0x10) = *(undefined4 *)(&DAT_00c5d378 + shapeCopy * 8); *(undefined4 *)((int)roomCopy + 0x14) = uVar1; *(int *)((int)roomCopy + 0x18) = shapeCopy; local_10c = *(LevelGenerator *)*(LevelGenerator *)((int)roomCopy + 0x30); if (local_10c != *(LevelGenerator *)((int)roomCopy + 0x30)) { do { update_room_neighbors (generator,(void *)((int)generator[0xd9] + *(int *)((int)local_10c + 0x10) * 0x48) ); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_10c); } while (local_10c != *(LevelGenerator *)((int)resizedRoom + 0x30)); } update_room_neighbors(generator,resizedRoom); return 1; } local_104 = (int *)(*(int *)((int)roomCopy + 8) + *piVar4); uVar3 = *(int *)((int)roomCopy + 0xc) + piVar4[1]; if ((local_104 < (int *)0xd) && (uVar3 < 0xd)) { gridIdx = uVar3 * 0xd + (int)local_104; if (gridIdx < 0) goto LAB_009b1744; } else { gridIdx = -1; LAB_009b1744: KAGE_LogMessage(0x10,(byte *)"[LevelGenerator] try_resize_endroom: invalid room\n"); } iVar2 = iVar2 + 8; generator[gridIdx + 5] = (LevelGenerator)0xffffffff; goto LAB_009b1700; } //@@ 009b1860 LevelGenerator::block_room_area /* DB: for each cell of the room's shape (get_room_placement_offsets) plus its 4 neighbours, sets blocked grid this+0x2b8; Level::place_special_rooms */ void LevelGenerator::block_room_area(int param_1) { int **ppiVar1; int *piVar2; int in_ECX; uint uVar3; int iVar4; int iVar5; uint uVar6; uint uVar7; int *piVar8; ppiVar1 = get_room_placement_offsets(*(int *)(param_1 + 0x18)); piVar2 = *ppiVar1; for (iVar5 = 0; (*(int *)(iVar5 + (int)piVar2) != g_levelGenInvalidPos[0] || (*(int *)(iVar5 + 4 + (int)piVar2) != g_levelGenInvalidPos[1])); iVar5 = iVar5 + 8) { uVar7 = 0; piVar8 = piVar2; do { uVar6 = *(int *)(iVar5 + (int)piVar2) + *(int *)((int)&DAT_00c35e9c + uVar7) + *(int *)(param_1 + 8); uVar3 = *(int *)(param_1 + 0xc) + *(int *)((int)&DAT_00c35ea0 + uVar7) + *(int *)(iVar5 + 4 + (int)piVar2); if (((uVar6 < 0xd) && (uVar3 < 0xd)) && (iVar4 = uVar3 * 0xd + uVar6, -1 < iVar4)) { *(undefined1 *)(iVar4 + 0x2b8 + in_ECX) = 1; piVar2 = *ppiVar1; piVar8 = piVar2; } uVar7 = uVar7 + 8; } while (uVar7 < 0x28); piVar2 = piVar8; } return; } //@@ 009b1910 FUN_009b1910 void FUN_009b1910(int *param_1) { int iVar1; int in_ECX; if ((((uint)(*param_1 + DAT_00c35e9c) < 0xd) && ((uint)(DAT_00c35ea0 + param_1[1]) < 0xd)) && (iVar1 = (DAT_00c35ea0 + param_1[1]) * 0xd + *param_1 + DAT_00c35e9c, -1 < iVar1)) { *(undefined1 *)(iVar1 + 0x2b8 + in_ECX) = 1; } return; } //@@ 009b1950 LevelGenerator::block_cells_near_rooms /* DB: ? marks every 13x13 cell of this+0x2b8 blocked when it or a 4-neighbour (offset table DAT_00c35e9c) is occupied in the other layout's grid param_1+0x14; Level::try_place_random_room */ void LevelGenerator::block_cells_near_rooms(int param_1) { uint uVar1; int in_ECX; uint uVar2; int iVar3; uint uVar4; uint uVar5; int iVar6; int local_10; uint local_c; local_10 = 0; local_c = 0; do { uVar5 = 0; do { if (local_c < 0x9d) { iVar6 = local_c + uVar5; } else { iVar6 = -1; } uVar1 = 0; do { if (*(char *)(iVar6 + 0x2b8 + in_ECX) != '\0') break; uVar4 = *(int *)((int)&DAT_00c35e9c + uVar1) + uVar5; uVar2 = *(int *)((int)&DAT_00c35ea0 + uVar1) + local_10; if ((((uVar4 < 0xd) && (uVar2 < 0xd)) && (iVar3 = uVar2 * 0xd + uVar4, -1 < iVar3)) && (-1 < *(int *)(param_1 + 0x14 + iVar3 * 4))) { *(undefined1 *)(iVar6 + 0x2b8 + in_ECX) = 1; } uVar1 = uVar1 + 8; } while (uVar1 < 0x28); uVar5 = uVar5 + 1; } while (uVar5 < 0xd); local_10 = local_10 + 1; local_c = local_c + 0xd; if (0xa8 < local_c) { return; } } while( true ); } //@@ 009b1a00 LevelGenerator::block_unused_door_cells /* DB: ECX = LevelGenerator (Level::generate_boss_room MOV ECX,EBX=param_1): for each of 8 doors not set in mask param_2, get_door_target_position of the room shape and marks that 13x13 cell in the blocked grid this+0x2b8 */ void LevelGenerator::block_unused_door_cells(int param_1,int param_2) { int iVar1; int in_ECX; uint uVar2; uint doorSlot; int local_10; int local_c; doorSlot = 0; uVar2 = 1; do { if (((*(uint *)(param_2 + (doorSlot >> 5) * 4) & uVar2) == 0) && ((get_door_target_position (&local_10,(int *)(param_1 + 8),*(int *)(param_1 + 0x18),doorSlot,1), local_10 != g_levelGenInvalidPos[0] || (local_c != g_levelGenInvalidPos[1])))) { if (((uint)(local_10 + DAT_00c35e9c) < 0xd) && (((uint)(DAT_00c35ea0 + local_c) < 0xd && (iVar1 = (DAT_00c35ea0 + local_c) * 0xd + local_10 + DAT_00c35e9c, -1 < iVar1)))) { *(undefined1 *)(iVar1 + 0x2b8 + in_ECX) = 1; } } doorSlot = doorSlot + 1; uVar2 = uVar2 << 1 | (uint)((int)uVar2 < 0); } while (doorSlot < 8); return; } //@@ 009b1a90 FUN_009b1a90 void FUN_009b1a90(undefined4 *param_1) { uint uVar1; int iVar2; void *pvVar3; int in_ECX; int iVar4; uint uVar5; uVar5 = *(uint *)(in_ECX + 0xc); if (((uVar5 & 3) == 0) && (*(uint *)(in_ECX + 8) <= *(int *)(in_ECX + 0x10) + 4U >> 2)) { std::deque<4byte>::_Growmap(in_ECX); uVar5 = *(uint *)(in_ECX + 0xc); } uVar1 = *(int *)(in_ECX + 8) * 4; uVar5 = uVar1 - 1 & uVar5; *(uint *)(in_ECX + 0xc) = uVar5; if (uVar5 == 0) { uVar5 = uVar1; } uVar5 = uVar5 - 1; iVar2 = (*(int *)(in_ECX + 8) - 1U & uVar5 >> 2) * 4; iVar4 = *(int *)(in_ECX + 4); if (*(int *)(iVar4 + iVar2) == 0) { pvVar3 = operator_new(0x10); *(void **)(iVar2 + *(int *)(in_ECX + 4)) = pvVar3; iVar4 = *(int *)(in_ECX + 4); } *(undefined4 *)(*(int *)(iVar2 + iVar4) + (uVar5 & 3) * 4) = *param_1; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) + 1; *(uint *)(in_ECX + 0xc) = uVar5; return; } //@@ 009b1b20 level_generator_rooms_shuffle /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (first,last) of 0x48-byte LevelGenerator_Room, ECX = RNG (xorshift with shifts ECX[1..3], "RNG Seed is zero!"): Fisher-Yates swap via temp copy; LevelGenerator::place_boss_room, generate_rooms */ void level_generator_rooms_shuffle(int param_1,int param_2) { code *pcVar1; uint uVar2; uint *in_ECX; uint uVar3; int local_64; int local_60; uint local_5c; undefined1 local_58 [48]; void *local_28 [7]; uint local_c; local_c = __security_cookie ^ (uint)&local_64; local_5c = (param_2 - param_1) / 0x48; local_60 = local_5c - 1; if (0 < local_60) { local_64 = local_60 * 0x48; do { uVar2 = local_5c; uVar3 = *in_ECX; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = *in_ECX; if (uVar3 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar3 = uVar3 >> ((byte)in_ECX[1] & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)in_ECX[2] & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)in_ECX[3] & 0x1f) ^ uVar3; *in_ECX = uVar3; if (uVar2 == 0) { uVar3 = 0; } else { uVar3 = uVar3 % uVar2; } FUN_009b1e40(param_1 + local_64); FUN_009b1f00(param_1 + uVar3 * 0x48); FUN_009b1f00(local_58); FID_conflict__Erase_tree_>_> (local_28,(fuzzer_allocator_> *)local_28, *(_Tree_node **)((int)local_28[0] + 4)); operator_delete(local_28[0],0x14); local_60 = local_60 + -1; local_64 = local_64 + -0x48; local_5c = local_5c - 1; } while (0 < local_60); } return; } //@@ 009b1c40 std::vector::_Emplace_reallocate /* DB: vector grow with 0x48-byte elements (max 0x38e38e3) copy-constructed by FUN_007507d0; LevelGenerator::place_room, get_neighbor_candidates (LevelGenerator rooms stride 0x48 at +0x364) */ LevelGenerator_Room * std::vector::_Emplace_reallocate(int param_1,void *param_2) { LevelGenerator_Room *this; uint uVar1; int iVar2; int iVar3; void *pvVar4; int *in_ECX; uint uVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e3f0; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - iVar2) / 0x48; if (iVar3 == 0x38e38e3) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = (in_ECX[2] - iVar2) / 0x48; if (0x38e38e3 - (uVar1 >> 1) < uVar1) { uVar5 = 0x38e38e3; } else { uVar1 = (uVar1 >> 1) + uVar1; uVar5 = iVar3 + 1U; if (iVar3 + 1U <= uVar1) { uVar5 = uVar1; } if (0x38e38e3 < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = _Allocate(uVar5 * 0x48); local_8 = 0; this = (LevelGenerator_Room *)((int)pvVar4 + ((param_1 - iVar2) / 0x48) * 0x48); LevelGenerator_Room::LevelGenerator_Room(this,param_2); if (param_1 == in_ECX[1]) { _Uninitialized_move(*in_ECX,in_ECX[1],pvVar4); } else { FUN_009b1dc0(*in_ECX,param_1,pvVar4); FUN_009b1dc0(param_1,in_ECX[1],this + 0x12); } _Change_array(pvVar4,iVar3 + 1,uVar5); ExceptionList = local_10; return this; } //@@ 009b1d88 Catch_All@009b1d88 void Catch_All_009b1d88(void) { int unaff_EBP; FUN_00752b50(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); deallocate(*(void **)(unaff_EBP + -0x28),*(uint *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009b1dc0 FUN_009b1dc0 int FUN_009b1dc0(int param_1,int param_2,int param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afe6bd; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 0x48) { FUN_009b1e40(param_1); param_3 = param_3 + 0x48; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_00752e40(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 009b1e40 FUN_009b1e40 void FUN_009b1e40(undefined1 *param_1) { undefined4 uVar1; void *pvVar2; undefined1 *in_ECX; *in_ECX = *param_1; *(undefined4 *)(in_ECX + 4) = *(undefined4 *)(param_1 + 4); *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(param_1 + 8); *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(param_1 + 0xc); *(undefined4 *)(in_ECX + 0x10) = *(undefined4 *)(param_1 + 0x10); *(undefined4 *)(in_ECX + 0x14) = *(undefined4 *)(param_1 + 0x14); *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)(param_1 + 0x18); *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(param_1 + 0x1c); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)(param_1 + 0x20); *(undefined4 *)(in_ECX + 0x24) = *(undefined4 *)(param_1 + 0x24); *(undefined4 *)(in_ECX + 0x28) = *(undefined4 *)(param_1 + 0x28); *(undefined4 *)(in_ECX + 0x2c) = *(undefined4 *)(param_1 + 0x2c); *(undefined4 *)(in_ECX + 0x30) = 0; *(undefined4 *)(in_ECX + 0x34) = 0; pvVar2 = operator_new(0x14); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *(void **)(in_ECX + 0x30) = pvVar2; *(undefined4 *)(in_ECX + 0x30) = *(undefined4 *)(param_1 + 0x30); *(void **)(param_1 + 0x30) = pvVar2; uVar1 = *(undefined4 *)(in_ECX + 0x34); *(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)(param_1 + 0x34); *(undefined4 *)(param_1 + 0x34) = uVar1; *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(param_1 + 0x38); in_ECX[0x3c] = param_1[0x3c]; *(undefined4 *)(in_ECX + 0x40) = *(undefined4 *)(param_1 + 0x40); in_ECX[0x44] = param_1[0x44]; return; } //@@ 009b1f00 FUN_009b1f00 void FUN_009b1f00(undefined1 *param_1) { int *this; undefined4 uVar1; int iVar2; undefined1 *in_ECX; *in_ECX = *param_1; *(undefined4 *)(in_ECX + 4) = *(undefined4 *)(param_1 + 4); uVar1 = *(undefined4 *)(param_1 + 0xc); *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(param_1 + 8); *(undefined4 *)(in_ECX + 0xc) = uVar1; uVar1 = *(undefined4 *)(param_1 + 0x14); *(undefined4 *)(in_ECX + 0x10) = *(undefined4 *)(param_1 + 0x10); *(undefined4 *)(in_ECX + 0x14) = uVar1; *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)(param_1 + 0x18); *(undefined4 *)(in_ECX + 0x1c) = *(undefined4 *)(param_1 + 0x1c); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)(param_1 + 0x20); *(undefined4 *)(in_ECX + 0x24) = *(undefined4 *)(param_1 + 0x24); uVar1 = *(undefined4 *)(param_1 + 0x2c); *(undefined4 *)(in_ECX + 0x28) = *(undefined4 *)(param_1 + 0x28); this = (int *)(in_ECX + 0x30); *(undefined4 *)(in_ECX + 0x2c) = uVar1; if (this != (int *)(param_1 + 0x30)) { iVar2 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)(in_ECX + 0x34) = 0; uVar1 = *(undefined4 *)(in_ECX + 0x30); *(undefined4 *)(in_ECX + 0x30) = *(undefined4 *)(param_1 + 0x30); *(undefined4 *)(param_1 + 0x30) = uVar1; uVar1 = *(undefined4 *)(in_ECX + 0x34); *(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)(param_1 + 0x34); *(undefined4 *)(param_1 + 0x34) = uVar1; } *(undefined4 *)(in_ECX + 0x38) = *(undefined4 *)(param_1 + 0x38); in_ECX[0x3c] = param_1[0x3c]; *(undefined4 *)(in_ECX + 0x40) = *(undefined4 *)(param_1 + 0x40); in_ECX[0x44] = param_1[0x44]; return; } //@@ 009b1fc0 Menu_Options::constructor /* DB: ? zeroes +0xc..+0x20, constructs ANM2 at +0x24 and +0x138, empty std::string at +0x260, clears +0x27c..+0x284; built by MenuManager::constructor and PauseScreen::constructor (both own an options menu); sits right before Menu_Options::Update 009b23a0 Menu_Options::Update void Menu_Options::constructor(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e420; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0xc) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x24)); local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x138)); *(undefined4 *)(in_ECX + 0x260) = 0; *(undefined4 *)(in_ECX + 0x270) = 0; *(undefined4 *)(in_ECX + 0x274) = 0xf; *(undefined1 *)(in_ECX + 0x260) = 0; *(undefined4 *)(in_ECX + 0x27c) = 0; *(undefined4 *)(in_ECX + 0x280) = 0; *(undefined4 *)(in_ECX + 0x284) = 0; ExceptionList = local_10; return; } //@@ 009b2090 Menu_Options::~Menu_Options /* DB: inverse of Menu_Options::constructor (009b1fc0: ANM2 at +0x24 and +0x138, std::string at +0x260, vector +0x27c): destroys them; called by PauseScreen::~PauseScreen and 00986f30 (MenuManager side) prototype: db/protos.zhl */ void __thiscall Menu_Options::~Menu_Options(Menu_Options *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; FID_conflict__Tidy(&this[1].OptionsSprite); std::string::_Tidy_deallocate((char *)&this[1].SelectedElement); local_8 = 0; ANM2::Reset(&this->GammaMenuSprite); AnimationState::~AnimationState(&(this->GammaMenuSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->GammaMenuSprite)._animState); std::string::_Tidy_deallocate((this->GammaMenuSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->GammaMenuSprite); local_8 = 1; ANM2::Reset(&this->OptionsSprite); AnimationState::~AnimationState(&(this->OptionsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->OptionsSprite)._animState); std::string::_Tidy_deallocate((this->OptionsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->OptionsSprite); ExceptionList = local_10; return; } //@@ 009b2150 Menu_Options::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? loads "gfx/ui/main menu/OptionsMenu.anm2" into ECX+0x24, stores param_2 at +0, Menu_Options::load_graphics, copies the position Vector param_1 into +0xc/+0x14, clears +0x258; PauseScreen::Init/Show embed the options menu prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Menu_Options::Init(Menu_Options *this,Vector *position,byte isPauseScreen) { char *ptr; uint size; undefined3 in_stack_00000009; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af18ad; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x21; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/main menu/OptionsMenu.anm2",0x22); local_14 = 0; ANM2::Load(&this->OptionsSprite,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { size = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; *(undefined4 *)this = _isPauseScreen; load_graphics(this); this->PositionX_duplicate = position->x; this->PositionY_duplicate = position->y; this->PositionX = position->x; this->PositionY = position->y; *(undefined1 *)(this + 1) = 0; ExceptionList = local_1c; return; } //@@ 009b22a0 Menu_Options::load_menu_anm2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ANM2::Load "gfx/ui/main menu/OptionsMenu.anm2" into this+0x24 (Menu_Options::constructor ANM2 slot); MenuManager::LoadGraphics and 009b7a20 PauseScreen::load_graphics void Menu_Options::load_menu_anm2(void) { int in_ECX; char *ptr; uint size; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af84fd; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x21; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/main menu/OptionsMenu.anm2",0x22); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x24),&local_3c,1); if (0xf < local_3c._capacity) { size = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < size) { ptr = *(char **)(local_3c._buf._0_4_ + -4); size = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_1c; return; } //@@ 009b23a0 Menu_Options::Update /* DB: called from MenuManager::Update (009897d0) with ECX=MenuManager+0xcecc (zhl _menuOptions 0xce8c+0x40) and +0xeb50 (second options instance); "Lua is resetting!", mods toggle -> reload xml/anm/texture caches, OptionsConfig::Save/SetMusicVolume prototype: db/protos.zhl */ void __thiscall Menu_Options::Update(Menu_Options *this) { Manager *pMVar1; char isTriggered; uint uVar2; int iVar3; int iVar4; Manager **ppMVar5; Manager **ppMVar6; uint onlineHudMode; Entity_Player *player; int unused; void *pvVar7; int *piVar8; int iVar9; undefined4 scrollStep; Manager *manager; float fVar10; float dirX; Manager *pMVar11; int *device; int *deviceRef; undefined4 actionId; Manager *local_34; Manager *local_30; float actionIds [3]; Manager *local_20; Manager *local_1c; float local_18; char isPauseMenu; void *local_10; undefined1 *puStack_c; float local_8; Game *game; MenuManager *menuManager; int menuMode; local_8 = -NAN; puStack_c = &LAB_00b0e44d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(actionIds + 10); ExceptionList = &local_10; if ((*(int *)this == 1) || (isPauseMenu = '\0', *(int *)this == 2)) { isPauseMenu = '\x01'; } if (*(char *)(this + 1) != '\0') { if (g_menuManager != (MenuManager *)0x0) { MenuManager::unload_graphics(); } if (g_manager != (Manager *)0x0) { pause_screen_unload_sprites(); } game = g_game; if (g_game != (Game *)0x0) { HUD::unload_graphics(&g_game->_hud); ANM2::Reset(&(game->_genericPrompt)._sprite); (game->_genericPrompt)._isOnlineVote = 0; ANM2::Reset(&game->_completionWidgetSprite); } manager = g_manager; pvVar7 = g_luaEngine; if (g_manager != (Manager *)0x0) { KAGE_LogMessage(1,(byte *)"Lua is resetting!\n"); LuaEngine::destroy(pvVar7); LuaEngine::Init(pvVar7,*(byte *)((int)pvVar7 + 0x1c)); FUN_008f5960(); ModManager::ListMods(&manager->_modManager); } TextureCache::Purge(); AnmCache::Clear(); if (g_manager != (Manager *)0x0) { Manager::validate_language(g_manager,unused); } if (g_menuManager != (MenuManager *)0x0) { MenuManager::LoadGraphics(); } if (g_manager != (Manager *)0x0) { FUN_00954710(); } if (g_game != (Game *)0x0) { Game::ReloadStagesXmlOnLuaReset(); } if (g_manager != (Manager *)0x0) { ModManager::LoadShaders(&g_manager->_modManager); Manager::unload_configs(); ModManager::LoadModContent(); ModManager::LoadModCurses(); } if (g_menuManager != (MenuManager *)0x0) { Menu_Character::Reset(&g_menuManager->_menuCharacter); } uVar2 = (int)(g_menuManager->_menuStateHistory)._end - (int)(g_menuManager->_menuStateHistory)._begin >> 2; if ((uVar2 < 2) || (*(int *)((int)(g_menuManager->_menuStateHistory)._begin + uVar2 * 4 + -8) != *(int *)&this[1].field_0x4)) { MenuManager::SetState(g_menuManager,*(int *)&this[1].field_0x4,0); *(undefined1 *)(this + 1) = 0; ExceptionList = local_10; return; } OptionsConfig::Save(&g_manager->_optionsConfig); menuManager = g_menuManager; pvVar7 = (g_menuManager->_menuStateHistory)._end; if (1 < (uint)((int)pvVar7 - (int)(g_menuManager->_menuStateHistory)._begin >> 2)) { pvVar7 = (void *)((int)pvVar7 + -4); (g_menuManager->_menuStateHistory)._end = pvVar7; } MenuManager::SetState(menuManager,*(int *)((int)pvVar7 + -4),0); *(undefined1 *)(this + 1) = 0; ExceptionList = local_10; return; } if (((g_manager->_framecount & 1) == 0) && ((this->OptionsSprite)._loaded != 0)) { AnimationState::Update(&(this->OptionsSprite)._animState); AnimationState::Update(&(this->OptionsSprite)._overlayAnimState); } manager = g_manager; if (isPauseMenu == '\0') { iVar3 = -1; } else { if (this->field_0x4 != '\0') { local_20 = *(Manager **)&this->field_0x1c; local_18 = (float)local_20 - this->PositionX; local_1c = (Manager *)(*(float *)&this->field_0x20 - this->PositionY); fVar10 = sqrtf(local_18 * local_18 + (float)local_1c * (float)local_1c); if (1.0 < fVar10) { pMVar11 = local_1c; dirX = local_18; if (0.0 < fVar10) { dirX = local_18 * (1.0 / fVar10); pMVar11 = (Manager *)((float)local_1c * (1.0 / fVar10)); } local_20 = (Manager *)0x3f800000; local_1c = (Manager *)(fVar10 * 0.1); ppMVar5 = &local_20; if (1.0 <= fVar10 * 0.1) { ppMVar5 = &local_1c; } pMVar1 = *ppMVar5; this->PositionX = dirX * (float)*ppMVar5 + this->PositionX; this->PositionY = (float)pMVar11 * (float)pMVar1 + this->PositionY; } else { this->PositionX = (float)local_20; this->PositionY = *(float *)&this->field_0x20; this->field_0x4 = 0; } } if (manager->_netplayManager == *(NetplayManager *)(manager + 1)) { player = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); iVar3 = player->_controllerIndex; } else { iVar3 = InputManager::FirstLocalDeviceID(&manager->_netplayManager); } } local_20 = (Manager *)0xe; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a209e0,&local_20,0,0,uVar2); manager = g_manager; game = g_game; if (isTriggered == '\0') { local_18 = 3.08286e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,&local_18,0,0); if (isTriggered == '\0') { actionIds[2] = 3.22299e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,actionIds + 2,0,0) ; if (isTriggered == '\0') { actionIds[1] = 2.8026e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar3,FUN_00a20940,actionIds + 1,0,0); if (isTriggered == '\0') { actionIds[0] = 2.94273e-44; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,actionIds,0,0) ; if (isTriggered == '\0') { local_34 = (Manager *)0xf; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar3,FUN_00a209e0,&local_34,0,0); manager = g_manager; if (isTriggered != '\0') { if (*(int *)&g_manager->_stringTable != *(int *)&this[1].field_0x20) { *(undefined1 *)(this + 1) = 1; scrollStep = FUN_0098aef0(); *(undefined4 *)&this[1].field_0x4 = scrollStep; goto switchD_009b2b40_caseD_a; } OptionsConfig::Save(&g_manager->_optionsConfig); if (isPauseMenu == '\0') { FUN_0098aec0(); } } } else { uVar2 = this->HoldRightCounter; if ((uVar2 == 0) || ((0x31 < uVar2 && ((uVar2 % 10 == 0 || ((*(int *)(*(int *)this[1].OptionsSprite._filename._buf + this->SelectedElement * 4 ) == 8 && ((this->HoldRightCounter & 1) == 0)))))))) { iVar3 = 1; goto LAB_009b2b22; } } } else { uVar2 = this->HoldLeftCounter; if ((uVar2 == 0) || ((0x31 < uVar2 && ((uVar2 % 10 == 0 || ((*(int *)(*(int *)this[1].OptionsSprite._filename._buf + this->SelectedElement * 4) == 8 && ((this->HoldLeftCounter & 1) == 0)))))))) { iVar3 = -1; goto LAB_009b2b22; } } } else { uVar2 = this->HoldUpDownCounter; if ((uVar2 == 0) || ((0x31 < uVar2 && (uVar2 % 10 == 0)))) { this->SelectedElement = this->SelectedElement + 1; iVar3 = *(int *)this[1].OptionsSprite._filename._buf; iVar9 = this->SelectedElement; if (*(int *)(this[1].OptionsSprite._filename._buf + 4) - iVar3 >> 2 <= iVar9) { this->SelectedElement = 0; iVar9 = 0; } menuManager = g_menuManager; if (isPauseMenu == '\0') { iVar4 = *(int *)(this[1].OptionsSprite._filename._buf + 4); menuMode = *(int *)this; if (menuMode == 3) { g_menuManager->_viewPositionSet[0x14].y = -1350.0; } else { g_menuManager->_viewPositionSet[10].y = -1080.0; } if (3 < iVar9) { iVar4 = (iVar4 - iVar3 >> 2) + -4; local_1c = (Manager *)0xf7a8; iVar3 = 0xf758; if (menuMode == 3) { iVar3 = 0xf7a8; } if (iVar4 < iVar9) { iVar9 = iVar4; } *(float *)((menuManager->_MenuShadowSprite)._filename._buf + iVar3 + -0x4c) = *(float *)((menuManager->_MenuShadowSprite)._filename._buf + iVar3 + -0x4c) - (float)(iVar9 + -3) * 20.0; } menuManager->_state = 1; } else { *(undefined4 *)&this->field_0x20 = 0; if (3 < iVar9) { iVar3 = (*(int *)(this[1].OptionsSprite._filename._buf + 4) - iVar3 >> 2) + -4; if (iVar3 < iVar9) { iVar9 = iVar3; } *(float *)&this->field_0x20 = 0.0 - (float)(iVar9 + -3) * 20.0; } this->field_0x4 = 1; } } } } else { uVar2 = this->HoldUpDownCounter; scrollStep = 10; if ((uVar2 == 0) || ((0x31 < uVar2 && (uVar2 % 10 == 0)))) { piVar8 = &this->SelectedElement; *piVar8 = *piVar8 + -1; iVar3 = this->SelectedElement; if (*piVar8 < 0) { iVar3 = (*(int *)(this[1].OptionsSprite._filename._buf + 4) - *(int *)this[1].OptionsSprite._filename._buf >> 2) + -1; this->SelectedElement = iVar3; } if (isPauseMenu == '\0') { if (*(int *)this == 3) { scrollStep = 0x14; } MenuManager::scroll_options_menu (scrollStep,iVar3, *(int *)(this[1].OptionsSprite._filename._buf + 4) - *(int *)this[1].OptionsSprite._filename._buf >> 2); } else { FUN_009b5250(iVar3); } } } goto LAB_009b300c; } iVar3 = 0; iVar9 = *(int *)(*(int *)this[1].OptionsSprite._filename._buf + this->SelectedElement * 4); if (iVar9 == 0) { if (*(int *)&g_manager->_stringTable == *(int *)&this[1].field_0x20) { MenuManager::push_menu(0xb,this->SelectedElement); iVar3 = 0; goto LAB_009b2b22; } *(undefined1 *)(this + 1) = 1; iVar3 = 0; *(undefined4 *)&this[1].field_0x4 = 0xb; } else { if (iVar9 == 1) { local_1c = g_manager; pvVar7 = (g_game->_playerManager)._playerList._end; piVar8 = (g_game->_playerManager)._playerList._begin; uVar2 = (g_game->_pauseScreen)._playerIdx; if ((int)pvVar7 - (int)piVar8 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar7 = (game->_playerManager)._playerList._end; piVar8 = (game->_playerManager)._playerList._begin; } if (uVar2 < (uint)((int)pvVar7 - (int)piVar8 >> 2)) { piVar8 = piVar8 + uVar2; } InputManager::get_device(&PTR_vftable_00c57b18,&device,*(int *)(*piVar8 + 0x1618)); local_8 = 0.0; if (device != (int *)0x0) { (**(code **)(*device + 0x54))(0xe); } manager = local_1c; if (local_1c->_netplayManager == *(NetplayManager *)(local_1c + 1)) { player = Game::GetPlayer(g_game,(game->_pauseScreen)._playerIdx); Entity_Player::SetControllerIndex(player,0xffffffff,1); } else { FUN_0090af30(0xffffffff); } manager->field_0x4abd0 = 1; local_8 = 1.4013e-45; if (((deviceRef != (int *)0x0) && (isTriggered = (**(code **)(*deviceRef + 0xc))(), isTriggered != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } local_8 = -NAN; iVar3 = 0; } LAB_009b2b22: manager = g_manager; } switch(*(undefined4 *)(*(int *)this[1].OptionsSprite._filename._buf + this->SelectedElement * 4)) { case 2: local_1c = (Manager *)0x0; local_30 = (Manager *)((float)iVar3 * 0.1 + (manager->_optionsConfig)._sfxVolume); local_34 = (Manager *)0x3f800000; ppMVar5 = &local_30; if ((float)local_30 <= 0.0) { ppMVar5 = &local_1c; } ppMVar6 = &local_34; if ((float)*ppMVar5 <= 1.0 && (float)*ppMVar5 != 1.0) { ppMVar6 = ppMVar5; } (manager->_optionsConfig)._sfxVolume = (float)*ppMVar6; SoundEffects::ClearVolumeModifier(&manager->_sfxManager); manager = g_manager; goto LAB_009b2c21; case 3: if ((manager->_musicManager)._isEnabled == 0) { fVar10 = 0.0; } else { fVar10 = (manager->_optionsConfig)._musicVolume; } local_30 = (Manager *)0x0; local_1c = (Manager *)((float)iVar3 * 0.1 + fVar10); ppMVar5 = &local_1c; if ((float)local_1c <= 0.0) { ppMVar5 = &local_30; } pMVar11 = *ppMVar5; if (1.0 <= (float)pMVar11) { pMVar11 = (Manager *)0x3f800000; } OptionsConfig::SetMusicVolume(&manager->_optionsConfig,(float)pMVar11); break; case 4: case 5: local_30 = (Manager *)0x0; local_1c = (Manager *)0x3f800000; local_34 = (Manager *)((float)iVar3 * 0.1 + (manager->_optionsConfig)._mapOpacity); ppMVar5 = &local_34; if ((float)local_34 <= 0.0) { ppMVar5 = &local_30; } ppMVar6 = &local_1c; if ((float)*ppMVar5 <= 1.0 && (float)*ppMVar5 != 1.0) { ppMVar6 = ppMVar5; } (manager->_optionsConfig)._mapOpacity = (float)*ppMVar6; goto LAB_009b2c21; case 6: OptionsConfig::set_fullscreen (&manager->_optionsConfig,(manager->_optionsConfig)._isFullscreen == 0); goto LAB_009b300c; case 7: (manager->_optionsConfig)._filterEnabled = (manager->_optionsConfig)._filterEnabled == 0; break; case 8: fVar10 = (float)iVar3 * 0.01 + (manager->_optionsConfig)._gamma; if (fVar10 <= 0.5) { fVar10 = 0.5; } if (1.5 <= fVar10) { fVar10 = 1.5; } (manager->_optionsConfig)._gamma = fVar10; break; case 9: uVar2 = (manager->_optionsConfig)._popupsMode + iVar3; if ((int)uVar2 < 0) { uVar2 = 2; } (manager->_optionsConfig)._popupsMode = -(uint)(uVar2 < 3) & uVar2; break; case 0xb: iVar4 = (manager->_optionsConfig)._cameraStyle + iVar3; iVar9 = iVar4 + 1; if (iVar3 != 0) { iVar9 = iVar4; } if (iVar9 < 3) { if (iVar9 < 1) { iVar9 = 2; } (manager->_optionsConfig)._cameraStyle = iVar9; } else { (manager->_optionsConfig)._cameraStyle = 1; } break; case 0xc: (manager->_optionsConfig)._historyHudMode = ((manager->_optionsConfig)._historyHudMode + iVar3 + 3) % 3; if (isPauseMenu == '\0') break; HUD::mark_all_slots_dirty(&g_game->_hud,1,0); goto LAB_009b300c; case 0xd: local_30 = (Manager *)0x0; local_1c = (Manager *)0x3f800000; local_34 = (Manager *)((float)iVar3 * 0.1 + (manager->_optionsConfig)._hudOffset); ppMVar5 = &local_34; if ((float)local_34 <= 0.0) { ppMVar5 = &local_30; } ppMVar6 = &local_1c; if ((float)*ppMVar5 <= 1.0 && (float)*ppMVar5 != 1.0) { ppMVar6 = ppMVar5; } (manager->_optionsConfig)._hudOffset = (float)*ppMVar6; LAB_009b2c21: local_1c = (Manager *)0xed; seed_fart_sound_override((int *)&local_1c); SoundEffects::Play(&manager->_sfxManager,(int)local_1c,1.0,0,0,1.0,0.0); LAB_009b300c: manager = g_manager; break; case 0xe: (manager->_optionsConfig)._enableFoundHUD = (manager->_optionsConfig)._enableFoundHUD == 0; break; case 0xf: (manager->_optionsConfig)._enableRumble = (manager->_optionsConfig)._enableRumble == 0; break; case 0x10: (manager->_optionsConfig)._enableChargeBars = (manager->_optionsConfig)._enableChargeBars == 0; break; case 0x11: (manager->_optionsConfig)._enableBulletVisibility = (manager->_optionsConfig)._enableBulletVisibility == 0; break; case 0x12: (manager->_optionsConfig)._enableAimLock = (manager->_optionsConfig)._enableAimLock == 0; break; case 0x13: iVar3 = (manager->_optionsConfig)._touchMode + iVar3; if (iVar3 < 1) { (manager->_optionsConfig)._touchMode = 1; } else { if (2 < iVar3) { iVar3 = 2; } (manager->_optionsConfig)._touchMode = iVar3; } break; case 0x14: uVar2 = (manager->_optionsConfig)._jacobEsauControls + iVar3; if ((int)uVar2 < 0) { uVar2 = 1; } (manager->_optionsConfig)._jacobEsauControls = -(uint)(uVar2 < 2) & uVar2; break; case 0x15: uVar2 = (manager->_optionsConfig)._onlineHud + iVar3; if ((int)uVar2 < 0) { uVar2 = 3; } onlineHudMode = 0; if (uVar2 < 4) { onlineHudMode = uVar2; } (manager->_optionsConfig)._onlineHud = onlineHudMode; break; case 0x16: (manager->_optionsConfig)._streamerMode = (manager->_optionsConfig)._streamerMode == 0; break; case 0x17: (manager->_optionsConfig)._onlineChatEnabled = (manager->_optionsConfig)._onlineChatEnabled == 0 ; break; case 0x18: FUN_00923fa0((manager->_optionsConfig)._onlinePlayerVolume + iVar3); break; case 0x19: FUN_00923fd0((manager->_optionsConfig)._onlinePlayerOpacity + iVar3); break; case 0x1a: iVar3 = (manager->_optionsConfig)._onlineColorSet + iVar3; if (iVar3 < 0) { (manager->_optionsConfig)._onlineColorSet = 3; } else { if (3 < iVar3) { iVar3 = 0; } (manager->_optionsConfig)._onlineColorSet = iVar3; } break; case 0x1b: FUN_00925bc0((manager->_optionsConfig)._onlineInputDelay + iVar3); break; case 0x1c: (manager->_optionsConfig)._itemInfoDisplayEnabled = (manager->_optionsConfig)._itemInfoDisplayEnabled == 0; } switchD_009b2b40_caseD_a: if ((*(int *)this == 1) || (*(int *)this == 2)) { if (manager->_netplayManager == *(NetplayManager *)(manager + 1)) { player = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); iVar3 = player->_controllerIndex; } else { iVar3 = InputManager::FirstLocalDeviceID(&manager->_netplayManager); } } else { iVar3 = -1; } local_34 = (Manager *)0x14; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,&local_34,0,0); if (isTriggered == '\0') { this->HoldLeftCounter = 0; } else { this->HoldLeftCounter = this->HoldLeftCounter + 1; } local_34 = (Manager *)0x15; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,&local_34,0,0); if (isTriggered == '\0') { this->HoldRightCounter = 0; } else { this->HoldRightCounter = this->HoldRightCounter + 1; } local_34 = (Manager *)0x16; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,&local_34,0,0); if (isTriggered == '\0') { actionId = 0x17; isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar3,FUN_00a20940,&actionId,0,0); if (isTriggered == '\0') { this->HoldUpDownCounter = 0; ExceptionList = local_10; return; } } this->HoldUpDownCounter = this->HoldUpDownCounter + 1; ExceptionList = local_10; return; } //@@ 009b31c0 Menu_Options::Render /* DB: option label layer names (Fullscreen, Gamma, HUDOffset, MapOpacity...), called from menu render dispatcher FUN_0098a040 beside Menu_DailyChallenge::Render prototype: db/protos.zhl */ void __thiscall Menu_Options::Render(Menu_Options *font) { KColor color; byte bVar1; char *animName; int iVar2; float *optionPositionsFrame; LayerState *pLVar3; void *pvVar4; void *renderer; undefined4 *shaderEntry; byte *str; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 uVar5; AnimationState *lastAnimState; int unused; ANM2 *sprite; bool isOptionOff; float10 roundedSpacing; float fVar6; double dVar7; undefined1 screenQuad [112]; undefined1 glyphRun [16]; float touchModeCounterX; float touchModeCounterY; float gammaCounterX; float gammaCounterY; float sfxVolume; float optionSpacing; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; KColor local_70; Vector optionPos; float musicVolume; float optionsOriginY; float local_4c; float local_48; float optionsOriginX; float menuY; float menuX; int local_38; Vector local_34; float local_2c; uint local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Font *font; Manager *manager; uint shaderStackSize; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0e488; local_1c = ExceptionList; ExceptionList = &local_1c; iVar2 = *(int *)font; if ((iVar2 == 1) || (iVar2 == 2)) { menuX = (g_screenWidth - 480.0) * 0.5 + font->PositionX; menuY = (g_screenHeight - 270.0) * 0.5 + font->PositionY; local_34.x = menuX; local_34.y = menuY; pLVar3 = ANM2::GetLayer(&font->OptionsSprite,(byte *)0x0); local_70._red = 0.0; local_70._green = 0.0; local_70._blue = 0.0; local_70._alpha = 0.60784316; local_70._unk = 0; pLVar3->_visible = 0; pvVar4 = render_quad_set_uniform_color (screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_70); render_color_shader_pass(pvVar4); iVar2 = *(int *)font; } else { menuX = (g_menuManager->_ViewPosition).x + font->PositionX; menuY = (g_menuManager->_ViewPosition).y + font->PositionY; local_34.x = menuX; local_34.y = menuY; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } sprite = &font->OptionsSprite; animName = "Background"; if (iVar2 == 3) { animName = "BackgroundMultiplayer"; } bVar1 = ANM2::SetAnimation(sprite,(byte *)animName,1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if ((font->OptionsSprite)._loaded != 0) { if ((font->OptionsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero); menuY = local_34.y; menuX = local_34.x; } else { AnimationState::Render (&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero); menuY = local_34.y; menuX = local_34.x; } } local_34.y = menuY + 16.0; iVar2 = *(int *)(font[1].OptionsSprite._filename._buf + 4) - *(int *)font[1].OptionsSprite._filename._buf; local_34.x = menuX + 240.0; local_4c = (float)((double)(iVar2 >> 2) + __uint_to_double_fixup[-(iVar2 >> 0x1f)]); local_2c = ((local_4c * 20.0 - 52.0) - 52.0) / 52.0; dVar7 = ceil((double)local_2c); local_2c = (float)dVar7; local_38 = __ftoui3(); local_2c = ((float)((double)local_38 + __uint_to_double_fixup[-(local_38 >> 0x1f)]) * 52.0 + 52.0 + 52.0) / local_4c; roundedSpacing = (float10)roundf(local_2c); optionSpacing = (float)roundedSpacing; bVar1 = ANM2::SetAnimation(sprite,(byte *)"PaperTop",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if ((font->OptionsSprite)._loaded != 0) { if ((font->OptionsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._overlayAnimState; } else { AnimationState::Render (&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._animState; } AnimationState::Render(lastAnimState,&local_34,&g_vectorZero,&g_vectorZero); } local_34.y = local_34.y + 100.0; for (; local_38 != 0; local_38 = local_38 + -1) { bVar1 = ANM2::SetAnimation(sprite,(byte *)"PaperMiddle",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if ((font->OptionsSprite)._loaded != 0) { if ((font->OptionsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._overlayAnimState; } else { AnimationState::Render (&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._animState; } AnimationState::Render(lastAnimState,&local_34,&g_vectorZero,&g_vectorZero); } local_34.y = local_34.y + 52.0; } bVar1 = ANM2::SetAnimation(sprite,(byte *)"PaperBottom",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if ((font->OptionsSprite)._loaded != 0) { if ((font->OptionsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._overlayAnimState; } else { AnimationState::Render (&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._animState; } AnimationState::Render(lastAnimState,&local_34,&g_vectorZero,&g_vectorZero); } optionsOriginY = 0.0; optionsOriginX = 0.0; optionPositionsFrame = (float *)ANM2::GetNullFrame(sprite,"Background","OptionPositions",0); if (optionPositionsFrame != (float *)0x0) { optionsOriginX = *optionPositionsFrame; optionsOriginY = optionPositionsFrame[1]; } if ((g_manager->_musicManager)._isEnabled == 0) { fVar6 = 0.0; } else { fVar6 = (g_manager->_optionsConfig)._musicVolume; } local_2c = fVar6 * 10.0 + 0.5; dVar7 = floor((double)local_2c); musicVolume = (float)dVar7; local_2c = (g_manager->_optionsConfig)._sfxVolume * 10.0 + 0.5; dVar7 = floor((double)local_2c); sfxVolume = (float)dVar7; local_2c = (g_manager->_optionsConfig)._mapOpacity * 10.0 + 0.5; dVar7 = floor((double)local_2c); local_4c = (float)dVar7; local_2c = (g_manager->_optionsConfig)._hudOffset * 10.0 + 0.5; dVar7 = floor((double)local_2c); local_2c = (float)dVar7; local_48 = (g_manager->_optionsConfig)._gamma * 100.0 + 0.5; dVar7 = floor((double)local_48); local_34.y = (float)dVar7; iVar2 = *(int *)font[1].OptionsSprite._filename._buf; local_38 = 0; if (0 < *(int *)(font[1].OptionsSprite._filename._buf + 4) - iVar2 >> 2) { optionsOriginX = optionsOriginX + 0.0; do { local_48 = (float)local_38 * optionSpacing + optionsOriginY; switch(*(undefined4 *)(iVar2 + local_38 * 4)) { case 0: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Controls",1); if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { fVar6 = 0.0; LAB_009b4475: AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,fVar6); if ((font->OptionsSprite)._animState._animData != (void *)0x0) { (font->OptionsSprite)._animState._isPlaying = 0; } } break; case 1: bVar1 = ANM2::SetAnimation(sprite,(byte *)"ChangeController",1); if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { fVar6 = 0.0; goto LAB_009b4475; } break; case 2: bVar1 = ANM2::SetAnimation(sprite,&DAT_00b7e490,1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_28 = *(uint *)((int)pvVar4 + 0x44); if ((pvVar4 == (void *)0x0) || (((int)local_28 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_28)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + local_28 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,local_28,(float)(int)sfxVolume); } break; case 3: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Music",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_28 = *(uint *)((int)pvVar4 + 0x44); if ((pvVar4 == (void *)0x0) || (((int)local_28 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_28)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + local_28 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,local_28,(float)(int)musicVolume); } break; case 4: animName = "MapOpacity"; goto LAB_009b39a1; case 5: animName = "PenOpacity"; LAB_009b39a1: bVar1 = ANM2::SetAnimation(sprite,(byte *)animName,1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_28 = *(uint *)((int)pvVar4 + 0x44); if ((pvVar4 == (void *)0x0) || (((int)local_28 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_28)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + local_28 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,local_28,(float)(int)local_4c); } break; case 6: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Fullscreen",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_24 = (float)(uint)((g_manager->_optionsConfig)._isFullscreen == 0); if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_28 = *(uint *)((int)pvVar4 + 0x48); if ((pvVar4 == (void *)0x0) || (((int)local_28 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_28)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + local_28 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,local_28,(float)(int)local_24); } break; case 7: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Filter",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._filterEnabled == 0; goto LAB_009b3b5d; case 8: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Gamma",1); uVar5 = extraout_ECX; if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0); uVar5 = extraout_ECX_00; if ((font->OptionsSprite)._animState._animData != (void *)0x0) { (font->OptionsSprite)._animState._isPlaying = 0; } } gammaCounterX = optionsOriginX + menuX + 50.0; gammaCounterY = local_48 + menuY + 0.0; render_counter((int)local_34.y,uVar5,gammaCounterX,gammaCounterY); break; case 9: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Popups",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } iVar2 = (g_manager->_optionsConfig)._popupsMode; if (iVar2 == 1) { if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x48); if ((pvVar4 == (void *)0x0) || (((int)local_24 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_24)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + (int)local_24 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,(int)local_24,0.0); } } else { pvVar4 = (font->OptionsSprite)._animState._animData; if (iVar2 == 2) { if ((pvVar4 != (void *)0x0) && ((4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x48); if ((pvVar4 == (void *)0x0) || (((int)local_24 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_24)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *) ((int)(font->OptionsSprite)._animState._layerFrames + (int)local_24 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,(int)local_24,1.0); } } else if ((pvVar4 != (void *)0x0) && ((4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x48); if ((pvVar4 == (void *)0x0) || (((int)local_24 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_24)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + (int)local_24 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,(int)local_24,2.0); } } break; case 0xb: bVar1 = ANM2::SetAnimation(sprite,(byte *)"ActiveCam",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (uint)((g_manager->_optionsConfig)._cameraStyle != 1); goto LAB_009b3b63; case 0xc: bVar1 = ANM2::SetAnimation(sprite,(byte *)"ExtraHUD",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._historyHudMode; goto LAB_009b3b63; case 0xd: bVar1 = ANM2::SetAnimation(sprite,(byte *)"HUDOffset",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (uint)((float)(int)local_2c != 10.0); if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x48); if ((pvVar4 == (void *)0x0) || (((int)local_24 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_24)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + (int)local_24 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,(int)local_24,(float)(int)local_28); } if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x44); if ((pvVar4 == (void *)0x0) || (((int)local_24 < 0 || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_24)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + (int)local_24 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,(int)local_24,(float)(int)local_2c); } break; case 0xe: bVar1 = ANM2::SetAnimation(sprite,(byte *)"FoundHUD",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableFoundHUD == 0; goto LAB_009b3b5d; case 0xf: bVar1 = ANM2::SetAnimation(sprite,(byte *)"Rumble",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableRumble == 0; goto LAB_009b3b5d; case 0x10: bVar1 = ANM2::SetAnimation(sprite,(byte *)"ChargeBars",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableChargeBars == 0; goto LAB_009b3b5d; case 0x11: bVar1 = ANM2::SetAnimation(sprite,(byte *)"BulletVisibility",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableBulletVisibility == 0; goto LAB_009b3b5d; case 0x12: bVar1 = ANM2::SetAnimation(sprite,(byte *)"AimLock",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableAimLock == 0; goto LAB_009b3b5d; case 0x13: bVar1 = ANM2::SetAnimation(sprite,(byte *)"TouchMode",1); uVar5 = extraout_ECX_01; if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0); uVar5 = extraout_ECX_02; if ((font->OptionsSprite)._animState._animData != (void *)0x0) { (font->OptionsSprite)._animState._isPlaying = 0; } } touchModeCounterY = local_48 + menuY + 0.0; touchModeCounterX = optionsOriginX + menuX + 70.0; render_counter((g_manager->_optionsConfig)._touchMode,uVar5,touchModeCounterX, touchModeCounterY); break; case 0x14: bVar1 = ANM2::SetAnimation(sprite,(byte *)"JacobEsauControl",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (uint)((g_manager->_optionsConfig)._jacobEsauControls != 1); goto LAB_009b3b63; case 0x15: bVar1 = ANM2::SetAnimation(sprite,(byte *)"MultiplayerHUD",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._onlineHud; goto LAB_009b3b63; case 0x16: bVar1 = ANM2::SetAnimation(sprite,(byte *)"StreamerMode",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._streamerMode == 0; goto LAB_009b3b5d; case 0x17: bVar1 = ANM2::SetAnimation(sprite,(byte *)"EnableChat",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._onlineChatEnabled == 0; goto LAB_009b3b5d; case 0x18: bVar1 = ANM2::SetAnimation(sprite,(byte *)"PlayerSound",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._onlinePlayerVolume; goto LAB_009b434b; case 0x19: bVar1 = ANM2::SetAnimation(sprite,(byte *)"PlayerOpacity",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._onlinePlayerOpacity; LAB_009b434b: if (((font->OptionsSprite)._animState._animData == (void *)0x0) || ((*(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) < 4 && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) < 4)))) break; pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x44); goto LAB_009b3ba4; case 0x1a: bVar1 = ANM2::SetAnimation(sprite,(byte *)"PlayerColors",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_24 = (float)(g_manager->_optionsConfig)._onlineColorSet; pLVar3 = ANM2::GetLayer(sprite,(byte *)"OnOff2"); if (pLVar3 == (LayerState *)0x0) { KAGE_LogMessage(4,(byte *)"[warn] no layer named %s\n"); } else { ANM2::SetLayerFrame(sprite,*(int *)pLVar3->_layerData,(int)local_24); } break; case 0x1b: local_24 = (float)(g_manager->_optionsConfig)._onlineInputDelay; bVar1 = ANM2::SetAnimation(sprite,(byte *)"InputDelay",1); if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { fVar6 = (float)(int)local_24; goto LAB_009b4475; } break; case 0x1c: bVar1 = ANM2::SetAnimation(sprite,(byte *)"ItemDescriptions",1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._itemInfoDisplayEnabled == 0; LAB_009b3b5d: local_28 = (uint)isOptionOff; LAB_009b3b63: if (((font->OptionsSprite)._animState._animData != (void *)0x0) && ((4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)((int)(font->OptionsSprite)._animState._animation + 0x80))))) { pvVar4 = (font->OptionsSprite)._animState._animData; local_24 = *(float *)((int)pvVar4 + 0x48); LAB_009b3ba4: if (((pvVar4 == (void *)0x0) || ((int)local_24 < 0)) || (*(int *)((int)pvVar4 + 0x1c) <= (int)local_24)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(font->OptionsSprite)._animState._layerFrames + (int)local_24 * 4) = 0; AnimationState::AdvanceLayerPosition (&(font->OptionsSprite)._animState,(int)local_24,(float)(int)local_28); } } if (local_38 == font->SelectedElement) { pLVar3 = ANM2::GetLayer(sprite,&DAT_00000005); pLVar3->_visible = 1; } else { pLVar3 = ANM2::GetLayer(sprite,&DAT_00000005); pLVar3->_visible = 0; } optionPos.x = optionsOriginX + menuX; optionPos.y = local_48 + menuY; if ((font->OptionsSprite)._loaded != 0) { if ((font->OptionsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(font->OptionsSprite)._animState,&optionPos,&g_vectorZero,&g_vectorZero); lastAnimState = &(font->OptionsSprite)._overlayAnimState; } else { AnimationState::Render (&(font->OptionsSprite)._overlayAnimState,&optionPos,&g_vectorZero,&g_vectorZero ); lastAnimState = &(font->OptionsSprite)._animState; } AnimationState::Render(lastAnimState,&optionPos,&g_vectorZero,&g_vectorZero); } iVar2 = *(int *)font[1].OptionsSprite._filename._buf; local_38 = local_38 + 1; } while (local_38 < *(int *)(font[1].OptionsSprite._filename._buf + 4) - iVar2 >> 2); } if (*(char *)(font + 1) != '\0') { fVar6 = 0.0; local_70._red = 0.0; local_70._green = 0.0; local_70._blue = 0.0; local_70._alpha = 0.5; local_70._unk = 0; pvVar4 = render_quad_set_uniform_color (screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_70); if ((*(float *)((int)pvVar4 + 0x40) + *(float *)((int)pvVar4 + 0x2c) + *(float *)((int)pvVar4 + 0x54) + *(float *)((int)pvVar4 + 0x68)) * 0.25 != fVar6) { shader_push((byte *)"KAGE_ColorShader"); local_70._red = 0.0; local_80 = 0; local_74 = 0; local_7c = 0; local_70._blue = 1.0; local_78 = 0x3f800000; local_70._alpha = 1.0; local_70._green = 1.0; local_70._unk = local_70._unk & 0xffffff00; renderer = kage_graphics_flush((void *)0x0); render_quad_draw(renderer,&local_80,pvVar4,1,unused); if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } shaderStackSize = g_shaderStackSize; shaderEntry = (undefined4 *)FUN_00684fc0(); g_shaderStackSize = shaderStackSize - 1; g_currentShader = (void *)*shaderEntry; if (g_shaderStackSize == 0) { DAT_00c379d8 = 0; } } manager = g_manager; font = &g_manager->_font2_TeamMeatEx12; str = string_table_translate(&g_manager->_stringTable,(byte *)"#LOADING"); iVar2 = Font::get_string_width_n(font,str,-1); local_78 = 0; local_74 = 0xffff; local_70._red = 0.0; local_70._green = 1.0; local_70._blue = -NAN; local_70._alpha = 0.0; local_70._unk = 0; local_14 = 0; local_34.y = (g_screenHeight - (float)(ushort)(manager->_font2_TeamMeatEx12)._lineHeight) * 0.5; local_24 = (g_screenWidth - (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])) * 0.5; pvVar4 = Font::measure_string(font,glyphRun,str,&local_78,&g_vectorOne); local_14 = CONCAT31(local_14._1_3_,1); color._blue = 1.0; color._red = 1.0; color._green = 1.0; color._alpha = 1.0; color._unk = 0; Font::render_glyph_quads(font,pvVar4,local_24,local_34.y,1.0,1.0,color,&local_78); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); } ExceptionList = local_1c; return; } //@@ 009b4810 Menu_Options::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? hides "Sketch" layers, swaps OptionsMenu.png for gfx/ui/main menu/OptionsMenuDark.png (ReplaceSpritesheet), loads GammaMenu.anm2 "Counter"; callers 009b2150 Menu_Options::Init init), 009b52a0 Menu_Options::reload PauseScreen::Update) prototype: db/protos.zhl */ void __thiscall Menu_Options::load_graphics(Menu_Options *this) { byte bVar1; PersistentGameData *persistentGameData; LayerState *layer; byte *nameText; char *pcVar2; int layerCount; uint uVar3; std_string *haystack; byte *pbVar4; bool isLess; undefined4 optionId; std_string path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *layerData; undefined4 *optionIdsEnd; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00af19c5; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; optionIdsEnd = *(undefined4 **)this[1].OptionsSprite._filename._buf; *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4) = optionIdsEnd; if ((*(int *)this == 0) || (*(int *)this == 3)) { optionId = 0; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) goto LAB_009b489a; *optionIdsEnd = 0; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } else { optionId = 1; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { LAB_009b489a: std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 1; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } } if (*(int *)this != 3) { optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 2; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 2; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 3; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 3; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 4; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 4; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 6; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 6; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 7; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 7; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 8; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 8; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0xf; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0xf; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } persistentGameData = (PersistentGameData *)(g_manager[1]._persistentGameData._achievements + 0xc); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { persistentGameData = &g_manager->_persistentGameData; } if ((persistentGameData->_achievements[0x281] != 0) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) { optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x1c; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x1c; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } } } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 9; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 9; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0xb; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0xb; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0xc; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0xc; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } if (*(int *)this != 3) { optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0xd; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0xd; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0xe; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0xe; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } if (*(int *)this != 3) { optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x10; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x10; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x11; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x11; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x14; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x14; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } } if (*(int *)this == 1) { LAB_009b4d28: layerCount = (this->OptionsSprite)._layerCount; pbVar4 = (byte *)0x0; if (0 < layerCount) { do { layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4); layerData = layer->_layerData; if (layerData == (void *)0x0) { nameText = &s_empty; } else { nameText = (byte *)((int)layerData + 8); if (0xf < *(uint *)((int)layerData + 0x1c)) { nameText = *(byte **)nameText; } } pcVar2 = strstr((char *)nameText,"Sketch"); if (pcVar2 != (char *)0x0) { layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4); layer->_visible = 0; } layerCount = (this->OptionsSprite)._layerCount; pbVar4 = pbVar4 + 1; } while ((int)pbVar4 < layerCount); } pbVar4 = (byte *)0x0; if (0 < layerCount) { do { layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4); haystack = &layer->_spriteSheetPath; if (0xf < (layer->_spriteSheetPath)._capacity) { haystack = *(std_string **)haystack->_buf; } uVar3 = std::string::find((byte *)haystack,(layer->_spriteSheetPath)._size,0, (byte *)"OptionsMenu.png",0xf); if (uVar3 != 0xffffffff) { path._buf._0_4_ = std::_Allocate(0x30); path._size = 0x24; path._capacity = 0x2f; builtin_strncpy((char *)path._buf._0_4_,"gfx/ui/main menu/OptionsMenuDark.png",0x25); local_14 = 0; Sprite::ReplaceSpritesheet((Sprite *)&this->OptionsSprite,(int)pbVar4,&path); local_14 = 0xffffffff; if (0xf < path._capacity) { uVar3 = path._capacity + 1; pcVar2 = (char *)path._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(path._buf._0_4_ + -4); uVar3 = path._capacity + 0x24; if ((char *)0x1f < (char *)(path._buf._0_4_ + (-4 - (int)pcVar2))) goto LAB_009b4f13; } operator_delete(pcVar2,uVar3); } } pbVar4 = pbVar4 + 1; } while ((int)pbVar4 < (this->OptionsSprite)._layerCount); } ANM2::LoadGraphics(&this->OptionsSprite,(byte)&this->OptionsSprite); } else { optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x15; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x15; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x16; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x16; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x17; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x17; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x18; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x18; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x19; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x19; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x1a; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x1a; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } optionIdsEnd = *(undefined4 **)(this[1].OptionsSprite._filename._buf + 4); optionId = 0x1b; if (optionIdsEnd == *(undefined4 **)(this[1].OptionsSprite._filename._buf + 8)) { std::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId); } else { *optionIdsEnd = 0x1b; pcVar2 = this[1].OptionsSprite._filename._buf + 4; *(int *)pcVar2 = *(int *)pcVar2 + 4; } if ((*(int *)this == 1) || (*(int *)this == 2)) goto LAB_009b4d28; } path._size = 0; path._capacity = 0xf; path._buf[0] = '\0'; path._buf[1] = '\0'; path._buf[2] = '\0'; path._buf[3] = '\0'; path._buf._0_4_ = std::_Allocate(0x20); path._size = 0x1f; path._capacity = 0x1f; builtin_strncpy((char *)path._buf._0_4_,"gfx/ui/main menu/GammaMenu.anm2",0x20); local_14 = 1; ANM2::Load(&this->GammaMenuSprite,&path,1); local_14 = 0xffffffff; if (0xf < path._capacity) { uVar3 = path._capacity + 1; pcVar2 = (char *)path._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(path._buf._0_4_ + -4); uVar3 = path._capacity + 0x24; if ((char *)0x1f < (char *)(path._buf._0_4_ + (-4 - (int)pcVar2))) { LAB_009b4f13: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } pbVar4 = (this->GammaMenuSprite)._animState._animData; if (pbVar4 != (byte *)0x0) { nameText = pbVar4; if (0xf < *(uint *)(pbVar4 + 0x14)) { nameText = *(byte **)pbVar4; } pcVar2 = "Counter"; do { bVar1 = *nameText; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_009b4f60: uVar3 = -(uint)isLess | 1; goto LAB_009b4f65; } if (bVar1 == 0) break; bVar1 = nameText[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_009b4f60; nameText = nameText + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009b4f65: if ((uVar3 == 0) && ((pbVar4[0x34] == 0 || ((this->GammaMenuSprite)._animState._isPlaying != 0)))) goto LAB_009b4fa2; } bVar1 = ANM2::SetAnimation(&this->GammaMenuSprite,(byte *)"Counter",1); if (bVar1 != 0) { AnimationState::Rewind(&(this->GammaMenuSprite)._animState); (this->GammaMenuSprite)._animState._isPlaying = 1; } LAB_009b4fa2: this->SelectedElement = 0; *(undefined4 *)&this->field_0x20 = 0; this->field_0x4 = 0; this->PositionX = this->PositionX_duplicate; this->PositionY = this->PositionY_duplicate; *(float *)&this->field_0x1c = g_vectorZero.x; *(float *)&this->field_0x20 = g_vectorZero.y; this->HoldLeftCounter = 0; this->HoldRightCounter = 0; this->HoldUpDownCounter = 0; ExceptionList = local_1c; return; } //@@ 009b5020 Menu_Options::render_counter /* WARNING: Removing unreachable block (ram,0x009b5114) */ /* DB: Menu_Options::Render: draws an integer digit by digit (11 px per digit, 6 px gap) with the counter ANM2 at +0x138 (+0x168 anim state, SetFrameFloat per digit), sign handling */ void Menu_Options::render_counter(uint param_1,undefined4 param_2,float param_3,float param_4) { int in_ECX; AnimationState *pAVar1; AnimationState *this; uint uVar2; int local_8; local_8 = 0; this = (AnimationState *)(in_ECX + 0x168); uVar2 = -param_1; if (-1 < (int)param_1) { uVar2 = param_1; } do { if (*(int *)(in_ECX + 0x16c) != 0) { AnimationState::SetFrameFloat(this,(float)((int)uVar2 % 10)); } if (*(char *)(in_ECX + 0x241) != '\0') { if (*(char *)(in_ECX + 0x1a8) == '\0') { AnimationState::Render(this,(Vector *)¶m_3,&g_vectorZero,&g_vectorZero); pAVar1 = (AnimationState *)(in_ECX + 0x188); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x188),(Vector *)¶m_3,&g_vectorZero,&g_vectorZero ); pAVar1 = this; } AnimationState::Render(pAVar1,(Vector *)¶m_3,&g_vectorZero,&g_vectorZero); } param_3 = param_3 - 11.0; uVar2 = (uint)(((int)uVar2 / 10) * 10) / 10; param_4 = param_4 + 0.0; local_8 = local_8 + -1; if (local_8 == 0) { if (*(int *)(in_ECX + 0x16c) != 0) { AnimationState::SetFrameFloat(this,10.0); } if (*(char *)(in_ECX + 0x241) != '\0') { if (*(char *)(in_ECX + 0x1a8) == '\0') { AnimationState::Render(this,(Vector *)¶m_3,&g_vectorZero,&g_vectorZero); pAVar1 = (AnimationState *)(in_ECX + 0x188); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x188),(Vector *)¶m_3,&g_vectorZero, &g_vectorZero); pAVar1 = this; } AnimationState::Render(pAVar1,(Vector *)¶m_3,&g_vectorZero,&g_vectorZero); } param_3 = param_3 - 6.0; param_4 = param_4 + 0.0; } } while ((uVar2 != 0) || (-1 < local_8)); if ((int)param_1 < 0) { if (*(int *)(in_ECX + 0x16c) != 0) { AnimationState::SetFrameFloat(this,11.0); } if (*(char *)(in_ECX + 0x241) != '\0') { if (*(char *)(in_ECX + 0x1a8) == '\0') { AnimationState::Render(this,(Vector *)¶m_3,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x188); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x188),(Vector *)¶m_3,&g_vectorZero,&g_vectorZero ); } AnimationState::Render(this,(Vector *)¶m_3,&g_vectorZero,&g_vectorZero); } } return; } //@@ 009b5250 FUN_009b5250 void FUN_009b5250(int param_1) { int iVar1; int in_ECX; *(undefined4 *)(in_ECX + 0x20) = 0; if (3 < param_1) { iVar1 = (*(int *)(in_ECX + 0x280) - *(int *)(in_ECX + 0x27c) >> 2) + -4; if (iVar1 < param_1) { param_1 = iVar1; } *(float *)(in_ECX + 0x20) = 0.0 - (float)(param_1 + -3) * 20.0; } *(undefined1 *)(in_ECX + 4) = 1; return; } //@@ 009b52a0 Menu_Options::reload /* DB: ? MenuManager::SetState for states 10 and 0x14 (options menus) and PauseScreen::Update: sets dirty flags +0x24c..+0x254, swaps state 1/2 by netplay, Menu_Options::load_graphics, stores language Manager+0x4a920 at +0x278 */ void Menu_Options::reload(void) { Menu_Options *in_ECX; in_ECX->HoldLeftCounter = 1; in_ECX->HoldRightCounter = 1; in_ECX->HoldUpDownCounter = 1; if (*(int *)in_ECX == 1) { if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) goto LAB_009b530a; *(undefined4 *)in_ECX = 2; } else { if ((*(int *)in_ECX != 2) || (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) goto LAB_009b530a; *(undefined4 *)in_ECX = 1; } load_graphics(in_ECX); LAB_009b530a: *(undefined4 *)&in_ECX[1].field_0x20 = *(undefined4 *)&g_manager->_stringTable; return; } //@@ 009b5320 PauseScreen::constructor /* DB: Game::constructor step 0x1e (Game+0x2363c _pauseScreen); constructs ANM2s at +0x2c mainsprite, +0x140 minisprite, +0x254 statssprite, +0x368 mystuffminispritebase, +0x47c, zeroes +0x590..+0x5ac: matches REPENTOGON PauseScreen layout */ void PauseScreen::constructor(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e5c3; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 4) = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x2c)); local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x140)); local_8._0_1_ = 1; ANM2::constructor((ANM2 *)(in_ECX + 0x254)); local_8._0_1_ = 2; ANM2::constructor((ANM2 *)(in_ECX + 0x368)); local_8._0_1_ = 3; ANM2::constructor((ANM2 *)(in_ECX + 0x47c)); *(undefined1 *)(in_ECX + 0x5ac) = 0; *(undefined4 *)(in_ECX + 0x590) = 0; *(undefined4 *)(in_ECX + 0x594) = 0; *(undefined4 *)(in_ECX + 0x598) = 0; *(undefined4 *)(in_ECX + 0x59c) = 0; *(undefined4 *)(in_ECX + 0x5a0) = 0; local_8._0_1_ = 4; Menu_Options::constructor(); *(undefined4 *)(in_ECX + 0x838) = 6; *(undefined4 *)(in_ECX + 0x83c) = 6; *(undefined4 *)(in_ECX + 0x840) = 0x24; *(undefined4 *)(in_ECX + 0x844) = 2; *(undefined1 *)(in_ECX + 0x848) = 0; *(undefined4 *)(in_ECX + 0x84c) = 0; *(undefined4 *)(in_ECX + 0x850) = 0; *(undefined4 *)(in_ECX + 0x854) = 0; *(undefined4 *)(in_ECX + 0x858) = 0; local_8._0_1_ = 6; *(undefined4 *)(in_ECX + 0x868) = 0; *(undefined4 *)(in_ECX + 0x86c) = 0; *(undefined4 *)(in_ECX + 0x870) = 0; KAGE::SmartPointer::SmartPointer((void *)(in_ECX + 0x874),(void *)0x0); local_8._0_1_ = 7; *(undefined4 *)(in_ECX + 0x87c) = 0; *(undefined4 *)(in_ECX + 0x880) = 0; *(undefined4 *)(in_ECX + 0x884) = 0; KAGE::SmartPointer::SmartPointer((void *)(in_ECX + 0x888),(void *)0x0); local_8._0_1_ = 8; *(undefined4 *)(in_ECX + 0x890) = 0; *(undefined4 *)(in_ECX + 0x894) = 0; *(undefined4 *)(in_ECX + 0x898) = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x89c)); *(undefined4 *)(in_ECX + 0x9b0) = 0xffffffff; *(undefined4 *)(in_ECX + 0x9b4) = 0; *(undefined4 *)(in_ECX + 0x9b8) = 0; *(undefined4 *)(in_ECX + 0x9bc) = 0; *(undefined4 *)(in_ECX + 0x9cc) = 0; *(undefined4 *)(in_ECX + 0x9d0) = 0xf; *(undefined1 *)(in_ECX + 0x9bc) = 0; local_8._0_1_ = 10; Font::Font((Font *)(in_ECX + 0x9d4)); *(undefined4 *)(in_ECX + 0xa20) = 0; *(undefined4 *)(in_ECX + 0xa24) = 0x3f800000; local_8._0_1_ = 0xb; ANM2::constructor((ANM2 *)(in_ECX + 0xa28)); local_8._0_1_ = 0xc; ANM2::constructor((ANM2 *)(in_ECX + 0xb3c)); local_8._0_1_ = 0xd; ANM2::constructor((ANM2 *)(in_ECX + 0xc50)); local_8._0_1_ = 0xe; ANM2::constructor((ANM2 *)(in_ECX + 0xd64)); local_8._0_1_ = 0xf; KAGE::SmartPointer::SmartPointer((void *)(in_ECX + 0xe78),(void *)0x0); *(undefined4 *)(in_ECX + 0xe80) = 0; *(undefined4 *)(in_ECX + 0xe84) = 0; *(undefined4 *)(in_ECX + 0xe88) = 0; *(undefined4 *)(in_ECX + 0xe8c) = 0; local_8._0_1_ = 0x11; ANM2::constructor((ANM2 *)(in_ECX + 0xe94)); local_8._0_1_ = 0x12; MenuDialog::constructor(); local_8._0_1_ = 0x13; *(undefined4 *)(in_ECX + 0x1218) = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x121c)); local_8 = CONCAT31(local_8._1_3_,0x14); ANM2::constructor((ANM2 *)(in_ECX + 0x1330)); *(undefined4 *)(in_ECX + 0x1444) = 0; *(undefined4 *)(in_ECX + 0x1448) = 0; *(undefined4 *)(in_ECX + 0x144c) = 0; *(undefined4 *)(in_ECX + 0x1450) = 0x3f400000; *(undefined1 *)(in_ECX + 0x1454) = 0; ExceptionList = local_10; return; } //@@ 009b5600 PauseScreen::~PauseScreen /* DB: Game::~Game destroys it in reverse ctor order right where PauseScreen::constructor ran; destroys the ANM2s at +0x2c/+0x140/+0x254/+0x368/+0x47c that PauseScreen::constructor builds, plus MenuDialog (009c4020), Menu_Options (009b2090), sprite +0xe94 and an image ref +0xe88 */ void PauseScreen::~PauseScreen(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e5e0; local_10 = ExceptionList; ExceptionList = &local_10; FUN_008d0f10(__security_cookie ^ (int)register0x00000010 - 4U); MenuDialog::~MenuDialog((void *)(in_ECX + 0xfb0)); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0xe94)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0xee4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0xec4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xeac)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xe94)); local_8 = 1; if (*(int **)(in_ECX + 0xe8c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0xe8c) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0xe88); } } PauseScreen_MyStuff::~PauseScreen_MyStuff(); Menu_Options::~Menu_Options((Menu_Options *)(in_ECX + 0x5b0)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x47c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4cc)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4ac)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x494)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x47c)); local_8 = 3; ANM2::Reset((ANM2 *)(in_ECX + 0x368)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3b8)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x398)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x380)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x368)); local_8 = 4; ANM2::Reset((ANM2 *)(in_ECX + 0x254)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x2a4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x284)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x26c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x254)); local_8 = 5; ANM2::Reset((ANM2 *)(in_ECX + 0x140)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 400)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x170)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x158)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x140)); local_8 = 6; ANM2::Reset((ANM2 *)(in_ECX + 0x2c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x7c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x44)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2c)); ExceptionList = local_10; return; } //@@ 009b5800 FUN_009b5800 int FUN_009b5800(void) { int iVar1; Entity_Player *pEVar2; int in_ECX; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pEVar2 = Game::GetPlayer(g_game,*(uint *)(in_ECX + 0xfac)); return pEVar2->_controllerIndex; } iVar1 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); return iVar1; } //@@ 009b5840 PauseScreen::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: loads PauseScreen/Death Screen anm2; LoadConfigXmls prototype: db/protos.zhl */ void __thiscall PauseScreen::Init(PauseScreen *deathScreenSprite) { PauseScreen *pPVar1; byte bVar2; char isLastRef; byte *curAnimName; LayerState *layer; void *other; char *pcVar3; uint uVar4; byte *pbVar5; undefined1 *deathScreenSprite; bool isLess; undefined1 myStuffImage [4]; int *myStuffImageRefCount; Vector optionsPos; PauseScreen *pauseScreen; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = myStuffImage + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0e62d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(myStuffImage + 0x40); ExceptionList = &local_1c; optionsPos.x = 0.0; optionsPos.y = 0.0; pauseScreen = deathScreenSprite; Menu_Options::Init((Menu_Options *)&deathScreenSprite->field_0x5b0,&optionsPos,1); PauseScreen_MyStuff::Init(&deathScreenSprite->field_0x838); CompletionMarks::Load(1); deathScreenSprite->_state = 0; *(undefined4 *)&deathScreenSprite->field_0x8 = 2; *(undefined4 *)&deathScreenSprite->field_0x24 = 0; *(undefined4 *)&deathScreenSprite->field_0x28 = 0; *(undefined1 *)&deathScreenSprite[1]._genericPrompt._sprite._animDefaultName._size = 0; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x17; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PauseScreen.anm2",0x18); local_14 = 0; ANM2::Load((ANM2 *)&deathScreenSprite->field_0x2c,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar4 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1d; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PauseScreen_small.anm2",0x1e); local_14 = 1; ANM2::Load((ANM2 *)&deathScreenSprite->field_0x140,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar4 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1c; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PauseScreenStats.anm2",0x1d); local_14 = 2; ANM2::Load((ANM2 *)&deathScreenSprite->field_0x254,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar4 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } deathScreenSprite = &deathScreenSprite->field_0x368; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x18; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14 = 3; ANM2::Load((ANM2 *)deathScreenSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; pcVar3 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar4) { pcVar3 = *(char **)(anm2Path._buf._0_4_ + -4); uVar4 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar3,uVar4); } pbVar5 = *(byte **)&deathScreenSprite->field_0x39c; if (pbVar5 != (byte *)0x0) { curAnimName = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { curAnimName = *(byte **)pbVar5; } pcVar3 = "Diary"; do { bVar2 = *curAnimName; isLess = bVar2 < (byte)*pcVar3; if (bVar2 != *pcVar3) { LAB_009b5bd0: uVar4 = -(uint)isLess | 1; goto LAB_009b5bd5; } if (bVar2 == 0) break; bVar2 = curAnimName[1]; isLess = bVar2 < (byte)pcVar3[1]; if (bVar2 != pcVar3[1]) goto LAB_009b5bd0; curAnimName = curAnimName + 2; pcVar3 = pcVar3 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_009b5bd5: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || (deathScreenSprite->field_0x3ac != '\0')))) goto LAB_009b5c01; } bVar2 = ANM2::SetAnimation((ANM2 *)deathScreenSprite,(byte *)"Diary",1); if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)&deathScreenSprite->field_0x398); deathScreenSprite->field_0x3ac = 1; } LAB_009b5c01: pbVar5 = (byte *)0x0; do { layer = ANM2::GetLayer((ANM2 *)deathScreenSprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while ((int)pbVar5 < 7); layer = ANM2::GetLayer((ANM2 *)deathScreenSprite,&DAT_00000006); layer->_visible = 1; other = Manager::LoadImage(myStuffImage,(byte *)"gfx/ui/menu_mystuff.png"); pPVar1 = pauseScreen; local_14 = 4; KAGE::SmartPointer::operator_assign(&pauseScreen->field_0xe88,other); local_14 = 5; if (myStuffImageRefCount != (int *)0x0) { isLastRef = (**(code **)(*myStuffImageRefCount + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(myStuffImage); } } local_14 = 0xffffffff; GenericPrompt::Initialize(&pPVar1->_genericPrompt,1); load_drop_player_menu(); ExceptionList = local_1c; return; } //@@ 009b5cb0 FUN_009b5cb0 void FUN_009b5cb0(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[2] = 2; in_ECX[9] = 0; in_ECX[10] = 0; *(undefined1 *)(in_ECX + 0x515) = 0; AnimationState::SetAnimationData((AnimationState *)(in_ECX + 0x1f),(void *)0x0); AnimationState::SetAnimationData((AnimationState *)(in_ECX + 100),(void *)0x0); Menu_Options::load_graphics((Menu_Options *)(in_ECX + 0x16c)); FUN_008d3250(); GenericPrompt::Initialize((GenericPrompt *)(in_ECX + 0x11f),1); return; } //@@ 009b5d20 PauseScreen::Update /* WARNING: Type propagation algorithm not settling */ /* DB: next to PauseScreen::Init 009b5840; #QUIT_DAILY_RUN prompt via GenericPrompt, BackKey, Game::End, DeleteSaveState; called from the menu update 00954cd0 Manager::Update 006fa540 prototype: db/protos.zhl */ void __thiscall PauseScreen::Update(PauseScreen *this) { char cVar1; byte bVar2; uint lobbyMemberCount; ItemConfig_Item *itemConfig; Entity_Player *player; int iVar3; LayerState *backKeyLayer; byte *pbVar4; byte *quitLine1; void *pvVar5; undefined1 *puVar6; undefined1 *prevHistoryItem; int iVar7; float fStack_80; float fStack_7c; KColor fadeColor; undefined8 local_60; Entity_Player *local_58 [2]; byte *local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; PauseScreen *savedThis; undefined1 *local_3c; void *local_38; Entity_Player *local_34; int local_30; undefined1 *cleanupFlags; int controllerIndex; byte local_21; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; Entity_Player *local_14; Game *game; Manager *manager; puStack_20 = (undefined1 *)(local_58 + 0x15); local_14 = (Entity_Player *)0xffffffff; puStack_18 = &LAB_00b0e69f; local_1c = ExceptionList; ExceptionList = &local_1c; local_3c = (undefined1 *)0x0; cleanupFlags = (undefined1 *)0x0; savedThis = this; cVar1 = FUN_009c3990(__security_cookie ^ (uint)(local_58 + 0x12)); if (cVar1 != '\0') { ExceptionList = local_1c; return; } iVar3 = this->_state; if (iVar3 == 2) { Menu_Options::Update((Menu_Options *)&this->field_0x5b0); } else if (iVar3 == 3) { update_items_menu(); if (this->field_0x848 == '\0') { this->_state = 1; ExceptionList = local_1c; return; } } else if (iVar3 == 6) { update_player_info_page(); } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { player = Game::GetPlayer(g_game,this->_playerIdx); controllerIndex = player->_controllerIndex; } else { controllerIndex = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } iVar7 = controllerIndex; iVar3 = this->_state; if (iVar3 == 0) { if ((controllerIndex == 0) && ((local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60), *(int *)&g_manager[1]._gamestate.field_0x290 != 0 || (local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60), 0 < *(int *)&g_manager[1]._gamestate.field_0x2d8)))) goto switchD_009b63f7_default; bVar2 = input_is_action_triggered(g_manager,0xc,controllerIndex,(Entity *)0x0,0); if (bVar2 == 0) { local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (iVar7 != 0) goto switchD_009b63f7_default; bVar2 = input_is_action_triggered(g_manager,0xf,0,(Entity *)0x0,0); local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if ((bVar2 == 0) || (local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60), g_game->_emoteMenuState != 0)) goto switchD_009b63f7_default; } Show(this); local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); goto switchD_009b63f7_default; } if (iVar3 != 1) { if (iVar3 == 2) { local_58[0] = (Entity_Player *)&DAT_0000000f; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,local_58,0,0); local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (cVar1 != '\0') { this->_state = 1; local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); } } else { local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (iVar3 == 5) { online_chat_window_update(); local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); } } goto switchD_009b63f7_default; } local_3c = (undefined1 *)0xc; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,&local_3c,0,0); if (cVar1 != '\0') { LAB_009b66f6: PopupWindow::hide(this); g_manager->_isWindowFocused = 1; ExceptionList = local_1c; return; } local_3c = &DAT_0000000f; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_3c,0,0); if (cVar1 != '\0') goto LAB_009b66f6; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { local_38 = (void *)0x1c; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_38,0,0); if (cVar1 != '\0') { lobbyMemberCount = online_lobby_get_member_count(); if (1 < lobbyMemberCount) { *(undefined4 *)&this[1].field_0x268 = 0; this->_state = 6; } goto LAB_009b6311; } } if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || ((g_game->_dailyChallenge)._id != 0)) { LAB_009b5fbf: local_21 = 0; } else { local_3c = (undefined1 *)0x18; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_3c,0,0); if (cVar1 == '\0') goto LAB_009b5fbf; Multiplayer::get_lobby(&DAT_00c79a50,&local_60); local_14 = (Entity_Player *)0x0; cleanupFlags = (undefined1 *)0x1; local_3c = (undefined1 *)0x1; cVar1 = FUN_00a284b0(); local_21 = 1; if (cVar1 != '\0') goto LAB_009b5fbf; } local_14 = (Entity_Player *)0xffffffff; if (((uint)cleanupFlags & 1) != 0) { cleanupFlags = (undefined1 *)((uint)cleanupFlags & 0xfffffffe); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_60); } if (local_21 == 0) { local_44 = 0x16; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_44,0,0); if (cVar1 == '\0') { local_48 = 0x17; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_48,0,0); if (cVar1 == '\0') { local_4c = 0x14; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a20940,&local_4c,0,0); if (cVar1 == '\0') { local_50 = (byte *)0x15; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a20940,&local_50,0,0); if ((cVar1 != '\0') && ((iVar3 = *(int *)&this->field_0x28, iVar3 == 0 || ((0x1d < iVar3 && (iVar3 % 10 == 0)))))) { local_58[0] = Game::GetPlayer(g_game,this->_playerIdx); pvVar5 = (local_58[0]->_history)._historyItems._end; local_3c = (local_58[0]->_history)._historyItems._begin; iVar7 = ((int)pvVar5 - (int)local_3c) / 0x1c; iVar3 = iVar7 + -0x18; local_30 = 0; if (0 < iVar3) { local_30 = iVar3; } local_38 = (void *)0x4; if (iVar7 != 0) { local_34 = (Entity_Player *)0x0; puVar6 = (undefined1 *)((int)pvVar5 + *(int *)&this->field_0x24 * -0x1c); if (puVar6 != local_3c) { do { if (0x17 < (int)local_34) break; prevHistoryItem = puVar6 + -0x1c; if (puVar6[-0x18] == '\0') { local_3c = *(undefined1 **)(puVar6 + -0x14); } else { local_3c = (undefined1 *)0x0; } itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)local_3c); if (itemConfig == (ItemConfig_Item *)0x0) { LAB_009b62cb: local_30 = local_30 + -1; if ((int)local_34 < (int)local_38) { local_38 = (void *)((int)local_38 + 1); } } else { player = Game::GetPlayer(g_game,this->_playerIdx); bVar2 = Entity_Player::HasCollectible(player,(int)local_3c,1); if (bVar2 == 0) goto LAB_009b62cb; local_34 = (Entity_Player *)&local_34->field_0x1; } puVar6 = prevHistoryItem; } while (prevHistoryItem != (local_58[0]->_history)._historyItems._begin); } } iVar3 = *(int *)&this->field_0x24; *(int *)&this->field_0x24 = iVar3 + (int)local_38; if (local_30 + 3 < iVar3 + (int)local_38) { iVar7 = 0; if (0 < iVar3) { iVar7 = iVar3; } *(int *)&this->field_0x24 = iVar7; } iVar7 = controllerIndex; } } else { iVar3 = *(int *)&this->field_0x28; if ((iVar3 == 0) || ((0x1d < iVar3 && (iVar3 % 10 == 0)))) { player = Game::GetPlayer(g_game,this->_playerIdx); local_30 = 4; local_34 = player; LAB_009b60e4: iVar3 = *(int *)&this->field_0x24 + -1; *(int *)&this->field_0x24 = iVar3; if (0 < iVar3) { do { local_38 = (player->_history)._historyItems._begin; iVar3 = ((int)(player->_history)._historyItems._end - (int)local_38) / 0x1c - iVar3; if ((*(char *)((int)local_38 + iVar3 * 0x1c + 4) == '\0') && (itemConfig = ItemConfig::GetCollectible (&g_manager->_itemConfig, *(int *)((int)local_38 + iVar3 * 0x1c + 8)), itemConfig != (ItemConfig_Item *)0x0)) { player = Game::GetPlayer(g_game,this->_playerIdx); bVar2 = Entity_Player::HasCollectible (player,*(int *)((int)local_38 + iVar3 * 0x1c + 8),1); if (bVar2 != 0) goto LAB_009b618a; } iVar3 = *(int *)&this->field_0x24 + -1; *(int *)&this->field_0x24 = iVar3; if (iVar3 < 1) goto LAB_009b618a; player = local_34; } while( true ); } goto LAB_009b6190; } } } else { *(int *)&this->field_0x8 = *(int *)&this->field_0x8 + 1; if (3 < *(int *)&this->field_0x8) { *(undefined4 *)&this->field_0x8 = 0; } } } else { puVar6 = &this->field_0x8; *(int *)puVar6 = *(int *)puVar6 + -1; if (*(int *)puVar6 < 0) { *(undefined4 *)&this->field_0x8 = 3; } } } else { InviteFriendsMenu::load_graphics(); this->_state = 5; } LAB_009b6311: if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { player = Game::GetPlayer(g_game,0); bVar2 = Entity_Player::IsLocalPlayer(player); if ((bVar2 != 0) && ((g_manager->_lobbySettings)._password._size != 0)) { local_58[0] = (Entity_Player *)&DAT_0000001d; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,local_58,0,0); if (cVar1 != '\0') { *(bool *)&this[1]._genericPrompt._sprite._animDefaultName._size = (char)this[1]._genericPrompt._sprite._animDefaultName._size == '\0'; } } } iVar7 = 0x194; iVar3 = 0x194; if (this->_menuType != 1) { iVar3 = 0x80; } if (*(int *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c) != 0) { iVar3 = 400; if (this->_menuType != 1) { iVar3 = 0x7c; } AnimationState::SetFrameFloat ((AnimationState *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c), (float)*(int *)&this->field_0x8); } local_58[0] = (Entity_Player *)&DAT_0000000e; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,local_58,0,0); local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (cVar1 == '\0') goto switchD_009b63f7_default; local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); switch(*(undefined4 *)&this->field_0x8) { case 0: if (this->_menuType != 1) { iVar7 = 0x80; } local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (*(int *)((this->_genericPrompt)._sprite._filename._buf + iVar7 + -0x47c) != 0) { this->_state = 2; Menu_Options::reload(); } break; case 1: if (this->_menuType != 1) { iVar7 = 0x80; } local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (*(int *)((this->_genericPrompt)._sprite._filename._buf + iVar7 + -0x47c) != 0) { this->_state = 3; FUN_008d3250(); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { player = Game::GetPlayer(g_game,(g_game->_pauseScreen)._playerIdx); iVar3 = player->_controllerIndex; } else { iVar3 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } local_21 = iVar3 == 0; backKeyLayer = ANM2::GetLayer((ANM2 *)&this->field_0xb3c,(byte *)"BackKey"); backKeyLayer->_visible = local_21; this->field_0x848 = 1; local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); } break; case 2: PopupWindow::hide(this); ExceptionList = local_1c; return; case 3: if ((g_game->_dailyChallenge)._id != 0) { local_58[0] = (Entity_Player *) string_table_translate(&g_manager->_stringTable,(byte *)"#QUIT_DAILY_RUN_4"); local_50 = string_table_translate(&g_manager->_stringTable,(byte *)"#QUIT_DAILY_RUN_3"); pbVar4 = string_table_translate(&g_manager->_stringTable,(byte *)"#QUIT_DAILY_RUN_2"); quitLine1 = string_table_translate(&g_manager->_stringTable,(byte *)"#QUIT_DAILY_RUN_1"); this = savedThis; FUN_00838230(quitLine1,pbVar4,local_50,local_58[0],0); GenericPrompt::Show(&this->_genericPrompt,0); this->_state = 4; local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); break; } iVar3 = 400; if (this->_menuType != 1) { iVar3 = 0x7c; } AnimationState::SetAnimationData ((AnimationState *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c), (void *)0x0); player = Game::GetPlayer(g_game,0); if (player->_dead != 0) { player = Game::GetPlayer(g_game,0); iVar3 = Entity_Player::GetExtraLives(player); if (iVar3 < 1) { Game::DeleteSaveState(); } } KColor::SetFromARGB(&fadeColor,0xff000000); manager = g_manager; game = g_game; fStack_7c = (g_game->_fadeOutColor)._alpha; fStack_80 = fadeColor._blue; g_game->_fadeSpeed = 0.08; game->_fadeOutTarget = 2; (game->_fadeOutColor)._red = fadeColor._red; (game->_fadeOutColor)._green = fadeColor._green; (game->_fadeOutColor)._blue = fadeColor._blue; (game->_fadeOutColor)._alpha = fStack_7c; (game->_fadeOutColor)._unk = 0; (game->_fadeOutColor)._alpha = (game->_fadeOutColor)._alpha + 0.08; if (manager->_netplayManager == *(NetplayManager *)(manager + 1)) { LAB_009b6686: local_21 = 0; } else { pvVar5 = Multiplayer::get_lobby(&DAT_00c79a50,&fadeColor._blue); local_14 = (Entity_Player *)0x1; local_3c = (undefined1 *)((uint)cleanupFlags | 2); cleanupFlags = local_3c; if (*(int **)((int)pvVar5 + 4) == (int *)0x0) goto LAB_009b6686; iVar3 = (**(code **)(**(int **)((int)pvVar5 + 4) + 0x3c))(); local_21 = 1; if (iVar3 != 3) goto LAB_009b6686; } local_14 = (Entity_Player *)0xffffffff; if (((uint)cleanupFlags & 2) != 0) { KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&fadeColor._blue); } manager = g_manager; local_60 = CONCAT44(local_60._4_4_,(undefined4)local_60); if (local_21 != 0) { Multiplayer::get_lobby(&DAT_00c79a50,&fStack_80); local_14 = (Entity_Player *)0x2; local_60 = FUN_00a23920(); pbVar4 = map_u64_bool_subscript(&manager[1]._gamestate.field_0x8f4,&local_60); local_14 = (Entity_Player *)0xffffffff; *pbVar4 = 1; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&fStack_80); } } switchD_009b63f7_default: GenericPrompt::Update(&this->_genericPrompt,1); if (((((this->_genericPrompt)._sprite._animState._animData == (void *)0x0) || ((this->_genericPrompt)._sprite._animState._isPlaying == 0)) && (this->_state == 4)) && (iVar3 = *(int *)&(this->_genericPrompt).field_0x12c, this->_state = 1, iVar3 == 1)) { Game::End(g_game,1); } local_58[0] = (Entity_Player *)0x15; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_58,0,0); if (cVar1 == '\0') { local_34 = (Entity_Player *)0x14; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_34,0,0); if (cVar1 == '\0') { *(undefined4 *)&this->field_0x28 = 0; ExceptionList = local_1c; return; } } *(int *)&this->field_0x28 = *(int *)&this->field_0x28 + 1; ExceptionList = local_1c; return; LAB_009b618a: player = local_34; LAB_009b6190: local_30 = local_30 + -1; if (local_30 == 0) goto code_r0x009b619c; goto LAB_009b60e4; code_r0x009b619c: local_30 = 0; iVar7 = controllerIndex; if (*(int *)&this->field_0x24 < 0) { *(undefined4 *)&this->field_0x24 = 0; } goto LAB_009b6311; } //@@ 009b6840 netplay_lobby_menu_update /* DB: ? online lobby overlay update: Invite/InviteKey/KickKey/PasswordPaper/ShowPassword(Key), Appear/Cursor/Dissapear, NetplayManager::IsIdxLocalPlayer; called from Game::Update (Game+0x1d520 != 0) and after PauseScreen::Update in 00954cd0 Manager::Update void netplay_lobby_menu_update(void) { void *pvVar1; Entity_Pickup *this; Game *pGVar2; Manager *pMVar3; byte bVar4; char cVar5; byte bVar6; uint uVar7; Entity_Player *pEVar8; int iVar9; byte *pbVar10; LayerState *pLVar11; int *in_ECX; char *pcVar12; int iVar13; int iVar14; uint uVar15; bool bVar16; int *local_1c; int *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e6d5; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; if (*in_ECX == 0) { return; } if ((*(int *)&g_game->_roomTransition != 0) && ((g_game->_roomTransition)._bossIntroBossId != 0)) { return; } ExceptionList = &local_10; if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) && (pEVar8 = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b1,(RNG **)&g_game->_playerManager,1), pEVar8 != (Entity_Player *)0x0)) { uVar15 = 0; pvVar1 = g_game->_room; if (*(int *)((int)pvVar1 + 0x1264) != 0) { do { this = *(Entity_Pickup **)(*(int *)((int)pvVar1 + 0x125c) + uVar15 * 4); if ((this->_type == 5) && (this->_variant == 100)) { Entity_Pickup::update_cycle_collectible(this,0); } uVar15 = uVar15 + 1; } while (uVar15 < *(uint *)((int)pvVar1 + 0x1264)); } } CompletionMarks::update_layers(uVar7); pGVar2 = g_game; if ((g_game->_hud)._hudRefreshType != 2) { (g_game->_hud)._hudRefreshType = 1; (pGVar2->_hud)._hudRefreshCountdown = 2; } bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x95),s_Idle,1); if (((bVar4 != 0) && (in_ECX[0xa2] != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0xa1),0.0), in_ECX[0xa2] != 0)) { *(undefined1 *)(in_ECX + 0xa6) = 0; } if (in_ECX[1] == 0) { local_14 = in_ECX[3]; if ((in_ECX[0xa2] != 0) && ((1 < *(int *)(in_ECX[0xa1] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 1 < *(int *)(in_ECX[0xa1] + 0x80)) ))) { iVar13 = in_ECX[0xa2]; iVar9 = *(int *)(iVar13 + 0x3c); if ((iVar13 == 0) || ((iVar9 < 0 || (*(int *)(iVar13 + 0x1c) <= iVar9)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0xa3] + iVar9 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xa1),iVar9,(float)local_14); } local_14 = in_ECX[4]; if ((in_ECX[0xa2] != 0) && ((2 < *(int *)(in_ECX[0xa1] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 2 < *(int *)(in_ECX[0xa1] + 0x80)) ))) { iVar13 = in_ECX[0xa2]; iVar9 = *(int *)(iVar13 + 0x40); if ((iVar13 == 0) || ((iVar9 < 0 || (*(int *)(iVar13 + 0x1c) <= iVar9)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0xa3] + iVar9 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xa1),iVar9,(float)local_14); } local_14 = in_ECX[5]; if ((in_ECX[0xa2] != 0) && ((3 < *(int *)(in_ECX[0xa1] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 3 < *(int *)(in_ECX[0xa1] + 0x80)) ))) { iVar13 = in_ECX[0xa2]; iVar9 = *(int *)(iVar13 + 0x44); if ((iVar13 == 0) || ((iVar9 < 0 || (*(int *)(iVar13 + 0x1c) <= iVar9)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0xa3] + iVar9 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xa1),iVar9,(float)local_14); } local_14 = in_ECX[6]; if ((in_ECX[0xa2] != 0) && ((4 < *(int *)(in_ECX[0xa1] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 4 < *(int *)(in_ECX[0xa1] + 0x80)) ))) { iVar13 = in_ECX[0xa2]; iVar9 = *(int *)(iVar13 + 0x48); if ((iVar13 == 0) || ((iVar9 < 0 || (*(int *)(iVar13 + 0x1c) <= iVar9)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0xa3] + iVar9 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xa1),iVar9,(float)local_14); } local_14 = in_ECX[7]; if ((in_ECX[0xa2] != 0) && ((5 < *(int *)(in_ECX[0xa1] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 5 < *(int *)(in_ECX[0xa1] + 0x80)) ))) { iVar13 = in_ECX[0xa2]; iVar9 = *(int *)(iVar13 + 0x4c); if ((iVar13 == 0) || ((iVar9 < 0 || (*(int *)(iVar13 + 0x1c) <= iVar9)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0xa3] + iVar9 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xa1),iVar9,(float)local_14); } local_14 = in_ECX[8]; if ((in_ECX[0xa2] != 0) && ((6 < *(int *)(in_ECX[0xa1] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)(in_ECX[0xa1] + 0x80)) ))) { iVar13 = in_ECX[0xa2]; iVar9 = *(int *)(iVar13 + 0x50); if ((iVar13 == 0) || ((iVar9 < 0 || (*(int *)(iVar13 + 0x1c) <= iVar9)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(in_ECX[0xa3] + iVar9 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(in_ECX + 0xa1),iVar9,(float)local_14); } } iVar13 = in_ECX[1]; iVar14 = 0x174; iVar9 = 0x174; if (iVar13 != 1) { iVar9 = 0x60; } if (*(int *)(iVar9 + (int)in_ECX) != 0) { local_14 = 0x70; iVar9 = 0x184; if (iVar13 != 1) { iVar9 = 0x70; } if (*(char *)(iVar9 + (int)in_ECX) == '\0') { iVar9 = 0x174; if (iVar13 != 1) { iVar9 = 0x60; } pbVar10 = *(byte **)(iVar9 + (int)in_ECX); if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar12 = "Appear"; do { bVar4 = *pbVar10; bVar16 = bVar4 < (byte)*pcVar12; if (bVar4 != *pcVar12) { LAB_009b6cf0: uVar7 = -(uint)bVar16 | 1; goto LAB_009b6cf5; } if (bVar4 == 0) break; bVar4 = pbVar10[1]; bVar16 = bVar4 < (byte)pcVar12[1]; if (bVar4 != pcVar12[1]) goto LAB_009b6cf0; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_009b6cf5: if (uVar7 == 0) { iVar13 = 0x140; if (in_ECX[1] != 1) { iVar13 = 0x2c; } ANM2::Play((ANM2 *)(iVar13 + (int)in_ECX),s_Idle,0); iVar13 = in_ECX[1]; if (iVar13 != 1) { iVar14 = 0x60; } if (*(int *)(iVar14 + (int)in_ECX) != 0) { iVar9 = 0x184; if (iVar13 != 1) { iVar9 = local_14; } *(undefined1 *)(iVar9 + (int)in_ECX) = 0; iVar13 = in_ECX[1]; } iVar9 = 0x140; if (iVar13 != 1) { iVar9 = 0x2c; } ANM2::SetOverlayAnimation((ANM2 *)(iVar9 + (int)in_ECX),(byte *)"Cursor",1); iVar13 = 0x194; if (in_ECX[1] != 1) { iVar13 = 0x80; } if (*(int *)(iVar13 + (int)in_ECX) != 0) { iVar13 = 400; if (in_ECX[1] != 1) { iVar13 = 0x7c; } AnimationState::SetFrameFloat((AnimationState *)(iVar13 + (int)in_ECX),(float)in_ECX[2]); } goto LAB_009b6dfb; } iVar13 = in_ECX[1]; } iVar9 = 0x184; if (iVar13 != 1) { iVar9 = 0x70; } if (*(char *)(iVar9 + (int)in_ECX) == '\0') { if (iVar13 != 1) { iVar14 = 0x60; } pbVar10 = *(byte **)(iVar14 + (int)in_ECX); if (pbVar10 == (byte *)0x0) { pbVar10 = &s_empty; } else if (0xf < *(uint *)(pbVar10 + 0x14)) { pbVar10 = *(byte **)pbVar10; } pcVar12 = "Dissapear"; do { bVar4 = *pbVar10; bVar16 = bVar4 < (byte)*pcVar12; if (bVar4 != *pcVar12) { LAB_009b6df0: uVar7 = -(uint)bVar16 | 1; goto LAB_009b6df5; } if (bVar4 == 0) break; bVar4 = pbVar10[1]; bVar16 = bVar4 < (byte)pcVar12[1]; if (bVar4 != pcVar12[1]) goto LAB_009b6df0; pbVar10 = pbVar10 + 2; pcVar12 = pcVar12 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_009b6df5: if (uVar7 == 0) { *in_ECX = 0; } } } LAB_009b6dfb: if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pEVar8 = Game::GetPlayer(g_game,in_ECX[0x3eb]); local_14 = pEVar8->_controllerIndex; } else { local_14 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || ((g_game->_dailyChallenge)._id != 0)) { LAB_009b6eef: bVar4 = 0; } else { local_1c = (int *)0x0; local_18 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_1c,&g_multiplayerLobbyPtr); local_8 = 1; if (local_1c == (int *)0x0) { bVar16 = false; } else { iVar13 = local_1c[5]; iVar9 = local_1c[4]; uVar7 = (**(code **)(*local_1c + 0x1c))(); bVar16 = uVar7 <= (uint)(iVar13 - iVar9 >> 3); } local_8 = 2; if (((local_18 != (int *)0x0) && (cVar5 = (**(code **)(*local_18 + 0xc))(), cVar5 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_1c); } local_8 = 0xffffffff; if (bVar16) goto LAB_009b6eef; bVar4 = 1; } iVar13 = 0x140; if (in_ECX[1] != 1) { iVar13 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar13 + (int)in_ECX),(byte *)"Invite"); pMVar3 = g_manager; pLVar11->_visible = bVar4; if ((pMVar3->_netplayManager == *(NetplayManager *)(pMVar3 + 1)) || (uVar7 = online_lobby_get_member_count(), uVar7 < 2)) { bVar4 = 0; } else { bVar4 = 1; } iVar13 = 0x140; if (in_ECX[1] != 1) { iVar13 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar13 + (int)in_ECX),&DAT_00b79bb0); iVar13 = 0x140; pLVar11->_visible = bVar4; if (in_ECX[1] != 1) { iVar13 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar13 + (int)in_ECX),(byte *)"Invite"); iVar13 = local_14; if ((pLVar11->_visible == 0) || (local_14 != 0)) { bVar4 = 0; } else { bVar4 = 1; } iVar9 = 0x140; if (in_ECX[1] != 1) { iVar9 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar9 + (int)in_ECX),(byte *)"InviteKey"); iVar9 = 0x140; pLVar11->_visible = bVar4; if (in_ECX[1] != 1) { iVar9 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar9 + (int)in_ECX),&DAT_00b79bb0); if ((pLVar11->_visible == 0) || (iVar13 != 0)) { bVar4 = 0; } else { bVar4 = 1; } iVar13 = 0x140; if (in_ECX[1] != 1) { iVar13 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar13 + (int)in_ECX),(byte *)"KickKey"); pLVar11->_visible = bVar4; PauseScreen::update_stuff_arrows(); if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { pEVar8 = Game::GetPlayer(g_game,in_ECX[0x3eb]); local_14 = pEVar8->_controllerIndex; } else { local_14 = InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pEVar8 = Game::GetPlayer(g_game,0); if (((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (bVar4 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,pEVar8->_controllerIndex), bVar4 != 0)) && ((g_manager->_lobbySettings)._password._size != 0)) { bVar4 = 1; goto LAB_009b7085; } } bVar4 = 0; LAB_009b7085: iVar13 = in_ECX[1]; iVar9 = 0x140; if (iVar13 != 1) { iVar9 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar9 + (int)in_ECX),(byte *)"PasswordPaper"); if (pLVar11 != (LayerState *)0x0) { pLVar11->_visible = bVar4; iVar13 = in_ECX[1]; } iVar9 = 0x140; if (iVar13 != 1) { iVar9 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar9 + (int)in_ECX),(byte *)"ShowPassword"); if (pLVar11 != (LayerState *)0x0) { if ((bVar4 == 0) || ((char)in_ECX[0x515] != '\0')) { bVar6 = 0; } else { bVar6 = 1; } pLVar11->_visible = bVar6; iVar13 = in_ECX[1]; } iVar9 = 0x140; if (iVar13 != 1) { iVar9 = 0x2c; } pLVar11 = ANM2::GetLayer((ANM2 *)(iVar9 + (int)in_ECX),(byte *)"ShowPasswordKey"); if (pLVar11 != (LayerState *)0x0) { if (((bVar4 == 0) || (local_14 != 0)) || ((char)in_ECX[0x515] != '\0')) { bVar4 = 0; } else { bVar4 = 1; } pLVar11->_visible = bVar4; iVar13 = in_ECX[1]; } iVar9 = 0x249; if (iVar13 != 1) { iVar9 = 0x135; } if (*(char *)(iVar9 + (int)in_ECX) != '\0') { iVar9 = 0x170; if (iVar13 != 1) { iVar9 = 0x5c; } AnimationState::Update((AnimationState *)(iVar9 + (int)in_ECX)); iVar9 = 400; if (iVar13 != 1) { iVar9 = 0x7c; } AnimationState::Update((AnimationState *)((int)in_ECX + iVar9)); } ExceptionList = local_10; return; } //@@ 009b7190 PauseScreen::Render /* DB: Game::Render calls it when _pauseScreen.state != 0; layers "Menu Title", "SeedPaper", CompletionWidget, sprite at +0x140/+0x2c by mode (this+4) prototype: REPENTOGON */ void __thiscall PauseScreen::Render(PauseScreen *this) { byte bVar1; LayerState *layer; LayerState *targetLayer; float *widgetNullFrame; int spriteOffset; int iVar2; byte *layerName; Game *game; Vector local_18; Vector renderPos; game = g_game; if ((*(int *)&g_game->_roomTransition == 0) || ((g_game->_roomTransition)._bossIntroBossId == 0)) { iVar2 = this->_menuType; spriteOffset = 0x140; if (iVar2 != 1) { spriteOffset = 0x2c; } local_18.x = (float)ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c),(byte *)"Menu Title"); if ((LayerState *)local_18.x != (LayerState *)0x0) { if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || ((game->_dailyChallenge)._id != 0)) { bVar1 = 0; } else { bVar1 = 1; } ((LayerState *)local_18.x)->_visible = bVar1; iVar2 = this->_menuType; } spriteOffset = 0x140; if (iVar2 != 1) { spriteOffset = 0x2c; } layer = ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c),(byte *)"SeedPaper"); if (layer != (LayerState *)0x0) { layer->_visible = (game->_dailyChallenge)._id == 0; iVar2 = this->_menuType; } renderPos.x = g_screenWidth * 0.6; renderPos.y = g_screenHeight * 0.5; if (iVar2 == 1) { renderPos.x = g_screenWidth * 0.7; renderPos.y = g_screenHeight - g_screenHeight * 0.025; } switch(this->_state) { case 1: case 4: spriteOffset = 0x140; if (iVar2 != 1) { spriteOffset = 0x2c; } ANM2::Render((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c), &renderPos,&g_vectorZero,&g_vectorZero); render_lobby_buttons(this,&renderPos); iVar2 = 0x170; if (this->_menuType != 1) { iVar2 = 0x5c; } layer = AnimationState::GetLayerFrame ((AnimationState *) ((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),1); local_18.x = (float)layer; if ((layer != (LayerState *)0x0) && (this->_menuType != 1)) { layerName = (byte *)0x0; if (*(int *)&this->field_0x2d4 != 0) { do { targetLayer = ANM2::GetLayer((ANM2 *)&this->field_0x254,layerName); (targetLayer->_pos).x = *(float *)((layer->_spriteSheetPath)._buf + 8); (targetLayer->_pos).y = *(float *)((layer->_spriteSheetPath)._buf + 0xc); targetLayer = ANM2::GetLayer((ANM2 *)&this->field_0x254,layerName); layerName = layerName + 1; (targetLayer->_size).x = (float)(layer->_spriteSheetPath)._size; (targetLayer->_size).y = (float)(layer->_spriteSheetPath)._capacity; } while (layerName < *(byte **)&this->field_0x2d4); } ANM2::Render((ANM2 *)&this->field_0x254,&renderPos,&g_vectorZero,&g_vectorZero); } iVar2 = 0x170; render_seed_paper(&renderPos); game = g_game; bVar1 = Game::IsInTimedSet(g_game,10); if (bVar1 == 0) { if (this->_menuType == 0) { render_my_stuff(this,&renderPos); game = g_game; } if (((0 < *(int *)&this->field_0xfa8) && ((game->_seedEffects)._isCustomRun == 0)) && (bVar1 = Seeds::AchievementUnlocksDisallowed(&game->_seedEffects), bVar1 == 0)) { spriteOffset = 0x174; if (this->_menuType != 1) { spriteOffset = 0x60; } if (*(int *)((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c) != 0) { if (this->_menuType != 1) { iVar2 = 0x5c; } widgetNullFrame = AnimationState::GetNullFrame ((AnimationState *) ((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c), (byte *)"CompletionWidget"); if (widgetNullFrame != (float *)0x0) { local_18.x = renderPos.x + *widgetNullFrame; local_18.y = renderPos.y + widgetNullFrame[1]; CompletionWidget::Render ((CompletionWidget *)&this->field_0xe90,&local_18, (Vector *)(widgetNullFrame + 4)); GenericPrompt::Render(&this->_genericPrompt); return; } } } } break; case 2: Menu_Options::Render((Menu_Options *)&this->field_0x5b0); GenericPrompt::Render(&this->_genericPrompt); return; case 3: render_items_page(); GenericPrompt::Render(&this->_genericPrompt); return; case 5: InviteFriendsMenu::Render(); GenericPrompt::Render(&this->_genericPrompt); return; case 6: kick_player_menu_render(); } GenericPrompt::Render(&this->_genericPrompt); } return; } //@@ 009b7500 PopupWindow::hide /* DB: ? if shown (this[0]) and current anim (mode this[1]==1 ? +0x174 : +0x60) not "Dissapear": plays sound 0x12 and "Dissapear" on the mode's sprite; DeathScreen::Show, PauseScreen::Update, online_chat_window_update prototype: db/protos.zhl */ void __thiscall PopupWindow::hide(void *this) { byte bVar1; Manager *pMVar2; int iVar3; byte *pbVar4; uint uVar5; char *pcVar6; int iVar7; int iVar8; bool bVar9; int local_8; pMVar2 = g_manager; if (*(int *)this != 0) { iVar7 = *(int *)((int)this + 4); iVar8 = 0x174; iVar3 = 0x174; if (iVar7 != 1) { iVar3 = 0x60; } if (*(int *)(iVar3 + (int)this) != 0) { iVar3 = 0x184; if (iVar7 != 1) { iVar3 = 0x70; } if (*(char *)(iVar3 + (int)this) == '\0') { if (iVar7 != 1) { iVar8 = 0x60; } pbVar4 = *(byte **)(iVar8 + (int)this); if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar6 = "Dissapear"; do { bVar1 = *pbVar4; bVar9 = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_009b75c6: uVar5 = -(uint)bVar9 | 1; goto LAB_009b75cb; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar9 = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_009b75c6; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_009b75cb: if (uVar5 == 0) { return; } } else { if (iVar7 != 1) { iVar8 = 0x60; } pbVar4 = *(byte **)(iVar8 + (int)this); if (0xf < *(uint *)(pbVar4 + 0x14)) { pbVar4 = *(byte **)pbVar4; } pcVar6 = "Dissapear"; do { bVar1 = *pbVar4; bVar9 = bVar1 < (byte)*pcVar6; if (bVar1 != *pcVar6) { LAB_009b7580: uVar5 = -(uint)bVar9 | 1; goto LAB_009b7585; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar9 = bVar1 < (byte)pcVar6[1]; if (bVar1 != pcVar6[1]) goto LAB_009b7580; pbVar4 = pbVar4 + 2; pcVar6 = pcVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_009b7585: if (uVar5 == 0) { return; } } } local_8 = 0x12; seed_fart_sound_override(&local_8); SoundEffects::Play(&pMVar2->_sfxManager,local_8,0.7,2,0,1.0,0.0); iVar7 = 0x140; if (*(int *)((int)this + 4) != 1) { iVar7 = 0x2c; } ANM2::Play((ANM2 *)(iVar7 + (int)this),(byte *)"Dissapear",0); iVar7 = 400; if (*(int *)((int)this + 4) != 1) { iVar7 = 0x7c; } AnimationState::SetAnimationData((AnimationState *)(iVar7 + (int)this),(void *)0x0); } return; } //@@ 009b7650 is_single_player /* DB: ? player vector at 0x4b3d8 size<=1 prototype: db/protos.zhl */ byte __thiscall is_single_player(void *this) { if (*(int *)this != 0) { if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || (((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager & 0xfffffffcU) == 4)) { return 1; } } return 0; } //@@ 009b7680 PauseScreen::Show /* DB: ? sets this+4=1 and resets a timer, anims Appear/Blood/Invite (Repentance+ pause menu invite option), SFXManager::StopLoopingSounds; called from Game::Update when pausing, sits with PauseScreen::Init (0x9b5840) and the #QUIT_DAILY_RUN pause update 0x9b5d20 prototype: REPENTOGON */ void __thiscall PauseScreen::Show(PauseScreen *this) { byte bVar1; int iVar2; Entity_Player *player; LayerState *bloodLayer; uint playerIdx; int *playerSlot; uint playerCount; int iVar3; ANM2 *menuSprite; int menuType; float statLevel; Vector local_10; Game *game; Manager *manager; local_10.x = 0.0; local_10.y = 0.0; Menu_Options::Init((Menu_Options *)&this->field_0x5b0,&local_10,1); manager = g_manager; this->_menuType = 1; this->_playerIdx = 0; game = g_game; if (manager->_netplayManager != *(NetplayManager *)(manager + 1)) { FUN_0090b070(); iVar2 = FUN_004253d0(); playerSlot = (game->_playerManager)._playerList._begin; playerIdx = 0; playerCount = (int)(game->_playerManager)._playerList._end - (int)playerSlot >> 2; if (playerCount != 0) { do { if (*playerSlot == iVar2) goto LAB_009b7713; playerIdx = playerIdx + 1; playerSlot = playerSlot + 1; } while (playerIdx < playerCount); } playerIdx = 0xffffffff; LAB_009b7713: this->_playerIdx = playerIdx; manager = g_manager; } SFXManager::StopLoopingSounds(&manager->_sfxManager); FUN_006f4170(); iVar2 = 0x140; this->_state = 1; iVar3 = 0x140; *(undefined4 *)&this->field_0x8 = 2; if (this->_menuType != 1) { iVar3 = 0x2c; } menuSprite = (ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c); bVar1 = ANM2::SetAnimation(menuSprite,(byte *)"Appear",1); if (bVar1 != 0) { AnimationState::Rewind(&menuSprite->_animState); (menuSprite->_animState)._isPlaying = 1; } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { player = Game::GetPlayer(g_game,this->_playerIdx); } else { iVar3 = FUN_0090b070(); if (iVar3 == 0) goto LAB_009b77c7; FUN_0090b070(); player = (Entity_Player *)FUN_004253d0(); if (player == (Entity_Player *)0x0) goto LAB_009b77c7; } *(int *)&this->field_0xe90 = player->_playerType; LAB_009b77c7: manager = g_manager; local_10.x = 2.38221e-44; seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&manager->_sfxManager,(int)local_10.x,0.7,2,0,1.0,0.0); player = Game::GetPlayer(g_game,this->_playerIdx); statLevel = player->_movespeed * 4.5 - 2.0; if (statLevel <= 0.0) { statLevel = 0.0; } if (7.0 <= statLevel) { statLevel = 7.0; } *(int *)&this->field_0xc = (int)statLevel; statLevel = pow(30.0 / (player->_maxfiredelay + 1.0),0.75); statLevel = statLevel * 2.120391 - 2.0; if (statLevel <= 0.0) { statLevel = 0.0; } if (7.0 <= statLevel) { statLevel = 7.0; } *(int *)&this->field_0x10 = (int)statLevel; statLevel = pow(player->_damage,0.56); iVar3 = 0x140; statLevel = statLevel * 2.231179 - 2.0; if (statLevel <= 0.0) { statLevel = 0.0; } if (7.0 <= statLevel) { statLevel = 7.0; } *(int *)&this->field_0x14 = (int)statLevel; statLevel = (player->_tearrange - 230.0) / 60.0 + 2.0; if (statLevel <= 0.0) { statLevel = 0.0; } if (7.0 <= statLevel) { statLevel = 7.0; } *(int *)&this->field_0x18 = (int)statLevel; statLevel = player->_shotspeed * 5.0 - 2.5; if (statLevel <= 0.0) { statLevel = 0.0; } if (7.0 <= statLevel) { statLevel = 7.0; } *(int *)&this->field_0x1c = (int)statLevel; statLevel = player->_luck + 2.5; menuType = this->_menuType; if (statLevel <= 0.0) { statLevel = 0.0; } if (7.0 <= statLevel) { statLevel = 7.0; } *(int *)&this->field_0x20 = (int)statLevel; if (menuType != 1) { iVar3 = 0x2c; } local_10.x = (float)ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c),(byte *)"Invite"); if ((LayerState *)local_10.x != (LayerState *)0x0) { ((LayerState *)local_10.x)->_visible = g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1); menuType = this->_menuType; } iVar3 = 0x140; if (menuType != 1) { iVar3 = 0x2c; } local_10.x = (float)ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c),&DAT_00b79bb0); if ((LayerState *)local_10.x != (LayerState *)0x0) { if ((g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) || ((uint)((int)*(NetplayManager *)(g_manager + 1) - (int)g_manager->_netplayManager >> 2) < 2)) { bVar1 = 0; } else { bVar1 = 1; } ((LayerState *)local_10.x)->_visible = bVar1; menuType = this->_menuType; } if (menuType != 1) { iVar2 = 0x2c; } bloodLayer = ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),(byte *)"Blood"); if (bloodLayer != (LayerState *)0x0) { bloodLayer->_visible = g_game->_difficulty == 1; } *(undefined4 *)&this->field_0x24 = 0; return; } //@@ 009b7a20 PauseScreen::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called by graphics-reload helper FUN_00954710 (with Manager::load_fonts, AchievementOverlay::load_graphics) when g_game; loads gfx/ui/PauseScreen(.anm2|_small), Death Screen.anm2, PauseScreenStats.anm2, menu_mystuff.png into this+0x2c */ void PauseScreen::load_graphics(void) { byte bVar1; char isLastRef; byte *curAnimName; LayerState *layer; void *image; int in_ECX; char *pcVar2; uint uVar3; byte *curAnimName; ANM2 *diarySprite; bool isLess; undefined1 loadedImage [4]; int *loadedImageRefCount; int savedThis; std_string deathScreenPath; std_string anm2Path; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; int pauseScreen; puStack_20 = loadedImage + 0x5c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0e735; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(loadedImage + 0x50); ExceptionList = &local_1c; anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; savedThis = in_ECX; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x17; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PauseScreen.anm2",0x18); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 0x2c),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pcVar2 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1d; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PauseScreen_small.anm2",0x1e); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x140),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pcVar2 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x1c; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/PauseScreenStats.anm2",0x1d); local_14 = 2; ANM2::Load((ANM2 *)(in_ECX + 0x254),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pcVar2 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } GenericPrompt::Initialize((GenericPrompt *)(in_ECX + 0x47c),1); diarySprite = (ANM2 *)(in_ECX + 0x368); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; anm2Path._buf[1] = '\0'; anm2Path._buf[2] = '\0'; anm2Path._buf[3] = '\0'; anm2Path._buf._0_4_ = std::_Allocate(0x20); anm2Path._size = 0x18; anm2Path._capacity = 0x1f; builtin_strncpy((char *)anm2Path._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14 = 3; ANM2::Load(diarySprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; pcVar2 = (char *)anm2Path._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(anm2Path._buf._0_4_ + -4); uVar3 = anm2Path._capacity + 0x24; if ((char *)0x1f < (char *)(anm2Path._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } curAnimName = *(byte **)(in_ECX + 0x39c); if (curAnimName == (byte *)0x0) { LAB_009b7d75: bVar1 = ANM2::SetAnimation(diarySprite,(byte *)"Diary",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x398)); *(undefined1 *)(in_ECX + 0x3ac) = 1; } } else { curAnimName = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } pcVar2 = "Diary"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_009b7d62: uVar3 = -(uint)isLess | 1; goto LAB_009b7d67; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_009b7d62; curAnimName = curAnimName + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009b7d67: if ((uVar3 != 0) || ((curAnimName[0x34] != 0 && (*(char *)(in_ECX + 0x3ac) == '\0')))) goto LAB_009b7d75; } curAnimName = (byte *)0x0; do { layer = ANM2::GetLayer(diarySprite,curAnimName); curAnimName = curAnimName + 1; layer->_visible = 0; } while ((int)curAnimName < 7); layer = ANM2::GetLayer(diarySprite,&DAT_00000006); layer->_visible = 1; image = Manager::LoadImage(loadedImage,(byte *)"gfx/ui/menu_mystuff.png"); pauseScreen = savedThis; local_14 = 4; KAGE::SmartPointer::operator_assign((void *)(savedThis + 0xe88),image); local_14 = 5; if (loadedImageRefCount != (int *)0x0) { isLastRef = (**(code **)(*loadedImageRefCount + 0xc))(); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(loadedImage); } } local_14 = 0xffffffff; Menu_Options::load_menu_anm2(); diarySprite = (ANM2 *)(pauseScreen + 0xc50); deathScreenPath._size = 0; deathScreenPath._capacity = 0xf; deathScreenPath._buf[0] = '\0'; deathScreenPath._buf[1] = '\0'; deathScreenPath._buf[2] = '\0'; deathScreenPath._buf[3] = '\0'; deathScreenPath._buf._0_4_ = std::_Allocate(0x20); deathScreenPath._size = 0x18; deathScreenPath._capacity = 0x1f; builtin_strncpy((char *)deathScreenPath._buf._0_4_,"gfx/ui/Death Screen.anm2",0x19); local_14 = 6; ANM2::Load(diarySprite,&deathScreenPath,1); local_14 = 0xffffffff; if (0xf < deathScreenPath._capacity) { uVar3 = deathScreenPath._capacity + 1; pcVar2 = (char *)deathScreenPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(deathScreenPath._buf._0_4_ + -4); uVar3 = deathScreenPath._capacity + 0x24; if ((char *)0x1f < (char *)(deathScreenPath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } curAnimName = *(byte **)(pauseScreen + 0xc84); deathScreenPath._size = 0; deathScreenPath._capacity = 0xf; deathScreenPath._buf._0_4_ = deathScreenPath._buf._0_4_ & 0xffffff00; if (curAnimName != (byte *)0x0) { curAnimName = curAnimName; if (0xf < *(uint *)(curAnimName + 0x14)) { curAnimName = *(byte **)curAnimName; } pcVar2 = "Diary"; do { bVar1 = *curAnimName; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_009b7f03: uVar3 = -(uint)isLess | 1; goto LAB_009b7f08; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_009b7f03; curAnimName = curAnimName + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009b7f08: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*(char *)(pauseScreen + 0xc94) != '\0')))) goto LAB_009b7f34; } bVar1 = ANM2::SetAnimation(diarySprite,(byte *)"Diary",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(pauseScreen + 0xc80)); *(undefined1 *)(pauseScreen + 0xc94) = 1; } LAB_009b7f34: curAnimName = (byte *)0x0; if (*(int *)(savedThis + 0xcd0) != 0) { do { layer = ANM2::GetLayer(diarySprite,curAnimName); curAnimName = curAnimName + 1; layer->_visible = 0; } while (curAnimName < *(byte **)(savedThis + 0xcd0)); } layer = ANM2::GetLayer(diarySprite,(byte *)"Items"); layer->_visible = 1; ExceptionList = local_1c; return; } //@@ 009b7f90 PauseScreen::update_stuff_arrows /* DB: toggles "StuffArrow1"/"StuffArrow2" layers of the pause sprite (+0x140 or +0x2c by mode this+4, same pattern as PauseScreen::Render) from the scroll index +0x24 vs the player's (+0xfac) collectible history count; netplay_lobby_menu_update */ void PauseScreen::update_stuff_arrows(void) { void *pvVar1; byte bVar2; Entity_Player *pEVar3; ItemConfig_Item *pIVar4; Entity_Player *this; LayerState *pLVar5; int in_ECX; void *pvVar6; int iVar7; int iVar8; int iVar9; int local_14; int local_10; iVar9 = *(int *)(in_ECX + 4); if (iVar9 == 0) { pEVar3 = Game::GetPlayer(g_game,*(uint *)(in_ECX + 0xfac)); pvVar6 = (pEVar3->_history)._historyItems._end; pvVar1 = (pEVar3->_history)._historyItems._begin; iVar7 = ((int)pvVar6 - (int)pvVar1) / 0x1c; iVar9 = iVar7 + -0x18; local_10 = 0; if (0 < iVar9) { local_10 = iVar9; } if (iVar7 != 0) { local_14 = 0; pvVar6 = (void *)((int)pvVar6 + *(int *)(in_ECX + 0x24) * -0x1c); if (pvVar6 != pvVar1) { do { if (0x17 < local_14) break; if (*(char *)((int)pvVar6 + -0x18) == '\0') { iVar9 = *(int *)((int)pvVar6 + -0x14); } else { iVar9 = 0; } pIVar4 = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar9); if (pIVar4 == (ItemConfig_Item *)0x0) { LAB_009b8065: local_10 = local_10 + -1; } else { this = Game::GetPlayer(g_game,*(uint *)(in_ECX + 0xfac)); bVar2 = Entity_Player::HasCollectible(this,iVar9,0); if (bVar2 == 0) goto LAB_009b8065; local_14 = local_14 + 1; } pvVar6 = (void *)((int)pvVar6 + -0x1c); } while (pvVar6 != (pEVar3->_history)._historyItems._begin); } } iVar7 = 0x140; iVar9 = 0x140; if (*(int *)(in_ECX + 4) != 1) { iVar9 = 0x2c; } pLVar5 = ANM2::GetLayer((ANM2 *)(iVar9 + in_ECX),(byte *)"StuffArrow1"); if (pLVar5 != (LayerState *)0x0) { pLVar5->_visible = 0 < *(int *)(in_ECX + 0x24); } if (*(int *)(in_ECX + 4) != 1) { iVar7 = 0x2c; } pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + iVar7),(byte *)"StuffArrow2"); if (pLVar5 != (LayerState *)0x0) { pLVar5->_visible = *(int *)(in_ECX + 0x24) < local_10; return; } } else { iVar8 = 0x140; iVar7 = 0x140; if (iVar9 != 1) { iVar7 = 0x2c; } pLVar5 = ANM2::GetLayer((ANM2 *)(iVar7 + in_ECX),(byte *)"StuffArrow1"); if (pLVar5 != (LayerState *)0x0) { pLVar5->_visible = 0; iVar9 = *(int *)(in_ECX + 4); } if (iVar9 != 1) { iVar8 = 0x2c; } pLVar5 = ANM2::GetLayer((ANM2 *)(in_ECX + iVar8),(byte *)"StuffArrow2"); if (pLVar5 != (LayerState *)0x0) { pLVar5->_visible = 0; } } return; } //@@ 009b8130 PauseScreen::render_seed_paper /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX=PauseScreen (sprite +0x140 when _menuType (+4) == 1 else +0x2c, same pattern as PauseScreen::Update); only caller PauseScreen::Render (9b7383); shows the "SeedPaper" layer when no daily challenge, draws Seeds::Seed2String at a null frame with Font::DrawStringScaled ("Error: Game Start Seed was not set.") */ void PauseScreen::render_seed_paper(float *param_1) { LayerState *seedPaperLayer; float *nullFrame; void *settings; std_string *psVar1; void *settings_00; int in_ECX; int iVar2; KColor *color; size_t *psVar3; KColor *color_00; uint uVar4; FontSettings secondHalfSettings [7]; FontSettings firstHalfSettings [5]; undefined4 local_80; undefined4 local_7c; KColor textColor; Vector secondLinePos; Vector firstLinePos; size_t local_54; size_t local_50; std_string *seedString [4]; uint seedStringSize; uint seedStringCapacity; byte halfText [16]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; undefined4 local_14; Game *game; Manager *manager; puStack_20 = halfText + 0x30; local_14 = 0xffffffff; puStack_18 = &DAT_00b0e783; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(halfText + 0x24); ExceptionList = &local_1c; iVar2 = 0x140; if (*(int *)(in_ECX + 4) != 1) { iVar2 = 0x2c; } seedPaperLayer = ANM2::GetLayer((ANM2 *)(iVar2 + in_ECX),(byte *)"SeedPaper"); if (seedPaperLayer != (LayerState *)0x0) { if ((g_game->_dailyChallenge)._id == 0) { seedPaperLayer->_visible = 1; iVar2 = 0x170; if (*(int *)(in_ECX + 4) != 1) { iVar2 = 0x5c; } nullFrame = AnimationState::GetNullFrame((AnimationState *)(iVar2 + in_ECX),&DAT_00b7562c); game = g_game; if (nullFrame != (float *)0x0) { firstLinePos.x = *nullFrame + *param_1; firstLinePos.y = nullFrame[1] + param_1[1]; uVar4 = (g_game->_seedEffects)._gameStartSeed; secondLinePos.x = firstLinePos.x + 0.0; secondLinePos.y = firstLinePos.y + 15.0; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar4 = (game->_seedEffects)._gameStartSeed; } Seeds::Seed2String((std_string *)seedString,uVar4); local_14 = 0; local_50 = seedStringSize; local_54 = 4; psVar3 = &local_50; if (3 < seedStringSize) { psVar3 = &local_54; } halfText[0] = 0; halfText[1] = 0; halfText[2] = 0; halfText[3] = 0; halfText[4] = 0; halfText[5] = 0; halfText[6] = 0; halfText[7] = 0; halfText[8] = 0; halfText[9] = 0; halfText[10] = 0; halfText[0xb] = 0; halfText[0xc] = 0; halfText[0xd] = 0; halfText[0xe] = 0; halfText[0xf] = 0; psVar1 = (std_string *)seedString; if (0xf < seedStringCapacity) { psVar1 = seedString[0]; } memcpy(halfText,psVar1,*psVar3); manager = g_manager; FontSettings::constructor(firstHalfSettings); local_14._0_1_ = 1; KColor::SetFromARGB(&textColor,0xff362f2d); Font::DrawStringScaled(&manager->_font2_TeamMeatEx12,halfText,&firstLinePos,color,settings); local_50 = 4; local_54 = seedStringSize - 4; local_80 = 0; psVar3 = &local_54; if (3 < seedStringSize - 4) { psVar3 = &local_50; } local_7c = 0; psVar1 = (std_string *)seedString; if (0xf < seedStringCapacity) { psVar1 = seedString[0]; } halfText[0] = 0; halfText[1] = 0; halfText[2] = 0; halfText[3] = 0; halfText[4] = 0; halfText[5] = 0; halfText[6] = 0; halfText[7] = 0; halfText[8] = 0; halfText[9] = 0; halfText[10] = 0; halfText[0xb] = 0; halfText[0xc] = 0; halfText[0xd] = 0; halfText[0xe] = 0; halfText[0xf] = 0; memcpy(halfText,psVar1->_buf + 5,*psVar3); manager = g_manager; FontSettings::constructor(secondHalfSettings); local_14 = CONCAT31(local_14._1_3_,2); KColor::SetFromARGB(&textColor,0xff362f2d); Font::DrawStringScaled (&manager->_font2_TeamMeatEx12,halfText,&secondLinePos,color_00,settings_00); if (0xf < seedStringCapacity) { uVar4 = seedStringCapacity + 1; psVar1 = seedString[0]; if (0xfff < uVar4) { psVar1 = (std_string *)seedString[0][-1]._capacity; uVar4 = seedStringCapacity + 0x24; if (0x1f < (uint)((int)seedString[0] + (-4 - (int)psVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar1,uVar4); } } } else { seedPaperLayer->_visible = 0; } } ExceptionList = local_1c; return; } //@@ 009b83a0 PauseScreen::render_my_stuff /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: only caller PauseScreen::Render (0x9b73ac, ECX=this); renders layers MyStuff/StuffArrow1/StuffArrow2 of sprite +0x140/+0x2c, ModManager::RenderCustomCollectionItem, ItemConfig::GetCollectible per player item prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall PauseScreen::render_my_stuff(PauseScreen *this,Vector *pos) { byte bVar1; int iVar2; int iVar3; LayerState *pLVar4; Sprite *menuSprite; void *pvVar5; Entity_Player *pEVar6; ItemConfig_Item *itemConfig; int iVar7; ANM2 *pAVar8; undefined1 *puVar9; undefined4 blendMode; undefined4 uStack_90; undefined4 uStack_8c; undefined4 uStack_88; undefined4 local_84; Vector modIconPos; Vector itemScale; Vector iconPos; History *history; float scaleY; float scaleX; Sprite *local_5c; undefined1 *local_58; float slotY; uint collectibleId; LayerState *local_4c; LayerState *local_48; Vector *local_44; ColorMod iconColor; float local_14; local_14 = (float)(__security_cookie ^ (uint)((&iconColor)[1]._tint + 1)); local_44 = pos; local_58 = &this->field_0x140; iVar2 = 0x140; if (this->_menuType != 1) { iVar2 = 0x2c; } local_5c = (Sprite *)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c); local_4c = ANM2::GetLayer((ANM2 *)local_5c,(byte *)"MyStuff"); if (local_4c != (LayerState *)0x0) { if (local_4c->_layerData == (int *)0x0) { iVar2 = -1; } else { iVar2 = *(int *)local_4c->_layerData; } Sprite::RenderLayer(local_5c,iVar2,pos,&g_vectorZero,&g_vectorZero); iVar2 = this->_menuType; iVar3 = 0x140; if (iVar2 != 1) { iVar3 = 0x2c; } local_48 = ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c),(byte *)"StuffArrow1"); if (local_48 != (LayerState *)0x0) { menuSprite = (Sprite *)&this->field_0x2c; if (iVar2 == 1) { menuSprite = (Sprite *)&this->field_0x140; } if (local_48->_layerData == (int *)0x0) { iVar2 = -1; } else { iVar2 = *(int *)local_48->_layerData; } Sprite::RenderLayer(menuSprite,iVar2,local_44,&g_vectorZero,&g_vectorZero); iVar2 = this->_menuType; } pAVar8 = (ANM2 *)&this->field_0x2c; if (iVar2 == 1) { pAVar8 = (ANM2 *)&this->field_0x140; } pLVar4 = ANM2::GetLayer(pAVar8,(byte *)"StuffArrow2"); if (pLVar4 != (LayerState *)0x0) { menuSprite = (Sprite *)&this->field_0x2c; if (iVar2 == 1) { menuSprite = (Sprite *)&this->field_0x140; } if (pLVar4->_layerData == (int *)0x0) { iVar2 = -1; } else { iVar2 = *(int *)pLVar4->_layerData; } Sprite::RenderLayer(menuSprite,iVar2,local_44,&g_vectorZero,&g_vectorZero); iVar2 = this->_menuType; } puVar9 = &this->field_0x2c; if (iVar2 == 1) { puVar9 = local_58; } if (local_4c->_layerData == (int *)0x0) { iVar2 = -1; } else { iVar2 = *(int *)local_4c->_layerData; } pvVar5 = AnimationState::GetLayerFrame((AnimationState *)(puVar9 + 0x30),iVar2); if (pvVar5 != (void *)0x0) { local_58 = (undefined1 *)(local_44->x + *(float *)((int)pvVar5 + 0x10)); local_5c = (Sprite *)(local_44->y + *(float *)((int)pvVar5 + 0x14)); itemScale.x = *(float *)((int)pvVar5 + 0x18); itemScale.y = *(float *)((int)pvVar5 + 0x1c); scaleY = itemScale.y; scaleX = itemScale.x; pEVar6 = Game::GetPlayer(g_game,this->_playerIdx); history = &pEVar6->_history; local_44 = (Vector *)g_vectorZero.x; slotY = g_vectorZero.y; if (local_48->_layerData == (int *)0x0) { iVar2 = -1; } else { iVar2 = *(int *)local_48->_layerData; } pvVar5 = AnimationState::GetLayerFrame((AnimationState *)&this->field_0x398,iVar2); if (pvVar5 != (void *)0x0) { local_4c = *(LayerState **)((int)pvVar5 + 0x10); local_48 = *(LayerState **)((int)pvVar5 + 0x14); pLVar4 = ANM2::GetLayer((ANM2 *)&this->field_0x368,&DAT_00000006); (pLVar4->_pos).x = -(float)local_4c; (pLVar4->_pos).y = -(float)local_48; pLVar4 = ANM2::GetLayer((ANM2 *)&this->field_0x368,&DAT_00000006); (pLVar4->_size).x = scaleX; (pLVar4->_size).y = scaleY; } local_48 = (LayerState *)0x0; pvVar5 = (void *)((int)(history->_historyItems)._end + *(int *)&this->field_0x24 * -0x1c); if (pvVar5 != (history->_historyItems)._begin) { do { if (0x17 < (int)local_48) { return; } if (*(char *)((int)pvVar5 + -0x18) == '\0') { collectibleId = *(uint *)((int)pvVar5 + -0x14); } else { collectibleId = 0; } itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if (itemConfig != (ItemConfig_Item *)0x0) { pEVar6 = Game::GetPlayer(g_game,this->_playerIdx); bVar1 = Entity_Player::HasCollectible(pEVar6,collectibleId,0); if (bVar1 != 0) { if ((int)collectibleId < 0) { collectibleId = 0x1b9; } local_48 = (LayerState *)((int)local_48 + 1); if (collectibleId < 0x2dd) { if ((*(int *)&this->field_0x39c != 0) && ((6 < *(int *)(*(int *)&this->field_0x398 + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 6 < *(int *)(*(int *)&this->field_0x398 + 0x80))))) { iVar2 = *(int *)&this->field_0x39c; local_4c = *(LayerState **)(iVar2 + 0x50); if ((iVar2 == 0) || (((int)local_4c < 0 || (*(int *)(iVar2 + 0x1c) <= (int)local_4c)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)(*(int *)&this->field_0x3a0 + (int)local_4c * 4) = 0; AnimationState::AdvanceLayerPosition ((AnimationState *)&this->field_0x398,(int)local_4c, (float)(int)(collectibleId - 1)); } iconPos.x = ((float)local_44 - 36.0) * scaleX + (float)local_58; iconPos.y = (slotY - 15.0) * scaleY + (float)local_5c; if (this->field_0x471 != '\0') { if (this->field_0x3d8 == '\0') { iVar2 = *(int *)&this->field_0x39c; if (((iVar2 != 0) && (6 < (*(ANM2 **)&this->field_0x398)->_layerCount)) && (iVar3 = *(int *)(iVar2 + 0x50), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar2 + 0x18)),&iconPos, *(int *)(*(int *)&this->field_0x3a0 + iVar3 * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)&this->field_0x398); } iVar2 = *(int *)&this->field_0x3bc; if (((iVar2 != 0) && (pAVar8 = *(ANM2 **)&this->field_0x3b8, 6 < pAVar8->_layerCount)) && (iVar3 = *(int *)(iVar2 + 0x50), -1 < iVar3)) { iVar7 = *(int *)&this->field_0x3c0; goto LAB_009b8908; } } else { iVar2 = *(int *)&this->field_0x3bc; if (((iVar2 != 0) && (6 < (*(ANM2 **)&this->field_0x3b8)->_layerCount)) && (iVar3 = *(int *)(iVar2 + 0x50), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar2 + 0x18)),&iconPos, *(int *)(*(int *)&this->field_0x3c0 + iVar3 * 4),&g_vectorZero, &g_vectorZero,*(ANM2 **)&this->field_0x3b8); } iVar2 = *(int *)&this->field_0x39c; if (((iVar2 != 0) && (pAVar8 = *(ANM2 **)&this->field_0x398, 6 < pAVar8->_layerCount)) && (iVar3 = *(int *)(iVar2 + 0x50), -1 < iVar3)) { iVar7 = *(int *)&this->field_0x3a0; LAB_009b8908: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)(iVar2 + 0x18)),&iconPos, *(int *)(iVar7 + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar8); } } } } else { local_84 = 7; if (((byte)g_graphicsManager_flags & 4) == 0) { uStack_90 = 6; } else { uStack_90 = 1; } blendMode = 0; uStack_8c = 7; uStack_88 = 1; iconColor._offset[0] = 0.0; iconColor._tint[0] = 1.0; iconColor._tint[1] = 1.0; iconColor._tint[2] = 1.0; iconColor._tint[3] = 1.0; iconColor._offset[1] = 0.0; iconColor._offset[2] = 0.0; iconColor._colorize[0] = 0.0; iconColor._colorize[1] = 0.0; iconColor._colorize[2] = 0.0; iconColor._colorize[3] = 0.0; modIconPos.x = ((float)local_44 - 36.0) * scaleX + (float)local_58; modIconPos.y = (slotY - 15.0) * scaleY + (float)local_5c; ModManager::RenderCustomCollectionItem (&g_manager->_modManager,collectibleId,&modIconPos,&itemScale,&iconColor, &blendMode); } local_44 = (Vector *)((float)local_44 + 0.0); slotY = slotY + 16.0; if (64.0 <= slotY) { slotY = slotY - 64.0; local_44 = (Vector *)((float)local_44 + 16.0); } } } pvVar5 = (void *)((int)pvVar5 + -0x1c); } while (pvVar5 != (history->_historyItems)._begin); } } } return; } //@@ 009b8990 PauseScreen::render_lobby_buttons /* WARNING: Type propagation algorithm not settling */ /* DB: only caller PauseScreen::Render (0x9b72d9); layers InviteButton/KickButton/PasswordButton/PasswordPos, lobby_password_render, NetplayManager::IsIdxLocalPlayer, render_input_button_icon prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall PauseScreen::render_lobby_buttons(PauseScreen *this,Vector *pos) { ColorMod color; Vector pos_00; Vector pos_01; Vector pos_02; Vector pos_03; byte bVar1; Entity_Player *player; int iVar2; byte *animName; uint cmpResult; LayerState *buttonLayer; float *nullFrame; byte *idleName; KColor *color_00; int iVar3; int controllerIndex; bool bVar4; undefined4 in_stack_ffffff60; undefined4 in_stack_ffffff64; undefined4 in_stack_ffffff68; undefined4 in_stack_ffffff6c; undefined4 in_stack_ffffff70; undefined4 in_stack_ffffff74; undefined8 *in_stack_ffffff78; float in_stack_ffffff7c; float in_stack_ffffff80; undefined4 in_stack_ffffff84; float in_stack_ffffff88; float fVar5; float fVar6; FontSettings fontSettings; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; KColor textColor; Vector local_30; char isShowPassword; undefined1 *puStack_20; void *local_1c; undefined *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &DAT_00b0e7bd; local_1c = ExceptionList; ExceptionList = &local_1c; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { player = Game::GetPlayer(g_game,this->_playerIdx); local_30.y = (float)player->_controllerIndex; } else { puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_30.y = (float)InputManager::FirstLocalDeviceID(&g_manager->_netplayManager); } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { LAB_009b8a56: isShowPassword = '\0'; } else { player = Game::GetPlayer(g_game,0); if (((g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) && (bVar1 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,player->_controllerIndex), bVar1 == 0)) || (isShowPassword = '\x01', (g_manager->_lobbySettings)._password._size == 0)) goto LAB_009b8a56; } manager = g_manager; if ((this->_state != 1) && (this->_state != 4)) { ExceptionList = local_1c; return; } if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { ExceptionList = local_1c; return; } iVar3 = this->_menuType; iVar2 = 0x174; if (iVar3 != 1) { iVar2 = 0x60; } if (*(int *)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c) != 0) { iVar2 = 0x184; if (iVar3 != 1) { iVar2 = 0x70; } if ((this->_genericPrompt)._sprite._filename._buf[iVar2 + -0x47c] == '\0') { iVar2 = 0x174; if (iVar3 != 1) { iVar2 = 0x60; } animName = *(byte **)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c); if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } idleName = s_Idle; do { bVar1 = *animName; bVar4 = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_009b8af8: cmpResult = -(uint)bVar4 | 1; goto LAB_009b8afd; } if (bVar1 == 0) break; bVar1 = animName[1]; bVar4 = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_009b8af8; animName = animName + 2; idleName = idleName + 2; } while (bVar1 != 0); cmpResult = 0; LAB_009b8afd: if (cmpResult == 0) { fontSettings = (FontSettings)0x0; local_5c = 0xffff; in_stack_ffffff7c = pos->x - 160.0; in_stack_ffffff80 = pos->y - 16.0; local_58 = 0; local_54 = 0x3f800000; local_50 = 0xffffffff; local_4c = 0; local_48 = 0; local_14 = 0; KColor::SetFromARGB(&textColor,0xff362f2d); in_stack_ffffff88 = 0.6; in_stack_ffffff84 = 0x3f19999a; in_stack_ffffff78 = &DAT_00b1bddc; in_stack_ffffff74 = 0x9b8ba1; pos_00.y = in_stack_ffffff80; pos_00.x = in_stack_ffffff7c; Font::DrawString(&manager->_font1_TeamMeatEx10,(byte *)&DAT_00b1bddc,pos_00, (Vector)0x3f19999a3f19999a,color_00,&fontSettings); local_14 = 0xffffffff; } } } if (local_30.y != 0.0) { iVar3 = 0x140; if (this->_menuType != 1) { iVar3 = 0x2c; } buttonLayer = ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c),(byte *)"Invite"); iVar3 = 0x170; if (buttonLayer->_visible != 0) { iVar2 = 0x174; if (this->_menuType != 1) { iVar2 = 0x60; } if (*(int *)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c) == 0) { nullFrame = (float *)0x0; } else { iVar2 = 0x170; if (this->_menuType != 1) { iVar2 = 0x5c; } nullFrame = AnimationState::GetNullFrame ((AnimationState *) ((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c), (byte *)"InviteButton"); } local_30.x = *nullFrame + pos->x; local_30.y = nullFrame[1] + pos->y; iVar2 = FUN_009b5800(); in_stack_ffffff70 = 0; in_stack_ffffff74 = 0; in_stack_ffffff78 = (undefined8 *)0x0; in_stack_ffffff7c = 0.0; in_stack_ffffff80 = 0.0; in_stack_ffffff84 = 0; in_stack_ffffff88 = 0.0; in_stack_ffffff60 = 0x3f800000; in_stack_ffffff64 = 0x3f800000; in_stack_ffffff68 = 0x3f800000; in_stack_ffffff6c = 0x3f800000; pos_01.y = local_30.y; pos_01.x = local_30.x; render_input_button_icon (iVar2,0x18,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_01); } iVar2 = 0x140; if (this->_menuType != 1) { iVar2 = 0x2c; } buttonLayer = ANM2::GetLayer((ANM2 *)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),&DAT_00b79bb0); if (buttonLayer->_visible != 0) { iVar2 = 0x174; if (this->_menuType != 1) { iVar2 = 0x60; } if (*(int *)((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c) == 0) { nullFrame = (float *)0x0; } else { if (this->_menuType != 1) { iVar3 = 0x5c; } nullFrame = AnimationState::GetNullFrame ((AnimationState *) ((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c), (byte *)"KickButton"); } local_30.x = *nullFrame + pos->x; local_30.y = nullFrame[1] + pos->y; iVar3 = FUN_009b5800(); in_stack_ffffff70 = 0; in_stack_ffffff74 = 0; in_stack_ffffff78 = (undefined8 *)0x0; in_stack_ffffff7c = 0.0; in_stack_ffffff80 = 0.0; in_stack_ffffff84 = 0; in_stack_ffffff88 = 0.0; in_stack_ffffff60 = 0x3f800000; in_stack_ffffff64 = 0x3f800000; in_stack_ffffff68 = 0x3f800000; in_stack_ffffff6c = 0x3f800000; pos_02.y = local_30.y; pos_02.x = local_30.x; render_input_button_icon (iVar3,0x1c,0,1, (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_02); } if ((char)this[1]._genericPrompt._sprite._animDefaultName._size != '\0') goto LAB_009b8e1f; if (isShowPassword != '\0') { if (*(int *)&this->field_0x174 == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)&this->field_0x170,(byte *)"PasswordButton"); } local_30.x = *nullFrame + pos->x; local_30.y = nullFrame[1] + pos->y; FUN_009b5800(); fVar5 = local_30.x; fVar6 = local_30.y; Color::Color(0x3f800000); color._tint[1] = (float)in_stack_ffffff64; color._tint[0] = (float)in_stack_ffffff60; color._tint[2] = (float)in_stack_ffffff68; color._tint[3] = (float)in_stack_ffffff6c; color._colorize[0] = (float)in_stack_ffffff70; color._colorize[1] = (float)in_stack_ffffff74; color._colorize[2] = (float)in_stack_ffffff78; color._colorize[3] = in_stack_ffffff7c; color._offset[0] = in_stack_ffffff80; color._offset[1] = (float)in_stack_ffffff84; color._offset[2] = in_stack_ffffff88; pos_03.y = fVar6; pos_03.x = fVar5; render_input_button_icon(controllerIndex,0x1d,0,1,color,pos_03); } } if ((char)this[1]._genericPrompt._sprite._animDefaultName._size == '\0') { ExceptionList = local_1c; return; } LAB_009b8e1f: if (isShowPassword != '\0') { if (*(int *)&this->field_0x174 == 0) { nullFrame = (float *)0x0; } else { nullFrame = AnimationState::GetNullFrame ((AnimationState *)&this->field_0x170,(byte *)"PasswordPos"); } local_30.x = *nullFrame + pos->x; local_30.y = nullFrame[1] + pos->y; lobby_password_render(&(g_manager->_lobbySettings)._password,&local_30,1.0); } ExceptionList = local_1c; return; } //@@ 009b8ea0 PlayerManager::~PlayerManager /* DB: Game::~Game member destroyed where Game::constructor builds _playerManager (Game+0x1baa8): deletes every Entity_Player* in _playerList (vector at +0, virtual deleting dtor), a second owned-ptr vector at +0xd0, the 4 owned pointers at +0x80 (esauJr[4], zeroed in the ctor), then frees the vectors */ void PlayerManager::~PlayerManager(void) { int *in_ECX; int iVar1; int *piVar2; piVar2 = (int *)*in_ECX; if (piVar2 != (int *)in_ECX[1]) { do { if ((undefined4 *)*piVar2 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar2)(1); } piVar2 = piVar2 + 1; } while (piVar2 != (int *)in_ECX[1]); piVar2 = (int *)*in_ECX; } in_ECX[1] = (int)piVar2; piVar2 = (int *)in_ECX[0x34]; if (piVar2 != (int *)in_ECX[0x35]) { do { if ((undefined4 *)*piVar2 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar2)(1); } piVar2 = piVar2 + 1; } while (piVar2 != (int *)in_ECX[0x35]); piVar2 = (int *)in_ECX[0x34]; } in_ECX[0x35] = (int)piVar2; iVar1 = 4; piVar2 = in_ECX + 0x20; do { if ((undefined4 *)*piVar2 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar2)(1); *piVar2 = 0; } piVar2 = piVar2 + 1; iVar1 = iVar1 + -1; } while (iVar1 != 0); FID_conflict__Tidy(in_ECX + 0x34); FID_conflict__Tidy(in_ECX + 0x1c); FID_conflict__Tidy(in_ECX); return; } //@@ 009b8f40 PlayerManager::init_main_player /* DB: ? creates player 0 if the list is empty (operator_new 0x2f00, Entity_Player::constructor), Init vfunc (1,0,playerType,..), pos (320,400), EntityList::AddEntity; resets slot arrays and HUD::AssignPlayerHUDs; callers Game::restore_game_state, 006f6500, 0042a4d0 prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall PlayerManager::init_main_player(PlayerManager *this,int playerType,uint seed) { void **ppvVar1; undefined4 *puVar2; int *piVar3; void *pvVar4; int iVar5; Manager *pMVar6; uint seed_00; uint uVar7; Entity *extraout_EAX; Entity *entity; void *local_10; undefined1 *puStack_c; undefined4 local_8; seed_00 = seed; local_8 = 0xffffffff; puStack_c = &LAB_00b0e7f7; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; (this->_rng)._shift1 = 5; (this->_rng)._shift2 = 7; (this->_rng)._seed = seed; (this->_rng)._shift3 = 0x16; *(undefined4 *)&this->field_0x60 = 0xffffffff; *(undefined4 *)&this->field_0x64 = 0xffffffff; *(undefined4 *)&this->field_0x68 = 0xffffffff; *(undefined4 *)&this->field_0x6c = 0xffffffff; if (playerType != -2) { puVar2 = (this->_playerList)._begin; if (puVar2 == (this->_playerList)._end) { seed = (uint)operator_new(0x2f00); local_8 = 0; if ((Entity_Player *)seed == (Entity_Player *)0x0) { seed = 0; } else { Entity_Player::constructor((Entity_Player *)seed); seed = (uint)extraout_EAX; } local_8 = 0xffffffff; (((Entity *)(seed + 0x143c))->_color)._offset[2] = (float)((int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2); (((Entity *)(seed + 0x143c))->_splatColor)._tint[0] = 0.0; piVar3 = (this->_playerList)._end; if (piVar3 == (this->_playerList)._capacity) { std::vector::_Emplace_reallocate(piVar3,&seed); entity = (Entity *)seed; } else { *piVar3 = seed; ppvVar1 = &(this->_playerList)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); entity = (Entity *)seed; } } else { entity = (Entity *)*puVar2; } (**(code **)(*(int *)entity + 4))(1,0,playerType,seed_00,uVar7); (entity->_pos).x = 320.0; (entity->_pos).y = 400.0; if (entity->_valid == 0) { pvVar4 = g_game->_room; iVar5 = *(int *)((int)pvVar4 + 0x1214); *(int *)((int)pvVar4 + 0x1214) = iVar5 + 1; entity->_index = iVar5; EntityList::AddEntity((EntityList *)((int)pvVar4 + 0x1218),entity); } } this->_coopSlots[0]._controllerIndex = -1; this->_coopSlots[1]._controllerIndex = -1; this->_coopSlots[0]._state = -1; this->_coopSlots[0]._menuPosition = 0.0; this->_coopSlots[0]._playerType = 0; this->_coopSlots[1]._state = -1; this->_coopSlots[1]._menuPosition = 0.0; this->_coopSlots[1]._playerType = 0; this->_coopSlots[2]._controllerIndex = -1; this->_coopSlots[2]._state = -1; this->_coopSlots[2]._menuPosition = 0.0; this->_coopSlots[2]._playerType = 0; this->_coopSlots[3]._controllerIndex = -1; this->_coopSlots[3]._state = -1; this->_coopSlots[3]._menuPosition = 0.0; this->_coopSlots[3]._playerType = 0; *(undefined4 *)&this->field_0x7c = 0; init_random_unlocks(this,seed_00); pMVar6 = g_manager; this->_stageTransitionPlayer = (void *)0x0; this->_roomTransitionPlayer = (void *)0x0; if (pMVar6->_netplayManager == *(NetplayManager *)(pMVar6 + 1)) { HUD::AssignPlayerHUDs(&g_game->_hud); } ExceptionList = local_10; return; } //@@ 009b9150 FUN_009b9150 void FUN_009b9150(void) { undefined4 *puVar1; Entity *entity; void *pvVar2; uint uVar3; int *in_ECX; int iVar4; int *piVar5; in_ECX[0x32] = 0; in_ECX[0x33] = 0; puVar1 = (undefined4 *)*in_ECX; uVar3 = in_ECX[1] - (int)puVar1; while ((uVar3 & 0xfffffffc) != 0) { entity = (Entity *)*puVar1; pvVar2 = g_game->_room; EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1238),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1258),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1248),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1268),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x12a8),entity); entity->_valid = 0; EntityList::invalidate_type_cache ((EntityList *)((int)pvVar2 + 0x1218),entity->_type,entity->_variant,entity->_subtype) ; (*(code *)**(undefined4 **)entity)(1); pvVar2 = (void *)(*in_ECX + 4); memmove((void *)*in_ECX,pvVar2,in_ECX[1] - (int)pvVar2); in_ECX[1] = in_ECX[1] + -4; puVar1 = (undefined4 *)*in_ECX; uVar3 = in_ECX[1] - (int)puVar1; } in_ECX[1] = (int)puVar1; uVar3 = 0; iVar4 = in_ECX[0x34]; if (in_ECX[0x35] - iVar4 >> 2 != 0) { do { puVar1 = *(undefined4 **)(iVar4 + uVar3 * 4); if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); } uVar3 = uVar3 + 1; iVar4 = in_ECX[0x34]; } while (uVar3 < (uint)(in_ECX[0x35] - iVar4 >> 2)); } in_ECX[0x35] = iVar4; piVar5 = in_ECX + 0x20; iVar4 = 4; do { if ((undefined4 *)*piVar5 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar5)(1); *piVar5 = 0; } piVar5 = piVar5 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); in_ECX[0x1f] = 0; *(undefined1 *)(in_ECX + 0x17) = 1; KAGE_LogMessage(1,(byte *)"Clearing player color assignments \n"); iVar4 = 0; piVar5 = in_ECX + 0x18; do { KAGE_LogMessage(1,(byte *)"Clearing player color assignment for color %d \n"); iVar4 = iVar4 + 1; *piVar5 = -1; piVar5 = piVar5 + 1; } while (iVar4 < 4); return; } //@@ 009b92c0 PlayerManager::GetPlayer /* ZHL [exact] __thiscall Entity_Player* PlayerManager::GetPlayer(int param1); prototype: REPENTOGON, confirmed by RET 4 */ Entity_Player * __thiscall PlayerManager::GetPlayer(PlayerManager *this,int param1) { void *pvVar1; undefined4 *puVar2; pvVar1 = (this->_playerList)._end; puVar2 = (this->_playerList)._begin; if ((int)pvVar1 - (int)puVar2 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar1 = (this->_playerList)._end; puVar2 = (this->_playerList)._begin; } if ((uint)param1 < (uint)((int)pvVar1 - (int)puVar2 >> 2)) { return (Entity_Player *)puVar2[param1]; } return (Entity_Player *)*puVar2; } //@@ 009b9310 PlayerManager::get_main_player /* DB: returns the param-th player of the player vector (ECX) counting only players that are not the higher-index twin (_twinPlayer 0x1e68, _playerIndex 0x161c); 0 if out of range; sits between PlayerManager::GetPlayer 009b92c0 and count_main_players 009b9480; Room::SpawnClearAward, RoomTransition::StartBossIntro prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Player * __thiscall PlayerManager::get_main_player(PlayerManager *this,int index) { int *piVar1; int iVar2; int iVar3; uint uVar4; uint uVar5; int iVar6; int *piVar7; piVar1 = (this->_playerList)._begin; iVar6 = 0; uVar4 = 0; uVar5 = (int)(this->_playerList)._end - (int)piVar1 >> 2; if (uVar5 != 0) { piVar7 = piVar1; do { iVar2 = *piVar7; iVar3 = *(int *)(iVar2 + 0x1e68); if ((((iVar3 == 0) || (*(int *)(iVar3 + 0x161c) == -1)) || (*(int *)(iVar2 + 0x161c) <= *(int *)(iVar3 + 0x161c))) || (iVar3 == iVar2)) { if (iVar6 == index) { return (Entity_Player *)piVar1[uVar4]; } iVar6 = iVar6 + 1; } uVar4 = uVar4 + 1; piVar7 = piVar7 + 1; } while (uVar4 < uVar5); } return (Entity_Player *)0x0; } //@@ 009b9380 PlayerManager::get_first_local_main_player /* DB: ? neighbours GetPlayer 009b92c0 / get_main_player 009b9310 PlayerManager::get_main_player count_main_players 009b9480; device +0x370 vfunc +0x14 is the "is local" test (same as InputManager::FirstLocalDeviceID); iterates the player vector (ECX), skips the higher-index member of a twin pair (_twinPlayer 0x1e68 / _playerIndex 0x161c), returns the first whose controller (_controllerIndex 0x1618) has no device entry in Manager+0x4b3d8 or whose device vfunc +0x14 returns true; Camera::update_focus_position, HUD prototype: db/protos.zhl */ Entity_Player * __thiscall PlayerManager::get_first_local_main_player(PlayerManager *this) { EntityPtr EVar1; EntityPtr EVar2; char cVar3; NetplayManager NVar4; uint uVar5; void *pvVar6; uint uVar7; uint local_8; pvVar6 = (this->_playerList)._begin; local_8 = 0; if ((int)(this->_playerList)._end - (int)pvVar6 >> 2 != 0) { do { EVar1 = *(EntityPtr *)((int)pvVar6 + local_8 * 4); EVar2 = *(EntityPtr *)((int)EVar1 + 0x1e68); if ((((EVar2 == (EntityPtr)0x0) || (*(int *)((int)EVar2 + 0x161c) == -1)) || (*(int *)((int)EVar1 + 0x161c) <= *(int *)((int)EVar2 + 0x161c))) || (EVar2 == EVar1)) { NVar4 = g_manager->_netplayManager; if (NVar4 == *(NetplayManager *)(g_manager + 1)) { return (Entity_Player *)EVar1; } uVar7 = (int)*(NetplayManager *)(g_manager + 1) - (int)NVar4 >> 2; uVar5 = 0; if (uVar7 == 0) { return (Entity_Player *)EVar1; } while (*(int *)(*(int *)NVar4 + 0xc) != *(int *)((int)EVar1 + 0x1618)) { uVar5 = uVar5 + 1; NVar4 = (NetplayManager)((int)NVar4 + 4); if (uVar7 <= uVar5) { return (Entity_Player *)EVar1; } } cVar3 = (**(code **)(*(int *)(*(int *)NVar4 + 0x370) + 0x14))(); if (cVar3 != '\0') { return (Entity_Player *)EVar1; } } pvVar6 = (this->_playerList)._begin; local_8 = local_8 + 1; } while (local_8 < (uint)((int)(this->_playerList)._end - (int)pvVar6 >> 2)); } return (Entity_Player *)0x0; } //@@ 009b9450 FUN_009b9450 uint FUN_009b9450(int param_1) { uint uVar1; int *in_ECX; uint uVar2; int *piVar3; piVar3 = (int *)*in_ECX; uVar1 = 0; uVar2 = in_ECX[1] - (int)piVar3 >> 2; if (uVar2 != 0) { do { if (*piVar3 == param_1) { return uVar1; } uVar1 = uVar1 + 1; piVar3 = piVar3 + 1; } while (uVar1 < uVar2); } return 0xffffffff; } //@@ 009b9480 PlayerManager::count_main_players /* DB: ? skips players whose +0x1e68 sibling has lower controller idx prototype: db/protos.zhl */ int __thiscall PlayerManager::count_main_players(PlayerManager *this) { int iVar1; bool bVar2; int iVar3; int iVar4; int iVar5; int *piVar6; piVar6 = (this->_playerList)._begin; iVar3 = 0; for (iVar5 = (int)(this->_playerList)._end - (int)piVar6 >> 2; iVar5 != 0; iVar5 = iVar5 + -1) { iVar4 = *piVar6; iVar1 = *(int *)(iVar4 + 0x1e68); if ((((iVar1 == 0) || (*(int *)(iVar1 + 0x161c) == -1)) || (*(int *)(iVar4 + 0x161c) <= *(int *)(iVar1 + 0x161c))) || (iVar1 == iVar4)) { bVar2 = false; } else { bVar2 = true; } iVar4 = iVar3 + 1; if (bVar2) { iVar4 = iVar3; } piVar6 = piVar6 + 1; iVar3 = iVar4; } return iVar3; } //@@ 009b94e0 FUN_009b94e0 void FUN_009b94e0(int param_1) { int *piVar1; int in_ECX; int *piVar2; int iVar3; if (*(char *)(in_ECX + 0x5c) != '\0') { if (param_1 == -1) { KAGE_LogMessage(8,(byte *) "PlayerManager::AssignPlayerColor() cannot assign a color without a valid controller ID (ID = %d) \n" ); return; } piVar1 = (int *)(in_ECX + 0x60); iVar3 = 0; piVar2 = piVar1; do { if (*piVar2 == param_1) { return; } iVar3 = iVar3 + 1; piVar2 = piVar2 + 1; } while (iVar3 < 4); iVar3 = 0; while (*piVar1 != -1) { iVar3 = iVar3 + 1; piVar1 = piVar1 + 1; if (3 < iVar3) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::AssignPlayerColor() failed to assign color for player, no colors are available! \n" ); return; } } KAGE_LogMessage(1,(byte *)"Assigning Player Color (%d) to Controller(%d) \n"); *(int *)(in_ECX + 0x60 + iVar3 * 4) = param_1; } return; } //@@ 009b9570 PlayerManager::GetPlayerColorValue /* DB: string "PlayerManager::GetPlayerColorValue( ) encountered invalid ePlayerColor value (%d)"; switch on color id per g_Manager+0x2a3f0 palette mode writing KColor-like floats to param_1 prototype: db/protos.zhl, confirmed by RET 8 */ void PlayerManager::GetPlayerColorValue(KColor *outColor,int playerColor) { int colorSet; colorSet = (g_manager->_optionsConfig)._onlineColorSet; if (colorSet == 0) { switch(playerColor) { case 0: outColor->_unk = 0; outColor->_red = 0.4392157; outColor->_green = 0.047058824; outColor->_blue = 0.047058824; outColor->_alpha = 1.0; return; case 1: outColor->_unk = 0; outColor->_red = 0.34901962; outColor->_green = 0.4509804; outColor->_blue = 0.5764706; outColor->_alpha = 1.0; return; case 2: outColor->_unk = 0; outColor->_red = 0.61960787; outColor->_green = 0.5882353; outColor->_blue = 0.0; outColor->_alpha = 1.0; return; case 3: outColor->_unk = 0; outColor->_red = 0.24705882; outColor->_green = 0.36862746; outColor->_blue = 0.18431373; outColor->_alpha = 1.0; return; } } else if (colorSet == 1) { switch(playerColor) { case 0: outColor->_unk = 0; outColor->_red = 0.73333335; outColor->_green = 0.19215687; outColor->_blue = 0.08235294; outColor->_alpha = 1.0; return; case 1: outColor->_unk = 0; outColor->_red = 0.34901962; outColor->_green = 0.6313726; outColor->_blue = 0.7490196; outColor->_alpha = 1.0; return; case 2: outColor->_unk = 0; outColor->_red = 0.64705884; outColor->_green = 0.77254903; outColor->_blue = 0.2627451; outColor->_alpha = 1.0; return; case 3: outColor->_unk = 0; outColor->_red = 0.38431373; outColor->_green = 0.11764706; outColor->_blue = 0.76862746; outColor->_alpha = 1.0; return; } } else if (colorSet == 2) { switch(playerColor) { case 0: outColor->_unk = 0; outColor->_red = 0.62352943; outColor->_green = 0.1764706; outColor->_blue = 0.08627451; outColor->_alpha = 1.0; return; case 1: outColor->_unk = 0; outColor->_red = 0.019607844; outColor->_green = 0.49803922; outColor->_blue = 0.62352943; outColor->_alpha = 1.0; return; case 2: outColor->_unk = 0; outColor->_red = 0.3137255; outColor->_green = 0.7254902; outColor->_blue = 0.36862746; outColor->_alpha = 1.0; return; case 3: outColor->_unk = 0; outColor->_red = 0.5411765; outColor->_green = 0.08235294; outColor->_blue = 0.7254902; outColor->_alpha = 1.0; return; } } else if (colorSet == 3) { switch(playerColor) { case 0: outColor->_unk = 0; outColor->_red = 0.6156863; outColor->_green = 0.14117648; outColor->_blue = 0.45490196; outColor->_alpha = 1.0; return; case 1: outColor->_unk = 0; outColor->_red = 0.0; outColor->_green = 0.29803923; outColor->_blue = 0.69803923; outColor->_alpha = 1.0; return; case 2: outColor->_unk = 0; outColor->_red = 0.73333335; outColor->_green = 0.6039216; outColor->_blue = 0.09019608; outColor->_alpha = 1.0; return; case 3: outColor->_unk = 0; outColor->_red = 0.25490198; outColor->_green = 0.5921569; outColor->_blue = 0.3019608; outColor->_alpha = 1.0; return; } } KAGE_LogMessage(8,(byte *) "PlayerManager::GetPlayerColorValue( ) encountered invalid ePlayerColor value (%d)\n" ); KColor::SetFromARGB(outColor,0xffff00ff); return; } //@@ 009b98e0 PlayerManager::SpawnCoPlayerBaby /* WARNING: Removing unreachable block (ram,0x009b9b0a) */ /* WARNING: Removing unreachable block (ram,0x009b9b1a) */ /* WARNING: Removing unreachable block (ram,0x009b9af8) */ /* ZHL [exact] __thiscall Entity_Player* PlayerManager::SpawnCoPlayerBaby(int babyID); //smol baby */ Entity * __thiscall PlayerManager::SpawnCoPlayerBaby(PlayerManager *this,Entity_Player *param_2) { code *pcVar1; byte isUnlocked; Entity *extraout_EAX; uint uVar2; Entity *pEVar3; uint roll; int iVar4; int extraout_EDX; void *pvVar5; int babyId; int *candidatesEnd; int iVar6; uint extraBabyCount; int *candidatesEndSaved; int candidate; Manager *savedManager; uint babyIndex; Entity *newPlayer; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; Manager *manager; void **playerListEnd; undefined4 *playerListSlot; babyId = (int)param_2; uStack_8 = 0xffffffff; puStack_c = &LAB_00b0e83f; local_10 = ExceptionList; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Spawning Co-Op Baby (Skin = %d) \n"); if (0x40 < ((int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2) + 1U) { KAGE_LogMessage(8,(byte *) "PlayerManager::SpawnCoPlayer() cannot spawn new player. Already at max players. (Count == %d, Max = %d) \n" ); ExceptionList = local_10; return (Entity *)0x0; } param_2 = operator_new(0x2f00); uStack_8 = 0; if (param_2 == (Entity_Player *)0x0) { param_2 = (Entity_Player *)0x0; } else { Entity_Player::constructor(param_2); param_2 = (Entity_Player *)extraout_EAX; } uStack_8 = 0xffffffff; (((Entity *)((int)param_2 + 0x143c))->_color)._offset[2] = (float)((int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2); playerListSlot = (this->_playerList)._end; newPlayer = (Entity *)param_2; if (playerListSlot == (this->_playerList)._capacity) { std::vector::_Emplace_reallocate(playerListSlot,¶m_2); newPlayer = (Entity *)param_2; } else { *playerListSlot = param_2; playerListEnd = &(this->_playerList)._end; *playerListEnd = (void *)((int)*playerListEnd + 4); } manager = g_manager; savedManager = g_manager; param_2 = (Entity_Player *)newPlayer; if (babyId < 0) { babyId = 0x47; param_2 = (Entity_Player *)0x47; uVar2 = Random(); if ((uVar2 & 3) == 0) { uStack_8 = 1; FUN_0042c820(((int)(manager->_entityConfig)._babies._end - (int)(manager->_entityConfig)._babies._begin) / 0x38); pvVar5 = (manager->_entityConfig)._babies._begin; babyIndex = 0; iVar4 = (int)(savedManager->_entityConfig)._babies._end - (int)pvVar5; iVar6 = iVar4 >> 0x1f; candidatesEnd = (int *)0x0; if (iVar4 / 0x38 + iVar6 != iVar6) { iVar6 = 0; candidatesEndSaved = candidatesEnd; do { iVar4 = iVar6 + (int)pvVar5; if (*(int *)(iVar4 + 0x34) < 0) { LAB_009b9a6d: candidate = iVar4; if (candidatesEnd == (int *)0x0) { std::vector::_Emplace_reallocate(0,&candidate); candidatesEnd = candidatesEndSaved; } else { *candidatesEnd = iVar4; candidatesEndSaved = candidatesEnd + 1; candidatesEnd = candidatesEndSaved; } } else { isUnlocked = PersistentGameData::Unlocked (&g_manager->_persistentGameData,*(int *)(iVar4 + 0x34)); iVar4 = extraout_EDX; if (isUnlocked != 0) goto LAB_009b9a6d; } iVar6 = iVar6 + 0x38; babyIndex = babyIndex + 1; pvVar5 = (savedManager->_entityConfig)._babies._begin; } while (babyIndex < (uint)(((int)(savedManager->_entityConfig)._babies._end - (int)pvVar5) / 0x38)); } if (candidatesEnd == (int *)0x0) { babyId = (int)param_2; } else if ((int)candidatesEnd >> 2 == 0) { babyId = (int)*puRam00000000; } else { uVar2 = Random(); babyId = (int)**(undefined4 **)((uVar2 % (uint)((int)candidatesEnd >> 2)) * 4); } uStack_8 = 0xffffffff; goto LAB_009b9b3f; } LAB_009b9c11: pEVar3 = newPlayer; if ((Entity *)babyId == (Entity *)0x47) { uVar2 = (this->_rng)._seed; param_2 = *(Entity_Player **)(*(int *)newPlayer + 4); if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_rng)._seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); pEVar3 = (Entity *)(*pcVar1)(); return pEVar3; } } uVar2 = uVar2 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar2; (this->_rng)._seed = uVar2; extraBabyCount = ((int)(savedManager->_entityConfig)._babies._end - (int)(savedManager->_entityConfig)._babies._begin) / 0x38 - 0x47; if (extraBabyCount == 0) { (*(code *)param_2)(1,1,0x47,uVar2); } else { roll = Random(); (*(code *)param_2)(1,1,roll % extraBabyCount + 0x47,uVar2); } goto LAB_009b9bd2; } } else { LAB_009b9b3f: if ((Entity *)babyId != (Entity *)0x19) goto LAB_009b9c11; uVar2 = Random(); *(uint *)&this->field_0xa8 = uVar2; *(undefined8 *)&this->field_0xac = 0x900000005; *(undefined4 *)&this->field_0xb4 = 7; } pEVar3 = newPlayer; uVar2 = (this->_rng)._seed; param_2 = *(Entity_Player **)(*(int *)newPlayer + 4); if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_rng)._seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); pEVar3 = (Entity *)(*pcVar1)(); return pEVar3; } } uVar2 = uVar2 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar2; (this->_rng)._seed = uVar2; (*(code *)param_2)(1,1,babyId,uVar2); LAB_009b9bd2: pvVar5 = g_game->_room; iVar6 = *(int *)((int)pvVar5 + 0x1214); *(int *)((int)pvVar5 + 0x1214) = iVar6 + 1; pEVar3->_index = iVar6; EntityList::AddEntity((EntityList *)((int)pvVar5 + 0x1218),pEVar3); ExceptionList = local_10; return pEVar3; } //@@ 009b9cd0 PlayerManager::SpawnCoPlayer2 /* ZHL [exact] __thiscall Entity_Player* PlayerManager::SpawnCoPlayer2(int playerType); //big baby */ Entity * __thiscall PlayerManager::SpawnCoPlayer2(PlayerManager *this,Entity_Player *param_2) { code *pcVar1; Entity_Player *extraout_EAX; Entity *pEVar2; uint uVar3; Entity_Player *extraout_EAX_00; int iVar4; Entity_Player *newPlayer; int *playerSlot; Entity_Player *coPlayer; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; int existingPlayer; undefined4 *extraPlayersEnd; void **listEnd; void *room; iVar4 = (int)param_2; uStack_8 = 0xffffffff; puStack_c = &LAB_00b0e889; local_10 = ExceptionList; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"[Frame: %d] Spawning Co-Op Player (ePlayerType = %d) \n"); if (iVar4 == -1) { param_2 = operator_new(0x2f00); uStack_8 = 0; if (param_2 == (Entity_Player *)0x0) { param_2 = (Entity_Player *)0x0; } else { Entity_Player::constructor(param_2); param_2 = extraout_EAX; } uStack_8 = 0xffffffff; *(int *)(¶m_2->field_0x143c + 0x1e0) = (int)(this->_extraPlayers)._end - (int)(this->_extraPlayers)._begin >> 2; extraPlayersEnd = (this->_extraPlayers)._end; if (extraPlayersEnd == (this->_extraPlayers)._capacity) { std::vector::_Emplace_reallocate(extraPlayersEnd,¶m_2); newPlayer = param_2; } else { *extraPlayersEnd = param_2; listEnd = &(this->_extraPlayers)._end; *listEnd = (void *)((int)*listEnd + 4); newPlayer = param_2; } uVar3 = (this->_rng)._seed; param_2 = *(Entity_Player **)(*(int *)newPlayer + 4); if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = (this->_rng)._seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); pEVar2 = (Entity *)(*pcVar1)(); return pEVar2; } } uVar3 = uVar3 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar3; (this->_rng)._seed = uVar3; (*(code *)param_2)(1,2,0,uVar3); } else { if (0x40 < ((int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2) + 1U) { KAGE_LogMessage(8,(byte *) "PlayerManager::SpawnCoPlayer() cannot spawn new player. Already at max players. (Count == %d, Max = %d) \n" ); ExceptionList = local_10; return (Entity *)0x0; } coPlayer = operator_new(0x2f00); uStack_8 = 1; if (coPlayer == (Entity_Player *)0x0) { coPlayer = (Entity_Player *)0x0; } else { Entity_Player::constructor(coPlayer); coPlayer = extraout_EAX_00; } uStack_8 = 0xffffffff; uVar3 = 0xffffffff; *(int *)(&coPlayer->field_0x143c + 0x1e0) = (int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2; playerSlot = (this->_playerList)._begin; iVar4 = (int)(this->_playerList)._end - (int)playerSlot >> 2; if (iVar4 != 0) { do { existingPlayer = *playerSlot; playerSlot = playerSlot + 1; if ((int)uVar3 < (int)*(uint *)(existingPlayer + 0x1620)) { uVar3 = *(uint *)(existingPlayer + 0x1620); } iVar4 = iVar4 + -1; } while (iVar4 != 0); if (uVar3 < 3) { *(uint *)(&coPlayer->field_0x143c + 0x1e4) = uVar3 + 1; } } playerSlot = (this->_playerList)._end; if (playerSlot == (this->_playerList)._capacity) { std::vector::_Emplace_reallocate(playerSlot,&coPlayer); } else { *playerSlot = (int)coPlayer; listEnd = &(this->_playerList)._end; *listEnd = (void *)((int)*listEnd + 4); } newPlayer = coPlayer; uVar3 = (this->_rng)._seed; pcVar1 = *(code **)(*(int *)coPlayer + 4); if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar3 = (this->_rng)._seed; if (uVar3 == 0) { pcVar1 = (code *)swi(3); pEVar2 = (Entity *)(*pcVar1)(); return pEVar2; } } uVar3 = uVar3 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar3; uVar3 = uVar3 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar3; uVar3 = uVar3 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar3; (this->_rng)._seed = uVar3; (*pcVar1)(1,0,param_2,uVar3); room = g_game->_room; iVar4 = *(int *)((int)room + 0x1214); *(int *)((int)room + 0x1214) = iVar4 + 1; newPlayer->_index = iVar4; EntityList::AddEntity((EntityList *)((int)room + 0x1218),(Entity *)newPlayer); } ExceptionList = local_10; return (Entity *)newPlayer; } //@@ 009b9f60 FUN_009b9f60 void FUN_009b9f60(Entity *param_1) { int *piVar1; void *pvVar2; int iVar3; int *in_ECX; param_1[5]._color._offset[2] = (float)(in_ECX[1] - *in_ECX >> 2); piVar1 = (int *)in_ECX[1]; if (piVar1 == (int *)in_ECX[2]) { std::vector::_Emplace_reallocate(piVar1,¶m_1); } else { *piVar1 = (int)param_1; in_ECX[1] = in_ECX[1] + 4; } pvVar2 = g_game->_room; iVar3 = *(int *)((int)pvVar2 + 0x1214); *(int *)((int)pvVar2 + 0x1214) = iVar3 + 1; param_1->_index = iVar3; EntityList::AddEntity((EntityList *)((int)pvVar2 + 0x1218),param_1); return; } //@@ 009b9fc0 FUN_009b9fc0 void FUN_009b9fc0(int param_1) { int *_Dst; undefined4 *in_ECX; for (_Dst = (int *)*in_ECX; (_Dst != (int *)in_ECX[1] && (*_Dst != param_1)); _Dst = _Dst + 1) { } memmove(_Dst,_Dst + 1,in_ECX[1] - (int)(_Dst + 1)); in_ECX[1] = in_ECX[1] + -4; return; } //@@ 009ba000 PlayerManager::RemoveCoPlayer /* DB: ZHL name; 'Clearing player color assignment', removes from player list ECX[0x34], baby skins prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall PlayerManager::RemoveCoPlayer(PlayerManager *this,Entity_Player *player,byte unusedBool) { void **ppvVar1; void *pvVar2; Entity *entity; qword qVar3; byte bVar4; uint uVar5; int iVar6; Entity_Player *mainPlayer; Entity_Familiar *familiar; uint uVar7; uint maxPocketItems; Vector *pos; int iVar8; qword *heapCounter; undefined4 *puVar9; Entity_Player *pEVar10; HUD *hud; int *piVar11; float ownedNpcCount; undefined4 *puVar12; undefined4 *puVar13; int *piVar14; undefined4 tmpHudSlot [51]; undefined1 local_48; float entityData; undefined4 local_40; uint entityCount; void *controllerIndex; EntityList_EL local_34; Vector local_24; Vector local_1c; PlayerManager *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; EntityPtr twinPlayer; pEVar10 = player; local_8 = 0xffffffff; puStack_c = &LAB_00b0e8d5; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(tmpHudSlot + 0x44); if (player == (Entity_Player *)0x0) { return; } twinPlayer = player->_twinPlayer; pvVar2 = (void *)player->_controllerIndex; ExceptionList = &local_10; controllerIndex = pvVar2; local_14 = this; if (((((twinPlayer == (EntityPtr)0x0) || (*(int *)((int)twinPlayer + 0x161c) == -1)) || (player->_playerIndex <= *(int *)((int)twinPlayer + 0x161c))) || (twinPlayer == (EntityPtr)player)) && (player->_parent == (EntityPtr)0x0)) { KAGE_LogMessage(1,(byte *)"Clearing player color assignment for controllerId %d \n"); piVar11 = (int *)&this->field_0x60; iVar6 = 0; do { if ((void *)*piVar11 == pvVar2) { *(undefined4 *)((int)(this->_coopSlots + 4) + iVar6 * 4 + 4) = 0xffffffff; break; } iVar6 = iVar6 + 1; piVar11 = piVar11 + 1; } while (iVar6 < 4); } game = g_game; if (pEVar10->_variant == 2) { uVar5 = 0; pvVar2 = g_game->_room; if (*(int *)((int)pvVar2 + 0x1264) != 0) { do { iVar6 = *(int *)(*(int *)((int)pvVar2 + 0x125c) + uVar5 * 4); if (((iVar6 != 0) && (((1 < *(int *)&game->_deathmatchManager && (*(int *)(iVar6 + 0x28) == 1)) || (*(int *)(iVar6 + 0x28) - 10U < 0x3de)))) && (*(int *)(iVar6 + 0xf1c) == pEVar10->_controllerIndex)) { *(undefined4 *)(iVar6 + 0xf1c) = 0xffffffff; } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar2 + 0x1264)); this = local_14; } piVar11 = (this->_extraPlayers)._end; for (piVar14 = (this->_extraPlayers)._begin; (piVar14 != piVar11 && ((Entity_Player *)*piVar14 != pEVar10)); piVar14 = piVar14 + 1) { } memmove(piVar14,piVar14 + 1,(int)piVar11 - (int)(piVar14 + 1)); ppvVar1 = &(this->_extraPlayers)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -4); uVar5 = 0; if ((int)(this->_extraPlayers)._end - (int)(this->_extraPlayers)._begin >> 2 != 0) { do { *(uint *)(*(int *)((int)(this->_extraPlayers)._begin + uVar5 * 4) + 0x161c) = uVar5; uVar5 = uVar5 + 1; } while (uVar5 < (uint)((int)(this->_extraPlayers)._end - (int)(this->_extraPlayers)._begin >> 2)); } (*(code *)**(undefined4 **)pEVar10)(1); goto LAB_009ba5d2; } if (pEVar10->_variant == 1) { player = Entity_Player::GetMainPlayer(pEVar10); switch(pEVar10->_babySkin) { case 0x1b: uVar5 = pEVar10->_soulHearts - 1; if (-1 < (int)uVar5) { iVar6 = pEVar10->_soulHearts + -2; do { if ((((int)uVar5 <= pEVar10->_soulHearts) && (uVar5 != 0)) && (((uVar5 & 1) != 0 && ((pEVar10->_blackHearts & 1 << ((byte)(iVar6 / 2) & 0x1f)) != 0)) )) { pEVar10->_blackHearts = pEVar10->_blackHearts & ~(1 << (uVar5 >> 1 & 0x1f)); Entity_Player::ClampGoldenHearts(pEVar10,0); Entity_Player::update_bone_hearts(pEVar10); Entity_Player::AddSoulHearts(pEVar10,-2,0); } iVar6 = iVar6 + -1; uVar5 = uVar5 - 1; } while (-1 < (int)uVar5); this = local_14; } break; case 0x1c: Entity_Player::AddMaxHearts(pEVar10,-2,0); break; case 0x1d: mainPlayer = Entity_Player::GetMainPlayer(pEVar10); Entity_Player::AddEternalHearts(mainPlayer,-1); break; case 0x1e: Entity_Player::AddSoulHearts(pEVar10,-2,0); } if (((player->_dead == 0) && ((EntityPtr)player != pEVar10->_parent)) && (bVar4 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x37), bVar4 == 0)) { local_24.y = (float)pEVar10->_boneHearts; local_1c.y = 0.0; iVar6 = pEVar10->_soulHearts; uVar5 = 1; LAB_009ba298: do { if (0 < iVar6) { if (0 < (int)local_24.y) goto LAB_009ba353; LAB_009ba385: if (((int)uVar5 <= pEVar10->_soulHearts) && (0 < (int)uVar5)) { uVar7 = uVar5 & 0x80000001; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffffe) + 1; } if ((uVar7 == 1) && ((pEVar10->_blackHearts & 1 << ((byte)((int)(uVar5 - 1) / 2) & 0x1f)) != 0)) { iVar8 = 2; if (iVar6 < 2) { iVar8 = iVar6; } Entity_Player::AddBlackHearts(player,iVar8); iVar6 = iVar6 + -2; uVar5 = uVar5 + 2; local_1c.y = (float)((int)local_1c.y + 1); goto LAB_009ba298; } } iVar8 = 2; if (iVar6 < 2) { iVar8 = iVar6; } Entity_Player::AddSoulHearts(player,iVar8,0); iVar6 = iVar6 + -2; uVar5 = uVar5 + 2; local_1c.y = (float)((int)local_1c.y + 1); goto LAB_009ba298; } if ((int)local_24.y < 1) goto code_r0x009ba2ab; LAB_009ba353: if ((pEVar10->_boneHearts < 1) || ((pEVar10->_boneHeartsMask & 1 << (SUB41(local_1c.y,0) & 0x1f)) == 0)) goto LAB_009ba385; Entity_Player::AddBoneHearts(player,1); local_24.y = (float)((int)local_24.y + -1); local_1c.y = (float)((int)local_1c.y + 1); } while( true ); } goto LAB_009ba2d0; } if (*(char *)g_game->_room != '\0') { iVar6 = 2; do { local_1c.y = (pEVar10->_pos).y; local_1c.x = (pEVar10->_pos).x; Room::FindFreePickupSpawnPosition(g_game->_room,&local_24,&local_1c,0.0,0,0,0); Entity_Player::DropTrinket(pEVar10,&local_24,0); iVar6 = iVar6 + -1; } while (iVar6 != 0); maxPocketItems = Entity_Player::GetMaxPocketItems(pEVar10); uVar7 = 0; if (maxPocketItems != 0) { do { local_1c.y = (pEVar10->_pos).y; local_1c.x = (pEVar10->_pos).x; pos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_24,&local_1c,0.0,0,0,0); Entity_Player::DropPocketItem(pEVar10,uVar7,pos); uVar7 = uVar7 + 1; maxPocketItems = Entity_Player::GetMaxPocketItems(pEVar10); } while (uVar7 < maxPocketItems); } } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_34,3,-1,-1,0,0); pvVar2 = local_34._data; uVar7 = 0; local_8 = 2; if (local_34._size != 0) { do { piVar11 = (int *)__RTDynamicCast(*(undefined4 *)((int)pvVar2 + uVar7 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0 ,uVar5); if ((Entity_Player *)piVar11[0x104] == pEVar10) { (**(code **)(*piVar11 + 0x28))(); } uVar7 = uVar7 + 1; } while (uVar7 < (uint)local_34._size); this = local_14; } Entity_Player::release_weapons_and_effects(pEVar10,1); local_8 = 0xffffffff; if (local_34._0_1_ != '\0') goto LAB_009ba5d2; if (g_mainHeap == (void *)0x0) { heapCounter = &g_allocatedBytesNoHeap; } else { heapCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_34._data != (void *)0x0) { uVar5 = *(uint *)((int)local_34._data + -4); qVar3 = *heapCounter; *(uint *)heapCounter = (uint)*heapCounter - uVar5; *(uint *)((int)heapCounter + 4) = *(uint *)((int)heapCounter + 4) - (uint)((uint)qVar3 < uVar5); free((uint *)((int)local_34._data + -4)); } LAB_009ba5cb: local_8 = 0xffffffff; LAB_009ba5d2: Entity_Player::release_weapons_and_effects(pEVar10,1); piVar11 = (this->_playerList)._end; for (piVar14 = (this->_playerList)._begin; (piVar14 != piVar11 && ((Entity_Player *)*piVar14 != pEVar10)); piVar14 = piVar14 + 1) { } memmove(piVar14,piVar14 + 1,(int)piVar11 - (int)(piVar14 + 1)); ppvVar1 = &(this->_playerList)._end; *ppvVar1 = (void *)((int)*ppvVar1 + -4); (**(code **)(*(int *)pEVar10 + 0x28))(); pEVar10->_playerIndex = -1; uVar5 = 0; if ((int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2 != 0) { do { *(uint *)(*(int *)((int)(this->_playerList)._begin + uVar5 * 4) + 0x161c) = uVar5; uVar5 = uVar5 + 1; } while (uVar5 < (uint)((int)(this->_playerList)._end - (int)(this->_playerList)._begin >> 2)); } game = g_game; this->_coopSlots[0]._controllerIndex = -1; hud = &game->_hud; this->_coopSlots[1]._controllerIndex = -1; this->_coopSlots[0]._state = -1; this->_coopSlots[0]._menuPosition = 0.0; this->_coopSlots[0]._playerType = 0; this->_coopSlots[1]._state = -1; this->_coopSlots[1]._menuPosition = 0.0; this->_coopSlots[1]._playerType = 0; this->_coopSlots[2]._controllerIndex = -1; this->_coopSlots[2]._state = -1; this->_coopSlots[2]._menuPosition = 0.0; this->_coopSlots[2]._playerType = 0; this->_coopSlots[3]._controllerIndex = -1; this->_coopSlots[3]._state = -1; this->_coopSlots[3]._menuPosition = 0.0; this->_coopSlots[3]._playerType = 0; player = (Entity_Player *)hud; remove_coplayer_slot(pEVar10); piVar11 = (int *)&(game->_hud).field_0x5ab8; uVar5 = 0; do { uVar7 = uVar5 + 1; if ((Entity_Player *)*piVar11 == pEVar10) { *(undefined4 *)((int)(&hud->_poopSpellsSprite + 2) + uVar5 * 0xcc + 0x78) = 0; if (uVar7 < 2) { puVar9 = (undefined4 *)((int)(&(game->_hud)._poopSpellsSprite + 2) + uVar5 * 0xcc + 0x78); iVar6 = 2 - uVar7; do { puVar12 = puVar9; puVar13 = tmpHudSlot; for (iVar8 = 0x33; iVar8 != 0; iVar8 = iVar8 + -1) { *puVar13 = *puVar12; puVar12 = puVar12 + 1; puVar13 = puVar13 + 1; } puVar12 = puVar9 + 0x33; puVar13 = puVar9; for (iVar8 = 0x33; iVar8 != 0; iVar8 = iVar8 + -1) { *puVar13 = *puVar12; puVar12 = puVar12 + 1; puVar13 = puVar13 + 1; } puVar12 = puVar9 + 0x33; puVar9 = puVar9 + 0x33; puVar13 = tmpHudSlot; for (iVar8 = 0x33; iVar8 != 0; iVar8 = iVar8 + -1) { *puVar12 = *puVar13; puVar13 = puVar13 + 1; puVar12 = puVar12 + 1; } iVar6 = iVar6 + -1; } while (iVar6 != 0); hud = (HUD *)player; } break; } piVar11 = piVar11 + 0x33; uVar5 = uVar7; } while (uVar7 < 2); HUD::AssignPlayerHUDs(hud); piVar14 = (int *)0x0; piVar11 = (int *)0x0; player = (Entity_Player *)0x0; local_34._data = (Entity_Player *)0x0; local_34._capacity = 0; local_24.y = 0.0; local_34._size = 0; local_48 = 1; pvVar2 = g_game->_room; entityData = *(float *)((int)pvVar2 + 0x125c); local_40 = *(undefined4 *)((int)pvVar2 + 0x1260); entityCount = *(uint *)((int)pvVar2 + 0x1264); uVar5 = 0; local_8 = 5; local_1c.y = entityData; local_14 = (PlayerManager *)entityCount; if (entityCount != 0) { do { iVar6 = *(int *)((int)local_1c.y + uVar5 * 4); if (((9 < *(int *)(iVar6 + 0x28)) && (player = (Entity_Player *) __RTDynamicCast(iVar6,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0), player != (Entity_Player *)0x0)) && ((player->_bloodGushSprite)._animState._layerFrames == controllerIndex)) { if (piVar11 == piVar14) { std::vector::_Emplace_reallocate(piVar11,&player); piVar11 = (int *)local_34._capacity; piVar14 = (int *)local_34._size; } else { *piVar11 = (int)player; local_34._capacity = (int)(piVar11 + 1); piVar11 = (int *)local_34._capacity; } } uVar5 = uVar5 + 1; } while (uVar5 < local_14); local_24.y = (float)piVar14; } ownedNpcCount = (float)((int)piVar11 - (int)local_34._data >> 2); local_1c.y = 0.0; player = local_34._data; if (ownedNpcCount != 0.0) { do { entity = *(Entity **)((int)(&(player->_sprite)._filename + -3) + (int)local_1c.y * 4); pvVar2 = g_game->_room; EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1238),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1258),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1248),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x1268),entity); EntityList_EL::remove((EntityList_EL *)((int)pvVar2 + 0x12a8),entity); entity->_valid = 0; EntityList::invalidate_type_cache ((EntityList *)((int)pvVar2 + 0x1218),entity->_type,entity->_variant, entity->_subtype); local_1c.y = (float)((int)local_1c.y + 1); } while ((uint)local_1c.y < (uint)ownedNpcCount); } if (player != (Entity_Player *)0x0) { uVar5 = (int)local_24.y - (int)player & 0xfffffffc; pEVar10 = player; if (0xfff < uVar5) { pEVar10 = player[-1]._replacedPlayer; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)player + (-4 - (int)pEVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pEVar10,uVar5); } ExceptionList = local_10; return; code_r0x009ba2ab: Entity_Player::AddMaxHearts(player,pEVar10->_maxHearts,0); Entity_Player::AddHearts(player,pEVar10->_redHearts,1,0); this = local_14; LAB_009ba2d0: EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_34,3,-1,-1,0,0); mainPlayer = player; uVar5 = 0; local_8 = 0; if (local_34._size != 0) { do { familiar = (Entity_Familiar *) __RTDynamicCast(*(undefined4 *)((int)local_34._data + uVar5 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if (familiar->_player == pEVar10) { if (familiar->_spawnerVariant == 1) { LAB_009ba410: (**(code **)(*(int *)familiar + 0x28))(); } else { Entity_Familiar::set_player(familiar,mainPlayer); } } else if (familiar->_spawnerVariant == 1) goto LAB_009ba410; uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_34._size); this = local_14; } Entity_Player::release_weapons_and_effects(pEVar10,1); local_8 = 0xffffffff; if (local_34._0_1_ != '\0') goto LAB_009ba5d2; local_8 = 1; tracked_alloc(1,local_34._data,0); goto LAB_009ba5cb; } //@@ 009ba8f0 PlayerManager::remove_coplayers_without_device /* DB: Game::rewind: when Manager+0x4b3d8 list non-empty, walks players backward and RemoveCoPlayer for main players whose InputManager::GetDeviceByPlayerEntity is null */ void PlayerManager::remove_coplayers_without_device(void) { EntityPtr player; EntityPtr EVar1; uint uVar2; void *pvVar3; byte unusedBool; PlayerManager *in_ECX; uint uVar4; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { pvVar3 = (in_ECX->_playerList)._begin; uVar2 = (int)(in_ECX->_playerList)._end - (int)pvVar3 >> 2; uVar4 = uVar2 - 1; if (uVar4 < uVar2) { do { player = *(EntityPtr *)((int)pvVar3 + uVar4 * 4); EVar1 = *(EntityPtr *)((int)player + 0x1e68); if ((((EVar1 == (EntityPtr)0x0) || (*(int *)((int)EVar1 + 0x161c) == -1)) || (*(int *)((int)player + 0x161c) <= *(int *)((int)EVar1 + 0x161c))) || (EVar1 == player)) { pvVar3 = InputManager::GetDeviceByPlayerEntity (&g_manager->_netplayManager,(Entity_Player *)player); if (pvVar3 == (void *)0x0) { RemoveCoPlayer(in_ECX,*(Entity_Player **)((int)(in_ECX->_playerList)._begin + uVar4 * 4) ,unusedBool); } } uVar4 = uVar4 - 1; pvVar3 = (in_ECX->_playerList)._begin; } while (uVar4 < (uint)((int)(in_ECX->_playerList)._end - (int)pvVar3 >> 2)); } } return; } //@@ 009ba980 PlayerManager::CoopBabiesOnly /* ZHL [exact] static bool PlayerManager::CoopBabiesOnly(); prototype: REPENTOGON */ byte __cdecl PlayerManager::CoopBabiesOnly(void) { if ((g_game->_gameStateFlags & 0x10) == 0) { return 0; } return 1; } //@@ 009ba9a0 FUN_009ba9a0 void FUN_009ba9a0(void) { uint uVar1; undefined4 in_ECX; undefined4 *local_1c; undefined4 *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e90d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; std::vector::copy_constructor(in_ECX); local_8 = 0; for (; local_1c != local_18; local_1c = local_1c + 1) { if (((Entity_Player *)*local_1c)->_variant == 0) { Entity_Player::InitPostLevelInitStats((Entity_Player *)*local_1c,uVar1); } } FID_conflict__Tidy(&local_1c); ExceptionList = local_10; return; } //@@ 009baa10 FUN_009baa10 void FUN_009baa10(char param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xc) = 0xffffffff; *(undefined4 *)(in_ECX + 0x20) = 0xffffffff; *(undefined4 *)(in_ECX + 0x14) = 0xffffffff; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x28) = 0xffffffff; *(undefined4 *)(in_ECX + 0x2c) = 0; *(undefined4 *)(in_ECX + 0x24) = 0; *(undefined4 *)(in_ECX + 0x34) = 0xffffffff; *(undefined4 *)(in_ECX + 0x3c) = 0xffffffff; *(undefined4 *)(in_ECX + 0x40) = 0; *(undefined4 *)(in_ECX + 0x38) = 0; *(undefined4 *)(in_ECX + 0x48) = 0xffffffff; *(undefined4 *)(in_ECX + 0x50) = 0xffffffff; *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; if (param_1 != '\0') { HUD::AssignPlayerHUDs(&g_game->_hud); } return; } //@@ 009baaa0 PlayerManager::GetPlayerSlotFromController /* DB: strings "PlayerManager::GetPlayerSlotFromController() recieved invalid controllerID (%d)" / "could not find NetInputDevice with controllerID"; scans the controller slots at this+0xc for param and returns the slot index prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall PlayerManager::GetPlayerSlotFromController(PlayerManager *this,int controllerId) { int iVar1; int iVar2; float fVar3; byte bVar4; undefined3 uVar5; char cVar6; int iVar7; NetplayManager NVar8; uint uVar9; CoopJoinSlot *pCVar10; uint uVar11; uint uVar12; bool bVar13; CoopJoinSlot *local_10; if (controllerId < 0) { KAGE_LogMessage(8,(byte *) "PlayerManager::GetPlayerSlotFromController() recieved invalid controllerID (%d) \n" ); return -1; } bVar13 = false; if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { iVar7 = FUN_0090b010(controllerId); if (iVar7 == 0) { KAGE_LogMessage(8,(byte *) "PlayerManager::GetPlayerSlotFromController() could not find NetInputDevice with controllerID(%d) \n" ); return -1; } cVar6 = (**(code **)(*(int *)(iVar7 + 0x370) + 0x14))(); bVar13 = cVar6 == '\0'; } local_10 = this->_coopSlots; uVar11 = 0; do { iVar7 = local_10->_controllerIndex; if (iVar7 == controllerId) { return uVar11; } NVar8 = g_manager->_netplayManager; if ((NVar8 != *(NetplayManager *)(g_manager + 1)) && (!bVar13)) { if (iVar7 < 0) { LAB_009babda: this->_coopSlots[uVar11]._controllerIndex = controllerId; this->_coopSlots[uVar11]._state = -1; return uVar11; } uVar9 = 0; uVar12 = (int)*(NetplayManager *)(g_manager + 1) - (int)NVar8 >> 2; if (uVar12 != 0) { do { if (*(int *)(*(int *)NVar8 + 0xc) == iVar7) { cVar6 = (**(code **)(*(int *)(*(int *)NVar8 + 0x370) + 0x14))(); if (cVar6 == '\0') { if (uVar11 < 3) { iVar7 = 3 - uVar11; pCVar10 = this->_coopSlots + 3; do { bVar4 = pCVar10[-0xffffffff00000001]._isPlayerTypeForced; uVar5 = *(undefined3 *)&pCVar10[-0xffffffff00000001].field_0x11; iVar1 = pCVar10[-1]._playerType; iVar2 = pCVar10[-1]._state; fVar3 = pCVar10[-1]._menuPosition; pCVar10->_controllerIndex = pCVar10[-1]._controllerIndex; pCVar10->_playerType = iVar1; pCVar10->_state = iVar2; pCVar10->_menuPosition = fVar3; pCVar10->_isPlayerTypeForced = bVar4; *(undefined3 *)&pCVar10->field_0x11 = uVar5; iVar7 = iVar7 + -1; pCVar10 = pCVar10 + -1; } while (iVar7 != 0); } goto LAB_009babda; } break; } uVar9 = uVar9 + 1; NVar8 = (NetplayManager)((int)NVar8 + 4); } while (uVar9 < uVar12); } } if (local_10->_controllerIndex < 0) goto LAB_009babda; uVar11 = uVar11 + 1; local_10 = local_10 + 1; if (3 < uVar11) { return -1; } } while( true ); } //@@ 009bac00 FUN_009bac00 int FUN_009bac00(int param_1) { int iVar1; uint uVar2; int *in_ECX; uint uVar3; uVar2 = 0; uVar3 = in_ECX[1] - *in_ECX >> 2; if (uVar3 != 0) { do { iVar1 = *(int *)(*in_ECX + uVar2 * 4); if (*(int *)(iVar1 + 0x1618) == param_1) { return iVar1; } uVar2 = uVar2 + 1; } while (uVar2 < uVar3); } return 0; } //@@ 009bac40 PlayerManager::handle_coop_join /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? this=PlayerManager (players vector at +0/+4): "Joining as possessor", SpawnCoPlayer2/RemoveCoPlayer/CoopBabiesOnly, HUD::AssignPlayerHUDs, SetControllerIndex, InitPostLevelInitStats; from the per-frame manager update 006fa540 prototype: db/protos.zhl */ void __thiscall PlayerManager::handle_coop_join(PlayerManager *this) { HUD *this_00; Manager *pMVar1; char cVar2; byte bVar3; uint uVar4; int *playerEntry; ChallengeParam *challengeParams; byte *animName; uint uVar5; void *pvVar6; byte unusedBool; Entity_Player *pEVar7; int iVar8; char *appearText; int *piVar9; undefined4 extraout_ECX; char extraout_DL; float fVar10; int iVar11; bool bVar12; Vector poofPos; int *inputDevice; int *inputDeviceRef; float local_28; Entity_Player *local_24; PlayerManager *local_20; int local_1c; float local_18; Entity_Player *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; PlayerManager *coopSlot; int extraPlayer; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00b0e93d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_20 = this; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { fVar10 = 0.0; while( true ) { local_8 = 0xffffffff; local_18 = fVar10; (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff,uVar4); iVar11 = DAT_00c57b24 - _DAT_00c57b20; local_8 = 0; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_8 = 0xffffffff; if ((uint)(iVar11 >> 3) <= (uint)fVar10) break; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&inputDevice,(uint)fVar10); local_8 = 1; if (inputDevice == (int *)0x0) { local_8 = 2; if (inputDeviceRef == (int *)0x0) goto LAB_009bb25d; cVar2 = (**(code **)(*inputDeviceRef + 0xc))(); if ((cVar2 == '\0') || (g_inputDeviceRelease == (void *)0x0)) goto LAB_009bb25d; (*g_inputDeviceRelease)(&inputDevice); fVar10 = (float)((int)fVar10 + 1); } else { local_1c = inputDevice[3]; local_24 = (Entity_Player *)0x0; bVar12 = false; local_14 = (Entity_Player *)0x0; iVar11 = local_1c; if ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2 != 0) { pvVar6 = (this->_playerList)._end; piVar9 = (this->_playerList)._begin; do { if ((int)pvVar6 - (int)piVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar6 = (this->_playerList)._end; piVar9 = (this->_playerList)._begin; } this = local_20; pEVar7 = (Entity_Player *)((int)pvVar6 - (int)piVar9 >> 2); playerEntry = piVar9 + (int)local_14; if (pEVar7 <= local_14) { playerEntry = piVar9; } if (*(int *)(*playerEntry + 0x1618) == local_1c) { bVar12 = true; if (pEVar7 == (Entity_Player *)0x0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n" ); pvVar6 = (this->_playerList)._end; piVar9 = (this->_playerList)._begin; } playerEntry = piVar9 + (int)local_14; if ((Entity_Player *)((int)pvVar6 - (int)piVar9 >> 2) <= local_14) { playerEntry = piVar9; } local_24 = (Entity_Player *)*playerEntry; } local_14 = (Entity_Player *)&local_14->field_0x1; } while (local_14 < (undefined1 *) ((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2)); iVar11 = local_1c; } piVar9 = (this->_extraPlayers)._begin; iVar8 = (int)(this->_extraPlayers)._end - (int)piVar9 >> 2; if (iVar8 != 0) { do { extraPlayer = *piVar9; piVar9 = piVar9 + 1; if (*(int *)(extraPlayer + 0x1618) == iVar11) { bVar12 = true; } iVar8 = iVar8 + -1; } while (iVar8 != 0); this = local_20; } if ((this->_coopSlots[0]._controllerIndex == iVar11) && (-1 < this->_coopSlots[0]._state)) { bVar12 = true; } if ((this->_coopSlots[1]._controllerIndex == iVar11) && (-1 < this->_coopSlots[1]._state)) { bVar12 = true; } if ((this->_coopSlots[2]._controllerIndex == iVar11) && (-1 < this->_coopSlots[2]._state)) { bVar12 = true; } if ((this->_coopSlots[3]._controllerIndex == iVar11) && (-1 < this->_coopSlots[3]._state)) { bVar12 = true; LAB_009bae76: local_1c = 1; bVar3 = CoopBabiesOnly(); cVar2 = extraout_DL; if (bVar3 != 0) { piVar9 = (this->_playerList)._begin; if ((int)(this->_playerList)._end - (int)piVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar9 = (this->_playerList)._begin; cVar2 = (char)local_1c; } if ((uint)(*(int *)(*piVar9 + 0x134c) + *(int *)(*piVar9 + 0x1344)) < 3) { cVar2 = '\0'; } } pEVar7 = local_24; if ((g_game->_dailyChallenge)._id == 0) { if ((cVar2 == '\0') || (0x3f < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(g_game->_playerManager)._playerList._begin >> 2))) { if (bVar12) goto LAB_009bb10b; } else if (bVar12) { LAB_009bb10b: if ((local_24 != (Entity_Player *)0x0) && (local_24->_parent == (EntityPtr)0x0)) { local_24 = (Entity_Player *)&DAT_00000013; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar11,FUN_00a209e0,&local_24,0,0); if ((cVar2 != '\0') && (pEVar7->_variant != 0)) { if (((pEVar7->_sprite)._animState._animData != (void *)0x0) && ((pEVar7->_sprite)._animState._isPlaying != 0)) { animName = (pEVar7->_sprite)._animState._animData; if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } appearText = "Appear"; do { bVar3 = *animName; bVar12 = bVar3 < (byte)*appearText; if (bVar3 != *appearText) { LAB_009bb198: uVar5 = -(uint)bVar12 | 1; goto LAB_009bb19d; } if (bVar3 == 0) break; bVar3 = animName[1]; bVar12 = bVar3 < (byte)appearText[1]; if (bVar3 != appearText[1]) goto LAB_009bb198; animName = animName + 2; appearText = appearText + 2; } while (bVar3 != 0); uVar5 = 0; LAB_009bb19d: if (uVar5 == 0) goto LAB_009bb22f; } piVar9 = (this->_playerList)._begin; if ((int)(this->_playerList)._end - (int)piVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); piVar9 = (this->_playerList)._begin; } if ((*(char *)(*piVar9 + 0x1398) == '\0') && (*(char *)(*piVar9 + 0x139a) == '\0') ) { uVar5 = Random(); poofPos.x = (pEVar7->_pos).x + 0.0; poofPos.y = (pEVar7->_pos).y - 10.0; Game::Spawn(g_game,1000,0xf,&poofPos,&g_vectorZero,(Entity *)0x0,0,uVar5); RemoveCoPlayer(this,pEVar7,unusedBool); } } } } else { local_24 = (Entity_Player *)&DAT_00000013; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar11,FUN_00a209e0,&local_24,0,0); if ((cVar2 != '\0') && (iVar8 = GetPlayerSlotFromController(this,iVar11), -1 < iVar8)) { bVar3 = CoopBabiesOnly(); if (bVar3 == 0) { if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) { (**(code **)(*inputDevice + 0x54))(0x13); this->_coopSlots[iVar8]._playerType = 0; this->_coopSlots[iVar8]._state = 1; this->_coopSlots[iVar8]._menuPosition = 1.0; this->_coopSlots[iVar8]._isPlayerTypeForced = 0; } else { challengeParams = Game::GetChallengeParams(g_game); this->_coopSlots[iVar8]._playerType = challengeParams->_playerType; this->_coopSlots[iVar8]._state = 1; this->_coopSlots[iVar8]._menuPosition = 1.0; this->_coopSlots[iVar8]._isPlayerTypeForced = 1; } } else { spawn_coop_baby_for_join(this,-1,iVar11); } } } } else { if (bVar12) goto LAB_009bb10b; local_28 = 2.66247e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar11,FUN_00a209e0,&local_28,0,0); pMVar1 = g_manager; if (cVar2 != '\0') { local_1c = 0xbb; seed_fart_sound_override(&local_1c); SoundEffects::Play(&pMVar1->_sfxManager,local_1c,0.5,2,0,1.0,0.0); } } LAB_009bb22f: local_8 = 4; } else { if (bVar12) goto LAB_009bae76; local_1c = 0x13; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar11,FUN_00a209e0,&local_1c,0,0); if (cVar2 == '\0') goto LAB_009bae76; local_1c = 8; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar11,FUN_00a20940,&local_1c,0,0); if (cVar2 == '\0') goto LAB_009bae76; local_1c = 10; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar11,FUN_00a20940,&local_1c,0,0); if (cVar2 == '\0') goto LAB_009bae76; if (g_game != (Game *)0x0) { Console::print_format(&g_game->_console,"Joining as possessor\n"); } pEVar7 = (Entity_Player *)SpawnCoPlayer2(this,0xffffffff); Entity_Player::SetControllerIndex(pEVar7,iVar11,1); local_8 = 3; } if (((inputDeviceRef != (int *)0x0) && (cVar2 = (**(code **)(*inputDeviceRef + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&inputDevice); } fVar10 = local_18; LAB_009bb25d: fVar10 = (float)((int)fVar10 + 1); } } local_20 = (PlayerManager *)&DAT_00000004; coopSlot = this; do { piVar9 = &coopSlot->_coopSlots[0]._state; if ((-1 < coopSlot->_coopSlots[0]._controllerIndex) && (-1 < *piVar9)) { bVar3 = CoopBabiesOnly(); if (bVar3 == 0) { local_28 = 2.8026e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (extraout_ECX,FUN_00a209e0,&local_28,0,0); if (cVar2 == '\0') { local_28 = 2.94273e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (coopSlot->_coopSlots[0]._controllerIndex,FUN_00a209e0,&local_28,0,0); if (cVar2 == '\0') { local_28 = 1.96182e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (coopSlot->_coopSlots[0]._controllerIndex,FUN_00a209e0,&local_28,0,0 ); if ((cVar2 == '\0') && (coopSlot->_coopSlots[0]._isPlayerTypeForced == 0)) { local_1c = 0xf; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (coopSlot->_coopSlots[0]._controllerIndex,FUN_00a209e0,&local_1c,0 ,0); if (cVar2 == '\0') goto LAB_009bb567; } else { iVar11 = coopSlot->_coopSlots[0]._playerType; coopSlot->_coopSlots[0]._isPlayerTypeForced = 0; if (iVar11 == -1) { pvVar6 = (this->_coopPlayerTypes)._begin; uVar4 = ((int)(this->_coopPlayerTypes)._end - (int)pvVar6 >> 2) - 1; if (uVar4 == 0) { uVar5 = 0; } else { uVar5 = Random(); uVar5 = uVar5 % uVar4; pvVar6 = (this->_coopPlayerTypes)._begin; } iVar11 = *(int *)((int)pvVar6 + uVar5 * 4 + 4); } local_14 = (Entity_Player *)SpawnCoPlayer2(&g_game->_playerManager,iVar11); Entity_Player::SetControllerIndex (local_14,coopSlot->_coopSlots[0]._controllerIndex,1); game = g_game; playerEntry = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)playerEntry >> 2 == 0) { KAGE_LogMessage(0x10,(byte *) "PlayerManager::GetPlayer() : There are no players! \n"); playerEntry = (game->_playerManager)._playerList._begin; } local_28 = *(float *)(*playerEntry + 0x33c); local_18 = *(float *)(*playerEntry + 0x340); uVar4 = Random(); fVar10 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_24 = (Entity_Player *)(fVar10 + fVar10); fVar10 = cos((float)local_24); local_28 = fVar10 * 10.0 + local_28; fVar10 = sin((float)local_24); pEVar7 = local_14; this_00 = &g_game->_hud; (local_14->_pos).x = local_28; (local_14->_pos).y = fVar10 * 10.0 + local_18; HUD::AssignPlayerHUDs(this_00); Entity_Player::InitPostLevelInitStats(pEVar7); pEVar7->_controlsCooldown = 0xf; uVar4 = Random(); poofPos.x = (pEVar7->_pos).x; poofPos.y = (pEVar7->_pos).y; Game::Spawn(g_game,1000,0xf,&poofPos,&g_vectorZero,(Entity *)0x0,0,uVar4); iVar11 = pEVar7->_damageCooldown; if (iVar11 < 0x2d) { iVar11 = 0x2d; } pEVar7->_damageCooldown = iVar11; } goto LAB_009bb561; } iVar11 = *piVar9 + 1; *piVar9 = iVar11; pvVar6 = (this->_coopPlayerTypes)._begin; if ((int)(this->_coopPlayerTypes)._end - (int)pvVar6 >> 2 <= iVar11) { *piVar9 = 0; iVar11 = 0; pvVar6 = (this->_coopPlayerTypes)._begin; } iVar11 = *(int *)((int)pvVar6 + iVar11 * 4); local_24 = (Entity_Player *)0xc3; } else { iVar11 = *piVar9 + -1; *piVar9 = iVar11; if (iVar11 < 0) { iVar11 = ((int)(this->_coopPlayerTypes)._end - (int)(this->_coopPlayerTypes)._begin >> 2) + -1; *piVar9 = iVar11; } local_24 = (Entity_Player *)0xc2; iVar11 = *(int *)((int)(this->_coopPlayerTypes)._begin + iVar11 * 4); } pMVar1 = g_manager; coopSlot->_coopSlots[0]._playerType = iVar11; seed_fart_sound_override((int *)&local_24); SoundEffects::Play(&pMVar1->_sfxManager,(int)local_24,1.0,2,0,1.0,0.0); } else { LAB_009bb561: *piVar9 = -1; } } LAB_009bb567: local_20 = (PlayerManager *)((int)&local_20[-1]._extraPlayers._capacity + 3); coopSlot = (PlayerManager *)piVar9; } while (local_20 != (PlayerManager *)0x0); } uVar4 = 0; if ((int)(this->_extraPlayers)._end - (int)(this->_extraPlayers)._begin >> 2 != 0) { do { Entity_Player::cycle_spectate_target (*(Entity_Player **)((int)(this->_extraPlayers)._begin + uVar4 * 4)); uVar4 = uVar4 + 1; } while (uVar4 < (uint)((int)(this->_extraPlayers)._end - (int)(this->_extraPlayers)._begin >> 2 )); } ExceptionList = local_10; return; } //@@ 009bb5d0 PlayerManager::Update /* ZHL [exact] __thiscall void PlayerManager::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall PlayerManager::Update(PlayerManager *this) { byte isPlaying; undefined4 *playerSlot; int *volumePlayerSlot; void *playersEnd; Game *game; PlayerManager *playerManager; SoundEffects *sfx; uint i; float playerVolume; float maxVolume; float savedMaxVolume; int soundId [2]; Manager *manager; Entity_Player *player; EntityPtr twin; int volumePlayer; game = g_game; if ((*(int *)&g_game->_roomTransition == 0) && (*(int *)&g_game->_stageTransition == 0)) { playerManager = &g_game->_playerManager; i = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playersEnd = (playerManager->_playerList)._end; if ((int)playersEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playersEnd = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (i < (uint)((int)playersEnd - (int)playerSlot >> 2)) { playerSlot = playerSlot + i; } player = (Entity_Player *)*playerSlot; if (((player->_dead != 0) && (((player->_sprite)._animState._animData == (void *)0x0 || ((player->_sprite)._animState._isPlaying == 0)))) && ((twin = player->_twinPlayer, twin == (EntityPtr)0x0 || ((*(int *)((int)twin + 0x7c) == 0 || (*(char *)((int)twin + 0x8c) == '\0')))))) { Entity_Player::TriggerDeath(player,0); game = g_game; } playerManager = &game->_playerManager; i = i + 1; } while (i < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } } playerManager = &game->_playerManager; maxVolume = 0.0; i = 0; savedMaxVolume = 0.0; if ((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2 != 0) { do { playersEnd = (playerManager->_playerList)._end; if ((int)playersEnd - (int)(playerManager->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); playersEnd = (playerManager->_playerList)._end; game = g_game; maxVolume = savedMaxVolume; } volumePlayerSlot = (playerManager->_playerList)._begin; if (i < (uint)((int)playersEnd - (int)volumePlayerSlot >> 2)) { volumePlayerSlot = volumePlayerSlot + i; } volumePlayer = *volumePlayerSlot; if (((0 < *(int *)(volumePlayer + 0x1ea8)) && ((*(uint *)(volumePlayer + 0x168) & 0x40) == 0)) && (*(char *)(volumePlayer + 0x173) == '\0')) { playerVolume = (float)*(int *)(volumePlayer + 0x1ea8) / 20.0; if (playerVolume <= 0.0) { playerVolume = 0.0; } if (1.0 <= playerVolume) { playerVolume = 1.0; } if (maxVolume <= playerVolume) { maxVolume = playerVolume; } savedMaxVolume = maxVolume; } playerManager = &game->_playerManager; i = i + 1; } while (i < (uint)((int)(game->_playerManager)._playerList._end - (int)(playerManager->_playerList)._begin >> 2)); } sfx = &g_manager->_sfxManager; if (0.01 < maxVolume) { isPlaying = SFXManager::IsPlaying(sfx,0x1fc); manager = g_manager; if (isPlaying != 0) { SFXManager::AdjustVolume(sfx,0x1fc,savedMaxVolume); SFXManager::AdjustPitch(sfx,0x1fc,1.0); return; } soundId[0] = 0x1fc; seed_fart_sound_override(soundId); SoundEffects::Play(&manager->_sfxManager,soundId[0],savedMaxVolume,2,1,1.0,0.0); } else { isPlaying = SFXManager::IsPlaying(sfx,0x1fc); if (isPlaying != 0) { SFXManager::Stop(sfx,0x1fc); return; } } return; } //@@ 009bb840 PlayerManager::trigger_room_clear /* DB: Entity_Player::TriggerRoomClear for every player + Entity_Familiar::TriggerRoomClear; ENTITY_BEAST calls it twice per dead harbinger (beast.md) prototype: db/protos.zhl */ void __thiscall PlayerManager::trigger_room_clear(PlayerManager *this) { qword qVar1; void *pvVar2; qword *pqVar3; uint uVar4; undefined4 *puVar5; EntityList_EL local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e96d; local_10 = ExceptionList; ExceptionList = &local_10; pvVar2 = (this->_playerList)._end; uVar4 = 0; puVar5 = (this->_playerList)._begin; if ((int)pvVar2 - (int)puVar5 >> 2 != 0) { do { if ((int)pvVar2 - (int)puVar5 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar2 = (this->_playerList)._end; puVar5 = (this->_playerList)._begin; } if (uVar4 < (uint)((int)pvVar2 - (int)puVar5 >> 2)) { puVar5 = puVar5 + uVar4; } Entity_Player::TriggerRoomClear((Entity_Player *)*puVar5); pvVar2 = (this->_playerList)._end; uVar4 = uVar4 + 1; puVar5 = (this->_playerList)._begin; } while (uVar4 < (uint)((int)pvVar2 - (int)puVar5 >> 2)); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_20,3,-1,-1,1,0); local_8 = 0; uVar4 = 0; if (local_20._size != 0) { do { Entity_Familiar::TriggerRoomClear(*(Entity_Familiar **)((int)local_20._data + uVar4 * 4)); uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_20._size); } if (local_20._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar3 = &g_allocatedBytesNoHeap; } else { pqVar3 = (qword *)((int)g_mainHeap + 0x30); } if (local_20._data != (void *)0x0) { uVar4 = *(uint *)((int)local_20._data + -4); qVar1 = *pqVar3; *(uint *)pqVar3 = (uint)*pqVar3 - uVar4; *(uint *)((int)pqVar3 + 4) = *(uint *)((int)pqVar3 + 4) - (uint)((uint)qVar1 < uVar4); free((void *)((int)local_20._data + -4)); } } ExceptionList = local_10; return; } //@@ 009bb960 PlayerManager::trigger_level_start /* DB: ? Level::RestoreGameState: Entity_Player::level_start(0) for every player, FUN_0062b360 on each familiar (type 3) in the room list, clears Game+0x676b0 */ void PlayerManager::trigger_level_start(void) { void *pvVar1; int iVar2; int *in_ECX; uint uVar3; undefined4 *puVar4; uVar3 = 0; iVar2 = in_ECX[1]; puVar4 = (undefined4 *)*in_ECX; if (iVar2 - (int)puVar4 >> 2 != 0) { do { if (iVar2 - (int)puVar4 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); iVar2 = in_ECX[1]; puVar4 = (undefined4 *)*in_ECX; } if (uVar3 < (uint)(iVar2 - (int)puVar4 >> 2)) { puVar4 = puVar4 + uVar3; } Entity_Player::level_start((Entity_Player *)*puVar4,0); iVar2 = in_ECX[1]; uVar3 = uVar3 + 1; puVar4 = (undefined4 *)*in_ECX; } while (uVar3 < (uint)(iVar2 - (int)puVar4 >> 2)); } uVar3 = 0; pvVar1 = g_game->_room; if (*(int *)((int)pvVar1 + 0x1264) == 0) { g_game->_rewindsThisFloor = 0; return; } do { iVar2 = *(int *)(*(int *)((int)pvVar1 + 0x125c) + uVar3 * 4); if ((iVar2 != 0) && (*(int *)(iVar2 + 0x28) == 3)) { Entity_Familiar::level_start(); } uVar3 = uVar3 + 1; } while (uVar3 < *(uint *)((int)pvVar1 + 0x1264)); g_game->_rewindsThisFloor = 0; return; } //@@ 009bba30 PlayerManager::enter_level /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this=PlayerManager (player vector at +0); builds co-op spawn offsets relative to player 0 into a global Vector list, Entity_Player::room_enter per player, Game::save_rewind_state, TextureCache::Purge; called from Level::generate_greed and the stage-start routine 0x706020 prototype: db/protos.zhl */ void __thiscall PlayerManager::enter_level(PlayerManager *this) { uint uVar1; int *piVar2; void **b; int iVar3; undefined4 *playerSlot; Vector *followPos; byte *a; void *pvVar4; Entity_Familiar *entity; undefined4 *playerSlot; Entity_Familiar *familiar; Entity_Player *pEVar6; uint entityIndex; int *piVar7; float fVar8; float fVar9; undefined1 local_4c [4]; float offsetX; Entity_Player *local_44; float local_40; Entity_Player *leadPlayer; Vector local_38; void *local_30; undefined8 preloadGroupName; char local_24 [8]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; float *offsetsEnd; local_8 = 0xffffffff; puStack_c = &LAB_00b0e9a5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c9435c) && (_Init_thread_header(&DAT_00c9435c,local_14), DAT_00c9435c == -1)) { _atexit((_func_4879 *)&LAB_00b16a40); _Init_thread_footer(&DAT_00c9435c); } leadPlayer = this->_roomTransitionPlayer; if (leadPlayer == (Entity_Player *)0x0) { leadPlayer = Game::GetPlayer(g_game,0); } DAT_00c94364 = DAT_00c94360; pvVar4 = (this->_playerList)._end; piVar7 = (this->_playerList)._begin; local_30 = (void *)0x0; if ((int)pvVar4 - (int)piVar7 >> 2 != 0) { do { if ((int)pvVar4 - (int)piVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (this->_playerList)._end; piVar7 = (this->_playerList)._begin; } if (local_30 < (uint)((int)pvVar4 - (int)piVar7 >> 2)) { piVar7 = piVar7 + (int)local_30; } pEVar6 = (Entity_Player *)*piVar7; offsetX = (pEVar6->_pos).x - (leadPlayer->_pos).x; local_44 = (Entity_Player *)((pEVar6->_pos).y - (leadPlayer->_pos).y); if (((offsetX == g_vectorZero.x) && ((float)local_44 == g_vectorZero.y)) && (pEVar6 != leadPlayer)) { uVar1 = Random(); local_40 = (float)((double)(int)uVar1 + __uint_to_double_fixup[-((int)uVar1 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_40 = local_40 + local_40; local_38.y = sin(local_40); offsetX = cos(local_40); local_44 = (Entity_Player *)local_38.y; } offsetsEnd = DAT_00c94364; if (DAT_00c94364 == DAT_00c94368) { std::vector::_Emplace_reallocate(DAT_00c94364,&offsetX); } else { *DAT_00c94364 = offsetX; offsetsEnd[1] = (float)local_44; DAT_00c94364 = DAT_00c94364 + 2; } pvVar4 = (this->_playerList)._end; local_30 = (void *)((int)local_30 + 1); piVar7 = (this->_playerList)._begin; } while (local_30 < (uint)((int)pvVar4 - (int)piVar7 >> 2)); } local_30 = (void *)((uint)local_30 & 0xffffff00); pEVar6 = (Entity_Player *)0x0; if ((int)pvVar4 - (int)piVar7 >> 2 != 0) { do { if ((int)pvVar4 - (int)piVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (this->_playerList)._end; piVar7 = (this->_playerList)._begin; } if (pEVar6 < (Entity_Player *)((int)pvVar4 - (int)piVar7 >> 2)) { piVar7 = piVar7 + (int)pEVar6; } Entity_Player::room_enter((Entity_Player *)*piVar7); pvVar4 = (this->_playerList)._end; piVar7 = (this->_playerList)._begin; if ((int)pvVar4 - (int)piVar7 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar4 = (this->_playerList)._end; piVar7 = (this->_playerList)._begin; } local_38.y = (float)((int)pvVar4 - (int)piVar7 >> 2); piVar2 = piVar7 + (int)pEVar6; if ((uint)local_38.y <= pEVar6) { piVar2 = piVar7; } local_30 = (void *)((uint)local_30 & 0xff); if (*(char *)(*piVar2 + 0x13f1) != '\0') { local_30 = (void *)0x1; } pEVar6 = (Entity_Player *)&pEVar6->field_0x1; } while (pEVar6 < (uint)local_38.y); if ((char)local_30 != '\0') { local_18 = 0xf; local_1c = 0xc; preloadGroupName = 0x7420726579616c70; builtin_strncpy(local_24,"ears",5); local_8 = 0; PreloadManager::load_group(&preloadGroupName); goto LAB_009bbdab; } } local_38.y = (float)&g_game->_preloadManager; local_18 = 0xf; local_1c = 0xc; preloadGroupName = 0x7420726579616c70; builtin_strncpy(local_24,"ears",5); local_8 = 1; std::map::_Find_lower_bound(local_4c,&preloadGroupName); pEVar6 = local_44; if (*(char *)((int)&(local_44->_damageEvents)._end + 1) == '\0') { b = &(local_44->_damageEvents)._capacity; if (0xf < (uint)local_44->_collisionIndex) { b = *b; } a = (byte *)&preloadGroupName; if (0xf < local_18) { a = (byte *)preloadGroupName; } iVar3 = string_compare(a,0xc,(byte *)b,local_44->_index); if (((-1 < iVar3) && (pEVar6 != *(Entity_Player **)local_38.y)) && ((char)pEVar6->_type != '\0') ) { iVar3 = *(int *)&pEVar6->field_0x44; if (iVar3 != *(int *)(pEVar6->_sprite)._filename._buf) { do { KAGE::SmartPointer::reset((void *)(iVar3 + 0x18),(void *)0x0); iVar3 = iVar3 + 0x20; } while (iVar3 != *(int *)(pEVar6->_sprite)._filename._buf); } *(undefined1 *)&pEVar6->_type = 0; } } TextureCache::Purge(); LAB_009bbdab: local_8 = 0xffffffff; uVar1 = 0; pvVar4 = (this->_playerList)._end; playerSlot = (this->_playerList)._begin; if ((int)pvVar4 - (int)playerSlot >> 2 != 0) { do { local_30 = pvVar4; if ((int)pvVar4 - (int)playerSlot >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); local_30 = (this->_playerList)._end; playerSlot = (this->_playerList)._begin; } playerSlot = playerSlot + uVar1; if ((uint)((int)local_30 - (int)playerSlot >> 2) <= uVar1) { playerSlot = playerSlot; } pEVar6 = (Entity_Player *)*playerSlot; pvVar4 = local_30; local_38.y = (float)pEVar6; if ((pEVar6 != leadPlayer) && ((fVar8 = DAT_00c94360[uVar1 * 2], fVar8 != g_vectorZero.x || (DAT_00c94360[uVar1 * 2 + 1] != g_vectorZero.y)))) { local_38.y = (pEVar6->_pos).x; local_40 = (pEVar6->_pos).y; fVar8 = sqrtf(DAT_00c94360[uVar1 * 2 + 1] * DAT_00c94360[uVar1 * 2 + 1] + fVar8 * fVar8); if (fVar8 <= 0.0) { fVar8 = DAT_00c94360[uVar1 * 2]; fVar9 = DAT_00c94360[uVar1 * 2 + 1]; } else { fVar9 = (3.0 / fVar8) * DAT_00c94360[uVar1 * 2 + 1]; fVar8 = (3.0 / fVar8) * DAT_00c94360[uVar1 * 2]; } (pEVar6->_pos).x = local_38.y + fVar8; (pEVar6->_pos).y = local_40 + fVar9; pvVar4 = (this->_playerList)._end; playerSlot = (this->_playerList)._begin; } uVar1 = uVar1 + 1; } while (uVar1 < (uint)((int)pvVar4 - (int)playerSlot >> 2)); } entityIndex = 0; pvVar4 = g_game->_room; uVar1 = 0; if (*(int *)((int)pvVar4 + 0x1264) != 0) { do { entity = *(Entity_Familiar **)(*(int *)((int)pvVar4 + 0x125c) + entityIndex * 4); if ((entity != (Entity_Familiar *)0x0) && (entity->_type == 3)) { followPos = Entity_Familiar::GetFollowTargetPosition(entity,&local_38,0); (entity->_pos).x = followPos->x; (entity->_pos).y = followPos->y; } uVar1 = *(uint *)((int)pvVar4 + 0x1264); entityIndex = entityIndex + 1; } while (entityIndex < uVar1); } entityIndex = 0; if (uVar1 != 0) { do { entity = *(Entity_Familiar **)(*(int *)((int)pvVar4 + 0x125c) + entityIndex * 4); if ((entity == (Entity_Familiar *)0x0) || (entity->_type != 3)) { familiar = (Entity_Familiar *)0x0; if (entity != (Entity_Familiar *)0x0) goto LAB_009bbf5f; LAB_009bbf80: entity = (Entity_Familiar *)0x0; } else { familiar = entity; LAB_009bbf5f: if (((*(int *)&g_game->_deathmatchManager < 2) || (entity->_type != 1)) && (0x3dd < entity->_type - 10U)) goto LAB_009bbf80; } if (familiar == (Entity_Familiar *)0x0) { if (entity != (Entity_Familiar *)0x0) { Entity_NPC::room_enter(); } } else { Entity_Familiar::room_enter(familiar); } entityIndex = entityIndex + 1; } while (entityIndex < *(uint *)((int)pvVar4 + 0x1264)); } Game::save_rewind_state(-1); ExceptionList = local_10; return; } //@@ 009bc000 PlayerManager::trigger_new_room_effects /* DB: ECX = player vector (GetPlayer "There are no players!" assert): Entity_Player::TriggerNewRoom_TemporaryEffects for every player, then queries room EntityList sublist +0x1218 and runs FUN_0062c8a0 on each (familiar variants 0xcb/0xdd new-room hooks); called by Level::ChangeRoom, Game::rewind, StageTransition::Update prototype: db/protos.zhl */ void __thiscall PlayerManager::trigger_new_room_effects(PlayerManager *this) { qword qVar1; uint uVar2; void *pvVar3; qword *pqVar4; uint uVar5; undefined4 *puVar6; EntityList_EL local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0e96d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar3 = (this->_playerList)._end; uVar5 = 0; puVar6 = (this->_playerList)._begin; if ((int)pvVar3 - (int)puVar6 >> 2 != 0) { do { if ((int)pvVar3 - (int)puVar6 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (this->_playerList)._end; puVar6 = (this->_playerList)._begin; } if (uVar5 < (uint)((int)pvVar3 - (int)puVar6 >> 2)) { puVar6 = puVar6 + uVar5; } Entity_Player::TriggerNewRoom_TemporaryEffects((Entity_Player *)*puVar6); pvVar3 = (this->_playerList)._end; uVar5 = uVar5 + 1; puVar6 = (this->_playerList)._begin; } while (uVar5 < (uint)((int)pvVar3 - (int)puVar6 >> 2)); } EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_20,3,-1,-1,1,0); local_8 = 0; uVar5 = 0; if (local_20._size != 0) { do { FUN_0062c8a0(uVar2); uVar5 = uVar5 + 1; } while (uVar5 < (uint)local_20._size); } if (local_20._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } if (local_20._data != (void *)0x0) { uVar2 = *(uint *)((int)local_20._data + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar2); free((void *)((int)local_20._data + -4)); } } ExceptionList = local_10; return; } //@@ 009bc120 PlayerManager::trigger_coop_baby_death /* DB: Entity_Player::TriggerDeath for variant 1 (co-op baby): if variant 0 ends the game (Game::End, event counter 10, music 0x5d), else RemoveCoPlayer and spawns effect 1000.15 poof */ void PlayerManager::trigger_coop_baby_death(Entity_Player *param_1) { Entity_Player *player; uint seed; PlayerManager *in_ECX; PersistentGameData *this; void *pvVar1; uint uVar2; bool bVar3; Vector local_10; if (param_1->_variant == 0) { this = &g_manager->_persistentGameData; *(Entity_Player **)&in_ECX->field_0x7c = param_1; PersistentGameData::IncreaseEventCounter(this,10,1); Music::Play((Music *)&g_manager->_musicManager,0x5d,(g_manager->_optionsConfig)._musicVolume); if (8 < ((int)(g_manager->_musicManager)._entries._end - (int)(g_manager->_musicManager)._entries._begin) / 0x60) { (g_manager->_musicManager)._queuedMusicID = 8; } Game::End(g_game,1); return; } bVar3 = true; if ((param_1->_babySkin == 0x3b) && (param_1->_parent != (EntityPtr)0x0)) { bVar3 = *(int *)((int)param_1->_parent + 0x28) != 1; } uVar2 = 1; pvVar1 = (in_ECX->_playerList)._begin; if (1 < (uint)((int)(in_ECX->_playerList)._end - (int)pvVar1 >> 2)) { do { player = *(Entity_Player **)((int)pvVar1 + uVar2 * 4); if ((player == param_1) && (RemoveCoPlayer(in_ECX,player,(byte)pvVar1), bVar3)) { seed = Random(); local_10.x = (param_1->_pos).x + 0.0; local_10.y = (param_1->_pos).y - 10.0; Game::SpawnEx(g_game,1000,0xf,&local_10,&g_vectorZero,(Entity *)0x0,0,seed,0); } uVar2 = uVar2 + 1; pvVar1 = (in_ECX->_playerList)._begin; } while (uVar2 < (uint)((int)(in_ECX->_playerList)._end - (int)pvVar1 >> 2)); } return; } //@@ 009bc280 PlayerManager::find_safe_spawn_position /* WARNING: Removing unreachable block (ram,0x009bc63a) */ /* WARNING: Removing unreachable block (ram,0x009bc64c) */ /* WARNING: Removing unreachable block (ram,0x009bc65c) */ /* WARNING: Removing unreachable block (ram,0x009bc662) */ /* DB: ? collects positions (+ velocity*45 lookahead) of players/enemies/projectiles in the room, then samples random points (sin/cos) clamped by Room::GetClampedPositionImpl / FindFreePickupSpawnPosition maximising distance; Entity_Player::Revive, Entity_Player::InitTwin prototype: db/protos.zhl, confirmed by RET 12 */ Vector * PlayerManager::find_safe_spawn_position(Vector *outPosition,Vector position) { float *pfVar1; float *pfVar2; void *pvVar3; uint uVar4; Vector *freePos; int iVar5; float *pfVar6; uint pointCount; float fVar7; float fVar8; float distX; float minDistSq; float *pointsEnd; Vector freeSpawnPos; Vector clampedPos; Vector local_34; float lookaheadX; float local_28; void *local_24; float bestDistSq; undefined4 local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; float candidateY; Game *game; puStack_c = &LAB_00b0e9dd; local_10 = ExceptionList; ExceptionList = &local_10; pfVar6 = (float *)0x0; pointsEnd = (float *)0x0; outPosition->x = g_vectorZero.x; outPosition->y = g_vectorZero.y; bestDistSq = 0.0; local_1c = 0; local_8 = 0; local_18 = 0.0; local_24 = g_game->_room; if (*(int *)((int)local_24 + 0x1264) != 0) { do { iVar5 = *(int *)(*(int *)((int)local_24 + 0x125c) + (int)local_18 * 4); if ((((1 < *(int *)&g_game->_deathmatchManager) && (*(int *)(iVar5 + 0x28) == 1)) || (*(int *)(iVar5 + 0x28) - 10U < 0x3de)) || (*(int *)(iVar5 + 0x28) == 9)) { local_34.x = *(float *)(iVar5 + 0x33c); local_34.y = *(float *)(iVar5 + 0x340); if (pfVar6 == (float *)0x0) { std::vector::_Emplace_reallocate(0,&local_34); } else { *pfVar6 = local_34.x; pfVar6[1] = local_34.y; pointsEnd = pfVar6 + 2; } lookaheadX = *(float *)(iVar5 + 0x360) * 30.0 * 1.5 + *(float *)(iVar5 + 0x33c); local_28 = *(float *)(iVar5 + 0x364) * 30.0 * 1.5 + *(float *)(iVar5 + 0x340); if (pointsEnd == (float *)0x0) { std::vector::_Emplace_reallocate(0,&lookaheadX); pfVar6 = (float *)0x0; } else { *pointsEnd = lookaheadX; pointsEnd[1] = local_28; pfVar6 = pointsEnd + 2; pointsEnd = pfVar6; } } local_18 = (float)((int)local_18 + 1); } while ((uint)local_18 < (uint)*(float *)((int)local_24 + 0x1264)); } local_1c = 0; pointCount = (int)pfVar6 >> 3; local_24 = (void *)0x0; do { pvVar3 = local_24; uVar4 = Random(); local_28 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_18 = (float)(int)pvVar3 + 30.0; local_28 = local_28 + local_28; fVar7 = cos(local_28); local_34.x = fVar7 * local_18 + position.x; fVar7 = sin(local_28); game = g_game; local_34.y = fVar7 * local_18 + position.y; Room::GetClampedPositionImpl(g_game->_room,&clampedPos,&local_34,0.0,0.0,0.0,0.0); local_34.x = clampedPos.x; local_34.y = clampedPos.y; freePos = Room::FindFreePickupSpawnPosition(game->_room,&freeSpawnPos,&local_34,0.0,1,0,0); minDistSq = 1e+08; fVar7 = freePos->x; candidateY = freePos->y; uVar4 = 0; if (pointCount < 4) { if (pointCount != 0) goto LAB_009bc5d1; } else { pfVar6 = (float *)&DAT_00000014; iVar5 = (pointCount - 4 >> 2) + 1; uVar4 = iVar5 * 4; do { fVar8 = (candidateY - pfVar6[-4]) * (candidateY - pfVar6[-4]) + (fVar7 - pfVar6[-5]) * (fVar7 - pfVar6[-5]); if (minDistSq <= fVar8) { fVar8 = minDistSq; } minDistSq = (candidateY - pfVar6[-2]) * (candidateY - pfVar6[-2]) + (fVar7 - pfVar6[-3]) * (fVar7 - pfVar6[-3]); if (fVar8 <= minDistSq) { minDistSq = fVar8; } fVar8 = (fVar7 - pfVar6[-1]) * (fVar7 - pfVar6[-1]) + (candidateY - *pfVar6) * (candidateY - *pfVar6); pfVar1 = pfVar6 + 1; if (minDistSq <= fVar8) { fVar8 = minDistSq; } pfVar2 = pfVar6 + 2; pfVar6 = pfVar6 + 8; minDistSq = (candidateY - *pfVar2) * (candidateY - *pfVar2) + (fVar7 - *pfVar1) * (fVar7 - *pfVar1); if (fVar8 <= minDistSq) { minDistSq = fVar8; } iVar5 = iVar5 + -1; } while (iVar5 != 0); while (uVar4 < pointCount) { LAB_009bc5d1: fVar8 = candidateY - *(float *)(uVar4 * 8 + 4); distX = fVar7 - *(float *)(uVar4 * 8); uVar4 = uVar4 + 1; fVar8 = fVar8 * fVar8 + distX * distX; if (minDistSq <= fVar8) { fVar8 = minDistSq; } minDistSq = fVar8; } } if (bestDistSq < minDistSq) { outPosition->x = fVar7; outPosition->y = candidateY; bestDistSq = minDistSq; } } while ((bestDistSq <= 14400.0) && (local_24 = (void *)((int)local_24 + 3), (int)local_24 < 0x96) ); ExceptionList = local_10; return outPosition; } //@@ 009bc690 PlayerManager::get_player_start_position /* DB: (out Vector*, player, basePos): basePos or Room::GetCenterPos when zero; with N players spreads them 48px apart by _playerIndex (0x161c), two rows +-24 when more than 2, slight y bias -0.01*idx; Entity_Player::level_start, NpcAI::ENTITY_MOTHER */ float * PlayerManager::get_player_start_position(float *param_1,int param_2,float *param_3) { int iVar1; int iVar2; bool bVar3; Vector *pVVar4; int iVar5; int *in_ECX; int iVar6; int iVar7; float fVar8; float fVar9; float fVar10; Vector local_c; iVar6 = *(int *)(param_2 + 0x161c); iVar1 = in_ECX[1]; iVar2 = *in_ECX; fVar8 = param_3[1]; *param_1 = *param_3; fVar10 = *param_1; iVar7 = iVar1 - iVar2 >> 2; bVar3 = fVar10 == g_vectorZero.x; param_1[1] = fVar8; if ((bVar3) && (param_1[1] == g_vectorZero.y)) { pVVar4 = Room::GetCenterPos(&local_c); fVar10 = pVVar4->x; fVar8 = pVVar4->y; *param_1 = fVar10; param_1[1] = fVar8; } if (iVar7 != 1) { fVar8 = param_1[1]; if (iVar7 == 2) { fVar9 = 0.5; } else { iVar5 = (iVar7 + 1) / 2; if (iVar6 < iVar5) { fVar8 = fVar8 - 24.0; } else { fVar8 = fVar8 + 24.0; iVar6 = iVar6 - iVar5; iVar5 = iVar7 - (iVar1 - iVar2 >> 0x1f) >> 1; } fVar9 = (float)(iVar5 + -1) * 0.5; } param_1[1] = fVar8 - (float)iVar6 * 0.01; *param_1 = ((float)iVar6 - fVar9) * 48.0 + fVar10; } return param_1; } //@@ 009bc790 PlayerManager::match_saved_players /* DB: ? (out vector, GameState*, bool): builds a vector sized to state +0x19d78 players, list of current players with +0x2c == 0, assigns each saved slot the player whose controller index (+0x1618) matches; PlayerManager::RestoreGameState and RestoreGameState_PostLevelInit */ int * PlayerManager::match_saved_players(int *param_1,int param_2,char param_3) { uint securityCookie; void *pvVar1; int *piVar2; undefined4 *tmpNode; int *listNode; undefined4 spawnedPlayer; PlayerManager *in_ECX; int extraout_ECX; int iVar3; PlayerManager *manager; int iVar4; undefined4 *tmpNode; uint spawnedPlayer; int slotOffset; int *unmatchedPlayers; int unmatchedCount; undefined4 local_28; int **local_24; undefined4 *local_20; undefined4 local_1c; PlayerManager *self; void *local_10; undefined1 *puStack_c; undefined4 local_8; bool isFillByLoop; puStack_c = &LAB_00b0ea2e; local_10 = ExceptionList; securityCookie = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; local_28 = 0; spawnedPlayer = *(uint *)(param_2 + 0x19d78); local_1c = 0; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; self = in_ECX; if (spawnedPlayer != 0) { if (0x3fffffff < spawnedPlayer) { /* WARNING: Subroutine does not return */ std::_Xlen(securityCookie); } pvVar1 = std::_Allocate(spawnedPlayer * 4); *param_1 = (int)pvVar1; param_1[1] = (int)pvVar1; param_1[2] = (int)((int)pvVar1 + spawnedPlayer * 4); tmpNode = (undefined4 *)*param_1; if ((local_1c == 0) || (((((char)local_1c == '\0' && (local_1c._1_1_ == '\0')) && (local_1c._2_1_ == '\0')) && (local_1c._3_1_ == '\0')))) { isFillByLoop = false; } else { isFillByLoop = true; } local_20 = tmpNode + spawnedPlayer; if (isFillByLoop) { for (; spawnedPlayer != 0; spawnedPlayer = spawnedPlayer - 1) { *tmpNode = 0; tmpNode = tmpNode + 1; } } else { memset(tmpNode,0,spawnedPlayer * 4); } param_1[1] = (int)local_20; } local_8 = 0; local_28 = 1; unmatchedPlayers = (int *)0x0; unmatchedCount = 0; piVar2 = operator_new(0xc); *piVar2 = (int)piVar2; piVar2[1] = (int)piVar2; spawnedPlayer = 0; local_8 = 1; pvVar1 = (self->_playerList)._begin; manager = self; unmatchedPlayers = piVar2; if ((int)(self->_playerList)._end - (int)pvVar1 >> 2 != 0) { do { if (*(int *)(*(int *)((int)pvVar1 + spawnedPlayer * 4) + 0x2c) == 0) { if (unmatchedCount == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_24 = &unmatchedPlayers; local_8._0_1_ = 2; local_20 = (undefined4 *)0x0; tmpNode = operator_new(0xc); local_8 = CONCAT31(local_8._1_3_,1); local_20 = (undefined4 *)0x0; tmpNode[2] = *(undefined4 *)((int)pvVar1 + spawnedPlayer * 4); unmatchedCount = unmatchedCount + 1; tmpNode = (undefined4 *)piVar2[1]; *tmpNode = piVar2; tmpNode[1] = tmpNode; piVar2[1] = (int)tmpNode; *tmpNode = tmpNode; manager = self; piVar2 = unmatchedPlayers; } spawnedPlayer = spawnedPlayer + 1; pvVar1 = (manager->_playerList)._begin; } while (spawnedPlayer < (uint)((int)(manager->_playerList)._end - (int)pvVar1 >> 2)); } iVar4 = 0; iVar3 = *(int *)(param_2 + 0x19d78); if (0 < iVar3) { slotOffset = 0; do { if (*(int *)(param_2 + 0x1a2a4 + slotOffset) == 0) { listNode = (int *)*piVar2; if (listNode != piVar2) { do { if (*(int *)(listNode[2] + 0x1618) == *(int *)(slotOffset + 0x1a2a0 + param_2)) { *(int *)(*param_1 + iVar4 * 4) = listNode[2]; *(int *)listNode[1] = *listNode; *(int *)(*listNode + 4) = listNode[1]; unmatchedCount = unmatchedCount + -1; operator_delete(listNode,0xc); piVar2 = unmatchedPlayers; break; } listNode = (int *)*listNode; } while (listNode != piVar2); } } iVar4 = iVar4 + 1; slotOffset = slotOffset + 0x5dc; iVar3 = *(int *)(param_2 + 0x19d78); } while (iVar4 < iVar3); manager = self; } if (param_3 != '\0') { if (piVar2 != (int *)*piVar2) { do { RemoveCoPlayer(manager,*(Entity_Player **)(piVar2[1] + 8),(byte)iVar3); piVar2 = (int *)piVar2[1]; iVar3 = extraout_ECX; manager = self; } while (piVar2 != (int *)*unmatchedPlayers); iVar3 = *(int *)(param_2 + 0x19d78); piVar2 = unmatchedPlayers; } iVar4 = 0; if (0 < iVar3) { tmpNode = (undefined4 *)(param_2 + 0x19d7c); do { if ((tmpNode[0x14a] == 0) && (*(int *)(*param_1 + iVar4 * 4) == 0)) { spawnedPlayer = SpawnCoPlayer2(self,*tmpNode); *(undefined4 *)(*param_1 + iVar4 * 4) = spawnedPlayer; } iVar4 = iVar4 + 1; tmpNode = tmpNode + 0x177; } while (iVar4 < *(int *)(param_2 + 0x19d78)); piVar2 = unmatchedPlayers; } } *(undefined4 *)piVar2[1] = 0; tmpNode = (undefined4 *)*piVar2; while (tmpNode != (undefined4 *)0x0) { tmpNode = (undefined4 *)*tmpNode; operator_delete(tmpNode,0xc); tmpNode = tmpNode; } operator_delete(unmatchedPlayers,0xc); ExceptionList = local_10; return param_1; } //@@ 009bcaa0 PlayerManager::RestoreGameState /* DB: REPENTOGON name; Game::restore_game_state calls it right before Level::RestoreGameState: Entity_Player::RestoreGameState for each of state+0x19d78 players from state+0x19d7c, then per-character fixups (switch on player type) prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PlayerManager::RestoreGameState(PlayerManager *this,GameState *state) { uint uVar1; undefined4 extraout_EAX; int *extraout_EAX_00; uint seed; undefined4 constructedSubPlayer; int iVar2; int iVar3; int iVar4; int *backupPlayer; int iVar5; GameStatePlayer *pGVar6; int *piVar7; int matchedPlayers [3]; Entity_Player *newPlayer; int *local_24; PlayerManager *playerManager; GameStatePlayer *local_1c; GameStatePlayer *savedPlayer; int playerIndex; void *local_10; undefined1 *puStack_c; int local_8; Game *game; code *initFn; GameStatePlayer parentPlayer; Entity_Player *subPlayer; local_8 = 0xffffffff; puStack_c = &LAB_00b0ea81; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(matchedPlayers + 0xc); ExceptionList = &local_10; playerManager = this; match_saved_players(matchedPlayers,state,1); local_8 = 0; iVar5 = 0; iVar3 = *(int *)&state->field_0x19d78; iVar2 = matchedPlayers[0]; if (0 < iVar3) { pGVar6 = (GameStatePlayer *)&state->field_0x19d7c; do { iVar3 = *(int *)(iVar2 + iVar5 * 4); if (iVar3 != 0) { if (*(int *)(iVar3 + 0x1e68) != 0) { local_1c = (GameStatePlayer *)(iVar3 + 0x1e68); std::multiset::erase(&local_1c); *(GameStatePlayer *)(iVar3 + 0x1e68) = (GameStatePlayer)0x0; iVar2 = matchedPlayers[0]; } Entity_Player::RestoreGameState(*(Entity_Player **)(iVar2 + iVar5 * 4),pGVar6); iVar2 = matchedPlayers[0]; } iVar3 = *(int *)&state->field_0x19d78; iVar5 = iVar5 + 1; pGVar6 = pGVar6 + 0x177; } while (iVar5 < iVar3); } playerIndex = 0; if (0 < iVar3) { savedPlayer = (GameStatePlayer *)&state->field_0x19d7c; do { iVar5 = playerIndex; if (savedPlayer[0x14a] == (GameStatePlayer)0x0) { if ((int)savedPlayer[0x14b] < 0) { iVar4 = *(int *)(iVar2 + playerIndex * 4); if (iVar4 != 0) { switch(*(undefined4 *)(iVar4 + 0x13c0)) { case 0x13: local_1c = (GameStatePlayer *)&DAT_00000014; break; default: goto switchD_009bcd23_caseD_14; case 0x1d: local_1c = (GameStatePlayer *)0x26; break; case 0x23: local_1c = (GameStatePlayer *)0x28; break; case 0x26: local_1c = (GameStatePlayer *)&DAT_0000001d; } iVar4 = playerIndex + 1; if (iVar4 < iVar3) { do { iVar3 = *(int *)(iVar2 + iVar4 * 4); if ((iVar3 != 0) && (*(GameStatePlayer **)(iVar3 + 0x13c0) == local_1c)) { iVar5 = *(int *)(iVar2 + iVar5 * 4); if ((*(int *)(iVar3 + 0x1618) == *(int *)(iVar5 + 0x1618)) && (*(int *)(iVar3 + 0x1e68) == 0)) { piVar7 = (int *)(iVar5 + 0x1e68); if (*(int *)(iVar5 + 0x1e68) != iVar3) { if (*(int *)(iVar5 + 0x1e68) != 0) { local_24 = piVar7; std::multiset::erase(&local_24); } *piVar7 = iVar3; std::multiset::insert(piVar7); iVar2 = matchedPlayers[0]; } piVar7 = (int *)(*(int *)(iVar2 + iVar4 * 4) + 0x1e68); iVar3 = *(int *)(iVar2 + playerIndex * 4); if (*piVar7 != iVar3) { if (*piVar7 != 0) { local_24 = piVar7; std::multiset::erase(&local_24); } *piVar7 = iVar3; if (iVar3 != 0) { std::multiset::insert(piVar7); } iVar2 = matchedPlayers[0]; } } iVar5 = playerIndex; } iVar4 = iVar4 + 1; } while (iVar4 < *(int *)&state->field_0x19d78); } } } else { parentPlayer = *(GameStatePlayer *)(iVar2 + (int)savedPlayer[0x14b] * 4); if (parentPlayer != (GameStatePlayer)0x0) { iVar3 = *(int *)(iVar2 + playerIndex * 4); pGVar6 = (GameStatePlayer *)(iVar3 + 0x3bc); if (*(int *)(iVar3 + 0x3bc) != 0) { local_1c = pGVar6; std::multiset::erase(&local_1c); } *pGVar6 = parentPlayer; std::multiset::insert(pGVar6); iVar2 = matchedPlayers[0]; } } switchD_009bcd23_caseD_14: } else { iVar3 = (int)savedPlayer[0x14a] + playerIndex; iVar4 = *(int *)(iVar2 + iVar3 * 4); if (iVar4 != 0) { if (*(int *)(iVar4 + 0x1e6c) == 0) { newPlayer = operator_new(0x2f00); local_8._0_1_ = 1; if (newPlayer == (Entity_Player *)0x0) { constructedSubPlayer = 0; } else { Entity_Player::constructor(newPlayer); constructedSubPlayer = extraout_EAX; } local_8 = (uint)local_8._1_3_ << 8; *(undefined4 *)(*(int *)(matchedPlayers[0] + iVar3 * 4) + 0x1e6c) = constructedSubPlayer ; iVar2 = *(int *)(matchedPlayers[0] + iVar3 * 4); (**(code **)(**(int **)(iVar2 + 0x1e6c) + 4)) (1,0,*savedPlayer,*(undefined4 *)(iVar2 + 0x3ec)); iVar2 = *(int *)(matchedPlayers[0] + iVar3 * 4); *(int *)(*(int *)(iVar2 + 0x1e6c) + 0x1e6c) = iVar2; iVar2 = matchedPlayers[0]; } Entity_Player::RestoreGameState (*(Entity_Player **)(*(int *)(iVar2 + iVar3 * 4) + 0x1e6c),savedPlayer); GameStatePlayer::Init ((GameStatePlayer *) (*(int *)(*(int *)(matchedPlayers[0] + iVar3 * 4) + 0x1e6c) + 0x20ec)); subPlayer = *(Entity_Player **)(*(int *)(matchedPlayers[0] + iVar3 * 4) + 0x1e6c); Entity_Player::StoreGameState(subPlayer,&subPlayer->_unlistedRestoreState,1); iVar5 = playerIndex; *(undefined1 *)(*(int *)(*(int *)(matchedPlayers[0] + iVar3 * 4) + 0x1e6c) + 0x20e8) = 1; local_1c = savedPlayer + 0xe0; if ((GameStatePlayer *) (*(int *)(*(int *)(matchedPlayers[0] + iVar3 * 4) + 0x1e6c) + 0x246c) != local_1c) { std::vector<52byte>::assign(*local_1c,savedPlayer[0xe1],state); } *(GameStatePlayer *)(*(int *)(*(int *)(matchedPlayers[0] + iVar3 * 4) + 0x1e6c) + 0x2468) = savedPlayer[0xdf]; iVar2 = matchedPlayers[0]; } } savedPlayer = savedPlayer + 0x177; playerIndex = iVar5 + 1; iVar3 = *(int *)&state->field_0x19d78; } while (playerIndex < iVar3); } piVar7 = (int *)&playerManager->field_0x80; savedPlayer = (GameStatePlayer *)&state->field_0x1cc5c; local_1c = (GameStatePlayer *)0x4; do { pGVar6 = savedPlayer; if ((undefined4 *)*piVar7 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar7)(1,uVar1); *piVar7 = 0; } if (*pGVar6 != (GameStatePlayer)0xffffffff) { newPlayer = operator_new(0x2f00); local_8._0_1_ = 2; if (newPlayer == (Entity_Player *)0x0) { backupPlayer = (int *)0x0; } else { Entity_Player::constructor(newPlayer); backupPlayer = extraout_EAX_00; } local_8 = (uint)local_8._1_3_ << 8; *piVar7 = (int)backupPlayer; initFn = *(code **)(*backupPlayer + 4); seed = Random(); (*initFn)(1,0,0,seed); pGVar6 = savedPlayer; Entity_Player::RestoreGameState((Entity_Player *)*piVar7,savedPlayer); } savedPlayer = pGVar6 + 0x177; piVar7 = piVar7 + 1; local_1c = (GameStatePlayer *)&local_1c[-1].field_0x3; } while (local_1c != (GameStatePlayer *)0x0); *(undefined4 *)&playerManager->field_0xa8 = *(undefined4 *)&state->field_0x19f68; *(undefined8 *)&playerManager->field_0xac = 0x900000005; *(undefined4 *)&playerManager->field_0xb4 = 7; *(undefined4 *)&playerManager->field_0xa4 = *(undefined4 *)&state->field_0x19f80; *(undefined4 *)&playerManager->field_0x90 = *(undefined4 *)&state->field_0x19f6c; *(undefined4 *)&playerManager->field_0x94 = *(undefined4 *)&state->field_0x19f70; *(undefined4 *)&playerManager->field_0x98 = *(undefined4 *)&state->field_0x19f74; *(undefined4 *)&playerManager->field_0x9c = *(undefined4 *)&state->field_0x19f78; game = g_game; *(undefined4 *)&playerManager->field_0xa0 = *(undefined4 *)&state->field_0x19f7c; playerManager->_coopSlots[0]._controllerIndex = -1; playerManager->_coopSlots[1]._controllerIndex = -1; playerManager->_coopSlots[0]._state = -1; playerManager->_coopSlots[0]._menuPosition = 0.0; playerManager->_coopSlots[0]._playerType = 0; playerManager->_coopSlots[1]._state = -1; playerManager->_coopSlots[1]._menuPosition = 0.0; playerManager->_coopSlots[1]._playerType = 0; playerManager->_coopSlots[2]._controllerIndex = -1; playerManager->_coopSlots[2]._state = -1; playerManager->_coopSlots[2]._menuPosition = 0.0; playerManager->_coopSlots[2]._playerType = 0; playerManager->_coopSlots[3]._controllerIndex = -1; playerManager->_coopSlots[3]._state = -1; playerManager->_coopSlots[3]._menuPosition = 0.0; playerManager->_coopSlots[3]._playerType = 0; HUD::AssignPlayerHUDs(&game->_hud); FID_conflict__Tidy(matchedPlayers); ExceptionList = local_10; return; } //@@ 009bd010 PlayerManager::RestoreGameState_PostLevelInit /* DB: REPENTOGON name; Game::restore_game_state calls it right after Level::RestoreGameState: spawn_dark_esau per stored player, resets the slot arrays, HUD::AssignPlayerHUDs, InvalidateCraftingItem prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall PlayerManager::RestoreGameState_PostLevelInit(PlayerManager *this,GameState *state) { Entity_Player *this_00; Game *pGVar1; int iVar2; void *gameStatePlayer; int local_20 [3]; PlayerManager *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0eaad; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = this; match_saved_players(local_20,state,0); iVar2 = 0; local_8 = 0; if (0 < *(int *)&state->field_0x19d78) { gameStatePlayer = &state->field_0x19d7c; do { this_00 = *(Entity_Player **)(local_20[0] + iVar2 * 4); if (this_00 != (Entity_Player *)0x0) { Entity_Player::spawn_dark_esau(this_00,gameStatePlayer); } iVar2 = iVar2 + 1; gameStatePlayer = (void *)((int)gameStatePlayer + 0x5dc); } while (iVar2 < *(int *)&state->field_0x19d78); this = local_14; } pGVar1 = g_game; this->_coopSlots[0]._controllerIndex = -1; this->_coopSlots[1]._controllerIndex = -1; this->_coopSlots[0]._state = -1; this->_coopSlots[0]._menuPosition = 0.0; this->_coopSlots[0]._playerType = 0; this->_coopSlots[1]._state = -1; this->_coopSlots[1]._menuPosition = 0.0; this->_coopSlots[1]._playerType = 0; this->_coopSlots[2]._controllerIndex = -1; this->_coopSlots[2]._state = -1; this->_coopSlots[2]._menuPosition = 0.0; this->_coopSlots[2]._playerType = 0; this->_coopSlots[3]._controllerIndex = -1; this->_coopSlots[3]._state = -1; this->_coopSlots[3]._menuPosition = 0.0; this->_coopSlots[3]._playerType = 0; HUD::AssignPlayerHUDs(&pGVar1->_hud); HUD::mark_all_slots_dirty(&g_game->_hud,0,0); HUD::InvalidateCraftingItem(&g_game->_hud,(Entity_Player *)0x0); FID_conflict__Tidy(local_20); ExceptionList = local_10; return; } //@@ 009bd150 PlayerManager::store_game_state /* DB: Game::store_game_state: for each non-coop-baby player Entity_Player::StoreGameState into state+0x19d7c (0x5dc each), count at +0x19d78, also twin +0x1e6c; "Number of players exceeds supported player limit (%d)!" */ void PlayerManager::store_game_state(int param_1) { int iVar1; Entity_Player *this; int *in_ECX; int iVar2; uint uVar3; int iVar4; GameStatePlayer *saveState; uint local_18; int local_14; int *local_10; local_18 = 0; *(undefined4 *)(param_1 + 0x19d78) = 0; local_10 = (int *)in_ECX[1]; if ((int)local_10 - *in_ECX >> 2 != 0) { iVar4 = *in_ECX; do { iVar1 = local_18 * 4; iVar2 = iVar4; if ((*(Entity_Player **)(iVar1 + iVar4))->_variant == 0) { uVar3 = *(uint *)(param_1 + 0x19d78); if (7 < uVar3) { LAB_009bd2e7: KAGE_LogMessage(4,(byte *)"Number of players exceeds supported player limit (%d)!\n"); break; } if (g_game->_isStoringGlowingHourglassState == 0) { Entity_Player::room_exit(*(Entity_Player **)(iVar1 + iVar4),1); iVar2 = *in_ECX; if ((uint)(in_ECX[1] - iVar2 >> 2) < (uint)((int)local_10 - iVar4 >> 2)) { local_18 = local_18 - 1; goto LAB_009bd2ca; } uVar3 = *(uint *)(param_1 + 0x19d78); } *(uint *)(*(int *)(iVar1 + iVar2) + 0x1620) = uVar3; Entity_Player::StoreGameState (*(Entity_Player **)(iVar1 + *in_ECX), (GameStatePlayer *)(*(int *)(param_1 + 0x19d78) * 0x5dc + 0x19d7c + param_1),1); uVar3 = *(int *)(param_1 + 0x19d78) + 1; *(uint *)(param_1 + 0x19d78) = uVar3; iVar2 = *in_ECX; this = *(Entity_Player **)(*(int *)(iVar2 + iVar1) + 0x1e6c); if (this != (Entity_Player *)0x0) { if (7 < uVar3) goto LAB_009bd2e7; if (g_game->_isStoringGlowingHourglassState == 0) { Entity_Player::room_exit(this,1); uVar3 = *(uint *)(param_1 + 0x19d78); iVar2 = *in_ECX; } *(uint *)(*(int *)(*(int *)(iVar1 + iVar2) + 0x1e6c) + 0x1620) = uVar3; Entity_Player::StoreGameState (*(Entity_Player **)(*(int *)(iVar1 + *in_ECX) + 0x1e6c), (GameStatePlayer *)(*(int *)(param_1 + 0x19d78) * 0x5dc + 0x19d7c + param_1),1) ; *(undefined4 *)(*(int *)(param_1 + 0x19d78) * 0x5dc + 0x1a2a4 + param_1) = 0xffffffff; *(int *)(param_1 + 0x19d78) = *(int *)(param_1 + 0x19d78) + 1; iVar2 = *in_ECX; } } LAB_009bd2ca: local_10 = (int *)in_ECX[1]; local_18 = local_18 + 1; iVar4 = iVar2; } while (local_18 < (uint)((int)local_10 - iVar2 >> 2)); } local_10 = in_ECX + 0x20; saveState = (GameStatePlayer *)(param_1 + 0x1cc5c); local_14 = 4; do { if ((Entity_Player *)*local_10 == (Entity_Player *)0x0) { *saveState = (GameStatePlayer)0xffffffff; } else { Entity_Player::StoreGameState((Entity_Player *)*local_10,saveState,1); } local_10 = local_10 + 1; saveState = saveState + 0x177; local_14 = local_14 + -1; } while (local_14 != 0); *(int *)(param_1 + 0x19f68) = in_ECX[0x2a]; *(int *)(param_1 + 0x19f80) = in_ECX[0x29]; *(int *)(param_1 + 0x19f6c) = in_ECX[0x24]; *(int *)(param_1 + 0x19f70) = in_ECX[0x25]; *(int *)(param_1 + 0x19f74) = in_ECX[0x26]; *(int *)(param_1 + 0x19f78) = in_ECX[0x27]; *(int *)(param_1 + 0x19f7c) = in_ECX[0x28]; return; } //@@ 009bd3b0 PlayerManager::spawn_coop_baby_for_join /* DB: ? PlayerManager::handle_coop_join: SpawnCoPlayerBaby, PlayExtraAnimation "Appear", SetControllerIndex, find_safe_spawn_position near player 0, sets hearts ("Co-player wants %d HP"), reassigns familiars (Entity_Familiar::set_player), copies collectibles/actives/trinkets from player 0 prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall PlayerManager::spawn_coop_baby_for_join(PlayerManager *familiar,int unused,int controllerIndex) { float fVar1; int iVar2; byte bVar3; int iVar4; undefined1 *puVar5; uint uVar6; Entity_Player *baby; Vector *safePos; float *pfVar7; uint heartParity; Entity_Familiar *familiar; int iVar8; int *piVar9; float *pfVar10; uint uVar11; qword *allocatedBytes; Entity_Player *firstPlayer; EntityList_EL local_74; undefined1 local_64 [4]; Vector local_60; float fStack_58; float fStack_54; Entity_Player *local_50; Entity_Player *local_4c; PlayerManager *local_48; uint local_44; void **local_40; int boneHeartsTaken; int iStack_38; int heartSlot; int boneHeartsLeft; int takeCount; int soulHeartsTaken; int redHeartsTaken; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; std_vector *babyVoidedCollectibles; void *familiarData; Game *game; qword oldAllocatedBytes; puStack_20 = local_64 + 0x60; local_14 = 0xffffffff; puStack_18 = &LAB_00b0eadd; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_64 + 0x54); ExceptionList = &local_1c; piVar9 = (familiar->_playerList)._begin; local_48 = familiar; puVar5 = local_64 + 0x60; if ((int)(familiar->_playerList)._end - (int)piVar9 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar9 = (familiar->_playerList)._begin; puVar5 = puStack_20; } puStack_20 = puVar5; game = g_game; local_4c = (Entity_Player *)*piVar9; iVar8 = local_4c->_redHearts; local_44 = iVar8 + local_4c->_soulHearts + local_4c->_boneHearts; if (local_4c->_maxHearts < iVar8) { iVar8 = local_4c->_maxHearts; } if ((uint)((local_4c->_soulHearts + 1) / 2 + (iVar8 + 1) / 2 + local_4c->_boneHearts) < 2) { local_50 = (Entity_Player *)0x37; std::set::find_node(local_64,&local_50); if (*(char *)((int)local_60.y + 0xd) != '\0') { ExceptionList = local_1c; return; } if (0x37 < *(int *)((int)local_60.y + 0x10)) { ExceptionList = local_1c; return; } if ((void *)local_60.y == (game->_seedEffects)._seedEffects) { ExceptionList = local_1c; return; } } baby = (Entity_Player *)SpawnCoPlayerBaby(local_48,0xffffffff,uVar6); local_50 = baby; Entity_Player::PlayExtraAnimation(baby,(byte *)"Appear"); baby->_damageCooldown = 0x96; Entity_Player::SetControllerIndex(baby,controllerIndex,1); firstPlayer = local_4c; local_60.x = (local_4c->_pos).x; local_60.y = (local_4c->_pos).y; safePos = find_safe_spawn_position(&local_60,local_4c->_pos); (baby->_pos).x = safePos->x; (baby->_pos).y = safePos->y; Entity_Player::AddMaxHearts(baby,-baby->_maxHearts,0); Entity_Player::apply_coop_baby_spawn_bonus(baby); local_40 = &(g_game->_seedEffects)._seedEffects; local_48 = (PlayerManager *)0x37; std::set::find_node(local_64,&local_48); if (((*(char *)((int)&((std_vector *)((int)local_60.y + 8))->_end + 1) == '\0') && ((int)((std_vector *)((int)local_60.y + 8))->_capacity < 0x38)) && ((Entity_Familiar *)local_60.y != *local_40)) { Entity_Player::AddMaxHearts(baby,2,0); Entity_Player::AddHearts(baby,2,1,0); } else { local_44 = local_44 >> 2; if (local_44 < 2) { local_44 = 2; } KAGE_LogMessage(1,(byte *)"Co-player wants %d HP\n"); local_48 = (PlayerManager *)firstPlayer->_soulHearts; boneHeartsLeft = firstPlayer->_boneHearts; iStack_38 = (int)((int)&(local_48->_playerList)._begin + 1) / 2 + boneHeartsLeft; redHeartsTaken = 0; local_40 = (void **)0x0; heartSlot = iStack_38 + -1; soulHeartsTaken = 0; boneHeartsTaken = 0; takeCount = 0; if (local_44 != 0) { uVar6 = firstPlayer->_redHearts; uVar11 = local_44; local_44 = boneHeartsLeft * 2; do { if (heartSlot < 0) { heartParity = uVar6 & 0x80000001; if ((int)heartParity < 0) { heartParity = (heartParity - 1 | 0xfffffffe) + 1; } iVar8 = 2 - heartParity; if ((0 < takeCount) && ((int)uVar11 < iVar8)) break; redHeartsTaken = redHeartsTaken + iVar8; uVar6 = uVar6 - iVar8; local_40 = (void **)((int)local_40 + 2); uVar11 = uVar11 - iVar8; } else if (((boneHeartsLeft < 1) || (firstPlayer->_boneHearts < 1)) || ((firstPlayer->_boneHeartsMask & 1 << ((byte)heartSlot & 0x1f)) == 0)) { heartParity = (uint)local_48 & 0x80000001; if ((int)heartParity < 0) { heartParity = (heartParity - 1 | 0xfffffffe) + 1; } iVar8 = 2 - heartParity; if ((0 < takeCount) && ((int)uVar11 < iVar8)) break; soulHeartsTaken = soulHeartsTaken + iVar8; uVar11 = uVar11 - iVar8; local_48 = (PlayerManager *)((int)local_48 - iVar8); heartSlot = heartSlot + -1; } else { fStack_58 = 2.8026e-45; fStack_54 = (float)(((uVar6 - local_44) - firstPlayer->_maxHearts) + 2); local_60.y = 0.0; pfVar10 = &fStack_54; if (1 < (int)fStack_54) { pfVar10 = &fStack_58; } pfVar7 = &local_60.y; if (0 < (int)*pfVar10) { pfVar7 = pfVar10; } fVar1 = *pfVar7; firstPlayer = local_4c; if ((0 < takeCount) && ((int)uVar11 < (int)fVar1 + 1)) break; redHeartsTaken = redHeartsTaken + (int)fVar1; boneHeartsTaken = boneHeartsTaken + 1; boneHeartsLeft = boneHeartsLeft + -1; uVar6 = uVar6 - (int)fVar1; uVar11 = uVar11 + (-1 - (int)fVar1); local_44 = local_44 - 2; heartSlot = heartSlot + -1; } takeCount = takeCount + 1; } while (0 < (int)uVar11); baby = local_50; } KAGE_LogMessage(1,(byte *)"Taking %d red HP, %d soul HP and %d bone HP\n"); iVar8 = heartSlot + 1; if (iVar8 < iStack_38) { bVar3 = (byte)iVar8 & 0x1f; local_44 = 1 << bVar3 | 1U >> 0x20 - bVar3; iStack_38 = iStack_38 - iVar8; do { game = g_game; if ((firstPlayer->_boneHearts < 1) || ((firstPlayer->_boneHeartsMask & local_44) == 0)) { uVar6 = baby->_soulHearts + 1; local_60.y = (float)(uVar6 & 0xfffffffe); puVar5 = &((Entity_Familiar *)local_60.y)->field_0x1; if (((int)puVar5 <= firstPlayer->_soulHearts) && (0 < (int)puVar5)) { uVar11 = (uint)puVar5 & 0x80000001; if ((int)uVar11 < 0) { uVar11 = (uVar11 - 1 | 0xfffffffe) + 1; } if ((uVar11 == 1) && (local_48 = (PlayerManager *)firstPlayer->_blackHearts, ((uint)local_48 & 1 << ((byte)((int)local_60.y - ((int)uVar6 >> 0x1f) >> 1) & 0x1f)) != 0)) { firstPlayer->_blackHearts = (uint)local_48 & ~(1 << ((int)&((Entity_Familiar *)local_60.y)->field_0x1 / 2 & 0x1fU)); if ((*(int *)&game->_deathmatchManager < 2) && ((firstPlayer->_dead == 0 && (0 < firstPlayer->_goldenHearts)))) { local_60.y = (float)((*(int *)((int)(&firstPlayer->_headAnim + 1) + ((firstPlayer->_redHearts <= firstPlayer->_maxHearts) + 2) * 4) + 1) / 2 + (firstPlayer->_soulHearts + 1) / 2 + firstPlayer->_boneHearts); if ((int)local_60.y < firstPlayer->_goldenHearts) { Entity_Player::BreakGoldenHearts (firstPlayer,firstPlayer->_goldenHearts - (int)local_60.y); firstPlayer->_goldenHearts = (int)local_60.y; } } Entity_Player::update_bone_hearts(firstPlayer); iVar8 = soulHeartsTaken - baby->_soulHearts; if (2 < iVar8) { iVar8 = 2; } Entity_Player::AddBlackHearts(baby,iVar8); goto LAB_009bd886; } } iVar8 = soulHeartsTaken - baby->_soulHearts; if (2 < iVar8) { iVar8 = 2; } Entity_Player::AddSoulHearts(baby,iVar8,0); } else { Entity_Player::AddBoneHearts(baby,1); } LAB_009bd886: local_44 = local_44 << 1 | (uint)((int)local_44 < 0); iStack_38 = iStack_38 + -1; } while (iStack_38 != 0); } Entity_Player::AddMaxHearts(baby,(int)local_40,0); Entity_Player::AddHearts(baby,redHeartsTaken,1,0); Entity_Player::AddSoulHearts(firstPlayer,-soulHeartsTaken,0); Entity_Player::AddHearts(firstPlayer,-redHeartsTaken,1,0); Entity_Player::AddBoneHearts(firstPlayer,-boneHeartsTaken); Entity_Player::AddMaxHearts(firstPlayer,-(int)local_40,0); } local_48 = (PlayerManager *)0x0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_74,3,-1,-1,0,0); local_14 = 0; local_44 = 0; if (local_74._size != 0) { do { iVar8 = *(int *)((int)local_74._data + local_44 * 4); iVar2 = *(int *)(iVar8 + 0x2c); if (((((iVar2 != 0x43) && (iVar2 != 0x3e)) && (iVar2 != 0x44)) && ((iVar2 != 900 && (familiar = (Entity_Familiar *) __RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0 ), *(int *)((int)familiar->_player + 0x2c) == 0)))) && (local_48 = (PlayerManager *)((int)&(local_48->_playerList)._begin + 1), local_48 == (PlayerManager *)0x2)) { Entity_Familiar::set_player(familiar,baby); break; } local_44 = local_44 + 1; } while (local_44 < (uint)local_74._size); } familiarData = local_74._data; uVar6 = 0; if (local_74._size != 0) { do { local_60.y = (float)__RTDynamicCast(*(undefined4 *)((int)familiarData + uVar6 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar:: RTTI_Type_Descriptor,0); iVar8 = __RTDynamicCast(*(undefined4 *)(*(int *)((int)familiarData + uVar6 * 4) + 0x3bc),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0); if ((((Entity_Familiar *)local_60.y != (Entity_Familiar *)0x0) && (iVar8 != 0)) && (*(Entity_Player **)(iVar8 + 0x410) != *(void **)((int)local_60.y + 0x410))) { Entity_Familiar::set_player ((Entity_Familiar *)local_60.y,*(void **)((int)local_60.y + 0x410)); } uVar6 = uVar6 + 1; } while (uVar6 < (uint)local_74._size); firstPlayer = local_4c; } local_4c = (Entity_Player *)0x0; do { local_60.y = (float)((int)local_4c * 4); iVar8 = 0; if (0 < *(int *)((int)(firstPlayer->_collectibleCounts)._begin + (int)local_60.y)) { do { Entity_Player::AddCollectible(local_50,(int)local_4c,0,1,0,0,0); iVar8 = iVar8 + 1; } while (iVar8 < *(int *)((int)(firstPlayer->_collectibleCounts)._begin + (int)local_60.y)); } baby = local_50; local_4c = (Entity_Player *)((int)local_4c + 1); } while ((int)local_4c < 0x2dd); iVar8 = firstPlayer->_activeDesc[0]._unk; iVar2 = firstPlayer->_activeDesc[0]._charge; iVar4 = firstPlayer->_activeDesc[0]._batteryCharge; local_4c = (Entity_Player *)0x2; local_50->_activeDesc[0]._item = firstPlayer->_activeDesc[0]._item; local_50->_activeDesc[0]._unk = iVar8; local_50->_activeDesc[0]._charge = iVar2; local_50->_activeDesc[0]._batteryCharge = iVar4; iVar8 = firstPlayer->_activeDesc[0]._timeRechargeCooldown; iVar2 = firstPlayer->_activeDesc[0]._partialCharge; iVar4 = firstPlayer->_activeDesc[0]._varData; local_50->_activeDesc[0]._subCharge = firstPlayer->_activeDesc[0]._subCharge; local_50->_activeDesc[0]._timeRechargeCooldown = iVar8; local_50->_activeDesc[0]._partialCharge = iVar2; local_50->_activeDesc[0]._varData = iVar4; local_50 = (Entity_Player *)firstPlayer->_trinketsID; do { if (*(int *)local_50 != 0) { Entity_Player::AddTrinket(baby,*(int *)local_50,1); } local_50 = (Entity_Player *)&local_50->field_0x4; local_4c = (Entity_Player *)((int)local_4c + -1); } while (local_4c != (Entity_Player *)0x0); local_50 = (Entity_Player *)0xc; do { *(undefined4 *)(&local_50[-1].field_0x26c0 + (int)(baby->_pillEffectUses)._begin) = *(undefined4 *)(&local_50[-1].field_0x26c0 + (int)(firstPlayer->_pillEffectUses)._begin); *(undefined4 *)((int)(baby->_pillEffectUses)._begin + (int)(&local_50->_sprite + -1) + 0xc4) = *(undefined4 *) ((int)(firstPlayer->_pillEffectUses)._begin + (int)(&local_50->_sprite + -1) + 0xc4); *(undefined4 *)((int)&local_50[-1]._replacedPlayer + (int)(baby->_pillEffectUses)._begin) = *(undefined4 *) ((int)&local_50[-1]._replacedPlayer + (int)(firstPlayer->_pillEffectUses)._begin); *(undefined4 *)((int)(baby->_pillEffectUses)._begin + (int)(&local_50->_sprite + -1) + 0xcc) = *(undefined4 *) ((int)(firstPlayer->_pillEffectUses)._begin + (int)(&local_50->_sprite + -1) + 0xcc); *(undefined4 *)((int)(baby->_pillEffectUses)._begin + (int)(&local_50->_sprite + -1) + 0xd0) = *(undefined4 *) ((int)(firstPlayer->_pillEffectUses)._begin + (int)(&local_50->_sprite + -1) + 0xd0); local_50 = (Entity_Player *)&local_50->_pendingDamage; } while ((int)local_50 < 0xd4); local_4c = (void *)0x0; if (&baby->_smeltedTrinkets != &firstPlayer->_smeltedTrinkets) { local_60.y = (float)(firstPlayer->_smeltedTrinkets)._begin; local_4c = (Entity_Player *)((int)(firstPlayer->_smeltedTrinkets)._end - (int)local_60.y); local_50 = (Entity_Player *)((int)local_4c >> 2); local_48 = (baby->_smeltedTrinkets)._begin; if ((Entity_Player *)((int)(baby->_smeltedTrinkets)._capacity - (int)local_48 >> 2) < local_50) { std::vector::reserve_clear(local_50); local_48 = (baby->_smeltedTrinkets)._begin; } memmove(local_48,(void *)local_60.y,(size_t)local_4c); (baby->_smeltedTrinkets)._end = (void *)((int)local_4c + (int)local_48); } babyVoidedCollectibles = &baby->_voidedCollectibles; if (babyVoidedCollectibles != &firstPlayer->_voidedCollectibles) { local_60.y = (float)(firstPlayer->_voidedCollectibles)._begin; local_50 = (Entity_Player *)((int)(firstPlayer->_voidedCollectibles)._end - (int)local_60.y); local_4c = babyVoidedCollectibles->_begin; if ((uint)((int)(baby->_voidedCollectibles)._capacity - (int)local_4c >> 2) < (uint)((int)local_50 >> 2)) { std::vector::reserve_clear((int)local_50 >> 2); local_4c = babyVoidedCollectibles->_begin; } memmove(local_4c,(void *)local_60.y,(size_t)local_50); (baby->_voidedCollectibles)._end = (void *)((int)local_4c + (int)(&local_50->_sprite + -1) + 0xcc); } baby->_cacheFlags = 0xffff; Entity_Player::EvaluateItems(); HUD::AssignPlayerHUDs(&g_game->_hud); if (local_74._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (local_74._data != (void *)0x0) { uVar6 = *(uint *)((int)local_74._data + -4); oldAllocatedBytes = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar6; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)oldAllocatedBytes < uVar6); free((uint *)((int)local_74._data + -4)); } } ExceptionList = local_1c; return; } //@@ 009bdc60 PlayerManager::init_random_unlocks /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x009be021) */ /* WARNING: Removing unreachable block (ram,0x009be033) */ /* WARNING: Removing unreachable block (ram,0x009be043) */ /* WARNING: Removing unreachable block (ram,0x009be049) */ /* DB: ? (seed) from PlayerManager::init_main_player: gathers 71 0x38-byte Manager+0x2a684 entries whose achievement (+0x34 <0x282) is unlocked (or always in daily/debug), shuffles with RNG shifts 3/23/25, keeps up to 5 at +0x90 (count +0xa4), then a vector at +0x70 from table DAT_00b7ec30 over 0x148-byte Manager+0x2a678 entries prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall PlayerManager::init_random_unlocks(PlayerManager *this,uint seed) { void **ppvVar1; code *pcVar2; void *pvVar3; int playerConfig; uint uVar4; undefined4 *puVar5; uint uVar6; Game *game; uint swapIndex; Manager *cachedManager; std_vector *psVar7; std_vector *babiesEnd; uint local_24; uint local_20; std_vector *local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; undefined4 *pickedBaby; uint *playerTypesEnd; undefined4 swapTmp; manager = g_manager; puStack_c = &LAB_00b0eb0d; local_10 = ExceptionList; local_18 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_24 = 0x19; *(undefined4 *)&this->field_0xa4 = 0; babiesEnd = (std_vector *)0x0; local_8 = 0; std::vector::_Reallocate(0x47); local_20 = 0; game = g_game; cachedManager = g_manager; psVar7 = babiesEnd; do { pvVar3 = (manager->_entityConfig)._babies._begin; uVar4 = *(uint *)((int)pvVar3 + local_20 + 0x34); local_1c = (std_vector *)((int)pvVar3 + local_20); if ((int)uVar4 < 0) { LAB_009bdd33: if (psVar7 == (std_vector *)0x0) { std::vector::_Emplace_reallocate(0,&local_1c); game = g_game; cachedManager = g_manager; psVar7 = babiesEnd; } else { psVar7->_begin = local_1c; babiesEnd = (std_vector *)&psVar7->_end; psVar7 = babiesEnd; } } else if (uVar4 < 0x282) { if ((uVar4 == 0) || ((cachedManager->_persistentGameData)._achievements[uVar4] != 0)) goto LAB_009bdd33; if (cachedManager->_state == 2) { if (game != (Game *)0x0) { if ((game->_dailyChallenge)._id == 0) { if (game->_isDebug == 0) goto LAB_009bdd64; } goto LAB_009bdd33; } } } LAB_009bdd64: local_20 = local_20 + 0x38; } while (local_20 < 0xf88); uVar4 = (int)psVar7 >> 2; local_20 = uVar4 - 1; if (0 < (int)local_20) { uVar6 = uVar4; do { if (seed == 0) { local_1c = psVar7; KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } swapIndex = seed >> 3 ^ seed; swapIndex = swapIndex << 0x17 ^ swapIndex; seed = swapIndex >> ((byte)local_24 & 0x1f) ^ swapIndex; if (uVar6 == 0) { swapIndex = 0; } else { swapIndex = seed % uVar6; } uVar6 = uVar6 - 1; swapTmp = *(undefined4 *)(local_20 * 4); *(undefined4 *)(local_20 * 4) = *(undefined4 *)(swapIndex * 4); local_20 = local_20 + -1; *(undefined4 *)(swapIndex * 4) = swapTmp; } while (0 < (int)local_20); game = g_game; cachedManager = g_manager; } uVar6 = 0; if (uVar4 != 0) { puVar5 = (undefined4 *)&this->field_0x90; do { if (4 < uVar6) break; pickedBaby = (undefined4 *)(uVar6 * 4); uVar6 = uVar6 + 1; *puVar5 = *(undefined4 *)*pickedBaby; puVar5 = puVar5 + 1; *(int *)&this->field_0xa4 = *(int *)&this->field_0xa4 + 1; } while (uVar6 < uVar4); cachedManager = g_manager; } puVar5 = (this->_coopPlayerTypes)._begin; local_1c = &this->_coopPlayerTypes; (this->_coopPlayerTypes)._end = puVar5; local_24 = 0xffffffff; if (puVar5 == (this->_coopPlayerTypes)._capacity) { std::vector::_Emplace_reallocate(puVar5,&local_24); game = g_game; cachedManager = g_manager; } else { *puVar5 = 0xffffffff; ppvVar1 = &(this->_coopPlayerTypes)._end; *ppvVar1 = (void *)((int)*ppvVar1 + 4); } local_20 = 0; do { psVar7 = local_1c; local_24 = *(uint *)((int)&DAT_00b7ec30 + local_20); if (((int)local_24 < 0) || (((int)(cachedManager->_entityConfig)._players._end - (int)(cachedManager->_entityConfig)._players._begin) / 0x148 <= (int)local_24)) { pvVar3 = (void *)0x0; } else { pvVar3 = (void *)(local_24 * 0x148 + (int)(cachedManager->_entityConfig)._players._begin); } uVar4 = *(uint *)((int)pvVar3 + 0xe8); if (((int)uVar4 < 0) || (((uVar4 < 0x282 && (((uVar4 == 0 || ((cachedManager->_persistentGameData)._achievements[uVar4] != 0)) || (((cachedManager->_state == 2 && (game != (Game *)0x0)) && (((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))) && (((local_24 != 9 && (local_24 != 0x1e)) || ((cachedManager->_persistentGameData)._eventCounters[0x15] != 0)))))) { playerTypesEnd = (this->_coopPlayerTypes)._end; if (playerTypesEnd == (this->_coopPlayerTypes)._capacity) { std::vector::_Emplace_reallocate(playerTypesEnd,&local_24); game = g_game; cachedManager = g_manager; } else { *playerTypesEnd = local_24; local_1c->_end = (void *)((int)local_1c->_end + 4); } } local_20 = local_20 + 4; } while (local_20 < 0x88); uVar4 = 0x29; if (0x29 < (uint)(((int)(cachedManager->_entityConfig)._players._end - (int)(cachedManager->_entityConfig)._players._begin) / 0x148)) { local_1c = (std_vector *)0x3488; do { if (((int)uVar4 < 0) || (((int)(cachedManager->_entityConfig)._players._end - (int)(cachedManager->_entityConfig)._players._begin) / 0x148 <= (int)uVar4)) { playerConfig = 0; } else { playerConfig = (int)(cachedManager->_entityConfig)._players._begin + (int)local_1c; } if (*(char *)(playerConfig + 0x128) == '\0') { playerTypesEnd = (this->_coopPlayerTypes)._end; if (playerTypesEnd == (this->_coopPlayerTypes)._capacity) { local_24 = uVar4; std::vector::_Emplace_reallocate(playerTypesEnd,&local_24); cachedManager = g_manager; } else { *playerTypesEnd = uVar4; psVar7->_end = (void *)((int)psVar7->_end + 4); } } local_1c = (std_vector *)&local_1c[0x1b]._end; uVar4 = uVar4 + 1; } while (uVar4 < (uint)(((int)(cachedManager->_entityConfig)._players._end - (int)(cachedManager->_entityConfig)._players._begin) / 0x148)); } ExceptionList = local_10; return; } //@@ 009be080 PlayerManager::FirstCollectibleOwner /* ZHL [exact] __thiscall Entity_Player* PlayerManager::FirstCollectibleOwner(CollectibleType collectibleID,RNG **rng, bool lazSharedGlobalTag); prototype: db/protos.zhl, confirmed by RET 12 */ Entity_Player * __thiscall PlayerManager::FirstCollectibleOwner (PlayerManager *this,int collectibleId,RNG **rng,byte isLazSharedGlobalTag) { Entity_Player *this_00; bool bVar1; byte bVar2; ItemConfig_Item *pIVar3; undefined4 *puVar4; pIVar3 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if (((isLazSharedGlobalTag == 0) || (pIVar3 == (ItemConfig_Item *)0x0)) || ((pIVar3->tags & 0x80000000) == 0)) { bVar1 = false; } else { bVar1 = true; } puVar4 = (this->_playerList)._begin; if (puVar4 != (this->_playerList)._end) { do { this_00 = (Entity_Player *)*puVar4; if (this_00->_variant == 0) { bVar2 = Entity_Player::HasCollectible(this_00,collectibleId,0); if (bVar2 != 0) { return this_00; } if (((bVar1) && (this_00->_backupPlayer != (Entity_Player *)0x0)) && (bVar2 = Entity_Player::HasCollectible(this_00->_backupPlayer,collectibleId,0), bVar2 != 0)) { return this_00->_backupPlayer; } } puVar4 = puVar4 + 1; } while (puVar4 != (this->_playerList)._end); } return (Entity_Player *)0x0; } //@@ 009be140 PlayerManager::RandomCollectibleOwner /* ZHL [exact] __thiscall Entity_Player* PlayerManager::RandomCollectibleOwner(CollectibleType collectibleID, unsigned int seed, RNG** returnRNG); prototype: db/protos.zhl, confirmed by RET 12 */ Entity_Player * __thiscall PlayerManager::RandomCollectibleOwner(PlayerManager *this,int collectibleId,uint seed,RNG **outRng) { void *pvVar1; code *pcVar2; byte bVar3; Entity_Player *pEVar4; uint uVar5; void *pvVar6; undefined4 *puVar7; undefined1 *puVar8; undefined1 *local_14; Entity_Player *local_c; local_14 = &DAT_bf800000; local_c = (Entity_Player *)0x0; puVar7 = (this->_playerList)._begin; pEVar4 = (Entity_Player *)0x0; if (puVar7 != (this->_playerList)._end) { do { pEVar4 = (Entity_Player *)*puVar7; if ((pEVar4->_variant == 0) && (bVar3 = Entity_Player::HasCollectible(pEVar4,collectibleId,0), bVar3 != 0)) { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pEVar4 = (Entity_Player *)(*pcVar2)(); return pEVar4; } uVar5 = seed >> 3 ^ seed; uVar5 = uVar5 << 5 ^ uVar5; seed = uVar5 >> 0x14 ^ uVar5; puVar8 = (undefined1 *) ((float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10); if ((float)local_14 < (float)puVar8) { local_14 = puVar8; local_c = pEVar4; } } puVar7 = puVar7 + 1; pEVar4 = local_c; } while (puVar7 != (this->_playerList)._end); } if (outRng != (RNG **)0x0) { if (pEVar4 != (Entity_Player *)0x0) { if (collectibleId < 0) { *outRng = (pEVar4->_collectibleRNGs)._begin; return pEVar4; } pvVar6 = (pEVar4->_collectibleRNGs)._end; if ((int)pvVar6 - (int)(pEVar4->_collectibleRNGs)._begin >> 4 <= collectibleId) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); pvVar6 = (pEVar4->_collectibleRNGs)._end; } pvVar1 = (pEVar4->_collectibleRNGs)._begin; uVar5 = ((int)pvVar6 - (int)pvVar1 >> 4) - 1; if (uVar5 < (uint)collectibleId) { collectibleId = uVar5; } *outRng = (RNG *)(collectibleId * 0x10 + (int)pvVar1); return pEVar4; } *outRng = (RNG *)0x0; } return pEVar4; } //@@ 009be2a0 PlayerManager::FirstTrinketOwner /* DB: matches the Lua PlayerManager.FirstTrinketOwner(trinket, RNG out, LazarusSharedGlobalTag): loops players variant 0, HasTrinket, writes the player's trinket RNG (+0x177c 16-byte entries, "Trinket ID out of bounds!") to *param_2; with param_3 and the trinket's config flag bit 31 also checks _backupPlayer (GetTrinketRNG); Entity_Pickup::HandleCollision (trinket 13) */ Entity_Player * PlayerManager::FirstTrinketOwner(uint param_1,undefined4 *param_2,char param_3) { void *pvVar1; Entity_Player *this; byte bVar2; int iVar3; RNG *pRVar4; int *in_ECX; uint uVar5; undefined4 *puVar6; char cStack0000000f; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((int)(param_1 & 0x7fff) < (int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2) { iVar3 = *(int *)((int)pvVar1 + (param_1 & 0x7fff) * 4); } else { iVar3 = 0; } if (((param_3 == '\0') || (iVar3 == 0)) || (cStack0000000f = '\x01', (*(uint *)(iVar3 + 0xb8) & 0x80000000) == 0)) { cStack0000000f = '\0'; } puVar6 = (undefined4 *)*in_ECX; if (puVar6 != (undefined4 *)in_ECX[1]) { do { this = (Entity_Player *)*puVar6; if (this->_variant == 0) { bVar2 = Entity_Player::HasTrinket(this,param_1,0); if (bVar2 != 0) { if (param_2 != (undefined4 *)0x0) { if (((int)param_1 < 0) || ((int)(this->_trinketRNGs)._end - (int)(this->_trinketRNGs)._begin >> 4 <= (int)param_1)) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); } pvVar1 = (this->_trinketRNGs)._begin; uVar5 = ((int)(this->_trinketRNGs)._end - (int)pvVar1 >> 4) - 1; param_1 = -(uint)(param_1 != 0) & param_1; if (param_1 < uVar5) { uVar5 = param_1; } *param_2 = (void *)(uVar5 * 0x10 + (int)pvVar1); } return this; } if (((cStack0000000f != '\0') && (this->_backupPlayer != (Entity_Player *)0x0)) && (bVar2 = Entity_Player::HasTrinket(this->_backupPlayer,param_1,0), bVar2 != 0)) { if (param_2 != (undefined4 *)0x0) { pRVar4 = Entity_Player::GetTrinketRNG(this->_backupPlayer,param_1); *param_2 = pRVar4; } return this->_backupPlayer; } } puVar6 = puVar6 + 1; } while (puVar6 != (undefined4 *)in_ECX[1]); } if (param_2 != (undefined4 *)0x0) { *param_2 = 0; } return (Entity_Player *)0x0; } //@@ 009be3e0 PlayerManager::RandomTrinketOwner /* ZHL [exact] __thiscall Entity_Player* PlayerManager::RandomTrinketOwner(TrinketType trinketType, unsigned int seed, RNG** returnRNG); prototype: db/protos.zhl, confirmed by RET 12 */ Entity_Player * __thiscall PlayerManager::RandomTrinketOwner(PlayerManager *this,int trinketId,uint seed,RNG **outRng) { Entity_Player *this_00; void *pvVar1; code *pcVar2; byte bVar3; uint uVar4; uint uVar5; Entity_Player *pEVar6; undefined4 *puVar7; undefined1 *puVar8; undefined1 *local_10; puVar7 = (this->_playerList)._begin; pEVar6 = (Entity_Player *)0x0; local_10 = &DAT_bf800000; if (puVar7 != (this->_playerList)._end) { do { this_00 = (Entity_Player *)*puVar7; if ((this_00->_variant == 0) && (bVar3 = Entity_Player::HasTrinket(this_00,trinketId,0), bVar3 != 0)) { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pEVar6 = (Entity_Player *)(*pcVar2)(); return pEVar6; } uVar4 = seed >> 3 ^ seed; uVar4 = uVar4 << 5 ^ uVar4; seed = uVar4 >> 0x14 ^ uVar4; puVar8 = (undefined1 *) ((float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10); if ((float)local_10 < (float)puVar8) { pEVar6 = this_00; local_10 = puVar8; } } puVar7 = puVar7 + 1; } while (puVar7 != (this->_playerList)._end); } if (outRng != (RNG **)0x0) { if (pEVar6 != (Entity_Player *)0x0) { if ((trinketId < 0) || ((int)(pEVar6->_trinketRNGs)._end - (int)(pEVar6->_trinketRNGs)._begin >> 4 <= trinketId)) { KAGE_LogMessage(0x10,(byte *)"Trinket ID out of bounds!\n"); } pvVar1 = (pEVar6->_trinketRNGs)._begin; uVar4 = ((int)(pEVar6->_trinketRNGs)._end - (int)pvVar1 >> 4) - 1; uVar5 = -(uint)(trinketId != 0) & trinketId; if (uVar5 < uVar4) { uVar4 = uVar5; } *outRng = (RNG *)(uVar4 * 0x10 + (int)pvVar1); return pEVar6; } *outRng = (RNG *)0x0; } return pEVar6; } //@@ 009be530 PlayerManager::GetRandomPlayer /* DB: ?xorshift-random pick among players variant 0, not coop ghost (0x20a9), not 0x202c, 0x17e0>2 prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Player * __thiscall PlayerManager::GetRandomPlayer(PlayerManager *this,int unused,uint seed) { Entity_Player *pEVar1; code *pcVar2; Entity_Player *pEVar3; uint uVar4; int *piVar5; undefined1 *puVar6; undefined1 *puVar7; Entity_Player *local_10; puVar7 = &DAT_bf800000; pEVar3 = (Entity_Player *)0x0; local_10 = (Entity_Player *)0x0; piVar5 = (this->_playerList)._begin; if (piVar5 != (this->_playerList)._end) { do { pEVar1 = (Entity_Player *)*piVar5; if ((((pEVar1->_variant == 0) && (pEVar1->_hasCurseMistEffect == 0)) && (pEVar1->_isCoopGhost == 0)) && (2 < pEVar1->_playerForms[1])) { if (seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); pEVar3 = (Entity_Player *)(*pcVar2)(); return pEVar3; } uVar4 = seed >> 3 ^ seed; uVar4 = uVar4 << 5 ^ uVar4; seed = uVar4 >> 0x14 ^ uVar4; puVar6 = (undefined1 *) ((float)((double)(int)seed + __uint_to_double_fixup[-((int)seed >> 0x1f)]) * 2.3283062e-10); if ((float)puVar6 <= (float)puVar7) { pEVar3 = local_10; } else { pEVar3 = pEVar1; puVar7 = puVar6; local_10 = pEVar1; } } piVar5 = piVar5 + 1; } while (piVar5 != (this->_playerList)._end); } return pEVar3; } //@@ 009be630 PlayerManager::FirstPlayerByType /* ZHL [exact] __thiscall Entity_Player* PlayerManager::FirstPlayerByType(unsigned int type); prototype: REPENTOGON, confirmed by RET 4 */ Entity_Player * __thiscall PlayerManager::FirstPlayerByType(PlayerManager *this,uint type) { Entity_Player *pEVar1; int *piVar2; piVar2 = (this->_playerList)._begin; while( true ) { if (piVar2 == (this->_playerList)._end) { return (Entity_Player *)0x0; } pEVar1 = (Entity_Player *)*piVar2; if (((pEVar1->_variant == 0) && (pEVar1->_isCoopGhost == 0)) && (pEVar1->_playerType == type)) break; piVar2 = piVar2 + 1; } return pEVar1; } //@@ 009be670 PlayerManager::are_all_players_tainted_blue_baby /* DB: loops players: false if any non-twin is not type 0x19; Pickup_PickVariant/Init turn bombs into poop nuggets (characters-8) prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall PlayerManager::are_all_players_tainted_blue_baby(PlayerManager *this,int unused) { int iVar1; int *piVar2; piVar2 = (this->_playerList)._begin; while( true ) { if (piVar2 == (this->_playerList)._end) { return 1; } iVar1 = *piVar2; if (((*(int *)(iVar1 + 0x2c) == 0) && (*(char *)(iVar1 + 0x20a9) == '\0')) && (*(int *)(iVar1 + 0x13c0) != 0x19)) break; piVar2 = piVar2 + 1; } return 0; } //@@ 009be6b0 PlayerManager::FirstTrinketOwner /* DB: iterates player list, GetTrinketMultiplier, prefers player with Mom's Box (439); REPENTOGON PlayerManager::FirstTrinketOwner shape prototype: db/protos.zhl, confirmed by RET 4 */ Entity_Player * __thiscall PlayerManager::FirstTrinketOwner(PlayerManager *this,int trinketId) { Entity_Player *this_00; float fVar1; bool bVar2; byte bVar3; int iVar4; int iVar5; undefined4 *puVar6; Entity_Player *pEVar7; bool bVar8; bool bVar9; pEVar7 = (Entity_Player *)0x0; puVar6 = (this->_playerList)._begin; do { if (puVar6 == (this->_playerList)._end) { return pEVar7; } this_00 = (Entity_Player *)*puVar6; fVar1 = this_00[1]._chargeBarSprites[0]._championColor._tint[0]; if ((fVar1 == 0.0) || (fVar1 != (float)trinketId)) { iVar5 = Entity_Player::GetTrinketMultiplier(this_00,trinketId); bVar9 = false; bVar8 = iVar5 == 0; LAB_009be708: bVar9 = bVar9 == iVar5 < 0; bVar2 = !bVar8 && bVar9; bVar3 = Entity_Player::HasCollectible((Entity_Player *)*puVar6,0x1b7,0); if (!bVar8 && bVar9) goto LAB_009be71d; } else { if (*(char *)(this_00[1]._chargeBarSprites[0]._color._offset + 1) == '\0') { iVar4 = Entity_Player::GetTrinketMultiplier(this_00,trinketId); bVar9 = SBORROW4(iVar4,1); iVar5 = iVar4 + -1; bVar8 = iVar4 == 1; goto LAB_009be708; } bVar2 = true; bVar3 = Entity_Player::HasCollectible(this_00,0x1b7,0); LAB_009be71d: if (bVar3 != 0) { return (Entity_Player *)*puVar6; } } if ((pEVar7 == (Entity_Player *)0x0) && (bVar2)) { pEVar7 = (Entity_Player *)*puVar6; } puVar6 = puVar6 + 1; } while( true ); } //@@ 009be750 PlayerManager::GetNumCollectibles /* ZHL [exact] __thiscall int PlayerManager::GetNumCollectibles(CollectibleType type); prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall PlayerManager::GetNumCollectibles(PlayerManager *this,int collectibleId) { Entity_Player *this_00; bool bVar1; ItemConfig_Item *pIVar2; int iVar3; int iVar4; undefined4 *puVar5; iVar4 = 0; pIVar2 = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId); if ((pIVar2 == (ItemConfig_Item *)0x0) || (bVar1 = true, (pIVar2->tags & 0x80000000) == 0)) { bVar1 = false; } puVar5 = (this->_playerList)._begin; if (puVar5 != (this->_playerList)._end) { do { this_00 = (Entity_Player *)*puVar5; if (this_00->_variant == 0) { iVar3 = Entity_Player::GetCollectibleNum(this_00,collectibleId,0); iVar4 = iVar4 + iVar3; if ((bVar1) && (this_00->_backupPlayer != (Entity_Player *)0x0)) { iVar3 = Entity_Player::GetCollectibleNum(this_00->_backupPlayer,collectibleId,0); iVar4 = iVar4 + iVar3; } } puVar5 = puVar5 + 1; } while (puVar5 != (this->_playerList)._end); } return iVar4; } //@@ 009be7f0 PlayerManager::HasTemporaryEffect /* ZHL [exact] __thiscall bool PlayerManager::HasTemporaryEffect(ItemConfig_Item *item); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall PlayerManager::HasTemporaryEffect(PlayerManager *this,ItemConfig_Item *item) { int iVar1; int *piVar2; int *piVar3; piVar3 = (this->_playerList)._begin; do { if (piVar3 == (this->_playerList)._end) { return 0; } iVar1 = *piVar3; if ((*(int *)(iVar1 + 0x2c) == 0) && (*(char *)(iVar1 + 0x1519) == '\0')) { for (piVar2 = *(int **)(iVar1 + 0x150c); piVar2 != *(int **)(iVar1 + 0x1510); piVar2 = piVar2 + 4) { if ((ItemConfig_Item *)*piVar2 == item) { return 1; } } } piVar3 = piVar3 + 1; } while( true ); } //@@ 009be850 PlayerManager::add_lost_curse /* DB: null item 112 for every player (white fire) (alt_path.md) */ void PlayerManager::add_lost_curse(void) { void *pvVar1; int iVar2; int *piVar3; int *in_ECX; int iVar4; uint uVar5; int local_28 [3]; undefined4 local_1c; int local_18 [3]; undefined4 local_c; uVar5 = 0; iVar4 = *in_ECX; if (in_ECX[1] - iVar4 >> 2 != 0) { do { pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((0x1c0 < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU)) && (iVar2 = *(int *)((int)pvVar1 + 0x1c0), iVar2 != 0)) { local_28[2] = *(undefined4 *)(iVar2 + 0x78); local_28[1] = 0; local_1c = 0; local_28[0] = iVar2; TemporaryEffects::AddEffect ((TemporaryEffects *)(*(int *)(iVar4 + uVar5 * 4) + 0x1508),local_28,1,1); iVar4 = *in_ECX; } iVar4 = *(int *)(*(int *)(iVar4 + uVar5 * 4) + 0x1e6c); if (iVar4 != 0) { if (*(char *)(iVar4 + 0x1519) == '\0') { for (piVar3 = *(int **)(iVar4 + 0x150c); piVar3 != *(int **)(iVar4 + 0x1510); piVar3 = piVar3 + 4) { if ((*(int *)*piVar3 == 0) && (((int *)*piVar3)[1] == 0x70)) goto LAB_009be966; } } pvVar1 = (g_manager->_itemConfig)._nullItems._begin; if ((0x1c0 < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar1 & 0xfffffffcU )) && (iVar2 = *(int *)((int)pvVar1 + 0x1c0), iVar2 != 0)) { local_18[2] = *(undefined4 *)(iVar2 + 0x78); local_18[1] = 0; local_c = 0; local_18[0] = iVar2; TemporaryEffects::AddEffect((TemporaryEffects *)(iVar4 + 0x1508),local_18,1,1); } } LAB_009be966: uVar5 = uVar5 + 1; iVar4 = *in_ECX; } while (uVar5 < (uint)(in_ECX[1] - iVar4 >> 2)); } return; } //@@ 009be990 NpcHelper::big_horn_is_any_hole_busy /* DB: ? scans entity ptr vector for field 0x3fc not 0/3; Big/Little Horn */ uint NpcHelper::big_horn_is_any_hole_busy(void) { int *piVar1; undefined4 *in_ECX; piVar1 = (int *)*in_ECX; while( true ) { if (piVar1 == (int *)in_ECX[1]) { return (uint)piVar1 & 0xffffff00; } if ((*(int *)(*piVar1 + 0x3fc) != 0) && (*(int *)(*piVar1 + 0x3fc) != 3)) break; piVar1 = piVar1 + 1; } return CONCAT31((int3)((uint)piVar1 >> 8),1); } //@@ 009be9c0 FUN_009be9c0 uint FUN_009be9c0(void) { int iVar1; int *piVar2; undefined4 *in_ECX; piVar2 = (int *)*in_ECX; while( true ) { if (piVar2 == (int *)in_ECX[1]) { return (uint)piVar2 & 0xffffff00; } if ((*(char *)(*piVar2 + 0x20a9) == '\0') && ((((iVar1 = *(int *)(*piVar2 + 0x184), iVar1 == 0 || (iVar1 == 3)) || (iVar1 == 1)) || (iVar1 == 2)))) break; piVar2 = piVar2 + 1; } return CONCAT31((int3)((uint)piVar2 >> 8),1); } //@@ 009bea10 entity_vector_set_flag_410 /* DB: sets byte +0x410 on each element prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall entity_vector_set_flag_410(void *this,byte value) { int iVar1; int *piVar2; piVar2 = *(int **)this; if (piVar2 != *(int **)((int)this + 4)) { do { iVar1 = *piVar2; piVar2 = piVar2 + 1; *(byte *)(iVar1 + 0x410) = value; } while (piVar2 != *(int **)((int)this + 4)); } return; } //@@ 009bea40 PlayerManager::get_total_luck /* DB: sums _luck (+0x156c) over the PlayerManager players, returns it in xmm0 prototype: db/protos.zhl */ float __fastcall PlayerManager::get_total_luck(PlayerManager *playerManager) { int iVar1; int *piVar2; float fVar3; fVar3 = 0.0; for (piVar2 = (playerManager->_playerList)._begin; piVar2 != (playerManager->_playerList)._end; piVar2 = piVar2 + 1) { iVar1 = *piVar2; if ((*(int *)(iVar1 + 0x2c) == 0) && (*(char *)(iVar1 + 0x20a9) == '\0')) { fVar3 = fVar3 + *(float *)(iVar1 + 0x156c); } } return fVar3; } //@@ 009bea80 PlayerManager::GetTrinketMultiplier /* ZHL [exact] __thiscall int PlayerManager::GetTrinketMultiplier(int TrinketID); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall PlayerManager::GetTrinketMultiplier(PlayerManager *this,int TrinketID) { void *pvVar1; Entity_Player *this_00; bool bVar2; int iVar3; undefined4 *puVar4; int iVar5; pvVar1 = (g_manager->_itemConfig)._trinkets._begin; if ((((int)(g_manager->_itemConfig)._trinkets._end - (int)pvVar1 >> 2 <= (int)(TrinketID & 0x7fffU)) || (iVar5 = *(int *)((int)pvVar1 + (TrinketID & 0x7fffU) * 4), iVar5 == 0)) || (bVar2 = true, (*(uint *)(iVar5 + 0xb8) & 0x80000000) == 0)) { bVar2 = false; } puVar4 = (this->_playerList)._begin; iVar5 = 0; if (puVar4 != (this->_playerList)._end) { do { this_00 = (Entity_Player *)*puVar4; if (this_00->_variant == 0) { iVar3 = Entity_Player::GetTrinketMultiplier(this_00,TrinketID); iVar5 = iVar5 + iVar3; if ((bVar2) && (this_00->_backupPlayer != (Entity_Player *)0x0)) { iVar3 = Entity_Player::GetTrinketMultiplier(this_00->_backupPlayer,TrinketID); iVar5 = iVar5 + iVar3; } } puVar4 = puVar4 + 1; } while (puVar4 != (this->_playerList)._end); } return iVar5; } //@@ 009beb30 PlayerManager::check_full_health /* DB: ? walks the player vector (ECX), for each non-ghost main player (variant 0, !_isCoopGhost) tests _soulHearts+_redHearts >= _maxHearts or HasInstantDeathCurse, combining per param (any/all) into the bool result; Level::CanOpenChallengeRoom, Level::place_special_rooms (challenge room door rule needs full health) */ uint PlayerManager::check_full_health(undefined1 param_1) { undefined4 *puVar1; Entity_Player *this; bool bVar2; byte bVar3; undefined4 *in_ECX; uint uVar4; uint3 uVar5; undefined4 *puVar6; puVar6 = (undefined4 *)*in_ECX; uVar4 = (uint)CONCAT11(param_1,param_1); puVar1 = (undefined4 *)in_ECX[1]; do { if (puVar6 == puVar1) { return uVar4 & 0xff; } this = (Entity_Player *)*puVar6; if ((this->_variant == 0) && (this->_isCoopGhost == 0)) { if (this->_soulHearts + this->_redHearts < this->_maxHearts) { bVar3 = Entity_Player::HasInstantDeathCurse(this); bVar2 = false; if (bVar3 != 0) goto LAB_009beb72; } else { LAB_009beb72: bVar2 = true; } uVar5 = (uint3)(uVar4 >> 8); if ((char)(uVar4 >> 8) == '\0') { if (((char)uVar4 != '\0') || (bVar2)) goto LAB_009beb8c; } else if (((char)uVar4 == '\0') || (!bVar2)) { uVar4 = (uint)uVar5 << 8; } else { LAB_009beb8c: uVar4 = CONCAT31(uVar5,1); } } puVar6 = puVar6 + 1; } while( true ); } //@@ 009beba0 players_center_position /* DB: ? (Vector* out, bool useCache): averages positions of local non-coop-ghost players (PlayerManager list at Game+0x1baa8, netplay local check), frame-cached; used by camera update, Room::update_ambient_sounds, NpcAI::ENTITY_DOGMA prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall players_center_position(void *this,Vector *outPosition,byte isUseCache) { Game *pGVar1; char cVar2; int *piVar3; uint uVar4; void *pvVar5; NetplayManager NVar6; int iVar7; uint uVar8; uint uVar9; PlayerManager *pPVar10; float fVar11; float fVar12; uint local_10; int local_c; float local_8; if ((isUseCache != 0) && (g_manager->_framecount == DAT_00c5c4d4)) { outPosition->x = DAT_00c9436c; outPosition->y = DAT_00c94370; return outPosition; } pPVar10 = &g_game->_playerManager; local_c = 0; fVar11 = 0.0; fVar12 = 0.0; _isUseCache = 0.0; local_8 = 0.0; local_10 = 0; if ((int)(g_game->_playerManager)._playerList._end - (int)(pPVar10->_playerList)._begin >> 2 != 0) { do { pvVar5 = (pPVar10->_playerList)._end; if ((int)pvVar5 - (int)(pPVar10->_playerList)._begin >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar5 = (pPVar10->_playerList)._end; fVar11 = _isUseCache; fVar12 = local_8; } piVar3 = (pPVar10->_playerList)._begin; if (local_10 < (uint)((int)pvVar5 - (int)piVar3 >> 2)) { piVar3 = piVar3 + local_10; } iVar7 = *piVar3; if (*(int *)(iVar7 + 0x2c) == 0) { if (*(int *)(iVar7 + 0x13c0) == 0x23) { if (*(char *)(iVar7 + 0x20a9) == '\0') goto LAB_009becd3; } NVar6 = g_manager->_netplayManager; if (NVar6 != *(NetplayManager *)(g_manager + 1)) { uVar8 = (int)*(NetplayManager *)(g_manager + 1) - (int)NVar6 >> 2; uVar4 = 0; if (uVar8 != 0) { do { if (*(int *)(*(int *)NVar6 + 0xc) == *(int *)(iVar7 + 0x1618)) { cVar2 = (**(code **)(*(int *)(*(int *)NVar6 + 0x370) + 0x14))(); fVar11 = _isUseCache; fVar12 = local_8; if (cVar2 == '\0') goto LAB_009becd3; break; } uVar4 = uVar4 + 1; NVar6 = (NetplayManager)((int)NVar6 + 4); } while (uVar4 < uVar8); } } local_8 = fVar12 + *(float *)(iVar7 + 0x33c); _isUseCache = fVar11 + *(float *)(iVar7 + 0x340); local_c = local_c + 1; fVar11 = _isUseCache; fVar12 = local_8; } LAB_009becd3: local_10 = local_10 + 1; pPVar10 = &g_game->_playerManager; } while (local_10 < (uint)((int)(g_game->_playerManager)._playerList._end - (int)(pPVar10->_playerList)._begin >> 2)); } uVar4 = 0; iVar7 = *(int *)((int)this + 0xd0); if (*(int *)((int)this + 0xd4) - iVar7 >> 2 != 0) { do { iVar7 = *(int *)(iVar7 + uVar4 * 4); NVar6 = g_manager->_netplayManager; if (NVar6 != *(NetplayManager *)(g_manager + 1)) { uVar9 = (int)*(NetplayManager *)(g_manager + 1) - (int)NVar6 >> 2; uVar8 = 0; if (uVar9 != 0) { do { if (*(int *)(*(int *)NVar6 + 0xc) == *(int *)(iVar7 + 0x1618)) { cVar2 = (**(code **)(*(int *)(*(int *)NVar6 + 0x370) + 0x14))(); fVar11 = _isUseCache; fVar12 = local_8; if (cVar2 == '\0') goto LAB_009bed76; break; } uVar8 = uVar8 + 1; NVar6 = (NetplayManager)((int)NVar6 + 4); } while (uVar8 < uVar9); } } local_8 = fVar12 + *(float *)(iVar7 + 0x33c); _isUseCache = fVar11 + *(float *)(iVar7 + 0x340); local_c = local_c + 1; LAB_009bed76: uVar4 = uVar4 + 1; iVar7 = *(int *)((int)this + 0xd0); fVar11 = _isUseCache; fVar12 = local_8; } while (uVar4 < (uint)(*(int *)((int)this + 0xd4) - iVar7 >> 2)); } pGVar1 = g_game; DAT_00c5c4d4 = g_manager->_framecount; if (local_c < 1) { piVar3 = (g_game->_playerManager)._playerList._begin; if ((int)(g_game->_playerManager)._playerList._end - (int)piVar3 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); piVar3 = (pGVar1->_playerManager)._playerList._begin; } DAT_00c9436c = *(float *)(*piVar3 + 0x33c); fVar11 = *(float *)(*piVar3 + 0x340); } else { fVar11 = fVar11 / (float)local_c; DAT_00c9436c = fVar12 / (float)local_c; } DAT_00c94370 = fVar11; outPosition->x = DAT_00c9436c; outPosition->y = fVar11; return outPosition; } //@@ 009bee80 PlayerManager::replace_player /* DB: ? (oldPlayer, newPlayer) familiar=PlayerManager players vector: swaps the entry, re-links _otherTwin 0x1e68/0x1e6c and 0x1d9c refs, GameStatePlayer::Init(+0x20ec), EntityList::AddEntity, EvaluateItems, InitPostLevelInitStats, HUD::AssignPlayerHUDs, RemoveStatusEffects; caller 007ac7e0 "Entity_Player::DischargeActiveItem" is a player-type change routine, misnamed prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall PlayerManager::replace_player(PlayerManager *familiar,Entity_Player *oldPlayer,Entity_Player *newPlayer) { undefined4 uVar1; EntityPtr EVar2; byte bVar3; uint uVar4; int *playerSlot; void **ppvVar5; Entity_Familiar *familiar; EntityList_EL familiars; EntityList_EL familiarsInclDead; std_multiset *childSet; EntityPtr childParentRef; EntityPtr local_28; EntityPtr local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *familiarData; Game *game; int newPlayerIndex; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0eb55; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; oldPlayer->_replacedPlayer = newPlayer; newPlayer->_replacedPlayer = oldPlayer; if (newPlayer->_valid == 0) { for (playerSlot = (familiar->_playerList)._begin; playerSlot != (familiar->_playerList)._end; playerSlot = playerSlot + 1) { if ((Entity_Player *)*playerSlot == oldPlayer) { *playerSlot = (int)newPlayer; Entity_Player::room_exit(oldPlayer,0); GameStatePlayer::Init(&oldPlayer->_unlistedRestoreState); Entity_Player::StoreGameState(oldPlayer,&oldPlayer->_unlistedRestoreState,0); oldPlayer->_hasUnlistedRestoreState = 1; newPlayer->_playerIndex = oldPlayer->_playerIndex; local_24 = oldPlayer->_twinPlayer; EVar2 = newPlayer->_twinPlayer; if (EVar2 != local_24) { if (EVar2 != (EntityPtr)0x0) { local_28 = (EntityPtr)&newPlayer->_twinPlayer; std::multiset::erase(&local_28); } newPlayer->_twinPlayer = local_24; if (local_24 != (EntityPtr)0x0) { std::multiset::insert(&newPlayer->_twinPlayer); } } EVar2 = oldPlayer->_twinPlayer; if (EVar2 != (EntityPtr)0x0) { local_24 = (EntityPtr)((int)EVar2 + 0x1e68); if (*(Entity_Player **)((int)EVar2 + 0x1e68) != newPlayer) { if (*(Entity_Player **)((int)EVar2 + 0x1e68) != (Entity_Player *)0x0) { local_28 = local_24; std::multiset::erase(&local_28); } *(Entity_Player **)local_24 = newPlayer; std::multiset::insert(local_24); } } if (newPlayer != oldPlayer->_backupPlayer) { newPlayer->_backupPlayer = oldPlayer->_backupPlayer; if (oldPlayer->_backupPlayer != (void *)0x0) { *(Entity_Player **)((int)oldPlayer->_backupPlayer + 0x1e6c) = newPlayer; } oldPlayer->_backupPlayer = (void *)0x0; } local_24 = (EntityPtr)oldPlayer->_forgottenBody; if (local_24 != (EntityPtr)0x0) { if (newPlayer->_forgottenBody != (void *)0x0) { local_28 = (EntityPtr)&newPlayer->_forgottenBody; std::multiset::erase(&local_28); } ppvVar5 = &newPlayer->_forgottenBody; *ppvVar5 = (void *)local_24; local_24 = (EntityPtr)ppvVar5; std::multiset::insert(ppvVar5); if (oldPlayer->_forgottenBody != (void *)0x0) { local_28 = (EntityPtr)&oldPlayer->_forgottenBody; std::multiset::erase(&local_28); } oldPlayer->_forgottenBody = (void *)0x0; Entity_Familiar::set_player(newPlayer->_forgottenBody,newPlayer); newPlayer->_forgottenBodyRoomIdx = oldPlayer->_forgottenBodyRoomIdx; (newPlayer->_forgottenBodyPos).x = (oldPlayer->_forgottenBodyPos).x; (newPlayer->_forgottenBodyPos).y = (oldPlayer->_forgottenBodyPos).y; oldPlayer->_forgottenBodyRoomIdx = -99999; (oldPlayer->_forgottenBodyPos).x = g_vectorZero.x; (oldPlayer->_forgottenBodyPos).y = g_vectorZero.y; } local_24 = (EntityPtr)(oldPlayer->_entityPtrReferrers)._head; childSet = &oldPlayer->_entityPtrReferrers; local_28 = *(EntityPtr *)local_24; if (local_28 != local_24) { do { **(undefined4 **)((int)local_28 + 0x10) = 0; childParentRef = *(EntityPtr *)((int)local_28 + 0x10); if (*(int *)childParentRef != 0) { local_24 = childParentRef; std::multiset::erase(&local_24); } *(Entity_Player **)childParentRef = newPlayer; std::multiset::insert(childParentRef); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); local_24 = (EntityPtr)childSet->_head; } while (local_28 != local_24); } FID_conflict__Erase_tree_>_> (childSet,(fuzzer_allocator_> *)childSet, *(_Tree_node **)((int)local_24 + 4)); *(EntityPtr *)((int)local_24 + 4) = local_24; *(EntityPtr *)local_24 = local_24; *(EntityPtr *)((int)local_24 + 8) = local_24; game = g_game; (oldPlayer->_entityPtrReferrers)._size = 0; newPlayer->_exists = 1; EntityList::AddEntity((EntityList *)((int)game->_room + 0x1218),(Entity *)newPlayer); Entity_Player::SetControllerIndex(newPlayer,oldPlayer->_controllerIndex,1); (newPlayer->_pos).x = (oldPlayer->_pos).x; (newPlayer->_pos).y = (oldPlayer->_pos).y; (newPlayer->_velocity).x = (oldPlayer->_velocity).x; (newPlayer->_velocity).y = (oldPlayer->_velocity).y; newPlayer->_forgottenBHeight = oldPlayer->_forgottenBHeight; newPlayer->_forgottenBHeightVelocity = oldPlayer->_forgottenBHeightVelocity; newPlayer->_heightVelocity = oldPlayer->_heightVelocity; (newPlayer->_posOffset).x = (oldPlayer->_posOffset).x; (newPlayer->_posOffset).y = (oldPlayer->_posOffset).y; uVar4 = *(uint *)((int)&oldPlayer->_flags + 4); *(int *)&newPlayer->_flags = (int)oldPlayer->_flags; *(uint *)((int)&newPlayer->_flags + 4) = uVar4; newPlayer->_entityCollisionClass = oldPlayer->_entityCollisionClass; newPlayer->_entityGridCollisionClass = oldPlayer->_entityGridCollisionClass; newPlayer->_visible = (uVar4 & 0x2000000) == 0; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&familiars,3,-1,-1,0,0) ; local_14 = 0; local_28 = (EntityPtr)0x0; if (familiars._size != 0) { do { familiar = (Entity_Familiar *) __RTDynamicCast(*(undefined4 *)((int)familiars._data + (int)local_28 * 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0 ); if (familiar->_player == oldPlayer) { if ((familiar->_isNotCountedAsFollower == 0) && (familiar->_variant != 0xf2)) { (**(code **)(*(int *)familiar + 0x28))(); } else { Entity_Familiar::set_player(familiar,newPlayer); } } local_28 = (EntityPtr)((int)local_28 + 1); } while ((uint)local_28 < (uint)familiars._size); } Entity_Player::release_weapons_and_effects(oldPlayer,1); oldPlayer->_valid = 0; oldPlayer->_exists = 0; oldPlayer->_playerIndex = -1; game = g_game; StatHUD::update_player(oldPlayer,newPlayer); FUN_0083bed0(oldPlayer,newPlayer); HUD::AssignPlayerHUDs(&game->_hud); HUD::mark_all_slots_dirty(&game->_hud,1,0); if (newPlayer->_hasUnlistedRestoreState != 0) { Entity_Player::RestoreGameState(newPlayer,&newPlayer->_unlistedRestoreState); Entity_Player::spawn_dark_esau(newPlayer,&newPlayer->_unlistedRestoreState); newPlayer->_hasUnlistedRestoreState = 0; } if (newPlayer->_postLevelInitFinished == 0) { Entity_Player::InitPostLevelInitStats(newPlayer); } newPlayer->_canFly = oldPlayer->_canFly; newPlayer->_cacheFlags = 0xffff; *(undefined4 *)&newPlayer->field_0x13f0 = 0; *(undefined4 *)&newPlayer->field_0x13f4 = 0; *(undefined4 *)&newPlayer->field_0x13f8 = 0; *(undefined4 *)&newPlayer->field_0x13fc = 0; newPlayer->field_0x1400 = 0; Entity_Player::TriggerNewRoom_TemporaryEffects(newPlayer); EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),&familiarsInclDead,3,-1,-1,1,0); familiarData = familiarsInclDead._data; local_14._0_1_ = 1; local_28 = (EntityPtr)0x0; if (familiarsInclDead._size != 0) { do { if (*(Entity_Player **)(*(int *)((int)familiarData + (int)local_28 * 4) + 0x410) == newPlayer) { FUN_0062c8a0(); } local_28 = (EntityPtr)((int)local_28 + 1); } while ((uint)local_28 < (uint)familiarsInclDead._size); } if (familiarsInclDead._0_1_ == '\0') { local_14._0_1_ = 2; tracked_alloc(1,familiarsInclDead._data,0); } local_14 = (uint)local_14._1_3_ << 8; Entity::RemoveStatusEffects((Entity *)newPlayer); Entity_Player::EvaluateItems(); oldPlayer->_replacedPlayer = (void *)0x0; newPlayer->_replacedPlayer = (void *)0x0; if (familiars._0_1_ == '\0') { local_14 = 3; tracked_alloc(1,familiars._data,0); } ExceptionList = local_1c; return 1; } } oldPlayer->_replacedPlayer = (void *)0x0; bVar3 = 0; } else { familiarData = (familiar->_playerList)._begin; uVar1 = *(undefined4 *)((int)familiarData + oldPlayer->_playerIndex * 4); newPlayerIndex = newPlayer->_playerIndex; *(undefined4 *)((int)familiarData + oldPlayer->_playerIndex * 4) = *(undefined4 *)((int)familiarData + newPlayerIndex * 4); *(undefined4 *)((int)familiarData + newPlayerIndex * 4) = uVar1; game = g_game; newPlayerIndex = oldPlayer->_playerIndex; oldPlayer->_playerIndex = newPlayer->_playerIndex; newPlayer->_playerIndex = newPlayerIndex; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); StatHUD::update_player(oldPlayer,newPlayer); FUN_0083bed0(oldPlayer,newPlayer); HUD::AssignPlayerHUDs(&game->_hud); HUD::mark_all_slots_dirty(&game->_hud,1,0); oldPlayer->_cacheFlags = 0xffff; *(undefined4 *)&oldPlayer->field_0x13f0 = 0; *(undefined4 *)&oldPlayer->field_0x13f4 = 0; *(undefined4 *)&oldPlayer->field_0x13f8 = 0; *(undefined4 *)&oldPlayer->field_0x13fc = 0; oldPlayer->field_0x1400 = 0; Entity_Player::EvaluateItems(uVar4); newPlayer->_cacheFlags = 0xffff; *(undefined4 *)&newPlayer->field_0x13f0 = 0; *(undefined4 *)&newPlayer->field_0x13f4 = 0; *(undefined4 *)&newPlayer->field_0x13f8 = 0; *(undefined4 *)&newPlayer->field_0x13fc = 0; newPlayer->field_0x1400 = 0; Entity_Player::EvaluateItems(); oldPlayer->_replacedPlayer = (void *)0x0; bVar3 = 1; } newPlayer->_replacedPlayer = (void *)0x0; ExceptionList = local_1c; return bVar3; } //@@ 009bf530 PlayerManager::restore_controller_assignment /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=PlayerManager (player vector *this): after Game::restore_game_state in Manager::start_pending_game, walks players with PlayerManager::GetPlayer, KAGE::Input::Manager::get_device, Entity_Player::SetControllerIndex, HUD::AssignPlayerHUDs prototype: db/protos.zhl */ void __thiscall PlayerManager::restore_controller_assignment(PlayerManager *this) { char cVar1; uint uVar2; void *pvVar3; int *playerSlot; int *piVar4; void *block; undefined4 *puVar5; uint uVar6; int iVar7; int *queueProxy; void *queueMap; uint queueMapSize; uint queueOffset; int queueSize; int device; int *deviceRefCount; int controllerIndex; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; local_8 = 0xffffffff; puStack_c = &LAB_00b0eb95; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar3 = (this->_playerList)._end; uVar6 = 0; puVar5 = (this->_playerList)._begin; if ((int)pvVar3 - (int)puVar5 >> 2 != 0) { do { if ((int)pvVar3 - (int)puVar5 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (this->_playerList)._end; puVar5 = (this->_playerList)._begin; } if (uVar6 < (uint)((int)pvVar3 - (int)puVar5 >> 2)) { puVar5 = puVar5 + uVar6; } Entity_Player::SetControllerIndex((Entity_Player *)*puVar5,0xffffffff,1,uVar2); pvVar3 = (this->_playerList)._end; uVar6 = uVar6 + 1; puVar5 = (this->_playerList)._begin; } while (uVar6 < (uint)((int)pvVar3 - (int)puVar5 >> 2)); } queueProxy = (int *)0x0; queueMap = (void *)0x0; queueMapSize = 0; queueOffset = 0; queueSize = 0; queueProxy = operator_new(8); queueProxy[1] = 0; *queueProxy = (int)&queueProxy; local_8._0_1_ = 0; local_8._1_3_ = 0; local_14 = g_manager->_activeControllerIndex; std::deque::push_front(&local_14); uVar2 = 0; while( true ) { (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff); iVar7 = DAT_00c57b24 - _DAT_00c57b20; local_8._0_1_ = 1; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); local_8 = (uint)local_8._1_3_ << 8; if ((uint)(iVar7 >> 3) <= uVar2) break; KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&device,uVar2); local_8._0_1_ = 2; if (((device != 0) && (controllerIndex = *(int *)(device + 0xc), controllerIndex != g_manager->_activeControllerIndex)) && ((*(byte *)(device + 8) & 1) != 0) ) { if (((queueOffset + queueSize & 3) == 0) && (queueMapSize <= queueSize + 4U >> 2)) { std::deque<4byte>::_Growmap(queueMapSize); } queueOffset = queueOffset & queueMapSize * 4 - 1; local_14 = queueSize + queueOffset; uVar6 = queueMapSize - 1 & local_14 >> 2; if (*(int *)((int)queueMap + uVar6 * 4) == 0) { pvVar3 = operator_new(0x10); *(void **)((int)queueMap + uVar6 * 4) = pvVar3; } *(int *)(*(int *)((int)queueMap + uVar6 * 4) + (local_14 & 3) * 4) = controllerIndex; queueSize = queueSize + 1; } local_8._0_1_ = 3; if (((deviceRefCount != (int *)0x0) && (cVar1 = (**(code **)(*deviceRefCount + 0xc))(), cVar1 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } local_8._0_1_ = 0; uVar2 = uVar2 + 1; } pvVar3 = (this->_playerList)._end; uVar2 = 0; piVar4 = (this->_playerList)._begin; if ((int)pvVar3 - (int)piVar4 >> 2 != 0) { do { if (queueSize == 0) break; if ((int)pvVar3 - (int)piVar4 >> 2 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (this->_playerList)._end; piVar4 = (this->_playerList)._begin; } uVar6 = (int)pvVar3 - (int)piVar4 >> 2; playerSlot = piVar4 + uVar2; if (uVar6 <= uVar2) { playerSlot = piVar4; } if (*(int *)(*playerSlot + 0x1618) == -1) { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"PlayerManager::GetPlayer() : There are no players! \n"); pvVar3 = (this->_playerList)._end; piVar4 = (this->_playerList)._begin; } if (uVar2 < (uint)((int)pvVar3 - (int)piVar4 >> 2)) { piVar4 = piVar4 + uVar2; } Entity_Player::SetControllerIndex ((Entity_Player *)*piVar4, *(undefined4 *) (*(int *)((int)queueMap + (queueOffset >> 2 & queueMapSize - 1) * 4) + (queueOffset & 3) * 4),1); queueSize = queueSize + -1; if (queueSize == 0) { queueOffset = 0; } else { queueOffset = queueOffset + 1; } } pvVar3 = (this->_playerList)._end; uVar2 = uVar2 + 1; piVar4 = (this->_playerList)._begin; } while (uVar2 < (uint)((int)pvVar3 - (int)piVar4 >> 2)); } game = g_game; this->_coopSlots[0]._controllerIndex = -1; this->_coopSlots[1]._controllerIndex = -1; this->_coopSlots[0]._state = -1; this->_coopSlots[0]._menuPosition = 0.0; this->_coopSlots[0]._playerType = 0; this->_coopSlots[1]._state = -1; this->_coopSlots[1]._menuPosition = 0.0; this->_coopSlots[1]._playerType = 0; this->_coopSlots[2]._controllerIndex = -1; this->_coopSlots[2]._state = -1; this->_coopSlots[2]._menuPosition = 0.0; this->_coopSlots[2]._playerType = 0; this->_coopSlots[3]._controllerIndex = -1; this->_coopSlots[3]._state = -1; this->_coopSlots[3]._menuPosition = 0.0; this->_coopSlots[3]._playerType = 0; HUD::AssignPlayerHUDs(&game->_hud); if (queueSize != 0) { do { queueSize = queueSize + -1; } while (queueSize != 0); queueOffset = 0; queueSize = 0; } pvVar3 = queueMap; uVar2 = queueMapSize; if (queueMapSize != 0) { do { block = *(void **)((int)pvVar3 + uVar2 * 4 + -4); uVar2 = uVar2 - 1; if (block != (void *)0x0) { operator_delete(block,0x10); pvVar3 = queueMap; } } while (uVar2 != 0); } if (pvVar3 != (void *)0x0) { uVar2 = queueMapSize * 4; block = pvVar3; if (0xfff < uVar2) { block = *(void **)((int)pvVar3 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)block))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(block,uVar2); } piVar4 = queueProxy; queueMapSize = 0; queueMap = (void *)0x0; queueProxy = (int *)0x0; operator_delete(piVar4,8); ExceptionList = local_10; return; } //@@ 009bf930 PlayerManager::FirstBirthrightOwner /* ZHL [exact] __thiscall Entity_Player* PlayerManager::FirstBirthrightOwner(unsigned int type); prototype: REPENTOGON, confirmed by RET 4 */ Entity_Player * __thiscall PlayerManager::FirstBirthrightOwner(PlayerManager *this,uint type) { Entity_Player *this_00; byte bVar1; undefined4 *puVar2; puVar2 = (this->_playerList)._begin; if (puVar2 != (this->_playerList)._end) { do { this_00 = (Entity_Player *)*puVar2; if ((this_00->_variant == 0) && (this_00->_playerType == type)) { bVar1 = Entity_Player::HasCollectible(this_00,0x26b,0); if (bVar1 != 0) { return this_00; } } puVar2 = puVar2 + 1; } while (puVar2 != (this->_playerList)._end); } return (Entity_Player *)0x0; } //@@ 009bf990 PlayerManager::IsCoopPlay /* ZHL [exact] __thiscall bool PlayerManager::IsCoopPlay(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall PlayerManager::IsCoopPlay(PlayerManager *this) { void *pvVar1; int iVar2; int iVar3; uint uVar4; uint uVar5; uint uVar6; pvVar1 = (this->_playerList)._begin; uVar5 = (int)(this->_playerList)._end - (int)pvVar1 >> 2; if (uVar5 < 2) { return 0; } uVar6 = 0; uVar4 = 0; do { iVar2 = *(int *)((int)pvVar1 + uVar4 * 4); if (((*(int *)(iVar2 + 0x2c) == 0) && (*(int *)(iVar2 + 0x3bc) == 0)) && ((iVar3 = *(int *)(iVar2 + 0x1e68), iVar3 == 0 || (((*(int *)(iVar3 + 0x161c) == -1 || (*(int *)(iVar2 + 0x161c) <= *(int *)(iVar3 + 0x161c))) || (iVar3 == iVar2)))))) { uVar6 = uVar6 + 1; } uVar4 = uVar4 + 1; } while (uVar4 < uVar5); return 1 < uVar6; } //@@ 009bfa00 PlayerManager::GetNumAlivePlayers /* DB: ? counts main non-ghost non-twin players without +0x20a9 */ int PlayerManager::GetNumAlivePlayers(void) { int iVar1; int iVar2; int *in_ECX; uint uVar3; uint uVar4; int iVar5; uVar3 = 0; uVar4 = in_ECX[1] - *in_ECX >> 2; iVar5 = 0; if (uVar4 != 0) { do { iVar1 = *(int *)(*in_ECX + uVar3 * 4); if ((((*(int *)(iVar1 + 0x2c) == 0) && (*(int *)(iVar1 + 0x3bc) == 0)) && ((iVar2 = *(int *)(iVar1 + 0x1e68), iVar2 == 0 || (((*(int *)(iVar2 + 0x161c) == -1 || (*(int *)(iVar1 + 0x161c) <= *(int *)(iVar2 + 0x161c))) || (iVar2 == iVar1)))))) && (*(char *)(iVar1 + 0x20a9) == '\0')) { iVar5 = iVar5 + 1; } uVar3 = uVar3 + 1; } while (uVar3 < uVar4); } return iVar5; } //@@ 009bfa70 PlayerManager::GetNumCoopPlayers /* DB: ? counts players in vector this[0..1] with variant 0, no parent (+0x3bc), not the higher-indexed half of a twin pair (+0x1e68 / +0x161c), and flag +0x20a9 set; Entity_Slot::Update, coop_join_menu_update prototype: db/protos.zhl */ int __thiscall PlayerManager::GetNumCoopPlayers(PlayerManager *this) { void *pvVar1; int iVar2; int iVar3; uint uVar4; uint uVar5; int iVar6; pvVar1 = (this->_playerList)._begin; uVar4 = 0; uVar5 = (int)(this->_playerList)._end - (int)pvVar1 >> 2; iVar6 = 0; if (uVar5 != 0) { do { iVar2 = *(int *)((int)pvVar1 + uVar4 * 4); if ((((*(int *)(iVar2 + 0x2c) == 0) && (*(int *)(iVar2 + 0x3bc) == 0)) && ((iVar3 = *(int *)(iVar2 + 0x1e68), iVar3 == 0 || (((*(int *)(iVar3 + 0x161c) == -1 || (*(int *)(iVar2 + 0x161c) <= *(int *)(iVar3 + 0x161c))) || (iVar3 == iVar2)))))) && (*(char *)(iVar2 + 0x20a9) != '\0')) { iVar6 = iVar6 + 1; } uVar4 = uVar4 + 1; } while (uVar4 < uVar5); } return iVar6; } //@@ 009bfae0 PlayerManager::revive_player_ghosts /* DB: loops players, RevivePlayerGhost if player+0x20a9 set; room clear/slot callers prototype: db/protos.zhl */ void __thiscall PlayerManager::revive_player_ghosts(PlayerManager *this) { Entity_Player *this_00; void *pvVar1; uint uVar2; uVar2 = 0; pvVar1 = (this->_playerList)._begin; if ((int)(this->_playerList)._end - (int)pvVar1 >> 2 != 0) { do { this_00 = *(Entity_Player **)((int)pvVar1 + uVar2 * 4); if (this_00->_isCoopGhost != 0) { Entity_Player::RevivePlayerGhost(this_00); pvVar1 = (this->_playerList)._begin; } uVar2 = uVar2 + 1; } while (uVar2 < (uint)((int)(this->_playerList)._end - (int)pvVar1 >> 2)); } return; } //@@ 009bfb20 PlayerManager::ReviveCoopPlayer /* DB: own log string "PlayerManager::ReviveCoopPlayer() recieved invalid player index"; Entity_Player::RevivePlayerGhost on player[idx], its main twin and +0x1e68 twin; coop_join_menu_update */ void PlayerManager::ReviveCoopPlayer(uint param_1) { EntityPtr this; EntityPtr EVar1; Entity_Player *pEVar2; int *in_ECX; int iVar3; if ((uint)(in_ECX[1] - *in_ECX >> 2) <= param_1) { KAGE_LogMessage(8,(byte *) "PlayerManager::ReviveCoopPlayer() recieved invalid player index (%d), Player List Size = %d, \n" ); return; } pEVar2 = *(Entity_Player **)(*in_ECX + param_1 * 4); if (pEVar2->_isCoopGhost == 0) { return; } Entity_Player::RevivePlayerGhost(pEVar2); iVar3 = *in_ECX; this = *(EntityPtr *)(iVar3 + param_1 * 4); EVar1 = *(EntityPtr *)((int)this + 0x1e68); if (((EVar1 == (EntityPtr)0x0) || (*(int *)((int)EVar1 + 0x161c) == -1)) || (*(int *)((int)this + 0x161c) <= *(int *)((int)EVar1 + 0x161c))) { if (this == (EntityPtr)0x0) goto LAB_009bfbbd; if (((EVar1 == (EntityPtr)0x0) || (*(int *)((int)EVar1 + 0x161c) == -1)) || (*(int *)((int)this + 0x161c) <= *(int *)((int)EVar1 + 0x161c))) { EVar1 = this; } } if (*(char *)((int)EVar1 + 0x20a9) != '\0') { pEVar2 = Entity_Player::GetMainTwin((Entity_Player *)this); Entity_Player::RevivePlayerGhost(pEVar2); iVar3 = *in_ECX; } LAB_009bfbbd: pEVar2 = *(Entity_Player **)(*(int *)(param_1 * 4 + iVar3) + 0x1e68); if ((pEVar2 == (Entity_Player *)0x0) || (pEVar2->_isCoopGhost == 0)) { return; } Entity_Player::RevivePlayerGhost(pEVar2); return; } //@@ 009bfc00 FUN_009bfc00 void FUN_009bfc00(void) { return; } //@@ 009bfc20 FUN_009bfc20 void FUN_009bfc20(void) { return; } //@@ 009bfc40 FUN_009bfc40 void FUN_009bfc40(void) { float in_XMM0_Da; pow(30.0 / (in_XMM0_Da + 1.0),0.75); return; } //@@ 009bfc80 FUN_009bfc80 void FUN_009bfc80(void) { float in_XMM0_Da; if (-2.0 < in_XMM0_Da) { pow((in_XMM0_Da + 2.0) * 0.47161114,1.3333334); return; } return; } //@@ 009bfcd0 FUN_009bfcd0 void FUN_009bfcd0(void) { float in_XMM0_Da; if (-2.0 < in_XMM0_Da) { pow((in_XMM0_Da + 2.0) * 0.44819352,1.7857143); return; } return; } //@@ 009bfd00 FUN_009bfd00 void FUN_009bfd00(void) { return; } //@@ 009bfd20 FUN_009bfd20 void FUN_009bfd20(void) { return; } //@@ 009bfd40 NpcHelper::hush_fly_shape_build /* DB: builds a closed formation path (6 31-gon, 1 five-point star .382, 2 six-point .577, 3-5 polygons); used by ENTITY_HUSH_FLY (boss_approx_2) */ float * NpcHelper::hush_fly_shape_build(int param_1) { float fVar1; undefined1 *puVar2; uint securityCookie; uint pointCapacity; float *in_ECX; float *pathEnd; int iVar3; float fVar4; float distX; float in_XMM2_Da; float pointX; float pointY; float pointDistance; float pointSegmentLength; float sideCountF; float angle; float radius; float *outPath; uint pointIdx; float circleX; int sideCount; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; void *savedExceptionList; savedExceptionList = ExceptionList; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b0ebd0; local_1c = ExceptionList; securityCookie = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; in_ECX[1] = 0.0; in_ECX[2] = 0.0; in_ECX[3] = 0.0; local_14 = 0; *in_ECX = 0.0; if (param_1 == 0) { ExceptionList = savedExceptionList; return in_ECX; } radius = in_XMM2_Da; outPath = in_ECX; if (param_1 == 6) { pointCapacity = 0x20; sideCount = 0x1f; } else if (param_1 == 3) { sideCount = param_1; pointCapacity = 4; } else if (param_1 == 4) { sideCount = param_1; pointCapacity = 5; } else if (param_1 == 5) { sideCount = param_1; pointCapacity = 6; } else if (param_1 == 1) { sideCount = 10; pointCapacity = 0xb; } else if (param_1 == 2) { sideCount = 0xc; pointCapacity = 0xd; } else { sideCount = (int)sideCountF; pointCapacity = (int)sideCountF + 1; puVar2 = (undefined1 *)((int)register0x00000010 + -4); if (pointCapacity == 0) goto LAB_009bfdd2; if (0xfffffff < pointCapacity) { /* WARNING: Subroutine does not return */ std::_Xlen(securityCookie); } } iVar3 = sideCount; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); FUN_009c00c0(pointCapacity); sideCountF = (float)iVar3; puVar2 = puStack_20; LAB_009bfdd2: puStack_20 = puVar2; pointIdx = 0; if (-1 < (int)sideCountF) { iVar3 = (int)sideCountF; sideCountF = (float)(int)sideCountF; do { angle = ((float)(int)pointIdx * 6.2831855) / sideCountF; circleX = cos(angle); circleX = circleX * radius; pointY = sin(angle); pointY = pointY * radius; pointX = circleX; if (param_1 == 1) { if ((pointIdx & 1) != 0) { pointY = pointY * 0.382; pointX = circleX * 0.382; } } else if ((param_1 == 2) && ((pointIdx & 1) != 0)) { pointX = circleX * 0.577; pointY = pointY * 0.577; } pathEnd = (float *)in_ECX[2]; pointSegmentLength = 0.0; if ((int)pathEnd - (int)in_ECX[1] >> 4 != 0) { fVar1 = outPath[2]; fVar4 = pointY - *(float *)((int)fVar1 + -0xc); distX = pointX - *(float *)((int)fVar1 + -0x10); fVar4 = sqrtf(fVar4 * fVar4 + distX * distX); *(float *)((int)fVar1 + -4) = fVar4; *outPath = fVar4 + *outPath; pathEnd = (float *)in_ECX[2]; iVar3 = sideCount; } pointDistance = *outPath; if (pathEnd == (float *)in_ECX[3]) { std::vector<16byte>::_Emplace_reallocate(pathEnd,&pointX); } else { *pathEnd = pointX; pathEnd[1] = pointY; pathEnd[2] = pointDistance; pathEnd[3] = pointSegmentLength; in_ECX[2] = (float)((int)in_ECX[2] + 0x10); } pointIdx = pointIdx + 1; } while ((int)pointIdx <= iVar3); } ExceptionList = local_1c; return outPath; } //@@ 009bffb0 NpcHelper::path_point_at /* DB: point a share (fmod 1) along a built path by length; "Path is incomplete" (boss_approx_2) */ void NpcHelper::path_point_at(float *param_1) { float fVar1; float fVar2; int iVar3; float *in_ECX; float *pfVar4; float fVar5; int iVar6; int iVar7; float fVar8; float in_XMM2_Da; float fVar9; fVar9 = in_ECX[2]; if ((uint)((int)fVar9 - (int)in_ECX[1] >> 4) < 2) { KAGE_LogMessage(0x10,(byte *)"Path is incomplete"); fVar9 = in_ECX[2]; } fVar8 = fmodf(in_XMM2_Da,1.0); fVar5 = in_ECX[1]; iVar6 = 0; fVar1 = *in_ECX; iVar7 = (int)fVar9 - (int)fVar5 >> 4; iVar3 = 1; if (1 < iVar7) { pfVar4 = (float *)((int)fVar5 + 0x18); do { if (fVar8 * fVar1 < *pfVar4) { iVar6 = iVar3 + -1; break; } iVar3 = iVar3 + 1; pfVar4 = pfVar4 + 4; } while (iVar3 < iVar7); } fVar9 = *(float *)((int)fVar5 + 0xc + iVar6 * 0x10); fVar2 = *(float *)((int)fVar5 + 8 + iVar6 * 0x10); if (fVar9 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar5 = in_ECX[1]; } fVar9 = ((fVar8 * fVar1 - fVar2) - 0.0) / (fVar9 - 0.0); *param_1 = (*(float *)((int)fVar5 + 0x10 + iVar6 * 0x10) - *(float *)((int)fVar5 + iVar6 * 0x10)) * fVar9 + *(float *)((int)fVar5 + iVar6 * 0x10); param_1[1] = (*(float *)((int)fVar5 + 0x14 + iVar6 * 0x10) - *(float *)((int)fVar5 + 4 + iVar6 * 0x10)) * fVar9 + *(float *)((int)fVar5 + 4 + iVar6 * 0x10); return; } //@@ 009c00c0 FUN_009c00c0 void FUN_009c00c0(uint param_1) { int iVar1; int iVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 *puVar7; undefined4 *puVar8; int *in_ECX; undefined4 *puVar9; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } puVar8 = std::_Allocate(param_1 << 4); puVar3 = (undefined4 *)in_ECX[1]; puVar7 = puVar8; for (puVar9 = (undefined4 *)*in_ECX; puVar9 != puVar3; puVar9 = puVar9 + 4) { uVar4 = puVar9[1]; uVar5 = puVar9[2]; uVar6 = puVar9[3]; *puVar7 = *puVar9; puVar7[1] = uVar4; puVar7[2] = uVar5; puVar7[3] = uVar6; puVar7 = puVar7 + 4; } FUN_007de290(puVar8,iVar1 - iVar2 >> 4,param_1); return; } //@@ 009c0120 FUN_009c0120 float10 FUN_009c0120(void) { int *in_ECX; float10 fVar1; float fVar2; fVar1 = (float10)(**(code **)(*in_ECX + 0x10))(); fVar2 = (float)fVar1; if (fVar2 <= 0.0) { fVar2 = 0.0; } if (1.0 <= fVar2) { fVar2 = 1.0; } return (float10)(((float)in_ECX[3] - (float)in_ECX[2]) * fVar2 + (float)in_ECX[2]); } //@@ 009c0170 FUN_009c0170 void FUN_009c0170(float *param_1) { int *in_ECX; float10 fVar1; float fVar2; fVar1 = (float10)(**(code **)(*in_ECX + 0x10))(); fVar2 = (float)fVar1; if (fVar2 <= 0.0) { fVar2 = 0.0; } if (1.0 <= fVar2) { fVar2 = 1.0; } *param_1 = ((float)in_ECX[4] - (float)in_ECX[2]) * fVar2 + (float)in_ECX[2]; param_1[1] = ((float)in_ECX[5] - (float)in_ECX[3]) * fVar2 + (float)in_ECX[3]; return; } //@@ 009c01d0 Popup::constructor /* DB: ? ECX=new popup: id from global counter DAT_00c72a24, GetTimeNs timestamp, loads gfx/ui/Popup_Beige.png / Popup_White.png, copies desc arg, Popup::set_state; only caller PopupQueue::push (DB note: "copies desc (FUN_009c01d0)") */ int * Popup::constructor(undefined1 *param_1) { longlong lVar1; longlong lVar2; longlong lVar3; int iVar4; int iVar5; char cVar6; void *pvVar7; int *in_ECX; uint uVar8; uint uVar9; int iVar10; ulonglong uVar11; ulonglong uVar12; undefined4 local_40; int *local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; int *local_2c; undefined4 local_28; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00b0ec1b; local_1c = ExceptionList; ExceptionList = &local_1c; *in_ECX = DAT_00c72a24; in_ECX[1] = 0; in_ECX[2] = 0; DAT_00c72a24 = DAT_00c72a24 + 1; in_ECX[3] = -1; uVar11 = GetTimeNs(); uVar8 = (uint)(uVar11 >> 0x20); lVar1 = (uVar11 & 0xffffffff) * 0x431bde82; local_30 = (undefined4)((ulonglong)lVar1 >> 0x20); lVar2 = (ulonglong)uVar8 * 0x431bde82; local_34 = (undefined4)((ulonglong)lVar2 >> 0x20); local_28 = (undefined4)lVar2; uVar11 = (ulonglong)uVar8 * 0xd7b634db + ((uVar11 & 0xffffffff) * 0xd7b634db >> 0x20); uVar9 = (uint)(uVar11 >> 0x20); lVar1 = lVar1 + (uVar11 & 0xffffffff); local_40 = (undefined4)lVar1; uVar8 = (uint)((ulonglong)lVar1 >> 0x20); lVar2 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar8),uVar9 + uVar8); uVar8 = (uint)((ulonglong)lVar2 >> 0x20); in_ECX[6] = -0x1010102; local_2c = in_ECX + 7; in_ECX[4] = (uint)lVar2 >> 0x12 | uVar8 * 0x4000; in_ECX[5] = uVar8 >> 0x12; *local_2c = 0; in_ECX[8] = 0; local_14 = 0; *(undefined1 *)(in_ECX + 9) = 0; in_ECX[10] = 0; in_ECX[0xb] = 0x41c80000; in_ECX[0xc] = 0x41700000; in_ECX[0xd] = 0x3f800000; in_ECX[0xe] = 2; in_ECX[0xf] = 3; in_ECX[0x11] = 0; in_ECX[0x10] = 0; in_ECX[0x13] = 0; in_ECX[0x12] = 0; in_ECX[0x14] = 0x3f000000; in_ECX[0x15] = 0; in_ECX[0x16] = 1; in_ECX[0x17] = 0x3f800000; in_ECX[0x18] = 0; KColor::SetFromARGB((KColor *)(in_ECX + 0x19),0xffffffff); in_ECX[0x1e] = 0; in_ECX[0x1f] = 0; in_ECX[0x20] = 0; in_ECX[0x21] = 0; in_ECX[0x22] = 0; in_ECX[0x23] = 0; in_ECX[0x24] = 0; in_ECX[0x25] = 0; in_ECX[0x26] = 0; in_ECX[0x27] = 0; in_ECX[0x28] = 0; in_ECX[0x29] = 0; in_ECX[0x2a] = -1; in_ECX[0x2b] = -1; KColor::SetFromARGB((KColor *)(in_ECX + 0x2c),0xffd3d3d3); *(byte *)(in_ECX + 9) = *(byte *)(in_ECX + 9) | 7; *(undefined1 *)(in_ECX + 0x31) = 1; local_14._0_1_ = 1; in_ECX[0x35] = 0; in_ECX[0x34] = 0; in_ECX[0x37] = 0; in_ECX[0x36] = 0; in_ECX[0x32] = (int)IsaacRepentancePlus::Popup::LerpVector2::vftable; in_ECX[0x3c] = (int)IsaacRepentancePlus::Popup::LerpVector2::vftable; in_ECX[0x3f] = 0; in_ECX[0x3e] = 0; in_ECX[0x41] = 0; in_ECX[0x40] = 0; in_ECX[0x46] = (int)IsaacRepentancePlus::Popup::LerpFloat::vftable; uVar12 = GetTimeNs(); uVar8 = (uint)(uVar12 >> 0x20); uVar11 = (uVar12 & 0xffffffff) * 0xd7b634db; local_40 = (undefined4)uVar11; lVar1 = (uVar12 & 0xffffffff) * 0x431bde82; local_30 = (undefined4)((ulonglong)lVar1 >> 0x20); lVar2 = (ulonglong)uVar8 * 0xd7b634db; local_34 = (undefined4)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0x431bde82; local_3c = (int *)((ulonglong)lVar3 >> 0x20); local_28 = (undefined4)lVar3; uVar11 = lVar2 + (uVar11 >> 0x20); uVar9 = (uint)(uVar11 >> 0x20); lVar1 = lVar1 + (uVar11 & 0xffffffff); local_38 = (undefined4)lVar1; uVar8 = (uint)((ulonglong)lVar1 >> 0x20); lVar3 = lVar3 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar8),uVar9 + uVar8); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); in_ECX[0x4e] = (uint)lVar3 >> 0x12 | uVar8 * 0x4000; in_ECX[0x4f] = uVar8 >> 0x12; in_ECX[0x50] = 0; if (*(int *)(param_1 + 0x3c) == 1) { pvVar7 = Manager::LoadImage(&local_40,(byte *)"gfx/ui/Popup_Beige.png"); local_14._0_1_ = 2; KAGE::SmartPointer::operator_assign(local_2c,pvVar7); local_14 = CONCAT31(local_14._1_3_,3); } else { pvVar7 = Manager::LoadImage(&local_40,(byte *)"gfx/ui/Popup_White.png"); local_14._0_1_ = 4; KAGE::SmartPointer::operator_assign(local_2c,pvVar7); local_14 = CONCAT31(local_14._1_3_,5); } if (((local_3c != (int *)0x0) && (cVar6 = (**(code **)(*local_3c + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_40); } local_14 = CONCAT31(local_14._1_3_,1); *(undefined1 *)(in_ECX + 9) = *param_1; in_ECX[10] = *(int *)(param_1 + 4); in_ECX[0xb] = *(int *)(param_1 + 8); in_ECX[0xc] = *(int *)(param_1 + 0xc); in_ECX[0xd] = *(int *)(param_1 + 0x10); in_ECX[0xe] = *(int *)(param_1 + 0x14); in_ECX[0xf] = *(int *)(param_1 + 0x18); in_ECX[0x10] = *(int *)(param_1 + 0x1c); in_ECX[0x11] = *(int *)(param_1 + 0x20); in_ECX[0x12] = *(int *)(param_1 + 0x24); in_ECX[0x13] = *(int *)(param_1 + 0x28); in_ECX[0x14] = *(int *)(param_1 + 0x2c); in_ECX[0x15] = *(int *)(param_1 + 0x30); in_ECX[0x16] = *(int *)(param_1 + 0x34); in_ECX[0x17] = *(int *)(param_1 + 0x38); in_ECX[0x18] = *(int *)(param_1 + 0x3c); iVar10 = *(int *)(param_1 + 0x44); iVar4 = *(int *)(param_1 + 0x48); iVar5 = *(int *)(param_1 + 0x4c); in_ECX[0x19] = *(int *)(param_1 + 0x40); in_ECX[0x1a] = iVar10; in_ECX[0x1b] = iVar4; in_ECX[0x1c] = iVar5; in_ECX[0x1d] = *(int *)(param_1 + 0x50); if (in_ECX + 0x1e != (int *)(param_1 + 0x54)) { FUN_009c3070(*(int *)(param_1 + 0x54),*(undefined4 *)(param_1 + 0x58),local_3c); } iVar10 = *(int *)(param_1 + 0x6c); in_ECX[0x25] = *(int *)(param_1 + 0x70); in_ECX[0x24] = iVar10; iVar10 = *(int *)(param_1 + 0x74); in_ECX[0x27] = *(int *)(param_1 + 0x78); in_ECX[0x26] = iVar10; iVar10 = *(int *)(param_1 + 0x7c); in_ECX[0x29] = *(int *)(param_1 + 0x80); in_ECX[0x28] = iVar10; in_ECX[0x2a] = *(int *)(param_1 + 0x84); iVar10 = *(int *)(param_1 + 0x90); iVar4 = *(int *)(param_1 + 0x94); iVar5 = *(int *)(param_1 + 0x98); in_ECX[0x2c] = *(int *)(param_1 + 0x8c); in_ECX[0x2d] = iVar10; in_ECX[0x2e] = iVar4; in_ECX[0x2f] = iVar5; in_ECX[0x30] = *(int *)(param_1 + 0x9c); *(undefined1 *)(in_ECX + 0x31) = param_1[0xa0]; build_lines(); set_state(in_ECX,1); local_3c = (int *)0; if (0 < *(int *)(param_1 + 0x88)) { local_3c = (int *)*(int *)(param_1 + 0x88); } iVar10 = 0; if (-1 < (int)local_3c) { do { FUN_009c2210(1); iVar10 = iVar10 + 1; } while (iVar10 <= (int)local_3c); } ExceptionList = local_1c; return in_ECX; } //@@ 009c06a0 FUN_009c06a0 float * FUN_009c06a0(float *param_1) { float fVar1; int iVar2; float *pfVar3; int in_ECX; float fVar4; undefined1 local_20 [8]; undefined1 local_18 [4]; float local_14; float local_10; float local_c; iVar2 = *(int *)(in_ECX + 200); param_1[1] = 0.0; *param_1 = 0.0; pfVar3 = (float *)(**(code **)(iVar2 + 8))(local_18); fVar1 = *pfVar3; local_c = *(float *)(in_ECX + 0x48); local_10 = pfVar3[1]; local_14 = *(float *)(in_ECX + 0x4c); (**(code **)(*(int *)(in_ECX + 0xf0) + 8))(local_20); fVar4 = DAT_00c79980 * 0.5; *param_1 = fVar1 + local_c + DAT_00c7997c * 0.5; param_1[1] = (local_10 + local_14 + fVar4) - 9.0; return param_1; } //@@ 009c0760 Popup::get_size /* DB: out Vector = sizes of the two child widgets (vfuncs at +0xc8 and +0xf0, slot +8) times scale +0x40/+0x44; HUD::update_item_info centres the item popup with it */ float * Popup::get_size(float *param_1) { int iVar1; int in_ECX; float fVar2; float fVar3; float local_18; float afStack_14 [4]; iVar1 = *(int *)(in_ECX + 200); param_1[1] = 0.0; *param_1 = 0.0; (**(code **)(iVar1 + 8))(&local_18); (**(code **)(*(int *)(in_ECX + 0xf0) + 8))(afStack_14); fVar2 = local_18 * *(float *)(in_ECX + 0x40); FUN_008370b0(); fVar3 = afStack_14[0] * *(float *)(in_ECX + 0x44); FUN_008370b0(); *param_1 = fVar2; param_1[1] = fVar3; return param_1; } //@@ 009c07f0 Popup::get_elapsed_ms /* DB: (GetTimeNs() / 1000000) - start time at this+0x10/+0x14 (64-bit); PopupManager::close and HUD::update_item_info compare it to popup+0x54 timeout prototype: db/protos.zhl */ longlong __thiscall Popup::get_elapsed_ms(void *this) { longlong lVar1; longlong lVar2; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar4 = (uint)((ulonglong)lVar1 >> 0x20); uVar3 = (uint)lVar1 >> 0x12 | uVar4 * 0x4000; return CONCAT44(((uVar4 >> 0x12) - *(int *)((int)this + 0x14)) - (uint)(uVar3 < *(uint *)((int)this + 0x10)),uVar3 - *(uint *)((int)this + 0x10)); } //@@ 009c0870 FUN_009c0870 void FUN_009c0870(int param_1,char param_2) { int iVar1; uint uVar2; int in_ECX; int *piVar3; uint uVar4; int iVar5; int iVar6; uVar4 = 0; iVar1 = *(int *)(in_ECX + 0x84); uVar2 = (*(int *)(in_ECX + 0x88) - iVar1) / 0x30; if (uVar2 != 0) { piVar3 = (int *)(iVar1 + 0xc); iVar5 = 0; while (((piVar3[-1] == -1 && (iVar6 = iVar5, *piVar3 == -1)) || (iVar6 = iVar5 + 1, iVar5 != param_1))) { uVar4 = uVar4 + 1; piVar3 = piVar3 + 0xc; iVar5 = iVar6; if (uVar2 <= uVar4) { return; } } if (param_2 == '\0') { if (*(int *)(iVar1 + 0xc + uVar4 * 0x30) != -1) { return; } *(undefined4 *)(iVar1 + 0xc + uVar4 * 0x30) = *(undefined4 *)(iVar1 + 8 + uVar4 * 0x30); *(undefined4 *)(*(int *)(in_ECX + 0x84) + 8 + uVar4 * 0x30) = 0xffffffff; } else { if (*(int *)(iVar1 + 8 + uVar4 * 0x30) != -1) { return; } *(undefined4 *)(iVar1 + 8 + uVar4 * 0x30) = *(undefined4 *)(iVar1 + 0xc + uVar4 * 0x30); *(undefined4 *)(*(int *)(in_ECX + 0x84) + 0xc + uVar4 * 0x30) = 0xffffffff; } if (*(uint *)(in_ECX + 0xc) == uVar4) { FUN_009c2210(0xffffffff); if (*(uint *)(in_ECX + 0xc) == uVar4) { *(undefined4 *)(in_ECX + 0xc) = 0xffffffff; return; } } else if ((*(uint *)(in_ECX + 0xc) == 0xffffffff) && (param_2 != '\0')) { *(uint *)(in_ECX + 0xc) = uVar4; } } return; } //@@ 009c0960 Popup::Update /* DB: ? ECX=popup (state +4): fade progress from GetTimeNs elapsed / 100 clamped 0..1, Popup::get_elapsed_ms, Popup::set_state transitions, returns bool finished; called per popup from PopupQueue::Update (first-in-list flag arg) */ undefined4 Popup::Update(undefined4 param_1) { undefined4 *puVar1; int iVar2; char cVar3; void *in_ECX; undefined4 in_XMM0_Da; float fVar4; undefined4 in_XMM0_Db; longlong lVar5; iVar2 = *(int *)((int)in_ECX + 4); GetTimeNs(); FUN_00aefe20(); fVar4 = (float)(double)CONCAT44(in_XMM0_Db,in_XMM0_Da) / 100.0; if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } if (iVar2 < 3) { fVar4 = fVar4 * 0.4 + 0.0; } else { fVar4 = 0.4 - fVar4 * 0.4; } *(float *)((int)in_ECX + 0x140) = fVar4; iVar2 = *(int *)((int)in_ECX + 4); if (iVar2 == 1) { show(); goto LAB_009c0ba9; } if (iVar2 != 2) { if ((iVar2 == 3) && (cVar3 = hide(), cVar3 != '\0')) { return 1; } goto LAB_009c0ba9; } if ((char)param_1 == '\0') goto LAB_009c0ba9; if ((*(int *)((int)in_ECX + 0xc) < 0) || ((*(int *)((int)in_ECX + 0x88) - *(int *)((int)in_ECX + 0x84)) / 0x30 <= *(int *)((int)in_ECX + 0xc))) { LAB_009c0ad6: if (*(int *)((int)in_ECX + 0xa8) != -1) { param_1 = 0xf; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,¶m_1,0,0); if ((cVar3 != '\0') && (*(int *)((int)in_ECX + 4) < 3)) { *(undefined4 *)((int)in_ECX + 0x18) = 0xfefefefe; if (*(code **)((int)in_ECX + 0xa0) != (code *)0x0) { (**(code **)((int)in_ECX + 0xa0))((int)in_ECX + 0xa8,*(undefined4 *)((int)in_ECX + 0xa4)); } set_state(in_ECX,3); } } } else { param_1 = 0xe; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,¶m_1,0,0); if (cVar3 == '\0') goto LAB_009c0ad6; FUN_009c1200(*(int *)((int)in_ECX + 0x84) + 8 + *(int *)((int)in_ECX + 0xc) * 0x30,0); } param_1 = 0x16; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,¶m_1,0,0); if (cVar3 == '\0') { param_1 = 0x17; cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,¶m_1,0,0); if (cVar3 != '\0') { FUN_009c2210(1); } } else { FUN_009c2210(0xffffffff); } LAB_009c0ba9: puVar1 = (undefined4 *)((int)in_ECX + 0x18); if (*(int *)((int)in_ECX + 0x18) != -0x1010102) { lVar5 = get_elapsed_ms(in_ECX); if ((((int)((ulonglong)lVar5 >> 0x20) != 0) || (*(uint *)((int)in_ECX + 0x54) <= (uint)lVar5)) && (*(int *)((int)in_ECX + 4) < 3)) { lVar5 = get_elapsed_ms(in_ECX); if (((int)((ulonglong)lVar5 >> 0x20) == 0) && ((uint)lVar5 < *(uint *)((int)in_ECX + 0x54))) { *puVar1 = *puVar1; } else { *puVar1 = 0xfefefefe; if (*(code **)((int)in_ECX + 0xa0) != (code *)0x0) { (**(code **)((int)in_ECX + 0xa0))(puVar1,*(undefined4 *)((int)in_ECX + 0xa4)); } set_state(in_ECX,3); } } } if (*(code **)((int)in_ECX + 0x90) != (code *)0x0) { (**(code **)((int)in_ECX + 0x90))(in_ECX,*(undefined4 *)((int)in_ECX + 0x94)); } return 0; } //@@ 009c0c30 popup_render /* DB: ? renders one entry of the mutex-guarded list at Manager+0x4d070 (the list Manager::update_controller_popups fills) when its layer (+0x3c) matches FUN_009c3890's arg (Game::Render calls 009c3890(0/1/2)); background quad (flag 1), shadow (flag 2), Font::measure_string + Font::render_glyph_quads */ void popup_render(void) { int *piVar1; int iVar2; Font *this; KColor color; byte bVar3; float *pfVar4; void *glyphs; int in_ECX; int *piVar5; float10 fVar6; float fVar7; float fVar8; float fVar9; undefined1 local_1c0 [112]; undefined1 local_150 [116]; undefined4 local_dc; undefined4 uStack_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 local_cc; undefined4 uStack_c8; undefined4 uStack_c4; undefined4 uStack_c0; int local_bc; undefined4 local_b8; int *local_b4; undefined4 local_b0; float local_ac; undefined4 local_a8; Vector local_a4; float local_9c; float local_98; float local_94; float local_90; float local_8c; float local_88; float local_84; float local_80; float local_7c; undefined4 local_78; undefined4 uStack_74; undefined4 uStack_70; undefined4 uStack_6c; KColor local_68; KColor local_54; float local_40; float local_3c; int local_38; float local_34; int *local_30; float local_2c; float local_28; float local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0ec55; local_1c = ExceptionList; ExceptionList = &local_1c; local_34 = *(float *)(in_ECX + 100); local_30 = *(int **)(in_ECX + 0x68); local_2c = *(float *)(in_ECX + 0x6c); local_28 = *(float *)(in_ECX + 0x70); local_38 = in_ECX; local_24 = local_28; fVar6 = (float10)(**(code **)(*(int *)(in_ECX + 0x118) + 8)) (__security_cookie ^ (int)register0x00000010 - 0x10U); g_graphicsManager_blendMode[1] = 1; local_b8 = local_34; if (((byte)g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } local_b4 = local_30; local_ac = (float)(fVar6 * (float10)local_28); g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; bVar3 = *(byte *)(in_ECX + 0x24); local_b0 = local_2c; local_a8 = 0; local_28 = local_ac; if ((bVar3 & 1) != 0) { local_54._alpha = *(float *)(in_ECX + 0x140); local_54._unk = 0; local_54._red = 0.0; local_54._green = 0.0; local_54._blue = 0.0; render_quad_set_uniform_color(local_150,0.0,0.0,DAT_00c7997c,DAT_00c79980,&local_54); render_color_shader_pass(local_150); bVar3 = *(byte *)(in_ECX + 0x24); } if ((bVar3 & 2) != 0) { local_40 = 5.0; local_3c = 5.0; fVar6 = (float10)(**(code **)(*(int *)(in_ECX + 0x118) + 8))(); local_54._unk = 0; local_54._red = 0.0; local_54._green = 0.0; local_54._blue = 0.0; local_54._alpha = (float)(fVar6 * (float10)0.4 * (float10)local_24); local_24 = local_54._alpha; Popup::render_frame(&local_54,&local_40); } Popup::render_frame(&local_b8,&g_vectorZero); iVar2 = *(int *)(in_ECX + 0x84); (**(code **)(*(int *)(in_ECX + 0xf0) + 8))(&local_80); pfVar4 = (float *)(**(code **)(*(int *)(in_ECX + 200) + 8))(&local_a4); local_28 = *pfVar4 + *(float *)(in_ECX + 0x48); local_24 = pfVar4[1] + *(float *)(in_ECX + 0x4c); (**(code **)(*(int *)(in_ECX + 0xf0) + 8))(&local_40); local_2c = DAT_00c79980 * 0.5 + local_24; fVar7 = local_3c * *(float *)(in_ECX + 0x44); FUN_008370b0(); fVar8 = local_40 * *(float *)(in_ECX + 0x40); local_24 = fVar7; FUN_008370b0(); fVar9 = DAT_00c7997c * 0.5 + local_28; local_28 = 0.0; fVar9 = fVar9 - fVar8 * 0.5; fVar7 = (local_2c - 9.0) - local_24 * 0.5; local_34 = fVar9; local_2c = fVar7; if (iVar2 != *(int *)(in_ECX + 0x88)) { local_30 = (int *)(iVar2 + 0xc); do { if ((*(char *)(in_ECX + 0xc4) != '\0') || (fVar8 = local_28, *local_30 == -1)) { this = *(Font **)(in_ECX + 0x28); pfVar4 = (float *)(local_30 + 1); if (*local_30 != -1) { pfVar4 = (float *)(in_ECX + 0xb0); } uStack_70 = 0; uStack_6c = 0xffff; local_68._red = 0.0; local_68._green = 1.0; local_24 = *pfVar4; fVar8 = pfVar4[4]; local_84 = pfVar4[1]; local_88 = pfVar4[2]; local_8c = local_ac * pfVar4[3]; local_68._blue = -NAN; local_68._alpha = 0.0; local_68._unk = 0; local_14 = 0; local_90 = local_7c; local_a4.y = local_7c; local_98 = local_7c * (float)local_30[7] + fVar7; local_94 = local_80; local_a4.x = local_80; local_9c = local_80 * (float)local_30[6] + fVar9; glyphs = Font::measure_string (this,&local_54._green,(byte *)local_30[-3],&uStack_70,&local_a4); local_14 = CONCAT31(local_14._1_3_,1); color._green = local_84; color._red = local_24; color._blue = local_88; color._alpha = local_8c; color._unk = (int)fVar8; Font::render_glyph_quads(this,glyphs,local_9c,local_98,local_94,local_90,color,&uStack_70); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); fVar8 = local_28; in_ECX = local_38; local_14 = 0xffffffff; if (local_28 == (float)*(int *)(local_38 + 0xc)) { local_68._unk = 0; local_68._red = 1.0; local_68._green = 1.0; local_68._blue = 1.0; local_68._alpha = 1.0; fVar7 = (((float)local_30[6] - 12.0) - 8.0) * local_80 + local_34; fVar9 = (((float)*(ushort *)(*(int *)(local_38 + 0x28) + 0x14) - 15.0) * 0.5 + (float)local_30[7]) * local_7c + local_2c; render_quad_set_uniform_color (local_1c0,fVar7,fVar9,local_80 * 12.0 + fVar7,local_7c * 15.0 + fVar9,&local_68 ); local_78 = 0x42c80000; uStack_6c = 0x41e00000; uStack_74 = 0x41e00000; uStack_70 = 0x42e00000; local_68._red = 100.0; local_dc = 0x42c80000; uStack_d8 = 0x41e00000; uStack_d4 = 0x42e00000; uStack_d0 = 0x41e00000; local_68._blue = 112.0; local_68._alpha = 43.0; local_68._green = 43.0; local_68._unk = CONCAT31(local_68._unk._1_3_,1); local_cc = 0x42c80000; uStack_c8 = 0x422c0000; uStack_c4 = 0x42e00000; uStack_c0 = 0x422c0000; local_bc = local_68._unk; (**(code **)(**(int **)(in_ECX + 0x1c) + 0x14))(&local_dc,local_1c0,&local_b8); } fVar7 = local_2c; fVar9 = local_34; } piVar5 = local_30 + 0xc; local_28 = (float)((int)fVar8 + 1); piVar1 = local_30 + 9; local_30 = piVar5; } while (piVar1 != *(int **)(in_ECX + 0x88)); } if (*(code **)(in_ECX + 0x98) != (code *)0x0) { (**(code **)(in_ECX + 0x98))(in_ECX,*(undefined4 *)(in_ECX + 0x9c)); } ExceptionList = local_1c; return; } //@@ 009c1200 FUN_009c1200 void FUN_009c1200(undefined4 *param_1,char param_2) { void *in_ECX; longlong lVar1; if (*(int *)((int)in_ECX + 4) < 3) { if (param_2 == '\0') { lVar1 = Popup::get_elapsed_ms(in_ECX); if (((int)((ulonglong)lVar1 >> 0x20) == 0) && ((uint)lVar1 < *(uint *)((int)in_ECX + 0x54))) { *(undefined4 *)((int)in_ECX + 0x18) = *param_1; return; } } *(undefined4 *)((int)in_ECX + 0x18) = 0xfefefefe; if (*(code **)((int)in_ECX + 0xa0) != (code *)0x0) { (**(code **)((int)in_ECX + 0xa0))(param_1,*(undefined4 *)((int)in_ECX + 0xa4)); } Popup::set_state(in_ECX,3); } return; } //@@ 009c1260 Popup::set_state /* DB: ? thiscall: state 1 -> show (FUN_009c12d0), 2 -> resets two child positions via vfuncs at +0xc8/+0xf0 (zero vector), 3 -> hide (FUN_009c14c0); stores state at this+4; callers PopupQueue internals (009c01d0, 009c3ab0), HUD::update_item_info, Manager::update_controller_popups prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Popup::set_state(void *this,int state) { if (state == 1) { show(); } else { if (state == 2) { (*(code *)**(undefined4 **)((int)this + 200))(&g_vectorZero); (*(code *)**(undefined4 **)((int)this + 0xf0))(&g_vectorOne); *(undefined4 *)((int)this + 4) = 2; return; } if (state == 3) { hide(); *(undefined4 *)((int)this + 4) = 3; return; } } *(int *)((int)this + 4) = state; return; } //@@ 009c12d0 Popup::show /* DB: Popup::set_state(1) calls it (DB note: 1 -> show): unless already state 1, resets the child transforms (+0xc8 position, +0xf0 scale, +0x118 alpha) and starts the opening tweens by style +0x58 (slide from -320 for style 1); also from the popup update 009c0960 Popup::Update void Popup::show(void) { int iVar1; char cVar2; void *in_ECX; undefined4 local_10; int local_c; float local_8; if (*(int *)((int)in_ECX + 4) != 1) { (*(code *)**(undefined4 **)((int)in_ECX + 200))(&g_vectorZero); (*(code *)**(undefined4 **)((int)in_ECX + 0xf0))(&g_vectorOne); local_8 = 1.0; (*(code *)**(undefined4 **)((int)in_ECX + 0x118))(&local_8); local_8 = 1.0 / *(float *)((int)in_ECX + 0x5c); if (*(int *)((int)in_ECX + 0x58) == 1) { local_10 = 0; local_c = -0x3ca10000; (*(code *)**(undefined4 **)((int)in_ECX + 200))(&local_10); local_c = __ftoui3(); (**(code **)(*(int *)((int)in_ECX + 200) + 4))(&g_vectorZero,&local_c); *(undefined4 *)((int)in_ECX + 8) = 1; (*(code *)**(undefined4 **)((int)in_ECX + 0xf0))(&DAT_00c375e0); local_c = __ftoui3(); (**(code **)(*(int *)((int)in_ECX + 0xf0) + 4))(&DAT_00c375ec,&local_c); } else { local_c = *(int *)((int)in_ECX + 0x58) + -2; if (local_c == 0) { (*(code *)**(undefined4 **)((int)in_ECX + 0x118))(&local_c); local_c = __ftoui3(); local_8 = 1.0; (**(code **)(*(int *)((int)in_ECX + 0x118) + 4))(&local_8,&local_c); *(undefined4 *)((int)in_ECX + 4) = 1; return; } } *(undefined4 *)((int)in_ECX + 4) = 1; return; } iVar1 = *(int *)((int)in_ECX + 0x58); if (iVar1 != 0) { if (iVar1 == 1) { cVar2 = (**(code **)(*(int *)((int)in_ECX + 0xf0) + 0xc))(); if (cVar2 == '\0') { return; } iVar1 = *(int *)((int)in_ECX + 8); *(int *)((int)in_ECX + 8) = iVar1 + 1; if (iVar1 + 1 < 4) { (**(code **)(*(int *)((int)in_ECX + 0xf0) + 4)) (&DAT_00c375ec + iVar1 * 0xc,&DAT_00c375e8 + iVar1 * 3); return; } } else { if (iVar1 != 2) { return; } cVar2 = (**(code **)(*(int *)((int)in_ECX + 0x118) + 0xc))(); if (cVar2 == '\0') { return; } } } set_state(in_ECX,2); return; } //@@ 009c14c0 Popup::hide /* DB: Popup::set_state(3) calls it (DB note on set_state: 3 -> hide): unless already state 3, starts the closing tweens (vfuncs at +0xf0/+0x118 per style +0x58) and records GetTimeNs/1e6 start time at +0x138; also from the popup update 009c0960 Popup::Update undefined4 Popup::hide(void) { int iVar1; longlong lVar2; longlong lVar3; char cVar4; int in_ECX; uint uVar5; uint uVar6; uint uVar7; ulonglong uVar8; int local_18; uint local_14; undefined4 local_10 [2]; undefined4 local_8; iVar1 = *(int *)(in_ECX + 0x58); local_18 = in_ECX; if (*(int *)(in_ECX + 4) != 3) { if (iVar1 == 1) { *(undefined4 *)(in_ECX + 8) = 3; local_10[0] = __ftoui3(); (**(code **)(*(int *)(in_ECX + 0xf0) + 4))(&DAT_00c37604,local_10); uVar8 = GetTimeNs(); uVar6 = (uint)(uVar8 >> 0x20); lVar2 = (uVar8 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar6 * 0xd7b634db + ((uVar8 & 0xffffffff) * 0xd7b634db >> 0x20); uVar7 = (uint)((ulonglong)lVar3 >> 0x20); uVar5 = (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (ulonglong)uVar6 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar7,uVar5),uVar7 + uVar5) ; uVar5 = (uint)((ulonglong)lVar2 >> 0x20); *(uint *)(local_18 + 0x138) = (uint)lVar2 >> 0x12 | uVar5 * 0x4000; *(uint *)(local_18 + 0x13c) = uVar5 >> 0x12; in_ECX = local_18; } else if (iVar1 == 2) { local_8 = __ftoui3(); local_10[0] = 0; (**(code **)(*(int *)(in_ECX + 0x118) + 4))(local_10,&local_8); *(undefined4 *)(in_ECX + 4) = 3; return 0; } *(undefined4 *)(in_ECX + 4) = 3; return 0; } if (iVar1 == 0) { return 1; } if (iVar1 == 1) { cVar4 = (**(code **)(*(int *)(in_ECX + 0xf0) + 0xc))(); if (cVar4 != '\0') { uVar5 = *(int *)(in_ECX + 8) - 1; *(uint *)(in_ECX + 8) = uVar5; if ((int)uVar5 < 0) { return 1; } if (uVar5 == 0) { local_18 = 0x70; local_10[0] = 0xc3690000; local_14 = uVar5; (**(code **)(*(int *)(in_ECX + 200) + 4))(&local_14,&local_18); uVar5 = *(uint *)(in_ECX + 8); } (**(code **)(*(int *)(in_ECX + 0xf0) + 4)) (&DAT_00c375e0 + uVar5 * 0xc,&DAT_00c375e8 + uVar5 * 3); } } else if ((iVar1 == 2) && (cVar4 = (**(code **)(*(int *)(in_ECX + 0x118) + 0xc))(), cVar4 != '\0')) { return 1; } return 0; } //@@ 009c16b0 Popup::render_frame /* DB: ? (KColor*, Vector* offset), ECX = Popup: builds ColorQuads (Quad::rotate, render_quad_set_uniform_color) and submits them via the image vfunc +0x14; FUN_009c0c30 (popup render, from the PopupQueue walker FUN_009c3890 <- Game::Render/Manager::Render) calls it twice: shadow offset (5,5) then &g_vectorZero */ void Popup::render_frame(undefined4 *param_1,float *param_2) { float *pfVar1; int in_ECX; KColor *color; KColor *color_00; int iVar2; KColor *color_01; KColor *color_02; KColor *color_03; KColor *color_04; KColor *color_05; KColor *color_06; KColor *color_07; KColor *color_08; float *pfVar3; float fVar4; float fVar5; float fVar6; float fVar7; undefined1 local_170 [112]; undefined1 local_100 [4]; float local_fc; float local_f8 [6]; float local_e0; float local_dc; undefined4 local_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 local_c8; undefined4 local_c4; undefined4 uStack_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 local_b4; undefined4 local_b0; undefined4 uStack_ac; undefined4 uStack_a8; undefined4 uStack_a4; undefined4 local_a0; undefined4 local_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined4 local_8c; undefined4 local_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined4 local_74; undefined4 uStack_70; undefined4 uStack_6c; undefined4 uStack_68; int local_64; Vector local_60; float local_58; float local_54; float local_50; float local_4c; float local_48; float local_44; float local_40; float local_3c; int local_38; undefined4 local_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; KColor local_24; local_38 = in_ECX; pfVar1 = (float *)(**(code **)(*(int *)(in_ECX + 200) + 8))(local_100); local_54 = *pfVar1 + *(float *)(in_ECX + 0x48); local_58 = pfVar1[1] + *(float *)(in_ECX + 0x4c); (**(code **)(*(int *)(in_ECX + 0xf0) + 8))(&local_60); fVar4 = local_60.x * *(float *)(in_ECX + 0x40); FUN_008370b0(); fVar5 = local_60.y * *(float *)(in_ECX + 0x44); local_44 = fVar4; FUN_008370b0(); local_4c = fVar5 / 98.0; fVar6 = local_44 * 0.5; fVar5 = fVar5 * 0.5; fVar4 = DAT_00c7997c * 0.5 + local_54 + *param_2; fVar7 = ((DAT_00c79980 * 0.5 + local_58) - 9.0) + param_2[1]; local_50 = fVar5; local_48 = fVar7; local_44 = local_44 / 211.0; local_40 = fVar4; local_3c = fVar6; KColor::SetFromARGB(&local_24,0xffffffff); ColorQuad::ColorQuad(local_f8,color); local_34 = 0x42f00000; uStack_28 = 0x41200000; uStack_30 = 0x41200000; uStack_2c = 0x43000000; local_24._red = 120.0; local_24._blue = 128.0; local_84 = 0x42f00000; uStack_80 = 0x41200000; uStack_7c = 0x43000000; uStack_78 = 0x41200000; local_24._alpha = 18.0; local_24._green = 18.0; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x42f00000; uStack_70 = 0x41900000; uStack_6c = 0x43000000; uStack_68 = 0x41900000; local_64 = local_24._unk; local_54 = fVar4 - fVar6; local_58 = fVar7 - fVar5; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color (local_170,fVar4 - fVar6,fVar7 - fVar5,fVar6 + fVar6 + (fVar4 - fVar6), fVar5 + fVar5 + (fVar7 - fVar5),color_00); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); fVar6 = local_4c * 98.0; local_34 = 0x3f800000; fVar4 = local_58 - 7.0; uStack_28 = 0x41e00000; fVar5 = local_54 - fVar6; uStack_30 = 0x41e00000; uStack_2c = 0x42c60000; local_24._red = 1.0; local_24._blue = 99.0; local_24._alpha = 35.0; local_24._green = 35.0; local_84 = 0x3f800000; uStack_80 = 0x41e00000; uStack_7c = 0x42c60000; uStack_78 = 0x41e00000; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x3f800000; uStack_70 = 0x420c0000; uStack_6c = 0x42c60000; uStack_68 = 0x420c0000; local_64 = local_24._unk; local_4c = fVar6; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color(local_170,fVar5,fVar4,fVar5 + fVar6,fVar4 + 7.0,color_01); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_60.x = local_e0; local_60.y = local_dc; Quad::rotate(local_f8,&local_60,-1.5707964); local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); fVar6 = local_44 * 211.0; local_34 = 0x41000000; fVar5 = local_40 - local_3c; uStack_28 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x435b0000; local_24._red = 8.0; local_24._blue = 219.0; local_84 = 0x41000000; uStack_80 = 0x3f800000; uStack_7c = 0x435b0000; uStack_78 = 0x3f800000; local_24._alpha = 9.0; local_24._green = 9.0; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x41000000; uStack_70 = 0x41100000; uStack_6c = 0x435b0000; uStack_68 = 0x41100000; local_fc = local_50 + 8.0; local_64 = local_24._unk; fVar4 = local_48 - local_fc; local_44 = fVar6; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color(local_170,fVar5,fVar4,fVar5 + fVar6,fVar4 + 8.0,color_02); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); local_34 = 0x3f800000; fVar4 = local_48 + -local_50; uStack_28 = 0x42100000; uStack_30 = 0x42100000; uStack_2c = 0x42c60000; local_24._red = 1.0; local_24._blue = 99.0; local_84 = 0x3f800000; uStack_80 = 0x42100000; uStack_7c = 0x42c60000; uStack_78 = 0x42100000; local_24._alpha = 43.0; local_24._green = 43.0; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x3f800000; uStack_70 = 0x422c0000; uStack_6c = 0x42c60000; uStack_68 = 0x422c0000; local_64 = local_24._unk; fVar5 = local_40 + (local_3c - local_4c); KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color (local_170,fVar5,fVar4,fVar5 + local_4c,fVar4 + 7.0,color_03); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_60.x = local_f8[2]; local_60.y = local_f8[3]; Quad::rotate(local_f8,&local_60,-1.5707964); local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); fVar4 = local_48 + local_50; fVar5 = -local_3c + local_40; local_34 = 0x40800000; uStack_28 = 0x41200000; uStack_30 = 0x41200000; uStack_2c = 0x43570000; local_24._red = 4.0; local_24._blue = 215.0; local_24._alpha = 27.0; local_24._green = 27.0; local_84 = 0x40800000; uStack_80 = 0x41200000; uStack_7c = 0x43570000; uStack_78 = 0x41200000; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x40800000; uStack_70 = 0x41d80000; uStack_6c = 0x43570000; uStack_68 = 0x41d80000; local_64 = local_24._unk; local_4c = fVar4; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color (local_170,fVar5,fVar4,fVar5 + local_44,fVar4 + 17.0,color_04); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); local_24._red = 1.0; local_34 = 0x3f800000; uStack_28 = 0x40800000; uStack_30 = 0x40800000; local_24._blue = 8.0; uStack_2c = 0x41000000; local_24._alpha = 9.0; fVar5 = local_54 - 7.0; fVar4 = local_58 - 5.0; local_24._green = 9.0; local_84 = 0x3f800000; uStack_80 = 0x40800000; uStack_7c = 0x41000000; uStack_78 = 0x40800000; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x3f800000; uStack_70 = 0x41100000; uStack_6c = 0x41000000; uStack_68 = 0x41100000; local_64 = local_24._unk; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color(local_170,fVar5,fVar4,fVar5 + 7.0,fVar4 + 5.0,color_05); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); fVar5 = local_40 + local_3c; fVar4 = -local_fc + local_48; local_34 = 0x435b0000; uStack_28 = 0x3f800000; uStack_30 = 0x3f800000; uStack_2c = 0x435e0000; local_24._red = 219.0; local_24._blue = 222.0; local_24._alpha = 9.0; local_24._green = 9.0; local_84 = 0x435b0000; uStack_80 = 0x3f800000; uStack_7c = 0x435e0000; uStack_78 = 0x3f800000; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x435b0000; uStack_70 = 0x41100000; uStack_6c = 0x435e0000; uStack_68 = 0x41100000; local_64 = local_24._unk; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color(local_170,fVar5,fVar4,fVar5 + 3.0,fVar4 + 8.0,color_06); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); local_34 = 0x3f800000; uStack_28 = 0x41200000; uStack_30 = 0x41200000; uStack_2c = 0x40800000; local_24._red = 1.0; fVar4 = -(local_3c + 3.0) + local_40; local_24._blue = 4.0; local_24._alpha = 23.0; local_24._green = 23.0; local_84 = 0x3f800000; uStack_80 = 0x41200000; uStack_7c = 0x40800000; uStack_78 = 0x41200000; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x3f800000; uStack_70 = 0x41b80000; uStack_6c = 0x40800000; uStack_68 = 0x41b80000; local_64 = local_24._unk; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color (local_170,fVar4,local_4c,fVar4 + 3.0,local_4c + 13.0,color_07); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); fVar5 = local_3c + local_40; fVar4 = local_48 + local_50; local_34 = 0x43570000; uStack_28 = 0x41200000; uStack_30 = 0x41200000; uStack_2c = 0x435c0000; local_24._red = 215.0; local_24._blue = 220.0; local_24._alpha = 27.0; local_24._green = 27.0; local_84 = 0x43570000; uStack_80 = 0x41200000; uStack_7c = 0x435c0000; uStack_78 = 0x41200000; local_24._unk = CONCAT31(local_24._unk._1_3_,1); local_74 = 0x43570000; uStack_70 = 0x41d80000; uStack_6c = 0x435c0000; uStack_68 = 0x41d80000; local_64 = local_24._unk; KColor::SetFromARGB(&local_24,0xffffffff); pfVar1 = render_quad_set_uniform_color(local_170,fVar5,fVar4,fVar5 + 5.0,fVar4 + 17.0,color_08); pfVar3 = local_f8; for (iVar2 = 0x1c; iVar2 != 0; iVar2 = iVar2 + -1) { *pfVar3 = *pfVar1; pfVar1 = pfVar1 + 1; pfVar3 = pfVar3 + 1; } local_9c = *param_1; uStack_98 = param_1[1]; uStack_94 = param_1[2]; uStack_90 = param_1[3]; local_c8 = param_1[4]; local_b0 = *param_1; uStack_ac = param_1[1]; uStack_a8 = param_1[2]; uStack_a4 = param_1[3]; local_c4 = *param_1; uStack_c0 = param_1[1]; uStack_bc = param_1[2]; uStack_b8 = param_1[3]; local_d8 = *param_1; uStack_d4 = param_1[1]; uStack_d0 = param_1[2]; uStack_cc = param_1[3]; local_b4 = local_c8; local_a0 = local_c8; local_8c = local_c8; (**(code **)(**(int **)(local_38 + 0x1c) + 0x14))(&local_84,local_f8,g_drawRectUnset); return; } //@@ 009c2210 FUN_009c2210 void FUN_009c2210(int param_1) { int iVar1; int iVar2; int in_ECX; int iVar3; iVar1 = *(int *)(in_ECX + 0xc); iVar3 = iVar1; do { iVar3 = param_1 + iVar3; *(int *)(in_ECX + 0xc) = iVar3; if (iVar3 < 0) { if (iVar1 < 0) goto LAB_009c2297; iVar3 = (*(int *)(in_ECX + 0x88) - *(int *)(in_ECX + 0x84)) / 0x30 + iVar3; *(int *)(in_ECX + 0xc) = iVar3; } iVar2 = (*(int *)(in_ECX + 0x88) - *(int *)(in_ECX + 0x84)) / 0x30; if (iVar2 <= iVar3) { if (iVar1 < 0) { LAB_009c2297: *(undefined4 *)(in_ECX + 0xc) = 0xffffffff; return; } iVar3 = iVar3 - iVar2; *(int *)(in_ECX + 0xc) = iVar3; } if (iVar3 == iVar1) { return; } if (*(int *)(*(int *)(in_ECX + 0x84) + 8 + iVar3 * 0x30) != -1) { return; } } while( true ); } //@@ 009c22b0 FUN_009c22b0 void FUN_009c22b0(undefined4 *param_1) { undefined4 uVar1; int in_ECX; uVar1 = *param_1; *(undefined4 *)(in_ECX + 0xc) = uVar1; *(undefined4 *)(in_ECX + 8) = uVar1; return; } //@@ 009c22d0 FUN_009c22d0 void FUN_009c22d0(undefined4 *param_1,undefined4 *param_2) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(in_ECX + 0xc); *(undefined4 *)(in_ECX + 0xc) = *param_1; uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(in_ECX + 0x10) = (uint)lVar1 >> 0x12 | uVar3 * 0x4000; *(uint *)(in_ECX + 0x14) = uVar3 >> 0x12; *(undefined4 *)(in_ECX + 0x18) = *param_2; return; } //@@ 009c2370 FUN_009c2370 bool FUN_009c2370(void) { int *in_ECX; float10 extraout_ST0; (**(code **)(*in_ECX + 0x10))(); return 1.0 <= (float)extraout_ST0; } //@@ 009c23a0 FUN_009c23a0 float10 FUN_009c23a0(void) { int in_ECX; double in_XMM0_Qa; GetTimeNs(); FUN_00aefe20(); return (float10)((float)in_XMM0_Qa / (float)((double)*(int *)(in_ECX + 0x18) + __uint_to_double_fixup[-(*(int *)(in_ECX + 0x18) >> 0x1f)])); } //@@ 009c2450 FUN_009c2450 void FUN_009c2450(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; int in_ECX; uVar1 = *param_1; *(undefined4 *)(in_ECX + 0x10) = uVar1; uVar2 = param_1[1]; *(undefined4 *)(in_ECX + 0x14) = uVar2; *(undefined4 *)(in_ECX + 8) = uVar1; *(undefined4 *)(in_ECX + 0xc) = uVar2; return; } //@@ 009c2480 FUN_009c2480 void FUN_009c2480(undefined4 *param_1,undefined4 *param_2) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(in_ECX + 0x10); *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(in_ECX + 0x14); *(undefined4 *)(in_ECX + 0x10) = *param_1; *(undefined4 *)(in_ECX + 0x14) = param_1[1]; uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(in_ECX + 0x18) = (uint)lVar1 >> 0x12 | uVar3 * 0x4000; *(uint *)(in_ECX + 0x1c) = uVar3 >> 0x12; *(undefined4 *)(in_ECX + 0x20) = *param_2; return; } //@@ 009c2530 FUN_009c2530 float10 FUN_009c2530(void) { int in_ECX; double in_XMM0_Qa; GetTimeNs(); FUN_00aefe20(); return (float10)((float)in_XMM0_Qa / (float)((double)*(int *)(in_ECX + 0x20) + __uint_to_double_fixup[-(*(int *)(in_ECX + 0x20) >> 0x1f)])); } //@@ 009c25e0 MessagePopup::MessagePopup /* DB: ? (font, callback, userdata, pos) popup descriptor: the callback later gets button ids 0xDEADBEEF/0x1212/0x2323; followed by add-text 009c2700, add-button 009c2760 and PopupQueue::push (was FontDrawParams::FontDrawParams) prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall MessagePopup::MessagePopup(void *this,void *font,void *callback,void *userData,Vector *position) { float fVar1; *(undefined1 *)this = 0; *(undefined4 *)((int)this + 8) = 0x41c80000; *(undefined4 *)((int)this + 0xc) = 0x41700000; *(void **)((int)this + 4) = font; *(undefined4 *)((int)this + 0x10) = 0x3f800000; *(undefined4 *)((int)this + 0x14) = 2; *(undefined4 *)((int)this + 0x18) = 3; fVar1 = position->y; *(float *)((int)this + 0x1c) = position->x; *(float *)((int)this + 0x20) = fVar1; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(undefined4 *)((int)this + 0x2c) = 0x3f000000; *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 1; *(undefined4 *)((int)this + 0x38) = 0x3f800000; *(undefined4 *)((int)this + 0x3c) = 0; KColor::SetFromARGB((KColor *)((int)this + 0x40),0xffffffff); *(undefined4 *)((int)this + 0x54) = 0; *(undefined4 *)((int)this + 0x58) = 0; *(undefined4 *)((int)this + 0x5c) = 0; *(undefined4 *)((int)this + 0x60) = 0; *(undefined4 *)((int)this + 100) = 0; *(undefined4 *)((int)this + 0x68) = 0; *(undefined4 *)((int)this + 0x6c) = 0; *(undefined4 *)((int)this + 0x70) = 0; *(undefined4 *)((int)this + 0x74) = 0; *(undefined4 *)((int)this + 0x78) = 0; *(undefined4 *)((int)this + 0x7c) = 0; *(undefined4 *)((int)this + 0x80) = 0; *(undefined4 *)((int)this + 0x84) = 0xffffffff; *(undefined4 *)((int)this + 0x88) = 0xffffffff; KColor::SetFromARGB((KColor *)((int)this + 0x8c),0xffd3d3d3); *(byte *)this = *(byte *)this | 7; *(void **)((int)this + 0x7c) = callback; *(undefined1 *)((int)this + 0xa0) = 1; *(void **)((int)this + 0x80) = userData; return; } //@@ 009c2700 FUN_009c2700 void FUN_009c2700(undefined4 param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4) { undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_30 = param_1; local_34 = 0; local_2c = 0xffffffff; local_28 = 0xffffffff; local_24 = *param_4; uStack_20 = param_4[1]; uStack_1c = param_4[2]; uStack_18 = param_4[3]; local_14 = param_4[4]; local_10 = *param_2; local_c = param_2[1]; local_8 = *param_3; std::vector<48byte>::push_back(&local_34); return; } //@@ 009c2760 FUN_009c2760 void FUN_009c2760(undefined4 param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4, undefined4 *param_5) { undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; local_34 = param_1; local_38 = 0; local_2c = 0xffffffff; local_30 = *param_2; local_28 = *param_5; uStack_24 = param_5[1]; uStack_20 = param_5[2]; uStack_1c = param_5[3]; local_18 = param_5[4]; local_14 = *param_3; local_10 = param_3[1]; local_c = *param_4; std::vector<48byte>::push_back(&local_38); return; } //@@ 009c27c0 Popup::build_lines /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? from Popup::constructor: Popup::free_line_buffers, then for each text entry (vector at +0x54) translates "##GAME##"/"##PLATFORM##" keys (string_table_translate), word-wraps via FUN_00682390 (width -1 entries) and stores per-line buffers/widths (Font::get_string_width_n) */ void Popup::build_lines(void) { float *pfVar1; byte bVar2; int *piVar3; int iVar4; byte *pbVar5; void *ptr; int *piVar6; int iVar7; void *in_ECX; StringTable *stringTable; byte *pbVar8; void *pvVar9; char *_Dest; int *piVar10; uint size; undefined4 *puVar11; uint uVar12; undefined4 *puVar13; int *piVar14; float fVar15; float fVar16; float fVar17; float fVar18; undefined1 *puVar19; int local_68; uint local_60; int *local_54; int *local_50; int local_4c; undefined4 *local_48; char *local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = -1; puStack_c = &LAB_00b0ec95; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; free_line_buffers(in_ECX); local_68 = *(int *)((int)in_ECX + 0x54); if (local_68 != *(int *)((int)in_ECX + 0x58)) { local_48 = (undefined4 *)(local_68 + 0x18); do { pbVar5 = (byte *)local_48[-5]; iVar4 = strncmp((char *)pbVar5,"##GAME##",8); if (iVar4 == 0) { pbVar5 = pbVar5 + 8; stringTable = &g_manager->_stringTable; LAB_009c288d: pbVar5 = string_table_translate(stringTable,pbVar5); } else { iVar4 = strncmp((char *)pbVar5,"##PLATFORM##",0xc); if (iVar4 == 0) { pbVar5 = pbVar5 + 0xc; stringTable = &g_manager->_stringTablePc; goto LAB_009c288d; } } local_54 = (int *)0x0; local_50 = (int *)0x0; local_4c = 0; local_8 = 0; if (local_48[-4] == -1) { text_wrap_lines(&local_54); } else { local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; pbVar8 = pbVar5; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); std::string::assign(local_2c._buf,pbVar5,(int)pbVar8 - (int)(pbVar5 + 1)); local_8._0_1_ = 1; vector_string_emplace_reallocate_move(&local_54,(std_string *)0x0,&local_2c); local_8 = (uint)local_8._1_3_ << 8; if (0xf < local_2c._capacity) { uVar12 = local_2c._capacity + 1; pvVar9 = (void *)local_2c._buf._0_4_; if (0xfff < uVar12) { pvVar9 = *(void **)(local_2c._buf._0_4_ + -4); uVar12 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)pvVar9))) goto LAB_009c2c9c; } operator_delete(pvVar9,uVar12); } } piVar3 = local_54; local_60 = 0; uVar12 = ((int)local_50 - (int)local_54) / 0x18; if (uVar12 != 0) { piVar6 = local_54; do { piVar14 = piVar6; if (0xf < (uint)piVar6[5]) { piVar14 = (int *)*piVar6; } if (piVar14 == (int *)0x0) { _Dest = (char *)0x0; } else { piVar10 = piVar14; do { iVar4 = *piVar10; piVar10 = (int *)((int)piVar10 + 1); } while ((char)iVar4 != '\0'); _Dest = operator_new_tracked((uint)((int)piVar10 + (1 - ((int)piVar14 + 1)))); piVar10 = piVar14; do { iVar4 = *piVar10; piVar10 = (int *)((int)piVar10 + 1); } while ((char)iVar4 != '\0'); strncpy(_Dest,(char *)piVar14,(size_t)((int)piVar10 + (1 - ((int)piVar14 + 1)))); } local_38 = local_48[-3]; local_40 = local_48[-5]; local_3c = local_48[-4]; local_34 = local_48[-2]; local_30 = local_48[-1]; local_2c._buf._0_4_ = *local_48; local_2c._buf._4_4_ = local_48[1]; local_2c._buf._12_4_ = local_48[3]; local_2c._size = local_48[4]; local_2c._buf._8_4_ = local_48[2]; local_2c._capacity = local_48[5]; puVar13 = *(undefined4 **)((int)in_ECX + 100); local_44 = _Dest; if (puVar13 == *(undefined4 **)((int)in_ECX + 0x68)) { std::vector<48byte>::_Emplace_reallocate(puVar13,&local_44); } else { *puVar13 = _Dest; puVar13[3] = local_38; puVar13[8] = local_2c._buf._8_4_; puVar13[4] = local_34; puVar13[5] = local_30; puVar13[6] = local_2c._buf._0_4_; puVar13[7] = local_2c._buf._4_4_; puVar13[1] = local_40; puVar13[2] = local_3c; puVar13[9] = local_2c._buf._12_4_; puVar13[10] = local_2c._size; puVar13[0xb] = local_2c._capacity; *(int *)((int)in_ECX + 100) = *(int *)((int)in_ECX + 100) + 0x30; } piVar6 = piVar6 + 6; local_60 = local_60 + 1; } while (local_60 < uVar12); } local_8 = -1; if (piVar3 != (int *)0x0) { piVar6 = local_50; piVar14 = piVar3; if (piVar3 != local_50) { do { uVar12 = piVar14[5]; if (0xf < uVar12) { pvVar9 = (void *)*piVar14; size = uVar12 + 1; ptr = pvVar9; if (0xfff < size) { ptr = *(void **)((int)pvVar9 + -4); size = uVar12 + 0x24; if (0x1f < (uint)((int)pvVar9 + (-4 - (int)ptr))) goto LAB_009c2c9c; } operator_delete(ptr,size); piVar6 = local_50; } piVar14[4] = 0; piVar14[5] = 0xf; *(undefined1 *)piVar14 = 0; piVar14 = piVar14 + 6; } while (piVar14 != piVar6); } uVar12 = ((local_4c - (int)piVar3) / 0x18) * 0x18; piVar6 = piVar3; if (0xfff < uVar12) { piVar6 = (int *)piVar3[-1]; uVar12 = uVar12 + 0x23; if ((undefined1 *)0x1f < (undefined1 *)((int)piVar3 + (-4 - (int)piVar6))) { LAB_009c2c9c: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar6,uVar12); local_54 = (int *)0x0; local_50 = (int *)0x0; local_4c = 0; } local_68 = local_68 + 0x30; local_48 = local_48 + 0xc; } while (local_68 != *(int *)((int)in_ECX + 0x58)); } puVar19 = &DAT_bf800000; fVar17 = 0.0; puVar13 = *(undefined4 **)((int)in_ECX + 0x60); fVar15 = 0.0; puVar11 = *(undefined4 **)((int)in_ECX + 100); fVar18 = (float)*(ushort *)(*(int *)((int)in_ECX + 4) + 0x14) * *(float *)((int)in_ECX + 0x10); if (puVar13 != puVar11) { do { iVar4 = Font::get_string_width_n(*(Font **)((int)in_ECX + 4),(byte *)*puVar13,-1); if (fVar15 <= (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)])) { fVar15 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]); } puVar11 = *(undefined4 **)((int)in_ECX + 100); pfVar1 = (float *)(puVar13 + 10); puVar13 = puVar13 + 0xc; fVar17 = fVar17 + fVar18 + *pfVar1; } while (puVar13 != puVar11); } fVar15 = *(float *)((int)in_ECX + 8) + *(float *)((int)in_ECX + 8) + fVar15; fVar16 = *(float *)((int)in_ECX + 0xc); fVar17 = fVar16 * 1.65 + fVar17; if ((*(float *)((int)in_ECX + 0x1c) == (float)puVar19) || (*(float *)((int)in_ECX + 0x1c) < fVar15)) { *(float *)((int)in_ECX + 0x1c) = fVar15; } if ((*(float *)((int)in_ECX + 0x20) == (float)puVar19) || (*(float *)((int)in_ECX + 0x20) < fVar17)) { *(float *)((int)in_ECX + 0x20) = fVar17; } puVar13 = *(undefined4 **)((int)in_ECX + 0x60); if (puVar13 != puVar11) { fVar15 = 0.5; do { iVar7 = Font::get_string_width_n(*(Font **)((int)in_ECX + 4),(byte *)*puVar13,-1); iVar4 = puVar13[0xb]; if (iVar4 == 0) { fVar17 = *(float *)((int)in_ECX + 8); LAB_009c2cba: puVar13[9] = fVar17 + (float)puVar13[9]; } else { if (iVar4 == 1) { fVar17 = *(float *)((int)in_ECX + 0x1c) * fVar15 - (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) * fVar15; goto LAB_009c2cba; } if (iVar4 == 2) { fVar17 = (*(float *)((int)in_ECX + 0x1c) - *(float *)((int)in_ECX + 8)) - (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]); goto LAB_009c2cba; } } fVar17 = (float)puVar13[10]; puVar13[10] = fVar16 + fVar17; puVar13 = puVar13 + 0xc; fVar16 = fVar16 + fVar17 + fVar18; } while (puVar13 != *(undefined4 **)((int)in_ECX + 100)); } ExceptionList = local_10; return; } //@@ 009c2d00 Popup::free_line_buffers /* DB: ? thiscall: walks vector +0x60..+0x64 of 0x30-byte entries, frees each entry's tracked-heap buffer (word 0) and nulls it, then end = begin; Popup::destroy, PopupQueue::destructor/Update prototype: db/protos.zhl */ void __thiscall Popup::free_line_buffers(void *this) { int iVar1; uint uVar2; qword qVar3; void **ppvVar4; qword *pqVar5; int *piVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; piVar6 = *(int **)((int)this + 0x60); ppvVar4 = &local_10; if (piVar6 == *(int **)((int)this + 100)) { *(int **)((int)this + 100) = piVar6; return; } do { ExceptionList = ppvVar4; iVar1 = *piVar6; if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); *piVar6 = 0; } piVar6 = piVar6 + 0xc; ppvVar4 = ExceptionList; } while (piVar6 != *(int **)((int)this + 100)); *(undefined4 *)((int)this + 100) = *(undefined4 *)((int)this + 0x60); ExceptionList = local_10; return; } //@@ 009c2db0 std::vector<48byte>::push_back /* DB: copies 12 dwords to end (+4) and advances by 0x30, else FUN_009c2e30 reallocates; popup queue in Manager::update_controller_popups, Menu_Game::Update and the popup helpers 009c3b70/009c3c30 */ void std::vector<48byte>::push_back(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { _Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; puVar1[1] = param_1[1]; puVar1[2] = param_1[2]; puVar1[3] = param_1[3]; puVar1[4] = param_1[4]; puVar1[5] = param_1[5]; puVar1[6] = param_1[6]; puVar1[7] = param_1[7]; puVar1[8] = param_1[8]; uVar2 = param_1[10]; puVar1[9] = param_1[9]; puVar1[10] = uVar2; puVar1[0xb] = param_1[0xb]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x30; return; } //@@ 009c2e30 std::vector<48byte>::_Emplace_reallocate /* DB: growth/max 0x5555555 by /0x30; callers std::vector<48byte>::push_back, 009c27c0 Popup::build_lines undefined4 * std::vector<48byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { uint uVar1; int iVar2; undefined4 uVar3; void *pvVar4; int iVar5; void *pvVar6; int *in_ECX; uint uVar7; uint uVar8; undefined4 *puVar9; void *ptr; iVar2 = *in_ECX; iVar5 = (in_ECX[1] - *in_ECX) / 0x30; if (iVar5 == 0x5555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar5 + 1; uVar8 = (in_ECX[2] - *in_ECX) / 0x30; if (0x5555555 - (uVar8 >> 1) < uVar8) { uVar7 = 0x5555555; } else { uVar8 = (uVar8 >> 1) + uVar8; uVar7 = uVar1; if (uVar1 <= uVar8) { uVar7 = uVar8; } if (0x5555555 < uVar7) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar6 = _Allocate(uVar7 * 0x30); puVar9 = (undefined4 *)(((param_1 - iVar2) / 0x30) * 0x30 + (int)pvVar6); *puVar9 = *param_2; puVar9[1] = param_2[1]; puVar9[2] = param_2[2]; puVar9[3] = param_2[3]; puVar9[4] = param_2[4]; puVar9[5] = param_2[5]; puVar9[6] = param_2[6]; puVar9[7] = param_2[7]; puVar9[8] = param_2[8]; uVar3 = param_2[10]; puVar9[9] = param_2[9]; puVar9[10] = uVar3; puVar9[0xb] = param_2[0xb]; if (param_1 == in_ECX[1]) { FUN_009c31a0(pvVar6,*in_ECX); } else { FUN_009c2fe0(*in_ECX,param_1,pvVar6); FUN_009c2fe0(param_1,in_ECX[1],puVar9 + 0xc); } pvVar4 = (void *)*in_ECX; if (pvVar4 != (void *)0x0) { uVar8 = ((in_ECX[2] - (int)pvVar4) / 0x30) * 0x30; ptr = pvVar4; if (0xfff < uVar8) { ptr = *(void **)((int)pvVar4 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar8); } *in_ECX = (int)pvVar6; in_ECX[1] = (int)(uVar1 * 0x30 + (int)pvVar6); in_ECX[2] = (int)(uVar7 * 0x30 + (int)pvVar6); return puVar9; } //@@ 009c2fe0 FUN_009c2fe0 undefined4 * FUN_009c2fe0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 *puVar3; undefined4 *puVar4; undefined4 *puVar5; puVar5 = param_3; if (param_1 != param_2) { puVar3 = param_1 + 6; puVar4 = param_3 + 7; do { *puVar5 = puVar3[-6]; puVar5 = puVar5 + 0xc; puVar4[-6] = puVar3[-5]; puVar4[-5] = puVar3[-4]; puVar4[-4] = puVar3[-3]; puVar4[-3] = puVar3[-2]; puVar4[-2] = puVar3[-1]; *(undefined4 *)((int)param_3 + (-0x30 - (int)param_1) + (int)(puVar3 + 0xc)) = *puVar3; *puVar4 = puVar3[1]; puVar4[1] = puVar3[2]; uVar2 = puVar3[3]; puVar4[3] = puVar3[4]; puVar4[2] = uVar2; puVar4[4] = puVar3[5]; puVar1 = puVar3 + 6; puVar3 = puVar3 + 0xc; puVar4 = puVar4 + 0xc; } while (puVar1 != param_2); } return puVar5; } //@@ 009c3070 FUN_009c3070 void FUN_009c3070(int param_1,int param_2) { uint uVar1; uint count; void *ptr; undefined4 uVar2; undefined4 *in_ECX; uint uVar3; uVar1 = (param_2 - param_1) / 0x30; ptr = (void *)*in_ECX; if (uVar1 <= (uint)((in_ECX[1] - (int)ptr) / 0x30)) { FUN_009c3230(ptr); in_ECX[1] = (void *)(uVar1 * 0x30 + (int)ptr); return; } count = (in_ECX[2] - (int)ptr) / 0x30; if (count < uVar1) { if (0x5555555 < uVar1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } if (0x5555555 - (count >> 1) < count) { uVar3 = 0x5555555; } else { uVar3 = (count >> 1) + count; if (uVar3 < uVar1) { uVar3 = uVar1; } } if (ptr != (void *)0x0) { deallocate(ptr,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x5555555 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } ptr = std::_Allocate(uVar3 * 0x30); *in_ECX = ptr; in_ECX[1] = ptr; in_ECX[2] = (void *)(uVar3 * 0x30 + (int)ptr); } FUN_009c3230(ptr); uVar2 = FUN_009c31a0(in_ECX[1]); in_ECX[1] = uVar2; return; } //@@ 009c31a0 FUN_009c31a0 undefined4 * FUN_009c31a0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar3; undefined4 *puVar4; undefined4 *puVar5; puVar5 = param_1; if (in_ECX != in_EDX) { puVar3 = in_ECX + 6; puVar4 = param_1 + 7; do { *puVar5 = puVar3[-6]; puVar5 = puVar5 + 0xc; puVar4[-6] = puVar3[-5]; puVar4[-5] = puVar3[-4]; puVar4[-4] = puVar3[-3]; puVar4[-3] = puVar3[-2]; puVar4[-2] = puVar3[-1]; *(undefined4 *)((int)param_1 + (-0x30 - (int)in_ECX) + (int)(puVar3 + 0xc)) = *puVar3; *puVar4 = puVar3[1]; puVar4[1] = puVar3[2]; uVar2 = puVar3[3]; puVar4[3] = puVar3[4]; puVar4[2] = uVar2; puVar4[4] = puVar3[5]; puVar1 = puVar3 + 6; puVar3 = puVar3 + 0xc; puVar4 = puVar4 + 0xc; } while (puVar1 != in_EDX); } return puVar5; } //@@ 009c3230 FUN_009c3230 undefined4 * FUN_009c3230(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; if (in_ECX == in_EDX) { return param_1; } puVar5 = in_ECX + 1; do { *param_1 = puVar5[-1]; param_1[1] = *puVar5; param_1[2] = puVar5[1]; param_1[3] = puVar5[2]; uVar2 = puVar5[4]; uVar3 = puVar5[5]; uVar4 = puVar5[6]; param_1[4] = puVar5[3]; param_1[5] = uVar2; param_1[6] = uVar3; param_1[7] = uVar4; param_1[8] = puVar5[7]; param_1[9] = puVar5[8]; param_1[10] = puVar5[9]; param_1[0xb] = puVar5[10]; puVar1 = puVar5 + 0xb; param_1 = param_1 + 0xc; puVar5 = puVar5 + 0xc; } while (puVar1 != in_EDX); return param_1; } //@@ 009c3290 PopupQueue::destructor /* DB: Manager::destructor: deletes every 0x148-byte popup in the std::list at +0 (under the mutex at +8), frees nodes, destroys KAGE::Mutex (DeleteCriticalSection +0x10) */ void PopupQueue::destructor(void) { void *ptr; int iVar1; LPCRITICAL_SECTION lpCriticalSection; char cVar2; undefined4 *in_ECX; int *piVar3; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(in_ECX[2] + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); iVar4 = in_ECX[1]; while (iVar4 != 0) { piVar3 = (int *)*in_ECX; ptr = *(void **)(*piVar3 + 8); if (ptr != (void *)0x0) { Popup::free_line_buffers((void *)((int)ptr + 0x24)); *(undefined4 *)((int)ptr + 0xa0) = 0; *(undefined4 *)((int)ptr + 0xa4) = 0; *(undefined4 *)((int)ptr + 0x98) = 0; *(undefined4 *)((int)ptr + 0x9c) = 0; *(undefined4 *)((int)ptr + 0x90) = 0; *(undefined4 *)((int)ptr + 0x94) = 0; FID_conflict__Tidy((void *)((int)ptr + 0x84)); FID_conflict__Tidy((void *)((int)ptr + 0x78)); local_8 = 0; if (((*(int **)((int)ptr + 0x20) != (int *)0x0) && (cVar2 = (**(code **)(**(int **)((int)ptr + 0x20) + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)ptr + 0x1c); } local_8 = 0xffffffff; operator_delete(ptr,0x148); *(undefined4 *)(*(int *)*in_ECX + 8) = 0; piVar3 = (int *)*in_ECX; iVar4 = in_ECX[1]; } piVar3 = (int *)*piVar3; iVar1 = *piVar3; in_ECX[1] = iVar4 + -1; *(int *)piVar3[1] = iVar1; *(int *)(iVar1 + 4) = piVar3[1]; operator_delete(piVar3,0xc); iVar4 = in_ECX[1]; } piVar3 = in_ECX + 2; (**(code **)(*piVar3 + 0x10))(); (**(code **)(*piVar3 + 8))(); lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[4]; *piVar3 = (int)KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[4] = 0; } *(byte *)(in_ECX + 3) = *(byte *)(in_ECX + 3) & 0xfe; *piVar3 = (int)KAGE::MutexBase::vftable; FUN_00498f80(); ExceptionList = local_10; return; } //@@ 009c3410 Popup::destroy /* DB: same body as the per-popup delete inlined in PopupQueue::destructor 009c3290 PopupQueue::destructor clear +0x90..+0xa4, Tidy +0x78/+0x84, release image +0x1c/+0x20, operator_delete); Menu_Game::Update after unlinking a popup node */ void Popup::destroy(void) { char cVar1; uint uVar2; void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; free_line_buffers((void *)((int)in_ECX + 0x24)); *(undefined4 *)((int)in_ECX + 0xa0) = 0; *(undefined4 *)((int)in_ECX + 0xa4) = 0; *(undefined4 *)((int)in_ECX + 0x98) = 0; *(undefined4 *)((int)in_ECX + 0x9c) = 0; *(undefined4 *)((int)in_ECX + 0x90) = 0; *(undefined4 *)((int)in_ECX + 0x94) = 0; FID_conflict__Tidy((void *)((int)in_ECX + 0x84)); FID_conflict__Tidy((void *)((int)in_ECX + 0x78)); local_8 = 0; if (*(int **)((int)in_ECX + 0x20) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)in_ECX + 0x20) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)((int)in_ECX + 0x1c); } } operator_delete(in_ECX,0x148); ExceptionList = local_10; return; } //@@ 009c34f0 PopupQueue::Update /* DB: ECX = popup std::list + KAGE::Mutex at +8 (lock vfunc +0xc), copies the node list then processes each popup; once per frame from Manager::Update right after update_controller_popups */ void PopupQueue::Update(void) { uint *puVar1; undefined4 *puVar2; void *pvVar3; int *piVar4; char cVar5; undefined4 *puVar6; int *piVar7; int *in_ECX; int *piVar8; int *piVar9; void *local_44; int *local_40; int *local_3c; int **local_38; undefined4 local_34; int *local_30; void *local_2c; int *local_28; int local_24; int *local_20; int *local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ecf5; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX + 2; local_20 = in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); local_18 = (int *)*in_ECX; local_38 = &local_30; local_30 = (int *)0x0; local_2c = (void *)0x0; piVar9 = (int *)*local_18; local_44 = (void *)0x0; local_8 = 0; if (piVar9 == local_18) { piVar9 = local_3c; } else { local_8 = 1; local_34 = 0; local_40 = operator_new(0xc); local_40[2] = piVar9[2]; piVar9 = (int *)*piVar9; local_44 = (void *)0x1; local_3c = local_40; local_1c = local_40; if (piVar9 != local_18) { do { piVar8 = local_40; pvVar3 = local_44; local_34 = 0; local_40 = operator_new(0xc); local_44 = (void *)((int)pvVar3 + 1); local_40[2] = piVar9[2]; *piVar8 = (int)local_40; local_40[1] = (int)piVar8; piVar9 = (int *)*piVar9; } while (piVar9 != local_18); } piVar9 = local_1c; } piVar8 = local_40; pvVar3 = local_44; local_38 = &local_30; local_8 = CONCAT31(local_8._1_3_,2); local_34 = 0; local_30 = operator_new(0xc); if (pvVar3 == (void *)0x0) { *local_30 = (int)local_30; local_30[1] = (int)local_30; } else { *local_30 = (int)piVar9; local_30[1] = (int)piVar8; piVar9[1] = (int)local_30; *piVar8 = (int)local_30; } local_8 = 3; local_28 = (int *)0x0; local_24 = 0; local_2c = pvVar3; local_28 = operator_new(0x18); piVar8 = local_14; *local_28 = (int)local_28; local_28[1] = (int)local_28; local_28[2] = (int)local_28; *(undefined2 *)(local_28 + 3) = 0x101; local_8 = CONCAT31(local_8._1_3_,4); (**(code **)(*local_14 + 0x10))(); local_1c = (void *)0x1; piVar9 = (int *)*local_30; if (piVar9 != local_30) { do { piVar8 = local_1c; cVar5 = Popup::Update(local_1c == local_2c); if (cVar5 != '\0') { puVar1 = (uint *)piVar9[2]; _Find_lower_bound<>(&local_44,puVar1); piVar4 = local_28; if ((*(char *)((int)local_3c + 0xd) != '\0') || (piVar7 = local_3c, *puVar1 < (uint)local_3c[4])) { if (local_24 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } local_38 = &local_28; local_8._0_1_ = 5; local_34 = 0; puVar6 = operator_new(0x18); local_8 = CONCAT31(local_8._1_3_,4); local_34 = 0; puVar6[4] = *puVar1; *(undefined1 *)(puVar6 + 5) = 0; *puVar6 = piVar4; puVar6[1] = piVar4; puVar6[2] = piVar4; *(undefined2 *)(puVar6 + 3) = 0; piVar7 = std::_Tree::_Insert_node(&local_28,local_44,(int)local_40,puVar6); piVar8 = local_1c; } *(undefined1 *)(piVar7 + 5) = 1; } piVar9 = (int *)*piVar9; local_1c = (int *)((int)piVar8 + 1); } while (piVar9 != local_30); piVar8 = local_14; } (**(code **)(*piVar8 + 0xc))(0xffffffff); piVar9 = *(int **)*local_20; if (piVar9 != (int *)*local_20) { do { puVar1 = (uint *)piVar9[2]; _Find_lower_bound<>(&local_44,puVar1); if (((*(char *)((int)local_3c + 0xd) == '\0') && ((uint)local_3c[4] <= *puVar1)) && (local_3c != local_28)) { Popup::free_line_buffers(puVar1 + 9); puVar1[0x28] = 0; puVar1[0x29] = 0; puVar1[0x26] = 0; puVar1[0x27] = 0; puVar1[0x24] = 0; puVar1[0x25] = 0; FID_conflict__Tidy(puVar1 + 0x21); FID_conflict__Tidy(puVar1 + 0x1e); local_8._0_1_ = 6; if ((((int *)puVar1[8] != (int *)0x0) && (cVar5 = (**(code **)(*(int *)puVar1[8] + 0xc))(), cVar5 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(puVar1 + 7); } local_8 = CONCAT31(local_8._1_3_,4); operator_delete(puVar1,0x148); piVar9[2] = 0; piVar8 = (int *)*piVar9; *(int **)piVar9[1] = piVar8; *(int *)(*piVar9 + 4) = piVar9[1]; local_20[1] = local_20[1] + -1; operator_delete(piVar9,0xc); } else { piVar8 = (int *)*piVar9; } piVar9 = piVar8; } while (piVar8 != (int *)*local_20); } (**(code **)(*local_14 + 0x10))(); FID_conflict__Erase_tree_>_> (&local_28,(fuzzer_allocator_> *)&local_28, (_Tree_node *)local_28[1]); operator_delete(local_28,0x18); *(undefined4 *)local_30[1] = 0; puVar6 = (undefined4 *)*local_30; while (puVar6 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar6; operator_delete(puVar6,0xc); puVar6 = puVar2; } operator_delete(local_30,0xc); ExceptionList = local_10; return; } //@@ 009c3890 FUN_009c3890 void FUN_009c3890(int param_1) { int *in_ECX; int *unaff_EBX; int *piVar1; int *piVar2; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); piVar2 = *(int **)*in_ECX; piVar1 = in_ECX + 2; if (piVar2 != (int *)*in_ECX) { do { if (*(int *)(piVar2[2] + 0x3c) == param_1) { popup_render(); } piVar2 = (int *)*piVar2; } while (piVar2 != (int *)*in_ECX); piVar1 = unaff_EBX; } (**(code **)(*piVar1 + 0x10))(); return; } //@@ 009c38e0 FUN_009c38e0 undefined1 FUN_009c38e0(int param_1) { int *piVar1; int *piVar2; int *in_ECX; undefined1 uVar3; uVar3 = 0; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); piVar1 = (int *)*in_ECX; piVar2 = (int *)*piVar1; if (piVar2 != piVar1) { while (*(int *)piVar2[2] != param_1) { piVar2 = (int *)*piVar2; if (piVar2 == piVar1) { (**(code **)(in_ECX[2] + 0x10))(); return 0; } } uVar3 = 1; } (**(code **)(in_ECX[2] + 0x10))(); return uVar3; } //@@ 009c3940 FUN_009c3940 undefined4 FUN_009c3940(int param_1) { undefined4 *puVar1; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); puVar1 = *(undefined4 **)*in_ECX; while( true ) { if (puVar1 == (undefined4 *)*in_ECX) { (**(code **)(in_ECX[2] + 0x10))(); return 0; } if (*(int *)puVar1[2] == param_1) break; puVar1 = (undefined4 *)*puVar1; } (**(code **)(in_ECX[2] + 0x10))(); return puVar1[2]; } //@@ 009c3990 FUN_009c3990 undefined1 FUN_009c3990(void) { int *piVar1; int *piVar2; int *in_ECX; undefined1 uVar3; uVar3 = 0; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); piVar1 = (int *)*in_ECX; piVar2 = (int *)*piVar1; if (piVar2 != piVar1) { while ((*(byte *)(piVar2[2] + 0x24) & 4) == 0) { piVar2 = (int *)*piVar2; if (piVar2 == piVar1) { (**(code **)(in_ECX[2] + 0x10))(); return 0; } } uVar3 = 1; } (**(code **)(in_ECX[2] + 0x10))(); return uVar3; } //@@ 009c39e0 PopupQueue::push /* DB: ? ECX is a std::list of popups guarded by a mutex at this+8 (vfuncs +0xc lock/+0x10 unlock); copies desc (FUN_009c01d0), inserts sorted by priority (+0x14 vs node +0x38), returns id; preceded by desc init FUN_009c25e0, text lines FUN_009c2700, "##GAME###PROMPT_OK" button FUN_009c3c30 (online_lobby_join, Level::InitializeGenesisRoom, HUD::update_item_info) prototype: db/protos.zhl, confirmed by RET 4 */ int __thiscall PopupQueue::push(void *this,void *desc) { int *piVar1; int *piVar2; void *pvVar3; uint uVar4; void *pvVar5; int *piVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ed37; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pvVar5 = operator_new(0x148); pvVar3 = desc; local_8 = 0; if (pvVar5 == (void *)0x0) { desc = (void *)0x0; } else { desc = (void *)Popup::constructor(desc); } local_8 = 0xffffffff; (**(code **)(*(int *)((int)this + 8) + 0xc))(0xffffffff,uVar4); piVar1 = *(int **)this; if (piVar1 != (int *)*piVar1) { piVar6 = piVar1; do { piVar2 = (int *)piVar6[1]; if (*(uint *)((int)pvVar3 + 0x14) <= *(uint *)(piVar2[2] + 0x38)) goto LAB_009c3a7f; piVar6 = piVar2; } while (piVar2 != (int *)*piVar1); } piVar6 = (int *)*piVar1; LAB_009c3a7f: FUN_009c3e60(piVar6,&desc); (**(code **)(*(int *)((int)this + 8) + 0x10))(); ExceptionList = local_10; return *(int *)desc; } //@@ 009c3ab0 PopupManager::close /* DB: ? ECX = Manager+0x4ae74 (the object FUN_009c25e0 opens popups on, e.g. NetplayManager::check_connection): under the mutex at +8 finds the popup whose id == *param_1; if state < 3 either stores the result (+0x18) or sets -0x1010102, calls its callback (+0xa0, userdata +0xa4) and FUN_009c1260(3) to finish; Manager::update_controller_popups closes popup id Manager+0x4abcc with -1 prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall PopupManager::close(void *this,int *popupId,int *result) { int *piVar1; int *piVar2; int *piVar3; int *this_00; longlong lVar4; if (*popupId != -1) { piVar1 = (int *)((int)this + 8); (**(code **)(*piVar1 + 0xc))(0xffffffff); this_00 = (int *)0x0; piVar2 = *(int **)this; piVar3 = (int *)*piVar2; if (piVar3 != piVar2) { while (this_00 = (int *)piVar3[2], *this_00 != *popupId) { piVar3 = (int *)*piVar3; if (piVar3 == piVar2) { (**(code **)(*piVar1 + 0x10))(); return; } } } (**(code **)(*piVar1 + 0x10))(); if ((this_00 != (int *)0x0) && (this_00[1] < 3)) { lVar4 = Popup::get_elapsed_ms(this_00); if (((int)((ulonglong)lVar4 >> 0x20) == 0) && ((uint)lVar4 < (uint)this_00[0x15])) { this_00[6] = *result; return; } this_00[6] = -0x1010102; if ((code *)this_00[0x28] != (code *)0x0) { (*(code *)this_00[0x28])(result,this_00[0x29]); } Popup::set_state(this_00,3); } } return; } //@@ 009c3b70 MessagePopup::add_blank_footer /* DB: twin of MessagePopup::add_ok_button: pushes the same grey spacer line (DAT_00c7b644) and then a text-less, button-less (id -1) 20.0f line via std::vector<48byte>::push_back; Manager::update_controller_popups for the controller-disconnected popup that has no OK button */ void MessagePopup::add_blank_footer(void) { undefined4 local_38 [2]; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; float local_14; float local_10; undefined4 local_c; local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_14 = g_vectorZero.x; local_38[0] = 0; local_30 = 0xffffffff; local_2c = 0xffffffff; local_18 = 0; local_10 = g_vectorZero.y; local_c = 1; std::vector<48byte>::push_back(local_38); local_38[0] = 0; local_30 = 0xffffffff; local_2c = 0xffffffff; local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_18 = 0; local_14 = 0.0; local_10 = 20.0; local_c = 1; std::vector<48byte>::push_back(local_38); return; } //@@ 009c3c30 MessagePopup::add_ok_button /* DB: ? EDX = popup: adds two entries via FUN_009c2db0 (a spacer and "##GAME###PROMPT_OK" with grey KColor 0x3e5cdcdd..), clears popup+0x84; Level::InitializeGenesisRoom, online_lobby_join prototype: db/protos.zhl */ void __fastcall MessagePopup::add_ok_button(byte *text,void *popupDesc) { undefined4 local_38; byte *local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; float local_14; float local_10; undefined4 local_c; local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_14 = g_vectorZero.x; local_38 = 0; local_30 = 0xffffffff; local_2c = 0xffffffff; local_18 = 0; local_10 = g_vectorZero.y; local_c = 1; local_34 = text; std::vector<48byte>::push_back(&local_38); local_38 = 0; local_34 = (byte *)0xb7ed98; local_30 = 0; local_2c = 0xffffffff; local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_18 = 0; local_14 = 0.0; local_10 = 35.0; local_c = 1; std::vector<48byte>::push_back(&local_38); *(undefined4 *)((int)popupDesc + 0x84) = 0; return; } //@@ 009c3d10 MessagePopup::add_yes_no_buttons /* DB: ? same builder as 009c3c30: adds a spacer then "##GAME###PROMPT_YES" (id 1) and "##GAME###PROMPT_NO" (id 2) via FUN_009c2db0; MenuManager::Update, Menu_OnlineLobby::update_controls prototype: db/protos.zhl */ void __fastcall MessagePopup::add_yes_no_buttons(byte *message,void *popup) { undefined4 local_38; byte *local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; float local_14; float local_10; undefined4 local_c; local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_14 = g_vectorZero.x; local_38 = 0; local_30 = 0xffffffff; local_2c = 0xffffffff; local_18 = 0; local_10 = g_vectorZero.y; local_c = 1; local_34 = message; std::vector<48byte>::push_back(&local_38); local_38 = 0; local_34 = (byte *)0xb7edac; local_30 = 1; local_2c = 0xffffffff; local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_18 = 0; local_14 = 0.0; local_10 = 35.0; local_c = 1; std::vector<48byte>::push_back(&local_38); local_28 = 0x3e5cdcdd; uStack_24 = 0x3e2cacad; uStack_20 = 0x3e34b4b5; uStack_1c = 0x3f800000; local_38 = 0; local_14 = g_vectorZero.x; local_34 = (byte *)0xb7edc0; local_30 = 2; local_2c = 0xffffffff; local_18 = 0; local_10 = g_vectorZero.y; local_c = 1; std::vector<48byte>::push_back(&local_38); *(undefined4 *)((int)popup + 0x84) = 2; *(undefined4 *)((int)popup + 0x88) = 1; return; } //@@ 009c3e60 FUN_009c3e60 void FUN_009c3e60(int param_1,int *param_2) { undefined4 *puVar1; int *piVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ed6d; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(in_ECX + 4) == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar2 = operator_new(0xc); piVar2[2] = *param_2; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 1; puVar1 = *(undefined4 **)(param_1 + 4); *piVar2 = param_1; piVar2[1] = (int)puVar1; *(int **)(param_1 + 4) = piVar2; *puVar1 = piVar2; ExceptionList = local_10; return; } //@@ 009c3ef0 FUN_009c3ef0 void FUN_009c3ef0(void) { undefined4 *puVar1; undefined4 *ptr; int in_ECX; if (*(int *)(in_ECX + 4) != 0) { *(undefined4 *)(*(int *)(in_ECX + 0xc) + 4) = 0; **(undefined4 **)(in_ECX + 8) = 0; ptr = *(undefined4 **)(in_ECX + 0xc); while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; operator_delete(ptr,0xc); ptr = puVar1; } } return; } //@@ 009c3f30 MenuDialog::constructor /* DB: ? zeroes +0, constructs two ANM2 at +4 and +0x118, clears +0x22c..+0x248, allocates a std::map head at +0x244; only MenuManager::constructor and PauseScreen::constructor build one (popup/dialog widget near the PopupQueue code 009c0000-009c4000) */ void MenuDialog::constructor(void) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0edbc; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; ANM2::constructor((ANM2 *)(in_ECX + 1)); local_8 = 0; ANM2::constructor((ANM2 *)(in_ECX + 0x46)); in_ECX[0x8b] = 0; in_ECX[0x8c] = 0; in_ECX[0x8d] = 0; local_8 = CONCAT31(local_8._1_3_,2); in_ECX[0x8e] = 0; in_ECX[0x8f] = 0; in_ECX[0x90] = 0; in_ECX[0x91] = 0; in_ECX[0x92] = 0; pvVar1 = operator_new(0x20); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0x91] = pvVar1; in_ECX[0x93] = 0; in_ECX[0x98] = 0; ExceptionList = local_10; return; } //@@ 009c4020 MenuDialog::~MenuDialog /* DB: inverse of MenuDialog::constructor (009c3f30: ANM2 at +4 and +0x118, std::map head at +0x244): resets both ANM2s, erases the map (0x20-byte nodes), vector_UserProfile_destroy; called by PauseScreen::~PauseScreen and 008e7630 prototype: db/protos.zhl */ void __thiscall MenuDialog::~MenuDialog(void *this) { ANM2 *this_00; undefined4 *this_01; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1f50; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::Reset((ANM2 *)((int)this + 4)); this_00 = (ANM2 *)((int)this + 0x118); ANM2::Reset(this_00); this_01 = (undefined4 *)((int)this + 0x244); FID_conflict__Erase_tree_>_> (this_01,(fuzzer_allocator_> *)this_01, *(_Tree_node **)(*(int *)((int)this + 0x244) + 4)); operator_delete((void *)*this_01,0x20); vector_UserProfile_destroy((void *)((int)this + 0x22c)); local_8 = 0; ANM2::Reset(this_00); AnimationState::~AnimationState((AnimationState *)((int)this + 0x168)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x148)); std::string::_Tidy_deallocate((char *)((int)this + 0x130)); std::string::_Tidy_deallocate((char *)this_00); local_8 = 1; ANM2::Reset((ANM2 *)((int)this + 4)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x54)); AnimationState::~AnimationState((AnimationState *)((int)this + 0x34)); std::string::_Tidy_deallocate((char *)((int)this + 0x1c)); std::string::_Tidy_deallocate((char *)((int)this + 4)); ExceptionList = local_10; return; } //@@ 009c4100 InviteFriendsMenu::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ANM2::Load of gfx/ui/InviteWidget.anm2 (+4) and gfx/ui/main menu/InviteFriendsMenu.anm2 (+0x118), Appear/ArrowUp/ArrowDown/Cursor, "list too long"; called from PauseScreen::Update and 008ead10 Menu_OnlineLobby::update_controls void InviteFriendsMenu::load_graphics(void) { ANM2 *this; undefined4 *puVar1; undefined4 *puVar2; MenuManager *pMVar3; byte bVar4; byte *pbVar5; undefined4 uVar6; byte *pbVar7; int iVar8; undefined4 *puVar9; char *pcVar10; LayerState *pLVar11; undefined4 *in_ECX; char *pcVar12; int *piVar13; uint uVar14; int *piVar15; bool bVar16; undefined4 uVar17; double dVar18; int local_7c; int local_78; int *local_70; int *local_6c; undefined4 *local_68; int *local_64; int *local_60; int *local_5c; int **local_58; int *local_54; int *local_50; int *local_4c; int *local_48; int *local_44; byte local_3d; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0ee1d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_68 = in_ECX; ANM2::Reset((ANM2 *)(in_ECX + 1)); this = (ANM2 *)(in_ECX + 0x46); ANM2::Reset(this); local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; if (g_menuManager == (MenuManager *)0x0) { local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x18; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/InviteWidget.anm2",0x19); local_14 = 2; ANM2::Load((ANM2 *)(in_ECX + 1),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; pcVar12 = (char *)local_3c._buf._0_4_; if (0xfff < uVar14) { pcVar12 = *(char **)(local_3c._buf._0_4_ + -4); uVar14 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar14); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x20); local_3c._size = 0x18; local_3c._capacity = 0x1f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/InviteWidget.anm2",0x19); local_14 = 3; ANM2::Load(this,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; pcVar12 = (char *)local_3c._buf._0_4_; if (0xfff < uVar14) { pcVar12 = *(char **)(local_3c._buf._0_4_ + -4); uVar14 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar14); } in_ECX[0x93] = 0x3f400000; } else { local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x27; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/main menu/InviteFriendsMenu.anm2",0x28); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 1),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; pcVar12 = (char *)local_3c._buf._0_4_; if (0xfff < uVar14) { pcVar12 = *(char **)(local_3c._buf._0_4_ + -4); uVar14 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar14); } local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x27; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"gfx/ui/main menu/InviteFriendsMenu.anm2",0x28); local_14 = 1; ANM2::Load(this,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar14 = local_3c._capacity + 1; pcVar12 = (char *)local_3c._buf._0_4_; if (0xfff < uVar14) { pcVar12 = *(char **)(local_3c._buf._0_4_ + -4); uVar14 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)pcVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar12,uVar14); } } pbVar5 = (byte *)in_ECX[0x53]; if (pbVar5 == (byte *)0x0) { LAB_009c4468: bVar4 = ANM2::SetAnimation(this,(byte *)"Cursor",1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x52)); *(undefined1 *)(in_ECX + 0x57) = 1; } } else { if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } pcVar12 = "Cursor"; do { bVar4 = *pbVar5; bVar16 = bVar4 < (byte)*pcVar12; if (bVar4 != *pcVar12) { LAB_009c4450: uVar14 = -(uint)bVar16 | 1; goto LAB_009c4455; } if (bVar4 == 0) break; bVar4 = pbVar5[1]; bVar16 = bVar4 < (byte)pcVar12[1]; if (bVar4 != pcVar12[1]) goto LAB_009c4450; pbVar5 = pbVar5 + 2; pcVar12 = pcVar12 + 2; } while (bVar4 != 0); uVar14 = 0; LAB_009c4455: if ((uVar14 != 0) || ((*(char *)(in_ECX[0x53] + 0x34) != '\0' && (*(char *)(in_ECX + 0x57) == '\0')))) goto LAB_009c4468; } pMVar3 = g_menuManager; in_ECX[0x94] = 8; if (pMVar3 == (MenuManager *)0x0) { uVar6 = 0x41400000; } else { uVar6 = 0x41800000; } in_ECX[0x95] = uVar6; uVar6 = 0x40800000; if (pMVar3 == (MenuManager *)0x0) { uVar17 = 0x40400000; } else { uVar17 = uVar6; } in_ECX[0x96] = uVar17; if (pMVar3 == (MenuManager *)0x0) { uVar6 = 0x40000000; } in_ECX[0x97] = uVar6; uVar6 = 0x60; in_ECX[0x98] = 0x41c00000; *in_ECX = 1; if (pMVar3 != (MenuManager *)0x0) { uVar6 = 0xa4; } in_ECX[0x99] = uVar6; pbVar5 = (byte *)in_ECX[0xe]; if (pbVar5 == (byte *)0x0) { LAB_009c455f: bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 1),(byte *)"Appear",1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0xd)); *(undefined1 *)(in_ECX + 0x12) = 1; } } else { pbVar7 = pbVar5; if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar7 = *(byte **)pbVar5; } pcVar12 = "Appear"; do { bVar4 = *pbVar7; bVar16 = bVar4 < (byte)*pcVar12; if (bVar4 != *pcVar12) { LAB_009c4544: uVar14 = -(uint)bVar16 | 1; goto LAB_009c4549; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar16 = bVar4 < (byte)pcVar12[1]; if (bVar4 != pcVar12[1]) goto LAB_009c4544; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar4 != 0); uVar14 = 0; LAB_009c4549: if ((uVar14 != 0) || ((pbVar5[0x34] != 0 && (*(char *)(in_ECX + 0x12) == '\0')))) goto LAB_009c455f; } iVar8 = in_ECX[0x91]; in_ECX[0x8e] = 0; in_ECX[0x8f] = 0; in_ECX[0x90] = 0; FID_conflict__Erase_tree_>_> (in_ECX + 0x91,(fuzzer_allocator_> *)(in_ECX + 0x91) ,*(_Tree_node **)(iVar8 + 4)); *(int *)(iVar8 + 4) = iVar8; *(int *)iVar8 = iVar8; *(int *)(iVar8 + 8) = iVar8; in_ECX[0x92] = 0; steam_friends_get(&local_7c,1); local_14 = 4; local_4c = (int *)0x0; local_48 = (int *)0x0; local_60 = operator_new(0x10); *local_60 = (int)local_60; local_60[1] = (int)local_60; local_14._0_1_ = 5; uVar14 = 0; local_4c = local_60; if (local_78 - local_7c >> 3 != 0) { do { iVar8 = (**(code **)(*(int *)(local_7c + uVar14 * 8) + 8))(); piVar15 = local_4c; if (iVar8 != 0) { local_5c = (int *)local_7c; if (local_48 == (int *)0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_58 = &local_4c; local_14._0_1_ = 6; local_54 = (int *)0x0; puVar9 = operator_new(0x10); local_54 = (int *)0x0; puVar9[2] = KAGE::System::UserProfileBase::vftable; puVar9[3] = *(undefined4 *)((int)local_5c + 4 + uVar14 * 8); puVar9[2] = KAGE::System::UserProfile::vftable; local_48 = (int *)((int)local_48 + 1); puVar1 = (undefined4 *)piVar15[1]; *puVar9 = piVar15; puVar9[1] = puVar1; piVar15[1] = (int)puVar9; *puVar1 = puVar9; local_14._0_1_ = 5; } uVar14 = uVar14 + 1; } while (uVar14 < (uint)(local_78 - local_7c >> 3)); } local_5c = local_48; local_60 = local_4c; if ((local_48 != (int *)0x0) && (local_48 != (int *)0x1)) { local_6c = (int *)FUN_008e33c0(); local_70 = (int *)FUN_008e33c0(); piVar15 = local_6c; local_44 = (int *)*local_60; pcVar12 = (char *)(**(code **)(local_44[2] + 4))(); pcVar10 = (char *)(**(code **)(piVar15[2] + 4))(); iVar8 = _stricmp(pcVar10,pcVar12); local_50 = piVar15; if (iVar8 < 0) { local_5c = piVar15; } else { local_5c = local_44; do { local_44 = (int *)*local_44; if (local_44 == piVar15) goto LAB_009c480b; pcVar12 = (char *)(**(code **)(local_44[2] + 4))(); pcVar10 = (char *)(**(code **)(piVar15[2] + 4))(); iVar8 = _stricmp(pcVar10,pcVar12); } while (-1 < iVar8); } do { local_54 = local_44 + 2; piVar15 = local_50; local_64 = local_50; do { piVar15 = (int *)*piVar15; local_50 = piVar15; if (piVar15 == local_70) break; pcVar12 = (char *)(**(code **)(*local_54 + 4))(); pcVar10 = (char *)(**(code **)(piVar15[2] + 4))(); iVar8 = _stricmp(pcVar10,pcVar12); } while (iVar8 < 0); puVar1 = (undefined4 *)local_64[1]; *puVar1 = piVar15; puVar9 = (undefined4 *)piVar15[1]; *puVar9 = local_44; puVar2 = (undefined4 *)local_44[1]; *puVar2 = local_64; local_44[1] = (int)puVar9; piVar15[1] = (int)puVar1; local_64[1] = (int)puVar2; if (piVar15 == local_70) goto LAB_009c480b; do { local_44 = (int *)*local_44; if (local_44 == piVar15) goto LAB_009c480b; pcVar12 = (char *)(**(code **)(local_44[2] + 4))(); pcVar10 = (char *)(**(code **)(piVar15[2] + 4))(); iVar8 = _stricmp(pcVar10,pcVar12); piVar15 = local_50; } while (-1 < iVar8); } while( true ); } LAB_009c4819: local_50 = local_68 + 0x8b; puVar1 = (undefined4 *)local_68[0x8c]; puVar9 = (undefined4 *)*local_50; local_14._0_1_ = 8; local_54 = puVar1; if (puVar9 != puVar1) { do { (**(code **)*puVar9)(); puVar9 = puVar9 + 2; } while (puVar9 != puVar1); puVar9 = (undefined4 *)*local_50; } local_14 = CONCAT31(local_14._1_3_,5); local_50[1] = (int)puVar9; if ((int *)(local_50[2] - *local_50 >> 3) < local_48) { if ((int *)0x1fffffff < local_48) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_009c5810(); puVar9 = (undefined4 *)local_50[1]; } piVar15 = (int *)*local_4c; piVar13 = local_50; if (piVar15 != local_4c) { do { puVar9 = local_68; puVar1 = (undefined4 *)local_68[0x8c]; if (puVar1 == (undefined4 *)local_68[0x8d]) { std::vector::_Emplace_reallocate(puVar1,piVar15 + 2); puVar9 = (undefined4 *)puVar9[0x8c]; piVar13 = local_50; } else { *puVar1 = KAGE::System::UserProfileBase::vftable; puVar1[1] = piVar15[3]; *puVar1 = KAGE::System::UserProfile::vftable; piVar13[1] = piVar13[1] + 8; puVar9 = (undefined4 *)piVar13[1]; } piVar15 = (int *)*piVar15; } while (piVar15 != local_4c); } local_54 = (int *)((float)((double)((int)puVar9 - *piVar13 >> 3) + __uint_to_double_fixup[-((int)puVar9 - *piVar13 >> 0x1f)]) / (float)((double)(int)local_68[0x94] + __uint_to_double_fixup[-((int)local_68[0x94] >> 0x1f)])); dVar18 = ceil((double)(float)local_54); local_54 = (int *)(float)dVar18; local_3d = 1 < (int)dVar18; pLVar11 = ANM2::GetLayer((ANM2 *)(local_68 + 1),(byte *)"ArrowUp"); pLVar11->_visible = local_3d; local_54 = (int *)((float)((double)((int)(local_68[0x8c] - local_68[0x8b]) >> 3) + __uint_to_double_fixup [-((int)(local_68[0x8c] - local_68[0x8b]) >> 0x1f)]) / (float)((double)(int)local_68[0x94] + __uint_to_double_fixup[-((int)local_68[0x94] >> 0x1f)])); dVar18 = ceil((double)(float)local_54); local_54 = (int *)(float)dVar18; local_3d = 1 < (int)dVar18; pLVar11 = ANM2::GetLayer((ANM2 *)(local_68 + 1),(byte *)"ArrowDown"); pLVar11->_visible = local_3d; *(undefined4 *)local_4c[1] = 0; puVar1 = (undefined4 *)*local_4c; while (puVar1 != (undefined4 *)0x0) { puVar9 = (undefined4 *)*puVar1; local_14._0_1_ = 9; (**(code **)puVar1[2])(); operator_delete(puVar1,0x10); puVar1 = puVar9; } local_14._0_1_ = 4; operator_delete(local_4c,0x10); vector_UserProfile_destroy(&local_7c); ExceptionList = local_1c; return; LAB_009c480b: *local_60 = (int)local_5c; goto LAB_009c4819; } //@@ 009c4a50 online_chat_window_update /* DB: ? state machine at +0 with Appear/Disappear anims, key polling, shares helpers 008e24c0/008fd7a0 map_u64_bool_subscript online_chat_update; called from online update 008e8240 Menu_OnlineLobby::Update pause menu 009b5d20 PauseScreen::Update void online_chat_window_update(void) { int *piVar1; Manager *pMVar2; float fVar3; byte bVar4; char cVar5; uint uVar6; byte *pbVar7; byte *pbVar8; int iVar9; void *pvVar10; uint uVar11; int iVar12; int *in_ECX; char *pcVar13; byte *pbVar14; int iVar15; int iVar16; bool bVar17; float fVar18; double dVar19; undefined1 local_40 [12]; undefined8 local_34; int local_2c; float local_28; int local_24; uint local_20; int local_1c; float local_18; char local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ee6e; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_40 + 0x3c); ExceptionList = &local_10; local_20 = 0; if (*(char *)((int)in_ECX + 0x10d) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0xd)); AnimationState::Update((AnimationState *)(in_ECX + 0x15)); } if (*(char *)((int)in_ECX + 0x221) != '\0') { AnimationState::Update((AnimationState *)(in_ECX + 0x52)); AnimationState::Update((AnimationState *)(in_ECX + 0x5a)); } iVar12 = *in_ECX; if (iVar12 == 1) { if ((in_ECX[0xe] != 0) && ((char)in_ECX[0x12] == '\0')) { pbVar7 = (byte *)in_ECX[0xe]; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar13 = "Appear"; do { bVar4 = *pbVar7; bVar17 = bVar4 < (byte)*pcVar13; if (bVar4 != *pcVar13) { LAB_009c5150: uVar6 = -(uint)bVar17 | 1; goto LAB_009c5155; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar17 = bVar4 < (byte)pcVar13[1]; if (bVar4 != pcVar13[1]) goto LAB_009c5150; pbVar7 = pbVar7 + 2; pcVar13 = pcVar13 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_009c5155: if (uVar6 == 0) { *in_ECX = 2; ANM2::Play((ANM2 *)(in_ECX + 1),s_Idle,0); } } goto LAB_009c5170; } if (iVar12 == 2) { if (g_menuManager == (MenuManager *)0x0) { local_1c = FUN_009b5800(uVar6); } else { local_1c = g_menuControllerIndex; } iVar12 = local_1c; local_24 = 0x16; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(local_1c,FUN_00a20940,&local_24,0,0); if (cVar5 == '\0') { local_2c = 0x17; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar12,FUN_00a20940,&local_2c,0,0); if (cVar5 == '\0') { in_ECX[0x90] = 0; } else { iVar16 = in_ECX[0x90]; if ((iVar16 == 0) || ((0x31 < iVar16 && (iVar16 % 10 == 0)))) { iVar16 = in_ECX[0x94]; local_24 = in_ECX[0x8f] + 1; in_ECX[0x8f] = local_24; local_1c = in_ECX[0x8c] - in_ECX[0x8b] >> 3; local_34._4_4_ = (float)((double)iVar16 + __uint_to_double_fixup[-(iVar16 >> 0x1f)]); local_28 = (float)((double)local_1c + __uint_to_double_fixup[-(in_ECX[0x8c] - in_ECX[0x8b] >> 0x1f)]) / local_34._4_4_; dVar19 = ceil((double)local_28); local_28 = (float)dVar19; if ((int)dVar19 == 1) { iVar9 = local_1c; } else { iVar9 = iVar16; if ((in_ECX[0x8e] == (int)dVar19 + -1) && (iVar9 = local_1c % iVar16, local_1c % iVar16 == 0)) { iVar9 = iVar16; } } if (local_24 < iVar9) { iVar16 = in_ECX[0x8b]; } else { in_ECX[0x8e] = in_ECX[0x8e] + 1; in_ECX[0x8f] = 0; iVar16 = in_ECX[0x8b]; local_34._4_4_ = (float)((double)(in_ECX[0x8c] - iVar16 >> 3) + __uint_to_double_fixup[-(in_ECX[0x8c] - iVar16 >> 0x1f)]) / local_34._4_4_; dVar19 = ceil((double)local_34._4_4_); local_34._4_4_ = (float)dVar19; iVar9 = in_ECX[0x8e]; if ((int)dVar19 <= iVar9) { iVar9 = 0; } in_ECX[0x8e] = iVar9; } pMVar2 = g_manager; if (1 < (uint)(in_ECX[0x8c] - iVar16 >> 3)) { local_1c = 0x11a; seed_fart_sound_override(&local_1c); SoundEffects::Play(&pMVar2->_sfxManager,local_1c,1.0,2,0,1.0,0.0); } } in_ECX[0x90] = in_ECX[0x90] + 1; } } else { iVar12 = in_ECX[0x90]; if ((iVar12 == 0) || ((0x31 < iVar12 && (iVar12 % 10 == 0)))) { piVar1 = in_ECX + 0x8f; *piVar1 = *piVar1 + -1; if (*piVar1 < 0) { iVar16 = in_ECX[0x94]; in_ECX[0x8f] = in_ECX[0x8f] + iVar16; piVar1 = in_ECX + 0x8e; *piVar1 = *piVar1 + -1; if (*piVar1 < 0) { iVar9 = in_ECX[0x8b]; iVar15 = in_ECX[0x8c] - iVar9; local_28 = (float)((double)iVar16 + __uint_to_double_fixup[-(iVar16 >> 0x1f)]); local_18 = (float)((double)(iVar15 >> 3) + __uint_to_double_fixup[-(iVar15 >> 0x1f)]) / local_28; dVar19 = ceil((double)local_18); local_2c = (int)dVar19 + -1; in_ECX[0x8e] = local_2c; iVar9 = in_ECX[0x8c] - iVar9; local_18 = (float)(iVar9 >> 3); local_28 = (float)((double)(int)local_18 + __uint_to_double_fixup[-(iVar9 >> 0x1f)]) / local_28; dVar19 = ceil((double)local_28); local_28 = (float)dVar19; if ((int)dVar19 == 1) { fVar18 = local_18; } else { fVar18 = (float)in_ECX[0x94]; if (local_2c == (int)dVar19 + -1) { fVar3 = (float)((int)local_18 % (int)fVar18); if ((float)((int)local_18 % (int)fVar18) == 0.0) { fVar3 = fVar18; } fVar18 = fVar3; } } in_ECX[0x8f] = (int)fVar18 + -1; } } pMVar2 = g_manager; if (1 < (uint)(in_ECX[0x8c] - in_ECX[0x8b] >> 3)) { local_18 = 3.95166e-43; seed_fart_sound_override((int *)&local_18); SoundEffects::Play(&pMVar2->_sfxManager,(int)local_18,1.0,2,0,1.0,0.0); iVar12 = in_ECX[0x90]; } } in_ECX[0x90] = iVar12 + 1; iVar12 = local_1c; } local_34._4_4_ = 1.96182e-44; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar12,FUN_00a209e0,(int)&local_34 + 4,0,0); local_34 = CONCAT44(local_34._4_4_,(undefined4)local_34); if (cVar5 != '\0') { uVar6 = in_ECX[0x94] * in_ECX[0x8e] + in_ECX[0x8f]; local_34 = CONCAT44(local_34._4_4_,(undefined4)local_34); if (uVar6 < (uint)(in_ECX[0x8c] - in_ECX[0x8b] >> 3)) { local_34._4_4_ = (float)(in_ECX[0x8b] + uVar6 * 8); cVar5 = KAGE::Network::MultiplayerManager::invite_user_to_lobby(local_34._4_4_,0); if (cVar5 != '\0') { local_34 = FUN_00a23920(); pbVar7 = map_u64_bool_subscript(in_ECX + 0x91,&local_34); *pbVar7 = 1; } } } local_28 = 2.10195e-44; cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar12,FUN_00a209e0,&local_28,0,0); if (cVar5 == '\0') { pvVar10 = Multiplayer::get_lobby(&DAT_00c79a50,local_40); local_8 = 0; uVar6 = 1; piVar1 = *(int **)((int)pvVar10 + 4); local_20 = 1; if (piVar1 == (int *)0x0) { cVar5 = '\0'; } else { iVar12 = piVar1[5]; iVar16 = piVar1[4]; uVar11 = (**(code **)(*piVar1 + 0x1c))(); cVar5 = '\x01' - ((uint)(iVar12 - iVar16 >> 3) < uVar11); } if (cVar5 != '\0') goto LAB_009c5068; local_11 = '\0'; } else { uVar6 = local_20; LAB_009c5068: local_11 = '\x01'; } local_8 = 0xffffffff; if ((uVar6 & 1) != 0) { KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(local_40); } if (local_11 == '\0') goto LAB_009c5170; *in_ECX = 3; pbVar7 = (byte *)in_ECX[0xe]; if (pbVar7 == (byte *)0x0) { LAB_009c50d9: bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 1),(byte *)"Disappear",1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0xd)); *(undefined1 *)(in_ECX + 0x12) = 1; } } else { pbVar8 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar8 = *(byte **)pbVar7; } pcVar13 = "Disappear"; do { bVar4 = *pbVar8; bVar17 = bVar4 < (byte)*pcVar13; if (bVar4 != *pcVar13) { LAB_009c50c6: uVar6 = -(uint)bVar17 | 1; goto LAB_009c50cb; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar17 = bVar4 < (byte)pcVar13[1]; if (bVar4 != pcVar13[1]) goto LAB_009c50c6; pbVar8 = pbVar8 + 2; pcVar13 = pcVar13 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_009c50cb: if ((uVar6 != 0) || ((pbVar7[0x34] != 0 && ((char)in_ECX[0x12] == '\0')))) goto LAB_009c50d9; } if (g_menuManager == (MenuManager *)0x0) { PopupWindow::hide(&g_game->_pauseScreen); } LAB_009c5170: iVar12 = *in_ECX; if (iVar12 == 1) { LAB_009c517c: if ((float)in_ECX[0x93] < 0.75) { fVar18 = (float)in_ECX[0x93] + 0.05; if (0.75 <= fVar18) { fVar18 = 0.75; } goto LAB_009c51c2; } } else { LAB_009c5177: if (iVar12 == 2) goto LAB_009c517c; } if (iVar12 == 1) { ExceptionList = local_10; return; } if (iVar12 == 2) { ExceptionList = local_10; return; } } else { if (((iVar12 != 3) || (in_ECX[0xe] == 0)) || ((char)in_ECX[0x12] != '\0')) goto LAB_009c5170; pbVar7 = (byte *)in_ECX[0xe]; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar7 = *(byte **)pbVar7; } pcVar13 = "Disappear"; do { bVar4 = *pbVar7; bVar17 = bVar4 < (byte)*pcVar13; if (bVar4 != *pcVar13) { LAB_009c4b20: uVar6 = -(uint)bVar17 | 1; goto LAB_009c4b25; } if (bVar4 == 0) break; bVar4 = pbVar7[1]; bVar17 = bVar4 < (byte)pcVar13[1]; if (bVar4 != pcVar13[1]) goto LAB_009c4b20; pbVar7 = pbVar7 + 2; pcVar13 = pcVar13 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_009c4b25: if (uVar6 != 0) goto LAB_009c5170; *in_ECX = 0; pbVar7 = (byte *)in_ECX[0xe]; if (pbVar7 == (byte *)0x0) { LAB_009c4b84: bVar4 = ANM2::SetAnimation((ANM2 *)(in_ECX + 1),s_Idle,1); if (bVar4 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0xd)); *(undefined1 *)(in_ECX + 0x12) = 1; } goto LAB_009c5170; } pbVar8 = pbVar7; if (0xf < *(uint *)(pbVar7 + 0x14)) { pbVar8 = *(byte **)pbVar7; } pbVar14 = s_Idle; do { bVar4 = *pbVar8; bVar17 = bVar4 < *pbVar14; if (bVar4 != *pbVar14) { LAB_009c4b65: uVar6 = -(uint)bVar17 | 1; goto LAB_009c4b6a; } if (bVar4 == 0) break; bVar4 = pbVar8[1]; bVar17 = bVar4 < pbVar14[1]; if (bVar4 != pbVar14[1]) goto LAB_009c4b65; pbVar8 = pbVar8 + 2; pbVar14 = pbVar14 + 2; } while (bVar4 != 0); uVar6 = 0; LAB_009c4b6a: if (uVar6 != 0) goto LAB_009c4b84; iVar12 = *in_ECX; if (pbVar7[0x34] != 0) { if ((char)in_ECX[0x12] == '\0') goto LAB_009c4b84; goto LAB_009c5177; } } if ((float)in_ECX[0x93] <= 0.0) { ExceptionList = local_10; return; } fVar18 = (float)in_ECX[0x93] - 0.05; if (fVar18 <= 0.0) { fVar18 = 0.0; } LAB_009c51c2: in_ECX[0x93] = (int)fVar18; ExceptionList = local_10; return; } //@@ 009c51e0 InviteFriendsMenu::Render /* DB: strings FriendList, Status, #Online/NO_ONLINE_FRIENDS; gated on state *this != 0, uses this+0x24c like the InviteFriendsMenu/MenuDialog layout (ANM2 +4/+0x118); called last in Menu_OnlineLobby::Render 008e8af0 Menu_OnlineLobby::Render void InviteFriendsMenu::Render(void) { Font *this; char cVar1; byte *pbVar2; undefined4 uVar3; int *other; KColor *color; int *in_ECX; float *pfVar4; AnimationState *pAVar5; undefined4 uVar6; KColor *color_00; int iVar7; int extraout_EDX; int iVar8; float *pfVar9; float fVar10; uint uVar11; uint uVar12; undefined1 local_194 [112]; undefined1 local_124 [112]; undefined1 local_b4 [8]; KColor local_ac; KColor local_98; uint local_84; uint local_80; undefined8 local_7c; undefined4 local_70; undefined4 local_6c; KColor local_68; Font *local_54; KColor local_50; undefined8 local_3c; uint local_30; Vector local_2c; float local_24; float local_20; float local_1c; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0eeb0; local_10 = ExceptionList; ExceptionList = &local_10; if (*in_ECX != 0) { local_50._alpha = (float)in_ECX[0x93]; local_50._unk = 0; local_50._red = 0.0; local_50._green = 0.0; local_50._blue = 0.0; render_quad_set_uniform_color(local_124,0.0,0.0,g_screenWidth,g_screenHeight,&local_50); render_color_shader_pass(local_124); if (g_menuManager == (MenuManager *)0x0) { local_18.x = g_screenWidth - 79.0; local_18.y = g_screenHeight - 96.0; } else { local_18.x = g_screenWidth * 0.5; local_18.y = g_screenHeight * 0.5; } if (*(char *)((int)in_ECX + 0x10d) != '\0') { local_20 = local_18.x; local_1c = local_18.y; if ((char)in_ECX[0x1d] == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0xd),&local_18,&g_vectorZero,&g_vectorZero); pAVar5 = (AnimationState *)(in_ECX + 0x15); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x15),&local_18,&g_vectorZero,&g_vectorZero); pAVar5 = (AnimationState *)(in_ECX + 0xd); } AnimationState::Render(pAVar5,&local_18,&g_vectorZero,&g_vectorZero); } local_20 = local_18.x; local_1c = local_18.y; if (in_ECX[0xe] == 0) { pfVar9 = (float *)0x0; pfVar4 = (float *)0x0; } else { pfVar9 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0xd),(byte *)"Status"); if (in_ECX[0xe] == 0) { pfVar4 = (float *)0x0; } else { pfVar4 = AnimationState::GetNullFrame((AnimationState *)(in_ECX + 0xd),(byte *)"FriendList") ; } } if (((*in_ECX == 2) && (pfVar9 != (float *)0x0)) && (pfVar4 != (float *)0x0)) { if ((uint)(in_ECX[0x8c] - in_ECX[0x8b]) < 8) { this = &g_manager->_font2_TeamMeatEx12; FUN_00a1a580(1); local_8 = 0; local_50._red = 0.21176471; local_50._green = 0.18431373; local_50._blue = 0.1764706; local_50._alpha = 1.0; local_2c.x = local_20 + *pfVar9; local_50._unk = 0; local_2c.y = local_1c + pfVar9[1]; pbVar2 = string_table_translate ((StringTable *)(extraout_EDX + 0x4a920), (byte *)"#Online/NO_ONLINE_FRIENDS"); Font::DrawString(this,pbVar2,&local_2c,(Vector *)(pfVar9 + 4),&local_50,local_b4); ExceptionList = local_10; return; } local_18.x = local_20 + *pfVar4; local_1c = local_1c + pfVar4[1]; iVar7 = in_ECX[0x94]; fVar10 = (float)(in_ECX[0x8e] * iVar7); local_20 = fVar10; local_18.y = local_1c; KColor::SetFromARGB(&local_ac,0xff362f2d); local_98._unk = 0; local_30 = 0; local_98._red = 0.4745098; local_98._green = 0.0; local_98._blue = 0.0; local_98._alpha = 1.0; if (iVar7 != 0) { do { if ((uint)(in_ECX[0x8c] - in_ECX[0x8b] >> 3) <= (uint)fVar10) { ExceptionList = local_10; return; } if ((local_30 == in_ECX[0x8f]) && (*(char *)((int)in_ECX + 0x221) != '\0')) { if ((char)in_ECX[0x62] == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x52),&local_18,&g_vectorZero,&g_vectorZero); pAVar5 = (AnimationState *)(in_ECX + 0x5a); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x5a),&local_18,&g_vectorZero,&g_vectorZero); pAVar5 = (AnimationState *)(in_ECX + 0x52); } AnimationState::Render(pAVar5,&local_18,&g_vectorZero,&g_vectorZero); local_1c = local_18.y; fVar10 = local_20; } local_24 = local_18.x + (float)in_ECX[0x98]; local_54 = &g_manager->_font1_TeamMeatEx10; iVar7 = *(int *)(in_ECX[0x8b] + 4 + (int)fVar10 * 8); if (iVar7 == 0) { local_3c = 0; local_3c._4_4_ = (byte *)0x0; local_3c._0_4_ = 0; uVar3 = local_3c._4_4_; uVar6 = (undefined4)local_3c; } else { uVar3 = *(undefined4 *)(iVar7 + 0xc); uVar6 = *(undefined4 *)(iVar7 + 8); } pbVar2 = user_profile_format_display_name(CONCAT44(uVar3,uVar6),local_54,in_ECX[0x99]); local_3c = CONCAT44(pbVar2,(undefined4)local_3c); KColor::SetFromARGB(&local_68,0xffffffff); render_quad_set_uniform_color (local_194,local_24,local_1c,local_24 + (float)in_ECX[0x95], (float)in_ECX[0x95] + local_1c,color_00); iVar7 = *(int *)(in_ECX[0x8b] + 4 + (int)fVar10 * 8); if ((iVar7 == 0) || (other = (int *)(iVar7 + 0x14), *other == 0)) { other = (int *)&DAT_00c799d8; } KAGE::SmartPointer::operator_assign(&local_2c,other); local_8 = 1; (**(code **)(*(int *)local_2c.x + 0x1c))(local_194,g_drawRectUnset); local_8 = 2; if ((((int *)local_2c.y != (int *)0x0) && (cVar1 = (**(code **)(*(int *)local_2c.y + 0xc))(), cVar1 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_2c); } local_70 = 0; local_6c = 0xffff; local_68._red = 0.0; local_68._green = 1.0; local_24 = (float)in_ECX[0x95] + (float)in_ECX[0x97] + local_24; local_68._blue = -NAN; local_68._alpha = 0.0; local_68._unk = 0; local_8 = 3; iVar7 = *(int *)(in_ECX[0x8b] + 4 + (int)fVar10 * 8); if (iVar7 == 0) { local_7c = 0; local_7c._4_4_ = 0; local_7c._0_4_ = 0; uVar11 = (uint)local_7c; uVar12 = local_7c._4_4_; } else { uVar11 = *(uint *)(iVar7 + 8); uVar12 = *(uint *)(iVar7 + 0xc); } local_84 = uVar11; local_80 = uVar12; local_18.x = local_24; FUN_00731ee0(&local_50._blue,&local_84); if (((*(char *)(local_50._unk + 0xd) == '\0') && (*(uint *)(local_50._unk + 0x14) <= uVar12)) && ((*(uint *)(local_50._unk + 0x14) < uVar12 || (*(uint *)(local_50._unk + 0x10) <= uVar11)))) { iVar7 = local_50._unk; iVar8 = in_ECX[0x91]; } else { iVar7 = in_ECX[0x91]; iVar8 = iVar7; } color = &local_ac; if (iVar7 != iVar8) { color = &local_98; } Font::DrawStringScaled(local_54,local_3c._4_4_,&local_18,color,&local_70); local_30 = local_30 + 1; local_8 = 0xffffffff; fVar10 = (float)((int)local_20 + 1); local_1c = local_1c + (float)in_ECX[0x95] + (float)in_ECX[0x96]; local_18.x = (local_24 - ((float)in_ECX[0x95] + (float)in_ECX[0x97])) - (float)in_ECX[0x98]; local_20 = fVar10; local_18.y = local_1c; } while (local_30 < (uint)in_ECX[0x94]); } } } ExceptionList = local_10; return; } //@@ 009c5780 std::list::destructor /* DB: ? only an unwind funclet: walks 0x10-byte list nodes, calls the inline element's vfunc 0 (8-byte polymorphic element at node+8, like UserProfile), frees nodes then the 0x10 head */ void std::list::destructor(void) { undefined4 *puVar1; undefined4 *puVar2; uint uVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; puStack_c = &LAB_00af1360; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; local_8 = 0; (**(code **)puVar1[2])(0,uVar3); operator_delete(puVar1,0x10); puVar1 = puVar2; } local_8 = 0xffffffff; operator_delete((void *)*in_ECX,0x10); ExceptionList = local_10; return; } //@@ 009c5810 FUN_009c5810 void FUN_009c5810(uint param_1) { int iVar1; int iVar2; void *pvVar3; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar3 = std::_Allocate(param_1 * 8); FUN_009c5920(*in_ECX,in_ECX[1],pvVar3); FUN_009c5860(pvVar3,iVar1 - iVar2 >> 3,param_1); return; } //@@ 009c5860 FUN_009c5860 void FUN_009c5860(int param_1,int param_2,int param_3) { uint uVar1; int *in_ECX; undefined4 *puVar2; undefined4 *puVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = (undefined4 *)*in_ECX; if (puVar2 != (undefined4 *)0x0) { puVar3 = (undefined4 *)in_ECX[1]; local_8 = 0; if (puVar2 != puVar3) { do { (**(code **)*puVar2)(0,uVar1); puVar2 = puVar2 + 2; } while (puVar2 != puVar3); puVar2 = (undefined4 *)*in_ECX; } uVar1 = in_ECX[2] - (int)puVar2 & 0xfffffff8; puVar3 = puVar2; if (0xfff < uVar1) { puVar3 = (undefined4 *)puVar2[-1]; uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)puVar2 + (-4 - (int)puVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar3,uVar1); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 8; in_ECX[2] = param_1 + param_3 * 8; ExceptionList = local_10; return; } //@@ 009c5920 FUN_009c5920 void FUN_009c5920(int param_1,int param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 *puVar2; if (param_1 == param_2) { return; } puVar2 = param_3; do { *puVar2 = KAGE::System::UserProfileBase::vftable; puVar1 = puVar2 + 2; puVar2[1] = *(undefined4 *)((param_1 - (int)param_3) + -4 + (int)puVar1); *puVar2 = KAGE::System::UserProfile::vftable; puVar2 = puVar1; } while ((param_1 - (int)param_3) + (int)puVar1 != param_2); return; } //@@ 009c59a0 std::vector::_Emplace_reallocate /* DB: 8-byte elements: constructs KAGE::System::UserProfileBase/UserProfile vftable + impl copy at the insert slot, moves halves (009c5920/009c5a80), max 0x1fffffff; InviteFriendsMenu::load_graphics and Lobby::get_members call it when end == capacity */ undefined4 * std::vector::_Emplace_reallocate(int param_1,int param_2) { uint uVar1; undefined4 *puVar2; int iVar3; int iVar4; void *pvVar5; int *in_ECX; uint uVar6; int iVar7; uint uVar8; iVar3 = *in_ECX; iVar7 = param_1 - iVar3 >> 3; iVar4 = in_ECX[1] - iVar3 >> 3; if (iVar4 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar4 + 1; uVar6 = in_ECX[2] - iVar3 >> 3; if (0x1fffffff - (uVar6 >> 1) < uVar6) { uVar8 = 0x1fffffff; } else { uVar6 = (uVar6 >> 1) + uVar6; uVar8 = uVar1; if (uVar1 <= uVar6) { uVar8 = uVar6; } if (0x1fffffff < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(uVar8 * 8); *(undefined ***)((int)pvVar5 + iVar7 * 8) = KAGE::System::UserProfileBase::vftable; puVar2 = (undefined4 *)((int)pvVar5 + iVar7 * 8); puVar2[1] = *(undefined4 *)(param_2 + 4); *puVar2 = KAGE::System::UserProfile::vftable; if (param_1 == in_ECX[1]) { FUN_009c5920(*in_ECX,in_ECX[1],pvVar5); } else { FUN_009c5a80(*in_ECX,param_1,pvVar5); FUN_009c5a80(param_1,in_ECX[1],puVar2 + 2); } FUN_009c5860(pvVar5,uVar1,uVar8); return puVar2; } //@@ 009c5a80 FUN_009c5a80 void FUN_009c5a80(int param_1,int param_2,undefined4 *param_3) { if (param_1 == param_2) { return; } param_1 = param_1 - (int)param_3; do { *param_3 = KAGE::System::UserProfileBase::vftable; param_3[1] = *(undefined4 *)(param_1 + 4 + (int)param_3); *param_3 = KAGE::System::UserProfile::vftable; param_3 = param_3 + 2; } while (param_1 + (int)param_3 != param_2); return; } //@@ 009c5b00 daily_lobby_join_destructor /* DB: ? ECX = NetplayManager+0x18d8 (NetplayManager::destructor 00906a90 NetplayManager::~NetplayManager ECX,[EDI+0x18d8]): releases ConstLobby +0x254/+0x25c, destroys ANM2s at +0x140 and +0xc */ void daily_lobby_join_destructor(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afb440; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)(in_ECX + 0x254) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)(in_ECX + 0x25c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x25c) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 600); } } local_8 = 1; ANM2::Reset((ANM2 *)(in_ECX + 0x140)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 400)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x170)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x158)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x140)); local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0xc)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5c)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x3c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x24)); std::string::_Tidy_deallocate((char *)(in_ECX + 0xc)); ExceptionList = local_10; return; } //@@ 009c5bf0 daily_lobby_join_init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX = NetplayManager+0x18d8 (lea ecx,[esi+0x18d8] in NetplayManager::Init), same object as daily_lobby_join_destructor 009c5b00 daily_lobby_join_destructor daily_lobby_join_reset 009c5df0: clears state +0/+4, empty ConstLobby, ANM2::Load "resources/gfx/ui/LoadingSpinner.anm2" into +0x140 */ void daily_lobby_join_init(void) { byte *pbVar1; char cVar2; byte bVar3; uint uVar4; byte *pbVar5; undefined4 *in_ECX; char *ptr; byte *pbVar6; bool bVar7; undefined8 local_50; undefined **local_48; undefined1 local_44 [4]; int *local_40; std_string local_3c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_44 + 0x40; local_14 = 0xffffffff; puStack_18 = &LAB_00b0eee5; local_1c = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_44 + 0x34); ExceptionList = &local_1c; *in_ECX = 0; in_ECX[1] = 0; local_50 = 0; local_24 = uVar4; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_50); local_14 = 0; std::shared_ptr::assign(in_ECX + 0x96,local_44); local_48 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_14 = 1; if (((local_40 != (int *)0x0) && (cVar2 = (**(code **)(*local_40 + 0xc))(uVar4), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_44); } local_14 = 0xffffffff; FUN_008370f0(); local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; local_3c._buf[1] = '\0'; local_3c._buf[2] = '\0'; local_3c._buf[3] = '\0'; local_3c._buf._0_4_ = std::_Allocate(0x30); local_3c._size = 0x24; local_3c._capacity = 0x2f; builtin_strncpy((char *)local_3c._buf._0_4_,"resources/gfx/ui/LoadingSpinner.anm2",0x25); local_14 = 2; ANM2::Load((ANM2 *)(in_ECX + 0x50),&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar4 = local_3c._capacity + 1; ptr = (char *)local_3c._buf._0_4_; if (0xfff < uVar4) { ptr = *(char **)(local_3c._buf._0_4_ + -4); uVar4 = local_3c._capacity + 0x24; if ((char *)0x1f < (char *)(local_3c._buf._0_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } pbVar1 = (byte *)in_ECX[0x5d]; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (pbVar1 != (byte *)0x0) { pbVar5 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar5 = *(byte **)pbVar1; } pbVar6 = s_Idle; do { bVar3 = *pbVar5; bVar7 = bVar3 < *pbVar6; if (bVar3 != *pbVar6) { LAB_009c5da0: uVar4 = -(uint)bVar7 | 1; goto LAB_009c5da5; } if (bVar3 == 0) break; bVar3 = pbVar5[1]; bVar7 = bVar3 < pbVar6[1]; if (bVar3 != pbVar6[1]) goto LAB_009c5da0; pbVar5 = pbVar5 + 2; pbVar6 = pbVar6 + 2; } while (bVar3 != 0); uVar4 = 0; LAB_009c5da5: if (uVar4 == 0) { if (pbVar1[0x34] == 0) { ExceptionList = local_1c; return; } if (*(char *)(in_ECX + 0x61) != '\0') { ExceptionList = local_1c; return; } } } bVar3 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x50),s_Idle,1); if (bVar3 != 0) { AnimationState::Rewind((AnimationState *)(in_ECX + 0x5c)); *(undefined1 *)(in_ECX + 0x61) = 1; } ExceptionList = local_1c; return; } //@@ 009c5df0 daily_lobby_join_reset /* DB: ? ECX = NetplayManager+0x18d8: if its ANM2 (+0xc) is showing (+0x40/+0x50), clears state +0/+4, replaces the lobby shared_ptr at +0x258 with an empty one (g_lobbyReleaseFn) and plays Dissapear (FUN_00837590); NetplayManager::Update before each LOBBY_JOIN_DAILY_* error popup and on input cancel */ void daily_lobby_join_reset(void) { char cVar1; uint uVar2; undefined4 *in_ECX; undefined1 local_24 [4]; int *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ef1d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; if ((in_ECX[0x10] != 0) && (*(char *)(in_ECX + 0x14) != '\0')) { in_ECX[1] = 0; *in_ECX = 0; local_1c = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_1c); local_8 = 0; std::shared_ptr::assign(in_ECX + 0x96,local_24); local_8 = 1; if (local_20 != (int *)0x0) { cVar1 = (**(code **)(*local_20 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_24); } } local_8 = 0xffffffff; FUN_00837590(); } ExceptionList = local_10; return; } //@@ 009c5eb0 daily_lobby_join_show_error /* DB: ? ECX = NetplayManager+0x18d8 (NetplayManager::Update); first resets it (009c5df0), then FontDrawParams on Manager+0x4ae74 + MessagePopup::add_ok_button + PopupQueue::push with the translated #Online/LOBBY_JOIN_DAILY_DENIED/FAILED/IN_PROGRESS text NetplayManager::Update passes for state 2/5/3 */ void daily_lobby_join_show_error(byte *param_1) { undefined1 local_c8 [84]; undefined1 local_74 [12]; undefined1 local_68 [12]; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; Vector local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ef50; local_10 = ExceptionList; ExceptionList = &local_10; daily_lobby_join_reset(__security_cookie ^ (uint)(local_68 + 100)); local_1c.x = (float)&DAT_bf800000; local_1c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_c8,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_1c); local_8 = 0; MessagePopup::add_ok_button(param_1,local_c8); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_c8); local_4c = 0; local_48 = 0; local_54 = 0; local_50 = 0; local_5c = 0; local_58 = 0; FID_conflict__Tidy(local_68); FID_conflict__Tidy(local_74); ExceptionList = local_10; return; } //@@ 009c5f90 FUN_009c5f90 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_009c5f90(int param_1) { byte bVar1; byte *name; code *callback; undefined4 *in_ECX; void *ptr; uint size; void *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af6ebd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; name = leaderboard_name_format(local_2c,(g_manager->_dailyChallenge)._id,(int)in_ECX,param_1); local_8 = (void *)0x0; if (0xf < *(uint *)(name + 0x14)) { name = *(byte **)name; } callback = FUN_009c6070; if (param_1 == 2) { callback = FUN_009c60a0; } bVar1 = leaderboard_find_async(name,0,callback,in_ECX); if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } if (bVar1 == 0) { *in_ECX = 5; } ExceptionList = local_10; return; } //@@ 009c6070 FUN_009c6070 void FUN_009c6070(undefined4 *param_1,int *param_2) { if (*param_2 == 1) { if (param_1 == (undefined4 *)0x0) { *param_2 = 5; return; } FUN_00a51c60(*param_1,FUN_009c60e0,param_2); } return; } //@@ 009c60a0 FUN_009c60a0 void FUN_009c60a0(undefined4 *param_1,int *param_2) { if (*param_2 == 1) { if (param_1 == (undefined4 *)0x0) { *param_2 = 5; return; } *(undefined4 *)&g_menuManager->field_0xe640 = *param_1; FUN_00a51c60(*param_1,FUN_009c6110,param_2); } return; } //@@ 009c60e0 FUN_009c60e0 void FUN_009c60e0(int param_1,int *param_2) { if (*param_2 == 1) { if (*(int *)(param_1 + 8) != 0) { *param_2 = 2; return; } FUN_009c5f90(2); } return; } //@@ 009c6110 FUN_009c6110 void FUN_009c6110(int param_1,int *param_2) { if (*param_2 == 1) { *param_2 = (-(uint)(*(int *)(param_1 + 8) != 0) & 0xfffffffe) + 4; } return; } //@@ 009c6130 GenericPopup::destructor /* DB: ? ECX = NetplayManager+0x1b38 (NetplayManager::destructor 00906a90 NetplayManager::~NetplayManager LEA ECX,[EDI+0x1b38]), the same object NetplayManager::Render 0090b900 NetplayManager::Render to GenericPopup::Render (ZHL exact); destroys ANM2 at +0 (Reset, anim states +0x30/+0x50), ConstLobby ref at +0x14c/+0x150 (g_lobbyReleaseFn), strings */ void GenericPopup::destructor(void) { int *piVar1; char cVar2; uint uVar3; ANM2 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; in_ECX[1]._animState._layerFrames = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; piVar1 = (int *)in_ECX[1]._animState._animFrame; if (piVar1 != (int *)0x0) { cVar2 = (**(code **)(*piVar1 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&in_ECX[1]._animState._nullLayerFrames); } } std::string::_Tidy_deallocate(in_ECX[1]._animDefaultName._buf + 8); local_8 = 1; ANM2::Reset(in_ECX); AnimationState::~AnimationState(&in_ECX->_overlayAnimState); AnimationState::~AnimationState(&in_ECX->_animState); std::string::_Tidy_deallocate((in_ECX->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)in_ECX); ExceptionList = local_10; return; } //@@ 009c61e0 LobbyPasswordPrompt::open /* DB: ? thiscall (.., lobby shared_ptr): unless already open, clears the password string (+0x134) and state (+0x144), stores the lobby, opens a text prompt titled "#Online/LOBBY_JOIN_PASS_CHECK"; called from the lobby-join handler 008e11b0 (misnamed Level::InitializeGenesisRoom, "lobby_password") and FUN_00912b60 */ void LobbyPasswordPrompt::open(undefined4 param_1,undefined1 param_2,int *param_3) { char cVar1; uint uVar2; byte *pbVar3; int in_ECX; undefined1 *puVar4; undefined4 uVar5; undefined4 uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ef7d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if ((*(int *)(in_ECX + 0x34) == 0) || (*(char *)(in_ECX + 0x44) == '\0')) { puVar4 = (undefined1 *)(in_ECX + 0x134); if (0xf < *(uint *)(in_ECX + 0x148)) { puVar4 = *(undefined1 **)(in_ECX + 0x134); } *(undefined4 *)(in_ECX + 0x144) = 0; *puVar4 = 0; uVar5 = 0x9c6249; std::shared_ptr::assign((void *)(in_ECX + 0x150),¶m_2); uVar6 = 0x9c6250; FUN_00837510(); pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_PASS_CHECK"); FUN_00837660(pbVar3,uVar5,uVar6); } local_8 = 1; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(¶m_2); } } ExceptionList = local_10; return; } //@@ 009c62c0 FUN_009c62c0 void FUN_009c62c0(void) { char cVar1; uint uVar2; undefined1 *puVar3; int in_ECX; undefined1 local_24 [4]; int *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0ef1d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; if ((*(int *)(in_ECX + 0x34) != 0) && (*(char *)(in_ECX + 0x44) != '\0')) { local_1c = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_1c); local_8 = 0; std::shared_ptr::assign((void *)(in_ECX + 0x150),local_24); local_8 = 1; if (local_20 != (int *)0x0) { cVar1 = (**(code **)(*local_20 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_24); } } local_8 = 0xffffffff; FUN_00837590(); puVar3 = (undefined1 *)(in_ECX + 0x134); if (0xf < *(uint *)(in_ECX + 0x148)) { puVar3 = *(undefined1 **)(in_ECX + 0x134); } *(undefined4 *)(in_ECX + 0x144) = 0; *puVar3 = 0; } ExceptionList = local_10; return; } //@@ 009c63a0 LobbyPasswordPrompt::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall (+0x34 prompt, +0x44 open): while the text prompt is open (FUN_00837210/FUN_00837610) reads the confirm action (0xe); in state 8 (+0x144) checks the entered password against the lobby (+0x14c): wrong -> sound 0xbb + "#Online/LOBBY_JOIN_PASS_WRONG_PASS" MessagePopup, right -> join (FUN_0090bf10); NetplayManager::Update */ void LobbyPasswordPrompt::Update(void) { void **lobby; Manager *pMVar1; char cVar2; uint uVar3; byte *text; ANM2 *in_ECX; undefined4 in_stack_fffffeac; undefined4 in_stack_fffffeb0; undefined4 uVar4; undefined1 local_124 [84]; undefined1 local_d0 [12]; undefined1 local_c4 [12]; undefined4 local_b8; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; undefined4 local_a8; undefined4 local_a4; Vector local_7c; undefined4 local_74; int local_70 [7]; char local_54 [24]; char local_3c [40]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0efb8; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_3c + 0x38); ExceptionList = &local_10; if (((in_ECX->_animState)._animData != (void *)0x0) && ((in_ECX->_animState)._isPlaying != 0)) { local_14 = uVar3; ANM2::update_appear_then_idle(in_ECX); cVar2 = FUN_00837610(uVar3); if (cVar2 != '\0') { handle_direction_input(); local_74 = 0xe; uVar4 = 0x9c6423; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_74,0,0); pMVar1 = g_manager; if (cVar2 != '\0') { if (in_ECX[1]._animState._animation == (void *)0x8) { lobby = &in_ECX[1]._animState._layerFrames; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(lobby); FUN_0085b160(in_stack_fffffeac,in_stack_fffffeb0,uVar4); local_8 = 0; cVar2 = FUN_0040c790(); if (cVar2 == '\0') { FUN_009c62c0(); pMVar1 = g_manager; local_70[0] = 0xbb; seed_fart_sound_override(local_70); SoundEffects::Play(&pMVar1->_sfxManager,local_70[0],1.0,2,0,1.0,0.0); text = string_table_translate (&g_manager->_stringTable,(byte *)"#Online/LOBBY_JOIN_PASS_WRONG_PASS") ; FUN_009c62c0(); local_7c.x = (float)&DAT_bf800000; local_7c.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_124,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_7c); local_8 = CONCAT31(local_8._1_3_,1); MessagePopup::add_ok_button(text,local_124); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_124); local_a8 = 0; local_a4 = 0; local_b0 = 0; local_ac = 0; local_b8 = 0; local_b4 = 0; FID_conflict__Tidy(local_c4); FID_conflict__Tidy(local_d0); } else { NetplayManager::join_pending_lobby(&g_manager->_netplayManager,lobby); FUN_009c62c0(); } local_8 = 0xffffffff; std::vector::_Tidy(); std::string::_Tidy_deallocate(local_3c); std::string::_Tidy_deallocate(local_54); } else { local_70[0] = 0xbb; seed_fart_sound_override(local_70); SoundEffects::Play(&pMVar1->_sfxManager,local_70[0],1.0,2,0,1.0,0.0); } } local_7c.y = 2.10195e-44; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_7c.y,0,0); if (cVar2 != '\0') { FUN_009c62c0(); } } } ExceptionList = local_10; return; } //@@ 009c6650 LobbyPasswordPrompt::handle_direction_input /* DB: ? ECX=LobbyPasswordPrompt: while the password (+0x144 length) is shorter than 8, polls W/A/S/D and arrow keys (0x106..0x109) through the input vtable slot 0x74 and appends the matching direction symbol; from LobbyPasswordPrompt::Update */ void LobbyPasswordPrompt::handle_direction_input(void) { char cVar1; int iVar2; int in_ECX; undefined4 *puVar3; byte *text; undefined4 local_8; if (*(uint *)(in_ECX + 0x144) < 8) { local_8 = 0x57; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x41; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x53; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x44; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x109; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x107; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x108; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') { local_8 = 0x106; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if (cVar1 == '\0') goto LAB_009c680c; text = &DAT_00b6312c; } else { text = &DAT_00b63160; } } else { text = &DAT_00b6315c; } } else { text = &DAT_00b75e80; } } else { text = &DAT_00b66140; } } else { text = &DAT_00b6614c; } } else { text = &DAT_00b656e8; } } else { text = &DAT_00b75e7c; } std::string::append((char *)(in_ECX + 0x134),text,1); } LAB_009c680c: local_8 = 0x103; cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_8,0,0); if ((cVar1 != '\0') && (*(int *)(in_ECX + 0x144) != 0)) { puVar3 = (undefined4 *)(in_ECX + 0x134); iVar2 = *(int *)(in_ECX + 0x144) + -1; if (0xf < *(uint *)(in_ECX + 0x148)) { puVar3 = (undefined4 *)*puVar3; } *(int *)(in_ECX + 0x144) = iVar2; *(undefined1 *)((int)puVar3 + iVar2) = 0; } return; } //@@ 009c6860 load_preloads_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: 'Could not find root node preloads in %s', preload nodes; Game::LoadConfigXmls */ undefined4 load_preloads_xml(byte *param_1) { int iVar1; qword qVar2; char cVar3; uint uVar4; int *piVar5; undefined4 uVar6; int iVar7; byte *text; void *pvVar8; byte *pbVar9; byte *pbVar10; void *pvVar11; qword *pqVar12; undefined4 *puVar13; bool bVar14; char *pcVar15; byte bVar16; int iStack_1009c; undefined1 auStack_10098 [48]; undefined1 auStack_10068 [65560]; void *local_50 [4]; undefined4 local_40; uint local_3c; undefined1 local_38 [4]; int *local_34; void *local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; undefined4 uStack_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0f023; local_10 = ExceptionList; uStack_14 = 0x9c687b; uVar4 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; local_18 = uVar4; piVar5 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar5 == (int *)0x0) { uVar6 = 0; } else { iVar7 = (**(code **)(*piVar5 + 4))(uVar4); text = operator_new_tracked(iVar7 + 1); (**(code **)(*piVar5 + 0x14))(text,1,iVar7); text[iVar7] = 0; (**(code **)*piVar5)(1); FUN_00413b90(); local_8 = (void *)0x0; pcVar15 = (char *)0x9c6911; pbVar10 = text; rapidxml::xml_document::parse(auStack_10098,text); bVar16 = (byte)pbVar10; pvVar8 = xml_node::first_node(auStack_10098,(byte *)"preloads",(int)pcVar15,bVar16); if (pvVar8 == (void *)0x0) { pcVar15 = "Could not find root node \'preloads\' in %s\n"; KAGE_LogMessage(0x10,(byte *)"Could not find root node \'preloads\' in %s\n"); bVar16 = (byte)param_1; } for (pvVar8 = xml_node::first_node(pvVar8,(byte *)"preload",(int)pcVar15,bVar16); pvVar8 != (void *)0x0; pvVar8 = *(void **)((int)pvVar8 + 0x2c)) { puVar13 = *(undefined4 **)((int)pvVar8 + 0x20); iVar7 = 0; iStack_1009c = 0; if (puVar13 != (undefined4 *)0x0) { do { pbVar10 = &g_xmlNullStr; if ((byte *)*puVar13 != (byte *)0x0) { pbVar10 = (byte *)*puVar13; } pbVar9 = s_id; do { bVar16 = *pbVar10; bVar14 = bVar16 < *pbVar9; if (bVar16 != *pbVar9) { LAB_009c69a4: uVar4 = -(uint)bVar14 | 1; goto LAB_009c69a9; } if (bVar16 == 0) break; bVar16 = pbVar10[1]; bVar14 = bVar16 < pbVar9[1]; if (bVar16 != pbVar9[1]) goto LAB_009c69a4; pbVar10 = pbVar10 + 2; pbVar9 = pbVar9 + 2; } while (bVar16 != 0); uVar4 = 0; LAB_009c69a9: if (uVar4 == 0) { local_20 = 0; pbVar10 = &g_xmlNullStr; if ((byte *)puVar13[1] != (byte *)0x0) { pbVar10 = (byte *)puVar13[1]; } local_1c = 0xf; local_30[0] = (void *)0x0; pbVar9 = pbVar10; do { bVar16 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar16 != 0); std::string::assign((char *)local_30,pbVar10,(int)pbVar9 - (int)(pbVar10 + 1)); local_8._0_1_ = 1; iVar7 = FUN_009c6e10(local_30); local_8 = (void *)((uint)local_8._1_3_ << 8); if (0xf < local_1c) { uVar4 = local_1c + 1; pvVar11 = local_30[0]; if (0xfff < uVar4) { pvVar11 = *(void **)((int)local_30[0] + -4); uVar4 = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar11))) { LAB_009c6c17: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar4); } local_20 = 0; local_1c = 0xf; local_30[0] = (void *)((uint)local_30[0] & 0xffffff00); iStack_1009c = iVar7; } } while ((puVar13[4] != 0) && (puVar13 = (undefined4 *)puVar13[6], puVar13 != (undefined4 *)0x0)); if (iVar7 != 0) { for (iVar1 = *(int *)((int)pvVar8 + 0x18); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x2c)) { for (puVar13 = *(undefined4 **)(iVar1 + 0x20); puVar13 != (undefined4 *)0x0; puVar13 = (undefined4 *)puVar13[6]) { pbVar10 = &g_xmlNullStr; if ((byte *)*puVar13 != (byte *)0x0) { pbVar10 = (byte *)*puVar13; } pbVar9 = &DAT_00b66e0c; do { bVar16 = *pbVar10; bVar14 = bVar16 < *pbVar9; if (bVar16 != *pbVar9) { LAB_009c6ad1: uVar4 = -(uint)bVar14 | 1; goto LAB_009c6ad6; } if (bVar16 == 0) break; bVar16 = pbVar10[1]; bVar14 = bVar16 < pbVar9[1]; if (bVar16 != pbVar9[1]) goto LAB_009c6ad1; pbVar10 = pbVar10 + 2; pbVar9 = pbVar9 + 2; } while (bVar16 != 0); uVar4 = 0; LAB_009c6ad6: if (uVar4 == 0) { local_40 = 0; pbVar10 = &g_xmlNullStr; if ((byte *)puVar13[1] != (byte *)0x0) { pbVar10 = (byte *)puVar13[1]; } local_3c = 0xf; local_50[0] = (void *)0x0; pbVar9 = pbVar10; do { bVar16 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar16 != 0); std::string::assign((char *)local_50,pbVar10,(int)pbVar9 - (int)(pbVar10 + 1)); local_8._0_1_ = 2; KAGE::SmartPointer::SmartPointer(local_38,(void *)0x0); local_8._0_1_ = 3; pcVar15 = *(char **)(iStack_1009c + 0x20); if (pcVar15 == *(char **)(iStack_1009c + 0x24)) { std::vector::_Emplace_reallocate(pcVar15,local_50); } else { std::string::string(pcVar15,local_50); local_8._0_1_ = 4; KAGE::SmartPointer::operator_assign(pcVar15 + 0x18,local_38); *(int *)(iVar7 + 0x20) = *(int *)(iVar7 + 0x20) + 0x20; } local_8._0_1_ = 5; if (((local_34 != (int *)0x0) && (cVar3 = (**(code **)(*local_34 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_38); } local_8 = (void *)((uint)local_8._1_3_ << 8); if (0xf < local_3c) { uVar4 = local_3c + 1; pvVar11 = local_50[0]; if (0xfff < uVar4) { pvVar11 = *(void **)((int)local_50[0] + -4); uVar4 = local_3c + 0x24; if (0x1f < (uint)((int)local_50[0] + (-4 - (int)pvVar11))) goto LAB_009c6c17; } operator_delete(pvVar11,uVar4); } iVar7 = iStack_1009c; } if (puVar13[4] == 0) break; } } } } } local_8 = (void *)0x6; xml_memory_pool::clear(auStack_10068); if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } if (text != (byte *)0x0) { uVar4 = *(uint *)(text + -4); qVar2 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar4; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar2 < uVar4); free(text + -4); } uVar6 = 1; } ExceptionList = local_10; return uVar6; } //@@ 009c6c90 PreloadManager::load_group /* DB: finds the preloads.xml group by name (FUN_0069d690 map find) and, if not yet loaded (+0x28), Manager::LoadImage + TextureCache::Add for every 0x20-byte {path, SmartPointer} entry of its vector at +0x44, then marks it loaded; Game::LoadConfigXmls loads "common"/"pickups"/"icons", PlayerManager::enter_level "player tears" */ void PreloadManager::load_group(byte *param_1) { int iVar1; int iVar2; char cVar3; byte *path; void *pvVar4; int *piVar5; int *in_ECX; byte *pbVar6; undefined1 auStackY_cc [128]; undefined1 local_2c [4]; int *local_28; undefined1 local_24 [4]; int *local_20; void *local_1c; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar2 = (int)param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b0f05d; local_10 = ExceptionList; ExceptionList = &local_10; std::map::find(); if ((param_1 != (byte *)*in_ECX) && (*(char *)((int)param_1 + 0x28) == '\0')) { pbVar6 = *(byte **)((int)param_1 + 0x44); if (pbVar6 != *(byte **)((int)param_1 + 0x48)) { param_1 = pbVar6 + 0x1c; do { path = pbVar6; if (0xf < *(uint *)(param_1 + -8)) { path = *(byte **)pbVar6; } pvVar4 = Manager::LoadImage(local_2c,path); local_8 = 0; piVar5 = KAGE::SmartPointer::operator_assign(local_24,pvVar4); iVar1 = piVar5[1]; piVar5[1] = *(int *)param_1; *(int *)param_1 = iVar1; iVar1 = *piVar5; *piVar5 = *(int *)(param_1 + -4); *(int *)(param_1 + -4) = iVar1; local_8 = CONCAT31(local_8._1_3_,1); if (local_20 != (int *)0x0) { cVar3 = (**(code **)(*local_20 + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_8 = 2; if (local_28 != (int *)0x0) { cVar3 = (**(code **)(*local_28 + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_8 = 0xffffffff; pvVar4 = (void *)0x0; piVar5 = (int *)0x0; local_18 = *(int **)param_1; local_1c = *(void **)(param_1 + -4); if (local_18 != (int *)0x0) { cVar3 = (**(code **)(*local_18 + 4))(); if (cVar3 != '\0') { if (piVar5 != (int *)0x0) { cVar3 = (**(code **)(*piVar5 + 0xc))(); if ((cVar3 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStackY_cc + 0x84); } } pvVar4 = local_1c; piVar5 = local_18; } } TextureCache::Add(pvVar4,piVar5); pbVar6 = pbVar6 + 0x20; param_1 = param_1 + 0x20; } while (pbVar6 != *(byte **)(iVar2 + 0x48)); } *(undefined1 *)(iVar2 + 0x28) = 1; } ExceptionList = local_10; return; } //@@ 009c6e10 FUN_009c6e10 int FUN_009c6e10(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::_Try_emplace(local_10,param_1); return *piVar1 + 0x28; } //@@ 009c6e30 std::map::_Try_emplace /* DB: MSVC _Tree try_emplace: std::map::_Find_lower_bound + string_compare, operator_new(0x50) node (max_size 0x3333333); operator[] wrapper 0x9c6e10 returns node+0x28, used by load_preloads_xml */ void std::map::_Try_emplace(undefined4 *param_1,byte *param_2) { int *piVar1; int iVar2; int iVar3; int iVar4; uint uVar5; byte *b; int iVar6; int *in_ECX; byte *a; int *piVar7; int *piVar8; int *local_38; int local_34; int *local_30; int *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0f08d; local_1c = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; string>::_Find_lower_bound(&local_38,param_2); if (*(char *)((int)local_30 + 0xd) == '\0') { b = (byte *)(local_30 + 4); if (0xf < (uint)local_30[9]) { b = *(byte **)b; } a = param_2; if (0xf < *(uint *)(param_2 + 0x14)) { a = *(byte **)param_2; } iVar6 = string_compare(a,*(uint *)(param_2 + 0x10),b,local_30[8]); if (-1 < iVar6) { *(undefined1 *)(param_1 + 1) = 0; goto LAB_009c7061; } } if (in_ECX[1] == 0x3333333) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar6 = *in_ECX; local_14 = 0; local_28 = (int *)0x0; local_24 = operator_new(0x50); local_24[4] = 0; local_24[8] = 0; local_24[9] = 0; iVar2 = *(int *)(param_2 + 4); iVar3 = *(int *)(param_2 + 8); iVar4 = *(int *)(param_2 + 0xc); local_24[4] = *(int *)param_2; local_24[5] = iVar2; local_24[6] = iVar3; local_24[7] = iVar4; *(undefined8 *)(local_24 + 8) = *(undefined8 *)(param_2 + 0x10); param_2[0x10] = 0; param_2[0x11] = 0; param_2[0x12] = 0; param_2[0x13] = 0; param_2[0x14] = 0xf; param_2[0x15] = 0; param_2[0x16] = 0; param_2[0x17] = 0; *param_2 = 0; *(undefined1 *)(local_24 + 10) = 0; local_24[0xb] = 0; local_24[0xf] = 0; local_24[0x10] = 0xf; local_24[0x11] = 0; local_24[0x12] = 0; local_24[0x13] = 0; *local_24 = iVar6; local_24[1] = iVar6; local_24[2] = iVar6; *(undefined2 *)(local_24 + 3) = 0; local_28 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; local_24[1] = (int)local_38; if (local_38 == local_28) { *local_28 = (int)local_24; local_28[1] = (int)local_24; local_28[2] = (int)local_24; *(undefined1 *)(local_24 + 3) = 1; } else { if (local_34 == 0) { local_38[2] = (int)local_24; if (local_38 == (int *)local_28[2]) { local_28[2] = (int)local_24; } } else { *local_38 = (int)local_24; if (local_38 == (int *)*local_28) { *local_28 = (int)local_24; } } piVar8 = local_24; if (*(char *)(local_24[1] + 0xc) == '\0') { do { piVar1 = (int *)piVar8[1]; piVar7 = *(int **)piVar1[1]; if (piVar1 == piVar7) { piVar7 = (int *)((undefined4 *)piVar1[1])[2]; if ((char)piVar7[3] == '\0') goto LAB_009c6ffa; if (piVar8 == (int *)piVar1[2]) { FUN_00415fe0(piVar1); piVar8 = piVar1; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } else if ((char)piVar7[3] == '\0') { LAB_009c6ffa: *(undefined1 *)(piVar1 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)*piVar1) { FUN_00415f80(piVar1); piVar8 = piVar1; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } } while (*(char *)(piVar8[1] + 0xc) == '\0'); } *(undefined1 *)(local_28[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; local_30 = local_24; LAB_009c7061: *param_1 = local_30; ExceptionList = local_1c; return; } //@@ 009c7080 std::vector::_Emplace_reallocate /* DB: ? 32-byte elements {std::string, KAGE::SmartPointer at +0x18}: 1.5x growth (Xlen 0x7ffffff), copy-constructs the new entry (string + SmartPointer::operator_assign), relocates (FUN_009c7280), destroys old (FUN_007091f0); load_preloads_xml adds a preload entry */ char * std::vector::_Emplace_reallocate(void *param_1,void *param_2) { uint uVar1; int iVar2; int iVar3; char *pcVar4; char *this; void *pvVar5; int *in_ECX; uint uVar6; char *pcVar7; char *extraout_ECX; char *this_00; void *pvVar8; uint local_24; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f0cd; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = in_ECX[1] - iVar2 >> 5; if (iVar3 == 0x7ffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar3 + 1; uVar6 = in_ECX[2] - iVar2 >> 5; if (0x7ffffff - (uVar6 >> 1) < uVar6) { local_24 = 0x7ffffff; } else { uVar6 = (uVar6 >> 1) + uVar6; local_24 = uVar1; if (uVar1 <= uVar6) { local_24 = uVar6; } if (0x7ffffff < local_24) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pcVar4 = _Allocate(local_24 << 5); this = pcVar4 + ((int)param_1 - iVar2 & 0xffffffe0); local_8 = 0; string::string(this,param_2); local_8._0_1_ = 1; KAGE::SmartPointer::operator_assign(this + 0x18,(void *)((int)param_2 + 0x18)); local_8._0_1_ = 0; pvVar8 = (void *)*in_ECX; pvVar5 = (void *)in_ECX[1]; if (param_1 == pvVar5) { pcVar7 = pcVar4; this_00 = pcVar4; for (; local_8._0_1_ = 2, pvVar8 != pvVar5; pvVar8 = (void *)((int)pvVar8 + 0x20)) { string::string(this_00,pvVar8); local_8._0_1_ = 3; KAGE::SmartPointer::operator_assign(this_00 + 0x18,(void *)((int)pvVar8 + 0x18)); this_00 = this_00 + 0x20; pcVar7 = extraout_ECX; } FUN_007091f0(pcVar7); } else { FUN_009c7280(pvVar8,param_1,pcVar4); FUN_009c7280(param_1,in_ECX[1],this + 0x20); } if (*in_ECX != 0) { FUN_007091f0(*in_ECX); pvVar8 = (void *)*in_ECX; uVar6 = in_ECX[2] - (int)pvVar8 & 0xffffffe0; pvVar5 = pvVar8; if (0xfff < uVar6) { pvVar5 = *(void **)((int)pvVar8 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar6); } *in_ECX = (int)pcVar4; in_ECX[1] = (int)(pcVar4 + uVar1 * 0x20); in_ECX[2] = (int)(pcVar4 + local_24 * 0x20); ExceptionList = local_10; return this; } //@@ 009c7256 Catch_All@009c7256 void Catch_All_009c7256(void) { int unaff_EBP; FUN_00708ff0(*(undefined4 *)(unaff_EBP + -0x1c),*(undefined4 *)(unaff_EBP + -0x28)); FUN_00571230(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009c7280 FUN_009c7280 char * FUN_009c7280(void *param_1,void *param_2,char *param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; puStack_c = &LAB_00b0f105; uVar2 = __security_cookie ^ (uint)(auStack_7 + 3); auStack_7 = (undefined1 [3])0x0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = (void *)((int)param_1 + 0x20)) { local_8 = 0; std::string::string(param_3,param_1); local_8 = 1; KAGE::SmartPointer::operator_assign(param_3 + 0x18,(void *)((int)param_1 + 0x18)); param_3 = param_3 + 0x20; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } local_8 = 0; FUN_007091f0(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 009c7320 FUN_009c7320 void FUN_009c7320(void) { int in_ECX; if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x50); } return; } //@@ 009c7340 FUN_009c7340 void FUN_009c7340(void) { FUN_007091f0(); return; } //@@ 009c7350 is_valid_item_config_id /* DB: ECX = item kind, EDX = id: id < 1 -> true; kind 0 checks ItemConfig vector +0x18 (g_Manager+0x2a41c), kind 2 trinket (id & 0x7fff, vector +0xc at +0x2a410), else ItemConfig::GetCollectible != 0; used while reading saved players (GameStatePlayer::read_part3, restore_save_state_part2) */ bool is_valid_item_config_id(void) { ItemConfig_Item *pIVar1; void *pvVar2; int in_ECX; void *pvVar3; uint in_EDX; if ((int)in_EDX < 1) { return true; } if (in_ECX == 0) { pvVar3 = (g_manager->_itemConfig)._nullItems._begin; pvVar2 = (g_manager->_itemConfig)._nullItems._end; } else { if (in_ECX != 2) { pIVar1 = ItemConfig::GetCollectible(&g_manager->_itemConfig,in_EDX); return pIVar1 != (ItemConfig_Item *)0x0; } in_EDX = in_EDX & 0x7fff; pvVar3 = (g_manager->_itemConfig)._trinkets._begin; pvVar2 = (g_manager->_itemConfig)._trinkets._end; } if ((int)in_EDX < (int)pvVar2 - (int)pvVar3 >> 2) { return *(int *)((int)pvVar3 + in_EDX * 4) != 0; } return false; } //@@ 009c73c0 GameState::constructor /* DB: thiscall GameState: zeroes header fields, _eh_vector_constructor_iterator(this+0x68, 0xb8, 0x20f, RoomDescriptor::constructor) for the saved room list, then the rest; callers Manager::constructor, write_game_state_to_stream prototype: db/protos.zhl */ GameState * __thiscall GameState::constructor(GameState *this) { undefined1 *puVar1; int *piVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0f25a; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)&this->field_0xa4 = 0; *(undefined4 *)&this->field_0xa8 = 0; *(undefined4 *)&this->field_0xac = 0; *(undefined4 *)&this->field_0xb0 = 0; *(undefined4 *)&this->field_0xb4 = 0; *(undefined4 *)&this->field_0xb8 = 0; *(undefined4 *)&this->field_0xc4 = 0; *(undefined4 *)&this->field_0xc8 = 0; *(undefined4 *)&this->field_0xcc = 0; *(undefined4 *)&this->field_0xd0 = 0; *(undefined4 *)&this->field_0xd4 = 0; *(undefined4 *)&this->field_0xd8 = 0; local_8 = 0; _eh_vector_constructor_iterator_ (&this->field_0x1a0,0xb8,0x20f,RoomDescriptor::constructor,RoomDescriptor::destructor); local_8._0_1_ = 1; puVar1 = &this->field_0x1951c; *(undefined4 *)puVar1 = 0; *(undefined4 *)&this->field_0x19520 = 0; *(undefined4 *)&this->field_0x19524 = 0; *(undefined4 *)&this->field_0x19528 = 0; *(undefined4 *)&this->field_0x1952c = 0; piVar2 = operator_new(8); piVar2[1] = 0; *(int **)puVar1 = piVar2; *piVar2 = (int)puVar1; local_8._0_1_ = 2; *(undefined4 *)&this->field_0x19d34 = 0; *(undefined4 *)&this->field_0x19d30 = 0; *(undefined4 *)&this->field_0x19d3c = 0xffffffff; *(undefined4 *)&this->field_0x19d40 = 0; this->field_0x19d44 = 0; *(undefined4 *)&this->field_0x19d48 = 0; this->field_0x19d4c = 0; _eh_vector_constructor_iterator_ (&this->field_0x19d7c,0x5dc,8,input_state_reset,GameStatePlayer::~GameStatePlayer); local_8._0_1_ = 3; _eh_vector_constructor_iterator_ (&this->field_0x1cc5c,0x5dc,4,input_state_reset,GameStatePlayer::~GameStatePlayer); local_8._0_1_ = 4; _eh_vector_constructor_iterator_(&this->field_0x1e3cc,0xc,0x1f,FUN_00424510,FID_conflict__Tidy); *(undefined4 *)&this->field_0x1e5d4 = 0; *(undefined4 *)&this->field_0x1e5d8 = 0; *(undefined4 *)&this->field_0x1e5dc = 0; *(undefined4 *)&this->field_0x1e5e0 = 0; *(undefined4 *)&this->field_0x1e5e4 = 0; *(undefined4 *)&this->field_0x1e5e8 = 0; *(undefined4 *)&this->field_0x1e5ec = 0; *(undefined4 *)&this->field_0x1e5f0 = 0; *(undefined4 *)&this->field_0x1e714 = 0; *(undefined4 *)&this->field_0x1e718 = 0; *(undefined4 *)&this->field_0x1e71c = 0; *(undefined4 *)&this->field_0x1e720 = 0; local_8._0_1_ = 6; Seeds::constructor(); *(undefined4 *)&this->field_0x1e790 = 0; *(undefined4 *)&this->field_0x1e794 = 0; *(undefined4 *)&this->field_0x1e798 = 0; *(undefined4 *)&this->field_0x1e79c = 0; *(undefined4 *)&this->field_0x1e7a0 = 0; *(undefined4 *)&this->field_0x1e7a4 = 0; local_8._0_1_ = 9; _eh_vector_constructor_iterator_(&this->field_0x1e7b4,800,7,FUN_006ef920,FUN_006f29a0); *(undefined4 *)&this->field_0x1fd98 = 0; *(undefined4 *)&this->field_0x1fd9c = 0; *(undefined4 *)&this->field_0x1fda0 = 0; *(undefined4 *)&this->field_0x1fdac = 0; *(undefined4 *)&this->field_0x1fdbc = 0; *(undefined4 *)&this->field_0x1fdc0 = 0xf; this->field_0x1fdac = 0; *(undefined4 *)&this->field_0x1fdc4 = 0; *(undefined4 *)&this->field_0x1fdd4 = 0; *(undefined4 *)&this->field_0x1fdd8 = 0xf; this->field_0x1fdc4 = 0; *(undefined4 *)&this->field_0x1fde0 = 0; *(undefined4 *)&this->field_0x1fde4 = 0; *(undefined4 *)&this->field_0x1fde8 = 0; *(undefined4 *)&this->field_0x1fdf4 = 0; *(undefined4 *)&this->field_0x1fe04 = 0; *(undefined4 *)&this->field_0x1fe08 = 0xf; this->field_0x1fdf4 = 0; *(undefined4 *)&this->field_0x1fe0c = 0; *(undefined4 *)&this->field_0x1fe1c = 0; *(undefined4 *)&this->field_0x1fe20 = 0xf; this->field_0x1fe0c = 0; local_8 = CONCAT31(local_8._1_3_,0x10); this->_saveFile = (void *)0x0; Clear(this); ExceptionList = local_10; return this; } //@@ 009c7750 FUN_009c7750 void FUN_009c7750(void) { std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); return; } //@@ 009c7780 FUN_009c7780 void FUN_009c7780(void) { void *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; FID_conflict__Tidy((void *)((int)in_ECX + 0x218)); FID_conflict__Tidy((void *)((int)in_ECX + 0x208)); local_8 = 0; _eh_vector_destructor_iterator_(in_ECX,0xc,0x1f,FID_conflict__Tidy); ExceptionList = local_10; return; } //@@ 009c77f0 FUN_009c77f0 void FUN_009c77f0(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 0x94)); return; } //@@ 009c7800 GameState::~GameState /* DB: tears down the GameState members: strings, vectors at +0x1fde0/+0x1fd98, 7x800-byte records at +0x1e7b4, a set at +0x1e778, 0x1f vectors at +0x1e3cc, 4+8 0x5dc-byte player states (FUN_00754d90) at +0x1cc5c/+0x19d7c, 0x20f RoomDescriptor::destructor at +0x1a0; write_game_state_to_stream unwinds its stack GameState with it, Manager::destructor prototype: db/protos.zhl */ void __thiscall GameState::~GameState(GameState *this) { undefined1 *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; std::string::_Tidy_deallocate(&this->field_0x1fe0c); std::string::_Tidy_deallocate(&this->field_0x1fdf4); FID_conflict__Tidy(&this->field_0x1fde0); std::string::_Tidy_deallocate(&this->field_0x1fdc4); std::string::_Tidy_deallocate(&this->field_0x1fdac); FID_conflict__Tidy(&this->field_0x1fd98); _eh_vector_destructor_iterator_(&this->field_0x1e7b4,800,7,FUN_006f29a0); std::vector::_Tidy(); std::vector<12byte>::_Tidy(); this_00 = &this->field_0x1e778; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(*(int *)&this->field_0x1e778 + 4)); operator_delete(*(void **)this_00,0x14); FID_conflict__Tidy(&this->field_0x1e714); FID_conflict__Tidy(&this->field_0x1e5e4); FID_conflict__Tidy(&this->field_0x1e5d4); local_8 = 0; _eh_vector_destructor_iterator_(&this->field_0x1e3cc,0xc,0x1f,FID_conflict__Tidy); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(&this->field_0x1cc5c,0x5dc,4,GameStatePlayer::~GameStatePlayer); _eh_vector_destructor_iterator_(&this->field_0x19d7c,0x5dc,8,GameStatePlayer::~GameStatePlayer); std::deque<12byte>::~deque(); _eh_vector_destructor_iterator_(&this->field_0x1a0,0xb8,0x20f,RoomDescriptor::destructor); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 009c79a0 GameState::Clear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called by GameState::Delete and the SteamCloud/local GameState load paths; constructs RoomDescriptor, GameStatePlayer::Init, memset; zhl GameState::Clear() prototype: REPENTOGON */ void __thiscall GameState::Clear(GameState *this) { undefined1 *puVar1; int *ptr; RoomDescriptor *emptyRoom; void *pvVar2; void *pvVar3; undefined4 *puVar4; GameStatePlayer *playerState; uint *puVar5; uint uVar6; int iVar7; uint *roomListIndexPtr; int *local_f8; void *pvStack_f4; uint auStack_f0 [3]; GameState *local_e4; undefined1 local_e0 [92]; int local_84; int local_80; undefined8 local_7c; undefined1 *local_74; void *local_60 [11]; void *local_34; int local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; GameState *gameState; puStack_20 = (undefined1 *)(local_60 + 0x17); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0f28d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_60 + 0x14); ExceptionList = &local_1c; this->_isSaveAvailable = 0; this->_isRerunAvailable = 0; *(undefined2 *)&this->field_0xc = 0x35; *(undefined4 *)this = 0; *(undefined2 *)&this->field_0x4 = 0; *(undefined4 *)&this->field_0x8 = 0; local_e4 = this; memset(&this->field_0xe,0,0x35); *(undefined4 *)&this->field_0xa8 = *(undefined4 *)&this->field_0xa4; *(undefined4 *)&this->field_0xb4 = *(undefined4 *)&this->field_0xb0; *(undefined4 *)&this->field_0x8c = 0; *(undefined4 *)&this->field_0x90 = 0; *(undefined4 *)&this->field_0x94 = 0; *(undefined4 *)&this->field_0x98 = 0; *(undefined4 *)&this->field_0x9c = 0; *(undefined4 *)&this->field_0xa0 = 0; *(undefined4 *)&this->field_0xbc = 0; *(undefined4 *)&this->field_0xc0 = 0; *(undefined4 *)&this->field_0x44 = 0; *(undefined4 *)&this->field_0x48 = 0; *(undefined4 *)&this->field_0x4c = 0; *(undefined4 *)&this->field_0x50 = 0; *(undefined4 *)&this->field_0x54 = 0; *(undefined4 *)&this->field_0x58 = 0; *(undefined4 *)&this->field_0x5c = 0; *(undefined4 *)&this->field_0x60 = 0; *(undefined4 *)&this->field_0x64 = 0; *(undefined4 *)&this->field_0x68 = 0; *(undefined4 *)&this->field_0x6c = 0; *(undefined4 *)&this->field_0x70 = 0; *(undefined4 *)&this->field_0x74 = 0; *(undefined4 *)&this->field_0x78 = 0; *(undefined4 *)&this->field_0x7c = 0; *(undefined4 *)&this->field_0x80 = 0; this->field_0x84 = 0; *(undefined4 *)&this->field_0x88 = 0; *(undefined4 *)&this->field_0xdc = 0; *(undefined4 *)&this->field_0xe0 = 0; *(undefined4 *)&this->field_0xe4 = 0; *(undefined4 *)&this->field_0xe8 = 0; *(undefined4 *)&this->field_0xec = 0; *(undefined4 *)&this->field_0xf0 = 0xffffffff; *(undefined4 *)&this->field_0xf4 = 0; *(undefined4 *)&this->field_0xf8 = 0; *(undefined4 *)&this->field_0xfc = 0; *(undefined4 *)&this->field_0x100 = 0; *(undefined2 *)&this->field_0x104 = 0; *(undefined4 *)&this->field_0x106 = 0x1a0000; *(undefined4 *)&this->field_0x10a = 0; *(undefined4 *)&this->field_0x10e = 0; *(undefined4 *)&this->field_0x112 = 0; *(undefined4 *)&this->field_0x116 = 0; *(undefined8 *)&this->field_0x11a = 0; *(undefined2 *)&this->field_0x122 = 0; *(undefined4 *)&this->field_0x124 = 0; memset(&this->field_0x128,0,0x30); roomListIndexPtr = (uint *)&this->field_0x1a8; *(undefined4 *)&this->field_0x158 = 0xffffffff; *(undefined4 *)&this->field_0x15c = 0; *(undefined4 *)&this->field_0x160 = 0; *(undefined4 *)&this->field_0x19c = 0; uVar6 = 0; puVar4 = (undefined4 *)&this->field_0x17c6c; do { emptyRoom = (RoomDescriptor *)RoomDescriptor::constructor((RoomDescriptor *)local_e0); RoomDescriptor::operator_assign((RoomDescriptor *)(roomListIndexPtr + -2),emptyRoom); std::vector::_Tidy(); FID_conflict__Erase_tree_>_> (local_60,(fuzzer_allocator_> *)local_60, *(_Tree_node **)((int)local_60[0] + 4)); operator_delete(local_60[0],0x14); std::vector::_Tidy(); FUN_00708f90(); gameState = local_e4; *roomListIndexPtr = uVar6; uVar6 = uVar6 + 1; roomListIndexPtr = roomListIndexPtr + 0x2e; puVar4[-1] = 0; *puVar4 = 0; puVar4[1] = 0; puVar4 = puVar4 + 3; } while (uVar6 < 0x20f); memset(&local_e4->field_0x19530,0,0x7ec); *(undefined4 *)&gameState->field_0x19d1c = 0; playerState = (GameStatePlayer *)&gameState->field_0x19d7c; *(undefined4 *)&gameState->field_0x19d20 = 0; gameState->field_0x19d24 = 0; *(undefined4 *)&gameState->field_0x19d28 = 0; *(undefined2 *)&gameState->field_0x19d2c = 0; *(float *)&gameState->field_0x19d30 = g_vectorZero.x; *(float *)&gameState->field_0x19d34 = g_vectorZero.y; *(undefined4 *)&gameState->field_0x19d38 = 0; local_f8 = (int *)0xffffffff; pvStack_f4 = (void *)0x0; auStack_f0[0] = auStack_f0[0] & 0xffffff00; auStack_f0[1] = 0; *(undefined4 *)&gameState->field_0x19d50 = 0xffffffff; *(undefined4 *)&gameState->field_0x19d6c = 0; *(undefined4 *)&gameState->field_0x19d3c = 0xffffffff; *(undefined4 *)&gameState->field_0x19d40 = 0; *(uint *)&gameState->field_0x19d44 = auStack_f0[0]; *(undefined4 *)&gameState->field_0x19d48 = 0; *(undefined4 *)&gameState->field_0x19d70 = 0; gameState->field_0x19d74 = 0; auStack_f0[2] = auStack_f0[2] & 0xffffff00; *(uint *)&gameState->field_0x19d4c = auStack_f0[2]; *(undefined4 *)&gameState->field_0x19d60 = 0xfffe7961; *(undefined4 *)&gameState->field_0x19d54 = 0xfffe7961; *(undefined8 *)&gameState->field_0x164 = 0xc0000000c; *(undefined8 *)&gameState->field_0x16c = 0xc0000000c; *(undefined8 *)&gameState->field_0x174 = 0xc0000000c; *(undefined8 *)&gameState->field_0x17c = 0xc0000000c; *(undefined8 *)&gameState->field_0x184 = 0xc0000000c; *(undefined8 *)&gameState->field_0x18c = 0xc0000000c; *(undefined8 *)&gameState->field_0x194 = 0xc0000000c; iVar7 = 8; do { GameStatePlayer::Init(playerState); playerState = playerState + 0x177; iVar7 = iVar7 + -1; } while (iVar7 != 0); iVar7 = 4; playerState = (GameStatePlayer *)&local_e4->field_0x1cc5c; do { GameStatePlayer::Init(playerState); gameState = local_e4; *playerState = (GameStatePlayer)0xffffffff; playerState = playerState + 0x177; iVar7 = iVar7 + -1; } while (iVar7 != 0); local_e4 = (GameState *)0x0; *(undefined4 *)&gameState->field_0x19d78 = 1; puVar5 = (uint *)&gameState->field_0x1e3cc; do { if (auStack_f0 != puVar5) { pvVar2 = (void *)*puVar5; uVar6 = puVar5[2]; *puVar5 = 0; puVar5[1] = 0; puVar5[2] = 0; if (pvVar2 != (void *)0x0) { uVar6 = uVar6 - (int)pvVar2 & 0xfffffffc; pvVar3 = pvVar2; if (0xfff < uVar6) { pvVar3 = *(void **)((int)pvVar2 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar3))) goto LAB_009c8175; } operator_delete(pvVar3,uVar6); } } local_e4 = (GameState *)((int)local_e4 + 1); puVar5 = puVar5 + 3; } while (local_e4 < 0x1f); memset(&gameState->field_0x1e540,0,0x7c); *(undefined4 *)&gameState->field_0x1e5bc = 0; *(undefined4 *)&gameState->field_0x1e5c0 = 0xffffffff; *(undefined4 *)&gameState->field_0x1e5c4 = 0; *(undefined4 *)&gameState->field_0x1e5c8 = 0; *(undefined4 *)&gameState->field_0x1e5cc = 0x3f800000; *(undefined4 *)&gameState->field_0x1e5d0 = 0x3f800000; memset(&gameState->field_0x1e5f4,0,0x4b); memset(&gameState->field_0x1e640,0,0x3e); FUN_009cf000(); local_80 = -0x55e8beb1; local_7c._0_4_ = 5; local_7c._4_4_ = (void *)0x9; local_74 = &DAT_00000007; local_34 = (void *)0x0; local_30 = 0; pvVar2 = operator_new(0x14); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; local_84 = 0; local_e0[0x58] = 0; local_34 = pvVar2; FID_conflict__Erase_tree_>_> (&local_34,(fuzzer_allocator_> *)&local_34, *(_Tree_node **)((int)pvVar2 + 4)); *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; local_30 = 0; local_14 = (void *)0x0; Seeds::operator_assign((Seeds *)&gameState->field_0x1e724,(Seeds *)(local_e0 + 0x58)); local_14 = (void *)0xffffffff; FID_conflict__Erase_tree_>_> (&local_34,(fuzzer_allocator_> *)&local_34, *(_Tree_node **)((int)local_34 + 4)); operator_delete(local_34,0x14); puVar1 = &gameState->field_0x1e790; *(undefined4 *)&gameState->field_0x1e780 = 0; *(undefined4 *)&gameState->field_0x1e784 = 0; *(undefined4 *)&gameState->field_0x1e788 = 0; *(undefined4 *)&gameState->field_0x1e78c = 0; if (auStack_f0 != (uint *)puVar1) { pvVar2 = *(void **)puVar1; iVar7 = *(int *)&gameState->field_0x1e798; *(undefined4 *)puVar1 = 0; *(undefined4 *)&gameState->field_0x1e794 = 0; *(undefined4 *)&gameState->field_0x1e798 = 0; if (pvVar2 != (void *)0x0) { uVar6 = ((iVar7 - (int)pvVar2) / 0xc) * 0xc; pvVar3 = pvVar2; if (0xfff < uVar6) { pvVar3 = *(void **)((int)pvVar2 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar3))) goto LAB_009c8175; } operator_delete(pvVar3,uVar6); } } puVar1 = &gameState->field_0x1e79c; *(undefined4 *)&gameState->field_0x1e7a8 = 0; *(undefined4 *)&gameState->field_0x1e7ac = 0; if (auStack_f0 != (uint *)puVar1) { pvVar2 = *(void **)puVar1; iVar7 = *(int *)&gameState->field_0x1e7a4; *(undefined4 *)puVar1 = 0; *(undefined4 *)&gameState->field_0x1e7a0 = 0; *(undefined4 *)&gameState->field_0x1e7a4 = 0; if (pvVar2 != (void *)0x0) { uVar6 = iVar7 - (int)pvVar2 & 0xfffffff8; pvVar3 = pvVar2; if (0xfff < uVar6) { pvVar3 = *(void **)((int)pvVar2 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar3))) goto LAB_009c8175; } operator_delete(pvVar3,uVar6); } } pvStack_f4 = (void *)0x0; auStack_f0[0] = 0; auStack_f0[1] = 0; auStack_f0[2] = 0; local_f8 = operator_new(8); local_f8[1] = 0; *local_f8 = (int)&local_f8; FUN_007526b0(&gameState->field_0x1951c); if (auStack_f0[2] != 0) { do { auStack_f0[2] = auStack_f0[2] - 1; } while (auStack_f0[2] != 0); auStack_f0[1] = 0; auStack_f0[2] = 0; } pvVar2 = pvStack_f4; uVar6 = auStack_f0[0]; if (auStack_f0[0] != 0) { do { pvVar3 = *(void **)((int)pvVar2 + uVar6 * 4 + -4); uVar6 = uVar6 - 1; if (pvVar3 != (void *)0x0) { operator_delete(pvVar3,0xc); pvVar2 = pvStack_f4; } } while (uVar6 != 0); } if (pvVar2 != (void *)0x0) { uVar6 = auStack_f0[0] * 4; pvVar3 = pvVar2; if (0xfff < uVar6) { pvVar3 = *(void **)((int)pvVar2 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar3))) goto LAB_009c8175; } operator_delete(pvVar3,uVar6); } ptr = local_f8; auStack_f0[0] = 0; pvStack_f4 = (void *)0x0; local_f8 = (int *)0x0; operator_delete(ptr,8); gameState->field_0x1e7b0 = 0; puVar1 = &gameState->field_0x1fd98; *(undefined4 *)&gameState->field_0x1eac4 = 0; *(undefined4 *)&gameState->field_0x1eac8 = 0; gameState->field_0x1ead0 = 0; *(undefined4 *)&gameState->field_0x1eacc = 0; *(undefined4 *)&gameState->field_0x1ede4 = 0; *(undefined4 *)&gameState->field_0x1ede8 = 0; gameState->field_0x1edf0 = 0; *(undefined4 *)&gameState->field_0x1edec = 0; *(undefined4 *)&gameState->field_0x1f104 = 0; *(undefined4 *)&gameState->field_0x1f108 = 0; gameState->field_0x1f110 = 0; *(undefined4 *)&gameState->field_0x1f10c = 0; *(undefined4 *)&gameState->field_0x1f424 = 0; *(undefined4 *)&gameState->field_0x1f428 = 0; gameState->field_0x1f430 = 0; *(undefined4 *)&gameState->field_0x1f42c = 0; *(undefined4 *)&gameState->field_0x1f744 = 0; *(undefined4 *)&gameState->field_0x1f748 = 0; gameState->field_0x1f750 = 0; *(undefined4 *)&gameState->field_0x1f74c = 0; *(undefined4 *)&gameState->field_0x1fa64 = 0; *(undefined4 *)&gameState->field_0x1fa68 = 0; gameState->field_0x1fa70 = 0; *(undefined4 *)&gameState->field_0x1fa6c = 0; *(undefined4 *)&gameState->field_0x1fd84 = 0; *(undefined4 *)&gameState->field_0x1fd88 = 0; gameState->field_0x1fd90 = 0; *(undefined4 *)&gameState->field_0x1fd8c = 0; *(undefined2 *)&gameState->field_0x1fd94 = 0; if (auStack_f0 != (uint *)puVar1) { pvVar2 = *(void **)puVar1; iVar7 = *(int *)&gameState->field_0x1fda0; *(undefined4 *)puVar1 = 0; *(undefined4 *)&gameState->field_0x1fd9c = 0; *(undefined4 *)&gameState->field_0x1fda0 = 0; if (pvVar2 != (void *)0x0) { uVar6 = iVar7 - (int)pvVar2 & 0xfffffffc; pvVar3 = pvVar2; if (0xfff < uVar6) { pvVar3 = *(void **)((int)pvVar2 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)pvVar3))) { LAB_009c8175: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar6); } } *(undefined4 *)&gameState->field_0x1fda4 = 0; ExceptionList = local_1c; return; } //@@ 009c8350 GameState::Delete /* ZHL [exact] __thiscall void GameState::Delete(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GameState::Delete(GameState *this) { Manager *pMVar1; char cVar2; int *piVar3; undefined4 *puVar4; char *_Filename; undefined1 *puVar5; pMVar1 = g_manager; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar3 == 0) || ((pMVar1->_optionsConfig)._enableSteamCloud == 0)) { if (*(int *)&this->field_0x1fdbc == 0) { KAGE_LogMessage(1,(byte *)"[warn] GameState::Delete: no filename specified.\n"); } _Filename = &this->field_0x1fdac; if (0xf < *(uint *)&this->field_0x1fdc0) { _Filename = *(char **)_Filename; } remove(_Filename); } else { puVar5 = &this->field_0x1fdf4; if (0xf < *(uint *)&this->field_0x1fe08) { puVar5 = *(undefined1 **)puVar5; } piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if (*piVar3 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); cVar2 = (**(code **)(*(int *)*puVar4 + 0x34))(puVar5); if (cVar2 != '\0') { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); (**(code **)(*(int *)*puVar4 + 0x18))(puVar5); Clear(this); return; } } } Clear(this); return; } //@@ 009c8410 GameState::DeleteRerun /* ZHL [exact] __thiscall void GameState::DeleteRerun(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GameState::DeleteRerun(GameState *this) { Manager *pMVar1; char cVar2; int *piVar3; undefined4 *puVar4; char *_Filename; undefined1 *puVar5; pMVar1 = g_manager; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*piVar3 == 0) || ((pMVar1->_optionsConfig)._enableSteamCloud == 0)) { if (*(int *)&this->field_0x1fdbc == 0) { KAGE_LogMessage(1,(byte *)"[warn] GameState::DeleteRerun: no filename specified.\n"); } _Filename = &this->field_0x1fdc4; if (0xf < *(uint *)&this->field_0x1fdd8) { _Filename = *(char **)_Filename; } remove(_Filename); } else { puVar5 = &this->field_0x1fe0c; if (0xf < *(uint *)&this->field_0x1fe20) { puVar5 = *(undefined1 **)puVar5; } piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if (*piVar3 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); cVar2 = (**(code **)(*(int *)*puVar4 + 0x34))(puVar5); if (cVar2 != '\0') { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); (**(code **)(*(int *)*puVar4 + 0x18))(puVar5); return; } } } return; } //@@ 009c84c0 GameStateReader::read_bool_vector /* DB: ? stream in ECX, std::vector in EDX: reads a ushort count, vector_bool_resize(max(param,count)), clears all bits, then reads the bits 8 per byte; GameStatePlayer::read_part3 (twice); counterpart of 009c85d0 GameState::write_bool_vector void GameStateReader::read_bool_vector(uint param_1) { uint *puVar1; undefined4 *in_ECX; uint uVar2; int *in_EDX; byte bVar3; ushort unaff_BX; uint uVar4; ushort uVar5; undefined4 unaff_EDI; undefined4 uStack_24; undefined4 *puStack_20; undefined4 *local_1c; int *piStack_18; (**(code **)(*(int *)*in_ECX + 0x14))(&local_1c,2,1); uStack_24 = (uint *)(uint)unaff_BX; local_1c = in_ECX + 3; Checksum::Update(local_1c,(byte *)&uStack_24,2); if (param_1 < unaff_BX) { param_1 = (uint)unaff_BX; } vector_bool_resize(in_EDX,param_1,(byte)unaff_BX); uVar4 = 0; if (in_EDX[3] != 0) { do { puVar1 = (uint *)(*in_EDX + (uVar4 >> 5) * 4); uVar2 = uVar4 & 0x1f; uVar4 = uVar4 + 1; *puVar1 = *puVar1 & ~(1 << uVar2); } while (uVar4 < (uint)in_EDX[3]); } bVar3 = 0; uVar5 = 0; if (unaff_BX != 0) { do { if (bVar3 == 0) { (**(code **)(*(int *)*puStack_20 + 0x14))((int)register0x00000010 + -0x2d,1,1); Checksum::Update(local_1c,(byte *)((int)register0x00000010 + -0x2c),1); } if ((uint)uVar5 < (uint)piStack_18[3]) { uStack_24 = (uint *)(*piStack_18 + (uint)(uVar5 >> 5) * 4); if ((byte)((byte)((uint)unaff_EDI >> 0x18) & (byte)(1 << bVar3)) == 0) { uVar4 = *uStack_24 & ~(1 << (uVar5 & 0x1f)); } else { uVar4 = *uStack_24 | 1 << (uVar5 & 0x1f); } *uStack_24 = uVar4; } uVar5 = uVar5 + 1; bVar3 = bVar3 + 1 & 7; } while (uVar5 < unaff_BX); } return; } //@@ 009c85d0 GameState::write_bool_vector /* DB: ? stream in ECX, bit vector in EDX: writes the ushort bit count (+0xc) then the bits packed 8 per byte, each with Checksum::Update; GameState::write for the bit vector at GameState+0x79a0; reader is 009c84c0 GameStateReader::read_bool_vector void GameState::write_bool_vector(void) { undefined4 *in_ECX; int in_EDX; ushort uVar1; short sVar2; undefined4 uVar3; undefined1 uVar4; byte abStack_34 [4]; ushort uStack_24; byte abStack_22 [2]; undefined4 *puStack_20; uint uStack_1c; int *local_18 [5]; puStack_20 = (undefined4 *)(uint)(uint3)puStack_20; sVar2 = 0; local_18[0] = (int *)(uint)*(ushort *)(in_EDX + 0xc); abStack_34[0] = 1; abStack_34[1] = 0; abStack_34[2] = 0; abStack_34[3] = 0; uVar3 = 0; (**(code **)(*(int *)*in_ECX + 0x1c))(local_18,2); uStack_1c = (uint)uStack_24; Checksum::Update(in_ECX + 3,(byte *)&uStack_1c,2); uVar1 = 0; if (uStack_24 != 0) { do { sVar2 = sVar2 + 1; if (sVar2 == 8) { sVar2 = 0; (**(code **)(*(int *)*puStack_20 + 0x1c))(abStack_22 + -7,1,1); Checksum::Update(puStack_20 + 3,abStack_22 + -6,1); } uVar4 = (undefined1)((uint)uVar3 >> 0x18); uVar1 = uVar1 + 1; } while (uVar1 < uStack_24); if (sVar2 != 0) { (**(code **)(*(int *)*puStack_20 + 0x1c))(abStack_22 + -7,1,1); abStack_34[0] = uVar4; Checksum::Update(puStack_20 + 3,abStack_34,1); } } return; } //@@ 009c86e0 GameStatePlayer::read_player_key /* DB: ? (stream*): reads an int into this[0] (Checksum::Update); if it is 0x80000000 reads int this[1] and ushorts +8/+0xa, else ints this[1] and this[2]; first read of GameState::read_player (before the version < 0x7d branch) */ void GameStatePlayer::read_player_key(int *param_1) { undefined4 *puVar1; int *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*param_1 + 0x14))(); param_1 = (int *)*in_ECX; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); param_1 = in_ECX + 1; if (*in_ECX == -0x80000000) { (**(code **)(*(int *)*puVar1 + 0x14))(); param_1 = (int *)in_ECX[1]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 2,2,1); param_1 = (int *)(uint)*(ushort *)(in_ECX + 2); Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))((ushort *)((int)in_ECX + 10),2,1); param_1 = (int *)(uint)*(ushort *)((int)in_ECX + 10); Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); return; } (**(code **)(*(int *)*puVar1 + 0x14))(param_1,4,1); param_1 = (int *)*param_1; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 2,4,1); param_1 = (int *)in_ECX[2]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); return; } //@@ 009c87e0 GameState::write_entry /* DB: ? writes a 12-byte record to stream param_1 with checksum: if first int == 0x80000000 writes int + two ushorts, else three ints; called in a loop from GameState::write and from GameState::write_room */ void GameState::write_entry(int *param_1) { undefined4 *puVar1; int *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*param_1 + 0x1c))(); param_1 = (int *)*in_ECX; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); param_1 = in_ECX + 1; if (*in_ECX == -0x80000000) { (**(code **)(*(int *)*puVar1 + 0x1c))(); param_1 = (int *)in_ECX[1]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 2,2,1); param_1 = (int *)(uint)*(ushort *)(in_ECX + 2); Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))((ushort *)((int)in_ECX + 10),2,1); param_1 = (int *)(uint)*(ushort *)((int)in_ECX + 10); Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); return; } (**(code **)(*(int *)*puVar1 + 0x1c))(param_1,4,1); param_1 = (int *)*param_1; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 2,4,1); param_1 = (int *)in_ECX[2]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); return; } //@@ 009c88e0 GameState::write_entity_save_state /* DB: ECX = saved entity record, EDX = writer: writes each dword field through writer vfunc +0x1c with endian swap FUN_00683410 (+0 type, +4, +8, +0xc, +0x10, +0x14, byte +0x60 ...) and recurses into itself for child records; callers GameState::write_room and GameState::write_player loop over the saved entities prototype: db/protos.zhl */ void __fastcall GameState::write_entity_save_state(void *record,void *writer) { undefined4 *puVar1; bool isHasExtraData; undefined4 uStack_148; ushort *puStack_13c; undefined4 *puStack_130; undefined4 *puStack_124; int iStack_118; undefined4 uStack_10c; undefined4 *puStack_f4; undefined4 *puStack_e8; undefined4 *puStack_dc; undefined4 *puStack_d0; undefined4 *puStack_c4; undefined4 *puStack_b8; undefined4 *puStack_ac; int iStack_a0; undefined4 uStack_94; int iStack_7c; undefined4 uStack_70; undefined4 *puStack_58; undefined4 *puStack_4c; int iStack_40; undefined4 *puStack_34; undefined4 uStack_30; undefined4 uStack_2c; byte abStack_1c [8]; undefined4 local_14 [4]; byte *extraData; uStack_2c = 1; uStack_30 = 4; puStack_34 = local_14; local_14[0] = *(undefined4 *)record; (**(code **)(**(int **)writer + 0x1c))(); iStack_40 = 0x9c891d; Checksum::Update((void *)((int)writer + 0xc),abStack_1c,4); iStack_40 = (int)record + 4; (**(code **)(**(int **)writer + 0x1c))(); puStack_4c = (undefined4 *)0x9c8941; Checksum::Update((void *)((int)writer + 0xc),abStack_1c + -0xc,4); puStack_4c = (undefined4 *)((int)record + 8); (**(code **)(**(int **)writer + 0x1c))(); puStack_34 = *(undefined4 **)((int)record + 8); puStack_58 = (undefined4 *)0x9c8965; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_34,4); puStack_58 = (undefined4 *)((int)record + 0xc); (**(code **)(**(int **)writer + 0x1c))(); iStack_40 = *(undefined4 *)((int)record + 0xc); Checksum::Update((void *)((int)writer + 0xc),(byte *)&iStack_40,4); (**(code **)(**(int **)writer + 0x1c))(); puStack_4c = *(undefined4 **)((int)record + 0x10); uStack_70 = (undefined4 *)0x9c89ad; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_4c,4); uStack_70 = (undefined4 *)((int)record + 0x14); (**(code **)(**(int **)writer + 0x1c))(); puStack_58 = *(undefined4 **)((int)record + 0x14); iStack_7c = 0x9c89d1; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_58,4); iStack_7c = (int)record + 0x60; (**(code **)(**(int **)writer + 0x1c))(); Checksum::Update((void *)((int)writer + 0xc),abStack_1c + -0x50,1); (**(code **)(**(int **)writer + 0x1c))(); uStack_70 = *(undefined4 **)((int)record + 0x18); uStack_94 = (undefined4 *)0x9c8a1a; Checksum::Update((void *)((int)writer + 0xc),(byte *)&uStack_70,4); uStack_94 = (undefined4 *)((int)record + 0x1c); (**(code **)(**(int **)writer + 0x1c))(); iStack_7c = *(undefined4 *)((int)record + 0x1c); iStack_a0 = 0x9c8a3e; Checksum::Update((void *)((int)writer + 0xc),(byte *)&iStack_7c,4); iStack_a0 = (int)record + 0x22; (**(code **)(**(int **)writer + 0x1c))(); puStack_ac = (undefined4 *)0x9c8a63; Checksum::Update((void *)((int)writer + 0xc),abStack_1c + -0x74,1); puStack_ac = (undefined4 *)((int)record + 0x24); (**(code **)(**(int **)writer + 0x1c))(); uStack_94 = *(undefined4 **)((int)record + 0x24); puStack_b8 = (undefined4 *)0x9c8a87; Checksum::Update((void *)((int)writer + 0xc),(byte *)&uStack_94,4); puStack_b8 = (undefined4 *)((int)record + 0x28); (**(code **)(**(int **)writer + 0x1c))(); iStack_a0 = *(undefined4 *)((int)record + 0x28); puStack_c4 = (undefined4 *)0x9c8aaf; Checksum::Update((void *)((int)writer + 0xc),(byte *)&iStack_a0,4); puStack_c4 = (undefined4 *)((int)record + 0x2c); (**(code **)(**(int **)writer + 0x1c))(); puStack_ac = *(undefined4 **)((int)record + 0x2c); puStack_d0 = (undefined4 *)0x9c8ad7; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_ac,4); puStack_d0 = (undefined4 *)((int)record + 0x30); (**(code **)(**(int **)writer + 0x1c))(); puStack_b8 = *(undefined4 **)((int)record + 0x30); puStack_dc = (undefined4 *)0x9c8afb; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_b8,4); puStack_dc = (undefined4 *)((int)record + 0x34); (**(code **)(**(int **)writer + 0x1c))(); puStack_c4 = *(undefined4 **)((int)record + 0x34); puStack_e8 = (undefined4 *)0x9c8b1f; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_c4,4); puStack_e8 = (undefined4 *)((int)record + 0x38); (**(code **)(**(int **)writer + 0x1c))(); puStack_d0 = *(undefined4 **)((int)record + 0x38); puStack_f4 = (undefined4 *)0x9c8b43; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_d0,4); puStack_f4 = (undefined4 *)((int)record + 0x3c); (**(code **)(**(int **)writer + 0x1c))(); puStack_dc = *(undefined4 **)((int)record + 0x3c); Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_dc,4); (**(code **)(**(int **)writer + 0x1c))(); puStack_e8 = *(undefined4 **)((int)record + 0x40); uStack_10c = (undefined4 *)0x9c8b8b; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_e8,4); uStack_10c = (undefined4 *)((int)record + 0x48); (**(code **)(**(int **)writer + 0x1c))(); puStack_f4 = *(undefined4 **)((int)record + 0x48); iStack_118 = 0x9c8bb6; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_f4,8); iStack_118 = (int)record + 0x23; (**(code **)(**(int **)writer + 0x1c))(); puStack_124 = (undefined4 *)0x9c8bdb; Checksum::Update((void *)((int)writer + 0xc),(byte *)((int)register0x00000010 + -0x108),1); puStack_124 = (undefined4 *)((int)record + 0x50); (**(code **)(**(int **)writer + 0x1c))(); uStack_10c = *(undefined4 **)((int)record + 0x50); puStack_130 = (undefined4 *)0x9c8c03; Checksum::Update((void *)((int)writer + 0xc),(byte *)&uStack_10c,4); puStack_130 = (undefined4 *)((int)record + 0x54); (**(code **)(**(int **)writer + 0x1c))(); iStack_118 = *(undefined4 *)((int)record + 0x54); puStack_13c = (ushort *)0x9c8c2b; Checksum::Update((void *)((int)writer + 0xc),(byte *)&iStack_118,4); puStack_13c = (ushort *)((int)record + 0x20); (**(code **)(**(int **)writer + 0x1c))(); puStack_124 = (undefined4 *)(uint)*(ushort *)((int)record + 0x20); uStack_148 = (undefined4 *)0x9c8c50; Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_124,2); uStack_148 = (undefined4 *)((int)record + 0x58); (**(code **)(**(int **)writer + 0x1c))(); puStack_130 = *(undefined4 **)((int)record + 0x58); Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_130,4); (**(code **)(**(int **)writer + 0x1c))((undefined4 *)((int)record + 0x5c)); puStack_13c = *(ushort **)((int)record + 0x5c); Checksum::Update((void *)((int)writer + 0xc),(byte *)&puStack_13c,4); puVar1 = uStack_148; uStack_148 = (undefined4 *)((uint)uStack_148 & 0xffffff); isHasExtraData = *(int *)((int)record + 100) != 0; if (isHasExtraData) { uStack_148._0_3_ = SUB43(puVar1,0); uStack_148 = (undefined4 *)CONCAT13(1,(undefined3)uStack_148); } if (*(int *)((int)record + 0x6c) != 0) { uStack_148 = (undefined4 *)(CONCAT13(isHasExtraData,(undefined3)uStack_148) | 0x2000000); } (**(code **)(**(int **)writer + 0x1c))((int)&uStack_148 + 3,1,1); Checksum::Update((void *)((int)writer + 0xc),(byte *)((int)register0x00000010 + -0x150),1); extraData = *(byte **)((int)record + 100); if (extraData != (byte *)0x0) { (**(code **)(**(int **)writer + 0x1c))(extraData,1,0x20); Checksum::Update((void *)((int)writer + 0xc),extraData,0x20); } if (*(void **)((int)record + 0x6c) != (void *)0x0) { write_entity_save_state(*(void **)((int)record + 0x6c),writer); } return; } //@@ 009c8d20 GameState::write_room /* DB: (GameStateRoomConfig* at +0x17c68, RoomDescriptor* at +0x1a0, stream): GameState::write loops _roomCount times with stride 0x2e0; writes shorts via stream vfn 0x1c plus checksum FUN_00683410 */ undefined4 GameState::write_room(uint param_1,ushort *param_2,int *param_3) { undefined4 *writer; uint *puVar1; int saveStateOffset; undefined4 *puVar2; ushort *puVar3; uint gridTypeShort; undefined4 restrictedGridCount; undefined4 allowedDoors; uint savedEffectCount; uint savedEntityCount; uint local_8; uint gridEntityType; writer = param_3; write_entry(param_3); puVar3 = param_2; local_8 = (uint)*param_2; (**(code **)(*(int *)*writer + 0x1c))(&local_8,2,1); param_1 = local_8 & 0xffff; Checksum::Update(writer + 3,(byte *)¶m_1,2); local_8 = (uint)puVar3[2]; (**(code **)(*(int *)*writer + 0x1c))(&local_8,2,1); param_1 = local_8 & 0xffff; Checksum::Update(writer + 3,(byte *)¶m_1,2); local_8 = (uint)puVar3[4]; (**(code **)(*(int *)*writer + 0x1c))(&local_8,2,1); param_1 = local_8 & 0xffff; Checksum::Update(writer + 3,(byte *)¶m_1,2); param_3._3_1_ = (char)puVar3[6]; (**(code **)(*(int *)*writer + 0x1c))((int)¶m_3 + 3,1,1); param_1 = CONCAT31(param_1._1_3_,param_3._3_1_); Checksum::Update(writer + 3,(byte *)¶m_1,1); allowedDoors = *(undefined4 *)(puVar3 + 0xc); (**(code **)(*(int *)*writer + 0x1c))(&allowedDoors,4,1); param_3 = (int *)allowedDoors; Checksum::Update(writer + 3,(byte *)¶m_3,4); (**(code **)(*(int *)*writer + 0x1c))(puVar3 + 0xe,4,8); Checksum::Update(writer + 3,(byte *)(puVar3 + 0xe),0x20); puVar3 = param_2 + 0x1e; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x20; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x22; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x25; (**(code **)(*(int *)*writer + 0x1c))(puVar3,2,1); param_3 = (int *)(uint)*puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,2); puVar3 = param_2 + 0x24; (**(code **)(*(int *)*writer + 0x1c))(puVar3,2,1); param_3 = (int *)(uint)*puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,2); puVar3 = param_2 + 0x26; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x2a; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x2c; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x2e; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x30; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); puVar3 = param_2 + 0x32; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(writer + 3,(byte *)¶m_3,4); local_8 = 0; do { puVar1 = (uint *)(*(int *)(param_2 + 0x34) + local_8); gridEntityType = *puVar1; param_3 = (int *)(gridEntityType & 0xffff); (**(code **)(*(int *)*writer + 0x1c))(¶m_3,2,1); gridTypeShort = (uint)param_3 & 0xffff; Checksum::Update(writer + 3,(byte *)&gridTypeShort,2); if (gridEntityType != 0) { (**(code **)(*(int *)*writer + 0x1c))(puVar1 + 1,4,1); param_3 = (int *)puVar1[1]; Checksum::Update(writer + 3,(byte *)¶m_3,4); (**(code **)(*(int *)*writer + 0x1c))(puVar1 + 2,4,1); param_3 = (int *)puVar1[2]; Checksum::Update(writer + 3,(byte *)¶m_3,4); param_1 = (uint)(ushort)puVar1[3]; (**(code **)(*(int *)*writer + 0x1c))(¶m_1,2,1); param_3 = (int *)(param_1 & 0xffff); Checksum::Update(writer + 3,(byte *)¶m_3,2); (**(code **)(*(int *)*writer + 0x1c))(puVar1 + 4,4,1); param_3 = (int *)puVar1[4]; Checksum::Update(writer + 3,(byte *)¶m_3,4); (**(code **)(*(int *)*writer + 0x1c))(puVar1 + 7,4,1); param_3 = (int *)puVar1[7]; Checksum::Update(writer + 3,(byte *)¶m_3,4); (**(code **)(*(int *)*writer + 0x1c))(puVar1 + 5,4,1); param_3 = (int *)puVar1[5]; Checksum::Update(writer + 3,(byte *)¶m_3,4); } puVar3 = param_2; local_8 = local_8 + 0x20; } while (local_8 < 0x3800); savedEntityCount = (*(int *)(param_2 + 0x3c) - *(int *)(param_2 + 0x3a)) / 0x78; (**(code **)(*(int *)*writer + 0x1c))(&savedEntityCount,4,1); param_3 = (int *)savedEntityCount; Checksum::Update(writer + 3,(byte *)¶m_3,4); param_3 = (int *)0x0; if (savedEntityCount != 0) { saveStateOffset = 0; do { write_entity_save_state((void *)(*(int *)(puVar3 + 0x3a) + saveStateOffset),writer); saveStateOffset = saveStateOffset + 0x78; param_3 = (int *)((int)param_3 + 1); } while (param_3 < savedEntityCount); } puVar2 = writer + 3; restrictedGridCount = *(undefined4 *)(puVar3 + 0x42); (**(code **)(*(int *)*writer + 0x1c))(&restrictedGridCount,4,1); param_3 = (int *)restrictedGridCount; Checksum::Update(puVar2,(byte *)¶m_3,4); param_3 = (int *)**(int **)(puVar3 + 0x40); if (param_3 != *(int **)(puVar3 + 0x40)) { do { puVar1 = (uint *)((int)param_3 + 0x10); (**(code **)(*(int *)*writer + 0x1c))(puVar1,4,1); param_1 = *puVar1; Checksum::Update(puVar2,(byte *)¶m_1,4); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_3); puVar3 = param_2; } while (param_3 != (int *)*(int *)(param_2 + 0x40)); } savedEffectCount = (*(int *)(puVar3 + 0x46) - *(int *)(puVar3 + 0x44)) / 0x78; (**(code **)(*(int *)*writer + 0x1c))(&savedEffectCount,4,1); param_3 = (int *)savedEffectCount; Checksum::Update(puVar2,(byte *)¶m_3,4); param_3 = (int *)0x0; if (savedEffectCount != 0) { saveStateOffset = 0; do { write_entity_save_state((void *)(*(int *)(puVar3 + 0x44) + saveStateOffset),writer); saveStateOffset = saveStateOffset + 0x78; param_3 = (int *)((int)param_3 + 1); } while (param_3 < savedEffectCount); } puVar2 = writer + 3; (**(code **)(*(int *)*writer + 0x1c))(puVar3 + 0x57,2,1); param_3 = (int *)(uint)puVar3[0x57]; Checksum::Update(puVar2,(byte *)¶m_3,2); puVar3 = param_2 + 0x56; (**(code **)(*(int *)*writer + 0x1c))(puVar3,2,1); param_3 = (int *)(uint)*puVar3; Checksum::Update(puVar2,(byte *)¶m_3,2); puVar3 = param_2 + 0x4a; (**(code **)(*(int *)*writer + 0x1c))(puVar3,2,8); Checksum::Update(puVar2,(byte *)puVar3,0x10); puVar3 = param_2 + 0x52; (**(code **)(*(int *)*writer + 0x1c))(puVar3,1,8); Checksum::Update(puVar2,(byte *)puVar3,8); puVar3 = param_2 + 0x5a; (**(code **)(*(int *)*writer + 0x1c))(puVar3,4,1); param_3 = *(int **)puVar3; Checksum::Update(puVar2,(byte *)¶m_3,4); puVar3 = param_2 + 0x29; (**(code **)(*(int *)*writer + 0x1c))(puVar3,2,1); param_2 = (ushort *)(uint)*puVar3; Checksum::Update(puVar2,(byte *)¶m_2,2); return 1; } //@@ 009c9340 GameState::write /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool GameState::write(GameStateIO** gameStateIO); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall GameState::write(GameState *this,void **gameStateIO) { int iVar1; uint blobLength; short emptyRun; std_string *seedStrBuf; int listBytes; uint *puVar3; undefined1 *fieldPtr; int *piVar4; undefined4 *dwordPtr; GameState *state; byte *stageBlock; undefined1 *puVar5; void **checksumState; uint encodedChecksum; int *pairCount; byte blockFlag; byte flagByte; uint *local_460; int *local_45c; GameState *self; byte tmpByte; int *local_450; byte local_44c [4]; std_string *local_448 [3]; std_string *local_43c [2]; std_string *local_434; ushort packedList [510]; byte headerText [16]; byte bitmask [12]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; ushort blobLength; void *checksum; byte pendingByteCount; local_8 = 0xffffffff; puStack_c = &LAB_00b0f2d0; local_10 = ExceptionList; blobLength = __security_cookie ^ (uint)(bitmask + 0x20); ExceptionList = &local_10; self = this; local_18 = blobLength; sprintf(headerText,(byte *)"ISAACNG_GSR%04u"); (**(code **)(*(int *)this->_saveFile + 0x1c))(headerText,1,0x10,blobLength); (**(code **)(*(int *)*gameStateIO + 0x1c))(this,4,1); local_450 = *(int **)this; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); (**(code **)(*(int *)*gameStateIO + 0x1c))(&this->field_0x4,1,1); local_44c[0] = this->field_0x4; Checksum::Update(gameStateIO + 3,local_44c,1); state = self; flagByte = self->field_0x1e724; (**(code **)(*(int *)*gameStateIO + 0x1c))(&flagByte,1,1); local_44c[0] = flagByte; Checksum::Update(gameStateIO + 3,local_44c,1); (**(code **)(*(int *)*gameStateIO + 0x1c))(&state->field_0x5,1,1); local_44c[0] = state->field_0x5; Checksum::Update(gameStateIO + 3,local_44c,1); fieldPtr = &self->field_0x8; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xc; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,2,1); local_450 = (int *)(uint)*(ushort *)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,2); blobLength = *(ushort *)fieldPtr; fieldPtr = &self->field_0xe; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,(uint)blobLength); Checksum::Update(gameStateIO + 3,fieldPtr,(uint)blobLength); fieldPtr = &self->field_0x44; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x48; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x4c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x50; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x54; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x58; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x5c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x60; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x64; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x68; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x6c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x70; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x74; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x78; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x7c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x80; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xdc; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xe0; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x84; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(gameStateIO + 3,local_44c,1); fieldPtr = &self->field_0x88; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); state = self; write_score_sheet(gameStateIO); (**(code **)(*(int *)*gameStateIO + 0x1c))(&state->field_0xe4,4,1); local_450 = *(int **)&state->field_0xe4; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xe8; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xec; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xf0; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xf4; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xf8; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0xfc; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x100; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); fieldPtr = &self->field_0x104; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(gameStateIO + 3,local_44c,1); fieldPtr = &self->field_0x105; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(gameStateIO + 3,local_44c,1); fieldPtr = &self->field_0x106; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(gameStateIO + 3,local_44c,1); fieldPtr = &self->field_0x107; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(gameStateIO + 3,local_44c,1); fieldPtr = &self->field_0x108; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,2,1); local_450 = (int *)(uint)*(ushort *)fieldPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,2); blobLength = *(ushort *)fieldPtr; fieldPtr = &self->field_0x10a; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,(uint)blobLength); checksumState = gameStateIO + 3; Checksum::Update(checksumState,fieldPtr,(uint)blobLength); fieldPtr = &self->field_0x124; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x128; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,0xc); Checksum::Update(checksumState,fieldPtr,0x30); fieldPtr = &self->field_0x158; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x15c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x160; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); dwordPtr = (undefined4 *)&self->field_0x164; local_45c = (int *)0xe; do { (**(code **)(*(int *)*gameStateIO + 0x1c))(dwordPtr,4,1); local_450 = (int *)*dwordPtr; Checksum::Update(checksumState,(byte *)&local_450,4); state = self; dwordPtr = dwordPtr + 1; local_45c = (int *)((int)local_45c + -1); } while (local_45c != (int *)0x0); local_45c = *(int **)&self->field_0x1952c; (**(code **)(*(int *)*gameStateIO + 0x1c))(&local_45c,4,1); local_450 = local_45c; Checksum::Update(checksumState,(byte *)&local_450,4); if (*(int *)&state->field_0x1952c != 0) { blobLength = 0; do { local_434 = *(std_string **)&state->field_0x19528; write_entry(gameStateIO); blobLength = blobLength + 1; } while (blobLength < *(uint *)&state->field_0x1952c); } local_460 = (uint *)&state->field_0x19c; (**(code **)(*(int *)*gameStateIO + 0x1c))(local_460,4,1); local_450 = *(int **)&state->field_0x19c; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); local_45c = (int *)0x0; if (*(int *)&state->field_0x19c != 0) { fieldPtr = &state->field_0x1a0; puVar5 = &state->field_0x17c68; do { write_room(puVar5,fieldPtr,gameStateIO); fieldPtr = fieldPtr + 0xb8; local_45c = (int *)((int)local_45c + 1); puVar5 = puVar5 + 0xc; } while (local_45c < (int *)*local_460); state = self; } fieldPtr = &state->field_0x16e08; local_45c = (int *)0x14; puVar5 = &state->field_0x1942c; local_450 = (int *)fieldPtr; do { write_room(puVar5,fieldPtr,gameStateIO); fieldPtr = fieldPtr + 0xb8; puVar5 = puVar5 + 0xc; local_45c = (int *)((int)local_45c + -1); } while (local_45c != (int *)0x0); puVar3 = (uint *)0x0; emptyRun = 0; local_460 = (uint *)0x0; piVar4 = (int *)&self->field_0x19530; local_45c = (int *)0x1fb; do { iVar1 = *piVar4; if (iVar1 < 0) { emptyRun = emptyRun + 1; } else { if (emptyRun != 0) { blobLength = (uint)puVar3 & 0xffff; puVar3 = (uint *)((int)puVar3 + 1); packedList[blobLength] = emptyRun - 1U | 0x8000; emptyRun = 0; } blobLength = (uint)puVar3 & 0xffff; puVar3 = (uint *)((int)puVar3 + 1); packedList[blobLength] = (ushort)iVar1; local_460 = puVar3; } piVar4 = piVar4 + 1; checksumState = gameStateIO + 3; local_45c = (int *)((int)local_45c + -1); } while (local_45c != (int *)0x0); if (emptyRun != 0) { local_460 = (uint *)((int)puVar3 + 1); packedList[(uint)puVar3 & 0xffff] = emptyRun - 1U | 0x8000; } (**(code **)(*(int *)*gameStateIO + 0x1c))(&local_460,2,1); local_450 = (int *)((uint)local_460 & 0xffff); Checksum::Update(checksumState,(byte *)&local_450,2); blobLength = (uint)local_460 & 0xffff; (**(code **)(*(int *)*gameStateIO + 0x1c))(packedList,2,blobLength); Checksum::Update(checksumState,(byte *)packedList,blobLength * 2); fieldPtr = &self->field_0x19d1c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d2c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d2d; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d20; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d24; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d28; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d30; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d34; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d38; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d3c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d40; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d48; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d44; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d4c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d50; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d54; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d58; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d60; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d64; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d5c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d68; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); fieldPtr = &self->field_0x19d6c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d70; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x19d74; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,1,1); local_44c[0] = *fieldPtr; Checksum::Update(checksumState,local_44c,1); state = self; tmpByte = self->field_0x19d78; (**(code **)(*(int *)*gameStateIO + 0x1c))(&tmpByte,1,1); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); local_45c = (int *)0x0; if (0 < *(int *)&state->field_0x19d78) { do { write_player(gameStateIO); local_45c = (int *)((int)local_45c + 1); } while ((int)local_45c < *(int *)&state->field_0x19d78); } checksumState = gameStateIO + 3; tmpByte = 4; (**(code **)(*(int *)*gameStateIO + 0x1c))(&tmpByte,1,1); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); local_45c = (int *)&state->field_0x1cc5c; local_460 = (uint *)0x4; do { if (*local_45c == -1) { tmpByte = 0; (**(code **)(*(int *)*gameStateIO + 0x1c))(); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); } else { tmpByte = 1; (**(code **)(*(int *)*gameStateIO + 0x1c))(&tmpByte,1,1); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); write_player(gameStateIO); } local_45c = local_45c + 0x177; local_460 = (uint *)((int)local_460 + -1); } while (local_460 != (uint *)0x0); write_item_pool(gameStateIO); blobLength = *(uint *)&state->field_0x1e728; if (blobLength == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); blobLength = *(uint *)&state->field_0x1e728; } Seeds::Seed2String((std_string *)local_448,blobLength); local_8 = 0; seedStrBuf = (std_string *)local_448; if (0xf < local_434) { seedStrBuf = local_448[0]; } (**(code **)(*(int *)*gameStateIO + 0x1c))(seedStrBuf,1,9); Checksum::Update(checksumState,(byte *)seedStrBuf,9); local_8 = 0xffffffff; if (0xf < local_434) { blobLength = (int)local_434 + 1; seedStrBuf = local_448[0]; if (0xfff < blobLength) { seedStrBuf = (std_string *)local_448[0][-1]._capacity; blobLength = (int)local_434 + 0x24; if (0x1f < (uint)((int)local_448[0] + (-4 - (int)seedStrBuf))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(seedStrBuf,blobLength); } state = self; bitmask[0] = 0; bitmask[1] = 0; bitmask[2] = 0; bitmask[3] = 0; bitmask[4] = 0; bitmask[5] = 0; bitmask[6] = 0; bitmask[7] = 0; piVar4 = (int *)0x0; bitmask[8] = 0; bitmask[9] = 0; do { local_450 = piVar4; std::set::find_node(local_448 + 3,&local_450); if (((*(char *)((int)local_434 + 0xd) == '\0') && (*(int *)((int)local_434 + 0x10) <= (int)piVar4)) && (local_434 != (std_string *)*(uint *)&state->field_0x1e778)) { bitmask[(uint)piVar4 >> 3] = bitmask[(uint)piVar4 >> 3] | (byte)(1 << ((uint)piVar4 & 7)); } piVar4 = (int *)((int)piVar4 + 1); } while (piVar4 < (int *)0x50); (**(code **)(*(int *)*gameStateIO + 0x1c))(&DAT_00b7f865,1,1); local_44c[0] = 10; checksumState = gameStateIO + 3; Checksum::Update(checksumState,local_44c,1); (**(code **)(*(int *)*gameStateIO + 0x1c))(bitmask,1,10); Checksum::Update(checksumState,bitmask,10); fieldPtr = &self->field_0x1e780; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x1e784; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); fieldPtr = &self->field_0x1e788; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); state = self; pairCount = (int *)(*(int *)&self->field_0x1e7a0 - *(int *)&self->field_0x1e79c >> 3); (**(code **)(*(int *)*gameStateIO + 0x1c))(&pairCount,4,1); local_450 = pairCount; Checksum::Update(checksumState,(byte *)&local_450,4); local_45c = (int *)0x0; if (*(int *)&state->field_0x1e7a0 - *(int *)&state->field_0x1e79c >> 3 != 0) { do { iVar1 = (int)local_45c * 8; dwordPtr = (undefined4 *)(*(int *)&state->field_0x1e79c + iVar1); (**(code **)(*(int *)*gameStateIO + 0x1c))(dwordPtr,4,1); local_450 = (int *)*dwordPtr; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); piVar4 = (int *)(*(int *)&self->field_0x1e79c + 4 + iVar1); (**(code **)(*(int *)*gameStateIO + 0x1c))(piVar4,4,1); local_450 = (int *)*piVar4; Checksum::Update(gameStateIO + 3,(byte *)&local_450,4); local_45c = (int *)((int)local_45c + 1); state = self; } while (local_45c < (int *)(*(int *)&self->field_0x1e7a0 - *(int *)&self->field_0x1e79c >> 3)); } checksumState = gameStateIO + 3; local_460 = (uint *)&state->field_0x1e680; write_bool_vector(); local_45c = (int *)0x25; (**(code **)(*(int *)*gameStateIO + 0x1c))(&local_45c,2,1); local_450 = (int *)((uint)local_45c & 0xffff); Checksum::Update(checksumState,(byte *)&local_450,2); local_45c = (int *)0x25; puVar3 = local_460; do { (**(code **)(*(int *)*gameStateIO + 0x1c))(puVar3,4,1); local_450 = (int *)*puVar3; Checksum::Update(checksumState,(byte *)&local_450,4); puVar3 = puVar3 + 1; local_45c = (int *)((int)local_45c + -1); } while (local_45c != (int *)0x0); fieldPtr = &self->field_0x1e78c; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,4,1); local_450 = *(int **)fieldPtr; Checksum::Update(checksumState,(byte *)&local_450,4); state = self; piVar4 = *(int **)&self->field_0x1e794; local_45c = (int *)&self->field_0x1e790; if ((uint)(((int)piVar4 - *local_45c) / 0xc) < 0x100) { local_450 = piVar4; } else { local_450 = piVar4; vector12_resize(0xff); piVar4 = *(int **)&state->field_0x1e794; } tmpByte = (byte)(((int)piVar4 - *(int *)&state->field_0x1e790) / 0xc); (**(code **)(*(int *)*gameStateIO + 0x1c))(&tmpByte,1,1); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); listBytes = *(int *)&state->field_0x1e794 - *(int *)&state->field_0x1e790; local_450 = (int *)0x0; iVar1 = listBytes >> 0x1f; if (listBytes / 0xc + iVar1 != iVar1) { local_460 = (uint *)0x0; do { puVar3 = (uint *)(*local_45c + (int)local_460); (**(code **)(*(int *)*gameStateIO + 0x1c))(puVar3,4,1); local_434 = (std_string *)*puVar3; Checksum::Update(checksumState,(byte *)(local_448 + 5),4); puVar3 = (uint *)((int)local_460 + *local_45c + 4); (**(code **)(*(int *)*gameStateIO + 0x1c))(puVar3,4,1); local_434 = (std_string *)*puVar3; Checksum::Update(checksumState,(byte *)(local_448 + 5),4); puVar3 = (uint *)((int)local_460 + *local_45c + 8); (**(code **)(*(int *)*gameStateIO + 0x1c))(puVar3,4,1); local_434 = (std_string *)*puVar3; Checksum::Update(checksumState,(byte *)(local_448 + 5),4); local_460 = local_460 + 3; local_450 = (int *)((int)local_450 + 1); } while (local_450 < (int *)((local_45c[1] - *local_45c) / 0xc)); state = self; } local_450 = (int *)(uint)*(ushort *)&state->field_0x1e7a8; (**(code **)(*(int *)*gameStateIO + 0x1c))(&local_450,2,1); local_434 = (std_string *)((uint)local_450 & 0xffff); Checksum::Update(checksumState,(byte *)(local_448 + 5),2); local_450 = (int *)(uint)*(ushort *)&state->field_0x1e7ac; (**(code **)(*(int *)*gameStateIO + 0x1c))(&local_450,2,1); local_434 = (std_string *)((uint)local_450 & 0xffff); Checksum::Update(checksumState,(byte *)(local_448 + 5),2); (**(code **)(*(int *)*gameStateIO + 0x1c))(&state->field_0x1e7b0,1,1); local_44c[0] = state->field_0x1e7b0; Checksum::Update(checksumState,local_44c,1); stageBlock = &self->field_0x1ead0; local_450 = (int *)0x7; do { blockFlag = stageBlock[-4]; (**(code **)(*(int *)*gameStateIO + 0x1c))(&blockFlag,1,1); local_44c[0] = blockFlag; Checksum::Update(checksumState,local_44c,1); tmpByte = stageBlock[-0xc]; (**(code **)(*(int *)*gameStateIO + 0x1c))(&tmpByte,1,1); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); local_44c[0] = 0; if ('\0' < (char)tmpByte) { do { write_room(stageBlock + (char)local_44c[0] * 0xc + -0x1ac, stageBlock + (char)local_44c[0] * 0xb8 + -0x31c,gameStateIO); local_44c[0] = local_44c[0] + 1; } while ((char)local_44c[0] < (char)tmpByte); } tmpByte = stageBlock[-8]; (**(code **)(*(int *)*gameStateIO + 0x1c))(&tmpByte,1,1); local_44c[0] = tmpByte; Checksum::Update(checksumState,local_44c,1); local_44c[0] = 0; if ('\0' < (char)tmpByte) { do { write_room(stageBlock + ((char)local_44c[0] + -3) * 0xc, stageBlock + (char)local_44c[0] * 0xb8 + -0x194,gameStateIO); local_44c[0] = local_44c[0] + 1; } while ((char)local_44c[0] < (char)tmpByte); } (**(code **)(*(int *)*gameStateIO + 0x1c))(stageBlock,1,1); local_44c[0] = *stageBlock; Checksum::Update(checksumState,local_44c,1); stageBlock = stageBlock + 800; local_450 = (int *)((int)local_450 + -1); } while (local_450 != (int *)0x0); fieldPtr = &self->field_0x1fd94; (**(code **)(*(int *)*gameStateIO + 0x1c))(fieldPtr,2,1); local_434 = (std_string *)(uint)*(ushort *)fieldPtr; Checksum::Update(checksumState,(byte *)(local_448 + 5),2); state = self; write_int_vector(&self->field_0x1fd98); (**(code **)(*(int *)*gameStateIO + 0x1c))(&state->field_0x1fddc,1,1); local_44c[0] = state->field_0x1fddc; Checksum::Update(checksumState,local_44c,1); state = self; write_int_vector(&self->field_0x1fde0); if ((gameStateIO[6] == (void *)0x0) && (pendingByteCount = *(byte *)(gameStateIO + 4), pendingByteCount != 0)) { if (pendingByteCount < 4) { memset((void *)((uint)pendingByteCount + (int)checksumState),0, (uint)(byte)(4 - pendingByteCount)); } *(undefined1 *)(gameStateIO + 4) = 0; gameStateIO[5] = (void *)(((uint)gameStateIO[5] >> 1) + (int)gameStateIO[5] * -0x80000000 + (int)*checksumState); } checksum = gameStateIO[5]; *(void **)&state->field_0x1fda4 = checksum; encodedChecksum = (uint)checksum ^ 0x96696996; (**(code **)(*(int *)state->_saveFile + 0x1c))(&encodedChecksum,4,1); ExceptionList = local_10; return 1; } //@@ 009cad40 FUN_009cad40 void FUN_009cad40(void) { qword qVar1; char cVar2; undefined4 *puVar3; undefined1 *puVar4; GameState *in_ECX; undefined4 *puVar5; qword *pqVar6; undefined1 *puVar7; void *pvStack_24; undefined1 *puStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined1 uStack_14; undefined4 uStack_10; undefined4 uStack_c; GameState::DeleteRerun(in_ECX); if (in_ECX->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x28); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x28; puVar5 = puVar3 + 1; *puVar3 = 0x28; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffd7 < (uint)qVar1); if (puVar5 != (undefined4 *)0x0) { puVar3[2] = 2; puVar3[3] = 0; *puVar5 = IsaacRepentancePlus::SteamCloudFile::vftable; puVar3[5] = 0; puVar3[7] = 0; puVar3[8] = 0; *(undefined2 *)(puVar3 + 9) = 0; goto LAB_009cad95; } } puVar5 = (undefined4 *)0x0; LAB_009cad95: puVar7 = &in_ECX->field_0x1fdf4; in_ECX->_saveFile = puVar5; puVar4 = puVar7; if (0xf < *(uint *)&in_ECX->field_0x1fe08) { puVar4 = *(undefined1 **)puVar7; } cVar2 = FUN_00683930(puVar4,0x100000); if ((cVar2 == '\0') || (cVar2 = (**(code **)(*(int *)in_ECX->_saveFile + 0x30))(), cVar2 == '\0')) { KAGE_LogMessage(1,(byte *)"[warn] GameState::SaveSteamCloud could not open %s for writing.\n"); (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); return; } if (0xf < *(uint *)&in_ECX->field_0x1fe08) { puVar7 = *(undefined1 **)puVar7; } pvStack_24 = in_ECX->_saveFile; uStack_1c = 0; uStack_c = 1; uStack_18 = 0; uStack_14 = 0; uStack_10 = 0xfedcba76; puStack_20 = puVar7; GameState::write(in_ECX,&pvStack_24); (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); return; } //@@ 009caea0 FUN_009caea0 undefined4 FUN_009caea0(void) { qword qVar1; char cVar2; byte bVar3; undefined4 *puVar4; undefined1 *puVar5; GameState *in_ECX; int *piVar6; qword *pqVar7; undefined1 *puVar8; void *pvStack_28; undefined1 *puStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined1 uStack_18; undefined4 uStack_14; undefined4 uStack_10; in_ECX->_isSaveAvailable = 0; in_ECX->_isRerunAvailable = 0; if (in_ECX->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x28); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0x28; piVar6 = puVar4 + 1; *puVar4 = 0x28; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xffffffd7 < (uint)qVar1); if (piVar6 != (int *)0x0) { puVar4[2] = 2; puVar4[3] = 0; *piVar6 = (int)IsaacRepentancePlus::SteamCloudFile::vftable; puVar4[5] = 0; puVar4[7] = 0; puVar4[8] = 0; *(undefined2 *)(puVar4 + 9) = 0; goto LAB_009caefa; } } piVar6 = (int *)0x0; LAB_009caefa: in_ECX->_saveFile = piVar6; puVar8 = &in_ECX->field_0x1fe0c; puVar5 = puVar8; if (0xf < *(uint *)&in_ECX->field_0x1fe20) { puVar5 = *(undefined1 **)puVar8; } cVar2 = (**(code **)(*piVar6 + 0x24))(puVar5); if ((cVar2 == '\0') || (cVar2 = (**(code **)(*(int *)in_ECX->_saveFile + 0x30))(), cVar2 == '\0')) { KAGE_LogMessage(1,(byte *)"SteamCloud could not find or open %s. No Rerun State detected.\n"); return 0; } if (0xf < *(uint *)&in_ECX->field_0x1fe20) { puVar8 = *(undefined1 **)puVar8; } pvStack_28 = in_ECX->_saveFile; uStack_20 = 0; uStack_10 = 1; uStack_1c = 0; uStack_18 = 0; uStack_14 = 0xfedcba76; puStack_24 = puVar8; bVar3 = GameState::read_rerun(in_ECX,&pvStack_28); (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); if (bVar3 == 0) { GameState::DeleteRerun(in_ECX); return 0; } in_ECX->_isRerunAvailable = 1; return 1; } //@@ 009cb020 read_entity_save_state_tree /* DB: ? reads EntitySaveState fields from stream (vtable+0x14) via 00683410, recurses for children (0x78 stride); caller 009cb620 GameState::read_player state read) prototype: db/protos.zhl */ byte __fastcall read_entity_save_state_tree(void *saveState,void *stream) { byte *data; qword qVar1; byte bVar2; uint uVar3; undefined4 *puVar4; void *extraout_EAX; undefined4 *puVar5; void *state; undefined1 *puVar6; qword *pqVar7; int unaff_EDI; undefined1 uStack00000034; int in_stack_0000006c; undefined1 uStack000000af; undefined1 uStack000000e7; undefined1 uStack000000eb; uint uVar8; byte abStack_102 [2]; byte abStack_ea [2]; byte abStack_de [2]; byte abStack_c6 [2]; undefined4 uStack_bc; byte abStack_ae [2]; char cVar9; byte abStack_a2 [2]; byte abStack_96 [2]; byte abStack_8a [2]; byte abStack_7e [2]; byte abStack_72 [2]; byte abStack_66 [2]; byte abStack_5a [2]; byte abStack_4e [2]; byte abStack_42 [6]; undefined4 uStack_3c; byte abStack_2a [2]; undefined4 uStack_28; byte abStack_24 [4]; void *local_20; undefined1 auStack_10 [12]; uStack_3c = 1; local_20 = saveState; (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_24,4); *(undefined4 *)saveState = uStack_28; (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_2a + -6,4); (**(code **)(**(int **)stream + 0x14))(); uStack_3c = *(undefined4 *)(unaff_EDI + 8); Checksum::Update((void *)((int)stream + 0xc),(byte *)&uStack_3c,4); (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_4e + 6,4); (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_5a + 6,4); (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_66 + 6,4); if (0x3a < *(uint *)((int)stream + 8)) { (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_72 + 2,1); } (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_72 + 6,4); puVar6 = auStack_10; if (0x46 < *(uint *)((int)stream + 8)) { (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_72 + 6,4); puVar6 = (undefined1 *)((int)saveState + 0x14); } (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_8a + 2,1); if (0x87 < *(uint *)((int)stream + 8)) { (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_7e + 6,4); } (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_8a + 6,4); cVar9 = '\x04'; (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_96 + 6,4); uStack_bc = puVar6 + 0x52; if (*(uint *)((int)stream + 8) < 0x5b) { uStack_bc = abStack_a2 + 2; (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_ae + 6,1); *(uint *)(puVar6 + 0x52) = (uint)(cVar9 != '\0'); } else { (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_a2 + 6,4); } (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_ae + 6,4); (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_ae + -6,4); if (*(uint *)((int)stream + 8) < 0x47) { (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_ae + 2,8); if (*(int *)uStack_bc == 4) { *(int *)(uStack_bc + 0x10) = in_stack_0000006c; *(undefined1 **)(uStack_bc + 0x14) = &uStack00000034; uStack_bc[0x18] = 0; uStack_bc[0x19] = 0; uStack_bc[0x1a] = 0; uStack_bc[0x1b] = 0; uStack_bc[0x1c] = 0; uStack_bc[0x1d] = 0; uStack_bc[0x1e] = 0; uStack_bc[0x1f] = 0; } } (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_c6 + 6,4); (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_c6 + -6,4); if (0x95 < *(uint *)((int)stream + 8)) { (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_c6 + 2,8); } (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_ea + 6,1); (**(code **)(**(int **)stream + 0x14))(); Checksum::Update((void *)((int)stream + 0xc),abStack_ea + 6,4); uVar8 = 0; (**(code **)(**(int **)stream + 0x14))(puVar6 + 0xea); Checksum::Update((void *)((int)stream + 0xc),abStack_ea + -6,4); uVar3 = *(uint *)((int)stream + 8); if (0x45 < uVar3) { (**(code **)(**(int **)stream + 0x14))(&uStack000000af,2,1); Checksum::Update((void *)((int)stream + 0xc),abStack_ea + -6,2); uVar3 = *(uint *)((int)stream + 8); } if (0x9d < uVar3) { (**(code **)(**(int **)stream + 0x14))(&uStack000000e7,4,1); Checksum::Update((void *)((int)stream + 0xc),abStack_ea + -6,4); uVar3 = *(uint *)((int)stream + 8); } if (0x6b < uVar3) { (**(code **)(**(int **)stream + 0x14))(&uStack000000eb,4,1); Checksum::Update((void *)((int)stream + 0xc),abStack_ea + -6,4); uVar3 = *(uint *)((int)stream + 8); } if (uVar3 < 0x67) { return 1; } (**(code **)(**(int **)stream + 0x14))(abStack_102 + 2,1,1); Checksum::Update((void *)((int)stream + 0xc),abStack_102 + -6,1); bVar2 = (byte)uVar8; if ((uVar8 & 1) != 0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x24); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar5 = (undefined4 *)0x0; } else { qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0x24; puVar5 = puVar4 + 1; *puVar4 = 0x24; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xffffffdb < (uint)qVar1); } EntitySaveState::set_extra_data(puVar5); data = *(byte **)(uStack_bc + 0xf0); (**(code **)(**(int **)stream + 0x14))(data,4,8); Checksum::Update((void *)((int)stream + 0xc),data,0x20); } if ((bVar2 & 2) == 0) { return 1; } if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x7c); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0x7c; *puVar4 = 0x7c; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xffffff83 < (uint)qVar1); if ((EntitySaveState *)(puVar4 + 1) != (EntitySaveState *)0x0) { EntitySaveState::constructor((EntitySaveState *)(puVar4 + 1)); state = extraout_EAX; goto LAB_009cb5dc; } } state = (void *)0x0; LAB_009cb5dc: EntitySaveStateRef::Set(uStack_bc + 0xf8,state); read_entity_save_state_tree(*(void **)(uStack_bc + 0xf8),stream); return 1; } //@@ 009cb620 GameState::read_player /* DB: ? this=GameState (_saveFile at +0x1fe24, version at +0x1fdf0); deserializes a GameStatePlayer record (player type as short, 8-int block at +0x1c, flags +0x44) via GameStateIO vtable slot 5 and checksums each field with the hash helper 0x683410 like GameState::write prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall GameState::read_player(GameState *this,void *unused,void *player,void *stream) { void *stream_00; char isReadFailed; int iVar1; uint uVar2; undefined4 *puVar3; uint *puVar4; void *pvVar5; byte *data; ushort *puVar6; undefined2 *puVar7; uint uStack_60; RNG local_50; undefined1 local_3c [4]; void *tmpInt; void *local_34; void *idSetCount; void *entityStateCount2; void *entityStateCount; GameState *savedState; uint *local_20; ushort tmpShort [4]; undefined1 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f300; local_10 = ExceptionList; uStack_60 = __security_cookie ^ (uint)(tmpShort + 0xc); local_14 = (undefined1 *)&uStack_60; ExceptionList = &local_10; savedState = this; isReadFailed = (**(code **)(*(int *)this->_saveFile + 0x10))(); stream_00 = stream; if (isReadFailed != '\0') { ExceptionList = local_10; return 0; } GameStatePlayer::read_player_key(stream); pvVar5 = player; if (*(uint *)((int)stream_00 + 8) < 0x7d) { (**(code **)(**(int **)stream_00 + 0x14))(player,4,1); stream = *(void **)pvVar5; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar3 = (undefined4 *)((int)pvVar5 + 4); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar3 = (undefined4 *)((int)player + 8); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); iVar1 = 0; pvVar5 = player; } else { (**(code **)(**(int **)stream_00 + 0x14))(tmpShort,2,1); unused = (void *)(uint)tmpShort[0]; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,2); pvVar5 = player; *(int *)player = (int)(short)tmpShort[0]; (**(code **)(**(int **)stream_00 + 0x14))(tmpShort,2,1); unused = (void *)(uint)tmpShort[0]; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,2); *(int *)((int)pvVar5 + 4) = (int)(short)tmpShort[0]; (**(code **)(**(int **)stream_00 + 0x14))(tmpShort,2,1); unused = (void *)(uint)tmpShort[0]; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,2); *(int *)((int)pvVar5 + 8) = (int)(short)tmpShort[0]; (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); iVar1 = (int)stream._3_1_; } *(int *)((int)pvVar5 + 0xc) = iVar1; (**(code **)(**(int **)stream_00 + 0x14))(&local_34,4,1); stream = local_34; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); *(uint *)((int)pvVar5 + 0x18) = (uint)local_34 & 0xff; local_50._shift3 = 0; (**(code **)(**(int **)stream_00 + 0x14))((byte *)((int)pvVar5 + 0x1c),4,8); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)((int)pvVar5 + 0x1c),0x20); puVar3 = (undefined4 *)((int)player + 0x3c); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar3 = (undefined4 *)((int)player + 0x40); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); pvVar5 = player; local_20 = (uint *)((int)player + 0x44); if (*(uint *)&savedState->field_0x1fdf0 < 0x3f) { *local_20 = 0; (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); if (stream._3_1_ != '\0') { *(uint *)((int)pvVar5 + 0x44) = *(uint *)((int)pvVar5 + 0x44) | 1; } (**(code **)(**(int **)stream_00 + 0x14))((ushort *)((int)pvVar5 + 0x4a),4,1); unused = (void *)(uint)*(ushort *)((int)pvVar5 + 0x4a); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,4); (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); puVar4 = local_20; if (stream._3_1_ != '\0') { *local_20 = *local_20 | 2; } (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); if (stream._3_1_ != '\0') { *puVar4 = *puVar4 | 4; } (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); if (stream._3_1_ != '\0') { *puVar4 = *puVar4 | 8; } (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); if (stream._3_1_ != '\0') { *puVar4 = *puVar4 | 0x10; } if (0x3c < *(uint *)((int)stream_00 + 8)) { puVar3 = (undefined4 *)((int)player + 0x4c); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); unused = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,4); } (**(code **)(**(int **)stream_00 + 0x14))((int)&stream + 3,1,1); unused = (void *)CONCAT31(unused._1_3_,stream._3_1_); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,1); if (stream._3_1_ != '\0') { *local_20 = *local_20 | 0x20; } } else { (**(code **)(**(int **)stream_00 + 0x14))(local_20,4); stream = *(void **)((int)pvVar5 + 0x44); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); stream = *(void **)(**(int **)stream_00 + 0x14); if (*(uint *)&savedState->field_0x1fdf0 < 0x82) { (*stream)(&unused,4,1); stream = unused; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); *(undefined2 *)((int)pvVar5 + 0x4a) = unused._0_2_; *(undefined2 *)((int)pvVar5 + 0x48) = 0; } else { (*stream)((int)pvVar5 + 0x4a,2); stream = (void *)(uint)*(ushort *)((int)pvVar5 + 0x4a); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,2); (**(code **)(**(int **)stream_00 + 0x14))((int)pvVar5 + 0x48,2,1); stream = (void *)(uint)*(ushort *)((int)pvVar5 + 0x48); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,2); } (**(code **)(**(int **)stream_00 + 0x14))((undefined4 *)((int)pvVar5 + 0x4c),4,1); stream = *(void **)((int)pvVar5 + 0x4c); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); } puVar3 = (undefined4 *)((int)player + 0x54); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar3 = (undefined4 *)((int)player + 0x58); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar3 = (undefined4 *)((int)player + 0x5c); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); pvVar5 = player; (**(code **)(**(int **)stream_00 + 0x14))((int)player + 0x60,4,1); stream = *(void **)((int)pvVar5 + 0x60); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); if (*(uint *)((int)stream_00 + 8) < 0x4b) { if (*(int *)((int)pvVar5 + 0x60) == 0) { uVar2 = 0; } else { local_50._shift1 = 0xb; local_50._shift2 = 7; local_50._shift3 = 0xc; local_50._seed = *(int *)((int)pvVar5 + 0x60); uVar2 = RNG::Next(&local_50); } *(uint *)((int)pvVar5 + 100) = uVar2; } else { (**(code **)(**(int **)stream_00 + 0x14))((undefined4 *)((int)pvVar5 + 100),4,1); stream = *(void **)((int)pvVar5 + 100); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); pvVar5 = player; } local_50._shift3 = 0; do { local_20 = (uint *)(*(int *)((int)pvVar5 + 0x68) + local_50._shift3); if (*(uint *)((int)stream_00 + 8) < 0x7b) { (**(code **)(**(int **)stream_00 + 0x14))(&tmpInt,4,1); stream = tmpInt; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); *local_20 = (uint)tmpInt; puVar4 = local_20 + 1; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar4 = local_20 + 2; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar4 = local_20 + 3; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar4 = local_20 + 4; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar4 = local_20 + 6; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,1,1); stream = (void *)CONCAT31(stream._1_3_,(char)*puVar4); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,1); puVar4 = local_20 + 7; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); if (0x20 < *(uint *)&savedState->field_0x1fdf0) goto LAB_009cbd8f; LAB_009cbdb4: pvVar5 = player; } else { (**(code **)(**(int **)stream_00 + 0x14))(&unused,2,1); stream = (void *)((uint)unused & 0xffff); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,2); *local_20 = (uint)unused & 0xffff; if (((uint)unused & 0xffff) != 0) { puVar4 = local_20 + 1; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar4 = local_20 + 2; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); (**(code **)(**(int **)stream_00 + 0x14))(tmpShort,2,1); stream = (void *)(uint)tmpShort[0]; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,2); local_20[3] = (uint)tmpShort[0]; puVar4 = local_20 + 4; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); puVar4 = local_20 + 7; *(bool *)(local_20 + 6) = 0 < (int)local_20[3]; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); LAB_009cbd8f: puVar4 = local_20 + 5; (**(code **)(**(int **)stream_00 + 0x14))(puVar4,4,1); stream = (void *)*puVar4; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); goto LAB_009cbdb4; } } local_50._shift3 = local_50._shift3 + 0x20; if ((void *)0x37ff < (uint)local_50._shift3) { (**(code **)(**(int **)stream_00 + 0x14))(&entityStateCount,4,1); stream = entityStateCount; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); local_8 = 0; std::vector::resize(entityStateCount); local_8 = 0xffffffff; unused = (void *)0x0; if (entityStateCount != (void *)0x0) { stream = (void *)0x0; do { isReadFailed = (**(code **)(*(int *)savedState->_saveFile + 0x10))(); if (isReadFailed != '\0') { ExceptionList = local_10; return 0; } read_entity_save_state_tree ((void *)(*(int *)((int)pvVar5 + 0x74) + (int)stream),stream_00); stream = (void *)((int)stream + 0x78); unused = (void *)((int)unused + 1); } while (unused < entityStateCount); } (**(code **)(**(int **)stream_00 + 0x14))(&idSetCount,4,1); stream = idSetCount; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); unused = (void *)((int)pvVar5 + 0x80); iVar1 = *(int *)unused; FID_conflict__Erase_tree_>_> (unused,unused,*(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; pvVar5 = (void *)0x0; *(undefined4 *)((int)unused + 4) = 0; if (idSetCount != (void *)0x0) { do { isReadFailed = (**(code **)(*(int *)savedState->_saveFile + 0x10))(); if (isReadFailed != '\0') { ExceptionList = local_10; return 0; } (**(code **)(**(int **)stream_00 + 0x14))(&stream,4,1); local_50._shift3 = (int)stream; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&local_50._shift3,4); std::set::insert(local_3c,&stream); pvVar5 = (void *)((int)pvVar5 + 1); } while (pvVar5 < idSetCount); } (**(code **)(**(int **)stream_00 + 0x14))(&entityStateCount2,4,1); stream = entityStateCount2; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); pvVar5 = player; local_8 = 2; std::vector::resize(entityStateCount2); local_8 = 0xffffffff; unused = (void *)0x0; if (entityStateCount2 != (void *)0x0) { stream = (void *)0x0; do { isReadFailed = (**(code **)(*(int *)savedState->_saveFile + 0x10))(); if (isReadFailed != '\0') { ExceptionList = local_10; return 0; } read_entity_save_state_tree ((void *)(*(int *)((int)pvVar5 + 0x88) + (int)stream),stream_00); stream = (void *)((int)stream + 0x78); unused = (void *)((int)unused + 1); } while (unused < entityStateCount2); } stream = *(void **)(**(int **)stream_00 + 0x14); if (*(uint *)&savedState->field_0x1fdf0 < 0x49) { (*stream)(&player,4,1); stream = player; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); *(undefined2 *)((int)pvVar5 + 0xae) = player._0_2_; (**(code **)(**(int **)stream_00 + 0x14))(&player,4,1); stream = player; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); *(undefined2 *)((int)pvVar5 + 0xac) = player._0_2_; stream = &DAT_00000008; puVar7 = (undefined2 *)((int)pvVar5 + 0x94); do { (**(code **)(**(int **)stream_00 + 0x14))(&player,4,1); unused = player; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&unused,4); stream = (void *)((int)stream + -1); *puVar7 = player._0_2_; puVar7 = puVar7 + 1; } while (stream != (void *)0x0); } else { (*stream)((int)pvVar5 + 0xae,2); stream = (void *)(uint)*(ushort *)((int)pvVar5 + 0xae); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,2); (**(code **)(**(int **)stream_00 + 0x14))((int)pvVar5 + 0xac,2,1); stream = (void *)(uint)*(ushort *)((int)pvVar5 + 0xac); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,2); (**(code **)(**(int **)stream_00 + 0x14))((byte *)((int)pvVar5 + 0x94),2,8); Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)((int)pvVar5 + 0x94),0x10); if (0x54 < *(uint *)&savedState->field_0x1fdf0) { data = (byte *)((int)player + 0xa4); (**(code **)(**(int **)stream_00 + 0x14))(data,1,8); Checksum::Update((void *)((int)stream_00 + 0xc),data,8); } puVar3 = (undefined4 *)((int)player + 0xb4); (**(code **)(**(int **)stream_00 + 0x14))(puVar3,4,1); stream = (void *)*puVar3; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&stream,4); if (0x67 < *(uint *)&savedState->field_0x1fdf0) { puVar6 = (ushort *)((int)player + 0x52); (**(code **)(**(int **)stream_00 + 0x14))(puVar6,2,1); player = (void *)(uint)*puVar6; Checksum::Update((void *)((int)stream_00 + 0xc),(byte *)&player,2); ExceptionList = local_10; return 1; } } ExceptionList = local_10; return 1; } } while( true ); } //@@ 009cc16c Catch_All@009cc16c undefined4 Catch_All_009cc16c(void) { return 0x9cc178; } //@@ 009cc172 Catch_All@009cc172 undefined4 Catch_All_009cc172(void) { return 0x9cc178; } //@@ 009cc1a0 GameState::read /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: "ISAACNG_GSR%u" */ byte GameState::read(int *param_1,char param_2) { ushort uVar1; undefined8 *puVar2; Seeds *pSVar3; char cVar4; byte bVar5; int iVar6; uint uVar7; Seeds **ppSVar8; void *pvVar9; Seeds *pSVar10; uint uVar11; GameState *in_ECX; byte *pbVar12; int iVar13; undefined1 *puVar14; uint fieldOffset; uint *puVar15; undefined4 *puVar16; int *reader; GameState *state; bool bVar17; undefined1 auStack_6e8 [12]; Seeds *pSStack_6dc; Seeds *pSStack_6d8; Seeds *pSStack_6d4; Seeds *pSStack_6d0; Seeds *pSStack_6c8; Seeds *pSStack_6c4; Seeds *pSStack_6c0; Seeds *pSStack_6bc; Seeds *trailerChecksum; uint storedChecksum; byte bStack_6ad; Seeds *pSStack_6ac; GameState *local_6a8; Seeds *pSStack_6a4; Seeds *pSStack_6a0; Seeds *pSStack_69c; byte bStack_695; int *checksum; undefined4 uStack_690; Seeds *pSStack_688; int *savedReader; byte bStack_67d; byte abStack_67c [4]; undefined1 auStack_678 [360]; undefined1 auStack_510 [12]; undefined1 auStack_504 [32]; undefined1 auStack_4e4 [12]; undefined1 auStack_4d8 [12]; undefined1 auStack_4cc [12]; undefined1 auStack_4c0 [12]; undefined1 auStack_4b4 [28]; ushort auStack_498 [290]; undefined1 auStack_254 [140]; void *pvStack_1c8; undefined1 auStack_178 [212]; void *apvStack_a4 [3]; byte seedEffectFlags [84]; undefined1 local_44 [16]; undefined1 local_34; byte seedString [9]; undefined1 uStack_27; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 uStack_14; int *historyEnd; puStack_20 = seedString + 0x2c; uStack_14 = 0xffffffff; puStack_18 = &LAB_00b0f33b; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(seedString + 0x20); ExceptionList = &local_1c; savedReader = param_1; local_6a8 = in_ECX; (**(code **)(*(int *)in_ECX->_saveFile + 0x14))(local_44,1,0x10,local_24); local_34 = 0; iVar6 = FUN_00837090(local_44,"ISAACNG_GSR%u",&in_ECX->field_0x1fdf0); if (iVar6 < 1) { *(undefined4 *)&in_ECX->field_0x1fdf0 = 0; LAB_009cc232: KAGE_LogMessage(1,(byte *)"[warn] GameState header is incorrect (%u != %u).\n"); (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); Delete(in_ECX); ExceptionList = local_1c; return in_ECX->_isSaveAvailable; } if (0xe < *(int *)&in_ECX->field_0x1fdf0 - 0x9bU) goto LAB_009cc232; KAGE_LogMessage(1,(byte *)"GameState Version Loaded: %u\n"); uVar7 = checksum_stream(in_ECX->_saveFile,0x10,4); *(uint *)&in_ECX->field_0x1fda4 = uVar7; (**(code **)(*(int *)in_ECX->_saveFile + 0xc))(0xfffffffc,2); storedChecksum = 0; (**(code **)(*(int *)in_ECX->_saveFile + 0x14))(&storedChecksum,4,1); (**(code **)(*(int *)in_ECX->_saveFile + 0xc))(0x10,0); storedChecksum = storedChecksum ^ 0x96696996; if ((param_2 != '\0') && ((storedChecksum != *(uint *)&in_ECX->field_0x1fda4 || (*(uint *)&in_ECX->field_0x1fda4 != *(uint *)&(g_manager->_persistentGameData).field_0xf84)))) { KAGE_LogMessage(1,(byte *)"[warn] GameState File %s: Checksum invalid!\n"); ExceptionList = local_1c; return 0; } param_1[2] = *(int *)&in_ECX->field_0x1fdf0; FUN_009d84a0(in_ECX); if (0x32 < *(uint *)&in_ECX->field_0x1fdf0) { FUN_009d8550(&in_ECX->field_0x4); } (**(code **)(*(int *)*param_1 + 0x14))(&bStack_6ad,1,1); checksum = param_1 + 3; abStack_67c[0] = bStack_6ad; Checksum::Update(checksum,abStack_67c,1); pSStack_6ac = (Seeds *)&in_ECX->field_0x1e724; *(byte *)pSStack_6ac = bStack_6ad; FUN_009d8550(&in_ECX->field_0x5); FUN_009d84a0(&in_ECX->field_0x8); puVar14 = &in_ECX->field_0xc; FUN_009d8470(puVar14); pSStack_6a0 = (Seeds *)0x35; ppSVar8 = &pSStack_6a0; if (*(ushort *)puVar14 < 0x36) { ppSVar8 = (Seeds **)puVar14; } uVar1 = *(ushort *)ppSVar8; *(ushort *)puVar14 = uVar1; puVar14 = &local_6a8->field_0xe; (**(code **)(*(int *)*savedReader + 0x14))(puVar14,1,(uint)uVar1); Checksum::Update(checksum,puVar14,(uint)uVar1); reader = savedReader; state = local_6a8; FUN_009d84a0(&local_6a8->field_0x44); FUN_009d84a0(&state->field_0x48); if (0x56 < *(uint *)&state->field_0x1fdf0) { FUN_009d84a0(&state->field_0x4c); } FUN_009d84a0(&state->field_0x50); FUN_009d84a0(&state->field_0x54); FUN_009d84a0(&state->field_0x58); if (0x3f < *(uint *)&state->field_0x1fdf0) { FUN_009d84a0(&state->field_0x5c); } FUN_009d84a0(&state->field_0x60); FUN_009d84a0(&state->field_0x64); uVar7 = *(uint *)&state->field_0x1fdf0; if (0x92 < uVar7) { FUN_009d84a0(&state->field_0x68); uVar7 = *(uint *)&state->field_0x1fdf0; } if (0x9a < uVar7) { FUN_009d84a0(&state->field_0x6c); } FUN_009d84a0(&state->field_0x70); FUN_009d84a0(&state->field_0x74); FUN_009d84a0(&state->field_0x78); uVar7 = *(uint *)&state->field_0x1fdf0; if (0x33 < uVar7) { FUN_009d84a0(&state->field_0x7c); uVar7 = *(uint *)&state->field_0x1fdf0; } if (uVar7 < 0x43) { FUN_009d84a0(&pSStack_69c); pSStack_6a0 = (Seeds *)0x0; if (pSStack_69c != (Seeds *)0x0) { do { cVar4 = (**(code **)(*(int *)state->_saveFile + 0x10))(); if (cVar4 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid history count %d. Save file %s might be corrupt.\n"); ExceptionList = local_1c; return 0; } (**(code **)(*(int *)*reader + 0x14))(&uStack_690,4,1); pSStack_688 = uStack_690; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); (**(code **)(*(int *)*reader + 0x14))(&pSStack_6bc,4,1); pSStack_688 = pSStack_6bc; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); (**(code **)(*(int *)*reader + 0x14))(&pSStack_6c0,4,1); pSStack_688 = pSStack_6c0; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); (**(code **)(*(int *)*reader + 0x14))(&pSStack_6c4,4,1); pSStack_688 = pSStack_6c4; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); (**(code **)(*(int *)*reader + 0x14))(&pSStack_6a4,4,1); pSStack_688 = pSStack_6a4; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); (**(code **)(*(int *)*reader + 0x14))(&pSStack_6c8,4,1); pSStack_688 = pSStack_6c8; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); auStack_6e8._8_4_ = uStack_690; pSStack_6dc = pSStack_6bc; pSStack_6d8 = pSStack_6c0; pSStack_6d4 = pSStack_6c4; auStack_6e8._4_4_ = auStack_6e8._4_4_ & 0xffffff00; auStack_6e8._0_4_ = pSStack_6c8; pSStack_6d0 = pSStack_6a4; if ((int)pSStack_6c8 < 0) { auStack_6e8._0_4_ = g_game->_frameCount; } historyEnd = *(int **)&state->field_0x1a13c; if (historyEnd == *(int **)&state->field_0x1a140) { std::vector<28byte>::_Emplace_reallocate(historyEnd,auStack_6e8); } else { *historyEnd = auStack_6e8._0_4_; historyEnd[1] = auStack_6e8._4_4_; historyEnd[2] = (int)uStack_690; historyEnd[3] = (int)pSStack_6bc; historyEnd[4] = (int)pSStack_6c0; historyEnd[5] = (int)pSStack_6c4; historyEnd[6] = (int)pSStack_6a4; *(int *)&state->field_0x1a13c = *(int *)&state->field_0x1a13c + 0x1c; } pSStack_6a0 = (Seeds *)&pSStack_6a0->field_0x1; } while (pSStack_6a0 < pSStack_69c); } } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x80,4,1); pSStack_688 = *(Seeds **)&state->field_0x80; Checksum::Update(checksum,(byte *)&pSStack_688,4); uVar7 = *(uint *)&state->field_0x1fdf0; if (0x2a < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xdc,4,1); pSStack_688 = *(Seeds **)&state->field_0xdc; Checksum::Update(checksum,(byte *)&pSStack_688,4); uVar7 = *(uint *)&state->field_0x1fdf0; } if (0x2d < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xe0,4,1); pSStack_688 = *(Seeds **)&state->field_0xe0; Checksum::Update(checksum,(byte *)&pSStack_688,4); } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x84,1,1); abStack_67c[0] = state->field_0x84; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x88,4,1); pSStack_688 = *(Seeds **)&state->field_0x88; Checksum::Update(checksum,(byte *)&pSStack_688,4); read_record((uint *)&state->field_0x8c,savedReader); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xe4,4,1); pSStack_688 = *(Seeds **)&state->field_0xe4; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xe8,4,1); pSStack_688 = *(Seeds **)&state->field_0xe8; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xec,4,1); pSStack_688 = *(Seeds **)&state->field_0xec; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xf0,4,1); pSStack_688 = *(Seeds **)&state->field_0xf0; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xf4,4,1); pSStack_688 = *(Seeds **)&state->field_0xf4; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xf8,4,1); pSStack_688 = *(Seeds **)&state->field_0xf8; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0xfc,4,1); pSStack_688 = *(Seeds **)&state->field_0xfc; Checksum::Update(checksum,(byte *)&pSStack_688,4); if (0x20 < *(uint *)&state->field_0x1fdf0) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x100,4,1); pSStack_688 = *(Seeds **)&state->field_0x100; Checksum::Update(checksum,(byte *)&pSStack_688,4); } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x104,1,1); abStack_67c[0] = state->field_0x104; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x105,1,1); abStack_67c[0] = state->field_0x105; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x106,1,1); abStack_67c[0] = state->field_0x106; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x107,1,1); abStack_67c[0] = state->field_0x107; Checksum::Update(checksum,abStack_67c,1); puVar14 = &state->field_0x108; (**(code **)(*(int *)*savedReader + 0x14))(puVar14,2,1); pSStack_688 = (Seeds *)(uint)*(ushort *)puVar14; Checksum::Update(checksum,(byte *)&pSStack_688,2); pSStack_688 = (Seeds *)0x1a; ppSVar8 = &pSStack_688; if (*(ushort *)puVar14 < 0x1b) { ppSVar8 = (Seeds **)puVar14; } uVar1 = *(ushort *)ppSVar8; *(ushort *)puVar14 = uVar1; puVar14 = &local_6a8->field_0x10a; (**(code **)(*(int *)*savedReader + 0x14))(puVar14,1,(uint)uVar1); Checksum::Update(checksum,puVar14,(uint)uVar1); state = local_6a8; puVar14 = &local_6a8->field_0x124; (**(code **)(*(int *)*savedReader + 0x14))(puVar14,4,1); pSStack_688 = *(Seeds **)puVar14; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x128,4,0xc); Checksum::Update(checksum,&state->field_0x128,0x30); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x158,4,1); pSStack_688 = *(Seeds **)&state->field_0x158; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x15c,4,1); pSStack_688 = *(Seeds **)&state->field_0x15c; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x160,4,1); pSStack_688 = *(Seeds **)&state->field_0x160; Checksum::Update(checksum,(byte *)&pSStack_688,4); reader = savedReader; pSStack_69c = (Seeds *)&state->field_0x164; pSStack_6a0 = (Seeds *)((0x50 < (uint)savedReader[2]) + 0xd); do { (**(code **)(*(int *)*reader + 0x14))(pSStack_69c,4,1); pSStack_688 = *(Seeds **)pSStack_69c; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); pSStack_69c = (Seeds *)&pSStack_69c->_gameStartSeed; pSStack_6a0 = (Seeds *)((int)&pSStack_6a0[-1]._seedEffectsCount + 3); } while (pSStack_6a0 != (Seeds *)0x0); if (0x55 < (uint)reader[2]) { (**(code **)(*(int *)*reader + 0x14))(&pSStack_6a0,4,1); pSStack_688 = pSStack_6a0; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); pSVar10 = *(Seeds **)&state->field_0x1952c; pSStack_688 = pSStack_6a0; bVar17 = pSStack_6a0 < pSVar10; if (pSVar10 < pSStack_6a0) { pSStack_6a4 = pSVar10; do { puVar14 = *(undefined1 **)&state->field_0x19524; if (puVar14 <= &pSStack_6a4->field_0x1) { std_deque_growmap(&state->field_0x1951c,(uint)pSStack_6a4); puVar14 = *(undefined1 **)&state->field_0x19524; pSStack_6a4 = *(Seeds **)&state->field_0x1952c; } uVar7 = (uint)(puVar14 + -1) & *(uint *)&state->field_0x19528; *(uint *)&state->field_0x19528 = uVar7; pSStack_6a4 = (Seeds *)((uint)(puVar14 + -1) & (int)pSStack_6a4->_stageSeeds + (uVar7 - 0x18)); iVar6 = *(int *)&state->field_0x19520; if (*(int *)(iVar6 + (int)pSStack_6a4 * 4) == 0) { pvVar9 = operator_new(0xc); *(void **)(*(int *)&state->field_0x19520 + (int)pSStack_6a4 * 4) = pvVar9; iVar6 = *(int *)&state->field_0x19520; } puVar2 = *(undefined8 **)(iVar6 + (int)pSStack_6a4 * 4); *puVar2 = 0; *(undefined4 *)(puVar2 + 1) = 0; pSVar10 = (Seeds *)(*(int *)&state->field_0x1952c + 1); *(Seeds **)&state->field_0x1952c = pSVar10; pSStack_6a4 = pSVar10; } while (pSVar10 < pSStack_688); bVar17 = pSStack_688 < pSVar10; } if (bVar17) { do { pSVar10 = (Seeds *)((int)&pSVar10[-1]._seedEffectsCount + 3); *(Seeds **)&state->field_0x1952c = pSVar10; if (pSVar10 == (Seeds *)0x0) { *(undefined4 *)&state->field_0x19528 = 0; } } while (pSStack_688 < pSVar10); } pSStack_6a4 = (Seeds *)0x0; if (pSVar10 != (Seeds *)0x0) { do { pSStack_688 = *(Seeds **)&state->field_0x19528; GameStatePlayer::read_player_key(reader); pSStack_6a4 = (Seeds *)&pSStack_6a4->field_0x1; } while (pSStack_6a4 < *(undefined1 **)&state->field_0x1952c); } } (**(code **)(*(int *)*reader + 0x14))(&state->field_0x19c,4,1); pSStack_688 = *(Seeds **)&state->field_0x19c; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); uVar7 = reader[2]; if (uVar7 < 0x56) { uStack_690 = (Seeds *)0x89; } else if (uVar7 < 0x6b) { uStack_690 = (Seeds *)0x8f; } else if (uVar7 < 0x6d) { uStack_690 = (Seeds *)0x90; } else if (uVar7 < 0x76) { uStack_690 = (Seeds *)0x91; } else if (uVar7 < 0x7b) { uStack_690 = (Seeds *)0x92; } else if (uVar7 < 0x84) { uStack_690 = (Seeds *)0x164; } else if (uVar7 < 0x94) { uStack_690 = (Seeds *)0x20d; } else { uStack_690 = (Seeds *)(0x20f - (uint)(uVar7 < 0x9a)); } if (0x1fa < *(uint *)&state->field_0x19c) { KAGE_LogMessage(1,(byte *)"[warn] Invalid room count %d. Save file %s might be corrupt.\n"); ExceptionList = local_1c; return 0; } pSStack_69c = (Seeds *)0x0; if (*(uint *)&state->field_0x19c != 0) { pSStack_6a4 = (Seeds *)&state->field_0x17c68; pSStack_6a0 = (Seeds *)&state->field_0x1a0; do { bVar5 = read_player(state,pSStack_6a4,pSStack_6a0,reader); if (bVar5 == 0) goto LAB_009cd058; pSStack_69c = (Seeds *)&pSStack_69c->field_0x1; pSStack_6a0 = pSStack_6a0 + 2; pSStack_6a4 = (Seeds *)&(pSStack_6a4->_rng)._shift1; } while (pSStack_69c < *(undefined1 **)&state->field_0x19c); } pSStack_69c = (Seeds *)0x1fb; if ((Seeds *)0x1fb < uStack_690) { pSStack_6a4 = (Seeds *)&state->field_0x1942c; pSStack_6a0 = (Seeds *)&state->field_0x16e08; do { bVar5 = read_player(state,pSStack_6a4,pSStack_6a0,reader); if (bVar5 == 0) { LAB_009cd058: KAGE_LogMessage(1,(byte *)"[warn] Could not read room #%d. Save file %s might be corrupt.\n" ); ExceptionList = local_1c; return 0; } pSStack_69c = (Seeds *)&pSStack_69c->field_0x1; pSStack_6a0 = pSStack_6a0 + 2; pSStack_6a4 = (Seeds *)&(pSStack_6a4->_rng)._shift1; } while (pSStack_69c < uStack_690); } if ((uint)reader[2] < 0x7b) { (**(code **)(*(int *)*reader + 0x14))(&state->field_0x19530,4,0xa9); Checksum::Update(checksum,&state->field_0x19530,0x2a4); } else { uStack_690 = (Seeds *)0x0; (**(code **)(*(int *)*reader + 0x14))(&uStack_690,2,1); pSStack_688 = (Seeds *)((uint)uStack_690 & 0xffff); Checksum::Update(checksum,(byte *)&pSStack_688,2); uVar7 = (uint)uStack_690 & 0xffff; (**(code **)(*(int *)*savedReader + 0x14))(auStack_498,2,uVar7); Checksum::Update(checksum,(byte *)auStack_498,uVar7 * 2); pSStack_69c = (Seeds *)0x0; uVar7 = 0; fieldOffset = 0x19530; pSStack_688 = uStack_690; pSVar10 = pSStack_688; do { pSVar3 = pSStack_69c; if ((short)uVar7 == 0) { pSStack_688._0_2_ = (ushort)uStack_690; if ((ushort)pSStack_688 <= (ushort)pSStack_69c) goto LAB_009cd14a; pSStack_69c = (Seeds *)&pSStack_69c->field_0x1; uVar11 = (uint)auStack_498[(uint)pSVar3 & 0xffff]; if ((short)auStack_498[(uint)pSVar3 & 0xffff] < 0) { uVar7 = uVar11 & 0x7fff; goto LAB_009cd14a; } } else { uVar7 = uVar7 + 0xffff; LAB_009cd14a: uVar11 = 0xffffffff; } puVar15 = (uint *)(&state->field_0x0 + fieldOffset); fieldOffset = fieldOffset + 4; *puVar15 = uVar11; pSStack_688 = pSVar10; } while (fieldOffset < 0x19d1c); } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d1c,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d1c; Checksum::Update(checksum,(byte *)&pSStack_688,4); uVar7 = savedReader[2]; if (0x7a < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d2c,1,1); abStack_67c[0] = state->field_0x19d2c; Checksum::Update(checksum,abStack_67c,1); uVar7 = savedReader[2]; } if (0x7b < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d2d,1,1); abStack_67c[0] = state->field_0x19d2d; Checksum::Update(checksum,abStack_67c,1); } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d20,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d20; Checksum::Update(checksum,(byte *)&pSStack_688,4); if (0xa4 < (uint)savedReader[2]) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d24,1,1); abStack_67c[0] = state->field_0x19d24; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d28,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d28; Checksum::Update(checksum,(byte *)&pSStack_688,4); } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d30,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d30; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d34,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d34; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d38,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d38; Checksum::Update(checksum,(byte *)&pSStack_688,4); if (0x85 < *(uint *)&state->field_0x1fdf0) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d3c,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d3c; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d40,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d40; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d48,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d48; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d44,1,1); abStack_67c[0] = state->field_0x19d44; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d4c,1,1); abStack_67c[0] = state->field_0x19d4c; Checksum::Update(checksum,abStack_67c,1); } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d50,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d50; Checksum::Update(checksum,(byte *)&pSStack_688,4); uVar7 = *(uint *)&state->field_0x1fdf0; if (0x46 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d54,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d54; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d58,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d58; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d60,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d60; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d64,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d64; Checksum::Update(checksum,(byte *)&pSStack_688,4); uVar7 = *(uint *)&state->field_0x1fdf0; } if (0x86 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d5c,1,1); abStack_67c[0] = state->field_0x19d5c; Checksum::Update(checksum,abStack_67c,1); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d68,1,1); abStack_67c[0] = state->field_0x19d68; Checksum::Update(checksum,abStack_67c,1); uVar7 = *(uint *)&state->field_0x1fdf0; } if (0x47 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d6c,4,1); pSStack_688 = *(Seeds **)&state->field_0x19d6c; Checksum::Update(checksum,(byte *)&pSStack_688,4); } puVar14 = &state->field_0x19d70; (**(code **)(*(int *)*savedReader + 0x14))(puVar14,4,1); pSStack_688 = *(Seeds **)puVar14; Checksum::Update(checksum,(byte *)&pSStack_688,4); iVar6 = *(int *)puVar14; if (((iVar6 < 0) || (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= iVar6)) || ((void *)(iVar6 * 0x148 + (int)(g_manager->_entityConfig)._players._begin) == (void *)0x0)) { KAGE_LogMessage(1,(byte *)"[warn] Invalid starting player type: %d\n"); ExceptionList = local_1c; return 0; } uVar7 = *(uint *)&state->field_0x1fdf0; if (0x32 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x19d74,1,1); abStack_67c[0] = state->field_0x19d74; Checksum::Update(checksum,abStack_67c,1); uVar7 = *(uint *)&state->field_0x1fdf0; } reader = savedReader; if (uVar7 < 0x44) { cVar4 = GameStatePlayer::read(savedReader); if (cVar4 == '\0') { ExceptionList = local_1c; return 0; } } else { (**(code **)(*(int *)*savedReader + 0x14))(&bStack_67d,1,1); abStack_67c[0] = bStack_67d; Checksum::Update(reader + 3,abStack_67c,1); *(int *)&state->field_0x19d78 = (int)(char)bStack_67d; pSStack_6a0 = (Seeds *)0x0; if (0 < (char)bStack_67d) { pSStack_6a4 = (Seeds *)&state->field_0x19d7c; do { cVar4 = GameStatePlayer::read(reader); if (cVar4 == '\0') { KAGE_LogMessage(8,(byte *)"Failed to read player data from gamestate \n"); ExceptionList = local_1c; return 0; } pSStack_6a0 = (Seeds *)&pSStack_6a0->field_0x1; pSStack_6a4 = (Seeds *)(pSStack_6a4[0x10]._stageSeeds + 1); } while ((int)pSStack_6a0 < *(int *)&state->field_0x19d78); } } if (0x8c < *(uint *)&state->field_0x1fdf0) { (**(code **)(*(int *)*reader + 0x14))(&bStack_67d,1,1); abStack_67c[0] = bStack_67d; Checksum::Update(reader + 3,abStack_67c,1); pSStack_688 = (Seeds *)(int)(char)bStack_67d; pSStack_69c = (Seeds *)0x0; if (0 < (int)pSStack_688) { uStack_690 = (Seeds *)&state->field_0x1cc5c; do { (**(code **)(*(int *)*reader + 0x14))(&bStack_67d,1,1); abStack_67c[0] = bStack_67d; Checksum::Update(reader + 3,abStack_67c,1); if (bStack_67d != 0) { if ((int)pSStack_69c < 4) { cVar4 = GameStatePlayer::read(reader); if (cVar4 == '\0') { ExceptionList = local_1c; return 0; } } else { input_state_reset(auStack_678); uStack_14 = 0; GameStatePlayer::read(reader); uStack_14 = 0xffffffff; FID_conflict__Erase_tree_>_> (apvStack_a4, (fuzzer_allocator_> *)apvStack_a4, *(_Tree_node **)((int)apvStack_a4[0] + 4)); operator_delete(apvStack_a4[0],0x18); std::vector<52byte>::_Tidy(); FUN_004b3950(); FID_conflict__Tidy(auStack_178); FUN_007dcd30(); FUN_007dcd30(); FUN_007dcd30(); std::deque::_Tidy(); pvVar9 = pvStack_1c8; pvStack_1c8 = (void *)0x0; operator_delete(pvVar9,8); FID_conflict__Tidy(auStack_254); FUN_004b3950(); std::vector<28byte>::_Tidy(); std::vector<28byte>::_Tidy(); std::vector<52byte>::_Tidy(); std::vector::_Tidy(); std::vector::_Tidy(); FID_conflict__Tidy(auStack_4b4); FID_conflict__Tidy(auStack_4c0); FID_conflict__Tidy(auStack_4cc); FID_conflict__Tidy(auStack_4d8); FID_conflict__Tidy(auStack_4e4); std::vector::_Tidy(); FID_conflict__Tidy(auStack_504); FID_conflict__Tidy(auStack_510); } } uStack_690 = (Seeds *)(uStack_690[0x10]._stageSeeds + 1); pSStack_69c = (Seeds *)&pSStack_69c->field_0x1; } while ((int)pSStack_69c < (int)pSStack_688); } } read_item_pool(); (**(code **)(*(int *)*reader + 0x14))(seedString,1,9); Checksum::Update(reader + 3,seedString,9); pbVar12 = seedString; uStack_27 = 0; pSStack_6d8 = (Seeds *)0x0; pSStack_6d4 = (Seeds *)0xf; auStack_6e8._0_4_ = (void *)0x0; do { bVar5 = *pbVar12; pbVar12 = pbVar12 + 1; } while (bVar5 != 0); std::string::assign(auStack_6e8,seedString,(int)pbVar12 - (int)(seedString + 1)); uStack_14 = 1; uVar7 = Seeds::String2Seed((std_string *)auStack_6e8); Seeds::set_start_seed((Seeds *)&state->field_0x1e724,uVar7); uStack_14 = 0xffffffff; if (0xf < pSStack_6d4) { uVar7 = (int)pSStack_6d4 + 1; pvVar9 = (void *)auStack_6e8._0_4_; if (0xfff < uVar7) { pvVar9 = *(void **)(auStack_6e8._0_4_ + -4); uVar7 = (int)pSStack_6d4 + 0x24; if (0x1f < (uint)(auStack_6e8._0_4_ + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar7); } pSStack_688 = (Seeds *)&state->field_0x1e778; if (*(uint *)&state->field_0x1fdf0 < 0x54) { (**(code **)(*(int *)*reader + 0x14))(seedEffectFlags,1,0x4d); Checksum::Update(reader + 3,seedEffectFlags,0x4d); pSVar3 = pSStack_688; iVar6 = *(int *)pSStack_688; FID_conflict__Erase_tree_>_> (pSStack_688,(fuzzer_allocator_> *)pSStack_688, *(_Tree_node **)(iVar6 + 4)); pSVar10 = pSStack_6ac; *(int *)(iVar6 + 4) = iVar6; *(int *)iVar6 = iVar6; *(int *)(iVar6 + 8) = iVar6; uVar7 = 0; pSVar3->_gameStartSeed = 0; do { if (seedEffectFlags[uVar7] != 0) { Seeds::AddSeedEffect(pSVar10,uVar7); } uVar7 = uVar7 + 1; } while (uVar7 < 0x4d); LAB_009cdc87: state = local_6a8; } else { (**(code **)(*(int *)*reader + 0x14))(&bStack_67d,1,1); abStack_67c[0] = bStack_67d; Checksum::Update(checksum,abStack_67c,1); iVar6 = *(int *)&state->field_0x1e778; FID_conflict__Erase_tree_>_> (&state->field_0x1e778, (fuzzer_allocator_> *)&state->field_0x1e778, *(_Tree_node **)(iVar6 + 4)); *(int *)(iVar6 + 4) = iVar6; *(int *)iVar6 = iVar6; *(int *)(iVar6 + 8) = iVar6; uVar7 = 0; *(undefined4 *)&state->field_0x1e77c = 0; abStack_67c[0] = 0; if (bStack_67d != 0) { do { reader = savedReader; if (0x4f < uVar7) break; (**(code **)(*(int *)*savedReader + 0x14))(&bStack_695,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,bStack_695); Checksum::Update(reader + 3,(byte *)&uStack_690,1); pSVar10 = pSStack_6ac; pSStack_6a0 = (Seeds *)0x0; pSStack_6a4 = (Seeds *)0x1; do { if (0x4f < uVar7) break; if ((bStack_695 & (byte)pSStack_6a4) != 0) { Seeds::AddSeedEffect(pSVar10,uVar7); } pSStack_6a0 = (Seeds *)&pSStack_6a0->field_0x1; pSStack_6a4 = (Seeds *)((int)pSStack_6a4 << 1 | (uint)((int)pSStack_6a4 < 0)); uVar7 = uVar7 + 1; } while ((int)pSStack_6a0 < 8); abStack_67c[0] = abStack_67c[0] + 1; } while (abStack_67c[0] < bStack_67d); goto LAB_009cdc87; } } (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1e780,4,1); pSStack_688 = *(Seeds **)&state->field_0x1e780; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1e784,4,1); pSStack_688 = *(Seeds **)&state->field_0x1e784; Checksum::Update(checksum,(byte *)&pSStack_688,4); (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1e788,4,1); pSStack_688 = *(Seeds **)&state->field_0x1e788; Checksum::Update(checksum,(byte *)&pSStack_688,4); reader = savedReader; if (*(uint *)&state->field_0x1fdf0 < 0x2f) goto LAB_009cdedb; uStack_690 = (Seeds *)0x0; (**(code **)(*(int *)*savedReader + 0x14))(&uStack_690,4,1); pSStack_688 = uStack_690; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); pSStack_69c = *(Seeds **)&state->field_0x1e7a0; pSStack_6a0 = (Seeds *)&state->field_0x1e79c; pSStack_688 = (Seeds *)((int)pSStack_69c - *(int *)pSStack_6a0 >> 3); if (uStack_690 < pSStack_688) { pSVar10 = (Seeds *)(*(int *)pSStack_6a0 + (int)uStack_690 * 8); LAB_009cde1a: *(Seeds **)&state->field_0x1e7a0 = pSVar10; } else if (pSStack_688 < uStack_690) { if (uStack_690 <= (Seeds *)(*(int *)&state->field_0x1e7a4 - *(int *)pSStack_6a0 >> 3)) { pSStack_688 = (Seeds *)((int)uStack_690 - (int)pSStack_688); if (pSStack_688 == (Seeds *)0x0) { pSVar10 = pSStack_69c; } else { memset(pSStack_69c,0,(int)pSStack_688 * 8); pSVar10 = (Seeds *)(pSStack_69c->_stageSeeds + (int)pSStack_688 * 2 + -6); } goto LAB_009cde1a; } FUN_009d88a0(uStack_690,pSStack_6a0); } pSStack_6ac = (Seeds *)0x0; pSVar10 = (Seeds *)&state->field_0x1e79c; if (0 < (int)uStack_690) { do { iVar6 = (int)pSStack_6ac * 8; puVar15 = (uint *)(*(int *)pSVar10 + iVar6); (**(code **)(*(int *)*savedReader + 0x14))(puVar15,4,1); pSStack_688 = (Seeds *)*puVar15; Checksum::Update(checksum,(byte *)&pSStack_688,4); reader = savedReader; puVar15 = (uint *)(iVar6 + *(int *)&local_6a8->field_0x1e79c + 4); if (*(uint *)&local_6a8->field_0x1fdf0 < 0x30) { *puVar15 = 0; } else { (**(code **)(*(int *)*savedReader + 0x14))(puVar15,4,1); pSStack_688 = (Seeds *)*puVar15; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); } pSStack_6ac = (Seeds *)&pSStack_6ac->field_0x1; pSVar10 = pSStack_6a0; } while ((int)pSStack_6ac < (int)uStack_690); state = local_6a8; } LAB_009cdedb: pSStack_6a4 = (Seeds *)&state->field_0x1e680; if (*(uint *)&state->field_0x1fdf0 < 0x42) { FUN_009cf000(); } else { GameStateReader::read_bool_vector(0x68); (**(code **)(*(int *)*reader + 0x14))(&uStack_690,2,1); pSStack_688 = (Seeds *)((uint)uStack_690 & 0xffff); Checksum::Update(reader + 3,(byte *)&pSStack_688,2); pSStack_6a0 = (Seeds *)0x0; if ((ushort)uStack_690 != 0) { historyEnd = reader + 3; do { (**(code **)(*(int *)*reader + 0x14))(&pSStack_6ac,4,1); pSStack_688 = pSStack_6ac; Checksum::Update(historyEnd,(byte *)&pSStack_688,4); if ((ushort)pSStack_6a0 < 0x25) { pSStack_6a4->_stageSeeds[((uint)pSStack_6a0 & 0xffff) - 6] = (int)pSStack_6ac; reader = savedReader; } pSStack_6a0 = (Seeds *)&pSStack_6a0->field_0x1; } while ((ushort)pSStack_6a0 < (ushort)uStack_690); state = local_6a8; } } uVar7 = *(uint *)&state->field_0x1fdf0; if (0x4f < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1e78c,4,1); pSStack_688 = *(Seeds **)&state->field_0x1e78c; Checksum::Update(checksum,(byte *)&pSStack_688,4); uVar7 = *(uint *)&state->field_0x1fdf0; } reader = savedReader; if (0x58 < uVar7) { bStack_67d = 0; (**(code **)(*(int *)*savedReader + 0x14))(&bStack_67d,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,bStack_67d); Checksum::Update(reader + 3,(byte *)&uStack_690,1); pSStack_69c = (Seeds *)&state->field_0x1e790; vector12_resize(bStack_67d); iVar13 = *(int *)&state->field_0x1e794 - *(int *)&state->field_0x1e790; pSStack_6ac = (Seeds *)0x0; iVar6 = iVar13 >> 0x1f; if (iVar13 / 0xc + iVar6 != iVar6) { uStack_690 = (Seeds *)0x0; do { puVar16 = (undefined4 *)((int)uStack_690 + *(int *)pSStack_69c); (**(code **)(*(int *)*reader + 0x14))(puVar16,4,1); pSStack_688 = (Seeds *)*puVar16; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); puVar16 = (undefined4 *)((int)uStack_690 + 4 + *(int *)pSStack_69c); (**(code **)(*(int *)*reader + 0x14))(puVar16,4,1); pSStack_688 = (Seeds *)*puVar16; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); puVar15 = (uint *)((int)uStack_690 + 8 + *(int *)pSStack_69c); (**(code **)(*(int *)*reader + 0x14))(puVar15,4,1); pSStack_688 = (Seeds *)*puVar15; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); uStack_690 = (Seeds *)((int)uStack_690 + 0xc); pSStack_6ac = (Seeds *)&pSStack_6ac->field_0x1; } while (pSStack_6ac < (undefined1 *)((pSStack_69c->_gameStartSeed - *(int *)pSStack_69c) / 0xc)); reader = savedReader; state = local_6a8; } } uVar7 = *(uint *)&state->field_0x1fdf0; if (0x52 < uVar7) { (**(code **)(*(int *)*reader + 0x14))(&uStack_690,2,1); pSStack_688 = (Seeds *)((uint)uStack_690 & 0xffff); Checksum::Update(reader + 3,(byte *)&pSStack_688,2); *(uint *)&state->field_0x1e7a8 = (uint)uStack_690 & 0xffff; (**(code **)(*(int *)*reader + 0x14))(&uStack_690,2,1); pSStack_688 = (Seeds *)((uint)uStack_690 & 0xffff); Checksum::Update(reader + 3,(byte *)&pSStack_688,2); uVar7 = *(uint *)&state->field_0x1fdf0; *(uint *)&state->field_0x1e7ac = (uint)uStack_690 & 0xffff; } if (0x80 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1e7b0,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,state->field_0x1e7b0); Checksum::Update(checksum,(byte *)&uStack_690,1); reader = savedReader; local_6a8 = (GameState *)&state->field_0x1ead0; pSStack_6ac = (Seeds *)0x7; do { (**(code **)(*(int *)*reader + 0x14))(abStack_67c,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,abStack_67c[0]); Checksum::Update(reader + 3,(byte *)&uStack_690,1); *(int *)((int)local_6a8 + -4) = (int)(char)abStack_67c[0]; if (((char)abStack_67c[0] != 0) || (0x88 < *(uint *)&state->field_0x1fdf0)) { (**(code **)(*(int *)*reader + 0x14))(&bStack_67d,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,bStack_67d); Checksum::Update(reader + 3,(byte *)&uStack_690,1); *(int *)((int)local_6a8 + -0xc) = (int)(char)bStack_67d; bStack_695 = 0; if ('\0' < (char)bStack_67d) { do { read_player(state,(undefined1 *)((int)local_6a8 + (char)bStack_695 * 0xc + -0x1ac), (undefined1 *)((int)local_6a8 + (char)bStack_695 * 0xb8 + -0x31c),reader); bStack_695 = bStack_695 + 1; } while ((char)bStack_695 < (char)bStack_67d); } (**(code **)(*(int *)*reader + 0x14))(&bStack_67d,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,bStack_67d); Checksum::Update(reader + 3,(byte *)&uStack_690,1); *(int *)((int)local_6a8 + -8) = (int)(char)bStack_67d; bStack_695 = 0; if ('\0' < (char)bStack_67d) { do { read_player(state,(undefined1 *)((int)local_6a8 + ((char)bStack_695 + -3) * 0xc), (undefined1 *)((int)local_6a8 + (char)bStack_695 * 0xb8 + -0x194),reader); bStack_695 = bStack_695 + 1; } while ((char)bStack_695 < (char)bStack_67d); } (**(code **)(*(int *)*reader + 0x14))(local_6a8,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,*(undefined1 *)local_6a8); Checksum::Update(reader + 3,(byte *)&uStack_690,1); } local_6a8 = (GameState *)((int)local_6a8 + 800); pSStack_6ac = (Seeds *)((int)&pSStack_6ac[-1]._seedEffectsCount + 3); } while (pSStack_6ac != (Seeds *)0x0); uVar7 = *(uint *)&state->field_0x1fdf0; pSStack_6ac = (Seeds *)0x0; } if (0x84 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1fd94,2,1); pSStack_688 = (Seeds *)(uint)*(ushort *)&state->field_0x1fd94; Checksum::Update(checksum,(byte *)&pSStack_688,2); uVar7 = *(uint *)&state->field_0x1fdf0; } if (0x89 < uVar7) { GameStateReader::read_int_vector(&state->field_0x1fd98); uVar7 = *(uint *)&state->field_0x1fdf0; } if (0x97 < uVar7) { (**(code **)(*(int *)*savedReader + 0x14))(&state->field_0x1fddc,1,1); uStack_690 = (Seeds *)CONCAT31(uStack_690._1_3_,state->field_0x1fddc); Checksum::Update(checksum,(byte *)&uStack_690,1); uVar7 = *(uint *)&state->field_0x1fdf0; } reader = savedReader; if (0x94 < uVar7) { GameStateReader::read_int_vector(&state->field_0x1fde0); } cVar4 = (**(code **)(*(int *)*reader + 0x10))(); uStack_690._3_1_ = cVar4; (**(code **)(*(int *)*reader + 0x14))(&trailerChecksum,4,1); pSStack_688 = trailerChecksum; Checksum::Update(reader + 3,(byte *)&pSStack_688,4); trailerChecksum = (Seeds *)((uint)trailerChecksum ^ 0x96696996); if (((trailerChecksum == *(Seeds **)&state->field_0x1fda4) && (uStack_690._3_1_ == '\0')) && (cVar4 = (**(code **)(*(int *)*reader + 0x10))(), cVar4 != '\0')) { ExceptionList = local_1c; return 1; } KAGE_LogMessage(1,(byte *)"[warn] Bad Gamestate Offset! Gamestate corrupted or has new data!\n"); ExceptionList = local_1c; return 0; } //@@ 009ce5a0 FUN_009ce5a0 undefined4 FUN_009ce5a0(void) { qword qVar1; char cVar2; undefined4 *puVar3; undefined1 *puVar4; GameState *in_ECX; int *piVar5; qword *pqVar6; undefined1 *puVar7; void *pvStack_28; undefined1 *puStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined1 uStack_18; undefined4 uStack_14; undefined4 uStack_10; in_ECX->_isSaveAvailable = 0; if (in_ECX->_saveFile != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX->_saveFile)(1); } if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x28); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x28; piVar5 = puVar3 + 1; *puVar3 = 0x28; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffd7 < (uint)qVar1); if (piVar5 != (int *)0x0) { puVar3[2] = 2; puVar3[3] = 0; *piVar5 = (int)IsaacRepentancePlus::SteamCloudFile::vftable; puVar3[5] = 0; puVar3[7] = 0; puVar3[8] = 0; *(undefined2 *)(puVar3 + 9) = 0; goto LAB_009ce5f8; } } piVar5 = (int *)0x0; LAB_009ce5f8: in_ECX->_saveFile = piVar5; puVar7 = &in_ECX->field_0x1fdf4; puVar4 = puVar7; if (0xf < *(uint *)&in_ECX->field_0x1fe08) { puVar4 = *(undefined1 **)puVar7; } cVar2 = (**(code **)(*piVar5 + 0x24))(puVar4); if ((cVar2 == '\0') || (cVar2 = (**(code **)(*(int *)in_ECX->_saveFile + 0x30))(), cVar2 == '\0')) { KAGE_LogMessage(1,(byte *)"SteamCloud could not find or open %s. No Game State detected.\n"); return 0; } if (0xf < *(uint *)&in_ECX->field_0x1fe08) { puVar7 = *(undefined1 **)puVar7; } pvStack_28 = in_ECX->_saveFile; uStack_20 = 0; uStack_10 = 1; uStack_1c = 0; uStack_18 = 0; uStack_14 = 0xfedcba76; puStack_24 = puVar7; cVar2 = GameState::read(&pvStack_28,1); (**(code **)(*(int *)in_ECX->_saveFile + 0x34))(); if (cVar2 == '\0') { GameState::Delete(in_ECX); return 0; } in_ECX->_isSaveAvailable = 1; return 1; } //@@ 009ce720 GameState::read_item_pool /* DB: GameState::read (FUN_009cc1a0, ISAACNG_GSR%u) calls it with ecx=this+0x1e3cc; version-gated pool count 26..31 (save ver <0x57..>=0x7a), per pool reads count+ints with Checksum::Update, then a vector_bool sized by ItemConfig collectibles; mirror of GameState::write_item_pool */ byte GameState::read_item_pool(void) { int iVar1; uint bitWord; void *freeBlock; int *in_ECX; uint uVar2; Manager *extraout_ECX; Manager *extraout_ECX_00; Manager *pMVar3; undefined4 *puVar4; byte *pbVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; undefined4 uStack00000004; int local_38; int local_34 [3]; undefined4 *local_28; undefined4 *poolCount; undefined4 *checksum; undefined4 *local_1c; undefined4 *local_18; int *poolState; byte collectibleBit [7]; char trinketBit [5]; void *oldData; local_18 = (undefined4 *)0x0; uVar2 = uStack00000004[2]; poolCount = (undefined4 *)((-(uint)(uVar2 < 0x7a) & 0xfffffffe) + 0x1f); if (uVar2 < 0x70) { poolCount = (undefined4 *)&DAT_0000001c; } if (uVar2 < 0x69) { poolCount = (undefined4 *)0x1b; } if (uVar2 < 0x57) { poolCount = (undefined4 *)0x1a; } puVar4 = uStack00000004 + 3; checksum = puVar4; poolState = in_ECX; do { (**(code **)(*(int *)*uStack00000004 + 0x14))(&local_1c,4,1); local_28 = local_1c; Checksum::Update(puVar4,(byte *)&local_28,4); if (local_34 != in_ECX) { oldData = (void *)*in_ECX; iVar1 = in_ECX[2]; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; if (oldData != (void *)0x0) { uVar2 = iVar1 - (int)oldData & 0xfffffffc; freeBlock = oldData; if (0xfff < uVar2) { freeBlock = *(void **)((int)oldData + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)oldData + (-4 - (int)freeBlock))) goto LAB_009ce83e; } operator_delete(freeBlock,uVar2); } } std::vector<4byte>::resize(local_1c); puVar8 = (undefined4 *)0x0; if (local_1c != (undefined4 *)0x0) { do { puVar7 = (undefined4 *)(*in_ECX + (int)puVar8 * 4); (**(code **)(*(int *)*uStack00000004 + 0x14))(puVar7,4,1); puVar4 = checksum; local_28 = (undefined4 *)*puVar7; Checksum::Update(checksum,(byte *)&local_28,4); puVar8 = (undefined4 *)((int)puVar8 + 1); } while (puVar8 < local_1c); } puVar7 = poolCount; puVar8 = uStack00000004; in_ECX = in_ECX + 3; local_18 = (undefined4 *)((int)local_18 + 1); } while (local_18 < poolCount); pbVar5 = (byte *)(poolState + 0x5d); (**(code **)(*(int *)*uStack00000004 + 0x14))(pbVar5,4,poolCount); puVar4 = checksum; Checksum::Update(checksum,pbVar5,(int)puVar7 * 4); piVar6 = poolState + 0x7c; (**(code **)(*(int *)*uStack00000004 + 0x14))(piVar6,4,1); uStack00000004 = (undefined4 *)*piVar6; Checksum::Update(puVar4,(byte *)&uStack00000004,4); piVar6 = poolState + 0x7d; (**(code **)(*(int *)*puVar8 + 0x14))(piVar6,4,1); uStack00000004 = (undefined4 *)*piVar6; Checksum::Update(puVar4,(byte *)&uStack00000004,4); piVar6 = poolState + 0x7e; (**(code **)(*(int *)*puVar8 + 0x14))(piVar6,4,1); uStack00000004 = (undefined4 *)*piVar6; Checksum::Update(puVar4,(byte *)&uStack00000004,4); piVar6 = poolState + 0x7f; (**(code **)(*(int *)*puVar8 + 0x14))(piVar6,4,1); uStack00000004 = (undefined4 *)*piVar6; Checksum::Update(puVar4,(byte *)&uStack00000004,4); piVar6 = poolState + 0x80; (**(code **)(*(int *)*puVar8 + 0x14))(piVar6,4,1); uStack00000004 = (undefined4 *)*piVar6; Checksum::Update(puVar4,(byte *)&uStack00000004,4); uVar2 = puVar8[2]; if (0x49 < uVar2) { piVar6 = poolState + 0x81; (**(code **)(*(int *)*puVar8 + 0x14))(piVar6,4,1); uStack00000004 = (undefined4 *)*piVar6; Checksum::Update(puVar4,(byte *)&uStack00000004,4); uVar2 = puVar8[2]; } if (uVar2 < 0x37) { local_18 = (undefined4 *)((-(uint)(uVar2 < 0x35) & 0xffffff22) + 0x2dd); } else { (**(code **)(*(int *)*puVar8 + 0x14))(&local_18,4,1); uStack00000004 = local_18; Checksum::Update(puVar4,(byte *)&uStack00000004,4); } if (local_18 <= (undefined4 *) ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2)) { piVar6 = poolState + 0x82; pMVar3 = g_manager; if (&local_38 != piVar6) { oldData = (void *)*piVar6; pMVar3 = (Manager *)poolState[0x84]; *piVar6 = 0; poolState[0x83] = 0; poolState[0x84] = 0; poolState[0x85] = 0; if (oldData != (void *)0x0) { uVar2 = (int)pMVar3 - (int)oldData & 0xfffffffc; freeBlock = oldData; if (0xfff < uVar2) { freeBlock = *(void **)((int)oldData + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)oldData + (-4 - (int)freeBlock))) goto LAB_009ce83e; } operator_delete(freeBlock,uVar2); pMVar3 = extraout_ECX; } } vector_bool_resize(piVar6,(uint)local_18,(byte)pMVar3); puVar7 = (undefined4 *)0x0; if (local_18 != (undefined4 *)0x0) { do { (**(code **)(*(int *)*puVar8 + 0x14))((int)&uStack00000004 + 3,1,1); collectibleBit[0] = uStack00000004._3_1_; Checksum::Update(puVar4,collectibleBit,1); uVar2 = (uint)puVar7 >> 5; local_28 = (undefined4 *)poolState[0x82]; if (uStack00000004._3_1_ == '\0') { bitWord = local_28[uVar2] & ~(1 << ((uint)puVar7 & 0x1f)); } else { bitWord = local_28[uVar2] | 1 << ((uint)puVar7 & 0x1f); } puVar7 = (undefined4 *)((int)puVar7 + 1); local_28[uVar2] = bitWord; } while (puVar7 < local_18); } if ((uint)puVar8[2] < 0x37) { local_1c = (undefined4 *)((-(uint)((uint)puVar8[2] < 0x35) & 0xffffffba) + 0xbe); } else { (**(code **)(*(int *)*puVar8 + 0x14))(&local_1c,4,1); local_28 = local_1c; Checksum::Update(puVar4,(byte *)&local_28,4); } if (local_1c <= (undefined4 *) ((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2)) { piVar6 = poolState + 0x86; pMVar3 = g_manager; if (&local_38 != piVar6) { oldData = (void *)*piVar6; pMVar3 = (Manager *)poolState[0x88]; *piVar6 = 0; poolState[0x87] = 0; poolState[0x88] = 0; poolState[0x89] = 0; if (oldData != (void *)0x0) { uVar2 = (int)pMVar3 - (int)oldData & 0xfffffffc; freeBlock = oldData; if (0xfff < uVar2) { freeBlock = *(void **)((int)oldData + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)oldData + (-4 - (int)freeBlock))) { LAB_009ce83e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar2); pMVar3 = extraout_ECX_00; } } vector_bool_resize(piVar6,(uint)local_1c,(byte)pMVar3); puVar7 = (undefined4 *)0x0; if (local_1c != (undefined4 *)0x0) { do { (**(code **)(*(int *)*puVar8 + 0x14))(trinketBit,1,1); uStack00000004 = (undefined4 *)CONCAT31(uStack00000004._1_3_,trinketBit[0]); Checksum::Update(puVar4,(byte *)&uStack00000004,1); uVar2 = (uint)puVar7 >> 5; uStack00000004 = (undefined4 *)poolState[0x86]; if (trinketBit[0] == '\0') { bitWord = uStack00000004[uVar2] & ~(1 << ((uint)puVar7 & 0x1f)); } else { bitWord = uStack00000004[uVar2] | 1 << ((uint)puVar7 & 0x1f); } puVar7 = (undefined4 *)((int)puVar7 + 1); uStack00000004[uVar2] = bitWord; } while (puVar7 < local_1c); } uVar2 = puVar8[2]; if (uVar2 < 0x37) { (**(code **)(*(int *)*puVar8 + 0x14))(&uStack00000004,4,1); local_28 = uStack00000004; Checksum::Update(puVar4,(byte *)&local_28,4); uVar2 = puVar8[2]; } pbVar5 = (byte *)(poolState + 0x8a); uVar2 = 0xf - (uVar2 < 0x77); (**(code **)(*(int *)*puVar8 + 0x14))(pbVar5,4,uVar2); Checksum::Update(checksum,pbVar5,uVar2 * 4); pbVar5 = (byte *)(poolState + 0x99); (**(code **)(*(int *)*puVar8 + 0x14))(pbVar5,1,uVar2); puVar7 = checksum; Checksum::Update(checksum,pbVar5,uVar2); puVar4 = poolCount; if (0x4d < (uint)puVar8[2]) { (**(code **)(*(int *)*puVar8 + 0x14))(poolState + 0x9d,2,poolCount); Checksum::Update(puVar7,(byte *)(poolState + 0x9d),(int)puVar4 * 2); } return 1; } } return 0; } //@@ 009cec80 GameState::write_item_pool /* DB: ? (stream*), ECX = GameState+0x1e3cc (lea ecx,[esi+0x1e3cc] in GameState::write): writes 0x1f (31 item pools) int vectors (count + ids, stride 0xc) with Checksum::Update, then ints +0x1f0..+0x204 and the bit vector at +0x208/+0x214 */ void GameState::write_item_pool(undefined4 *param_1) { int *in_ECX; int unaff_EBX; undefined4 *this; uint uVar1; int iVar2; int iVar3; undefined4 uStack_8c; uint uVar4; uint uVar5; byte abStack_72 [2]; int iVar6; byte abStack_66 [2]; byte abStack_5a [2]; byte abStack_4e [2]; byte abStack_42 [2]; byte abStack_2a [6]; int *local_24; uint local_20; void *pvStack_1c; int local_14; undefined4 *local_10; uint auStack_c [2]; local_14 = 0x1f; this = param_1 + 3; local_24 = in_ECX; local_10 = this; do { local_20 = in_ECX[1] - *in_ECX >> 2; (**(code **)(*(int *)*param_1 + 0x1c))(); auStack_c[0] = local_20; Checksum::Update(this,(byte *)auStack_c,4); uVar1 = 0; if (local_20 != 0) { do { iVar6 = *in_ECX; (**(code **)(*(int *)*param_1 + 0x1c))(); this = local_10; auStack_c[0] = *(uint *)(iVar6 + uVar1 * 4); Checksum::Update(local_10,(byte *)auStack_c,4); uVar1 = uVar1 + 1; } while (uVar1 < local_20); } in_ECX = in_ECX + 3; local_14 = local_14 + -1; } while (local_14 != 0); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(pvStack_1c,(byte *)(local_24 + 0x5d),0x7c); (**(code **)(*(int *)*param_1 + 0x1c))(); local_24 = *(int **)(unaff_EBX + 0x1f0); Checksum::Update(pvStack_1c,(byte *)&local_24,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(pvStack_1c,abStack_2a + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(pvStack_1c,abStack_42 + 6,4); iVar6 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(pvStack_1c,abStack_4e + 6,4); uVar5 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_8c = 0x9cee20; Checksum::Update(pvStack_1c,abStack_5a + 6,4); uVar4 = 1; uStack_8c = iVar6 + 0x204; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(pvStack_1c,abStack_66 + 6,4); iVar6 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(abStack_72 + 2); Checksum::Update(pvStack_1c,abStack_72 + 6,4); uVar1 = 0; if (uVar5 != 0) { do { uStack_8c = CONCAT13((*(uint *)(*(int *)(uVar4 + 0x208) + (uVar1 >> 5) * 4) & 1 << ((byte)uVar1 & 0x1f)) != 0,(undefined3)uStack_8c); (**(code **)(*(int *)*param_1 + 0x1c))((int)&uStack_8c + 3,1,1); Checksum::Update(pvStack_1c,abStack_72 + -0x16,1); uVar1 = uVar1 + 1; } while (uVar1 < uVar5); } iVar3 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(abStack_72 + -6,4); Checksum::Update(pvStack_1c,abStack_72 + -6,4); uVar1 = 0; if (uVar4 != 0) { do { (**(code **)(*(int *)*param_1 + 0x1c))(abStack_72 + -0x23,1,1); Checksum::Update(pvStack_1c,abStack_72 + -0x22,1); uVar1 = uVar1 + 1; } while (uVar1 < uVar4); } iVar2 = 0xf; (**(code **)(*(int *)*param_1 + 0x1c))((byte *)(iVar6 + 0x228),4); Checksum::Update(pvStack_1c,(byte *)(iVar6 + 0x228),0x3c); (**(code **)(*(int *)*param_1 + 0x1c))((byte *)(iVar3 + 0x264),1,0xf); Checksum::Update(pvStack_1c,(byte *)(iVar3 + 0x264),0xf); (**(code **)(*(int *)*param_1 + 0x1c))((byte *)(iVar2 + 0x274),2,0x1f); Checksum::Update(pvStack_1c,(byte *)(iVar2 + 0x274),0x3e); return; } //@@ 009cf000 FUN_009cf000 void FUN_009cf000(void) { uint *puVar1; uint uVar2; int in_ECX; uint uVar3; vector_bool_resize((int *)(in_ECX + 0x94),0x68,(byte)in_ECX); uVar2 = 0; do { puVar1 = (uint *)(*(int *)(in_ECX + 0x94) + (uVar2 >> 5) * 4); uVar3 = uVar2 & 0x1f; uVar2 = uVar2 + 1; *puVar1 = *puVar1 & ~(1 << uVar3); } while (uVar2 < 0x68); return; } //@@ 009cf050 GameStatePlayer::Init /* ZHL [exact] __thiscall void GameStatePlayer::Init(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall GameStatePlayer::Init(GameStatePlayer *this) { GameStatePlayer GVar1; void *ptr; GameStatePlayer GVar2; uint uVar3; GameStatePlayer oldDequeSize; GameStatePlayer local_3c; GameStatePlayer local_38; GameStatePlayer tmpListHead; GameStatePlayer tmpDequeMap; GameStatePlayer tmpDequeMapSize; GameStatePlayer tmpDequeOffset; GameStatePlayer tmpDequeSize; undefined4 uStack_1c; GameStatePlayer *memberField; GameStatePlayer oldDequeOffset; GameStatePlayer oldDequeSize; *this = (GameStatePlayer)0x0; this[1] = (GameStatePlayer)0x0; this[2] = (GameStatePlayer)0x0; this[3] = (GameStatePlayer)0x0; this[4] = (GameStatePlayer)0x0; this[5] = (GameStatePlayer)0x0; this[6] = (GameStatePlayer)0x0; this[7] = (GameStatePlayer)0x0; this[8] = (GameStatePlayer)0x0; this[9] = (GameStatePlayer)0x0; this[10] = (GameStatePlayer)0x0; this[0xb] = (GameStatePlayer)0x30000; *(undefined2 *)(this + 0xc) = 0; this[0xc].field_0x2 = 0; this[0xd] = (GameStatePlayer)0x0; *(undefined2 *)(this + 0xe) = 0; this[0x12] = (GameStatePlayer)0x0; this[0x13] = (GameStatePlayer)0x0; this[0x14] = (GameStatePlayer)0x0; this[0x15] = (GameStatePlayer)0x0; this[0x16] = (GameStatePlayer)0x0; this[0x17] = (GameStatePlayer)0x0; this[0x18] = (GameStatePlayer)0x0; this[0x19] = (GameStatePlayer)0x0; this[0x1a] = (GameStatePlayer)0x0; this[0x1b] = (GameStatePlayer)0x0; this[0x1c] = (GameStatePlayer)0x0; this[0x1d] = (GameStatePlayer)0x0; this[0x1e] = (GameStatePlayer)0x0; this[0x1f] = (GameStatePlayer)0x0; this[0x20] = (GameStatePlayer)0x0; this[0x21] = (GameStatePlayer)0x0; this[0x22] = (GameStatePlayer)0x0; this[0x23] = (GameStatePlayer)0x0; this[0x24] = (GameStatePlayer)0xffffffff; this[0x25] = (GameStatePlayer)0x0; this[0x26] = (GameStatePlayer)0x0; *(undefined8 *)(this + 0x27) = 0; this[0x29] = (GameStatePlayer)0x0; this[0x2a] = (GameStatePlayer)0xffffffff; this[0x2b] = (GameStatePlayer)0x0; this[0x2c] = (GameStatePlayer)0x0; *(undefined8 *)(this + 0x2d) = 0; this[0x2f] = (GameStatePlayer)0x0; this[0x30] = (GameStatePlayer)0xffffffff; this[0x31] = (GameStatePlayer)0x0; this[0x32] = (GameStatePlayer)0x0; *(undefined8 *)(this + 0x33) = 0; this[0x35] = (GameStatePlayer)0x0; this[0x36] = (GameStatePlayer)0xffffffff; this[0x37] = (GameStatePlayer)0x0; this[0x38] = (GameStatePlayer)0x0; tmpDequeSize = (GameStatePlayer)0x0; uStack_1c = 0; *(undefined8 *)(this + 0x39) = 0; this[0x3b] = (GameStatePlayer)g_vectorOne.x; this[0x3c] = (GameStatePlayer)g_vectorOne.y; this[0x3d] = (GameStatePlayer)g_vectorOne.x; this[0x3e] = (GameStatePlayer)g_vectorOne.y; this[0x3f] = (GameStatePlayer)g_vectorOne.x; this[0x40] = (GameStatePlayer)g_vectorOne.y; this[0x82] = (GameStatePlayer)0x0; this[0x83] = (GameStatePlayer)0x0; this[0xd2] = (GameStatePlayer)0x0; this[0xd3] = (GameStatePlayer)0x0; this[0xd4] = (GameStatePlayer)0x0; this[0xd5] = (GameStatePlayer)0x0; this[0x84] = (GameStatePlayer)0x0; this[0x8b] = (GameStatePlayer)0x0; this[0xda] = (GameStatePlayer)0x0; this[0xdb] = (GameStatePlayer)0x0; this[0xf] = (GameStatePlayer)0x0; this[0x10] = (GameStatePlayer)0x0; this[0x11] = (GameStatePlayer)0x0; this[0xdd] = (GameStatePlayer)0x0; this[0xde] = (GameStatePlayer)0x0; this[0xd6] = (GameStatePlayer)0x3f800000; this[0xd9] = (GameStatePlayer)0x3f800000; this[0xd8] = (GameStatePlayer)0x3f800000; this[0xd7] = (GameStatePlayer)0x3f800000; this[0x41] = (GameStatePlayer)0x0; this[0x43] = (GameStatePlayer)0x0; this[0x42] = (GameStatePlayer)0x1; this[0x44] = (GameStatePlayer)0x1; this[0x45] = (GameStatePlayer)0x0; this[0x46] = (GameStatePlayer)0x1; this[0x47] = (GameStatePlayer)0x0; this[0x48] = (GameStatePlayer)0x1; memset(this + 0x49,0,0x44); memberField = this + 0x5a; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x5c]; *memberField = (GameStatePlayer)0x0; this[0x5b] = (GameStatePlayer)0x0; this[0x5c] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x5d; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x5f]; *memberField = (GameStatePlayer)0x0; this[0x5e] = (GameStatePlayer)0x0; this[0x5f] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x60; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x62]; *memberField = (GameStatePlayer)0x0; this[0x61] = (GameStatePlayer)0x0; this[0x62] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffff8; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x78; if (&local_3c != memberField) { GVar2 = *memberField; local_3c = this[0x7a]; oldDequeSize = this[0x79]; *memberField = (GameStatePlayer)0x0; this[0x79] = (GameStatePlayer)0x0; this[0x7a] = (GameStatePlayer)0x0; GVar1 = GVar2; if (GVar2 != (GameStatePlayer)0x0) { for (; GVar1 != oldDequeSize; GVar1 = (GameStatePlayer)((int)GVar1 + 0x78)) { invoke_pending_callbacks((void *)GVar1); } uVar3 = (((int)local_3c - (int)GVar2) / 0x78) * 0x78; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x75; *(undefined8 *)(this + 99) = 0; this[0x74] = (GameStatePlayer)0x0; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x77]; *memberField = (GameStatePlayer)0x0; this[0x76] = (GameStatePlayer)0x0; this[0x77] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffff8; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x65; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x67]; *memberField = (GameStatePlayer)0x0; this[0x66] = (GameStatePlayer)0x0; this[0x67] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x68; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x6a]; *memberField = (GameStatePlayer)0x0; this[0x69] = (GameStatePlayer)0x0; this[0x6a] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x6b; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x6d]; *memberField = (GameStatePlayer)0x0; this[0x6c] = (GameStatePlayer)0x0; this[0x6d] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x6e; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x70]; *memberField = (GameStatePlayer)0x0; this[0x6f] = (GameStatePlayer)0x0; this[0x70] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x71; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x73]; *memberField = (GameStatePlayer)0x0; this[0x72] = (GameStatePlayer)0x0; this[0x73] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0xe0; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0xe2]; *memberField = (GameStatePlayer)0x0; this[0xe1] = (GameStatePlayer)0x0; this[0xe2] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (((int)oldDequeSize - (int)GVar2) / 0x34) * 0x34; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0xe3; this[0xdf] = (GameStatePlayer)0x0; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0xe5]; *memberField = (GameStatePlayer)0x0; this[0xe4] = (GameStatePlayer)0x0; this[0xe5] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (((int)oldDequeSize - (int)GVar2) / 0x1c) * 0x1c; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } *(undefined1 *)(this + 0xe6) = 0; *(undefined2 *)(this + 0xee) = 0; memberField = this + 0xef; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0xf1]; *memberField = (GameStatePlayer)0x0; this[0xf0] = (GameStatePlayer)0x0; this[0xf1] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (((int)oldDequeSize - (int)GVar2) / 0x1c) * 0x1c; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x109; this[0xf2] = (GameStatePlayer)0xffffffff; this[0xf3] = (GameStatePlayer)0xffffffff; this[0xf4] = (GameStatePlayer)0xffffffff; this[0xf5] = (GameStatePlayer)0xffffffff; this[0xf6] = (GameStatePlayer)0xffffffff; this[0xf7] = (GameStatePlayer)0xffffffff; this[0xf8] = (GameStatePlayer)0xffffffff; this[0xf9] = (GameStatePlayer)0xffffffff; this[0xfa] = (GameStatePlayer)0xffffffff; this[0xfb] = (GameStatePlayer)0xffffffff; this[0xfc] = (GameStatePlayer)0xffffffff; this[0xfd] = (GameStatePlayer)0xffffffff; this[0xfe] = (GameStatePlayer)0xffffffff; this[0xff] = (GameStatePlayer)0xffffffff; this[0x100] = (GameStatePlayer)0xffffffff; this[0x101] = (GameStatePlayer)0xffffffff; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x10b]; *memberField = (GameStatePlayer)0x0; this[0x10a] = (GameStatePlayer)0x0; this[0x10b] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } this[0x10c] = (GameStatePlayer)0x0; *(undefined2 *)(this + 0x10e) = 0; memberField = this + 0x146; this[0xdb] = (GameStatePlayer)0x0; this[0x10f] = (GameStatePlayer)0x0; this[0x110] = (GameStatePlayer)0x0; this[0x111] = (GameStatePlayer)0x0; this[0x112] = (GameStatePlayer)0x0; this[0x10d] = (GameStatePlayer)0x0; this[0x116] = (GameStatePlayer)0x0; this[0x117] = (GameStatePlayer)0x0; this[0x118] = (GameStatePlayer)0x0; this[0x119] = (GameStatePlayer)0x0; *(undefined8 *)(this + 0x11a) = 0; this[0x11c] = (GameStatePlayer)0x0; this[0x113] = (GameStatePlayer)0x0; this[0x114] = (GameStatePlayer)0x0; this[0x115] = (GameStatePlayer)0x0; this[0x11d] = (GameStatePlayer)0x0; this[0x11e] = (GameStatePlayer)0x0; this[0x11f] = (GameStatePlayer)0x0; this[0x120] = (GameStatePlayer)0x0; this[0x121] = (GameStatePlayer)0x0; this[0x123] = (GameStatePlayer)0x0; this[0x124] = (GameStatePlayer)0x0; this[0x126] = (GameStatePlayer)0x0; this[0x122] = (GameStatePlayer)0xc61c3c00; this[0x125] = (GameStatePlayer)0xffffffff; this[0x127] = (GameStatePlayer)0xfffe7961; this[0x128] = (GameStatePlayer)g_vectorZero.x; this[0x129] = (GameStatePlayer)g_vectorZero.y; this[0x12a] = (GameStatePlayer)0xffffffff; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x148]; *memberField = (GameStatePlayer)0x0; this[0x147] = (GameStatePlayer)0x0; this[0x148] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffff0; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } this[0x149] = (GameStatePlayer)0x0; this[0x14a] = (GameStatePlayer)0x0; this[0x14b] = (GameStatePlayer)0xffffffff; this[0x14c] = (GameStatePlayer)0x0; *(undefined1 *)(this + 0x14d) = 0; this[299] = (GameStatePlayer)0x0; tmpDequeMap = (GameStatePlayer)0x0; tmpDequeMapSize = (GameStatePlayer)0x0; tmpDequeOffset = (GameStatePlayer)0x0; tmpDequeSize = (GameStatePlayer)0x0; tmpListHead = (GameStatePlayer)operator_new(8); memberField = this + 300; *(int *)((int)tmpListHead + 4) = 0; *(GameStatePlayer **)tmpListHead = &tmpListHead; if (&tmpListHead != memberField) { GVar2 = *memberField; *memberField = tmpListHead; if (GVar2 != (GameStatePlayer)0x0) { *(GameStatePlayer **)GVar2 = &tmpListHead; tmpListHead = *memberField; } if (tmpListHead != (GameStatePlayer)0x0) { *(GameStatePlayer **)tmpListHead = memberField; } oldDequeSize = this[0x12d]; GVar1 = this[0x12e]; this[0x12d] = tmpDequeMap; this[0x12e] = tmpDequeMapSize; oldDequeOffset = this[0x12f]; this[0x12f] = tmpDequeOffset; oldDequeSize = this[0x130]; this[0x130] = tmpDequeSize; tmpListHead = GVar2; tmpDequeMap = oldDequeSize; tmpDequeMapSize = GVar1; tmpDequeOffset = oldDequeOffset; tmpDequeSize = oldDequeSize; } GVar2 = tmpDequeMap; oldDequeSize = tmpDequeMapSize; if (tmpDequeSize != (GameStatePlayer)0x0) { do { tmpDequeSize = (GameStatePlayer)((int)tmpDequeSize + -1); local_3c = (GameStatePlayer)0x0; } while (tmpDequeSize != (GameStatePlayer)0x0); tmpDequeOffset = (GameStatePlayer)0x0; tmpDequeSize = (GameStatePlayer)0x0; } while (oldDequeSize != (GameStatePlayer)0x0) { ptr = *(void **)((int)GVar2 + -4 + (int)oldDequeSize * 4); oldDequeSize = (GameStatePlayer)((int)oldDequeSize + -1); if (ptr != (void *)0x0) { operator_delete(ptr,0x10); GVar2 = tmpDequeMap; } } if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)tmpDequeMapSize * 4; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } GVar2 = tmpListHead; tmpDequeMapSize = (GameStatePlayer)0x0; tmpDequeMap = (GameStatePlayer)0x0; tmpListHead = (GameStatePlayer)0x0; operator_delete((void *)GVar2,8); memberField = this + 0x131; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x133]; *memberField = (GameStatePlayer)0x0; this[0x132] = (GameStatePlayer)0x0; this[0x133] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x137; this[0x134] = (GameStatePlayer)0x0; this[0x135] = (GameStatePlayer)0xffffffff; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x139]; *memberField = (GameStatePlayer)0x0; this[0x138] = (GameStatePlayer)0x0; this[0x139] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x13a; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x13c]; *memberField = (GameStatePlayer)0x0; this[0x13b] = (GameStatePlayer)0x0; this[0x13c] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } memberField = this + 0x140; *(undefined1 *)(this + 0x13d) = 0; this[0x136] = (GameStatePlayer)0x0; this[0x13e] = (GameStatePlayer)0x0; this[0x13f] = (GameStatePlayer)0x0; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x142]; *memberField = (GameStatePlayer)0x0; this[0x141] = (GameStatePlayer)0x0; this[0x142] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (int)oldDequeSize - (int)GVar2 & 0xfffffffc; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) goto LAB_009cff2f; } operator_delete((void *)oldDequeSize,uVar3); } } this[0x143] = (GameStatePlayer)0x0; memberField = this + 0x156; this[0x144] = (GameStatePlayer)0x0; this[0x145] = (GameStatePlayer)0x0; this[0x14d].field_0x1 = 0; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x158]; *memberField = (GameStatePlayer)0x0; this[0x157] = (GameStatePlayer)0x0; this[0x158] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { uVar3 = (((int)oldDequeSize - (int)GVar2) / 0x34) * 0x34; oldDequeSize = GVar2; if (0xfff < uVar3) { oldDequeSize = *(GameStatePlayer *)((int)GVar2 + -4); uVar3 = uVar3 + 0x23; if (0x1f < ((int)GVar2 - (int)oldDequeSize) - 4U) { LAB_009cff2f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)oldDequeSize,uVar3); } } this[0x159] = (GameStatePlayer)0x0; this[0x15a] = (GameStatePlayer)0x0; this[0x15c] = (GameStatePlayer)0x0; this[0x15b] = (GameStatePlayer)0x1; this[0x15d] = (GameStatePlayer)0x1; this[0x15e] = (GameStatePlayer)0x0; this[0x15f] = (GameStatePlayer)0x1; this[0x160] = (GameStatePlayer)0x0; this[0x161] = (GameStatePlayer)0x1; this[0x162] = (GameStatePlayer)0x0; this[0x163] = (GameStatePlayer)0x0; *(undefined1 *)(this + 0x164) = 0; this[0x165] = (GameStatePlayer)0x0; this[0x167] = (GameStatePlayer)0x0; this[0x166] = (GameStatePlayer)0x1; this[0x168] = (GameStatePlayer)0x1; this[0x169] = (GameStatePlayer)0x0; this[0x16a] = (GameStatePlayer)0x1; this[0x16b] = (GameStatePlayer)0x0; this[0x16c] = (GameStatePlayer)0x1; this[0x16d] = (GameStatePlayer)0x0; this[0x16e] = (GameStatePlayer)0x0; *(undefined1 *)(this + 0x16f) = 0xff; this[0x170] = (GameStatePlayer)0x0; this[0x171] = (GameStatePlayer)0x0; this[0x172] = (GameStatePlayer)0x0; this[0x173] = (GameStatePlayer)0x0; *(undefined2 *)(this + 0x174) = 0; local_38 = (GameStatePlayer)0x0; GVar2 = (GameStatePlayer)operator_new(0x18); memberField = this + 0x175; *(GameStatePlayer *)GVar2 = GVar2; *(GameStatePlayer *)((int)GVar2 + 4) = GVar2; *(GameStatePlayer *)((int)GVar2 + 8) = GVar2; *(undefined2 *)((int)GVar2 + 0xc) = 0x101; local_3c = GVar2; if (&local_3c != memberField) { local_3c = *memberField; *memberField = GVar2; GVar2 = this[0x176]; this[0x176] = local_38; local_38 = GVar2; } FID_conflict__Erase_tree_>_> (&local_3c,(fuzzer_allocator_> *)&local_3c, *(_Tree_node **)((int)local_3c + 4)); operator_delete((void *)local_3c,0x18); memberField = this + 0x105; this[0xdb] = (GameStatePlayer)0x0; this[0x102] = (GameStatePlayer)0x0; if (&local_3c != memberField) { GVar2 = *memberField; oldDequeSize = this[0x107]; *memberField = (GameStatePlayer)0x0; this[0x106] = (GameStatePlayer)0x0; this[0x107] = (GameStatePlayer)0x0; if (GVar2 != (GameStatePlayer)0x0) { FUN_005cbf50(GVar2,(int)oldDequeSize - (int)GVar2 >> 4); } } this[0x108] = (GameStatePlayer)0x0; return; } //@@ 009cff40 GameStatePlayer::read_coplayer /* DB: ? (stream*) -> 1: reader of 009d0100's record (8 ushorts, 2 ints, the last two ushorts only for save version > 0x91); GameStatePlayer::read_part3 after "[warn] Invalid co-player count %d" */ undefined4 GameStatePlayer::read_coplayer(undefined4 *param_1) { undefined4 *puVar1; ushort *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*param_1 + 0x14))(); param_1 = (undefined4 *)(uint)*in_ECX; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 1,2,1); param_1 = (undefined4 *)(uint)in_ECX[1]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 2,2,1); param_1 = (undefined4 *)(uint)in_ECX[2]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 3,2,1); param_1 = (undefined4 *)(uint)in_ECX[3]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 4,2,1); param_1 = (undefined4 *)(uint)in_ECX[4]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 5,2,1); param_1 = (undefined4 *)(uint)in_ECX[5]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 6,2,1); param_1 = (undefined4 *)(uint)in_ECX[6]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 7,2,1); param_1 = (undefined4 *)(uint)in_ECX[7]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 10,4,1); param_1 = *(undefined4 **)(in_ECX + 10); Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 0xc,4,1); param_1 = *(undefined4 **)(in_ECX + 0xc); Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); if (0x91 < (uint)puVar1[2]) { (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 9,2,1); param_1 = (undefined4 *)(uint)in_ECX[9]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x14))(in_ECX + 8,2,1); param_1 = (undefined4 *)(uint)in_ECX[8]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); } return 1; } //@@ 009d0100 GameStatePlayer::write_coplayer /* DB: ? (stream*): writes a co-player record = 8 ushorts (+0..+0xe), ints +0x14/+0x18, ushorts +0x12/+0x10 with Checksum::Update; GameState::write_player loops it over the co-player list and once more for an optional one */ void GameStatePlayer::write_coplayer(undefined4 *param_1) { undefined4 *puVar1; ushort *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*param_1 + 0x1c))(); param_1 = (undefined4 *)(uint)*in_ECX; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 1,2,1); param_1 = (undefined4 *)(uint)in_ECX[1]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 2,2,1); param_1 = (undefined4 *)(uint)in_ECX[2]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 3,2,1); param_1 = (undefined4 *)(uint)in_ECX[3]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 4,2,1); param_1 = (undefined4 *)(uint)in_ECX[4]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 5,2,1); param_1 = (undefined4 *)(uint)in_ECX[5]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 6,2,1); param_1 = (undefined4 *)(uint)in_ECX[6]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 7,2,1); param_1 = (undefined4 *)(uint)in_ECX[7]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 10,4,1); param_1 = *(undefined4 **)(in_ECX + 10); Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 0xc,4,1); param_1 = *(undefined4 **)(in_ECX + 0xc); Checksum::Update(puVar1 + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 9,2,1); param_1 = (undefined4 *)(uint)in_ECX[9]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); (**(code **)(*(int *)*puVar1 + 0x1c))(in_ECX + 8,2,1); param_1 = (undefined4 *)(uint)in_ECX[8]; Checksum::Update(puVar1 + 3,(byte *)¶m_1,2); return; } //@@ 009d02c0 GameStatePlayer::read_block_538 /* DB: ? (stream*): reader of the block GameStatePlayer::write_block_538 (009d0440) writes: 3 ushorts -> this[0..2], one byte -> bools +0xc (bit0)/+0xd (bit1), 4 ushorts -> this[4..7], each with Checksum::Update; GameStatePlayer::read_part3 for save versions > 0x7d */ void GameStatePlayer::read_block_538(undefined4 *param_1) { undefined4 *puVar1; uint *in_ECX; uint local_10; ushort local_c [2]; byte local_8 [4]; puVar1 = param_1; (**(code **)(*(int *)*param_1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); *in_ECX = (uint)local_c[0]; (**(code **)(*(int *)*puVar1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); in_ECX[1] = (uint)local_c[0]; (**(code **)(*(int *)*puVar1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); in_ECX[2] = (uint)local_c[0]; (**(code **)(*(int *)*puVar1 + 0x14))((int)¶m_1 + 3,1,1); local_8[0] = param_1._3_1_; Checksum::Update(puVar1 + 3,local_8,1); *(byte *)(in_ECX + 3) = param_1._3_1_ & 1; *(byte *)((int)in_ECX + 0xd) = param_1._3_1_ >> 1 & 1; (**(code **)(*(int *)*puVar1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); in_ECX[4] = (uint)local_c[0]; (**(code **)(*(int *)*puVar1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); in_ECX[5] = (uint)local_c[0]; (**(code **)(*(int *)*puVar1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); in_ECX[6] = (uint)local_c[0]; (**(code **)(*(int *)*puVar1 + 0x14))(local_c,2,1); local_10 = (uint)local_c[0]; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); in_ECX[7] = (uint)local_c[0]; return; } //@@ 009d0440 GameStatePlayer::write_block_538 /* DB: ? (stream*), ECX = GameStatePlayer+0x538 (lea ecx,[esi+0x538] in GameState::write_player): writes ushorts at +0,+4,+8, one byte packing two bools (+0xc -> bit 0 of byte 3, +0xd -> bit 1) and ushorts +0x10..+0x1c, each with Checksum::Update */ void GameStatePlayer::write_block_538(undefined4 *param_1) { undefined4 *puVar1; undefined4 *puVar2; ushort *in_ECX; bool bVar3; uint local_10; uint local_c; byte local_8 [4]; puVar1 = param_1; local_c = (uint)*in_ECX; (**(code **)(*(int *)*param_1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); local_c = (uint)in_ECX[2]; (**(code **)(*(int *)*puVar1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); local_c = (uint)in_ECX[4]; (**(code **)(*(int *)*puVar1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); puVar2 = param_1; param_1 = (undefined4 *)((uint)param_1 & 0xffffff); bVar3 = (char)in_ECX[6] != '\0'; if (bVar3) { param_1._0_3_ = SUB43(puVar2,0); param_1 = (undefined4 *)CONCAT13(1,param_1._0_3_); } if (*(char *)((int)in_ECX + 0xd) != '\0') { param_1 = (undefined4 *)(CONCAT13(bVar3,param_1._0_3_) | 0x2000000); } (**(code **)(*(int *)*puVar1 + 0x1c))((int)¶m_1 + 3,1,1); local_8[0] = param_1._3_1_; Checksum::Update(puVar1 + 3,local_8,1); local_c = (uint)in_ECX[8]; (**(code **)(*(int *)*puVar1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); local_c = (uint)in_ECX[10]; (**(code **)(*(int *)*puVar1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); local_c = (uint)in_ECX[0xc]; (**(code **)(*(int *)*puVar1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); local_c = (uint)in_ECX[0xe]; (**(code **)(*(int *)*puVar1 + 0x1c))(&local_c,2,1); local_10 = local_c & 0xffff; Checksum::Update(puVar1 + 3,(byte *)&local_10,2); return; } //@@ 009d05d0 GameStatePlayer::read /* DB: called by GameState::read_rerun and 0090c7e0 NetplayManager::restore_player_state after GameStatePlayer::Init(&local) with the stream ptr; per-player [warn] strings (Invalid player type, pocket item, trinket, voided active item); Ghidra split its tail into FUN_009d16ee and FUN_009d2656 (costume/familiar/history count warnings) */ uint GameStatePlayer::read(undefined4 *param_1) { short sVar1; int **data; ItemConfig_Item *collectibleConfig; uint extraout_EAX; uint uVar2; uint extraout_EAX_00; int *in_ECX; undefined4 *puVar3; void *pvVar4; int *piVar5; undefined1 *puVar6; ushort *shortField; int *piVar7; int iVar8; char *format; undefined4 uVar9; uint uStack_120; void *intVector; int intVectorEnd; int local_8c; int *pocketSlotCount; int *pocketSlot; byte local_5c [4]; undefined4 *checksum; int *local_54; int *local_50; int *local_4c; ushort checksumByte; byte readByte; undefined4 *local_44; ushort readShort [3]; byte packedFlags; undefined4 *local_38; int *playerState; char pocketType; int *local_2c [2]; undefined1 *puStack_24; undefined1 *local_20; void *local_1c; undefined1 *puStack_18; int *local_14; puStack_24 = (undefined1 *)(local_2c + 10); local_14 = (int *)0xffffffff; puStack_18 = &LAB_00b0f39e; local_1c = ExceptionList; uStack_120 = __security_cookie ^ (uint)(local_2c + 7); local_20 = (undefined1 *)&uStack_120; ExceptionList = &local_1c; uVar9 = 4; playerState = in_ECX; (**(code **)(*(int *)*param_1 + 0x14))(); local_2c[0] = (int *)*in_ECX; checksum = param_1 + 3; local_44 = checksum; local_38 = checksum; Checksum::Update(checksum,(byte *)local_2c,4); if (((*in_ECX < 0) || (((int)(g_manager->_entityConfig)._players._end - (int)(g_manager->_entityConfig)._players._begin) / 0x148 <= *in_ECX)) || ((void *)(*in_ECX * 0x148 + (int)(g_manager->_entityConfig)._players._begin) == (void *)0x0)) { format = "[warn] Invalid player type: %d\n"; goto LAB_009d4590; } (**(code **)(*(int *)*param_1 + 0x14))(in_ECX + 1,4,1); local_2c[0] = (int *)in_ECX[1]; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 2; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 3; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 4; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 5; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 6; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 7; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 8; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 9; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 10; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0xb; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,1,1); checksumByte._0_1_ = (undefined1)*piVar7; Checksum::Update(param_1 + 3,(byte *)&checksumByte,1); puVar6 = (undefined1 *)((int)playerState + 0x2d); (**(code **)(*(int *)*param_1 + 0x14))(puVar6,1,1); checksumByte = CONCAT11(checksumByte._1_1_,*puVar6); Checksum::Update(param_1 + 3,(byte *)&checksumByte,1); piVar7 = playerState; if ((uint)param_1[2] < 0x82) { (**(code **)(*(int *)*param_1 + 0x14))(&local_4c,4,1); local_2c[0] = local_4c; Checksum::Update(param_1 + 3,(byte *)local_2c,4); *(undefined2 *)((int)piVar7 + 0x2e) = local_4c._0_2_; *(undefined2 *)(piVar7 + 0xc) = 0; } else { (**(code **)(*(int *)*param_1 + 0x14))((int)playerState + 0x2e,2,1); local_2c[0] = (int *)(uint)*(ushort *)((int)piVar7 + 0x2e); Checksum::Update(param_1 + 3,(byte *)local_2c,2); (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 0xc,2,1); local_2c[0] = (int *)(uint)*(ushort *)(piVar7 + 0xc); Checksum::Update(param_1 + 3,(byte *)local_2c,2); } if ((uint)param_1[2] < 0x79) { (**(code **)(*(int *)*param_1 + 0x14))((int)piVar7 + 0x32,1,1); checksumByte = CONCAT11(checksumByte._1_1_,*(undefined1 *)((int)piVar7 + 0x32)); Checksum::Update(param_1 + 3,(byte *)&checksumByte,1); } else { (**(code **)(*(int *)*param_1 + 0x14))(&packedFlags,1,1); checksumByte = CONCAT11(checksumByte._1_1_,packedFlags); Checksum::Update(param_1 + 3,(byte *)&checksumByte,1); *(byte *)((int)piVar7 + 0x32) = packedFlags & 1; *(byte *)(piVar7 + 0x14d) = packedFlags >> 1 & 1; *(byte *)((int)piVar7 + 0x535) = packedFlags >> 2 & 1; } uVar2 = param_1[2]; if (uVar2 < 0x4d) { if (0x23 < uVar2) { (**(code **)(*(int *)*param_1 + 0x14))(&local_4c,4,1); local_2c[0] = local_4c; Checksum::Update(param_1 + 3,(byte *)local_2c,4); *(undefined2 *)(piVar7 + 0xd) = local_4c._0_2_; uVar2 = param_1[2]; } if (0x39 < uVar2) { (**(code **)(*(int *)*param_1 + 0x14))(&local_4c,4,1); local_2c[0] = local_4c; Checksum::Update(param_1 + 3,(byte *)local_2c,4); *(undefined2 *)(piVar7 + 0xe) = local_4c._0_2_; } } else { (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 0xd,2,1); local_2c[0] = (int *)(uint)*(ushort *)(piVar7 + 0xd); Checksum::Update(param_1 + 3,(byte *)local_2c,2); shortField = (ushort *)((int)playerState + 0x36); (**(code **)(*(int *)*param_1 + 0x14))(shortField,2,1); local_2c[0] = (int *)(uint)*shortField; Checksum::Update(param_1 + 3,(byte *)local_2c,2); shortField = (ushort *)(playerState + 0xe); (**(code **)(*(int *)*param_1 + 0x14))(shortField,2,1); local_2c[0] = (int *)(uint)*shortField; Checksum::Update(param_1 + 3,(byte *)local_2c,2); piVar7 = playerState; } uVar2 = param_1[2]; if (0x24 < uVar2) { (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 0xf,4,1); local_2c[0] = (int *)piVar7[0xf]; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; } if (0xa4 < uVar2) { piVar7 = playerState + 0x10; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; } if (0x2c < uVar2) { piVar7 = playerState + 0x11; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; } if (uVar2 < 0x3e) { if (0x3a < uVar2) { (**(code **)(*(int *)*param_1 + 0x14))(local_2c,4,1); local_4c = local_2c[0]; data = &local_4c; goto LAB_009d0b19; } } else { piVar7 = playerState + 0xdd; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0xde; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; data = local_2c; LAB_009d0b19: Checksum::Update(param_1 + 3,(byte *)data,4); } piVar7 = playerState + 0x12; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x13; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x14; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x15; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x16; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x17; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x18; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState; if (0x27 < (uint)param_1[2]) { if ((uint)param_1[2] < 0x45) { (**(code **)(*(int *)*param_1 + 0x14))(&local_4c,4,1); local_2c[0] = local_4c; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7[0x19] = (int)((float)local_4c / 0.2); } else { (**(code **)(*(int *)*param_1 + 0x14))(playerState + 0x19,4,1); local_2c[0] = (int *)piVar7[0x19]; Checksum::Update(param_1 + 3,(byte *)local_2c,4); if (0xa5 < (uint)param_1[2]) { FUN_009d84a0(piVar7 + 0x1a); } } } (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 0x1b,4,1); local_2c[0] = (int *)piVar7[0x1b]; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x1c; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x1d; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x1e; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x1f; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x20; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x21; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; if (0x37 < uVar2) { piVar7 = playerState + 0x22; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; } local_54 = (int *)&DAT_00000004; if (uVar2 < 0x3c) { local_54 = (int *)0x1; } else if (uVar2 < 0x66) { local_54 = (int *)0x2; } else if (uVar2 < 0x71) { local_54 = (int *)0x3; } local_50 = playerState + 0x23; local_4c = (int *)0x0; do { (**(code **)(*(int *)*param_1 + 0x14))(local_50,4,1); local_2c[0] = (int *)*local_50; Checksum::Update(param_1 + 3,(byte *)local_2c,4); if ((0 < *local_50) && (collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,*local_50), collectibleConfig == (ItemConfig_Item *)0x0)) { format = "Invalid collectible ID: %d\n"; uVar2 = 4; goto LAB_009d4592; } if (0x98 < (uint)param_1[2]) { piVar7 = local_50 + 1; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); } piVar7 = local_50 + 2; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = local_50 + 3; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; if (99 < uVar2) { piVar7 = local_50 + 4; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; } if (0x6b < uVar2) { piVar7 = local_50 + 5; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); } local_4c = (int *)((int)local_4c + 1); local_50 = local_50 + 6; } while (local_4c < local_54); piVar7 = playerState + 0x3b; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x3c; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x3d; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x3e; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; if (0x28 < uVar2) { piVar7 = playerState + 0x3f; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState + 0x40; (**(code **)(*(int *)*param_1 + 0x14))(piVar7,4,1); local_2c[0] = (int *)*piVar7; Checksum::Update(param_1 + 3,(byte *)local_2c,4); uVar2 = param_1[2]; } pocketSlotCount = (int *)&DAT_00000004; if (uVar2 < 0x66) { pocketSlotCount = (int *)0x2; } else if (uVar2 < 0x71) { pocketSlotCount = (int *)0x3; } local_4c = (int *)0x0; pocketSlot = playerState + 0x41; piVar7 = playerState; do { (**(code **)(*(int *)*param_1 + 0x14))(&pocketType,1,1); checksumByte = CONCAT11(checksumByte._1_1_,pocketType); Checksum::Update(param_1 + 3,(byte *)&checksumByte,1); local_54 = (int *)0x0; pocketSlot[1] = (int)pocketType; (**(code **)(*(int *)*param_1 + 0x14))(&local_54,4,1); local_2c[0] = local_54; Checksum::Update(param_1 + 3,(byte *)local_2c,4); *pocketSlot = (int)local_54; if (((pocketType == '\x01') && (0 < (int)local_54)) && ((local_2c[0] = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)local_2c[0] >> 2 <= (int)local_54 || (piVar7 = playerState, local_2c[0][(int)local_54] == 0)))) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pocket item (type: %d, ID: %d)\n"); uVar2 = extraout_EAX; goto code_r0x009d459a; } pocketSlot = pocketSlot + 2; local_4c = (int *)((int)local_4c + 1); } while (local_4c < pocketSlotCount); iVar8 = 0x10 - (uint)((uint)param_1[2] < 0xa7); (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 0x49,4,iVar8); puVar3 = local_44; Checksum::Update(local_44,(byte *)(piVar7 + 0x49),iVar8 * 4); uVar2 = param_1[2]; if (0x4b < uVar2) { local_54 = (int *)0x0; (**(code **)(*(int *)*param_1 + 0x14))(&local_54,4,1); local_2c[0] = local_54; Checksum::Update(puVar3,(byte *)local_2c,4); local_8c = 0; playerState[0x59] = (uint)local_54 & 0xffff; uVar2 = param_1[2]; } piVar7 = playerState; if (0x2e < uVar2) { GameStateReader::read_int_vector(playerState + 0x5a); if ((uint)((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) < (uint)(piVar7[0x5b] - piVar7[0x5a] >> 2)) { uVar2 = FUN_009d459a(uVar9); return uVar2; } uVar2 = param_1[2]; if (uVar2 < 0x4d) { sVar1 = *(short *)(piVar7[0x5a] + 0x144); *(short *)((int)piVar7 + 0x20e) = sVar1; *(int *)(piVar7[0x5a] + 0x144) = (sVar1 + 8) / 9; *(undefined2 *)((int)piVar7 + 0x36) = *(undefined2 *)(piVar7[0x5a] + 0x768); *(undefined4 *)(piVar7[0x5a] + 0x768) = 0; uVar2 = param_1[2]; } } if (0x26 < uVar2) { GameStateReader::read_int_vector(piVar7 + 0x5d); piVar5 = (int *)piVar7[0x5d]; local_2c[0] = (int *)(piVar7[0x5e] - (int)piVar5 >> 2); local_4c = (int *)0x0; if (local_2c[0] != (int *)0x0) { do { iVar8 = *piVar5; if ((0 < iVar8) && ((pvVar4 = (g_manager->_itemConfig)._collectibles._begin, (int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar4 >> 2 <= iVar8 || (*(int *)((int)pvVar4 + iVar8 * 4) == 0)))) { format = "[warn] Invalid voided active item %d\n"; goto LAB_009d4590; } local_4c = (int *)((int)local_4c + 1); piVar5 = piVar5 + 1; } while (local_4c < local_2c[0]); } } if ((uint)param_1[2] < 0x8b) { piVar7 = playerState; } else { if ((uint)param_1[2] < 0x97) { intVector = (void *)0x0; intVectorEnd = 0; local_8c = 0; local_14 = (int *)0x0; GameStateReader::read_int_vector(&intVector); piVar7 = playerState; piVar5 = (int *)0x0; local_2c[0] = (int *)(intVectorEnd - (int)intVector >> 2); if (local_2c[0] != (int *)0x0) { do { iVar8 = playerState[0x60]; *(undefined4 *)(iVar8 + (int)piVar5 * 8) = *(undefined4 *)((int)intVector + (int)piVar5 * 4); *(undefined4 *)(iVar8 + 4 + (int)piVar5 * 8) = 0; piVar5 = (int *)((int)piVar5 + 1); } while (piVar5 < local_2c[0]); } local_14 = (int *)0xffffffff; if (intVector != (void *)0x0) { uVar2 = (local_8c - (int)intVector >> 2) * 4; pvVar4 = intVector; if (0xfff < uVar2) { pvVar4 = *(void **)((int)intVector + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)intVector + (-4 - (int)pvVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar2); } } else { (**(code **)(*(int *)*param_1 + 0x14))(&local_50,4,1); local_2c[0] = local_50; Checksum::Update(param_1 + 3,(byte *)local_2c,4); piVar7 = playerState; local_4c = playerState + 0x60; puVar3 = (undefined4 *)*local_4c; playerState[0x61] = (int)puVar3; if (local_50 != (int *)0x0) { piVar5 = local_50; if ((int *)(playerState[0x62] - (int)puVar3 >> 3) < local_50) { std::vector<8byte_0_m1>::_Resize_reallocate(local_50,puVar3); } else { do { *puVar3 = 0; puVar3[1] = 0xffffffff; puVar3 = puVar3 + 2; piVar5 = (int *)((int)piVar5 + -1); } while (piVar5 != (int *)0x0); playerState[0x61] = (int)puVar3; } } local_54 = (int *)0x0; if (local_50 != (int *)0x0) { do { (**(code **)(*(int *)*param_1 + 0x14))(&checksumByte,2,1); local_2c[0] = (int *)(uint)checksumByte; Checksum::Update(param_1 + 3,(byte *)local_2c,2); (**(code **)(*(int *)*param_1 + 0x14))(readShort,2,1); local_2c[0] = (int *)(uint)readShort[0]; Checksum::Update(param_1 + 3,(byte *)local_2c,2); iVar8 = *local_4c; *(uint *)(iVar8 + (int)local_54 * 8) = (uint)checksumByte; *(uint *)(iVar8 + 4 + (int)local_54 * 8) = (uint)readShort[0]; local_54 = (int *)((int)local_54 + 1); } while (local_54 < local_50); piVar7 = playerState; } } piVar5 = (int *)piVar7[0x60]; local_2c[0] = (int *)(piVar7[0x61] - (int)piVar5 >> 3); local_4c = (int *)0x0; if (local_2c[0] != (int *)0x0) { do { iVar8 = *piVar5; if ((0 < iVar8) && (((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2 <= iVar8 || (piVar7 = playerState, *(int *)((int)(g_manager->_itemConfig)._collectibles._begin + iVar8 * 4) == 0)))) { format = "[warn] Invalid voided passive item %d\n"; goto LAB_009d4590; } local_4c = (int *)((int)local_4c + 1); piVar5 = piVar5 + 2; } while (local_4c < local_2c[0]); } } (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 99,4,2); Checksum::Update(param_1 + 3,(byte *)(piVar7 + 99),8); piVar5 = piVar7 + 99; local_4c = (int *)0x0; while( true ) { local_2c[0] = (int *)*piVar5; if ((0 < (int)local_2c[0]) && (((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 <= (int)((uint)local_2c[0] & 0x7fff) || (piVar7 = playerState, *(int *)((int)(g_manager->_itemConfig)._trinkets._begin + ((uint)local_2c[0] & 0x7fff) * 4) == 0)))) break; local_4c = (int *)((int)local_4c + 1); piVar5 = piVar5 + 1; if ((int *)0x1 < local_4c) { if (param_1[2] - 0x2f < 0x62) { (**(code **)(*(int *)*param_1 + 0x14))(&local_54,4,1); local_2c[0] = local_54; Checksum::Update(param_1 + 3,(byte *)local_2c,4); local_4c = (int *)0x0; if (local_54 != (int *)0x0) { do { (**(code **)(*(int *)*param_1 + 0x14))(&readByte,1,1); local_5c[0] = readByte; Checksum::Update(param_1 + 3,local_5c,1); local_4c = (int *)((int)local_4c + 1); } while (local_4c < local_54); piVar7 = playerState; } } (**(code **)(*(int *)*param_1 + 0x14))(piVar7 + 0x74,4,1); local_2c[0] = (int *)piVar7[0x74]; Checksum::Update(param_1 + 3,(byte *)local_2c,4); local_14 = (int *)0x1; std::vector<8byte>::resize(piVar7[0x74]); local_14 = (int *)0xffffffff; uVar2 = Entity_Player::restore_save_state_part2(); return uVar2; } } format = "[warn] Invalid trinket %d\n"; LAB_009d4590: uVar2 = 1; LAB_009d4592: KAGE_LogMessage(uVar2,(byte *)format); uVar2 = extraout_EAX_00; code_r0x009d459a: ExceptionList = local_1c; return uVar2 & 0xffffff00; } //@@ 009d16b0 Catch_All@009d16b0 undefined * Catch_All_009d16b0(void) { KAGE_LogMessage(1,(byte *)"[warn] Invalid costume count %d. Save file %s might be corrupt.\n"); return &UNK_009d16d8; } //@@ 009d16ee Entity_Player::restore_save_state_part2 /* DB: Ghidra split chunk (odd address) called only from 009d05d0 GameStatePlayer::read restore from save state: "Invalid player type", "Invalid voided active item"); saveStateSlot chunk restores costumes/familiars/history/pocket items/temporary effects with "[warn] Invalid ... Save file %s might be corrupt" logs; EntitySaveState::copy */ undefined4 Entity_Player::restore_save_state_part2(void) { void *pvVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; char cVar6; byte bVar7; uint uVar8; undefined4 uVar9; void *pvVar10; int iVar11; ItemConfig_Item *collectibleConfig; undefined1 uVar12; int iVar13; void *checksum; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; void *checksum2; byte bVar14; uint uVar15; uint *puVar16; int unaff_EBX; int unaff_EBP; int unaff_ESI; undefined4 *puVar17; undefined4 *fieldPtr; ushort *shortField; byte *shortArrayField; int *piVar18; undefined1 *byteField; Manager *manager; undefined4 *unaff_EDI; int iVar19; char *format; EntitySaveState *saveStateSlot; iVar19 = *(int *)(unaff_ESI + 0x1d0); *(undefined4 *)(unaff_EBP + -0x44) = 0; if (iVar19 != 0) { do { cVar6 = (**(code **)(*(int *)*unaff_EDI + 0x10))(); if (cVar6 != '\0') goto LAB_009d1988; iVar19 = *(int *)(unaff_EBP + -0x44) * 8; puVar17 = (undefined4 *)(*(int *)(unaff_ESI + 0x1d4) + iVar19); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar17 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x1d4) + 4 + iVar19); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); unaff_ESI = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(*(int *)(unaff_ESI + 0x1d4) + 4 + iVar19) ; cVar6 = is_valid_item_config_id(); if (cVar6 == '\0') { KAGE_LogMessage(1,(byte *)"[warn] Invalid costume (type: %d, ID: %d)\n"); goto code_r0x009d459a; } unaff_EDI = *(undefined4 **)(unaff_EBX + 8); uVar8 = *(int *)(unaff_EBP + -0x44) + 1; *(uint *)(unaff_EBP + -0x44) = uVar8; } while (uVar8 < *(uint *)(unaff_ESI + 0x1d0)); } puVar17 = *(undefined4 **)(unaff_EBX + 8); uVar8 = puVar17[2]; if (0x2f < uVar8) { GameStateReader::read_int_vector(unaff_ESI + 0x194); GameStateReader::read_int_vector(unaff_ESI + 0x1a0); GameStateReader::read_int_vector(unaff_ESI + 0x1ac); GameStateReader::read_int_vector(unaff_ESI + 0x1b8); uVar8 = puVar17[2]; } if (0x2e < uVar8) { GameStateReader::read_int_vector((int *)(unaff_ESI + 0x1c4)); iVar13 = 0; iVar19 = *(int *)(unaff_ESI + 0x1c8) - *(int *)(unaff_ESI + 0x1c4) >> 2; *(int *)(unaff_EBP + -0x1c) = iVar19; if (0 < iVar19) { do { if (0 < iVar13) { pvVar10 = (g_manager->_itemConfig)._pillEffects._begin; if (((int)(g_manager->_itemConfig)._pillEffects._end - (int)pvVar10 >> 2 <= iVar13) || (*(int *)((int)pvVar10 + iVar13 * 4) == 0)) { format = "Invalid pill effect %d\n"; goto LAB_009d4590; } iVar19 = *(int *)(unaff_EBP + -0x1c); } iVar13 = iVar13 + 1; } while (iVar13 < iVar19); } } fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x1ec); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x204); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar19 = *(int *)(unaff_EBP + -0x24) + 0x1f0; *(undefined4 *)(unaff_EBP + -0x3c) = 5; *(int *)(unaff_EBP + -0x44) = iVar19; do { (**(code **)(*(int *)*puVar17 + 0x14))(iVar19,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = **(undefined4 **)(unaff_EBP + -0x44); Checksum::Update(checksum,(byte *)(unaff_EBP + -0x1c),4); iVar19 = *(int *)(unaff_EBP + -0x44) + 4; piVar18 = (int *)(unaff_EBP + -0x3c); *piVar18 = *piVar18 + -1; *(int *)(unaff_EBP + -0x44) = iVar19; } while (*piVar18 != 0); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x208); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar19 = *(int *)(unaff_EBP + -0x24); if ((uint)puVar17[2] < 0x4d) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x3c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x3c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); *(undefined2 *)(iVar19 + 0x20c) = *(undefined2 *)(unaff_EBP + -0x3c); } else { (**(code **)(*(int *)*puVar17 + 0x14))(iVar19 + 0x20c,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(iVar19 + 0x20c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); (**(code **)(*(int *)*puVar17 + 0x14))((ushort *)(iVar19 + 0x20e),2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(iVar19 + 0x20e); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); iVar19 = *(int *)(unaff_EBP + -0x24); } (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x210),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x210); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x214); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x218); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; if (0x1e < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x21c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x220); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x224); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } iVar19 = *(int *)(unaff_EBP + -0x24); if (0x1d < uVar8) { iVar13 = *(int *)*puVar17; *(int *)(unaff_EBP + -0x50) = iVar19 + 0x22c; (**(code **)(iVar13 + 0x14))(iVar19 + 0x22c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x22c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar13 = *(int *)(iVar19 + 0x22c); *(undefined4 *)(unaff_EBP + -0x1c) = 10; piVar18 = (int *)(unaff_EBP + -0x1c); if (iVar13 < 0xb) { piVar18 = (int *)(iVar19 + 0x22c); } *(undefined4 *)(unaff_EBP + -0x44) = 0; iVar13 = *piVar18; *(int *)(iVar19 + 0x22c) = iVar13; if (0 < iVar13) { iVar19 = iVar19 + 0x234; *(int *)(unaff_EBP + -0x40) = iVar19; do { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + -4),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + -4); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(*(undefined4 *)(unaff_EBP + -0x40),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = **(undefined4 **)(unaff_EBP + -0x40); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x40) + 4); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x40) + 8); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x40) + 0xc); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x40) + 0x10); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; iVar19 = *(int *)(unaff_EBP + -0x40); *(undefined1 **)(unaff_EBP + -0x3c) = (undefined1 *)(iVar19 + 0x14); if (uVar8 < 0x74) { *(undefined1 *)(iVar19 + 0x14) = 0; } else { (**(code **)(*(int *)*puVar17 + 0x14))(*(undefined4 *)(unaff_EBP + -0x3c),1,1); *(undefined1 *)(unaff_EBP + -0x38) = **(undefined1 **)(unaff_EBP + -0x3c); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); iVar19 = *(int *)(unaff_EBP + -0x40); } iVar19 = iVar19 + 0x1c; iVar13 = *(int *)(unaff_EBP + -0x44) + 1; *(int *)(unaff_EBP + -0x44) = iVar13; *(int *)(unaff_EBP + -0x40) = iVar19; } while (iVar13 < **(int **)(unaff_EBP + -0x50)); iVar19 = *(int *)(unaff_EBP + -0x24); } } if (0x38 < (uint)puVar17[2]) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x50,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x50); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar13 = *(int *)(iVar19 + 0x1e8); iVar11 = *(int *)(iVar19 + 0x1e0); *(int **)(unaff_EBP + -0x3c) = (int *)(iVar19 + 0x1e0); uVar8 = *(uint *)(unaff_EBP + -0x50); if ((uint)((iVar13 - iVar11) / 0x78) < uVar8) { if (0x2222222 < uVar8) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate_exactly(uVar8); uVar8 = *(uint *)(unaff_EBP + -0x50); } *(undefined4 *)(unaff_EBP + -0x44) = 0; if (uVar8 != 0) { pvVar10 = *(void **)(unaff_EBP + -0x28); do { *(undefined4 *)(unaff_EBP + -0xf0) = 0; *(undefined4 *)(unaff_EBP + -0xec) = 0; *(undefined4 *)(unaff_EBP + -0xe8) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0xe4) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0x100) = 0; *(float *)(unaff_EBP + -0xd8) = g_vectorZero.x; *(float *)(unaff_EBP + -0xd4) = g_vectorZero.y; *(undefined4 *)(unaff_EBP + -0xfc) = 0; *(undefined4 *)(unaff_EBP + -0xf8) = 0; *(undefined4 *)(unaff_EBP + -0xf4) = 0; *(undefined4 *)(unaff_EBP + -0xe0) = 0; *(undefined4 *)(unaff_EBP + -0xdc) = 0; *(undefined4 *)(unaff_EBP + -0xd0) = 0; *(undefined4 *)(unaff_EBP + -0xcc) = 0; *(undefined4 *)(unaff_EBP + -200) = 0; *(undefined4 *)(unaff_EBP + -0xc4) = 0; *(undefined4 *)(unaff_EBP + -0xc0) = 0; *(undefined4 *)(unaff_EBP + -0xb8) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0xb4) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0xb0) = 0x42700000; *(undefined4 *)(unaff_EBP + -0xac) = 0x3f800000; *(undefined4 *)(unaff_EBP + -0xa8) = 0x3f800000; *(undefined4 *)(unaff_EBP + -0xa4) = 0; *(undefined1 *)(unaff_EBP + -0xa0) = 1; *(undefined4 *)(unaff_EBP + -0x9c) = 0; *(undefined4 *)(unaff_EBP + -0x98) = 0; *(undefined4 *)(unaff_EBP + -0x94) = 0; *(undefined4 *)(unaff_EBP + -0x90) = 0; *(undefined4 *)(unaff_EBP + -4) = 3; if ((uint)puVar17[2] < 0x67) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x100,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x100); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xfc,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0xfc); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xf8,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0xf8); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xf0,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0xf0); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xcc,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0xcc); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; if (0x5a < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xd0,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0xd0); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xde,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0xde); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); uVar8 = puVar17[2]; } if (0x5d < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0xdd,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0xdd); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),2); *(int *)(unaff_EBP + -0xf4) = (int)*(short *)(unaff_EBP + -0x30); } } else { read_entity_save_state_tree((void *)(unaff_EBP + -0x100),puVar17); } saveStateSlot = *(EntitySaveState **)(*(int *)(unaff_EBP + -0x3c) + 4); if (saveStateSlot == *(EntitySaveState **)(*(int *)(unaff_EBP + -0x3c) + 8)) { std::vector::_Emplace_reallocate(saveStateSlot,unaff_EBP + -0x100); } else { EntitySaveState::copy(saveStateSlot,(void *)(unaff_EBP + -0x100)); piVar18 = (int *)(*(int *)(unaff_EBP + -0x3c) + 4); *piVar18 = *piVar18 + 0x78; } *(undefined4 *)(unaff_EBP + -4) = 4; if (((*(int **)(unaff_EBP + -0x90) != (int *)0x0) && (cVar6 = (**(code **)(**(int **)(unaff_EBP + -0x90) + 0xc))(), cVar6 != '\0')) && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(unaff_EBP + -0x94); } *(undefined4 *)(unaff_EBP + -4) = 5; if (((*(int **)(unaff_EBP + -0x98) != (int *)0x0) && (cVar6 = (**(code **)(**(int **)(unaff_EBP + -0x98) + 0xc))(), cVar6 != '\0')) && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) { (*g_entitySaveStateExtraDataReleaseFn)(unaff_EBP + -0x9c); } *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; uVar8 = *(int *)(unaff_EBP + -0x44) + 1; *(uint *)(unaff_EBP + -0x44) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x50)); iVar19 = *(int *)(unaff_EBP + -0x24); } } (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x348),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x348); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x34c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x350); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x354); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x358); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x35c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x360); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x364); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x368); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar19 = *(int *)(unaff_EBP + -0x24); if ((uint)puVar17[2] < 0x8c) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1c,4,1); *(undefined4 *)(unaff_EBP + -0x3c) = *(undefined4 *)(unaff_EBP + -0x1c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x3c),4); *(undefined4 *)(iVar19 + 0x36c) = 0; } else { (**(code **)(*(int *)*puVar17 + 0x14))(iVar19 + 0x36c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x36c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); } if ((uint)puVar17[2] < 0x23) { *(undefined4 *)(iVar19 + 0x370) = 0; } else { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x370),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x370); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); } if (0x1f < (uint)puVar17[2]) { iVar13 = *(int *)*puVar17; *(int *)(unaff_EBP + -0x44) = iVar19 + 0x37c; (**(code **)(iVar13 + 0x14))(iVar19 + 0x37c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x37c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -4) = 6; uVar9 = *(undefined4 *)(iVar19 + 0x37c); *(int *)(unaff_EBP + -0x40) = iVar19 + 0x380; std::vector<52byte>::resize(uVar9); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; iVar19 = *(int *)(iVar19 + 0x37c); *(undefined4 *)(unaff_EBP + -0x3c) = 0; if (iVar19 != 0) { *(undefined4 *)(unaff_EBP + -0x30) = 0; do { cVar6 = (**(code **)(*(int *)*puVar17 + 0x10))(); if (cVar6 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid familiar count %d. Save file %s might be corrupt.\n"); goto code_r0x009d459a; } fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + 4 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + 8 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + 0xc + *(int *)(unaff_EBP + -0x30)) ; (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x10 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x14 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x18 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x1c + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; if (0x54 < uVar8) { fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x20 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x24 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (0x59 < uVar8) { fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + 0x28 + *(int *)(unaff_EBP + -0x30)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } iVar19 = **(int **)(unaff_EBP + -0x40); if (uVar8 < 0x8f) { *(undefined4 *)(iVar19 + 0x2c + *(int *)(unaff_EBP + -0x30)) = *(undefined4 *)(iVar19 + *(int *)(unaff_EBP + -0x30)); } else { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x30) + 0x2c + iVar19); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); } cVar6 = '\0'; uVar8 = puVar17[2]; *(undefined1 *)(unaff_EBP + -0x1d) = 0; if (0x9b < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); cVar6 = *(char *)(unaff_EBP + -0x1d); } *(bool *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x30) + 0x30) = cVar6 != '\0'; cVar6 = '\0'; uVar8 = puVar17[2]; *(undefined1 *)(unaff_EBP + -0x29) = 0; if (0x9f < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); cVar6 = *(char *)(unaff_EBP + -0x29); } iVar19 = *(int *)(unaff_EBP + -0x30); *(bool *)(**(int **)(unaff_EBP + -0x40) + 0x31 + iVar19) = cVar6 != '\0'; *(int *)(unaff_EBP + -0x30) = iVar19 + 0x34; uVar8 = *(int *)(unaff_EBP + -0x3c) + 1; *(uint *)(unaff_EBP + -0x3c) = uVar8; } while (uVar8 < **(uint **)(unaff_EBP + -0x44)); } } if (0x3f < (uint)puVar17[2]) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x38),1); *(undefined4 *)(unaff_EBP + -4) = 8; vector28_resize(*(undefined1 *)(unaff_EBP + -0x1d)); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; uVar9 = GameStatePlayer::read_part3(); return uVar9; } if ((uint)puVar17[2] < 0x41) { uVar9 = *(undefined4 *)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x34) = uVar9; LAB_009d29c0: iVar19 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x28) = uVar9; } else { shortField = (ushort *)(*(int *)(unaff_EBP + -0x24) + 0x3b8); (**(code **)(*(int *)*puVar17 + 0x14))(shortField,2,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(uint *)(unaff_EBP + -0x1c) = (uint)*shortField; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),2); uVar8 = puVar17[2]; if (0x57 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x430); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (uVar8 < 0x72) { iVar19 = *(int *)(unaff_EBP + -0x24); } else { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),2); iVar19 = *(int *)(unaff_EBP + -0x24); *(int *)(iVar19 + 0x434) = (int)*(short *)(unaff_EBP + -0x30); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); *(undefined2 *)(iVar19 + 0x438) = *(undefined2 *)(unaff_EBP + -0x30); uVar8 = puVar17[2]; } *(undefined4 *)(unaff_EBP + -0x28) = *(undefined4 *)(unaff_EBP + -0x34); if (uVar8 < 0x4f) { pvVar10 = *(void **)(unaff_EBP + -0x34); } else { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x43c),4,1); pvVar10 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x43c); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (0x4f < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x440); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x444); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (0x51 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x448); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (0x5a < uVar8) { shortArrayField = (byte *)(*(int *)(unaff_EBP + -0x24) + 0x458); (**(code **)(*(int *)*puVar17 + 0x14))(shortArrayField,2,6); Checksum::Update(*(void **)(unaff_EBP + -0x34),shortArrayField,0xc); shortArrayField = (byte *)(*(int *)(unaff_EBP + -0x24) + 0x464); (**(code **)(*(int *)*puVar17 + 0x14))(shortArrayField,2,6); Checksum::Update(*(void **)(unaff_EBP + -0x34),shortArrayField,0xc); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x470); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } uVar9 = *(undefined4 *)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x3c) = uVar9; *(void **)(unaff_EBP + -0x48) = pvVar10; if (uVar8 < 0x5d) { iVar19 = *(int *)(unaff_EBP + -0x24); *(void **)(unaff_EBP + -0x34) = pvVar10; *(undefined4 *)(unaff_EBP + -0x28) = uVar9; if (0x5b < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x44c),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x44c); Checksum::Update(*(void **)(unaff_EBP + -0x48),(byte *)(unaff_EBP + -0x1c),4); uVar9 = *(undefined4 *)(unaff_EBP + -0x3c); *(undefined4 *)(unaff_EBP + -0x34) = extraout_ECX; goto LAB_009d29c0; } } else { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); iVar19 = *(int *)(unaff_EBP + -0x24); *(uint *)(iVar19 + 0x44c) = (uint)*(byte *)(unaff_EBP + -0x1d); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x38),1); *(uint *)(iVar19 + 0x454) = (uint)*(byte *)(unaff_EBP + -0x1d); } } uVar8 = puVar17[2]; if (0x62 < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x38),1); *(uint *)(iVar19 + 0x450) = (uint)*(byte *)(unaff_EBP + -0x29); uVar8 = puVar17[2]; } uVar9 = *(undefined4 *)(unaff_EBP + -0x28); if (0x5e < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x474),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x474); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x478); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x47c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x480); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x484); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x488); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; uVar9 = *(undefined4 *)(unaff_EBP + -0x28); } *(undefined4 *)(unaff_EBP + -0x40) = uVar9; *(undefined4 *)(unaff_EBP + -0x48) = uVar9; if (uVar8 < 0x60) { LAB_009d2c5b: puVar17 = *(undefined4 **)(unaff_EBX + 8); uVar8 = puVar17[2]; if (uVar8 < 0x61) { pvVar10 = *(void **)(unaff_EBP + -0x28); } else { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x490); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (0x61 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x494); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (uVar8 < 100) { uVar9 = *(undefined4 *)(unaff_EBP + -0x40); *(undefined4 *)(unaff_EBP + -0x40) = uVar9; } else { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),2); iVar19 = *(int *)(unaff_EBP + -0x24); *(int *)(iVar19 + 0x498) = (int)*(short *)(unaff_EBP + -0x30); uVar8 = puVar17[2]; if (0x69 < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x49c),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x49c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4a0); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4a4); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4a8); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; iVar19 = *(int *)(unaff_EBP + -0x24); } if (0x6b < uVar8) { uVar9 = 4; (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x4ac),4,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x4ac); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); if ((uint)puVar17[2] < 0x90) { *(undefined4 *)(unaff_EBP + -100) = 0; *(undefined4 *)(unaff_EBP + -0x60) = 0; *(undefined4 *)(unaff_EBP + -0x5c) = 0; *(undefined4 *)(unaff_EBP + -0x58) = 0; *(undefined4 *)(unaff_EBP + -4) = 0xc; *(undefined4 *)(unaff_EBP + -0x88) = 0; *(undefined4 *)(unaff_EBP + -0x84) = 0; *(undefined4 *)(unaff_EBP + -0x80) = 0; *(undefined4 *)(unaff_EBP + -0x7c) = 0; *(undefined1 *)(unaff_EBP + -4) = 0xd; GameStateReader::read_bool_vector(0); GameStateReader::read_bool_vector(0); iVar19 = *(int *)(unaff_EBP + -0x24); uVar8 = 0; *(undefined4 *)(unaff_EBP + -0x34) = 0; if (*(int *)(unaff_EBP + -0x58) != 0) { do { if (2 < *(uint *)(iVar19 + 0x4c0)) break; if ((*(uint *)(*(int *)(unaff_EBP + -100) + (uVar8 >> 5) * 4) & 1 << ((byte)uVar8 & 0x1f)) == 0) { iVar13 = *(int *)(unaff_EBP + -0x34); } else { uVar8 = *(uint *)(iVar19 + 0x4bc); *(uint *)(unaff_EBP + -0x44) = uVar8; if (((uVar8 & 1) == 0) && (*(uint *)(unaff_EBP + -0x44) = uVar8, *(uint *)(iVar19 + 0x4b8) <= *(int *)(iVar19 + 0x4c0) + 2U >> 1)) { std::deque::_Growmap(*(int *)(unaff_EBP + -100)); *(undefined4 *)(unaff_EBP + -0x44) = *(undefined4 *)(iVar19 + 0x4bc); } iVar13 = *(int *)(iVar19 + 0x4b8); uVar8 = iVar13 * 2; uVar15 = uVar8 - 1 & *(uint *)(unaff_EBP + -0x44); *(uint *)(iVar19 + 0x4bc) = uVar15; if (uVar15 == 0) { uVar15 = uVar8; } *(uint *)(unaff_EBP + -0x50) = uVar15; *(uint *)(unaff_EBP + -0x50) = uVar15 - 1; uVar8 = uVar15 - 1 >> 1 & iVar13 - 1U; iVar13 = *(int *)(iVar19 + 0x4b4); *(uint *)(unaff_EBP + -0x48) = uVar8; iVar11 = iVar19; if (*(int *)(iVar13 + uVar8 * 4) == 0) { pvVar10 = operator_new(0x10); *(void **)(*(int *)(iVar19 + 0x4b4) + uVar8 * 4) = pvVar10; iVar11 = *(int *)(unaff_EBP + -0x24); } uVar8 = *(uint *)(unaff_EBP + -0x50) & 1; iVar2 = *(int *)(*(int *)(iVar19 + 0x4b4) + *(int *)(unaff_EBP + -0x48) * 4); iVar13 = *(int *)(unaff_EBP + -0x34); *(int *)(iVar2 + uVar8 * 8) = iVar13; *(undefined4 *)(iVar2 + 4 + uVar8 * 8) = 1; *(int *)(iVar19 + 0x4c0) = *(int *)(iVar19 + 0x4c0) + 1; puVar17 = *(undefined4 **)(unaff_EBX + 8); *(undefined4 *)(iVar19 + 0x4bc) = *(undefined4 *)(unaff_EBP + -0x50); iVar19 = iVar11; if ((0 < iVar13) && ((pvVar10 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar10 >> 2 <= iVar13 || (*(int *)((int)pvVar10 + iVar13 * 4) == 0)))) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pocket item (type: %d, ID: %d)\n"); pvVar10 = *(void **)(unaff_EBP + -0x88); if (pvVar10 != (void *)0x0) { deallocate(pvVar10,*(int *)(unaff_EBP + -0x80) - (int)pvVar10 >> 2); } pvVar10 = *(void **)(unaff_EBP + -100); if (pvVar10 == (void *)0x0) { uVar9 = FUN_009d459a(uVar9); return uVar9; } deallocate(pvVar10,*(int *)(unaff_EBP + -0x5c) - (int)pvVar10 >> 2); goto code_r0x009d459a; } } uVar8 = iVar13 + 1; *(uint *)(unaff_EBP + -0x34) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x58)); } uVar8 = 0; *(undefined4 *)(unaff_EBP + -0x44) = 0; if (*(int *)(unaff_EBP + -0x7c) != 0) { do { if (2 < *(uint *)(iVar19 + 0x4c0)) break; if ((*(uint *)(*(int *)(unaff_EBP + -0x88) + (uVar8 >> 5) * 4) & 1 << ((byte)uVar8 & 0x1f)) != 0) { uVar8 = *(uint *)(iVar19 + 0x4bc); *(uint *)(unaff_EBP + -0x34) = uVar8; if (((uVar8 & 1) == 0) && (*(uint *)(unaff_EBP + -0x34) = uVar8, *(uint *)(iVar19 + 0x4b8) <= *(int *)(iVar19 + 0x4c0) + 2U >> 1)) { std::deque::_Growmap(iVar19 + 0x4b0); *(undefined4 *)(unaff_EBP + -0x34) = *(undefined4 *)(iVar19 + 0x4bc); } iVar13 = *(int *)(iVar19 + 0x4b8); iVar2 = iVar13 * 2; puVar16 = (uint *)(unaff_EBP + -0x34); *puVar16 = *puVar16 & iVar2 - 1U; uVar8 = *puVar16; iVar11 = *(int *)(unaff_EBP + -0x34); *(int *)(iVar19 + 0x4bc) = iVar11; if (uVar8 == 0) { iVar11 = iVar2; } *(uint *)(unaff_EBP + -0x34) = iVar11 - 1U; uVar8 = iVar11 - 1U >> 1 & iVar13 - 1U; iVar13 = *(int *)(iVar19 + 0x4b4); *(uint *)(unaff_EBP + -0x48) = uVar8; if (*(int *)(iVar13 + uVar8 * 4) == 0) { pvVar10 = operator_new(0x10); *(void **)(*(int *)(iVar19 + 0x4b4) + *(int *)(unaff_EBP + -0x48) * 4) = pvVar10; } uVar8 = *(uint *)(unaff_EBP + -0x34); uVar15 = uVar8 & 1; iVar13 = *(int *)(*(int *)(iVar19 + 0x4b4) + *(int *)(unaff_EBP + -0x48) * 4); *(undefined4 *)(iVar13 + uVar15 * 8) = *(undefined4 *)(unaff_EBP + -0x44); puVar17 = *(undefined4 **)(unaff_EBX + 8); *(undefined4 *)(iVar13 + 4 + uVar15 * 8) = 0; *(int *)(iVar19 + 0x4c0) = *(int *)(iVar19 + 0x4c0) + 1; *(uint *)(iVar19 + 0x4bc) = uVar8; } uVar8 = *(int *)(unaff_EBP + -0x44) + 1; *(uint *)(unaff_EBP + -0x44) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x7c)); } pvVar10 = *(void **)(unaff_EBP + -0x88); if (pvVar10 != (void *)0x0) { deallocate(pvVar10,*(int *)(unaff_EBP + -0x80) - (int)pvVar10 >> 2); } *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; pvVar10 = *(void **)(unaff_EBP + -100); if (pvVar10 != (void *)0x0) { deallocate(pvVar10,*(int *)(unaff_EBP + -0x5c) - (int)pvVar10 >> 2); } } else { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x38),1); *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x29) != '\0') { do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x4c,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x4c); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x30),1); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x48,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x48); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); if (((*(char *)(unaff_EBP + -0x4c) == '\x01') && (iVar19 = *(int *)(unaff_EBP + -0x48), 0 < iVar19)) && ((pvVar1 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar1 >> 2 <= iVar19 || (*(int *)((int)pvVar1 + iVar19 * 4) == 0)))) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pocket item (type: %d, ID: %d)\n"); goto code_r0x009d459a; } bVar7 = *(char *)(unaff_EBP + -0x35) + 1; *(byte *)(unaff_EBP + -0x35) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x29)); } } piVar18 = (int *)(*(int *)(unaff_EBP + -0x24) + 0x4c4); *(int **)(unaff_EBP + -0x1c) = piVar18; FUN_007dccd0(8); uVar8 = 0; *(undefined4 *)(unaff_EBP + -0x48) = 0; do { iVar19 = *piVar18; (**(code **)(*(int *)*puVar17 + 0x14))((undefined1 *)(iVar19 + uVar8),1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar19 + uVar8); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); piVar18 = *(int **)(unaff_EBP + -0x1c); uVar8 = *(int *)(unaff_EBP + -0x48) + 1; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < 8); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4d0); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); if (0x98 < (uint)puVar17[2]) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4d4); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); } *(int *)(unaff_EBP + -0x1c) = *(int *)(unaff_EBP + -0x24) + 0x4dc; FUN_007dccd0(6); uVar8 = 0; *(undefined4 *)(unaff_EBP + -0x48) = 0; do { byteField = (undefined1 *)(**(int **)(unaff_EBP + -0x1c) + uVar8); (**(code **)(*(int *)*puVar17 + 0x14))(byteField,1,1); pvVar10 = *(void **)(unaff_EBP + -0x28); *(undefined1 *)(unaff_EBP + -0x30) = *byteField; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x30),1); uVar8 = *(int *)(unaff_EBP + -0x48) + 1; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < 6); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x30),1); uVar12 = *(undefined1 *)(unaff_EBP + -0x1d); if (0x14 < *(byte *)(unaff_EBP + -0x1d)) { uVar12 = 0x14; } piVar18 = (int *)(*(int *)(unaff_EBP + -0x24) + 0x4e8); *(undefined1 *)(unaff_EBP + -0x1d) = uVar12; *(int **)(unaff_EBP + -0x1c) = piVar18; FUN_007dccd0(uVar12); uVar8 = 0; *(undefined4 *)(unaff_EBP + -0x48) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { do { iVar19 = *piVar18; (**(code **)(*(int *)*puVar17 + 0x14))((undefined1 *)(iVar19 + uVar8),1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar19 + uVar8); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); uVar8 = *(int *)(unaff_EBP + -0x48) + 1; piVar18 = *(int **)(unaff_EBP + -0x1c); *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < *(byte *)(unaff_EBP + -0x1d)); } byteField = (undefined1 *)(*(int *)(unaff_EBP + -0x24) + 0x4f4); (**(code **)(*(int *)*puVar17 + 0x14))(byteField,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *byteField; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4d8); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4f8); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4fc); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x528); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); } uVar9 = *(undefined4 *)(unaff_EBP + -0x40); } uVar8 = puVar17[2]; *(undefined4 *)(unaff_EBP + -0x34) = uVar9; if (0x74 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x52c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; *(undefined4 *)(unaff_EBP + -0x40) = extraout_ECX_00; } if (0x75 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x514); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (0x77 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x530); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } iVar19 = *(int *)(unaff_EBP + -0x24); if (0x7d < uVar8) { GameStatePlayer::read_block_538(puVar17); uVar8 = puVar17[2]; } if (uVar8 < 0xa4) { *(undefined4 *)(iVar19 + 0x564) = *(undefined4 *)(iVar19 + 4); } else { piVar18 = (int *)*puVar17; *(undefined4 *)(unaff_EBP + -0x38) = 0; (**(code **)(*piVar18 + 0x14))(unaff_EBP + -0x38,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x38); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -4) = 0xe; *(int *)(unaff_EBP + -0x40) = iVar19 + 0x558; std::vector<52byte>::resize(*(undefined4 *)(unaff_EBP + -0x38)); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0x48) = 0; if (0 < *(int *)(unaff_EBP + -0x38)) { *(undefined4 *)(unaff_EBP + -0x28) = 0; do { cVar6 = (**(code **)(*(int *)*puVar17 + 0x10))(); if (cVar6 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid familiar count %d. Save file %s might be corrupt.\n"); goto code_r0x009d459a; } fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28)); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 4) ; (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 8) ; (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0xc); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x10); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x14); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x18); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x1c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x20); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x24); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x28); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x2c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); pvVar10 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); piVar18 = (int *)*puVar17; *(undefined1 *)(unaff_EBP + -0x29) = 0; (**(code **)(*piVar18 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x30),1); *(bool *)(*(int *)(unaff_EBP + -0x28) + 0x30 + **(int **)(unaff_EBP + -0x40)) = *(char *)(unaff_EBP + -0x29) != '\0'; piVar18 = (int *)*puVar17; *(undefined1 *)(unaff_EBP + -0x1d) = 0; (**(code **)(*piVar18 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x30),1); iVar19 = *(int *)(unaff_EBP + -0x28); *(bool *)(iVar19 + 0x31 + **(int **)(unaff_EBP + -0x40)) = *(char *)(unaff_EBP + -0x1d) != '\0'; iVar13 = *(int *)(unaff_EBP + -0x48) + 1; *(int *)(unaff_EBP + -0x28) = iVar19 + 0x34; *(int *)(unaff_EBP + -0x48) = iVar13; } while (iVar13 < *(int *)(unaff_EBP + -0x38)); iVar19 = *(int *)(unaff_EBP + -0x24); } (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x564),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x564); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); iVar19 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x40) = extraout_ECX_01; } uVar8 = puVar17[2]; if (0x7f < uVar8) { *(undefined4 *)(unaff_EBP + -0x48) = 0; *(int *)(unaff_EBP + -0x50) = iVar19 + 0x568; do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); *(undefined4 *)(unaff_EBP + -0x44) = 0; *(int *)(*(int *)(unaff_EBP + -0x50) + 4) = (int)*(char *)(unaff_EBP + -0x29); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x44,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x44); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); cVar6 = *(char *)(unaff_EBP + -0x29); piVar18 = *(int **)(unaff_EBP + -0x50); iVar13 = *(int *)(unaff_EBP + -0x44); *piVar18 = iVar13; if ((cVar6 == '\x01') && (0 < iVar13)) { pvVar10 = (g_manager->_itemConfig)._cards._begin; pvVar1 = (g_manager->_itemConfig)._cards._end; *(void **)(unaff_EBP + -0x1c) = pvVar10; iVar19 = *(int *)(unaff_EBP + -0x24); if (((int)pvVar1 - (int)pvVar10 >> 2 <= iVar13) || (*(int *)(*(int *)(unaff_EBP + -0x1c) + iVar13 * 4) == 0)) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pre curse pocket item (type: %d, ID: %d)\n"); goto code_r0x009d459a; } } uVar8 = *(int *)(unaff_EBP + -0x48) + 1; *(int **)(unaff_EBP + -0x50) = piVar18 + 2; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x74)); (**(code **)(*(int *)*puVar17 + 0x14))(iVar19 + 0x588,4,2); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(iVar19 + 0x588),8); uVar8 = 0; puVar16 = (uint *)(iVar19 + 0x588); *(undefined4 *)(unaff_EBP + -0x48) = 0; do { uVar15 = *puVar16; *(uint *)(unaff_EBP + -0x1c) = uVar15; if (0 < (int)uVar15) { puVar17 = *(undefined4 **)(unaff_EBX + 8); if (((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 <= (int)(uVar15 & 0x7fff)) || (iVar19 = *(int *)(unaff_EBP + -0x24), *(int *)((int)(g_manager->_itemConfig)._trinkets._begin + (uVar15 & 0x7fff) * 4) == 0)) { format = "[warn] Invalid pre curse trinket %d\n"; goto LAB_009d4590; } uVar8 = *(uint *)(unaff_EBP + -0x48); } uVar8 = uVar8 + 1; puVar16 = puVar16 + 1; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < 2); uVar8 = puVar17[2]; } if (0x81 < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))(iVar19 + 0x590,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar19 + 0x590); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); *(undefined4 *)(unaff_EBP + -0x48) = 0; *(int *)(unaff_EBP + -0x50) = iVar19 + 0x598; do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x35,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x35); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); *(undefined4 *)(unaff_EBP + -0x44) = 0; **(int **)(unaff_EBP + -0x50) = (int)*(char *)(unaff_EBP + -0x35); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x44,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x44); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); piVar18 = *(int **)(unaff_EBP + -0x50); iVar13 = *(int *)(unaff_EBP + -0x44); piVar18[-1] = iVar13; if (((*(char *)(iVar19 + 0x590) != '\0') && (iVar11 = *piVar18, *(int *)(unaff_EBP + -0x3c) = iVar11, iVar11 == 1)) && (0 < iVar13)) { pvVar10 = (g_manager->_itemConfig)._cards._begin; pvVar1 = (g_manager->_itemConfig)._cards._end; *(void **)(unaff_EBP + -0x1c) = pvVar10; iVar19 = *(int *)(unaff_EBP + -0x24); if (((int)pvVar1 - (int)pvVar10 >> 2 <= iVar13) || (*(int *)(*(int *)(unaff_EBP + -0x1c) + iVar13 * 4) == 0)) { KAGE_LogMessage(1,(byte *) "[warn] Invalid pre coop ghost pocket item (type: %d, ID: %d)\n"); goto code_r0x009d459a; } } uVar8 = *(int *)(unaff_EBP + -0x48) + 1; *(int **)(unaff_EBP + -0x50) = piVar18 + 2; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x74)); (**(code **)(*(int *)*puVar17 + 0x14))(iVar19 + 0x5b4,4,2); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(iVar19 + 0x5b4),8); cVar6 = *(char *)(iVar19 + 0x590); puVar16 = (uint *)(iVar19 + 0x5b4); uVar8 = 0; *(char *)(unaff_EBP + -0x35) = cVar6; *(undefined4 *)(unaff_EBP + -0x48) = 0; do { if (cVar6 != '\0') { uVar15 = *puVar16; *(uint *)(unaff_EBP + -0x1c) = uVar15; if (0 < (int)uVar15) { puVar17 = *(undefined4 **)(unaff_EBX + 8); if (((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 <= (int)(uVar15 & 0x7fff)) || (iVar19 = *(int *)(unaff_EBP + -0x24), *(int *)((int)(g_manager->_itemConfig)._trinkets._begin + (uVar15 & 0x7fff) * 4) == 0 )) { format = "[warn] Invalid pre coop ghost trinket %d\n"; goto LAB_009d4590; } uVar8 = *(uint *)(unaff_EBP + -0x48); } cVar6 = *(char *)(unaff_EBP + -0x35); } uVar8 = uVar8 + 1; puVar16 = puVar16 + 1; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < 2); uVar8 = puVar17[2]; } if (0x80 < uVar8) { (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x5c8),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x5c8); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } if (uVar8 < 0x82) { pvVar10 = *(void **)(unaff_EBP + -0x40); *(void **)(unaff_EBP + -0x28) = pvVar10; } else { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x5cc); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x40),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; if (0xa7 < uVar8) { byteField = (undefined1 *)(*(int *)(unaff_EBP + -0x24) + 0x5d0); (**(code **)(*(int *)*puVar17 + 0x14))(byteField,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *byteField; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); uVar8 = puVar17[2]; } if (0xa8 < uVar8) { byteField = (undefined1 *)(*(int *)(unaff_EBP + -0x24) + 0x5d1); (**(code **)(*(int *)*puVar17 + 0x14))(byteField,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *byteField; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); uVar8 = puVar17[2]; } pvVar10 = *(void **)(unaff_EBP + -0x40); *(void **)(unaff_EBP + -0x28) = pvVar10; if (0x82 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x524); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; pvVar10 = *(void **)(unaff_EBP + -0x28); } } if (uVar8 < 0x6e) { LAB_009d3eb4: iVar19 = *(int *)(unaff_EBP + -0x24); } else { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x30),1); iVar19 = *(int *)(unaff_EBP + -0x24); *(int *)(unaff_EBP + -0x48) = iVar19 + 0x500; std::vector<4byte>::resize(*(undefined1 *)(unaff_EBP + -0x1d)); uVar8 = 0; *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { iVar19 = **(int **)(unaff_EBP + -0x48); do { puVar17 = (undefined4 *)(iVar19 + uVar8 * 4); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar19 = **(int **)(unaff_EBP + -0x48); *(int *)(unaff_EBP + -0x1c) = iVar19; iVar13 = *(int *)(iVar19 + uVar8 * 4); if (0 < iVar13) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar13); if (collectibleConfig == (ItemConfig_Item *)0x0) { format = "[warn] Invalid item card %d\n"; goto LAB_009d4590; } iVar19 = *(int *)(unaff_EBP + -0x1c); } bVar7 = *(char *)(unaff_EBP + -0x35) + 1; uVar8 = (uint)bVar7; *(byte *)(unaff_EBP + -0x35) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x1d)); puVar17 = *(undefined4 **)(unaff_EBX + 8); goto LAB_009d3eb4; } } if ((uint)puVar17[2] < 0x6f) { LAB_009d3f14: uVar8 = puVar17[2]; if (0x72 < uVar8) { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x510); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar8 = puVar17[2]; } iVar19 = *(int *)(unaff_EBP + -0x24); if (0x7e < uVar8) { iVar13 = *(int *)*puVar17; *(int *)(unaff_EBP + -0x3c) = iVar19 + 0x5bc; (**(code **)(iVar13 + 0x14))(iVar19 + 0x5bc,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar19 + 0x5bc); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); if (*(char *)(iVar19 + 0x5bc) != -1) { iVar13 = *(int *)*puVar17; *(int *)(unaff_EBP + -0x48) = iVar19 + 0x5c0; (**(code **)(iVar13 + 0x14))(iVar19 + 0x5c0,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x5c0); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))((undefined4 *)(iVar19 + 0x5c4),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar19 + 0x5c4); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); cVar6 = **(char **)(unaff_EBP + -0x3c); *(char *)(unaff_EBP + -0x2d) = cVar6; if (cVar6 == '\x02') { iVar19 = **(int **)(unaff_EBP + -0x48); *(int *)(unaff_EBP + -0x1c) = iVar19; manager = g_manager; if (0 < iVar19) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar19); if (collectibleConfig == (ItemConfig_Item *)0x0) { format = "[warn] Invalid active item wildcard effect %d\n"; goto LAB_009d4590; } goto LAB_009d4022; } } else { manager = g_manager; LAB_009d4022: iVar19 = **(int **)(unaff_EBP + -0x48); if (((*(char *)(unaff_EBP + -0x2d) == '\x01') && (0 < iVar19)) && ((pvVar10 = (manager->_itemConfig)._cards._begin, (int)(manager->_itemConfig)._cards._end - (int)pvVar10 >> 2 <= iVar19 || (*(int *)((int)pvVar10 + iVar19 * 4) == 0)))) { KAGE_LogMessage(1,(byte *) "[warn] Invalid pocket item wildcard effect (type: %d, id: %d)\n"); goto code_r0x009d459a; } } iVar19 = *(int *)(unaff_EBP + -0x24); } } if (0x42 < (uint)puVar17[2]) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x44,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x44); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -0x48) = 0; if (*(int *)(unaff_EBP + -0x44) != 0) { do { cVar6 = (**(code **)(*(int *)*puVar17 + 0x10))(); if (cVar6 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid history count %d. Save file %s might be corrupt.\n") ; } (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x3c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x3c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x74,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x74); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x34,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x34); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x50,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x50); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x38,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x38); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar8 = *(uint *)(unaff_EBP + -0x3c); uVar15 = uVar8 & 0xffffff; *(uint *)(unaff_EBP + -0x1c) = uVar15; *(uint *)(unaff_EBP + -0x3c) = uVar15; cVar6 = (char)(uVar8 >> 0x18); if (cVar6 == '\x03') { *(undefined1 *)(unaff_EBP + -0x6c) = 1; uVar15 = -uVar15; } else { if (cVar6 == '\x02') { uVar15 = -uVar15; } else { if (cVar6 == '\x01') { if (uVar15 != 0) { pvVar10 = (g_manager->_itemConfig)._trinkets._begin; pvVar1 = (g_manager->_itemConfig)._trinkets._end; *(void **)(unaff_EBP + -0x1c) = pvVar10; puVar17 = *(undefined4 **)(unaff_EBX + 8); if (((int)pvVar1 - (int)pvVar10 >> 2 <= (int)(uVar8 & 0x7fff)) || (*(int *)(*(int *)(unaff_EBP + -0x1c) + (uVar8 & 0x7fff) * 4) == 0)) { format = "[warn] Invalid history trinket %d\n"; goto LAB_009d4590; } } *(undefined1 *)(unaff_EBP + -0x6c) = 1; goto LAB_009d422f; } if (uVar15 != 0) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,uVar15); if (collectibleConfig == (ItemConfig_Item *)0x0) { format = "[warn] Invalid history collectible %d\n"; goto LAB_009d4590; } uVar15 = *(uint *)(unaff_EBP + -0x1c); } } *(undefined1 *)(unaff_EBP + -0x6c) = 0; } LAB_009d422f: *(undefined4 *)(unaff_EBP + -100) = *(undefined4 *)(unaff_EBP + -0x74); *(undefined4 *)(unaff_EBP + -0x60) = *(undefined4 *)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x5c) = *(undefined4 *)(unaff_EBP + -0x30); *(uint *)(unaff_EBP + -0x68) = uVar15; uVar9 = *(undefined4 *)(unaff_EBP + -0x50); *(undefined4 *)(unaff_EBP + -0x58) = uVar9; *(int *)(unaff_EBP + -0x70) = *(int *)(unaff_EBP + -0x38); if (*(int *)(unaff_EBP + -0x38) < 0) { *(int *)(unaff_EBP + -0x70) = g_game->_frameCount; } fieldPtr = *(undefined4 **)(iVar19 + 0x3c0); if (fieldPtr == *(undefined4 **)(iVar19 + 0x3c4)) { std::vector<28byte>::_Emplace_reallocate(fieldPtr,unaff_EBP + -0x70); } else { uVar3 = *(undefined4 *)(unaff_EBP + -0x6c); uVar4 = *(undefined4 *)(unaff_EBP + -0x68); uVar5 = *(undefined4 *)(unaff_EBP + -100); *fieldPtr = *(undefined4 *)(unaff_EBP + -0x70); fieldPtr[1] = uVar3; fieldPtr[2] = uVar4; fieldPtr[3] = uVar5; uVar3 = *(undefined4 *)(unaff_EBP + -0x5c); fieldPtr[4] = *(undefined4 *)(unaff_EBP + -0x60); fieldPtr[5] = uVar3; fieldPtr[6] = uVar9; *(int *)(iVar19 + 0x3c0) = *(int *)(iVar19 + 0x3c0) + 0x1c; } uVar8 = *(int *)(unaff_EBP + -0x48) + 1; *(uint *)(unaff_EBP + -0x48) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x44)); } if (100 < (uint)puVar17[2]) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x29) != '\0') { do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); bVar7 = *(byte *)(unaff_EBP + -0x35); bVar14 = bVar7 + 1; *(byte *)(unaff_EBP + -0x35) = bVar14; *(int *)(iVar19 + 0x3c8 + (uint)bVar7 * 4) = (int)*(short *)(unaff_EBP + -0x30); } while (bVar14 < *(byte *)(unaff_EBP + -0x29)); } } } if (0x50 < (uint)puVar17[2]) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); FUN_0042c820(*(undefined1 *)(unaff_EBP + -0x1d)); *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x50,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x50); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); fieldPtr = *(undefined4 **)(iVar19 + 0x428); if (fieldPtr == *(undefined4 **)(iVar19 + 0x42c)) { std::vector::_Emplace_reallocate(fieldPtr,unaff_EBP + -0x50); } else { *fieldPtr = *(undefined4 *)(unaff_EBP + -0x50); *(int *)(iVar19 + 0x428) = *(int *)(iVar19 + 0x428) + 4; } if ((0 < *(int *)(unaff_EBP + -0x50)) && (collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,*(int *)(unaff_EBP + -0x50)) , collectibleConfig == (ItemConfig_Item *)0x0)) { format = "[warn] Invalid Monster Manual collectible %d\n"; goto LAB_009d4590; } bVar7 = *(char *)(unaff_EBP + -0x35) + 1; *(byte *)(unaff_EBP + -0x35) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x1d)); } } if (0x89 < (uint)puVar17[2]) { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x3c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x3c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -0x1c) = 0; if (*(int *)(unaff_EBP + -0x3c) != 0) { *(int *)(unaff_EBP + -0x44) = iVar19 + 0x5d4; do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x38,2,1); *(uint *)(unaff_EBP + -0x48) = (uint)*(ushort *)(unaff_EBP + -0x38); Checksum::Update(checksum2,(byte *)(unaff_EBP + -0x48),2); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x48) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(checksum2,(byte *)(unaff_EBP + -0x48),2); *(int *)(unaff_EBP + -0x54) = (int)*(short *)(unaff_EBP + -0x38); *(uint *)(unaff_EBP + -0x50) = (uint)*(ushort *)(unaff_EBP + -0x30); std_map_int_insert(*(void **)(unaff_EBP + -0x44),(void *)(unaff_EBP + -0x78), (int *)(unaff_EBP + -0x54)); uVar8 = *(int *)(unaff_EBP + -0x1c) + 1; *(uint *)(unaff_EBP + -0x1c) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x3c)); iVar19 = *(int *)(unaff_EBP + -0x24); } } *(int *)(unaff_EBP + -0x3c) = iVar19 + 0x4b0; std::deque::_Tidy(); if (0x9c < (uint)puVar17[2]) { piVar18 = (int *)*puVar17; *(undefined4 *)(unaff_EBP + -0x28) = 0; (**(code **)(*piVar18 + 0x14))(unaff_EBP + -0x28,4,1); pvVar10 = *(void **)(unaff_EBP + -0x40); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x28); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -0x1c) = 0; if (*(int *)(unaff_EBP + -0x28) != 0) { do { (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x80,4,1); *(undefined4 *)(unaff_EBP + -0x48) = *(undefined4 *)(unaff_EBP + -0x80); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x48),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x7c,4,1); *(undefined4 *)(unaff_EBP + -0x48) = *(undefined4 *)(unaff_EBP + -0x7c); Checksum::Update(pvVar10,(byte *)(unaff_EBP + -0x48),4); std::deque::push_back(unaff_EBP + -0x80); uVar8 = *(int *)(unaff_EBP + -0x1c) + 1; *(uint *)(unaff_EBP + -0x1c) = uVar8; } while (uVar8 < *(uint *)(unaff_EBP + -0x28)); } } uVar9 = 1; goto LAB_009d459c; } piVar18 = (int *)(iVar19 + 0x50c); (**(code **)(*(int *)*puVar17 + 0x14))(piVar18,4,1); *(int *)(unaff_EBP + -0x1c) = *piVar18; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); if ((*piVar18 < 1) || (collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,*piVar18), collectibleConfig != (ItemConfig_Item *)0x0)) goto LAB_009d3f14; format = "[warn] Invalid modeling clay effect %d\n"; LAB_009d4590: KAGE_LogMessage(1,(byte *)format); } else { fieldPtr = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x48c); (**(code **)(*(int *)*puVar17 + 0x14))(fieldPtr,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *fieldPtr; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar17 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); iVar19 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -4) = 10; uVar8 = (uint)*(ushort *)(unaff_EBP + -0x30); iVar13 = *(int *)(iVar19 + 0x51c); iVar11 = *(int *)(iVar19 + 0x518); *(int *)(unaff_EBP + -0x44) = iVar13; uVar15 = iVar13 - iVar11 >> 4; *(int *)(unaff_EBP + -0x1c) = iVar11; puVar17 = *(undefined4 **)(unaff_EBX + 8); if (uVar8 < uVar15) { iVar13 = uVar8 * 0x10 + *(int *)(iVar19 + 0x518); LAB_009d2c3f: *(int *)(iVar19 + 0x51c) = iVar13; } else if (uVar15 < uVar8) { if (uVar8 <= (uint)(*(int *)(iVar19 + 0x520) - *(int *)(unaff_EBP + -0x1c) >> 4)) { iVar13 = uVar8 - uVar15; *(int *)(unaff_EBP + -0x1c) = iVar13; if (iVar13 == 0) { iVar13 = *(int *)(unaff_EBP + -0x44); } else { memset(*(void **)(unaff_EBP + -0x44),0,iVar13 * 0x10); iVar13 = *(int *)(unaff_EBP + -0x44) + *(int *)(unaff_EBP + -0x1c) * 0x10; } goto LAB_009d2c3f; } std::vector<16byte>::_Resize_reallocate(uVar8,uVar8); } *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0x44) = 0; if (*(short *)(unaff_EBP + -0x30) == 0) goto LAB_009d2c5b; while (cVar6 = (**(code **)(*(int *)*puVar17 + 0x10))(), cVar6 == '\0') { iVar13 = (*(uint *)(unaff_EBP + -0x44) & 0xffff) * 0x10; puVar17 = (undefined4 *)(*(int *)(iVar19 + 0x518) + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar17 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x518) + 4 + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar17 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x518) + 8 + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar17 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x518) + 0xc + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar17,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar17; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar19 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar13 + 4 + *(int *)(iVar19 + 0x518)); cVar6 = is_valid_item_config_id(); if (cVar6 == '\0') { KAGE_LogMessage(1,(byte *)"[warn] Invalid temporary effect (type: %d, ID: %d)\n"); goto code_r0x009d459a; } iVar13 = *(int *)(unaff_EBP + -0x44) + 1; *(int *)(unaff_EBP + -0x44) = iVar13; if (*(ushort *)(unaff_EBP + -0x30) <= (ushort)iVar13) goto LAB_009d2c5b; puVar17 = *(undefined4 **)(unaff_EBX + 8); } LAB_009d1988: KAGE_LogMessage(1,(byte *)"[warn] Invalid costume count %d. Save file %s might be corrupt.\n"); } code_r0x009d459a: uVar9 = 0; LAB_009d459c: ExceptionList = *(void **)(unaff_EBP + -0xc); return uVar9; } //@@ 009d25f5 Catch_All@009d25f5 undefined4 Catch_All_009d25f5(void) { KAGE_LogMessage(1,(byte *)"[warn] Invalid familiar count %d. Save file %s might be corrupt.\n"); return 0x9d26db; } //@@ 009d261d Catch_All@009d261d undefined * Catch_All_009d261d(void) { KAGE_LogMessage(1,(byte *)"[warn] Invalid co-player count %d. Save file %s might be corrupt.\n"); return &UNK_009d2640; } //@@ 009d2656 GameStatePlayer::read_part3 /* DB: not a real function: Ghidra split the tail of GameStatePlayer::read (009d05d0) into FUN_009d16ee and this chunk (no prologue, unaff_EBP/EBX/ESI, reached by fallthrough from 009d16ee); carries the [warn] Invalid pocket item / costume count / familiar count / history count / temporary effect "Save file %s might be corrupt" reads */ undefined4 GameStatePlayer::read_part3(void) { void *pvVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; char cVar6; byte bVar7; undefined4 uVar8; void *pvVar9; int iVar10; ItemConfig_Item *collectibleConfig; undefined1 uVar11; undefined4 extraout_ECX; uint uVar12; int iVar13; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; int iVar14; void *this; byte bVar15; uint uVar16; uint *puVar17; int unaff_EBX; int unaff_EBP; int unaff_ESI; char *pcVar18; ushort *puVar19; undefined4 *puVar20; byte *shortArrayDest; undefined4 *readDest; int *piVar21; undefined1 *puVar22; Manager *manager; undefined4 *unaff_EDI; *(undefined1 *)(unaff_EBP + -0x29) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { do { cVar6 = (**(code **)(*(int *)*unaff_EDI + 0x10))(); if (cVar6 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid co-player count %d. Save file %s might be corrupt.\n"); goto code_r0x009d459a; } cVar6 = read_coplayer(unaff_EDI); if (cVar6 == '\0') goto LAB_009d26db; bVar7 = *(char *)(unaff_EBP + -0x29) + 1; *(byte *)(unaff_EBP + -0x29) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x1d)); } pcVar18 = (char *)(unaff_ESI + 0x398); (**(code **)(*(int *)*unaff_EDI + 0x14))(pcVar18,1,1); *(char *)(unaff_EBP + -0x38) = *pcVar18; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x38),1); iVar14 = *(int *)(unaff_EBP + -0x24); if ((*pcVar18 != '\0') && (cVar6 = read_coplayer(unaff_EDI), cVar6 == '\0')) { LAB_009d26db: uVar8 = FUN_009d459a(); return uVar8; } if ((uint)unaff_EDI[2] < 0x41) { uVar8 = *(undefined4 *)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x34) = uVar8; LAB_009d29c0: iVar14 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x28) = uVar8; } else { puVar19 = (ushort *)(iVar14 + 0x3b8); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar19,2,1); pvVar9 = *(void **)(unaff_EBP + -0x28); *(uint *)(unaff_EBP + -0x1c) = (uint)*puVar19; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),2); uVar12 = unaff_EDI[2]; if (0x57 < uVar12) { puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x430); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); pvVar9 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = unaff_EDI[2]; } if (uVar12 < 0x72) { iVar14 = *(int *)(unaff_EBP + -0x24); } else { (**(code **)(*(int *)*unaff_EDI + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),2); iVar14 = *(int *)(unaff_EBP + -0x24); *(int *)(iVar14 + 0x434) = (int)*(short *)(unaff_EBP + -0x30); (**(code **)(*(int *)*unaff_EDI + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); *(undefined2 *)(iVar14 + 0x438) = *(undefined2 *)(unaff_EBP + -0x30); uVar12 = unaff_EDI[2]; } *(undefined4 *)(unaff_EBP + -0x28) = *(undefined4 *)(unaff_EBP + -0x34); if (uVar12 < 0x4f) { pvVar9 = *(void **)(unaff_EBP + -0x34); } else { (**(code **)(*(int *)*unaff_EDI + 0x14))((undefined4 *)(iVar14 + 0x43c),4,1); pvVar9 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x43c); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = unaff_EDI[2]; } if (0x4f < uVar12) { puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x440); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x444); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); pvVar9 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = unaff_EDI[2]; } if (0x51 < uVar12) { puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x448); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); pvVar9 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = unaff_EDI[2]; } if (0x5a < uVar12) { shortArrayDest = (byte *)(*(int *)(unaff_EBP + -0x24) + 0x458); (**(code **)(*(int *)*unaff_EDI + 0x14))(shortArrayDest,2,6); Checksum::Update(*(void **)(unaff_EBP + -0x34),shortArrayDest,0xc); shortArrayDest = (byte *)(*(int *)(unaff_EBP + -0x24) + 0x464); (**(code **)(*(int *)*unaff_EDI + 0x14))(shortArrayDest,2,6); Checksum::Update(*(void **)(unaff_EBP + -0x34),shortArrayDest,0xc); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x470); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); pvVar9 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = unaff_EDI[2]; } uVar8 = *(undefined4 *)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x3c) = uVar8; *(void **)(unaff_EBP + -0x48) = pvVar9; if (uVar12 < 0x5d) { iVar14 = *(int *)(unaff_EBP + -0x24); *(void **)(unaff_EBP + -0x34) = pvVar9; *(undefined4 *)(unaff_EBP + -0x28) = uVar8; if (0x5b < uVar12) { (**(code **)(*(int *)*unaff_EDI + 0x14))((undefined4 *)(iVar14 + 0x44c),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x44c); Checksum::Update(*(void **)(unaff_EBP + -0x48),(byte *)(unaff_EBP + -0x1c),4); uVar8 = *(undefined4 *)(unaff_EBP + -0x3c); *(undefined4 *)(unaff_EBP + -0x34) = extraout_ECX; goto LAB_009d29c0; } } else { (**(code **)(*(int *)*unaff_EDI + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x38),1); iVar14 = *(int *)(unaff_EBP + -0x24); *(uint *)(iVar14 + 0x44c) = (uint)*(byte *)(unaff_EBP + -0x1d); (**(code **)(*(int *)*unaff_EDI + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x38),1); *(uint *)(iVar14 + 0x454) = (uint)*(byte *)(unaff_EBP + -0x1d); } } uVar12 = unaff_EDI[2]; if (0x62 < uVar12) { (**(code **)(*(int *)*unaff_EDI + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x38),1); *(uint *)(iVar14 + 0x450) = (uint)*(byte *)(unaff_EBP + -0x29); uVar12 = unaff_EDI[2]; } uVar8 = *(undefined4 *)(unaff_EBP + -0x28); if (0x5e < uVar12) { (**(code **)(*(int *)*unaff_EDI + 0x14))((undefined4 *)(iVar14 + 0x474),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x474); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x478); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x47c); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x480); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x484); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x488); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar12 = unaff_EDI[2]; uVar8 = *(undefined4 *)(unaff_EBP + -0x28); } *(undefined4 *)(unaff_EBP + -0x40) = uVar8; *(undefined4 *)(unaff_EBP + -0x48) = uVar8; if (uVar12 < 0x60) { LAB_009d2c5b: puVar20 = *(undefined4 **)(unaff_EBX + 8); uVar12 = puVar20[2]; if (uVar12 < 0x61) { pvVar9 = *(void **)(unaff_EBP + -0x28); } else { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x490); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); pvVar9 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; } if (0x61 < uVar12) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x494); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); pvVar9 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; } if (uVar12 < 100) { uVar8 = *(undefined4 *)(unaff_EBP + -0x40); *(undefined4 *)(unaff_EBP + -0x40) = uVar8; } else { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),2); iVar14 = *(int *)(unaff_EBP + -0x24); *(int *)(iVar14 + 0x498) = (int)*(short *)(unaff_EBP + -0x30); uVar12 = puVar20[2]; if (0x69 < uVar12) { (**(code **)(*(int *)*puVar20 + 0x14))((undefined4 *)(iVar14 + 0x49c),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x49c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4a0); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4a4); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4a8); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; iVar14 = *(int *)(unaff_EBP + -0x24); } if (0x6b < uVar12) { (**(code **)(*(int *)*puVar20 + 0x14))((undefined4 *)(iVar14 + 0x4ac),4,1); pvVar9 = *(void **)(unaff_EBP + -0x28); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x4ac); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); if ((uint)puVar20[2] < 0x90) { *(undefined4 *)(unaff_EBP + -100) = 0; *(undefined4 *)(unaff_EBP + -0x60) = 0; *(undefined4 *)(unaff_EBP + -0x5c) = 0; *(undefined4 *)(unaff_EBP + -0x58) = 0; *(undefined4 *)(unaff_EBP + -4) = 0xc; *(undefined4 *)(unaff_EBP + -0x88) = 0; *(undefined4 *)(unaff_EBP + -0x84) = 0; *(undefined4 *)(unaff_EBP + -0x80) = 0; *(undefined4 *)(unaff_EBP + -0x7c) = 0; *(undefined1 *)(unaff_EBP + -4) = 0xd; GameStateReader::read_bool_vector(0); GameStateReader::read_bool_vector(0); iVar14 = *(int *)(unaff_EBP + -0x24); uVar12 = 0; *(undefined4 *)(unaff_EBP + -0x34) = 0; if (*(int *)(unaff_EBP + -0x58) != 0) { do { if (2 < *(uint *)(iVar14 + 0x4c0)) break; if ((*(uint *)(*(int *)(unaff_EBP + -100) + (uVar12 >> 5) * 4) & 1 << ((byte)uVar12 & 0x1f)) == 0) { iVar13 = *(int *)(unaff_EBP + -0x34); } else { uVar12 = *(uint *)(iVar14 + 0x4bc); *(uint *)(unaff_EBP + -0x44) = uVar12; if (((uVar12 & 1) == 0) && (*(uint *)(unaff_EBP + -0x44) = uVar12, *(uint *)(iVar14 + 0x4b8) <= *(int *)(iVar14 + 0x4c0) + 2U >> 1)) { std::deque::_Growmap(*(int *)(unaff_EBP + -100)); *(undefined4 *)(unaff_EBP + -0x44) = *(undefined4 *)(iVar14 + 0x4bc); } iVar13 = *(int *)(iVar14 + 0x4b8); uVar12 = iVar13 * 2; uVar16 = uVar12 - 1 & *(uint *)(unaff_EBP + -0x44); *(uint *)(iVar14 + 0x4bc) = uVar16; if (uVar16 == 0) { uVar16 = uVar12; } *(uint *)(unaff_EBP + -0x50) = uVar16; *(uint *)(unaff_EBP + -0x50) = uVar16 - 1; uVar12 = uVar16 - 1 >> 1 & iVar13 - 1U; iVar13 = *(int *)(iVar14 + 0x4b4); *(uint *)(unaff_EBP + -0x48) = uVar12; iVar10 = iVar14; if (*(int *)(iVar13 + uVar12 * 4) == 0) { pvVar9 = operator_new(0x10); *(void **)(*(int *)(iVar14 + 0x4b4) + uVar12 * 4) = pvVar9; iVar10 = *(int *)(unaff_EBP + -0x24); } uVar12 = *(uint *)(unaff_EBP + -0x50) & 1; iVar2 = *(int *)(*(int *)(iVar14 + 0x4b4) + *(int *)(unaff_EBP + -0x48) * 4); iVar13 = *(int *)(unaff_EBP + -0x34); *(int *)(iVar2 + uVar12 * 8) = iVar13; *(undefined4 *)(iVar2 + 4 + uVar12 * 8) = 1; *(int *)(iVar14 + 0x4c0) = *(int *)(iVar14 + 0x4c0) + 1; puVar20 = *(undefined4 **)(unaff_EBX + 8); *(undefined4 *)(iVar14 + 0x4bc) = *(undefined4 *)(unaff_EBP + -0x50); iVar14 = iVar10; if ((0 < iVar13) && ((pvVar9 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar9 >> 2 <= iVar13 || (*(int *)((int)pvVar9 + iVar13 * 4) == 0)))) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pocket item (type: %d, ID: %d)\n"); pvVar9 = *(void **)(unaff_EBP + -0x88); if (pvVar9 != (void *)0x0) { deallocate(pvVar9,*(int *)(unaff_EBP + -0x80) - (int)pvVar9 >> 2); } pvVar9 = *(void **)(unaff_EBP + -100); if (pvVar9 == (void *)0x0) goto LAB_009d26db; deallocate(pvVar9,*(int *)(unaff_EBP + -0x5c) - (int)pvVar9 >> 2); goto code_r0x009d459a; } } uVar12 = iVar13 + 1; *(uint *)(unaff_EBP + -0x34) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x58)); } uVar12 = 0; *(undefined4 *)(unaff_EBP + -0x44) = 0; if (*(int *)(unaff_EBP + -0x7c) != 0) { do { if (2 < *(uint *)(iVar14 + 0x4c0)) break; if ((*(uint *)(*(int *)(unaff_EBP + -0x88) + (uVar12 >> 5) * 4) & 1 << ((byte)uVar12 & 0x1f)) != 0) { uVar12 = *(uint *)(iVar14 + 0x4bc); *(uint *)(unaff_EBP + -0x34) = uVar12; if (((uVar12 & 1) == 0) && (*(uint *)(unaff_EBP + -0x34) = uVar12, *(uint *)(iVar14 + 0x4b8) <= *(int *)(iVar14 + 0x4c0) + 2U >> 1)) { std::deque::_Growmap(iVar14 + 0x4b0); *(undefined4 *)(unaff_EBP + -0x34) = *(undefined4 *)(iVar14 + 0x4bc); } iVar13 = *(int *)(iVar14 + 0x4b8); iVar2 = iVar13 * 2; puVar17 = (uint *)(unaff_EBP + -0x34); *puVar17 = *puVar17 & iVar2 - 1U; uVar12 = *puVar17; iVar10 = *(int *)(unaff_EBP + -0x34); *(int *)(iVar14 + 0x4bc) = iVar10; if (uVar12 == 0) { iVar10 = iVar2; } *(uint *)(unaff_EBP + -0x34) = iVar10 - 1U; uVar12 = iVar10 - 1U >> 1 & iVar13 - 1U; iVar13 = *(int *)(iVar14 + 0x4b4); *(uint *)(unaff_EBP + -0x48) = uVar12; if (*(int *)(iVar13 + uVar12 * 4) == 0) { pvVar9 = operator_new(0x10); *(void **)(*(int *)(iVar14 + 0x4b4) + *(int *)(unaff_EBP + -0x48) * 4) = pvVar9; } uVar12 = *(uint *)(unaff_EBP + -0x34); uVar16 = uVar12 & 1; iVar13 = *(int *)(*(int *)(iVar14 + 0x4b4) + *(int *)(unaff_EBP + -0x48) * 4); *(undefined4 *)(iVar13 + uVar16 * 8) = *(undefined4 *)(unaff_EBP + -0x44); puVar20 = *(undefined4 **)(unaff_EBX + 8); *(undefined4 *)(iVar13 + 4 + uVar16 * 8) = 0; *(int *)(iVar14 + 0x4c0) = *(int *)(iVar14 + 0x4c0) + 1; *(uint *)(iVar14 + 0x4bc) = uVar12; } uVar12 = *(int *)(unaff_EBP + -0x44) + 1; *(uint *)(unaff_EBP + -0x44) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x7c)); } pvVar9 = *(void **)(unaff_EBP + -0x88); if (pvVar9 != (void *)0x0) { deallocate(pvVar9,*(int *)(unaff_EBP + -0x80) - (int)pvVar9 >> 2); } *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; pvVar9 = *(void **)(unaff_EBP + -100); if (pvVar9 != (void *)0x0) { deallocate(pvVar9,*(int *)(unaff_EBP + -0x5c) - (int)pvVar9 >> 2); } } else { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x38) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x38),1); *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x29) != '\0') { do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x4c,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x4c); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x30),1); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x48,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x48); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); if (((*(char *)(unaff_EBP + -0x4c) == '\x01') && (iVar14 = *(int *)(unaff_EBP + -0x48), 0 < iVar14)) && ((pvVar1 = (g_manager->_itemConfig)._cards._begin, (int)(g_manager->_itemConfig)._cards._end - (int)pvVar1 >> 2 <= iVar14 || (*(int *)((int)pvVar1 + iVar14 * 4) == 0)))) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pocket item (type: %d, ID: %d)\n"); goto code_r0x009d459a; } bVar7 = *(char *)(unaff_EBP + -0x35) + 1; *(byte *)(unaff_EBP + -0x35) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x29)); } } piVar21 = (int *)(*(int *)(unaff_EBP + -0x24) + 0x4c4); *(int **)(unaff_EBP + -0x1c) = piVar21; FUN_007dccd0(8); uVar12 = 0; *(undefined4 *)(unaff_EBP + -0x48) = 0; do { iVar14 = *piVar21; (**(code **)(*(int *)*puVar20 + 0x14))((undefined1 *)(iVar14 + uVar12),1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar14 + uVar12); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); piVar21 = *(int **)(unaff_EBP + -0x1c); uVar12 = *(int *)(unaff_EBP + -0x48) + 1; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < 8); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4d0); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); if (0x98 < (uint)puVar20[2]) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4d4); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); } *(int *)(unaff_EBP + -0x1c) = *(int *)(unaff_EBP + -0x24) + 0x4dc; FUN_007dccd0(6); uVar12 = 0; *(undefined4 *)(unaff_EBP + -0x48) = 0; do { puVar22 = (undefined1 *)(**(int **)(unaff_EBP + -0x1c) + uVar12); (**(code **)(*(int *)*puVar20 + 0x14))(puVar22,1,1); pvVar9 = *(void **)(unaff_EBP + -0x28); *(undefined1 *)(unaff_EBP + -0x30) = *puVar22; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x30),1); uVar12 = *(int *)(unaff_EBP + -0x48) + 1; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < 6); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x30),1); uVar11 = *(undefined1 *)(unaff_EBP + -0x1d); if (0x14 < *(byte *)(unaff_EBP + -0x1d)) { uVar11 = 0x14; } piVar21 = (int *)(*(int *)(unaff_EBP + -0x24) + 0x4e8); *(undefined1 *)(unaff_EBP + -0x1d) = uVar11; *(int **)(unaff_EBP + -0x1c) = piVar21; FUN_007dccd0(uVar11); uVar12 = 0; *(undefined4 *)(unaff_EBP + -0x48) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { do { iVar14 = *piVar21; (**(code **)(*(int *)*puVar20 + 0x14))((undefined1 *)(iVar14 + uVar12),1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar14 + uVar12); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); uVar12 = *(int *)(unaff_EBP + -0x48) + 1; piVar21 = *(int **)(unaff_EBP + -0x1c); *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < *(byte *)(unaff_EBP + -0x1d)); } puVar22 = (undefined1 *)(*(int *)(unaff_EBP + -0x24) + 0x4f4); (**(code **)(*(int *)*puVar20 + 0x14))(puVar22,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *puVar22; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4d8); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4f8); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x4fc); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x528); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); } uVar8 = *(undefined4 *)(unaff_EBP + -0x40); } uVar12 = puVar20[2]; *(undefined4 *)(unaff_EBP + -0x34) = uVar8; if (0x74 < uVar12) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x52c); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; *(undefined4 *)(unaff_EBP + -0x40) = extraout_ECX_00; } if (0x75 < uVar12) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x514); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; } if (0x77 < uVar12) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x530); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; } iVar14 = *(int *)(unaff_EBP + -0x24); if (0x7d < uVar12) { read_block_538(puVar20); uVar12 = puVar20[2]; } if (uVar12 < 0xa4) { *(undefined4 *)(iVar14 + 0x564) = *(undefined4 *)(iVar14 + 4); } else { piVar21 = (int *)*puVar20; *(undefined4 *)(unaff_EBP + -0x38) = 0; (**(code **)(*piVar21 + 0x14))(unaff_EBP + -0x38,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x38); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -4) = 0xe; *(int *)(unaff_EBP + -0x40) = iVar14 + 0x558; std::vector<52byte>::resize(*(undefined4 *)(unaff_EBP + -0x38)); *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0x48) = 0; if (0 < *(int *)(unaff_EBP + -0x38)) { *(undefined4 *)(unaff_EBP + -0x28) = 0; do { cVar6 = (**(code **)(*(int *)*puVar20 + 0x10))(); if (cVar6 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid familiar count %d. Save file %s might be corrupt.\n"); goto code_r0x009d459a; } readDest = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28)); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 4) ; (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *)(**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 8) ; (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0xc); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x10); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x14); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x18); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x1c); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x20); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x24); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x28); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); readDest = (undefined4 *) (**(int **)(unaff_EBP + -0x40) + *(int *)(unaff_EBP + -0x28) + 0x2c); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); pvVar9 = *(void **)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); piVar21 = (int *)*puVar20; *(undefined1 *)(unaff_EBP + -0x29) = 0; (**(code **)(*piVar21 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x30),1); *(bool *)(*(int *)(unaff_EBP + -0x28) + 0x30 + **(int **)(unaff_EBP + -0x40)) = *(char *)(unaff_EBP + -0x29) != '\0'; piVar21 = (int *)*puVar20; *(undefined1 *)(unaff_EBP + -0x1d) = 0; (**(code **)(*piVar21 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x30),1); iVar14 = *(int *)(unaff_EBP + -0x28); *(bool *)(iVar14 + 0x31 + **(int **)(unaff_EBP + -0x40)) = *(char *)(unaff_EBP + -0x1d) != '\0'; iVar13 = *(int *)(unaff_EBP + -0x48) + 1; *(int *)(unaff_EBP + -0x28) = iVar14 + 0x34; *(int *)(unaff_EBP + -0x48) = iVar13; } while (iVar13 < *(int *)(unaff_EBP + -0x38)); iVar14 = *(int *)(unaff_EBP + -0x24); } (**(code **)(*(int *)*puVar20 + 0x14))((undefined4 *)(iVar14 + 0x564),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x564); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); iVar14 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x40) = extraout_ECX_01; } uVar12 = puVar20[2]; if (0x7f < uVar12) { *(undefined4 *)(unaff_EBP + -0x48) = 0; *(int *)(unaff_EBP + -0x50) = iVar14 + 0x568; do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); *(undefined4 *)(unaff_EBP + -0x44) = 0; *(int *)(*(int *)(unaff_EBP + -0x50) + 4) = (int)*(char *)(unaff_EBP + -0x29); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x44,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x44); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); cVar6 = *(char *)(unaff_EBP + -0x29); piVar21 = *(int **)(unaff_EBP + -0x50); iVar13 = *(int *)(unaff_EBP + -0x44); *piVar21 = iVar13; if ((cVar6 == '\x01') && (0 < iVar13)) { pvVar9 = (g_manager->_itemConfig)._cards._begin; pvVar1 = (g_manager->_itemConfig)._cards._end; *(void **)(unaff_EBP + -0x1c) = pvVar9; iVar14 = *(int *)(unaff_EBP + -0x24); if (((int)pvVar1 - (int)pvVar9 >> 2 <= iVar13) || (*(int *)(*(int *)(unaff_EBP + -0x1c) + iVar13 * 4) == 0)) { KAGE_LogMessage(1,(byte *)"[warn] Invalid pre curse pocket item (type: %d, ID: %d)\n"); goto code_r0x009d459a; } } uVar12 = *(int *)(unaff_EBP + -0x48) + 1; *(int **)(unaff_EBP + -0x50) = piVar21 + 2; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x74)); (**(code **)(*(int *)*puVar20 + 0x14))(iVar14 + 0x588,4,2); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(iVar14 + 0x588),8); uVar12 = 0; puVar17 = (uint *)(iVar14 + 0x588); *(undefined4 *)(unaff_EBP + -0x48) = 0; do { uVar16 = *puVar17; *(uint *)(unaff_EBP + -0x1c) = uVar16; if (0 < (int)uVar16) { puVar20 = *(undefined4 **)(unaff_EBX + 8); if (((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 <= (int)(uVar16 & 0x7fff)) || (iVar14 = *(int *)(unaff_EBP + -0x24), *(int *)((int)(g_manager->_itemConfig)._trinkets._begin + (uVar16 & 0x7fff) * 4) == 0)) { pcVar18 = "[warn] Invalid pre curse trinket %d\n"; goto LAB_009d4590; } uVar12 = *(uint *)(unaff_EBP + -0x48); } uVar12 = uVar12 + 1; puVar17 = puVar17 + 1; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < 2); uVar12 = puVar20[2]; } if (0x81 < uVar12) { (**(code **)(*(int *)*puVar20 + 0x14))(iVar14 + 0x590,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar14 + 0x590); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); *(undefined4 *)(unaff_EBP + -0x48) = 0; *(int *)(unaff_EBP + -0x50) = iVar14 + 0x598; do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x35,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x35); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); *(undefined4 *)(unaff_EBP + -0x44) = 0; **(int **)(unaff_EBP + -0x50) = (int)*(char *)(unaff_EBP + -0x35); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x44,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x44); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); piVar21 = *(int **)(unaff_EBP + -0x50); iVar13 = *(int *)(unaff_EBP + -0x44); piVar21[-1] = iVar13; if (((*(char *)(iVar14 + 0x590) != '\0') && (iVar10 = *piVar21, *(int *)(unaff_EBP + -0x3c) = iVar10, iVar10 == 1)) && (0 < iVar13)) { pvVar9 = (g_manager->_itemConfig)._cards._begin; pvVar1 = (g_manager->_itemConfig)._cards._end; *(void **)(unaff_EBP + -0x1c) = pvVar9; iVar14 = *(int *)(unaff_EBP + -0x24); if (((int)pvVar1 - (int)pvVar9 >> 2 <= iVar13) || (*(int *)(*(int *)(unaff_EBP + -0x1c) + iVar13 * 4) == 0)) { KAGE_LogMessage(1,(byte *) "[warn] Invalid pre coop ghost pocket item (type: %d, ID: %d)\n"); goto code_r0x009d459a; } } uVar12 = *(int *)(unaff_EBP + -0x48) + 1; *(int **)(unaff_EBP + -0x50) = piVar21 + 2; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x74)); (**(code **)(*(int *)*puVar20 + 0x14))(iVar14 + 0x5b4,4,2); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(iVar14 + 0x5b4),8); cVar6 = *(char *)(iVar14 + 0x590); puVar17 = (uint *)(iVar14 + 0x5b4); uVar12 = 0; *(char *)(unaff_EBP + -0x35) = cVar6; *(undefined4 *)(unaff_EBP + -0x48) = 0; do { if (cVar6 != '\0') { uVar16 = *puVar17; *(uint *)(unaff_EBP + -0x1c) = uVar16; if (0 < (int)uVar16) { puVar20 = *(undefined4 **)(unaff_EBX + 8); if (((int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2 <= (int)(uVar16 & 0x7fff)) || (iVar14 = *(int *)(unaff_EBP + -0x24), *(int *)((int)(g_manager->_itemConfig)._trinkets._begin + (uVar16 & 0x7fff) * 4) == 0 )) { pcVar18 = "[warn] Invalid pre coop ghost trinket %d\n"; goto LAB_009d4590; } uVar12 = *(uint *)(unaff_EBP + -0x48); } cVar6 = *(char *)(unaff_EBP + -0x35); } uVar12 = uVar12 + 1; puVar17 = puVar17 + 1; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < 2); uVar12 = puVar20[2]; } if (0x80 < uVar12) { (**(code **)(*(int *)*puVar20 + 0x14))((undefined4 *)(iVar14 + 0x5c8),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x5c8); Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; } if (uVar12 < 0x82) { pvVar9 = *(void **)(unaff_EBP + -0x40); *(void **)(unaff_EBP + -0x28) = pvVar9; } else { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x5cc); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x40),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; if (0xa7 < uVar12) { puVar22 = (undefined1 *)(*(int *)(unaff_EBP + -0x24) + 0x5d0); (**(code **)(*(int *)*puVar20 + 0x14))(puVar22,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *puVar22; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); uVar12 = puVar20[2]; } if (0xa8 < uVar12) { puVar22 = (undefined1 *)(*(int *)(unaff_EBP + -0x24) + 0x5d1); (**(code **)(*(int *)*puVar20 + 0x14))(puVar22,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *puVar22; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x30),1); uVar12 = puVar20[2]; } pvVar9 = *(void **)(unaff_EBP + -0x40); *(void **)(unaff_EBP + -0x28) = pvVar9; if (0x82 < uVar12) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x524); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x34),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; pvVar9 = *(void **)(unaff_EBP + -0x28); } } if (uVar12 < 0x6e) { LAB_009d3eb4: iVar14 = *(int *)(unaff_EBP + -0x24); } else { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x30),1); iVar14 = *(int *)(unaff_EBP + -0x24); *(int *)(unaff_EBP + -0x48) = iVar14 + 0x500; std::vector<4byte>::resize(*(undefined1 *)(unaff_EBP + -0x1d)); uVar12 = 0; *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { iVar14 = **(int **)(unaff_EBP + -0x48); do { puVar20 = (undefined4 *)(iVar14 + uVar12 * 4); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar14 = **(int **)(unaff_EBP + -0x48); *(int *)(unaff_EBP + -0x1c) = iVar14; iVar13 = *(int *)(iVar14 + uVar12 * 4); if (0 < iVar13) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar13); if (collectibleConfig == (ItemConfig_Item *)0x0) { pcVar18 = "[warn] Invalid item card %d\n"; goto LAB_009d4590; } iVar14 = *(int *)(unaff_EBP + -0x1c); } bVar7 = *(char *)(unaff_EBP + -0x35) + 1; uVar12 = (uint)bVar7; *(byte *)(unaff_EBP + -0x35) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x1d)); puVar20 = *(undefined4 **)(unaff_EBX + 8); goto LAB_009d3eb4; } } if ((uint)puVar20[2] < 0x6f) { LAB_009d3f14: uVar12 = puVar20[2]; if (0x72 < uVar12) { readDest = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x510); (**(code **)(*(int *)*puVar20 + 0x14))(readDest,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *readDest; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar12 = puVar20[2]; } iVar14 = *(int *)(unaff_EBP + -0x24); if (0x7e < uVar12) { iVar13 = *(int *)*puVar20; *(int *)(unaff_EBP + -0x3c) = iVar14 + 0x5bc; (**(code **)(iVar13 + 0x14))(iVar14 + 0x5bc,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(iVar14 + 0x5bc); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); if (*(char *)(iVar14 + 0x5bc) != -1) { iVar13 = *(int *)*puVar20; *(int *)(unaff_EBP + -0x48) = iVar14 + 0x5c0; (**(code **)(iVar13 + 0x14))(iVar14 + 0x5c0,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x5c0); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar20 + 0x14))((undefined4 *)(iVar14 + 0x5c4),4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar14 + 0x5c4); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); cVar6 = **(char **)(unaff_EBP + -0x3c); *(char *)(unaff_EBP + -0x2d) = cVar6; if (cVar6 == '\x02') { iVar14 = **(int **)(unaff_EBP + -0x48); *(int *)(unaff_EBP + -0x1c) = iVar14; manager = g_manager; if (0 < iVar14) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar14); if (collectibleConfig == (ItemConfig_Item *)0x0) { pcVar18 = "[warn] Invalid active item wildcard effect %d\n"; goto LAB_009d4590; } goto LAB_009d4022; } } else { manager = g_manager; LAB_009d4022: iVar14 = **(int **)(unaff_EBP + -0x48); if (((*(char *)(unaff_EBP + -0x2d) == '\x01') && (0 < iVar14)) && ((pvVar9 = (manager->_itemConfig)._cards._begin, (int)(manager->_itemConfig)._cards._end - (int)pvVar9 >> 2 <= iVar14 || (*(int *)((int)pvVar9 + iVar14 * 4) == 0)))) { KAGE_LogMessage(1,(byte *) "[warn] Invalid pocket item wildcard effect (type: %d, id: %d)\n"); goto code_r0x009d459a; } } iVar14 = *(int *)(unaff_EBP + -0x24); } } if (0x42 < (uint)puVar20[2]) { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x44,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x44); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -0x48) = 0; if (*(int *)(unaff_EBP + -0x44) != 0) { do { cVar6 = (**(code **)(*(int *)*puVar20 + 0x10))(); if (cVar6 != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid history count %d. Save file %s might be corrupt.\n") ; } (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x3c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x3c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x74,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x74); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x34,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x34); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x30,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x50,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x50); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x38,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x38); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); uVar12 = *(uint *)(unaff_EBP + -0x3c); uVar16 = uVar12 & 0xffffff; *(uint *)(unaff_EBP + -0x1c) = uVar16; *(uint *)(unaff_EBP + -0x3c) = uVar16; cVar6 = (char)(uVar12 >> 0x18); if (cVar6 == '\x03') { *(undefined1 *)(unaff_EBP + -0x6c) = 1; uVar16 = -uVar16; } else { if (cVar6 == '\x02') { uVar16 = -uVar16; } else { if (cVar6 == '\x01') { if (uVar16 != 0) { pvVar9 = (g_manager->_itemConfig)._trinkets._begin; pvVar1 = (g_manager->_itemConfig)._trinkets._end; *(void **)(unaff_EBP + -0x1c) = pvVar9; puVar20 = *(undefined4 **)(unaff_EBX + 8); if (((int)pvVar1 - (int)pvVar9 >> 2 <= (int)(uVar12 & 0x7fff)) || (*(int *)(*(int *)(unaff_EBP + -0x1c) + (uVar12 & 0x7fff) * 4) == 0)) { pcVar18 = "[warn] Invalid history trinket %d\n"; goto LAB_009d4590; } } *(undefined1 *)(unaff_EBP + -0x6c) = 1; goto LAB_009d422f; } if (uVar16 != 0) { collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,uVar16); if (collectibleConfig == (ItemConfig_Item *)0x0) { pcVar18 = "[warn] Invalid history collectible %d\n"; goto LAB_009d4590; } uVar16 = *(uint *)(unaff_EBP + -0x1c); } } *(undefined1 *)(unaff_EBP + -0x6c) = 0; } LAB_009d422f: *(undefined4 *)(unaff_EBP + -100) = *(undefined4 *)(unaff_EBP + -0x74); *(undefined4 *)(unaff_EBP + -0x60) = *(undefined4 *)(unaff_EBP + -0x34); *(undefined4 *)(unaff_EBP + -0x5c) = *(undefined4 *)(unaff_EBP + -0x30); *(uint *)(unaff_EBP + -0x68) = uVar16; uVar8 = *(undefined4 *)(unaff_EBP + -0x50); *(undefined4 *)(unaff_EBP + -0x58) = uVar8; *(int *)(unaff_EBP + -0x70) = *(int *)(unaff_EBP + -0x38); if (*(int *)(unaff_EBP + -0x38) < 0) { *(int *)(unaff_EBP + -0x70) = g_game->_frameCount; } readDest = *(undefined4 **)(iVar14 + 0x3c0); if (readDest == *(undefined4 **)(iVar14 + 0x3c4)) { std::vector<28byte>::_Emplace_reallocate(readDest,unaff_EBP + -0x70); } else { uVar3 = *(undefined4 *)(unaff_EBP + -0x6c); uVar4 = *(undefined4 *)(unaff_EBP + -0x68); uVar5 = *(undefined4 *)(unaff_EBP + -100); *readDest = *(undefined4 *)(unaff_EBP + -0x70); readDest[1] = uVar3; readDest[2] = uVar4; readDest[3] = uVar5; uVar3 = *(undefined4 *)(unaff_EBP + -0x5c); readDest[4] = *(undefined4 *)(unaff_EBP + -0x60); readDest[5] = uVar3; readDest[6] = uVar8; *(int *)(iVar14 + 0x3c0) = *(int *)(iVar14 + 0x3c0) + 0x1c; } uVar12 = *(int *)(unaff_EBP + -0x48) + 1; *(uint *)(unaff_EBP + -0x48) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x44)); } if (100 < (uint)puVar20[2]) { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x29,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x29); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x29) != '\0') { do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); bVar7 = *(byte *)(unaff_EBP + -0x35); bVar15 = bVar7 + 1; *(byte *)(unaff_EBP + -0x35) = bVar15; *(int *)(iVar14 + 0x3c8 + (uint)bVar7 * 4) = (int)*(short *)(unaff_EBP + -0x30); } while (bVar15 < *(byte *)(unaff_EBP + -0x29)); } } } if (0x50 < (uint)puVar20[2]) { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x1d,1,1); *(undefined1 *)(unaff_EBP + -0x30) = *(undefined1 *)(unaff_EBP + -0x1d); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x30),1); FUN_0042c820(*(undefined1 *)(unaff_EBP + -0x1d)); *(undefined1 *)(unaff_EBP + -0x35) = 0; if (*(char *)(unaff_EBP + -0x1d) != '\0') { do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x50,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x50); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); readDest = *(undefined4 **)(iVar14 + 0x428); if (readDest == *(undefined4 **)(iVar14 + 0x42c)) { std::vector::_Emplace_reallocate(readDest,unaff_EBP + -0x50); } else { *readDest = *(undefined4 *)(unaff_EBP + -0x50); *(int *)(iVar14 + 0x428) = *(int *)(iVar14 + 0x428) + 4; } if ((0 < *(int *)(unaff_EBP + -0x50)) && (collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,*(int *)(unaff_EBP + -0x50)) , collectibleConfig == (ItemConfig_Item *)0x0)) { pcVar18 = "[warn] Invalid Monster Manual collectible %d\n"; goto LAB_009d4590; } bVar7 = *(char *)(unaff_EBP + -0x35) + 1; *(byte *)(unaff_EBP + -0x35) = bVar7; } while (bVar7 < *(byte *)(unaff_EBP + -0x1d)); } } if (0x89 < (uint)puVar20[2]) { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x3c,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x3c); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -0x1c) = 0; if (*(int *)(unaff_EBP + -0x3c) != 0) { *(int *)(unaff_EBP + -0x44) = iVar14 + 0x5d4; do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x38,2,1); *(uint *)(unaff_EBP + -0x48) = (uint)*(ushort *)(unaff_EBP + -0x38); Checksum::Update(this,(byte *)(unaff_EBP + -0x48),2); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x48) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(this,(byte *)(unaff_EBP + -0x48),2); *(int *)(unaff_EBP + -0x54) = (int)*(short *)(unaff_EBP + -0x38); *(uint *)(unaff_EBP + -0x50) = (uint)*(ushort *)(unaff_EBP + -0x30); std_map_int_insert(*(void **)(unaff_EBP + -0x44),(void *)(unaff_EBP + -0x78), (int *)(unaff_EBP + -0x54)); uVar12 = *(int *)(unaff_EBP + -0x1c) + 1; *(uint *)(unaff_EBP + -0x1c) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x3c)); iVar14 = *(int *)(unaff_EBP + -0x24); } } *(int *)(unaff_EBP + -0x3c) = iVar14 + 0x4b0; std::deque::_Tidy(); if (0x9c < (uint)puVar20[2]) { piVar21 = (int *)*puVar20; *(undefined4 *)(unaff_EBP + -0x28) = 0; (**(code **)(*piVar21 + 0x14))(unaff_EBP + -0x28,4,1); pvVar9 = *(void **)(unaff_EBP + -0x40); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(unaff_EBP + -0x28); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x1c),4); *(undefined4 *)(unaff_EBP + -0x1c) = 0; if (*(int *)(unaff_EBP + -0x28) != 0) { do { (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x80,4,1); *(undefined4 *)(unaff_EBP + -0x48) = *(undefined4 *)(unaff_EBP + -0x80); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x48),4); (**(code **)(*(int *)*puVar20 + 0x14))(unaff_EBP + -0x7c,4,1); *(undefined4 *)(unaff_EBP + -0x48) = *(undefined4 *)(unaff_EBP + -0x7c); Checksum::Update(pvVar9,(byte *)(unaff_EBP + -0x48),4); std::deque::push_back(unaff_EBP + -0x80); uVar12 = *(int *)(unaff_EBP + -0x1c) + 1; *(uint *)(unaff_EBP + -0x1c) = uVar12; } while (uVar12 < *(uint *)(unaff_EBP + -0x28)); } } uVar8 = 1; goto LAB_009d459c; } piVar21 = (int *)(iVar14 + 0x50c); (**(code **)(*(int *)*puVar20 + 0x14))(piVar21,4,1); *(int *)(unaff_EBP + -0x1c) = *piVar21; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); if ((*piVar21 < 1) || (collectibleConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,*piVar21), collectibleConfig != (ItemConfig_Item *)0x0)) goto LAB_009d3f14; pcVar18 = "[warn] Invalid modeling clay effect %d\n"; LAB_009d4590: KAGE_LogMessage(1,(byte *)pcVar18); } else { puVar20 = (undefined4 *)(*(int *)(unaff_EBP + -0x24) + 0x48c); (**(code **)(*(int *)*unaff_EDI + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); (**(code **)(*(int *)*unaff_EDI + 0x14))(unaff_EBP + -0x30,2,1); *(uint *)(unaff_EBP + -0x1c) = (uint)*(ushort *)(unaff_EBP + -0x30); Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),2); iVar14 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -4) = 10; uVar12 = (uint)*(ushort *)(unaff_EBP + -0x30); iVar13 = *(int *)(iVar14 + 0x51c); iVar10 = *(int *)(iVar14 + 0x518); *(int *)(unaff_EBP + -0x44) = iVar13; uVar16 = iVar13 - iVar10 >> 4; *(int *)(unaff_EBP + -0x1c) = iVar10; puVar20 = *(undefined4 **)(unaff_EBX + 8); if (uVar12 < uVar16) { iVar13 = uVar12 * 0x10 + *(int *)(iVar14 + 0x518); LAB_009d2c3f: *(int *)(iVar14 + 0x51c) = iVar13; } else if (uVar16 < uVar12) { if (uVar12 <= (uint)(*(int *)(iVar14 + 0x520) - *(int *)(unaff_EBP + -0x1c) >> 4)) { iVar13 = uVar12 - uVar16; *(int *)(unaff_EBP + -0x1c) = iVar13; if (iVar13 == 0) { iVar13 = *(int *)(unaff_EBP + -0x44); } else { memset(*(void **)(unaff_EBP + -0x44),0,iVar13 * 0x10); iVar13 = *(int *)(unaff_EBP + -0x44) + *(int *)(unaff_EBP + -0x1c) * 0x10; } goto LAB_009d2c3f; } std::vector<16byte>::_Resize_reallocate(uVar12,uVar12); } *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; *(undefined4 *)(unaff_EBP + -0x44) = 0; if (*(short *)(unaff_EBP + -0x30) == 0) goto LAB_009d2c5b; while (cVar6 = (**(code **)(*(int *)*puVar20 + 0x10))(), cVar6 == '\0') { iVar13 = (*(uint *)(unaff_EBP + -0x44) & 0xffff) * 0x10; puVar20 = (undefined4 *)(*(int *)(iVar14 + 0x518) + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x518) + 4 + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x518) + 8 + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); puVar20 = (undefined4 *)(*(int *)(*(int *)(unaff_EBP + -0x24) + 0x518) + 0xc + iVar13); (**(code **)(*(int *)**(undefined4 **)(unaff_EBX + 8) + 0x14))(puVar20,4,1); *(undefined4 *)(unaff_EBP + -0x1c) = *puVar20; Checksum::Update(*(void **)(unaff_EBP + -0x28),(byte *)(unaff_EBP + -0x1c),4); iVar14 = *(int *)(unaff_EBP + -0x24); *(undefined4 *)(unaff_EBP + -0x1c) = *(undefined4 *)(iVar13 + 4 + *(int *)(iVar14 + 0x518)); cVar6 = is_valid_item_config_id(); if (cVar6 == '\0') { KAGE_LogMessage(1,(byte *)"[warn] Invalid temporary effect (type: %d, ID: %d)\n"); goto code_r0x009d459a; } iVar13 = *(int *)(unaff_EBP + -0x44) + 1; *(int *)(unaff_EBP + -0x44) = iVar13; if (*(ushort *)(unaff_EBP + -0x30) <= (ushort)iVar13) goto LAB_009d2c5b; puVar20 = *(undefined4 **)(unaff_EBX + 8); } KAGE_LogMessage(1,(byte *)"[warn] Invalid costume count %d. Save file %s might be corrupt.\n"); } code_r0x009d459a: uVar8 = 0; LAB_009d459c: ExceptionList = *(void **)(unaff_EBP + -0xc); return uVar8; } //@@ 009d2bd4 Catch_All@009d2bd4 undefined * Catch_All_009d2bd4(void) { KAGE_LogMessage(1,(byte *) "[warn] Invalid temporary effect count %d. Save file %s might be corrupt.\n"); return &UNK_009d2bf7; } //@@ 009d396e Catch_All@009d396e undefined4 Catch_All_009d396e(void) { KAGE_LogMessage(1,(byte *)"[warn] Invalid familiar count %d. Save file %s might be corrupt.\n"); return 0x9d26db; } //@@ 009d459a FUN_009d459a undefined1 FUN_009d459a(void) { int unaff_EBP; ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } //@@ 009d45c0 GameState::write_player /* DB: ? GameState::write calls it per player (count game+0x19d78) and for the 4 0x5dc-byte records at game+0x1cc5c; writes fields via stream vfn 0x1c plus the checksum accumulator FUN_00683410; also from write_rerun */ void GameState::write_player(undefined4 *param_1) { byte bVar1; undefined4 *in_ECX; int unaff_ESI; undefined1 *puVar2; char *pcVar3; undefined4 *listEntry; undefined4 *listEntry; char *pcVar5; uint uVar6; byte *pbStack_6b8; undefined4 uStack_6ac; ushort uVar7; uint uVar8; byte *pbVar9; undefined4 uStack_6a0; char *pcVar10; undefined1 uVar11; undefined4 uStack_694; undefined4 uStack_688; undefined4 uStack_67c; undefined4 uVar12; undefined4 uStack_670; byte abStack_662 [2]; undefined4 uStack_658; int iVar13; int iVar14; undefined4 uStack_64c; byte abStack_63e [2]; byte abStack_632 [2]; int iVar15; undefined4 uStack_628; int iVar16; int iVar17; undefined4 uStack_61c; int iVar18; int iVar19; undefined4 uStack_610; int iVar20; byte abStack_602 [2]; int iVar21; undefined4 uStack_5f8; byte abStack_5ea [2]; byte abStack_5de [2]; undefined4 uStack_5d4; byte abStack_5c6 [2]; byte abStack_5ba [2]; byte abStack_5ae [2]; byte abStack_5a2 [2]; undefined4 uStack_598; undefined4 uStack_58c; undefined4 uStack_580; undefined4 uStack_574; undefined4 uStack_568; int iStack_55c; undefined4 uStack_550; byte abStack_542 [2]; byte abStack_536 [2]; byte abStack_52a [2]; byte abStack_51e [2]; byte abStack_512 [2]; byte abStack_506 [2]; byte abStack_4fa [2]; byte abStack_4ee [2]; undefined4 uVar22; byte abStack_4e2 [2]; byte abStack_4d6 [2]; byte abStack_4ca [2]; byte abStack_4be [2]; byte abStack_4b2 [2]; byte abStack_4a6 [2]; byte abStack_49a [2]; byte abStack_48e [2]; byte abStack_482 [2]; byte abStack_476 [2]; byte abStack_446 [2]; byte abStack_43a [2]; byte abStack_42e [2]; byte abStack_422 [2]; byte abStack_416 [2]; byte abStack_40a [2]; byte abStack_3fe [2]; byte abStack_3f2 [2]; byte abStack_3e6 [2]; byte abStack_3da [2]; byte abStack_3ce [2]; undefined4 uStack_3c4; byte abStack_3b6 [2]; byte abStack_3aa [2]; byte abStack_39e [2]; byte abStack_392 [2]; byte abStack_386 [2]; byte abStack_37a [2]; byte abStack_36e [2]; byte abStack_362 [2]; byte abStack_356 [2]; byte abStack_34a [2]; byte abStack_33e [2]; byte abStack_332 [2]; undefined4 uStack_328; byte abStack_31a [2]; byte abStack_30e [2]; byte abStack_302 [2]; byte abStack_2f6 [2]; byte abStack_2ea [2]; byte abStack_2de [2]; byte abStack_2d2 [2]; byte abStack_2c6 [2]; byte abStack_2ba [2]; undefined4 uStack_2b0; byte abStack_2a2 [2]; undefined4 uStack_298; uint uVar23; byte abStack_28a [2]; uint *puVar24; byte abStack_27e [2]; int iVar25; byte abStack_272 [2]; int iVar26; byte abStack_266 [2]; int iVar27; byte abStack_25a [2]; int iVar28; byte abStack_242 [2]; byte abStack_236 [2]; int *piVar29; byte abStack_22a [2]; byte abStack_21e [2]; byte abStack_212 [2]; byte abStack_206 [2]; byte abStack_1fa [2]; byte abStack_1ee [2]; byte abStack_1e2 [2]; byte abStack_1d6 [2]; byte abStack_1ca [2]; byte abStack_1be [2]; byte abStack_1b2 [2]; byte abStack_1a6 [2]; byte abStack_19a [2]; byte abStack_18e [2]; byte abStack_182 [2]; byte abStack_176 [2]; byte abStack_16a [2]; byte abStack_15e [2]; byte abStack_152 [2]; byte abStack_146 [2]; byte abStack_13a [2]; byte abStack_12e [2]; byte abStack_122 [2]; byte abStack_116 [2]; byte abStack_10a [2]; byte abStack_fe [2]; byte abStack_f2 [2]; byte abStack_e6 [2]; byte abStack_da [2]; byte abStack_ce [2]; byte abStack_c2 [2]; byte abStack_b6 [2]; byte abStack_92 [2]; byte abStack_86 [2]; byte abStack_7a [2]; int iVar30; byte abStack_6e [2]; byte abStack_62 [6]; undefined4 uStack_5c; byte abStack_4a [6]; undefined4 auStack_44 [3]; undefined4 auStack_38 [3]; undefined4 auStack_2c [3]; undefined4 auStack_20 [7]; uStack_5c = 1; (**(code **)(*(int *)*param_1 + 0x1c))(); auStack_20[0] = *in_ECX; listEntry = param_1 + 3; Checksum::Update(listEntry,(byte *)auStack_20,4); (**(code **)(*(int *)*param_1 + 0x1c))(); auStack_2c[0] = in_ECX[1]; Checksum::Update(listEntry,(byte *)auStack_2c,4); iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); auStack_38[0] = *(undefined4 *)(unaff_ESI + 8); Checksum::Update(listEntry,(byte *)auStack_38,4); (**(code **)(*(int *)*param_1 + 0x1c))(); auStack_44[0] = uRam00000010; Checksum::Update(listEntry,(byte *)auStack_44,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4a + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_5c = *(undefined4 *)(iVar30 + 0x14); Checksum::Update(listEntry,(byte *)&uStack_5c,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_6e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_7a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_86 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_92 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_92 + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_da + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_e6 + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_c2 + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_ce + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_10a + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_e6 + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_f2 + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_fe + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_10a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_116 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_122 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_12e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_13a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_146 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_152 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_15e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_16a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_176 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_182 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_18e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_19a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1a6 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1b2 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1be + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1ca + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1d6 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1e2 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1ee + 6,4); piVar29 = (int *)0x1; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_1fa + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_206 + 6,4); do { iVar28 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_212 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); iVar30 = *piVar29; Checksum::Update(listEntry,abStack_21e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_22a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); piVar29 = *(int **)(iVar28 + 8); Checksum::Update(listEntry,abStack_236 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_242 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_206 + 6,4); } while (iVar30 != 1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_212 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_21e + 6,4); iVar27 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_22a + 6,4); iVar26 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_236 + 6,4); iVar25 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_242 + 6,4); puVar24 = (uint *)&DAT_00000004; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_242 + -6,4); iVar28 = iVar26 + 0x104; iVar30 = 4; do { iVar25 = CONCAT13((char)((uint)iVar25 >> 0x18), CONCAT12(*(undefined1 *)(iVar28 + 4),(short)iVar25)); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_28a + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_242 + -6,4); iVar28 = iVar28 + 8; iVar30 = iVar30 + -1; } while (iVar30 != 0); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,(byte *)(iVar26 + 0x124),0x40); iVar28 = 1; iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_266 + 6,4); write_int_vector(); write_int_vector(); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_272 + 6,4); uVar23 = 0; if (iVar27 != -0x100) { do { (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_27e + 6,2); uVar7 = *(ushort *)(*(int *)(iVar25 + 0x180) + 4 + iVar28 * 8); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_272 + 6,2); uVar23 = uVar23 + 1; } while (uVar23 < uVar7); } (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,(byte *)(iVar25 + 0x18c),8); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_28a + 6,4); uStack_298 = 0; if (*(int *)(iVar30 + 0x1d0) != 0) { do { (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(param_1 + 3,abStack_28a + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(param_1 + 3,abStack_28a + 6,4); uStack_298 = uStack_298 + 1; } while (uStack_298 < *puVar24); } listEntry = param_1 + 3; write_int_vector(); write_int_vector(); write_int_vector(); write_int_vector(); write_int_vector(); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_28a + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2a2 + 6,4); uStack_2b0 = 5; do { (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2a2 + 6,4); uStack_2b0 = uStack_2b0 + -1; } while (uStack_2b0 != 0); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2a2 + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2ba + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2c6 + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2d2 + 6,4); piVar29 = (int *)&DAT_00000004; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2de + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2ea + 6,4); iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_2f6 + 6,4); iVar28 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_302 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_30e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_31a + 6,4); uStack_328 = 0; if (0 < *(int *)(iVar30 + 0x22c)) { iVar30 = iVar28; do { (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_31a + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_332 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_33e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_34a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_356 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_362 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_34a + 6,1); uStack_328 = uStack_328 + 1; } while (uStack_328 < *piVar29); } (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_31a + -6,4); uVar23 = 0; iVar25 = *(int *)(iVar30 + 0x1e4) - *(int *)(iVar30 + 0x1e0); iVar28 = iVar25 >> 0x1f; if (iVar25 / 0x78 + iVar28 != iVar28) { iVar28 = 0; do { write_entity_save_state((void *)(*(int *)(iVar30 + 0x1e0) + iVar28),param_1); iVar28 = iVar28 + 0x78; uVar23 = uVar23 + 1; } while (uVar23 < (uint)((*(int *)(iVar30 + 0x1e4) - *(int *)(iVar30 + 0x1e0)) / 0x78)); } listEntry = param_1 + 3; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_332 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_33e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_34a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_356 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_362 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_36e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_37a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_386 + 6,4); iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_392 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_39e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3aa + 6,4); uVar22 = 0; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3b6 + 6,4); uVar7 = (ushort)uVar22; uStack_3c4 = 0; if (*(int *)(iVar30 + 0x37c) != 0) { do { (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3b6 + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3ce + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3da + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3e6 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3f2 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3fe + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_40a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_416 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_422 + 6,4); iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_42e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_43a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_446 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_482 + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3e6 + 6,1); uVar7 = (ushort)uVar22; uStack_3c4 = uStack_3c4 + 1; } while (uStack_3c4 < *(uint *)(iVar30 + 0x37c)); } (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3f2 + 6,1); uVar23 = (uint)uVar7; if ((char)(uVar7 >> 8) != '\0') { do { GameStatePlayer::write_coplayer(); bVar1 = (char)(uVar23 >> 0x10) + 1; uVar6 = uVar23 >> 8; uVar23 = (uint)CONCAT12(bVar1,(short)uVar23); } while (bVar1 < (byte)uVar6); } (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3fe + 6,1); if (*(char *)(iVar30 + 0x398) != '\0') { GameStatePlayer::write_coplayer(); } (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3da + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3e6 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3f2 + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_3fe + 6,2); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_40a + 6,4); iVar28 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_416 + 6,4); iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_422 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_42e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,(byte *)(iVar28 + 0x458),0xc); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,(byte *)(iVar30 + 0x464),0xc); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_446 + -6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_48e + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_49a + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4a6 + 6,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_482 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_48e + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_49a + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4a6 + 6,4); uVar22 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4b2 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4be + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4ca + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4d6 + 6,2); uVar7 = 0; if ((short)uVar22 != 0) { do { (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(param_1 + 3,abStack_4e2 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(param_1 + 3,abStack_4ee + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(param_1 + 3,abStack_4fa + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(param_1 + 3,abStack_4d6 + 6,4); uVar7 = uVar7 + 1; } while (uVar7 < (ushort)uVar22); } listEntry = param_1 + 3; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4e2 + 6,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4ee + 6,4); iVar30 = 2; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_4fa + 6,2); iVar25 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_506 + 6,4); iVar28 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); iStack_55c = 0x9d6173; Checksum::Update(listEntry,abStack_512 + 6,4); iStack_55c = iVar30 + 0x4a4; iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_568 = 0x9d61a1; Checksum::Update(listEntry,abStack_51e + 6,4); uVar22 = 4; uStack_568 = iVar25 + 0x4a8; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_574 = 0x9d61cb; Checksum::Update(listEntry,abStack_52a + 6,4); iVar26 = 4; uStack_574 = iVar28 + 0x4ac; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_580 = (byte *)0x9d61f5; Checksum::Update(listEntry,abStack_536 + 6,4); uStack_580 = abStack_542 + -0x21; iVar25 = 1; iVar28 = CONCAT22((short)((uint)uVar22 >> 0x10), CONCAT11(*(undefined1 *)(iVar30 + 0x4c0),(char)uVar22)); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_58c = (byte *)0x9d622b; Checksum::Update(listEntry,abStack_542 + -0x2a,1); uVar23 = 0; bVar1 = 0; if ((char)((uint)iVar26 >> 8) != '\0') { do { iVar30 = iVar28; uVar23 = uVar23 + *(int *)(iVar30 + 0x4bc); iVar26 = CONCAT13(*(undefined1 *) (*(int *)(*(int *)(iVar30 + 0x4b4) + (*(int *)(iVar30 + 0x4b8) - 1U & uVar23 >> 1) * 4) + 4 + (uVar23 & 1) * 8),(int3)iVar26); uStack_58c = abStack_542 + -0x2b; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_574 = CONCAT31(uStack_574._1_3_,(char)((uint)iVar25 >> 0x18)); uStack_598 = (int *)0x9d62c0; Checksum::Update(param_1 + 3,(byte *)&uStack_574,1); uStack_598 = &iStack_55c; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_58c = (byte *)0x9d62e6; Checksum::Update(param_1 + 3,abStack_542 + 6,4); bVar1 = bVar1 + 1; uVar23 = (uint)bVar1; iVar28 = iVar30; } while (bVar1 < (byte)((uint)iVar26 >> 8)); } listEntry = param_1 + 3; uStack_550 = 0; do { puVar2 = (undefined1 *)(*(int *)(iVar30 + 0x4c4) + uStack_550); uStack_58c = puVar2; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_568 = CONCAT31(uStack_568._1_3_,*puVar2); uStack_58c = (byte *)0x9d632c; iVar30 = iVar28; Checksum::Update(listEntry,(byte *)&uStack_568,1); uStack_550 = uStack_550 + 1; iVar28 = iVar30; } while (uStack_550 < 8); uStack_58c = (byte *)(iVar30 + 0x4d0); uVar22 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_598 = (int *)0x9d6364; Checksum::Update(listEntry,abStack_542 + -6,4); uVar23 = 0; uStack_598 = (int *)(iVar26 + 0x4d4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_542 + -0x12,4); uStack_568 = 0; do { puVar2 = (undefined1 *)(*(int *)(iVar25 + 0x4dc) + uStack_568); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_580 = (byte *)CONCAT31(uStack_580._1_3_,*puVar2); Checksum::Update(listEntry,(byte *)&uStack_580,1); uStack_568 = uStack_568 + 1; } while (uStack_568 < 6); iVar30 = CONCAT13((char)((uint)uVar22 >> 0x18),CONCAT12(0x14,(short)uVar22)); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_58c = (byte *)CONCAT31(uStack_58c._1_3_,(char)(uVar23 >> 0x10)); Checksum::Update(listEntry,(byte *)&uStack_58c,1); uStack_574 = 0; if ((char)(uVar23 >> 0x10) != '\0') { do { puVar2 = (undefined1 *)(*(int *)(iVar30 + 0x4e8) + uStack_574); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_58c = (byte *)CONCAT31(uStack_58c._1_3_,*puVar2); Checksum::Update(listEntry,(byte *)&uStack_58c,1); uStack_574 = uStack_574 + 1; } while (uStack_574 < (uVar23 >> 0x10 & 0xff)); } iVar28 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_598 = (int *)CONCAT31(uStack_598._1_3_,*(undefined1 *)(iVar30 + 0x4f4)); Checksum::Update(listEntry,(byte *)&uStack_598,1); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_5a2 + 0x2a,4); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_5d4 = 0x9d64c5; Checksum::Update(listEntry,abStack_5a2 + 0x1e,4); iVar30 = 4; uStack_5d4 = iVar28 + 0x4fc; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_5a2 + 0x12,4); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_5a2 + 6,4); iVar27 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_5f8 = 0x9d6543; Checksum::Update(listEntry,abStack_5ae + 6,4); uStack_5f8 = iVar30 + 0x514; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_5ba + 6,4); iVar30 = 1; iVar21 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_610 = (undefined4 *)0x9d659b; Checksum::Update(listEntry,abStack_5c6 + 6,4); GameStatePlayer::write_block_538(); uStack_5d4 = (*(int *)(iVar27 + 0x55c) - *(int *)(iVar27 + 0x558)) / 0x34; uStack_610 = &uStack_5d4; iVar28 = 1; iVar20 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_61c = 0x9d65f2; Checksum::Update(listEntry,abStack_5c6 + -6,4); iVar26 = *(int *)(iVar27 + 0x55c) - *(int *)(iVar27 + 0x558); iVar25 = iVar26 >> 0x1f; if (iVar26 / 0x34 + iVar25 != iVar25) { uStack_61c = 0; do { uStack_61c = *(int *)(iVar27 + 0x558) + uStack_61c; iVar19 = 1; iVar18 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_628 = (byte *)0x9d6649; Checksum::Update(listEntry,abStack_5de + 6,4); iVar17 = 1; iVar16 = 4; piVar29 = (int *)(*(int *)(iVar21 + 0x558) + iVar30 + 4); uStack_628 = (byte *)piVar29; (**(code **)(*(int *)*param_1 + 0x1c))(); iVar25 = *piVar29; Checksum::Update(listEntry,abStack_5ea + 6,4); iVar15 = 1; iVar27 = 4; iVar30 = *(int *)(iVar20 + 0x558); (**(code **)(*(int *)*param_1 + 0x1c))(); iVar26 = *(int *)(iVar30 + iVar28 + 8); Checksum::Update(listEntry,abStack_5ea + -6,4); iVar30 = *(int *)(iVar18 + 0x558); (**(code **)(*(int *)*param_1 + 0x1c))(); iVar30 = *(int *)(iVar30 + iVar19 + 0xc); uStack_64c = (int *)0x9d66e2; Checksum::Update(listEntry,abStack_602 + 6,4); iVar19 = 1; iVar18 = 4; piVar29 = (int *)(*(int *)(iVar16 + 0x558) + iVar17 + 0x10); uStack_64c = piVar29; (**(code **)(*(int *)*param_1 + 0x1c))(); iVar28 = *piVar29; uStack_658 = 0x9d6715; Checksum::Update(listEntry,abStack_602 + -6,4); iVar14 = 1; iVar13 = 4; uStack_658 = *(int *)(iVar27 + 0x558) + iVar15 + 0x14; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_602 + -0x12,4); iVar17 = 1; iVar27 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_670 = (undefined1 *)0x9d677b; Checksum::Update(listEntry,abStack_632 + 0x12,4); iVar16 = 1; iVar15 = 4; uStack_670 = (undefined1 *)(*(int *)(iVar18 + 0x558) + iVar19 + 0x1c); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_67c = 0x9d67ae; Checksum::Update(listEntry,abStack_632 + 6,4); iVar19 = 1; iVar18 = 4; uStack_67c = *(int *)(iVar13 + 0x558) + iVar14 + 0x20; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_688 = (byte *)0x9d67e5; Checksum::Update(listEntry,abStack_63e + 6,4); uStack_688 = (byte *)(*(int *)(iVar27 + 0x558) + iVar17 + 0x24); iVar27 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_694 = 0x9d681c; Checksum::Update(listEntry,abStack_63e + -6,4); uStack_694 = *(int *)(iVar15 + 0x558) + iVar16 + 0x28; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_6a0 = (byte *)0x9d6853; Checksum::Update(listEntry,abStack_662 + 0x12,4); uVar11 = 1; uStack_6a0 = (byte *)(*(int *)(iVar18 + 0x558) + iVar19 + 0x2c); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_6ac = (byte *)0x9d6886; Checksum::Update(listEntry,abStack_662 + 6,4); uStack_6ac = abStack_662 + -0x2a; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_694 = CONCAT31(uStack_694._1_3_,uVar11); pbStack_6b8 = (byte *)0x9d68c4; Checksum::Update(listEntry,(byte *)&uStack_694,1); pbStack_6b8 = abStack_662 + -0x37; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_5f8 = CONCAT31(uStack_5f8._1_3_,(char)((uint)iVar21 >> 0x18)); uStack_61c = 0x9d68fe; Checksum::Update(listEntry,(byte *)&uStack_5f8,1); uStack_61c = iVar26 + 0x34; } while (iVar25 + 1U < (uint)((*(int *)(iVar27 + 0x55c) - *(int *)(iVar27 + 0x558)) / 0x34)); } uStack_61c = iVar27 + 0x564; uVar22 = 1; iVar28 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_628 = (byte *)0x9d6958; Checksum::Update(listEntry,abStack_5de + 6,4); piVar29 = (int *)(iVar21 + 0x568); iVar30 = 4; do { uStack_628 = abStack_602 + -6; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_610 = (undefined4 *)CONCAT31(uStack_610._1_3_,(char)uVar22); Checksum::Update(listEntry,(byte *)&uStack_610,1); uStack_5f8 = *piVar29; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_628 = (byte *)0x9d69cb; Checksum::Update(listEntry,abStack_5de + 6,4); iVar30 = iVar30 + -1; piVar29 = piVar29 + 2; } while (iVar30 != 0); iVar26 = 4; uStack_628 = (byte *)(iVar21 + 0x588); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,(byte *)(iVar21 + 0x588),8); uVar22 = 1; iVar25 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_61c = CONCAT31(uStack_61c._1_3_,*(undefined1 *)(iVar20 + 0x590)); Checksum::Update(listEntry,(byte *)&uStack_61c,1); piVar29 = (int *)(iVar28 + 0x594); iVar30 = 4; do { (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_628 = (byte *)CONCAT31(uStack_628._1_3_,(char)uVar22); uStack_64c = (int *)0x9d6a61; Checksum::Update(listEntry,(byte *)&uStack_628,1); uStack_64c = &uStack_610; uStack_610 = (undefined4 *)*piVar29; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_5ea + -6,4); iVar30 = iVar30 + -1; piVar29 = piVar29 + 2; } while (iVar30 != 0); iVar20 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_64c = (int *)0x9d6ab7; Checksum::Update(listEntry,(byte *)(iVar28 + 0x5b4),8); iVar27 = 4; uStack_64c = (int *)(iVar26 + 0x5c8); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_658 = 0x9d6ae1; Checksum::Update(listEntry,abStack_602 + -6,4); iVar28 = 4; uStack_658 = iVar25 + 0x5cc; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_602 + -0x12,4); iVar30 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_64c = (int *)CONCAT31(uStack_64c._1_3_,*(undefined1 *)(iVar20 + 0x5d0)); uStack_670 = (undefined1 *)0x9d6b3a; Checksum::Update(listEntry,(byte *)&uStack_64c,1); uVar22 = 1; uStack_670 = (undefined1 *)(iVar27 + 0x5d1); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_658 = CONCAT31(uStack_658._1_3_,*(undefined1 *)(iVar27 + 0x5d1)); uStack_67c = 0x9d6b65; Checksum::Update(listEntry,(byte *)&uStack_658,1); uStack_67c = iVar28 + 0x524; iVar26 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_688 = (byte *)0x9d6b8f; Checksum::Update(listEntry,abStack_63e + 6,4); uStack_688 = abStack_662 + -8; iVar25 = 1; iVar28 = CONCAT13((char)((uint)uVar22 >> 0x18), CONCAT12((char)(*(int *)(iVar30 + 0x504) - *(int *)(iVar30 + 0x500) >> 2), (short)uVar22)); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_670 = (undefined1 *)CONCAT31(uStack_670._1_3_,(char)((uint)iVar26 >> 0x10)); uStack_694 = 0x9d6bcd; Checksum::Update(listEntry,(byte *)&uStack_670,1); uVar23 = 0; bVar1 = 0; if ((char)((uint)iVar26 >> 0x10) != '\0') { do { uStack_694 = *(int *)(iVar30 + 0x500) + uVar23 * 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_694 = 0x9d6c0c; iVar30 = iVar28; Checksum::Update(listEntry,abStack_63e + -6,4); bVar1 = bVar1 + 1; uVar23 = (uint)bVar1; iVar28 = iVar30; } while (bVar1 < (byte)((uint)iVar26 >> 0x10)); } uStack_694 = iVar30 + 0x50c; iVar30 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_6a0 = (byte *)0x9d6c46; Checksum::Update(listEntry,abStack_662 + 0x12,4); uVar23 = 1; pcVar10 = &DAT_00000004; uStack_6a0 = (byte *)(iVar26 + 0x510); (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_6ac = (byte *)0x9d6c70; Checksum::Update(listEntry,abStack_662 + 6,4); pbVar9 = (byte *)0x1; uVar22 = 1; pcVar3 = (char *)(iVar25 + 0x5bc); uStack_6ac = (byte *)pcVar3; (**(code **)(*(int *)*param_1 + 0x1c))(); uStack_694 = CONCAT31(uStack_694._1_3_,*pcVar3); pbStack_6b8 = (byte *)0x9d6c9a; Checksum::Update(listEntry,(byte *)&uStack_694,1); if (*pcVar3 != -1) { pbStack_6b8 = (byte *)(iVar30 + 0x5c0); (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_662 + -0x12,4); (**(code **)(*(int *)*param_1 + 0x1c))(pcVar10 + 0x5c4,4,1); pbStack_6b8 = (byte *)0x9d6cf3; Checksum::Update(listEntry,abStack_662 + -6,4); } pcVar3 = &DAT_00000004; pbStack_6b8 = abStack_662 + -0x12; (**(code **)(*(int *)*param_1 + 0x1c))(); Checksum::Update(listEntry,abStack_662 + -0x12,4); bVar1 = (byte)uVar22; listEntry = *(undefined4 **)(iVar30 + 0x3bc); if (listEntry != *(undefined4 **)(pcVar10 + 0x3c0)) { do { uStack_688 = (byte *)listEntry[2]; if (*(char *)(listEntry + 1) == '\0') { if ((int)uStack_688 < 0) { uStack_688 = (byte *)(-(int)uStack_688 | 0x2000000); } } else if ((int)uStack_688 < 0) { uStack_688 = (byte *)(-(int)uStack_688 | 0x3000000); } else { uStack_688 = (byte *)((uint)uStack_688 | 0x1000000); } uVar23 = listEntry[4]; uStack_67c = listEntry[5]; uVar12 = *listEntry; uVar6 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(&uStack_688,4,1); uStack_67c = uStack_694; Checksum::Update(listEntry,(byte *)&uStack_67c,4); (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x36,4,1); uStack_688 = pbVar9; Checksum::Update(listEntry,(byte *)&uStack_688,4); (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x4e,4,1); uStack_694 = uVar6; Checksum::Update(listEntry,(byte *)&uStack_694,4); (**(code **)(*(int *)*param_1 + 0x1c))(&uStack_6a0,4,1); uStack_6a0 = uStack_6ac; Checksum::Update(listEntry,(byte *)&uStack_6a0,4); (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x46,4,1); uStack_6ac = (byte *)pcVar3; Checksum::Update(listEntry,(byte *)&uStack_6ac,4); (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x4e,4,1); uStack_670 = (undefined1 *)uVar12; Checksum::Update(listEntry,(byte *)&uStack_670,4); bVar1 = (byte)uVar22; listEntry = listEntry + 7; } while (listEntry != *(undefined4 **)(pcVar10 + 0x3c0)); } iVar30 = 0xf; uVar7 = (ushort)bVar1; piVar29 = (int *)(pcVar10 + 0x404); do { if (-1 < *piVar29) { uVar7 = CONCAT11((char)iVar30 + '\x01',bVar1); break; } piVar29 = piVar29 + -1; iVar30 = iVar30 + -1; } while (-1 < iVar30); uVar8 = (uint)uVar7; uVar22 = 1; (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x45,1,1); uStack_6ac = (byte *)CONCAT31(uStack_6ac._1_3_,(char)((uint)pcVar3 >> 8)); Checksum::Update(listEntry,(byte *)&uStack_6ac,1); uVar11 = (undefined1)uVar22; uVar6 = 0; bVar1 = 0; if ((char)((uint)pcVar3 >> 8) != '\0') { do { uVar6 = (uint)*(ushort *)(pcVar10 + uVar6 * 4 + 0x3c8); (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x1e,2,1); uStack_67c = uVar6 & 0xffff; Checksum::Update(listEntry,(byte *)&uStack_67c,2); uVar11 = (undefined1)uVar22; bVar1 = bVar1 + 1; uVar6 = (uint)bVar1; } while (bVar1 < (byte)((uint)pcVar3 >> 8)); } iVar30 = 1; pcVar5 = (char *)0x1; (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x4e); pbStack_6b8 = (byte *)CONCAT31(pbStack_6b8._1_3_,uVar11); Checksum::Update(listEntry,(byte *)&pbStack_6b8,1); uVar6 = 0; if (*(int *)(pcVar10 + 0x428) - *(int *)(pcVar10 + 0x424) >> 2 != 0) { do { piVar29 = (int *)(*(int *)(pcVar10 + 0x424) + uVar6 * 4); (**(code **)(*(int *)*param_1 + 0x1c))(piVar29,4,1); uStack_688 = (byte *)*piVar29; pcVar10 = pcVar3; Checksum::Update(listEntry,(byte *)&uStack_688,4); uVar6 = uVar6 + 1; pcVar3 = pcVar10; } while (uVar6 < (uint)(*(int *)(pcVar10 + 0x428) - *(int *)(pcVar10 + 0x424) >> 2)); } iVar28 = 4; (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x2a,4,1); uStack_694 = uVar23; Checksum::Update(listEntry,(byte *)&uStack_694,4); uStack_6ac = (byte *)**(int **)(pcVar10 + 0x5d4); if (uStack_6ac != (byte *)*(int **)(pcVar10 + 0x5d4)) { do { uStack_6a0 = (byte *)(uint)*(ushort *)((int)uStack_6ac + 0x14); (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x3a,2,1); uStack_6a0 = (byte *)(uVar8 & 0xffff); Checksum::Update(listEntry,(byte *)&uStack_6a0,2); (**(code **)(*(int *)*param_1 + 0x1c))(&uStack_6ac,2,1); uStack_694 = (uint)uStack_6a0 & 0xffff; Checksum::Update(listEntry,(byte *)&uStack_694,2); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&uStack_6ac); } while (uStack_6ac != (byte *)*(int *)(pcVar10 + 0x5d4)); } (**(code **)(*(int *)*param_1 + 0x1c))(abStack_662 + -0x36,4,1); uStack_6a0 = pbVar9; Checksum::Update(listEntry,(byte *)&uStack_6a0,4); uVar23 = 0; if (*(int *)(pcVar10 + 0x4c0) != 0) { do { piVar29 = (int *)(*(int *)(*(int *)(pcVar10 + 0x4b4) + (uVar23 + *(int *)(pcVar10 + 0x4bc) >> 1 & *(int *)(pcVar10 + 0x4b8) - 1U) * 4) + (uVar23 + *(int *)(pcVar10 + 0x4bc) & 1) * 8); (**(code **)(*(int *)*param_1 + 0x1c))(piVar29,4,1); uStack_6ac = (byte *)*piVar29; Checksum::Update(listEntry,(byte *)&uStack_6ac,4); uVar6 = iVar30 + *(int *)(iVar28 + 0x4bc); piVar29 = (int *)((uVar6 & 1) * 8 + 4 + *(int *)(*(int *)(iVar28 + 0x4b4) + (uVar6 >> 1 & *(int *)(iVar28 + 0x4b8) - 1U) * 4)); (**(code **)(*(int *)*param_1 + 0x1c))(piVar29,4,1); uStack_6a0 = (byte *)*piVar29; pcVar10 = pcVar5; Checksum::Update(listEntry,(byte *)&uStack_6a0,4); uVar23 = uVar23 + 1; pcVar5 = pcVar10; } while (uVar23 < *(uint *)(pcVar10 + 0x4c0)); } return; } //@@ 009d71b0 GameState::read_record /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? no callers; stream vfn 0x14 (read) into this[0..0x10] plus vector loops (this[0xb]) via FUN_0069ee50, checksum FUN_00683410; counterpart of a GameState::write_* (FUN_009d8660 shared with 009e54d0/009e5710/009e5a30) prototype: db/protos.zhl, confirmed by RET 4 */ void GameState::read_record(uint *record,int *stream) { uint entryCount; uint local_24; uint checksumValue; byte checksumByte [7]; byte flagByte; uint entry; uint entryField2; uint entryField3; undefined4 local_8; undefined8 *entryEnd; local_8 = __security_cookie ^ (uint)(checksumByte + 0x18); (**(code **)(*(int *)*stream + 0x14))(record,4,1); local_24 = *record; Checksum::Update(stream + 3,(byte *)&local_24,4); (**(code **)(*(int *)*stream + 0x14))(record + 1,4,1); local_24 = record[1]; Checksum::Update(stream + 3,(byte *)&local_24,4); (**(code **)(*(int *)*stream + 0x14))(record + 2,4,1); local_24 = record[2]; Checksum::Update(stream + 3,(byte *)&local_24,4); (**(code **)(*(int *)*stream + 0x14))(record + 3,4,1); local_24 = record[3]; Checksum::Update(stream + 3,(byte *)&local_24,4); (**(code **)(*(int *)*stream + 0x14))(record + 4,4,1); local_24 = record[4]; Checksum::Update(stream + 3,(byte *)&local_24,4); (**(code **)(*(int *)*stream + 0x14))(record + 5,4,1); local_24 = record[5]; Checksum::Update(stream + 3,(byte *)&local_24,4); entryCount = 0x1f - ((uint)stream[2] < 0x94); if ((uint)stream[2] < 0xa2) { entryField2 = entryField2 & 0xffffff00; entryField3 = 0x3f800000; local_24 = 0; do { (**(code **)(*(int *)*stream + 0x14))(&entry,4,1); checksumValue = entry; Checksum::Update(stream + 3,(byte *)&checksumValue,4); entryEnd = (undefined8 *)record[7]; if (entryEnd == (undefined8 *)record[8]) { std::vector<12byte>::_Emplace_reallocate(entryEnd,&entry); } else { *entryEnd = CONCAT44(entryField2,entry); *(uint *)(entryEnd + 1) = entryField3; record[7] = record[7] + 0xc; } (**(code **)(*(int *)*stream + 0x14))(&entry,4,1); checksumValue = entry; Checksum::Update(stream + 3,(byte *)&checksumValue,4); entryEnd = (undefined8 *)record[10]; if (entryEnd == (undefined8 *)record[0xb]) { std::vector<12byte>::_Emplace_reallocate(entryEnd,&entry); } else { *entryEnd = CONCAT44(entryField2,entry); *(uint *)(entryEnd + 1) = entryField3; record[10] = record[10] + 0xc; } local_24 = local_24 + 1; } while (local_24 < entryCount); } else { record[10] = record[9]; entryCount = 0; (**(code **)(*(int *)*stream + 0x14))(&entryCount,4,1); local_24 = entryCount; Checksum::Update(stream + 3,(byte *)&local_24,4); local_24 = 0; if (0 < (int)entryCount) { do { (**(code **)(*(int *)*stream + 0x14))(&entry,4,1); checksumValue = entry; Checksum::Update(stream + 3,(byte *)&checksumValue,4); flagByte = 0; (**(code **)(*(int *)*stream + 0x14))(&flagByte,1,1); checksumByte[0] = flagByte; Checksum::Update(stream + 3,checksumByte,1); entryField2 = CONCAT31(entryField2._1_3_,flagByte != 0); (**(code **)(*(int *)*stream + 0x14))(&entryField3,4,1); checksumValue = entryField3; Checksum::Update(stream + 3,(byte *)&checksumValue,4); entryEnd = (undefined8 *)record[10]; if (entryEnd == (undefined8 *)record[0xb]) { std::vector<12byte>::_Emplace_reallocate(entryEnd,&entry); } else { *entryEnd = CONCAT44(entryField2,entry); *(uint *)(entryEnd + 1) = entryField3; record[10] = record[10] + 0xc; } local_24 = local_24 + 1; } while ((int)local_24 < (int)entryCount); } record[7] = record[6]; entryCount = 0; (**(code **)(*(int *)*stream + 0x14))(&entryCount,4,1); checksumValue = entryCount; Checksum::Update(stream + 3,(byte *)&checksumValue,4); local_24 = 0; if (0 < (int)entryCount) { do { (**(code **)(*(int *)*stream + 0x14))(&entry,4,1); checksumValue = entry; Checksum::Update(stream + 3,(byte *)&checksumValue,4); flagByte = 0; (**(code **)(*(int *)*stream + 0x14))(&flagByte,1,1); checksumByte[0] = flagByte; Checksum::Update(stream + 3,checksumByte,1); entryField2 = CONCAT31(entryField2._1_3_,flagByte != 0); (**(code **)(*(int *)*stream + 0x14))(&entryField3,4,1); checksumValue = entryField3; Checksum::Update(stream + 3,(byte *)&checksumValue,4); entryEnd = (undefined8 *)record[7]; if (entryEnd == (undefined8 *)record[8]) { std::vector<12byte>::_Emplace_reallocate(entryEnd,&entry); } else { *entryEnd = CONCAT44(entryField2,entry); *(uint *)(entryEnd + 1) = entryField3; record[7] = record[7] + 0xc; } local_24 = local_24 + 1; } while ((int)local_24 < (int)entryCount); } } (**(code **)(*(int *)*stream + 0x14))(record + 0xc,4,1); checksumValue = record[0xc]; Checksum::Update(stream + 3,(byte *)&checksumValue,4); (**(code **)(*(int *)*stream + 0x14))(record + 0xd,4,1); checksumValue = record[0xd]; Checksum::Update(stream + 3,(byte *)&checksumValue,4); record[0x12] = record[0x11]; if (0x9e < (uint)stream[2]) { (**(code **)(*(int *)*stream + 0x14))(&entryCount,4,1); checksumValue = entryCount; Checksum::Update(stream + 3,(byte *)&checksumValue,4); local_24 = 0; if (entryCount != 0) { do { entry = 0; entryField2 = 0; entryField3 = entryField3 & 0xffffff00; (**(code **)(*(int *)*stream + 0x14))(&entry,4,1); checksumValue = entry; Checksum::Update(stream + 3,(byte *)&checksumValue,4); (**(code **)(*(int *)*stream + 0x14))(&entryField2,4,1); checksumValue = entryField2; Checksum::Update(stream + 3,(byte *)&checksumValue,4); flagByte = 0; (**(code **)(*(int *)*stream + 0x14))(&flagByte,1,1); checksumByte[0] = flagByte; Checksum::Update(stream + 3,checksumByte,1); entryEnd = (undefined8 *)record[0x12]; entryField3 = CONCAT31(entryField3._1_3_,flagByte != 0); if (entryEnd == (undefined8 *)record[0x13]) { std::vector<12byte>::_Emplace_reallocate(entryEnd,&entry); } else { *entryEnd = CONCAT44(entryField2,entry); *(uint *)(entryEnd + 1) = entryField3; record[0x12] = record[0x12] + 0xc; } local_24 = local_24 + 1; } while (local_24 < entryCount); } } record[0xf] = record[0xe]; if (0xa2 < (uint)stream[2]) { (**(code **)(*(int *)*stream + 0x14))(&entryCount,4,1); checksumValue = entryCount; Checksum::Update(stream + 3,(byte *)&checksumValue,4); local_24 = 0; if (entryCount != 0) { do { entry = 0; entryField2 = 0; entryField3 = entryField3 & 0xffffff00; (**(code **)(*(int *)*stream + 0x14))(&entry,4,1); checksumValue = entry; Checksum::Update(stream + 3,(byte *)&checksumValue,4); (**(code **)(*(int *)*stream + 0x14))(&entryField2,4,1); checksumValue = entryField2; Checksum::Update(stream + 3,(byte *)&checksumValue,4); flagByte = 0; (**(code **)(*(int *)*stream + 0x14))(&flagByte,1,1); checksumByte[0] = flagByte; Checksum::Update(stream + 3,checksumByte,1); entryEnd = (undefined8 *)record[0xf]; entryField3 = CONCAT31(entryField3._1_3_,flagByte != 0); if (entryEnd == (undefined8 *)record[0x10]) { std::vector<12byte>::_Emplace_reallocate(entryEnd,&entry); } else { *entryEnd = CONCAT44(entryField2,entry); *(uint *)(entryEnd + 1) = entryField3; record[0xf] = record[0xf] + 0xc; } local_24 = local_24 + 1; } while (local_24 < entryCount); } } return; } //@@ 009d77e0 GameState::write_score_sheet /* DB: ? (stream*): writes + Checksum::Update the 6 ints this[0..5] and the 12-byte {int, bool, int} vectors this[9..10] and this[6..7] (the block ScoreSheet::store_state 009e54d0 ScoreSheet::store_state via stream vfunc +0x1c; GameState::write; GameState::read_record 009d71b0 GameState::read_record the matching reader */ void GameState::write_score_sheet(undefined4 *param_1) { int iVar1; undefined4 *in_ECX; undefined4 *field; int *intField; int checksumValue; uint local_10; int entryOffset; byte checksumByte [4]; undefined4 *writer; writer = param_1; (**(code **)(*(int *)*param_1 + 0x1c))(); param_1 = (undefined4 *)*in_ECX; Checksum::Update(writer + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 1,4,1); param_1 = (undefined4 *)in_ECX[1]; Checksum::Update(writer + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 2,4,1); param_1 = (undefined4 *)in_ECX[2]; Checksum::Update(writer + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 3,4,1); param_1 = (undefined4 *)in_ECX[3]; Checksum::Update(writer + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 4,4,1); param_1 = (undefined4 *)in_ECX[4]; Checksum::Update(writer + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 5,4,1); param_1 = (undefined4 *)in_ECX[5]; Checksum::Update(writer + 3,(byte *)¶m_1,4); param_1 = (undefined4 *)((int)(in_ECX[10] - in_ECX[9]) / 0xc); (**(code **)(*(int *)*writer + 0x1c))(¶m_1,4,1); local_10 = (uint)param_1; Checksum::Update(writer + 3,(byte *)&local_10,4); local_10 = 0; iVar1 = (int)(in_ECX[10] - in_ECX[9]) >> 0x1f; if ((int)(in_ECX[10] - in_ECX[9]) / 0xc + iVar1 != iVar1) { entryOffset = 0; do { field = (undefined4 *)(in_ECX[9] + entryOffset); (**(code **)(*(int *)*writer + 0x1c))(field,4,1); checksumValue = *field; Checksum::Update(writer + 3,(byte *)&checksumValue,4); param_1 = (undefined4 *)CONCAT13(*(char *)(entryOffset + 4 + in_ECX[9]) != '\0',param_1._0_3_) ; (**(code **)(*(int *)*writer + 0x1c))((int)¶m_1 + 3,1,1); checksumByte[0] = param_1._3_1_; Checksum::Update(writer + 3,checksumByte,1); field = (undefined4 *)(in_ECX[9] + entryOffset + 8); (**(code **)(*(int *)*writer + 0x1c))(field,4,1); checksumValue = *field; Checksum::Update(writer + 3,(byte *)&checksumValue,4); entryOffset = entryOffset + 0xc; local_10 = local_10 + 1; } while (local_10 < (uint)((int)(in_ECX[10] - in_ECX[9]) / 0xc)); } param_1 = (undefined4 *)((int)(in_ECX[7] - in_ECX[6]) / 0xc); (**(code **)(*(int *)*writer + 0x1c))(¶m_1,4,1); checksumValue = (int)param_1; Checksum::Update(writer + 3,(byte *)&checksumValue,4); local_10 = 0; iVar1 = (int)(in_ECX[7] - in_ECX[6]) >> 0x1f; if ((int)(in_ECX[7] - in_ECX[6]) / 0xc + iVar1 != iVar1) { entryOffset = 0; do { field = (undefined4 *)(in_ECX[6] + entryOffset); (**(code **)(*(int *)*writer + 0x1c))(field,4,1); checksumValue = *field; Checksum::Update(writer + 3,(byte *)&checksumValue,4); param_1 = (undefined4 *)CONCAT13(*(char *)(in_ECX[6] + 4 + entryOffset) != '\0',param_1._0_3_) ; (**(code **)(*(int *)*writer + 0x1c))((int)¶m_1 + 3,1,1); checksumByte[0] = param_1._3_1_; Checksum::Update(writer + 3,checksumByte,1); intField = (int *)(entryOffset + 8 + in_ECX[6]); (**(code **)(*(int *)*writer + 0x1c))(intField,4,1); checksumValue = *intField; Checksum::Update(writer + 3,(byte *)&checksumValue,4); entryOffset = entryOffset + 0xc; local_10 = local_10 + 1; } while (local_10 < (uint)((int)(in_ECX[7] - in_ECX[6]) / 0xc)); } (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 0xc,4,1); param_1 = (undefined4 *)in_ECX[0xc]; Checksum::Update(writer + 3,(byte *)¶m_1,4); (**(code **)(*(int *)*writer + 0x1c))(in_ECX + 0xd,4,1); param_1 = (undefined4 *)in_ECX[0xd]; Checksum::Update(writer + 3,(byte *)¶m_1,4); param_1 = (undefined4 *)((int)(in_ECX[0x12] - in_ECX[0x11]) / 0xc); (**(code **)(*(int *)*writer + 0x1c))(¶m_1,4,1); checksumValue = (int)param_1; Checksum::Update(writer + 3,(byte *)&checksumValue,4); local_10 = 0; iVar1 = (int)(in_ECX[0x12] - in_ECX[0x11]) >> 0x1f; if ((int)(in_ECX[0x12] - in_ECX[0x11]) / 0xc + iVar1 != iVar1) { entryOffset = 0; do { field = (undefined4 *)(in_ECX[0x11] + entryOffset); (**(code **)(*(int *)*writer + 0x1c))(field,4,1); checksumValue = *field; Checksum::Update(writer + 3,(byte *)&checksumValue,4); intField = (int *)(in_ECX[0x11] + entryOffset + 4); (**(code **)(*(int *)*writer + 0x1c))(intField,4,1); checksumValue = *intField; Checksum::Update(writer + 3,(byte *)&checksumValue,4); param_1 = (undefined4 *) CONCAT13(*(char *)(entryOffset + 8 + in_ECX[0x11]) != '\0',param_1._0_3_); (**(code **)(*(int *)*writer + 0x1c))((int)¶m_1 + 3,1,1); checksumByte[0] = param_1._3_1_; Checksum::Update(writer + 3,checksumByte,1); entryOffset = entryOffset + 0xc; local_10 = local_10 + 1; } while (local_10 < (uint)((int)(in_ECX[0x12] - in_ECX[0x11]) / 0xc)); } param_1 = (undefined4 *)((int)(in_ECX[0xf] - in_ECX[0xe]) / 0xc); (**(code **)(*(int *)*writer + 0x1c))(¶m_1,4,1); checksumValue = (int)param_1; Checksum::Update(writer + 3,(byte *)&checksumValue,4); local_10 = 0; iVar1 = (int)(in_ECX[0xf] - in_ECX[0xe]) >> 0x1f; if ((int)(in_ECX[0xf] - in_ECX[0xe]) / 0xc + iVar1 != iVar1) { entryOffset = 0; do { field = (undefined4 *)(in_ECX[0xe] + entryOffset); (**(code **)(*(int *)*writer + 0x1c))(field,4,1); checksumValue = *field; Checksum::Update(writer + 3,(byte *)&checksumValue,4); intField = (int *)(in_ECX[0xe] + entryOffset + 4); (**(code **)(*(int *)*writer + 0x1c))(intField,4,1); checksumValue = *intField; Checksum::Update(writer + 3,(byte *)&checksumValue,4); param_1 = (undefined4 *) CONCAT13(*(char *)(entryOffset + 8 + in_ECX[0xe]) != '\0',param_1._0_3_); (**(code **)(*(int *)*writer + 0x1c))((int)¶m_1 + 3,1,1); checksumByte[0] = param_1._3_1_; Checksum::Update(writer + 3,checksumByte,1); entryOffset = entryOffset + 0xc; local_10 = local_10 + 1; } while (local_10 < (uint)((int)(in_ECX[0xf] - in_ECX[0xe]) / 0xc)); } return; } //@@ 009d7d50 GameState::read_rerun /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool GameState::read_rerun(GameStateIO** gameStateIO); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall GameState::read_rerun(GameState *this,void **gameStateIO) { byte bVar1; std_string seed; char isEof; int headerResult; uint uVar2; byte *seedCursor; char acStackY_178 [128]; undefined4 uVar3; int *in_stack_ffffff2c; undefined4 in_stack_ffffff30; undefined4 uVar4; undefined4 uVar5; int historyTime; uint uStack_74; int historyItemPoolType; int historyTimeRaw; int historyRoomType; int historyStageType; int historyLevelStage; int historyItemId; uint historyCount; uint checksum; uint i; byte playerCountBuf [7]; byte playerCount; int checksumBuf [5]; undefined1 local_1c; byte seedText [9]; undefined1 local_f; uint local_c; undefined1 auStack_8 [4]; int *historyEnd; undefined1 *version; local_c = __security_cookie ^ (uint)(auStack_8 + 4); (**(code **)(*(int *)this->_saveFile + 0x14))(); version = &this->field_0x1fdf0; local_1c = 0; headerResult = FUN_00837090(); if (headerResult < 1) { *(undefined4 *)version = 0; } else if (*(int *)&this->field_0x1fdf0 - 0x9bU < 0xf) { uVar2 = checksum_stream(this->_saveFile,0x10,4); *(uint *)&this->field_0x1fda8 = uVar2; (**(code **)(*(int *)this->_saveFile + 0xc))(); checksum = 0; (**(code **)(*(int *)this->_saveFile + 0x14))(); (**(code **)(*(int *)this->_saveFile + 0xc))(); checksum = checksum ^ 0x96696996; if (checksum != *(uint *)&this->field_0x1fda8) { KAGE_LogMessage(1,(byte *)"[warn] GameState File %s: Checksum invalid!\n"); return 0; } gameStateIO[2] = *(void **)version; FUN_009d8550(); FUN_009d84a0(); uVar2 = *(uint *)version; if (0x3c < uVar2) { FUN_009d8550(); uVar2 = *(uint *)&this->field_0x1fdf0; } this->field_0x4 = 1; if (uVar2 < 0x43) { FUN_009d84a0(); i = 0; if (historyCount != 0) { do { isEof = (**(code **)(*(int *)this->_saveFile + 0x10))(); if (isEof != '\0') { KAGE_LogMessage(1,(byte *) "[warn] Invalid history count %d. Save file %s might be corrupt.\n"); return 0; } (**(code **)(*(int *)*gameStateIO + 0x14))(); checksumBuf[0] = historyItemId; Checksum::Update(gameStateIO + 3,(byte *)checksumBuf,4); (**(code **)(*(int *)*gameStateIO + 0x14))(); checksumBuf[0] = historyLevelStage; Checksum::Update(gameStateIO + 3,(byte *)checksumBuf,4); in_stack_ffffff2c = &historyStageType; in_stack_ffffff30 = 4; (**(code **)(*(int *)*gameStateIO + 0x14))(); checksumBuf[0] = historyStageType; Checksum::Update(gameStateIO + 3,(byte *)checksumBuf,4); (**(code **)(*(int *)*gameStateIO + 0x14))(&historyRoomType,4); checksumBuf[0] = historyRoomType; Checksum::Update(gameStateIO + 3,(byte *)checksumBuf,4); (**(code **)(*(int *)*gameStateIO + 0x14))(&historyItemPoolType,4,1); checksumBuf[0] = historyItemPoolType; Checksum::Update(gameStateIO + 3,(byte *)checksumBuf,4); (**(code **)(*(int *)*gameStateIO + 0x14))(&historyTimeRaw,4,1); checksumBuf[0] = historyTimeRaw; Checksum::Update(gameStateIO + 3,(byte *)checksumBuf,4); uStack_74 = uStack_74 & 0xffffff00; historyTime = historyTimeRaw; if (historyTimeRaw < 0) { historyTime = g_game->_frameCount; } historyEnd = *(int **)&this->field_0x1a13c; if (historyEnd == *(int **)&this->field_0x1a140) { std::vector<28byte>::_Emplace_reallocate(); } else { *historyEnd = historyTime; historyEnd[1] = uStack_74; historyEnd[2] = historyItemId; historyEnd[3] = historyLevelStage; historyEnd[4] = historyStageType; historyEnd[5] = historyRoomType; historyEnd[6] = historyItemPoolType; *(int *)&this->field_0x1a13c = *(int *)&this->field_0x1a13c + 0x1c; } i = i + 1; } while (i < historyCount); } } if (*(uint *)&this->field_0x1fdf0 < 0x44) { GameStatePlayer::read(); } else { (**(code **)(*(int *)*gameStateIO + 0x14))(); playerCountBuf[0] = playerCount; Checksum::Update(gameStateIO + 3,playerCountBuf,1); *(int *)&this->field_0x19d78 = (int)(char)playerCount; i = 0; if (0 < (char)playerCount) { do { GameStatePlayer::read(); i = i + 1; } while ((int)i < *(int *)&this->field_0x19d78); } } (**(code **)(*(int *)*gameStateIO + 0x14))(); uVar4 = 0x9d812a; Checksum::Update(gameStateIO + 3,seedText,9); local_f = 0; seedCursor = seedText; uVar3 = 0; uVar5 = 0; uVar2 = 0xf; do { bVar1 = *seedCursor; seedCursor = seedCursor + 1; } while (bVar1 != 0); std::string::assign(acStackY_178 + 0xa0,seedText,(int)seedCursor - (int)(seedText + 1)); seed._buf._4_4_ = in_stack_ffffff2c; seed._buf[0] = (char)uVar3; seed._buf[1] = (char)((uint)uVar3 >> 8); seed._buf[2] = (char)((uint)uVar3 >> 0x10); seed._buf[3] = (char)((uint)uVar3 >> 0x18); seed._buf[8] = (char)in_stack_ffffff30; seed._buf[9] = (char)((uint)in_stack_ffffff30 >> 8); seed._buf[10] = (char)((uint)in_stack_ffffff30 >> 0x10); seed._buf[0xb] = (char)((uint)in_stack_ffffff30 >> 0x18); seed._buf[0xc] = (char)uVar4; seed._buf[0xd] = (char)((uint)uVar4 >> 8); seed._buf[0xe] = (char)((uint)uVar4 >> 0x10); seed._buf[0xf] = (char)((uint)uVar4 >> 0x18); seed._size = uVar5; seed._capacity = uVar2; Seeds::SetStartSeed((Seeds *)&this->field_0x1e724,seed); return 1; } KAGE_LogMessage(1,(byte *)"[warn] GameState Rerun header is incorrect (%u != %u).\n"); (**(code **)(*(int *)this->_saveFile + 0x34))(); DeleteRerun(this); return this->_isRerunAvailable; } //@@ 009d8190 GameState::write_rerun /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool GameState::write_rerun(GameStateIO** gameStateIO); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall GameState::write_rerun(GameState *this,void **gameStateIO) { void **this_00; byte bVar1; void *pvVar2; uint uVar3; std_string *psVar4; void **ppvVar5; int iVar6; uint local_54; undefined4 local_50; void **local_4c; byte local_48 [4]; byte local_44 [4]; std_string *local_40 [4]; uint local_30; uint local_2c; byte local_28 [16]; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f3cd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; local_4c = gameStateIO; local_18 = uVar3; sprintf(local_28,(byte *)"ISAACNG_GSR%04u"); (**(code **)(*(int *)this->_saveFile + 0x1c))(local_28,1,0x10,uVar3); (**(code **)(*(int *)*gameStateIO + 0x1c))(&this->field_0x5,1,1); local_44[0] = this->field_0x5; ppvVar5 = gameStateIO + 3; Checksum::Update(ppvVar5,local_44,1); (**(code **)(*(int *)*local_4c + 0x1c))(&this->field_0x8,4,1); local_50 = *(undefined4 *)&this->field_0x8; Checksum::Update(ppvVar5,(byte *)&local_50,4); (**(code **)(*(int *)*local_4c + 0x1c))(&this->field_0x19d74,1,1); local_44[0] = this->field_0x19d74; Checksum::Update(ppvVar5,local_44,1); local_44[0] = this->field_0x19d78; (**(code **)(*(int *)*local_4c + 0x1c))(local_44,1,1); local_48[0] = local_44[0]; Checksum::Update(ppvVar5,local_48,1); iVar6 = 0; if (0 < *(int *)&this->field_0x19d78) { do { write_player(local_4c); iVar6 = iVar6 + 1; } while (iVar6 < *(int *)&this->field_0x19d78); } uVar3 = *(uint *)&this->field_0x1e728; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Error: Game Start Seed was not set.\n"); uVar3 = *(uint *)&this->field_0x1e728; } Seeds::Seed2String((std_string *)local_40,uVar3); ppvVar5 = local_4c; local_8 = 0; psVar4 = (std_string *)local_40; if (0xf < local_2c) { psVar4 = local_40[0]; } (**(code **)(*(int *)*local_4c + 0x1c))(psVar4,1,9); this_00 = ppvVar5 + 3; Checksum::Update(this_00,(byte *)psVar4,9); local_8 = 0xffffffff; if (0xf < local_2c) { uVar3 = local_2c + 1; psVar4 = local_40[0]; if (0xfff < uVar3) { psVar4 = (std_string *)local_40[0][-1]._capacity; uVar3 = local_2c + 0x24; if (0x1f < (uint)((int)local_40[0] + (-4 - (int)psVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar4,uVar3); } local_30 = 0; local_2c = 0xf; local_40[0] = (std_string *)((uint)local_40[0] & 0xffffff00); if ((ppvVar5[6] == (void *)0x0) && (bVar1 = *(byte *)(ppvVar5 + 4), bVar1 != 0)) { if (bVar1 < 4) { memset((void *)((uint)bVar1 + (int)this_00),0,(uint)(byte)(4 - bVar1)); } *(undefined1 *)(ppvVar5 + 4) = 0; ppvVar5[5] = (void *)(((uint)ppvVar5[5] >> 1) + (int)ppvVar5[5] * -0x80000000 + (int)*this_00); } pvVar2 = ppvVar5[5]; *(void **)&this->field_0x1fda4 = pvVar2; local_54 = (uint)pvVar2 ^ 0x96696996; (**(code **)(*(int *)this->_saveFile + 0x1c))(&local_54,4,1); ExceptionList = local_10; return 1; } //@@ 009d83f0 std::vector<52byte>::resize /* DB: element 0x34: shrink sets end, grow within capacity via FUN_009d8820 (default-construct n), else FUN_009d8a20 reallocates; Entity_Player::restore_save_state_part2, GameStatePlayer::read_part3 */ int std::vector<52byte>::resize(uint param_1) { uint uVar1; int iVar2; int *in_ECX; int iVar3; iVar3 = in_ECX[1] - *in_ECX; iVar2 = iVar3 * 0x4ec4ec4f; uVar1 = iVar3 / 0x34; if (param_1 < uVar1) { iVar2 = param_1 * 0x34 + *in_ECX; in_ECX[1] = iVar2; return iVar2; } if (uVar1 < param_1) { if ((uint)((in_ECX[2] - *in_ECX) / 0x34) < param_1) { iVar2 = FUN_009d8a20(param_1,¶m_1); return iVar2; } iVar2 = FUN_009d8820(in_ECX[1],param_1 - uVar1,param_1); in_ECX[1] = iVar2; } return iVar2; } //@@ 009d8470 FUN_009d8470 void FUN_009d8470(ushort *param_1) { ushort *puVar1; undefined4 *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*in_ECX + 0x14))(param_1,2,1); param_1 = (ushort *)(uint)*puVar1; Checksum::Update(in_ECX + 3,(byte *)¶m_1,2); return; } //@@ 009d84a0 FUN_009d84a0 void FUN_009d84a0(undefined4 *param_1) { undefined4 *puVar1; undefined4 *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*in_ECX + 0x14))(param_1,4,1); param_1 = (undefined4 *)*puVar1; Checksum::Update(in_ECX + 3,(byte *)¶m_1,4); return; } //@@ 009d84d0 GameState::write_int_vector /* DB: writes count then each 4-byte element of vector param_1 through stream vslot 0x1c (this[0]), feeding each value to Checksum::Update (00683410); GameState::write, GameState::write_player */ void GameState::write_int_vector(int *param_1) { uint *puVar1; undefined4 *in_ECX; uint uVar2; uint local_c; uint local_8; local_8 = param_1[1] - *param_1 >> 2; (**(code **)(*(int *)*in_ECX + 0x1c))(&local_8,4,1); local_c = local_8; Checksum::Update(in_ECX + 3,(byte *)&local_c,4); uVar2 = 0; if (local_8 != 0) { do { puVar1 = (uint *)(*param_1 + uVar2 * 4); (**(code **)(*(int *)*in_ECX + 0x1c))(puVar1,4,1); local_c = *puVar1; Checksum::Update(in_ECX + 3,(byte *)&local_c,4); uVar2 = uVar2 + 1; } while (uVar2 < local_8); } return; } //@@ 009d8550 FUN_009d8550 void FUN_009d8550(undefined1 *param_1) { undefined1 *puVar1; undefined4 *in_ECX; puVar1 = param_1; (**(code **)(*(int *)*in_ECX + 0x14))(param_1,1,1); param_1 = (undefined1 *)CONCAT31(param_1._1_3_,*puVar1); Checksum::Update(in_ECX + 3,(byte *)¶m_1,1); return; } //@@ 009d8580 GameStateReader::read_int_vector /* DB: ? reads a uint count via the stream vfunc +0x14 (byte-swapped by FUN_00683410), then that many ints into the std::vector param (replacing its storage); GameStatePlayer::read, Entity_Player::restore_save_state_part2 */ void GameStateReader::read_int_vector(int *param_1) { undefined4 *puVar1; void *pvVar2; int iVar3; int *piVar4; void *ptr; undefined4 *in_ECX; uint uVar5; int local_20 [3]; undefined4 *local_14; undefined4 *local_10; uint local_c; uint local_8; local_10 = in_ECX; (**(code **)(*(int *)*in_ECX + 0x14))(&local_8,4,1); local_c = local_8; local_14 = in_ECX + 3; Checksum::Update(local_14,(byte *)&local_c,4); piVar4 = param_1; if (local_20 != param_1) { pvVar2 = (void *)*param_1; iVar3 = param_1[2]; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; if (pvVar2 != (void *)0x0) { uVar5 = iVar3 - (int)pvVar2 & 0xfffffffc; ptr = pvVar2; if (0xfff < uVar5) { ptr = *(void **)((int)pvVar2 + -4); uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)pvVar2 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); } } std::vector<4byte>::resize(local_8); uVar5 = 0; if (local_8 != 0) { do { puVar1 = (undefined4 *)(*piVar4 + uVar5 * 4); (**(code **)(*(int *)*local_10 + 0x14))(puVar1,4,1); param_1 = (int *)*puVar1; Checksum::Update(local_14,(byte *)¶m_1,4); uVar5 = uVar5 + 1; } while (uVar5 < local_8); } return; } //@@ 009d8660 std::vector<12byte>::_Emplace_reallocate /* DB: second instance of the 12-byte insert-reallocate (max 0x15555555, 1.5x, copies the element then both halves around the insert point); GameState::read_record and ScoreSheet::store_state/restore_state (which also call the named 0069ee50 std::vector<12byte>::_Emplace_reallocate */ undefined8 * std::vector<12byte>::_Emplace_reallocate(undefined8 *param_1,undefined8 *param_2) { undefined8 *puVar1; int iVar2; void *pvVar3; int iVar4; uint uVar5; undefined8 *puVar6; undefined8 *puVar7; int *in_ECX; uint uVar8; uint uVar9; undefined8 *puVar10; void *ptr; undefined8 *puVar11; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0xc; if (iVar4 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar5 = iVar4 + 1; uVar9 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar9 >> 1) < uVar9) { uVar8 = 0x15555555; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar8 = uVar5; if (uVar5 <= uVar9) { uVar8 = uVar9; } if (0x15555555 < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = _Allocate(uVar8 * 0xc); puVar1 = (undefined8 *)((int)puVar6 + (((int)param_1 - iVar2) / 0xc) * 0xc); *puVar1 = *param_2; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(param_2 + 1); puVar11 = (undefined8 *)in_ECX[1]; puVar7 = (undefined8 *)*in_ECX; puVar10 = puVar6; if (param_1 == puVar11) { for (; puVar7 != puVar11; puVar7 = (undefined8 *)((int)puVar7 + 0xc)) { *puVar10 = *puVar7; *(undefined4 *)(puVar10 + 1) = *(undefined4 *)(puVar7 + 1); puVar10 = (undefined8 *)((int)puVar10 + 0xc); } } else { if (puVar7 != param_1) { do { *puVar10 = *puVar7; puVar11 = puVar7 + 1; puVar7 = (undefined8 *)((int)puVar7 + 0xc); *(undefined4 *)(puVar10 + 1) = *(undefined4 *)puVar11; puVar10 = (undefined8 *)((int)puVar10 + 0xc); } while (puVar7 != param_1); puVar11 = (undefined8 *)in_ECX[1]; } if (param_1 != puVar11) { puVar7 = puVar1; do { *(undefined8 *)((int)puVar7 + 0xc) = *param_1; puVar10 = param_1 + 1; param_1 = (undefined8 *)((int)param_1 + 0xc); *(undefined4 *)((int)puVar7 + 0x14) = *(undefined4 *)puVar10; puVar7 = (undefined8 *)((int)puVar7 + 0xc); } while (param_1 != puVar11); } } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar9 = ((in_ECX[2] - (int)pvVar3) / 0xc) * 0xc; ptr = pvVar3; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar3 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)puVar6; in_ECX[1] = (int)puVar6 + uVar5 * 0xc; in_ECX[2] = uVar8 * 0xc + (int)puVar6; return puVar1; } //@@ 009d8820 FUN_009d8820 void FUN_009d8820(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[6] = 0; param_1[7] = 0; param_1[10] = 0; param_1[0xb] = 0; param_1[0xc] = 0; param_1[9] = 0; param_1[8] = 0; param_1 = param_1 + 0xd; } return; } //@@ 009d88a0 FUN_009d88a0 void FUN_009d88a0(uint param_1) { uint *_Dst; int iVar1; int *in_ECX; int iVar2; uint uVar3; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar2 = in_ECX[1] - *in_ECX >> 3; uVar3 = in_ECX[2] - *in_ECX >> 3; if (0x1fffffff - (uVar3 >> 1) < uVar3) { uVar3 = 0x1fffffff; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < param_1) { uVar3 = param_1; } else if (0x1fffffff < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar3 * 8); iVar1 = param_1 - iVar2; if (iVar1 != 0) { memset(_Dst + iVar2 * 2,0,iVar1 * 8); } memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FID_conflict__Change_array(in_ECX,_Dst,param_1,uVar3); return; } //@@ 009d8960 std::vector<16byte>::_Resize_reallocate /* DB: 16-byte elements, zero-filled tail, memmove of the old range, FUN_007de290 change-array; GameStatePlayer::read_part3 (same shape as 00a1cea0) */ void std::vector<16byte>::_Resize_reallocate(uint param_1) { void *_Dst; int *in_ECX; int iVar1; uint uVar2; int iVar3; if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar1 = in_ECX[1] - *in_ECX >> 4; uVar2 = in_ECX[2] - *in_ECX >> 4; if (0xfffffff - (uVar2 >> 1) < uVar2) { uVar2 = 0xfffffff; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < param_1) { uVar2 = param_1; } else if (0xfffffff < uVar2) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar2 << 4); iVar3 = param_1 - iVar1; if (iVar3 != 0) { memset((void *)(iVar1 * 0x10 + (int)_Dst),0,iVar3 * 0x10); } memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FUN_007de290(_Dst,param_1,uVar2); return; } //@@ 009d8a20 FUN_009d8a20 void FUN_009d8a20(uint param_1,undefined1 *param_2) { int iVar1; void *pvVar2; int *in_ECX; uint uVar3; if (0x4ec4ec4 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar1 = (in_ECX[1] - *in_ECX) / 0x34; uVar3 = (in_ECX[2] - *in_ECX) / 0x34; if (0x4ec4ec4 - (uVar3 >> 1) < uVar3) { uVar3 = 0x4ec4ec4; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < param_1) { uVar3 = param_1; } else if (0x4ec4ec4 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar2 = std::_Allocate(uVar3 * 0x34); FUN_009d8820((void *)(iVar1 * 0x34 + (int)pvVar2),param_1 - iVar1,*param_2); FUN_007de3a0(*in_ECX,in_ECX[1],pvVar2); FUN_007de330(pvVar2,param_1,uVar3); return; } //@@ 009d8af0 std::vector<8byte_0_m1>::_Resize_reallocate /* DB: 8-byte elements (max 0x1fffffff, 1.5x growth): new tail filled with {0, 0xffffffff}, old elements copied, _Change_array; GameStatePlayer::read when growing a pair vector */ void std::vector<8byte_0_m1>::_Resize_reallocate(uint param_1) { uint *puVar1; uint uVar2; uint *puVar3; uint *puVar4; int *in_ECX; int iVar5; uint uVar6; int iVar7; uint *puVar8; if (0x1fffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar5 = in_ECX[1] - *in_ECX >> 3; uVar6 = in_ECX[2] - *in_ECX >> 3; if (0x1fffffff - (uVar6 >> 1) < uVar6) { uVar6 = 0x1fffffff; } else { uVar6 = (uVar6 >> 1) + uVar6; if (uVar6 < param_1) { uVar6 = param_1; } else if (0x1fffffff < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = _Allocate(uVar6 * 8); puVar1 = puVar4 + iVar5 * 2; for (iVar7 = param_1 - iVar5; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar1 = 0; puVar1[1] = 0xffffffff; puVar1 = puVar1 + 2; } puVar1 = (uint *)in_ECX[1]; puVar3 = puVar4; for (puVar8 = (uint *)*in_ECX; puVar8 != puVar1; puVar8 = puVar8 + 2) { uVar2 = puVar8[1]; *puVar3 = *puVar8; puVar3[1] = uVar2; puVar3 = puVar3 + 2; } FID_conflict__Change_array(in_ECX,puVar4,param_1,uVar6); return; } //@@ 009d8be0 save_slot_get_status /* DB: ? returns 0/1/2 for the current save slot from Manager flags (+0x2c9 -> 2; +0x19f, +0xa80, +0xf18 > 0, +0x2c7) with the netplay checks (Manager+8 == 2, Game+0x26630/+0x26589); Menu_Save::Reset calls it after Manager::SetSaveSlot for each of the 3 slots and stores it per slot prototype: db/protos.zhl */ int __cdecl save_slot_get_status(void) { int iVar1; Game *in_EAX; uint3 uVar2; if ((g_manager->_persistentGameData)._achievements[0x27d] != 0) { LAB_009d8c95: return CONCAT31((int3)((uint)in_EAX >> 8),2); } iVar1 = g_manager->_state; if (((iVar1 == 2) && (g_game != (Game *)0x0)) && ((in_EAX = g_game, (g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))) goto LAB_009d8c95; uVar2 = (uint3)((uint)g_game >> 8); if ((g_manager->_persistentGameData)._achievements[0x153] == 0) { if (((iVar1 != 2) || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) goto LAB_009d8c3e; LAB_009d8c46: if ((g_game != (Game *)0x0) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0))) ) goto LAB_009d8c3e; } else if (iVar1 == 2) goto LAB_009d8c46; if ((((g_manager->_persistentGameData)._eventCounters[0x1ec] == 0) && (((g_manager->_persistentGameData)._cutsceneCounters[0x19] < 1 && ((g_manager->_persistentGameData)._achievements[0x27b] == 0)))) && ((iVar1 != 2 || ((g_game == (Game *)0x0 || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0))))) ))) { return CONCAT31(uVar2,1); } LAB_009d8c3e: return (uint)uVar2 << 8; } //@@ 009d8ca0 has_all_completion_marks /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? iterates 0x14 character rows of the mark table at 0xc35ed0 (stride 0x90) over 12 mark slots (order 0,1,2,4,5,3,6,9,12,7,13,14) and returns false on the first achievement in g_Manager+0x2d0 without bits 0xc; Menu_Save::Update/Reset, MenuManager::SetState prototype: db/protos.zhl */ byte __cdecl has_all_completion_marks(void) { uint uVar1; int iVar2; undefined *puVar3; int iVar4; int local_38 [13]; puVar3 = &DAT_00c35ed0; local_38[0] = 0; local_38[1] = 1; local_38[2] = 2; local_38[3] = 4; local_38[4] = 5; local_38[5] = 3; local_38[6] = 6; local_38[7] = 9; iVar4 = 0; local_38[8] = 0xc; local_38[9] = 7; local_38[10] = 0xd; local_38[0xb] = 0xe; do { if (iVar4 != 0x14) { uVar1 = 0; do { if (((int)puVar3 < 0xc375e0) && (puVar3 != (undefined *)0x0)) { iVar2 = *(int *)(puVar3 + local_38[uVar1] * 8); } else { iVar2 = 0; } if (((g_manager->_persistentGameData)._eventCounters[iVar2] & 0xc) == 0) { return 0; } uVar1 = uVar1 + 1; } while (uVar1 < 0xc); } puVar3 = puVar3 + 0x90; iVar4 = iVar4 + 1; if (0xc375df < (int)puVar3) { return 1; } } while( true ); } //@@ 009d8d50 Menu_Save::~Menu_Save /* DB: destroys the GenericPrompt ANM2 at +0x6a4 (the one Menu_Save::Update drives), the ConstLobby at +0x698, ANM2s +0x584/+0x470, the 3 slot ANM2s at +0x12c and the main ANM2 at +0x18; MenuManager dtor 00986f30 MenuManager::~MenuManager EH unwind */ void Menu_Save::~Menu_Save(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0bd60; local_10 = ExceptionList; ExceptionList = &local_10; unload_graphics(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x6a4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x6f4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x6d4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x6bc)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x6a4)); *(undefined ***)(in_ECX + 0x698) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (*(int **)(in_ECX + 0x6a0) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x6a0) + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 0x69c); } } local_8 = 2; ANM2::Reset((ANM2 *)(in_ECX + 0x584)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5d4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x5b4)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x59c)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x584)); local_8 = 3; ANM2::Reset((ANM2 *)(in_ECX + 0x470)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4c0)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x4a0)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x488)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x470)); local_8 = 0xffffffff; _eh_vector_destructor_iterator_((void *)(in_ECX + 300),0x114,3,ANM2::~ANM2); local_8 = 4; ANM2::Reset((ANM2 *)(in_ECX + 0x18)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x68)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x48)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x30)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x18)); ExceptionList = local_10; return; } //@@ 009d92c0 Menu_Save::unload_graphics /* DB: ? ANM2::Reset of four sprites (+0x18,+0x470,+0x584,+0x6a4), AnmCache::RemoveRef, clears +0x7d4; MenuManager::unload_graphics calls it between the title and game menu sprite resets (Menu_Save sits between them in MenuManager) */ void Menu_Save::unload_graphics(void) { uint *ptr; void *pvVar1; undefined4 *puVar2; int in_ECX; int iVar3; undefined4 *puVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::Reset((ANM2 *)(in_ECX + 0x18)); ANM2::Reset((ANM2 *)(in_ECX + 0x470)); ANM2::Reset((ANM2 *)(in_ECX + 0x584)); ANM2::Reset((ANM2 *)(in_ECX + 0x6a4)); *(undefined1 *)(in_ECX + 0x7d4) = 0; iVar3 = 3; puVar4 = (undefined4 *)(in_ECX + 0x154); do { if (puVar4[-6] != 0) { AnmCache::RemoveRef((std_string *)(puVar4 + -10)); } puVar2 = puVar4 + -10; if (0xf < (uint)puVar4[-5]) { puVar2 = (undefined4 *)*puVar2; } puVar4[-6] = 0; *(undefined1 *)puVar2 = 0; AnimationState::SetAnimationData((AnimationState *)(puVar4 + 2),(void *)0x0); AnimationState::SetAnimationData((AnimationState *)(puVar4 + 10),(void *)0x0); puVar2 = puVar4 + -4; if (0xf < (uint)puVar4[1]) { puVar2 = (undefined4 *)*puVar2; } *puVar4 = 0; *(undefined1 *)puVar2 = 0; pvVar1 = (void *)puVar4[0x15]; puVar4[0x13] = 0; puVar4[0x14] = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); local_8 = 0xffffffff; } puVar4[0x15] = 0; puVar4[0x16] = 0; puVar4[0x17] = 0; puVar4[0x18] = 0; puVar4[0x19] = 0; puVar4[0x1a] = 0; puVar4[0x1b] = g_vectorZero.x; puVar4[0x1c] = g_vectorZero.y; puVar4[0x1d] = g_vectorOne.x; puVar4[0x1e] = g_vectorOne.y; puVar4[0x1f] = 0; puVar4[0x20] = 0x3f800000; puVar4[0x21] = 0x3f800000; puVar4[0x22] = 0x3f800000; puVar4[0x23] = 0x3f800000; puVar4[0x24] = 0; puVar4[0x25] = 0; puVar4[0x26] = 0; puVar4[0x27] = 0; puVar4[0x28] = 0; puVar4[0x29] = 0; puVar4[0x2a] = 0; puVar4[0x2f] = 0; puVar4[0x30] = 0; puVar4[0x31] = 0; puVar4[0x32] = 0; puVar4[0x33] = 0; puVar4[0x34] = 0; puVar4[0x35] = 0; puVar4[0x2b] = 0x3f800000; puVar4[0x2c] = 0x3f800000; puVar4[0x2d] = 0x3f800000; puVar4[0x2e] = 0; *(undefined2 *)(puVar4 + 0x36) = 0; puVar4[0x37] = 0x3f800000; *(undefined2 *)(puVar4 + 0x38) = 0; *(undefined1 *)(puVar4 + 0x12) = 0; puVar4[0x39] = 0xffffffff; puVar4[0x3a] = 0; puVar4 = puVar4 + 0x45; iVar3 = iVar3 + -1; } while (iVar3 != 0); ExceptionList = local_10; return; } //@@ 009d9560 Menu_Save::LoadGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ANM2::Load "gfx/ui/main menu/SaveSelectMenu.anm2" into this+0x18 and +0x470, "SaveSelectMenu_Drawing.anm2" for the slot drawings; MenuManager::LoadGraphics between Menu_Title::load_graphics and Menu_Character::LoadGraphics */ void Menu_Save::LoadGraphics(void) { byte isAnimSet; Menu_Save *in_ECX; char *allocBlock; uint uVar1; uint size; Menu_Save *slotDrawing; std_string drawingPath; std_string menuPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0f425; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; menuPath._size = 0; menuPath._capacity = 0xf; menuPath._buf[0] = '\0'; menuPath._buf[1] = '\0'; menuPath._buf[2] = '\0'; menuPath._buf[3] = '\0'; menuPath._buf._0_4_ = std::_Allocate(0x30); menuPath._size = 0x24; menuPath._capacity = 0x2f; builtin_strncpy((char *)menuPath._buf._0_4_,"gfx/ui/main menu/SaveSelectMenu.anm2",0x25); local_14 = 0; ANM2::Load((ANM2 *)(in_ECX + 6),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar1 = menuPath._capacity + 1; allocBlock = (char *)menuPath._buf._0_4_; if (0xfff < uVar1) { allocBlock = *(char **)(menuPath._buf._0_4_ + -4); uVar1 = menuPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuPath._buf._0_4_ + (-4 - (int)allocBlock))) { LAB_009d963b: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar1); } menuPath._size = 0; menuPath._capacity = 0xf; menuPath._buf[0] = '\0'; menuPath._buf[1] = '\0'; menuPath._buf[2] = '\0'; menuPath._buf[3] = '\0'; menuPath._buf._0_4_ = std::_Allocate(0x30); menuPath._size = 0x24; menuPath._capacity = 0x2f; builtin_strncpy((char *)menuPath._buf._0_4_,"gfx/ui/main menu/SaveSelectMenu.anm2",0x25); local_14 = 1; ANM2::Load((ANM2 *)(in_ECX + 0x11c),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar1 = menuPath._capacity + 1; allocBlock = (char *)menuPath._buf._0_4_; if (0xfff < uVar1) { allocBlock = *(char **)(menuPath._buf._0_4_ + -4); uVar1 = menuPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuPath._buf._0_4_ + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar1); } menuPath._size = 0; menuPath._capacity = 0xf; menuPath._buf[0] = '\0'; menuPath._buf[1] = '\0'; menuPath._buf[2] = '\0'; menuPath._buf[3] = '\0'; menuPath._buf._0_4_ = std::_Allocate(0x30); menuPath._size = 0x24; menuPath._capacity = 0x2f; builtin_strncpy((char *)menuPath._buf._0_4_,"gfx/ui/main menu/SaveSelectMenu.anm2",0x25); local_14 = 2; ANM2::Load((ANM2 *)(in_ECX + 0x161),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar1 = menuPath._capacity + 1; allocBlock = (char *)menuPath._buf._0_4_; if (0xfff < uVar1) { allocBlock = *(char **)(menuPath._buf._0_4_ + -4); uVar1 = menuPath._capacity + 0x24; if ((char *)0x1f < (char *)(menuPath._buf._0_4_ + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar1); } GenericPrompt::Initialize((GenericPrompt *)(in_ECX + 0x1a9),0); uVar1 = 0; slotDrawing = in_ECX + 0x58; do { drawingPath._size = 0; drawingPath._capacity = 0xf; drawingPath._buf[0] = '\0'; drawingPath._buf[1] = '\0'; drawingPath._buf[2] = '\0'; drawingPath._buf[3] = '\0'; drawingPath._buf._0_4_ = std::_Allocate(0x30); drawingPath._size = 0x2c; drawingPath._capacity = 0x2f; builtin_strncpy((char *)drawingPath._buf._0_4_,"gfx/ui/main menu/SaveSelectMenu_Drawing.anm2", 0x2d); local_14 = 3; ANM2::Load((ANM2 *)(slotDrawing + -0xd),&drawingPath,0); local_14 = 0xffffffff; if (0xf < drawingPath._capacity) { size = drawingPath._capacity + 1; allocBlock = (char *)drawingPath._buf._0_4_; if (0xfff < size) { allocBlock = *(char **)(drawingPath._buf._0_4_ + -4); size = drawingPath._capacity + 0x24; if ((char *)0x1f < (char *)(drawingPath._buf._0_4_ + (-4 - (int)allocBlock))) goto LAB_009d963b; } operator_delete(allocBlock,size); } drawingPath._size = 0; drawingPath._capacity = 0xf; drawingPath._buf._0_4_ = drawingPath._buf._0_4_ & 0xffffff00; isAnimSet = ANM2::SetAnimation((ANM2 *)(slotDrawing + -0xd),s_Idle,1); if ((isAnimSet != 0) && (*slotDrawing != (Menu_Save)0x0)) { AnimationState::SetFrameFloat((AnimationState *)(slotDrawing + -1),0.0); if (*slotDrawing != (Menu_Save)0x0) { *(undefined1 *)(slotDrawing + 4) = 0; } } uVar1 = uVar1 + 1; slotDrawing = slotDrawing + 0x45; if (2 < uVar1) { Reset(in_ECX); ExceptionList = local_1c; return; } } while( true ); } //@@ 009d98f0 Menu_Save::select_slot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: thiscall Menu_Save, called 3x by Menu_Save::Update (0x9d9d04/12/20, one per slot); Manager::SetSaveSlot(param), if save not loaded shows GenericPrompt (+0x6a4) #SAVE_DATA_CORRUPTED_HAS_BACKUP/NO_BACKUP lines, else lobby join / MenuManager::push_menu */ void Menu_Save::select_slot(uint param_1) { char cVar1; byte bVar2; byte *pbVar3; byte *line1Text; undefined4 *in_ECX; int extraout_ECX; int extraout_ECX_00; int unused; undefined **propertiesVtable; void *properties; undefined4 uVar4; void *propertiesRefCount; undefined4 uVar5; undefined1 auStack_b6 [2]; undefined **resetLobby; undefined1 resetLobbyPtr [8]; undefined **newLobby; undefined1 newLobbyPtr [4]; int *newLobbyRefCount; undefined8 local_90; undefined4 *menu; GenericPrompt *local_84; byte backupLineText [104]; uint securityCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 *pendingLobby; local_8 = 0xffffffff; puStack_c = &LAB_00b0f479; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(backupLineText + 0x7c); ExceptionList = &local_10; menu = in_ECX; Manager::SetSaveSlot(g_manager,param_1); if ((g_manager->_persistentGameData)._isFileLoaded == 0) { local_84 = (GenericPrompt *)save_backup_find_latest(); in_ECX[0x1f6] = local_84; if ((int)local_84 < 1) { pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_NO_BACKUP_LINE_5"); local_90 = CONCAT44(pbVar3,(undefined4)local_90); string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_NO_BACKUP_LINE_4"); string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_NO_BACKUP_LINE_3"); pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_NO_BACKUP_LINE_2"); line1Text = string_table_translate (&g_manager->_stringTable, (byte *)"#SAVE_DATA_CORRUPTED_NO_BACKUP_LINE_1"); } else { pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_HAS_BACKUP_LINE_3") ; sprintf_s(backupLineText,100,pbVar3); string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_HAS_BACKUP_LINE_5"); string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_HAS_BACKUP_LINE_4"); pbVar3 = string_table_translate (&g_manager->_stringTable,(byte *)"#SAVE_DATA_CORRUPTED_HAS_BACKUP_LINE_2") ; line1Text = string_table_translate (&g_manager->_stringTable, (byte *)"#SAVE_DATA_CORRUPTED_HAS_BACKUP_LINE_1"); } local_84 = (GenericPrompt *)(menu + 0x1a9); FUN_00838230(line1Text,pbVar3); GenericPrompt::Show(local_84,0); *menu = 3; } else { pendingLobby = in_ECX + 0x1a7; unused = 0; if (((int *)in_ECX[0x1a7] != (int *)0x0) && (cVar1 = (**(code **)(*(int *)in_ECX[0x1a7] + 0xc))(), unused = extraout_ECX, cVar1 != '\0')) { local_90 = CONCAT44(auStack_b6 + -0xe,(undefined4)local_90); propertiesVtable = KAGE::Network::Multiplayer::ConstLobby::vftable; properties = (void *)0x0; propertiesRefCount = (void *)0x0; local_8 = 0; std::shared_ptr::assign(auStack_b6 + -10,pendingLobby); local_8 = 0xffffffff; bVar2 = online_check_game_version(propertiesVtable,properties,propertiesRefCount); unused = extraout_ECX_00; if (bVar2 != 0) { uVar4 = 0x9d9b57; bVar2 = show_beta_disclaimer_popup(1,FUN_009dc5a0,in_ECX); if (bVar2 == 0) { uVar5 = 0x9d9b73; Menu_Character::Reset(&g_menuManager->_menuCharacter); online_lobby_join(&g_manager->_netplayManager,in_ECX + 0x1a6,CONCAT44(uVar5,uVar4)); resetLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(); local_8 = 3; std::shared_ptr::assign(pendingLobby,resetLobbyPtr); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&resetLobby); ExceptionList = local_10; return; } ExceptionList = local_10; return; } } MenuManager::push_menu(3,unused); local_90 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(); local_8 = 1; std::shared_ptr::assign(pendingLobby,newLobbyPtr); newLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 2; if (((newLobbyRefCount != (int *)0x0) && (cVar1 = (**(code **)(*newLobbyRefCount + 0xc))(), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 009d9c60 Menu_Save::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: MenuManager update dispatch 009897d0 MenuManager::Update 2 (save select); File1Select/DeleteConfirmation anims, GenericPrompt::Update, PersistentGameData Load/Save/Clear, GameState::Delete, %s/save_backups/ prototype: db/protos.zhl */ void __thiscall Menu_Save::Update(Menu_Save *this) { char isInputTriggered; byte bVar1; Menu_Save MVar2; int iVar3; Menu_Save MVar4; byte *pbVar5; int *steamContext; byte unk; char *animName; Menu_Save *persistentGameData; undefined4 extraout_ECX; undefined4 uVar6; undefined4 extraout_ECX_00; Menu_Save extraout_ECX_01; Menu_Save extraout_ECX_02; Menu_Save extraout_ECX_03; Menu_Save extraout_ECX_04; Menu_Save extraout_ECX_05; uint uVar7; PersistentGameData *persistentGameData; uint *slotIds; ANM2 *slotSprite; Menu_Save *pMVar8; bool isLess; undefined4 local_640; ANM2 *local_63c; Manager *local_638; int local_634; Menu_Save local_630; Menu_Save savedDataPath [4]; uint savedDataPathSize; uint savedDataPathCapacity; byte backupFileName [1536]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *cloudManager; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00b0f4c0; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(backupFileName + 0x610); ExceptionList = &local_10; local_640 = 0; local_634 = 0xe; local_630 = (Menu_Save)this; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&local_634,0,&local_640,local_14); manager = g_manager; if (isInputTriggered != '\0') { MVar2 = *this; if ((MVar2 == (Menu_Save)0x1) || (MVar2 == (Menu_Save)0x2)) { if (MVar2 == (Menu_Save)0x1) { *this = (Menu_Save)0x2; ANM2::Play((ANM2 *)(this + 0x161),(byte *)"DeleteConfirmationAppear",0); this[2] = (Menu_Save)0x1; } else { MVar2 = this[0x16e]; if ((MVar2 != (Menu_Save)0x0) && (*(char *)(this + 0x172) != '\0')) { if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar2 = *(Menu_Save *)MVar2; } animName = "DeleteConfirmationIdle"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_009d9dc0: uVar7 = -(uint)isLess | 1; goto LAB_009d9dc5; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_009d9dc0; MVar2 = (Menu_Save)((int)MVar2 + 2); animName = animName + 2; } while (bVar1 != 0); uVar7 = 0; LAB_009d9dc5: if (uVar7 == 0) { if (this[2] == (Menu_Save)0x0) { local_63c = (ANM2 *)g_manager->_currentSaveSlot; Manager::SetSaveSlot(g_manager,(int)this[1] + 1); GameState::Delete(&manager->_gamestate); PersistentGameData::Clear(&manager->_persistentGameData,0); local_638 = g_manager; steamContext = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*steamContext == 0) || ((local_638->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(&manager->_persistentGameData); } else { PersistentGameData::SaveToSteamCloud(&manager->_persistentGameData); } Manager::SetSaveSlot(manager,(uint)local_63c); slotSprite = (ANM2 *)(this + 0x4b); pbVar5 = &this[0x11a].field_0x3; local_634 = 3; slotIds = &DAT_00b244b8; local_638 = (Manager *)g_manager->_currentSaveSlot; local_63c = slotSprite; do { Manager::SetSaveSlot(g_manager,*slotIds); replace_slot_graphics(persistentGameData,slotSprite); iVar3 = save_slot_get_status(); pbVar5[-3] = (byte)iVar3; bVar1 = has_all_completion_marks(); this = (Menu_Save *)local_630; slotSprite = slotSprite + 1; *pbVar5 = bVar1; local_634 = local_634 + -1; slotIds = slotIds + 1; pbVar5 = pbVar5 + 1; } while (local_634 != 0); update_save_drawings((Menu_Save *)local_630); iVar3 = 3; uVar6 = extraout_ECX; slotSprite = local_63c; do { ANM2::LoadGraphics(slotSprite,(byte)uVar6); slotSprite = slotSprite + 1; iVar3 = iVar3 + -1; uVar6 = extraout_ECX_00; } while (iVar3 != 0); Manager::SetSaveSlot(g_manager,(uint)local_638); Menu_Character::Reset(&g_menuManager->_menuCharacter); } MVar2 = *(Menu_Save *)((int)this + 0x5b8); if (MVar2 != (Menu_Save)0x0) { MVar4 = MVar2; if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar4 = *(Menu_Save *)MVar2; } animName = "DeleteConfirmationDissapear"; do { bVar1 = *(byte *)MVar4; isLess = bVar1 < (byte)*animName; if (bVar1 != *animName) { LAB_009d9f43: uVar7 = -(uint)isLess | 1; goto LAB_009d9f48; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar4 + 1); isLess = bVar1 < (byte)animName[1]; if (bVar1 != animName[1]) goto LAB_009d9f43; MVar4 = (Menu_Save)((int)MVar4 + 2); animName = animName + 2; } while (bVar1 != 0); uVar7 = 0; LAB_009d9f48: if ((uVar7 == 0) && ((*(byte *)((int)MVar2 + 0x34) == 0 || (*(char *)((int)this + 0x5c8) != '\0')))) goto LAB_009da447; } bVar1 = ANM2::SetAnimation((ANM2 *)((int)this + 0x584), (byte *)"DeleteConfirmationDissapear",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)((int)this + 0x5b4)); *(undefined1 *)((int)this + 0x5c8) = 1; } } } } } else if (MVar2 != (Menu_Save)0x3) { switch(this[1]) { case (Menu_Save)0x0: select_slot(1); break; case (Menu_Save)0x1: select_slot(2); break; case (Menu_Save)0x2: select_slot(3); break; case (Menu_Save)0x3: *this = (Menu_Save)0x1; this[1] = (Menu_Save)0x0; ANM2::Play((ANM2 *)(this + 0x11c),(byte *)"DeleteDeselect",0); } } goto LAB_009da447; } local_630 = (Menu_Save)0x14; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_630,0,0); if (isInputTriggered == '\0') { local_630 = (Menu_Save)0x15; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_630,0,0); if (isInputTriggered == '\0') { local_630 = (Menu_Save)0x17; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_630,0,0); if (isInputTriggered == '\0') { local_630 = (Menu_Save)0x16; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_630,0,0); if (isInputTriggered == '\0') { local_630 = (Menu_Save)0xf; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_630,0,0); if (isInputTriggered != '\0') { MVar2 = *this; if (MVar2 == (Menu_Save)0x2) { ANM2::Play((ANM2 *)(this + 0x161),(byte *)"DeleteConfirmationDissapear",0); } else if (MVar2 == (Menu_Save)0x1) { *this = (Menu_Save)0x0; } else if (MVar2 == (Menu_Save)0x3) { GenericPrompt::Disappear((ANM2 *)(this + 0x1a9)); } else { FUN_0098aec0(); } } } else if (this[1] == (Menu_Save)0x3) { ANM2::Play((ANM2 *)(this + 0x11c),(byte *)"DeleteDeselect",0); this[1] = (Menu_Save)0x0; ANM2::Play((ANM2 *)(this + 6),(byte *)"File1Select",0); ANM2::Play((ANM2 *)(this + 0x4b),(byte *)"Animated",0); } } else { MVar2 = this[1]; if ((((MVar2 == (Menu_Save)0x0) || (MVar2 == (Menu_Save)0x1)) || (MVar2 == (Menu_Save)0x2)) && (*this == (Menu_Save)0x0)) { if (MVar2 == (Menu_Save)0x0) { animName = "File1Deselect"; LAB_009da2a6: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 6),(byte *)animName,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x12)); *(undefined1 *)(this + 0x17) = 1; } } else { if (MVar2 == (Menu_Save)0x1) { animName = "File2Deselect"; goto LAB_009da2a6; } if (MVar2 == (Menu_Save)0x2) { animName = "File3Deselect"; goto LAB_009da2a6; } } pMVar8 = this + 0x58; local_634 = 3; do { MVar2 = *pMVar8; if (MVar2 == (Menu_Save)0x0) { LAB_009da318: bVar1 = ANM2::SetAnimation((ANM2 *)(pMVar8 + -0xd),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(pMVar8 + -1)); *(undefined1 *)(pMVar8 + 4) = 1; } } else { MVar4 = MVar2; if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar4 = *(Menu_Save *)MVar2; } pbVar5 = s_Idle; do { bVar1 = *(byte *)MVar4; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009da305: uVar7 = -(uint)isLess | 1; goto LAB_009da30a; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar4 + 1); isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009da305; MVar4 = (Menu_Save)((int)MVar4 + 2); pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_009da30a: if ((uVar7 != 0) || ((*(byte *)((int)MVar2 + 0x34) != 0 && (*(char *)(pMVar8 + 4) == '\0')))) goto LAB_009da318; } pMVar8 = pMVar8 + 0x45; local_634 = local_634 + -1; } while (local_634 != 0); this[1] = (Menu_Save)0x3; ANM2::Play((ANM2 *)(this + 0x11c),(byte *)"DeleteSelect",0); } } } else { MVar2 = this[3]; if ((MVar2 == (Menu_Save)0x0) || ((0x31 < (uint)MVar2 && ((uint)MVar2 % 10 == 0)))) { if (*this == (Menu_Save)0x2) { MVar2._1_3_ = 0; MVar2._0_1_ = this[2] == (Menu_Save)0x0; this[2] = MVar2; } else if ((*this != (Menu_Save)0x3) && (MVar2 = this[1], (int)MVar2 < 3)) { if (MVar2 == (Menu_Save)0x0) { animName = "File1Deselect"; LAB_009da182: ANM2::Play((ANM2 *)(this + 6),(byte *)animName,0); } else { if (MVar2 == (Menu_Save)0x1) { animName = "File2Deselect"; goto LAB_009da182; } if (MVar2 == (Menu_Save)0x2) { animName = "File3Deselect"; goto LAB_009da182; } } pMVar8 = this + 0x58; local_634 = 3; do { MVar2 = *pMVar8; if (MVar2 == (Menu_Save)0x0) { LAB_009da1e8: bVar1 = ANM2::SetAnimation((ANM2 *)(pMVar8 + -0xd),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(pMVar8 + -1)); *(undefined1 *)(pMVar8 + 4) = 1; } } else { MVar4 = MVar2; if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar4 = *(Menu_Save *)MVar2; } pbVar5 = s_Idle; do { bVar1 = *(byte *)MVar4; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009da1d5: uVar7 = -(uint)isLess | 1; goto LAB_009da1da; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar4 + 1); isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009da1d5; MVar4 = (Menu_Save)((int)MVar4 + 2); pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_009da1da: if ((uVar7 != 0) || ((*(byte *)((int)MVar2 + 0x34) != 0 && (*(char *)(pMVar8 + 4) == '\0')))) goto LAB_009da1e8; } pMVar8 = pMVar8 + 0x45; local_634 = local_634 + -1; } while (local_634 != 0); this[1] = (Menu_Save)((int)this[1] + 1); local_634 = 0; if (2 < (int)this[1]) { this[1] = (Menu_Save)0x0; } } } } } else { MVar2 = this[3]; if ((MVar2 == (Menu_Save)0x0) || ((0x31 < (uint)MVar2 && ((uint)MVar2 % 10 == 0)))) { if (*this == (Menu_Save)0x2) { MVar4._1_3_ = 0; MVar4._0_1_ = this[2] == (Menu_Save)0x0; this[2] = MVar4; } else if ((*this != (Menu_Save)0x3) && (MVar2 = this[1], (int)MVar2 < 3)) { if (MVar2 == (Menu_Save)0x0) { animName = "File1Deselect"; LAB_009da038: ANM2::Play((ANM2 *)(this + 6),(byte *)animName,0); } else { if (MVar2 == (Menu_Save)0x1) { animName = "File2Deselect"; goto LAB_009da038; } if (MVar2 == (Menu_Save)0x2) { animName = "File3Deselect"; goto LAB_009da038; } } pMVar8 = this + 0x58; local_634 = 3; do { MVar2 = *pMVar8; if (MVar2 == (Menu_Save)0x0) { LAB_009da098: bVar1 = ANM2::SetAnimation((ANM2 *)(pMVar8 + -0xd),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(pMVar8 + -1)); *(undefined1 *)(pMVar8 + 4) = 1; } } else { MVar4 = MVar2; if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar4 = *(Menu_Save *)MVar2; } pbVar5 = s_Idle; do { bVar1 = *(byte *)MVar4; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009da085: uVar7 = -(uint)isLess | 1; goto LAB_009da08a; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar4 + 1); isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009da085; MVar4 = (Menu_Save)((int)MVar4 + 2); pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_009da08a: if ((uVar7 != 0) || ((*(byte *)((int)MVar2 + 0x34) != 0 && (*(char *)(pMVar8 + 4) == '\0')))) goto LAB_009da098; } pMVar8 = pMVar8 + 0x45; local_634 = local_634 + -1; } while (local_634 != 0); pMVar8 = this + 1; *pMVar8 = (Menu_Save)((int)*pMVar8 + -1); local_634 = 0; if ((int)*pMVar8 < 0) { this[1] = (Menu_Save)0x2; } } } } LAB_009da447: local_630 = (Menu_Save)0x14; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_630,0,0); if (isInputTriggered == '\0') { local_630 = (Menu_Save)0x15; isInputTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_630,0,0); if (isInputTriggered != '\0') goto LAB_009da4ae; *(Menu_Save *)((int)this + 0xc) = (Menu_Save)0x0; } else { LAB_009da4ae: *(Menu_Save *)((int)this + 0xc) = (Menu_Save)((int)*(Menu_Save *)((int)this + 0xc) + 1); } update_sprites(this); GenericPrompt::Update((GenericPrompt *)((int)this + 0x6a4),1); if ((*(Menu_Save *)((int)this + 0x6d8) != (Menu_Save)0x0) && (*(char *)((int)this + 0x6e8) != '\0')) { ExceptionList = local_10; return; } if (*this != (Menu_Save)0x3) { ExceptionList = local_10; return; } *this = (Menu_Save)0x0; manager = g_manager; if (*(Menu_Save *)((int)this + 2000) != (Menu_Save)0x1) { ExceptionList = local_10; return; } MVar2 = *(Menu_Save *)((int)this + 0x7d8); local_630 = MVar2; if ((int)MVar2 < 1) { FUN_00926460(1); MVar2 = extraout_ECX_05; goto LAB_009da665; } persistentGameData = &g_manager->_persistentGameData; if ((Menu_Save *)0x4c4b3ff < (Menu_Save *)((int)MVar2 + 0xfeced300U)) goto LAB_009da665; std::string::string((char *)savedDataPath,&(g_manager->_persistentGameData).field_0x8); local_8 = 0; pbVar5 = PersistentGameData::get_save_file_name(persistentGameData); sprintf(&DAT_00c93e50,(byte *)"%s/save_backups/"); sprintf_s(backupFileName,0x600,(byte *)"%s%d.%s"); local_8._0_1_ = 1; tracked_alloc(1,pbVar5,0); local_8 = (uint)local_8._1_3_ << 8; PersistentGameData::Load(persistentGameData,backupFileName); *(undefined1 *)persistentGameData = 1; MVar2 = (Menu_Save)&(manager->_persistentGameData).field_0x8; if (MVar2 == (Menu_Save)savedDataPath) { LAB_009da5d2: cloudManager = g_manager; if ((manager->_persistentGameData)._isFileLoaded != 0) { *(undefined1 *)persistentGameData = 0; steamContext = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if ((*steamContext == 0) || ((cloudManager->_optionsConfig)._enableSteamCloud == 0)) { PersistentGameData::Save(persistentGameData); MVar2 = extraout_ECX_03; } else { PersistentGameData::SaveToSteamCloud(persistentGameData); MVar2 = extraout_ECX_02; } } } else { MVar4 = (Menu_Save)savedDataPath; if (0xf < savedDataPathCapacity) { MVar4 = savedDataPath[0]; } std::string::assign((char *)MVar2,(byte *)MVar4,savedDataPathSize); MVar2 = extraout_ECX_01; if (*(char *)persistentGameData != '\0') goto LAB_009da5d2; } local_8 = 0xffffffff; if (0xf < savedDataPathCapacity) { uVar7 = savedDataPathCapacity + 1; MVar2 = savedDataPath[0]; if (0xfff < uVar7) { MVar2 = *(Menu_Save *)((int)savedDataPath[0] + -4); uVar7 = savedDataPathCapacity + 0x24; if (0x1f < ((int)savedDataPath[0] - (int)MVar2) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)MVar2,uVar7); MVar2 = extraout_ECX_04; } LAB_009da665: slotSprite = (ANM2 *)((int)this + (g_manager->_currentSaveSlot * 0x45 + 6) * 4); replace_slot_graphics((Menu_Save *)MVar2,slotSprite); ANM2::LoadGraphics(slotSprite,unk); Menu_Character::Reset(&g_menuManager->_menuCharacter); ExceptionList = local_10; return; } //@@ 009da6d0 Menu_Save::Render /* DB: thiscall Menu_Save (ANM2 at +0x18 as in Menu_Save::LoadGraphics): renders the menu sprite at MenuManager offset (+0x44/+0x48) + this+0x10, shows layer 4, renders each slot drawing at the "Drawing1"/"Drawing2"/"Drawing3" null frames; MenuManager::Render prototype: db/protos.zhl */ void __thiscall Menu_Save::Render(Menu_Save *this) { Menu_Save MVar1; Menu_Save MVar2; Menu_Save MVar3; LayerState *layer4; float *nullFrame; AnimationState *lastAnimState; Vector drawingPos; Vector menuPos; float menuPosY; float menuPosX; menuPos.x = (g_menuManager->_ViewPosition).x + (float)this[4]; menuPos.y = (g_menuManager->_ViewPosition).y + (float)this[5]; menuPosY = menuPos.y; menuPosX = menuPos.x; layer4 = ANM2::GetLayer((ANM2 *)(this + 6),&DAT_00000004); layer4->_visible = 1; if (this[0x48].field_0x1 != '\0') { if (*(char *)(this + 0x22) == '\0') { AnimationState::Render((AnimationState *)(this + 0x12),&menuPos,&g_vectorZero,&g_vectorZero); AnimationState::Render((AnimationState *)(this + 0x1a),&menuPos,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render((AnimationState *)(this + 0x1a),&menuPos,&g_vectorZero,&g_vectorZero); AnimationState::Render((AnimationState *)(this + 0x12),&menuPos,&g_vectorZero,&g_vectorZero); } menuPosX = menuPos.x; menuPosY = menuPos.y; } if (this[0x13] != (Menu_Save)0x0) { nullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x12),(byte *)"Drawing1"); if (nullFrame != (float *)0x0) { if (this + 0x75 != (Menu_Save *)(nullFrame + 6)) { MVar1 = *(Menu_Save *)(nullFrame + 7); MVar2 = *(Menu_Save *)(nullFrame + 8); MVar3 = *(Menu_Save *)(nullFrame + 9); this[0x75] = *(Menu_Save *)(nullFrame + 6); this[0x76] = MVar1; this[0x77] = MVar2; this[0x78] = MVar3; MVar1 = *(Menu_Save *)(nullFrame + 0xb); MVar2 = *(Menu_Save *)(nullFrame + 0xc); MVar3 = *(Menu_Save *)(nullFrame + 0xd); this[0x79] = *(Menu_Save *)(nullFrame + 10); this[0x7a] = MVar1; this[0x7b] = MVar2; this[0x7c] = MVar3; *(undefined8 *)(this + 0x7d) = *(undefined8 *)(nullFrame + 0xe); this[0x7f] = *(Menu_Save *)(nullFrame + 0x10); } drawingPos.x = menuPosX + *nullFrame; drawingPos.y = menuPosY + nullFrame[1]; if (this[0x8d].field_0x1 != '\0') { if (*(char *)(this + 0x67) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x57),&drawingPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x5f); } else { AnimationState::Render ((AnimationState *)(this + 0x5f),&drawingPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x57); } AnimationState::Render(lastAnimState,&drawingPos,&g_vectorZero,&g_vectorZero); } } if (this[0x13] != (Menu_Save)0x0) { nullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x12),(byte *)"Drawing2"); if (nullFrame != (float *)0x0) { if (this + 0xba != (Menu_Save *)(nullFrame + 6)) { MVar1 = *(Menu_Save *)(nullFrame + 7); MVar2 = *(Menu_Save *)(nullFrame + 8); MVar3 = *(Menu_Save *)(nullFrame + 9); this[0xba] = *(Menu_Save *)(nullFrame + 6); this[0xbb] = MVar1; this[0xbc] = MVar2; this[0xbd] = MVar3; MVar1 = *(Menu_Save *)(nullFrame + 0xb); MVar2 = *(Menu_Save *)(nullFrame + 0xc); MVar3 = *(Menu_Save *)(nullFrame + 0xd); this[0xbe] = *(Menu_Save *)(nullFrame + 10); this[0xbf] = MVar1; this[0xc0] = MVar2; this[0xc1] = MVar3; *(undefined8 *)(this + 0xc2) = *(undefined8 *)(nullFrame + 0xe); this[0xc4] = *(Menu_Save *)(nullFrame + 0x10); } drawingPos.x = menuPosX + *nullFrame; drawingPos.y = menuPosY + nullFrame[1]; if (this[0xd2].field_0x1 != '\0') { if (*(char *)(this + 0xac) == '\0') { AnimationState::Render ((AnimationState *)(this + 0x9c),&drawingPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0xa4); } else { AnimationState::Render ((AnimationState *)(this + 0xa4),&drawingPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x9c); } AnimationState::Render(lastAnimState,&drawingPos,&g_vectorZero,&g_vectorZero); } } if (this[0x13] != (Menu_Save)0x0) { nullFrame = AnimationState::GetNullFrame((AnimationState *)(this + 0x12),(byte *)"Drawing3") ; if (nullFrame != (float *)0x0) { if (this + 0xff != (Menu_Save *)(nullFrame + 6)) { MVar1 = *(Menu_Save *)(nullFrame + 7); MVar2 = *(Menu_Save *)(nullFrame + 8); MVar3 = *(Menu_Save *)(nullFrame + 9); this[0xff] = *(Menu_Save *)(nullFrame + 6); this[0x100] = MVar1; this[0x101] = MVar2; this[0x102] = MVar3; MVar1 = *(Menu_Save *)(nullFrame + 0xb); MVar2 = *(Menu_Save *)(nullFrame + 0xc); MVar3 = *(Menu_Save *)(nullFrame + 0xd); this[0x103] = *(Menu_Save *)(nullFrame + 10); this[0x104] = MVar1; this[0x105] = MVar2; this[0x106] = MVar3; *(undefined8 *)(this + 0x107) = *(undefined8 *)(nullFrame + 0xe); this[0x109] = *(Menu_Save *)(nullFrame + 0x10); } drawingPos.x = menuPosX + *nullFrame; drawingPos.y = menuPosY + nullFrame[1]; if (this[0x117].field_0x1 != '\0') { if (*(char *)(this + 0xf1) == '\0') { AnimationState::Render ((AnimationState *)(this + 0xe1),&drawingPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0xe9); } else { AnimationState::Render ((AnimationState *)(this + 0xe9),&drawingPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0xe1); } AnimationState::Render(lastAnimState,&drawingPos,&g_vectorZero,&g_vectorZero); } } } } } if (this[0x15e].field_0x1 != '\0') { if (*(char *)(this + 0x138) == '\0') { AnimationState::Render((AnimationState *)(this + 0x128),&menuPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x130); } else { AnimationState::Render((AnimationState *)(this + 0x130),&menuPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x128); } AnimationState::Render(lastAnimState,&menuPos,&g_vectorZero,&g_vectorZero); } if ((*this == (Menu_Save)0x2) && (this[0x1a3].field_0x1 != '\0')) { if (*(char *)(this + 0x17d) == '\0') { AnimationState::Render((AnimationState *)(this + 0x16d),&menuPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x175); } else { AnimationState::Render((AnimationState *)(this + 0x175),&menuPos,&g_vectorZero,&g_vectorZero); lastAnimState = (AnimationState *)(this + 0x16d); } AnimationState::Render(lastAnimState,&menuPos,&g_vectorZero,&g_vectorZero); } GenericPrompt::Render((GenericPrompt *)(this + 0x1a9)); return; } //@@ 009daaa0 Menu_Save::unload_graphics /* DB: ECX=MenuManager+0x2f4 (_menuSave, structs.hpp: ANM2 at +0x18, 3 ANM2 at +0x12c, +0x470, +0x584): ANM2::Reset on exactly these; first call of ~Menu_Save */ void Menu_Save::unload_graphics(void) { uint *ptr; void *pvVar1; undefined4 *puVar2; int in_ECX; int iVar3; undefined4 *puVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::Reset((ANM2 *)(in_ECX + 0x18)); ANM2::Reset((ANM2 *)(in_ECX + 0x470)); ANM2::Reset((ANM2 *)(in_ECX + 0x584)); puVar4 = (undefined4 *)(in_ECX + 0x154); iVar3 = 3; do { if (puVar4[-6] != 0) { AnmCache::RemoveRef((std_string *)(puVar4 + -10)); } puVar2 = puVar4 + -10; if (0xf < (uint)puVar4[-5]) { puVar2 = (undefined4 *)*puVar2; } puVar4[-6] = 0; *(undefined1 *)puVar2 = 0; AnimationState::SetAnimationData((AnimationState *)(puVar4 + 2),(void *)0x0); AnimationState::SetAnimationData((AnimationState *)(puVar4 + 10),(void *)0x0); puVar2 = puVar4 + -4; if (0xf < (uint)puVar4[1]) { puVar2 = (undefined4 *)*puVar2; } *puVar4 = 0; *(undefined1 *)puVar2 = 0; pvVar1 = (void *)puVar4[0x15]; puVar4[0x13] = 0; puVar4[0x14] = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); local_8 = 0xffffffff; } puVar4[0x15] = 0; puVar4[0x16] = 0; puVar4[0x17] = 0; puVar4[0x18] = 0; puVar4[0x19] = 0; puVar4[0x1a] = 0; puVar4[0x1b] = g_vectorZero.x; puVar4[0x1c] = g_vectorZero.y; puVar4[0x1d] = g_vectorOne.x; puVar4[0x1e] = g_vectorOne.y; puVar4[0x1f] = 0; puVar4[0x20] = 0x3f800000; puVar4[0x21] = 0x3f800000; puVar4[0x22] = 0x3f800000; puVar4[0x23] = 0x3f800000; puVar4[0x24] = 0; puVar4[0x25] = 0; puVar4[0x26] = 0; puVar4[0x27] = 0; puVar4[0x28] = 0; puVar4[0x29] = 0; puVar4[0x2a] = 0; puVar4[0x2f] = 0; puVar4[0x30] = 0; puVar4[0x31] = 0; puVar4[0x32] = 0; puVar4[0x33] = 0; puVar4[0x34] = 0; puVar4[0x35] = 0; puVar4[0x2b] = 0x3f800000; puVar4[0x2c] = 0x3f800000; puVar4[0x2d] = 0x3f800000; puVar4[0x2e] = 0; *(undefined2 *)(puVar4 + 0x36) = 0; puVar4[0x37] = 0x3f800000; *(undefined2 *)(puVar4 + 0x38) = 0; *(undefined1 *)(puVar4 + 0x12) = 0; puVar4[0x39] = 0xffffffff; puVar4[0x3a] = 0; puVar4 = puVar4 + 0x45; iVar3 = iVar3 + -1; } while (iVar3 != 0); ExceptionList = local_10; return; } //@@ 009dad30 Menu_Save::Reset /* ZHL [exact] __thiscall void Menu_Save::Reset(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Save::Reset(Menu_Save *this) { byte bVar1; Menu_Save MVar2; uint uVar3; LayerState *layer; int iVar4; byte *pbVar5; Menu_Save MVar6; char *expectedName; Menu_Save *this_00; undefined4 extraout_ECX; undefined4 uVar7; undefined4 extraout_ECX_00; uint *saveSlotId; ANM2 *sprite; ANM2 *slotSprite; bool isLess; int slotsLeft; sprite = (ANM2 *)(this + 0x11c); *this = (Menu_Save)0x0; MVar6 = this[0x129]; if (MVar6 == (Menu_Save)0x0) { LAB_009dad97: bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x128)); *(undefined1 *)(this + 0x12d) = 1; } } else { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } pbVar5 = s_Idle; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009dad84: uVar3 = -(uint)isLess | 1; goto LAB_009dad89; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009dad84; MVar2 = (Menu_Save)((int)MVar2 + 2); pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009dad89: if ((uVar3 != 0) || ((*(byte *)((int)MVar6 + 0x34) != 0 && (*(char *)(this + 0x12d) == '\0')))) goto LAB_009dad97; } MVar6 = this[0x16e]; if (MVar6 == (Menu_Save)0x0) { LAB_009dae14: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 0x161),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x16d)); *(undefined1 *)(this + 0x172) = 1; } } else { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } pbVar5 = s_Idle; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_009dadf0: uVar3 = -(uint)isLess | 1; goto LAB_009dadf5; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_009dadf0; MVar2 = (Menu_Save)((int)MVar2 + 2); pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009dadf5: if ((uVar3 != 0) || ((*(byte *)((int)MVar6 + 0x34) != 0 && (*(char *)(this + 0x172) == '\0')))) goto LAB_009dae14; } pbVar5 = (byte *)0x0; if (0 < (int)this[0x13c]) { do { layer = ANM2::GetLayer(sprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while ((int)pbVar5 < (int)this[0x13c]); } layer = ANM2::GetLayer(sprite,&DAT_00000005); layer->_visible = 1; layer = ANM2::GetLayer((ANM2 *)(this + 6),&DAT_00000005); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)(this + 6),&DAT_00000009); layer->_visible = 1; layer = ANM2::GetLayer(sprite,&DAT_00000009); layer->_visible = 0; layer = ANM2::GetLayer((ANM2 *)(this + 0x161),&DAT_00000009); layer->_visible = 0; MVar2 = (Menu_Save)(g_manager->_currentSaveSlot + -1); this[2] = (Menu_Save)0x0; this[3] = (Menu_Save)0x0; MVar6 = (Menu_Save)0x0; if (0 < (int)MVar2) { MVar6 = MVar2; } this[1] = MVar6; if (MVar6 != (Menu_Save)0x0) { if (MVar6 != (Menu_Save)0x1) { if (MVar6 != (Menu_Save)0x2) goto LAB_009db19e; MVar6 = this[0x13]; if (MVar6 == (Menu_Save)0x0) { LAB_009daf23: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 6),(byte *)"File3Select",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x12)); *(undefined1 *)(this + 0x17) = 1; } } else { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } expectedName = "File3Select"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_009daf10: uVar3 = -(uint)isLess | 1; goto LAB_009daf15; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009daf10; MVar2 = (Menu_Save)((int)MVar2 + 2); expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009daf15: if ((uVar3 != 0) || ((*(byte *)((int)MVar6 + 0x34) != 0 && (*(char *)(this + 0x17) == '\0')))) goto LAB_009daf23; } MVar6 = this[0xe2]; if (MVar6 != (Menu_Save)0x0) { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } expectedName = "Animated"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_009daf80: uVar3 = -(uint)isLess | 1; goto LAB_009daf85; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009daf80; MVar2 = (Menu_Save)((int)MVar2 + 2); expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009daf85: if ((uVar3 == 0) && ((*(byte *)((int)MVar6 + 0x34) == 0 || (*(char *)(this + 0xe6) != '\0')))) goto LAB_009db19e; } bVar1 = ANM2::SetAnimation((ANM2 *)(this + 0xd5),(byte *)"Animated",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0xe1)); *(undefined1 *)(this + 0xe6) = 1; } goto LAB_009db19e; } MVar6 = this[0x13]; if (MVar6 == (Menu_Save)0x0) { LAB_009db018: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 6),(byte *)"File2Select",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x12)); *(undefined1 *)(this + 0x17) = 1; } } else { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } expectedName = "File2Select"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_009db005: uVar3 = -(uint)isLess | 1; goto LAB_009db00a; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009db005; MVar2 = (Menu_Save)((int)MVar2 + 2); expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009db00a: if ((uVar3 != 0) || ((*(byte *)((int)MVar6 + 0x34) != 0 && (*(char *)(this + 0x17) == '\0')))) goto LAB_009db018; } MVar6 = this[0x9d]; if (MVar6 != (Menu_Save)0x0) { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } expectedName = "Animated"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_009db070: uVar3 = -(uint)isLess | 1; goto LAB_009db075; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009db070; MVar2 = (Menu_Save)((int)MVar2 + 2); expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009db075: if ((uVar3 == 0) && ((*(byte *)((int)MVar6 + 0x34) == 0 || (*(char *)(this + 0xa1) != '\0')))) goto LAB_009db19e; } bVar1 = ANM2::SetAnimation((ANM2 *)(this + 0x90),(byte *)"Animated",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x9c)); *(undefined1 *)(this + 0xa1) = 1; } goto LAB_009db19e; } MVar6 = this[0x13]; if (MVar6 == (Menu_Save)0x0) { LAB_009db108: bVar1 = ANM2::SetAnimation((ANM2 *)(this + 6),(byte *)"File1Select",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x12)); *(undefined1 *)(this + 0x17) = 1; } } else { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } expectedName = "File1Select"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_009db0f5: uVar3 = -(uint)isLess | 1; goto LAB_009db0fa; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009db0f5; MVar2 = (Menu_Save)((int)MVar2 + 2); expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009db0fa: if ((uVar3 != 0) || ((*(byte *)((int)MVar6 + 0x34) != 0 && (*(char *)(this + 0x17) == '\0')))) goto LAB_009db108; } MVar6 = this[0x58]; if (MVar6 != (Menu_Save)0x0) { MVar2 = MVar6; if (0xf < *(uint *)((int)MVar6 + 0x14)) { MVar2 = *(Menu_Save *)MVar6; } expectedName = "Animated"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*expectedName; if (bVar1 != *expectedName) { LAB_009db160: uVar3 = -(uint)isLess | 1; goto LAB_009db165; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)expectedName[1]; if (bVar1 != expectedName[1]) goto LAB_009db160; MVar2 = (Menu_Save)((int)MVar2 + 2); expectedName = expectedName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009db165: if ((uVar3 == 0) && ((*(byte *)((int)MVar6 + 0x34) == 0 || (*(char *)(this + 0x5c) != '\0')))) goto LAB_009db19e; } bVar1 = ANM2::SetAnimation((ANM2 *)(this + 0x4b),(byte *)"Animated",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x57)); *(undefined1 *)(this + 0x5c) = 1; } LAB_009db19e: pbVar5 = &this[0x11a].field_0x3; saveSlotId = &DAT_00b244b8; slotSprite = (ANM2 *)(this + 0x4b); slotsLeft = 3; uVar3 = g_manager->_currentSaveSlot; sprite = slotSprite; do { Manager::SetSaveSlot(g_manager,*saveSlotId); load_slot_data(); replace_slot_graphics(this_00,sprite); iVar4 = save_slot_get_status(); pbVar5[-3] = (byte)iVar4; bVar1 = has_all_completion_marks(); sprite = sprite + 1; *pbVar5 = bVar1; slotsLeft = slotsLeft + -1; saveSlotId = saveSlotId + 1; pbVar5 = pbVar5 + 1; } while (slotsLeft != 0); update_save_drawings(this); iVar4 = 3; uVar7 = extraout_ECX; do { ANM2::LoadGraphics(slotSprite,(byte)uVar7); slotSprite = slotSprite + 1; iVar4 = iVar4 + -1; uVar7 = extraout_ECX_00; } while (iVar4 != 0); Manager::SetSaveSlot(g_manager,uVar3); return; } //@@ 009db250 FUN_009db250 void FUN_009db250(undefined4 param_1,undefined1 param_2,int *param_3) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0f4fd; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; std::shared_ptr::assign((void *)(in_ECX + 0x69c),¶m_2); local_8 = 1; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(¶m_2); } } ExceptionList = local_10; return; } //@@ 009db2d0 Menu_Save::replace_slot_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] __thiscall void Menu_Save::replace_slot_graphics(ANM2* sprite); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Menu_Save::replace_slot_graphics(Menu_Save *this,ANM2 *sprite) { LayerState *layer; char *drawingPath; void *freeBlock; byte *pathCursor; uint uVar1; char *negativePath; uint heartPieces; std_string sheetPath; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; int managerState; int negativePieces; byte pathChar; int photoPieces; local_8 = 0xffffffff; puStack_c = &LAB_00b0f535; local_10 = ExceptionList; local_18 = __security_cookie ^ (int)&sheetPath + 0x2cU; ExceptionList = &local_10; negativePath = (char *)0x0; heartPieces = 0; if ((g_manager->_persistentGameData)._isFileLoaded == 0) { drawingPath = "gfx/ui/main menu/SaveDrawings/CorruptData.png"; } else if (((g_manager->_persistentGameData)._achievements[0x27d] == 0) && (((managerState = g_manager->_state, managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if ((g_manager->_persistentGameData)._eventCounters[0x1ec] == 0) { if ((g_manager->_persistentGameData)._cutsceneCounters[0x19] < 1) { if (((g_manager->_persistentGameData)._achievements[0x27b] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0x153] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0xeb] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0x54] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0x45] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if ((g_manager->_persistentGameData)._eventCounters[0x1a] == 0) { if (((g_manager->_persistentGameData)._achievements[0x29] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0x9b] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { photoPieces = (g_manager->_persistentGameData)._eventCounters[0xb]; negativePieces = (g_manager->_persistentGameData)._eventCounters[0xd]; if ((photoPieces < 1) && (negativePieces < 1)) { if (((g_manager->_persistentGameData)._achievements[0x20] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0xb] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { if (((g_manager->_persistentGameData)._achievements[0x21] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) )) { uVar1 = (g_manager->_persistentGameData)._eventCounters[1]; if (uVar1 == 0) { if (((g_manager->_persistentGameData)._achievements[4] == 0) && (((managerState != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) { drawingPath = "gfx/ui/main menu/SaveDrawings/01_Basement.png"; } else { drawingPath = "gfx/ui/main menu/SaveDrawings/02_MomKill.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/03_Heart.png"; heartPieces = 0xb; if (uVar1 < 0xb) { heartPieces = uVar1; } } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/04_EverythingIsTerrible.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/05_Fetus.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/06_BlueBaby.png"; } switchD_009db728_caseD_0: negativePath = (char *)0x0; } else { switch(photoPieces) { case 0: drawingPath = "gfx/ui/main menu/SaveDrawings/12_PhotoOutline.png"; break; case 1: drawingPath = "gfx/ui/main menu/SaveDrawings/12_Photo1Piece.png"; break; case 2: drawingPath = "gfx/ui/main menu/SaveDrawings/11_Photo2Pieces.png"; break; case 3: drawingPath = "gfx/ui/main menu/SaveDrawings/10_Photo3Pieces.png"; break; case 4: drawingPath = "gfx/ui/main menu/SaveDrawings/09_Photo4Pieces.png"; break; default: drawingPath = "gfx/ui/main menu/SaveDrawings/08_PhotoFull.png"; } switch(negativePieces) { case 0: goto switchD_009db728_caseD_0; case 1: negativePath = "gfx/ui/main menu/SaveDrawings/12_Negative1Piece.png"; break; case 2: negativePath = "gfx/ui/main menu/SaveDrawings/11_Negative2Pieces.png"; break; case 3: negativePath = "gfx/ui/main menu/SaveDrawings/10_Negative3Pieces.png"; break; case 4: negativePath = "gfx/ui/main menu/SaveDrawings/09_Negative4Pieces.png"; break; default: negativePath = "gfx/ui/main menu/SaveDrawings/08_NegativeFull.png"; } } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/13_LambSkull.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/07_GoldenGod.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/16_KillMegaSatan.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/14_PlatinumGod.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/15_RealPlatinumGod.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/17_1000Percent.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/2SaveFilesToGo.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/Mother.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/Dogma.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/Beast.png"; } } else { drawingPath = "gfx/ui/main menu/SaveDrawings/DeadGod.png"; } sheetPath._size = 0; sheetPath._capacity = 0xf; sheetPath._buf._0_4_ = (void *)0x0; pathCursor = (byte *)drawingPath; do { pathChar = *pathCursor; pathCursor = pathCursor + 1; } while (pathChar != 0); std::string::assign(sheetPath._buf,(byte *)drawingPath,(int)pathCursor - (int)(drawingPath + 1)); local_8 = 0; Sprite::ReplaceSpritesheet((Sprite *)sprite,0,&sheetPath); local_8 = 0xffffffff; if (0xf < sheetPath._capacity) { uVar1 = sheetPath._capacity + 1; freeBlock = (void *)sheetPath._buf._0_4_; if (0xfff < uVar1) { freeBlock = *(void **)(sheetPath._buf._0_4_ + -4); uVar1 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)freeBlock))) goto LAB_009db696; } operator_delete(freeBlock,uVar1); } layer = ANM2::GetLayer(sprite,(byte *)0x0); layer->_visible = 1; if ((byte *)negativePath == (byte *)0x0) { layer = ANM2::GetLayer(sprite,(byte *)0x1); layer->_visible = 0; } else { sheetPath._size = 0; sheetPath._capacity = 0xf; sheetPath._buf._0_4_ = (void *)0x0; pathCursor = (byte *)negativePath; do { pathChar = *pathCursor; pathCursor = pathCursor + 1; } while (pathChar != 0); std::string::assign(sheetPath._buf,(byte *)negativePath, (int)pathCursor - (int)(negativePath + 1)); local_8 = 1; Sprite::ReplaceSpritesheet((Sprite *)sprite,1,&sheetPath); local_8 = 0xffffffff; if (0xf < sheetPath._capacity) { uVar1 = sheetPath._capacity + 1; freeBlock = (void *)sheetPath._buf._0_4_; if (0xfff < uVar1) { freeBlock = *(void **)(sheetPath._buf._0_4_ + -4); uVar1 = sheetPath._capacity + 0x24; if (0x1f < (uint)(sheetPath._buf._0_4_ + (-4 - (int)freeBlock))) { LAB_009db696: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar1); } layer = ANM2::GetLayer(sprite,(byte *)0x1); layer->_visible = 1; } uVar1 = 0; do { layer = ANM2::GetLayer(sprite,(byte *)(uVar1 + 2)); if (uVar1 < heartPieces) { layer->_visible = 1; } else { layer->_visible = 0; } uVar1 = uVar1 + 1; } while (uVar1 < 0xb); ExceptionList = local_10; return; } //@@ 009db850 Menu_Save::update_sprites /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? last step of Menu_Save::Update: AnimationState::Update on the main and 3 slot sprites, scales by selection (*this==1 -> 0.6/0.4), plays "File1Select".."File3Select" + "Animated" for the selected slot and drives the delete-confirmation sprite (+0x584) through DeleteConfirmationAppear/Idle/Dissapear, DeleteDeselect prototype: db/protos.zhl */ void __thiscall Menu_Save::update_sprites(Menu_Save *this) { byte bVar1; std_string *animName; Menu_Save MVar2; uint uVar3; Menu_Save curAnimName; void *allocBlock; ANM2 *slotAnimState; char *wantedAnimNameStr; int iVar4; AnimationState *slotAnimState; bool isLess; byte *anim; Menu_Save normalColor [8]; undefined4 local_60; undefined4 uStack_5c; undefined4 local_58; Menu_Save dimColor [8]; undefined4 local_34; undefined4 uStack_30; undefined4 local_2c; uint cleanupFlags; char isNeedSelectAnim; void *curAnim [5]; uint curAnimCapacity; void *local_8; uint *animNameSize; Menu_Save *newColor; local_8 = (void *)(__security_cookie ^ (uint)(curAnim + 7)); cleanupFlags = 0; if ((g_manager->_framecount & 1) == 0) { if (this[0x48].field_0x1 != '\0') { AnimationState::Update((AnimationState *)(this + 0x12)); AnimationState::Update((AnimationState *)(this + 0x1a)); } slotAnimState = (AnimationState *)(this + 0x57); iVar4 = 3; do { if (*(char *)((int)&slotAnimState[6]._currentlyTriggeredEvents + 1) != '\0') { AnimationState::Update(slotAnimState); AnimationState::Update(slotAnimState + 1); } slotAnimState = (AnimationState *)&slotAnimState[8]._isPlaying; iVar4 = iVar4 + -1; } while (iVar4 != 0); if (this[0x15e].field_0x1 != '\0') { AnimationState::Update((AnimationState *)(this + 0x128)); AnimationState::Update((AnimationState *)(this + 0x130)); } if (*this == (Menu_Save)0x1) { MVar2 = (Menu_Save)0x3f19999a; curAnimName = (Menu_Save)0x3ecccccd; newColor = dimColor; local_34 = 0; uStack_30 = 0; local_2c = 0; } else { MVar2 = (Menu_Save)0x3f800000; curAnimName = (Menu_Save)0x3f800000; newColor = normalColor; local_60 = 0; uStack_5c = 0; local_58 = 0; } if (this + 0x146 != newColor) { *(undefined8 *)(this + 0x14e) = 0; this[0x150] = (Menu_Save)0x0; this[0x14a] = (Menu_Save)0x0; this[0x14b] = (Menu_Save)0x0; this[0x14c] = (Menu_Save)0x0; this[0x14d] = (Menu_Save)0x0; this[0x146] = (Menu_Save)0x3f800000; this[0x147] = MVar2; this[0x148] = curAnimName; this[0x149] = (Menu_Save)0x3f800000; } if ((*this == (Menu_Save)0x2) && (this[0x1a3].field_0x1 != '\0')) { AnimationState::Update((AnimationState *)(this + 0x16d)); AnimationState::Update((AnimationState *)(this + 0x175)); } } switch(this[1]) { case (Menu_Save)0x0: if ((this[0x13] == (Menu_Save)0x0) || (uVar3 = cleanupFlags, *(char *)(this + 0x17) == '\0')) { animName = ANM2::GetAnimation((ANM2 *)(this + 0x12),(std_string *)curAnim); uVar3 = 1; animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar1 = str_eq((byte *)animName,*animNameSize,(byte *)"File1Select",0xb); isNeedSelectAnim = '\x01'; if (bVar1 != 0) goto LAB_009db9d0; } else { LAB_009db9d0: isNeedSelectAnim = '\0'; } if (((uVar3 & 1) != 0) && (0xf < curAnimCapacity)) { uVar3 = curAnimCapacity + 1; allocBlock = curAnim[0]; if (0xfff < uVar3) { allocBlock = *(void **)((int)curAnim[0] + -4); uVar3 = curAnimCapacity + 0x24; if (0x1f < (uint)((int)curAnim[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar3); } if (isNeedSelectAnim != '\0') { ANM2::Play((ANM2 *)(this + 6),(byte *)"File1Select",0); slotAnimState = (ANM2 *)(this + 0x4b); anim = (byte *)"Animated"; LAB_009dbbe7: ANM2::Play(slotAnimState,anim,0); } break; case (Menu_Save)0x1: if ((this[0x13] == (Menu_Save)0x0) || (uVar3 = cleanupFlags, *(char *)(this + 0x17) == '\0')) { animName = ANM2::GetAnimation((ANM2 *)(this + 0x12),(std_string *)curAnim); uVar3 = 2; animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar1 = str_eq((byte *)animName,*animNameSize,(byte *)"File2Select",0xb); isNeedSelectAnim = '\x01'; if (bVar1 != 0) goto LAB_009dba7b; } else { LAB_009dba7b: isNeedSelectAnim = '\0'; } if (((uVar3 & 2) != 0) && (0xf < curAnimCapacity)) { uVar3 = curAnimCapacity + 1; allocBlock = curAnim[0]; if (0xfff < uVar3) { allocBlock = *(void **)((int)curAnim[0] + -4); uVar3 = curAnimCapacity + 0x24; if (0x1f < (uint)((int)curAnim[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar3); } if (isNeedSelectAnim != '\0') { ANM2::Play((ANM2 *)(this + 6),(byte *)"File2Select",0); slotAnimState = (ANM2 *)(this + 0x90); anim = (byte *)"Animated"; goto LAB_009dbbe7; } break; case (Menu_Save)0x2: if ((this[0x13] == (Menu_Save)0x0) || (uVar3 = cleanupFlags, *(char *)(this + 0x17) == '\0')) { animName = ANM2::GetAnimation((ANM2 *)(this + 0x12),(std_string *)curAnim); uVar3 = 4; animNameSize = &animName->_size; if (0xf < animName->_capacity) { animName = *(std_string **)animName->_buf; } bVar1 = str_eq((byte *)animName,*animNameSize,(byte *)"File3Select",0xb); isNeedSelectAnim = '\x01'; if (bVar1 != 0) goto LAB_009dbb26; } else { LAB_009dbb26: isNeedSelectAnim = '\0'; } if (((uVar3 & 4) != 0) && (0xf < curAnimCapacity)) { uVar3 = curAnimCapacity + 1; allocBlock = curAnim[0]; if (0xfff < uVar3) { allocBlock = *(void **)((int)curAnim[0] + -4); uVar3 = curAnimCapacity + 0x24; if (0x1f < (uint)((int)curAnim[0] + (-4 - (int)allocBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(allocBlock,uVar3); } if (isNeedSelectAnim != '\0') { ANM2::Play((ANM2 *)(this + 6),(byte *)"File3Select",0); slotAnimState = (ANM2 *)(this + 0xd5); anim = (byte *)"Animated"; goto LAB_009dbbe7; } break; case (Menu_Save)0x3: if ((this[0x129] != (Menu_Save)0x0) && (*(char *)(this + 0x12d) == '\0')) { MVar2 = this[0x129]; if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar2 = *(Menu_Save *)MVar2; } wantedAnimNameStr = "DeleteDeselect"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_009dbbd2: uVar3 = -(uint)isLess | 1; goto LAB_009dbbd7; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_009dbbd2; MVar2 = (Menu_Save)((int)MVar2 + 2); wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009dbbd7: if (uVar3 == 0) { anim = s_Idle; slotAnimState = (ANM2 *)(this + 0x11c); goto LAB_009dbbe7; } } } if (*this != (Menu_Save)0x2) { return; } if ((this[0x16e] != (Menu_Save)0x0) && (*(char *)(this + 0x172) == '\0')) { MVar2 = this[0x16e]; if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar2 = *(Menu_Save *)MVar2; } wantedAnimNameStr = "DeleteConfirmationAppear"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_009dbc42: uVar3 = -(uint)isLess | 1; goto LAB_009dbc47; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_009dbc42; MVar2 = (Menu_Save)((int)MVar2 + 2); wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009dbc47: if (uVar3 == 0) { MVar2 = this[0x16e]; if (MVar2 != (Menu_Save)0x0) { curAnimName = MVar2; if (0xf < *(uint *)((int)MVar2 + 0x14)) { curAnimName = *(Menu_Save *)MVar2; } wantedAnimNameStr = "DeleteConfirmationIdle"; do { bVar1 = *(byte *)curAnimName; isLess = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_009dbc88: uVar3 = -(uint)isLess | 1; goto LAB_009dbc8d; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)curAnimName + 1); isLess = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_009dbc88; curAnimName = (Menu_Save)((int)curAnimName + 2); wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009dbc8d: if ((uVar3 == 0) && ((*(byte *)((int)MVar2 + 0x34) == 0 || (*(char *)(this + 0x172) != '\0')))) goto LAB_009dbd1b; } bVar1 = ANM2::SetAnimation((ANM2 *)(this + 0x161),(byte *)"DeleteConfirmationIdle",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(this + 0x16d)); *(undefined1 *)(this + 0x172) = 1; } goto LAB_009dbd1b; } } MVar2 = this[0x16e]; if ((MVar2 != (Menu_Save)0x0) && (*(char *)(this + 0x172) == '\0')) { if (0xf < *(uint *)((int)MVar2 + 0x14)) { MVar2 = *(Menu_Save *)MVar2; } wantedAnimNameStr = "DeleteConfirmationDissapear"; do { bVar1 = *(byte *)MVar2; isLess = bVar1 < (byte)*wantedAnimNameStr; if (bVar1 != *wantedAnimNameStr) { LAB_009dbd10: uVar3 = -(uint)isLess | 1; goto LAB_009dbd15; } if (bVar1 == 0) break; bVar1 = *(byte *)((int)MVar2 + 1); isLess = bVar1 < (byte)wantedAnimNameStr[1]; if (bVar1 != wantedAnimNameStr[1]) goto LAB_009dbd10; MVar2 = (Menu_Save)((int)MVar2 + 2); wantedAnimNameStr = wantedAnimNameStr + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009dbd15: if (uVar3 == 0) { *this = (Menu_Save)0x0; } } LAB_009dbd1b: MVar2 = this[2]; if ((this[0x16e] != (Menu_Save)0x0) && ((8 < *(int *)((int)this[0x16d] + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 8 < *(int *)((int)this[0x16d] + 0x80))))) { curAnimName = this[0x16e]; iVar4 = *(int *)((int)curAnimName + 0x58); if ((curAnimName == (Menu_Save)0x0) || ((iVar4 < 0 || (*(int *)((int)curAnimName + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)this[0x16f] + iVar4 * 4) = 0; AnimationState::AdvanceLayerPosition((AnimationState *)(this + 0x16d),iVar4,(float)(int)MVar2); } return; } //@@ 009dbdd0 Menu_Save::update_save_drawings /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? swaps gfx/ui/main menu/SaveDrawings/*.png (1SaveFileToGo, Complete1-3, Infinity1-3) per slot layer; callers Menu_Save::Reset, 0098aa30, 009d9c60 prototype: db/protos.zhl */ void __thiscall Menu_Save::update_save_drawings(Menu_Save *this) { byte bVar1; Menu_Save *pMVar2; byte *pbVar3; int iVar4; byte *****pathData; Menu_Save sheet; LayerState *pLVar5; byte *****pppppbVar6; char highestStateCount; Menu_Title *menuTitle; uint freeSize; byte *pbVar7; byte *****a; undefined1 uVar8; char *pngPath; ANM2 *drawingSprite; byte *****pppppbVar9; int toGoCount; Menu_Save *slotSheets; int local_44; undefined1 highestSlotState; byte *****pathString [4]; uint pathSize; uint pathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ****local_14; local_14 = (byte ****)0xffffffff; puStack_18 = &LAB_00b0f59d; local_1c = ExceptionList; puStack_20 = (undefined1 *)(pathString + 0xe); local_24 = __security_cookie ^ (uint)(pathString + 0xb); ExceptionList = &local_1c; highestSlotState = 0; pMVar2 = (Menu_Save *)&highestSlotState; if (*(byte *)(this + 0x11a) != 0) { pMVar2 = this + 0x11a; } bVar1 = this[0x11a].field_0x1; highestSlotState = *(byte *)pMVar2; pbVar7 = &highestSlotState; if (*(byte *)pMVar2 < bVar1) { pbVar7 = &this[0x11a].field_0x1; } highestSlotState = *pbVar7; pbVar3 = &highestSlotState; if (*pbVar7 < (byte)this[0x11a].field_0x2) { pbVar3 = &this[0x11a].field_0x2; } highestSlotState = *pbVar3; highestStateCount = (this[0x11a].field_0x2 == highestSlotState) + (bVar1 == highestSlotState) + (*(byte *)(this + 0x11a) == highestSlotState); if ((highestSlotState == 2) && (highestStateCount == '\x03')) { uVar8 = 1; } else { uVar8 = 0; } menuTitle = &g_menuManager->_menuTitle; g_menuManager->field_0x2f0 = uVar8; Menu_Title::load_graphics(menuTitle); iVar4 = 0; do { if ((&this[0x11a].field_0x3)[iVar4] != '\0') { uVar8 = 1; goto LAB_009dbec6; } iVar4 = iVar4 + 1; } while (iVar4 < 3); uVar8 = 0; LAB_009dbec6: menuTitle = &g_menuManager->_menuTitle; g_menuManager->field_0x2f1 = uVar8; Menu_Title::load_graphics(menuTitle); if ((highestSlotState == 0) || (highestStateCount != '\x03')) { iVar4 = 0; slotSheets = this + 0x6a; toGoCount = 0; local_44 = 0; do { if ((&this[0x11a].field_0x0)[local_44] == '\x01') { pngPath = "gfx/ui/main menu/SaveDrawings/1SaveFileToGo.png"; pathSize = 0; if (iVar4 != 1) { pngPath = "gfx/ui/main menu/SaveDrawings/2SaveFilesToGo.png"; } pathCapacity = 0xf; pathString[0] = (byte *****)0x0; pbVar7 = (byte *)pngPath; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)pathString,(byte *)pngPath,(int)pbVar7 - (int)(pngPath + 1)); pathData = pathString[0]; local_14 = (byte ****)0x6; if (0 < (int)slotSheets[1]) { sheet = *slotSheets; pppppbVar9 = (byte *****)((int)sheet + 8); pppppbVar6 = pppppbVar9; if (0xf < *(uint *)((int)sheet + 0x1c)) { pppppbVar6 = (byte *****)*pppppbVar9; } a = (byte *****)pathString; if (0xf < pathCapacity) { a = pathString[0]; } bVar1 = str_eq((byte *)a,pathSize,(byte *)pppppbVar6,*(uint *)((int)sheet + 0x18)); if (bVar1 == 0) { if ((byte ******)pppppbVar9 == pathString) { *(undefined1 *)((int)sheet + 0x30) = 0; } else { pppppbVar6 = (byte *****)pathString; if (0xf < pathCapacity) { pppppbVar6 = pathData; } std::string::assign((char *)pppppbVar9,(byte *)pppppbVar6,pathSize); *(undefined1 *)((int)*slotSheets + 0x30) = 0; pathData = pathString[0]; } } } local_14 = (byte ****)0xffffffff; if (0xf < pathCapacity) { freeSize = pathCapacity + 1; pppppbVar9 = pathData; if (0xfff < freeSize) { pppppbVar9 = (byte *****)pathData[-1]; freeSize = pathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pathData + (-4 - (int)pppppbVar9))) goto LAB_009dc591; } operator_delete(pppppbVar9,freeSize); } pLVar5 = ANM2::GetLayer((ANM2 *)(slotSheets + -0x1f),(byte *)0x0); iVar4 = toGoCount + 1; pLVar5->_visible = 1; toGoCount = iVar4; } local_44 = local_44 + 1; slotSheets = slotSheets + 0x45; } while (local_44 < 3); } else { if (highestSlotState == 2) { pathData = std::_Allocate(0x30); pathSize = 0x2b; pathCapacity = 0x2f; *pathData = (byte ****)0x2f786667; pathData[1] = (byte ****)0x6d2f6975; pathData[2] = (byte ****)0x206e6961; pathData[3] = (byte ****)0x756e656d; pathData[4] = (byte ****)0x7661532f; pathData[5] = (byte ****)0x61724465; pathData[6] = (byte ****)0x676e6977; pathData[7] = (byte ****)0x6e492f73; pathData[8] = (byte ****)0x696e6966; pathData[9] = (byte ****)0x2e317974; *(undefined2 *)(pathData + 10) = 0x6e70; *(byte *)((int)pathData + 0x2a) = 0x67; *(byte *)((int)pathData + 0x2b) = 0; local_14 = (byte ****)0x0; pathString[0] = pathData; if (0 < (int)this[0x6b]) { sheet = this[0x6a]; pbVar7 = (byte *)((int)sheet + 8); if (0xf < *(uint *)((int)sheet + 0x1c)) { pbVar7 = *(byte **)((int)sheet + 8); } bVar1 = str_eq((byte *)pathData,0x2b,pbVar7,*(uint *)((int)sheet + 0x18)); if (bVar1 == 0) { if ((byte ******)((int)sheet + 8) != pathString) { std::string::assign((char *)((int)sheet + 8),(byte *)pathData,0x2b); sheet = this[0x6a]; pathData = pathString[0]; } *(undefined1 *)((int)sheet + 0x30) = 0; } } local_14 = (byte ****)0xffffffff; if (0xf < pathCapacity) { freeSize = pathCapacity + 1; pppppbVar9 = pathData; if (0xfff < freeSize) { pppppbVar9 = (byte *****)pathData[-1]; freeSize = pathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pathData + (-4 - (int)pppppbVar9))) goto LAB_009dc591; } operator_delete(pppppbVar9,freeSize); } pathData = std::_Allocate(0x30); pathSize = 0x2b; pathCapacity = 0x2f; *pathData = (byte ****)0x2f786667; pathData[1] = (byte ****)0x6d2f6975; pathData[2] = (byte ****)0x206e6961; pathData[3] = (byte ****)0x756e656d; pathData[4] = (byte ****)0x7661532f; pathData[5] = (byte ****)0x61724465; pathData[6] = (byte ****)0x676e6977; pathData[7] = (byte ****)0x6e492f73; pathData[8] = (byte ****)0x696e6966; pathData[9] = (byte ****)0x2e327974; *(undefined2 *)(pathData + 10) = 0x6e70; *(byte *)((int)pathData + 0x2a) = 0x67; *(byte *)((int)pathData + 0x2b) = 0; local_14 = (byte ****)0x1; pathString[0] = pathData; if (0 < (int)this[0xb0]) { sheet = this[0xaf]; pbVar7 = (byte *)((int)sheet + 8); if (0xf < *(uint *)((int)sheet + 0x1c)) { pbVar7 = *(byte **)((int)sheet + 8); } bVar1 = str_eq((byte *)pathData,0x2b,pbVar7,*(uint *)((int)sheet + 0x18)); if (bVar1 == 0) { if ((byte ******)((int)sheet + 8) != pathString) { std::string::assign((char *)((int)sheet + 8),(byte *)pathData,0x2b); sheet = this[0xaf]; pathData = pathString[0]; } *(undefined1 *)((int)sheet + 0x30) = 0; } } local_14 = (byte ****)0xffffffff; if (0xf < pathCapacity) { freeSize = pathCapacity + 1; pppppbVar9 = pathData; if (0xfff < freeSize) { pppppbVar9 = (byte *****)pathData[-1]; freeSize = pathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pathData + (-4 - (int)pppppbVar9))) goto LAB_009dc591; } operator_delete(pppppbVar9,freeSize); } pathString[0] = std::_Allocate(0x30); *pathString[0] = (byte ****)0x2f786667; pathString[0][1] = (byte ****)0x6d2f6975; pathString[0][2] = (byte ****)0x206e6961; pathString[0][3] = (byte ****)0x756e656d; pathString[0][4] = (byte ****)0x7661532f; pathString[0][5] = (byte ****)0x61724465; pathString[0][6] = (byte ****)0x676e6977; pathString[0][7] = (byte ****)0x6e492f73; pathString[0][8] = (byte ****)0x696e6966; pathString[0][9] = (byte ****)0x2e337974; *(undefined2 *)(pathString[0] + 10) = 0x6e70; *(char *)((int)pathString[0] + 0x2a) = 'g'; *(char *)((int)pathString[0] + 0x2b) = '\0'; local_14 = (byte ****)0x2; } else { pathData = std::_Allocate(0x30); pathSize = 0x2b; pathCapacity = 0x2f; *pathData = (byte ****)0x2f786667; pathData[1] = (byte ****)0x6d2f6975; pathData[2] = (byte ****)0x206e6961; pathData[3] = (byte ****)0x756e656d; pathData[4] = (byte ****)0x7661532f; pathData[5] = (byte ****)0x61724465; pathData[6] = (byte ****)0x676e6977; pathData[7] = (byte ****)0x6f432f73; pathData[8] = (byte ****)0x656c706d; pathData[9] = (byte ****)0x2e316574; *(undefined2 *)(pathData + 10) = 0x6e70; *(byte *)((int)pathData + 0x2a) = 0x67; *(byte *)((int)pathData + 0x2b) = 0; local_14 = (byte ****)0x3; pathString[0] = pathData; if (0 < (int)this[0x6b]) { sheet = this[0x6a]; pbVar7 = (byte *)((int)sheet + 8); if (0xf < *(uint *)((int)sheet + 0x1c)) { pbVar7 = *(byte **)((int)sheet + 8); } bVar1 = str_eq((byte *)pathData,0x2b,pbVar7,*(uint *)((int)sheet + 0x18)); if (bVar1 == 0) { if ((byte ******)((int)sheet + 8) != pathString) { std::string::assign((char *)((int)sheet + 8),(byte *)pathData,0x2b); sheet = this[0x6a]; pathData = pathString[0]; } *(undefined1 *)((int)sheet + 0x30) = 0; } } local_14 = (byte ****)0xffffffff; if (0xf < pathCapacity) { freeSize = pathCapacity + 1; pppppbVar9 = pathData; if (0xfff < freeSize) { pppppbVar9 = (byte *****)pathData[-1]; freeSize = pathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pathData + (-4 - (int)pppppbVar9))) goto LAB_009dc591; } operator_delete(pppppbVar9,freeSize); } pathData = std::_Allocate(0x30); pathSize = 0x2b; pathCapacity = 0x2f; *pathData = (byte ****)0x2f786667; pathData[1] = (byte ****)0x6d2f6975; pathData[2] = (byte ****)0x206e6961; pathData[3] = (byte ****)0x756e656d; pathData[4] = (byte ****)0x7661532f; pathData[5] = (byte ****)0x61724465; pathData[6] = (byte ****)0x676e6977; pathData[7] = (byte ****)0x6f432f73; pathData[8] = (byte ****)0x656c706d; pathData[9] = (byte ****)0x2e326574; *(undefined2 *)(pathData + 10) = 0x6e70; *(byte *)((int)pathData + 0x2a) = 0x67; *(byte *)((int)pathData + 0x2b) = 0; local_14 = (byte ****)0x4; pathString[0] = pathData; if (0 < (int)this[0xb0]) { sheet = this[0xaf]; pbVar7 = (byte *)((int)sheet + 8); if (0xf < *(uint *)((int)sheet + 0x1c)) { pbVar7 = *(byte **)((int)sheet + 8); } bVar1 = str_eq((byte *)pathData,0x2b,pbVar7,*(uint *)((int)sheet + 0x18)); if (bVar1 == 0) { if ((byte ******)((int)sheet + 8) != pathString) { std::string::assign((char *)((int)sheet + 8),(byte *)pathData,0x2b); sheet = this[0xaf]; pathData = pathString[0]; } *(undefined1 *)((int)sheet + 0x30) = 0; } } local_14 = (byte ****)0xffffffff; if (0xf < pathCapacity) { freeSize = pathCapacity + 1; pppppbVar9 = pathData; if (0xfff < freeSize) { pppppbVar9 = (byte *****)pathData[-1]; freeSize = pathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pathData + (-4 - (int)pppppbVar9))) goto LAB_009dc591; } operator_delete(pppppbVar9,freeSize); } pathString[0] = std::_Allocate(0x30); *pathString[0] = (byte ****)0x2f786667; pathString[0][1] = (byte ****)0x6d2f6975; pathString[0][2] = (byte ****)0x206e6961; pathString[0][3] = (byte ****)0x756e656d; pathString[0][4] = (byte ****)0x7661532f; pathString[0][5] = (byte ****)0x61724465; pathString[0][6] = (byte ****)0x676e6977; pathString[0][7] = (byte ****)0x6f432f73; pathString[0][8] = (byte ****)0x656c706d; pathString[0][9] = (byte ****)0x2e336574; *(undefined2 *)(pathString[0] + 10) = 0x6e70; *(char *)((int)pathString[0] + 0x2a) = 'g'; *(char *)((int)pathString[0] + 0x2b) = '\0'; local_14 = (byte ****)0x5; } pathData = pathString[0]; pathCapacity = 0x2f; pathSize = 0x2b; if (0 < (int)this[0xf5]) { sheet = this[0xf4]; pbVar7 = (byte *)((int)sheet + 8); if (0xf < *(uint *)((int)sheet + 0x1c)) { pbVar7 = *(byte **)((int)sheet + 8); } bVar1 = str_eq((byte *)pathString[0],0x2b,pbVar7,*(uint *)((int)sheet + 0x18)); if (bVar1 == 0) { if ((byte ******)((int)sheet + 8) != pathString) { std::string::assign((char *)((int)sheet + 8),(byte *)pathData,0x2b); sheet = this[0xf4]; pathData = pathString[0]; } *(undefined1 *)((int)sheet + 0x30) = 0; } } local_14 = (byte ****)0xffffffff; if (0xf < pathCapacity) { freeSize = pathCapacity + 1; pppppbVar9 = pathData; if (0xfff < freeSize) { pppppbVar9 = (byte *****)pathData[-1]; freeSize = pathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)pathData + (-4 - (int)pppppbVar9))) { LAB_009dc591: local_14 = (byte ****)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppbVar9,freeSize); } drawingSprite = (ANM2 *)(this + 0x4b); iVar4 = 3; do { pLVar5 = ANM2::GetLayer(drawingSprite,(byte *)0x0); drawingSprite = drawingSprite + 1; pLVar5->_visible = 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); } ExceptionList = local_1c; return; } //@@ 009dc5a0 FUN_009dc5a0 void FUN_009dc5a0(char param_1,int param_2) { char cVar1; uint uVar2; int in_ECX; undefined4 in_stack_ffffffbc; undefined4 uVar3; undefined1 local_30 [4]; int *local_2c; undefined **local_28; undefined1 local_24 [4]; int *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f5e5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; if (param_1 == '\0') { MenuManager::push_menu(3,in_ECX); } else { uVar3 = 0x9dc5ea; Menu_Character::Reset(&g_menuManager->_menuCharacter); online_lobby_join(&g_manager->_netplayManager,(void *)(param_2 + 0x698), CONCAT44(uVar3,in_stack_ffffffbc)); local_1c = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_1c); local_8 = 0; std::shared_ptr::assign((void *)(param_2 + 0x69c),local_24); local_28 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_20 != (int *)0x0) { cVar1 = (**(code **)(*local_20 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_24); } } local_8 = 0xffffffff; } local_1c = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_1c); local_8 = 2; std::shared_ptr::assign((void *)(param_2 + 0x69c),local_30); local_8 = 3; if (local_2c != (int *)0x0) { cVar1 = (**(code **)(*local_2c + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_30); } } ExceptionList = local_10; return; } //@@ 009dc6e0 GlitchedCollectibleGfx::constructor /* DB: ? zeroes a 0x38-byte object and sets +8 = 0x12345678 (seed sentinel); the only users are ItemPool::CreateGlitchedCollectible (new + this, pushed into a vector) and glitched_collectible_render_gfx */ void GlitchedCollectibleGfx::constructor(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0x12345678; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; return; } //@@ 009dc750 ProceduralItemManager::~ProceduralItemManager /* DB: Game::~Game member at Game+0x67758 (_proceduralItemManager, db/fields.tsv): the std::set head at +0x28 is the one Game::constructor allocates into Game+0x67780; frees vector at +0, vector +0x1c, two render-target refs (+0xc/+0x14 via g_renderTargetReleaseFn) and two SmartPointer */ void ProceduralItemManager::~ProceduralItemManager(void) { undefined4 *this; char cVar1; void *in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f610; local_10 = ExceptionList; ExceptionList = &local_10; KAGE::SmartPointer::reset(in_ECX); KAGE::SmartPointer::reset(extraout_ECX); this = (undefined4 *)((int)in_ECX + 0x28); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)((int)in_ECX + 0x28) + 4)); operator_delete((void *)*this,0x18); FID_conflict__Tidy((void *)((int)in_ECX + 0x1c)); local_8 = 0; if (*(int **)((int)in_ECX + 0x18) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)in_ECX + 0x18) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)((int)in_ECX + 0x14); } } local_8 = 1; if (*(int **)((int)in_ECX + 0x10) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)in_ECX + 0x10) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)((int)in_ECX + 0xc); } } FID_conflict__Tidy(in_ECX); ExceptionList = local_10; return; } //@@ 009dc830 init_procedural_item_surfaces /* DB: ? called from Game::LoadConfigXmls (and two reload paths); creates render targets "Procedural Item Surface"/"Procedural Item Collection Surface" and calls ItemPool::CreateGlitchedCollectible setup prototype: db/protos.zhl */ void __fastcall init_procedural_item_surfaces(ProceduralItemManager *manager) { ItemConfig_Item *this; int *piVar1; Game *pGVar2; char cVar3; void *pvVar4; undefined4 *puVar5; KColor *clearColor; KColor *clearColor_00; Manager *pMVar6; uint uVar7; KColor local_48; KColor local_34; undefined1 local_20 [4]; int *local_1c; ProceduralItemManager *local_18; Manager *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f645; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = manager; if (manager->_renderTarget == 0) { KColor::SetFromARGB(&local_34,0); pvVar4 = KAGE_Graphics::create_render_target (local_20,0x400,0x400,(byte *)"Procedural Item Surface",clearColor); local_8 = 0; shared_ptr::operator_assign(&manager->_renderTarget,pvVar4); local_8 = 1; if (((local_1c != (int *)0x0) && (cVar3 = (**(code **)(*local_1c + 0xc))(), cVar3 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(local_20); } } local_8 = 0xffffffff; if (*(int *)&manager->field_0x14 == 0) { KColor::SetFromARGB(&local_48,0); pvVar4 = KAGE_Graphics::create_render_target (&local_34._alpha,0x200,0x200,(byte *)"Procedural Item Collection Surface", clearColor_00); local_8 = 2; shared_ptr::operator_assign(&manager->field_0x14,pvVar4); local_8 = 3; if ((((int *)local_34._unk != (int *)0x0) && (cVar3 = (**(code **)(*(int *)local_34._unk + 0xc))(), cVar3 != '\0')) && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&local_34._alpha); } } local_8 = 0xffffffff; pvVar4 = (manager->_proceduralItems)._begin; local_14 = (Manager *)0x0; if ((int)(manager->_proceduralItems)._end - (int)pvVar4 >> 2 != 0) { do { puVar5 = *(undefined4 **)((int)pvVar4 + (int)local_14 * 4); if (puVar5 != (undefined4 *)0x0) { this = (ItemConfig_Item *)*puVar5; if (this != (ItemConfig_Item *)0x0) { ItemConfig_Item::~ItemConfig_Item(this); operator_delete(this,0xe8); } uVar7 = 0; if ((int)(puVar5[0xc] - puVar5[0xb]) >> 2 != 0) { do { operator_delete(*(void **)(puVar5[0xb] + uVar7 * 4),0x68); uVar7 = uVar7 + 1; } while (uVar7 < (uint)((int)(puVar5[0xc] - puVar5[0xb]) >> 2)); } FID_conflict__Tidy(puVar5 + 0xb); operator_delete(puVar5,0x38); } local_14 = (Manager *)((int)local_14 + 1); pvVar4 = (local_18->_proceduralItems)._begin; manager = local_18; } while (local_14 < (uint)((int)(local_18->_proceduralItems)._end - (int)pvVar4 >> 2)); } pMVar6 = g_manager; uVar7 = 0; (manager->_proceduralItems)._end = pvVar4; *(undefined4 *)&manager->field_0x20 = *(undefined4 *)&manager->field_0x1c; pvVar4 = (pMVar6->_itemConfig)._collectibles._begin; local_14 = pMVar6; if ((int)(pMVar6->_itemConfig)._collectibles._end - (int)pvVar4 >> 2 != 0) { do { local_18 = *(ProceduralItemManager **)((int)pvVar4 + uVar7 * 4); if ((local_18 != (ProceduralItemManager *)0x0) && ((local_18->_proceduralItems)._begin == (void *)0x3)) { pvVar4 = (local_18->_proceduralItems)._end; if (((((pvVar4 != (void *)0x1db) && (((pvVar4 != (void *)0x1e2 && (pvVar4 != (void *)0x129)) && (pvVar4 != (void *)0x203)) )) && ((pvVar4 != (void *)0x7f && (pvVar4 != (void *)0x1e3)))) && (pvVar4 != (void *)0x15b)) && (((pvVar4 != (void *)0x249 && (pvVar4 != (void *)0x1ea)) && ((pvVar4 != (void *)0x27c && (pvVar4 != (void *)0x274)))))) { piVar1 = *(int **)&manager->field_0x20; if (piVar1 == *(int **)&manager->field_0x24) { std::vector<4byte>::_Emplace_reallocate(piVar1,&local_18); pMVar6 = local_14; } else { *piVar1 = (int)local_18; *(int *)&manager->field_0x20 = *(int *)&manager->field_0x20 + 4; } } } uVar7 = uVar7 + 1; pvVar4 = (pMVar6->_itemConfig)._collectibles._begin; } while (uVar7 < (uint)((int)(pMVar6->_itemConfig)._collectibles._end - (int)pvVar4 >> 2)); } pvVar4 = (manager->_spawnTriggerTargets)._head; FID_conflict__Erase_tree_>_> (&manager->_spawnTriggerTargets, (fuzzer_allocator_> *) &manager->_spawnTriggerTargets,*(_Tree_node **)((int)pvVar4 + 4)); *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; (manager->_spawnTriggerTargets)._size = 0; local_34._alpha = 0.0; local_34._unk = 0; std::vector::resize(&local_34._alpha); puVar5 = std::deque::back(); if ((byte *)(puVar5 + 1) != (byte *)0x0) { *(byte *)(puVar5 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar5 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)manager->_renderTarget,0); RenderTarget::Clear(&DAT_00c798e0); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,*(void **)&manager->field_0x14,0); RenderTarget::Clear(&DAT_00c798e0); if (g_renderTargetStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"PopRenderTarget: stack is empty!\n"); } puVar5 = std::deque::back(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)*puVar5,*(byte *)(puVar5 + 1)); pGVar2 = g_game; g_renderTargetStackSize = g_renderTargetStackSize - 1; if (g_renderTargetStackSize == 0) { DAT_00c7978c = 0; } local_18 = (ProceduralItemManager *)0x4f; std::set::find_node(&local_34._blue,&local_18); if (((*(char *)(local_34._unk + 0xd) == '\0') && (*(int *)(local_34._unk + 0x10) < 0x50)) && ((void *)local_34._unk != (pGVar2->_seedEffects)._seedEffects)) { ItemPool::CreateGlitchedCollectible(1,0); } ExceptionList = local_10; return; } //@@ 009dcbb0 utf8_string_writer_write /* DB: ? thiscall writer {pendingContinuation, base, pos, remaining}: appends bytes from param_1 to a std::string converting Latin-1 bytes >= 0x80 into 2-byte UTF-8 (0xc2/0xc3 lead + continuation), 0 -> 1; returns 1 when the remaining budget (+0xc) hits 0; ItemPool::CreateGlitchedCollectible building the glitched name */ undefined4 utf8_string_writer_write(int param_1,int param_2) { byte c; int iVar1; byte c_00; int *in_ECX; int iVar2; param_2 = in_ECX[1] + param_2; iVar1 = in_ECX[2]; if (iVar1 < param_2) { iVar2 = in_ECX[3]; do { if (iVar2 < 1) break; c = *(byte *)((iVar1 - in_ECX[1]) + param_1); if (*in_ECX < 1) { if ((char)c < '\0') { c_00 = c & 0x1f | 0xc2; if ((c & 0x1e) != 0) { c_00 = c & 0x1f | 0xc0; } std::string::push_back((char *)in_ECX[4],c_00); *in_ECX = 1; } else { if (c == 0) { c = 1; } std::string::push_back((char *)in_ECX[4],c); } } else { std::string::push_back((char *)in_ECX[4],c & 0x3f | 0x80); *in_ECX = *in_ECX + -1; } in_ECX[3] = in_ECX[3] + -1; iVar1 = in_ECX[2] + 1; iVar2 = in_ECX[3]; in_ECX[2] = iVar1; } while (iVar1 < param_2); } in_ECX[1] = param_2; return CONCAT31((int3)((uint)iVar1 >> 8),in_ECX[3] < 1); } //@@ 009dcc70 ItemPool::CreateGlitchedCollectible /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: TMTRAINER (721) path in GetCollectible; "initialized with %d effects (score: %g)", cap 0x400 reuse */ int ItemPool::CreateGlitchedCollectible(ItemConfig_Item *param_1,byte param_2) { undefined4 uVar1; int iVar2; byte ******this; undefined4 uVar3; code *pcVar4; ColorMod *pCVar5; char cVar6; ItemConfig_Item *pIVar7; int iVar8; uint uVar9; undefined1 *puVar10; byte *******strBuf; uint uVar11; ItemConfig_Item *pIVar12; float fVar13; char *_Str1; int *extraout_EAX; KColor *hueColor; int *extraout_EAX_00; undefined *shader; ColorMod *color; std_string *path; void *pvVar14; undefined4 *imageRef; byte bVar15; byte bVar16; byte bVar17; int *in_ECX; int unused; undefined1 *shader; undefined1 auVar19 [4]; int unusedArg; uint uVar20; int unusedArg_00; int unused_00; int unusedArg_01; uint uVar21; ItemConfig *pIVar22; float *pfVar23; Vector *size; int *imageRefCount; undefined1 auStack_2ea [2]; undefined1 auStack_2e0 [116]; ColorMod *local_26c; Vector VStack_268; int *piStack_260; ItemConfig *local_25c; Vector local_254; int *procManager; byte ******local_248; undefined1 *local_244; Vector VStack_240; ItemConfig *local_238; ItemConfig_Item *item; ItemConfig_Item *local_230; void *local_22c; Vector VStack_228; bool local_21d; float *local_21c; ItemConfig_Item *local_218; Vector VStack_214; ItemConfig_Item *local_20c; undefined1 *local_208; float *local_204; Color displayColor; byte *******itemName [4]; uint itemNameSize; uint itemNameCapacity; byte *******itemDesc [4]; uint itemDescSize; uint itemDescCapacity; undefined1 auStack_1a4 [24]; byte *****pppppbStack_18c; byte *****pppppbStack_188; byte *****pppppbStack_184; ushort local_180; undefined2 uStack_17e; float fStack_17c; RNG local_178; ItemConfig_Item IStack_167; float local_88 [7]; int iStack_6c; ItemConfig_Item *local_68; ItemConfig_Item *pIStack_64; undefined1 *puStack_60; byte ******ppppppbStack_5c; ItemConfig_Item *local_58; undefined8 uStack_54; float *pfStack_4c; void *apvStack_44 [2]; undefined1 local_3c [4]; KColor KStack_38; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Game *game; Manager *manager; game = g_game; puStack_20 = local_3c + 0x38; local_14 = 0xffffffff; puStack_18 = &LAB_00b0f6d5; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0x2c); ExceptionList = &local_1c; uVar21 = in_ECX[1] - *in_ECX >> 2; if (0x3ff < uVar21) { local_178._seed = (int)param_1; local_178._shift1 = 1; local_178._shift2 = 5; local_178._shift3 = 0x10; puStack_20 = local_3c + 0x38; uVar21 = RNG::RandomInt(&local_178,uVar21); ExceptionList = local_1c; return *(int *)(**(int **)(*in_ECX + uVar21 * 4) + 4); } local_208 = &DAT_0000004f; procManager = in_ECX; std::set::find_node(); if ((*(char *)((int)local_254.y + 0xd) != '\0') || (0x4f < *(int *)((int)local_254.y + 0x10))) { local_254.y = (float)(game->_seedEffects)._seedEffects; } if (((void *)local_254.y != (game->_seedEffects)._seedEffects) && (param_1 == (ItemConfig_Item *)0x1)) { VStack_214.y = (float)operator_new(0xe8); if ((ItemConfig_Item *)VStack_214.y == (ItemConfig_Item *)0x0) { pIVar7 = (ItemConfig_Item *)0x0; } else { pIVar7 = ItemConfig_Item::ItemConfig_Item((ItemConfig_Item *)VStack_214.y); } std::string::assign((pIVar7->gfxFilename)._buf, (byte *)"gfx/promo/gfuel/items/collectibles/Collectibles_143_Speedball.png", 0x41); std::string::assign((pIVar7->name)._buf,(byte *)"G FUEL!",7); std::string::assign((pIVar7->desc)._buf,&s_empty,0); uVar1 = *(undefined4 *)((int)&pIVar7->tags + 4); *(uint *)&pIVar7->tags = (uint)pIVar7->tags | 0x8000; pIVar7->cacheFlags = pIVar7->cacheFlags | 0xffff; *(undefined4 *)((int)&pIVar7->tags + 4) = uVar1; pIVar7->type = 1; pIVar7->addCostumeOnPickup = 1; ItemConfig_Costume::operator_assign(); glitched_collectible_render_gfx(1,pIVar7); } VStack_214.y = (float)operator_new(0x38); if ((void *)VStack_214.y == (void *)0x0) { local_21c = (float *)0x0; } else { local_21c = (float *)GlitchedCollectibleGfx::constructor(); } local_204 = local_21c; if ((undefined4 *)procManager[1] == (undefined4 *)procManager[2]) { std::vector<4byte>::_Emplace_reallocate(); } else { *(undefined4 *)procManager[1] = local_21c; procManager[1] = procManager[1] + 4; } pfVar23 = local_204; iVar8 = procManager[1]; local_21d = ((uint)param_1 & 0xc000) == 0xc000; if (local_21d) { if ((param_2 & 2) != 0) { param_1 = (ItemConfig_Item *)((uint)param_1 & 0xffff3fff); local_21d = false; } } else if ((param_2 & 8) != 0) { param_1 = (ItemConfig_Item *)((uint)param_1 | 0xc000); local_21d = true; } iVar2 = *procManager; local_204[2] = (float)param_1; local_204[1] = (float)((iVar8 - iVar2 >> 2) + -1); local_21c = local_204; VStack_214.y = (float)operator_new(0xe8); if ((ItemConfig_Item *)VStack_214.y == (ItemConfig_Item *)0x0) { item = (ItemConfig_Item *)0x0; } else { item = ItemConfig_Item::ItemConfig_Item((ItemConfig_Item *)VStack_214.y); } *pfVar23 = (float)item; item->type = 1; local_178._shift1 = 4; local_178._shift2 = 3; item->id = -(procManager[1] - *procManager >> 2); local_20c = (ItemConfig_Item *)0x1b; local_178._shift3 = 0x1b; itemNameCapacity = 0xf; itemNameSize = 0; itemName[0] = (byte *******)0x0; itemDescCapacity = 0xf; itemDescSize = 0; itemDesc[0] = (byte *******)0x0; local_14._0_1_ = 1; local_14._1_3_ = 0; local_254.y = (float)itemDesc; local_254.x = (float)itemName; VStack_228.y = 0.0; do { if (param_1 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } bVar15 = (byte)local_178._shift1; uVar21 = (uint)param_1 >> (bVar15 & 0x1f) ^ (uint)param_1; bVar16 = (byte)local_178._shift2; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; bVar17 = (byte)local_20c; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; local_208 = (undefined1 *)(uVar21 & 7); if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar9 = uVar21 >> (bVar15 & 0x1f) ^ uVar21; uVar9 = uVar9 << (bVar16 & 0x1f) ^ uVar9; uVar9 = uVar9 >> (bVar17 & 0x1f) ^ uVar9; local_204 = (float *)(uVar9 & 7); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar9 = uVar9 >> (bVar15 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar16 & 0x1f) ^ uVar9; uVar9 = uVar9 >> (bVar17 & 0x1f) ^ uVar9; local_244 = (undefined1 *)(uVar21 & 7) + (int)local_204 + 4U + (uVar9 & 7); if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar9 = uVar9 >> (bVar15 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar16 & 0x1f) ^ uVar9; uVar9 = uVar9 >> (bVar17 & 0x1f) ^ uVar9; if (uVar9 == (uVar9 / 0x50) * 0x50) { if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar9 = uVar9 >> (bVar15 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar16 & 0x1f) ^ uVar9; uVar9 = uVar9 >> (bVar17 & 0x1f) ^ uVar9; local_244 = local_244 + uVar9 % 0x28; } uVar21 = (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2; if (uVar9 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar9 = uVar9 >> (bVar15 & 0x1f) ^ uVar9; uVar9 = uVar9 << (bVar16 & 0x1f) ^ uVar9; local_204 = (float *)(uVar9 >> (bVar17 & 0x1f) ^ uVar9); if (uVar21 == 0) { local_238 = (ItemConfig *)0x0; } else { local_238 = (ItemConfig *)((uint)local_204 % uVar21); } if (g_game == (Game *)0x0) { if (-1 < (int)local_238) goto LAB_009dd205; LAB_009dd227: local_208 = (g_manager->_itemConfig)._collectibles._begin; uVar21 = (int)(g_manager->_itemConfig)._collectibles._end - (int)local_208 >> 2; LAB_009dd240: do { local_238 = (ItemConfig *)((uint)((int)&(local_238->_collectibles)._begin + 1U) % uVar21); if (g_game == (Game *)0x0) { if ((int)local_238 < 0) goto LAB_009dd240; LAB_009dd28d: if ((int)uVar21 <= (int)local_238) goto LAB_009dd240; local_230 = *(ItemConfig_Item **)(local_208 + (int)local_238 * 4); } else { if (-1 < (int)local_238) goto LAB_009dd28d; iVar8 = -1 - (int)local_238; if ((iVar8 < 0) || (pvVar14 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar14 >> 2 <= iVar8)) { local_230 = (ItemConfig_Item *)0x0; } else { local_230 = (ItemConfig_Item *)**(undefined4 **)((int)pvVar14 + iVar8 * 4); } } } while (local_230 == (ItemConfig_Item *)0x0); } else { if ((int)local_238 < 0) { if (((int)local_238 < 0) && (pvVar14 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~(uint)local_238 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar14 >> 2)) { local_230 = (ItemConfig_Item *)**(undefined4 **)((int)pvVar14 + ~(uint)local_238 * 4); } else { local_230 = (ItemConfig_Item *)0x0; } } else { LAB_009dd205: pvVar14 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar14 >> 2 <= (int)local_238) goto LAB_009dd227; local_230 = *(ItemConfig_Item **)((int)pvVar14 + (int)local_238 * 4); } if (local_230 == (ItemConfig_Item *)0x0) goto LAB_009dd227; } auStack_1a4._20_4_ = 0.0; fStack_17c = 2.10195e-44; local_180 = 1; uStack_17e = 0; this = (byte ******)itemName[(int)&((ItemConfig_Item *)((int)VStack_228.y + -0xcc))->chargeType] ; auStack_1a4._20_4_ = (byte *****)0x1; local_248 = this; if (this != (byte ******)(auStack_1a4 + 0x14)) { std::string::_Tidy_deallocate((char *)this); *this = (byte *****)auStack_1a4._20_4_; this[1] = pppppbStack_18c; this[2] = pppppbStack_188; this[3] = pppppbStack_184; *(ulonglong *)(this + 4) = CONCAT44(fStack_17c,CONCAT22(uStack_17e,local_180)); } local_180 = 0; uStack_17e = 0; auStack_1a4._20_4_ = auStack_1a4._20_4_ & 0xffffff00; if (local_204 == (float *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_204 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)local_204; uVar21 = uVar21 << ((byte)local_178._shift2 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> ((byte)local_20c & 0x1f) ^ uVar21); if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)pIVar7; local_58 = pIVar7; uVar21 = uVar21 << ((byte)local_178._shift2 & 0x1f) ^ uVar21; uStack_54 = 0x150000000b; iVar8 = 0; VStack_214.y = (float)(uVar21 >> ((byte)local_20c & 0x1f) ^ uVar21); local_178._seed = (int)VStack_214.y; VStack_240.y = (float)((uint)VStack_214.y & 0x3f); pIStack_64 = (ItemConfig_Item *)((uint)VStack_214.y & 0x3f); ppppppbStack_5c = local_248; iStack_6c = 0; local_68 = (ItemConfig_Item *)0x0; puStack_60 = local_244; local_204 = (float *)&DAT_0000000d; pfStack_4c = (float *)&DAT_0000000d; if (0 < (int)local_244) { LAB_009dd400: ItemConfig_Item::GetLocalizedName(local_230,(std_string *)(auStack_1a4 + 0x14),0x14); local_14._0_1_ = 2; ItemConfig_Item::get_localized_description(local_230,(std_string *)local_3c,unused); local_14._0_1_ = 3; pIVar12 = local_230; while ((local_230 = pIVar12, (int)VStack_240.y < 0x20 && (0 < (int)local_244))) { if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> ((byte)uStack_54 & 0x1f) ^ (uint)pIVar7; uVar21 = uVar21 << ((byte)((ulonglong)uStack_54 >> 0x20) & 0x1f) ^ uVar21; local_218 = (ItemConfig_Item *)(uVar21 >> ((byte)local_204 & 0x1f) ^ uVar21); bVar15 = (byte)local_218; local_58 = local_218; if (iVar8 < 1) { if ((char)bVar15 < '\0') { bVar16 = bVar15 & 0x1f | 0xc2; if (((uint)local_218 & 0x1e) != 0) { bVar16 = bVar15 & 0x1f | 0xc0; } std::string::push_back((char *)local_248,bVar16); iVar8 = 1; iStack_6c = 1; } else { if (bVar15 == 0) { bVar15 = 1; } uVar21 = (uint)VStack_268.y >> 8; VStack_268.y = (float)CONCAT31((int3)uVar21,bVar15); std::string::push_back((char *)local_248,bVar15); } } else { std::string::push_back((char *)local_248,bVar15 & 0x3f | 0x80); iVar8 = iVar8 + -1; iStack_6c = iVar8; } VStack_240.y = (float)((int)(int *)VStack_240.y + 1); local_244 = local_244 + -1; pIStack_64 = (ItemConfig_Item *)VStack_240.y; puStack_60 = local_244; pIVar7 = local_218; pIVar12 = local_230; } local_68 = (ItemConfig_Item *)0x20; if ((int)local_244 < 1) { LAB_009dddbd: local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; auVar19 = local_3c; if (0xfff < uVar21) { auVar19 = *(undefined1 (*) [4])((int)local_3c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)auVar19))) goto LAB_009dfb4f; } operator_delete((void *)auVar19,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; shader = (undefined1 *)auStack_1a4._20_4_; goto LAB_009dde1d; } local_208 = (undefined1 *)(uint)(ushort)pIVar12->id; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') goto LAB_009dddbd; local_208 = (undefined1 *)(uint)local_180; cVar6 = utf8_string_writer_write(); shader = (undefined1 *)auStack_1a4._20_4_; if (cVar6 != '\0') goto LAB_009dddbd; local_208 = (undefined1 *)auStack_1a4._20_4_; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; auVar19 = local_3c; if (0xfff < uVar21) { auVar19 = *(undefined1 (*) [4])((int)local_3c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)auVar19))) goto LAB_009dfb4f; } operator_delete((void *)auVar19,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (0xfff < uVar21) { puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } LAB_009dd9e2: puVar10 = shader; goto LAB_009dde3d; } local_204 = (float *)((uint)KStack_38._alpha & 0xffff); cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; auVar19 = local_3c; if (0xfff < uVar21) { auVar19 = *(undefined1 (*) [4])((int)local_3c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)auVar19))) goto LAB_009dfb4f; } operator_delete((void *)auVar19,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } local_22c = (void *)local_3c; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } local_204 = (float *)(uint)(ushort)pIVar12->type; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } local_204 = (float *)(uint)(ushort)pIVar12->chargeType; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } local_204 = (float *)(uint)(ushort)pIVar12->_initCharge; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } local_204 = (float *)(uint)(ushort)pIVar12->maxCharges; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; puVar10 = *(undefined1 **)((undefined4)shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)((undefined4)shader + (-4 - (int)puVar10)) < (undefined1 *)0x20) goto LAB_009dde3d; goto LAB_009dfb4f; } local_204 = (float *)(uint)(ushort)pIVar12->maxCooldown; cVar6 = utf8_string_writer_write(); if (cVar6 != '\0') { local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if ((uint)fStack_17c < 0x10) goto LAB_009dde45; uVar21 = (int)fStack_17c + 1; if (uVar21 < 0x1000) goto LAB_009dd9e2; uVar21 = (int)fStack_17c + 0x24; puVar10 = (undefined1 *) ((undefined4)shader + (-4 - (int)*(undefined1 **)((undefined4)shader + -4))); shader = *(undefined1 **)((undefined4)shader + -4); if (&DAT_0000001f < puVar10) goto LAB_009dfb4f; goto LAB_009dd9e2; } local_230 = pIStack_64; local_204 = pfStack_4c; local_248 = ppppppbStack_5c; VStack_240.y = (float)&local_68->desc; local_218 = local_58; if ((int)pIStack_64 < (int)&local_68->desc) { iVar8 = iStack_6c; do { if ((int)puStack_60 < 1) break; local_244 = puStack_60; if (local_218 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_218 >> ((byte)uStack_54 & 0x1f) ^ (uint)local_218; uVar21 = uVar21 << ((byte)((ulonglong)uStack_54 >> 0x20) & 0x1f) ^ uVar21; local_218 = (ItemConfig_Item *)(uVar21 >> ((byte)local_204 & 0x1f) ^ uVar21); bVar15 = (byte)local_218; local_58 = local_218; if (iVar8 < 1) { if ((char)bVar15 < '\0') { bVar16 = bVar15 & 0x1f | 0xc2; if (((uint)local_218 & 0x1e) != 0) { bVar16 = bVar15 & 0x1f | 0xc0; } std::string::push_back((char *)local_248,bVar16); iVar8 = 1; iStack_6c = 1; } else { if (bVar15 == 0) { bVar15 = 1; } local_26c = (ColorMod *)CONCAT31(local_26c._1_3_,bVar15); std::string::push_back((char *)local_248,bVar15); } } else { std::string::push_back((char *)local_248,bVar15 & 0x3f | 0x80); iVar8 = iVar8 + -1; iStack_6c = iVar8; } local_230 = (ItemConfig_Item *)((int)&local_230->type + 1); puStack_60 = local_244 + -1; } while ((int)local_230 < (int)VStack_240.y); } local_68 = (ItemConfig_Item *)VStack_240.y; local_244 = puStack_60; if (0 < (int)puStack_60) { local_25c = &g_manager->_itemConfig; VStack_240.y = (float)((int)(g_manager->_itemConfig)._collectibles._end - (int)(local_25c->_collectibles)._begin >> 2); pIVar22 = local_238; do { pIVar22 = (ItemConfig *) ((uint)((int)&(pIVar22->_collectibles)._begin + 1U) % (uint)VStack_240.y); local_230 = ItemConfig::GetCollectible(local_25c,(int)pIVar22); iVar8 = iStack_6c; pIVar7 = local_218; } while (local_230 == (ItemConfig_Item *)0x0); VStack_240.y = 0.0; pIStack_64 = (ItemConfig_Item *)0x0; local_68 = (ItemConfig_Item *)0x0; local_14._0_1_ = 2; local_238 = pIVar22; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; if (0xf < (uint)fStack_17c) { uVar21 = (int)fStack_17c + 1; shader = local_208; if (0xfff < uVar21) { shader = *(undefined1 **)(local_208 + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)0x1f < local_208 + (-4 - (int)shader)) goto LAB_009dfb4f; } operator_delete(shader,uVar21); } goto LAB_009dd400; } local_14._0_1_ = 2; if (0xf < (uint)KStack_38._unk) { uVar21 = KStack_38._unk + 1; pvVar14 = local_22c; if (0xfff < uVar21) { pvVar14 = *(void **)((int)local_22c + -4); uVar21 = KStack_38._unk + 0x24; if (0x1f < (uint)((int)local_22c + (-4 - (int)pvVar14))) goto LAB_009dfb4f; } operator_delete(pvVar14,uVar21); } local_14._0_1_ = 1; KStack_38._alpha = 0.0; KStack_38._unk = 0xf; local_3c = (undefined1 [4])((uint)local_3c & 0xffffff00); if (0xf < (uint)fStack_17c) { shader = local_208; LAB_009dde1d: local_14._0_1_ = 1; KStack_38._unk = 0xf; KStack_38._alpha = 0.0; uVar21 = (int)fStack_17c + 1; puVar10 = shader; if (0xfff < uVar21) { puVar10 = *(undefined1 **)(shader + -4); uVar21 = (int)fStack_17c + 0x24; if ((undefined1 *)0x1f < shader + (-4 - (int)puVar10)) goto LAB_009dfb4f; } LAB_009dde3d: local_14._0_1_ = 1; KStack_38._unk = 0xf; KStack_38._alpha = 0.0; operator_delete(puVar10,uVar21); } LAB_009dde45: fStack_17c = 2.10195e-44; auStack_1a4._20_4_ = auStack_1a4._20_4_ & 0xffffff00; } pIVar7 = item; uStack_17e = 0; local_180 = 0; VStack_228.y = (float)((int)(int *)VStack_228.y + 1); param_1 = (ItemConfig_Item *)VStack_214.y; } while ((uint)VStack_228.y < (ItemConfig_Item *)0x2); if (&item->name != (std_string *)itemName) { strBuf = (byte *******)itemName; if (0xf < itemNameCapacity) { strBuf = itemName[0]; } std::string::assign((item->name)._buf,(byte *)strBuf,itemNameSize); } if (&pIVar7->desc != (std_string *)itemDesc) { strBuf = (byte *******)itemDesc; if (0xf < itemDescCapacity) { strBuf = itemDesc[0]; } std::string::assign((pIVar7->desc)._buf,(byte *)strBuf,itemDescSize); } RNG::Next(&local_178); switch((uint)local_178._seed % 0xe) { case 0: uVar21 = RNG::RandomInt(&local_178,6); uVar9 = RNG::RandomInt(&local_178,3); pIVar7->addMaxhearts = uVar21 - uVar9; uVar21 = RNG::RandomInt(&local_178,6); uVar9 = RNG::RandomInt(&local_178,3); pIVar7->addHearts = uVar21 - uVar9; break; case 1: uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addSoulHearts = uVar21; break; case 2: uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addBlackHearts = uVar21; break; case 3: uVar21 = RNG::RandomInt(&local_178,6); uVar9 = RNG::RandomInt(&local_178,3); pIVar7->addBombs = uVar21 - uVar9; break; case 4: uVar21 = RNG::RandomInt(&local_178,6); uVar9 = RNG::RandomInt(&local_178,3); pIVar7->addKeys = uVar21 - uVar9; break; case 5: uVar21 = RNG::RandomInt(&local_178,6); uVar9 = RNG::RandomInt(&local_178,6); uVar20 = RNG::RandomInt(&local_178,6); uVar11 = RNG::RandomInt(&local_178,6); pIVar7->addCoins = uVar11 + (uVar21 - uVar9) + uVar20; } pfVar23 = local_21c; local_21c[4] = 0.0; RNG::Next(&local_178); manager = g_manager; if ((local_178._seed & 1U) == 0) { uVar21 = RNG::RandomInt(&local_178, (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2); pIVar12 = ItemConfig::GetCollectible(&manager->_itemConfig,uVar21); LAB_009de0b7: local_21c[4] = (float)pIVar12; pfVar23 = local_21c; if (pIVar12 != (ItemConfig_Item *)0x0) { pIVar7->cacheFlags = pIVar7->cacheFlags | pIVar12->cacheFlags; } } else if ((local_178._seed & 1U) == 1) { uVar21 = RNG::RandomInt(&local_178, (int)(g_manager->_itemConfig)._trinkets._end - (int)(g_manager->_itemConfig)._trinkets._begin >> 2); pvVar14 = (manager->_itemConfig)._trinkets._begin; if ((int)(uVar21 & 0x7fff) < (int)(manager->_itemConfig)._trinkets._end - (int)pvVar14 >> 2) { pIVar12 = *(ItemConfig_Item **)((int)pvVar14 + (uVar21 & 0x7fff) * 4); goto LAB_009de0b7; } local_21c[4] = 0.0; pfVar23 = local_21c; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addMaxhearts = pIVar7->addMaxhearts + uVar21; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addHearts = pIVar7->addHearts + uVar21; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addSoulHearts = pIVar7->addSoulHearts + uVar21; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addBlackHearts = pIVar7->addBlackHearts + uVar21; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addBombs = pIVar7->addBombs + uVar21; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addKeys = pIVar7->addKeys + uVar21; } RNG::Next(&local_178); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)(((uint)local_178._seed / 0x28) * 0x28)) { uVar21 = RNG::RandomInt(&local_178,6); pIVar7->addCoins = pIVar7->addCoins + uVar21; } pIVar7->addMaxhearts = pIVar7->addMaxhearts & 0xfffffffe; pfVar23[5] = 0.0; pfVar23[6] = 0.0; pfVar23[7] = 0.0; pfVar23[8] = 0.0; pfVar23[9] = 0.0; pfVar23[10] = 0.0; VStack_240.y = 0.0; if ((pIVar7->cacheFlags != 0) || (uVar21 = 5, 0 < pIVar7->addMaxhearts)) { uVar21 = 0x14; } uVar21 = RNG::RandomInt(&local_178,uVar21); if (uVar21 == 0) { uVar21 = 0; auStack_1a4._20_4_ = (undefined1 *)0x0; pppppbStack_18c = (byte *****)0x1; pppppbStack_188 = (byte *****)0x2; pppppbStack_184 = (byte *****)0x3; local_180 = 4; uStack_17e = 0; fStack_17c = 7.00649e-45; local_3c = (undefined1 [4])0x1; KStack_38._red = 2.8026e-45; KStack_38._green = 2.24208e-44; KStack_38._blue = 1.12104e-44; do { uVar9 = RNG::RandomInt(&local_178,6 - uVar21); uVar9 = uVar9 + uVar21; if (uVar9 != uVar21) { uVar1 = *(undefined4 *)(auStack_1a4 + uVar21 * 4 + 0x14); *(undefined4 *)(auStack_1a4 + uVar21 * 4 + 0x14) = *(undefined4 *)(auStack_1a4 + uVar9 * 4 + 0x14); *(undefined4 *)(auStack_1a4 + uVar9 * 4 + 0x14) = uVar1; } uVar21 = uVar21 + 1; } while (uVar21 < 5); if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } bVar15 = (byte)local_178._shift1; uVar21 = (uint)local_178._seed >> (bVar15 & 0x1f) ^ local_178._seed; bVar16 = (byte)local_178._shift2; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; bVar17 = (byte)local_178._shift3; local_218 = (ItemConfig_Item *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); if (local_218 == (ItemConfig_Item *)(((uint)local_218 / 0x28) * 0x28)) { local_204 = local_21c + 5; VStack_228.y = (float)&DAT_00000006; do { if (local_218 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_218 >> (bVar15 & 0x1f) ^ (uint)local_218; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; local_208 = (undefined1 *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); VStack_214.y = (float)((double)(int)local_208 + __uint_to_double_fixup[-((int)local_208 >> 0x1f)]) * 2.3283062e-10; if (local_208 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_208 >> (bVar15 & 0x1f) ^ (uint)local_208; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; pIVar12 = (ItemConfig_Item *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); local_218 = pIVar12; *local_204 = (float)((double)(int)pIVar12 + __uint_to_double_fixup[-((int)pIVar12 >> 0x1f)]) * 2.3283062e-10 + VStack_214.y; VStack_228.y = (float)((int)&((ItemConfig_Item *)((int)VStack_228.y + -0xcc))->_initCharge + 3); local_204 = local_204 + 1; } while ((ItemConfig_Item *)VStack_228.y != (ItemConfig_Item *)0x0); } else { if (local_218 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_218 >> (bVar15 & 0x1f) ^ (uint)local_218; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; local_20c = (ItemConfig_Item *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); fVar13 = (float)((double)(int)local_20c + __uint_to_double_fixup[-((int)local_20c >> 0x1f)]) * 2.3283062e-10 + 0.25; local_21c[(int)(auStack_1a4._20_4_ + 5)] = fVar13; if (fVar13 < 0.5) { LAB_009de603: if (local_20c == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_20c >> (bVar15 & 0x1f) ^ (uint)local_20c; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; local_178._seed = uVar21 >> (bVar17 & 0x1f) ^ uVar21; local_21c[(int)pppppbStack_18c + 5] = (float)((double)local_178._seed + __uint_to_double_fixup[-(local_178._seed >> 0x1f)]) * 2.3283062e-10 + 0.25; } else { if (local_20c == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_20c >> (bVar15 & 0x1f) ^ (uint)local_20c; uVar21 = uVar21 << (bVar16 & 0x1f) ^ uVar21; local_20c = (ItemConfig_Item *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); local_178._seed = (int)local_20c; if (((uint)local_20c & 7) == 0) goto LAB_009de603; } uVar21 = 5; if (1.0 < local_21c[(int)pppppbStack_18c + 5] + local_21c[(int)(auStack_1a4._20_4_ + 5)]) { uVar21 = 2; } uVar21 = RNG::RandomInt(&local_178,uVar21); pIVar12 = (ItemConfig_Item *)local_178._seed; if (uVar21 == 0) { if ((ItemConfig_Item *)local_178._seed == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_178._seed >> ((byte)local_178._shift1 & 0x1f) ^ local_178._seed; uVar21 = uVar21 << ((byte)local_178._shift2 & 0x1f) ^ uVar21; pIVar12 = (ItemConfig_Item *)(uVar21 >> ((byte)local_178._shift3 & 0x1f) ^ uVar21); local_21c[(int)pppppbStack_188 + 5] = 0.1 - (float)((double)(int)pIVar12 + __uint_to_double_fixup[-((int)pIVar12 >> 0x1f)]) * 2.3283062e-10 * 0.5; } } if (local_21c[5] != 0.0) { item->cacheFlags = item->cacheFlags | (uint)local_3c; } if (local_21c[6] != 0.0) { item->cacheFlags = item->cacheFlags | (uint)KStack_38._red; } if (local_21c[7] != 0.0) { item->cacheFlags = item->cacheFlags | (uint)KStack_38._green; } if (local_21c[8] != 0.0) { item->cacheFlags = item->cacheFlags | (uint)KStack_38._blue; } if (local_21c[9] != 0.0) { item->cacheFlags = item->cacheFlags | 4; } pIVar7 = item; if (local_21c[10] != 0.0) { item->cacheFlags = item->cacheFlags | 0x400; } } else { pIVar12 = (ItemConfig_Item *)local_178._seed; } bVar15 = (byte)local_178._shift3; bVar16 = (byte)local_178._shift1; bVar17 = (byte)local_178._shift2; if (local_21d == false) { if (pIVar12 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar12 >> (bVar16 & 0x1f) ^ (uint)pIVar12; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; local_208 = (undefined1 *)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); VStack_214.y = (float)((double)(int)local_208 + __uint_to_double_fixup[-((int)local_208 >> 0x1f)]) * 2.3283062e-10; if (local_208 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_208 >> (bVar16 & 0x1f) ^ (uint)local_208; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; local_208 = (undefined1 *)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); local_20c = (ItemConfig_Item *) ((float)((double)(int)local_208 + __uint_to_double_fixup[-((int)local_208 >> 0x1f)]) * 2.3283062e-10); if (local_208 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_208 >> (bVar16 & 0x1f) ^ (uint)local_208; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); local_20c = (ItemConfig_Item *) ((float)local_20c + VStack_214.y + (float)((double)(int)pIVar7 + __uint_to_double_fixup[-((int)pIVar7 >> 0x1f)]) * 2.3283062e-10); } else { pIVar7->type = 3; local_88[0] = 0.0; local_88[1] = 1.4013e-45; local_88[2] = 2.8026e-45; local_88[3] = 2.8026e-45; local_88[4] = 4.2039e-45; local_88[5] = 4.2039e-45; local_88[6] = 4.2039e-45; iStack_6c = 4; local_68 = (ItemConfig_Item *)&DAT_00000004; pIStack_64 = (ItemConfig_Item *)&DAT_00000004; puStack_60 = (undefined1 *)0x6; ppppppbStack_5c = (byte ******)&DAT_00000006; local_58 = (ItemConfig_Item *)&DAT_00000006; uStack_54 = 0x12c0000000c; pfStack_4c = (float *)0x258; if (pIVar12 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar12 >> (bVar16 & 0x1f) ^ (uint)pIVar12; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; VStack_228.y = (float)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); local_208 = (undefined1 *)local_88[(uint)VStack_228.y & 0xf]; item->maxCharges = (int)local_208; item->_initCharge = (int)local_208; if ((int)local_208 < 0xd) { item->chargeType = 0; if ((ItemConfig_Item *)VStack_228.y == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)VStack_228.y >> (bVar16 & 0x1f) ^ (uint)VStack_228.y; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); fVar13 = (float)((double)(int)pIVar7 + __uint_to_double_fixup[-((int)pIVar7 >> 0x1f)]) * 2.3283062e-10 * (float)(int)local_208; local_20c = (ItemConfig_Item *)(fVar13 + fVar13 + 1.0); } else { item->chargeType = 1; if ((ItemConfig_Item *)VStack_228.y == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)VStack_228.y >> (bVar16 & 0x1f) ^ (uint)VStack_228.y; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; local_208 = (undefined1 *)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); VStack_214.y = (float)((double)(int)local_208 + __uint_to_double_fixup[-((int)local_208 >> 0x1f)]) * 2.3283062e-10; if (local_208 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_208 >> (bVar16 & 0x1f) ^ (uint)local_208; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> (bVar15 & 0x1f) ^ uVar21); local_20c = (ItemConfig_Item *) ((float)((double)(int)pIVar7 + __uint_to_double_fixup[-((int)pIVar7 >> 0x1f)]) * 2.3283062e-10 + VStack_214.y); } } local_204 = (float *)0x0; fVar13 = 0.0; do { if (((float)local_20c <= fVar13) || (fVar13 = local_21c[0xc], 7 < (uint)((int)fVar13 - (int)local_21c[0xb] >> 2))) break; bVar15 = (byte)local_178._shift1; bVar16 = (byte)local_178._shift3; bVar17 = (byte)local_178._shift2; if (item->type == 3) { VStack_228.y = 0.0; } else { pppppbStack_184 = (byte *****)0x5; local_180 = 6; uStack_17e = 0; fStack_17c = 9.80909e-45; local_208 = (undefined1 *)fVar13; auStack_1a4._16_4_ = 1.4013e-45; auStack_1a4._20_4_ = (undefined1 *)0x2; pppppbStack_18c = (byte *****)0x3; pppppbStack_188 = (byte *****)0x4; if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> (bVar15 & 0x1f) ^ (uint)pIVar7; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> (bVar16 & 0x1f) ^ uVar21); VStack_228.y = (float)*(ItemConfig_Item **)(auStack_1a4 + ((uint)pIVar7 % 7) * 4 + 0x10); } if (local_21c[0xb] != fVar13) { if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> (bVar15 & 0x1f) ^ (uint)pIVar7; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> (bVar16 & 0x1f) ^ uVar21); if (((uint)pIVar7 & 3) != 0) { VStack_228.y = (float)&DAT_00000008; } } apvStack_44[0] = (void *)0x0; apvStack_44[1] = (void *)0x0; local_3c = (undefined1 [4])0x1; KStack_38._red = 1.4013e-45; KStack_38._green = 2.8026e-45; KStack_38._blue = 4.2039e-45; KStack_38._alpha = 5.60519e-45; KStack_38._unk = 5; if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> (bVar15 & 0x1f) ^ (uint)pIVar7; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; local_208 = (undefined1 *)(uVar21 >> (bVar16 & 0x1f) ^ uVar21); VStack_214.y = (float)apvStack_44[(uint)local_208 & 7]; pIVar22 = operator_new(0x68); local_25c = pIVar22; if (pIVar22 == (ItemConfig *)0x0) { pIVar22 = (ItemConfig *)0x0; } else { memset(pIVar22,0,0x68); (pIVar22->_nullItems)._capacity = (void *)0x0; (pIVar22->_cards)._begin = (void *)0x0; (pIVar22->_cards)._end = (void *)0x0; (pIVar22->_cards)._capacity = (void *)0x0; Color::Color((Color *)&(pIVar22->_pillEffects)._end); } local_238 = pIVar22; if (local_208 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_208 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)local_208; uVar21 = uVar21 << (bVar17 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> ((byte)local_178._shift3 & 0x1f) ^ uVar21); ProceduralEffect::roll_params(VStack_228.y); if ((local_204 == (float *)0x63) || (VStack_240.y + (float)(pIVar22->_wispGfxRoot)._size < (float)local_20c)) { LAB_009ded9d: if ((pIVar22->_collectibles)._begin == (void *)0x6) { local_254.y = (float)((uint)(pIVar22->_trinkets)._begin & 0xffff); if (local_254.y == 9.18341e-41) { local_254.y = -NAN; } local_254.x = (float)(uint)*(ushort *)((int)&(pIVar22->_trinkets)._begin + 2); FUN_009e24f0(); } if ((undefined4 *)local_21c[0xc] == (undefined4 *)local_21c[0xd]) { std::vector<4byte>::_Emplace_reallocate(); pIVar22 = local_238; } else { *(undefined4 *)local_21c[0xc] = pIVar22; local_21c[0xc] = (float)((int)local_21c[0xc] + 4); } VStack_240.y = VStack_240.y + (float)(pIVar22->_wispGfxRoot)._size; } else { if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)pIVar7; uVar21 = uVar21 << ((byte)local_178._shift2 & 0x1f) ^ uVar21; pIVar7 = (ItemConfig_Item *)(uVar21 >> ((byte)local_178._shift3 & 0x1f) ^ uVar21); if (pIVar7 == (ItemConfig_Item *)(((uint)pIVar7 / 0x14) * 0x14)) goto LAB_009ded9d; operator_delete(pIVar22,0x68); } local_204 = (float *)((int)local_204 + 1); fVar13 = VStack_240.y; } while (local_204 < 100); local_20c = pIVar7; KAGE_LogMessage(1,(byte *)"initialized with %d effects (score: %g)\n"); pfVar23 = local_21c; uVar21 = 0; if ((int)local_21c[0xc] - (int)local_21c[0xb] >> 2 != 0) { do { func_0x009e1c30(); local_14._0_1_ = 4; KAGE_LogMessage(1,&DAT_00b6ec00); local_14._0_1_ = 1; std::string::_Tidy_deallocate(auStack_1a4 + 0x14); uVar21 = uVar21 + 1; } while (uVar21 < (uint)((int)pfVar23[0xc] - (int)pfVar23[0xb] >> 2)); pIVar7 = local_20c; } if (pIVar7 == (ItemConfig_Item *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)pIVar7 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)pIVar7; bVar15 = (byte)local_178._shift2; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; bVar16 = (byte)local_178._shift3; local_208 = (undefined1 *)(uVar21 >> (bVar16 & 0x1f) ^ uVar21); item->devilprice = ((ushort)local_208 & 1) + 1; if (local_208 == (undefined1 *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_208 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)local_208; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; local_204 = (float *)(uVar21 >> (bVar16 & 0x1f) ^ uVar21); item->shopPrice = (short)local_204 + (short)((uint)local_204 / 99) * -99 + 1; if (local_204 == (float *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_204 >> ((byte)local_178._shift1 & 0x1f) ^ (uint)local_204; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; VStack_228.y = (float)(uVar21 >> (bVar16 & 0x1f) ^ uVar21); local_178._seed = (int)VStack_228.y; bVar16 = (byte)local_178._shift1; if (((uint)VStack_228.y & 1) == 0) { fVar13 = (float)RNG::RandomInt(&local_178, ((int)(g_manager->_sfxManager)._sounds._end - (int)(g_manager->_sfxManager)._sounds._begin) / 0x1b8); pvVar14 = (g_manager->_sfxManager)._sounds._begin; if (*(int *)((int)pvVar14 + (int)fVar13 * 0x1b8 + 400) != 0) { _Str1 = (char *)((int)pvVar14 + (int)fVar13 * 0x1b8 + 8); if (0xf < *(uint *)((int)pvVar14 + (int)fVar13 * 0x1b8 + 0x1c)) { _Str1 = *(char **)_Str1; } iVar8 = _strnicmp(_Str1,"sfx/voiceover",0xd); if (iVar8 != 0) { local_21c[3] = fVar13; } } bVar15 = (byte)local_178._shift2; bVar16 = (byte)local_178._shift1; } local_254.x = 0.0; local_254.y = 0.0; VStack_228.y = (float)local_178._seed; std::vector::resize(&local_254); VStack_214.y = (float)std::deque::back(); if ((byte *)((int)VStack_214.y + 4) != (byte *)0x0) { *(byte *)((int)VStack_214.y + 4) = (byte)(g_graphicsManager_flags >> 5) & 1; } *(void **)VStack_214.y = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)procManager[3],0); BlendMode::SetMode(&KStack_38,1,unusedArg); g_graphicsManager_blendMode[0] = *extraout_EAX; g_graphicsManager_blendMode[1] = extraout_EAX[1]; g_graphicsManager_blendMode[2] = extraout_EAX[2]; g_graphicsManager_blendMode[3] = extraout_EAX[3]; g_graphicsManager_blendMode[4] = extraout_EAX[4]; shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } local_218 = (ItemConfig_Item *)0x0; g_currentShader = shader; if (VStack_228.y == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)VStack_228.y >> (bVar16 & 0x1f) ^ (uint)VStack_228.y; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; bVar17 = (byte)local_178._shift3; local_22c = (void *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); if (local_22c == (void *)(((uint)local_22c / 5) * 5)) { if (local_22c == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_22c >> (bVar16 & 0x1f) ^ (uint)local_22c; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; local_22c = (void *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); local_218 = (ItemConfig_Item *)((uint)local_22c & 0x3f); } local_204 = (float *)0x0; local_20c = (ItemConfig_Item *)0x0; if (local_22c == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_22c >> (bVar16 & 0x1f) ^ (uint)local_22c; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; local_178._seed = uVar21; if (uVar21 % 5 == 0) { uVar9 = Random(); local_20c = (ItemConfig_Item *)(uVar9 % 3 + 1); } VStack_240.y = (float)&IStack_167; VStack_228.y = 0.0; pIVar7 = local_20c; do { if (((uint)VStack_228.y & 0xfffffff8) < 0x39) { pIVar12 = (ItemConfig_Item *)((int)&local_218->type + 1); *(char *)((int)&((ItemConfig_Item *)((int)VStack_240.y + -0xcc))->_initCharge + 3) = (char)local_218; *(char *)(int *)VStack_240.y = (char)local_204; *(char *)((int)(int *)VStack_240.y + 1) = (char)pIVar7; local_218 = pIVar12; if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = uVar21 >> (bVar16 & 0x1f) ^ uVar21; bVar15 = (byte)local_178._shift2; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; bVar17 = (byte)local_178._shift3; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; if (uVar21 == (uVar21 / 0xc) * 0xc) { if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = uVar21 >> (bVar16 & 0x1f) ^ uVar21; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; local_20c = (ItemConfig_Item *)(uVar21 & 3); } if ((int)pIVar12 < 0x40) { if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = uVar21 >> (bVar16 & 0x1f) ^ uVar21; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; pIVar7 = local_20c; local_178._seed = uVar21; if (uVar21 != (uVar21 / 0xc) * 0xc) goto LAB_009df4cc; } local_204 = (float *)((int)local_204 + 1U & 0x80000003); if ((int)local_204 < 0) { local_204 = (float *)(((int)local_204 - 1U | 0xfffffffc) + 1); } local_218 = (ItemConfig_Item *)VStack_228.y; if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = uVar21 >> (bVar16 & 0x1f) ^ uVar21; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; local_238 = (ItemConfig *)(uVar21 >> (bVar17 & 0x1f) ^ uVar21); if ((uint)local_238 % 0x14 == 0) { local_218 = (ItemConfig_Item *)((int)(int *)VStack_228.y + 1); } local_20c = (ItemConfig_Item *)0x0; if (local_238 == (ItemConfig *)0x0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_238 >> (bVar16 & 0x1f) ^ (uint)local_238; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; pIVar7 = local_20c; local_178._seed = uVar21; if (uVar21 == (uVar21 / 5) * 5) { if (uVar21 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = uVar21 >> (bVar16 & 0x1f) ^ uVar21; uVar21 = uVar21 << (bVar15 & 0x1f) ^ uVar21; uVar21 = uVar21 >> (bVar17 & 0x1f) ^ uVar21; local_20c = (ItemConfig_Item *)(uVar21 % 3 + 1); pIVar7 = local_20c; local_178._seed = uVar21; } } else { *(undefined2 *)((int)&((ItemConfig_Item *)((int)VStack_240.y + -0xcc))->_initCharge + 3) = 0xffff; *(undefined1 *)((int)(int *)VStack_240.y + 1) = 0; } LAB_009df4cc: VStack_240.y = (float)((int)(int *)VStack_240.y + 3); VStack_228.y = (float)((int)(int *)VStack_228.y + 1); } while ((int)VStack_228.y < 0x40); _eh_vector_constructor_iterator_ ((void *)((int)&IStack_167.tags + 7),8,4,(_func_void_void_ptr *)&LAB_0040c5b0, FUN_0040c440); local_14 = CONCAT31(local_14._1_3_,5); local_204 = (float *)0x0; do { iVar8 = 0; do { manager = g_manager; uVar21 = RNG::RandomInt(&local_178, ((int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2) - 1); pIVar7 = ItemConfig::GetCollectible(&manager->_itemConfig,uVar21 + 1); if ((pIVar7 != (ItemConfig_Item *)0x0) && ((pIVar7->gfxFilename)._size != 0)) { path = &pIVar7->gfxFilename; if (0xf < (pIVar7->gfxFilename)._capacity) { path = *(std_string **)path->_buf; } pvVar14 = Manager::LoadImage(&VStack_214,(byte *)path); local_14._0_1_ = 6; imageRef = KAGE::SmartPointer::operator_assign(&local_254,pvVar14); pfVar23 = local_204; uVar1 = imageRef[1]; imageRef[1] = *(undefined4 *)((int)(&IStack_167.costume + 1) + (int)local_204 * 8 + 0x17); uVar3 = *(undefined4 *)((int)(&IStack_167.costume + 1) + (int)local_204 * 8 + 0x13); *(undefined4 *)((int)(&IStack_167.costume + 1) + (int)local_204 * 8 + 0x17) = uVar1; uVar1 = *imageRef; *imageRef = uVar3; *(undefined4 *)((int)(&IStack_167.costume + 1) + (int)local_204 * 8 + 0x13) = uVar1; local_14._0_1_ = 7; if ((((int *)local_254.y != (int *)0x0) && (cVar6 = (**(code **)(*(int *)local_254.y + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 8; if ((((int *)VStack_214.y != (int *)0x0) && (cVar6 = (**(code **)(*(int *)VStack_214.y + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14 = CONCAT31(local_14._1_3_,5); goto LAB_009df56b; } iVar8 = iVar8 + 1; } while (iVar8 < 10); pfVar23 = local_204; LAB_009df56b: local_204 = (float *)((int)pfVar23 + 1); } while ((int)local_204 < 4); if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c9437c) && (_Init_thread_header(), DAT_00c9437c == -1)) { Color::Color((Color *)&DAT_00c94380); _Init_thread_footer(); } Color::Color(&displayColor); if (local_178._seed == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar4 = (code *)swi(3); iVar8 = (*pcVar4)(); return iVar8; } uVar21 = (uint)local_178._seed >> ((byte)local_178._shift1 & 0x1f) ^ local_178._seed; uVar21 = uVar21 << ((byte)local_178._shift2 & 0x1f) ^ uVar21; uVar21 = uVar21 >> ((byte)local_178._shift3 & 0x1f) ^ uVar21; hueColor = hsv_to_rgb(&KStack_38, (float)((double)(int)uVar21 + __uint_to_double_fixup[-((int)uVar21 >> 0x1f)] ) * 2.3283062e-10 * 360.0,1.0,1.0,1.0); pfVar23 = (float *)((int)&IStack_167.type + 1); local_178._seed = (int)&DAT_00c94380; uVar21 = 0; local_178._shift2 = (int)&displayColor; local_178._shift1 = (int)&DAT_00c5d400; displayColor._colorize[0] = hueColor->_red; displayColor._colorize[1] = hueColor->_green; displayColor._colorize[2] = hueColor->_blue; displayColor._colorize[3] = hueColor->_alpha; local_178._shift3 = (int)&DAT_00c5d42c; local_204 = pfVar23; do { shader = &DAT_42000000; fVar13 = 4.0; VStack_214.y = (float)(uVar21 >> 3); local_25c = (ItemConfig *)(uVar21 & 7); bVar15 = *(byte *)((int)pfVar23 + -1); local_204 = pfVar23; if (bVar15 != 0xff) { local_208 = (undefined1 *)(uint)bVar15; if (*(int *)((int)(&IStack_167.costume + 1) + (int)(uint)bVar15 * 8 + 0x13) != 0) { uVar9 = *(byte *)((int)pfVar23 + -2) & 7; local_254.x = 4.0; local_254.y = 4.0; VStack_268.x = (float)(*(byte *)((int)pfVar23 + -2) >> 3) * 4.0; VStack_268.y = (float)uVar9 * 4.0; quad_set_rect(&iStack_6c,&VStack_268,&local_254,uVar9); KColor::SetFromARGB(&KStack_38,0xffffffff); VStack_228.x = 4.0; VStack_228.y = 4.0; uVar9 = ~item->id; uVar20 = uVar9 & 0x8000001f; if ((int)uVar20 < 0) { uVar20 = (uVar20 - 1 | 0xffffffe0) + 1; } VStack_240.x = (float)(int)uVar20 * (float)shader + (float)(int)VStack_214.y * fVar13; VStack_240.y = (float)((int)(uVar9 + ((int)uVar9 >> 0x1f & 0x1fU)) >> 5) * (float)shader + (float)(int)local_25c * fVar13; render_quad_set_rect(auStack_2e0,&VStack_240,&VStack_228,&KStack_38); local_26c = *(ColorMod **)(IStack_167.name._buf + (uint)*(byte *)pfVar23 * 4 + -0x19); pIVar22 = (ItemConfig *)0x0; imageRefCount = (int *)0x0; VStack_214.y = *(float *)((int)(&IStack_167.costume + 1) + (int)local_208 * 8 + 0x17); local_25c = *(ItemConfig **)((int)(&IStack_167.costume + 1) + (int)local_208 * 8 + 0x13); if ((int *)VStack_214.y != (int *)0x0) { cVar6 = (**(code **)(*(int *)VStack_214.y + 4))(); if (cVar6 != '\0') { if (((imageRefCount != (int *)0x0) && (cVar6 = (**(code **)(*imageRefCount + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStack_2ea + -10); } pIVar22 = local_25c; imageRefCount = (int *)VStack_214.y; } } pCVar5 = local_26c; apply_sprite_shader_params(local_26c,1,pIVar22,imageRefCount); KStack_38._red = pCVar5->_tint[0]; KStack_38._green = pCVar5->_tint[1]; KStack_38._blue = pCVar5->_tint[2]; KStack_38._alpha = pCVar5->_tint[3]; KStack_38._unk = 0; (**(code **)(**(int **)((int)(&IStack_167.costume + 1) + (int)local_208 * 8 + 0x13) + 0x14)) (&iStack_6c); } } uVar21 = uVar21 + 1; pfVar23 = (float *)((int)local_204 + 3); local_204 = pfVar23; } while ((int)uVar21 < 0x40); _glfw_context_reset(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)procManager[5],0); BlendMode::SetMode(&KStack_38,1,unusedArg_00); g_graphicsManager_blendMode[0] = *extraout_EAX_00; g_graphicsManager_blendMode[1] = extraout_EAX_00[1]; g_graphicsManager_blendMode[2] = extraout_EAX_00[2]; g_graphicsManager_blendMode[3] = extraout_EAX_00[3]; g_graphicsManager_blendMode[4] = extraout_EAX_00[4]; shader = &g_shaders; if ((DAT_00c7911c & 1) == 0) { shader = g_currentShader; } g_currentShader = shader; Manager::LoadImage(&piStack_260,(byte *)"gfx/ui/mod_defaults.png"); local_14._0_1_ = 9; fVar13 = 16.0; local_254.x = 16.0; local_254.y = 16.0; VStack_214.x = 0.0; VStack_214.y = 0.0; quad_set_rect(&iStack_6c,&VStack_214,&local_254,unused_00); KColor::SetFromARGB(&KStack_38,0xffffffff); local_254.x = 32.0; local_254.y = 32.0; uVar21 = ~item->id; uVar9 = uVar21 & 0x8000001f; if ((int)uVar9 < 0) { uVar9 = (uVar9 - 1 | 0xffffffe0) + 1; } VStack_214.x = (float)(int)uVar9 * fVar13; size = &local_254; VStack_214.y = (float)((int)(uVar21 + ((int)uVar21 >> 0x1f & 0x1fU)) >> 5) * fVar13; render_quad_set_rect(auStack_2e0,&VStack_214,size,&KStack_38); pvVar14 = (void *)0x9dfa09; Color::Color((Color *)auStack_1a4); KAGE::SmartPointer::operator_assign(auStack_2ea + -10,&piStack_260); apply_sprite_shader_params(color,1,size,pvVar14); (**(code **)(*piStack_260 + 0x14))(&iStack_6c); local_14._0_1_ = 10; if (((local_25c != (ItemConfig *)0x0) && (cVar6 = (**(code **)((int)(local_25c->_collectibles)._begin + 0xc))(), cVar6 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } local_14._0_1_ = 5; _glfw_context_reset(); pop_render_target(); shader_cache_find(unusedArg_01); InfoDisplay::add_item_entry(); iVar8 = procManager[1]; iVar2 = *procManager; local_14._0_1_ = 1; _eh_vector_destructor_iterator_((void *)((int)&IStack_167.tags + 7),8,4,FUN_0040c440); if (0xf < itemDescCapacity) { uVar21 = itemDescCapacity + 1; strBuf = itemDesc[0]; if (0xfff < uVar21) { strBuf = (byte *******)itemDesc[0][-1]; uVar21 = itemDescCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)itemDesc[0] + (-4 - (int)strBuf))) goto LAB_009dfb4f; } operator_delete(strBuf,uVar21); } itemDescSize = 0; itemDescCapacity = 0xf; itemDesc[0] = (byte *******)((uint)itemDesc[0] & 0xffffff00); if (0xf < itemNameCapacity) { uVar21 = itemNameCapacity + 1; strBuf = itemName[0]; if (0xfff < uVar21) { strBuf = (byte *******)itemName[0][-1]; uVar21 = itemNameCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)itemName[0] + (-4 - (int)strBuf))) { LAB_009dfb4f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(strBuf,uVar21); } ExceptionList = local_1c; return -(iVar8 - iVar2 >> 2); } //@@ 009dfc90 glitched_collectible_render_gfx /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from ItemPool::CreateGlitchedCollectible: Manager::LoadImage "gfx/promo/gfuel/ui/death items.png" (!), SetRenderTarget, shader_cache_find, render_quad_set_rect, pop_render_target: composes the glitched item sprite */ int glitched_collectible_render_gfx(int param_1,int param_2,undefined4 param_3,int param_4) { int iVar1; char cVar2; undefined4 *puVar3; uint uVar4; ColorMod *color; undefined *puVar5; int *in_ECX; byte *path; int unused; uint uVar6; int unusedArg; int iVar7; undefined1 *puVar8; float fVar9; Vector *pVVar10; void *pvVar11; KColor *color_00; undefined1 auStack_1aa [2]; undefined1 local_19c [112]; undefined1 local_12c [112]; KColor local_bc; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined1 local_88; int *local_84; int *local_80; Vector local_7c; Vector local_74; Color local_6c; ColorMod local_40; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; local_8 = -NAN; puStack_c = &LAB_00b0f715; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&local_40)[1]._colorize; ExceptionList = &local_10; local_74.y = (float)operator_new(0x38); if ((void *)local_74.y == (void *)0x0) { local_74.y = 0.0; } else { local_74.y = (float)GlitchedCollectibleGfx::constructor(); } if ((float *)in_ECX[1] == (float *)in_ECX[2]) { std::vector<4byte>::_Emplace_reallocate(); } else { *(float *)in_ECX[1] = local_74.y; in_ECX[1] = in_ECX[1] + 4; } iVar7 = in_ECX[1]; iVar1 = *in_ECX; *(int *)local_74.y = param_2; *(int *)((int)local_74.y + 4) = (iVar7 - iVar1 >> 2) + -1; *(int *)((int)local_74.y + 8) = param_1; *(int *)((int)local_74.y + 0x10) = param_4; if (param_4 != 0) { *(uint *)(param_2 + 0x54) = *(uint *)(param_2 + 0x54) | *(uint *)(param_4 + 0x54); } local_7c.x = 0.0; local_7c.y = 0.0; *(int *)(param_2 + 4) = -(in_ECX[1] - *in_ECX >> 2); std::vector::resize(&local_7c); puVar3 = std::deque::back(); if ((byte *)(puVar3 + 1) != (byte *)0x0) { *(byte *)(puVar3 + 1) = (byte)(g_graphicsManager_flags >> 5) & 1; } *puVar3 = g_graphicsManager_renderTarget; KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)in_ECX[3],0); g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[1] = 1; g_graphicsManager_blendMode[2] = 7; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[3] = 1; path = (byte *)(param_2 + 0x38); puVar5 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar5 = g_currentShader; } g_graphicsManager_blendMode[4] = 7; if (0xf < *(uint *)(param_2 + 0x4c)) { path = *(byte **)(param_2 + 0x38); } g_currentShader = puVar5; Manager::LoadImage(&local_84,path); local_8 = 0.0; puVar8 = &DAT_42000000; if (local_84 != (int *)0x0) { local_74.x = (float)&DAT_42000000; local_74.y = (float)&DAT_42000000; local_7c.x = 0.0; local_7c.y = 0.0; quad_set_rect(local_40._tint + 2,&local_7c,&local_74,unused); KColor::SetFromARGB(&local_bc,0xffffffff); uVar4 = ~*(uint *)(param_2 + 4); local_7c.x = 32.0; local_7c.y = 32.0; uVar6 = uVar4 & 0x8000001f; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xffffffe0) + 1; } local_74.x = (float)(int)uVar6 * (float)puVar8; pVVar10 = &local_7c; local_74.y = (float)((int)(uVar4 + ((int)uVar4 >> 0x1f & 0x1fU)) >> 5) * (float)puVar8; render_quad_set_rect(local_12c,&local_74,pVVar10,&local_bc); pvVar11 = (void *)0x9dfea4; Color::Color(&local_6c); KAGE::SmartPointer::operator_assign(auStack_1aa + -10,&local_84); apply_sprite_shader_params(color,1,pVVar10,pvVar11); (**(code **)(*local_84 + 0x14))(local_40._tint + 2); } iVar7 = 1; std::string::assign((char *)(param_2 + 0x38),&s_empty,0); _glfw_context_reset(); KAGE_Graphics::SetRenderTarget(&DAT_00c798e0,(void *)in_ECX[5],0); if ((g_graphicsManager_flags & 4) == 0) { iVar7 = 6; } g_graphicsManager_blendMode[0] = 0; puVar5 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar5 = g_currentShader; } g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; g_currentShader = puVar5; g_graphicsManager_blendMode[1] = iVar7; pvVar11 = Manager::LoadImage(&local_7c,(byte *)"gfx/promo/gfuel/ui/death items.png"); local_8._0_1_ = 1; KAGE::SmartPointer::operator_assign(&local_84,pvVar11); local_8._0_1_ = 2; if ((int *)local_7c.y != (int *)0x0) { cVar2 = (**(code **)(*(int *)local_7c.y + 0xc))(); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_8 = (float)((uint)local_8._1_3_ << 8); fVar9 = 16.0; local_98 = 0; local_9c = 0; local_a8 = 0; local_a4 = 0; local_a0 = 0x41800000; local_94 = 0x41800000; local_90 = 0x41800000; local_8c = 0x41800000; local_88 = 1; KColor::SetFromARGB(&local_bc,0xffffffff); uVar4 = ~*(uint *)(param_2 + 4); local_7c.x = 32.0; local_7c.y = 32.0; uVar6 = uVar4 & 0x8000001f; if ((int)uVar6 < 0) { uVar6 = (uVar6 - 1 | 0xffffffe0) + 1; } local_74.x = (float)(int)uVar6 * fVar9; color_00 = &local_bc; pVVar10 = &local_7c; local_74.y = (float)((int)(uVar4 + ((int)uVar4 >> 0x1f & 0x1fU)) >> 5) * fVar9; render_quad_set_rect(local_19c,&local_74,pVVar10,color_00); local_40._offset[0] = 0.0; local_40._tint[0] = 1.0; local_40._tint[1] = 1.0; local_40._tint[2] = 1.0; local_40._tint[3] = 1.0; local_40._offset[1] = 0.0; local_40._offset[2] = 0.0; local_40._colorize[0] = 0.0; local_40._colorize[1] = 0.0; local_40._colorize[2] = 0.0; local_40._colorize[3] = 0.0; KAGE::SmartPointer::operator_assign(auStack_1aa + -10,&local_84); apply_sprite_shader_params(&local_40,1,pVVar10,color_00); (**(code **)(*local_84 + 0x14))(&local_a8); _glfw_context_reset(1); pop_render_target(); shader_cache_find(unusedArg); InfoDisplay::add_item_entry(param_2,1); iVar7 = in_ECX[1]; iVar1 = *in_ECX; local_8 = 4.2039e-45; if (local_80 != (int *)0x0) { cVar2 = (**(code **)(*local_80 + 0xc))(); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_84); } } ExceptionList = local_10; return -(iVar7 - iVar1 >> 2); } //@@ 009e0150 FUN_009e0150 undefined4 FUN_009e0150(uint param_1) { int *in_ECX; if (((int)param_1 < 0) && ((int)~param_1 < in_ECX[1] - *in_ECX >> 2)) { return **(undefined4 **)(*in_ECX + ~param_1 * 4); } return 0; } //@@ 009e0180 FUN_009e0180 undefined4 FUN_009e0180(uint param_1) { int *in_ECX; if (((int)param_1 < 0) && ((int)~param_1 < in_ECX[1] - *in_ECX >> 2)) { return *(undefined4 *)(*in_ECX + ~param_1 * 4); } return 0; } //@@ 009e01b0 glitched_item_effects_run /* DB: UseActiveItem 0x5b3bc8 sends negative (TMTRAINER) ids here: item ~id of Game+0x67758 runs each effect whose trigger matches param_3 (8 = after the previous one fired) through trigger_effect_execute (items-verify, use_dispatch.md) */ void glitched_item_effects_run (uint param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5, undefined4 param_6) { void *pvVar1; int iVar2; char cVar3; int iVar4; uint uVar5; uint uVar6; if ((((int)param_1 < 0) && (pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin, (int)~param_1 < (int)(g_game->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2 )) && (iVar2 = *(int *)((int)pvVar1 + ~param_1 * 4), iVar2 != 0)) { uVar6 = 0xffffffff; iVar4 = *(int *)(iVar2 + 0x2c); uVar5 = 0; if (*(int *)(iVar2 + 0x30) - iVar4 >> 2 != 0) { do { iVar4 = **(int **)(iVar4 + uVar5 * 4); if ((iVar4 == param_3) || ((iVar4 == 8 && (uVar6 == uVar5 - 1)))) { cVar3 = trigger_effect_execute(param_2,param_4,param_5,param_6); if (cVar3 != '\0') { uVar6 = uVar5; } } uVar5 = uVar5 + 1; iVar4 = *(int *)(iVar2 + 0x2c); } while (uVar5 < (uint)(*(int *)(iVar2 + 0x30) - iVar4 >> 2)); } } return; } //@@ 009e0240 GlitchedCollectibleGfx::render_item /* DB: ? thiscall (id<0, quad, ..): validates ~id against the procedural item vector (this[0..1]), builds a SourceQuad and offsets it to the 32x32 atlas cell ((~id)%32, (~id)/32), renders via image vfunc +0x14 of this[3]; HUD::render_extra_hud and two HUD item renderers prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall GlitchedCollectibleGfx::render_item (void *this,int itemId,SourceQuad *sourceQuad,void *destQuad,void *colorQuad) { void *pvVar1; uint uVar2; uint extraout_EDX; float fVar3; float fVar4; SourceQuad local_28; if (((-1 < itemId) || (*(int *)((int)this + 4) - *(int *)this >> 2 <= ~itemId)) || (**(int **)(*(int *)this + ~itemId * 4) == 0)) { return (void *)0x0; } SourceQuad::SourceQuad(&local_28,sourceQuad); uVar2 = extraout_EDX & 0x8000001f; if ((int)uVar2 < 0) { uVar2 = (uVar2 - 1 | 0xffffffe0) + 1; } fVar4 = (float)(int)uVar2 * 32.0; local_28._topLeft.x = fVar4 + local_28._topLeft.x; fVar3 = (float)((int)(extraout_EDX + ((int)extraout_EDX >> 0x1f & 0x1fU)) >> 5) * 32.0; local_28._topLeft.y = fVar3 + local_28._topLeft.y; local_28._topRight.x = fVar4 + local_28._topRight.x; local_28._topRight.y = fVar3 + local_28._topRight.y; local_28._bottomLeft.x = fVar4 + local_28._bottomLeft.x; local_28._bottomRight.x = fVar4 + local_28._bottomRight.x; local_28._bottomLeft.y = fVar3 + local_28._bottomLeft.y; local_28._bottomRight.y = fVar3 + local_28._bottomRight.y; pvVar1 = (void *)(**(code **)(**(int **)((int)this + 0xc) + 0x14))(&local_28,destQuad,colorQuad); return pvVar1; } //@@ 009e0340 FUN_009e0340 void FUN_009e0340(int *param_1) { ProceduralItemManager *in_ECX; uint uVar1; init_procedural_item_surfaces(in_ECX); uVar1 = 0; if (param_1[1] - *param_1 >> 2 != 0) { do { ItemPool::CreateGlitchedCollectible(*(undefined4 *)(*param_1 + uVar1 * 4),0); uVar1 = uVar1 + 1; } while (uVar1 < (uint)(param_1[1] - *param_1 >> 2)); } return; } //@@ 009e0390 FUN_009e0390 void FUN_009e0390(void) { int in_ECX; undefined4 *this; FUN_007dcd30(); FUN_007dcd30(); this = (undefined4 *)(in_ECX + 4); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 4) + 4)); operator_delete((void *)*this,0x18); return; } //@@ 009e03d0 FUN_009e03d0 void FUN_009e03d0(int param_1) { void *in_ECX; int local_1c [2]; undefined1 local_14 [8]; int local_c; std::set::find_node(local_14,¶m_1); if (((*(char *)(local_c + 0xd) == '\0') && (*(int *)(local_c + 0x10) <= param_1)) && (local_c != *(int *)((int)in_ECX + 4))) { *(int *)(local_c + 0x14) = *(int *)(local_c + 0x14) + 1; GlitchedItemSet::recalculate(in_ECX); return; } local_1c[0] = param_1; local_1c[1] = 1; std_map_int_insert((void *)((int)in_ECX + 4),local_14,local_1c); GlitchedItemSet::recalculate(in_ECX); return; } //@@ 009e0450 FUN_009e0450 void FUN_009e0450(int param_1) { void *ptr; void *in_ECX; undefined1 local_10 [8]; void *local_8; std::set::find_node(local_10,¶m_1); if ((((*(char *)((int)local_8 + 0xd) == '\0') && (*(int *)((int)local_8 + 0x10) <= param_1)) && (local_8 != *(void **)((int)in_ECX + 4))) && (*(int *)((int)local_8 + 0x14) = *(int *)((int)local_8 + 0x14) + -1, *(int *)((int)local_8 + 0x14) < 1)) { ptr = std::_Tree::_Extract((void *)((int)in_ECX + 4),local_8); operator_delete(ptr,0x18); } GlitchedItemSet::recalculate(in_ECX); return; } //@@ 009e04b0 collectible_set_has /* DB: ? set find with count>0; HasCollectible */ undefined4 collectible_set_has(int param_1) { int in_ECX; undefined1 local_10 [8]; int local_8; std::set::find_node(local_10,¶m_1); if ((((*(char *)(local_8 + 0xd) == '\0') && (*(int *)(local_8 + 0x10) <= param_1)) && (local_8 != *(int *)(in_ECX + 4))) && (0 < *(int *)(local_8 + 0x14))) { return 1; } return 0; } //@@ 009e0500 GlitchedItemSet::recalculate /* DB: ? thiscall: clears the byte-count arrays (+0xc..+0x10, +0x18..+0x1c) and the 6 float stat sums (+0x24..+0x38), then for each negative id in the set at +4 looks up the procedural item ~id in Game +0x67758 and adds its counts and stat floats (+0x14..+0x28); Entity_Player::RestoreGameState and the set add/remove helpers 009e03d0/009e0450 prototype: db/protos.zhl */ void __thiscall GlitchedItemSet::recalculate(void *this) { void *pvVar1; int iVar2; int *piVar3; Game *pGVar4; uint uVar5; int iVar6; int local_8; uVar5 = 0; if (*(int *)((int)this + 0x10) != *(int *)((int)this + 0xc)) { do { *(undefined1 *)(uVar5 + *(int *)((int)this + 0xc)) = 0; uVar5 = uVar5 + 1; } while (uVar5 < (uint)(*(int *)((int)this + 0x10) - *(int *)((int)this + 0xc))); } uVar5 = 0; if (*(int *)((int)this + 0x1c) != *(int *)((int)this + 0x18)) { do { *(undefined1 *)(uVar5 + *(int *)((int)this + 0x18)) = 0; uVar5 = uVar5 + 1; } while (uVar5 < (uint)(*(int *)((int)this + 0x1c) - *(int *)((int)this + 0x18))); } *(undefined4 *)((int)this + 0x24) = 0; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 0; *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 0; *(undefined4 *)((int)this + 0x38) = 0; pGVar4 = g_game; local_8 = **(int **)((int)this + 4); if ((int *)local_8 != *(int **)((int)this + 4)) { do { uVar5 = ~*(uint *)(local_8 + 0x10); if ((((int)*(uint *)(local_8 + 0x10) < 0) && (pvVar1 = (pGVar4->_proceduralItemManager)._proceduralItems._begin, (int)uVar5 < (int)(pGVar4->_proceduralItemManager)._proceduralItems._end - (int)pvVar1 >> 2)) && (iVar2 = *(int *)((int)pvVar1 + uVar5 * 4), iVar2 != 0)) { piVar3 = *(int **)(iVar2 + 0x10); if (piVar3 != (int *)0x0) { if (*piVar3 == 2) { iVar6 = *(int *)((int)this + 0x18); } else { if (*piVar3 == 0) goto LAB_009e05d4; iVar6 = *(int *)((int)this + 0xc); } *(char *)(piVar3[1] + iVar6) = *(char *)(piVar3[1] + iVar6) + *(char *)(local_8 + 0x14); } LAB_009e05d4: *(float *)((int)this + 0x24) = *(float *)(iVar2 + 0x14) + *(float *)((int)this + 0x24); *(float *)((int)this + 0x28) = *(float *)(iVar2 + 0x18) + *(float *)((int)this + 0x28); *(float *)((int)this + 0x2c) = *(float *)(iVar2 + 0x1c) + *(float *)((int)this + 0x2c); *(float *)((int)this + 0x30) = *(float *)(iVar2 + 0x20) + *(float *)((int)this + 0x30); *(float *)((int)this + 0x34) = *(float *)(iVar2 + 0x24) + *(float *)((int)this + 0x34); *(float *)((int)this + 0x38) = *(float *)(iVar2 + 0x28) + *(float *)((int)this + 0x38); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); } while (local_8 != *(int *)((int)this + 4)); } return; } //@@ 009e0650 FUN_009e0650 undefined1 FUN_009e0650(int param_1) { int in_ECX; if ((param_1 < 0) || (*(int *)(in_ECX + 0x10) - *(int *)(in_ECX + 0xc) <= param_1)) { return 0; } return *(undefined1 *)(*(int *)(in_ECX + 0xc) + param_1); } //@@ 009e0680 trigger_set_dispatch /* DB: ? reentrancy-guarded loop over set ids calling 009e14b0 trigger_effect_execute effect runner) prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall trigger_set_dispatch(void *this,int triggerType,Entity *entity,Vector *position,Vector *velocity) { int local_c [2]; if (DAT_00c7f600 == 0) { local_c[0] = **(int **)((int)this + 4); if ((int *)local_c[0] != *(int **)((int)this + 4)) { DAT_00c7f600 = 1; do { glitched_item_effects_run (*(undefined4 *)(local_c[0] + 0x10),*(undefined4 *)this,triggerType,entity, position,velocity); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)local_c); } while (local_c[0] != *(int *)((int)this + 4)); DAT_00c7f600 = DAT_00c7f600 + -1; return; } } return; } //@@ 009e0700 ProceduralEffect::roll_trigger_target /* DB: ? (RNG*) with outs in ECX/EDX: RNG%6 selects a category (2, 9, 5, ..) with chance 0.01/1.0 and, 1 in 3/4, a random entry of FUN_00694f00(category) (0x168-byte records, id at +4); ProceduralEffect::roll_params kind 2 and kind 6 rescale */ int ProceduralEffect::roll_trigger_target(RNG *param_1) { code *pcVar1; uint3 uVar2; RNG *this; uint uVar3; int iVar4; uint uVar5; EntityConfig *pEVar6; void *pvVar7; uint *in_ECX; float *in_EDX; void *pvVar8; uint uVar9; ushort uVar10; int local_40; int local_3c; int local_34; int local_30; void *local_2c; float *local_28; uint *local_24; uint local_20; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; this = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b0f765; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar9 = 0; uVar10 = 0xffff; param_1 = (RNG *)0x0; uVar5 = this->_seed; local_28 = in_EDX; local_24 = in_ECX; if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = this->_seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); iVar4 = (*pcVar1)(); return iVar4; } } uVar5 = uVar5 >> ((byte)this->_shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)this->_shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)this->_shift3 & 0x1f) ^ uVar5; this->_seed = uVar5; switch(uVar5 % 6) { case 0: uVar9 = 2; param_1 = (RNG *)0x3c23d70a; uVar5 = RNG::RandomInt(this,3); if (uVar5 != 0) { LAB_009e0a8b: param_1 = (RNG *)0x3c23d70a; goto LAB_009e080a; } FUN_00694f00(&local_34,2); local_8 = 0; iVar4 = (int)((ulonglong)((longlong)(local_30 - local_34) * 0xb60b60b7) >> 0x20); break; case 1: uVar9 = 9; param_1 = (RNG *)0x3c23d70a; uVar5 = RNG::RandomInt(this,3); if (uVar5 != 0) goto LAB_009e0a8b; FUN_00694f00(&local_34,9); local_8 = 1; iVar4 = (int)((ulonglong)((longlong)(local_30 - local_34) * 0xb60b60b7) >> 0x20); break; case 2: uVar9 = 5; param_1 = (RNG *)0x3f800000; uVar5 = RNG::RandomInt(this,4); if (uVar5 == 0) { param_1 = (RNG *)0x3f800000; goto LAB_009e080a; } FUN_00694f00(&local_34,5); local_8 = 2; iVar4 = (int)((ulonglong)((longlong)(local_30 - local_34) * 0xb60b60b7) >> 0x20); break; case 3: param_1 = (RNG *)0x3ca3d70a; uVar9 = 4; goto LAB_009e080a; case 4: local_20 = 999; uVar5 = RNG::RandomInt(this,4); if (uVar5 == 0) { uVar5 = this->_seed; uVar9 = 0; do { if (uVar5 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar5 = this->_seed; if (uVar5 == 0) { pcVar1 = (code *)swi(3); iVar4 = (*pcVar1)(); return iVar4; } } uVar5 = uVar5 >> ((byte)this->_shift1 & 0x1f) ^ uVar5; uVar5 = uVar5 << ((byte)this->_shift2 & 0x1f) ^ uVar5; uVar5 = uVar5 >> ((byte)this->_shift3 & 0x1f) ^ uVar5; this->_seed = uVar5; pEVar6 = &g_manager->_entityConfig; local_1c = uVar5 % 0x3de + 10; local_18 = local_1c * 0x100000; local_14 = local_18; _Find_lower_bound<>(&local_34,&local_14); if ((*(char *)((int)local_2c + 0xd) == '\0') && (*(uint *)((int)local_2c + 0x10) <= local_18)) { pvVar7 = local_2c; pvVar8 = (pEVar6->_entities)._head; } else { pvVar7 = (pEVar6->_entities)._head; pvVar8 = pvVar7; } iVar4 = (int)pvVar7 + 0x18; if (pvVar7 == pvVar8) { iVar4 = 0; } if ((iVar4 != 0) && (*(char *)(iVar4 + 0x2c) == '\0')) { uVar10 = 0xffff; param_1 = (RNG *)0x3ca3d70a; uVar9 = local_1c & 0xffff; goto LAB_009e080a; } uVar9 = uVar9 + 1; } while (uVar9 < 100); uVar10 = 0xffff; param_1 = (RNG *)0x3ca3d70a; uVar9 = local_20; } else { param_1 = (RNG *)0x3ca3d70a; uVar9 = 999; uVar10 = 0xffff; } goto LAB_009e080a; case 5: FUN_00694f00(&local_40,1000); local_8 = 3; uVar5 = RNG::RandomInt(this,(local_3c - local_40) / 0x168); uVar10 = *(ushort *)(uVar5 * 0x168 + 4 + local_40); std::vector::_Tidy(uVar3); param_1 = (RNG *)0x3ca3d70a; uVar9 = 1000; goto LAB_009e080a; default: goto switchD_009e0787_default; } uVar5 = RNG::RandomInt(this,(iVar4 >> 8) - (iVar4 >> 0x1f)); uVar10 = *(ushort *)(uVar5 * 0x168 + 4 + local_34); std::vector::_Tidy(); switchD_009e0787_default: LAB_009e080a: *local_24 = uVar9 << 0x10 | (uint)uVar10; *local_28 = (float)param_1; uVar2 = CONCAT21((short)((uint)local_28 >> 0x10), ((float)param_1 == 0.0) << 6 | NAN((float)param_1) << 2 | 2U | (float)param_1 < 0.0); if ((float)param_1 == 0.0) { ExceptionList = local_10; return (uint)uVar2 << 8; } ExceptionList = local_10; return CONCAT31(uVar2,1); } //@@ 009e0ad0 ProceduralEffect::roll_spawn_target /* DB: ? (RNG*) with outs in ECX/EDX: 1 in 8 picks a random entity config from the set at Manager +0x2a670 (skipping type 1 and flag +0x44), chance 0.1..1.1; else RNG&3 picks from the item lists FUN_00694f00(2/5/4..) with fixed chances 0.01/1.0/0.02; ProceduralEffect::roll_params kind 2 right after 009e0700 ProceduralEffect::roll_trigger_target int ProceduralEffect::roll_spawn_target(RNG *param_1) { code *pcVar1; uint3 uVar2; Manager *pMVar3; uint uVar4; int iVar5; uint uVar6; uint uVar7; EntityConfig *pEVar8; void *pvVar9; uint *in_ECX; float *in_EDX; void *pvVar10; int iStack_38; int iStack_34; void *pvStack_30; float *local_2c; uint *local_28; uint local_24; uint local_20; uint local_1c; uint local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b0f7ad; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = 0; local_24 = 0; local_14 = 0.0; uVar6 = param_1->_seed; local_2c = in_EDX; local_28 = in_ECX; if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = param_1->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar6 = uVar6 >> ((byte)param_1->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)param_1->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)param_1->_shift3 & 0x1f) ^ uVar6; param_1->_seed = uVar6; pMVar3 = g_manager; if ((uVar6 & 7) == 0) { local_20 = 10; do { uVar4 = param_1->_seed; uVar6 = (pMVar3->_entityConfig)._entities._size; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = param_1->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar4 = uVar4 >> ((byte)param_1->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)param_1->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)param_1->_shift3 & 0x1f) ^ uVar4; param_1->_seed = uVar4; if (uVar6 == 0) { uVar7 = *(uint *)(pMVar3->_entityConfig)._entities._head; } else { uVar6 = uVar4 % uVar6; local_1c = *(uint *)(pMVar3->_entityConfig)._entities._head; uVar7 = local_1c; if (uVar6 != 0) { do { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_1c); uVar6 = uVar6 - 1; } while (uVar6 != 0); uVar7 = local_1c; } } uVar6 = *(uint *)(uVar7 + 0x18) & 0xffff; if ((*(uint *)(uVar7 + 0x18) != 1) && (*(char *)(uVar7 + 0x44) == '\0')) { local_24 = (uint)*(ushort *)(uVar7 + 0x1c); local_18 = uVar6; if (uVar4 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar4 = param_1->_seed; if (uVar4 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar4 = uVar4 >> ((byte)param_1->_shift1 & 0x1f) ^ uVar4; uVar4 = uVar4 << ((byte)param_1->_shift2 & 0x1f) ^ uVar4; uVar4 = uVar4 >> ((byte)param_1->_shift3 & 0x1f) ^ uVar4; param_1->_seed = uVar4; local_14 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283062e-10 + 0.1; } local_20 = local_20 + -1; } while (local_20 != 0); uVar6 = local_24; } else { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = param_1->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar6 = uVar6 >> ((byte)param_1->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)param_1->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)param_1->_shift3 & 0x1f) ^ uVar6; param_1->_seed = uVar6; switch(uVar6 & 3) { case 0: FUN_00694f00(&iStack_38,2); uStack_8 = 0; uVar6 = RNG::RandomInt(param_1,(iStack_34 - iStack_38) / 0x168); uVar6 = (uint)*(ushort *)(uVar6 * 0x168 + 4 + iStack_38); std::vector::_Tidy(uVar4); local_14 = 0.01; local_18 = 2; break; case 1: local_14 = 1.0; local_18 = 5; uVar6 = 0; uVar4 = RNG::RandomInt(param_1,4); if (uVar4 == 0) { local_14 = 1.0; local_18 = 5; } else { FUN_00694f00(&iStack_38,5); uStack_8 = 1; uVar6 = RNG::RandomInt(param_1,(iStack_34 - iStack_38) / 0x168); uVar6 = (uint)*(ushort *)(uVar6 * 0x168 + 4 + iStack_38); std::vector::_Tidy(); } break; case 2: FUN_00694f00(&iStack_38,4); uStack_8 = 2; uVar6 = RNG::RandomInt(param_1,(iStack_34 - iStack_38) / 0x168); uVar6 = (uint)*(ushort *)(uVar6 * 0x168 + 4 + iStack_38); std::vector::_Tidy(); local_14 = 0.02; local_18 = 4; break; case 3: uVar4 = 0; local_18 = 10; local_14 = 0.02; do { if (uVar6 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar6 = param_1->_seed; if (uVar6 == 0) { pcVar1 = (code *)swi(3); iVar5 = (*pcVar1)(); return iVar5; } } uVar6 = uVar6 >> ((byte)param_1->_shift1 & 0x1f) ^ uVar6; uVar6 = uVar6 << ((byte)param_1->_shift2 & 0x1f) ^ uVar6; uVar6 = uVar6 >> ((byte)param_1->_shift3 & 0x1f) ^ uVar6; param_1->_seed = uVar6; pEVar8 = &g_manager->_entityConfig; local_1c = uVar6 % 0x3de + 10; local_24 = local_1c * 0x100000; local_20 = local_24; _Find_lower_bound<>(&iStack_38,&local_24); if ((*(char *)((int)pvStack_30 + 0xd) == '\0') && (*(uint *)((int)pvStack_30 + 0x10) <= local_20)) { pvVar9 = pvStack_30; pvVar10 = (pEVar8->_entities)._head; } else { pvVar9 = (pEVar8->_entities)._head; pvVar10 = pvVar9; } iVar5 = (int)pvVar9 + 0x18; if (pvVar9 == pvVar10) { iVar5 = 0; } if ((iVar5 != 0) && (*(char *)(iVar5 + 0x2c) == '\0')) { uVar6 = 0; local_18 = local_1c & 0xffff; goto LAB_009e0eea; } uVar4 = uVar4 + 1; } while (uVar4 < 10); uVar6 = 0; } } LAB_009e0eea: *local_28 = local_18 << 0x10 | uVar6 & 0xffff; *local_2c = local_14; uVar2 = CONCAT21((short)((uint)local_2c >> 0x10), (local_14 == 0.0) << 6 | NAN(local_14) << 2 | 2U | local_14 < 0.0); if (local_14 != 0.0) { ExceptionList = local_10; return CONCAT31(uVar2,1); } ExceptionList = local_10; return (uint)uVar2 << 8; } //@@ 009e0f60 ProceduralEffect::roll_params /* DB: ? called from ItemPool::CreateGlitchedCollectible(x, kind, seed); stores first arg at this+0, switch on kind rolls RNG::RandomInt/RandomFloat, ItemConfig::GetCollectible, BitSet128 masks */ void ProceduralEffect::roll_params(float param_1,float param_2,float param_3) { int iVar1; code *pcVar2; Game *pGVar3; ItemConfig_Item *pIVar4; uint uVar5; uint uVar6; BitSet128 *pBVar7; uint uVar8; float *in_ECX; uint uVar9; uint uVar10; float fVar11; float fVar12; float fVar13; ColorMod local_74; BitSet128 local_48; RNG local_34; float local_24; float local_20; float local_1c; float local_18; float local_14; float local_10; float local_c; fVar11 = param_3; local_34._seed = (int)param_3; local_34._shift1 = 0xd; local_34._shift2 = 3; *in_ECX = param_1; in_ECX[1] = param_2; in_ECX[2] = param_3; local_34._shift3 = 0x11; in_ECX[0x18] = 0.0; in_ECX[4] = 0.0; in_ECX[5] = 0.0; in_ECX[6] = 0.0; in_ECX[7] = 0.0; in_ECX[8] = 0.0; in_ECX[9] = 0.0; in_ECX[10] = 0.0; in_ECX[0xb] = 0.0; in_ECX[0xc] = 1.0; pGVar3 = g_game; switch(param_2) { case 0.0: uVar8 = RNG::RandomInt(&local_34, *(int *)&(g_game->_proceduralItemManager).field_0x20 - *(int *)&(g_game->_proceduralItemManager).field_0x1c >> 2); iVar1 = *(int *)(*(int *)&(pGVar3->_proceduralItemManager).field_0x1c + uVar8 * 4); if (*(int *)(iVar1 + 0xac) == 1) { fVar11 = (float)*(int *)(iVar1 + 0xc0); LAB_009e1045: in_ECX[0x18] = fVar11; } else if (*(int *)(iVar1 + 0xac) == 0) { fVar11 = (float)*(int *)(iVar1 + 0x74) * 0.5 + 1.0; goto LAB_009e1045; } fVar11 = *(float *)(iVar1 + 4); if (fVar11 == 9.86514e-43) { in_ECX[0x18] = in_ECX[0x18] + 6.0; fVar11 = *(float *)(iVar1 + 4); } in_ECX[4] = fVar11; break; case 1.4013e-45: param_3 = 0.0; do { uVar8 = (int)(g_manager->_itemConfig)._collectibles._end - (int)(g_manager->_itemConfig)._collectibles._begin >> 2; if (fVar11 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar10 = (uint)local_34._seed >> ((byte)local_34._shift1 & 0x1f) ^ local_34._seed; uVar10 = uVar10 << ((byte)local_34._shift2 & 0x1f) ^ uVar10; fVar11 = (float)(uVar10 >> ((byte)local_34._shift3 & 0x1f) ^ uVar10); fVar12 = 0.0; if (uVar8 != 0) { fVar12 = (float)((uint)fVar11 % uVar8); } local_34._seed = (int)fVar11; pIVar4 = ItemConfig::GetCollectible(&g_manager->_itemConfig,(int)fVar12); if (pIVar4 != (ItemConfig_Item *)0x0) { in_ECX[4] = fVar12; in_ECX[0x18] = 1.0; break; } param_3 = (float)((int)param_3 + 1); } while ((int)param_3 < 10); break; case 2.8026e-45: in_ECX[6] = 1000.0; roll_trigger_target(&local_34); roll_spawn_target(&local_34); if (0.0 < param_3) { in_ECX[0x18] = param_1 / param_3; } else { in_ECX[0x18] = 10000.0; } break; case 4.2039e-45: fVar11 = RNG::RandomFloat(&local_34); fVar12 = RNG::RandomFloat(&local_34); fVar13 = RNG::RandomFloat(&local_34); in_ECX[6] = fVar13 * fVar12 * fVar11 * 8000.0 + 30.0; fVar11 = RNG::RandomFloat(&local_34); fVar12 = RNG::RandomFloat(&local_34); fVar11 = fVar12 * (fVar11 - 0.2) * 80.0; if (fVar11 <= 0.0) { fVar11 = 0.0; } in_ECX[7] = fVar11; in_ECX[0x18] = fVar11 * 0.1; if ((fVar11 < 0.0) || (uVar8 = RNG::RandomInt(&local_34,3), uVar8 == 0)) { uVar8 = 100; if (in_ECX[7] <= 5.0 && in_ECX[7] != 5.0) { uVar8 = 0x14; } uVar10 = 0; fVar11 = (float)local_34._seed; do { if (fVar11 == 0.0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = (uint)fVar11 >> ((byte)local_34._shift1 & 0x1f) ^ (uint)fVar11; uVar5 = uVar5 << ((byte)local_34._shift2 & 0x1f) ^ uVar5; fVar11 = (float)(uVar5 >> ((byte)local_34._shift3 & 0x1f) ^ uVar5); if ((uint)fVar11 % uVar8 == 0) { if (uVar10 < 0x40) { uVar5 = 1 << (uVar10 & 0x1f); uVar6 = 0; if (0x1f < uVar10) { uVar6 = uVar5; } uVar5 = uVar5 ^ uVar6; if (0x3f < uVar10) { uVar6 = uVar5; } in_ECX[8] = (float)((uint)in_ECX[8] | uVar5); in_ECX[9] = (float)((uint)in_ECX[9] | uVar6); } else { uVar5 = uVar10 - 0x40; uVar6 = 1 << (uVar5 & 0x1f); uVar9 = 0; if (0x1f < uVar5) { uVar9 = uVar6; } uVar6 = uVar6 ^ uVar9; if (0x3f < uVar5) { uVar9 = uVar6; } in_ECX[10] = (float)((uint)in_ECX[10] | uVar6); in_ECX[0xb] = (float)((uint)in_ECX[0xb] | uVar9); } in_ECX[0x18] = in_ECX[0x18] + 0.4; } uVar10 = uVar10 + 1; } while (uVar10 < 0x80); local_34._seed = (int)fVar11; pBVar7 = BitSet128::__bnot(&g_tearFlagLudovico,&local_48); in_ECX[8] = (float)((uint)in_ECX[8] & (uint)pBVar7->_l); in_ECX[9] = (float)((uint)in_ECX[9] & *(uint *)((int)&pBVar7->_l + 4)); in_ECX[10] = (float)((uint)in_ECX[10] & (uint)pBVar7->_h); in_ECX[0xb] = (float)((uint)in_ECX[0xb] & *(uint *)((int)&pBVar7->_h + 4)); } break; case 5.60519e-45: roll_spawn_target(&local_34); in_ECX[0x18] = param_2 * 100.0; break; case 7.00649e-45: fVar11 = RNG::RandomFloat(&local_34); fVar12 = RNG::RandomFloat(&local_34); in_ECX[0x18] = 1.0; in_ECX[7] = fVar12 * 10.0 + fVar11 * 10.0 + 5.0; fVar11 = (float)RNG::RandomInt(&local_34,10); in_ECX[4] = fVar11; uVar8 = RNG::RandomInt(&local_34,4); if (uVar8 == 0) { local_20 = RNG::RandomFloat(&local_34); local_1c = RNG::RandomFloat(&local_34); local_18 = RNG::RandomFloat(&local_34); local_14 = RNG::RandomFloat(&local_34); local_10 = RNG::RandomFloat(&local_34); local_c = RNG::RandomFloat(&local_34); fVar11 = RNG::RandomFloat(&local_34); fVar12 = RNG::RandomFloat(&local_34); fVar13 = RNG::RandomFloat(&local_34); local_74._tint[0] = RNG::RandomFloat(&local_34); local_74._colorize[1] = local_c; local_74._colorize[2] = local_10; local_74._colorize[3] = local_14; local_74._offset[0] = local_18; local_74._offset[1] = local_1c; local_74._tint[3] = 1.0; local_74._offset[2] = local_20; local_74._tint[1] = fVar13; local_74._tint[2] = fVar12; local_74._colorize[0] = fVar11; Color::operator_assign((Color *)(in_ECX + 0xd),&local_74); } } if ((*in_ECX == 8.40779e-45) && (roll_trigger_target(&local_34), 0.0 < local_24)) { in_ECX[0x18] = in_ECX[0x18] / local_24; } if (*in_ECX == 1.4013e-45) { in_ECX[0x18] = in_ECX[0x18] * 10.0; } return; } //@@ 009e14b0 trigger_effect_execute /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called from trigger_set_dispatch; switch on effect type: 0 UseActiveItem, 1 AddCollectibleEffect, 2/4 Spawn, 3 tear flags, 5 Game::Fart; 'Collectible ID out of bounds!' */ uint trigger_effect_execute(Entity_Player *param_1,Entity *param_2,Entity *param_3,float *param_4) { uint *puVar1; int *piVar2; int iVar3; code *pcVar4; qword qVar5; undefined1 *puVar6; char cVar7; byte bVar8; Entity *pEVar9; int *in_ECX; uint uVar10; uint extraout_ECX; uint extraout_ECX_00; RNG *this; float fVar11; EntityRef local_90; Vector local_68; undefined1 local_60 [12]; float local_54; undefined8 local_50; int *local_48; uint local_44; float local_40; Vector local_3c; uint local_34; float local_30; RNG *local_2c; undefined2 local_26; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_60 + 0x5c; local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0f7dd; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_60 + 0x50); ExceptionList = &local_1c; local_48 = in_ECX; puVar6 = local_60 + 0x5c; if ((int)(param_1->_collectibleRNGs)._end - (int)(param_1->_collectibleRNGs)._begin >> 4 < 1) { KAGE_LogMessage(0x10,(byte *)"Collectible ID out of bounds!\n"); puVar6 = puStack_20; } puStack_20 = puVar6; this = (param_1->_collectibleRNGs)._begin; local_2c = this; if (*in_ECX == 6) { uVar10 = (uint)*(ushort *)(in_ECX + 3); local_30 = (float)(uint)*(ushort *)((int)in_ECX + 0xe); if (uVar10 == 0xffff) { uVar10 = 0xffffffff; } if ((((param_2 != (Entity *)0x0) && (fVar11 = (float)param_2->_type, fVar11 == local_30)) && ((uVar10 == 0xffffffff || (param_2->_variant == uVar10)))) && ((((fVar11 != 2.8026e-45 && (fVar11 != 1.26117e-44)) && (fVar11 != 1.4013e-42)) || (local_30 = RNG::RandomFloat(this), local_30 < (float)in_ECX[0xc] * 0.05)))) goto LAB_009e15a5; goto switchD_009e1729_default; } LAB_009e15a5: if (*in_ECX == 1) { uVar10 = this->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = this->_seed; if (uVar10 == 0) { pcVar4 = (code *)swi(3); uVar10 = (*pcVar4)(); return uVar10; } } uVar10 = uVar10 >> ((byte)this->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 ^ uVar10 << ((byte)this->_shift2 & 0x1f); uVar10 = uVar10 ^ uVar10 >> ((byte)this->_shift3 & 0x1f); this->_seed = uVar10; if ((float)in_ECX[0xc] * 0.05 <= (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283062e-10) goto switchD_009e1729_default; } if (*in_ECX == 2) { uVar10 = this->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = this->_seed; if (uVar10 == 0) { pcVar4 = (code *)swi(3); uVar10 = (*pcVar4)(); return uVar10; } } uVar10 = uVar10 >> ((byte)this->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 ^ uVar10 << ((byte)this->_shift2 & 0x1f); uVar10 = uVar10 ^ uVar10 >> ((byte)this->_shift3 & 0x1f); this->_seed = uVar10; if ((float)in_ECX[0xc] * 0.05 <= (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283062e-10) goto switchD_009e1729_default; } if (*in_ECX == 3) { uVar10 = this->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = this->_seed; if (uVar10 == 0) { pcVar4 = (code *)swi(3); uVar10 = (*pcVar4)(); return uVar10; } } uVar10 = uVar10 >> ((byte)this->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 ^ uVar10 << ((byte)this->_shift2 & 0x1f); uVar10 = uVar10 ^ uVar10 >> ((byte)this->_shift3 & 0x1f); this->_seed = uVar10; if ((float)in_ECX[0xc] * 0.2 <= (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283062e-10) goto switchD_009e1729_default; } switch(in_ECX[1]) { case 0: Entity_Player::UseActiveItem(param_1,&local_26,in_ECX[4],3,-1,0); uVar10 = 1; break; case 1: TemporaryEffects::AddCollectibleEffect(¶m_1->_temporaryeffects,in_ECX[4],1,1); uVar10 = 1; break; case 2: local_44 = (uint)*(ushort *)((int)in_ECX + 0x12); local_30 = (float)(uint)*(ushort *)(in_ECX + 4); if (local_30 == 9.18341e-41) { local_30 = -NAN; } local_40 = (float)(uint)*(ushort *)((int)in_ECX + 0x16); local_50 = (ulonglong)CONCAT24((short)in_ECX[5],(undefined4)local_50); local_26._1_1_ = 0; local_34 = 0; local_3c.y = (float)g_game->_room; bVar8 = 0; if (*(int *)((int)local_3c.y + 0x1264) != 0) { do { piVar2 = *(int **)(*(int *)((int)local_3c.y + 0x125c) + local_34 * 4); if ((piVar2[0x5a] & 0x200000U) == 0) { if (((local_44 != 999) || (((*(int *)&g_game->_deathmatchManager < 2 || (piVar2[10] != 1)) && (0x3dd < piVar2[10] - 10U)))) || (cVar7 = (**(code **)(*piVar2 + 0x4c))(), cVar7 != '\0')) { iVar3 = *(int *)(*(int *)((int)local_3c.y + 0x125c) + local_34 * 4); this = local_2c; if ((*(uint *)(iVar3 + 0x28) != local_44) || ((local_30 != -NAN && (in_ECX = local_48, (float)*(uint *)(iVar3 + 0x2c) != local_30) ))) goto LAB_009e197e; } piVar2 = *(int **)(*(int *)((int)local_3c.y + 0x125c) + local_34 * 4); fVar11 = *(float *)¶m_3->field_0x4 - (float)piVar2[0xd0]; if (fVar11 * fVar11 + (*(float *)param_3 - (float)piVar2[0xcf]) * (*(float *)param_3 - (float)piVar2[0xcf]) <= (float)in_ECX[6] * (float)in_ECX[6]) { (**(code **)(*piVar2 + 0x28))(); uVar10 = this->_seed; if (uVar10 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar10 = this->_seed; if (uVar10 == 0) { pcVar4 = (code *)swi(3); uVar10 = (*pcVar4)(); return uVar10; } } uVar10 = uVar10 >> ((byte)this->_shift1 & 0x1f) ^ uVar10; uVar10 = uVar10 << ((byte)this->_shift2 & 0x1f) ^ uVar10; uVar10 = uVar10 >> ((byte)local_2c->_shift3 & 0x1f) ^ uVar10; local_2c->_seed = uVar10; iVar3 = *(int *)(*(int *)((int)local_3c.y + 0x125c) + local_34 * 4); local_68.x = *(float *)(iVar3 + 0x360); local_68.y = *(float *)(iVar3 + 0x364); iVar3 = *(int *)(*(int *)((int)local_3c.y + 0x125c) + local_34 * 4); local_54 = *(float *)(iVar3 + 0x340); local_60._8_4_ = *(int *)(iVar3 + 0x33c); pEVar9 = Game::Spawn(g_game,(uint)local_40,local_50._4_4_,(Vector *)(local_60 + 8), &local_68,(Entity *)param_1,0,uVar10); if (pEVar9 == (Entity *)0x0) { this = local_2c; } else { if (((1 < *(int *)&g_game->_deathmatchManager) && (pEVar9->_type == 1)) || (pEVar9->_type - 10U < 0x3de)) { qVar5 = pEVar9->_flags; puVar1 = (uint *)((int)&pEVar9->_flags + 4); *puVar1 = *puVar1 | 0x80; *(int *)&pEVar9->_flags = (int)qVar5; } (**(code **)(*(int *)pEVar9 + 0xc))(); local_26._1_1_ = 1; this = local_2c; } } } LAB_009e197e: local_34 = local_34 + 1; bVar8 = local_26._1_1_; } while (local_34 < *(uint *)((int)local_3c.y + 0x1264)); } uVar10 = (uint)bVar8; break; case 3: local_2c = (RNG *)((uint)local_2c & 0xffffff00); pEVar9 = param_3; EntityList::QueryRadius ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_60, (Vector *)param_3,(float)in_ECX[6],8); local_14 = (void *)0x0; local_3c.y = 0.0; uVar10 = extraout_ECX; if (local_54 != 0.0) { do { fVar11 = local_3c.y; local_40 = (float)in_ECX[7]; local_50 = 0; if ((in_ECX[8] != 0 || in_ECX[9] != 0) || (in_ECX[10] != 0 || in_ECX[0xb] != 0)) { get_tear_flags_from_player (&local_50,uVar10,*(BitSet128 *)(in_ECX + 8),(int)pEVar9,param_2); } pcVar4 = *(code **)(**(int **)(local_60._4_4_ + (int)fVar11 * 4) + 0x20); EntityRef::constructor(&local_90,(Entity *)param_1); pEVar9 = (Entity *)&local_90; cVar7 = (*pcVar4)(local_40,(undefined4)local_50,local_50._4_4_,pEVar9,0x1e); fVar11 = local_3c.y; in_ECX = local_48; uVar10 = (uint)local_2c & 0xff; if (cVar7 != '\0') { uVar10 = 1; } local_2c = (RNG *)uVar10; if ((local_48[8] != 0 || local_48[9] != 0) || (local_48[10] != 0 || local_48[0xb] != 0)) { pEVar9 = param_2; Entity_Tear::ApplyTearFlagEffects (*(Entity **)(local_60._4_4_ + (int)local_3c.y * 4),(Vector *)param_3, *(BitSet128 *)(local_48 + 8),param_2,(float)local_48[7]); uVar10 = extraout_ECX_00; } local_3c.y = (float)((int)fVar11 + 1); } while ((uint)local_3c.y < (uint)local_54); } if (local_60[0] == '\0') { local_14 = (void *)0x1; tracked_alloc(1,(void *)local_60._4_4_,0); } uVar10 = (uint)local_2c & 0xff; break; case 4: local_30 = (float)in_ECX[4]; local_44 = (uint)local_30 >> 0x10; if (local_44 != 0) { uVar10 = RNG::Next(this); local_54 = 9.80909e-45; local_40 = *param_4; local_48 = (int *)param_4[1]; local_60._0_4_ = in_ECX[2]; local_60._4_4_ = 5; local_60._8_4_ = 9; fVar11 = RNG::RandomFloat((RNG *)local_60); local_50 = CONCAT44(fVar11,(undefined4)local_50); local_3c.x = local_40 * 8.0 * fVar11; local_3c.y = (float)local_48 * 8.0 * fVar11; pEVar9 = Game::Spawn(g_game,local_44,(uint)local_30 & 0xffff,(Vector *)param_3,&local_3c, (Entity *)param_1,0,uVar10); if (pEVar9 != (Entity *)0x0) { bVar8 = Entity::IsEnemy(pEVar9); if (bVar8 != 0) { qVar5 = pEVar9->_flags; puVar1 = (uint *)((int)&pEVar9->_flags + 4); *puVar1 = *puVar1 | 0x80; *(int *)&pEVar9->_flags = (int)qVar5; } (**(code **)(*(int *)pEVar9 + 0xc))(); ExceptionList = local_1c; return 1; } } default: switchD_009e1729_default: uVar10 = 0; break; case 5: Game::Fart(g_game,(Vector *)param_3,(float)in_ECX[7] * 6.0,(Entity *)param_1, ((float)in_ECX[7] * 6.0) / 85.0,in_ECX[4],(ColorMod *)(in_ECX + 0xd)); uVar10 = 1; } ExceptionList = local_1c; return uVar10; } //@@ 009e24a0 std::map::find /* DB: lower_bound + 64-bit key compare, returns end() on miss */ void std::map::find(int *param_1,uint *param_2) { int *in_ECX; undefined1 local_10 [8]; int local_8; FUN_009e2760(local_10,param_2); if (*(char *)(local_8 + 0xd) == '\0') { if ((*(uint *)(local_8 + 0x10) <= *param_2) && ((*(uint *)(local_8 + 0x10) < *param_2 || (*(uint *)(local_8 + 0x14) <= param_2[1])))) { *param_1 = local_8; return; } } *param_1 = *in_ECX; return; } //@@ 009e24f0 FUN_009e24f0 void FUN_009e24f0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_009e2580(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 009e2520 FUN_009e2520 void FUN_009e2520(void *param_1) { uint *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; std_string *psVar5; undefined4 *in_ECX; byte *in_EDX; puVar1 = (uint *)(in_EDX + 0x10); if (0xf < *(uint *)(in_EDX + 0x14)) { in_EDX = *(byte **)in_EDX; } psVar5 = std_string_insert(param_1,0,in_EDX,*puVar1); *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; uVar2 = *(undefined4 *)(psVar5->_buf + 4); uVar3 = *(undefined4 *)(psVar5->_buf + 8); uVar4 = *(undefined4 *)(psVar5->_buf + 0xc); *in_ECX = *(undefined4 *)psVar5->_buf; in_ECX[1] = uVar2; in_ECX[2] = uVar3; in_ECX[3] = uVar4; *(undefined8 *)(in_ECX + 4) = *(undefined8 *)&psVar5->_size; psVar5->_size = 0; psVar5->_capacity = 0xf; psVar5->_buf[0] = '\0'; return; } //@@ 009e2580 FUN_009e2580 void FUN_009e2580(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5fad; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)FUN_009e2760(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if (*(char *)(iVar3 + 0xd) == '\0') { if ((*(uint *)(iVar3 + 0x10) <= *param_2) && ((*(uint *)(iVar3 + 0x10) < *param_2 || (*(uint *)(iVar3 + 0x14) <= param_2[1])))) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar8 = operator_new(0x18); uVar6 = param_2[1]; piVar8[4] = *param_2; local_28 = (int *)uVar1; piVar8[5] = uVar6; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_009e26da: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_009e26da; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 009e2760 FUN_009e2760 int * FUN_009e2760(int *param_1,uint *param_2) { uint uVar1; undefined4 *puVar2; int *in_ECX; int iVar3; iVar3 = *in_ECX; puVar2 = *(undefined4 **)(iVar3 + 4); *param_1 = (int)puVar2; param_1[1] = 0; param_1[2] = iVar3; if (*(char *)((int)puVar2 + 0xd) == '\0') { uVar1 = *param_2; do { *param_1 = (int)puVar2; if (((uint)puVar2[4] < uVar1) || (((uint)puVar2[4] <= uVar1 && ((uint)puVar2[5] < param_2[1])))) { puVar2 = (undefined4 *)puVar2[2]; iVar3 = 0; } else { param_1[2] = (int)puVar2; iVar3 = 1; puVar2 = (undefined4 *)*puVar2; } param_1[1] = iVar3; } while (*(char *)((int)puVar2 + 0xd) == '\0'); } return param_1; } //@@ 009e27c0 anm2_member_at_1c4_destroy /* DB: ? EH unwind-only helper: ANM2::Reset + the two AnimationState dtors + two strings of an ANM2 embedded at this+0x1c4; only caller Unwind@00b00cf9 */ void anm2_member_at_1c4_destroy(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)(in_ECX + 0x1c4)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 0x214)); AnimationState::~AnimationState((AnimationState *)(in_ECX + 500)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1dc)); std::string::_Tidy_deallocate((char *)(in_ECX + 0x1c4)); ExceptionList = local_10; return; } //@@ 009e2f20 RailManager::Render /* DB: Room::Render calls it with ECX=&room->field_0x7468 (zhl Room _railManager 0x7468); SetAnimation on the rail anm2, iterates grid width*height (*this->room +0xc/+0x10), AnimationState::Render per rail cell */ void RailManager::Render(float *param_1) { int iVar1; byte bVar2; int *in_ECX; int iVar3; AnimationState *this; uint uVar4; float fVar5; double dVar6; double dVar7; int local_58; Vector local_48 [8]; bVar2 = ANM2::SetAnimation((ANM2 *)(in_ECX + 0x71),&DAT_00b804d8,1); if (((bVar2 != 0) && (in_ECX[0x7e] != 0)) && (AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x7d),0.0), in_ECX[0x7e] != 0)) { *(undefined1 *)(in_ECX + 0x82) = 0; } uVar4 = 0; iVar3 = *(int *)(*in_ECX + 0x10) * *(int *)(*in_ECX + 0xc); if (0 < iVar3) { local_58 = 0x24; do { bVar2 = *(byte *)((int)in_ECX + uVar4 + 4); if (-1 < (char)bVar2) { if (uVar4 < 0x1c0) { if ((*(int *)(local_58 + *in_ECX) != 0) && (*(int *)(*(int *)(local_58 + *in_ECX) + 4) == 7)) goto LAB_009e3195; if ((bVar2 == 0xff) || ((bVar2 & 0x40) == 0)) goto LAB_009e2fd2; bVar2 = bVar2 & 0x3f; if (in_ECX[0x7e] != 0) goto LAB_009e2fe1; } else { LAB_009e2fd2: if (in_ECX[0x7e] != 0) { bVar2 = bVar2 & 0xf; LAB_009e2fe1: AnimationState::SetFrameFloat((AnimationState *)(in_ECX + 0x7d),(float)bVar2); } } iVar1 = *(int *)(*in_ECX + 0xc); fVar5 = g_displayPixelRatio * g_screenPointScale; dVar6 = floor((double)(((((float)((int)uVar4 % iVar1) * 40.0 + 40.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar5 + 0.5)); dVar7 = floor((double)(((((float)((int)uVar4 / iVar1) * 40.0 + 120.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar5 + 0.5)); local_48[0].x = (float)dVar6 / fVar5 + *param_1; local_48[0].y = (float)dVar7 / fVar5 + param_1[1]; if (*(char *)((int)in_ECX + 0x2cd) != '\0') { if ((char)in_ECX[0x8d] == '\0') { AnimationState::Render ((AnimationState *)(in_ECX + 0x7d),local_48,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x85); } else { AnimationState::Render ((AnimationState *)(in_ECX + 0x85),local_48,&g_vectorZero,&g_vectorZero); this = (AnimationState *)(in_ECX + 0x7d); } AnimationState::Render(this,local_48,&g_vectorZero,&g_vectorZero); } } LAB_009e3195: local_58 = local_58 + 4; uVar4 = uVar4 + 1; } while ((int)uVar4 < iVar3); } return; } //@@ 009e31b0 Room::render_pit_rails /* DB: Room::Render callee: "pitrail" anim, per grid cell (<0x1c0) with rail flag, SetFrameFloat */ void __thiscall Room::render_pit_rails(Room *this,float *param_2) { byte bVar1; int iVar2; AnimationState *this_00; uint uVar3; int iVar4; float fVar5; double dVar6; double dVar7; int local_5c; Vector local_48 [8]; bVar1 = ANM2::SetAnimation((ANM2 *)(this->_gridEntities + 0x68),(byte *)"pitrail",1); if (((bVar1 != 0) && (this->_gridEntities[0x75] != (void *)0x0)) && (AnimationState::SetFrameFloat((AnimationState *)(this->_gridEntities + 0x74),0.0), this->_gridEntities[0x75] != (void *)0x0)) { *(undefined1 *)(this->_gridEntities + 0x79) = 0; } uVar3 = 0; iVar2 = *(int *)(*(int *)this + 0x10) * *(int *)(*(int *)this + 0xc); if (0 < iVar2) { local_5c = 0x24; do { bVar1 = *(byte *)((int)this->_gridEntities + (uVar3 - 0x20)); if ((-1 < (char)bVar1) && (uVar3 < 0x1c0)) { iVar4 = *(int *)this; if ((*(int *)(local_5c + iVar4) != 0) && (*(int *)(*(int *)(local_5c + iVar4) + 4) == 7)) { if (this->_gridEntities[0x75] != (void *)0x0) { AnimationState::SetFrameFloat ((AnimationState *)(this->_gridEntities + 0x74),(float)(bVar1 & 0xf)); iVar4 = *(int *)this; } iVar4 = *(int *)(iVar4 + 0xc); fVar5 = g_displayPixelRatio * g_screenPointScale; dVar6 = floor((double)(((((float)((int)uVar3 % iVar4) * 40.0 + 40.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * fVar5 + 0.5)); dVar7 = floor((double)(((((float)((int)uVar3 / iVar4) * 40.0 + 120.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar5 + 0.5)); local_48[0].x = (float)dVar6 / fVar5 + *param_2; local_48[0].y = (float)dVar7 / fVar5 + param_2[1]; if (*(char *)((int)this->_gridEntities + 0x2a9) != '\0') { if (*(char *)(this->_gridEntities + 0x84) == '\0') { AnimationState::Render ((AnimationState *)(this->_gridEntities + 0x74),local_48,&g_vectorZero, &g_vectorZero); this_00 = (AnimationState *)(this->_gridEntities + 0x7c); } else { AnimationState::Render ((AnimationState *)(this->_gridEntities + 0x7c),local_48,&g_vectorZero, &g_vectorZero); this_00 = (AnimationState *)(this->_gridEntities + 0x74); } AnimationState::Render(this_00,local_48,&g_vectorZero,&g_vectorZero); } } } local_5c = local_5c + 4; uVar3 = uVar3 + 1; } while ((int)uVar3 < iVar2); } return; } //@@ 009e3450 RoomGridPath::can_step /* DB: ? ECX holds Room* like room_grid_flood_fill (the next function): for two 4-adjacent grid indices (|drow|+|dcol|==1, index<448) checks the from-cell's type nibble (ECX+4+idx) against the direction table DAT_00c37610 (0x44-byte entries of +-13 offsets) and returns whether the step is allowed; NpcHelper::hornfel_spawn_doors, room_grid_flood_fill prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall RoomGridPath::can_step(void *this,int fromIndex,int toIndex) { byte bVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; float *pfVar7; int iVar8; iVar8 = *(int *)(*(int *)this + 0xc); uVar2 = toIndex / iVar8 - fromIndex / iVar8; uVar6 = toIndex % iVar8 - fromIndex % iVar8; if (((((uVar2 ^ (int)uVar2 >> 0x1f) - ((int)uVar2 >> 0x1f)) + ((uVar6 ^ (int)uVar6 >> 0x1f) - ((int)uVar6 >> 0x1f)) == 1) && ((uint)fromIndex < 0x1c0)) && (bVar1 = *(byte *)(fromIndex + 4 + (int)this), bVar1 != 0xff)) { iVar8 = 0; uVar3 = bVar1 & 0xf; if (0 < *(int *)(&DAT_00c37610 + uVar3 * 0x44)) { pfVar7 = (float *)(&DAT_00c37614 + uVar3 * 0x44); do { if (*pfVar7 == -13.0) { uVar5 = 0xffffffff; } else { uVar5 = 0; if (*pfVar7 == 13.0) { uVar5 = 1; } } if (pfVar7[1] == -13.0) { uVar4 = 0xffffffff; } else { uVar4 = 0; if (pfVar7[1] == 13.0) { uVar4 = 1; } } if ((uVar5 == uVar6) && (uVar4 == uVar2)) { return 1; } iVar8 = iVar8 + 1; pfVar7 = pfVar7 + 2; } while (iVar8 < *(int *)(&DAT_00c37610 + uVar3 * 0x44)); } } return 0; } //@@ 009e3560 room_grid_flood_fill /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? this holds Room* (uses _gridWidth/_gridHeight): BitSet of 448 grid bits (memset 0x38) seeded with param_1 index, allocates a std::list, iterative fill; returns bool; callers Entity_NPC::HandleCollision and 004b70c0 NpcHelper::hornfel_spawn_doors undefined1 room_grid_flood_fill(uint param_1,uint param_2) { int *ptr; byte bVar1; uint uVar2; uint *puVar3; int iVar4; int iVar5; int *in_ECX; int iVar6; void *pvVar7; void *pvVar8; undefined1 uVar9; uint uVar10; undefined4 uVar11; int iVar12; uint local_94; int local_90; int local_8c; int local_88; int local_84; uint local_80; uint local_7c; uint *local_78; uint local_74; int local_70; int *local_6c; void *local_68; int local_64; undefined4 local_60; int local_5c; int local_58; uint local_54; int *local_50; uint local_4c [15]; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f8ed; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_4c + 0x12); ExceptionList = &local_10; local_50 = in_ECX; local_4c[0xe] = uVar2; memset(local_4c,0,0x38); local_6c = (int *)0x0; local_68 = (void *)0x0; local_64 = 0; local_60 = 0; local_5c = 0; local_6c = operator_new(8); local_6c[1] = 0; *local_6c = (int)&local_6c; local_8 = 0; local_80 = param_1; local_7c = 0xffffffff; std::deque::push_back(&local_80); if (0x1bf < param_1) { /* WARNING: Subroutine does not return */ std::bitset::_Xran(uVar2); } uVar2 = 1 << (param_1 & 0x1f); uVar10 = 0; if (0x1f < (param_1 & 0x3f)) { uVar10 = uVar2; } uVar2 = uVar2 ^ uVar10; if (0x3f < (param_1 & 0x3f)) { uVar10 = uVar2; } local_4c[(param_1 >> 6) * 2] = local_4c[(param_1 >> 6) * 2] | uVar2; iVar5 = *in_ECX; local_4c[(param_1 >> 6) * 2 + 1] = local_4c[(param_1 >> 6) * 2 + 1] | uVar10; local_70 = *(int *)(iVar5 + 0xc); local_8c = *(int *)(iVar5 + 0x10); uVar11 = local_60; iVar5 = local_5c; do { local_60 = uVar11; if (iVar5 == 0) { uVar9 = 0; local_5c = 0; LAB_009e37c8: if (local_5c != 0) { do { local_5c = local_5c + -1; } while (local_5c != 0); local_60 = 0; local_5c = 0; } pvVar7 = local_68; iVar5 = local_64; if (local_64 != 0) { do { pvVar8 = *(void **)((int)pvVar7 + iVar5 * 4 + -4); iVar5 = iVar5 + -1; if (pvVar8 != (void *)0x0) { operator_delete(pvVar8,0x10); pvVar7 = local_68; } } while (iVar5 != 0); } if (pvVar7 != (void *)0x0) { uVar2 = local_64 * 4; pvVar8 = pvVar7; if (0xfff < uVar2) { pvVar8 = *(void **)((int)pvVar7 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)pvVar7 + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar2); } ptr = local_6c; local_64 = 0; local_68 = (void *)0x0; local_6c = (int *)0x0; operator_delete(ptr,8); ExceptionList = local_10; return uVar9; } local_5c = iVar5; puVar3 = (uint *)FUN_009e3d30(); local_74 = *puVar3; iVar4 = FUN_009e3d30(); local_5c = iVar5 + -1; local_84 = *(int *)(iVar4 + 4); if (local_5c == 0) { uVar11 = 0; } local_60 = uVar11; if (local_74 == param_2) { uVar9 = 1; goto LAB_009e37c8; } iVar5 = local_5c; if (local_74 < 0x1c0) { bVar1 = *(byte *)((int)in_ECX + local_74 + 4); if (bVar1 != 0xff) { iVar12 = 0; uVar2 = bVar1 & 0xf; local_88 = (int)local_74 / local_70; iVar4 = (int)local_74 % local_70; local_58 = iVar4; local_54 = uVar2; do { if (uVar2 == 6) { if (iVar12 == local_84) goto LAB_009e36ce; } else { LAB_009e36ce: iVar5 = (&DAT_00b804e4)[iVar12 * 2] + local_88; iVar6 = (&DAT_00b804e0)[iVar12 * 2] + iVar4; if (-1 < iVar6) { if (-1 < iVar5) { if (iVar6 < local_70) { if (iVar5 < local_8c) { iVar4 = *(int *)(*in_ECX + 0xc); if ((iVar6 < iVar4) && (iVar5 < *(int *)(*in_ECX + 0x10))) { uVar2 = iVar4 * iVar5 + iVar6; } else { uVar2 = 0xffffffff; } uVar10 = 1 << (uVar2 & 0x1f); local_7c = 0; if (0x1f < (uVar2 & 0x3f)) { local_7c = uVar10; } uVar10 = uVar10 ^ local_7c; if (0x3f < (uVar2 & 0x3f)) { local_7c = uVar10; } local_78 = local_4c + (uVar2 >> 6) * 2; if (((((uVar10 & *local_78) == 0 && (local_7c & local_4c[(uVar2 >> 6) * 2 + 1]) == 0) && (uVar2 < 0x1c0)) && (*(char *)((int)local_50 + uVar2 + 4) != -1)) && (bVar1 = RoomGridPath::can_step(local_50,local_74,uVar2), bVar1 != 0)) { local_94 = uVar2; local_90 = iVar12; std::deque::push_back(&local_94); *local_78 = *local_78 | uVar10; local_78[1] = local_78[1] | local_7c; } iVar4 = local_58; in_ECX = local_50; uVar2 = local_54; } } } } } iVar12 = iVar12 + 1; uVar11 = local_60; iVar5 = local_5c; } while (iVar12 < 4); } } } while( true ); } //@@ 009e38a0 RailManager::get_closest_rail_point /* DB: ? (pos, vel, gridIndex, railType, out closest, out dir, out dist(1e16 init), out t, out bool): walks the rail-type segment table DAT_00c37610 (0x44 bytes per type, 8-byte segment endpoints) offset to the grid cell (col*40+40, row*40+120 using room width *ECX+0xc), projecting pos onto each segment; types 7..10 flagged as curves; Entity_NPC::apply_velocity (minecart rail following) */ void RailManager::get_closest_rail_point (float *param_1,float *param_2,uint param_3,int param_4,float *param_5,float *param_6 ,float *param_7,float *param_8,undefined1 *param_9) { int iVar1; int iVar2; bool bVar3; int *in_ECX; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float local_28; float local_24; int local_18; iVar2 = *(int *)(*in_ECX + 0xc); *param_8 = 0.0; *param_5 = g_vectorZero.x; param_5[1] = g_vectorZero.y; *param_6 = g_vectorZero.x; fVar5 = g_vectorZero.y; *param_7 = 1e+16; param_6[1] = fVar5; if ((((param_4 == 9) || (param_4 == 10)) || (param_4 == 7)) || (bVar3 = false, param_4 == 8)) { bVar3 = true; } *param_9 = 0; local_18 = 0; if (0 < *(int *)(&DAT_00c37610 + param_4 * 0x44) + -1) { fVar5 = DAT_00c35ec8; fVar11 = DAT_00c35ec4; do { while( true ) { iVar1 = local_18 * 8; fVar12 = *(float *)(&DAT_00c37614 + param_4 * 0x44 + iVar1); if (((fVar12 != fVar11) || (*(float *)(&DAT_00c37618 + param_4 * 0x44 + iVar1) != fVar5)) && ((*(float *)(&DAT_00c3761c + param_4 * 0x44 + iVar1) != fVar11 || (*(float *)(&DAT_00c37620 + param_4 * 0x44 + iVar1) != fVar5)))) break; local_18 = local_18 + 1; } fVar6 = *(float *)(&DAT_00c3761c + param_4 * 0x44 + iVar1) - fVar12; fVar12 = fVar12 + (float)((int)param_3 % iVar2) * 40.0 + 40.0; fVar7 = *(float *)(&DAT_00c37620 + param_4 * 0x44 + iVar1) - *(float *)(&DAT_00c37618 + param_4 * 0x44 + iVar1); fVar13 = *(float *)(&DAT_00c37618 + param_4 * 0x44 + iVar1) + (float)((int)param_3 / iVar2) * 40.0 + 120.0; fVar5 = *param_1; fVar11 = param_1[1]; fVar10 = fVar7 * fVar7 + fVar6 * fVar6; local_28 = param_2[1]; local_24 = *param_2; fVar8 = ((fVar11 - fVar13) * fVar7 + (fVar5 - fVar12) * fVar6) / fVar10; fVar4 = sqrtf(local_28 * local_28 + local_24 * local_24); if (0.0 < fVar4) { local_24 = local_24 * (1.0 / fVar4); local_28 = local_28 * (1.0 / fVar4); } fVar4 = sqrtf(fVar10); if (fVar4 <= 0.0) { fVar10 = fVar7; fVar9 = fVar6; } else { fVar10 = fVar7 * (1.0 / fVar4); fVar9 = fVar6 * (1.0 / fVar4); } if (((0.0 <= fVar8) || (local_18 < 1)) || (((float)(&DAT_00c3760c)[local_18 * 2 + param_4 * 0x11] == DAT_00c35ec4 && (*(float *)(&DAT_00c37610 + param_4 * 0x44 + iVar1) == DAT_00c35ec8)))) { if (((1.0 < fVar8) && (local_18 < *(int *)(&DAT_00c37610 + param_4 * 0x44) + -2)) && (((float)(&DAT_00c37624)[local_18 * 2 + param_4 * 0x11] != DAT_00c35ec4 || ((float)(&DAT_00c37628)[local_18 * 2 + param_4 * 0x11] != DAT_00c35ec8)))) { fVar8 = 1.0; } } else { fVar8 = 0.0; } fVar12 = fVar6 * fVar8 + fVar12; fVar13 = fVar7 * fVar8 + fVar13; fVar5 = fVar5 - fVar12; fVar11 = fVar11 - fVar13; fVar5 = (fVar11 * fVar11 + fVar5 * fVar5) - ABS(fVar9 * local_24 + fVar10 * local_28) * 10.0; if (fVar5 < *param_7) { *param_7 = fVar5; *param_8 = fVar8; *param_5 = fVar12; param_5[1] = fVar13; if (0.0 < fVar4) { fVar6 = fVar6 * (1.0 / fVar4); fVar7 = fVar7 * (1.0 / fVar4); } *param_6 = fVar6; param_6[1] = fVar7; } local_18 = local_18 + 1; fVar5 = DAT_00c35ec8; fVar11 = DAT_00c35ec4; } while (local_18 < *(int *)(&DAT_00c37610 + param_4 * 0x44) + -1); } if (((bVar3) && (1.0 <= *param_8)) && (0.0 < param_2[1] * param_6[1] + *param_6 * *param_2)) { *param_9 = 1; } fVar5 = param_6[1] * param_2[1] + *param_6 * *param_2; if (fVar5 == 0.0) { if ((param_3 & 1) != 0) { return; } } else if (0.0 <= fVar5) { return; } *param_6 = *param_6 * -1.0; param_6[1] = param_6[1] * -1.0; return; } //@@ 009e3d30 FUN_009e3d30 int FUN_009e3d30(void) { uint uVar1; int in_ECX; uVar1 = (*(int *)(in_ECX + 0x10) + *(int *)(in_ECX + 0xc)) - 1; return *(int *)(*(int *)(in_ECX + 4) + (uVar1 >> 1 & *(int *)(in_ECX + 8) - 1U) * 4) + (uVar1 & 1) * 8; } //@@ 009e3d60 FUN_009e3d60 void FUN_009e3d60(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(undefined4 **)(in_ECX + 4) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 4))(1,__security_cookie ^ (int)register0x00000010 - 4U); } std::string::_Tidy_deallocate((char *)(in_ECX + 0x20)); std::string::_Tidy_deallocate((char *)(in_ECX + 8)); ExceptionList = local_10; return; } //@@ 009e3dc0 RebirthSaveData::Clear /* DB: ? thiscall: zeroes a Rebirth-format save block (achievement byte arrays 0xb3 / 0x15b, 0x5f dwords at +0xec, counters +0x3c4..+0x4a4, flags); PersistentGameData::TryImportRebirthLocalSave before parsing the old save */ void RebirthSaveData::Clear(void) { undefined2 *in_ECX; int iVar1; undefined4 *puVar2; *(undefined4 *)(in_ECX + 0x250) = 0; *(undefined4 *)(in_ECX + 0x252) = 0; memset(in_ECX + 0x1c,0,0xb3); memset(in_ECX + 0x134,0,0x15b); puVar2 = (undefined4 *)(in_ECX + 0x76); for (iVar1 = 0x5f; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar2 = 0; puVar2 = puVar2 + 1; } *(undefined4 *)(in_ECX + 0x1e2) = 0; *(undefined4 *)(in_ECX + 0x1e4) = 0; *(undefined4 *)(in_ECX + 0x1e6) = 0; *(undefined4 *)(in_ECX + 0x1e8) = 0; *(undefined4 *)(in_ECX + 0x1ea) = 0; *(undefined4 *)(in_ECX + 0x1ec) = 0; *(undefined4 *)(in_ECX + 0x1ee) = 0; *(undefined4 *)(in_ECX + 0x1f0) = 0; *(undefined4 *)(in_ECX + 0x1f2) = 0; *(undefined4 *)(in_ECX + 500) = 0; *(undefined4 *)(in_ECX + 0x1f6) = 0; *(undefined4 *)(in_ECX + 0x1f8) = 0; *(undefined4 *)(in_ECX + 0x1fa) = 0; in_ECX[0x1fc] = 0; *(undefined1 *)(in_ECX + 0x1fd) = 0; memset((void *)((int)in_ECX + 0x3fb),0,0x39); *(undefined4 *)(in_ECX + 0x21a) = 0; *(undefined4 *)(in_ECX + 0x21c) = 0; *(undefined4 *)(in_ECX + 0x21e) = 0; *(undefined4 *)(in_ECX + 0x220) = 0; *(undefined4 *)(in_ECX + 0x222) = 0; *(undefined1 *)(in_ECX + 0x224) = 0; *(undefined4 *)(in_ECX + 0x226) = 0; *(undefined4 *)(in_ECX + 0x228) = 0; *(undefined4 *)(in_ECX + 0x22a) = 0; *(undefined4 *)(in_ECX + 0x22c) = 0; *(undefined4 *)(in_ECX + 0x22e) = 0; *(undefined4 *)(in_ECX + 0x230) = 0; *(undefined4 *)(in_ECX + 0x232) = 0; *(undefined4 *)(in_ECX + 0x234) = 0; *(undefined4 *)(in_ECX + 0x236) = 0; *(undefined4 *)(in_ECX + 0x238) = 0; *(undefined4 *)(in_ECX + 0x23a) = 0; *(undefined4 *)(in_ECX + 0x23c) = 0; *(undefined4 *)(in_ECX + 0x23e) = 0; *(undefined4 *)(in_ECX + 0x240) = 0; *(undefined4 *)(in_ECX + 0x242) = 0; *(undefined4 *)(in_ECX + 0x244) = 0; *(undefined4 *)(in_ECX + 0x246) = 0; *(undefined4 *)(in_ECX + 0x248) = 0; *(undefined4 *)(in_ECX + 0x24a) = 0; *(undefined4 *)(in_ECX + 0x24c) = 0; *(undefined4 *)(in_ECX + 0x24e) = 0; *in_ECX = 0; return; } //@@ 009e4af0 RebirthSaveData::repair_counters /* DB: ? thiscall, only call at end of the Rebirth save parser (0x9e4613, reached from PersistentGameData::TryImportRebirthLocalSave); for each set flag/count (+0x3c, +0xf0.., +0x148..+0x150) clamps a counter in +0x454..+0x498 to >=1 and +0x454 to >=1 */ void RebirthSaveData::repair_counters(void) { int iVar1; int iVar2; int *piVar3; int *piVar4; int in_ECX; int local_8; iVar1 = *(int *)(in_ECX + 0xf0); if (*(char *)(in_ECX + 0x3c) != '\0') { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x458)) { piVar3 = (int *)(in_ECX + 0x458); } piVar4 = (int *)(in_ECX + 0x454); *(int *)(in_ECX + 0x458) = *piVar3; local_8 = 1; piVar3 = &local_8; if (1 < *piVar4) { piVar3 = piVar4; } iVar2 = *piVar3; *piVar4 = iVar2; piVar3 = &local_8; if (1 < iVar2) { piVar3 = piVar4; } local_8 = 1; iVar2 = *piVar3; *piVar4 = iVar2; piVar3 = &local_8; if (1 < iVar2) { piVar3 = piVar4; } local_8 = 1; *piVar4 = *piVar3; } if (0 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x45c)) { piVar3 = (int *)(in_ECX + 0x45c); } *(int *)(in_ECX + 0x45c) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (1 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x460)) { piVar3 = (int *)(in_ECX + 0x460); } *(int *)(in_ECX + 0x460) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (2 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x464)) { piVar3 = (int *)(in_ECX + 0x464); } *(int *)(in_ECX + 0x464) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (3 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x468)) { piVar3 = (int *)(in_ECX + 0x468); } *(int *)(in_ECX + 0x468) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (4 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x46c)) { piVar3 = (int *)(in_ECX + 0x46c); } *(int *)(in_ECX + 0x46c) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (5 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x470)) { piVar3 = (int *)(in_ECX + 0x470); } *(int *)(in_ECX + 0x470) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (6 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x474)) { piVar3 = (int *)(in_ECX + 0x474); } *(int *)(in_ECX + 0x474) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (7 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x478)) { piVar3 = (int *)(in_ECX + 0x478); } *(int *)(in_ECX + 0x478) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (8 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x47c)) { piVar3 = (int *)(in_ECX + 0x47c); } *(int *)(in_ECX + 0x47c) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (9 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x480)) { piVar3 = (int *)(in_ECX + 0x480); } *(int *)(in_ECX + 0x480) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; if (10 < iVar1) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x484)) { piVar3 = (int *)(in_ECX + 0x484); } *(int *)(in_ECX + 0x484) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } } } } } } } } } } } if (0 < *(int *)(in_ECX + 0x11c)) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x488)) { piVar3 = (int *)(in_ECX + 0x488); } *(int *)(in_ECX + 0x488) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < *(int *)(in_ECX + 0x114)) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x48c)) { piVar3 = (int *)(in_ECX + 0x48c); } *(int *)(in_ECX + 0x48c) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < *(int *)(in_ECX + 0x14c)) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x494)) { piVar3 = (int *)(in_ECX + 0x494); } *(int *)(in_ECX + 0x494) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < *(int *)(in_ECX + 0x148)) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x490)) { piVar3 = (int *)(in_ECX + 0x490); } *(int *)(in_ECX + 0x490) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } if (0 < *(int *)(in_ECX + 0x150)) { local_8 = 1; piVar3 = &local_8; if (1 < *(int *)(in_ECX + 0x498)) { piVar3 = (int *)(in_ECX + 0x498); } *(int *)(in_ECX + 0x498) = *piVar3; piVar3 = (int *)(in_ECX + 0x454); local_8 = 1; piVar4 = &local_8; if (1 < *piVar3) { piVar4 = piVar3; } *piVar3 = *piVar4; } return; } //@@ 009e5000 get_rich_presence_room_status /* DB: ? returns a status id for the current location: 0 outside a run, 0x19 dimension 2, 0x18/0x1a/0x1b/0x1c for special room flags/ids (-0x14, -0xd, -0xc), else a switch on Room type (+8) (2->9, 3->0xb, ..), challenge 0x1f, greed-mode wave ids 0x20..0x23; NetplayManager::Update caches it at +0x18c0 with stage/greed state and refreshes presence (FUN_009128e0) when it changes */ int get_rich_presence_room_status(void) { void *pvVar1; int *piVar2; uint uVar3; int iVar4; Game *pGVar5; byte bVar6; int in_ECX; pGVar5 = g_game; if ((g_game != (Game *)0x0) && (g_game->_stage != 0)) { if (g_game->_currentDimensionIdx == 2) { return 0x19; } pvVar1 = g_game->_room; piVar2 = *(int **)((int)pvVar1 + 4); uVar3 = piVar2[0x11]; if ((uVar3 >> 10 & 1) != 0) { return 0x18; } if (*piVar2 == -0x14) { return 0x1a; } if (*piVar2 == -0xd) { return 0x1b; } if (piVar2[2] == -0xc) { return 0x1c; } if ((g_game->_stage != 0xd) || (g_game->_stageType != 1)) { switch(*(undefined4 *)((int)pvVar1 + 8)) { case 2: return 9; case 3: return 0xb; case 4: return 0x12; case 5: goto switchD_009e50ae_caseD_5; case 6: return 3; case 7: return 0x14; case 8: return 0x15; case 9: return 4; case 10: return 0xd; case 0xb: return 0xe; case 0xc: return 0x10; case 0xd: return 0x11; case 0xe: return 5; case 0xf: return 6; case 0x10: return 0x16; case 0x11: return 0xc; case 0x12: return 8; case 0x13: return 7; case 0x14: return 0x13; case 0x15: return 0xf; case 0x16: return 10; default: if (g_game->_challenge != 0) { return 0x1f; } bVar6 = Game::IsGreedMode(g_game); if (bVar6 == 0) { return 0; } if ((*(int *)((int)pvVar1 + 0x723c) == -1) && ((uVar3 & 1) != 0)) { return 0x20; } iVar4 = pGVar5->_difficulty; uVar3 = pGVar5->_greedModeWave; if (uVar3 == (iVar4 == 3) + 0xb) { return 0x23; } return 0x22 - (uint)(uVar3 < (iVar4 == 3) + 9); case 0x18: return 0x17; } } if ((uVar3 & 1) == 0) { return (*(int *)((int)pvVar1 + 8) == 0x10) + 0x1d; } } return in_ECX; switchD_009e50ae_caseD_5: iVar4 = *(int *)((int)pvVar1 + 0x1bb0); if (iVar4 == 0x37) { return 1; } if ((iVar4 == 0x3e) || (iVar4 == 0x47)) { return 0x24; } return 2; } //@@ 009e5300 ScoreSheet::ScoreSheet /* DB: zeroes the vectors at +0x40/+0x5c/+0x68/+0x7c then FUN_009e53a0 (ScoreSheet reset: zeroes bonus ints +0..+0x34, clears vectors, run ending); REPENTOGON ScoreSheet has _runTime at +0x40 region; Game::constructor, Leaderboard::render_scores builds one per row prototype: db/protos.zhl */ void * __thiscall ScoreSheet::ScoreSheet(ScoreSheet *this) { this[0x10] = (ScoreSheet)0x0; this[0x11] = (ScoreSheet)0x0; this[0x12] = (ScoreSheet)0x0; this[0x17] = (ScoreSheet)0x0; this[0x18] = (ScoreSheet)0x0; this[0x19] = (ScoreSheet)0x0; this[0x1a] = (ScoreSheet)0x0; this[0x1b] = (ScoreSheet)0x0; this[0x1c] = (ScoreSheet)0x0; this[0x1f] = (ScoreSheet)0x0; this[0x20] = (ScoreSheet)0x0; this[0x21] = (ScoreSheet)0x0; Reset(); return this; } //@@ 009e5370 FUN_009e5370 void FUN_009e5370(void) { std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); std::vector<12byte>::_Tidy(); return; } //@@ 009e53a0 ScoreSheet::Reset /* DB: clears the vectors (+0x40, +0x5c, +0x68, +0x7c end=begin) and the score ints, then stores the build id from "J460"/"1"/"9" (cached in DAT_00c5c4dc) at +0x8c; ScoreSheet::ScoreSheet and Game::reset_run_state */ void ScoreSheet::Reset(void) { int iVar1; uint uVar2; uint uVar3; undefined4 *in_ECX; char *_Str; in_ECX[0x18] = in_ECX[0x17]; in_ECX[0x1b] = in_ECX[0x1a]; in_ECX[0x20] = in_ECX[0x1f]; in_ECX[0x11] = in_ECX[0x10]; uVar2 = DAT_00c5c4dc; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0; in_ECX[0x16] = 0; in_ECX[0x1d] = 0; in_ECX[0x1e] = 0; *(undefined1 *)(in_ECX + 0x22) = 0; if (uVar2 == 0xffffffff) { iVar1 = isdigit(0x4a); if (iVar1 == 0) { _Str = "460"; } else { _Str = "J460"; } uVar2 = atoi(_Str); iVar1 = atoi("1"); uVar3 = atoi("9"); uVar2 = (uVar3 | iVar1 << 8) << 0x10 | uVar2; DAT_00c5c4dc = uVar2; } in_ECX[0x23] = uVar2; return; } //@@ 009e54d0 ScoreSheet::store_state /* DB: (dst): copies the same fields and 12-byte vectors (+0x5c, +0x68, +0x7c) into the saved block; Game::store_game_state; mirror of 009e5710 ScoreSheet::restore_state void ScoreSheet::store_state(undefined4 *param_1) { undefined8 *puVar1; int iVar2; undefined4 *puVar3; undefined8 *puVar4; int in_ECX; int iVar5; int local_8; puVar3 = param_1; param_1 = (undefined4 *)0x0; *puVar3 = *(undefined4 *)(in_ECX + 0x38); puVar3[1] = *(undefined4 *)(in_ECX + 0x3c); puVar3[2] = *(undefined4 *)(in_ECX + 0x4c); puVar3[3] = *(undefined4 *)(in_ECX + 0x50); puVar3[4] = *(undefined4 *)(in_ECX + 0x54); puVar3[5] = *(undefined4 *)(in_ECX + 0x58); puVar3[7] = puVar3[6]; iVar5 = *(int *)(in_ECX + 0x60) - *(int *)(in_ECX + 0x5c); iVar2 = iVar5 >> 0x1f; if (iVar5 / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = (undefined8 *)puVar3[7]; puVar4 = (undefined8 *)(*(int *)(in_ECX + 0x5c) + local_8); if (puVar1 == (undefined8 *)puVar3[8]) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); puVar3[7] = puVar3[7] + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((*(int *)(in_ECX + 0x60) - *(int *)(in_ECX + 0x5c)) / 0xc)); } puVar3[10] = puVar3[9]; param_1 = (undefined4 *)0x0; iVar5 = *(int *)(in_ECX + 0x6c) - *(int *)(in_ECX + 0x68); iVar2 = iVar5 >> 0x1f; if (iVar5 / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = (undefined8 *)puVar3[10]; puVar4 = (undefined8 *)(*(int *)(in_ECX + 0x68) + local_8); if (puVar1 == (undefined8 *)puVar3[0xb]) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); puVar3[10] = puVar3[10] + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((*(int *)(in_ECX + 0x6c) - *(int *)(in_ECX + 0x68)) / 0xc)); } puVar3[0xc] = *(undefined4 *)(in_ECX + 0x74); puVar3[0xd] = *(undefined4 *)(in_ECX + 0x78); puVar3[0x12] = puVar3[0x11]; param_1 = (undefined4 *)0x0; iVar5 = *(int *)(in_ECX + 0x80) - *(int *)(in_ECX + 0x7c); iVar2 = iVar5 >> 0x1f; if (iVar5 / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = (undefined8 *)puVar3[0x12]; puVar4 = (undefined8 *)(*(int *)(in_ECX + 0x7c) + local_8); if (puVar1 == (undefined8 *)puVar3[0x13]) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); puVar3[0x12] = puVar3[0x12] + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((*(int *)(in_ECX + 0x80) - *(int *)(in_ECX + 0x7c)) / 0xc)); } puVar3[0xf] = puVar3[0xe]; param_1 = (undefined4 *)0x0; iVar5 = *(int *)(in_ECX + 0x44) - *(int *)(in_ECX + 0x40); iVar2 = iVar5 >> 0x1f; if (iVar5 / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = (undefined8 *)puVar3[0xf]; puVar4 = (undefined8 *)(*(int *)(in_ECX + 0x40) + local_8); if (puVar1 == (undefined8 *)puVar3[0x10]) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); puVar3[0xf] = puVar3[0xf] + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((*(int *)(in_ECX + 0x44) - *(int *)(in_ECX + 0x40)) / 0xc)); } return; } //@@ 009e5710 ScoreSheet::restore_state /* DB: (src): copies the ints (+0x38/+0x3c/+0x4c..+0x58, +0x74/+0x78 ..) and the 12-byte vectors (+0x5c, +0x68, +0x7c) back from the saved block; Game::restore_game_state; mirror of 009e54d0 ScoreSheet::store_state void ScoreSheet::restore_state(undefined4 *param_1) { undefined8 *puVar1; int iVar2; undefined4 *puVar3; undefined8 *puVar4; int in_ECX; int local_8; puVar3 = param_1; param_1 = (undefined4 *)0x0; *(undefined4 *)(in_ECX + 0x38) = *puVar3; *(undefined4 *)(in_ECX + 0x3c) = puVar3[1]; *(undefined4 *)(in_ECX + 0x4c) = puVar3[2]; *(undefined4 *)(in_ECX + 0x50) = puVar3[3]; *(undefined4 *)(in_ECX + 0x54) = puVar3[4]; *(undefined4 *)(in_ECX + 0x58) = puVar3[5]; *(undefined4 *)(in_ECX + 0x60) = *(undefined4 *)(in_ECX + 0x5c); iVar2 = (int)(puVar3[7] - puVar3[6]) >> 0x1f; if ((int)(puVar3[7] - puVar3[6]) / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = *(undefined8 **)(in_ECX + 0x60); puVar4 = (undefined8 *)(puVar3[6] + local_8); if (puVar1 == *(undefined8 **)(in_ECX + 100)) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); *(int *)(in_ECX + 0x60) = *(int *)(in_ECX + 0x60) + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((int)(puVar3[7] - puVar3[6]) / 0xc)); } *(undefined4 *)(in_ECX + 0x6c) = *(undefined4 *)(in_ECX + 0x68); param_1 = (undefined4 *)0x0; iVar2 = (int)(puVar3[10] - puVar3[9]) >> 0x1f; if ((int)(puVar3[10] - puVar3[9]) / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = *(undefined8 **)(in_ECX + 0x6c); puVar4 = (undefined8 *)(puVar3[9] + local_8); if (puVar1 == *(undefined8 **)(in_ECX + 0x70)) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); *(int *)(in_ECX + 0x6c) = *(int *)(in_ECX + 0x6c) + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((int)(puVar3[10] - puVar3[9]) / 0xc)); } *(undefined4 *)(in_ECX + 0x74) = puVar3[0xc]; *(undefined4 *)(in_ECX + 0x78) = puVar3[0xd]; *(undefined4 *)(in_ECX + 0x80) = *(undefined4 *)(in_ECX + 0x7c); param_1 = (undefined4 *)0x0; iVar2 = (int)(puVar3[0x12] - puVar3[0x11]) >> 0x1f; if ((int)(puVar3[0x12] - puVar3[0x11]) / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = *(undefined8 **)(in_ECX + 0x80); puVar4 = (undefined8 *)(puVar3[0x11] + local_8); if (puVar1 == *(undefined8 **)(in_ECX + 0x84)) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); *(int *)(in_ECX + 0x80) = *(int *)(in_ECX + 0x80) + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((int)(puVar3[0x12] - puVar3[0x11]) / 0xc)); } *(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(in_ECX + 0x40); param_1 = (undefined4 *)0x0; iVar2 = (int)(puVar3[0xf] - puVar3[0xe]) >> 0x1f; if ((int)(puVar3[0xf] - puVar3[0xe]) / 0xc + iVar2 != iVar2) { local_8 = 0; do { puVar1 = *(undefined8 **)(in_ECX + 0x44); puVar4 = (undefined8 *)(puVar3[0xe] + local_8); if (puVar1 == *(undefined8 **)(in_ECX + 0x48)) { std::vector<12byte>::_Emplace_reallocate(puVar1,puVar4); } else { *puVar1 = *puVar4; *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1); *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + 0xc; } local_8 = local_8 + 0xc; param_1 = (undefined4 *)((int)param_1 + 1); } while (param_1 < (uint)((int)(puVar3[0xf] - puVar3[0xe]) / 0xc)); } return; } //@@ 009e5960 ScoreSheet::add_cleared_room /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX is the ScoreSheet (009e5300 ScoreSheet::ScoreSheet inits the same +0x5c vector); (roomType, roomShape, clearCount, flag) with float in XMM0: when param_3==1 and amount > 0 pushes FUN_009e6740(shape) entries {roomType, flag, amount} (2 for shapes 8..12 i.e. 2x2/L rooms, else 1) into the vector at ECX+0x60 (realloc 0069ee50), and adds the count to ECX+0x74 for roomType 0xb; Room::TriggerClear, Room::on_leave, Ambush::Update prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall ScoreSheet::add_cleared_room(ScoreSheet *this,int roomType,int roomShape,int clearCount,byte isFlag) { ScoreSheet SVar1; undefined4 uVar2; int iVar3; uint uVar4; int iVar5; Game *pGVar6; float in_XMM0_Da; int local_14; undefined4 uStack_10; float local_c; undefined4 local_8; pGVar6 = g_game; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (clearCount == 1) { uVar4 = *(uint *)((int)&g_game->_gameStateFlags + 4) & 0x10000; if (uVar4 == 0) { uVar2 = 0; } else { uVar2 = CONCAT31((int3)(uVar4 >> 8),1); } find_stage_entry(g_game->_stage,g_game->_stageType,uVar2); if (0.0 < in_XMM0_Da) { local_14 = roomType; uStack_10 = CONCAT31(uStack_10._1_3_,isFlag); local_c = in_XMM0_Da; iVar3 = FUN_009e6740(roomShape); if (0 < iVar3) { iVar5 = iVar3; do { SVar1 = this[0x18]; if (SVar1 == this[0x19]) { std::vector<12byte>::_Emplace_reallocate(SVar1,&local_14); } else { *(ulonglong *)SVar1 = CONCAT44(uStack_10,local_14); *(float *)((int)SVar1 + 8) = local_c; this[0x18] = (ScoreSheet)((int)this[0x18] + 0xc); } iVar5 = iVar5 + -1; } while (iVar5 != 0); pGVar6 = g_game; } if ((roomType == 0xb) && (pGVar6->_bossChallenge != 0)) { this[0x1d] = (ScoreSheet)((int)this[0x1d] + iVar3); } } } return; } //@@ 009e5a30 FUN_009e5a30 void FUN_009e5a30(int param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4) { undefined8 *puVar1; int in_ECX; int local_10; undefined4 uStack_c; undefined4 local_8; if ((*(int *)(in_ECX + 0x38) < param_1) && (((g_game->_dailyChallenge)._id == 0 || (param_1 <= (g_game->_dailyChallenge)._params._endStage)))) { *(int *)(in_ECX + 0x38) = param_1; *(undefined4 *)(in_ECX + 0x3c) = param_2; *(undefined4 *)(in_ECX + 0x4c) = param_3; } local_10 = param_1; puVar1 = *(undefined8 **)(in_ECX + 0x80); uStack_c = param_2; local_8 = CONCAT31(local_8._1_3_,param_4); if (puVar1 == *(undefined8 **)(in_ECX + 0x84)) { std::vector<12byte>::_Emplace_reallocate(puVar1,&local_10); return; } *puVar1 = CONCAT44(param_2,param_1); *(undefined4 *)(puVar1 + 1) = local_8; *(int *)(in_ECX + 0x80) = *(int *)(in_ECX + 0x80) + 0xc; return; } //@@ 009e5ab0 ScoreSheet::add_pickup_points /* DB: (pickupVariant, subType, pos*): unless Game +0x67744, with SEED_G_FUEL (0x4f) and variant 100 / subtype -1 awards (stage+4)*200, spawns ENTITY_TEXT 9001.2 at pos-(0,8) showing the value, adds it to this+0x50; Entity_Pickup::HandleCollision on pickup */ void ScoreSheet::add_pickup_points(int param_1,int param_2,float *param_3) { int iVar1; Game *pGVar2; byte bVar3; uint seed; Entity *pEVar4; int in_ECX; int iVar5; Vector local_1c; Vector local_14; void *local_c; pGVar2 = g_game; if (g_game->_isRoomRespawned == 0) { iVar5 = 0; if ((param_1 == 100) && (param_2 == -1)) { bVar3 = Seeds::HasSeedEffect(&g_game->_seedEffects,0x4f); if (bVar3 != 0) { iVar5 = (pGVar2->_stage + 4) * 200; } } local_1c.x = 1.10703e-43; std::set::find_node(&local_14,&local_1c); if ((((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) < 0x50)) && (local_c != (pGVar2->_seedEffects)._seedEffects)) && (((*param_3 != g_vectorZero.x || (param_3[1] != g_vectorZero.y)) && (0 < iVar5)))) { seed = Random(); local_14.x = *param_3 - 0.0; local_14.y = param_3[1] - 8.0; local_1c.x = 0.0; local_1c.y = -2.0; pEVar4 = Game::SpawnEx(g_game,0x2329,2,&local_14,&local_1c,(Entity *)0x0,0,seed,0); iVar1 = *(int *)pEVar4; (pEVar4->_targetPosition).y = 0.0; (pEVar4->_targetPosition).x = (float)iVar5; (**(code **)(iVar1 + 0xc))(); } *(int *)(in_ECX + 0x50) = *(int *)(in_ECX + 0x50) + iVar5; } return; } //@@ 009e5c00 award_fly_kill_points /* DB: ? called on fly kills; spawns ENTITY_TEXT 9001 with points, adds to this+0x54 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall award_fly_kill_points(void *this,Entity *fly) { Game *pGVar1; undefined4 uVar2; int iVar3; Entity *pEVar4; uint uVar5; float fVar6; float fVar7; double dVar8; Vector local_50; Vector local_48 [8]; pGVar1 = g_game; if ((((*(uint *)(*(int *)((int)g_game->_room + 4) + 0x44) >> 10 & 1) == 0) || (*(char *)((int)this + 0x88) == '\0')) && (g_game->_isRoomRespawned == 0)) { fVar6 = pow(fly->_maxHitPoints,0.2); fVar6 = fVar6 * 5.0; dVar8 = ceil((double)fVar6); uVar5 = *(uint *)((int)&pGVar1->_gameStateFlags + 4) & 0x10000; fVar7 = (float)dVar8 * fly->_scoreMultiplier; if (uVar5 == 0) { uVar2 = 0; } else { uVar2 = CONCAT31((int3)(uVar5 >> 8),1); } ScoreSheet::find_stage_entry(pGVar1->_stage,pGVar1->_stageType,uVar2); fVar6 = fVar6 * fVar7; iVar3 = PlayerManager::GetGFuelCount(); if ((0 < iVar3) && (0.0 < fVar6)) { fVar6 = fVar6 * 10.0; uVar5 = Random(); local_48[0].x = (fly->_pos).x - 0.0; local_48[0].y = (fly->_pos).y - 8.0; local_50.x = 0.0; local_50.y = -2.0; pEVar4 = Game::SpawnEx(g_game,0x2329,2,local_48,&local_50,(Entity *)0x0,0,uVar5,0); iVar3 = *(int *)pEVar4; (pEVar4->_targetPosition).x = fVar6; (pEVar4->_targetPosition).y = 0.0; (**(code **)(iVar3 + 0xc))(); } *(int *)((int)this + 0x54) = *(int *)((int)this + 0x54) + (int)fVar6; } return; } //@@ 009e5d90 ScoreSheet::Calculate /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall void ScoreSheet::Calculate(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall ScoreSheet::Calculate(ScoreSheet *this) { char cVar1; int iVar2; int iVar3; int iVar4; qword qVar5; Game *pGVar6; uint uVar7; int iVar8; int iVar9; ScoreSheet SVar10; ChallengeParam *pCVar11; ScoreSheet SVar12; Entity_Player *pEVar13; float fVar14; uint uVar15; char *pcVar16; int *piVar17; int *piVar18; int *piVar19; float fVar20; undefined1 auVar21 [12]; float fVar22; int iVar23; int iVar24; float fVar25; int iVar26; int iVar27; int iVar28; int iVar29; float fVar30; double dVar31; int local_94; int local_90; int local_8c; int local_88; ScoreSheet local_80; Entity_Player *local_7c; uint local_78; int local_74; Entity_Player *local_70; int *local_6c; int *local_68; int *local_64; int *local_60; undefined1 local_59; undefined4 local_58; float local_54; int *local_4c; int *local_48; int local_44 [9]; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; int local_14; puStack_20 = (undefined1 *)(local_44 + 0x10); puStack_18 = &LAB_00b0f92d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_44 + 0xd); ExceptionList = &local_1c; local_44[0] = 0x3c; local_44[1] = 0x78; local_44[2] = 0xb4; local_44[3] = 0xb4; local_44[4] = 300; local_44[5] = 300; local_44[6] = 0x168; local_44[7] = 0x168; local_6c = (int *)0x0; local_68 = (int *)0x0; local_64 = (int *)0x0; local_14 = 0; local_44[8] = uVar7; if (g_manager->_netplayManager == *(NetplayManager *)(g_manager + 1)) { local_70 = Game::GetPlayer(g_game,0); } else { puStack_20 = (undefined1 *)(local_44 + 0x10); iVar8 = FUN_0090b070(uVar7); if (iVar8 == 0) { local_70 = (Entity_Player *)0x0; } else { FUN_0090b070(uVar7); local_70 = (Entity_Player *)FUN_004253d0(); } } std::vector::_Emplace_reallocate(0,&local_70); local_60 = local_6c; if (*local_6c == 0) goto LAB_009e66e0; local_48 = *(int **)(*local_6c + 0x1d98); if (local_48 != (int *)0x0) { if (local_68 == local_64) { std::vector::_Emplace_reallocate(local_68,&local_48); local_60 = local_6c; } else { *local_68 = (int)local_48; local_68 = local_68 + 1; } } local_48 = *(int **)(*local_60 + 0x1e68); local_4c = local_68; if (local_48 != (int *)0x0) { if (local_68 == local_64) { local_6c = local_60; std::vector::_Emplace_reallocate(local_68,&local_48); local_60 = local_6c; } else { *local_68 = (int)local_48; local_68 = local_68 + 1; } local_48 = *(int **)(*(int *)(*local_60 + 0x1e68) + 0x1d98); local_4c = local_68; if (local_48 != (int *)0x0) { if (local_68 == local_64) { local_6c = local_60; std::vector::_Emplace_reallocate(local_68,&local_48); local_60 = local_6c; } else { *local_68 = (int)local_48; local_68 = local_68 + 1; } local_4c = local_68; } } local_48 = *(int **)(*local_60 + 0x1e6c); local_68 = local_4c; if (local_48 != (int *)0x0) { if (local_4c == local_64) { local_6c = local_60; std::vector::_Emplace_reallocate(local_4c,&local_48); local_60 = local_6c; } else { *local_4c = (int)local_48; local_68 = local_4c + 1; } local_48 = *(int **)(*(int *)(*local_60 + 0x1e6c) + 0x1d98); local_4c = local_68; if (local_48 != (int *)0x0) { if (local_68 == local_64) { local_6c = local_60; std::vector::_Emplace_reallocate(local_68,&local_48); local_60 = local_6c; local_4c = local_68; } else { *local_68 = (int)local_48; local_4c = local_68 + 1; } } } piVar18 = local_4c; pEVar13 = (Entity_Player *)g_game->_stage; SVar12 = this[0x16]; if ((SVar12 == (ScoreSheet)0x0) || (local_70 = pEVar13, SVar12 == (ScoreSheet)0x1)) { local_70 = (Entity_Player *)((int)&pEVar13[-1]._replacedPlayer + 3); } local_7c = (Entity_Player *)&DAT_00000008; if ((int)local_70 < 8) { local_7c = local_70; } if (((10 < (int)pEVar13) || (SVar12 == (ScoreSheet)0x4)) || (local_80 = (ScoreSheet)0x0, SVar12 == (ScoreSheet)0x5)) { local_80 = (ScoreSheet)0x1; } *this = (ScoreSheet)0x0; local_78 = 0; iVar8 = (int)this[0x20] - (int)this[0x1f] >> 0x1f; if (((int)this[0x20] - (int)this[0x1f]) / 0xc + iVar8 != iVar8) { iVar8 = 0; do { SVar12 = this[0x1f]; if (*(char *)((int)SVar12 + 8 + iVar8) == '\0') { if (*(uint *)((int)SVar12 + iVar8) < 0xe) { iVar9 = *(int *)(&DAT_00b80bd0 + *(uint *)((int)SVar12 + iVar8) * 4); } else { iVar9 = 0; } } else { iVar9 = 500; } *this = (ScoreSheet)((int)*this + iVar9); iVar8 = iVar8 + 0xc; local_78 = local_78 + 1; } while (local_78 < (uint)(((int)this[0x20] - (int)SVar12) / 0xc)); } SVar12 = this[0x16]; SVar10 = (ScoreSheet)0x0; if (SVar12 == (ScoreSheet)0x6) { SVar10 = (ScoreSheet)0xfa0; } this[3] = SVar10; SVar10 = (ScoreSheet)0x0; if (SVar12 == (ScoreSheet)0x7) { SVar10 = (ScoreSheet)0xfa0; } this[2] = SVar10; SVar10 = (ScoreSheet)0x0; if (SVar12 == (ScoreSheet)0x8) { SVar10 = (ScoreSheet)0x1a0a; } this[4] = SVar10; pGVar6 = g_game; SVar10 = (ScoreSheet)0x0; if (SVar12 == (ScoreSheet)0xd) { SVar10 = (ScoreSheet)0x1a0a; } this[5] = SVar10; local_58 = (undefined4)pGVar6->_gameStateFlags; local_59 = (pGVar6->_gameStateFlags & 0x200000000) != 0; local_74 = 0; local_90 = 0; iVar8 = 0; if ((g_game->_gameStateFlags & 0x10000000000) != 0) { iVar8 = 0x15b3; } iVar9 = 0; if ((bool)local_59) { iVar9 = 0x115c; } local_94 = 0; SVar10 = (ScoreSheet)0x0; this[8] = (ScoreSheet)(iVar8 + iVar9); local_8c = 0; if (SVar12 == (ScoreSheet)0xb) { SVar10 = (ScoreSheet)0x1a0a; } this[6] = SVar10; SVar10 = (ScoreSheet)0x0; if (SVar12 == (ScoreSheet)0xe) { SVar10 = (ScoreSheet)0x1a0a; } this[7] = SVar10; fVar14 = 0.0; local_4c = (int *)0x0; local_88 = 0; local_48 = local_60; if (local_60 != piVar18) { fVar14 = 0.0; do { iVar8 = *local_48; iVar9 = 0x10; local_78 = 0; uVar7 = *(uint *)(iVar8 + 0x1350); do { uVar15 = (int)uVar7 >> 1; fVar14 = (float)((int)fVar14 + (uVar7 & 1)); uVar7 = (int)uVar7 >> 2; local_78 = local_78 + (uVar15 & 1); iVar9 = iVar9 + -1; } while (iVar9 != 0); fVar14 = (float)((int)fVar14 + local_78); local_74 = local_74 + *(int *)(iVar8 + 0x1340); local_90 = local_90 + *(int *)(iVar8 + 0x1344); local_94 = local_94 + *(int *)(iVar8 + 0x134c); local_8c = local_8c + *(int *)(iVar8 + 0x1348); local_4c = (int *)((int)local_4c + *(int *)(iVar8 + 0x194c)); local_88 = local_88 + *(int *)(iVar8 + 0x1d88); local_48 = local_48 + 1; } while (local_48 != piVar18); local_54 = fVar14; } fVar30 = 0.0; fVar25 = (float)((double)(int)this[0x14] + __uint_to_double_fixup[-((int)this[0x14] >> 0x1f)]); for (fVar22 = 1.0; (0.0 < fVar25 && (0.001 < fVar22)); fVar22 = fVar22 * 0.98058254) { auVar21 = ZEXT812(0x42c80000); if (fVar25 <= auVar21._0_4_) { auVar21._4_8_ = auVar21._4_8_; auVar21._0_4_ = fVar25; } fVar25 = fVar25 - 100.0; fVar20 = auVar21._0_4_ * fVar22; fVar30 = fVar30 + fVar20 + fVar20; } iVar8 = *local_60; this[1] = (ScoreSheet) ((int)fVar30 + ((int)local_4c * 5 + *(int *)(iVar8 + 0x1368) + (*(int *)(iVar8 + 0x1364) + *(int *)(iVar8 + 0x135c)) * 2 + local_88 + local_8c + (int)fVar14 + local_90 + local_94 + local_74) * 10); local_6c = local_60; calculate_room_score(); local_4c = (int *)0x3c; pCVar11 = Game::GetChallengeParams(g_game); if ((pCVar11->_pathType == 3) || (this[0x16] == (ScoreSheet)0xe)) { local_80 = (ScoreSheet)0x0; local_7c = local_70; if (6 < (int)local_70) { local_7c = (Entity_Player *)&DAT_00000006; } iVar8 = 0x3c; local_48 = (int *)(((int)this[0x20] - (int)this[0x1f]) / 0xc); if (local_48 != (int *)0x0) { pcVar16 = (char *)((int)this[0x1f] + 8); iVar9 = iVar8; piVar19 = local_48; do { cVar1 = *pcVar16; pcVar16 = pcVar16 + 0xc; iVar8 = iVar9 + 0x4b; if (cVar1 == '\0') { iVar8 = iVar9; } piVar19 = (int *)((int)piVar19 + -1); iVar9 = iVar8; } while (piVar19 != (int *)0x0); local_4c = (int *)iVar8; } if (this[0x16] == (ScoreSheet)0xe) { local_4c = (int *)(iVar8 + 0x1a4); } } piVar19 = (int *)0x0; if (((int)local_7c < 1) || (local_7c < (Entity_Player *)&DAT_00000008)) { piVar17 = local_4c; } else { uVar7 = (uint)local_7c & 0x80000007; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffff8) + 1; } iVar8 = 0; iVar9 = 0; iVar23 = 0; iVar24 = 0; iVar26 = 0; iVar27 = 0; iVar28 = 0; iVar29 = 0; do { iVar8 = iVar8 + local_44[(int)piVar19]; iVar9 = iVar9 + local_44[(int)piVar19 + 1]; iVar23 = iVar23 + local_44[(int)piVar19 + 2]; iVar24 = iVar24 + local_44[(int)piVar19 + 3]; piVar17 = piVar19 + 1; iVar2 = (int)piVar19 + 5; iVar3 = (int)piVar19 + 6; iVar4 = (int)piVar19 + 7; piVar19 = piVar19 + 2; iVar26 = iVar26 + local_44[(int)piVar17]; iVar27 = iVar27 + local_44[iVar2]; iVar28 = iVar28 + local_44[iVar3]; iVar29 = iVar29 + local_44[iVar4]; } while ((int)piVar19 < (int)((int)local_7c - uVar7)); piVar17 = (int *)((int)local_4c + iVar8 + iVar26 + iVar23 + iVar28 + iVar9 + iVar27 + iVar24 + iVar29); } local_74 = 0; if ((int)piVar19 < (int)local_7c) { if ((int)local_7c - (int)piVar19 < 2) { iVar8 = 0; LAB_009e63f7: piVar17 = (int *)((int)piVar17 + local_44[(int)piVar19]); } else { iVar8 = 0; local_74 = 0; do { iVar8 = iVar8 + local_44[(int)piVar19]; local_74 = local_74 + local_44[(int)piVar19 + 1]; piVar19 = (int *)((int)piVar19 + 2); } while ((int)piVar19 < (int)((int)&local_7c[-1]._replacedPlayer + 3)); local_48 = piVar19; if ((int)piVar19 < (int)local_7c) goto LAB_009e63f7; } piVar17 = (int *)((int)piVar17 + iVar8 + local_74); } iVar8 = (int)piVar17 + (int)local_80 * 0x1a4; SVar12 = this[0x16]; if (((SVar12 == (ScoreSheet)0x6) || (SVar12 == (ScoreSheet)0x7)) || (SVar12 == (ScoreSheet)0x8)) { iVar8 = iVar8 + 0x1a4; } qVar5 = g_game->_gameStateFlags; this[0xb] = (ScoreSheet)0x0; local_54 = (float)(iVar8 + 0xf0); if ((qVar5 & 0x200000000) == 0) { local_54 = (float)iVar8; } if (local_54 == 0.0) { SVar12 = (ScoreSheet)0x0; local_54 = 0.0; } else { fVar14 = log_precise(0.8); fVar14 = (fVar14 * ((float)g_game->_timeCounter / 30.0)) / (float)((double)(int)local_54 + __uint_to_double_fixup[-((int)local_54 >> 0x1f)]); FUN_007df1e0(); local_54 = (1.0 - fVar14) * (float)((int)this[7] + (int)this[2] + (int)*this + (int)this[4] + (int)this[8] + (int)this[5] + (int)this[6] + (int)this[3]) * 0.8; dVar31 = ceil((double)local_54); local_54 = (float)dVar31; SVar12 = (ScoreSheet)(int)dVar31; } this[0xb] = SVar12; piVar17 = (int *)0x0; local_48 = (int *)0x0; piVar19 = local_60; if (local_60 != piVar18) { do { iVar8 = *piVar19; piVar19 = piVar19 + 1; piVar17 = (int *)((int)piVar17 + *(int *)(iVar8 + 0x16b4)); } while (piVar19 != piVar18); local_48 = piVar17; } fVar14 = log_precise(0.8); fVar30 = ((float)((double)(int)local_48 + __uint_to_double_fixup[-((int)local_48 >> 0x1f)]) * fVar14) / 12.0; FUN_007df1e0(); local_54 = (1.0 - fVar30) * (float)(int)this[9] * 0.8; dVar31 = ceil((double)local_54); local_54 = (float)dVar31; local_80 = (ScoreSheet)thunk_FUN_00af0780(); pEVar13 = local_70; if (this[0x16] == (ScoreSheet)0xe) { pEVar13 = (Entity_Player *)&DAT_00000007; } this[10] = local_80; this[0xc] = (ScoreSheet)0x0; SVar12 = (ScoreSheet)0x0; fVar30 = (float)(int)pEVar13 * 2.5; if (fVar30 <= 1.0) { fVar30 = 1.0; } if (fVar30 <= 0.0) { SVar10 = this[1]; } else { local_48 = (int *)0x0; piVar19 = local_60; if (local_60 != piVar18) { do { iVar8 = 0; piVar17 = *(int **)(*piVar19 + 0x16c8); for (iVar9 = *(int *)(*piVar19 + 0x16cc) - (int)piVar17 >> 2; iVar9 != 0; iVar9 = iVar9 + -1 ) { iVar8 = iVar8 + *piVar17; piVar17 = piVar17 + 1; } piVar19 = piVar19 + 1; local_48 = (int *)((int)local_48 + iVar8); } while (piVar19 != piVar18); local_80 = this[10]; } SVar10 = this[1]; fVar30 = ((float)((double)(int)local_48 + __uint_to_double_fixup[-((int)local_48 >> 0x1f)]) * fVar14) / fVar30; FUN_007df1e0(); local_54 = (1.0 - fVar30) * (float)(int)SVar10 * 0.8; dVar31 = ceil((double)local_54); local_54 = (float)dVar31; SVar12 = (ScoreSheet)thunk_FUN_00af0780(); this[0xc] = SVar12; } this[0xd] = (ScoreSheet) (((((int)this[7] - (int)SVar12) - (int)local_80) - (int)this[0xb]) + (int)this[2] + (int)*this + (int)this[4] + (int)this[8] + (int)this[5] + (int)SVar10 + (int)this[9] + (int)this[6] + (int)this[3]); LAB_009e66e0: if (local_60 != (int *)0x0) { uVar7 = (int)local_64 - (int)local_60 & 0xfffffffc; piVar18 = local_60; if (0xfff < uVar7) { piVar18 = (int *)local_60[-1]; uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)local_60 + (-4 - (int)piVar18))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar18,uVar7); } ExceptionList = local_1c; return; } //@@ 009e6740 FUN_009e6740 undefined4 FUN_009e6740(undefined4 param_1) { switch(param_1) { case 8: case 9: case 10: case 0xb: case 0xc: return 2; default: return 1; } } //@@ 009e6780 ScoreSheet::calculate_room_score /* DB: ? thiscall ScoreSheet: sums the 0xc-byte {room, isBonus, mult} entries of the vectors +0x68 and +0x5c (the add_cleared_room vector) via FUN_009e69c0(room, 0/1) * mult into +0x24 or a bonus total capped at 2000 (flag +0x88 when reached), adds (+0x78*3 + +0x74)*100 + +0x54, +1000 each for Game +0x2654c flags 0x40/0x80; ScoreSheet::Calculate */ void ScoreSheet::calculate_room_score(void) { Game *pGVar1; int iVar2; int iVar3; int in_ECX; int iVar4; int iVar5; int iVar6; uint uVar7; float fVar8; uint local_c; int local_8; iVar5 = 0; local_8 = 0; local_c = 0; *(undefined4 *)(in_ECX + 0x24) = 0; iVar6 = 0; iVar3 = *(int *)(in_ECX + 0x68); iVar4 = *(int *)(in_ECX + 0x6c) - iVar3; iVar2 = iVar4 >> 0x1f; if (iVar4 / 0xc + iVar2 != iVar2) { do { iVar6 = *(int *)(in_ECX + 0x24); fVar8 = *(float *)(iVar5 + 8 + iVar3); if (*(char *)(iVar5 + 4 + iVar3) == '\0') { iVar2 = FUN_009e69c0(*(undefined4 *)(iVar5 + iVar3),0); iVar6 = iVar6 + (int)((float)iVar2 * fVar8); *(int *)(in_ECX + 0x24) = iVar6; } else { iVar2 = FUN_009e69c0(*(undefined4 *)(iVar5 + iVar3),0); local_8 = local_8 + (int)((float)iVar2 * fVar8); } iVar5 = iVar5 + 0xc; local_c = local_c + 1; } while (local_c < (uint)((*(int *)(in_ECX + 0x6c) - iVar3) / 0xc)); } iVar3 = *(int *)(in_ECX + 0x5c); local_c = 0; iVar4 = *(int *)(in_ECX + 0x60) - iVar3; iVar2 = iVar4 >> 0x1f; if (iVar4 / 0xc + iVar2 != iVar2) { iVar2 = 0; do { iVar6 = *(int *)(in_ECX + 0x24); fVar8 = *(float *)(iVar3 + 8 + iVar2); if (*(char *)(iVar3 + 4 + iVar2) == '\0') { iVar4 = FUN_009e69c0(*(undefined4 *)(iVar3 + iVar2),1); iVar6 = iVar6 + (int)((float)iVar4 * fVar8); *(int *)(in_ECX + 0x24) = iVar6; } else { iVar4 = FUN_009e69c0(*(undefined4 *)(iVar3 + iVar2),1); local_8 = local_8 + (int)((float)iVar4 * fVar8); } iVar2 = iVar2 + 0xc; local_c = local_c + 1; } while (local_c < (uint)((*(int *)(in_ECX + 0x60) - iVar3) / 0xc)); } if (1999 < local_8) { *(undefined1 *)(in_ECX + 0x88) = 1; } pGVar1 = g_game; iVar3 = 2000; if (local_8 < 2000) { iVar3 = local_8; } iVar6 = (*(int *)(in_ECX + 0x78) * 3 + *(int *)(in_ECX + 0x74)) * 100 + iVar3 + *(int *)(in_ECX + 0x54) + iVar6; *(int *)(in_ECX + 0x24) = iVar6; uVar7 = *(uint *)((int)&pGVar1->_gameStateFlags + 4); if ((uVar7 & 0x40) != 0) { iVar6 = iVar6 + 1000; *(int *)(in_ECX + 0x24) = iVar6; uVar7 = *(uint *)((int)&pGVar1->_gameStateFlags + 4); } if ((uVar7 & 0x80) != 0) { *(int *)(in_ECX + 0x24) = iVar6 + 1000; } return; } //@@ 009e6940 ScoreSheet::find_stage_entry /* DB: thiscall (stage, stageType, bool): linear search of the 0xc-byte {stage, type, flag} entries at this+0x40..+0x44; ScoreSheet::add_cleared_room and award_fly_kill_points with Game _stage/_stageType */ char * ScoreSheet::find_stage_entry(int param_1,int param_2,char param_3) { int iVar1; char *pcVar2; int in_ECX; int iVar3; uint uVar4; uint uVar5; uVar5 = 0; iVar3 = *(int *)(in_ECX + 0x44) - *(int *)(in_ECX + 0x40); pcVar2 = (char *)(iVar3 * 0x2aaaaaab); iVar1 = iVar3 >> 0x1f; iVar3 = iVar3 / 0xc + iVar1; uVar4 = iVar3 - iVar1; if (iVar3 != iVar1) { pcVar2 = (char *)(*(int *)(in_ECX + 0x40) + 8); while (((*(int *)(pcVar2 + -8) != param_1 || (*(int *)(pcVar2 + -4) != param_2)) || (*pcVar2 != param_3))) { uVar5 = uVar5 + 1; pcVar2 = pcVar2 + 0xc; if (uVar4 <= uVar5) { return pcVar2; } } if (uVar4 == 1) { return pcVar2; } } return pcVar2; } //@@ 009e69c0 FUN_009e69c0 undefined4 FUN_009e69c0(undefined4 param_1,char param_2) { undefined4 uVar1; undefined4 uVar2; uVar1 = 10; uVar2 = 0x28; switch(param_1) { case 2: case 4: case 0xc: uVar1 = 0x1e; if (param_2 != '\0') { uVar1 = 0x28; } return uVar1; case 3: case 7: case 0x12: case 0x13: case 0x14: case 0x15: uVar1 = 0x3c; if (param_2 != '\0') { uVar1 = 0x28; } return uVar1; case 5: if (param_2 != '\0') { uVar1 = 100; } return uVar1; case 6: uVar2 = 0x46; break; case 8: case 0x16: uVar1 = 0xa0; if (param_2 != '\0') { uVar1 = 0x28; } return uVar1; case 10: case 0xe: case 0xf: uVar1 = 0x32; if (param_2 != '\0') { uVar1 = 0x28; } return uVar1; case 0xb: if (param_2 != '\0') { uVar1 = 200; } return uVar1; case 0x10: uVar1 = 0x46; if (param_2 != '\0') { uVar1 = 0x28; } return uVar1; } if (param_2 != '\0') { uVar1 = uVar2; } return uVar1; } //@@ 009e6ac0 FUN_009e6ac0 void FUN_009e6ac0(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = std::runtime_error::vftable; return; } //@@ 009e6b00 FUN_009e6b00 void FUN_009e6b00(void) { undefined4 *in_ECX; *(undefined8 *)(in_ECX + 1) = 0; in_ECX[1] = "bad cast"; *in_ECX = std::bad_cast::vftable; return; } //@@ 009e6b20 FUN_009e6b20 void FUN_009e6b20(void) { void *pExceptionObject; FUN_009e6b00(); /* WARNING: Subroutine does not return */ _CxxThrowException(pExceptionObject,(ThrowInfo *)&DAT_00bd5d08); } //@@ 009e6b40 FUN_009e6b40 void FUN_009e6b40(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = std::bad_cast::vftable; return; } //@@ 009e6b80 FUN_009e6b80 void FUN_009e6b80(void) { undefined4 *puVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { puVar1 = (undefined4 *) (**(code **)(**(int **)(in_ECX + 4) + 8)) (__security_cookie ^ (int)register0x00000010 - 4U); if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); } } ExceptionList = local_10; return; } //@@ 009e6bd0 FUN_009e6bd0 void FUN_009e6bd0(undefined4 *param_1) { undefined4 *in_ECX; undefined4 *local_c; undefined1 local_8; if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; local_8 = 1; local_c = param_1; __std_exception_copy(&local_c,in_ECX + 1); *in_ECX = png::error::vftable; return; } //@@ 009e6c20 FUN_009e6c20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_009e6c20(byte *param_1,int param_2) { std_string *allocSource; uint uVar1; char *pcVar2; undefined4 *in_ECX; void *pvVar3; undefined4 *local_4c; undefined4 *local_48; void *local_44 [5]; uint local_30; void *local_2c; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b0f96d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_44 + 0x10); ExceptionList = &local_10; local_48 = in_ECX; local_14 = uVar1; pcVar2 = strerror(param_2); allocSource = *(std_string **)(param_1 + 0x10); if (0x7fffffffU - (int)allocSource < 2) { /* WARNING: Subroutine does not return */ std::string::_Xlen(uVar1); } if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::concat((char *)local_44,(int)local_48,allocSource,param_1,(uint)allocSource, &DAT_00b80c08,2); local_8 = (void *)0x0; local_4c = (undefined4 *)FUN_0060c790(pcVar2); if (0xf < (uint)local_4c[5]) { local_4c = (undefined4 *)*local_4c; } *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; local_48 = (undefined4 *)CONCAT31(local_48._1_3_,1); __std_exception_copy(&local_4c,in_ECX + 1); *in_ECX = std::runtime_error::vftable; if (0xf < local_18) { uVar1 = local_18 + 1; pvVar3 = local_2c; if (0xfff < uVar1) { pvVar3 = *(void **)((int)local_2c + -4); uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)pvVar3))) goto LAB_009e6d48; } operator_delete(pvVar3,uVar1); } local_1c = 0; local_18 = 0xf; local_2c = (void *)((uint)local_2c & 0xffffff00); if (0xf < local_30) { uVar1 = local_30 + 1; pvVar3 = local_44[0]; if (0xfff < uVar1) { pvVar3 = *(void **)((int)local_44[0] + -4); uVar1 = local_30 + 0x24; if (0x1f < (uint)((int)local_44[0] + (-4 - (int)pvVar3))) { LAB_009e6d48: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar1); } *in_ECX = png::std_error::vftable; ExceptionList = local_10; return; } //@@ 009e6d90 FUN_009e6d90 void FUN_009e6d90(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0xffffffff; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; return; } //@@ 009e6df0 FUN_009e6df0 void FUN_009e6df0(void) { FUN_007dcd30(); FUN_009e7390(); return; } //@@ 009e6e10 FUN_009e6e10 void FUN_009e6e10(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = png::error::vftable; return; } //@@ 009e6e50 FUN_009e6e50 void FUN_009e6e50(byte *param_1) { byte bVar1; byte *pbVar2; int in_ECX; pbVar2 = param_1; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x50),param_1,(int)pbVar2 - (int)(param_1 + 1)); return; } //@@ 009e6e80 FUN_009e6e80 void FUN_009e6e80(void) { undefined4 *in_ECX; /* WARNING: Subroutine does not return */ longjmp((int *)*in_ECX,-1); } //@@ 009e6e90 FUN_009e6e90 void FUN_009e6e90(Weapon_Brimstone *param_1,undefined4 param_2) { Weapon_Brimstone::GetMainEntity(param_1); FUN_009e6e50(param_2); /* WARNING: Subroutine does not return */ FUN_009e6e80(); } //@@ 009e6eb0 save_screenshot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: glfw_get_window_size, glReadPixels(0,0,w,h,GL_RGBA,GL_UNSIGNED_BYTE), flips rows, builds "%s%s.png"/"%s%s-%d.png" names and writes the PNG through an ofstream and the PNG writer 009e86e0; Manager::Update after sprintf("%sscreenshots") + CreateDirectoryA on the screenshot key */ void save_screenshot(void) { undefined1 *puVar1; undefined1 uVar2; undefined1 uVar3; int iVar4; int iVar5; void *pvVar6; qword qVar7; int *piVar8; uint uVar9; int *piVar10; byte *pbVar11; int in_ECX; int unused; undefined2 *puVar12; int iVar13; qword *pqVar14; int iVar15; undefined1 *puVar16; undefined4 *puVar17; void *ptr; char *pcVar18; undefined4 uVar19; uint *path; undefined1 local_554 [80]; int local_504; basic_ios_> local_4ec [72]; int local_4a4; int local_4a0; undefined4 local_49c; undefined4 local_498; undefined4 local_470; undefined4 local_46c; int *piStack_468; int *piStack_464; int iStack_460; int local_458; void *local_454; undefined1 local_450 [4]; int *local_44c; undefined4 *local_448; int local_440; int local_43c; int local_438; int local_434; undefined2 local_42f; char local_42c [24]; uint local_414 [256]; uint local_14; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0f9dc; local_10 = ExceptionList; uVar9 = __security_cookie ^ (uint)(local_414 + 0x104); ExceptionList = &local_10; local_14 = uVar9; piVar10 = glfw_get_window_size((int *)&local_44c,in_ECX); iVar4 = *piVar10; local_448 = (undefined4 *)iVar4; piVar10 = glfw_get_window_size(&local_458,unused); iVar5 = piVar10[1]; local_43c = iVar5; local_454 = operator_new_tracked(iVar5 * iVar4 * 4); (*(code *)epoxy_glReadPixels)(0,0,iVar4,iVar5,0x1908,0x1401,local_454,uVar9); FUN_009e6d90(); local_498 = 2; local_49c = 8; local_470 = 0; local_46c = 0; piStack_468 = (int *)0x0; piStack_464 = (int *)0x0; iStack_460 = 0; local_8 = 1; FUN_009e8380(iVar4,iVar5); local_8._0_1_ = 2; local_8._1_3_ = 0; local_440 = 0; if (0 < iVar4) { local_434 = 0; iVar13 = iVar5; puVar17 = (undefined4 *)iVar4; do { if (0 < iVar13) { puVar16 = (undefined1 *) ((int)local_454 + ((iVar13 + -1) * (int)puVar17 + local_440) * 4 + 1); iVar15 = 0; local_438 = iVar13; do { puVar1 = puVar16 + -1; uVar2 = *puVar16; uVar3 = puVar16[1]; puVar16 = puVar16 + (int)puVar17 * -4; local_42f = CONCAT11(uVar2,*puVar1); puVar12 = (undefined2 *)(*(int *)((int)piStack_468 + iVar15) + local_434); local_438 = local_438 + -1; *puVar12 = local_42f; *(undefined1 *)(puVar12 + 1) = uVar3; iVar15 = iVar15 + 0xc; } while (local_438 != 0); local_438 = 0; iVar13 = local_43c; puVar17 = local_448; } local_440 = local_440 + 1; local_434 = local_434 + 3; } while (local_440 < (int)puVar17); } pcVar18 = "%s%s.png"; local_4a4 = iVar4; local_4a0 = iVar5; sprintf((byte *)local_414,(byte *)"%s%s.png"); while( true ) { path = local_414; uVar19 = 0x9e7081; pbVar11 = FileSystem::ResolvePath((byte *)path); if (pbVar11 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar14 = &g_allocatedBytesNoHeap; } else { pqVar14 = (qword *)((int)g_mainHeap + 0x30); } path = (uint *)(pbVar11 + -4); uVar9 = *path; qVar7 = *pqVar14; *(uint *)pqVar14 = (uint)*pqVar14 - uVar9; *(uint *)((int)pqVar14 + 4) = *(uint *)((int)pqVar14 + 4) - (uint)((uint)qVar7 < uVar9); uVar19 = 0x9e70ac; free(path); local_8._0_1_ = 2; } if (pbVar11 == (byte *)0x0) break; pbVar11 = g_userDataDir; sprintf((byte *)local_414,(byte *)"%s%s-%d.png"); pcVar18 = (char *)pbVar11; } std::basic_ofstream::basic_ofstream(local_414,pcVar18,uVar19,path); local_8._0_1_ = 4; if (local_504 == 0) { piVar10 = _errno(); iVar4 = *piVar10; std::string::string_from_cstr(local_42c,(byte *)local_414); local_8 = CONCAT31(local_8._1_3_,5); FUN_009e6c20(local_42c,iVar4); /* WARNING: Subroutine does not return */ _CxxThrowException(local_450,(ThrowInfo *)&DAT_00bd5c94); } std::ios_base::exceptions((ios_base *)(local_554 + *(int *)(local_554._0_4_ + 4)),4); local_44c = &local_4a4; local_448 = &local_470; png_write_image(&local_44c,(FamiliarData *)local_554); *(undefined ***)(local_554 + *(int *)(local_554._0_4_ + 4)) = std::basic_ofstream_>::vftable; *(int *)(local_554 + *(int *)(local_554._0_4_ + 4) + -4) = *(int *)(local_554._0_4_ + 4) + -0x68; std::basic_filebuf::~basic_filebuf(); std::basic_ostream_>::~basic_ostream_> ((basic_ostream_> *)(local_554 + 8)); std::basic_ios_>::~basic_ios_>(local_4ec); piVar8 = piStack_464; piVar10 = piStack_468; if (piStack_468 != (int *)0x0) { for (; piVar10 != piVar8; piVar10 = piVar10 + 3) { pvVar6 = (void *)*piVar10; if (pvVar6 != (void *)0x0) { uVar9 = ((piVar10[2] - (int)pvVar6) / 3) * 3; ptr = pvVar6; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar6 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar6 + (-4 - (int)ptr))) goto LAB_009e7239; } operator_delete(ptr,uVar9); *piVar10 = 0; piVar10[1] = 0; piVar10[2] = 0; } } uVar9 = ((iStack_460 - (int)piStack_468) / 0xc) * 0xc; piVar10 = piStack_468; if (0xfff < uVar9) { piVar10 = (int *)piStack_468[-1]; uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)piStack_468 + (-4 - (int)piVar10))) { LAB_009e7239: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar10,uVar9); piStack_468 = (int *)0x0; piStack_464 = (int *)0x0; iStack_460 = 0; } FUN_007dcd30(); FUN_009e7390(); ExceptionList = local_10; return; } //@@ 009e72e0 FUN_009e72e0 void FUN_009e72e0(void) { FUN_009e7310(); FUN_007dcd30(); FUN_009e7390(); return; } //@@ 009e7300 FUN_009e7300 void FUN_009e7300(void) { FUN_009e7310(); return; } //@@ 009e7310 FUN_009e7310 void FUN_009e7310(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_009e85d0(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0xc) * 0xc; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009e7390 FUN_009e7390 void FUN_009e7390(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 3) * 3; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009e7400 FUN_009e7400 void FUN_009e7400(void) { basic_ios_> *this; int *in_ECX; this = (basic_ios_> *)(in_ECX + 0x1a); *(undefined ***)(this + *(int *)(*in_ECX + 4) + -0x68) = std::basic_ofstream_>::vftable; *(int *)(this + *(int *)(*in_ECX + 4) + -0x6c) = *(int *)(*in_ECX + 4) + -0x68; std::basic_filebuf::~basic_filebuf(); std::basic_ostream_>::~basic_ostream_> ((basic_ostream_> *)(in_ECX + 2)); /* WARNING: Could not recover jumptable at 0x009e7432. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_>(this); return; } //@@ 009e7440 FUN_009e7440 void FUN_009e7440(int param_1) { undefined4 *in_ECX; *in_ECX = std::exception::vftable; *(undefined8 *)(in_ECX + 1) = 0; __std_exception_copy(param_1 + 4,in_ECX + 1); *in_ECX = png::std_error::vftable; return; } //@@ 009e7480 FUN_009e7480 void FUN_009e7480(void) { bool bVar1; codecvt_base *this; basic_streambuf_> *in_ECX; this = (codecvt_base *)FUN_009e84e0(); bVar1 = std::codecvt_base::always_noconv(this); if (bVar1) { *(undefined4 *)(in_ECX + 0x38) = 0; return; } *(codecvt_base **)(in_ECX + 0x38) = this; std::basic_streambuf_>::_Init(in_ECX); return; } //@@ 009e74c0 FUN_009e74c0 undefined4 FUN_009e74c0(void) { int iVar1; int *in_ECX; if (in_ECX[0x13] != 0) { iVar1 = (**(code **)(*in_ECX + 0xc))(0xffffffff); if (iVar1 != -1) { iVar1 = fflush((FILE *)in_ECX[0x13]); if (iVar1 < 0) { return 0xffffffff; } } } return 0; } //@@ 009e74f0 FUN_009e74f0 basic_streambuf_> * FUN_009e74f0(char *param_1,size_t param_2,int param_3) { undefined4 uVar1; undefined4 uVar2; int iVar3; basic_streambuf_> *in_ECX; undefined4 local_8; if ((param_1 == (char *)0x0) && (param_2 == 0 && param_3 == 0)) { iVar3 = 4; } else { iVar3 = 0; } if (*(FILE **)(in_ECX + 0x4c) != (FILE *)0x0) { iVar3 = setvbuf(*(FILE **)(in_ECX + 0x4c),param_1,iVar3,param_2); if (iVar3 == 0) { iVar3 = *(int *)(in_ECX + 0x4c); in_ECX[0x48] = (basic_streambuf_>)0x1; in_ECX[0x3d] = (basic_streambuf_>)0x0; std::basic_streambuf_>::_Init(in_ECX); if (iVar3 != 0) { param_1 = (char *)0x0; param_3 = 0; local_8 = 0; get_stream_buffer_pointers(iVar3,¶m_1,¶m_3,&local_8); *(char **)(in_ECX + 0xc) = param_1; *(char **)(in_ECX + 0x10) = param_1; *(int *)(in_ECX + 0x1c) = param_3; *(int *)(in_ECX + 0x20) = param_3; *(undefined4 *)(in_ECX + 0x2c) = local_8; *(undefined4 *)(in_ECX + 0x30) = local_8; } uVar2 = DAT_00c943b0; uVar1 = DAT_00c943ac; *(int *)(in_ECX + 0x4c) = iVar3; *(undefined4 *)(in_ECX + 0x40) = uVar1; *(undefined4 *)(in_ECX + 0x44) = uVar2; *(undefined4 *)(in_ECX + 0x38) = 0; return in_ECX; } } return (basic_streambuf_> *)0x0; } //@@ 009e75c0 FUN_009e75c0 void FUN_009e75c0(int *param_1,uint param_2,int param_3,uint param_4,int param_5,undefined4 param_6, undefined4 param_7) { int iVar1; char cVar2; int iVar3; int in_ECX; int local_10; int local_c; local_10 = param_2 + param_4; local_c = param_3 + param_5 + (uint)CARRY4(param_2,param_4); if (*(int *)(in_ECX + 0x4c) != 0) { cVar2 = FUN_009e82b0(); if (cVar2 != '\0') { iVar3 = fsetpos(*(FILE **)(in_ECX + 0x4c),(fpos_t *)&local_10); if (iVar3 == 0) { *(undefined4 *)(in_ECX + 0x40) = param_6; *(undefined4 *)(in_ECX + 0x44) = param_7; if (**(int **)(in_ECX + 0xc) == in_ECX + 0x3c) { iVar3 = *(int *)(in_ECX + 0x54); iVar1 = *(int *)(in_ECX + 0x50); **(int **)(in_ECX + 0xc) = iVar1; **(int **)(in_ECX + 0x1c) = iVar1; **(int **)(in_ECX + 0x2c) = iVar3 - iVar1; } iVar3 = *(int *)(in_ECX + 0x40); iVar1 = *(int *)(in_ECX + 0x44); *param_1 = local_10; param_1[1] = local_c; param_1[2] = 0; param_1[3] = 0; param_1[4] = iVar3; param_1[5] = iVar1; return; } } } *param_1 = -1; param_1[1] = -1; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; return; } //@@ 009e7690 FUN_009e7690 void FUN_009e7690(undefined4 *param_1,int param_2,int param_3,int param_4) { undefined4 uVar1; undefined4 uVar2; char cVar3; int iVar4; basic_filebuf_> *in_ECX; int unaff_EDI; bool bVar5; undefined4 local_10; undefined4 local_c; if ((((basic_filebuf_> *)**(int **)(in_ECX + 0x1c) == in_ECX + 0x3c) && (param_4 == 1)) && (*(int *)(in_ECX + 0x38) == 0)) { bVar5 = param_2 != 0; param_2 = param_2 + -1; param_3 = param_3 + -1 + (uint)bVar5; } if ((((*(int *)(in_ECX + 0x4c) == 0) || (cVar3 = FUN_009e82b0(), cVar3 == '\0')) || (((param_2 != 0 || param_3 != 0 || (param_4 != 1)) && (iVar4 = _fseeki64(*(FILE **)(in_ECX + 0x4c),CONCAT44(param_4,param_3),unaff_EDI), iVar4 != 0 )))) || (iVar4 = fgetpos(*(FILE **)(in_ECX + 0x4c),(fpos_t *)&local_10), iVar4 != 0)) { *param_1 = 0xffffffff; param_1[1] = 0xffffffff; param_1[2] = 0; param_1[3] = 0; *(undefined8 *)(param_1 + 4) = 0; return; } std::basic_filebuf_>::_Reset_back(in_ECX); uVar1 = *(undefined4 *)(in_ECX + 0x40); uVar2 = *(undefined4 *)(in_ECX + 0x44); *param_1 = local_10; param_1[1] = local_c; param_1[2] = 0; param_1[3] = 0; param_1[4] = uVar1; param_1[5] = uVar2; return; } //@@ 009e7780 FUN_009e7780 __int64 FUN_009e7780(char *param_1,uint param_2,int param_3) { size_t sVar1; basic_streambuf_> *in_ECX; uint _Count; undefined4 unaff_EDI; int iVar2; bool bVar3; __int64 _Var4; uint local_1c; int local_18; if (*(int *)(in_ECX + 0x38) != 0) { _Var4 = std::basic_streambuf_>::xsputn (in_ECX,param_1,CONCAT44(unaff_EDI,param_3)); return _Var4; } if ((void *)**(undefined4 **)(in_ECX + 0x20) == (void *)0x0) { local_1c = 0; } else { local_1c = **(uint **)(in_ECX + 0x30); } local_18 = (int)local_1c >> 0x1f; _Count = param_2; iVar2 = param_3; if ((param_3 < 0) || ((param_3 < 1 && (param_2 == 0)))) goto LAB_009e7855; if ((-1 < local_18) && ((0 < local_18 || (local_1c != 0)))) { if ((param_3 <= local_18) && ((param_3 < local_18 || (param_2 < local_1c)))) { local_1c = param_2; local_18 = param_3; } memcpy((void *)**(undefined4 **)(in_ECX + 0x20),param_1,local_1c); _Count = param_2 - local_1c; iVar2 = (param_3 - local_18) - (uint)(param_2 < local_1c); param_1 = param_1 + local_1c; **(int **)(in_ECX + 0x30) = **(int **)(in_ECX + 0x30) - local_1c; **(int **)(in_ECX + 0x20) = **(int **)(in_ECX + 0x20) + local_1c; if (iVar2 < 0) goto LAB_009e7855; if ((iVar2 < 1) && (_Count == 0)) goto LAB_009e7855; } if (*(FILE **)(in_ECX + 0x4c) != (FILE *)0x0) { sVar1 = fwrite(param_1,1,_Count,*(FILE **)(in_ECX + 0x4c)); bVar3 = _Count < sVar1; _Count = _Count - sVar1; iVar2 = iVar2 - (uint)bVar3; } LAB_009e7855: return CONCAT44((param_3 - iVar2) - (uint)(param_2 < _Count),param_2 - _Count); } //@@ 009e7870 FUN_009e7870 __int64 FUN_009e7870(char *param_1,uint param_2,int param_3) { int iVar1; int iVar2; size_t sVar3; basic_streambuf_> *in_ECX; uint _Size; undefined4 unaff_EDI; uint uVar4; __int64 _Var5; char *local_10; if ((param_3 < 1) && ((param_3 < 0 || (param_2 == 0)))) { return 0; } if (*(int *)(in_ECX + 0x38) != 0) { _Var5 = std::basic_streambuf_>::xsgetn (in_ECX,param_1,CONCAT44(unaff_EDI,param_3)); return _Var5; } if (((void *)**(undefined4 **)(in_ECX + 0x1c) == (void *)0x0) || (uVar4 = **(uint **)(in_ECX + 0x2c), uVar4 == 0)) { local_10 = param_1; uVar4 = param_2; } else { _Size = param_2; if (uVar4 < param_2) { _Size = uVar4; } memcpy(param_1,(void *)**(undefined4 **)(in_ECX + 0x1c),_Size); local_10 = param_1 + _Size; **(int **)(in_ECX + 0x2c) = **(int **)(in_ECX + 0x2c) - _Size; **(int **)(in_ECX + 0x1c) = **(int **)(in_ECX + 0x1c) + _Size; uVar4 = param_2 - _Size; } if (*(int *)(in_ECX + 0x4c) != 0) { if ((basic_streambuf_> *)**(int **)(in_ECX + 0xc) == in_ECX + 0x3c) { iVar1 = *(int *)(in_ECX + 0x54); iVar2 = *(int *)(in_ECX + 0x50); **(int **)(in_ECX + 0xc) = iVar2; **(int **)(in_ECX + 0x1c) = iVar2; **(int **)(in_ECX + 0x2c) = iVar1 - iVar2; } while (0xfff < uVar4) { sVar3 = fread(local_10,1,0xfff,*(FILE **)(in_ECX + 0x4c)); uVar4 = uVar4 - sVar3; local_10 = local_10 + sVar3; if (sVar3 != 0xfff) { return CONCAT44(param_3 - (uint)(param_2 < uVar4),param_2 - uVar4); } } if (uVar4 != 0) { sVar3 = fread(local_10,1,uVar4,*(FILE **)(in_ECX + 0x4c)); uVar4 = uVar4 - sVar3; } } return CONCAT44(param_3 - (uint)(param_2 < uVar4),param_2 - uVar4); } //@@ 009e79b0 std::basic_filebuf::uflow /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: slot 7 of the std::basic_filebuf vftable (MSVC order dtor,_Lock,_Unlock,overflow,pbackfail,showmanyc,underflow,uflow); std::string buffer for codecvt, memcpy/memmove */ uint std::basic_filebuf::uflow(void) { uint uVar1; int iVar2; byte *pbVar3; uint _Size; uint uVar4; uint uVar5; char *******pppppppcVar6; int iVar7; char *******pppppppcVar8; int in_ECX; char *******ptr; char *pcVar9; byte *local_44; int local_40; uint local_3c; char *local_38; int local_34; byte local_2d; char *******local_2c [4]; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; char ******local_8; local_8 = (char ******)0xffffffff; puStack_c = &LAB_00afd29d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_2c + 10); uVar5 = **(uint **)(in_ECX + 0x1c); if (uVar5 != 0) { iVar2 = **(int **)(in_ECX + 0x2c); if (uVar5 < iVar2 + uVar5) { **(int **)(in_ECX + 0x2c) = iVar2 + -1; pbVar3 = (byte *)**(int **)(in_ECX + 0x1c); **(int **)(in_ECX + 0x1c) = (int)(pbVar3 + 1); return (uint)*pbVar3; } } if (*(int *)(in_ECX + 0x4c) != 0) { ExceptionList = &local_10; if (**(int **)(in_ECX + 0xc) == in_ECX + 0x3c) { iVar2 = *(int *)(in_ECX + 0x54); iVar7 = *(int *)(in_ECX + 0x50); **(int **)(in_ECX + 0xc) = iVar7; **(int **)(in_ECX + 0x1c) = iVar7; **(int **)(in_ECX + 0x2c) = iVar2 - iVar7; } local_14 = uVar4; if (*(int *)(in_ECX + 0x38) != 0) { local_1c = 0; local_18 = 0xf; local_2c[0] = (char *******)0x0; local_8 = (char ******)0x0; local_40 = in_ECX; local_34 = fgetc(*(FILE **)(in_ECX + 0x4c)); uVar5 = local_3c; _Size = local_1c; local_3c = local_18; joined_r0x009e7a8a: local_1c = _Size; local_18 = local_3c; if (local_34 != -1) { if (_Size < local_3c) { local_1c = _Size + 1; pppppppcVar8 = (char *******)local_2c; if (0xf < local_3c) { pppppppcVar8 = local_2c[0]; } *(char *)((int)pppppppcVar8 + _Size) = (char)local_34; *(char *)((int)pppppppcVar8 + _Size + 1) = '\0'; } else { if (_Size == 0x7fffffff) { /* WARNING: Subroutine does not return */ string::_Xlen(uVar4); } uVar5 = _Size + 1 | 0xf; if (uVar5 < 0x80000000) { if (0x7fffffff - (local_3c >> 1) < local_3c) { uVar5 = 0x7fffffff; } else { uVar1 = local_3c + (local_3c >> 1); if (uVar5 < uVar1) { uVar5 = uVar1; } } } else { uVar5 = 0x7fffffff; } pppppppcVar6 = _Allocate(uVar5 + 1); pppppppcVar8 = local_2c[0]; local_1c = _Size + 1; local_18 = uVar5; if (local_3c < 0x10) { memcpy(pppppppcVar6,local_2c,_Size); *(char *)((int)pppppppcVar6 + _Size) = (char)local_34; *(char *)((int)pppppppcVar6 + _Size + 1) = '\0'; } else { memcpy(pppppppcVar6,local_2c[0],_Size); uVar5 = local_3c + 1; *(char *)((int)pppppppcVar6 + _Size) = (char)local_34; *(char *)((int)pppppppcVar6 + _Size + 1) = '\0'; ptr = pppppppcVar8; if (0xfff < uVar5) { ptr = (char *******)pppppppcVar8[-1]; uVar5 = local_3c + 0x24; if ((char *)0x1f < (char *)((int)pppppppcVar8 + (-4 - (int)ptr))) goto LAB_009e7c4b; } operator_delete(ptr,uVar5); } local_2c[0] = pppppppcVar6; } iVar2 = local_40; pppppppcVar8 = (char *******)local_2c; if (0xf < local_18) { pppppppcVar8 = local_2c[0]; } pppppppcVar6 = (char *******)local_2c; if (0xf < local_18) { pppppppcVar6 = local_2c[0]; } iVar7 = std::codecvt::in (*(codecvt **)(local_40 + 0x38), (_Mbstatet *)(local_40 + 0x40),(char *)pppppppcVar6, (char *)((int)pppppppcVar8 + local_1c),&local_38,(char *)&local_2d, (char *)local_2c,(char **)&local_44); if ((iVar7 == 0) || (iVar7 == 1)) { if (local_44 == &local_2d) goto code_r0x009e7bd3; pppppppcVar8 = (char *******)local_2c; if (0xf < local_18) { pppppppcVar8 = local_2c[0]; } for (pcVar9 = (char *)((int)pppppppcVar8 + (local_1c - (int)local_38)); 0 < (int)pcVar9; pcVar9 = pcVar9 + -1) { ungetc((int)(pcVar9 + -1)[(int)local_38],*(FILE **)(iVar2 + 0x4c)); } uVar5 = (uint)local_2d; goto LAB_009e7c21; } uVar5 = local_3c; if (iVar7 == 3) { pppppppcVar8 = (char *******)local_2c; if (0xf < local_18) { pppppppcVar8 = local_2c[0]; } uVar5 = (uint)*(char *)pppppppcVar8; goto LAB_009e7c21; } } local_3c = uVar5; uVar5 = 0xffffffff; LAB_009e7c21: if (0xf < local_18) { uVar4 = local_18 + 1; pppppppcVar8 = local_2c[0]; if (0xfff < uVar4) { pppppppcVar8 = (char *******)local_2c[0][-1]; uVar4 = local_18 + 0x24; if ((char *)0x1f < (char *)((int)local_2c[0] + (-4 - (int)pppppppcVar8))) { LAB_009e7c4b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppcVar8,uVar4); } ExceptionList = local_10; return uVar5; } uVar5 = fgetc(*(FILE **)(in_ECX + 0x4c)); if (uVar5 != 0xffffffff) { ExceptionList = local_10; return uVar5 & 0xff; } } ExceptionList = local_10; return 0xffffffff; code_r0x009e7bd3: pppppppcVar8 = (char *******)local_2c; if (0xf < local_18) { pppppppcVar8 = local_2c[0]; } uVar5 = (int)local_38 - (int)pppppppcVar8; if (local_1c < (uint)((int)local_38 - (int)pppppppcVar8)) { uVar5 = local_1c; } pppppppcVar8 = (char *******)local_2c; if (0xf < local_18) { pppppppcVar8 = local_2c[0]; } local_1c = local_1c - uVar5; memmove(pppppppcVar8,(char *)((int)pppppppcVar8 + uVar5),local_1c + 1); local_34 = fgetc(*(FILE **)(iVar2 + 0x4c)); uVar5 = local_3c; _Size = local_1c; local_3c = local_18; goto joined_r0x009e7a8a; } //@@ 009e7cd0 std::basic_filebuf_>::underflow /* Library Function - Single Match protected: virtual int __thiscall std::basic_filebuf >::underflow(void) Library: Visual Studio 2019 Release */ int __thiscall std::basic_filebuf_>::underflow (basic_filebuf_> *this) { byte *pbVar1; int iVar2; pbVar1 = (byte *)**(undefined4 **)(this + 0x1c); if ((pbVar1 != (byte *)0x0) && (pbVar1 < pbVar1 + **(int **)(this + 0x2c))) { return (uint)*pbVar1; } iVar2 = (**(code **)(*(int *)this + 0x1c))(); if (iVar2 == -1) { return -1; } (**(code **)(*(int *)this + 0x10))(iVar2); return iVar2; } //@@ 009e7d10 FUN_009e7d10 uint FUN_009e7d10(uint param_1) { undefined1 *puVar1; uint uVar2; undefined1 *puVar3; int iVar4; int in_ECX; uVar2 = **(uint **)(in_ECX + 0x1c); if (((uVar2 != 0) && (**(uint **)(in_ECX + 0xc) < uVar2)) && ((param_1 == 0xffffffff || (*(byte *)(uVar2 - 1) == param_1)))) { **(int **)(in_ECX + 0x2c) = **(int **)(in_ECX + 0x2c) + 1; **(int **)(in_ECX + 0x1c) = **(int **)(in_ECX + 0x1c) + -1; if (param_1 == 0xffffffff) { param_1 = 0; } return param_1; } if ((*(FILE **)(in_ECX + 0x4c) != (FILE *)0x0) && (param_1 != 0xffffffff)) { if ((*(int *)(in_ECX + 0x38) == 0) && (iVar4 = ungetc(param_1 & 0xff,*(FILE **)(in_ECX + 0x4c)), iVar4 != -1)) { return param_1; } puVar1 = (undefined1 *)(in_ECX + 0x3c); if ((undefined1 *)**(int **)(in_ECX + 0x1c) != puVar1) { *puVar1 = (char)param_1; puVar3 = (undefined1 *)**(int **)(in_ECX + 0xc); if (puVar3 != puVar1) { *(undefined1 **)(in_ECX + 0x50) = puVar3; *(int *)(in_ECX + 0x54) = **(int **)(in_ECX + 0x2c) + **(int **)(in_ECX + 0x1c); } **(int **)(in_ECX + 0xc) = (int)puVar1; **(int **)(in_ECX + 0x1c) = (int)puVar1; **(undefined4 **)(in_ECX + 0x2c) = 1; return param_1; } } return 0xffffffff; } //@@ 009e7dc0 Room::GetBossThematicItem /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix20/22] __thiscall bool Room::GetBossThematicItem(int* retCollectibleType, int* retTrinketType, unsigned int* seed); */ int __thiscall Room::GetBossThematicItem(Room *this,int param_2) { uint uVar1; void *pvVar2; void *pvVar3; char *pcVar4; int iVar5; int iVar6; size_t sVar7; char cVar8; size_t _Count; char *local_34; char *local_30; char local_29; char local_28 [32]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_28 + 0x24); if (param_2 == -1) { return 0; } uVar1 = *(uint *)(this->_bottomRightPos).y; cVar8 = (char)param_2; if ((uVar1 != 0) && (uVar1 < *(int *)this->_gridEntities[3] + uVar1)) { pcVar4 = std::basic_streambuf_>::_Pninc ((basic_streambuf_> *)this); *pcVar4 = cVar8; return param_2; } if (this->_gridEntities[10] != (void *)0x0) { if ((void **)*(undefined1 **)this->_gridWidth == this->_gridEntities + 6) { pvVar2 = this->_gridEntities[0xc]; pvVar3 = this->_gridEntities[0xb]; *(void **)this->_gridWidth = pvVar3; *(void **)(this->_bottomRightPos).x = pvVar3; *(int *)this->_gridEntities[2] = (int)pvVar2 - (int)pvVar3; } if (this->_gridEntities[5] == (codecvt *)0x0) { LAB_009e7e8d: iVar6 = fputc((int)cVar8,this->_gridEntities[10]); iVar5 = -1; if (iVar6 != -1) { iVar5 = param_2; } return iVar5; } local_29 = cVar8; iVar5 = std::codecvt::out (this->_gridEntities[5],(_Mbstatet *)(this->_gridEntities + 7),&local_29, local_28,&local_34,local_28,(char *)&local_8,&local_30); if ((iVar5 == 0) || (iVar5 == 1)) { _Count = (int)local_30 - (int)local_28; if (((_Count == 0) || (sVar7 = fwrite(local_28,1,_Count,this->_gridEntities[10]), _Count == sVar7)) && (*(undefined1 *)((int)this->_gridEntities + 0x19) = 1, local_34 != &local_29)) { return param_2; } } else if (iVar5 == 3) { cVar8 = local_29; goto LAB_009e7e8d; } } return -1; } //@@ 009e7f10 FUN_009e7f10 void FUN_009e7f10(void) { int in_ECX; if (*(FILE **)(in_ECX + 0x4c) != (FILE *)0x0) { _unlock_file(*(FILE **)(in_ECX + 0x4c)); } return; } //@@ 009e7f20 FUN_009e7f20 void FUN_009e7f20(void) { int in_ECX; if (*(FILE **)(in_ECX + 0x4c) != (FILE *)0x0) { _lock_file(*(FILE **)(in_ECX + 0x4c)); } return; } //@@ 009e7f30 std::basic_filebuf::~basic_filebuf /* DB: sets basic_filebuf vftable, restores the get area, flushes (FUN_009e82b0) and fcloses the FILE at +0x4c, then ~basic_streambuf; the screenshot writer's ofstream teardown and other filebuf dtors */ void std::basic_filebuf::~basic_filebuf(void) { int iVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; uint uVar5; basic_streambuf_> *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0a50; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)in_ECX = basic_filebuf_>::vftable; if ((*(int *)(in_ECX + 0x4c) != 0) && ((basic_streambuf_> *)**(int **)(in_ECX + 0xc) == in_ECX + 0x3c)) { iVar1 = *(int *)(in_ECX + 0x54); iVar2 = *(int *)(in_ECX + 0x50); **(int **)(in_ECX + 0xc) = iVar2; **(int **)(in_ECX + 0x1c) = iVar2; **(int **)(in_ECX + 0x2c) = iVar1 - iVar2; } if (in_ECX[0x48] != (basic_streambuf_>)0x0) { if (*(int *)(in_ECX + 0x4c) != 0) { if ((basic_streambuf_> *)**(int **)(in_ECX + 0xc) == in_ECX + 0x3c ) { iVar1 = *(int *)(in_ECX + 0x54); iVar2 = *(int *)(in_ECX + 0x50); **(int **)(in_ECX + 0xc) = iVar2; **(int **)(in_ECX + 0x1c) = iVar2; **(int **)(in_ECX + 0x2c) = iVar1 - iVar2; } FUN_009e82b0(uVar5); fclose(*(FILE **)(in_ECX + 0x4c)); } in_ECX[0x48] = (basic_streambuf_>)0x0; in_ECX[0x3d] = (basic_streambuf_>)0x0; std::basic_streambuf_>::_Init(in_ECX); uVar4 = DAT_00c943b0; uVar3 = DAT_00c943ac; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x40) = uVar3; *(undefined4 *)(in_ECX + 0x44) = uVar4; *(undefined4 *)(in_ECX + 0x38) = 0; } std::basic_streambuf_>::~basic_streambuf_> (in_ECX); ExceptionList = local_10; return; } //@@ 009e8010 std::basic_ofstream::basic_ofstream /* DB: builds basic_ios/basic_ostream/basic_filebuf, sets basic_ofstream vftable, then opens param_1 filename; caller save_screenshot */ void std::basic_ofstream::basic_ofstream(char *param_1) { basic_streambuf_> *this; int iVar1; int iVar2; bool bVar3; _iobuf *p_Var4; codecvt_base *this_00; undefined4 *puVar5; basic_ostream_> *in_ECX; undefined1 *puVar6; undefined1 local_28 [4]; int *local_24; undefined4 local_1c; basic_streambuf_> *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fa5a; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = 0; *(undefined **)in_ECX = &DAT_00b1b17c; std::basic_ios_>::basic_ios_> ((basic_ios_> *)(in_ECX + 0x68)); this = (basic_streambuf_> *)(in_ECX + 4); local_8 = 0; local_1c = 1; std::basic_ostream_>::basic_ostream_> (in_ECX,this,false); local_8 = 1; *(undefined ***)(in_ECX + *(int *)(*(int *)in_ECX + 4)) = basic_ofstream_>::vftable; *(int *)(in_ECX + *(int *)(*(int *)in_ECX + 4) + -4) = *(int *)(*(int *)in_ECX + 4) + -0x68; local_18 = this; std::basic_streambuf_>::basic_streambuf_> (this); local_8._0_1_ = 2; *(undefined ***)this = basic_filebuf_>::vftable; in_ECX[0x4c] = (basic_ostream_>)0x0; in_ECX[0x41] = (basic_ostream_>)0x0; std::basic_streambuf_>::_Init(this); iVar2 = DAT_00c943b0; iVar1 = DAT_00c943ac; *(undefined4 *)(in_ECX + 0x50) = 0; *(int *)(in_ECX + 0x44) = iVar1; *(int *)(in_ECX + 0x48) = iVar2; *(undefined4 *)(in_ECX + 0x3c) = 0; local_8._0_1_ = 3; if ((*(int *)(in_ECX + 0x50) != 0) || (p_Var4 = std::_Fiopen(param_1,0x22,0x40), p_Var4 == (_iobuf *)0x0)) { std::basic_ios_>::setstate ((basic_ios_> *)(in_ECX + *(int *)(*(int *)in_ECX + 4)),2, false); ExceptionList = local_10; return; } in_ECX[0x4c] = (basic_ostream_>)0x1; in_ECX[0x41] = (basic_ostream_>)0x0; std::basic_streambuf_>::_Init(this); param_1 = (char *)0x0; local_14 = 0; local_18 = (basic_streambuf_> *)0x0; get_stream_buffer_pointers(p_Var4,¶m_1,&local_14,&local_18); iVar1 = DAT_00c943b0; *(char **)(in_ECX + 0x10) = param_1; *(char **)(in_ECX + 0x14) = param_1; *(undefined4 *)(in_ECX + 0x20) = local_14; *(undefined4 *)(in_ECX + 0x24) = local_14; *(basic_streambuf_> **)(in_ECX + 0x30) = local_18; *(basic_streambuf_> **)(in_ECX + 0x34) = local_18; *(int *)(in_ECX + 0x44) = DAT_00c943ac; puVar6 = local_28; *(int *)(in_ECX + 0x48) = iVar1; *(_iobuf **)(in_ECX + 0x50) = p_Var4; *(undefined4 *)(in_ECX + 0x3c) = 0; std::basic_streambuf_>::getloc(this); local_8 = CONCAT31(local_8._1_3_,4); this_00 = (codecvt_base *)FUN_009e84e0(puVar6); bVar3 = std::codecvt_base::always_noconv(this_00); if (bVar3) { *(undefined4 *)(in_ECX + 0x3c) = 0; } else { *(codecvt_base **)(in_ECX + 0x3c) = this_00; std::basic_streambuf_>::_Init(this); } local_8 = CONCAT31(local_8._1_3_,5); if (local_24 == (int *)0x0) { ExceptionList = local_10; return; } puVar5 = (undefined4 *)(**(code **)(*local_24 + 8))(); if (puVar5 == (undefined4 *)0x0) { ExceptionList = local_10; return; } (**(code **)*puVar5)(1); ExceptionList = local_10; return; } //@@ 009e81f0 FUN_009e81f0 void FUN_009e81f0(byte param_1) { void *in_ECX; std::basic_filebuf::~basic_filebuf(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } return; } //@@ 009e8220 FUN_009e8220 basic_ios_> * FUN_009e8220(byte param_1) { basic_ios_> *ptr; basic_ios_> *in_ECX; ptr = in_ECX + -0x68; *(undefined ***)(in_ECX + *(int *)(*(int *)(in_ECX + -0x68) + 4) + -0x68) = std::basic_ofstream_>::vftable; *(int *)(in_ECX + *(int *)(*(int *)ptr + 4) + -0x6c) = *(int *)(*(int *)ptr + 4) + -0x68; std::basic_filebuf::~basic_filebuf(); std::basic_ostream_>::~basic_ostream_> ((basic_ostream_> *)(in_ECX + -0x60)); std::basic_ios_>::~basic_ios_>(in_ECX); if ((param_1 & 1) != 0) { operator_delete(ptr,0xb0); } return ptr; } //@@ 009e8280 std::basic_filebuf_>::_Reset_back /* Library Function - Single Match private: void __thiscall std::basic_filebuf >::_Reset_back(void) Libraries: Visual Studio 2015 Release, Visual Studio 2017 Release, Visual Studio 2019 Release */ void __thiscall std::basic_filebuf_>::_Reset_back (basic_filebuf_> *this) { int iVar1; int iVar2; if ((basic_filebuf_> *)**(int **)(this + 0xc) == this + 0x3c) { iVar1 = *(int *)(this + 0x50); iVar2 = *(int *)(this + 0x54); **(int **)(this + 0xc) = iVar1; **(int **)(this + 0x1c) = iVar1; **(int **)(this + 0x2c) = iVar2 - iVar1; } return; } //@@ 009e82b0 FUN_009e82b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ bool FUN_009e82b0(void) { int iVar1; size_t sVar2; int *in_ECX; size_t _Count; char *local_2c; char local_28 [32]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_28 + 0x24); if ((in_ECX[0xe] == 0) || (*(char *)((int)in_ECX + 0x3d) == '\0')) { return true; } iVar1 = (**(code **)(*in_ECX + 0xc))(0xffffffff); if (iVar1 == -1) { return false; } iVar1 = std::codecvt::unshift ((codecvt *)in_ECX[0xe],(_Mbstatet *)(in_ECX + 0x10), local_28,(char *)&local_8,&local_2c); if (iVar1 == 0) { *(undefined1 *)((int)in_ECX + 0x3d) = 0; } else if (iVar1 != 1) { if (iVar1 == 3) { *(undefined1 *)((int)in_ECX + 0x3d) = 0; return true; } return false; } _Count = (int)local_2c - (int)local_28; if ((_Count == 0) || (sVar2 = fwrite(local_28,1,_Count,(FILE *)in_ECX[0x13]), _Count == sVar2)) { return *(char *)((int)in_ECX + 0x3d) == '\0'; } return false; } //@@ 009e8380 FUN_009e8380 void FUN_009e8380(uint param_1,uint param_2) { uint *puVar1; uint uVar2; uint uVar3; int iVar4; uint *in_ECX; undefined2 *puVar5; int *piVar6; uVar2 = param_1; puVar1 = in_ECX + 2; in_ECX[1] = param_2; *in_ECX = param_1; param_1 = (int)(in_ECX[3] - *puVar1) / 0xc; if (param_2 < param_1) { uVar3 = *puVar1; iVar4 = param_2 * 0xc; FUN_009e85d0(in_ECX[3] - *puVar1); in_ECX[3] = uVar3 + iVar4; } else if (param_1 < param_2) { if ((uint)((int)(in_ECX[4] - *puVar1) / 0xc) < param_2) { FUN_009e8bc0(param_2,¶m_1); } else { uVar3 = FUN_009e86a0(in_ECX[3],param_2 - param_1,param_1); in_ECX[3] = uVar3; } } piVar6 = (int *)*puVar1; if (piVar6 != (int *)in_ECX[3]) { do { puVar5 = (undefined2 *)piVar6[1]; uVar3 = ((int)puVar5 - *piVar6) / 3; if (uVar2 < uVar3) { piVar6[1] = *piVar6 + uVar2 * 3; } else if (uVar3 < uVar2) { if ((uint)((piVar6[2] - *piVar6) / 3) < uVar2) { FUN_009e8a80(uVar2,puVar5); } else { for (iVar4 = uVar2 - uVar3; iVar4 != 0; iVar4 = iVar4 + -1) { *puVar5 = 0; *(undefined1 *)(puVar5 + 1) = 0; puVar5 = (undefined2 *)((int)puVar5 + 3); } piVar6[1] = (int)puVar5; } } piVar6 = piVar6 + 3; } while (piVar6 != (int *)in_ECX[3]); } return; } //@@ 009e84a0 FUN_009e84a0 void FUN_009e84a0(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 3; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 009e84e0 FUN_009e84e0 _Facet_base * FUN_009e84e0(void) { int iVar1; uint uVar2; _Locimp *p_Var3; locale *in_ECX; _Facet_base *p_Var4; _Lockit local_18 [4]; _Facet_base *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fa96; local_10 = ExceptionList; ExceptionList = &local_10; std::_Lockit::_Lockit(local_18,0); local_8 = 0; local_14 = DAT_00c7f604; uVar2 = std::locale::id::operator_unsigned_int((id *)id_exref); iVar1 = *(int *)(in_ECX + 4); if (uVar2 < *(uint *)(iVar1 + 0xc)) { p_Var4 = *(_Facet_base **)(*(int *)(iVar1 + 8) + uVar2 * 4); if (p_Var4 != (_Facet_base *)0x0) goto LAB_009e85a0; } else { p_Var4 = (_Facet_base *)0x0; } if (*(char *)(iVar1 + 0x14) == '\0') { LAB_009e855f: if (p_Var4 != (_Facet_base *)0x0) goto LAB_009e85a0; } else { p_Var3 = std::locale::_Getgloballocale(); if (uVar2 < *(uint *)(p_Var3 + 0xc)) { p_Var4 = *(_Facet_base **)(*(int *)(p_Var3 + 8) + uVar2 * 4); goto LAB_009e855f; } } p_Var4 = local_14; if (local_14 == (_Facet_base *)0x0) { uVar2 = std::codecvt::_Getcat((facet **)&local_14,in_ECX); p_Var4 = local_14; if (uVar2 == 0xffffffff) { /* WARNING: Subroutine does not return */ FUN_009e6b20(); } local_8 = CONCAT31(local_8._1_3_,1); std::_Facet_Register(local_14); (**(code **)(*(int *)p_Var4 + 4))(); DAT_00c7f604 = local_14; p_Var4 = local_14; } LAB_009e85a0: std::_Lockit::~_Lockit(local_18); ExceptionList = local_10; return p_Var4; } //@@ 009e85d0 FUN_009e85d0 void FUN_009e85d0(void) { void *pvVar1; int *in_ECX; uint size; int *in_EDX; void *ptr; do { if (in_ECX == in_EDX) { return; } pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = ((in_ECX[2] - (int)pvVar1) / 3) * 3; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } in_ECX = in_ECX + 3; } while( true ); } //@@ 009e8650 FUN_009e8650 void FUN_009e8650(void) { int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af11c0; local_10 = ExceptionList; ExceptionList = &local_10; if ((undefined4 *)*in_ECX != (undefined4 *)0x0) { local_8 = 0; (*(code *)**(undefined4 **)*in_ECX)(1,__security_cookie ^ (int)register0x00000010 - 4U); } ExceptionList = local_10; return; } //@@ 009e86a0 FUN_009e86a0 undefined4 * FUN_009e86a0(undefined4 *param_1,int param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1 = param_1 + 3; } FUN_009e85d0(); return param_1; } //@@ 009e86e0 png_write_image /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? libpng writer: png_create_write_struct, png_info_destroy, png_destroy_write_struct ("Attempted to set both read_data_fn and write_data_fn"); the ZHL Entity_Familiar::RestoreState signature matched wrongly */ void __thiscall png_write_image(void *this,FamiliarData *saveData) { code *pcVar1; undefined4 *puVar2; int iVar3; uint uVar4; undefined4 uVar5; uint uVar6; size_t _Size; void *pvVar7; uint uVar8; int iVar9; uint local_88; void *local_80; void **local_7c; void *local_78; void *local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; void *local_54; int local_50; int local_4c; void *local_48; int local_44; int local_40; void **local_3c; void *local_38; void *local_34; void *local_30; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0facd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = uVar4; local_80 = (void *)png_create_write_struct(); local_7c = &local_80; local_78 = local_80; if (local_80 == (void *)0x0) { local_74 = (void *)0x0; } else { local_74 = malloc(0xb8); if (local_74 != (void *)0x0) { memset(local_74,0,0xb8); } } FUN_009e6d90(uVar4); local_3c = &local_80; local_38 = local_80; if (local_80 == (void *)0x0) { local_34 = (void *)0x0; } else { local_34 = malloc(0xb8); if (local_34 != (void *)0x0) { memset(local_34,0,0xb8); } } pvVar7 = local_80; local_20 = 0; local_1c = 0xf; local_30 = (void *)0x0; *(FamiliarData **)((int)local_80 + 0x5c) = saveData; *(code **)((int)local_80 + 0x4c) = FUN_009e91a0; *(code **)((int)local_80 + 0x144) = FUN_009e90c0; if (*(int *)((int)local_80 + 0x50) != 0) { *(undefined4 *)((int)local_80 + 0x50) = 0; if (*(code **)((int)local_80 + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n", "Attempted to set both read_data_fn and write_data_fn in"); FUN_008c5d50(uVar5); } else { (**(code **)((int)local_80 + 0x44))(local_80); } pcVar1 = *(code **)((int)pvVar7 + 0x44); if (pcVar1 == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n", "the same structure. Resetting read_data_fn to NULL."); FUN_008c5d50(uVar5); } else { (*pcVar1)(pvVar7); } } local_8 = 0; puVar2 = *(undefined4 **)this; local_70 = *puVar2; local_6c = puVar2[1]; local_68 = puVar2[2]; local_64 = puVar2[3]; local_60 = puVar2[4]; local_5c = puVar2[5]; local_58 = puVar2[6]; if (&local_54 != (void **)(puVar2 + 7)) { pvVar7 = (void *)puVar2[7]; _Size = puVar2[8] - (int)pvVar7; if ((uint)((local_4c - (int)local_54) / 3) < (uint)((int)_Size / 3)) { std::vector<3byte>::_Clear_and_reserve((int)_Size / 3); } memmove(local_54,pvVar7,_Size); local_50 = _Size + (int)local_54; } if (&local_48 != (void **)(puVar2 + 10)) { pvVar7 = (void *)puVar2[10]; uVar4 = puVar2[0xb] - (int)pvVar7; if ((uint)(local_40 - (int)local_48) < uVar4) { std::vector::_Clear_and_reserve(uVar4); } memmove(local_48,pvVar7,uVar4); local_44 = uVar4 + (int)local_48; } PngWriter::write_info(); iVar9 = *(int *)this; if ((*(int *)(iVar9 + 0x10) == 0) || (*(char *)((int)local_80 + 0x11b) == '\0')) { uVar4 = 1; } else { *(uint *)((int)local_80 + 0x68) = *(uint *)((int)local_80 + 0x68) | 2; uVar4 = 7; iVar9 = *(int *)this; } uVar6 = *(uint *)(iVar9 + 4); local_88 = 0; do { uVar8 = 0; if (uVar6 != 0) { iVar9 = 0; do { iVar3 = *(int *)(*(int *)((int)this + 4) + 8); if ((uint)((*(int *)(*(int *)((int)this + 4) + 0xc) - iVar3) / 0xc) <= uVar8) { /* WARNING: Subroutine does not return */ FUN_008ba150(); } FUN_009e8e90(*(undefined4 *)(iVar9 + iVar3)); uVar8 = uVar8 + 1; iVar9 = iVar9 + 0xc; uVar6 = *(uint *)(*(int *)this + 4); } while (uVar8 < uVar6); } local_88 = local_88 + 1; } while (local_88 < uVar4); PngWriter::write_end(); pvVar7 = local_34; if (local_34 != (void *)0x0) { png_info_destroy(local_38,local_34); free(pvVar7); local_34 = (void *)0x0; } png_destroy_write_struct(); if (0xf < local_1c) { uVar4 = local_1c + 1; pvVar7 = local_30; if (0xfff < uVar4) { pvVar7 = *(void **)((int)local_30 + -4); uVar4 = local_1c + 0x24; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar4); } local_20 = 0; local_1c = 0xf; local_30 = (void *)((uint)local_30 & 0xffffff00); FUN_007dcd30(); FUN_009e7390(); ExceptionList = local_10; return; } //@@ 009e8a80 FUN_009e8a80 void FUN_009e8a80(uint param_1) { undefined2 *puVar1; int iVar2; uint uVar3; undefined2 *puVar4; uint size; int *in_ECX; int iVar5; undefined2 *puVar6; undefined2 *puVar7; undefined2 *puVar8; if (0x55555555 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar2 = (in_ECX[1] - *in_ECX) / 3; uVar3 = (in_ECX[2] - *in_ECX) / 3; if (0x55555555 - (uVar3 >> 1) < uVar3) { uVar3 = 0x55555555; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < param_1) { uVar3 = param_1; } else if (0x55555555 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar4 = std::_Allocate(uVar3 * 3); puVar6 = (undefined2 *)((int)puVar4 + iVar2 * 3); for (iVar5 = param_1 - iVar2; iVar5 != 0; iVar5 = iVar5 + -1) { *puVar6 = 0; *(undefined1 *)(puVar6 + 1) = 0; puVar6 = (undefined2 *)((int)puVar6 + 3); } puVar6 = (undefined2 *)*in_ECX; puVar7 = (undefined2 *)in_ECX[1]; puVar8 = puVar4; if (puVar6 != puVar7) { do { *puVar8 = *puVar6; puVar1 = puVar6 + 1; puVar6 = (undefined2 *)((int)puVar6 + 3); *(undefined1 *)(puVar8 + 1) = *(undefined1 *)puVar1; puVar8 = (undefined2 *)((int)puVar8 + 3); } while (puVar6 != puVar7); puVar6 = (undefined2 *)*in_ECX; } if (puVar6 != (undefined2 *)0x0) { size = ((in_ECX[2] - (int)puVar6) / 3) * 3; puVar7 = puVar6; if (0xfff < size) { puVar7 = *(undefined2 **)(puVar6 + -2); size = size + 0x23; if (0x1f < (uint)((int)puVar6 + (-4 - (int)puVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar7,size); } *in_ECX = (int)puVar4; in_ECX[1] = (int)puVar4 + param_1 * 3; in_ECX[2] = uVar3 * 3 + (int)puVar4; return; } //@@ 009e8bc0 FUN_009e8bc0 void FUN_009e8bc0(uint param_1,undefined1 *param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; void *pvVar4; int iVar5; uint uVar6; undefined4 *puVar7; undefined4 *puVar8; int *in_ECX; undefined4 *puVar9; uint size; void *ptr; undefined4 *puVar10; if (0x15555555 < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } iVar5 = (in_ECX[1] - *in_ECX) / 0xc; uVar6 = (in_ECX[2] - *in_ECX) / 0xc; if (0x15555555 - (uVar6 >> 1) < uVar6) { uVar6 = 0x15555555; } else { uVar6 = (uVar6 >> 1) + uVar6; if (uVar6 < param_1) { uVar6 = param_1; } else if (0x15555555 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = std::_Allocate(uVar6 * 0xc); FUN_009e86a0(puVar7 + iVar5 * 3,param_1 - iVar5,*param_2); puVar1 = (undefined4 *)in_ECX[1]; puVar8 = (undefined4 *)*in_ECX; puVar9 = puVar1; puVar10 = puVar7; if (puVar8 != puVar1) { do { uVar2 = puVar8[2]; uVar3 = puVar8[1]; puVar9 = (undefined4 *)*puVar8; puVar8[2] = 0; puVar8[1] = 0; *puVar8 = 0; puVar8 = puVar8 + 3; *puVar10 = puVar9; puVar10[1] = uVar3; puVar10[2] = uVar2; puVar10 = puVar10 + 3; } while (puVar8 != puVar1); } FUN_009e85d0(puVar9); if (*in_ECX != 0) { FUN_009e85d0(*in_ECX); pvVar4 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar4) / 0xc) * 0xc; ptr = pvVar4; if (0xfff < size) { ptr = *(void **)((int)pvVar4 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + param_1 * 3); in_ECX[2] = (int)(puVar7 + uVar6 * 3); return; } //@@ 009e8d40 PngWriter::write_end /* DB: ? libpng png_write_end under the writer's setjmp guard: requires the IDAT-written mode bit ("No IDATs written into file"), writes pending text chunks, sets mode 8, writes IEND via the write callback (+0x4c, "Call to NULL write function"); last call of the PNG writer 009e86e0 png_write_image void PngWriter::write_end(void) { void *pngPtr; int iVar1; undefined4 uVar2; int iVar3; undefined4 *in_ECX; int *piVar4; int iVar5; undefined1 local_1c [12]; int local_10; undefined4 *local_c; undefined1 local_8; undefined1 local_7; undefined1 local_6; undefined1 local_5; local_c = in_ECX; iVar3 = setjmp3(*in_ECX,0); if (iVar3 != 0) { FUN_009e6bd0(local_c + 0x14); /* WARNING: Subroutine does not return */ _CxxThrowException(local_1c,(ThrowInfo *)&DAT_00bd5cc0); } pngPtr = (void *)local_c[0x12]; iVar3 = local_c[0x13]; if ((*(byte *)((int)pngPtr + 0x60) & 4) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (iVar3 != 0) { if (((*(uint *)(iVar3 + 8) & 0x200) != 0) && ((*(uint *)((int)pngPtr + 100) & 0x10000) == 0)) { FUN_00a931f0(); } local_10 = 0; if (0 < *(int *)(iVar3 + 0x30)) { iVar5 = 0; do { piVar4 = (int *)(*(int *)(iVar3 + 0x38) + iVar5); iVar1 = *piVar4; if (iVar1 < 0) { if (iVar1 == -1) { FUN_00a92520(piVar4[2],piVar4[3]); *(undefined4 *)(iVar5 + *(int *)(iVar3 + 0x38)) = 0xfffffffd; } } else { png_write_zTXt(piVar4[2],piVar4[3],iVar1); *(undefined4 *)(iVar5 + *(int *)(iVar3 + 0x38)) = 0xfffffffe; } iVar5 = iVar5 + 0x10; local_10 = local_10 + 1; } while (local_10 < *(int *)(iVar3 + 0x30)); } } *(uint *)((int)pngPtr + 0x60) = *(uint *)((int)pngPtr + 0x60) | 8; png_write_chunk_header(pngPtr,(byte *)&DAT_00c12990,0); uVar2 = *(undefined4 *)((int)pngPtr + 0x108); local_5 = (undefined1)uVar2; local_8 = (undefined1)((uint)uVar2 >> 0x18); local_7 = (undefined1)((uint)uVar2 >> 0x10); local_6 = (undefined1)((uint)uVar2 >> 8); if (*(code **)((int)pngPtr + 0x4c) == (code *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)pngPtr + 0x4c))(pngPtr,&local_8,4); *(uint *)((int)pngPtr + 0x60) = *(uint *)((int)pngPtr + 0x60) | 0x10; return; } //@@ 009e8e90 FUN_009e8e90 void FUN_009e8e90(void) { int iVar1; undefined4 *in_ECX; undefined1 local_14 [12]; undefined4 *local_8; local_8 = in_ECX; iVar1 = setjmp3(*in_ECX,0); if (iVar1 != 0) { FUN_009e6bd0(local_8 + 0x14); /* WARNING: Subroutine does not return */ _CxxThrowException(local_14,(ThrowInfo *)&DAT_00bd5cc0); } png_write_row(); return; } //@@ 009e8ee0 PngWriter::write_info /* DB: ? thiscall writer {png_struct* at +0 ...}: setjmp3(png_ptr) guard rethrowing a C++ exception, png_set_IHDR-like FUN_00a63100(w,h,depth,colorType,...) from this[4..10], for palette colour type 3 sets PLTE (this[0xb..0xc], count/3, flag 8) and tRNS (this[0xe..0xf], flag 0x10), then png_write_info FUN_00a63490; called by the PNG writer 009e86e0 png_write_image Entity_Familiar::RestoreState) */ void PngWriter::write_info(void) { int iVar1; int iVar2; int iVar3; undefined4 *in_ECX; undefined1 local_14 [12]; undefined4 *local_8; local_8 = in_ECX; iVar3 = setjmp3(*in_ECX,0); if (iVar3 != 0) { FUN_009e6bd0(local_8 + 0x14); /* WARNING: Subroutine does not return */ _CxxThrowException(local_14,(ThrowInfo *)&DAT_00bd5cc0); } FUN_00a63100(local_8[4],local_8[5],local_8[6],local_8[7],local_8[8],local_8[9],local_8[10]); if (local_8[7] == 3) { iVar3 = local_8[0xb]; iVar1 = local_8[0xc]; if (((iVar3 != iVar1) && (local_8[2] != 0)) && (iVar2 = local_8[3], iVar2 != 0)) { *(int *)(iVar2 + 0x10) = iVar3; *(uint *)(iVar2 + 8) = *(uint *)(iVar2 + 8) | 8; *(short *)(iVar2 + 0x14) = (short)((iVar1 - iVar3) / 3); } iVar3 = local_8[0xe]; iVar1 = local_8[0xf]; if (iVar3 != iVar1) { iVar2 = local_8[3]; if ((local_8[2] != 0) && (iVar2 != 0)) { if (iVar3 != 0) { *(int *)(iVar2 + 0x4c) = iVar3; } *(uint *)(iVar2 + 8) = *(uint *)(iVar2 + 8) | 0x10; *(short *)(iVar2 + 0x16) = (short)iVar1 - (short)iVar3; } } } png_write_info(); return; } //@@ 009e8fc0 FUN_009e8fc0 void FUN_009e8fc0(void) { undefined4 *puVar1; void *infoPtr; int in_ECX; puVar1 = (undefined4 *)(in_ECX + 0x4c); if ((puVar1 != (undefined4 *)0x0) && (infoPtr = (void *)*puVar1, infoPtr != (void *)0x0)) { png_info_destroy(*(void **)(in_ECX + 0x48),infoPtr); free(infoPtr); *puVar1 = 0; } png_destroy_write_struct(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x50)); FUN_007dcd30(); FUN_009e7390(); return; } //@@ 009e9020 std::vector<3byte>::_Clear_and_reserve /* DB: vector of 3-byte elements (max 0x55555555): frees the old buffer (FUN_009e84a0) and allocates capacity max(n, 1.5x); Entity_Familiar::RestoreState before memmove-assigning a byte-triple vector */ void std::vector<3byte>::_Clear_and_reserve(uint param_1) { uint uVar1; void *pvVar2; int *in_ECX; uint uVar3; if (0x55555555 < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = (in_ECX[2] - *in_ECX) / 3; if (0x55555555 - (uVar1 >> 1) < uVar1) { uVar3 = 0x55555555; } else { uVar3 = (uVar1 >> 1) + uVar1; if (uVar3 < param_1) { uVar3 = param_1; } } if (*in_ECX != 0) { FUN_009e84a0(*in_ECX,uVar1); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x55555555 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar2 = _Allocate(uVar3 * 3); *in_ECX = (int)pvVar2; in_ECX[1] = (int)pvVar2; in_ECX[2] = (int)((int)pvVar2 + uVar3 * 3); return; } //@@ 009e90c0 FUN_009e90c0 void FUN_009e90c0(int param_1) { int iVar1; basic_ostream_> *this; undefined1 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0fb00; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *(int *)(param_1 + 0x48); puVar2 = (undefined1 *)(iVar1 + 0x50); if (0xf < *(uint *)(iVar1 + 100)) { puVar2 = *(undefined1 **)(iVar1 + 0x50); } *(undefined4 *)(iVar1 + 0x60) = 0; *puVar2 = 0; this = *(basic_ostream_> **)(param_1 + 0x5c); local_8 = 0; std::basic_ostream_>::flush(this); if (*(int *)(this + *(int *)(*(int *)this + 4) + 0xc) != 0) { std::string::assign((char *)(iVar1 + 0x50),(byte *)"ostream::flush() failed",0x17); } local_8 = 0xffffffff; if (*(int *)(iVar1 + 0x60) != 0) { /* WARNING: Subroutine does not return */ FUN_009e6e80(); } FUN_009e917a(); return; } //@@ 009e9139 Catch@009e9139 undefined * Catch_009e9139(void) { undefined4 uVar1; int unaff_EBP; uVar1 = (**(code **)(**(int **)(unaff_EBP + -0x14) + 4))(); FUN_009e6e50(uVar1); return &DAT_009e9150; } //@@ 009e9162 Catch_All@009e9162 undefined * Catch_All_009e9162(void) { int unaff_EBP; std::string::assign((char *)(*(int *)(unaff_EBP + 8) + 0x50), (byte *)"flush_data: caught something wrong",0x22); return &DAT_009e9150; } //@@ 009e917a FUN_009e917a void FUN_009e917a(void) { int unaff_EBP; ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 009e91a0 FUN_009e91a0 void FUN_009e91a0(int param_1,char *param_2) { int iVar1; basic_ostream_> *this; uint uVar2; undefined1 *puVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0fb20; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar1 = *(int *)(param_1 + 0x48); puVar3 = (undefined1 *)(iVar1 + 0x50); if (0xf < *(uint *)(iVar1 + 100)) { puVar3 = *(undefined1 **)(iVar1 + 0x50); } *(undefined4 *)(iVar1 + 0x60) = 0; *puVar3 = 0; this = *(basic_ostream_> **)(param_1 + 0x5c); local_8 = 0; std::basic_ostream_>::write(this,param_2,(ulonglong)uVar2 << 0x20); if (*(int *)(this + *(int *)(*(int *)this + 4) + 0xc) != 0) { std::string::assign((char *)(iVar1 + 0x50),(byte *)"ostream::write() failed",0x17); } local_8 = 0xffffffff; if (*(int *)(iVar1 + 0x60) != 0) { /* WARNING: Subroutine does not return */ FUN_009e6e80(); } FUN_009e9262(); return; } //@@ 009e9221 Catch@009e9221 undefined * Catch_009e9221(void) { undefined4 uVar1; int unaff_EBP; uVar1 = (**(code **)(**(int **)(unaff_EBP + -0x14) + 4))(); FUN_009e6e50(uVar1); return &DAT_009e9238; } //@@ 009e924a Catch_All@009e924a undefined * Catch_All_009e924a(void) { int unaff_EBP; std::string::assign((char *)(*(int *)(unaff_EBP + 8) + 0x50), (byte *)"write_data: caught something wrong",0x22); return &DAT_009e9238; } //@@ 009e9262 FUN_009e9262 void FUN_009e9262(void) { int unaff_EBP; ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 009e9281 FUN_009e9281 void FUN_009e9281(void) { FUN_009e8220(); return; } //@@ 009e9290 Seeds::constructor /* ZHL [exact] __fastcall void Seeds::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __fastcall Seeds::constructor(void) { int *this; int iVar1; void *pvVar2; undefined1 *in_ECX; this = (int *)(in_ECX + 0x54); *(undefined8 *)(in_ECX + 0xc) = 0x900000005; *(undefined4 *)(in_ECX + 8) = 0xaa17414f; *(undefined4 *)(in_ECX + 0x14) = 7; *this = 0; *(undefined4 *)(in_ECX + 0x58) = 0; pvVar2 = operator_new(0x14); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *this = (int)pvVar2; *(undefined4 *)(in_ECX + 4) = 0; *in_ECX = 0; iVar1 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0x58) = 0; return; } //@@ 009e9320 Seeds::construct_from_copy /* ZHL [exact] __thiscall void Seeds::construct_from_copy(Seeds* right); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Seeds::construct_from_copy(Seeds *this,Seeds *right) { void **this_00; int iVar1; int iVar2; int iVar3; void *pvVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fb50; local_10 = ExceptionList; ExceptionList = &local_10; this_00 = &this->_seedEffects; (this->_rng)._shift1 = 5; (this->_rng)._shift2 = 9; (this->_rng)._seed = -0x55e8beb1; (this->_rng)._shift3 = 7; *this_00 = (void *)0x0; this->_seedEffectsCount = 0; pvVar4 = operator_new(0x14); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; *(undefined2 *)((int)pvVar4 + 0xc) = 0x101; *this_00 = pvVar4; local_8 = 0; this->_isCustomRun = right->_isCustomRun; this->_gameStartSeed = right->_gameStartSeed; this->_playerInitSeed = right->_playerInitSeed; if (this_00 != &right->_seedEffects) { pvVar4 = *this_00; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)pvVar4 + 4)); *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; this->_seedEffectsCount = 0; std_set_uint_copy(this_00,&right->_seedEffects,(int)right); } iVar1 = (right->_rng)._shift1; iVar2 = (right->_rng)._shift2; iVar3 = (right->_rng)._shift3; (this->_rng)._seed = (right->_rng)._seed; (this->_rng)._shift1 = iVar1; (this->_rng)._shift2 = iVar2; (this->_rng)._shift3 = iVar3; iVar1 = right->_stageSeeds[1]; iVar2 = right->_stageSeeds[2]; iVar3 = right->_stageSeeds[3]; this->_stageSeeds[0] = right->_stageSeeds[0]; this->_stageSeeds[1] = iVar1; this->_stageSeeds[2] = iVar2; this->_stageSeeds[3] = iVar3; iVar1 = right->_stageSeeds[5]; iVar2 = right->_stageSeeds[6]; iVar3 = right->_stageSeeds[7]; this->_stageSeeds[4] = right->_stageSeeds[4]; this->_stageSeeds[5] = iVar1; this->_stageSeeds[6] = iVar2; this->_stageSeeds[7] = iVar3; iVar1 = right->_stageSeeds[9]; iVar2 = right->_stageSeeds[10]; iVar3 = right->_stageSeeds[0xb]; this->_stageSeeds[8] = right->_stageSeeds[8]; this->_stageSeeds[9] = iVar1; this->_stageSeeds[10] = iVar2; this->_stageSeeds[0xb] = iVar3; *(undefined8 *)(this->_stageSeeds + 0xc) = *(undefined8 *)(right->_stageSeeds + 0xc); ExceptionList = local_10; return; } //@@ 009e9430 Seeds::operator_assign /* DB: copy-assign: copies _isCustomRun(+0), _gameStartSeed(+4), _rng(+8..), +0x50 _playerInitSeed, rebuilds the _seedEffects set at +0x54 (copy via FUN_00709280); Game::store_game_state calls it right after Seeds::construct_from_copy prototype: db/protos.zhl, confirmed by RET 4 */ Seeds * __thiscall Seeds::operator_assign(Seeds *this,Seeds *other) { void **this_00; void *pvVar1; int iVar2; int iVar3; int iVar4; if (this != other) { this->_isCustomRun = other->_isCustomRun; this->_gameStartSeed = other->_gameStartSeed; this->_playerInitSeed = other->_playerInitSeed; this_00 = &this->_seedEffects; if (this_00 != &other->_seedEffects) { pvVar1 = *this_00; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; this->_seedEffectsCount = 0; std_set_uint_copy(&this->_seedEffects,&other->_seedEffects,(int)other); } iVar2 = (other->_rng)._shift1; iVar3 = (other->_rng)._shift2; iVar4 = (other->_rng)._shift3; (this->_rng)._seed = (other->_rng)._seed; (this->_rng)._shift1 = iVar2; (this->_rng)._shift2 = iVar3; (this->_rng)._shift3 = iVar4; iVar2 = other->_stageSeeds[1]; iVar3 = other->_stageSeeds[2]; iVar4 = other->_stageSeeds[3]; this->_stageSeeds[0] = other->_stageSeeds[0]; this->_stageSeeds[1] = iVar2; this->_stageSeeds[2] = iVar3; this->_stageSeeds[3] = iVar4; iVar2 = other->_stageSeeds[5]; iVar3 = other->_stageSeeds[6]; iVar4 = other->_stageSeeds[7]; this->_stageSeeds[4] = other->_stageSeeds[4]; this->_stageSeeds[5] = iVar2; this->_stageSeeds[6] = iVar3; this->_stageSeeds[7] = iVar4; iVar2 = other->_stageSeeds[9]; iVar3 = other->_stageSeeds[10]; iVar4 = other->_stageSeeds[0xb]; this->_stageSeeds[8] = other->_stageSeeds[8]; this->_stageSeeds[9] = iVar2; this->_stageSeeds[10] = iVar3; this->_stageSeeds[0xb] = iVar4; *(undefined8 *)(this->_stageSeeds + 0xc) = *(undefined8 *)(other->_stageSeeds + 0xc); } return this; } //@@ 009e94c0 FUN_009e94c0 void FUN_009e94c0(void) { undefined4 *this; int in_ECX; this = (undefined4 *)(in_ECX + 0x54); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)(in_ECX + 0x54) + 4)); operator_delete((void *)*this,0x14); return; } //@@ 009e94e0 Seeds::InitSeedInfo /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Seeds:InitSeedInfo */ void Seeds::InitSeedInfo(void) { uint banListSize; int banListEnd; int **copyHeadReg; int **innerNode; void *exclusiveSetHead; undefined4 local_48; int **copyHead; undefined4 local_40; undefined1 local_3c [8]; int ***local_34; int ***local_30; undefined4 exclusiveSeedIds; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; int ***outerNode; local_8 = 0xffffffff; puStack_c = &LAB_00b0fb95; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_3c + 0x38); ExceptionList = &local_10; banListSize = DAT_00c798c8 - (int)g_seedComboBans >> 3; if (banListSize < 0x51) { if (banListSize < 0x50) { if ((uint)(DAT_00c798cc - (int)g_seedComboBans >> 3) < 0x50) { std::vector>::_Resize_reallocate(banListSize,&local_30); } else { DAT_00c798c8 = std::_Uninitialized_value_construct_n> (DAT_00c798c8,0x50 - banListSize,local_30); } } } else { banListEnd = (int)g_seedComboBans + 0x280; FUN_009ebbf0(banListSize,local_14); DAT_00c798c8 = banListEnd; } exclusiveSeedIds = 1; uStack_28 = 2; uStack_24 = 0x29; uStack_20 = 0x2b; local_1c = 0x2a; local_18 = 0x2c; exclusiveSetHead = (void *)0x0; local_48 = 0; exclusiveSetHead = operator_new(0x14); *(void **)exclusiveSetHead = exclusiveSetHead; *(void **)((int)exclusiveSetHead + 4) = exclusiveSetHead; *(void **)((int)exclusiveSetHead + 8) = exclusiveSetHead; *(undefined2 *)((int)exclusiveSetHead + 0xc) = 0x101; local_8 = 0; std::set::insert_range(&exclusiveSeedIds,&local_14); local_8 = 1; local_34 = ©Head; copyHead = (int **)0x0; local_40 = 0; local_30 = local_34; copyHead = operator_new(0x14); *copyHead = (int *)copyHead; copyHead[1] = (int *)copyHead; copyHead[2] = (int *)copyHead; *(undefined2 *)(copyHead + 3) = 0x101; local_8._0_1_ = 2; std_set_uint_copy(©Head,&exclusiveSetHead,(int)local_30); local_8._0_1_ = 3; local_30 = (int ***)*copyHead; copyHeadReg = copyHead; if (local_30 != (int ***)copyHead) { do { outerNode = local_30; innerNode = (int **)*copyHeadReg; if (innerNode != copyHeadReg) { do { if (outerNode[4] != (int **)innerNode[4]) { std::set::insert(local_3c,innerNode + 4); copyHeadReg = copyHead; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&innerNode); } while (innerNode != copyHeadReg); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_30); } while (local_30 != (int ***)copyHeadReg); } local_8 = CONCAT31(local_8._1_3_,1); FID_conflict__Erase_tree_>_> (©Head,(fuzzer_allocator_> *)©Head, (_Tree_node *)copyHeadReg[1]); operator_delete(copyHead,0x14); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); FUN_009e9bf0(); local_30 = (int ***)0xb; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0xd; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x10; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x11; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x13; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x15; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x12; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x14; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x18; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x19; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x20; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x21; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x26; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x37; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x39; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x3f; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x40; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x41; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x42; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x43; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x44; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x46; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x49; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x4d; std::set::insert_c798d0(local_3c,&local_30); local_30 = (int ***)0x4f; std::set::insert_c798d0(local_3c,&local_30); FID_conflict__Erase_tree_>_> (&exclusiveSetHead, (fuzzer_allocator_> *)&exclusiveSetHead, *(_Tree_node **)((int)exclusiveSetHead + 4)); operator_delete(exclusiveSetHead,0x14); ExceptionList = local_10; return; } //@@ 009e9ab0 Seeds::CountUnlockedSeedEffects /* ZHL [lua] Lua binding Seeds:CountUnlockedSeedEffects */ int Seeds::CountUnlockedSeedEffects(void) { int iVar1; char *pcVar2; int iVar3; int iVar4; int iVar5; iVar4 = 0; iVar5 = 0x10; pcVar2 = &(g_manager->_persistentGameData).field_0xf15; do { iVar1 = iVar4 + 1; if (pcVar2[-1] == '\0') { iVar1 = iVar4; } iVar4 = iVar1 + 1; if (*pcVar2 == '\0') { iVar4 = iVar1; } iVar1 = iVar4 + 1; if (pcVar2[1] == '\0') { iVar1 = iVar4; } iVar3 = iVar1 + 1; if (pcVar2[2] == '\0') { iVar3 = iVar1; } iVar4 = iVar3 + 1; if (pcVar2[3] == '\0') { iVar4 = iVar3; } iVar5 = iVar5 + -1; pcVar2 = pcVar2 + 5; } while (iVar5 != 0); return iVar4; } //@@ 009e9b10 Seeds::IsSeedComboBanned /* ZHL [lua] Lua binding Seeds:IsSeedComboBanned */ bool Seeds::IsSeedComboBanned(uint param_1,uint param_2) { int *piVar1; int *piVar2; if ((param_1 < 0x50) && (param_2 < 0x50)) { piVar1 = (int *)((int)g_seedComboBans + param_1 * 8); piVar2 = (int *)std::set::find(¶m_1,¶m_2); return *piVar2 != *piVar1; } return true; } //@@ 009e9b50 Seeds::AchievementUnlocksDisallowed /* ZHL [exact] __thiscall bool Seeds::AchievementUnlocksDisallowed(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Seeds::AchievementUnlocksDisallowed(Seeds *this) { undefined4 *puVar1; int iVar2; int iVar3; undefined1 local_18 [8]; int local_10; int local_c; undefined4 *local_8; iVar3 = DAT_00c798d0; puVar1 = this->_seedEffects; local_8 = (undefined4 *)*puVar1; while( true ) { if (local_8 == puVar1) { return 0; } iVar2 = local_8[4]; local_c = iVar2; std::set::find_node(local_18,&local_c); if (((*(char *)(local_10 + 0xd) == '\0') && (*(int *)(local_10 + 0x10) <= iVar2)) && (local_10 != iVar3)) break; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); } return 1; } //@@ 009e9bc0 Seeds::Reset /* ZHL [lua] Lua binding Seeds:Reset */ void __thiscall Seeds::Reset(Seeds *this) { void *pvVar1; pvVar1 = this->_seedEffects; this->_gameStartSeed = 0; this->_isCustomRun = 0; FID_conflict__Erase_tree_>_> (&this->_seedEffects, (fuzzer_allocator_> *)&this->_seedEffects, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; this->_seedEffectsCount = 0; return; } //@@ 009e9bf0 FUN_009e9bf0 void FUN_009e9bf0(void) { undefined1 local_18 [4]; undefined1 local_14 [4]; undefined1 local_10 [12]; std::set::insert(local_10,local_18); std::set::insert(local_10,local_14); return; } //@@ 009e9c40 Seeds::CanAddSeedEffect /* ZHL [lua] Lua binding Seeds:CanAddSeedEffect */ undefined1 Seeds::CanAddSeedEffect(uint param_1) { int *piVar1; undefined4 *puVar2; void *pvVar3; byte bVar4; Seeds *in_ECX; undefined1 local_21; undefined4 *local_20; void *local_1c [2]; undefined1 local_14 [8]; void *local_c; if ((0x4f < param_1) || (bVar4 = HasSeedEffect(in_ECX,param_1), bVar4 != 0)) { return 0; } std::set::set_copy((void *)((int)g_seedComboBans + param_1 * 8)); pvVar3 = local_1c[0]; puVar2 = in_ECX->_seedEffects; local_20 = (undefined4 *)*puVar2; do { if (local_20 == puVar2) { local_21 = 1; LAB_009e9ccd: FID_conflict__Erase_tree_>_> (local_1c,(fuzzer_allocator_> *)local_1c, *(_Tree_node **)((int)pvVar3 + 4)); operator_delete(local_1c[0],0x14); return local_21; } piVar1 = local_20 + 4; std::set::find_node(local_14,piVar1); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(int *)((int)local_c + 0x10) <= *piVar1)) && (local_c != pvVar3)) { local_21 = 0; goto LAB_009e9ccd; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_20); } while( true ); } //@@ 009e9d10 FUN_009e9d10 undefined4 FUN_009e9d10(void *param_1) { std_string seedString; int iVar1; undefined4 uVar2; char acStackY_a8 [128]; undefined1 in_stack_ffffffdc [16]; undefined4 in_stack_ffffffec; uint in_stack_fffffff0; std::string::string(acStackY_a8 + 0x84,param_1); seedString._size = in_stack_ffffffec; seedString._buf[0] = in_stack_ffffffdc[0]; seedString._buf[1] = in_stack_ffffffdc[1]; seedString._buf[2] = in_stack_ffffffdc[2]; seedString._buf[3] = in_stack_ffffffdc[3]; seedString._buf[4] = in_stack_ffffffdc[4]; seedString._buf[5] = in_stack_ffffffdc[5]; seedString._buf[6] = in_stack_ffffffdc[6]; seedString._buf[7] = in_stack_ffffffdc[7]; seedString._buf[8] = in_stack_ffffffdc[8]; seedString._buf[9] = in_stack_ffffffdc[9]; seedString._buf[10] = in_stack_ffffffdc[10]; seedString._buf[0xb] = in_stack_ffffffdc[0xb]; seedString._buf[0xc] = in_stack_ffffffdc[0xc]; seedString._buf[0xd] = in_stack_ffffffdc[0xd]; seedString._buf[0xe] = in_stack_ffffffdc[0xe]; seedString._buf[0xf] = in_stack_ffffffdc[0xf]; seedString._capacity = in_stack_fffffff0; iVar1 = Seeds::GetSeedEffect(seedString); if (iVar1 == 0) { return 0; } uVar2 = Seeds::CanAddSeedEffect(); return uVar2; } //@@ 009e9d50 Seeds::RemoveBlockingSeedEffects /* ZHL [lua] Lua binding Seeds:RemoveBlockingSeedEffects prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Seeds::RemoveBlockingSeedEffects(Seeds *this,int seedEffect) { int iVar1; int *piVar2; int local_8; if ((uint)seedEffect < 0x50) { iVar1 = seedEffect * 8; piVar2 = *(int **)(iVar1 + (int)g_seedComboBans); seedEffect = *piVar2; if ((int *)seedEffect != piVar2) { do { local_8 = *(int *)(seedEffect + 0x10); std_set_int_erase_key(&this->_seedEffects,&local_8); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&seedEffect); } while (seedEffect != *(int *)(iVar1 + (int)g_seedComboBans)); } } return; } //@@ 009e9db0 Seeds::GetSeedEffect /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Seeds:GetSeedEffect prototype: db/protos.zhl, confirmed by RET 0 */ int __cdecl Seeds::GetSeedEffect(std_string seedString) { uint uVar1; std_string *seedBuf; int *digestWord; void *ptr; int *knownWord; int seedEffect; bool isMoreWords; int seedDigest [5]; int knownDigests [12]; undefined *local_20; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; int local_8; puStack_c = &LAB_00b0fbcd; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(knownDigests + 0x13); ExceptionList = &local_10; local_8 = 0; local_14 = uVar1; if (seedString._size != 9) { if (seedString._size < 9) { std::string::append_n(seedString._buf,9 - seedString._size,0x20); } else { seedString._size = 9; seedBuf = &seedString; if (0xf < seedString._capacity) { seedBuf = (std_string *)seedString._buf._0_4_; } seedBuf->_buf[9] = '\0'; } } sha1_digest(seedString._size,uVar1); knownDigests[5] = 0x6c5a0c0e; knownDigests[6] = 0x1a0758c1; digestWord = seedDigest; knownDigests[7] = 0xf87d621; knownWord = knownDigests + 5; knownDigests[8] = 0x4341e0df; uVar1 = 0x10; knownDigests[9] = 0xb960dbc8; do { if (*digestWord != *knownWord) { knownDigests[5] = 0x3bf504ef; digestWord = seedDigest; knownDigests[6] = 0x1d7a8f74; knownWord = knownDigests + 5; knownDigests[7] = 0xe5f5926b; uVar1 = 0x10; knownDigests[8] = 0x81c59abe; knownDigests[9] = 0x1dd1207a; goto LAB_009e9eb0; } digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = 3 < uVar1; uVar1 = uVar1 - 4; } while (isMoreWords); seedEffect = 1; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009e9eb0: if (*digestWord != *knownWord) { knownDigests[5] = 0xc0978b6d; digestWord = seedDigest; knownDigests[6] = 0x1a161c38; knownWord = knownDigests + 5; knownDigests[7] = 0x928e1cfa; uVar1 = 0x10; knownDigests[8] = 0x5b6a6d2f; knownDigests[9] = 0xac98e081; goto LAB_009e9f00; } } seedEffect = 2; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009e9f00: if (*digestWord != *knownWord) { knownDigests[5] = 0x304506ba; digestWord = seedDigest; knownDigests[6] = 0x8b775f95; knownWord = knownDigests + 5; knownDigests[7] = 0x4e67cd3e; uVar1 = 0x10; knownDigests[8] = 0x9c06ae9f; knownDigests[9] = 0xe2de0fa8; goto LAB_009e9f50; } } seedEffect = 3; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009e9f50: if (*digestWord != *knownWord) { knownDigests[5] = 0x4fb26f55; digestWord = seedDigest; knownDigests[6] = 0xc5665e72; knownWord = knownDigests + 5; knownDigests[7] = 0x9a17007b; uVar1 = 0x10; knownDigests[8] = 0x87f1069f; knownDigests[9] = 0x31ff0348; goto LAB_009e9fa0; } } seedEffect = 4; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009e9fa0: if (*digestWord != *knownWord) { knownDigests[5] = 0x1cea905d; digestWord = seedDigest; knownDigests[6] = 0xb8ebca46; knownWord = knownDigests + 5; knownDigests[7] = 0xed4280f; uVar1 = 0x10; knownDigests[8] = 0x748ffb5; knownDigests[9] = 0x7ffb5b76; goto LAB_009e9ff0; } } seedEffect = 5; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009e9ff0: if (*digestWord != *knownWord) { knownDigests[5] = 0xd146f9aa; digestWord = seedDigest; knownDigests[6] = 0xa1e076ee; knownWord = knownDigests + 5; knownDigests[7] = 0xdff668ab; uVar1 = 0x10; knownDigests[8] = 0x913be3d0; knownDigests[9] = 0x2634e8b6; goto LAB_009ea040; } } seedEffect = 6; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea040: if (*digestWord != *knownWord) { knownDigests[5] = 0x3548c06e; digestWord = seedDigest; knownDigests[6] = 0xee4ee98a; knownWord = knownDigests + 5; knownDigests[7] = 0x5b3c9a46; uVar1 = 0x10; knownDigests[8] = 0x703e0a2f; knownDigests[9] = 0x699f69f9; goto LAB_009ea090; } } seedEffect = 7; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea090: if (*digestWord != *knownWord) { if (*(int *)&g_manager->_stringTable != 0) goto LAB_009ea19b; knownDigests[5] = 0xaf3f840; digestWord = seedDigest; knownDigests[6] = 0x7c7441af; knownWord = knownDigests + 5; knownDigests[7] = 0x65a9595; uVar1 = 0x10; knownDigests[8] = 0x5d8145b2; knownDigests[9] = 0x54a7f5cd; knownDigests[0] = -0x512ed42e; knownDigests[1] = 0x7fe6f84a; knownDigests[2] = 0x8b443c11; knownDigests[3] = 0x52cff77d; knownDigests[4] = 0xead4bf55; knownDigests[10] = 0xde3e4928; knownDigests[0xb] = 0x5a08d551; local_20 = (undefined *)0xb1b137c2; local_1c = 0x78d1be7; local_18 = 0x6ecf797b; goto LAB_009ea131; } } seedEffect = 8; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea131: if (*digestWord != *knownWord) { digestWord = seedDigest; uVar1 = 0x10; knownWord = knownDigests; goto LAB_009ea157; } } seedEffect = 9; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea157: if (*digestWord != *knownWord) { digestWord = seedDigest; uVar1 = 0x10; knownWord = knownDigests + 10; goto LAB_009ea180; } } seedEffect = 9; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea180: if (*digestWord != *knownWord) goto LAB_009ea19b; } seedEffect = 9; goto LAB_009eb531; LAB_009ea19b: knownDigests[10] = 0xcc45f85d; digestWord = seedDigest; knownDigests[0xb] = 0x4f57cb04; knownWord = knownDigests + 10; local_20 = (undefined *)0x66a64a12; uVar1 = 0x10; local_1c = 0x800e3620; local_18 = 0x1d593677; do { if (*digestWord != *knownWord) { knownDigests[10] = 0xa6c2493c; digestWord = seedDigest; knownDigests[0xb] = 0x63ad9432; knownWord = knownDigests + 10; local_20 = (undefined *)0x4148d831; uVar1 = 0x10; local_1c = 0xdf9f77b1; local_18 = 0xbf6647d1; goto LAB_009ea220; } digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = 3 < uVar1; uVar1 = uVar1 - 4; } while (isMoreWords); seedEffect = 10; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea220: if (*digestWord != *knownWord) { knownDigests[10] = 0x46f0455a; digestWord = seedDigest; knownDigests[0xb] = 0x114286f; knownWord = knownDigests + 10; local_20 = (undefined *)0x7aa1d92; uVar1 = 0x10; local_1c = 0x31795e51; local_18 = 0xc3a91557; goto LAB_009ea270; } } seedEffect = 0xb; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea270: if (*digestWord != *knownWord) { knownDigests[10] = 0xad0d4f17; digestWord = seedDigest; knownDigests[0xb] = 0xf205a756; knownWord = knownDigests + 10; local_20 = (undefined *)0xa6f15c1c; uVar1 = 0x10; local_1c = 0x54b52f56; local_18 = 0x16d783d6; goto LAB_009ea2c0; } } seedEffect = 0xc; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea2c0: if (*digestWord != *knownWord) { knownDigests[10] = 0xdaec4547; digestWord = seedDigest; knownDigests[0xb] = 0xfe35ccb5; knownWord = knownDigests + 10; local_20 = (undefined *)0xc1324934; uVar1 = 0x10; local_1c = 0xaf372679; local_18 = 0x453c2fff; goto LAB_009ea310; } } seedEffect = 0xd; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea310: if (*digestWord != *knownWord) { knownDigests[10] = 0x266a6130; digestWord = seedDigest; knownDigests[0xb] = 0xf524c959; knownWord = knownDigests + 10; local_20 = (undefined *)0x423fbe49; uVar1 = 0x10; local_1c = 0x46fa74bb; local_18 = 0x3039b5f; goto LAB_009ea360; } } seedEffect = 0xe; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea360: if (*digestWord != *knownWord) { knownDigests[10] = 0xaa5761ee; digestWord = seedDigest; knownDigests[0xb] = 0x30e25d1e; knownWord = knownDigests + 10; local_20 = (undefined *)0xe52653e1; uVar1 = 0x10; local_1c = 0xb8e93635; local_18 = 0x204c69a6; goto LAB_009ea3b0; } } seedEffect = 0xf; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea3b0: if (*digestWord != *knownWord) { knownDigests[10] = 0x82a66e1f; digestWord = seedDigest; knownDigests[0xb] = 0x2514691a; knownWord = knownDigests + 10; local_20 = (undefined *)0x24b4fe73; uVar1 = 0x10; local_1c = 0xf55350c4; local_18 = 0x59110ab8; goto LAB_009ea400; } } seedEffect = 0x10; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea400: if (*digestWord != *knownWord) { knownDigests[10] = 0x180b97e7; digestWord = seedDigest; knownDigests[0xb] = 0x4dc18b34; knownWord = knownDigests + 10; local_20 = (undefined *)0xcfbe0714; uVar1 = 0x10; local_1c = 0x99abc405; local_18 = 0xfee53d9a; goto LAB_009ea450; } } seedEffect = 0x11; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea450: if (*digestWord != *knownWord) { knownDigests[10] = 0x12daa358; digestWord = seedDigest; knownDigests[0xb] = 0x36200ae1; knownWord = knownDigests + 10; local_20 = (undefined *)0xdff06abf; uVar1 = 0x10; local_1c = 0x1dd5a8c4; local_18 = 0x869fb34a; goto LAB_009ea4a0; } } seedEffect = 0x12; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea4a0: if (*digestWord != *knownWord) { knownDigests[10] = 0x39f41b98; digestWord = seedDigest; knownDigests[0xb] = 0x29f9df57; knownWord = knownDigests + 10; local_20 = (undefined *)0x35180df6; uVar1 = 0x10; local_1c = 0x84c6c35e; local_18 = 0x3148da51; goto LAB_009ea4f0; } } seedEffect = 0x13; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea4f0: if (*digestWord != *knownWord) { knownDigests[10] = 0x6f178531; digestWord = seedDigest; knownDigests[0xb] = 0xaff12645; knownWord = knownDigests + 10; local_20 = (undefined *)0xcf29c82b; uVar1 = 0x10; local_1c = 0x56d5e983; local_18 = 0x3a27e93; goto LAB_009ea540; } } seedEffect = 0x15; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea540: if (*digestWord != *knownWord) { knownDigests[10] = 0x8eca9891; digestWord = seedDigest; knownDigests[0xb] = 0xae185aee; knownWord = knownDigests + 10; local_20 = (undefined *)0xfd206f66; uVar1 = 0x10; local_1c = 0x154b083f; local_18 = 0xd7880653; goto LAB_009ea590; } } seedEffect = 0x14; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea590: if (*digestWord != *knownWord) { knownDigests[10] = 0xc224e789; digestWord = seedDigest; knownDigests[0xb] = 0xc4e85fce; knownWord = knownDigests + 10; local_20 = (undefined *)0x22e2b855; uVar1 = 0x10; local_1c = 0xc6967e4b; local_18 = 0xc11440cb; goto LAB_009ea5e0; } } seedEffect = 0x17; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea5e0: if (*digestWord != *knownWord) { knownDigests[10] = 0x981bacd2; digestWord = seedDigest; knownDigests[0xb] = 0xbd5f3f1b; knownWord = knownDigests + 10; local_20 = (undefined *)0x25974766; uVar1 = 0x10; local_1c = 0xaa585fb6; local_18 = 0x89620e3b; knownDigests[0] = -0x1c9f381; knownDigests[1] = 0xab1e9a51; knownDigests[2] = 0xd6ca5ab6; knownDigests[3] = 0x1c274461; knownDigests[4] = 0xa5b3c0a5; goto LAB_009ea650; } } seedEffect = 0x18; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea650: if (*digestWord != *knownWord) { digestWord = seedDigest; uVar1 = 0x10; knownWord = knownDigests; goto LAB_009ea676; } } seedEffect = 0x19; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea676: if (*digestWord != *knownWord) { knownDigests[10] = 0x84264e8e; digestWord = seedDigest; knownDigests[0xb] = 0x8f8a9b0a; knownWord = knownDigests + 10; local_20 = (undefined *)0xb8be97f9; uVar1 = 0x10; local_1c = 0x692ccf85; local_18 = 0xb142e553; goto LAB_009ea6c0; } } seedEffect = 0x19; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea6c0: if (*digestWord != *knownWord) { knownDigests[10] = 0x21a39872; digestWord = seedDigest; knownDigests[0xb] = 0x354944eb; knownWord = knownDigests + 10; local_20 = (undefined *)0xd64ddd2; uVar1 = 0x10; local_1c = 0x974d3d0; local_18 = 0xe3257c75; goto LAB_009ea710; } } seedEffect = 0x1a; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea710: if (*digestWord != *knownWord) { knownDigests[10] = 0x9658587d; digestWord = seedDigest; knownDigests[0xb] = 0x680beb2e; knownWord = knownDigests + 10; local_20 = &DAT_00c17e9a; uVar1 = 0x10; local_1c = 0xe8391b1e; local_18 = 0x8a51b26b; goto LAB_009ea760; } } seedEffect = 0x1b; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea760: if (*digestWord != *knownWord) { knownDigests[10] = 0x3edf6f95; digestWord = seedDigest; knownDigests[0xb] = 0x9ecb1288; knownWord = knownDigests + 10; local_20 = (undefined *)0x36195541; uVar1 = 0x10; local_1c = 0x22b0c87e; local_18 = 0x41ad36e6; goto LAB_009ea7b0; } } seedEffect = 0x1c; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea7b0: if (*digestWord != *knownWord) { knownDigests[10] = 0x8bcac277; digestWord = seedDigest; knownDigests[0xb] = 0xd15bd5c2; knownWord = knownDigests + 10; local_20 = (undefined *)0x6effa0f5; uVar1 = 0x10; local_1c = 0x56a42aad; local_18 = 0xce198264; goto LAB_009ea800; } } seedEffect = 0x1d; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea800: if (*digestWord != *knownWord) { knownDigests[10] = 0xf03d08f4; digestWord = seedDigest; knownDigests[0xb] = 0x69227e8f; knownWord = knownDigests + 10; local_20 = (undefined *)0x48611079; uVar1 = 0x10; local_1c = 0xf0003e96; local_18 = 0x99ef74d2; goto LAB_009ea850; } } seedEffect = 0x1e; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea850: if (*digestWord != *knownWord) { knownDigests[10] = 0xecf04d14; digestWord = seedDigest; knownDigests[0xb] = 0xecde01d; knownWord = knownDigests + 10; local_20 = (undefined *)0x8c11e029; uVar1 = 0x10; local_1c = 0x6f44f055; local_18 = 0xac7088cb; knownDigests[0] = -0x21c388a2; knownDigests[1] = 0x543bcce9; knownDigests[2] = 0x94506ea0; knownDigests[3] = 0xcb6208c3; knownDigests[4] = 0xb5449e35; goto LAB_009ea8c0; } } seedEffect = 0x20; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea8c0: if (*digestWord != *knownWord) { digestWord = seedDigest; uVar1 = 0x10; knownWord = knownDigests; goto LAB_009ea8e6; } } seedEffect = 0x21; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea8e6: if (*digestWord != *knownWord) { knownDigests[10] = 0xf91813e9; digestWord = seedDigest; knownDigests[0xb] = 0xa7772c9; knownWord = knownDigests + 10; local_20 = (undefined *)0xe27b9d6b; uVar1 = 0x10; local_1c = 0xf7892976; local_18 = 0xe236a4a4; goto LAB_009ea930; } } seedEffect = 0x21; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea930: if (*digestWord != *knownWord) { knownDigests[10] = 0x4196cd99; digestWord = seedDigest; knownDigests[0xb] = 0x64f8044a; knownWord = knownDigests + 10; local_20 = (undefined *)0x3434a403; uVar1 = 0x10; local_1c = 0x1270209d; local_18 = 0x22ecf739; goto LAB_009ea980; } } seedEffect = 0x23; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea980: if (*digestWord != *knownWord) { knownDigests[10] = 0xe882c0fe; digestWord = seedDigest; knownDigests[0xb] = 0x8ac0f8d9; knownWord = knownDigests + 10; local_20 = (undefined *)0xbd5489c9; uVar1 = 0x10; local_1c = 0x7812cf03; local_18 = 0x71356391; goto LAB_009ea9d0; } } seedEffect = 0x24; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ea9d0: if (*digestWord != *knownWord) { knownDigests[10] = 0xcec7da35; digestWord = seedDigest; knownDigests[0xb] = 0x201aaa62; knownWord = knownDigests + 10; local_20 = (undefined *)0xb4a9f700; uVar1 = 0x10; local_1c = 0x4a432c0c; local_18 = 0x7ee62bc6; goto LAB_009eaa20; } } seedEffect = 0x25; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaa20: if (*digestWord != *knownWord) { knownDigests[10] = 0xaa095acf; digestWord = seedDigest; knownDigests[0xb] = 0xe4a74c20; knownWord = knownDigests + 10; local_20 = (undefined *)0x10ab775a; uVar1 = 0x10; local_1c = 0x1907b856; local_18 = 0x80687a48; goto LAB_009eaa70; } } seedEffect = 0x26; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaa70: if (*digestWord != *knownWord) { knownDigests[10] = 0xf70117d7; digestWord = seedDigest; knownDigests[0xb] = 0x22517083; knownWord = knownDigests + 10; local_20 = (undefined *)0xca73c522; uVar1 = 0x10; local_1c = 0x1bd84277; local_18 = 0xfce7e3f9; goto LAB_009eaac0; } } seedEffect = 0x29; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaac0: if (*digestWord != *knownWord) { knownDigests[10] = 0x2c504325; digestWord = seedDigest; knownDigests[0xb] = 0x973cc813; knownWord = knownDigests + 10; local_20 = (undefined *)0xbe13f93; uVar1 = 0x10; local_1c = 0xd1852583; local_18 = 0x3c3b24b9; goto LAB_009eab10; } } seedEffect = 0x2a; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eab10: if (*digestWord != *knownWord) { knownDigests[10] = 0xf9a7e518; digestWord = seedDigest; knownDigests[0xb] = 0xa2c99815; knownWord = knownDigests + 10; local_20 = (undefined *)0x96ff583f; uVar1 = 0x10; local_1c = 0x44d29781; local_18 = 0x1659d867; goto LAB_009eab60; } } seedEffect = 0x2b; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eab60: if (*digestWord != *knownWord) { knownDigests[10] = 0x599c51f1; digestWord = seedDigest; knownDigests[0xb] = 0xf66d16a3; knownWord = knownDigests + 10; local_20 = (undefined *)0x3445635f; uVar1 = 0x10; local_1c = 0x931521c2; local_18 = 0x60887148; goto LAB_009eabb0; } } seedEffect = 0x2c; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eabb0: if (*digestWord != *knownWord) { knownDigests[10] = 0x2e0dd9cb; digestWord = seedDigest; knownDigests[0xb] = 0x996c914e; knownWord = knownDigests + 10; local_20 = (undefined *)0x871fb6d8; uVar1 = 0x10; local_1c = 0x22bedbd8; local_18 = 0xb5c604f2; goto LAB_009eac00; } } seedEffect = 0x2e; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eac00: if (*digestWord != *knownWord) { knownDigests[10] = 0xaef79928; digestWord = seedDigest; knownDigests[0xb] = 0xe73ce84c; knownWord = knownDigests + 10; local_20 = (undefined *)0xa0deee95; uVar1 = 0x10; local_1c = 0xf8838a16; local_18 = 0xe5ceac7e; goto LAB_009eac50; } } seedEffect = 0x2f; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eac50: if (*digestWord != *knownWord) { knownDigests[10] = 0xe6ec1b40; digestWord = seedDigest; knownDigests[0xb] = 0x242dc317; knownWord = knownDigests + 10; local_20 = (undefined *)0xeaf3e29e; uVar1 = 0x10; local_1c = 0x29a24bc7; local_18 = 0x9b2c3239; goto LAB_009eaca0; } } seedEffect = 0x30; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaca0: if (*digestWord != *knownWord) { knownDigests[10] = 0xc0707c9b; digestWord = seedDigest; knownDigests[0xb] = 0x3d97fc0c; knownWord = knownDigests + 10; local_20 = (undefined *)0x78389ea3; uVar1 = 0x10; local_1c = 0x7db053a6; local_18 = 0xe34b8aab; knownDigests[0] = -0x62041f9a; knownDigests[1] = 0xf76d02bb; knownDigests[2] = 0xc573d1f2; knownDigests[3] = 0x97de624e; knownDigests[4] = 0x1e81877e; goto LAB_009ead10; } } seedEffect = 0x35; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ead10: if (*digestWord != *knownWord) { digestWord = seedDigest; uVar1 = 0x10; knownWord = knownDigests; goto LAB_009ead40; } } seedEffect = 0x36; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ead40: if (*digestWord != *knownWord) { knownDigests[10] = 0xc08e6930; digestWord = seedDigest; knownDigests[0xb] = 0x80cdd12c; knownWord = knownDigests + 10; local_20 = (undefined *)0xeb758cee; uVar1 = 0x10; local_1c = 0x927977cb; local_18 = 0x111abbc9; goto LAB_009ead90; } } seedEffect = 0x36; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009ead90: if (*digestWord != *knownWord) { knownDigests[10] = 0x220a7ee4; digestWord = seedDigest; knownDigests[0xb] = 0xe964d085; knownWord = knownDigests + 10; local_20 = (undefined *)0x22376a38; uVar1 = 0x10; local_1c = 0xfc1df130; local_18 = 0x2179b945; goto LAB_009eade0; } } seedEffect = 0x37; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eade0: if (*digestWord != *knownWord) { knownDigests[10] = 0x4ac7df82; digestWord = seedDigest; knownDigests[0xb] = 0xb747e6e3; knownWord = knownDigests + 10; local_20 = (undefined *)0x35749d6a; uVar1 = 0x10; local_1c = 0x36dc4df0; local_18 = 0x8e59b190; goto LAB_009eae30; } } seedEffect = 0x34; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eae30: if (*digestWord != *knownWord) { knownDigests[10] = 0xafe55c97; digestWord = seedDigest; knownDigests[0xb] = 0x7fd1b37d; knownWord = knownDigests + 10; local_20 = (undefined *)0x97cbbd26; uVar1 = 0x10; local_1c = 0xfc68c3ba; local_18 = 0xec247758; goto LAB_009eae80; } } seedEffect = 0x38; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eae80: if (*digestWord != *knownWord) { knownDigests[10] = 0x1adbea69; digestWord = seedDigest; knownDigests[0xb] = 0x6ae0833e; knownWord = knownDigests + 10; local_20 = (undefined *)0xb255770c; uVar1 = 0x10; local_1c = 0xf6b0e556; local_18 = 0x48bd8a35; goto LAB_009eaed0; } } seedEffect = 0x39; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaed0: if (*digestWord != *knownWord) { knownDigests[10] = 0x5fcca255; digestWord = seedDigest; knownDigests[0xb] = 0xf1b3aee7; knownWord = knownDigests + 10; local_20 = (undefined *)0x94f755c7; uVar1 = 0x10; local_1c = 0x8350b8a4; local_18 = 0x7afab16e; goto LAB_009eaf20; } } seedEffect = 0x3a; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaf20: if (*digestWord != *knownWord) { knownDigests[10] = 0xef7f8d5a; digestWord = seedDigest; knownDigests[0xb] = 0x560f9541; knownWord = knownDigests + 10; local_20 = (undefined *)0x968346fc; uVar1 = 0x10; local_1c = 0xb2e73f86; local_18 = 0x4491efce; goto LAB_009eaf70; } } seedEffect = 0x3b; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eaf70: if (*digestWord != *knownWord) { knownDigests[10] = 0xcaca8ad1; digestWord = seedDigest; knownDigests[0xb] = 0xf707ea0; knownWord = knownDigests + 10; local_20 = (undefined *)0x6175fa4; uVar1 = 0x10; local_1c = 0x11f9995a; local_18 = 0xf88db202; goto LAB_009eafc0; } } seedEffect = 0x3c; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eafc0: if (*digestWord != *knownWord) { knownDigests[10] = 0xf175008f; digestWord = seedDigest; knownDigests[0xb] = 0x1237581f; knownWord = knownDigests + 10; local_20 = (undefined *)0xd058b62f; uVar1 = 0x10; local_1c = 0x8f7d34d8; local_18 = 0xf3f037cd; goto LAB_009eb010; } } seedEffect = 0x3d; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb010: if (*digestWord != *knownWord) { knownDigests[10] = 0x8e0037f9; digestWord = seedDigest; knownDigests[0xb] = 0xa1669bfc; knownWord = knownDigests + 10; local_20 = (undefined *)0x6fa5dd21; uVar1 = 0x10; local_1c = 0xe778f3cb; local_18 = 0x711455a3; goto LAB_009eb060; } } seedEffect = 0x3e; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb060: if (*digestWord != *knownWord) { knownDigests[10] = 0xad54e77c; digestWord = seedDigest; knownDigests[0xb] = 0x6a2a6b36; knownWord = knownDigests + 10; local_20 = (undefined *)0xb797cf31; uVar1 = 0x10; local_1c = 0x501d7191; local_18 = 0x80b3a955; goto LAB_009eb0b0; } } seedEffect = 0x3f; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb0b0: if (*digestWord != *knownWord) { knownDigests[10] = 0x41e2bd6f; digestWord = seedDigest; knownDigests[0xb] = 0xf12943ef; knownWord = knownDigests + 10; local_20 = (undefined *)0x54ec4ab6; uVar1 = 0x10; local_1c = 0x565fb4a0; local_18 = 0x345681a0; goto LAB_009eb100; } } seedEffect = 0x40; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb100: if (*digestWord != *knownWord) { knownDigests[10] = 0xa863b211; digestWord = seedDigest; knownDigests[0xb] = 0x6e2c9147; knownWord = knownDigests + 10; local_20 = (undefined *)0xae5f6508; uVar1 = 0x10; local_1c = 0x114eb299; local_18 = 0x62d320f5; goto LAB_009eb150; } } seedEffect = 0x41; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb150: if (*digestWord != *knownWord) { knownDigests[10] = 0xf3fd3d89; digestWord = seedDigest; knownDigests[0xb] = 0xcca14a44; knownWord = knownDigests + 10; local_20 = (undefined *)0xebedc510; uVar1 = 0x10; local_1c = 0x69bb00df; local_18 = 0x8801f545; goto LAB_009eb1a0; } } seedEffect = 0x42; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb1a0: if (*digestWord != *knownWord) { knownDigests[10] = 0xa10fa13a; digestWord = seedDigest; knownDigests[0xb] = 0xb1d8e004; knownWord = knownDigests + 10; local_20 = (undefined *)0x81b93223; uVar1 = 0x10; local_1c = 0xa3bacc39; local_18 = 0xb46793fc; goto LAB_009eb1f0; } } seedEffect = 0x44; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb1f0: if (*digestWord != *knownWord) { knownDigests[10] = 0x5d1c4c85; digestWord = seedDigest; knownDigests[0xb] = 0x5902de6f; knownWord = knownDigests + 10; local_20 = (undefined *)0xac1156a1; uVar1 = 0x10; local_1c = 0xc97868b4; local_18 = 0xb518c1d3; goto LAB_009eb240; } } seedEffect = 0x43; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb240: if (*digestWord != *knownWord) { knownDigests[10] = 0x7b845138; digestWord = seedDigest; knownDigests[0xb] = 0xcde29161; knownWord = knownDigests + 10; local_20 = (undefined *)0x1c040239; uVar1 = 0x10; local_1c = 0x431b940c; local_18 = 0xa255148c; goto LAB_009eb290; } } seedEffect = 0x46; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb290: if (*digestWord != *knownWord) { knownDigests[10] = 0xc37f47b7; digestWord = seedDigest; knownDigests[0xb] = 0x82d7cc03; knownWord = knownDigests + 10; local_20 = (undefined *)0x4c8b417e; uVar1 = 0x10; local_1c = 0xf5d6b4f8; local_18 = 0xebf23f83; goto LAB_009eb2e0; } } seedEffect = 0x47; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb2e0: if (*digestWord != *knownWord) { knownDigests[10] = 0x31a7e167; digestWord = seedDigest; knownDigests[0xb] = 0x24906665; knownWord = knownDigests + 10; local_20 = (undefined *)0x1a346f28; uVar1 = 0x10; local_1c = 0xffc5ee52; local_18 = 0x8719c7a7; goto LAB_009eb330; } } seedEffect = 0x48; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb330: if (*digestWord != *knownWord) { knownDigests[10] = 0xab552bd3; digestWord = seedDigest; knownDigests[0xb] = 0x4742222c; knownWord = knownDigests + 10; local_20 = (undefined *)0xa0f0e6cf; uVar1 = 0x10; local_1c = 0x4b15bb5; local_18 = 0xdb833c02; goto LAB_009eb380; } } seedEffect = 0x49; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb380: if (*digestWord != *knownWord) { knownDigests[10] = 0xd6da8026; digestWord = seedDigest; knownDigests[0xb] = 0xb29cb3a3; knownWord = knownDigests + 10; local_20 = (undefined *)0x8599bd3d; uVar1 = 0x10; local_1c = 0x464a415; local_18 = 0xf079460c; goto LAB_009eb3d0; } } seedEffect = 0x4a; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb3d0: if (*digestWord != *knownWord) { knownDigests[10] = 0x7f104aac; digestWord = seedDigest; knownDigests[0xb] = 0x4c5dd52; knownWord = knownDigests + 10; local_20 = (undefined *)0x886c422c; uVar1 = 0x10; local_1c = 0x36b8e0e9; local_18 = 0x8574715f; goto LAB_009eb420; } } seedEffect = 0x4b; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb420: if (*digestWord != *knownWord) { knownDigests[10] = 0xf5145c3f; digestWord = seedDigest; knownDigests[0xb] = 0xa7abbaaf; knownWord = knownDigests + 10; local_20 = (undefined *)0xf8912d2f; uVar1 = 0x10; local_1c = 0x71fab149; local_18 = 0x33f872cb; goto LAB_009eb470; } } seedEffect = 0x4c; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb470: if (*digestWord != *knownWord) { knownDigests[10] = 0x764f0aa9; digestWord = seedDigest; knownDigests[0xb] = 0x76171ea9; knownWord = knownDigests + 10; local_20 = (undefined *)0x1eca41a3; uVar1 = 0x10; local_1c = 0xf38a621f; local_18 = 0xb2387e17; goto LAB_009eb4c0; } } seedEffect = 0x4d; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb4c0: if (*digestWord != *knownWord) { knownDigests[10] = 0xaa42d2ad; digestWord = seedDigest; knownDigests[0xb] = 0xc7a73da7; knownWord = knownDigests + 10; local_20 = (undefined *)0xcb0913e7; uVar1 = 0x10; local_1c = 0x41df263; local_18 = 0x306ba234; goto LAB_009eb510; } } seedEffect = 0x4e; goto LAB_009eb531; while( true ) { digestWord = digestWord + 1; knownWord = knownWord + 1; isMoreWords = uVar1 < 4; uVar1 = uVar1 - 4; if (isMoreWords) break; LAB_009eb510: if (*digestWord != *knownWord) { seedEffect = 0; goto LAB_009eb531; } } seedEffect = 0x4f; LAB_009eb531: if (0xf < seedString._capacity) { uVar1 = seedString._capacity + 1; ptr = (void *)seedString._buf._0_4_; if (0xfff < uVar1) { ptr = *(void **)(seedString._buf._0_4_ + -4); uVar1 = seedString._capacity + 0x24; if (0x1f < (seedString._buf._0_4_ - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar1); } ExceptionList = local_10; return seedEffect; } //@@ 009eb590 Seeds::IsStringValidSeed /* ZHL [lua] Lua binding Seeds:IsStringValidSeed */ bool Seeds::IsStringValidSeed(std_string *param_1) { uint uVar1; uVar1 = String2Seed(param_1); return uVar1 != 0; } //@@ 009eb5b0 Seeds::Seed2String /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [lua] Lua binding Seeds:Seed2String prototype: db/protos.zhl, confirmed by RET 0 */ std_string * __cdecl Seeds::Seed2String(std_string *outStr,uint seed) { uint uVar1; std_string *psVar2; uint uVar3; byte bVar4; char cVar5; byte local_10 [4]; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10 + 0xc); bVar4 = 0; for (uVar3 = seed; uVar3 != 0; uVar3 = uVar3 >> 5) { cVar5 = bVar4 + (char)uVar3; bVar4 = cVar5 * '\x02' - (cVar5 >> 7); } uVar3 = seed ^ 0xfef7ffd; outStr->_buf[0] = '\0'; outStr->_buf[1] = '\0'; outStr->_buf[2] = '\0'; outStr->_buf[3] = '\0'; outStr->_size = 0; outStr->_capacity = 0xf; local_10[0] = (byte)(uVar3 >> 0x1b); local_10[1] = (byte)(uVar3 >> 0x16) & 0x1f; outStr->_buf[0] = '\0'; local_10[2] = (byte)(uVar3 >> 0x11) & 0x1f; outStr->_size = 9; local_10[3] = (byte)(uVar3 >> 0xc) & 0x1f; local_c._0_2_ = CONCAT11((char)(uVar3 >> 2),(char)(uVar3 >> 7)) & 0x1f1f; local_c._0_3_ = (uint3)(ushort)local_c; local_c = CONCAT13(bVar4,(uint3)local_c) & 0x1fffffff; local_c = CONCAT13(local_c._3_1_,CONCAT12((char)((uVar3 << 8 | (uint)bVar4) >> 5),(ushort)local_c) ) & 0xff1fffff; memmove(outStr,"0000 0000",9); outStr->_buf[9] = '\0'; uVar3 = 0; do { if (uVar3 != 4) { uVar1 = uVar3 - 1; if (uVar3 < 5) { uVar1 = uVar3; } psVar2 = outStr; if (0xf < outStr->_capacity) { psVar2 = *(std_string **)outStr->_buf; } psVar2->_buf[uVar3] = "ABCDEFGHJKLMNPQRSTWXYZ01234V6789"[local_10[uVar1]]; } uVar3 = uVar3 + 1; } while (uVar3 < 9); return outStr; } //@@ 009eb6b0 Seeds::String2Seed /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static int Seeds::String2Seed(std_string *str); prototype: db/protos.zhl, confirmed by RET 0 */ uint __cdecl Seeds::String2Seed(std_string *str) { std_string *psVar1; char cVar2; byte bVar3; uint uVar4; uint uVar5; uint uVar6; byte local_110 [256]; byte local_10 [4]; byte local_c; byte local_b; byte local_a; byte local_9; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10 + 0xc); if (str->_size == 9) { uVar6 = str->_capacity; psVar1 = str; if (0xf < uVar6) { psVar1 = *(std_string **)str->_buf; } if (psVar1->_buf[4] == ' ') { memset(local_110,0xff,0x100); uVar4 = 0; do { local_110["ABCDEFGHJKLMNPQRSTWXYZ01234V6789"[uVar4]] = (byte)uVar4; uVar4 = uVar4 + 1; } while (uVar4 < 0x20); uVar4 = 0; do { if (uVar4 != 4) { uVar5 = uVar4 - 1; if (uVar4 < 5) { uVar5 = uVar4; } psVar1 = str; if (0xf < uVar6) { psVar1 = *(std_string **)str->_buf; } bVar3 = local_110[psVar1->_buf[uVar4]]; local_10[uVar5] = bVar3; if (bVar3 == 0xff) { return 0; } } uVar4 = uVar4 + 1; } while (uVar4 < 9); bVar3 = 0; uVar4 = (((((((uint)local_10[0] << 5 | (uint)local_10[1]) << 5 | (uint)local_10[2]) << 5 | (uint)local_10[3]) << 5 | (uint)local_c) << 5 | (uint)local_b) << 2 | (uint)(local_a >> 3)) ^ 0xfef7ffd; for (uVar6 = uVar4; uVar6 != 0; uVar6 = uVar6 >> 5) { cVar2 = bVar3 + (char)uVar6; bVar3 = cVar2 * '\x02' - (cVar2 >> 7); } if (bVar3 == (byte)(local_a << 5 | local_9)) { return uVar4; } } } return 0; } //@@ 009eb7f0 Seeds::SetStartSeed /* ZHL [lua] Lua binding Seeds:SetStartSeed prototype: db/protos.zhl, confirmed by RET 24 */ void __thiscall Seeds::SetStartSeed(Seeds *this,std_string seed) { uint uVar1; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0563d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = String2Seed(&seed); set_start_seed(this,uVar1); if (0xf < seed._capacity) { uVar1 = seed._capacity + 1; ptr = (void *)seed._buf._0_4_; if (0xfff < uVar1) { ptr = *(void **)(seed._buf._0_4_ + -4); uVar1 = seed._capacity + 0x24; if (0x1f < (seed._buf._0_4_ - (int)ptr) - 4U) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar1); } ExceptionList = local_10; return; } //@@ 009eb880 Seeds::set_start_seed /* ZHL [exact] __thiscall void Seeds::set_start_seed(unsigned int seed); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Seeds::set_start_seed(Seeds *this,uint seed) { code *pcVar1; uint uVar2; int iVar3; int *piVar4; this->_gameStartSeed = seed; if (seed == 0) { uVar2 = Random(); seed = 1; if (1 < uVar2) { seed = uVar2; } this->_gameStartSeed = seed; } piVar4 = this->_stageSeeds; iVar3 = 0xe; (this->_rng)._shift1 = 3; (this->_rng)._shift2 = 0x17; (this->_rng)._seed = seed; (this->_rng)._shift3 = 0x19; do { uVar2 = (this->_rng)._seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_rng)._seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar2; (this->_rng)._seed = uVar2; *piVar4 = uVar2; piVar4 = piVar4 + 1; iVar3 = iVar3 + -1; } while (iVar3 != 0); uVar2 = (this->_rng)._seed; if (uVar2 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); uVar2 = (this->_rng)._seed; if (uVar2 == 0) { pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } uVar2 = uVar2 >> ((byte)(this->_rng)._shift1 & 0x1f) ^ uVar2; uVar2 = uVar2 << ((byte)(this->_rng)._shift2 & 0x1f) ^ uVar2; uVar2 = uVar2 >> ((byte)(this->_rng)._shift3 & 0x1f) ^ uVar2; (this->_rng)._seed = uVar2; this->_playerInitSeed = uVar2; return; } //@@ 009eb950 Seeds::Restart /* ZHL [lua] Lua binding Seeds:Restart */ void Seeds::Restart(int param_1) { Seeds *in_ECX; if ((in_ECX->_isCustomRun == 0) || (param_1 != 0)) { set_start_seed(in_ECX,0); return; } set_start_seed(in_ECX,in_ECX->_gameStartSeed); return; } //@@ 009eb980 Seeds::ForgetStageSeed /* ZHL [lua] Lua binding Seeds:ForgetStageSeed prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Seeds::ForgetStageSeed(Seeds *this,int levelStage) { code *pcVar1; uint uVar2; uint uVar3; uVar3 = -(uint)(levelStage != 0) & levelStage; uVar2 = 0xd; if (uVar3 < 0xd) { uVar2 = uVar3; } uVar3 = this->_stageSeeds[uVar2]; if (uVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"RNG Seed is zero!\n"); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar3 = uVar3 >> 5 ^ uVar3; uVar3 = uVar3 << 0xf ^ uVar3; this->_stageSeeds[uVar2] = uVar3 >> 0x11 ^ uVar3; return; } //@@ 009eba00 FUN_009eba00 undefined4 FUN_009eba00(void *param_1) { std_string seedString; int seedEffect; Seeds *in_ECX; char acStackY_a8 [128]; undefined1 in_stack_ffffffdc [16]; undefined4 in_stack_ffffffec; uint in_stack_fffffff0; std::string::string(acStackY_a8 + 0x84,param_1); seedString._size = in_stack_ffffffec; seedString._buf[0] = in_stack_ffffffdc[0]; seedString._buf[1] = in_stack_ffffffdc[1]; seedString._buf[2] = in_stack_ffffffdc[2]; seedString._buf[3] = in_stack_ffffffdc[3]; seedString._buf[4] = in_stack_ffffffdc[4]; seedString._buf[5] = in_stack_ffffffdc[5]; seedString._buf[6] = in_stack_ffffffdc[6]; seedString._buf[7] = in_stack_ffffffdc[7]; seedString._buf[8] = in_stack_ffffffdc[8]; seedString._buf[9] = in_stack_ffffffdc[9]; seedString._buf[10] = in_stack_ffffffdc[10]; seedString._buf[0xb] = in_stack_ffffffdc[0xb]; seedString._buf[0xc] = in_stack_ffffffdc[0xc]; seedString._buf[0xd] = in_stack_ffffffdc[0xd]; seedString._buf[0xe] = in_stack_ffffffdc[0xe]; seedString._buf[0xf] = in_stack_ffffffdc[0xf]; seedString._capacity = in_stack_fffffff0; seedEffect = Seeds::GetSeedEffect(seedString); if (seedEffect == 0) { return 0; } Seeds::AddSeedEffect(in_ECX,seedEffect); return 1; } //@@ 009eba40 FUN_009eba40 void FUN_009eba40(void *param_1) { std_string seedString; int in_ECX; char acStackY_a8 [128]; undefined1 in_stack_ffffffdc [16]; undefined4 in_stack_ffffffec; uint in_stack_fffffff0; std::string::string(acStackY_a8 + 0x84,param_1); seedString._size = in_stack_ffffffec; seedString._buf[0] = in_stack_ffffffdc[0]; seedString._buf[1] = in_stack_ffffffdc[1]; seedString._buf[2] = in_stack_ffffffdc[2]; seedString._buf[3] = in_stack_ffffffdc[3]; seedString._buf[4] = in_stack_ffffffdc[4]; seedString._buf[5] = in_stack_ffffffdc[5]; seedString._buf[6] = in_stack_ffffffdc[6]; seedString._buf[7] = in_stack_ffffffdc[7]; seedString._buf[8] = in_stack_ffffffdc[8]; seedString._buf[9] = in_stack_ffffffdc[9]; seedString._buf[10] = in_stack_ffffffdc[10]; seedString._buf[0xb] = in_stack_ffffffdc[0xb]; seedString._buf[0xc] = in_stack_ffffffdc[0xc]; seedString._buf[0xd] = in_stack_ffffffdc[0xd]; seedString._buf[0xe] = in_stack_ffffffdc[0xe]; seedString._buf[0xf] = in_stack_ffffffdc[0xf]; seedString._capacity = in_stack_fffffff0; param_1 = (void *)Seeds::GetSeedEffect(seedString); if (param_1 != (void *)0x0) { std_set_int_erase_key((void *)(in_ECX + 0x54),(int *)¶m_1); } return; } //@@ 009eba80 std::set::set_copy /* DB: copy ctor: empty head node (0x14, isnil 0x101) then std_set_uint_copy(src); Seeds::CanAddSeedEffect copies the conflict set g_seedComboBans[effect] */ void std::set::set_copy(void *param_1) { void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fc0d; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; pvVar1 = operator_new(0x14); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *in_ECX = pvVar1; local_8 = 0; std_set_uint_copy(in_ECX,param_1,(int)param_1); ExceptionList = local_10; return; } //@@ 009ebb00 FUN_009ebb00 void FUN_009ebb00(void) { FUN_009ebbf0(); return; } //@@ 009ebb20 std::set::insert_c798d0 /* DB: ? std::set::insert specialised to the global set at DAT_00c798d0 (ECX unused): find_node, inserts a 0x14 node when absent, returns {iter,bool}; Seeds::InitSeedInfo inserts seed effects 11,13,16..21,24,25,32,33,38,55,57.. into it */ void std::set::insert_c798d0(int *param_1,int *param_2) { undefined8 uVar1; undefined4 uVar2; uint uVar3; undefined8 *puVar4; undefined4 *newNode; void *pvVar5; undefined1 uVar6; void *local_28; int iStack_24; undefined1 local_1c [4]; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fc3d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined8 *)find_node(local_1c,param_2); uVar2 = DAT_00c798d0; pvVar5 = *(void **)(puVar4 + 1); uVar1 = *puVar4; if ((*(char *)((int)pvVar5 + 0xd) == '\0') && (*(int *)((int)pvVar5 + 0x10) <= *param_2)) { uVar6 = 0; } else { if (DAT_00c798d4 == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } local_18 = &DAT_00c798d0; local_8 = 0; local_14 = 0; newNode = operator_new(0x14); newNode[4] = *param_2; iStack_24 = (int)((ulonglong)uVar1 >> 0x20); *newNode = uVar2; local_28 = (void *)uVar1; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; pvVar5 = _Tree::_Insert_node(&DAT_00c798d0,local_28,iStack_24,newNode); uVar6 = 1; } *param_1 = (int)pvVar5; *(undefined1 *)(param_1 + 1) = uVar6; ExceptionList = local_10; return; } //@@ 009ebbf0 FUN_009ebbf0 void FUN_009ebbf0(void) { int *in_ECX; int *in_EDX; for (; in_ECX != in_EDX; in_ECX = in_ECX + 2) { FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x14); } return; } //@@ 009ebc30 std::_Uninitialized_value_construct_n> /* DB: (dest, n): constructs n empty std::set (0x14-byte head node, isnil 0x101) and returns the end; Seeds::InitSeedInfo and 009ebdc0 std::vector>::_Resize_reallocate the 0x50 seed-conflict table */ undefined4 * std::_Uninitialized_value_construct_n>(undefined4 *param_1,int param_2) { void **ppvVar1; uint uVar2; void *pvVar3; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0fc6d; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_2 != 0; param_2 = param_2 + -1) { *param_1 = 0; param_1[1] = 0; pvVar3 = operator_new(0x14); *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; *(undefined2 *)((int)pvVar3 + 0xc) = 0x101; *param_1 = pvVar3; param_1 = param_1 + 2; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_009ebbf0(in_ECX,uVar2); ExceptionList = local_10; return param_1; } //@@ 009ebce0 std::set::insert_range /* DB: thiscall set (first, last int*): for each int, _Find_lower_bound (FUN_009ebfd0) and if absent allocates a 0x14 node and std::_Tree::_Insert_node ("max size" check 0xccccccc); Seeds::InitSeedInfo builds sets from int arrays */ void std::set::insert_range(undefined4 *param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; void **ppvVar3; uint uVar4; undefined8 *puVar5; undefined4 *newNode; undefined4 *in_ECX; undefined1 local_30 [12]; undefined8 local_24; undefined4 local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fc9d; uVar4 = __security_cookie ^ (uint)(local_30 + 0x2c); uVar1 = *in_ECX; ppvVar3 = &local_10; local_10 = ExceptionList; do { ExceptionList = ppvVar3; if (param_1 == param_2) { ExceptionList = local_10; return; } puVar5 = (undefined8 *)_Find_hint(local_30,uVar1,param_1); local_24 = *puVar5; local_1c = *(undefined4 *)(puVar5 + 1); if ((char)local_1c == '\0') { if (in_ECX[1] == 0xccccccc) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } uVar2 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x14); local_8 = 0xffffffff; local_14 = 0; newNode[4] = *param_1; *newNode = uVar2; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; _Tree::_Insert_node(in_ECX,(void *)local_24,local_24._4_4_,newNode); } param_1 = param_1 + 1; ppvVar3 = ExceptionList; } while( true ); } //@@ 009ebdc0 std::vector>::_Resize_reallocate /* DB: specialised to the global vector g_seedComboBans..cc of 8-byte std::set (one per seed effect): grows to 0x50 elements, value-constructs the tail (009ebc30), copies the old sets (std_set_uint_copy), destroys/frees the old buffer; Seeds::InitSeedInfo sizes the seed-effect conflict table to 80 */ void std::vector>::_Resize_reallocate(undefined4 param_1,undefined1 *param_2) { undefined4 *copyTag; undefined4 *puVar1; void *pvVar2; uint uVar3; undefined4 extraout_ECX; undefined4 uVar4; undefined4 extraout_ECX_00; uint size; int iVar5; undefined4 *this; undefined4 *other; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fcd5; local_10 = ExceptionList; ExceptionList = &local_10; uVar3 = (int)DAT_00c798cc - (int)g_seedComboBans >> 3; iVar5 = (int)DAT_00c798c8 - (int)g_seedComboBans >> 3; if (0x1fffffff - (uVar3 >> 1) < uVar3) { uVar3 = 0x1fffffff; } else { uVar3 = (uVar3 >> 1) + uVar3; if (uVar3 < 0x50) { uVar3 = 0x50; } else if (0x1fffffff < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar1 = _Allocate(uVar3 * 8); local_8 = 0; _Uninitialized_value_construct_n>(puVar1 + iVar5 * 2,0x50 - iVar5,*param_2); copyTag = DAT_00c798c8; uVar4 = extraout_ECX; this = puVar1; for (other = g_seedComboBans; local_8._0_1_ = 1, other != copyTag; other = other + 2) { *this = 0; this[1] = 0; pvVar2 = operator_new(0x14); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; *this = pvVar2; local_8._0_1_ = 2; std_set_uint_copy(this,other,(int)copyTag); this = this + 2; uVar4 = extraout_ECX_00; } FUN_009ebbf0(uVar4); if (g_seedComboBans != (void *)0x0) { FUN_009ebbf0(g_seedComboBans); size = (int)DAT_00c798cc - (int)g_seedComboBans & 0xfffffff8; pvVar2 = g_seedComboBans; if (0xfff < size) { pvVar2 = *(void **)((int)g_seedComboBans + -4); size = size + 0x23; if (0x1f < (uint)((int)g_seedComboBans + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } g_seedComboBans = puVar1; DAT_00c798c8 = puVar1 + 0xa0; DAT_00c798cc = puVar1 + uVar3 * 2; ExceptionList = local_10; return; } //@@ 009ebf8f Catch_All@009ebf8f void Catch_All_009ebf8f(void) { int unaff_EBP; FUN_009ebb00(*(undefined4 *)(unaff_EBP + -0x20),*(undefined4 *)(unaff_EBP + -0x1c)); deallocate(*(void **)(unaff_EBP + -0x18),*(uint *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009ebfc0 FUN_009ebfc0 void FUN_009ebfc0(void) { FUN_009ebbf0(); return; } //@@ 009ebfd0 std::set::_Find_hint /* DB: hinted-insert position search: compares key with hint node +0x10 and its neighbours (iterator ++/--), returns {node, child side, found}; caller std::set::insert_range */ void std::set::_Find_hint(int *param_1,int *param_2,int *param_3) { char cVar1; int iVar2; int *piVar3; _Tree_unchecked_const_iterator_>,struct_std::_Iterator_base0> *p_Var4; undefined4 *in_ECX; int *piVar5; int *piVar6; int iVar7; int local_18; int local_14; int local_10; int *local_8; piVar3 = param_2; piVar6 = (int *)*in_ECX; if (*(char *)((int)param_2 + 0xd) == '\0') { iVar2 = param_2[4]; iVar7 = *param_3; if (param_2 == (int *)*piVar6) { if (iVar7 < iVar2) { *param_1 = (int)param_2; param_1[1] = 1; *(undefined1 *)(param_1 + 2) = 0; return; } } else { if (iVar2 <= iVar7) { if (iVar2 < iVar7) { p_Var4 = _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_2); iVar2 = *(int *)p_Var4; if ((*(char *)(iVar2 + 0xd) == '\0') && (*(int *)(iVar2 + 0x10) <= iVar7)) goto LAB_009ec103; cVar1 = *(char *)(piVar3[2] + 0xd); *(undefined1 *)(param_1 + 2) = 0; if (cVar1 == '\0') { *param_1 = iVar2; param_1[1] = 1; return; } } else { *(undefined1 *)(param_1 + 2) = 1; } *param_1 = (int)piVar3; param_1[1] = 0; return; } piVar6 = (int *)*param_2; if (*(char *)((int)piVar6 + 0xd) == '\0') { cVar1 = *(char *)(piVar6[2] + 0xd); piVar5 = (int *)piVar6[2]; while (cVar1 == '\0') { cVar1 = *(char *)(piVar5[2] + 0xd); piVar6 = piVar5; piVar5 = (int *)piVar5[2]; } } else { piVar6 = (int *)param_2[1]; piVar5 = param_2; if (*(char *)((int)piVar6 + 0xd) == '\0') { do { param_2 = piVar6; piVar6 = param_2; local_8 = param_2; if (piVar5 != (int *)*param_2) break; piVar6 = (int *)param_2[1]; piVar5 = param_2; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar5 + 0xd) != '\0') { piVar6 = piVar5; } } if (piVar6[4] < iVar7) { cVar1 = *(char *)(piVar6[2] + 0xd); *(undefined1 *)(param_1 + 2) = 0; if (cVar1 == '\0') { *param_1 = (int)piVar3; param_1[1] = 1; return; } *param_1 = (int)piVar6; param_1[1] = 0; return; } } } else if ((*(char *)(piVar6[1] + 0xd) != '\0') || (iVar7 = *param_3, *(int *)(piVar6[2] + 0x10) < iVar7)) { *param_1 = piVar6[2]; *(undefined1 *)(param_1 + 2) = 0; param_1[1] = 0; return; } LAB_009ec103: find_node(&local_18,param_3); if ((*(char *)(local_10 + 0xd) == '\0') && (*(int *)(local_10 + 0x10) <= iVar7)) { *param_1 = local_10; param_1[1] = 2; *(undefined1 *)(param_1 + 2) = 1; return; } *param_1 = local_18; param_1[1] = local_14; *(undefined1 *)(param_1 + 2) = 0; return; } //@@ 009ec1d0 Menu_Stats::~Menu_Stats /* DB: destroys 0x282 x 0x34 entries at +0x1838 (FUN_00420b00), 11 ANM2 at +0xc5c (stride 0x114), ANM2 +0xb48 and +0x1c (the two loaded by Menu_Stats::LoadGraphics); MenuManager dtor 00986f30 MenuManager::~MenuManager its EH unwind */ void __thiscall Menu_Stats::~Menu_Stats(Menu_Stats *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; ExceptionList = &local_10; _eh_vector_destructor_iterator_(this->_achievementOverlayEntries,0x34,0x282,FUN_00420b00); _eh_vector_destructor_iterator_(&this->_achievementMiniSprite1,0x114,0xb,ANM2::~ANM2); local_8 = 0; ANM2::Reset(&this->_achievementsSprite); AnimationState::~AnimationState(&(this->_achievementsSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_achievementsSprite)._animState); std::string::_Tidy_deallocate((this->_achievementsSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_achievementsSprite); local_8 = 1; ANM2::Reset(&this->_StatsMenuSprite); AnimationState::~AnimationState(&(this->_StatsMenuSprite)._overlayAnimState); AnimationState::~AnimationState(&(this->_StatsMenuSprite)._animState); std::string::_Tidy_deallocate((this->_StatsMenuSprite)._animDefaultName._buf); std::string::_Tidy_deallocate((char *)&this->_StatsMenuSprite); ExceptionList = local_10; return; } //@@ 009ec600 Menu_Stats::unload_graphics /* DB: ECX=MenuManager+0x2a18 (_menuStats: ANM2 +0x1c, +0xb48, 11 ANM2 at +0xc5c per structs.hpp): ANM2::Reset on those; from MenuManager::unload_graphics */ void __thiscall Menu_Stats::unload_graphics(Menu_Stats *this) { uint *ptr; void *pvVar1; undefined4 *puVar2; std_string *psVar3; int iVar4; uint *puVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; ANM2::Reset(&this->_StatsMenuSprite); ANM2::Reset(&this->_achievementsSprite); puVar5 = &(this->_achievementMiniSprite1)._animDefaultName._size; iVar4 = 0xb; do { if (puVar5[-6] != 0) { AnmCache::RemoveRef((std_string *)(puVar5 + -10)); } puVar2 = puVar5 + -10; if (0xf < puVar5[-5]) { puVar2 = (undefined4 *)*puVar2; } puVar5[-6] = 0; *(undefined1 *)puVar2 = 0; AnimationState::SetAnimationData((AnimationState *)(puVar5 + 2),(void *)0x0); AnimationState::SetAnimationData((AnimationState *)(puVar5 + 10),(void *)0x0); psVar3 = (std_string *)(puVar5 + -4); if (0xf < puVar5[1]) { psVar3 = *(std_string **)psVar3->_buf; } *puVar5 = 0; psVar3->_buf[0] = '\0'; pvVar1 = (void *)puVar5[0x15]; puVar5[0x13] = 0; puVar5[0x14] = 0; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,0xa0,*ptr,LayerState::~LayerState); operator_delete(ptr,*ptr * 0xa0 + 4); local_8 = 0xffffffff; } puVar5[0x15] = 0; puVar5[0x16] = 0; puVar5[0x17] = 0; puVar5[0x18] = 0; puVar5[0x19] = 0; puVar5[0x1a] = 0; puVar5[0x1b] = (uint)g_vectorZero.x; puVar5[0x1c] = (uint)g_vectorZero.y; puVar5[0x1d] = (uint)g_vectorOne.x; puVar5[0x1e] = (uint)g_vectorOne.y; puVar5[0x1f] = 0; puVar5[0x20] = 0x3f800000; puVar5[0x21] = 0x3f800000; puVar5[0x22] = 0x3f800000; puVar5[0x23] = 0x3f800000; puVar5[0x24] = 0; puVar5[0x25] = 0; puVar5[0x26] = 0; puVar5[0x27] = 0; puVar5[0x28] = 0; puVar5[0x29] = 0; puVar5[0x2a] = 0; puVar5[0x2f] = 0; puVar5[0x30] = 0; puVar5[0x31] = 0; puVar5[0x32] = 0; puVar5[0x33] = 0; puVar5[0x34] = 0; puVar5[0x35] = 0; puVar5[0x2b] = 0x3f800000; puVar5[0x2c] = 0x3f800000; puVar5[0x2d] = 0x3f800000; puVar5[0x2e] = 0; *(undefined2 *)(puVar5 + 0x36) = 0; puVar5[0x37] = 0x3f800000; *(undefined2 *)(puVar5 + 0x38) = 0; *(undefined1 *)(puVar5 + 0x12) = 0; puVar5[0x39] = 0xffffffff; puVar5[0x3a] = 0; puVar5 = puVar5 + 0x45; iVar4 = iVar4 + -1; } while (iVar4 != 0); ExceptionList = local_10; return; } //@@ 009ec880 Menu_Stats::LoadGraphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: thiscall: ANM2::Load "gfx/ui/main menu/StatsMenu.anm2" into this+0x1c, "gfx/ui/achievement/achievements.anm2" into +0xb48, SecretsMenuComponents.anm2, Icon1Unlocked; MenuManager::LoadGraphics */ void __thiscall Menu_Stats::LoadGraphics(Menu_Stats *this) { byte bVar1; byte *currentAnimName; char *pcVar2; uint uVar3; void **miniSpriteAnimData; bool isLess; int miniSpriteIndex; std_string componentsPath; std_string anmPath; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; byte *currentAnim; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b0fd1d; local_1c = ExceptionList; local_24 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x20); anmPath._size = 0x1f; anmPath._capacity = 0x1f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/main menu/StatsMenu.anm2",0x20); local_14 = 0; ANM2::Load(&this->_StatsMenuSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; pcVar2 = (char *)anmPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(anmPath._buf._0_4_ + -4); uVar3 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar2))) { LAB_009ec971: local_14 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } anmPath._size = 0; anmPath._capacity = 0xf; anmPath._buf[0] = '\0'; anmPath._buf[1] = '\0'; anmPath._buf[2] = '\0'; anmPath._buf[3] = '\0'; anmPath._buf._0_4_ = std::_Allocate(0x30); anmPath._size = 0x24; anmPath._capacity = 0x2f; builtin_strncpy((char *)anmPath._buf._0_4_,"gfx/ui/achievement/achievements.anm2",0x25); local_14 = 1; ANM2::Load(&this->_achievementsSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; pcVar2 = (char *)anmPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(anmPath._buf._0_4_ + -4); uVar3 = anmPath._capacity + 0x24; if ((char *)0x1f < (char *)(anmPath._buf._0_4_ + (-4 - (int)pcVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar3); } miniSpriteIndex = 0; miniSpriteAnimData = &(this->_achievementMiniSprite1)._animState._animData; do { componentsPath._size = 0; componentsPath._capacity = 0xf; componentsPath._buf[0] = '\0'; componentsPath._buf[1] = '\0'; componentsPath._buf[2] = '\0'; componentsPath._buf[3] = '\0'; componentsPath._buf._0_4_ = std::_Allocate(0x30); componentsPath._size = 0x2b; componentsPath._capacity = 0x2f; builtin_strncpy((char *)componentsPath._buf._0_4_,"gfx/ui/main menu/SecretsMenuComponents.anm2", 0x2c); local_14 = 2; ANM2::Load((ANM2 *)(miniSpriteAnimData + -0xd),&componentsPath,1); local_14 = 0xffffffff; if (0xf < componentsPath._capacity) { uVar3 = componentsPath._capacity + 1; pcVar2 = (char *)componentsPath._buf._0_4_; if (0xfff < uVar3) { pcVar2 = *(char **)(componentsPath._buf._0_4_ + -4); uVar3 = componentsPath._capacity + 0x24; if ((char *)0x1f < (char *)(componentsPath._buf._0_4_ + (-4 - (int)pcVar2))) goto LAB_009ec971; } operator_delete(pcVar2,uVar3); } componentsPath._size = 0; componentsPath._capacity = 0xf; componentsPath._buf._0_4_ = componentsPath._buf._0_4_ & 0xffffff00; if (miniSpriteIndex < 9) { currentAnim = *miniSpriteAnimData; if (currentAnim != (byte *)0x0) { currentAnimName = currentAnim; if (0xf < *(uint *)(currentAnim + 0x14)) { currentAnimName = *(byte **)currentAnim; } pcVar2 = "Icon1Unlocked"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*pcVar2; if (bVar1 != *pcVar2) { LAB_009ecb50: uVar3 = -(uint)isLess | 1; goto LAB_009ecb55; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)pcVar2[1]; if (bVar1 != pcVar2[1]) goto LAB_009ecb50; currentAnimName = currentAnimName + 2; pcVar2 = pcVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009ecb55: if ((uVar3 == 0) && ((currentAnim[0x34] == 0 || (*(byte *)(miniSpriteAnimData + 4) != 0)))) goto LAB_009ecb85; } bVar1 = ANM2::SetAnimation((ANM2 *)(miniSpriteAnimData + -0xd),(byte *)"Icon1Unlocked",1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(miniSpriteAnimData + -1)); *(byte *)(miniSpriteAnimData + 4) = 1; } } LAB_009ecb85: miniSpriteIndex = miniSpriteIndex + 1; miniSpriteAnimData = miniSpriteAnimData + 0x45; if (10 < miniSpriteIndex) { reset_state(); ExceptionList = local_1c; return; } } while( true ); } //@@ 009ecbc0 Menu_Stats::Update /* ZHL [exact] __thiscall void Menu_Stats::Update(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall Menu_Stats::Update(Menu_Stats *this) { void *pvVar1; int layerId; Game *pGVar2; Manager *pMVar3; int iVar4; uint uVar5; float targetFrame; if (((g_manager->_framecount & 1) == 0) && ((this->_StatsMenuSprite)._loaded != 0)) { AnimationState::Update(&(this->_StatsMenuSprite)._animState); AnimationState::Update(&(this->_StatsMenuSprite)._overlayAnimState); } pMVar3 = g_manager; this->_countItemsInCollection = 0; iVar4 = 0; do { if (*(char *)((int)(pMVar3->_persistentGameData)._eventCounters + iVar4 + 0x82c) != '\0') { this->_countItemsInCollection = this->_countItemsInCollection + 1; } pGVar2 = g_game; iVar4 = iVar4 + 1; } while (iVar4 < 0x2dd); uVar5 = 0; this->_countTotalAchievements = 0; do { if (((this->_achievementOverlayEntries[uVar5]._id == uVar5) && (uVar5 < 0x282)) && (((uVar5 == 0 || ((pMVar3->_persistentGameData)._achievements[uVar5] != 0)) || (((pMVar3->_state == 2 && (pGVar2 != (Game *)0x0)) && (((pGVar2->_dailyChallenge)._id != 0 || (pGVar2->_isDebug != 0)))))))) { this->_countTotalAchievements = this->_countTotalAchievements + 1; } uVar5 = uVar5 + 1; } while ((int)uVar5 < 0x282); this->_countDeaths = (pMVar3->_persistentGameData)._eventCounters[10]; this->_countMomKills = (pMVar3->_persistentGameData)._eventCounters[1]; if ((this->_StatsMenuSprite)._animState._animData != (void *)0x0) { pvVar1 = (this->_StatsMenuSprite)._animState._animation; if (this->_countTotalAchievements < 1) { if ((*(int *)((int)pvVar1 + 0x80) < 9) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_StatsMenuSprite)._animState._animation + 0x80) < 9)) goto LAB_009ecd3e; pvVar1 = (this->_StatsMenuSprite)._animState._animData; iVar4 = *(int *)((int)pvVar1 + 0x58); if ((pvVar1 == (void *)0x0) || ((iVar4 < 0 || (*(int *)((int)pvVar1 + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } targetFrame = 1.0; } else { if ((*(int *)((int)pvVar1 + 0x80) < 9) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_StatsMenuSprite)._animState._animation + 0x80) < 9)) goto LAB_009ecd3e; pvVar1 = (this->_StatsMenuSprite)._animState._animData; iVar4 = *(int *)((int)pvVar1 + 0x58); if ((pvVar1 == (void *)0x0) || ((iVar4 < 0 || (*(int *)((int)pvVar1 + 0x1c) <= iVar4)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } targetFrame = 0.0; } *(undefined4 *)((int)(this->_StatsMenuSprite)._animState._layerFrames + iVar4 * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_StatsMenuSprite)._animState,iVar4,targetFrame); } LAB_009ecd3e: if (this->_isAchievementScreenVisible == 0) { update_stats_screen(this); } else { update_achievements(); } iVar4 = this->_statsMenuCurrentSelection; if ((this->_StatsMenuSprite)._animState._animData != (void *)0x0) { if ((*(int *)((int)(this->_StatsMenuSprite)._animState._animation + 0x80) < 5) && (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), *(int *)((int)(this->_StatsMenuSprite)._animState._animation + 0x80) < 5)) { return; } pvVar1 = (this->_StatsMenuSprite)._animState._animData; layerId = *(int *)((int)pvVar1 + 0x48); if (((pvVar1 == (void *)0x0) || (layerId < 0)) || (*(int *)((int)pvVar1 + 0x1c) <= layerId)) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_StatsMenuSprite)._animState._layerFrames + layerId * 4) = 0; AnimationState::AdvanceLayerPosition(&(this->_StatsMenuSprite)._animState,layerId,(float)iVar4); } return; } //@@ 009ecdd0 Menu_Stats::Render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: right after Menu_Stats::Update 009ecbc0, rendered in the menu manager render sequence 0098a040; "%d/%d" counters via Font::DrawString, render_color_shader_pass prototype: REPENTOGON */ void __thiscall Menu_Stats::Render(Menu_Stats *this) { float fVar1; LayerState *hiddenLayer; void *quad; AnimationState *secondAnimState; AnimationState *animState; undefined1 quadBuffer [112]; KColor color; undefined4 fontParams; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; Vector local_58; Vector local_50; float menuY; Vector local_44; float numberX; float numberY; byte countText [16]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = countText + 0x30; local_14 = 0xffffffff; puStack_18 = &LAB_00b0fd5d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(countText + 0x24); ExceptionList = &local_1c; local_58.y = (g_menuManager->_ViewPosition).x + this->_PositionX; local_50.y = (g_menuManager->_ViewPosition).y + this->_PositionY; local_50.x = local_58.y; menuY = local_50.y; local_44.y = (float)this; hiddenLayer = ANM2::GetLayer(&this->_StatsMenuSprite,&DAT_00000007); hiddenLayer->_visible = 0; if ((this->_StatsMenuSprite)._loaded != 0) { if ((this->_StatsMenuSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_StatsMenuSprite)._animState,&local_50,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->_StatsMenuSprite)._overlayAnimState,&local_50,&g_vectorZero,&g_vectorZero); menuY = local_50.y; local_58.y = local_50.x; } else { AnimationState::Render (&(this->_StatsMenuSprite)._overlayAnimState,&local_50,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->_StatsMenuSprite)._animState,&local_50,&g_vectorZero,&g_vectorZero); menuY = local_50.y; local_58.y = local_50.x; } } numberY = menuY + 5.0; local_50.y = local_58.y + 40.0; numberX = local_50.y; render_number(this,this->_countDeaths,local_50.y,numberY); numberY = menuY + 27.0; numberX = local_50.y; render_number(this,this->_countItemsInCollection,local_50.y,numberY); numberY = menuY + 49.0; numberX = local_50.y; render_number(this,this->_countMomKills,local_50.y,numberY); numberY = menuY + 71.0; numberX = local_50.y; render_number(this,this->_countTotalAchievements,local_50.y,numberY); numberY = menuY + 93.0; numberX = local_50.y; render_number(this,(g_manager->_persistentGameData)._eventCounters[0x17],local_50.y,numberY); numberY = menuY + 115.0; numberX = local_50.y; render_number(this,(g_manager->_persistentGameData)._eventCounters[0x1f2],local_50.y,numberY); if (this->_isAchievementScreenVisible != 0) { color._red = 0.0; color._green = 0.0; color._blue = 0.0; color._alpha = 0.5; color._unk = 0; quad = render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,&color); render_color_shader_pass(quad); local_58.x = local_58.y + 240.0; local_58.y = menuY + 135.0; if ((this->_achievementsSprite)._loaded != 0) { if ((this->_achievementsSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->_achievementsSprite)._animState,&local_58,&g_vectorZero,&g_vectorZero); animState = &(this->_achievementsSprite)._overlayAnimState; } else { AnimationState::Render (&(this->_achievementsSprite)._overlayAnimState,&local_58,&g_vectorZero, &g_vectorZero); animState = &(this->_achievementsSprite)._animState; } AnimationState::Render(animState,&local_58,&g_vectorZero,&g_vectorZero); } sprintf_s(countText,0x10,(byte *)"%d/%d"); fontParams = 0; local_70 = 0xffff; local_6c = 0; local_68 = 0x3f800000; local_64 = 0xffffffff; local_60 = 0; local_5c = 0; local_14 = 0; color._unk = 0; color._red = 0.8; color._green = 0.8; color._blue = 0.8; color._alpha = 1.0; Font::get_string_width_n(&g_manager->_font1_TeamMeatEx10,countText,-1); fVar1 = local_44.y; Font::DrawString(countText,&color,&fontParams); local_14 = 0xffffffff; local_58.y = 0.0; animState = &((ANM2 *)((int)fVar1 + 0xc5c))->_animState; do { local_44.y = (g_menuManager->_ViewPosition).y + *(float *)((int)fVar1 + 0x18) + *(float *)((int)fVar1 + 0x134); local_44.x = (float)(int)local_58.y * 35.0 + *(float *)((int)fVar1 + 0x138) + 100.0 + (g_menuManager->_ViewPosition).x + *(float *)((int)fVar1 + 0x14); if (*(char *)((int)&animState[6]._currentlyTriggeredEvents + 1) != '\0') { if (*(char *)&animState[2]._animation == '\0') { AnimationState::Render(animState,&local_44,&g_vectorZero,&g_vectorZero); secondAnimState = animState + 1; } else { AnimationState::Render(animState + 1,&local_44,&g_vectorZero,&g_vectorZero); secondAnimState = animState; } AnimationState::Render(secondAnimState,&local_44,&g_vectorZero,&g_vectorZero); } local_58.y = (float)((int)local_58.y + 1); animState = (AnimationState *)&animState[8]._isPlaying; } while ((int)local_58.y < 9); local_44.x = (g_menuManager->_ViewPosition).x + *(float *)((int)fVar1 + 0x14) + 95.0; local_44.y = (g_menuManager->_ViewPosition).y + *(float *)((int)fVar1 + 0x18) + *(float *)((int)fVar1 + 0x134); if (((ANM2 *)((int)fVar1 + 0x1610))->_loaded != 0) { if (((ANM2 *)((int)fVar1 + 0x1610))->_overlayRenderFirst == 0) { AnimationState::Render (&((ANM2 *)((int)fVar1 + 0x1610))->_animState,&local_44,&g_vectorZero, &g_vectorZero); animState = &((ANM2 *)((int)fVar1 + 0x1610))->_overlayAnimState; } else { AnimationState::Render (&((ANM2 *)((int)fVar1 + 0x1610))->_overlayAnimState,&local_44,&g_vectorZero, &g_vectorZero); animState = &((ANM2 *)((int)fVar1 + 0x1610))->_animState; } AnimationState::Render(animState,&local_44,&g_vectorZero,&g_vectorZero); } local_44.x = (g_menuManager->_ViewPosition).x + *(float *)((int)fVar1 + 0x14) + 380.0; local_44.y = (g_menuManager->_ViewPosition).y + *(float *)((int)fVar1 + 0x18) + *(float *)((int)fVar1 + 0x134); if (((ANM2 *)((int)fVar1 + 0x1724))->_loaded != 0) { if (((ANM2 *)((int)fVar1 + 0x1724))->_overlayRenderFirst == 0) { AnimationState::Render (&((ANM2 *)((int)fVar1 + 0x1724))->_animState,&local_44,&g_vectorZero, &g_vectorZero); animState = &((ANM2 *)((int)fVar1 + 0x1724))->_overlayAnimState; } else { AnimationState::Render (&((ANM2 *)((int)fVar1 + 0x1724))->_overlayAnimState,&local_44,&g_vectorZero, &g_vectorZero); animState = &((ANM2 *)((int)fVar1 + 0x1724))->_animState; } AnimationState::Render(animState,&local_44,&g_vectorZero,&g_vectorZero); } } ExceptionList = local_1c; return; } //@@ 009ed3c0 Menu_Stats::reset_state /* DB: ? Menu_Stats typed ECX: sets StatsMenuSprite "Idle", hides achievementsSprite layer 0, plays CursorLeft/CursorRight, randomizes _IconIDtoUseForAchievementID[0x282], zeroes the counters/selection, _achievementScrollInPosition = 275; tail of Menu_Stats::LoadGraphics */ void Menu_Stats::reset_state(void) { byte bVar1; byte *currentAnimName; uint uVar2; LayerState *achievementsLayer; Menu_Stats *in_ECX; byte *idleName; char *cursorAnimName; int iconsLeft; int *iconId; bool isLess; byte *animData; animData = (in_ECX->_StatsMenuSprite)._animState._animData; if (animData == (byte *)0x0) { LAB_009ed415: bVar1 = ANM2::SetAnimation(&in_ECX->_StatsMenuSprite,s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind(&(in_ECX->_StatsMenuSprite)._animState); (in_ECX->_StatsMenuSprite)._animState._isPlaying = 1; } } else { currentAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { currentAnimName = *(byte **)animData; } idleName = s_Idle; do { bVar1 = *currentAnimName; isLess = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_009ed402: uVar2 = -(uint)isLess | 1; goto LAB_009ed407; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_009ed402; currentAnimName = currentAnimName + 2; idleName = idleName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009ed407: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((in_ECX->_StatsMenuSprite)._animState._isPlaying == 0)))) goto LAB_009ed415; } achievementsLayer = ANM2::GetLayer(&in_ECX->_achievementsSprite,(byte *)0x0); achievementsLayer->_visible = 0; animData = (in_ECX->_cursorLeftSprite)._animState._animData; if (animData == (byte *)0x0) { LAB_009ed496: bVar1 = ANM2::SetAnimation(&in_ECX->_cursorLeftSprite,(byte *)"CursorLeft",1); if (bVar1 != 0) { AnimationState::Rewind(&(in_ECX->_cursorLeftSprite)._animState); (in_ECX->_cursorLeftSprite)._animState._isPlaying = 1; } } else { currentAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { currentAnimName = *(byte **)animData; } cursorAnimName = "CursorLeft"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*cursorAnimName; if (bVar1 != *cursorAnimName) { LAB_009ed480: uVar2 = -(uint)isLess | 1; goto LAB_009ed485; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)cursorAnimName[1]; if (bVar1 != cursorAnimName[1]) goto LAB_009ed480; currentAnimName = currentAnimName + 2; cursorAnimName = cursorAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009ed485: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((in_ECX->_cursorLeftSprite)._animState._isPlaying == 0)))) goto LAB_009ed496; } animData = (in_ECX->_cursorRightSprite)._animState._animData; if (animData != (byte *)0x0) { currentAnimName = animData; if (0xf < *(uint *)(animData + 0x14)) { currentAnimName = *(byte **)animData; } cursorAnimName = "CursorRight"; do { bVar1 = *currentAnimName; isLess = bVar1 < (byte)*cursorAnimName; if (bVar1 != *cursorAnimName) { LAB_009ed4f7: uVar2 = -(uint)isLess | 1; goto LAB_009ed4fc; } if (bVar1 == 0) break; bVar1 = currentAnimName[1]; isLess = bVar1 < (byte)cursorAnimName[1]; if (bVar1 != cursorAnimName[1]) goto LAB_009ed4f7; currentAnimName = currentAnimName + 2; cursorAnimName = cursorAnimName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_009ed4fc: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((in_ECX->_cursorRightSprite)._animState._isPlaying != 0)))) goto LAB_009ed535; } bVar1 = ANM2::SetAnimation(&in_ECX->_cursorRightSprite,(byte *)"CursorRight",1); if (bVar1 != 0) { AnimationState::Rewind(&(in_ECX->_cursorRightSprite)._animState); (in_ECX->_cursorRightSprite)._animState._isPlaying = 1; } LAB_009ed535: iconsLeft = 0x282; iconId = in_ECX->_IconIDtoUseForAchievementID; do { uVar2 = Random(); *iconId = uVar2 % 3 + 1; iconsLeft = iconsLeft + -1; iconId = iconId + 1; } while (iconsLeft != 0); in_ECX->_countTotalAchievements = 0; in_ECX->_countItemsInCollection = 0; in_ECX->_countDeaths = 0; in_ECX->_countMomKills = 0; in_ECX->_statsMenuCurrentSelection = 0; in_ECX->_isAchievementScreenVisible = 0; in_ECX->_achievementScrollInPosition = 275.0; in_ECX->_achievementScrollThruListPosition = 0.0; load_achievements_xml(in_ECX); in_ECX->_holdInputTimer = 0; return; } //@@ 009ed5a0 Menu_Stats::render_number /* DB: ? thiscall (value, x, y): shows layer 7 of the StatsMenu ANM2 (this+0x1c) and draws value digit by digit (value/10 loop) with AnimationLayer::RenderFrame on layer 7 of the two digit sprites (+0x4c/+0x6c), "LayerId out of bounds"/"id out of bounds"; Menu_Stats::Render */ int __thiscall Menu_Stats::render_number(Menu_Stats *this,uint param_2,float param_3,float param_4) { LayerState *pLVar1; void *pvVar2; int iVar3; uint uVar4; void *pvVar5; ANM2 *pAVar6; pLVar1 = ANM2::GetLayer(&this->_StatsMenuSprite,&DAT_00000007); pLVar1->_visible = 1; do { uVar4 = param_2 / 10; if (((this->_StatsMenuSprite)._animState._animData != (void *)0x0) && ((7 < *(int *)((int)(this->_StatsMenuSprite)._animState._animation + 0x80) || (KAGE_LogMessage(0x10,(byte *)"LayerId out of bounds\n"), 7 < *(int *)((int)(this->_StatsMenuSprite)._animState._animation + 0x80))))) { pvVar5 = (this->_StatsMenuSprite)._animState._animData; iVar3 = *(int *)((int)pvVar5 + 0x54); if ((pvVar5 == (void *)0x0) || ((iVar3 < 0 || (*(int *)((int)pvVar5 + 0x1c) <= iVar3)))) { KAGE_LogMessage(0x10,(byte *)"id out of bounds\n"); } *(undefined4 *)((int)(this->_StatsMenuSprite)._animState._layerFrames + iVar3 * 4) = 0; AnimationState::AdvanceLayerPosition (&(this->_StatsMenuSprite)._animState,iVar3,(float)(param_2 % 10)); } if ((this->_StatsMenuSprite)._loaded != 0) { if ((this->_StatsMenuSprite)._overlayRenderFirst == 0) { pvVar5 = (this->_StatsMenuSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (pAVar6 = (this->_StatsMenuSprite)._animState._animation, 7 < pAVar6->_layerCount)) && (iVar3 = *(int *)((int)pvVar5 + 0x54), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar5 + 0x18)), (Vector *)¶m_3, *(int *)((int)(this->_StatsMenuSprite)._animState._layerFrames + iVar3 * 4), &g_vectorZero,&g_vectorZero,pAVar6); } pvVar5 = (this->_StatsMenuSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (pAVar6 = (this->_StatsMenuSprite)._overlayAnimState._animation, 7 < pAVar6->_layerCount )) && (iVar3 = *(int *)((int)pvVar5 + 0x54), -1 < iVar3)) { pvVar2 = (this->_StatsMenuSprite)._overlayAnimState._layerFrames; goto LAB_009ed716; } } else { pvVar5 = (this->_StatsMenuSprite)._overlayAnimState._animData; if (((pvVar5 != (void *)0x0) && (pAVar6 = (this->_StatsMenuSprite)._overlayAnimState._animation, 7 < pAVar6->_layerCount )) && (iVar3 = *(int *)((int)pvVar5 + 0x54), -1 < iVar3)) { AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar5 + 0x18)), (Vector *)¶m_3, *(int *)((int)(this->_StatsMenuSprite)._overlayAnimState._layerFrames + iVar3 * 4),&g_vectorZero,&g_vectorZero,pAVar6); } pvVar5 = (this->_StatsMenuSprite)._animState._animData; if (((pvVar5 != (void *)0x0) && (pAVar6 = (this->_StatsMenuSprite)._animState._animation, 7 < pAVar6->_layerCount)) && (iVar3 = *(int *)((int)pvVar5 + 0x54), -1 < iVar3)) { pvVar2 = (this->_StatsMenuSprite)._animState._layerFrames; LAB_009ed716: AnimationLayer::RenderFrame ((AnimationLayer *)(iVar3 * 0x10 + *(int *)((int)pvVar5 + 0x18)), (Vector *)¶m_3,*(int *)((int)pvVar2 + iVar3 * 4),&g_vectorZero, &g_vectorZero,pAVar6); } } } param_3 = param_3 - 11.0; param_4 = param_4 - 1.5; param_2 = (uVar4 * 10) / 10; if (param_2 == 0) { return uVar4 * 2; } } while( true ); } //@@ 009ed780 Menu_Stats::load_achievements_xml /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? parses achievements.xml ("achievements"/"achievement", TryRedirectPath) into 0x34-byte records at this+0xa4a8 (Menu_Stats is 0xa478 in zhl); caller 0x9ed3c0 is the secrets page (achievements.anm2, SecretsMenuComponents.anm2) next to Menu_Stats::Update */ void __thiscall Menu_Stats::load_achievements_xml(Menu_Stats *this) { qword qVar1; byte *extraout_EAX; int *file; int iVar2; byte *fileText; void *node; void *gfxRootAttr; std_string *left; byte *******pppppppbVar3; byte *pbVar4; byte *pbVar5; std_string *psVar6; uint uVar7; uint uVar8; qword *allocatedBytes; AchievementOverlay_Entry *entry; undefined4 *attribute; bool bVar9; byte *pbVar10; byte bVar11; uint achievementId; byte *******name [4]; uint nameSize; uint nameCapacity; byte *******gfxPath; char acStack_100b4 [4]; char acStack_100b0 [4]; char acStack_100ac [4]; uint gfxPathSize; uint gfxPathCapacity; undefined1 xmlDoc [48]; undefined1 auStack_10070 [65564]; std_string tmpString; std_string gfxRoot; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; manager = g_manager; puStack_20 = auStack_10070 + 0x1006c; local_14 = 0xffffffff; puStack_18 = &LAB_00b0fdc3; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(auStack_10070 + 0x10060); ExceptionList = &local_1c; tmpString._buf._0_4_ = std::_Allocate(0x20); tmpString._size = 0x10; tmpString._capacity = 0x1f; *(undefined4 *)tmpString._buf._0_4_ = 0x69686361; *(undefined4 *)(tmpString._buf._0_4_ + 4) = 0x6d657665; *(undefined4 *)(tmpString._buf._0_4_ + 8) = 0x73746e65; *(undefined4 *)(tmpString._buf._0_4_ + 0xc) = 0x6c6d782e; *(byte *)(tmpString._buf._0_4_ + 0x10) = 0; local_14 = 0; ModManager::TryRedirectPath(&manager->_modManager,&gfxRoot,&tmpString); local_14._0_1_ = 1; pbVar10 = extraout_EAX; if (0xf < *(uint *)(extraout_EAX + 0x14)) { pbVar10 = *(byte **)extraout_EAX; } file = FileSystem::Open(&PTR_vftable_00c37a10,pbVar10,(int *)0x0); local_14 = (uint)local_14._1_3_ << 8; if (0xf < gfxRoot._capacity) { uVar7 = gfxRoot._capacity + 1; psVar6 = (std_string *)gfxRoot._buf._0_4_; if (0xfff < uVar7) { psVar6 = (std_string *)((std_string *)(gfxRoot._buf._0_4_ + 0xffffffe8))->_capacity; uVar7 = gfxRoot._capacity + 0x24; if (0x1f < (uint)(gfxRoot._buf._0_4_ + (-4 - (int)psVar6))) goto LAB_009ed8ac; } operator_delete(psVar6,uVar7); } local_14 = -1; gfxRoot._size = 0; gfxRoot._capacity = 0xf; gfxRoot._buf._0_4_ = gfxRoot._buf._0_4_ & 0xffffff00; if (0xf < tmpString._capacity) { uVar7 = tmpString._capacity + 1; pppppppbVar3 = (byte *******)tmpString._buf._0_4_; if (0xfff < uVar7) { pppppppbVar3 = *(byte ********)(tmpString._buf._0_4_ + -4); uVar7 = tmpString._capacity + 0x24; if ((byte *)0x1f < (byte *)(tmpString._buf._0_4_ + (-4 - (int)pppppppbVar3))) { LAB_009ed8ac: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar3,uVar7); } if (file != (int *)0x0) { iVar2 = (**(code **)(*file + 4))(); fileText = operator_new_tracked(iVar2 + 1); (**(code **)(*file + 0x14))(fileText,1,iVar2); fileText[iVar2] = 0; (**(code **)*file)(1); FUN_00413b90(); local_14 = 2; pbVar10 = (byte *)0x9ed921; pbVar4 = fileText; rapidxml::xml_document::parse(xmlDoc,fileText); bVar11 = (byte)pbVar4; node = xml_node::first_node(xmlDoc,(byte *)"achievements",(int)pbVar10,bVar11); gfxRoot._size = 0; gfxRoot._capacity = 0xf; gfxRoot._buf._0_4_ = (std_string *)0x0; local_14._0_1_ = 3; gfxRootAttr = xml_node::first_attribute(node,&DAT_00b6987c,(uint)pbVar10,bVar11); if (gfxRootAttr != (void *)0x0) { pbVar10 = &g_xmlNullStr; if (*(byte **)((int)gfxRootAttr + 4) != (byte *)0x0) { pbVar10 = *(byte **)((int)gfxRootAttr + 4); } pbVar4 = pbVar10; do { bVar11 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar11 != 0); uVar7 = (int)pbVar4 - (int)(pbVar10 + 1); std::string::assign(gfxRoot._buf,pbVar10,uVar7); bVar11 = (byte)uVar7; } for (node = xml_node::first_node(node,(byte *)"achievement",(int)pbVar10,bVar11); node != (void *)0x0; node = *(void **)((int)node + 0x2c)) { achievementId = 0xffffffff; nameSize = 0; nameCapacity = 0xf; name[0] = (byte *******)0x0; gfxPathSize = 0; gfxPathCapacity = 0xf; gfxPath = (byte *******)0x0; local_14._0_1_ = 4; attribute = *(undefined4 **)((int)node + 0x20); if (attribute != (undefined4 *)0x0) { do { pbVar10 = (byte *)*attribute; pbVar5 = s_id; pbVar4 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar4 = pbVar10; } do { bVar11 = *pbVar4; bVar9 = bVar11 < *pbVar5; if (bVar11 != *pbVar5) { LAB_009eda43: uVar7 = -(uint)bVar9 | 1; goto LAB_009eda48; } if (bVar11 == 0) break; bVar11 = pbVar4[1]; bVar9 = bVar11 < pbVar5[1]; if (bVar11 != pbVar5[1]) goto LAB_009eda43; pbVar4 = pbVar4 + 2; pbVar5 = pbVar5 + 2; } while (bVar11 != 0); uVar7 = 0; LAB_009eda48: if (uVar7 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar10 = (byte *)attribute[1]; } achievementId = atoi((char *)pbVar10); } else { pbVar5 = &DAT_00b6e37c; pbVar4 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar4 = pbVar10; } do { bVar11 = *pbVar4; bVar9 = bVar11 < *pbVar5; if (bVar11 != *pbVar5) { LAB_009edaa0: uVar7 = -(uint)bVar9 | 1; goto LAB_009edaa5; } if (bVar11 == 0) break; bVar11 = pbVar4[1]; bVar9 = bVar11 < pbVar5[1]; if (bVar11 != pbVar5[1]) goto LAB_009edaa0; pbVar4 = pbVar4 + 2; pbVar5 = pbVar5 + 2; } while (bVar11 != 0); uVar7 = 0; LAB_009edaa5: if (uVar7 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar10 = (byte *)attribute[1]; } pbVar4 = pbVar10; do { bVar11 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar11 != 0); std::string::assign((char *)name,pbVar10,(int)pbVar4 - (int)(pbVar10 + 1)); } else { pbVar5 = &DAT_00b66fec; pbVar4 = &g_xmlNullStr; if (pbVar10 != (byte *)0x0) { pbVar4 = pbVar10; } do { bVar11 = *pbVar4; bVar9 = bVar11 < *pbVar5; if (bVar11 != *pbVar5) { LAB_009edb10: uVar7 = -(uint)bVar9 | 1; goto LAB_009edb15; } if (bVar11 == 0) break; bVar11 = pbVar4[1]; bVar9 = bVar11 < pbVar5[1]; if (bVar11 != pbVar5[1]) goto LAB_009edb10; pbVar5 = pbVar5 + 2; pbVar4 = pbVar4 + 2; } while (bVar11 != 0); uVar7 = 0; LAB_009edb15: if (uVar7 == 0) { pbVar10 = &g_xmlNullStr; if ((byte *)attribute[1] != (byte *)0x0) { pbVar10 = (byte *)attribute[1]; } pbVar4 = pbVar10; do { bVar11 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar11 != 0); psVar6 = (std_string *)(pbVar4 + -(int)(pbVar10 + 1)); if ((std_string *)(0x7fffffff - gfxRoot._size) < psVar6) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } left = &gfxRoot; if (0xf < gfxRoot._capacity) { left = (std_string *)gfxRoot._buf._0_4_; } std::string::concat(tmpString._buf,(int)this,psVar6,(byte *)left,gfxRoot._size, pbVar10,(uint)psVar6); if (0xf < gfxPathCapacity) { uVar7 = gfxPathCapacity + 1; pppppppbVar3 = gfxPath; if (0xfff < uVar7) { pppppppbVar3 = (byte *******)gfxPath[-1]; uVar7 = gfxPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)gfxPath + (-4 - (int)pppppppbVar3))) goto LAB_009edddd; } operator_delete(pppppppbVar3,uVar7); } gfxPath = (byte *******)tmpString._buf._0_4_; acStack_100b4[0] = tmpString._buf[4]; acStack_100b4[1] = tmpString._buf[5]; acStack_100b4[2] = tmpString._buf[6]; acStack_100b4[3] = tmpString._buf[7]; acStack_100b0[0] = tmpString._buf[8]; acStack_100b0[1] = tmpString._buf[9]; acStack_100b0[2] = tmpString._buf[10]; acStack_100b0[3] = tmpString._buf[0xb]; acStack_100ac[0] = tmpString._buf[0xc]; acStack_100ac[1] = tmpString._buf[0xd]; acStack_100ac[2] = tmpString._buf[0xe]; acStack_100ac[3] = tmpString._buf[0xf]; gfxPathSize = tmpString._size; gfxPathCapacity = tmpString._capacity; } } } } while ((attribute[4] != 0) && (attribute = (undefined4 *)attribute[6], attribute != (undefined4 *)0x0)); if (achievementId < 0x282) { psVar6 = &this->_achievementOverlayEntries[achievementId]._name; this->_achievementOverlayEntries[achievementId]._id = achievementId; if (psVar6 != (std_string *)name) { pppppppbVar3 = (byte *******)name; if (0xf < nameCapacity) { pppppppbVar3 = name[0]; } std::string::assign(psVar6->_buf,(byte *)pppppppbVar3,nameSize); } psVar6 = &this->_achievementOverlayEntries[achievementId]._gfx; if (psVar6 != (std_string *)&gfxPath) { pppppppbVar3 = (byte *******)&gfxPath; if (0xf < gfxPathCapacity) { pppppppbVar3 = gfxPath; } std::string::assign(psVar6->_buf,(byte *)pppppppbVar3,gfxPathSize); } } } uVar7 = nameCapacity; local_14._0_1_ = 3; if (0xf < gfxPathCapacity) { uVar8 = gfxPathCapacity + 1; pppppppbVar3 = gfxPath; if (0xfff < uVar8) { pppppppbVar3 = (byte *******)gfxPath[-1]; uVar8 = gfxPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)gfxPath + (-4 - (int)pppppppbVar3))) goto LAB_009edddd; } operator_delete(pppppppbVar3,uVar8); } if (0xf < uVar7) { uVar8 = uVar7 + 1; pppppppbVar3 = name[0]; if (0xfff < uVar8) { pppppppbVar3 = (byte *******)name[0][-1]; uVar8 = uVar7 + 0x24; if ((byte *)0x1f < (byte *)((int)name[0] + (-4 - (int)pppppppbVar3))) goto LAB_009edddd; } operator_delete(pppppppbVar3,uVar8); } } this->_maxAchievementID = 0; entry = this->_achievementOverlayEntries + 1; iVar2 = 2; do { if (entry[-1]._id == iVar2 + -2) { this->_achievementIDList[this->_maxAchievementID] = iVar2 + -2; this->_maxAchievementID = this->_maxAchievementID + 1; } if (entry->_id == iVar2 + -1) { this->_achievementIDList[this->_maxAchievementID] = iVar2 + -1; this->_maxAchievementID = this->_maxAchievementID + 1; } if (entry[1]._id == iVar2) { this->_achievementIDList[this->_maxAchievementID] = iVar2; this->_maxAchievementID = this->_maxAchievementID + 1; } if (entry[2]._id == iVar2 + 1) { this->_achievementIDList[this->_maxAchievementID] = iVar2 + 1; this->_maxAchievementID = this->_maxAchievementID + 1; } if (entry[3]._id == iVar2 + 2) { this->_achievementIDList[this->_maxAchievementID] = iVar2 + 2; this->_maxAchievementID = this->_maxAchievementID + 1; } if (entry[4]._id == iVar2 + 3) { this->_achievementIDList[this->_maxAchievementID] = iVar2 + 3; this->_maxAchievementID = this->_maxAchievementID + 1; } entry = entry + 6; uVar7 = iVar2 + 4; iVar2 = iVar2 + 6; } while (uVar7 < 0x282); local_14._0_1_ = 2; if (0xf < gfxRoot._capacity) { uVar7 = gfxRoot._capacity + 1; psVar6 = (std_string *)gfxRoot._buf._0_4_; if (0xfff < uVar7) { psVar6 = (std_string *)((std_string *)(gfxRoot._buf._0_4_ + -0x18))->_capacity; uVar7 = gfxRoot._capacity + 0x24; if ((byte *)0x1f < (byte *)(gfxRoot._buf._0_4_ + (-4 - (int)psVar6))) { LAB_009edddd: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar6,uVar7); } local_14 = 5; xml_memory_pool::clear(auStack_10070); if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = (qword *)((int)g_mainHeap + 0x30); } if (fileText != (byte *)0x0) { uVar7 = *(uint *)(fileText + -4); qVar1 = *allocatedBytes; *(uint *)allocatedBytes = (uint)*allocatedBytes - uVar7; *(uint *)((int)allocatedBytes + 4) = *(uint *)((int)allocatedBytes + 4) - (uint)((uint)qVar1 < uVar7); free(fileText + -4); } } ExceptionList = local_1c; return; } //@@ 009ede60 Menu_Stats::update_stats_screen /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Menu_Stats::Update calls it when _isAchievementScreenVisible == 0 (update_achievements otherwise); polls input actions 0xe/0x16/0x17/0xf via Input::Manager vfunc +0x74, cycles the stats page counter persistentData+0x10 (wraps at 5), opens the achievement screen ("Appear", Achievement_Locked.png) or leaves (FUN_0098aec0) prototype: db/protos.zhl */ void __thiscall Menu_Stats::update_stats_screen(Menu_Stats *persistentData) { int iVar1; char cVar2; byte bVar3; byte extraout_CL; byte extraout_CL_00; byte extraout_CL_01; int unused; PersistentGameData *persistentData; PersistentGameData *extraout_ECX; char *ptr; int iVar4; int extraout_EDX; int extraout_EDX_00; uint uVar5; undefined4 selectAction; int local_58; Menu_Stats *local_54; undefined1 local_50 [24]; float fStack_38; float fStack_34; float local_30; float local_2c; float local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; Manager *manager; puStack_20 = local_50 + 0x4c; local_14 = 0xffffffff; puStack_18 = &LAB_00af556d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_50 + 0x40); ExceptionList = &local_1c; selectAction = 0xe; local_54 = persistentData; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0xffffffff,FUN_00a209e0,&selectAction,0,0,local_24); if (cVar2 == '\0') { local_54 = (Menu_Stats *)0x16; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_54,0,0); if (cVar2 == '\0') { local_54 = (Menu_Stats *)0x17; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_54,0,0); if (cVar2 == '\0') { local_58 = 0xf; cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_58,0,0); if (cVar2 != '\0') { FUN_0098aec0(); } } else { iVar4 = persistentData->_statsMenuCurrentSelection; iVar1 = iVar4 + 1; persistentData->_statsMenuCurrentSelection = iVar1; if (iVar1 < 5) { if ((iVar4 == 1) && (persistentData->_countTotalAchievements == 0)) { persistentData->_statsMenuCurrentSelection = 3; } } else { persistentData->_statsMenuCurrentSelection = 0; } } } else { iVar4 = persistentData->_statsMenuCurrentSelection; iVar1 = iVar4 + -1; persistentData->_statsMenuCurrentSelection = iVar1; if (iVar1 < 0) { persistentData->_statsMenuCurrentSelection = 4; } else if ((iVar4 == 3) && (persistentData->_countTotalAchievements == 0)) { persistentData->_statsMenuCurrentSelection = 1; } } } else { switch(persistentData->_statsMenuCurrentSelection) { case 0: MenuManager::push_menu(8,unused); break; case 1: MenuManager::push_menu(0xd,unused); break; case 2: iVar1 = persistentData->_maxAchievementID; iVar4 = 0; persistentData->_selectedAchievmentId = 0; local_58 = persistentData->_achievementIDList[0]; if (0 < iVar1) { persistentData = &g_manager->_persistentGameData; do { bVar3 = PersistentGameData::Unlocked(persistentData,local_58); iVar4 = extraout_EDX; if (bVar3 != 0) break; persistentData->_selectedAchievmentId = persistentData->_selectedAchievmentId + 1; iVar4 = persistentData->_selectedAchievmentId; local_58 = persistentData->_achievementIDList[iVar4]; persistentData = extraout_ECX; } while (iVar4 < iVar1); } manager = g_manager; if (iVar4 < iVar1) { uVar5 = 1; do { if ((manager->_persistentGameData)._achievements[uVar5] != 0) { PersistentGameData::UnlockSteamAchievement(&manager->_persistentGameData,uVar5); } persistentData = local_54; uVar5 = uVar5 + 1; } while (uVar5 < 0x282); local_54->_isAchievementScreenVisible = 1; ANM2::Play(&local_54->_achievementsSprite,(byte *)"Appear",0); bVar3 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,local_58); if (bVar3 == 0) { local_50._20_4_ = std::_Allocate(0x30); local_2c = 5.74532e-44; local_28 = 6.5861e-44; builtin_strncpy((char *)local_50._20_4_,"gfx/ui/achievement/Achievement_Locked.png",0x2a); local_14 = 0; Sprite::ReplaceSpritesheet ((Sprite *)&persistentData->_achievementsSprite,3,(std_string *)(local_50 + 0x14)); local_14 = 0xffffffff; bVar3 = extraout_CL_00; if (0xf < (uint)local_28) { uVar5 = (int)local_28 + 1; ptr = (char *)local_50._20_4_; if (0xfff < uVar5) { ptr = *(char **)(local_50._20_4_ + -4); uVar5 = (int)local_28 + 0x24; if ((char *)0x1f < (char *)(local_50._20_4_ + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar5); bVar3 = extraout_CL_01; } } else { Sprite::ReplaceSpritesheet ((Sprite *)&persistentData->_achievementsSprite,3, &persistentData->_achievementOverlayEntries[extraout_EDX_00]._gfx); bVar3 = extraout_CL; } ANM2::LoadGraphics(&persistentData->_achievementsSprite,bVar3); persistentData->_achievementScrollThruListPosition = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_30 = 0.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 0.0; local_2c = 0.0; local_28 = 0.0; Sprite::SetColor((Sprite *)&persistentData->_achievementMiniSprite1,(ColorMod *)local_50); local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 0.0; local_28 = 0.0; Sprite::SetColor((Sprite *)&persistentData->_achievementMiniSprite9,(ColorMod *)local_50); local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_28 = 0.0; Sprite::SetColor((Sprite *)&persistentData->_achievementMiniSprite2,(ColorMod *)local_50); local_30 = 0.0; local_50._16_4_ = 0.0; local_50._20_4_ = 0.0; fStack_38 = 0.0; fStack_34 = 0.0; local_2c = 0.0; local_50._0_4_ = 1.0; local_50._4_4_ = 1.0; local_50._8_4_ = 1.0; local_50._12_4_ = 1.0; local_28 = 0.0; Sprite::SetColor((Sprite *)&persistentData->_achievementMiniSprite8,(ColorMod *)local_50); } break; case 3: MenuManager::push_menu(0xe,unused); break; case 4: MenuManager::push_menu(0x16,unused); } } if ((persistentData->_statsMenuCurrentSelection == 2) && (persistentData->_countTotalAchievements == 0)) { persistentData->_statsMenuCurrentSelection = 0; } ExceptionList = local_1c; return; } //@@ 009ee2a0 Menu_Stats::update_achievements /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: called from Menu_Stats::Update when _isAchievementScreenVisible; Icon%dLocked/Unlocked(Selected) spritesheets, Achievement_Locked.png, Appear/Dissapear */ void __thiscall Menu_Stats::update_achievements(Menu_Stats *this) { int *piVar1; char isActionTriggered; byte bVar2; uint uVar3; void **ppvVar4; float *miniPlaybackSpeed; byte *pbVar5; byte *pbVar6; int listIndex; byte extraout_CL; int iVar7; char *animName; uint extraout_ECX; uint extraout_ECX_00; uint extraout_ECX_01; int rawListIndex; byte *pbVar8; AnimationState *miniAnimState; bool bVar9; void *pvVar10; float maxScrollStep; float fVar11; float scrollPosition; undefined4 local_1d8 [8]; undefined4 local_1b8; undefined4 uStack_1b4; undefined4 local_1b0; undefined4 local_1ac [8]; undefined4 local_18c; undefined4 uStack_188; undefined4 local_184; undefined4 local_180 [8]; undefined4 local_160; undefined4 uStack_15c; undefined4 local_158; undefined4 local_154 [8]; undefined4 local_134; undefined4 uStack_130; undefined4 local_12c; undefined4 local_128; undefined4 uStack_124; undefined4 uStack_120; float fStack_11c; undefined4 local_108; undefined4 uStack_104; undefined4 local_100; undefined4 local_fc; undefined4 uStack_f8; undefined4 uStack_f4; float fStack_f0; undefined4 local_dc; undefined4 uStack_d8; undefined4 local_d4; undefined4 local_d0; undefined4 uStack_cc; undefined4 uStack_c8; float fStack_c4; undefined4 local_b0; undefined4 uStack_ac; undefined4 local_a8; undefined4 local_a4; undefined4 uStack_a0; undefined4 uStack_9c; float fStack_98; undefined4 local_84; undefined4 uStack_80; undefined4 local_7c; undefined4 menuRightAction; undefined4 menuLeftAction; void *local_70; void *local_6c; byte local_65; byte lockedAnimName [32]; byte unlockedAnimName [8]; byte *lockedGfxPath [4]; undefined4 lockedGfxPathSize; uint lockedGfxPathCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte *local_14; ColorMod *miniSpriteColor; local_14 = (byte *)0xffffffff; puStack_18 = &LAB_00b0fe05; local_1c = ExceptionList; puStack_20 = (undefined1 *)(lockedGfxPath + 0xe); uVar3 = __security_cookie ^ (uint)(lockedGfxPath + 0xb); local_24 = uVar3; ExceptionList = &local_1c; if (((g_manager->_framecount & 1) == 0) || (0x3c < this->_holdInputTimer)) { if ((this->_achievementsSprite)._loaded != 0) { AnimationState::Update(&(this->_achievementsSprite)._animState); AnimationState::Update(&(this->_achievementsSprite)._overlayAnimState); } miniAnimState = &(this->_achievementMiniSprite1)._animState; local_6c = (void *)0xb; do { if (*(char *)((int)&miniAnimState[6]._currentlyTriggeredEvents + 1) != '\0') { AnimationState::Update(miniAnimState); AnimationState::Update(miniAnimState + 1); } miniAnimState = (AnimationState *)&miniAnimState[8]._isPlaying; local_6c = (void *)((int)local_6c + -1); } while (local_6c != (void *)0x0); pvVar10 = (void *)0x3f800000; local_6c = (void *)0x0; if (0xb4 < this->_holdInputTimer) { local_70 = (void *)0x40800000; local_6c = (void *)((float)(this->_holdInputTimer + -0xb4) / 30.0 + 1.0); ppvVar4 = &local_6c; if (4.0 <= (float)local_6c) { ppvVar4 = &local_70; } pvVar10 = *ppvVar4; } (this->_achievementsSprite)._playbackSpeed = (float)pvVar10; miniPlaybackSpeed = &(this->_achievementMiniSprite1)._playbackSpeed; iVar7 = 0xb; do { *miniPlaybackSpeed = (float)pvVar10; miniPlaybackSpeed = miniPlaybackSpeed + 0x45; iVar7 = iVar7 + -1; } while (iVar7 != 0); if (0x3c < this->_holdInputTimer) { pvVar10 = (void *)((float)pvVar10 + (float)pvVar10); } this->_scrollSpeed = (float)pvVar10; } local_70 = (void *)0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_70,0,0,uVar3); if (isActionTriggered == '\0') { menuLeftAction = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&menuLeftAction,0,0); if (isActionTriggered == '\0') { menuRightAction = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&menuRightAction,0,0); if (isActionTriggered == '\0') { this->_holdInputTimer = 0; } else { this->_holdInputTimer = this->_holdInputTimer + 1; bVar9 = true; if ((this->_achievementsSprite)._animState._animData == (void *)0x0) goto LAB_009ee6cd; if ((this->_achievementsSprite)._animState._isPlaying != 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pbVar5 = s_Idle; do { bVar2 = *pbVar6; bVar9 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_009ee632: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee637; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_009ee632; pbVar6 = pbVar6 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee637: if (uVar3 == 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } animName = "Dissapear2"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ee678: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee67d; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ee678; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee67d: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((this->_achievementsSprite)._animState._isPlaying != 0)))) goto LAB_009ee6c6; } animName = "Dissapear2"; goto LAB_009ee6a3; } } } goto LAB_009ee6c6; } this->_holdInputTimer = this->_holdInputTimer + 1; bVar9 = (this->_achievementsSprite)._animState._animData == (void *)0x0; if (!bVar9) { if ((this->_achievementsSprite)._animState._isPlaying != 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } pbVar5 = s_Idle; do { bVar2 = *pbVar6; bVar9 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_009ee528: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee52d; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_009ee528; pbVar6 = pbVar6 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee52d: if (uVar3 == 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } animName = "Dissapear"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ee570: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee575; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ee570; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee575: if (uVar3 == 0) { if ((pbVar6[0x34] == 0) || ((this->_achievementsSprite)._animState._isPlaying != 0)) goto LAB_009ee6c6; animName = "Dissapear"; goto LAB_009ee6a3; } } animName = "Dissapear"; LAB_009ee6a3: bVar2 = ANM2::SetAnimation(&this->_achievementsSprite,(byte *)animName,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } } goto LAB_009ee6c6; } } else { pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 == (byte *)0x0) { LAB_009ee474: bVar2 = ANM2::SetAnimation(&this->_achievementsSprite,(byte *)"Dissapear",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } animName = "Dissapear"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ee450: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee455; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ee450; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee455: if ((uVar3 != 0) || ((pbVar6[0x34] != 0 && ((this->_achievementsSprite)._animState._isPlaying == 0)))) goto LAB_009ee474; } this->_isAchievementScreenVisible = 0; this->_achievementScrollInPosition = 275.0; LAB_009ee6c6: bVar9 = (this->_achievementsSprite)._animState._animData == (void *)0x0; } LAB_009ee6cd: if ((!bVar9) && ((this->_achievementsSprite)._animState._isPlaying == 0)) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Dissapear"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ee716: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee71b; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ee716; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee71b: if (uVar3 == 0) { if (this->_isAchievementScreenVisible == 0) goto LAB_009eeedc; pbVar6 = (this->_achievementsSprite)._animState._animData; pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } animName = "Appear"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ee764: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee769; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ee764; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee769: if (((uVar3 != 0) || (pbVar6[0x34] != 0)) && (bVar2 = ANM2::SetAnimation(&this->_achievementsSprite,(byte *)"Appear",1), bVar2 != 0)) { AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } iVar7 = this->_selectedAchievmentId + -1; if (iVar7 < 0) { iVar7 = this->_maxAchievementID + -1; } uVar3 = this->_achievementIDList[iVar7]; if ((uVar3 == 0xfffffffe) || ((-1 < (int)uVar3 && ((0x281 < uVar3 || (((uVar3 != 0 && ((g_manager->_persistentGameData)._achievements[uVar3] == 0)) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))))))))) { pbVar6 = std::_Allocate(0x30); lockedGfxPathSize = 0x29; lockedGfxPathCapacity = 0x2f; pbVar6[0] = 'g'; pbVar6[1] = 'f'; pbVar6[2] = 'x'; pbVar6[3] = '/'; pbVar6[4] = 'u'; pbVar6[5] = 'i'; pbVar6[6] = '/'; pbVar6[7] = 'a'; pbVar6[8] = 'c'; pbVar6[9] = 'h'; pbVar6[10] = 'i'; pbVar6[0xb] = 'e'; pbVar6[0xc] = 'v'; pbVar6[0xd] = 'e'; pbVar6[0xe] = 'm'; pbVar6[0xf] = 'e'; pbVar6[0x10] = 'n'; pbVar6[0x11] = 't'; pbVar6[0x12] = '/'; pbVar6[0x13] = 'A'; pbVar6[0x14] = 'c'; pbVar6[0x15] = 'h'; pbVar6[0x16] = 'i'; pbVar6[0x17] = 'e'; pbVar6[0x18] = 'v'; pbVar6[0x19] = 'e'; pbVar6[0x1a] = 'm'; pbVar6[0x1b] = 'e'; pbVar6[0x1c] = 'n'; pbVar6[0x1d] = 't'; pbVar6[0x1e] = '_'; pbVar6[0x1f] = 'L'; pbVar6[0x20] = 0x6f; pbVar6[0x21] = 99; pbVar6[0x22] = 0x6b; pbVar6[0x23] = 0x65; pbVar6[0x24] = 100; pbVar6[0x25] = 0x2e; pbVar6[0x26] = 0x70; pbVar6[0x27] = 0x6e; pbVar6[0x28] = 0x67; pbVar6[0x29] = 0; local_14 = (byte *)0x0; lockedGfxPath[0] = pbVar6; if (3 < (this->_achievementsSprite)._layerCount) { local_6c = (this->_achievementsSprite)._layerState; pbVar5 = (byte *)((int)local_6c + 0x1e8); if (0xf < *(uint *)((int)local_6c + 0x1fc)) { pbVar5 = *(byte **)((int)local_6c + 0x1e8); } bVar2 = str_eq(pbVar6,0x29,pbVar5,*(uint *)((int)local_6c + 0x1f8)); if (bVar2 == 0) { pvVar10 = local_6c; if ((byte **)((int)local_6c + 0x1e8) != lockedGfxPath) { std::string::assign((char *)((int)local_6c + 0x1e8),pbVar6,0x29); pvVar10 = (this->_achievementsSprite)._layerState; pbVar6 = lockedGfxPath[0]; } *(undefined1 *)((int)pvVar10 + 0x210) = 0; } } local_14 = (byte *)0xffffffff; uVar3 = lockedGfxPathCapacity; if (0xf < lockedGfxPathCapacity) { uVar3 = lockedGfxPathCapacity + 1; pbVar5 = pbVar6; if (0xfff < uVar3) { pbVar5 = *(byte **)(pbVar6 + -4); uVar3 = lockedGfxPathCapacity + 0x24; if ((byte *)0x1f < pbVar6 + (-4 - (int)pbVar5)) goto LAB_009eeec0; } operator_delete(pbVar5,uVar3); uVar3 = extraout_ECX; } bVar2 = (byte)uVar3; } else { Sprite::ReplaceSpritesheet ((Sprite *)&this->_achievementsSprite,3, &this->_achievementOverlayEntries[uVar3]._gfx); bVar2 = extraout_CL; } } else { if ((this->_achievementsSprite)._animState._isPlaying != 0) goto LAB_009eeedc; pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Dissapear2"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ee975: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee97a; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ee975; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ee97a: if (uVar3 != 0) { if ((this->_achievementsSprite)._animState._isPlaying != 0) goto LAB_009eeedc; pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Appear"; do { local_65 = *pbVar6; bVar9 = local_65 < (byte)*animName; pbVar5 = (this->_achievementsSprite)._animState._animData; if (local_65 != *animName) { LAB_009ee9e6: uVar3 = -(uint)bVar9 | 1; goto LAB_009ee9eb; } if (local_65 == 0) break; local_65 = pbVar6[1]; bVar9 = local_65 < (byte)animName[1]; pbVar5 = (this->_achievementsSprite)._animState._animData; if (local_65 != animName[1]) goto LAB_009ee9e6; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (local_65 != 0); uVar3 = 0; LAB_009ee9eb: if (uVar3 != 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 == (byte *)0x0) { pbVar6 = &s_empty; } else if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Appear2"; do { local_65 = *pbVar6; bVar9 = local_65 < (byte)*animName; pbVar5 = (this->_achievementsSprite)._animState._animData; if (local_65 != *animName) { LAB_009eea46: uVar3 = -(uint)bVar9 | 1; goto LAB_009eea4b; } if (local_65 == 0) break; local_65 = pbVar6[1]; bVar9 = local_65 < (byte)animName[1]; pbVar5 = (this->_achievementsSprite)._animState._animData; if (local_65 != animName[1]) goto LAB_009eea46; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (local_65 != 0); uVar3 = 0; LAB_009eea4b: if (uVar3 != 0) goto LAB_009eeedc; } if (this->_achievementScrollThruListPosition != 0.0) { if (pbVar5 == (byte *)0x0) { pbVar5 = &s_empty; } else if (0xf < *(uint *)(pbVar5 + 0x14)) { pbVar5 = *(byte **)pbVar5; } animName = "Appear"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009eeaa0: uVar3 = -(uint)bVar9 | 1; goto LAB_009eeaa5; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009eeaa0; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009eeaa5: if (uVar3 == 0) { piVar1 = &this->_selectedAchievmentId; *piVar1 = *piVar1 + -1; if (*piVar1 < 0) { this->_selectedAchievmentId = this->_maxAchievementID + -1; } } else { this->_selectedAchievmentId = this->_selectedAchievmentId + 1; iVar7 = this->_selectedAchievmentId; if (this->_maxAchievementID <= iVar7) { iVar7 = 0; } this->_selectedAchievmentId = iVar7; } } pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 == (byte *)0x0) { LAB_009eeb44: bVar2 = ANM2::SetAnimation(&this->_achievementsSprite,s_Idle,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } pbVar8 = s_Idle; do { bVar2 = *pbVar5; bVar9 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009eeb20: uVar3 = -(uint)bVar9 | 1; goto LAB_009eeb25; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009eeb20; pbVar5 = pbVar5 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009eeb25: if ((uVar3 != 0) || ((pbVar6[0x34] != 0 && ((this->_achievementsSprite)._animState._isPlaying == 0)))) goto LAB_009eeb44; } miniSpriteColor = &(this->_achievementMiniSprite1)._color; this->_achievementScrollThruListPosition = 0.0; local_134 = 0; uStack_130 = 0; local_12c = 0; if (miniSpriteColor != (ColorMod *)local_154) { (this->_achievementMiniSprite1)._color._colorize[0] = 0.0; (this->_achievementMiniSprite1)._color._colorize[1] = 0.0; (this->_achievementMiniSprite1)._color._colorize[2] = 0.0; (this->_achievementMiniSprite1)._color._colorize[3] = 0.0; (this->_achievementMiniSprite1)._color._offset[0] = 0.0; (this->_achievementMiniSprite1)._color._offset[1] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite1)._color._tint[1] = 1.0; (this->_achievementMiniSprite1)._color._tint[2] = 1.0; (this->_achievementMiniSprite1)._color._tint[3] = 0.0; (this->_achievementMiniSprite1)._color._offset[2] = 0.0; } miniSpriteColor = &(this->_achievementMiniSprite9)._color; local_160 = 0; uStack_15c = 0; local_158 = 0; if (miniSpriteColor != (ColorMod *)local_180) { (this->_achievementMiniSprite9)._color._colorize[0] = 0.0; (this->_achievementMiniSprite9)._color._colorize[1] = 0.0; (this->_achievementMiniSprite9)._color._colorize[2] = 0.0; (this->_achievementMiniSprite9)._color._colorize[3] = 0.0; (this->_achievementMiniSprite9)._color._offset[0] = 0.0; (this->_achievementMiniSprite9)._color._offset[1] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite9)._color._tint[1] = 1.0; (this->_achievementMiniSprite9)._color._tint[2] = 1.0; (this->_achievementMiniSprite9)._color._tint[3] = 0.0; (this->_achievementMiniSprite9)._color._offset[2] = 0.0; } miniSpriteColor = &(this->_achievementMiniSprite2)._color; local_18c = 0; uStack_188 = 0; local_184 = 0; if (miniSpriteColor != (ColorMod *)local_1ac) { (this->_achievementMiniSprite2)._color._colorize[0] = 0.0; (this->_achievementMiniSprite2)._color._colorize[1] = 0.0; (this->_achievementMiniSprite2)._color._colorize[2] = 0.0; (this->_achievementMiniSprite2)._color._colorize[3] = 0.0; (this->_achievementMiniSprite2)._color._offset[0] = 0.0; (this->_achievementMiniSprite2)._color._offset[1] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite2)._color._tint[1] = 1.0; (this->_achievementMiniSprite2)._color._tint[2] = 1.0; (this->_achievementMiniSprite2)._color._tint[3] = 1.0; (this->_achievementMiniSprite2)._color._offset[2] = 0.0; } miniSpriteColor = &(this->_achievementMiniSprite8)._color; local_1b8 = 0; uStack_1b4 = 0; local_1b0 = 0; if (miniSpriteColor != (ColorMod *)local_1d8) { (this->_achievementMiniSprite8)._color._colorize[0] = 0.0; (this->_achievementMiniSprite8)._color._colorize[1] = 0.0; (this->_achievementMiniSprite8)._color._colorize[2] = 0.0; (this->_achievementMiniSprite8)._color._colorize[3] = 0.0; (this->_achievementMiniSprite8)._color._offset[0] = 0.0; (this->_achievementMiniSprite8)._color._offset[1] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite8)._color._tint[1] = 1.0; (this->_achievementMiniSprite8)._color._tint[2] = 1.0; (this->_achievementMiniSprite8)._color._tint[3] = 1.0; (this->_achievementMiniSprite8)._color._offset[2] = 0.0; } goto LAB_009eeedc; } if (this->_isAchievementScreenVisible == 0) goto LAB_009eeedc; pbVar6 = (this->_achievementsSprite)._animState._animData; if (pbVar6 == (byte *)0x0) { LAB_009eed44: bVar2 = ANM2::SetAnimation(&this->_achievementsSprite,(byte *)"Appear2",1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } else { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } animName = "Appear2"; do { bVar2 = *pbVar5; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009eed20: uVar3 = -(uint)bVar9 | 1; goto LAB_009eed25; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009eed20; pbVar5 = pbVar5 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009eed25: if ((uVar3 != 0) || ((pbVar6[0x34] != 0 && ((this->_achievementsSprite)._animState._isPlaying == 0)))) goto LAB_009eed44; } rawListIndex = this->_selectedAchievmentId + 1; iVar7 = 0; if (rawListIndex < this->_maxAchievementID) { iVar7 = rawListIndex; } uVar3 = this->_achievementIDList[iVar7]; if ((uVar3 == 0xfffffffe) || ((-1 < (int)uVar3 && ((0x281 < uVar3 || (((uVar3 != 0 && ((g_manager->_persistentGameData)._achievements[uVar3] == 0)) && (((g_manager->_state != 2 || (g_game == (Game *)0x0)) || (((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))))))))) { pbVar6 = std::_Allocate(0x30); lockedGfxPathSize = 0x29; lockedGfxPathCapacity = 0x2f; pbVar6[0] = 'g'; pbVar6[1] = 'f'; pbVar6[2] = 'x'; pbVar6[3] = '/'; pbVar6[4] = 'u'; pbVar6[5] = 'i'; pbVar6[6] = '/'; pbVar6[7] = 'a'; pbVar6[8] = 'c'; pbVar6[9] = 'h'; pbVar6[10] = 'i'; pbVar6[0xb] = 'e'; pbVar6[0xc] = 'v'; pbVar6[0xd] = 'e'; pbVar6[0xe] = 'm'; pbVar6[0xf] = 'e'; pbVar6[0x10] = 'n'; pbVar6[0x11] = 't'; pbVar6[0x12] = '/'; pbVar6[0x13] = 'A'; pbVar6[0x14] = 'c'; pbVar6[0x15] = 'h'; pbVar6[0x16] = 'i'; pbVar6[0x17] = 'e'; pbVar6[0x18] = 'v'; pbVar6[0x19] = 'e'; pbVar6[0x1a] = 'm'; pbVar6[0x1b] = 'e'; pbVar6[0x1c] = 'n'; pbVar6[0x1d] = 't'; pbVar6[0x1e] = '_'; pbVar6[0x1f] = 'L'; pbVar6[0x20] = 0x6f; pbVar6[0x21] = 99; pbVar6[0x22] = 0x6b; pbVar6[0x23] = 0x65; pbVar6[0x24] = 100; pbVar6[0x25] = 0x2e; pbVar6[0x26] = 0x70; pbVar6[0x27] = 0x6e; pbVar6[0x28] = 0x67; pbVar6[0x29] = 0; local_14 = (byte *)0x1; lockedGfxPath[0] = pbVar6; if (3 < (this->_achievementsSprite)._layerCount) { local_6c = (this->_achievementsSprite)._layerState; pbVar5 = (byte *)((int)local_6c + 0x1e8); if (0xf < *(uint *)((int)local_6c + 0x1fc)) { pbVar5 = *(byte **)((int)local_6c + 0x1e8); } bVar2 = str_eq(pbVar6,0x29,pbVar5,*(uint *)((int)local_6c + 0x1f8)); if (bVar2 == 0) { pvVar10 = local_6c; if ((byte **)((int)local_6c + 0x1e8) != lockedGfxPath) { std::string::assign((char *)((int)local_6c + 0x1e8),pbVar6,0x29); pvVar10 = (this->_achievementsSprite)._layerState; pbVar6 = lockedGfxPath[0]; } *(undefined1 *)((int)pvVar10 + 0x210) = 0; } } local_14 = (byte *)0xffffffff; uVar3 = lockedGfxPathCapacity; if (0xf < lockedGfxPathCapacity) { uVar3 = lockedGfxPathCapacity + 1; pbVar5 = pbVar6; if (0xfff < uVar3) { pbVar5 = *(byte **)(pbVar6 + -4); uVar3 = lockedGfxPathCapacity + 0x24; if ((byte *)0x1f < pbVar6 + (-4 - (int)pbVar5)) { LAB_009eeec0: local_14 = (byte *)0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar5,uVar3); uVar3 = extraout_ECX_01; } } else { Sprite::ReplaceSpritesheet ((Sprite *)&this->_achievementsSprite,3, &this->_achievementOverlayEntries[uVar3]._gfx); uVar3 = extraout_ECX_00; } bVar2 = (byte)uVar3; } ANM2::LoadGraphics(&this->_achievementsSprite,bVar2); } LAB_009eeedc: if (240.0 < this->_achievementScrollInPosition) { this->_achievementScrollInPosition = this->_achievementScrollInPosition - 2.0; goto LAB_009ef2cd; } if (((this->_achievementsSprite)._animState._animData != (void *)0x0) && ((this->_achievementsSprite)._animState._isPlaying != 0)) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Dissapear2"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009eef64: uVar3 = -(uint)bVar9 | 1; goto LAB_009eef69; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009eef64; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009eef69: if (uVar3 != 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Appear2"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009eefa0: uVar3 = -(uint)bVar9 | 1; goto LAB_009eefa5; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009eefa0; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009eefa5: if (uVar3 != 0) goto LAB_009ef0f9; } scrollPosition = this->_achievementScrollThruListPosition; if (-35.0 < scrollPosition) { miniSpriteColor = &(this->_achievementMiniSprite2)._color; local_a4 = 0x3f800000; uStack_a0 = 0x3f800000; maxScrollStep = this->_scrollSpeed + this->_scrollSpeed; uStack_9c = 0x3f800000; local_84 = 0; uStack_80 = 0; local_7c = 0; fVar11 = scrollPosition + 35.0; if (maxScrollStep <= scrollPosition + 35.0) { fVar11 = maxScrollStep; } scrollPosition = scrollPosition - fVar11; this->_achievementScrollThruListPosition = scrollPosition; fStack_98 = scrollPosition / 35.0 + 1.0; if (miniSpriteColor != (ColorMod *)&local_a4) { (this->_achievementMiniSprite2)._color._colorize[0] = 0.0; (this->_achievementMiniSprite2)._color._colorize[1] = 0.0; (this->_achievementMiniSprite2)._color._colorize[2] = 0.0; (this->_achievementMiniSprite2)._color._colorize[3] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite2)._color._tint[1] = 1.0; (this->_achievementMiniSprite2)._color._tint[2] = 1.0; (this->_achievementMiniSprite2)._color._tint[3] = fStack_98; (this->_achievementMiniSprite2)._color._offset[0] = 0.0; (this->_achievementMiniSprite2)._color._offset[1] = 0.0; (this->_achievementMiniSprite2)._color._offset[2] = 0.0; scrollPosition = this->_achievementScrollThruListPosition; } miniSpriteColor = &(this->_achievementMiniSprite9)._color; fStack_c4 = -scrollPosition / 35.0; local_d0 = 0x3f800000; uStack_cc = 0x3f800000; uStack_c8 = 0x3f800000; local_b0 = 0; uStack_ac = 0; local_a8 = 0; if (miniSpriteColor != (ColorMod *)&local_d0) { (this->_achievementMiniSprite9)._color._colorize[0] = 0.0; (this->_achievementMiniSprite9)._color._colorize[1] = 0.0; (this->_achievementMiniSprite9)._color._colorize[2] = 0.0; (this->_achievementMiniSprite9)._color._colorize[3] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite9)._color._tint[1] = 1.0; (this->_achievementMiniSprite9)._color._tint[2] = 1.0; (this->_achievementMiniSprite9)._color._tint[3] = fStack_c4; (this->_achievementMiniSprite9)._color._offset[0] = 0.0; (this->_achievementMiniSprite9)._color._offset[1] = 0.0; (this->_achievementMiniSprite9)._color._offset[2] = 0.0; } } } LAB_009ef0f9: if (((this->_achievementsSprite)._animState._animData != (void *)0x0) && ((this->_achievementsSprite)._animState._isPlaying != 0)) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Dissapear"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ef146: uVar3 = -(uint)bVar9 | 1; goto LAB_009ef14b; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ef146; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ef14b: if (uVar3 != 0) { pbVar6 = (this->_achievementsSprite)._animState._animData; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar6 = *(byte **)pbVar6; } animName = "Appear"; do { bVar2 = *pbVar6; bVar9 = bVar2 < (byte)*animName; if (bVar2 != *animName) { LAB_009ef182: uVar3 = -(uint)bVar9 | 1; goto LAB_009ef187; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar9 = bVar2 < (byte)animName[1]; if (bVar2 != animName[1]) goto LAB_009ef182; pbVar6 = pbVar6 + 2; animName = animName + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ef187: if (uVar3 != 0) goto LAB_009ef2cd; } scrollPosition = this->_achievementScrollThruListPosition; if (scrollPosition < 35.0) { miniSpriteColor = &(this->_achievementMiniSprite1)._color; local_fc = 0x3f800000; uStack_f8 = 0x3f800000; maxScrollStep = this->_scrollSpeed + this->_scrollSpeed; uStack_f4 = 0x3f800000; local_dc = 0; uStack_d8 = 0; local_d4 = 0; fVar11 = 35.0 - scrollPosition; if (maxScrollStep <= 35.0 - scrollPosition) { fVar11 = maxScrollStep; } fVar11 = fVar11 + scrollPosition; this->_achievementScrollThruListPosition = fVar11; fStack_f0 = fVar11 / 35.0; if (miniSpriteColor != (ColorMod *)&local_fc) { (this->_achievementMiniSprite1)._color._colorize[0] = 0.0; (this->_achievementMiniSprite1)._color._colorize[1] = 0.0; (this->_achievementMiniSprite1)._color._colorize[2] = 0.0; (this->_achievementMiniSprite1)._color._colorize[3] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite1)._color._tint[1] = 1.0; (this->_achievementMiniSprite1)._color._tint[2] = 1.0; (this->_achievementMiniSprite1)._color._tint[3] = fStack_f0; (this->_achievementMiniSprite1)._color._offset[0] = 0.0; (this->_achievementMiniSprite1)._color._offset[1] = 0.0; (this->_achievementMiniSprite1)._color._offset[2] = 0.0; fVar11 = this->_achievementScrollThruListPosition; } miniSpriteColor = &(this->_achievementMiniSprite8)._color; local_128 = 0x3f800000; uStack_124 = 0x3f800000; uStack_120 = 0x3f800000; local_108 = 0; uStack_104 = 0; local_100 = 0; fStack_11c = 1.0 - fVar11 / 35.0; if (miniSpriteColor != (ColorMod *)&local_128) { (this->_achievementMiniSprite8)._color._colorize[0] = 0.0; (this->_achievementMiniSprite8)._color._colorize[1] = 0.0; (this->_achievementMiniSprite8)._color._colorize[2] = 0.0; (this->_achievementMiniSprite8)._color._colorize[3] = 0.0; miniSpriteColor->_tint[0] = 1.0; (this->_achievementMiniSprite8)._color._tint[1] = 1.0; (this->_achievementMiniSprite8)._color._tint[2] = 1.0; (this->_achievementMiniSprite8)._color._tint[3] = fStack_11c; (this->_achievementMiniSprite8)._color._offset[0] = 0.0; (this->_achievementMiniSprite8)._color._offset[1] = 0.0; (this->_achievementMiniSprite8)._color._offset[2] = 0.0; } } } LAB_009ef2cd: local_6c = (void *)0x0; do { pvVar10 = local_6c; iVar7 = this->_maxAchievementID; rawListIndex = (int)local_6c + this->_selectedAchievmentId + -4; if (rawListIndex < 0) { rawListIndex = rawListIndex + iVar7; } listIndex = rawListIndex - iVar7; if (rawListIndex < iVar7) { listIndex = rawListIndex; } uVar3 = this->_achievementIDList[listIndex]; if (uVar3 == 0xfffffffe) { bVar9 = false; } else if ((int)uVar3 < 0) { LAB_009ef353: bVar9 = true; } else if (uVar3 < 0x282) { if (((uVar3 == 0) || ((g_manager->_persistentGameData)._achievements[uVar3] != 0)) || (((g_manager->_state == 2 && (g_game != (Game *)0x0)) && (((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) goto LAB_009ef353; bVar9 = false; } else { bVar9 = false; } if (bVar9) { if ((this->_achievementScrollThruListPosition == 0.0) && (local_6c == (void *)0x4)) { sprintf(unlockedAnimName,(byte *)"Icon%dUnlockedSelected"); pbVar6 = (this->_achievementMiniSprite5)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } pbVar8 = unlockedAnimName; do { bVar2 = *pbVar5; bVar9 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009ef3d0: uVar3 = -(uint)bVar9 | 1; goto LAB_009ef3d5; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009ef3d0; pbVar5 = pbVar5 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ef3d5: if (uVar3 == 0) { if ((pbVar6[0x34] == 0) || ((this->_achievementMiniSprite5)._animState._isPlaying != 0)) goto LAB_009ef521; pbVar6 = unlockedAnimName; goto LAB_009ef4bb; } } pbVar6 = unlockedAnimName; goto LAB_009ef4bb; } sprintf(unlockedAnimName,(byte *)"Icon%dUnlocked"); pbVar6 = unlockedAnimName; LAB_009ef4ef: bVar2 = ANM2::SetAnimation(&this->_achievementMiniSprite1 + (int)pvVar10,pbVar6,1); if (bVar2 != 0) { AnimationState::Rewind(&(&this->_achievementMiniSprite1)[(int)pvVar10]._animState); (&this->_achievementMiniSprite1)[(int)pvVar10]._animState._isPlaying = 1; } } else { if ((this->_achievementScrollThruListPosition != 0.0) || (local_6c != (void *)0x4)) { sprintf(lockedAnimName,(byte *)"Icon%dLocked"); pbVar6 = lockedAnimName; goto LAB_009ef4ef; } sprintf(lockedAnimName,(byte *)"Icon%dLockedSelected"); pbVar6 = (this->_achievementMiniSprite5)._animState._animData; if (pbVar6 != (byte *)0x0) { pbVar5 = pbVar6; if (0xf < *(uint *)(pbVar6 + 0x14)) { pbVar5 = *(byte **)pbVar6; } pbVar8 = lockedAnimName; do { bVar2 = *pbVar5; bVar9 = bVar2 < *pbVar8; if (bVar2 != *pbVar8) { LAB_009ef490: uVar3 = -(uint)bVar9 | 1; goto LAB_009ef495; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; bVar9 = bVar2 < pbVar8[1]; if (bVar2 != pbVar8[1]) goto LAB_009ef490; pbVar5 = pbVar5 + 2; pbVar8 = pbVar8 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_009ef495: if ((uVar3 == 0) && ((pbVar6[0x34] == 0 || ((this->_achievementMiniSprite5)._animState._isPlaying != 0)))) goto LAB_009ef521; } pbVar6 = lockedAnimName; LAB_009ef4bb: bVar2 = ANM2::SetAnimation(&this->_achievementMiniSprite5,pbVar6,1); if (bVar2 != 0) { AnimationState::Rewind(&(this->_achievementMiniSprite5)._animState); (this->_achievementMiniSprite5)._animState._isPlaying = 1; } } LAB_009ef521: local_6c = (void *)((int)local_6c + 1); if (8 < (int)local_6c) { ExceptionList = local_1c; return; } } while( true ); } //@@ 009ef550 FUN_009ef550 void FUN_009ef550(int *param_1) { if (*param_1 == 1) { FUN_009ef570(); return; } return; } //@@ 009ef570 FUN_009ef570 void FUN_009ef570(void) { void *pvVar1; pvVar1 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x202); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } *(undefined4 *)((int)pvVar1 + 0x1c) = 1; return; } //@@ 009ef5c0 FUN_009ef5c0 void FUN_009ef5c0(void) { char cVar1; uint uVar2; int *piVar3; undefined4 *puVar4; Menu_Title *in_ECX; char *text; undefined1 local_c4 [84]; undefined1 local_70 [12]; undefined1 local_64 [12]; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; Vector local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0fe40; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_64 + 0x60); ExceptionList = &local_10; Menu_Title::load_graphics(in_ECX); piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4e0,uVar2); if (*piVar3 == 0) { LAB_009ef71b: show_beta_disclaimer_popup(0,FUN_009ef960,in_ECX); ExceptionList = local_10; return; } puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4e0,uVar2); cVar1 = (**(code **)(*(int *)*puVar4 + 0x1c))(0x62200); if (cVar1 == '\0') { text = "##PLATFORM###AFTERBIRTH_DLC_NOT_INSTALLED"; } else { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4e0,uVar2); cVar1 = (**(code **)(*(int *)*puVar4 + 0x1c))(0x8b524); if (cVar1 == '\0') { text = "##PLATFORM###AFTERBIRTH_PLUS_DLC_NOT_INSTALLED"; } else { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4e0); cVar1 = (**(code **)(*(int *)*puVar4 + 0x1c))(0x15c37c); if (cVar1 != '\0') goto LAB_009ef71b; text = "##PLATFORM###REPENTANCE_DLC_NOT_INSTALLED"; } } local_18.x = (float)&DAT_bf800000; local_18.y = (float)&DAT_bf800000; MessagePopup::MessagePopup (local_c4,&g_manager->_font2_TeamMeatEx12,FUN_009ef570,(void *)0x0,&local_18); local_8 = 0; MessagePopup::add_ok_button((byte *)text,local_c4); PopupQueue::push(&g_manager[1]._gamestate.field_0xcf0,local_c4); local_48 = 0; local_44 = 0; local_50 = 0; local_4c = 0; local_58 = 0; local_54 = 0; FID_conflict__Tidy(local_64); FID_conflict__Tidy(local_70); ExceptionList = local_10; return; } //@@ 009ef740 Menu_Title::load_graphics /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: builds "gfx/ui/main menu/" + "titlemenu.png" / "titlemenu_2.png" / "titlemenu_3.png" (flags this+0x11c/+0x11d) and replaces the spritesheet on ANM2 this+8; MenuManager::LoadGraphics, Menu_Save::update_save_drawings prototype: db/protos.zhl */ void __thiscall Menu_Title::load_graphics(Menu_Title *this) { char *sheetName; byte extraout_CL; byte extraout_CL_00; byte bVar1; uint uVar2; byte ****ppppbVar3; void *pvVar4; byte ****ppppbVar5; ANM2 *titleSprite; byte ****sheetPath [4]; undefined4 sheetPathSize; uint sheetPathCapacity; void *pathCopy [4]; uint pathCopySize; uint pathCopyCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; byte ***local_14; puStack_20 = (undefined1 *)(sheetPath + 0x14); local_14 = (byte ***)0xffffffff; puStack_18 = &LAB_00b0fe7d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(sheetPath + 0x11); ExceptionList = &local_1c; sheetPath[0] = std::_Allocate(0x20); sheetPathSize = 0x11; sheetPathCapacity = 0x1f; *sheetPath[0] = (byte ***)0x2f786667; sheetPath[0][1] = (byte ***)0x6d2f6975; sheetPath[0][2] = (byte ***)0x206e6961; sheetPath[0][3] = (byte ***)0x756e656d; *(byte *)(sheetPath[0] + 4) = 0x2f; *(byte *)((int)sheetPath[0] + 0x11) = 0; local_14 = (byte ***)0x0; if (*(char *)((int)&this[1].PositionX + 1) == '\0') { if (*(char *)&this[1].PositionX == '\0') { sheetName = "titlemenu.png"; uVar2 = 0xd; } else { sheetName = "titlemenu_2.png"; uVar2 = 0xf; } } else { sheetName = "titlemenu_3.png"; uVar2 = 0xf; } std::string::append((char *)sheetPath,(byte *)sheetName,uVar2); titleSprite = &this->TitleScreenSprite; pathCopySize = 0; ppppbVar5 = (byte ****)sheetPath; if (0xf < sheetPathCapacity) { ppppbVar5 = sheetPath[0]; } pathCopyCapacity = 0xf; pathCopy[0] = (void *)0x0; ppppbVar3 = ppppbVar5; do { bVar1 = *(byte *)ppppbVar3; ppppbVar3 = (byte ****)((int)ppppbVar3 + 1); } while (bVar1 != 0); std::string::assign((char *)pathCopy,(byte *)ppppbVar5,(int)ppppbVar3 - (int)((int)ppppbVar5 + 1)) ; local_14._0_1_ = 1; Sprite::ReplaceSpritesheet((Sprite *)titleSprite,0,(std_string *)pathCopy); local_14 = (byte ***)((uint)local_14._1_3_ << 8); if (0xf < pathCopyCapacity) { uVar2 = pathCopyCapacity + 1; pvVar4 = pathCopy[0]; if (0xfff < uVar2) { pvVar4 = *(void **)((int)pathCopy[0] + -4); uVar2 = pathCopyCapacity + 0x24; if (0x1f < (uint)((int)pathCopy[0] + (-4 - (int)pvVar4))) goto LAB_009ef92e; } operator_delete(pvVar4,uVar2); } ppppbVar5 = (byte ****)sheetPath; if (0xf < sheetPathCapacity) { ppppbVar5 = sheetPath[0]; } pathCopySize = 0; pathCopyCapacity = 0xf; pathCopy[0] = (void *)0x0; ppppbVar3 = ppppbVar5; do { bVar1 = *(byte *)ppppbVar3; ppppbVar3 = (byte ****)((int)ppppbVar3 + 1); } while (bVar1 != 0); std::string::assign((char *)pathCopy,(byte *)ppppbVar5,(int)ppppbVar3 - (int)((int)ppppbVar5 + 1)) ; local_14._0_1_ = 2; Sprite::ReplaceSpritesheet((Sprite *)titleSprite,1,(std_string *)pathCopy); local_14 = (byte ***)((uint)local_14._1_3_ << 8); bVar1 = extraout_CL; if (0xf < pathCopyCapacity) { uVar2 = pathCopyCapacity + 1; pvVar4 = pathCopy[0]; if (0xfff < uVar2) { pvVar4 = *(void **)((int)pathCopy[0] + -4); uVar2 = pathCopyCapacity + 0x24; if (0x1f < (uint)((int)pathCopy[0] + (-4 - (int)pvVar4))) goto LAB_009ef92e; } operator_delete(pvVar4,uVar2); bVar1 = extraout_CL_00; } ANM2::LoadGraphics(titleSprite,bVar1); if (0xf < sheetPathCapacity) { uVar2 = sheetPathCapacity + 1; ppppbVar5 = sheetPath[0]; if (0xfff < uVar2) { ppppbVar5 = (byte ****)sheetPath[0][-1]; uVar2 = sheetPathCapacity + 0x24; if ((byte *)0x1f < (byte *)((int)sheetPath[0] + (-4 - (int)ppppbVar5))) { LAB_009ef92e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar5,uVar2); } ExceptionList = local_1c; return; } //@@ 009ef960 FUN_009ef960 void FUN_009ef960(char param_1) { if (param_1 == '\0') { FUN_009ef570(); return; } return; } //@@ 009ef980 FUN_009ef980 void FUN_009ef980(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("STEAMAPPS_INTERFACE_VERSION008"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 009ef9a0 RichTextSpan::try_merge /* DB: ? thiscall (other span): when style matches (+0x34 scale, 4 dwords +0x20..+0x2c color, +0x38, +0x3c) appends other's text std::string and returns 1, else 0; rich_text_layout merges adjacent spans with it */ undefined4 RichTextSpan::try_merge(byte *param_1) { uint *puVar1; char *in_ECX; int *piVar2; byte *pbVar3; uint uVar4; bool bVar5; if (*(float *)(in_ECX + 0x34) == *(float *)(param_1 + 0x34)) { pbVar3 = param_1 + 0x20; uVar4 = 0xc; piVar2 = (int *)(in_ECX + 0x20); do { if (*piVar2 != *(int *)pbVar3) { return 0; } piVar2 = piVar2 + 1; pbVar3 = pbVar3 + 4; bVar5 = 3 < uVar4; uVar4 = uVar4 - 4; } while (bVar5); if ((*(int *)(in_ECX + 0x38) == *(int *)(param_1 + 0x38)) && (*(int *)(in_ECX + 0x3c) == *(int *)(param_1 + 0x3c))) { puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::append(in_ECX,param_1,*puVar1); return 1; } } return 0; } //@@ 009efa10 RichText::~RichText /* DB: ? Font::Unload(this+0x18), deletes the 0x128-byte icon ANM2 at this+0x64 (ANM2::Reset, AnimationState dtors), frees the map at +0x58, destroys strings; called from two owner dtors (0083c4c0, 008d2a30) and an EH unwind funclet prototype: db/protos.zhl */ void __thiscall RichText::~RichText(void *this) { undefined4 *this_00; char *pcVar1; int iVar2; int iVar3; ANM2 *this_01; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b0feb0; local_10 = ExceptionList; ExceptionList = &local_10; Font::Unload((Font *)((int)this + 0x18)); iVar2 = *(int *)((int)this + 100); if (iVar2 != 0) { iVar3 = *(int *)(iVar2 + 0x120); std::map::_Erase_tree(iVar2 + 0x120,*(undefined4 *)(iVar3 + 4)); *(int *)(iVar3 + 4) = iVar3; *(int *)iVar3 = iVar3; *(int *)(iVar3 + 8) = iVar3; *(undefined4 *)(iVar2 + 0x124) = 0; this_01 = *(ANM2 **)((int)this + 100); if (this_01 != (ANM2 *)0x0) { pcVar1 = this_01[1]._filename._buf + 0xc; local_8 = 0; iVar2 = *(int *)pcVar1; std::map::_Erase_tree(pcVar1,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; this_01[1]._filename._size = 0; ANM2::Reset(this_01); std::map::_Erase_tree(pcVar1,*(undefined4 *)(*(int *)pcVar1 + 4)); operator_delete(*(void **)pcVar1,0x1c); local_8 = CONCAT31(local_8._1_3_,1); ANM2::Reset(this_01); AnimationState::~AnimationState(&this_01->_overlayAnimState); AnimationState::~AnimationState(&this_01->_animState); std::string::_Tidy_deallocate((this_01->_animDefaultName)._buf); std::string::_Tidy_deallocate((char *)this_01); operator_delete(this_01,0x128); *(undefined4 *)((int)this + 100) = 0; } } Font::Unload((Font *)((int)this + 0x18)); this_00 = (undefined4 *)((int)this + 0x58); FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(*(int *)((int)this + 0x58) + 4)); operator_delete((void *)*this_00,0x18); FUN_004b3950(); std::string::_Tidy_deallocate(this); ExceptionList = local_10; return; } //@@ 009efb60 RichText::load_font /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: callers PauseScreen_MyStuff::Init and FUN_0083c5f0; assigns the font path string, Font::Unload/Font::Load into +0x18 ('Failed to load font: %s'), lazily ANM2::Load gfx/ui/text_icons.anm2 into +0x64 and sets its scale from the font height; same object rich_text_render uses */ void RichText::load_font(byte *param_1) { uint *puVar1; ANM2 *pAVar2; byte *pbVar3; char extraout_AL; ANM2 *this; void *pvVar4; byte *in_ECX; char *pcVar5; int iVar6; uint size; std_string local_148; byte local_130 [268]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_130 + 300; local_14 = 0xffffffff; puStack_18 = &LAB_00b0ff00; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_130 + 0x120); ExceptionList = &local_1c; pbVar3 = local_130 + 300; if (in_ECX != param_1) { puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } std::string::assign((char *)in_ECX,param_1,*puVar1); pbVar3 = puStack_20; } puStack_20 = pbVar3; sprintf_s(local_130,0x104,&DAT_00b62fdc); Font::Unload((Font *)(in_ECX + 0x18)); Font::Load((Font *)(in_ECX + 0x18),local_130,0); if (extraout_AL == '\0') { KAGE_LogMessage(0x10,(byte *)"Failed to load font: %s \n"); } iVar6 = *(int *)(in_ECX + 100); if (iVar6 == 0) { this = operator_new(0x128); local_14 = 0; if (this == (ANM2 *)0x0) { this = (ANM2 *)0x0; } else { ANM2::constructor(this); local_14 = CONCAT31(local_14._1_3_,1); this[1]._filename._buf[0] = '\0'; this[1]._filename._buf[1] = '\0'; this[1]._filename._buf[2] = '\0'; this[1]._filename._buf[3] = '\0'; pAVar2 = this + 1; (pAVar2->_filename)._buf[4] = '\0'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; pAVar2 = this + 1; (pAVar2->_filename)._buf[8] = '\0'; (pAVar2->_filename)._buf[9] = '\0'; (pAVar2->_filename)._buf[10] = '\0'; (pAVar2->_filename)._buf[0xb] = '\0'; pcVar5 = this[1]._filename._buf + 0xc; pcVar5[0] = '\0'; pcVar5[1] = '\0'; pcVar5[2] = '\0'; pcVar5[3] = '\0'; this[1]._filename._size = 0; pvVar4 = operator_new(0x1c); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; *(undefined2 *)((int)pvVar4 + 0xc) = 0x101; *(void **)pcVar5 = pvVar4; } local_14 = 0xffffffff; *(ANM2 **)(in_ECX + 100) = this; local_148._size = 0; local_148._capacity = 0xf; local_148._buf[0] = '\0'; local_148._buf[1] = '\0'; local_148._buf[2] = '\0'; local_148._buf[3] = '\0'; local_148._buf._0_4_ = std::_Allocate(0x20); local_148._size = 0x16; local_148._capacity = 0x1f; builtin_strncpy((char *)local_148._buf._0_4_,"gfx/ui/text_icons.anm2",0x17); local_14 = 2; ANM2::Load(this,&local_148,1); if (0xf < local_148._capacity) { size = local_148._capacity + 1; pcVar5 = (char *)local_148._buf._0_4_; if (0xfff < size) { pcVar5 = *(char **)(local_148._buf._0_4_ + -4); size = local_148._capacity + 0x24; if ((char *)0x1f < (char *)(local_148._buf._0_4_ + (-4 - (int)pcVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar5,size); } iVar6 = *(int *)(in_ECX + 100); } *(float *)(iVar6 + 0x114) = (float)*(ushort *)(in_ECX + 0x2c); ExceptionList = local_1c; return; } //@@ 009efdb0 rich_text_render /* DB: ? renders lines from 009f0290 rich_text_layout inline heart/pickup/collectible icons; used by PlayerHUD::RenderHearts and item info pages prototype: db/protos.zhl, confirmed by RET 24 */ Vector * __thiscall rich_text_render(void *this,Vector *outSize,byte *text,Vector *position,KColor *color,float scale, int maxWidth) { int *piVar1; uint uVar2; int iVar3; byte *str; void *pvVar4; int *piVar5; byte *pbVar6; int *piVar7; float *pfVar8; float fVar9; float fVar10; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; int *local_50; int *local_4c; int local_48; Vector local_44; Vector local_3c; float local_34; float local_30; float local_2c; float local_28; float local_24; float local_20; float local_1c; float local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ff45; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_50 = (int *)0x0; local_4c = (int *)0x0; local_48 = 0; local_8 = 0; local_14 = this; rich_text_layout(text,color,maxWidth,&local_50); iVar3 = (uint)*(ushort *)((int)local_14 + 0x2c) * ((int)local_4c - (int)local_50 >> 4); outSize->x = 0.0; outSize->y = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * *(float *)((int)local_14 + 0x68) * scale; piVar7 = local_4c; if (local_50 != local_4c) { pvVar4 = local_14; piVar5 = local_50 + 1; do { pbVar6 = (byte *)piVar5[-1]; if (pbVar6 != (byte *)*piVar5) { pfVar8 = (float *)(pbVar6 + 0x1c); do { switch(pfVar8[7]) { case 0.0: local_6c = 0; local_68 = 0xffff; local_64 = 0; local_60 = 0x3f800000; local_5c = 0xffffffff; local_58 = 0; local_54 = 0; local_8._0_1_ = 1; local_3c.x = pfVar8[6]; local_44.x = pfVar8[-1] + position->x; local_44.y = position->y + *pfVar8; str = pbVar6; if (0xf < (uint)pfVar8[-2]) { str = *(byte **)pbVar6; } local_3c.y = local_3c.x; Font::DrawString((Font *)((int)pvVar4 + 0x18),str,&local_44,&local_3c, (KColor *)(pfVar8 + 1),&local_6c); local_8 = (uint)local_8._1_3_ << 8; break; case 1.4013e-45: *(float *)(*(int *)((int)pvVar4 + 100) + 0x114) = (float)*(ushort *)((int)pvVar4 + 0x2c) * pfVar8[6]; local_1c = pfVar8[-1] + position->x; local_18 = position->y + *pfVar8; RichTextIcon::render(&local_1c,0,pfVar8[8],pfVar8[4]); break; case 2.8026e-45: *(float *)(*(int *)((int)pvVar4 + 100) + 0x114) = (float)*(ushort *)((int)pvVar4 + 0x2c) * pfVar8[6]; local_24 = pfVar8[-1] + position->x; local_20 = position->y + *pfVar8; RichTextIcon::render(&local_24,1,pfVar8[8],pfVar8[4]); break; case 4.2039e-45: *(float *)(*(int *)((int)pvVar4 + 100) + 0x114) = (float)*(ushort *)((int)pvVar4 + 0x2c) * pfVar8[6]; local_2c = pfVar8[-1] + position->x; local_28 = position->y + *pfVar8; RichTextIcon::render(&local_2c,2,pfVar8[8],pfVar8[4]); break; case 5.60519e-45: *(float *)(*(int *)((int)pvVar4 + 100) + 0x114) = (float)*(ushort *)((int)pvVar4 + 0x2c) * pfVar8[6]; local_34 = pfVar8[-1] + position->x; local_30 = position->y + *pfVar8; RichTextIcon::render(&local_34,3,pfVar8[8],pfVar8[4]); break; default: goto switchD_009efe7c_default; } pvVar4 = local_14; switchD_009efe7c_default: pbVar6 = pbVar6 + 0x40; pfVar8 = pfVar8 + 0x10; } while (pbVar6 != (byte *)*piVar5); piVar7 = local_4c; } piVar1 = piVar5 + 3; fVar9 = (float)((double)piVar5[2] + __uint_to_double_fixup[-(piVar5[2] >> 0x1f)]); fVar10 = outSize->x; if (outSize->x <= fVar9) { fVar10 = fVar9; } outSize->x = fVar10; piVar5 = piVar5 + 4; } while (piVar1 != piVar7); } piVar5 = local_50; if (local_50 != (int *)0x0) { for (; piVar5 != piVar7; piVar5 = piVar5 + 4) { std::vector::_Tidy(uVar2); } uVar2 = local_48 - (int)local_50 & 0xfffffff0; piVar7 = local_50; if (0xfff < uVar2) { piVar7 = (int *)local_50[-1]; uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_50 + (-4 - (int)piVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar7,uVar2); } ExceptionList = local_10; return outSize; } //@@ 009f0140 Font::measure_rich_text /* DB: ? (out Vector*, text, maxWidth, scale in xmm3): runs rich_text_layout into a vector of 0x10-byte lines, x = widest line (+0xc), y = lines * ushort line height (this+0x2c) * this+0x68 * scale; PlayerHUD::render_pocket_item_info, menu_item_description_build prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Font::measure_rich_text(Font *this,Vector *outSize,byte *text,int maxWidth,float scale) { int *piVar1; uint uVar2; void *pvVar3; undefined4 extraout_ECX; int iVar4; void *pvVar5; float fVar6; float fVar7; KColor local_34; void *local_20; void *local_1c; int local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0ff7d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_20 = (void *)0x0; local_1c = (void *)0x0; local_18 = 0; local_8 = 0; local_14 = scale; KColor::SetFromARGB(&local_34,0xffffffff); rich_text_layout(text,extraout_ECX,maxWidth,&local_20); pvVar5 = local_1c; iVar4 = ((int)local_1c - (int)local_20 >> 4) * (uint)*(ushort *)&(this->_kerningPairs)._begin; outSize->x = 0.0; outSize->y = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * *(float *)&this[1]._pages * local_14; if (local_20 != local_1c) { pvVar3 = local_20; do { piVar1 = (int *)((int)pvVar3 + 0xc); pvVar3 = (void *)((int)pvVar3 + 0x10); fVar6 = (float)((double)*piVar1 + __uint_to_double_fixup[-(*piVar1 >> 0x1f)]); fVar7 = outSize->x; if (outSize->x <= fVar6) { fVar7 = fVar6; } outSize->x = fVar7; } while (pvVar3 != local_1c); } pvVar3 = local_20; if (local_20 != (void *)0x0) { for (; pvVar3 != pvVar5; pvVar3 = (void *)((int)pvVar3 + 0x10)) { std::vector::_Tidy(uVar2); } uVar2 = local_18 - (int)local_20 & 0xfffffff0; pvVar5 = local_20; if (0xfff < uVar2) { pvVar5 = *(void **)((int)local_20 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_20 + (-4 - (int)pvVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar2); } ExceptionList = local_10; return outSize; } //@@ 009f0290 rich_text_layout /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (text, font, w, h, out lines): splits markup text into runs (type 0 text drawn via 00a1b050, 1-4 icon types via 009f24b0); caller 009efdb0 rich_text_render with inline redheart/soulheart/blackheart/collectible icons */ void rich_text_layout(char *param_1,int *param_2,int param_3,int param_4) { float fVar1; char *this; int iVar2; int iVar3; char cVar4; int iVar5; undefined4 uVar6; void *pvVar7; byte *pbVar8; int *piVar9; uint uVar10; int *piVar11; void *pvVar12; uint uVar13; byte *pbVar14; byte *pbVar15; undefined4 *puVar16; byte *pbVar17; undefined4 *puVar18; bool bVar19; byte *in_XMM3_Da; double dVar20; undefined1 local_108 [8]; int local_100; undefined4 local_fc; int local_f8 [4]; int local_e8; byte *local_e4; int local_e0; byte *local_dc; byte *local_d8; int local_d4; undefined4 local_d0; char *local_cc; byte *local_c8; byte *local_c4; byte *local_c0; int *local_bc; int local_b8; int *local_b4; float local_b0; int *local_ac; int local_a8; byte *local_a4; int local_a0; int local_9c; int local_98; int *local_94; byte *local_90; byte *local_8c; int *local_88; byte *local_84; int *local_80; byte *local_7c; undefined4 *local_78; int *local_74; int *local_70; int *local_6c; void *local_68 [4]; undefined4 local_58; uint local_54; undefined4 local_50; undefined4 local_4c; KColor local_48; undefined4 local_34; undefined4 local_30; undefined4 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_68 + 0x19); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b0ffeb; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_68 + 0x16); ExceptionList = &local_1c; local_b0 = 0.0; local_f8[0] = *param_2; local_f8[1] = param_2[1]; local_f8[2] = param_2[2]; local_f8[3] = param_2[3]; local_e8 = param_2[4]; local_cc = param_1; local_e0 = param_4; local_80 = (int *)0x0; local_b4 = (int *)0x0; local_68[0] = (void *)0x0; local_58 = 0; local_54 = 0xf; local_4c = 0; local_50 = 0; local_a4 = in_XMM3_Da; local_98 = local_e8; local_8c = in_XMM3_Da; KColor::SetFromARGB(&local_48,0xffffffff); local_9c = 0; if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) goto LAB_009f1197; } operator_delete(pvVar12,uVar13); } local_68[0] = (void *)0x0; local_58 = 0; local_54 = 0xf; local_4c = 0; local_50 = 0; KColor::SetFromARGB(&local_48,0xffffffff); local_a8 = 0; if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) goto LAB_009f1197; } operator_delete(pvVar12,uVar13); } local_a0 = 0; local_88 = (int *)0x0; local_ac = (int *)0x0; local_74 = (int *)0x0; local_70 = (int *)0x0; local_6c = (int *)0x0; local_dc = (byte *)0x0; local_d8 = (byte *)0x0; local_d4 = 0; local_d0 = 0; local_14 = (void *)0x1; FUN_009f1be0(); pbVar8 = local_dc; local_14 = (void *)((uint)local_14 & 0xffffff00); if (local_dc != (byte *)0x0) { pbVar17 = local_d8; pbVar15 = local_dc; if (local_dc != local_d8) { do { uVar13 = *(uint *)(pbVar15 + 0x14); if (0xf < uVar13) { pvVar12 = *(void **)pbVar15; uVar10 = uVar13 + 1; pvVar7 = pvVar12; if (0xfff < uVar10) { pvVar7 = *(void **)((int)pvVar12 + -4); uVar10 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)pvVar7))) goto LAB_009f1197; } operator_delete(pvVar7,uVar10); pbVar17 = local_d8; } pbVar15[0x10] = 0; pbVar15[0x11] = 0; pbVar15[0x12] = 0; pbVar15[0x13] = 0; pbVar15[0x14] = 0xf; pbVar15[0x15] = 0; pbVar15[0x16] = 0; pbVar15[0x17] = 0; *pbVar15 = 0; pbVar15 = pbVar15 + 0x40; } while (pbVar15 != pbVar17); } uVar13 = local_d4 - (int)pbVar8 & 0xffffffc0; pbVar17 = pbVar8; if (0xfff < uVar13) { pbVar17 = *(byte **)(pbVar8 + -4); uVar13 = uVar13 + 0x23; if ((byte *)0x1f < pbVar8 + (-4 - (int)pbVar17)) goto LAB_009f1197; } operator_delete(pbVar17,uVar13); param_4 = local_e0; } puVar16 = (undefined4 *)(*(int *)(param_4 + 4) + -0x10); local_58 = 0; local_54 = 0xf; local_68[0] = (void *)0x0; local_4c = 0; local_50 = 0; local_78 = puVar16; KColor::SetFromARGB(&local_48,0xffffffff); local_34 = 0x3f800000; local_30 = 0; local_2c = 0; local_14 = (void *)CONCAT31(local_14._1_3_,2); if (local_70 == local_6c) { std::vector::_Emplace_reallocate(local_70,local_68); } else { RichTextSpan::move_construct(local_70,local_68); local_70 = local_70 + 0x10; } local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) { LAB_009f1197: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar13); } local_94 = local_70 + -0x10; piVar11 = local_70 + -10; *piVar11 = 0; local_bc = local_70 + -8; local_70[-9] = 0; *local_bc = local_f8[0]; local_70[-7] = local_f8[1]; local_70[-6] = local_f8[2]; local_70[-5] = local_f8[3]; local_70[-4] = local_98; local_70[-3] = (int)local_a4; local_70[-2] = 0; local_70[-1] = 0; if (*local_cc != '\0') { local_e4 = (byte *)(float)((double)param_3 + __uint_to_double_fixup[-(param_3 >> 0x1f)]); do { piVar9 = local_94; local_7c = (byte *)local_80; if (local_cc[local_a0] == '<') { cVar4 = rich_text_parse_icon_tag (local_cc,piVar11,&local_b4,local_f8,&local_8c,local_a4,&local_a0, &local_9c,&local_a8); local_98 = local_e8; if (cVar4 == '\0') { local_80 = local_b4; goto LAB_009f06d2; } } else { LAB_009f06d2: local_fc = CONCAT31(local_fc._1_3_,local_cc[local_a0]); std::string::push_back((char *)piVar9,local_cc[local_a0]); if (*(char *)(local_b8 + 0x18) == '\0') { LAB_009f0762: iVar5 = 0; } else { local_84 = (byte *)(int)local_cc[local_a0]; piVar11 = (int *)(local_b8 + 0x58); _Find_lower_bound<>(local_108,&local_84); if ((*(char *)(local_100 + 0xd) != '\0') || (iVar5 = local_100, local_84 < *(byte **)(local_100 + 0x10))) { iVar5 = *piVar11; } if (iVar5 == *piVar11) { iVar5 = *(int *)(local_b8 + 0x60); } else { iVar5 = *(int *)(iVar5 + 0x14); } if (iVar5 == -1) goto LAB_009f0762; iVar5 = (int)*(short *)(*(int *)(local_b8 + 0x40) + 0x10 + iVar5 * 0x14); } local_a0 = local_a0 + 1; local_b4 = (int *)((float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * (float)local_8c + (float)local_80); } local_c8 = (byte *)((float)local_b4 - (float)local_7c); local_80 = local_b4; if ((float)local_c8 + (float)local_ac <= (float)local_e4) { local_ac = (int *)((float)local_c8 + (float)local_ac); local_88 = (int *)((float)local_c8 + (float)local_88); } else { uVar6 = __ftoui3(); puVar16[3] = uVar6; fVar1 = (float)local_74[6]; local_b0 = (float)*(ushort *)(local_b8 + 0x2c) * *(float *)(local_b8 + 0x68) * (float)local_a4 + local_b0; for (piVar11 = local_74; piVar11 != local_70; piVar11 = piVar11 + 0x10) { piVar11[7] = (int)local_b0; piVar11[6] = (int)((float)piVar11[6] - fVar1); } uVar6 = __ftoui3(); puVar16[3] = uVar6; local_84 = (byte *)puVar16[1]; pbVar8 = (byte *)*puVar16; local_ac = local_88; local_80 = local_88; local_b4 = local_88; local_c4 = pbVar8; if (0x3f < (uint)((int)local_84 - (int)pbVar8)) { local_90 = pbVar8 + 0x40; pbVar17 = local_90; if (pbVar8 != local_84) { do { if (pbVar17 == local_84) break; if (*(float *)(pbVar8 + 0x34) == *(float *)(pbVar17 + 0x34)) { pbVar15 = pbVar8 + 0x20; local_c0 = (byte *)0xc; pbVar14 = pbVar17 + 0x20; do { if (*(int *)pbVar15 != *(int *)pbVar14) goto LAB_009f09aa; pbVar15 = pbVar15 + 4; pbVar14 = pbVar14 + 4; bVar19 = (byte *)0x3 < local_c0; local_c0 = local_c0 + -4; } while (bVar19); if ((*(int *)(pbVar8 + 0x38) != *(int *)(pbVar17 + 0x38)) || (*(int *)(pbVar8 + 0x3c) != *(int *)(pbVar17 + 0x3c))) goto LAB_009f09aa; pbVar15 = pbVar17; if (0xf < *(uint *)(pbVar17 + 0x14)) { pbVar15 = *(byte **)pbVar17; } std::string::append((char *)pbVar8,pbVar15,*(uint *)(pbVar17 + 0x10)); pbVar14 = (byte *)local_78[1]; local_c0 = pbVar17 + 0x40; pbVar15 = pbVar17; local_84 = pbVar14; if (local_c0 != pbVar14) { pbVar17 = pbVar17 + 0x18; do { if (pbVar17 + -0x18 != local_c0) { std::string::_Tidy_deallocate((char *)(pbVar17 + -0x18)); iVar5 = *(int *)(local_c0 + 4); iVar2 = *(int *)(local_c0 + 8); iVar3 = *(int *)(local_c0 + 0xc); *(int *)(pbVar17 + -0x18) = *(int *)local_c0; *(int *)(pbVar17 + -0x14) = iVar5; *(int *)(pbVar17 + -0x10) = iVar2; *(int *)(pbVar17 + -0xc) = iVar3; *(undefined8 *)(pbVar17 + -8) = *(undefined8 *)(local_c0 + 0x10); pbVar17[0x38] = 0; pbVar17[0x39] = 0; pbVar17[0x3a] = 0; pbVar17[0x3b] = 0; pbVar17[0x3c] = 0xf; pbVar17[0x3d] = 0; pbVar17[0x3e] = 0; pbVar17[0x3f] = 0; *local_c0 = 0; } local_c0 = local_c0 + 0x40; *(int *)pbVar17 = *(int *)(pbVar17 + 0x40); *(int *)(pbVar17 + 4) = *(int *)(pbVar17 + 0x44); *(int *)(pbVar17 + 8) = *(int *)(pbVar17 + 0x48); *(int *)(pbVar17 + 0xc) = *(int *)(pbVar17 + 0x4c); *(int *)(pbVar17 + 0x10) = *(int *)(pbVar17 + 0x50); *(int *)(pbVar17 + 0x14) = *(int *)(pbVar17 + 0x54); *(int *)(pbVar17 + 0x18) = *(int *)(pbVar17 + 0x58); *(int *)(pbVar17 + 0x1c) = *(int *)(pbVar17 + 0x5c); *(int *)(pbVar17 + 0x20) = *(int *)(pbVar17 + 0x60); *(int *)(pbVar17 + 0x24) = *(int *)(pbVar17 + 100); pbVar17 = pbVar17 + 0x40; } while (local_c0 != pbVar14); pbVar14 = (byte *)local_78[1]; pbVar15 = local_90; pbVar8 = local_c4; } std::string::_Tidy_deallocate((char *)(pbVar14 + -0x40)); local_78[1] = local_78[1] + -0x40; local_84 = (byte *)local_78[1]; } else { LAB_009f09aa: pbVar15 = pbVar17 + 0x40; pbVar8 = pbVar17; local_c4 = pbVar17; local_90 = pbVar15; } pbVar17 = pbVar15; } while (pbVar8 != local_84); } } iVar5 = local_e0; local_dc = (byte *)0x0; local_d8 = (byte *)0x0; local_d4 = 0; local_d0 = 0; local_14._0_1_ = 3; puVar16 = *(undefined4 **)(local_e0 + 4); if (puVar16 == *(undefined4 **)(local_e0 + 8)) { std::vector::_Emplace_reallocate(puVar16,&local_dc); } else { *puVar16 = 0; puVar16[1] = 0; puVar16[2] = 0; puVar16[3] = 0; *(int *)(local_e0 + 4) = *(int *)(local_e0 + 4) + 0x10; } iVar2 = local_d4; local_c4 = local_dc; local_90 = local_d8; local_14 = (void *)((uint)local_14._1_3_ << 8); if (local_dc != (byte *)0x0) { pbVar8 = local_d8; pbVar17 = local_dc; if (local_dc != local_d8) { do { uVar13 = *(uint *)(pbVar17 + 0x14); if (0xf < uVar13) { pvVar12 = *(void **)pbVar17; uVar10 = uVar13 + 1; pvVar7 = pvVar12; if (0xfff < uVar10) { pvVar7 = *(void **)((int)pvVar12 + -4); uVar10 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)pvVar7))) goto LAB_009f1197; } operator_delete(pvVar7,uVar10); pbVar8 = local_90; } pbVar17[0x10] = 0; pbVar17[0x11] = 0; pbVar17[0x12] = 0; pbVar17[0x13] = 0; pbVar17[0x14] = 0xf; pbVar17[0x15] = 0; pbVar17[0x16] = 0; pbVar17[0x17] = 0; *pbVar17 = 0; pbVar17 = pbVar17 + 0x40; } while (pbVar17 != pbVar8); } uVar13 = iVar2 - (int)local_c4 & 0xffffffc0; pbVar8 = local_c4; if (0xfff < uVar13) { pbVar8 = *(byte **)(local_c4 + -4); uVar13 = uVar13 + 0x23; if ((byte *)0x1f < local_c4 + (-4 - (int)pbVar8)) goto LAB_009f1197; } operator_delete(pbVar8,uVar13); local_dc = (byte *)0x0; local_d8 = (byte *)0x0; local_d4 = 0; iVar5 = local_e0; } iVar2 = local_9c; puVar16 = (undefined4 *)(*(int *)(iVar5 + 4) + -0x10); local_78 = puVar16; if (local_9c != 0) { if ((local_94[0xe] != 0) || (local_94[4] != 0)) { local_58 = 0; local_54 = 0xf; local_68[0] = (void *)0x0; local_4c = 0; local_50 = 0; local_48._unk = 0; local_48._red = 1.0; local_48._green = 1.0; local_48._blue = 1.0; local_48._alpha = 1.0; local_34 = 0x3f800000; local_30 = 0; local_2c = 0; local_14 = (void *)CONCAT31(local_14._1_3_,4); if (local_70 == local_6c) { std::vector::_Emplace_reallocate(local_70,local_68); } else { RichTextSpan::move_construct(local_70,local_68); local_70 = local_70 + 0x10; } local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) goto LAB_009f1197; } operator_delete(pvVar12,uVar13); } local_94 = local_70 + -0x10; local_70[-10] = (int)local_88; local_70[-9] = (int)local_b0; } local_80 = (int *)((float)local_c8 + (float)local_88); local_bc = local_94 + 8; local_94[8] = local_f8[0]; local_94[9] = local_f8[1]; local_94[10] = local_f8[2]; local_94[0xb] = local_f8[3]; local_94[0xc] = local_98; local_94[0xd] = (int)local_8c; local_94[0xe] = iVar2; local_94[0xf] = local_a8; local_b4 = local_80; local_ac = local_80; } } piVar11 = local_f8; uVar13 = 0xc; piVar9 = local_bc; do { if (*piVar11 != *piVar9) goto LAB_009f0cc3; piVar11 = piVar11 + 1; piVar9 = piVar9 + 1; bVar19 = 3 < uVar13; uVar13 = uVar13 - 4; } while (bVar19); if ((((float)local_8c != (float)local_94[0xd]) || (local_9c != local_94[0xe])) || (local_a8 != local_94[0xf])) { LAB_009f0cc3: if ((local_94[0xe] != 0) || (local_94[4] != 0)) { local_58 = 0; local_54 = 0xf; local_68[0] = (void *)0x0; local_4c = 0; local_50 = 0; local_48._unk = 0; local_48._red = 1.0; local_48._green = 1.0; local_48._blue = 1.0; local_48._alpha = 1.0; local_34 = 0x3f800000; local_30 = 0; local_2c = 0; local_14 = (void *)CONCAT31(local_14._1_3_,5); if (local_70 == local_6c) { std::vector::_Emplace_reallocate(local_70,local_68); } else { RichTextSpan::move_construct(local_70,local_68); local_70 = local_70 + 0x10; } local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) goto LAB_009f1197; } operator_delete(pvVar12,uVar13); } local_94 = local_70 + -0x10; local_70[-10] = (int)local_80; local_70[-9] = (int)local_b0; } local_bc = local_94 + 8; *local_bc = local_f8[0]; local_94[9] = local_f8[1]; local_94[10] = local_f8[2]; local_94[0xb] = local_f8[3]; local_94[0xc] = local_98; local_94[0xe] = local_9c; local_94[0xd] = (int)local_8c; local_94[0xf] = local_a8; *(byte **)((((int)local_70 - (int)local_74 & 0xffffffc0U) - 0x28) + (int)local_74) = local_7c; } if (local_9c == 0) { piVar11 = local_94 + 6; } else { local_88 = (int *)0x0; local_7c = (byte *)local_70; piVar11 = local_74; puVar18 = puVar16; if (local_74 != local_70) { do { puVar16 = local_78; this = (char *)puVar18[1]; local_7c = (byte *)local_70; if (this == (char *)local_78[2]) { std::vector::_Emplace_reallocate_copy(this,piVar11); } else { std::string::string(this,piVar11); iVar5 = piVar11[7]; *(int *)(this + 0x18) = piVar11[6]; *(int *)(this + 0x1c) = iVar5; *(int *)(this + 0x20) = piVar11[8]; *(int *)(this + 0x24) = piVar11[9]; *(int *)(this + 0x28) = piVar11[10]; *(int *)(this + 0x2c) = piVar11[0xb]; *(int *)(this + 0x30) = piVar11[0xc]; *(int *)(this + 0x34) = piVar11[0xd]; *(int *)(this + 0x38) = piVar11[0xe]; *(int *)(this + 0x3c) = piVar11[0xf]; local_78[1] = local_78[1] + 0x40; puVar16 = local_78; } piVar11 = piVar11 + 0x10; local_7c = (byte *)local_70; puVar18 = puVar16; } while (piVar11 != local_70); pbVar8 = (byte *)local_70; piVar11 = local_74; if (local_74 != local_70) { do { uVar13 = piVar11[5]; if (0xf < uVar13) { pvVar12 = (void *)*piVar11; uVar10 = uVar13 + 1; pvVar7 = pvVar12; if (0xfff < uVar10) { pvVar7 = *(void **)((int)pvVar12 + -4); uVar10 = uVar13 + 0x24; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)pvVar7))) goto LAB_009f1197; } operator_delete(pvVar7,uVar10); pbVar8 = local_7c; } piVar11[4] = 0; piVar11[5] = 0xf; *(undefined1 *)piVar11 = 0; piVar11 = piVar11 + 0x10; } while ((byte *)piVar11 != pbVar8); } } piVar11 = local_74; local_9c = 0; local_58 = 0; local_54 = 0xf; local_68[0] = (void *)0x0; local_4c = 0; local_50 = 0; local_70 = local_74; KColor::SetFromARGB(&local_48,0xffffffff); local_34 = 0x3f800000; local_30 = 0; local_2c = 0; local_14 = (void *)CONCAT31(local_14._1_3_,6); if (piVar11 == local_6c) { std::vector::_Emplace_reallocate(piVar11,local_68); } else { RichTextSpan::move_construct(piVar11,local_68); local_70 = local_70 + 0x10; } local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) goto LAB_009f1197; } operator_delete(pvVar12,uVar13); } local_94 = local_70 + -0x10; piVar11 = local_70 + -10; local_bc = local_70 + -8; local_70[-9] = (int)local_b0; *piVar11 = (int)local_80; *local_bc = local_f8[0]; local_70[-7] = local_f8[1]; local_70[-6] = local_f8[2]; local_70[-5] = local_f8[3]; local_70[-4] = local_98; local_70[-3] = (int)local_8c; local_70[-2] = 0; local_70[-1] = local_a8; } if (local_94[4] != 0) { piVar9 = local_94; if (0xf < (uint)local_94[5]) { piVar9 = (int *)*local_94; } if (*(char *)(local_94[4] + -1 + (int)piVar9) == ' ') { local_88 = (int *)0x0; local_7c = (byte *)local_70; piVar11 = local_74; if (local_74 != local_70) { do { local_7c = (byte *)local_70; if (puVar16[1] == puVar16[2]) { std::vector::_Emplace_reallocate_copy(puVar16[1],piVar11); } else { FUN_009f20f0(); puVar16[1] = puVar16[1] + 0x40; } piVar9 = local_70; piVar11 = piVar11 + 0x10; local_7c = (byte *)local_70; } while (piVar11 != local_70); piVar11 = local_74; if (local_74 != local_70) { do { std::string::_Tidy_deallocate((char *)piVar11); piVar11 = piVar11 + 0x10; } while (piVar11 != piVar9); puVar16 = local_78; } } piVar11 = local_74; local_58 = 0; local_54 = 0xf; local_68[0] = (void *)0x0; local_4c = 0; local_50 = 0; local_70 = local_74; KColor::SetFromARGB(&local_48,0xffffffff); local_34 = 0x3f800000; local_30 = 0; local_2c = 0; local_14 = (void *)CONCAT31(local_14._1_3_,7); if (piVar11 == local_6c) { std::vector::_Emplace_reallocate(piVar11,local_68); } else { RichTextSpan::move_construct(piVar11,local_68); local_70 = local_70 + 0x10; } local_14 = (void *)((uint)local_14 & 0xffffff00); if (0xf < local_54) { uVar13 = local_54 + 1; pvVar12 = local_68[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_68[0] + -4); uVar13 = local_54 + 0x24; if (0x1f < (uint)((int)local_68[0] + (-4 - (int)pvVar12))) goto LAB_009f1197; } operator_delete(pvVar12,uVar13); } local_94 = local_70 + -0x10; piVar11 = local_70 + -10; local_bc = local_70 + -8; local_70[-9] = (int)local_b0; *piVar11 = (int)local_80; *local_bc = local_f8[0]; local_70[-7] = local_f8[1]; local_70[-6] = local_f8[2]; local_70[-5] = local_f8[3]; local_70[-4] = local_98; local_70[-2] = local_9c; local_70[-3] = (int)local_8c; local_70[-1] = local_a8; } } } while (local_cc[local_a0] != '\0'); } piVar11 = local_74; if (local_74 != local_70) { do { local_7c = (byte *)local_70; if (puVar16[1] == puVar16[2]) { std::vector::_Emplace_reallocate_copy(puVar16[1],piVar11); } else { FUN_009f20f0(); puVar16[1] = puVar16[1] + 0x40; } piVar9 = local_70; piVar11 = piVar11 + 0x10; local_7c = (byte *)local_70; } while (piVar11 != local_70); piVar11 = local_74; if (local_74 != local_70) { do { std::string::_Tidy_deallocate((char *)piVar11); piVar11 = piVar11 + 0x10; } while (piVar11 != piVar9); puVar16 = local_78; } } pbVar8 = (byte *)puVar16[1]; pbVar17 = (byte *)*puVar16; local_7c = pbVar17; local_70 = local_74; if ((((int)pbVar8 - (int)pbVar17 & 0xffffffc0U) != 0) && (local_90 = pbVar17 + 0x40, pbVar17 != pbVar8)) { local_a4 = pbVar17 + 0x80; pbVar15 = local_90; do { if (pbVar15 == pbVar8) break; cVar4 = RichTextSpan::try_merge(); if (cVar4 == '\0') { pbVar14 = pbVar15 + 0x40; local_a4 = local_a4 + 0x40; pbVar17 = pbVar15; local_90 = pbVar14; local_7c = pbVar15; } else { pbVar8 = (byte *)local_78[1]; local_c8 = local_a4; pbVar14 = pbVar15; local_e4 = pbVar8; if (local_a4 != pbVar8) { pbVar8 = local_a4 + -0x28; pbVar17 = local_a4; do { FUN_004215a0(); *(int *)pbVar8 = *(int *)(pbVar8 + 0x40); pbVar17 = pbVar17 + 0x40; *(int *)(pbVar8 + 4) = *(int *)(pbVar8 + 0x44); *(int *)(pbVar8 + 8) = *(int *)(pbVar8 + 0x48); *(int *)(pbVar8 + 0xc) = *(int *)(pbVar8 + 0x4c); *(int *)(pbVar8 + 0x10) = *(int *)(pbVar8 + 0x50); *(int *)(pbVar8 + 0x14) = *(int *)(pbVar8 + 0x54); *(int *)(pbVar8 + 0x18) = *(int *)(pbVar8 + 0x58); *(int *)(pbVar8 + 0x1c) = *(int *)(pbVar8 + 0x5c); *(int *)(pbVar8 + 0x20) = *(int *)(pbVar8 + 0x60); *(int *)(pbVar8 + 0x24) = *(int *)(pbVar8 + 100); pbVar8 = pbVar8 + 0x40; } while (pbVar17 != local_e4); pbVar8 = (byte *)local_78[1]; pbVar14 = local_90; pbVar17 = local_7c; } std::string::_Tidy_deallocate((char *)(pbVar8 + -0x40)); local_78[1] = local_78[1] + -0x40; } pbVar8 = (byte *)local_78[1]; pbVar15 = pbVar14; } while (pbVar17 != pbVar8); } dVar20 = ceil((double)(float)local_ac); local_c8 = (byte *)(float)dVar20; uVar6 = FUN_00af0800(); piVar9 = local_70; local_78[3] = uVar6; piVar11 = local_74; if (local_74 != (int *)0x0) { for (; piVar11 != piVar9; piVar11 = piVar11 + 0x10) { std::string::_Tidy_deallocate((char *)piVar11); } FUN_009f1d50(local_74,(int)local_6c - (int)local_74 >> 6); } ExceptionList = local_1c; return; } //@@ 009f1380 rich_text_parse_icon_tag /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? str_eq on tag names player/pickup/rooms/collectible/color/default/redheart/soulheart/blackheart, advances x by icon width and sets kind 2/3/4; called from text renderer 009f0290 rich_text_layout by PlayerHUD::RenderHearts and Rep+ player info */ undefined1 rich_text_parse_icon_tag (int param_1,float *param_2,float *param_3,undefined4 *param_4,float *param_5, float param_6,int *param_7,undefined4 *param_8,int *param_9) { uint uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; byte bVar6; uint uVar7; byte *pbVar8; ulong argb; undefined4 *extraout_EAX; void *ptr; byte *pbVar9; int iVar10; uint uVar11; void *pvVar12; byte *pbVar13; int iVar14; code *pcVar15; undefined8 uVar16; double dVar17; KColor local_a4; int *local_90; float *local_8c; float *local_88; undefined4 *local_84; float *local_80; int *local_78; float local_74; undefined4 *local_70; byte *local_6c; byte *local_68; int local_64; int local_60; undefined1 local_59; byte *local_58; void *local_54 [4]; undefined4 local_44; uint local_40; void *local_3c; int local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_54 + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b1003d; local_1c = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_54 + 0x11); ExceptionList = &local_1c; local_8c = param_2; local_80 = param_3; local_88 = param_5; local_90 = param_7; local_78 = param_9; pbVar13 = (byte *)(*param_7 + param_1); local_70 = param_4; local_84 = param_8; local_44 = 0; local_40 = 0xf; local_54[0] = (void *)0x0; pbVar9 = pbVar13; do { bVar6 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar6 != 0); local_24 = uVar7; std::string::assign((char *)local_54,pbVar13,(int)pbVar9 - (int)(pbVar13 + 1)); local_14 = (void *)0x0; ExtractAngleBracketText(uVar7); local_14._0_1_ = 1; string_split(0x3d); local_14 = (void *)CONCAT31(local_14._1_3_,2); iVar10 = (int)local_68 - (int)local_6c; pbVar9 = local_6c; if (iVar10 - 0x30U < 0x18) { local_58 = (byte *)0x0; if (iVar10 / 0x18 + (iVar10 >> 0x1f) != iVar10 >> 0x1f) { local_60 = 0; do { pbVar13 = pbVar9 + local_60; if (*(int *)(pbVar9 + local_60 + 0x10) != 0) { do { uVar16 = FUN_004170e0(0); iVar10 = (int)((ulonglong)uVar16 >> 0x20); if (*(char *)uVar16 != ' ') { uVar16 = FUN_004170e0(0); iVar10 = (int)((ulonglong)uVar16 >> 0x20); if (*(char *)uVar16 != '\t') break; } pbVar9 = pbVar13; if (0xf < *(uint *)(pbVar13 + 0x14)) { pbVar9 = *(byte **)pbVar13; } iVar14 = iVar10 - (uint)(iVar10 != 0); *(int *)(pbVar13 + 0x10) = iVar14; memmove(pbVar9,pbVar9 + (iVar10 != 0),iVar14 + 1); } while (*(int *)(pbVar13 + 0x10) != 0); pbVar9 = local_6c; } local_60 = local_60 + 0x18; local_58 = (byte *)((int)local_58 + 1); } while (local_58 < (uint)(((int)local_68 - (int)pbVar9) / 0x18)); } local_58 = (byte *)0x0; iVar10 = (int)local_68 - (int)pbVar9 >> 0x1f; if (((int)local_68 - (int)pbVar9) / 0x18 + iVar10 != iVar10) { local_60 = 0; do { uVar7 = *(uint *)(pbVar9 + local_60 + 0x10); pbVar13 = pbVar9 + local_60; if (uVar7 != 0) { do { uVar11 = *(uint *)(pbVar13 + 0x14); pbVar9 = pbVar13; if (0xf < uVar11) { pbVar9 = *(byte **)pbVar13; } if (pbVar9[uVar7 - 1] != 0x20) { pbVar9 = pbVar13; if (0xf < uVar11) { pbVar9 = *(byte **)pbVar13; } if (pbVar9[uVar7 - 1] != 9) break; } uVar1 = uVar7 - 1; if (uVar7 < uVar1) { /* WARNING: Subroutine does not return */ FUN_00499950(); } pbVar9 = pbVar13; if (0xf < uVar11) { pbVar9 = *(byte **)pbVar13; } *(uint *)(pbVar13 + 0x10) = uVar1; pbVar9[uVar1] = pbVar9[uVar7]; uVar7 = *(uint *)(pbVar13 + 0x10); } while (uVar7 != 0); pbVar9 = local_6c; } local_60 = local_60 + 0x18; local_58 = (byte *)((int)local_58 + 1); } while (local_58 < (uint)(((int)local_68 - (int)pbVar9) / 0x18)); } if (*(uint *)(pbVar9 + 0x14) < 0x10) { pbVar13 = pbVar9; } else { pbVar13 = *(byte **)pbVar9; } pbVar8 = pbVar13 + *(int *)(pbVar9 + 0x10); pcVar15 = tolower_exref; if (pbVar13 != pbVar8) { local_60 = 0; local_58 = pbVar8; do { bVar6 = (*pcVar15)((int)(char)*pbVar13); pcVar15 = tolower_exref; pbVar13[local_60] = bVar6; pbVar13 = pbVar13 + 1; } while (pbVar13 != pbVar8); pbVar9 = local_6c; } pbVar13 = pbVar9 + 0x18; if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar13 = *(byte **)pbVar13; } local_58 = pbVar13 + *(int *)(pbVar9 + 0x28); if (pbVar13 != local_58) { local_60 = 0; do { bVar6 = (*pcVar15)((int)(char)*pbVar13); pcVar15 = tolower_exref; *pbVar13 = bVar6; pbVar13 = pbVar13 + 1; } while (pbVar13 != local_58); pbVar9 = local_6c; } pbVar13 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar13 = *(byte **)pbVar9; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x10),(byte *)"player",6); if (bVar6 == 0) { pbVar13 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar13 = *(byte **)pbVar9; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x10),(byte *)"pickup",6); if (bVar6 != 0) { uVar7 = *(uint *)(pbVar9 + 0x2c); pbVar8 = pbVar9 + 0x18; pbVar13 = pbVar8; if (0xf < uVar7) { pbVar13 = *(byte **)pbVar8; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x28),&DAT_00b80fac,4); if (bVar6 == 0) { pbVar13 = pbVar8; if (0xf < uVar7) { pbVar13 = *(byte **)pbVar8; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x28),&DAT_00b80fdc,3); if (bVar6 == 0) { pbVar13 = pbVar8; if (0xf < uVar7) { pbVar13 = *(byte **)pbVar8; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x28),&DAT_00b69f24,4); if (bVar6 == 0) { pbVar13 = pbVar8; if (0xf < uVar7) { pbVar13 = *(byte **)pbVar8; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x28),(byte *)"redheart",8); if (bVar6 == 0) { pbVar13 = pbVar8; if (0xf < uVar7) { pbVar13 = *(byte **)pbVar8; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x28),(byte *)"soulheart",9); if (bVar6 == 0) { pbVar13 = pbVar8; if (0xf < uVar7) { pbVar13 = *(byte **)pbVar8; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x28),(byte *)"blackheart",10); if (bVar6 == 0) { if (0xf < uVar7) { pbVar8 = *(byte **)pbVar8; } iVar10 = atoi((char *)pbVar8); } else { iVar10 = 5; } } else { iVar10 = 4; } } else { iVar10 = 3; } } else { iVar10 = 2; } } else { iVar10 = 1; } } else { iVar10 = 0; } *local_78 = iVar10; *local_8c = *local_8c + 2.0; RichTextIcon::set_icon(1,*local_78); RichTextIcon::get_size(&local_74); *local_80 = local_74 * *local_88 + 4.0 + *local_80; *local_84 = 2; goto LAB_009f1a69; } pbVar13 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar13 = *(byte **)pbVar9; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x10),(byte *)"rooms",5); if (bVar6 != 0) { pbVar13 = pbVar9 + 0x18; if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar13 = *(byte **)pbVar13; } iVar10 = atoi((char *)pbVar13); *local_78 = iVar10; RichTextIcon::set_icon(3,iVar10); RichTextIcon::get_size(&local_74); *local_80 = local_74 + *local_80; *local_84 = 4; goto LAB_009f1a69; } pbVar13 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar13 = *(byte **)pbVar9; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x10),(byte *)"collectible",0xb); if (bVar6 != 0) { pbVar13 = pbVar9 + 0x18; if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar13 = *(byte **)pbVar13; } iVar10 = atoi((char *)pbVar13); *local_78 = iVar10; *local_8c = *local_8c + 2.0; RichTextIcon::set_icon(2,*local_78); RichTextIcon::get_size(&local_74); *local_80 = local_74 * *local_88 + 4.0 + *local_80; *local_84 = 3; goto LAB_009f1a69; } pbVar13 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar13 = *(byte **)pbVar9; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x10),&DAT_00b69770,4); if (bVar6 == 0) { pbVar13 = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { pbVar13 = *(byte **)pbVar9; } bVar6 = str_eq(pbVar13,*(uint *)(pbVar9 + 0x10),(byte *)"color",5); puVar5 = local_70; if (bVar6 != 0) { pbVar13 = pbVar9 + 0x18; local_70 = (undefined4 *)local_70[3]; if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar13 = *(byte **)pbVar13; } argb = strtoul((char *)pbVar13,(char **)0x0,0x10); KColor::SetFromARGB(&local_a4,argb); uVar2 = extraout_EAX[1]; uVar3 = extraout_EAX[2]; uVar4 = extraout_EAX[3]; *puVar5 = *extraout_EAX; puVar5[1] = uVar2; puVar5[2] = uVar3; puVar5[3] = uVar4; puVar5[4] = extraout_EAX[4]; puVar5[3] = (float)local_70 * (float)puVar5[3]; goto LAB_009f1a69; } } else { pbVar13 = pbVar9 + 0x18; pbVar8 = pbVar13; if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar8 = *(byte **)pbVar13; } bVar6 = str_eq(pbVar8,*(uint *)(pbVar9 + 0x28),(byte *)"default",7); if (bVar6 == 0) { if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar13 = *(byte **)pbVar13; } dVar17 = atof((char *)pbVar13); local_58 = (byte *)(float)dVar17; *local_88 = (float)local_58; pbVar9 = local_6c; } else { *local_88 = param_6; } } } else { pbVar13 = pbVar9 + 0x18; if (0xf < *(uint *)(pbVar9 + 0x2c)) { pbVar13 = *(byte **)pbVar13; } iVar10 = atoi((char *)pbVar13); *local_78 = iVar10; *local_8c = *local_8c + 2.0; RichTextIcon::set_icon(0,*local_78); RichTextIcon::get_size(&local_74); *local_80 = local_74 * *local_88 + 4.0 + *local_80; *local_84 = 1; LAB_009f1a69: pbVar9 = local_6c; } local_59 = 1; *local_90 = *local_90 + local_2c + 2; } else { local_59 = 0; } pbVar13 = local_68; if (pbVar9 != (byte *)0x0) { if (pbVar9 != local_68) { do { uVar7 = *(uint *)(pbVar9 + 0x14); if (0xf < uVar7) { pvVar12 = *(void **)pbVar9; uVar11 = uVar7 + 1; ptr = pvVar12; if (0xfff < uVar11) { ptr = *(void **)((int)pvVar12 + -4); uVar11 = uVar7 + 0x24; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)ptr))) goto LAB_009f1b9f; } operator_delete(ptr,uVar11); } pbVar9[0x10] = 0; pbVar9[0x11] = 0; pbVar9[0x12] = 0; pbVar9[0x13] = 0; pbVar9[0x14] = 0xf; pbVar9[0x15] = 0; pbVar9[0x16] = 0; pbVar9[0x17] = 0; *pbVar9 = 0; pbVar9 = pbVar9 + 0x18; } while (pbVar9 != pbVar13); pbVar9 = local_6c; } uVar7 = ((local_64 - (int)pbVar9) / 0x18) * 0x18; pbVar13 = pbVar9; if (0xfff < uVar7) { pbVar13 = *(byte **)(pbVar9 + -4); uVar7 = uVar7 + 0x23; if ((byte *)0x1f < pbVar9 + (-4 - (int)pbVar13)) goto LAB_009f1b9f; } operator_delete(pbVar13,uVar7); local_6c = (byte *)0x0; local_68 = (byte *)0x0; local_64 = 0; } if (0xf < local_28) { uVar7 = local_28 + 1; pvVar12 = local_3c; if (0xfff < uVar7) { pvVar12 = *(void **)((int)local_3c + -4); uVar7 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar12))) goto LAB_009f1b9f; } operator_delete(pvVar12,uVar7); } local_2c = 0; local_28 = 0xf; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar7 = local_40 + 1; pvVar12 = local_54[0]; if (0xfff < uVar7) { pvVar12 = *(void **)((int)local_54[0] + -4); uVar7 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar12))) { LAB_009f1b9f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar7); } ExceptionList = local_1c; return local_59; } //@@ 009f1be0 FUN_009f1be0 void FUN_009f1be0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector::_Emplace_reallocate(puVar1,param_1); return; } uVar2 = *param_1; uVar3 = param_1[2]; uVar4 = param_1[1]; param_1[2] = 0; param_1[1] = 0; *param_1 = 0; *puVar1 = uVar2; puVar1[1] = uVar4; puVar1[2] = uVar3; puVar1[3] = param_1[3]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x10; return; } //@@ 009f1c40 std::vector>::_Tidy /* DB: ? vector of 0x10-byte elements each destroyed with 009f1cb0 std::vector::_Tidy of rich-text segments), i.e. the lines of a rich text; unwind-only callers near rich_text_render */ void std::vector>::_Tidy(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { vector::_Tidy(); pvVar1 = (void *)((int)pvVar1 + 0x10); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = in_ECX[2] - (int)pvVar1 & 0xfffffff0; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009f1cb0 std::vector::_Tidy /* DB: ? vector of 0x40-byte elements each starting with a std::string; used by rich_text_render and Font::measure_rich_text (the parsed rich-text pieces of a line) */ void std::vector::_Tidy(void) { uint size; int *in_ECX; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { string::_Tidy_deallocate(this); this = this + 0x40; } while (this != pcVar1); this = (char *)*in_ECX; } size = in_ECX[2] - (int)this & 0xffffffc0; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 009f1d20 FUN_009f1d20 void FUN_009f1d20(char *param_1,char *param_2) { for (; param_1 != param_2; param_1 = param_1 + 0x40) { std::string::_Tidy_deallocate(param_1); } return; } //@@ 009f1d50 FUN_009f1d50 void FUN_009f1d50(void *param_1,int param_2) { void *ptr; uint size; size = param_2 * 0x40; ptr = param_1; if (0xfff < size) { ptr = *(void **)((int)param_1 + -4); size = size + 0x23; if (0x1f < (uint)((int)param_1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); return; } //@@ 009f1d90 std::vector::_Emplace_reallocate /* DB: ? 16-byte elements = moved 3-dword vector + 1 dword (a line holding its span vector), 1.5x growth (Xlen 0x0fffffff), relocates with FUN_009f2410, destroys old with FUN_009f1cb0; rich_text_layout and its push_back FUN_009f1be0 */ undefined4 * std::vector::_Emplace_reallocate(int param_1,undefined4 *param_2) { uint uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int iVar5; undefined4 *puVar6; undefined4 *puVar7; int *in_ECX; uint uVar8; uint uVar9; void *pvVar10; void *pvVar11; undefined4 *puVar12; int iVar13; iVar13 = *in_ECX; iVar5 = in_ECX[1] - iVar13 >> 4; if (iVar5 == 0xfffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar5 + 1; uVar8 = in_ECX[2] - iVar13 >> 4; if (0xfffffff - (uVar8 >> 1) < uVar8) { uVar9 = 0xfffffff; } else { uVar8 = (uVar8 >> 1) + uVar8; uVar9 = uVar1; if (uVar1 <= uVar8) { uVar9 = uVar8; } if (0xfffffff < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar6 = _Allocate(uVar9 * 0x10); puVar7 = (undefined4 *)((int)puVar6 + (param_1 - iVar13 & 0xfffffff0U)); uVar2 = param_2[2]; uVar3 = param_2[1]; uVar4 = *param_2; param_2[2] = 0; param_2[1] = 0; *param_2 = 0; *puVar7 = uVar4; puVar7[1] = uVar3; puVar7[2] = uVar2; puVar7[3] = param_2[3]; iVar13 = *in_ECX; puVar12 = puVar6; if (param_1 != in_ECX[1]) { FUN_009f2410(puVar6,iVar13); puVar12 = puVar7 + 4; } FUN_009f2410(puVar12,iVar13); pvVar10 = (void *)*in_ECX; if (pvVar10 != (void *)0x0) { pvVar11 = (void *)in_ECX[1]; if (pvVar10 != pvVar11) { do { vector::_Tidy(); pvVar10 = (void *)((int)pvVar10 + 0x10); } while (pvVar10 != pvVar11); pvVar10 = (void *)*in_ECX; } uVar8 = in_ECX[2] - (int)pvVar10 & 0xfffffff0; pvVar11 = pvVar10; if (0xfff < uVar8) { pvVar11 = *(void **)((int)pvVar10 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar8); } *in_ECX = (int)puVar6; in_ECX[1] = (int)(puVar6 + uVar1 * 4); in_ECX[2] = (int)(puVar6 + uVar9 * 4); return puVar7; } //@@ 009f1ef0 RichTextSpan::move_construct /* DB: ? dest in EDX, src param: moves a 0x40-byte span = std::string text (+0..+0x17, src reset to empty SSO) followed by 10 dwords (style: color +0x20..+0x2c, scale +0x34, +0x38, +0x3c); used by the two span-vector reallocators and rich_text_layout push prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl RichTextSpan::move_construct(void *dest,void *source) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; *(undefined4 *)dest = 0; *(undefined4 *)((int)dest + 0x10) = 0; *(undefined4 *)((int)dest + 0x14) = 0; uVar1 = *(undefined4 *)((int)source + 4); uVar2 = *(undefined4 *)((int)source + 8); uVar3 = *(undefined4 *)((int)source + 0xc); *(undefined4 *)dest = *(undefined4 *)source; *(undefined4 *)((int)dest + 4) = uVar1; *(undefined4 *)((int)dest + 8) = uVar2; *(undefined4 *)((int)dest + 0xc) = uVar3; *(undefined8 *)((int)dest + 0x10) = *(undefined8 *)((int)source + 0x10); *(undefined4 *)((int)source + 0x10) = 0; *(undefined4 *)((int)source + 0x14) = 0xf; *(undefined1 *)source = 0; uVar1 = *(undefined4 *)((int)source + 0x1c); *(undefined4 *)((int)dest + 0x18) = *(undefined4 *)((int)source + 0x18); *(undefined4 *)((int)dest + 0x1c) = uVar1; *(undefined4 *)((int)dest + 0x20) = *(undefined4 *)((int)source + 0x20); *(undefined4 *)((int)dest + 0x24) = *(undefined4 *)((int)source + 0x24); *(undefined4 *)((int)dest + 0x28) = *(undefined4 *)((int)source + 0x28); *(undefined4 *)((int)dest + 0x2c) = *(undefined4 *)((int)source + 0x2c); *(undefined4 *)((int)dest + 0x30) = *(undefined4 *)((int)source + 0x30); *(undefined4 *)((int)dest + 0x34) = *(undefined4 *)((int)source + 0x34); *(undefined4 *)((int)dest + 0x38) = *(undefined4 *)((int)source + 0x38); *(undefined4 *)((int)dest + 0x3c) = *(undefined4 *)((int)source + 0x3c); return; } //@@ 009f1f70 std::vector::_Emplace_reallocate /* DB: ? same as 009f2150 std::vector::_Emplace_reallocate_copy move-constructs the new 0x40-byte span (009f1ef0); rich_text_layout */ void * std::vector::_Emplace_reallocate(void *param_1,void *param_2) { void *dest; int iVar1; int iVar2; uint uVar3; void *pvVar4; int *in_ECX; uint uVar5; int extraout_EDX; void *dest_00; void *pvVar6; void *source; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10070; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; iVar2 = in_ECX[1] - iVar1 >> 6; if (iVar2 == 0x3ffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar3 = iVar2 + 1; uVar5 = in_ECX[2] - iVar1 >> 6; if (0x3ffffff - (uVar5 >> 1) < uVar5) { local_20 = 0x3ffffff; } else { uVar5 = (uVar5 >> 1) + uVar5; local_20 = uVar3; if (uVar3 <= uVar5) { local_20 = uVar5; } if (0x3ffffff < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar4 = _Allocate(local_20 << 6); local_8 = 0; dest = (void *)(((int)param_1 - iVar1 & 0xffffffc0U) + (int)pvVar4); RichTextSpan::move_construct(dest,param_2); pvVar6 = (void *)in_ECX[1]; source = (void *)*in_ECX; if (param_1 == pvVar6) { _Uninitialized_copy(source,pvVar6,pvVar4); } else { dest_00 = pvVar4; if (source != param_1) { do { RichTextSpan::move_construct(dest_00,source); source = (void *)((int)source + 0x40); dest_00 = (void *)(extraout_EDX + 0x40); } while (source != param_1); pvVar6 = (void *)in_ECX[1]; } if (param_1 != pvVar6) { iVar1 = 0x40 - (int)param_1; do { RichTextSpan::move_construct((void *)((int)dest + iVar1 + (int)param_1),param_1); param_1 = (void *)((int)param_1 + 0x40); } while (param_1 != pvVar6); } } _Change_array(pvVar4,uVar3,local_20); ExceptionList = local_10; return dest; } //@@ 009f20c7 Catch_All@009f20c7 void Catch_All_009f20c7(void) { int unaff_EBP; FUN_009f1d20(*(undefined4 *)(unaff_EBP + 0xc),*(undefined4 *)(unaff_EBP + -0x24)); FUN_009f1d50(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + -0x1c)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009f20f0 FUN_009f20f0 void FUN_009f20f0(void *param_1) { undefined4 uVar1; char *in_EDX; std::string::string(in_EDX,param_1); uVar1 = *(undefined4 *)((int)param_1 + 0x1c); *(undefined4 *)(in_EDX + 0x18) = *(undefined4 *)((int)param_1 + 0x18); *(undefined4 *)(in_EDX + 0x1c) = uVar1; *(undefined4 *)(in_EDX + 0x20) = *(undefined4 *)((int)param_1 + 0x20); *(undefined4 *)(in_EDX + 0x24) = *(undefined4 *)((int)param_1 + 0x24); *(undefined4 *)(in_EDX + 0x28) = *(undefined4 *)((int)param_1 + 0x28); *(undefined4 *)(in_EDX + 0x2c) = *(undefined4 *)((int)param_1 + 0x2c); *(undefined4 *)(in_EDX + 0x30) = *(undefined4 *)((int)param_1 + 0x30); *(undefined4 *)(in_EDX + 0x34) = *(undefined4 *)((int)param_1 + 0x34); *(undefined4 *)(in_EDX + 0x38) = *(undefined4 *)((int)param_1 + 0x38); *(undefined4 *)(in_EDX + 0x3c) = *(undefined4 *)((int)param_1 + 0x3c); return; } //@@ 009f2150 std::vector::_Emplace_reallocate_copy /* DB: ? vector of 0x40-byte rich-text spans: grows 1.5x (Xlen at 0x3ffffff), copy-constructs the new span (FUN_009f20f0), moves the others with RichTextSpan::move_construct 009f1ef0, returns the new element; rich_text_layout when the line vector is full */ int std::vector::_Emplace_reallocate_copy(void *param_1,undefined4 param_2) { int iVar1; uint uVar2; void *pvVar3; int *in_ECX; uint uVar4; int extraout_EDX; void *dest; int iVar5; void *pvVar6; void *source; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10090; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = *in_ECX; iVar1 = in_ECX[1] - iVar5 >> 6; if (iVar1 == 0x3ffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = iVar1 + 1; uVar4 = in_ECX[2] - iVar5 >> 6; if (0x3ffffff - (uVar4 >> 1) < uVar4) { local_20 = 0x3ffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; local_20 = uVar2; if (uVar2 <= uVar4) { local_20 = uVar4; } if (0x3ffffff < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar3 = _Allocate(local_20 << 6); iVar5 = ((int)param_1 - iVar5 & 0xffffffc0U) + (int)pvVar3; local_8 = 0; FUN_009f20f0(param_2); pvVar6 = (void *)in_ECX[1]; source = (void *)*in_ECX; if (param_1 == pvVar6) { _Uninitialized_copy(source,pvVar6,pvVar3); } else { dest = pvVar3; if (source != param_1) { do { RichTextSpan::move_construct(dest,source); source = (void *)((int)source + 0x40); dest = (void *)(extraout_EDX + 0x40); } while (source != param_1); pvVar6 = (void *)in_ECX[1]; } if (param_1 != pvVar6) { iVar1 = (iVar5 + 0x40) - (int)param_1; do { RichTextSpan::move_construct((void *)(iVar1 + (int)param_1),param_1); param_1 = (void *)((int)param_1 + 0x40); } while (param_1 != pvVar6); } } _Change_array(pvVar3,uVar2,local_20); ExceptionList = local_10; return iVar5; } //@@ 009f229d Catch_All@009f229d void Catch_All_009f229d(void) { int unaff_EBP; FUN_009f1d20(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x2c)); FUN_009f1d50(*(undefined4 *)(unaff_EBP + 8),*(undefined4 *)(unaff_EBP + -0x1c)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 009f22d0 std::vector::_Change_array /* DB: destroys 0x40-byte spans (string), frees, installs new buffer; _Emplace_reallocate(_copy) */ void std::vector::_Change_array(int param_1,int param_2,int param_3) { uint size; int *in_ECX; char *this; char *pcVar1; this = (char *)*in_ECX; if (this != (char *)0x0) { pcVar1 = (char *)in_ECX[1]; if (this != pcVar1) { do { string::_Tidy_deallocate(this); this = this + 0x40; } while (this != pcVar1); this = (char *)*in_ECX; } size = in_ECX[2] - (int)this & 0xffffffc0; pcVar1 = this; if (0xfff < size) { pcVar1 = *(char **)(this + -4); size = size + 0x23; if ((char *)0x1f < this + (-4 - (int)pcVar1)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar1,size); } *in_ECX = param_1; in_ECX[1] = param_2 * 0x40 + param_1; in_ECX[2] = param_3 * 0x40 + param_1; return; } //@@ 009f2350 std::_Uninitialized_copy /* DB: copies 0x40-byte RichTextSpan (std::string + 10 dwords); std::vector::_Emplace_reallocate(_copy) */ void std::_Uninitialized_copy(undefined4 *param_1,undefined4 *param_2,char *param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 *puVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b100bd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (param_1 != param_2) { puVar3 = param_1 + 10; do { string::string(param_3,puVar3 + -10); uVar2 = puVar3[-3]; *(undefined4 *)(param_3 + 0x18) = puVar3[-4]; *(undefined4 *)(param_3 + 0x1c) = uVar2; *(undefined4 *)(param_3 + 0x20) = puVar3[-2]; *(undefined4 *)(param_3 + 0x24) = puVar3[-1]; *(undefined4 *)(param_3 + 0x28) = *puVar3; *(undefined4 *)(param_3 + 0x2c) = puVar3[1]; *(undefined4 *)(param_3 + 0x30) = puVar3[2]; *(undefined4 *)(param_3 + 0x34) = puVar3[3]; *(undefined4 *)(param_3 + 0x38) = puVar3[4]; *(undefined4 *)(param_3 + 0x3c) = puVar3[5]; param_3 = param_3 + 0x40; puVar1 = puVar3 + 6; puVar3 = puVar3 + 0x10; } while (puVar1 != param_2); } ExceptionList = local_10; return; } //@@ 009f2410 FUN_009f2410 undefined4 * FUN_009f2410(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar5; undefined4 *puVar6; puVar6 = param_1; if (in_ECX != in_EDX) { puVar5 = in_ECX + 1; do { uVar2 = *puVar5; uVar3 = puVar5[1]; uVar4 = puVar5[-1]; puVar5[1] = 0; *puVar5 = 0; puVar5[-1] = 0; *(undefined4 *)((int)param_1 + (-0x10 - (int)in_ECX) + (int)(puVar5 + 4)) = uVar2; *puVar6 = uVar4; puVar6[2] = uVar3; puVar6[3] = puVar5[2]; puVar1 = puVar5 + 3; puVar6 = puVar6 + 4; puVar5 = puVar5 + 4; } while (puVar1 != in_EDX); } return puVar6; } //@@ 009f2480 FUN_009f2480 void FUN_009f2480(void) { char *pcVar1; undefined4 *in_ECX; char *this; pcVar1 = (char *)in_ECX[1]; for (this = (char *)*in_ECX; this != pcVar1; this = this + 0x40) { std::string::_Tidy_deallocate(this); } return; } //@@ 009f24b0 RichTextIcon::render /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall (pos, type, id, ..): RichTextIcon::set_icon(type,id), type 2 renders the collectible image scaled to the line height +4 (*1.5) with white KColor, else renders the ANM2 frame; rich_text_render cases for inline icons */ void RichTextIcon::render(float *param_1,int param_2,int param_3,float param_4) { char *this; float *pfVar1; int *piVar2; undefined *puVar3; ColorMod *color; undefined4 *puVar4; ColorMod *color_00; int layerId; ANM2 *in_ECX; uint size; float fVar5; undefined1 auStackY_1a8 [128]; void *pvVar6; float *image; void *pvVar7; void *imageRefCount; undefined1 local_110 [112]; float local_a0; float fStack_9c; float fStack_98; float fStack_94; float local_90; float fStack_8c; float fStack_88; float fStack_84; undefined8 local_80; float local_78; KColor local_74; Vector local_60; char *local_58; float *local_54; Color local_50; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; puStack_20 = (undefined1 *)(&local_50)[1]._offset; local_14 = -NAN; puStack_18 = &LAB_00b100ed; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((&local_50)[1]._colorize + 1); ExceptionList = &local_1c; local_54 = param_1; set_icon(); if (param_2 == 2) { this = in_ECX[1]._filename._buf + 0xc; pvVar6 = (void *)0x9f2522; local_58 = this; piVar2 = map_int_ImagePtr_subscript(this,¶m_3); if (*piVar2 != 0) { puVar3 = &g_shaders; if ((DAT_00c7911c & 1) == 0) { puVar3 = g_currentShader; } g_currentShader = puVar3; if (0.0 < *(float *)in_ECX[1]._filename._buf) { pvVar6 = (void *)0x9f2563; piVar2 = map_int_ImagePtr_subscript(this,¶m_3); fVar5 = (float)((double)*(int *)(*piVar2 + 0x14) + __uint_to_double_fixup[-(*(int *)(*piVar2 + 0x14) >> 0x1f)]); if (*(float *)in_ECX[1]._filename._buf <= fVar5 && fVar5 != *(float *)in_ECX[1]._filename._buf) { piVar2 = map_int_ImagePtr_subscript(this,¶m_3); local_60.y = (*(float *)in_ECX[1]._filename._buf / (float)((double)*(int *)(*piVar2 + 0x14) + __uint_to_double_fixup[-(*(int *)(*piVar2 + 0x14) >> 0x1f)])) * 1.5; KColor::SetFromARGB(&local_74,0xffffffff); piVar2 = map_int_ImagePtr_subscript(this,¶m_3); pfVar1 = local_54; local_54 = (float *)((float)((double)*(int *)(*piVar2 + 0x14) + __uint_to_double_fixup[-(*(int *)(*piVar2 + 0x14) >> 0x1f)]) * local_60.y + local_54[1]); piVar2 = map_int_ImagePtr_subscript(this,¶m_3); fVar5 = *pfVar1; image = local_54; render_quad_set_uniform_color (local_110,fVar5,pfVar1[1], (float)((double)*(int *)(*piVar2 + 0x10) + __uint_to_double_fixup[-(*(int *)(*piVar2 + 0x10) >> 0x1f)]) * local_60.y + fVar5,(float)local_54,&local_74); pvVar7 = (void *)0x9f266e; Color::Color(&local_50); pvVar6 = map_int_ImagePtr_subscript(local_58,¶m_3); KAGE::SmartPointer::operator_assign(auStackY_1a8 + 0x84,pvVar6); apply_sprite_shader_params(color,1,image,pvVar7); puVar4 = map_int_ImagePtr_subscript(local_58,¶m_3); local_74._unk = 0; local_74._red = 1.0; local_74._green = 1.0; local_74._blue = 1.0; local_74._alpha = param_4; (**(code **)(*(int *)*puVar4 + 0x1c))(); ExceptionList = local_1c; return; } } imageRefCount = (void *)0x9f26e3; Color::Color(&local_50); pvVar7 = map_int_ImagePtr_subscript(local_58,¶m_3); KAGE::SmartPointer::operator_assign(auStackY_1a8 + 0x84,pvVar7); apply_sprite_shader_params(color_00,1,pvVar6,imageRefCount); puVar4 = map_int_ImagePtr_subscript(local_58,¶m_3); local_74._unk = 0; local_74._red = 1.0; local_74._green = 1.0; local_74._blue = 1.0; local_74._alpha = param_4; (**(code **)(*(int *)*puVar4 + 0x20))(); } } else { get_animation_name(); local_14 = 0.0; piVar2 = (int *)ANM2::get_layer_by_string(); if (piVar2 != (int *)0x0) { if ((int *)*piVar2 == (int *)0x0) { layerId = -1; } else { layerId = *(int *)*piVar2; } pvVar6 = AnimationState::GetLayerFrame(&in_ECX->_animState,layerId); fVar5 = *(float *)in_ECX[1]._filename._buf; local_60.y = 0.0; if ((0.0 < fVar5) && (fVar5 < *(float *)((int)pvVar6 + 0xc))) { fVar5 = fVar5 / *(float *)((int)pvVar6 + 0xc); (in_ECX->_scale).x = fVar5; (in_ECX->_scale).y = fVar5; } local_74._unk = 0; local_74._red = 1.0; local_74._green = 1.0; local_74._blue = 1.0; local_74._alpha = param_4; Color::Color(); if (&in_ECX->_color != (ColorMod *)&local_a0) { (in_ECX->_color)._tint[0] = local_a0; (in_ECX->_color)._tint[1] = fStack_9c; (in_ECX->_color)._tint[2] = fStack_98; (in_ECX->_color)._tint[3] = fStack_94; (in_ECX->_color)._colorize[0] = local_90; (in_ECX->_color)._colorize[1] = fStack_8c; (in_ECX->_color)._colorize[2] = fStack_88; (in_ECX->_color)._colorize[3] = fStack_84; *(undefined8 *)(in_ECX->_color)._offset = local_80; (in_ECX->_color)._offset[2] = local_78; } local_60.x = *local_54 + local_60.y; local_60.y = local_54[1] + local_60.y; ANM2::Render(in_ECX,&local_60,&g_vectorZero,&g_vectorZero); } if (0xf < (uint)local_50._offset[2]) { size = (int)local_50._offset[2] + 1; pvVar6 = (void *)local_50._colorize[1]; if (0xfff < size) { pvVar6 = *(void **)((int)local_50._colorize[1] + -4); size = (int)local_50._offset[2] + 0x24; if (0x1f < (uint)((int)local_50._colorize[1] + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,size); } } ExceptionList = local_1c; return; } //@@ 009f28b0 RichTextIcon::get_size /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall, returns Vector into param_1: type 2 (+0x118) -> collectible image width/height (+0x10/+0x14) scaled to the max height +0x114 (*1.5); else from the current animation frame; rich_text_parse_icon_tag advances the cursor by its x */ float * RichTextIcon::get_size(float *param_1) { float fVar1; float fVar2; double dVar3; int *piVar4; int *piVar5; int iVar6; void *pvVar7; int in_ECX; uint size; float fVar8; float fVar9; void *local_30 [4]; undefined4 local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00af85cd; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; param_1[1] = 0.0; *param_1 = 0.0; if (*(int *)(in_ECX + 0x118) == 2) { piVar5 = (int *)(in_ECX + 0x11c); piVar4 = map_int_ImagePtr_subscript((void *)(in_ECX + 0x120),piVar5); if (*piVar4 == 0) { ExceptionList = local_10; return param_1; } piVar4 = map_int_ImagePtr_subscript((void *)(in_ECX + 0x120),piVar5); iVar6 = *(int *)(*piVar4 + 0x14); dVar3 = __uint_to_double_fixup[-(iVar6 >> 0x1f)]; piVar4 = map_int_ImagePtr_subscript((void *)(in_ECX + 0x120),piVar5); *param_1 = (float)((double)*(int *)(*piVar4 + 0x10) + __uint_to_double_fixup[-(*(int *)(*piVar4 + 0x10) >> 0x1f)]); param_1[1] = (float)((double)iVar6 + dVar3); if (*(float *)(in_ECX + 0x114) <= 0.0) { ExceptionList = local_10; return param_1; } piVar4 = map_int_ImagePtr_subscript((void *)(in_ECX + 0x120),piVar5); fVar8 = (float)((double)*(int *)(*piVar4 + 0x14) + __uint_to_double_fixup[-(*(int *)(*piVar4 + 0x14) >> 0x1f)]); if (fVar8 < *(float *)(in_ECX + 0x114) || fVar8 == *(float *)(in_ECX + 0x114)) { ExceptionList = local_10; return param_1; } piVar5 = map_int_ImagePtr_subscript((void *)(in_ECX + 0x120),piVar5); fVar8 = (*(float *)(in_ECX + 0x114) / (float)((double)*(int *)(*piVar5 + 0x14) + __uint_to_double_fixup[-(*(int *)(*piVar5 + 0x14) >> 0x1f)])) * 1.5; fVar9 = fVar8 * param_1[1]; *param_1 = fVar8 * *param_1; } else { if (*(void **)(in_ECX + 0x34) == (void *)0x0) { local_1c = 0xf; local_20 = 0; local_30[0] = (void *)0x0; } else { std::string::string((char *)local_30,*(void **)(in_ECX + 0x34)); } local_8 = (void *)0x0; piVar5 = (int *)ANM2::get_layer_by_string(); local_8 = (void *)0xffffffff; if (0xf < local_1c) { size = local_1c + 1; pvVar7 = local_30[0]; if (0xfff < size) { pvVar7 = *(void **)((int)local_30[0] + -4); size = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,size); } if (piVar5 == (int *)0x0) { ExceptionList = local_10; return param_1; } if ((int *)*piVar5 == (int *)0x0) { iVar6 = -1; } else { iVar6 = *(int *)*piVar5; } pvVar7 = AnimationState::GetLayerFrame((AnimationState *)(in_ECX + 0x30),iVar6); fVar8 = *(float *)((int)pvVar7 + 8); *param_1 = fVar8; fVar1 = *(float *)((int)pvVar7 + 0xc); param_1[1] = fVar1; fVar2 = *(float *)(in_ECX + 0x114); if (fVar2 <= 0.0) { ExceptionList = local_10; return param_1; } if (fVar1 <= fVar2) { ExceptionList = local_10; return param_1; } fVar9 = fVar1 * (fVar2 / fVar1); *param_1 = fVar8 * (fVar2 / fVar1); } param_1[1] = fVar9; ExceptionList = local_10; return param_1; } //@@ 009f2b10 RichTextIcon::get_animation_name /* DB: own log string "Invalid icon type (%d) for get_animation_name()": type 0 "players", 1 "pickups", 3 "rooms"; RichTextIcon::render/set_icon */ undefined4 * RichTextIcon::get_animation_name(undefined4 *param_1,int param_2) { if (param_2 == 0) { *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; param_1[4] = 7; memmove(param_1,"players",7); *(undefined1 *)((int)param_1 + 7) = 0; return param_1; } if (param_2 == 1) { *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; param_1[4] = 7; memmove(param_1,"pickups",7); *(undefined1 *)((int)param_1 + 7) = 0; return param_1; } if (param_2 == 3) { *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; param_1[4] = 5; memmove(param_1,"rooms",5); *(undefined1 *)((int)param_1 + 5) = 0; return param_1; } KAGE_LogMessage(8,(byte *)"Invalid icon type (%d) for get_animation_name() \n"); *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; param_1[4] = 0; *(undefined1 *)param_1 = 0; return param_1; } //@@ 009f2c10 RichTextIcon::set_icon /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall on an ANM2-based icon (type, id): type 2 = collectible -> stores type at +0x118, loads the item's gfx (ItemConfig::GetCollectible, Manager::LoadImage) into the image slot +0x11c; other types SetAnimation(FUN_009f2b10(type)) + frame by id, "Invalid icon id (%d) for Icon Type %d"; rich_text_parse_icon_tag, rich_text icon render 009f24b0 RichTextIcon::render void RichTextIcon::set_icon(int param_1,int param_2) { byte *pbVar1; ANM2 *pAVar2; Manager *pMVar3; byte bVar4; char cVar5; byte *anim; byte *pbVar6; uint uVar7; ItemConfig_Item *pIVar8; int *piVar9; std_string *path; void *pvVar10; void *this; ANM2 *in_ECX; byte *pbVar11; int iVar12; bool bVar13; undefined1 local_34 [4]; int *local_30; void *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; iVar12 = param_2; pMVar3 = g_manager; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b10135; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; if (param_1 == 2) { pAVar2 = in_ECX + 1; (pAVar2->_filename)._buf[4] = '\x02'; (pAVar2->_filename)._buf[5] = '\0'; (pAVar2->_filename)._buf[6] = '\0'; (pAVar2->_filename)._buf[7] = '\0'; pIVar8 = ItemConfig::GetCollectible(&pMVar3->_itemConfig,param_2); if (pIVar8 != (ItemConfig_Item *)0x0) { piVar9 = map_int_ImagePtr_subscript(in_ECX[1]._filename._buf + 0xc,¶m_2); if (*piVar9 == 0) { path = &pIVar8->gfxFilename; if (0xf < (pIVar8->gfxFilename)._capacity) { path = *(std_string **)path->_buf; } pvVar10 = Manager::LoadImage(local_34,(byte *)path); local_8 = (void *)0x1; this = map_int_ImagePtr_subscript(in_ECX[1]._filename._buf + 0xc,¶m_2); KAGE::SmartPointer::operator_assign(this,pvVar10); local_8 = (void *)0x2; if (local_30 != (int *)0x0) { cVar5 = (**(code **)(*local_30 + 0xc))(); if ((cVar5 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_34); } } } LAB_009f2dec: iVar12 = param_2; } LAB_009f2def: *(int *)(in_ECX[1]._filename._buf + 8) = iVar12; } else { anim = (byte *)get_animation_name(local_2c,param_1); local_8 = (void *)0x0; if (0xf < *(uint *)(anim + 0x14)) { anim = *(byte **)anim; } pbVar1 = (in_ECX->_animState)._animData; if (pbVar1 == (byte *)0x0) { LAB_009f2caa: bVar4 = ANM2::SetAnimation(in_ECX,anim,1); if (bVar4 != 0) { AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } } else { pbVar6 = pbVar1; if (0xf < *(uint *)(pbVar1 + 0x14)) { pbVar6 = *(byte **)pbVar1; } pbVar11 = anim; do { bVar4 = *pbVar6; bVar13 = bVar4 < *pbVar11; if (bVar4 != *pbVar11) { LAB_009f2c97: uVar7 = -(uint)bVar13 | 1; goto LAB_009f2c9c; } if (bVar4 == 0) break; bVar4 = pbVar6[1]; bVar13 = bVar4 < pbVar11[1]; if (bVar4 != pbVar11[1]) goto LAB_009f2c97; pbVar6 = pbVar6 + 2; pbVar11 = pbVar11 + 2; } while (bVar4 != 0); uVar7 = 0; LAB_009f2c9c: if ((uVar7 != 0) || ((pbVar1[0x34] != 0 && ((in_ECX->_animState)._isPlaying == 0)))) goto LAB_009f2caa; } local_8 = (void *)0xffffffff; if (0xf < local_18) { uVar7 = local_18 + 1; pvVar10 = local_2c[0]; if (0xfff < uVar7) { pvVar10 = *(void **)((int)local_2c[0] + -4); uVar7 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar7); } *(int *)(in_ECX[1]._filename._buf + 4) = param_1; if (-1 < param_2) { pvVar10 = (in_ECX->_animState)._animData; if (pvVar10 == (void *)0x0) { iVar12 = 0; } else { iVar12 = *(int *)((int)pvVar10 + 0x30); } if (param_2 <= iVar12) { iVar12 = param_2; if (pvVar10 != (void *)0x0) { AnimationState::SetFrameFloat(&in_ECX->_animState,(float)param_2); goto LAB_009f2dec; } goto LAB_009f2def; } } KAGE_LogMessage(8,(byte *)"Invalid icon id (%d) for Icon Type %d \n"); } ExceptionList = local_10; return; } //@@ 009f2e20 map_int_ImagePtr_subscript /* DB: std::map::operator[]: set::find_node, inserts 0x1c-byte node with zeroed 2-dword value, returns &value (+0x14); RichTextIcon::set_icon caches collectible images by id (Manager::LoadImage + SmartPointer::operator_assign into it) prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall map_int_ImagePtr_subscript(void *this,int *key) { undefined4 uVar1; uint uVar2; undefined4 *newNode; void *local_24; int local_20; void *local_1c; void *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1016d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; std::set::find_node(&local_24,key); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*key < *(int *)((int)local_1c + 0x10))) { if (*(int *)((int)this + 4) == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *(undefined4 *)this; local_8 = 0; local_14 = 0; local_18 = this; newNode = operator_new(0x1c); newNode[4] = *key; newNode[5] = 0; newNode[6] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(this,local_24,local_20,newNode); } ExceptionList = local_10; return (void *)((int)local_1c + 0x14); } //@@ 009f2ee0 VideoPlayer::play /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? ECX = video player (Cutscene object +0x5c, caller 0095fac0 passes the path +0x40 and volume in xmm2); copies path, checks ".ogv", ModManager::TryRedirectPath, opens clip (FUN_00a62910), clamps volume into clip +0x48, restarts/plays via clip vtable +0x1c/+0x18; sibling VideoPlayer::unload 00a62880 VideoPlayer::unload void VideoPlayer::play(char *param_1) { char cVar1; byte bVar2; int iVar3; Manager *pMVar4; undefined4 *extraout_EAX; undefined4 *puVar5; int in_ECX; byte *pbVar6; void *pvVar7; int iVar8; char *pcVar9; uint uVar10; float in_XMM2_Da; void *local_c4 [4]; uint local_b4; uint local_b0; void *local_ac [4]; uint local_9c; uint local_98; byte local_94 [128]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b101ab; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_94 + 0x90); ExceptionList = &local_10; pcVar9 = param_1; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; pcVar9[(int)local_ac + (0x17 - (int)param_1)] = cVar1; } while (cVar1 != '\0'); strstr((char *)local_94,".ogv"); pMVar4 = g_manager; pbVar6 = local_94; local_9c = 0; local_98 = 0xf; local_ac[0] = (void *)0x0; do { bVar2 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar2 != 0); std::string::assign((char *)local_ac,local_94,(int)pbVar6 - (int)(local_94 + 1)); local_8 = 0; ModManager::TryRedirectPath(&pMVar4->_modManager,(std_string *)local_c4,(std_string *)local_ac); local_8._0_1_ = 1; puVar5 = extraout_EAX; if (0xf < (uint)extraout_EAX[5]) { puVar5 = (undefined4 *)*extraout_EAX; } FUN_00a62910(puVar5); local_8 = (uint)local_8._1_3_ << 8; if (0xf < local_b0) { uVar10 = local_b0 + 1; pvVar7 = local_c4[0]; if (0xfff < uVar10) { pvVar7 = *(void **)((int)local_c4[0] + -4); uVar10 = local_b0 + 0x24; if (0x1f < (uint)((int)local_c4[0] + (-4 - (int)pvVar7))) goto LAB_009f3050; } operator_delete(pvVar7,uVar10); } local_8 = -1; local_b4 = 0; local_b0 = 0xf; local_c4[0] = (void *)((uint)local_c4[0] & 0xffffff00); if (0xf < local_98) { uVar10 = local_98 + 1; pvVar7 = local_ac[0]; if (0xfff < uVar10) { pvVar7 = *(void **)((int)local_ac[0] + -4); uVar10 = local_98 + 0x24; if (0x1f < (uint)((int)local_ac[0] + (-4 - (int)pvVar7))) { LAB_009f3050: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar10); } iVar3 = *(int *)(in_ECX + 4); if (iVar3 != 0) { if (in_XMM2_Da < 1.0) { if (0.0 < in_XMM2_Da) { *(float *)(iVar3 + 0x48) = in_XMM2_Da; } else { *(undefined4 *)(iVar3 + 0x48) = 0; } } else { *(undefined4 *)(iVar3 + 0x48) = 0x3f800000; } } iVar3 = *(int *)(in_ECX + 4); if (iVar3 != 0) { (**(code **)(**(int **)(iVar3 + 0x28) + 0x1c))(); FUN_00aaaa90(); *(undefined4 *)(iVar3 + 0x98) = 0; *(undefined4 *)(iVar3 + 0x94) = 0; iVar8 = (int)(*(float *)(iVar3 + 0x70) * 0.0); if (iVar8 < 0) { iVar8 = 0; } else if (*(int *)(iVar3 + 0x6c) < iVar8) { iVar8 = *(int *)(iVar3 + 0x6c); } *(int *)(iVar3 + 0x88) = iVar8; *(undefined1 *)(iVar3 + 0x90) = 0; *(undefined1 *)(iVar3 + 0x74) = 0; *(undefined1 *)(in_ECX + 0x10) = 0; if (*(int *)(in_ECX + 4) != 0) { (**(code **)(**(int **)(*(int *)(in_ECX + 4) + 0x28) + 0x18))(); *(undefined1 *)(in_ECX + 0x10) = 1; } } ExceptionList = local_10; return; } //@@ 009f3130 Weapon::GetMaxCharge /* ZHL [exact] float GetMaxCharge(); */ float10 Weapon::GetMaxCharge(void) { return (float10)0; } //@@ 009f3140 Weapon::GetFocusEntity /* ZHL [vtable slot 9] */ undefined4 __thiscall Weapon::GetFocusEntity(void) { return 0; } //@@ 009f3150 Weapon::GetMainEntity /* ZHL [exact] Entity* GetMainEntity(); */ undefined4 Weapon::GetMainEntity(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x44); } //@@ 009f3160 Weapon_Brimstone::GetMainEntity /* ZHL [vtable slot 10] */ EntityPtr __thiscall Weapon_Brimstone::GetMainEntity(Weapon_Brimstone *this) { return this->_mainLaser; } //@@ 009f3170 Weapon_UrnOfSouls::GetMainEntity /* DB: vtable slot 10 of Weapon_UrnOfSouls; slot name from Weapon */ undefined4 Weapon_UrnOfSouls::GetMainEntity(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x4c); } //@@ 009f3180 FUN_009f3180 void FUN_009f3180(void) { uint uVar1; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b101f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = (int)IsaacRepentancePlus::Weapon::vftable; in_ECX[2] = 0; local_8 = 0; in_ECX[6] = 0x3f800000; in_ECX[9] = 0; in_ECX[8] = 0; in_ECX[0xb] = 0; in_ECX[10] = 0; in_ECX[0x10] = 0; in_ECX[0xf] = 0; in_ECX[0xc] = 0; if (*(code **)(*in_ECX + 0x14) == Weapon::ClearReferences) { Weapon::ClearReferences(); } else { (**(code **)(*in_ECX + 0x14))(uVar1); } in_ECX[7] = 0; in_ECX[3] = 0; in_ECX[4] = 0x41200000; in_ECX[5] = 0; in_ECX[6] = 0x3f800000; in_ECX[0xe] = 0; in_ECX[8] = (int)g_vectorZero.x; in_ECX[9] = (int)g_vectorZero.y; ExceptionList = local_10; return; } //@@ 009f3260 std::basic_stringbuf,std::allocator_>::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::basic_stringbuf,class std::allocator >::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::basic_stringbuf,std::allocator_>:: _scalar_deleting_destructor_ (basic_stringbuf,std::allocator_> *this,uint param_1) { IsaacRepentancePlus::Weapon::~Weapon((Weapon *)this); if ((param_1 & 1) != 0) { operator_delete(this,0x44); } return this; } //@@ 009f3290 IsaacRepentancePlus::Weapon::~Weapon /* DB: resets vftable to IsaacRepentancePlus::Weapon::vftable, clears the owner's weapon ref (familiar +0xd4c or player via FUN_007ad4e0), erases the multiset entry at +8; called by every Weapon_*::Free prototype: db/protos.zhl */ void __thiscall IsaacRepentancePlus::Weapon::~Weapon(Weapon *this) { Entity_Player *pEVar1; Entity_Player *this_00; EntityPtr *pEVar2; Weapon *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; pEVar1 = this->_owner; *(undefined ***)this = vftable; if ((((pEVar1 == (Entity_Player *)0x0) || (this_00 = pEVar1, pEVar1->_type != 1)) && (this_00 = (Entity_Player *)0x0, pEVar1 != (Entity_Player *)0x0)) && (pEVar1->_type == 3)) { pEVar1->_chargeBarSprites[5]._numEvents = 0; } else if (this_00 != (Entity_Player *)0x0) { local_14 = this; ::Entity_Player::stop_costume_item_anims(this_00); } pEVar2 = &this->_technology2Laser; if (*pEVar2 != (EntityPtr)0x0) { local_14 = (Weapon *)pEVar2; std::multiset::erase(&local_14); *pEVar2 = (EntityPtr)0x0; } ExceptionList = local_10; return; } //@@ 009f3320 Weapon::ClearReferences /* ZHL [vtable slot 5] */ void __thiscall Weapon::ClearReferences(Weapon *this) { EntityPtr *pEVar1; Weapon *local_8; pEVar1 = &this->_technology2Laser; if (*pEVar1 != (EntityPtr)0x0) { local_8 = this; (**(code **)(*(int *)*pEVar1 + 0x28))(); if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Weapon *)pEVar1; std::multiset::erase(&local_8); *pEVar1 = (EntityPtr)0x0; } } return; } //@@ 009f3360 Weapon::IsAxisAligned /* ZHL [exact] __thiscall bool Weapon::IsAxisAligned(); prototype: REPENTOGON, confirmed by RET 0 */ byte __thiscall Weapon::IsAxisAligned(Weapon *this) { byte bVar1; Entity_Player *this_00; this_00 = this->_owner; if (((this_00 != (Entity_Player *)0x0) && (((this_00->_type == 1 || ((this_00->_type == 3 && (this_00 = *(Entity_Player **)&this_00->_isControlsEnabled, this_00 != (Entity_Player *)0x0 )))) && (*(float *)&this->field_0x28 == g_vectorZero.x)))) && (*(float *)&this->field_0x2c == g_vectorZero.y)) { bVar1 = Entity_Player::HasCollectible(this_00,0x1d1,0); if (bVar1 == 0) { bVar1 = Entity_Player::HasCollectible(this_00,0x18a,0); if (bVar1 == 0) { return 1; } } } return 0; } //@@ 009f33e0 Weapon::get_aim_direction /* DB: Marked (394) target override for player/familiar owner else default dir prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Weapon::get_aim_direction(Weapon *this,Vector *outDir,Vector *defaultDir) { float fVar1; byte bVar2; float *pfVar3; Entity_Player *this_00; this_00 = this->_owner; if (((this_00 != (Entity_Player *)0x0) && ((this_00->_type == 1 || ((this_00->_type == 3 && (this_00 = *(Entity_Player **)&this_00->_isControlsEnabled, this_00 != (Entity_Player *)0x0) ))))) && ((this->_modifiers & 0x40000000U) == 0)) { bVar2 = Entity_Player::HasCollectible(this_00,0x18a,0); if ((((bVar2 == 0) || (this_00->_markedTarget == (void *)0x0)) && (*(float *)&this->field_0x28 == g_vectorZero.x)) && (*(float *)&this->field_0x2c == g_vectorZero.y)) { pfVar3 = (float *)FUN_00753940(); fVar1 = *pfVar3; outDir->y = pfVar3[1]; outDir->x = fVar1; return outDir; } } fVar1 = defaultDir->x; outDir->y = defaultDir->y; outDir->x = fVar1; return outDir; } //@@ 009f3480 Weapon::Reset /* ZHL [vtable slot 4] */ void __thiscall Weapon::Reset(Weapon *this) { (**(code **)(*(int *)this + 0x14))(); *(undefined4 *)&this->field_0x1c = 0; *(undefined4 *)&this->field_0xc = 0; *(undefined4 *)&this->field_0x10 = 0x41200000; *(undefined4 *)&this->field_0x14 = 0; *(undefined4 *)&this->field_0x18 = 0x3f800000; *(undefined4 *)(this + 1) = 0; *(float *)&this->field_0x20 = g_vectorZero.x; *(float *)&this->field_0x24 = g_vectorZero.y; return; } //@@ 009f34d0 Weapon::Init /* ZHL [vtable slot 1] */ void __thiscall Weapon::Init(Weapon *this,undefined4 param_2,void *param_3) { (**(code **)(*(int *)this + 0x10))(); this->_owner = param_3; *(undefined4 *)&this->field_0x30 = param_2; return; } //@@ 009f34f0 Weapon::Update /* ZHL [vtable slot 2] */ void __thiscall Weapon::Update(Weapon *this,char param_2) { float fVar1; if ((param_2 == '\0') && (fVar1 = *(float *)&this->field_0xc, -1.0 < fVar1)) { if (this->_owner != (void *)0x0) { *(float *)&this->field_0xc = fVar1 - *(float *)((int)this->_owner + 0x39c); return; } *(float *)&this->field_0xc = fVar1 - 1.0; } return; } //@@ 009f3540 Weapon::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] void Fire(const Vector& pos, bool IsShooting, bool IsInterpolated); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon::Fire(Weapon *this,Vector *position,byte isShooting,byte isInterpolated) { uint uVar1; qword qVar2; qword qVar3; byte bVar4; char cVar5; Vector *pVVar6; Vector *ownerPos; Entity_Laser *laser; ColorMod *laserColorPtr; int rollResult; Entity_Player *ownerPlayer; uint notExplosiveLoHi; int extraout_ECX; int iVar7; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; uint notExplosiveHiHi; uint notExplosiveHiLo; Entity_Player *player; uint uVar8; EntityPtr EVar9; EntityPtr EVar10; float fVar11; undefined1 auStack_68 [4]; Entity_Laser *local_64; float aimDirY; EntityPtr local_5c; Entity_Player *player2; EntityPtr local_54; Vector local_50; Vector scratchVec; Weapon *local_40; Weapon *local_3c; ColorMod laserColor; uint local_c; Manager *manager; local_c = __security_cookie ^ (uint)auStack_68; local_54 = (EntityPtr)position; ownerPlayer = this->_owner; if (ownerPlayer == (Entity_Player *)0x0) { LAB_009f35c4: player2 = (Entity_Player *)0x0; LAB_009f35ca: local_3c = (Weapon *)0x0; } else if (ownerPlayer->_type == 1) { local_3c = (Weapon *)ownerPlayer->_luck; player2 = ownerPlayer; } else { if (ownerPlayer->_type == 3) { player2 = *(Entity_Player **)&ownerPlayer->_isControlsEnabled; LAB_009f35aa: ownerPlayer = *(Entity_Player **)&ownerPlayer->_isControlsEnabled; if (ownerPlayer == (Entity_Player *)0x0) goto LAB_009f35ca; } else { if (ownerPlayer == (Entity_Player *)0x0) goto LAB_009f35c4; player2 = (Entity_Player *)0x0; if (ownerPlayer->_type != 1) { if (ownerPlayer->_type == 3) goto LAB_009f35aa; goto LAB_009f35ca; } } local_3c = (Weapon *)ownerPlayer->_luck; } ownerPlayer = player2; local_40 = this; if (player2 == (Entity_Player *)0x0) { LAB_009f3b99: EVar9 = this->_technology2Laser; if ((EVar9 != (EntityPtr)0x0) && (*(char *)((int)EVar9 + 0x173) == '\0')) { (**(code **)(*(int *)EVar9 + 0x28))(); } return; } Entity_Player::HasCollectible(player2,0x18a,0); bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x98,0); if ((bVar4 == 0) || (*(int *)&this->field_0x30 == 0xf)) goto LAB_009f3b99; local_64 = (Entity_Laser *)*(float *)local_54; aimDirY = *(float *)((int)local_54 + 4); local_50.x = (float)local_64; local_50.y = aimDirY; bVar4 = IsAxisAligned(this); if (bVar4 == 0) { fVar11 = sqrtf((float)local_64 * (float)local_64 + aimDirY * aimDirY); if (0.0 < fVar11) { aimDirY = (1.0 / fVar11) * aimDirY; local_64 = (Entity_Laser *)((float)local_64 * (1.0 / fVar11)); local_50.x = (float)local_64; local_50.y = aimDirY; } } else { pVVar6 = Vector::ToCardinal(&scratchVec,&local_50); local_64 = (Entity_Laser *)pVVar6->x; aimDirY = pVVar6->y; local_50.x = (float)local_64; local_50.y = aimDirY; } if ((isShooting == 0) || (((float)local_64 == g_vectorZero.x && (aimDirY == g_vectorZero.y)))) { if (*(int *)&g_game->_roomTransition != 0) { return; } if (isShooting != 0) { return; } goto LAB_009f3b99; } EVar9 = this->_technology2Laser; local_54 = (EntityPtr)&this->_technology2Laser; local_5c = EVar9; if (EVar9 == (EntityPtr)0x0) { fVar11 = 1.0; pVVar6 = &local_50; uVar8 = 1; EVar10 = EVar9; ownerPos = get_owner_position(this,&scratchVec); laser = fire_laser(this,ownerPos,uVar8,pVVar6,EVar9._0_1_,EVar10._0_1_,fVar11); laser->_disableInitSound = 1; manager = g_manager; local_64 = laser; if (((this->_owner != (void *)0x0) && (*(char *)g_game->_room != '\0')) && (1 < g_game->_frameCount - *(int *)((int)g_game->_room + 0x11f0))) { local_5c = (EntityPtr)0x86; seed_fart_sound_override((int *)&local_5c); SoundEffects::Play(&manager->_sfxManager,(int)local_5c,1.0,2,0,1.0,0.0); } EVar9 = local_54; qVar2 = (laser->_tearFlags)._l; uVar8 = *(uint *)((int)&(laser->_tearFlags)._l + 4); qVar3 = (laser->_tearFlags)._h; uVar1 = *(uint *)((int)&(laser->_tearFlags)._h + 4); laser->_timeout = -1; laser->_disableFollowParent = 0; notExplosiveHiLo = ~(uint)g_tearFlagExplosive._h; notExplosiveHiHi = ~g_tearFlagExplosive._h._4_4_; notExplosiveLoHi = ~g_tearFlagExplosive._l._4_4_; *(uint *)&(local_64->_tearFlags)._l = ~(uint)g_tearFlagExplosive._l & (uint)qVar2; *(uint *)((int)&(local_64->_tearFlags)._l + 4) = notExplosiveLoHi & uVar8; *(uint *)&(local_64->_tearFlags)._h = notExplosiveHiLo & (uint)qVar3; *(uint *)((int)&(local_64->_tearFlags)._h + 4) = notExplosiveHiHi & uVar1; if (*(Entity_Laser **)local_54 != local_64) { if (*(Entity_Laser **)local_54 != (Entity_Laser *)0x0) { local_5c = local_54; std::multiset::erase(&local_5c); } *(Entity_Laser **)EVar9 = local_64; std::multiset::insert(EVar9); } local_64->_damageMultiplier = 0.13; local_64->field_0x517 = 1; (**(code **)(*(int *)local_64 + 0xc))(); aimDirY = local_50.y; local_64 = (Entity_Laser *)local_50.x; player = player2; LAB_009f39d5: this = local_40; ownerPlayer = player; } else if (isInterpolated == 0) { fVar11 = atan2f(aimDirY,(float)local_64); Entity_NPC::SetAimAngle((Entity_NPC *)local_5c,fVar11 * 57.295776); GetOwnerLaserOffset(this,&scratchVec,1,&local_50); player = player2; *(float *)((int)local_5c + 0x350) = scratchVec.y; *(float *)((int)local_5c + 0x410) = scratchVec.x; *(int *)((int)local_5c + 0x34c) = 0; *(int *)((int)local_5c + 0x414) = 0; uVar8 = *(uint *)((int)&(ownerPlayer->_tearFlags)._l + 4); qVar2 = (ownerPlayer->_tearFlags)._h; uVar1 = *(uint *)((int)&(ownerPlayer->_tearFlags)._h + 4); notExplosiveHiLo = ~(uint)g_tearFlagExplosive._h; notExplosiveHiHi = ~g_tearFlagExplosive._h._4_4_; notExplosiveLoHi = ~g_tearFlagExplosive._l._4_4_; *(uint *)((int)local_5c + 0x428) = ~(uint)g_tearFlagExplosive._l & (uint)(ownerPlayer->_tearFlags)._l; *(uint *)((int)local_5c + 0x42c) = notExplosiveLoHi & uVar8; *(uint *)((int)local_5c + 0x430) = notExplosiveHiLo & (uint)qVar2; *(uint *)((int)local_5c + 0x434) = notExplosiveHiHi & uVar1; laserColorPtr = Entity_Player::get_laser_color_copy(player2,&laserColor); EVar9 = local_5c; (**(code **)(*(int *)local_5c + 0x3c))(laserColorPtr,0xffffffff,0xff,0,1); if ((aimDirY <= -0.5) || ((float)local_64 <= -0.5)) { *(int *)((int)EVar9 + 0x358) = -0x3ee00000; } else { *(int *)((int)EVar9 + 0x358) = 0x453b8000; } goto LAB_009f39d5; } cVar5 = FUN_0097e7c0(); iVar7 = extraout_ECX; if (cVar5 == '\0') goto LAB_009f3b6a; bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x37,0); if (bVar4 == 0) { LAB_009f3a27: bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x57,0); iVar7 = extraout_ECX_00; if (bVar4 == 0) goto LAB_009f3b6a; iVar7 = 0x50 - (int)((float)local_3c * 5.0); if (iVar7 < 1) { iVar7 = 1; } rollResult = Isaac::Random(iVar7); iVar7 = extraout_ECX_01; if (rollResult != 0) goto LAB_009f3b6a; } else { iVar7 = 0x14 - (int)((float)local_3c * 1.5); if (iVar7 < 1) { iVar7 = 1; } iVar7 = Isaac::Random(iVar7); if (iVar7 != 0) goto LAB_009f3a27; } scratchVec.x = (float)((uint)local_64 ^ 0x80000000); scratchVec.y = (float)((uint)aimDirY ^ 0x80000000); local_40 = (Weapon *)scratchVec.y; local_3c = (Weapon *)scratchVec.x; pVVar6 = get_owner_position(this,&local_50); laser = fire_laser(this,pVVar6,5,&scratchVec,0,1,0.13); (**(code **)(*(int *)laser + 0xc))(); bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x57,0); iVar7 = extraout_ECX_02; if (bVar4 != 0) { scratchVec.x = aimDirY; scratchVec.y = (float)local_3c; pVVar6 = get_owner_position(this,&local_50); laser = fire_laser(this,pVVar6,5,&scratchVec,0,1,0.13); (**(code **)(*(int *)laser + 0xc))(); scratchVec.x = (float)local_40; scratchVec.y = (float)local_64; pVVar6 = get_owner_position(this,&local_50); laser = fire_laser(this,pVVar6,5,&scratchVec,0,1,0.13); (**(code **)(*(int *)laser + 0xc))(); iVar7 = extraout_ECX_03; } LAB_009f3b6a: SetBlinkTime(this,5,iVar7); return; } //@@ 009f3bd0 Weapon::get_owner_position /* DB: owner(+4)->_pos or zero vector prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Weapon::get_owner_position(Weapon *this,Vector *outPos) { void *pvVar1; float fVar2; fVar2 = g_vectorZero.x; pvVar1 = this->_owner; if (pvVar1 == (void *)0x0) { outPos->y = g_vectorZero.y; outPos->x = fVar2; return outPos; } fVar2 = *(float *)((int)pvVar1 + 0x33c); outPos->y = *(float *)((int)pvVar1 + 0x340); outPos->x = fVar2; return outPos; } //@@ 009f3c10 FUN_009f3c10 void FUN_009f3c10(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 == 0) || ((*(int *)(iVar1 + 0x28) != 1 && ((*(int *)(iVar1 + 0x28) != 3 || (*(int *)(iVar1 + 0x410) == 0)))))) { return; } return; } //@@ 009f3c40 FUN_009f3c40 void FUN_009f3c40(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 == 0) || ((*(int *)(iVar1 + 0x28) != 1 && ((*(int *)(iVar1 + 0x28) != 3 || (*(int *)(iVar1 + 0x410) == 0)))))) { return; } return; } //@@ 009f3c80 Weapon::get_damage /* DB: returns float in xmm0: owner (this+4) player -> _damage (+0x1470); familiar -> its player's _damage * 0.5 unless _playerType (+0x13c0) == 13 (Lilith), doubled with collectible 0xf7 (BFFS!); else 3.5; Weapon::fire_laser and the weapon init helpers pass it to the entity's vfunc +0x40 prototype: db/protos.zhl */ float __thiscall Weapon::get_damage(Weapon *this) { void *pvVar1; Entity_Player *this_00; byte bVar2; float local_8; pvVar1 = this->_owner; if (pvVar1 != (void *)0x0) { if (*(int *)((int)pvVar1 + 0x28) == 1) { return *(float *)((int)pvVar1 + 0x1470); } if ((*(int *)((int)pvVar1 + 0x28) == 3) && (this_00 = *(Entity_Player **)((int)pvVar1 + 0x410), this_00 != (Entity_Player *)0x0)) { local_8 = this_00->_damage; if (this_00->_playerType != 0xd) { local_8 = local_8 * 0.5; } bVar2 = Entity_Player::HasCollectible(this_00,0xf7,0); if (bVar2 == 0) { return local_8; } return local_8 + local_8; } } return 3.5; } //@@ 009f3d00 Weapon::get_owner_tear_flags /* DB: resolves the owner (+4) to a player (type 1, or a familiar's player), returns its TearFlags (player +0x1488..0x1494) into the 16-byte out; for a familiar owner with TRINKET_BABY_BENDER (0x7f) ORs the homing mask g_tearFlagHoming; Weapon::fire_laser, Weapon_Rockets::Fire prototype: db/protos.zhl, confirmed by RET 4 */ BitSet128 * __thiscall Weapon::get_owner_tear_flags(Weapon *this,BitSet128 *outFlags) { uint *puVar1; undefined4 uVar2; undefined4 uVar3; qword qVar4; byte bVar5; Entity_Player *pEVar6; Entity_Player *this_00; pEVar6 = this->_owner; if (pEVar6 == (Entity_Player *)0x0) { LAB_009f3d28: this_00 = (Entity_Player *)0x0; if ((pEVar6 != (Entity_Player *)0x0) && (pEVar6->_type == 3)) goto LAB_009f3d36; } else { if (pEVar6->_type != 1) { if (pEVar6->_type == 3) { this_00 = *(Entity_Player **)&pEVar6->_isControlsEnabled; goto LAB_009f3d36; } goto LAB_009f3d28; } this_00 = pEVar6; } pEVar6 = (Entity_Player *)0x0; LAB_009f3d36: *(undefined4 *)&outFlags->_l = 0; *(undefined4 *)((int)&outFlags->_l + 4) = 0; *(undefined4 *)&outFlags->_h = 0; *(undefined4 *)((int)&outFlags->_h + 4) = 0; if (this_00 != (Entity_Player *)0x0) { uVar2 = *(undefined4 *)((int)&(this_00->_tearFlags)._l + 4); qVar4 = (this_00->_tearFlags)._h; uVar3 = *(undefined4 *)((int)&(this_00->_tearFlags)._h + 4); *(int *)&outFlags->_l = (int)(this_00->_tearFlags)._l; *(undefined4 *)((int)&outFlags->_l + 4) = uVar2; *(int *)&outFlags->_h = (int)qVar4; *(undefined4 *)((int)&outFlags->_h + 4) = uVar3; if (pEVar6 != (Entity_Player *)0x0) { bVar5 = Entity_Player::HasTrinket(this_00,0x7f,0); if (bVar5 != 0) { *(uint *)&outFlags->_l = (uint)outFlags->_l | (uint)g_tearFlagHoming._l; puVar1 = (uint *)((int)&outFlags->_l + 4); *puVar1 = *puVar1 | g_tearFlagHoming._l._4_4_; *(uint *)&outFlags->_h = (uint)outFlags->_h | (uint)g_tearFlagHoming._h; puVar1 = (uint *)((int)&outFlags->_h + 4); *puVar1 = *puVar1 | g_tearFlagHoming._h._4_4_; return outFlags; } } } return outFlags; } //@@ 009f3db0 Weapon::get_tear_color /* DB: sibling of Weapon::get_laser_color 009f3f60: resolves owner player (this+4, familiar -> player), copies Entity_Player _tearColor into a Color out-param (default white), trinket 0x7f / local-player tweaks; Weapon_Bone::init_club, Weapon_Knife::init_knife */ float * Weapon::get_tear_color(float *param_1) { byte bVar1; int in_ECX; Entity_Player *this; Entity_Player *pEVar2; float tintB; float local_60 [11]; float local_34 [8]; undefined4 local_14; undefined4 uStack_10; undefined4 local_c; float colorizeA; float colorizeB; float colorizeG; float colorizeR; float tintA; float tintB; float tintG; float tintR; pEVar2 = *(Entity_Player **)(in_ECX + 4); if (pEVar2 == (Entity_Player *)0x0) { LAB_009f3dd9: this = (Entity_Player *)0x0; if ((pEVar2 != (Entity_Player *)0x0) && (pEVar2->_type == 3)) goto LAB_009f3de7; } else { if (pEVar2->_type != 1) { if (pEVar2->_type == 3) { this = *(Entity_Player **)&pEVar2->_isControlsEnabled; goto LAB_009f3de7; } goto LAB_009f3dd9; } this = pEVar2; } pEVar2 = (Entity_Player *)0x0; LAB_009f3de7: *param_1 = 1.0; param_1[1] = 1.0; param_1[2] = 1.0; param_1[3] = 1.0; param_1[4] = 0.0; param_1[5] = 0.0; param_1[6] = 0.0; param_1[7] = 0.0; param_1[8] = 0.0; param_1[9] = 0.0; param_1[10] = 0.0; if (this != (Entity_Player *)0x0) { tintR = (this->_tearColor)._tint[0]; tintG = (this->_tearColor)._tint[1]; tintB = (this->_tearColor)._tint[2]; tintA = (this->_tearColor)._tint[3]; tintB = (this->_tearColor)._offset[2]; colorizeR = (this->_tearColor)._colorize[0]; colorizeG = (this->_tearColor)._colorize[1]; colorizeB = (this->_tearColor)._colorize[2]; colorizeA = (this->_tearColor)._colorize[3]; if (param_1 != local_60) { *(undefined8 *)(param_1 + 8) = *(undefined8 *)(this->_tearColor)._offset; *param_1 = tintR; param_1[1] = tintG; param_1[2] = tintB; param_1[3] = tintA; param_1[10] = tintB; param_1[4] = colorizeR; param_1[5] = colorizeG; param_1[6] = colorizeB; param_1[7] = colorizeA; } if (pEVar2 != (Entity_Player *)0x0) { bVar1 = Entity_Player::HasTrinket(this,0x7f,0); if (bVar1 == 0) { if ((char)pEVar2->_chargeBarSprites[5]._shadowLayerIndex != '\0') { param_1[4] = 2.4; param_1[5] = 2.4; param_1[6] = 2.4; param_1[7] = 1.0; } } else { local_14 = 0x3e5cdcde; uStack_10 = 0x3ca0a0a1; local_c = 0x3ebebebf; if (param_1 != local_34) { param_1[4] = 0.0; param_1[5] = 0.0; param_1[6] = 0.0; param_1[7] = 0.0; param_1[8] = 0.21568629; param_1[9] = 0.019607844; *param_1 = 0.4; param_1[1] = 0.15; param_1[2] = 0.38; param_1[3] = 1.0; param_1[10] = 0.37254903; } } } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar1 = NetplayManager::IsIdxLocalPlayer(&g_manager->_netplayManager,this->_controllerIndex); if (bVar1 == 0) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { tintB = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } else { tintB = 1.0; } param_1[3] = tintB * param_1[3]; } } } return param_1; } //@@ 009f3f60 Weapon::get_laser_color /* DB: resolves owner player (this+4, familiar -> its player) and copies Entity_Player _laserColor into a Color out-param (default white), with trinket/local-player adjustments; Weapon::fire_laser, Weapon_Brimstone::fire_hitscan prototype: db/protos.zhl, confirmed by RET 4 */ ColorMod * __thiscall Weapon::get_laser_color(Weapon *this,ColorMod *outColor) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; byte bVar9; Entity_Player *this_00; Entity_Familiar *ownerFamiliar; float fVar10; ColorMod local_8c; ColorMod greenLaserColor; ColorMod purpleLaserColor; ownerFamiliar = this->_owner; if ((Entity_Player *)ownerFamiliar == (Entity_Player *)0x0) { LAB_009f3f8c: this_00 = (Entity_Player *)0x0; if (((Entity_Player *)ownerFamiliar != (Entity_Player *)0x0) && (((Entity_Player *)ownerFamiliar)->_type == 3)) goto LAB_009f3f9a; } else { if (((Entity_Player *)ownerFamiliar)->_type != 1) { if (((Entity_Player *)ownerFamiliar)->_type == 3) { this_00 = *(Entity_Player **)&((Entity_Player *)ownerFamiliar)->_isControlsEnabled; goto LAB_009f3f9a; } goto LAB_009f3f8c; } this_00 = (Entity_Player *)ownerFamiliar; } ownerFamiliar = (Entity_Familiar *)0x0; LAB_009f3f9a: outColor->_tint[0] = 1.0; outColor->_tint[1] = 1.0; outColor->_tint[2] = 1.0; outColor->_tint[3] = 1.0; outColor->_colorize[0] = 0.0; outColor->_colorize[1] = 0.0; outColor->_colorize[2] = 0.0; outColor->_colorize[3] = 0.0; outColor->_offset[0] = 0.0; outColor->_offset[1] = 0.0; outColor->_offset[2] = 0.0; if (this_00 != (Entity_Player *)0x0) { fVar1 = (this_00->_laserColor)._tint[0]; fVar2 = (this_00->_laserColor)._tint[1]; fVar3 = (this_00->_laserColor)._tint[2]; fVar4 = (this_00->_laserColor)._tint[3]; fVar10 = (this_00->_laserColor)._offset[2]; fVar5 = (this_00->_laserColor)._colorize[0]; fVar6 = (this_00->_laserColor)._colorize[1]; fVar7 = (this_00->_laserColor)._colorize[2]; fVar8 = (this_00->_laserColor)._colorize[3]; if (outColor != &local_8c) { *(undefined8 *)outColor->_offset = *(undefined8 *)(this_00->_laserColor)._offset; outColor->_tint[0] = fVar1; outColor->_tint[1] = fVar2; outColor->_tint[2] = fVar3; outColor->_tint[3] = fVar4; outColor->_offset[2] = fVar10; outColor->_colorize[0] = fVar5; outColor->_colorize[1] = fVar6; outColor->_colorize[2] = fVar7; outColor->_colorize[3] = fVar8; } if ((Entity_Player *)ownerFamiliar != (Entity_Player *)0x0) { bVar9 = Entity_Player::HasTrinket(this_00,0x7f,0); if (bVar9 == 0) { if ((char)((Entity_Player *)ownerFamiliar)->_chargeBarSprites[5]._shadowLayerIndex != '\0') { greenLaserColor._offset[0] = 1.0; greenLaserColor._colorize[0] = 0.0; greenLaserColor._colorize[1] = 0.0; greenLaserColor._colorize[2] = 0.0; greenLaserColor._colorize[3] = 0.0; greenLaserColor._tint[0] = 0.2; greenLaserColor._tint[1] = 1.0; greenLaserColor._tint[2] = 0.0; greenLaserColor._tint[3] = 1.0; greenLaserColor._offset[1] = 1.0; greenLaserColor._offset[2] = 0.0; Color::operator_assign((Color *)outColor,&greenLaserColor); } } else { purpleLaserColor._offset[0] = 0.3529412; purpleLaserColor._offset[1] = 0.0; purpleLaserColor._offset[2] = 0.7058824; if (outColor != &purpleLaserColor) { outColor->_colorize[0] = 0.0; outColor->_colorize[1] = 0.0; outColor->_colorize[2] = 0.0; outColor->_colorize[3] = 0.0; outColor->_offset[0] = 0.3529412; outColor->_offset[1] = 0.0; outColor->_tint[0] = 0.4; outColor->_tint[1] = 0.15; outColor->_tint[2] = 0.38; outColor->_tint[3] = 1.0; outColor->_offset[2] = 0.7058824; } } } if (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1)) { bVar9 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,this_00->_controllerIndex); if (bVar9 == 0) { if ((g_game == (Game *)0x0) || (*(int *)&g_game->_deathmatchManager < 2)) { fVar10 = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1; } else { fVar10 = 1.0; } outColor->_tint[3] = fVar10 * outColor->_tint[3]; } } } return outColor; } //@@ 009f4130 FUN_009f4130 void FUN_009f4130(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return; } return; } //@@ 009f4150 Weapon::GetChargeBarAmount /* ZHL [vtable slot 7] */ float10 __thiscall Weapon::GetChargeBarAmount(Weapon *this) { float fVar1; float10 fVar2; float fVar3; if (((uint)this->_modifiers >> 7 & 1) != 0) { return (float10)0; } fVar2 = (float10)(**(code **)(*(int *)this + 0x18))(); fVar1 = (float)fVar2; if ((0.0 < fVar1) && ((fVar3 = *(float *)&this->field_0x14, 1.0 < fVar3 || (fVar1 <= fVar3)))) { fVar3 = fVar3 / fVar1; if (fVar3 <= 0.0) { fVar3 = 0.0; } if (1.0 <= fVar3) { fVar3 = 1.0; } return (float10)fVar3; } return (float10)0.0; } //@@ 009f41c0 Weapon::GetMultiShotParams /* DB: player/familiar owner -> Entity_Player::GetMultiShotParams else default prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall Weapon::GetMultiShotParams(Weapon *this,void *outParams,int unusedArg) { Entity_Player *this_00; this_00 = this->_owner; if ((this_00 == (Entity_Player *)0x0) || ((this_00->_type != 1 && ((this_00->_type != 3 || (this_00 = *(Entity_Player **)&this_00->_isControlsEnabled, this_00 == (Entity_Player *)0x0)) )))) { *(undefined4 *)outParams = 0; *(undefined4 *)((int)outParams + 4) = 0; *(undefined4 *)((int)outParams + 8) = 0; *(undefined4 *)((int)outParams + 0xc) = 0; *(undefined4 *)((int)outParams + 0x10) = 0; *(undefined4 *)((int)outParams + 0x14) = 1; *(undefined4 *)((int)outParams + 0x18) = 0; *(undefined2 *)((int)outParams + 0x1c) = 0; *(undefined1 *)((int)outParams + 0x1e) = 0; *(undefined2 *)((int)outParams + 0x20) = 0; return outParams; } Entity_Player::GetMultiShotParams(this_00,outParams,*(int *)&this->field_0x30); return outParams; } //@@ 009f4230 FUN_009f4230 void * FUN_009f4230(void *param_1,int param_2,int param_3,float param_4,float param_5,float param_6, short param_7,float param_8,float param_9,float param_10,float param_11, int param_12,float param_13,byte param_14,short param_15) { Vector shotDirection; shotDirection.y = param_5; shotDirection.x = param_4; Entity_Player::GetMultiShotPositionVelocity (param_1,param_2,param_3,shotDirection,param_6,param_7,param_8,param_9,param_10,param_11 ,param_12,param_13,param_14,param_15); return param_1; } //@@ 009f4280 Weapon::UpdateHeadChargeAnimation /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? HeadDownCharge/FloatChargeSide anim names prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Weapon::UpdateHeadChargeAnimation (Weapon *this,int collectibleId,int chargeType,Vector *direction,float charge) { void *pvVar1; int iVar2; ItemConfig_Item *item; void **other; ulonglong *dirAnimName; char *freeChars; int unused1; uint freeSize; Entity_Player *player; std_string *animName; ItemConfig *unused3; char *local_c8; char *local_c4; char *local_c0; char *local_bc; void *itemAnim [4]; uint itemAnimSize; uint itemAnimCapacity; ulonglong local_9c; char local_94 [8]; undefined4 local_8c; uint local_88; ulonglong local_84; char local_7c [8]; undefined4 local_74; uint local_70; ulonglong local_6c; char local_64 [8]; uint local_5c; uint local_58; void *local_54 [4]; undefined4 local_44; uint local_40; ulonglong local_3c; char local_34 [8]; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; ItemConfig *itemConfig; Entity_Player *owner; puStack_20 = local_34 + 0x30; puStack_18 = &LAB_00b102ff; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_34 + 0x24); owner = this->_owner; if ((((owner == (Entity_Player *)0x0) || (player = owner, owner->_type != 1)) && (player = (Entity_Player *)0x0, owner != (Entity_Player *)0x0)) && (owner->_type == 3)) { local_44 = 0; local_40 = 0xf; local_54[0] = (void *)0x0; local_14 = 0x1a; if (ABS(direction->x) <= ABS(direction->y)) { iVar2 = (uint)(0.0 <= direction->y) * 2 + 1; } else { iVar2 = 2; if (direction->x < 0.0) { iVar2 = 0; } } if (chargeType == 0) { ExceptionList = &local_1c; ANM2::SetFrame(&owner->_sprite,(std_string *)(&PTR_s_FloatChargeSide_00b816e4)[iVar2], (int)((charge * 30.0) / 18.0)); } else if (chargeType == 1) { ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; ANM2::Play(&owner->_sprite,(&PTR_s_FloatChargedSide_00b816f4)[iVar2],0); } else if ((chargeType == 2) && ((collectibleId == 0x76 || (collectibleId == 0xe5)))) { ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; ANM2::Play(&owner->_sprite,(&PTR_s_Shoot2Side_00b816d4)[iVar2],0); } owner->_chargeBarSprites[5]._numEvents = 1; (owner->_sprite)._flipX = iVar2 == 0; ExceptionList = local_1c; return; } if (player == (Entity_Player *)0x0) { return; } itemAnimSize = 0; itemAnimCapacity = 0xf; itemAnim[0] = (void *)0x0; local_14._0_1_ = 0; local_14._1_3_ = 0; switch(chargeType) { case 0: builtin_strncpy(local_34,"Charge",7); local_28 = 0xf; local_2c = 0xe; local_3c = 0x6e776f4464616548; builtin_strncpy(local_64,"tCharge",8); local_58 = 0xf; local_5c = 0xf; local_6c = 0x6867695264616548; local_88 = 0xf; local_8c = 0xc; local_9c = 0x6843705564616548; builtin_strncpy(local_94,"arge",5); builtin_strncpy(local_7c,"Charge",7); local_70 = 0xf; local_74 = 0xe; local_84 = 0x7466654c64616548; local_14 = 4; if (ABS(direction->x) <= ABS(direction->y)) { dirAnimName = &local_9c; if (0.0 <= direction->y) { dirAnimName = &local_3c; } } else if (0.0 <= direction->x) { dirAnimName = &local_6c; } else { dirAnimName = &local_84; } ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; std::string::string((char *)local_54,dirAnimName); local_14._0_1_ = 5; FUN_0040c310(local_54); local_14._0_1_ = 4; if (0xf < local_40) { freeSize = local_40 + 1; pvVar1 = local_54[0]; if (0xfff < freeSize) { pvVar1 = *(void **)((int)local_54[0] + -4); freeSize = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } local_14._0_1_ = 3; if (0xf < local_70) { freeSize = local_70 + 1; pvVar1 = (char *)local_84; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(char *)local_84 + -4); freeSize = local_70 + 0x24; if (0x1f < (uint)((int)(char *)local_84 + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } local_14._0_1_ = 2; if (0xf < local_88) { freeSize = local_88 + 1; pvVar1 = (char *)local_9c; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(char *)local_9c + -4); freeSize = local_88 + 0x24; if (0x1f < (uint)((int)(char *)local_9c + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } local_14._0_1_ = 1; if (0xf < local_58) { freeSize = local_58 + 1; pvVar1 = (ulonglong *)local_6c; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(ulonglong *)local_6c + -4); freeSize = local_58 + 0x24; if (0x1f < (uint)((int)(ulonglong *)local_6c + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } local_14._0_1_ = 0; if (0xf < local_28) { freeSize = local_28 + 1; pvVar1 = (char *)local_3c; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(char *)local_3c + -4); freeSize = local_28 + 0x24; if (0x1f < (uint)((int)(char *)local_3c + (-4 - (int)pvVar1))) goto LAB_009f4c64; } LAB_009f4577: local_14._0_1_ = 0; operator_delete(pvVar1,freeSize); } break; case 1: ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; local_bc = std::_Allocate(0x20); local_5c = 0x12; local_58 = 0x1f; local_6c = CONCAT44(local_6c._4_4_,local_bc); builtin_strncpy(local_bc,"HeadDownChargeFull",0x13); local_14._0_1_ = 6; local_c8 = std::_Allocate(0x20); local_74 = 0x13; local_70 = 0x1f; local_84 = CONCAT44(local_84._4_4_,local_c8); builtin_strncpy(local_c8,"HeadRightChargeFull",0x14); local_14._0_1_ = 7; local_c4 = std::_Allocate(0x20); local_2c = 0x10; builtin_strncpy(local_c4,"HeadUpChargeFull",0x11); local_28 = 0x1f; local_3c = CONCAT44(local_3c._4_4_,local_c4); local_14._0_1_ = 8; local_c0 = std::_Allocate(0x20); local_8c = 0x12; builtin_strncpy(local_c0,"HeadLeftChargeFull",0x13); local_88 = 0x1f; local_9c = CONCAT44(local_9c._4_4_,local_c0); local_14 = CONCAT31(local_14._1_3_,9); if (ABS(direction->x) <= ABS(direction->y)) { if (0.0 <= direction->y) { std::string::string((char *)local_54,&local_6c); local_bc = (char *)(ulonglong *)local_6c; } else { std::string::string((char *)local_54,&local_3c); local_c4 = (char *)local_3c; } } else if (0.0 <= direction->x) { std::string::string((char *)local_54,&local_84); local_c8 = (char *)local_84; } else { std::string::string((char *)local_54,&local_9c); local_c0 = (char *)local_9c; } local_14._0_1_ = 10; FUN_0040c310(local_54); local_14._0_1_ = 9; if (0xf < local_40) { freeSize = local_40 + 1; pvVar1 = local_54[0]; if (0xfff < freeSize) { pvVar1 = *(void **)((int)local_54[0] + -4); freeSize = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } local_14._0_1_ = 8; if (0xf < local_88) { freeSize = local_88 + 1; freeChars = local_c0; if (0xfff < freeSize) { freeChars = *(char **)(local_c0 + -4); freeSize = local_88 + 0x24; if ((char *)0x1f < local_c0 + (-4 - (int)freeChars)) goto LAB_009f4c64; } operator_delete(freeChars,freeSize); } local_14._0_1_ = 7; if (0xf < local_28) { freeSize = local_28 + 1; freeChars = local_c4; if (0xfff < freeSize) { freeChars = *(char **)(local_c4 + -4); freeSize = local_28 + 0x24; if ((char *)0x1f < local_c4 + (-4 - (int)freeChars)) goto LAB_009f4c64; } operator_delete(freeChars,freeSize); } local_14._0_1_ = 6; if (0xf < local_70) { freeSize = local_70 + 1; freeChars = local_c8; if (0xfff < freeSize) { freeChars = *(char **)(local_c8 + -4); freeSize = local_70 + 0x24; if ((char *)0x1f < local_c8 + (-4 - (int)freeChars)) goto LAB_009f4c64; } operator_delete(freeChars,freeSize); } local_14._0_1_ = 0; if (0xf < local_58) { freeSize = local_58 + 1; freeChars = local_bc; if (0xfff < freeSize) { freeChars = *(char **)(local_bc + -4); freeSize = local_58 + 0x24; if ((char *)0x1f < local_bc + (-4 - (int)freeChars)) goto LAB_009f4c64; } operator_delete(freeChars,freeSize); } break; case 2: builtin_strncpy(local_34,"Shoot",6); local_28 = 0xf; local_2c = 0xd; local_3c = 0x6e776f4464616548; local_14 = 0xb; ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; std::string::string_from_cstr((char *)&local_84,(byte *)"HeadRightShoot"); local_14._0_1_ = 0xc; std::string::string_from_cstr((char *)&local_9c,(byte *)"HeadUpShoot"); local_14._0_1_ = 0xd; std::string::string_from_cstr((char *)local_54,(byte *)"HeadLeftShoot"); local_14._0_1_ = 0xe; pvVar1 = string_from_direction(&local_6c,*direction,local_54,&local_9c,&local_84,&local_3c); local_14._0_1_ = 0xf; FUN_0040c310(pvVar1); std::string::_Tidy_deallocate((char *)&local_6c); std::string::_Tidy_deallocate((char *)local_54); std::string::_Tidy_deallocate((char *)&local_9c); std::string::_Tidy_deallocate((char *)&local_84); local_14._0_1_ = 0; if (0xf < local_28) { freeSize = local_28 + 1; pvVar1 = (char *)local_3c; if (0xfff < freeSize) { freeSize = local_28 + 0x24; pvVar1 = *(void **)((int)(char *)local_3c + -4); if (0x1f < (uint)((int)(char *)local_3c + (-4 - (int)*(void **)((int)(char *)local_3c + -4)) )) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } goto LAB_009f4577; } break; case 3: ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; std::string::string_from_cstr((char *)&local_84,(byte *)"HeadDownShootAlt"); local_14._0_1_ = 0x10; std::string::string_from_cstr((char *)&local_3c,(byte *)"HeadRightShootAlt"); local_14._0_1_ = 0x11; std::string::string_from_cstr((char *)&local_9c,(byte *)"HeadUpShootAlt"); local_14._0_1_ = 0x12; std::string::string_from_cstr((char *)local_54,(byte *)"HeadLeftShootAlt"); local_14._0_1_ = 0x13; pvVar1 = string_from_direction(&local_6c,*direction,local_54,&local_9c,&local_3c,&local_84); local_14._0_1_ = 0x14; FUN_0040c310(pvVar1); std::string::_Tidy_deallocate((char *)&local_6c); std::string::_Tidy_deallocate((char *)local_54); std::string::_Tidy_deallocate((char *)&local_9c); std::string::_Tidy_deallocate((char *)&local_3c); local_14._0_1_ = 0; std::string::_Tidy_deallocate((char *)&local_84); break; default: ExceptionList = &local_1c; puStack_20 = local_34 + 0x30; } iVar2 = (int)charge; itemConfig = &g_manager->_itemConfig; animName = (std_string *)itemAnim; unused3 = itemConfig; item = ItemConfig::GetCollectible(itemConfig,collectibleId); Entity_Player::update_item_anims(player,unused1,item,(int)itemConfig,animName,iVar2,(int)unused3); if (chargeType == 2) { local_44 = 0; local_40 = 0xf; local_54[0] = (void *)0x0; std::string::assign((char *)local_54,(byte *)"HeadDown",8); local_14._0_1_ = 0x15; local_74 = 0; local_70 = 0xf; local_84 = local_84 & 0xffffffff00000000; std::string::assign((char *)&local_84,(byte *)"HeadRight",9); local_14._0_1_ = 0x16; local_2c = 0; local_28 = 0xf; local_3c = local_3c & 0xffffffff00000000; std::string::assign((char *)&local_3c,(byte *)"HeadUp",6); local_14._0_1_ = 0x17; local_8c = 0; local_88 = 0xf; local_9c = local_9c & 0xffffffff00000000; std::string::assign((char *)&local_9c,(byte *)"HeadLeft",8); local_14._0_1_ = 0x18; if (ABS(direction->x) <= ABS(direction->y)) { other = (void **)&local_3c; if (0.0 <= direction->y) { other = local_54; } } else if (0.0 <= direction->x) { other = (void **)&local_84; } else { other = (void **)&local_9c; } std::string::string((char *)&local_6c,other); local_14._0_1_ = 0x19; if (&player->_headAnim != (std_string *)&local_6c) { dirAnimName = &local_6c; if (0xf < local_58) { dirAnimName = (ulonglong *)local_6c; } std::string::assign((player->_headAnim)._buf,(byte *)dirAnimName,local_5c); } std::string::_Tidy_deallocate((char *)&local_6c); if (0xf < local_88) { freeSize = local_88 + 1; pvVar1 = (char *)local_9c; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(char *)local_9c + -4); freeSize = local_88 + 0x24; if (0x1f < (uint)((int)(char *)local_9c + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } if (0xf < local_28) { freeSize = local_28 + 1; pvVar1 = (char *)local_3c; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(char *)local_3c + -4); freeSize = local_28 + 0x24; if (0x1f < (uint)((int)(char *)local_3c + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } if (0xf < local_70) { freeSize = local_70 + 1; pvVar1 = (char *)local_84; if (0xfff < freeSize) { pvVar1 = *(void **)((int)(char *)local_84 + -4); freeSize = local_70 + 0x24; if (0x1f < (uint)((int)(char *)local_84 + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } if (0xf < local_40) { freeSize = local_40 + 1; pvVar1 = local_54[0]; if (0xfff < freeSize) { pvVar1 = *(void **)((int)local_54[0] + -4); freeSize = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar1))) goto LAB_009f4c64; } operator_delete(pvVar1,freeSize); } } if (0xf < itemAnimCapacity) { freeSize = itemAnimCapacity + 1; pvVar1 = itemAnim[0]; if (0xfff < freeSize) { pvVar1 = *(void **)((int)itemAnim[0] + -4); freeSize = itemAnimCapacity + 0x24; if (0x1f < (uint)((int)itemAnim[0] + (-4 - (int)pvVar1))) { LAB_009f4c64: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,freeSize); } ExceptionList = local_1c; return; } //@@ 009f4da0 Weapon::play_brimstone_costume_shoot /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? (.., dir Vector*, frames 8.0): owner player only; picks "HeadDownShoot"/"HeadRightShoot"/"HeadUpShoot"/"HeadLeftShoot" via string_from_direction(dir) (plain "Shoot" fallback), then FUN_0075ad50 with ItemConfig::GetCollectible(0x76 Brimstone) to play it on that item's costume; Weapon_Brimstone::Fire when FUN_0075abe0 > 0xf */ void Weapon::play_brimstone_costume_shoot (undefined4 param_1,undefined4 param_2,Vector *param_3,float param_4) { Entity_Player *pEVar1; void *pvVar2; int animFrames; ItemConfig_Item *brimstoneItem; int in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar3; undefined4 extraout_ECX_02; uint freeSize; char directionAnim [24]; char headUpShoot [24]; char headLeftShoot [24]; void *animName [4]; undefined4 animNameSize; uint animNameCapacity; void *headRightShoot [4]; undefined4 headRightShootSize; uint headRightShootCapacity; undefined8 headDownShoot; char local_24 [8]; undefined4 headDownShootSize; uint headDownShootCapacity; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; void **animNameArg; puStack_c = &LAB_00b1036b; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; pEVar1 = *(Entity_Player **)(in_ECX + 4); if ((pEVar1 != (Entity_Player *)0x0) && (pEVar1->_type == 1)) { animNameSize = 0; animNameCapacity = 0xf; animName[0] = (void *)0x0; builtin_strncpy(local_24,"Shoot",6); headDownShootCapacity = 0xf; headDownShootSize = 0xd; headDownShoot = 0x6e776f4464616548; local_8 = 0xb; headRightShootSize = 0; headRightShootCapacity = 0xf; headRightShoot[0] = (void *)0x0; std::string::assign((char *)headRightShoot,(byte *)"HeadRightShoot",0xe); local_8._0_1_ = 0xc; std::string::string_from_cstr(headUpShoot,(byte *)"HeadUpShoot"); local_8._0_1_ = 0xd; std::string::string_from_cstr(headLeftShoot,(byte *)"HeadLeftShoot"); local_8._0_1_ = 0xe; pvVar2 = string_from_direction (directionAnim,*param_3,headLeftShoot,headUpShoot,headRightShoot, &headDownShoot); local_8._0_1_ = 0xf; FUN_0040c310(pvVar2); std::string::_Tidy_deallocate(directionAnim); std::string::_Tidy_deallocate(headLeftShoot); std::string::_Tidy_deallocate(headUpShoot); local_8._0_1_ = 0xb; uVar3 = extraout_ECX; if (0xf < headRightShootCapacity) { freeSize = headRightShootCapacity + 1; pvVar2 = headRightShoot[0]; if (0xfff < freeSize) { pvVar2 = *(void **)((int)headRightShoot[0] + -4); freeSize = headRightShootCapacity + 0x24; if (0x1f < (uint)((int)headRightShoot[0] + (-4 - (int)pvVar2))) goto LAB_009f4f36; } operator_delete(pvVar2,freeSize); uVar3 = extraout_ECX_00; } local_8._0_1_ = 0; if (0xf < headDownShootCapacity) { freeSize = headDownShootCapacity + 1; pvVar2 = (void *)headDownShoot; if (0xfff < freeSize) { pvVar2 = *(void **)((int)(void *)headDownShoot + -4); freeSize = headDownShootCapacity + 0x24; if (0x1f < (uint)((int)(void *)headDownShoot + (-4 - (int)pvVar2))) { LAB_009f4f36: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,freeSize); uVar3 = extraout_ECX_01; } animFrames = (int)param_4; animNameArg = animName; brimstoneItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x76); Entity_Player::play_item_costume_anim (pEVar1,extraout_ECX_02,brimstoneItem,uVar3,animNameArg,animFrames); if (0xf < animNameCapacity) { freeSize = animNameCapacity + 1; pvVar2 = animName[0]; if (0xfff < freeSize) { pvVar2 = *(void **)((int)animName[0] + -4); freeSize = animNameCapacity + 0x24; if (0x1f < (uint)((int)animName[0] + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,freeSize); } } ExceptionList = local_10; return; } //@@ 009f4fc0 FUN_009f4fc0 Entity_Player * FUN_009f4fc0(void) { Entity_Player *pEVar1; Entity_Player *extraout_EAX; int in_ECX; Entity_Player *this; pEVar1 = *(Entity_Player **)(in_ECX + 4); if ((((pEVar1 == (Entity_Player *)0x0) || (this = pEVar1, pEVar1->_type != 1)) && (this = (Entity_Player *)0x0, pEVar1 != (Entity_Player *)0x0)) && (pEVar1->_type == 3)) { pEVar1->_chargeBarSprites[5]._numEvents = 0; } else { pEVar1 = (Entity_Player *)0x0; if (this != (Entity_Player *)0x0) { Entity_Player::stop_costume_item_anims(this); return extraout_EAX; } } return pEVar1; } //@@ 009f4ff0 Weapon::stop_costume_item_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? thiscall Weapon (owner this+4); for a player owner (type 1) walks the 15 costume-map layers and clears CostumeSpriteDesc+0x11c (_itemAnimPlay) on the layer whose costume belongs to collectible param (Weapon::is_held_item); familiar owner (type 3) clears a field instead; Weapon_Bone/Brimstone/Tears::Fire prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Weapon::stop_costume_item_anim(Weapon *this,int collectibleId) { void *pvVar1; byte bVar2; ItemConfig_Item *itemDesc; void *pvVar3; int *piVar4; ANM2 *sprite; int local_34; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; uint uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00aff10d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)&(&local_2c)[1]._size; ExceptionList = &local_10; pvVar1 = this->_owner; if ((((pvVar1 == (void *)0x0) || (pvVar3 = pvVar1, *(int *)((int)pvVar1 + 0x28) != 1)) && (pvVar3 = (void *)0x0, pvVar1 != (void *)0x0)) && (*(int *)((int)pvVar1 + 0x28) == 3)) { *(undefined4 *)((int)pvVar1 + 0xd4c) = 0; } else if ((pvVar3 != (void *)0x0) && (itemDesc = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId), *(char *)((int)pvVar3 + 0x20a9) == '\0')) { piVar4 = (int *)((int)pvVar3 + 0x122c); local_34 = 0xf; do { if (-1 < *piVar4) { local_2c._capacity = 0xf; local_2c._size = 0; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; sprite = (ANM2 *)(*piVar4 * 0x130 + *(int *)((int)pvVar3 + 0x1220)); bVar2 = is_held_item(sprite,&local_2c,itemDesc); if (bVar2 != 0) { sprite[1]._filename._buf[8] = '\0'; } } piVar4 = piVar4 + 4; local_34 = local_34 + -1; } while (local_34 != 0); } ExceptionList = local_10; return; } //@@ 009f50f0 Weapon::IsItemAnimFinished /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall bool Weapon::IsItemAnimFinished(unsigned int collectibleID); prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall Weapon::IsItemAnimFinished(Weapon *this,uint collectibleID) { bool bVar1; byte bVar2; ItemConfig_Item *itemDesc; void *pvVar3; bool bVar4; ANM2 *sprite; uint uVar5; uint size; uint local_58; int *local_54; void *local_50; byte local_4a; byte local_48 [16]; undefined4 local_38; undefined4 local_34; void *local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *pvStack_8; pvStack_8 = (void *)0xffffffff; puStack_c = &LAB_00b103c6; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); bVar4 = false; pvVar3 = this->_owner; if ((((pvVar3 == (void *)0x0) || (local_50 = pvVar3, *(int *)((int)pvVar3 + 0x28) != 1)) && (local_50 = (void *)0x0, pvVar3 != (void *)0x0)) && (local_50 = (void *)0x0, *(int *)((int)pvVar3 + 0x28) == 3)) { if (((*(int *)((int)pvVar3 + 0xd4c) != 0) && (*(int *)((int)pvVar3 + 0x7c) != 0)) && (*(char *)((int)pvVar3 + 0x8c) != '\0')) { return 0; } } else if (local_50 != (void *)0x0) { local_34 = 0xf; local_38 = 0; local_48[0] = 0; local_48[1] = 0; local_48[2] = 0; local_48[3] = 0; ExceptionList = &local_10; itemDesc = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleID); bVar2 = 1; local_54 = (int *)((int)local_50 + 0x122c); local_4a = 1; local_58 = 0; do { if (-1 < *local_54) { sprite = (ANM2 *)(*local_54 * 0x130 + *(int *)((int)local_50 + 0x1220)); if (sprite[1]._filename._buf[8] == '\0') { uVar5 = local_1c; LAB_009f51e9: bVar1 = false; } else { uVar5 = 0xf; local_1c = 0xf; local_20 = 0; local_30[0] = (void *)0x0; bVar4 = true; bVar2 = is_held_item(sprite,(std_string *)local_30,itemDesc); if (bVar2 == 0) goto LAB_009f51e9; bVar1 = true; } if ((bVar4) && (bVar4 = false, 0xf < uVar5)) { size = uVar5 + 1; pvVar3 = local_30[0]; if (0xfff < size) { pvVar3 = *(void **)((int)local_30[0] + -4); size = uVar5 + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,size); } bVar2 = local_4a; if (bVar1) { bVar2 = ANM2::IsFinishedImpl(sprite,local_48); if ((bVar2 != 0) && ((pvVar3 = (sprite->_animState)._animData, pvVar3 == (void *)0x0 || (*(char *)((int)pvVar3 + 0x34) == '\0')))) { ExceptionList = local_10; return 1; } local_4a = 0; bVar2 = local_4a; } } local_54 = local_54 + 4; local_58 = local_58 + 1; if (0xe < local_58) { ExceptionList = local_10; return bVar2; } } while( true ); } return 1; } //@@ 009f52c0 Weapon::update_c_section_charge_anim /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: state 0/1/2 -> "SubAnim_Charge"/"SubAnim_Charged"/"SubAnim_Shoot"; for the owner player's costume layers (+0x122c, 15 slots) whose item is ItemConfig::GetCollectible(0x2a6 COLLECTIBLE_C_SECTION) plays/sets the overlay anim and frame; non-player owner falls back to Weapon::UpdateHeadChargeAnimation(0x2a6); Weapon_Fetus/Brimstone/Bone::Fire prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Weapon::update_c_section_charge_anim (Weapon *this,int unusedCollectibleId,int chargeState,Vector *direction,float charge) { byte isAnimSet; ItemConfig_Item *cSectionConfig; ulonglong *animName; void *pvVar1; int *costumeSlot; ANM2 *costumeSprite; uint animNameCapacity; uint size; int slotsLeft; byte isRestart; ulonglong animNameBuf; char local_24 [12]; uint local_18; uint securityCookie; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af32ed; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; pvVar1 = this->_owner; if ((pvVar1 == (void *)0x0) || (*(int *)((int)pvVar1 + 0x28) != 1)) { UpdateHeadChargeAnimation(this,0x2a6,chargeState,direction,charge); ExceptionList = local_10; return; } animNameCapacity = 0xf; local_24[8] = '\0'; local_24[9] = '\0'; local_24[10] = '\0'; local_24[0xb] = '\0'; local_18 = 0xf; animNameBuf = animNameBuf & 0xffffffff00000000; local_8 = 0; isRestart = 0; if (chargeState == 0) { builtin_strncpy(local_24,"Charge",7); local_24[8] = '\x0e'; local_24[9] = '\0'; local_24[10] = '\0'; local_24[0xb] = '\0'; isRestart = 0; } else if (chargeState == 1) { builtin_strncpy(local_24,"Charged",8); local_24[8] = '\x0f'; local_24[9] = '\0'; local_24[10] = '\0'; local_24[0xb] = '\0'; isRestart = 0; } else { if (chargeState != 2) goto LAB_009f53c3; builtin_strncpy(local_24,"Shoot",6); local_24[8] = '\r'; local_24[9] = '\0'; local_24[10] = '\0'; local_24[0xb] = '\0'; isRestart = 1; } animNameBuf = 0x5f6d696e41627553; LAB_009f53c3: cSectionConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x2a6); slotsLeft = 0xf; costumeSlot = (int *)((int)pvVar1 + 0x122c); do { if (((-1 < *costumeSlot) && ((char)costumeSlot[3] != '\0')) && (costumeSprite = (ANM2 *)(*costumeSlot * 0x130 + *(int *)((int)pvVar1 + 0x1220)), *(ItemConfig_Item **)costumeSprite[1]._filename._buf == cSectionConfig)) { if (charge < 0.0) { if (-1.0 <= charge) { animName = &animNameBuf; if (0xf < animNameCapacity) { animName = (ulonglong *)animNameBuf; } ANM2::PlayOverlay(costumeSprite,(byte *)animName,isRestart); } else { animName = &animNameBuf; if (0xf < animNameCapacity) { animName = (ulonglong *)animNameBuf; } ANM2::SetOverlayAnimation(costumeSprite,(byte *)animName,0); } } else { animName = &animNameBuf; if (0xf < animNameCapacity) { animName = (ulonglong *)animNameBuf; } isAnimSet = ANM2::SetOverlayAnimation(costumeSprite,(byte *)animName,1); if ((isAnimSet != 0) && ((costumeSprite->_overlayAnimState)._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&costumeSprite->_overlayAnimState,(float)(int)charge); } } animNameCapacity = local_18; } costumeSlot = costumeSlot + 4; slotsLeft = slotsLeft + -1; } while (slotsLeft != 0); if (0xf < animNameCapacity) { size = animNameCapacity + 1; pvVar1 = (ulonglong *)animNameBuf; if (0xfff < size) { pvVar1 = *(void **)((int)(ulonglong *)animNameBuf + -4); size = animNameCapacity + 0x24; if (0x1f < (uint)((int)(ulonglong *)animNameBuf + (-4 - (int)pvVar1))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar1,size); } ExceptionList = local_10; return; } //@@ 009f5510 Weapon::is_c_section_anim_finished /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? item 0x2a6 (C Section): owner not player -> Weapon::IsItemAnimFinished(0x2a6); else scans player item-anim slots (+0x122c, table +0x1220 stride 0x130) for that ItemConfig item and checks current anim != "SubAnim"; Weapon_Bone/Brimstone/Fetus::Fire prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Weapon::is_c_section_anim_finished(Weapon *this,int unused) { void *pvVar1; bool bVar2; byte bVar3; ItemConfig_Item *pIVar4; int iVar5; byte ******ppppppbVar6; bool bVar7; uint uVar8; uint uVar9; byte ******ppppppbVar10; int *local_3c; uint local_38; byte ******local_30 [4]; uint local_20; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; byte *****local_8; local_8 = (byte *****)0xffffffff; puStack_c = &LAB_00b1040e; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; bVar7 = false; pvVar1 = this->_owner; if ((pvVar1 == (void *)0x0) || (*(int *)((int)pvVar1 + 0x28) != 1)) { bVar3 = IsItemAnimFinished(this,0x2a6); } else { pIVar4 = ItemConfig::GetCollectible(&g_manager->_itemConfig,0x2a6); local_3c = (int *)((int)pvVar1 + 0x122c); local_38 = 0; do { if (((-1 < *local_3c) && ((char)local_3c[3] != '\0')) && (iVar5 = *local_3c * 0x130 + *(int *)((int)pvVar1 + 0x1220), *(ItemConfig_Item **)(iVar5 + 0x114) == pIVar4)) { if (*(char *)(iVar5 + 100) == '\0') { uVar8 = local_1c; ppppppbVar10 = local_30[0]; LAB_009f561f: bVar2 = false; } else { if (*(void **)(iVar5 + 0x54) == (void *)0x0) { local_20 = 0; local_1c = 0xf; local_30[0] = (byte ******)0x0; } else { std::string::string((char *)local_30,*(void **)(iVar5 + 0x54)); } uVar8 = local_1c; ppppppbVar10 = local_30[0]; bVar7 = true; uVar9 = 7; if (local_20 < 7) { uVar9 = local_20; } ppppppbVar6 = (byte ******)local_30; if (0xf < local_1c) { ppppppbVar6 = local_30[0]; } iVar5 = string_compare((byte *)ppppppbVar6,uVar9,(byte *)"SubAnim",7); if (iVar5 != 0) goto LAB_009f561f; bVar2 = true; } local_8 = (byte *****)0xffffffff; if ((bVar7) && (bVar7 = false, 0xf < uVar8)) { uVar9 = uVar8 + 1; ppppppbVar6 = ppppppbVar10; if (0xfff < uVar9) { ppppppbVar6 = (byte ******)ppppppbVar10[-1]; uVar9 = uVar8 + 0x24; if ((byte *)0x1f < (byte *)((int)ppppppbVar10 + (-4 - (int)ppppppbVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppppbVar6,uVar9); } if (bVar2) { ExceptionList = local_10; return 0; } } local_38 = local_38 + 1; local_3c = local_3c + 4; } while (local_38 < 0xf); bVar3 = 1; } ExceptionList = local_10; return bVar3; } //@@ 009f56c0 Weapon::SetBlinkTime /* ZHL [exact] __thiscall void Weapon::SetBlinkTime(int Delay); prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Weapon::SetBlinkTime(Weapon *this,int delay,int unused) { void *pvVar1; int iVar2; void *pvVar3; pvVar1 = this->_owner; if ((((pvVar1 == (void *)0x0) || (pvVar3 = pvVar1, *(int *)((int)pvVar1 + 0x28) != 1)) && (pvVar3 = (void *)0x0, pvVar1 != (void *)0x0)) && (*(int *)((int)pvVar1 + 0x28) == 3)) { iVar2 = *(int *)((int)pvVar1 + 0xd50); if (*(int *)((int)pvVar1 + 0xd50) < delay) { iVar2 = delay; } *(int *)((int)pvVar1 + 0xd50) = iVar2; } else if (pvVar3 != (void *)0x0) { iVar2 = *(int *)((int)pvVar3 + 0x1338); if (*(int *)((int)pvVar3 + 0x1338) < delay) { iVar2 = delay; } *(int *)((int)pvVar3 + 0x1338) = iVar2; return; } return; } //@@ 009f5720 Weapon::SetHeadLockTime /* ZHL [exact] __thiscall void Weapon::SetHeadLockTime(int Time); prototype: REPENTOGON, confirmed by RET 4 */ void __thiscall Weapon::SetHeadLockTime(Weapon *this,int Time) { void *pvVar1; int *piVar2; int *piVar3; void *pvVar4; pvVar1 = this->_owner; if ((((pvVar1 == (void *)0x0) || (pvVar4 = pvVar1, *(int *)((int)pvVar1 + 0x28) != 1)) && (pvVar4 = (void *)0x0, pvVar1 != (void *)0x0)) && (*(int *)((int)pvVar1 + 0x28) == 3)) { piVar2 = (int *)((int)pvVar1 + 0xda8); piVar3 = &Time; if (Time <= *piVar2) { piVar3 = piVar2; } *piVar2 = *piVar3; } else if (pvVar4 != (void *)0x0) { piVar2 = &Time; if (Time <= *(int *)((int)pvVar4 + 0x133c)) { piVar2 = (int *)((int)pvVar4 + 0x133c); } *(int *)((int)pvVar4 + 0x133c) = *piVar2; return; } return; } //@@ 009f5780 Weapon::set_head_direction /* DB: (dir): owner player -> +0x1628 = dir and the head animation string from the "HeadLeft".. table (PTR 00b60b30); familiar owner -> +0xd58 = dir; Weapon_SpiritSword::Fire before Weapon::SetHeadLockTime */ void Weapon::set_head_direction(int param_1) { byte bVar1; int iVar2; byte *text; int in_ECX; byte *pbVar3; int iVar4; iVar2 = *(int *)(in_ECX + 4); if ((((iVar2 == 0) || (iVar4 = iVar2, *(int *)(iVar2 + 0x28) != 1)) && (iVar4 = 0, iVar2 != 0)) && (*(int *)(iVar2 + 0x28) == 3)) { *(int *)(iVar2 + 0xd58) = param_1; } else if (iVar4 != 0) { *(int *)(iVar4 + 0x1628) = param_1; if (param_1 != -1) { text = (&PTR_s_HeadLeft_00b60b30)[param_1]; pbVar3 = text; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign((char *)(iVar4 + 0x1320),text,(int)pbVar3 - (int)(text + 1)); return; } } return; } //@@ 009f57f0 FUN_009f57f0 int FUN_009f57f0(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 1)) { return 0; } return (int)*(char *)(iVar1 + 0x1578); } //@@ 009f5810 FUN_009f5810 void FUN_009f5810(undefined1 param_1) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 1)) { *(undefined1 *)(iVar1 + 0x1578) = param_1; } return; } //@@ 009f5830 FUN_009f5830 undefined4 FUN_009f5830(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 1)) { return 0; } return *(undefined4 *)(iVar1 + 0x18f8); } //@@ 009f5850 FUN_009f5850 undefined4 FUN_009f5850(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 1)) { return 0; } return *(undefined4 *)(iVar1 + 0x18fc); } //@@ 009f5870 FUN_009f5870 undefined4 FUN_009f5870(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4); if ((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 1)) { return 0; } return *(undefined4 *)(iVar1 + 0x18a4); } //@@ 009f5890 Weapon::get_tear_movement_inheritance /* DB: this+4 owner: if player -> Entity_Player::GetTearMovementInheritance; if familiar -> uses owning player velocity*0.6*2 with Marked check (HasCollectible 0x18a); else zero; called from every Weapon_*::Fire prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Weapon::get_tear_movement_inheritance(Weapon *this,Vector *outResult,Vector *direction) { Entity_Player *pEVar1; int iVar2; byte bVar3; float fVar4; float fVar5; float fVar6; float fVar7; Vector local_10; pEVar1 = this->_owner; if (((pEVar1 != (Entity_Player *)0x0) && (*(float *)&this->field_0x28 == g_vectorZero.x)) && (*(float *)&this->field_0x2c == g_vectorZero.y)) { if (pEVar1->_type == 1) { Entity_Player::GetTearMovementInheritance(pEVar1,outResult,direction,0); return outResult; } if (pEVar1->_type == 3) { pEVar1 = *(Entity_Player **)&pEVar1->_isControlsEnabled; bVar3 = Entity_Player::HasCollectible(pEVar1,0x18a,0); if ((bVar3 == 0) || (pEVar1->_markedTarget == (void *)0x0)) { iVar2 = *(int *)((int)this->_owner + 0x410); fVar5 = *(float *)(iVar2 + 0x360) * 0.6; fVar6 = *(float *)(iVar2 + 0x364) * 0.6; fVar5 = fVar5 + fVar5; fVar6 = fVar6 + fVar6; if ((direction->x != g_vectorZero.x) || (direction->y != g_vectorZero.y)) { Vector::Normalized(direction,&local_10); fVar4 = fVar6 * local_10.y + fVar5 * local_10.x; fVar7 = local_10.y * fVar4; fVar4 = local_10.x * fVar4; if (fVar4 * local_10.x + fVar7 * local_10.y < 0.0) { fVar5 = fVar5 - fVar4; fVar6 = fVar6 - fVar7; } } outResult->x = fVar5; outResult->y = fVar6; return outResult; } } } outResult->x = g_vectorZero.x; outResult->y = g_vectorZero.y; return outResult; } //@@ 009f5a30 Weapon::GetOwnerLaserOffset /* DB: owner player GetLaserOffset or familiar(type 3) variant prototype: db/protos.zhl, confirmed by RET 12 */ Vector * __thiscall Weapon::GetOwnerLaserOffset(Weapon *this,Vector *outOffset,int laserOffsetId,Vector *direction) { int *piVar1; float fVar2; Entity_Player *this_00; fVar2 = g_vectorZero.y; this_00 = this->_owner; if (this_00 != (Entity_Player *)0x0) { piVar1 = &this_00->_type; if ((*piVar1 != 1) && (this_00 = (Entity_Player *)0x0, *piVar1 == 3)) { FUN_00631a00(outOffset,laserOffsetId,direction); return outOffset; } if (this_00 != (Entity_Player *)0x0) { Entity_Player::GetLaserOffset(this_00,outOffset,laserOffsetId,direction); return outOffset; } } outOffset->x = g_vectorZero.x; outOffset->y = fVar2; return outOffset; } //@@ 009f5aa0 FUN_009f5aa0 int FUN_009f5aa0(void) { int iVar1; uint3 uVar2; int in_ECX; iVar1 = *(int *)(in_ECX + 4); uVar2 = (uint3)((uint)iVar1 >> 8); if (((iVar1 == 0) || (*(int *)(iVar1 + 0x28) != 1)) || ((*(int *)(iVar1 + 0x145c) < 1 && ((*(int *)(iVar1 + 0x2c) != 1 || (*(int *)(iVar1 + 0x1aec) != 8)))))) { return (uint)uVar2 << 8; } return CONCAT31(uVar2,1); } //@@ 009f5ad0 Weapon::fire_tear /* DB: called from Weapon::TriggerTearEffects; this=Weapon (+4 owner); Entity_Player::FireTear(pos, dir, ...) when owner is a player else Game::SpawnEx(2,0,...) and vtable+0x40 (SetDamage); returns the tear prototype: db/protos.zhl, confirmed by RET 24 */ Entity_Tear * __thiscall Weapon::fire_tear(Weapon *this,Vector *position,Vector *velocity,uint flags,int unused, float damageMultiplier,float positionStep) { Entity_Player *this_00; Entity_Player *pEVar1; Entity_Tear *pEVar2; uint uVar3; int iVar4; float fVar5; float fVar6; float fVar7; float fVar8; int iStack_18; EntityPtr local_14; EntityPtr *local_10; EntityPtr local_c; this_00 = this->_owner; if (this_00 != (Entity_Player *)0x0) { if (this_00->_type == 1) { pEVar2 = Entity_Player::FireTear (this_00,position,*velocity,flags,(Entity *)this_00,damageMultiplier); } else { if (this_00->_type != 3) goto LAB_009f5b91; pEVar2 = Entity_Player::FireTear (*(Entity_Player **)&this_00->_isControlsEnabled,position,*velocity,flags, (Entity *)this_00,damageMultiplier); local_c = (EntityPtr)this->_owner; if (pEVar2->_spawnerEntity != (EntityPtr)0x0) { local_10 = &pEVar2->_spawnerEntity; std::multiset::erase(&local_10); } pEVar2->_spawnerEntity = local_c; if (local_c != (EntityPtr)0x0) { std::multiset::insert(&pEVar2->_spawnerEntity); } } local_14 = (EntityPtr)this; if (pEVar2 != (Entity_Tear *)0x0) goto LAB_009f5c1f; } LAB_009f5b91: uVar3 = Random(); pEVar2 = (Entity_Tear *)Game::SpawnEx(g_game,2,0,position,velocity,this->_owner,0,uVar3,0); (**(code **)(*(int *)pEVar2 + 0x40))(damageMultiplier * pEVar2->_collisionDamage); local_14 = *(EntityPtr *)(iStack_18 + 4); if (pEVar2->_parent != (EntityPtr)0x0) { local_10 = &pEVar2->_parent; std::multiset::erase(&local_10); } pEVar2->_parent = local_14; if (local_14 != (EntityPtr)0x0) { std::multiset::insert(&pEVar2->_parent); } (**(code **)(*(int *)pEVar2 + 0xc))(); LAB_009f5c1f: pEVar1 = *(Entity_Player **)((int)local_14 + 4); if ((pEVar1 != (Entity_Player *)0x0) && (pEVar1->_type == 1)) { iVar4 = Entity_Player::get_seeded_variant(pEVar1); if (iVar4 == 2) { local_c = (EntityPtr)(pEVar2->_velocity).x; local_10 = (EntityPtr *)(pEVar2->_velocity).y; uVar3 = Random(); fVar6 = (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.8; (pEVar2->_velocity).y = fVar6 * (float)local_10; (pEVar2->_velocity).x = fVar6 * (float)local_c; } } fVar6 = (pEVar2->_velocity).x * positionStep + (pEVar2->_pos).x; fVar8 = (pEVar2->_velocity).y * positionStep + (pEVar2->_pos).y; (pEVar2->_pos).x = fVar6; (pEVar2->_pos).y = fVar8; pEVar1 = *(Entity_Player **)((int)local_14 + 4); if ((pEVar1 != (Entity_Player *)0x0) && ((this_00 == (Entity_Player *)0x0 || (this_00 == pEVar1))) ) { if (pEVar1->_type == 1) { fVar5 = (pEVar1->_lastVelocity).x; fVar7 = (pEVar1->_lastVelocity).y; fVar5 = fVar5 + fVar5; fVar7 = fVar7 + fVar7; } else { fVar5 = (pEVar1->_velocity).x; fVar7 = (pEVar1->_velocity).y; } (pEVar2->_pos).y = fVar8 - fVar7 * positionStep; (pEVar2->_pos).x = fVar6 - fVar5 * positionStep; } return pEVar2; } //@@ 009f5d60 Weapon::fire_bomb /* DB: ? ECX is a Weapon; calls Entity_Player::FireBomb(pos, vel, owner) and returns the bomb (was a ZHL prefix match Room::MamaMegaExplosion) prototype: db/protos.zhl, confirmed by RET 8 */ Entity_Bomb * Weapon::fire_bomb(Weapon *weapon,Vector *position,Vector *velocity) { EntityPtr *pEVar1; Entity_Player *source; undefined4 uVar2; EntityPtr EVar3; Manager *pMVar4; Entity_Bomb *pEVar5; uint seed; Entity_Player *this; float fVar6; float local_10; EntityPtr *local_c [2]; source = weapon->_owner; if (source != (Entity_Player *)0x0) { if (source->_type == 1) { this = source; } else { if (source->_type != 3) goto LAB_009f5eb6; this = *(Entity_Player **)&source->_isControlsEnabled; } pEVar5 = Entity_Player::FireBomb(this,position,velocity,(Entity *)source); pMVar4 = g_manager; if (pEVar5 != (Entity_Bomb *)0x0) { if ((pEVar5->_variant == 0x13) || (pEVar5->_variant == 0x14)) { local_10 = 8.21161e-43; if (0.7 < pEVar5->_scale || pEVar5->_scale == 0.7) { local_10 = 8.1976e-43; } seed_fart_sound_override((int *)&local_10); SoundEffects::Play(&pMVar4->_sfxManager,(int)local_10,1.0,2,0,1.0,0.0); } local_10 = (pEVar5->_velocity).x; local_c[0] = (EntityPtr *)(pEVar5->_velocity).y; fVar6 = local_10 * local_10 + (float)local_c[0] * (float)local_c[0]; if (fVar6 < 36.0) { fVar6 = sqrtf(fVar6); if (0.0 < fVar6) { local_10 = local_10 * (1.0 / fVar6); local_c[0] = (EntityPtr *)((float)local_c[0] * (1.0 / fVar6)); } (pEVar5->_velocity).x = local_10 * 6.0; (pEVar5->_velocity).y = (float)local_c[0] * 6.0; } return pEVar5; } } LAB_009f5eb6: seed = Random(); pEVar5 = (Entity_Bomb *)Game::SpawnEx(g_game,4,0,position,velocity,weapon->_owner,0,seed,0); pEVar1 = &pEVar5->_parent; uVar2 = *(undefined4 *)((int)&pEVar5->_flags + 4); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags | 0x4000000; *(undefined4 *)((int)&pEVar5->_flags + 4) = uVar2; EVar3 = (EntityPtr)weapon->_owner; if (*pEVar1 != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = EVar3; if (EVar3 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } (**(code **)(*(int *)pEVar5 + 0xc))(); return pEVar5; } //@@ 009f5f40 Weapon::FireBrimstone /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] static cleanup Entity_Laser* Weapon::FireBrimstone(Entity* entity, const Vector& position, const Vector& direction, float damageMult, float unk1, unsigned int unk2); prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Entity_Laser * __cdecl Weapon::FireBrimstone (Entity *entity,Vector *position,Vector *direction,float damageMult,float unk1,uint unk2) { byte isOwned; int iVar1; Vector *mouthOffset; float *extraout_EAX; Entity_Laser *laser; uint uVar2; TearParams *hitParams; Entity **maxDistanceChoice; void *nullNameBlock; Entity_Player *player; bool isTechVariant; float fVar3; float offsetX; TearParams tearParams; float local_104; Vector flyingOffset; Vector mouthOffsetOut; uint local_dc; float angle; Vector *aimDirection; float mouthOffsetY; Vector laserOffset; Entity *local_c4; Entity *local_c0; float damageMultiplier; int laserVariant; uint fireFlags; Entity *local_b0; float laserScale; undefined1 hitParamsOut [108]; void *nullName; char local_38; char local_37; uint nullNameSize; uint nullNameCapacity; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = hitParamsOut + 0xa4; local_14 = 0xffffffff; puStack_18 = &LAB_00b1044d; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(hitParamsOut + 0x98); ExceptionList = &local_1c; aimDirection = direction; if ((entity != (Entity *)0x0) && (entity->_type == 3)) { player = *(Entity_Player **)&entity[1].field_0x4; local_b0 = entity; goto LAB_009f5ff5; } if (entity != (Entity *)0x0) { local_b0 = (Entity *)0x0; if (entity->_type == 1) { local_b0 = (Entity *)0x0; player = (Entity_Player *)entity; goto LAB_009f5ff5; } if (entity->_type == 3) { player = *(Entity_Player **)&entity[1].field_0x4; goto LAB_009f5ff5; } } local_b0 = (Entity *)0x0; player = (Entity_Player *)0x0; LAB_009f5ff5: local_c4 = entity; local_c0 = (Entity *)position; damageMultiplier = damageMult; angle = atan2f(direction->y,direction->x); angle = angle * 57.295776; laserScale = sqrtf(damageMultiplier); fireFlags = unk2; if ((char)unk2 < '\0') { laserScale = laserScale * 0.75; } if (local_b0 != (Entity *)0x0) { laserScale = laserScale * 0.5; } laserVariant = 1; if (player != (Entity_Player *)0x0) { isOwned = Entity_Player::HasCollectible(player,0x44,0); laserVariant = 1; if (isOwned != 0) { laserVariant = 9; } iVar1 = Entity_Player::GetCollectibleNum(player,0x76,0); if (1 < iVar1) { laserScale = laserScale + laserScale; } } local_dc = fireFlags & 0x200; if ((local_dc == 0) || ((player != (Entity_Player *)0x0 && (isOwned = Entity_Player::HasCollectible(player,0x76,0), isOwned != 0)))) { if ((fireFlags & 0x400) != 0) { laserScale = laserScale + laserScale; } } else { laserScale = laserScale * 0.5; } if (((player != (Entity_Player *)0x0) && (player->_playerType == 7)) && ((isOwned = Entity_Player::HasCollectible(player,0x26b,0), isOwned != 0 || (isOwned = TemporaryEffects::HasTrinketEffect(&player->_temporaryeffects,0xa2), isOwned != 0)) )) { laserScale = laserScale + laserScale; } if (1.5 < laserScale) { isTechVariant = laserVariant == 9; laserVariant = 0xb; laserScale = laserScale * 0.5; if (isTechVariant) { laserVariant = 0xe; } } laserOffset.y = 0.0; laserOffset.x = 0.0; if (local_b0 == (Entity *)0x0) { if (player != (Entity_Player *)0x0) { isOwned = Entity_Player::HasCollectible(player,0x2a6,0); if (isOwned == 0) { nullName = (void *)0x74756f4d; nullNameCapacity = 0xf; nullNameSize = 5; local_38 = 'h'; local_37 = '\0'; local_14 = 4; mouthOffset = Entity_Player::GetCostumeNullPos (player,&mouthOffsetOut,(std_string *)&nullName,1,&g_vectorZero); local_b0 = (Entity *)(mouthOffset->x / 0.65); mouthOffsetY = mouthOffset->y / 0.65; local_14 = 0xffffffff; if (0xf < nullNameCapacity) { uVar2 = nullNameCapacity + 1; nullNameBlock = nullName; if (0xfff < uVar2) { nullNameBlock = *(void **)((int)nullName + -4); uVar2 = nullNameCapacity + 0x24; if (0x1f < (uint)((int)nullName + (-4 - (int)nullNameBlock))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(nullNameBlock,uVar2); } fVar3 = mouthOffsetY; offsetX = (float)local_b0; if (player->_canFly != 0) { Entity_Player::GetFlyingOffset(player,&flyingOffset); offsetX = (float)local_b0 + *extraout_EAX / 0.65; fVar3 = extraout_EAX[1] / 0.65 + mouthOffsetY; } } else { fVar3 = (player->_sprite)._scale.y * -6.0; offsetX = (float)(Entity *)0x0; } laserOffset.x = offsetX; laserOffset.y = fVar3; } } else { laserOffset.x = (float)(aimDirection->x * 10.0 + 0.0); laserOffset.y = (4.0 - ABS(aimDirection->x) * 4.0) - 23.0; } if (((fireFlags & 0x280) == 0x200) && ((player == (Entity_Player *)0x0 || (isOwned = Entity_Player::HasCollectible(player,0x76,0), isOwned == 0)))) { iVar1 = 3; } else { iVar1 = 9; } laser = Entity_Laser::ShootAngle (laserVariant,(Vector *)local_c0,angle,iVar1,&laserOffset,entity,0); laser->_damageMultiplier = damageMultiplier; laser->_scale = laserScale; Entity_Laser::ResetSpriteScale(laser); TearParams::constructor(&tearParams); if (player != (Entity_Player *)0x0) { uVar2 = Random(); hitParams = (TearParams *) Entity_Player::GetTearHitParams (hitParamsOut,2,damageMultiplier,(uVar2 & 1) * 2 + -1,local_c4); TearParams::operator_(&tearParams,hitParams); } (**(code **)(*(int *)laser + 0x40))(tearParams._tearDamage); if (aimDirection->y <= -0.5) { fVar3 = -10.0; } else { fVar3 = 3000.0; } laser->_renderDepthOffset = fVar3; if ((player == (Entity_Player *)0x0) || (((player->_playerType != 7 && (isOwned = TemporaryEffects::HasTrinketEffect(&player->_temporaryeffects,0xa2), isOwned == 0) ) || (isOwned = Entity_Player::HasCollectible(player,0x76,0), isOwned != 0)))) { if ((fireFlags & 0x400) != 0) { laser->_maxDistance = 30.0; } } else { local_c0 = (Entity *)0x42700000; local_c4 = (Entity *)(player->_tearrange * 0.25 + 32.0); maxDistanceChoice = &local_c4; if ((float)local_c4 <= 60.0) { maxDistanceChoice = &local_c0; } laser->_maxDistance = (float)*maxDistanceChoice; } if ((local_dc != 0) && ((player == (Entity_Player *)0x0 || (isOwned = Entity_Player::HasCollectible(player,0x76,0), isOwned == 0)))) { local_104 = local_104 * 0.5; } laser->field_0x517 = 1; laser->_mass = local_104 * laser->_mass; *(undefined4 *)&(laser->_tearFlags)._l = (undefined4)tearParams._flags._l; *(undefined4 *)((int)&(laser->_tearFlags)._l + 4) = tearParams._flags._l._4_4_; *(undefined4 *)&(laser->_tearFlags)._h = (undefined4)tearParams._flags._h; *(undefined4 *)((int)&(laser->_tearFlags)._h + 4) = tearParams._flags._h._4_4_; ExceptionList = local_1c; return laser; } //@@ 009f6570 Weapon::fire_brimstone_with_color /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Weapon::FireBrimstone from owner position (+0x33c/+0x340), then laser vslot 0x3c (SetColor) with Weapon::get_laser_color (009f3f60); Weapon_Brimstone::Fire and 00a02890 Weapon_Brimstone::fire Entity_Laser * Weapon::fire_brimstone_with_color(Vector *param_1,uint param_2) { Entity *entity; code *pcVar1; Entity_Laser *pEVar2; ColorMod *pCVar3; Weapon *in_ECX; float in_XMM2_Da; undefined1 auStack_44 [4]; Vector local_40; ColorMod local_38; uint local_c; local_c = __security_cookie ^ (uint)auStack_44; entity = in_ECX->_owner; if (entity == (Entity *)0x0) { local_40.x = g_vectorZero.x; local_40.y = g_vectorZero.y; } else { local_40.x = (entity->_pos).x; local_40.y = (entity->_pos).y; } pEVar2 = FireBrimstone(entity,&local_40,param_1,in_XMM2_Da,local_40.y,param_2); pcVar1 = *(code **)(*(int *)pEVar2 + 0x3c); pCVar3 = get_laser_color(in_ECX,&local_38); (*pcVar1)(pCVar3,0xffffffff,0xff,0,1); return pEVar2; } //@@ 009f6610 Weapon::fire_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? Weapon::Fire callee (pos, dir, ..., flags): Entity_Player::FireTechLaser or Entity_Laser::ShootAngle with Weapon::GetOwnerLaserOffset, sets laser+0x515 prototype: db/protos.zhl, confirmed by RET 24 */ Entity_Laser * __thiscall Weapon::fire_laser(Weapon *this,Vector *position,uint offsetId,Vector *direction,byte isLeftEye, byte isOneHit,float damageScale) { int iVar1; code *pcVar2; void *pvVar3; Entity *source; Entity_Laser *pEVar4; uint uVar5; BitSet128 *ownerTearFlags; ColorMod *laserColor; float fVar6; float fVar7; undefined4 flagsHighLo; undefined4 flagsHighHi; undefined1 auStack_f8 [14]; byte savedIsOneHit; byte savedIsLeftEye; Weapon *weapon; int local_e4; float local_e0; Vector local_dc; Vector *savedPosition; uint savedOffsetId; Vector laserPos; float savedDamageScale; undefined1 local_c0 [8]; undefined8 uStack_b8; undefined1 auStack_a8 [52]; undefined4 uStack_74; float fStack_54; ColorMod local_40; uint local_14; Entity_Player *owner; local_14 = __security_cookie ^ (uint)auStack_f8; savedPosition = position; savedIsLeftEye = isLeftEye; local_e0 = (float)CONCAT31(local_e0._1_3_,isLeftEye); savedIsOneHit = isOneHit; local_e4 = CONCAT31(local_e4._1_3_,isOneHit); owner = this->_owner; savedOffsetId = offsetId; local_dc.x = (float)direction; savedDamageScale = damageScale; weapon = this; if (owner == (Entity_Player *)0x0) goto LAB_009f690b; if (owner->_type == 1) { pEVar4 = Entity_Player::FireTechLaser (owner,position,offsetId,direction,isLeftEye,isOneHit,(Entity *)0x0, damageScale); } else { if (owner->_type != 3) goto LAB_009f690b; local_e4 = *(int *)&owner->_isControlsEnabled; local_e0 = atan2f(direction->y,direction->x); uVar5 = savedOffsetId; GetOwnerLaserOffset(this,&laserPos,savedOffsetId,direction); local_c0._4_4_ = laserPos.y; laserPos.x = laserPos.x + savedPosition->x; local_c0._0_4_ = 0.0; laserPos.y = savedPosition->y + 0.0; pEVar4 = Entity_Laser::ShootAngle (2,&laserPos,local_e0 * 57.295776,3,(Vector *)local_c0,this->_owner,0); pEVar4->_oneHit = savedIsOneHit; pEVar4->_disableFollowParent = 1; if ((uVar5 == 2) && (uVar5 = Random(), uVar5 % 100 < 5)) { uVar5 = Random(); uVar5 = uVar5 % 0x54; fVar7 = (float)(1 << (uVar5 & 0x1f)); uStack_b8 = 0; fVar6 = 0.0; if (0x1f < uVar5) { fVar6 = fVar7; } fVar7 = (float)((uint)fVar7 ^ (uint)fVar6); if (0x3f < uVar5) { fVar6 = fVar7; } uStack_b8._0_4_ = 0; uStack_b8._4_4_ = 0; flagsHighLo = (undefined4)uStack_b8; flagsHighHi = uStack_b8._4_4_; local_c0._0_4_ = fVar7; local_c0._4_4_ = fVar6; } else { ownerTearFlags = get_owner_tear_flags(weapon,(BitSet128 *)local_c0); fVar7 = *(float *)&ownerTearFlags->_l; fVar6 = *(float *)((int)&ownerTearFlags->_l + 4); flagsHighLo = (undefined4)ownerTearFlags->_h; flagsHighHi = *(undefined4 *)((int)&ownerTearFlags->_h + 4); } iVar1 = *(int *)pEVar4; *(float *)&(pEVar4->_tearFlags)._l = fVar7; *(float *)((int)&(pEVar4->_tearFlags)._l + 4) = fVar6; *(undefined4 *)&(pEVar4->_tearFlags)._h = flagsHighLo; *(undefined4 *)((int)&(pEVar4->_tearFlags)._h + 4) = flagsHighHi; pcVar2 = *(code **)(iVar1 + 0x3c); laserColor = get_laser_color(weapon,&local_40); (*pcVar2)(laserColor,0xffffffff,0xff,0,1); if (local_e4 != 0) { if (savedOffsetId == 1) { pcVar2 = *(code **)(*(int *)pEVar4 + 0x40); fVar7 = get_damage(weapon); (*pcVar2)(fVar7); } else { pvVar3 = weapon->_owner; uVar5 = Random(); Entity_Player::GetTearHitParams(auStack_a8,3,savedDamageScale,(uVar5 & 1) * 2 + -1,pvVar3); (**(code **)(*(int *)pEVar4 + 0x40))(uStack_74); pEVar4->_mass = fStack_54 * pEVar4->_mass; } } pEVar4->_entityGridCollisionClass = 6; if (savedIsLeftEye == 0) { if ((*(float *)((int)local_dc.x + 4) <= -0.5) || (*(float *)local_dc.x <= -0.5)) goto LAB_009f68d2; fVar7 = 3000.0; } else if ((*(float *)((int)local_dc.x + 4) < -0.5) || (0.5 < *(float *)local_dc.x)) { LAB_009f68d2: fVar7 = -10.0; } else { fVar7 = 3000.0; } pEVar4->_renderDepthOffset = fVar7; pEVar4->field_0x517 = 1; direction = (Vector *)local_dc.x; } if (pEVar4 != (Entity_Laser *)0x0) { return pEVar4; } LAB_009f690b: source = weapon->_owner; fVar7 = atan2f(direction->y,direction->x); if (source == (Entity *)0x0) { local_dc.x = g_vectorZero.x; local_dc.y = g_vectorZero.y; } else { local_dc.x = (source->_pos).x; local_dc.y = (source->_pos).y; } pEVar4 = Entity_Laser::ShootAngle(2,&local_dc,fVar7 * 57.295776,3,&g_vectorZero,source,0); return pEVar4; } //@@ 009f6980 Weapon::fire_tech_x_laser /* DB: (pos, vel, radius in xmm3): owner player -> Entity_Player::FireTechXLaser; fallback Game::SpawnEx(7, 2) with parent owner, posOffset (0,-20), depth 3000, _radius; Weapon_TechX::Fire */ Entity_Laser * Weapon::fire_tech_x_laser(Vector *param_1,Vector *param_2,float param_3) { EntityPtr *pEVar1; Entity_Player *source; EntityPtr EVar2; Entity_Laser *pEVar3; uint seed; int in_ECX; Entity_Player *this; float in_XMM3_Da; EntityPtr *local_10; float local_c; source = *(Entity_Player **)(in_ECX + 4); local_c = in_XMM3_Da; if (source != (Entity_Player *)0x0) { if (source->_type == 1) { this = source; } else { if (source->_type != 3) goto LAB_009f69d8; this = *(Entity_Player **)&source->_isControlsEnabled; } pEVar3 = Entity_Player::FireTechXLaser(this,param_1,param_2,in_XMM3_Da,(Entity *)source,param_3) ; if (pEVar3 != (Entity_Laser *)0x0) { return pEVar3; } } LAB_009f69d8: seed = Random(); pEVar3 = (Entity_Laser *) Game::SpawnEx(g_game,7,2,param_1,param_2,*(Entity **)(in_ECX + 4),2,seed,0); pEVar1 = &pEVar3->_parent; (pEVar3->_posOffset).x = 0.0; (pEVar3->_posOffset).y = -20.0; EVar2 = *(EntityPtr *)(in_ECX + 4); if (*pEVar1 != (EntityPtr)0x0) { local_10 = pEVar1; std::multiset::erase(&local_10); } *pEVar1 = EVar2; if (EVar2 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } pEVar3->_renderDepthOffset = 3000.0; pEVar3->_radius = local_c; return pEVar3; } //@@ 009f6a60 Weapon::fire_knife /* DB: owner player or familiar's player -> Entity_Player::FireKnife, then sets the knife's _spawnerEntity to the owner; Weapon_Knife::Fire */ Entity_Knife * Weapon::fire_knife(Entity *param_1,uint param_2,byte param_3) { EntityPtr *pEVar1; EntityPtr EVar2; EntityPtr *in_ECX; EntityPtr this; Entity_Knife *pEVar3; float in_XMM3_Da; EntityPtr *local_c [2]; EVar2 = in_ECX[1]; pEVar3 = (Entity_Knife *)0x0; local_c[0] = in_ECX; if (EVar2 != (EntityPtr)0x0) { if (*(int *)((int)EVar2 + 0x28) == 1) { this = EVar2; } else { if (*(int *)((int)EVar2 + 0x28) != 3) goto LAB_009f6aa7; this = *(EntityPtr *)((int)EVar2 + 0x410); } pEVar3 = Entity_Player::FireKnife((Entity_Player *)this,param_1,param_2,in_XMM3_Da,param_3,0); } LAB_009f6aa7: pEVar1 = &pEVar3->_spawnerEntity; if (pEVar3->_spawnerEntity != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = EVar2; if (EVar2 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } return pEVar3; } //@@ 009f6af0 Weapon::fire_bone_club /* DB: owner player or familiar's player -> Entity_Player::FireBoneClub(..., this), then sets the result's +0x3c8 EntityPtr to the owner; Weapon_Bone::Fire */ Entity_Knife * Weapon::fire_bone_club(Entity *param_1,uint param_2,byte param_3) { EntityPtr *pEVar1; EntityPtr EVar2; Weapon *in_ECX; EntityPtr this; Entity_Knife *pEVar3; float in_XMM3_Da; Weapon *local_c [2]; EVar2 = (EntityPtr)in_ECX->_owner; pEVar3 = (Entity_Knife *)0x0; local_c[0] = in_ECX; if (EVar2 != (EntityPtr)0x0) { if (*(int *)((int)EVar2 + 0x28) == 1) { this = EVar2; } else { if (*(int *)((int)EVar2 + 0x28) != 3) goto LAB_009f6b2c; this = *(EntityPtr *)((int)EVar2 + 0x410); } pEVar3 = Entity_Player::FireBoneClub ((Entity_Player *)this,param_1,param_2,param_3,in_ECX,in_XMM3_Da); } LAB_009f6b2c: pEVar1 = &pEVar3->_spawnerEntity; if (pEVar3->_spawnerEntity != (EntityPtr)0x0) { local_c[0] = (Weapon *)pEVar1; std::multiset::erase(local_c); } *pEVar1 = EVar2; if (EVar2 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } return pEVar3; } //@@ 009f6b70 Weapon::fire_brimstone_ball /* DB: (pos, vel, offset): owner (this+4) player or familiar's player -> Entity_Player::FireBrimstoneBall; fallback Game::SpawnEx(1000, 0x71) with parent = owner, posOffset, timeout/lifespan 0x24, depth 3000; Weapon_Bone::Fire */ Entity_Effect * Weapon::fire_brimstone_ball(Vector *param_1,Vector *param_2,Vector *param_3) { EntityPtr *pEVar1; EntityPtr EVar2; Entity_Effect *pEVar3; uint seed; EntityPtr *in_ECX; EntityPtr this; uint in_stack_ffffffdc; uint in_stack_ffffffe0; Entity *in_stack_ffffffe4; EntityPtr *local_c [2]; EVar2 = in_ECX[1]; local_c[0] = in_ECX; if (EVar2 != (EntityPtr)0x0) { if (*(int *)((int)EVar2 + 0x28) == 1) { this = EVar2; } else { if (*(int *)((int)EVar2 + 0x28) != 3) goto LAB_009f6bb9; this = *(EntityPtr *)((int)EVar2 + 0x410); } pEVar3 = Entity_Player::FireBrimstoneBall ((Entity_Player *)this,param_1,param_2,param_3,in_stack_ffffffdc, in_stack_ffffffe0,in_stack_ffffffe4); if (pEVar3 != (Entity_Effect *)0x0) { return pEVar3; } } LAB_009f6bb9: seed = Random(); pEVar3 = (Entity_Effect *) Game::SpawnEx(g_game,1000,0x71,param_1,param_2,(Entity *)local_c[0][1],0,seed,0); pEVar1 = &pEVar3->_parent; if (pEVar3->_parent != (EntityPtr)0x0) { local_c[0] = pEVar1; std::multiset::erase(local_c); } *pEVar1 = EVar2; if (EVar2 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } (pEVar3->_posOffset).x = param_3->x; (pEVar3->_posOffset).y = param_3->y; pEVar3->_timeout = 0x24; pEVar3->_lifespan = 0x24; pEVar3->_renderDepthOffset = 3000.0; return pEVar3; } //@@ 009f6c50 Weapon::FireSword /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [exact] __thiscall Entity_Knife* Weapon::FireSword(Entity * param_1, unsigned int param_2, float param_3, bool param_4, bool param_5, unsigned int param_6, Entity * param_7); prototype: REPENTOGON, confirmed by RET 24 */ Entity_Knife * __thiscall Weapon::FireSword(Weapon *this,Entity *param_2,uint param_3,float param_4,byte param_5,byte param_6, uint param_7,Entity *param_8) { EntityPtr *pEVar1; void *pvVar2; int iVar3; undefined4 uVar4; Entity_Knife *pEVar5; uint uVar6; Entity *pEVar7; Entity *local_98; EntityPtr *local_94; Vector local_90; uint local_88; EntityPtr local_84; Entity *local_80; float local_7c; undefined1 local_78 [16]; undefined4 uStack_68; undefined4 uStack_64; undefined4 uStack_60; undefined4 uStack_5c; undefined4 uStack_58; uint local_c; local_c = __security_cookie ^ (uint)&local_98; local_84 = (EntityPtr)param_2; local_94 = (EntityPtr *)param_3; pEVar7 = this->_owner; local_98 = (Entity *)0x0; if (pEVar7 != (Entity *)0x0) { if (pEVar7->_type == 1) { local_98 = pEVar7; } else if (pEVar7->_type == 3) { local_98 = *(Entity **)&pEVar7[1].field_0x4; } } local_80 = pEVar7; local_7c = param_4; local_88 = Random(); pvVar2 = this->_owner; if (pvVar2 == (void *)0x0) { local_90.x = g_vectorZero.x; local_90.y = g_vectorZero.y; } else { local_90.x = *(float *)((int)pvVar2 + 0x33c); local_90.y = *(float *)((int)pvVar2 + 0x340); } pEVar5 = (Entity_Knife *) Game::SpawnEx(g_game,8,(uint)local_94,&local_90,&g_vectorZero,pEVar7,0,local_88,0); if ((pEVar5 == (Entity_Knife *)0x0) || (pEVar5->_type != 8)) { pEVar5 = (Entity_Knife *)0x0; } pEVar1 = &pEVar5->_parent; if (pEVar5->_parent != (EntityPtr)0x0) { local_94 = pEVar1; std::multiset::erase(&local_94); } *pEVar1 = local_84; if (local_84 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } (pEVar5->_posOffset).x = 0.0; (pEVar5->_posOffset).y = -10.0; if (local_98 != (Entity *)0x0) { pEVar7 = local_80; uVar6 = Random(); Entity_Player::GetTearHitParams(local_78,0xd,0x3f800000,(uVar6 & 1) * 2 + -1,pEVar7); (**(code **)(*(int *)pEVar5 + 0x3c))(&local_84,0xffffffff,0xff,0,1); iVar3 = *(int *)pEVar5; *(undefined4 *)&(pEVar5->_tearFlags)._l = uStack_68; *(undefined4 *)((int)&(pEVar5->_tearFlags)._l + 4) = uStack_64; *(undefined4 *)&(pEVar5->_tearFlags)._h = uStack_60; *(undefined4 *)((int)&(pEVar5->_tearFlags)._h + 4) = uStack_5c; (**(code **)(iVar3 + 0x40))(uStack_58); } if (360.0 < ABS(local_7c)) { local_7c = fmodf(local_7c,360.0); } if (local_7c <= 180.0) { if (local_7c < -180.0) { local_7c = local_7c + 360.0; } } else { local_7c = local_7c - 360.0; } pEVar5->_rotationOffset = local_7c; if (param_5 != 0) { uVar4 = *(undefined4 *)((int)&pEVar5->_flags + 4); *(uint *)&pEVar5->_flags = (uint)pEVar5->_flags | 0x200000; *(undefined4 *)((int)&pEVar5->_flags + 4) = uVar4; } return pEVar5; } //@@ 009f6e60 fire_fetus_tear /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? (pos, vel, variant 7, source, dmgMult): TearParams from GetTearHitParams(WEAPON_FETUS 0xe), Marked flag strip; callers sprinkler and Weapon_Fetus::Fire prototype: db/protos.zhl, confirmed by RET 24 */ Entity_Tear * __thiscall fire_fetus_tear(void *this,Vector *position,Vector *velocity,int fireFlags,Entity *source, float damageMultiplier,int unused) { float fVar1; int iVar2; BitSet128 flags; Game *pGVar3; undefined4 uVar4; byte bVar5; uint uVar6; uint uVar7; TearParams *other; BitSet128 *pBVar8; Entity_Tear *this_00; Vector **ppVVar9; int *piVar10; int iVar11; Vector **ppVVar12; byte ****ppppbVar13; Entity *pEVar14; byte unk; byte *pbVar15; EntityPtr extraout_EDX; EntityPtr EVar16; EntityPtr this_01; byte ****ppppbVar17; float fVar18; Vector *pVVar19; Vector local_150; float local_148; Vector local_144; Vector local_13c; Vector *local_134; Vector *local_130; Vector *local_12c; undefined1 local_128 [68]; uint uStack_e4; float local_e0; Vector *local_dc; Vector *local_d8; float local_d4; float local_d0; float local_cc; undefined1 local_c0 [104]; byte ****local_58 [2]; undefined1 local_50 [8]; Vector local_48; undefined1 local_40 [20]; float fStack_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_40 + 0x3c; local_14 = 0xffffffff; puStack_18 = &LAB_00b10495; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_40 + 0x30); ExceptionList = &local_1c; local_12c = velocity; local_130 = (Vector *)damageMultiplier; local_134 = this; local_24 = uVar6; TearParams::constructor((TearParams *)local_128); EVar16 = extraout_EDX; if (extraout_EDX == (EntityPtr)0x0) { EVar16 = *(EntityPtr *)((int)this + 4); } this_01 = (EntityPtr)0x0; if (*(int *)((int)EVar16 + 0x28) == 1) { this_01 = EVar16; LAB_009f6ef1: if (this_01 != (EntityPtr)0x0) { uVar7 = Random(); other = (TearParams *) Entity_Player::GetTearHitParams (local_c0,0xe,local_130,(uVar7 & 1) * 2 + -1,EVar16,uVar6); TearParams::operator_((TearParams *)local_128,other); bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x18a,0); if (bVar5 != 0) { pBVar8 = BitSet128::__bnot((BitSet128 *)&DAT_00c34b40,(BitSet128 *)(local_40 + 8)); local_128._56_4_ = local_128._56_4_ & (uint)pBVar8->_l; local_128._60_4_ = local_128._60_4_ & *(uint *)((int)&pBVar8->_l + 4); local_128._64_4_ = local_128._64_4_ & (uint)pBVar8->_h; uStack_e4 = uStack_e4 & *(uint *)((int)&pBVar8->_h + 4); } } } else if (*(int *)((int)EVar16 + 0x28) == 3) { this_01 = *(EntityPtr *)((int)EVar16 + 0x410); goto LAB_009f6ef1; } uVar4 = local_128._56_4_; local_130 = (Vector *)local_128._64_4_; pBVar8 = BitSet128::operator_or ((BitSet128 *)(local_40 + 8),(BitSet128 *)&DAT_00c34580, (BitSet128 *)&DAT_00c345d0); pBVar8 = BitSet128::__bnot(pBVar8,(BitSet128 *)local_50); uVar6 = uVar4 & (uint)pBVar8->_l; local_128._60_4_ = local_128._60_4_ & *(uint *)((int)&pBVar8->_l + 4); local_130 = (Vector *)((uint)local_130 & (uint)pBVar8->_h); uStack_e4 = uStack_e4 & *(uint *)((int)&pBVar8->_h + 4); local_128._56_4_ = uVar6; local_128._64_4_ = local_130; pBVar8 = BitSet128::operator_or ((BitSet128 *)(local_40 + 8),(BitSet128 *)&DAT_00c34780,&g_tearFlagSpectral); local_128._56_4_ = uVar6 | (uint)pBVar8->_l; local_128._60_4_ = local_128._60_4_ | *(uint *)((int)&pBVar8->_l + 4); local_128._64_4_ = (uint)local_130 | (uint)pBVar8->_h; uStack_e4 = uStack_e4 | *(uint *)((int)&pBVar8->_h + 4); if (this_01 != (EntityPtr)0x0) { bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x34,0); if ((bVar5 != 0) || (bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0xa8,0), bVar5 != 0)) { local_128._56_4_ = local_128._56_4_ | DAT_00c34770; local_128._60_4_ = local_128._60_4_ | DAT_00c34774; local_128._64_4_ = local_128._64_4_ | DAT_00c34778; uStack_e4 = uStack_e4 | DAT_00c3477c; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x44,0); if (bVar5 != 0) { local_128._56_4_ = local_128._56_4_ | DAT_00c34750; local_128._60_4_ = local_128._60_4_ | DAT_00c34754; local_128._64_4_ = local_128._64_4_ | DAT_00c34758; uStack_e4 = uStack_e4 | DAT_00c3475c; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x18b,0); if (bVar5 != 0) { local_128._56_4_ = local_128._56_4_ | DAT_00c34740; local_128._60_4_ = local_128._60_4_ | DAT_00c34744; local_128._64_4_ = local_128._64_4_ | DAT_00c34748; uStack_e4 = uStack_e4 | DAT_00c3474c; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x76,0); if (bVar5 != 0) { local_128._56_4_ = local_128._56_4_ | _DAT_00c34760; local_128._60_4_ = local_128._60_4_ | _DAT_00c34764; local_128._64_4_ = local_128._64_4_ | _DAT_00c34768; uStack_e4 = uStack_e4 | _DAT_00c3476c; } if (local_134[6].x == 1.4013e-44) { local_128._56_4_ = local_128._56_4_ | _DAT_00c34720; local_128._60_4_ = local_128._60_4_ | _DAT_00c34724; local_128._64_4_ = local_128._64_4_ | _DAT_00c34728; uStack_e4 = uStack_e4 | _DAT_00c3472c; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x72,0); if (bVar5 != 0) { local_128._56_4_ = local_128._56_4_ | DAT_00c34730; local_128._60_4_ = local_128._60_4_ | DAT_00c34734; local_128._64_4_ = local_128._64_4_ | DAT_00c34738; uStack_e4 = uStack_e4 | DAT_00c3473c; } bVar5 = Entity_Player::HasCollectible((Entity_Player *)this_01,0x243,0); if (bVar5 != 0) { local_128._56_4_ = local_128._56_4_ | DAT_00c34710; local_128._60_4_ = local_128._60_4_ | DAT_00c34714; local_128._64_4_ = local_128._64_4_ | DAT_00c34718; uStack_e4 = uStack_e4 | DAT_00c3471c; } } uVar6 = Random(); local_150.x = local_12c->x + position->x; local_150.y = local_12c->y + position->y; this_00 = (Entity_Tear *) Game::Spawn(g_game,2,local_128._0_4_,&local_150,local_12c,(Entity *)local_134->y,0,uVar6 ); (this_00->_velocity).y = (this_00->_velocity).y * local_cc; (this_00->_velocity).x = (this_00->_velocity).x * local_cc; local_12c = local_d8; this_00->_height = (float)local_d8; fVar18 = Entity_Tear::get_height_offset_y(this_00,(float)local_d8); pGVar3 = g_game; (this_00->_posOffset).y = fVar18; if ((*(int *)((int)pGVar3->_room + 8) == 0x10) && ((this_00->_posOffset).y = -18.0, -5.1 < (float)local_12c)) { this_00->_height = -5.1; } (**(code **)(*(int *)this_00 + 0x40))(local_e0 * 0.75); flags._l._4_4_ = local_128._60_4_; flags._l._0_4_ = local_128._56_4_; flags._h._0_4_ = local_128._64_4_; flags._h._4_4_ = uStack_e4; Entity_Tear::SetTearFlags(this_00,flags); local_134 = (Vector *)0x3c23d70a; local_12c = local_dc; ppVVar12 = &local_12c; if ((float)local_dc <= 0.01) { ppVVar12 = &local_134; } pVVar19 = *ppVVar12; this_00->_baseScale = (float)pVVar19; this_00->_fScale = (float)pVVar19; Entity_Tear::ResetSpriteScale(this_00); (**(code **)(*(int *)this_00 + 0x3c))(local_128 + 8,0xffffffff,0xff,0,1); if (this_01 == (EntityPtr)0x0) { fVar18 = 260.0; } else { fVar18 = *(float *)((int)this_01 + 0x1480); } this_00->_tearRange = fVar18; if (this_00->_parent != (EntityPtr)0x0) { local_12c = (Vector *)&this_00->_parent; std::multiset::erase(&local_12c); } this_00->_parent = this_01; if (this_01 != (EntityPtr)0x0) { std::multiset::insert(&this_00->_parent); } if ((fireFlags & 4U) != 0) { this_00->_canTriggerStreakEnd = 0; } local_130 = (Vector *)0x0; if (this_01 != (EntityPtr)0x0) { if (0 < *(int *)((int)this_01 + 0x18b0)) { local_12c = (Vector *)0x8; ppVVar12 = &local_12c; if (*(int *)((int)this_01 + 0x18b0) < 8) { ppVVar12 = (Vector **)((int)this_01 + 0x18b0); } local_12c = (Vector *)((float)(int)*ppVVar12 * 0.125); ppVVar9 = &local_12c; if ((float)(int)*ppVVar12 * 0.125 <= 0.0) { ppVVar9 = &local_130; } local_130 = *ppVVar9; } } pVVar19 = local_130; if (*(char *)((int)this_01 + 0x1519) == '\0') { for (piVar10 = *(int **)((int)this_01 + 0x150c); piVar10 != *(int **)((int)this_01 + 0x1510); piVar10 = piVar10 + 4) { if ((*(int *)*piVar10 == 0) && (((int *)*piVar10)[1] == 0x6f)) { iVar2 = piVar10[1]; if (0 < iVar2) { iVar11 = 0x10; if (iVar2 < 0x10) { iVar11 = iVar2; } local_12c = (Vector *)((float)iVar11 * 0.0625); ppVVar12 = &local_12c; if ((float)iVar11 * 0.0625 <= (float)local_130) { ppVVar12 = &local_130; } pVVar19 = *ppVVar12; } break; } } } if (0.0 < (float)pVVar19) { Entity_Tear::SetDeadEyeIntensity(this_00,(float)pVVar19); } this_00->_mass = local_d4 * this_00->_mass; this_00->_knockbackMultiplier = local_d0; iVar2 = *(int *)((int)this_01 + 0x146c); *(int *)((int)this_01 + 0x146c) = iVar2 + 1; this_00->_tearIdx = iVar2; if ((this_00->_variant == 0x32) && ((this_00->_sprite)._layerCount != 0)) { local_40._8_4_ = *(undefined4 *)&(this_00->_tearFlags)._l; local_40._12_4_ = *(undefined4 *)((int)&(this_00->_tearFlags)._l + 4); local_40._16_4_ = *(undefined4 *)&(this_00->_tearFlags)._h; fStack_2c = *(float *)((int)&(this_00->_tearFlags)._h + 4); local_134 = *(Vector **)((int)this_01 + 0x13c0); pBVar8 = BitSet128::operator_and ((BitSet128 *)local_50,(BitSet128 *)(local_40 + 8),(BitSet128 *)&DAT_00c348f0 ); if (((int)pBVar8->_l != 0 || *(int *)((int)&pBVar8->_l + 4) != 0) || ((int)pBVar8->_h != 0 || *(int *)((int)&pBVar8->_h + 4) != 0)) { local_134 = (Vector *)0x10; } ANM2::GetLayer(&this_00->_sprite,(byte *)0x0); FUN_004562f0(local_58); local_14 = 0; costume_path_apply_skin_color (local_40,local_58,*(int *)((int)this_01 + 0x1898),(int)local_134,(byte *)0x0, (byte *)0x0); ppppbVar17 = local_58[0]; local_14 = CONCAT31(local_14._1_3_,1); ppppbVar13 = (byte ****)local_58; if (0xf < (uint)local_48.y) { ppppbVar13 = local_58[0]; } pbVar15 = local_40; if (0xf < (uint)fStack_2c) { pbVar15 = (byte *)local_40._0_4_; } bVar5 = str_eq(pbVar15,local_40._16_4_,(byte *)ppppbVar13,(uint)local_48.x); if (bVar5 == 0) { Sprite::ReplaceSpritesheet((Sprite *)&this_00->_sprite,0,(std_string *)local_40); ANM2::LoadGraphics(&this_00->_sprite,unk); ppppbVar17 = local_58[0]; } local_14 = local_14 & 0xffffff00; if (0xf < (uint)fStack_2c) { uVar6 = (int)fStack_2c + 1; pbVar15 = (byte *)local_40._0_4_; if (0xfff < uVar6) { pbVar15 = *(byte **)(local_40._0_4_ + -4); uVar6 = (int)fStack_2c + 0x24; if ((byte *)0x1f < (byte *)(local_40._0_4_ + (-4 - (int)pbVar15))) goto LAB_009f7686; } operator_delete(pbVar15,uVar6); ppppbVar17 = local_58[0]; } local_14 = 0xffffffff; local_40._16_4_ = 0.0; fStack_2c = 2.10195e-44; local_40._0_4_ = local_40._0_4_ & 0xffffff00; if (0xf < (uint)local_48.y) { uVar6 = (int)local_48.y + 1; ppppbVar13 = ppppbVar17; if (0xfff < uVar6) { ppppbVar13 = (byte ****)ppppbVar17[-1]; uVar6 = (int)local_48.y + 0x24; if ((byte *)0x1f < (byte *)((int)ppppbVar17 + (-4 - (int)ppppbVar13))) { LAB_009f7686: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar13,uVar6); } } fVar18 = (this_00->_velocity).x; fVar1 = (this_00->_velocity).y; if (0.001 < fVar18 * fVar18 + fVar1 * fVar1) { uVar6 = Random(); local_144.x = (this_00->_velocity).x; local_144.y = (this_00->_velocity).y; local_13c.x = (this_00->_pos).x; local_13c.y = (this_00->_pos).y; pEVar14 = Game::Spawn(g_game,1000,2,&local_13c,&local_144,(Entity *)0x0,2,uVar6); iVar2 = *(int *)pEVar14; (pEVar14->_posOffset).x = 0.0; (pEVar14->_posOffset).y = -15.0; (**(code **)(iVar2 + 0xc))(); local_130 = (Vector *)(this_00->_velocity).x; local_148 = (this_00->_velocity).y; uVar6 = Random(); local_13c.y = (float)((uVar6 & 1) + 1); uVar7 = Random(); local_144.y = (float)((uVar7 & 1) + (uVar6 & 1) + 4); fVar18 = 0.0; do { uVar6 = Random(); local_12c = (Vector *) (((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292); local_134 = (Vector *)cos((float)local_12c); local_12c = (Vector *)sin((float)local_12c); uVar6 = Random(); local_48.y = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_48.x = ((float)local_134 * (float)local_130 - (float)local_12c * local_148) * local_48.y ; local_48.y = ((float)local_12c * (float)local_130 + (float)local_134 * local_148) * local_48.y ; local_40._16_4_ = (this_00->_pos).x + local_48.x; fStack_2c = (this_00->_pos).y + local_48.y; uVar6 = Random(); pEVar14 = Game::Spawn(g_game,1000,5,(Vector *)(local_40 + 0x10),&local_48,(Entity *)0x0, (-(uint)((uint)fVar18 < (uint)local_13c.y) & 0xffffff9d) + 99,uVar6); (**(code **)(*(int *)pEVar14 + 0xc))(); fVar18 = (float)((int)fVar18 + 1); } while ((int)fVar18 < (int)local_144.y); } (**(code **)(*(int *)this_00 + 0xc))(); fVar18 = (this_00->_velocity).y; (this_00->_pos).x = (this_00->_pos).x - (this_00->_velocity).x; (this_00->_pos).y = (this_00->_pos).y - fVar18; lua_callback_run_post_fire_tear(this_00); ExceptionList = local_1c; return this_00; } //@@ 009f7930 Weapon::TriggerTearEffects /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? spawns synergy tears/candles/coins/flies per tick along dir; Brimstone::Fire and other weapons prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall Weapon::TriggerTearEffects(Weapon *this,Vector *direction,int count) { float fVar1; BitSet128 flags; BitSet128 flags_00; BitSet128 flags_01; BitSet128 flags_02; BitSet128 flags_03; byte bVar2; Vector *inheritedVelocity; Entity_Tear *tear; int iVar3; uint uVar4; void *owner; uint uVar5; uint uVar6; int extraout_EDX; float *extraout_EDX_00; Entity_Player *player; int *unaff_EDI; uint uVar7; Weapon *weapon; bool bVar8; bool bVar9; float fVar10; EntityPtr EVar11; float fVar12; Weapon *pWVar13; undefined1 auStackY_374 [128]; int iVar14; EntityPtr EStack_2b8; float fStack_2b4; EntityPtr local_2ac; Vector local_2a8; Entity_Tear *local_2a0; byte isBirdsEye; byte isGhostPepper; int i; Vector VStack_290; undefined1 local_288 [8]; float local_280; float fStack_27c; float fStack_278; float aimDirX; float aimDirY; Vector triggerPos; Vector spiderOrigin; Vector firePos; undefined1 auStack_248 [8]; undefined1 auStack_240 [8]; undefined1 local_238 [8]; float fStack_230; Vector aVStack_22c [2]; uint uStack_218; uint uStack_214; uint local_210; uint uStack_20c; uint uStack_208; uint uStack_204; uint uStack_200; uint uStack_1fc; float fStack_1e0; uint uStack_1dc; uint uStack_1d8; uint uStack_1d4; Vector spiderPos; undefined1 local_1c0 [48]; undefined1 auStack_190 [8]; Vector aVStack_188 [6]; undefined4 uStack_158; uint uStack_154; undefined1 auStack_150 [4]; undefined4 uStack_14c; undefined4 uStack_148; undefined4 uStack_144; undefined4 uStack_140; undefined4 uStack_13c; undefined4 uStack_138; undefined4 uStack_134; undefined4 uStack_130; undefined8 uStack_12c; undefined4 uStack_124; undefined4 uStack_120; uint uStack_11c; uint uStack_118; uint uStack_114; uint uStack_110; float fStack_10c; float fStack_108; float fStack_104; uint uStack_ec; undefined1 auStack_e8 [48]; uint uStack_b8; uint uStack_b4; uint uStack_b0; uint uStack_ac; float fStack_a4; float fStack_9c; ColorMod tearTint; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float fStack_1c; float local_18; uint local_14; Game *game; Manager *manager; local_14 = __security_cookie ^ (uint)&EStack_2b8; local_2ac = (EntityPtr)direction; if (count < 1) { return; } VStack_290.y = (float)this->_owner; local_288._0_4_ = this; if ((EntityPtr)VStack_290.y == (EntityPtr)0x0) { LAB_009f79d6: player = (Entity_Player *)0x0; VStack_290.y = 0.0; } else { if (*(int *)((int)VStack_290.y + 0x28) != 1) { if (*(int *)((int)VStack_290.y + 0x28) != 3) goto LAB_009f79d6; player = *(Entity_Player **)((int)VStack_290.y + 0x410); VStack_290.y = (float)player; if ((EntityPtr)player == (EntityPtr)0x0) goto LAB_009f79dc; } player = (Entity_Player *)VStack_290.y; if (*(int *)((int)VStack_290.y + 0x1600) == 0) { local_2a8.x = (float)((int)VStack_290.y + 0x1580); uVar7 = 0; do { if (*(int *)local_2a8.x == 0x143) { Entity_Player::AddActiveCharge(player,count,uVar7,0,0,1); } uVar7 = uVar7 + 1; local_2a8.x = (float)((int)local_2a8.x + 0x20); } while (uVar7 < 4); } } LAB_009f79dc: EVar11 = local_2ac; if ((((*(float *)local_2ac == g_vectorZero.x) && (*(float *)((int)local_2ac + 4) == g_vectorZero.y)) && (EVar11 = (EntityPtr)(local_288._0_4_ + 0x20), *(float *)(local_288._0_4_ + 0x20) == g_vectorZero.x)) && ((*(float *)(local_288._0_4_ + 0x24) == g_vectorZero.y && ((EntityPtr)player != (EntityPtr)0x0) ))) { EVar11 = (EntityPtr)((int)player + 0x1630); } aimDirX = *(float *)EVar11; fVar10 = *(float *)&((Entity *)EVar11)->field_0x4; i = 0; aimDirY = fVar10; local_238._0_4_ = aimDirX; local_238._4_4_ = fVar10; do { weapon = (Weapon *)local_288._0_4_; if ((EntityPtr)player == (EntityPtr)0x0) { LAB_009f8615: *(int *)(weapon + 1) = *(int *)(weapon + 1) + 1; if ((EntityPtr)player != (EntityPtr)0x0) goto LAB_009f8620; } else { owner = *(void **)(local_288._0_4_ + 4); if (owner == (void *)0x0) { triggerPos.x = g_vectorZero.x; triggerPos.y = g_vectorZero.y; } else { triggerPos.x = *(float *)((int)owner + 0x33c); triggerPos.y = *(float *)((int)owner + 0x340); } trigger_set_dispatch ((void *)((int)player + 0x1fc8),1,(Entity *)0x0,&triggerPos,(Vector *)local_238); bVar2 = Entity_Player::HasCollectible(player,0xd9,0); if (bVar2 != 0) { FUN_009f3c10(); fVar10 = fVar10 + fVar10; local_2ac = (EntityPtr)(0x14 - (int)fVar10); if ((int)local_2ac < 1) { local_2ac = (EntityPtr)0x1; } if (((local_2ac == (EntityPtr)0x0) || (uVar7 = Random(), uVar7 % (uint)local_2ac == 0)) && ((local_2ac = *(EntityPtr *)((int)player + 0x1370), (uint)local_2ac <= (Entity *)&DAT_00000004 || (((bVar2 = Entity_Player::HasCollectible(player,0xf8,0), bVar2 != 0 || (bVar2 = TemporaryEffects::HasCollectibleEffect ((TemporaryEffects *)((int)player + 0x1508),0xf8), bVar2 != 0)) && ((uint)local_2ac <= (Entity *)&DAT_00000009)))))) { owner = *(void **)((int)weapon + 4); if (owner == (void *)0x0) { spiderOrigin.x = g_vectorZero.x; spiderOrigin.y = g_vectorZero.y; fVar10 = g_vectorZero.y; } else { spiderOrigin.x = *(float *)((int)owner + 0x33c); spiderOrigin.y = *(float *)((int)owner + 0x340); } Room::FindFreePickupSpawnPosition(g_game->_room,&spiderPos,&spiderOrigin,0.0,0,0,0); *(int *)((int)player + 0x1370) = *(int *)((int)player + 0x1370) + 1; spawn_blue_spider(&spiderPos,(Entity *)player,&g_vectorZero); } } bVar2 = Entity_Player::HasCollectible(player,0x23d,0); if (bVar2 != 0) { uVar7 = Random(); if ((uVar7 & 3) == 0) { Isaac::GetAxisAlignedUnitVectorFromDir ((Vector *)(local_288 + 4),*(int *)((int)player + 0x1628)); local_2ac = (EntityPtr)((float)local_288._4_4_ * 10.0); local_2a0 = (Entity_Tear *)(local_280 * 10.0); iVar14 = 0x9f7c3f; local_288._4_4_ = local_2ac; local_280 = (float)local_2a0; inheritedVelocity = get_tear_movement_inheritance (weapon,(Vector *)(auStack_190 + 4),(Vector *)(local_288 + 4)); owner = *(void **)((int)weapon + 4); if (owner == (void *)0x0) { LAB_009f7c88: fVar10 = 1.0; } else if (*(int *)((int)owner + 0x28) == 1) { fVar10 = *(float *)((int)owner + 0x1464); } else { if ((*(int *)((int)owner + 0x28) != 3) || (*(int *)((int)owner + 0x410) == 0)) goto LAB_009f7c88; fVar10 = *(float *)(*(int *)((int)owner + 0x410) + 0x1464); } local_2ac = (EntityPtr)(fVar10 * ((float)local_2ac + inheritedVelocity->x)); local_2a0 = (Entity_Tear *)(fVar10 * ((float)local_2a0 + inheritedVelocity->y)); local_288._4_4_ = local_2ac; local_280 = (float)local_2a0; if (1 < count) { uVar7 = Random(); owner = *(void **)((int)weapon + 4); local_280 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; local_288._4_4_ = (float)local_2ac * local_280; local_280 = (float)local_2a0 * local_280; } if (owner == (void *)0x0) { firePos.x = g_vectorZero.x; firePos.y = g_vectorZero.y; } else { firePos.x = *(float *)((int)owner + 0x33c); firePos.y = *(float *)((int)owner + 0x340); } tear = fire_tear(weapon,&firePos,(Vector *)(local_288 + 4),0x47,iVar14,1.0,0.0); local_2ac = (EntityPtr)(*(uint *)((int)&(tear->_tearFlags)._h + 4) & DAT_00c34b6c); if ((((uint)(tear->_tearFlags)._l & DAT_00c34b60) == 0 && (*(uint *)((int)&(tear->_tearFlags)._l + 4) & DAT_00c34b64) == 0) && (((uint)(tear->_tearFlags)._h & DAT_00c34b68) == 0 && local_2ac == (EntityPtr)0x0)) { tear->_fallingSpeed = tear->_fallingSpeed - 7.0; tear->_fallingAccel = tear->_fallingAccel * 0.01; } local_210 = ((uint)(tear->_tearFlags)._l | DAT_00c34600 | (uint)g_tearFlagSpectral._l) & ~(DAT_00c34860 | DAT_00c34b70); uStack_20c = (*(uint *)((int)&(tear->_tearFlags)._l + 4) | DAT_00c34604 | g_tearFlagSpectral._l._4_4_) & ~(DAT_00c34864 | DAT_00c34b74); uStack_208 = ((uint)(tear->_tearFlags)._h | DAT_00c34608 | (uint)g_tearFlagSpectral._h) & ~(DAT_00c34868 | DAT_00c34b78); uStack_204 = (*(uint *)((int)&(tear->_tearFlags)._h + 4) | DAT_00c3460c | g_tearFlagSpectral._h._4_4_) & ~(DAT_00c3486c | DAT_00c34b7c); flags_02._l._4_4_ = uStack_20c; flags_02._l._0_4_ = local_210; flags_02._h._0_4_ = uStack_208; flags_02._h._4_4_ = uStack_204; local_2a0 = tear; Entity_Tear::SetTearFlags(tear,flags_02); local_1c0._40_4_ = (tear->_sprite)._color._offset[2]; tearTint._colorize[0] = 0.0; tearTint._colorize[1] = 0.0; tearTint._colorize[2] = 0.0; tearTint._colorize[3] = 0.0; tearTint._offset[0] = 0.0; tearTint._tint[0] = 1.5; tearTint._tint[1] = 2.0; tearTint._tint[2] = 2.0; tearTint._tint[3] = 1.0; local_1c0._0_4_ = (tear->_sprite)._color._tint[0]; local_1c0._4_4_ = (tear->_sprite)._color._tint[1]; local_1c0._8_4_ = (tear->_sprite)._color._tint[2]; local_1c0._12_4_ = (tear->_sprite)._color._tint[3]; tearTint._offset[1] = 0.0; tearTint._offset[2] = 0.0; local_1c0._16_4_ = (tear->_sprite)._color._colorize[0]; local_1c0._20_4_ = (tear->_sprite)._color._colorize[1]; local_1c0._24_4_ = (tear->_sprite)._color._colorize[2]; local_1c0._28_4_ = (tear->_sprite)._color._colorize[3]; local_1c0._32_8_ = *(undefined8 *)(tear->_sprite)._color._offset; Color::__mul((Color *)local_1c0,&tearTint); local_40 = (float)local_1c0._0_4_; fStack_3c = (float)local_1c0._4_4_; fStack_38 = (float)local_1c0._8_4_; fStack_34 = (float)local_1c0._12_4_; local_18 = (float)local_1c0._40_4_; local_30 = (float)local_1c0._16_4_; fStack_2c = (float)local_1c0._20_4_; fStack_28 = (float)local_1c0._24_4_; fStack_24 = (float)local_1c0._28_4_; local_20 = (float)local_1c0._32_4_; fStack_1c = (float)local_1c0._36_4_; fVar10 = (float)local_1c0._32_4_; (**(code **)(*(int *)tear + 0x3c))(); player = (Entity_Player *)VStack_290.y; } } if ((*(int *)((int)player + 0x2ef8) == 0) || (*(int *)((int)player + 0x2ef8) != 0x9d)) { iVar14 = Entity_Player::GetTrinketMultiplier(player,0x9d); bVar9 = false; bVar8 = iVar14 == 0; LAB_009f7fe7: if (!bVar8 && bVar9 == iVar14 < 0) goto LAB_009f7ff2; } else { if (*(char *)((int)player + 0x2ef0) == '\0') { iVar3 = Entity_Player::GetTrinketMultiplier(player,0x9d); bVar9 = SBORROW4(iVar3,1); iVar14 = iVar3 + -1; bVar8 = iVar3 == 1; goto LAB_009f7fe7; } LAB_009f7ff2: local_2a8.y = 2.10195e-44; iVar14 = Entity_Player::GetTrinketMultiplier(player,0x9d); if (iVar14 == 2) { local_2a8.y = 1.4013e-44; } else if (iVar14 == 3) { local_2a8.y = 7.00649e-45; } if (*(uint *)((undefined4)weapon + 1) % (uint)local_2a8.y == 0) { Entity_Player::GetTearHitParams(); bVar2 = Entity_Player::HasCollectible(player,0x95,0); if (bVar2 == 0) { fStack_10c = fStack_10c + 40.0; fStack_108 = fStack_108 + 0.3; } uStack_11c = uStack_11c | (uint)g_tearFlagExplosive._l | (uint)g_tearFlagPoison._l | DAT_00c34860; uStack_114 = uStack_114 | (uint)g_tearFlagExplosive._h | (uint)g_tearFlagPoison._h | DAT_00c34868; uStack_158 = 0; uStack_124 = 0; uStack_118 = uStack_118 | g_tearFlagExplosive._l._4_4_ | g_tearFlagPoison._l._4_4_ | DAT_00c34864; uStack_110 = uStack_110 | g_tearFlagExplosive._h._4_4_ | g_tearFlagPoison._h._4_4_ | DAT_00c3486c; uStack_14c = 0x3f000000; uStack_148 = 0x3f666666; uStack_144 = 0x3ecccccd; uStack_140 = 0x3f800000; uStack_13c = 0; uStack_138 = 0; uStack_134 = 0; uStack_130 = 0; uStack_12c = 0; Isaac::GetAxisAlignedUnitVectorFromDir(&local_2a8,*(int *)((int)player + 0x1628)); local_2a8.x = local_2a8.x * 16.0; local_2a8.y = local_2a8.y * 16.0; inheritedVelocity = get_tear_movement_inheritance(weapon,(Vector *)(local_1c0 + 0x28),&local_2a8); local_2a8.x = local_2a8.x + inheritedVelocity->x; local_2a8.y = local_2a8.y + inheritedVelocity->y; uVar7 = Random(); owner = *(void **)((int)weapon + 4); if (owner == (void *)0x0) { fVar10 = g_vectorZero.x; fVar12 = g_vectorZero.y; } else { fVar10 = *(float *)((int)owner + 0x33c); fVar12 = *(float *)((int)owner + 0x340); } auStack_248._4_4_ = fVar10 + *(float *)((int)player + 0x164c) + local_2a8.x; auStack_240._0_4_ = fVar12 + *(float *)((int)player + 0x1650) + local_2a8.y; tear = (Entity_Tear *) Game::SpawnEx(g_game,2,uStack_154,(Vector *)(auStack_248 + 4),&local_2a8, (Entity *)player,0,uVar7,0); tear->_height = fStack_104; fVar10 = Entity_Tear::get_height_offset_y(tear,fStack_104); game = g_game; (tear->_posOffset).y = fVar10; if ((*(int *)((int)game->_room + 8) == 0x10) && (fVar10 = tear->_height, (tear->_posOffset).y = -18.0, -5.1 < fVar10)) { tear->_height = -5.1; } (**(code **)(*(int *)tear + 0x40))(); flags._l._4_4_ = uStack_11c; flags._l._0_4_ = uStack_120; flags._h._0_4_ = uStack_118; flags._h._4_4_ = uStack_114; Entity_Tear::SetTearFlags(tear,flags); fVar10 = fStack_10c; if (fStack_10c <= 0.01) { fVar10 = 0.01; } tear->_baseScale = fVar10; tear->_fScale = fVar10; Entity_Tear::ResetSpriteScale(tear); (**(code **)(*(int *)tear + 0x3c))(auStack_150,0xffffffff,0xff,0,1); if (tear->_parent != (EntityPtr)0x0) { std::multiset::erase(auStackY_374 + 0x9c); } tear->_parent = (EntityPtr)player; std::multiset::insert(&tear->_parent); uVar7 = Random(); tear->_tearIdx = uVar7; tear->_canTriggerStreakEnd = 0; fVar10 = pow(0.9,50.0); fVar10 = (fVar10 - 1.0) * -9.491221; tear->_fallingAccel = 0.8; if (fVar10 <= 0.01) { fVar10 = 0.01; } tear->_fallingSpeed = ((-5.0 - tear->_height) - (50.0 - fVar10) * 9.0) / fVar10; (**(code **)(*(int *)tear + 0xc))(); fVar10 = (tear->_pos).x - (tear->_velocity).x; fVar12 = (tear->_velocity).y; (tear->_pos).x = fVar10; (tear->_pos).y = (tear->_pos).y - fVar12; weapon = (Weapon *)local_288._0_4_; } } if (((*(int *)((int)player + 0x2c) == 1) && (*(int *)((int)player + 0x1aec) == 0x16)) && (uVar7 = Random(), uVar7 % 0x32 == 0)) { iVar3 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar14 = 0; if (0 < iVar3) { iVar14 = iVar3; } if (0 < iVar14) { owner = weapon->_owner; if (owner == (void *)0x0) { auStack_248._0_4_ = g_vectorZero.x; auStack_248._4_4_ = g_vectorZero.y; fVar10 = g_vectorZero.y; } else { auStack_248._0_4_ = *(float *)((int)owner + 0x33c); auStack_248._4_4_ = *(float *)((int)owner + 0x340); } Entity_Player::AddBlueFlies(player,1,(Vector *)auStack_248,(Entity *)0x0); } } isBirdsEye = Entity_Player::HasCollectible(player,0x268,0); isGhostPepper = Entity_Player::HasCollectible(player,0x1ef,0); if ((isBirdsEye == 0) || (isGhostPepper == 0)) { local_2a8.x = 2.8026e-45; if (isBirdsEye == 0) { if (isGhostPepper == 0) goto LAB_009f8615; } else { local_2a8.y = 2.8026e-45; if (isGhostPepper != 0) goto LAB_009f84ed; } local_2a8.y = 2.8026e-45; local_2a8.x = 2.8026e-45; } else { local_2a8.y = 1.4013e-45; local_2a8.x = 1.4013e-45; } LAB_009f84ed: FUN_009f3c10(); local_2ac = (EntityPtr)(extraout_EDX - (int)fVar10); if (extraout_EDX - (int)fVar10 < (int)local_2a8.y) { local_2ac = (EntityPtr)local_2a8.x; } if (local_2ac != (EntityPtr)0x0) { uVar7 = Random(); if (uVar7 % (uint)local_2ac != 0) goto LAB_009f8615; } auStack_240._0_4_ = aimDirX; auStack_240._4_4_ = aimDirY; fVar10 = aimDirY; if (isBirdsEye == 0) { if (isGhostPepper != 0) { LAB_009f858f: local_2ac = (EntityPtr)Entity_Player::ShootBlueCandle(player,(Vector *)auStack_240); if (1 < *(int *)&g_game->_deathmatchManager) { Random(); Entity_Player::GetTearHitParams(); fVar10 = (fStack_a4 * 4.0 * *(float *)((int)player + 0x157c)) / *(float *)((int)player + 0x1470); (**(code **)(*unaff_EDI + 0x40))(); *(int *)(weapon + 1) = *(int *)(weapon + 1) + 1; goto LAB_009f8620; } } goto LAB_009f8615; } if (isGhostPepper != 0) { uVar7 = Random(); if ((uVar7 & 1) != 0) goto LAB_009f858f; } Entity_Player::ShootRedCandle(player,(Vector *)auStack_240); *(int *)(weapon + 1) = *(int *)(weapon + 1) + 1; LAB_009f8620: bVar2 = Entity_Player::HasCollectible(player,0x1c2,0); if (bVar2 != 0) { if (*(uint *)(weapon + 1) % 0x14 == 0) { Entity_Player::GetTearHitParams(); unaff_EDI = (int *)(local_280 * 10.0); fStack_2b4 = fStack_27c * 10.0; VStack_290.x = (float)unaff_EDI; VStack_290.y = fStack_2b4; inheritedVelocity = get_tear_movement_inheritance(weapon,(Vector *)auStack_190,&VStack_290); owner = weapon->_owner; if ((owner == (void *)0x0) || ((*(int *)((int)owner + 0x28) != 1 && ((*(int *)((int)owner + 0x28) != 3 || (owner = *(void **)((int)owner + 0x410), owner == (void *)0x0)))))) { fVar10 = 1.0; } else { fVar10 = *(float *)((int)owner + 0x1464); } fVar12 = fVar10 * ((float)unaff_EDI + inheritedVelocity->x); EStack_2b8 = (EntityPtr)(fVar10 * (fStack_2b4 + inheritedVelocity->y)); VStack_290.x = fVar12; VStack_290.y = (float)EStack_2b8; if (1 < count) { uVar7 = Random(); fVar10 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; VStack_290.x = fVar10 * fVar12; VStack_290.y = (float)EStack_2b8 * fVar10; } fVar10 = VStack_290.x; EStack_2b8 = (EntityPtr)VStack_290.y; uVar7 = Random(); owner = weapon->_owner; if (owner == (void *)0x0) { fVar12 = g_vectorZero.x; fVar1 = g_vectorZero.y; } else { fVar12 = *(float *)((int)owner + 0x33c); fVar1 = *(float *)((int)owner + 0x340); } auStack_240._4_4_ = fVar12 + *(float *)((int)player + 0x164c) + fVar10; local_238._0_4_ = fVar1 + *(float *)((int)player + 0x1650) + (float)EStack_2b8; tear = (Entity_Tear *) Game::SpawnEx(g_game,2,0x14,(Vector *)(auStack_240 + 4),&VStack_290, (Entity *)player,0,uVar7,0); tear->_height = fStack_9c; fVar10 = Entity_Tear::get_height_offset_y(tear,fStack_9c); game = g_game; (tear->_posOffset).y = fVar10; if ((*(int *)((int)game->_room + 8) == 0x10) && (fVar10 = tear->_height, (tear->_posOffset).y = -18.0, -5.1 < fVar10)) { tear->_height = -5.1; } if (*(int *)((int)player + 0x1368) < 1) { (**(code **)(*(int *)tear + 0x40))(); uVar5 = uStack_b8 | DAT_00c34a20; uVar7 = DAT_00c34a24 | uStack_b4; uVar6 = uStack_b0 | DAT_00c34a28; uVar4 = uStack_ac | DAT_00c34a2c; uStack_208 = uVar5; uStack_204 = uVar7; uStack_200 = uVar6; uStack_1fc = uVar4; } else { Entity_Player::AddCoins(player,-1); (**(code **)(*(int *)tear + 0x40))(); uVar5 = uStack_b8 | DAT_00c34a20 | DAT_00c34aa0; uVar7 = DAT_00c34a24 | uStack_b4 | DAT_00c34aa4; uVar6 = uStack_b0 | DAT_00c34a28 | DAT_00c34aa8; uVar4 = uStack_ac | DAT_00c34a2c | DAT_00c34aac; uStack_218 = uVar5; uStack_214 = uVar7; local_210 = uVar6; uStack_20c = uVar4; } flags_00._l._4_4_ = uVar7; flags_00._l._0_4_ = uVar5; flags_00._h._0_4_ = uVar6; flags_00._h._4_4_ = uVar4; Entity_Tear::SetTearFlags(tear,flags_00); if (tear->_parent != (EntityPtr)0x0) { std::multiset::erase(auStackY_374 + 0xb0); } tear->_parent = (EntityPtr)player; std::multiset::insert(&tear->_parent); uVar7 = Random(); tear->_tearIdx = uVar7; tear->_canTriggerStreakEnd = 0; uVar7 = Random(); tear->_fallingSpeed = ((float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 - *(float *)((int)player + 0x1478)) - 7.0; tear->_fallingAccel = *(float *)((int)player + 0x147c) * 0.01; (**(code **)(*(int *)tear + 0xc))(); manager = g_manager; fVar10 = (tear->_pos).x - (tear->_velocity).x; fVar12 = (tear->_velocity).y; local_2a8.x = 3.83956e-43; (tear->_pos).x = fVar10; (tear->_pos).y = (tear->_pos).y - fVar12; seed_fart_sound_override((int *)&local_2a8); SoundEffects::Play(&manager->_sfxManager,(int)local_2a8.x,1.0,2,0,1.0,0.0); player = (Entity_Player *)VStack_290.y; weapon = (Weapon *)local_288._0_4_; } } bVar2 = Entity_Player::HasCollectible(player,0x1bc,0); if ((bVar2 != 0) && (*(uint *)(weapon + 1) % 0xf == 0)) { local_2ac = (EntityPtr)0xc; do { Entity_Player::GetTearHitParams(); Isaac::GetAxisAlignedUnitVectorFromDir((Vector *)local_288,*(int *)((int)player + 0x1628)) ; fVar10 = (float)local_288._0_4_ * 10.0; EVar11 = (EntityPtr)((float)local_288._4_4_ * 10.0); EStack_2b8 = EVar11; local_288._0_4_ = fVar10; local_288._4_4_ = EVar11; get_tear_movement_inheritance(weapon,aVStack_188,(Vector *)local_288); FUN_009f3c40(); pWVar13 = (Weapon *)((fVar10 + *extraout_EDX_00) * (float)EVar11); EStack_2b8 = (EntityPtr)(((float)EStack_2b8 + extraout_EDX_00[1]) * (float)EVar11); local_288._0_4_ = pWVar13; local_288._4_4_ = EStack_2b8; uVar7 = Random(); fStack_278 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 3.14; fStack_278 = fStack_278 + fStack_278; uVar7 = Random(); fStack_2b4 = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10; fVar10 = cos(fStack_278); fVar10 = fVar10 * fStack_2b4 * 3.5 + (float)pWVar13; local_238._4_4_ = fVar10; fVar12 = sin(fStack_278); fStack_2b4 = fVar12 * fStack_2b4 * 3.5 + (float)EStack_2b8; fStack_230 = fStack_2b4; uVar7 = Random(); owner = weapon->_owner; if (owner == (void *)0x0) { fVar12 = g_vectorZero.x; fVar1 = g_vectorZero.y; } else { fVar12 = *(float *)((int)owner + 0x33c); fVar1 = *(float *)((int)owner + 0x340); } aVStack_22c[0].x = fVar12 + *(float *)((int)player + 0x164c) + fVar10; aVStack_22c[0].y = fVar1 + *(float *)((int)player + 0x1650) + fStack_2b4; tear = (Entity_Tear *) Game::SpawnEx(g_game,2,uStack_ec,aVStack_22c,(Vector *)(local_238 + 4), (Entity *)player,0,uVar7,0); tear->_height = fStack_9c; fVar10 = Entity_Tear::get_height_offset_y(tear,fStack_9c); game = g_game; (tear->_posOffset).y = fVar10; if ((*(int *)((int)game->_room + 8) == 0x10) && (fVar10 = tear->_height, (tear->_posOffset).y = -18.0, -5.1 < fVar10)) { tear->_height = -5.1; } (**(code **)(*(int *)tear + 0x40))(); flags_01._l._4_4_ = uStack_b4; flags_01._l._0_4_ = uStack_b8; flags_01._h._0_4_ = uStack_b0; flags_01._h._4_4_ = uStack_ac; Entity_Tear::SetTearFlags(tear,flags_01); uVar7 = Random(); uVar4 = Random(); fVar10 = (((float)(uVar7 & 1) + 0.0) * 0.4 + 0.9 + (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 0.05) * fStack_a4; if (fVar10 <= 0.01) { fVar10 = 0.01; } tear->_baseScale = fVar10; tear->_fScale = fVar10; Entity_Tear::ResetSpriteScale(tear); (**(code **)(*(int *)tear + 0x3c))(auStack_e8,0xffffffff,0xff,0,1); if (tear->_parent != (EntityPtr)0x0) { std::multiset::erase(auStackY_374 + 0xa8); } player = (Entity_Player *)EStack_2b8; tear->_parent = EStack_2b8; std::multiset::insert(&tear->_parent); uVar7 = Random(); tear->_tearIdx = uVar7; tear->_canTriggerStreakEnd = 0; uVar7 = Random(); tear->_fallingSpeed = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 0.2 - *(float *)((int)player + 0x1478); tear->_fallingAccel = *(float *)((int)player + 0x147c); (**(code **)(*(int *)tear + 0xc))(); game = g_game; fVar10 = (tear->_pos).x - (tear->_velocity).x; fVar12 = (tear->_velocity).y; (tear->_pos).x = fVar10; (tear->_pos).y = (tear->_pos).y - fVar12; if (1 < *(int *)&game->_deathmatchManager) { fVar10 = (float)((uint)(tear->_tearFlags)._l | _DAT_00c34b10); uStack_1dc = *(uint *)((int)&(tear->_tearFlags)._l + 4) | DAT_00c34b14; uStack_1d8 = (uint)(tear->_tearFlags)._h | _DAT_00c34b18; uStack_1d4 = *(uint *)((int)&(tear->_tearFlags)._h + 4) | DAT_00c34b1c; flags_03._l._4_4_ = uStack_1dc; flags_03._l._0_4_ = fVar10; flags_03._h._0_4_ = uStack_1d8; flags_03._h._4_4_ = uStack_1d4; fStack_1e0 = fVar10; Entity_Tear::SetTearFlags(tear,flags_03); } bVar2 = Entity_Player::HasCollectible(player,0x95,0); if (bVar2 == 0) { tear->_fallingAccel = *(float *)((int)player + 0x147c) + 0.5; uVar7 = Random(); fVar10 = (5.0 - (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) * 2.3283064e-10 * 15.0) - *(float *)((int)player + 0x1478); tear->_fallingSpeed = fVar10; } local_2ac = (EntityPtr)((int)&((Entity *)((int)local_2ac + -0x40c))->_luaBridgeRef + 3); weapon = (Weapon *)local_288._0_4_; } while (local_2ac != (EntityPtr)0x0); } } i = i + 1; if (count <= i) { return; } } while( true ); } //@@ 009f9020 Isaac::CreateWeapon /* ZHL [exact] static cleanup Weapon* Isaac::CreateWeapon(WeaponType type, Entity* ent); prototype: db/protos.zhl */ Weapon * __cdecl Isaac::CreateWeapon(int weaponType,Entity *owner) { Weapon *pWVar1; if (*(undefined4 **)(&DAT_00c73630 + weaponType * 4) == (undefined4 *)0x0) { return (Weapon *)0x0; } pWVar1 = (Weapon *)(**(code **)**(undefined4 **)(&DAT_00c73630 + weaponType * 4))(); (**(code **)(*(int *)pWVar1 + 4))(weaponType,owner); return pWVar1; } //@@ 009f9050 Isaac::DestoryWeapon /* ZHL [exact] static cleanup void Isaac::DestoryWeapon(Weapon** wep); prototype: db/protos.zhl */ void __cdecl Isaac::DestoryWeapon(Weapon **weapon) { if (*weapon != (Weapon *)0x0) { (**(code **)(*(int *)*weapon + 0x14))(); if (*weapon != (Weapon *)0x0) { (*(code *)**(undefined4 **)*weapon)(1); } *weapon = (Weapon *)0x0; } return; } //@@ 009f9080 FUN_009f9080 undefined4 * FUN_009f9080(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b104d4; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x44); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Deathmatch::vftable; ExceptionList = local_10; return puVar2; } //@@ 009f90f0 FUN_009f90f0 undefined4 * FUN_009f90f0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10514; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x54); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_UrnOfSouls::vftable; puVar2[0x13] = 0; puVar2[0x14] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f9170 FUN_009f9170 undefined4 * FUN_009f9170(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10554; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x48); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_UmbilicalWhip::vftable; puVar2[0x11] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f91f0 FUN_009f91f0 undefined4 * FUN_009f91f0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b104d4; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x44); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_TechX::vftable; ExceptionList = local_10; return puVar2; } //@@ 009f9260 FUN_009f9260 undefined4 * FUN_009f9260(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10594; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x50); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Tears::vftable; ExceptionList = local_10; return puVar2; } //@@ 009f92d0 FUN_009f92d0 undefined4 * FUN_009f92d0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10594; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x50); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_SpiritSword::vftable; puVar2[0x11] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f9350 FUN_009f9350 undefined4 * FUN_009f9350(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10554; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x48); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Rockets::vftable; puVar2[0x11] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f93d0 FUN_009f93d0 undefined4 * FUN_009f93d0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b104d4; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x44); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_MonstrosLung::vftable; ExceptionList = local_10; return puVar2; } //@@ 009f9440 FUN_009f9440 undefined4 * FUN_009f9440(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10554; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x48); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Ludovico::vftable; puVar2[0x11] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f94c0 FUN_009f94c0 undefined4 * FUN_009f94c0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10594; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x50); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Laser::vftable; puVar2[0x11] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f9540 FUN_009f9540 undefined4 * FUN_009f9540(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b105dc; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x54); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); local_8 = CONCAT31(local_8._1_3_,1); *puVar2 = IsaacRepentancePlus::Weapon_Knife::vftable; _eh_vector_constructor_iterator_(puVar2 + 0x11,4,4,FUN_0042a020,FUN_00579700); ExceptionList = local_10; return puVar2; } //@@ 009f95d0 FUN_009f95d0 undefined4 * FUN_009f95d0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b104d4; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x44); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Fetus::vftable; ExceptionList = local_10; return puVar2; } //@@ 009f9640 FUN_009f9640 undefined4 * FUN_009f9640(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10614; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x4c); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Brimstone::vftable; puVar2[0x12] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f96c0 FUN_009f96c0 undefined4 * FUN_009f96c0(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10554; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x48); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); *puVar2 = IsaacRepentancePlus::Weapon_Bombs::vftable; puVar2[0x11] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f9740 FUN_009f9740 undefined4 * FUN_009f9740(void) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1065c; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = operator_new(0x60); local_8 = 0; if (puVar2 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } FUN_009f3180(uVar1); local_8 = CONCAT31(local_8._1_3_,1); *puVar2 = IsaacRepentancePlus::Weapon_Bone::vftable; _eh_vector_constructor_iterator_(puVar2 + 0x11,4,4,FUN_0042a020,FUN_00579700); puVar2[0x15] = 0; puVar2[0x16] = 0; ExceptionList = local_10; return puVar2; } //@@ 009f97e0 Weapon_UrnOfSouls::Free /* DB: vtable slot 0 of Weapon_UrnOfSouls; slot name from Weapon */ void Weapon_UrnOfSouls::Free(byte param_1) { undefined1 *puVar1; Weapon *in_ECX; Weapon *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b0f610; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = &in_ECX[1].field_0x18; local_14 = in_ECX; if (*(int *)puVar1 != 0) { local_14 = (Weapon *)puVar1; std::multiset::erase(&local_14); *(undefined4 *)puVar1 = 0; } puVar1 = &in_ECX[1].field_0x14; if (*(int *)puVar1 != 0) { local_14 = (Weapon *)puVar1; std::multiset::erase(&local_14); *(undefined4 *)puVar1 = 0; } IsaacRepentancePlus::Weapon::~Weapon(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x54); } ExceptionList = local_10; return; } //@@ 009f9880 Weapon_Bombs::Free /* DB: vtable slot 0 of Weapon_Bombs; slot name from Weapon */ void Weapon_Bombs::Free(byte param_1) { undefined1 *puVar1; Weapon *in_ECX; Weapon *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = &in_ECX[1].field_0xc; local_14 = in_ECX; if (*(int *)puVar1 != 0) { local_14 = (Weapon *)puVar1; std::multiset::erase(&local_14); *(undefined4 *)puVar1 = 0; } IsaacRepentancePlus::Weapon::~Weapon(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x48); } ExceptionList = local_10; return; } //@@ 009f9900 Weapon_Tears::Free /* DB: vtable slot 0 of Weapon_Tears; slot name from Weapon */ void Weapon_Tears::Free(byte param_1) { Weapon *in_ECX; IsaacRepentancePlus::Weapon::~Weapon(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x50); } return; } //@@ 009f9930 Weapon_Laser::Free /* DB: vtable slot 0 of Weapon_Laser; slot name from Weapon */ void Weapon_Laser::Free(byte param_1) { undefined1 *puVar1; Weapon *in_ECX; Weapon *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = &in_ECX[1].field_0xc; local_14 = in_ECX; if (*(int *)puVar1 != 0) { local_14 = (Weapon *)puVar1; std::multiset::erase(&local_14); *(undefined4 *)puVar1 = 0; } IsaacRepentancePlus::Weapon::~Weapon(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x50); } ExceptionList = local_10; return; } //@@ 009f99b0 Weapon_Knife::Free /* DB: vtable slot 0 of Weapon_Knife; slot name from Weapon */ void Weapon_Knife::Free(byte param_1) { Weapon *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; _eh_vector_destructor_iterator_(&in_ECX[1].field_0xc,4,4,FUN_00579700); IsaacRepentancePlus::Weapon::~Weapon(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x54); } ExceptionList = local_10; return; } //@@ 009f9a20 Weapon_Brimstone::Free /* ZHL [vtable slot 0] */ Weapon_Brimstone * __thiscall Weapon_Brimstone::Free(Weapon_Brimstone *this,byte param_2) { EntityPtr *pEVar1; Weapon_Brimstone *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; ExceptionList = &local_10; pEVar1 = &this->_mainLaser; local_14 = this; if (*pEVar1 != (EntityPtr)0x0) { local_14 = (Weapon_Brimstone *)pEVar1; std::multiset::erase(&local_14); *pEVar1 = (EntityPtr)0x0; } IsaacRepentancePlus::Weapon::~Weapon((Weapon *)this); if ((param_2 & 1) != 0) { operator_delete(this,0x4c); } ExceptionList = local_10; return this; } //@@ 009f9aa0 Weapon_Bone::Free /* DB: vftable */ void Weapon_Bone::Free(byte param_1) { undefined1 *puVar1; Weapon *in_ECX; Weapon *local_14; void *local_10; undefined1 *puStack_c; uint local_8; puStack_c = &LAB_00b10680; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; puVar1 = &in_ECX[1].field_0x20; local_14 = in_ECX; if (*(int *)puVar1 != 0) { local_14 = (Weapon *)puVar1; std::multiset::erase(&local_14); *(undefined4 *)puVar1 = 0; } puVar1 = &in_ECX[1].field_0x1c; if (*(int *)puVar1 != 0) { local_14 = (Weapon *)puVar1; std::multiset::erase(&local_14); *(undefined4 *)puVar1 = 0; } local_8 = local_8 & 0xffffff00; _eh_vector_destructor_iterator_(&in_ECX[1].field_0xc,4,4,FUN_00579700); IsaacRepentancePlus::Weapon::~Weapon(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 009f9b60 Weapon_Bombs::Fire /* DB: vftable */ void Weapon_Bombs::Fire(Vector *param_1,byte param_2,byte param_3) { Vector shotDirection; byte isAxisAligned; Vector *vecResult; uint rngResult; EntityPtr firedBomb; Weapon *in_ECX; void *unused; int unusedArg; EntityPtr oldLink; uint randomShotsLeft; int bomb; Entity_Bomb *linkSlot; float fVar1; float fVar2; float fVar3; float shotSpeed; Vector local_80; Vector local_78; uint isLudovico; Weapon *weapon; Vector aimDirection; Vector spawnPos; Vector scratchVec; Vector multiShotOffset; Vector multiShotVelocity; undefined4 multiShotParams; float fStack_3c; float fStack_38; float fStack_34; float local_30; int iStack_2c; float fStack_28; undefined4 uStack_24; uint local_20; weapon = in_ECX; Weapon::Fire(in_ECX,param_1,param_2,param_3); unused = in_ECX->_owner; isLudovico = (uint)in_ECX->_modifiers >> 4 & 0xffffff01; if (unused == (void *)0x0) { spawnPos.x = g_vectorZero.x; spawnPos.y = g_vectorZero.y; } else { spawnPos.x = *(float *)((int)unused + 0x33c); spawnPos.y = *(float *)((int)unused + 0x340); if ((*(int *)((int)unused + 0x28) == 1) || ((*(int *)((int)unused + 0x28) == 3 && (unused = *(void **)((int)unused + 0x410), unused != (void *)0x0)))) { shotSpeed = *(float *)((int)unused + 0x1464); goto LAB_009f9c09; } } shotSpeed = 1.0; LAB_009f9c09: if ((param_2 == 0) || (0.0 < *(float *)&in_ECX->field_0xc || *(float *)&in_ECX->field_0xc == 0.0)) { if ((char)isLudovico == '\0') { return; } } else if (((char)isLudovico == '\0') || (*(int *)&in_ECX[1].field_0xc == 0)) { if (param_3 != 0) { return; } *(float *)&in_ECX->field_0xc = *(float *)&in_ECX->field_0x10; Weapon::SetBlinkTime(in_ECX,7 - (int)(*(float *)&in_ECX->field_0x10 * -0.45),(int)unused); aimDirection.x = param_1->x; aimDirection.y = param_1->y; isAxisAligned = Weapon::IsAxisAligned(in_ECX); if (isAxisAligned == 0) { fVar2 = sqrtf(aimDirection.x * aimDirection.x + aimDirection.y * aimDirection.y); if (0.0 < fVar2) { aimDirection.x = aimDirection.x * (1.0 / fVar2); aimDirection.y = aimDirection.y * (1.0 / fVar2); } } else { vecResult = Vector::ToCardinal(&scratchVec,&aimDirection); aimDirection.x = vecResult->x; aimDirection.y = vecResult->y; } Weapon::TriggerTearEffects(in_ECX,&aimDirection,1); fVar2 = aimDirection.x * 12.0; fVar3 = aimDirection.y * 12.0; vecResult = Weapon::get_tear_movement_inheritance(in_ECX,&scratchVec,&g_vectorZero); fVar2 = fVar2 + vecResult->x; fVar3 = fVar3 + vecResult->y; Weapon::GetMultiShotParams(in_ECX,&multiShotParams,unusedArg); local_78.x = -fVar3; if (uStack_24._1_1_ != '\0') { local_80.x = -fVar2 * shotSpeed; local_80.y = local_78.x * shotSpeed; Weapon::fire_bomb(in_ECX,&spawnPos,&local_80); } if (uStack_24._2_1_ != '\0') { local_78.x = local_78.x * shotSpeed; local_78.y = fVar2 * shotSpeed; Weapon::fire_bomb(in_ECX,&spawnPos,&local_78); local_78.x = fVar3 * shotSpeed; local_78.y = -fVar2 * shotSpeed; Weapon::fire_bomb(in_ECX,&spawnPos,&local_78); } for (randomShotsLeft = local_20 & 0xffff; randomShotsLeft != 0; randomShotsLeft = randomShotsLeft - 1) { rngResult = Random(); local_78.x = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; local_80.x = cos(local_78.x); fVar1 = sin(local_78.x); scratchVec.x = (local_80.x * fVar2 - fVar1 * fVar3) * shotSpeed; scratchVec.y = (fVar1 * fVar2 + local_80.x * fVar3) * shotSpeed; Weapon::fire_bomb(in_ECX,&spawnPos,&scratchVec); } local_80.x = 0.0; local_78.x = 0.0; if ((short)multiShotParams < 1) { return; } do { shotDirection.y = fVar3; shotDirection.x = fVar2; Entity_Player::GetMultiShotPositionVelocity (&multiShotOffset,(int)local_78.x,5,shotDirection,shotSpeed,(short)multiShotParams, fStack_3c,fStack_38,fStack_34,local_30,iStack_2c,fStack_28,(byte)uStack_24, (short)local_20); scratchVec.x = spawnPos.x + multiShotOffset.x; scratchVec.y = spawnPos.y + multiShotOffset.y; firedBomb = (EntityPtr)Weapon::fire_bomb(in_ECX,&scratchVec,&multiShotVelocity); if ((char)isLudovico != '\0') { if ((Entity_Bomb *)local_80.x == (Entity_Bomb *)0x0) { oldLink = *(EntityPtr *)&in_ECX[1].field_0xc; linkSlot = (Entity_Bomb *)&in_ECX[1].field_0xc; if (oldLink != firedBomb) goto LAB_009f9fda; } else { oldLink = *(EntityPtr *)((int)local_80.x + 0x3c0); linkSlot = (Entity_Bomb *)((int)local_80.x + 0x3c0); LAB_009f9fda: if (oldLink != (EntityPtr)0x0) { local_80.x = (float)linkSlot; std::multiset::erase(&local_80); } *(EntityPtr *)linkSlot = firedBomb; if (firedBomb != (EntityPtr)0x0) { std::multiset::insert(linkSlot); } } in_ECX = weapon; local_80.x = (float)firedBomb; } local_78.x = (float)((int)local_78.x + 1); if ((int)(short)multiShotParams <= (int)local_78.x) { return; } } while( true ); } bomb = *(int *)&in_ECX[1].field_0xc; if ((bomb != 0) && (param_2 != 0)) { aimDirection.x = param_1->x; aimDirection.y = param_1->y; if (1.0 < aimDirection.x * aimDirection.x + aimDirection.y * aimDirection.y) { Vector::Normalize(&aimDirection); } fVar2 = *(float *)(bomb + 0x36c); fVar3 = aimDirection.x * shotSpeed * 1.2 * 0.5; fVar1 = aimDirection.y * shotSpeed * 1.2 * 0.5; if (fVar2 != 0.0) { *(float *)(bomb + 0x360) = (fVar3 * *(float *)(bomb + 0x39c)) / fVar2 + *(float *)(bomb + 0x360); *(float *)(bomb + 0x364) = (fVar1 * *(float *)(bomb + 0x39c)) / fVar2 + *(float *)(bomb + 0x364); bomb = *(int *)&in_ECX[1].field_0xc; } for (bomb = *(int *)(bomb + 0x3c0); bomb != 0; bomb = *(int *)(bomb + 0x3c0)) { fVar2 = *(float *)(bomb + 0x36c); if (fVar2 != 0.0) { *(float *)(bomb + 0x360) = (*(float *)(bomb + 0x39c) * fVar3) / fVar2 + *(float *)(bomb + 0x360); *(float *)(bomb + 0x364) = (fVar1 * *(float *)(bomb + 0x39c)) / fVar2 + *(float *)(bomb + 0x364); } } } return; } //@@ 009fa190 Weapon_Bombs::GetFocusEntity /* DB: vtable slot 9 of Weapon_Bombs; slot name from Weapon */ undefined4 Weapon_Bombs::GetFocusEntity(void) { int in_ECX; if ((*(uint *)(in_ECX + 0x34) >> 4 & 1) == 0) { return 0; } return *(undefined4 *)(in_ECX + 0x44); } //@@ 009fa1b0 Weapon_Bombs::GetMarkedTargetVariant /* DB: vtable slot 12 of Weapon_Bombs; slot name from Weapon */ undefined4 Weapon_Bombs::GetMarkedTargetVariant(void) { byte bVar1; int in_ECX; undefined4 uVar2; Entity_Player *this; if ((*(uint *)(in_ECX + 0x34) >> 4 & 1) != 0) { return 0; } this = *(Entity_Player **)(in_ECX + 4); if (this != (Entity_Player *)0x0) { if (this->_type == 1) goto LAB_009fa1e0; if (this->_type == 3) { this = *(Entity_Player **)&this->_isControlsEnabled; goto LAB_009fa1e0; } } this = (Entity_Player *)0x0; LAB_009fa1e0: bVar1 = Entity_Player::HasCollectible(this,0x18a,0); if (bVar1 == 0) { return 0; } bVar1 = Entity_Player::HasCollectible(this,0x23c,0); uVar2 = 0x1e; if (bVar1 != 0) { uVar2 = 0x99; } return uVar2; } //@@ 009fa220 Weapon_Bone::Update /* DB: vftable */ void Weapon_Bone::Update(char param_1) { int iVar1; byte bVar2; Entity_Player *pEVar3; float *extraout_EAX; int in_ECX; Entity_Player *this; Entity_Player *pEVar4; float fVar5; float fVar6; float fVar7; float local_14; Vector local_10; pEVar3 = *(Entity_Player **)(in_ECX + 4); pEVar4 = pEVar3; if (pEVar3 == (Entity_Player *)0x0) { LAB_009fa24f: this = (Entity_Player *)0x0; if ((pEVar3 != (Entity_Player *)0x0) && (pEVar3->_type == 1)) goto LAB_009fa25f; } else { if (pEVar3->_type == 1) { this = pEVar3; goto LAB_009fa25f; } if (pEVar3->_type != 3) goto LAB_009fa24f; this = *(Entity_Player **)&pEVar3->_isControlsEnabled; } pEVar4 = (Entity_Player *)0x0; LAB_009fa25f: if (*(int *)(in_ECX + 0x30) == 0xb) { *(undefined4 *)(in_ECX + 0x10) = 0x41700000; if ((this != (Entity_Player *)0x0) && (bVar2 = Entity_Player::HasCollectible(this,0x3b,0), bVar2 != 0)) { *(undefined4 *)(in_ECX + 0x10) = 0x40c00000; } pEVar3 = *(Entity_Player **)(in_ECX + 4); *(undefined4 *)(in_ECX + 0x34) = 0x80000000; } fVar5 = -10.0; fVar6 = 0.0; if (pEVar3 != (Entity_Player *)0x0) { if (pEVar4 == (Entity_Player *)0x0) { fVar6 = (pEVar3->_sprite)._scale.x * 0.0; if (pEVar3->_type == 3) { fVar5 = (pEVar3->_sprite)._scale.y * -20.0; } else { fVar5 = (pEVar3->_sprite)._scale.y * -10.0; } } else { fVar5 = (pEVar4->_playerSpriteScale).x; if (fVar5 <= 1.0) { fVar5 = 1.0; } iVar1 = pEVar4->_entityGridCollisionClass; if ((((iVar1 == 0) || (iVar1 == 3)) || (iVar1 == 1)) || (iVar1 == 2)) { Entity_Player::GetFlyingOffset(pEVar4,&local_10); local_14 = *extraout_EAX / 0.65 + 0.0; local_10.x = extraout_EAX[1] / 0.65 - 10.0; } else { local_14 = 0.0; local_10.x = -10.0; } bVar2 = TemporaryEffects::HasCollectibleEffect(&pEVar4->_temporaryeffects,0x271); if (bVar2 != 0) { fVar5 = fVar5 * 4.0; } fVar6 = local_14 * fVar5 + (pEVar4->_posOffset).x; fVar5 = local_10.x * fVar5 + (pEVar4->_posOffset).y; } } fVar7 = 1.0; iVar1 = *(int *)(in_ECX + 0x44); if (iVar1 != 0) { *(float *)(iVar1 + 0x34c) = fVar6; *(float *)(iVar1 + 0x350) = fVar5; } iVar1 = *(int *)(in_ECX + 0x48); if (iVar1 != 0) { *(float *)(iVar1 + 0x34c) = fVar6; *(float *)(iVar1 + 0x350) = fVar5; } iVar1 = *(int *)(in_ECX + 0x4c); if (iVar1 != 0) { *(float *)(iVar1 + 0x34c) = fVar6; *(float *)(iVar1 + 0x350) = fVar5; } iVar1 = *(int *)(in_ECX + 0x50); if (iVar1 != 0) { *(float *)(iVar1 + 0x34c) = fVar6; *(float *)(iVar1 + 0x350) = fVar5; } if ((param_1 == '\0') && (-1.0 < *(float *)(in_ECX + 0xc))) { if (*(int *)(in_ECX + 4) != 0) { fVar7 = *(float *)(*(int *)(in_ECX + 4) + 0x39c); } *(float *)(in_ECX + 0xc) = *(float *)(in_ECX + 0xc) - fVar7; } return; } //@@ 009fa450 Weapon_Bone::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x009fb3f0) */ /* WARNING: Removing unreachable block (ram,0x009fb40e) */ /* WARNING: Removing unreachable block (ram,0x009fb41b) */ /* WARNING: Removing unreachable block (ram,0x009fb404) */ /* WARNING: Removing unreachable block (ram,0x009fb423) */ /* DB: Weapon_Bone vftable slot 3 (Fire); gfx/tears_brokenbone.png, TryForgottenThrow, Entity_Knife::Shoot prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_Bone::Fire(void *this,Vector *direction,byte isShooting,byte isInterpolated) { char *pcVar1; uint *puVar2; int *piVar3; code *pcVar4; qword qVar5; Manager *pMVar6; byte bVar7; EntityPtr *pEVar8; uint uVar9; TearParams *other; BitSet128 *pBVar10; Vector *pVVar11; int iVar12; int *piVar13; std_string *anim; Vector *pVVar14; uint rngResult; Entity_Tear *fetusTear; float *pfVar15; EntityPtr *pEVar16; Entity_Knife *club; Entity_Bomb *pEVar17; Entity *club; char cVar19; byte extraout_CL; byte extraout_CL_00; int unusedCollectibleId; EntityPtr extraout_ECX; EntityPtr extraout_ECX_00; undefined3 uVar23; undefined4 uVar20; int *piVar21; int extraout_ECX_01; uint3 uVar24; int unused; Vector *extraout_ECX_02; Vector *extraout_ECX_03; Vector *extraout_ECX_04; void *pvVar22; int unused_00; Vector *extraout_ECX_05; Entity_Player *this_00; float *extraout_ECX_06; float *extraout_ECX_07; float *extraout_ECX_08; int extraout_ECX_09; int extraout_ECX_10; float *extraout_ECX_11; int unused_01; float *extraout_ECX_12; Entity_Knife *extraout_ECX_13; Entity_Knife *extraout_ECX_14; Entity_Knife *extraout_ECX_15; Entity_Knife *unused_02; float *extraout_ECX_16; int extraout_ECX_17; int extraout_ECX_18; float *extraout_ECX_19; float *extraout_ECX_20; float *extraout_ECX_21; int *extraout_EDX; EntityPtr EVar25; void **ppvVar26; float fVar27; EntityPtr EVar28; EntityPtr EVar29; undefined1 *puVar30; undefined1 auVar31 [16]; float fVar32; float fVar33; float fVar34; double dVar35; BitSet128 *b; Color local_2f8; void *local_2cc; EntityPtr EStack_2c8; float fStack_2c4; float fStack_2c0; float local_2bc; void *pvStack_2b8; void *pvStack_2b4; EntityPtr EStack_2b0; undefined1 local_2ac [8]; Vector local_2a4; undefined4 local_29c; EntityPtr local_298; EntityPtr maxCharge; uint isBrimstone; Vector *aimDirection; undefined4 local_288; EntityPtr local_284; float local_280; undefined1 local_27c [12]; float local_270; float local_26c; EntityPtr local_268; Vector local_264; uint isCursedEye; Vector local_258; EntityPtr local_250; float local_24c; Vector local_248; Vector ownerPos; Vector local_238; EntityPtr shotSpeed; int weaponType; EntityPtr local_228; EntityPtr local_224; Vector local_220; Vector local_218; EntityPtr newCharge; EntityPtr clubScale; float local_208; char isEpicFetus; char isReleased; EntityPtr local_200; char local_1f9; Vector shotDirection; float local_1f0; Vector local_1ec; Vector local_1e4; byte isChocolateMilk; EntityPtr local_1d8; undefined2 local_1d2; Entity_Knife *heldClub; Entity_Player *player; char isChargeMode; char isDrFetus; byte local_1c6; undefined1 local_1c5; undefined1 local_1c4 [8]; float tearBombVariant; Color tearColor; BitSet128 tearFlags; float tearDamage; float tearScale; float tearHeight; float fStack_16c; float local_168; float local_164; float local_160; Color flashColor; undefined1 local_c4 [24]; void *pvStack_ac; EntityPtr EStack_a8; float local_a4 [2]; float local_9c; Color chargeColor; undefined1 local_6c [28]; undefined1 local_50 [4]; float fStack_4c; float fStack_48; float fStack_44; Color clubFlashColor; uint local_14; void *local_10; undefined1 *puStack_c; float local_8; Entity_Player *owner; local_8 = -NAN; puStack_c = &LAB_00b106ce; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(&clubFlashColor)[1]._colorize; ExceptionList = &local_10; aimDirection = direction; local_268 = (EntityPtr)this; Weapon::Fire(this,direction,isShooting,isInterpolated); weaponType = *(int *)((int)this + 0x30); EVar28 = *(EntityPtr *)((int)this + 4); EVar29 = EVar28; if (EVar28 == (EntityPtr)0x0) { LAB_009fa53d: local_1ec.y = 0.0; player = (Entity_Player *)EVar28; if (EVar28 == (EntityPtr)0x0) { LAB_009fa4db: } else { local_1ec.y = 0.0; if (*(int *)((int)EVar28 + 0x28) == 1) goto LAB_009fa525; } EVar25 = (EntityPtr)local_1ec.y; if (EVar28 != (EntityPtr)0x0) { player = (Entity_Player *)0x0; if (*(int *)((int)EVar28 + 0x28) == 1) goto LAB_009fa525; local_1ec.y = (float)EVar25; if (*(int *)((int)EVar28 + 0x28) == 3) { player = (Entity_Player *)0x0; EVar29 = *(EntityPtr *)((int)EVar28 + 0x410); if (*(EntityPtr *)((int)EVar28 + 0x410) != (EntityPtr)0x0) goto LAB_009fa525; } } shotSpeed = (EntityPtr)0x3f800000; player = (Entity_Player *)0x0; if (EVar28 != (EntityPtr)0x0) goto LAB_009fa572; ownerPos.x = g_vectorZero.x; player = (Entity_Player *)0x0; shotSpeed = (EntityPtr)0x3f800000; ownerPos.y = g_vectorZero.y; } else { if (*(int *)((int)EVar28 + 0x28) != 1) { if (*(int *)((int)EVar28 + 0x28) != 3) goto LAB_009fa53d; local_1ec.y = *(float *)((int)EVar28 + 0x410); goto LAB_009fa4db; } player = (Entity_Player *)EVar28; local_1ec.y = (float)EVar28; LAB_009fa525: shotSpeed = *(EntityPtr *)((int)EVar29 + 0x1464); EVar25 = (EntityPtr)local_1ec.y; LAB_009fa572: ownerPos.x = ((Vector *)((int)EVar28 + 0x33c))->x; ownerPos.y = *(float *)((int)EVar28 + 0x340); } local_200 = (EntityPtr)player; uVar9 = *(uint *)((int)this + 0x34); isChocolateMilk = *(byte *)((int)this + 0x34) & 1; isCursedEye = uVar9 >> 1 & 0xffffff01; isBrimstone = uVar9 >> 2 & 0xffffff01; local_1ec.x = (float)EVar25; local_1c4._0_4_ = shotSpeed; local_250 = (EntityPtr)(uVar9 >> 3 & 0xffffff01); if ((((*(int *)((int)this + 0x30) == 0xb) || (EVar25 == (EntityPtr)0x0)) || (bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0x34,0), bVar7 == 0)) || (bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0xa8,0), bVar7 != 0)) { isDrFetus = '\0'; if ((weaponType != 0xb) && (EVar25 != (EntityPtr)0x0)) goto LAB_009fa65b; LAB_009fa671: isEpicFetus = '\0'; } else { isDrFetus = '\x01'; LAB_009fa65b: bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0xa8,0); if (bVar7 == 0) goto LAB_009fa671; isEpicFetus = '\x01'; } if (((*(uint *)((int)this + 0x34) >> 4 & 1) == 0) || (local_1f9 = '\x01', isEpicFetus != '\0')) { local_1f9 = '\0'; } if ((weaponType == 0xb) || (EVar25 == (EntityPtr)0x0)) { LAB_009fa6bd: local_1c6 = '\0'; } else { bVar7 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)((int)EVar25 + 0x1508),0x2c0) ; local_1c6 = '\x01'; if (bVar7 == 0) goto LAB_009fa6bd; } local_248.y = (float)(*(uint *)((int)this + 0x34) >> 0xb & 0xffffff01); fVar27 = local_248.y; if (((isChocolateMilk == 0) && ((char)isCursedEye == '\0')) && ((char)isBrimstone == '\0')) { isChargeMode = '\0'; if (local_250._0_1_ != '\0') goto LAB_009fa703; } else { LAB_009fa703: isChargeMode = '\x01'; } if (((*(uint *)((int)this + 0x34) >> 7 & 1) != 0) || (*(float *)((int)this + 0x10) <= 0.0)) { pEVar16 = (EntityPtr *)((int)this + 0x10); local_1e4.y = 0.001; local_1c5 = 1; player = (Entity_Player *)local_200; shotSpeed = (EntityPtr)local_1c4._0_4_; pEVar8 = (EntityPtr *)&local_1e4.y; if (0.001 < (float)*pEVar16 || (float)*pEVar16 == 0.001) { pEVar8 = pEVar16; } local_1ec.y = local_1ec.x; local_228 = *pEVar8; local_1e4.y = (float)local_228; local_224 = local_228; EVar25 = (EntityPtr)local_1ec.x; if (local_248.y._0_1_ != '\0') { isChargeMode = '\x01'; local_1c5 = 1; isDrFetus = isDrFetus; goto LAB_009fa822; } } else { pEVar16 = (EntityPtr *)((int)this + 0x10); local_1e4.y = 0.001; local_1c5 = 0; pEVar8 = (EntityPtr *)&local_1e4.y; if (0.001 < (float)*pEVar16 || (float)*pEVar16 == 0.001) { pEVar8 = pEVar16; } local_228 = *pEVar8; local_224 = local_228; LAB_009fa822: local_1e4.y = (float)local_228; } isReleased = '\0'; local_248.y = fVar27; local_228 = (EntityPtr)local_1e4.y; local_224 = (EntityPtr)local_1e4.y; if ((EVar25 == (EntityPtr)0x0) || (bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0x72,0), bVar7 == 0)) { local_200 = (EntityPtr)0x1; if (local_1c6 != '\0') { local_200 = (EntityPtr)0x3; } } else { local_200 = (EntityPtr)0x2; } fVar27 = 2.0; if (weaponType == 0xb) { local_200 = (EntityPtr)0x9; } if ((((char)isCursedEye == '\0') && (local_248.y._0_1_ == '\0')) || (isChocolateMilk != 0)) { fVar27 = 3.0; } local_1c6 = isShooting; maxCharge = (EntityPtr)(fVar27 * (float)local_224); local_258.y = fVar27 * (float)local_224; local_228 = (EntityPtr)((float)local_228 + local_1e4.y); if ((isEpicFetus != '\0') && (player != (Entity_Player *)0x0)) { if ((((isShooting == 0) || ((pvVar22 = player->_heldEntity, pvVar22 == (void *)0x0 || (*(char *)((int)pvVar22 + 0x171) != '\0')))) || (*(int *)((int)pvVar22 + 0x28) != 1000)) || (*(int *)((int)pvVar22 + 0x2c) != 0x76)) { if ((*(int **)((int)this + 0x58) != (int *)0x0) && (isInterpolated == 0)) { (**(code **)(**(int **)((int)this + 0x58) + 0x28))(); } } else { Weapon::SetBlinkTime(this,10,(int)player); if (*(int *)((int)this + 0x58) == 0) { if (isInterpolated == 0) { uVar9 = Random(); local_1ec.x = (float)Game::Spawn(g_game,1000,0x1e,&ownerPos,&g_vectorZero, *(Entity **)((int)this + 4),0,uVar9); pcVar1 = (char *)((int)local_1ec.x + 0x45c); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; pcVar1 = (char *)((int)local_1ec.x + 0x460); pcVar1[0] = '\0'; pcVar1[1] = '\0'; pcVar1[2] = '\0'; pcVar1[3] = '\0'; EVar28 = *(EntityPtr *)((int)this + 0x58); if (EVar28 != (EntityPtr)local_1ec.x) { if (EVar28 != (EntityPtr)0x0) { local_1c4._0_4_ = (int)this + 0x58; std::multiset::erase(); } *(float *)((int)this + 0x58) = local_1ec.x; std::multiset::insert(); EVar28 = *(EntityPtr *)((int)this + 0x58); } if (EVar28 != (EntityPtr)0x0) goto LAB_009fa9d5; } } else { LAB_009fa9d5: local_238.x = aimDirection->x; local_238.y = aimDirection->y; local_208 = local_238.y; local_1e4.y = local_238.x; if (1.0 < local_238.x * local_238.x + local_238.y * local_238.y) { Vector::Normalize(&local_238); local_208 = local_238.y; local_1e4.y = local_238.x; } local_238.x = local_1e4.y; local_238.y = local_208; bVar7 = Entity_Player::HasCollectible(player,0x166,0); if ((bVar7 == 0) || (bVar7 = Entity_Player::HasCollectible(player,0xf5,0), bVar7 != 0)) { EVar28 = (EntityPtr)local_1e4.y; } else { local_1c4._0_4_ = cos(0.7853982); fVar27 = sin(0.7853982); fVar32 = fVar27 * local_208; local_208 = fVar27 * local_1e4.y + (float)local_1c4._0_4_ * local_208; EVar28 = (EntityPtr)((float)local_1c4._0_4_ * local_1e4.y - fVar32); } iVar12 = *(int *)((int)this + 0x58); *(float *)(iVar12 + 0x360) = (float)EVar28 * 8.0 * *(float *)(iVar12 + 0x39c) + *(float *)(iVar12 + 0x360); *(float *)(iVar12 + 0x364) = local_208 * 8.0 * *(float *)(iVar12 + 0x39c) + *(float *)(iVar12 + 0x364); } } } iVar12 = *(int *)((int)this + 4); clubScale = (EntityPtr)0x3f800000; if (iVar12 != 0) { if (player == (Entity_Player *)0x0) { pVVar11 = (Vector *)(iVar12 + 0xe4); pVVar14 = (Vector *)local_1c4; if (*(int *)(iVar12 + 0x28) != 3) { if (1.0 < pVVar11->x) { pVVar14 = pVVar11; } goto LAB_009fabed; } local_1c4._0_4_ = pVVar11->x * 0.8; local_1ec.x = 0.8; if ((float)local_1c4._0_4_ <= 0.8) { pVVar14 = &local_1ec; } } else { local_238.x = (player->_playerSpriteScale).x; local_238.y = (player->_playerSpriteScale).y; pVVar14 = &local_238; if (local_238.x <= 1.0) { pVVar14 = (Vector *)local_1c4; } LAB_009fabed: local_1c4._0_4_ = (EntityPtr)0x3f800000; } clubScale = (EntityPtr)pVVar14->x; } if ((EVar25 != (EntityPtr)0x0) && (weaponType != 0xb)) { bVar7 = TemporaryEffects::HasCollectibleEffect((TemporaryEffects *)((int)EVar25 + 0x1508),0x271) ; if (bVar7 != 0) { clubScale = (EntityPtr)((float)clubScale * 4.0); } bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0xa9,0); if (bVar7 == 0) { bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0x213,0); if (bVar7 != 0) { clubScale = (EntityPtr)((float)clubScale * 1.5); } } else { clubScale = (EntityPtr)((float)clubScale + (float)clubScale); } } if ((local_1f9 != '\0') && (*(int *)((int)this + 0x54) == 0)) { TearParams::constructor((TearParams *)(local_1c4 + 4)); if (EVar25 != (EntityPtr)0x0) { Random(); EVar25 = (EntityPtr)local_1ec.y; other = (TearParams *)Entity_Player::GetTearHitParams(); TearParams::operator_((TearParams *)(local_1c4 + 4),other); } uVar9 = Random(); local_238.x = ownerPos.x + 0.0; local_238.y = ownerPos.y + 5.0; local_1d8 = (EntityPtr) Game::Spawn(g_game,2,local_1c4._4_4_,&local_238,&g_vectorZero, *(Entity **)((int)this + 4),2,uVar9); if ((local_1d8 == (EntityPtr)0x0) || (*(int *)((int)local_1d8 + 0x28) != 2)) { local_1d8 = (EntityPtr)0x0; } local_1ec.x = (float)((int)local_1d8 + 0x3bc); local_218.y = *(float *)((int)this + 4); if (*(EntityPtr *)((int)local_1d8 + 0x3bc) != (EntityPtr)0x0) { local_1c4._0_4_ = local_1ec.x; std::multiset::erase(); } *(float *)local_1ec.x = local_218.y; if ((EntityPtr)local_218.y != (EntityPtr)0x0) { std::multiset::insert(); } Entity_Projectile::SetHeight((Entity_Projectile *)local_1d8,-40.0); (**(code **)(*(int *)local_1d8 + 0x40))(); b = &g_tearFlagSpectral; pBVar10 = BitSet128::operator_or((BitSet128 *)local_50,&tearFlags,&g_tearFlagLudovico); pBVar10 = BitSet128::operator_or((BitSet128 *)&local_2bc,pBVar10,b); Entity_Tear::SetTearFlags((Entity_Tear *)local_1d8,*pBVar10); (**(code **)(*(int *)local_1d8 + 0x3c))(); fVar27 = sqrtf(tearDamage); local_1ec.x = 0.01; local_1c4._0_4_ = tearDamage * 0.04 + 1.5 + fVar27 * 0.15; pVVar11 = (Vector *)local_1c4; if ((float)local_1c4._0_4_ <= 0.01) { pVVar11 = &local_1ec; } fVar27 = pVVar11->x; *(float *)((int)local_1d8 + 0x424) = fVar27; *(float *)((int)local_1d8 + 0x420) = fVar27; Entity_Tear::ResetSpriteScale((Entity_Tear *)local_1d8); (**(code **)(*(int *)local_1d8 + 0xc))(); if (*(EntityPtr *)((int)this + 0x54) != local_1d8) { if (*(EntityPtr *)((int)this + 0x54) != (EntityPtr)0x0) { local_1c4._0_4_ = (int)this + 0x54; std::multiset::erase(); } *(EntityPtr *)((int)this + 0x54) = local_1d8; std::multiset::insert(); } } if (((weaponType == 0xb) || (EVar25 == (EntityPtr)0x0)) || (bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0x57,0), bVar7 == 0)) { local_1f9 = '\0'; if ((weaponType != 0xb) && (EVar25 != (EntityPtr)0x0)) goto LAB_009faf3a; LAB_009faf4d: cVar19 = '\0'; } else { local_1f9 = '\x01'; LAB_009faf3a: bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar25,0x37,0); if (bVar7 == 0) goto LAB_009faf4d; cVar19 = '\x01'; } EVar28 = local_200; local_1d2 = CONCAT11(cVar19,(undefined1)local_1d2); local_208 = 0.0; do { if (((local_208 == 0.0) || ((local_208 == 1.4013e-45 && (cVar19 != '\0')))) || (local_1f9 != '\0')) { local_1ec.x = (float)((int)this + (int)local_208 * 4 + 0x44); piVar21 = *(int **)((int)this + (int)local_208 * 4 + 0x44); if (piVar21 != (int *)0x0) { if ((piVar21[10] == 8) && (*(EntityPtr *)(piVar21 + 0xb) == EVar28)) goto LAB_009fb07f; (**(code **)(*piVar21 + 0x28))(); } local_218.y = (float)Weapon::fire_bone_club(); if (*(EntityPtr *)local_1ec.x != (EntityPtr)local_218.y) { if (*(EntityPtr *)local_1ec.x != (EntityPtr)0x0) { local_1c4._0_4_ = local_1ec.x; std::multiset::erase(); } *(float *)local_1ec.x = local_218.y; if ((EntityPtr)local_218.y != (EntityPtr)0x0) { std::multiset::insert(); } } *(undefined4 *)((int)local_218.y + 0x438) = (&DAT_00b81710)[(int)local_208]; *(bool *)((int)local_218.y + 0x467) = local_208 == 0.0; (**(code **)(*(int *)local_218.y + 0xc))(); } else { local_1ec.x = (float)((int)this + (int)local_208 * 4 + 0x44); if ((*(EntityPtr *)local_1ec.x != (EntityPtr)0x0) && ((**(code **)(*(int *)*(EntityPtr *)local_1ec.x + 0x28))(), *(EntityPtr *)local_1ec.x != (EntityPtr)0x0)) { local_1c4._0_4_ = local_1ec.x; std::multiset::erase(); *(EntityPtr *)local_1ec.x = (EntityPtr)0x0; } } LAB_009fb07f: EVar29 = (EntityPtr)local_1ec.y; local_208 = (float)((int)local_208 + 1); cVar19 = local_1d2._1_1_; } while ((uint)local_208 < 4); heldClub = *(Entity_Knife **)((int)this + 0x44); shotDirection.y = aimDirection->y; shotDirection.x = aimDirection->x; if (shotDirection.y == 0.0) { if (shotDirection.x == 0.0) { shotDirection.x = *(float *)((int)this + 0x20); shotDirection.y = *(float *)((int)this + 0x24); } if (((shotDirection.y == 0.0) && (shotDirection.x == 0.0)) && (player != (Entity_Player *)0x0)) { switch(player->_headDirection) { case 0: shotDirection.x = (float)&DAT_bf800000; break; case 1: shotDirection.y = (float)&DAT_bf800000; break; case 2: shotDirection.x = 1.0; break; case 3: shotDirection.y = 1.0; } } } bVar7 = Weapon::IsAxisAligned(this); if (bVar7 != 0) { pVVar11 = Vector::ToCardinal((Vector *)(local_27c + 8),&shotDirection); shotDirection.x = pVVar11->x; shotDirection.y = pVVar11->y; } local_218.y = shotDirection.y; local_1ec.x = shotDirection.x; if ((((player != (Entity_Player *)0x0) && (iVar12 = *(int *)((int)this + 4), iVar12 != 0)) && (*(int *)(iVar12 + 0x28) == 1)) && ((0 < *(int *)(iVar12 + 0x145c) || ((*(int *)(iVar12 + 0x2c) == 1 && (*(int *)(iVar12 + 0x1aec) == 8)))))) { local_1c4._0_4_ = (float)(int)*(char *)(iVar12 + 0x1578) * 45.0 * 0.017453292; local_2a4.y = cos((float)local_1c4._0_4_); fVar27 = sin((float)local_1c4._0_4_); shotDirection.x = local_2a4.y * local_1ec.x - fVar27 * local_218.y; shotDirection.y = local_2a4.y * local_218.y + fVar27 * local_1ec.x; local_1ec.y = (float)EVar29; } if ((heldClub->_isSwinging == 0) && (heldClub->_isFlying == 0)) { local_1ec.x = (float)((int)this + 0x44); local_1e4.y = 0.0; EVar28 = (EntityPtr)shotDirection.y; EVar25 = (EntityPtr)shotDirection.x; do { local_1c4._0_4_ = *(undefined4 *)local_1ec.x; if ((EntityPtr)local_1c4._0_4_ != (EntityPtr)0x0) { fVar27 = atan2f((float)EVar28,(float)EVar25); EVar28 = (EntityPtr)(fVar27 * 57.295776 + *(float *)((int)&DAT_00b81710 + (int)local_1e4.y)) ; if (360.0 < ABS((float)EVar28)) { EVar28 = (EntityPtr)fmodf((float)EVar28,360.0); } if ((float)EVar28 <= 180.0) { if ((float)EVar28 < -180.0) { EVar28 = (EntityPtr)((float)EVar28 + 360.0); } } else { EVar28 = (EntityPtr)((float)EVar28 - 360.0); } *(EntityPtr *)(local_1c4._0_4_ + 0x438) = EVar28; EVar28 = (EntityPtr)shotDirection.y; EVar25 = (EntityPtr)shotDirection.x; } local_1e4.y = (float)((int)local_1e4.y + 4); local_1ec.x = (float)((int)local_1ec.x + 4); } while ((uint)local_1e4.y < 0x10); if (heldClub->field_0x466 == '\0') { heldClub->_rotationOffset = 0.0; } iVar12 = g_game->_frameCount - heldClub->_spawnFrame; if (*(float *)((int)this + 0x14) <= 0.0) { if (iVar12 < 2) { local_1ec.x = (float)clubScale; } else { fVar27 = (heldClub->_sprite)._scale.x; local_1ec.x = ((float)clubScale - fVar27) * 0.5 + fVar27; } } else { if (1 < iVar12) goto LAB_009fb512; local_1ec.x = (float)clubScale; } local_1e4.y = (float)((int)this + 0x44); local_218.y = 5.60519e-45; do { if (*(int *)local_1e4.y != 0) { init_club(); iVar12 = *(int *)local_1e4.y; fVar27 = local_1ec.x * g_vectorOne.y; *(float *)(iVar12 + 0xe4) = local_1ec.x * g_vectorOne.x; *(float *)(iVar12 + 0xe8) = fVar27; } local_218.y = (float)((int)local_218.y + -1); local_1e4.y = (float)((int)local_1e4.y + 4); } while ((EntityPtr)local_218.y != (EntityPtr)0x0); } LAB_009fb512: if (local_1c6 == 0) { if (((char)isBrimstone != '\0') && (bVar7 = Weapon::IsItemAnimFinished(this,0x76), bVar7 != 0)) { Weapon::stop_costume_item_anim(this,0x76); } if ((char)isCursedEye != '\0') { Weapon::stop_costume_item_anim(this,0x13c); } if ((isChocolateMilk != 0) && (bVar7 = Weapon::IsItemAnimFinished(this,0x45), bVar7 != 0)) { Weapon::stop_costume_item_anim(this,0x45); } if ((local_250._0_1_ != '\0') && (bVar7 = Weapon::IsItemAnimFinished(this,0xe5), bVar7 != 0)) { Weapon::stop_costume_item_anim(this,0xe5); } if ((SUB41(local_248.y,0) != '\0') && (bVar7 = Weapon::is_c_section_anim_finished(this,(int)local_248.y), bVar7 != 0)) { Weapon::update_c_section_charge_anim(this,unusedCollectibleId,0,aimDirection,0.0); } } if (isInterpolated != 0) { ExceptionList = local_10; return; } EVar28 = *(EntityPtr *)((int)this + 0x14); newCharge = EVar28; if (local_1c6 == 0) { if ((isChargeMode != '\0') || (((player != (Entity_Player *)0x0 && (player->_heldEntity != (void *)0x0)) || (local_248.y._0_1_ != '\0')))) { if (0.0 < (float)EVar28) { newCharge = (EntityPtr)0x0; if (0.0 <= *(float *)((int)this + 0xc)) { *(undefined4 *)((int)this + 0x5c) = 0; } } goto LAB_009fba4f; } if (1.0 < (float)EVar28) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)&local_2bc,8,1,-1,0,0) ; local_8 = 5.60519e-45; local_200 = (EntityPtr)0x0; EVar28 = extraout_ECX; if (EStack_2b0 != (EntityPtr)0x0) { do { local_1c4._0_4_ = *(EntityPtr *)((int)pvStack_2b8 + (int)local_200 * 4); EVar28 = *(EntityPtr *)(local_1c4._0_4_ + 0x3bc); if ((EVar28 != (EntityPtr)0x0) && ((EVar28 == *(EntityPtr *)((int)this + 4) || (*(EntityPtr *)((int)EVar28 + 0x3bc) == *(EntityPtr *)((int)this + 4))))) { EVar29 = (EntityPtr)((float)*(EntityPtr *)(local_1c4._0_4_ + 0x43c) * 0.5); if (360.0 < ABS((float)EVar29)) { EVar29 = (EntityPtr)fmodf((float)EVar29,360.0); EVar28 = extraout_ECX_00; } if ((float)EVar29 <= 180.0) { if ((float)EVar29 < -180.0) { EVar29 = (EntityPtr)((float)EVar29 + 360.0); } } else { EVar29 = (EntityPtr)((float)EVar29 - 360.0); } *(EntityPtr *)(local_1c4._0_4_ + 0x43c) = EVar29; } local_200 = (EntityPtr)((int)local_200 + 1); } while ((uint)local_200 < (uint)EStack_2b0); EVar29 = (EntityPtr)local_1ec.y; } Weapon::SetBlinkTime(this,7 - (int)((float)local_224 * -0.45),(int)EVar28); Weapon::TriggerTearEffects(this,&shotDirection,1); local_1c4._0_4_ = (float)local_224 * 3.0; local_1ec.x = 300.0; local_224 = (EntityPtr)local_1c4._0_4_; pEVar16 = (EntityPtr *)local_1c4; if ((float)*(EntityPtr *)((int)this + 0x14) <= (float)local_1c4._0_4_) { pEVar16 = (EntityPtr *)((int)this + 0x14); } local_200 = *pEVar16; if ((EVar29 == (EntityPtr)0x0) || (bVar7 = Entity_Player::HasCollectible((Entity_Player *)EVar29,0xe9,0), bVar7 == 0)) { fVar27 = 300.0; local_1e4.y = 0.2; local_250 = (EntityPtr)((float)local_200 / (float)local_224); pEVar16 = &local_250; if ((float)local_200 / (float)local_224 <= 0.2) { pEVar16 = (EntityPtr *)&local_1e4.y; } local_218.y = (float)*pEVar16; if (EVar29 == (EntityPtr)0x0) { local_1c4._0_4_ = (EntityPtr)0x43820000; } else { local_1c4._0_4_ = *(EntityPtr *)((int)EVar29 + 0x1480); } } else { local_1e4.y = 0.2; local_1ec.x = 100000.0; fVar27 = 100000.0; local_250 = (EntityPtr)((float)local_200 / (float)local_224); local_1c4._0_4_ = *(EntityPtr *)((int)EVar29 + 0x1480); pEVar16 = &local_250; if ((float)local_200 / (float)local_224 <= 0.2) { pEVar16 = (EntityPtr *)&local_1e4.y; } local_218.y = (float)*pEVar16; } local_1e4.y = 0.2; local_200 = (EntityPtr)0x43480000; pVVar11 = (Vector *)local_1c4; if (fVar27 <= (float)local_1c4._0_4_) { pVVar11 = &local_1ec; } local_1c4._0_4_ = pVVar11->x * 0.9; pEVar16 = (EntityPtr *)local_1c4; if ((float)local_1c4._0_4_ <= 200.0) { pEVar16 = &local_200; } uVar9 = 0; EVar28 = *pEVar16; local_200 = (EntityPtr)((int)this + 0x44); local_1c4._0_4_ = EVar28; do { club = *(Entity_Knife **)local_200; if ((club != (Entity_Knife *)0x0) && ((uVar9 == 0 || (club->field_0x466 != '\0')))) { Entity_Knife::Shoot(club,local_218.y,(float)EVar28); EVar28 = (EntityPtr)local_1c4._0_4_; } uVar9 = uVar9 + 1; local_200 = (EntityPtr)((int)local_200 + 4); } while (uVar9 < 4); Weapon::SetHeadLockTime(this,2); if (player != (Entity_Player *)0x0) { Entity_Player::TryForgottenThrow(player,&shotDirection); } local_8 = -NAN; if (local_2bc._0_1_ == '\0') { local_8 = 7.00649e-45; tracked_alloc(1,pvStack_2b8,0); } } if (*(int *)((int)this + 0x44) != 0) { *(undefined1 *)(*(int *)((int)this + 0x44) + 0x466) = 0; } if (*(int *)((int)this + 0x48) != 0) { *(undefined1 *)(*(int *)((int)this + 0x48) + 0x466) = 0; } if (*(int *)((int)this + 0x4c) != 0) { *(undefined1 *)(*(int *)((int)this + 0x4c) + 0x466) = 0; } if (*(int *)((int)this + 0x50) != 0) { *(undefined1 *)(*(int *)((int)this + 0x50) + 0x466) = 0; } *(float *)((int)this + 0x20) = g_vectorZero.x; *(float *)((int)this + 0x24) = g_vectorZero.y; EVar28 = (EntityPtr)0x0; LAB_009fb9ec: club = heldClub; goto LAB_009fb9f2; } LAB_009fba4f: iVar12 = *(int *)((int)this + 4); if (((iVar12 == 0) || (*(int *)(iVar12 + 0x28) != 1)) || (piVar21 = (int *)local_248.y, *(int *)(iVar12 + 0x18f8) < 1)) { uVar23 = (undefined3)((uint)player >> 8); if ((player == (Entity_Player *)0x0) || ((player->_temporaryeffects)._disabled != 0)) { uVar20 = CONCAT31(uVar23,local_1c5); } else { piVar13 = (player->_temporaryeffects)._effects._begin; piVar3 = (player->_temporaryeffects)._effects._end; if (piVar13 == piVar3) { uVar20 = CONCAT31(uVar23,local_1c5); } else { do { piVar21 = (int *)*piVar13; if ((*piVar21 == 0) && (piVar21[1] == 0x78)) goto LAB_009fbb0b; piVar13 = piVar13 + 4; uVar20 = CONCAT31(CONCAT21((short)((uint)player >> 0x10),isDrFetus),local_1c5); local_1ec.y = (float)EVar29; } while (piVar13 != piVar3); isDrFetus = isDrFetus; player = player; } } if ((char)uVar20 == '\0') { if (local_248.y._0_1_ != '\0') goto LAB_009fbb7b; } else { if (isChargeMode == '\0') goto LAB_009fbb11; LAB_009fbb7b: if ((((local_1c6 != 0) && ((float)maxCharge <= (float)EVar28)) && (local_1c6 = 0, 0.0 < (float)EVar28)) && (newCharge = (EntityPtr)0x0, 0.0 <= *(float *)((int)this + 0xc))) { *(undefined4 *)((int)this + 0x5c) = 0; } isReleased = '\x01'; } } else { LAB_009fbb0b: uVar20 = CONCAT31((int3)((uint)piVar21 >> 8),local_1c5); LAB_009fbb11: isChargeMode = '\0'; newCharge = EVar28; local_1ec.x = (float)EVar28; *(undefined4 *)((int)this + 0x14) = 0; if ((char)uVar20 != '\0') { local_1c4._0_4_ = (EntityPtr)0x3f800000; isReleased = '\x01'; pVVar11 = (Vector *)local_1c4; if (1.0 <= (float)EVar28) { pVVar11 = &local_1ec; } newCharge = (EntityPtr)pVVar11->x; } } owner = player; pfVar15 = (float *)((int)this + 0x14); iVar12 = CONCAT22((short)((uint)uVar20 >> 0x10),CONCAT11(local_1c6,(char)uVar20)); if ((local_1c6 == 0) || ((heldClub->_isSwinging != 0 && ((char)uVar20 == '\0')))) { if ((isChargeMode == '\0') && (local_1c6 != 0)) goto LAB_009fbc0f; LAB_009fbc27: if ((((player != (Entity_Player *)0x0) && (player->_heldEntity != (void *)0x0)) && (local_1c6 == 0)) || (((local_248.y._0_1_ != '\0' && (local_1c6 == 0)) && ((*(float *)((int)this + 0xc) <= 0.0 && *(float *)((int)this + 0xc) != 0.0 && (1.0 < *pfVar15)))))) goto LAB_009fbcd3; EVar28 = newCharge; if (((isChocolateMilk == 0) && ((char)isBrimstone == '\0')) && (local_250._0_1_ == '\0')) { if ((char)isCursedEye != '\0') goto LAB_009fbc86; goto LAB_009fdeca; } if ((char)isCursedEye == '\0') { if (local_1c6 == 0) { if ((0.0 < *(float *)((int)this + 0xc) || *(float *)((int)this + 0xc) == 0.0) || (*pfVar15 <= 1.0)) goto LAB_009fb9ec; goto LAB_009fbcd3; } } else { LAB_009fbc86: if (local_1c6 == 0) { if ((0.0 < *(float *)((int)this + 0xc) || *(float *)((int)this + 0xc) == 0.0) || (*(int *)((int)this + 0x5c) < 1)) goto LAB_009fb9ec; goto LAB_009fbcd3; } } } else { if (isChargeMode != '\0') { if (*pfVar15 <= 1.0 && *pfVar15 != 1.0) { *pfVar15 = 1.0; newCharge = (EntityPtr)0x3f800000; } goto LAB_009fbc27; } LAB_009fbc0f: if (((0.0 < *(float *)((int)this + 0xc) || *(float *)((int)this + 0xc) == 0.0) || (0.0 < *pfVar15)) || (heldClub->_isFlying != 0)) goto LAB_009fbc27; LAB_009fbcd3: Weapon::GetMultiShotParams(this,local_2f8._tint + 2,iVar12); iVar12 = *(int *)((int)this + 4); *(EntityPtr *)((int)this + 0xc) = local_224; unused = extraout_ECX_01; if (iVar12 != 0) { uVar24 = (uint3)((uint)extraout_ECX_01 >> 8); if (*(int *)(iVar12 + 0x28) == 1) { unused = CONCAT31(uVar24,*(undefined1 *)(iVar12 + 0x1578)); } else if ((iVar12 == 0) || (unused = (uint)uVar24 << 8, *(int *)(iVar12 + 0x28) != 1)) goto LAB_009fbd18; cVar19 = (char)unused; unused = CONCAT31((int3)((uint)unused >> 8),-cVar19); *(char *)(iVar12 + 0x1578) = -cVar19; } LAB_009fbd18: Weapon::SetBlinkTime(this,7 - (int)((float)local_224 * -0.45),unused); Weapon::TriggerTearEffects(this,&shotDirection,1); pVVar11 = &local_1ec; local_1ec.x = 0.5; local_280 = 1.0; local_2bc = local_2f8._tint[2]; pvStack_2b8 = (void *)local_2f8._tint[3]; pvStack_2b4 = (void *)local_2f8._colorize[0]; EStack_2b0 = (EntityPtr)local_2f8._colorize[1]; local_1c4._0_4_ = 1.0 / ((float)clubScale * 0.5 + 0.5); pVVar14 = (Vector *)local_1c4; if ((float)local_1c4._0_4_ <= 0.5) { pVVar14 = pVVar11; } local_2cc = (void *)local_2f8._colorize[2]; EStack_2c8 = (EntityPtr)local_2f8._colorize[3]; fStack_2c4 = local_2f8._offset[0]; fStack_2c0 = local_2f8._offset[1]; local_208 = local_2f8._offset[2]; local_238.y = pVVar14->x; local_1d2 = local_2f8._tint[2]._0_2_; if (owner != (Entity_Player *)0x0) { pvVar22 = owner->_heldEntity; local_1ec.x = (float)&owner->_heldEntity; if (pvVar22 != (void *)0x0) { fVar27 = (owner->_pos).y; *(float *)((int)pvVar22 + 0x33c) = (owner->_pos).x; *(float *)((int)pvVar22 + 0x340) = fVar27; EVar28 = (EntityPtr)owner->_heldEntity; local_1e4.y = (float)EVar28; if (*(int *)((int)EVar28 + 0x28) == 4) { *(uint *)((int)EVar28 + 0x16c) = *(uint *)((int)EVar28 + 0x16c) & 0xfdffffdf; *(int *)((int)EVar28 + 0x168) = *(int *)((int)EVar28 + 0x168); *(int *)((int)EVar28 + 0x354) = 0; local_218.y = 0.0; if (0 < local_2f8._tint[2]._0_2_) { local_1c4._0_4_ = (int)local_2f8._tint[2]._0_2_ / 2; do { EVar28 = (EntityPtr)local_1e4.y; FUN_009f4230(local_27c,local_218.y,5,shotDirection.x,shotDirection.y,shotSpeed); if (local_218.y == (float)local_1c4._0_4_) { *(undefined1 *)((int)local_1e4.y + 0x461) = 1; } else { EVar28 = (EntityPtr)Weapon::fire_bomb(this,&ownerPos,&g_vectorZero); iVar12 = *(int *)((int)player->_heldEntity + 0x410); *(int *)((int)EVar28 + 0x410) = iVar12; *(int *)((int)EVar28 + 0x414) = iVar12; anim = ANM2::GetAnimation((ANM2 *)((int)local_1e4.y + 0x78), (std_string *)(local_c4 + 0x14)); local_8 = 0.0; if (0xf < anim->_capacity) { anim = *(std_string **)anim->_buf; } ANM2::Play((ANM2 *)((int)EVar28 + 0x48),(byte *)anim,0); local_8 = -NAN; std::string::_Tidy_deallocate(local_c4 + 0x14); if (*(void **)((int)EVar28 + 0x7c) != (void *)0x0) { AnimationState::SetFrameFloat ((AnimationState *)((int)EVar28 + 0x78), (float)(int)*(float *)((int)local_1e4.y + 0x88)); } } *(int *)((int)EVar28 + 0x188) = 4; *(int *)((int)EVar28 + 0x184) = 6; local_2a4.y = local_270; local_1d8 = (EntityPtr)local_27c._8_4_; if ((*(int *)((int)EVar28 + 0x2c) == 0x13) || (*(int *)((int)EVar28 + 0x2c) == 0x14)) { fVar27 = atan2f(local_270,(float)local_27c._8_4_); *(float *)((int)EVar28 + 0x428) = fVar27 * 57.295776; } else { *(float *)((int)EVar28 + 0x41c) = -5.0; } ((Vector *)((int)EVar28 + 0x34c))->x = 0.0; *(float *)((int)EVar28 + 0x350) = -14.0; fVar32 = sqrtf(local_2a4.y * local_2a4.y + (float)local_1d8 * (float)local_1d8); EVar29 = local_1d8; fVar27 = local_2a4.y; if (0.0 < fVar32) { EVar29 = (EntityPtr)((float)local_1d8 * (1.0 / fVar32)); fVar27 = local_2a4.y * (1.0 / fVar32); } fVar32 = (player->_lastVelocity).x * 0.6; iVar12 = *(int *)EVar28; fVar33 = (player->_lastVelocity).y * 0.6; ((Vector *)((int)EVar28 + 0x360))->x = (float)EVar29 * 20.0 + fVar32 + fVar32; *(float *)((int)EVar28 + 0x364) = fVar27 * 20.0 + fVar33 + fVar33; (**(code **)(iVar12 + 0x40))(); local_218.y = (float)((int)local_218.y + 1); *(float *)((int)EVar28 + 0x42c) = 15.0; } while ((int)local_218.y < (int)local_1d2); } } else if ((*(int *)((int)EVar28 + 0x28) == 1000) && (*(int *)((int)EVar28 + 0x2c) == 0x76)) { iVar12 = *(int *)((int)this + 0x58); if (iVar12 == 0) { local_220.x = ownerPos.x + shotDirection.x * 80.0; local_220.y = ownerPos.y + shotDirection.y * 80.0; } else { local_220.x = (float)*(EntityPtr *)(iVar12 + 0x33c); local_220.y = *(float *)(iVar12 + 0x340); } *(uint *)((int)EVar28 + 0x16c) = *(uint *)((int)EVar28 + 0x16c) & 0xffffffdf; *(int *)((int)EVar28 + 0x168) = *(int *)((int)EVar28 + 0x168); local_218.y = local_220.x - ownerPos.x; local_1d8 = (EntityPtr)(local_220.y - ownerPos.y); *(int *)((int)EVar28 + 0x354) = 0; ((Vector *)((int)EVar28 + 0x34c))->x = 0.0; *(float *)((int)EVar28 + 0x350) = 0.0; *(EntityPtr *)((int)EVar28 + 0x450) = (EntityPtr)0x1; local_1e4.y = 0.0; if (0 < local_2f8._tint[2]._0_2_) { local_220.x = 1.0; local_248.x = (float)((int)local_2f8._tint[2]._0_2_ / 2); local_220.y = 0.0; do { FUN_009f4230(local_27c,local_1e4.y,5,local_220.x,local_220.y,shotSpeed); fVar27 = atan2f(local_270,(float)local_27c._8_4_); local_1c4._0_4_ = fVar27 * 57.295776 * 0.017453292; local_2a4.y = cos((float)local_1c4._0_4_); fVar27 = sin((float)local_1c4._0_4_); local_1c4._0_4_ = ownerPos.x + (local_218.y * local_2a4.y - (float)local_1d8 * fVar27) ; local_2a4.y = ownerPos.y + (float)local_1d8 * local_2a4.y + local_218.y * fVar27; if (local_1e4.y == local_248.x) { EVar29 = EVar28; } else { uVar9 = Random(); EVar29 = (EntityPtr) Game::Spawn(g_game,1000,0x76,&ownerPos,&g_vectorZero, *(Entity **)((int)this + 4),0,uVar9); } local_1e4.y = (float)((int)local_1e4.y + 1); *(float *)((int)EVar29 + 0x338) = local_2a4.y; *(float *)((int)EVar29 + 0x450) = local_1e4.y; *(undefined4 *)((int)EVar29 + 0x334) = local_1c4._0_4_; } while ((int)local_1e4.y < (int)local_1d2); } } *(undefined1 *)(*(int *)local_1ec.x + 0x171) = 1; pVVar11 = (Vector *)0x0; if (*(int *)local_1ec.x != 0) { local_248.x = local_1ec.x; std::multiset::erase(); pVVar11 = extraout_ECX_02; } *(int *)local_1ec.x = 0; } } if (isChocolateMilk != 0) { pVVar11 = (Vector *)local_1c4; local_248.x = 1.0; local_1c4._0_4_ = (*(float *)((int)this + 0x14) / (float)local_224 - 1.0) + 1.0; pVVar14 = &local_248; if (1.0 <= (float)local_1c4._0_4_) { pVVar14 = pVVar11; } local_280 = pVVar14->x; } if ((local_250._0_1_ != '\0') && ((float)local_228 <= *(float *)((int)this + 0x14))) { Weapon::UpdateHeadChargeAnimation(this,0xe5,2,&shotDirection,-1.0); local_220.x = shotDirection.x * 10.0; local_220.y = shotDirection.y * 10.0; local_1e4.y = local_220.y; local_1d8 = (EntityPtr)local_220.x; pVVar11 = Weapon::get_tear_movement_inheritance(this,(Vector *)(local_27c + 8),&local_220); fVar27 = local_1ec.y; local_1d8 = (EntityPtr)((float)local_1d8 + pVVar11->x); local_1e4.y = local_1e4.y + pVVar11->y; if (((EntityPtr)local_1ec.y == (EntityPtr)0x0) || (bVar7 = Entity_Player::HasCollectible((Entity_Player *)local_1ec.y,0x95,0), bVar7 == 0)) { local_1ec.x = 1.68156e-44; if ((EntityPtr)fVar27 != (EntityPtr)0x0) goto LAB_009fc57a; } else { uVar9 = Random(); fVar32 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.7; local_1d8 = (EntityPtr)((float)local_1d8 * fVar32); local_1e4.y = local_1e4.y * fVar32; LAB_009fc57a: local_1ec.x = 1.68156e-44; bVar7 = Entity_Player::HasCollectible((Entity_Player *)fVar27,0x213,0); if (bVar7 != 0) { bVar7 = Entity_Player::HasCollectible((Entity_Player *)fVar27,0x76,0); local_1ec.x = (float)((uint)(bVar7 == 0) * 2 + 5); } } bVar7 = Entity_Player::HasCollectible((Entity_Player *)fVar27,0x34,0); EVar28 = (EntityPtr)local_1ec.x; if (bVar7 != 0) { EVar28 = (EntityPtr)0x5; } local_1c4._0_4_ = EStack_2c8; local_248.x = (float)((int)EVar28 + (int)(((float)(int)EVar28 / 5.0) * (float)(int)local_1d2)) / (float)(int)EStack_2c8; iVar12 = 0x9fc63a; dVar35 = ceil((double)local_248.x); local_218.y = (float)dVar35; local_2a4.y = 0.0; pVVar11 = extraout_ECX_03; if (0 < (int)local_1c4._0_4_) { do { fVar32 = local_2a4.y; fVar27 = 0.0; if (1 < (int)local_1c4._0_4_) { local_1ec.x = (float)((uint)local_2f8._offset[0] ^ 0x80000000); local_248.x = (float)(int)local_1c4._0_4_ - 1.0; if (local_248.x == 0.0) { iVar12 = 0x9fc6b2; KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar27 = ((float)(int)fVar32 - 0.0) / (local_248.x - 0.0); auVar31 = ZEXT416((uint)fVar27); if (fVar27 <= 0.0) { auVar31 = ZEXT816(0); } if (1.0 <= auVar31._0_4_) { auVar31._0_4_ = 0x3f800000; } fVar27 = (local_2f8._offset[0] - local_1ec.x) * auVar31._0_4_ + local_1ec.x; } local_248.x = fVar27 * 0.017453292; local_1ec.x = cos(local_248.x); fVar27 = sin(local_248.x); fVar34 = (float)local_1d8 * local_1ec.x; fVar33 = local_1e4.y * local_1ec.x; local_1ec.x = 0.0; pVVar11 = extraout_ECX_04; if (0 < (int)local_218.y) { local_264.y = (fVar34 - local_1e4.y * fVar27) * (float)shotSpeed; local_220.y = (fVar33 + (float)local_1d8 * fVar27) * (float)shotSpeed; do { uVar9 = Random(); fVar27 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_248.x = fVar27 + fVar27; local_284 = (EntityPtr)sin(local_248.x); uVar9 = Random(); local_298 = (EntityPtr) ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10); fVar27 = cos(local_248.x); local_27c._8_4_ = fVar27 * (float)local_298 * 3.5 + local_264.y; local_270 = (float)local_298 * (float)local_284 * 3.5 + local_220.y; EVar28 = (EntityPtr) Weapon::fire_tear(this,&ownerPos,(Vector *)(local_27c + 8),0,iVar12,1.0,0.0); local_284 = EVar28; if ((*(int *)((int)EVar28 + 0x2c) == 0x1d) && (uVar9 = Random(), (uVar9 & 3) != 0)) { fStack_48 = 0.0; fStack_44 = 2.10195e-44; local_6c._20_4_ = (void *)0x0; std::string::assign(local_6c + 0x14,(byte *)"gfx/tears_brokenbone.png",0x18); local_8 = 1.4013e-45; iVar12 = 0x9fc8f0; Sprite::ReplaceSpritesheet ((Sprite *)((int)EVar28 + 0x48),0,(std_string *)(local_6c + 0x14)); local_8 = -NAN; bVar7 = extraout_CL; if (0xf < (uint)fStack_44) { uVar9 = (int)fStack_44 + 1; pvVar22 = (void *)local_6c._20_4_; if (0xfff < uVar9) { pvVar22 = *(void **)(local_6c._20_4_ + -4); uVar9 = (int)fStack_44 + 0x24; if (0x1f < (uint)(local_6c._20_4_ + (-4 - (int)pvVar22))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } iVar12 = 0x9fc928; operator_delete(pvVar22,uVar9); bVar7 = extraout_CL_00; } ANM2::LoadGraphics((ANM2 *)((int)EVar28 + 0x48),bVar7); } if ((EntityPtr)local_1ec.y == (EntityPtr)0x0) { LAB_009fc98a: *(float *)((int)EVar28 + 0x418) = *(float *)((int)local_1ec.y + 0x147c) + 0.5; uVar9 = Random(); *(float *)((int)EVar28 + 0x414) = (*(float *)((int)local_1ec.y + 0x1478) - (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 15.0) + 5.0; } else { iVar12 = 0x9fc94c; bVar7 = Entity_Player::HasCollectible((Entity_Player *)local_1ec.y,0x95,0); if (bVar7 == 0) { local_50 = *(undefined1 (*) [4])&((BitSet128 *)((int)EVar28 + 0x428))->_l; fStack_4c = *(float *)((int)EVar28 + 0x42c); fStack_48 = *(float *)((int)EVar28 + 0x430); fStack_44 = *(float *)((int)EVar28 + 0x434); pBVar10 = BitSet128::operator_and ((BitSet128 *)&EStack_a8,(BitSet128 *)local_50, (BitSet128 *)&DAT_00c345e0); if (((int)pBVar10->_l == 0 && *(int *)((int)&pBVar10->_l + 4) == 0) && ((int)pBVar10->_h == 0 && *(int *)((int)&pBVar10->_h + 4) == 0)) goto LAB_009fc98a; } } uVar9 = Random(); rngResult = Random(); EVar28 = local_284; local_298 = (EntityPtr)0x3c23d70a; local_284 = (EntityPtr) ((((float)(uVar9 & 1) + 0.0) * 0.4 + 0.9 + (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.05) * *(float *)((int)local_284 + 0x420)); pEVar16 = &local_284; if ((float)local_284 <= 0.01) { pEVar16 = &local_298; } EVar29 = *pEVar16; *(EntityPtr *)((int)EVar28 + 0x424) = EVar29; *(EntityPtr *)((int)EVar28 + 0x420) = EVar29; Entity_Tear::ResetSpriteScale((Entity_Tear *)EVar28); pVVar11 = (Vector *)(int)local_218.y; local_1ec.x = (float)((int)local_1ec.x + 1); } while ((int)local_1ec.x < (int)pVVar11); fVar32 = local_2a4.y; } local_2a4.y = (float)((int)fVar32 + 1); } while ((int)local_2a4.y < (int)local_1c4._0_4_); } } if (((char)isBrimstone != '\0') && ((float)local_228 <= *(float *)((int)this + 0x14))) { Weapon::UpdateHeadChargeAnimation(this,0x76,2,&shotDirection,-1.0); local_220.y = atan2f(shotDirection.y,shotDirection.x); local_220.y = local_220.y * 57.295776; local_1e4.y = 0.0; do { local_1c4._0_4_ = *(EntityPtr *)((int)this + (int)local_1e4.y * 4 + 0x44); EVar28 = (EntityPtr)local_1e4.y; if (((EntityPtr)local_1c4._0_4_ != (EntityPtr)0x0) && (((EntityPtr)local_1e4.y == (EntityPtr)0x0 || ((((EntityPtr)local_1e4.y == (EntityPtr)0x1 && (local_2f8._offset[1]._1_1_ != '\0')) || (local_2f8._offset[1]._2_1_ != '\0')))))) { pcVar4 = *(code **)(*(int *)local_1c4._0_4_ + 0x3c); if ((EntityPtr)local_1ec.y == (EntityPtr)0x0) { Color::Reset(&flashColor); flashColor._tint[0] = 1.0; flashColor._tint[1] = 0.0; flashColor._tint[2] = 0.0; flashColor._tint[3] = 1.0; flashColor._offset[0] = 0.0; flashColor._offset[1] = 0.0; flashColor._offset[2] = 0.0; } else { Color::Reset((Color *)local_6c); local_6c._0_4_ = 1.0; local_6c._4_4_ = 0.0; local_6c._8_4_ = 0.0; local_6c._12_4_ = 1.0; fStack_4c = 0.0; local_c4._0_4_ = *(float *)((int)local_1ec.y + 0x14c4); local_c4._4_4_ = *(undefined4 *)((int)local_1ec.y + 0x14c8); local_c4._8_4_ = *(int *)((int)local_1ec.y + 0x14cc); local_c4._12_4_ = *(int *)((int)local_1ec.y + 0x14d0); fStack_48 = 0.0; fStack_44 = 0.0; local_c4._16_4_ = ((AnimationState *)((int)local_1ec.y + 0x14d4))->_animation; local_c4._20_4_ = *(EntityPtr *)((int)local_1ec.y + 0x14d8); pvStack_ac = *(void **)((int)local_1ec.y + 0x14dc); EStack_a8 = *(EntityPtr *)((int)local_1ec.y + 0x14e0); local_a4 = *(float (*) [2])((int)local_1ec.y + 0x14e4); local_9c = *(float *)((int)local_1ec.y + 0x14ec); Color::__mul((Color *)local_c4,(ColorMod *)local_6c); chargeColor._offset[2] = local_9c; chargeColor._tint[0] = (float)local_c4._0_4_; chargeColor._tint[1] = (float)local_c4._4_4_; chargeColor._tint[2] = (float)local_c4._8_4_; chargeColor._tint[3] = (float)local_c4._12_4_; chargeColor._colorize[0] = (float)local_c4._16_4_; chargeColor._colorize[1] = (float)local_c4._20_4_; chargeColor._colorize[2] = (float)pvStack_ac; chargeColor._colorize[3] = (float)EStack_a8; chargeColor._offset[0] = local_a4[0]; chargeColor._offset[1] = local_a4[1]; } (*pcVar4)(); EVar28 = (EntityPtr)local_1e4.y; if ((EntityPtr)local_1e4.y == (EntityPtr)0x0) { if (0 < local_1d2) { local_29c = 0x3f800000; local_298 = (EntityPtr)local_1e4.y; iVar12 = 0; do { FUN_009f4230(local_2ac,iVar12,10,local_29c,local_298,shotSpeed); fVar27 = atan2f(local_2a4.y,local_2a4.x); local_264.y = (fVar27 * 57.295776 + local_220.y) * 0.017453292; local_284 = (EntityPtr)sin(local_264.y); fVar27 = cos(local_264.y); local_270 = (float)local_284 * 6.0; local_27c._8_4_ = fVar27 * 6.0; local_24c = ownerPos.x + fVar27 * 30.0; local_248.x = ownerPos.y + (float)local_284 * 30.0; Weapon::fire_brimstone_ball(); iVar12 = iVar12 + 1; } while (iVar12 < local_1d2); } EVar28 = (EntityPtr)local_1e4.y; } else { fVar27 = atan2f(shotDirection.y,shotDirection.x); fVar27 = fVar27 * 57.295776 + (float)(&DAT_00b81710)[(int)EVar28]; if (360.0 < ABS(fVar27)) { fVar27 = fmodf(fVar27,360.0); } if (fVar27 <= 180.0) { if (fVar27 < -180.0) { fVar27 = fVar27 + 360.0; } } else { fVar27 = fVar27 - 360.0; } local_264.y = fVar27 * 0.017453292; local_284 = (EntityPtr)sin(local_264.y); fVar27 = cos(local_264.y); local_1ec.x = (float)local_284 * 6.0; local_1f0 = fVar27 * 6.0; local_218.x = ownerPos.x + fVar27 * 30.0; local_218.y = ownerPos.y + (float)local_284 * 30.0; Weapon::fire_brimstone_ball(); } } pMVar6 = g_manager; local_1e4.y = (float)((int)EVar28 + 1); } while ((uint)local_1e4.y < 4); local_1c4._0_4_ = (EntityPtr)0x7; seed_fart_sound_override((int *)local_1c4); SoundEffects::Play(&pMVar6->_sfxManager,local_1c4._0_4_,0.5,2,0,1.0,0.0); Weapon::SetBlinkTime(this,0x24,unused_00); pVVar11 = extraout_ECX_05; } if ((local_248.y._0_1_ != '\0') && ((float)local_228 <= *(float *)((int)this + 0x14))) { Weapon::update_c_section_charge_anim(this,(int)pVVar11,2,aimDirection,-1.0); fVar27 = atan2f(shotDirection.y,shotDirection.x); local_284 = (EntityPtr)(fVar27 * 57.295776); local_1ec.x = 0.0; do { fVar27 = local_1ec.x; if (*(int *)((int)this + (int)local_1ec.x * 4 + 0x44) != 0) { if ((EntityPtr)local_1ec.x == (EntityPtr)0x0) { local_1c4._0_4_ = (EntityPtr)0x0; if (0 < local_1d2) { local_24c = 1.0; local_248.x = 0.0; local_298 = (EntityPtr)0x3c23d70a; do { FUN_009f4230(local_50,local_1c4._0_4_,10,local_24c,local_248.x,shotSpeed); fVar27 = atan2f(fStack_44,fStack_48); local_220.y = (fVar27 * 57.295776 + (float)local_284) * 0.017453292; local_264.y = sin(local_220.y); iVar12 = 0x9fd2a2; fVar27 = cos(local_220.y); local_2a4.y = local_264.y * 10.0; local_2a4.x = fVar27 * 10.0; local_1e4.x = ownerPos.x + fVar27 * 4.0; local_1e4.y = ownerPos.y + local_264.y * 4.0; fetusTear = fire_fetus_tear(this,&local_1e4,&local_2a4,0,*(Entity **)((int)this + 4) ,1.0,iVar12); local_220.y = fetusTear->_fScale * 1.2; pEVar16 = (EntityPtr *)&local_220.y; if (local_220.y <= 0.01) { pEVar16 = &local_298; } EVar28 = *pEVar16; fetusTear->_baseScale = (float)EVar28; fetusTear->_fScale = (float)EVar28; Entity_Tear::ResetSpriteScale(fetusTear); fetusTear->_tearRange = fetusTear->_tearRange + fetusTear->_tearRange; (**(code **)(*(int *)fetusTear + 0xc))(); local_1c4._0_4_ = local_1c4._0_4_ + 1; } while ((int)local_1c4._0_4_ < (int)local_1d2); } } else if ((((EntityPtr)local_1ec.x == (EntityPtr)0x1) && (local_2f8._offset[1]._1_1_ != '\0')) || (local_2f8._offset[1]._2_1_ != '\0')) { fVar32 = atan2f(shotDirection.y,shotDirection.x); fVar27 = fVar32 * 57.295776 + (float)(&DAT_00b81710)[(int)fVar27]; if (360.0 < ABS(fVar27)) { fVar27 = fmodf(fVar27,360.0); } if (fVar27 <= 180.0) { if (fVar27 < -180.0) { fVar27 = fVar27 + 360.0; } } else { fVar27 = fVar27 - 360.0; } local_220.y = fVar27 * 0.017453292; local_264.y = sin(local_220.y); iVar12 = 0x9fd0d2; fVar27 = cos(local_220.y); local_270 = local_264.y * 10.0; local_27c._8_4_ = fVar27 * 10.0; local_218.x = ownerPos.x + fVar27 * 4.0; local_218.y = ownerPos.y + local_264.y * 4.0; fetusTear = fire_fetus_tear(this,&local_218,(Vector *)(local_27c + 8),0, *(Entity **)((int)this + 4),1.0,iVar12); local_264.y = 0.01; local_220.y = fetusTear->_fScale * 1.2; pVVar11 = &local_220; if (local_220.y <= 0.01) { pVVar11 = &local_264; } fVar27 = pVVar11->y; fetusTear->_baseScale = fVar27; fetusTear->_fScale = fVar27; Entity_Tear::ResetSpriteScale(fetusTear); fetusTear->_tearRange = fetusTear->_tearRange + fetusTear->_tearRange; (**(code **)(*(int *)fetusTear + 0xc))(); } } local_1ec.x = (float)((int)local_1ec.x + 1); } while ((uint)local_1ec.x < 4); } if ((char)isCursedEye == '\0') { local_1e4.y = 1.4013e-45; } else { local_1e4.y = *(float *)((int)this + 0x5c); } EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_27c,8,1,-1,0,0); uVar20 = local_27c._4_4_; local_8 = 2.8026e-45; fVar27 = 0.0; if (local_270 != 0.0) { fVar32 = local_270; club = heldClub; do { piVar21 = *(int **)(uVar20 + (int)fVar27 * 4); if ((Entity_Knife *)piVar21[0xef] == club) { (**(code **)(*piVar21 + 0x28))(); fVar32 = local_270; club = heldClub; } fVar27 = (float)((int)fVar27 + 1); } while ((uint)fVar27 < (uint)fVar32); this = (void *)local_268; } local_1d8 = (EntityPtr)0x0; local_1c4._0_4_ = (EntityPtr)0x0; do { EVar28 = (EntityPtr)local_1c4._0_4_; if ((*(int *)((undefined1 *)((int)this + 0x44) + local_1c4._0_4_ * 4) != 0) && (((EntityPtr)local_1c4._0_4_ == (EntityPtr)0x0 || ((((EntityPtr)local_1c4._0_4_ == (EntityPtr)0x1 && (local_2f8._offset[1]._1_1_ != '\0')) || (local_2f8._offset[1]._2_1_ != '\0')))))) { local_1c4._4_4_ = 0.0; tearBombVariant = 0.0; Color::Color(&tearColor); tearFlags._l = 0; tearFlags._h = 0; tearDamage = 3.5; tearScale = 1.0; tearHeight = -23.75; fStack_16c = 1.0; local_168 = 1.7; local_164 = 1.0; local_160 = 0.0; piVar21 = extraout_EDX; if ((EntityPtr)local_1ec.y != (EntityPtr)0x0) { Random(); pfVar15 = (float *)Entity_Player::GetTearHitParams(); local_1c4._4_4_ = *pfVar15; tearBombVariant = pfVar15[1]; if (&tearColor != (Color *)(pfVar15 + 2)) { tearColor._tint[0] = ((Color *)(pfVar15 + 2))->_tint[0]; tearColor._tint[1] = pfVar15[3]; tearColor._tint[2] = pfVar15[4]; tearColor._tint[3] = pfVar15[5]; tearColor._colorize[0] = pfVar15[6]; tearColor._colorize[1] = pfVar15[7]; tearColor._colorize[2] = pfVar15[8]; tearColor._colorize[3] = pfVar15[9]; tearColor._offset._0_8_ = *(undefined8 *)(pfVar15 + 10); tearColor._offset[2] = pfVar15[0xc]; } tearFlags._l = *(qword *)(pfVar15 + 0xe); tearFlags._h = *(qword *)(pfVar15 + 0x10); tearDamage = pfVar15[0x12]; tearScale = pfVar15[0x13]; tearHeight = pfVar15[0x14]; fStack_16c = pfVar15[0x15]; local_168 = pfVar15[0x16]; local_164 = pfVar15[0x17]; piVar21 = *(int **)((undefined1 *)((int)this + 0x44) + local_1c4._0_4_ * 4); local_160 = pfVar15[0x18]; EVar28 = (EntityPtr)local_1c4._0_4_; } local_268 = (EntityPtr)(local_280 * tearDamage); pEVar16 = &local_268; if (local_280 * tearDamage <= (float)local_1d8) { pEVar16 = &local_1d8; } local_1d8 = *pEVar16; (**(code **)(*piVar21 + 0x3c))(); iVar12 = *(int *)((undefined1 *)((int)this + 0x44) + (int)EVar28 * 4); *(undefined4 *)(iVar12 + 0x410) = (undefined4)tearFlags._l; *(undefined4 *)(iVar12 + 0x414) = tearFlags._l._4_4_; *(undefined4 *)(iVar12 + 0x418) = (undefined4)tearFlags._h; *(undefined4 *)(iVar12 + 0x41c) = tearFlags._h._4_4_; (**(code **)(**(int **)((undefined1 *)((int)this + 0x44) + (int)EVar28 * 4) + 0x40))(); fVar27 = atan2f(shotDirection.y,shotDirection.x); fVar27 = fVar27 * 57.295776 + (float)(&DAT_00b81710)[(int)EVar28]; if (360.0 < ABS(fVar27)) { fVar27 = fmodf(fVar27,360.0); } if (fVar27 <= 180.0) { if (fVar27 < -180.0) { fVar27 = fVar27 + 360.0; } } else { fVar27 = fVar27 - 360.0; } *(float *)(*(int *)((undefined1 *)((int)this + 0x44) + (int)EVar28 * 4) + 0x438) = fVar27; iVar12 = *(int *)((undefined1 *)((int)this + 0x44) + (int)EVar28 * 4); *(short *)(iVar12 + 0x4ec) = SUB42(local_1e4.y,0); *(undefined2 *)(iVar12 + 0x4ee) = 0; Entity_Knife::SetAttackAnimation (*(Entity_Knife **)((undefined1 *)((int)this + 0x44) + (int)EVar28 * 4)); *(bool *)(*(int *)((undefined1 *)((int)this + 0x44) + (int)EVar28 * 4) + 0x466) = isChargeMode == '\0'; } local_1c4._0_4_ = (int)EVar28 + 1; } while ((uint)local_1c4._0_4_ < 4); local_1c4._0_4_ = (EntityPtr)0x0; if (0 < local_1d2) { local_288 = 0x3f800000; local_268 = (EntityPtr)((int)local_1d2 / 2); local_284 = (EntityPtr)0x0; do { uVar20 = local_1c4._0_4_; FUN_009f4230(local_50,local_1c4._0_4_,10,local_288,local_284,shotSpeed); fVar27 = atan2f(fStack_44,fStack_48); fVar27 = fVar27 * 57.295776; local_264.y = fVar27; if ((EntityPtr)uVar20 == local_268) { if (360.0 < ABS(fVar27)) { fVar27 = fmodf(fVar27,360.0); } local_1c4._0_4_ = uVar20; if (fVar27 <= 180.0) { if (fVar27 < -180.0) { fVar27 = fVar27 + 360.0; } heldClub->_rotationOffset = fVar27; } else { heldClub->_rotationOffset = fVar27 - 360.0; } } else { local_1c4._4_4_ = 0.0; tearBombVariant = 0.0; Color::Color(&tearColor); tearFlags._l = 0; tearFlags._h = 0; tearDamage = 3.5; tearScale = 1.0; tearHeight = -23.75; fStack_16c = 1.0; local_168 = 1.7; local_164 = 1.0; local_160 = 0.0; if ((EntityPtr)local_1ec.y != (EntityPtr)0x0) { Random(); pfVar15 = (float *)Entity_Player::GetTearHitParams(); local_1c4._4_4_ = *pfVar15; tearBombVariant = pfVar15[1]; if (&tearColor != (Color *)(pfVar15 + 2)) { tearColor._tint[0] = ((Color *)(pfVar15 + 2))->_tint[0]; tearColor._tint[1] = pfVar15[3]; tearColor._tint[2] = pfVar15[4]; tearColor._tint[3] = pfVar15[5]; tearColor._colorize[0] = pfVar15[6]; tearColor._colorize[1] = pfVar15[7]; tearColor._colorize[2] = pfVar15[8]; tearColor._colorize[3] = pfVar15[9]; tearColor._offset._0_8_ = *(undefined8 *)(pfVar15 + 10); tearColor._offset[2] = pfVar15[0xc]; } tearFlags._l = *(qword *)(pfVar15 + 0xe); tearFlags._h = *(qword *)(pfVar15 + 0x10); tearDamage = pfVar15[0x12]; tearScale = pfVar15[0x13]; tearHeight = pfVar15[0x14]; fStack_16c = pfVar15[0x15]; local_168 = pfVar15[0x16]; local_164 = pfVar15[0x17]; local_160 = pfVar15[0x18]; } local_220.y = local_280 * tearDamage; pEVar16 = (EntityPtr *)&local_220.y; if (local_280 * tearDamage <= (float)local_1d8) { pEVar16 = &local_1d8; } local_1d8 = *pEVar16; club = (Entity_Knife *)Weapon::fire_bone_club(); (**(code **)(*(int *)club + 0x3c))(); iVar12 = *(int *)club; *(undefined4 *)&(club->_tearFlags)._l = (undefined4)tearFlags._l; *(undefined4 *)((int)&(club->_tearFlags)._l + 4) = tearFlags._l._4_4_; *(undefined4 *)&(club->_tearFlags)._h = (undefined4)tearFlags._h; *(undefined4 *)((int)&(club->_tearFlags)._h + 4) = tearFlags._h._4_4_; (**(code **)(iVar12 + 0x40))(); (club->_sprite)._scale.x = (heldClub->_sprite)._scale.x; (club->_sprite)._scale.y = (heldClub->_sprite)._scale.y; *(short *)(club + 1) = SUB42(local_1e4.y,0); *(undefined2 *)&club[1].field_0x2 = 0; Entity_Knife::SetAttackAnimation(club); (**(code **)(*(int *)club + 0xc))(); } local_1c4._0_4_ = local_1c4._0_4_ + 1; } while ((int)local_1c4._0_4_ < (int)local_1d2); } for (local_1c4._0_4_ = (uint)local_208 & 0xffff; (EntityPtr)local_1c4._0_4_ != (EntityPtr)0x0; local_1c4._0_4_ = local_1c4._0_4_ - 1) { local_1c4._4_4_ = 0.0; tearBombVariant = 0.0; Color::Color(&tearColor); tearFlags._l = 0; tearFlags._h = 0; tearDamage = 3.5; tearScale = 1.0; tearHeight = -23.75; fStack_16c = 1.0; local_168 = 1.7; local_164 = 1.0; local_160 = 0.0; if ((EntityPtr)local_1ec.y != (EntityPtr)0x0) { Random(); pfVar15 = (float *)Entity_Player::GetTearHitParams(); local_1c4._4_4_ = *pfVar15; tearBombVariant = pfVar15[1]; if (&tearColor != (Color *)(pfVar15 + 2)) { tearColor._tint[0] = ((Color *)(pfVar15 + 2))->_tint[0]; tearColor._tint[1] = pfVar15[3]; tearColor._tint[2] = pfVar15[4]; tearColor._tint[3] = pfVar15[5]; tearColor._colorize[0] = pfVar15[6]; tearColor._colorize[1] = pfVar15[7]; tearColor._colorize[2] = pfVar15[8]; tearColor._colorize[3] = pfVar15[9]; tearColor._offset._0_8_ = *(undefined8 *)(pfVar15 + 10); tearColor._offset[2] = pfVar15[0xc]; } tearFlags._l = *(qword *)(pfVar15 + 0xe); tearFlags._h = *(qword *)(pfVar15 + 0x10); tearDamage = pfVar15[0x12]; tearScale = pfVar15[0x13]; tearHeight = pfVar15[0x14]; fStack_16c = pfVar15[0x15]; local_168 = pfVar15[0x16]; local_164 = pfVar15[0x17]; local_160 = pfVar15[0x18]; } local_268 = (EntityPtr)(local_280 * tearDamage); pEVar16 = &local_268; if (local_280 * tearDamage <= (float)local_1d8) { pEVar16 = &local_1d8; } local_1d8 = *pEVar16; Random(); club = (Entity_Knife *)Weapon::fire_bone_club(); (**(code **)(*(int *)club + 0x3c))(); iVar12 = *(int *)club; *(undefined4 *)&(club->_tearFlags)._l = (undefined4)tearFlags._l; *(undefined4 *)((int)&(club->_tearFlags)._l + 4) = tearFlags._l._4_4_; *(undefined4 *)&(club->_tearFlags)._h = (undefined4)tearFlags._h; *(undefined4 *)((int)&(club->_tearFlags)._h + 4) = tearFlags._h._4_4_; (**(code **)(iVar12 + 0x40))(); (club->_sprite)._scale.x = (heldClub->_sprite)._scale.x; (club->_sprite)._scale.y = (heldClub->_sprite)._scale.y; *(short *)(club + 1) = SUB42(local_1e4.y,0); *(undefined2 *)&club[1].field_0x2 = 0; Entity_Knife::SetAttackAnimation(club); (**(code **)(*(int *)club + 0xc))(); } uVar9 = Random(); pMVar6 = g_manager; local_1c4._0_4_ = (EntityPtr)0xfc; local_238.y = ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9) * local_238.y; seed_fart_sound_override((int *)local_1c4); SoundEffects::Play(&pMVar6->_sfxManager,local_1c4._0_4_,1.0,1,0,local_238.y,0.0); if ((20.0 < (float)local_1d8) && (1.5 < (float)clubScale)) { Game::ShakeScreen(g_game,(int)((float)clubScale * 5.0)); } if (isChargeMode == '\0') { EVar28 = (EntityPtr)0x3f800000; if (isReleased == '\0') goto LAB_009fde0f; if (*(float *)((int)this + 0x14) <= 1.0 && *(float *)((int)this + 0x14) != 1.0) { *(undefined4 *)((int)this + 0x14) = 0x3f800000; } } else { EVar28 = (EntityPtr)0x0; LAB_009fde0f: newCharge = EVar28; } *(undefined4 *)((int)this + 0x5c) = 0; *(float *)((int)this + 0x20) = g_vectorZero.x; *(float *)((int)this + 0x24) = g_vectorZero.y; if ((char)isCursedEye != '\0') { owner = *(void **)((int)this + 4); if (((owner == (Entity_Player *)0x0) || (this_00 = owner, owner->_type != 1)) && ((this_00 = (Entity_Player *)0x0, owner != (Entity_Player *)0x0 && (owner->_type == 3)))) { owner->_chargeBarSprites[5]._numEvents = 0; } else if (this_00 != (Entity_Player *)0x0) { Entity_Player::stop_costume_item_anims(this_00); } } owner = player; if (player != (Entity_Player *)0x0) { Entity_Player::TryForgottenThrow(player,&shotDirection); } if (local_27c[0] == '\0') { local_8 = 4.2039e-45; tracked_alloc(1,(void *)local_27c._4_4_,0); } local_8 = -NAN; iVar12 = (uint)local_1c6 << 8; pfVar15 = (float *)((int)this + 0x14); LAB_009fdeca: EVar28 = newCharge; if ((char)((uint)iVar12 >> 8) == '\0') goto LAB_009fb9ec; } EVar28 = newCharge; if (weaponType == 0xb) goto LAB_009fb9ec; if (((heldClub->_isSwinging != 0) && (isReleased == '\0')) || (*pfVar15 < 1.0)) { club = heldClub; goto LAB_009fb9f2; } Color::Reset(&clubFlashColor); pfVar15 = &local_258.y; clubFlashColor._tint[0] = 1.0; clubFlashColor._tint[1] = 1.0; clubFlashColor._tint[2] = 1.0; clubFlashColor._tint[3] = 0.0; local_238.y = 1.001; EVar28 = (EntityPtr)((float)newCharge + 1.0); pEVar16 = (EntityPtr *)&local_238.y; if (1.001 <= (float)maxCharge) { pEVar16 = (EntityPtr *)pfVar15; } newCharge = *pEVar16; if ((float)EVar28 <= (float)newCharge) { newCharge = EVar28; } if (owner == (Entity_Player *)0x0) goto LAB_009fe321; pfVar15 = (float *)CONCAT31((int3)((uint)pfVar15 >> 8),isEpicFetus); if ((isDrFetus != '\0') || (isEpicFetus != '\0')) { ppvVar26 = &owner->_heldEntity; local_1c4._0_4_ = ppvVar26; if (*ppvVar26 == (void *)0x0) { if (isChargeMode == '\0') { fVar27 = 1.0; } else { fVar27 = (float)maxCharge - 30.0; if (fVar27 <= 2.0) { fVar27 = 2.0; } } if (*(float *)((int)this + 0x14) == fVar27) { if (isEpicFetus == '\0') { local_27c._8_4_ = (player->_pos).x; local_270 = (player->_pos).y; pEVar17 = Weapon::fire_bomb(this,(Vector *)(local_27c + 8),&g_vectorZero); if (*(void **)local_1c4._0_4_ != (void *)0x0) { local_258.y = (float)local_1c4._0_4_; std::multiset::erase(); } *(Entity_Bomb **)local_1c4._0_4_ = pEVar17; if (pEVar17 != (Entity_Bomb *)0x0) { std::multiset::insert(); } qVar5 = pEVar17->_flags; puVar2 = (uint *)((int)&pEVar17->_flags + 4); *puVar2 = *puVar2 | 0x2000020; *(int *)&pEVar17->_flags = (int)qVar5; pEVar17->_explosionCountdown1 = 0x2d; *(undefined4 *)&pEVar17->field_0x414 = 0x2d; pEVar17->_entityCollisionClass = 0; pEVar17->_entityGridCollisionClass = 0; pEVar17->_visible = 0; fVar27 = atan2f(shotDirection.y,shotDirection.x); pEVar17->_rocketAngle = fVar27 * 57.295776; if ((pEVar17->_variant == 0x13) || (pEVar17->_variant == 0x14)) { ANM2::Play(&pEVar17->_sprite,s_Idle,0); (pEVar17->_sprite)._rotation = 0.0; } } else { uVar9 = Random(); local_27c._8_4_ = (player->_pos).x; local_270 = (player->_pos).y; local_1c4._0_4_ = Game::Spawn(g_game,1000,0x76,(Vector *)(local_27c + 8),&g_vectorZero, *(void **)((int)this + 4),0,uVar9); if (*ppvVar26 != (void *)0x0) { local_258.y = (float)ppvVar26; std::multiset::erase(); } *ppvVar26 = (void *)local_1c4._0_4_; if ((EntityPtr)local_1c4._0_4_ != (EntityPtr)0x0) { std::multiset::insert(); } *(uint *)(local_1c4._0_4_ + 0x16c) = *(uint *)(local_1c4._0_4_ + 0x16c) | 0x20; *(byte *)(local_1c4._0_4_ + 0x171) = 0; *(undefined4 *)(local_1c4._0_4_ + 0x168) = *(undefined4 *)(local_1c4._0_4_ + 0x168); } pMVar6 = g_manager; local_1c4._0_4_ = (EntityPtr)0xc9; seed_fart_sound_override((int *)local_1c4); SoundEffects::Play(&pMVar6->_sfxManager,local_1c4._0_4_,1.0,2,0,1.0,0.0); pfVar15 = extraout_ECX_06; } } owner = player; } pvVar22 = owner->_heldEntity; if (pvVar22 == (void *)0x0) goto LAB_009fe321; fVar27 = (owner->_pos).y; *(float *)((int)pvVar22 + 0x33c) = (owner->_pos).x; *(float *)((int)pvVar22 + 0x340) = fVar27; pvVar22 = owner->_heldEntity; fVar27 = (owner->_velocity).y; *(float *)((int)pvVar22 + 0x360) = (owner->_velocity).x; *(float *)((int)pvVar22 + 0x364) = fVar27; switch(owner->_headDirection) { case 0: fVar27 = (owner->_sprite)._scale.x * 8.0; break; case 1: fVar27 = (owner->_sprite)._scale.x * -12.0; goto LAB_009fe24e; case 2: fVar27 = (owner->_sprite)._scale.x * -8.0; LAB_009fe24e: fVar32 = (owner->_sprite)._scale.y; pvVar22 = owner->_heldEntity; *(float *)((int)pvVar22 + 0x34c) = fVar27; *(float *)((int)pvVar22 + 0x350) = fVar32 * -4.0; *(undefined4 *)((int)owner->_heldEntity + 0x354) = 0xffffffff; goto LAB_009fe2f0; default: fVar27 = (owner->_sprite)._scale.x * 12.0; } fVar32 = (owner->_sprite)._scale.y; pvVar22 = owner->_heldEntity; *(float *)((int)pvVar22 + 0x34c) = fVar27; *(float *)((int)pvVar22 + 0x350) = fVar32 * -4.0; *(undefined4 *)((int)owner->_heldEntity + 0x354) = 0; LAB_009fe2f0: pvVar22 = owner->_heldEntity; if (*(int *)((int)pvVar22 + 0x28) == 4) { fVar27 = atan2f(shotDirection.y,shotDirection.x); *(float *)((int)pvVar22 + 0x428) = fVar27 * 57.295776; pfVar15 = extraout_ECX_07; } LAB_009fe321: club = heldClub; if ((char)isCursedEye == '\0') { if (isChocolateMilk != 0) goto LAB_009fe472; if ((char)isBrimstone != '\0') goto LAB_009fe5d9; if ((float)maxCharge <= *(float *)((int)this + 0x14)) { clubFlashColor._tint[3] = 1.0; clubFlashColor._offset[0] = 0.2; clubFlashColor._offset[1] = 0.2; clubFlashColor._offset[2] = 0.2; Color::__mul(&clubFlashColor,&heldClub->_color); pfVar15 = extraout_ECX_08; } } else { if ((float)maxCharge < *(float *)((int)this + 0x14) || (float)maxCharge == *(float *)((int)this + 0x14)) { Weapon::UpdateHeadChargeAnimation(this,0x13c,1,&shotDirection,-1.0); club = heldClub; clubFlashColor._tint[3] = 1.0; clubFlashColor._offset[0] = 0.2; clubFlashColor._offset[1] = 0.2; clubFlashColor._offset[2] = 0.2; Color::__mul(&clubFlashColor,&heldClub->_color); iVar12 = extraout_ECX_10; } else { Weapon::UpdateHeadChargeAnimation(this,0x13c,0,&shotDirection,0.0); iVar12 = extraout_ECX_09; club = heldClub; } Weapon::SetBlinkTime(this,1,iVar12); iVar12 = (int)(((float)newCharge * 5.0) / (float)maxCharge); *(int *)((int)this + 0x5c) = iVar12; if ((1.0 < (float)newCharge) && (iVar12 == 0)) { *(undefined4 *)((int)this + 0x5c) = 1; } pfVar15 = extraout_ECX_11; if (isChocolateMilk != 0) { LAB_009fe472: fVar27 = *(float *)((int)this + 0x14); if ((float)maxCharge <= fVar27) { puVar30 = &DAT_bf800000; } else { puVar30 = (undefined1 *)((fVar27 / (float)maxCharge) * 18.0); } Weapon::UpdateHeadChargeAnimation (this,0x45,(uint)((float)maxCharge <= fVar27),&shotDirection,(float)puVar30); Weapon::SetBlinkTime(this,1,unused_01); fVar32 = ((float)newCharge / (float)local_224 - 1.0) * 0.5 + 1.0; fVar27 = 1.0; if (1.0 <= fVar32) { fVar27 = fVar32; } fVar27 = fVar27 * (float)clubScale; fVar32 = fVar27; if ((heldClub->_isSwinging != 0) && (fVar32 = (heldClub->_sprite)._scale.x, fVar32 <= fVar27)) { fVar32 = fVar27; } iVar12 = *(int *)((int)this + 0x44); if (iVar12 != 0) { fVar27 = fVar32 * g_vectorOne.y; *(float *)(iVar12 + 0xe4) = fVar32 * g_vectorOne.x; *(float *)(iVar12 + 0xe8) = fVar27; } iVar12 = *(int *)((int)this + 0x48); if (iVar12 != 0) { fVar27 = fVar32 * g_vectorOne.y; *(float *)(iVar12 + 0xe4) = fVar32 * g_vectorOne.x; *(float *)(iVar12 + 0xe8) = fVar27; } iVar12 = *(int *)((int)this + 0x4c); if (iVar12 != 0) { fVar27 = fVar32 * g_vectorOne.y; *(float *)(iVar12 + 0xe4) = fVar32 * g_vectorOne.x; *(float *)(iVar12 + 0xe8) = fVar27; } iVar12 = *(int *)((int)this + 0x50); pfVar15 = extraout_ECX_12; club = heldClub; if (iVar12 != 0) { fVar27 = fVar32 * g_vectorOne.y; *(float *)(iVar12 + 0xe4) = fVar32 * g_vectorOne.x; *(float *)(iVar12 + 0xe8) = fVar27; } } if ((char)isBrimstone != '\0') { LAB_009fe5d9: if ((float)local_228 <= *(float *)((int)this + 0x14)) { Weapon::UpdateHeadChargeAnimation(this,0x76,1,&shotDirection,-1.0); fVar27 = local_1ec.y; Color::Reset(&chargeColor); chargeColor._tint[0] = 1.0; chargeColor._tint[1] = 0.0; chargeColor._tint[2] = 0.0; chargeColor._tint[3] = 1.0; if ((EntityPtr)fVar27 != (EntityPtr)0x0) { local_2f8._tint[0] = *(float *)((int)fVar27 + 0x14c4); local_2f8._tint[1] = *(float *)((int)fVar27 + 0x14c8); local_2f8._tint[2] = *(float *)((int)fVar27 + 0x14cc); local_2f8._tint[3] = *(float *)((int)fVar27 + 0x14d0); local_2f8._offset[2] = *(float *)((int)fVar27 + 0x14ec); local_2f8._colorize[0] = (float)((AnimationState *)((int)fVar27 + 0x14d4))->_animation; local_2f8._colorize[1] = *(float *)((int)fVar27 + 0x14d8); local_2f8._colorize[2] = *(float *)((int)fVar27 + 0x14dc); local_2f8._colorize[3] = *(float *)((int)fVar27 + 0x14e0); local_2f8._offset._0_8_ = *(undefined8 *)((int)fVar27 + 0x14e4); Color::__mul(&local_2f8,(ColorMod *)&chargeColor); chargeColor._offset[2] = local_2f8._offset[2]; chargeColor._tint[0] = local_2f8._tint[0]; chargeColor._tint[1] = local_2f8._tint[1]; chargeColor._tint[2] = local_2f8._tint[2]; chargeColor._tint[3] = local_2f8._tint[3]; chargeColor._colorize[0] = local_2f8._colorize[0]; chargeColor._colorize[1] = local_2f8._colorize[1]; chargeColor._colorize[2] = local_2f8._colorize[2]; chargeColor._colorize[3] = local_2f8._colorize[3]; chargeColor._offset[0] = local_2f8._offset[0]; chargeColor._offset[1] = local_2f8._offset[1]; } club = heldClub; clubFlashColor._tint[0] = chargeColor._tint[0]; clubFlashColor._tint[1] = chargeColor._tint[1]; clubFlashColor._tint[2] = chargeColor._tint[2]; clubFlashColor._tint[3] = chargeColor._tint[3]; clubFlashColor._colorize[0] = chargeColor._colorize[0]; clubFlashColor._colorize[1] = chargeColor._colorize[1]; clubFlashColor._colorize[2] = chargeColor._colorize[2]; clubFlashColor._colorize[3] = chargeColor._colorize[3]; clubFlashColor._offset[0] = chargeColor._offset[0]; clubFlashColor._offset[1] = chargeColor._offset[1]; clubFlashColor._offset[2] = chargeColor._offset[2]; iVar12 = Entity::GetIntervalTicks((Entity *)heldClub,2.0,0.0); unused_02 = extraout_ECX_14; if (iVar12 != 0) { unused_02 = extraout_ECX_14; if ((club->_sprite)._animState._animData != (void *)0x0) { pfVar15 = AnimationState::GetNullFrameById(&(club->_sprite)._animState,0); unused_02 = extraout_ECX_15; if (pfVar15 != (float *)0x0) { local_238.y = *pfVar15 / 0.65; local_1e4.y = pfVar15[1] / 0.65; local_258.y = (club->_sprite)._rotation * 0.017453292; local_268 = (EntityPtr)cos(local_258.y); fVar27 = sin(local_258.y); local_1c4._0_4_ = (local_238.y * (float)local_268 - local_1e4.y * fVar27) * 1.2; local_1e4.y = (local_1e4.y * (float)local_268 + local_238.y * fVar27) * 1.2; local_258.y = cos(1.5707964); fVar27 = sin(1.5707964); local_200 = (EntityPtr)(local_258.y * (float)local_1c4._0_4_ - local_1e4.y * fVar27); local_1ec.x = (float)local_1c4._0_4_ * fVar27 + local_258.y * local_1e4.y; fVar27 = sqrtf((float)local_200 * (float)local_200 + local_1ec.x * local_1ec.x); if (0.0 < fVar27) { local_200 = (EntityPtr)((float)local_200 * (1.0 / fVar27)); local_1ec.x = local_1ec.x * (1.0 / fVar27); } local_238.y = (club->_sprite)._scale.y; uVar9 = Random(); local_258.y = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; local_268 = (EntityPtr)(club->_pos).x; local_220.y = (club->_pos).y; uVar9 = Random(); fVar27 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10; local_264.x = fVar27 * (float)local_200 * local_258.y * local_238.y * 10.0 + local_258.y * (float)local_1c4._0_4_ + (float)local_268; local_264.y = fVar27 * local_1ec.x * local_258.y * local_238.y * 10.0 + local_258.y * local_1e4.y + local_220.y; local_238.y = (float)Random(); pvVar22 = *(void **)((int)this + 4); pfVar15 = &local_26c; if (pvVar22 == (void *)0x0) { local_27c._8_4_ = g_vectorZero.x; local_270 = g_vectorZero.y; pfVar15 = (float *)(local_27c + 8); } else { local_26c = *(float *)((int)pvVar22 + 0x360); local_268 = *(EntityPtr *)((int)pvVar22 + 0x364); } uVar9 = Random(); fVar27 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1c4._0_4_ = fVar27 + fVar27; uVar9 = Random(); local_200 = (EntityPtr) ((float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10); fVar27 = cos((float)local_1c4._0_4_); local_258.y = fVar27 * (float)local_200; fVar27 = sin((float)local_1c4._0_4_); local_258.x = local_258.y + local_258.y + *pfVar15 * 0.2 + 0.0; local_258.y = (fVar27 * (float)local_200 + fVar27 * (float)local_200 + pfVar15[1] * 0.2) - 1.0; club = Game::Spawn(g_game,1000,0x6f,&local_264,&local_258,(Entity *)0x0,0, (uint)local_238.y); if ((EntityPtr)local_1ec.y != (EntityPtr)0x0) { chargeColor._tint[0] = *(float *)((int)local_1ec.y + 0x14c4); chargeColor._tint[1] = *(float *)((int)local_1ec.y + 0x14c8); chargeColor._tint[2] = *(float *)((int)local_1ec.y + 0x14cc); chargeColor._tint[3] = *(float *)((int)local_1ec.y + 0x14d0); chargeColor._colorize[0] = (float)((AnimationState *)((int)local_1ec.y + 0x14d4))->_animation; chargeColor._colorize[1] = *(float *)((int)local_1ec.y + 0x14d8); chargeColor._colorize[2] = *(float *)((int)local_1ec.y + 0x14dc); chargeColor._colorize[3] = *(float *)((int)local_1ec.y + 0x14e0); chargeColor._offset._0_8_ = *(undefined8 *)((int)local_1ec.y + 0x14e4); chargeColor._offset[2] = *(float *)((int)local_1ec.y + 0x14ec); (**(code **)(*(int *)club + 0x3c))(); } uVar9 = Random(); fVar32 = (float)((double)(int)uVar9 + __uint_to_double_fixup[-((int)uVar9 >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.3; fVar27 = (heldClub->_sprite)._scale.x; (club->_sprite)._scale.y = fVar32 * (heldClub->_sprite)._scale.y; (club->_sprite)._scale.x = fVar32 * fVar27; (club->_posOffset).x = (heldClub->_posOffset).x; (club->_posOffset).y = (heldClub->_posOffset).y; club->_renderDepthOffset = -100.0; unused_02 = heldClub; club = heldClub; } } } } else { Weapon::UpdateHeadChargeAnimation (this,0x76,0,&shotDirection, (*(float *)((int)this + 0x14) / (float)local_228) * 18.0); unused_02 = extraout_ECX_13; } Weapon::SetBlinkTime(this,1,(int)unused_02); pfVar15 = extraout_ECX_16; } } if (local_250._0_1_ != '\0') { if ((float)local_228 <= *(float *)((int)this + 0x14)) { Weapon::UpdateHeadChargeAnimation(this,0xe5,1,&shotDirection,-1.0); clubFlashColor._tint[0] = 1.0; clubFlashColor._tint[1] = 1.0; clubFlashColor._tint[2] = 1.0; clubFlashColor._tint[3] = 1.0; clubFlashColor._offset[0] = 0.2; clubFlashColor._offset[1] = 0.2; clubFlashColor._offset[2] = 0.2; Color::__mul(&clubFlashColor,&club->_color); iVar12 = extraout_ECX_18; } else { Weapon::UpdateHeadChargeAnimation (this,0xe5,0,&shotDirection,(*(float *)((int)this + 0x14) / (float)local_228) * 18.0 ); iVar12 = extraout_ECX_17; } Weapon::SetBlinkTime(this,1,iVar12); pfVar15 = extraout_ECX_19; } if (local_248.y._0_1_ != '\0') { local_258.y = *(float *)((int)this + 0x14); if ((float)local_228 <= local_258.y) { puVar30 = &DAT_bf800000; iVar12 = 1; LAB_009fece6: Weapon::update_c_section_charge_anim(this,(int)pfVar15,iVar12,aimDirection,(float)puVar30); pfVar15 = extraout_ECX_21; } else { bVar7 = Weapon::is_c_section_anim_finished(this,(int)pfVar15); pfVar15 = extraout_ECX_20; if (bVar7 != 0) { puVar30 = (undefined1 *)((local_258.y / (float)local_228) * 18.0); iVar12 = 0; goto LAB_009fece6; } } Weapon::SetBlinkTime(this,1,(int)pfVar15); } iVar12 = Entity::GetIntervalTicks((Entity *)club,4.0,0.0); if ((iVar12 != 0) && (0.0 < clubFlashColor._tint[3])) { (**(code **)(*(int *)club + 0x3c))(); } pVVar11 = Weapon::get_aim_direction(this,(Vector *)(local_27c + 8),&shotDirection); *(float *)((int)this + 0x20) = pVVar11->x; *(float *)((int)this + 0x24) = pVVar11->y; EVar28 = newCharge; LAB_009fb9f2: if (club->_isFlying != 0) { Weapon::SetHeadLockTime(this,2); } *(EntityPtr *)((int)this + 0x14) = EVar28; ExceptionList = local_10; return; } //@@ 009fed90 Weapon_Bone::Reset /* DB: vftable */ void Weapon_Bone::Reset(void) { int *in_ECX; (**(code **)(*in_ECX + 0x14))(); in_ECX[7] = 0; in_ECX[3] = 0; in_ECX[4] = 0x41200000; in_ECX[5] = 0; in_ECX[6] = 0x3f800000; in_ECX[0xe] = 0; in_ECX[8] = (int)g_vectorZero.x; in_ECX[9] = (int)g_vectorZero.y; in_ECX[0x17] = 0; return; } //@@ 009fedf0 Weapon_Bone::ClearReferences /* DB: vftable */ void Weapon_Bone::ClearReferences(void) { int *in_ECX; int *piVar1; int iVar2; int *local_8; piVar1 = in_ECX + 2; local_8 = in_ECX; if ((int *)in_ECX[2] != (int *)0x0) { (**(code **)(*(int *)in_ECX[2] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } piVar1 = in_ECX + 0x11; iVar2 = 4; do { if ((int *)*piVar1 != (int *)0x0) { (**(code **)(*(int *)*piVar1 + 0x28))(); (**(code **)(*(int *)*piVar1 + 0x44))(); } piVar1 = piVar1 + 1; iVar2 = iVar2 + -1; } while (iVar2 != 0); piVar1 = in_ECX + 0x16; if ((int *)in_ECX[0x16] != (int *)0x0) { (**(code **)(*(int *)in_ECX[0x16] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } piVar1 = in_ECX + 0x15; if ((int *)in_ECX[0x15] != (int *)0x0) { (**(code **)(*(int *)in_ECX[0x15] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } return; } //@@ 009feeb0 Weapon_Bone::GetMaxCharge /* DB: vftable */ float10 Weapon_Bone::GetMaxCharge(void) { int in_ECX; float fVar1; if (((*(uint *)(in_ECX + 0x34) & 0x80e) == 0) || ((*(uint *)(in_ECX + 0x34) & 1) != 0)) { fVar1 = *(float *)(in_ECX + 0x10); if (fVar1 < 0.001) { fVar1 = 0.001; } return (float10)fVar1 * (float10)3.0; } fVar1 = *(float *)(in_ECX + 0x10); if (fVar1 < 0.001) { fVar1 = 0.001; } return (float10)fVar1 + (float10)fVar1; } //@@ 009fef20 Weapon_Bone::TriggerNewRoom /* DB: vtable slot 11 of Weapon_Bone; slot name from Weapon */ void Weapon_Bone::TriggerNewRoom(void) { byte bVar1; byte *pbVar2; uint uVar3; int in_ECX; byte *pbVar4; byte *idleName; int *knifeSlot; bool isLess; int *eraseKey; int slotsLeft; int knife; int *targetRef; knifeSlot = (int *)(in_ECX + 0x44); slotsLeft = 4; do { knife = *knifeSlot; if (knife != 0) { targetRef = (int *)(knife + 0x3c4); *(float *)(knife + 0x334) = g_vectorZero.x; *(float *)(knife + 0x338) = g_vectorZero.y; if (*targetRef != 0) { eraseKey = targetRef; std::multiset::erase(&eraseKey); } *targetRef = 0; *(undefined4 *)(knife + 0x444) = 0; *(undefined1 *)(knife + 0x464) = 0; *(undefined4 *)(knife + 0x448) = 0; *(undefined2 *)(knife + 0x4e5) = 0; switch(*(int *)(knife + 0x2c)) { case 2: case 3: case 4: case 8: case 9: code_r0x009fefcb: if ((*(int *)(knife + 0x7c) != 0) && (*(char *)(knife + 0x8c) != '\0')) { pbVar2 = *(byte **)(knife + 0x7c); if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar2 = *(byte **)pbVar2; } pbVar4 = &DAT_00b602e8; do { bVar1 = *pbVar2; isLess = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_009ff012: uVar3 = -(uint)isLess | 1; goto LAB_009ff017; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; isLess = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_009ff012; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009ff017: if (uVar3 == 0) { pbVar2 = *(byte **)(knife + 0x7c); if (pbVar2 != (byte *)0x0) { pbVar4 = pbVar2; if (0xf < *(uint *)(pbVar2 + 0x14)) { pbVar4 = *(byte **)pbVar2; } idleName = s_Idle; do { bVar1 = *pbVar4; isLess = bVar1 < *idleName; if (bVar1 != *idleName) { LAB_009ff054: uVar3 = -(uint)isLess | 1; goto LAB_009ff059; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; isLess = bVar1 < idleName[1]; if (bVar1 != idleName[1]) goto LAB_009ff054; pbVar4 = pbVar4 + 2; idleName = idleName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009ff059: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || (*(char *)(knife + 0x8c) != '\0')))) break; } bVar1 = ANM2::SetAnimation((ANM2 *)(knife + 0x48),s_Idle,1); if (bVar1 != 0) { AnimationState::Rewind((AnimationState *)(knife + 0x78)); *(undefined1 *)(knife + 0x8c) = 1; } } } break; case 5: case 0xb: break; default: if (*(int *)(knife + 0x2c) == 1) goto code_r0x009fefcb; } } knifeSlot = knifeSlot + 1; slotsLeft = slotsLeft + -1; if (slotsLeft == 0) { return; } } while( true ); } //@@ 009ff0c0 Weapon_Bone::init_club /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (club): weapon type (+0x30) 0xb -> only vfunc +0x40(7.0); else color (FUN_009f3db0) via vfunc +0x3c, Weapon::get_owner_tear_flags -> +0x410..+0x41c, Weapon::get_damage via vfunc +0x40, +0x37c = 0.5 or 3.0 by modifier bit 7; Weapon_Bone::Fire on each club in this+0x44.. */ void Weapon_Bone::init_club(int *param_1) { code *pcVar1; int iVar2; qword qVar3; undefined4 uVar4; BitSet128 *pBVar5; Weapon *in_ECX; float fVar6; int iVar7; int iVar8; Weapon *this; undefined1 *local_5c; undefined1 local_50 [4]; int local_4c; undefined1 local_38 [44]; uint local_c; local_c = __security_cookie ^ (uint)local_50; local_4c = *param_1; if (*(int *)&in_ECX->field_0x30 == 0xb) { local_5c = (undefined1 *)0x40e00000; (**(code **)(local_4c + 0x40))(); return; } local_5c = local_38; uVar4 = Weapon::get_tear_color(); local_5c = (undefined1 *)0x1; this = (Weapon *)0xff; iVar8 = -1; (**(code **)(local_4c + 0x3c))(uVar4,0xffffffff,0xff,0); pBVar5 = Weapon::get_owner_tear_flags(in_ECX,(BitSet128 *)&local_5c); iVar7 = *(int *)((int)&pBVar5->_l + 4); qVar3 = pBVar5->_h; iVar2 = *(int *)((int)&pBVar5->_h + 4); param_1[0x104] = (int)pBVar5->_l; param_1[0x105] = iVar7; param_1[0x106] = (int)qVar3; param_1[0x107] = iVar2; pcVar1 = *(code **)(*param_1 + 0x40); fVar6 = Weapon::get_damage(this); (*pcVar1)(fVar6); if ((*(uint *)(iVar8 + 0x34) >> 7 & 1) == 0) { iVar7 = 0x40400000; } else { iVar7 = 0x3f000000; } param_1[0xdf] = iVar7; return; } //@@ 009ff1a0 Weapon_Bone::CanTriggerCursedEyeTeleport /* DB: vtable slot 14 of Weapon_Bone; slot name from Weapon */ undefined4 Weapon_Bone::CanTriggerCursedEyeTeleport(void) { int iVar1; int *in_ECX; float fVar2; if (((in_ECX[0xc] != 0xb) && (iVar1 = in_ECX[1], iVar1 != 0)) && (*(int *)(iVar1 + 0x28) == 1)) { if ((*(int *)(iVar1 + 0x140c) != 0) && (iVar1 = (**(code **)(*in_ECX + 0x30))(), iVar1 != 0)) { return 0; } if (0.0 < (float)in_ECX[5]) { fVar2 = (float)in_ECX[4]; if (fVar2 < 0.001) { fVar2 = 0.001; } if ((float)in_ECX[5] < fVar2 + fVar2) { return 1; } } } return 0; } //@@ 009ff210 Weapon_Bone::CanTriggerKidneyStone /* DB: vtable slot 15 of Weapon_Bone; slot name from Weapon */ uint Weapon_Bone::CanTriggerKidneyStone(void) { uint in_EAX; int in_ECX; if ((*(int *)(in_ECX + 0x30) == 0xb) || ((in_EAX = *(uint *)(in_ECX + 0x44), in_EAX != 0 && (*(char *)(in_EAX + 0x464) != '\0')))) { return in_EAX & 0xffffff00; } return CONCAT31((int3)(in_EAX >> 8),1); } //@@ 009ff230 Weapon_Bone::CanOverrideForgottenThrow /* DB: vtable slot 16 of Weapon_Bone; slot name from Weapon */ uint Weapon_Bone::CanOverrideForgottenThrow(void) { byte bVar1; uint uVar2; bool bVar3; byte bVar4; undefined3 extraout_var; uint uVar5; int in_ECX; Entity_Player *this; Entity_Player *pEVar6; pEVar6 = *(Entity_Player **)(in_ECX + 4); uVar5 = *(uint *)(in_ECX + 0x30); if (pEVar6 == (Entity_Player *)0x0) { LAB_009ff265: this = (Entity_Player *)0x0; if ((pEVar6 == (Entity_Player *)0x0) || (pEVar6->_type != 1)) { LAB_009ff273: pEVar6 = (Entity_Player *)0x0; } } else { if (pEVar6->_type != 1) { if (pEVar6->_type != 3) goto LAB_009ff265; this = *(Entity_Player **)&pEVar6->_isControlsEnabled; goto LAB_009ff273; } this = pEVar6; } bVar1 = *(byte *)(in_ECX + 0x34); uVar2 = *(uint *)(in_ECX + 0x34); if ((((uVar5 == 0xb) || (this == (Entity_Player *)0x0)) || (bVar4 = Entity_Player::HasCollectible(this,0x34,0), bVar4 == 0)) || (bVar4 = Entity_Player::HasCollectible(this,0xa8,0), bVar4 != 0)) { bVar3 = false; if ((uVar5 != 0xb) && (this != (Entity_Player *)0x0)) goto LAB_009ff2f1; } else { bVar3 = true; LAB_009ff2f1: bVar4 = Entity_Player::HasCollectible(this,0xa8,0); uVar5 = CONCAT31(extraout_var,bVar4); if (bVar4 != 0) { uVar5 = CONCAT31(extraout_var,1); goto LAB_009ff309; } } uVar5 = uVar5 & 0xffffff00; LAB_009ff309: if (((((bVar1 & 1) == 0) && ((uVar2 >> 1 & 1) == 0)) && (((uVar2 >> 2 & 1) == 0 && ((uVar2 >> 3 & 1) == 0)))) && (((((!bVar3 && ((char)uVar5 == '\0')) || (pEVar6 == (Entity_Player *)0x0)) || (pEVar6->_heldEntity == (void *)0x0)) && ((uVar5 = *(uint *)(in_ECX + 0x44), uVar5 == 0 || (*(char *)(uVar5 + 0x466) == '\0')))))) { return uVar5 & 0xffffff00; } return CONCAT31((int3)(uVar5 >> 8),1); } //@@ 009ff360 Weapon_Brimstone::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* ZHL [exact] void Fire(const Vector& shootPos, bool IsShooting, bool IsInterpolated); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_Brimstone::Fire(Weapon_Brimstone *this,Vector *direction,byte isShooting,byte isInterpolated) { byte bVar1; char cVar2; undefined3 extraout_var; EntityPtr *pEVar3; undefined2 uVar8; Vector *pVVar4; uint uVar5; std_string *str; Vector *aimDirection; void *pvVar6; undefined4 uVar7; Entity_Laser *laser; EntityPtr *extraout_EAX; undefined1 *extraout_ECX; EntityPtr EVar9; undefined4 extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int unused; int unusedCollectibleId; int unusedCollectibleId_00; int extraout_ECX_03; int extraout_ECX_04; int unusedCollectibleId_01; void *pvVar10; void *extraout_ECX_05; void *extraout_ECX_06; int unusedCollectibleId_02; int unused_00; int unusedCollectibleId_03; Entity_Player *ownerPlayer; undefined1 *extraout_ECX_07; undefined1 *puVar11; int iVar12; int iVar13; uint uVar14; ANM2 *sprite; bool bVar15; float10 fVar16; EntityPtr EVar17; EntityPtr EVar18; float fVar19; EntityPtr EVar20; float fVar21; undefined4 uVar22; undefined4 local_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined4 local_c8; undefined4 uStack_c4; undefined4 uStack_c0; undefined4 uStack_bc; uint local_b8; float local_b4; float local_b0; Vector local_ac; Vector local_a4; float local_9c; EntityPtr local_98; uint isCSection; Vector local_90; char isHasMarked; float local_84; EntityPtr local_80; char isHasBrimstone; uint local_78; Vector *shootDirection; uint local_70; EntityPtr local_6c; byte isChocolateMilk; char local_65; EntityPtr local_64; Vector local_60; Vector local_58; byte local_4e; char local_4d; EntityPtr local_4c; char local_46; char isFullyCharged; char animSuffix [8]; undefined1 local_3c [12]; EntityPtr local_30; std_string local_2c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Player *owner; local_8 = 0xffffffff; puStack_c = &LAB_00b1072e; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)((int)&local_2c + 0x28U); ExceptionList = &local_10; shootDirection = direction; local_70 = 0; local_58.y = 0.0; Weapon::Fire((Weapon *)this,direction,isShooting,isInterpolated); uVar14 = this->_modifiers; local_b0 = 1.0; local_90.y = 1.0; local_78 = uVar14 >> 4 & 0xffffff01; local_a4.y = (float)(uVar14 >> 5 & 0xffffff01); local_98 = (EntityPtr)(uVar14 >> 9 & 0xffffff01); EVar18 = (EntityPtr)this->_owner; isCSection = uVar14 >> 0xb & 0xffffff01; if (EVar18 == (EntityPtr)0x0) { local_80 = (EntityPtr)g_vectorZero.x; local_4c = (EntityPtr)g_vectorZero.y; LAB_009ff4b6: EVar17 = (EntityPtr)0x0; local_64 = EVar18; if (EVar18 == (EntityPtr)0x0) { LAB_009ff44f: local_6c = EVar17; } else { local_6c = (EntityPtr)0x0; if (*(int *)((int)EVar18 + 0x28) == 1) { local_b0 = *(float *)((int)EVar18 + 0x1464); goto LAB_009ff4eb; } } EVar17 = local_6c; if (EVar18 != (EntityPtr)0x0) { local_64 = (EntityPtr)0x0; if (*(int *)((int)EVar18 + 0x28) == 1) { LAB_009ff48a: local_64 = (EntityPtr)0x0; local_b0 = *(float *)((int)EVar18 + 0x1464); local_6c = EVar17; goto LAB_009ff4eb; } local_6c = EVar17; if (*(int *)((int)EVar18 + 0x28) == 3) { EVar18 = *(EntityPtr *)((int)EVar18 + 0x410); local_64 = (EntityPtr)0x0; if (EVar18 != (EntityPtr)0x0) goto LAB_009ff48a; } } local_64 = (EntityPtr)0x0; } else { local_80 = *(EntityPtr *)((int)EVar18 + 0x33c); local_4c = *(EntityPtr *)((int)EVar18 + 0x340); if (*(int *)((int)EVar18 + 0x28) != 1) { if (*(int *)((int)EVar18 + 0x28) != 3) goto LAB_009ff4b6; EVar17 = *(EntityPtr *)((int)EVar18 + 0x410); goto LAB_009ff44f; } local_b0 = *(float *)((int)EVar18 + 0x1464); local_6c = EVar18; local_64 = EVar18; EVar17 = EVar18; } LAB_009ff4eb: puVar11 = &this->field_0x10; local_ac.y = 0.001; pEVar3 = (EntityPtr *)&local_ac.y; if (0.001 < *(float *)puVar11 || *(float *)puVar11 == 0.001) { pEVar3 = (EntityPtr *)puVar11; } local_ac.y = (float)*pEVar3; local_58.y = (float)*pEVar3; if (EVar17 == (EntityPtr)0x0) { LAB_009ff534: isHasBrimstone = '\0'; } else { bVar1 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x76,0); pEVar3 = (EntityPtr *)CONCAT31(extraout_var,bVar1); isHasBrimstone = '\x01'; puVar11 = extraout_ECX; if (bVar1 == 0) goto LAB_009ff534; } EVar18 = local_6c; if ((char)local_78 == '\0') { isChocolateMilk = (byte)this->_modifiers & 1; if ((((uint)this->_modifiers >> 7 & 1) != 0) || (*(float *)&this->field_0x10 <= 1.0)) { local_4e = 1; local_46 = '\x01'; if (local_a4.y._0_1_ != '\0') goto LAB_009ff579; } else { local_4e = 0; LAB_009ff579: local_46 = '\0'; } if ((EVar17 == (EntityPtr)0x0) || ((bVar1 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x18a,0), bVar1 == 0 && (bVar1 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x23c,0), bVar1 == 0)))) { local_4d = '\0'; if (EVar17 != (EntityPtr)0x0) goto LAB_009ff5b3; LAB_009ff5cc: isHasMarked = '\0'; } else { local_4d = '\x01'; LAB_009ff5b3: bVar1 = Entity_Player::HasCollectible((Entity_Player *)EVar17,0x18a,0); isHasMarked = '\x01'; if (bVar1 == 0) goto LAB_009ff5cc; } pvVar10 = this->_owner; if ((pvVar10 == (void *)0x0) || ((*(int *)((int)pvVar10 + 0x28) != 1 && ((*(int *)((int)pvVar10 + 0x28) != 3 || (pvVar10 = *(void **)((int)pvVar10 + 0x410), pvVar10 == (void *)0x0)))))) { iVar13 = 0; } else { iVar13 = *(int *)((int)pvVar10 + 0x140c); } if ((local_4d == '\0') || (iVar13 == 0)) { EVar18 = *(EntityPtr *)&this->field_0x28; EVar9 = *(EntityPtr *)&this->field_0x2c; } else { EVar18 = *(EntityPtr *)(iVar13 + 0x33c); EVar9 = *(EntityPtr *)(iVar13 + 0x340); } local_60.x = (float)EVar18; local_60.y = (float)EVar9; uVar8 = (undefined2)((uint)&local_60 >> 0x10); bVar1 = (byte)&local_60; uVar7 = CONCAT22(uVar8,(ushort)bVar1); if (((float)EVar18 == g_vectorZero.x) && (uVar7 = CONCAT22(uVar8,(ushort)bVar1), (float)EVar9 == g_vectorZero.y)) { pvVar10 = (void *)((uint)EVar9._1_3_ << 8); } else { pvVar10 = (void *)CONCAT31(EVar9._1_3_,1); } local_4c._2_2_ = (undefined2)((uint)uVar7 >> 0x10); local_4c._0_1_ = (byte)uVar7; local_4c._1_1_ = 0; local_78 = CONCAT31(local_4c._1_3_,isShooting); isFullyCharged = '\0'; local_65 = (char)pvVar10; EVar20 = local_4c; if (local_4e != 0) { if (local_ac.y <= *(float *)&this->field_0x14) { LAB_009ff696: EVar20 = (EntityPtr)0x100; isFullyCharged = '\x01'; } else if ((isShooting != 0) && (local_46 != '\0')) { if ((this->_mainLaser != (EntityPtr)0x0) && (4 < *(int *)((int)this->_mainLaser + 0x458))) goto LAB_009ff696; EVar20 = (EntityPtr)0x0; } } local_80 = *(EntityPtr *)&this->field_0xc; if (((float)*(EntityPtr *)&this->field_0xc < 0.0) || (local_4d = '\0', 0.0 < *(float *)&this->field_0x14)) { local_4d = '\x01'; } cVar2 = EVar20._1_1_; if (EVar20._1_1_ == '\0') { if (((isInterpolated == 0) && (isShooting != 0)) && ((char)pvVar10 != '\0')) { EVar20 = (EntityPtr)local_ac.y; if (isChocolateMilk != 0) { pVVar4 = Weapon::get_owner_position((Weapon *)this,(Vector *)(local_3c + 8)); fVar19 = (float)EVar9 - pVVar4->y; fVar21 = (float)EVar18 - pVVar4->x; fVar19 = sqrtf(fVar19 * fVar19 + fVar21 * fVar21); pvVar10 = (void *)CONCAT31((int3)((uint)extraout_ECX_00 >> 8),local_65); fVar19 = (fVar19 - 50.0) / 250.0; if (fVar19 <= 0.0) { fVar19 = 0.0; } if (1.0 <= fVar19) { fVar19 = 1.0; } EVar20 = (EntityPtr)((local_ac.y * 2.5 - local_ac.y * 0.25) * fVar19 + local_ac.y * 0.25); } local_4c = (EntityPtr)0x0; local_78 = local_78 & 0xff; if ((float)EVar20 <= *(float *)&this->field_0x14) { local_78 = 0; } } if ((((this->_mainLaser != (EntityPtr)0x0) && (iVar13 = *(int *)((int)this->_mainLaser + 0x3bc), iVar13 != 0)) && (*(int *)(iVar13 + 0x28) != 1000)) && (((EVar17 == (EntityPtr)0x0 || ((char)pvVar10 != '\0')) || (*(int *)((int)EVar17 + 0x1e68) != 0)))) { local_78 = local_78 & 0xffffff00; } cVar2 = isFullyCharged; } if (local_98._0_1_ == '\0') { if ((char)local_78 != '\0') { LAB_009ffb5c: if (cVar2 == '\0') goto LAB_009ffb64; } LAB_009ffebb: local_4c = (EntityPtr)0x3a83126f; pEVar3 = &local_4c; if (0.001 <= local_ac.y) { pEVar3 = (EntityPtr *)&local_58.y; } EVar18 = *pEVar3; if (isChocolateMilk != 0) { local_58.y = 0.001; local_4c = (EntityPtr)(local_ac.y * 0.25); pEVar3 = (EntityPtr *)&local_58.y; if (0.001 <= local_ac.y * 0.25) { pEVar3 = &local_4c; } EVar18 = *pEVar3; } if (*(float *)&this->field_0x14 < (float)EVar18) { if (this->_mainLaser == (EntityPtr)0x0) { pvVar10 = this->_owner; if (((pvVar10 == (void *)0x0) || (pvVar6 = pvVar10, *(int *)((int)pvVar10 + 0x28) != 1)) && ((pvVar6 = (void *)0x0, pvVar10 != (void *)0x0 && (*(int *)((int)pvVar10 + 0x28) == 3)))) { iVar13 = *(int *)((int)pvVar10 + 0xd50); LAB_00a0049b: if (1 < iVar13) goto LAB_00a004a0; } else { pvVar10 = (void *)0x0; if (pvVar6 != (void *)0x0) { iVar13 = *(int *)((int)pvVar6 + 0x1338); goto LAB_00a0049b; } } LAB_00a004ba: Weapon::stop_costume_item_anim((Weapon *)this,0x76); pvVar10 = extraout_ECX_06; } else { LAB_00a004a0: if ((this->_owner != (void *)0x0) && (*(int *)((int)this->_owner + 0x28) == 1)) { bVar1 = Weapon::IsItemAnimFinished((Weapon *)this,0x76); pvVar10 = extraout_ECX_05; if (bVar1 != 0) goto LAB_00a004ba; } } if ((((this->_mainLaser == (EntityPtr)0x0) && (this->_owner != (void *)0x0)) && (*(int *)((int)this->_owner + 0x28) == 1)) && (((char)isCSection != '\0' && (bVar1 = Weapon::is_c_section_anim_finished((Weapon *)this,(int)pvVar10), bVar1 != 0)))) { Weapon::update_c_section_charge_anim ((Weapon *)this,unusedCollectibleId_02,0,shootDirection,0.0); } } else { uVar14 = (uint)local_4e << 7 | 0x800; if ((char)isCSection == '\0') { uVar14 = (uint)local_4e << 7; } pVVar4 = shootDirection; if ((char)pvVar10 == '\0') { pVVar4 = (Vector *)&this->field_0x20; } local_6c = (EntityPtr)pVVar4->x; local_64 = (EntityPtr)pVVar4->y; local_70 = uVar14; local_60.x = (float)local_6c; local_60.y = (float)local_64; bVar1 = Weapon::IsAxisAligned((Weapon *)this); if (bVar1 == 0) { fVar19 = sqrtf((float)local_64 * (float)local_64 + (float)local_6c * (float)local_6c); iVar13 = extraout_ECX_04; if (0.0 < fVar19) { local_64 = (EntityPtr)((1.0 / fVar19) * (float)local_64); local_60.x = (1.0 / fVar19) * (float)local_6c; goto LAB_009fffc8; } } else { pVVar4 = Vector::ToCardinal((Vector *)(local_3c + 8),&local_60); local_60.x = pVVar4->x; local_64 = (EntityPtr)pVVar4->y; iVar13 = extraout_ECX_03; LAB_009fffc8: local_6c = (EntityPtr)local_60.x; local_60.y = (float)local_64; } if (local_46 == '\0') { if (isChocolateMilk == 0) { fVar19 = 1.0; } else { fVar19 = *(float *)&this->field_0x14 / local_ac.y; if (fVar19 <= 0.1) { fVar19 = 0.1; } if (2.5 <= fVar19) { fVar19 = 2.5; } local_90.y = fVar19; } } else { fVar19 = (30.0 / (*(float *)&this->field_0x10 + 1.0)) * 0.2; local_90.y = fVar19; if (isChocolateMilk != 0) { fVar19 = fVar19 * 1.25; local_90.y = fVar19; } } if (local_98._0_1_ != '\0') { uVar14 = uVar14 | 0x200; local_70 = uVar14; if (isHasBrimstone == '\0') { local_90.y = fVar19 * 0.5; } } Weapon::GetMultiShotParams((Weapon *)this,&local_d8,iVar13); fVar19 = atan2f((float)local_64,(float)local_6c); *(float *)&this->field_0x44 = fVar19 * 57.295776; if ((char)isCSection == '\0') { Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,2,&local_60,-1.0); } else { Weapon::update_c_section_charge_anim ((Weapon *)this,unusedCollectibleId_01,2,&local_60,-1.0); } local_64 = (EntityPtr)0x0; local_4c = (EntityPtr)0x0; if (0 < (short)local_d8) { do { FUN_009f4230((undefined1 *)((int)&local_2c + 8),local_4c,2,local_60.x,local_60.y, local_b0,local_d8,uStack_d4,uStack_d0,uStack_cc,local_c8,uStack_c4, uStack_c0,uStack_bc,local_b8); EVar18 = (EntityPtr) Weapon::fire_brimstone_with_color((undefined1 *)((int)&local_2c + 0x10),uVar14) ; (**(code **)(*(int *)EVar18 + 0xc))(); if (local_64 == (EntityPtr)0x0) { local_64 = EVar18; if (this->_mainLaser != EVar18) { if (this->_mainLaser != (EntityPtr)0x0) { local_58.y = (float)&this->_mainLaser; std::multiset::erase(&local_58.y); } EVar17 = (EntityPtr)&this->_mainLaser; *(EntityPtr *)EVar17 = EVar18; goto LAB_00a001a4; } } else { EVar17 = (EntityPtr)((int)EVar18 + 0x3bc); if (*(int *)((int)EVar18 + 0x3bc) != 0) { local_58.y = (float)EVar17; std::multiset::erase(&local_58.y); } *(EntityPtr *)EVar17 = local_64; LAB_00a001a4: std::multiset::insert(EVar17); } local_4c = (EntityPtr)((int)local_4c + 1); uVar14 = local_70; } while ((int)local_4c < (int)(short)local_d8); } local_4c = (EntityPtr)(local_b8 & 0xffff); uVar5 = local_70; while( true ) { local_70 = uVar5; if (local_4c == (EntityPtr)0x0) break; uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_58.y = fVar19 + fVar19; local_80 = (EntityPtr)sin(local_58.y); local_b4 = cos(local_58.y); local_b0 = (float)local_80; local_98 = (EntityPtr)Weapon::fire_brimstone_with_color(&local_b4,uVar14); local_80 = this->_mainLaser; EVar18 = (EntityPtr)((int)local_98 + 0x3bc); if (*(EntityPtr *)EVar18 != (EntityPtr)0x0) { local_58.y = (float)EVar18; std::multiset::erase(&local_58.y); } *(EntityPtr *)EVar18 = local_80; if (local_80 != (EntityPtr)0x0) { std::multiset::insert(EVar18); } (**(code **)((int)*(EntityPtr *)local_98 + 0xc))(); local_4c = (EntityPtr)((int)local_4c - 1); uVar14 = local_70; uVar5 = local_70; } uStack_bc._1_1_ = (char)((uint)uStack_bc >> 8); bVar15 = uStack_bc._1_1_ != '\0'; EVar18 = (EntityPtr)0x0; if (bVar15) { local_58.x = (float)((uint)local_60.x ^ 0x80000000); local_58.y = (float)((uint)local_60.y ^ 0x80000000); local_98 = (EntityPtr)Weapon::fire_brimstone_with_color(&local_58,uVar5); local_80 = this->_mainLaser; local_4c = (EntityPtr)((int)local_98 + 0x3bc); if (*(EntityPtr *)((int)local_98 + 0x3bc) != (EntityPtr)0x0) { local_58.y = (float)local_4c; std::multiset::erase(&local_58.y); } *(EntityPtr *)local_4c = local_80; if (local_80 != (EntityPtr)0x0) { std::multiset::insert(local_4c); } (**(code **)((int)*(EntityPtr *)local_98 + 0xc))(); EVar18 = local_4c; } local_4c = EVar18; if (uStack_bc._2_1_ != '\0') { local_58.x = (float)((uint)local_60.y ^ 0x80000000); local_58.y = local_60.x; local_98 = (EntityPtr)Weapon::fire_brimstone_with_color(&local_58,uVar5); local_80 = this->_mainLaser; local_4c = (EntityPtr)((int)local_98 + 0x3bc); if (*(EntityPtr *)((int)local_98 + 0x3bc) != (EntityPtr)0x0) { local_58.y = (float)local_4c; std::multiset::erase(&local_58.y); } *(EntityPtr *)local_4c = local_80; if (local_80 != (EntityPtr)0x0) { std::multiset::insert(local_4c); } (**(code **)((int)*(EntityPtr *)local_98 + 0xc))(); EVar18 = (EntityPtr)((uint)local_60.x ^ 0x80000000); local_60.x = local_60.y; local_60.y = (float)EVar18; local_80 = (EntityPtr)Weapon::fire_brimstone_with_color(&local_60,uVar5); local_4c = this->_mainLaser; EVar18 = (EntityPtr)((int)local_80 + 0x3bc); if (*(EntityPtr *)EVar18 != (EntityPtr)0x0) { local_58.y = (float)EVar18; std::multiset::erase(&local_58.y); } *(EntityPtr *)EVar18 = local_4c; if (local_4c != (EntityPtr)0x0) { std::multiset::insert(EVar18); } (**(code **)((int)*(float *)local_80 + 0xc))(); } if ((local_a4.y._0_1_ != '\0') && ((char)isCSection != '\0')) { fire_c_section_fetuses(); } } if ((this->_mainLaser == (EntityPtr)0x0) || (isInterpolated != 0)) { LAB_00a00882: *(undefined4 *)&this->field_0x14 = 0; } else { iVar13 = Entity::GetIntervalTicks((Entity *)this->_mainLaser,4.0,0.0); Weapon::TriggerTearEffects((Weapon *)this,shootDirection,iVar13); if ((local_a4.y._0_1_ == '\0') && ((iVar13 = Entity::GetIntervalTicks((Entity *)this->_mainLaser,4.0,0.0), iVar13 != 0 && ((char)isCSection != '\0')))) { fire_c_section_fetuses(); } if ((isHasMarked != '\0') || ((local_46 != '\0' && (isFullyCharged != '\0')))) { EntityList::QuerySublist ((EntityList *)((int)g_game->_room + 0x1218),(EntityList_EL *)local_3c,7,-1,-1,0 ,0); local_8 = 0; fVar19 = atan2f(shootDirection->y,shootDirection->x); EVar18 = (EntityPtr)(fVar19 * 57.295776); local_98 = local_30; local_4c = (EntityPtr)0x0; local_80 = (EntityPtr)local_3c._4_4_; local_64 = EVar18; if (local_30 != (EntityPtr)0x0) { do { EVar17 = *(EntityPtr *)((int)local_80 + (int)local_4c * 4); if ((EVar17 == this->_mainLaser) || (*(EntityPtr *)((int)EVar17 + 0x3bc) == this->_mainLaser)) { local_58.y = *(float *)((int)EVar17 + 0x41c); fVar19 = *(float *)&this->field_0x44; *(undefined1 *)((int)EVar17 + 0x4c0) = 1; *(undefined4 *)((int)EVar17 + 0x4c4) = 0; fVar19 = angle_difference(local_58.y,(local_58.y - fVar19) + (float)EVar18); *(float *)((int)EVar17 + 0x4c8) = fVar19; if (0.0 <= fVar19) { uVar7 = 0x41000000; } else { uVar7 = 0xc1000000; } *(undefined4 *)((int)EVar17 + 0x4cc) = uVar7; fVar19 = sin(local_58.y * 0.017453292); if (fVar19 <= -0.5) { uVar7 = 0xc1200000; } else { uVar7 = 0x453b8000; } *(undefined4 *)((int)EVar17 + 0x358) = uVar7; if ((local_46 == '\0') || (isFullyCharged == '\0')) { EVar18 = local_64; } else { Weapon::GetOwnerLaserOffset((Weapon *)this,&local_60,4,shootDirection); *(float *)((int)EVar17 + 0x34c) = local_60.x; *(float *)((int)EVar17 + 0x350) = local_60.y; EVar18 = local_64; if (*(int *)((int)EVar17 + 0x458) < 8) { *(undefined4 *)((int)EVar17 + 0x458) = 8; } } } local_4c = (EntityPtr)((int)local_4c + 1); } while ((uint)local_4c < (uint)local_98); } local_58.y = *(float *)&this->field_0x44; fVar19 = angle_difference(local_58.y,(float)EVar18); if (fVar19 <= -8.0) { fVar19 = -8.0; } if (8.0 <= fVar19) { fVar19 = 8.0; } fVar19 = local_58.y + fVar19; if (360.0 < ABS(fVar19)) { fVar19 = fmodf(fVar19,360.0); } if (fVar19 <= 180.0) { if (fVar19 < -180.0) { fVar19 = fVar19 + 360.0; } } else { fVar19 = fVar19 - 360.0; } *(float *)&this->field_0x44 = fVar19; bVar1 = Weapon::IsItemAnimFinished((Weapon *)this,0x76); pVVar4 = shootDirection; if (bVar1 == 0) { if ((char)isCSection == '\0') { Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,2,shootDirection,-2.0); if (((isFullyCharged != '\0') && (local_46 != '\0')) && ((((owner = this->_owner, owner != (Entity_Player *)0x0 && (ownerPlayer = owner, owner->_type == 1)) || ((ownerPlayer = (Entity_Player *)0x0, owner == (Entity_Player *)0x0 || (owner->_type != 3)))) && (ownerPlayer != (Entity_Player *)0x0)))) { pvVar10 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar10 >> 2 < 0x77) { uVar7 = 0; } else { uVar7 = *(undefined4 *)((int)pvVar10 + 0x1d8); } uVar22 = 0xa0083e; iVar13 = Entity_Player::get_costume_anim_frame (ownerPlayer,ownerPlayer,uVar7,ownerPlayer); if (0xf < iVar13) { Weapon::play_brimstone_costume_shoot(uVar22,ownerPlayer,pVVar4,0x41000000); } } } else { Weapon::update_c_section_charge_anim ((Weapon *)this,unusedCollectibleId_03,2,shootDirection,0.0); } } local_8 = 0xffffffff; if (local_3c[0] == '\0') { local_8 = 1; tracked_alloc(1,(void *)local_80,0); local_8 = 0xffffffff; } goto LAB_00a00882; } Weapon::SetHeadLockTime((Weapon *)this,2); if ((this->_owner == (void *)0x0) || (*(int *)((int)this->_owner + 0x28) != 3)) goto LAB_00a00882; Weapon::SetBlinkTime((Weapon *)this,10,unused_00); *(undefined4 *)&this->field_0x14 = 0; } } else { if ((char)local_78 == '\0') goto LAB_009ffebb; if (((isInterpolated != 0) || (0.0 < *(float *)&this->field_0x14)) || (0.0 <= (float)local_80) ) goto LAB_009ffb5c; if (cVar2 != '\0') goto LAB_009ffebb; local_64 = (EntityPtr)((uint)local_4e << 7); local_58.x = shootDirection->x; local_58.y = shootDirection->y; bVar1 = Weapon::IsAxisAligned((Weapon *)this); if (bVar1 == 0) { Vector::Normalize(&local_58); local_4c = (EntityPtr)local_58.x; iVar13 = extraout_ECX_02; } else { pVVar4 = Vector::ToCardinal(&local_60,&local_58); local_4c = (EntityPtr)pVVar4->x; local_58.y = pVVar4->y; iVar13 = extraout_ECX_01; } local_80 = (EntityPtr)local_58.y; local_58.x = (float)local_4c; Weapon::GetMultiShotParams((Weapon *)this,&local_d8,iVar13); fVar19 = atan2f((float)local_80,(float)local_4c); *(float *)&this->field_0x44 = fVar19 * 57.295776; Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,3,&local_58,-1.0); Weapon::SetBlinkTime((Weapon *)this,10,unused); iVar13 = 0; local_4e = 0; if (0 < (short)local_d8) { do { FUN_009f4230((undefined1 *)((int)&local_2c + 8),iVar13,10,local_58.x,local_58.y,local_b0, local_d8,uStack_d4,uStack_d0,uStack_cc,local_c8,uStack_c4,uStack_c0,uStack_bc ,local_b8); if (local_4e == 0) { cVar2 = fire_hitscan(&g_vectorZero,(undefined1 *)((int)&local_2c + 0x10),local_64); local_4e = 0; if (cVar2 != '\0') goto LAB_009ff93e; } else { LAB_009ff93e: local_4e = 1; } iVar13 = iVar13 + 1; } while (iVar13 < (short)local_d8); } uVar14 = local_b8 & 0xffff; EVar18 = local_64; bVar1 = local_4e; while( true ) { local_64 = EVar18; if (uVar14 == 0) break; if (bVar1 == 0) { uVar5 = Random(); fVar19 = (float)((double)(int)uVar5 + __uint_to_double_fixup[-((int)uVar5 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_4c = (EntityPtr)(fVar19 + fVar19); local_80 = (EntityPtr)sin((float)local_4c); local_60.x = cos((float)local_4c); local_60.y = (float)local_80; cVar2 = fire_hitscan(&g_vectorZero,&local_60,local_64); bVar1 = 0; if (cVar2 != '\0') goto LAB_009ff9ec; } else { LAB_009ff9ec: bVar1 = 1; } uVar14 = uVar14 - 1; EVar18 = local_64; } uStack_bc._1_1_ = (char)((uint)uStack_bc >> 8); if (uStack_bc._1_1_ == '\0') { if (bVar1 != 0) goto LAB_009ffafb; LAB_009ffa68: if (uStack_bc._2_1_ != '\0') { local_9c = -local_58.y; local_98 = (EntityPtr)local_58.x; cVar2 = fire_hitscan(&g_vectorZero,&local_9c,EVar18); if (cVar2 == '\0') { EVar17 = (EntityPtr)((uint)local_58.x ^ 0x80000000); local_58.x = local_58.y; local_58.y = (float)EVar17; cVar2 = fire_hitscan(&g_vectorZero,&local_58,EVar18); if (cVar2 == '\0') goto LAB_009ffae1; } goto LAB_009ffafb; } LAB_009ffae1: EVar18 = local_6c; if ((local_6c != (EntityPtr)0x0) && (bVar1 = TemporaryEffects::HasNullEffect ((TemporaryEffects *)((int)local_6c + 0x1508),0x7f), bVar1 != 0)) goto LAB_009ffafe; } else { if (bVar1 == 0) { local_80 = (EntityPtr)((uint)local_58.y ^ 0x80000000); local_84 = -local_58.x; cVar2 = fire_hitscan(&g_vectorZero,&local_84,EVar18); if (cVar2 == '\0') goto LAB_009ffa68; } LAB_009ffafb: EVar18 = local_6c; LAB_009ffafe: fVar16 = (float10)(**(code **)(*(int *)this + 0x18))(); local_4c = (EntityPtr)(float)fVar16; *(float *)&this->field_0x14 = ((float)local_4c - *(float *)&this->field_0x14) * 0.5 + *(float *)&this->field_0x14; if (EVar18 != (EntityPtr)0x0) { TemporaryEffects::RemoveNullEffect((TemporaryEffects *)((int)EVar18 + 0x1508),0x7f,-1); } } *(float *)&this->field_0xc = local_ac.y; local_4d = '\x01'; LAB_009ffb64: EVar18 = this->_mainLaser; if (((EVar18 != (EntityPtr)0x0) && (*(int *)((int)EVar18 + 0x3bc) != 0)) && (*(int *)(*(int *)((int)EVar18 + 0x3bc) + 0x28) != 1000)) { (**(code **)(*(int *)EVar18 + 0x28))(); } local_a4.y = (float)this->_owner; local_46 = '\0'; if (((EntityPtr)local_a4.y != (EntityPtr)0x0) && (*(EntityPtr *)((int)local_a4.y + 0x28) == (EntityPtr)0x1)) { pvVar10 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar10 >> 2 < 0x77) { local_4c = (EntityPtr)0x0; } else { local_4c = *(EntityPtr *)((int)pvVar10 + 0x1d8); } local_98 = (EntityPtr)((int)local_a4.y + 0x122c); local_80 = (EntityPtr)0x0; do { if ((-1 < (int)*(EntityPtr *)local_98) && (*(char *)((int)local_98 + 0xc) == '\0')) { local_2c._size = 0; sprite = (ANM2 *)((int)*(EntityPtr *)local_98 * 0x130 + (int)*(EntityPtr *)((int)local_a4.y + 0x1220)); local_2c._capacity = 0xf; local_2c._buf._0_4_ = (void *)0x0; std::string::assign(local_2c._buf,&s_empty,0); local_70 = local_70 | 2; bVar1 = Weapon::is_held_item(sprite,&local_2c,(void *)local_4c); if ((bVar1 == 0) || (((sprite->_animState)._animData == (void *)0x0 || (local_65 = '\x01', (sprite->_animState)._isPlaying == 0)))) { local_65 = '\0'; } local_8 = 0xffffffff; if (((local_70 & 2) != 0) && (local_70 = local_70 & 0xfffffffd, 0xf < local_2c._capacity)) { uVar14 = local_2c._capacity + 1; pvVar10 = (void *)local_2c._buf._0_4_; if (0xfff < uVar14) { pvVar10 = *(void **)(local_2c._buf._0_4_ + -4); uVar14 = local_2c._capacity + 0x24; if (0x1f < (uint)(local_2c._buf._0_4_ + (-4 - (int)pvVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar10,uVar14); } if (local_65 != '\0') { if ((sprite != (ANM2 *)0x0) && (bVar1 = ANM2::IsPlaying(sprite,&s_empty), bVar1 != 0)) { ANM2::GetAnimation((ANM2 *)&sprite->_animState,&local_2c); local_8 = 3; if (local_2c._size < 8) { LAB_009ffd27: local_46 = '\0'; } else { str = (std_string *)FUN_00651a90(animSuffix,local_2c._size - 8,0xffffffff); local_70 = local_70 | 1; bVar1 = str_eq_cstr(str,(byte *)"ShootAlt"); local_46 = '\x01'; if (bVar1 == 0) goto LAB_009ffd27; } if ((local_70 & 1) != 0) { std::string::_Tidy_deallocate(animSuffix); } local_8 = 0xffffffff; std::string::_Tidy_deallocate(local_2c._buf); } break; } } local_80 = (EntityPtr)((int)local_80 + 1); local_98 = (EntityPtr)((int)local_98 + 0x10); } while ((uint)local_80 < 0xf); } if (local_4d == '\0') { LAB_009ffde2: pVVar4 = shootDirection; } else { fVar16 = (float10)(**(code **)(*(int *)this + 0x18))(); pVVar4 = shootDirection; local_4c = (EntityPtr)(float)fVar16; if (*(float *)&this->field_0x14 < (float)local_4c) { EVar18 = (EntityPtr)((*(float *)&this->field_0x14 / (float)local_4c) * 18.0); local_4c = EVar18; if ((char)isCSection == '\0') { if (local_46 == '\0') { Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,0,shootDirection,(float)EVar18); } } else { bVar1 = Weapon::is_c_section_anim_finished((Weapon *)this,unusedCollectibleId); if (bVar1 != 0) { EVar18 = local_4c; Weapon::update_c_section_charge_anim ((Weapon *)this,unusedCollectibleId_00,0,shootDirection,(float)local_4c); } } if (isInterpolated == 0) { FUN_009f4130(); *(float *)&this->field_0x14 = (float)EVar18 + *(float *)&this->field_0x14; } goto LAB_009ffde2; } if ((char)isCSection == '\0') { if (local_46 != '\0') goto LAB_009ffde2; Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,1,shootDirection,-1.0); } else { Weapon::update_c_section_charge_anim ((Weapon *)this,unusedCollectibleId,1,shootDirection,-1.0); } } bVar1 = Weapon::IsAxisAligned((Weapon *)this); if (bVar1 == 0) { aimDirection = Weapon::get_aim_direction((Weapon *)this,(Vector *)(local_3c + 8),pVVar4); } else { local_60.x = pVVar4->x; aimDirection = &local_60; local_60.y = pVVar4->y; } fVar19 = aimDirection->x; *(float *)&this->field_0x20 = fVar19; *(float *)&this->field_0x24 = aimDirection->y; Weapon::SetBlinkTime((Weapon *)this,1,(int)fVar19); } } else { local_90.y = 1.0; EVar17 = this->_mainLaser; local_a4.x = (float)local_80; local_a4.y = (float)local_4c; if (EVar17 != (EntityPtr)0x0) { local_a4.x = *(float *)((int)EVar17 + 0x33c); local_a4.y = *(float *)((int)EVar17 + 0x340); } if (isInterpolated == 0) { bVar1 = Entity_Player::HasCollectible((Entity_Player *)local_6c,0x44,0); local_70 = 1; if (bVar1 != 0) { local_70 = 9; } if ((local_98._0_1_ != '\0') && (isHasBrimstone == '\0')) { local_90.y = 0.5; } iVar13 = Entity_Player::GetCollectibleNum((Entity_Player *)EVar18,0x76,0); if (1 < iVar13) { local_90.y = local_90.y + local_90.y; } if ((this->_owner != (void *)0x0) && (*(int *)((int)this->_owner + 0x28) == 3)) { local_90.y = local_90.y * 0.5; } if (1.5 < local_90.y) { bVar15 = local_70 == 9; local_70 = 0xb; local_90.y = local_90.y * 0.5; if (bVar15) { local_70 = 0xe; } } EVar17 = this->_mainLaser; pEVar3 = &this->_mainLaser; if ((EVar17 != (EntityPtr)0x0) && ((*(int *)((int)EVar17 + 0x30) != 1 || (*(uint *)((int)EVar17 + 0x2c) != local_70)))) { (**(code **)(*(int *)EVar17 + 0x28))(); if (this->_mainLaser != (EntityPtr)0x0) { local_58.y = (float)&this->_mainLaser; std::multiset::erase(&local_58.y); this->_mainLaser = (EntityPtr)0x0; } LAB_00a009e9: uVar14 = Random(); laser = (Entity_Laser *) Game::Spawn(g_game,7,local_70,&local_a4,&g_vectorZero,this->_owner,1,uVar14); if ((laser == (Entity_Laser *)0x0) || (laser->_type != 7)) { laser = (Entity_Laser *)0x0; } (laser->_posOffset).x = 0.0; (laser->_posOffset).y = -20.0; Entity::SetParent((Entity *)laser,this->_owner); laser->_renderDepthOffset = 3000.0; laser->_scale = local_90.y; Entity_Laser::ResetSpriteScale(laser); init_laser(laser); (**(code **)(*(int *)laser + 0xc))(); EntityPtr::Set(&this->_mainLaser,(Entity *)laser); EVar17 = this->_mainLaser; pEVar3 = extraout_EAX; puVar11 = extraout_ECX_07; goto LAB_00a00a7b; } if (EVar17 == (EntityPtr)0x0) goto LAB_00a009e9; } else { LAB_00a00a7b: if (EVar17 == (EntityPtr)0x0) { uVar14 = CONCAT31((int3)((uint)puVar11 >> 8),isShooting); goto LAB_009ffe67; } } local_78 = CONCAT31((int3)((uint)pEVar3 >> 8),isShooting); if (isShooting == 0) { iVar12 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar13 = 0; if (0 < iVar12) { iVar13 = iVar12; } if (iVar13 < 1) { fVar19 = (float)local_80 - *(float *)((int)EVar17 + 0x33c); fVar21 = (float)local_4c - *(float *)((int)EVar17 + 0x340); if (10000.0 < fVar21 * fVar21 + fVar19 * fVar19) { local_60.x = fVar19; local_60.y = fVar21; pVVar4 = Vector::Normalized(&local_60,(Vector *)(local_3c + 8)); local_60.x = pVVar4->x * 0.3 * 0.5; local_60.y = pVVar4->y * 0.3 * 0.5; goto LAB_00a00bb9; } } } else { local_60.x = shootDirection->x; local_60.y = shootDirection->y; if (1.0 < local_60.x * local_60.x + local_60.y * local_60.y) { Vector::Normalize(&local_60); } local_60.x = local_60.x * 2.0 * 0.5 * local_b0; local_60.y = local_60.y * 2.0 * 0.5 * local_b0; LAB_00a00bb9: Entity::AddVelocity_divided((Entity *)EVar17,&local_60,0); } pEVar3 = &this->_mainLaser; if (isInterpolated == 0) { init_laser(*pEVar3); EVar18 = *pEVar3; *(float *)((int)EVar18 + 0x4e0) = local_90.y; Entity_Laser::ResetSpriteScale((Entity_Laser *)EVar18); if ((local_64 != (EntityPtr)0x0) && (iVar13 = Entity::GetIntervalTicks((Entity *)local_64,local_ac.y,0.0), iVar13 != 0)) { EVar18 = *pEVar3; if (EVar18 != (EntityPtr)0x0) { local_58.x = *(float *)((int)EVar18 + 0x33c); local_58.y = *(float *)((int)EVar18 + 0x340); local_60.x = *(float *)((int)this->_owner + 0x33c); local_60.y = *(float *)((int)this->_owner + 0x340); bVar1 = Vector::operator_ne(&local_58,&local_60); if (bVar1 != 0) { local_60.x = *(float *)((int)*pEVar3 + 0x33c) - *(float *)((int)this->_owner + 0x33c); local_60.y = *(float *)((int)*pEVar3 + 0x340) - *(float *)((int)this->_owner + 0x340); pVVar4 = Vector::Normalized(&local_60,&local_ac); Weapon::TriggerTearEffects((Weapon *)this,pVVar4,1); goto LAB_009ffe64; } } pVVar4 = MusicManager::RandomVector(&local_90); Weapon::TriggerTearEffects((Weapon *)this,pVVar4,1); } } } LAB_009ffe64: uVar14 = local_78; LAB_009ffe67: if ((char)isCSection != '\0') { if (this->_mainLaser == (EntityPtr)0x0) { if (((char)uVar14 != '\0') || (bVar1 = Weapon::is_c_section_anim_finished((Weapon *)this,uVar14), bVar1 != 0)) { *(float *)&this->field_0x3c = shootDirection->x; *(float *)&this->field_0x40 = shootDirection->y; } } else { local_58.y = *(float *)((int)this->_mainLaser + 0x41c) * 0.017453292; local_4c = (EntityPtr)cos(local_58.y); fVar19 = sin(local_58.y); *(EntityPtr *)&this->field_0x3c = local_4c; *(float *)&this->field_0x40 = fVar19; } } ExceptionList = local_10; return; } //@@ 00a00d10 Weapon_Brimstone::fire_c_section_fetuses /* DB: ? gated in Weapon_Brimstone::Fire on modifier bit 5 and the C Section flag (local_94, the one used with Weapon::is_c_section_anim_finished); for each laser whose id/parent matches this+0x48, fire_fetus_tear from the laser position (+0x33c) along its angle (+0x41c) plus a random 3-unit jitter, scaled by the owner's shot speed (+0x1464) */ void Weapon_Brimstone::fire_c_section_fetuses(void) { Entity *source; qword qVar1; uint uVar2; Entity_Tear *pEVar3; void *in_ECX; int iVar4; qword *pqVar5; uint uVar6; float fVar7; int unused; EntityList_EL local_48; Vector local_38; Vector local_30; void *local_28; float local_24; float local_20; float local_1c; float local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1076d; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = *(int *)((int)in_ECX + 4); local_18 = 1.0; if ((iVar4 != 0) && ((*(int *)(iVar4 + 0x28) == 1 || ((*(int *)(iVar4 + 0x28) == 3 && (iVar4 = *(int *)(iVar4 + 0x410), iVar4 != 0)))))) { local_18 = *(float *)(iVar4 + 0x1464); } local_28 = in_ECX; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_48,7,-1,-1,0,0); uVar6 = 0; local_8 = 0; if (local_48._size != 0) { do { iVar4 = *(int *)((int)local_48._data + uVar6 * 4); if ((iVar4 == *(int *)((int)in_ECX + 0x48)) || (*(int *)(iVar4 + 0x3bc) == *(int *)((int)in_ECX + 0x48))) { local_1c = *(float *)(iVar4 + 0x41c) * 0.017453292; local_14 = sin(local_1c); source = *(Entity **)((int)in_ECX + 4); local_24 = cos(local_1c); local_24 = local_24 * 10.0; local_14 = local_14 * 10.0; uVar2 = Random(); local_1c = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_1c = local_1c + local_1c; local_20 = sin(local_1c); unused = 0xa00e61; fVar7 = cos(local_1c); in_ECX = local_28; local_38.x = *(float *)(iVar4 + 0x33c); local_38.y = *(float *)(iVar4 + 0x340); local_30.x = (fVar7 * 3.0 + local_24) * local_18; local_30.y = (local_20 * 3.0 + local_14) * local_18; pEVar3 = fire_fetus_tear(local_28,&local_38,&local_30,0,source,1.0,unused); (**(code **)(*(int *)pEVar3 + 0xc))(); } uVar6 = uVar6 + 1; } while (uVar6 < (uint)local_48._size); } if (local_48._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } if (local_48._data != (void *)0x0) { uVar6 = *(uint *)((int)local_48._data + -4); qVar1 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar6; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar1 < uVar6); free((uint *)((int)local_48._data + -4)); } } ExceptionList = local_10; return; } //@@ 00a00f30 Weapon_Brimstone::GetMaxCharge /* ZHL [vtable slot 6] */ float10 __thiscall Weapon_Brimstone::GetMaxCharge(Weapon_Brimstone *this) { float fVar1; float fVar2; fVar2 = 1.0; if ((this->_modifiers & 1) != 0) { fVar2 = 2.5; } if (((uint)this->_modifiers >> 4 & 1) != 0) { return (float10)0.0; } fVar1 = *(float *)&this->field_0x10; if (fVar1 < 0.001) { fVar1 = 0.001; } return (float10)(fVar1 * fVar2); } //@@ 00a00f90 Weapon_Brimstone::init_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (laser): same body as 00a06330 Weapon_Laser::init_laser flags -> +0x428, Weapon::get_laser_color, Weapon::get_damage); Weapon_Brimstone::Fire on the new and on the existing laser */ void Weapon_Brimstone::init_laser(int *param_1) { code *pcVar1; int iVar2; int iVar3; qword qVar4; BitSet128 *pBVar5; ColorMod *pCVar6; Weapon *in_ECX; float fVar7; int *piVar8; undefined1 auStack_50 [4]; int *local_4c; BitSet128 local_48; ColorMod local_38; uint local_c; local_c = __security_cookie ^ (uint)auStack_50; local_4c = param_1; pBVar5 = Weapon::get_owner_tear_flags(in_ECX,&local_48); iVar2 = *(int *)((int)&pBVar5->_l + 4); qVar4 = pBVar5->_h; iVar3 = *(int *)((int)&pBVar5->_h + 4); param_1[0x10a] = (int)pBVar5->_l; param_1[0x10b] = iVar2; param_1[0x10c] = (int)qVar4; param_1[0x10d] = iVar3; pcVar1 = *(code **)(*param_1 + 0x3c); pCVar6 = Weapon::get_laser_color(in_ECX,&local_38); piVar8 = (int *)0x0; (*pcVar1)(pCVar6,0xffffffff,0xff,0,1); pcVar1 = *(code **)(*piVar8 + 0x40); fVar7 = Weapon::get_damage(in_ECX); (*pcVar1)(fVar7); return; } //@@ 00a01020 Weapon_Brimstone::fire_hitscan /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? called 5x from Weapon_Brimstone::Fire with a direction: Capsule::Collide sweep over EntityList::QueryRadius, GetTearHitParams(2,...), AddBrimstoneMark, AddKnockback, BombDamage; PlayerType 28 Tainted Azazel + Birthright 619 branch; returns hit flag. Caller NPCAI_Pathfinder::MoveRandomlyAxisAligned (00a02890, weapon code region) is misnamed */ undefined1 Weapon_Brimstone::fire_hitscan(undefined4 param_1,Vector *param_2) { float *pfVar1; float fVar2; code *pcVar3; BitSet128 tearFlags; BitSet128 flags; byte bVar4; char cVar5; uint uVar6; uint uVar7; TearParams *other; void *pvVar8; int gridCenterY; int iVar9; float fVar10; BitSet128 *maskResult; Capsule *a; Entity *pEVar11; int *piVar12; ColorMod *laserColor; Weapon *in_ECX; Entity *unused; int gridCenterY; EntityPtr player; int iVar14; float fVar15; float fVar16; uint uVar17; uint uVar18; float in_XMM3_Da; float fVar19; double dVar20; undefined4 uVar21; TypeDescriptor *pTVar22; TypeDescriptor *pTVar23; undefined4 uVar24; Capsule gridCapsule [10]; BitSet128 maskedFlags; Capsule beamCapsule; float local_1fc; float local_1e0; float local_1dc; TearParams tearParams; EntityList_EL hits; int *gridEntity; undefined1 local_158 [8]; Vector local_150; Vector local_148; float local_140; float fStack_13c; Vector VStack_138; float beamTipY; int gridMaxY; int gridX; Vector local_124; Vector ownerPos; Vector local_114; float laserScale; float ownerOffsetY; float ownerOffsetX; undefined1 isHit; EntityPtr local_fc; Weapon *local_f8; float local_f4; uint local_f0; float local_ec; undefined1 hitParamsOut [108]; Color splashColor; undefined1 local_50 [8]; float fStack_48; float fStack_44; float local_40; float fStack_3c; float fStack_38; float fStack_34; float local_30 [3]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; float local_14; Weapon *curWeapon; Game *game; Manager *manager; Entity_Projectile *target; qword targetFlags; puStack_20 = (undefined1 *)(local_30 + 0xb); local_14 = -NAN; puStack_18 = &LAB_00b107a0; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_30 + 8); ExceptionList = &local_1c; fVar19 = 1.0; player = (EntityPtr)in_ECX->_owner; laserScale = fVar19; local_f8 = in_ECX; local_24 = uVar6; if (player == (EntityPtr)0x0) { LAB_00a01284: local_fc = (EntityPtr)0x0; TearParams::constructor(&tearParams); tearParams._flags._l._0_4_ = (uint)tearParams._flags._l | DAT_00c34c60; tearParams._flags._l._4_4_ = tearParams._flags._l._4_4_ | DAT_00c34c64; tearParams._flags._h._0_4_ = (uint)tearParams._flags._h | DAT_00c34c68; tearParams._flags._h._4_4_ = tearParams._flags._h._4_4_ | DAT_00c34c6c; ownerOffsetX = g_vectorZero.x; ownerOffsetY = g_vectorZero.y; } else { local_ec = in_XMM3_Da; if (*(int *)((int)player + 0x28) == 1) { puStack_20 = (undefined1 *)(local_30 + 0xb); TearParams::constructor(&tearParams); LAB_00a010c6: pvVar8 = local_f8->_owner; uVar7 = Random(); other = (TearParams *) Entity_Player::GetTearHitParams (hitParamsOut,2,local_ec * 1.5,(uVar7 & 1) * 2 + -1,pvVar8,uVar6); TearParams::operator_(&tearParams,other); tearParams._flags._l._0_4_ = (uint)tearParams._flags._l | DAT_00c34c60; tearParams._flags._l._4_4_ = tearParams._flags._l._4_4_ | DAT_00c34c64; tearParams._flags._h._0_4_ = (uint)tearParams._flags._h | DAT_00c34c68; tearParams._flags._h._4_4_ = tearParams._flags._h._4_4_ | DAT_00c34c6c; local_fc = player; if ((*(int *)((int)player + 0x13c0) == 0x1c) && (bVar4 = Entity_Player::HasCollectible((Entity_Player *)player,0x26b,0), bVar4 != 0)) { fVar19 = 2.0; laserScale = 2.0; local_fc = player; } else { fVar19 = 1.0; ownerOffsetX = g_vectorZero.x; ownerOffsetY = g_vectorZero.y; laserScale = 1.0; if (player == (EntityPtr)0x0) { goto LAB_00a012fb; } } if (player == (EntityPtr)local_f8->_owner) { ownerOffsetY = g_vectorZero.y + *(float *)((int)player + 0x1650); ownerOffsetX = g_vectorZero.x + *(float *)((int)player + 0x164c); } else { ownerOffsetY = g_vectorZero.y; ownerOffsetX = g_vectorZero.x; } goto LAB_00a01301; } if (*(int *)((int)player + 0x28) != 3) goto LAB_00a01284; player = *(EntityPtr *)((int)player + 0x410); puStack_20 = (undefined1 *)(local_30 + 0xb); TearParams::constructor(&tearParams); if (player != (EntityPtr)0x0) goto LAB_00a010c6; tearParams._flags._l._0_4_ = (uint)tearParams._flags._l | DAT_00c34c60; tearParams._flags._l._4_4_ = tearParams._flags._l._4_4_ | DAT_00c34c64; tearParams._flags._h._0_4_ = (uint)tearParams._flags._h | DAT_00c34c68; tearParams._flags._h._4_4_ = tearParams._flags._h._4_4_ | DAT_00c34c6c; ownerOffsetX = g_vectorZero.x; ownerOffsetY = g_vectorZero.y; laserScale = fVar19; local_fc = player; } LAB_00a012fb: g_vectorZero.x = ownerOffsetX; g_vectorZero.y = ownerOffsetY; LAB_00a01301: pvVar8 = local_f8->_owner; if (pvVar8 == (void *)0x0) { fVar15 = g_vectorZero.y; fVar10 = g_vectorZero.x; } else { fVar15 = *(float *)((int)pvVar8 + 0x340); fVar10 = *(float *)((int)pvVar8 + 0x33c); } fVar19 = fVar19 * 26.0 + 12.0; beamTipY = param_2->y * fVar19 + ownerOffsetY + fVar15; local_124.x = param_2->x * fVar19 + ownerOffsetX + fVar10; if (pvVar8 == (void *)0x0) { ownerPos.x = g_vectorZero.x; ownerPos.y = g_vectorZero.y; } else { ownerPos.x = *(float *)((int)pvVar8 + 0x33c); ownerPos.y = *(float *)((int)pvVar8 + 0x340); } local_124.y = beamTipY; local_114.y = local_124.x; fVar19 = atan2f(param_2->y,param_2->x); local_148.x = 1.5; local_148.y = 1.0; Capsule::constructor(&beamCapsule,&local_124,&local_148,fVar19 * 57.295776,laserScale * 20.0); if ((((uint)g_game->_debugFlags >> 5 & 1) != 0) && (0.0 < local_1e0)) { pvVar8 = DebugRenderer::Get(&g_game->_debugRenderer,*(int *)((int)local_f8->_owner + 0x20),1); push_shape_points(pvVar8,&beamCapsule); } local_150.x = (float)beamCapsule; local_150.y = local_1fc; local_ec = local_1dc + local_1e0; local_124.y = (float)g_game->_room; isHit = 0; local_148.y = 0.0; local_148.x = 0.0; iVar14 = (int)(((float)beamCapsule - 40.0) / 40.0 + 0.5); gridCenterY = (int)((local_1fc - 120.0) / 40.0 + 0.5); if ((((-1 < iVar14) && (local_f0 = *(int *)((int)local_124.y + 0xc), iVar14 < (int)local_f0)) && (-1 < gridCenterY)) && ((gridMaxY = *(int *)((int)local_124.y + 0x10), gridCenterY < gridMaxY && (iVar14 = gridCenterY * local_f0 + iVar14, -1 < iVar14)))) { gridCenterY = iVar14 / (int)local_f0; iVar14 = iVar14 % (int)local_f0; local_f4 = local_ec / 40.0; dVar20 = ceil((double)local_f4); gridCenterY = (int)dVar20; iVar9 = iVar14 - gridCenterY; gridX = 0; if (0 < iVar9) { gridX = iVar9; } fVar10 = (float)(gridCenterY - gridCenterY); fVar19 = 0.0; if (0 < (int)fVar10) { fVar19 = fVar10; } iVar14 = gridCenterY + iVar14; uVar6 = local_f0; if (iVar14 < (int)local_f0) { uVar6 = iVar14; } gridCenterY = gridCenterY + gridCenterY; iVar14 = gridMaxY; if (gridCenterY < gridMaxY) { iVar14 = gridCenterY; } gridMaxY = iVar14; local_f4 = fVar19; local_f0 = uVar6; if (gridX <= (int)uVar6) { do { gridCenterY = gridX; if ((int)fVar19 <= iVar14) { do { if (((gridCenterY < 0) || (*(int *)((int)local_124.y + 0xc) <= gridCenterY)) || (((int)fVar19 < 0 || ((*(int *)((int)local_124.y + 0x10) <= (int)fVar19 || (iVar14 = *(int *)((int)local_124.y + 0xc) * (int)fVar19 + gridCenterY, iVar14 < 0)))))) { piVar12 = (int *)0x0; } else { piVar12 = *(int **)((int)local_124.y + iVar14 * 4 + 0x24); } gridEntity = piVar12; if (piVar12 != (int *)0x0) { iVar14 = *(int *)((int)g_game->_room + 0xc); VStack_138.y = (float)(piVar12[9] / iVar14) * 40.0 + 120.0; VStack_138.x = (float)(piVar12[9] % iVar14) * 40.0 + 40.0; Capsule::constructor(gridCapsule,&VStack_138,&g_vectorOne,0.0,20.0); bVar4 = Capsule::Collide(gridCapsule,&beamCapsule,&local_148); if (bVar4 != 0) { pcVar3 = *(code **)(*piVar12 + 0x10); EntityRef::constructor((EntityRef *)(local_50 + 4),local_f8->_owner); (*pcVar3)(1); } gridCenterY = gridX; } fVar19 = (float)((int)fVar19 + 1); } while ((int)fVar19 <= gridMaxY); fVar19 = local_f4; iVar14 = gridMaxY; uVar6 = local_f0; } gridX = gridCenterY + 1; } while (gridX <= (int)uVar6); } } game = g_game; fVar19 = local_ec; maskResult = BitSet128::operator_and ((BitSet128 *)&local_140,&tearParams._flags,(BitSet128 *)&DAT_00c34c60); if (((int)maskResult->_l != 0 || *(int *)((int)&maskResult->_l + 4) != 0) || (uVar6 = 0x1c, (int)maskResult->_h != 0 || *(int *)((int)&maskResult->_h + 4) != 0)) { uVar6 = 0x1e; } EntityList::QueryRadius((EntityList *)((int)game->_room + 0x1218),&hits,&local_150,fVar19,uVar6); local_14 = 0.0; local_f0 = 0; if (hits._size != 0) { fVar19 = 0.0; do { uVar6 = local_f0; target = *(Entity_Projectile **)((int)hits._data + local_f0 * 4); if ((target->_size != fVar19) && (target->_entityCollisionClass != 0)) { if (local_1dc <= fVar19) { LAB_00a017fb: bVar4 = Entity::IsDescendantOf((Entity *)target,local_f8->_owner); player = local_fc; if (bVar4 == 0) { if ((*(int *)&g_game->_deathmatchManager < 2) || (target->_type != 1)) { iVar14 = target->_type; if (iVar14 - 10U < 0x3de) goto LAB_00a0183f; } else { iVar14 = 1; LAB_00a0183f: targetFlags = target->_flags; VStack_138.y = *(float *)((int)&target->_flags + 4); if ((targetFlags & 0x20000000) == 0) { if (iVar14 == 0x21) { if (target->_variant == 0xb) { LAB_00a01d15: if (target->_dead == 0) { local_f4 = (target->_pos).y - ownerPos.y; local_ec = (target->_pos).x - ownerPos.x; fVar15 = sqrtf(local_f4 * local_f4 + local_ec * local_ec); fVar19 = local_ec; fVar10 = local_f4; if (0.0 < fVar15) { fVar10 = local_f4 * (1.0 / fVar15); fVar19 = local_ec * (1.0 / fVar15); } if ((targetFlags & 0x4000000) == 0) { fVar15 = target->_friction; fVar16 = 900.0 / (target->_mass + 50.0); if (fVar15 != 0.0) { fVar2 = target->_speedMultiplier; (target->_velocity).y = (fVar2 * fVar10 * fVar16) / fVar15 + (target->_velocity).y; (target->_velocity).x = (fVar2 * fVar19 * fVar16) / fVar15 + (target->_velocity).x; } local_150.x = fVar19 * 20.0; local_150.y = fVar10 * 20.0; EntityRef::constructor((EntityRef *)(local_50 + 4),local_f8->_owner); Entity::AddKnockback ((Entity *)target,(EntityRef *)(local_50 + 4),&local_150,0xe,1); } VStack_138.x = 0.0; VStack_138.y = 0.0; bVar4 = Entity::IsVulnerableEnemy((Entity *)target,(Entity *)0x0); player = local_fc; if (((bVar4 == 0) || ((((*(char *)((int)local_fc + 0x202c) != '\0' || (*(char *)((int)local_fc + 0x20a9) != '\0')) || (*(int *)((int)local_fc + 0x17dc) < 3)) && ((bVar4 = Entity_Player::HasCollectible((Entity_Player *)local_fc,0x97,0) , bVar4 == 0 || (uVar6 = Random(), uVar6 % 6 != 0)))))) || (0x1d < *(int *)((int)player + 0x136c))) { local_ec = VStack_138.y; local_f4 = VStack_138.x; } else { local_f4 = 2.29589e-41; local_ec = 0.0; } pcVar3 = *(code **)(*(int *)target + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),local_f8->_owner); cVar5 = (*pcVar3)(tearParams._tearDamage,local_f4,local_ec,local_50 + 4); if (cVar5 != '\0') { bVar4 = Entity::IsVulnerableEnemy((Entity *)target,(Entity *)0x0); curWeapon = local_f8; if (bVar4 != 0) { flags._l._4_4_ = tearParams._flags._l._4_4_; flags._l._0_4_ = (uint)tearParams._flags._l; flags._h._0_4_ = (uint)tearParams._flags._h; flags._h._4_4_ = tearParams._flags._h._4_4_; Entity_Tear::ApplyTearFlagEffects ((Entity *)target,&ownerPos,flags,local_f8->_owner, tearParams._tearDamage); EntityRef::constructor((EntityRef *)(local_50 + 4),curWeapon->_owner); Entity::AddBrimstoneMark ((Entity *)target,(EntityRef *)(local_50 + 4),-0x96); isHit = 1; } } } } else { pcVar3 = *(code **)(*(int *)target + 0x20); EntityRef::constructor((EntityRef *)(local_50 + 4),local_f8->_owner); (*pcVar3)(0x447a0000,0,0,local_50 + 4); } } else if (iVar14 == 0x3c3) { g_forceCollideDepth = g_forceCollideDepth + 1; (**(code **)(*(int *)local_fc + 0x5c))(target); (**(code **)(*(int *)target + 0x5c))(player,0); g_forceCollideDepth = g_forceCollideDepth + -1; } else if (iVar14 != 0x11) goto LAB_00a01d15; fVar19 = 0.0; goto LAB_00a018a9; } uVar6 = local_f0; } if (iVar14 == 4) { if (((target->_parent != local_fc) || ((char)target->_wiggleFrameOffset == '\0')) || (pfVar1 = &(target->_posOffset).y, 0.0 < *pfVar1 || *pfVar1 == 0.0)) { local_f4 = (target->_pos).y - ownerPos.y; local_ec = (target->_pos).x - ownerPos.x; fVar16 = sqrtf(local_f4 * local_f4 + local_ec * local_ec); fVar19 = 0.0; fVar10 = local_ec; fVar15 = local_f4; if (0.0 < fVar16) { fVar10 = local_ec * (1.0 / fVar16); fVar15 = local_f4 * (1.0 / fVar16); } fVar16 = target->_friction; if (fVar16 != 0.0) { fVar2 = target->_speedMultiplier; (target->_velocity).x = (fVar10 * 18.0 * fVar2) / fVar16 + (target->_velocity).x; (target->_velocity).y = (fVar15 * 18.0 * fVar2) / fVar16 + (target->_velocity).y; } goto LAB_00a018a9; } } else if (iVar14 == 9) { if (((local_fc != (EntityPtr)0x0) && (target->_dead == 0)) && (-50.0 < target->_height)) { local_f4 = (target->_pos).y - ownerPos.y; local_ec = (target->_pos).x - ownerPos.x; fVar19 = sqrtf(local_f4 * local_f4 + local_ec * local_ec); if (fVar19 <= 0.0) { local_124.x = local_ec; fVar19 = local_f4; } else { local_124.x = local_ec * (1.0 / fVar19); fVar19 = local_f4 * (1.0 / fVar19); } local_124.x = local_124.x * 18.0; local_124.y = fVar19 * 18.0; Entity_Projectile::Reflect(target,unused,&local_124); } goto LAB_00a021a0; } fVar19 = 0.0; if ((local_fc == (EntityPtr)0x0) || (iVar14 != 2)) { if (((iVar14 == 5) && (((target->_variant != 100 && (target[1]._sprite._eventNames == (void *)0x0)) && (target->_dead == 0)))) && ((target->_entityCollisionClass != 0 && ((target->_flags & 0x4000000) == 0)))) { local_ec = (target->_pos).x - ownerPos.x; local_f4 = (target->_pos).y - ownerPos.y; fVar10 = sqrtf(local_ec * local_ec + local_f4 * local_f4); fVar19 = 0.0; if (fVar10 <= 0.0) { fVar15 = local_ec; fVar10 = local_f4; } else { fVar15 = local_ec * (1.0 / fVar10); fVar10 = (1.0 / fVar10) * local_f4; } fVar16 = target->_friction; if (fVar16 != 0.0) { fVar2 = target->_speedMultiplier; (target->_velocity).x = (fVar15 * 18.0 * fVar2) / fVar16 + (target->_velocity).x; (target->_velocity).y = (fVar10 * 18.0 * fVar2) / fVar16 + (target->_velocity).y; } } } else if (target->_parent == local_fc) { local_140 = target->_curvingStrength; fStack_13c = target->_acceleration; VStack_138.x = target->_orbitDistance; VStack_138.y = *(float *)&target->field_0x434; maskResult = BitSet128::operator_and (&maskedFlags,(BitSet128 *)&local_140,&g_tearFlagLudovico); if (((int)maskResult->_l != 0 || *(int *)((int)&maskResult->_l + 4) != 0) || ((int)maskResult->_h != 0 || *(int *)((int)&maskResult->_h + 4) != 0)) { local_f4 = (target->_pos).y - ownerPos.y; local_ec = (target->_pos).x - ownerPos.x; fVar10 = sqrtf(local_f4 * local_f4 + local_ec * local_ec); fVar19 = 0.0; if (fVar10 <= 0.0) { fVar15 = local_f4; fVar10 = local_ec; } else { fVar15 = local_f4 * (1.0 / fVar10); fVar10 = local_ec * (1.0 / fVar10); } (target->_velocity).x = fVar10 * 18.0 * 1.25; (target->_velocity).y = fVar15 * 18.0 * 1.25; } } goto LAB_00a018a9; } } else { a = Entity::GetCollisionCapsule((Entity *)target,local_50 + 4,&g_vectorZero); bVar4 = Capsule::Collide(a,&beamCapsule,&local_148); if (bVar4 != 0) goto LAB_00a017fb; } LAB_00a021a0: local_f0 = uVar6; fVar19 = 0.0; } LAB_00a018a9: local_f0 = local_f0 + 1; } while (local_f0 < (uint)hits._size); } uVar6 = (uint)tearParams._flags._l; uVar7 = tearParams._flags._l._4_4_; uVar17 = (uint)tearParams._flags._h; uVar18 = tearParams._flags._h._4_4_; maskResult = BitSet128::operator_and(&maskedFlags,&tearParams._flags,&g_tearFlagExplosive); curWeapon = local_f8; if (((int)maskResult->_l != 0 || *(int *)((int)&maskResult->_l + 4) != 0) || ((int)maskResult->_h != 0 || *(int *)((int)&maskResult->_h + 4) != 0)) { local_114.x = local_114.y; local_114.y = beamTipY; Game::BombTearflagEffects(&local_114,0x41f00000,uVar6,uVar7,uVar17,uVar18,local_f8->_owner); tearFlags._l._4_4_ = tearParams._flags._l._4_4_; tearFlags._l._0_4_ = (uint)tearParams._flags._l; tearFlags._h._0_4_ = (uint)tearParams._flags._h; tearFlags._h._4_4_ = tearParams._flags._h._4_4_; Game::BombDamage(g_game,&local_114,tearParams._tearDamage * 2.0 + 10.0,30.0,1,curWeapon->_owner, tearFlags,0x400000004,0); maskResult = BitSet128::operator_and ((BitSet128 *)local_158,&tearParams._flags,&g_tearFlagPoison); if (((int)maskResult->_l != 0 || *(int *)((int)&maskResult->_l + 4) != 0) || ((int)maskResult->_h != 0 || *(int *)((int)&maskResult->_h + 4) != 0)) { uVar6 = Random(); uVar24 = 0; pTVar23 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar22 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar21 = 0; pEVar11 = Game::Spawn(g_game,1000,7,&local_114,&g_vectorZero,(Entity *)0x0,0,uVar6); piVar12 = (int *)__RTDynamicCast(pEVar11,uVar21,pTVar22,pTVar23,uVar24); uVar6 = Random(); pcVar3 = *(code **)(*piVar12 + 0x3c); fVar19 = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 + 1.0) * 0.5; piVar12[0x39] = (int)fVar19; piVar12[0x3a] = (int)fVar19; Color::Reset((Color *)local_50); local_50._0_4_ = 0.02; local_50._4_4_ = 0.9; fStack_48 = 0.02; fStack_44 = 1.0; local_30[0] = 0.0; local_30[1] = 0.33333334; local_30[2] = 0.0; (*pcVar3)(local_50,0xffffffff,0xff,0,1); (**(code **)(*piVar12 + 0xc))(); uVar6 = Random(); pEVar11 = Game::Spawn(g_game,1000,2,&local_114,&g_vectorZero,(Entity *)0x0,4,uVar6); pcVar3 = *(code **)(*(int *)pEVar11 + 0x3c); Color::Reset((Color *)local_50); local_50._0_4_ = 0.02; local_50._4_4_ = 0.9; fStack_48 = 0.02; fStack_44 = 1.0; local_30[0] = 0.039215688; local_30[1] = 0.3921569; local_30[2] = 0.0; (*pcVar3)(local_50,0xffffffff,0xff,0,1); (pEVar11->_sprite)._scale.x = 0.5; (pEVar11->_sprite)._scale.y = 0.2; pEVar11->_renderDepthOffset = -5.0; (**(code **)(*(int *)pEVar11 + 0xc))(); } uVar6 = Random(); uVar24 = 0; pTVar23 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar22 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar21 = 0; pEVar11 = Game::Spawn(g_game,1000,1,&local_114,&g_vectorZero,(Entity *)0x0,0,uVar6); piVar12 = (int *)__RTDynamicCast(pEVar11,uVar21,pTVar22,pTVar23,uVar24); pcVar3 = *(code **)(*piVar12 + 0x3c); piVar12[0x39] = (int)((float)piVar12[0x39] * 0.5); piVar12[0x3a] = (int)((float)piVar12[0x3a] * 0.5); laserColor = Weapon::get_laser_color(local_f8,(ColorMod *)local_50); (*pcVar3)(laserColor,0xffffffff,0xff,0,1); } manager = g_manager; local_ec = 7.553e-43; seed_fart_sound_override((int *)&local_ec); SoundEffects::Play(&manager->_sfxManager,(int)local_ec,1.0,2,0,1.0,0.0); curWeapon = local_f8; Weapon::GetOwnerLaserOffset(local_f8,&local_124,4,param_2); Color::Reset(&splashColor); player = local_fc; splashColor._tint[0] = 2.0; splashColor._tint[1] = 1.0; splashColor._tint[2] = 1.0; splashColor._tint[3] = 1.0; if (local_fc != (EntityPtr)0x0) { local_50._0_4_ = *(float *)((int)local_fc + 0x14c4); local_50._4_4_ = *(float *)((int)local_fc + 0x14c8); fStack_48 = *(float *)((int)local_fc + 0x14cc); fStack_44 = *(float *)((int)local_fc + 0x14d0); local_30[2] = *(float *)((int)local_fc + 0x14ec); local_40 = *(float *)((int)local_fc + 0x14d4); fStack_3c = *(float *)((int)local_fc + 0x14d8); fStack_38 = *(float *)((int)local_fc + 0x14dc); fStack_34 = *(float *)((int)local_fc + 0x14e0); local_30._0_8_ = *(undefined8 *)((int)local_fc + 0x14e4); Color::__mul(&splashColor,(ColorMod *)local_50); } uVar6 = Random(); pEVar11 = curWeapon->_owner; local_150.x = param_2->x * 5.0; local_150.y = param_2->y * 5.0; if (pEVar11 == (Entity *)0x0) { fVar10 = g_vectorZero.y; fVar19 = g_vectorZero.x; } else { fVar10 = (pEVar11->_pos).y; fVar19 = (pEVar11->_pos).x; } VStack_138.y = param_2->y + ownerOffsetY + fVar10; VStack_138.x = param_2->x + ownerOffsetX + fVar19; pEVar11 = Game::Spawn(g_game,1000,2,&VStack_138,&local_150,pEVar11,(1.5 < laserScale) + 2,uVar6); if (player != (EntityPtr)0x0) { (**(code **)(*(int *)pEVar11 + 0x3c))(&splashColor,0xffffffff,0xff,0); } (pEVar11->_posOffset).x = local_124.x; (pEVar11->_posOffset).y = local_124.y; uVar6 = Random(); iVar14 = *(int *)pEVar11; *(float *)(pEVar11[1]._sprite._animDefaultName._buf + 8) = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 360.0; (**(code **)(iVar14 + 0xc))(); local_ec = 8.40779e-45; do { uVar6 = Random(); local_114.y = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 60.0 - 30.0) * 0.017453292; local_fc = (EntityPtr)cos(local_114.y); fVar19 = sin(local_114.y); local_114.y = (float)local_fc * param_2->x - fVar19 * param_2->y; local_fc = (EntityPtr)((float)local_fc * param_2->y + fVar19 * param_2->x); uVar6 = Random(); fVar19 = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10; local_150.y = (float)local_fc * fVar19 * 8.0 * laserScale; local_150.x = fVar19 * local_114.y * 8.0 * laserScale; local_114.y = local_150.x; local_fc = (EntityPtr)local_150.y; uVar6 = Random(); pEVar11 = local_f8->_owner; if (pEVar11 == (Entity *)0x0) { fVar10 = g_vectorZero.y; fVar19 = g_vectorZero.x; } else { fVar10 = (pEVar11->_pos).y; fVar19 = (pEVar11->_pos).x; } VStack_138.y = ownerOffsetY + fVar10 + (float)local_fc; VStack_138.x = ownerOffsetX + fVar19 + local_114.y; pEVar11 = Game::Spawn(g_game,1000,0x6f,&VStack_138,&local_150,pEVar11,1,uVar6); if (player != (EntityPtr)0x0) { (**(code **)(*(int *)pEVar11 + 0x3c))(&splashColor,0xffffffff,0xff,0); } (pEVar11->_posOffset).x = local_124.x; (pEVar11->_posOffset).y = local_124.y; fVar19 = laserScale * g_vectorOne.x; (pEVar11->_sprite)._scale.y = laserScale * g_vectorOne.y; (pEVar11->_sprite)._scale.x = fVar19; uVar6 = Random(); (pEVar11->_sprite)._playbackSpeed = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 0.4 + 0.6; (**(code **)(*(int *)pEVar11 + 0xc))(); local_ec = (float)((int)local_ec + -1); } while (local_ec != 0.0); if (hits._0_1_ == '\0') { local_14 = 1.4013e-45; tracked_alloc(1,hits._data,0); } ExceptionList = local_1c; return isHit; } //@@ 00a02790 Weapon_Brimstone::ClearReferences /* ZHL [vtable slot 5] */ void __thiscall Weapon_Brimstone::ClearReferences(Weapon_Brimstone *this) { EntityPtr *pEVar1; Weapon_Brimstone *local_8; pEVar1 = &this->_technology2Laser; local_8 = this; if (this->_technology2Laser != (EntityPtr)0x0) { (**(code **)(*(int *)this->_technology2Laser + 0x28))(); if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Weapon_Brimstone *)pEVar1; std::multiset::erase(&local_8); *pEVar1 = (EntityPtr)0x0; } } pEVar1 = &this->_mainLaser; if (this->_mainLaser != (EntityPtr)0x0) { (**(code **)(*(int *)this->_mainLaser + 0x28))(); if (*pEVar1 != (EntityPtr)0x0) { local_8 = (Weapon_Brimstone *)pEVar1; std::multiset::erase(&local_8); *pEVar1 = (EntityPtr)0x0; } } return; } //@@ 00a02800 Weapon_Brimstone::GetMarkedTargetVariant /* ZHL [vtable slot 12] */ undefined4 __thiscall Weapon_Brimstone::GetMarkedTargetVariant(Weapon_Brimstone *this) { byte bVar1; Entity_Player *this_00; if (((uint)this->_modifiers >> 4 & 1) != 0) { return 0; } this_00 = this->_owner; if (this_00 != (Entity_Player *)0x0) { if (this_00->_type == 1) goto LAB_00a02830; if (this_00->_type == 3) { this_00 = *(Entity_Player **)&this_00->_isControlsEnabled; goto LAB_00a02830; } } this_00 = (Entity_Player *)0x0; LAB_00a02830: bVar1 = Entity_Player::HasCollectible(this_00,0x23c,0); if (bVar1 != 0) { return 0x99; } bVar1 = Entity_Player::HasCollectible(this_00,0x18a,0); if (bVar1 == 0) { return 0; } return 0x1e; } //@@ 00a02870 Weapon_Brimstone::GetFocusEntity /* ZHL [vtable slot 9] */ EntityPtr __thiscall Weapon_Brimstone::GetFocusEntity(Weapon_Brimstone *this) { if (((uint)this->_modifiers >> 4 & 1) == 0) { return (EntityPtr)0x0; } return this->_mainLaser; } //@@ 00a02890 Weapon_Brimstone::fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? calls Weapon_Brimstone::fire_hitscan, Weapon::FireBrimstone, GetMultiShotParams, UpdateHeadChargeAnimation; this+4 owner, +0x34 modifiers, +0x48 laser (was NPCAI_Pathfinder::MoveRandomlyAxisAligned) */ void __thiscall Weapon_Brimstone::fire(Weapon_Brimstone *this,float Speed,byte IgnoreStatusEffects) { EntityPtr *pEVar1; Entity *pEVar2; Vector *pVVar3; char isHitscanHit; char isAnyHit; uint rngValue; EntityPtr EVar4; ColorMod *laserColor; Entity_Laser *pEVar5; void *pvVar6; int unused; float extraout_ECX; float extraout_ECX_00; float extraout_ECX_01; float extraout_ECX_02; int loopIndex; uint rngValue; bool isShootingBackwards; float10 fVar8; float fVar9; float in_XMM2_Da; int *piVar10; int *piVar11; undefined1 auStack_a8 [2]; undefined1 auStack_a6 [2]; undefined1 local_a4 [8]; float local_9c; float *local_98; Vector VStack_94; EntityPtr local_8c; float damageMultiplier; Vector *aimDir; Vector local_80; undefined4 local_78; undefined4 uStack_74; short multiShotParams [2]; float fStack_6c; float fStack_68; float fStack_64; float local_60; int iStack_5c; float fStack_58; undefined1 auStack_54 [64]; uint stackCookie; code *setColorFn; stackCookie = __security_cookie ^ (uint)auStack_a8; aimDir = (Vector *)Speed; damageMultiplier = in_XMM2_Da; Weapon::GetMultiShotParams((Weapon *)this,multiShotParams,(int)this); pvVar6 = this->_owner; if (pvVar6 == (void *)0x0) { LAB_00a02903: local_8c = (EntityPtr)0x0; if (pvVar6 != (void *)0x0) { local_8c = (EntityPtr)0x0; if (*(int *)((int)pvVar6 + 0x28) == 1) goto LAB_00a02934; if (*(int *)((int)pvVar6 + 0x28) == 3) goto LAB_00a02924; } LAB_00a0293e: local_a4._0_4_ = (Entity_Laser *)0x3f800000; } else if (*(int *)((int)pvVar6 + 0x28) == 1) { local_a4._0_4_ = *(undefined4 *)((int)pvVar6 + 0x1464); local_8c = (EntityPtr)pvVar6; } else { if (*(int *)((int)pvVar6 + 0x28) != 3) goto LAB_00a02903; local_8c = *(EntityPtr *)((int)pvVar6 + 0x410); LAB_00a02924: pvVar6 = *(void **)((int)pvVar6 + 0x410); if (pvVar6 == (void *)0x0) goto LAB_00a0293e; LAB_00a02934: local_a4._0_4_ = *(undefined4 *)((int)pvVar6 + 0x1464); } if (((uint)this->_modifiers >> 9 & 1) == 0) { Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,2,(Vector *)Speed,-1.0); fVar9 = 0.0; local_8c = (EntityPtr)0x0; local_98 = (float *)0x0; if (0 < multiShotParams[0]) { do { local_a4._4_4_ = ((Vector *)Speed)->x; local_9c = ((Vector *)Speed)->y; Entity_Player::GetMultiShotPositionVelocity (&local_80,(int)local_98,2,*(Vector *)Speed,(float)local_a4._0_4_, multiShotParams[0],fStack_6c,fStack_68,fStack_64,local_60,iStack_5c,fStack_58, auStack_54[0],auStack_54._4_2_); EVar4 = (EntityPtr)Weapon::fire_brimstone_with_color(); (**(code **)(*(int *)EVar4 + 0xc))(); if (local_8c == (EntityPtr)0x0) { local_8c = EVar4; if (this->_mainLaser != EVar4) { if (this->_mainLaser != (EntityPtr)0x0) { VStack_94.y = (float)&this->_mainLaser; std::multiset::erase(); } this->_mainLaser = EVar4; goto LAB_00a02da1; } } else { if (*(int *)((int)EVar4 + 0x3bc) != 0) { VStack_94.y = (float)((int)EVar4 + 0x3bc); std::multiset::erase(); } *(EntityPtr *)((int)EVar4 + 0x3bc) = local_8c; LAB_00a02da1: std::multiset::insert(); } fVar9 = (float)((int)local_98 + 1); Speed = (float)aimDir; local_98 = (float *)fVar9; } while ((int)fVar9 < (int)multiShotParams[0]); } for (local_98 = (float *)(auStack_54._4_4_ & 0xffff); local_98 != (float *)0x0; local_98 = (float *)((int)local_98 + -1)) { rngValue = Random(); fVar9 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; VStack_94.y = fVar9 + fVar9; local_80.x = cos(VStack_94.y); local_80.y = sin(VStack_94.y); pEVar2 = this->_owner; if (pEVar2 == (Entity *)0x0) { local_9c = g_vectorZero.y; local_a4._4_4_ = g_vectorZero.x; fVar9 = extraout_ECX; } else { fVar9 = (pEVar2->_pos).y; local_a4._4_4_ = (pEVar2->_pos).x; local_9c = fVar9; } local_a4._0_4_ = Weapon::FireBrimstone(pEVar2,(Vector *)(local_a4 + 4),&local_80,damageMultiplier,fVar9,0) ; setColorFn = *(code **)(*(int *)local_a4._0_4_ + 0x3c); laserColor = Weapon::get_laser_color((Weapon *)this,(ColorMod *)(auStack_54 + 0x14)); piVar10 = (int *)0x0; (*setColorFn)(laserColor,0xffffffff,0xff); local_a4._4_4_ = this->_mainLaser; pEVar5 = (Entity_Laser *)(piVar10 + 0xef); if (*(float *)pEVar5 != 0.0) { local_a4._0_4_ = pEVar5; std::multiset::erase(local_a4); } *(undefined4 *)pEVar5 = local_a4._4_4_; if ((EntityPtr)local_a4._4_4_ != (EntityPtr)0x0) { std::multiset::insert(pEVar5); } (**(code **)(*piVar10 + 0xc))(); fVar9 = extraout_ECX_00; } auStack_54[1] = (char)((uint)auStack_54._0_4_ >> 8); isShootingBackwards = auStack_54[1] != '\0'; if (isShootingBackwards) { pEVar2 = this->_owner; local_80.x = -aimDir->x; local_80.y = -aimDir->y; if (pEVar2 == (Entity *)0x0) { local_a4._4_4_ = g_vectorZero.x; local_9c = g_vectorZero.y; } else { fVar9 = (pEVar2->_pos).y; local_a4._4_4_ = (pEVar2->_pos).x; local_9c = fVar9; } local_a4._0_4_ = Weapon::FireBrimstone(pEVar2,(Vector *)(local_a4 + 4),&local_80,damageMultiplier,fVar9,0) ; setColorFn = *(code **)(*(int *)local_a4._0_4_ + 0x3c); laserColor = Weapon::get_laser_color((Weapon *)this,(ColorMod *)(auStack_54 + 0x14)); piVar10 = (int *)0x0; (*setColorFn)(laserColor,0xffffffff,0xff); EVar4 = this->_mainLaser; pEVar5 = (Entity_Laser *)(piVar10 + 0xef); if (*(float *)pEVar5 != 0.0) { local_a4._0_4_ = pEVar5; std::multiset::erase(local_a4); } *(EntityPtr *)pEVar5 = EVar4; if (EVar4 != (EntityPtr)0x0) { std::multiset::insert(pEVar5); } (**(code **)(*piVar10 + 0xc))(); fVar9 = extraout_ECX_01; } if (auStack_54[2] == '\0') { return; } pEVar2 = this->_owner; local_80.x = -aimDir->y; local_80.y = aimDir->x; if (pEVar2 == (Entity *)0x0) { local_9c = g_vectorZero.y; local_a4._4_4_ = g_vectorZero.x; } else { fVar9 = (pEVar2->_pos).y; local_a4._4_4_ = (pEVar2->_pos).x; local_9c = fVar9; } local_a4._0_4_ = Weapon::FireBrimstone(pEVar2,(Vector *)(local_a4 + 4),&local_80,damageMultiplier,fVar9,0); setColorFn = *(code **)(*(int *)local_a4._0_4_ + 0x3c); laserColor = Weapon::get_laser_color((Weapon *)this,(ColorMod *)(auStack_54 + 0x14)); piVar11 = (int *)0x0; piVar10 = (int *)0xffffffff; (*setColorFn)(laserColor,0xffffffff,0xff); EVar4 = this->_mainLaser; pEVar5 = (Entity_Laser *)(piVar11 + 0xef); if (*(int *)pEVar5 != 0) { local_a4._0_4_ = pEVar5; std::multiset::erase(local_a4); } *(EntityPtr *)pEVar5 = EVar4; if (EVar4 != (EntityPtr)0x0) { std::multiset::insert(pEVar5); } (**(code **)(*piVar11 + 0xc))(); pEVar2 = this->_owner; VStack_94.x = local_98[1]; VStack_94.y = -*local_98; if (pEVar2 == (Entity *)0x0) { fVar9 = extraout_ECX_02; } else { fVar9 = (pEVar2->_pos).y; } pEVar5 = Weapon::FireBrimstone(pEVar2,(Vector *)(auStack_a8 + -0xc),&VStack_94,local_9c,fVar9,0) ; setColorFn = *(code **)(*(int *)pEVar5 + 0x3c); laserColor = Weapon::get_laser_color((Weapon *)this,(ColorMod *)auStack_54); (*setColorFn)(laserColor,0xffffffff,0xff,0,1); EVar4 = this->_mainLaser; pEVar1 = (EntityPtr *)(piVar10 + 0xef); if (*pEVar1 != (EntityPtr)0x0) { std::multiset::erase(auStack_a8 + -0x10); } *pEVar1 = EVar4; if (EVar4 != (EntityPtr)0x0) { std::multiset::insert(pEVar1); } (**(code **)(*piVar10 + 0xc))(); return; } Weapon::UpdateHeadChargeAnimation((Weapon *)this,0x76,3,(Vector *)Speed,-1.0); Weapon::SetBlinkTime((Weapon *)this,10,unused); isAnyHit = '\0'; loopIndex = 0; VStack_94.x = (float)((uint)VStack_94.x & 0xffffff); if (0 < multiShotParams[0]) { do { local_a4._4_4_ = aimDir->x; local_9c = aimDir->y; Entity_Player::GetMultiShotPositionVelocity (&local_80,loopIndex,10,*aimDir,(float)local_a4._0_4_,multiShotParams[0],fStack_6c, fStack_68,fStack_64,local_60,iStack_5c,fStack_58,auStack_54[0],auStack_54._4_2_); if (VStack_94.x._3_1_ == '\0') { isHitscanHit = fire_hitscan(&g_vectorZero); isAnyHit = '\0'; if (isHitscanHit != '\0') goto LAB_00a02a08; } else { LAB_00a02a08: isAnyHit = '\x01'; } loopIndex = loopIndex + 1; VStack_94.x = (float)CONCAT13(isAnyHit,VStack_94.x._0_3_); } while (loopIndex < multiShotParams[0]); } pVVar3 = aimDir; fVar9 = (float)auStack_54._0_4_; for (rngValue = auStack_54._4_4_ & 0xffff; aimDir = pVVar3, auStack_54._0_4_ = fVar9, rngValue != 0; rngValue = rngValue - 1) { if (isAnyHit == '\0') { rngValue = Random(); fVar9 = (float)((double)(int)rngValue + __uint_to_double_fixup[-((int)rngValue >> 0x1f)]) * 2.3283064e-10 * 3.14; local_98 = (float *)(fVar9 + fVar9); local_a4._4_4_ = cos((float)local_98); local_9c = sin((float)local_98); isHitscanHit = fire_hitscan(&g_vectorZero); isAnyHit = '\0'; if (isHitscanHit != '\0') goto LAB_00a02aa9; } else { LAB_00a02aa9: isAnyHit = '\x01'; } pVVar3 = aimDir; fVar9 = (float)auStack_54._0_4_; } auStack_54[1] = (char)((uint)fVar9 >> 8); if (auStack_54[1] != '\0') { if (isAnyHit != '\0') goto LAB_00a02bed; local_a4._4_4_ = (uint)pVVar3->x ^ 0x80000000; local_9c = -pVVar3->y; isAnyHit = fire_hitscan(&g_vectorZero); fVar9 = (float)auStack_54._0_4_; } if (isAnyHit != '\0') goto LAB_00a02bed; auStack_54[2] = (char)((uint)fVar9 >> 0x10); if (auStack_54[2] != '\0') { local_a4._4_4_ = (uint)pVVar3->y ^ 0x80000000; local_9c = pVVar3->x; isAnyHit = fire_hitscan(&g_vectorZero); if (isAnyHit != '\0') goto LAB_00a02bed; local_a4._4_4_ = pVVar3->y; local_9c = -pVVar3->x; isAnyHit = fire_hitscan(&g_vectorZero); if (isAnyHit != '\0') goto LAB_00a02bed; } if (local_8c == (EntityPtr)0x0) { return; } if (*(char *)((int)local_8c + 0x1519) != '\0') { return; } piVar10 = *(int **)((int)local_8c + 0x150c); if (piVar10 == *(int **)((int)local_8c + 0x1510)) { return; } while ((*(int *)*piVar10 != 0 || (((int *)*piVar10)[1] != 0x7f))) { piVar10 = piVar10 + 4; if (piVar10 == *(int **)((int)local_8c + 0x1510)) { return; } } LAB_00a02bed: fVar8 = (float10)(**(code **)(*(int *)this + 0x18))(); local_98 = (float *)(float)fVar8; *(float *)&this->field_0x14 = ((float)local_98 - *(float *)&this->field_0x14) * 0.5 + *(float *)&this->field_0x14; if (local_8c != (EntityPtr)0x0) { pvVar6 = (g_manager->_itemConfig)._nullItems._begin; if ((0x1fc < (int)((int)(g_manager->_itemConfig)._nullItems._end - (int)pvVar6 & 0xfffffffcU)) && (local_80.x = *(float *)((int)pvVar6 + 0x1fc), local_80.x != 0.0)) { local_78 = *(undefined4 *)((int)local_80.x + 0x78); local_80.y = 0.0; uStack_74 = 0; TemporaryEffects::RemoveEffect((TemporaryEffects *)((int)local_8c + 0x1508),&local_80,-1); return; } } return; } //@@ 00a031b0 Weapon_Deathmatch::Fire /* DB: vftable */ void Weapon_Deathmatch::Fire(Vector *param_1,byte param_2,byte param_3) { byte bVar1; Vector *pVVar2; uint rngResult; Vector *position; Entity_Bomb *bomb; int iVar3; uint scaleRoll; Weapon *in_ECX; int unused; int unused_00; float10 maxCharge; float fVar4; float fVar5; float fVar6; float maxCharge; undefined1 auVar8 [12]; float fVar9; undefined1 *charge; void *ownerPlayer; Vector bombVelocity; Vector VStack_18; Vector VStack_10; *(undefined4 *)&in_ECX->field_0x10 = 0x41a00000; Weapon::Fire(in_ECX,param_1,param_2,param_3); if (param_3 != 0) { return; } ownerPlayer = in_ECX->_owner; if (ownerPlayer != (void *)0x0) { if (*(int *)((int)ownerPlayer + 0x28) == 1) goto LAB_00a03209; if (*(int *)((int)ownerPlayer + 0x28) == 3) { ownerPlayer = *(void **)((int)ownerPlayer + 0x410); goto LAB_00a03209; } } ownerPlayer = (void *)0x0; LAB_00a03209: fVar9 = 0.001; if (0.001 <= *(float *)&in_ECX->field_0x10) { fVar9 = *(float *)&in_ECX->field_0x10; } maxCharge = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); VStack_10.x = *(float *)&in_ECX->field_0x20; VStack_10.y = *(float *)&in_ECX->field_0x24; fVar4 = (float)maxCharge; bVar1 = Weapon::IsAxisAligned(in_ECX); fVar5 = 1.0; if (bVar1 == 0) { pVVar2 = Weapon::get_aim_direction(in_ECX,&VStack_18,&VStack_10); maxCharge = pVVar2->x; fVar6 = pVVar2->y; fVar5 = sqrtf(maxCharge * maxCharge + fVar6 * fVar6); if (0.0 < fVar5) { maxCharge = pVVar2->x * (1.0 / fVar5); fVar6 = pVVar2->y * (1.0 / fVar5); } fVar5 = 1.0; VStack_10.x = maxCharge; } else { pVVar2 = Vector::ToCardinal(&VStack_18,&VStack_10); fVar6 = pVVar2->y; VStack_10.x = pVVar2->x; } maxCharge = *(float *)&in_ECX->field_0x14; VStack_10.y = fVar6; if (param_2 == 0) { auVar8 = ZEXT812(0x3a83126f); if (auVar8._0_4_ <= fVar9) { auVar8._4_8_ = auVar8._4_8_; auVar8._0_4_ = fVar9; } fVar9 = auVar8._0_4_; if (fVar9 <= maxCharge) { Weapon::UpdateHeadChargeAnimation(in_ECX,0xe5,2,&VStack_10,-1.0); if (fVar4 <= *(float *)&in_ECX->field_0x14) { fVar4 = *(float *)&in_ECX->field_0x14; } if (fVar9 <= fVar4) { fVar4 = fVar9; } unused = 7 - (int)(fVar4 * -0.45); iVar3 = 0xb; if (0xb < unused) { iVar3 = unused; } Weapon::SetBlinkTime(in_ECX,iVar3,unused); pVVar2 = Weapon::get_tear_movement_inheritance(in_ECX,&VStack_18,&VStack_10); bombVelocity.x = pVVar2->x; fVar9 = pVVar2->y; VStack_18.x = fVar9; FUN_009f3c40(); rngResult = Random(); fVar4 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar4 = fVar4 + fVar4; rngResult = Random(); fVar5 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; rngResult = Random(); fVar6 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.4; maxCharge = cos(fVar4); bombVelocity.x = (maxCharge * fVar5 * 3.5 + (VStack_10.x * 10.0 + bombVelocity.x) * fVar9) * fVar6 ; fVar4 = sin(fVar4); pVVar2 = &bombVelocity; bombVelocity.y = (fVar4 * fVar5 * 3.5 + (VStack_10.y * 10.0 + VStack_18.x) * fVar9) * fVar6; position = Weapon::get_owner_position(in_ECX,&VStack_10); bomb = Weapon::fire_bomb(in_ECX,position,pVVar2); if (ownerPlayer != (void *)0x0) { bomb->_fallAcceleration = 0.8; rngResult = Random(); bomb->_fallSpeed = -1.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 8.0; rngResult = Random(); iVar3 = bomb->_explosionCountdown1 - rngResult % 0xf; if (iVar3 < 0xf) { iVar3 = 0xf; } bomb->_explosionCountdown1 = iVar3; *(int *)&bomb->field_0x414 = iVar3; } rngResult = Random(); scaleRoll = Random(); bomb->_loadCostumes = 1; bomb->_explosionDamage = 25.0; fVar9 = (float)((double)(int)scaleRoll + __uint_to_double_fixup[-((int)scaleRoll >> 0x1f)]) * 2.3283064e-10 * 0.15 + ((float)(rngResult & 1) + 0.0) * 0.2 + 0.4; bomb->_radiusMultiplier = fVar9 * bomb->_radiusMultiplier; bomb->_scale = fVar9 * bomb->_scale; } *(undefined4 *)&in_ECX->field_0x14 = 0; bVar1 = Weapon::IsItemAnimFinished(in_ECX,0xe5); if (bVar1 != 0) { FUN_009f4fc0(); return; } } else { if (fVar4 <= maxCharge) { charge = &DAT_bf800000; iVar3 = 1; } else { if (in_ECX->_owner != (void *)0x0) { fVar5 = *(float *)((int)in_ECX->_owner + 0x39c); } iVar3 = 0; *(float *)&in_ECX->field_0x14 = fVar5 + maxCharge; charge = (undefined1 *)(((fVar5 + maxCharge) / fVar4) * 18.0); } Weapon::UpdateHeadChargeAnimation(in_ECX,0xe5,iVar3,param_1,(float)charge); Weapon::SetBlinkTime(in_ECX,1,unused_00); *(float *)&in_ECX->field_0x20 = param_1->x; *(float *)&in_ECX->field_0x24 = param_1->y; } return; } //@@ 00a036b0 Weapon_Deathmatch::GetMaxCharge /* DB: vtable slot 6 of Weapon_Deathmatch; slot name from Weapon */ float10 Weapon_Deathmatch::GetMaxCharge(void) { int in_ECX; float fVar1; fVar1 = *(float *)(in_ECX + 0x10); if (fVar1 < 0.001) { fVar1 = 0.001; } return (float10)fVar1; } //@@ 00a036e0 Weapon_Fetus::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: vftable */ void __thiscall Weapon_Fetus::Fire(void) { Entity *source; Vector shotDirection; byte bVar1; uint uVar2; Entity_Player *owner; int ownerPlayer; float *pfVar3; ANM2 *pAVar4; Vector *pVVar5; Entity_Tear *tear; byte *animName; Vector *newAimDirection; void *in_ECX; Entity_Player *player; int extraout_ECX; int unusedArg; int extraout_ECX_00; ANM2 *player; ANM2 *extraout_ECX_01; void *pvVar6; ANM2 *extraout_ECX_02; int unusedCollectibleId; int extraout_ECX_03; ANM2 *extraout_ECX_04; int extraout_ECX_05; int extraout_ECX_06; Entity_Player *ownerAsPlayer; float10 fVar7; float fVar8; undefined1 *puVar9; Vector *in_stack_00000004; byte in_stack_00000008; byte in_stack_0000000c; int iVar10; short multiShotParams [2]; float fStack_a0; float fStack_9c; float fStack_98; float fStack_94; int iStack_90; float fStack_8c; char isShootingBackwards; char isShootingSideways; undefined4 uStack_88; uint numRandomDirTears; Weapon *weapon; float spreadAngle; Vector scratchVec; Vector local_70; Vector firePos; Vector aimDirection; Vector local_58; Vector *direction; float local_4c; char isMarked; float local_44; float local_40; undefined8 subAnimName; float local_34; float local_30; Vector local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b107dd; local_1c = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; direction = in_stack_00000004; weapon = in_ECX; local_24 = uVar2; Weapon::Fire(in_ECX,in_stack_00000004,in_stack_00000008,in_stack_0000000c); owner = *(Entity_Player **)((int)in_ECX + 4); ownerAsPlayer = owner; if (owner == (Entity_Player *)0x0) { LAB_00a03762: player = (Entity_Player *)0x0; if ((owner == (Entity_Player *)0x0) || (owner->_type != 1)) { LAB_00a03770: if ((owner == (Entity_Player *)0x0) || ((ownerAsPlayer = (Entity_Player *)0x0, owner->_type != 1 && ((owner->_type != 3 || (owner = *(Entity_Player **)&owner->_isControlsEnabled, owner == (Entity_Player *)0x0)))) )) { local_70.y = 1.0; ownerAsPlayer = (Entity_Player *)0x0; goto LAB_00a037a2; } } local_70.y = owner->_shotspeed; } else { if (owner->_type != 1) { if (owner->_type != 3) goto LAB_00a03762; player = *(Entity_Player **)&owner->_isControlsEnabled; goto LAB_00a03770; } local_70.y = owner->_shotspeed; player = owner; } LAB_00a037a2: local_70.y = local_70.y * 1.25; if (player == (Entity_Player *)0x0) { LAB_00a037c7: isMarked = '\0'; } else { bVar1 = Entity_Player::HasCollectible(player,0x18a,0); isMarked = '\x01'; if (bVar1 == 0) goto LAB_00a037c7; } local_40 = (float)(*(uint *)((int)in_ECX + 0x34) >> 7 & 0xffffff01); fVar7 = (float10)(**(code **)(*(int *)in_ECX + 0x18))(uVar2); iVar10 = *(int *)((int)in_ECX + 4); fVar8 = (float)fVar7; local_44 = fVar8; if (iVar10 == 0) { LAB_00a0382d: firePos.x = *(float *)((int)in_ECX + 0x28); firePos.y = *(float *)((int)in_ECX + 0x2c); } else { if (*(int *)(iVar10 + 0x28) == 1) { ownerPlayer = iVar10; } else if ((*(int *)(iVar10 + 0x28) != 3) || (ownerPlayer = *(int *)(iVar10 + 0x410), ownerPlayer == 0)) goto LAB_00a0382d; ownerPlayer = *(int *)(ownerPlayer + 0x140c); if ((ownerPlayer == 0) || (isMarked == '\0')) goto LAB_00a0382d; firePos.x = *(float *)(ownerPlayer + 0x33c); firePos.y = *(float *)(ownerPlayer + 0x340); } bVar1 = (firePos.x == g_vectorZero.x) << 6 | (NAN(firePos.x) || NAN(g_vectorZero.x)) << 2 | 2U | firePos.x < g_vectorZero.x; if (firePos.x == g_vectorZero.x) { bVar1 = (firePos.y == g_vectorZero.y) << 6 | (NAN(firePos.y) || NAN(g_vectorZero.y)) << 2 | 2U | firePos.y < g_vectorZero.y; } local_4c = (float)CONCAT31(CONCAT21((short)((uint)&firePos >> 0x10),bVar1),in_stack_00000008); if (((iVar10 != 0) && (*(int *)(iVar10 + 0x28) == 1)) && (0 < *(int *)(iVar10 + 0x18f8))) { local_40 = 1.0; pfVar3 = &local_40; if (1.0 <= fVar8) { pfVar3 = &local_44; } fVar8 = *pfVar3; } if ((-1000.0 < fVar8) && (local_4c = (float)(uint)in_stack_00000008, fVar8 <= *(float *)((int)in_ECX + 0x14))) { local_4c = 0.0; } aimDirection.x = *(float *)((int)in_ECX + 0x20); aimDirection.y = *(float *)((int)in_ECX + 0x24); bVar1 = Weapon::IsAxisAligned(in_ECX); if (bVar1 == 0) { fVar8 = sqrtf(aimDirection.y * aimDirection.y + aimDirection.x * aimDirection.x); iVar10 = extraout_ECX_00; if (0.0 < fVar8) { aimDirection.x = (1.0 / fVar8) * aimDirection.x; aimDirection.y = (float)(aimDirection.y * (1.0 / fVar8)); } } else { puVar9 = (undefined1 *)0x0; if (ABS(aimDirection.x) <= ABS(aimDirection.y)) { aimDirection.x = 0.0; if (0.0 <= aimDirection.y) { puVar9 = (undefined1 *)0x3f800000; } else { puVar9 = &DAT_bf800000; } } else if (0.0 <= aimDirection.x) { aimDirection.x = 1.0; } else { aimDirection.x = (float)&DAT_bf800000; } iVar10 = extraout_ECX; aimDirection.y = (float)puVar9; } fVar8 = 1.0; pVVar5 = direction; if (local_4c._0_1_ == '\0') { if (in_stack_0000000c == 0) { player = (ANM2 *)&local_44; local_40 = 1.0; pAVar4 = (ANM2 *)&local_40; if (1.0 <= local_44) { pAVar4 = player; } if (*(float *)((int)in_ECX + 0x14) < *(float *)(pAVar4->_filename)._buf) { LAB_00a03e32: pVVar5 = direction; } else { *(float *)((int)in_ECX + 0xc) = local_44 / 3.0; if (ownerAsPlayer == (Entity_Player *)0x0) { ownerPlayer = 7 - (int)(local_44 * -0.15); iVar10 = 0xb; if (0xb < ownerPlayer) { iVar10 = ownerPlayer; } Weapon::SetBlinkTime(in_ECX,iVar10,ownerPlayer); } Weapon::TriggerTearEffects(in_ECX,&aimDirection,1); Weapon::get_owner_position(in_ECX,&firePos); local_4c = aimDirection.x * 10.0; local_44 = aimDirection.y * 10.0; pVVar5 = Weapon::get_tear_movement_inheritance(in_ECX,&scratchVec,&aimDirection); local_4c = local_4c + pVVar5->x; local_44 = local_44 + pVVar5->y; iVar10 = unusedArg; Weapon::GetMultiShotParams(in_ECX,multiShotParams,unusedArg); local_40 = -local_44; if (isShootingBackwards != '\0') { local_58.x = -local_4c * local_70.y; local_58.y = local_40 * local_70.y; tear = fire_fetus_tear(in_ECX,&firePos,&local_58,0,*(Entity **)((int)in_ECX + 4),1.0, iVar10); iVar10 = 0xa03a92; (**(code **)(*(int *)tear + 0xc))(); } if (isShootingSideways != '\0') { local_58.x = local_4c * local_70.y; local_58.y = local_40 * local_70.y; tear = fire_fetus_tear(in_ECX,&firePos,&local_58,0,*(Entity **)((int)in_ECX + 4),1.0, iVar10); iVar10 = 0xa03adf; (**(code **)(*(int *)tear + 0xc))(); local_58.x = -local_4c * local_70.y; local_58.y = local_44 * local_70.y; tear = fire_fetus_tear(in_ECX,&firePos,&local_58,0,*(Entity **)((int)in_ECX + 4),1.0, iVar10); (**(code **)(*(int *)tear + 0xc))(); } local_40 = (float)(numRandomDirTears & 0xffff); if (local_40 != 0.0) { do { source = *(Entity **)((int)in_ECX + 4); uVar2 = Random(); spreadAngle = ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 50.0 - 25.0) * 0.017453292; local_58.y = cos(spreadAngle); iVar10 = 0xa03b99; fVar8 = sin(spreadAngle); scratchVec.x = (local_4c * local_58.y - local_44 * fVar8) * local_70.y; scratchVec.y = (local_4c * fVar8 + local_44 * local_58.y) * local_70.y; tear = fire_fetus_tear(in_ECX,&firePos,&scratchVec,0,source,1.0,iVar10); (**(code **)(*(int *)tear + 0xc))(); local_40 = (float)((int)local_40 - 1); } while (local_40 != 0.0); local_40 = 0.0; } iVar10 = 0; if (0 < multiShotParams[0]) { local_58.x = local_4c; local_58.y = local_44; do { shotDirection.y = local_58.y; shotDirection.x = local_58.x; uVar2 = numRandomDirTears; Entity_Player::GetMultiShotPositionVelocity (&local_34,iVar10,9,shotDirection,local_70.y,multiShotParams[0],fStack_a0, fStack_9c,fStack_98,fStack_94,iStack_90,fStack_8c,(byte)uStack_88, (short)numRandomDirTears); scratchVec.x = firePos.x + local_34; scratchVec.y = local_30 + firePos.y; tear = fire_fetus_tear(in_ECX,&scratchVec,&local_2c,0,*(Entity **)((int)in_ECX + 4),1.0, uVar2); (**(code **)(*(int *)tear + 0xc))(); iVar10 = iVar10 + 1; } while (iVar10 < multiShotParams[0]); } player = *(ANM2 **)((int)in_ECX + 4); local_58.y = (float)player; if ((player != (ANM2 *)0x0) && ((player->_animDefaultName)._size == 1)) { fVar8 = 2.10195e-44; local_2c.y = 2.10195e-44; local_14 = (void *)0x0; local_34 = (float)0x6f6f6853; local_2c.x = 1.82169e-44; subAnimName._0_1_ = 'S'; subAnimName._1_1_ = 'u'; subAnimName._2_1_ = 'b'; subAnimName._3_1_ = 'A'; subAnimName._4_1_ = 'n'; subAnimName._5_1_ = 'i'; subAnimName._6_1_ = 'm'; subAnimName._7_1_ = '_'; local_30 = (float)CONCAT22(local_30._2_2_,0x74); pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if ((int)(g_manager->_itemConfig)._collectibles._end - (int)pvVar6 >> 2 < 0x2a7) { local_40 = 0.0; } else { local_40 = *(float *)((int)pvVar6 + 0xa98); } pfVar3 = player[0x10]._championColor._colorize + 2; iVar10 = 0xf; do { if ((-1 < (int)*pfVar3) && (*(char *)(pfVar3 + 3) != '\0')) { player = (ANM2 *)((int)*pfVar3 * 0x130 + (int)(((ANM2 *)((int)local_58.y + 0x1140))->_championColor)._tint[3]); if (*(float *)player[1]._filename._buf == local_40) { animName = (byte *)&subAnimName; if (0xf < (uint)fVar8) { animName = (byte *)subAnimName; } ANM2::PlayOverlay(player,animName,1); player = extraout_ECX_01; fVar8 = local_2c.y; } } pfVar3 = pfVar3 + 4; iVar10 = iVar10 + -1; } while (iVar10 != 0); local_14 = (void *)0xffffffff; in_ECX = weapon; if (0xf < (uint)fVar8) { uVar2 = (int)fVar8 + 1; pvVar6 = (byte *)subAnimName; if (0xfff < uVar2) { pvVar6 = *(void **)((int)(byte *)subAnimName + -4); uVar2 = (int)fVar8 + 0x24; if (0x1f < (uint)((int)(byte *)subAnimName + (-4 - (int)pvVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar6,uVar2); player = extraout_ECX_02; } goto LAB_00a03e32; } Weapon::UpdateHeadChargeAnimation(in_ECX,0x2a6,2,direction,-1.0); player = extraout_ECX_04; pVVar5 = direction; } *(undefined4 *)&((Weapon *)in_ECX)->field_0x14 = 0; bVar1 = Weapon::is_c_section_anim_finished(in_ECX,(int)player); iVar10 = unusedCollectibleId; if (bVar1 != 0) { Weapon::update_c_section_charge_anim(in_ECX,unusedCollectibleId,0,pVVar5,0.0); iVar10 = extraout_ECX_03; } } bVar1 = Weapon::is_c_section_anim_finished(in_ECX,iVar10); if (bVar1 == 0) { ExceptionList = local_1c; return; } goto LAB_00a03f31; } local_40 = *(float *)((int)in_ECX + 0x14); if (local_44 <= local_40) { puVar9 = &DAT_bf800000; ownerPlayer = 1; LAB_00a03f02: Weapon::update_c_section_charge_anim(in_ECX,iVar10,ownerPlayer,pVVar5,(float)puVar9); iVar10 = extraout_ECX_06; } else { if (in_stack_0000000c == 0) { if (*(int *)((int)in_ECX + 4) != 0) { fVar8 = *(float *)(*(int *)((int)in_ECX + 4) + 0x39c); } local_40 = local_40 + fVar8; *(float *)((int)in_ECX + 0x14) = local_40; } bVar1 = Weapon::is_c_section_anim_finished(in_ECX,iVar10); iVar10 = extraout_ECX_05; pVVar5 = direction; if (bVar1 != 0) { puVar9 = (undefined1 *)((local_40 / local_44) * 18.0); ownerPlayer = 0; goto LAB_00a03f02; } } if (in_stack_0000000c == 0) { Weapon::SetBlinkTime(in_ECX,1,iVar10); newAimDirection = Weapon::get_aim_direction(in_ECX,&local_70,pVVar5); *(float *)((int)in_ECX + 0x20) = newAimDirection->x; *(float *)((int)in_ECX + 0x24) = newAimDirection->y; } LAB_00a03f31: ((Weapon *)((int)in_ECX + 0x38))->_owner = (void *)pVVar5->x; ((Weapon *)((int)in_ECX + 0x38))->_technology2Laser = (EntityPtr)pVVar5->y; ExceptionList = local_1c; return; } //@@ 00a03f60 Weapon_Fetus::GetMaxCharge /* DB: vtable slot 6 of Weapon_Fetus; slot name from Weapon */ float10 Weapon_Fetus::GetMaxCharge(void) { int in_ECX; float fVar1; fVar1 = *(float *)(in_ECX + 0x10) * 3.0; if (fVar1 <= 0.001) { fVar1 = 0.001; } return (float10)fVar1; } //@@ 00a03f90 Weapon_Knife::Fire /* WARNING: Removing unreachable block (ram,0x00a045cb) */ /* WARNING: Removing unreachable block (ram,0x00a045e9) */ /* WARNING: Removing unreachable block (ram,0x00a045f6) */ /* WARNING: Removing unreachable block (ram,0x00a045df) */ /* DB: Weapon_Knife vftable slot 3 (RTTI walk); ZHL prefix24/43 called it Menu_Game::online_mods_check */ void __thiscall Weapon_Knife::Fire(void *this,Vector *param_2,int *param_3,int *param_4) { int iVar1; undefined4 uVar2; byte bVar3; int **ppiVar4; undefined2 uVar9; undefined3 uVar8; Vector *tmpVec; BitSet128 *maskedTearFlags; int **ppiVar5; int *piVar6; int iVar7; Entity_Player *ownerPlayer; int iVar10; int iVar11; char *unusedArg; void *pvVar12; void *ptr; char cVar13; Entity_Player *pEVar14; uint uVar15; undefined4 *puVar16; bool bVar17; float fVar18; float fVar19; undefined1 local_94 [12]; float fStack_88; int *knifeRange; undefined1 multiShotParams [36]; int *local_5c; Vector local_58; int *local_50; float local_4c; float shotSpeed; uint local_44; undefined1 local_40 [4]; void *knifeList; Vector local_38; uint local_30; int *local_2c; char isMomsEye; void *local_24; Entity_Player *local_20; undefined4 *local_1c; Entity_Player *local_18; char local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; Entity_Knife *knife; local_8 = 0xffffffff; puStack_c = &LAB_00b1081d; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = this; Weapon::Fire(this,param_2,(byte)param_3,(byte)param_4); local_18 = *(Entity_Player **)((int)this + 4); local_30 = 0; local_20 = (Entity_Player *)(*(uint *)((int)this + 0x34) >> 4 & 0xffffff01); local_44 = *(uint *)((int)this + 0x34) >> 6 & 0xffffff01; if (local_18 == (Entity_Player *)0x0) { LAB_00a04011: pEVar14 = (Entity_Player *)0x0; if ((local_18 == (Entity_Player *)0x0) || (local_18->_type != 1)) { LAB_00a04022: local_18 = (Entity_Player *)0x0; } } else { if (local_18->_type != 1) { if (local_18->_type != 3) goto LAB_00a04011; pEVar14 = *(Entity_Player **)&local_18->_isControlsEnabled; goto LAB_00a04022; } pEVar14 = local_18; } if (pEVar14 == (Entity_Player *)0x0) { LAB_00a04043: local_11 = '\0'; } else { bVar3 = Entity_Player::HasCollectible(pEVar14,0x18a,0); local_11 = '\x01'; if (bVar3 == 0) goto LAB_00a04043; } ppiVar5 = (int **)((int)this + 0x10); local_5c = (int *)0x3a83126f; ppiVar4 = &local_5c; if (0.001 < (float)*ppiVar5 || (float)*ppiVar5 == 0.001) { ppiVar4 = ppiVar5; } local_2c = *ppiVar4; if (local_18 != (Entity_Player *)0x0) { bVar3 = TemporaryEffects::HasNullEffect(&local_18->_temporaryeffects,0x6e); local_30 = 0; if (bVar3 != 0) { local_30 = 5; } } if (pEVar14 == (Entity_Player *)0x0) { fVar19 = 260.0; } else { fVar19 = pEVar14->_tearrange; } knifeRange = (int *)(fVar19 * 0.6); iVar7 = *(int *)((int)this + 4); if (iVar7 == 0) { LAB_00a04100: shotSpeed = 1.0; } else if (*(int *)(iVar7 + 0x28) == 1) { shotSpeed = *(float *)(iVar7 + 0x1464); } else { if ((*(int *)(iVar7 + 0x28) != 3) || (*(int *)(iVar7 + 0x410) == 0)) goto LAB_00a04100; shotSpeed = *(float *)(*(int *)(iVar7 + 0x410) + 0x1464); } local_50 = knifeRange; if ((char)local_20 != '\0') { if ((char)param_4 != '\0') goto LAB_00a04e59; if (*(int *)((int)this + 0x44) == 0) { param_4 = (int *)Weapon::fire_knife(); if (*(int **)((int)this + 0x44) != param_4) { if (*(int **)((int)this + 0x44) != (int *)0x0) { local_58.y = (float)((int)this + 0x44); std::multiset::erase(); } *(int **)((int)this + 0x44) = param_4; if (param_4 != (int *)0x0) { std::multiset::insert(); } } if (pEVar14 != (Entity_Player *)0x0) { init_knife(); } (**(code **)(*param_4 + 0xc))(); } piVar6 = *(int **)((int)this + 0x44); local_50 = piVar6; init_knife(); if ((local_18 != (Entity_Player *)0x0) && (iVar7 = Entity::GetIntervalTicks((Entity *)local_18,(float)local_2c,0.0), iVar7 != 0)) { if (piVar6 == (int *)0x0) { LAB_00a04c17: tmpVec = MusicManager::RandomVector(&local_38); } else { local_58.y = (float)piVar6[0xd0]; local_58.x = (float)piVar6[0xcf]; local_38.x = *(float *)(*(int *)((int)this + 4) + 0x33c); local_38.y = *(float *)(*(int *)((int)this + 4) + 0x340); bVar3 = Vector::operator_ne(&local_58,&local_38); if (bVar3 == 0) goto LAB_00a04c17; local_38.x = (float)piVar6[0xcf] - *(float *)(*(int *)((int)this + 4) + 0x33c); local_38.y = (float)piVar6[0xd0] - *(float *)(*(int *)((int)this + 4) + 0x340); tmpVec = Vector::Normalized(&local_38,&local_58); } Weapon::TriggerTearEffects(this,tmpVec,1); } unusedArg = g_game->_room; if ((*unusedArg != '\0') && (g_game->_frameCount == *(int *)(unusedArg + 0x11f0))) { tmpVec = Weapon::get_owner_position(this,&local_38); unusedArg = (char *)tmpVec->x; piVar6[0xcf] = (int)unusedArg; piVar6[0xd0] = (int)tmpVec->y; } Weapon::GetMultiShotParams(this,multiShotParams,(int)unusedArg); local_2c = (int *)((short)multiShotParams._0_2_ + -1); param_4 = (int *)0x0; knifeList = (void *)0x0; if ((int)local_2c < 0) { local_2c = (int *)0x0; } pEVar14 = (Entity_Player *)0x0; local_20 = (Entity_Player *)0x0; local_38.x = 0.0; local_18 = (Entity_Player *)0x0; local_38.y = 0.0; local_8 = 0; local_44 = piVar6[0xf0]; if (local_44 != 0) { do { if ((Entity_Player *)local_38.x == pEVar14) { std::vector::_Emplace_reallocate(); pEVar14 = (Entity_Player *)local_38.y; } else { *(uint *)local_38.x = local_44; local_38.x = (float)((int)local_38.x + 4); } local_44 = *(uint *)(local_44 + 0x3c0); } while (local_44 != 0); local_44 = 0; local_20 = (Entity_Player *)local_38.x; local_18 = pEVar14; } pvVar12 = knifeList; local_58.y = (float)((int)local_20 - (int)knifeList >> 2); local_38.x = (float)local_20; param_4 = knifeList; if ((uint)local_58.y < local_2c) { local_2c = (int *)((int)local_2c - (int)local_58.y); if (0 < (int)local_2c) { do { fVar19 = local_38.x; param_4 = (int *)Weapon::fire_knife(); init_knife(); if ((Entity_Player *)fVar19 == local_18) { std::vector::_Emplace_reallocate(); local_18 = (Entity_Player *)local_38.y; } else { *(int **)fVar19 = param_4; local_38.x = (float)((int)fVar19 + 4); } local_2c = (int *)((int)local_2c + -1); } while (local_2c != (int *)0x0); param_4 = knifeList; local_2c = (int *)0x0; } LAB_00a04d8c: uVar15 = (int)local_38.x - (int)param_4 >> 2; local_30 = 0; pvVar12 = param_4; if (uVar15 != 0) { do { local_50 = *(int **)((int)pvVar12 + local_30 * 4); if (piVar6[0xf0] != 0) { local_58.y = (float)(piVar6 + 0xf0); std::multiset::erase(); pvVar12 = param_4; } piVar6[0xf0] = (int)local_50; if (local_50 != (int *)0x0) { std::multiset::insert(); pvVar12 = param_4; } piVar6 = *(int **)((int)pvVar12 + local_30 * 4); if (g_game->_frameCount == piVar6[0xca]) { (**(code **)(*piVar6 + 0xc))(); piVar6 = *(int **)((int)param_4 + local_30 * 4); pvVar12 = param_4; } local_30 = local_30 + 1; } while (local_30 < uVar15); } } else if (local_2c < (uint)local_58.y) { piVar6 = local_2c; do { (**(code **)(**(int **)((int)pvVar12 + (int)piVar6 * 4) + 0x28))(); piVar6 = (int *)((int)piVar6 + 1); } while (piVar6 < (uint)local_58.y); pEVar14 = (Entity_Player *)((int)pvVar12 + (int)local_2c * 4); local_38.x = (float)local_20; if (pEVar14 != local_20) { local_38.x = (float)pEVar14; } piVar6 = local_50; goto LAB_00a04d8c; } if (pvVar12 != (void *)0x0) { uVar15 = (int)local_18 - (int)pvVar12 & 0xfffffffc; ptr = pvVar12; if (0xfff < uVar15) { ptr = *(void **)((int)pvVar12 - 4); uVar15 = uVar15 + 0x23; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar15); } this = local_24; LAB_00a04e59: iVar7 = *(int *)((int)this + 0x44); if (iVar7 == 0) { ExceptionList = local_10; return; } if ((char)param_3 == '\0') { ExceptionList = local_10; return; } shotSpeed = shotSpeed * 5.0; fVar19 = param_2->x; param_4 = (int *)param_2->y; fVar18 = fVar19 * fVar19 + (float)param_4 * (float)param_4; if ((1.0 < fVar18) && (fVar18 = sqrtf(fVar18), 0.0 < fVar18)) { fVar19 = param_2->x * (1.0 / fVar18); param_4 = (int *)(param_2->y * (1.0 / fVar18)); } fVar18 = *(float *)(iVar7 + 0x36c); if (fVar18 == 0.0) { ExceptionList = local_10; return; } *(float *)(iVar7 + 0x364) = (*(float *)(iVar7 + 0x39c) * shotSpeed * (float)param_4 * 0.5) / fVar18 + *(float *)(iVar7 + 0x364); *(float *)(iVar7 + 0x360) = (*(float *)(iVar7 + 0x39c) * shotSpeed * fVar19 * 0.5) / fVar18 + *(float *)(iVar7 + 0x360) ; ExceptionList = local_10; return; } if ((iVar7 == 0) || ((((*(int *)(iVar7 + 0x28) != 1 && ((*(int *)(iVar7 + 0x28) != 3 || (iVar7 = *(int *)(iVar7 + 0x410), iVar7 == 0)))) || (iVar7 = *(int *)(iVar7 + 0x140c), iVar7 == 0)) || (local_11 == '\0')))) { fVar19 = *(float *)((int)this + 0x28); fVar18 = *(float *)((int)this + 0x2c); } else { fVar19 = *(float *)(iVar7 + 0x33c); fVar18 = *(float *)(iVar7 + 0x340); } uVar9 = (undefined2)((uint)&local_38 >> 0x10); uVar8 = CONCAT21(uVar9,(fVar19 == g_vectorZero.x) << 6 | (NAN(fVar19) || NAN(g_vectorZero.x)) << 2 | 2U | fVar19 < g_vectorZero.x); if ((fVar19 != g_vectorZero.x) || (uVar8 = CONCAT21(uVar9,(fVar18 == g_vectorZero.y) << 6 | (NAN(fVar18) || NAN(g_vectorZero.y)) << 2 | 2U | fVar18 < g_vectorZero.y), fVar18 != g_vectorZero.y)) { local_11 = '\x01'; } else { local_11 = '\0'; } local_24 = (void *)CONCAT31(uVar8,(char)param_3); local_5c = (int *)0x3dcccccd; local_38.x = fVar19; local_38.y = fVar18; if ((((char)param_4 == '\0') && ((char)param_3 != '\0')) && (local_11 != '\0')) { tmpVec = Weapon::get_owner_position(this,&local_38); fVar18 = fVar18 - tmpVec->y; fVar19 = fVar19 - tmpVec->x; fVar19 = sqrtf(fVar18 * fVar18 + fVar19 * fVar19); fVar18 = (fVar19 - 50.0) / 250.0; if (fVar18 <= 0.0) { fVar18 = 0.0; } if (1.0 <= fVar18) { fVar18 = 1.0; } fVar18 = (((float)local_2c * 4.0 - 5.0) * fVar18 + 5.0) - 1.0; if ((0.0 < fVar18) && (local_5c = (int *)(fVar19 / ((fVar18 / (float)local_2c) * 4.0)), (float)local_5c <= 0.1)) { local_5c = (int *)0x3dcccccd; } local_24 = (void *)((uint)local_24 & 0xff); if (fVar18 < *(float *)((int)this + 0x14)) { local_24 = (void *)0x0; } } if ((pEVar14 == (Entity_Player *)0x0) || (bVar3 = Entity_Player::HasCollectible(pEVar14,0x57,0), bVar3 == 0)) { param_3 = (int *)((uint)param_3 & 0xffffff); if (pEVar14 != (Entity_Player *)0x0) goto LAB_00a04287; LAB_00a0429a: isMomsEye = '\0'; } else { param_3 = (int *)CONCAT13(1,param_3._0_3_); LAB_00a04287: bVar3 = Entity_Player::HasCollectible(pEVar14,0x37,0); if (bVar3 == 0) goto LAB_00a0429a; isMomsEye = '\x01'; } uVar15 = 0; do { if ((uVar15 == 0) || (((uVar15 == 1 && (isMomsEye != '\0')) || (param_3._3_1_ != '\0')))) { if (*(int *)((int)this + uVar15 * 4 + 0x44) == 0) { local_20 = (Entity_Player *)Weapon::fire_knife(); pEVar14 = *(Entity_Player **)((int)this + uVar15 * 4 + 0x44); puVar16 = (undefined4 *)((int)this + uVar15 * 4 + 0x44); if (pEVar14 != local_20) { if (pEVar14 != (Entity_Player *)0x0) { local_1c = puVar16; std::multiset::erase(); puVar16 = (undefined4 *)((int)this + uVar15 * 4 + 0x44); } *puVar16 = local_20; if (local_20 != (Entity_Player *)0x0) { std::multiset::insert(); } } *(undefined4 *)((local_20->_bodySprite)._animDefaultName._buf + 4) = (&DAT_00b81710)[uVar15] ; (**(code **)(*(uint *)local_20 + 0xc))(); } } else { piVar6 = *(int **)((int)this + uVar15 * 4 + 0x44); if (piVar6 != (int *)0x0) { (**(code **)(*piVar6 + 0x28))(); if (*(int *)((int)this + uVar15 * 4 + 0x44) != 0) { local_20 = (Entity_Player *)((int)this + uVar15 * 4 + 0x44); std::multiset::erase(); *(undefined4 *)((int)this + uVar15 * 4 + 0x44) = 0; } } } uVar15 = uVar15 + 1; } while (uVar15 < 4); local_20 = *(Entity_Player **)((int)this + 0x44); if (local_20 == (Entity_Player *)0x0) { ExceptionList = local_10; return; } piVar6 = (int *)((int)this + 0x44); param_3 = (int *)0x4; do { if (*piVar6 != 0) { init_knife(); } piVar6 = piVar6 + 1; param_3 = (int *)((int)param_3 + -1); } while (param_3 != (int *)0x0); Weapon::IsAxisAligned(this); cVar13 = *(char *)((int)local_20 + 0x464); if (((cVar13 == '\0') || ((char)local_44 != '\0')) || (local_11 != '\0')) { param_3 = (int *)param_2->x; local_1c = (undefined4 *)param_2->y; if ((((char)local_24 == '\0') && (cVar13 == '\0')) && ((0.0 < *(float *)((int)this + 0x14) && (local_11 == '\0')))) { param_3 = *(int **)((int)this + 0x20); local_1c = *(undefined4 **)((int)this + 0x24); } if (((float)local_1c == 0.0) && ((float)param_3 == 0.0)) { if (local_18 == (Entity_Player *)0x0) { if (*(int *)(*(int *)((int)this + 4) + 0x28) == 3) { switch(*(undefined4 *)(*(int *)((int)this + 4) + 0xd58)) { case 0: goto LAB_00a0445a; case 1: goto LAB_00a04464; case 2: goto LAB_00a044dd; case 3: local_1c = (undefined4 *)0x3f800000; } } } else { switch(local_18->_headDirection) { case 0: LAB_00a0445a: param_3 = (int *)&DAT_bf800000; break; case 1: LAB_00a04464: local_1c = (undefined4 *)&DAT_bf800000; break; case 2: LAB_00a044dd: param_3 = (int *)0x3f800000; break; case 3: local_1c = (undefined4 *)0x3f800000; } } } if (((char)local_44 != '\0') && (local_11 == '\0')) { if (ABS((float)param_3) <= ABS((float)local_1c)) { param_3 = (int *)0x0; if (0.0 <= (float)local_1c) { local_1c = (undefined4 *)0x3f800000; } else { local_1c = (undefined4 *)&DAT_bf800000; } } else { local_1c = (undefined4 *)0x0; if (0.0 <= (float)param_3) { param_3 = (int *)0x3f800000; } else { param_3 = (int *)&DAT_bf800000; } } } piVar6 = (int *)((int)this + 0x44); local_18 = (Entity_Player *)0x0; do { if (*piVar6 != 0) { fVar19 = atan2f((float)local_1c,(float)param_3); fVar19 = fVar19 * 57.295776 + *(float *)((int)&DAT_00b81710 + (int)local_18); if (360.0 < ABS(fVar19)) { fVar19 = fmodf(fVar19,360.0); } if (fVar19 <= 180.0) { if (fVar19 < -180.0) { fVar19 = fVar19 + 360.0; } } else { fVar19 = fVar19 - 360.0; } *(float *)(*piVar6 + 0x438) = fVar19; local_4c = (float)*piVar6; *(undefined4 *)((int)local_4c + 0x43c) = 0; } local_18 = (Entity_Player *)((int)local_18 + 4); piVar6 = piVar6 + 1; } while (local_18 < 0x10); cVar13 = *(char *)((int)local_20 + 0x464); } pEVar14 = local_20; local_2c = (int *)((float)local_2c * 4.0); if ((char)local_24 == '\0') { if ((cVar13 == '\0') && (fVar19 = *(float *)((int)this + 0x14), 0.0 < fVar19)) { local_4c = (float)local_2c; if (fVar19 <= (float)local_2c) { local_4c = fVar19; } Weapon::TriggerTearEffects(this,param_2,1); local_94._0_4_ = *(undefined4 *)((int)pEVar14 + 0x410); local_94._4_4_ = *(undefined4 *)((int)pEVar14 + 0x414); local_94._8_4_ = *(float *)((int)pEVar14 + 0x418); fStack_88 = *(float *)((int)pEVar14 + 0x41c); local_18 = (Entity_Player *)0x43960000; param_3 = (int *)0x43960000; maskedTearFlags = BitSet128::operator_and ((BitSet128 *)local_40,(BitSet128 *)local_94,(BitSet128 *)&DAT_00c34b60); if (((int)maskedTearFlags->_l != 0 || *(int *)((int)&maskedTearFlags->_l + 4) != 0) || ((int)maskedTearFlags->_h != 0 || *(int *)((int)&maskedTearFlags->_h + 4) != 0)) { local_18 = (Entity_Player *)0x47c35000; param_3 = (int *)0x47c35000; } ownerPlayer = *(Entity_Player **)((int)this + 4); if ((ownerPlayer == (Entity_Player *)0x0) || ((ownerPlayer->_type != 1 && ((ownerPlayer->_type != 3 || (ownerPlayer = *(Entity_Player **)&ownerPlayer->_isControlsEnabled, ownerPlayer == (Entity_Player *)0x0)))))) { param_4 = (int *)0x0; multiShotParams._20_4_ = 1; multiShotParams._0_2_ = 0; multiShotParams._2_2_ = 0; uVar15 = 0; multiShotParams._24_4_ = 0.0; multiShotParams._28_4_ = multiShotParams._28_4_ & 0xff000000; multiShotParams._4_4_ = 0.0; multiShotParams._8_4_ = 0.0; multiShotParams._12_4_ = 0.0; multiShotParams._16_4_ = 0.0; local_24 = (void *)0x0; multiShotParams._32_4_ = multiShotParams._32_4_ & 0xffff0000; } else { Entity_Player::GetMultiShotParams (ownerPlayer,(Weapon_MultiShotParams *)multiShotParams,*(int *)((int)this + 0x30)) ; param_4 = (int *)CONCAT22((short)((uint)pEVar14 >> 0x10),multiShotParams._0_2_); uVar15 = (uint)CONCAT11(multiShotParams[0x1d],multiShotParams[0x1e]); local_24 = (void *)(multiShotParams._32_4_ & 0xffff); } param_2 = (Vector *)0x0; do { uVar2 = param_4; knife = *(Entity_Knife **)((int)this + (int)param_2 * 4 + 0x44); if (knife != (Entity_Knife *)0x0) { if (param_2 != (Vector *)0x0) { if (param_2 == (Vector *)0x1) { cVar13 = (char)(uVar15 >> 8); } else { if (param_2 < 2) goto LAB_00a04912; cVar13 = (char)uVar15; } if (cVar13 == '\0') goto LAB_00a04912; } ppiVar5 = &knifeRange; if ((float)local_18 <= (float)local_50) { ppiVar5 = ¶m_3; } piVar6 = *ppiVar5; if ((float)piVar6 <= (float)local_5c) { piVar6 = local_5c; } Entity_Knife::Shoot(knife,local_4c / (float)local_2c,(float)piVar6); puVar16 = (undefined4 *)0x0; if (0 < (short)uVar2) { local_38.x = 1.0; local_1c = (undefined4 *)((int)(short)uVar2 / 2); local_38.y = 0.0; do { FUN_009f4230(local_94,puVar16,4,local_38.x,local_38.y,shotSpeed); fVar19 = atan2f(fStack_88,(float)local_94._8_4_); fVar19 = fVar19 * 57.295776; local_58.y = (float)*(int **)((int)this + (int)param_2 * 4 + 0x44); if (puVar16 == local_1c) { if (360.0 < ABS(fVar19)) { fVar19 = fmodf(fVar19,360.0); } if (fVar19 <= 180.0) { if (fVar19 < -180.0) { fVar19 = fVar19 + 360.0; } *(float *)((int)local_58.y + 0x43c) = fVar19; } else { *(float *)((int)local_58.y + 0x43c) = fVar19 - 360.0; } } else { piVar6 = (int *)Weapon::fire_knife(); (**(code **)(*piVar6 + 0xc))(); } puVar16 = (undefined4 *)((int)puVar16 + 1); } while ((int)puVar16 < (int)(short)param_4); } } LAB_00a04912: param_2 = (Vector *)((int)param_2 + 1); uVar15 = (uint)CONCAT11(multiShotParams[0x1d],multiShotParams[0x1e]); } while ((int)param_2 < 4); for (uVar15 = (uint)local_24 & 0xffff; uVar15 != 0; uVar15 = uVar15 - 1) { Random(); piVar6 = (int *)Weapon::fire_knife(); (**(code **)(*piVar6 + 0xc))(); } *(undefined4 *)((int)this + 0x14) = 0; *(float *)((int)this + 0x20) = g_vectorZero.x; *(float *)((int)this + 0x24) = g_vectorZero.y; } } else if (cVar13 == '\0') { if ((char)param_4 == '\0') { if (*(int *)((int)this + 4) == 0) { fVar19 = 1.0; } else { fVar19 = *(float *)(*(int *)((int)this + 4) + 0x39c); } fVar19 = fVar19 + *(float *)((int)this + 0x14); fVar18 = (float)local_2c; if (fVar19 <= (float)local_2c) { fVar18 = fVar19; } *(float *)((int)this + 0x14) = fVar18; } tmpVec = Weapon::get_aim_direction(this,&local_38,param_2); *(float *)((int)this + 0x20) = tmpVec->x; *(float *)((int)this + 0x24) = tmpVec->y; } if (((*(char *)((int)local_20 + 0x464) == '\0') || (25.0 < *(float *)((int)local_20 + 0x444) || *(float *)((int)local_20 + 0x444) == 25.0)) || (*(float *)((int)local_20 + 0x448) <= 0.0)) { iVar7 = *(int *)((int)this + 4); if (((iVar7 != 0) && (iVar10 = iVar7, *(int *)(iVar7 + 0x28) == 1)) || ((iVar10 = 0, iVar7 == 0 || (*(int *)(iVar7 + 0x28) != 3)))) { if (iVar10 != 0) { iVar7 = *(int *)(iVar10 + 0x1338); if (iVar7 < 7) { iVar7 = 7; } *(int *)(iVar10 + 0x1338) = iVar7; } goto LAB_00a04a62; } iVar10 = *(int *)(iVar7 + 0xd50); iVar11 = 7; bVar17 = SBORROW4(iVar10,7); iVar1 = iVar10 + -7; } else { iVar7 = *(int *)((int)this + 4); if (((iVar7 != 0) && (iVar10 = iVar7, *(int *)(iVar7 + 0x28) == 1)) || ((iVar10 = 0, iVar7 == 0 || (*(int *)(iVar7 + 0x28) != 3)))) { if (iVar10 != 0) { iVar7 = *(int *)(iVar10 + 0x1338); if (iVar7 < 0xf) { iVar7 = 0xf; } *(int *)(iVar10 + 0x1338) = iVar7; } goto LAB_00a04a62; } iVar10 = *(int *)(iVar7 + 0xd50); iVar11 = 0xf; bVar17 = SBORROW4(iVar10,0xf); iVar1 = iVar10 + -0xf; } if (bVar17 != iVar1 < 0) { iVar10 = iVar11; } *(int *)(iVar7 + 0xd50) = iVar10; LAB_00a04a62: if (((*(char *)((int)local_20 + 0x464) != '\0') && (local_11 == '\0')) && ((char)local_44 == '\0') ) { iVar7 = *(int *)((int)this + 4); if (((iVar7 == 0) || (iVar10 = iVar7, *(int *)(iVar7 + 0x28) != 1)) && ((iVar10 = 0, iVar7 != 0 && (*(int *)(iVar7 + 0x28) == 3)))) { iVar10 = *(int *)(iVar7 + 0xda8); if (iVar10 < 2) { iVar10 = 2; } *(int *)(iVar7 + 0xda8) = iVar10; ExceptionList = local_10; return; } if (iVar10 != 0) { iVar7 = *(int *)(iVar10 + 0x133c); if (iVar7 < 2) { iVar7 = 2; } *(int *)(iVar10 + 0x133c) = iVar7; ExceptionList = local_10; return; } } ExceptionList = local_10; return; } //@@ 00a04f90 Weapon_Knife::ClearReferences /* DB: vftable */ void Weapon_Knife::ClearReferences(void) { int *in_ECX; int *piVar1; int iVar2; int *local_8; piVar1 = in_ECX + 2; local_8 = in_ECX; if ((int *)in_ECX[2] != (int *)0x0) { (**(code **)(*(int *)in_ECX[2] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } piVar1 = in_ECX + 0x11; iVar2 = 4; do { if ((int *)*piVar1 != (int *)0x0) { (**(code **)(*(int *)*piVar1 + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } piVar1 = piVar1 + 1; iVar2 = iVar2 + -1; } while (iVar2 != 0); return; } //@@ 00a05010 Weapon_Knife::GetMaxCharge /* DB: vftable */ float10 Weapon_Knife::GetMaxCharge(void) { int in_ECX; float fVar1; if ((*(uint *)(in_ECX + 0x34) >> 4 & 1) != 0) { return (float10)0.0; } fVar1 = *(float *)(in_ECX + 0x10); if (fVar1 < 0.001) { fVar1 = 0.001; } return (float10)(fVar1 * 4.0); } //@@ 00a05060 Weapon_Knife::SupportsTractorBeam /* DB: vtable slot 13 of Weapon_Knife; slot name from Weapon */ uint Weapon_Knife::SupportsTractorBeam(void) { int in_ECX; return CONCAT31((uint3)(*(uint *)(in_ECX + 0x34) >> 0xc),~(byte)(*(uint *)(in_ECX + 0x34) >> 4)) & 0xffffff01; } //@@ 00a05070 Weapon_Knife::init_knife /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (knife): offset from the owner player's _posOffset (-10, -15 more when flag 0x200000000000000, plus GetFlyingOffset/0.65), color via FUN_009f3db0, tear flags (+0x410..+0x41c, OR'ed with a fixed mask when weapon modifier bit 4), Weapon::get_damage via vfunc +0x40, 0.75 scale for familiar owners; Weapon_Knife::Fire */ void Weapon_Knife::init_knife(int *param_1) { code *pcVar1; int iVar2; int iVar3; qword qVar4; float *extraout_EAX; undefined4 uVar5; BitSet128 *pBVar6; uint uVar7; int in_ECX; Entity_Player *this; uint uVar8; uint uVar9; Weapon *unaff_EDI; float fVar10; int iStack_6c; int iVar11; undefined1 auStack_58 [4]; float local_54; float local_50; BitSet128 local_4c; undefined1 local_38 [44]; uint local_c; local_c = __security_cookie ^ (uint)auStack_58; this = *(Entity_Player **)(in_ECX + 4); if (this == (Entity_Player *)0x0) { LAB_00a05166: local_50 = 0.0; local_54 = -10.0; } else { local_50 = 0.0; if (this->_type != 1) { if (this->_type != 3) goto LAB_00a05166; this = *(Entity_Player **)&this->_isControlsEnabled; local_54 = -10.0; if (this == (Entity_Player *)0x0) goto LAB_00a0517d; } local_50 = (this->_posOffset).x + 0.0; local_54 = (this->_posOffset).y - 10.0; if ((this->_flags & 0x200000000000000) != 0) { local_54 = local_54 - 15.0; } iVar11 = this->_entityGridCollisionClass; if ((((iVar11 == 0) || (iVar11 == 3)) || (iVar11 == 1)) || (iVar11 == 2)) { Entity_Player::GetFlyingOffset(this,(Vector *)((int)&local_4c._l + 4)); local_50 = *extraout_EAX / 0.65 + local_50; local_54 = extraout_EAX[1] / 0.65 + local_54; } } LAB_00a0517d: pcVar1 = *(code **)(*param_1 + 0x3c); uVar5 = Weapon::get_tear_color(local_38); iVar11 = 1; iStack_6c = 0xff; (*pcVar1)(uVar5,0xffffffff); if (((uint)unaff_EDI->_modifiers >> 4 & 1) == 0) { pBVar6 = Weapon::get_owner_tear_flags(unaff_EDI,(BitSet128 *)(auStack_58 + -4)); iVar2 = *(int *)((int)&pBVar6->_l + 4); qVar4 = pBVar6->_h; iVar3 = *(int *)((int)&pBVar6->_h + 4); param_1[0x104] = (int)pBVar6->_l; param_1[0x105] = iVar2; param_1[0x106] = (int)qVar4; param_1[0x107] = iVar3; } else { pBVar6 = Weapon::get_owner_tear_flags(unaff_EDI,(BitSet128 *)(auStack_58 + -4)); uVar9 = (uint)pBVar6->_h | (uint)g_tearFlagLudovico._h; uVar8 = *(uint *)((int)&pBVar6->_h + 4) | g_tearFlagLudovico._h._4_4_; uVar7 = *(uint *)((int)&pBVar6->_l + 4) | g_tearFlagLudovico._l._4_4_; param_1[0x104] = (uint)pBVar6->_l | (uint)g_tearFlagLudovico._l; param_1[0x105] = uVar7; param_1[0x106] = uVar9; param_1[0x107] = uVar8; } pcVar1 = *(code **)(*param_1 + 0x40); fVar10 = Weapon::get_damage(unaff_EDI); (*pcVar1)(fVar10); if ((*(int *)(iVar11 + 4) != 0) && (*(int *)(*(int *)(iVar11 + 4) + 0x28) == 3)) { fVar10 = g_vectorOne.x * 0.75; param_1[0x3a] = (int)(g_vectorOne.y * 0.75); iStack_6c = -0x3e600000; param_1[0x39] = (int)fVar10; } param_1[0xd3] = 0; param_1[0xd4] = iStack_6c; return; } //@@ 00a052a0 Weapon_Laser::Reset /* DB: vftable */ void Weapon_Laser::Reset(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; return; } //@@ 00a052b0 Weapon_Laser::Fire /* DB: Weapon_Laser vftable slot 3 (Fire) */ void Weapon_Laser::Fire(Vector *param_1,byte param_2,byte param_3) { byte isMarkedAim; Entity_Player *pEVar2; uint isCursedEye; Vector *vecResult; int iVar3; undefined4 uVar4; int *ludoLaser; Entity *newLudoLaser; int iVar5; char isMonstrosLung; Weapon *in_ECX; uint unused; int unused_00; int unusedArg; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; int extraout_ECX_05; int extraout_ECX_06; int extraout_ECX_07; Entity_Player *ownerPlayer; int iVar6; int extraout_ECX_08; int extraout_ECX_09; byte bVar7; void *ownerEntity; uint uVar8; float10 maxCharge; float fVar9; float fVar10; float fVar11; double dVar12; byte isFiring; float fStack_60; Vector local_5c; float fStack_54; float local_50; Vector local_4c; Vector scratchVec; Vector aimDirection; Vector ownerPos; undefined1 multiShotParams [29]; char isFireBackward; char isFireSideways; ushort uStack_c; bool isChargeWeapon; bool isFireReady; bool isMarkedAim; isFiring = param_2; Weapon::Fire(in_ECX,param_1,param_2,param_3); uVar8 = in_ECX->_modifiers; local_50 = (float)(uVar8 >> 6 & 0xffffff01); pEVar2 = in_ECX->_owner; local_5c.y = (float)pEVar2; if (pEVar2 == (Entity_Player *)0x0) { ownerPos.x = g_vectorZero.x; ownerPos.y = g_vectorZero.y; LAB_00a0534f: ownerPlayer = (Entity_Player *)0x0; if ((pEVar2 == (Entity_Player *)0x0) || (pEVar2->_type != 1)) { LAB_00a05373: if ((pEVar2 == (Entity_Player *)0x0) || ((pEVar2->_type != 1 && ((pEVar2->_type != 3 || (pEVar2 = *(Entity_Player **)&pEVar2->_isControlsEnabled, pEVar2 == (Entity_Player *)0x0) ))))) { local_5c.x = 1.0; local_5c.y = 0.0; } else { local_5c.y = 0.0; local_5c.x = pEVar2->_shotspeed; } } else { local_5c.x = pEVar2->_shotspeed; } } else { ownerPos.x = (pEVar2->_pos).x; ownerPos.y = (pEVar2->_pos).y; if (pEVar2->_type != 1) { if (pEVar2->_type != 3) goto LAB_00a0534f; ownerPlayer = *(Entity_Player **)&pEVar2->_isControlsEnabled; goto LAB_00a05373; } local_5c.x = pEVar2->_shotspeed; ownerPlayer = pEVar2; } if ((uVar8 >> 4 & 1) != 0) { if (param_3 == 0) { ludoLaser = *(int **)&in_ECX[1].field_0xc; if (ludoLaser == (int *)0x0) { LAB_00a05f6a: if (ludoLaser != (int *)0x0) goto LAB_00a05f6e; } else { if ((ludoLaser[0xb] != 2) || (ludoLaser[0xc] != 1)) { (**(code **)(*ludoLaser + 0x28))(); ludoLaser = *(int **)&in_ECX[1].field_0xc; goto LAB_00a05f6a; } LAB_00a05f6e: if (*(char *)((int)ludoLaser + 0x173) == '\0') goto LAB_00a06048; } uVar8 = Random(); newLudoLaser = Game::SpawnEx(g_game,7,2,&ownerPos,&g_vectorZero,in_ECX->_owner,1,uVar8,0); if ((newLudoLaser == (Entity *)0x0) || (newLudoLaser->_type != 7)) { newLudoLaser = (Entity *)0x0; } (newLudoLaser->_posOffset).x = 0.0; (newLudoLaser->_posOffset).y = -20.0; local_4c.x = (float)in_ECX->_owner; if (newLudoLaser->_parent != (EntityPtr)0x0) { scratchVec.x = (float)&newLudoLaser->_parent; std::multiset::erase(); } newLudoLaser->_parent = (EntityPtr)local_4c.x; if ((EntityPtr)local_4c.x != (EntityPtr)0x0) { std::multiset::insert(); } newLudoLaser->_renderDepthOffset = 3000.0; init_laser(); (**(code **)(*(int *)newLudoLaser + 0xc))(); if (*(Entity **)&in_ECX[1].field_0xc != newLudoLaser) { if (*(Entity **)&in_ECX[1].field_0xc != (Entity *)0x0) { scratchVec.x = (float)&in_ECX[1].field_0xc; std::multiset::erase(); } *(Entity **)&in_ECX[1].field_0xc = newLudoLaser; std::multiset::insert(); } } LAB_00a06048: iVar3 = *(int *)&in_ECX[1].field_0xc; if (iVar3 == 0) { return; } fVar11 = param_1->x; fVar9 = param_1->y; fVar10 = fVar9 * fVar9 + fVar11 * fVar11; local_50 = fVar9; local_4c.x = fVar11; if (1.0 < fVar10) { fVar10 = sqrtf(fVar10); fVar11 = local_4c.x; fVar9 = local_50; if (0.0 < fVar10) { fVar9 = local_50 * (1.0 / fVar10); fVar11 = local_4c.x * (1.0 / fVar10); } } if (param_2 == 0) { iVar6 = *(int *)((int)g_game->_room + 0x12c4) + *(int *)((int)g_game->_room + 0x12c0); iVar5 = 0; if (0 < iVar6) { iVar5 = iVar6; } if (0 < iVar5) goto LAB_00a06200; fVar9 = ownerPos.x - *(float *)(iVar3 + 0x33c); fVar11 = ownerPos.y - *(float *)(iVar3 + 0x340); if (fVar11 * fVar11 + fVar9 * fVar9 <= 10000.0) goto LAB_00a06200; aimDirection.x = ownerPos.x - *(float *)(iVar3 + 0x33c); aimDirection.y = ownerPos.y - *(float *)(iVar3 + 0x340); vecResult = Vector::Normalized(&aimDirection,&scratchVec); fVar10 = *(float *)(iVar3 + 0x36c); fVar11 = vecResult->x * 0.3 * 0.5; fVar9 = vecResult->y * 0.3 * 0.5; } else { fVar10 = *(float *)(iVar3 + 0x36c); fVar11 = fVar11 * 2.0 * 0.5 * local_5c.x; fVar9 = fVar9 * 2.0 * 0.5 * local_5c.x; } if (fVar10 != 0.0) { *(float *)(iVar3 + 0x364) = (fVar9 * *(float *)(iVar3 + 0x39c)) / fVar10 + *(float *)(iVar3 + 0x364); *(float *)(iVar3 + 0x360) = (fVar11 * *(float *)(iVar3 + 0x39c)) / fVar10 + *(float *)(iVar3 + 0x360); } LAB_00a06200: if (param_3 != 0) { return; } init_laser(); if ((Entity_Player *)local_5c.y == (Entity_Player *)0x0) { return; } iVar3 = Entity::GetIntervalTicks((Entity *)local_5c.y,*(float *)&in_ECX->field_0x10,0.0); if (iVar3 == 0) { return; } iVar3 = *(int *)&in_ECX[1].field_0xc; if (iVar3 != 0) { scratchVec.x = *(float *)(iVar3 + 0x33c); scratchVec.y = *(float *)(iVar3 + 0x340); aimDirection.x = *(float *)((int)in_ECX->_owner + 0x33c); aimDirection.y = *(float *)((int)in_ECX->_owner + 0x340); bVar7 = Vector::operator_ne(&scratchVec,&aimDirection); if (bVar7 != 0) { aimDirection.x = *(float *)(iVar3 + 0x33c) - *(float *)((int)in_ECX->_owner + 0x33c); aimDirection.y = *(float *)(iVar3 + 0x340) - *(float *)((int)in_ECX->_owner + 0x340); vecResult = Vector::Normalized(&aimDirection,&scratchVec); Weapon::TriggerTearEffects(in_ECX,vecResult,1); return; } } vecResult = MusicManager::RandomVector(&aimDirection); Weapon::TriggerTearEffects(in_ECX,vecResult,1); return; } isCursedEye = uVar8 >> 1; bVar7 = (byte)in_ECX->_modifiers & 1; unused = CONCAT31((uint3)(uVar8 >> 0xb),(char)(uVar8 >> 3)) & 0xffffff01; if ((((uVar8 >> 3 & 1) != 0) || (bVar7 != 0)) || (isChargeWeapon = false, (isCursedEye & 1) != 0)) { isChargeWeapon = true; } if ((ownerPlayer == (Entity_Player *)0x0) || ((isMarkedAim = Entity_Player::HasCollectible(ownerPlayer,0x18a,0), isMarkedAim == 0 && (isMarkedAim = Entity_Player::HasCollectible(ownerPlayer,0x23c,0), isMarkedAim == 0)))) { isMarkedAim = false; } else { isMarkedAim = true; } if ((((uint)in_ECX->_modifiers >> 7 & 1) != 0) || (isFireReady = false, *(float *)&in_ECX->field_0x10 <= 0.0)) { isFireReady = true; } maxCharge = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); local_5c.x = (float)maxCharge; if ((isCursedEye & 1) != 0) { local_5c.x = local_5c.x * 0.5; } ownerEntity = in_ECX->_owner; isMonstrosLung = (char)unused; if (((ownerEntity != (void *)0x0) && (*(int *)((int)ownerEntity + 0x28) == 1)) && (0 < *(int *)((int)ownerEntity + 0x18f8))) { if ((isMonstrosLung == '\0') && (bVar7 == 0)) { LAB_00a054d2: if (((isCursedEye & 1) == 0) || (*(int *)&in_ECX[1].field_0x14 < 1)) goto LAB_00a054e1; } else { local_4c.x = 5.0; vecResult = &local_5c; if (5.0 <= local_5c.x) { vecResult = &local_4c; } if (*(float *)&in_ECX->field_0x14 < vecResult->x) goto LAB_00a054d2; } isFiring = 0; } LAB_00a054e1: if ((((param_3 == 0) && (isFiring != 0)) && (isFireReady)) && ((((isMonstrosLung != '\0' || (bVar7 != 0)) && (fVar11 = *(float *)&in_ECX->field_0x14, local_5c.x <= fVar11)) || (((isCursedEye & 1) != 0 && (((fVar11 = *(float *)&in_ECX->field_0x14, 0.0 < fVar11 && (4 < *(int *)&in_ECX[1].field_0x14)) || ((fVar11 <= 0.0 && (0 < *(int *)&in_ECX[1].field_0x14)))))))))) { local_4c.x = 1e-05; isFiring = 0; vecResult = &local_4c; if (1e-05 <= fVar11) { vecResult = (Vector *)&in_ECX->field_0x14; } fVar11 = vecResult->x; *(float *)&in_ECX[1].field_0x10 = fVar11; *(float *)&in_ECX->field_0x14 = fVar11; } if ((ownerEntity == (void *)0x0) || ((((*(int *)((int)ownerEntity + 0x28) != 1 && ((*(int *)((int)ownerEntity + 0x28) != 3 || (ownerEntity = *(void **)((int)ownerEntity + 0x410), ownerEntity == (void *)0x0)))) || (iVar3 = *(int *)((int)ownerEntity + 0x140c), iVar3 == 0)) || (!isMarkedAim)))) { fVar11 = *(float *)&in_ECX->field_0x28; fVar9 = *(float *)&in_ECX->field_0x2c; } else { fVar11 = *(float *)(iVar3 + 0x33c); fVar9 = *(float *)(iVar3 + 0x340); } if ((fVar11 == g_vectorZero.x) && (fVar9 == g_vectorZero.y)) { isMarkedAim = false; } else { isMarkedAim = true; } scratchVec.x = fVar11; scratchVec.y = fVar9; if (((param_3 == 0) && (isFiring != 0)) && (isMarkedAim)) { vecResult = Weapon::get_owner_position(in_ECX,&scratchVec); fVar9 = fVar9 - vecResult->y; fVar11 = fVar11 - vecResult->x; fVar9 = sqrtf(fVar9 * fVar9 + fVar11 * fVar11); fVar11 = *(float *)&in_ECX->field_0x14; fVar9 = (fVar9 - 50.0) / 250.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } if (fVar11 <= 0.0) { iVar3 = 1; } else { iVar3 = (int)(fVar9 * 4.0 + 1.0); } if (((bVar7 != 0) && (((local_5c.x - 5.0) * fVar9 + 5.0) - 1.0 < fVar11)) || ((isMonstrosLung != '\0' && (local_5c.x < fVar11)))) { isFiring = 0; } else if ((isCursedEye & 1) != 0) { if (iVar3 <= *(int *)&in_ECX[1].field_0x14) { isFiring = 0; } } } uVar8 = 0; local_4c.x = 1.4013e-45; if (isChargeWeapon) { if (isFiring == 0) { if ((bVar7 == 0) || (*(float *)&in_ECX->field_0x14 <= 0.0)) { if ((isMonstrosLung == '\0') || (*(float *)&in_ECX->field_0x14 < local_5c.x)) { if ((isCursedEye & 1) != 0) { if (0 < *(int *)&in_ECX[1].field_0x14) { uVar8 = 1; } } } else { uVar8 = 1; } } else { uVar8 = 1; } } if (param_3 != 0) { if (uVar8 == 0) { return; } Weapon::SetBlinkTime(in_ECX,1,unused); return; } } else if (isFiring != 0) { if (param_3 != 0) { return; } if (*(float *)&in_ECX->field_0xc <= 0.0 && *(float *)&in_ECX->field_0xc != 0.0) { do { if (7 < uVar8) break; uVar8 = uVar8 + 1; fVar11 = *(float *)&in_ECX->field_0x10 + 1.0 + *(float *)&in_ECX->field_0xc; *(float *)&in_ECX->field_0xc = fVar11; } while (fVar11 < 0.0); } *(undefined4 *)&in_ECX[1].field_0x10 = 0; } aimDirection.x = param_1->x; aimDirection.y = param_1->y; if (param_2 == 0) { aimDirection.x = *(float *)&in_ECX->field_0x20; aimDirection.y = *(float *)&in_ECX->field_0x24; } isMarkedAim = Weapon::IsAxisAligned(in_ECX); fStack_60 = aimDirection.x; if (isMarkedAim == 0) { local_5c.y = aimDirection.y; fVar11 = sqrtf(aimDirection.y * aimDirection.y + aimDirection.x * aimDirection.x); if (fVar11 <= 0.0) { pEVar2 = (Entity_Player *)local_5c.y; } else { aimDirection.y = local_5c.y * (1.0 / fVar11); fStack_60 = (1.0 / fVar11) * fStack_60; pEVar2 = (Entity_Player *)aimDirection.y; aimDirection.x = fStack_60; } } else { vecResult = Vector::ToCardinal(&scratchVec,&aimDirection); fStack_60 = vecResult->x; aimDirection.y = vecResult->y; pEVar2 = (Entity_Player *)aimDirection.y; aimDirection.x = fStack_60; } if (uVar8 == 0) goto LAB_00a05c7f; if (isMonstrosLung != '\0') { Weapon::UpdateHeadChargeAnimation(in_ECX,0xe5,2,&aimDirection,-1.0); fStack_60 = aimDirection.x; pEVar2 = (Entity_Player *)aimDirection.y; } fStack_60 = fStack_60 * 10.0; local_5c.y = (float)pEVar2 * 10.0; if (local_50._0_1_ == '\0') { vecResult = Weapon::get_tear_movement_inheritance(in_ECX,&scratchVec,&aimDirection); local_5c.y = vecResult->y * 0.4 + local_5c.y; fStack_60 = vecResult->x * 0.4 + fStack_60; } fVar11 = sqrtf(fStack_60 * fStack_60 + local_5c.y * local_5c.y); if (fVar11 <= 0.0) { aimDirection.y = local_5c.y; } else { fStack_60 = fStack_60 * (1.0 / fVar11); aimDirection.y = (float)(local_5c.y * (1.0 / fVar11)); } aimDirection.x = fStack_60; Weapon::SetBlinkTime(in_ECX,7 - (int)(*(float *)&in_ECX->field_0x10 * -0.45),unused_00); Weapon::TriggerTearEffects(in_ECX,&aimDirection,1); Weapon::GetMultiShotParams(in_ECX,multiShotParams,unusedArg); fVar11 = 0.0; if (isMonstrosLung != '\0') { fVar11 = 1.68156e-44; } if (bVar7 == 0) { fStack_60 = 1.0; if (isMonstrosLung != '\0') goto LAB_00a05a05; } else { fVar9 = *(float *)&in_ECX[1].field_0x10 + 1.0; if (isMonstrosLung == '\0') { fStack_60 = (fVar9 * 4.0) / (local_5c.x + 1.0); if (fStack_60 <= 0.1) { fStack_60 = 0.1; } if (4.0 <= fStack_60) { fStack_60 = 4.0; } } else { fStack_60 = (fVar9 * 2.5) / (local_5c.x + 1.0); if (fStack_60 <= 0.02) { fStack_60 = 0.02; } if (2.5 <= fStack_60) { fStack_60 = 2.5; } LAB_00a05a05: if (fStack_60 < 1.0) { scratchVec.x = (float)(int)fVar11; local_5c.y = scratchVec.x * fStack_60; dVar12 = ceil((double)local_5c.y); local_5c.y = (float)dVar12; fVar11 = local_4c.x; if (1 < (int)dVar12) { fVar11 = (float)(int)dVar12; } fStack_60 = fStack_60 * (scratchVec.x / (float)(int)fVar11); } } } iVar3 = *(int *)ThreadLocalStoragePointer; if (*(int *)(iVar3 + 0xc) < DAT_00c943b4) { _Init_thread_header(); iVar3 = extraout_ECX_08; if (DAT_00c943b4 == -1) { _atexit((_func_4879 *)&LAB_00b16b00); _Init_thread_footer(); iVar3 = extraout_ECX_09; } } DAT_00c943bc = DAT_00c943b8; uVar4 = 0; if (isMonstrosLung != '\0') { uVar4 = 6; } fire_lasers(&ownerPos,&aimDirection,uVar4,fStack_60,multiShotParams,fVar11,iVar3); uVar4 = extraout_ECX; if (isFireBackward != '\0') { scratchVec.x = -aimDirection.x; scratchVec.y = -aimDirection.y; fire_lasers(&ownerPos,&scratchVec,5,fStack_60,0,fVar11,extraout_ECX); uVar4 = extraout_ECX_00; } if (isFireSideways != '\0') { scratchVec.x = aimDirection.y; scratchVec.y = -aimDirection.x; fire_lasers(&ownerPos,&scratchVec,5,fStack_60,0,fVar11,uVar4); scratchVec.x = -aimDirection.y; scratchVec.y = aimDirection.x; fire_lasers(&ownerPos,&scratchVec,5,fStack_60,0,fVar11,extraout_ECX_01); } for (local_4c.x = (float)(uint)uStack_c; local_4c.x != 0.0; local_4c.x = (float)((int)local_4c.x - 1)) { uVar8 = Random(); fVar9 = (float)((double)(int)uVar8 + __uint_to_double_fixup[-((int)uVar8 >> 0x1f)]) * 2.3283064e-10 * 3.14; scratchVec.x = fVar9 + fVar9; local_5c.y = cos(scratchVec.x); fStack_54 = sin(scratchVec.x); fire_lasers(&ownerPos,&local_5c.y,5,fStack_60,0,fVar11,extraout_ECX_02); } uVar8 = 0; local_4c.x = 0.0; if (DAT_00c943bc - DAT_00c943b8 >> 2 != 0) { local_50 = (float)((uint)local_50 ^ 1); do { *(char *)(*(int *)(DAT_00c943b8 + uVar8 * 4) + 0x4e4) = SUB41(local_50,0); (**(code **)(**(int **)(DAT_00c943b8 + uVar8 * 4) + 0xc))(); uVar8 = uVar8 + 1; } while (uVar8 < (uint)(DAT_00c943bc - DAT_00c943b8 >> 2)); } LAB_00a05c7f: if (isChargeWeapon) { if (isFiring == 0) { if (0 < *(int *)&in_ECX[1].field_0x14) { *(int *)&in_ECX[1].field_0x14 = *(int *)&in_ECX[1].field_0x14 + -1; } *(undefined4 *)&in_ECX->field_0x14 = 0; if ((isMonstrosLung == '\0') || (bVar7 = Weapon::IsItemAnimFinished(in_ECX,0xe5), bVar7 != 0)) { pEVar2 = in_ECX->_owner; if (((pEVar2 == (Entity_Player *)0x0) || (ownerPlayer = pEVar2, pEVar2->_type != 1)) && ((ownerPlayer = (Entity_Player *)0x0, pEVar2 != (Entity_Player *)0x0 && (pEVar2->_type == 3)))) { pEVar2->_chargeBarSprites[5]._numEvents = 0; } else if (ownerPlayer != (Entity_Player *)0x0) { Entity_Player::stop_costume_item_anims(ownerPlayer); } } } else { pEVar2 = *(Entity_Player **)&in_ECX->field_0x14; local_5c.y = (float)pEVar2; if ((bVar7 != 0) || (isMonstrosLung != '\0')) { if (local_5c.x <= (float)pEVar2) { Weapon::UpdateHeadChargeAnimation(in_ECX,0xe5,1,&aimDirection,-1.0); Weapon::UpdateHeadChargeAnimation(in_ECX,0x44,1,&aimDirection,-1.0); iVar3 = extraout_ECX_04; } else { local_5c.y = ((float)pEVar2 / local_5c.x) * 18.0; Weapon::UpdateHeadChargeAnimation(in_ECX,0xe5,0,&aimDirection,local_5c.y); Weapon::UpdateHeadChargeAnimation(in_ECX,0x44,0,&aimDirection,local_5c.y); iVar3 = extraout_ECX_03; if (in_ECX->_owner == (void *)0x0) { local_5c.y = *(float *)&in_ECX->field_0x14 + 1.0; } else { local_5c.y = *(float *)((int)in_ECX->_owner + 0x39c) + *(float *)&in_ECX->field_0x14; } } pEVar2 = (Entity_Player *)local_5c.y; Weapon::SetBlinkTime(in_ECX,8,iVar3); } if ((isCursedEye & 1) != 0) { maxCharge = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); local_4c.x = (float)maxCharge; if (local_4c.x <= *(float *)&in_ECX->field_0x14) { Weapon::UpdateHeadChargeAnimation(in_ECX,0x44,1,&aimDirection,-1.0); Weapon::UpdateHeadChargeAnimation(in_ECX,0x13c,1,&aimDirection,-1.0); iVar3 = extraout_ECX_07; pEVar2 = (Entity_Player *)local_5c.y; } else { iVar3 = extraout_ECX_05; if (in_ECX->_owner != (void *)0x0) { fVar11 = (*(float *)&in_ECX->field_0x14 / local_4c.x) * 18.0; if (*(int *)((int)in_ECX->_owner + 0x28) == 1) { Weapon::UpdateHeadChargeAnimation(in_ECX,0x44,0,&aimDirection,fVar11); fVar11 = 0.0; } Weapon::UpdateHeadChargeAnimation(in_ECX,0x13c,0,&aimDirection,fVar11); iVar3 = extraout_ECX_06; } if (in_ECX->_owner == (void *)0x0) { pEVar2 = (Entity_Player *)(*(float *)&in_ECX->field_0x14 + 1.0); } else { pEVar2 = (Entity_Player *) (*(float *)((int)in_ECX->_owner + 0x39c) + *(float *)&in_ECX->field_0x14); } } Weapon::SetBlinkTime(in_ECX,1,iVar3); *(int *)&in_ECX[1].field_0x14 = (int)((((float)pEVar2 + 1.0) * 5.0) / (local_4c.x + 1.0)); } *(Entity_Player **)&in_ECX->field_0x14 = pEVar2; *(Entity_Player **)&in_ECX[1].field_0x10 = pEVar2; } if (param_2 != 0) { bVar7 = Weapon::IsAxisAligned(in_ECX); if (bVar7 == 0) { vecResult = Weapon::get_aim_direction(in_ECX,&local_4c,&aimDirection); *(float *)&in_ECX->field_0x20 = vecResult->x; *(float *)&in_ECX->field_0x24 = vecResult->y; return; } *(float *)&in_ECX->field_0x20 = aimDirection.x; *(float *)&in_ECX->field_0x24 = aimDirection.y; return; } } return; } //@@ 00a06330 Weapon_Laser::init_laser /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (laser): copies Weapon::get_owner_tear_flags to laser +0x428..+0x434, SetColor vfunc +0x3c with Weapon::get_laser_color, vfunc +0x40 with Weapon::get_damage; Weapon_Laser::Fire after spawning/reusing the laser */ void Weapon_Laser::init_laser(int *param_1) { code *pcVar1; int iVar2; int iVar3; qword qVar4; BitSet128 *pBVar5; ColorMod *pCVar6; Weapon *in_ECX; float fVar7; BitSet128 local_48; ColorMod local_38; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); pBVar5 = Weapon::get_owner_tear_flags(in_ECX,&local_48); iVar2 = *(int *)((int)&pBVar5->_l + 4); qVar4 = pBVar5->_h; iVar3 = *(int *)((int)&pBVar5->_h + 4); param_1[0x10a] = (int)pBVar5->_l; param_1[0x10b] = iVar2; param_1[0x10c] = (int)qVar4; param_1[0x10d] = iVar3; pcVar1 = *(code **)(*param_1 + 0x3c); pCVar6 = Weapon::get_laser_color(in_ECX,&local_38); (*pcVar1)(pCVar6,0xffffffff,0xff,0,1); pcVar1 = *(code **)(*param_1 + 0x40); fVar7 = Weapon::get_damage(in_ECX); (*pcVar1)(fVar7); return; } //@@ 00a063b0 Weapon_Laser::ClearReferences /* DB: vftable */ void Weapon_Laser::ClearReferences(void) { int *piVar1; int *in_ECX; int *local_8; piVar1 = in_ECX + 2; local_8 = in_ECX; if ((int *)in_ECX[2] != (int *)0x0) { (**(code **)(*(int *)in_ECX[2] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } piVar1 = in_ECX + 0x11; if ((int *)in_ECX[0x11] != (int *)0x0) { (**(code **)(*(int *)in_ECX[0x11] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } return; } //@@ 00a06420 Weapon_Laser::fire_lasers /* DB: (out, dir, variant, ..., multishot params*, spreadCount): per multishot (Entity_Player::GetMultiShotPositionVelocity) calls Weapon::fire_laser, or fires spreadCount lasers at random angles, pushing each into the global vector DAT_00c943bc; Weapon_Laser::Fire for main/back/side directions */ Entity_Laser * Weapon_Laser::fire_lasers (float *param_1,Vector *param_2,uint param_3,float param_4,short *param_5,int param_6) { uint rngResult; uint scaleRoll; Weapon *in_ECX; void *ownerPlayer; int spreadLeft; Entity_Laser *pEVar1; float fVar2; float fVar3; float local_50; Weapon *weapon; int shotIndex; int shotCount; float local_40; float spreadBaseX; float spreadBaseY; Entity_Laser *local_34; Vector laserPos; Vector spreadDir; Vector laserDir; float multiShotPosVel; float local_14; float local_10; float local_c; Manager *manager; pEVar1 = (Entity_Laser *)0x0; if (param_5 == (short *)0x0) { shotCount = 1; } else { shotCount = (int)*param_5; } ownerPlayer = in_ECX->_owner; if ((ownerPlayer == (void *)0x0) || ((*(int *)((int)ownerPlayer + 0x28) != 1 && ((*(int *)((int)ownerPlayer + 0x28) != 3 || (ownerPlayer = *(void **)((int)ownerPlayer + 0x410), ownerPlayer == (void *)0x0)))))) { local_40 = 1.0; } else { local_40 = *(float *)((int)ownerPlayer + 0x1464); } shotIndex = 0; if (0 < shotCount) { weapon = in_ECX; do { laserDir.y = param_2->y; local_50 = *param_1; fVar2 = param_1[1]; laserDir.x = param_2->x; laserPos.x = local_50; laserPos.y = fVar2; if (param_5 != (short *)0x0) { Entity_Player::GetMultiShotPositionVelocity (&multiShotPosVel,shotIndex,3,*param_2,local_40,(short)*(undefined4 *)param_5, *(float *)(param_5 + 2),*(float *)(param_5 + 4),*(float *)(param_5 + 6), *(float *)(param_5 + 8),*(int *)(param_5 + 10),*(float *)(param_5 + 0xc), (byte)*(undefined4 *)(param_5 + 0xe),(short)*(undefined4 *)(param_5 + 0x10)); laserPos.x = local_50 + multiShotPosVel; laserDir.y = local_c; laserPos.y = fVar2 + local_14; laserDir.x = local_10; } if (param_6 < 1) { local_34 = Weapon::fire_laser(weapon,&laserPos,param_3,&laserDir,1,1,param_4); if (DAT_00c943bc == DAT_00c943c0) { std::vector::_Emplace_reallocate(); } else { *DAT_00c943bc = local_34; DAT_00c943bc = DAT_00c943bc + 1; } pEVar1 = (Entity_Laser *)&pEVar1->field_0x1; } else { spreadBaseX = laserDir.x * 70.0; spreadBaseY = laserDir.y * 70.0; local_34 = (Entity_Laser *)((int)(&(pEVar1->_sprite)._filename + -3) + param_6); spreadLeft = param_6; do { rngResult = Random(); fVar2 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)] ) * 2.3283064e-10 * 3.14; fVar2 = fVar2 + fVar2; rngResult = Random(); local_50 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; fVar3 = cos(fVar2); fVar3 = fVar3 * 50.0 * local_50 + spreadBaseX; fVar2 = sin(fVar2); local_50 = fVar2 * 50.0 * local_50 + spreadBaseY; spreadDir.x = fVar3; spreadDir.y = local_50; fVar2 = sqrtf(fVar3 * fVar3 + local_50 * local_50); if (0.0 < fVar2) { spreadDir.x = fVar3 * (1.0 / fVar2); spreadDir.y = local_50 * (1.0 / fVar2); } pEVar1 = Weapon::fire_laser(weapon,&laserPos,param_3,&spreadDir,1,1,param_4); fVar2 = sqrtf(local_50 * local_50 + fVar3 * fVar3); pEVar1->_maxDistance = fVar2; rngResult = Random(); scaleRoll = Random(); pEVar1->_scale = (((float)(rngResult & 1) + 0.0) * 0.4 + 0.9 + (float)((double)(int)scaleRoll + __uint_to_double_fixup[-((int)scaleRoll >> 0x1f)]) * 2.3283064e-10 * 0.05) * pEVar1->_scale; Entity_Laser::ResetSpriteScale(pEVar1); rngResult = Random(); pEVar1->_chainedLasers = (rngResult & 1) + 3; pEVar1->_disableInitSound = 5 < param_6; if (DAT_00c943bc == DAT_00c943c0) { FUN_00a06940(); } else { *DAT_00c943bc = pEVar1; DAT_00c943bc = DAT_00c943bc + 1; } manager = g_manager; spreadLeft = spreadLeft + -1; } while (spreadLeft != 0); if (5 < param_6) { local_50 = 1.90577e-43; seed_fart_sound_override((int *)&local_50); SoundEffects::Play(&manager->_sfxManager,(int)local_50,1.0,2,0,1.0,0.0); } pEVar1 = local_34; } shotIndex = shotIndex + 1; } while (shotIndex < shotCount); } return pEVar1; } //@@ 00a06870 Weapon_Laser::GetMaxCharge /* DB: vftable */ float10 Weapon_Laser::GetMaxCharge(void) { uint uVar1; int in_ECX; float fVar2; uVar1 = *(uint *)(in_ECX + 0x34); fVar2 = 1.0; if ((uVar1 >> 3 & 1) != 0) { fVar2 = 4.3; } if ((uVar1 & 1) != 0) { fVar2 = fVar2 * 2.5; } if ((uVar1 >> 1 & 1) != 0) { fVar2 = fVar2 + fVar2; } if (1.0 < fVar2) { return (float10)((*(float *)(in_ECX + 0x10) + 1.0) * fVar2 - 1.0); } return (float10)0; } //@@ 00a068e0 Weapon_Laser::CanTriggerCursedEyeTeleport /* DB: vtable slot 14 of Weapon_Laser; slot name from Weapon */ undefined4 Weapon_Laser::CanTriggerCursedEyeTeleport(void) { int iVar1; int *in_ECX; float10 extraout_ST0; iVar1 = in_ECX[1]; if ((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 1)) { if ((*(int *)(iVar1 + 0x140c) != 0) && (iVar1 = (**(code **)(*in_ECX + 0x30))(), iVar1 != 0)) { return 0; } if ((0.0 < (float)in_ECX[5]) && ((**(code **)(*in_ECX + 0x18))(), (float)in_ECX[5] <= (float)extraout_ST0 && (float)extraout_ST0 != (float)in_ECX[5])) { return 1; } } return 0; } //@@ 00a06940 FUN_00a06940 uint * FUN_00a06940(void *param_1,uint *param_2) { uint uVar1; uint *puVar2; int iVar3; uint *_Dst; uint uVar4; int iVar5; uint uVar6; iVar3 = (int)DAT_00c943bc - (int)DAT_00c943b8 >> 2; iVar5 = (int)param_1 - (int)DAT_00c943b8; if (iVar3 == 0x3fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar4 = DAT_00c943c0 - (int)DAT_00c943b8 >> 2; if (0x3fffffff - (uVar4 >> 1) < uVar4) { uVar6 = 0x3fffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; uVar6 = uVar1; if (uVar1 <= uVar4) { uVar6 = uVar4; } if (0x3fffffff < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar6 * 4); puVar2 = _Dst + (iVar5 >> 2); *puVar2 = *param_2; if (param_1 == DAT_00c943bc) { memmove(_Dst,DAT_00c943b8,(int)DAT_00c943bc - (int)DAT_00c943b8); } else { memmove(_Dst,DAT_00c943b8,(int)param_1 - (int)DAT_00c943b8); memmove(puVar2 + 1,param_1,(int)DAT_00c943bc - (int)param_1); } FID_conflict__Change_array(&DAT_00c943b8,_Dst,uVar1,uVar6); return puVar2; } //@@ 00a06a30 Weapon_Ludovico::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: vftable prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_Ludovico::Fire(void *orbitTear,Vector *direction,byte isShooting,byte isInterpolated) { byte bVar1; uint uVar2; int iVar3; Vector *pVVar4; undefined4 uVar5; TearParams *hitParams; EntityPtr EVar6; BitSet128 *pBVar7; EntityPtr *pEVar8; Entity_Tear *orbitTear; uint rngResult; Entity_Player *extraout_ECX; Entity_Player *extraout_ECX_00; Entity_Player *extraout_ECX_01; Entity_Player *extraout_ECX_02; Entity_Player *pEVar9; Entity_Player *extraout_ECX_03; Entity_Player *extraout_ECX_04; int extraout_ECX_05; EntityPtr EVar10; Entity_Player *player; EntityPtr EVar11; EntityPtr extraout_EDX; qword *allocatedBytesPtr; EntityPtr EVar12; Weapon *weapon; float fVar13; float fVar14; short multiShotParams [18]; BitSet128 notExplosiveFlags; BitSet128 tearFlagsTmp; EntityList_EL local_16c; undefined1 notExplosiveFlags2 [4]; EntityPtr orbitTearsBegin; EntityPtr orbitTearsEnd; EntityPtr orbitTearsCap; void *childTearsBegin; EntityPtr childTearsEnd; EntityPtr local_144; EntityPtr childTearsCap; undefined1 local_13c [8]; Vector VStack_134; Vector local_12c; undefined1 local_124 [8]; Vector local_11c; EntityPtr luck; float shotSpeed; EntityPtr local_10c; Entity_Player *ownerPlayer; Weapon *self; EntityPtr local_100; Vector local_fc; EntityPtr local_f4; EntityPtr local_f0; EntityPtr local_ec; EntityPtr local_e8; TearParams tearParams; undefined1 hitParamsBuf [104]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; qword allocatedBytes; Game *game; void *owner; local_8 = 0xffffffff; puStack_c = &LAB_00b10866; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(hitParamsBuf + 0x78); ExceptionList = &local_10; local_f4 = (EntityPtr)direction; self = orbitTear; local_14 = uVar2; Weapon::Fire(orbitTear,direction,isShooting,isInterpolated); pEVar9 = *(Entity_Player **)((int)orbitTear + 4); if (pEVar9 == (Entity_Player *)0x0) { LAB_00a06a9a: ownerPlayer = (Entity_Player *)0x0; if (pEVar9 != (Entity_Player *)0x0) goto LAB_00a06aa0; local_f0 = (EntityPtr)g_vectorZero.x; local_ec = (EntityPtr)g_vectorZero.y; ownerPlayer = (Entity_Player *)0x0; LAB_00a06b2b: luck = (EntityPtr)0x0; if (pEVar9 != (Entity_Player *)0x0) goto LAB_00a06b3a; LAB_00a06b6d: shotSpeed = 1.0; } else { if (pEVar9->_type == 1) { ownerPlayer = pEVar9; } else { if (pEVar9->_type != 3) goto LAB_00a06a9a; ownerPlayer = *(Entity_Player **)&pEVar9->_isControlsEnabled; } LAB_00a06aa0: local_f0 = (EntityPtr)(pEVar9->_pos).x; local_ec = (EntityPtr)(pEVar9->_pos).y; if (pEVar9->_type == 1) { player = pEVar9; } else if ((pEVar9->_type != 3) || (player = *(Entity_Player **)&pEVar9->_isControlsEnabled, player == (Entity_Player *)0x0 )) goto LAB_00a06b2b; luck = (EntityPtr)player->_luck; LAB_00a06b3a: if ((pEVar9->_type != 1) && ((pEVar9->_type != 3 || (pEVar9 = *(Entity_Player **)&pEVar9->_isControlsEnabled, pEVar9 == (Entity_Player *)0x0)))) goto LAB_00a06b6d; shotSpeed = pEVar9->_shotspeed; } player = ownerPlayer; local_12c.y = (float)((int)orbitTear + 0x44); EVar6 = *(EntityPtr *)((int)orbitTear + 0x44); local_10c = EVar6; if ((EVar6 == (EntityPtr)0x0) || (*(int *)((int)EVar6 + 0x28) != 2)) { if (isInterpolated != 0) { ExceptionList = local_10; return; } if (EVar6 != (EntityPtr)0x0) { (**(code **)(*(int *)EVar6 + 0x28))(uVar2); } TearParams::constructor(&tearParams); weapon = self; if (player != (Entity_Player *)0x0) { owner = self->_owner; if ((owner == (void *)0x0) || (*(int *)((int)owner + 0x28) != 1)) { iVar3 = 0; } else { iVar3 = (int)*(char *)((int)owner + 0x1578); } hitParams = (TearParams *) Entity_Player::GetTearHitParams(hitParamsBuf,8,0x3f800000,iVar3,owner); TearParams::operator_(&tearParams,hitParams); } uVar2 = Random(); local_11c.x = (float)local_f0 + 0.0; local_11c.y = (float)local_ec + 5.0; EVar6 = (EntityPtr) Game::Spawn(g_game,2,tearParams._tearVariant,&local_11c,&g_vectorZero,weapon->_owner,0, uVar2); if ((EVar6 == (EntityPtr)0x0) || (*(int *)((int)EVar6 + 0x28) != 2)) { EVar6 = (EntityPtr)0x0; } VStack_134.y = (float)weapon->_owner; EVar11 = (EntityPtr)((int)EVar6 + 0x3bc); if (*(EntityPtr *)EVar11 != (EntityPtr)0x0) { local_fc.y = (float)EVar11; std::multiset::erase(&local_fc.y); } *(float *)EVar11 = VStack_134.y; if ((EntityPtr)VStack_134.y != (EntityPtr)0x0) { std::multiset::insert(EVar11); } *(undefined4 *)((int)EVar6 + 0x410) = 0xc2200000; fVar13 = Entity_Tear::get_height_offset_y((Entity_Tear *)EVar6,-40.0); game = g_game; *(float *)((int)EVar6 + 0x350) = fVar13; if (*(int *)((int)game->_room + 8) == 0x10) { *(undefined4 *)((int)EVar6 + 0x350) = 0xc1900000; } (**(code **)(*(int *)EVar6 + 0x40))(tearParams._tearDamage); pBVar7 = BitSet128::operator_or(&tearFlagsTmp,&tearParams._flags,&g_tearFlagLudovico); Entity_Tear::SetTearFlags((Entity_Tear *)EVar6,*pBVar7); (**(code **)(*(int *)EVar6 + 0x3c))(&tearParams._tearColor,0xffffffff,0xff,0,1); fVar13 = sqrtf(tearParams._tearDamage); fVar13 = fVar13 * 0.15 + tearParams._tearDamage * 0.04 + 1.5; if (fVar13 <= 0.01) { fVar13 = 0.01; } *(float *)((int)EVar6 + 0x424) = fVar13; *(float *)((int)EVar6 + 0x420) = fVar13; Entity_Tear::ResetSpriteScale((Entity_Tear *)EVar6); (**(code **)(*(int *)EVar6 + 0xc))(); fVar13 = local_12c.y; if (*(EntityPtr *)local_12c.y == EVar6) { ExceptionList = local_10; return; } if (*(EntityPtr *)local_12c.y != (EntityPtr)0x0) { local_fc.y = local_12c.y; std::multiset::erase(&local_fc.y); } *(EntityPtr *)fVar13 = EVar6; std::multiset::insert(fVar13); ExceptionList = local_10; return; } if (isInterpolated != 0) { ExceptionList = local_10; return; } if (isShooting != 0) { local_fc.x = *(float *)local_f4; local_100 = *(EntityPtr *)((int)local_f4 + 4); local_fc.y = (float)local_100; local_e8 = (EntityPtr)local_fc.x; if (1.0 < local_fc.x * local_fc.x + (float)local_100 * (float)local_100) { Vector::Normalize(&local_fc); local_e8 = (EntityPtr)local_fc.x; pEVar9 = extraout_ECX; } local_100 = (EntityPtr)local_fc.y; local_fc.x = (float)local_e8; if (player != (Entity_Player *)0x0) { bVar1 = Entity_Player::HasCollectible(player,0x166,0); pEVar9 = extraout_ECX_00; if (bVar1 != 0) { bVar1 = Entity_Player::HasCollectible(player,0xf5,0); pEVar9 = extraout_ECX_01; if (bVar1 == 0) { local_f0 = (EntityPtr)cos(0.7853982); fVar13 = sin(0.7853982); fVar14 = (float)local_e8 * fVar13; local_e8 = (EntityPtr)((float)local_e8 * (float)local_f0 - fVar13 * (float)local_100); local_100 = (EntityPtr)((float)local_f0 * (float)local_100 + fVar14); pEVar9 = extraout_ECX_02; } } } fVar13 = *(float *)((int)EVar6 + 0x36c); if (fVar13 != 0.0) { *(float *)((int)EVar6 + 0x364) = (*(float *)((int)EVar6 + 0x39c) * (float)local_100 * shotSpeed * 3.0) / fVar13 + *(float *)((int)EVar6 + 0x364); *(float *)((int)EVar6 + 0x360) = (*(float *)((int)EVar6 + 0x39c) * (float)local_e8 * shotSpeed * 3.0) / fVar13 + *(float *)((int)EVar6 + 0x360); } } weapon = self; if (self->_owner != (Entity *)0x0) { iVar3 = Entity::GetIntervalTicks(self->_owner,*(float *)&self->field_0x10,0.0); pEVar9 = extraout_ECX_03; if (iVar3 != 0) { iVar3 = *(int *)&weapon[1].field_0xc; if (iVar3 == 0) { LAB_00a06df7: pVVar4 = MusicManager::RandomVector(&local_fc); } else { VStack_134.x = *(float *)(iVar3 + 0x33c); VStack_134.y = *(float *)(iVar3 + 0x340); local_fc.x = *(float *)((int)weapon->_owner + 0x33c); local_fc.y = *(float *)((int)weapon->_owner + 0x340); bVar1 = Vector::operator_ne(&VStack_134,&local_fc); if (bVar1 == 0) goto LAB_00a06df7; local_fc.x = *(float *)(*(int *)&weapon[1].field_0xc + 0x33c) - *(float *)((int)weapon->_owner + 0x33c); local_fc.y = *(float *)(*(int *)&weapon[1].field_0xc + 0x340) - *(float *)((int)weapon->_owner + 0x340); pVVar4 = Vector::Normalized(&local_fc,&local_11c); } Weapon::TriggerTearEffects(weapon,pVVar4,1); pEVar9 = extraout_ECX_04; } } Weapon::GetMultiShotParams(weapon,multiShotParams,(int)pEVar9); local_e8 = (EntityPtr)(multiShotParams[0] + -1); local_100 = (EntityPtr)0x0; childTearsBegin = (void *)0x0; if ((int)local_e8 < 0) { local_e8 = (EntityPtr)0x0; } EVar11 = (EntityPtr)0x0; local_ec = (EntityPtr)0x0; childTearsEnd = (EntityPtr)0x0; childTearsCap = (EntityPtr)0x0; local_144 = (EntityPtr)0x0; local_8 = 0; local_f4 = *(EntityPtr *)((int)EVar6 + 0x3c0); if (local_f4 != (EntityPtr)0x0) { do { if (childTearsEnd == EVar11) { std::vector::_Emplace_reallocate(childTearsEnd,&local_f4); EVar11 = local_144; } else { *(EntityPtr *)childTearsEnd = local_f4; childTearsEnd = (EntityPtr)((int)childTearsEnd + 4); } local_f4 = *(EntityPtr *)((int)local_f4 + 0x3c0); } while (local_f4 != (EntityPtr)0x0); local_100 = (EntityPtr)childTearsBegin; childTearsCap = EVar11; local_ec = childTearsEnd; } EVar10 = local_ec; EVar11 = local_100; local_f4 = (EntityPtr)((int)local_ec - (int)local_100 >> 2); childTearsBegin = (void *)local_100; childTearsEnd = local_ec; if ((uint)local_f4 < (uint)local_e8) { TearParams::constructor(&tearParams); EVar11 = extraout_EDX; if (ownerPlayer != (Entity_Player *)0x0) { uVar5 = FUN_009f57f0(); hitParams = (TearParams *) Entity_Player::GetTearHitParams (hitParamsBuf,8,0x3f800000,uVar5,*(undefined4 *)(extraout_ECX_05 + 4)); TearParams::operator_(&tearParams,hitParams); EVar11 = local_e8; } local_e8 = (EntityPtr)((int)EVar11 - (int)local_f4); if (0 < (int)local_e8) { local_ec = (EntityPtr)((int)EVar6 + 0xf0); local_f4 = (EntityPtr)0x3c23d70a; do { uVar2 = Random(); local_fc.x = *(float *)((int)EVar6 + 0x33c) + 0.0; local_fc.y = *(float *)((int)EVar6 + 0x340) + 5.0; EVar6 = (EntityPtr) Game::Spawn(g_game,2,tearParams._tearVariant,&local_fc,&g_vectorZero,self->_owner,4, uVar2); if ((EVar6 == (EntityPtr)0x0) || (*(int *)((int)EVar6 + 0x28) != 2)) { EVar6 = (EntityPtr)0x0; } if (*(EntityPtr *)((int)EVar6 + 0x3bc) != (EntityPtr)0x0) { local_f0 = (EntityPtr)((int)EVar6 + 0x3bc); std::multiset::erase(&local_f0); } *(EntityPtr *)((int)EVar6 + 0x3bc) = local_10c; std::multiset::insert((EntityPtr *)((int)EVar6 + 0x3bc)); *(float *)((int)EVar6 + 0x410) = -40.0; fVar13 = Entity_Tear::get_height_offset_y((Entity_Tear *)EVar6,-40.0); game = g_game; *(float *)((int)EVar6 + 0x350) = fVar13; if (*(int *)((int)game->_room + 8) == 0x10) { *(float *)((int)EVar6 + 0x350) = -18.0; } (**(code **)(*(int *)EVar6 + 0x40))(*(int *)((int)local_10c + 0x388)); pBVar7 = BitSet128::__bnot(&g_tearFlagExplosive,(BitSet128 *)notExplosiveFlags2); local_16c._0_4_ = *(int *)((int)local_10c + 0x428); local_16c._data = *(void **)((int)local_10c + 0x42c); local_16c._capacity = *(int *)((int)local_10c + 0x430); local_16c._size = *(int *)((int)local_10c + 0x434); pBVar7 = BitSet128::operator_and((BitSet128 *)local_124,(BitSet128 *)&local_16c,pBVar7); Entity_Tear::SetTearFlags((Entity_Tear *)EVar6,*pBVar7); (**(code **)(*(int *)EVar6 + 0x3c))(local_ec,0xffffffff,0xff,0,1); local_f0 = (EntityPtr)(*(float *)((int)local_10c + 0x420) * 0.5); pEVar8 = &local_f0; if ((float)local_f0 <= 0.01) { pEVar8 = &local_f4; } EVar11 = *pEVar8; *(EntityPtr *)((int)EVar6 + 0x424) = EVar11; *(EntityPtr *)((int)EVar6 + 0x420) = EVar11; Entity_Tear::ResetSpriteScale((Entity_Tear *)EVar6); *(int *)((int)EVar6 + 0x184) = 0; local_f0 = EVar6; if (EVar10 == childTearsCap) { std::vector::_Emplace_reallocate(EVar10,&local_f0); childTearsCap = local_144; } else { *(EntityPtr *)EVar10 = EVar6; childTearsEnd = (EntityPtr)((int)EVar10 + 4); } local_e8 = (EntityPtr)((int)local_e8 + -1); EVar10 = childTearsEnd; EVar6 = local_10c; } while (local_e8 != (EntityPtr)0x0); local_100 = (EntityPtr)childTearsBegin; } LAB_00a07202: EVar12 = (EntityPtr)((int)EVar10 - (int)local_100 >> 2); local_e8 = (EntityPtr)0x0; EVar10 = local_100; EVar11 = EVar6; if (EVar12 != (EntityPtr)0x0) { do { local_ec = *(EntityPtr *)((int)EVar10 + (int)local_e8 * 4); local_f0 = (EntityPtr)((int)EVar11 + 0x3c0); if (*(EntityPtr *)local_f0 != (EntityPtr)0x0) { local_12c.y = (float)local_f0; std::multiset::erase(&local_12c.y); EVar10 = local_100; } *(EntityPtr *)local_f0 = local_ec; if (local_ec != (EntityPtr)0x0) { std::multiset::insert(local_f0); EVar10 = local_100; } EVar11 = *(EntityPtr *)((int)EVar10 + (int)local_e8 * 4); if (g_game->_frameCount == *(int *)((int)EVar11 + 0x328)) { (**(code **)(*(int *)EVar11 + 0xc))(); EVar11 = *(EntityPtr *)((int)local_100 + (int)local_e8 * 4); EVar10 = local_100; } local_e8 = (EntityPtr)((int)local_e8 + 1); } while ((uint)local_e8 < (uint)EVar12); } } else if ((uint)local_e8 < (uint)local_f4) { EVar6 = local_e8; do { local_f0 = luck; (**(code **)(**(int **)((int)EVar11 + (int)EVar6 * 4) + 0x28))(); EVar6 = (EntityPtr)((int)EVar6 + 1); } while ((uint)EVar6 < (uint)local_f4); luck = local_f0; EVar11 = (EntityPtr)((int)EVar11 + (int)local_e8 * 4); EVar10 = local_ec; EVar6 = local_10c; if (EVar11 != local_ec) { EVar10 = EVar11; childTearsEnd = EVar11; } goto LAB_00a07202; } pEVar9 = ownerPlayer; if (ownerPlayer != (Entity_Player *)0x0) { bVar1 = Entity_Player::HasCollectible(ownerPlayer,0xe5,0); if (bVar1 != 0) { EVar11 = (EntityPtr)0x0; local_f0 = (EntityPtr)0x0; orbitTearsBegin = (EntityPtr)0x0; orbitTearsEnd = (EntityPtr)0x0; local_ec = (EntityPtr)0x0; orbitTearsCap = (EntityPtr)0x0; local_8._0_1_ = 1; EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_16c,2,-1,5,0,0); local_8 = CONCAT31(local_8._1_3_,2); local_e8 = (EntityPtr)local_16c._size; if ((EntityPtr)local_16c._size == (EntityPtr)0x0) { EVar10 = (EntityPtr)0x0; } else { EVar10 = (EntityPtr)0x0; local_f4 = (EntityPtr)local_16c._data; do { if (*(EntityPtr *)(*(int *)local_f4 + 0x3bc) == EVar6) { if (EVar11 == EVar10) { std::vector::_Emplace_reallocate(EVar11,local_f4); local_ec = orbitTearsCap; EVar10 = orbitTearsCap; EVar11 = orbitTearsEnd; } else { *(int *)EVar11 = *(int *)local_f4; orbitTearsEnd = (EntityPtr)((int)EVar11 + 4); EVar11 = orbitTearsEnd; } } local_f4 = (EntityPtr)((int)local_f4 + 4); local_e8 = (EntityPtr)((int)local_e8 + -1); } while (local_e8 != (EntityPtr)0x0); local_f0 = orbitTearsBegin; local_e8 = (EntityPtr)0x0; EVar10 = orbitTearsBegin; } weapon = self; if ((int)EVar11 - (int)EVar10 < 4) { owner = self->_owner; if ((owner == (void *)0x0) || (*(int *)((int)owner + 0x28) != 1)) { iVar3 = 0; } else { iVar3 = (int)*(char *)((int)owner + 0x1578); } Entity_Player::GetTearHitParams(&tearParams,8,0x3f800000,iVar3,owner); local_fc.y = 0.01; local_10c = (EntityPtr)0x5; do { uVar2 = Random(); fVar13 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_12c.y = fVar13 + fVar13; VStack_134.y = sin(local_12c.y); uVar2 = Random(); local_e8 = (EntityPtr) ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 20.0 + 5.0); fVar13 = cos(local_12c.y); local_f4 = (EntityPtr)(fVar13 * (float)local_e8); local_e8 = (EntityPtr)((float)local_e8 * VStack_134.y); uVar2 = Random(); local_11c.x = (float)local_f4 + *(float *)((int)EVar6 + 0x33c); local_11c.y = (float)local_e8 + *(float *)((int)EVar6 + 0x340); orbitTear = (Entity_Tear *) Game::Spawn(g_game,2,tearParams._tearVariant,&local_11c,&g_vectorZero, weapon->_owner,5,uVar2); if ((orbitTear == (Entity_Tear *)0x0) || (orbitTear->_type != 2)) { orbitTear = (Entity_Tear *)0x0; } (orbitTear->_parentOffset).x = (float)local_f4; (orbitTear->_parentOffset).y = (float)local_e8; if (orbitTear->_parent != (EntityPtr)0x0) { VStack_134.y = (float)&orbitTear->_parent; std::multiset::erase(&VStack_134.y); } orbitTear->_parent = EVar6; std::multiset::insert(&orbitTear->_parent); orbitTear->_height = -40.0; fVar13 = Entity_Tear::get_height_offset_y(orbitTear,-40.0); game = g_game; (orbitTear->_posOffset).y = fVar13; if (*(int *)((int)game->_room + 8) == 0x10) { (orbitTear->_posOffset).y = -18.0; } (**(code **)(*(int *)orbitTear + 0x40))(*(int *)((int)EVar6 + 0x388)); pBVar7 = BitSet128::__bnot(&g_tearFlagExplosive,¬ExplosiveFlags); local_13c._0_4_ = *(int *)((int)EVar6 + 0x428); local_13c._4_4_ = *(int *)((int)EVar6 + 0x42c); VStack_134.x = *(float *)((int)EVar6 + 0x430); VStack_134.y = *(float *)((int)EVar6 + 0x434); pBVar7 = BitSet128::operator_and(&tearFlagsTmp,(BitSet128 *)local_13c,pBVar7); Entity_Tear::SetTearFlags(orbitTear,*pBVar7); (**(code **)(*(int *)orbitTear + 0x3c))((int *)((int)EVar6 + 0xf0),0xffffffff,0xff,0,1); uVar2 = Random(); VStack_134.y = ((float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)] ) * 2.3283064e-10 * 0.75 + 0.5) * *(float *)((int)EVar6 + 0x420); pVVar4 = &VStack_134; if (VStack_134.y <= 0.01) { pVVar4 = &local_fc; } fVar13 = pVVar4->y; orbitTear->_baseScale = fVar13; orbitTear->_fScale = fVar13; Entity_Tear::ResetSpriteScale(orbitTear); local_10c = (EntityPtr)((int)local_10c + -1); orbitTear->_entityGridCollisionClass = 0; weapon = self; } while (local_10c != (EntityPtr)0x0); } if (local_16c._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocatedBytesPtr = &g_allocatedBytesNoHeap; } else { allocatedBytesPtr = (qword *)((int)g_mainHeap + 0x30); } if ((EntityPtr)local_16c._data != (EntityPtr)0x0) { uVar2 = *(uint *)((int)local_16c._data + -4); allocatedBytes = *allocatedBytesPtr; *(uint *)allocatedBytesPtr = (uint)*allocatedBytesPtr - uVar2; *(uint *)((int)allocatedBytesPtr + 4) = *(uint *)((int)allocatedBytesPtr + 4) - (uint)((uint)allocatedBytes < uVar2); free((uint *)((int)local_16c._data + -4)); } } local_8 = local_8 & 0xffffff00; if (local_f0 != (EntityPtr)0x0) { uVar2 = (int)local_ec - (int)local_f0 & 0xfffffffc; EVar11 = local_f0; if (0xfff < uVar2) { EVar11 = *(EntityPtr *)((int)local_f0 + -4); uVar2 = uVar2 + 0x23; if (0x1f < ((int)local_f0 - (int)EVar11) - 4U) goto LAB_00a07ae8; } operator_delete((void *)EVar11,uVar2); } pEVar9 = ownerPlayer; } iVar3 = Entity::GetIntervalTicks((Entity *)pEVar9,*(float *)&self->field_0x10,0.0); if (iVar3 != 0) { iVar3 = 0xa07781; bVar1 = Entity_Player::HasCollectible(pEVar9,0x57,0); if ((bVar1 != 0) && ((local_fc.y = (float)__ftoui3(), (EntityPtr)local_fc.y == (EntityPtr)0x0 || (uVar2 = Random(), uVar2 % (uint)local_fc.y == 0)))) { local_11c.x = shotSpeed * 10.0; VStack_134.x = *(float *)((int)EVar6 + 0x33c); VStack_134.y = *(float *)((int)EVar6 + 0x340); local_11c.y = shotSpeed * 0.0; local_fc.y = local_11c.x; local_ec = (EntityPtr)local_11c.y; Weapon::fire_tear(self,&VStack_134,&local_11c,6,iVar3,1.0,0.0); VStack_134.y = shotSpeed * -10.0; local_12c.x = *(float *)((int)EVar6 + 0x33c); local_12c.y = *(float *)((int)EVar6 + 0x340); local_11c.y = (float)local_ec; local_11c.x = VStack_134.y; Weapon::fire_tear(self,&local_12c,&local_11c,6,iVar3,1.0,0.0); local_fc.x = *(float *)((int)EVar6 + 0x33c); local_11c.x = (float)local_ec; local_11c.y = local_fc.y; local_fc.y = *(float *)((int)EVar6 + 0x340); Weapon::fire_tear(self,&local_fc,&local_11c,6,iVar3,1.0,0.0); local_fc.x = *(float *)((int)EVar6 + 0x33c); local_fc.y = *(float *)((int)EVar6 + 0x340); local_11c.x = (float)local_ec; local_11c.y = VStack_134.y; Weapon::fire_tear(self,&local_fc,&local_11c,6,iVar3,1.0,0.0); } iVar3 = 0xa079a4; bVar1 = Entity_Player::HasCollectible(pEVar9,0x37,0); if ((bVar1 != 0) && ((uVar2 = __ftoui3(), uVar2 == 0 || (rngResult = Random(), rngResult % uVar2 == 0)))) { uVar2 = Random(); shotSpeed = shotSpeed * 10.0; fVar13 = (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_fc.y = fVar13 + fVar13; fVar13 = cos(local_fc.y); local_11c.x = fVar13 * shotSpeed; fVar13 = sin(local_fc.y); VStack_134.x = *(float *)((int)EVar6 + 0x33c); local_11c.y = fVar13 * shotSpeed; VStack_134.y = *(float *)((int)EVar6 + 0x340); Weapon::fire_tear(self,&VStack_134,&local_11c,6,iVar3,1.0,0.0); } } } if (local_100 != (EntityPtr)0x0) { uVar2 = (int)childTearsCap - (int)local_100 & 0xfffffffc; EVar6 = local_100; if (0xfff < uVar2) { EVar6 = *(EntityPtr *)((int)local_100 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)local_100 + (-4 - (int)EVar6))) { LAB_00a07ae8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)EVar6,uVar2); } ExceptionList = local_10; return; } //@@ 00a07d50 Weapon_MonstrosLung::Fire /* WARNING: Restarted to delay deadcode elimination for space: stack */ /* ZHL [exact] void Fire(const Vector& shootPos, bool IsShooting, bool IsInterpolated); prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_MonstrosLung::Fire (Weapon_MonstrosLung *player,Vector *direction,byte isShooting,byte isInterpolated) { bool bVar1; bool bVar2; byte bVar3; byte bVar4; Vector *pVVar5; uint rngResult; void *ownerPlayer; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int unused; int extraout_ECX_02; int extraout_ECX_03; int extraout_ECX_04; Entity_Player *player; Entity_Player *owner; int iVar6; float10 fVar7; float fVar8; float fVar9; undefined1 auVar10 [12]; undefined1 auVar11 [16]; float fVar12; undefined1 auVar13 [12]; undefined1 auVar14 [12]; undefined1 auVar15 [12]; double dVar16; float baseVelocityX; float baseVelocityY; float local_50; float local_4c; float local_48; float local_44; float targetY; Vector aimDirection; Vector scratchVec; short multiShotParams [10]; int laneCount; float spreadAngle; char isShootingBackwards; char isShootingSideways; ushort randomDirTearCount; Manager *manager; Weapon::Fire((Weapon *)player,direction,isShooting,isInterpolated); if (isInterpolated != 0) { return; } owner = player->_owner; if (owner == (Entity_Player *)0x0) { LAB_00a07dae: owner = (Entity_Player *)0x0; LAB_00a07db0: bVar1 = false; } else { if (owner->_type != 1) { if (owner->_type != 3) goto LAB_00a07dae; owner = *(Entity_Player **)&owner->_isControlsEnabled; if (owner != (Entity_Player *)0x0) goto LAB_00a07d95; goto LAB_00a07db0; } LAB_00a07d95: bVar3 = Entity_Player::HasCollectible(owner,0x18a,0); if (bVar3 == 0) goto LAB_00a07db0; bVar1 = true; } bVar3 = (byte)player->_modifiers & 1; if ((((uint)player->_modifiers >> 7 & 1) != 0) || (fVar9 = *(float *)&player->field_0x10, fVar9 <= 0.0)) { fVar9 = *(float *)&player->field_0x10; bVar2 = true; } else { bVar2 = false; } auVar10 = ZEXT812(0x3a83126f); if (auVar10._0_4_ <= fVar9) { auVar10._4_8_ = auVar10._4_8_; auVar10._0_4_ = fVar9; } local_48 = auVar10._0_4_; aimDirection.x = *(float *)&player->field_0x20; aimDirection.y = *(float *)&player->field_0x24; bVar4 = Weapon::IsAxisAligned((Weapon *)player); if (bVar4 == 0) { pVVar5 = Weapon::get_aim_direction((Weapon *)player,&scratchVec,&aimDirection); fVar9 = pVVar5->x; fVar12 = pVVar5->y; fVar8 = sqrtf(fVar9 * fVar9 + fVar12 * fVar12); if (0.0 < fVar8) { fVar9 = fVar9 * (1.0 / fVar8); fVar12 = fVar12 * (1.0 / fVar8); } aimDirection.x = fVar9; aimDirection.y = fVar12; } else { pVVar5 = Vector::ToCardinal(&scratchVec,&aimDirection); aimDirection.x = pVVar5->x; aimDirection.y = pVVar5->y; } ownerPlayer = player->_owner; if ((((ownerPlayer == (void *)0x0) || ((*(int *)((int)ownerPlayer + 0x28) != 1 && ((*(int *)((int)ownerPlayer + 0x28) != 3 || (ownerPlayer = *(void **)((int)ownerPlayer + 0x410), ownerPlayer == (void *)0x0)))))) || (iVar6 = *(int *)((int)ownerPlayer + 0x140c), iVar6 == 0)) || (!bVar1)) { local_44 = *(float *)&player->field_0x28; targetY = *(float *)&player->field_0x2c; } else { local_44 = *(float *)(iVar6 + 0x33c); targetY = *(float *)(iVar6 + 0x340); } if ((local_44 != g_vectorZero.x) || (bVar1 = false, targetY != g_vectorZero.y)) { bVar1 = true; } fVar7 = (float10)(**(code **)(*(int *)player + 0x18))(); local_50 = (float)fVar7; if (isShooting != 0) { if (bVar1) { if (bVar3 != 0) { pVVar5 = Weapon::get_owner_position((Weapon *)player,&scratchVec); fVar9 = targetY - pVVar5->y; fVar12 = local_44 - pVVar5->x; fVar9 = sqrtf(fVar9 * fVar9 + fVar12 * fVar12); fVar9 = (fVar9 - 50.0) / 250.0; if (fVar9 <= 0.0) { fVar9 = 0.0; } if (1.0 <= fVar9) { fVar9 = 1.0; } local_50 = (local_48 * 2.5 - local_48 * 0.25) * fVar9 + local_48 * 0.25; } if (local_50 <= *(float *)&player->field_0x14) goto LAB_00a0811a; } if (bVar2) { auVar13 = ZEXT812(0x3a83126f); if (auVar13._0_4_ <= local_50) { auVar13._4_8_ = auVar13._4_8_; auVar13._0_4_ = local_50; } if (auVar13._0_4_ <= *(float *)&player->field_0x14) goto LAB_00a0811a; } if (local_50 <= *(float *)&player->field_0x14) { Weapon::UpdateHeadChargeAnimation((Weapon *)player,0xe5,1,direction,-1.0); iVar6 = extraout_ECX_01; } else { if (player->_owner == (void *)0x0) { fVar9 = 1.0; } else { fVar9 = *(float *)((int)player->_owner + 0x39c); } fVar9 = *(float *)&player->field_0x14 + fVar9; *(float *)&player->field_0x14 = fVar9; Weapon::UpdateHeadChargeAnimation((Weapon *)player,0xe5,0,direction,(fVar9 / local_50) * 18.0); manager = g_manager; iVar6 = extraout_ECX; if (local_50 <= *(float *)&player->field_0x14) { local_48 = 1.25556e-42; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&manager->_sfxManager,(int)local_48,1.0,2,0,1.0,0.0); iVar6 = extraout_ECX_00; } } Weapon::SetBlinkTime((Weapon *)player,1,iVar6); *(float *)&player->field_0x20 = direction->x; *(float *)&player->field_0x24 = direction->y; return; } LAB_00a0811a: auVar14 = ZEXT812(0x3a83126f); if (auVar14._0_4_ <= local_48) { auVar14._4_8_ = auVar14._4_8_; auVar14._0_4_ = local_48; } local_4c = auVar14._0_4_; if (bVar3 != 0) { auVar15 = ZEXT812(0x3f800000); if (local_48 <= auVar15._0_4_) { auVar15._4_8_ = auVar15._4_8_; auVar15._0_4_ = local_48; } local_4c = auVar15._0_4_; } if (local_4c <= *(float *)&player->field_0x14) { Weapon::UpdateHeadChargeAnimation((Weapon *)player,0xe5,2,&aimDirection,-1.0); if (local_50 <= *(float *)&player->field_0x14) { local_50 = *(float *)&player->field_0x14; } if (local_4c <= local_50) { local_50 = local_4c; } unused = 7 - (int)(local_50 * -0.45); iVar6 = 0xb; if (0xb < unused) { iVar6 = unused; } Weapon::SetBlinkTime((Weapon *)player,iVar6,unused); baseVelocityX = aimDirection.x * 10.0; baseVelocityY = aimDirection.y * 10.0; pVVar5 = Weapon::get_tear_movement_inheritance((Weapon *)player,&scratchVec,&aimDirection); baseVelocityX = baseVelocityX + pVVar5->x; baseVelocityY = baseVelocityY + pVVar5->y; iVar6 = extraout_ECX_02; if (owner != (Entity_Player *)0x0) { bVar4 = Entity_Player::HasCollectible(owner,0x95,0); iVar6 = extraout_ECX_03; if (bVar4 != 0) { rngResult = Random(); fVar9 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.7; baseVelocityX = baseVelocityX * fVar9; baseVelocityY = baseVelocityY * fVar9; iVar6 = extraout_ECX_04; } } local_50 = 1.0; if (bVar3 != 0) { local_50 = *(float *)&player->field_0x14 / local_48; if (local_50 <= 0.02) { local_50 = 0.02; } if (2.5 <= local_50) { local_50 = 2.5; } local_50 = local_50 * 0.8; } Weapon::GetMultiShotParams((Weapon *)player,multiShotParams,iVar6); local_4c = 1.68156e-44; if (owner != (Entity_Player *)0x0) { bVar3 = Entity_Player::HasCollectible(owner,0x213,0); if (bVar3 != 0) { bVar3 = Entity_Player::HasCollectible(owner,0x76,0); local_4c = (float)((uint)(bVar3 == 0) * 2 + 5); } bVar3 = Entity_Player::HasCollectible(owner,0x34,0); if (bVar3 != 0) { local_4c = 7.00649e-45; } } if (local_50 < 1.0) { local_44 = (float)(int)local_4c; local_48 = local_44 * local_50; dVar16 = ceil((double)local_48); local_48 = (float)dVar16; local_4c = (float)1; if (1 < (int)dVar16) { local_4c = (float)(int)dVar16; } } Weapon::TriggerTearEffects((Weapon *)player,&aimDirection,(int)local_4c); local_48 = 0.0; iVar6 = (int)local_4c + (int)(((float)(int)local_4c / 5.0) * (float)(int)multiShotParams[0]); if (0 < laneCount) { do { fVar9 = 0.0; if (1 < laneCount) { fVar9 = -spreadAngle; local_44 = (float)laneCount - 1.0; if (local_44 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar12 = ((float)(int)local_48 - 0.0) / (local_44 - 0.0); auVar11 = ZEXT416((uint)fVar12); if (fVar12 <= 0.0) { auVar11 = ZEXT816(0); } if (1.0 <= auVar11._0_4_) { auVar11._0_4_ = 0x3f800000; } fVar9 = (spreadAngle - fVar9) * auVar11._0_4_ + fVar9; } local_44 = fVar9 * 0.017453292; fVar9 = cos(local_44); fVar12 = sin(local_44); scratchVec.y = fVar9 * baseVelocityY + fVar12 * baseVelocityX; scratchVec.x = fVar9 * baseVelocityX - fVar12 * baseVelocityY; FireBurst(&scratchVec,iVar6); local_48 = (float)((int)local_48 + 1); } while ((int)local_48 < laneCount); } if (isShootingBackwards != '\0') { scratchVec.x = -baseVelocityX; scratchVec.y = -baseVelocityY; FireBurst(&scratchVec,iVar6); } if (isShootingSideways != '\0') { scratchVec.x = -baseVelocityY; scratchVec.y = baseVelocityX; FireBurst(&scratchVec,iVar6); scratchVec.x = baseVelocityY; scratchVec.y = -baseVelocityX; FireBurst(&scratchVec,iVar6); } manager = g_manager; for (local_48 = (float)(uint)randomDirTearCount; g_manager = manager, local_48 != 0.0; local_48 = (float)((int)local_48 - 1)) { rngResult = Random(); local_44 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; fVar9 = cos(local_44); fVar12 = sin(local_44); scratchVec.y = fVar9 * baseVelocityY + fVar12 * baseVelocityX; scratchVec.x = fVar9 * baseVelocityX - fVar12 * baseVelocityY; FireBurst(&scratchVec,iVar6); manager = g_manager; } local_48 = 1.24856e-42; seed_fart_sound_override((int *)&local_48); SoundEffects::Play(&manager->_sfxManager,(int)local_48,1.0,2,0,1.0,0.0); } *(undefined4 *)&player->field_0x14 = 0; bVar3 = Weapon::IsItemAnimFinished((Weapon *)player,0xe5); if (bVar3 != 0) { owner = player->_owner; if ((((owner == (Entity_Player *)0x0) || (player = owner, owner->_type != 1)) && (player = (Entity_Player *)0x0, owner != (Entity_Player *)0x0)) && (owner->_type == 3)) { owner->_chargeBarSprites[5]._numEvents = 0; } else if (player != (Entity_Player *)0x0) { Entity_Player::stop_costume_item_anims(player); return; } } return; } //@@ 00a08700 Weapon_MonstrosLung::FireBurst /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: fires N burst tears around a velocity (items sweep 12) */ void Weapon_MonstrosLung::FireBurst(undefined4 param_1,int param_2) { BitSet128 flags; byte isHasCollectible; uint rngResult; Entity_Bomb *bomb; int fuseTime; uint rngResult2; Entity_Tear *tear; Weapon *in_ECX; float *extraout_EDX; float in_XMM0_Da; float angle; float spreadScale; float velocityX; float fVar1; float fVar2; float in_XMM3_Da; uint in_stack_ffffff94; Entity_Player *player; int shotsLeft; Vector local_30; Vector firePos; uint local_20; uint uStack_1c; uint uStack_18; uint uStack_14; Entity_Player *owner; owner = in_ECX->_owner; if (owner != (Entity_Player *)0x0) { if (owner->_type == 1) { firePos.x = (owner->_pos).x; firePos.y = (owner->_pos).y; player = owner; goto LAB_00a08780; } if (owner->_type == 3) { player = *(Entity_Player **)&owner->_isControlsEnabled; firePos.x = (owner->_pos).x; firePos.y = (owner->_pos).y; goto LAB_00a08780; } } player = (Entity_Player *)0x0; if (owner == (Entity_Player *)0x0) { player = (Entity_Player *)0x0; firePos.x = g_vectorZero.x; firePos.y = g_vectorZero.y; } else { firePos.x = (owner->_pos).x; firePos.y = (owner->_pos).y; } LAB_00a08780: shotsLeft = param_2; if (0 < param_2) { do { FUN_009f3c40(); fVar1 = *extraout_EDX; fVar2 = extraout_EDX[1]; rngResult = Random(); angle = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 3.14; angle = angle + angle; rngResult = Random(); spreadScale = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10; velocityX = cos(angle); velocityX = velocityX * spreadScale * 3.5 + fVar1 * in_XMM0_Da; local_30.x = velocityX; fVar1 = sin(angle); fVar1 = fVar1 * spreadScale * 3.5 + fVar2 * in_XMM0_Da; local_30.y = fVar1; if (player == (Entity_Player *)0x0) { LAB_00a08a1b: tear = Weapon::fire_tear(in_ECX,&firePos,&local_30,0,in_stack_ffffff94,in_XMM3_Da,0.0); if (1 < *(int *)&g_game->_deathmatchManager) { local_20 = (uint)(tear->_tearFlags)._l | _DAT_00c34b10; in_stack_ffffff94 = *(uint *)((int)&(tear->_tearFlags)._l + 4) | DAT_00c34b14; uStack_18 = (uint)(tear->_tearFlags)._h | _DAT_00c34b18; uStack_14 = *(uint *)((int)&(tear->_tearFlags)._h + 4) | DAT_00c34b1c; flags._l._4_4_ = in_stack_ffffff94; flags._l._0_4_ = local_20; flags._h._0_4_ = uStack_18; flags._h._4_4_ = uStack_14; uStack_1c = in_stack_ffffff94; Entity_Tear::SetTearFlags(tear,flags); } if (player != (Entity_Player *)0x0) { if (0.0 < player->_tearfallaccel) { rngResult = Random(); tear->_fallingSpeed = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * -10.0 - tear->_fallingSpeed; } else { tear->_fallingAccel = player->_tearfallaccel + 0.5; in_stack_ffffff94 = 0xa08af7; isHasCollectible = Entity_Player::HasCollectible(player,0x95,0); if (isHasCollectible == 0) { in_stack_ffffff94 = 0xa08b09; isHasCollectible = Entity_Player::HasCollectible(player,0x213,0); if (isHasCollectible != 0) goto LAB_00a08b44; rngResult = Random(); fVar2 = 5.0; fVar1 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 15.0; } else { LAB_00a08b44: rngResult = Random(); fVar2 = -5.0; fVar1 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 10.0; } tear->_fallingSpeed = (fVar2 - fVar1) - player->_tearfallspeed; } } rngResult = Random(); rngResult2 = Random(); in_XMM0_Da = (((float)(rngResult & 1) + 0.0) * 0.4 + 0.9 + (float)((double)(int)rngResult2 + __uint_to_double_fixup[-((int)rngResult2 >> 0x1f)]) * 2.3283064e-10 * 0.05) * tear->_fScale; if (in_XMM0_Da <= 0.01) { in_XMM0_Da = 0.01; } tear->_baseScale = in_XMM0_Da; tear->_fScale = in_XMM0_Da; Entity_Tear::ResetSpriteScale(tear); } else { in_stack_ffffff94 = 0xa088a7; isHasCollectible = Entity_Player::HasCollectible(player,0x34,0); if (isHasCollectible == 0) goto LAB_00a08a1b; rngResult = Random(); local_30.y = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.4; local_30.x = velocityX * local_30.y; local_30.y = fVar1 * local_30.y; in_stack_ffffff94 = 0xa08915; bomb = Weapon::fire_bomb(in_ECX,&firePos,&local_30); bomb->_fallAcceleration = 0.8; rngResult = Random(); bomb->_fallSpeed = -1.0 - (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 8.0; rngResult = Random(); fuseTime = bomb->_explosionCountdown1 - rngResult % 0xf; if (fuseTime < 0xf) { fuseTime = 0xf; } bomb->_explosionCountdown1 = fuseTime; *(int *)&bomb->field_0x414 = fuseTime; rngResult = Random(); rngResult2 = Random(); bomb->_loadCostumes = 1; fVar1 = (float)((double)(int)rngResult2 + __uint_to_double_fixup[-((int)rngResult2 >> 0x1f)] ) * 2.3283064e-10 * 0.15 + ((float)(rngResult & 1) + 0.0) * 0.2 + 0.4; in_XMM0_Da = fVar1 * bomb->_scale; bomb->_radiusMultiplier = fVar1 * bomb->_radiusMultiplier; bomb->_scale = in_XMM0_Da; } shotsLeft = shotsLeft + -1; } while (shotsLeft != 0); } return; } //@@ 00a08c80 Weapon_MonstrosLung::GetMaxCharge /* ZHL [vtable slot 6] */ float10 __thiscall Weapon_MonstrosLung::GetMaxCharge(Weapon_MonstrosLung *this) { float fVar1; float local_8; local_8 = 1.0; if ((this->_modifiers & 1) != 0) { local_8 = 2.5; } fVar1 = *(float *)&this->field_0x10; if (fVar1 < 0.001) { fVar1 = 0.001; } return (float10)fVar1 * (float10)local_8; } //@@ 00a08cd0 Weapon_MonstrosLung::GetMarkedTargetVariant /* ZHL [vtable slot 12] */ undefined4 __thiscall Weapon_MonstrosLung::GetMarkedTargetVariant(Weapon_MonstrosLung *this) { byte bVar1; undefined4 uVar2; Entity_Player *this_00; this_00 = this->_owner; if (this_00 != (Entity_Player *)0x0) { if (this_00->_type == 1) goto LAB_00a08cf6; if (this_00->_type == 3) { this_00 = *(Entity_Player **)&this_00->_isControlsEnabled; goto LAB_00a08cf6; } } this_00 = (Entity_Player *)0x0; LAB_00a08cf6: bVar1 = Entity_Player::HasCollectible(this_00,0x18a,0); if (bVar1 == 0) { return 0; } bVar1 = Entity_Player::HasCollectible(this_00,0x23c,0); uVar2 = 0x1e; if (bVar1 != 0) { uVar2 = 0x99; } return uVar2; } //@@ 00a08d40 Weapon_Rockets::Fire /* DB: vftable prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_Rockets::Fire(void *player,Vector *aimDirection,byte isShooting,byte isInterpolated) { qword qVar1; void *pvVar2; byte bVar3; char extraout_AL; short rocketCount; uint uVar4; Entity *mainTarget; Entity *extraTarget; int iVar5; BitSet128 *maskedFlags; Vector *pVVar6; Entity_Player *extraout_ECX; float *unusedArg; Entity_Player *pEVar7; float *extraout_ECX_00; float *extraout_ECX_01; float *extraout_ECX_02; float *extraout_ECX_03; int extraout_ECX_04; int extraout_ECX_05; qword *allocCounter; Entity_Player *player; Entity_Player *familiar; bool bVar8; float fVar9; float fVar10; float fVar11; undefined3 in_stack_00000009; undefined3 in_stack_0000000d; undefined4 uVar12; TypeDescriptor *pTVar13; TypeDescriptor *pTVar14; undefined4 uVar15; short multiShotParams [14]; char local_6b; char local_6a; ushort local_68; BitSet128 tearFlags; EntityList_EL local_54; Vector tmpPos; Vector local_3c; float angleSin; undefined4 *local_30; Weapon *weapon; Vector local_28; float local_20; float local_1c; float local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; undefined4 *parentRef; int *targetRef; local_8 = 0xffffffff; puStack_c = &LAB_00b1089d; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = (float)_isInterpolated; local_30 = (undefined4 *)_isShooting; weapon = player; Weapon::Fire(player,aimDirection,isShooting,isInterpolated); pEVar7 = *(Entity_Player **)((int)player + 4); _isShooting = pEVar7; if (pEVar7 == (Entity_Player *)0x0) { LAB_00a08dcb: player = (Entity_Player *)0x0; if ((pEVar7 != (Entity_Player *)0x0) && (pEVar7->_type == 1)) goto LAB_00a08dde; LAB_00a08da6: _isShooting = (Entity_Player *)0x0; if ((pEVar7 == (Entity_Player *)0x0) || (pEVar7->_type != 3)) goto LAB_00a08dde; local_14 = *(uint *)((int)player + 0x34) >> 0x1f; _isShooting = (Entity_Player *)0x0; familiar = pEVar7; LAB_00a08e26: pEVar7 = *(Entity_Player **)&pEVar7->_isControlsEnabled; if (pEVar7 == (Entity_Player *)0x0) goto LAB_00a08e3a; local_28.y = (float)pEVar7->_markedTarget; } else { if (pEVar7->_type != 1) { if (pEVar7->_type != 3) goto LAB_00a08dcb; player = *(Entity_Player **)&pEVar7->_isControlsEnabled; goto LAB_00a08da6; } player = pEVar7; LAB_00a08dde: local_14 = *(uint *)((int)player + 0x34) >> 0x1f; familiar = (Entity_Player *)0x0; bVar3 = (byte)(*(uint *)((int)player + 0x34) >> 0x1f); _isInterpolated = (int *)CONCAT13(bVar3,_isInterpolated); if (pEVar7 != (Entity_Player *)0x0) { local_14 = CONCAT31((int3)((uint)player >> 8),bVar3); if (pEVar7->_type == 1) { local_14 = (uint)bVar3; local_28.y = (float)pEVar7->_markedTarget; goto LAB_00a08e3c; } if (pEVar7->_type == 3) goto LAB_00a08e26; } LAB_00a08e3a: local_28.y = 0.0; } LAB_00a08e3c: if ((((char)local_14 == '\0') && ((Entity *)local_28.y != (Entity *)0x0)) && (player != (Entity_Player *)0x0)) { bVar3 = Entity_Player::HasCollectible(player,0x18a,0); pEVar7 = extraout_ECX; if (bVar3 == 0) goto LAB_00a08e63; unusedArg = (float *)CONCAT31((int3)((uint)extraout_ECX >> 8),1); } else { LAB_00a08e63: unusedArg = (float *)((uint)pEVar7 & 0xffffff00); } iVar5 = *(int *)((int)player + 0x44); local_3c.y = (float)((int)player + 0x44); _isInterpolated = (int *)CONCAT13((char)unusedArg,_isInterpolated); if (iVar5 != 0) { if ((char)unusedArg == '\0') { pVVar6 = (Vector *)aimDirection->x; local_18 = aimDirection->y; fVar10 = (float)pVVar6 * (float)pVVar6 + local_18 * local_18; aimDirection = pVVar6; if (1.0 < fVar10) { fVar10 = sqrtf(fVar10); unusedArg = extraout_ECX_00; if (0.0 < fVar10) { aimDirection = (Vector *)((float)pVVar6 * (1.0 / fVar10)); local_18 = local_18 * (1.0 / fVar10); } } if (player == (Entity_Player *)0x0) { LAB_00a08fb1: fVar10 = local_18; } else { bVar3 = Entity_Player::HasCollectible(player,0x166,0); unusedArg = extraout_ECX_01; if (bVar3 == 0) goto LAB_00a08fb1; bVar3 = Entity_Player::HasCollectible(player,0xf5,0); unusedArg = extraout_ECX_02; if (bVar3 != 0) goto LAB_00a08fb1; local_20 = cos(0.7853982); fVar10 = sin(0.7853982); fVar9 = (float)aimDirection * fVar10; aimDirection = (Vector *)((float)aimDirection * local_20 - local_18 * fVar10); unusedArg = extraout_ECX_03; fVar10 = local_18 * local_20 + fVar9; } iVar5 = *(int *)((int)player + 0x44); *(float *)(iVar5 + 0x360) = (float)aimDirection * 8.0 * *(float *)(iVar5 + 0x39c) + *(float *)(iVar5 + 0x360); *(float *)(iVar5 + 0x364) = fVar10 * 8.0 * *(float *)(iVar5 + 0x39c) + *(float *)(iVar5 + 0x364); } else { unusedArg = (float *)(iVar5 + 0x33c); fVar10 = ((Vector *)((int)local_28.y + 0x33c))->x; fVar9 = ((Vector *)((int)local_28.y + 0x33c))->y; if (familiar != (Entity_Player *)0x0) { fVar9 = (fVar9 + (familiar->_pos).y) - *(float *)(*(int *)&familiar->_isControlsEnabled + 0x340); fVar10 = (fVar10 + (familiar->_pos).x) - *(float *)(*(int *)&familiar->_isControlsEnabled + 0x33c); } *unusedArg = fVar10; *(float *)(iVar5 + 0x340) = fVar9; } } if (local_1c._0_1_ != '\0') { ExceptionList = local_10; return; } Weapon::GetMultiShotParams(player,multiShotParams,(int)unusedArg); iVar5 = extraout_ECX_04; if ((char)local_14 == '\0') { LAB_00a09039: rocketCount = multiShotParams[0]; } else { bVar3 = Entity_Player::HasCollectible(player,0x164,0); iVar5 = extraout_ECX_05; if (bVar3 == 0) goto LAB_00a09039; rocketCount = multiShotParams[0] * 2; } if (((char)local_30 != '\0') || (in_stack_0000000d._2_1_ != '\0')) { Weapon::SetBlinkTime(player,10,iVar5); if (((*(int *)((int)player + 0x44) == 0) || ((extraout_AL != '\0' && (*(char *)(*(int *)((int)player + 0x44) + 0x173) != '\0')))) && ((*(float *)((int)player + 0xc) <= 0.0 && *(float *)((int)player + 0xc) != 0.0 || ((char)local_14 != '\0')))) { local_20 = (float)((rocketCount * 5 + 0x14) * 2); iVar5 = *(int *)((int)player + 4); if (iVar5 == 0) { tmpPos.x = g_vectorZero.x; tmpPos.y = g_vectorZero.y; } else { tmpPos.x = *(float *)(iVar5 + 0x33c); tmpPos.y = *(float *)(iVar5 + 0x340); } local_18 = g_vectorOne.x; local_1c = g_vectorOne.y; if (familiar != (Entity_Player *)0x0) { local_18 = g_vectorOne.x * 0.8; local_1c = g_vectorOne.y * 0.8; } if (in_stack_0000000d._2_1_ != '\0') { tmpPos.x = ((Vector *)((int)local_28.y + 0x33c))->x; tmpPos.y = ((Vector *)((int)local_28.y + 0x33c))->y; } uVar4 = Random(); mainTarget = Game::Spawn(g_game,1000,0x1e,&tmpPos,&g_vectorZero,*(Entity **)((int)player + 4),0, uVar4); (mainTarget->_sprite)._scale.x = local_18; *(int *)&mainTarget[1].field_0x44 = (int)rocketCount; *(float *)(mainTarget[1]._sprite._filename._buf + 8) = local_20; *(float *)(mainTarget[1]._sprite._filename._buf + 0xc) = local_20; (mainTarget->_sprite)._scale.y = local_1c; if ((in_stack_0000000d._2_1_ != '\0') && (familiar == (Entity_Player *)0x0)) { mainTarget->_visible = 0; } targetRef = (int *)((int)player + 0x44); local_28.y = (float)mainTarget; if (*(Entity **)((int)player + 0x44) != mainTarget) { if (*(Entity **)((int)player + 0x44) != (Entity *)0x0) { _isInterpolated = targetRef; std::multiset::erase(&isInterpolated); } *targetRef = (int)mainTarget; std::multiset::insert(targetRef); } if (local_6b != '\0') { uVar4 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; extraTarget = Game::Spawn(g_game,1000,0x1e,&tmpPos,&g_vectorZero,*(Entity **)((int)player + 4) ,0,uVar4); iVar5 = __RTDynamicCast(extraTarget,uVar12,pTVar13,pTVar14,uVar15); if (*(int *)(iVar5 + 0x3bc) != 0) { _isInterpolated = (int *)(iVar5 + 0x3bc); std::multiset::erase(&isInterpolated); } *(undefined4 *)(iVar5 + 0x3bc) = mainTarget; std::multiset::insert((undefined4 *)(iVar5 + 0x3bc)); *(float *)(iVar5 + 0x45c) = local_20; *(float *)(iVar5 + 0x460) = local_20; *(float *)(iVar5 + 0xe4) = local_18; *(float *)(iVar5 + 0xe8) = local_1c; *(int *)(iVar5 + 0x450) = (int)rocketCount; *(undefined4 *)(iVar5 + 0x30) = 1; } if (local_6a != '\0') { _isInterpolated = (int *)0x2; do { uVar4 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; mainTarget = Game::Spawn(g_game,1000,0x1e,&tmpPos,&g_vectorZero, *(Entity **)((int)player + 4),0,uVar4); iVar5 = __RTDynamicCast(mainTarget,uVar12,pTVar13,pTVar14,uVar15); parentRef = (undefined4 *)(iVar5 + 0x3bc); if (*(int *)(iVar5 + 0x3bc) != 0) { local_30 = parentRef; std::multiset::erase(&local_30); } mainTarget = (Entity *)local_28.y; *parentRef = local_28.y; std::multiset::insert(parentRef); *(float *)(iVar5 + 0x45c) = local_20; *(float *)(iVar5 + 0x460) = local_20; *(int *)(iVar5 + 0x450) = (int)rocketCount; *(int **)(iVar5 + 0x30) = _isInterpolated; _isInterpolated = (int *)((int)_isInterpolated + 1); *(float *)(iVar5 + 0xe4) = local_18; *(float *)(iVar5 + 0xe8) = local_1c; } while ((int)_isInterpolated < 4); } _isInterpolated = (int *)(uint)local_68; while (_isInterpolated != (int *)0x0) { uVar4 = Random(); uVar15 = 0; pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor; pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor; uVar12 = 0; extraTarget = Game::Spawn(g_game,1000,0x1e,&tmpPos,&g_vectorZero,*(Entity **)((int)player + 4) ,0,uVar4); local_28.y = (float)__RTDynamicCast(extraTarget,uVar12,pTVar13,pTVar14,uVar15); parentRef = (undefined4 *)((int)local_28.y + 0x3bc); if (*(int *)((int)local_28.y + 0x3bc) != 0) { local_30 = parentRef; std::multiset::erase(&local_30); } *parentRef = mainTarget; std::multiset::insert(parentRef); fVar10 = local_28.y; *(float *)((int)local_28.y + 0x45c) = local_20; *(float *)((int)local_28.y + 0x460) = local_20; *(float *)((int)local_28.y + 0xe4) = local_18; *(float *)((int)local_28.y + 0xe8) = local_1c; *(int *)((int)local_28.y + 0x450) = (int)rocketCount; *(undefined4 *)((int)local_28.y + 0x30) = 4; uVar4 = Random(); fVar9 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; local_30 = (undefined4 *)(fVar9 + fVar9); angleSin = sin((float)local_30); uVar4 = Random(); local_28.y = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 80.0 + 10.0; fVar9 = cos((float)local_30); _isInterpolated = (int *)((int)_isInterpolated - 1); *(float *)((int)fVar10 + 0x34c) = fVar9 * local_28.y; *(float *)((int)fVar10 + 0x350) = local_28.y * angleSin; } *(undefined4 *)((int)player + 0xc) = *(undefined4 *)((int)player + 0x10); _isInterpolated = (int *)0x0; } } targetRef = (int *)((int)player + 0x44); if (*targetRef == 0) goto LAB_00a09959; Weapon::get_owner_tear_flags(player,&tearFlags); maskedFlags = BitSet128::operator_and ((BitSet128 *)&local_54,&tearFlags,(BitSet128 *)&DAT_00c34b20); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { tmpPos.x = *(float *)(*targetRef + 0x33c); tmpPos.y = *(float *)(*targetRef + 0x340); Game::AttractEntities(g_game,&tmpPos,(void *)0x0,(void *)0x0,10.0,250.0); EntityList::QuerySublist((EntityList *)((int)g_game->_room + 0x1218),&local_54,1000,0x1e,-1,0,0) ; pvVar2 = local_54._data; uVar4 = 0; local_8 = 0; if (local_54._size != 0) { do { iVar5 = *(int *)((int)pvVar2 + uVar4 * 4); if (*(int *)(iVar5 + 0x3bc) == *targetRef) { tmpPos.x = *(float *)(iVar5 + 0x33c); tmpPos.y = *(float *)(iVar5 + 0x340); Game::AttractEntities(g_game,&tmpPos,(void *)0x0,(void *)0x0,10.0,250.0); } uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_54._size); player = weapon; } local_8 = 0xffffffff; if (local_54._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_54._data != (void *)0x0) { uVar4 = *(uint *)((int)local_54._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); free((uint *)((int)local_54._data + -4)); } local_8 = 0xffffffff; } } maskedFlags = BitSet128::operator_and((BitSet128 *)&local_54,&tearFlags,&g_tearFlagHoming); if (((int)maskedFlags->_l != 0 || *(int *)((int)&maskedFlags->_l + 4) != 0) || ((int)maskedFlags->_h != 0 || *(int *)((int)&maskedFlags->_h + 4) != 0)) { tmpPos.x = *(float *)(*targetRef + 0x33c); tmpPos.y = *(float *)(*targetRef + 0x340); EntityList::QueryRadius((EntityList *)((int)g_game->_room + 0x1218),&local_54,&tmpPos,200.0,8); fVar10 = 999999.0; uVar4 = 0; aimDirection = (Vector *)0x0; if (local_54._size != 0) { _isInterpolated = *(int **)&g_game->_deathmatchManager; do { pVVar6 = *(Vector **)((int)local_54._data + uVar4 * 4); if (((int)_isInterpolated < 2) || (pVVar6[5].x != 1.4013e-45)) { fVar9 = pVVar6[5].x; if (((int)fVar9 - 10U < 0x3de) && (((fVar9 != 4.62428e-44 && (fVar9 != 2.38221e-44)) && (fVar9 != 4.09179e-43)))) { if (fVar9 == 1.24015e-42) { bVar8 = pVVar6[5].y == 1.4013e-44; } else { if ((fVar9 == 1.34525e-42) || (fVar9 == 1.35225e-42)) goto LAB_00a0972d; bVar8 = fVar9 == 3.43318e-43; } if (!bVar8) goto LAB_00a096e7; } LAB_00a0972d: iVar5 = *(int *)local_3c.y; } else { LAB_00a096e7: if (*(char *)((int)&pVVar6[0x2e].x + 3) != '\0') goto LAB_00a0972d; iVar5 = *(int *)local_3c.y; fVar11 = *(float *)(iVar5 + 0x340) - pVVar6[0x68].x; fVar9 = *(float *)(iVar5 + 0x33c) - pVVar6[0x67].y; fVar9 = fVar11 * fVar11 + fVar9 * fVar9; if (fVar9 < fVar10) { fVar10 = fVar9; aimDirection = pVVar6; } } uVar4 = uVar4 + 1; } while (uVar4 < (uint)local_54._size); player = weapon; if (aimDirection != (Vector *)0x0) { _isInterpolated = (int *)(aimDirection[0x68].x - *(float *)(iVar5 + 0x340)); fVar9 = aimDirection[0x67].y - *(float *)(iVar5 + 0x33c); fVar10 = sqrtf((float)_isInterpolated * (float)_isInterpolated + fVar9 * fVar9); targetRef = _isInterpolated; if (0.0 < fVar10) { fVar9 = fVar9 * (1.0 / fVar10); targetRef = (int *)((float)_isInterpolated * (1.0 / fVar10)); } fVar10 = *(float *)(iVar5 + 0x36c); if (fVar10 != 0.0) { *(float *)(iVar5 + 0x364) = (*(float *)(iVar5 + 0x39c) * (float)targetRef) / fVar10 + *(float *)(iVar5 + 0x364); *(float *)(iVar5 + 0x360) = (*(float *)(iVar5 + 0x39c) * fVar9) / fVar10 + *(float *)(iVar5 + 0x360); } } } if (local_54._0_1_ == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = (qword *)((int)g_mainHeap + 0x30); } if (local_54._data != (void *)0x0) { uVar4 = *(uint *)((int)local_54._data + -4); qVar1 = *allocCounter; *(uint *)allocCounter = (uint)*allocCounter - uVar4; *(uint *)((int)allocCounter + 4) = *(uint *)((int)allocCounter + 4) - (uint)((uint)qVar1 < uVar4); free((uint *)((int)local_54._data + -4)); } local_8 = 0xffffffff; } targetRef = (int *)&((Weapon *)((int)player + 0x38))->field_0xc; } if ((((Weapon *)player)->_owner == (Entity *)0x0) || (iVar5 = Entity::GetIntervalTicks (((Weapon *)player)->_owner,*(float *)&((Weapon *)player)->field_0x10,0.0), iVar5 == 0)) goto LAB_00a09959; iVar5 = *targetRef; if (iVar5 == 0) { LAB_00a098fd: uVar4 = Random(); fVar10 = (float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) * 2.3283064e-10 * 3.14; fVar10 = fVar10 + fVar10; local_28.x = cos(fVar10); local_28.y = sin(fVar10); pVVar6 = &local_28; } else { fVar10 = *(float *)((int)((Weapon *)player)->_owner + 0x33c); fVar9 = *(float *)((int)((Weapon *)player)->_owner + 0x340); if ((*(float *)(iVar5 + 0x33c) == fVar10) && (*(float *)(iVar5 + 0x340) == fVar9)) goto LAB_00a098fd; _isInterpolated = (int *)(*(float *)(iVar5 + 0x340) - fVar9); fVar10 = *(float *)(iVar5 + 0x33c) - fVar10; local_3c.x = fVar10; local_3c.y = (float)_isInterpolated; fVar9 = sqrtf((float)_isInterpolated * (float)_isInterpolated + fVar10 * fVar10); if (0.0 < fVar9) { local_3c.y = (1.0 / fVar9) * (float)_isInterpolated; local_3c.x = (1.0 / fVar9) * fVar10; } pVVar6 = &local_3c; } Weapon::TriggerTearEffects(player,pVVar6,1); LAB_00a09959: if ((*targetRef != 0) && (*(char *)(*targetRef + 0x173) != '\0')) { *(undefined4 *)&((Weapon *)player)->field_0xc = *(undefined4 *)&((Weapon *)player)->field_0x10; if (((char)local_14 != '\0') && (_isShooting != (Entity_Player *)0x0)) { Entity_Player::ResetItemState(_isShooting); } } ExceptionList = local_10; return; } //@@ 00a099a0 Weapon_Rockets::GetMarkedTargetVariant /* DB: vtable slot 12 of Weapon_Rockets; slot name from Weapon */ byte Weapon_Rockets::GetMarkedTargetVariant(void) { byte bVar1; int in_ECX; Entity_Player *this; this = *(Entity_Player **)(in_ECX + 4); if (this != (Entity_Player *)0x0) { if (this->_type == 1) goto LAB_00a099be; if (this->_type == 3) { this = *(Entity_Player **)&this->_isControlsEnabled; goto LAB_00a099be; } } this = (Entity_Player *)0x0; LAB_00a099be: bVar1 = Entity_Player::HasCollectible(this,0x18a,0); return -(bVar1 != 0) & 0x1e; } //@@ 00a099e0 Weapon_SpiritSword::Fire /* DB: vftable prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_SpiritSword::Fire(void *maskedFlags,Vector *direction,byte isShooting,byte isInterpolated) { byte bVar1; byte bVar2; char headDirection; Vector *clampedScale; Vector *pVVar3; int iVar4; float *clampedCharge; Entity_Knife *knife; Vector **ppVVar5; BitSet128 *maskedFlags; byte *animName; Entity *unusedArg; Entity_Player *extraout_EDX; Entity_Player *extraout_EDX_00; Entity_Player *player; uint uVar6; void *pvVar7; float *pfVar8; float fVar9; float fVar10; float nextCharge; undefined3 in_stack_00000009; undefined3 in_stack_0000000d; Entity aEStackY_7ffffe98 [2072860]; undefined4 uVar11; uint uVar12; short *outParams; short *psVar13; Entity *player; short multiShotParams [14]; char isShootingBackwards; char isShootingSideways; ushort numRandomDirKnives; undefined1 knifeFlags [4]; void *pvStack_60; Vector VStack_5c; Vector local_54; undefined1 flagTest [8]; Vector local_44; float minPitch; float scalePitch; Vector local_34; Vector local_2c; uint swordVariant; Entity_Player *ownerPlayer; float speedMultiplier; float swordScale; char isMomsKnife; void *local_10; undefined1 *puStack_c; undefined4 local_8; Game *game; Manager *manager; int *swordKnife; local_8 = 0xffffffff; puStack_c = &LAB_00b108cd; local_10 = ExceptionList; ExceptionList = &local_10; pVVar3 = direction; local_34.y = (float)maskedFlags; Weapon::Fire(maskedFlags,direction,isShooting,isInterpolated); bVar2 = (byte)pVVar3; local_2c.y = *(float *)((int)maskedFlags + 4); ownerPlayer = (Entity_Player *)local_2c.y; if ((Entity_Player *)local_2c.y == (Entity_Player *)0x0) { speedMultiplier = 1.0; LAB_00a09a65: ownerPlayer = (Entity_Player *)0x0; if ((Entity_Player *)local_2c.y != (Entity_Player *)0x0) { ownerPlayer = (Entity_Player *)0x0; if (((Entity_Player *)local_2c.y)->_type == 1) goto LAB_00a09a88; } LAB_00a09a81: local_2c.y = 0.0; } else { speedMultiplier = ((Entity_Player *)local_2c.y)->_speedMultiplier; if (((Entity_Player *)local_2c.y)->_type != 1) { if (((Entity_Player *)local_2c.y)->_type != 3) goto LAB_00a09a65; ownerPlayer = *(Entity_Player **)&((Entity_Player *)local_2c.y)->_isControlsEnabled; goto LAB_00a09a81; } } LAB_00a09a88: player = ownerPlayer; if (ownerPlayer == (Entity_Player *)0x0) { LAB_00a09aaf: swordVariant = 10; isMomsKnife = '\0'; if (player != (Entity_Player *)0x0) goto LAB_00a09abe; } else { Entity_Player::HasCollectible(ownerPlayer,0x18a,0); bVar2 = 0xa5; bVar1 = Entity_Player::HasCollectible(player,0x72,0); if (bVar1 == 0) goto LAB_00a09aaf; isMomsKnife = '\x01'; LAB_00a09abe: bVar2 = 0xc9; bVar1 = Entity_Player::HasCollectible(player,0x44,0); swordVariant = 10; if (bVar1 != 0) { swordVariant = 0xb; } } iVar4 = *(int *)((int)maskedFlags + 4); swordScale = 1.0; if (iVar4 != 0) { if ((Entity_Player *)local_2c.y == (Entity_Player *)0x0) { pVVar3 = (Vector *)(iVar4 + 0xe4); clampedScale = &local_34; if (*(int *)(iVar4 + 0x28) != 3) { if (1.0 < pVVar3->x) { clampedScale = pVVar3; } goto LAB_00a09b5e; } local_34.x = pVVar3->x * 0.8; local_2c.x = 0.8; if (local_34.x <= 0.8) { clampedScale = &local_2c; } } else { local_54.x = ((Vector *)((int)local_2c.y + 0x14f0))->x; local_54.y = ((Vector *)((int)local_2c.y + 0x14f0))->y; clampedScale = &local_54; if (local_54.x <= 1.0) { clampedScale = &local_34; } LAB_00a09b5e: local_34.x = 1.0; } swordScale = clampedScale->x; } if (player != (Entity_Player *)0x0) { bVar2 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x271); if (bVar2 != 0) { swordScale = swordScale * 4.0; } bVar2 = 0xa6; bVar1 = Entity_Player::HasCollectible(player,0xa9,0); if (bVar1 == 0) { bVar2 = 200; bVar1 = Entity_Player::HasCollectible(player,0x213,0); if (bVar1 != 0) { swordScale = swordScale * 1.5; } } else { swordScale = swordScale + swordScale; } } minPitch = 0.5; scalePitch = 1.0 / (swordScale * 0.5 + 0.5); pfVar8 = &scalePitch; if (scalePitch <= 0.5) { pfVar8 = &minPitch; } if ((isInterpolated == 0) && (0.0 < *(float *)((int)maskedFlags + 0x48))) { *(float *)((int)maskedFlags + 0x48) = *(float *)((int)maskedFlags + 0x48) - speedMultiplier; } if (isShooting == 0) { *(undefined1 *)((int)maskedFlags + 0x4c) = 0; } local_54.y = direction->y; local_54.x = direction->x; if (local_54.y == 0.0) { if (local_54.x == 0.0) { local_54.x = *(float *)((int)maskedFlags + 0x20); local_54.y = *(float *)((int)maskedFlags + 0x24); } if (((local_54.y == 0.0) && (local_54.x == 0.0)) && ((Entity_Player *)local_2c.y != (Entity_Player *)0x0)) { switch(*(int *)((int)local_2c.y + 0x1628)) { case 0: local_54.x = (float)&DAT_bf800000; break; case 1: local_54.y = (float)&DAT_bf800000; break; case 2: local_54.x = 1.0; break; case 3: local_54.y = 1.0; } } } local_2c.x = (float)pfVar8; bVar1 = Weapon::IsAxisAligned(maskedFlags); if (bVar1 == 0) { local_34.x = local_54.y; } else { pVVar3 = Vector::ToCardinal(&VStack_5c,&local_54); local_54.x = pVVar3->x; local_34.x = pVVar3->y; } direction = (Vector *)local_54.x; local_54.y = local_34.x; if (((((Entity_Player *)local_2c.y != (Entity_Player *)0x0) && (iVar4 = *(int *)((int)maskedFlags + 4), iVar4 != 0)) && (*(int *)(iVar4 + 0x28) == 1)) && ((0 < *(int *)(iVar4 + 0x145c) || ((*(int *)(iVar4 + 0x2c) == 1 && (*(int *)(iVar4 + 0x1aec) == 8)))))) { local_2c.y = (float)(int)*(char *)(iVar4 + 0x1578) * 45.0 * 0.017453292; local_44.y = cos(local_2c.y); fVar9 = sin(local_2c.y); local_54.x = local_44.y * (float)direction - fVar9 * local_34.x; local_54.y = fVar9 * (float)direction + local_44.y * local_34.x; } if (isInterpolated != 0) { ExceptionList = local_10; return; } if ((SUB41(_isShooting,0) != '\0') && (*(float *)((int)maskedFlags + 0xc) <= 0.0)) { swordKnife = *(int **)((int)maskedFlags + 0x44); local_2c.y = (float)((int)maskedFlags + 0x44); if (swordKnife != (int *)0x0) { if (*(char *)((int)swordKnife + 0x466) != '\0') goto LAB_00a0a43d; (**(code **)(*swordKnife + 0x28))(); } game = g_game; if (*(char *)((int)maskedFlags + 0x4c) == '\0') { *(undefined4 *)((int)maskedFlags + 0xc) = 0x3f800000; *(undefined4 *)((int)maskedFlags + 0x14) = 0; if (1 < *(int *)&game->_deathmatchManager) { *(undefined4 *)((int)maskedFlags + 0xc) = 0x41f00000; } *(undefined1 *)((int)maskedFlags + 0x4c) = 1; if ((ownerPlayer == (Entity_Player *)0x0) || (ownerPlayer->_soulHearts + ownerPlayer->_redHearts < ownerPlayer->_maxHearts)) { iVar4 = FUN_009f57f0(); player = (Entity *)-iVar4; uVar12 = 0xa09e81; FUN_009f5810(player); _isInterpolated = (Entity_Knife *)((uint)_isInterpolated & 0xffffff); player = extraout_EDX_00; if (extraout_EDX_00 != (Entity_Player *)0x0) goto LAB_00a09e89; } else { _isInterpolated = (Entity_Knife *)CONCAT13(1,_isInterpolated); iVar4 = FUN_009f57f0(); FUN_009f5810(-iVar4); player = extraout_EDX; LAB_00a09e89: player = (Entity *)0x0; uVar12 = 0xde; bVar2 = 0x97; bVar1 = Entity_Player::HasCollectible(player,0xde,0); if (bVar1 != 0) { uVar6 = 0; pvVar7 = g_game->_room; if (*(int *)((int)pvVar7 + 0x1264) != 0) { do { iVar4 = *(int *)(*(int *)((int)pvVar7 + 0x125c) + uVar6 * 4); if ((((iVar4 != 0) && (*(int *)(iVar4 + 0x28) == 2)) && (*(int *)(iVar4 + 0x2c) == 0x2f)) && ((*(int *)(iVar4 + 0x3c8) == *(int *)((int)maskedFlags + 4) && (1 < *(int *)(iVar4 + 0x438))))) { *(undefined4 *)(iVar4 + 0x438) = 1; } uVar6 = uVar6 + 1; } while (uVar6 < *(uint *)((int)pvVar7 + 0x1264)); pfVar8 = (float *)local_2c.x; } } } pVVar3 = direction; direction = (Vector *)((uint)direction & 0xffffff); if ((in_stack_0000000d._2_1_ != '\0') && (*(float *)((int)maskedFlags + 0x48) <= 0.0)) { _isInterpolated = (Entity_Knife *)(*(float *)((int)maskedFlags + 0x10) + *(float *)((int)maskedFlags + 0x10)); local_44.y = 60.0; direction = (Vector *)CONCAT13(1,(int3)pVVar3); clampedCharge = (float *)&isInterpolated; if (60.0 <= (float)_isInterpolated) { clampedCharge = &local_44.y; } *(float *)((int)maskedFlags + 0x48) = *clampedCharge; } if (*(int **)((int)maskedFlags + 0x44) != (int *)0x0) { player = (Entity *)0xa09f46; (**(code **)(**(int **)((int)maskedFlags + 0x44) + 0x28))(); } pvStack_60 = (void *)0x0; VStack_5c.x = 0.0; VStack_5c.y = 0.0; local_8 = 0; local_44.y = (float)Weapon::FireSword(maskedFlags,*(Entity **)((int)maskedFlags + 4),swordVariant,0.0,1, bVar2,uVar12,player); knife = *(Entity_Knife **)((int)maskedFlags + 0x44); _isInterpolated = (Entity_Knife *)((int)maskedFlags + 0x44); if (knife != (Entity_Knife *)local_44.y) { if (knife != (Entity_Knife *)0x0) { std::multiset::erase(&isInterpolated); } *(undefined4 *)((int)maskedFlags + 0x44) = local_44.y; knife = (Entity_Knife *)local_44.y; if ((Entity_Knife *)local_44.y != (Entity_Knife *)0x0) { _isInterpolated = (Entity_Knife *)local_44.y; std::multiset::insert((undefined4 *)((int)maskedFlags + 0x44)); knife = *(Entity_Knife **)((int)maskedFlags + 0x44); } } _isInterpolated = knife; fVar9 = atan2f(local_54.y,local_54.x); _isInterpolated->_rotation = fVar9 * 57.295776; if (direction._3_1_ != '\0') { iVar4 = *(int *)((int)maskedFlags + 0x44); *(uint *)(iVar4 + 0x168) = *(uint *)(iVar4 + 0x168) | 0x400000; *(undefined4 *)(iVar4 + 0x16c) = *(undefined4 *)(iVar4 + 0x16c); } *(undefined4 *)(*(int *)((int)maskedFlags + 0x44) + 0x4ec) = 1; _isInterpolated = *(Entity_Knife **)((int)maskedFlags + 0x44); std::vector::_Emplace_reallocate(0,&isInterpolated); outParams = multiShotParams; uVar11 = 0xa0a02d; player = unusedArg; Weapon::GetMultiShotParams(maskedFlags,outParams,(int)unusedArg); if (isShootingBackwards != '\0') { knife = Weapon::FireSword(maskedFlags,*(Entity **)((int)maskedFlags + 0x44),swordVariant,180.0,0, (byte)uVar11,(uint)outParams,player); player = (Entity *)0xa0a061; _isInterpolated = knife; fVar9 = atan2f(local_54.y,local_54.x); knife->_rotation = fVar9 * 57.295776; *(undefined4 *)(knife + 1) = 1; if (VStack_5c.x == VStack_5c.y) { player = (Entity *)&isInterpolated; uVar11 = 0xa0a09d; outParams = (short *)VStack_5c.x; std::vector::_Emplace_reallocate(VStack_5c.x,player); } else { *(Entity_Knife **)VStack_5c.x = _isInterpolated; VStack_5c.x = (float)((int)VStack_5c.x + 4); } } psVar13 = (short *)VStack_5c.x; if (isShootingSideways != '\0') { _isInterpolated = Weapon::FireSword((Weapon *)local_34.y,*(Entity **)local_2c.y,swordVariant,90.0,0, (byte)uVar11,(uint)outParams,player); player = (Entity *)0xa0a0d9; fVar9 = atan2f(local_54.y,local_54.x); _isInterpolated->_rotation = fVar9 * 57.295776; *(undefined4 *)(_isInterpolated + 1) = 1; if (psVar13 == (short *)VStack_5c.y) { player = (Entity *)&isInterpolated; uVar11 = 0xa0a112; std::vector::_Emplace_reallocate(psVar13,player); } else { *(Entity_Knife **)psVar13 = _isInterpolated; VStack_5c.x = (float)psVar13 + 2; psVar13 = outParams; } outParams = (short *)VStack_5c.x; _isInterpolated = Weapon::FireSword((Weapon *)local_34.y,*(Entity **)local_2c.y,swordVariant,-90.0,0, (byte)uVar11,(uint)psVar13,player); fVar9 = atan2f(local_54.y,local_54.x); _isInterpolated->_rotation = fVar9 * 57.295776; *(undefined4 *)(_isInterpolated + 1) = 1; if (outParams == (short *)VStack_5c.y) { uVar11 = 0xa0a17d; std::vector::_Emplace_reallocate(outParams,&isInterpolated); } else { *(Entity_Knife **)outParams = _isInterpolated; VStack_5c.x = (float)outParams + 2; outParams = psVar13; } } fVar9 = local_34.y; direction = (Vector *)(uint)numRandomDirKnives; if (direction != (Vector *)0x0) { do { psVar13 = (short *)VStack_5c.x; player = (Entity *)0xa0a197; uVar12 = Random(); _isInterpolated = Weapon::FireSword((Weapon *)fVar9, *(Entity **)&((Weapon *)((int)fVar9 + 0x38))->field_0xc, swordVariant, (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 360.0,0,(byte)uVar11,(uint)outParams,player); fVar10 = atan2f(local_54.y,local_54.x); _isInterpolated->_rotation = fVar10 * 57.295776; *(undefined4 *)(_isInterpolated + 1) = 1; if (psVar13 == (short *)VStack_5c.y) { uVar11 = 0xa0a21c; std::vector::_Emplace_reallocate(psVar13,&isInterpolated); } else { *(Entity_Knife **)psVar13 = _isInterpolated; VStack_5c.x = (float)psVar13 + 2; psVar13 = outParams; } direction = (Vector *)((int)&direction[-1].y + 3); outParams = psVar13; } while (direction != (Vector *)0x0); direction = (Vector *)0x0; pfVar8 = (float *)local_2c.x; } _isInterpolated = (Entity_Knife *)0x0; fVar9 = swordScale; if (2 < g_game->_frameCount - *(int *)(*(int *)local_2c.y + 0x328)) { fVar9 = *(float *)(*(int *)local_2c.y + 0xe4); fVar9 = (swordScale - fVar9) * 0.5 + fVar9; } uVar12 = 0; uVar6 = (int)VStack_5c.x - (int)pvStack_60 >> 2; if (uVar6 != 0) { do { iVar4 = *(int *)((int)pvStack_60 + uVar12 * 4); if ((((iVar4 != 0) && (*(int *)(iVar4 + 0x28) == 8)) && (*(int *)(iVar4 + 0x30) == 0)) && ((*(int *)(iVar4 + 0x3bc) == *(int *)local_2c.y || (iVar4 == *(int *)local_2c.y)))) { fVar10 = fVar9 * g_vectorOne.y; *(float *)(iVar4 + 0xe4) = fVar9 * g_vectorOne.x; *(float *)(iVar4 + 0xe8) = fVar10; } uVar12 = uVar12 + 1; } while (uVar12 < uVar6); uVar12 = 0; do { Entity_Knife::SetAttackAnimation(*(Entity_Knife **)((int)pvStack_60 + uVar12 * 4)); (**(code **)(**(int **)((int)pvStack_60 + uVar12 * 4) + 0xc))(); direction = *(Vector **)(*(int *)((int)pvStack_60 + uVar12 * 4) + 0x388); ppVVar5 = &direction; if ((float)direction <= (float)_isInterpolated) { ppVVar5 = (Vector **)&isInterpolated; } uVar12 = uVar12 + 1; _isInterpolated = (Entity_Knife *)*ppVVar5; } while (uVar12 < uVar6); pfVar8 = (float *)local_2c.x; } uVar12 = Random(); manager = g_manager; direction = (Vector *)0xfc; local_44.y = ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 1.1) * *pfVar8; seed_fart_sound_override((int *)&direction); SoundEffects::Play(&manager->_sfxManager,(int)direction,1.0,1,0,local_44.y,0.0); if ((20.0 < (float)_isInterpolated) && (1.5 < swordScale)) { Game::ShakeScreen(g_game,(int)(swordScale * 5.0)); } maskedFlags = (void *)local_34.y; Weapon::TriggerTearEffects((Weapon *)local_34.y,&local_54,1); local_8 = 0xffffffff; if (pvStack_60 != (void *)0x0) { uVar12 = (int)VStack_5c.y - (int)pvStack_60 & 0xfffffffc; pvVar7 = pvStack_60; if (0xfff < uVar12) { pvVar7 = *(void **)((int)pvStack_60 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)pvStack_60 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar12); } } } LAB_00a0a43d: if (*(int *)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc == 0) { *(undefined4 *)&((Weapon *)maskedFlags)->field_0x14 = 0; ExceptionList = local_10; return; } if ((SUB41(_isShooting,0) != '\0') || (*(float *)&((Weapon *)maskedFlags)->field_0x14 < *(float *)&((Weapon *)maskedFlags)->field_0x10 * 4.0)) { *(char *)(*(int *)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc + 0x466) = SUB41(_isShooting,0); iVar4 = *(int *)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc; if (*(char *)(iVar4 + 0x466) == '\0') { *(undefined4 *)&((Weapon *)maskedFlags)->field_0x14 = 0; } else { fVar9 = *(float *)&((Weapon *)maskedFlags)->field_0x10 * 4.0; if (*(char *)(iVar4 + 0x465) == '\0') { nextCharge = speedMultiplier + *(float *)&((Weapon *)maskedFlags)->field_0x14; fVar10 = fVar9; if (nextCharge <= fVar9) { fVar10 = nextCharge; } *(float *)&((Weapon *)maskedFlags)->field_0x14 = fVar10; *(bool *)(iVar4 + 0x4e8) = fVar9 <= fVar10; } else { *(bool *)(iVar4 + 0x4e8) = fVar9 <= *(float *)&((Weapon *)maskedFlags)->field_0x14; } } } else { Weapon::GetMultiShotParams(maskedFlags,multiShotParams,(int)_isShooting); Entity_Knife::SpinAttack (*(Entity_Knife **)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc,multiShotParams[0],0); if ((isMomsKnife != '\0') && (knife = *(Entity_Knife **)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc, knife != (Entity_Knife *)0x0)) { if (ownerPlayer == (Entity_Player *)0x0) { fVar9 = 260.0; } else { fVar9 = ownerPlayer->_tearrange; } knifeFlags = SUB84((knife->_tearFlags)._l,0); pvStack_60 = *(void **)((int)&(knife->_tearFlags)._l + 4); VStack_5c.x = *(float *)&(knife->_tearFlags)._h; VStack_5c.y = *(float *)((int)&(knife->_tearFlags)._h + 4); fVar9 = fVar9 * 0.6; fVar10 = 300.0; maskedFlags = BitSet128::operator_and ((BitSet128 *)flagTest,(BitSet128 *)knifeFlags, (BitSet128 *)&DAT_00c34b60); bVar2 = BitSet128::IsNonZero(maskedFlags); if (bVar2 != 0) { fVar10 = 100000.0; } if (fVar10 <= fVar9) { fVar9 = fVar10; } Entity_Knife::Shoot(knife,1.0,fVar9); } *(undefined4 *)&((Weapon *)maskedFlags)->field_0x14 = 0; Weapon::TriggerTearEffects(maskedFlags,&local_54,6); } animName = *(byte **)(*(int *)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc + 0x7c); if (animName == (byte *)0x0) { animName = &s_empty; } else if (0xf < *(uint *)(animName + 0x14)) { animName = *(byte **)animName; } iVar4 = strncmp((char *)animName,"Spin",4); if (iVar4 == 0) { Entity::GetNullOffset (*(Entity **)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc,&local_44,&DAT_00b1d3b0); fVar9 = local_44.y; if (ABS(local_44.y) < ABS(local_44.x)) { headDirection = '\x02'; if (local_44.x < 0.0) { headDirection = '\0'; } goto LAB_00a0a674; } } else { _isShooting = (float)(*(Entity **)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc)[1]._variant * 0.017453292; _isInterpolated = (Entity_Knife *)cos(_isShooting); fVar9 = sin(_isShooting); if (ABS(fVar9) < ABS((float)_isInterpolated)) { headDirection = '\x02'; if ((float)_isInterpolated < 0.0) { headDirection = '\0'; } goto LAB_00a0a674; } } headDirection = (0.0 <= fVar9) * '\x02' + '\x01'; LAB_00a0a674: Weapon::set_head_direction(headDirection); Weapon::SetHeadLockTime(maskedFlags,1); swordKnife = *(int **)&((Weapon *)((int)maskedFlags + 0x38))->field_0xc; if ((((char)swordKnife[0x119] == '\0') && (*(char *)((int)swordKnife + 0x465) == '\0')) && (*(char *)((int)swordKnife + 0x466) == '\0')) { (**(code **)(*swordKnife + 0x28))(); ExceptionList = local_10; return; } ExceptionList = local_10; return; } //@@ 00a0a6f0 Weapon_SpiritSword::Reset /* DB: vtable slot 4 of Weapon_SpiritSword; slot name from Weapon */ void Weapon_SpiritSword::Reset(void) { int in_ECX; *(undefined1 *)(in_ECX + 0x4c) = 0; return; } //@@ 00a0a700 Weapon_SpiritSword::GetMaxCharge /* DB: vtable slot 6 of Weapon_SpiritSword; slot name from Weapon */ float10 Weapon_SpiritSword::GetMaxCharge(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x10) * (float10)4.0; } //@@ 00a0a720 Weapon_Tears::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Weapon_Tears vftable slot 3 (Fire); gfuel promo casing/muzzle_flash anm2, GetMultiShotParams, TriggerTearEffects */ void Weapon_Tears::Fire(Vector *param_1,byte param_2,byte param_3) { undefined1 *puVar1; byte bVar2; char cVar3; ushort uVar4; short sVar5; int iVar6; Vector *pVVar7; ANM2 **ppAVar8; int *effectIt; Vector *pVVar9; uint uVar10; int iVar11; uint uVar12; LayerState *layer; Weapon *in_ECX; Entity_Laser *pEVar13; ANM2 *pAVar14; Entity_Player *ownerPlayer; void *pvVar15; void *pvVar16; undefined1 freeBlock [4]; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int extraout_ECX_03; uint extraout_EDX; Entity_Player *pEVar17; int iVar18; float *pfVar19; ColorMod *spriteColor; bool bVar20; bool bVar21; float10 fVar22; float fVar23; undefined4 uVar24; float fVar25; float fVar26; Entity *pEVar27; float chargeRatio; ANM2 *pAVar28; undefined1 auVar29 [16]; longlong lVar30; Vector local_1d8; undefined1 multiShotLaserOffset [8]; Vector multiShotLaserVelocity; Vector effectSpawnPos; int local_1b8; Vector multiShotOffset; Vector multiShotVelocity; Vector sideLaserDirection2; Vector sideTearVelocity; Vector backTearVelocity; Vector multiShotLaserDirection; Vector randomLaserDirection; Vector sideLaserDirection; Vector backLaserDirection; Vector shotPos; Vector shotVelocity; Vector randomTearVelocity; Vector baseVelocity; Vector local_14c; Vector shotDirection; int eyeMode; float local_138; uint isNeptunus; uint isCursedEye; ANM2 *local_12c; uint local_128; uint numTears; Vector local_120; float laserAimX; float laserAimY; ANM2 *local_110; float local_10c; float shotSpeed; byte animDigit; char local_103; Vector firePos; Vector aimDirection; Entity_Laser *local_ec; Entity_Player *player; ANM2 *local_e4; float local_e0; float aimY; float aimX; Entity_Player *ownerAsPlayer; ANM2 *local_d0; Entity *local_cc; Entity *local_c8; Vector local_c4; float spreadAngle; ANM2 *local_b8; byte isChocolateMilk; ANM2 *local_b0; byte local_a9; undefined1 hitParams [8]; float local_a0; float local_9c; float local_98; float local_94; float local_90; float local_8c; float local_88; float local_84; float local_80; float local_7c; float local_78; float local_5c; undefined1 local_40 [12]; float fStack_34; float fStack_30; undefined1 auStack_2c [4]; float fStack_28; float fStack_24; float fStack_20; undefined1 uStack_1c; char cStack_1b; char cStack_1a; undefined1 uStack_19; float local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; local_8 = 0xffffffff; puStack_c = &LAB_00b10905; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(auStack_2c + 0x28); ExceptionList = &local_10; Weapon::Fire(in_ECX,param_1,param_2,param_3); pEVar17 = in_ECX->_owner; shotSpeed = 1.0; if (pEVar17 == (Entity_Player *)0x0) { LAB_00a0a7cb: ownerPlayer = (Entity_Player *)0x0; ownerAsPlayer = pEVar17; if (pEVar17 == (Entity_Player *)0x0) { LAB_00a0a79b: player = ownerPlayer; } else { player = (Entity_Player *)0x0; if (pEVar17->_type == 1) { shotSpeed = pEVar17->_shotspeed; goto LAB_00a0a830; } } ownerPlayer = player; if (pEVar17 != (Entity_Player *)0x0) { ownerAsPlayer = (Entity_Player *)0x0; if (pEVar17->_type == 1) { shotSpeed = pEVar17->_shotspeed; goto LAB_00a0a830; } player = ownerPlayer; if (pEVar17->_type == 3) { ownerAsPlayer = (Entity_Player *)0x0; if (*(int *)&pEVar17->_isControlsEnabled != 0) { shotSpeed = *(float *)(*(int *)&pEVar17->_isControlsEnabled + 0x1464); goto LAB_00a0a830; } } } ownerAsPlayer = (Entity_Player *)0x0; } else { if (pEVar17->_type != 1) { if (pEVar17->_type != 3) goto LAB_00a0a7cb; ownerPlayer = *(Entity_Player **)&pEVar17->_isControlsEnabled; goto LAB_00a0a79b; } shotSpeed = pEVar17->_shotspeed; player = pEVar17; ownerAsPlayer = pEVar17; ownerPlayer = pEVar17; } LAB_00a0a830: isChocolateMilk = (byte)in_ECX->_modifiers & 1; isCursedEye = (uint)in_ECX->_modifiers >> 1 & 0xffffff01; if ((isChocolateMilk != 0) || (local_a9 = isChocolateMilk, (char)isCursedEye != '\0')) { local_a9 = 1; } uVar10 = 0; if (ownerPlayer == (Entity_Player *)0x0) { LAB_00a0a886: local_103 = '\0'; } else { bVar2 = Entity_Player::HasCollectible(ownerPlayer,0x18a,0); local_103 = '\x01'; uVar10 = extraout_EDX; if (bVar2 == 0) goto LAB_00a0a886; } uVar12 = in_ECX->_modifiers; if (((uVar12 >> 7 & 1) != 0) || (*(float *)&in_ECX->field_0x10 <= 0.0)) { local_e0 = 1.4013e-45; } else { local_e0 = (float)(uVar10 & 0xffffff00); } isNeptunus = uVar12 >> 8 & 0xffff01; local_128 = 0; if ((uVar12 & 0x100) == 0) { local_128 = (uint)local_a9; } if (ownerAsPlayer != (Entity_Player *)0x0) { iVar6 = Entity_Player::get_seeded_variant(ownerAsPlayer); local_e0 = (float)((uint)local_e0 & 0xff); if (iVar6 != -1) { local_e0 = 1.4013e-45; } } cVar3 = SUB41(local_e0,0); pvVar15 = in_ECX->_owner; if (((pvVar15 == (void *)0x0) || (*(int *)((int)pvVar15 + 0x28) != 1)) || (*(int *)((int)pvVar15 + 0x18f8) < 1)) { LAB_00a0a981: local_a9 = param_2; if (pvVar15 != (void *)0x0) goto LAB_00a0a98e; LAB_00a0a9c8: pEVar27 = *(Entity **)&in_ECX->field_0x28; pEVar13 = *(Entity_Laser **)&in_ECX->field_0x2c; } else { if (isChocolateMilk == 0) { LAB_00a0a969: if (((char)isCursedEye == '\0') || (*(int *)&in_ECX[1].field_0xc < 1)) goto LAB_00a0a981; } else { local_e4 = (ANM2 *)(*(float *)&in_ECX->field_0x10 * 2.5); local_b0 = (ANM2 *)0x40a00000; ppAVar8 = &local_e4; if (5.0 <= (float)local_e4) { ppAVar8 = &local_b0; } if (*(float *)&in_ECX->field_0x14 < (float)*ppAVar8) goto LAB_00a0a969; } local_a9 = 0; LAB_00a0a98e: if ((((*(int *)((int)pvVar15 + 0x28) != 1) && ((*(int *)((int)pvVar15 + 0x28) != 3 || (pvVar15 = *(void **)((int)pvVar15 + 0x410), pvVar15 == (void *)0x0)))) || (iVar6 = *(int *)((int)pvVar15 + 0x140c), iVar6 == 0)) || (local_103 == '\0')) goto LAB_00a0a9c8; pEVar27 = *(Entity **)(iVar6 + 0x33c); pEVar13 = *(Entity_Laser **)(iVar6 + 0x340); } local_120.x = (float)pEVar27; local_120.y = (float)pEVar13; if (((float)pEVar27 == g_vectorZero.x) && ((float)pEVar13 == g_vectorZero.y)) { bVar20 = false; } else { bVar20 = true; } if ((param_3 == 0) && (local_a9 != 0)) { if (bVar20) { pVVar7 = Weapon::get_owner_position(in_ECX,&local_14c); fVar23 = (float)pEVar13 - pVVar7->y; fVar25 = (float)pEVar27 - pVVar7->x; fVar23 = sqrtf(fVar23 * fVar23 + fVar25 * fVar25); fVar23 = (fVar23 - 50.0) / 250.0; if (fVar23 <= 0.0) { fVar23 = 0.0; } if (1.0 <= fVar23) { fVar23 = 1.0; } if (*(float *)&in_ECX->field_0x14 <= 0.0) { iVar6 = 1; } else { iVar6 = (int)(fVar23 * 4.0 + 1.0); } if (((isChocolateMilk == 0) || (*(float *)&in_ECX->field_0x14 <= ((*(float *)&in_ECX->field_0x10 * 2.5 - 5.0) * fVar23 + 5.0) - 1.0)) && (((char)isCursedEye == '\0' || (*(int *)&in_ECX[1].field_0xc < iVar6)))) { cVar3 = SUB41(local_e0,0); goto LAB_00a0aaec; } } else { LAB_00a0aaec: if (((cVar3 == '\0') || ((char)local_128 == '\0')) || (((puVar1 = &in_ECX->field_0x14, isChocolateMilk == 0 || (fVar23 = *(float *)puVar1, fVar23 < *(float *)&in_ECX->field_0x10 * 2.5)) && (((char)isCursedEye == '\0' || (((fVar23 = *(float *)puVar1, fVar23 <= 0.0 || (*(int *)&in_ECX[1].field_0xc < 5)) && ((0.0 < fVar23 || (*(int *)&in_ECX[1].field_0xc < 1)))))))))) goto LAB_00a0ab67; local_e4 = (ANM2 *)0x3727c5ac; ppAVar8 = &local_e4; if (1e-05 <= fVar23) { ppAVar8 = (ANM2 **)puVar1; } pAVar14 = *ppAVar8; *(ANM2 **)&in_ECX[1].field_0x10 = pAVar14; *(ANM2 **)puVar1 = pAVar14; } local_a9 = 0; } LAB_00a0ab67: aimX = param_1->x; aimY = param_1->y; if (param_2 == 0) { aimX = *(float *)&in_ECX->field_0x20; aimY = *(float *)&in_ECX->field_0x24; } aimDirection.x = aimX; aimDirection.y = aimY; bVar2 = Weapon::IsAxisAligned(in_ECX); if (bVar2 == 0) { fVar23 = sqrtf(aimY * aimY + aimX * aimX); if (fVar23 <= 0.0) goto LAB_00a0acb1; aimDirection.x = aimX * (1.0 / fVar23); aimY = aimY * (1.0 / fVar23); LAB_00a0ac91: } else { if (ABS(aimX) <= ABS(aimY)) { aimDirection.x = 0.0; if (0.0 <= aimY) { aimY = 1.0; } else { aimY = (float)&DAT_bf800000; } goto LAB_00a0ac91; } aimY = 0.0; if (0.0 <= aimX) { aimDirection.x = 1.0; } else { aimDirection.x = (float)&DAT_bf800000; } } aimDirection.y = aimY; aimX = aimDirection.x; LAB_00a0acb1: pEVar17 = ownerAsPlayer; eyeMode = 0; if (ownerAsPlayer != (Entity_Player *)0x0) { if (((((char)isCursedEye == '\0') && (ownerAsPlayer->_playerType != 2)) && (bVar2 = Entity_Player::HasCollectible(ownerAsPlayer,0x1bc,0), bVar2 == 0)) && ((bVar2 = Entity_Player::HasCollectible(pEVar17,0x2c4,0), bVar2 == 0 && (pEVar17->_playerType != 0x17)))) { bVar2 = Entity_Player::HasCollectible(pEVar17,0x98,0); if (bVar2 != 0) { eyeMode = -1; } } else { eyeMode = 1; } } pAVar14 = (ANM2 *)0x1; local_110 = (ANM2 *)0x1; if (((char)local_128 == '\0') && (pEVar17 != (Entity_Player *)0x0)) { bVar2 = Entity_Player::HasCollectible(pEVar17,600,0); pAVar14 = (ANM2 *)0x1; if (bVar2 != 0) { if (eyeMode == 0) { pAVar14 = (ANM2 *)0x2; } local_110 = pAVar14; } } local_1b8 = 0x4c; local_e4 = (ANM2 *)0x0; uVar10 = local_128; do { pAVar28 = *(ANM2 **)&in_ECX->field_0x10; iVar6 = 0xc; if (local_e4 != (ANM2 *)0x0) { iVar6 = local_1b8; } pfVar19 = (float *)(&in_ECX->field_0x0 + iVar6); if (pAVar14 == (ANM2 *)0x2) { fVar23 = 30.0 / ((float)pAVar28 + 1.0); if (local_e4 == (ANM2 *)0x0) { local_12c = (ANM2 *)(30.0 / (fVar23 * 0.5833333) - 1.0); } else { local_12c = (ANM2 *)(30.0 / (fVar23 * 0.41666666) - 1.0); } } else { local_12c = pAVar28; } if ((char)isNeptunus != '\0') { local_c8 = (Entity *)((float)pAVar28 * 12.0); local_b0 = *(ANM2 **)&in_ECX->field_0x14; if ((float)local_c8 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar23 = ((float)local_b0 - 0.0) / ((float)local_c8 - 0.0); if (fVar23 <= 0.0) { fVar23 = 0.0; } if (1.0 <= fVar23) { fVar23 = 1.0; } fVar23 = pow(fVar23 * 1.4495001 + 1.0,2.0); fVar25 = (float)local_12c + 1.0; local_12c = (ANM2 *)0x3e800000; local_b0 = (ANM2 *)(fVar25 / fVar23); ppAVar8 = &local_b0; if ((float)local_b0 <= 0.25) { ppAVar8 = &local_12c; } local_12c = (ANM2 *)((float)*ppAVar8 - 1.0); pAVar14 = local_110; uVar10 = local_128; } fVar23 = 0.0; local_e0 = 0.0; if ((char)uVar10 == '\0') { if (local_a9 != 0) { if (param_3 != 0) { ExceptionList = local_10; return; } local_e0 = -1.0 - *pfVar19; if (*pfVar19 <= 0.0 && *pfVar19 != 0.0) { do { if (7 < (uint)fVar23) break; fVar23 = (float)((int)fVar23 + 1); fVar25 = (float)local_12c + 1.0 + *pfVar19; *pfVar19 = fVar25; } while (fVar25 < 0.0); } *(undefined4 *)&in_ECX[1].field_0x10 = 0; } } else { if (local_a9 == 0) { if ((isChocolateMilk == 0) || (*(float *)&in_ECX->field_0x14 <= 0.0)) { if (((char)isCursedEye != '\0') && (0 < *(int *)&in_ECX[1].field_0xc)) { fVar23 = 1.4013e-45; } } else { fVar23 = 1.4013e-45; } } if (param_3 != 0) { if (fVar23 == 0.0) { ExceptionList = local_10; return; } Weapon::SetBlinkTime(in_ECX,1,(int)pAVar14); ExceptionList = local_10; return; } } if (fVar23 != 0.0) { do { pEVar17 = in_ECX->_owner; local_138 = (float)((int)fVar23 - 1); if (pEVar17 == (Entity_Player *)0x0) { LAB_00a0affc: fStack_24 = 1.4013e-45; numTears = 0; local_40._8_4_ = 0.0; fStack_34 = 0.0; fStack_30 = 0.0; auStack_2c = (undefined1 [4])0x0; fStack_28 = 0.0; fStack_20 = 0.0; uStack_1c = 0; cStack_1b = '\0'; cStack_1a = '\0'; local_b0 = (ANM2 *)0x0; local_18 = (float)((uint)local_18 & 0xffff0000); } else { if (pEVar17->_type == 1) { ownerPlayer = pEVar17; } else if ((pEVar17->_type != 3) || (ownerPlayer = *(Entity_Player **)&pEVar17->_isControlsEnabled, ownerPlayer == (Entity_Player *)0x0)) goto LAB_00a0affc; Entity_Player::GetMultiShotParams (ownerPlayer,(Weapon_MultiShotParams *)(local_40 + 8), *(int *)&in_ECX->field_0x30); pEVar17 = in_ECX->_owner; local_b0 = (ANM2 *)((uint)local_18 & 0xffff); numTears = local_40._8_4_ & 0xffff; } shotDirection.x = aimX; local_c8 = (Entity *)0x0; shotDirection.y = aimY; if (isChocolateMilk == 0) { fVar23 = (float)(7 - (int)(*(float *)&in_ECX->field_0x10 * -0.45)); local_c4.x = 1.54143e-44; if (0xb < (int)fVar23) { local_c4.x = fVar23; } if ((pEVar17 == (Entity_Player *)0x0) || (pEVar17->_type != 1)) { ownerPlayer = (Entity_Player *)0x0; if ((pEVar17 == (Entity_Player *)0x0) || (pEVar17->_type != 3)) goto LAB_00a0b0e8; } else { ownerPlayer = pEVar17; LAB_00a0b0e8: pEVar17 = (Entity_Player *)0x0; } if (ownerPlayer != (Entity_Player *)0x0) { pVVar7 = (Vector *)&ownerPlayer->_blinkTime; LAB_00a0b100: bVar21 = SBORROW4((int)pVVar7->x,(int)local_c4.x); bVar20 = (int)pVVar7->x - (int)local_c4.x < 0; goto LAB_00a0b102; } if (pEVar17 != (Entity_Player *)0x0) { pVVar7 = &pEVar17->_chargeBarSprites[5]._offset; goto LAB_00a0b100; } } else { local_c4.x = 1.68156e-44; if ((pEVar17 == (Entity_Player *)0x0) || (pEVar17->_type != 1)) { ownerPlayer = (Entity_Player *)0x0; if ((pEVar17 == (Entity_Player *)0x0) || (pEVar17->_type != 3)) goto LAB_00a0b082; } else { ownerPlayer = pEVar17; LAB_00a0b082: pEVar17 = (Entity_Player *)0x0; } if (ownerPlayer == (Entity_Player *)0x0) { if (pEVar17 == (Entity_Player *)0x0) goto LAB_00a0b10f; fVar23 = pEVar17->_chargeBarSprites[5]._offset.x; bVar21 = SBORROW4((int)fVar23,0xc); bVar20 = (int)fVar23 + -0xc < 0; pVVar7 = &pEVar17->_chargeBarSprites[5]._offset; } else { pVVar7 = (Vector *)&ownerPlayer->_blinkTime; bVar21 = SBORROW4(*(int *)pVVar7,0xc); bVar20 = *(int *)pVVar7 + -0xc < 0; } LAB_00a0b102: pVVar9 = &local_c4; if (bVar21 == bVar20) { pVVar9 = pVVar7; } pVVar7->x = pVVar9->x; } LAB_00a0b10f: if ((char)isNeptunus != '\0') { fVar23 = ((*(float *)&in_ECX->field_0x14 + 1.0) / (*(float *)&in_ECX->field_0x10 * 12.0 + 1.0)) * 18.0; if (fVar23 == 0.0) { Weapon::stop_costume_item_anim(in_ECX,0x255); } else { Weapon::UpdateHeadChargeAnimation(in_ECX,0x255,2,&aimDirection,fVar23); aimY = aimDirection.y; aimX = aimDirection.x; } } Weapon::TriggerTearEffects(in_ECX,&shotDirection,1); if (ownerAsPlayer != (Entity_Player *)0x0) { if (eyeMode == 0) { if (local_110 < (ANM2 *)0x2) { cVar3 = FUN_009f57f0(); pvVar15 = in_ECX->_owner; cVar3 = -cVar3; if ((pvVar15 != (void *)0x0) && (*(int *)((int)pvVar15 + 0x28) == 1)) goto LAB_00a0b20c; } else { pvVar15 = in_ECX->_owner; if ((pvVar15 != (void *)0x0) && (*(int *)((int)pvVar15 + 0x28) == 1)) { cVar3 = (local_e4 != (ANM2 *)0x0) * '\x02' + -1; LAB_00a0b20c: *(char *)((int)pvVar15 + 0x1578) = cVar3; } } } else { pvVar15 = in_ECX->_owner; if ((pvVar15 != (void *)0x0) && (*(int *)((int)pvVar15 + 0x28) == 1)) { *(char *)((int)pvVar15 + 0x1578) = (char)eyeMode; } } uVar4 = FUN_009f57f0(); local_c8 = (Entity *)(uint)uVar4; cVar3 = FUN_009f5aa0(); if (cVar3 != '\0') { local_c4.x = (float)(int)(short)uVar4 * 45.0 * 0.017453292; local_b8 = (ANM2 *)cos(local_c4.x); fVar23 = sin(local_c4.x); fVar25 = fVar23 * shotDirection.x; shotDirection.x = (float)local_b8 * shotDirection.x - fVar23 * shotDirection.y; shotDirection.y = (float)local_b8 * shotDirection.y + fVar25; } pEVar17 = player; if ((((isChocolateMilk != 0) || ((char)isNeptunus != '\0')) || (1 < (short)numTears)) || ((bVar2 = Entity_Player::HasCollectible(player,0xa9,0), bVar2 != 0 || (bVar2 = Entity_Player::HasCollectible(pEVar17,0x95,0), bVar2 != 0)))) { local_c8 = (Entity *)0x0; } bVar2 = Entity_Player::HasCollectible(pEVar17,6,0); if (bVar2 == 0) { if ((pEVar17->_temporaryeffects)._disabled == 0) { for (effectIt = (pEVar17->_temporaryeffects)._effects._begin; effectIt != (pEVar17->_temporaryeffects)._effects._end; effectIt = effectIt + 4) { iVar6 = *(int *)*effectIt; if ((((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) && (((int *)*effectIt)[1] == 6) ) goto LAB_00a0b368; } pEVar17 = player; } bVar2 = Entity_Player::HasCollectible(pEVar17,0x1b8,0); if (bVar2 == 0) goto LAB_00a0b3c1; } LAB_00a0b368: pvVar15 = in_ECX->_owner; local_c8 = (Entity *)0x0; local_c4.x = 2.24208e-44; if ((((pvVar15 == (void *)0x0) || (pvVar16 = pvVar15, *(int *)((int)pvVar15 + 0x28) != 1)) && (pvVar16 = (void *)0x0, pvVar15 != (void *)0x0)) && (*(int *)((int)pvVar15 + 0x28) == 3)) { pVVar7 = (Vector *)((int)pvVar15 + 0xd50); } else { if (pvVar16 == (void *)0x0) goto LAB_00a0b3c1; pVVar7 = (Vector *)((int)pvVar16 + 0x1338); } pVVar9 = &local_c4; if (0xf < (int)pVVar7->x) { pVVar9 = pVVar7; } pVVar7->x = pVVar9->x; } LAB_00a0b3c1: pEVar17 = ownerAsPlayer; pvVar15 = in_ECX->_owner; if (pvVar15 == (void *)0x0) { firePos.x = g_vectorZero.x; firePos.y = g_vectorZero.y; } else { firePos.x = *(float *)((int)pvVar15 + 0x33c); firePos.y = *(float *)((int)pvVar15 + 0x340); } local_d0 = (ANM2 *)(shotDirection.x * 10.0); local_b8 = (ANM2 *)(shotDirection.y * 10.0); iVar6 = 0xa0b447; pVVar7 = Weapon::get_tear_movement_inheritance(in_ECX,&local_1d8,&shotDirection); baseVelocity.x = (float)local_d0 + pVVar7->x; local_d0 = (ANM2 *)baseVelocity.x; baseVelocity.y = (float)local_b8 + pVVar7->y; local_b8 = (ANM2 *)baseVelocity.y; if (player != (Entity_Player *)0x0) { iVar6 = 0xa0b498; bVar2 = Entity_Player::HasCollectible(player,0x95,0); if (bVar2 != 0) { uVar10 = Random(); fVar23 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.9; baseVelocity.y = fVar23 * (float)local_b8; baseVelocity.x = fVar23 * (float)local_d0; local_b8 = (ANM2 *)baseVelocity.y; local_d0 = (ANM2 *)baseVelocity.x; } } local_c4.x = 1.0; if (isChocolateMilk != 0) { local_c4.x = *(float *)&in_ECX->field_0x10 + 1.0; if ((char)isNeptunus == '\0') { fVar23 = *(float *)&in_ECX[1].field_0x10; local_c4.x = local_c4.x * 2.5; } else { fVar23 = *(float *)&in_ECX->field_0x14; local_c4.x = local_c4.x * 12.0; } local_c4.x = ((fVar23 + 1.0) * 4.0) / local_c4.x; if (local_c4.x <= 0.1) { local_c4.x = 0.1; } if (4.0 <= local_c4.x) { local_c4.x = 4.0; } } auVar29 = ZEXT816(0); spreadAngle = 0.0; if (pEVar17 != (Entity_Player *)0x0) { iVar11 = FUN_009f5870(); iVar6 = 0xa0b5a7; bVar2 = Entity_Player::HasCollectible(ownerAsPlayer,0x170,0); if ((bVar2 != 0) && (0 < iVar11)) { spreadAngle = ((float)(iVar11 / 0x5a) * 16.0) / 3.0 + 0.0; } fVar23 = spreadAngle; FUN_009f5830(); lVar30 = FUN_009f5850(); pEVar17 = ownerAsPlayer; iVar18 = (int)((ulonglong)lVar30 >> 0x20); iVar11 = (int)lVar30; if (((0xffffffff < lVar30) && (0 < iVar11)) && (iVar18 < iVar11 + -1)) { spreadAngle = fVar23 + ((float)iVar18 * 24.0) / (float)iVar11; } iVar11 = Entity_Player::get_seeded_variant(ownerAsPlayer); if (iVar11 == 2) { spreadAngle = spreadAngle + 24.0; LAB_00a0b676: } else { iVar11 = Entity_Player::get_seeded_variant(pEVar17); if (iVar11 == 4) { spreadAngle = spreadAngle + 8.0; goto LAB_00a0b676; } } auVar29 = ZEXT416((uint)spreadAngle); } if ((char)isNeptunus != '\0') { fVar23 = (*(float *)&in_ECX->field_0x14 * 16.0) / (*(float *)&in_ECX->field_0x10 * 12.0); if (fVar23 <= 0.0) { fVar23 = 0.0; } if (16.0 <= fVar23) { fVar23 = 16.0; } auVar29._0_4_ = auVar29._0_4_ + fVar23; spreadAngle = auVar29._0_4_; } fVar23 = auVar29._0_4_; if ((((short)local_c8 == 0) || (eyeMode != 1)) || (pEVar17 == (Entity_Player *)0x0)) { LAB_00a0bfdc: if (cStack_1b != '\0') { local_10c = shotSpeed * -(float)local_d0; local_ec = (Entity_Laser *)(shotSpeed * -(float)local_b8); if (fVar23 == 0.0) { backTearVelocity.x = local_10c; backTearVelocity.y = (float)local_ec; } else { uVar10 = Random(); local_c4.y = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292; local_cc = (Entity *)cos(local_c4.y); fVar23 = sin(local_c4.y); backTearVelocity.x = local_10c * (float)local_cc - (float)local_ec * fVar23; backTearVelocity.y = (float)(local_10c * fVar23 + (float)local_ec * (float)local_cc); } Weapon::fire_tear(in_ECX,&firePos,&backTearVelocity,6,iVar6,local_c4.x,local_e0); } if (cStack_1a != '\0') { local_c4.y = shotSpeed * (float)local_d0; local_cc = (Entity *)(shotSpeed * -(float)local_b8); if (spreadAngle == 0.0) { sideTearVelocity.x = (float)local_cc; sideTearVelocity.y = local_c4.y; } else { uVar10 = Random(); local_ec = (Entity_Laser *) (((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292); local_10c = cos((float)local_ec); fVar23 = sin((float)local_ec); sideTearVelocity.x = (float)local_cc * local_10c - local_c4.y * fVar23; sideTearVelocity.y = (float)local_cc * fVar23 + local_c4.y * local_10c; } Weapon::fire_tear(in_ECX,&firePos,&sideTearVelocity,6,iVar6,local_c4.x,local_e0); local_cc = (Entity *)(shotSpeed * (float)local_b8); local_c4.y = shotSpeed * -(float)local_d0; if (spreadAngle == 0.0) { local_120.x = (float)local_cc; local_120.y = local_c4.y; } else { uVar10 = Random(); local_ec = (Entity_Laser *) (((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292); local_10c = cos((float)local_ec); fVar23 = sin((float)local_ec); local_120.x = (float)((float)local_cc * local_10c - local_c4.y * fVar23); local_120.y = (float)((float)local_cc * fVar23 + local_c4.y * local_10c); } Weapon::fire_tear(in_ECX,&firePos,&local_120,6,iVar6,local_c4.x,local_e0); } uVar10 = (uint)local_b0 & 0xffff; if (uVar10 != 0) { if (spreadAngle == 0.0) { do { uVar12 = Random(); local_ec = (Entity_Laser *) ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292); local_cc = (Entity *)cos((float)local_ec); fVar23 = sin((float)local_ec); randomTearVelocity.x = shotSpeed * ((float)local_d0 * (float)local_cc - (float)local_b8 * fVar23); randomTearVelocity.y = shotSpeed * ((float)local_d0 * fVar23 + (float)local_b8 * (float)local_cc); Weapon::fire_tear(in_ECX,&firePos,&randomTearVelocity,6,iVar6,local_c4.x,local_e0); uVar10 = uVar10 - 1; } while (uVar10 != 0); } else { do { uVar12 = Random(); local_ec = (Entity_Laser *) ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292); local_cc = (Entity *)cos((float)local_ec); fVar23 = sin((float)local_ec); fVar25 = (float)local_b8 * (float)local_cc; local_cc = (Entity *) (shotSpeed * ((float)local_d0 * (float)local_cc - (float)local_b8 * fVar23)); local_ec = (Entity_Laser *)(shotSpeed * ((float)local_d0 * fVar23 + fVar25)); local_c4.y = (float)local_ec; uVar12 = Random(); local_ec = (Entity_Laser *) (((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292); local_10c = cos((float)local_ec); fVar23 = sin((float)local_ec); randomTearVelocity.x = (float)local_cc * local_10c - local_c4.y * fVar23; randomTearVelocity.y = local_c4.y * local_10c + (float)local_cc * fVar23; Weapon::fire_tear(in_ECX,&firePos,&randomTearVelocity,6,iVar6,local_c4.x,local_e0); uVar10 = uVar10 - 1; } while (uVar10 != 0); } } sVar5 = (short)local_c8; if (sVar5 != 0) { uVar10 = Random(); fVar23 = (float)(int)sVar5; fVar25 = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.3; firePos.x = firePos.x - fVar23 * (float)local_b8 * fVar25; firePos.y = fVar23 * (float)local_d0 * fVar25 + firePos.y; } sVar5 = (short)numTears; local_b0 = (ANM2 *)0x0; if (0 < sVar5) { uVar24 = CONCAT13(uStack_19,CONCAT12(cStack_1a,CONCAT11(cStack_1b,uStack_1c))); if (spreadAngle == 0.0) { iVar6 = 0; do { fVar23 = fStack_20; FUN_009f4230(&multiShotOffset,iVar6,*(undefined4 *)&in_ECX->field_0x30, baseVelocity.x,baseVelocity.y,shotSpeed,local_40._8_4_,fStack_34, fStack_30,auStack_2c,fStack_28,fStack_24,fStack_20,uVar24,local_18); shotPos.x = multiShotOffset.x + firePos.x; shotVelocity.x = multiShotVelocity.x; shotVelocity.y = multiShotVelocity.y; shotPos.y = multiShotOffset.y + firePos.y; Weapon::fire_tear(in_ECX,&shotPos,&shotVelocity,0,(int)fVar23,local_c4.x,local_e0); iVar6 = iVar6 + 1; uVar24 = CONCAT13(uStack_19,CONCAT12(cStack_1a,CONCAT11(cStack_1b,uStack_1c))); } while (iVar6 < (short)numTears); } else { do { fVar23 = fStack_20; FUN_009f4230(&multiShotOffset,local_b0,*(undefined4 *)&in_ECX->field_0x30, baseVelocity.x,baseVelocity.y,shotSpeed,local_40._8_4_,fStack_34, fStack_30,auStack_2c,fStack_28,fStack_24,fStack_20,uVar24,local_18); uVar10 = Random(); local_ec = (Entity_Laser *) (((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292); local_cc = (Entity *)cos((float)local_ec); fVar25 = sin((float)local_ec); shotVelocity.x = multiShotVelocity.x * (float)local_cc - multiShotVelocity.y * fVar25; shotPos.y = multiShotOffset.y + firePos.y; shotVelocity.y = multiShotVelocity.x * fVar25 + multiShotVelocity.y * (float)local_cc; shotPos.x = multiShotOffset.x + firePos.x; Weapon::fire_tear(in_ECX,&shotPos,&shotVelocity,0,(int)fVar23,local_c4.x,local_e0); uVar24 = CONCAT13(uStack_19,CONCAT12(cStack_1a,CONCAT11(cStack_1b,uStack_1c))); local_b0 = (ANM2 *)((local_b0->_filename)._buf + 1); } while ((int)local_b0 < (int)sVar5); } } if ((ownerAsPlayer != (Entity_Player *)0x0) && (iVar6 = Entity_Player::get_seeded_variant(ownerAsPlayer), iVar6 != -1)) { uVar10 = Random(); fVar23 = sqrtf((float)local_b8 * (float)local_b8 + (float)local_d0 * (float)local_d0); if (fVar23 <= 0.0) { pAVar14 = local_d0; pAVar28 = local_b8; } else { pAVar14 = (ANM2 *)((float)local_d0 * (4.0 / fVar23)); pAVar28 = (ANM2 *)((float)local_b8 * (4.0 / fVar23)); } effectSpawnPos.x = firePos.x + (float)pAVar14; effectSpawnPos.y = firePos.y + (float)pAVar28; pEVar27 = Game::Spawn(g_game,1000,0xf,&effectSpawnPos,&g_vectorZero,(Entity *)0x0,0, uVar10); local_b0 = &pEVar27->_sprite; pAVar14 = &pEVar27[1]._sprite; (pAVar14->_filename)._buf[8] = '\x02'; (pAVar14->_filename)._buf[9] = '\0'; (pAVar14->_filename)._buf[10] = '\0'; (pAVar14->_filename)._buf[0xb] = '\0'; pAVar14 = &pEVar27[1]._sprite; (pAVar14->_filename)._buf[0xc] = '\x02'; (pAVar14->_filename)._buf[0xd] = '\0'; (pAVar14->_filename)._buf[0xe] = '\0'; (pAVar14->_filename)._buf[0xf] = '\0'; uStack_1c = 0; cStack_1b = '\0'; cStack_1a = '\0'; uStack_19 = 0; local_18 = 2.10195e-44; auStack_2c = (undefined1 [4])0x0; local_c8 = pEVar27; std::string::assign(auStack_2c,(byte *)"gfx/promo/gfuel/effects/muzzle_flash.anm2",0x29) ; local_8 = 0; ANM2::Load(&pEVar27->_sprite,(std_string *)auStack_2c,1); local_8 = 0xffffffff; if (0xf < (uint)local_18) { uVar10 = (int)local_18 + 1; freeBlock = auStack_2c; if (0xfff < uVar10) { freeBlock = *(undefined1 (*) [4])((int)auStack_2c + -4); uVar10 = (int)local_18 + 0x24; if (0x1f < (uint)((int)auStack_2c + (-4 - (int)freeBlock))) goto LAB_00a0d400; } operator_delete((void *)freeBlock,uVar10); } (pEVar27->_posOffset).x = 0.0; (pEVar27->_posOffset).y = -20.0; uVar10 = Random(); local_103 = '\0'; animDigit = ((byte)uVar10 & 3) + 0x30; bVar2 = ANM2::SetAnimation(&pEVar27->_sprite,&animDigit,1); pAVar14 = local_b0; if (bVar2 != 0) { AnimationState::Rewind(&local_b0->_animState); (pAVar14->_animState)._isPlaying = 1; pEVar27 = local_c8; } uVar10 = Random(); Entity_Player::GetTearHitParams(hitParams,1,0x3f800000,(uVar10 & 1) * 2 + -1,0); fVar23 = local_5c * g_vectorOne.x; (pEVar27->_sprite)._scale.y = local_5c * g_vectorOne.y; (pEVar27->_sprite)._scale.x = fVar23; fVar23 = local_9c; fVar25 = local_a0; local_10c = local_98; if (local_84 != 0.0) { fVar26 = local_9c * 0.71516 + local_a0 * 0.212671 + local_98 * 0.072169; fVar25 = local_a0 + (fVar26 * local_90 - local_a0) * local_84; fVar23 = local_9c + (fVar26 * local_8c - local_9c) * local_84; local_10c = local_98 + (fVar26 * local_88 - local_98) * local_84; } local_10c = local_10c + local_78; local_cc = (Entity *)(fVar23 + local_7c); local_ec = (Entity_Laser *)(local_80 + fVar25); Color::Reset((Color *)local_40); local_40._0_4_ = local_ec; spriteColor = &(pEVar27->_sprite)._color; local_40._4_4_ = local_cc; local_40._8_4_ = local_10c; fStack_34 = local_94; if (spriteColor != (ColorMod *)local_40) { spriteColor->_tint[0] = (float)local_ec; (pEVar27->_sprite)._color._tint[1] = (float)local_cc; (pEVar27->_sprite)._color._tint[2] = local_10c; (pEVar27->_sprite)._color._tint[3] = local_94; (pEVar27->_sprite)._color._colorize[0] = fStack_30; (pEVar27->_sprite)._color._colorize[1] = (float)auStack_2c; (pEVar27->_sprite)._color._colorize[2] = fStack_28; (pEVar27->_sprite)._color._colorize[3] = fStack_24; *(ulonglong *)(pEVar27->_sprite)._color._offset = CONCAT17(uStack_19, CONCAT16(cStack_1a,CONCAT15(cStack_1b,CONCAT14(uStack_1c,fStack_20)))); (pEVar27->_sprite)._color._offset[2] = local_18; } fVar23 = atan2f((float)local_b8,(float)local_d0); local_ec = (Entity_Laser *)(fVar23 * 57.295776); layer = ANM2::GetLayer(local_b0,(byte *)0x0); layer->_rotation = (float)local_ec; uVar10 = g_graphicsManager_flags; layer = ANM2::GetLayer(local_b0,(byte *)0x0); iVar6 = 1; if ((uVar10 & 4) == 0) { iVar6 = 6; } layer->_blendMode[1] = iVar6; layer->_blendMode[0] = 0; layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; (**(code **)(*(int *)local_c8 + 0xc))(); uVar10 = Random(); uVar12 = Random(); local_ec = (Entity_Laser *) (((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 20.0 - 10.0) * 0.017453292); local_cc = (Entity *)cos((float)local_ec); fVar23 = sin((float)local_ec); local_ec = (Entity_Laser *) ((float)local_d0 * (float)local_cc - (float)local_b8 * fVar23); local_cc = (Entity *)((float)local_d0 * fVar23 + (float)local_b8 * (float)local_cc); uVar12 = Random(); local_14c.x = -((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.1); local_14c.y = local_14c.x * (float)local_cc; local_14c.x = local_14c.x * (float)local_ec; pEVar27 = Game::Spawn(g_game,1000,0x1b,&firePos,&local_14c,(Entity *)0x0,0,uVar10); local_ec = (Entity_Laser *)&pEVar27->_sprite; uStack_1c = 0; cStack_1b = '\0'; cStack_1a = '\0'; uStack_19 = 0; local_18 = 2.10195e-44; auStack_2c = (undefined1 [4])0x0; local_cc = pEVar27; std::string::assign(auStack_2c,(byte *)"gfx/promo/gfuel/effects/casing.anm2",0x23); local_8 = 1; ANM2::Load(&pEVar27->_sprite,(std_string *)auStack_2c,1); local_8 = 0xffffffff; if (0xf < (uint)local_18) { uVar10 = (int)local_18 + 1; freeBlock = auStack_2c; if (0xfff < uVar10) { freeBlock = *(undefined1 (*) [4])((int)auStack_2c + -4); uVar10 = (int)local_18 + 0x24; if (0x1f < (uint)((int)auStack_2c + (-4 - (int)freeBlock))) { LAB_00a0d400: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete((void *)freeBlock,uVar10); } bVar2 = ANM2::SetAnimation(&pEVar27->_sprite,&DAT_00b63070,1); pEVar13 = local_ec; if (bVar2 != 0) { AnimationState::Rewind((AnimationState *)&local_ec->_subtype); ((AnimationState *)&pEVar13->_subtype)->_isPlaying = 1; pEVar27 = local_cc; } uVar10 = Random(); (pEVar27->_sprite)._playbackSpeed = (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 0.6 + 0.8; uVar10 = Random(); iVar6 = *(int *)pEVar27; pEVar27[1]._damageEvents._begin = (void *)(-8.0 - (float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 * 16.0); (**(code **)(iVar6 + 0xc))(); iVar6 = Entity_Player::get_seeded_variant(ownerAsPlayer); manager = g_manager; switch(iVar6) { case 2: case 3: local_b0 = (ANM2 *)0x33b; seed_fart_sound_override((int *)&local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0,1.0,2,0,1.0,0.0); iVar6 = 0x10; break; case 4: local_b0 = (ANM2 *)0x33e; seed_fart_sound_override((int *)&local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0,1.0,2,0,1.0,0.0); Game::ShakeScreen(g_game,10); pEVar17 = ownerAsPlayer; local_d0 = (ANM2 *)(-(float)local_d0 * 0.02); local_ec = (Entity_Laser *)(-(float)local_b8 * 0.02); local_cc = (Entity *)(ownerAsPlayer->_velocity).y; local_b8 = (ANM2 *)local_ec; local_b0 = local_d0; fVar23 = sqrtf((float)local_d0 * (float)local_d0 + (float)local_ec * (float)local_ec); if (fVar23 <= 0.0) { pEVar13 = local_ec; } else { local_b0 = (ANM2 *)((1.0 / fVar23) * (float)local_d0); pEVar13 = (Entity_Laser *)((1.0 / fVar23) * (float)local_b8); } fVar23 = (pEVar17->_velocity).x; fVar25 = -(fVar23 * (float)local_b0 + (float)local_cc * (float)pEVar13); if (fVar25 <= 0.2) { fVar25 = 0.2; } (pEVar17->_velocity).y = fVar25 * (float)local_b8 + (pEVar17->_velocity).y; (pEVar17->_velocity).x = fVar25 * (float)local_d0 + fVar23; goto LAB_00a0d2c8; case 5: local_b0 = (ANM2 *)0x340; LAB_00a0d055: seed_fart_sound_override((int *)&local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0,1.0,2,0,1.0,0.0); iVar6 = 10; break; default: if (0.75 <= local_5c) { if (1.75 < local_5c) { local_b0 = (ANM2 *)0x33a; goto LAB_00a0d055; } local_b0 = (ANM2 *)0x338; seed_fart_sound_override((int *)&local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0,1.0,2,0,1.0,0.0); iVar6 = 6; } else { local_b0 = (ANM2 *)0x339; seed_fart_sound_override((int *)&local_b0); SoundEffects::Play(&manager->_sfxManager,(int)local_b0,1.0,2,0,1.0,0.0); iVar6 = 3; } } Game::ShakeScreen(g_game,iVar6); } } else { iVar6 = 0xa0b6f1; bVar2 = Entity_Player::HasCollectible(pEVar17,0x98,0); if (bVar2 == 0) { fVar23 = spreadAngle; goto LAB_00a0bfdc; } laserAimX = shotDirection.x; laserAimY = shotDirection.y; fVar23 = sqrtf(shotDirection.x * shotDirection.x + shotDirection.y * shotDirection.y); if (0.0 < fVar23) { laserAimX = (1.0 / fVar23) * laserAimX; laserAimY = laserAimY * (1.0 / fVar23); } if ((*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c943c4) && (_Init_thread_header(&DAT_00c943c4), DAT_00c943c4 == -1)) { _atexit(FUN_00b16b10); _Init_thread_footer(&DAT_00c943c4); } g_weaponTearsFiredLasersEnd = DAT_00c943c8; if (cStack_1b != '\0') { local_d0 = (ANM2 *)((uint)laserAimX ^ 0x80000000); local_c4.y = -laserAimY; if (spreadAngle == 0.0) { backLaserDirection.x = (float)local_d0; backLaserDirection.y = local_c4.y; } else { uVar10 = Random(); local_c8 = (Entity *) (((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292); local_b8 = (ANM2 *)cos((float)local_c8); fVar23 = sin((float)local_c8); backLaserDirection.x = (float)((float)local_b8 * (float)local_d0 - fVar23 * local_c4.y); backLaserDirection.y = (float)local_b8 * local_c4.y + fVar23 * (float)local_d0; } local_c4.y = (float)Weapon::fire_laser(in_ECX,&firePos,1,&backLaserDirection,0,1, local_c4.x); if (g_weaponTearsFiredLasersEnd == DAT_00c943d0) { std::vector::_Emplace_reallocate (g_weaponTearsFiredLasersEnd,&local_c4.y); } else { *g_weaponTearsFiredLasersEnd = (Entity_Laser *)local_c4.y; g_weaponTearsFiredLasersEnd = g_weaponTearsFiredLasersEnd + 1; } } if (cStack_1a != '\0') { local_c8 = (Entity *)((uint)laserAimY ^ 0x80000000); if (spreadAngle == 0.0) { sideLaserDirection.y = laserAimX; sideLaserDirection.x = (float)local_c8; } else { uVar10 = Random(); local_c4.y = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292; local_b8 = (ANM2 *)cos(local_c4.y); fVar23 = sin(local_c4.y); sideLaserDirection.y = (float)local_b8 * laserAimX + (float)local_c8 * fVar23; sideLaserDirection.x = (float)((float)local_c8 * (float)local_b8 - fVar23 * laserAimX) ; } local_c4.y = (float)Weapon::fire_laser(in_ECX,&firePos,1,&sideLaserDirection,0,1, local_c4.x); if (g_weaponTearsFiredLasersEnd == DAT_00c943d0) { std::vector::_Emplace_reallocate (g_weaponTearsFiredLasersEnd,&local_c4.y); } else { *g_weaponTearsFiredLasersEnd = (Entity_Laser *)local_c4.y; g_weaponTearsFiredLasersEnd = g_weaponTearsFiredLasersEnd + 1; } local_b8 = (ANM2 *)((uint)laserAimX ^ 0x80000000); if (spreadAngle == 0.0) { sideLaserDirection2.x = laserAimY; sideLaserDirection2.y = (float)local_b8; } else { uVar10 = Random(); local_c4.y = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292; local_c8 = (Entity *)cos(local_c4.y); fVar23 = sin(local_c4.y); sideLaserDirection2.x = (float)local_c8 * laserAimY - fVar23 * (float)local_b8; sideLaserDirection2.y = (float)(fVar23 * laserAimY + (float)local_c8 * (float)local_b8); } local_c4.y = (float)Weapon::fire_laser(in_ECX,&firePos,1,&sideLaserDirection2,0,1, local_c4.x); if (g_weaponTearsFiredLasersEnd == DAT_00c943d0) { std::vector::_Emplace_reallocate (g_weaponTearsFiredLasersEnd,&local_c4.y); } else { *g_weaponTearsFiredLasersEnd = (Entity_Laser *)local_c4.y; g_weaponTearsFiredLasersEnd = g_weaponTearsFiredLasersEnd + 1; } } for (uVar10 = (uint)local_b0 & 0xffff; uVar10 != 0; uVar10 = uVar10 - 1) { uVar12 = Random(); local_c4.y = (float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 * 360.0 * 0.017453292; local_c8 = (Entity *)cos(local_c4.y); fVar23 = sin(local_c4.y); fVar25 = (float)local_c8 * laserAimX; local_c8 = (Entity *)((float)local_c8 * laserAimY + fVar23 * laserAimX); local_b8 = (ANM2 *)(fVar25 - fVar23 * laserAimY); if (spreadAngle == 0.0) { randomLaserDirection.x = (float)local_b8; randomLaserDirection.y = (float)local_c8; } else { uVar12 = Random(); local_c4.y = ((float)((double)(int)uVar12 + __uint_to_double_fixup[-((int)uVar12 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292; local_b0 = (ANM2 *)cos(local_c4.y); fVar23 = sin(local_c4.y); randomLaserDirection.x = (float)((float)local_b0 * (float)local_b8 - fVar23 * (float)local_c8); randomLaserDirection.y = (float)((float)local_b0 * (float)local_c8 + fVar23 * (float)local_b8); } local_c4.y = (float)Weapon::fire_laser(in_ECX,&firePos,1,&randomLaserDirection,0,1, local_c4.x); if (g_weaponTearsFiredLasersEnd == DAT_00c943d0) { std::vector::_Emplace_reallocate (g_weaponTearsFiredLasersEnd,&local_c4.y); } else { *g_weaponTearsFiredLasersEnd = (Entity_Laser *)local_c4.y; g_weaponTearsFiredLasersEnd = g_weaponTearsFiredLasersEnd + 1; } } iVar6 = 0; if (0 < (short)numTears) { uVar24 = CONCAT13(uStack_19,CONCAT12(cStack_1a,CONCAT11(cStack_1b,uStack_1c))); do { FUN_009f4230(multiShotLaserOffset,iVar6,3,laserAimX,laserAimY,shotSpeed,local_40._8_4_ ,fStack_34,fStack_30,auStack_2c,fStack_28,fStack_24,fStack_20,uVar24, local_18); local_c8 = (Entity *)multiShotLaserVelocity.x; local_b8 = (ANM2 *)multiShotLaserVelocity.y; fVar23 = sqrtf(multiShotLaserVelocity.y * multiShotLaserVelocity.y + multiShotLaserVelocity.x * multiShotLaserVelocity.x); if (fVar23 <= 0.0) { pAVar14 = (ANM2 *)multiShotLaserVelocity.y; pEVar27 = (Entity *)multiShotLaserVelocity.x; } else { local_c8 = (Entity *)((float)local_c8 * (1.0 / fVar23)); local_b8 = (ANM2 *)((float)local_b8 * (1.0 / fVar23)); pAVar14 = local_b8; pEVar27 = local_c8; } if (spreadAngle != 0.0) { uVar10 = Random(); local_c4.y = ((float)((double)(int)uVar10 + __uint_to_double_fixup[-((int)uVar10 >> 0x1f)]) * 2.3283064e-10 - 0.5) * spreadAngle * 0.017453292; local_b0 = (ANM2 *)cos(local_c4.y); fVar23 = sin(local_c4.y); pEVar27 = (Entity *)((float)local_c8 * (float)local_b0 - fVar23 * (float)local_b8); pAVar14 = (ANM2 *)(fVar23 * (float)local_c8 + (float)local_b8 * (float)local_b0); } multiShotLaserDirection.x = (float)pEVar27; multiShotLaserDirection.y = (float)pAVar14; local_c4.y = (float)Weapon::fire_laser(in_ECX,&firePos,1,&multiShotLaserDirection,0,1, local_c4.x); if (g_weaponTearsFiredLasersEnd == DAT_00c943d0) { std::vector::_Emplace_reallocate (g_weaponTearsFiredLasersEnd,&local_c4.y); } else { *g_weaponTearsFiredLasersEnd = (Entity_Laser *)local_c4.y; g_weaponTearsFiredLasersEnd = g_weaponTearsFiredLasersEnd + 1; } iVar6 = iVar6 + 1; uVar24 = CONCAT13(uStack_19,CONCAT12(cStack_1a,CONCAT11(cStack_1b,uStack_1c))); } while (iVar6 < (short)numTears); } uVar10 = 0; if ((int)g_weaponTearsFiredLasersEnd - (int)DAT_00c943c8 >> 2 != 0) { do { DAT_00c943c8[uVar10]->_disableFollowParent = 0; (**(code **)(*(int *)DAT_00c943c8[uVar10] + 0xc))(); uVar10 = uVar10 + 1; } while (uVar10 < (uint)((int)g_weaponTearsFiredLasersEnd - (int)DAT_00c943c8 >> 2)); } } LAB_00a0d2c8: local_e0 = local_e0 - ((float)local_12c + 1.0); fVar23 = local_138; } while (local_138 != 0.0); pAVar14 = local_110; uVar10 = local_128; } local_e4 = (ANM2 *)((local_e4->_filename)._buf + 1); if ((int)pAVar14 <= (int)local_e4) { if ((char)isNeptunus == '\0') { if ((char)uVar10 != '\0') { if (local_a9 == 0) { if (0 < *(int *)&in_ECX[1].field_0xc) { *(int *)&in_ECX[1].field_0xc = *(int *)&in_ECX[1].field_0xc + -1; } *(undefined4 *)&in_ECX->field_0x14 = 0; FUN_009f4fc0(); } else { pAVar14 = *(ANM2 **)&in_ECX->field_0x14; local_e4 = pAVar14; if (isChocolateMilk != 0) { fVar22 = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); local_b0 = (ANM2 *)(float)fVar22; if ((float)local_b0 <= *(float *)&in_ECX->field_0x14) { Weapon::UpdateHeadChargeAnimation(in_ECX,0x45,1,&aimDirection,-1.0); iVar6 = extraout_ECX_00; } else { Weapon::UpdateHeadChargeAnimation (in_ECX,0x45,0,&aimDirection, (*(float *)&in_ECX->field_0x14 / (float)local_b0) * 18.0); iVar6 = extraout_ECX; if (in_ECX->_owner == (void *)0x0) { local_e4 = (ANM2 *)(*(float *)&in_ECX->field_0x14 + 1.0); if ((float)local_b0 <= (float)local_e4) { local_e4 = local_b0; } } else { local_e4 = (ANM2 *)(*(float *)((int)in_ECX->_owner + 0x39c) + *(float *)&in_ECX->field_0x14); if ((float)local_b0 <= (float)local_e4) { local_e4 = local_b0; } } } pAVar14 = local_e4; Weapon::SetBlinkTime(in_ECX,1,iVar6); aimY = aimDirection.y; aimX = aimDirection.x; } if ((char)isCursedEye != '\0') { fVar22 = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); local_110 = (ANM2 *)(float)fVar22; if ((float)local_110 <= *(float *)&in_ECX->field_0x14) { Weapon::UpdateHeadChargeAnimation(in_ECX,0x13c,1,&aimDirection,-1.0); aimY = aimDirection.y; aimX = aimDirection.x; iVar6 = extraout_ECX_03; pAVar14 = local_e4; } else { iVar6 = extraout_ECX_01; if (in_ECX->_owner != (void *)0x0) { if (*(int *)((int)in_ECX->_owner + 0x28) == 1) { fVar23 = 0.0; } else { fVar23 = (*(float *)&in_ECX->field_0x14 / (float)local_110) * 18.0; } Weapon::UpdateHeadChargeAnimation(in_ECX,0x13c,0,&aimDirection,fVar23); aimX = aimDirection.x; aimY = aimDirection.y; iVar6 = extraout_ECX_02; } if (in_ECX->_owner == (void *)0x0) { pAVar14 = (ANM2 *)(*(float *)&in_ECX->field_0x14 + 1.0); if ((float)local_110 <= (float)pAVar14) { pAVar14 = local_110; } } else { pAVar14 = (ANM2 *)(*(float *)((int)in_ECX->_owner + 0x39c) + *(float *)&in_ECX->field_0x14); if ((float)local_110 <= (float)pAVar14) { pAVar14 = local_110; } } } pAVar28 = local_110; Weapon::SetBlinkTime(in_ECX,1,iVar6); *(int *)&in_ECX[1].field_0xc = (int)((((float)pAVar14 + 1.0) * 5.0) / ((float)pAVar28 + 1.0)); } *(ANM2 **)&in_ECX->field_0x14 = pAVar14; *(ANM2 **)&in_ECX[1].field_0x10 = pAVar14; } if (param_2 != 0) { bVar2 = Weapon::IsAxisAligned(in_ECX); if (bVar2 == 0) { pVVar7 = Weapon::get_aim_direction(in_ECX,&baseVelocity,&aimDirection); } else { pVVar7 = &local_14c; local_14c.x = aimX; local_14c.y = aimY; } *(float *)&in_ECX->field_0x20 = pVVar7->x; *(float *)&in_ECX->field_0x24 = pVVar7->y; } } } else if (local_a9 == 0) { local_138 = (float)*(undefined4 *)&in_ECX->field_0x14; if (ownerAsPlayer == (Entity_Player *)0x0) { pVVar7 = &local_14c; local_14c.x = aimX; local_14c.y = aimY; } else { pVVar7 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_1d8,ownerAsPlayer->_headDirection); } local_120.x = pVVar7->x; local_120.y = pVVar7->y; fVar22 = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); local_e4 = (ANM2 *)(float)fVar22; if ((float)local_e4 <= *(float *)&in_ECX->field_0x14) { Weapon::UpdateHeadChargeAnimation(in_ECX,0x255,1,&local_120,-1.0); *(float *)&in_ECX->field_0x14 = local_138; *(float *)&in_ECX[1].field_0x10 = local_138; } else { Weapon::UpdateHeadChargeAnimation (in_ECX,0x255,0,&local_120, (*(float *)&in_ECX->field_0x14 / (float)local_e4) * 18.0); if (in_ECX->_owner == (void *)0x0) { pAVar14 = (ANM2 *)(*(float *)&in_ECX->field_0x14 + 1.0); if ((float)local_e4 <= (float)pAVar14) { pAVar14 = local_e4; } *(ANM2 **)&in_ECX->field_0x14 = pAVar14; *(ANM2 **)&in_ECX[1].field_0x10 = pAVar14; } else { pAVar14 = (ANM2 *)(*(float *)((int)in_ECX->_owner + 0x39c) + *(float *)&in_ECX->field_0x14); if ((float)local_e4 <= (float)pAVar14) { pAVar14 = local_e4; } *(ANM2 **)&in_ECX->field_0x14 = pAVar14; *(ANM2 **)&in_ECX[1].field_0x10 = pAVar14; } } } else { fVar22 = (float10)(**(code **)(*(int *)in_ECX + 0x18))(); fVar23 = *(float *)&in_ECX->field_0x14; local_e4 = (ANM2 *)(float)(fVar22 + (float10)1.0); local_138 = fVar23 + 1.0; if ((float)local_e4 == 0.0) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); fVar23 = *(float *)&in_ECX->field_0x14; } fVar25 = 1.0; chargeRatio = (local_138 - 0.0) / ((float)local_e4 - 0.0); fVar26 = *(float *)&in_ECX->field_0x10 + 1.0; if (fVar26 <= 1.0) { fVar26 = 1.0; } if (in_ECX->_owner != (void *)0x0) { fVar25 = *(float *)((int)in_ECX->_owner + 0x39c); } fVar23 = fVar23 - fVar25 * ((fVar26 - 1.0) * chargeRatio * chargeRatio + 1.0); if (fVar23 <= 0.0) { fVar23 = 0.0; } *(float *)&in_ECX->field_0x14 = fVar23; *(float *)&in_ECX[1].field_0x10 = fVar23; } ExceptionList = local_10; return; } } while( true ); } //@@ 00a0d850 Weapon_Tears::Reset /* DB: vftable */ void Weapon_Tears::Reset(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; return; } //@@ 00a0d870 Weapon_Tears::Update /* DB: vftable */ void Weapon_Tears::Update(char param_1) { int in_ECX; float fVar1; float fVar2; if (param_1 == '\0') { fVar1 = 1.0; if (-1.0 < *(float *)(in_ECX + 0xc)) { if (*(int *)(in_ECX + 4) == 0) { fVar2 = 1.0; } else { fVar2 = *(float *)(*(int *)(in_ECX + 4) + 0x39c); } *(float *)(in_ECX + 0xc) = *(float *)(in_ECX + 0xc) - fVar2; } if (-1.0 < *(float *)(in_ECX + 0x4c)) { if (*(int *)(in_ECX + 4) != 0) { fVar1 = *(float *)(*(int *)(in_ECX + 4) + 0x39c); } *(float *)(in_ECX + 0x4c) = *(float *)(in_ECX + 0x4c) - fVar1; } } return; } //@@ 00a0d8e0 Weapon_Tears::GetMaxCharge /* DB: vftable */ float10 Weapon_Tears::GetMaxCharge(void) { uint uVar1; int in_ECX; float fVar2; uVar1 = *(uint *)(in_ECX + 0x34); fVar2 = 1.0; if ((uVar1 >> 8 & 1) == 0) { if ((uVar1 & 1) != 0) { fVar2 = 2.5; } if ((uVar1 >> 1 & 1) != 0) { fVar2 = fVar2 + fVar2; } if (fVar2 <= 1.0) { return (float10)0; } } else { fVar2 = 12.0; } return (float10)((*(float *)(in_ECX + 0x10) + 1.0) * fVar2 - 1.0); } //@@ 00a0d950 Weapon_Tears::CanTriggerCursedEyeTeleport /* DB: vtable slot 14 of Weapon_Tears; slot name from Weapon */ undefined4 Weapon_Tears::CanTriggerCursedEyeTeleport(void) { int iVar1; int *in_ECX; float10 extraout_ST0; iVar1 = in_ECX[1]; if ((iVar1 != 0) && (*(int *)(iVar1 + 0x28) == 1)) { if ((*(int *)(iVar1 + 0x140c) != 0) && (iVar1 = (**(code **)(*in_ECX + 0x30))(), iVar1 != 0)) { return 0; } if (((((uint)in_ECX[0xd] >> 8 & 1) == 0) && (0.0 < (float)in_ECX[5])) && ((**(code **)(*in_ECX + 0x18))(), (float)in_ECX[5] <= (float)extraout_ST0 && (float)extraout_ST0 != (float)in_ECX[5])) { return 1; } } return 0; } //@@ 00a0d9c0 Weapon_TechX::Fire /* DB: vftable prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_TechX::Fire(void *this,Vector *direction,byte isShooting,byte isInterpolated) { Vector shotDirection; bool bVar1; bool bVar2; byte bVar3; byte isAxisAligned; int ownerPlayer; Vector *pVVar4; int *laser; uint rngResult; Entity_Player *pEVar5; int extraout_ECX; int unusedArg; Entity_Player *player; int extraout_ECX_00; int extraout_ECX_01; uint randomLasersLeft; float fVar6; float cosAngle; float fVar7; float fVar8; float fVar9; float fVar10; float releaseCharge; float local_70; float local_6c; Vector aimDirection; Vector local_60; Vector scratchVec; float fStack_50; float fStack_4c; undefined1 auStack_48 [8]; undefined4 local_40; float fStack_3c; float fStack_38; float fStack_34; float fStack_30; int iStack_2c; float fStack_28; undefined4 uStack_24; uint uStack_20; int ownerEntity; Weapon::Fire(this,direction,isShooting,isInterpolated); if (isInterpolated != 0) { return; } pEVar5 = *(Entity_Player **)((int)this + 4); if (pEVar5 == (Entity_Player *)0x0) { LAB_00a0da10: player = (Entity_Player *)0x0; if (pEVar5 != (Entity_Player *)0x0) { if (pEVar5->_type == 1) goto LAB_00a0da2f; if (pEVar5->_type == 3) goto LAB_00a0da23; } LAB_00a0da39: fVar6 = 1.0; } else if (pEVar5->_type == 1) { fVar6 = pEVar5->_shotspeed; player = pEVar5; } else { if (pEVar5->_type != 3) goto LAB_00a0da10; player = *(Entity_Player **)&pEVar5->_isControlsEnabled; LAB_00a0da23: pEVar5 = *(Entity_Player **)&pEVar5->_isControlsEnabled; if (pEVar5 == (Entity_Player *)0x0) goto LAB_00a0da39; LAB_00a0da2f: fVar6 = pEVar5->_shotspeed; } if (player == (Entity_Player *)0x0) { LAB_00a0da62: bVar1 = false; } else { bVar3 = Entity_Player::HasCollectible(player,0x18a,0); bVar1 = true; if (bVar3 == 0) goto LAB_00a0da62; } if (((*(uint *)((int)this + 0x34) >> 7 & 1) != 0) || (bVar2 = false, *(float *)((int)this + 0x10) <= 0.0)) { bVar2 = true; } ownerEntity = *(int *)((int)this + 4); releaseCharge = -1000.0; if (ownerEntity == 0) { LAB_00a0dae1: fVar10 = *(float *)((int)this + 0x28); fVar7 = *(float *)((int)this + 0x2c); } else { if (*(int *)(ownerEntity + 0x28) == 1) { ownerPlayer = ownerEntity; } else if ((*(int *)(ownerEntity + 0x28) != 3) || (ownerPlayer = *(int *)(ownerEntity + 0x410), ownerPlayer == 0)) goto LAB_00a0dae1; ownerPlayer = *(int *)(ownerPlayer + 0x140c); if ((ownerPlayer == 0) || (!bVar1)) goto LAB_00a0dae1; fVar10 = *(float *)(ownerPlayer + 0x33c); fVar7 = *(float *)(ownerPlayer + 0x340); } if ((fVar10 == g_vectorZero.x) && (fVar7 == g_vectorZero.y)) { bVar1 = false; } else { bVar1 = true; } local_60.x = fVar10; local_60.y = fVar7; if (isShooting != 0) { if (bVar2) { releaseCharge = *(float *)((int)this + 0x10) * 3.0; } else if (bVar1) { pVVar4 = Weapon::get_owner_position(this,&scratchVec); fVar7 = fVar7 - pVVar4->y; fVar10 = fVar10 - pVVar4->x; fVar10 = sqrtf(fVar7 * fVar7 + fVar10 * fVar10); releaseCharge = *(float *)((int)this + 0x10); fVar10 = (fVar10 - 50.0) / 250.0; if (fVar10 <= 0.0) { fVar10 = 0.0; } if (1.0 <= fVar10) { fVar10 = 1.0; } releaseCharge = (releaseCharge * 3.0 - releaseCharge) * fVar10 + releaseCharge; } } if ((((ownerEntity != 0) && (*(int *)(ownerEntity + 0x28) == 1)) && (0 < *(int *)(ownerEntity + 0x18f8))) && (releaseCharge = *(float *)((int)this + 0x10), releaseCharge < 1.0)) { releaseCharge = 1.0; } bVar3 = isShooting; if ((-1000.0 < releaseCharge) && (releaseCharge <= *(float *)((int)this + 0x14))) { bVar3 = 0; } aimDirection.x = direction->x; aimDirection.y = direction->y; if (isShooting == 0) { aimDirection.x = *(float *)((int)this + 0x20); aimDirection.y = *(float *)((int)this + 0x24); } isAxisAligned = Weapon::IsAxisAligned(this); if (isAxisAligned == 0) { fVar10 = sqrtf(aimDirection.x * aimDirection.x + aimDirection.y * aimDirection.y); ownerEntity = extraout_ECX_00; if (0.0 < fVar10) { aimDirection.x = (1.0 / fVar10) * aimDirection.x; aimDirection.y = aimDirection.y * (1.0 / fVar10); } } else { pVVar4 = Vector::ToCardinal(&scratchVec,&aimDirection); aimDirection.x = pVVar4->x; aimDirection.y = pVVar4->y; ownerEntity = extraout_ECX; } fVar8 = 1.0; fVar10 = *(float *)((int)this + 0x10); fVar7 = *(float *)((int)this + 0x14); if (bVar3 == 0) { if (fVar10 < 1.0) { fVar8 = 1.0; } else { fVar8 = fVar10; } if ((fVar8 <= fVar7) || ((-1000.0 < releaseCharge && (releaseCharge <= fVar7)))) { *(float *)((int)this + 0xc) = fVar10; ownerPlayer = 7 - (int)(fVar10 * -0.45); ownerEntity = 0xb; if (0xb < ownerPlayer) { ownerEntity = ownerPlayer; } Weapon::SetBlinkTime(this,ownerEntity,ownerPlayer); Weapon::TriggerTearEffects(this,&aimDirection,1); Weapon::get_owner_position(this,&local_60); fVar7 = aimDirection.x * 10.0; fVar8 = aimDirection.y * 10.0; pVVar4 = Weapon::get_tear_movement_inheritance(this,&scratchVec,&aimDirection); fVar9 = *(float *)((int)this + 0x10) + 1.0; fVar7 = fVar7 + pVVar4->x; fVar10 = *(float *)((int)this + 0x14) + 1.0; fVar8 = fVar8 + pVVar4->y; if (fVar9 * 3.0 <= fVar10) { fVar10 = fVar9 * 3.0; } Weapon::GetMultiShotParams(this,&local_40,unusedArg); fVar10 = ((fVar10 - fVar9) / (fVar9 + fVar9)) * 0.75 + 0.25; if (uStack_24._1_1_ != '\0') { local_70 = -fVar7 * fVar6; local_6c = -fVar8 * fVar6; laser = (int *)Weapon::fire_tech_x_laser(&local_60,&local_70,fVar10); (**(code **)(*laser + 0xc))(); } if (uStack_24._2_1_ != '\0') { local_70 = fVar7 * fVar6; local_6c = fVar6 * -fVar8; laser = (int *)Weapon::fire_tech_x_laser(&local_60,&local_70,fVar10); (**(code **)(*laser + 0xc))(); local_70 = -fVar7 * fVar6; local_6c = fVar8 * fVar6; laser = (int *)Weapon::fire_tech_x_laser(&local_60,&local_70,fVar10); (**(code **)(*laser + 0xc))(); } for (randomLasersLeft = uStack_20 & 0xffff; randomLasersLeft != 0; randomLasersLeft = randomLasersLeft - 1) { rngResult = Random(); local_70 = (float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; rngResult = Random(); fVar9 = ((float)((double)(int)rngResult + __uint_to_double_fixup[-((int)rngResult >> 0x1f)]) * 2.3283064e-10 * 50.0 - 25.0) * 0.017453292; cosAngle = cos(fVar9); fVar9 = sin(fVar9); scratchVec.x = (fVar7 * cosAngle - fVar8 * fVar9) * fVar6; scratchVec.y = (fVar8 * cosAngle + fVar7 * fVar9) * fVar6; laser = (int *)Weapon::fire_tech_x_laser(&local_60,&scratchVec,local_70 * fVar10); (**(code **)(*laser + 0xc))(); } ownerEntity = 0; if (0 < (short)local_40) { local_70 = fVar7; local_6c = fVar8; do { shotDirection.y = local_6c; shotDirection.x = local_70; Entity_Player::GetMultiShotPositionVelocity (&fStack_50,ownerEntity,9,shotDirection,fVar6,(short)local_40,fStack_3c, fStack_38,fStack_34,fStack_30,iStack_2c,fStack_28,(byte)uStack_24, (short)uStack_20); scratchVec.x = local_60.x + fStack_50; scratchVec.y = fStack_4c + local_60.y; laser = (int *)Weapon::fire_tech_x_laser(&scratchVec,auStack_48,fVar10); (**(code **)(*laser + 0xc))(); ownerEntity = ownerEntity + 1; } while (ownerEntity < (short)local_40); } pEVar5 = *(Entity_Player **)((int)this + 4); if ((((pEVar5 == (Entity_Player *)0x0) || (player = pEVar5, pEVar5->_type != 1)) && (player = (Entity_Player *)0x0, pEVar5 != (Entity_Player *)0x0)) && (pEVar5->_type == 3)) { pEVar5->_chargeBarSprites[5]._numEvents = 0; } else if (player != (Entity_Player *)0x0) { Entity_Player::stop_costume_item_anims(player); *(undefined4 *)((int)this + 0x14) = 0; goto LAB_00a0e1fe; } } *(undefined4 *)((int)this + 0x14) = 0; } else { if (fVar10 * 3.0 <= fVar7) { Weapon::UpdateHeadChargeAnimation(this,0x18b,1,direction,-1.0); ownerEntity = extraout_ECX_01; } else { if (*(int *)((int)this + 4) != 0) { fVar8 = *(float *)(*(int *)((int)this + 4) + 0x39c); } *(float *)((int)this + 0x14) = fVar7 + fVar8; } Weapon::SetBlinkTime(this,1,ownerEntity); } LAB_00a0e1fe: if (isShooting != 0) { bVar3 = Weapon::IsAxisAligned(this); if (bVar3 != 0) { fVar6 = direction->y; *(float *)((int)this + 0x20) = direction->x; *(float *)((int)this + 0x24) = fVar6; return; } pVVar4 = Weapon::get_aim_direction(this,&local_60,direction); *(float *)((int)this + 0x20) = pVVar4->x; *(float *)((int)this + 0x24) = pVVar4->y; } return; } //@@ 00a0e260 Weapon_TechX::GetMaxCharge /* DB: vtable slot 6 of Weapon_TechX; slot name from Weapon */ float10 Weapon_TechX::GetMaxCharge(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x10) * (float10)3.0; } //@@ 00a0e270 Weapon_UmbilicalWhip::Fire /* DB: vftable */ void Weapon_UmbilicalWhip::Fire(Vector *param_1,byte param_2,byte param_3) { byte isAxisAligned; int iVar1; Vector *vecResult; uint seed; int *whip; Weapon *in_ECX; int *extraout_ECX; int *unused; Entity *whipEntity; float fVar2; float ownerY; Entity_Player *local_2c; Vector VStack_28; Vector VStack_20; Vector aimDirection; Vector scratchVec; undefined4 flagsHigh; Manager *manager; void *owner; undefined1 *whipRef; Weapon::Fire(in_ECX,param_1,param_2,param_3); local_2c = in_ECX->_owner; if (local_2c == (Entity_Player *)0x0) { LAB_00a0e2c3: local_2c = (Entity_Player *)0x0; } else { if (local_2c->_type != 1) { if (local_2c->_type != 3) goto LAB_00a0e2c3; local_2c = *(Entity_Player **)&local_2c->_isControlsEnabled; if (local_2c == (Entity_Player *)0x0) goto LAB_00a0e2cb; } Entity_Player::HasCollectible(local_2c,0x18a,0); } LAB_00a0e2cb: whip = *(int **)&in_ECX[1].field_0xc; iVar1 = 0; if (whip != (int *)0x0) { iVar1 = (*(char *)((int)whip + 0x171) != '\0') + 1; } *(int *)&in_ECX->field_0x1c = iVar1; if ((param_2 != 0) && (*(float *)&in_ECX->field_0xc <= 0.0 && *(float *)&in_ECX->field_0xc != 0.0) ) { if (param_3 != 0) { return; } unused = whip; if ((whip != (int *)0x0) && (whip[0x362] == 1)) { (**(code **)(*whip + 0x28))(); whip = *(int **)&in_ECX[1].field_0xc; unused = extraout_ECX; } if (whip == (int *)0x0) { fVar2 = *(float *)&in_ECX->field_0x10; *(float *)&in_ECX->field_0xc = fVar2 + fVar2; Weapon::SetBlinkTime(in_ECX,7 - (int)(fVar2 * -0.45),(int)unused); aimDirection.x = param_1->x; aimDirection.y = param_1->y; isAxisAligned = Weapon::IsAxisAligned(in_ECX); if (isAxisAligned == 0) { Vector::Normalize(&aimDirection); } else { vecResult = Vector::ToCardinal(&VStack_20,&aimDirection); aimDirection.x = vecResult->x; aimDirection.y = vecResult->y; } VStack_28.x = aimDirection.x * 10.0; VStack_20.x = aimDirection.y * 10.0; vecResult = Weapon::get_tear_movement_inheritance(in_ECX,&scratchVec,&aimDirection); VStack_28.x = vecResult->x * 0.4 + VStack_28.x; VStack_28.y = vecResult->y * 0.4 + VStack_20.x; vecResult = Vector::Normalized(&VStack_28,&scratchVec); aimDirection.x = vecResult->x; aimDirection.y = vecResult->y; seed = Random(); vecResult = Weapon::get_owner_position(in_ECX,&scratchVec); VStack_28.x = (float)Game::SpawnEx(g_game,3,0xf0,vecResult,&g_vectorZero,(Entity *)local_2c,0, seed,0); whipEntity = *(Entity **)&in_ECX[1].field_0xc; whipRef = &in_ECX[1].field_0xc; if (whipEntity != (Entity *)VStack_28.x) { if (whipEntity != (Entity *)0x0) { VStack_20.x = (float)whipRef; std::multiset::erase(&VStack_20); } *(float *)whipRef = VStack_28.x; whipEntity = (Entity *)0x0; if ((Entity *)VStack_28.x != (Entity *)0x0) { std::multiset::insert(whipRef); whipEntity = *(Entity **)whipRef; } } flagsHigh = *(undefined4 *)((int)&whipEntity->_flags + 4); *(uint *)&whipEntity->_flags = (uint)whipEntity->_flags & 0xfffffffb; *(undefined4 *)((int)&whipEntity->_flags + 4) = flagsHigh; vecResult = Vector::Normalized(&aimDirection,&scratchVec); fVar2 = vecResult->y; iVar1 = *(int *)whipRef; *(float *)(iVar1 + 0x334) = vecResult->x; *(float *)(iVar1 + 0x338) = fVar2; (**(code **)(**(int **)whipRef + 0xc))(); manager = g_manager; local_2c = (Entity_Player *)0x1ee; seed_fart_sound_override((int *)&local_2c); SoundEffects::Play(&manager->_sfxManager,(int)local_2c,1.0,2,0,1.0,0.0); Weapon::TriggerTearEffects(in_ECX,&aimDirection,1); whip = *(int **)&in_ECX[1].field_0xc; } } if (whip == (int *)0x0) { in_ECX[1]._owner = (void *)g_vectorZero.x; in_ECX[1]._technology2Laser = (EntityPtr)g_vectorZero.y; } else { owner = in_ECX->_owner; if (owner == (void *)0x0) { fVar2 = g_vectorZero.x; ownerY = g_vectorZero.y; } else { fVar2 = *(float *)((int)owner + 0x33c); ownerY = *(float *)((int)owner + 0x340); } local_2c = (Entity_Player *)((float)whip[0xcf] - fVar2); VStack_28.x = (float)whip[0xd0] - ownerY; fVar2 = sqrtf((float)local_2c * (float)local_2c + VStack_28.x * VStack_28.x); if (fVar2 <= 0.0) { in_ECX[1]._owner = local_2c; in_ECX[1]._technology2Laser = (EntityPtr)VStack_28.x; } else { in_ECX[1]._owner = (void *)((float)local_2c * (1.0 / fVar2)); in_ECX[1]._technology2Laser = (EntityPtr)(VStack_28.x * (1.0 / fVar2)); } } if ((param_2 == 0) && (*(int *)&in_ECX[1].field_0xc != 0)) { *(undefined4 *)(*(int *)&in_ECX[1].field_0xc + 0xd88) = 1; } return; } //@@ 00a0e630 Weapon_UrnOfSouls::Fire /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: Weapon_UrnOfSouls vftable slot 3 (Fire) prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Weapon_UrnOfSouls::Fire(void *flameLaser,Vector *direction,byte isShooting,byte isInterpolated) { Entity_Player *pEVar1; uint urnPosY; uint uVar3; byte bVar4; Vector *pVVar5; uint uVar6; Entity_Player *ownerPlayer; int *extraout_EDX; float fVar7; float fVar8; float fVar9; EntityPtr aimX; float fVar10; Entity *pEVar11; byte isDontUpdate; undefined1 auStack_98 [8]; Entity_Tear *local_90; EntityPtr local_8c; Vector aimDir; EntityPtr local_80; Entity_Player *player; Vector ownerPos; Vector local_70; Vector VStack_68; Vector VStack_60; uint uStack_58; uint uStack_54; Vector local_48; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; float fStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; float fStack_20; undefined4 uStack_1c; undefined4 uStack_18; uint local_14; EntityPtr flameLaser; BitSet128 luckyTearFlags; Manager *manager; int ownerEntity; Entity_Tear *soulTear; BitSet128 tearFlags; int *urnEffect; undefined4 urnPosY; int urnState; local_14 = __security_cookie ^ (uint)auStack_98; local_90 = (Entity_Tear *)direction; Weapon::Fire(flameLaser,direction,isShooting,isInterpolated); pEVar1 = *(Entity_Player **)((int)flameLaser + 4); player = pEVar1; if (pEVar1 == (Entity_Player *)0x0) { LAB_00a0e69d: ownerPlayer = (Entity_Player *)0x0; if ((pEVar1 == (Entity_Player *)0x0) || (pEVar1->_type != 1)) { LAB_00a0e6af: player = (Entity_Player *)0x0; if (pEVar1 == (Entity_Player *)0x0) { local_48.x = 1.0; player = (Entity_Player *)0x0; goto LAB_00a0e6d5; } } local_48.x = pEVar1->_speedMultiplier; } else { if (pEVar1->_type != 1) { if (pEVar1->_type != 3) goto LAB_00a0e69d; ownerPlayer = *(Entity_Player **)&pEVar1->_isControlsEnabled; goto LAB_00a0e6af; } local_48.x = pEVar1->_speedMultiplier; ownerPlayer = pEVar1; } LAB_00a0e6d5: pEVar1 = player; if (ownerPlayer != (Entity_Player *)0x0) { Entity_Player::HasCollectible(ownerPlayer,0x18a,0); } ownerPlayer = *(Entity_Player **)((int)flameLaser + 4); local_70.x = *(float *)local_90; local_80 = *(EntityPtr *)&local_90->field_0x4; if ((local_70.x == g_vectorZero.x) && ((float)local_80 == g_vectorZero.y)) { local_70.x = *(float *)((int)flameLaser + 0x20); local_80 = *(EntityPtr *)((int)flameLaser + 0x24); } aimDir.x = local_70.x; aimDir.y = (float)local_80; if ((local_70.x == g_vectorZero.x) && ((float)local_80 == g_vectorZero.y)) { flameLaser = local_80; aimX = (EntityPtr)local_70.x; if (pEVar1 == (Entity_Player *)0x0) { if (ownerPlayer->_type == 3) { switch(ownerPlayer->_chargeBarSprites[5]._scale.x) { case 0.0: goto LAB_00a0e785; case 1.4013e-45: goto LAB_00a0e7a6; case 2.8026e-45: goto LAB_00a0e798; case 4.2039e-45: goto LAB_00a0e7ce; } } } else { switch(pEVar1->_headDirection) { case 0: LAB_00a0e785: aimX = (EntityPtr)&DAT_bf800000; aimDir.x = (float)&DAT_bf800000; break; case 1: LAB_00a0e7a6: aimDir.y = (float)&DAT_bf800000; flameLaser = (EntityPtr)&DAT_bf800000; break; case 2: LAB_00a0e798: aimDir.x = 1.0; aimX = (EntityPtr)0x3f800000; break; case 3: LAB_00a0e7ce: aimDir.y = 1.0; flameLaser = (EntityPtr)0x3f800000; } } } else { fVar7 = sqrtf(local_70.x * local_70.x + (float)local_80 * (float)local_80); ownerPlayer = *(Entity_Player **)((int)flameLaser + 4); if (fVar7 <= 0.0) { flameLaser = local_80; aimX = (EntityPtr)local_70.x; } else { aimDir.y = (1.0 / fVar7) * (float)local_80; aimDir.x = (1.0 / fVar7) * local_70.x; flameLaser = (EntityPtr)aimDir.y; aimX = (EntityPtr)aimDir.x; } } local_8c = (EntityPtr)0x0; if ((ownerPlayer != (Entity_Player *)0x0) && (ownerPlayer->_type == 1)) { bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x3b,0); local_8c._1_3_ = 0; local_8c._0_1_ = bVar4 != 0; flameLaser = (EntityPtr)aimDir.y; aimX = (EntityPtr)aimDir.x; } urnEffect = *(int **)((int)flameLaser + 0x4c); soulTear = (Entity_Tear *)((int)flameLaser + 0x4c); if (((urnEffect == (int *)0x0) || ((*(EntityPtr *)(urnEffect + 0xc) != local_8c && ((**(code **)(*urnEffect + 0x28))(), flameLaser = (EntityPtr)aimDir.y, aimX = (EntityPtr)aimDir.x, *(int *)((int)flameLaser + 0x4c) == 0)))) && (isInterpolated == 0)) { local_90 = (Entity_Tear *)Random(); pEVar11 = *(Entity **)((int)flameLaser + 4); if (pEVar11 == (Entity *)0x0) { ownerPos.x = g_vectorZero.x; ownerPos.y = g_vectorZero.y; } else { ownerPos.x = (pEVar11->_pos).x; ownerPos.y = (pEVar11->_pos).y; } local_8c = (EntityPtr) Game::SpawnEx(g_game,1000,0xb2,&ownerPos,&g_vectorZero,pEVar11,(uint)local_8c, (uint)local_90,0); flameLaser = *(EntityPtr *)soulTear; if (flameLaser != local_8c) { if (flameLaser != (EntityPtr)0x0) { local_90 = soulTear; std::multiset::erase(&local_90); } *(EntityPtr *)soulTear = local_8c; flameLaser = (EntityPtr)0x0; if (local_8c != (EntityPtr)0x0) { std::multiset::insert(soulTear); flameLaser = *(EntityPtr *)((int)flameLaser + 0x4c); } } local_70.x = *(float *)((int)flameLaser + 4); local_8c = (EntityPtr)&((Entity *)flameLaser)->_parent; if (*(EntityPtr *)local_8c != (EntityPtr)0x0) { local_90 = (Entity_Tear *)local_8c; std::multiset::erase(&local_90); } *(float *)local_8c = local_70.x; if ((EntityPtr)local_70.x != (EntityPtr)0x0) { std::multiset::insert(local_8c); } *(undefined4 *)((int)*(EntityPtr *)soulTear + 0x450) = 0xfffffffc; flameLaser = *(EntityPtr *)soulTear; *(undefined4 *)((int)flameLaser + 0x34c) = 0; *(undefined4 *)((int)flameLaser + 0x350) = 0xc1700000; ownerEntity = __RTDynamicCast(*(undefined4 *)((int)flameLaser + 4),0, &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor, &IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0); if (((ownerEntity != 0) && (g_manager->_netplayManager != *(NetplayManager *)(g_manager + 1))) && (bVar4 = NetplayManager::IsIdxLocalPlayer (&g_manager->_netplayManager,*(uint *)(ownerEntity + 0x1618)), bVar4 == 0)) { flameLaser = *(EntityPtr *)soulTear; uStack_40 = *(undefined4 *)((int)flameLaser + 0xf0); uStack_3c = *(undefined4 *)((int)flameLaser + 0xf4); uStack_38 = *(undefined4 *)((int)flameLaser + 0xf8); fVar10 = *(float *)((int)flameLaser + 0xfc); uStack_30 = *(undefined4 *)((int)flameLaser + 0x100); uStack_2c = *(undefined4 *)((int)flameLaser + 0x104); uStack_28 = *(undefined4 *)((int)flameLaser + 0x108); uStack_24 = *(undefined4 *)((int)flameLaser + 0x10c); fVar7 = *(float *)((int)flameLaser + 0x110); uStack_1c = *(undefined4 *)((int)flameLaser + 0x114); uStack_18 = *(undefined4 *)((int)flameLaser + 0x118); fStack_34 = fVar10; fStack_20 = fVar7; FUN_00925df0(); fStack_34 = fVar7 * fVar10; (**(code **)(*extraout_EDX + 0x3c))(&uStack_40,0xffffffff,0xff,0,1); } fVar7 = atan2f(aimDir.y,aimDir.x); fVar7 = fVar7 * 57.295776; if (0.0 < fVar7) { fVar7 = fVar7 + 90.0; } else { fVar7 = fVar7 - 90.0; } *(float *)((int)*(EntityPtr *)soulTear + 0xec) = fVar7; (**(code **)(*(int *)*(EntityPtr *)soulTear + 0xc))(); flameLaser = (EntityPtr)aimDir.y; aimX = (EntityPtr)aimDir.x; } if (*(EntityPtr *)soulTear == (EntityPtr)0x0) { return; } fVar7 = atan2f((float)flameLaser,(float)aimX); *(float *)((int)*(EntityPtr *)soulTear + 0x474) = fVar7 * 57.295776; ownerEntity = *(int *)((int)flameLaser + 0x50); if (ownerEntity != 0) { urnPosY = *(undefined4 *)((int)*(EntityPtr *)soulTear + 0x340); *(undefined4 *)(ownerEntity + 0x33c) = *(undefined4 *)((int)*(EntityPtr *)soulTear + 0x33c); *(undefined4 *)(ownerEntity + 0x340) = urnPosY; ownerEntity = *(int *)((int)flameLaser + 0x50); local_90 = *(Entity_Tear **)(ownerEntity + 0x41c); fVar7 = LerpAngleDeg((float)local_90,*(float *)(*(int *)((int)flameLaser + 0x4c) + 0xec),0.15); *(float *)(ownerEntity + 0x418) = fVar7; *(float *)(ownerEntity + 0x41c) = fVar7; *(Entity_Tear **)(ownerEntity + 0x420) = local_90; *(float *)(ownerEntity + 0xec) = fVar7 - 90.0; } if (isInterpolated != 0) { return; } ownerEntity = *(int *)((int)flameLaser + 0x4c); urnState = *(int *)(ownerEntity + 0x450); if (urnState < 0) goto LAB_00a0f3a4; if (((isShooting != 0) && (*(float *)((int)flameLaser + 0x44) <= 0.0)) && ((player != (Entity_Player *)0x0 && ((0 < player->_urnSouls || (0 < player->_effectiveSoulCharge)))))) { if ((urnState == 3) || (urnState == 4)) { *(undefined4 *)(ownerEntity + 0x450) = 3; } else if (urnState == 0) { *(undefined4 *)(ownerEntity + 0x450) = 1; Weapon::get_owner_position(flameLaser,&ownerPos); manager = g_manager; local_8c = (EntityPtr)0x216; seed_fart_sound_override((int *)&local_8c); SoundEffects::Play(&manager->_sfxManager,(int)local_8c,1.6,1,0,1.0,0.0); } pEVar1 = player; ownerEntity = *(int *)(*(int *)((int)flameLaser + 0x4c) + 0x450); if ((ownerEntity == 2) || (ownerEntity == 3)) { if (player->_urnSouls < 1) { if (0 < player->_effectiveSoulCharge) { Entity_Player::AddSoulCharge(player,-1); *(undefined4 *)((int)flameLaser + 0x44) = 0x41c80000; } } else { Entity_Player::AddUrnSouls(player,0xffffffff); *(undefined4 *)((int)flameLaser + 0x44) = 0x41700000; } if ((0.0 < *(float *)((int)flameLaser + 0x44)) && (bVar4 = Entity_Player::HasCollectible(pEVar1,0x248,0), bVar4 != 0)) { isDontUpdate = 0; bVar4 = 0; pVVar5 = Weapon::get_owner_position(flameLaser,&ownerPos); Entity_Player::AddWisp(pEVar1,0x280,pVVar5,bVar4,isDontUpdate); } } } ownerEntity = *(int *)((int)flameLaser + 0x4c); urnState = *(int *)(ownerEntity + 0x450); if (*(float *)((int)flameLaser + 0x44) <= 0.0) { if ((urnState == 2) || (urnState == 3)) { Weapon::get_owner_position(flameLaser,&ownerPos); manager = g_manager; local_90 = (Entity_Tear *)0x218; seed_fart_sound_override((int *)&local_90); SoundEffects::Play(&manager->_sfxManager,(int)local_90,1.6,1,0,1.0,0.0); manager = g_manager; *(undefined4 *)((int)flameLaser + 0x48) = 0; *(float *)((int)flameLaser + 0x20) = g_vectorZero.x; *(float *)((int)flameLaser + 0x24) = g_vectorZero.y; SFXManager::Stop(&manager->_sfxManager,0x216); *(undefined4 *)(*(int *)((int)flameLaser + 0x4c) + 0x450) = 4; } goto LAB_00a0f3a4; } if ((urnState != 2) && (urnState != 3)) goto LAB_00a0f3a4; fVar7 = local_48.x / 90.0 + *(float *)((int)flameLaser + 0x48); local_70.x = 1.0; if (fVar7 <= 1.0) { local_70.x = fVar7; } *(float *)((int)flameLaser + 0x48) = local_70.x; Weapon::get_owner_position(flameLaser,&ownerPos); local_90 = (Entity_Tear *)(*(float *)(ownerEntity + 0xec) * 0.017453292); local_8c = (EntityPtr)cos((float)local_90); local_90 = (Entity_Tear *)sin((float)local_90); fVar7 = local_70.x * 6.0 + 6.0; local_70.x = fVar7 * (float)local_90; VStack_60.x = fVar7 * (float)local_8c; uVar6 = Random(); VStack_68.x = ((float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) * 2.3283064e-10 * 16.0 - 8.0) * 0.017453292; local_80 = (EntityPtr)cos(VStack_68.x); fVar7 = sin(VStack_68.x); pEVar1 = player; ownerEntity = *(int *)((int)flameLaser + 4); fVar10 = (float)local_80 * VStack_60.x; local_80 = (EntityPtr)((float)local_80 * local_70.x + fVar7 * VStack_60.x); VStack_68.x = fVar10 - fVar7 * local_70.x; fVar10 = (float)local_8c * -0.4 * local_48.x; ownerPos.x = (float)local_8c + (float)local_8c + ownerPos.x; fVar7 = (float)local_90 * -0.4 * local_48.x; ownerPos.y = (float)local_90 + (float)local_90 + ownerPos.y; *(float *)(ownerEntity + 0x364) = *(float *)(ownerEntity + 0x39c) * fVar7 + *(float *)(ownerEntity + 0x364); *(float *)(ownerEntity + 0x360) = *(float *)(ownerEntity + 0x39c) * fVar10 + *(float *)(ownerEntity + 0x360); if (((player != (Entity_Player *)0x0) && (flameLaser = player->_twinPlayer, flameLaser != (EntityPtr)0x0)) && (fVar8 = *(float *)(*(int *)((int)flameLaser + 4) + 0x33c) - *(float *)((int)flameLaser + 0x33c), fVar9 = *(float *)(*(int *)((int)flameLaser + 4) + 0x340) - *(float *)((int)flameLaser + 0x340), fVar9 * fVar9 + fVar8 * fVar8 < 6400.0)) { *(float *)((int)flameLaser + 0x364) = fVar7 * *(float *)((int)flameLaser + 0x39c) + *(float *)((int)flameLaser + 0x364); *(float *)((int)flameLaser + 0x360) = *(float *)((int)flameLaser + 0x39c) * fVar10 + *(float *)((int)flameLaser + 0x360); } VStack_68.y = (float)local_80; VStack_60.x = VStack_68.x; pVVar5 = Weapon::get_tear_movement_inheritance(flameLaser,&local_48,&VStack_68); VStack_68.x = VStack_60.x + pVVar5->x; VStack_68.y = (float)local_80 + pVVar5->y; if (*(int *)(*(int *)((int)flameLaser + 0x4c) + 0x30) == 1) { fVar7 = *(float *)((int)flameLaser + 0x48); ownerEntity = _get_index_plus_one_if_kind_4_5(); flameLaser = (EntityPtr)((int)flameLaser + 0x50); aimX = *(EntityPtr *)flameLaser; local_48.x = ((float)ownerEntity * 0.3 + 2.8) * 1.5 * (fVar7 * 0.19999999 + 0.8); if (aimX == (EntityPtr)0x0) { pEVar11 = *(Entity **)((int)flameLaser + 0x4c); local_70.x = (pEVar11->_pos).x; local_70.y = (pEVar11->_pos).y; bVar4 = 0; pVVar5 = &VStack_60; ownerEntity = 8; VStack_60.y = -15.0; VStack_60.x = (float)aimX; fVar7 = atan2f((float)local_90,(float)local_8c); VStack_68.x = (float)Entity_Laser::ShootAngle (1,&local_70,fVar7 * 57.295776,ownerEntity,pVVar5,pEVar11,bVar4 ); aimX = *(EntityPtr *)flameLaser; if (aimX != (EntityPtr)VStack_68.x) { if (aimX != (EntityPtr)0x0) { VStack_60.x = (float)flameLaser; std::multiset::erase(&VStack_60); } *(float *)flameLaser = VStack_68.x; aimX = (EntityPtr)0x0; if ((EntityPtr)VStack_68.x != (EntityPtr)0x0) { std::multiset::insert(flameLaser); aimX = *(EntityPtr *)((int)flameLaser + 0x50); } } *(int *)((int)aimX + 0x34) = 1; *(undefined4 *)((int)*(EntityPtr *)flameLaser + 0x38) = 0; (**(code **)(*(int *)*(EntityPtr *)flameLaser + 0x40))(local_48.x); uVar3 = DAT_00c34c6c; urnPosY = DAT_00c34c68; uVar6 = DAT_00c34c64; aimX = *(EntityPtr *)flameLaser; *(uint *)((int)aimX + 0x428) = DAT_00c34c60; *(uint *)((int)aimX + 0x42c) = uVar6; *(uint *)((int)aimX + 0x430) = urnPosY; *(uint *)((int)aimX + 0x434) = uVar3; (**(code **)(*(int *)*(EntityPtr *)flameLaser + 0xc))(); aimX = *(EntityPtr *)flameLaser; if (aimX == (EntityPtr)0x0) goto LAB_00a0f2ba; } (**(code **)(*(int *)aimX + 0x40))(local_48.x); uVar3 = DAT_00c34c6c; urnPosY = DAT_00c34c68; uVar6 = DAT_00c34c64; aimX = *(EntityPtr *)flameLaser; *(uint *)((int)aimX + 0x428) = DAT_00c34c60; *(uint *)((int)aimX + 0x42c) = uVar6; *(uint *)((int)aimX + 0x430) = urnPosY; *(uint *)((int)aimX + 0x434) = uVar3; *(undefined4 *)((int)*(EntityPtr *)flameLaser + 0x458) = 8; flameLaser = *(EntityPtr *)flameLaser; fVar7 = LerpAngleDeg(*(float *)((int)flameLaser + 0x41c), *(float *)(*(int *)((int)flameLaser + 0x4c) + 0xec),0.3); Entity_NPC::SetAimAngle((Entity_NPC *)flameLaser,fVar7); ownerEntity = *(int *)((int)flameLaser + 0x50); fVar7 = sin(*(float *)(ownerEntity + 0x41c) * 0.017453292); if (fVar7 <= -0.5) { *(undefined4 *)(ownerEntity + 0x358) = 0xc1200000; } else { *(undefined4 *)(ownerEntity + 0x358) = 0x453b8000; } } else { uVar6 = Random(); local_90 = (Entity_Tear *) Game::SpawnEx(g_game,2,0x2e,&ownerPos,&VStack_68,(Entity *)pEVar1,0,uVar6,0); VStack_68.x = (float)&local_90->_parent; if (local_90->_parent != (EntityPtr)0x0) { VStack_60.x = VStack_68.x; std::multiset::erase(&VStack_60); } *(Entity_Player **)VStack_68.x = pEVar1; if (pEVar1 != (Entity_Player *)0x0) { std::multiset::insert(VStack_68.x); } soulTear = local_90; tearFlags._l._4_4_ = DAT_00c34b54; tearFlags._l._0_4_ = DAT_00c34b50; tearFlags._h._0_4_ = DAT_00c34b58; tearFlags._h._4_4_ = DAT_00c34b5c; Entity_Tear::SetTearFlags(local_90,tearFlags); soulTear->_tearRange = 160.0; uVar6 = RNG::RandomInt(&soulTear->_dropRNG,8); if (uVar6 == 0) { VStack_60.x = (float)((uint)(soulTear->_tearFlags)._l | DAT_00c34c60); VStack_60.y = (float)(*(uint *)((int)&(soulTear->_tearFlags)._l + 4) | DAT_00c34c64); uStack_58 = (uint)(soulTear->_tearFlags)._h | DAT_00c34c68; uStack_54 = *(uint *)((int)&(soulTear->_tearFlags)._h + 4) | DAT_00c34c6c; luckyTearFlags._l._4_4_ = VStack_60.y; luckyTearFlags._l._0_4_ = (EntityPtr)VStack_60.x; luckyTearFlags._h._0_4_ = uStack_58; luckyTearFlags._h._4_4_ = uStack_54; Entity_Tear::SetTearFlags(soulTear,luckyTearFlags); } fVar7 = *(float *)((int)flameLaser + 0x48); ownerEntity = _get_index_plus_one_if_kind_4_5(); soulTear->_mass = 0.0; VStack_60.x = ((float)ownerEntity * 0.3 + 2.3) * (fVar7 * 0.19999999 + 0.8); fVar7 = *(float *)((int)flameLaser + 0x48) * 0.40000004 + 0.7; if (fVar7 <= 0.01) { fVar7 = 0.01; } soulTear->_baseScale = fVar7; soulTear->_fScale = fVar7; Entity_Tear::ResetSpriteScale(soulTear); (**(code **)(*(int *)soulTear + 0x40))(VStack_60.x); soulTear->_fallingAccel = 0.1; (**(code **)(*(int *)soulTear + 0xc))(); } LAB_00a0f2ba: Game::ShakeScreen(g_game,3); Weapon::TriggerTearEffects(flameLaser,&aimDir,1); *(float *)((int)flameLaser + 0x44) = *(float *)((int)flameLaser + 0x44) - 1.0; *(float *)((int)flameLaser + 0x20) = aimDir.x; *(float *)((int)flameLaser + 0x24) = aimDir.y; LAB_00a0f3a4: ownerEntity = *(int *)((int)flameLaser + 0x4c); *(undefined4 *)(ownerEntity + 0x478) = *(undefined4 *)((int)flameLaser + 0x48); urnState = *(int *)(*(int *)((int)flameLaser + 0x4c) + 0x450); if (((urnState == 2) || (urnState == 3)) || (*(int *)((int)flameLaser + 0x50) != 0)) { Weapon::SetBlinkTime(flameLaser,4,ownerEntity); } return; } //@@ 00a0f410 Weapon_UrnOfSouls::Reset /* DB: vtable slot 4 of Weapon_UrnOfSouls; slot name from Weapon */ void Weapon_UrnOfSouls::Reset(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; return; } //@@ 00a0f420 Weapon_UrnOfSouls::ClearReferences /* DB: vtable slot 5 of Weapon_UrnOfSouls; slot name from Weapon */ void Weapon_UrnOfSouls::ClearReferences(void) { int *piVar1; int *in_ECX; int *local_8; piVar1 = in_ECX + 2; local_8 = in_ECX; if ((int *)in_ECX[2] != (int *)0x0) { (**(code **)(*(int *)in_ECX[2] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } piVar1 = in_ECX + 0x13; if ((int *)in_ECX[0x13] != (int *)0x0) { (**(code **)(*(int *)in_ECX[0x13] + 0x28))(); if (*piVar1 != 0) { local_8 = piVar1; std::multiset::erase(&local_8); *piVar1 = 0; } } SFXManager::Stop(&g_manager->_sfxManager,0x216); SFXManager::Stop(&g_manager->_sfxManager,0x217); return; } //@@ 00a0f4c0 operator_new /* DB: allocator used by std::_Allocate; calls FUN_00a648b0(size,0) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl operator_new(uint size) { void *pvVar1; pvVar1 = tracked_alloc(0,(void *)0x0,(ulonglong)size); return pvVar1; } //@@ 00a0f4e0 operator_new_tracked /* DB: src/rooms decompile labels (operator_new_tracked) prototype: db/protos.zhl */ void * __fastcall operator_new_tracked(uint size) { void *pvVar1; pvVar1 = tracked_alloc(0,(void *)0x0,(ulonglong)size); return pvVar1; } //@@ 00a0f500 FUN_00a0f500 void FUN_00a0f500(void *param_1) { void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; tracked_alloc(1,param_1,0); ExceptionList = local_10; return; } //@@ 00a0f550 KColor::SetFromARGB /* DB: unpacks ARGB uint into 0-1 floats prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall KColor::SetFromARGB(KColor *this,uint argb) { this->_unk = 0; this->_red = ((float)(argb >> 0x10 & 0xff) + 0.0) / 255.0; this->_green = ((float)(argb >> 8 & 0xff) + 0.0) / 255.0; this->_blue = ((float)(argb & 0xff) + 0.0) / 255.0; this->_alpha = ((float)(argb >> 0x18) + 0.0) / 255.0; return; } //@@ 00a0f610 KColor::set_from_argb_signed /* DB: duplicate of KColor::SetFromARGB (00a0f550) without the +0.0 and with signed shifts: r,g,b,a = ARGB bytes / 255, +0x10 = 0; Game::render_debug_overlay (0x6599ff99) */ void KColor::set_from_argb_signed(uint param_1) { float *in_ECX; in_ECX[4] = 0.0; *in_ECX = (float)((int)param_1 >> 0x10 & 0xff) / 255.0; in_ECX[1] = (float)((int)param_1 >> 8 & 0xff) / 255.0; in_ECX[2] = (float)(param_1 & 0xff) / 255.0; in_ECX[3] = (float)((int)param_1 >> 0x18 & 0xff) / 255.0; return; } //@@ 00a0f690 KColor::KColor /* DB: r,g,b in xmm, a param, ECX[4]=0 prototype: db/protos.zhl, confirmed by RET 4 */ KColor * __thiscall KColor::KColor(KColor *this,float red,float green,float blue,float alpha) { this->_unk = 0; this->_red = red; this->_green = green; this->_blue = blue; this->_alpha = alpha; return this; } //@@ 00a0f6c0 FUN_00a0f6c0 void FUN_00a0f6c0(int param_1,int param_2,int param_3,int param_4) { float *in_ECX; in_ECX[4] = 0.0; *in_ECX = (float)param_1 / 255.0; in_ECX[1] = (float)param_2 / 255.0; in_ECX[2] = (float)param_3 / 255.0; in_ECX[3] = (float)param_4 / 255.0; return; } //@@ 00a0f720 FUN_00a0f720 void FUN_00a0f720(undefined4 *param_1) { undefined4 *in_ECX; *in_ECX = *param_1; in_ECX[1] = param_1[1]; in_ECX[2] = param_1[2]; in_ECX[3] = param_1[3]; in_ECX[4] = param_1[4]; return; } //@@ 00a0f750 FUN_00a0f750 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a0f750(void) { undefined1 (*in_ECX) [16]; undefined1 auVar1 [16]; if (*(int *)in_ECX[1] == 2) { auVar1 = maxps(*in_ECX,ZEXT816(0)); auVar1 = minps(auVar1,_DAT_00bac9f0); *in_ECX = auVar1; } return; } //@@ 00a0f770 FUN_00a0f770 void FUN_00a0f770(float *param_1,float *param_2) { float fVar1; double dVar2; double dVar3; double dVar4; if (param_2[4] != 0.0) { KAGE_LogMessage(0x10,(byte *)"Specified color isn\'t in the RGB color space"); } fVar1 = param_2[3]; dVar2 = (double)param_2[2]; libm_sse2_pow_precise(); dVar3 = (double)param_2[1]; libm_sse2_pow_precise(); dVar4 = (double)*param_2; libm_sse2_pow_precise(); param_1[4] = 0.0; *param_1 = (float)dVar4; param_1[1] = (float)dVar3; param_1[2] = (float)dVar2; param_1[3] = fVar1; return; } //@@ 00a0f830 FUN_00a0f830 float * FUN_00a0f830(float *param_1,float *param_2) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; if (param_2[4] != 0.0) { KAGE_LogMessage(0x10,(byte *)"Specified color isn\'t in the RGB color space"); } param_1[3] = param_2[3]; *param_1 = 0.0; param_1[2] = 0.0; param_1[4] = 0.0; param_1[1] = 0.0; fVar3 = param_2[1]; fVar8 = param_2[2]; fVar5 = fVar3; if (*param_2 <= fVar3) { fVar5 = *param_2; } if (fVar3 <= *param_2) { fVar3 = *param_2; } fVar7 = fVar8; if (fVar5 <= fVar8) { fVar7 = fVar5; } if (fVar8 <= fVar3) { fVar8 = fVar3; } fVar3 = fVar8 + fVar7; fVar6 = fVar8 - fVar7; fVar5 = fVar3 * 0.5; param_1[2] = fVar5; *param_1 = fVar5; if (fVar7 == fVar8) { *param_1 = 0.0; return param_1; } if (0.5 < fVar5) { fVar3 = (2.0 - fVar8) - fVar7; } param_1[1] = fVar6 / fVar3; fVar7 = *param_2; fVar1 = param_2[1]; fVar2 = param_2[2]; if (fVar8 == fVar7) { if (fVar2 <= fVar1) { fVar4 = (fVar1 - fVar2) / fVar6 + 0.0; } else { fVar4 = (fVar1 - fVar2) / fVar6 + 6.0; } } else if (fVar8 == fVar1) { fVar4 = (fVar2 - fVar7) / fVar6 + 2.0; } else { fVar4 = fVar5; if (fVar8 == fVar2) { fVar4 = (fVar7 - fVar1) / fVar6 + 4.0; } } *param_1 = (fVar4 / 6.0) * 360.0; param_1[1] = (fVar6 / fVar3) * 100.0; param_1[2] = fVar5 * 100.0; return param_1; } //@@ 00a0f9b0 FUN_00a0f9b0 void FUN_00a0f9b0(float *param_1,float *param_2) { float fVar1; double dVar2; double dVar3; double dVar4; if (param_2[4] != 1.4013e-45) { KAGE_LogMessage(0x10,(byte *)"Specified color isn\'t in the sRGB color space"); } fVar1 = param_2[3]; dVar2 = (double)param_2[2]; libm_sse2_pow_precise(); dVar3 = (double)param_2[1]; libm_sse2_pow_precise(); dVar4 = (double)*param_2; libm_sse2_pow_precise(); param_1[4] = 0.0; *param_1 = (float)dVar4; param_1[1] = (float)dVar3; param_1[2] = (float)dVar2; param_1[3] = fVar1; return; } //@@ 00a0fa70 FUN_00a0fa70 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined1 (*) [16] FUN_00a0fa70(undefined1 (*param_1) [16],undefined4 *param_2) { code *pcVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined1 auVar6 [16]; undefined1 local_2c [20]; undefined4 local_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; int local_8; local_8 = 1; if (param_2[4] != 1) { KAGE_LogMessage(0x10,(byte *)"Specified color isn\'t in the sRGB color space"); local_8 = param_2[4]; } local_18 = *param_2; uStack_14 = param_2[1]; uStack_10 = param_2[2]; uStack_c = param_2[3]; if (*(code **)(&DAT_00b244c4 + local_8 * 0xc) != (code *)0x0) { puVar5 = (undefined4 *)(**(code **)(&DAT_00b244c4 + local_8 * 0xc))(local_2c,&local_18); local_18 = *puVar5; uStack_14 = puVar5[1]; uStack_10 = puVar5[2]; uStack_c = puVar5[3]; local_8 = 0; } pcVar1 = (code *)(&PTR_FUN_00b244cc)[local_8 * 3]; *(undefined4 *)*param_1 = local_18; *(undefined4 *)(*param_1 + 4) = uStack_14; *(undefined4 *)(*param_1 + 8) = uStack_10; *(undefined4 *)(*param_1 + 0xc) = uStack_c; *(int *)param_1[1] = local_8; if (pcVar1 != (code *)0x0) { puVar5 = (undefined4 *)(*pcVar1)(local_2c,param_1); uVar2 = puVar5[1]; uVar3 = puVar5[2]; uVar4 = puVar5[3]; *(undefined4 *)*param_1 = *puVar5; *(undefined4 *)(*param_1 + 4) = uVar2; *(undefined4 *)(*param_1 + 8) = uVar3; *(undefined4 *)(*param_1 + 0xc) = uVar4; *(undefined4 *)param_1[1] = 2; auVar6 = maxps(*param_1,ZEXT816(0)); auVar6 = minps(auVar6,_DAT_00bac9f0); *param_1 = auVar6; } return param_1; } //@@ 00a0fb60 KColor::hsl_to_rgb /* DB: ? (out, in) KColor: "Specified color isn't in the HSL color space" unless in[4] (space tag) == 2; h/360, s*0.01, l*0.01, achromatic shortcut, standard hue2rgb with 1/3 offsets, copies alpha and sets out space tag 0; next to KColor::KColor (00a0f690) */ void KColor::hsl_to_rgb(float *param_1,float *param_2) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; if (param_2[4] != 2.8026e-45) { KAGE_LogMessage(0x10,(byte *)"Specified color isn\'t in the HSL color space"); } fVar3 = param_2[1] * 0.01; fVar5 = *param_2 / 360.0; fVar4 = param_2[2] * 0.01; if (fVar3 == 0.0) { fVar3 = param_2[3]; *param_1 = fVar4; param_1[1] = fVar4; param_1[2] = fVar4; param_1[3] = fVar3; param_1[4] = 0.0; return; } if (0.5 <= fVar4) { fVar3 = (fVar4 + fVar3) - fVar4 * fVar3; } else { fVar3 = (fVar3 + 1.0) * fVar4; } fVar1 = fVar5 - 0.33333334; fVar4 = (fVar4 + fVar4) - fVar3; if (fVar1 < 0.0) { fVar1 = fVar1 + 1.0; } if (1.0 < fVar1) { fVar1 = fVar1 - 1.0; } if (0.16666667 <= fVar1) { if (0.5 <= fVar1) { if (0.6666667 <= fVar1) { fVar1 = fVar4; } else { fVar1 = (fVar3 - fVar4) * (0.6666667 - fVar1) * 6.0 + fVar4; } } else { fVar1 = fVar3; } } else { fVar1 = (fVar3 - fVar4) * 6.0 * fVar1 + fVar4; } fVar6 = fVar5; if (fVar5 < 0.0) { fVar6 = fVar5 + 1.0; } if (1.0 < fVar6) { fVar6 = fVar6 - 1.0; } if (0.16666667 <= fVar6) { fVar2 = fVar3; if ((0.5 <= fVar6) && (fVar2 = fVar4, fVar6 < 0.6666667)) { fVar2 = (fVar3 - fVar4) * (0.6666667 - fVar6) * 6.0 + fVar4; } } else { fVar2 = (fVar3 - fVar4) * 6.0 * fVar6 + fVar4; } fVar5 = fVar5 + 0.33333334; if (fVar5 < 0.0) { fVar5 = fVar5 + 1.0; } if (1.0 < fVar5) { fVar5 = fVar5 - 1.0; } if (0.16666667 <= fVar5) { if (0.5 <= fVar5) { if (0.6666667 <= fVar5) { fVar3 = fVar4; } else { fVar3 = (fVar3 - fVar4) * (0.6666667 - fVar5) * 6.0 + fVar4; } } } else { fVar3 = (fVar3 - fVar4) * 6.0 * fVar5 + fVar4; } *param_1 = fVar3; param_1[1] = fVar2; param_1[2] = fVar1; param_1[3] = 1.0; param_1[4] = 0.0; return; } //@@ 00a0fdb0 FUN_00a0fdb0 undefined4 * FUN_00a0fdb0(undefined4 *param_1,undefined4 *param_2) { code *pcVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined1 local_2c [20]; undefined4 local_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; int local_8; local_8 = param_2[4]; if (local_8 != 2) { KAGE_LogMessage(0x10,(byte *)"Specified color isn\'t in the HSL color space"); local_8 = param_2[4]; } local_18 = *param_2; uStack_14 = param_2[1]; uStack_10 = param_2[2]; uStack_c = param_2[3]; if (*(code **)(&DAT_00b244c4 + local_8 * 0xc) != (code *)0x0) { puVar5 = (undefined4 *)(**(code **)(&DAT_00b244c4 + local_8 * 0xc))(local_2c,&local_18); local_18 = *puVar5; uStack_14 = puVar5[1]; uStack_10 = puVar5[2]; uStack_c = puVar5[3]; local_8 = 0; } pcVar1 = (code *)(&PTR_FUN_00b244c8)[local_8 * 3]; *param_1 = local_18; param_1[1] = uStack_14; param_1[2] = uStack_10; param_1[3] = uStack_c; param_1[4] = local_8; if (pcVar1 != (code *)0x0) { puVar5 = (undefined4 *)(*pcVar1)(local_2c,param_1); uVar2 = puVar5[1]; uVar3 = puVar5[2]; uVar4 = puVar5[3]; *param_1 = *puVar5; param_1[1] = uVar2; param_1[2] = uVar3; param_1[3] = uVar4; param_1[4] = 1; } return param_1; } //@@ 00a0fe80 EntityPtr::clear /* DB: ?zero two dwords (ICF) prototype: db/protos.zhl */ EntityPtr * __thiscall EntityPtr::clear(EntityPtr *this) { this[1] = (EntityPtr)0x0; *this = (EntityPtr)0x0; return this; } //@@ 00a0fe90 Vector::Vector /* DB: stores XMM1/XMM2 into x,y prototype: db/protos.zhl */ Vector * __thiscall Vector::Vector(Vector *this,float x,float y) { this->x = x; this->y = y; return this; } //@@ 00a0fea0 Vector::Length /* ZHL [lua] Lua binding Vector:Length prototype: db/protos.zhl, confirmed by RET 0 */ float __thiscall Vector::Length(Vector *this) { float fVar1; fVar1 = sqrtf(this->x * this->x + this->y * this->y); return fVar1; } //@@ 00a0fed0 Vector::LengthSquared /* ZHL [lua] Lua binding Vector:LengthSquared prototype: db/protos.zhl, confirmed by RET 0 */ float __thiscall Vector::LengthSquared(Vector *this) { return this->x * this->x + this->y * this->y; } //@@ 00a0ff00 FUN_00a0ff00 void FUN_00a0ff00(void) { float *in_ECX; float *in_EDX; sqrtf((in_EDX[1] - in_ECX[1]) * (in_EDX[1] - in_ECX[1]) + (*in_EDX - *in_ECX) * (*in_EDX - *in_ECX)); return; } //@@ 00a0ff30 Vector::Distance /* ZHL [lua] Lua binding Vector:Distance prototype: db/protos.zhl, confirmed by RET 4 */ float __thiscall Vector::Distance(Vector *this,Vector *other) { float fVar1; float fVar2; fVar1 = other->y - this->y; fVar2 = other->x - this->x; fVar1 = sqrtf(fVar1 * fVar1 + fVar2 * fVar2); return fVar1; } //@@ 00a0ff70 FUN_00a0ff70 void FUN_00a0ff70(void) { return; } //@@ 00a0ff90 Vector::DistanceSquared /* ZHL [lua] Lua binding Vector:DistanceSquared prototype: db/protos.zhl, confirmed by RET 4 */ float __thiscall Vector::DistanceSquared(Vector *this,Vector *other) { float fVar1; float fVar2; fVar1 = other->y - this->y; fVar2 = other->x - this->x; return fVar1 * fVar1 + fVar2 * fVar2; } //@@ 00a0ffc0 Vector::Normalize /* ZHL [lua] Lua binding Vector:Normalize prototype: db/protos.zhl, confirmed by RET 0 */ void __thiscall Vector::Normalize(Vector *this) { float fVar1; float fVar2; float fVar3; fVar1 = this->x; fVar2 = this->y; fVar3 = sqrtf(fVar1 * fVar1 + fVar2 * fVar2); if (0.0 < fVar3) { this->x = fVar1 * (1.0 / fVar3); this->y = fVar2 * (1.0 / fVar3); } return; } //@@ 00a10030 Vector::Normalized /* ZHL [lua] Lua binding Vector:Normalized prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::Normalized(Vector *this,Vector *outResult) { float fVar1; float fVar2; float fVar3; fVar2 = this->y; outResult->x = this->x; fVar1 = outResult->x; outResult->y = fVar2; fVar2 = outResult->y; fVar3 = sqrtf(fVar1 * fVar1 + fVar2 * fVar2); if (0.0 < fVar3) { outResult->x = fVar1 * (1.0 / fVar3); outResult->y = fVar2 * (1.0 / fVar3); } return outResult; } //@@ 00a100b0 Vector::Resize /* ZHL [lua] Lua binding Vector:Resize prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Vector::Resize(Vector *this,float length) { float fVar1; fVar1 = sqrtf(this->x * this->x + this->y * this->y); if (0.0 < fVar1) { this->y = (length / fVar1) * this->y; this->x = (length / fVar1) * this->x; } return; } //@@ 00a10100 Vector::Resized /* ZHL [lua] Lua binding Vector:Resized prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::Resized(Vector *this,Vector *outVec,float length) { float fVar1; float fVar2; fVar2 = sqrtf(this->x * this->x + this->y * this->y); if (0.0 < fVar2) { fVar1 = this->x; outVec->y = (length / fVar2) * this->y; outVec->x = (length / fVar2) * fVar1; return outVec; } fVar2 = this->y; outVec->x = this->x; outVec->y = fVar2; return outVec; } //@@ 00a10160 FUN_00a10160 void FUN_00a10160(void) { return; } //@@ 00a10180 Vector::Dot /* ZHL [lua] Lua binding Vector:Dot prototype: db/protos.zhl, confirmed by RET 4 */ float __thiscall Vector::Dot(Vector *this,Vector *other) { return other->x * this->x + other->y * this->y; } //@@ 00a101a0 Vector::Cross /* ZHL [lua] Lua binding Vector:Cross */ float10 Vector::Cross(float *param_1) { float *in_ECX; return (float10)param_1[1] * (float10)*in_ECX - (float10)in_ECX[1] * (float10)*param_1; } //@@ 00a101c0 vector_lerp /* DB: out=a+(b-a)*t, optional clamp t to [0,1] prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Vector * __cdecl vector_lerp(Vector *outResult,Vector *from,Vector *to,byte isClamped,float t) { if (isClamped != 0) { if (t <= 0.0) { t = 0.0; } if (1.0 <= t) { t = 1.0; } } outResult->x = (to->x - from->x) * t + from->x; outResult->y = (to->y - from->y) * t + from->y; return outResult; } //@@ 00a10210 Vector::Lerp /* ZHL [lua] Lua binding Vector:Lerp */ void Vector::Lerp(float *param_1,float param_2,char param_3) { float fVar1; float *in_ECX; if (param_3 != '\0') { if (param_2 <= 0.0) { param_2 = 0.0; } if (1.0 <= param_2) { param_2 = 1.0; } } fVar1 = param_1[1]; *in_ECX = (*param_1 - *in_ECX) * param_2 + *in_ECX; in_ECX[1] = (fVar1 - in_ECX[1]) * param_2 + in_ECX[1]; return; } //@@ 00a10270 Vector::Rotate /* DB: thiscall: angle in XMM1 degrees * 0.017453292, x' = x*cos - y*sin, y' = y*cos + x*sin in place; Entity_Player::update_shooting after Normalize */ void Vector::Rotate(void) { float fVar1; float *in_ECX; float fVar2; float fVar3; float in_XMM1_Da; fVar2 = cos(in_XMM1_Da * 0.017453292); fVar3 = sin(in_XMM1_Da * 0.017453292); fVar1 = *in_ECX; *in_ECX = fVar1 * fVar2 - in_ECX[1] * fVar3; in_ECX[1] = in_ECX[1] * fVar2 + fVar1 * fVar3; return; } //@@ 00a102e0 Vector::Rotated /* ZHL [lua] Lua binding Vector:Rotated prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::Rotated(Vector *this,Vector *outVec,float angleDegrees) { float fVar1; float fVar2; float fVar3; float fVar4; fVar3 = cos(angleDegrees * 0.017453292); fVar4 = sin(angleDegrees * 0.017453292); fVar1 = this->x; fVar2 = this->y; outVec->x = fVar1 * fVar3 - fVar2 * fVar4; outVec->y = fVar2 * fVar3 + fVar1 * fVar4; return outVec; } //@@ 00a10350 Vector::FromAngle /* DB: deg*pi/180 -> cos,sin prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ Vector * __cdecl Vector::FromAngle(Vector *outVec,float angleDegrees) { float fVar1; fVar1 = cos(angleDegrees * 0.017453292); outVec->x = fVar1; fVar1 = sin(angleDegrees * 0.017453292); outVec->y = fVar1; return outVec; } //@@ 00a10390 Vector::GetAngleDegrees /* ZHL [lua] Lua binding Vector:GetAngleDegrees prototype: db/protos.zhl, confirmed by RET 0 */ float __thiscall Vector::GetAngleDegrees(Vector *this) { float fVar1; fVar1 = atan2f(this->y,this->x); return fVar1 * 57.295776; } //@@ 00a103c0 Vector::Clamp /* ZHL [lua] Lua binding Vector:Clamp */ void Vector::Clamp(float param_1,float param_2,float param_3,float param_4) { float *in_ECX; float fVar1; fVar1 = *in_ECX; if (*in_ECX <= param_1) { fVar1 = param_1; } if (param_3 <= fVar1) { fVar1 = param_3; } *in_ECX = fVar1; fVar1 = in_ECX[1]; if (in_ECX[1] <= param_2) { fVar1 = param_2; } if (param_4 <= fVar1) { fVar1 = param_4; } in_ECX[1] = fVar1; return; } //@@ 00a103f0 Vector::Clamped /* ZHL [lua] Lua binding Vector:Clamped */ void Vector::Clamped(float *param_1,float param_2,float param_3,float param_4,float param_5) { float *in_ECX; float fVar1; fVar1 = *in_ECX; if (*in_ECX <= param_2) { fVar1 = param_2; } if (param_4 <= fVar1) { fVar1 = param_4; } *param_1 = fVar1; fVar1 = in_ECX[1]; if (in_ECX[1] <= param_3) { fVar1 = param_3; } if (param_5 <= fVar1) { fVar1 = param_5; } param_1[1] = fVar1; return; } //@@ 00a10420 Vector::__add /* ZHL [lua] Lua binding Vector:__add prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::__add(Vector *this,Vector *outVec,Vector *other) { outVec->x = other->x + this->x; outVec->y = other->y + this->y; return outVec; } //@@ 00a10450 Vector::operator_add_assign /* DB: adds x,y in place prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::operator_add_assign(Vector *this,Vector *other) { this->x = other->x + this->x; this->y = other->y + this->y; return this; } //@@ 00a10480 Vector::__sub /* ZHL [lua] Lua binding Vector:__sub prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::__sub(Vector *this,Vector *outResult,Vector *other) { outResult->x = this->x - other->x; outResult->y = this->y - other->y; return outResult; } //@@ 00a104b0 Vector::operator__ /* DB: body: this.xy -= arg.xy prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::operator__(Vector *this,Vector *other) { this->x = this->x - other->x; this->y = this->y - other->y; return this; } //@@ 00a104e0 Vector::__mul /* ZHL [lua] Lua binding Vector:__mul prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::__mul(Vector *this,Vector *outResult,float *scalar) { float fVar1; float fVar2; fVar1 = *scalar; fVar2 = this->y; outResult->x = fVar1 * this->x; outResult->y = fVar1 * fVar2; return outResult; } //@@ 00a10510 Vector::Mul /* DB: out = a * this componentwise prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::Mul(Vector *this,Vector *outResult,Vector *other) { outResult->x = other->x * this->x; outResult->y = other->y * this->y; return outResult; } //@@ 00a10540 Vector::operator_mul_assign /* DB: scales x,y by float in place prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::operator_mul_assign(Vector *this,float *scalar) { this->x = *scalar * this->x; this->y = this->y * *scalar; return this; } //@@ 00a10570 FUN_00a10570 void FUN_00a10570(float *param_1) { float *in_ECX; *in_ECX = *param_1 * *in_ECX; in_ECX[1] = param_1[1] * in_ECX[1]; return; } //@@ 00a105a0 Vector::__div /* ZHL [lua] Lua binding Vector:__div prototype: db/protos.zhl, confirmed by RET 8 */ Vector * __thiscall Vector::__div(Vector *this,Vector *outResult,float *divisor) { float fVar1; fVar1 = *divisor; outResult->x = this->x / fVar1; outResult->y = this->y / fVar1; return outResult; } //@@ 00a105d0 Vector::__div_assign /* DB: divides x,y in place by float prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::__div_assign(Vector *this,float *divisor) { this->x = this->x / *divisor; this->y = this->y / *divisor; return this; } //@@ 00a10600 Vector::operator_eq /* DB: compares x and y floats of two vectors prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Vector::operator_eq(Vector *this,Vector *other) { if ((this->x == other->x) && (this->y == other->y)) { return 1; } return 0; } //@@ 00a10630 Vector::operator_ne /* DB: compares two float pairs, returns 1 if different prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall Vector::operator_ne(Vector *this,Vector *other) { if ((this->x == other->x) && (this->y == other->y)) { return 0; } return 1; } //@@ 00a10660 Vector::__unm /* ZHL [lua] Lua binding Vector:__unm prototype: db/protos.zhl, confirmed by RET 4 */ Vector * __thiscall Vector::__unm(Vector *this,Vector *outResult) { outResult->x = -this->x; outResult->y = -this->y; return outResult; } //@@ 00a10690 FUN_00a10690 void FUN_00a10690(undefined4 param_1) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[3] = 0; in_ECX[5] = 0; in_ECX[7] = 0; in_ECX[4] = in_XMM1_Da; *in_ECX = in_XMM1_Da; in_ECX[3] = in_XMM2_Da; in_ECX[1] = in_XMM2_Da; in_ECX[6] = in_XMM3_Da; in_ECX[2] = in_XMM3_Da; in_ECX[7] = param_1; in_ECX[5] = param_1; return; } //@@ 00a106e0 DestinationQuad::DestinationQuad /* DB: stores four Vector corners (param_1..param_4) into this[0..7]; BeamRenderer::End, Room::render_water, Backdrop::RenderWater, set_quad_corner_colors prototype: db/protos.zhl, confirmed by RET 16 */ DestinationQuad * __thiscall DestinationQuad::DestinationQuad (DestinationQuad *this,Vector *topLeft,Vector *topRight,Vector *bottomLeft, Vector *bottomRight) { (this->_topLeft).y = 0.0; (this->_topLeft).x = 0.0; (this->_topRight).y = 0.0; (this->_topRight).x = 0.0; (this->_bottomLeft).y = 0.0; (this->_bottomLeft).x = 0.0; (this->_bottomRight).y = 0.0; (this->_bottomRight).x = 0.0; (this->_topLeft).x = topLeft->x; (this->_topLeft).y = topLeft->y; (this->_topRight).x = topRight->x; (this->_topRight).y = topRight->y; (this->_bottomLeft).x = bottomLeft->x; (this->_bottomLeft).y = bottomLeft->y; (this->_bottomRight).x = bottomRight->x; (this->_bottomRight).y = bottomRight->y; return this; } //@@ 00a10760 Quad::rotate /* DB: thiscall on a 4-corner float quad, (pivot Vector*, angle in xmm2): if angle != 0, translates the 4 corners by -pivot, rotates by cos/sin, translates back; AnimationLayer::RenderFrame, render_build_sprite_quad, Room::render_darkness_overlay prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall Quad::rotate(void *this,Vector *pivot,float angle) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; if (angle != 0.0) { fVar1 = cos(angle); fVar2 = sin(angle); fVar3 = -pivot->y; fVar8 = -pivot->x; fVar5 = fVar3 + *(float *)((int)this + 4); *(float *)((int)this + 0xc) = fVar3 + *(float *)((int)this + 0xc); fVar4 = fVar8 + *(float *)((int)this + 8); fVar9 = fVar8 + *(float *)((int)this + 0x18); fVar7 = fVar8 + *(float *)((int)this + 0x10); *(float *)((int)this + 0x14) = fVar3 + *(float *)((int)this + 0x14); *(float *)((int)this + 0x1c) = fVar3 + *(float *)((int)this + 0x1c); fVar3 = (fVar8 + *(float *)this) * fVar1 - fVar5 * fVar2; fVar8 = fVar5 * fVar1 + (fVar8 + *(float *)this) * fVar2; *(float *)this = fVar3; *(float *)((int)this + 4) = fVar8; fVar10 = fVar4 * fVar1 - *(float *)((int)this + 0xc) * fVar2; fVar11 = *(float *)((int)this + 0xc) * fVar1 + fVar4 * fVar2; *(float *)((int)this + 8) = fVar10; *(float *)((int)this + 0xc) = fVar11; fVar6 = *(float *)((int)this + 0x14) * fVar1 + fVar7 * fVar2; fVar5 = fVar7 * fVar1 - *(float *)((int)this + 0x14) * fVar2; *(float *)((int)this + 0x14) = fVar6; *(float *)((int)this + 0x10) = fVar5; fVar4 = *(float *)((int)this + 0x1c) * fVar1 + fVar9 * fVar2; fVar1 = fVar9 * fVar1 - *(float *)((int)this + 0x1c) * fVar2; *(float *)((int)this + 0x1c) = fVar4; *(float *)((int)this + 0x18) = fVar1; *(float *)this = fVar3 + pivot->x; *(float *)((int)this + 4) = fVar8 + pivot->y; *(float *)((int)this + 8) = fVar10 + pivot->x; *(float *)((int)this + 0xc) = fVar11 + pivot->y; *(float *)((int)this + 0x10) = fVar5 + pivot->x; *(float *)((int)this + 0x14) = fVar6 + pivot->y; *(float *)((int)this + 0x18) = fVar1 + pivot->x; *(float *)((int)this + 0x1c) = fVar4 + pivot->y; } return; } //@@ 00a10950 Quad::scale /* DB: thiscall on a 4-corner float quad (pivot Vector*, scale Vector*): if scale != (1,1) translates the corners by -pivot, multiplies x/y by scale, translates back; render_build_sprite_quad calls it right before Quad::rotate */ void Quad::scale(float *param_1,float *param_2) { float fVar1; float fVar2; float fVar3; float *in_ECX; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; if ((*param_2 != 1.0) || (param_2[1] != 1.0)) { fVar12 = -*param_1; fVar10 = -param_1[1]; fVar4 = *in_ECX; fVar5 = in_ECX[1]; fVar6 = in_ECX[2]; fVar11 = in_ECX[3]; fVar13 = in_ECX[4]; fVar1 = in_ECX[6]; *in_ECX = fVar12 + fVar4; fVar2 = in_ECX[5]; fVar3 = in_ECX[7]; in_ECX[1] = fVar10 + fVar5; in_ECX[2] = fVar12 + fVar6; in_ECX[3] = fVar10 + fVar11; in_ECX[4] = fVar12 + fVar13; in_ECX[5] = fVar10 + fVar2; in_ECX[6] = fVar12 + fVar1; in_ECX[7] = fVar10 + fVar3; fVar9 = (fVar12 + fVar4) * *param_2; *in_ECX = fVar9; fVar8 = (fVar10 + fVar5) * param_2[1]; in_ECX[1] = fVar8; fVar7 = (fVar12 + fVar6) * *param_2; in_ECX[2] = fVar7; fVar6 = (fVar10 + fVar11) * param_2[1]; in_ECX[3] = fVar6; fVar5 = (fVar12 + fVar13) * *param_2; in_ECX[4] = fVar5; fVar4 = (fVar10 + fVar2) * param_2[1]; in_ECX[5] = fVar4; fVar13 = (fVar12 + fVar1) * *param_2; in_ECX[6] = fVar13; fVar11 = (fVar10 + fVar3) * param_2[1]; in_ECX[7] = fVar11; *in_ECX = fVar9 + *param_1; in_ECX[1] = fVar8 + param_1[1]; in_ECX[2] = fVar7 + *param_1; in_ECX[3] = fVar6 + param_1[1]; in_ECX[4] = fVar5 + *param_1; in_ECX[5] = fVar4 + param_1[1]; in_ECX[6] = fVar13 + *param_1; in_ECX[7] = fVar11 + param_1[1]; } return; } //@@ 00a10ab0 Quad::is_on_screen /* DB: ? thiscall on a render quad (4 corner x,y): clamps the quad's bounding box to the render target size (g_graphicsManager_renderTarget +0x10/+0x14) or the screen size (DAT_00c7997c/80) and returns whether anything is left; render_quad_draw drops quads for which it returns 0 */ int Quad::is_on_screen(void) { float fVar1; float fVar2; uint3 uVar3; float *in_ECX; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; if ((g_graphicsManager_renderTarget == (void *)0x0) || ((g_graphicsManager_flags & 0x20) != 0)) { fVar5 = DAT_00c7997c; } else { fVar5 = (float)((double)*(int *)((int)g_graphicsManager_renderTarget + 0x10) + __uint_to_double_fixup [-(*(int *)((int)g_graphicsManager_renderTarget + 0x10) >> 0x1f)]); } if ((g_graphicsManager_renderTarget == (void *)0x0) || ((g_graphicsManager_flags & 0x20) != 0)) { fVar4 = DAT_00c79980; } else { fVar4 = (float)((double)*(int *)((int)g_graphicsManager_renderTarget + 0x14) + __uint_to_double_fixup [-(*(int *)((int)g_graphicsManager_renderTarget + 0x14) >> 0x1f)]); } fVar2 = *in_ECX; fVar6 = in_ECX[2]; fVar1 = in_ECX[4]; fVar9 = in_ECX[1]; fVar12 = in_ECX[3]; fVar11 = in_ECX[5]; fVar8 = fVar2; if (fVar2 <= 0.0) { fVar8 = 0.0; } fVar7 = fVar2; if (fVar5 <= fVar2) { fVar7 = fVar5; } fVar10 = fVar6; if (fVar6 <= fVar8) { fVar10 = fVar8; } if (fVar7 <= fVar6) { fVar6 = fVar7; } fVar8 = fVar1; if (fVar1 <= fVar10) { fVar8 = fVar10; } if (fVar6 <= fVar1) { fVar1 = fVar6; } fVar6 = in_ECX[6]; fVar7 = fVar6; if (fVar6 <= fVar8) { fVar7 = fVar8; } if (fVar1 <= fVar6) { fVar6 = fVar1; } fVar1 = fVar9; if (fVar4 <= fVar9) { fVar1 = fVar4; } fVar8 = fVar12; if (fVar1 <= fVar12) { fVar8 = fVar1; } fVar1 = fVar11; if (fVar8 <= fVar11) { fVar1 = fVar8; } fVar8 = in_ECX[7]; fVar10 = fVar8; if (fVar1 <= fVar8) { fVar10 = fVar1; } if (fVar9 <= 0.0) { fVar9 = 0.0; } if (fVar12 <= fVar9) { fVar12 = fVar9; } if (fVar11 <= fVar12) { fVar11 = fVar12; } if (fVar8 <= fVar11) { fVar8 = fVar11; } uVar3 = (uint3)((uint)fVar2 >> 8); if ((((fVar6 < fVar5) && (0.0 < fVar7)) && (fVar10 < fVar4)) && (0.0 < fVar8)) { return CONCAT31(uVar3,1); } return (uint)uVar3 << 8; } //@@ 00a10c00 ColorQuad::ColorQuad /* DB: ? thiscall(KColor*): zeroes 4 corner Vector2s (g_vectorZero zero vector) then copies the 5-dword color into 4 corner color slots (+0x20,+0x34,+0x48,+0x5c); callers render_color_quad, render_quad_draw_color_shader, Room::render_water prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall ColorQuad::ColorQuad(void *this,KColor *color) { undefined4 uVar1; float fVar2; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(float *)((int)this + 0x18) = g_vectorZero.x; fVar2 = g_vectorZero.y; uVar1 = *(undefined4 *)((int)this + 0x18); *(float *)((int)this + 0x1c) = g_vectorZero.y; *(undefined4 *)((int)this + 0x10) = uVar1; *(float *)((int)this + 0x14) = fVar2; *(undefined4 *)((int)this + 8) = uVar1; *(float *)((int)this + 0xc) = fVar2; *(undefined4 *)this = uVar1; *(float *)((int)this + 4) = fVar2; *(float *)((int)this + 0x20) = color->_red; *(float *)((int)this + 0x24) = color->_green; *(float *)((int)this + 0x28) = color->_blue; *(float *)((int)this + 0x2c) = color->_alpha; *(int *)((int)this + 0x30) = color->_unk; *(float *)((int)this + 0x34) = color->_red; *(float *)((int)this + 0x38) = color->_green; *(float *)((int)this + 0x3c) = color->_blue; *(float *)((int)this + 0x40) = color->_alpha; *(int *)((int)this + 0x44) = color->_unk; *(float *)((int)this + 0x48) = color->_red; *(float *)((int)this + 0x4c) = color->_green; *(float *)((int)this + 0x50) = color->_blue; *(float *)((int)this + 0x54) = color->_alpha; *(int *)((int)this + 0x58) = color->_unk; *(float *)((int)this + 0x5c) = color->_red; *(float *)((int)this + 0x60) = color->_green; *(float *)((int)this + 100) = color->_blue; *(float *)((int)this + 0x68) = color->_alpha; *(int *)((int)this + 0x6c) = color->_unk; return; } //@@ 00a10d00 render_quad_set_uniform_color /* DB: ? fills quad vertex struct with same color (5 dwords per corner); Game/Room render prototype: db/protos.zhl, confirmed by RET 8 */ void * render_quad_set_uniform_color (void *outQuad,float left,float top,float right,float bottom,KColor *color) { *(undefined4 *)((int)outQuad + 0xc) = 0; *(undefined4 *)((int)outQuad + 0x14) = 0; *(undefined4 *)((int)outQuad + 0x1c) = 0; *(float *)((int)outQuad + 0x10) = left; *(float *)outQuad = left; *(float *)((int)outQuad + 0xc) = top; *(float *)((int)outQuad + 4) = top; *(float *)((int)outQuad + 0x18) = right; *(float *)((int)outQuad + 8) = right; *(float *)((int)outQuad + 0x1c) = bottom; *(float *)((int)outQuad + 0x14) = bottom; *(float *)((int)outQuad + 0x20) = color->_red; *(float *)((int)outQuad + 0x24) = color->_green; *(float *)((int)outQuad + 0x28) = color->_blue; *(float *)((int)outQuad + 0x2c) = color->_alpha; *(int *)((int)outQuad + 0x30) = color->_unk; *(float *)((int)outQuad + 0x34) = color->_red; *(float *)((int)outQuad + 0x38) = color->_green; *(float *)((int)outQuad + 0x3c) = color->_blue; *(float *)((int)outQuad + 0x40) = color->_alpha; *(int *)((int)outQuad + 0x44) = color->_unk; *(float *)((int)outQuad + 0x48) = color->_red; *(float *)((int)outQuad + 0x4c) = color->_green; *(float *)((int)outQuad + 0x50) = color->_blue; *(float *)((int)outQuad + 0x54) = color->_alpha; *(int *)((int)outQuad + 0x58) = color->_unk; *(float *)((int)outQuad + 0x5c) = color->_red; *(float *)((int)outQuad + 0x60) = color->_green; *(float *)((int)outQuad + 100) = color->_blue; *(float *)((int)outQuad + 0x68) = color->_alpha; *(int *)((int)outQuad + 0x6c) = color->_unk; return outQuad; } //@@ 00a10dd0 set_quad_corner_colors /* DB: ? copies 5-dword color into 4 corners; Laser render prototype: db/protos.zhl, confirmed by RET 20 */ void * __thiscall set_quad_corner_colors (void *this,Vector *topLeft,Vector *topRight,Vector *bottomLeft,Vector *bottomRight, KColor *color) { DestinationQuad::DestinationQuad(this,topLeft,topRight,bottomLeft,bottomRight); *(float *)((int)this + 0x20) = color->_red; *(float *)((int)this + 0x24) = color->_green; *(float *)((int)this + 0x28) = color->_blue; *(float *)((int)this + 0x2c) = color->_alpha; *(int *)((int)this + 0x30) = color->_unk; *(float *)((int)this + 0x34) = color->_red; *(float *)((int)this + 0x38) = color->_green; *(float *)((int)this + 0x3c) = color->_blue; *(float *)((int)this + 0x40) = color->_alpha; *(int *)((int)this + 0x44) = color->_unk; *(float *)((int)this + 0x48) = color->_red; *(float *)((int)this + 0x4c) = color->_green; *(float *)((int)this + 0x50) = color->_blue; *(float *)((int)this + 0x54) = color->_alpha; *(int *)((int)this + 0x58) = color->_unk; *(float *)((int)this + 0x5c) = color->_red; *(float *)((int)this + 0x60) = color->_green; *(float *)((int)this + 100) = color->_blue; *(float *)((int)this + 0x68) = color->_alpha; *(int *)((int)this + 0x6c) = color->_unk; return this; } //@@ 00a10e70 render_quad_set_rect /* DB: 4 verts from pos+size, 3x5 color floats prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall render_quad_set_rect(void *this,Vector *position,Vector *size,KColor *color) { float fVar1; float fVar2; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; fVar1 = position->x; *(float *)((int)this + 0x18) = fVar1; fVar2 = position->y; *(float *)((int)this + 0x1c) = fVar2; *(float *)((int)this + 0x14) = fVar2; *(float *)((int)this + 0xc) = fVar2; *(float *)((int)this + 4) = fVar2; *(float *)((int)this + 8) = fVar1; *(float *)((int)this + 0x10) = fVar1; *(float *)this = fVar1; *(float *)((int)this + 8) = fVar1 + size->x; *(float *)((int)this + 0x14) = *(float *)((int)this + 0x14) + size->y; *(float *)((int)this + 0x18) = fVar1 + size->x; *(float *)((int)this + 0x1c) = *(float *)((int)this + 0x1c) + size->y; *(float *)((int)this + 0x20) = color->_red; *(float *)((int)this + 0x24) = color->_green; *(float *)((int)this + 0x28) = color->_blue; *(float *)((int)this + 0x2c) = color->_alpha; *(int *)((int)this + 0x30) = color->_unk; *(float *)((int)this + 0x34) = color->_red; *(float *)((int)this + 0x38) = color->_green; *(float *)((int)this + 0x3c) = color->_blue; *(float *)((int)this + 0x40) = color->_alpha; *(int *)((int)this + 0x44) = color->_unk; *(float *)((int)this + 0x48) = color->_red; *(float *)((int)this + 0x4c) = color->_green; *(float *)((int)this + 0x50) = color->_blue; *(float *)((int)this + 0x54) = color->_alpha; *(int *)((int)this + 0x58) = color->_unk; *(float *)((int)this + 0x5c) = color->_red; *(float *)((int)this + 0x60) = color->_green; *(float *)((int)this + 100) = color->_blue; *(float *)((int)this + 0x68) = color->_alpha; *(int *)((int)this + 0x6c) = color->_unk; return; } //@@ 00a10fa0 render_quad_copy /* DB: copy ctor of the 0x70-byte render quad (8 pos floats + 4 KColors, cf. render_quad_set_rect): default-inits corners to g_vectorZero and 4x KColor::SetFromARGB(0xffffffff), then copies 0x1c dwords from param_1; BeamRenderer::End, render_quad_draw prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall render_quad_copy(void *this,void *src) { float fVar1; float fVar2; int iVar3; undefined4 *puVar4; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 0x18) = 0; fVar1 = g_vectorZero.x; *(float *)((int)this + 0x18) = g_vectorZero.x; fVar2 = g_vectorZero.y; *(float *)((int)this + 0x1c) = g_vectorZero.y; *(float *)((int)this + 0x10) = fVar1; *(float *)((int)this + 0x14) = fVar2; *(float *)((int)this + 8) = fVar1; *(float *)((int)this + 0xc) = fVar2; *(float *)this = fVar1; *(float *)((int)this + 4) = fVar2; KColor::SetFromARGB((KColor *)((int)this + 0x20),0xffffffff); KColor::SetFromARGB((KColor *)((int)this + 0x34),0xffffffff); KColor::SetFromARGB((KColor *)((int)this + 0x48),0xffffffff); KColor::SetFromARGB((KColor *)((int)this + 0x5c),0xffffffff); puVar4 = this; for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) { *puVar4 = *(undefined4 *)src; src = (undefined4 *)((int)src + 4); puVar4 = puVar4 + 1; } return this; } //@@ 00a11060 FUN_00a11060 void FUN_00a11060(undefined4 *param_1) { undefined4 *in_ECX; int iVar1; for (iVar1 = 0x1c; iVar1 != 0; iVar1 = iVar1 + -1) { *in_ECX = *param_1; param_1 = param_1 + 1; in_ECX = in_ECX + 1; } return; } //@@ 00a11080 FUN_00a11080 void FUN_00a11080(void) { undefined4 *in_ECX; in_ECX[3] = 0; in_ECX[5] = 0; in_ECX[7] = 0; in_ECX[4] = 0; *in_ECX = 0; in_ECX[3] = 0; in_ECX[1] = 0; in_ECX[6] = 0x3f800000; in_ECX[2] = 0x3f800000; in_ECX[7] = 0x3f800000; in_ECX[5] = 0x3f800000; *(undefined1 *)(in_ECX + 8) = 0; return; } //@@ 00a110e0 FUN_00a110e0 void FUN_00a110e0(undefined4 param_1,undefined1 param_2) { undefined4 *in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM2_Da; undefined4 in_XMM3_Da; in_ECX[3] = 0; in_ECX[5] = 0; in_ECX[7] = 0; *(undefined1 *)(in_ECX + 8) = param_2; in_ECX[4] = in_XMM1_Da; *in_ECX = in_XMM1_Da; in_ECX[3] = in_XMM2_Da; in_ECX[1] = in_XMM2_Da; in_ECX[6] = in_XMM3_Da; in_ECX[2] = in_XMM3_Da; in_ECX[7] = param_1; in_ECX[5] = param_1; return; } //@@ 00a11130 FUN_00a11130 void FUN_00a11130(Vector *param_1,Vector *param_2,Vector *param_3,Vector *param_4) { DestinationQuad *in_ECX; DestinationQuad::DestinationQuad(in_ECX,param_1,param_2,param_3,param_4); *(undefined1 *)&in_ECX[1]._topLeft.x = 1; return; } //@@ 00a11160 quad_set_rect /* DB: ? same 4-corner fill from pos+size as render_quad_set_rect (00a10e70) but an 8-float quad with a bool at +0x20 set to 1 (no colour floats); used just before render_quad_set_rect in Backdrop::RenderFloor/PlayerHUD::RenderActiveItem, likely the source (UV) quad prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall quad_set_rect(void *this,Vector *pos,Vector *size,int unused) { float fVar1; float fVar2; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x10) = 0; fVar1 = pos->x; *(float *)((int)this + 0x18) = fVar1; fVar2 = pos->y; *(float *)((int)this + 0x1c) = fVar2; *(float *)((int)this + 0x14) = fVar2; *(float *)((int)this + 0xc) = fVar2; *(float *)((int)this + 4) = fVar2; *(float *)((int)this + 8) = fVar1; *(float *)((int)this + 0x10) = fVar1; *(float *)this = fVar1; *(float *)((int)this + 8) = fVar1 + size->x; *(float *)((int)this + 0x14) = *(float *)((int)this + 0x14) + size->y; *(float *)((int)this + 0x18) = fVar1 + size->x; fVar1 = size->y; *(undefined1 *)((int)this + 0x20) = 1; *(float *)((int)this + 0x1c) = *(float *)((int)this + 0x1c) + fVar1; return this; } //@@ 00a11210 SourceQuad::SourceQuad /* DB: ? like ColorQuad::ColorQuad (00a10c00) but copies four 8-byte corner Vector2s plus one extra dword (+0x20) from the param quad; BeamRenderer::End, render_quad_draw, PlayerHUD::RenderActiveItem prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall SourceQuad::SourceQuad(SourceQuad *this,void *source) { float fVar1; float fVar2; float fVar3; (this->_topLeft).y = 0.0; (this->_topLeft).x = 0.0; (this->_topRight).y = 0.0; (this->_topRight).x = 0.0; (this->_bottomLeft).y = 0.0; (this->_bottomLeft).x = 0.0; (this->_bottomRight).y = 0.0; (this->_bottomRight).x = 0.0; fVar1 = g_vectorZero.x; (this->_bottomRight).x = g_vectorZero.x; fVar2 = g_vectorZero.y; (this->_bottomRight).y = g_vectorZero.y; (this->_bottomLeft).x = fVar1; (this->_bottomLeft).y = fVar2; (this->_topRight).x = fVar1; (this->_topRight).y = fVar2; (this->_topLeft).x = fVar1; (this->_topLeft).y = fVar2; fVar1 = *(float *)((int)source + 4); fVar2 = *(float *)((int)source + 8); fVar3 = *(float *)((int)source + 0xc); (this->_topLeft).x = *(float *)source; (this->_topLeft).y = fVar1; (this->_topRight).x = fVar2; (this->_topRight).y = fVar3; fVar1 = *(float *)((int)source + 0x14); fVar2 = *(float *)((int)source + 0x18); fVar3 = *(float *)((int)source + 0x1c); (this->_bottomLeft).x = *(float *)((int)source + 0x10); (this->_bottomLeft).y = fVar1; (this->_bottomRight).x = fVar2; (this->_bottomRight).y = fVar3; this->_coordinateSpace = *(int *)((int)source + 0x20); return; } //@@ 00a112a0 FUN_00a112a0 void FUN_00a112a0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *in_ECX = *param_1; in_ECX[1] = uVar1; in_ECX[2] = uVar2; in_ECX[3] = uVar3; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; in_ECX[4] = param_1[4]; in_ECX[5] = uVar1; in_ECX[6] = uVar2; in_ECX[7] = uVar3; in_ECX[8] = param_1[8]; return; } //@@ 00a112c0 KAGE_LogMessage /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: src/anm2 decompile labels (KAGE_LogMessage(level,fmt,...)) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl KAGE_LogMessage(uint flags,byte *format) { bool bVar1; char cVar2; char *pcVar3; char *pcVar4; undefined1 uStack0000000c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1093d; local_10 = ExceptionList; ExceptionList = &local_10; if (DAT_00c7de48 != 1) { if ((g_logFile == (void *)0x0) || ((_DAT_00c79bdc & flags) == 0)) { bVar1 = false; } else { bVar1 = true; } if (((char)flags != '\0') || (bVar1)) { if (DAT_00c7de48 == 0) { DAT_00c7de48 = 1; cVar2 = FUN_00a15770(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar2 == '\0') { DAT_00c7de48 = 0; ExceptionList = local_10; return; } DAT_00c7de48 = 2; } (**(code **)(PTR_vftable_00c37958 + 0xc))(0xffffffff); local_8 = 0; if (DAT_00c33911 != '\0') { switch(flags) { case 1: break; case 2: break; default: break; case 4: break; case 8: break; case 0x10: } sprintf((byte *)&DAT_00c7b648,&DAT_00b62fdc); } pcVar3 = &DAT_00c7b648; do { cVar2 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar2 != '\0'); FUN_00709bc0(format,&uStack0000000c); if ((char)flags != '\0') { OutputDebugStringA(&DAT_00c7b648); } if (((bVar1) && (g_logFile != (void *)0x0)) && ((_DAT_00c79bdc & flags) != 0)) { pcVar3 = &DAT_00c7b648; do { pcVar4 = pcVar3; pcVar3 = pcVar4 + 1; } while (*pcVar4 != '\0'); (**(code **)(*(int *)g_logFile + 0x1c))(&DAT_00c7b648,1,pcVar4 + -0xc7b648); } pcVar3 = &DAT_00c7b648; do { pcVar4 = pcVar3; DAT_00c7b648 = *pcVar4; pcVar3 = pcVar4 + 1; } while (DAT_00c7b648 != '\0'); DAT_00c33911 = pcVar4[-1] == '\n'; local_8 = 1; (**(code **)(PTR_vftable_00c37958 + 0x10))(); } } ExceptionList = local_10; return; } //@@ 00a114d0 BlendMode::SetMode /* DB: fills 5 blend factor ints for mode 0/1/2; used on ANM2::GetLayer results prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall BlendMode::SetMode(void *this,int mode,int unusedArg) { uint uVar1; undefined4 uVar2; uVar1 = g_graphicsManager_flags; if (mode == 0) { *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 1; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 1; *(undefined4 *)((int)this + 0x10) = 0; } else { if (mode == 1) { uVar1 = g_graphicsManager_flags & 4; uVar2 = 1; *(undefined4 *)this = 0; if (uVar1 == 0) { uVar2 = 6; } *(undefined4 *)((int)this + 4) = uVar2; *(undefined4 *)((int)this + 8) = 7; *(undefined4 *)((int)this + 0xc) = 1; *(undefined4 *)((int)this + 0x10) = 7; return; } if (mode == 2) { *(undefined4 *)this = 0; *(undefined4 *)((int)this + 8) = 1; uVar2 = 6; *(undefined4 *)((int)this + 0xc) = 1; if ((uVar1 & 4) != 0) { uVar2 = 1; } *(undefined4 *)((int)this + 0x10) = 1; *(undefined4 *)((int)this + 4) = uVar2; return; } } return; } //@@ 00a11590 FUN_00a11590 void FUN_00a11590(undefined4 param_1,undefined4 param_2) { undefined4 *in_ECX; in_ECX[2] = param_2; in_ECX[4] = param_2; *in_ECX = 0; in_ECX[1] = param_1; in_ECX[3] = param_1; return; } //@@ 00a115c0 copy_20_bytes /* DB: ?5-dword struct copy (ICF) prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall copy_20_bytes(void *this,void *src) { *(undefined4 *)this = *(undefined4 *)src; *(undefined4 *)((int)this + 4) = *(undefined4 *)((int)src + 4); *(undefined4 *)((int)this + 8) = *(undefined4 *)((int)src + 8); *(undefined4 *)((int)this + 0xc) = *(undefined4 *)((int)src + 0xc); *(undefined4 *)((int)this + 0x10) = *(undefined4 *)((int)src + 0x10); return; } //@@ 00a115f0 FUN_00a115f0 void FUN_00a115f0(byte param_1) { void *in_ECX; FUN_00a11620(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x2c); } return; } //@@ 00a11620 FUN_00a11620 void FUN_00a11620(void) { int *piVar1; int iVar2; LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b10960; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = KAGE::Graphics::ImageManager::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { iVar2 = in_ECX[2]; g_imageReleaseFn = (void *)0x0; std::map::_Erase_tree(in_ECX + 2,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; in_ECX[3] = 0; (**(code **)(in_ECX[4] + 8))(); in_ECX[1] = in_ECX[1] & 0xfffffffe; } lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[6]; in_ECX[4] = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[6] = 0; } *(byte *)(in_ECX + 5) = *(byte *)(in_ECX + 5) & 0xfe; piVar1 = in_ECX + 2; in_ECX[4] = KAGE::MutexBase::vftable; std::map::_Erase_tree(piVar1,*(undefined4 *)(*piVar1 + 4)); operator_delete((void *)*piVar1,0x1c); *in_ECX = KAGE::ManagerBase::vftable; in_ECX[1] = in_ECX[1] & 0xfffffffe; ExceptionList = local_10; return; } //@@ 00a11700 FUN_00a11700 undefined4 FUN_00a11700(void) { int in_ECX; (**(code **)(*(int *)(in_ECX + 0x10) + 4))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; g_imageReleaseFn = FUN_00a12240; g_renderTargetReleaseFn = FUN_00a12240; return 1; } //@@ 00a11730 FUN_00a11730 void FUN_00a11730(void) { int iVar1; int in_ECX; if ((*(byte *)(in_ECX + 4) & 1) != 0) { iVar1 = *(int *)(in_ECX + 8); g_imageReleaseFn = (void *)0x0; std::map::_Erase_tree(in_ECX + 8,*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0xc) = 0; (**(code **)(*(int *)(in_ECX + 0x10) + 8))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; } return; } //@@ 00a11780 FUN_00a11780 void * FUN_00a11780(void *param_1,byte *param_2) { char cVar1; uint uVar2; byte *pbVar3; undefined1 local_20 [4]; int *local_1c; undefined4 local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pbVar3 = param_2; local_8 = 0xffffffff; puStack_c = &LAB_00b109a6; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; local_18 = 0; if ((param_2 == (byte *)0x0) || (*param_2 == 0)) { KAGE::SmartPointer::SmartPointer(param_1,(void *)0x0); ExceptionList = local_10; return param_1; } KAGE::SmartPointer::SmartPointer(local_20,(void *)0x0); local_8 = 1; (**(code **)(DAT_00c37990 + 0xc))(0xffffffff,uVar2); pbVar3 = path_join(pbVar3,(byte *)0x0,0,0); param_2 = (byte *)KAGE_Filesys_FileManager::GetPrimaryFilePathHash(pbVar3); FUN_00a12280(&local_14,¶m_2); if (pbVar3 != (byte *)0x0) { local_8._0_1_ = 2; tracked_alloc(1,pbVar3,0); local_8 = CONCAT31(local_8._1_3_,1); } if (local_14 != DAT_00c37988) { KAGE::SmartPointer::operator_assign(local_20,(void *)(local_14 + 0x14)); } (**(code **)(DAT_00c37990 + 0x10))(); KAGE::SmartPointer::operator_assign(param_1,local_20); local_18 = 1; local_8 = 3; if (local_1c != (int *)0x0) { cVar1 = (**(code **)(*local_1c + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_20); } } ExceptionList = local_10; return param_1; } //@@ 00a118d0 KAGE_Graphics_ImageManager::load_image_file /* DB: ? resolves the path (FileSystem::ResolvePath), returns a cached image if present, otherwise picks the decoder by extension ("png" -> KAGE::Graphics::ImagePng, also bmp/jpeg/jpg/pcx) and loads it into a SmartPointer; callers Manager::LoadImage, Font::Load */ void * KAGE_Graphics_ImageManager::load_image_file(void *param_1,byte *param_2) { byte bVar1; char cVar2; uint uVar3; byte *pbVar4; void *pvVar5; int *piVar6; int iVar7; byte *pbVar8; undefined4 *puVar9; undefined4 *extraout_ECX; undefined4 *extraout_ECX_00; undefined4 *extraout_ECX_01; undefined4 *extraout_ECX_02; undefined4 *extraout_ECX_03; byte *pbVar10; bool bVar11; undefined1 local_28 [4]; int *local_24; int *local_20; int *local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10a0f; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; local_18 = 0; KAGE::SmartPointer::SmartPointer(&local_20,(void *)0x0); local_8 = 1; pbVar4 = FileSystem::ResolvePath(param_2); if (pbVar4 == (byte *)0x0) { KAGE::SmartPointer::operator_assign(param_1,&local_20); local_8 = 2; goto LAB_00a11c31; } pvVar5 = (void *)FUN_00a11780(local_28,pbVar4); local_8 = CONCAT31(local_8._1_3_,3); local_18 = 2; piVar6 = KAGE::SmartPointer::operator_assign(&local_20,pvVar5); iVar7 = *piVar6; local_18 = 0; local_8 = 4; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(uVar3), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_28); } if (iVar7 != 0) { local_8._0_1_ = 5; tracked_alloc(1,pbVar4,0); local_8 = CONCAT31(local_8._1_3_,1); KAGE::SmartPointer::operator_assign(param_1,&local_20); local_8 = 6; goto LAB_00a11c31; } local_8._0_1_ = 7; tracked_alloc(1,pbVar4,0); local_8 = CONCAT31(local_8._1_3_,1); pbVar4 = path_join(param_2,(byte *)0x0,0,0); if (pbVar4 == (byte *)0x0) { pbVar10 = (byte *)0x0; } else { pbVar10 = pbVar4; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); bVar1 = pbVar4[(int)pbVar10 - (int)(pbVar4 + 1)]; pbVar10 = pbVar4 + ((int)pbVar10 - (int)(pbVar4 + 1)); while ((bVar1 != 0x2e && (pbVar10 != pbVar4))) { pbVar10 = pbVar10 + -1; bVar1 = *pbVar10; } pbVar10 = pbVar10 + 1; } iVar7 = _stricmp((char *)pbVar10,"png"); if (iVar7 == 0) { pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) { LAB_00a11b61: puVar9 = (undefined4 *)0x0; } else { FUN_00a69950(); *extraout_ECX = KAGE::Graphics::ImagePng::vftable; puVar9 = extraout_ECX; } LAB_00a11b63: KAGE::SmartPointer::reset(&local_20,puVar9); } else { iVar7 = _stricmp((char *)pbVar10,"jpg"); if ((iVar7 == 0) || (iVar7 = _stricmp((char *)pbVar10,"jpeg"), iVar7 == 0)) { pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11b61; FUN_00a69950(); *extraout_ECX_00 = KAGE::Graphics::ImageJpg::vftable; puVar9 = extraout_ECX_00; goto LAB_00a11b63; } iVar7 = _stricmp((char *)pbVar10,"bmp"); if (iVar7 == 0) { pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11b61; FUN_00a69950(); *extraout_ECX_01 = KAGE::Graphics::ImageBmp::vftable; puVar9 = extraout_ECX_01; goto LAB_00a11b63; } iVar7 = _stricmp((char *)pbVar10,"pcx"); if (iVar7 == 0) { pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11b61; FUN_00a69950(); *extraout_ECX_02 = KAGE::Graphics::ImagePcx::vftable; puVar9 = extraout_ECX_02; goto LAB_00a11b63; } pbVar8 = &s_empty; do { bVar1 = *pbVar10; bVar11 = bVar1 < *pbVar8; if (bVar1 != *pbVar8) { LAB_00a11b38: uVar3 = -(uint)bVar11 | 1; goto LAB_00a11b3d; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar11 = bVar1 < pbVar8[1]; if (bVar1 != pbVar8[1]) goto LAB_00a11b38; pbVar10 = pbVar10 + 2; pbVar8 = pbVar8 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00a11b3d: if (uVar3 == 0) { pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11b61; FUN_00a69950(); *extraout_ECX_03 = KAGE::Graphics::ImagePlatform::vftable; puVar9 = extraout_ECX_03; goto LAB_00a11b63; } } piVar6 = local_20; if (local_20 == (int *)0x0) { LAB_00a11bef: KAGE::SmartPointer::reset(&local_20,(void *)0x0); } else { (**(code **)(*local_20 + 0x3c))(); puVar9 = FileSystem::Open(&PTR_vftable_00c37a10,pbVar4,piVar6 + 0x11); cVar2 = (**(code **)(*piVar6 + 0x38))(puVar9,piVar6[0x11]); if ((cVar2 == '\0') && ((void *)piVar6[0x11] != (void *)0x0)) { local_8._0_1_ = 8; tracked_alloc(1,(void *)piVar6[0x11],0); local_8 = CONCAT31(local_8._1_3_,1); piVar6[0x11] = 0; } if (puVar9 != (undefined4 *)0x0) { (**(code **)*puVar9)(1); } FUN_00a12c00(); if (cVar2 == '\0') goto LAB_00a11bef; (**(code **)(*local_20 + 0x40))(); FUN_00a120f0(&local_20); } if (pbVar4 != (byte *)0x0) { local_8._0_1_ = 9; tracked_alloc(1,pbVar4,0); local_8 = CONCAT31(local_8._1_3_,1); } KAGE::SmartPointer::operator_assign(param_1,&local_20); local_8 = 10; LAB_00a11c31: local_18 = 1; if (((local_1c != (int *)0x0) && (cVar2 = (**(code **)(*local_1c + 0xc))(), cVar2 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_20); } ExceptionList = local_10; return param_1; } //@@ 00a11c70 KAGE_Graphics::create_image /* DB: ? (out, width, height, format, name): "Unknown image format '%d' passed to LoadImage", switch on format allocating the image object, strncpy the name ("Ellipse" from 004248a0); also KAGE::System::UserProfile::load_steam_avatar, 00a617e0, 00a8c430 prototype: db/protos.zhl, confirmed by RET 20 */ void * KAGE_Graphics::create_image(void *outImage,int width,int height,int format,byte *name) { byte bVar1; int *piVar2; char cVar3; uint uVar4; void *pvVar5; undefined4 *extraout_ECX; undefined4 *extraout_ECX_00; undefined4 *extraout_ECX_01; undefined4 *extraout_ECX_02; undefined4 *extraout_ECX_03; undefined4 *extraout_ECX_04; undefined4 *image; byte *pbVar6; char *_Dest; char *_Source; undefined **local_24; int *local_20; int *local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10a5e; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = 0; KAGE::SmartPointer::SmartPointer(&local_20,(void *)0x0); local_8 = 1; switch(format) { case 0: pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) { LAB_00a11d91: image = (undefined4 *)0x0; } else { FUN_00a69950(uVar4); *extraout_ECX = KAGE::Graphics::ImagePng::vftable; image = extraout_ECX; } break; case 1: pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11d91; FUN_00a69950(uVar4); *extraout_ECX_00 = KAGE::Graphics::ImageJpg::vftable; image = extraout_ECX_00; break; case 2: pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11d91; FUN_00a69950(uVar4); *extraout_ECX_01 = KAGE::Graphics::ImageBmp::vftable; image = extraout_ECX_01; break; case 3: pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11d91; FUN_00a69950(uVar4); *extraout_ECX_02 = KAGE::Graphics::ImagePcx::vftable; image = extraout_ECX_02; break; case 4: pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11d91; FUN_00a69950(uVar4); *extraout_ECX_03 = KAGE::Graphics::ImageRGBA::vftable; image = extraout_ECX_03; break; case 5: pvVar5 = operator_new(0x60); if (pvVar5 == (void *)0x0) goto LAB_00a11d91; FUN_00a69950(uVar4); *extraout_ECX_04 = KAGE::Graphics::ImagePlatform::vftable; image = extraout_ECX_04; break; default: KAGE_LogMessage(8,(byte *)"Unknown image format \'%d\' passed to LoadImage\n"); KAGE::SmartPointer::SmartPointer(outImage,(void *)0x0); local_8 = 2; goto LAB_00a11edd; } KAGE::SmartPointer::reset(&local_20,image); piVar2 = local_20; if ((local_20 == (int *)0x0) || ((**(code **)(*local_20 + 0x3c))(), width == 0)) { LAB_00a11e8b: KAGE::SmartPointer::reset(&local_20,(void *)0x0); } else { local_24 = KAGE::Filesys::BufferedStream::vftable; local_8 = CONCAT31(local_8._1_3_,3); cVar3 = (**(code **)(*piVar2 + 0x38))(&local_24,name); if (cVar3 != '\0') { _Source = "unknown"; if (name != (byte *)0x0) { _Source = (char *)name; } if ((byte *)_Source == (byte *)0x0) { _Dest = (char *)0x0; } else { pbVar6 = (byte *)_Source; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); _Dest = operator_new_tracked((uint)(pbVar6 + (1 - (int)(_Source + 1)))); pbVar6 = (byte *)_Source; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); strncpy(_Dest,_Source,(size_t)(pbVar6 + (1 - (int)(_Source + 1)))); } piVar2[0x10] = (int)_Dest; } FUN_00a12c00(); local_8 = CONCAT31(local_8._1_3_,1); FUN_00a58200(); if (cVar3 == '\0') goto LAB_00a11e8b; (**(code **)(*local_20 + 0x40))(); FUN_00a120f0(&local_20); } KAGE::SmartPointer::operator_assign(outImage,&local_20); local_8 = 4; LAB_00a11edd: local_18 = 1; if (((local_1c != (int *)0x0) && (cVar3 = (**(code **)(*local_1c + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_20); } ExceptionList = local_10; return outImage; } //@@ 00a11f30 KAGE_Graphics::create_render_target /* DB: operator_new(0x60) PlatformRenderTarget (FUN_00a90ca0 w,h,fmt,...) wrapped in ReferenceCount smart pointer returned in param_1; callers Game::create_render_surfaces, Minimap::Init, HUD::LoadGraphics, Backdrop ctor prototype: db/protos.zhl, confirmed by RET 20 */ void * KAGE_Graphics::create_render_target (void *outTarget,int width,int height,byte *name,KColor *clearColor) { int iVar1; char cVar2; uint uVar3; int *piVar4; KColor *pKVar5; undefined4 local_24; int local_20; int *local_1c; int *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b10ac4; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; local_14 = 0; piVar4 = operator_new(0x60); local_8 = 1; local_18 = piVar4; if (piVar4 == (int *)0x0) { piVar4 = (int *)0x0; } else { KAGE_Graphics_RenderTargetBase::RenderTargetBase(width,height,name,clearColor); *piVar4 = (int)KAGE::Graphics::PlatformRenderTarget::vftable; } local_8 = local_8 & 0xffffff00; *(undefined4 *)outTarget = 0; *(undefined4 *)((int)outTarget + 4) = 0; pKVar5 = operator_new(0x18); local_8 = 2; clearColor = pKVar5; if (pKVar5 == (KColor *)0x0) { pKVar5 = (KColor *)0x0; } else { ReferenceCountBase::ReferenceCountBase((ReferenceCountBase *)pKVar5); pKVar5->_red = (float)ReferenceCount::vftable; pKVar5[1]._red = (float)piVar4; } local_8 = local_8 & 0xffffff00; if (*(int **)((int)outTarget + 4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)((int)outTarget + 4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(outTarget); } } *(KColor **)((int)outTarget + 4) = pKVar5; *(int **)outTarget = piVar4; local_8 = 0; local_14 = 1; (**(code **)(*piVar4 + 0x40))(); (**(code **)(DAT_00c37990 + 0xc))(0xffffffff); iVar1 = *(int *)outTarget; piVar4 = *(int **)((int)outTarget + 4); local_24 = *(undefined4 *)(iVar1 + 0x48); local_20 = 0; local_1c = (int *)0x0; if (piVar4 != (int *)0x0) { cVar2 = (**(code **)(*piVar4 + 4))(); if (cVar2 != '\0') { if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_20); } } local_20 = iVar1; local_1c = piVar4; } } local_8 = 3; FUN_00a122d0(&clearColor,&local_24); local_8 = 4; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_20); } } local_8 = local_8 & 0xffffff00; (**(code **)(DAT_00c37990 + 0x10))(); ExceptionList = local_10; return outTarget; } //@@ 00a120f0 FUN_00a120f0 void FUN_00a120f0(int *param_1) { char cVar1; undefined4 local_1c; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10afd; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(DAT_00c37990 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_18 + 0x14)); local_1c = *(undefined4 *)(*param_1 + 0x48); KAGE::SmartPointer::operator_assign(local_18,param_1); local_8 = 0; FUN_00a122d0(¶m_1,&local_1c); local_8 = 1; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_18); } } local_8 = 0xffffffff; (**(code **)(DAT_00c37990 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a121b0 FUN_00a121b0 void FUN_00a121b0(int param_1) { int iVar1; int iVar2; int local_8; iVar2 = param_1; if (param_1 != 0) { (**(code **)(DAT_00c37990 + 0xc))(0xffffffff); iVar1 = *(int *)(iVar2 + 0x48); local_8 = iVar1; FUN_00a12280(¶m_1,&local_8); if (param_1 != DAT_00c37988) { do { if (*(int *)(*(int *)(param_1 + 0x14) + 0x48) != iVar1) break; if (*(int *)(param_1 + 0x14) == iVar2) { FUN_00414d60(¶m_1,param_1); break; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } while (param_1 != DAT_00c37988); } (**(code **)(DAT_00c37990 + 0x10))(); } return; } //@@ 00a12240 FUN_00a12240 void FUN_00a12240(undefined4 *param_1) { short sVar1; int iVar2; iVar2 = param_1[1]; if (iVar2 != 0) { (**(code **)(*(int *)(iVar2 + 8) + 0xc))(0xffffffff); sVar1 = *(short *)(iVar2 + 4); (**(code **)(*(int *)(iVar2 + 8) + 0x10))(); if (sVar1 == 1) { FUN_00a121b0(*param_1); } } return; } //@@ 00a12280 FUN_00a12280 void FUN_00a12280(int *param_1,uint *param_2) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *puVar3; int *in_ECX; undefined4 *puVar4; puVar1 = (undefined4 *)*in_ECX; puVar4 = puVar1; if (*(char *)((int)puVar1[1] + 0xd) == '\0') { puVar2 = (undefined4 *)puVar1[1]; do { if ((uint)puVar2[4] < *param_2) { puVar3 = (undefined4 *)puVar2[2]; } else { puVar3 = (undefined4 *)*puVar2; puVar4 = puVar2; } puVar2 = puVar3; } while (*(char *)((int)puVar3 + 0xd) == '\0'); } if ((*(char *)((int)puVar4 + 0xd) == '\0') && ((uint)puVar4[4] <= *param_2)) { *param_1 = (int)puVar4; return; } *param_1 = (int)puVar1; return; } //@@ 00a122d0 FUN_00a122d0 undefined4 * FUN_00a122d0(undefined4 *param_1,int *param_2) { int iVar1; uint uVar2; int *newNode; undefined4 *puVar3; void *pvVar4; int *in_ECX; uint childSide; undefined4 *parent; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b10b6d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar1 = *in_ECX; local_8 = 0; newNode = operator_new(0x1c); local_8 = 1; newNode[4] = *param_2; KAGE::SmartPointer::operator_assign(newNode + 5,param_2 + 1); *newNode = iVar1; newNode[1] = iVar1; newNode[2] = iVar1; *(undefined2 *)(newNode + 3) = 0; local_8 = 2; childSide = 0; parent = *(undefined4 **)(*in_ECX + 4); if (*(char *)((int)parent + 0xd) == '\0') { puVar3 = parent; do { parent = puVar3; if ((uint)newNode[4] < (uint)parent[4]) { puVar3 = (undefined4 *)*parent; } else { puVar3 = (undefined4 *)parent[2]; } childSide = (uint)((uint)newNode[4] < (uint)parent[4]); } while (*(char *)((int)puVar3 + 0xd) == '\0'); } if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } pvVar4 = std::_Tree::_Insert_node(in_ECX,parent,childSide,newNode); *param_1 = pvVar4; ExceptionList = local_10; return param_1; } //@@ 00a123b0 FUN_00a123b0 undefined4 FUN_00a123b0(void) { int in_ECX; if ((*(uint *)(in_ECX + 8) & 1) == 0) { return 0; } return 1; } //@@ 00a123d0 FUN_00a123d0 undefined4 FUN_00a123d0(void) { int in_ECX; if ((*(uint *)(in_ECX + 8) & 2) == 0) { return 0; } return 1; } //@@ 00a123f0 FUN_00a123f0 void FUN_00a123f0(int param_1,int param_2) { int *in_ECX; if ((param_1 != in_ECX[0xe]) || (param_2 != in_ECX[0xf])) { (**(code **)(*in_ECX + 0x48))(param_1,param_2); in_ECX[0xe] = param_1; in_ECX[0xf] = param_2; } return; } //@@ 00a12420 FUN_00a12420 bool FUN_00a12420(void) { int in_ECX; return *(int *)(in_ECX + 0x28) == 0; } //@@ 00a12430 KAGE::Graphics::ImageBase::set_palette /* WARNING: Removing unreachable block (ram,0x00a1260c) */ /* WARNING: Removing unreachable block (ram,0x00a1261b) */ /* WARNING: Removing unreachable block (ram,0x00a1262b) */ /* WARNING: Removing unreachable block (ram,0x00a12631) */ /* DB: vtable slot 3 of KAGE::Graphics::ImageBase and all Image* subclasses; "Attempting to set palette on an image that isn't indexed" (vfunc +8 is_indexed), "Specified palette is larger than 256 texels in size", names the palette image "%s - Palette" from this+0x44/+0x40 or "unknown", creates/updates the palette texture (this+0x2c) */ void KAGE::Graphics::ImageBase::set_palette(undefined4 param_1,uint param_2) { char cVar1; void *pvVar2; int *in_ECX; int *extraout_ECX; int *piVar3; undefined **local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10b9d; local_10 = ExceptionList; ExceptionList = &local_10; cVar1 = (**(code **)(*in_ECX + 8))(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar1 == '\0') { KAGE_LogMessage(0x10,(byte *)"Attempting to set palette on an image that isn\'t indexed\n"); } if (0x100 < param_2) { KAGE_LogMessage(0x10,(byte *)"Specified palette is larger than 256 texels in size\n"); } sprintf(&DAT_00c943d8,(byte *)"%s - Palette"); if ((int *)in_ECX[0xb] != (int *)0x0) { (**(code **)(*(int *)in_ECX[0xb] + 0x34))(1); in_ECX[0xb] = 0; } pvVar2 = operator_new(0x60); if (pvVar2 == (void *)0x0) { piVar3 = (int *)0x0; } else { FUN_00a69950(); *extraout_ECX = (int)ImagePalette::vftable; extraout_ECX[2] = extraout_ECX[2] | 4; extraout_ECX[3] = extraout_ECX[3]; piVar3 = extraout_ECX; } in_ECX[0xb] = (int)piVar3; local_14 = Filesys::BufferedStream::vftable; local_8 = 0; cVar1 = (**(code **)(*piVar3 + 0x38))(&local_14,&DAT_00c943d8); if ((cVar1 == '\0') && ((int *)in_ECX[0xb] != (int *)0x0)) { (**(code **)(*(int *)in_ECX[0xb] + 0x34))(1); in_ECX[0xb] = 0; } piVar3 = (int *)in_ECX[0xb]; if ((piVar3[0xc] != 0) || (piVar3[0xd] != 0)) { (**(code **)(*piVar3 + 0x44))(0,0); piVar3[0xc] = 0; piVar3[0xd] = 0; piVar3 = (int *)in_ECX[0xb]; } if ((piVar3[0xe] != 1) || (piVar3[0xf] != 1)) { (**(code **)(*piVar3 + 0x48))(1,1); piVar3[0xe] = 1; piVar3[0xf] = 1; } ExceptionList = local_10; return; } //@@ 00a12650 FUN_00a12650 void FUN_00a12650(float *param_1,KColor *param_2) { int *in_ECX; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined1 local_7c; undefined1 local_78 [116]; local_8c = 0; local_9c = 0; local_90 = 0; local_98 = 0; local_84 = 0x3f800000; local_94 = 0x3f800000; local_80 = 0x3f800000; local_88 = 0x3f800000; local_7c = 0; render_quad_set_uniform_color (local_78,*param_1,param_1[1], (float)((double)in_ECX[4] + __uint_to_double_fixup[-(in_ECX[4] >> 0x1f)]) + *param_1, (float)((double)in_ECX[5] + __uint_to_double_fixup[-(in_ECX[5] >> 0x1f)]) + param_1[1], param_2); (**(code **)(*in_ECX + 0x10))(&local_9c,local_78,1); return; } //@@ 00a12720 FUN_00a12720 void FUN_00a12720(void *param_1,float *param_2) { int *in_ECX; float *pfVar1; float *pfVar2; uint uVar3; bool bVar4; undefined4 local_9c; undefined4 local_98; undefined4 local_94; undefined4 local_90; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined1 local_7c; undefined1 local_78 [32]; float local_58; float fStack_54; float fStack_50; float fStack_4c; float local_48; float local_44; float fStack_40; float fStack_3c; float fStack_38; float local_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float local_1c; float fStack_18; float fStack_14; float fStack_10; float local_c; local_8c = 0; local_9c = 0; pfVar2 = g_drawRectUnset; local_90 = 0; uVar3 = 0xc; local_98 = 0; local_84 = 0x3f800000; local_94 = 0x3f800000; local_80 = 0x3f800000; local_88 = 0x3f800000; local_7c = 0; pfVar1 = param_2; do { if (*pfVar1 != *pfVar2) { render_quad_copy(local_78,param_1); local_1c = *param_2; fStack_18 = param_2[1]; fStack_14 = param_2[2]; fStack_10 = param_2[3]; local_48 = param_2[4]; local_30 = *param_2; fStack_2c = param_2[1]; fStack_28 = param_2[2]; fStack_24 = param_2[3]; local_44 = *param_2; fStack_40 = param_2[1]; fStack_3c = param_2[2]; fStack_38 = param_2[3]; local_58 = *param_2; fStack_54 = param_2[1]; fStack_50 = param_2[2]; fStack_4c = param_2[3]; local_34 = local_48; local_20 = local_48; local_c = local_48; (**(code **)(*in_ECX + 0x10))(&local_9c,local_78,1); return; } pfVar1 = pfVar1 + 1; pfVar2 = pfVar2 + 1; bVar4 = 3 < uVar3; uVar3 = uVar3 - 4; } while (bVar4); (**(code **)(*in_ECX + 0x10))(&local_9c,param_1,1); return; } //@@ 00a12820 FUN_00a12820 void FUN_00a12820(float *param_1,float *param_2,KColor *param_3) { int *in_ECX; float fVar1; float fVar2; undefined1 local_78 [116]; fVar2 = param_1[2] - *param_1; if (fVar2 < 0.0) { fVar2 = -fVar2; } fVar1 = param_1[5] - param_1[1]; if (fVar1 < 0.0) { fVar1 = -fVar1; } if (*(char *)(param_1 + 8) == '\0') { fVar2 = fVar2 * (float)((double)in_ECX[4] + __uint_to_double_fixup[-(in_ECX[4] >> 0x1f)]); fVar1 = fVar1 * (float)((double)in_ECX[5] + __uint_to_double_fixup[-(in_ECX[5] >> 0x1f)]); } render_quad_set_uniform_color (local_78,*param_2,param_2[1],*param_2 + fVar2,param_2[1] + fVar1,param_3); (**(code **)(*in_ECX + 0x10))(param_1,local_78,1); return; } //@@ 00a128f0 FUN_00a128f0 void FUN_00a128f0(undefined4 param_1,void *param_2,float *param_3) { float *pfVar1; int *in_ECX; float *pfVar2; uint uVar3; bool bVar4; undefined1 local_78 [32]; float local_58; float fStack_54; float fStack_50; float fStack_4c; float local_48; float local_44; float fStack_40; float fStack_3c; float fStack_38; float local_34; float local_30; float fStack_2c; float fStack_28; float fStack_24; float local_20; float local_1c; float fStack_18; float fStack_14; float fStack_10; float local_c; pfVar1 = g_drawRectUnset; uVar3 = 0xc; pfVar2 = param_3; do { if (*pfVar2 != *pfVar1) { render_quad_copy(local_78,param_2); local_1c = *param_3; fStack_18 = param_3[1]; fStack_14 = param_3[2]; fStack_10 = param_3[3]; local_48 = param_3[4]; local_30 = *param_3; fStack_2c = param_3[1]; fStack_28 = param_3[2]; fStack_24 = param_3[3]; local_44 = *param_3; fStack_40 = param_3[1]; fStack_3c = param_3[2]; fStack_38 = param_3[3]; local_58 = *param_3; fStack_54 = param_3[1]; fStack_50 = param_3[2]; fStack_4c = param_3[3]; local_34 = local_48; local_20 = local_48; local_c = local_48; (**(code **)(*in_ECX + 0x10))(param_1,local_78,1); return; } pfVar2 = pfVar2 + 1; pfVar1 = pfVar1 + 1; bVar4 = 3 < uVar3; uVar3 = uVar3 - 4; } while (bVar4); (**(code **)(*in_ECX + 0x10))(param_1,param_2,1); return; } //@@ 00a129a0 FUN_00a129a0 void * FUN_00a129a0(void *param_1,void *param_2,uint param_3) { byte bVar1; undefined4 *puVar2; char cVar3; void *this; void *pvVar4; int *in_ECX; int unused; int unused_00; void *apvStack_c [2]; cVar3 = (**(code **)(*in_ECX + 8))(); if (cVar3 == '\0') { this = kage_graphics_flush(in_ECX); apvStack_c[0] = this; pvVar4 = render_quad_draw(this,param_1,param_2,param_3,unused_00); } else { shader_push((byte *)"KAGE_IndexedTextureShader"); this = kage_graphics_flush(in_ECX); apvStack_c[0] = this; pvVar4 = render_quad_draw(this,param_1,param_2,param_3,unused); FUN_00a14200(); } if (((pvVar4 != (void *)0x0) && (bVar1 = *(byte *)((int)this + 4), (bVar1 & 1) != 0)) && ((bVar1 & 2) == 0)) { *(byte *)((int)this + 4) = bVar1 | 2; puVar2 = (undefined4 *)in_ECX[0x14]; if (puVar2 != (undefined4 *)in_ECX[0x15]) { *puVar2 = this; in_ECX[0x14] = in_ECX[0x14] + 4; return pvVar4; } std::vector::_Emplace_reallocate(puVar2,apvStack_c); } return pvVar4; } //@@ 00a12a60 FUN_00a12a60 void FUN_00a12a60(void) { int *in_ECX; (**(code **)(*in_ECX + 0x54))(0); FUN_00a189a0(); return; } //@@ 00a12a80 FUN_00a12a80 void FUN_00a12a80(void) { KAGE_LogMessage(0x10,(byte *)"GetTexelRegion not implemented."); return; } //@@ 00a12aa0 FUN_00a12aa0 void FUN_00a12aa0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } return; } //@@ 00a12ad0 FUN_00a12ad0 void FUN_00a12ad0(void) { uint uVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af81c0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(void **)(in_ECX + 0x40) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x40),0); *(undefined4 *)(in_ECX + 0x40) = 0; } local_8 = 0xffffffff; if (*(void **)(in_ECX + 0x44) != (void *)0x0) { local_8 = 1; tracked_alloc(1,*(void **)(in_ECX + 0x44),0); *(undefined4 *)(in_ECX + 0x44) = 0; } if (*(int **)(in_ECX + 0x2c) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + 0x2c) + 0x34))(1,uVar1); *(undefined4 *)(in_ECX + 0x2c) = 0; } *(uint *)(in_ECX + 8) = *(uint *)(in_ECX + 8) & 0xfffffffe; *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(in_ECX + 0xc); ExceptionList = local_10; return; } //@@ 00a12b80 FUN_00a12b80 void FUN_00a12b80(void) { int iVar1; int iVar2; int *in_ECX; char *pcVar3; in_ECX[2] = in_ECX[2] | 1; in_ECX[3] = in_ECX[3]; iVar2 = DAT_00c379a0; iVar1 = DAT_00c3799c; if ((DAT_00c3799c != in_ECX[0xc]) || (DAT_00c379a0 != in_ECX[0xd])) { (**(code **)(*in_ECX + 0x44))(DAT_00c3799c,DAT_00c379a0); in_ECX[0xc] = iVar1; in_ECX[0xd] = iVar2; } iVar2 = DAT_00c379a8; iVar1 = DAT_00c379a4; if ((DAT_00c379a4 != in_ECX[0xe]) || (DAT_00c379a8 != in_ECX[0xf])) { (**(code **)(*in_ECX + 0x48))(DAT_00c379a4,DAT_00c379a8); in_ECX[0xe] = iVar1; in_ECX[0xf] = iVar2; } pcVar3 = (char *)in_ECX[0x11]; if ((char *)in_ECX[0x11] == (char *)0x0) { pcVar3 = "unknown"; if ((char *)in_ECX[0x10] != (char *)0x0) { pcVar3 = (char *)in_ECX[0x10]; } } (**(code **)(*in_ECX + 0x5c))(pcVar3); return; } //@@ 00a12c00 FUN_00a12c00 void FUN_00a12c00(void) { uint uVar1; int iVar2; uint uVar3; uint uVar4; int in_ECX; byte *filePath; undefined4 local_3c; undefined1 local_38 [8]; uint local_30; uint local_2c; int local_28; int local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_38 + 0x34; local_14 = 0xffffffff; puStack_18 = &LAB_00b10bd5; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_38 + 0x28); ExceptionList = &local_1c; uVar1 = *(uint *)(in_ECX + 0x48); filePath = *(byte **)(in_ECX + 0x44); if (*(byte **)(in_ECX + 0x44) == (byte *)0x0) { filePath = (byte *)"unknown"; if (*(byte **)(in_ECX + 0x40) != (byte *)0x0) { filePath = *(byte **)(in_ECX + 0x40); } } local_30 = uVar1; uVar4 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(filePath); *(uint *)(in_ECX + 0x48) = uVar4; if (uVar4 != uVar1) { local_2c = uVar1; (**(code **)(DAT_00c37990 + 0xc))(0xffffffff,uVar3); FUN_00a12280(&local_24,&local_2c); if (local_24 != DAT_00c37988) { do { iVar2 = *(int *)(local_24 + 0x14); if ((*(uint *)(iVar2 + 0x48) != local_30) && (iVar2 != in_ECX)) break; if (iVar2 == in_ECX) { KAGE::SmartPointer::operator_assign(&local_28,(void *)(local_24 + 0x14)); local_14 = 0; FUN_00414d60(&local_30,local_24); local_3c = *(undefined4 *)(local_28 + 0x48); KAGE::SmartPointer::operator_assign(local_38,&local_28); local_14 = CONCAT31(local_14._1_3_,1); FUN_00a122d0(&local_30,&local_3c); FUN_007098c0(); local_14 = 0xffffffff; FUN_0040c440(); break; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); } while (local_24 != DAT_00c37988); } (**(code **)(DAT_00c37990 + 0x10))(); } ExceptionList = local_1c; return; } //@@ 00a12d50 ImageBase::set_size /* DB: thiscall image (w,h): vfunc +0x4c/+0x50 min/max texture size, "Attempted to create image larger than max supported size", stores clamped w/h (+0x10/+0x14), pow2 texture w/h (+0x18/+0x1c, FUN_00a15590) and u/v scale (+0x20/+0x24); image loaders log "...because set_size failed" when it returns 0 prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall ImageBase::set_size(void *this,uint width,uint height,int unused) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; uVar1 = (**(code **)(*(int *)this + 0x4c))(); uVar2 = (**(code **)(*(int *)this + 0x50))(); if ((uVar2 < width) || (uVar2 < height)) { KAGE_LogMessage(8,(byte *)"Attempted to create image larger than max supported size"); return 0; } uVar3 = FUN_00a15590(); uVar4 = FUN_00a15590(); uVar5 = uVar1; if (uVar1 < width) { uVar5 = width; } uVar7 = uVar2; if (uVar5 < uVar2) { uVar7 = uVar5; } *(uint *)((int)this + 0x10) = uVar7; uVar5 = uVar1; if (uVar1 < height) { uVar5 = height; } uVar6 = uVar2; if (uVar5 < uVar2) { uVar6 = uVar5; } *(uint *)((int)this + 0x14) = uVar6; uVar5 = uVar1; if (uVar1 < uVar3) { uVar5 = uVar3; } uVar3 = uVar2; if (uVar5 < uVar2) { uVar3 = uVar5; } if (uVar1 < uVar4) { uVar1 = uVar4; } *(uint *)((int)this + 0x18) = uVar3; if (uVar1 < uVar2) { uVar2 = uVar1; } *(uint *)((int)this + 0x1c) = uVar2; *(float *)((int)this + 0x20) = (float)((double)(int)uVar7 + __uint_to_double_fixup[-((int)uVar7 >> 0x1f)]) / (float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]); *(float *)((int)this + 0x24) = (float)((double)(int)uVar6 + __uint_to_double_fixup[-((int)uVar6 >> 0x1f)]) / (float)((double)(int)uVar2 + __uint_to_double_fixup[-((int)uVar2 >> 0x1f)]); return 1; } //@@ 00a12ea0 FUN_00a12ea0 void FUN_00a12ea0(int param_1) { char cVar1; int *in_ECX; (&DAT_00c79928)[param_1] = in_ECX; cVar1 = (**(code **)(*in_ECX + 8))(); if ((cVar1 == '\0') || ((int *)in_ECX[0xb] == (int *)0x0)) { return; } /* WARNING: Could not recover jumptable at 0x00a12ece. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*(int *)in_ECX[0xb] + 0x54))(); return; } //@@ 00a12ee0 FUN_00a12ee0 void FUN_00a12ee0(byte param_1) { void *in_ECX; FUN_00a12f20(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xac); } return; } //@@ 00a12f20 FUN_00a12f20 void FUN_00a12f20(void) { int *this; undefined4 *in_ECX; this = in_ECX + 0x23; *in_ECX = KAGE::Graphics::ManagerBase::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); FID_conflict__Tidy(in_ECX + 0x20); std::deque<4byte>::~deque(); FUN_00a13c00(); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a12f80 FUN_00a12f80 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00a12f80(void) { uint uVar1; int *in_ECX; KColor local_28; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10c14; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = operator_new(0x10); local_8 = 0; if (local_14 == (void *)0x0) { DAT_00c7367c = (void *)0x0; } else { DAT_00c7367c = KAGE::Graphics::GraphicsBufferObject::GraphicsBufferObject(local_14); } local_8 = 0xffffffff; *(undefined4 *)((int)DAT_00c7367c + 0xc) = 1; KColor::SetFromARGB(&local_28,0xff000000); (**(code **)(*in_ECX + 0x58))(local_28._red,local_28._green,local_28._blue,uVar1); _DAT_00c379b4 = _DAT_00c379b4 | 1; (**(code **)(DAT_00c37990 + 4))(); _DAT_00c37984 = _DAT_00c37984 | 1; in_ECX[1] = in_ECX[1] | 1; g_imageReleaseFn = FUN_00a12240; g_renderTargetReleaseFn = FUN_00a12240; ExceptionList = local_10; return 1; } //@@ 00a13060 FUN_00a13060 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a13060(void) { int iVar1; undefined4 *puVar2; int *piVar3; int in_ECX; int *piVar4; int *local_8; piVar4 = *(int **)(in_ECX + 0x80); if (piVar4 != *(int **)(in_ECX + 0x84)) { do { if ((undefined4 *)*piVar4 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar4)(1); *piVar4 = 0; } piVar4 = piVar4 + 1; } while (piVar4 != *(int **)(in_ECX + 0x84)); } piVar4 = (int *)(in_ECX + 0x8c); local_8 = (int *)**(int **)(in_ECX + 0x8c); if (local_8 != *(int **)(in_ECX + 0x8c)) { do { piVar3 = local_8; if (*(undefined4 **)((int)local_8 + 0x14) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)((int)local_8 + 0x14))(1); *(undefined4 *)((int)piVar3 + 0x14) = 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); } while (local_8 != (int *)*piVar4); } iVar1 = *piVar4; *(undefined4 *)(in_ECX + 0x84) = *(undefined4 *)(in_ECX + 0x80); FID_conflict__Erase_tree_>_> (piVar4,(fuzzer_allocator_> *)piVar4, *(_Tree_node **)(iVar1 + 4)); puVar2 = DAT_00c7367c; *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0x90) = 0; *(undefined4 *)(in_ECX + 0x94) = 0; if (puVar2 != (undefined4 *)0x0) { (**(code **)*puVar2)(1); DAT_00c7367c = (undefined4 *)0x0; } local_8 = (int *)*DAT_00c379bc; if (local_8 != DAT_00c379bc) { do { piVar4 = local_8; (**(code **)(*(int *)local_8[5] + 4))(); puVar2 = (undefined4 *)piVar4[5]; if (puVar2 != (undefined4 *)0x0) { (**(code **)*puVar2)(1); piVar4[5] = 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); } while (local_8 != DAT_00c379bc); } piVar4 = DAT_00c379bc; FID_conflict__Erase_tree_>_> (&DAT_00c379bc,(fuzzer_allocator_> *)&DAT_00c379bc, (_Tree_node *)DAT_00c379bc[1]); piVar4[1] = (int)piVar4; *piVar4 = (int)piVar4; piVar4[2] = (int)piVar4; iVar1 = DAT_00c37988; _DAT_00c379b4 = _DAT_00c379b4 & 0xfffffffe; _DAT_00c379c0 = 0; if ((_DAT_00c37984 & 1) != 0) { g_imageReleaseFn = (void *)0x0; std::map::_Erase_tree(&DAT_00c37988,*(undefined4 *)(DAT_00c37988 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; _DAT_00c3798c = 0; (**(code **)(DAT_00c37990 + 8))(); _DAT_00c37984 = _DAT_00c37984 & 0xfffffffe; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a131f0 FUN_00a131f0 void FUN_00a131f0(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x24) = 1; *(undefined4 *)(in_ECX + 0x28) = 0; *(undefined4 *)(in_ECX + 0x2c) = 1; *(undefined4 *)(in_ECX + 0x30) = 0; shader_cache_find(in_ECX); return; } //@@ 00a13220 FUN_00a13220 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a13220(int param_1) { char cVar1; int *piVar2; void *pvVar3; int *piVar4; int in_ECX; int *piVar5; KAGE_Graphics::flush_batches(); *(undefined1 **)(in_ECX + 0x1c) = &DAT_bf800000; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x24) = 1; *(undefined4 *)(in_ECX + 0x28) = 0; *(undefined4 *)(in_ECX + 0x2c) = 1; *(undefined4 *)(in_ECX + 0x30) = 0; piVar5 = *(int **)g_glContextObjects; if (piVar5 != g_glContextObjects) { do { (**(code **)(*(int *)piVar5[4] + 0x14))(); piVar2 = (int *)piVar5[2]; if (*(char *)((int)piVar2 + 0xd) == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar5 = piVar2; piVar2 = (int *)*piVar2; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar5 = piVar2; piVar2 = (int *)*piVar2; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar4 = (int *)piVar5[1]; piVar2 = piVar5; while ((piVar5 = piVar4, cVar1 == '\0' && (piVar2 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar4 = (int *)piVar5[1]; piVar2 = piVar5; } } } while (piVar5 != g_glContextObjects); } pvVar3 = g_glContextObjects; FID_conflict__Erase_tree_>_> (&g_glContextObjects, (fuzzer_allocator_> *)&g_glContextObjects, *(_Tree_node **)((int)g_glContextObjects + 4)); *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; _DAT_00c379c8 = 0; if (g_shaderStackSize != 0) { do { g_shaderStackSize = g_shaderStackSize - 1; } while (g_shaderStackSize != 0); DAT_00c379d8 = 0; g_shaderStackSize = 0; } shader_cache_find(param_1); return; } //@@ 00a13320 FUN_00a13320 void FUN_00a13320(undefined4 *param_1,undefined4 param_2) { int *in_ECX; (**(code **)(*in_ECX + 0x18))(*param_1,param_2); return; } //@@ 00a13340 FUN_00a13340 void FUN_00a13340(int param_1,char param_2) { int in_ECX; *(int *)(in_ECX + 0x68) = param_1; if ((param_1 == 0) || (param_2 != '\0')) { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 0x20; return; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xffffffdf; return; } //@@ 00a13370 FUN_00a13370 void FUN_00a13370(undefined4 *param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x20))(*param_1,param_2,param_3); return; } //@@ 00a13390 FUN_00a13390 void FUN_00a13390(undefined4 param_1,undefined4 param_2,char param_3) { uint uVar1; void *pvVar2; int iVar3; undefined4 *puVar4; undefined4 uVar5; int *in_ECX; uint uVar6; int iVar7; if ((in_ECX[0x1a] != 0) && (param_3 != '\0')) { (**(code **)(*in_ECX + 0x14))(1); } iVar7 = in_ECX[0x1f]; uVar1 = in_ECX[0x1e]; if (((uVar1 + iVar7 & 1) == 0) && ((uint)in_ECX[0x1d] <= iVar7 + 2U >> 1)) { std::deque::_Growmap(iVar7); uVar1 = in_ECX[0x1e]; iVar7 = in_ECX[0x1f]; } uVar1 = in_ECX[0x1d] * 2 - 1U & uVar1; in_ECX[0x1e] = uVar1; uVar1 = uVar1 + iVar7; uVar6 = in_ECX[0x1d] - 1U & uVar1 >> 1; iVar3 = in_ECX[0x1c]; iVar7 = uVar6 * 4; if (*(int *)(iVar3 + uVar6 * 4) == 0) { pvVar2 = operator_new(0x10); *(void **)(iVar7 + in_ECX[0x1c]) = pvVar2; iVar3 = in_ECX[0x1c]; } iVar7 = *(int *)(iVar7 + iVar3); uVar1 = uVar1 & 1; *(undefined4 *)(iVar7 + uVar1 * 8) = 0; *(undefined4 *)(iVar7 + 4 + uVar1 * 8) = 0; in_ECX[0x1f] = in_ECX[0x1f] + 1; puVar4 = (undefined4 *)FUN_009e3d30(); uVar5 = (**(code **)(*in_ECX + 0x28))(puVar4 + 1); *puVar4 = uVar5; (**(code **)(*in_ECX + 0x18))(param_1,param_2); return; } //@@ 00a13460 FUN_00a13460 void FUN_00a13460(char param_1) { undefined1 uVar1; int iVar2; undefined4 *puVar3; if (DAT_00c7995c == 0) { KAGE_LogMessage(0x10,(byte *)"Render target stack empty\n"); } if (param_1 != '\0') { (**(code **)(DAT_00c798e0 + 0x14))(1); } iVar2 = FUN_009e3d30(); uVar1 = *(undefined1 *)(iVar2 + 4); puVar3 = (undefined4 *)FUN_009e3d30(); (**(code **)(DAT_00c798e0 + 0x18))(*puVar3,uVar1); DAT_00c7995c = DAT_00c7995c + -1; if (DAT_00c7995c == 0) { DAT_00c79958 = 0; } return; } //@@ 00a134e0 FUN_00a134e0 undefined4 FUN_00a134e0(byte *param_1) { int in_ECX; if (param_1 != (byte *)0x0) { *param_1 = (byte)(*(uint *)(in_ECX + 4) >> 5) & 1; } return *(undefined4 *)(in_ECX + 0x68); } //@@ 00a13500 FUN_00a13500 void FUN_00a13500(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x98) = param_1; return; } //@@ 00a13510 set_blend_mode /* DB: BlendMode::SetMode result copied to +0x20..0x30 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall set_blend_mode(void *this,int mode) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *extraout_EAX; undefined1 local_18 [20]; BlendMode::SetMode(local_18,mode,(int)this); uVar1 = *extraout_EAX; uVar2 = extraout_EAX[1]; uVar3 = extraout_EAX[2]; uVar4 = extraout_EAX[3]; *(undefined4 *)((int)this + 0x30) = extraout_EAX[4]; *(undefined4 *)((int)this + 0x20) = uVar1; *(undefined4 *)((int)this + 0x24) = uVar2; *(undefined4 *)((int)this + 0x28) = uVar3; *(undefined4 *)((int)this + 0x2c) = uVar4; return; } //@@ 00a13560 FUN_00a13560 void FUN_00a13560(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { int in_ECX; *(undefined4 *)(in_ECX + 0x20) = param_1; *(undefined4 *)(in_ECX + 0x24) = param_2; *(undefined4 *)(in_ECX + 0x28) = param_3; *(undefined4 *)(in_ECX + 0x2c) = param_4; *(undefined4 *)(in_ECX + 0x30) = param_5; return; } //@@ 00a13590 FUN_00a13590 void FUN_00a13590(char param_1) { int in_ECX; if (param_1 == '\0') { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffd; return; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 2; return; } //@@ 00a135c0 FUN_00a135c0 uint FUN_00a135c0(void) { int in_ECX; return CONCAT31((uint3)(*(uint *)(in_ECX + 4) >> 9),(char)(*(uint *)(in_ECX + 4) >> 1)) & 0xffffff01; } //@@ 00a135d0 FUN_00a135d0 void FUN_00a135d0(char param_1) { int in_ECX; if (param_1 == '\0') { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffb; return; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 4; return; } //@@ 00a13600 FUN_00a13600 uint FUN_00a13600(void) { int in_ECX; return CONCAT31((uint3)(*(uint *)(in_ECX + 4) >> 10),(char)(*(uint *)(in_ECX + 4) >> 2)) & 0xffffff01; } //@@ 00a13610 FUN_00a13610 void FUN_00a13610(char param_1) { int in_ECX; if (param_1 == '\0') { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffff7; return; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 8; return; } //@@ 00a13640 FUN_00a13640 uint FUN_00a13640(void) { int in_ECX; return CONCAT31((uint3)(*(uint *)(in_ECX + 4) >> 0xb),(char)(*(uint *)(in_ECX + 4) >> 3)) & 0xffffff01; } //@@ 00a13650 FUN_00a13650 void FUN_00a13650(char param_1) { int in_ECX; if (param_1 == '\0') { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xffffffef; return; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 0x10; return; } //@@ 00a13680 FUN_00a13680 uint FUN_00a13680(void) { int in_ECX; return CONCAT31((uint3)(*(uint *)(in_ECX + 4) >> 0xc),(char)(*(uint *)(in_ECX + 4) >> 4)) & 0xffffff01; } //@@ 00a13690 FUN_00a13690 void FUN_00a13690(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int in_ECX; *(undefined4 *)(in_ECX + 8) = param_1; *(undefined4 *)(in_ECX + 0xc) = param_2; *(undefined4 *)(in_ECX + 0x10) = param_3; *(undefined4 *)(in_ECX + 0x14) = 0x3f800000; *(undefined4 *)(in_ECX + 0x18) = 0; return; } //@@ 00a136d0 FUN_00a136d0 undefined4 FUN_00a136d0(void) { undefined4 uVar1; int *in_ECX; if (in_ECX[0x1a] == 0) { /* WARNING: Could not recover jumptable at 0x00a136dd. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*in_ECX + 0x30))(); return uVar1; } return *(undefined4 *)(in_ECX[0x1a] + 0x10); } //@@ 00a136e0 FUN_00a136e0 undefined4 FUN_00a136e0(void) { undefined4 uVar1; int *in_ECX; if (in_ECX[0x1a] == 0) { /* WARNING: Could not recover jumptable at 0x00a136ed. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*in_ECX + 0x34))(); return uVar1; } return *(undefined4 *)(in_ECX[0x1a] + 0x14); } //@@ 00a136f0 FUN_00a136f0 void FUN_00a136f0(undefined4 param_1,int param_2) { int in_ECX; *(undefined4 *)(in_ECX + 0x48 + param_2 * 4) = param_1; return; } //@@ 00a13710 FUN_00a13710 void FUN_00a13710(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x48) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x50) = 0; *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x58) = 0; *(undefined4 *)(in_ECX + 0x5c) = 0; *(undefined4 *)(in_ECX + 0x60) = 0; *(undefined4 *)(in_ECX + 100) = 0; return; } //@@ 00a13720 FUN_00a13720 void FUN_00a13720(int *param_1,undefined4 param_2) { undefined1 *puVar1; g_currentShader = param_1; (**(code **)(*param_1 + 0xc))(param_2); puVar1 = (undefined1 *)FUN_00a14250(¶m_1); *puVar1 = 1; return; } //@@ 00a13750 kage_graphics_flush /* DB: ? compares global render state g_graphicsManager_blendMode.., 00a670c0/00a66e30 RenderBatch::set_state called from Entity::PostRender after shader set and 00a11080 prototype: db/protos.zhl, confirmed by RET 4 */ void * kage_graphics_flush(void *renderState) { int iVar1; int iVar2; bool bVar3; int *piVar4; char cVar5; int *piVar6; void *pvVar7; undefined4 *puVar8; undefined4 uVar9; byte bVar10; int *piVar11; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pvVar7 = DAT_00c79974; local_14 = 0xffffffff; puStack_18 = &LAB_00b10c6a; local_1c = ExceptionList; ExceptionList = &local_1c; if ((((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)))) { bVar10 = 0; } else { bVar10 = 1; } if (DAT_00c79974 == (void *)0x0) goto LAB_00a1380d; if ((~*(byte *)((int)DAT_00c79974 + 4) & 1) == bVar10) { cVar5 = RenderBatch::is_state_equal(renderState); bVar3 = true; if (cVar5 == '\0') goto LAB_00a137e9; } else { LAB_00a137e9: bVar3 = false; } iVar1 = *(int *)((int)pvVar7 + 0x3c); iVar2 = *(int *)((int)pvVar7 + 0x38); if (*(int *)(iVar2 + 0xc + iVar1 * 0x14) == *(int *)(iVar2 + 0x10 + iVar1 * 0x14)) { if (!bVar3) { RenderBatch::set_state(renderState); ExceptionList = local_1c; return DAT_00c79974; } ExceptionList = local_1c; return DAT_00c79974; } if (bVar3) { ExceptionList = local_1c; return DAT_00c79974; } LAB_00a1380d: DAT_00c79974 = (undefined4 *)0x0; if ((bVar10 == 0) && (renderState != (void *)0x0)) { piVar6 = *(int **)((int)renderState + 0x50); for (piVar11 = *(int **)((int)renderState + 0x4c); piVar11 != piVar6; piVar11 = piVar11 + 1) { pvVar7 = (void *)*piVar11; if (((*(byte *)((int)pvVar7 + 4) & 1) != 0) && (cVar5 = RenderBatch::is_state_equal(renderState), cVar5 != '\0')) { ExceptionList = local_1c; return pvVar7; } } } if (DAT_00c79970 == 0) { puVar8 = operator_new(0x44); if (puVar8 == (undefined4 *)0x0) { puVar8 = (undefined4 *)0x0; } else { *puVar8 = KAGE::Graphics::RenderBatch::vftable; *(undefined1 *)(puVar8 + 1) = 0; puVar8[2] = 0; puVar8[3] = 0; bVar10 = (byte)g_graphicsManager_flags & 4; uVar9 = 1; puVar8[4] = 0; if (bVar10 == 0) { uVar9 = 6; } puVar8[5] = uVar9; puVar8[6] = 7; puVar8[7] = 1; puVar8[8] = 7; puVar8[9] = 0; puVar8[10] = 0; puVar8[0xb] = 0; puVar8[0xc] = 0; local_14 = 2; KAGE::Graphics::GraphicsBufferObject::GraphicsBufferObject(puVar8 + 0xd); } local_14 = 0xffffffff; DAT_00c79974 = puVar8; } else { if (*(char *)((int)DAT_00c7996c + 0xd) == '\0') { piVar6 = (int *)*DAT_00c7996c; if (*(char *)((int)piVar6 + 0xd) == '\0') { cVar5 = *(char *)(piVar6[2] + 0xd); piVar11 = (int *)piVar6[2]; while (cVar5 == '\0') { cVar5 = *(char *)(piVar11[2] + 0xd); piVar6 = piVar11; piVar11 = (int *)piVar11[2]; } } else { cVar5 = *(char *)(DAT_00c7996c[1] + 0xd); piVar4 = (int *)DAT_00c7996c[1]; piVar11 = DAT_00c7996c; while ((piVar6 = piVar4, cVar5 == '\0' && (piVar11 == (int *)*piVar6))) { cVar5 = *(char *)(piVar6[1] + 0xd); piVar4 = (int *)piVar6[1]; piVar11 = piVar6; } if (*(char *)((int)piVar11 + 0xd) != '\0') { piVar6 = piVar11; } } } else { piVar6 = (int *)DAT_00c7996c[2]; } DAT_00c79974 = (undefined4 *)piVar6[5]; pvVar7 = std::_Tree::_Extract(&DAT_00c7996c,piVar6); operator_delete(pvVar7,0x18); } RenderBatch::set_state(renderState); if (DAT_00c79964 == DAT_00c79968) { std::vector::_Emplace_reallocate(DAT_00c79964,&DAT_00c79974); } else { *DAT_00c79964 = (int)DAT_00c79974; DAT_00c79964 = DAT_00c79964 + 1; } ExceptionList = local_1c; return DAT_00c79974; } //@@ 00a139f0 KAGE_Graphics::flush_batches /* DB: ? thiscall graphics: for each pending batch in the vector this+0x80..+0x84 submits it (FUN_00a67bd0) and records its vertex range (FUN_00a13ca0), clears the vector, then rebuilds/clears the std::set at this+0x8c; first call of the frame-flush 00a19180 _glfw_context_reset of FUN_00a13220 */ void KAGE_Graphics::flush_batches(void) { int iVar1; int iVar2; uint uVar3; int *in_ECX; int *piVar4; int *piVar5; int *piVar6; int *local_34; int local_2c; int local_28; int *local_24; int local_20; int local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10c9d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar5 = (int *)in_ECX[0x20]; local_24 = in_ECX; if (piVar5 != (int *)in_ECX[0x21]) { do { submit_batch(uVar3); local_18 = (int *)*piVar5; iVar1 = *(int *)((int)local_18 + 8); if (iVar1 != 0) { *(undefined4 *)(iVar1 + 0x50) = *(undefined4 *)(iVar1 + 0x4c); local_18 = (int *)*piVar5; } iVar1 = *(int *)((int)local_18 + 0x3c); iVar2 = *(int *)((int)local_18 + 0x38); local_1c = (*(int *)(iVar2 + 8 + iVar1 * 0x14) - *(int *)(iVar2 + 0xc + iVar1 * 0x14)) + *(int *)(iVar2 + 4 + iVar1 * 0x14); FUN_00a13ca0(&local_20,&local_1c); piVar5 = piVar5 + 1; } while (piVar5 != (int *)in_ECX[0x21]); piVar5 = (int *)in_ECX[0x20]; } in_ECX[0x21] = (int)piVar5; in_ECX[0x25] = 0; if (in_ECX[0x1a] == 0) { local_14 = (int *)0x0; local_34 = (int *)0x0; local_20 = 0; local_8 = 0; uVar3 = local_24[0x24]; if (uVar3 != 0) { if (0x3fffffff < uVar3) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(uVar3); } local_14 = (int *)0x0; local_20 = 0; local_18 = local_24 + 0x23; piVar5 = (int *)*local_18; local_24 = (int *)*piVar5; piVar4 = (int *)0x0; if (local_24 != piVar5) { do { piVar5 = local_24 + 5; (**(code **)(*(int *)(local_24[5] + 0x34) + 0x10))(); if (local_34 == (int *)0x0) { std::vector::_Emplace_reallocate(0,piVar5); } else { *local_34 = *piVar5; local_34 = local_34 + 1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); piVar5 = (int *)*local_18; piVar4 = local_34; } while (local_24 != piVar5); } local_14 = (int *)0x0; local_20 = 0; piVar6 = (int *)0x0; FID_conflict__Erase_tree_>_> (local_18,(fuzzer_allocator_> *)local_18, (_Tree_node *)piVar5[1]); piVar5[1] = (int)piVar5; *piVar5 = (int)piVar5; piVar5[2] = (int)piVar5; local_18[1] = 0; if (piVar4 != (int *)0x0) { do { local_28 = *piVar6; iVar1 = *(int *)(local_28 + 0x3c); iVar2 = *(int *)(local_28 + 0x38); local_2c = (*(int *)(iVar2 + 8 + iVar1 * 0x14) - *(int *)(iVar2 + 0xc + iVar1 * 0x14)) + *(int *)(iVar2 + 4 + iVar1 * 0x14); FUN_00a13ca0(&local_24,&local_2c); piVar6 = piVar6 + 1; } while (piVar6 != piVar4); piVar6 = local_14; } if (piVar6 != (int *)0x0) { uVar3 = local_20 - (int)piVar6 & 0xfffffffc; piVar5 = piVar6; if (0xfff < uVar3) { piVar5 = (int *)piVar6[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)piVar6 + (-4 - (int)piVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar5,uVar3); } } ExceptionList = local_10; return; } //@@ 00a13c00 FUN_00a13c00 void FUN_00a13c00(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; uint size; int iVar2; iVar2 = in_ECX[4]; if (iVar2 != 0) { do { iVar2 = iVar2 + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; } iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x14); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 00a13ca0 FUN_00a13ca0 void FUN_00a13ca0(undefined4 *param_1,undefined4 param_2) { undefined4 local_10 [3]; FUN_00a13cd0(local_10,param_2); *param_1 = local_10[0]; return; } //@@ 00a13cd0 FUN_00a13cd0 void FUN_00a13cd0(undefined4 *param_1,uint *param_2) { char cVar1; int iVar2; uint uVar3; int *piVar4; uint uVar5; int *piVar6; int *piVar7; int *in_ECX; int *piVar8; int *piVar9; bool bVar10; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b10cd5; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar2 = *in_ECX; local_8 = 0; piVar6 = operator_new(0x18); uVar3 = *param_2; piVar6[4] = uVar3; piVar6[5] = param_2[1]; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; local_8 = 1; bVar10 = false; piVar4 = (int *)*in_ECX; piVar9 = (int *)piVar4[1]; if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar7 = piVar9; do { piVar9 = piVar7; bVar10 = uVar3 < (uint)piVar9[4]; if (bVar10) { piVar7 = (int *)*piVar9; } else { piVar7 = (int *)piVar9[2]; } } while (*(char *)((int)piVar7 + 0xd) == '\0'); } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)piVar9; if (piVar9 == piVar4) { *piVar4 = (int)piVar6; piVar4[1] = (int)piVar6; piVar4[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (bVar10) { *piVar9 = (int)piVar6; if (piVar9 == (int *)*piVar4) { *piVar4 = (int)piVar6; } } else { piVar9[2] = (int)piVar6; if (piVar9 == (int *)piVar4[2]) { piVar4[2] = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar9 = piVar6; while (cVar1 == '\0') { piVar7 = (int *)piVar9[1]; piVar8 = *(int **)piVar7[1]; if (piVar7 == piVar8) { piVar8 = (int *)((undefined4 *)piVar7[1])[2]; if ((char)piVar8[3] == '\0') goto LAB_00a13e0d; if (piVar9 == (int *)piVar7[2]) { FUN_00415fe0(piVar7); piVar9 = piVar7; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar9[1] + 4)); } else if ((char)piVar8[3] == '\0') { LAB_00a13e0d: *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; piVar9 = *(int **)(piVar9[1] + 4); } else { if (piVar9 == (int *)*piVar7) { FUN_00415f80(piVar7); piVar9 = piVar7; } *(undefined1 *)(piVar9[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar9[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar9[1] + 4)); } cVar1 = *(char *)(piVar9[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a13e90 FUN_00a13e90 void FUN_00a13e90(byte param_1) { void *in_ECX; FUN_00a13ec0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x30); } return; } //@@ 00a13ec0 FUN_00a13ec0 void FUN_00a13ec0(void) { undefined4 *puVar1; undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ShaderManager::vftable; std::deque<4byte>::~deque(); puVar1 = in_ECX + 5; FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(in_ECX[5] + 4)); operator_delete((void *)*puVar1,0x18); puVar1 = in_ECX + 3; FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(in_ECX[3] + 4)); operator_delete((void *)*puVar1,0x18); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a13f20 FUN_00a13f20 void FUN_00a13f20(void) { int *this; undefined4 *puVar1; int in_ECX; int *piVar2; int *local_8; this = (int *)(in_ECX + 0xc); piVar2 = (int *)*this; local_8 = (int *)*piVar2; if (local_8 != piVar2) { do { piVar2 = local_8; (**(code **)(*(int *)local_8[5] + 4))(); puVar1 = (undefined4 *)piVar2[5]; if (puVar1 != (undefined4 *)0x0) { (**(code **)*puVar1)(1); piVar2[5] = 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); piVar2 = (int *)*this; } while (local_8 != piVar2); } FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, (_Tree_node *)piVar2[1]); piVar2[1] = (int)piVar2; *piVar2 = (int)piVar2; piVar2[2] = (int)piVar2; *(undefined4 *)(in_ECX + 0x10) = 0; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a13fa0 FUN_00a13fa0 undefined4 FUN_00a13fa0(byte *param_1,void *param_2,void *param_3) { qword qVar1; byte bVar2; undefined4 *puVar3; undefined4 *puVar4; qword *pqVar5; uint local_c [2]; if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x54); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 + 0x54; *puVar3 = 0x54; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) + (uint)(0xffffffab < (uint)qVar1); if (puVar3 != (undefined4 *)0xfffffffc) { puVar3 = (undefined4 *)FUN_00a245b0(); goto LAB_00a13fd7; } } puVar3 = (undefined4 *)0x0; LAB_00a13fd7: bVar2 = Shader::load(puVar3,param_1,param_2,param_3); if (bVar2 != 0) { local_c[0] = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(param_1); puVar4 = (undefined4 *)FUN_00a14330(local_c); *puVar4 = puVar3; return 1; } if (puVar3 != (undefined4 *)0x0) { (**(code **)*puVar3)(1); } return 0; } //@@ 00a14050 shader_cache_find /* DB: ? path hash lower_bound lookup, sets current shader global prototype: db/protos.zhl, confirmed by RET 4 */ byte shader_cache_find(int unusedArg) { void *pvVar1; uint uVar2; int *piVar3; undefined1 local_14 [8]; int local_c; uint local_8; uVar2 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash((byte *)"KAGE_ColorTextureShader"); local_8 = uVar2; _Find_lower_bound<>(local_14,&local_8); if (((*(char *)(local_c + 0xd) == '\0') && (*(uint *)(local_c + 0x10) <= uVar2)) && (local_c != DAT_00c379bc)) { piVar3 = (int *)std::map::operator_index(&local_8); pvVar1 = (void *)*piVar3; if ((pvVar1 != (void *)0x0) && ((*(byte *)((int)pvVar1 + 4) & 1) != 0)) { g_currentShader = pvVar1; return 1; } } return 0; } //@@ 00a140c0 shader_push /* DB: called as FUN_00a140c0("KAGE_ColorShader") before color quads (Console::Render); hashes path, finds in shader map, pushes previous current shader g_currentShader onto a deque and makes it current, returns 1 prototype: db/protos.zhl, confirmed by RET 4 */ byte shader_push(byte *shaderName) { void *pvVar1; uint uVar2; int *piVar3; void *pvVar4; undefined4 extraout_ECX; undefined1 local_24 [8]; int local_1c; int local_18; uint local_14; uVar2 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(shaderName); local_14 = uVar2; _Find_lower_bound<>(local_24,&local_14); if (((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= uVar2)) && (local_1c != DAT_00c379bc)) { piVar3 = (int *)std::map::operator_index(&local_14); pvVar1 = (void *)*piVar3; if ((pvVar1 != (void *)0x0) && ((*(byte *)((int)pvVar1 + 4) & 1) != 0)) { if (((g_shaderStackSize + DAT_00c379d8 & 3) == 0) && (DAT_00c379d4 <= g_shaderStackSize + 4 >> 2)) { std::deque<4byte>::_Growmap(extraout_ECX); } DAT_00c379d8 = DAT_00c379d8 & DAT_00c379d4 * 4 - 1; uVar2 = DAT_00c379d8 + g_shaderStackSize; local_18 = (DAT_00c379d4 - 1 & uVar2 >> 2) * 4; if (*(int *)(local_18 + DAT_00c379d0) == 0) { pvVar4 = operator_new(0x10); *(void **)(local_18 + DAT_00c379d0) = pvVar4; } *(void **)(*(int *)(local_18 + DAT_00c379d0) + (uVar2 & 3) * 4) = g_currentShader; g_shaderStackSize = g_shaderStackSize + 1; g_currentShader = pvVar1; return 1; } } return 0; } //@@ 00a14200 FUN_00a14200 void FUN_00a14200(void) { uint uVar1; undefined4 *puVar2; if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } uVar1 = g_shaderStackSize; puVar2 = (undefined4 *)FUN_00684fc0(); g_currentShader = (void *)*puVar2; if (uVar1 - 1 == 0) { DAT_00c379d8 = 0; } g_shaderStackSize = uVar1 - 1; return; } //@@ 00a14250 FUN_00a14250 int FUN_00a14250(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_00a143f0(local_10,param_1); return *piVar1 + 0x14; } //@@ 00a14270 std::map::operator_index /* DB: _Find_lower_bound on the uint key; if missing new 0x18 node {key at +0x10, value 0 at +0x14}, insert via FUN_00415bd0 (size 0xaaaaaaa check); returns &node+0x14; shader_cache_find, FXLayers::Render */ int std::map::operator_index(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(uint *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x18); newNode[4] = *param_1; newNode[5] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = _Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 00a14330 FUN_00a14330 int FUN_00a14330(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5f7d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _Find_lower_bound<>(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(uint *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x18); newNode[4] = *param_1; newNode[5] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 00a143f0 FUN_00a143f0 void FUN_00a143f0(undefined4 *param_1,uint *param_2) { char cVar1; int *piVar2; undefined4 *puVar3; int *piVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined4 *puVar6; int *piVar7; undefined4 *puVar8; bool bVar9; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10d4d; local_10 = ExceptionList; piVar2 = (int *)*in_ECX; bVar9 = false; local_14 = (int *)piVar2[1]; piVar7 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar4 = local_14; do { local_14 = piVar4; bVar9 = *param_2 <= (uint)local_14[4]; if (bVar9) { piVar4 = (int *)*local_14; piVar7 = local_14; } else { piVar4 = (int *)local_14[2]; } } while (*(char *)((int)piVar4 + 0xd) == '\0'); } if ((*(char *)((int)piVar7 + 0xd) == '\0') && ((uint)piVar7[4] <= *param_2)) { *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 0; return; } ExceptionList = &local_10; if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; puVar5 = operator_new(0x18); puVar5[4] = *param_2; *(undefined1 *)(puVar5 + 5) = 0; *puVar5 = piVar2; puVar5[1] = piVar2; puVar5[2] = piVar2; *(undefined2 *)(puVar5 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; puVar5[1] = local_14; if (local_14 == piVar2) { *piVar2 = (int)puVar5; piVar2[1] = (int)puVar5; piVar2[2] = (int)puVar5; *(undefined1 *)(puVar5 + 3) = 1; } else { if (bVar9) { *local_14 = (int)puVar5; if (local_14 == (int *)*piVar2) { *piVar2 = (int)puVar5; } } else { local_14[2] = (int)puVar5; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)puVar5; } } cVar1 = *(char *)(puVar5[1] + 0xc); puVar8 = puVar5; while (cVar1 == '\0') { puVar3 = (undefined4 *)puVar8[1]; puVar6 = *(undefined4 **)puVar3[1]; if (puVar3 == puVar6) { puVar6 = (undefined4 *)((undefined4 *)puVar3[1])[2]; if (*(char *)(puVar6 + 3) == '\0') goto LAB_00a1455a; if (puVar8 == (undefined4 *)puVar3[2]) { FUN_00415fe0(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar8[1] + 4)); } else if (*(char *)(puVar6 + 3) == '\0') { LAB_00a1455a: *(undefined1 *)(puVar3 + 3) = 1; *(undefined1 *)(puVar6 + 3) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; puVar8 = *(undefined4 **)(puVar8[1] + 4); } else { if (puVar8 == (undefined4 *)*puVar3) { FUN_00415f80(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar8[1] + 4)); } cVar1 = *(char *)(puVar8[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *param_1 = puVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a145e0 FUN_00a145e0 void FUN_00a145e0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ShaderBase::vftable; KAGE::Graphics::ShaderBase::free_uniforms(in_ECX); FID_conflict__Tidy(in_ECX + 0x10); FUN_00a15310(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x4c); } return; } //@@ 00a14620 Shader::load /* DB: (name, attrib array {char*,int} null-terminated, params): stores a copy of name at this+8, copies attribs into this+0xc/count this+0x10, compiles via vfunc +8 (vfunc +4 cleanup on fail), sets flags|=1 and vfunc +0x28(name); ModManager::LoadShaders, FUN_00a13fa0 shader cache prototype: db/protos.zhl, confirmed by RET 12 */ byte __thiscall Shader::load(void *this,byte *name,void *attributes,void *params) { byte bVar1; int iVar2; char cVar3; uint uVar4; uint uVar5; void *pvVar6; char *pcVar7; byte *pbVar8; char *_Dest; char *pcVar9; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(void **)((int)this + 8) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)((int)this + 8),0); *(undefined4 *)((int)this + 8) = 0; } local_8 = 0xffffffff; if (name == (byte *)0x0) { pcVar9 = (char *)0x0; } else { pbVar8 = name; do { bVar1 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar1 != 0); pcVar9 = operator_new_tracked((uint)(pbVar8 + (1 - (int)(name + 1)))); pbVar8 = name; do { bVar1 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar1 != 0); strncpy(pcVar9,(char *)name,(size_t)(pbVar8 + (1 - (int)(name + 1)))); } uVar5 = 0; *(char **)((int)this + 8) = pcVar9; *(undefined4 *)((int)this + 0x10) = 0; iVar2 = *(int *)((int)attributes + 4); while (iVar2 != 0) { uVar5 = uVar5 + 1; *(uint *)((int)this + 0x10) = uVar5; iVar2 = *(int *)((int)attributes + uVar5 * 8 + 4); } pvVar6 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)uVar5 * 8 >> 0x20) != 0) | (uint)((ulonglong)uVar5 * 8))); *(void **)((int)this + 0xc) = pvVar6; local_14 = 0; if (*(int *)((int)this + 0x10) != 0) { do { iVar2 = local_14 * 8; pcVar9 = *(char **)(iVar2 + (int)attributes); if (pcVar9 == (char *)0x0) { _Dest = (char *)0x0; } else { pcVar7 = pcVar9; do { cVar3 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar3 != '\0'); _Dest = operator_new_tracked((uint)(pcVar7 + (1 - (int)(pcVar9 + 1)))); pcVar7 = pcVar9; do { cVar3 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar3 != '\0'); strncpy(_Dest,pcVar9,(size_t)(pcVar7 + (1 - (int)(pcVar9 + 1)))); } *(char **)(iVar2 + *(int *)((int)this + 0xc)) = _Dest; *(undefined4 *)(iVar2 + 4 + *(int *)((int)this + 0xc)) = *(undefined4 *)(iVar2 + 4 + (int)attributes); local_14 = local_14 + 1; } while (local_14 < *(uint *)((int)this + 0x10)); } cVar3 = (**(code **)(*(int *)this + 8))(params,uVar4); if (cVar3 == '\0') { (**(code **)(*(int *)this + 4))(); ExceptionList = local_10; return 0; } *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 1; (**(code **)(*(int *)this + 0x28))(name); ExceptionList = local_10; return 1; } //@@ 00a147e0 FUN_00a147e0 byte FUN_00a147e0(byte *param_1,void *param_2,byte *param_3,byte *param_4) { byte bVar1; uint uVar2; int *piVar3; int iVar4; void *ptr; void *ptr_00; void *local_2c; undefined4 local_28; void *local_24; undefined4 local_20; void *local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10d70; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar3 = FileSystem::Open(&PTR_vftable_00c37a10,param_3,(int *)0x0); if (piVar3 != (int *)0x0) { (**(code **)(*piVar3 + 0xc))(0,0,uVar2); iVar4 = (**(code **)(*piVar3 + 4))(); ptr = operator_new_tracked(iVar4 + 1); local_14 = (**(code **)(*piVar3 + 0x14))(ptr,iVar4,1); *(undefined1 *)(iVar4 + (int)ptr) = 0; (**(code **)*piVar3)(1); if (ptr != (void *)0x0) { piVar3 = FileSystem::Open(&PTR_vftable_00c37a10,param_4,(int *)0x0); if (piVar3 != (int *)0x0) { (**(code **)(*piVar3 + 0xc))(0,0); iVar4 = (**(code **)(*piVar3 + 4))(); ptr_00 = operator_new_tracked(iVar4 + 1); local_18 = (**(code **)(*piVar3 + 0x14))(ptr_00,iVar4,1); *(undefined1 *)(iVar4 + (int)ptr_00) = 0; (**(code **)*piVar3)(1); if (ptr_00 != (void *)0x0) { local_28 = local_14; local_20 = local_18; local_2c = ptr; local_24 = ptr_00; bVar1 = Shader::load(local_1c,param_1,param_2,&local_2c); local_8 = 1; tracked_alloc(1,ptr,0); local_8 = 2; tracked_alloc(1,ptr_00,0); ExceptionList = local_10; return bVar1; } } local_8 = 0; tracked_alloc(1,ptr,0); local_8 = 0xffffffff; KAGE_LogMessage(8,(byte *)"Failed to load pixel shader \'%s\'\n"); ExceptionList = local_10; return 0; } } KAGE_LogMessage(8,(byte *)"Failed to load vertex shader \'%s\'\n"); ExceptionList = local_10; return 0; } //@@ 00a149a0 KAGE::Graphics::ShaderBase::free_uniforms /* DB: ? frees the 8-byte param entries (+0xc, count +0x10) and the 0x18-byte uniform records (+0x34..+0x38) through the tracked heap; called by the ShaderBase dtors 00a145e0/00a24620/00a24660, ModManager::unload_shaders and Isaac::Shutdown prototype: db/protos.zhl */ void __thiscall KAGE::Graphics::ShaderBase::free_uniforms(void *this) { uint uVar1; qword qVar2; int iVar3; qword *pqVar4; uint uVar5; uint uVar6; int iVar7; int *piVar8; code *pcVar9; int iVar10; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b10d90; local_10 = ExceptionList; ExceptionList = &local_10; uVar5 = 0; if (*(int *)((int)this + 0x10) != 0) { do { iVar10 = *(int *)(*(int *)((int)this + 0xc) + uVar5 * 8); if (iVar10 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)(iVar10 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar6; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar6); free((void *)(iVar10 + -4)); *(undefined4 *)(*(int *)((int)this + 0xc) + uVar5 * 8) = 0; } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)this + 0x10)); } iVar10 = *(int *)((int)this + 0x38); iVar7 = *(int *)((int)this + 0x34); local_14 = 0; iVar3 = iVar10 - iVar7 >> 0x1f; if ((iVar10 - iVar7) / 0x18 + iVar3 != iVar3) { local_18 = 0; do { iVar10 = local_18 + iVar7; iVar3 = *(int *)(iVar10 + 0xc); uVar6 = 0; uVar5 = *(int *)(local_18 + 0x10 + iVar7) - iVar3 >> 2; if (uVar5 != 0) { do { if ((7 < *(int *)(iVar10 + 8)) && (iVar7 = *(int *)(*(int *)(iVar10 + 0xc) + uVar6 * 4), iVar7 != 0)) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)(iVar7 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar1; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar1); free((void *)(iVar7 + -4)); *(undefined4 *)(*(int *)(iVar10 + 0xc) + uVar6 * 4) = 0; } uVar6 = uVar6 + 1; } while (uVar6 < uVar5); iVar3 = *(int *)(iVar10 + 0xc); } local_14 = local_14 + 1; local_18 = local_18 + 0x18; *(int *)(iVar10 + 0x10) = iVar3; iVar10 = *(int *)((int)this + 0x38); iVar7 = *(int *)((int)this + 0x34); } while (local_14 < (uint)((iVar10 - iVar7) / 0x18)); } if (iVar7 != iVar10) { do { FID_conflict__Tidy((void *)(iVar7 + 0xc)); iVar7 = iVar7 + 0x18; } while (iVar7 != iVar10); iVar7 = *(int *)((int)this + 0x34); } *(int *)((int)this + 0x38) = iVar7; iVar10 = 8; piVar8 = (int *)((int)this + 0x14); do { iVar7 = *piVar8; if (iVar7 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar7 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar5; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar5); free((void *)(iVar7 + -4)); *piVar8 = 0; } piVar8 = piVar8 + 1; iVar10 = iVar10 + -1; } while (iVar10 != 0); iVar10 = *(int *)((int)this + 8); if (iVar10 == 0) { pcVar9 = free_exref; } else { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar10 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar5; pcVar9 = free_exref; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar5); free((void *)(iVar10 + -4)); *(undefined4 *)((int)this + 8) = 0; } iVar10 = *(int *)((int)this + 0xc); if (iVar10 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar10 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar5; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar5); (*pcVar9)(iVar10 + -4); *(undefined4 *)((int)this + 0xc) = 0; } *(uint *)((int)this + 4) = *(uint *)((int)this + 4) & 0xfffffffe; *(undefined4 *)((int)this + 0x10) = 0; ExceptionList = local_10; return; } //@@ 00a14bf0 FUN_00a14bf0 void FUN_00a14bf0(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 0xc)); return; } //@@ 00a14c00 Shader::set_uniform /* DB: ? "unknown shader uniform type" prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Shader::set_uniform(void *this,byte *name,int type,void *data,int unused) { byte bVar1; int iVar2; uint uVar3; uint uVar4; uint uVar5; byte *pbVar6; int iVar7; int *piVar8; int iVar9; int *piVar10; undefined4 *puVar11; char *format; undefined4 local_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 *puStack_3c; undefined8 local_38; char *local_30; byte *local_2c; undefined4 *local_28; void *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 *local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = (undefined4 *)0xffffffff; puStack_18 = &LAB_00b10dbd; local_1c = ExceptionList; ExceptionList = &local_1c; local_24 = this; local_28 = (undefined4 *)find_uniform(name,this); if (local_28 == (undefined4 *)0x0) { local_48 = 0; uStack_44 = 0; uStack_40 = 0; local_38 = 0; puStack_3c = local_28; local_14 = local_28; std::vector<24byte>::push_back(&local_48); local_14 = (undefined4 *)0xffffffff; if (puStack_3c != (undefined4 *)0x0) { uVar5 = local_38._4_4_ - (int)puStack_3c & 0xfffffffc; puVar11 = puStack_3c; if (0xfff < uVar5) { puVar11 = (undefined4 *)puStack_3c[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)puStack_3c + (-4 - (int)puVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar11,uVar5); } iVar7 = *(int *)((int)this + 0x34) + ((*(int *)((int)this + 0x38) - *(int *)((int)this + 0x34)) / 0x18) * 0x18; puVar11 = (undefined4 *)(iVar7 + -0x18); local_28 = puVar11; if (name == (byte *)0x0) { *puVar11 = 0; *(undefined4 *)(iVar7 + -0x14) = 1; *(int *)(iVar7 + -0x10) = type; } else { pbVar6 = name; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); local_30 = operator_new_tracked((uint)(pbVar6 + (1 - (int)(name + 1)))); local_2c = name + 1; pbVar6 = name; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); strncpy(local_30,(char *)name,(size_t)(pbVar6 + (1 - (int)local_2c))); *puVar11 = local_30; *(undefined4 *)(iVar7 + -0x14) = 1; *(int *)(iVar7 + -0x10) = type; } } switch(type) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: format = "Getting the type size of a shader uniform texture is not supported"; goto LAB_00a14da7; case 8: case 0xc: case 0x10: uVar5 = 4; break; case 9: case 0xd: case 0x11: uVar5 = 8; break; case 10: case 0xe: case 0x12: uVar5 = 0xc; break; case 0xb: case 0xf: case 0x13: case 0x14: uVar5 = 0x10; break; case 0x15: case 0x17: uVar5 = 0x18; break; case 0x16: case 0x1a: uVar5 = 0x20; break; case 0x18: uVar5 = 0x24; break; case 0x19: case 0x1b: uVar5 = 0x30; break; case 0x1c: uVar5 = 0x40; break; default: format = "Unknown shader uniform type \'%d\' specified"; LAB_00a14da7: KAGE_LogMessage(0x10,(byte *)format); uVar5 = 0; } iVar7 = (int)(local_28[4] - local_28[3]) >> 2; if (iVar7 != 0) { piVar8 = *(int **)(local_28[3] + -4 + iVar7 * 4); piVar10 = data; uVar4 = uVar5; while (uVar3 = uVar4 - 4, 3 < uVar4) { if (*piVar8 != *piVar10) goto LAB_00a14ded; piVar8 = piVar8 + 1; piVar10 = piVar10 + 1; uVar4 = uVar3; } if (uVar3 == 0xfffffffc) { ExceptionList = local_1c; return; } LAB_00a14ded: if ((char)*piVar8 == (char)*piVar10) { if (uVar3 == 0xfffffffd) { ExceptionList = local_1c; return; } if (*(char *)((int)piVar8 + 1) == *(char *)((int)piVar10 + 1)) { if (uVar3 == 0xfffffffe) { ExceptionList = local_1c; return; } if (*(char *)((int)piVar8 + 2) == *(char *)((int)piVar10 + 2)) { if (uVar3 == 0xffffffff) { ExceptionList = local_1c; return; } if (*(char *)((int)piVar8 + 3) == *(char *)((int)piVar10 + 3)) { ExceptionList = local_1c; return; } } } } this = local_24; } local_2c = operator_new_tracked(uVar5); memcpy(local_2c,data,uVar5); puVar11 = (undefined4 *)local_28[4]; if (puVar11 == (undefined4 *)local_28[5]) { std::vector::_Emplace_reallocate(puVar11,&local_2c); } else { *puVar11 = local_2c; local_28[4] = local_28[4] + 4; } *(undefined4 *)((int)this + 0x44) = *(undefined4 *)((int)this + 0x40); iVar7 = *(int *)((int)this + 0x34); local_28 = (undefined4 *)0x0; iVar9 = *(int *)((int)local_24 + 0x38) - iVar7; iVar2 = iVar9 >> 0x1f; if (iVar9 / 0x18 + iVar2 != iVar2) { local_2c = (byte *)0x0; do { local_30 = (char *)((*(int *)(local_2c + iVar7 + 0x10) - *(int *)(local_2c + iVar7 + 0xc) >> 2 ) + -1); piVar8 = *(int **)((int)local_24 + 0x44); if (piVar8 == *(int **)((int)local_24 + 0x48)) { std::vector::_Emplace_reallocate(piVar8,&local_30); } else { *piVar8 = (int)local_30; *(int *)((int)this + 0x44) = *(int *)((int)this + 0x44) + 4; } iVar7 = *(int *)((int)local_24 + 0x34); local_28 = (undefined4 *)((int)local_28 + 1); local_2c = local_2c + 0x18; } while (local_28 < (uint)((*(int *)((int)local_24 + 0x38) - iVar7) / 0x18)); } ExceptionList = local_1c; return; } //@@ 00a14f90 FUN_00a14f90 void FUN_00a14f90(int *param_1) { uint uVar1; undefined4 uVar2; int *in_ECX; undefined4 *puVar3; int iVar4; int *piVar5; uint uVar6; piVar5 = param_1; if (param_1 == (int *)0x0) { piVar5 = in_ECX + 0x10; } uVar6 = 0; iVar4 = *piVar5; if (piVar5[1] - iVar4 >> 2 != 0) { param_1 = (int *)0x0; do { puVar3 = (undefined4 *)(in_ECX[0xd] + (int)param_1); uVar1 = *(uint *)(iVar4 + uVar6 * 4); if (uVar1 < (uint)((int)(puVar3[4] - puVar3[3]) >> 2)) { uVar2 = *(undefined4 *)(puVar3[3] + uVar1 * 4); uVar1 = puVar3[2]; if (uVar1 < 8) { (&DAT_00c79928)[uVar1] = uVar2; } else { (**(code **)(*in_ECX + 0x1c))(*puVar3,uVar1,uVar2,puVar3[1]); } } uVar6 = uVar6 + 1; iVar4 = *piVar5; param_1 = (int *)((int)param_1 + 0x18); } while (uVar6 < (uint)(piVar5[1] - iVar4 >> 2)); } uVar6 = 0; do { if ((&DAT_00c79928)[uVar6] != 0) { (**(code **)(*in_ECX + 0x18))(uVar6,(&DAT_00c79928)[uVar6]); } uVar6 = uVar6 + 1; } while (uVar6 < 8); return; } //@@ 00a15040 Shader::find_uniform /* DB: linear search of the 0x18-byte uniform records at this+0x34..+0x38 for strcmp(name)==0 and type (+4)==1, returns the record or null; Shader::set_uniform creates one when null */ undefined4 * Shader::find_uniform(byte *param_1) { byte bVar1; undefined4 *puVar2; int iVar3; byte *pbVar4; uint uVar5; int in_ECX; int iVar6; byte *pbVar7; undefined4 *puVar8; uint uVar9; bool bVar10; puVar2 = *(undefined4 **)(in_ECX + 0x34); iVar6 = *(int *)(in_ECX + 0x38) - (int)puVar2; iVar3 = iVar6 >> 0x1f; iVar6 = iVar6 / 0x18 + iVar3; uVar9 = 0; puVar8 = puVar2; if (iVar6 != iVar3) { do { pbVar4 = (byte *)*puVar8; pbVar7 = param_1; do { bVar1 = *pbVar7; bVar10 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_00a15090: uVar5 = -(uint)bVar10 | 1; goto LAB_00a15095; } if (bVar1 == 0) break; bVar1 = pbVar7[1]; bVar10 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_00a15090; pbVar7 = pbVar7 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00a15095: if ((uVar5 == 0) && (puVar8[1] == 1)) { return puVar2 + uVar9 * 6; } uVar9 = uVar9 + 1; puVar8 = puVar8 + 6; } while (uVar9 < (uint)(iVar6 - iVar3)); } return (undefined4 *)0x0; } //@@ 00a150d0 FUN_00a150d0 void FUN_00a150d0(void) { uint uVar1; qword qVar2; int *piVar3; int in_ECX; int iVar4; int iVar5; qword *pqVar6; int iVar7; uint uVar8; int local_24; int local_20; uint local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af38e0; local_10 = ExceptionList; ExceptionList = &local_10; iVar7 = *(int *)(in_ECX + 0x34); iVar5 = *(int *)(in_ECX + 0x38) - iVar7; local_1c = 0; iVar4 = iVar5 >> 0x1f; local_14 = in_ECX; if (iVar5 / 0x18 + iVar4 != iVar4) { local_18 = 0; do { iVar5 = local_18 + iVar7; piVar3 = *(int **)(iVar5 + 0xc); iVar4 = *(int *)(local_18 + 0x10 + iVar7) - (int)piVar3 >> 2; if (iVar4 != 0) { local_24 = piVar3[iVar4 + -1]; local_20 = local_24; if (7 < *(int *)(local_18 + 8 + iVar7)) { uVar8 = 0; if (iVar4 != 1) { do { piVar3 = *(int **)(iVar5 + 0xc); iVar7 = piVar3[uVar8]; if (iVar7 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)(iVar7 + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar1; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar1); free((void *)(iVar7 + -4)); local_8 = 0xffffffff; *(undefined4 *)(*(int *)(iVar5 + 0xc) + uVar8 * 4) = 0; piVar3 = *(int **)(iVar5 + 0xc); } uVar8 = uVar8 + 1; } while (uVar8 < iVar4 - 1U); } } in_ECX = local_14; *(int **)(iVar5 + 0x10) = piVar3; if (piVar3 == *(int **)(iVar5 + 0x14)) { std::vector::_Emplace_reallocate(piVar3,&local_24); } else { *piVar3 = local_20; *(int *)(iVar5 + 0x10) = *(int *)(iVar5 + 0x10) + 4; } } iVar7 = *(int *)(in_ECX + 0x34); local_1c = local_1c + 1; local_18 = local_18 + 0x18; } while (local_1c < (uint)((*(int *)(in_ECX + 0x38) - iVar7) / 0x18)); } *(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(in_ECX + 0x40); iVar7 = *(int *)(in_ECX + 0x34); local_1c = 0; iVar5 = *(int *)(in_ECX + 0x38) - iVar7; iVar4 = iVar5 >> 0x1f; if (iVar5 / 0x18 + iVar4 != iVar4) { iVar4 = 0; do { local_24 = (*(int *)(iVar4 + 0x10 + iVar7) - *(int *)(iVar4 + 0xc + iVar7) >> 2) + -1; piVar3 = *(int **)(local_14 + 0x44); if (piVar3 == *(int **)(local_14 + 0x48)) { std::vector::_Emplace_reallocate(piVar3,&local_24); } else { *piVar3 = local_24; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + 4; } iVar7 = *(int *)(local_14 + 0x34); iVar4 = iVar4 + 0x18; local_1c = local_1c + 1; } while (local_1c < (uint)((*(int *)(local_14 + 0x38) - iVar7) / 0x18)); } ExceptionList = local_10; return; } //@@ 00a152a0 std::vector<24byte>::push_back /* DB: move push of a 24-byte element (3 dwords + a moved 3-dword vector) at this+4, realloc via FUN_00a153a0 when full; Shader::set_uniform adds a new uniform record */ void std::vector<24byte>::push_back(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { _Emplace_reallocate(puVar1,param_1); return; } *puVar1 = *param_1; puVar1[1] = param_1[1]; puVar1[2] = param_1[2]; uVar2 = param_1[5]; uVar3 = param_1[4]; uVar4 = param_1[3]; param_1[5] = 0; param_1[4] = 0; param_1[3] = 0; puVar1[3] = uVar4; puVar1[4] = uVar3; puVar1[5] = uVar2; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x18; return; } //@@ 00a15310 FUN_00a15310 void FUN_00a15310(void) { uint size; int *in_ECX; void *pvVar1; void *pvVar2; pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { pvVar2 = (void *)in_ECX[1]; if (pvVar1 != pvVar2) { do { FID_conflict__Tidy((void *)((int)pvVar1 + 0xc)); pvVar1 = (void *)((int)pvVar1 + 0x18); } while (pvVar1 != pvVar2); pvVar1 = (void *)*in_ECX; } size = ((in_ECX[2] - (int)pvVar1) / 0x18) * 0x18; pvVar2 = pvVar1; if (0xfff < size) { pvVar2 = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00a153a0 std::vector<24byte>::_Emplace_reallocate /* DB: growth/max 0xaaaaaaa by /0x18; caller std::vector<24byte>::push_back */ undefined4 * std::vector<24byte>::_Emplace_reallocate(int param_1,undefined4 *param_2) { uint uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; undefined4 *puVar7; uint uVar8; int *in_ECX; uint uVar9; void *pvVar10; void *pvVar11; undefined4 *puVar12; int iVar13; iVar13 = *in_ECX; iVar6 = (in_ECX[1] - *in_ECX) / 0x18; if (iVar6 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar6 + 1; uVar8 = (in_ECX[2] - *in_ECX) / 0x18; if (0xaaaaaaa - (uVar8 >> 1) < uVar8) { uVar9 = 0xaaaaaaa; } else { uVar8 = (uVar8 >> 1) + uVar8; uVar9 = uVar1; if (uVar1 <= uVar8) { uVar9 = uVar8; } if (0xaaaaaaa < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar7 = _Allocate(uVar9 * 0x18); puVar2 = puVar7 + ((param_1 - iVar13) / 0x18) * 6; *puVar2 = *param_2; puVar2[1] = param_2[1]; puVar2[2] = param_2[2]; uVar3 = param_2[5]; uVar4 = param_2[4]; uVar5 = param_2[3]; param_2[5] = 0; param_2[4] = 0; param_2[3] = 0; puVar2[3] = uVar5; puVar2[4] = uVar4; puVar2[5] = uVar3; iVar13 = *in_ECX; puVar12 = puVar7; if (param_1 != in_ECX[1]) { FUN_00915eb0(puVar7,iVar13); puVar12 = puVar2 + 6; } FUN_00915eb0(puVar12,iVar13); pvVar10 = (void *)*in_ECX; if (pvVar10 != (void *)0x0) { pvVar11 = (void *)in_ECX[1]; if (pvVar10 != pvVar11) { do { FID_conflict__Tidy((void *)((int)pvVar10 + 0xc)); pvVar10 = (void *)((int)pvVar10 + 0x18); } while (pvVar10 != pvVar11); pvVar10 = (void *)*in_ECX; } uVar8 = ((in_ECX[2] - (int)pvVar10) / 0x18) * 0x18; pvVar11 = pvVar10; if (0xfff < uVar8) { pvVar11 = *(void **)((int)pvVar10 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)pvVar11))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar11,uVar8); } *in_ECX = (int)puVar7; in_ECX[1] = (int)(puVar7 + uVar1 * 6); in_ECX[2] = (int)(puVar7 + uVar9 * 6); return puVar2; } //@@ 00a15550 FUN_00a15550 void FUN_00a15550(void) { return; } //@@ 00a15570 FUN_00a15570 uint FUN_00a15570(void) { uint in_EAX; uint in_ECX; if ((in_ECX == 0) || (in_EAX = in_ECX - 1, (in_ECX & in_EAX) != 0)) { return in_EAX & 0xffffff00; } return CONCAT31((int3)(in_EAX >> 8),1); } //@@ 00a15590 FUN_00a15590 int FUN_00a15590(void) { uint uVar1; byte bVar2; uint in_ECX; uint uVar3; bVar2 = 1; uVar3 = in_ECX - 1; uVar1 = in_ECX >> 1; while (uVar1 != 0) { uVar3 = uVar3 | uVar1; bVar2 = bVar2 + 1; uVar1 = in_ECX >> (bVar2 & 0x1f); } return uVar3 + 1; } //@@ 00a155c0 Math::lerp /* DB: a XMM0, b XMM1, t XMM2 (clamped to 0..1 when CL != 0): a + (b - a) * t (asm) (dogma_effects.md) prototype: db/protos.zhl */ float __cdecl Math::lerp(float a,float b,float t,byte isClamped) { if (isClamped != 0) { if (t <= 0.0) { t = 0.0; } if (1.0 <= t) { t = 1.0; } } return a + (b - a) * t; } //@@ 00a155f0 FUN_00a155f0 void FUN_00a155f0(void) { float in_XMM0_Da; float in_XMM1_Da; if (in_XMM0_Da == in_XMM1_Da) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } return; } //@@ 00a15640 assert_lerp_range /* DB: only logs "Start and End parameters cannot be the same!" if two float args equal prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ float __cdecl assert_lerp_range(float value,float inMin,float inMax,float outMin,float outMax,byte isClamped) { float fVar1; if (inMin == inMax) { KAGE_LogMessage(0x10,(byte *)"Start and End parameters cannot be the same!"); } fVar1 = (value - inMin) / (inMax - inMin); if (isClamped != 0) { if (fVar1 <= 0.0) { fVar1 = 0.0; } if (1.0 <= fVar1) { fVar1 = 1.0; } } return (outMax - outMin) * fVar1 + outMin; } //@@ 00a156d0 FUN_00a156d0 void FUN_00a156d0(void) { LPCRITICAL_SECTION in_ECX; DeleteCriticalSection(in_ECX); return; } //@@ 00a156e0 FUN_00a156e0 void FUN_00a156e0(byte param_1) { LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[2]; *in_ECX = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[2] = 0; } *(byte *)(in_ECX + 1) = *(byte *)(in_ECX + 1) & 0xfe; *in_ECX = KAGE::MutexBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a15730 FUN_00a15730 void FUN_00a15730(void) { LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[2]; *in_ECX = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[2] = 0; } *(byte *)(in_ECX + 1) = *(byte *)(in_ECX + 1) & 0xfe; *in_ECX = KAGE::MutexBase::vftable; return; } //@@ 00a15770 FUN_00a15770 undefined4 FUN_00a15770(void) { LPCRITICAL_SECTION lpCriticalSection; int in_ECX; if ((*(byte *)(in_ECX + 4) & 1) == 0) { lpCriticalSection = operator_new(0x1c); if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { lpCriticalSection = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; InitializeCriticalSection(lpCriticalSection); } *(LPCRITICAL_SECTION *)(in_ECX + 8) = lpCriticalSection; *(byte *)(in_ECX + 4) = *(byte *)(in_ECX + 4) | 1; } return 1; } //@@ 00a157c0 FUN_00a157c0 void FUN_00a157c0(void) { LPCRITICAL_SECTION lpCriticalSection; int in_ECX; lpCriticalSection = *(LPCRITICAL_SECTION *)(in_ECX + 8); if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); *(undefined4 *)(in_ECX + 8) = 0; } *(byte *)(in_ECX + 4) = *(byte *)(in_ECX + 4) & 0xfe; return; } //@@ 00a157f0 KAGE::Mutex::Lock /* DB: "Trying to lock mutex that has not been initialized"; timeout -1 -> EnterCriticalSection + spin on busy flag; else TryEnterCriticalSection loop with Sleep(10) until timeout ms (GetTimeNs); returns 1 on success prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall KAGE::Mutex::Lock(void *this,int timeoutMs) { char cVar1; LPCRITICAL_SECTION p_Var2; longlong lVar3; longlong lVar4; BOOL BVar5; uint uVar6; uint uVar7; uint uVar8; uint uVar9; ulonglong uVar10; if ((*(byte *)((int)this + 4) & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Trying to lock mutex that has not been initialized"); } if (timeoutMs == -1) { p_Var2 = *(LPCRITICAL_SECTION *)((int)this + 8); EnterCriticalSection(p_Var2); cVar1 = *(char *)&p_Var2[1].DebugInfo; while (cVar1 != '\0') { Sleep(1000); cVar1 = *(char *)&p_Var2[1].DebugInfo; } *(undefined1 *)&p_Var2[1].DebugInfo = 1; return 1; } uVar10 = GetTimeNs(); uVar7 = (uint)(uVar10 >> 0x20); lVar3 = (uVar10 & 0xffffffff) * 0x431bde82; lVar4 = (ulonglong)uVar7 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); uVar9 = (uint)((ulonglong)lVar4 >> 0x20); uVar6 = (int)((ulonglong)lVar3 >> 0x20) + (uint)CARRY4((uint)lVar3,(uint)lVar4); lVar3 = (ulonglong)uVar7 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar6),uVar9 + uVar6); uVar7 = (uint)((ulonglong)lVar3 >> 0x20); uVar6 = (uint)lVar3 >> 0x12 | uVar7 * 0x4000; if (timeoutMs != 0) { do { p_Var2 = *(LPCRITICAL_SECTION *)((int)this + 8); BVar5 = TryEnterCriticalSection(p_Var2); if ((BVar5 == 0) || (*(char *)&p_Var2[1].DebugInfo == '\0')) { if (BVar5 != 0) { return 1; } } else { LeaveCriticalSection(p_Var2); } Sleep(10); uVar10 = GetTimeNs(); uVar9 = (uint)(uVar10 >> 0x20); lVar3 = (uVar10 & 0xffffffff) * 0x431bde82; lVar4 = (ulonglong)uVar9 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = (ulonglong)uVar9 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)((ulonglong)lVar3 >> 0x20) + (uint)CARRY4((uint)lVar3,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar3) >> 0x20)); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); uVar9 = (uint)lVar3 >> 0x12 | uVar8 * 0x4000; } while (((uVar8 >> 0x12) - (uVar7 >> 0x12) == (uint)(uVar9 < uVar6)) && (uVar9 - uVar6 < (uint)timeoutMs)); } return 0; } //@@ 00a159a0 FUN_00a159a0 void FUN_00a159a0(void) { LPCRITICAL_SECTION lpCriticalSection; int in_ECX; if ((*(byte *)(in_ECX + 4) & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Trying to unlock mutex that has not been initialized"); } lpCriticalSection = *(LPCRITICAL_SECTION *)(in_ECX + 8); *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; LeaveCriticalSection(lpCriticalSection); return; } //@@ 00a159d0 KAGE_Filesys_FileManager::GetPrimaryFilePathHash /* ZHL [exact] static __fastcall uint32_t KAGE_Filesys_FileManager::GetPrimaryFilePathHash(const char* filePath); prototype: REPENTOGON, confirmed by RET 0 */ uint __fastcall KAGE_Filesys_FileManager::GetPrimaryFilePathHash(byte *filePath) { byte bVar1; uint uVar2; uint uVar3; byte bVar4; if (filePath == (byte *)0x0) { return 0; } uVar2 = 0x1505; bVar1 = *filePath; while (bVar1 != 0) { filePath = filePath + 1; bVar4 = bVar1 + 0x20; if (0x19 < (byte)(bVar1 + 0xbf)) { bVar4 = bVar1; } uVar3 = (uint)bVar4; if (bVar4 == 0x5c) { uVar3 = 0x2f; } uVar2 = uVar2 * 0x21 + uVar3; bVar1 = *filePath; } return uVar2; } //@@ 00a15a30 FUN_00a15a30 undefined8 FUN_00a15a30(void) { byte bVar1; uint uVar2; uint uVar3; uint uVar4; byte *in_ECX; byte bVar5; uint uVar6; int iVar7; bool bVar8; if (in_ECX == (byte *)0x0) { return 0; } iVar7 = 0; uVar6 = 0x1505; bVar1 = *in_ECX; while (bVar1 != 0) { in_ECX = in_ECX + 1; bVar5 = bVar1 + 0x20; if (0x19 < (byte)(bVar1 + 0xbf)) { bVar5 = bVar1; } uVar4 = (uint)bVar5; if (bVar5 == 0x5c) { uVar4 = 0x2f; } uVar2 = uVar6 >> 0x1b; bVar8 = CARRY4(uVar6 * 0x20,uVar6); uVar3 = uVar6 * 0x21; uVar6 = uVar3 + uVar4; iVar7 = (iVar7 << 5 | uVar2) + iVar7 + (uint)bVar8 + (uint)CARRY4(uVar3,uVar4); bVar1 = *in_ECX; } return CONCAT44(iVar7,uVar6); } //@@ 00a15ab0 FUN_00a15ab0 uint FUN_00a15ab0(void) { byte bVar1; uint uVar2; byte *in_ECX; byte bVar3; uint uVar4; if (in_ECX == (byte *)0x0) { return 0; } uVar4 = 0x5bb2220e; bVar1 = *in_ECX; while (bVar1 != 0) { in_ECX = in_ECX + 1; bVar3 = bVar1 + 0x20; if (0x19 < (byte)(bVar1 + 0xbf)) { bVar3 = bVar1; } uVar2 = (uint)bVar3; if (bVar3 == 0x5c) { uVar2 = 0x2f; } uVar4 = (uVar2 ^ uVar4) * 0x1000193; bVar1 = *in_ECX; } return uVar4; } //@@ 00a15b10 get_time_ms /* DB: GetTimeNs() divided by 1,000,000 (magic 0x431bde82d7b634db >> 18), returns uint64 milliseconds; Entity_Player::TakeDamage/Update, Menu_OnlineLobby::init_lobby_view prototype: db/protos.zhl */ ulonglong __cdecl get_time_ms(void) { longlong lVar1; longlong lVar2; uint uVar3; ulonglong uVar4; uVar4 = GetTimeNs(); uVar3 = (uint)(uVar4 >> 0x20); lVar1 = (uVar4 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar3 * 0xd7b634db + ((uVar4 & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar3 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); return CONCAT44(uVar3 >> 0x12,(uint)lVar1 >> 0x12 | uVar3 * 0x4000); } //@@ 00a15b90 FUN_00a15b90 void FUN_00a15b90(undefined4 *param_1) { char cVar1; char *_Source; char *pcVar2; char *_Dest; undefined4 *in_ECX; *in_ECX = 0; _Source = (char *)*param_1; if (_Source != (char *)0x0) { pcVar2 = _Source; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar2 + (1 - (int)(_Source + 1)))); pcVar2 = _Source; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); strncpy(_Dest,_Source,(size_t)(pcVar2 + (1 - (int)(_Source + 1)))); *in_ECX = _Dest; } in_ECX[1] = param_1[1]; return; } //@@ 00a15c00 FUN_00a15c00 void FUN_00a15c00(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if ((void *)*in_ECX != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)*in_ECX,0); *in_ECX = 0; } in_ECX[1] = 0xffffffff; ExceptionList = local_10; return; } //@@ 00a15c70 FUN_00a15c70 void FUN_00a15c70(byte param_1) { undefined4 *this; uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Filesys::ContentManagerBase::ContentMountPoint::vftable; if ((void *)in_ECX[3] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[3],0); in_ECX[3] = 0; } in_ECX[4] = 0xffffffff; *in_ECX = KAGE::Filesys::FileMap::vftable; FUN_00a68640(uVar1); this = in_ECX + 1; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[1] + 4)); operator_delete((void *)*this,0x18); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } ExceptionList = local_10; return; } //@@ 00a15d20 FUN_00a15d20 void FUN_00a15d20(undefined4 param_1) { int *in_ECX; (**(code **)(*in_ECX + 0x18))(in_ECX[3],param_1); return; } //@@ 00a15d40 FUN_00a15d40 void FUN_00a15d40(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Filesys::ContentManagerBase::vftable; FID_conflict__Tidy(in_ECX + 8); FID_conflict__Tidy(in_ECX + 5); FID_conflict__Tidy(in_ECX + 2); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x2c); } return; } //@@ 00a15d90 FUN_00a15d90 undefined4 FUN_00a15d90(void) { byte *ptr; void *in_ECX; byte *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10ded; local_10 = ExceptionList; ExceptionList = &local_10; FileSystem::load_mount_points(in_ECX); local_14 = 0xffffffff; ptr = path_join(&s_empty,&s_empty,0,1); local_8 = 0; local_18 = ptr; FUN_00a15f10(&local_18); if (ptr != (byte *)0x0) { local_8 = 1; tracked_alloc(1,ptr,0); } *(uint *)((int)in_ECX + 4) = *(uint *)((int)in_ECX + 4) | 1; ExceptionList = local_10; return 1; } //@@ 00a15e30 FUN_00a15e30 void FUN_00a15e30(void) { int iVar1; qword qVar2; uint uVar3; int in_ECX; qword *pqVar4; int *piVar5; undefined4 *puVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar5 = *(int **)(in_ECX + 0x14); if (piVar5 != *(int **)(in_ECX + 0x18)) { do { if ((undefined4 *)*piVar5 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar5)(1,uVar3); *piVar5 = 0; } piVar5 = piVar5 + 1; } while (piVar5 != *(int **)(in_ECX + 0x18)); piVar5 = *(int **)(in_ECX + 0x14); } *(int **)(in_ECX + 0x18) = piVar5; *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(in_ECX + 8); puVar6 = *(undefined4 **)(in_ECX + 0x20); if (puVar6 != *(undefined4 **)(in_ECX + 0x24)) { do { piVar5 = (int *)*puVar6; if (piVar5 != (int *)0x0) { iVar1 = *piVar5; if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar1 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar3; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar3); free((void *)(iVar1 + -4)); *piVar5 = 0; } operator_delete(piVar5,8); *puVar6 = 0; } puVar6 = puVar6 + 1; } while (puVar6 != *(undefined4 **)(in_ECX + 0x24)); puVar6 = *(undefined4 **)(in_ECX + 0x20); } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; *(undefined4 **)(in_ECX + 0x24) = puVar6; ExceptionList = local_10; return; } //@@ 00a15f10 FUN_00a15f10 void FUN_00a15f10(int *param_1) { undefined4 *puVar1; uint uVar2; int iVar3; int *piVar4; void *pvVar5; int in_ECX; undefined4 extraout_ECX; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10e2c; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*param_1 != 0) { iVar3 = FUN_00a16e00(); if (iVar3 == 0) { local_14 = (int *)FUN_00a16e00(extraout_ECX,uVar2); piVar4 = local_14; if (local_14 == (int *)0x0) { piVar4 = operator_new(0x14); local_8 = 0; if (piVar4 == (int *)0x0) { piVar4 = (int *)0x0; } else { *piVar4 = (int)KAGE::Filesys::FileMap::vftable; piVar4[1] = 0; piVar4[2] = 0; local_14 = piVar4; pvVar5 = operator_new(0x18); *(void **)pvVar5 = pvVar5; *(void **)((int)pvVar5 + 4) = pvVar5; *(void **)((int)pvVar5 + 8) = pvVar5; *(undefined2 *)((int)pvVar5 + 0xc) = 0x101; piVar4[1] = (int)pvVar5; local_8 = CONCAT31(local_8._1_3_,1); *piVar4 = (int)KAGE::Filesys::ContentManagerBase::ContentMountPoint::vftable; FUN_00a15b90(param_1); } local_8 = 0xffffffff; local_14 = piVar4; (**(code **)(*piVar4 + 8))(&s_empty); puVar1 = *(undefined4 **)(in_ECX + 0x18); if (puVar1 == *(undefined4 **)(in_ECX + 0x1c)) { std::vector<4byte>::_Emplace_reallocate(puVar1,&local_14); piVar4 = local_14; } else { *puVar1 = piVar4; *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + 4; } } puVar1 = *(undefined4 **)(in_ECX + 0xc); if (puVar1 != *(undefined4 **)(in_ECX + 0x10)) { *puVar1 = piVar4; *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + 4; ExceptionList = local_10; return; } std::vector<4byte>::_Emplace_reallocate(puVar1,&local_14); } } ExceptionList = local_10; return; } //@@ 00a16060 FileSystem::GetMountPrefixes /* WARNING: Variable defined which should be unmapped: outPrefixes */ /* DB: src/anm2 decompile labels (FileSystem::GetMountPrefixes) prototype: db/protos.zhl, confirmed by RET 4 */ void * FileSystem::GetMountPrefixes(void *outPrefixes) { int iVar1; undefined4 *puVar2; int iVar3; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; puStack_c = &LAB_00b10e6e; ExceptionList = &local_10; *(undefined4 *)outPrefixes = 0; *(undefined4 *)((int)outPrefixes + 4) = 0; *(undefined4 *)((int)outPrefixes + 8) = 0; local_8 = 0; iVar3 = DAT_00c379ec - DAT_00c379e8 >> 2; local_14 = 1; while (iVar3 = iVar3 + -1, -1 < iVar3) { iVar1 = *(int *)(DAT_00c379e8 + iVar3 * 4); strncmp(*(char **)(iVar1 + 0xc),(char *)&s_empty,0); local_18 = *(undefined4 *)(iVar1 + 0xc); puVar2 = *(undefined4 **)((int)outPrefixes + 4); if (puVar2 == *(undefined4 **)((int)outPrefixes + 8)) { std::vector::_Emplace_reallocate(puVar2,&local_18); } else { *puVar2 = local_18; *(int *)((int)outPrefixes + 4) = *(int *)((int)outPrefixes + 4) + 4; } } ExceptionList = local_10; return outPrefixes; } //@@ 00a16130 FUN_00a16130 byte * FUN_00a16130(byte *param_1) { int iVar1; byte *pbVar2; byte *name; char local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; ExceptionList = &local_10; local_11 = '\0'; iVar1 = FileSystem::find_mount(param_1,&local_11); if (iVar1 == 0) { ExceptionList = local_10; return (byte *)0x0; } if (local_11 != '\0') { pbVar2 = path_join(param_1,*(byte **)(iVar1 + 0xc),0,0); ExceptionList = local_10; return pbVar2; } pbVar2 = path_join(param_1,(byte *)0x0,0,0); name = (byte *)FUN_00a68790(pbVar2); if (pbVar2 != (byte *)0x0) { local_8 = 0; tracked_alloc(1,pbVar2,0); local_8 = 0xffffffff; } pbVar2 = path_join(name,*(byte **)(iVar1 + 0xc),0,0); ExceptionList = local_10; return pbVar2; } //@@ 00a16220 FUN_00a16220 byte * FUN_00a16220(byte *param_1) { char cVar1; byte bVar2; char *_Str2; qword qVar3; byte *_Str1; int iVar4; byte *filePath; uint uVar5; int *piVar6; int in_ECX; qword *pqVar7; byte *pbVar8; char *pcVar9; size_t _MaxCount; undefined1 local_2c [8]; int local_24; int local_20; int local_1c; uint local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1df0; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; _Str1 = path_join(param_1,(byte *)0x0,0,0); local_1c = *(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8) >> 2; do { do { local_1c = local_1c + -1; if (local_1c < 0) { if (_Str1 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(_Str1 + -4); qVar3 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar5; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar3 < uVar5); free(_Str1 + -4); } ExceptionList = local_10; return (byte *)0x0; } local_20 = local_1c * 4; _Str2 = *(char **)(*(int *)(*(int *)(in_ECX + 8) + local_20) + 0xc); pcVar9 = _Str2; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); _MaxCount = (int)pcVar9 - (int)(_Str2 + 1); iVar4 = strncmp((char *)_Str1,_Str2,_MaxCount); } while (iVar4 != 0); pbVar8 = _Str1; do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar2 != 0); pbVar8 = pbVar8 + (-_MaxCount - (int)(_Str1 + 1)) + 1; filePath = tracked_alloc(0,(void *)0x0,ZEXT48(pbVar8)); if (filePath == (byte *)0x0) { filePath = (byte *)0x0; } else { memset(filePath,0,(size_t)pbVar8); *filePath = 0; } strncpy_s((char *)filePath,(rsize_t)pbVar8,(char *)(_Str1 + _MaxCount),(rsize_t)pbVar8); iVar4 = *(int *)(*(int *)(local_14 + 8) + local_20); uVar5 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(filePath); local_18 = uVar5; _Find_lower_bound<>(local_2c,&local_18); in_ECX = local_14; } while ((((*(char *)(local_24 + 0xd) != '\0') || (uVar5 < *(uint *)(local_24 + 0x10))) || (local_24 == *(int *)(iVar4 + 4))) || (piVar6 = map_find_value((void *)(iVar4 + 4),(uint)&local_18), in_ECX = local_14, *piVar6 == 0)); if (_Str1 != (byte *)0x0) { local_8 = 0; tracked_alloc(1,_Str1,0); } ExceptionList = local_10; return filePath; } //@@ 00a163f0 filesys_list_directory_mounts /* DB: ? (dir, int* count) like filesys_list_directory 00a16610 filesys_list_directory loops the mount root vector DAT_00c379e8..ec: path_join per root, platform filesystem vfunc +0x20 (PTR_vftable_00c379e0) appends entries, then new[] of 8-byte {flags & ~0x10, name}; only caller FUN_00926510 on "%s/save_backups/" */ uint * filesys_list_directory_mounts(byte *param_1,int *param_2) { uint uVar1; byte *pbVar2; qword qVar3; undefined1 *puVar4; uint uVar5; byte *pbVar6; int iVar7; qword *pqVar8; uint uVar9; byte *local_38; byte *local_34; int local_30; uint *local_2c; uint local_28; uint *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); puStack_18 = &LAB_00b10eca; local_1c = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_38 = (byte *)0x0; local_34 = (byte *)0x0; local_30 = 0; local_14 = 0; uVar9 = 0; puVar4 = (undefined1 *)((int)register0x00000010 + -4); if (DAT_00c379ec - DAT_00c379e8 >> 2 != 0) { do { pbVar6 = path_join(param_1,*(byte **)(*(int *)(DAT_00c379e8 + uVar9 * 4) + 0xc),0,1); (**(code **)(PTR_vftable_00c379e0 + 0x20))(pbVar6,&local_38,uVar5); if (pbVar6 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)(pbVar6 + -4); qVar3 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar1; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar3 < uVar1); free(pbVar6 + -4); local_14 = local_14 & 0xffffff00; } uVar9 = uVar9 + 1; } while (uVar9 < (uint)(DAT_00c379ec - DAT_00c379e8 >> 2)); puVar4 = puStack_20; } puStack_20 = puVar4; uVar9 = (int)local_34 - (int)local_38 >> 3; local_24 = (uint *)0x0; uVar5 = -(uint)((int)((ulonglong)uVar9 * 8 >> 0x20) != 0) | (uint)((ulonglong)uVar9 * 8); local_28 = uVar9; local_2c = operator_new_tracked(-(uint)(0xfffffffb < uVar5) | uVar5 + 4); local_14 = CONCAT31(local_14._1_3_,2); if (local_2c == (uint *)0x0) { local_24 = (uint *)0x0; } else { *local_2c = uVar9; local_24 = local_2c + 1; _eh_vector_constructor_iterator_ (local_24,8,uVar9,(_func_void_void_ptr *)&LAB_00a5a410,FUN_00a5a420); } pbVar6 = local_34; uVar5 = 0; iVar7 = (int)local_34 - (int)local_38 >> 3; *param_2 = iVar7; if (iVar7 != 0) { do { local_24[uVar5 * 2 + 1] = *(uint *)(local_38 + uVar5 * 8 + 4); *(byte *)(local_24 + uVar5 * 2) = local_38[uVar5 * 8] & 0xef; uVar5 = uVar5 + 1; } while (uVar5 < (uint)((int)local_34 - (int)local_38 >> 3)); } pbVar2 = local_38; if (local_38 != (byte *)0x0) { for (; pbVar2 != pbVar6; pbVar2 = pbVar2 + 8) { if (((*pbVar2 & 4) == 0) && (iVar7 = *(int *)(pbVar2 + 4), iVar7 != 0)) { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar7 + -4); qVar3 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar5; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar3 < uVar5); free((void *)(iVar7 + -4)); pbVar2[4] = 0; pbVar2[5] = 0; pbVar2[6] = 0; pbVar2[7] = 0; } } uVar5 = local_30 - (int)local_38 & 0xfffffff8; pbVar6 = local_38; if (0xfff < uVar5) { pbVar6 = *(byte **)(local_38 + -4); uVar5 = uVar5 + 0x23; if ((byte *)0x1f < local_38 + (-4 - (int)pbVar6)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar6,uVar5); } ExceptionList = local_1c; return local_24; } //@@ 00a16610 filesys_list_directory /* DB: (dir, pattern, int* count) -> new[] of 8-byte {flags & ~0x10, name} entries: calls platform filesystem vfunc +0x20 (PTR_vftable_00c379e0) to list, copies entries, frees the temp; ModManager::ListMods on the mods dir, FUN_00903d60 on g_userDataDir */ uint * filesys_list_directory(byte *param_1,byte *param_2,int *param_3) { byte *pbVar1; qword qVar2; uint uVar3; byte *pbVar4; uint *puVar5; int iVar6; qword *pqVar7; uint *puVar8; uint uVar9; byte *local_1c; byte *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b10f2a; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_1c = (byte *)0x0; local_18 = (byte *)0x0; local_14 = 0; local_8 = 0; pbVar4 = path_join(param_2,param_1,0,1); (**(code **)(PTR_vftable_00c379e0 + 0x20))(pbVar4,&local_1c,uVar3); if (pbVar4 != (byte *)0x0) { local_8._0_1_ = 1; tracked_alloc(1,pbVar4,0); local_8 = (uint)local_8._1_3_ << 8; } uVar9 = (int)local_18 - (int)local_1c >> 3; uVar3 = -(uint)((int)((ulonglong)uVar9 * 8 >> 0x20) != 0) | (uint)((ulonglong)uVar9 * 8); puVar5 = operator_new_tracked(-(uint)(0xfffffffb < uVar3) | uVar3 + 4); local_8 = CONCAT31(local_8._1_3_,2); if (puVar5 == (uint *)0x0) { puVar8 = (uint *)0x0; } else { puVar8 = puVar5 + 1; *puVar5 = uVar9; _eh_vector_constructor_iterator_ (puVar8,8,uVar9,(_func_void_void_ptr *)&LAB_00a5a410,FUN_00a5a420); } pbVar4 = local_18; uVar3 = 0; iVar6 = (int)local_18 - (int)local_1c >> 3; *param_3 = iVar6; if (iVar6 != 0) { do { puVar8[uVar3 * 2 + 1] = *(uint *)(local_1c + uVar3 * 8 + 4); *(byte *)(puVar8 + uVar3 * 2) = local_1c[uVar3 * 8] & 0xef; uVar3 = uVar3 + 1; } while (uVar3 < (uint)((int)local_18 - (int)local_1c >> 3)); } pbVar1 = local_1c; if (local_1c != (byte *)0x0) { for (; pbVar1 != pbVar4; pbVar1 = pbVar1 + 8) { if (((*pbVar1 & 4) == 0) && (iVar6 = *(int *)(pbVar1 + 4), iVar6 != 0)) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar6 + -4); qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar3; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar2 < uVar3); free((void *)(iVar6 + -4)); pbVar1[4] = 0; pbVar1[5] = 0; pbVar1[6] = 0; pbVar1[7] = 0; } } uVar3 = local_14 - (int)local_1c & 0xfffffff8; pbVar4 = local_1c; if (0xfff < uVar3) { pbVar4 = *(byte **)(local_1c + -4); uVar3 = uVar3 + 0x23; if ((byte *)0x1f < local_1c + (-4 - (int)pbVar4)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar4,uVar3); } ExceptionList = local_10; return puVar8; } //@@ 00a167d0 FileSystem::load_mount_points /* DB: opens "kage_mount_points.dat" via FileSystem::Open (falls back to a KAGE::Filesys::File at a path_join path) and registers the mount points; called at startup (009aa040 before the version log) and by FUN_00a15d90 prototype: db/protos.zhl */ void __thiscall FileSystem::load_mount_points(void *this) { undefined4 *puVar1; uint uVar2; qword qVar3; byte bVar4; char cVar5; uint uVar6; int *piVar7; byte *pbVar8; int iVar9; int iVar10; undefined4 *puVar11; qword *pqVar12; uint uVar13; void *pvVar14; code *pcVar15; int *piVar16; int *piVar17; byte *local_40; undefined4 local_3c; undefined4 *local_38; byte *local_34; void *local_30; undefined4 *local_2c; undefined4 *local_28; int local_24; byte *local_20; void *local_1c; uint local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10f7f; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_30 = this; piVar7 = Open(&PTR_vftable_00c37a10,(byte *)"kage_mount_points.dat",(int *)0x0); local_14 = piVar7; if (piVar7 == (int *)0x0) { piVar16 = piVar7; piVar17 = piVar7; pbVar8 = (byte *)(**(code **)(*(int *)this + 0x10))(0,0,uVar6); pbVar8 = path_join((byte *)"kage_mount_points.dat",pbVar8,(byte)piVar16,(byte)piVar17); if ((pbVar8 == (byte *)0x0) || (*pbVar8 == 0)) { local_14 = piVar7; if (pbVar8 == (byte *)0x0) { ExceptionList = local_10; return; } } else { local_34 = operator_new(0x10); if (local_34 == (byte *)0x0) { local_14 = (int *)0x0; } else { *(int *)((int)local_34 + 4) = 2; *(int *)((int)local_34 + 8) = 0; *(undefined ***)local_34 = KAGE::Filesys::File::vftable; *(int *)((int)local_34 + 0xc) = 0; local_14 = (int *)local_34; } piVar7 = local_14; if (*(code **)(*local_14 + 0x24) == KAGE::Filesys::File::open) { bVar4 = KAGE::Filesys::File::open(local_14,pbVar8); } else { bVar4 = (**(code **)(*local_14 + 0x24))(); } if (bVar4 == 0) { (**(code **)*piVar7)(1); piVar7 = (int *)0x0; local_14 = (int *)0x0; } } local_8 = 0; tracked_alloc(1,pbVar8,0); local_8 = 0xffffffff; if (piVar7 == (int *)0x0) { ExceptionList = local_10; return; } } local_20 = (byte *)0x0; (**(code **)(*piVar7 + 0x14))(&local_20,4,1); local_34 = local_20; do { if (local_34 == (byte *)0x0) { ExceptionList = local_10; return; } local_24 = 0; iVar9 = (**(code **)(*piVar7 + 0x14))(&local_24,4,1); iVar10 = local_24; if (iVar9 == 4) { uVar6 = local_24 + 1; pbVar8 = operator_new_tracked(uVar6); local_20 = pbVar8; memset(pbVar8,0,uVar6); iVar9 = (**(code **)(*piVar7 + 0x14))(pbVar8,1,iVar10); if (iVar9 == iVar10) { local_18 = 0; (**(code **)(*piVar7 + 0x14))(&local_18,4,1); uVar6 = local_18; local_1c = operator_new_tracked (-(uint)((int)((ulonglong)local_18 * 4 >> 0x20) != 0) | (uint)((ulonglong)local_18 * 4)); uVar13 = 0; if (uVar6 != 0) { do { pvVar14 = (void *)0x0; local_28 = (undefined4 *)0x0; iVar10 = (**(code **)(*piVar7 + 0x14))(&local_28,4,1); local_2c = local_28; if (iVar10 == 4) { uVar6 = (int)local_28 + 1; pvVar14 = operator_new_tracked(uVar6); memset(pvVar14,0,uVar6); piVar7 = local_14; puVar11 = (undefined4 *)(**(code **)(*local_14 + 0x14))(pvVar14,1,local_2c); if ((puVar11 != local_2c) && (pvVar14 != (void *)0x0)) { local_8 = 2; tracked_alloc(1,pvVar14,0); local_8 = 0xffffffff; pvVar14 = (void *)0x0; } } *(void **)((int)local_1c + uVar13 * 4) = pvVar14; uVar13 = uVar13 + 1; } while (uVar13 < local_18); } local_3c = 0xffffffff; local_40 = path_join(local_20,&s_empty,0,1); local_8 = 3; piVar16 = *(int **)((int)local_30 + 0x18); for (piVar7 = *(int **)((int)local_30 + 0x14); piVar7 != piVar16; piVar7 = piVar7 + 1) { piVar17 = (int *)*piVar7; if ((piVar17[4] == -1) && (cVar5 = FUN_00a5a940(), pvVar14 = local_1c, cVar5 != '\0')) { if (piVar17 != (int *)0x0) { (**(code **)(*piVar17 + 4))(local_1c,local_18); goto LAB_00a16b36; } break; } } puVar11 = operator_new(0x14); local_8._0_1_ = 4; local_38 = puVar11; if (puVar11 == (undefined4 *)0x0) { local_2c = (undefined4 *)0x0; pvVar14 = local_1c; } else { puVar1 = puVar11 + 1; *puVar11 = KAGE::Filesys::FileMap::vftable; *puVar1 = 0; puVar11[2] = 0; local_2c = puVar1; pvVar14 = operator_new(0x18); *(void **)pvVar14 = pvVar14; *(void **)((int)pvVar14 + 4) = pvVar14; *(void **)((int)pvVar14 + 8) = pvVar14; *(undefined2 *)((int)pvVar14 + 0xc) = 0x101; *puVar1 = pvVar14; local_8._0_1_ = 5; *puVar11 = KAGE::Filesys::ContentManagerBase::ContentMountPoint::vftable; FUN_00a15b90(&local_40); pvVar14 = local_1c; local_8._0_1_ = 6; FUN_00a68590(local_1c,local_18); local_2c = puVar11; } local_8 = CONCAT31(local_8._1_3_,3); puVar11 = *(undefined4 **)((int)local_30 + 0x18); if (puVar11 == *(undefined4 **)((int)local_30 + 0x1c)) { std::vector<4byte>::_Emplace_reallocate(puVar11,&local_2c); } else { *puVar11 = local_2c; *(int *)((int)local_30 + 0x18) = *(int *)((int)local_30 + 0x18) + 4; } LAB_00a16b36: uVar6 = local_18; uVar13 = 0; if (local_18 != 0) { do { iVar10 = *(int *)((int)pvVar14 + uVar13 * 4); if (iVar10 != 0) { if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar10 + -4); qVar3 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar2; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar10 + -4)); *(undefined4 *)((int)pvVar14 + uVar13 * 4) = 0; } uVar13 = uVar13 + 1; } while (uVar13 < uVar6); } if (pvVar14 == (void *)0x0) { pcVar15 = free_exref; } else { if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)((int)pvVar14 + -4); qVar3 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar6; pcVar15 = free_exref; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar3 < uVar6); free((void *)((int)pvVar14 + -4)); } local_8 = 0xffffffff; if (local_40 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)(local_40 + -4); qVar3 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar6; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar3 < uVar6); (*pcVar15)(local_40 + -4); local_40 = (byte *)0x0; } local_8 = 0xffffffff; local_3c = 0xffffffff; if (local_20 != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)(local_20 + -4); qVar3 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 - uVar6; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) - (uint)((uint)qVar3 < uVar6); (*pcVar15)(local_20 + -4); } local_8 = 0xffffffff; piVar7 = local_14; } else if (pbVar8 != (byte *)0x0) { local_8 = 1; tracked_alloc(1,pbVar8,0); local_8 = 0xffffffff; } } local_34 = local_34 + -1; } while( true ); } //@@ 00a16c60 FileSystem::find_mount /* DB: (path, bool* isArchive) -> mount: walks the mount vector this+8..+0xc from last to first, checks archive (open_archive_file with null out, sets *isArchive=1) and each mount's path-hash map; FileSystem::ResolvePath */ undefined4 FileSystem::find_mount(byte *param_1,undefined1 *param_2) { int iVar1; uint uVar2; qword qVar3; byte bVar4; byte *name; byte *path; int *piVar5; int in_ECX; qword *pqVar6; int iVar7; undefined1 local_20 [8]; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10fa0; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; name = path_join(param_1,(byte *)0x0,0,0); iVar7 = (*(int *)(in_ECX + 0xc) - *(int *)(in_ECX + 8) >> 2) + -1; if (-1 < iVar7) { while( true ) { if (DAT_00c37b14 != 0) { path = path_join(name,*(byte **)(*(int *)(*(int *)(in_ECX + 8) + iVar7 * 4) + 0xc),0,0); bVar4 = open_archive_file(&PTR_vftable_00c37a10,path,(void **)0x0); param_1 = (byte *)CONCAT13(bVar4,param_1._0_3_); if (path != (byte *)0x0) { operator_delete(path,1); bVar4 = param_1._3_1_; } if (bVar4 != 0) { iVar1 = *(int *)(local_14 + 8); *param_2 = 1; ExceptionList = local_10; return *(undefined4 *)(iVar1 + iVar7 * 4); } in_ECX = local_14; } iVar1 = *(int *)(*(int *)(in_ECX + 8) + iVar7 * 4); param_1 = (byte *)KAGE_Filesys_FileManager::GetPrimaryFilePathHash(name); _Find_lower_bound<>(local_20,¶m_1); if (((*(char *)(local_18 + 0xd) == '\0') && (*(byte **)(local_18 + 0x10) <= param_1)) && (local_18 != *(int *)(iVar1 + 4))) { piVar5 = map_find_value((void *)(iVar1 + 4),(uint)¶m_1); if (*piVar5 != 0) { if (name != (byte *)0x0) { local_8 = 0; tracked_alloc(1,name,0); } *param_2 = 0; ExceptionList = local_10; return *(undefined4 *)(*(int *)(local_14 + 8) + iVar7 * 4); } } iVar7 = iVar7 + -1; if (iVar7 < 0) break; in_ECX = local_14; } } if (name != (byte *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(name + -4); qVar3 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar2; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar3 < uVar2); free(name + -4); } ExceptionList = local_10; return 0; } //@@ 00a16e00 FUN_00a16e00 int FUN_00a16e00(void) { int *piVar1; int iVar2; int iVar3; char cVar4; int in_ECX; int *in_EDX; int *piVar5; piVar5 = (int *)*in_EDX; piVar1 = (int *)in_EDX[1]; if (piVar5 != piVar1) { iVar2 = *(int *)(in_ECX + 4); do { iVar3 = *piVar5; if ((*(int *)(iVar3 + 0x10) == iVar2) && (cVar4 = FUN_00a5a940(), cVar4 != '\0')) { return iVar3; } piVar5 = piVar5 + 1; } while (piVar5 != piVar1); } return 0; } //@@ 00a16e60 FUN_00a16e60 void FUN_00a16e60(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_00a16ec0(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00a16ec0 FUN_00a16ec0 void FUN_00a16ec0(void) { int iVar1; uint uVar2; qword qVar3; void **ppvVar4; byte *in_ECX; byte *in_EDX; qword *pqVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1360; ppvVar4 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar4, in_ECX != in_EDX; in_ECX = in_ECX + 8) { if (((*in_ECX & 4) == 0) && (iVar1 = *(int *)(in_ECX + 4), iVar1 != 0)) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; } ppvVar4 = ExceptionList; } ExceptionList = local_10; return; } //@@ 00a16f50 opendir /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: dirent.h for Windows (opendir with _wopendir inlined): mbstowcs_s path, GetFullPathNameW, FindFirstFileW into a DIR struct (handle at +0x46c); only caller win32_opendir */ void * opendir(void) { WCHAR WVar1; void *pvVar2; errno_t eVar3; void *pvVar4; DWORD DVar5; LPCWSTR pWVar6; HANDLE pvVar7; char *in_ECX; LPWIN32_FIND_DATAW lpFindFileData; code *pcVar8; size_t local_220; LPCWSTR local_21c; DWORD local_218; code *local_214; wchar_t local_210 [260]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_210 + 0x106); if ((in_ECX == (char *)0x0) || (*in_ECX == '\0')) { _set_errno(2); return (void *)0x0; } pvVar2 = malloc(0x118); if (pvVar2 == (void *)0x0) { return (void *)0x0; } eVar3 = mbstowcs_s(&local_220,local_210,0x104,in_ECX,0x104); pcVar8 = free_exref; local_214 = free_exref; if (eVar3 != 0) goto LAB_00a17132; if (local_210[0] == L'\0') { _set_errno(2); LAB_00a17123: pvVar4 = (void *)0x0; } else { pvVar4 = malloc(0x474); if (pvVar4 != (void *)0x0) { *(undefined4 *)((int)pvVar4 + 0x46c) = 0xffffffff; *(undefined4 *)((int)pvVar4 + 0x468) = 0; local_218 = GetFullPathNameW(local_210,0,(LPWSTR)0x0,(LPWSTR *)0x0); local_21c = malloc(local_218 * 2 + 0x10); *(LPCWSTR *)((int)pvVar4 + 0x470) = local_21c; if (local_21c != (LPWSTR)0x0) { DVar5 = GetFullPathNameW(local_210,local_218,local_21c,(LPWSTR *)0x0); if (DVar5 == 0) { _set_errno(2); } else { pWVar6 = local_21c + DVar5; if ((((local_21c < pWVar6) && (WVar1 = pWVar6[-1], WVar1 != L'/')) && (WVar1 != L':')) && (WVar1 != L'\\')) { *pWVar6 = L'\\'; pWVar6 = pWVar6 + 1; } lpFindFileData = (LPWIN32_FIND_DATAW)((int)pvVar4 + 0x218); pWVar6[0] = L'*'; pWVar6[1] = L'\0'; pvVar7 = FindFirstFileW(local_21c,lpFindFileData); *(HANDLE *)((int)pvVar4 + 0x46c) = pvVar7; if (pvVar7 == (HANDLE)0xffffffff) { lpFindFileData = (LPWIN32_FIND_DATAW)0x0; } *(uint *)((int)pvVar4 + 0x468) = (uint)(pvVar7 != (HANDLE)0xffffffff); if (lpFindFileData != (LPWIN32_FIND_DATAW)0x0) { pcVar8 = local_214; goto LAB_00a17128; } _set_errno(2); if (*(HANDLE *)((int)pvVar4 + 0x46c) != (HANDLE)0xffffffff) { FindClose(*(HANDLE *)((int)pvVar4 + 0x46c)); *(undefined4 *)((int)pvVar4 + 0x46c) = 0xffffffff; } pcVar8 = local_214; } } if (*(int *)((int)pvVar4 + 0x470) != 0) { (*pcVar8)(*(int *)((int)pvVar4 + 0x470)); *(undefined4 *)((int)pvVar4 + 0x470) = 0; } (*pcVar8)(pvVar4); goto LAB_00a17123; } } LAB_00a17128: *(void **)((int)pvVar2 + 0x114) = pvVar4; if (pvVar4 != (void *)0x0) { return pvVar2; } LAB_00a17132: (*pcVar8)(pvVar2); return (void *)0x0; } //@@ 00a17170 FUN_00a17170 byte * FUN_00a17170(void) { return &s_empty; } //@@ 00a17180 FileSystem::ResolvePath /* DB: src/anm2 decompile labels (FileSystem::ResolvePath) prototype: db/protos.zhl, confirmed by RET 4 */ byte * FileSystem::ResolvePath(byte *path) { byte bVar1; char cVar2; uint uVar3; byte *pbVar4; int iVar5; byte *pbVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; pbVar4 = path; local_8 = 0xffffffff; puStack_c = &LAB_00b10fc0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (path != (byte *)0x0) { pbVar6 = path; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); if (((2 < (uint)((int)pbVar6 - (int)(path + 1))) && (path[1] == 0x3a)) && ((path[2] == 0x5c || (path[2] == 0x2f)))) { pbVar4 = path_join(path,(byte *)0x0,0,0); cVar2 = file_exists(uVar3); if ((cVar2 == '\0') && (pbVar4 != (byte *)0x0)) { local_8 = 0; tracked_alloc(1,pbVar4,0); pbVar4 = (byte *)0x0; } ExceptionList = local_10; return pbVar4; } } path = (byte *)((uint)path & 0xffffff); iVar5 = find_mount(pbVar4,(int)&path + 3); if (iVar5 == 0) { ExceptionList = local_10; return (byte *)0x0; } if (path._3_1_ != '\0') { pbVar4 = path_join(pbVar4,*(byte **)(iVar5 + 0xc),0,0); ExceptionList = local_10; return pbVar4; } pbVar4 = path_join(pbVar4,(byte *)0x0,0,0); pbVar6 = (byte *)FUN_00a68790(pbVar4); if (pbVar4 != (byte *)0x0) { local_8 = 1; tracked_alloc(1,pbVar4,0); local_8 = 0xffffffff; } pbVar4 = path_join(pbVar6,*(byte **)(iVar5 + 0xc),0,0); ExceptionList = local_10; return pbVar4; } //@@ 00a172e0 win32_opendir /* DB: ? (path, flags): treats ""/"./" as cwd, FindFirstFile/FindClose with handle +0x46c, wcstombs_s entry names, dirent-style struct; callers filesys_list_directory, 00a163f0, 00a687f0 prototype: db/protos.zhl, confirmed by RET 8 */ void win32_opendir(byte *path,int flags) { char cVar1; byte bVar2; void *_Memory; undefined2 uVar3; uint uVar4; undefined4 *_Memory_00; int iVar5; errno_t eVar6; byte *pbVar7; char *pcVar8; byte *pbVar9; byte *pbVar10; int iVar11; bool bVar12; byte local_20 [4]; byte *local_1c; size_t local_18; code *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10fed; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; if ((path == (byte *)0x0) || (*path == 0)) { bVar12 = true; } else { bVar12 = false; } pbVar10 = &DAT_00b7ded4; if (!bVar12) { pbVar10 = path; } if (DAT_00c5aa98 != (char *)0x0) { pcVar8 = DAT_00c5aa98; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); if (pcVar8 != DAT_00c5aa98 + 1) { pcVar8 = DAT_00c5aa98; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); strncmp(DAT_00c5aa98,(char *)pbVar10,(int)pcVar8 - (int)(DAT_00c5aa98 + 1)); } } _Memory_00 = (undefined4 *)opendir(uVar4); if (_Memory_00 == (undefined4 *)0x0) { ExceptionList = local_10; return; } local_14 = FindNextFileW_exref; do { iVar11 = _Memory_00[0x45]; if (*(int *)(iVar11 + 0x468) == 0) { if (*(int *)(iVar11 + 0x46c) == -1) goto LAB_00a175a8; iVar5 = (*local_14)(*(int *)(iVar11 + 0x46c),iVar11 + 0x218); if (iVar5 == 0) { FindClose(*(HANDLE *)(iVar11 + 0x46c)); *(undefined4 *)(iVar11 + 0x46c) = 0xffffffff; LAB_00a175a8: _Memory = (void *)_Memory_00[0x45]; if (_Memory == (void *)0x0) { _set_errno(9); } else { if (*(HANDLE *)((int)_Memory + 0x46c) != (HANDLE)0xffffffff) { FindClose(*(HANDLE *)((int)_Memory + 0x46c)); *(undefined4 *)((int)_Memory + 0x46c) = 0xffffffff; } if (*(void **)((int)_Memory + 0x470) != (void *)0x0) { free(*(void **)((int)_Memory + 0x470)); *(undefined4 *)((int)_Memory + 0x470) = 0; } free(_Memory); } _Memory_00[0x45] = 0; free(_Memory_00); ExceptionList = local_10; return; } } else { *(undefined4 *)(iVar11 + 0x468) = 0; } if ((uint *)(iVar11 + 0x218) == (uint *)0x0) goto LAB_00a175a8; pbVar10 = (byte *)(_Memory_00 + 4); eVar6 = wcstombs_s(&local_18,(char *)pbVar10,0x104,(wchar_t *)(iVar11 + 0x244),0x104); if ((eVar6 == 0) || ((*(short *)(iVar11 + 0x44c) != 0 && (eVar6 = wcstombs_s(&local_18,(char *)pbVar10,0x104,(wchar_t *)(iVar11 + 0x44c),0x104), eVar6 == 0)))) { _Memory_00[2] = local_18 - 1; uVar4 = *(uint *)(iVar11 + 0x218); if ((uVar4 & 0x40) == 0) { if ((uVar4 & 0x10) == 0) { _Memory_00[3] = 0x8000; iVar11 = 0x8000; } else { _Memory_00[3] = 0x4000; iVar11 = 0x4000; } } else { _Memory_00[3] = 0x2000; iVar11 = 0x2000; } uVar3 = 0x114; } else { uVar3 = 0; *pbVar10 = 0x3f; *(undefined1 *)((int)_Memory_00 + 0x11) = 0; iVar11 = 0; _Memory_00[2] = 1; _Memory_00[3] = 0; } *_Memory_00 = 0; pbVar9 = &DAT_00b1cebc; *(undefined2 *)(_Memory_00 + 1) = uVar3; pbVar7 = pbVar10; do { bVar2 = *pbVar7; bVar12 = bVar2 < *pbVar9; if (bVar2 != *pbVar9) { LAB_00a174a0: uVar4 = -(uint)bVar12 | 1; goto LAB_00a174a5; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar12 = bVar2 < pbVar9[1]; if (bVar2 != pbVar9[1]) goto LAB_00a174a0; pbVar7 = pbVar7 + 2; pbVar9 = pbVar9 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00a174a5: if (uVar4 != 0) { pbVar9 = &DAT_00b1ceb8; pbVar7 = pbVar10; do { bVar2 = *pbVar7; bVar12 = bVar2 < *pbVar9; if (bVar2 != *pbVar9) { LAB_00a174e0: uVar4 = -(uint)bVar12 | 1; goto LAB_00a174e5; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar12 = bVar2 < pbVar9[1]; if (bVar2 != pbVar9[1]) goto LAB_00a174e0; pbVar7 = pbVar7 + 2; pbVar9 = pbVar9 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_00a174e5: if (uVar4 != 0) { local_1c = path_join(pbVar10,(byte *)0x0,0,0); local_20[0] = (iVar11 == 0x4000) + 5; local_8 = 0; pbVar10 = *(byte **)(flags + 4); if (pbVar10 == *(byte **)(flags + 8)) { FUN_00a17630(pbVar10,local_20); } else { *pbVar10 = local_20[0]; *(byte **)(pbVar10 + 4) = local_1c; *(int *)(flags + 4) = *(int *)(flags + 4) + 8; } local_8 = 0xffffffff; if (((local_20[0] & 4) == 0) && (local_1c != (byte *)0x0)) { local_8 = 1; tracked_alloc(1,local_1c,0); local_8 = 0xffffffff; local_1c = (byte *)0x0; } } } } while( true ); } //@@ 00a17630 FUN_00a17630 undefined1 * FUN_00a17630(undefined1 *param_1,undefined1 *param_2) { uint uVar1; undefined1 *puVar2; int iVar3; undefined1 *puVar4; void *pvVar5; undefined1 *puVar6; int iVar7; undefined1 *puVar8; void *ptr; int *in_ECX; uint uVar9; uint uVar10; undefined1 *puVar11; iVar3 = *in_ECX; iVar7 = in_ECX[1] - iVar3 >> 3; if (iVar7 == 0x1fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar7 + 1; uVar9 = in_ECX[2] - iVar3 >> 3; if (0x1fffffff - (uVar9 >> 1) < uVar9) { uVar10 = 0x1fffffff; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar10 = uVar1; if (uVar1 <= uVar9) { uVar10 = uVar9; } if (0x1fffffff < uVar10) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar8 = std::_Allocate(uVar10 * 8); puVar2 = puVar8 + ((int)param_1 - iVar3 >> 3) * 8; *puVar2 = *param_2; *(undefined4 *)(puVar2 + 4) = *(undefined4 *)(param_2 + 4); puVar4 = (undefined1 *)in_ECX[1]; puVar11 = (undefined1 *)*in_ECX; puVar6 = puVar8; if (param_1 == puVar4) { for (; puVar11 != puVar4; puVar11 = puVar11 + 8) { *puVar6 = *puVar11; *(undefined4 *)(puVar6 + 4) = *(undefined4 *)(puVar11 + 4); puVar6 = puVar6 + 8; } FUN_00a16ec0(puVar6); } else { FUN_00a17780(puVar11,param_1,puVar8); FUN_00a17780(param_1,in_ECX[1],puVar2 + 8); } if (*in_ECX != 0) { FUN_00a16ec0(*in_ECX); pvVar5 = (void *)*in_ECX; uVar9 = in_ECX[2] - (int)pvVar5 & 0xfffffff8; ptr = pvVar5; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar5 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar5 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)puVar8; in_ECX[1] = (int)(puVar8 + uVar1 * 8); in_ECX[2] = (int)(puVar8 + uVar10 * 8); return puVar2; } //@@ 00a17780 FUN_00a17780 undefined1 * FUN_00a17780(undefined1 *param_1,undefined1 *param_2,undefined1 *param_3) { undefined1 uVar1; undefined1 *puVar2; undefined1 *puVar3; puVar2 = param_1; puVar3 = param_3; if (param_1 != param_2) { do { uVar1 = *puVar2; puVar2 = puVar2 + 8; *puVar3 = uVar1; *(undefined4 *)(puVar3 + 4) = *(undefined4 *)(puVar3 + (int)(param_1 + (4 - (int)param_3))); puVar3 = puVar3 + 8; } while (puVar2 != param_2); } FUN_00a16ec0(puVar2); return puVar3; } //@@ 00a177c0 FUN_00a177c0 void FUN_00a177c0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Filesys::Manager::vftable; FUN_00a177f0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x20108); } return; } //@@ 00a177f0 FUN_00a177f0 void FUN_00a177f0(void) { int in_ECX; undefined4 *puVar1; uint uVar2; int iVar3; uVar2 = 0; if (*(int *)(in_ECX + 0x104) != 0) { puVar1 = (undefined4 *)(in_ECX + 4); do { if ((void *)*puVar1 != (void *)0x0) { operator_delete((void *)*puVar1,1); *puVar1 = 0; } uVar2 = uVar2 + 1; puVar1 = puVar1 + 2; } while (uVar2 < *(uint *)(in_ECX + 0x104)); } puVar1 = (undefined4 *)(in_ECX + 0x108); iVar3 = 0x8000; do { if ((void *)*puVar1 != (void *)0x0) { operator_delete((void *)*puVar1,0x1c); *puVar1 = 0; } puVar1 = puVar1 + 1; iVar3 = iVar3 + -1; } while (iVar3 != 0); *(undefined4 *)(in_ECX + 0x104) = 0; return; } //@@ 00a17860 file_exists /* DB: FileSystem::ResolvePath(path) != 0 (frees the resolved buffer via tracked_alloc(0,0)); anm2_resolve_spritesheet_path, costume_path_apply_skin_color, ModManager::LoadModContent prototype: db/protos.zhl, confirmed by RET 4 */ byte file_exists(byte *path) { byte *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; ExceptionList = &local_10; ptr = FileSystem::ResolvePath(path); if (ptr != (byte *)0x0) { local_8 = 0; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return ptr != (byte *)0x0; } //@@ 00a178d0 FileSystem::Open /* DB: src/rooms decompile labels (FileSystem::Open) prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall FileSystem::Open(void *this,byte *path,int *outResolvedPath) { byte *pbVar1; void *local_10; undefined1 *puStack_c; int *local_8; pbVar1 = path; local_8 = (int *)0xffffffff; puStack_c = &LAB_00af0b60; local_10 = ExceptionList; if ((path == (byte *)0x0) || (*path == 0)) { return (void *)0x0; } path = (byte *)0x0; ExceptionList = &local_10; pbVar1 = ResolvePath(pbVar1); open_archive_file(this,pbVar1,&path); if (path == (byte *)0x0) { open_disk_file(pbVar1,&path); if (outResolvedPath == (int *)0x0) { if (pbVar1 == (byte *)0x0) { ExceptionList = local_10; return path; } local_8 = (int *)0x1; LAB_00a1795c: tracked_alloc(1,pbVar1,0); ExceptionList = local_10; return path; } } else if (outResolvedPath == (int *)0x0) { if (pbVar1 == (byte *)0x0) { ExceptionList = local_10; return path; } local_8 = outResolvedPath; goto LAB_00a1795c; } *outResolvedPath = (int)pbVar1; ExceptionList = local_10; return path; } //@@ 00a179c0 KAGE_Filesys_FileManager::LoadArchiveFile /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: REPENTOGON KAGE_Filesys_FileManager.zhl static LoadArchiveFile(char* path, int, ushort): same 0xe64 frame (sub esp,0xe64 matches the zhl sig prefix) and 3 args pushed (dword, dword, word) by FontKerningPair::IsaacStartup; strings "Failed to open archive file '%s'", "Cannot load archive file '%s', maximum number of archive files exceeded", "hash table is full"; FileSystem::open_archive_file */ void KAGE_Filesys_FileManager::LoadArchiveFile(byte *param_1,uint *param_2,ushort param_3) { byte bVar1; undefined1 uVar2; uint uVar3; byte *ptr; byte *pbVar4; uint uVar5; uint *ptr_00; byte *pbVar6; int iVar7; int *piVar8; uint uVar9; int iVar10; bool bVar11; char *format; uint local_e64; undefined4 local_e60; byte *local_e5c; int local_e58; int *local_e54; undefined1 local_e4d; uint local_e4c; int local_e48 [3]; int local_e3c; int local_21c [128]; undefined1 local_1c [7]; undefined1 local_15; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11020; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; local_e5c = param_1; local_14 = uVar3; ptr = FileSystem::ResolvePath(param_1); if (ptr == (byte *)0x0) { KAGE_LogMessage(8,(byte *)"Failed to open archive file \'%s\'\n"); } else { uVar9 = 0; local_e64 = 0; if (DAT_00c37b14 != 0) { do { pbVar4 = (byte *)(&DAT_00c37a14)[uVar9 * 2]; pbVar6 = ptr; do { bVar1 = *pbVar4; bVar11 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_00a17a60: uVar5 = -(uint)bVar11 | 1; goto LAB_00a17a65; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar11 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_00a17a60; pbVar4 = pbVar4 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00a17a65: } while ((uVar5 != 0) && (uVar9 = uVar9 + 1, uVar9 < DAT_00c37b14)); local_e64 = uVar9; if (0x1f < uVar9) { KAGE_LogMessage(8,(byte *) "Cannot load archive file \'%s\', maximum number of archive files exceeded\n" ); local_8 = 0; tracked_alloc(1,ptr,0); ExceptionList = local_10; return; } } (&DAT_00c37a14)[local_e64 * 2] = ptr; local_e54 = (int *)0x0; FileSystem::open_disk_file(ptr,&local_e54); if ((local_e54 == (int *)0x0) && (FileSystem::open_archive_file (&PTR_vftable_00c37a10,(byte *)(&DAT_00c37a14)[local_e64 * 2],&local_e54), local_e54 == (int *)0x0)) { KAGE_LogMessage(8,(byte *)"Failed to open archive file \'%s\'\n"); if ((void *)(&DAT_00c37a14)[local_e64 * 2] == (void *)0x0) { ExceptionList = local_10; return; } local_8 = 1; tracked_alloc(1,(void *)(&DAT_00c37a14)[local_e64 * 2],0); (&DAT_00c37a14)[local_e64 * 2] = 0; ExceptionList = local_10; return; } piVar8 = local_e54; (**(code **)(*local_e54 + 0x14))(local_1c,1,7,uVar3); local_15 = 0; local_e4d = 0; (**(code **)(*piVar8 + 0x14))(&local_e4d,1,1); (&DAT_00c37a18)[local_e64 * 8] = local_e4d; local_e58 = 0; (**(code **)(*piVar8 + 0x14))(&local_e58,4,1); local_e60 = 0; (**(code **)(*piVar8 + 0x14))(&local_e60,2,1); (**(code **)(*piVar8 + 0xc))(local_e58,0); local_e58 = 0; if ((ushort)local_e60 != 0) { do { ptr_00 = operator_new(0x1c); piVar8 = local_e54; local_e4c = 0; *ptr_00 = local_e64; (**(code **)(*local_e54 + 0x14))(&local_e4c,4,1); ptr_00[1] = local_e4c; local_e4c = 0; (**(code **)(*piVar8 + 0x14))(&local_e4c,4,1); ptr_00[2] = local_e4c; local_e4c = 0; (**(code **)(*piVar8 + 0x14))(&local_e4c,4,1); ptr_00[3] = local_e4c; local_e4c = 0; (**(code **)(*piVar8 + 0x14))(&local_e4c,4,1); ptr_00[4] = local_e4c; local_e4c = 0; (**(code **)(*piVar8 + 0x14))(&local_e4c,4,1); ptr_00[5] = local_e4c; if (((ushort)local_e58 < param_3) && (*param_2 == local_e4c)) { uVar2 = 1; } else { uVar2 = 0; } *(undefined1 *)(ptr_00 + 6) = uVar2; FUN_00a68a50(ptr_00); local_8 = 2; uVar3 = 0xababeb98; memset(local_21c,0,0x200); local_e4c = *(uint *)(local_e3c + 0x10); do { uVar9 = local_e4c; if (0x200 < (int)local_e4c) { uVar9 = 0x200; } uVar5 = (**(code **)(local_e48[0] + 0x14))(local_21c,1,uVar9); iVar7 = 0; iVar10 = (int)(((int)(uVar5 + 3) >> 0x1f & 3U) + uVar5 + 3) >> 2; if (0 < iVar10) { do { piVar8 = local_21c + iVar7; iVar7 = iVar7 + 1; uVar3 = uVar3 * -0x80000000 + *piVar8 + (uVar3 >> 1); } while (iVar7 < iVar10); } local_e4c = local_e4c - uVar9; } while ((0 < (int)local_e4c) && (uVar5 == uVar9)); if (uVar3 == *(uint *)(local_e3c + 0x14)) { uVar9 = ptr_00[1] & 0x7fff; iVar7 = *(int *)(&DAT_00c37b18 + uVar9 * 4); uVar3 = 0; if (iVar7 != 0) { do { if (((*(uint *)(iVar7 + 4) == ptr_00[1]) && (uVar5 = uVar3, *(uint *)(iVar7 + 8) == ptr_00[2])) || (uVar5 = uVar3 + 1, 0x7fff < uVar3)) break; uVar9 = uVar9 + 1 & 0x7fff; iVar7 = *(int *)(&DAT_00c37b18 + uVar9 * 4); uVar3 = uVar5; } while (iVar7 != 0); if (0x7fff < uVar5) { format = "Failed to load file %x%x from \'%s\', hash table is full\n"; goto LAB_00a17dad; } } *(uint **)(&DAT_00c37b18 + uVar9 * 4) = ptr_00; } else { format = "Failed to load file %x%x from \'%s\', checksum is invalid\n"; LAB_00a17dad: KAGE_LogMessage(8,(byte *)format); operator_delete(ptr_00,0x1c); } local_8 = 0xffffffff; KAGE::Filesys::ArchivedFile::~ArchivedFile(local_e48); param_2 = param_2 + 1; local_e58 = local_e58 + 1; } while ((ushort)local_e58 < (ushort)local_e60); piVar8 = local_e54; } (**(code **)*piVar8)(1); if (DAT_00c37b14 < local_e64 + 1) { DAT_00c37b14 = local_e64 + 1; } } ExceptionList = local_10; return; } //@@ 00a17ea0 FileSystem::open_disk_file /* DB: (path, File** out) -> bool: without out returns a platform file-exists check (FUN_00a52540-family); else news a KAGE::Filesys::File (0x10) and calls its open vfunc +0x24, deleting on failure; FileSystem::Open fallback after open_archive_file */ bool FileSystem::open_disk_file(byte *param_1,undefined4 *param_2) { byte bVar1; undefined1 uVar2; int *this; if ((param_1 == (byte *)0x0) || (*param_1 == 0)) { return false; } if (param_2 == (undefined4 *)0x0) { uVar2 = file_exists(); return (bool)uVar2; } this = operator_new(0x10); if (this == (int *)0x0) { this = (int *)0x0; } else { this[1] = 2; this[2] = 0; *this = (int)KAGE::Filesys::File::vftable; this[3] = 0; } if (*(code **)(*this + 0x24) == KAGE::Filesys::File::open) { bVar1 = KAGE::Filesys::File::open(this,param_1); } else { bVar1 = (**(code **)(*this + 0x24))(); } if (bVar1 == 0) { (**(code **)*this)(1); this = (int *)0x0; } *param_2 = this; return this != (int *)0x0; } //@@ 00a17f40 FileSystem::open_archive_file /* DB: (path, File** out) -> bool: GetPrimaryFilePathHash(path), linear-probes the 0x8000-entry archive hash table at this+0x108 matching hash (+4) and secondary hash (+8); if out, news a 0xc2c-byte archive file (FUN_00a68a50); FileSystem::Open tries it first, then FUN_00a17ea0 prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall FileSystem::open_archive_file(void *this,byte *path,void **outFile) { uint uVar1; uint uVar2; int iVar3; void *pvVar4; undefined4 extraout_ECX; uint uVar5; uint uVar6; int iVar7; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11067; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((path != (byte *)0x0) && (*path != 0)) { uVar2 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(path); uVar6 = uVar2 & 0x7fff; iVar7 = *(int *)((int)this + uVar6 * 4 + 0x108); if (iVar7 != 0) { iVar3 = FUN_00a15ab0(extraout_ECX,uVar1); uVar1 = 0; do { if (((*(uint *)(iVar7 + 4) == uVar2) && (uVar5 = uVar1, *(int *)(iVar7 + 8) == iVar3)) || (uVar5 = uVar1 + 1, 0x7fff < uVar1)) break; uVar6 = uVar6 + 1 & 0x7fff; iVar7 = *(int *)((int)this + uVar6 * 4 + 0x108); uVar1 = uVar5; } while (iVar7 != 0); if ((*(int *)((int)this + uVar6 * 4 + 0x108) != 0) && (uVar5 < 0x8000)) { if (outFile != (void **)0x0) { pvVar4 = operator_new(0xc2c); local_8 = 0; if (pvVar4 != (void *)0x0) { pvVar4 = (void *)FUN_00a68a50(*(undefined4 *)((int)this + uVar6 * 4 + 0x108)); *outFile = pvVar4; ExceptionList = local_10; return 1; } *outFile = (void *)0x0; } ExceptionList = local_10; return 1; } } } ExceptionList = local_10; return 0; } //@@ 00a18070 FUN_00a18070 void FUN_00a18070(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ManagerOpenGL::vftable; FUN_00a12f20(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xbc); } return; } //@@ 00a180a0 FUN_00a180a0 void FUN_00a180a0(void) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ManagerOpenGL::vftable; FUN_00a12f20(); return; } //@@ 00a180b0 FUN_00a180b0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00a180b0(void) { uint uVar1; int *in_ECX; KColor local_28; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b110a4; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_28._green = 1.6908874e-38; local_28._blue = 2.83062e-43; local_28._alpha = 1.6909558e-38; local_28._unk = 0x9a; FUN_00a13fa0("KAGE_ColorShader",&PTR_s_Position_00c0f8c0,&local_28._green); local_28._green = 1.6909166e-38; local_28._blue = 3.90962e-43; local_28._alpha = 1.6910332e-38; local_28._unk = 0x10b; FUN_00a13fa0("KAGE_ColorTextureShader",&PTR_s_Position_00c0f8f0,&local_28._green); local_28._green = 1.6909166e-38; local_28._blue = 3.90962e-43; local_28._alpha = 1.6909782e-38; local_28._unk = 0x186; FUN_00a13fa0("KAGE_IndexedTextureShader",&PTR_s_Position_00c0f8f0,&local_28._green); (**(code **)(*in_ECX + 0x78))(uVar1); (**(code **)(*in_ECX + 0x18))(0,1); local_14 = operator_new(0x10); local_8 = 0; if (local_14 == (void *)0x0) { DAT_00c7367c = (void *)0x0; } else { DAT_00c7367c = KAGE::Graphics::GraphicsBufferObject::GraphicsBufferObject(local_14); } local_8 = 0xffffffff; *(undefined4 *)((int)DAT_00c7367c + 0xc) = 1; KColor::SetFromARGB(&local_28,0xff000000); (**(code **)(*in_ECX + 0x58))(local_28._red,local_28._green,local_28._blue); _DAT_00c379b4 = _DAT_00c379b4 | 1; (**(code **)(DAT_00c37990 + 4))(); _DAT_00c37984 = _DAT_00c37984 | 1; in_ECX[1] = in_ECX[1] | 1; g_imageReleaseFn = FUN_00a12240; g_renderTargetReleaseFn = FUN_00a12240; ExceptionList = local_10; return 1; } //@@ 00a18230 RenderTarget::Clear /* DB: glClear 0x4100 with clear color prototype: db/protos.zhl */ void __thiscall RenderTarget::Clear(void *this) { int extraout_ECX; int extraout_ECX_00; int unusedArg; if (*(int *)((int)this + 0x68) == 0) { (*(code *)epoxy_glClear)(0x4100); unusedArg = extraout_ECX_00; } else { (*(code *)epoxy_glClearColor)(0,0,0,0); (*(code *)epoxy_glClear)(0x4100); (*(code *)epoxy_glClearColor) (*(undefined4 *)((int)this + 8),*(undefined4 *)((int)this + 0xc), *(undefined4 *)((int)this + 0x10),*(undefined4 *)((int)this + 0x14)); unusedArg = extraout_ECX; } *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x24) = 1; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 1; *(undefined4 *)((int)this + 0x30) = 0; shader_cache_find(unusedArg); return; } //@@ 00a182c0 FUN_00a182c0 void FUN_00a182c0(char param_1) { int in_ECX; if (param_1 == '\0') { (*(code *)epoxy_glDisable)(0x8db9); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffff7; return; } (*(code *)epoxy_glEnable)(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 8; return; } //@@ 00a18300 KAGE_Graphics::SetRenderTarget /* DB: glBindFramebuffer + status logs prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall KAGE_Graphics::SetRenderTarget(void *this,void *target,byte isNoFlip) { int iVar1; *(void **)((int)this + 0x68) = target; if ((target == (void *)0x0) || (isNoFlip != 0)) { *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x20; if (target == (void *)0x0) { (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); update_depth_renderbuffer(this,0); (*(code *)epoxy_glCullFace)(0x405); (**(code **)(*(int *)this + 0x7c))(); update_projection(this); return; } } else { *(uint *)((int)this + 4) = *(uint *)((int)this + 4) & 0xffffffdf; } update_depth_renderbuffer(this,0); (*(code *)epoxy_glBindFramebuffer)(0x8d40,*(undefined4 *)((int)this + 0xac)); (*(code *)epoxy_glFramebufferTexture2D)(0x8d40,0x8ce0,0xde1,*(undefined4 *)((int)target + 0x58),0) ; (*(code *)epoxy_glCullFace)(0x404); (*(code *)epoxy_glViewport) (0,0,*(undefined4 *)((int)target + 0x10),*(undefined4 *)((int)target + 0x14)); update_projection(this); iVar1 = (*(code *)epoxy_glCheckFramebufferStatus)(0x8d40); if (iVar1 != 0x8cd5) { if (iVar1 != 0x8cd9) { if (iVar1 == 0x8cdd) { KAGE_LogMessage(8,(byte *)"GL_FRAMEBUFFER_UNSUPPORTED\n"); return; } KAGE_LogMessage(8,(byte *)"Framebuffer nok Status %x\n"); return; } (*(code *)epoxy_glFramebufferRenderbuffer)(0x8d40,0x8d00,0x8d41,0); iVar1 = (*(code *)epoxy_glCheckFramebufferStatus)(0x8d40); if (iVar1 != 0x8cd5) { KAGE_LogMessage(8,(byte *)"framebuffer still nok after detaching depth buffer, Status %x\n"); return; } } return; } //@@ 00a18460 FUN_00a18460 void FUN_00a18460(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int in_ECX; (*(code *)epoxy_glClearColor)(param_1,param_2,param_3,0x3f800000); *(undefined4 *)(in_ECX + 8) = param_1; *(undefined4 *)(in_ECX + 0xc) = param_2; *(undefined4 *)(in_ECX + 0x10) = param_3; *(undefined4 *)(in_ECX + 0x14) = 0x3f800000; *(undefined4 *)(in_ECX + 0x18) = 0; return; } //@@ 00a184e0 FUN_00a184e0 void FUN_00a184e0(void) { (*(code *)epoxy_glEnable)(0xbe2); (*(code *)epoxy_glEnable)(0xb71); (*(code *)epoxy_glEnable)(0xb44); (*(code *)epoxy_glClearDepth)(0xc08f400000000000); (*(code *)epoxy_glDepthFunc)(0x204); (*(code *)epoxy_glCullFace)(0x405); return; } //@@ 00a18530 KAGE_Graphics::update_projection /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? builds an orthographic matrix from the render target size (target +0x10/+0x14) or the screen size (this+0x9c/+0xa0) and uploads it to g_currentShader's "Transform" uniform; KAGE_Graphics::SetRenderTarget after each bind prototype: db/protos.zhl */ void __thiscall KAGE_Graphics::update_projection(void *this) { int iVar1; undefined4 uVar2; undefined4 uVar3; float fVar4; float fVar5; float local_58 [6]; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; float local_28; float local_24; undefined4 local_20; undefined4 local_1c; float local_14; local_14 = (float)(__security_cookie ^ (uint)(local_58 + 0x12)); if (g_currentShader == (void *)0x0) { return; } iVar1 = *(int *)((int)this + 0x68); if ((iVar1 == 0) || ((*(byte *)((int)this + 4) & 0x20) != 0)) { local_58[5] = *(float *)((int)this + 0xa0); if ((iVar1 != 0) && ((*(byte *)((int)this + 4) & 0x20) == 0)) goto LAB_00a185a5; local_28 = *(float *)((int)this + 0x9c) - 0.0; fVar5 = *(float *)((int)this + 0x9c) + 0.0; fVar4 = local_58[5] + 0.0; local_58[0] = 2.0 / local_28; if (iVar1 == 0) { local_58[5] = 0.0 - local_58[5]; local_24 = -fVar4 / local_58[5]; goto LAB_00a18638; } } else { local_58[5] = (float)((double)*(int *)(iVar1 + 0x14) + __uint_to_double_fixup[-(*(int *)(iVar1 + 0x14) >> 0x1f)]); LAB_00a185a5: fVar4 = local_58[5] + 0.0; fVar5 = (float)((double)*(int *)(iVar1 + 0x10) + __uint_to_double_fixup[-(*(int *)(iVar1 + 0x10) >> 0x1f)]); local_28 = fVar5 - 0.0; fVar5 = fVar5 + 0.0; local_58[0] = 2.0 / local_28; } local_58[5] = local_58[5] - 0.0; local_24 = -fVar4 / local_58[5]; LAB_00a18638: local_58[5] = 2.0 / local_58[5]; local_28 = -fVar5 / local_28; local_1c = 0x3f800000; local_20 = 0x80000000; local_38 = 0; local_34 = 0; local_2c = 0; local_30 = 0xba83126f; local_58[4] = 0.0; local_40 = 0; local_3c = 0; local_58[1] = 0.0; local_58[2] = 0.0; local_58[3] = 0.0; uVar2 = *(undefined4 *)((int)g_currentShader + 0x4c); uVar3 = (*(code *)epoxy_glGetUniformLocation)(uVar2,"Transform"); (*(code *)epoxy_glUseProgram)(uVar2); (*(code *)epoxy_glUniformMatrix4fv)(uVar3,1,0,local_58); return; } //@@ 00a186f0 FUN_00a186f0 void FUN_00a186f0(void) { float fVar1; float fVar2; undefined *puVar3; Vector *pVVar4; undefined4 uVar5; undefined4 uVar6; int *in_ECX; puVar3 = epoxy_glViewport; pVVar4 = &g_vectorZero; if ((*(byte *)(in_ECX + 1) & 0x40) != 0) { pVVar4 = (Vector *)(in_ECX + 0x29); } fVar1 = pVVar4->x; fVar2 = pVVar4->y; uVar5 = (**(code **)(*in_ECX + 0x34))(); uVar6 = (**(code **)(*in_ECX + 0x30))(); (*(code *)puVar3)((int)fVar1,(int)fVar2,uVar6,uVar5); return; } //@@ 00a18750 KAGE_Graphics::update_depth_renderbuffer /* DB: ? thiscall graphics: size = this[0x2d]/[0x2e] or virtual getters, if not forced and existing renderbuffer (this[0x2c]) is big enough return; else deletes it, rounds w/h up to pow2 (min 8), binds framebuffer this[0x2b], glGenRenderbuffers, "Renderbuffer ID: %d size %dx%d"; KAGE_Graphics::SetRenderTarget, window resize FUN_00954150 prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall KAGE_Graphics::update_depth_renderbuffer(void *this,byte isForced) { undefined4 *puVar1; int iVar2; uint uVar3; uint uVar4; uint uVar5; byte bVar6; uint uVar7; undefined3 in_stack_00000005; undefined4 local_c; int local_8; uVar3 = *(uint *)((int)this + 0xb4); if ((int)uVar3 < 1) { uVar3 = (**(code **)(*(int *)this + 0x5c))(); } uVar4 = *(uint *)((int)this + 0xb8); if ((int)uVar4 < 1) { uVar4 = (**(code **)(*(int *)this + 0x60))(); } if ((isForced == 0) && (*(int *)((int)this + 0xb0) != 0)) { (*(code *)epoxy_glBindRenderbuffer)(0x8d41,*(int *)((int)this + 0xb0)); (*(code *)epoxy_glGetRenderbufferParameteriv)(0x8d41,0x8d42,&isForced); (*(code *)epoxy_glGetRenderbufferParameteriv)(0x8d41,0x8d43,&local_8); if (((int)uVar3 <= _isForced) && ((int)uVar4 <= local_8)) { return; } } if (*(int *)((int)this + 0xb0) != 0) { (*(code *)epoxy_glDeleteRenderbuffers)(1,(int)this + 0xb0); } if ((int)uVar3 < 9) { uVar3 = 8; uVar7 = 7; uVar5 = 4; LAB_00a18808: bVar6 = 1; do { uVar7 = uVar7 | uVar5; bVar6 = bVar6 + 1; uVar5 = uVar3 >> (bVar6 & 0x1f); } while (uVar5 != 0); } else { uVar7 = uVar3 - 1; uVar5 = uVar3 >> 1; if (uVar5 != 0) goto LAB_00a18808; } _isForced = uVar7 + 1; if ((int)uVar4 < 9) { uVar4 = 8; uVar3 = 7; uVar7 = 4; } else { uVar3 = uVar4 - 1; uVar7 = uVar4 >> 1; if (uVar7 == 0) goto LAB_00a18850; } bVar6 = 1; do { uVar3 = uVar3 | uVar7; bVar6 = bVar6 + 1; uVar7 = uVar4 >> (bVar6 & 0x1f); } while (uVar7 != 0); LAB_00a18850: (*(code *)epoxy_glGetIntegerv)(0x8ca6,&local_c); (*(code *)epoxy_glBindFramebuffer)(0x8d40,*(undefined4 *)((int)this + 0xac)); puVar1 = (undefined4 *)((int)this + 0xb0); (*(code *)epoxy_glGenRenderbuffers)(1,puVar1); iVar2 = _isForced; KAGE_LogMessage(1,(byte *)"Renderbuffer ID: %d size %dx%d\n"); (*(code *)epoxy_glBindRenderbuffer)(0x8d41,*puVar1); (*(code *)epoxy_glRenderbufferStorage)(0x8d41,0x81a6,iVar2,uVar3 + 1); (*(code *)epoxy_glFramebufferRenderbuffer)(0x8d40,0x8d00,0x8d41,*puVar1); (*(code *)epoxy_glBindFramebuffer)(0x8d40,local_c); return; } //@@ 00a188f0 FUN_00a188f0 void FUN_00a188f0(undefined4 param_1) { undefined *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; puVar1 = epoxy_glBlendEquation; switch(param_1) { case 0: uVar2 = 0x8006; break; case 1: uVar2 = 0x800a; break; case 2: uVar2 = 0x800b; break; case 3: uVar2 = 0x8007; break; case 4: uVar2 = 0x8008; break; default: KAGE_LogMessage(0x10,(byte *)"Unknwon blend function specified\n"); uVar2 = 0xffffffff; } (*(code *)puVar1)(uVar2); puVar1 = epoxy_glBlendFuncSeparate; uVar2 = FUN_00a18a20(); uVar3 = FUN_00a18a20(); uVar4 = FUN_00a18a20(); uVar5 = FUN_00a18a20(); (*(code *)puVar1)(uVar5,uVar4,uVar3,uVar2); return; } //@@ 00a189a0 FUN_00a189a0 void FUN_00a189a0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { if (g_currentShader == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"No shader set\n"); } (**(code **)(*(int *)g_currentShader + 0x20))(param_1,param_2,param_3); (*(code *)epoxy_glDrawElements)(4,param_5,0x1403,param_4); (**(code **)(*(int *)g_currentShader + 0x24))(param_1,param_2,param_3); return; } //@@ 00a18a20 FUN_00a18a20 undefined4 FUN_00a18a20(void) { undefined4 in_ECX; switch(in_ECX) { case 0: return 0; case 1: return 1; case 2: return 0x300; case 3: return 0x301; case 4: return 0x306; case 5: return 0x307; case 6: return 0x302; case 7: return 0x303; case 8: return 0x304; case 9: return 0x305; default: KAGE_LogMessage(0x10,(byte *)"Unknwon blend factor specified\n"); return 0xffffffff; } } //@@ 00a18aa0 KAGE::Graphics::Manager::Manager /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? constructor of the global graphics manager at 0xc798e0 (returns &DAT_00c798e0): sets KAGE::Graphics::ManagerBase::vftable then KAGE::Graphics::Manager::vftable, g_graphicsManager_flags/blendMode defaults, KColor white, several std::list/map heads, g_glfwWindow=0, 1920x1080 floats (0x44f00000/0x44870000); called once from the static initializer at 402140 */ undefined4 * KAGE::Graphics::Manager::Manager(void) { void *local_10; undefined *puStack_c; undefined4 local_8; puStack_c = &DAT_00b11133; local_10 = ExceptionList; ExceptionList = &local_10; g_graphicsManager_flags = 0; local_8 = 0; DAT_00c798e0 = ManagerBase::vftable; KColor::SetFromARGB((KColor *)&DAT_00c798e8,0xffffffff); g_graphicsManager_blendMode[1] = 1; DAT_00c798fc = &DAT_bf800000; if ((g_graphicsManager_flags & 4) == 0) { g_graphicsManager_blendMode[1] = 6; } g_graphicsManager_blendMode[0] = 0; g_graphicsManager_blendMode[2] = 7; g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; _DAT_00c79914 = (undefined4 *)0x0; _DAT_00c79918 = 0; _DAT_00c7991c = 0; _DAT_00c79920 = 0; _DAT_00c79924 = 0; _DAT_00c79914 = operator_new(8); _DAT_00c79914[1] = 0; *_DAT_00c79914 = &DAT_00c79914; local_8._0_1_ = 1; _DAT_00c7994c = (undefined4 *)0x0; DAT_00c79950 = 0; DAT_00c79954 = 0; DAT_00c79958 = 0; DAT_00c7995c = 0; _DAT_00c7994c = operator_new(8); _DAT_00c7994c[1] = 0; *_DAT_00c7994c = &DAT_00c7994c; _DAT_00c79960 = 0; DAT_00c79964 = 0; DAT_00c79968 = 0; local_8 = CONCAT31(local_8._1_3_,3); DAT_00c7996c = (void *)0x0; DAT_00c79970 = 0; DAT_00c7996c = operator_new(0x18); *(void **)DAT_00c7996c = DAT_00c7996c; *(void **)((int)DAT_00c7996c + 4) = DAT_00c7996c; *(void **)((int)DAT_00c7996c + 8) = DAT_00c7996c; *(undefined2 *)((int)DAT_00c7996c + 0xc) = 0x101; g_graphicsManager_flags = g_graphicsManager_flags | 0x12; DAT_00c79974 = 0; _DAT_00c79978 = 1; DAT_00c79988 = 0; DAT_00c79984 = 0; DAT_00c79928 = 0; DAT_00c7992c = 0; uRam00c79930 = 0; uRam00c79934 = 0; DAT_00c7997c = 0x44f00000; _DAT_00c79938 = 0; uRam00c7993c = 0; uRam00c79940 = 0; uRam00c79944 = 0; DAT_00c79980 = 0x44870000; _DAT_00c7998c = 0; _DAT_00c79990 = 0; _DAT_00c79994 = 0xffffffff; _DAT_00c79998 = 0xffffffff; local_8 = 4; DAT_00c798e0 = vftable; g_glfwWindow = (void *)0x0; DAT_00c799a4 = 0; DAT_00c799a0 = 0; DAT_00c799ac = 0; DAT_00c799a8 = 0; DAT_00c799b4 = 0; DAT_00c799b0 = 0; DAT_00c799b8 = (void *)0x0; _DAT_00c799bc = 0; DAT_00c799b8 = operator_new(0x10); *(void **)DAT_00c799b8 = DAT_00c799b8; *(void **)((int)DAT_00c799b8 + 4) = DAT_00c799b8; local_8._0_1_ = 5; _DAT_00c799c0 = (void *)0x0; _DAT_00c799c4 = 0; _DAT_00c799c0 = operator_new(0x10); *(void **)_DAT_00c799c0 = _DAT_00c799c0; *(void **)((int)_DAT_00c799c0 + 4) = _DAT_00c799c0; local_8._0_1_ = 6; _DAT_00c799c8 = (void *)0x0; _DAT_00c799cc = 0; _DAT_00c799c8 = operator_new(0x10); *(void **)_DAT_00c799c8 = _DAT_00c799c8; *(void **)((int)_DAT_00c799c8 + 4) = _DAT_00c799c8; local_8 = CONCAT31(local_8._1_3_,7); DAT_00c799d0 = (void *)0x0; _DAT_00c799d4 = 0; DAT_00c799d0 = operator_new(0x10); *(void **)DAT_00c799d0 = DAT_00c799d0; *(void **)((int)DAT_00c799d0 + 4) = DAT_00c799d0; g_graphicsManager_flags = g_graphicsManager_flags | 0x200; ExceptionList = local_10; return &DAT_00c798e0; } //@@ 00a18dc0 FUN_00a18dc0 void FUN_00a18dc0(byte param_1) { void *in_ECX; FUN_00a18e10(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xf8); } return; } //@@ 00a18df0 FUN_00a18df0 void FUN_00a18df0(void) { undefined4 *in_ECX; FUN_00a1a500(); operator_delete((void *)*in_ECX,0x10); return; } //@@ 00a18e10 FUN_00a18e10 void FUN_00a18e10(void) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::Manager::vftable; FUN_00a1a500(); operator_delete((void *)in_ECX[0x3c],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0x3a],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0x38],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0x36],0x10); *in_ECX = KAGE::Graphics::ManagerOpenGL::vftable; FUN_00a12f20(); return; } //@@ 00a18e90 KAGE::Graphics::Manager::Init /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: KAGE::Graphics::Manager vtable slot 1 (RTTI); KAGE::System::Init calls it with ecx=0xc798e0 (the KAGE_Graphics instance); glfwInit + 'GLFW failed to initialize', creates window, compiles KAGE_ColorShader/KAGE_ColorTextureShader/KAGE_IndexedTextureShader */ undefined1 KAGE::Graphics::Manager::Init(void) { char cVar1; int iVar2; HWND pHVar3; uint uVar4; uint uVar5; int *in_ECX; KColor local_58; char *local_44; undefined4 local_40; char *local_3c; undefined4 local_38; char *local_34; undefined4 local_30; char *local_2c; undefined4 local_28; char *local_24; undefined4 local_20; char *local_1c; undefined4 local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11164; local_10 = ExceptionList; ExceptionList = &local_10; DAT_00c7de7c = FUN_00a19dd0; iVar2 = glfwInit(__security_cookie ^ (int)register0x00000010 - 4U); if (iVar2 != 1) { KAGE_LogMessage(0x10,(byte *)"GLFW failed to initialize\n"); } FUN_00a19450(&DAT_00c79a34); in_ECX[0x32] = DAT_00c79a34; in_ECX[0x33] = DAT_00c79a38; cVar1 = DAT_00c79a3c; uVar5 = in_ECX[1] | 0x400; if (DAT_00c79a3c == '\0') { uVar5 = in_ECX[1] & 0xfffffbff; } in_ECX[1] = uVar5; if (in_ECX[0x2f] != 0) { iVar2 = -0x10; pHVar3 = (HWND)FUN_00a5f090(in_ECX[0x2f]); uVar4 = GetWindowLongA(pHVar3,iVar2); uVar5 = uVar4 & 0xfffeffff; if (cVar1 != '\0') { uVar5 = uVar4 | 0x10000; } iVar2 = -0x10; pHVar3 = (HWND)FUN_00a5f090(); SetWindowLongA(pHVar3,iVar2,uVar5); } cVar1 = KAGE_Graphics::create_window(); if (cVar1 == '\0') { ExceptionList = local_10; return 0; } iVar2 = in_ECX[0x2f]; if (iVar2 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x333); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else if (*(int *)(iVar2 + 0x40) == 0) { (*DAT_00c73748)(iVar2); if (*(int *)(iVar2 + 0x14) != 0) { (*DAT_00c73754)(iVar2); } } local_24 = "\n\nattribute\tvec3\t\t\tPosition;\nattribute\tvec4\t\t\tColor;\n\nvarying\t\tvec4\t\t\tColor0;\n\nuniform\t\tmat4\t\t\tTransform;\n\nvoid\t\tmain( void )\n{\n\tColor0 = Color;\n\tgl_Position = Transform * vec4( Position.xyz, 1.0 );\n}\n\n" ; local_20 = 0xca; local_1c = "\n\n#ifndef GL_ES\n\t#define lowp\n#endif\n\nvarying\t\tlowp vec4\t\tColor0;\n\nvoid\t\tmain( void )\n{\n\tgl_FragColor = Color0;\n\tif( gl_FragColor.a == 0.0 )\t\tdiscard;\n}\n\n" ; local_18 = 0x9a; FUN_00a13fa0("KAGE_ColorShader",&PTR_s_Position_00c0f8c0,&local_24); local_34 = "\n\nattribute\tvec3\t\t\tPosition;\nattribute\tvec4\t\t\tColor;\nattribute\tvec2\t\t\tTexCoord;\n\nvarying\t\tvec4\t\t\tColor0;\nvarying\t\tvec2\t\t\tTexCoord0;\n\nuniform\t\tmat4\t\t\tTransform;\n\nvoid\t\tmain( void )\n{\n\tgl_Position = Transform * vec4( Position.xyz, 1.0 );\n\tColor0 = Color;\n\tTexCoord0 = TexCoord;\n}\n\n" ; local_30 = 0x117; local_2c = "\n\n#ifndef GL_ES\n\t#define lowp\n\t#define highp\n#endif\n\nvarying\t\tlowp vec4\t\tColor0;\nvarying\t\thighp vec2\t\tTexCoord0;\n\nuniform\t\tsampler2D\t\tTexture0;\n\nvoid\t\tmain( void )\n{\n\tgl_FragColor = texture2D( Texture0, TexCoord0 ) * Color0;\n\tif( gl_FragColor.a == 0.0 )\t\tdiscard;\n}\n\n" ; local_28 = 0x10b; FUN_00a13fa0("KAGE_ColorTextureShader",&PTR_s_Position_00c0f8f0,&local_34); local_44 = "\n\nattribute\tvec3\t\t\tPosition;\nattribute\tvec4\t\t\tColor;\nattribute\tvec2\t\t\tTexCoord;\n\nvarying\t\tvec4\t\t\tColor0;\nvarying\t\tvec2\t\t\tTexCoord0;\n\nuniform\t\tmat4\t\t\tTransform;\n\nvoid\t\tmain( void )\n{\n\tgl_Position = Transform * vec4( Position.xyz, 1.0 );\n\tColor0 = Color;\n\tTexCoord0 = TexCoord;\n}\n\n" ; local_40 = 0x117; local_3c = "\n\n#ifndef GL_ES\n\t#define lowp\n\t#define highp\n#endif\n\nvarying\t\tlowp vec4\t\tColor0;\nvarying\t\thighp vec2\t\tTexCoord0;\n\nuniform\t\tsampler2D\t\tTexture0;\nuniform\t\tsampler2D\t\tTexture1;\n\nvoid\t\tmain( void )\n{\n\tvec4\tPaletteIndex = texture2D( Texture0, TexCoord0 );\n\tvec4\tOutputColor = texture2D( Texture1, PaletteIndex.xy ) * Color0;\n\tif( OutputColor.w == 0.0 )\t\tdiscard;\n\tgl_FragColor = OutputColor;\n}\n\n" ; local_38 = 0x186; FUN_00a13fa0("KAGE_IndexedTextureShader",&PTR_s_Position_00c0f8f0,&local_44); (**(code **)(*in_ECX + 0x78))(); (**(code **)(*in_ECX + 0x18))(0,1); local_14 = operator_new(0x10); local_8 = 0; if (local_14 == (void *)0x0) { DAT_00c7367c = (void *)0x0; } else { DAT_00c7367c = GraphicsBufferObject::GraphicsBufferObject(local_14); } local_8 = 0xffffffff; *(undefined4 *)((int)DAT_00c7367c + 0xc) = 1; KColor::SetFromARGB(&local_58,0xff000000); (**(code **)(*in_ECX + 0x58))(local_58._red,local_58._green,local_58._blue); _DAT_00c379b4 = _DAT_00c379b4 | 1; (**(code **)(DAT_00c37990 + 4))(); _DAT_00c37984 = _DAT_00c37984 | 1; in_ECX[1] = in_ECX[1] | 1; g_imageReleaseFn = FUN_00a12240; g_renderTargetReleaseFn = FUN_00a12240; ExceptionList = local_10; return 1; } //@@ 00a19130 FUN_00a19130 void FUN_00a19130(void) { int in_ECX; FUN_00a13060(); (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); (*(code *)epoxy_glDeleteFramebuffers)(1,in_ECX + 0xac); (*(code *)epoxy_glDeleteRenderbuffers)(1,in_ECX + 0xb0); FUN_00a6af90(); *(undefined4 *)(in_ECX + 0xbc) = 0; return; } //@@ 00a19180 _glfw_context_reset /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ? GLFW context.c, resets hints */ void _glfw_context_reset(char param_1) { char cVar1; int *piVar2; int iVar3; void *pvVar4; int *piVar5; int in_ECX; int *piVar6; KAGE_Graphics::flush_batches(); *(undefined1 **)(in_ECX + 0x1c) = &DAT_bf800000; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x24) = 1; *(undefined4 *)(in_ECX + 0x28) = 0; *(undefined4 *)(in_ECX + 0x2c) = 1; *(undefined4 *)(in_ECX + 0x30) = 0; piVar6 = *(int **)g_glContextObjects; if (piVar6 != g_glContextObjects) { do { (**(code **)(*(int *)piVar6[4] + 0x14))(); piVar2 = (int *)piVar6[2]; if (*(char *)((int)piVar2 + 0xd) == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar6 = piVar2; piVar2 = (int *)*piVar2; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar6 = piVar2; piVar2 = (int *)*piVar2; } } else { cVar1 = *(char *)(piVar6[1] + 0xd); piVar5 = (int *)piVar6[1]; piVar2 = piVar6; while ((piVar6 = piVar5, cVar1 == '\0' && (piVar2 == (int *)piVar6[2]))) { cVar1 = *(char *)(piVar6[1] + 0xd); piVar5 = (int *)piVar6[1]; piVar2 = piVar6; } } } while (piVar6 != g_glContextObjects); } pvVar4 = g_glContextObjects; FID_conflict__Erase_tree_>_> (&g_glContextObjects, (fuzzer_allocator_> *)&g_glContextObjects, *(_Tree_node **)((int)g_glContextObjects + 4)); *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; _DAT_00c379c8 = 0; if (g_shaderStackSize != 0) { do { g_shaderStackSize = g_shaderStackSize - 1; } while (g_shaderStackSize != 0); DAT_00c379d8 = 0; g_shaderStackSize = 0; } shader_cache_find(g_shaderStackSize); if (param_1 != '\0') { if (*(int *)(in_ECX + 0x68) == 0) { iVar3 = *(int *)(in_ECX + 0xbc); if (iVar3 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\context.c" ,0x28b); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if (*(int *)(iVar3 + 500) == 0) { _glfwInputError(0x1000a, "Cannot swap buffers of a window that has no OpenGL or OpenGL ES context"); return; } (**(code **)(iVar3 + 0x230))(iVar3); return; } (*(code *)epoxy_glClear)(0x100); } return; } //@@ 00a19340 GraphicsWindow::get_framebuffer_width /* DB: ? asserts "window != NULL" (GLFW_3.4 window.c line 711) on this+0xbc, calls platform getter DAT_00c73730(window,&w,&h) and returns w; the sibling FUN_00a193c0 returns h; Manager::ResizeWindowCallback uses both prototype: db/protos.zhl */ int __thiscall GraphicsWindow::get_framebuffer_width(void *this) { int iVar1; undefined4 local_c; int local_8; iVar1 = *(int *)((int)this + 0xbc); if (iVar1 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x2c7); } local_8 = 0; local_c = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); return local_8; } (*DAT_00c73730)(iVar1,&local_8,&local_c); return local_8; } //@@ 00a193c0 Window::get_framebuffer_height /* DB: ? GLFW 3.4 inlined getter on the GLFWwindow at ECX+0xbc: assert "window != NULL" at window.c line 0x2c7 (glfwGetFramebufferSize region), _glfwInputError(GLFW_NOT_INITIALIZED) if not initialized, platform callback DAT_00c73730(window,&w,&h), returns h; Manager::ResizeWindowCallback, Manager::update_state_loading prototype: db/protos.zhl */ int __thiscall Window::get_framebuffer_height(void *this) { int iVar1; undefined4 local_c; int local_8; iVar1 = *(int *)((int)this + 0xbc); if (iVar1 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x2c7); } local_c = 0; local_8 = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); return local_8; } (*DAT_00c73730)(iVar1,&local_c,&local_8); return local_8; } //@@ 00a19440 FUN_00a19440 void * FUN_00a19440(void) { return g_glfwWindow; } //@@ 00a19450 FUN_00a19450 void FUN_00a19450(int *param_1) { int iVar1; int iVar2; int iVar3; int in_ECX; if ((*(int *)(in_ECX + 0xc0) != *param_1) || (*(int *)(in_ECX + 0xc4) != param_1[1])) { *(int *)(in_ECX + 0xc0) = *param_1; *(int *)(in_ECX + 0xc4) = param_1[1]; if ((*(uint *)(in_ECX + 4) & 0x100) == 0) { iVar1 = *(int *)(in_ECX + 0xbc); if (iVar1 != 0) { iVar2 = *param_1; iVar3 = param_1[1]; if (iVar2 < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x26f); } if (iVar3 < 0) { _wassert(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x270); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } *(int *)(iVar1 + 0x28) = iVar2; *(int *)(iVar1 + 0x2c) = iVar3; (*DAT_00c73724)(iVar1,iVar2,iVar3); return; } } else { KAGE_LogMessage(4,(byte *)"Setting size of window while in fullscreen, is this intended?\n"); } } return; } //@@ 00a19530 glfw_get_window_size /* DB: ? GLFW 3.4 window.c line 0x260 assert "window != NULL" on window g_glfwWindow; returns cached size (DAT_00c799a0/a4) when not windowed flag, else calls platform getter (DAT_00c73720) into an int pair; Manager::Render, OptionsConfig::Load, Entity_Player::GetMouseAimTarget prototype: db/protos.zhl, confirmed by RET 8 */ int * glfw_get_window_size(int *outSize,int unused) { void *pvVar1; int local_c; int local_8; outSize[1] = 0; *outSize = 0; pvVar1 = g_glfwWindow; if ((g_graphicsManager_flags & 0x100) == 0) { *outSize = DAT_00c799a0; outSize[1] = DAT_00c799a4; return outSize; } if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x260); } local_8 = 0; local_c = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); *outSize = local_8; outSize[1] = local_c; return outSize; } (*DAT_00c73720)(pvVar1,&local_8,&local_c); *outSize = local_8; outSize[1] = local_c; return outSize; } //@@ 00a19600 glfw_set_window_pos /* DB: (x,y) on g_glfwWindow: caches x/y in DAT_00c799b0/b4, logs "Setting position of window while in fullscreen, is this intended?", GLFW 3.4 window.c glfwSetWindowPos assert line 0x253, skips when monitor (+0x40) set, platform setWindowPos; OptionsConfig::Load passes _windowPosX/_windowPosY */ void glfw_set_window_pos(int param_1,int param_2) { void *pvVar1; pvVar1 = g_glfwWindow; if ((DAT_00c799b0 != param_1) || (DAT_00c799b4 != param_2)) { DAT_00c799b0 = param_1; DAT_00c799b4 = param_2; if ((g_graphicsManager_flags & 0x100) == 0) { if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x253); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if (*(int *)((int)pvVar1 + 0x40) == 0) { (*DAT_00c7371c)(pvVar1,param_1,param_2); return; } } else { KAGE_LogMessage(4,(byte *) "Setting position of window while in fullscreen, is this intended?\n"); } } return; } //@@ 00a196b0 KAGE_Graphics::set_fullscreen /* DB: ? (bool fullscreen, char): toggles g_graphicsManager_flags bit 8, GLFW 3.4 window.c/monitor.c asserts (glfwSetWindowMonitor path), update_projection/update_depth_renderbuffer; only caller OptionsConfig::set_fullscreen */ void KAGE_Graphics::set_fullscreen(byte param_1,char param_2) { uint uVar1; void *pvVar2; int iVar3; HWND hWnd; Vector *pVVar4; code *pcVar5; int *piVar6; int cx; bool bVar7; HWND hWndInsertAfter; int X; int Y; UINT uFlags; undefined4 local_10; undefined4 local_c; int local_8; if (((byte)(g_graphicsManager_flags >> 8) & 1) == param_1) { return; } if (param_1 == 0) { g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffeff; FUN_00a6b0a0(DAT_00c799b0,DAT_00c799b4,DAT_00c799a8,DAT_00c799ac,0); pvVar2 = g_glfwWindow; pcVar5 = _wassert_exref; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3a3); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(undefined4 *)((int)pvVar2 + 8) = 1; if (*(int *)((int)pvVar2 + 0x40) == 0) { (*DAT_00c7377c)(pvVar2,1); } } pvVar2 = g_glfwWindow; bVar7 = DAT_00c79a3d != '\0'; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3a3); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(uint *)((int)pvVar2 + 4) = (uint)bVar7; if (*(int *)((int)pvVar2 + 0x40) == 0) { (*DAT_00c73778)(pvVar2,(uint)bVar7); } } uFlags = 3; iVar3 = 0; cx = 0; Y = 0; X = 0; hWndInsertAfter = (HWND)0xfffffffe; hWnd = (HWND)FUN_00a5f090(); } else { g_graphicsManager_flags = g_graphicsManager_flags | 0x100; local_8 = window_get_current_monitor(); pcVar5 = _wassert_exref; if (local_8 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0x1c1); } if (_glfw == 0) { _glfwInputError(0x10001,0); piVar6 = (int *)0x0; } else { uVar1 = local_8 + 0x98; iVar3 = (*DAT_00c736fc)(local_8,uVar1); piVar6 = (int *)(-(uint)(iVar3 != 0) & uVar1); } if (param_2 != '\0') { FUN_00a6b0a0(0,0,*piVar6,piVar6[1],piVar6[5]); goto LAB_00a1993f; } FUN_00a6b0a0(0,0,*piVar6 + 1,piVar6[1],0); pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3a3); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(undefined4 *)((int)pvVar2 + 8) = 0; if (*(int *)((int)pvVar2 + 0x40) == 0) { (*DAT_00c7377c)(pvVar2,0); } } pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3a3); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(undefined4 *)((int)pvVar2 + 4) = 0; if (*(int *)((int)pvVar2 + 0x40) == 0) { (*DAT_00c73778)(pvVar2,0); } } iVar3 = piVar6[1]; cx = *piVar6 + 1; hWnd = (HWND)FUN_00a5f090(); uFlags = 0x10; Y = 0; X = -1; hWndInsertAfter = (HWND)0xffffffff; } SetWindowPos(hWnd,hWndInsertAfter,X,Y,cx,iVar3,uFlags); LAB_00a1993f: pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { (*pcVar5)(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x333); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else if ((*(int *)((int)pvVar2 + 0x40) == 0) && ((*DAT_00c73748)(pvVar2), *(int *)((int)pvVar2 + 0x14) != 0)) { (*DAT_00c73754)(pvVar2); } pvVar2 = g_glfwWindow; if (param_1 == 0) { g_graphicsManager_flags = g_graphicsManager_flags & 0xfffff7ff; } else { g_graphicsManager_flags = g_graphicsManager_flags | 0x800; } if (g_glfwWindow == (void *)0x0) { (*pcVar5)(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x260); } local_10 = 0; local_c = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); } else { (*DAT_00c73720)(pvVar2,&local_10,&local_c); } piVar6 = (int *)*DAT_00c799b8; if (piVar6 != DAT_00c799b8) { do { (*(code *)piVar6[2])(local_10,local_c,piVar6[3]); piVar6 = (int *)*piVar6; } while (piVar6 != DAT_00c799b8); } pVVar4 = (Vector *)&DAT_00c79984; if ((g_graphicsManager_flags & 0x40) == 0) { pVVar4 = &g_vectorZero; } (*(code *)epoxy_glViewport)((int)pVVar4->x,(int)pVVar4->y,DAT_00c799a8,DAT_00c799ac); update_projection(&DAT_00c798e0); update_depth_renderbuffer(&DAT_00c798e0,0); pvVar2 = g_glfwWindow; if (param_1 == 0) { if (g_glfwWindow == (void *)0x0) { (*pcVar5)(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x24c); } if (_glfw != 0) { if (*(int *)((int)pvVar2 + 0x70) == 0x34001) { return; } *(undefined4 *)((int)pvVar2 + 0x70) = 0x34001; (*DAT_00c736a0)(pvVar2,(int)pvVar2 + 0x1e0,(int)pvVar2 + 0x1e8); (*DAT_00c736a8)(pvVar2,0x34001); return; } } else { if (g_glfwWindow == (void *)0x0) { (*pcVar5)(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x24c); } if (_glfw != 0) { if (*(int *)((int)pvVar2 + 0x70) == 0x34002) { return; } *(undefined4 *)((int)pvVar2 + 0x70) = 0x34002; (*DAT_00c736a0)(pvVar2,(int)pvVar2 + 0x1e0,(int)pvVar2 + 0x1e8); (*DAT_00c736a8)(pvVar2,0x34002); return; } } _glfwInputError(0x10001,0); return; } //@@ 00a19b60 FUN_00a19b60 void FUN_00a19b60(void) { int in_ECX; FUN_00a1a470((byte)(*(uint *)(in_ECX + 4) >> 9) & 1); (*(code *)epoxy_glEnable)(0xbe2); (*(code *)epoxy_glEnable)(0xb71); (*(code *)epoxy_glEnable)(0xb44); (*(code *)epoxy_glClearDepth)(0xc08f400000000000); (*(code *)epoxy_glDepthFunc)(0x204); (*(code *)epoxy_glCullFace)(0x405); return; } //@@ 00a19bc0 FUN_00a19bc0 void FUN_00a19bc0(void) { int in_ECX; Vector *pVVar1; pVVar1 = &g_vectorZero; if ((*(byte *)(in_ECX + 4) & 0x40) != 0) { pVVar1 = (Vector *)(in_ECX + 0xa4); } (*(code *)epoxy_glViewport) ((int)pVVar1->x,(int)pVVar1->y,*(undefined4 *)(in_ECX + 200), *(undefined4 *)(in_ECX + 0xcc)); return; } //@@ 00a19bf0 FUN_00a19bf0 void FUN_00a19bf0(void *param_1,int param_2,int param_3) { Vector *pVVar1; int *piVar2; if (((param_1 == g_glfwWindow) && (param_2 != 0)) && (param_3 != 0)) { DAT_00c799a0 = param_2; DAT_00c799a4 = param_3; piVar2 = (int *)*DAT_00c799b8; if (piVar2 != DAT_00c799b8) { do { (*(code *)piVar2[2])(param_2,param_3,piVar2[3]); piVar2 = (int *)*piVar2; } while (piVar2 != DAT_00c799b8); } pVVar1 = (Vector *)&DAT_00c79984; if (((byte)g_graphicsManager_flags & 0x40) == 0) { pVVar1 = &g_vectorZero; } (*(code *)epoxy_glViewport)((int)pVVar1->x,(int)pVVar1->y,DAT_00c799a8,DAT_00c799ac); KAGE_Graphics::update_depth_renderbuffer(&DAT_00c798e0,0); KAGE_Graphics::update_projection(&DAT_00c798e0); } return; } //@@ 00a19dd0 FUN_00a19dd0 void FUN_00a19dd0(void) { KAGE_LogMessage(8,(byte *)"GLFW Error %d: %s\n"); return; } //@@ 00a19df0 KAGE_Graphics::create_window /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? only caller FUN_00a18e90 (graphics init called by KAGE::System::Init, compiles KAGE_ColorShader etc.); glfwWindowHint calls, glfwCreateWindow -> this+0xbc, SetWindowLong icon, glfwMakeContextCurrent, 'Failed to create OpenGL window / context', 'OpenGL version %%s' */ undefined4 KAGE_Graphics::create_window(void) { HMODULE hInstance; HICON dwNewLong; uint uVar1; LPVOID pvVar2; int *piVar3; 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 uVar4; HWND pHVar5; undefined4 extraout_ECX_07; int *piVar6; LPCSTR lpIconName; int iVar7; int local_10; glfwWindowHint(); if (_glfw == 0) { _glfwInputError(0x10001,0); uVar4 = extraout_ECX_00; } else { _DAT_00c73830 = 0; uVar4 = extraout_ECX; } if (_glfw == 0) { _glfwInputError(0x10001,0); uVar4 = extraout_ECX_01; } else { _DAT_00c7383c = 0; } if (_glfw == 0) { _glfwInputError(0x10001,0); uVar4 = extraout_ECX_02; } else { _DAT_00c73c6c = 2; } if (_glfw == 0) { _glfwInputError(0x10001,0); uVar4 = extraout_ECX_03; } else { _DAT_00c73c70 = 0; } local_10 = glfwCreateWindow(DAT_00c79a30,uVar4,in_ECX[0x2f]); if (local_10 == 0) { if (_glfw == 0) { _glfwInputError(0x10001,0); uVar4 = extraout_ECX_05; } else { _DAT_00c73c6c = 1; uVar4 = extraout_ECX_04; } if (_glfw == 0) { _glfwInputError(0x10001,0); uVar4 = extraout_ECX_06; } else { _DAT_00c73c70 = 0; } local_10 = glfwCreateWindow(DAT_00c79a30,uVar4,in_ECX[0x2f]); if (local_10 == 0) { KAGE_LogMessage(0x10,(byte *)"Failed to create OpenGL window / context\n"); } } if (in_ECX[0x2f] != 0) { FUN_00a6af90(); } lpIconName = (LPCSTR)(uint)DAT_00c79a40; hInstance = GetModuleHandleA((LPCSTR)0x0); dwNewLong = LoadIconA(hInstance,lpIconName); if (_glfw == 0) { _glfwInputError(0x10001,0); pHVar5 = (HWND)0x0; } else if (DAT_00c73694 == 0x60001) { pHVar5 = *(HWND *)(local_10 + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized"); pHVar5 = (HWND)0x0; } SetClassLongA(pHVar5,-0xe,(LONG)dwNewLong); if ((in_ECX[1] & 0x400U) == 0) { iVar7 = -0x10; pHVar5 = (HWND)FUN_00a5f090(extraout_ECX_07); uVar1 = GetWindowLongA(pHVar5,iVar7); uVar1 = uVar1 & 0xfffeffff; iVar7 = -0x10; pHVar5 = (HWND)FUN_00a5f090(); SetWindowLongA(pHVar5,iVar7,uVar1); } in_ECX[0x2f] = local_10; if (_glfw == 0) { _glfwInputError(0x10001,0); goto LAB_00a1a0a2; } if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar2 = TlsGetValue(DAT_00c74b84); if ((local_10 != 0) && (*(int *)(local_10 + 500) == 0)) { _glfwInputError(0x1000a, "Cannot make current with a window that has no OpenGL or OpenGL ES context"); goto LAB_00a1a0a2; } if (pvVar2 == (LPVOID)0x0) { LAB_00a1a092: if (local_10 == 0) goto LAB_00a1a0a2; } else if ((local_10 == 0) || (*(int *)(local_10 + 0x1f8) != *(int *)((int)pvVar2 + 0x1f8))) { (**(code **)((int)pvVar2 + 0x22c))(0); goto LAB_00a1a092; } (**(code **)(local_10 + 0x22c))(local_10); LAB_00a1a0a2: (*(code *)epoxy_glGetString)(0x1f02); KAGE_LogMessage(1,(byte *)"OpenGL version %s\n"); (*(code *)epoxy_glGetString)(0x8b8c); KAGE_LogMessage(1,(byte *)"GLSL version %s\n"); piVar3 = in_ECX + 0x2b; if (*piVar3 != 0) { (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); (*(code *)epoxy_glDeleteFramebuffers)(1,piVar3); } if (epoxy_glGenFramebuffers == (undefined *)0x0) { KAGE_LogMessage(8,(byte *)"glGenFramebuffers is NULL!\n"); return 0; } (*(code *)epoxy_glGenFramebuffers)(1,piVar3); KAGE_LogMessage(1,(byte *)"Framebuffer ID: %d\n"); (*(code *)epoxy_glBindFramebuffer)(0x8d40,*piVar3); update_depth_renderbuffer(in_ECX,1); (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); iVar7 = in_ECX[0x2f]; if (iVar7 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x41f); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(code **)(iVar7 + 0x274) = FUN_00a19bf0; } iVar7 = in_ECX[0x2f]; if (iVar7 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x414); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(undefined **)(iVar7 + 0x270) = &UNK_00a19ca0; } iVar7 = in_ECX[0x2f]; if (iVar7 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x440); } if (_glfw == 0) { _glfwInputError(0x10001,0); } else { *(undefined **)(iVar7 + 0x280) = &UNK_00a19d40; } if ((in_ECX[1] & 0x100U) == 0) { iVar7 = in_ECX[0x2f]; if (iVar7 == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x245); } piVar6 = in_ECX + 0x34; piVar3 = in_ECX + 0x35; if (piVar6 != (int *)0x0) { *piVar6 = 0; } if (piVar3 != (int *)0x0) { *piVar3 = 0; } if (_glfw == 0) { _glfwInputError(0x10001,0); (**(code **)(*in_ECX + 0x78))(); return 1; } (*_DAT_00c73718)(iVar7,piVar6,piVar3); } (**(code **)(*in_ECX + 0x78))(); return 1; } //@@ 00a1a2e0 window_get_current_monitor /* DB: ? GLFW monitor.c asserts: walks the monitor list, getMonitorPos + video mode and returns the monitor containing ECX+0xd0/0xd4 (window position), else the primary monitor; callers OptionsConfig::set_vsync, 00a196b0 KAGE_Graphics::set_fullscreen undefined4 window_get_current_monitor(void) { int iVar1; undefined4 *puVar2; int iVar3; int iVar4; int in_ECX; int *piVar5; int iVar6; int local_c; int local_8; iVar3 = g_glfwMonitorCount; puVar2 = DAT_00c73ca4; if (_glfw == 0) { _glfwInputError(0x10001,0); } else { iVar6 = 0; if (0 < g_glfwMonitorCount) { do { iVar1 = puVar2[iVar6]; local_8 = 0; local_c = 0; if (iVar1 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0x149); } local_8 = 0; local_c = 0; if (_glfw == 0) { _glfwInputError(0x10001,0); } else { (*DAT_00c736ec)(iVar1,&local_8,&local_c); } iVar1 = puVar2[iVar6]; if (iVar1 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0x1c1); } if (_glfw == 0) { _glfwInputError(0x10001,0); piVar5 = (int *)0x0; } else { iVar4 = (*DAT_00c736fc)(iVar1,iVar1 + 0x98U); piVar5 = (int *)(-(uint)(iVar4 != 0) & iVar1 + 0x98U); } if ((((local_8 < *(int *)(in_ECX + 0xd0)) && (*(int *)(in_ECX + 0xd0) < *piVar5 + local_8)) && (local_c < *(int *)(in_ECX + 0xd4))) && (*(int *)(in_ECX + 0xd4) < piVar5[1] + local_c)) { return puVar2[iVar6]; } iVar6 = iVar6 + 1; } while (iVar6 < iVar3); } } if (_glfw == 0) { _glfwInputError(0x10001,0); } else if (g_glfwMonitorCount != 0) { return *DAT_00c73ca4; } return 0; } //@@ 00a1a470 FUN_00a1a470 void FUN_00a1a470(byte param_1) { LPVOID pvVar1; PROC pPVar2; if (_glfw == 0) { _glfwInputError(0x10001,0); } else { if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar1 = TlsGetValue(DAT_00c74b84); if (pvVar1 == (LPVOID)0x0) { _glfwInputError(0x10002, "Cannot set swap interval without a current OpenGL or OpenGL ES context"); } else { (**(code **)((int)pvVar1 + 0x234))((uint)param_1); } } pPVar2 = wglGetProcAddress("wglSwapIntervalEXT"); if (pPVar2 != (PROC)0x0) { (*pPVar2)((uint)param_1); } return; } //@@ 00a1a500 FUN_00a1a500 void FUN_00a1a500(void) { undefined4 *puVar1; undefined4 *ptr; undefined4 *in_EDX; *(undefined4 *)in_EDX[1] = 0; ptr = (undefined4 *)*in_EDX; while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; ptr[2] = 0; ptr[3] = 0; operator_delete(ptr,0x10); ptr = puVar1; } return; } //@@ 00a1a540 FontSettings::constructor /* ZHL [exact] __thiscall void FontSettings::constructor(); prototype: REPENTOGON, confirmed by RET 0 */ void __thiscall FontSettings::constructor(FontSettings *this) { this[6] = (FontSettings)0x0; *this = (FontSettings)0x0; this[1] = (FontSettings)0xffff; this[2] = (FontSettings)0x0; this[3] = (FontSettings)0x3f800000; this[4] = (FontSettings)0xffffffff; this[5] = (FontSettings)0x0; this[6] = (FontSettings)0x0; return; } //@@ 00a1a580 FUN_00a1a580 void FUN_00a1a580(undefined4 param_1) { undefined4 *in_ECX; in_ECX[6] = 0; *in_ECX = param_1; in_ECX[1] = 0xffff; in_ECX[2] = 0; in_ECX[3] = 0x3f800000; in_ECX[4] = 0xffffffff; in_ECX[5] = 0; in_ECX[6] = 0; return; } //@@ 00a1a5c0 Font::SetAlignment /* DB: Lua Font table */ void Font::SetAlignment(undefined4 param_1) { undefined4 *in_ECX; *in_ECX = param_1; return; } //@@ 00a1a5d0 Font::SetMaxCharacters /* DB: Lua Font table */ void Font::SetMaxCharacters(undefined2 param_1) { int in_ECX; *(undefined2 *)(in_ECX + 4) = param_1; return; } //@@ 00a1a5e0 Font::GetMaxCharacters /* DB: Lua Font table */ undefined2 Font::GetMaxCharacters(void) { int in_ECX; return *(undefined2 *)(in_ECX + 4); } //@@ 00a1a5f0 Font::IsAutoWrapEnabled /* DB: Lua Font table */ bool Font::IsAutoWrapEnabled(void) { int in_ECX; return *(int *)(in_ECX + 8) == 1; } //@@ 00a1a600 Font::EnableTruncation /* DB: Lua Font table */ void Font::EnableTruncation(undefined2 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 8) = 2; *(undefined2 *)(in_ECX + 6) = param_1; return; } //@@ 00a1a620 Font::IsTruncationEnabled /* DB: Lua Font table */ bool Font::IsTruncationEnabled(void) { int in_ECX; return *(int *)(in_ECX + 8) == 2; } //@@ 00a1a630 Font::SetMissingCharacterOverride /* DB: Lua Font table */ void __thiscall Font::SetMissingCharacterOverride(Font *this,undefined4 param_2) { this->_spacingVert = (undefined1)param_2; this->_outline = param_2._1_1_; *(undefined2 *)&this->field_0x12 = param_2._2_2_; return; } //@@ 00a1a640 Font::Font /* DB: constructor: clears loaded byte +0, glyph vectors +0x24..+0x3c, allocs the std::map head at +0x40 (glyph map used by Font::get_string_width_utf16), +0x48 missing glyph = -1; called from HUD/PauseScreen/Manager constructors prototype: db/protos.zhl */ Font * __thiscall Font::Font(Font *this) { void *pvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b111a0; local_10 = ExceptionList; ExceptionList = &local_10; this->_isLoaded = 0; this->_numChars = 0; this->_chars = (void *)0x0; (this->_kerningPairs)._begin = (void *)0x0; (this->_kerningPairs)._end = (void *)0x0; (this->_kerningPairs)._capacity = (void *)0x0; local_8 = 0; this->_numPages = 0; this->_pageTextures = (void *)0x0; (this->_charsBlock)._head = (void *)0x0; (this->_charsBlock)._size = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; (this->_charsBlock)._head = pvVar1; this->_missingCharacter = -1; ExceptionList = local_10; return this; } //@@ 00a1a6f0 FUN_00a1a6f0 void FUN_00a1a6f0(void) { std_map *this; Font *in_ECX; Font::Unload(in_ECX); this = &in_ECX->_charsBlock; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)((int)(in_ECX->_charsBlock)._head + 4)); operator_delete(this->_head,0x18); FUN_004b3950(); return; } //@@ 00a1a730 Font::Load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: zhl Font::Load(path, bool); opens the font file, sprintf page names, builds glyph table; 0x85e470 "KColor::Load" is just Font::Load(path,0) and is misnamed prototype: REPENTOGON, confirmed by RET 8 */ void __thiscall Font::Load(Font *this,byte *path,byte unusedIsLoading) { byte bVar1; longlong lVar2; char cVar3; int *piVar4; char *pcVar5; byte *pbVar6; uint uVar7; void *pvVar8; byte *pbVar9; void *_Dst; uint uVar10; uint *puVar11; byte *pbVar12; std_vector *psVar13; byte *pbVar14; int iVar15; uint *puVar16; bool bVar17; undefined3 in_stack_00000009; undefined1 local_444 [4]; int *local_440; int local_43c; uint local_438; std_vector *local_434; void *local_430; uint local_42c; int *local_428; Font *local_424; byte *local_420; undefined4 local_41c; byte local_417 [514]; char local_215 [513]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11203; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_215 + 0x211); ExceptionList = &local_10; local_424 = this; Unload(this); piVar4 = FileSystem::Open(&PTR_vftable_00c37a10,path,(int *)0x0); if (piVar4 != (int *)0x0) { iVar15 = -(int)path; do { bVar1 = *path; path = path + 1; path[(int)(local_215 + iVar15)] = bVar1; } while (bVar1 != 0); pcVar5 = local_215; do { pcVar5 = pcVar5 + 1; } while (*pcVar5 != '\0'); pcVar5 = pcVar5 + -1; cVar3 = *pcVar5; for (; ((cVar3 != '/' && (cVar3 != '\\')) && (pcVar5 != local_215 + 1)); pcVar5 = pcVar5 + -1) { cVar3 = pcVar5[-1]; } *pcVar5 = '\0'; local_41c = 0; local_428 = piVar4; (**(code **)(*piVar4 + 0x14))(&local_41c,1,3); pbVar9 = &DAT_00b82680; pbVar6 = (byte *)&local_41c; do { bVar1 = *pbVar6; bVar17 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00a1a830: uVar7 = -(uint)bVar17 | 1; goto LAB_00a1a835; } if (bVar1 == 0) break; bVar1 = pbVar6[1]; bVar17 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00a1a830; pbVar6 = pbVar6 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_00a1a835: if (uVar7 == 0) { local_417[2] = '\0'; (**(code **)(*piVar4 + 0x14))(local_417 + 2,1,1); if (local_417[2] == '\x03') { cVar3 = (**(code **)(*piVar4 + 0x10))(); while (cVar3 == '\0') { local_417[2] = '\0'; (**(code **)(*piVar4 + 0x14))(local_417 + 2,1,1); local_41c = 0; (**(code **)(*piVar4 + 0x14))(&local_41c,4,1); local_43c = (**(code **)(*piVar4 + 8))(); cVar3 = (**(code **)(*piVar4 + 0x10))(); if (cVar3 != '\0') break; switch(local_417[2]) { case 1: (**(code **)(*piVar4 + 0x14))(&this->_fontSize,0x10,1); break; case 2: (**(code **)(*piVar4 + 0x14))(&this->_lineHeight,0x10,1); break; case 3: pbVar6 = operator_new_tracked(local_41c + 1); local_420 = pbVar6; (**(code **)(*piVar4 + 0x14))(pbVar6,1,local_41c); pbVar6[local_41c] = 0; uVar7 = (uint)(ushort)this->_pages; local_424->_numPages = uVar7; puVar16 = operator_new_tracked(-(uint)(0xfffffffb < uVar7 * 8) | uVar7 * 8 + 4); local_8 = 0; if (puVar16 == (uint *)0x0) { puVar11 = (uint *)0x0; } else { puVar11 = puVar16 + 1; *puVar16 = uVar7; _eh_vector_constructor_iterator_ (puVar11,8,uVar7,(_func_void_void_ptr *)&LAB_0040c5b0,FUN_0040c440); } local_42c = 0; local_424->_pageTextures = puVar11; pbVar6 = local_420; this = local_424; if (local_424->_numPages != 0) { do { local_8 = 0xffffffff; memset(local_417 + 3,0,0x200); pcVar5 = local_215 + 1; do { cVar3 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar3 != '\0'); if (pcVar5 != local_215 + 2) { sprintf(local_417 + 3,&DAT_00b7dea4); } pbVar9 = pbVar6; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); pbVar14 = local_417 + 2; do { pbVar12 = pbVar14 + 1; pbVar14 = pbVar14 + 1; } while (*pbVar12 != 0); pbVar12 = pbVar6; for (uVar7 = (uint)((int)pbVar9 - (int)pbVar6) >> 2; uVar7 != 0; uVar7 = uVar7 - 1) { *(undefined4 *)pbVar14 = *(undefined4 *)pbVar12; pbVar12 = pbVar12 + 4; pbVar14 = pbVar14 + 4; } for (uVar7 = (int)pbVar9 - (int)pbVar6 & 3; uVar7 != 0; uVar7 = uVar7 - 1) { *pbVar14 = *pbVar12; pbVar12 = pbVar12 + 1; pbVar14 = pbVar14 + 1; } pbVar9 = (byte *)0x0; if (_unusedIsLoading != (char *)0x0) { pcVar5 = _unusedIsLoading; do { cVar3 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar3 != '\0'); pbVar9 = (byte *)(pcVar5 + -(int)(_unusedIsLoading + 1)); if (pbVar9 == (byte *)0x3) { pbVar9 = local_417 + 3; do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; } while (bVar1 != 0); uVar7 = (int)pbVar9 - (int)(local_417 + 4); pbVar9 = (byte *)0x0; if ((4 < uVar7) && (pbVar9 = local_417 + uVar7 + 3, local_417[uVar7 - 1] == 0x2e)) { *(undefined2 *)(local_417 + uVar7) = *(undefined2 *)_unusedIsLoading; local_417[uVar7 + 2] = _unusedIsLoading[2]; } } } pvVar8 = (void *)KAGE_Graphics_ImageManager::load_image_file (local_444,local_417 + 3,pbVar9); this = local_424; uVar7 = local_42c; local_8 = 1; KAGE::SmartPointer::operator_assign ((void *)((int)local_424->_pageTextures + local_42c * 8),pvVar8); local_8 = 2; if (((local_440 != (int *)0x0) && (cVar3 = (**(code **)(*local_440 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_444); } do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); local_42c = uVar7 + 1; } while (local_42c < (uint)this->_numPages); } local_8 = 0xffffffff; if (local_420 != (byte *)0x0) { local_8 = 3; tracked_alloc(1,local_420,0); local_8 = 0xffffffff; } goto LAB_00a1ad1a; case 4: this->_numChars = local_41c / 0x14; lVar2 = (ulonglong)(local_41c / 0x14) * 0x14; pvVar8 = operator_new_tracked (-(uint)((int)((ulonglong)lVar2 >> 0x20) != 0) | (uint)lVar2); this->_chars = pvVar8; (**(code **)(*piVar4 + 0x14))(pvVar8,0x14,this->_numChars); if (this->_numChars != 0) { iVar15 = 0; uVar7 = 0; do { puVar16 = map_find_value(&this->_charsBlock,(int)local_424->_chars + iVar15); iVar15 = iVar15 + 0x14; *puVar16 = uVar7; uVar7 = uVar7 + 1; } while (uVar7 < (uint)local_424->_numChars); this = local_424; goto LAB_00a1ad1a; } break; case 5: psVar13 = &this->_kerningPairs; pvVar8 = psVar13->_begin; _Dst = (this->_kerningPairs)._end; uVar10 = local_41c / 10; uVar7 = (int)_Dst - (int)pvVar8 >> 4; local_434 = psVar13; local_430 = _Dst; if (uVar10 < uVar7) { (this->_kerningPairs)._end = (void *)(uVar10 * 0x10 + (int)pvVar8); } else if (uVar7 < uVar10) { if ((uint)((int)(this->_kerningPairs)._capacity - (int)pvVar8 >> 4) < uVar10) { std::vector<16byte>::_Resize_reallocate(uVar10,uVar7); } else { iVar15 = uVar10 - uVar7; if (iVar15 != 0) { memset(_Dst,0,iVar15 * 0x10); _Dst = (void *)((int)local_430 + iVar15 * 0x10); } (this->_kerningPairs)._end = _Dst; } } if (uVar10 != 0) { local_430 = (void *)0x0; do { puVar16 = (uint *)((int)psVar13->_begin + (int)local_430); local_420 = (byte *)0x0; (**(code **)(*local_428 + 0x14))(&local_420,4,1); pbVar6 = local_420; local_42c = 0; (**(code **)(*local_428 + 0x14))(&local_42c,4,1); puVar16[1] = (uint)pbVar6; *puVar16 = local_42c; local_420 = (byte *)0x0; (**(code **)(*local_428 + 0x14))(&local_420,2,1); *(undefined2 *)(puVar16 + 2) = local_420._0_2_; local_430 = (void *)((int)local_430 + 0x10); uVar10 = uVar10 - 1; psVar13 = local_434; } while (uVar10 != 0); } this = local_424; local_438 = local_438 & 0xffffff00; std::_Sort_unchecked<16byte_u64key> ((int)(local_424->_kerningPairs)._end - (int)psVar13->_begin >> 4,local_438); LAB_00a1ad1a: piVar4 = local_428; } (**(code **)(*piVar4 + 0xc))(local_41c + local_43c,0); cVar3 = (**(code **)(*piVar4 + 0x10))(); } (**(code **)*piVar4)(1); this->_isLoaded = 1; } } } ExceptionList = local_10; return; } //@@ 00a1ad90 Font::Unload /* DB: Lua Font table prototype: db/protos.zhl */ void __thiscall Font::Unload(Font *this) { uint *ptr; void *pvVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11230; local_10 = ExceptionList; ExceptionList = &local_10; if (this->_chars != (void *)0x0) { local_8 = 0; tracked_alloc(1,this->_chars,0); this->_chars = (void *)0x0; } local_8 = 0xffffffff; pvVar1 = this->_pageTextures; if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 1; _eh_vector_destructor_iterator_(pvVar1,8,*ptr,FUN_0040c440); operator_delete(ptr,*ptr * 8 + 4); this->_pageTextures = (void *)0x0; } pvVar1 = (this->_charsBlock)._head; FID_conflict__Erase_tree_>_> (&this->_charsBlock, (fuzzer_allocator_> *)&this->_charsBlock, *(_Tree_node **)((int)pvVar1 + 4)); *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; (this->_charsBlock)._size = 0; this->_isLoaded = 0; this->_numChars = 0; this->_numPages = 0; ExceptionList = local_10; return; } //@@ 00a1ae70 Font::GetCharacterWidth /* DB: Lua Font table */ void Font::GetCharacterWidth(void) { FUN_00a1b510(); return; } //@@ 00a1ae80 Font::GetStringWidth /* ZHL [exact] __thiscall int Font::GetStringWidth(const char* str); prototype: REPENTOGON, confirmed by RET 4 */ int __thiscall Font::GetStringWidth(Font *this,byte *str) { int iVar1; iVar1 = get_string_width_n(this,str,-1); return iVar1; } //@@ 00a1aea0 Font::GetLineHeight /* DB: Lua Font table */ short __thiscall Font::GetLineHeight(Font *this) { return this->_lineHeight; } //@@ 00a1aeb0 Font::GetBaselineHeight /* DB: Lua Font table */ short __thiscall Font::GetBaselineHeight(Font *this) { return this->_base; } //@@ 00a1aec0 Font::DrawStringScaled /* DB: ? builds string, draws at scale 1,1 with KColor prototype: db/protos.zhl, confirmed by RET 16 */ void __thiscall Font::DrawStringScaled(Font *this,byte *text,Vector *pos,KColor *color,void *settings) { float y; uint uVar1; void *glyphs; undefined1 local_24 [16]; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1125d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; y = pos->y; local_14 = pos->x; glyphs = measure_string(this,local_24,text,settings,&g_vectorOne); local_8 = 0; render_glyph_quads(this,glyphs,local_14,y,1.0,1.0,*color,settings); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00a1af90 Font::DrawString /* DB: ? builds text layout then draws with color param_2; Console::RenderHistory */ void Font::DrawString(byte *param_1,KColor *param_2,void *param_3) { uint uVar1; void *glyphs; Font *in_ECX; float in_XMM2_Da; float in_XMM3_Da; undefined1 local_2c [16]; float local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1128d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; local_1c = in_XMM2_Da; local_18 = in_XMM3_Da; glyphs = measure_string(in_ECX,local_2c,param_1,param_3,&g_vectorOne); local_8 = 0; render_glyph_quads(in_ECX,glyphs,local_1c,local_18,1.0,1.0,*param_2,param_3); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00a1b050 Font::DrawString /* DB: Font::measure_string into a glyph vector then Font::render_glyph_quads, then frees the vector; called by Entity_Player::Render, Menu_OnlineLobby::Render, OnlineChat::render prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Font::DrawString(Font *this,byte *str,Vector *position,Vector *scale,KColor *color,void *settings) { float scaleY; float y; uint uVar1; void *glyphs; undefined1 local_2c [16]; float local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1128d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; scaleY = scale->y; local_18 = scale->x; y = position->y; local_1c = position->x; glyphs = measure_string(this,local_2c,str,settings,scale); local_8 = 0; render_glyph_quads(this,glyphs,local_1c,y,local_18,scaleY,*color,settings); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00a1b140 Font::DrawString /* DB: Lua Font table prototype: REPENTOGON, confirmed by RET 28 */ void __thiscall Font::DrawString(Font *this,byte *str,Vector pos,Vector scale,KColor *color,FontSettings *settings) { uint uVar1; void *glyphs; undefined1 local_2c [16]; Vector local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1128d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; local_1c.x = scale.x; local_1c.y = scale.y; glyphs = measure_string(this,local_2c,str,settings,&local_1c); local_8 = 0; render_glyph_quads(this,glyphs,pos.x,pos.y,scale.x,scale.y,*color,settings); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00a1b210 Font::draw_string_wide_unscaled /* DB: ? twin of Font::DrawString (00a1af90, measure_string + scale 1) built on Font::layout_glyphs/draw_glyph_run with scale &g_vectorOne (1,1); GenericPopup::Render, HUD_Message::UpdateTextImage prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall Font::draw_string_wide_unscaled(Font *this,short *text,float x,float y,KColor *color,void *settings) { uint uVar1; void *glyphRun; undefined1 local_2c [16]; float local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1128d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; local_1c = x; local_18 = y; glyphRun = layout_glyphs(this,local_2c,(byte *)text,settings,&g_vectorOne); local_8 = 0; draw_glyph_run(this,local_1c,local_18,glyphRun,1.0,1.0,*color,settings); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00a1b2d0 Font::draw_string_wide /* DB: ? same shape as Font::DrawString but via Font::layout_glyphs/draw_glyph_run; PlayerHUD::RenderPocketItems passes it the UTF-16 buffer produced by text_convert_encoding(0,buf,0x65,1) prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall Font::draw_string_wide (Font *this,short *text,float x,float y,float scaleX,float scaleY,KColor *color, void *settings) { uint uVar1; void *glyphRun; undefined1 local_34 [16]; Vector local_24; float local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b112bd; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; local_24.x = scaleX; local_24.y = scaleY; local_1c = x; local_18 = y; glyphRun = layout_glyphs(this,local_34,(byte *)text,settings,&local_24); local_8 = 0; draw_glyph_run(this,local_1c,local_18,glyphRun,scaleX,scaleY,*color,settings); std::vector<12byte>::clear(uVar1); std::vector<12byte>::_Tidy(); ExceptionList = local_10; return; } //@@ 00a1b3b0 Font::SetMissingCharacter /* DB: Lua Font table */ void __thiscall Font::SetMissingCharacter(Font *this,uint param_2) { uint uVar1; undefined1 local_10 [8]; void *local_8; uVar1 = param_2; this->_missingCharacter = -1; _Find_lower_bound<>(local_10,¶m_2); if (((*(char *)((int)local_8 + 0xd) == '\0') && (*(uint *)((int)local_8 + 0x10) <= uVar1)) && (local_8 != (this->_charsBlock)._head)) { this->_missingCharacter = *(int *)((int)local_8 + 0x14); return; } this->_missingCharacter = -1; return; } //@@ 00a1b410 FUN_00a1b410 undefined4 FUN_00a1b410(uint param_1,uint param_2) { uint uVar1; int in_ECX; int iVar2; undefined1 local_14 [8]; int local_c; int local_8; local_8 = in_ECX; _Find_lower_bound<>(local_14,¶m_1); uVar1 = param_2; if ((*(char *)(local_c + 0xd) == '\0') && (*(uint *)(local_c + 0x10) <= param_1)) { iVar2 = *(int *)(in_ECX + 0x40); if (local_c != iVar2) { return *(undefined4 *)(local_c + 0x14); } } else { iVar2 = *(int *)(in_ECX + 0x40); } if (param_2 != 0xffffffff) { _Find_lower_bound<>(local_14,¶m_2); if (((*(char *)(local_c + 0xd) == '\0') && (*(uint *)(local_c + 0x10) <= uVar1)) && (local_c != iVar2)) { return *(undefined4 *)(local_c + 0x14); } } return *(undefined4 *)(local_8 + 0x48); } //@@ 00a1b4a0 Font::get_kerning /* DB: ? thiscall (second, first): binary search of the sorted 16-byte {first,second,amount} vector at +0x2c..+0x30, returns (short) amount or 0; Font::render_glyph, get_string_width_n/_utf16 prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Font::get_kerning(Font *this,uint second,uint first) { uint *puVar1; uint uVar2; uint uVar3; uint *puVar4; puVar1 = (this->_kerningPairs)._end; puVar4 = (this->_kerningPairs)._begin; uVar2 = (int)puVar1 - (int)puVar4 >> 4; if (0 < (int)uVar2) { do { uVar3 = uVar2 >> 1; if ((puVar4[uVar3 * 4 + 1] <= second) && ((puVar4[uVar3 * 4 + 1] < second || (puVar4[uVar3 * 4] < first)))) { puVar4 = puVar4 + uVar3 * 4 + 4; uVar3 = uVar2 + (-1 - uVar3); } uVar2 = uVar3; } while (0 < (int)uVar3); } if (((puVar4 == puVar1) || (*puVar4 != first)) || (puVar4[1] != second)) { return 0; } return (int)(short)puVar4[2]; } //@@ 00a1b510 FUN_00a1b510 int FUN_00a1b510(uint param_1) { uint uVar1; int iVar2; char *in_ECX; undefined1 local_10 [8]; int local_8; uVar1 = param_1; if (*in_ECX != '\0') { _Find_lower_bound<>(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) == '\0') && (*(uint *)(local_8 + 0x10) <= uVar1)) && (local_8 != *(int *)(in_ECX + 0x40))) { iVar2 = *(int *)(local_8 + 0x14); } else { iVar2 = *(int *)(in_ECX + 0x48); } if (iVar2 != -1) { return (int)*(short *)(*(int *)(in_ECX + 0x28) + 0x10 + iVar2 * 0x14); } } return 0; } //@@ 00a1b580 Font::render_glyph /* DB: looks up glyph index (FUN_00a1b410), applies kerning (FUN_00a1b4a0) * scale, reads 0x14-byte glyph record (+4 src xy, +8 size, +0xc offset, +0x12 page) and draws a quad from page texture this+0x3c[page]; Font::render_glyph_quads, Font::draw_glyph_run */ void __thiscall Font::render_glyph(Font *this,uint param_2,undefined1 param_3,uint *param_4,float param_5, float param_6,float param_7,float param_8,KColor param_9,int param_10) { void *pvVar1; char cVar2; int iVar3; int iVar4; undefined4 *puVar5; undefined4 *extraout_EAX; int unused; KColor *color; int unused_00; undefined4 *puVar6; float fVar7; float fVar8; undefined1 local_1b8 [112]; undefined4 *local_148; undefined1 *local_144; uint *local_140; undefined2 local_13c; undefined4 local_138; undefined4 uStack_134; undefined4 uStack_130; undefined4 uStack_12c; undefined4 local_128; undefined4 uStack_124; undefined4 uStack_120; undefined4 uStack_11c; undefined4 local_118; undefined4 local_114 [28]; KColor local_a4; KColor local_90; KColor local_7c; KColor local_68; undefined1 local_4c [16]; KColor local_3c; float local_28; void *local_24; Vector local_20; Vector local_18; Vector local_10; local_20.y = (float)this; iVar3 = FUN_00a1b410(param_2,*(undefined4 *)(param_10 + 0x10)); if (iVar3 == -1) { return; } pvVar1 = this->_chars; local_18.y = (float)(int)*(short *)((int)pvVar1 + iVar3 * 0x14 + 0x10); local_24 = pvVar1; iVar4 = get_kerning(this,*param_4,param_2); local_28 = (float)iVar4 * param_7; fVar8 = param_5 - local_28; param_5 = fVar8; if (*(int *)(param_10 + 0x14) == 0) { local_10.x = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 8); local_10.y = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 10); local_20.x = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 4); local_20.y = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 6); fVar7 = param_7; quad_set_rect(local_4c,&local_20,&local_10,unused); local_10.x = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 8) * fVar7; local_10.y = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 10) * param_8; local_20.x = (float)(int)*(short *)((int)pvVar1 + iVar3 * 0x14 + 0xc) * fVar7 + fVar8; local_20.y = (float)(int)*(short *)((int)pvVar1 + iVar3 * 0x14 + 0xe) * param_8 + param_6; render_quad_set_rect(local_1b8,&local_20,&local_10,¶m_9); (**(code **)(**(int **)((int)this->_pageTextures + (uint)*(byte *)((int)pvVar1 + iVar3 * 0x14 + 0x12) * 8) + 0x14)) (local_4c,local_1b8,g_drawRectUnset); } else { local_148 = ¶m_2; local_144 = ¶m_3; local_140 = param_4; FUN_00a11080(); KColor::SetFromARGB(&local_3c,0xffffffff); ColorQuad::ColorQuad(local_114,color); KColor::SetFromARGB(&local_a4,0xffffffff); KColor::SetFromARGB(&local_90,0xffffffff); KColor::SetFromARGB(&local_7c,0xffffffff); KColor::SetFromARGB(&local_68,0xffffffff); local_13c = *(undefined2 *)((int)pvVar1 + iVar3 * 0x14 + 0x10); local_18.x = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 8); local_18.y = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 10); local_10.x = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 4); local_10.y = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 6); puVar5 = quad_set_rect(local_4c,&local_10,&local_18,unused_00); local_138 = *puVar5; uStack_134 = puVar5[1]; uStack_130 = puVar5[2]; uStack_12c = puVar5[3]; local_128 = puVar5[4]; uStack_124 = puVar5[5]; uStack_120 = puVar5[6]; uStack_11c = puVar5[7]; local_118 = puVar5[8]; local_10.x = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 8) * param_7; local_10.y = (float)*(ushort *)((int)pvVar1 + iVar3 * 0x14 + 10) * param_8; local_18.x = (float)(int)*(short *)((int)pvVar1 + iVar3 * 0x14 + 0xc) * param_7 + param_5; local_18.y = (float)(int)*(short *)((int)pvVar1 + iVar3 * 0x14 + 0xe) * param_8 + param_6; render_quad_set_rect(local_1b8,&local_18,&local_10,¶m_9); puVar5 = extraout_EAX; puVar6 = local_114; for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) { *puVar6 = *puVar5; puVar5 = puVar5 + 1; puVar6 = puVar6 + 1; } cVar2 = (**(code **)(param_10 + 0x14))(&local_148,*(undefined4 *)(param_10 + 0x18)); if (cVar2 == '\0') { return; } (**(code **)(**(int **)((int)*(void **)((int)local_20.y + 0x3c) + (uint)*(byte *)((int)local_24 + iVar3 * 0x14 + 0x12) * 8) + 0x14)) (&local_138,local_114,g_drawRectUnset); } *param_4 = param_2; return; } //@@ 00a1b8e0 Font::get_string_width_n /* WARNING: Removing unreachable block (ram,0x00a1b921) */ /* DB: Font::GetStringWidth(str) is a thin wrapper calling this(str,-1); ECX char* first byte=loaded flag; builds UTF8 CharacterIterator(str,len) prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Font::get_string_width_n(Font *this,byte *str,int length) { int iVar1; uint uVar2; uint first; int iVar3; uint local_30; uint local_2c; byte *local_28; uint local_24 [2]; byte *local_1c; byte *local_18; undefined1 local_14 [8]; void *local_c; if ((this->_isLoaded == 0) || (str == (byte *)0x0)) { return 0; } FUN_00a55a50(str,length); if (local_18 <= local_1c) { return 0; } local_30 = 0; local_28 = utf8_decode_next(local_1c,&local_30,local_18); first = local_30; local_2c = 0; local_30 = 0; uVar2 = 0; if (first != 0) { do { local_24[0] = first; _Find_lower_bound<>(local_14,local_24); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) <= first)) && (local_c != (this->_charsBlock)._head)) { iVar3 = *(int *)((int)local_c + 0x14); } else { iVar3 = this->_missingCharacter; } if (iVar3 != -1) { iVar1 = get_kerning(this,local_2c,first); local_30 = local_30 + (*(short *)((int)this->_chars + iVar3 * 0x14 + 0x10) - iVar1); local_2c = first; } if (local_18 <= local_28) break; local_24[0] = 0; local_28 = utf8_decode_next(local_28,local_24,local_18); first = local_24[0]; } while (local_24[0] != 0); uVar2 = local_30; } if ((int)uVar2 < 0) { uVar2 = 0; } return uVar2; } //@@ 00a1ba10 Font::get_string_width_utf16 /* DB: Font ECX (byte0 loaded, +0x40 glyph map, +0x48 missing glyph, +0x28 glyph table stride 0x14); iterates ushort chars with kerning FUN_00a1b4a0 summing advances; called by Font::layout_glyphs/draw_glyph_run and HUD text renderers prototype: db/protos.zhl, confirmed by RET 8 */ int __thiscall Font::get_string_width_utf16(Font *this,short *text,int length) { int iVar1; int iVar2; ushort *puVar3; uint first; int local_34; uint local_2c; uint local_28; void *local_24; ushort *local_1c; ushort *local_18; undefined1 local_14 [8]; void *local_c; if ((this->_isLoaded == 0) || (text == (short *)0x0)) { return 0; } FUN_00a55b00(text,length); iVar2 = 0; if (local_1c < local_18) { first = (uint)*local_1c; local_2c = 0; local_34 = 0; if (first != 0) { local_24 = (this->_charsBlock)._head; puVar3 = local_1c; do { puVar3 = puVar3 + 1; local_28 = first; _Find_lower_bound<>(local_14,&local_28); if (((*(char *)((int)local_c + 0xd) == '\0') && (*(uint *)((int)local_c + 0x10) <= first)) && (local_c != local_24)) { iVar2 = *(int *)((int)local_c + 0x14); } else { iVar2 = this->_missingCharacter; } if (iVar2 != -1) { iVar1 = get_kerning(this,local_2c,first); local_34 = local_34 + (*(short *)((int)this->_chars + iVar2 * 0x14 + 0x10) - iVar1); local_2c = first; } iVar2 = local_34; } while ((puVar3 < local_18) && (first = (uint)*puVar3, first != 0)); } } if (iVar2 < 0) { iVar2 = 0; } return iVar2; } //@@ 00a1bb10 Font::measure_string /* DB: ? (out Vector*, str, settings, scale=&1.0f): string size without drawing; used by Console::RenderHistory for wrapping and by the grid-index debug overlay to center text; sits between Font::DrawString and the glyph table code prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall Font::measure_string(Font *this,void *outLayout,byte *text,void *settings,Vector *scale) { byte *pbVar1; float scale_00; uint uVar2; ushort uVar3; uint uVar4; uint uVar5; uint uVar6; byte *pbVar7; byte local_28 [4]; byte *local_24; int local_20; int local_1c; byte *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1130b; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; if (*(int *)((int)settings + 8) == 1) { uVar3 = *(ushort *)((int)settings + 6); scale_00 = scale->x; *(undefined1 *)outLayout = 0; *(undefined4 *)((int)outLayout + 4) = 0; *(undefined4 *)((int)outLayout + 8) = 0; *(undefined4 *)((int)outLayout + 0xc) = 0; local_8 = 0; FormattedText::set(outLayout,text,this,(uint)uVar3,scale_00,0); ExceptionList = local_10; return outLayout; } local_28[0] = 0; local_24 = (byte *)0x0; local_20 = 0; local_1c = 0; local_8 = 1; std::vector<12byte>::clear(uVar4); FormattedText::split_lines(); local_28[0] = local_28[0] | 1; local_8 = 2; if (*(int *)((int)settings + 8) == 2) { uVar6 = (uint)*(ushort *)((int)settings + 6); local_14 = get_string_width_n(this,&DAT_00b1cec0,-1); if (uVar6 < local_14) { local_14 = uVar6; } local_14 = uVar6 - local_14; text = (byte *)0x0; local_18 = (byte *)((local_20 - (int)local_24) / 0xc); pbVar7 = local_24; if (local_18 != (byte *)0x0) { do { get_string_width_n(this,*(byte **)(pbVar7 + 4),(uint)*(ushort *)(pbVar7 + 8)); uVar5 = __ftoui3(); uVar2 = local_14; if (uVar6 < uVar5) { *(short *)(pbVar7 + 8) = *(short *)(pbVar7 + 8) + -1; *pbVar7 = *pbVar7 | 1; if (*(short *)(pbVar7 + 8) != 0) { uVar3 = *(ushort *)(pbVar7 + 8); do { get_string_width_n(this,*(byte **)(pbVar7 + 4),(uint)uVar3); uVar5 = __ftoui3(); if (uVar5 <= uVar2) break; pbVar1 = pbVar7 + 8; *(short *)pbVar1 = *(short *)pbVar1 + -1; uVar3 = *(ushort *)(pbVar7 + 8); } while (*(short *)pbVar1 != 0); } } text = text + 1; pbVar7 = pbVar7 + 0xc; } while (text < local_18); } } *(undefined1 *)outLayout = 0; *(undefined4 *)((int)outLayout + 4) = 0; *(undefined4 *)((int)outLayout + 8) = 0; *(undefined4 *)((int)outLayout + 0xc) = 0; local_8 = CONCAT31(local_8._1_3_,3); FormattedText::operator_assign(outLayout,local_28); std::vector<12byte>::clear(uVar4); if (local_24 != (byte *)0x0) { uVar4 = ((local_1c - (int)local_24) / 0xc) * 0xc; pbVar7 = local_24; if (0xfff < uVar4) { pbVar7 = *(byte **)(local_24 + -4); uVar4 = uVar4 + 0x23; if ((byte *)0x1f < local_24 + (-4 - (int)pbVar7)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar7,uVar4); } ExceptionList = local_10; return outLayout; } //@@ 00a1bd80 Font::render_glyph_quads /* DB: ? this Font (+0x14 line height); draws a vector of 12-byte glyph entries with 'KAGE_ColorTextureShader', alignment switch 3-8; Console::RenderHistory after layout 00a1bb10 prototype: db/protos.zhl, confirmed by RET 36 */ void __thiscall Font::render_glyph_quads (Font *this,void *glyphs,float x,float y,float scaleX,float scaleY,KColor color, void *settings) { byte *text; int iVar1; uint uVar2; byte bVar3; int iVar4; undefined4 *puVar5; int iVar6; uint uVar7; byte *pbVar8; uint uVar9; float fVar10; float fVar11; float fVar12; float fVar13; float local_3c; uint local_38; float local_34; undefined4 local_30; uint local_2c; byte *local_28; int local_24; byte *local_20; uint local_1c; uint local_18; float local_14; byte *local_10; float local_c; if (this->_isLoaded == 0) { return; } local_c = (float)(ushort)this->_lineHeight * *(float *)((int)settings + 0xc) * scaleY; local_3c = y; switch(*(undefined4 *)settings) { case 3: case 4: case 5: iVar4 = (*(int *)((int)glyphs + 8) - *(int *)((int)glyphs + 4)) / 0xc; local_3c = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * local_c * 0.5; break; case 6: case 7: case 8: iVar4 = (*(int *)((int)glyphs + 8) - *(int *)((int)glyphs + 4)) / 0xc; local_3c = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * local_c; break; default: goto switchD_00a1bdd5_default; } local_3c = y - local_3c; switchD_00a1bdd5_default: local_14 = x; shader_push((byte *)"KAGE_ColorTextureShader"); local_18 = (uint)*(ushort *)((int)settings + 4); uVar7 = 0; local_2c = 0; iVar4 = *(int *)((int)glyphs + 8); iVar6 = iVar4 - *(int *)((int)glyphs + 4); iVar1 = iVar6 >> 0x1f; if (iVar6 / 0xc + iVar1 != iVar1) { local_24 = 0; do { fVar12 = 3.0; if (local_2c < (uint)((iVar4 - *(int *)((int)glyphs + 4)) / 0xc)) { pbVar8 = (byte *)(local_24 + *(int *)((int)glyphs + 4)); local_28 = pbVar8; if (pbVar8 != (byte *)0x0) { local_34 = local_14; fVar10 = scaleX; switch(*(undefined4 *)settings) { case 1: case 4: case 7: fVar11 = local_14; iVar4 = get_string_width_n(this,*(byte **)(pbVar8 + 4),(uint)*(ushort *)(pbVar8 + 8)); bVar3 = *pbVar8; fVar13 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * scaleX; if ((bVar3 & 2) != 0) { iVar4 = FUN_00a1b510(0x2d); bVar3 = *pbVar8; fVar13 = fVar13 + (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * fVar10; } if ((bVar3 & 1) != 0) { iVar4 = FUN_00a1b510(0x2e); fVar13 = fVar13 + (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * fVar12 * fVar10; } local_34 = fVar11 - fVar13 * 0.5; break; case 2: case 5: case 8: fVar11 = local_14; iVar4 = get_string_width_n(this,*(byte **)(pbVar8 + 4),(uint)*(ushort *)(pbVar8 + 8)); bVar3 = *pbVar8; fVar13 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * scaleX; if ((bVar3 & 2) != 0) { iVar4 = FUN_00a1b510(0x2d); bVar3 = *pbVar8; fVar13 = fVar13 + (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * fVar10; } if ((bVar3 & 1) != 0) { iVar4 = FUN_00a1b510(0x2e); fVar13 = fVar13 + (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * fVar12 * fVar10; } local_34 = fVar11 - fVar13; break; default: } text = *(byte **)(pbVar8 + 4); local_10 = text + *(ushort *)(pbVar8 + 8); fVar12 = local_34; if (text < local_10) { local_38 = 0; local_20 = utf8_decode_next(text,&local_38,local_10); uVar9 = local_38; local_30 = 0xffffffff; local_38 = 0; if (uVar9 != 0) { while( true ) { uVar2 = local_38; local_1c = uVar7; if ((ushort)local_18 <= (ushort)uVar7) goto LAB_00a1c3f2; local_38 = local_38 + 1; fVar11 = local_3c; render_glyph(this,uVar9,uVar2,&local_30,fVar12,local_3c,fVar10,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); fVar12 = local_34 + fVar11; uVar7 = local_1c + 1 & 0xffff; local_34 = fVar12; if (local_10 <= local_20) break; local_1c = 0; local_20 = utf8_decode_next(local_20,&local_1c,local_10); if (local_1c == 0) break; uVar9 = local_1c; fVar10 = scaleX; } } pbVar8 = local_28; } else { local_30 = 0xffffffff; local_38 = 0; } uVar9 = local_38; if ((ushort)local_18 <= (ushort)uVar7) break; bVar3 = *pbVar8; if ((bVar3 & 2) != 0) { local_38 = local_38 + 1; fVar10 = local_3c; render_glyph(this,0x2d,uVar9,&local_30,fVar12,local_3c,scaleX,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); bVar3 = *pbVar8; fVar12 = local_34 + fVar10; local_34 = fVar12; } uVar9 = local_38; if ((bVar3 & 1) != 0) { fVar10 = local_3c; render_glyph(this,0x2e,local_38,&local_30,fVar12,local_3c,scaleX,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); local_10 = (byte *)(fVar10 + local_34); fVar12 = local_3c; render_glyph(this,0x2e,uVar9 + 1,&local_30,local_10,local_3c,scaleX,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); render_glyph(this,0x2e,uVar9 + 2,&local_30,fVar12 + (float)local_10,local_3c,scaleX, scaleY,color._red,color._green,color._blue,color._alpha,color._unk,settings ); } local_3c = local_c + local_3c; } } local_2c = local_2c + 1; local_24 = local_24 + 0xc; iVar4 = *(int *)((int)glyphs + 8); } while (local_2c < (uint)((iVar4 - *(int *)((int)glyphs + 4)) / 0xc)); } LAB_00a1c3f2: if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } uVar7 = g_shaderStackSize; puVar5 = (undefined4 *)FUN_00684fc0(); if (uVar7 - 1 == 0) { DAT_00c379d8 = 0; } g_shaderStackSize = uVar7 - 1; g_currentShader = (void *)*puVar5; return; } //@@ 00a1c480 Font::layout_glyphs /* DB: ? (out run, text, FontSettings*, size*) builds a vector of 12-byte glyph quads for a string; callers GenericPrompt::Render, GenericPopup::Render, HUD_Message::render_text_image prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall Font::layout_glyphs(Font *this,void *outRun,byte *text,void *settings,Vector *boxSize) { byte *pbVar1; byte **ppbVar2; float fVar3; int iVar4; Font *pFVar5; ushort uVar6; uint uVar7; Font *pFVar8; void *_Dst; int iVar9; uint uVar10; byte *pbVar11; byte *local_2c; int local_28; int local_24; Font *local_20; byte *local_1c; code *local_18; Font *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11363; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = this; if (*(int *)((int)settings + 8) == 1) { fVar3 = boxSize->x; *(undefined1 *)outRun = 0; *(undefined4 *)((int)outRun + 4) = 0; *(undefined4 *)((int)outRun + 8) = 0; *(undefined4 *)((int)outRun + 0xc) = 0; local_8 = 0; std::vector<12byte>::clear(uVar7); local_20 = local_14; local_14 = (Font *)&local_20; local_18 = FUN_00a56bf0; local_8 = CONCAT31(local_8._1_3_,1); local_1c = (byte *)fVar3; FormattedText::split_lines_converted((undefined4 *)((int)outRun + 4),FUN_00a56bf0,local_14); *(byte *)outRun = *(byte *)outRun | 1; ExceptionList = local_10; return outRun; } local_2c = (byte *)0x0; local_28 = 0; local_24 = 0; local_8 = 2; std::vector<12byte>::clear(uVar7); FormattedText::split_lines_utf16(); local_8 = 3; if (*(int *)((int)settings + 8) == 2) { uVar10 = (uint)*(ushort *)((int)settings + 6); uVar7 = get_string_width_n(this,&DAT_00b1cec0,-1); if (uVar10 < uVar7) { uVar7 = uVar10; } local_14 = (Font *)(uVar10 - uVar7); text = (byte *)0x0; local_1c = (byte *)((local_28 - (int)local_2c) / 0xc); pbVar11 = local_2c; if (local_1c != (byte *)0x0) { do { get_string_width_utf16(this,*(short **)(pbVar11 + 4),(uint)*(ushort *)(pbVar11 + 8)); uVar7 = __ftoui3(); pFVar5 = local_14; if (uVar10 < uVar7) { *(short *)(pbVar11 + 8) = *(short *)(pbVar11 + 8) + -1; *pbVar11 = *pbVar11 | 1; if (*(short *)(pbVar11 + 8) != 0) { uVar6 = *(ushort *)(pbVar11 + 8); do { get_string_width_utf16(this,*(short **)(pbVar11 + 4),(uint)uVar6); pFVar8 = (Font *)__ftoui3(); if (pFVar8 <= pFVar5) break; pbVar1 = pbVar11 + 8; *(short *)pbVar1 = *(short *)pbVar1 + -1; uVar6 = *(ushort *)(pbVar11 + 8); } while (*(short *)pbVar1 != 0); } } text = text + 1; pbVar11 = pbVar11 + 0xc; } while (text < local_1c); } } ppbVar2 = (byte **)((int)outRun + 4); *(undefined1 *)outRun = 0; *ppbVar2 = (byte *)0x0; *(undefined4 *)((int)outRun + 8) = 0; *(undefined4 *)((int)outRun + 0xc) = 0; local_8 = CONCAT31(local_8._1_3_,4); *(undefined1 *)outRun = 1; if (ppbVar2 != &local_2c) { std::vector<12byte>::assign(local_2c,local_28,outRun); } if (((*(byte *)outRun & 1) == 0) && (iVar9 = *(int *)((int)outRun + 8) - (int)*ppbVar2, text = (byte *)0x0, iVar4 = iVar9 >> 0x1f, iVar9 / 0xc + iVar4 != iVar4)) { boxSize = (Vector *)0x0; do { pbVar11 = *ppbVar2; _Dst = operator_new_tracked((uint)*(ushort *)((int)&boxSize[1].x + (int)pbVar11) * 2); memcpy(_Dst,*(void **)((int)&boxSize->y + (int)pbVar11), (uint)*(ushort *)((int)&boxSize[1].x + (int)pbVar11) * 2); *(void **)((int)&boxSize->y + (int)pbVar11) = _Dst; text = text + 1; boxSize = (Vector *)&boxSize[1].y; } while (text < (byte *)((*(int *)((int)outRun + 8) - (int)*ppbVar2) / 0xc)); } std::vector<12byte>::clear(); if (local_2c != (byte *)0x0) { uVar7 = ((local_24 - (int)local_2c) / 0xc) * 0xc; pbVar11 = local_2c; if (0xfff < uVar7) { pbVar11 = *(byte **)(local_2c + -4); uVar7 = uVar7 + 0x23; if ((byte *)0x1f < local_2c + (-4 - (int)pbVar11)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar11,uVar7); } ExceptionList = local_10; return outRun; } //@@ 00a1c7d0 Font::draw_glyph_run /* DB: ? called by GenericPrompt::Render and menu renders; KAGE_ColorTextureShader, horizontal alignment switch on FontSettings (3-5 center, 6-8 right) over 12-byte glyph vector, "Shader stack empty" prototype: db/protos.zhl, confirmed by RET 36 */ void __thiscall Font::draw_glyph_run (Font *this,float x,float y,void *glyphRun,float scaleX,float scaleY,KColor color, void *settings) { int iVar1; byte bVar2; undefined4 *puVar3; int iVar4; int iVar5; byte *pbVar6; ushort *puVar7; uint uVar8; float fVar9; float fVar10; float fVar11; float local_3c; int local_38; float local_34; undefined4 local_30; uint local_2c; byte *local_28; int local_24; uint local_20; uint local_1c; float local_18; uint local_14; ushort *local_10; float local_c; if (this->_isLoaded == 0) { return; } local_c = (float)(ushort)this->_lineHeight * *(float *)((int)settings + 0xc) * scaleY; local_3c = y; switch(*(undefined4 *)settings) { case 3: case 4: case 5: iVar5 = (*(int *)((int)glyphRun + 8) - *(int *)((int)glyphRun + 4)) / 0xc; local_3c = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * local_c * 0.5; break; case 6: case 7: case 8: iVar5 = (*(int *)((int)glyphRun + 8) - *(int *)((int)glyphRun + 4)) / 0xc; local_3c = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * local_c; break; default: goto switchD_00a1c825_default; } local_3c = y - local_3c; switchD_00a1c825_default: local_18 = x; shader_push((byte *)"KAGE_ColorTextureShader"); local_1c = (uint)*(ushort *)((int)settings + 4); uVar8 = 0; local_2c = 0; iVar5 = *(int *)((int)glyphRun + 8); iVar4 = iVar5 - *(int *)((int)glyphRun + 4); iVar1 = iVar4 >> 0x1f; if (iVar4 / 0xc + iVar1 != iVar1) { local_24 = 0; do { fVar11 = 3.0; if ((local_2c < (uint)((iVar5 - *(int *)((int)glyphRun + 4)) / 0xc)) && (pbVar6 = (byte *)(local_24 + *(int *)((int)glyphRun + 4)), local_28 = pbVar6, pbVar6 != (byte *)0x0)) { local_34 = local_18; fVar9 = scaleX; switch(*(undefined4 *)settings) { case 1: case 4: case 7: iVar5 = get_string_width_utf16(this,*(short **)(pbVar6 + 4),(uint)*(ushort *)(pbVar6 + 8)) ; bVar2 = *pbVar6; fVar10 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * scaleX; if ((bVar2 & 2) != 0) { iVar5 = FUN_00a1b510(0x2d); bVar2 = *pbVar6; fVar10 = fVar10 + (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * fVar9; } if ((bVar2 & 1) != 0) { iVar5 = FUN_00a1b510(0x2e); fVar10 = fVar10 + (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * fVar11 * fVar9; } local_34 = local_34 - fVar10 * 0.5; break; case 2: case 5: case 8: iVar5 = get_string_width_utf16(this,*(short **)(pbVar6 + 4),(uint)*(ushort *)(pbVar6 + 8)) ; bVar2 = *pbVar6; fVar10 = (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * scaleX; if ((bVar2 & 2) != 0) { iVar5 = FUN_00a1b510(0x2d); bVar2 = *pbVar6; fVar10 = fVar10 + (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * fVar9; } if ((bVar2 & 1) != 0) { iVar5 = FUN_00a1b510(0x2e); fVar10 = fVar10 + (float)((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) * fVar11 * fVar9; } local_34 = local_34 - fVar10; break; default: } puVar7 = *(ushort **)(pbVar6 + 4); local_10 = puVar7 + *(ushort *)(pbVar6 + 8); if (puVar7 < local_10) { local_20 = (uint)*puVar7; iVar5 = 0; local_30 = 0xffffffff; local_38 = 0; if (local_20 != 0) { while( true ) { puVar7 = puVar7 + 1; local_14 = uVar8; if ((ushort)local_1c <= (ushort)uVar8) goto LAB_00a1ce18; local_38 = iVar5 + 1; fVar11 = local_3c; render_glyph(this,local_20,iVar5,&local_30,local_34,local_3c,fVar9,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); local_34 = local_34 + fVar11; uVar8 = local_14 + 1 & 0xffff; if ((local_10 <= puVar7) || (local_20 = (uint)*puVar7, local_20 == 0)) break; iVar5 = local_38; fVar9 = scaleX; } } pbVar6 = local_28; } else { local_30 = 0xffffffff; local_38 = 0; } if ((ushort)local_1c <= (ushort)uVar8) break; bVar2 = *pbVar6; if ((bVar2 & 2) != 0) { fVar11 = local_3c; render_glyph(this,0x2d,local_38,&local_30,local_34,local_3c,scaleX,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); bVar2 = *pbVar6; local_34 = local_34 + fVar11; local_38 = local_38 + 1; } if ((bVar2 & 1) != 0) { fVar11 = local_3c; render_glyph(this,0x2e,local_38,&local_30,local_34,local_3c,scaleX,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); local_10 = (ushort *)(fVar11 + local_34); fVar11 = local_3c; render_glyph(this,0x2e,local_38 + 1,&local_30,local_10,local_3c,scaleX,scaleY,color._red, color._green,color._blue,color._alpha,color._unk,settings); render_glyph(this,0x2e,local_38 + 2,&local_30,fVar11 + (float)local_10,local_3c,scaleX, scaleY,color._red,color._green,color._blue,color._alpha,color._unk,settings); } local_3c = local_c + local_3c; } local_2c = local_2c + 1; local_24 = local_24 + 0xc; iVar5 = *(int *)((int)glyphRun + 8); } while (local_2c < (uint)((iVar5 - *(int *)((int)glyphRun + 4)) / 0xc)); } LAB_00a1ce18: if (g_shaderStackSize == 0) { KAGE_LogMessage(0x10,(byte *)"Shader stack empty\n"); } uVar8 = g_shaderStackSize; puVar3 = (undefined4 *)FUN_00684fc0(); if (uVar8 - 1 == 0) { DAT_00c379d8 = 0; } g_shaderStackSize = uVar8 - 1; g_currentShader = (void *)*puVar3; return; } //@@ 00a1cea0 std::vector<16byte>::_Resize_reallocate /* DB: grows to param_1 elements of 16 bytes (1.5x growth, Xlen at 0x0fffffff), zero-fills the new tail, memmoves the old range; Font::Load when resizing the vector at +0x2c */ void std::vector<16byte>::_Resize_reallocate(uint param_1) { void *pvVar1; void *_Dst; int iVar2; void *ptr; int *in_ECX; int iVar3; uint uVar4; uint size; if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar3 = in_ECX[1] - *in_ECX >> 4; uVar4 = in_ECX[2] - *in_ECX >> 4; if (0xfffffff - (uVar4 >> 1) < uVar4) { uVar4 = 0xfffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; if (uVar4 < param_1) { uVar4 = param_1; } else if (0xfffffff < uVar4) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = _Allocate(uVar4 * 0x10); iVar2 = param_1 - iVar3; if (iVar2 != 0) { memset((void *)(iVar3 * 0x10 + (int)_Dst),0,iVar2 * 0x10); } memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); pvVar1 = (void *)*in_ECX; if (pvVar1 != (void *)0x0) { size = in_ECX[2] - (int)pvVar1 & 0xfffffff0; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } *in_ECX = (int)_Dst; in_ECX[1] = (int)(param_1 * 0x10 + (int)_Dst); in_ECX[2] = (int)((int)_Dst + uVar4 * 0x10); return; } //@@ 00a1cfa0 std::_Sort_unchecked<16byte_u64key> /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: introsort over 16-byte elements (heap-sort fallback when depth budget <1, recursion with budget*3/4, insertion threshold 0x200 bytes = 32 elems) keyed by the uint64 at +0; Font::Load sorts its glyph/kerning vector (this+0x2c..+0x30) */ void std::_Sort_unchecked<16byte_u64key>(int param_1,undefined4 param_2) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; int iVar8; uint *puVar9; uint *in_ECX; uint *puVar10; uint *in_EDX; int iVar11; uint *puVar12; int iVar13; uint uVar14; undefined1 auStack_68 [12]; uint *local_5c; uint *local_58; uint *local_54; uint *local_50; int local_4c; int local_48; int local_44; uint local_40; uint uStack_3c; uint uStack_38; uint uStack_34; uint local_30; uint uStack_2c; uint uStack_28; uint uStack_24; uint local_14; local_14 = __security_cookie ^ (uint)auStack_68; local_5c = in_ECX; local_58 = in_EDX; if (0x200 < (int)((int)in_EDX - (int)in_ECX & 0xfffffff0U)) { do { if (param_1 < 1) { uVar7 = (int)local_58 - (int)in_ECX >> 4; iVar13 = (int)local_58 - (int)in_ECX >> 5; if (0 < iVar13) { local_44 = uVar7 - 1; local_48 = local_44 >> 1; local_54 = in_ECX + iVar13 * 4; do { uVar1 = local_54[-4]; uVar2 = local_54[-3]; uVar14 = local_54[-2]; uVar3 = local_54[-1]; local_54 = local_54 + -4; iVar13 = iVar13 + -1; iVar8 = iVar13; iVar11 = iVar13; if (iVar13 < local_48) { do { if ((in_ECX[iVar11 * 8 + 5] < in_ECX[iVar11 * 8 + 9]) || ((in_ECX[iVar11 * 8 + 5] <= in_ECX[iVar11 * 8 + 9] && (in_ECX[iVar11 * 8 + 4] <= in_ECX[iVar11 * 8 + 8])))) { iVar8 = 2; } else { iVar8 = 1; } iVar8 = iVar11 * 2 + iVar8; puVar12 = in_ECX + iVar8 * 4; uVar4 = puVar12[1]; uVar5 = puVar12[2]; uVar6 = puVar12[3]; puVar10 = in_ECX + iVar11 * 4; *puVar10 = *puVar12; puVar10[1] = uVar4; puVar10[2] = uVar5; puVar10[3] = uVar6; iVar11 = iVar8; } while (iVar8 < local_48); } if ((iVar8 == local_48) && ((uVar7 & 1) == 0)) { puVar10 = in_ECX + uVar7 * 4 + -4; uVar4 = puVar10[1]; uVar5 = puVar10[2]; uVar6 = puVar10[3]; puVar12 = in_ECX + iVar8 * 4; *puVar12 = *puVar10; puVar12[1] = uVar4; puVar12[2] = uVar5; puVar12[3] = uVar6; iVar8 = local_44; } while (iVar13 < iVar8) { iVar11 = iVar8 + -1 >> 1; if ((uVar2 < in_ECX[iVar11 * 4 + 1]) || ((uVar2 <= in_ECX[iVar11 * 4 + 1] && (uVar1 <= in_ECX[iVar11 * 4])))) break; puVar12 = in_ECX + iVar11 * 4; uVar4 = puVar12[1]; uVar5 = puVar12[2]; uVar6 = puVar12[3]; puVar10 = in_ECX + iVar8 * 4; *puVar10 = *puVar12; puVar10[1] = uVar4; puVar10[2] = uVar5; puVar10[3] = uVar6; iVar8 = iVar11; } puVar12 = in_ECX + iVar8 * 4; *puVar12 = uVar1; puVar12[1] = uVar2; puVar12[2] = uVar14; puVar12[3] = uVar3; local_4c = iVar13; } while (0 < iVar13); } puVar12 = local_58; if ((int)uVar7 < 2) { return; } do { local_5c = puVar12 + -4; local_30 = *local_5c; uStack_2c = puVar12[-3]; uStack_28 = puVar12[-2]; uStack_24 = puVar12[-1]; uVar14 = (int)local_5c - (int)in_ECX; uVar7 = in_ECX[1]; uVar1 = in_ECX[2]; uVar2 = in_ECX[3]; *local_5c = *in_ECX; puVar12[-3] = uVar7; puVar12[-2] = uVar1; puVar12[-1] = uVar2; FUN_00a1d4d0((int)uVar14 >> 4,&local_30,param_2); puVar12 = local_5c; } while (0x1f < (int)(uVar14 & 0xfffffff0)); return; } _Partition_by_median_guess_unchecked<16byte_u64key>(local_58,param_2); param_1 = (param_1 >> 1) + (param_1 >> 2); if ((int)((int)local_54 - (int)in_ECX & 0xfffffff0U) < (int)((int)local_58 - (int)local_50 & 0xfffffff0U)) { _Sort_unchecked<16byte_u64key>(param_1,param_2); local_5c = local_50; in_ECX = local_50; } else { _Sort_unchecked<16byte_u64key>(param_1,param_2); local_58 = local_54; } } while (0x200 < (int)((int)local_58 - (int)in_ECX & 0xfffffff0U)); } if ((in_ECX != local_58) && (puVar12 = in_ECX + 4, puVar12 != local_58)) { do { local_40 = *puVar12; local_54 = (uint *)puVar12[1]; uStack_38 = puVar12[2]; uStack_34 = puVar12[3]; if ((in_ECX[1] < local_54) || ((in_ECX[1] <= local_54 && (*in_ECX <= local_40)))) { puVar10 = puVar12; while( true ) { puVar9 = puVar10 + -4; if ((puVar10[-3] < local_54) || ((puVar10[-3] <= local_54 && (*puVar9 <= local_40)))) break; *puVar10 = *puVar9; puVar10[1] = puVar10[-3]; puVar10[2] = puVar10[-2]; puVar10[3] = puVar10[-1]; puVar10 = puVar9; } *puVar10 = local_40; puVar10[1] = (uint)local_54; puVar10[2] = uStack_38; puVar10[3] = uStack_34; in_ECX = local_5c; } else { uStack_3c = (uint)local_54; local_30 = local_40; uStack_2c = (uint)local_54; uStack_28 = uStack_38; uStack_24 = uStack_34; memmove((void *)((int)puVar12 + (0x10 - ((int)puVar12 - (int)in_ECX))),in_ECX, (int)puVar12 - (int)in_ECX); *in_ECX = local_40; in_ECX[1] = uStack_3c; in_ECX[2] = uStack_38; in_ECX[3] = uStack_34; } puVar12 = puVar12 + 4; } while (puVar12 != local_58); } return; } //@@ 00a1d280 std::_Partition_by_median_guess_unchecked<16byte_u64key> /* DB: median-of-3/ninther (count>40) then partitions 16-byte records by a 64-bit key; called from std::_Sort_unchecked<16byte_u64key> */ void std::_Partition_by_median_guess_unchecked<16byte_u64key>(uint *param_1,uint *param_2) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; int iVar7; uint *puVar8; undefined4 *in_ECX; uint uVar9; uint *puVar10; uint *puVar11; uint *in_EDX; undefined4 extraout_EDX; uint *puVar12; uint *puVar13; uint *puVar14; uint *puVar15; uint *local_10; uint *local_c; puVar8 = param_1 + -4; iVar7 = (int)puVar8 - (int)in_EDX >> 4; puVar12 = in_EDX + ((int)param_1 - (int)in_EDX >> 5) * 4; if (iVar7 < 0x29) { FUN_00a1d5a0(puVar8,param_2); } else { iVar7 = iVar7 + 1 >> 3; FUN_00a1d5a0(in_EDX + iVar7 * 8,param_2); FUN_00a1d5a0(puVar12 + iVar7 * 4,param_2); FUN_00a1d5a0(puVar8,param_2); FUN_00a1d5a0(extraout_EDX,param_2); } param_2 = puVar12 + 4; if (in_EDX < puVar12) { uVar9 = *puVar12; local_10 = (uint *)puVar12[1]; do { uVar1 = puVar12[-3]; uVar2 = puVar12[-4]; if ((uVar1 < local_10) || ((((uVar1 <= local_10 && (uVar2 < uVar9)) || (local_10 < uVar1)) || ((local_10 <= uVar1 && (uVar9 < uVar2)))))) break; puVar12 = puVar12 + -4; uVar9 = uVar2; local_10 = (uint *)uVar1; } while (in_EDX < puVar12); } if (param_2 < param_1) { while( true ) { uVar9 = param_2[1]; if (((uVar9 < puVar12[1]) || ((uVar9 <= puVar12[1] && (*param_2 < *puVar12)))) || (puVar12[1] < uVar9)) break; if (((puVar12[1] <= uVar9) && (*puVar12 < *param_2)) || (param_2 = param_2 + 4, param_1 <= param_2)) break; } } puVar8 = param_2; puVar10 = param_2; puVar13 = puVar12; LAB_00a1d39c: local_c = puVar12; LAB_00a1d39f: local_10 = puVar8; do { puVar15 = puVar12; if (puVar8 < param_1) { do { uVar9 = puVar8[1]; if ((uVar9 <= puVar13[1]) && ((uVar9 < puVar13[1] || (*puVar8 <= *puVar13)))) { if ((uVar9 < puVar13[1]) || ((uVar9 <= puVar13[1] && (*puVar8 < *puVar13)))) break; if (puVar10 != puVar8) { uVar9 = puVar8[1]; uVar1 = puVar8[2]; uVar2 = puVar8[3]; uVar3 = *puVar10; uVar4 = puVar10[1]; uVar5 = puVar10[2]; uVar6 = puVar10[3]; *puVar10 = *puVar8; puVar10[1] = uVar9; puVar10[2] = uVar1; puVar10[3] = uVar2; *puVar8 = uVar3; puVar8[1] = uVar4; puVar8[2] = uVar5; puVar8[3] = uVar6; } puVar10 = puVar10 + 4; } puVar8 = puVar8 + 4; } while (puVar8 < param_1); puVar15 = local_c; param_2 = puVar10; local_10 = puVar8; } puVar11 = puVar10; puVar14 = puVar13; puVar12 = puVar15; if (in_EDX < puVar15) { do { puVar8 = puVar12 + -4; uVar9 = puVar13[1]; puVar14 = puVar13; if ((uVar9 <= puVar12[-3]) && ((uVar9 < puVar12[-3] || (*puVar13 <= *puVar8)))) { if ((uVar9 < puVar12[-3]) || ((uVar9 <= puVar12[-3] && (*puVar13 < *puVar8)))) break; puVar14 = puVar13 + -4; if (puVar14 != puVar8) { uVar9 = puVar12[-3]; uVar1 = puVar12[-2]; uVar2 = puVar12[-1]; uVar3 = *puVar14; uVar4 = puVar13[-3]; uVar5 = puVar13[-2]; uVar6 = puVar13[-1]; *puVar14 = *puVar8; puVar13[-3] = uVar9; puVar13[-2] = uVar1; puVar13[-1] = uVar2; *puVar8 = uVar3; puVar12[-3] = uVar4; puVar12[-2] = uVar5; puVar12[-1] = uVar6; } } puVar15 = puVar15 + -4; puVar13 = puVar14; puVar12 = puVar8; } while (in_EDX < puVar15); puVar8 = local_10; puVar11 = param_2; local_c = puVar15; } if (puVar15 == in_EDX) break; puVar12 = puVar15 + -4; if (puVar8 != param_1) { uVar9 = *puVar8; uVar1 = puVar8[1]; uVar2 = puVar8[2]; uVar3 = puVar8[3]; uVar4 = puVar15[-3]; uVar5 = puVar15[-2]; uVar6 = puVar15[-1]; *puVar8 = *puVar12; puVar8[1] = uVar4; puVar8[2] = uVar5; puVar8[3] = uVar6; puVar8 = puVar8 + 4; *puVar12 = uVar9; puVar15[-3] = uVar1; puVar15[-2] = uVar2; puVar15[-1] = uVar3; puVar10 = puVar11; puVar13 = puVar14; goto LAB_00a1d39c; } puVar13 = puVar14 + -4; if (puVar12 != puVar13) { uVar9 = puVar14[-3]; uVar1 = puVar14[-2]; uVar2 = puVar14[-1]; uVar3 = *puVar12; uVar4 = puVar15[-3]; uVar5 = puVar15[-2]; uVar6 = puVar15[-1]; *puVar12 = *puVar13; puVar15[-3] = uVar9; puVar15[-2] = uVar1; puVar15[-1] = uVar2; *puVar13 = uVar3; puVar14[-3] = uVar4; puVar14[-2] = uVar5; puVar14[-1] = uVar6; } uVar9 = puVar11[-3]; uVar1 = puVar11[-2]; uVar2 = puVar11[-1]; puVar10 = puVar11 + -4; uVar3 = *puVar13; uVar4 = puVar14[-3]; uVar5 = puVar14[-2]; uVar6 = puVar14[-1]; *puVar13 = puVar11[-4]; puVar14[-3] = uVar9; puVar14[-2] = uVar1; puVar14[-1] = uVar2; *puVar10 = uVar3; puVar11[-3] = uVar4; puVar11[-2] = uVar5; puVar11[-1] = uVar6; param_2 = puVar10; local_c = puVar12; } while( true ); if (puVar8 == param_1) { *in_ECX = puVar14; in_ECX[1] = puVar11; return; } if (puVar11 != puVar8) { uVar9 = puVar11[1]; uVar1 = puVar11[2]; uVar2 = puVar11[3]; uVar3 = *puVar14; uVar4 = puVar14[1]; uVar5 = puVar14[2]; uVar6 = puVar14[3]; *puVar14 = *puVar11; puVar14[1] = uVar9; puVar14[2] = uVar1; puVar14[3] = uVar2; *puVar11 = uVar3; puVar11[1] = uVar4; puVar11[2] = uVar5; puVar11[3] = uVar6; } uVar9 = puVar8[1]; uVar1 = puVar8[2]; uVar2 = puVar8[3]; puVar10 = puVar11 + 4; uVar3 = *puVar14; uVar4 = puVar14[1]; uVar5 = puVar14[2]; uVar6 = puVar14[3]; *puVar14 = *puVar8; puVar14[1] = uVar9; puVar14[2] = uVar1; puVar14[3] = uVar2; puVar13 = puVar14 + 4; *puVar8 = uVar3; puVar8[1] = uVar4; puVar8[2] = uVar5; puVar8[3] = uVar6; puVar8 = puVar8 + 4; puVar12 = puVar15; param_2 = puVar10; goto LAB_00a1d39f; } //@@ 00a1d4d0 FUN_00a1d4d0 void FUN_00a1d4d0(uint param_1,uint *param_2) { undefined4 *puVar1; undefined4 *puVar2; uint *puVar3; uint uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; uint uVar8; uint uVar9; int iVar10; int in_ECX; int iVar11; int in_EDX; int iVar12; iVar12 = (int)(param_1 - 1) >> 1; iVar10 = in_EDX; while (iVar10 < iVar12) { iVar11 = iVar10 * 0x20 + in_ECX; if ((*(uint *)(iVar11 + 0x14) < *(uint *)(iVar11 + 0x24)) || ((*(uint *)(iVar11 + 0x14) <= *(uint *)(iVar11 + 0x24) && (*(uint *)(iVar11 + 0x10) <= *(uint *)(iVar11 + 0x20))))) { iVar11 = 2; } else { iVar11 = 1; } iVar11 = iVar10 * 2 + iVar11; puVar1 = (undefined4 *)(in_ECX + iVar11 * 0x10); uVar5 = puVar1[1]; uVar6 = puVar1[2]; uVar7 = puVar1[3]; puVar2 = (undefined4 *)(in_ECX + iVar10 * 0x10); *puVar2 = *puVar1; puVar2[1] = uVar5; puVar2[2] = uVar6; puVar2[3] = uVar7; iVar10 = iVar11; } if ((iVar10 == iVar12) && ((param_1 & 1) == 0)) { puVar2 = (undefined4 *)(in_ECX + -0x10 + param_1 * 0x10); uVar5 = puVar2[1]; uVar6 = puVar2[2]; uVar7 = puVar2[3]; puVar1 = (undefined4 *)(in_ECX + iVar10 * 0x10); *puVar1 = *puVar2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; iVar10 = param_1 - 1; } while (in_EDX < iVar10) { iVar12 = iVar10 + -1 >> 1; uVar4 = *(uint *)(in_ECX + 4 + iVar12 * 0x10); if ((param_2[1] < uVar4) || ((param_2[1] <= uVar4 && (*param_2 <= *(uint *)(in_ECX + iVar12 * 0x10))))) break; puVar1 = (undefined4 *)(in_ECX + iVar12 * 0x10); uVar5 = puVar1[1]; uVar6 = puVar1[2]; uVar7 = puVar1[3]; puVar2 = (undefined4 *)(in_ECX + iVar10 * 0x10); *puVar2 = *puVar1; puVar2[1] = uVar5; puVar2[2] = uVar6; puVar2[3] = uVar7; iVar10 = iVar12; } uVar4 = param_2[1]; uVar8 = param_2[2]; uVar9 = param_2[3]; puVar3 = (uint *)(in_ECX + iVar10 * 0x10); *puVar3 = *param_2; puVar3[1] = uVar4; puVar3[2] = uVar8; puVar3[3] = uVar9; return; } //@@ 00a1d5a0 FUN_00a1d5a0 void FUN_00a1d5a0(uint *param_1) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint *in_ECX; uint *in_EDX; uint uVar6; uint uVar7; uVar6 = *in_EDX; uVar7 = in_EDX[1]; if ((uVar7 < in_ECX[1]) || ((uVar7 <= in_ECX[1] && (uVar6 < *in_ECX)))) { uVar6 = in_ECX[1]; uVar7 = in_ECX[2]; uVar1 = in_ECX[3]; uVar2 = *in_EDX; uVar3 = in_EDX[1]; uVar4 = in_EDX[2]; uVar5 = in_EDX[3]; *in_EDX = *in_ECX; in_EDX[1] = uVar6; in_EDX[2] = uVar7; in_EDX[3] = uVar1; *in_ECX = uVar2; in_ECX[1] = uVar3; in_ECX[2] = uVar4; in_ECX[3] = uVar5; uVar6 = *in_EDX; uVar7 = in_EDX[1]; } if ((param_1[1] <= uVar7) && ((param_1[1] < uVar7 || (*param_1 < uVar6)))) { uVar6 = *param_1; uVar7 = param_1[1]; uVar1 = param_1[2]; uVar2 = param_1[3]; uVar3 = in_EDX[1]; uVar4 = in_EDX[2]; uVar5 = in_EDX[3]; *param_1 = *in_EDX; param_1[1] = uVar3; param_1[2] = uVar4; param_1[3] = uVar5; *in_EDX = uVar6; in_EDX[1] = uVar7; in_EDX[2] = uVar1; in_EDX[3] = uVar2; if ((in_EDX[1] <= in_ECX[1]) && ((in_EDX[1] < in_ECX[1] || (*in_EDX < *in_ECX)))) { uVar3 = in_ECX[1]; uVar4 = in_ECX[2]; uVar5 = in_ECX[3]; *in_EDX = *in_ECX; in_EDX[1] = uVar3; in_EDX[2] = uVar4; in_EDX[3] = uVar5; *in_ECX = uVar6; in_ECX[1] = uVar7; in_ECX[2] = uVar1; in_ECX[3] = uVar2; } } return; } //@@ 00a1d600 FUN_00a1d600 void FUN_00a1d600(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; return; } //@@ 00a1d610 std::list>::push_back /* DB: "list too long" check, operator_new(0x10) node {next,prev,a,b} linked before head; SaveSlotManager/MenuManager ctors, IsaacMain */ void std::list>::push_back(int param_1,int param_2) { int iVar1; undefined4 *puVar2; int *piVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11395; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; iVar1 = *in_ECX; if (in_ECX[1] == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 1; piVar3 = operator_new(0x10); piVar3[2] = param_1; piVar3[3] = param_2; in_ECX[1] = in_ECX[1] + 1; puVar2 = *(undefined4 **)(iVar1 + 4); *piVar3 = iVar1; piVar3[1] = (int)puVar2; *(int **)(iVar1 + 4) = piVar3; *puVar2 = piVar3; ExceptionList = local_10; return; } //@@ 00a1d6b0 FUN_00a1d6b0 void FUN_00a1d6b0(int param_1) { int *piVar1; int *ptr; int *in_ECX; piVar1 = (int *)*in_ECX; ptr = (int *)*piVar1; if (ptr != piVar1) { while (ptr[2] != param_1) { ptr = (int *)*ptr; if (ptr == piVar1) { return; } } *(int *)ptr[1] = *ptr; *(int *)(*ptr + 4) = ptr[1]; in_ECX[1] = in_ECX[1] + -1; ptr[2] = 0; ptr[3] = 0; operator_delete(ptr,0x10); } return; } //@@ 00a1d710 render_color_quad /* DB: KAGE_ColorShader, KColor::SetFromARGB prototype: db/protos.zhl, confirmed by RET 20 */ void render_color_quad(Vector *from,Vector *to,KColor *fromColor,KColor *toColor,float thickness) { void *this; KColor *color; int unused; float fVar1; float fVar2; float fVar3; float local_b0; float local_ac; float local_a8; float local_a4; float local_a0; float local_9c; float local_98; float local_94; float local_90; float fStack_8c; float fStack_88; float fStack_84; int local_80; float local_7c; float fStack_78; float fStack_74; float fStack_70; int local_6c; float local_68; float fStack_64; float fStack_60; float fStack_5c; int local_58; float local_54; float fStack_50; float fStack_4c; float fStack_48; int local_44; KColor local_40; undefined1 local_2c [40]; if ((fromColor->_alpha == 0.0) && (toColor->_alpha == 0.0)) { return; } shader_push((byte *)"KAGE_ColorShader"); FUN_00a11080(); KColor::SetFromARGB(&local_40,0xffffffff); ColorQuad::ColorQuad(&local_b0,color); fVar2 = to->y - from->y; fVar3 = to->x - from->x; fVar1 = sqrtf(fVar2 * fVar2 + fVar3 * fVar3); if (0.0 < fVar1) { fVar2 = fVar2 * (1.0 / fVar1); fVar3 = fVar3 * (1.0 / fVar1); } local_98 = -fVar2 * thickness * 0.5; local_80 = fromColor->_unk; fVar3 = thickness * 0.5 * fVar3; local_b0 = from->x - local_98; local_a0 = local_98 + from->x; local_ac = (from->y - fVar3) - 0.5; local_9c = (from->y + fVar3) - 0.5; local_a8 = to->x - local_98; local_98 = local_98 + to->x; local_a4 = (to->y - fVar3) - 0.5; local_94 = (fVar3 + to->y) - 0.5; local_68 = fromColor->_red; fStack_64 = fromColor->_green; fStack_60 = fromColor->_blue; fStack_5c = fromColor->_alpha; local_90 = fromColor->_red; fStack_8c = fromColor->_green; fStack_88 = fromColor->_blue; fStack_84 = fromColor->_alpha; local_54 = toColor->_red; fStack_50 = toColor->_green; fStack_4c = toColor->_blue; fStack_48 = toColor->_alpha; local_6c = toColor->_unk; local_7c = toColor->_red; fStack_78 = toColor->_green; fStack_74 = toColor->_blue; fStack_70 = toColor->_alpha; local_58 = local_80; local_44 = local_6c; this = kage_graphics_flush((void *)0x0); render_quad_draw(this,local_2c,&local_b0,1,unused); FUN_00a14200(); return; } //@@ 00a1d8f0 render_quad_draw_color_shader /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? arg float* color matrix (returns 0 when avg alpha of [0xb],[0x10],[0x15],[0x1a] is 0), builds 4 vertices and draws with KAGE_ColorShader; called right after render_quad_set_uniform_color in 008128f0, also 0042dbb0, 0094ef10 prototype: db/protos.zhl, confirmed by RET 4 */ void * render_quad_draw_color_shader(float *line,float thickness) { undefined4 *puVar1; void *pvVar2; int iVar3; int unused; float *this; int iVar4; float fVar5; float fVar6; float fVar7; float local_280; float local_27c; float local_278; KColor local_274; float local_260; float local_25c; float local_258; float local_254; float local_250; float local_24c; float local_248; float local_244; float local_240; float fStack_23c; float fStack_238; float fStack_234; float local_230; float local_22c; float fStack_228; float fStack_224; float fStack_220; float local_21c; float local_218; float fStack_214; float fStack_210; float fStack_20c; float local_208; float local_204; float fStack_200; float fStack_1fc; float fStack_1f8; float local_1f4; float local_1f0; float local_1ec; float local_1e8; float local_1e4; float local_1e0; float local_1dc; float local_1d8; float local_1d4; float local_1d0; float fStack_1cc; float fStack_1c8; float fStack_1c4; float local_1c0; float local_1bc; float fStack_1b8; float fStack_1b4; float fStack_1b0; float local_1ac; float local_1a8; float fStack_1a4; float fStack_1a0; float fStack_19c; float local_198; float local_194; float fStack_190; float fStack_18c; float fStack_188; float local_184; float local_180; float local_17c; float local_178; float local_174; float local_170; float local_16c; float local_168; float local_164; float local_160; float fStack_15c; float fStack_158; float fStack_154; float local_150; float local_14c; float fStack_148; float fStack_144; float fStack_140; float local_13c; float local_138; float fStack_134; float fStack_130; float fStack_12c; float local_128; float local_124; float fStack_120; float fStack_11c; float fStack_118; float local_114; float local_110; float local_10c; float local_108; float local_104; float local_100; float local_fc; float local_f8; float local_f4; float local_f0; float fStack_ec; float fStack_e8; float fStack_e4; float local_e0; float local_dc; float fStack_d8; float fStack_d4; float fStack_d0; float local_cc; float local_c8; float fStack_c4; float fStack_c0; float fStack_bc; float local_b8; float local_b4; float fStack_b0; float fStack_ac; float fStack_a8; float local_a4; undefined1 local_a0 [20]; undefined4 local_8c [32]; uint local_c; local_c = __security_cookie ^ (uint)&local_280; if ((line[0x10] + line[0xb] + line[0x15] + line[0x1a]) * 0.25 == 0.0) { return (void *)0x0; } puVar1 = local_8c; iVar3 = 4; do { iVar4 = iVar3; puVar1[-1] = 0; puVar1[-5] = 0; puVar1[-2] = 0; puVar1[-4] = 0; puVar1[1] = 0x3f800000; puVar1[-3] = 0x3f800000; puVar1[2] = 0x3f800000; *puVar1 = 0x3f800000; *(undefined1 *)(puVar1 + 3) = 0; iVar3 = iVar4 + -1; puVar1 = puVar1 + 9; } while (iVar3 != 0); iVar4 = iVar4 + 3; this = &local_260; local_278 = thickness; do { local_274._unk = 0; local_274._red = 1.0; local_274._green = 1.0; local_274._blue = 1.0; local_274._alpha = 1.0; ColorQuad::ColorQuad(this,&local_274); this = this + 0x1c; iVar4 = iVar4 + -1; } while (iVar4 != 0); local_280 = line[3] - line[1]; local_27c = line[2] - *line; fVar5 = sqrtf(local_280 * local_280 + local_27c * local_27c); if (0.0 < fVar5) { local_27c = local_27c * (1.0 / fVar5); local_280 = local_280 * (1.0 / fVar5); } local_248 = line[2]; local_278 = local_278 * 0.5; local_230 = line[0xc]; fVar5 = line[3]; fVar6 = -local_280 * local_278; fVar7 = local_27c * local_278; local_21c = line[0x11]; local_260 = *line - fVar6; local_27c = line[6] - local_248; local_250 = *line + fVar6; local_258 = local_248 - fVar6; local_248 = local_248 + fVar6; local_280 = line[7] - fVar5; local_25c = (line[1] - fVar7) - 0.5; local_24c = (line[1] + fVar7) - 0.5; local_254 = (fVar5 - fVar7) - 0.5; local_244 = (fVar5 + fVar7) - 0.5; local_218 = line[8]; fStack_214 = line[9]; fStack_210 = line[10]; fStack_20c = line[0xb]; local_240 = line[8]; fStack_23c = line[9]; fStack_238 = line[10]; fStack_234 = line[0xb]; local_204 = line[0xd]; fStack_200 = line[0xe]; fStack_1fc = line[0xf]; fStack_1f8 = line[0x10]; local_22c = line[0xd]; fStack_228 = line[0xe]; fStack_224 = line[0xf]; fStack_220 = line[0x10]; local_208 = local_230; local_1f4 = local_21c; fVar5 = sqrtf(local_27c * local_27c + local_280 * local_280); if (0.0 < fVar5) { local_27c = local_27c * (1.0 / fVar5); local_280 = local_280 * (1.0 / fVar5); } local_1d8 = -local_280 * local_278; local_1c0 = line[0x11]; local_27c = local_278 * local_27c; local_1f0 = line[2] - local_1d8; local_1e0 = line[2] + local_1d8; local_1ac = line[0x1b]; local_280 = line[6]; local_1e8 = local_280 - local_1d8; local_1d8 = local_280 + local_1d8; local_1ec = (line[3] - local_27c) - 0.5; local_1dc = (line[3] + local_27c) - 0.5; fVar5 = line[7]; local_1e4 = (fVar5 - local_27c) - 0.5; local_280 = line[4] - local_280; local_1d4 = (fVar5 + local_27c) - 0.5; local_27c = line[5] - fVar5; local_1a8 = line[0xd]; fStack_1a4 = line[0xe]; fStack_1a0 = line[0xf]; fStack_19c = line[0x10]; local_1d0 = line[0xd]; fStack_1cc = line[0xe]; fStack_1c8 = line[0xf]; fStack_1c4 = line[0x10]; local_194 = line[0x17]; fStack_190 = line[0x18]; fStack_18c = line[0x19]; fStack_188 = line[0x1a]; local_1bc = line[0x17]; fStack_1b8 = line[0x18]; fStack_1b4 = line[0x19]; fStack_1b0 = line[0x1a]; local_198 = local_1c0; local_184 = local_1ac; fVar5 = sqrtf(local_280 * local_280 + local_27c * local_27c); if (0.0 < fVar5) { local_27c = local_27c * (1.0 / fVar5); local_280 = local_280 * (1.0 / fVar5); } local_168 = -local_27c * local_278; local_150 = line[0x1b]; fVar5 = local_278 * local_280; local_180 = line[6] - local_168; local_170 = line[6] + local_168; local_13c = line[0x16]; local_280 = line[4]; local_178 = local_280 - local_168; local_168 = local_280 + local_168; local_17c = (line[7] - fVar5) - 0.5; local_16c = (line[7] + fVar5) - 0.5; local_27c = line[5]; local_174 = (local_27c - fVar5) - 0.5; local_280 = *line - local_280; local_164 = (local_27c + fVar5) - 0.5; local_27c = line[1] - local_27c; local_138 = line[0x17]; fStack_134 = line[0x18]; fStack_130 = line[0x19]; fStack_12c = line[0x1a]; local_160 = line[0x17]; fStack_15c = line[0x18]; fStack_158 = line[0x19]; fStack_154 = line[0x1a]; local_124 = line[0x12]; fStack_120 = line[0x13]; fStack_11c = line[0x14]; fStack_118 = line[0x15]; local_14c = line[0x12]; fStack_148 = line[0x13]; fStack_144 = line[0x14]; fStack_140 = line[0x15]; local_128 = local_150; local_114 = local_13c; fVar5 = sqrtf(local_280 * local_280 + local_27c * local_27c); if (fVar5 <= 0.0) { fVar6 = local_27c; fVar5 = local_280; } else { fVar6 = local_27c * (1.0 / fVar5); fVar5 = local_280 * (1.0 / fVar5); } local_108 = -fVar6 * local_278; local_e0 = line[0x16]; fVar5 = local_278 * fVar5; local_110 = line[4] - local_108; local_100 = line[4] + local_108; local_cc = line[0xc]; local_f8 = *line + local_108; local_108 = *line - local_108; local_10c = (line[5] - fVar5) - 0.5; local_fc = (fVar5 + line[5]) - 0.5; local_104 = (line[1] - fVar5) - 0.5; local_f4 = (fVar5 + line[1]) - 0.5; local_c8 = line[0x12]; fStack_c4 = line[0x13]; fStack_c0 = line[0x14]; fStack_bc = line[0x15]; local_f0 = line[0x12]; fStack_ec = line[0x13]; fStack_e8 = line[0x14]; fStack_e4 = line[0x15]; local_b4 = line[8]; fStack_b0 = line[9]; fStack_ac = line[10]; fStack_a8 = line[0xb]; local_dc = line[8]; fStack_d8 = line[9]; fStack_d4 = line[10]; fStack_d0 = line[0xb]; local_b8 = local_e0; local_a4 = local_cc; shader_push((byte *)"KAGE_ColorShader"); pvVar2 = kage_graphics_flush((void *)0x0); pvVar2 = render_quad_draw(pvVar2,local_a0,&local_260,4,unused); FUN_00a14200(); return pvVar2; } //@@ 00a1dfd0 render_color_shader_pass /* DB: binds "KAGE_ColorShader" when avg of 4 color components nonzero, used by Game::Render overlays prototype: db/protos.zhl, confirmed by RET 4 */ int render_color_shader_pass(void *quad) { void *pvVar1; int unused; undefined1 local_28 [36]; if ((*(float *)((int)quad + 0x40) + *(float *)((int)quad + 0x2c) + *(float *)((int)quad + 0x54) + *(float *)((int)quad + 0x68)) * 0.25 == 0.0) { return 0; } shader_push((byte *)"KAGE_ColorShader"); FUN_00a11080(); pvVar1 = kage_graphics_flush((void *)0x0); pvVar1 = render_quad_draw(pvVar1,local_28,quad,1,unused); FUN_00a14200(); return (int)pvVar1; } //@@ 00a1e050 FUN_00a1e050 void FUN_00a1e050(void) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b113d8; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Input::InputDeviceBase::vftable; *(undefined2 *)(in_ECX + 2) = 0; in_ECX[3] = DAT_00c7362c; DAT_00c7362c = DAT_00c7362c + 1; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; local_8 = 1; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; in_ECX[0x30] = 0; in_ECX[0x31] = 0; in_ECX[0x32] = 0xffffffff; in_ECX[0x33] = 4; in_ECX[0x34] = DAT_00c57b3c; in_ECX[0x35] = DAT_00c57b40; in_ECX[0x36] = 0; in_ECX[0x37] = 0; in_ECX[0x38] = 0; in_ECX[0x39] = 0; FUN_00a2c980(uVar1); *(ushort *)(in_ECX + 2) = *(ushort *)(in_ECX + 2) | 2; memset(in_ECX + 0x10,0,0x80); memset(in_ECX + 0x3a,0,0x284); ExceptionList = local_10; return; } //@@ 00a1e1b0 FUN_00a1e1b0 void FUN_00a1e1b0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Input::InputDeviceBase::vftable; FUN_00a1e2c0(); FUN_004b3950(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x370); } return; } //@@ 00a1e1f0 FUN_00a1e1f0 void FUN_00a1e1f0(void) { undefined4 *in_ECX; *in_ECX = KAGE::Input::InputDeviceBase::vftable; FUN_00a1e2c0(); FUN_004b3950(); return; } //@@ 00a1e210 FUN_00a1e210 undefined4 FUN_00a1e210(void) { longlong lVar1; void *pvVar2; int *in_ECX; (**(code **)(*in_ECX + 0x14))(); lVar1 = (ulonglong)(uint)(in_ECX[5] - in_ECX[4] >> 4) * 4; pvVar2 = tracked_alloc(0,(void *)0x0, (ulonglong)(-(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1)); in_ECX[0x30] = (int)pvVar2; lVar1 = (ulonglong)(uint)(in_ECX[5] - in_ECX[4] >> 4) * 4; pvVar2 = tracked_alloc(0,(void *)0x0, (ulonglong)(-(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1)); in_ECX[0x31] = (int)pvVar2; memset((void *)in_ECX[0x30],0,(in_ECX[5] - in_ECX[4] >> 4) << 2); memset((void *)in_ECX[0x31],0,(in_ECX[5] - in_ECX[4] >> 4) << 2); return 1; } //@@ 00a1e2c0 FUN_00a1e2c0 void FUN_00a1e2c0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0b60; local_10 = ExceptionList; ExceptionList = &local_10; if (*(void **)(in_ECX + 0xc0) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0xc0),0); *(undefined4 *)(in_ECX + 0xc0) = 0; } if (*(void **)(in_ECX + 0xc4) != (void *)0x0) { local_8 = 1; tracked_alloc(1,*(void **)(in_ECX + 0xc4),0); *(undefined4 *)(in_ECX + 0xc4) = 0; } ExceptionList = local_10; return; } //@@ 00a1e360 FUN_00a1e360 char * FUN_00a1e360(uint param_1) { if (param_1 < 0xabb1) { if (param_1 == 0xabb0) { return "Right Joystick Right"; } switch(param_1) { case 0xabab: return "Left Joystick Left"; case 0xabac: return "Left Joystick Right"; case 0xabad: return "Left Joystick Up"; case 0xabae: return "Left Joystick Down"; case 0xabaf: return "Right Joystick Left"; } } else if (param_1 < 0xcdce) { if (param_1 == 0xcdcd) { return "Touch Panel Primary"; } if (param_1 == 0xabb1) { return "Right Joystick Up"; } if (param_1 == 0xabb2) { return "Right Joystick Down"; } } else { if (param_1 == 0xcdce) { return "Touch Panel Secondary"; } if (param_1 == 0xffffffff) { return "None"; } } return "Unknown"; } //@@ 00a1e430 FUN_00a1e430 void FUN_00a1e430(void) { int *this; void *_Src; int iVar1; int in_ECX; uint count; void *_Dst; size_t _Size; iVar1 = DAT_00c799ec; _Src = DAT_00c799e8; this = (int *)(in_ECX + 0x10); if ((void **)this != &DAT_00c799e8) { _Dst = (void *)*this; count = DAT_00c799ec - (int)DAT_00c799e8 >> 4; if ((uint)(*(int *)(in_ECX + 0x18) - (int)_Dst >> 4) < count) { vector16_clear_and_reserve(this,count); _Dst = (void *)*this; } _Size = iVar1 - (int)_Src; memmove(_Dst,_Src,_Size); *(size_t *)(in_ECX + 0x14) = (int)_Dst + _Size; } return; } //@@ 00a1e490 FUN_00a1e490 void FUN_00a1e490(undefined4 param_1,undefined4 param_2) { int in_ECX; *(undefined4 *)(in_ECX + 200) = param_1; *(undefined4 *)(in_ECX + 0xcc) = param_2; return; } //@@ 00a1e4b0 FUN_00a1e4b0 undefined4 FUN_00a1e4b0(void) { float *pfVar1; uint uVar2; byte *pbVar3; int in_ECX; uint uVar4; undefined1 local_c [8]; if ((*(byte *)(in_ECX + 8) & 2) == 0) { return 0; } if ((((*(int *)(in_ECX + 0x20) != 0 || *(int *)(in_ECX + 0x24) != 0) || (*(int *)(in_ECX + 0x30) != 0 || *(int *)(in_ECX + 0x34) != 0)) || (pfVar1 = (float *)FUN_00a1eed0(local_c,0), 0.0 < *pfVar1 * *pfVar1 + pfVar1[1] * pfVar1[1])) || (pfVar1 = (float *)FUN_00a1eed0(local_c,1), 0.0 < *pfVar1 * *pfVar1 + pfVar1[1] * pfVar1[1]) ) { return 1; } uVar2 = 0; uVar4 = *(int *)(in_ECX + 0x14) - *(int *)(in_ECX + 0x10) >> 4; if (uVar4 != 0) { pfVar1 = *(float **)(in_ECX + 0xc0); do { if (*(float *)(in_ECX + 0xd4) <= *pfVar1) { return 1; } uVar2 = uVar2 + 1; pfVar1 = pfVar1 + 1; } while (uVar2 < uVar4); } uVar2 = 0; if (*(uint *)(in_ECX + 0x368) == 0) { return 0; } pbVar3 = (byte *)(in_ECX + 0x108); do { if ((*pbVar3 & 3) != 0) { return 1; } uVar2 = uVar2 + 1; pbVar3 = pbVar3 + 0x28; } while (uVar2 < *(uint *)(in_ECX + 0x368)); return 0; } //@@ 00a1e590 FUN_00a1e590 undefined4 FUN_00a1e590(void) { float *pfVar1; float fVar2; int iVar3; byte *pbVar4; int *in_ECX; uint uVar5; uint uVar6; if ((*(byte *)(in_ECX + 2) & 2) != 0) { iVar3 = (**(code **)(*in_ECX + 0x3c))(0); if (iVar3 != -1) { return 1; } uVar5 = 0; uVar6 = in_ECX[5] - in_ECX[4] >> 4; if (uVar6 != 0) { fVar2 = (float)in_ECX[0x35]; do { if ((fVar2 <= *(float *)(in_ECX[0x30] + uVar5 * 4)) && (pfVar1 = (float *)(in_ECX[0x31] + uVar5 * 4), *pfVar1 <= fVar2 && fVar2 != *pfVar1)) { return 1; } uVar5 = uVar5 + 1; } while (uVar5 < uVar6); } uVar5 = 0; if (in_ECX[0xda] != 0) { pbVar4 = (byte *)(in_ECX + 0x42); do { if ((*pbVar4 & 1) != 0) { return 1; } uVar5 = uVar5 + 1; pbVar4 = pbVar4 + 0x28; } while (uVar5 < (uint)in_ECX[0xda]); } } return 0; } //@@ 00a1e610 FUN_00a1e610 bool FUN_00a1e610(undefined4 param_1) { int *in_ECX; float10 extraout_ST0; (**(code **)(*in_ECX + 0x2c))(param_1); return 0.0 < (float)extraout_ST0; } //@@ 00a1e640 FUN_00a1e640 bool FUN_00a1e640(uint param_1) { char cVar1; int *in_ECX; uint uVar2; uint uVar3; undefined4 *puStack_40; uint uStack_3c; int iStack_28; if ((*(byte *)(in_ECX + 2) & 2) != 0) { uStack_3c = param_1; puStack_40 = (undefined4 *)0xa1e661; cVar1 = (**(code **)(*in_ECX + 0x24))(); if (cVar1 != '\0') { puStack_40 = ¶m_1; cVar1 = (**(code **)(*in_ECX + 0x8c))(); if (cVar1 == '\0') { cVar1 = (**(code **)(*in_ECX + 0x90))(¶m_1); uVar2 = param_1; if (cVar1 == '\0') { cVar1 = (**(code **)(*in_ECX + 0x94))(¶m_1); if (cVar1 != '\0') { FUN_00a1e760(); (**(code **)(*in_ECX + 100))(&puStack_40,uVar2); return iStack_28 == 1; } } else { uVar2 = 1 << (param_1 & 0x1f); uVar3 = 0; if (0x1f < param_1) { uVar3 = uVar2; } uVar2 = uVar2 ^ uVar3; if (0x3f < param_1) { uVar3 = uVar2; } if (((uVar2 & in_ECX[0xc]) != 0 || (in_ECX[0xd] & uVar3) != 0) && ((uVar2 & in_ECX[0xe]) == 0 && (in_ECX[0xf] & uVar3) == 0)) { return true; } } } else { uVar2 = 1 << (param_1 & 0x1f); uVar3 = 0; if (0x1f < param_1) { uVar3 = uVar2; } uVar2 = uVar2 ^ uVar3; if (0x3f < param_1) { uVar3 = uVar2; } if (((uVar2 & in_ECX[8]) != 0 || (in_ECX[9] & uVar3) != 0) && ((uVar2 & in_ECX[10]) == 0 && (in_ECX[0xb] & uVar3) == 0)) { return true; } } } } return false; } //@@ 00a1e760 FUN_00a1e760 void FUN_00a1e760(void) { int in_ECX; *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0xc) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; return; } //@@ 00a1e790 FUN_00a1e790 float10 FUN_00a1e790(uint param_1) { char cVar1; int *in_ECX; uint uVar2; uint uVar3; float fVar4; float fVar5; undefined4 uStack_38; int iStack_24; if ((*(byte *)(in_ECX + 2) & 2) != 0) { cVar1 = (**(code **)(*in_ECX + 0x8c))(¶m_1); if (cVar1 != '\0') { uStack_38 = 1.0; uVar3 = 1 << (param_1 & 0x1f); uVar2 = 0; if (0x1f < param_1) { uVar2 = uVar3; } uVar3 = uVar3 ^ uVar2; if (0x3f < param_1) { uVar2 = uVar3; } if ((uVar3 & in_ECX[8]) == 0 && (uVar2 & in_ECX[9]) == 0) { uStack_38 = 0.0; } return (float10)uStack_38; } cVar1 = (**(code **)(*in_ECX + 0x90))(¶m_1); uVar3 = param_1; if (cVar1 != '\0') { fVar5 = (float)in_ECX[0x34]; fVar4 = (float)in_ECX[param_1 + 0x10]; if (-fVar5 <= fVar4) { if (fVar4 <= fVar5) { return (float10)0.0; } fVar4 = fVar4 - fVar5; } else { fVar4 = fVar4 + fVar5; } return (float10)(fVar4 / (1.0 - fVar5)); } cVar1 = (**(code **)(*in_ECX + 0x94))(¶m_1); if (cVar1 != '\0') { FUN_00a1e760(); (**(code **)(*in_ECX + 100))((int)register0x00000010 + -0x3c,uVar3); fVar5 = 1.0; if (iStack_24 != 2) { fVar5 = 0.0; } return (float10)fVar5; } } return (float10)0; } //@@ 00a1e8d0 FUN_00a1e8d0 undefined4 FUN_00a1e8d0(uint param_1) { char cVar1; int *in_ECX; int iVar2; uint uVar3; int iVar4; if (((*(byte *)(in_ECX + 2) & 2) != 0) && (param_1 < (uint)(in_ECX[5] - in_ECX[4] >> 4))) { if ((float)in_ECX[0x35] <= *(float *)(in_ECX[0x30] + param_1 * 4)) { return 1; } uVar3 = 0; iVar4 = param_1 << 4; do { iVar2 = in_ECX[4]; if ((uint)(in_ECX[5] - iVar2 >> 4) <= param_1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar2 = in_ECX[4]; } if ((*(int *)(iVar4 + iVar2) != -1) && (cVar1 = (**(code **)(*in_ECX + 0x24))(*(int *)(iVar4 + iVar2)), cVar1 != '\0')) { return 1; } uVar3 = uVar3 + 1; iVar4 = iVar4 + 4; } while (uVar3 < 4); } return 0; } //@@ 00a1e970 FUN_00a1e970 undefined4 FUN_00a1e970(uint param_1) { float *pfVar1; float fVar2; char cVar3; int *in_ECX; int iVar4; uint uVar5; int iVar6; if (((*(byte *)(in_ECX + 2) & 2) != 0) && (param_1 < (uint)(in_ECX[5] - in_ECX[4] >> 4))) { fVar2 = (float)in_ECX[0x35]; if ((fVar2 <= *(float *)(in_ECX[0x30] + param_1 * 4)) && (pfVar1 = (float *)(in_ECX[0x31] + param_1 * 4), *pfVar1 <= fVar2 && fVar2 != *pfVar1)) { return 1; } uVar5 = 0; iVar6 = param_1 << 4; do { iVar4 = in_ECX[4]; if ((uint)(in_ECX[5] - iVar4 >> 4) <= param_1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar4 = in_ECX[4]; } if ((*(int *)(iVar6 + iVar4) != -1) && (cVar3 = (**(code **)(*in_ECX + 0x28))(*(int *)(iVar6 + iVar4)), cVar3 != '\0')) { return 1; } uVar5 = uVar5 + 1; iVar6 = iVar6 + 4; } while (uVar5 < 4); } return 0; } //@@ 00a1ea20 FUN_00a1ea20 float10 FUN_00a1ea20(uint param_1) { int *in_ECX; int iVar1; int iVar2; int iVar3; float10 fVar4; float fVar5; float local_8; if (((*(byte *)(in_ECX + 2) & 2) == 0) || ((uint)(in_ECX[5] - in_ECX[4] >> 4) <= param_1)) { return (float10)0; } iVar2 = 4; local_8 = *(float *)(in_ECX[0x30] + param_1 * 4); iVar3 = param_1 << 4; do { iVar1 = in_ECX[4]; if ((uint)(in_ECX[5] - iVar1 >> 4) <= param_1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar1 = in_ECX[4]; } if (*(int *)(iVar3 + iVar1) != -1) { fVar4 = (float10)(**(code **)(*in_ECX + 0x2c))(*(int *)(iVar3 + iVar1)); fVar5 = (float)fVar4; if ((float)fVar4 <= local_8) { fVar5 = local_8; } local_8 = fVar5; } iVar3 = iVar3 + 4; iVar2 = iVar2 + -1; } while (iVar2 != 0); return (float10)local_8; } //@@ 00a1ead0 FUN_00a1ead0 int FUN_00a1ead0(undefined4 param_1) { uint uVar1; uint uVar2; char cVar3; int *in_ECX; uint uVar4; uint uVar5; uint uVar6; int iVar7; uint uVar8; bool bVar9; bool bVar10; if ((*(byte *)(in_ECX + 2) & 2) != 0) { uVar6 = 0; do { bVar10 = false; switch(param_1) { case 0: bVar9 = uVar6 == 0; bVar10 = uVar6 == 1; break; case 1: bVar9 = uVar6 == 1; bVar10 = uVar6 == 0; break; case 2: bVar9 = uVar6 == 0; break; case 3: bVar10 = uVar6 == 0; goto LAB_00a1eb42; default: goto LAB_00a1eb9c; } if (bVar9) { iVar7 = 0; do { cVar3 = (**(code **)(*in_ECX + 0x28))(iVar7); if (cVar3 != '\0') { return iVar7; } iVar7 = iVar7 + 1; } while (iVar7 < 0x40); } else { LAB_00a1eb42: if (bVar10) { uVar1 = in_ECX[0xc]; uVar2 = in_ECX[0xd]; if (uVar1 != 0 || uVar2 != 0) { uVar8 = 0; do { uVar5 = 1 << (uVar8 & 0x1f); uVar4 = 0; if (0x1f < uVar8) { uVar4 = uVar5; } uVar5 = uVar5 ^ uVar4; if (0x3f < uVar8) { uVar4 = uVar5; } if ((uVar5 & (uVar1 ^ in_ECX[0xe]) & uVar1) != 0 || (uVar4 & (in_ECX[0xf] ^ uVar2) & uVar2) != 0) { return uVar8 + 0xabab; } uVar8 = uVar8 + 1; } while ((int)uVar8 < 0x40); } } } LAB_00a1eb9c: uVar6 = uVar6 + 1; } while (uVar6 < 2); } return -1; } //@@ 00a1ebe0 FUN_00a1ebe0 void FUN_00a1ebe0(undefined4 param_1,char param_2) { int *in_ECX; if (param_2 == '\0') { (**(code **)(*in_ECX + 0x44))(param_1,0); return; } (**(code **)(*in_ECX + 0x44))(param_1,0x3f800000); return; } //@@ 00a1ec20 FUN_00a1ec20 void FUN_00a1ec20(uint param_1,float param_2) { bool bVar1; bool bVar2; char cVar3; int *in_ECX; uint uVar4; uint uVar5; bVar1 = param_2 == (float)in_ECX[0x35]; bVar2 = param_2 < (float)in_ECX[0x35]; cVar3 = (**(code **)(*in_ECX + 0x8c))(¶m_1); if (cVar3 == '\0') { cVar3 = (**(code **)(*in_ECX + 0x90))(¶m_1); if (cVar3 != '\0') { uVar4 = 1 << (param_1 & 0x1f); uVar5 = 0; if (0x1f < param_1) { uVar5 = uVar4; } uVar4 = uVar4 ^ uVar5; if (0x3f < param_1) { uVar5 = uVar4; } if (bVar2 || bVar1) { uVar4 = in_ECX[0xc] & ~uVar4; uVar5 = in_ECX[0xd] & ~uVar5; } else { uVar4 = in_ECX[0xc] | uVar4; uVar5 = in_ECX[0xd] | uVar5; } in_ECX[0xc] = uVar4; in_ECX[0xd] = uVar5; in_ECX[param_1 + 0x10] = (int)param_2; } return; } uVar4 = 1 << (param_1 & 0x1f); uVar5 = 0; if (0x1f < param_1) { uVar5 = uVar4; } uVar4 = uVar4 ^ uVar5; if (0x3f < param_1) { uVar5 = uVar4; } if (bVar2 || bVar1) { in_ECX[8] = in_ECX[8] & ~uVar4; in_ECX[9] = in_ECX[9] & ~uVar5; return; } in_ECX[8] = in_ECX[8] | uVar4; in_ECX[9] = in_ECX[9] | uVar5; return; } //@@ 00a1ed10 FUN_00a1ed10 void FUN_00a1ed10(undefined4 param_1,char param_2) { int *in_ECX; if (param_2 == '\0') { (**(code **)(*in_ECX + 0x4c))(param_1,0); return; } (**(code **)(*in_ECX + 0x4c))(param_1,0x3f800000); return; } //@@ 00a1ed50 FUN_00a1ed50 void FUN_00a1ed50(uint param_1,undefined4 param_2) { int in_ECX; if (param_1 < (uint)(*(int *)(in_ECX + 0x14) - *(int *)(in_ECX + 0x10) >> 4)) { *(undefined4 *)(*(int *)(in_ECX + 0xc0) + param_1 * 4) = param_2; } return; } //@@ 00a1ed80 FUN_00a1ed80 void FUN_00a1ed80(uint param_1) { char cVar1; int *in_ECX; uint uVar2; uint uVar3; cVar1 = (**(code **)(*in_ECX + 0x8c))(¶m_1); if (cVar1 != '\0') { uVar2 = 1 << (param_1 & 0x1f); uVar3 = 0; if (0x1f < param_1) { uVar3 = uVar2; } uVar2 = uVar2 ^ uVar3; if (0x3f < param_1) { uVar3 = uVar2; } in_ECX[10] = in_ECX[10] | uVar2; in_ECX[0xb] = in_ECX[0xb] | uVar3; return; } cVar1 = (**(code **)(*in_ECX + 0x90))(¶m_1); if (cVar1 == '\0') { (**(code **)(*in_ECX + 0x94))(¶m_1); return; } uVar2 = 1 << (param_1 & 0x1f); uVar3 = 0; if (0x1f < param_1) { uVar3 = uVar2; } uVar2 = uVar2 ^ uVar3; if (0x3f < param_1) { uVar3 = uVar2; } in_ECX[0xe] = in_ECX[0xe] | uVar2; in_ECX[0xf] = in_ECX[0xf] | uVar3; return; } //@@ 00a1ee10 FUN_00a1ee10 void FUN_00a1ee10(uint param_1) { int *in_ECX; int iVar1; int iVar2; int iVar3; if (param_1 < (uint)(in_ECX[5] - in_ECX[4] >> 4)) { iVar2 = 4; iVar3 = param_1 << 4; do { iVar1 = in_ECX[4]; if ((uint)(in_ECX[5] - iVar1 >> 4) <= param_1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar1 = in_ECX[4]; } if (*(int *)(iVar3 + iVar1) != -1) { (**(code **)(*in_ECX + 0x50))(*(int *)(iVar3 + iVar1)); } iVar3 = iVar3 + 4; iVar2 = iVar2 + -1; } while (iVar2 != 0); } *(undefined4 *)(in_ECX[0x31] + param_1 * 4) = *(undefined4 *)(in_ECX[0x30] + param_1 * 4); return; } //@@ 00a1ee90 FUN_00a1ee90 void FUN_00a1ee90(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd0) = param_1; return; } //@@ 00a1eeb0 FUN_00a1eeb0 void FUN_00a1eeb0(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0xd4) = param_1; return; } //@@ 00a1eed0 FUN_00a1eed0 float * FUN_00a1eed0(float *param_1,undefined4 param_2) { float fVar1; int *in_ECX; float fVar2; (**(code **)(*in_ECX + 0x7c))(param_1,param_2); fVar2 = (float)in_ECX[0x34]; fVar1 = *param_1; if (-fVar2 <= fVar1) { if (fVar1 <= fVar2) { fVar2 = 0.0; } else { fVar2 = (fVar1 - fVar2) / (1.0 - fVar2); } } else { fVar2 = (fVar1 + fVar2) / (1.0 - fVar2); } *param_1 = fVar2; fVar2 = (float)in_ECX[0x34]; fVar1 = param_1[1]; if (fVar1 < -fVar2) { param_1[1] = (fVar1 + fVar2) / (1.0 - fVar2); return param_1; } if (fVar2 < fVar1) { param_1[1] = (fVar1 - fVar2) / (1.0 - fVar2); return param_1; } param_1[1] = 0.0; return param_1; } //@@ 00a1efa0 FUN_00a1efa0 uint FUN_00a1efa0(void) { char cVar1; int *in_ECX; uint uVar2; uVar2 = 0; if ((*(byte *)(in_ECX + 2) & 2) != 0) { cVar1 = (**(code **)(*in_ECX + 0x24))(0); if (cVar1 == '\0') { cVar1 = (**(code **)(*in_ECX + 0x24))(1); if (cVar1 != '\0') { uVar2 = 2; } } else { uVar2 = 1; } cVar1 = (**(code **)(*in_ECX + 0x24))(2); if (cVar1 != '\0') { return uVar2 | 4; } cVar1 = (**(code **)(*in_ECX + 0x24))(3); if (cVar1 != '\0') { uVar2 = uVar2 | 8; } } return uVar2; } //@@ 00a1f010 FUN_00a1f010 void FUN_00a1f010(void) { longlong lVar1; longlong lVar2; int *in_ECX; uint uVar3; int in_XMM1_Da; int in_XMM2_Da; ulonglong uVar4; in_ECX[0x36] = in_XMM1_Da; in_ECX[0x37] = in_XMM2_Da; uVar4 = GetTimeNs(); uVar3 = (uint)(uVar4 >> 0x20); lVar1 = (uVar4 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar3 * 0xd7b634db + ((uVar4 & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar3 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); in_ECX[0x38] = (uint)lVar1 >> 0x12 | uVar3 * 0x4000; in_ECX[0x39] = uVar3 >> 0x12; (**(code **)(*in_ECX + 0x84))(in_XMM1_Da,in_XMM2_Da); return; } //@@ 00a1f0e0 FUN_00a1f0e0 void FUN_00a1f0e0(undefined4 *param_1,int param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; uint uVar5; int in_ECX; int *piVar6; uVar5 = 0; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[6] = 0; param_1[7] = 0; *(undefined8 *)(param_1 + 8) = 0; if (*(uint *)(in_ECX + 0x368) != 0) { piVar6 = (int *)(in_ECX + 0x104); while ((param_2 != -1 && (*piVar6 != param_2))) { uVar5 = uVar5 + 1; piVar6 = piVar6 + 10; if (*(uint *)(in_ECX + 0x368) <= uVar5) { return; } } puVar1 = (undefined4 *)(in_ECX + 0xe8 + uVar5 * 0x28); uVar2 = puVar1[1]; uVar3 = puVar1[2]; uVar4 = puVar1[3]; *param_1 = *puVar1; param_1[1] = uVar2; param_1[2] = uVar3; param_1[3] = uVar4; puVar1 = (undefined4 *)(in_ECX + 0xf8 + uVar5 * 0x28); uVar2 = puVar1[1]; uVar3 = puVar1[2]; uVar4 = puVar1[3]; param_1[4] = *puVar1; param_1[5] = uVar2; param_1[6] = uVar3; param_1[7] = uVar4; *(undefined8 *)(param_1 + 8) = *(undefined8 *)(in_ECX + 0x108 + uVar5 * 0x28); } return; } //@@ 00a1f160 FUN_00a1f160 void FUN_00a1f160(undefined4 *param_1,int param_2,int param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; int *piVar5; int in_ECX; uint uVar6; uVar6 = 0; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[6] = 0; param_1[7] = 0; *(undefined8 *)(param_1 + 8) = 0; if (*(uint *)(in_ECX + 0x368) != 0) { piVar5 = (int *)(in_ECX + 0x104); while ((piVar5[-7] != param_2 || ((param_3 != -1 && (*piVar5 != param_3))))) { uVar6 = uVar6 + 1; piVar5 = piVar5 + 10; if (*(uint *)(in_ECX + 0x368) <= uVar6) { return; } } puVar1 = (undefined4 *)(in_ECX + 0xe8 + uVar6 * 0x28); uVar2 = puVar1[1]; uVar3 = puVar1[2]; uVar4 = puVar1[3]; *param_1 = *puVar1; param_1[1] = uVar2; param_1[2] = uVar3; param_1[3] = uVar4; puVar1 = (undefined4 *)(in_ECX + 0xf8 + uVar6 * 0x28); uVar2 = puVar1[1]; uVar3 = puVar1[2]; uVar4 = puVar1[3]; param_1[4] = *puVar1; param_1[5] = uVar2; param_1[6] = uVar3; param_1[7] = uVar4; *(undefined8 *)(param_1 + 8) = *(undefined8 *)(in_ECX + 0x108 + uVar6 * 0x28); } return; } //@@ 00a1f1f0 FUN_00a1f1f0 void FUN_00a1f1f0(void *param_1,int param_2) { undefined4 *puVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 *puVar6; int in_ECX; uint uVar7; memset(param_1,0,0x284); uVar7 = 0; if (*(int *)(in_ECX + 0x368) != 0) { puVar6 = (undefined4 *)(in_ECX + 0xe8); do { if ((param_2 == -1) || (puVar6[7] == param_2)) { iVar2 = *(int *)((int)param_1 + 0x280); *(int *)((int)param_1 + 0x280) = iVar2 + 1; uVar3 = puVar6[1]; uVar4 = puVar6[2]; uVar5 = puVar6[3]; puVar1 = (undefined4 *)((int)param_1 + iVar2 * 0x28); *puVar1 = *puVar6; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; uVar3 = puVar6[5]; uVar4 = puVar6[6]; uVar5 = puVar6[7]; puVar1 = (undefined4 *)((int)param_1 + iVar2 * 0x28 + 0x10); *puVar1 = puVar6[4]; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; uVar3 = puVar6[9]; puVar1 = (undefined4 *)((int)param_1 + iVar2 * 0x28 + 0x20); *puVar1 = puVar6[8]; puVar1[1] = uVar3; } uVar7 = uVar7 + 1; puVar6 = puVar6 + 10; } while (uVar7 < *(uint *)(in_ECX + 0x368)); } return; } //@@ 00a1f280 KAGE::Input::InputDevice::update /* DB: ? ECX=input device: copies current to previous state (axes +0x20.., action bitmaps +0xc0/+0xc4), clears, then vtable +0x78/+0x80 polling; "ActionId is out of range"; called per device from KAGE::Input::Manager::update_devices */ undefined1 KAGE::Input::InputDevice::update(void) { int iVar1; longlong lVar2; longlong lVar3; char cVar4; float *pfVar5; int iVar6; int *in_ECX; int iVar7; uint uVar8; uint uVar9; uint uVar10; int unaff_ESI; undefined4 uVar11; float fVar12; float fVar13; float fVar14; ulonglong uVar15; ulonglong uVar16; float afStack_18 [2]; float fStack_10; float fStack_c; in_ECX[10] = in_ECX[8]; in_ECX[0xb] = in_ECX[9]; in_ECX[0xe] = in_ECX[0xc]; in_ECX[0xf] = in_ECX[0xd]; memcpy((void *)in_ECX[0x31],(void *)in_ECX[0x30],(in_ECX[5] - in_ECX[4] >> 4) << 2); in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; memset((void *)in_ECX[0x30],0,(in_ECX[5] - in_ECX[4] >> 4) << 2); cVar4 = (**(code **)(*in_ECX + 0x78))(); if (cVar4 == '\0') { return 0; } cVar4 = (**(code **)(*in_ECX + 0x80))(); if (cVar4 != '\0') { (**(code **)(*in_ECX + 0x7c))(&fStack_10,0); fVar13 = (float)in_ECX[0x35]; if (-fVar13 <= fStack_10) { if (fVar13 < fStack_10) { in_ECX[0xc] = in_ECX[0xc] | 2; goto LAB_00a1f364; } } else { in_ECX[0xc] = in_ECX[0xc] | 1; LAB_00a1f364: in_ECX[0xd] = in_ECX[0xd]; } if (-fVar13 <= fStack_c) { if (fVar13 < fStack_c) { in_ECX[0xc] = in_ECX[0xc] | 8; goto LAB_00a1f384; } } else { in_ECX[0xc] = in_ECX[0xc] | 4; LAB_00a1f384: in_ECX[0xd] = in_ECX[0xd]; } pfVar5 = (float *)FUN_00a1eed0(afStack_18,0); fStack_10 = *pfVar5; fVar13 = pfVar5[1]; if (0.0 <= fStack_10) { fVar14 = 0.0; } else { fVar14 = -fStack_10; } fVar12 = fStack_10; if (fStack_10 <= 0.0) { fVar12 = 0.0; } in_ECX[0x10] = (int)fVar14; in_ECX[0x11] = (int)fVar12; if (0.0 <= fVar13) { fVar14 = 0.0; } else { fVar14 = -fVar13; } if (fVar13 <= 0.0) { fVar13 = 0.0; } in_ECX[0x12] = (int)fVar14; in_ECX[0x13] = (int)fVar13; } cVar4 = (**(code **)(*in_ECX + 0x80))(); if (cVar4 == '\0') goto LAB_00a1f4c9; (**(code **)(*in_ECX + 0x7c))(&fStack_10,1); fVar13 = (float)in_ECX[0x35]; if (-fVar13 <= fStack_10) { if (fVar13 < fStack_10) { in_ECX[0xc] = in_ECX[0xc] | 0x20; goto LAB_00a1f43c; } } else { in_ECX[0xc] = in_ECX[0xc] | 0x10; LAB_00a1f43c: in_ECX[0xd] = in_ECX[0xd]; } if (-fVar13 <= fStack_c) { if (fVar13 < fStack_c) { in_ECX[0xc] = in_ECX[0xc] | 0x80; goto LAB_00a1f45f; } } else { in_ECX[0xc] = in_ECX[0xc] | 0x40; LAB_00a1f45f: in_ECX[0xd] = in_ECX[0xd]; } pfVar5 = (float *)FUN_00a1eed0(afStack_18,1); fStack_10 = *pfVar5; fVar13 = pfVar5[1]; if (0.0 <= fStack_10) { fVar14 = 0.0; } else { fVar14 = -fStack_10; } fVar12 = fStack_10; if (fStack_10 <= 0.0) { fVar12 = 0.0; } in_ECX[0x14] = (int)fVar14; in_ECX[0x15] = (int)fVar12; if (0.0 <= fVar13) { fVar14 = 0.0; } else { fVar14 = -fVar13; } if (fVar13 <= 0.0) { fVar13 = 0.0; } in_ECX[0x16] = (int)fVar14; in_ECX[0x17] = (int)fVar13; LAB_00a1f4c9: if (in_ECX[0x33] != 4) { iVar6 = (**(code **)(*in_ECX + 0x3c))(0); if (iVar6 != -1) { iVar1 = in_ECX[0x33]; iVar7 = in_ECX[4]; uVar8 = in_ECX[0x32]; if ((uint)(in_ECX[5] - iVar7 >> 4) <= uVar8) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar7 = in_ECX[4]; } *(int *)(iVar7 + (iVar1 + uVar8 * 4) * 4) = iVar6; in_ECX[0x32] = -1; in_ECX[0x33] = 4; } } if ((*(byte *)(in_ECX + 2) & 8) == 0) { fVar13 = (float)in_ECX[0x36]; if (0.0 < fVar13) { fVar13 = (float)in_ECX[0x37]; uVar11 = 0; fStack_10 = fVar13; uVar15 = GetTimeNs(); uVar10 = (uint)(uVar15 >> 0x20); uVar16 = (ulonglong)uVar10 * 0xd7b634db + ((uVar15 & 0xffffffff) * 0xd7b634db >> 0x20); uVar9 = (uint)(uVar16 >> 0x20); fVar14 = (float)in_ECX[0x36]; uVar8 = (uint)((uVar15 & 0xffffffff) * 0x431bde82 + (uVar16 & 0xffffffff) >> 0x20); lVar2 = (ulonglong)uVar10 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar8),uVar9 + uVar8); uVar10 = (uint)((ulonglong)lVar2 >> 0x20); uVar8 = (uint)lVar2 >> 0x12 | uVar10 * 0x4000; afStack_18[0] = fVar14; if (((uVar10 >> 0x12) - in_ECX[0x39] != (uint)(uVar8 < (uint)in_ECX[0x38])) || (uVar8 != in_ECX[0x38])) { FUN_00aefe20(); fVar14 = afStack_18[0] - (float)(double)CONCAT44(uVar11,fVar13) * 0.001; in_ECX[0x36] = (int)fVar14; } if (0.0 < fVar14) { fVar13 = fStack_10; } else { in_ECX[0x36] = 0; fVar14 = 0.0; fVar13 = 0.0; } (**(code **)(*in_ECX + 0x84))(fVar14,fVar13); uVar16 = GetTimeNs(); uVar10 = (uint)(uVar16 >> 0x20); lVar2 = (uVar16 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar10 * 0xd7b634db + ((uVar16 & 0xffffffff) * 0xd7b634db >> 0x20); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar8 = (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar3); lVar2 = (ulonglong)uVar10 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar8),uVar9 + uVar8); uVar8 = (uint)((ulonglong)lVar2 >> 0x20); *(uint *)(unaff_ESI + 0xe0) = (uint)lVar2 >> 0x12 | uVar8 * 0x4000; *(uint *)(unaff_ESI + 0xe4) = uVar8 >> 0x12; return 1; } if (fVar13 < 0.0) { (**(code **)(*in_ECX + 0x84))(fVar13,in_ECX[0x37]); } } return 1; } //@@ 00a1f720 FUN_00a1f720 void FUN_00a1f720(float *param_1) { float fVar1; fVar1 = g_vectorZero.y; *param_1 = g_vectorZero.x; param_1[1] = fVar1; return; } //@@ 00a1f740 FUN_00a1f740 void FUN_00a1f740(int *param_1,int param_2) { int iVar1; int iVar2; int iVar3; int *piVar4; int in_ECX; int iVar5; uint uVar6; undefined4 *puVar7; undefined4 *puVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11411; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(*(int *)ThreadLocalStoragePointer + 0xc) < DAT_00c947d8) { _Init_thread_header(&DAT_00c947d8,__security_cookie ^ (int)register0x00000010 - 4U); if (DAT_00c947d8 == -1) { local_8 = 0; FUN_00a2c980(); _Init_thread_footer(&DAT_00c947d8); } } puVar7 = (undefined4 *)(in_ECX + 0xe8); puVar8 = &DAT_00c947e0; for (iVar5 = 0xa1; iVar5 != 0; iVar5 = iVar5 + -1) { *puVar8 = *puVar7; puVar7 = puVar7 + 1; puVar8 = puVar8 + 1; } memset((undefined4 *)(in_ECX + 0xe8),0,0x284); if (param_2 != 0) { iVar5 = 0; do { iVar1 = param_1[1]; iVar2 = param_1[2]; iVar3 = param_1[3]; uVar6 = 0; piVar4 = (int *)(in_ECX + 0xe8 + iVar5 * 0x28); *piVar4 = *param_1; piVar4[1] = iVar1; piVar4[2] = iVar2; piVar4[3] = iVar3; iVar1 = param_1[5]; iVar2 = param_1[6]; iVar3 = param_1[7]; piVar4 = (int *)(in_ECX + 0xf8 + iVar5 * 0x28); *piVar4 = param_1[4]; piVar4[1] = iVar1; piVar4[2] = iVar2; piVar4[3] = iVar3; *(undefined8 *)(in_ECX + 0x108 + iVar5 * 0x28) = *(undefined8 *)(param_1 + 8); if (DAT_00c94a60 != 0) { piVar4 = &DAT_00c947e0; do { if (*param_1 == *piVar4) { *(undefined4 *)(in_ECX + 0xec + iVar5 * 0x28) = (&DAT_00c947e4)[uVar6 * 10]; *(undefined4 *)(in_ECX + 0xf0 + iVar5 * 0x28) = (&DAT_00c947e8)[uVar6 * 10]; *(undefined4 *)(in_ECX + 0x108 + iVar5 * 0x28) = 2; *(undefined4 *)(in_ECX + 0xfc + iVar5 * 0x28) = (&DAT_00c947ec)[uVar6 * 10]; iVar1 = (&DAT_00c947f0)[uVar6 * 10]; goto LAB_00a1f83a; } uVar6 = uVar6 + 1; piVar4 = piVar4 + 10; } while (uVar6 < DAT_00c94a60); } *(undefined4 *)(in_ECX + 0x108 + iVar5 * 0x28) = 1; *(int *)(in_ECX + 0xec + iVar5 * 0x28) = param_1[3]; *(int *)(in_ECX + 0xf0 + iVar5 * 0x28) = param_1[4]; *(int *)(in_ECX + 0xfc + iVar5 * 0x28) = param_1[3]; iVar1 = param_1[4]; LAB_00a1f83a: *(int *)(in_ECX + 0x100 + iVar5 * 0x28) = iVar1; param_1 = param_1 + 10; *(int *)(in_ECX + 0x368) = *(int *)(in_ECX + 0x368) + 1; param_2 = param_2 + -1; iVar5 = *(int *)(in_ECX + 0x368); } while (param_2 != 0); } ExceptionList = local_10; return; } //@@ 00a1f8f0 FUN_00a1f8f0 bool FUN_00a1f8f0(uint *param_1) { return *param_1 < 0xabab; } //@@ 00a1f910 FUN_00a1f910 int FUN_00a1f910(uint *param_1) { uint uVar1; uint3 uVar2; uVar1 = *param_1 - 0xabab; uVar2 = (uint3)(uVar1 >> 8); if (uVar1 < 0x20) { *param_1 = uVar1; return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 00a1f930 FUN_00a1f930 int FUN_00a1f930(uint *param_1) { uint uVar1; uint3 uVar2; uVar1 = *param_1 - 0xcdcd; uVar2 = (uint3)(uVar1 >> 8); if (uVar1 < 2) { *param_1 = uVar1; return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 00a1f950 FUN_00a1f950 void FUN_00a1f950(byte param_1) { void *in_ECX; FUN_00a1f980(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x4c); } return; } //@@ 00a1f980 FUN_00a1f980 void FUN_00a1f980(void) { LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; *in_ECX = KAGE::Input::ManagerBase::vftable; FUN_00a1a500(); operator_delete((void *)in_ECX[0x11],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0xf],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0xd],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0xb],0x10); lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[7]; in_ECX[5] = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[7] = 0; } *(byte *)(in_ECX + 6) = *(byte *)(in_ECX + 6) & 0xfe; in_ECX[5] = KAGE::MutexBase::vftable; FUN_00a214f0(); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a1fa20 FUN_00a1fa20 undefined4 FUN_00a1fa20(void) { uint uVar1; uint *puVar2; int in_ECX; uint uVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11462; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(byte *)(in_ECX + 4) & 1) == 0) { (**(code **)(*(int *)(in_ECX + 0x14) + 4))(__security_cookie ^ (int)register0x00000010 - 4U); uVar1 = DAT_00c799f4; uVar3 = -(uint)((int)((ulonglong)DAT_00c799f4 * 8 >> 0x20) != 0) | (uint)((ulonglong)DAT_00c799f4 * 8); puVar2 = operator_new_tracked(-(uint)(0xfffffffb < uVar3) | uVar3 + 4); local_8 = 0; if (puVar2 == (uint *)0x0) { puVar2 = (uint *)0x0; } else { *puVar2 = uVar1; puVar2 = puVar2 + 1; _eh_vector_constructor_iterator_ (puVar2,8,uVar1,(_func_void_void_ptr *)&LAB_0040c5b0,FUN_004242b0); } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; *(uint **)(in_ECX + 0x20) = puVar2; } ExceptionList = local_10; return 1; } //@@ 00a1fad0 FUN_00a1fad0 void FUN_00a1fad0(void) { uint *ptr; void *pvVar1; int in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03640; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(byte *)(in_ECX + 4) & 1) != 0) { (**(code **)(*(int *)(in_ECX + 0x14) + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); FUN_00a21800(extraout_ECX); *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(in_ECX + 8); (**(code **)(*(int *)(in_ECX + 0x14) + 0x10))(); pvVar1 = *(void **)(in_ECX + 0x20); if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,8,*ptr,FUN_004242b0); operator_delete(ptr,*ptr * 8 + 4); local_8 = 0xffffffff; *(undefined4 *)(in_ECX + 0x20) = 0; } FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x2c) = *(undefined4 *)(in_ECX + 0x2c); *(int *)(*(int *)(in_ECX + 0x2c) + 4) = *(int *)(in_ECX + 0x2c); *(undefined4 *)(in_ECX + 0x30) = 0; FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)(in_ECX + 0x34); *(int *)(*(int *)(in_ECX + 0x34) + 4) = *(int *)(in_ECX + 0x34); *(undefined4 *)(in_ECX + 0x38) = 0; FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x3c) = *(undefined4 *)(in_ECX + 0x3c); *(int *)(*(int *)(in_ECX + 0x3c) + 4) = *(int *)(in_ECX + 0x3c); *(undefined4 *)(in_ECX + 0x40) = 0; FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(in_ECX + 0x44); *(int *)(*(int *)(in_ECX + 0x44) + 4) = *(int *)(in_ECX + 0x44); *(undefined4 *)(in_ECX + 0x48) = 0; (**(code **)(*(int *)(in_ECX + 0x14) + 8))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; } ExceptionList = local_10; return; } //@@ 00a1fc00 KAGE::Input::Manager::update_devices /* WARNING: Removing unreachable block (ram,0x00a1ff8a) */ /* WARNING: Removing unreachable block (ram,0x00a1ff90) */ /* WARNING: Removing unreachable block (ram,0x00a1ff9e) */ /* WARNING: Removing unreachable block (ram,0x00a1ffab) */ /* WARNING: Removing unreachable block (ram,0x00a1ffb4) */ /* WARNING: Removing unreachable block (ram,0x00a1ffbc) */ /* WARNING: Removing unreachable block (ram,0x00a1ffbf) */ /* WARNING: Removing unreachable block (ram,0x00a1ffd0) */ /* WARNING: Removing unreachable block (ram,0x00a1ffd3) */ /* WARNING: Removing unreachable block (ram,0x00a1ffe5) */ /* WARNING: Removing unreachable block (ram,0x00a1fff5) */ /* WARNING: Removing unreachable block (ram,0x00a1fffb) */ /* WARNING: Heritage AFTER dead removal. Example location: s0xffffff98 : 0x00a1fd51 */ /* WARNING: Restarted to delay deadcode elimination for space: stack */ /* DB: ? called by Input::Manager vtable slot 4 FUN_00a21cb0 right after the GLFW platform pollEvents and by Manager::Update; under the mutex at this+0x14 walks the device vector this+8..+0xc calling per-device virtuals */ void KAGE::Input::Manager::update_devices(void) { code *pcVar1; int *piVar2; int iVar3; undefined4 uVar4; char cVar5; undefined4 *puVar6; int *in_ECX; int *piVar7; undefined1 *puStack_6c; undefined4 uStack_68; int *piVar8; int *in_stack_ffffffa0; undefined4 *local_4c; undefined4 *local_48; int *local_3c; uint local_24; void *local_1c; undefined1 *puStack_18; int local_14; puStack_18 = &LAB_00b11495; local_1c = ExceptionList; ExceptionList = &local_1c; local_4c = (undefined4 *)0x0; local_48 = (undefined4 *)0x0; piVar7 = in_ECX + 5; local_14 = 0; if (piVar7 == (int *)0x0) { uStack_68 = (int *)0xa1fc72; KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar7 + 0xc))(); } local_14._0_1_ = 1; piVar8 = (int *)in_ECX[2]; if (piVar8 != (int *)in_ECX[3]) { do { cVar5 = InputDevice::update(); if (cVar5 == '\0') { pcVar1 = *(code **)(*in_ECX + 0x7c); piVar2 = (int *)piVar8[1]; if (piVar2 != (int *)0x0) { uStack_68 = (int *)0xa1fcd7; cVar5 = (**(code **)(*piVar2 + 4))(); if (cVar5 != '\0') { if (in_stack_ffffffa0 != (int *)0x0) { uStack_68 = (int *)0xa1fcec; cVar5 = (**(code **)(*in_stack_ffffffa0 + 0xc))(); if ((cVar5 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { puStack_6c = (undefined1 *)0xa1fcfe; uStack_68 = (int *)((int)register0x00000010 + -100); (*g_inputDeviceRelease)(); } } in_stack_ffffffa0 = piVar2; } } uStack_68 = (int *)0xa1fd14; (*pcVar1)(); pcVar1 = *(code **)(*in_ECX + 0x80); puStack_6c = (undefined1 *)0x0; uStack_68 = (int *)0x0; if (((((int *)piVar8[1] != (int *)0x0) && (cVar5 = (**(code **)(*(int *)piVar8[1] + 4))(), cVar5 != '\0')) && (uStack_68 != (int *)0x0)) && ((cVar5 = (**(code **)(*uStack_68 + 0xc))(), cVar5 != '\0' && (g_inputDeviceRelease != (void *)0x0)))) { (*g_inputDeviceRelease)(&puStack_6c); } (*pcVar1)(); FUN_00a21570(); local_14._0_1_ = 2; if (((*(int **)(in_ECX[3] + -4) != (int *)0x0) && (cVar5 = (**(code **)(**(int **)(in_ECX[3] + -4) + 0xc))(), cVar5 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } local_14._0_1_ = 1; in_ECX[3] = in_ECX[3] + -8; } else { if ((((*(byte *)((int *)*piVar8 + 2) & 1) == 0) && (cVar5 = (**(code **)(*(int *)*piVar8 + 0x1c))(), cVar5 != '\0')) && (local_24 = 0, DAT_00c799f4 != 0)) { iVar3 = in_ECX[8]; do { if (*(int *)(iVar3 + local_24 * 8) == 0) { puVar6 = (undefined4 *)FUN_00902d60(); uVar4 = puVar6[1]; puVar6[1] = *(undefined4 *)(iVar3 + 4 + local_24 * 8); *(undefined4 *)(iVar3 + 4 + local_24 * 8) = uVar4; uVar4 = *puVar6; *puVar6 = *(undefined4 *)(iVar3 + local_24 * 8); *(undefined4 *)(iVar3 + local_24 * 8) = uVar4; local_14._0_1_ = 3; if (((local_3c != (int *)0x0) && (cVar5 = (**(code **)(*local_3c + 0xc))(), cVar5 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(); } local_14._0_1_ = 1; *(ushort *)(*piVar8 + 8) = *(ushort *)(*piVar8 + 8) | 1; if (local_48 == (undefined4 *)0x0) { uStack_68 = (int *)0xa1fea9; std::vector<8byte>::_Emplace_reallocate(); } else { FUN_00902d60(); local_48 = local_48 + 2; } break; } local_24 = local_24 + 1; } while (local_24 < DAT_00c799f4); } piVar8 = piVar8 + 2; } } while (piVar8 != (int *)in_ECX[3]); } local_14._0_1_ = 4; (**(code **)(*piVar7 + 0x10))(); local_14 = (uint)local_14._1_3_ << 8; if (local_48 != (undefined4 *)0x0) { do { piVar7 = *(int **)in_ECX[0xf]; if (piVar7 != (int *)in_ECX[0xf]) { do { pcVar1 = (code *)piVar7[2]; uStack_68 = (int *)0x0; piVar8 = (int *)0x0; uVar4 = *local_4c; if ((int *)local_4c[1] != (int *)0x0) { puStack_6c = (undefined1 *)0xa1ff23; cVar5 = (**(code **)(*(int *)local_4c[1] + 4))(); if (cVar5 != '\0') { if (piVar8 != (int *)0x0) { puStack_6c = (undefined1 *)0xa1ff35; cVar5 = (**(code **)(*piVar8 + 0xc))(); if ((cVar5 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { puStack_6c = (undefined1 *)&uStack_68; (*g_inputDeviceRelease)(); } } uStack_68 = (int *)uVar4; } } puStack_6c = (undefined1 *)0xa1ff56; (*pcVar1)(); piVar7 = (int *)*piVar7; } while (piVar7 != (int *)in_ECX[0xf]); } local_4c = local_4c + 2; } while (local_4c != local_48); } ExceptionList = local_1c; return; } //@@ 00a20020 KAGE::Input::Manager::get_device_count /* DB: KAGE::Input::Manager vtable slot 7; locks the mutex at this+0x14 and returns (end-begin)>>3 of the device vector at this+8/+0xc (the 8-byte entries get_device copies); Console::RunCommand loops get_device over it */ int KAGE::Input::Manager::get_device_count(void) { int *piVar1; int iVar2; int iVar3; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x14); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } iVar2 = *(int *)(in_ECX + 0xc); iVar3 = *(int *)(in_ECX + 8); local_8 = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return iVar2 - iVar3 >> 3; } //@@ 00a200a0 FUN_00a200a0 int FUN_00a200a0(void) { int *piVar1; uint uVar2; int in_ECX; int iVar3; int iVar4; uint uVar5; uint uVar6; uint uVar7; uint uVar8; uint uVar9; uint uVar10; uint uVar11; uint uVar12; uint uVar13; uint uVar14; uint uVar15; uint uVar16; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x14); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } iVar4 = 0; uVar2 = 0; if (DAT_00c799f4 != 0) { if (7 < DAT_00c799f4) { uVar13 = 0; uVar14 = 0; uVar15 = 0; uVar16 = 0; uVar9 = 0; uVar10 = 0; uVar11 = 0; uVar12 = 0; iVar4 = *(int *)(in_ECX + 0x20); iVar3 = 0x10; do { uVar2 = uVar2 + 8; uVar5 = -(uint)(*(int *)(iVar3 + -0x10 + iVar4) == 0); uVar6 = -(uint)(*(int *)(iVar3 + -8 + iVar4) == 0); uVar7 = -(uint)(*(int *)(iVar3 + iVar4) == 0); uVar8 = -(uint)(*(int *)(iVar3 + 8 + iVar4) == 0); uVar13 = uVar13 + 1 & ~uVar5 | uVar5 & uVar13; uVar14 = uVar14 + 1 & ~uVar6 | uVar6 & uVar14; uVar15 = uVar15 + 1 & ~uVar7 | uVar7 & uVar15; uVar16 = uVar16 + 1 & ~uVar8 | uVar8 & uVar16; uVar5 = -(uint)(*(int *)(iVar3 + 0x10 + iVar4) == 0); uVar6 = -(uint)(*(int *)(iVar3 + 0x18 + iVar4) == 0); uVar7 = -(uint)(*(int *)(iVar3 + 0x20 + iVar4) == 0); uVar8 = -(uint)(*(int *)(iVar3 + 0x28 + iVar4) == 0); uVar9 = uVar9 + 1 & ~uVar5 | uVar5 & uVar9; uVar10 = uVar10 + 1 & ~uVar6 | uVar6 & uVar10; uVar11 = uVar11 + 1 & ~uVar7 | uVar7 & uVar11; uVar12 = uVar12 + 1 & ~uVar8 | uVar8 & uVar12; iVar3 = iVar3 + 0x40; } while (uVar2 < (DAT_00c799f4 & 0xfffffff8)); iVar4 = uVar9 + uVar13 + uVar11 + uVar15 + uVar10 + uVar14 + uVar12 + uVar16; } if (uVar2 < DAT_00c799f4) { iVar3 = iVar4; do { iVar4 = iVar3 + 1; if (*(int *)(*(int *)(in_ECX + 0x20) + uVar2 * 8) == 0) { iVar4 = iVar3; } uVar2 = uVar2 + 1; iVar3 = iVar4; } while (uVar2 < DAT_00c799f4); } } local_8 = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return iVar4; } //@@ 00a20240 KAGE::Input::Manager::get_device /* DB: KAGE::Input::Manager vtable slot 9; under the mutex at this+0x14 copies the shared_ptr device at index param_2 of the device vector (this+8, 8-byte entries) or the default device when out of range into *param_1; Manager::Init, PlayerManager::handle_coop_join prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall KAGE::Input::Manager::get_device(Manager *this,void *outDevice,uint index) { PersistentGameData *pPVar1; int iVar2; char cVar3; undefined4 uVar4; uint uVar5; uint uVar6; undefined1 local_28 [4]; int *local_24; undefined1 local_20 [4]; int *local_1c; PersistentGameData *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11518; local_10 = ExceptionList; ExceptionList = &local_10; pPVar1 = &this->_persistentGameData; local_14 = 0; local_18 = pPVar1; if (pPVar1 == (PersistentGameData *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*(int *)pPVar1 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_20 + 0x1c)); } local_8 = 1; iVar2 = this->_state; if (index < (uint)(this->_previousState - iVar2 >> 3)) { uVar4 = FUN_00902d60(iVar2 + index * 8); local_8 = CONCAT31(local_8._1_3_,2); uVar5 = 1; } else { uVar4 = SmartPointer::SmartPointer(iVar2); local_8 = 3; uVar5 = 2; } local_14 = uVar5; FUN_00902d60(uVar4); uVar6 = uVar5 | 4; local_14 = uVar6; if ((uVar5 & 2) != 0) { uVar6 = uVar5 & 0xfffffffd | 4; local_8 = 4; local_14 = uVar6; if (local_1c != (int *)0x0) { cVar3 = (**(code **)(*local_1c + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_20); } } } if ((uVar6 & 1) != 0) { local_14 = uVar6 & 0xfffffffe; local_8 = 5; if (local_24 != (int *)0x0) { cVar3 = (**(code **)(*local_24 + 0xc))(); if ((cVar3 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_28); } } } local_8 = 6; (**(code **)(*(int *)pPVar1 + 0x10))(); ExceptionList = local_10; return outDevice; } //@@ 00a20390 InputManager::get_device /* DB: locks mutex at this+0x14, scans vector of shared_ptr (+8..+0xc) for device whose +0xc == index, copies shared_ptr out; Entity_Player::GetMouseAimTarget calls it with ECX=0xc57b18 and _controllerIndex then dynamic_casts to NetInputDevice prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall InputManager::get_device(void *this,void *outDevice,int index) { int *piVar1; int *piVar2; int extraout_ECX; int extraout_ECX_00; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1154d; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x14); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); iVar3 = extraout_ECX; } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); iVar3 = extraout_ECX_00; } local_8 = 0; piVar2 = *(int **)((int)this + 8); do { if (piVar2 == *(int **)((int)this + 0xc)) { KAGE::SmartPointer::SmartPointer(iVar3); local_8 = 2; LAB_00a2040e: (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return outDevice; } iVar3 = *piVar2; if (*(int *)(iVar3 + 0xc) == index) { FUN_00902d60(piVar2); local_8 = 1; goto LAB_00a2040e; } piVar2 = piVar2 + 2; } while( true ); } //@@ 00a20440 FUN_00a20440 int FUN_00a20440(int param_1) { int *piVar1; int *piVar2; int in_ECX; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11570; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x14); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } iVar3 = 0; for (piVar2 = *(int **)(in_ECX + 8); piVar2 != *(int **)(in_ECX + 0xc); piVar2 = piVar2 + 2) { if (*(int *)(*piVar2 + 0xc) == param_1) goto LAB_00a204a9; iVar3 = iVar3 + 1; } iVar3 = -1; LAB_00a204a9: local_8 = 1; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return iVar3; } //@@ 00a204e0 FUN_00a204e0 int FUN_00a204e0(int param_1,int *param_2) { int *piVar1; char cVar2; int *piVar3; int in_ECX; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1159d; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x14); local_8 = 0; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } iVar4 = 0; for (piVar3 = *(int **)(in_ECX + 8); piVar3 != *(int **)(in_ECX + 0xc); piVar3 = piVar3 + 2) { if (*piVar3 == param_1) goto LAB_00a2054f; iVar4 = iVar4 + 1; } iVar4 = -1; LAB_00a2054f: local_8 = CONCAT31(local_8._1_3_,2); (**(code **)(*piVar1 + 0x10))(); local_8 = 3; if (((param_2 != (int *)0x0) && (cVar2 = (**(code **)(*param_2 + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } ExceptionList = local_10; return iVar4; } //@@ 00a205a0 InputManager::is_device_connected /* DB: calls vslot 0x28 (get device shared_ptr by index), releases it, returns ptr != 0; Entity_Player::Update, MenuManager::Update, coop_join_menu_update prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall InputManager::is_device_connected(void *this,int deviceIndex) { int iVar1; char cVar2; int *piVar3; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; ExceptionList = &local_10; piVar3 = (int *)(**(code **)(*(int *)this + 0x28)) (local_1c,deviceIndex,__security_cookie ^ (uint)(local_1c + 0x18)); iVar1 = *piVar3; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_1c); } } ExceptionList = local_10; return iVar1 != 0; } //@@ 00a20620 FUN_00a20620 uint FUN_00a20620(int param_1) { int iVar1; uint uVar2; int in_ECX; uVar2 = 0; if (DAT_00c799f4 != 0) { do { iVar1 = *(int *)(*(int *)(in_ECX + 0x20) + uVar2 * 8); if ((iVar1 != 0) && (*(int *)(iVar1 + 0xc) == param_1)) { return CONCAT31((int3)(uVar2 >> 8),1); } uVar2 = uVar2 + 1; } while (uVar2 < DAT_00c799f4); } return uVar2 & 0xffffff00; } //@@ 00a20660 FUN_00a20660 void FUN_00a20660(undefined1 param_1,undefined4 param_2) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a20680,¶m_1,0,0); return; } //@@ 00a20680 FUN_00a20680 uint FUN_00a20680(int param_1,int *param_2,char *param_3) { uint uVar1; char *pcVar2; ushort uVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar3 = *(ushort *)(param_1 + 8) | 2; if (*param_3 == '\0') { uVar3 = *(ushort *)(param_1 + 8) & 0xfffd; } *(ushort *)(param_1 + 8) = uVar3; local_8 = 0; pcVar2 = param_3; if (param_2 != (int *)0x0) { pcVar2 = (char *)(**(code **)(*param_2 + 0xc))(uVar1); if (((char)pcVar2 != '\0') && (pcVar2 = (char *)0x0, g_inputDeviceRelease != (void *)0x0)) { pcVar2 = (char *)(*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return (uint)pcVar2 & 0xffffff00; } //@@ 00a20710 FUN_00a20710 void FUN_00a20710(undefined1 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a20730,¶m_1,0,param_3); return; } //@@ 00a20730 FUN_00a20730 undefined1 FUN_00a20730(int *param_1,int *param_2,undefined4 *param_3) { undefined1 uVar1; char cVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b115cd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = (**(code **)(*param_1 + 0x24))(*param_3,__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 1; if (param_2 != (int *)0x0) { cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar1; } //@@ 00a207b0 FUN_00a207b0 void FUN_00a207b0(undefined1 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a207d0,¶m_1,0,param_3); return; } //@@ 00a207d0 FUN_00a207d0 undefined1 FUN_00a207d0(int *param_1,int *param_2,undefined4 *param_3) { undefined1 uVar1; char cVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b115cd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = (**(code **)(*param_1 + 0x28))(*param_3,__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 1; if (param_2 != (int *)0x0) { cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar1; } //@@ 00a20850 FUN_00a20850 float10 FUN_00a20850(undefined1 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; float local_8; local_8 = 0.0; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a20880,¶m_1,&local_8,param_3); return (float10)local_8; } //@@ 00a20880 FUN_00a20880 bool FUN_00a20880(int *param_1,int *param_2,undefined4 *param_3,float *param_4) { bool bVar1; char cVar2; float10 fVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b115fd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; fVar3 = (float10)(**(code **)(*param_1 + 0x2c)) (*param_3,__security_cookie ^ (int)register0x00000010 - 4U); param_3 = (undefined4 *)(float)fVar3; bVar1 = (float)param_3 != 0.0; *param_4 = (float)param_3; local_8 = 1; if (((param_2 != (int *)0x0) && (cVar2 = (**(code **)(*param_2 + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } ExceptionList = local_10; return bVar1; } //@@ 00a20920 FUN_00a20920 void FUN_00a20920(undefined1 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a20940,¶m_1,0,param_3); return; } //@@ 00a20940 FUN_00a20940 undefined1 FUN_00a20940(int *param_1,int *param_2,undefined4 *param_3) { undefined1 uVar1; char cVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b115cd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = (**(code **)(*param_1 + 0x30))(*param_3,__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 1; if (param_2 != (int *)0x0) { cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar1; } //@@ 00a209c0 FUN_00a209c0 void FUN_00a209c0(undefined1 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a209e0,¶m_1,0,param_3); return; } //@@ 00a209e0 FUN_00a209e0 undefined1 FUN_00a209e0(int *param_1,int *param_2,undefined4 *param_3) { undefined1 uVar1; char cVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b115cd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = (**(code **)(*param_1 + 0x34))(*param_3,__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 1; if (param_2 != (int *)0x0) { cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar1; } //@@ 00a20a60 FUN_00a20a60 bool FUN_00a20a60(undefined4 param_1,undefined4 param_2,undefined4 param_3) { char cVar1; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0x4c))(param_1,param_2,param_3); return cVar1 == '\0'; } //@@ 00a20a80 FUN_00a20a80 float10 FUN_00a20a80(undefined1 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; float local_8; local_8 = 0.0; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a20ab0,¶m_1,&local_8,param_3); return (float10)local_8; } //@@ 00a20ab0 FUN_00a20ab0 bool FUN_00a20ab0(int *param_1,int *param_2,undefined4 *param_3,float *param_4) { bool bVar1; char cVar2; float10 fVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b115fd; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; fVar3 = (float10)(**(code **)(*param_1 + 0x38)) (*param_3,__security_cookie ^ (int)register0x00000010 - 4U); param_3 = (undefined4 *)(float)fVar3; bVar1 = (float)param_3 != 0.0; *param_4 = (float)param_3; local_8 = 1; if (((param_2 != (int *)0x0) && (cVar2 = (**(code **)(*param_2 + 0xc))(), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } ExceptionList = local_10; return bVar1; } //@@ 00a20b50 FUN_00a20b50 void FUN_00a20b50(undefined1 param_1,undefined1 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_3,FUN_00a20b70,¶m_1,¶m_2,0); return; } //@@ 00a20b70 FUN_00a20b70 uint FUN_00a20b70(undefined1 param_1,int *param_2) { uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c45d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = FUN_00a1f010(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 1; if (param_2 != (int *)0x0) { uVar1 = (**(code **)(*param_2 + 0xc))(); if (((char)uVar1 != '\0') && (uVar1 = 0, g_inputDeviceRelease != (void *)0x0)) { uVar1 = (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar1 & 0xffffff00; } //@@ 00a20bf0 FUN_00a20bf0 void FUN_00a20bf0(undefined1 param_1,undefined4 param_2) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_2,FUN_00a20c10,¶m_1,0,0); return; } //@@ 00a20c10 FUN_00a20c10 uint FUN_00a20c10(int *param_1,int *param_2,char *param_3) { longlong lVar1; longlong lVar2; longlong lVar3; int *piVar4; uint uVar5; ulonglong uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar4 = param_1; puStack_c = &LAB_00b1162d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar5 = CONCAT31((int3)((uint)param_3 >> 8),*(byte *)(param_1 + 2) >> 3) & 0xffffff01; if (*param_3 != (char)uVar5) { if (*param_3 == '\0') { uVar6 = GetTimeNs(); uVar5 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar5 * 0x431bde82; param_3 = (char *)lVar2; lVar3 = (ulonglong)uVar5 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); lVar2 = lVar2 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar1) >> 0x20)); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); piVar4[0x38] = (uint)lVar2 >> 0x12 | uVar5 * 0x4000; piVar4[0x39] = uVar5 >> 0x12; uVar5 = *(ushort *)(piVar4 + 2) & 0xfff7; *(short *)(piVar4 + 2) = (short)uVar5; } else { (**(code **)(*param_1 + 0x84))(0,0,__security_cookie ^ (int)register0x00000010 - 4U); uVar5 = *(ushort *)(piVar4 + 2) | 8; *(short *)(piVar4 + 2) = (short)uVar5; } } local_8 = 1; if (param_2 != (int *)0x0) { uVar5 = (**(code **)(*param_2 + 0xc))(); if (((char)uVar5 != '\0') && (uVar5 = 0, g_inputDeviceRelease != (void *)0x0)) { uVar5 = (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar5 & 0xffffff00; } //@@ 00a20d50 FUN_00a20d50 void FUN_00a20d50(undefined4 param_1) { int *in_ECX; (**(code **)(*in_ECX + 0x74))(param_1,FUN_00a20d70,0,0,0); return; } //@@ 00a20d70 FUN_00a20d70 uint FUN_00a20d70(undefined1 param_1,int *param_2) { uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b0c45d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; uVar1 = FUN_00a1f010(__security_cookie ^ (int)register0x00000010 - 4U); local_8 = 1; if (param_2 != (int *)0x0) { uVar1 = (**(code **)(*param_2 + 0xc))(); if (((char)uVar1 != '\0') && (uVar1 = 0, g_inputDeviceRelease != (void *)0x0)) { uVar1 = (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return uVar1 & 0xffffff00; } //@@ 00a20df0 FUN_00a20df0 void FUN_00a20df0(undefined1 param_1,int *param_2) { code *pcVar1; char cVar2; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1165d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; (**(code **)(in_ECX[5] + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); if (in_ECX[3] == in_ECX[4]) { std::vector<8byte>::_Emplace_reallocate(in_ECX[3],¶m_1); } else { FUN_00902d60(¶m_1); in_ECX[3] = in_ECX[3] + 8; } (**(code **)(in_ECX[5] + 0x10))(); pcVar1 = *(code **)(*in_ECX + 0x78); FUN_00902d60(¶m_1); (*pcVar1)(); local_8 = 1; if (param_2 != (int *)0x0) { cVar2 = (**(code **)(*param_2 + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } } ExceptionList = local_10; return; } //@@ 00a20eb0 FUN_00a20eb0 void FUN_00a20eb0(int param_1,int *param_2) { code *pcVar1; int iVar2; int *piVar3; int *piVar4; char cVar5; uint uVar6; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1168d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (param_1 != 0) { pcVar1 = *(code **)(*in_ECX + 0x7c); FUN_00902d60(¶m_1); (*pcVar1)(); pcVar1 = *(code **)(*in_ECX + 0x80); FUN_00902d60(¶m_1); (*pcVar1)(); piVar3 = (int *)in_ECX[2]; do { piVar4 = piVar3; if (piVar4 == (int *)in_ECX[3]) goto LAB_00a20f6f; piVar3 = piVar4 + 2; } while (*piVar4 != param_1); FUN_00a21570(piVar4); iVar2 = in_ECX[3]; local_8 = CONCAT31(local_8._1_3_,1); piVar3 = *(int **)(iVar2 + -4); if (((piVar3 != (int *)0x0) && (cVar5 = (**(code **)(*piVar3 + 0xc))(), cVar5 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(iVar2 + -8); } in_ECX[3] = in_ECX[3] + -8; } LAB_00a20f6f: local_8 = 2; if (((param_2 != (int *)0x0) && (cVar5 = (**(code **)(*param_2 + 0xc))(uVar6), cVar5 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(¶m_1); } ExceptionList = local_10; return; } //@@ 00a20fb0 KAGE::Input::Manager::query_devices /* DB: KAGE::Input::Manager vtable slot 29 (+0x74); Input::IsButtonTriggered etc call it via PTR_vftable+0x74 with (controllerIdx, predicate FUN_00a207d0, &arg, 0,0); idx -1 iterates all devices under mutex, returns 1 if predicate true prototype: db/protos.zhl, confirmed by RET 20 */ byte __thiscall KAGE::Input::Manager::query_devices (Manager *this,int deviceIndex,void *predicate,void *predicateArg,int predicateArg2, int *outDeviceId) { PersistentGameData *pPVar1; char cVar2; int iVar3; void *pvStack_40; int *piStack_3c; int local_20; PersistentGameData *local_1c; void *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b116c5; local_10 = ExceptionList; ExceptionList = &local_10; if (deviceIndex == -1) { pPVar1 = &this->_persistentGameData; local_1c = pPVar1; if (pPVar1 == (PersistentGameData *)0x0) { piStack_3c = (int *)0xa20ffc; KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*(int *)pPVar1 + 0xc))(); } local_8 = 0; iVar3 = this->_state; deviceIndex = 0; if (this->_previousState - iVar3 >> 3 != 0) { do { pvStack_40 = (void *)0x0; piStack_3c = (int *)0x0; local_14 = *(int **)(iVar3 + 4 + deviceIndex * 8); local_18 = *(void **)(iVar3 + deviceIndex * 8); if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 4))(); if (cVar2 != '\0') { if (piStack_3c != (int *)0x0) { cVar2 = (**(code **)(*piStack_3c + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&pvStack_40); } } piStack_3c = local_14; pvStack_40 = local_18; } } cVar2 = (*predicate)(); if (cVar2 != '\0') { if (outDeviceId != (int *)0x0) { *outDeviceId = *(int *)(*(int *)(this->_state + deviceIndex * 8) + 0xc); } local_8 = 1; (**(code **)(*(int *)pPVar1 + 0x10))(); ExceptionList = local_10; return 1; } iVar3 = this->_state; deviceIndex = deviceIndex + 1; } while ((uint)deviceIndex < (uint)(this->_previousState - iVar3 >> 3)); } local_8 = 2; (**(code **)(*(int *)pPVar1 + 0x10))(); } else { piStack_3c = (int *)0xa2110f; (**(code **)(*(int *)this + 0x28))(); local_8 = 3; if (local_20 != 0) { piStack_3c = (int *)predicateArg2; pvStack_40 = predicateArg; FUN_00902d60(&local_20); cVar2 = (*predicate)(); if (cVar2 != '\0') { if (outDeviceId != (int *)0x0) { *outDeviceId = *(int *)(local_20 + 0xc); } local_8 = 4; if (local_1c != (PersistentGameData *)0x0) { piStack_3c = (int *)0xa2115e; cVar2 = (**(code **)(*(int *)local_1c + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { piStack_3c = &local_20; pvStack_40 = (void *)0xa21171; (*g_inputDeviceRelease)(); } } ExceptionList = local_10; return 1; } } local_8 = 5; if (local_1c != (PersistentGameData *)0x0) { piStack_3c = (int *)0xa2119f; cVar2 = (**(code **)(*(int *)local_1c + 0xc))(); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { piStack_3c = &local_20; pvStack_40 = (void *)0xa211b2; (*g_inputDeviceRelease)(); } } } ExceptionList = local_10; return 0; } //@@ 00a211d0 FUN_00a211d0 void FUN_00a211d0(undefined4 param_1,int *param_2) { code *pcVar1; undefined4 uVar2; int *piVar3; char cVar4; int in_ECX; int *piVar5; undefined4 local_38; int *local_34; undefined4 *puStack_30; uint uStack_2c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b116fd; local_10 = ExceptionList; uStack_2c = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; piVar5 = (int *)**(int **)(in_ECX + 0x2c); if (piVar5 != *(int **)(in_ECX + 0x2c)) { do { piVar3 = param_2; uVar2 = param_1; puStack_30 = (undefined4 *)piVar5[3]; pcVar1 = (code *)piVar5[2]; local_38 = 0; local_34 = (int *)0x0; if (param_2 != (int *)0x0) { cVar4 = (**(code **)(*param_2 + 4))(); if (cVar4 != '\0') { if (local_34 != (int *)0x0) { cVar4 = (**(code **)(*local_34 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_38); } } local_34 = piVar3; local_38 = uVar2; } } (*pcVar1)(); piVar5 = (int *)*piVar5; } while (piVar5 != (int *)*(int *)(in_ECX + 0x2c)); } local_8 = 1; if (param_2 != (int *)0x0) { puStack_30 = (undefined4 *)0xa21295; cVar4 = (**(code **)(*param_2 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { puStack_30 = ¶m_1; local_34 = (int *)0xa212a8; (*g_inputDeviceRelease)(); } } ExceptionList = local_10; return; } //@@ 00a212c0 FUN_00a212c0 void FUN_00a212c0(undefined4 param_1,int *param_2) { code *pcVar1; undefined4 uVar2; int *piVar3; char cVar4; int in_ECX; int *piVar5; undefined4 local_38; int *local_34; undefined4 *puStack_30; uint uStack_2c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b116fd; local_10 = ExceptionList; uStack_2c = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; piVar5 = (int *)**(int **)(in_ECX + 0x34); if (piVar5 != *(int **)(in_ECX + 0x34)) { do { piVar3 = param_2; uVar2 = param_1; puStack_30 = (undefined4 *)piVar5[3]; pcVar1 = (code *)piVar5[2]; local_38 = 0; local_34 = (int *)0x0; if (param_2 != (int *)0x0) { cVar4 = (**(code **)(*param_2 + 4))(); if (cVar4 != '\0') { if (local_34 != (int *)0x0) { cVar4 = (**(code **)(*local_34 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_38); } } local_34 = piVar3; local_38 = uVar2; } } (*pcVar1)(); piVar5 = (int *)*piVar5; } while (piVar5 != (int *)*(int *)(in_ECX + 0x34)); } local_8 = 1; if (param_2 != (int *)0x0) { puStack_30 = (undefined4 *)0xa21385; cVar4 = (**(code **)(*param_2 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { puStack_30 = ¶m_1; local_34 = (int *)0xa21398; (*g_inputDeviceRelease)(); } } ExceptionList = local_10; return; } //@@ 00a213b0 FUN_00a213b0 void FUN_00a213b0(int param_1,int *param_2) { code *pcVar1; int iVar2; int *piVar3; char cVar4; uint uVar5; int in_ECX; int *piVar6; int local_38; int *local_34; undefined4 *puStack_30; uint uStack_2c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b116fd; local_10 = ExceptionList; uStack_2c = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if ((*(byte *)(param_1 + 8) & 1) != 0) { uVar5 = 0; if (DAT_00c799f4 != 0) { piVar6 = *(int **)(in_ECX + 0x20); do { if (*piVar6 == param_1) { puStack_30 = (undefined4 *)0x0; local_34 = (int *)0xa2141b; FUN_00902f10(); piVar6 = (int *)**(int **)(in_ECX + 0x44); if (piVar6 != *(int **)(in_ECX + 0x44)) { do { piVar3 = param_2; iVar2 = param_1; puStack_30 = (undefined4 *)piVar6[3]; pcVar1 = (code *)piVar6[2]; local_38 = 0; local_34 = (int *)0x0; if ((param_2 != (int *)0x0) && (cVar4 = (**(code **)(*param_2 + 4))(), cVar4 != '\0')) { if ((local_34 != (int *)0x0) && ((cVar4 = (**(code **)(*local_34 + 0xc))(), cVar4 != '\0' && (g_inputDeviceRelease != (void *)0x0)))) { (*g_inputDeviceRelease)(&local_38); } local_34 = piVar3; local_38 = iVar2; } (*pcVar1)(); piVar6 = (int *)*piVar6; } while (piVar6 != (int *)*(int *)(in_ECX + 0x44)); } break; } uVar5 = uVar5 + 1; piVar6 = piVar6 + 2; } while (uVar5 < DAT_00c799f4); } *(ushort *)(param_1 + 8) = *(ushort *)(param_1 + 8) & 0xfffe; } local_8 = 1; if (param_2 != (int *)0x0) { puStack_30 = (undefined4 *)0xa214b9; cVar4 = (**(code **)(*param_2 + 0xc))(); if ((cVar4 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { puStack_30 = ¶m_1; local_34 = (int *)0xa214cc; (*g_inputDeviceRelease)(); } } ExceptionList = local_10; return; } //@@ 00a214f0 FUN_00a214f0 void FUN_00a214f0(void) { void *pvVar1; void *ptr; int *in_ECX; uint size; if (*in_ECX != 0) { FUN_00a21800(*in_ECX); pvVar1 = (void *)*in_ECX; size = in_ECX[2] - (int)pvVar1 & 0xfffffff8; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00a21550 FUN_00a21550 void FUN_00a21550(void) { FUN_00a21800(); return; } //@@ 00a21570 FUN_00a21570 undefined4 * FUN_00a21570(undefined4 *param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; int in_ECX; int in_EDX; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_18 + 0x14); if (in_ECX == in_EDX) { return param_1; } ExceptionList = &local_10; do { local_8 = 0xffffffff; puVar4 = (undefined4 *)FUN_00902d60(in_ECX); uVar1 = puVar4[1]; puVar4[1] = param_1[1]; param_1[1] = uVar1; uVar1 = *puVar4; *puVar4 = *param_1; *param_1 = uVar1; local_8 = 0; if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(local_18); } } in_ECX = in_ECX + 8; param_1 = param_1 + 2; } while (in_ECX != in_EDX); ExceptionList = local_10; return param_1; } //@@ 00a21630 std::vector<8byte>::_Emplace_reallocate /* DB: growth/max 0x1fffffff by >>3, element via FUN_00902d60; callers KAGE::Input::Manager::update_devices, 00a20df0 */ void * std::vector<8byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { uint uVar1; void *pvVar2; int iVar3; void *pvVar4; int iVar5; void *pvVar6; void *ptr; int *in_ECX; uint uVar7; int extraout_ECX; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1178d; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *in_ECX; iVar5 = in_ECX[1] - iVar3 >> 3; if (iVar5 == 0x1fffffff) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar5 + 1; uVar7 = in_ECX[2] - iVar3 >> 3; if (0x1fffffff - (uVar7 >> 1) < uVar7) { local_20 = 0x1fffffff; } else { uVar7 = (uVar7 >> 1) + uVar7; local_20 = uVar1; if (uVar1 <= uVar7) { local_20 = uVar7; } if (0x1fffffff < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar6 = _Allocate(local_20 << 3); local_8 = 0; pvVar2 = (void *)((int)pvVar6 + (param_1 - iVar3 >> 3) * 8); FUN_00902d60(param_2); iVar3 = in_ECX[1]; iVar5 = *in_ECX; if (param_1 == iVar3) { local_8 = CONCAT31(local_8._1_3_,1); for (; iVar5 != iVar3; iVar5 = iVar5 + 8) { FUN_00902d60(iVar5); param_1 = extraout_ECX; } FUN_00a21800(param_1); } else { FUN_00a21880(iVar5,param_1,pvVar6); FUN_00a21880(param_1,in_ECX[1],(int)pvVar2 + 8); } if (*in_ECX != 0) { FUN_00a21800(*in_ECX); pvVar4 = (void *)*in_ECX; uVar7 = in_ECX[2] - (int)pvVar4 & 0xfffffff8; ptr = pvVar4; if (0xfff < uVar7) { ptr = *(void **)((int)pvVar4 + -4); uVar7 = uVar7 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } *in_ECX = (int)pvVar6; in_ECX[1] = (int)((int)pvVar6 + uVar1 * 8); in_ECX[2] = (int)((int)pvVar6 + local_20 * 8); ExceptionList = local_10; return pvVar2; } //@@ 00a217ce Catch_All@00a217ce void Catch_All_00a217ce(void) { int unaff_EBP; FUN_00a21550(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x2c)); deallocate(*(void **)(unaff_EBP + -0x24),*(uint *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00a21800 FUN_00a21800 void FUN_00a21800(void) { void **ppvVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, in_ECX != in_EDX; in_ECX = in_ECX + 8) { local_8 = 0; if (((*(int **)(in_ECX + 4) != (int *)0x0) && (cVar2 = (**(code **)(**(int **)(in_ECX + 4) + 0xc))(uVar3), cVar2 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(in_ECX); } ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 00a21880 FUN_00a21880 int FUN_00a21880(int param_1,int param_2,int param_3) { void **ppvVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b117bd; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; local_8 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 8) { FUN_00902d60(param_1); param_3 = param_3 + 8; ppvVar1 = ExceptionList; in_ECX = extraout_ECX; } FUN_00a21800(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 00a21900 FUN_00a21900 void FUN_00a21900(void) { FUN_00a21800(); return; } //@@ 00a21910 FUN_00a21910 void FUN_00a21910(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Input::Manager::vftable; FUN_00a21b70(uVar1); KAGE::Thread::~Thread(in_ECX + 0x13); FUN_00a1f980(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } ExceptionList = local_10; return; } //@@ 00a21980 FUN_00a21980 /* WARNING: Restarted to delay deadcode elimination for space: stack */ undefined4 FUN_00a21980(void) { code *pcVar1; uint uVar2; char cVar3; uint *puVar4; int *piVar5; ReferenceCountBase *this; int *in_ECX; uint uVar6; int *piVar7; undefined1 auStack_2a [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11833; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(byte *)(in_ECX + 1) & 1) == 0) { (**(code **)(in_ECX[5] + 4))(); uVar2 = DAT_00c799f4; uVar6 = -(uint)((int)((ulonglong)DAT_00c799f4 * 8 >> 0x20) != 0) | (uint)((ulonglong)DAT_00c799f4 * 8); puVar4 = operator_new_tracked(-(uint)(0xfffffffb < uVar6) | uVar6 + 4); local_8 = 0; if (puVar4 == (uint *)0x0) { puVar4 = (uint *)0x0; } else { *puVar4 = uVar2; puVar4 = puVar4 + 1; _eh_vector_constructor_iterator_ (puVar4,8,uVar2,(_func_void_void_ptr *)&LAB_0040c5b0,FUN_004242b0); } in_ECX[1] = in_ECX[1] | 1; in_ECX[8] = (int)puVar4; } local_8 = 0xffffffff; piVar5 = operator_new(0x370); local_8 = 1; if (piVar5 == (int *)0x0) { piVar5 = (int *)0x0; } else { FUN_00a1e050(); *piVar5 = (int)KAGE::Input::InputDeviceKeyboard::vftable; piVar5[3] = 0; } local_8 = 0xffffffff; if (*(code **)(*piVar5 + 4) == FUN_00a6c3e0) { FUN_00a6c3e0(); } else { (**(code **)(*piVar5 + 4))(); } pcVar1 = *(code **)(*in_ECX + 0x6c); piVar7 = (int *)0x0; this = operator_new(0x18); local_8 = 2; if (this != (ReferenceCountBase *)0x0) { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(int **)(this + 0x14) = piVar5; } local_8 = 0xffffffff; if (((piVar7 != (int *)0x0) && (cVar3 = (**(code **)(*piVar7 + 0xc))(), cVar3 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(auStack_2a + -10); } (*pcVar1)(); DAT_00c75da8 = FUN_00a21d40; DAT_00c78d8c = 0; DAT_00c78d7c = FUN_00a21f40; DAT_00c78d88 = 0; FUN_00a6cf80(); if ((*(byte *)(in_ECX + 1) & 2) == 0) { (**(code **)(in_ECX[0x13] + 8))(FUN_00a220c0,2,0x1000); in_ECX[1] = in_ECX[1] | 2; } ExceptionList = local_10; return 1; } //@@ 00a21b70 FUN_00a21b70 void FUN_00a21b70(void) { uint *ptr; void *pvVar1; uint uVar2; int in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b03640; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffd; (**(code **)(*(int *)(in_ECX + 0x4c) + 0xc))(uVar2); if ((*(byte *)(in_ECX + 4) & 1) != 0) { (**(code **)(*(int *)(in_ECX + 0x14) + 0xc))(0xffffffff); FUN_00a21800(extraout_ECX); *(undefined4 *)(in_ECX + 0xc) = *(undefined4 *)(in_ECX + 8); (**(code **)(*(int *)(in_ECX + 0x14) + 0x10))(); pvVar1 = *(void **)(in_ECX + 0x20); if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 0; _eh_vector_destructor_iterator_(pvVar1,8,*ptr,FUN_004242b0); operator_delete(ptr,*ptr * 8 + 4); local_8 = 0xffffffff; *(undefined4 *)(in_ECX + 0x20) = 0; } FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x2c) = *(undefined4 *)(in_ECX + 0x2c); *(int *)(*(int *)(in_ECX + 0x2c) + 4) = *(int *)(in_ECX + 0x2c); *(undefined4 *)(in_ECX + 0x30) = 0; FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)(in_ECX + 0x34); *(int *)(*(int *)(in_ECX + 0x34) + 4) = *(int *)(in_ECX + 0x34); *(undefined4 *)(in_ECX + 0x38) = 0; FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x3c) = *(undefined4 *)(in_ECX + 0x3c); *(int *)(*(int *)(in_ECX + 0x3c) + 4) = *(int *)(in_ECX + 0x3c); *(undefined4 *)(in_ECX + 0x40) = 0; FUN_00a1a500(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x44) = *(undefined4 *)(in_ECX + 0x44); *(int *)(*(int *)(in_ECX + 0x44) + 4) = *(int *)(in_ECX + 0x44); *(undefined4 *)(in_ECX + 0x48) = 0; (**(code **)(*(int *)(in_ECX + 0x14) + 8))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; } ExceptionList = local_10; return; } //@@ 00a21cb0 FUN_00a21cb0 void FUN_00a21cb0(void) { if (_glfw == 0) { _glfwInputError(0x10001,0); Gamepad_processEvents(); KAGE::Input::Manager::update_devices(); return; } (*DAT_00c7378c)(); Gamepad_processEvents(); KAGE::Input::Manager::update_devices(); return; } //@@ 00a21d00 FUN_00a21d00 int FUN_00a21d00(int param_1) { if (param_1 == 0x11) { param_1 = 7; } else if (param_1 == 0x12) { return 5; } return param_1; } //@@ 00a21d30 FUN_00a21d30 undefined4 FUN_00a21d30(undefined4 param_1) { return param_1; } //@@ 00a21d40 FUN_00a21d40 void FUN_00a21d40(void) { char cVar1; int *piVar2; uint uVar3; ReferenceCountBase *this; uint *puVar4; undefined1 auStackY_b8 [128]; int *piVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b1187e; local_10 = ExceptionList; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Gamepad Connected:\n"); KAGE_LogMessage(1,(byte *)" Description: %s\n"); KAGE_LogMessage(1,(byte *)" Vendor ID: %d\n"); KAGE_LogMessage(1,(byte *)" Product ID: %d\n"); KAGE_LogMessage(1,(byte *)" Number of axes: %d\n"); KAGE_LogMessage(1,(byte *)" Number of buttons: %d\n"); piVar2 = operator_new(0x4f0); uStack_8 = 0; if (piVar2 == (int *)0x0) { piVar2 = (int *)0x0; } else { FUN_00a1e050(); *piVar2 = (int)KAGE::Input::InputDeviceGamepad::vftable; piVar2[0xdc] = -1; uVar3 = 0; piVar2[0xdd] = 0; piVar2[0xde] = (int)"unknown"; piVar2[0xdf] = 0; piVar2[0xe0] = 0; piVar2[0xe1] = 3; puVar4 = (uint *)(piVar2 + 0xe3); do { puVar4[-1] = uVar3; *puVar4 = uVar3; uVar3 = uVar3 + 1; puVar4 = puVar4 + 2; } while (uVar3 < 0x1d); memset(piVar2 + 0x11c,0,0x80); } uStack_8 = 0xffffffff; if (*(code **)(*piVar2 + 4) == KAGE::Input::InputDeviceGamepad::Init) { cVar1 = KAGE::Input::InputDeviceGamepad::Init(); } else { cVar1 = (**(code **)(*piVar2 + 4))(); } if (cVar1 == '\0') { (**(code **)*piVar2)(); ExceptionList = local_10; return; } piVar5 = (int *)0x0; this = operator_new(0x18); uStack_8 = 2; if (this != (ReferenceCountBase *)0x0) { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(int **)(this + 0x14) = piVar2; } uStack_8 = 0xffffffff; if (((piVar5 != (int *)0x0) && (cVar1 = (**(code **)(*piVar5 + 0xc))(), cVar1 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(auStackY_b8 + 0x88); } FUN_00a20df0(); Gamepad_processEvents(); ExceptionList = local_10; return; } //@@ 00a21f40 FUN_00a21f40 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a21f40(int *param_1) { char cVar1; uint uVar2; int iVar3; uint index; TypeDescriptor *pTVar4; undefined4 uVar5; int iStack_18; int *piStack_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b118ad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE_LogMessage(1,(byte *)"Gamepad Disconnected:\n"); KAGE_LogMessage(1,(byte *)" Description: %s\n"); index = 1; do { (**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff,uVar2); iVar3 = DAT_00c57b24 - _DAT_00c57b20; uStack_8 = 0; (**(code **)(PTR_vftable_00c57b2c + 0x10))(); uStack_8 = 0xffffffff; if ((uint)(iVar3 >> 3) <= index) { ExceptionList = local_10; return; } KAGE::Input::Manager::get_device((Manager *)&PTR_vftable_00c57b18,&iStack_18,index); uStack_8 = 1; if ((iStack_18 != 0) && (iVar3 = __RTDynamicCast(iStack_18,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0), iVar3 != 0)) { uVar5 = 0; pTVar4 = &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor; iVar3 = __RTDynamicCast(iStack_18,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0); if (*(int *)(iVar3 + 0x370) == *param_1) { FUN_00902d60(&iStack_18); FUN_00a20eb0(pTVar4,uVar5); uStack_8 = 2; if (piStack_14 == (int *)0x0) { ExceptionList = local_10; return; } cVar1 = (**(code **)(*piStack_14 + 0xc))(); if (cVar1 == '\0') { ExceptionList = local_10; return; } if (g_inputDeviceRelease == (void *)0x0) { ExceptionList = local_10; return; } (*g_inputDeviceRelease)(&iStack_18); ExceptionList = local_10; return; } } uStack_8 = 3; if (((piStack_14 != (int *)0x0) && (cVar1 = (**(code **)(*piStack_14 + 0xc))(), cVar1 != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&iStack_18); } uStack_8 = 0xffffffff; index = index + 1; } while( true ); } //@@ 00a220c0 FUN_00a220c0 void FUN_00a220c0(void) { while (((byte)DAT_00c57b1c & 2) != 0) { FUN_00a6dab0(); Sleep(100); } return; } //@@ 00a220f0 FUN_00a220f0 void FUN_00a220f0(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Input::InputDeviceGamepad::vftable; if ((void *)in_ECX[0xdd] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[0xdd],0); in_ECX[0xdd] = 0; } FUN_00a1e2c0(uVar1); *in_ECX = KAGE::Input::InputDeviceBase::vftable; FUN_00a1e2c0(); FUN_004b3950(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x4f0); } ExceptionList = local_10; return; } //@@ 00a22190 KAGE::Input::InputDeviceGamepad::Init /* DB: ? KAGE::Input::InputDeviceGamepad vtable slot 1 (RTTI); stores descriptor, identifies the pad: 'Gamepad identified as %s, VendorId = %d, ProductId = %d, Family = %s', Xbox/PlayStation/Nintendo/Unknown Device, 'Could not find hardware descriptor for gamepad' */ void KAGE::Input::InputDeviceGamepad::Init(undefined4 *param_1) { char cVar1; byte bVar2; undefined4 uVar3; ushort uVar4; short *psVar5; byte *pbVar6; uint uVar7; short sVar8; int in_ECX; char *pcVar9; uint uVar10; byte *pbVar11; char *pcVar12; int iVar13; char *_Dest; undefined **ppuVar14; undefined4 *puVar15; bool bVar16; *(undefined4 *)(in_ECX + 0x370) = *param_1; pcVar12 = (char *)param_1[1]; if (pcVar12 == (char *)0x0) { _Dest = (char *)0x0; } else { pcVar9 = pcVar12; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar9 + (1 - (int)(pcVar12 + 1)))); pcVar9 = pcVar12; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); strncpy(_Dest,pcVar12,(size_t)(pcVar9 + (1 - (int)(pcVar12 + 1)))); } *(char **)(in_ECX + 0x374) = _Dest; if (*(char *)(param_1 + 2) == '\0') { uVar4 = *(ushort *)(in_ECX + 8) & 0xffef; } else { uVar4 = *(ushort *)(in_ECX + 8) | 0x10; } *(ushort *)(in_ECX + 8) = uVar4; if ((*(short *)((int)param_1 + 10) != 0) && (*(short *)(param_1 + 3) != 0)) { psVar5 = &DAT_00c57b76; uVar10 = 0; LAB_00a22230: if (((psVar5[-1] != *(short *)((int)param_1 + 10)) || (*psVar5 != *(short *)(param_1 + 3))) || ((*(int *)(psVar5 + 1) != 0 && (*(int *)(psVar5 + 1) != param_1[5])))) goto LAB_00a22250; psVar5 = psVar5 + -3; puVar15 = (undefined4 *)(in_ECX + 0x378); for (iVar13 = 0x5e; iVar13 != 0; iVar13 = iVar13 + -1) { *puVar15 = *(undefined4 *)psVar5; psVar5 = psVar5 + 2; puVar15 = puVar15 + 1; } uVar4 = *(ushort *)(in_ECX + 8); goto LAB_00a223bb; } LAB_00a22266: ppuVar14 = &PTR_s_Unknown_Device_00c57b70; uVar10 = 0; LAB_00a22270: pbVar6 = *ppuVar14; pbVar11 = (byte *)param_1[1]; do { bVar2 = *pbVar6; bVar16 = bVar2 < *pbVar11; if (bVar2 != *pbVar11) { LAB_00a222b5: uVar7 = -(uint)bVar16 | 1; goto LAB_00a222ba; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar16 = bVar2 < pbVar11[1]; if (bVar2 != pbVar11[1]) goto LAB_00a222b5; pbVar6 = pbVar6 + 2; pbVar11 = pbVar11 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_00a222ba: if (uVar7 != 0) goto code_r0x00a222c2; uVar3 = *(undefined4 *)(in_ECX + 0x374); puVar15 = (undefined4 *)(in_ECX + 0x378); for (iVar13 = 0x5e; iVar13 != 0; iVar13 = iVar13 + -1) { *puVar15 = *ppuVar14; ppuVar14 = ppuVar14 + 1; puVar15 = puVar15 + 1; } *(undefined4 *)(in_ECX + 0x378) = uVar3; *(undefined2 *)(in_ECX + 0x37c) = *(undefined2 *)((int)param_1 + 10); *(undefined2 *)(in_ECX + 0x37e) = *(undefined2 *)(param_1 + 3); uVar4 = *(ushort *)(in_ECX + 8); LAB_00a223bb: sVar8 = 6; goto LAB_00a223c0; LAB_00a22250: uVar10 = uVar10 + 0x178; psVar5 = psVar5 + 0xbc; if (0x2eff < uVar10) goto LAB_00a22266; goto LAB_00a22230; code_r0x00a222c2: uVar10 = uVar10 + 0x178; ppuVar14 = ppuVar14 + 0x5e; if (0x2eff < uVar10) goto code_r0x00a222d6; goto LAB_00a22270; code_r0x00a222d6: ppuVar14 = &PTR_s_Unknown_Device_00c57b70; uVar10 = 0; do { pbVar6 = *ppuVar14; pcVar12 = "Unknown Device"; do { bVar2 = *pbVar6; bVar16 = bVar2 < (byte)*pcVar12; if (bVar2 != *pcVar12) { LAB_00a22307: uVar7 = -(uint)bVar16 | 1; goto LAB_00a2230c; } if (bVar2 == 0) break; bVar2 = pbVar6[1]; bVar16 = bVar2 < (byte)pcVar12[1]; if (bVar2 != pcVar12[1]) goto LAB_00a22307; pbVar6 = pbVar6 + 2; pcVar12 = pcVar12 + 2; } while (bVar2 != 0); uVar7 = 0; LAB_00a2230c: if (uVar7 == 0) { uVar3 = *(undefined4 *)(in_ECX + 0x374); puVar15 = (undefined4 *)(in_ECX + 0x378); for (iVar13 = 0x5e; iVar13 != 0; iVar13 = iVar13 + -1) { *puVar15 = *ppuVar14; ppuVar14 = ppuVar14 + 1; puVar15 = puVar15 + 1; } sVar8 = 5; *(undefined4 *)(in_ECX + 0x378) = uVar3; *(undefined2 *)(in_ECX + 0x37c) = *(undefined2 *)((int)param_1 + 10); *(undefined2 *)(in_ECX + 0x37e) = *(undefined2 *)(param_1 + 3); uVar4 = *(ushort *)(in_ECX + 8); LAB_00a223c0: *(ushort *)(in_ECX + 8) = uVar4 | 1 << sVar8; goto LAB_00a223f7; } uVar10 = uVar10 + 0x178; ppuVar14 = ppuVar14 + 0x5e; if (0x2eff < uVar10) { KAGE_LogMessage(0x10,(byte *)"Could not find hardware descriptor for gamepad\n"); LAB_00a223f7: KAGE_LogMessage(1,(byte *) "Gamepad identified as \'%s\', VendorId = %d, ProductId = %d, Family = %s\n" ); FUN_00a1e210(param_1); return; } } while( true ); } //@@ 00a22430 FUN_00a22430 void FUN_00a22430(void) { uint uVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(void **)(in_ECX + 0x374) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x374),0); *(undefined4 *)(in_ECX + 0x374) = 0; } FUN_00a1e2c0(uVar1); ExceptionList = local_10; return; } //@@ 00a224a0 FUN_00a224a0 undefined4 FUN_00a224a0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x378); } //@@ 00a224b0 FUN_00a224b0 char * FUN_00a224b0(uint param_1) { char *pcVar1; int in_ECX; if ((*(byte *)(in_ECX + 8) & 0x20) == 0) { if (0xabaa < param_1) { pcVar1 = (char *)FUN_00a1e360(); return pcVar1; } switch(param_1) { case 0: return "Left"; case 1: return "Right"; case 2: return "Up"; case 3: return "Down"; case 4: return "X"; case 5: return "B"; case 6: return "Y"; case 7: return "A"; case 8: return "LB"; case 9: return "LT"; case 10: return "L3"; case 0xb: return "RB"; case 0xc: return "RT"; case 0xd: return "R3"; case 0xe: return "Back"; case 0xf: return "Start"; case 0x10: return "Guide"; } } else if ((int)param_1 < 0xabac) { if (param_1 == 0xabab) { return "Axis 1-"; } switch(param_1) { case 0: return "Btn 1"; case 1: return "Btn 2"; case 2: return "Btn 3"; case 3: return "Btn 4"; case 4: return "Btn 5"; case 5: return "Btn 6"; case 6: return "Btn 7"; case 7: return "Btn 8"; case 8: return "Btn 9"; case 9: return "Btn 10"; case 10: return "Btn 11"; case 0xb: return "Btn 12"; case 0xc: return "Btn 13"; case 0xd: return "Btn 14"; case 0xe: return "Btn 15"; case 0xf: return "Btn 16"; case 0x10: return "Btn 17"; case 0x11: return "Btn 18"; case 0x12: return "Btn 19"; case 0x13: return "Btn 20"; case 0x14: return "Btn 21"; case 0x15: return "Btn 22"; case 0x16: return "Btn 23"; case 0x17: return "Btn 24"; case 0x18: return "Btn 25"; case 0x19: return "Btn 26"; case 0x1a: return "Btn 27"; case 0x1b: return "Btn 28"; case 0x1c: return "Btn 29"; case 0x1d: return "Btn 30"; case 0x1e: return "Btn 31"; case 0x1f: return "Btn 32"; } } else { switch(param_1) { case 0xabac: return "Axis 1+"; case 0xabad: return "Axis 2-"; case 0xabae: return "Axis 2+"; case 0xabaf: return "Axis 3-"; case 0xabb0: return "Axis 3+"; case 0xabb1: return "Axis 4-"; case 0xabb2: return "Axis 4+"; case 0xabb3: return "Axis 5-"; case 0xabb4: return "Axis 5+"; case 0xabb5: return "Axis 6-"; case 0xabb6: return "Axis 6+"; case 0xabb7: return "Axis 7-"; case 0xabb8: return "Axis 7+"; case 0xabb9: return "Axis 8-"; case 0xabba: return "Axis 8+"; case 0xabbb: return "Axis 9-"; case 0xabbc: return "Axis 9+"; case 0xabbd: return "Axis 10-"; case 0xabbe: return "Axis 10+"; case 0xabbf: return "Axis 11-"; case 0xabc0: return "Axis 11+"; case 0xabc1: return "Axis 12-"; case 0xabc2: return "Axis 12+"; case 0xabc3: return "Axis 13-"; case 0xabc4: return "Axis 13+"; case 0xabc5: return "Axis 14-"; case 0xabc6: return "Axis 14+"; case 0xabc7: return "Axis 15-"; case 0xabc8: return "Axis 15+"; case 0xabc9: return "Axis 16-"; case 0xabca: return "Axis 16+"; } } return "Unknown"; } //@@ 00a22940 KAGE::Input::InputDeviceGamepad::update /* DB: ? InputDeviceGamepad vtable slot 30 (keyboard slot 30 = 00a6c650): finds its device in g_gamepadDevices by id (this+0x370), maps the 29 button bindings (this+0x388 pairs) and ORs pressed buttons into the 64-bit mask this+0x20/+0x24 */ uint KAGE::Input::InputDeviceGamepad::update(void) { float fVar1; ushort uVar2; uint uVar3; int iVar4; int *in_ECX; uint uVar5; uint *puVar6; int *piVar7; uint uVar8; int *piVar9; float local_1c; uint local_18; uint local_14; int *local_10; uint local_c; byte local_5; uVar3 = 0; uVar5 = DAT_00c79bf0 - (int)g_gamepadDevices >> 2; if (uVar5 != 0) { do { piVar9 = g_gamepadDevices[uVar3]; if (*piVar9 == in_ECX[0xdc]) { if (piVar9 != (int *)0x0) { uVar3 = 0; local_c = (uint)(*(ushort *)(in_ECX + 2) & 0x20); if (piVar9[5] == 0) goto LAB_00a22a04; goto LAB_00a229a0; } break; } uVar3 = uVar3 + 1; } while (uVar3 < uVar5); } return uVar3 & 0xffffff00; LAB_00a229a0: do { if (0x1f < uVar3) break; uVar5 = 0; puVar6 = (uint *)(in_ECX + 0xe3); do { if (*puVar6 == uVar3) { iVar4 = in_ECX[uVar5 * 2 + 0xe2]; goto LAB_00a229c9; } uVar5 = uVar5 + 1; puVar6 = puVar6 + 2; } while (uVar5 < 0x1d); iVar4 = -1; LAB_00a229c9: if ((((*(ushort *)(in_ECX + 2) & 0x20) != 0) || (iVar4 != -1)) && (*(char *)(uVar3 + piVar9[7]) != '\0')) { uVar5 = 1 << (uVar3 & 0x1f); uVar8 = 0; if (0x1f < uVar3) { uVar8 = uVar5; } uVar5 = uVar5 ^ uVar8; if (0x3f < uVar3) { uVar8 = uVar5; } in_ECX[8] = in_ECX[8] | uVar5; in_ECX[9] = in_ECX[9] | uVar8; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)piVar9[5]); LAB_00a22a04: local_14 = 0; uVar3 = piVar9[4] * 2; local_10 = piVar9; if (uVar3 != 0) { do { if (0x1f < local_14) break; if ((*(byte *)(in_ECX + 2) & 0x40) == 0) { in_ECX[local_14 + 0x11c] = *(int *)(piVar9[6] + (local_14 >> 1) * 4); } else { fVar1 = (float)in_ECX[local_14 + 0x11c]; local_5 = ~(byte)local_14 & 1; local_1c = *(float *)(piVar9[6] + (local_14 >> 1) * 4) - fVar1; if (fVar1 < 0.0) { local_1c = local_1c / (1.0 - fVar1); } local_18 = 0xffffffff; if ((short)local_c == 0) { uVar3 = 0; piVar7 = in_ECX + 0xe3; do { piVar9 = local_10; if (*piVar7 == local_14 + 0xabab) { local_18 = in_ECX[uVar3 * 2 + 0xe2]; goto LAB_00a22ac5; } uVar3 = uVar3 + 1; piVar7 = piVar7 + 2; } while (uVar3 < 0x1d); local_18 = 0xffffffff; } LAB_00a22ac5: if (local_5 == 0) { if ((float)in_ECX[0x35] < local_1c) goto LAB_00a22ae2; LAB_00a22b4a: if (local_1c <= 0.0) { local_1c = 0.0; } } else { if (local_1c < -(float)in_ECX[0x35]) { LAB_00a22ae2: if (((short)local_c != 0) || (local_18 != 0xffffffff)) { (**(code **)(*in_ECX + 0x90))(&local_18); if (local_18 == 0xffffffff) { local_18 = local_14; } uVar3 = 1 << (local_18 & 0x1f); uVar5 = 0; if (0x1f < local_18) { uVar5 = uVar3; } uVar3 = uVar3 ^ uVar5; if (0x3f < local_18) { uVar5 = uVar3; } in_ECX[0xc] = in_ECX[0xc] | uVar3; in_ECX[0xd] = in_ECX[0xd] | uVar5; } if (local_5 == 0) goto LAB_00a22b4a; } if (0.0 <= local_1c) { local_1c = 0.0; } else { local_1c = -local_1c; } } in_ECX[local_14 + 0x10] = (int)local_1c; } local_14 = local_14 + 1; uVar3 = piVar9[4] * 2; } while (local_14 < uVar3); } uVar2 = *(ushort *)(in_ECX + 2); *(ushort *)(in_ECX + 2) = uVar2 | 0x40; return CONCAT31((int3)(CONCAT22((short)(uVar3 >> 0x10),uVar2) >> 8),1); } //@@ 00a22b80 FUN_00a22b80 float * FUN_00a22b80(float *param_1,int param_2) { int *in_ECX; float10 fVar1; float10 fVar2; float10 fVar3; float10 fVar4; float fVar5; param_1[1] = 0.0; *param_1 = 0.0; if (((*(ushort *)(in_ECX + 2) & 2) != 0) && ((*(ushort *)(in_ECX + 2) & 0x20) == 0)) { fVar1 = (float10)(**(code **)(*in_ECX + 0x2c))(param_2 * 4 + 0xabab); fVar2 = (float10)(**(code **)(*in_ECX + 0x2c))(param_2 * 4 + 0xabac); fVar3 = (float10)(**(code **)(*in_ECX + 0x2c))(param_2 * 4 + 0xabad); fVar4 = (float10)(**(code **)(*in_ECX + 0x2c))(param_2 * 4 + 0xabae); fVar5 = (float)fVar4; if (fVar5 < (float)fVar3) { fVar5 = -(float)fVar3; } if ((float)fVar2 < (float)fVar1) { param_1[1] = fVar5; *param_1 = -(float)fVar1; return param_1; } param_1[1] = fVar5; *param_1 = (float)fVar2; } return param_1; } //@@ 00a22c80 FUN_00a22c80 void FUN_00a22c80(undefined4 param_1,float param_2) { uint uVar1; int in_ECX; int *piVar2; uint uVar3; float fVar4; uVar1 = 0; uVar3 = DAT_00c79bf0 - (int)g_gamepadDevices >> 2; if (uVar3 != 0) { do { piVar2 = g_gamepadDevices[uVar1]; if (*piVar2 == *(int *)(in_ECX + 0x370)) goto LAB_00a22cb0; uVar1 = uVar1 + 1; } while (uVar1 < uVar3); } piVar2 = (int *)0x0; LAB_00a22cb0: if (*(char *)piVar2[8] != '\0') { fVar4 = param_2 - 0.5; if (param_2 <= 0.0) { param_2 = 0.0; } fVar4 = fVar4 + fVar4; if (1.0 <= param_2) { param_2 = 1.0; } if (fVar4 <= 0.0) { fVar4 = 0.0; } if (1.0 <= fVar4) { fVar4 = 1.0; } param_2 = (float)CONCAT22((short)(int)(fVar4 * 65535.0),(short)(int)(param_2 * 65535.0)); (*DAT_00c7e2f0)(*(undefined4 *)((char *)piVar2[8] + 0x2c),¶m_2); } return; } //@@ 00a22d20 FUN_00a22d20 bool FUN_00a22d20(uint *param_1) { uint uVar1; int in_ECX; uint *puVar2; if ((*(byte *)(in_ECX + 8) & 0x20) != 0) { return *param_1 < 0xabab; } uVar1 = 0; puVar2 = (uint *)(in_ECX + 0x388); do { if (*puVar2 == *param_1) { uVar1 = *(uint *)(in_ECX + 0x38c + uVar1 * 8); if (uVar1 < 0xabab) { *param_1 = uVar1; return true; } return false; } uVar1 = uVar1 + 1; puVar2 = puVar2 + 2; } while (uVar1 < 0x1d); return false; } //@@ 00a22d80 FUN_00a22d80 undefined4 FUN_00a22d80(uint *param_1) { int in_ECX; uint *puVar1; uint uVar2; if ((*(byte *)(in_ECX + 8) & 0x20) != 0) { uVar2 = *param_1 - 0xabab; if (uVar2 < 0x20) { *param_1 = uVar2; return 1; } return 0; } uVar2 = 0; puVar1 = (uint *)(in_ECX + 0x388); while (*puVar1 != *param_1) { uVar2 = uVar2 + 1; puVar1 = puVar1 + 2; if (0x1c < uVar2) { return 0; } } uVar2 = *(uint *)(in_ECX + 0x38c + uVar2 * 8); if (uVar2 < 0xabab) { return 0; } if (uVar2 == 0xffffffff) { return 0; } *param_1 = uVar2 - 0xabab; return 1; } //@@ 00a22df0 FUN_00a22df0 void FUN_00a22df0(byte param_1) { undefined4 *this; undefined4 *in_ECX; *in_ECX = KAGE::Memory::ManagerBase::vftable; FUN_00a1a500(); operator_delete((void *)in_ECX[4],0x10); this = in_ECX + 2; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[2] + 4)); operator_delete((void *)*this,0x18); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } return; } //@@ 00a22e60 FUN_00a22e60 undefined4 FUN_00a22e60(void) { uint *puVar1; uint uVar2; undefined4 *puVar3; void *pvVar4; int in_ECX; bool bVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1190d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar3 = operator_new(0x40); if (puVar3 == (undefined4 *)0x0) { puVar3 = (undefined4 *)0x0; } else { *puVar3 = KAGE::Memory::HeapBase::vftable; puVar3[2] = 0x7fcb9dd6; *(undefined1 *)(puVar3 + 3) = 0; *(undefined1 *)(puVar3 + 5) = 0; puVar3[4] = KAGE::Mutex::vftable; puVar3[6] = 0; local_8 = 1; puVar3[7] = 0; puVar3[8] = 0; pvVar4 = operator_new(0xc); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; puVar3[7] = pvVar4; local_8._0_1_ = 2; puVar3[10] = 0; puVar3[0xb] = 0; puVar3[0xc] = 0; puVar3[0xd] = 0; puVar3[0xe] = 0; puVar3[0xf] = 0; pvVar4 = operator_new(0x10); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; puVar3[0xe] = pvVar4; local_8 = CONCAT31(local_8._1_3_,3); *(byte *)(puVar3 + 3) = *(byte *)(puVar3 + 3) | 1; if (*(code **)(puVar3[4] + 4) == FUN_00a15770) { FUN_00a15770(); } else { (**(code **)(puVar3[4] + 4))(uVar2); } *puVar3 = KAGE::Memory::MainHeap::vftable; puVar3[10] = DAT_00c79a04; puVar3[0xb] = 0; puVar1 = puVar3 + 0xc; bVar5 = CARRY4(*puVar1,(uint)g_allocatedBytesNoHeap); *puVar1 = *puVar1 + (uint)g_allocatedBytesNoHeap; puVar3[0xd] = puVar3[0xd] + g_allocatedBytesNoHeap._4_4_ + (uint)bVar5; g_mainHeap = puVar3; } local_8 = 0xffffffff; FUN_00a23230(puVar3); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; ExceptionList = local_10; return 1; } //@@ 00a22fb0 FUN_00a22fb0 void FUN_00a22fb0(void) { int *this; int in_ECX; int *piVar1; int *local_8; this = (int *)(in_ECX + 8); piVar1 = (int *)*this; local_8 = (int *)*piVar1; if (local_8 != piVar1) { do { piVar1 = local_8; if ((undefined4 *)local_8[5] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)local_8[5])(1); piVar1[5] = 0; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); piVar1 = (int *)*this; } while (local_8 != piVar1); } FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, (_Tree_node *)piVar1[1]); piVar1[1] = (int)piVar1; *piVar1 = (int)piVar1; piVar1[2] = (int)piVar1; *(undefined4 *)(in_ECX + 0xc) = 0; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a23020 FUN_00a23020 void FUN_00a23020(void) { int *piVar1; int in_ECX; int *ptr; int *piVar2; int local_8; local_8 = **(int **)(in_ECX + 8); if ((int *)local_8 != *(int **)(in_ECX + 8)) { do { piVar1 = *(int **)(local_8 + 0x14); if (((*(byte *)(piVar1 + 3) & 1) != 0) && (ptr = *(int **)piVar1[0xe], ptr != (int *)piVar1[0xe])) { do { piVar2 = ptr + 3; *(char *)piVar2 = (char)*piVar2 + -1; if ((char)*piVar2 == '\0') { (**(code **)(*piVar1 + 8))(ptr[2],0); piVar2 = (int *)*ptr; *(int **)ptr[1] = piVar2; *(int *)(*ptr + 4) = ptr[1]; piVar1[0xf] = piVar1[0xf] + -1; operator_delete(ptr,0x10); } else { piVar2 = (int *)*ptr; } ptr = piVar2; } while (piVar2 != (int *)piVar1[0xe]); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); } while (local_8 != *(int *)(in_ECX + 8)); } return; } //@@ 00a230b0 KAGE_Memory::heap_alloc /* DB: (heapId, &size) -> ptr: heap map lookup, "Invalid heap identifier specified", heap vfunc +4 (alloc), FUN_00a23200 out-of-memory on null; image loaders allocate texel buffers with heap 2 ("texel buffer allocation of size %d failed") prototype: db/protos.zhl, confirmed by RET 8 */ void * KAGE_Memory::heap_alloc(uint heapId,ulonglong *size) { uint uVar1; void *pvVar2; undefined1 local_1c [8]; void *local_14; undefined4 local_10; uint local_c; undefined1 local_5; local_c = 0; local_10 = 0; local_5 = 0; (**(code **)(PTR_vftable_00c37964 + 0x10))(heapId,&local_c,&local_10,&local_5); uVar1 = local_c; heapId = local_c; _Find_lower_bound<>(local_1c,&heapId); if (((*(char *)((int)local_14 + 0xd) != '\0') || (uVar1 < *(uint *)((int)local_14 + 0x10))) || (local_14 == g_memoryManager_heaps)) { KAGE_LogMessage(0x10,(byte *)"Invalid heap identifier specified"); return (void *)0x0; } pvVar2 = (void *)(**(code **)(**(int **)((int)local_14 + 0x14) + 4))(size,local_10); if (pvVar2 == (void *)0x0) { FUN_00a23200(uVar1); } return pvVar2; } //@@ 00a23160 KAGE_Memory::heap_free /* DB: (heapId, ptr): looks the heap id up in the heap map (g_memoryManager_heaps end), "Invalid heap identifier specified", then calls heap vfunc +8 (free); image loaders free texel buffers with heap 2 prototype: db/protos.zhl, confirmed by RET 8 */ void KAGE_Memory::heap_free(uint heapId,void *ptr) { uint uVar1; undefined1 local_1c [8]; void *local_14; undefined4 local_10; uint local_c; uint local_8; local_8 = 0; local_10 = 0; local_c = local_c & 0xffffff00; (**(code **)(PTR_vftable_00c37964 + 0x10))(heapId,&local_8,&local_10,&local_c); uVar1 = local_8; heapId = local_8; _Find_lower_bound<>(local_1c,&heapId); if ((*(char *)((int)local_14 + 0xd) != '\0') || (uVar1 < *(uint *)((int)local_14 + 0x10))) { local_14 = g_memoryManager_heaps; } if (local_14 == g_memoryManager_heaps) { KAGE_LogMessage(0x10,(byte *)"Invalid heap identifier specified"); return; } (**(code **)(**(int **)((int)local_14 + 0x14) + 8))(ptr,local_c); return; } //@@ 00a23200 FUN_00a23200 void FUN_00a23200(undefined4 param_1) { int *piVar1; piVar1 = *(int **)g_memoryManager_oomHandlers; if (piVar1 != g_memoryManager_oomHandlers) { do { (*(code *)piVar1[2])(param_1,piVar1[3]); piVar1 = (int *)*piVar1; } while (piVar1 != g_memoryManager_oomHandlers); } return; } //@@ 00a23230 FUN_00a23230 void FUN_00a23230(int param_1) { undefined4 local_18; int local_14; undefined1 local_10 [12]; local_14 = param_1; local_18 = *(undefined4 *)(param_1 + 8); std::map::insert(local_10,&local_18); return; } //@@ 00a23260 FUN_00a23260 void FUN_00a23260(undefined4 param_1,undefined4 *param_2,undefined4 *param_3,undefined1 *param_4) { int in_ECX; *param_2 = *(undefined4 *)(**(int **)(in_ECX + 8) + 0x10); *param_3 = 1; *param_4 = 0; return; } //@@ 00a23290 FUN_00a23290 void FUN_00a23290(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::System::UserProfileBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,8); } return; } //@@ 00a232c0 FUN_00a232c0 void FUN_00a232c0(uint param_1) { uint uVar1; char cVar2; uint uVar3; undefined4 extraout_EAX; undefined4 *in_ECX; undefined4 extraout_ECX; int local_30; int *local_2c; undefined4 local_28; undefined4 local_24; undefined4 *local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; uVar1 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b1197d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::System::UserProfileBase::vftable; in_ECX[1] = 0; local_20 = in_ECX; _Find_lower_bound<>(&local_28,¶m_1); if (((*(char *)((int)local_20 + 0xd) == '\0') && ((uint)local_20[4] <= uVar1)) && (local_20 != DAT_00c5ac08)) { FUN_00a23df0(local_20 + 5); } else { KAGE::SmartPointer::SmartPointer(extraout_ECX); } local_8 = 0; if (local_30 != 0) { local_28 = *(undefined4 *)(local_30 + 8); local_24 = *(undefined4 *)(local_30 + 0xc); UserProfile::find_or_create(&local_28); KAGE::SmartPointer::operator_assign(&local_30); in_ECX[1] = extraout_EAX; } local_8 = 1; if (local_2c != (int *)0x0) { cVar2 = (**(code **)(*local_2c + 0xc))(uVar3); if ((cVar2 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_30); } } *in_ECX = KAGE::System::UserProfile::vftable; ExceptionList = local_10; return; } //@@ 00a233c0 FUN_00a233c0 undefined4 FUN_00a233c0(void) { int iVar1; int in_ECX; if ((*(int *)(in_ECX + 4) != 0) && (iVar1 = *(int *)(*(int *)(in_ECX + 4) + 0x20), iVar1 != 0)) { iVar1 = *(int *)(iVar1 + 0x18); if (iVar1 == 0) { return 2; } if (iVar1 != 1) { if (iVar1 == 5) { return 3; } KAGE_LogMessage(0x10,(byte *)"Unknown EOS platform\n"); return 0; } } return 1; } //@@ 00a23410 FUN_00a23410 undefined4 FUN_00a23410(void) { int iVar1; char cVar2; undefined4 uVar3; int *piVar4; undefined4 *puVar5; int *in_ECX; undefined4 uStack_10; undefined4 uStack_c; if ((in_ECX[1] != 0) && (*(int *)(in_ECX[1] + 0x20) != 0)) { uVar3 = FUN_00a6f680(); return uVar3; } piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); if (*piVar4 != 0) { cVar2 = (**(code **)(*in_ECX + 0x14))(); if (cVar2 == '\0') { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); iVar1 = in_ECX[1]; if (iVar1 == 0) { uStack_c = 0; uStack_10 = 0; } else { uStack_10 = *(undefined4 *)(iVar1 + 8); uStack_c = *(undefined4 *)(iVar1 + 0xc); } uVar3 = (**(code **)(*(int *)*puVar5 + 0x18))(uStack_10,uStack_c); } else { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); uVar3 = (**(code **)(*(int *)*puVar5 + 8))(); } switch(uVar3) { case 1: return 1; case 2: return 2; case 3: case 4: return 3; } } return 0; } //@@ 00a23500 FUN_00a23500 undefined4 FUN_00a23500(void) { int iVar1; int *piVar2; undefined4 *puVar3; int in_ECX; undefined4 uStack_10; undefined4 uStack_c; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); if (*piVar2 == 0) { return 0; } puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); iVar1 = *(int *)(in_ECX + 4); if (iVar1 == 0) { uStack_c = 0; uStack_10 = 0; } else { uStack_10 = *(undefined4 *)(iVar1 + 8); uStack_c = *(undefined4 *)(iVar1 + 0xc); } (**(code **)(*(int *)*puVar3 + 0x74))("steamid",uStack_10,uStack_c); return 1; } //@@ 00a23580 FUN_00a23580 undefined4 FUN_00a23580(void) { int iVar1; int *piVar2; undefined4 *puVar3; int in_ECX; undefined4 uStack_10; undefined4 uStack_c; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); if (*piVar2 == 0) { return 0; } puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); iVar1 = *(int *)(in_ECX + 4); if (iVar1 == 0) { uStack_c = 0; uStack_10 = 0; } else { uStack_10 = *(undefined4 *)(iVar1 + 8); uStack_c = *(undefined4 *)(iVar1 + 0xc); } (**(code **)(*(int *)*puVar3 + 0x74))("friendadd",uStack_10,uStack_c); return 1; } //@@ 00a23600 FUN_00a23600 void FUN_00a23600(void) { int *in_ECX; /* WARNING: Could not recover jumptable at 0x00a23605. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 0x30))(); return; } //@@ 00a23610 KAGE::System::UserProfile::load_steam_avatar /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "Steam User Avatar - %llu": ISteamFriends GetLargeFriendAvatar (+0x8c) -> ISteamUtils GetImageSize/GetImageRGBA into a tracked_alloc buffer, creates a texture via FUN_00a11c70; callers set local UserProfile::vftable and then call it (NetplayManager::update_player_removal) prototype: db/protos.zhl */ void __thiscall KAGE::System::UserProfile::load_steam_avatar(void *this) { uint height; code *pcVar1; undefined2 *ptr; char cVar2; int iVar3; int *piVar4; undefined4 *puVar5; int extraout_EAX; longlong lVar6; undefined8 uVar7; byte *buffer; char *pcVar8; int *local_134; int *local_130; undefined2 *local_128; int local_124; int local_120; undefined8 local_11c; byte local_114 [256]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b119b0; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_114 + 0x110); ExceptionList = &local_10; iVar3 = *(int *)((int)this + 4); if (((((iVar3 != 0) && (lVar6 = __aullshr(local_14), lVar6 != 0xfefefefe)) && (*(int *)(iVar3 + 8) != 0 || *(int *)(iVar3 + 0xc) != 0)) && ((iVar3 = (**(code **)(*(int *)this + 0xc))(), iVar3 == 1 && (*(int *)((int)this + 4) != 0)))) && ((*(int *)(*(int *)((int)this + 4) + 0x14) == 0 && (piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8), *piVar4 != 0)))) { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); pcVar1 = *(code **)(*(int *)*puVar5 + 0x94); uVar7 = FUN_00a23920(0); cVar2 = (*pcVar1)(uVar7); if (cVar2 == '\0') { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); pcVar1 = *(code **)(*(int *)*puVar5 + 0x8c); uVar7 = FUN_00a23920(); iVar3 = (*pcVar1)(uVar7); if (0 < iVar3) { local_11c._4_4_ = iVar3; puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); cVar2 = (**(code **)(*(int *)*puVar5 + 0x14))(iVar3,&local_120,&local_124); if (cVar2 != '\0') { iVar3 = local_120 * local_124 * 4; height = iVar3 + 4; local_128 = tracked_alloc(0,(void *)0x0,(ulonglong)height); *local_128 = (undefined2)local_120; local_128[1] = (undefined2)local_124; uVar7 = FUN_00a23920(); buffer = local_114; pcVar8 = "Steam User Avatar - %llu"; sprintf(buffer,(byte *)"Steam User Avatar - %llu"); puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec,buffer,pcVar8,uVar7); (**(code **)(*(int *)*puVar5 + 0x18))(local_11c._4_4_,local_128 + 2,iVar3); local_11c = FUN_00a23920(); ptr = local_128; KAGE_Graphics::create_image(&local_134,(int)local_128,height,4,local_114); local_8 = 0; if (local_134 != (int *)0x0) { if ((local_134[0xc] != 1) || (local_134[0xd] != 1)) { (**(code **)(*local_134 + 0x44))(1,1); local_134[0xc] = 1; local_134[0xd] = 1; } ::UserProfile::find_or_create(&local_11c); SmartPointer::operator_assign((void *)(extraout_EAX + 0x14),&local_134); } local_8 = 1; if (local_130 != (int *)0x0) { cVar2 = (**(code **)(*local_130 + 0xc))(); if ((cVar2 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_134); } } local_8 = 2; tracked_alloc(1,ptr,0); } } } } ExceptionList = local_10; return; } //@@ 00a238c0 FUN_00a238c0 void FUN_00a238c0(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamInternal_FindOrCreateUserInterface(0,"SteamUtils010"); *param_1 = uVar1; return; } //@@ 00a238e0 FUN_00a238e0 void FUN_00a238e0(undefined4 param_1,undefined4 param_2) { undefined4 *in_ECX; *in_ECX = param_1; in_ECX[1] = param_2; return; } //@@ 00a23900 FUN_00a23900 void FUN_00a23900(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("SteamFriends017"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 00a23920 FUN_00a23920 undefined8 FUN_00a23920(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return 0; } return *(undefined8 *)(*(int *)(in_ECX + 4) + 8); } //@@ 00a23950 FUN_00a23950 undefined * FUN_00a23950(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return &DAT_00b6d12c; } return *(undefined **)(*(int *)(in_ECX + 4) + 0x10); } //@@ 00a23970 FUN_00a23970 uint FUN_00a23970(void) { undefined1 *puVar1; uint in_EAX; void *pvVar2; int in_ECX; puVar1 = *(undefined1 **)(in_ECX + 4); if (puVar1 == (undefined1 *)0x0) { return in_EAX & 0xffffff00; } pvVar2 = (void *)0x0; if ((*(int *)(puVar1 + 0x20) == 0) || (pvVar2 = *(void **)(*(int *)(puVar1 + 0x20) + 0x10), pvVar2 != g_eosLocalUserId)) { return CONCAT31((int3)((uint)pvVar2 >> 8),*puVar1) & 0xffffff01; } return CONCAT31((int3)((uint)pvVar2 >> 8),1); } //@@ 00a239a0 FUN_00a239a0 uint FUN_00a239a0(void) { byte *pbVar1; int in_ECX; pbVar1 = *(byte **)(in_ECX + 4); if (pbVar1 == (byte *)0x0) { return 0; } return CONCAT31((int3)((uint)pbVar1 >> 8),*pbVar1 >> 1) & 0xffffff01; } //@@ 00a239c0 FUN_00a239c0 uint FUN_00a239c0(void) { byte *pbVar1; int in_ECX; pbVar1 = *(byte **)(in_ECX + 4); if (pbVar1 == (byte *)0x0) { return 0; } return CONCAT31((int3)((uint)pbVar1 >> 8),*pbVar1 >> 2) & 0xffffff01; } //@@ 00a239e0 FUN_00a239e0 undefined4 FUN_00a239e0(undefined4 param_1) { char cVar1; uint uVar2; undefined4 uVar3; int in_ECX; uint uVar4; uint uVar5; undefined1 local_24 [4]; int *local_20; undefined1 local_1c [4]; int *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11a30; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; local_14 = 0; if (*(int *)(in_ECX + 4) == 0) { uVar3 = KAGE::SmartPointer::SmartPointer(in_ECX); local_8 = 2; uVar4 = 2; } else { uVar3 = FUN_00a23df0(*(int *)(in_ECX + 4) + 0x20); local_8 = 1; uVar4 = 1; } local_14 = uVar4; FUN_00a23df0(uVar3); uVar5 = uVar4 | 4; if ((uVar4 & 2) != 0) { uVar5 = uVar4 & 0xfffffffd | 4; local_8 = 3; if (local_18 != (int *)0x0) { local_14 = uVar5; cVar1 = (**(code **)(*local_18 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_1c); } } } if ((uVar5 & 1) != 0) { local_14 = uVar5 & 0xfffffffe; local_8 = 4; if (local_20 != (int *)0x0) { cVar1 = (**(code **)(*local_20 + 0xc))(); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_24); } } } ExceptionList = local_10; return param_1; } //@@ 00a23ae0 UserProfile::find_or_create /* DB: ? keyed by 64-bit id in this[0..1]; looks up map via FUN_00a23bb0 under mutex, else creates under global CRITICAL_SECTION 0xc5aa78 ("Trying to lock mutex that has not been initialized"); results stored into KAGE::System::UserProfile objects in NetplayManager::process_drop_player_message prototype: db/protos.zhl */ void __thiscall UserProfile::find_or_create(void *this) { char cVar1; void *pvVar2; int iVar3; undefined1 local_20 [8]; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; if (*(int *)this == 0 && *(int *)((int)this + 4) == 0) { return; } iVar3 = FUN_00a23bb0(); if (iVar3 == 0) { if ((DAT_00c5aa74 & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Trying to lock mutex that has not been initialized"); } pvVar2 = g_userProfileLock; EnterCriticalSection(g_userProfileLock); cVar1 = *(char *)((int)pvVar2 + 0x18); while (cVar1 != '\0') { Sleep(1000); cVar1 = *(char *)((int)pvVar2 + 0x18); } *(undefined1 *)((int)pvVar2 + 0x18) = 1; local_18 = *(undefined4 *)this; local_14 = *(undefined4 *)((int)this + 4); local_10 = local_18; local_c = local_14; std::map::try_emplace(local_20,&local_18); if ((DAT_00c5aa74 & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Trying to unlock mutex that has not been initialized"); } pvVar2 = g_userProfileLock; *(undefined1 *)((int)g_userProfileLock + 0x18) = 0; LeaveCriticalSection(pvVar2); FUN_00a23bb0(); } return; } //@@ 00a23bb0 FUN_00a23bb0 int FUN_00a23bb0(void) { uint *in_ECX; int iVar1; undefined1 local_1c [8]; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(PTR_vftable_00c5aa70 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_1c + 0x18)); FUN_00a24210(local_1c,in_ECX); if (*(char *)(local_14 + 0xd) == '\0') { if ((*(uint *)(local_14 + 0x14) <= in_ECX[1]) && (((*(uint *)(local_14 + 0x14) < in_ECX[1] || (*(uint *)(local_14 + 0x10) <= *in_ECX)) && (local_14 != DAT_00c798d8)))) { iVar1 = local_14 + 0x18; goto LAB_00a23c1a; } } iVar1 = 0; LAB_00a23c1a: local_8 = 0; (**(code **)(PTR_vftable_00c5aa70 + 0x10))(); ExceptionList = local_10; return iVar1; } //@@ 00a23c50 KAGE::SmartPointer::operator_assign /* DB: copy-and-swap: builds a temp from param via FUN_00a23df0, swaps both dwords with this, releases the temp's old refcount (vfunc +0xc); same shape as SharedPtr::assign 004d74a0 SharedPtr::assign void KAGE::SmartPointer::operator_assign(undefined4 param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_00a23df0(param_1); uVar1 = puVar4[1]; puVar4[1] = in_ECX[1]; in_ECX[1] = uVar1; uVar1 = *puVar4; *puVar4 = *in_ECX; *in_ECX = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_1c); } } ExceptionList = local_10; return; } //@@ 00a23ce0 FUN_00a23ce0 void FUN_00a23ce0(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00a23d40 KAGE::SmartPointer::SmartPointer /* DB: default ctor: zeroes this, wraps null in a new ReferenceCount, releases any old block; same shape as 00a28790 KAGE::SmartPointer::SmartPointer void KAGE::SmartPointer::SmartPointer(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(); } } in_ECX[1] = this; *in_ECX = 0; ExceptionList = local_10; return; } //@@ 00a23df0 FUN_00a23df0 void FUN_00a23df0(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 00a23e50 FUN_00a23e50 undefined4 FUN_00a23e50(void) { undefined1 *ptr; short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); ptr = (undefined1 *)in_ECX[5]; if (ptr != (undefined1 *)0x0) { *ptr = 0; *(undefined4 *)(ptr + 8) = 0; *(undefined4 *)(ptr + 0xc) = 0; *(undefined4 *)(ptr + 0x10) = 0; *(undefined4 *)(ptr + 0x14) = 0; *(undefined4 *)(ptr + 0x18) = 0xffffffff; operator_delete(ptr,0x20); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x00a23ec3. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 00a23ee0 FUN_00a23ee0 void FUN_00a23ee0(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00a23ee0(param_1,param_2[2]); piVar2 = (int *)*param_2; FUN_00a70fe0(); operator_delete(param_2,0x40); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00a23f30 KAGE::SmartPointer::reset /* DB: news ReferenceCount (ptr at +0x14 = param_1), releases old refcount at this+4 (vfunc +0xc, g_profileReleaseFn), stores ptr/refcount in this[0]/[1]; same shape as KAGE::SmartPointer::reset 0040c7f0 KAGE::SmartPointer::reset void KAGE::SmartPointer::reset(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 00a23fd0 std::map::try_emplace /* DB: ? red-black tree (head DAT_00c798d8, size DAT_00c798dc, max 0x3ffffff) find-or-insert of a 64-bit key, new node 0x40 bytes; from UserProfile::find_or_create */ void std::map::try_emplace(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; undefined4 *puVar4; int *piVar5; uint uVar6; undefined8 *puVar7; undefined4 *puVar8; undefined4 *puVar9; undefined4 *puVar10; int *local_28; int iStack_24; undefined1 local_1c [4]; undefined4 *local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11a7b; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)FUN_00a24210(local_1c,param_2); piVar5 = DAT_00c798d8; iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if (*(char *)(iVar3 + 0xd) == '\0') { if ((*(uint *)(iVar3 + 0x14) <= param_2[1]) && ((*(uint *)(iVar3 + 0x14) < param_2[1] || (*(uint *)(iVar3 + 0x10) <= *param_2)))) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (DAT_00c798dc == 0x3ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } local_18 = &DAT_00c798d8; local_8 = 0; local_14 = (undefined4 *)0x0; puVar8 = operator_new(0x40); uVar6 = *param_2; puVar8[5] = param_2[1]; puVar8[4] = uVar6; *(undefined1 *)(puVar8 + 6) = 0; uVar6 = param_2[3]; puVar8[8] = param_2[2]; puVar8[9] = uVar6; puVar8[10] = 0; puVar8[0xb] = 0; puVar8[0xc] = 0; puVar8[0xe] = 0; puVar8[0xf] = 0; local_8 = 3; local_14 = puVar8; steam_user_profile_update(puVar8 + 6); local_28 = (int *)uVar1; *puVar8 = piVar5; puVar8[1] = piVar5; puVar8[2] = piVar5; *(undefined2 *)(puVar8 + 3) = 0; piVar5 = DAT_00c798d8; DAT_00c798dc = DAT_00c798dc + 1; puVar8[1] = local_28; if (local_28 == piVar5) { *piVar5 = (int)puVar8; piVar5[1] = (int)puVar8; piVar5[2] = (int)puVar8; *(undefined1 *)(puVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)puVar8; if (local_28 == (int *)piVar5[2]) { piVar5[2] = (int)puVar8; } } else { *local_28 = (int)puVar8; if (local_28 == (int *)*piVar5) { *piVar5 = (int)puVar8; } } cVar2 = *(char *)(puVar8[1] + 0xc); puVar10 = puVar8; while (cVar2 == '\0') { puVar4 = (undefined4 *)puVar10[1]; puVar9 = *(undefined4 **)puVar4[1]; if (puVar4 == puVar9) { puVar9 = (undefined4 *)((undefined4 *)puVar4[1])[2]; if (*(char *)(puVar9 + 3) == '\0') { LAB_00a24182: *(undefined1 *)(puVar4 + 3) = 1; *(undefined1 *)(puVar9 + 3) = 1; *(undefined1 *)(*(int *)(puVar10[1] + 4) + 0xc) = 0; puVar10 = *(undefined4 **)(puVar10[1] + 4); } else { if (puVar10 == (undefined4 *)puVar4[2]) { FUN_00415fe0(puVar4); puVar10 = puVar4; } *(undefined1 *)(puVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar10[1] + 4)); } } else { if (*(char *)(puVar9 + 3) == '\0') goto LAB_00a24182; if (puVar10 == (undefined4 *)*puVar4) { FUN_00415f80(puVar4); puVar10 = puVar4; } *(undefined1 *)(puVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar10[1] + 4)); } cVar2 = *(char *)(puVar10[1] + 0xc); } *(undefined1 *)(piVar5[1] + 0xc) = 1; } *param_1 = (int)puVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a24210 FUN_00a24210 int * FUN_00a24210(int *param_1,uint *param_2) { uint uVar1; uint uVar2; undefined4 *puVar3; int iVar4; iVar4 = DAT_00c798d8; puVar3 = *(undefined4 **)(DAT_00c798d8 + 4); *param_1 = (int)puVar3; param_1[1] = 0; param_1[2] = iVar4; if (*(char *)((int)puVar3 + 0xd) == '\0') { uVar1 = *param_2; uVar2 = param_2[1]; do { *param_1 = (int)puVar3; if ((uVar2 < (uint)puVar3[5]) || ((uVar2 <= (uint)puVar3[5] && (uVar1 <= (uint)puVar3[4])))) { param_1[2] = (int)puVar3; iVar4 = 1; puVar3 = (undefined4 *)*puVar3; } else { puVar3 = (undefined4 *)puVar3[2]; iVar4 = 0; } param_1[1] = iVar4; } while (*(char *)((int)puVar3 + 0xd) == '\0'); } return param_1; } //@@ 00a24270 DateTime::constructor /* DB: ? thiscall (bool now): zeroes flags byte, time64 at +8 and tm fields +0x10..+0x30; when now: _time64 -> +8 and _gmtime64 into the tm fields; holiday_get_current then sets flags|=2 (same struct as DateTime::set_from_yyyymmdd 0085af30) */ void DateTime::constructor(char param_1) { byte *_Time; int iVar1; int iVar2; int iVar3; byte bVar4; tm *ptVar5; byte *in_ECX; __time64_t _Var6; _Time = in_ECX + 8; _Time[0] = 0; _Time[1] = 0; _Time[2] = 0; _Time[3] = 0; *in_ECX = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; in_ECX[0x10] = 0; in_ECX[0x11] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0; in_ECX[0x16] = 0; in_ECX[0x17] = 0; in_ECX[0x18] = 0; in_ECX[0x19] = 0; in_ECX[0x1a] = 0; in_ECX[0x1b] = 0; in_ECX[0x1c] = 0; in_ECX[0x1d] = 0; in_ECX[0x1e] = 0; in_ECX[0x1f] = 0; in_ECX[0x20] = 0; in_ECX[0x21] = 0; in_ECX[0x22] = 0; in_ECX[0x23] = 0; in_ECX[0x24] = 0; in_ECX[0x25] = 0; in_ECX[0x26] = 0; in_ECX[0x27] = 0; in_ECX[0x28] = 0; in_ECX[0x29] = 0; in_ECX[0x2a] = 0; in_ECX[0x2b] = 0; in_ECX[0x2c] = 0; in_ECX[0x2d] = 0; in_ECX[0x2e] = 0; in_ECX[0x2f] = 0; in_ECX[0x30] = 0; in_ECX[0x31] = 0; in_ECX[0x32] = 0; in_ECX[0x33] = 0; if (param_1 != '\0') { _Var6 = _time64((__time64_t *)0x0); bVar4 = *in_ECX; *(__time64_t *)_Time = _Var6; *in_ECX = bVar4 & 0xfd; if ((bVar4 & 1) == 0) { bVar4 = bVar4 & 0xfc; } else { ptVar5 = _gmtime64((__time64_t *)_Time); iVar1 = ptVar5->tm_min; iVar2 = ptVar5->tm_hour; iVar3 = ptVar5->tm_mday; *(int *)(in_ECX + 0x10) = ptVar5->tm_sec; *(int *)(in_ECX + 0x14) = iVar1; *(int *)(in_ECX + 0x18) = iVar2; *(int *)(in_ECX + 0x1c) = iVar3; iVar1 = ptVar5->tm_year; iVar2 = ptVar5->tm_wday; iVar3 = ptVar5->tm_yday; *(int *)(in_ECX + 0x20) = ptVar5->tm_mon; *(int *)(in_ECX + 0x24) = iVar1; *(int *)(in_ECX + 0x28) = iVar2; *(int *)(in_ECX + 0x2c) = iVar3; *(int *)(in_ECX + 0x30) = ptVar5->tm_isdst; bVar4 = *in_ECX & 0xfd; } *in_ECX = bVar4 | 1; ptVar5 = _gmtime64((__time64_t *)_Time); iVar1 = ptVar5->tm_min; iVar2 = ptVar5->tm_hour; iVar3 = ptVar5->tm_mday; *(int *)(in_ECX + 0x10) = ptVar5->tm_sec; *(int *)(in_ECX + 0x14) = iVar1; *(int *)(in_ECX + 0x18) = iVar2; *(int *)(in_ECX + 0x1c) = iVar3; iVar1 = ptVar5->tm_year; iVar2 = ptVar5->tm_wday; iVar3 = ptVar5->tm_yday; *(int *)(in_ECX + 0x20) = ptVar5->tm_mon; *(int *)(in_ECX + 0x24) = iVar1; *(int *)(in_ECX + 0x28) = iVar2; *(int *)(in_ECX + 0x2c) = iVar3; iVar1 = ptVar5->tm_isdst; *in_ECX = *in_ECX & 0xfc; *(int *)(in_ECX + 0x30) = iVar1; } return; } //@@ 00a24330 FUN_00a24330 void FUN_00a24330(int param_1,uint param_2,undefined4 param_3) { int *in_ECX; int iVar1; iVar1 = *in_ECX; if ((uint)(in_ECX[1] - iVar1 >> 4) <= param_2) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); iVar1 = *in_ECX; } *(undefined4 *)(iVar1 + (param_1 + param_2 * 4) * 4) = param_3; return; } //@@ 00a24370 FUN_00a24370 undefined4 FUN_00a24370(uint param_1,int param_2) { int *in_ECX; if (param_1 < (uint)(in_ECX[1] - *in_ECX >> 4)) { return *(undefined4 *)(*in_ECX + (param_2 + param_1 * 4) * 4); } KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); return *(undefined4 *)(*in_ECX + (param_2 + param_1 * 4) * 4); } //@@ 00a243c0 FUN_00a243c0 void FUN_00a243c0(uint param_1,undefined4 *param_2) { int *in_ECX; if ((uint)(in_ECX[1] - *in_ECX >> 4) <= param_1) { KAGE_LogMessage(0x10,(byte *)"ActionId is out of range\n"); } *param_2 = 0xffffffff; param_2[1] = 0xffffffff; param_2[2] = 0xffffffff; param_2[3] = 0xffffffff; *param_2 = *(undefined4 *)(*in_ECX + param_1 * 0x10); param_2[1] = *(undefined4 *)(*in_ECX + 4 + param_1 * 0x10); param_2[2] = *(undefined4 *)(*in_ECX + 8 + param_1 * 0x10); param_2[3] = *(undefined4 *)(*in_ECX + 0xc + param_1 * 0x10); return; } //@@ 00a24420 std::vector<16byte_ff>::_Resize_reallocate /* DB: same as 00a1cea0 std::vector<16byte>::_Resize_reallocate new 16-byte elements are memset 0xff and old ones copied dword-wise; init_engine_parameters resizes to 0x20 (action bindings) */ void std::vector<16byte_ff>::_Resize_reallocate(uint param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; int *in_ECX; int iVar8; uint uVar9; undefined4 *puVar10; uint size; int iVar11; if (0xfffffff < param_1) { /* WARNING: Subroutine does not return */ _Xlen(); } iVar8 = in_ECX[1] - *in_ECX >> 4; uVar9 = in_ECX[2] - *in_ECX >> 4; if (0xfffffff - (uVar9 >> 1) < uVar9) { uVar9 = 0xfffffff; } else { uVar9 = (uVar9 >> 1) + uVar9; if (uVar9 < param_1) { uVar9 = param_1; } else if (0xfffffff < uVar9) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar5 = _Allocate(uVar9 * 0x10); iVar11 = param_1 - iVar8; if (iVar11 != 0) { memset(puVar5 + iVar8 * 4,0xff,iVar11 * 0x10); } puVar6 = (undefined4 *)*in_ECX; puVar7 = (undefined4 *)in_ECX[1]; puVar10 = puVar5; if (puVar6 != puVar7) { do { uVar1 = *puVar6; uVar2 = puVar6[1]; uVar3 = puVar6[2]; uVar4 = puVar6[3]; puVar6 = puVar6 + 4; *puVar10 = uVar1; puVar10[1] = uVar2; puVar10[2] = uVar3; puVar10[3] = uVar4; puVar10 = puVar10 + 4; } while (puVar6 != puVar7); puVar6 = (undefined4 *)*in_ECX; } if (puVar6 != (undefined4 *)0x0) { size = in_ECX[2] - (int)puVar6 & 0xfffffff0; puVar7 = puVar6; if (0xfff < size) { puVar7 = (undefined4 *)puVar6[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar6 + (-4 - (int)puVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar7,size); } *in_ECX = (int)puVar5; in_ECX[1] = (int)(puVar5 + param_1 * 4); in_ECX[2] = (int)(puVar5 + uVar9 * 4); return; } //@@ 00a24530 FUN_00a24530 void FUN_00a24530(char *param_1) { char cVar1; char *pcVar2; pcVar2 = param_1; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar2 - (int)(param_1 + 1))) { KAGE_LogMessage(0x10,(byte *)"%s: It is longer than the allowed size of %d\n"); } cVar1 = *param_1; while (cVar1 != '\0') { pcVar2 = strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._ !?&-()+:", (int)cVar1); if (pcVar2 == (char *)0x0) { KAGE_LogMessage(0x10,(byte *)"%s: \'%c\' in an invalid character\n"); } pcVar2 = param_1 + 1; param_1 = param_1 + 1; cVar1 = *pcVar2; } return; } //@@ 00a245b0 FUN_00a245b0 void FUN_00a245b0(void) { undefined4 *in_ECX; in_ECX[1] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; in_ECX[0x10] = 0; in_ECX[0x11] = 0; in_ECX[0x12] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; *in_ECX = KAGE::Graphics::Shader::vftable; in_ECX[0x13] = 0xffffffff; return; } //@@ 00a24620 FUN_00a24620 void FUN_00a24620(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ShaderBase::vftable; KAGE::Graphics::ShaderBase::free_uniforms(in_ECX); FID_conflict__Tidy(in_ECX + 0x10); FUN_00a15310(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x50); } return; } //@@ 00a24660 FUN_00a24660 void FUN_00a24660(void) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ShaderBase::vftable; KAGE::Graphics::ShaderBase::free_uniforms(in_ECX); FID_conflict__Tidy(in_ECX + 0x10); FUN_00a15310(); return; } //@@ 00a24680 FUN_00a24680 void FUN_00a24680(void) { void *in_ECX; (*(code *)epoxy_glDeleteProgram)(*(undefined4 *)((int)in_ECX + 0x4c)); KAGE::Graphics::ShaderBase::free_uniforms(in_ECX); return; } //@@ 00a246a0 FUN_00a246a0 undefined4 FUN_00a246a0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; void *pvVar3; undefined4 uVar4; int in_ECX; int local_24; int local_20; int local_1c; int local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01a70; local_10 = ExceptionList; ExceptionList = &local_10; uVar1 = (*(code *)epoxy_glCreateShader)(0x8b31,__security_cookie ^ (int)register0x00000010 - 4U); uVar2 = (*(code *)epoxy_glCreateShader)(0x8b30); local_14 = (void *)*param_1; (*(code *)epoxy_glShaderSource)(uVar1,1,&local_14,0); (*(code *)epoxy_glCompileShader)(uVar1); (*(code *)epoxy_glGetShaderiv)(uVar1,0x8b81,&local_1c); if (local_1c == 0) { (*(code *)epoxy_glGetShaderiv)(uVar1,0x8b84,¶m_1); pvVar3 = tracked_alloc(0,(void *)0x0,(ulonglong)((int)param_1 + 1)); (*(code *)epoxy_glGetShaderInfoLog)(uVar1,param_1,0,pvVar3); KAGE_LogMessage(8,(byte *)"Failed to compile vertex shader \'%s\'. Errors - \n%s\n"); if (pvVar3 != (void *)0x0) { uStack_8 = 0; tracked_alloc(1,pvVar3,0); uStack_8 = 0xffffffff; } (*(code *)epoxy_glDeleteShader)(uVar1); ExceptionList = local_10; return 0; } local_1c = param_1[2]; (*(code *)epoxy_glShaderSource)(uVar2,1,&local_1c,0); (*(code *)epoxy_glCompileShader)(uVar2); (*(code *)epoxy_glGetShaderiv)(uVar2,0x8b81,&local_20); if (local_20 == 0) { (*(code *)epoxy_glGetShaderiv)(uVar2,0x8b84,¶m_1); local_14 = tracked_alloc(0,(void *)0x0,(ulonglong)((int)param_1 + 1)); (*(code *)epoxy_glGetShaderInfoLog)(uVar2,param_1,0,local_14); KAGE_LogMessage(8,(byte *)"Failed to compile fragment shader \'%s\'. Errors - \n%s\n"); if (local_14 != (void *)0x0) { uStack_8 = 1; tracked_alloc(1,local_14,0); uStack_8 = 0xffffffff; } (*(code *)epoxy_glDeleteShader)(uVar1); (*(code *)epoxy_glDeleteShader)(uVar2); ExceptionList = local_10; return 0; } uVar4 = (*(code *)epoxy_glCreateProgram)(); *(undefined4 *)(in_ECX + 0x4c) = uVar4; (*(code *)epoxy_glAttachShader)(uVar4,uVar1); (*(code *)epoxy_glAttachShader)(*(undefined4 *)(in_ECX + 0x4c),uVar2); (*(code *)epoxy_glLinkProgram)(*(undefined4 *)(in_ECX + 0x4c)); (*(code *)epoxy_glDeleteShader)(uVar1); (*(code *)epoxy_glDeleteShader)(uVar2); (*(code *)epoxy_glGetProgramiv)(*(undefined4 *)(in_ECX + 0x4c),0x8b82,&local_24); if (local_24 != 0) { ExceptionList = local_10; return 1; } (*(code *)epoxy_glGetProgramiv)(*(undefined4 *)(in_ECX + 0x4c),0x8b84,&local_18); pvVar3 = tracked_alloc(0,(void *)0x0,(ulonglong)(local_18 + 1)); (*(code *)epoxy_glGetProgramInfoLog)(*(undefined4 *)(in_ECX + 0x4c),local_18,0,pvVar3); KAGE_LogMessage(8,(byte *)"Failed to link shader program \'%s\'. Errors - \n%s\n"); if (pvVar3 != (void *)0x0) { uStack_8 = 2; tracked_alloc(1,pvVar3,0); uStack_8 = 0xffffffff; } (*(code *)epoxy_glDeleteProgram)(*(undefined4 *)(in_ECX + 0x4c)); ExceptionList = local_10; return 0; } //@@ 00a24960 FUN_00a24960 void FUN_00a24960(int *param_1) { uint uVar1; undefined4 uVar2; int *in_ECX; undefined4 *puVar3; int iVar4; int *piVar5; uint uVar6; (*(code *)epoxy_glUseProgram)(in_ECX[0x13]); piVar5 = param_1; if (param_1 == (int *)0x0) { piVar5 = in_ECX + 0x10; } uVar6 = 0; iVar4 = *piVar5; if (piVar5[1] - iVar4 >> 2 != 0) { param_1 = (int *)0x0; do { puVar3 = (undefined4 *)(in_ECX[0xd] + (int)param_1); uVar1 = *(uint *)(iVar4 + uVar6 * 4); if (uVar1 < (uint)((int)(puVar3[4] - puVar3[3]) >> 2)) { uVar2 = *(undefined4 *)(puVar3[3] + uVar1 * 4); uVar1 = puVar3[2]; if (uVar1 < 8) { (&DAT_00c79928)[uVar1] = uVar2; } else { (**(code **)(*in_ECX + 0x1c))(*puVar3,uVar1,uVar2,puVar3[1]); } } uVar6 = uVar6 + 1; iVar4 = *piVar5; param_1 = (int *)((int)param_1 + 0x18); } while (uVar6 < (uint)(piVar5[1] - iVar4 >> 2)); } uVar6 = 0; do { if ((&DAT_00c79928)[uVar6] != 0) { (**(code **)(*in_ECX + 0x18))(uVar6,(&DAT_00c79928)[uVar6]); } uVar6 = uVar6 + 1; } while (uVar6 < 8); KAGE_Graphics::update_projection(&DAT_00c798e0); return; } //@@ 00a24a20 FUN_00a24a20 undefined * FUN_00a24a20(void) { sprintf(&DAT_00c94a64,(byte *)"Texture%d"); return &DAT_00c94a64; } //@@ 00a24a50 FUN_00a24a50 void FUN_00a24a50(int param_1,int param_2) { int iVar1; int *in_ECX; iVar1 = in_ECX[param_1 + 5]; if (iVar1 == 0) { iVar1 = (**(code **)(*in_ECX + 0x10))(param_1); } iVar1 = (*(code *)epoxy_glGetUniformLocation)(in_ECX[0x13],iVar1); if (-1 < iVar1) { (*(code *)epoxy_glActiveTexture)(param_1 + 0x84c0); (*(code *)epoxy_glBindTexture)(0xde1,*(undefined4 *)(param_2 + 0x58)); (*(code *)epoxy_glUniform1i)(iVar1,param_1); } return; } //@@ 00a24ab0 FUN_00a24ab0 void FUN_00a24ab0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int iVar1; int in_ECX; iVar1 = (*(code *)epoxy_glGetUniformLocation)(*(undefined4 *)(in_ECX + 0x4c),param_1); if (-1 < iVar1) { switch(param_2) { case 8: (*(code *)epoxy_glUniform1fv)(iVar1,1,param_3); return; case 9: (*(code *)epoxy_glUniform2fv)(iVar1,1,param_3); return; case 10: (*(code *)epoxy_glUniform3fv)(iVar1,1,param_3); return; case 0xb: (*(code *)epoxy_glUniform4fv)(iVar1,1,param_3); return; case 0xc: (*(code *)epoxy_glUniform1iv)(iVar1,1,param_3); return; case 0xd: (*(code *)epoxy_glUniform2iv)(iVar1,1,param_3); return; case 0xe: (*(code *)epoxy_glUniform3iv)(iVar1,1,param_3); return; case 0xf: (*(code *)epoxy_glUniform4iv)(iVar1,1,param_3); return; case 0x10: (*(code *)epoxy_glUniform1uiv)(iVar1,1,param_3); return; case 0x11: (*(code *)epoxy_glUniform2uiv)(iVar1,1,param_3); return; case 0x12: (*(code *)epoxy_glUniform3uiv)(iVar1,1,param_3); return; case 0x13: (*(code *)epoxy_glUniform4uiv)(iVar1,1,param_3); return; case 0x14: (*(code *)epoxy_glUniformMatrix2fv)(iVar1,1,0,param_3); return; case 0x15: (*(code *)epoxy_glUniformMatrix2x3fv)(iVar1,1,0,param_3); return; case 0x16: (*(code *)epoxy_glUniformMatrix2x4fv)(iVar1,1,0,param_3); return; case 0x17: (*(code *)epoxy_glUniformMatrix3x2fv)(iVar1,1,0,param_3); return; case 0x18: (*(code *)epoxy_glUniformMatrix3fv)(iVar1,1,0,param_3); return; case 0x19: (*(code *)epoxy_glUniformMatrix3x4fv)(iVar1,1,0,param_3); return; case 0x1a: (*(code *)epoxy_glUniformMatrix4x2fv)(iVar1,1,0,param_3); return; case 0x1b: (*(code *)epoxy_glUniformMatrix4x3fv)(iVar1,1,0,param_3); return; case 0x1c: (*(code *)epoxy_glUniformMatrix4fv)(iVar1,1,0,param_3); } } return; } //@@ 00a24ca0 FUN_00a24ca0 void FUN_00a24ca0(int param_1,undefined4 param_2,undefined4 param_3) { undefined *puVar1; int iVar2; undefined4 uVar3; int in_ECX; uint uVar4; uVar4 = 0; if (*(int *)(in_ECX + 0x10) != 0) { do { iVar2 = (*(code *)epoxy_glGetAttribLocation) (*(undefined4 *)(in_ECX + 0x4c), *(undefined4 *)(*(int *)(in_ECX + 0xc) + uVar4 * 8)); if (-1 < iVar2) { (*(code *)epoxy_glEnableVertexAttribArray)(iVar2); puVar1 = epoxy_glVertexAttribPointer; switch(*(undefined4 *)(*(int *)(in_ECX + 0xc) + 4 + uVar4 * 8)) { case 1: case 8: uVar3 = 1; break; case 2: case 7: uVar3 = 2; break; case 3: case 5: uVar3 = 3; break; case 4: case 6: uVar3 = 4; break; default: KAGE_LogMessage(0x10,(byte *)"Unknown attribute format specified\n"); uVar3 = 0; } (*(code *)puVar1)(iVar2,uVar3,0x1406,0,param_3,param_1); } switch(*(undefined4 *)(*(int *)(in_ECX + 0xc) + 4 + uVar4 * 8)) { case 1: case 8: iVar2 = 4; break; case 2: case 7: iVar2 = 8; break; case 3: case 5: iVar2 = 0xc; break; case 4: case 6: iVar2 = 0x10; break; default: KAGE_LogMessage(0x10,(byte *)"Unknown attribute format specified\n"); iVar2 = 0; } uVar4 = uVar4 + 1; param_1 = param_1 + iVar2; } while (uVar4 < *(uint *)(in_ECX + 0x10)); } return; } //@@ 00a24dd0 FUN_00a24dd0 void FUN_00a24dd0(void) { int iVar1; int in_ECX; uint uVar2; uVar2 = 0; if (*(int *)(in_ECX + 0x10) != 0) { do { iVar1 = (*(code *)epoxy_glGetAttribLocation) (*(undefined4 *)(in_ECX + 0x4c), *(undefined4 *)(*(int *)(in_ECX + 0xc) + uVar2 * 8)); if (-1 < iVar1) { (*(code *)epoxy_glDisableVertexAttribArray)(iVar1); } uVar2 = uVar2 + 1; } while (uVar2 < *(uint *)(in_ECX + 0x10)); } return; } //@@ 00a24e10 FUN_00a24e10 int FUN_00a24e10(void) { int iVar1; int in_ECX; int in_EDX; undefined4 *puVar2; int iVar3; iVar3 = 0; if (in_EDX != 0) { puVar2 = (undefined4 *)(in_ECX + 4); do { switch(*puVar2) { case 1: case 8: iVar1 = 4; break; case 2: case 7: iVar1 = 8; break; case 3: case 5: iVar1 = 0xc; break; case 4: case 6: iVar1 = 0x10; break; default: KAGE_LogMessage(0x10,(byte *)"Unknown attribute format specified\n"); iVar1 = 0; } iVar3 = iVar3 + iVar1; puVar2 = puVar2 + 2; in_EDX = in_EDX + -1; } while (in_EDX != 0); } return iVar3; } //@@ 00a24e90 FUN_00a24e90 void FUN_00a24e90(void) { undefined4 *in_ECX; in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a24ea0 FUN_00a24ea0 void FUN_00a24ea0(void) { int in_ECX; if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(); } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a24ec0 FUN_00a24ec0 void FUN_00a24ec0(void) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; uVar6 = GetTimeNs(); uVar3 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar3 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar3 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar4 = (uint)((ulonglong)lVar1 >> 0x20); uVar3 = (uint)lVar1 >> 0x12 | uVar4 * 0x4000; if (((uVar4 >> 0x12) - *(int *)(in_ECX + 0xc) != (uint)(uVar3 < *(uint *)(in_ECX + 8))) || (*(uint *)(in_ECX + 0x10) <= uVar3 - *(uint *)(in_ECX + 8))) { if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(); } uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(in_ECX + 8) = (uint)lVar1 >> 0x12 | uVar3 * 0x4000; *(uint *)(in_ECX + 0xc) = uVar3 >> 0x12; } return; } //@@ 00a24fd0 SaveDataManager::open_file_read /* DB: ? logs "Save data manager has not been initialized" unless flag&1; when flag&2 news a KAGE::Filesys::File, gets path via own vfunc +0x10 and calls File open-read vfunc +0x24; callers Isaac::LoadModData, OptionsConfig::Load, Menu_Save::load_slot_data, PersistentGameData::TryImportABLocalSave prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall SaveDataManager::open_file_read(void *this,byte *fileName) { byte bVar1; uint uVar2; int *this_00; byte *pbVar3; byte isAppendSlash; uVar2 = *(uint *)((int)this + 4); if ((uVar2 & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Save data manager has not been initialized\n"); uVar2 = *(uint *)((int)this + 4); } if ((uVar2 & 2) == 0) { return (void *)0x0; } this_00 = operator_new(0x10); if (this_00 == (int *)0x0) { this_00 = (int *)0x0; } else { this_00[1] = 2; this_00[2] = 0; *this_00 = (int)KAGE::Filesys::File::vftable; this_00[3] = 0; } isAppendSlash = 0; bVar1 = 0; pbVar3 = (byte *)(**(code **)(*(int *)this + 0x10))(); pbVar3 = path_join(fileName,pbVar3,bVar1,isAppendSlash); if (*(code **)(*this_00 + 0x24) == KAGE::Filesys::File::open) { bVar1 = KAGE::Filesys::File::open(this_00,pbVar3); } else { bVar1 = (**(code **)(*this_00 + 0x24))(); } if (bVar1 == 0) { (**(code **)*this_00)(1); this_00 = (int *)0x0; } if (pbVar3 != (byte *)0x0) { operator_delete(pbVar3,1); } return this_00; } //@@ 00a25090 SaveDataManager::open_file_write /* DB: ? sibling of 00a24fd0 SaveDataManager::open_file_read callers are writers (Isaac::SaveModData, write_desync_dump); logs "Save data manager has not been initialized" if !(this+4 &1); if flags&2 and file exists (FUN_00a25200) news a KAGE::Filesys::File and calls its open vfunc +0x28(path,mode); returns File* or null; callers Isaac::SaveModData, ModEntry::parse_metadata_xml prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall SaveDataManager::open_file_write(void *this,byte *path,int mode) { char cVar1; uint uVar2; int *piVar3; uVar2 = *(uint *)((int)this + 4); if ((uVar2 & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Save data manager has not been initialized\n"); uVar2 = *(uint *)((int)this + 4); } if ((uVar2 & 2) != 0) { cVar1 = FUN_00a25200(path); if (cVar1 != '\0') { piVar3 = operator_new(0x10); if (piVar3 == (int *)0x0) { piVar3 = (int *)0x0; } else { piVar3[1] = 2; piVar3[2] = 0; *piVar3 = (int)KAGE::Filesys::File::vftable; piVar3[3] = 0; } if (*(code **)(*piVar3 + 0x28) == FUN_00a52610) { cVar1 = FUN_00a52610(path,mode); } else { cVar1 = (**(code **)(*piVar3 + 0x28))(path,mode); } if (cVar1 == '\0') { (**(code **)*piVar3)(1); piVar3 = (int *)0x0; } return piVar3; } } return (void *)0x0; } //@@ 00a25130 FUN_00a25130 undefined4 FUN_00a25130(undefined4 param_1,undefined4 param_2) { int *piVar1; uint size; void *ptr; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = (int *)0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(**(code **)(*in_ECX + 0x14)) (param_1,__security_cookie ^ (int)register0x00000010 - 4U); if (piVar1 != (int *)0x0) { size = (**(code **)(*piVar1 + 4))(); ptr = operator_new_tracked(size); (**(code **)(*piVar1 + 0x14))(ptr,1,size); (**(code **)*piVar1)(1); piVar1 = (int *)(**(code **)(*in_ECX + 0x18))(param_2,0); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 0x1c))(ptr,1,size); (**(code **)*piVar1)(1); ExceptionList = local_10; return 1; } if (ptr != (void *)0x0) { local_8 = piVar1; tracked_alloc(1,ptr,0); } } ExceptionList = local_10; return 0; } //@@ 00a25200 FUN_00a25200 byte FUN_00a25200(byte *param_1) { char *pcVar1; char cVar2; byte bVar3; byte *pbVar4; byte *_Str; char *_Dst; char *pcVar5; int *in_ECX; char *pcVar6; size_t _Size; byte isAppendSlash; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10fa0; local_10 = ExceptionList; ExceptionList = &local_10; isAppendSlash = 0; bVar3 = 0; pbVar4 = (byte *)(**(code **)(*in_ECX + 0x10)) (0,0,__security_cookie ^ (int)register0x00000010 - 4U); _Str = path_join(param_1,pbVar4,bVar3,isAppendSlash); pbVar4 = _Str; do { bVar3 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar3 != 0); _Dst = tracked_alloc(0,(void *)0x0,ZEXT48(pbVar4 + (1 - (int)(_Str + 1)))); pcVar5 = strpbrk((char *)_Str,"/"); param_1._3_1_ = 1; for (; pcVar5 != (char *)0x0; pcVar5 = strpbrk(pcVar5 + 1,"/")) { _Size = (int)pcVar5 - (int)_Str; memcpy(_Dst,_Str,_Size); _Dst[_Size] = '\0'; pcVar6 = _Dst; do { cVar2 = *pcVar6; pcVar6 = pcVar6 + 1; } while (cVar2 != '\0'); if ((pcVar6 != _Dst + 1) && (_Dst[_Size - 1] != ':')) { pcVar6 = _Dst + -1; do { pcVar1 = pcVar6 + 1; pcVar6 = pcVar6 + 1; } while (*pcVar1 != '\0'); pcVar6[0] = '/'; pcVar6[1] = '\0'; bVar3 = (**(code **)(*in_ECX + 0x24))(_Dst); param_1._3_1_ = param_1._3_1_ & bVar3; } } if (_Str != (byte *)0x0) { local_8 = 0; tracked_alloc(1,_Str,0); } if (_Dst != (char *)0x0) { local_8 = 1; tracked_alloc(1,_Dst,0); } ExceptionList = local_10; return param_1._3_1_; } //@@ 00a25350 FUN_00a25350 void FUN_00a25350(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = KAGE::Filesys::FileStream::vftable; in_ECX[1] = 2; if ((void *)in_ECX[2] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[2],0); in_ECX[2] = 0; } *in_ECX = KAGE::Filesys::StreamBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } ExceptionList = local_10; return; } //@@ 00a253e0 FUN_00a253e0 undefined4 FUN_00a253e0(byte *param_1) { byte *pbVar1; int in_ECX; *(undefined4 *)(in_ECX + 4) = 0; pbVar1 = path_join(param_1,(byte *)0x0,0,0); *(byte **)(in_ECX + 8) = pbVar1; return 1; } //@@ 00a25410 FUN_00a25410 undefined4 FUN_00a25410(byte *param_1) { byte *pbVar1; int in_ECX; *(undefined4 *)(in_ECX + 4) = 1; pbVar1 = path_join(param_1,(byte *)0x0,0,0); *(byte **)(in_ECX + 8) = pbVar1; return 1; } //@@ 00a25440 FUN_00a25440 bool FUN_00a25440(void) { int in_ECX; return *(int *)(in_ECX + 4) != 2; } //@@ 00a25450 FUN_00a25450 void FUN_00a25450(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 4) = 2; if (*(void **)(in_ECX + 8) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 8),0); *(undefined4 *)(in_ECX + 8) = 0; } ExceptionList = local_10; return; } //@@ 00a254c0 FUN_00a254c0 void FUN_00a254c0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Filesys::SaveDataManager::vftable; if ((void *)in_ECX[6] != (void *)0x0) { operator_delete((void *)in_ECX[6],1); in_ECX[6] = 0; } in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x20); } return; } //@@ 00a25510 FUN_00a25510 bool FUN_00a25510(char *param_1) { int iVar1; iVar1 = remove(param_1); return iVar1 != -1; } //@@ 00a25530 FUN_00a25530 undefined4 FUN_00a25530(LPCSTR param_1) { BOOL BVar1; DWORD DVar2; BVar1 = CreateDirectoryA(param_1,(LPSECURITY_ATTRIBUTES)0x0); if (BVar1 != 1) { DVar2 = GetLastError(); if (DVar2 != 0xb7) { return 0; } } return 1; } //@@ 00a25560 FUN_00a25560 bool FUN_00a25560(char *param_1) { char cVar1; LPCSTR _Dst; int iVar2; char *pcVar3; _SHFILEOPSTRUCTA local_30; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af4e20; local_10 = ExceptionList; ExceptionList = &local_10; pcVar3 = param_1; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); _Dst = tracked_alloc(0,(void *)0x0,ZEXT48(pcVar3 + (2 - (int)(param_1 + 1)))); memset(_Dst,0,(size_t)(pcVar3 + (2 - (int)(param_1 + 1)))); pcVar3 = param_1; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; pcVar3[(int)(_Dst + (-1 - (int)param_1))] = cVar1; } while (cVar1 != '\0'); local_30.hwnd = (HWND)0x0; local_30.fFlags = 0x414; local_30.pTo = (LPCSTR)0x0; local_30.fAnyOperationsAborted = 0; local_30.hNameMappings = (LPVOID)0x0; local_30.lpszProgressTitle = (LPCSTR)0x0; local_30.wFunc = 3; local_30.pFrom = _Dst; iVar2 = SHFileOperationA(&local_30); if (_Dst != (LPCSTR)0x0) { local_8 = 0; tracked_alloc(1,_Dst,0); } ExceptionList = local_10; return iVar2 == 0; } //@@ 00a25650 FUN_00a25650 int FUN_00a25650(void) { byte bVar1; byte *pbVar2; uint uVar3; byte *in_ECX; byte *pbVar4; int iVar5; byte *pbVar6; bool bVar7; iVar5 = 0; if (0 < DAT_00c74b74) { pbVar6 = (byte *)(DAT_00c74b70 + 0x80); do { pbVar2 = in_ECX; pbVar4 = pbVar6; do { bVar1 = *pbVar4; bVar7 = bVar1 < *pbVar2; if (bVar1 != *pbVar2) { LAB_00a25692: uVar3 = -(uint)bVar7 | 1; goto LAB_00a25697; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar7 = bVar1 < pbVar2[1]; if (bVar1 != pbVar2[1]) goto LAB_00a25692; pbVar4 = pbVar4 + 2; pbVar2 = pbVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00a25697: if (uVar3 == 0) { return iVar5 * 0xf5 + DAT_00c74b70; } iVar5 = iVar5 + 1; pbVar6 = pbVar6 + 0xf5; } while (iVar5 < DAT_00c74b74); } return 0; } //@@ 00a256d0 FUN_00a256d0 int FUN_00a256d0(void) { byte bVar1; int iVar2; int in_ECX; byte *pbVar3; int iVar4; bool bVar5; bool bVar6; iVar2 = FUN_00a25650(); if (iVar2 != 0) { iVar4 = 0; pbVar3 = (byte *)(iVar2 + 0xa2); do { bVar1 = pbVar3[-1]; if (bVar1 == 3) { bVar6 = SBORROW4((uint)(*pbVar3 >> 4),*(int *)(in_ECX + 0x1c)); bVar5 = (int)((uint)(*pbVar3 >> 4) - *(int *)(in_ECX + 0x1c)) < 0; LAB_00a25718: if (bVar6 == bVar5) { return 0; } } else { if (bVar1 == 2) { bVar6 = SBORROW4((uint)*pbVar3,*(int *)(in_ECX + 0x14)); bVar5 = (int)((uint)*pbVar3 - *(int *)(in_ECX + 0x14)) < 0; goto LAB_00a25718; } if (bVar1 == 1) { bVar6 = SBORROW4((uint)*pbVar3,*(int *)(in_ECX + 0xc)); bVar5 = (int)((uint)*pbVar3 - *(int *)(in_ECX + 0xc)) < 0; goto LAB_00a25718; } } iVar4 = iVar4 + 1; pbVar3 = pbVar3 + 4; } while (iVar4 < 0xf); iVar4 = 0; pbVar3 = (byte *)(iVar2 + 0xde); do { bVar1 = pbVar3[-1]; if (bVar1 == 3) { bVar6 = SBORROW4((uint)(*pbVar3 >> 4),*(int *)(in_ECX + 0x1c)); bVar5 = (int)((uint)(*pbVar3 >> 4) - *(int *)(in_ECX + 0x1c)) < 0; LAB_00a25758: if (bVar6 == bVar5) { return 0; } } else { if (bVar1 == 2) { bVar6 = SBORROW4((uint)*pbVar3,*(int *)(in_ECX + 0x14)); bVar5 = (int)((uint)*pbVar3 - *(int *)(in_ECX + 0x14)) < 0; goto LAB_00a25758; } if (bVar1 == 1) { bVar6 = SBORROW4((uint)*pbVar3,*(int *)(in_ECX + 0xc)); bVar5 = (int)((uint)*pbVar3 - *(int *)(in_ECX + 0xc)) < 0; goto LAB_00a25758; } } iVar4 = iVar4 + 1; pbVar3 = pbVar3 + 4; } while (iVar4 < 6); } return iVar2; } //@@ 00a25770 parseMapping /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 input.c parseMapping: gamepad mapping string fields a/b/x/y/dpup/leftshoulder/lefttrigger/leftx/.../"platform"; caller FUN_00a6a420 (glfwInit -> glfwUpdateGamepadMappings) */ int parseMapping(void) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; byte bVar4; char cVar5; size_t sVar6; int iVar7; ulong uVar8; ulong uVar9; void *in_ECX; char *pcVar10; char *in_EDX; char *pcVar11; int iVar12; uint uVar13; char local_c2; byte local_c1; char *local_c0; char *local_bc [3]; int local_b0; undefined1 *local_ac; int local_a8; undefined1 *local_a4; int local_a0; undefined1 *local_9c; int local_98; undefined1 *local_94; int local_90; char *local_8c; int local_88; char *local_84; int local_80; char *local_7c; int local_78; char *local_74; int local_70; char *local_6c; int local_68; char *local_64; int local_60; undefined *local_5c; int local_58; char *local_54; int local_50; char *local_4c; int local_48; char *local_44; int local_40; char *local_3c; int local_38; char *local_34; int local_30; char *local_2c; int local_28; char *local_24; int local_20; char *local_1c; int local_18; char *local_14; int local_10; char *local_8; local_8 = (char *)(__security_cookie ^ (uint)(local_bc + 0x2e)); local_b0 = (int)in_ECX + 0xa1; local_a8 = (int)in_ECX + 0xa5; local_a0 = (int)in_ECX + 0xa9; local_98 = (int)in_ECX + 0xad; local_90 = (int)in_ECX + 0xb9; local_88 = (int)in_ECX + 0xbd; local_80 = (int)in_ECX + 0xc1; local_78 = (int)in_ECX + 0xb1; local_70 = (int)in_ECX + 0xb5; local_68 = (int)in_ECX + 0xc5; local_60 = (int)in_ECX + 0xc9; local_58 = (int)in_ECX + 0xcd; local_50 = (int)in_ECX + 0xd1; local_48 = (int)in_ECX + 0xd5; local_40 = (int)in_ECX + 0xd9; local_38 = (int)in_ECX + 0xed; local_30 = (int)in_ECX + 0xf1; local_28 = (int)in_ECX + 0xdd; local_20 = (int)in_ECX + 0xe1; local_18 = (int)in_ECX + 0xe5; local_10 = (int)in_ECX + 0xe9; local_bc[0] = "platform"; local_bc[1] = (char *)0x0; local_bc[2] = "a"; local_ac = &DAT_00b69bc4; local_a4 = &DAT_00b66150; local_9c = &DAT_00b6cb44; local_94 = &DAT_00b69f1c; local_8c = "start"; local_84 = "guide"; local_7c = "leftshoulder"; local_74 = "rightshoulder"; local_6c = "leftstick"; local_64 = "rightstick"; local_5c = &DAT_00b9b3c4; local_54 = "dpright"; local_4c = "dpdown"; local_44 = "dpleft"; local_3c = "lefttrigger"; local_34 = "righttrigger"; local_2c = "leftx"; local_24 = "lefty"; local_1c = "rightx"; local_14 = "righty"; local_c0 = in_EDX; sVar6 = strcspn(in_EDX,","); if ((sVar6 == 0x20) && (local_c0[0x20] == ',')) { uVar1 = *(undefined4 *)(local_c0 + 4); uVar2 = *(undefined4 *)(local_c0 + 8); uVar3 = *(undefined4 *)(local_c0 + 0xc); *(undefined4 *)((int)in_ECX + 0x80) = *(undefined4 *)local_c0; *(undefined4 *)((int)in_ECX + 0x84) = uVar1; *(undefined4 *)((int)in_ECX + 0x88) = uVar2; *(undefined4 *)((int)in_ECX + 0x8c) = uVar3; pcVar10 = local_c0 + 0x10; uVar1 = *(undefined4 *)(local_c0 + 0x14); uVar2 = *(undefined4 *)(local_c0 + 0x18); uVar3 = *(undefined4 *)(local_c0 + 0x1c); local_c0 = local_c0 + 0x21; *(undefined4 *)((int)in_ECX + 0x90) = *(undefined4 *)pcVar10; *(undefined4 *)((int)in_ECX + 0x94) = uVar1; *(undefined4 *)((int)in_ECX + 0x98) = uVar2; *(undefined4 *)((int)in_ECX + 0x9c) = uVar3; sVar6 = strcspn(local_c0,","); pcVar10 = local_c0; if ((sVar6 < 0x80) && (local_c0[sVar6] == ',')) { memcpy(in_ECX,local_c0,sVar6); local_c0 = pcVar10 + sVar6 + 1; cVar5 = *local_c0; if (cVar5 == '\0') { LAB_00a25bb2: pcVar10 = (char *)((int)in_ECX + 0x81); iVar7 = 8; do { iVar12 = iVar7; if ((byte)(pcVar10[-1] + 0xbfU) < 6) { pcVar10[-1] = pcVar10[-1] + ' '; } if ((byte)(*pcVar10 + 0xbfU) < 6) { *pcVar10 = *pcVar10 + ' '; } if ((byte)(pcVar10[1] + 0xbfU) < 6) { pcVar10[1] = pcVar10[1] + ' '; } if ((byte)(pcVar10[2] + 0xbfU) < 6) { pcVar10[2] = pcVar10[2] + ' '; } pcVar10 = pcVar10 + 4; iVar7 = iVar12 + -1; } while (iVar7 != 0); (*DAT_00c736e4)((undefined4 *)((int)in_ECX + 0x80)); return iVar12; } do { if (cVar5 == '+') { return 0; } if (cVar5 == '-') { return 0; } uVar13 = 0; do { pcVar10 = local_bc[uVar13 * 2]; pcVar11 = pcVar10; do { cVar5 = *pcVar11; pcVar11 = pcVar11 + 1; } while (cVar5 != '\0'); sVar6 = (int)pcVar11 - (int)(pcVar10 + 1); iVar7 = strncmp(local_c0,pcVar10,sVar6); if ((iVar7 == 0) && (local_c0[sVar6] == ':')) { pcVar11 = local_bc[uVar13 * 2 + 1]; pcVar10 = local_c0 + sVar6 + 1; if (pcVar11 == (char *)0x0) { local_c0 = pcVar10; pcVar11 = (char *)(*DAT_00c736e0)(); pcVar10 = pcVar11; do { cVar5 = *pcVar10; pcVar10 = pcVar10 + 1; } while (cVar5 != '\0'); iVar7 = strncmp(local_c0,pcVar11,(int)pcVar10 - (int)(pcVar11 + 1)); if (iVar7 != 0) { return 0; } } else { local_c2 = -1; local_c1 = 1; if (*pcVar10 == '+') { local_c2 = '\0'; LAB_00a25a7a: pcVar10 = local_c0 + sVar6 + 2; } else if (*pcVar10 == '-') { local_c1 = 0; goto LAB_00a25a7a; } local_c0 = pcVar10; cVar5 = *local_c0; if (cVar5 == 'a') { cVar5 = '\x01'; LAB_00a25a90: *pcVar11 = cVar5; uVar8 = strtoul(local_c0 + 1,&local_c0,10); bVar4 = (byte)uVar8; } else { if (cVar5 == 'b') { cVar5 = '\x02'; goto LAB_00a25a90; } if (cVar5 != 'h') break; *pcVar11 = '\x03'; uVar8 = strtoul(local_c0 + 1,&local_c0,10); uVar9 = strtoul(local_c0 + 1,&local_c0,10); bVar4 = (byte)uVar9 | (char)uVar8 << 4; } pcVar11[1] = bVar4; if (*pcVar11 == '\x01') { cVar5 = (char)(2 / (longlong)(int)((uint)local_c1 - (int)local_c2)); pcVar11[2] = cVar5; pcVar11[3] = -(local_c1 + local_c2); if (*local_c0 == '~') { pcVar11[3] = local_c1 + local_c2; pcVar11[2] = -cVar5; } } } break; } uVar13 = uVar13 + 1; } while (uVar13 < 0x16); sVar6 = strcspn(local_c0,","); local_c0 = local_c0 + sVar6; sVar6 = strspn(local_c0,","); local_c0 = local_c0 + sVar6; cVar5 = *local_c0; if (cVar5 == '\0') goto LAB_00a25bb2; } while( true ); } } _glfwInputError(0x10004,0); return 0; } //@@ 00a25c50 FUN_00a25c50 void FUN_00a25c50(undefined4 param_1,int param_2,uint param_3) { int in_ECX; uint in_EDX; wchar_t *_Message; uint _Line; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x112); } if ((int)in_EDX < 0) { if (in_EDX != 0xffffffff) { _Line = 0x113; _Message = L"key >= 0 || key == GLFW_KEY_UNKNOWN"; LAB_00a25cad: _wassert(_Message, L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,_Line); } } else if (0x15c < (int)in_EDX) { _Line = 0x114; _Message = L"key <= GLFW_KEY_LAST"; goto LAB_00a25cad; } if ((param_2 != 1) && (param_2 != 0)) { _wassert(L"action == GLFW_PRESS || action == GLFW_RELEASE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x115); } if (param_3 != (param_3 & 0x3f)) { _wassert(L"mods == (mods & GLFW_MOD_MASK)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x116); } if (in_EDX < 0x15d) { if (param_2 == 0) { if (*(char *)(in_ECX + 0x7c + in_EDX) == '\0') { return; } if (*(int *)(in_ECX + 100) != 0) { *(undefined1 *)(in_EDX + 0x7c + in_ECX) = 3; goto LAB_00a25d38; } } *(char *)(in_ECX + 0x7c + in_EDX) = (char)param_2; } LAB_00a25d38: if (*(code **)(in_ECX + 0x2a4) != (code *)0x0) { (**(code **)(in_ECX + 0x2a4))(); } return; } //@@ 00a25d60 FUN_00a25d60 void FUN_00a25d60(uint param_1,int param_2) { int in_ECX; uint in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x137); } if (param_1 != (param_1 & 0x3f)) { _wassert(L"mods == (mods & GLFW_MOD_MASK)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x138); } if ((param_2 != 1) && (param_2 != 0)) { _wassert(L"plain == GLFW_TRUE || plain == GLFW_FALSE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x139); } if ((0x1f < in_EDX) && ((in_EDX < 0x7f || (0x9f < in_EDX)))) { if (*(code **)(in_ECX + 0x2ac) != (code *)0x0) { (**(code **)(in_ECX + 0x2ac))(); } if ((param_2 != 0) && (*(code **)(in_ECX + 0x2a8) != (code *)0x0)) { (**(code **)(in_ECX + 0x2a8))(); } } return; } //@@ 00a25e20 FUN_00a25e20 void FUN_00a25e20(void) { int in_ECX; double in_XMM1_Qa; double in_XMM2_Qa; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x14f); } if (in_XMM1_Qa <= -3.4028234663852886e+38) { _wassert(L"xoffset > -FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x150); } if (3.4028234663852886e+38 <= in_XMM1_Qa) { _wassert(L"xoffset < FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x151); } if (in_XMM2_Qa <= -3.4028234663852886e+38) { _wassert(L"yoffset > -FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x152); } if (3.4028234663852886e+38 <= in_XMM2_Qa) { _wassert(L"yoffset < FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x153); } if (*(code **)(in_ECX + 0x2a0) != (code *)0x0) { (**(code **)(in_ECX + 0x2a0))(); } return; } //@@ 00a25f20 FUN_00a25f20 void FUN_00a25f20(int param_1,uint param_2) { int in_ECX; undefined1 uVar1; uint in_EDX; wchar_t *_Message; uint _Line; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x15d); } if ((int)in_EDX < 0) { _Line = 0x15e; _Message = L"button >= 0"; } else { if ((int)in_EDX < 8) goto LAB_00a25f7a; _Line = 0x15f; _Message = L"button <= GLFW_MOUSE_BUTTON_LAST"; } _wassert(_Message, L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,_Line); LAB_00a25f7a: if ((param_1 != 1) && (param_1 != 0)) { _wassert(L"action == GLFW_PRESS || action == GLFW_RELEASE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x160); } if (param_2 != (param_2 & 0x3f)) { _wassert(L"mods == (mods & GLFW_MOD_MASK)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x161); } if (in_EDX < 8) { if ((param_1 != 0) || (uVar1 = 3, *(int *)(in_ECX + 0x68) == 0)) { uVar1 = (undefined1)param_1; } *(undefined1 *)(in_ECX + 0x74 + in_EDX) = uVar1; if (*(code **)(in_ECX + 0x294) != (code *)0x0) { (**(code **)(in_ECX + 0x294))(); } } return; } //@@ 00a26000 FUN_00a26000 void FUN_00a26000(void) { int in_ECX; double in_XMM1_Qa; double in_XMM2_Qa; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x177); } if (in_XMM1_Qa <= -3.4028234663852886e+38) { _wassert(L"xpos > -FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x178); } if (3.4028234663852886e+38 <= in_XMM1_Qa) { _wassert(L"xpos < FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x179); } if (in_XMM2_Qa <= -3.4028234663852886e+38) { _wassert(L"ypos > -FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x17a); } if (3.4028234663852886e+38 <= in_XMM2_Qa) { _wassert(L"ypos < FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x17b); } if ((*(double *)(in_ECX + 0x1e0) != in_XMM1_Qa) || (*(double *)(in_ECX + 0x1e8) != in_XMM2_Qa)) { *(double *)(in_ECX + 0x1e0) = in_XMM1_Qa; *(double *)(in_ECX + 0x1e8) = in_XMM2_Qa; if (*(code **)(in_ECX + 0x298) != (code *)0x0) { (**(code **)(in_ECX + 0x298))(); } } return; } //@@ 00a26130 FUN_00a26130 void FUN_00a26130(byte param_1) { int iVar1; int in_ECX; int in_EDX; uint uVar2; if (in_ECX == 0) { _wassert(L"js != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1cb); } if (in_EDX < 0) { _wassert(L"hat >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1cc); } if (*(int *)(in_ECX + 0x1c) <= in_EDX) { _wassert(L"hat < js->hatCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1cd); } if ((param_1 & 0xf0) != 0) { _wassert(L"(value & 0xf0) == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1d0); } if ((param_1 & 10) == 10) { _wassert(L"(value & GLFW_HAT_LEFT) == 0 || (value & GLFW_HAT_RIGHT) == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1d2); } if ((param_1 & 5) == 5) { _wassert(L"(value & GLFW_HAT_UP) == 0 || (value & GLFW_HAT_DOWN) == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1d3); } uVar2 = (uint)(char)param_1; iVar1 = *(int *)(in_ECX + 0x14) + in_EDX * 4; *(byte *)(iVar1 + *(int *)(in_ECX + 0x10)) = param_1 & 1; *(byte *)(iVar1 + 1 + *(int *)(in_ECX + 0x10)) = (byte)(uVar2 >> 1) & 1; *(byte *)(iVar1 + 2 + *(int *)(in_ECX + 0x10)) = (byte)(uVar2 >> 2) & 1; *(byte *)(iVar1 + 3 + *(int *)(in_ECX + 0x10)) = (byte)(uVar2 >> 3) & 1; *(byte *)(in_EDX + *(int *)(in_ECX + 0x18)) = param_1; return; } //@@ 00a26240 FUN_00a26240 undefined4 * FUN_00a26240(uint param_1,int param_2,size_t param_3) { int iVar1; int *piVar2; void *pvVar3; char *in_ECX; char *in_EDX; int iVar4; int iVar5; undefined4 uVar6; char *pcVar7; iVar4 = 0; piVar2 = &DAT_00c73d9c; while (piVar2[-0x3b] != 0) { if (*piVar2 == 0) { iVar4 = iVar4 + 1; break; } if (piVar2[0x3b] == 0) { iVar4 = iVar4 + 2; break; } if (piVar2[0x76] == 0) { iVar4 = iVar4 + 3; break; } piVar2 = piVar2 + 0xec; iVar4 = iVar4 + 4; if (0xc74b70 < (int)piVar2) { return (undefined4 *)0x0; } } if (0xf < iVar4) { return (undefined4 *)0x0; } iVar5 = iVar4 * 0xec; (&DAT_00c73cb0)[iVar4 * 0x3b] = 1; if (param_1 == 0) { LAB_00a26308: pvVar3 = (void *)0x0; } else { if (0x3fffffff < param_1) { pcVar7 = "Allocation size overflow"; uVar6 = 0x10004; LAB_00a26300: _glfwInputError(uVar6,pcVar7); goto LAB_00a26308; } pvVar3 = (void *)(*g_glfwAllocate)(param_1 * 4,g_glfwAllocatorUser); if (pvVar3 == (void *)0x0) { pcVar7 = (char *)0x0; uVar6 = 0x10005; goto LAB_00a26300; } pvVar3 = memset(pvVar3,0,param_1 * 4); } (&DAT_00c73cb8)[iVar4 * 0x3b] = pvVar3; iVar1 = param_2 + param_3 * 4; if (iVar1 == 0) { LAB_00a26351: pvVar3 = (void *)0x0; } else { pvVar3 = (void *)(*g_glfwAllocate)(iVar1,g_glfwAllocatorUser); if (pvVar3 == (void *)0x0) { _glfwInputError(0x10005,0); goto LAB_00a26351; } pvVar3 = memset(pvVar3,0,param_2 + param_3 * 4); } (&DAT_00c73cc0)[iVar4 * 0x3b] = pvVar3; if (param_3 != 0) { pvVar3 = (void *)(*g_glfwAllocate)(param_3,g_glfwAllocatorUser); if (pvVar3 != (void *)0x0) { pvVar3 = memset(pvVar3,0,param_3); goto LAB_00a2638d; } _glfwInputError(0x10005,0); } pvVar3 = (void *)0x0; LAB_00a2638d: (&DAT_00c73cc8)[iVar4 * 0x3b] = pvVar3; *(int *)(iVar5 + 0xc73cc4) = param_2; *(size_t *)(iVar5 + 0xc73ccc) = param_3; *(uint *)(iVar5 + 0xc73cbc) = param_1; strncpy((char *)(iVar5 + 0xc73cd0),in_ECX,0x7f); strncpy((char *)(iVar5 + 0xc73d54),in_EDX,0x20); uVar6 = FUN_00a256d0(); *(undefined4 *)(iVar5 + 0xc73d78) = uVar6; return &DAT_00c73cb0 + iVar4 * 0x3b; } //@@ 00a263e0 FUN_00a263e0 void FUN_00a263e0(void) { (*DAT_00c73720)(); (*DAT_00c736a4)(); return; } //@@ 00a26440 glfwSetInputMode /* DB: GLFW 3.4 input.c glfwSetInputMode with mode constant-propagated to GLFW_CURSOR: assert "window != NULL" line 0x24c, "Invalid cursor mode 0x%08X" for values outside 0x34001..0x34004, stores window+0x70 then platform getCursorPos/setCursorMode; OptionsConfig::Load passes MouseControl+0x34001 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl glfwSetInputMode(void *window,int value) { if (window == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x24c); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if ((((value != 0x34001) && (value != 0x34002)) && (value != 0x34003)) && (value != 0x34004)) { _glfwInputError(0x10003,"Invalid cursor mode 0x%08X",value); return; } if (*(int *)((int)window + 0x70) != value) { *(int *)((int)window + 0x70) = value; (*DAT_00c736a0)(window,(int)window + 0x1e0,(int)window + 0x1e8); (*DAT_00c736a8)(window,value); } return; } //@@ 00a264f0 glfwGetMouseButton /* DB: GLFW 3.4 input.c (assert "window != NULL" line 761, "Invalid mouse button %i"); ECX=window, EDX=button<8, returns state at window+0x74+button, clearing sticky state 3; Entity_Player::GetMouseAimTarget, Manager::Update */ int glfwGetMouseButton(void) { char cVar1; int in_ECX; uint in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x2f9); } if (_glfw == 0) { _glfwInputError(0x10001,0); return 0; } if (7 < in_EDX) { _glfwInputError(0x10003,"Invalid mouse button %i"); return 0; } cVar1 = *(char *)(in_ECX + 0x74 + in_EDX); if (cVar1 == '\x03') { *(undefined1 *)(in_ECX + 0x74 + in_EDX) = 0; return 1; } return (int)cVar1; } //@@ 00a26570 FUN_00a26570 void FUN_00a26570(void) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *in_ECX; if (_glfw == 0) { _glfwInputError(0x10001,0); return; } puVar1 = DAT_00c73ca0; if (in_ECX != (undefined4 *)0x0) { for (; puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)*puVar1) { if ((undefined4 *)puVar1[0x11] == in_ECX) { if (_glfw == 0) { _glfwInputError(0x10001); } else { puVar1[0x11] = 0; (*DAT_00c736c0)(puVar1,0); } } } (*DAT_00c736bc)(); puVar1 = &DAT_00c73c9c; for (puVar2 = DAT_00c73c9c; puVar2 != in_ECX; puVar2 = (undefined4 *)*puVar2) { puVar1 = puVar2; } *puVar1 = *in_ECX; (*g_glfwDeallocate)(); } return; } //@@ 00a26620 FUN_00a26620 void FUN_00a26620(void) { int in_EDX; if (in_EDX == 0) { _wassert(L"string != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x5b5); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } (*DAT_00c736cc)(); return; } //@@ 00a26670 FUN_00a26670 undefined4 FUN_00a26670(void) { undefined4 uVar1; if (_glfw == 0) { _glfwInputError(0x10001,0); return 0; } /* WARNING: Could not recover jumptable at 0x00a2668b. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (*DAT_00c736d0)(); return uVar1; } //@@ 00a266a0 FUN_00a266a0 void FUN_00a266a0(void) { LARGE_INTEGER local_c; if (_glfw == 0) { _glfwInputError(0x10001,0); return; } QueryPerformanceCounter(&local_c); FUN_00aefe20(); FUN_00aefe20(); return; } //@@ 00a26710 StringTable::constructor /* DB: thiscall: zeroes +0, builds two empty std::map heads (+4 node 0x18, +0xc node 0x28, color/isnil 0x101), zeroes counts, then StringTable::clear FUN_00a26920; sits next to StringTable::get_string/load_xml; Manager::constructor builds two of them */ void StringTable::constructor(void) { void *pvVar1; StringTable *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11ae0; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)&in_ECX->field_0x4 = 0; *(undefined4 *)&in_ECX->field_0x8 = 0; pvVar1 = operator_new(0x18); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; *(void **)&in_ECX->field_0x4 = pvVar1; local_8 = 0; (in_ECX->_categories)._head = (void *)0x0; (in_ECX->_categories)._size = 0; pvVar1 = operator_new(0x28); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; (in_ECX->_categories)._head = pvVar1; *(undefined4 *)(in_ECX + 1) = 0; clear(in_ECX); ExceptionList = local_10; return; } //@@ 00a267c0 FUN_00a267c0 void FUN_00a267c0(void) { undefined1 *this; StringTable *in_ECX; StringTable::clear(in_ECX); std::map::_Erase_tree (&in_ECX->_categories,*(undefined4 *)((int)(in_ECX->_categories)._head + 4)); operator_delete((in_ECX->_categories)._head,0x28); this = &in_ECX->field_0x4; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*(int *)&in_ECX->field_0x4 + 4)); operator_delete(*(void **)this,0x18); return; } //@@ 00a26810 StringTable::Load /* DB: REPENTOGON StringTable::Load(fileName): path_join, finds the extension, clears (00a26920), compares the extension (DAT_00b9c154) and loads (FUN_00a26f20), then sets current language from the first entry; Manager::Init prototype: REPENTOGON, confirmed by RET 4 */ byte __thiscall StringTable::Load(StringTable *this,byte *fileName) { byte bVar1; byte *ptr; byte *pbVar2; uint uVar3; byte *pbVar4; bool bVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; ptr = path_join(fileName,(byte *)0x0,0,0); if (ptr == (byte *)0x0) { ExceptionList = local_10; return 0; } pbVar4 = ptr; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); bVar1 = ptr[(int)pbVar4 - (int)(ptr + 1)]; pbVar4 = ptr + ((int)pbVar4 - (int)(ptr + 1)); while ((bVar1 != 0x2e && (pbVar4 != ptr))) { pbVar4 = pbVar4 + -1; bVar1 = *pbVar4; } pbVar4 = pbVar4 + 1; clear(this); fileName._3_1_ = 0; pbVar2 = &DAT_00b9c154; do { bVar1 = *pbVar4; bVar5 = bVar1 < *pbVar2; if (bVar1 != *pbVar2) { LAB_00a268c0: uVar3 = -(uint)bVar5 | 1; goto LAB_00a268c5; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar5 = bVar1 < pbVar2[1]; if (bVar1 != pbVar2[1]) goto LAB_00a268c0; pbVar4 = pbVar4 + 2; pbVar2 = pbVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00a268c5: if (uVar3 == 0) { fileName._3_1_ = FUN_00a26f20(ptr); } local_8 = 0; tracked_alloc(1,ptr,0); if ((fileName._3_1_ != 0) && (*(int *)&this->field_0x8 != 0)) { *(undefined4 *)this = *(undefined4 *)(**(int **)&this->field_0x4 + 0x10); } ExceptionList = local_10; return fileName._3_1_; } //@@ 00a26920 StringTable::clear /* DB: walks the category map (this+0xc), frees each tracked value buffer, then erases the tree (00a27c80); Manager::destructor, StringTable::Load prototype: db/protos.zhl */ void __thiscall StringTable::clear(StringTable *this) { undefined1 *this_00; char cVar1; int iVar2; uint uVar3; qword qVar4; int *piVar5; qword *pqVar6; int *piVar7; int *piVar8; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b11b00; local_10 = ExceptionList; ExceptionList = &local_10; piVar8 = (this->_categories)._head; piVar7 = (int *)*piVar8; if (piVar7 != piVar8) { do { iVar2 = piVar7[4]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar3; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); } piVar8 = (int *)piVar7[2]; if (*(char *)((int)piVar8 + 0xd) == '\0') { cVar1 = *(char *)(*piVar8 + 0xd); piVar7 = piVar8; piVar8 = (int *)*piVar8; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar8 + 0xd); piVar7 = piVar8; piVar8 = (int *)*piVar8; } } else { cVar1 = *(char *)(piVar7[1] + 0xd); piVar5 = (int *)piVar7[1]; piVar8 = piVar7; while ((piVar7 = piVar5, cVar1 == '\0' && (piVar8 == (int *)piVar7[2]))) { cVar1 = *(char *)(piVar7[1] + 0xd); piVar5 = (int *)piVar7[1]; piVar8 = piVar7; } } piVar8 = (this->_categories)._head; } while (piVar7 != piVar8); } std::map::_Erase_tree(&this->_categories,piVar8[1]); piVar8[1] = (int)piVar8; *piVar8 = (int)piVar8; piVar8[2] = (int)piVar8; this_00 = &this->field_0x4; (this->_categories)._size = 0; iVar2 = *(int *)this_00; *(undefined4 *)(this + 1) = 0; *(undefined4 *)this = 0; FID_conflict__Erase_tree_>_> (this_00,(fuzzer_allocator_> *)this_00, *(_Tree_node **)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)&this->field_0x8 = 0; ExceptionList = local_10; return; } //@@ 00a26a30 StringTable::translate /* DB: path_join(1) lowercases the key, splits "category/key" at '/', else uses the default category (this+0x14), then StringTable::get_string with language *this; string_table_translate */ byte * StringTable::translate(byte *param_1) { byte *category; char *pcVar1; byte *pbVar2; int language; StringTable *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; category = path_join(param_1,(byte *)0x0,1,0); pcVar1 = strchr((char *)category,0x2f); if (pcVar1 == (char *)0x0) { language = *(int *)in_ECX; pbVar2 = category; } else { *pcVar1 = '\0'; language = *(int *)in_ECX; pbVar2 = (byte *)(pcVar1 + 1); if (category != (byte *)0x0) { param_1 = (byte *)((uint)param_1 & 0xffffff); pbVar2 = get_string(in_ECX,category,language,(byte *)(pcVar1 + 1),(byte *)((int)¶m_1 + 3)) ; goto LAB_00a26ab7; } } param_1 = (byte *)((uint)param_1 & 0xffffff); pbVar2 = get_string(in_ECX,*(byte **)(in_ECX + 1),language,pbVar2,(byte *)((int)¶m_1 + 3)); if (category == (byte *)0x0) { ExceptionList = local_10; return pbVar2; } LAB_00a26ab7: local_8 = 0; tracked_alloc(1,category,0); ExceptionList = local_10; return pbVar2; } //@@ 00a26af0 StringTable::get_string /* DB: returns StringTable::InvalidCategory on miss prototype: db/protos.zhl, confirmed by RET 16 */ byte * __thiscall StringTable::get_string(StringTable *this,byte *category,int language,byte *key,byte *outIsMissing) { byte *pbVar1; int iVar2; uint uVar3; void *ptr; void *ptr_00; undefined1 local_20 [8]; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar2 = language; local_8 = 0xffffffff; puStack_c = &LAB_00b11b20; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; std::set::find_node(local_20,&language); if ((*(char *)(local_18 + 0xd) != '\0') || (iVar2 < *(int *)(local_18 + 0x10))) { local_18 = *(int *)&this->field_0x4; } if (local_18 != *(int *)&this->field_0x4) { local_14 = *(int *)(local_18 + 0x14); if ((-1 < local_14) && (local_14 <= *(int *)&this->field_0x8)) { ptr = (void *)FUN_00a62e10(uVar3); language = (int)ptr; std::map::find(&category,&language); pbVar1 = category; if (category == (this->_categories)._head) { if (ptr != (void *)0x0) { local_8 = 2; tracked_alloc(1,ptr,0); } *outIsMissing = 1; ExceptionList = local_10; return (byte *)"StringTable::InvalidCategory"; } ptr_00 = (void *)FUN_00a62e10(uVar3); language = (int)ptr_00; std::map::find(&category,&language); if (category == *(byte **)(pbVar1 + 0x14)) { if (ptr != (void *)0x0) { local_8 = 4; tracked_alloc(1,ptr,0); } if (ptr_00 != (void *)0x0) { local_8 = 5; tracked_alloc(1,ptr_00,0); } *outIsMissing = 1; ExceptionList = local_10; return (byte *)"StringTable::InvalidKey"; } pbVar1 = *(byte **)(*(int *)(category + 0x14) + local_14 * 4); if (pbVar1 != (byte *)0x0) { if (ptr != (void *)0x0) { local_8 = 8; tracked_alloc(1,ptr,0); } if (ptr_00 != (void *)0x0) { local_8 = 9; tracked_alloc(1,ptr_00,0); } *outIsMissing = 0; ExceptionList = local_10; return pbVar1; } if (ptr != (void *)0x0) { local_8 = 6; tracked_alloc(1,ptr,0); } if (ptr_00 != (void *)0x0) { local_8 = 7; tracked_alloc(1,ptr_00,0); } *outIsMissing = 1; ExceptionList = local_10; return (byte *)"StringTable::UntranslatedString"; } } *outIsMissing = 1; ExceptionList = local_10; return (byte *)"StringTable::InvalidLanguage"; } //@@ 00a26d30 StringTable::get_string_by_index /* DB: (category, language, keyIndex): returns "StringTable::InvalidCategory"/"InvalidKeyIndex"/"InvalidKey"/"UntranslatedString" or the translation; Game::ShowFortuneText picks RNG index (language g_manager+0x4a920) */ char * StringTable::get_string_by_index(int param_1,void *param_2,uint param_3) { char *pcVar1; int iVar2; uint uVar3; void *ptr; int in_ECX; undefined1 local_20 [8]; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar2 = (int)param_2; local_8 = 0xffffffff; puStack_c = &LAB_00b11b40; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; std::set::find_node(local_20,¶m_2); if ((*(char *)(local_18 + 0xd) != '\0') || (iVar2 < *(int *)(local_18 + 0x10))) { local_18 = *(int *)(in_ECX + 4); } if (local_18 != *(int *)(in_ECX + 4)) { local_14 = *(int *)(local_18 + 0x14); if ((-1 < local_14) && (local_14 <= *(int *)(in_ECX + 8))) { ptr = (void *)FUN_00a62e10(uVar3); param_2 = ptr; std::map::find(¶m_1,¶m_2); iVar2 = param_1; if (param_1 == *(int *)(in_ECX + 0xc)) { if (ptr != (void *)0x0) { local_8 = 1; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return "StringTable::InvalidCategory"; } if ((uint)(*(int *)(param_1 + 0x20) - *(int *)(param_1 + 0x1c) >> 2) <= param_3) { if (ptr != (void *)0x0) { local_8 = 2; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return "StringTable::InvalidKeyIndex"; } std::map::find(¶m_2,*(int *)(param_1 + 0x1c) + param_3 * 4); if (param_2 == *(void **)(iVar2 + 0x14)) { if (ptr != (void *)0x0) { local_8 = 3; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return "StringTable::InvalidKey"; } pcVar1 = *(char **)(*(int *)((int)param_2 + 0x14) + local_14 * 4); if (pcVar1 == (char *)0x0) { if (ptr != (void *)0x0) { local_8 = 4; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return "StringTable::UntranslatedString"; } if (ptr != (void *)0x0) { local_8 = 5; tracked_alloc(1,ptr,0); } ExceptionList = local_10; return pcVar1; } } ExceptionList = local_10; return "StringTable::InvalidLanguage"; } //@@ 00a26f20 FUN_00a26f20 /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a26f20(byte *param_1) { byte bVar1; void *pvVar2; longlong lVar3; uint uVar4; int *piVar5; int iVar6; void *pvVar7; undefined4 *puVar8; void **this; byte *pbVar9; byte *pbVar10; byte *pbVar11; int iVar12; void **this_00; char *pcVar13; char *pcVar14; bool bVar15; undefined1 auStack_100a4 [8]; int iStack_1009c; char *pcStack_10098; byte *pbStack_10094; int iStack_10090; int iStack_1008c; void *pvStack_10088; void *pvStack_10084; void *pvStack_10080; void *pvStack_1007c; void *pvStack_10078; undefined4 *puStack_10074; undefined1 *puStack_10070; byte *pbStack_1006c; undefined4 *puStack_10068; char *pcStack_10064; undefined4 *puStack_10060; byte *pbStack_1005c; undefined1 auStack_10058 [48]; undefined1 auStack_10028 [65560]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11b7b; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(auStack_10028 + 0x10024); ExceptionList = &local_10; piVar5 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); if (piVar5 != (int *)0x0) { (**(code **)(*piVar5 + 0xc))(0,0,uVar4); iVar6 = (**(code **)(*piVar5 + 4))(); pbStack_10094 = operator_new_tracked(iVar6 + 1); (**(code **)(*piVar5 + 0x14))(pbStack_10094,iVar6,1); pbStack_10094[iVar6] = 0; (**(code **)*piVar5)(1); pbVar11 = pbStack_10094; if (pbStack_10094 != (byte *)0x0) { FUN_00413b90(); local_8 = 0; iVar6 = 0xa26fe0; pbVar9 = pbVar11; rapidxml::xml_document::parse(auStack_10058,pbVar11); pbVar10 = g_xmlParseError; g_xmlParseError = (byte *)0x0; if (pbVar10 == (byte *)0x0) { pbStack_1006c = xml_node::first_node(auStack_10058,(byte *)"stringtable",iVar6,(byte)pbVar9) ; pvVar7 = xml_node::first_node(pbStack_1006c,(byte *)"languages",iVar6,(byte)pbVar9); puStack_10070 = xml_node::first_node(pvVar7,(byte *)"language",iVar6,(byte)pbVar9); pcStack_10064 = (char *)0x0; for (; puStack_10070 != (undefined1 *)0x0; puStack_10070 = *(undefined1 **)(puStack_10070 + 0x2c)) { pbVar11 = s_id; do { pbStack_1005c = pbVar11; pbVar11 = pbStack_1005c + 1; } while (*pbVar11 != 0); pbStack_1005c = pbStack_1005c + -0xb1bfef; for (puVar8 = *(undefined4 **)(puStack_10070 + 0x20); puVar8 != (undefined4 *)0x0; puVar8 = (undefined4 *)puVar8[6]) { pbVar11 = (byte *)*puVar8; if (pbVar11 == (byte *)0x0) { pbVar10 = (byte *)0x0; pbVar11 = &g_xmlNullStr; } else { pbVar10 = (byte *)puVar8[2]; } if (pbVar10 == pbStack_1005c) { pbVar10 = pbVar10 + (int)pbVar11; if (pbVar10 <= pbVar11) { LAB_00a270f0: pbVar9 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar9 = (byte *)puVar8[1]; } iVar6 = 0xa27104; iStack_10090 = atoi((char *)pbVar9); pcVar13 = pcStack_10064; if (iStack_10090 < 0x14) { pcStack_10064 = pcStack_10064 + 1; pbVar9 = (byte *)&iStack_10090; iVar6 = 0xa27136; puVar8 = (undefined4 *)FUN_00a279f0(pbVar9); *puVar8 = pcVar13; } break; } iVar12 = (int)s_id - (int)pbVar11; while (*pbVar11 == pbVar11[iVar12]) { pbVar11 = pbVar11 + 1; if (pbVar10 <= pbVar11) goto LAB_00a270f0; } } } } puStack_10068 = xml_node::first_node(pbStack_1006c,(byte *)"category",iVar6,(byte)pbVar9); if (puStack_10068 != (undefined4 *)0x0) { LAB_00a27170: pbVar11 = s_name; do { pbStack_1005c = pbVar11; pbVar11 = pbStack_1005c + 1; } while (*pbVar11 != 0); puVar8 = (undefined4 *)puStack_10068[8]; pbStack_1005c = pbStack_1005c + -0xb1c13b; if (puVar8 != (undefined4 *)0x0) { LAB_00a27192: pbVar11 = (byte *)*puVar8; if (pbVar11 == (byte *)0x0) { pbVar9 = (byte *)0x0; pbVar11 = &g_xmlNullStr; } else { pbVar9 = (byte *)puVar8[2]; } if (pbVar9 != pbStack_1005c) goto LAB_00a2737d; pbVar9 = pbVar9 + (int)pbVar11; if (pbVar11 < pbVar9) { iVar6 = (int)s_name - (int)pbVar11; while (*pbVar11 == pbVar11[iVar6]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a271e0; } goto LAB_00a2737d; } LAB_00a271e0: pbVar11 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar11 = (byte *)puVar8[1]; } pbVar9 = pbVar11 + 1; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); pbStack_1006c = operator_new_tracked((uint)(pbVar11 + (1 - (int)pbVar9))); pbVar11 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar11 = (byte *)puVar8[1]; } pbStack_1005c = pbStack_1006c; iVar6 = tolower((int)(char)*pbVar11); *pbStack_1005c = (byte)iVar6; if (*pbVar11 != 0) { iVar6 = (int)pbStack_1005c - (int)pbVar11; do { pbVar9 = pbVar11 + 1; pbVar11 = pbVar11 + 1; iVar12 = tolower((int)(char)*pbVar9); pbVar11[iVar6] = (byte)iVar12; } while (*pbVar11 != 0); } iVar6 = iStack_1008c; if (*(int *)(iStack_1008c + 0x14) == 0) { *(byte **)(iStack_1008c + 0x14) = pbStack_1006c; } pvStack_10078 = (void *)0x0; pvStack_10080 = (void *)0x0; pvStack_1007c = (void *)0x0; pvStack_10088 = (void *)0x0; pvStack_10084 = (void *)0x0; pvStack_10088 = operator_new(0x18); *(void **)pvStack_10088 = pvStack_10088; *(void **)((int)pvStack_10088 + 4) = pvStack_10088; *(void **)((int)pvStack_10088 + 8) = pvStack_10088; *(undefined2 *)((int)pvStack_10088 + 0xc) = 0x101; pvStack_10080 = (void *)0x0; pvStack_1007c = (void *)0x0; pvStack_10078 = (void *)0x0; local_8 = CONCAT31(local_8._1_3_,3); pbStack_1005c = (byte *)(iVar6 + 0xc); this = (void **)FUN_00a27960(&pbStack_1006c); pbVar11 = (byte *)(iVar6 + 0xc); if (this != &pvStack_10088) { pvVar7 = *this; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)((int)pvVar7 + 4)); *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; this[1] = (void *)0x0; pvVar7 = *this; *this = pvStack_10088; pvVar2 = this[1]; this[1] = pvStack_10084; pbVar11 = pbStack_1005c; pvStack_10088 = pvVar7; pvStack_10084 = pvVar2; } this_00 = this + 2; if (this_00 != &pvStack_10080) { FID_conflict__Tidy(this_00); *this_00 = pvStack_10080; this[3] = pvStack_1007c; this[4] = pvStack_10078; pvStack_10080 = (void *)0x0; pvStack_1007c = (void *)0x0; pvStack_10078 = (void *)0x0; } local_8 = local_8 & 0xffffff00; if (pvStack_10080 != (void *)0x0) { uVar4 = ((int)pvStack_10078 - (int)pvStack_10080 >> 2) * 4; pvVar7 = pvStack_10080; if (0xfff < uVar4) { pvVar7 = *(void **)((int)pvStack_10080 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)pvStack_10080 + (-4 - (int)pvVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar7,uVar4); pvStack_10080 = (void *)0x0; pvStack_1007c = (void *)0x0; pvStack_10078 = (void *)0x0; } FID_conflict__Erase_tree_>_> (&pvStack_10088, (fuzzer_allocator_> *)&pvStack_10088, *(_Tree_node **)((int)pvStack_10088 + 4)); operator_delete(pvStack_10088,0x18); std::map::_Find_lower_bound(auStack_100a4,&pbStack_1006c); iStack_10090 = iStack_1009c; if (*(char *)(iStack_1009c + 0xd) == '\0') { pbVar9 = *(byte **)(iStack_1009c + 0x10); pbVar10 = pbStack_1006c; do { bVar1 = *pbVar10; bVar15 = bVar1 < *pbVar9; if (bVar1 != *pbVar9) { LAB_00a27470: uVar4 = -(uint)bVar15 | 1; goto LAB_00a27475; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar15 = bVar1 < pbVar9[1]; if (bVar1 != pbVar9[1]) goto LAB_00a27470; pbVar10 = pbVar10 + 2; pbVar9 = pbVar9 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_00a27475: if ((int)uVar4 < 0) goto LAB_00a27479; } else { LAB_00a27479: iStack_10090 = *(int *)pbVar11; } pcVar13 = "key"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); puStack_10060 = (undefined4 *)puStack_10068[6]; if (puStack_10060 != (undefined4 *)0x0) { do { pbVar11 = (byte *)*puStack_10060; if (pbVar11 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar11 = &g_xmlNullStr; } else { pcVar13 = (char *)puStack_10060[2]; } if (pcVar13 == pcVar14 + -0xb80fdb) { pbVar9 = (byte *)(pcVar13 + (int)pbVar11); if (pbVar9 <= pbVar11) { LAB_00a274e0: iVar6 = iStack_1008c; pbVar11 = s_name; do { pbStack_1005c = pbVar11; pbVar11 = pbStack_1005c + 1; } while (*pbVar11 != 0); pbStack_1005c = pbStack_1005c + -0xb1c13b; puVar8 = (undefined4 *)puStack_10060[8]; if (puVar8 != (undefined4 *)0x0) { LAB_00a27508: pbVar11 = (byte *)*puVar8; if (pbVar11 == (byte *)0x0) { pbVar9 = (byte *)0x0; pbVar11 = &g_xmlNullStr; } else { pbVar9 = (byte *)puVar8[2]; } if (pbVar9 != pbStack_1005c) goto LAB_00a27645; pbVar9 = pbVar11 + (int)pbVar9; if (pbVar11 < pbVar9) { iVar12 = (int)s_name - (int)pbVar11; while (*pbVar11 == pbVar11[iVar12]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a27560; } goto LAB_00a27645; } LAB_00a27560: lVar3 = (ulonglong)*(uint *)(iStack_1008c + 8) * 4; pbStack_1005c = operator_new_tracked (-(uint)((int)((ulonglong)lVar3 >> 0x20) != 0) | (uint)lVar3); memset(pbStack_1005c,0,*(int *)(iVar6 + 8) << 2); pbVar11 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar11 = (byte *)puVar8[1]; } pbVar9 = pbVar11 + 1; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); puStack_10070 = operator_new_tracked((uint)(pbVar11 + (1 - (int)pbVar9))); pbVar11 = &g_xmlNullStr; if ((byte *)puVar8[1] != (byte *)0x0) { pbVar11 = (byte *)puVar8[1]; } pcStack_10064 = puStack_10070; iVar6 = tolower((int)(char)*pbVar11); *pcStack_10064 = (char)iVar6; if (*pbVar11 != 0) { iVar6 = (int)pcStack_10064 - (int)pbVar11; do { pbVar9 = pbVar11 + 1; pbVar11 = pbVar11 + 1; iVar12 = tolower((int)(char)*pbVar9); pbVar11[iVar6] = (byte)iVar12; } while (*pbVar11 != 0); } iVar6 = iStack_10090; puVar8 = (undefined4 *)FUN_00a27a10(&puStack_10070); *puVar8 = pbStack_1005c; piVar5 = *(int **)(iVar6 + 0x20); if (piVar5 == *(int **)(iVar6 + 0x24)) { std::vector::_Emplace_reallocate(piVar5,&puStack_10070); } else { *piVar5 = (int)puStack_10070; *(int *)(iVar6 + 0x20) = *(int *)(iVar6 + 0x20) + 4; } pcVar13 = "string"; do { pcStack_10064 = pcVar13; pcVar13 = pcStack_10064 + 1; } while (*pcVar13 != '\0'); pcStack_10064 = pcStack_10064 + -0xb6eaab; puStack_10074 = (undefined4 *)puStack_10060[6]; if (puStack_10074 != (undefined4 *)0x0) { do { pbVar11 = (byte *)*puStack_10074; if (pbVar11 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar11 = &g_xmlNullStr; } else { pcVar13 = (char *)puStack_10074[2]; } if (pcVar13 == pcStack_10064) { pbVar9 = (byte *)(pcVar13 + (int)pbVar11); if (pbVar9 <= pbVar11) { LAB_00a27710: pcStack_10064 = (char *)0x0; LAB_00a27720: if (pcStack_10064 < *(char **)(iStack_1008c + 8)) { pbVar11 = &g_xmlNullStr; if ((byte *)puStack_10074[1] != (byte *)0x0) { pbVar11 = (byte *)puStack_10074[1]; } pbVar9 = pbVar11 + 1; do { bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar1 != 0); pcVar13 = operator_new_tracked((uint)(pbVar11 + (1 - (int)pbVar9))); pbVar10 = &g_xmlNullStr; if ((byte *)puStack_10074[1] != (byte *)0x0) { pbVar10 = (byte *)puStack_10074[1]; } strncpy(pcVar13,(char *)pbVar10, (size_t)(pbVar11 + (1 - (int)pbVar9))); *(char **)(pbStack_1005c + (int)pcStack_10064 * 4) = pcVar13; pcStack_10064 = pcStack_10064 + 1; pcVar13 = "string"; do { pcStack_10098 = pcVar13; pcVar13 = pcStack_10098 + 1; } while (*pcVar13 != '\0'); pcStack_10098 = pcStack_10098 + -0xb6eaab; puStack_10074 = (undefined4 *)puStack_10074[0xb]; if (puStack_10074 != (undefined4 *)0x0) { do { pbVar11 = (byte *)*puStack_10074; if (pbVar11 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar11 = &g_xmlNullStr; } else { pcVar13 = (char *)puStack_10074[2]; } if (pcVar13 == pcStack_10098) { pbVar9 = pbVar11 + (int)pcVar13; if (pbVar9 <= pbVar11) goto LAB_00a27720; iVar6 = (int)"string" - (int)pbVar11; while (*pbVar11 == pbVar11[iVar6]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a27720; } } puStack_10074 = (undefined4 *)puStack_10074[0xb]; if (puStack_10074 == (undefined4 *)0x0) break; } while( true ); } } break; } iVar6 = (int)"string" - (int)pbVar11; while (*pbVar11 == pbVar11[iVar6]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a27710; } } puStack_10074 = (undefined4 *)puStack_10074[0xb]; } while (puStack_10074 != (undefined4 *)0x0); } } LAB_00a27656: pcVar13 = "key"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); puStack_10060 = (undefined4 *)puStack_10060[0xb]; do { if (puStack_10060 == (undefined4 *)0x0) goto LAB_00a2787e; pbVar11 = (byte *)*puStack_10060; if (pbVar11 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar11 = &g_xmlNullStr; } else { pcVar13 = (char *)puStack_10060[2]; } if (pcVar13 == pcVar14 + -0xb80fdb) { pbVar9 = pbVar11 + (int)pcVar13; if (pbVar9 <= pbVar11) goto LAB_00a274e0; iVar6 = (int)&DAT_00b80fdc - (int)pbVar11; while (*pbVar11 == pbVar11[iVar6]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a274e0; } } puStack_10060 = (undefined4 *)puStack_10060[0xb]; } while( true ); } iVar6 = (int)&DAT_00b80fdc - (int)pbVar11; while (*pbVar11 == pbVar11[iVar6]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a274e0; } } puStack_10060 = (undefined4 *)puStack_10060[0xb]; } while (puStack_10060 != (undefined4 *)0x0); puStack_10060 = (undefined4 *)0x0; } } LAB_00a2787e: pcVar13 = "category"; do { pcVar14 = pcVar13; pcVar13 = pcVar14 + 1; } while (*pcVar13 != '\0'); puStack_10068 = (undefined4 *)puStack_10068[0xb]; if (puStack_10068 != (undefined4 *)0x0) { do { pbVar11 = (byte *)*puStack_10068; if (pbVar11 == (byte *)0x0) { pcVar13 = (char *)0x0; pbVar11 = &g_xmlNullStr; } else { pcVar13 = (char *)puStack_10068[2]; } if (pcVar13 == pcVar14 + -0xb9c11b) { pbVar9 = pbVar11 + (int)pcVar13; if (pbVar9 <= pbVar11) goto LAB_00a27170; iVar6 = (int)"category" - (int)pbVar11; while (*pbVar11 == pbVar11[iVar6]) { pbVar11 = pbVar11 + 1; if (pbVar9 <= pbVar11) goto LAB_00a27170; } } puStack_10068 = (undefined4 *)puStack_10068[0xb]; if (puStack_10068 == (undefined4 *)0x0) break; } while( true ); } } local_8 = 4; xml_memory_pool::clear(auStack_10028); local_8 = 5; tracked_alloc(1,pbStack_10094,0); ExceptionList = local_10; return 1; } local_8 = CONCAT31(local_8._1_3_,1); tracked_alloc(1,pbVar11,0); local_8 = 2; xml_memory_pool::clear(auStack_10028); } } ExceptionList = local_10; return 0; LAB_00a2737d: puVar8 = (undefined4 *)puVar8[6]; if (puVar8 == (undefined4 *)0x0) goto LAB_00a2787e; goto LAB_00a27192; LAB_00a27645: puVar8 = (undefined4 *)puVar8[6]; if (puVar8 == (undefined4 *)0x0) goto LAB_00a27656; goto LAB_00a27508; } //@@ 00a27038 StringTable::load_xml /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? stringtable XML: nodes stringtable/languages/language/category/string with id/key/name attributes; no direct callers (REPENTOGON StringTable::Load(fileName) is the public entry) */ undefined4 StringTable::load_xml(void) { byte bVar1; undefined1 *puVar2; longlong lVar3; void *pvVar4; int *piVar5; int iVar6; byte *pbVar7; void *ptr; byte *pbVar8; byte *pbVar9; int iVar10; uint uVar11; char *pcVar12; byte *_Source; int unaff_EBP; undefined4 *puVar13; int *this; char *pcVar14; bool bVar15; int in_stack_fffffff8; byte *in_stack_fffffffc; pvVar4 = xml_node::first_node ((void *)(unaff_EBP + -0x10054),(byte *)"stringtable",in_stack_fffffff8, (byte)in_stack_fffffffc); *(void **)(unaff_EBP + -0x10068) = pvVar4; pvVar4 = xml_node::first_node (pvVar4,(byte *)"languages",in_stack_fffffff8,(byte)in_stack_fffffffc); pvVar4 = xml_node::first_node(pvVar4,(byte *)"language",in_stack_fffffff8,(byte)in_stack_fffffffc) ; *(undefined4 *)(unaff_EBP + -0x10060) = 0; *(void **)(unaff_EBP + -0x1006c) = pvVar4; while (pvVar4 != (void *)0x0) { pbVar8 = s_id; do { pbVar9 = pbVar8; pbVar8 = pbVar9 + 1; } while (*pbVar8 != 0); puVar13 = *(undefined4 **)((int)pvVar4 + 0x20); pbVar9 = pbVar9 + -0xb1bfef; *(byte **)(unaff_EBP + -0x10058) = pbVar9; for (; puVar13 != (undefined4 *)0x0; puVar13 = (undefined4 *)puVar13[6]) { pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pbVar7 = (byte *)0x0; pbVar8 = &g_xmlNullStr; } else { pbVar7 = (byte *)puVar13[2]; } if (pbVar7 == pbVar9) { pbVar7 = pbVar7 + (int)pbVar8; if (pbVar7 <= pbVar8) { LAB_00a270f0: in_stack_fffffffc = &g_xmlNullStr; if ((byte *)puVar13[1] != (byte *)0x0) { in_stack_fffffffc = (byte *)puVar13[1]; } in_stack_fffffff8 = 0xa27104; iVar10 = atoi((char *)in_stack_fffffffc); *(int *)(unaff_EBP + -0x1008c) = iVar10; if (iVar10 < 0x14) { iVar10 = *(int *)(unaff_EBP + -0x10060); *(int *)(unaff_EBP + -0x10060) = iVar10 + 1; in_stack_fffffffc = (byte *)(unaff_EBP + -0x1008c); in_stack_fffffff8 = 0xa27136; piVar5 = (int *)FUN_00a279f0(in_stack_fffffffc); *piVar5 = iVar10; } break; } iVar10 = (int)s_id - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar7 <= pbVar8) goto LAB_00a270f0; } pbVar9 = *(byte **)(unaff_EBP + -0x10058); } } pvVar4 = *(void **)(*(int *)(unaff_EBP + -0x1006c) + 0x2c); *(void **)(unaff_EBP + -0x1006c) = pvVar4; } pvVar4 = xml_node::first_node (*(void **)(unaff_EBP + -0x10068),(byte *)"category",in_stack_fffffff8, (byte)in_stack_fffffffc); *(void **)(unaff_EBP + -0x10064) = pvVar4; if (pvVar4 == (void *)0x0) { LAB_00a2701b: *(undefined4 *)(unaff_EBP + -4) = 4; xml_memory_pool::clear((void *)(unaff_EBP + -0x10024)); *(undefined4 *)(unaff_EBP + -4) = 5; tracked_alloc(1,*(void **)(unaff_EBP + -0x10090),0); ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } LAB_00a27170: pbVar8 = s_name; do { pbVar9 = pbVar8; pbVar8 = pbVar9 + 1; } while (*pbVar8 != 0); puVar13 = *(undefined4 **)((int)pvVar4 + 0x20); pbVar9 = pbVar9 + -0xb1c13b; *(byte **)(unaff_EBP + -0x10058) = pbVar9; if (puVar13 != (undefined4 *)0x0) { LAB_00a27192: pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pbVar7 = (byte *)0x0; pbVar8 = &g_xmlNullStr; } else { pbVar7 = (byte *)puVar13[2]; } if (pbVar7 != pbVar9) goto LAB_00a2737d; pbVar7 = pbVar7 + (int)pbVar8; if (pbVar8 < pbVar7) { iVar10 = (int)s_name - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar7 <= pbVar8) goto LAB_00a271e0; } pbVar9 = *(byte **)(unaff_EBP + -0x10058); goto LAB_00a2737d; } LAB_00a271e0: pbVar8 = &g_xmlNullStr; if ((byte *)puVar13[1] != (byte *)0x0) { pbVar8 = (byte *)puVar13[1]; } pbVar9 = pbVar8 + 1; do { bVar1 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar1 != 0); pvVar4 = operator_new_tracked((uint)(pbVar8 + (1 - (int)pbVar9))); pbVar9 = (byte *)puVar13[1]; *(void **)(unaff_EBP + -0x10068) = pvVar4; *(void **)(unaff_EBP + -0x10058) = pvVar4; pbVar8 = &g_xmlNullStr; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; } iVar10 = tolower((int)(char)*pbVar8); puVar2 = *(undefined1 **)(unaff_EBP + -0x10058); *puVar2 = (char)iVar10; if (*pbVar8 != 0) { iVar10 = (int)puVar2 - (int)pbVar8; do { pbVar9 = pbVar8 + 1; pbVar8 = pbVar8 + 1; iVar6 = tolower((int)(char)*pbVar9); pbVar8[iVar10] = (byte)iVar6; } while (*pbVar8 != 0); } iVar10 = *(int *)(unaff_EBP + -0x10088); if (*(int *)(iVar10 + 0x14) == 0) { *(undefined4 *)(iVar10 + 0x14) = *(undefined4 *)(unaff_EBP + -0x10068); } *(undefined4 *)(unaff_EBP + -0x10074) = 0; *(undefined4 *)(unaff_EBP + -0x10084) = 0; *(undefined4 *)(unaff_EBP + -0x10080) = 0; *(undefined4 *)(unaff_EBP + -0x1007c) = 0; *(undefined4 *)(unaff_EBP + -0x10078) = 0; *(undefined4 *)(unaff_EBP + -0x10084) = 0; *(undefined4 *)(unaff_EBP + -0x10080) = 0; pvVar4 = operator_new(0x18); *(void **)pvVar4 = pvVar4; *(void **)((int)pvVar4 + 4) = pvVar4; *(void **)((int)pvVar4 + 8) = pvVar4; *(undefined2 *)((int)pvVar4 + 0xc) = 0x101; *(void **)(unaff_EBP + -0x10084) = pvVar4; *(undefined4 *)(unaff_EBP + -0x1007c) = 0; *(undefined4 *)(unaff_EBP + -0x10078) = 0; *(undefined4 *)(unaff_EBP + -0x10074) = 0; puVar13 = (undefined4 *)(iVar10 + 0xc); *(undefined1 *)(unaff_EBP + -4) = 3; *(undefined4 **)(unaff_EBP + -0x10058) = puVar13; piVar5 = (int *)FUN_00a27960(unaff_EBP + -0x10068); if (piVar5 != (int *)(unaff_EBP + -0x10084)) { iVar10 = *piVar5; FID_conflict__Erase_tree_>_> (piVar5,(fuzzer_allocator_> *)piVar5, *(_Tree_node **)(iVar10 + 4)); *(int *)(iVar10 + 4) = iVar10; *(int *)iVar10 = iVar10; *(int *)(iVar10 + 8) = iVar10; puVar13 = *(undefined4 **)(unaff_EBP + -0x10058); piVar5[1] = 0; iVar10 = *piVar5; *piVar5 = *(int *)(unaff_EBP + -0x10084); *(int *)(unaff_EBP + -0x10084) = iVar10; iVar10 = piVar5[1]; piVar5[1] = *(int *)(unaff_EBP + -0x10080); *(int *)(unaff_EBP + -0x10080) = iVar10; } this = piVar5 + 2; if (this == (int *)(unaff_EBP + -0x1007c)) { iVar10 = *(int *)(unaff_EBP + -0x10074); pvVar4 = *(void **)(unaff_EBP + -0x1007c); } else { FID_conflict__Tidy(this); pvVar4 = (void *)0x0; *this = *(int *)(unaff_EBP + -0x1007c); piVar5[3] = *(int *)(unaff_EBP + -0x10078); piVar5[4] = *(int *)(unaff_EBP + -0x10074); iVar10 = 0; *(undefined4 *)(unaff_EBP + -0x1007c) = 0; *(undefined4 *)(unaff_EBP + -0x10078) = 0; *(undefined4 *)(unaff_EBP + -0x10074) = 0; } *(undefined1 *)(unaff_EBP + -4) = 0; if (pvVar4 != (void *)0x0) { uVar11 = (iVar10 - (int)pvVar4 >> 2) * 4; ptr = pvVar4; if (0xfff < uVar11) { ptr = *(void **)((int)pvVar4 + -4); uVar11 = uVar11 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar11); *(undefined4 *)(unaff_EBP + -0x1007c) = 0; *(undefined4 *)(unaff_EBP + -0x10078) = 0; *(undefined4 *)(unaff_EBP + -0x10074) = 0; } FID_conflict__Erase_tree_>_> ((void *)(unaff_EBP + -0x10084),(void *)(unaff_EBP + -0x10084), *(_Tree_node **)(*(int *)(unaff_EBP + -0x10084) + 4)); operator_delete(*(void **)(unaff_EBP + -0x10084),0x18); std::map::_Find_lower_bound(unaff_EBP + -0x100a0,unaff_EBP + -0x10068); iVar10 = *(int *)(unaff_EBP + -0x10098); *(int *)(unaff_EBP + -0x1008c) = iVar10; if (*(char *)(iVar10 + 0xd) == '\0') { pbVar8 = *(byte **)(iVar10 + 0x10); pbVar9 = *(byte **)(unaff_EBP + -0x10068); do { bVar1 = *pbVar9; bVar15 = bVar1 < *pbVar8; if (bVar1 != *pbVar8) { LAB_00a27470: uVar11 = -(uint)bVar15 | 1; goto LAB_00a27475; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; bVar15 = bVar1 < pbVar8[1]; if (bVar1 != pbVar8[1]) goto LAB_00a27470; pbVar9 = pbVar9 + 2; pbVar8 = pbVar8 + 2; } while (bVar1 != 0); uVar11 = 0; LAB_00a27475: if ((int)uVar11 < 0) goto LAB_00a27479; } else { LAB_00a27479: *(undefined4 *)(unaff_EBP + -0x1008c) = *puVar13; } pcVar14 = "key"; do { pcVar12 = pcVar14; pcVar14 = pcVar12 + 1; } while (*pcVar14 != '\0'); puVar13 = *(undefined4 **)(*(int *)(unaff_EBP + -0x10064) + 0x18); *(undefined4 **)(unaff_EBP + -0x1005c) = puVar13; while (puVar13 != (undefined4 *)0x0) { pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pcVar14 = (char *)0x0; pbVar8 = &g_xmlNullStr; } else { pcVar14 = (char *)puVar13[2]; } if (pcVar14 == pcVar12 + -0xb80fdb) { pbVar9 = (byte *)(pcVar14 + (int)pbVar8); if (pbVar9 <= pbVar8) { LAB_00a274e0: pbVar8 = s_name; do { pbVar9 = pbVar8; pbVar8 = pbVar9 + 1; } while (*pbVar8 != 0); iVar10 = *(int *)(unaff_EBP + -0x1005c); pbVar9 = pbVar9 + -0xb1c13b; *(byte **)(unaff_EBP + -0x10058) = pbVar9; puVar13 = *(undefined4 **)(iVar10 + 0x20); if (puVar13 != (undefined4 *)0x0) { LAB_00a27508: pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pbVar7 = (byte *)0x0; pbVar8 = &g_xmlNullStr; } else { pbVar7 = (byte *)puVar13[2]; } if (pbVar7 != pbVar9) goto LAB_00a27645; pbVar7 = pbVar8 + (int)pbVar7; if (pbVar8 < pbVar7) { iVar10 = (int)s_name - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar7 <= pbVar8) goto LAB_00a27560; } pbVar9 = *(byte **)(unaff_EBP + -0x10058); goto LAB_00a27645; } LAB_00a27560: iVar10 = *(int *)(unaff_EBP + -0x10088); lVar3 = (ulonglong)*(uint *)(iVar10 + 8) * 4; pvVar4 = operator_new_tracked (-(uint)((int)((ulonglong)lVar3 >> 0x20) != 0) | (uint)lVar3); iVar10 = *(int *)(iVar10 + 8); *(void **)(unaff_EBP + -0x10058) = pvVar4; memset(pvVar4,0,iVar10 << 2); pbVar8 = &g_xmlNullStr; if ((byte *)puVar13[1] != (byte *)0x0) { pbVar8 = (byte *)puVar13[1]; } pbVar9 = pbVar8 + 1; do { bVar1 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar1 != 0); pvVar4 = operator_new_tracked((uint)(pbVar8 + (1 - (int)pbVar9))); pbVar9 = (byte *)puVar13[1]; *(void **)(unaff_EBP + -0x1006c) = pvVar4; *(void **)(unaff_EBP + -0x10060) = pvVar4; pbVar8 = &g_xmlNullStr; if (pbVar9 != (byte *)0x0) { pbVar8 = pbVar9; } iVar10 = tolower((int)(char)*pbVar8); puVar2 = *(undefined1 **)(unaff_EBP + -0x10060); *puVar2 = (char)iVar10; if (*pbVar8 != 0) { iVar10 = (int)puVar2 - (int)pbVar8; do { pbVar9 = pbVar8 + 1; pbVar8 = pbVar8 + 1; iVar6 = tolower((int)(char)*pbVar9); pbVar8[iVar10] = (byte)iVar6; } while (*pbVar8 != 0); } iVar10 = *(int *)(unaff_EBP + -0x1008c); puVar13 = (undefined4 *)FUN_00a27a10(unaff_EBP + -0x1006c); *puVar13 = *(undefined4 *)(unaff_EBP + -0x10058); puVar13 = *(undefined4 **)(iVar10 + 0x20); if (puVar13 == *(undefined4 **)(iVar10 + 0x24)) { std::vector::_Emplace_reallocate(puVar13,unaff_EBP + -0x1006c); } else { *puVar13 = *(undefined4 *)(unaff_EBP + -0x1006c); *(int *)(iVar10 + 0x20) = *(int *)(iVar10 + 0x20) + 4; } pcVar14 = "string"; do { pcVar12 = pcVar14; pcVar14 = pcVar12 + 1; } while (*pcVar14 != '\0'); iVar10 = *(int *)(unaff_EBP + -0x1005c); pcVar12 = pcVar12 + -0xb6eaab; *(char **)(unaff_EBP + -0x10060) = pcVar12; puVar13 = *(undefined4 **)(iVar10 + 0x18); *(undefined4 **)(unaff_EBP + -0x10070) = puVar13; if (puVar13 != (undefined4 *)0x0) { do { pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pcVar14 = (char *)0x0; pbVar8 = &g_xmlNullStr; } else { pcVar14 = (char *)puVar13[2]; } if (pcVar14 == pcVar12) { pbVar9 = (byte *)(pcVar14 + (int)pbVar8); if (pbVar8 < pbVar9) { iVar10 = (int)"string" - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar9 <= pbVar8) goto LAB_00a27710; } pcVar12 = *(char **)(unaff_EBP + -0x10060); goto LAB_00a277d1; } LAB_00a27710: uVar11 = 0; *(undefined4 *)(unaff_EBP + -0x10060) = 0; goto LAB_00a27720; } LAB_00a277d1: puVar13 = (undefined4 *)puVar13[0xb]; *(undefined4 **)(unaff_EBP + -0x10070) = puVar13; } while (puVar13 != (undefined4 *)0x0); LAB_00a27650: iVar10 = *(int *)(unaff_EBP + -0x1005c); } } pcVar14 = "key"; do { pcVar12 = pcVar14; pcVar14 = pcVar12 + 1; } while (*pcVar14 != '\0'); puVar13 = *(undefined4 **)(iVar10 + 0x2c); *(undefined4 **)(unaff_EBP + -0x1005c) = puVar13; do { if (puVar13 == (undefined4 *)0x0) goto LAB_00a27878; pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pcVar14 = (char *)0x0; pbVar8 = &g_xmlNullStr; } else { pcVar14 = (char *)puVar13[2]; } if (pcVar14 == pcVar12 + -0xb80fdb) { pbVar9 = pbVar8 + (int)pcVar14; if (pbVar9 <= pbVar8) goto LAB_00a274e0; iVar10 = (int)&DAT_00b80fdc - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar9 <= pbVar8) goto LAB_00a274e0; } } puVar13 = *(undefined4 **)(*(int *)(unaff_EBP + -0x1005c) + 0x2c); *(undefined4 **)(unaff_EBP + -0x1005c) = puVar13; } while( true ); } iVar10 = (int)&DAT_00b80fdc - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar9 <= pbVar8) goto LAB_00a274e0; } } puVar13 = *(undefined4 **)(*(int *)(unaff_EBP + -0x1005c) + 0x2c); *(undefined4 **)(unaff_EBP + -0x1005c) = puVar13; } LAB_00a27878: pvVar4 = *(void **)(unaff_EBP + -0x10064); } pcVar14 = "category"; do { pcVar12 = pcVar14; pcVar14 = pcVar12 + 1; } while (*pcVar14 != '\0'); puVar13 = *(undefined4 **)((int)pvVar4 + 0x2c); *(undefined4 **)(unaff_EBP + -0x10064) = puVar13; if (puVar13 != (undefined4 *)0x0) { do { pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pcVar14 = (char *)0x0; pbVar8 = &g_xmlNullStr; } else { pcVar14 = (char *)puVar13[2]; } if (pcVar14 == pcVar12 + -0xb9c11b) { pbVar9 = pbVar8 + (int)pcVar14; if (pbVar9 <= pbVar8) goto LAB_00a278d0; iVar10 = (int)"category" - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar9 <= pbVar8) goto LAB_00a278d0; } } puVar13 = *(undefined4 **)(*(int *)(unaff_EBP + -0x10064) + 0x2c); *(undefined4 **)(unaff_EBP + -0x10064) = puVar13; if (puVar13 == (undefined4 *)0x0) break; } while( true ); } goto LAB_00a2701b; LAB_00a2737d: puVar13 = (undefined4 *)puVar13[6]; if (puVar13 == (undefined4 *)0x0) goto LAB_00a27878; goto LAB_00a27192; LAB_00a27645: puVar13 = (undefined4 *)puVar13[6]; if (puVar13 == (undefined4 *)0x0) goto LAB_00a27650; goto LAB_00a27508; LAB_00a27720: if (uVar11 < *(uint *)(*(int *)(unaff_EBP + -0x10088) + 8)) { pbVar8 = &g_xmlNullStr; if ((byte *)puVar13[1] != (byte *)0x0) { pbVar8 = (byte *)puVar13[1]; } pbVar9 = pbVar8 + 1; do { bVar1 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar1 != 0); pcVar14 = operator_new_tracked((uint)(pbVar8 + (1 - (int)pbVar9))); pbVar7 = *(byte **)(*(int *)(unaff_EBP + -0x10070) + 4); _Source = &g_xmlNullStr; if (pbVar7 != (byte *)0x0) { _Source = pbVar7; } strncpy(pcVar14,(char *)_Source,(size_t)(pbVar8 + (1 - (int)pbVar9))); iVar10 = *(int *)(unaff_EBP + -0x10060); *(char **)(*(int *)(unaff_EBP + -0x10058) + iVar10 * 4) = pcVar14; *(int *)(unaff_EBP + -0x10060) = iVar10 + 1; pcVar14 = "string"; do { pcVar12 = pcVar14; pcVar14 = pcVar12 + 1; } while (*pcVar14 != '\0'); pcVar12 = pcVar12 + -0xb6eaab; *(char **)(unaff_EBP + -0x10094) = pcVar12; puVar13 = *(undefined4 **)(*(int *)(unaff_EBP + -0x10070) + 0x2c); *(undefined4 **)(unaff_EBP + -0x10070) = puVar13; if (puVar13 != (undefined4 *)0x0) { do { pbVar8 = (byte *)*puVar13; if (pbVar8 == (byte *)0x0) { pcVar14 = (char *)0x0; pbVar8 = &g_xmlNullStr; } else { pcVar14 = (char *)puVar13[2]; } if (pcVar14 == pcVar12) { pbVar9 = pbVar8 + (int)pcVar14; if (pbVar9 <= pbVar8) goto LAB_00a2780c; iVar10 = (int)"string" - (int)pbVar8; while (*pbVar8 == pbVar8[iVar10]) { pbVar8 = pbVar8 + 1; if (pbVar9 <= pbVar8) goto LAB_00a2780c; } pcVar12 = *(char **)(unaff_EBP + -0x10094); } puVar13 = (undefined4 *)puVar13[0xb]; *(undefined4 **)(unaff_EBP + -0x10070) = puVar13; if (puVar13 == (undefined4 *)0x0) break; } while( true ); } } goto LAB_00a27650; LAB_00a2780c: uVar11 = *(uint *)(unaff_EBP + -0x10060); goto LAB_00a27720; LAB_00a278d0: pvVar4 = *(void **)(unaff_EBP + -0x10064); goto LAB_00a27170; } //@@ 00a27930 FUN_00a27930 void FUN_00a27930(void) { int *in_ECX; FID_conflict__Tidy(in_ECX + 2); FID_conflict__Erase_tree_>_> (in_ECX,(fuzzer_allocator_> *)in_ECX, *(_Tree_node **)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x18); return; } //@@ 00a27960 FUN_00a27960 int FUN_00a27960(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x14; } //@@ 00a27980 std::map::find /* DB: lower_bound (FUN_00a280b0) then byte-wise strcmp of the key at node+0x10; returns the node or end (*ECX); StringTable::get_string, Game::ShowFortuneText */ void std::map::find(int *param_1,undefined4 *param_2) { byte bVar1; byte *pbVar2; uint uVar3; int *in_ECX; byte *pbVar4; bool bVar5; undefined1 local_10 [8]; int local_8; _Find_lower_bound(local_10,param_2); if (*(char *)(local_8 + 0xd) == '\0') { pbVar4 = *(byte **)(local_8 + 0x10); pbVar2 = (byte *)*param_2; do { bVar1 = *pbVar2; bVar5 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_00a279c6: uVar3 = -(uint)bVar5 | 1; goto LAB_00a279cb; } if (bVar1 == 0) break; bVar1 = pbVar2[1]; bVar5 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_00a279c6; pbVar2 = pbVar2 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00a279cb: if (-1 < (int)uVar3) { *param_1 = local_8; return; } } *param_1 = *in_ECX; return; } //@@ 00a279f0 FUN_00a279f0 int FUN_00a279f0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_00a27cf0(local_10,param_1); return *piVar1 + 0x14; } //@@ 00a27a10 FUN_00a27a10 int FUN_00a27a10(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_00a27ec0(local_10,param_1); return *piVar1 + 0x14; } //@@ 00a27a30 std::map::try_emplace /* DB: std::map: _Find_lower_bound (00a280b0) + inline strcmp, on miss allocates the node (operator_new) and inserts/rebalances (FUN_00415f80/00415fe0, max-size check 004170d0); returns pair in param_1; only caller 00a27960 = operator[] (returns node+0x14), used by StringTable::load_xml */ void std::map::try_emplace(int *param_1,int *param_2) { byte bVar1; int iVar2; int *piVar3; uint uVar4; byte *pbVar5; uint uVar6; int *piVar7; void *pvVar8; int *in_ECX; byte *pbVar9; int *piVar10; bool bVar11; int *local_3c; int local_38; int local_34; int *local_2c; int *local_28; int *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b11bc5; local_1c = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; local_24 = in_ECX; _Find_lower_bound(&local_3c,param_2); if (*(char *)(local_34 + 0xd) == '\0') { pbVar5 = *(byte **)(local_34 + 0x10); pbVar9 = (byte *)*param_2; do { bVar1 = *pbVar9; bVar11 = bVar1 < *pbVar5; if (bVar1 != *pbVar5) { LAB_00a27ab0: uVar6 = -(uint)bVar11 | 1; goto LAB_00a27ab5; } if (bVar1 == 0) break; bVar1 = pbVar9[1]; bVar11 = bVar1 < pbVar5[1]; if (bVar1 != pbVar5[1]) goto LAB_00a27ab0; pbVar9 = pbVar9 + 2; pbVar5 = pbVar5 + 2; } while (bVar1 != 0); uVar6 = 0; LAB_00a27ab5: if (-1 < (int)uVar6) { *param_1 = local_34; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_1c; return; } } if (in_ECX[1] == 0x6666666) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } iVar2 = *in_ECX; local_14 = 0; local_2c = (int *)0x0; piVar7 = operator_new(0x28); piVar3 = piVar7 + 5; local_14 = 1; piVar7[4] = *param_2; *piVar3 = 0; piVar7[6] = 0; piVar7[7] = 0; piVar7[8] = 0; piVar7[9] = 0; *piVar3 = 0; piVar7[6] = 0; local_2c = piVar7; local_28 = piVar3; pvVar8 = operator_new(0x18); *(void **)pvVar8 = pvVar8; *(void **)((int)pvVar8 + 4) = pvVar8; *(void **)((int)pvVar8 + 8) = pvVar8; *(undefined2 *)((int)pvVar8 + 0xc) = 0x101; *piVar3 = (int)pvVar8; piVar7[7] = 0; piVar7[8] = 0; piVar7[9] = 0; *local_2c = iVar2; local_2c[1] = iVar2; local_2c[2] = iVar2; *(undefined2 *)(local_2c + 3) = 0; piVar3 = (int *)*local_24; local_24[1] = local_24[1] + 1; local_2c[1] = (int)local_3c; if (local_3c == piVar3) { *piVar3 = (int)local_2c; piVar3[1] = (int)local_2c; piVar3[2] = (int)local_2c; *(undefined1 *)(local_2c + 3) = 1; } else { if (local_38 == 0) { local_3c[2] = (int)local_2c; if (local_3c == (int *)piVar3[2]) { piVar3[2] = (int)local_2c; } } else { *local_3c = (int)local_2c; if (local_3c == (int *)*piVar3) { *piVar3 = (int)local_2c; } } piVar7 = local_2c; local_24 = piVar3; if (*(char *)(local_2c[1] + 0xc) == '\0') { do { piVar3 = (int *)piVar7[1]; piVar10 = *(int **)piVar3[1]; if (piVar3 == piVar10) { piVar10 = (int *)((undefined4 *)piVar3[1])[2]; if ((char)piVar10[3] == '\0') goto LAB_00a27bf6; if (piVar7 == (int *)piVar3[2]) { FUN_00415fe0(piVar3); piVar7 = piVar3; } *(undefined1 *)(piVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar7[1] + 4)); } else if ((char)piVar10[3] == '\0') { LAB_00a27bf6: *(undefined1 *)(piVar3 + 3) = 1; *(undefined1 *)(piVar10 + 3) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; piVar7 = *(int **)(piVar7[1] + 4); } else { if (piVar7 == (int *)*piVar3) { FUN_00415f80(piVar3); piVar7 = piVar3; } *(undefined1 *)(piVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar7[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar7[1] + 4)); } } while (*(char *)(piVar7[1] + 0xc) == '\0'); } *(undefined1 *)(local_24[1] + 0xc) = 1; } *param_1 = (int)local_2c; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_1c; return; } //@@ 00a27c80 std::map::_Erase_tree /* DB: recursive _Erase of 0x28-byte nodes whose value holds a key map (+0x14, _Erase_tree + 0x18 head) and a vector (+0x1c); Manager::destructor via StringTable::clear */ void std::map::_Erase_tree(undefined4 param_1,int *param_2) { int *this; char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { _Erase_tree(param_1,param_2[2]); piVar2 = (int *)*param_2; this = param_2 + 5; FID_conflict__Tidy(param_2 + 7); FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); operator_delete(param_2,0x28); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00a27cf0 FUN_00a27cf0 void FUN_00a27cf0(int *param_1,int *param_2) { char cVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; std::set::find_node(&local_24,param_2); if ((*(char *)(local_1c + 0xd) == '\0') && (*(int *)(local_1c + 0x10) <= *param_2)) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar5); } iVar2 = *in_ECX; local_8 = 0; local_14 = 0; piVar6 = operator_new(0x18); piVar6[4] = *param_2; piVar6[5] = 0; *piVar6 = iVar2; piVar6[1] = iVar2; piVar6[2] = iVar2; *(undefined2 *)(piVar6 + 3) = 0; piVar3 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar6[1] = (int)local_24; if (local_24 == piVar3) { *piVar3 = (int)piVar6; piVar3[1] = (int)piVar6; piVar3[2] = (int)piVar6; *(undefined1 *)(piVar6 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar6; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)piVar6; } } else { *local_24 = (int)piVar6; if (local_24 == (int *)*piVar3) { *piVar3 = (int)piVar6; } } cVar1 = *(char *)(piVar6[1] + 0xc); piVar8 = piVar6; while (cVar1 == '\0') { piVar4 = (int *)piVar8[1]; piVar7 = *(int **)piVar4[1]; if (piVar4 == piVar7) { piVar7 = (int *)((undefined4 *)piVar4[1])[2]; if ((char)piVar7[3] == '\0') { LAB_00a27e3a: *(undefined1 *)(piVar4 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar4[2]) { FUN_00415fe0(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_00a27e3a; if (piVar8 == (int *)*piVar4) { FUN_00415f80(piVar4); piVar8 = piVar4; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)piVar6; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a27ec0 FUN_00a27ec0 void FUN_00a27ec0(int *param_1,int *param_2) { byte bVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; byte *pbVar7; uint uVar8; int *piVar9; int *in_ECX; byte *pbVar10; int *piVar11; int *piVar12; bool bVar13; int *local_24; int local_20; int local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1cad; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; std::map::_Find_lower_bound(&local_24,param_2); if (*(char *)(local_1c + 0xd) == '\0') { pbVar7 = *(byte **)(local_1c + 0x10); pbVar10 = (byte *)*param_2; do { bVar1 = *pbVar10; bVar13 = bVar1 < *pbVar7; if (bVar1 != *pbVar7) { LAB_00a27f25: uVar8 = -(uint)bVar13 | 1; goto LAB_00a27f2a; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar13 = bVar1 < pbVar7[1]; if (bVar1 != pbVar7[1]) goto LAB_00a27f25; pbVar10 = pbVar10 + 2; pbVar7 = pbVar7 + 2; } while (bVar1 != 0); uVar8 = 0; LAB_00a27f2a: if (-1 < (int)uVar8) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (in_ECX[1] == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = 0; piVar9 = operator_new(0x18); piVar9[4] = *param_2; piVar9[5] = 0; *piVar9 = iVar3; piVar9[1] = iVar3; piVar9[2] = iVar3; *(undefined2 *)(piVar9 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar9[1] = (int)local_24; if (local_24 == piVar4) { *piVar4 = (int)piVar9; piVar4[1] = (int)piVar9; piVar4[2] = (int)piVar9; *(undefined1 *)(piVar9 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)piVar9; if (local_24 == (int *)piVar4[2]) { piVar4[2] = (int)piVar9; } } else { *local_24 = (int)piVar9; if (local_24 == (int *)*piVar4) { *piVar4 = (int)piVar9; } } cVar2 = *(char *)(piVar9[1] + 0xc); piVar12 = piVar9; while (cVar2 == '\0') { piVar5 = (int *)piVar12[1]; piVar11 = *(int **)piVar5[1]; if (piVar5 == piVar11) { piVar11 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar11[3] == '\0') { LAB_00a2802b: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar11 + 3) = 1; *(undefined1 *)(*(int *)(piVar12[1] + 4) + 0xc) = 0; piVar12 = *(int **)(piVar12[1] + 4); } else { if (piVar12 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar12 = piVar5; } *(undefined1 *)(piVar12[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar12[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar12[1] + 4)); } } else { if ((char)piVar11[3] == '\0') goto LAB_00a2802b; if (piVar12 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar12 = piVar5; } *(undefined1 *)(piVar12[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar12[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar12[1] + 4)); } cVar2 = *(char *)(piVar12[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar9; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a280b0 std::map::_Find_lower_bound /* DB: strcmp-keyed tree walk returning {node, isLeft, bound}; StringTable::load_xml, std::map::find */ int * std::map::_Find_lower_bound(int *param_1,undefined4 *param_2) { char cVar1; byte bVar2; int iVar3; byte *pbVar4; byte *pbVar5; uint uVar6; int *in_ECX; byte *pbVar7; undefined4 *puVar8; bool bVar9; iVar3 = *in_ECX; puVar8 = *(undefined4 **)(iVar3 + 4); *param_1 = (int)puVar8; cVar1 = *(char *)((int)puVar8 + 0xd); param_1[1] = 0; param_1[2] = iVar3; if (cVar1 == '\0') { pbVar4 = (byte *)*param_2; do { pbVar7 = (byte *)puVar8[4]; *param_1 = (int)puVar8; pbVar5 = pbVar4; do { bVar2 = *pbVar7; bVar9 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_00a28100: uVar6 = -(uint)bVar9 | 1; goto LAB_00a28105; } if (bVar2 == 0) break; bVar2 = pbVar7[1]; bVar9 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_00a28100; pbVar7 = pbVar7 + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar6 = 0; LAB_00a28105: if (-1 < (int)uVar6) { param_1[2] = (int)puVar8; puVar8 = (undefined4 *)*puVar8; } else { puVar8 = (undefined4 *)puVar8[2]; } param_1[1] = (uint)(-1 < (int)uVar6); } while (*(char *)((int)puVar8 + 0xd) == '\0'); } return param_1; } //@@ 00a28130 std::_Facet_base::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::_Facet_base::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::_Facet_base::_scalar_deleting_destructor_(_Facet_base *this,uint param_1) { *(undefined ***)this = KAGE::Filesys::StreamBase::vftable; if ((param_1 & 1) != 0) { operator_delete(this,4); } return this; } //@@ 00a28160 FUN_00a28160 void FUN_00a28160(void) { undefined4 *in_ECX; *in_ECX = KAGE::Filesys::StreamBase::vftable; return; } //@@ 00a28170 FUN_00a28170 bool FUN_00a28170(void) { uint uVar1; uint uVar2; int *in_ECX; uVar1 = (**(code **)(*in_ECX + 8))(); uVar2 = (**(code **)(*in_ECX + 4))(); return uVar2 <= uVar1; } //@@ 00a28190 FUN_00a28190 uint FUN_00a28190(int param_1,int param_2) { char *pcVar1; int iVar2; uint uVar3; int *in_ECX; uint uVar4; iVar2 = (**(code **)(*in_ECX + 8))(); uVar3 = (**(code **)(*in_ECX + 0x14))(&DAT_00c94a90,1,0x1000); uVar4 = 0; if (uVar3 != 0) { while (uVar4 < param_2 - 1U) { *(undefined1 *)(uVar4 + param_1) = (&DAT_00c94a90)[uVar4]; pcVar1 = &DAT_00c94a90 + uVar4; if (((*pcVar1 == '\0') || (uVar4 = uVar4 + 1, *pcVar1 == '\n')) || (uVar3 <= uVar4)) break; } } *(undefined1 *)(uVar4 + param_1) = 0; if (uVar4 + iVar2 <= iVar2 + uVar3) { uVar3 = uVar4; } (**(code **)(*in_ECX + 0xc))(uVar3 + iVar2,0); return uVar4; } //@@ 00a28210 FUN_00a28210 uint FUN_00a28210(void) { int *in_ECX; undefined4 uStack_8; uStack_8 = (uint)in_ECX & 0xffffff; (**(code **)(*in_ECX + 0x14))((int)&uStack_8 + 3,1,1); return uStack_8 >> 0x18; } //@@ 00a28230 FUN_00a28230 void FUN_00a28230(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if ((int *)in_ECX[2] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[2] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 1); } } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } ExceptionList = local_10; return; } //@@ 00a282c0 KAGE::Network::Multiplayer::ConstLobby::ConstLobby /* DB: ctor from a 64-bit lobby id: ConstLobby vftable, default SmartPointer, then assigns the impl found by FUN_00a71f00(id); 22 callers (netplay_lobby_handle_join_message passes &id) */ void KAGE::Network::Multiplayer::ConstLobby::ConstLobby(void) { char cVar1; uint uVar2; void *value; undefined4 *in_ECX; undefined1 local_20 [4]; int *local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11c08; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; *in_ECX = vftable; SmartPointer::SmartPointer(in_ECX); local_8 = 0; value = (void *)FUN_00a71f00(uVar2); local_8._0_1_ = 1; std::shared_ptr::assign(in_ECX + 1,value); local_8 = CONCAT31(local_8._1_3_,2); if (local_1c != (int *)0x0) { cVar1 = (**(code **)(*local_1c + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_20); } } ExceptionList = local_10; return; } //@@ 00a28360 KAGE::Network::Multiplayer::ConstLobby::ConstLobby /* DB: ? sets ConstLobby::vftable, swaps in the shared_ptr returned by FUN_00a28840(¶m_1) and releases the by-value shared_ptr param_2; netplay_lobby_host_handle_message, ModManager::RenderCustomCharacterMenu prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall KAGE::Network::Multiplayer::ConstLobby::ConstLobby(void *this,void *lobbyPtr,void *lobbyCtrl) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined1 local_1c [4]; int *local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11c48; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; *(undefined ***)this = vftable; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; local_8 = 1; local_14 = this; puVar4 = (undefined4 *)FUN_00a28840(&lobbyPtr); uVar1 = puVar4[1]; puVar4[1] = *(undefined4 *)((int)this + 8); *(undefined4 *)((int)this + 8) = uVar1; uVar1 = *puVar4; *puVar4 = *(undefined4 *)((int)this + 4); *(undefined4 *)((int)this + 4) = uVar1; local_8 = CONCAT31(local_8._1_3_,2); if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_1c); } } local_8 = 3; if (lobbyCtrl != (void *)0x0) { cVar2 = (**(code **)(*(int *)lobbyCtrl + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&lobbyPtr); } } ExceptionList = local_10; return this; } //@@ 00a28440 KAGE::Network::Multiplayer::ConstLobby::ConstLobby /* DB: copy ctor: ConstLobby vftable, zero, shared_ptr assign from param+4; Menu_OnlineLobbyList::Update */ void KAGE::Network::Multiplayer::ConstLobby::ConstLobby(int param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11c80; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = vftable; in_ECX[1] = 0; in_ECX[2] = 0; local_8 = 0; std::shared_ptr::assign(in_ECX + 1,(void *)(param_1 + 4)); ExceptionList = local_10; return; } //@@ 00a284b0 FUN_00a284b0 uint FUN_00a284b0(void) { int *piVar1; int iVar2; int iVar3; uint in_EAX; uint uVar4; int in_ECX; piVar1 = *(int **)(in_ECX + 4); if (piVar1 == (int *)0x0) { return in_EAX & 0xffffff00; } iVar2 = piVar1[5]; iVar3 = piVar1[4]; uVar4 = (**(code **)(*piVar1 + 0x1c))(); return (uint)(uVar4 <= (uint)(iVar2 - iVar3 >> 3)); } //@@ 00a284d0 KAGE::Network::Multiplayer::Lobby::get_member /* DB: ? (out UserProfile, index): "Invalid lobby user index" vs impl (this+4) member array +0x10..+0x14, UserProfile::find_or_create, load_steam_avatar; sibling of Lobby::get_members 00a285f0; lobby_get_member_info, NetplayManager::send_message */ undefined4 * KAGE::Network::Multiplayer::Lobby::get_member(undefined4 *param_1,uint param_2) { int extraout_EAX; int in_ECX; int iVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11cad; local_10 = ExceptionList; iVar1 = *(int *)(in_ECX + 4); if (iVar1 == 0) { param_1[1] = 0; *param_1 = System::UserProfile::vftable; return param_1; } ExceptionList = &local_10; if ((uint)(*(int *)(iVar1 + 0x14) - *(int *)(iVar1 + 0x10) >> 3) <= param_2) { KAGE_LogMessage(0x10,(byte *)"Invalid lobby user index"); iVar1 = *(int *)(in_ECX + 4); } iVar1 = *(int *)(iVar1 + 0x10); *param_1 = System::UserProfileBase::vftable; UserProfile::find_or_create((void *)(iVar1 + param_2 * 8)); param_1[1] = extraout_EAX; local_8 = 0; *param_1 = System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { System::UserProfile::load_steam_avatar(param_1); } ExceptionList = local_10; return param_1; } //@@ 00a28590 FUN_00a28590 uint FUN_00a28590(void) { int iVar1; int iVar2; int in_ECX; uint uVar3; undefined8 uVar4; iVar1 = *(int *)(in_ECX + 4); if (iVar1 != 0) { uVar3 = 0; iVar2 = *(int *)(iVar1 + 0x10); if (*(int *)(iVar1 + 0x14) - iVar2 >> 3 != 0) { do { uVar4 = FUN_00a23920(); if ((*(int *)(iVar2 + uVar3 * 8) == (int)uVar4) && (*(int *)(iVar2 + 4 + uVar3 * 8) == (int)((ulonglong)uVar4 >> 0x20))) { return uVar3; } uVar3 = uVar3 + 1; } while (uVar3 < (uint)(*(int *)(iVar1 + 0x14) - iVar2 >> 3)); } } return 0xffffffff; } //@@ 00a285f0 KAGE::Network::Multiplayer::Lobby::get_members /* DB: ? walks the lobby impl (this+4) member array +0x10..+0x14, wraps each as KAGE::System::UserProfile and appends to vector param_1, skipping the local user (UserProfile::is_local_user) unless param_2; Menu_OnlineLobby::init_lobby_view, online_chat_update prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall KAGE::Network::Multiplayer::Lobby::get_members(void *this,void *outMembers,byte isIncludeLocalUser) { int iVar1; undefined4 *puVar2; byte bVar3; int extraout_EAX; void *this_00; undefined **local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b09575; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *(int *)((int)this + 4); if ((iVar1 != 0) && (this_00 = *(void **)(iVar1 + 0x10), this_00 != *(void **)(iVar1 + 0x14))) { do { local_8 = 0xffffffff; local_18 = System::UserProfileBase::vftable; UserProfile::find_or_create(this_00); local_8 = 0; local_18 = System::UserProfile::vftable; local_14 = extraout_EAX; if ((extraout_EAX != 0) && ((*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0 && (*(int *)(extraout_EAX + 0x14) == 0)))) { System::UserProfile::load_steam_avatar(&local_18); } local_8 = 1; if ((isIncludeLocalUser != 0) || (bVar3 = System::UserProfile::is_local_user(&local_18), bVar3 == 0)) { puVar2 = *(undefined4 **)((int)outMembers + 4); if (puVar2 == *(undefined4 **)((int)outMembers + 8)) { std::vector::_Emplace_reallocate(puVar2,&local_18); } else { *puVar2 = System::UserProfileBase::vftable; puVar2[1] = local_14; *puVar2 = System::UserProfile::vftable; *(int *)((int)outMembers + 4) = *(int *)((int)outMembers + 4) + 8; } } this_00 = (void *)((int)this_00 + 8); } while (this_00 != *(void **)(*(int *)((int)this + 4) + 0x14)); } ExceptionList = local_10; return; } //@@ 00a286f0 FUN_00a286f0 void FUN_00a286f0(undefined4 *param_1) { undefined1 *puVar1; int in_ECX; undefined1 local_10 [4]; undefined4 local_c; if (*(int **)(in_ECX + 4) == (int *)0x0) { local_c = 0; puVar1 = local_10; } else { puVar1 = (undefined1 *)(**(code **)(**(int **)(in_ECX + 4) + 0x20))(local_10); } param_1[1] = *(undefined4 *)(puVar1 + 4); *param_1 = KAGE::System::UserProfile::vftable; return; } //@@ 00a28730 FUN_00a28730 void FUN_00a28730(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00a28790 KAGE::SmartPointer::SmartPointer /* DB: default ctor: zeroes ECX, wraps a null pointer in a new ReferenceCount (0x18), releases any old refcount; SaveSlotManager::constructor, MenuManager::constructor */ void KAGE::SmartPointer::SmartPointer(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } in_ECX[1] = this; *in_ECX = 0; ExceptionList = local_10; return; } //@@ 00a28840 FUN_00a28840 void FUN_00a28840(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 00a288a0 std::shared_ptr::assign /* DB: ? swap two dwords then release old via vfunc 0xc prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall std::shared_ptr::assign(void *this,void *value) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_00a28840(value); uVar1 = puVar4[1]; puVar4[1] = *(undefined4 *)((int)this + 4); *(undefined4 *)((int)this + 4) = uVar1; uVar1 = *puVar4; *puVar4 = *(undefined4 *)this; *(undefined4 *)this = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_1c); } } ExceptionList = local_10; return this; } //@@ 00a28930 FUN_00a28930 void FUN_00a28930(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 00a289d0 KAGE::Network::MultiplayerManager::dynamic_initializer /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? static initializer called from CRT init stub 0x4068c0: sets MultiplayerManagerBase vftable at 0xc79a50, g_multiplayerService=0, builds a ConstLobby/Lobby (SmartPointer) at 0xc79a70 */ undefined * KAGE::Network::MultiplayerManager::dynamic_initializer(void) { uint uVar1; undefined4 in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11d65; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; _DAT_00c79a54 = 0; local_8 = 0; _DAT_00c79a50 = MultiplayerManagerBase::vftable; g_multiplayerService = (void *)0x0; DAT_00c79a60 = 0; _DAT_00c79a64 = 0; _DAT_00c79a68 = 0; _DAT_00c79a70 = Multiplayer::ConstLobby::vftable; SmartPointer::SmartPointer(in_ECX); _DAT_00c79a70 = Multiplayer::Lobby::vftable; local_8._0_1_ = 1; g_multiplayerCommandThreadFlags._0_1_ = 0; FUN_00a28c20(uVar1); DAT_00c79aac = 0; DAT_00c79aa8 = Thread::vftable; _DAT_00c79ab0 = 0; local_8._0_1_ = 3; _DAT_00c79ab4 = (void *)0x0; _DAT_00c79ab8 = 0; _DAT_00c79ab4 = operator_new(0x10); *(void **)_DAT_00c79ab4 = _DAT_00c79ab4; *(void **)((int)_DAT_00c79ab4 + 4) = _DAT_00c79ab4; local_8._0_1_ = 4; FUN_00a28c20(); local_8._0_1_ = 5; _DAT_00c79ae4 = Multiplayer::ConstLobby::vftable; SmartPointer::SmartPointer(extraout_ECX); _DAT_00c79ae4 = Multiplayer::Lobby::vftable; _DAT_00c79af0 = 0; uRam00c79af4 = 0; uRam00c79af8 = 0; uRam00c79afc = 0; _DAT_00c79b00 = 0; DAT_00c79b08 = 0; DAT_00c79b0c = 0; _DAT_00c79b10 = 0; DAT_00c79b14 = 0; DAT_00c79b18 = 0; uRam00c79b1c = 0; _DAT_00c79b20 = 0; DAT_00c79b24 = 0; uRam00c79b28 = 0; uRam00c79b2c = 0; _DAT_00c79b30 = 0; _DAT_00c79b34 = 0; local_8._0_1_ = 8; FUN_00a28c20(); local_8._0_1_ = 9; DAT_00c79b60 = (void *)0x0; _DAT_00c79b64 = 0; DAT_00c79b60 = operator_new(0x10); *(void **)DAT_00c79b60 = DAT_00c79b60; *(void **)((int)DAT_00c79b60 + 4) = DAT_00c79b60; local_8._0_1_ = 10; _DAT_00c79b68 = (void *)0x0; _DAT_00c79b6c = 0; _DAT_00c79b68 = operator_new(0x10); *(void **)_DAT_00c79b68 = _DAT_00c79b68; *(void **)((int)_DAT_00c79b68 + 4) = _DAT_00c79b68; local_8 = CONCAT31(local_8._1_3_,0xb); _DAT_00c79b70 = (void *)0x0; _DAT_00c79b74 = 0; _DAT_00c79b70 = operator_new(0x10); *(void **)_DAT_00c79b70 = _DAT_00c79b70; *(void **)((int)_DAT_00c79b70 + 4) = _DAT_00c79b70; ExceptionList = local_10; return &DAT_00c79a50; } //@@ 00a28bf0 FUN_00a28bf0 void FUN_00a28bf0(byte param_1) { void *in_ECX; FUN_00a28d60(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x128); } return; } //@@ 00a28c20 FUN_00a28c20 void FUN_00a28c20(void) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *in_ECX; puVar1 = in_ECX + 2; *in_ECX = KAGE::ThreadSafeQueue::vftable; *(undefined1 *)(in_ECX + 1) = 0; *puVar1 = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; puVar2 = operator_new(8); puVar2[1] = 0; *puVar1 = puVar2; *puVar2 = puVar1; *(undefined1 *)(in_ECX + 8) = 0; in_ECX[7] = KAGE::Mutex::vftable; in_ECX[9] = 0; *in_ECX = KAGE::CommandQueue::vftable; return; } //@@ 00a28ca0 KAGE::ThreadSafeQueue::~ThreadSafeQueue /* DB: sets ThreadSafeQueue::vftable, clears the queue, destroys the KAGE::Mutex member at +0x1c (DeleteCriticalSection, MutexBase::vftable) */ void KAGE::ThreadSafeQueue::~ThreadSafeQueue(void) { LPCRITICAL_SECTION lpCriticalSection; uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = ThreadSafeQueue::vftable; shutdown(uVar1); lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[9]; in_ECX[7] = Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[9] = 0; } *(byte *)(in_ECX + 8) = *(byte *)(in_ECX + 8) & 0xfe; in_ECX[7] = MutexBase::vftable; FUN_00a2a7e0(); ExceptionList = local_10; return; } //@@ 00a28d30 FUN_00a28d30 void FUN_00a28d30(byte param_1) { void *in_ECX; KAGE::ThreadSafeQueue::~ThreadSafeQueue(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x28); } return; } //@@ 00a28d60 FUN_00a28d60 void FUN_00a28d60(void) { undefined4 *in_ECX; *in_ECX = KAGE::Network::MultiplayerManagerBase::vftable; FUN_00a1a500(); operator_delete((void *)in_ECX[0x48],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0x46],0x10); FUN_00a1a500(); operator_delete((void *)in_ECX[0x44],0x10); KAGE::ThreadSafeQueue::~ThreadSafeQueue(); FUN_00a539f0(); FID_conflict__Tidy(in_ECX + 0x37); FID_conflict__Tidy(in_ECX + 0x34); FUN_00a538a0(); FUN_004b3950(); FUN_004b3950(); multiplayer_lobby_state_destroy(); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a28e20 FUN_00a28e20 undefined4 FUN_00a28e20(void) { byte *pbVar1; LPCRITICAL_SECTION lpCriticalSection; int in_ECX; if ((DAT_00c5ab48 & 1) == 0) { lpCriticalSection = operator_new(0x1c); if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { lpCriticalSection = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; InitializeCriticalSection(lpCriticalSection); } DAT_00c5ab48 = DAT_00c5ab48 | 1; DAT_00c5ab4c = lpCriticalSection; } if (*(char *)(in_ECX + 0xec) == '\0') { (**(code **)(*(int *)(in_ECX + 0x104) + 4))(); *(undefined1 *)(in_ECX + 0xec) = 1; } pbVar1 = (byte *)(in_ECX + 0x2c); if ((*(byte *)(in_ECX + 0x2c) & 1) == 0) { if (*(char *)(in_ECX + 0x34) == '\0') { (**(code **)(*(int *)(in_ECX + 0x4c) + 4))(); *(undefined1 *)(in_ECX + 0x34) = 1; } (**(code **)(*(int *)(in_ECX + 0x58) + 4))(FUN_00a9e950,2,0xffffffff,0x10000,pbVar1); *pbVar1 = *pbVar1 | 1; } else { KAGE_LogMessage(0x10,(byte *)"Command thread is already initialized\n"); } if (*(char *)(in_ECX + 0x70) == '\0') { (**(code **)(*(int *)(in_ECX + 0x88) + 4))(); *(undefined1 *)(in_ECX + 0x70) = 1; } std::list>::push_back(FUN_00a732b0,in_ECX + 0x10); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; return 1; } //@@ 00a28f10 FUN_00a28f10 void FUN_00a28f10(void) { int in_ECX; if ((*(byte *)(in_ECX + 0x2c) & 1) != 0) { *(byte *)(in_ECX + 0x2c) = *(byte *)(in_ECX + 0x2c) | 2; (**(code **)(*(int *)(in_ECX + 0x58) + 0xc))(); KAGE::ThreadSafeQueue::shutdown(); *(byte *)(in_ECX + 0x2c) = *(byte *)(in_ECX + 0x2c) & 0xfc; } KAGE::ThreadSafeQueue::shutdown(); FUN_00a1d6b0(FUN_00a732b0); KAGE::ThreadSafeQueue::shutdown(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a28f60 lobby_process_user_commands /* DB: ? from KAGE::System::update and 00a5f6a0: drains a command deque (+0xf4/+0xf8/+0xfc/+0x100), "Incorrect number of parameters for user modification command", ConstLobby shared_ptr at +0x24, UserProfile::find_or_create/load_steam_avatar */ void lobby_process_user_commands(void) { code *pcVar1; char cVar2; int iVar3; int extraout_EAX; int in_ECX; int *piVar4; int iVar5; int *piVar6; uint size; int *_Dst; int *local_6c; int iStack_68; int iStack_64; int iStack_60; int local_5c; undefined **local_58; undefined4 local_54; int *local_50; undefined **local_4c; int local_48; int *local_44; undefined **local_40; undefined4 local_3c; int *local_38; undefined **local_34 [2]; int *local_2c; int local_28; undefined8 local_24; int *local_1c; size_t local_18; char local_11; void *local_10; undefined1 *puStack_c; undefined **local_8; local_8 = (undefined **)0xffffffff; puStack_c = &LAB_00b11dd5; local_10 = ExceptionList; ExceptionList = &local_10; local_28 = in_ECX; KAGE::Network::MultiplayerManager::update_lobby_members (__security_cookie ^ (uint)(local_34 + 0xc)); if (*(int **)(in_ECX + 8) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + 8) + 8))(); } local_6c = (int *)0x0; iStack_68 = 0; iStack_64 = 0; iStack_60 = 0; local_5c = 0; piVar4 = (int *)(in_ECX + 0x104); local_8._1_3_ = 0; local_2c = piVar4; do { local_8._0_1_ = 0; _Dst = local_6c; do { do { while( true ) { (**(code **)(*piVar4 + 0xc))(0xffffffff); if (*(int *)(in_ECX + 0x100) == 0) { (**(code **)(*local_2c + 0x10))(); if (_Dst != (int *)0x0) { size = iStack_64 - (int)_Dst & 0xfffffff8; piVar4 = _Dst; if (0xfff < size) { piVar4 = (int *)_Dst[-1]; size = size + 0x23; if (0x1f < (uint)((int)_Dst + (-4 - (int)piVar4))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar4,size); } ExceptionList = local_10; return; } piVar4 = *(int **)(*(int *)(in_ECX + 0xf4) + (*(int *)(in_ECX + 0xf8) - 1U & *(uint *)(in_ECX + 0xfc)) * 4); local_24 = CONCAT44(piVar4,(int)local_24); iVar3 = *piVar4; if (&local_6c != (int **)(piVar4 + 1)) { local_1c = (int *)piVar4[1]; local_18 = piVar4[2] - (int)local_1c; if ((uint)(iStack_64 - (int)_Dst >> 3) < (uint)((int)local_18 >> 3)) { std::vector<8byte>::_Clear_and_reserve((int)local_18 >> 3); _Dst = local_6c; } memmove(_Dst,local_1c,local_18); iStack_68 = local_18 + (int)_Dst; piVar4 = local_24._4_4_; } local_5c = piVar4[5]; iStack_60 = piVar4[4]; iVar5 = *(int *)(*(int *)(in_ECX + 0xf4) + (*(int *)(in_ECX + 0xf8) - 1U & *(uint *)(in_ECX + 0xfc)) * 4); *(undefined4 *)(iVar5 + 0x10) = 0; *(undefined4 *)(iVar5 + 0x14) = 0; std::vector::_Tidy(); piVar4 = (int *)(in_ECX + 0x100); *piVar4 = *piVar4 + -1; if (*piVar4 == 0) { *(undefined4 *)(in_ECX + 0xfc) = 0; } else { *(int *)(in_ECX + 0xfc) = *(int *)(in_ECX + 0xfc) + 1; } (**(code **)(*(int *)(in_ECX + 0x104) + 0x10))(); if (iVar3 != 0) break; if (iStack_68 - (int)_Dst >> 3 != 3) { KAGE_LogMessage(0x10,(byte *) "Incorrect number of parameters for user modification command\n"); } local_4c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_48 = 0; local_44 = (int *)0x0; local_8._0_1_ = 1; std::shared_ptr::assign(&local_48,(void *)(in_ECX + 0x24)); if (local_48 == 0) { local_24 = 0; local_24._4_4_ = (int *)0x0; local_24._0_4_ = 0; iVar3 = (int)local_24._4_4_; iVar5 = (int)local_24; } else { iVar3 = *(int *)(local_48 + 0xc); iVar5 = *(int *)(local_48 + 8); } if ((iVar5 != *_Dst) || (local_11 = '\x01', iVar3 != _Dst[1])) { local_11 = '\0'; } local_4c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 2; if (((local_44 != (int *)0x0) && (cVar2 = (**(code **)(*local_44 + 0xc))(), cVar2 != '\0') ) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_48); } piVar4 = (int *)(in_ECX + 0x104); local_8._0_1_ = 0; if (local_11 != '\0') { local_58 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_54 = 0; local_50 = (int *)0x0; local_8._0_1_ = 3; std::shared_ptr::assign(&local_54,(void *)(in_ECX + 0x24)); local_58 = KAGE::Network::Multiplayer::Lobby::vftable; local_8._0_1_ = 4; local_34[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(_Dst + 2); local_8._0_1_ = 5; local_34[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_34); } local_8._0_1_ = 6; piVar4 = (int *)**(int **)(in_ECX + 0x118); if (piVar4 != *(int **)(in_ECX + 0x118)) { do { (*(code *)piVar4[2])(&local_58,local_34,_Dst[4],piVar4[3]); piVar4 = (int *)*piVar4; } while (piVar4 != (int *)*(int *)(in_ECX + 0x118)); } local_34[0] = KAGE::System::UserProfileBase::vftable; local_58 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 7; if (((local_50 != (int *)0x0) && (cVar2 = (**(code **)(*local_50 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_54); } local_8._0_1_ = 0; piVar4 = (int *)(in_ECX + 0x104); } } piVar4 = (int *)(in_ECX + 0x104); } while (iVar3 != 1); piVar4 = (int *)(in_ECX + 0x104); piVar6 = (int *)**(int **)(in_ECX + 0x120); } while (piVar6 == *(int **)(in_ECX + 0x120)); do { pcVar1 = (code *)piVar6[2]; iVar3 = piVar6[3]; local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_3c = 0; local_38 = (int *)0x0; local_8._0_1_ = 8; std::shared_ptr::assign(&local_3c,(void *)(in_ECX + 0x24)); local_40 = KAGE::Network::Multiplayer::Lobby::vftable; local_8._0_1_ = 9; (*pcVar1)(&local_40,iVar3); local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 10; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_3c); } piVar6 = (int *)*piVar6; in_ECX = local_28; } while (piVar6 != (int *)*(int *)(local_28 + 0x120)); piVar4 = (int *)(local_28 + 0x104); } while( true ); } //@@ 00a29370 Multiplayer::set_service_provider /* DB: switch on provider type: 0 none, 1 ServiceLocalhost (0x74, ChangeWindowMessageFilterEx WM_COPYDATA), others Steam/EOS; destroys the previous g_multiplayerService; "Unknown or unsupported service provider type specified"; online_lobby_join, menus prototype: db/protos.zhl, confirmed by RET 4 */ void Multiplayer::set_service_provider(int providerType) { int iVar1; undefined4 *puVar2; undefined4 uVar3; undefined8 uVar4; undefined4 *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b11e69; local_1c = ExceptionList; ExceptionList = &local_1c; if (g_multiplayerService == (void *)0x0) { iVar1 = 0; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); } else { iVar1 = (*(code *)**(undefined4 **)g_multiplayerService) (__security_cookie ^ (int)register0x00000010 - 0x10U); } if (providerType == iVar1) { ExceptionList = local_1c; return; } if (g_multiplayerService != (void *)0x0) { (**(code **)(*(int *)g_multiplayerService + 4))(1); g_multiplayerService = (void *)0x0; } switch(providerType) { case 0: g_multiplayerService = (void *)0x0; ExceptionList = local_1c; return; case 1: puVar2 = operator_new(0x74); local_14 = 0; if (puVar2 != (undefined4 *)0x0) { local_24 = puVar2; KAGE::Network::Multiplayer::ServiceBase::ServiceBase(); *puVar2 = KAGE::Network::Multiplayer::ServiceLocalhost::vftable; puVar2[0x11] = 0; puVar2[0x12] = 0; puVar2[0x13] = 0; puVar2[0x14] = 0; puVar2[0x17] = 0; puVar2[0x18] = 0; puVar2[0x19] = 0; local_14._0_1_ = 4; puVar2[0x1a] = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(puVar2 + 0x1b); local_14 = CONCAT31(local_14._1_3_,5); if (_glfw == 0) { _glfwInputError(0x10001,0); ChangeWindowMessageFilterEx((HWND)0x0,0x4a,1,(PCHANGEFILTERSTRUCT)0x0); g_multiplayerService = puVar2; ExceptionList = local_1c; return; } if (DAT_00c73694 == 0x60001) { ChangeWindowMessageFilterEx (*(HWND *)((int)g_glfwWindow + 0x2b4),0x4a,1,(PCHANGEFILTERSTRUCT)0x0); g_multiplayerService = puVar2; ExceptionList = local_1c; return; } _glfwInputError(0x1000e,"Win32: Platform not initialized"); ChangeWindowMessageFilterEx((HWND)0x0,0x4a,1,(PCHANGEFILTERSTRUCT)0x0); g_multiplayerService = puVar2; ExceptionList = local_1c; return; } break; case 2: puVar2 = operator_new(0xb0); local_14 = 6; if (puVar2 != (undefined4 *)0x0) { KAGE::Network::Multiplayer::ServiceBase::ServiceBase(); *puVar2 = KAGE::Network::Multiplayer::ServiceSteam::vftable; puVar2[0x12] = 0; puVar2[0x13] = 0; puVar2[0x14] = 0; puVar2[0x15] = 0; *(undefined1 *)(puVar2 + 0x17) = 0; puVar2[0x16] = CCallResult::vftable; puVar2[0x1a] = 0; puVar2[0x1b] = 0; puVar2[0x1c] = 0; puVar2[0x1d] = 0; puVar2[0x18] = 0x201; *(undefined1 *)(puVar2 + 0x1f) = 0; puVar2[0x1e] = CCallResult::vftable; puVar2[0x22] = 0; puVar2[0x23] = 0; puVar2[0x24] = 0; puVar2[0x25] = 0; puVar2[0x20] = 0x1f8; *(undefined1 *)(puVar2 + 0x27) = 0; puVar2[0x28] = 0; puVar2[0x26] = CCallback:: vftable; puVar2[0x29] = puVar2; puVar2[0x2a] = &LAB_00a75e20; SteamAPI_RegisterCallback(puVar2 + 0x26,0x1fa); g_multiplayerService = puVar2; ExceptionList = local_1c; return; } break; case 3: puVar2 = operator_new(0x68); local_14 = 7; if (puVar2 != (undefined4 *)0x0) { KAGE::Network::Multiplayer::ServiceBase::ServiceBase(); puVar2[0x12] = 0; puVar2[0x13] = 0; *puVar2 = KAGE::Network::Multiplayer::ServiceEOS::vftable; puVar2[0x14] = 0; puVar2[0x15] = 0; puVar2[0x16] = 0; puVar2[0x17] = 0; puVar2[0x18] = 0; puVar2[0x19] = 0; if (puVar2[0x12] == 0 && puVar2[0x13] == 0) { local_24 = (undefined4 *)0x1; uVar3 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&local_24,puVar2,FUN_00a770b0); uVar4 = _EOS_Lobby_AddNotifyLobbyMemberStatusReceived_16(uVar3); *(undefined8 *)(puVar2 + 0x12) = uVar4; g_multiplayerService = puVar2; ExceptionList = local_1c; return; } g_multiplayerService = puVar2; ExceptionList = local_1c; return; } break; default: KAGE_LogMessage(0x10,(byte *)"Unknown or unsupported service provider type specified\n"); ExceptionList = local_1c; return; } g_multiplayerService = (void *)0x0; ExceptionList = local_1c; return; } //@@ 00a296e0 FUN_00a296e0 void * FUN_00a296e0(void *param_1,int param_2,void *param_3,uint param_4,byte param_5) { if (g_multiplayerService == (void *)0x0) { KAGE_LogMessage(0x10,(byte *) "Attempting to create a message when there is no multiplayer service\n"); } NetConnection::send_message(g_multiplayerService,param_1,param_2,param_3,param_4,param_5); return param_1; } //@@ 00a29740 multiplayer_send_message /* DB: ? (connection, message, user): "Attempting to send a message when there is no multiplayer service", reliable->unreliable fallback warning, mutex-guarded queueing (FUN_00a78370); NetplayManager::send_message, RemoveRemotePlayer prototype: db/protos.zhl, confirmed by RET 12 */ byte multiplayer_send_message(void *recipient,void *message,void *messageRefCount) { undefined4 *puVar1; int iVar2; int *piVar3; int *piVar4; byte bVar5; char cVar6; uint uVar7; undefined4 *puVar8; void *pvVar9; undefined4 uVar10; undefined4 uVar11; int *piVar12; undefined4 in_stack_ffffffc0; char *id; undefined8 local_28; undefined4 *local_1c; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11ed2; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (message == (void *)0x0) { bVar5 = 0; } else { if (g_multiplayerService == (void *)0x0) { in_stack_ffffffc0 = 0x10; KAGE_LogMessage(0x10,(byte *) "Attempting to send a message when there is no multiplayer service\n"); } id = (char *)0xa297a0; cVar6 = (**(code **)(*(int *)recipient + 0x14))(uVar7); if (cVar6 == '\0') { if ((*(int *)((int)message + 0xc) != 0) && ((*(byte *)(*(int *)(**(int **)((int)message + 8) + 0x14) + 4) & 1) != 0)) { iVar2 = *(int *)((int)recipient + 4); if (iVar2 == 0) { local_28._4_4_ = (int *)0x0; local_28._0_4_ = 0; } else { local_28._0_4_ = *(undefined4 *)(iVar2 + 8); local_28._4_4_ = *(int **)(iVar2 + 0xc); } id = (char *)&local_28; in_stack_ffffffc0 = 0xa29945; bVar5 = connection_map_contains(g_multiplayerService,(ulonglong *)id); if (bVar5 == 0) { id = "Attempting to send a reliable message to a user without an active connection, this message will be converted to non-reliable\n" ; in_stack_ffffffc0 = 4; KAGE_LogMessage(4,(byte *) "Attempting to send a reliable message to a user without an active connection, this message will be converted to non-reliable\n" ); piVar12 = (int *)**(int **)((int)message + 8); if (piVar12 != *(int **)((int)message + 8)) { do { *(byte *)(piVar12[5] + 4) = *(byte *)(piVar12[5] + 4) & 0xfe; piVar3 = (int *)piVar12[2]; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar6 = *(char *)(*piVar3 + 0xd); piVar12 = piVar3; piVar3 = (int *)*piVar3; while (cVar6 == '\0') { cVar6 = *(char *)(*piVar3 + 0xd); piVar12 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar6 = *(char *)(piVar12[1] + 0xd); piVar4 = (int *)piVar12[1]; piVar3 = piVar12; while ((piVar12 = piVar4, cVar6 == '\0' && (piVar3 == (int *)piVar12[2]))) { cVar6 = *(char *)(piVar12[1] + 0xd); piVar4 = (int *)piVar12[1]; piVar3 = piVar12; } } } while (piVar12 != *(int **)((int)message + 8)); } } } iVar2 = *(int *)((int)recipient + 4); if (iVar2 == 0) { local_28._4_4_ = (int *)0x0; local_28._0_4_ = 0; } else { local_28._0_4_ = *(undefined4 *)(iVar2 + 8); local_28._4_4_ = *(int **)(iVar2 + 0xc); } FUN_008ef1d0(&message); bVar5 = KAGE::Network::Multiplayer::ConnectionBase::send_message (&local_28,1,in_stack_ffffffc0,id); } else { piVar12 = (int *)((int)g_multiplayerService + 0x38); local_18 = piVar12; if (piVar12 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar12 + 0xc))(0xffffffff); } local_8._0_1_ = 1; puVar8 = operator_new(0x20); local_8._0_1_ = 2; local_1c = puVar8; if (puVar8 == (undefined4 *)0x0) { puVar8 = (undefined4 *)0x0; } else { puVar1 = puVar8 + 2; *puVar8 = 0; puVar8[1] = 0; local_28 = CONCAT44(puVar1,(undefined4)local_28); *puVar1 = 0; puVar8[3] = 0; pvVar9 = operator_new(0x1c); *(void **)pvVar9 = pvVar9; *(void **)((int)pvVar9 + 4) = pvVar9; *(void **)((int)pvVar9 + 8) = pvVar9; *(undefined2 *)((int)pvVar9 + 0xc) = 0x101; *puVar1 = pvVar9; puVar8[4] = 0; puVar8[5] = 0; local_8._0_1_ = 4; puVar1 = puVar8 + 6; local_28 = CONCAT44(puVar1,(undefined4)local_28); *puVar1 = 0; puVar8[7] = 0; pvVar9 = operator_new(0x20); *(void **)pvVar9 = pvVar9; *(void **)((int)pvVar9 + 4) = pvVar9; *(void **)((int)pvVar9 + 8) = pvVar9; *(undefined2 *)((int)pvVar9 + 0xc) = 0x101; *puVar1 = pvVar9; } local_8._0_1_ = 1; multiplayer_message_coalesce_fragments(puVar8); iVar2 = *(int *)((int)recipient + 4); if (iVar2 == 0) { local_28 = 0; local_28._4_4_ = (int *)0x0; local_28._0_4_ = 0; uVar10 = local_28._4_4_; uVar11 = (undefined4)local_28; } else { uVar10 = *(undefined4 *)(iVar2 + 0xc); uVar11 = *(undefined4 *)(iVar2 + 8); } *puVar8 = uVar11; puVar8[1] = uVar10; FUN_00a2a690(puVar8); local_8._0_1_ = 5; FUN_00a2a510(&local_28); local_8._0_1_ = 6; if (((local_28._4_4_ != (int *)0x0) && (cVar6 = (**(code **)(*local_28._4_4_ + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_28); } local_8 = CONCAT31(local_8._1_3_,7); (**(code **)(*piVar12 + 0x10))(); bVar5 = 1; } } local_8 = 8; if (((messageRefCount != (void *)0x0) && (cVar6 = (**(code **)(*(int *)messageRefCount + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&message); } ExceptionList = local_10; return bVar5; } //@@ 00a29a40 FUN_00a29a40 undefined1 * FUN_00a29a40(undefined4 param_1,int param_2,int *param_3) { char cVar1; undefined1 *puVar2; undefined1 auStackY_100 [188]; undefined4 uStackY_44; undefined4 *puStackY_40; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_18 = &LAB_00b11f00; local_1c = ExceptionList; ExceptionList = &local_1c; local_14 = 0; if (param_2 == 0) { puVar2 = auStackY_100; } else { if (g_multiplayerService == (void *)0x0) { puStackY_40 = (undefined4 *)0xa29aa1; KAGE_LogMessage(0x10,(byte *) "Attempting to broadcast a message when there is no multiplayer service\n" ); } puStackY_40 = ¶m_2; uStackY_44 = 0xa29ab8; FUN_008ef1d0(); puStackY_40 = (undefined4 *)param_1; uStackY_44 = 0xa29ac2; puVar2 = (undefined1 *)FUN_00a785c0(); } local_14 = 1; if (param_3 != (int *)0x0) { cVar1 = (**(code **)(*param_3 + 0xc))(); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } puVar2 = (undefined1 *)((uint)puVar2 & 0xff); } ExceptionList = local_1c; return puVar2; } //@@ 00a29b10 FUN_00a29b10 bool FUN_00a29b10(byte param_1) { int iVar1; char cVar2; int *piVar3; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; if (g_multiplayerService == (void *)0x0) { return false; } ExceptionList = &local_10; piVar3 = NetworkManager::receive_message(g_multiplayerService,local_1c,param_1,0); iVar1 = *piVar3; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } ExceptionList = local_10; return iVar1 != 0; } //@@ 00a29bb0 Multiplayer::flush_channel /* DB: ? under the service mutexes removes queued messages whose channel byte (+5) equals param and marks pending ones in each peer as dropped; Menu_OnlineLobby::Update */ void Multiplayer::flush_channel(int *param_1) { int iVar1; void *pvVar2; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> _Var3; char cVar4; int *piVar5; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar2 = g_multiplayerService; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; ExceptionList = &local_10; if (g_multiplayerService != (void *)0x0) { (**(code **)(*(int *)((int)g_multiplayerService + 0x38) + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); _Var3 = param_1._0_1_; piVar5 = (int *)**(int **)((int)pvVar2 + 0x30); if (piVar5 != *(int **)((int)pvVar2 + 0x30)) { do { param_1 = (int *)*piVar5; if (*(_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)(*(int *)(**(int **)(piVar5[2] + 8) + 0x14) + 5) == _Var3) { *(int **)piVar5[1] = param_1; *(int *)(*piVar5 + 4) = piVar5[1]; *(int *)((int)pvVar2 + 0x34) = *(int *)((int)pvVar2 + 0x34) + -1; local_8 = 0; if ((((int *)piVar5[3] != (int *)0x0) && (cVar4 = (**(code **)(*(int *)piVar5[3] + 0xc))(), cVar4 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(piVar5 + 2); } local_8 = 0xffffffff; operator_delete(piVar5,0x10); } piVar5 = param_1; } while (param_1 != *(int **)((int)pvVar2 + 0x30)); } (**(code **)(*(int *)((int)pvVar2 + 0x38) + 0x10))(); (**(code **)(*(int *)((int)pvVar2 + 0x10) + 0xc))(0xffffffff); local_14 = **(int **)((int)pvVar2 + 8); if ((int *)local_14 != *(int **)((int)pvVar2 + 8)) { do { iVar1 = *(int *)(local_14 + 0x18); piVar5 = *(int **)(iVar1 + 0x38); param_1 = (int *)*piVar5; if (param_1 != piVar5) { do { if (*(_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)(*(int *)(**(int **)(param_1[6] + 8) + 0x14) + 5) == _Var3) { *(undefined1 *)(param_1 + 10) = 1; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } while (param_1 != *(int **)(iVar1 + 0x38)); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } while (local_14 != *(int *)((int)pvVar2 + 8)); } (**(code **)(*(int *)((int)pvVar2 + 0x10) + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a29d00 Multiplayer::leave_lobby /* DB: ? (callback, userdata): if g_multiplayerLobbyPtr holds no lobby calls callback(0, empty ConstLobby, userdata) at once, else queues request type 3 with the callback (FUN_00a73100); caller NetplayManager::join_pending_lobby with callback 00908ce0 netplay_leave_lobby_callback void Multiplayer::leave_lobby(code *param_1,undefined4 param_2) { bool bVar1; char cVar2; uint uVar3; void *ptr; undefined4 local_3c; void *local_38; undefined4 uStack_34; undefined **ppuStack_30; code *pcStack_2c; int *local_28; undefined8 local_24; int *local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11f45; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_24 = 0xb9c1bc; local_1c = (int *)0x0; local_8 = 0; std::shared_ptr::assign((void *)((int)&local_24 + 4),&g_multiplayerLobbyPtr); local_24 = CONCAT44(local_24._4_4_,KAGE::Network::Multiplayer::Lobby::vftable); local_8 = 1; if (local_24._4_4_ != (int *)0x0) { cVar2 = (**(code **)(*local_24._4_4_ + 0xc))(uVar3); if (cVar2 != '\0') { bVar1 = false; goto LAB_00a29d75; } } bVar1 = true; LAB_00a29d75: local_24 = CONCAT44(local_24._4_4_,KAGE::Network::Multiplayer::ConstLobby::vftable); local_8 = 2; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)&local_24 + 4); } } local_8 = 0xffffffff; if (bVar1) { local_24 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_24); local_8 = 3; (*param_1)(0,&ppuStack_30,param_2); ppuStack_30 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 4; if (local_28 != (int *)0x0) { cVar2 = (**(code **)(*local_28 + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&pcStack_2c); ExceptionList = local_10; return; } } } else { local_3c = 3; local_38 = (void *)0x0; uStack_34 = 0; ppuStack_30 = (undefined **)0x0; pcStack_2c = (code *)0x0; local_28 = (int *)0x0; local_8 = 5; local_24 = 1; std::vector<8byte>::_Emplace_reallocate(0,&local_24); pcStack_2c = param_1; local_28 = (int *)param_2; CommandThread::post_command(&DAT_00c79a60,&local_3c); if (local_38 != (void *)0x0) { uVar3 = (int)ppuStack_30 - (int)local_38 & 0xfffffff8; ptr = local_38; if (0xfff < uVar3) { ptr = *(void **)((int)local_38 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_38 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } } ExceptionList = local_10; return; } //@@ 00a29ed0 FUN_00a29ed0 void FUN_00a29ed0(void) { int iVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(PTR_vftable_00c5ab44 + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); iVar1 = DAT_00c79bf8; FUN_00a721b0(&DAT_00c79bf8,*(undefined4 *)(DAT_00c79bf8 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; DAT_00c79bfc = 0; local_8 = 0; (**(code **)(PTR_vftable_00c5ab44 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a29f60 Multiplayer::get_lobby /* DB: ? ECX = global 0xc79a50; builds a KAGE::Network::Multiplayer::Lobby (ConstLobby->Lobby vftable) holding shared_ptr copied from this+0x24 into param_1; used by PauseScreen/Menu_OnlineLobby prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall Multiplayer::get_lobby(void *this,void *outLobby) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11f80; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)outLobby = KAGE::Network::Multiplayer::ConstLobby::vftable; *(undefined4 *)((int)outLobby + 4) = 0; *(undefined4 *)((int)outLobby + 8) = 0; local_8 = 0; std::shared_ptr::assign((undefined4 *)((int)outLobby + 4),(void *)((int)this + 0x24)); *(undefined ***)outLobby = KAGE::Network::Multiplayer::Lobby::vftable; ExceptionList = local_10; return outLobby; } //@@ 00a29fd0 FUN_00a29fd0 void * FUN_00a29fd0(void *param_1,int param_2) { int iVar1; undefined4 local_c; undefined4 uStack_8; if (g_multiplayerService == (void *)0x0) { KAGE::SmartPointer::SmartPointer(0); return param_1; } iVar1 = *(int *)(param_2 + 4); if (iVar1 == 0) { uStack_8 = 0; local_c = 0; } else { local_c = *(undefined4 *)(iVar1 + 8); uStack_8 = *(undefined4 *)(iVar1 + 0xc); } NetworkManager::get_peer(g_multiplayerService,param_1,(ulonglong *)&local_c); return param_1; } //@@ 00a2a030 FUN_00a2a030 void FUN_00a2a030(void *param_1,undefined4 param_2,void *param_3,uint param_4) { void *in_stack_ffffffe8; void *in_stack_ffffffec; undefined1 auStack_e [10]; NetConnection::send_message(g_multiplayerService,auStack_e + -10,0,param_3,param_4,0xff); multiplayer_send_message(param_1,in_stack_ffffffe8,in_stack_ffffffec); return; } //@@ 00a2a070 FUN_00a2a070 void FUN_00a2a070(undefined4 param_1,void *param_2) { undefined1 auStack_18 [12]; undefined1 *local_c; local_c = auStack_18; NetConnection::send_message(g_multiplayerService,auStack_18,0,param_2,0x18,0xff); FUN_00a29a40(0); return; } //@@ 00a2a0b0 Multiplayer::handle_member_status /* DB: ? (lobby, userId, status): if lobby is the current one, status 0 (joined) connects the peer (service vfunc +0x28) unless known, 1..4 (left/kicked) drops the peer and purges its queued messages (mutex "Invalid mutex object specified"), then emits a lobby event {lobby id, user, status}; netplay_lobby_host_handle_message, LobbyLocalhost::add_member prototype: db/protos.zhl, confirmed by RET 12 */ void Multiplayer::handle_member_status(void *lobby,ulonglong *userId,int status) { bool bVar1; char cVar2; byte bVar3; uint uVar4; int iVar5; int iVar6; int *piVar7; int iVar8; void *pvVar9; int iVar10; int *ptr; int *piVar11; undefined4 local_38; void *local_34; int *piStack_30; undefined **ppuStack_2c; void *pvStack_28; int *local_24; undefined8 local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b11fc5; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; ppuStack_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; pvStack_28 = (void *)0x0; local_24 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&pvStack_28,&g_multiplayerLobbyPtr); if (pvStack_28 == (void *)0x0) { local_20 = 0; local_20._4_4_ = (int *)0x0; local_20._0_4_ = 0; iVar6 = (int)local_20._4_4_; iVar8 = (int)local_20; } else { iVar6 = *(int *)((int)pvStack_28 + 0xc); iVar8 = *(int *)((int)pvStack_28 + 8); } iVar10 = *(int *)((int)lobby + 4); if (iVar10 == 0) { local_20 = 0; local_20._4_4_ = (int *)0x0; local_20._0_4_ = 0; iVar5 = (int)local_20._4_4_; iVar10 = (int)local_20; } else { iVar5 = *(int *)(iVar10 + 0xc); iVar10 = *(int *)(iVar10 + 8); } if ((iVar10 == iVar8) && (iVar5 == iVar6)) { bVar1 = false; } else { bVar1 = true; } ppuStack_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(uVar4), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&pvStack_28); } pvVar9 = g_multiplayerService; local_8 = 0xffffffff; if (!bVar1) { switch(status) { case 0: bVar3 = connection_map_contains(g_multiplayerService,userId); if (bVar3 == 0) { (**(code **)(*(int *)g_multiplayerService + 0x28))(userId); } break; case 1: case 2: case 3: case 4: bVar3 = connection_map_contains(g_multiplayerService,userId); if (bVar3 != 0) { (**(code **)(*(int *)((int)pvVar9 + 0x10) + 0xc))(0xffffffff); std::map::erase(userId); (**(code **)(*(int *)((int)pvVar9 + 0x10) + 0x10))(); piVar11 = (int *)((int)pvVar9 + 0x38); if (piVar11 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar11 + 0xc))(0xffffffff); } ptr = (int *)**(int **)((int)pvVar9 + 0x30); if (ptr != *(int **)((int)pvVar9 + 0x30)) { do { piVar7 = (int *)*ptr; local_20 = CONCAT44(piVar7,(int)local_20); if ((*(int *)ptr[2] == (int)*userId) && (*(int *)(ptr[2] + 4) == *(int *)((int)userId + 4))) { *(int **)ptr[1] = piVar7; *(int *)(*ptr + 4) = ptr[1]; *(int *)((int)pvVar9 + 0x34) = *(int *)((int)pvVar9 + 0x34) + -1; local_8 = 2; if (((int *)ptr[3] != (int *)0x0) && ((cVar2 = (**(code **)(*(int *)ptr[3] + 0xc))(), cVar2 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(ptr + 2); } operator_delete(ptr,0x10); piVar7 = local_20._4_4_; } ptr = piVar7; } while (piVar7 != *(int **)((int)pvVar9 + 0x30)); } local_8 = 3; (**(code **)(*piVar11 + 0x10))(); } } ppuStack_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; pvStack_28 = (void *)0x0; local_24 = (int *)0x0; local_8 = 4; std::shared_ptr::assign(&pvStack_28,&g_multiplayerLobbyPtr); ppuStack_2c = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 5; Lobby::refresh_members(pvStack_28); ppuStack_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 6; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&pvStack_28); } local_38 = 0; local_34 = (void *)0x0; piStack_30 = (int *)0x0; ppuStack_2c = (undefined **)0x0; pvStack_28 = (void *)0x0; local_24 = (int *)0x0; local_8 = 7; iVar6 = *(int *)((int)lobby + 4); if (iVar6 == 0) { local_20._4_4_ = (int *)0x0; local_20._0_4_ = 0; } else { local_20._0_4_ = *(undefined4 *)(iVar6 + 8); local_20._4_4_ = *(int **)(iVar6 + 0xc); } std::vector<8byte>::_Emplace_reallocate(0,&local_20); if ((undefined **)piStack_30 == ppuStack_2c) { std::vector<8byte>::_Emplace_reallocate(piStack_30,userId); } else { iVar6 = *(int *)((int)userId + 4); *piStack_30 = (int)*userId; piStack_30[1] = iVar6; piStack_30 = piStack_30 + 2; } local_20 = (longlong)status; if ((undefined **)piStack_30 == ppuStack_2c) { std::vector<8byte>::_Emplace_reallocate(piStack_30,&local_20); } else { *piStack_30 = status; piStack_30[1] = status >> 0x1f; piStack_30 = piStack_30 + 2; } FUN_00a2a5a0(&local_38); if (local_34 != (void *)0x0) { uVar4 = (int)ppuStack_2c - (int)local_34 & 0xfffffff8; pvVar9 = local_34; if (0xfff < uVar4) { pvVar9 = *(void **)((int)local_34 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)pvVar9))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar9,uVar4); } } ExceptionList = local_10; return; } //@@ 00a2a430 FUN_00a2a430 void FUN_00a2a430(undefined4 param_1) { int *piVar1; piVar1 = (int *)*DAT_00c79b60; if (piVar1 != DAT_00c79b60) { do { (*(code *)piVar1[2])(param_1,piVar1[3]); piVar1 = (int *)*piVar1; } while (piVar1 != DAT_00c79b60); } return; } //@@ 00a2a460 KAGE::SmartPointer::SmartPointer /* DB: default ctor: null pointer wrapped in a new ReferenceCount (0x18), releases the old one through g_connectionReleaseFn; NetplayManager / NetworkManager::get_peer */ void KAGE::SmartPointer::SmartPointer(void) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afc524; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } } in_ECX[1] = this; *in_ECX = 0; ExceptionList = local_10; return; } //@@ 00a2a510 FUN_00a2a510 void FUN_00a2a510(undefined4 param_1) { int iVar1; undefined4 *puVar2; int *piVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11ffd; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; if (in_ECX[1] == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar3 = operator_new(0x10); FUN_008ef1d0(param_1); in_ECX[1] = in_ECX[1] + 1; puVar2 = *(undefined4 **)(iVar1 + 4); *piVar3 = iVar1; piVar3[1] = (int)puVar2; *(int **)(iVar1 + 4) = piVar3; *puVar2 = piVar3; ExceptionList = local_10; return; } //@@ 00a2a5a0 FUN_00a2a5a0 void FUN_00a2a5a0(undefined4 *param_1) { int *piVar1; undefined4 *puVar2; undefined4 uVar3; uint uVar4; void *pvVar5; int iVar6; int in_ECX; uint uVar7; int iVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1093d; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x1c); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; iVar8 = *(int *)(in_ECX + 0x18); uVar7 = *(uint *)(in_ECX + 0x10); if (uVar7 <= iVar8 + 1U) { FUN_006937a0(uVar7); uVar7 = *(uint *)(in_ECX + 0x10); iVar8 = *(int *)(in_ECX + 0x18); } uVar4 = uVar7 - 1 & *(uint *)(in_ECX + 0x14); *(uint *)(in_ECX + 0x14) = uVar4; uVar7 = uVar7 - 1 & uVar4 + iVar8; iVar6 = *(int *)(in_ECX + 0xc); iVar8 = uVar7 * 4; if (*(int *)(iVar6 + uVar7 * 4) == 0) { pvVar5 = operator_new(0x18); *(void **)(iVar8 + *(int *)(in_ECX + 0xc)) = pvVar5; iVar6 = *(int *)(in_ECX + 0xc); } puVar2 = *(undefined4 **)(iVar8 + iVar6); *puVar2 = *param_1; FUN_00915d70(param_1 + 1); uVar3 = param_1[5]; puVar2[4] = param_1[4]; puVar2[5] = uVar3; *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + 1; local_8 = 1; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a2a690 FUN_00a2a690 void FUN_00a2a690(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } in_ECX[1] = this; *in_ECX = param_1; ExceptionList = local_10; return; } //@@ 00a2a740 FUN_00a2a740 void FUN_00a2a740(byte param_1) { LPCRITICAL_SECTION lpCriticalSection; uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::ThreadSafeQueue::vftable; KAGE::ThreadSafeQueue::shutdown(uVar1); lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[9]; in_ECX[7] = KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[9] = 0; } *(byte *)(in_ECX + 8) = *(byte *)(in_ECX + 8) & 0xfe; in_ECX[7] = KAGE::MutexBase::vftable; FUN_00a2a7e0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x28); } ExceptionList = local_10; return; } //@@ 00a2a7e0 FUN_00a2a7e0 void FUN_00a2a7e0(void) { void *pvVar1; void *ptr; undefined4 *in_ECX; int iVar2; uint size; iVar2 = in_ECX[4]; do { if (iVar2 == 0) goto LAB_00a2a830; iVar2 = *(int *)(in_ECX[1] + (iVar2 + in_ECX[3] + -1 & in_ECX[2] - 1) * 4); *(undefined4 *)(iVar2 + 0x10) = 0; *(undefined4 *)(iVar2 + 0x14) = 0; std::vector::_Tidy(); iVar2 = in_ECX[4] + -1; in_ECX[4] = iVar2; } while (iVar2 != 0); in_ECX[3] = 0; LAB_00a2a830: iVar2 = in_ECX[2]; while (iVar2 != 0) { iVar2 = iVar2 + -1; pvVar1 = *(void **)(in_ECX[1] + iVar2 * 4); if (pvVar1 != (void *)0x0) { operator_delete(pvVar1,0x18); } } pvVar1 = (void *)in_ECX[1]; if (pvVar1 != (void *)0x0) { size = in_ECX[2] * 4; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } pvVar1 = (void *)*in_ECX; in_ECX[2] = 0; in_ECX[1] = 0; *in_ECX = 0; operator_delete(pvVar1,8); return; } //@@ 00a2a8b0 FUN_00a2a8b0 void FUN_00a2a8b0(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; std::vector::_Tidy(); return; } //@@ 00a2a8d0 KAGE::ThreadSafeQueue::shutdown /* DB: ? when initialized (+4): locks the mutex (+0x1c vfunc +0xc, -1), drains the deque (+0xc..+0x18), unlocks (+0x10), destroys (+8), clears flag; ThreadSafeQueue::~ThreadSafeQueue, multiplayer_connection_state_destroy */ void KAGE::ThreadSafeQueue::shutdown(void) { int *piVar1; int iVar2; int in_ECX; if (*(char *)(in_ECX + 4) != '\0') { (**(code **)(*(int *)(in_ECX + 0x1c) + 0xc))(0xffffffff); if (*(int *)(in_ECX + 0x18) != 0) { while( true ) { iVar2 = *(int *)(*(int *)(in_ECX + 0xc) + (*(int *)(in_ECX + 0x10) - 1U & *(uint *)(in_ECX + 0x14)) * 4); *(undefined4 *)(iVar2 + 0x10) = 0; *(undefined4 *)(iVar2 + 0x14) = 0; std::vector::_Tidy(); piVar1 = (int *)(in_ECX + 0x18); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) break; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; } *(undefined4 *)(in_ECX + 0x14) = 0; } (**(code **)(*(int *)(in_ECX + 0x1c) + 0x10))(); (**(code **)(*(int *)(in_ECX + 0x1c) + 8))(); *(undefined1 *)(in_ECX + 4) = 0; } return; } //@@ 00a2a940 FUN_00a2a940 void FUN_00a2a940(void) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(in_ECX); *in_ECX = KAGE::Network::Multiplayer::Lobby::vftable; return; } //@@ 00a2a970 FUN_00a2a970 void FUN_00a2a970(void) { int in_ECX; if (*(int **)(in_ECX + 4) == (int *)0x0) { return; } /* WARNING: Could not recover jumptable at 0x00a2a97d. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(**(int **)(in_ECX + 4) + 0x24))(); return; } //@@ 00a2a990 SoundInstance::SoundInstance /* DB: default ctor: SmartPointer (ReferenceCount 0x18), loop bytes 0, volume 1.0 (+0xc), pan 0, pitch 1.0 (+0x14); same layout as SoundInstance::assign; Manager::constructor prototype: db/protos.zhl */ void __thiscall SoundInstance::SoundInstance(void *this) { char cVar1; uint uVar2; ReferenceCountBase *this_00; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1203c; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)this = 0; *(undefined4 *)((int)this + 4) = 0; local_8 = 0; this_00 = operator_new(0x18); local_8._0_1_ = 1; if (this_00 == (ReferenceCountBase *)0x0) { this_00 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this_00); *(undefined ***)this_00 = ReferenceCount::vftable; *(undefined4 *)(this_00 + 0x14) = 0; } local_8 = (uint)local_8._1_3_ << 8; if (*(int **)((int)this + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)this + 4) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(this); } } *(ReferenceCountBase **)((int)this + 4) = this_00; *(undefined4 *)this = 0; *(undefined2 *)((int)this + 8) = 0; *(undefined1 *)((int)this + 10) = 0; *(undefined4 *)((int)this + 0xc) = 0x3f800000; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0x3f800000; ExceptionList = local_10; return; } //@@ 00a2aa60 FUN_00a2aa60 void FUN_00a2aa60(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1203c; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; local_8 = 0; this = operator_new(0x18); local_8._0_1_ = 1; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = 0; } local_8 = (uint)local_8._1_3_ << 8; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(); } } in_ECX[1] = this; *in_ECX = 0; *(undefined2 *)(in_ECX + 2) = 0; *(undefined1 *)((int)in_ECX + 10) = 0; in_ECX[3] = 0x3f800000; in_ECX[4] = 0; in_ECX[5] = 0x3f800000; SoundInstance::operator_assign(param_1); ExceptionList = local_10; return; } //@@ 00a2ab40 FUN_00a2ab40 void FUN_00a2ab40(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 8) = 0; *(undefined1 *)(in_ECX + 10) = 0; *(undefined4 *)(in_ECX + 0xc) = 0x3f800000; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0x3f800000; local_8 = 0; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(); } } ExceptionList = local_10; return; } //@@ 00a2abd0 FUN_00a2abd0 void FUN_00a2abd0(void) { int in_ECX; KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 8) = 0; *(undefined1 *)(in_ECX + 10) = 0; *(undefined4 *)(in_ECX + 0xc) = 0x3f800000; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0x3f800000; return; } //@@ 00a2ac00 FUN_00a2ac00 void FUN_00a2ac00(void) { int *in_ECX; if ((int *)*in_ECX != (int *)0x0) { (**(code **)(*(int *)*in_ECX + 0x2c))(1); *(undefined2 *)((int)in_ECX + 9) = 1; } return; } //@@ 00a2ac20 FUN_00a2ac20 void FUN_00a2ac20(void) { int iVar1; int *in_ECX; float in_XMM1_Da; in_ECX[4] = (int)in_XMM1_Da; if ((int *)*in_ECX != (int *)0x0) { iVar1 = (**(code **)(*(int *)*in_ECX + 0x60))(); if ((1 < iVar1) && (in_XMM1_Da != 0.0)) { KAGE_LogMessage(4,(byte *) "Attempting to set pan on non-mono source (%s), this will have no effect\n") ; return; } (**(code **)(*(int *)*in_ECX + 0x50))(in_XMM1_Da); } return; } //@@ 00a2ac90 SoundInstance::operator_assign /* DB: ? copies another SoundInstance: copy source SmartPointer (FUN_008f2d20), reset (FUN_00a2ae60(0)) to defaults (loop 0, volume 1.0, pan 0, pitch 1.0), swap in the source, then copy loop/volume/pan/pitch fields; SFXManager::load_xml */ void SoundInstance::operator_assign(int param_1) { undefined4 uVar1; undefined4 uVar2; undefined2 uVar3; char cVar4; uint uVar5; undefined4 *puVar6; undefined4 *in_ECX; undefined1 local_2c [4]; int *local_28; undefined1 local_24 [4]; int *local_20; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1206d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; FUN_008f2d20(param_1); local_8 = 0; uVar1 = *(undefined4 *)(param_1 + 0xc); uVar3 = *(undefined2 *)(param_1 + 8); local_18 = *(undefined4 *)(param_1 + 0x10); local_1c = *(undefined4 *)(param_1 + 0x14); KAGE::SmartPointer::reset(0); *(undefined2 *)(in_ECX + 2) = 0; *(undefined1 *)((int)in_ECX + 10) = 0; in_ECX[3] = 0x3f800000; in_ECX[4] = 0; in_ECX[5] = 0x3f800000; puVar6 = (undefined4 *)FUN_008f2d20(local_24); uVar2 = puVar6[1]; puVar6[1] = in_ECX[1]; in_ECX[1] = uVar2; uVar2 = *puVar6; *puVar6 = *in_ECX; *in_ECX = uVar2; local_8 = CONCAT31(local_8._1_3_,1); if (local_28 != (int *)0x0) { cVar4 = (**(code **)(*local_28 + 0xc))(uVar5); if ((cVar4 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_2c); } } in_ECX[3] = uVar1; in_ECX[4] = local_18; *(char *)(in_ECX + 2) = (char)uVar3; *(char *)((int)in_ECX + 9) = (char)((ushort)uVar3 >> 8); in_ECX[5] = local_1c; local_8 = 2; if (local_20 != (int *)0x0) { cVar4 = (**(code **)(*local_20 + 0xc))(); if ((cVar4 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_24); } } ExceptionList = local_10; return; } //@@ 00a2add0 SoundInstance::assign /* DB: ? thiscall: resets (FUN_00a2ae60(0)), sets loop byte 0, volume 1.0, pan 0, pitch 1.0, binds the source param (FUN_008f2c90) and pushes loop/volume/pan/pitch to the voice via vfuncs +0x40/+0x48/+0x50/+0x58; SoundEffect::Load, SoundEffects::Play prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall SoundInstance::assign(void *this,void *source) { KAGE::SmartPointer::reset(0); *(undefined2 *)((int)this + 8) = 0; *(undefined1 *)((int)this + 10) = 0; *(undefined4 *)((int)this + 0xc) = 0x3f800000; *(undefined4 *)((int)this + 0x10) = 0; *(undefined4 *)((int)this + 0x14) = 0x3f800000; FUN_008f2c90(source); if (*(int **)this != (int *)0x0) { (**(code **)(**(int **)this + 0x40))(*(undefined1 *)((int)this + 8)); (**(code **)(**(int **)this + 0x48))(*(undefined4 *)((int)this + 0xc)); (**(code **)(**(int **)this + 0x50))(*(undefined4 *)((int)this + 0x10)); (**(code **)(**(int **)this + 0x58))(*(undefined4 *)((int)this + 0x14)); } return; } //@@ 00a2ae60 KAGE::SmartPointer::reset /* DB: thiscall (raw ptr): news ReferenceCount (0x18, ptr at +0x14), releases old refcount ECX[1] via vfunc +0xc / g_soundReleaseFn, stores ptr/refcount; same shape as 0040c7f0 KAGE::SmartPointer::reset SoundInstance::assign calls it with 0 */ void KAGE::SmartPointer::reset(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6694; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(); } } *in_ECX = param_1; in_ECX[1] = this; ExceptionList = local_10; return; } //@@ 00a2af00 FUN_00a2af00 void FUN_00a2af00(byte param_1) { void *in_ECX; FUN_00a2af30(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x34); } return; } //@@ 00a2af30 FUN_00a2af30 void FUN_00a2af30(void) { int *piVar1; LPCRITICAL_SECTION p_Var2; undefined4 *in_ECX; *in_ECX = KAGE::Sound::ManagerBase::vftable; p_Var2 = (LPCRITICAL_SECTION)in_ECX[0xc]; in_ECX[10] = KAGE::Mutex::vftable; if (p_Var2 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var2); operator_delete(p_Var2,0x1c); in_ECX[0xc] = 0; } *(byte *)(in_ECX + 0xb) = *(byte *)(in_ECX + 0xb) & 0xfe; in_ECX[10] = KAGE::MutexBase::vftable; FID_conflict__Tidy(in_ECX + 7); p_Var2 = (LPCRITICAL_SECTION)in_ECX[6]; in_ECX[4] = KAGE::Mutex::vftable; if (p_Var2 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var2); operator_delete(p_Var2,0x1c); in_ECX[6] = 0; } *(byte *)(in_ECX + 5) = *(byte *)(in_ECX + 5) & 0xfe; piVar1 = in_ECX + 2; in_ECX[4] = KAGE::MutexBase::vftable; FUN_00a2bcb0(piVar1,*(undefined4 *)(*piVar1 + 4)); operator_delete((void *)*piVar1,0x1c); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a2afd0 FUN_00a2afd0 undefined4 FUN_00a2afd0(void) { int in_ECX; (**(code **)(*(int *)(in_ECX + 0x10) + 4))(); (**(code **)(*(int *)(in_ECX + 0x28) + 4))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; g_soundReleaseFn = FUN_00a2bb10; return 1; } //@@ 00a2b000 FUN_00a2b000 void FUN_00a2b000(void) { int iVar1; int in_ECX; g_soundReleaseFn = (void *)0x0; iVar1 = *(int *)(in_ECX + 8); FUN_00a2bcb0(in_ECX + 8,*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0xc) = 0; (**(code **)(*(int *)(in_ECX + 0x10) + 8))(); (**(code **)(*(int *)(in_ECX + 0x28) + 8))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a2b050 FUN_00a2b050 /* WARNING: Removing unreachable block (ram,0x00a2b13d) */ /* WARNING: Removing unreachable block (ram,0x00a2b14c) */ /* WARNING: Removing unreachable block (ram,0x00a2b15c) */ /* WARNING: Removing unreachable block (ram,0x00a2b162) */ void FUN_00a2b050(void) { char cVar1; int in_ECX; undefined4 *puVar2; undefined4 *puVar3; undefined4 *local_28; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1209d; local_10 = ExceptionList; ExceptionList = &local_10; if (((*(uint *)(in_ECX + 4) & 1) != 0) && ((*(uint *)(in_ECX + 4) & 2) == 0)) { (**(code **)(*(int *)(in_ECX + 0x10) + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); (**(code **)(*(int *)(in_ECX + 0x28) + 0xc))(0xffffffff); puVar3 = (undefined4 *)0x0; local_28 = (undefined4 *)0x0; local_8 = 0; puVar2 = *(undefined4 **)(in_ECX + 0x1c); if (puVar2 != *(undefined4 **)(in_ECX + 0x20)) { do { cVar1 = (**(code **)(*(int *)*puVar2 + 0x74))(); if (cVar1 != '\0') { if (puVar3 == (undefined4 *)0x0) { std::vector<4byte>::_Emplace_reallocate(0,puVar2); puVar3 = local_28; } else { *puVar3 = *puVar2; local_28 = puVar3 + 1; puVar3 = local_28; } } puVar2 = puVar2 + 1; } while (puVar2 != *(undefined4 **)(in_ECX + 0x20)); } puVar2 = (undefined4 *)0x0; (**(code **)(*(int *)(in_ECX + 0x28) + 0x10))(); if (puVar3 != (undefined4 *)0x0) { do { (**(code **)(*(int *)*puVar2 + 0x3c))(); puVar2 = puVar2 + 1; } while (puVar2 != puVar3); } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a2b180 FUN_00a2b180 undefined4 FUN_00a2b180(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x24))(param_1,param_2,0,param_3); return param_1; } //@@ 00a2b1a0 FUN_00a2b1a0 undefined4 FUN_00a2b1a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; (**(code **)(*in_ECX + 0x24))(param_1,param_2,1,param_3); return param_1; } //@@ 00a2b1c0 FUN_00a2b1c0 void FUN_00a2b1c0(void) { int in_ECX; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 2; return; } //@@ 00a2b1d0 FUN_00a2b1d0 void FUN_00a2b1d0(void) { int in_ECX; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffd; return; } //@@ 00a2b1e0 SoundManager::load_sound /* DB: "Sound manager has not been initialized", picks the source by extension ".ogg"/".wav" ("Failed to load sound '%s'. Unknown sound source type"), "sample" vs "stream" (param_4), path hash via KAGE_Filesys_FileManager::GetPrimaryFilePathHash, "Failed to open %s \"%s\""; SoundEffect::Load, SoundEffects::Play prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall SoundManager::load_sound(void *this,void *outSound,byte *path,void *fileSource,byte isStream) { byte bVar1; code *pcVar2; void *pvVar3; int *piVar4; char cVar5; uint uVar6; ReferenceCountBase *pRVar7; char *pcVar8; undefined4 *puVar9; byte *pbVar10; undefined3 in_stack_00000011; int local_2c; undefined1 local_28 [4]; int *local_24; int *local_20; int *local_1c; void *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar3 = fileSource; local_8 = 0xffffffff; puStack_c = &LAB_00b12184; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; local_14 = 0; local_18 = this; if (((*(uint *)((int)this + 4) & 1) == 0) && (KAGE_LogMessage(0x10,(byte *)"Sound manager has not been initialized\n"), (*(uint *)((int)this + 4) & 1) == 0)) { *(undefined4 *)outSound = 0; *(undefined4 *)((int)outSound + 4) = 0; pRVar7 = operator_new(0x18); local_8 = 1; _isStream = pRVar7; if (pRVar7 == (ReferenceCountBase *)0x0) { pRVar7 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar7); *(undefined ***)pRVar7 = ReferenceCount::vftable; *(undefined4 *)(pRVar7 + 0x14) = 0; } local_8 = local_8 & 0xffffff00; if (((*(int **)((int)outSound + 4) != (int *)0x0) && (cVar5 = (**(code **)(**(int **)((int)outSound + 4) + 0xc))(), cVar5 != '\0')) && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(outSound); } *(ReferenceCountBase **)((int)outSound + 4) = pRVar7; *(undefined4 *)outSound = 0; ExceptionList = local_10; return outSound; } (**(code **)(*(int *)this + 0x28))(&local_20,path,fileSource,uVar6); local_8 = 2; fileSource = local_20; if (local_20 == (int *)0x0) { fileSource = (void *)0x0; } else if (isStream == 0) { FUN_008f2d20(&local_20); local_14 = 1; local_8 = 3; if (local_1c == (int *)0x0) { ExceptionList = local_10; return outSound; } cVar5 = (**(code **)(*local_1c + 0xc))(); if (cVar5 == '\0') { ExceptionList = local_10; return outSound; } if (g_soundReleaseFn == (void *)0x0) { ExceptionList = local_10; return outSound; } (*g_soundReleaseFn)(&local_20); ExceptionList = local_10; return outSound; } pcVar8 = strstr((char *)path,".wav"); if (pcVar8 == (char *)0x0) { pcVar8 = strstr((char *)path,".ogg"); if (pcVar8 == (char *)0x0) { pcVar8 = strstr((char *)path,".org"); if (pcVar8 == (char *)0x0) { KAGE_LogMessage(8,(byte *)"Failed to load sound \'%s\'. Unknown sound source type\n"); FUN_008f2d20(&local_20); FUN_007e2740(); ExceptionList = local_10; return outSound; } if (pvVar3 == (void *)0x0) { puVar9 = operator_new(0x4c); local_8._0_1_ = 0xb; if (puVar9 == (undefined4 *)0x0) goto LAB_00a2b5b3; FUN_00a9fa20(); puVar9[0x11] = 0; puVar9[0x12] = 0; *puVar9 = KAGE::Sound::SampleSourceOrg::vftable; } else { if (pvVar3 != (void *)0x1) goto LAB_00a2b5c2; puVar9 = operator_new(0x20740); local_8._0_1_ = 0xc; if (puVar9 == (undefined4 *)0x0) goto LAB_00a2b5b3; FUN_00aa0110(); *puVar9 = KAGE::Sound::StreamSourceOrg::vftable; puVar9[0x81cc] = 0; puVar9[0x81cd] = 0; memset(puVar9 + 0x25,0,0x2069c); puVar9[0x81ce] = 0; puVar9[0x81cf] = 0; } } else if (pvVar3 == (void *)0x0) { puVar9 = operator_new(0x58); local_8._0_1_ = 6; if (puVar9 == (undefined4 *)0x0) goto LAB_00a2b5b3; FUN_00a9fa20(); puVar9[0x11] = 0; puVar9[0x12] = 0; *puVar9 = KAGE::Sound::SampleSourceOgg::vftable; } else { if (pvVar3 != (void *)0x1) goto LAB_00a2b5c2; puVar9 = operator_new(0xc4); local_8._0_1_ = 7; if (puVar9 == (undefined4 *)0x0) goto LAB_00a2b5b3; FUN_00aa0110(); *puVar9 = KAGE::Sound::StreamSourceOgg::vftable; puVar9[0x25] = 0; *(undefined1 *)(puVar9 + 0x29) = 0; puVar9[0x28] = KAGE::Mutex::vftable; puVar9[0x2a] = 0; puVar9[0x2b] = 0; puVar9[0x2f] = 0; puVar9[0x30] = 0xf; *(undefined1 *)(puVar9 + 0x2b) = 0; local_8._0_1_ = 10; pcVar2 = *(code **)(puVar9[0x28] + 4); if (pcVar2 == FUN_00a15770) { FUN_00a15770(); puVar9[0x26] = 0; } else { (*pcVar2)(); puVar9[0x26] = 0; } } } else if (pvVar3 == (void *)0x0) { puVar9 = operator_new(100); local_8._0_1_ = 4; if (puVar9 == (undefined4 *)0x0) { LAB_00a2b5b3: puVar9 = (undefined4 *)0x0; } else { FUN_00a9fa20(); puVar9[0x11] = 0; puVar9[0x12] = 0; *puVar9 = KAGE::Sound::SampleSourceWav::vftable; puVar9[0x14] = 0; puVar9[0x13] = 0; } } else { if (pvVar3 != (void *)0x1) goto LAB_00a2b5c2; puVar9 = operator_new(0xa8); local_8._0_1_ = 5; if (puVar9 == (undefined4 *)0x0) goto LAB_00a2b5b3; FUN_00aa0110(); *puVar9 = KAGE::Sound::StreamSourceWav::vftable; } local_8 = CONCAT31(local_8._1_3_,2); KAGE::SmartPointer::reset(puVar9); LAB_00a2b5c2: if ((((isStream == 0) || (fileSource == (void *)0x0)) || ((pvVar3 != (void *)0x0 || (cVar5 = (**(code **)(*(int *)fileSource + 0x20))(local_20), cVar5 == '\0')))) && (cVar5 = (**(code **)(*local_20 + 0x1c))(path), cVar5 == '\0')) { KAGE::SmartPointer::reset(0); KAGE_LogMessage(1,(byte *)"Failed to open %s \"%s\"\n"); } else { local_20[1] = (int)pvVar3; if (path == (byte *)0x0) { pcVar8 = (char *)0x0; } else { pbVar10 = path; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); pcVar8 = operator_new_tracked((uint)(pbVar10 + (1 - (int)(path + 1)))); pbVar10 = path; do { bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; } while (bVar1 != 0); strncpy(pcVar8,(char *)path,(size_t)(pbVar10 + (1 - (int)(path + 1)))); } piVar4 = local_20; local_20[3] = (int)pcVar8; uVar6 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash((byte *)local_20[3]); pvVar3 = local_18; piVar4[4] = uVar6; (**(code **)(*(int *)((int)local_18 + 0x10) + 0xc))(0xffffffff); local_2c = local_20[4]; FUN_008f2d20(&local_20); local_8._0_1_ = 0xd; FUN_00a2bd60(&isStream,&local_2c); local_8._0_1_ = 0xe; if (((local_24 != (int *)0x0) && (cVar5 = (**(code **)(*local_24 + 0xc))(), cVar5 != '\0')) && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_28); } local_8 = CONCAT31(local_8._1_3_,2); (**(code **)(*(int *)((int)pvVar3 + 0x10) + 0x10))(); } FUN_008f2d20(&local_20); local_14 = 1; local_8 = 0xf; if (((local_1c == (int *)0x0) || (cVar5 = (**(code **)(*local_1c + 0xc))(), cVar5 == '\0')) || (g_soundReleaseFn == (void *)0x0)) { ExceptionList = local_10; return outSound; } (*g_soundReleaseFn)(&local_20); ExceptionList = local_10; return outSound; } //@@ 00a2b780 FUN_00a2b780 void FUN_00a2b780(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 8) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 8) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(in_ECX + 4); } } ExceptionList = local_10; return; } //@@ 00a2b7f0 FUN_00a2b7f0 undefined4 FUN_00a2b7f0(undefined4 param_1,ReferenceCountBase *param_2) { char cVar1; undefined4 *puVar2; ReferenceCountBase *pRVar3; int in_ECX; uint uVar4; uint uVar5; undefined1 local_28 [4]; int *local_24; undefined4 local_20; ReferenceCountBase *local_1c; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1220f; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = 0; (**(code **)(*(int *)(in_ECX + 0x10) + 0xc)) (0xffffffff,__security_cookie ^ (uint)(local_28 + 0x24)); param_2 = (ReferenceCountBase *)KAGE_Filesys_FileManager::GetPrimaryFilePathHash((byte *)param_2); FUN_00a12280(&local_18,¶m_2); (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); if (local_18 == *(int *)(in_ECX + 8)) { local_20 = 0; local_1c = (ReferenceCountBase *)0x0; pRVar3 = operator_new(0x18); local_8 = 2; param_2 = pRVar3; if (pRVar3 == (ReferenceCountBase *)0x0) { pRVar3 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar3); *(undefined ***)pRVar3 = ReferenceCount::vftable; *(undefined4 *)(pRVar3 + 0x14) = 0; } local_8 = CONCAT31(local_8._1_3_,1); if (local_1c != (ReferenceCountBase *)0x0) { cVar1 = (**(code **)(*(int *)local_1c + 0xc))(); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(&local_20); } } local_20 = 0; puVar2 = &local_20; local_8 = 3; uVar4 = 2; local_1c = pRVar3; } else { puVar2 = (undefined4 *)FUN_008f2d20(local_18 + 0x14); local_8 = 1; uVar4 = 1; } local_14 = uVar4; FUN_008f2d20(puVar2); uVar5 = uVar4 | 4; if ((uVar4 & 2) != 0) { uVar5 = uVar4 & 0xfffffffd | 4; local_8 = 4; if (local_1c != (ReferenceCountBase *)0x0) { local_14 = uVar5; cVar1 = (**(code **)(*(int *)local_1c + 0xc))(); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(&local_20); } } } if ((uVar5 & 1) != 0) { local_14 = uVar5 & 0xfffffffe; local_8 = 5; if (local_24 != (int *)0x0) { cVar1 = (**(code **)(*local_24 + 0xc))(); if ((cVar1 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(local_28); } } } ExceptionList = local_10; return param_1; } //@@ 00a2b990 FUN_00a2b990 void FUN_00a2b990(void *param_1) { char cVar1; uint uVar2; void *pvVar3; int in_ECX; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((*(byte *)(in_ECX + 4) & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Sound manager has not been initialized\n"); } pvVar3 = param_1; if (param_1 != (void *)0x0) { (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff,uVar2); local_14 = *(undefined4 *)((int)pvVar3 + 0x10); FUN_00a12280(¶m_1,&local_14); if (param_1 != *(void **)(in_ECX + 8)) { do { if (*(int *)((int)*(void **)((int)param_1 + 0x14) + 0x10) != *(int *)((int)pvVar3 + 0x10)) break; if (*(void **)((int)param_1 + 0x14) == pvVar3) { pvVar3 = std_tree_extract((void *)(in_ECX + 8),param_1); local_8 = 0; if (((*(int **)((int)pvVar3 + 0x18) != (int *)0x0) && (cVar1 = (**(code **)(**(int **)((int)pvVar3 + 0x18) + 0xc))(), cVar1 != '\0')) && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)((int)pvVar3 + 0x14); } local_8 = 0xffffffff; operator_delete(pvVar3,0x1c); break; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } while (param_1 != *(void **)(in_ECX + 8)); } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a2ba90 FUN_00a2ba90 void FUN_00a2ba90(int param_1) { int *_Src; int *_Dst; (**(code **)(DAT_00c5aac8 + 0xc))(0xffffffff); if (DAT_00c5aabc != DAT_00c5aac0) { _Dst = DAT_00c5aabc; while (_Src = _Dst + 1, *_Dst != param_1) { _Dst = _Src; if (_Src == DAT_00c5aac0) { (**(code **)(DAT_00c5aac8 + 0x10))(); return; } } memmove(_Dst,_Src,(int)DAT_00c5aac0 - (int)_Src); DAT_00c5aac0 = DAT_00c5aac0 + -1; } (**(code **)(DAT_00c5aac8 + 0x10))(); return; } //@@ 00a2bb10 FUN_00a2bb10 void FUN_00a2bb10(int *param_1) { short sVar1; int iVar2; int iVar3; int *piVar4; char cVar5; void *ptr; uint uVar6; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = param_1[1]; if (iVar2 != 0) { (**(code **)(*(int *)(iVar2 + 8) + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); sVar1 = *(short *)(iVar2 + 4); (**(code **)(*(int *)(iVar2 + 8) + 0x10))(); if (sVar1 == 1) { iVar2 = *param_1; if (iVar2 != 0) { uVar6 = 0; do { iVar3 = *(int *)(uVar6 + 8 + DAT_00c5aadc); if (iVar3 == iVar2) { *(undefined4 *)(iVar3 + 0x34) = 0; *(undefined4 *)(uVar6 + 8 + DAT_00c5aadc) = 0; alSourceStop(*(undefined4 *)(uVar6 + DAT_00c5aadc)); alSourcei(*(undefined4 *)(uVar6 + DAT_00c5aadc),0x1009,0); } uVar6 = uVar6 + 0xc; } while (uVar6 < 0x300); } if ((DAT_00c5aaa4 & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Sound manager has not been initialized\n"); } if (iVar2 != 0) { (**(code **)(DAT_00c5aab0 + 0xc))(0xffffffff); local_14 = *(undefined4 *)(iVar2 + 0x10); FUN_00a12280(¶m_1,&local_14); piVar4 = DAT_00c5aaa8; while( true ) { if ((param_1 == piVar4) || (*(int *)(param_1[5] + 0x10) != *(int *)(iVar2 + 0x10))) goto LAB_00a2bc80; if (param_1[5] == iVar2) break; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } ptr = std_tree_extract(&DAT_00c5aaa8,param_1); local_8 = 0; if (((*(int **)((int)ptr + 0x18) != (int *)0x0) && (cVar5 = (**(code **)(**(int **)((int)ptr + 0x18) + 0xc))(), cVar5 != '\0')) && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)((int)ptr + 0x14); } local_8 = 0xffffffff; operator_delete(ptr,0x1c); LAB_00a2bc80: (**(code **)(DAT_00c5aab0 + 0x10))(); } } } ExceptionList = local_10; return; } //@@ 00a2bcb0 FUN_00a2bcb0 void FUN_00a2bcb0(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { FUN_00a2bcb0(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[6] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[6] + 0xc))(uVar4), cVar3 != '\0')) && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(param_2 + 5); } local_8 = 0xffffffff; operator_delete(param_2,0x1c); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 00a2bd60 FUN_00a2bd60 void FUN_00a2bd60(undefined4 *param_1,undefined4 param_2) { undefined4 local_10 [3]; FUN_00a2bd90(local_10,param_2); *param_1 = local_10[0]; return; } //@@ 00a2bd90 FUN_00a2bd90 void FUN_00a2bd90(undefined4 *param_1,int *param_2) { char cVar1; int iVar2; int *piVar3; uint uVar4; int *piVar5; int *piVar6; int *in_ECX; int *piVar7; int *piVar8; bool bVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1227d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar2 = *in_ECX; local_8 = 0; piVar5 = operator_new(0x1c); local_8 = 1; piVar5[4] = *param_2; FUN_008f2d20(param_2 + 1); *piVar5 = iVar2; piVar5[1] = iVar2; piVar5[2] = iVar2; *(undefined2 *)(piVar5 + 3) = 0; local_8 = 2; bVar9 = false; piVar3 = (int *)*in_ECX; piVar8 = (int *)piVar3[1]; if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar6 = piVar8; do { piVar8 = piVar6; bVar9 = (uint)piVar5[4] < (uint)piVar8[4]; if (bVar9) { piVar6 = (int *)*piVar8; } else { piVar6 = (int *)piVar8[2]; } } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } in_ECX[1] = in_ECX[1] + 1; piVar5[1] = (int)piVar8; if (piVar8 == piVar3) { *piVar3 = (int)piVar5; piVar3[1] = (int)piVar5; piVar3[2] = (int)piVar5; *(undefined1 *)(piVar5 + 3) = 1; } else { if (bVar9) { *piVar8 = (int)piVar5; if (piVar8 == (int *)*piVar3) { *piVar3 = (int)piVar5; } } else { piVar8[2] = (int)piVar5; if (piVar8 == (int *)piVar3[2]) { piVar3[2] = (int)piVar5; } } cVar1 = *(char *)(piVar5[1] + 0xc); piVar8 = piVar5; while (cVar1 == '\0') { piVar6 = (int *)piVar8[1]; piVar7 = *(int **)piVar6[1]; if (piVar6 == piVar7) { piVar7 = (int *)((undefined4 *)piVar6[1])[2]; if ((char)piVar7[3] == '\0') { LAB_00a2beda: *(undefined1 *)(piVar6 + 3) = 1; *(undefined1 *)(piVar7 + 3) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; piVar8 = *(int **)(piVar8[1] + 4); } else { if (piVar8 == (int *)piVar6[2]) { FUN_00415fe0(piVar6); piVar8 = piVar6; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar8[1] + 4)); } } else { if ((char)piVar7[3] == '\0') goto LAB_00a2beda; if (piVar8 == (int *)*piVar6) { FUN_00415f80(piVar6); piVar8 = piVar6; } *(undefined1 *)(piVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar8[1] + 4)); } cVar1 = *(char *)(piVar8[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = piVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a2bf60 sound_entry_ptr_destroy /* DB: ? releases the SoundSourceBase SmartPointer at (+4)->+0x14/+0x18 (g_soundReleaseFn) and deletes the 0x1c-byte object at +4; only reached from an unwind funclet */ void sound_entry_ptr_destroy(void) { int iVar1; char cVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *(int *)(in_ECX + 4); if (iVar1 != 0) { local_8 = 0; if (*(int **)(iVar1 + 0x18) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar1 + 0x18) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar2 != '\0') && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)(iVar1 + 0x14); } } } if (*(void **)(in_ECX + 4) != (void *)0x0) { operator_delete(*(void **)(in_ECX + 4),0x1c); } ExceptionList = local_10; return; } //@@ 00a2bfe0 utf8_decode_next /* DB: ECX = UTF-8 pointer, EDX = out codepoint, param_1 = end: ASCII fast path, lead-byte length table (decompiler shows it as an offset into an unrelated string), validates continuation ranges, returns pointer past the char; Font::render_glyph_quads, online_chat_text_input prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte * __cdecl utf8_decode_next(byte *text,uint *outCodepoint,byte *end) { byte bVar1; byte bVar2; bool bVar3; byte *pbVar4; int iVar5; uint uVar6; byte bVar7; byte *pbVar8; uint uVar9; bVar1 = *text; uVar6 = (uint)bVar1; if (bVar1 < 0x7f) { *outCodepoint = uVar6; return text + 1; } if (end == (byte *)0x0) { pbVar8 = text; do { end = pbVar8; pbVar8 = end + 1; } while (*end != 0); } bVar7 = bVar1; if (bVar1 < 0xc0) { uVar9 = 0; pbVar8 = text; goto LAB_00a2c120; } uVar9 = (uint)(byte)"Sound manager has not been initialized\n"[bVar1 + 0x20]; pbVar8 = text + uVar9; pbVar4 = text + (byte)"Sound manager has not been initialized\n"[bVar1 + 0x20] + 1; switch((uint)(byte)"Sound manager has not been initialized\n"[bVar1 + 0x20]) { case 0: switchD_00a2c061_caseD_0: LAB_00a2c120: if (0x41 < (byte)(bVar7 + 0x80)) { bVar3 = bVar7 < 0xf5; goto LAB_00a2c081; } goto LAB_00a2c07f; case 1: LAB_00a2c0be: bVar7 = (byte)uVar6; bVar2 = pbVar4[-1]; if (0x3f < (byte)(bVar2 + 0x80)) break; switch(uVar6 & 0xff) { case 0xe0: if (0x9f < bVar2) goto LAB_00a2c120; break; default: goto switchD_00a2c061_caseD_0; case 0xed: if (bVar2 < 0xa0) goto LAB_00a2c120; break; case 0xf0: if (0x8f < bVar2) goto LAB_00a2c120; break; case 0xf4: if (bVar2 < 0x90) goto LAB_00a2c120; } goto LAB_00a2c07f; case 2: LAB_00a2c0a9: bVar7 = pbVar4[-1]; uVar6 = (uint)CONCAT11(bVar7,bVar1); pbVar4 = pbVar4 + -1; if ((0x7f < bVar7) && (bVar7 < 0xc0)) goto LAB_00a2c0be; break; case 3: pbVar4 = pbVar4 + -1; if ((0x7f < *pbVar4) && (*pbVar4 < 0xc0)) goto LAB_00a2c0a9; } LAB_00a2c07f: bVar3 = false; LAB_00a2c081: if ((end <= pbVar8) || (!bVar3)) { *outCodepoint = 0; if (pbVar8 < end) { end = pbVar8 + 1; } return end; } iVar5 = 0; switch(uVar9) { case 5: text = text + 1; iVar5 = (uint)bVar1 << 6; case 4: bVar1 = *text; text = text + 1; iVar5 = (iVar5 + (uint)bVar1) * 0x40; case 3: bVar1 = *text; text = text + 1; iVar5 = (iVar5 + (uint)bVar1) * 0x40; case 2: bVar1 = *text; text = text + 1; iVar5 = (iVar5 + (uint)bVar1) * 0x40; case 1: bVar1 = *text; text = text + 1; iVar5 = (iVar5 + (uint)bVar1) * 0x40; case 0: bVar1 = *text; text = text + 1; iVar5 = iVar5 + (uint)bVar1; } uVar6 = iVar5 - (&DAT_00b9c570)[uVar9]; if (0xffff < uVar6) { if (uVar6 < 0x110000) { *(ushort *)((int)outCodepoint + 2) = ((ushort)uVar6 & 0x33f) + 0xdc00; *(short *)outCodepoint = (short)(uVar6 >> 10) + -0x2800; return text; } *outCodepoint = 0xfffd; return text; } if ((uVar6 < 0xd800) || (0xdbff < uVar6)) { *outCodepoint = uVar6 & 0xffff; return text; } *outCodepoint = 0xfffd; return text; } //@@ 00a2c250 text_convert_encoding /* DB: ECX=src text, EDX=len, (srcEnc, dst, dstCap, dstEnc): FUN_00a2c6e0 converts into a temp vector, encoding 0=1 byte 1=2 bytes else "Unknown encoding specified", copies min(cap-1) and NUL-terminates, returns char count; PlayerHUD::RenderPocketItems calls (0,buf,0x65,1) UTF-8 -> UTF-16 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ uint __cdecl text_convert_encoding (byte *text,int length,int srcEncoding,void *dst,int dstCapacity,int dstEncoding) { void *pvVar1; uint uVar2; uint _Size; void *ptr; uint _Size_00; void *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b122ad; local_10 = ExceptionList; if (text == (byte *)0x0) { return 0; } local_1c = (void *)0x0; local_18 = 0; local_14 = 0; local_8 = 0; ExceptionList = &local_10; text_convert_encoding_to_vector (srcEncoding,&local_1c,dstEncoding,__security_cookie ^ (int)register0x00000010 - 4U); if (dstEncoding == 0) { _Size_00 = 1; } else if (dstEncoding == 1) { _Size_00 = 2; } else { KAGE_LogMessage(0x10,(byte *)"Unknown encoding specified\n"); _Size_00 = 0; } pvVar1 = local_1c; uVar2 = (dstCapacity + -1) * _Size_00; _Size = local_18 - (int)local_1c; if (uVar2 < (uint)(local_18 - (int)local_1c)) { _Size = uVar2; } if (_Size != 0) { memcpy(dst,local_1c,_Size); } memset((void *)((int)dst + _Size),0,_Size_00); if (pvVar1 != (void *)0x0) { uVar2 = local_14 - (int)pvVar1; ptr = pvVar1; if (0xfff < uVar2) { ptr = *(void **)((int)pvVar1 + -4); uVar2 = uVar2 + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } ExceptionList = local_10; return _Size / _Size_00; } //@@ 00a2c370 utf8_to_utf16_alloc /* DB: ? ECX = char*; converts into a temporary ushort vector, allocates (operator_new_tracked) and copies it with a 16-bit terminator, returns the wide buffer (null for null input); HUD::ShowItemText, HUD::show_fortune_text_impl feed the result to Font::get_string_width_utf16-style wide text paths prototype: db/protos.zhl */ short * __fastcall utf8_to_utf16_alloc(byte *text) { byte bVar1; short *_Dst; void *ptr; uint size; void *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b122ad; local_10 = ExceptionList; ExceptionList = &local_10; if (text == (byte *)0x0) { _Dst = (short *)0x0; } else { do { bVar1 = *text; text = text + 1; } while (bVar1 != 0); local_1c = (void *)0x0; local_18 = 0; local_14 = 0; local_8 = 0; text_convert_encoding_to_vector(0,&local_1c,1,__security_cookie ^ (int)register0x00000010 - 4U); _Dst = operator_new_tracked((local_18 - (int)local_1c) + 2); if (local_18 - (int)local_1c != 0) { memcpy(_Dst,local_1c,local_18 - (int)local_1c); } *(undefined2 *)((int)_Dst + (local_18 - (int)local_1c)) = 0; if (local_1c != (void *)0x0) { size = local_14 - (int)local_1c; ptr = local_1c; if (0xfff < size) { ptr = *(void **)((int)local_1c + -4); size = size + 0x23; if (0x1f < (uint)((int)local_1c + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); ExceptionList = local_10; return _Dst; } } ExceptionList = local_10; return _Dst; } //@@ 00a2c470 FUN_00a2c470 void FUN_00a2c470(byte *param_1,uint param_2,int param_3) { undefined1 *puVar1; uint uVar2; int iVar3; undefined1 uVar4; byte *end; byte *text; end = param_1 + param_2; param_2 = 0; text = utf8_decode_next(param_1,¶m_2,end); iVar3 = param_3; uVar2 = param_2; while (uVar2 != 0) { puVar1 = *(undefined1 **)(iVar3 + 4); param_1 = (byte *)CONCAT13((char)uVar2,param_1._0_3_); param_2 = uVar2; if (puVar1 == *(undefined1 **)(iVar3 + 8)) { FUN_00a2c8b0(puVar1,(int)¶m_1 + 3); } else { *puVar1 = (char)uVar2; *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1; } puVar1 = *(undefined1 **)(iVar3 + 4); uVar4 = (undefined1)(uVar2 >> 8); param_1 = (byte *)CONCAT13(uVar4,param_1._0_3_); if (puVar1 == *(undefined1 **)(iVar3 + 8)) { FUN_00a2c8b0(puVar1,(int)¶m_1 + 3); } else { *puVar1 = uVar4; *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1; } if ((short)(uVar2 >> 0x10) != 0) { puVar1 = *(undefined1 **)(iVar3 + 4); uVar4 = (undefined1)(uVar2 >> 0x10); param_1 = (byte *)CONCAT13(uVar4,param_1._0_3_); if (puVar1 == *(undefined1 **)(iVar3 + 8)) { FUN_00a2c8b0(puVar1,(int)¶m_1 + 3); } else { *puVar1 = uVar4; *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1; } puVar1 = *(undefined1 **)(iVar3 + 4); uVar4 = (undefined1)(uVar2 >> 0x18); param_1 = (byte *)CONCAT13(uVar4,param_1._0_3_); if (puVar1 == *(undefined1 **)(iVar3 + 8)) { FUN_00a2c8b0(puVar1,(int)¶m_1 + 3); } else { *puVar1 = uVar4; *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1; } } text = utf8_decode_next(text,¶m_2,end); uVar2 = param_2; } return; } //@@ 00a2c570 FUN_00a2c570 void FUN_00a2c570(ushort *param_1,int param_2,int *param_3) { ushort uVar1; void *_Dst; uint uVar2; size_t _Size; uint uVar3; if (param_1 + param_2 <= param_1) { return; } uVar3 = (uint)*param_1; if (uVar3 - 0xd800 < 0x400) { if (param_1 + param_2 <= param_1 + 1) { return; } uVar1 = param_1[1]; if ((ushort)(uVar1 + 0x2400) < 0x400) { uVar3 = uVar3 * 0x400 + -0x35fdc00 + (uint)uVar1; } } if (uVar3 < 0x80) { param_2 = 1; _Size = 1; } else if (uVar3 < 0x800) { param_2 = 2; _Size = 2; } else if ((uVar3 < 0x10000) || (0x10ffff < uVar3)) { _Size = 3; param_2 = 3; } else { param_2 = 4; _Size = 4; } _Dst = (void *)param_3[1]; uVar3 = (int)_Dst - *param_3; uVar2 = uVar3 + _Size; if (uVar2 < uVar3) { param_3[1] = *param_3 + uVar2; } else if (uVar3 < uVar2) { if ((uint)(param_3[2] - *param_3) < uVar2) { FUN_007dedb0(uVar2,_Size); } else { memset(_Dst,0,_Size); param_3[1] = (int)_Dst + _Size; } } /* WARNING: Could not recover jumptable at 0x00a2c680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)(&PTR_LAB_00a2c6cc)[param_2 + -1])(); return; } //@@ 00a2c6e0 text_convert_encoding_to_vector /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: (srcEnc, out vector, dstEnc), ECX src, EDX length: same encoding memcpy, else dispatch table of converters (FUN_00a2c470/00a2c570); "Unknown encoding specified"; text_convert_encoding, utf8_to_utf16_alloc */ void text_convert_encoding_to_vector(int param_1,int *param_2,int param_3) { uint uVar1; void *in_ECX; int in_EDX; int iVar2; uint local_18; code *local_14; code *local_10; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (param_1 == param_3) { if (param_1 == 0) { iVar2 = 1; } else if (param_1 == 1) { iVar2 = 2; } else { KAGE_LogMessage(0x10,(byte *)"Unknown encoding specified\n"); iVar2 = 0; } FUN_007dccd0(iVar2 * in_EDX); memcpy((void *)*param_2,in_ECX,iVar2 * in_EDX); } local_18 = 0; local_14 = FUN_00a2c470; local_10 = FUN_00a2c570; local_c = 0; if ((param_1 != 0) && (param_1 != 1)) { KAGE_LogMessage(0x10,(byte *)"Unknown encoding specified\n"); } if ((param_3 != 0) && (param_3 != 1)) { KAGE_LogMessage(0x10,(byte *)"Unknown encoding specified\n"); } uVar1 = __ftoui3(); if ((uint)(param_2[2] - *param_2) < uVar1) { if (0x7fffffff < uVar1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_00a2c860(uVar1); } (*(code *)(&local_18)[param_3 + param_1 * 2])(in_ECX,in_EDX,param_2); return; } //@@ 00a2c860 FUN_00a2c860 void FUN_00a2c860(uint param_1) { int iVar1; int iVar2; void *_Dst; int *in_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; _Dst = std::_Allocate(param_1); memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); FUN_007df050(_Dst,iVar1 - iVar2,param_1); return; } //@@ 00a2c8b0 FUN_00a2c8b0 undefined1 * FUN_00a2c8b0(void *param_1,undefined1 *param_2) { int iVar1; uint uVar2; void *_Dst; undefined1 *puVar3; int *in_ECX; uint uVar4; iVar1 = *in_ECX; if (in_ECX[1] - iVar1 == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = (in_ECX[1] - iVar1) + 1; uVar4 = in_ECX[2] - iVar1; if (0x7fffffff - (uVar4 >> 1) < uVar4) { uVar4 = 0x7fffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; if (uVar4 < uVar2) { uVar4 = uVar2; } } _Dst = std::_Allocate(uVar4); puVar3 = (undefined1 *)(((int)param_1 - iVar1) + (int)_Dst); *puVar3 = *param_2; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); } else { memmove(_Dst,(void *)*in_ECX,(int)param_1 - *in_ECX); memmove(puVar3 + 1,param_1,in_ECX[1] - (int)param_1); } FUN_007df050(_Dst,uVar2,uVar4); return puVar3; } //@@ 00a2c8bc FUN_00a2c8bc int FUN_00a2c8bc(void) { int in_EAX; void *_Dst; undefined1 *puVar1; int *in_ECX; uint uVar2; void *unaff_EBX; int iVar3; int unaff_EBP; iVar3 = *in_ECX; *(int *)(unaff_EBP + 8) = in_EAX - iVar3; if (in_ECX[1] - iVar3 == 0x7fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar2 = in_ECX[2] - iVar3; *(int *)(unaff_EBP + -4) = (in_ECX[1] - iVar3) + 1; if (0x7fffffff - (uVar2 >> 1) < uVar2) { uVar2 = 0x7fffffff; } else { uVar2 = (uVar2 >> 1) + uVar2; if (uVar2 < *(uint *)(unaff_EBP + -4)) { uVar2 = *(uint *)(unaff_EBP + -4); } } _Dst = std::_Allocate(uVar2); puVar1 = (undefined1 *)(*(int *)(unaff_EBP + 8) + (int)_Dst); *(void **)(unaff_EBP + -8) = _Dst; *(undefined1 **)(unaff_EBP + 8) = puVar1; *puVar1 = **(undefined1 **)(unaff_EBP + 0xc); if (unaff_EBX == (void *)in_ECX[1]) { memmove(_Dst,(void *)*in_ECX,in_ECX[1] - *in_ECX); iVar3 = *(int *)(unaff_EBP + 8); } else { memmove(_Dst,(void *)*in_ECX,(int)unaff_EBX - *in_ECX); iVar3 = *(int *)(unaff_EBP + 8); memmove((void *)(iVar3 + 1),unaff_EBX,in_ECX[1] - (int)unaff_EBX); } FUN_007df050(*(undefined4 *)(unaff_EBP + -8),*(undefined4 *)(unaff_EBP + -4),uVar2); return iVar3; } //@@ 00a2c980 FUN_00a2c980 void FUN_00a2c980(void) { undefined4 *puVar1; void *in_ECX; int iVar2; iVar2 = 0x10; puVar1 = (undefined4 *)((int)in_ECX + 0x10); do { puVar1[-2] = 0; puVar1[-3] = 0; *puVar1 = 0; puVar1[-1] = 0; puVar1[2] = 0; puVar1[1] = 0; iVar2 = iVar2 + -1; puVar1 = puVar1 + 10; } while (iVar2 != 0); *(undefined4 *)((int)in_ECX + 0x280) = 0; memset(in_ECX,0,0x280); return; } //@@ 00a2ca10 FUN_00a2ca10 /* WARNING: Type propagation algorithm not settling */ void FUN_00a2ca10(int param_1) { ushort uVar1; char cVar2; char *pcVar3; int iVar4; undefined4 uVar5; FARPROC pFVar6; int *in_EDX; undefined4 unaff_ESI; int iVar7; bool bVar8; iVar7 = 0; for (iVar4 = *in_EDX; iVar4 != 0; iVar4 = in_EDX[iVar4]) { /* WARNING: Could not find normalized switch variable to match jumptable */ switch(iVar4) { case 0: goto LAB_00a3032b; case 1: if (((g_epoxyBeginCount != 0) || (pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0)) || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) goto LAB_00a2ca6f; goto LAB_00a3031e; case 2: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 10 < iVar4)))))) goto LAB_00a2ca6f; goto LAB_00a3031e; case 3: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0xb < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 4: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0xc < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 5: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0xd < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 6: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0xe < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 7: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x13 < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 8: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x14 < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 9: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x1d < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 10: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x1e < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0xb: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x1f < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0xc: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x20 < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0xd: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x27 < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0xe: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x28 < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0xf: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x29 < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0x10: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x2a < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0x11: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x2b < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0x12: if ((g_epoxyBeginCount != 0) || (((pcVar3 = (char *)(*(code *)epoxy_glGetString)(0x1f02), pcVar3 == (char *)0x0 || (iVar4 = strncmp("OpenGL ES",pcVar3,9), iVar4 != 0)) && ((g_epoxyBeginCount != 0 || (iVar4 = epoxy_internal_gl_version(), 0x2c < iVar4)))))) goto code_r0x00a2cb28; goto LAB_00a3031e; case 0x13: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x16: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x17: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x18: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x19: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x1a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x1b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x1c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x1d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x1e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x1f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x20: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x21: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x22: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x23: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x24: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x25: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x26: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x27: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x28: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x29: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x2a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x2b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x2c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x2d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x2e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x2f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x30: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x31: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x32: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x33: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x34: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x35: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x36: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x37: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x38: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x39: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x3a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x3b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x3c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x3d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x3e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x3f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x40: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x41: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x42: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x43: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x44: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x45: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x46: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x47: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x48: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x49: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x4a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x4b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x4c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x4d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x4e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x4f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x50: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x51: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x52: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x53: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x54: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x55: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x56: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x57: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x58: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x59: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x5a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x5b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x5c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x5d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x5e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x5f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x60: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x61: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x62: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 99: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 100: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x65: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x66: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x67: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x68: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x69: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x6a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x6b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x6c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x6d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x6e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x6f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x70: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x71: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x72: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x73: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x74: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x75: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x76: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x77: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x78: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x79: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x7a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x7b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x7c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x7d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x7e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x7f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x80: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x81: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x82: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x83: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x84: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x85: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x86: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x87: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x88: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x89: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x8a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x8b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x8c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x8d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x8e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x8f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x90: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x91: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x92: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x93: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x94: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x95: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x96: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x97: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x98: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x99: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x9a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x9b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x9c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x9d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x9e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x9f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa0: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa1: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa2: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa3: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa4: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa5: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa6: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa7: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa8: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xa9: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xaa: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xab: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xac: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xad: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xae: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xaf: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb0: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb1: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb2: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb3: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb4: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb5: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb6: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb7: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb8: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xb9: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xba: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xbb: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xbc: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xbd: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xbe: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xbf: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc0: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc1: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc2: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc3: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc4: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc5: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc6: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 199: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 200: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xc9: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xca: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xcb: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xcc: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xcd: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xce: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xcf: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd0: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd1: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd2: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd3: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd4: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd5: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd6: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd7: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd8: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xd9: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xda: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xdb: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xdc: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xdd: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xde: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xdf: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe0: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe1: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe2: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe3: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe4: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe5: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe6: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe7: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe8: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xe9: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xea: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xeb: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xec: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xed: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xee: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xef: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf0: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf1: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf2: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf3: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf4: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf5: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf6: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf7: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf8: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xf9: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xfa: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xfb: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xfc: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xfd: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xfe: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0xff: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x100: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x101: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x102: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x103: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x104: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x105: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x106: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x107: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x108: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x109: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x10a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x10b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x10c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x10d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x10e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x10f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x110: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x111: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x112: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x113: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x114: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x115: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x116: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x117: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x118: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x119: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x11a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x11b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x11c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x11d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x11e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x11f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x120: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x121: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x122: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x123: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x124: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x125: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x126: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x127: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x128: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x129: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x12a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 299: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 300: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x12d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x12e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x12f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x130: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x131: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x132: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x133: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x134: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x135: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x136: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x137: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x138: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x139: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x13a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x13b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x13c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x13d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x13e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x13f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x140: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x141: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x142: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x143: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x144: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x145: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x146: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x147: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x148: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x149: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x14f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x150: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x151: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x152: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x153: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x154: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x155: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x156: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x157: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x158: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x159: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15a: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15b: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15c: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15d: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15e: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x15f: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x160: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x161: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x162: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x163: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x164: if (g_epoxyBeginCount != 0) goto code_r0x00a2cb28; cVar2 = epoxy_internal_has_gl_extension(); break; case 0x165: cVar2 = epoxy_is_desktop_gl(); if (((cVar2 == '\0') && (iVar4 = epoxy_internal_gl_version(), 9 < iVar4)) && (iVar4 = epoxy_internal_gl_version(), iVar4 < 0x14)) { FUN_00a624c0("glAccum" + *(ushort *)(param_1 + iVar7 * 2),1); return; } goto LAB_00a3031e; case 0x166: cVar2 = epoxy_is_desktop_gl(); if ((cVar2 == '\0') && (iVar4 = epoxy_internal_gl_version(), 0x13 < iVar4)) { FUN_00a624c0("glAccum" + *(ushort *)(param_1 + iVar7 * 2),1); return; } goto LAB_00a3031e; case 0x167: cVar2 = epoxy_is_desktop_gl(); if (cVar2 == '\0') { iVar4 = epoxy_internal_gl_version(); bVar8 = SBORROW4(iVar4,0x1e); iVar4 = iVar4 + -0x1e; code_r0x00a3031c: if (bVar8 == iVar4 < 0) { uVar1 = *(ushort *)(param_1 + iVar7 * 2); if (pHRam00c7de68 == (HMODULE)0x0) { if (DAT_00c7ac6a == '\0') { uVar5 = __acrt_iob_func(2,"Attempting to dlopen() while in the dynamic linker.\n", unaff_ESI); FUN_008c5d50(uVar5); /* WARNING: Subroutine does not return */ abort(); } pHRam00c7de68 = LoadLibraryA("libGLESv2.so.2"); if (pHRam00c7de68 == (HMODULE)0x0) goto code_r0x00a627c3; } pFVar6 = GetProcAddress(pHRam00c7de68,"glAccum" + uVar1); if (pFVar6 != (FARPROC)0x0) { return; } code_r0x00a627c3: (*(code *)epoxy_wglGetProcAddress)("glAccum" + uVar1); return; } } goto LAB_00a3031e; case 0x168: cVar2 = epoxy_is_desktop_gl(); if (cVar2 == '\0') { iVar4 = epoxy_internal_gl_version(); bVar8 = SBORROW4(iVar4,0x1f); iVar4 = iVar4 + -0x1f; goto code_r0x00a3031c; } goto LAB_00a3031e; case 0x169: LAB_00a2ca6f: FUN_00a624c0("glAccum" + *(ushort *)(param_1 + iVar7 * 2),1); return; default: goto LAB_00a3031e; } if (cVar2 != '\0') { code_r0x00a2cb28: (*(code *)epoxy_wglGetProcAddress)("glAccum" + *(ushort *)(param_1 + iVar7 * 2)); return; } LAB_00a3031e: iVar4 = iVar7 + 1; iVar7 = iVar7 + 1; } LAB_00a3032b: /* WARNING: Subroutine does not return */ /* WARNING: This code block may not be properly labeled as switch case */ abort(); } //@@ 00a308f0 FUN_00a308f0 void FUN_00a308f0(void) { undefined1 local_8 [4]; FUN_00a2ca10(local_8); return; } //@@ 00a30920 FUN_00a30920 void FUN_00a30920(undefined4 param_1,undefined4 param_2) { epoxy_glAccum = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glAccum)(param_1,param_2); return; } //@@ 00a30950 FUN_00a30950 void FUN_00a30950(void) { epoxy_glAccumxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30968. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAccumxOES)(); return; } //@@ 00a30970 FUN_00a30970 void FUN_00a30970(void) { epoxy_glActiveProgramEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30988. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveProgramEXT)(); return; } //@@ 00a30990 FUN_00a30990 void FUN_00a30990(void) { epoxy_glActiveShaderProgram = (undefined *)FUN_00a2ca10(&DAT_00b3da3c); /* WARNING: Could not recover jumptable at 0x00a309b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveShaderProgram)(); return; } //@@ 00a309c0 FUN_00a309c0 void FUN_00a309c0(void) { epoxy_glActiveShaderProgramEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a309d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveShaderProgramEXT)(); return; } //@@ 00a309e0 FUN_00a309e0 void FUN_00a309e0(void) { epoxy_glActiveStencilFaceEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a309f6. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveStencilFaceEXT)(); return; } //@@ 00a30a00 FUN_00a30a00 void FUN_00a30a00(void) { epoxy_glActiveTexture = (undefined *)FUN_00a2ca10(&DAT_00b3da78); /* WARNING: Could not recover jumptable at 0x00a30a20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveTexture)(); return; } //@@ 00a30a30 FUN_00a30a30 void FUN_00a30a30(void) { epoxy_glActiveTextureARB = (undefined *)FUN_00a2ca10(&DAT_00b2b178); /* WARNING: Could not recover jumptable at 0x00a30a50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveTextureARB)(); return; } //@@ 00a30a60 FUN_00a30a60 void FUN_00a30a60(void) { epoxy_glActiveVaryingNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30a78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glActiveVaryingNV)(); return; } //@@ 00a30a80 FUN_00a30a80 void FUN_00a30a80(void) { epoxy_glAlphaFragmentOp1ATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30a96. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAlphaFragmentOp1ATI)(); return; } //@@ 00a30aa0 FUN_00a30aa0 void FUN_00a30aa0(void) { epoxy_glAlphaFragmentOp2ATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30ab6. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAlphaFragmentOp2ATI)(); return; } //@@ 00a30ac0 FUN_00a30ac0 void FUN_00a30ac0(void) { epoxy_glAlphaFragmentOp3ATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30ad6. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAlphaFragmentOp3ATI)(); return; } //@@ 00a30ae0 FUN_00a30ae0 void FUN_00a30ae0(undefined4 param_1,undefined4 param_2) { epoxy_glAlphaFunc = (undefined *)FUN_00a2ca10(FUN_00b3c6f0); (*(code *)epoxy_glAlphaFunc)(param_1,param_2); return; } //@@ 00a30b10 FUN_00a30b10 void FUN_00a30b10(undefined4 param_1,undefined4 param_2) { epoxy_glAlphaFuncQCOM = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glAlphaFuncQCOM)(param_1,param_2); return; } //@@ 00a30b40 FUN_00a30b40 void FUN_00a30b40(void) { epoxy_glAlphaFuncx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30b56. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAlphaFuncx)(); return; } //@@ 00a30b60 FUN_00a30b60 void FUN_00a30b60(void) { epoxy_glAlphaFuncxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30b76. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAlphaFuncxOES)(); return; } //@@ 00a30b80 FUN_00a30b80 void FUN_00a30b80(void) { epoxy_glApplyTextureEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30b96. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glApplyTextureEXT)(); return; } //@@ 00a30ba0 FUN_00a30ba0 void FUN_00a30ba0(void) { epoxy_glAreProgramsResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30bb6. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAreProgramsResidentNV)(); return; } //@@ 00a30bc0 FUN_00a30bc0 void FUN_00a30bc0(void) { epoxy_glAreTexturesResident = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAreTexturesResident)(); return; } //@@ 00a30be0 FUN_00a30be0 void FUN_00a30be0(void) { epoxy_glAreTexturesResidentEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30bf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAreTexturesResidentEXT)(); return; } //@@ 00a30c00 FUN_00a30c00 void FUN_00a30c00(void) { epoxy_glArrayElement = (undefined *)FUN_00a2ca10(&DAT_00b3cdd4); /* WARNING: Could not recover jumptable at 0x00a30c20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glArrayElement)(); return; } //@@ 00a30c30 FUN_00a30c30 void FUN_00a30c30(void) { epoxy_glArrayElementEXT = (undefined *)FUN_00a2ca10(&DAT_00b28324); /* WARNING: Could not recover jumptable at 0x00a30c50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glArrayElementEXT)(); return; } //@@ 00a30c60 FUN_00a30c60 void FUN_00a30c60(void) { epoxy_glArrayObjectATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30c78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glArrayObjectATI)(); return; } //@@ 00a30c80 FUN_00a30c80 void FUN_00a30c80(void) { epoxy_glAsyncMarkerSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30c96. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAsyncMarkerSGIX)(); return; } //@@ 00a30ca0 FUN_00a30ca0 void FUN_00a30ca0(void) { epoxy_glAttachObjectARB = (undefined *)FUN_00a2ca10(&DAT_00b267a8); /* WARNING: Could not recover jumptable at 0x00a30cc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAttachObjectARB)(); return; } //@@ 00a30cd0 FUN_00a30cd0 void FUN_00a30cd0(void) { epoxy_glAttachShader = (undefined *)FUN_00a2ca10(&DAT_00b28e48); /* WARNING: Could not recover jumptable at 0x00a30cf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glAttachShader)(); return; } //@@ 00a30d00 FUN_00a30d00 void FUN_00a30d00(void) { PTR_FUN_00c0feb0 = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c0feb0)(); return; } //@@ 00a30d20 FUN_00a30d20 void FUN_00a30d20(void) { epoxy_glBeginConditionalRender = (undefined *)FUN_00a2ca10(&DAT_00b3ca08); /* WARNING: Could not recover jumptable at 0x00a30d40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginConditionalRender)(); return; } //@@ 00a30d50 FUN_00a30d50 void FUN_00a30d50(void) { epoxy_glBeginConditionalRenderNV = (undefined *)FUN_00a2ca10(0xb3c6c0); /* WARNING: Could not recover jumptable at 0x00a30d70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginConditionalRenderNV)(); return; } //@@ 00a30d80 FUN_00a30d80 void FUN_00a30d80(void) { epoxy_glBeginConditionalRenderNVX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30d98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginConditionalRenderNVX)(); return; } //@@ 00a30dc0 FUN_00a30dc0 void FUN_00a30dc0(void) { epoxy_glBeginOcclusionQueryNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginOcclusionQueryNV)(); return; } //@@ 00a30de0 FUN_00a30de0 void FUN_00a30de0(void) { epoxy_glBeginPerfMonitorAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginPerfMonitorAMD)(); return; } //@@ 00a30e00 FUN_00a30e00 void FUN_00a30e00(void) { epoxy_glBeginPerfQueryINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30e18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginPerfQueryINTEL)(); return; } //@@ 00a30e20 FUN_00a30e20 void FUN_00a30e20(void) { epoxy_glBeginQuery = (undefined *)FUN_00a2ca10(&DAT_00b270fc); /* WARNING: Could not recover jumptable at 0x00a30e40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginQuery)(); return; } //@@ 00a30e50 FUN_00a30e50 void FUN_00a30e50(void) { epoxy_glBeginQueryARB = (undefined *)FUN_00a2ca10(&DAT_00b29f04); /* WARNING: Could not recover jumptable at 0x00a30e70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginQueryARB)(); return; } //@@ 00a30e80 FUN_00a30e80 void FUN_00a30e80(void) { epoxy_glBeginQueryEXT = (undefined *)FUN_00a2ca10(&DAT_00b281b4); /* WARNING: Could not recover jumptable at 0x00a30ea0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginQueryEXT)(); return; } //@@ 00a30eb0 FUN_00a30eb0 void FUN_00a30eb0(void) { epoxy_glBeginQueryIndexed = (undefined *)FUN_00a2ca10(&DAT_00b29b84); /* WARNING: Could not recover jumptable at 0x00a30ed0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginQueryIndexed)(); return; } //@@ 00a30ee0 FUN_00a30ee0 void FUN_00a30ee0(void) { epoxy_glBeginTransformFeedback = (undefined *)FUN_00a2ca10(&DAT_00b3b958); /* WARNING: Could not recover jumptable at 0x00a30f00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginTransformFeedback)(); return; } //@@ 00a30f10 FUN_00a30f10 void FUN_00a30f10(void) { epoxy_glBeginTransformFeedbackEXT = (undefined *)FUN_00a2ca10(&DAT_00b27344); /* WARNING: Could not recover jumptable at 0x00a30f30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginTransformFeedbackEXT)(); return; } //@@ 00a30f40 FUN_00a30f40 void FUN_00a30f40(void) { epoxy_glBeginTransformFeedbackNV = (undefined *)FUN_00a2ca10(&DAT_00b3b054); /* WARNING: Could not recover jumptable at 0x00a30f60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginTransformFeedbackNV)(); return; } //@@ 00a30f90 FUN_00a30f90 void FUN_00a30f90(void) { epoxy_glBeginVideoCaptureNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a30fa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBeginVideoCaptureNV)(); return; } //@@ 00a30fb0 FUN_00a30fb0 void FUN_00a30fb0(void) { epoxy_glBindAttribLocation = (undefined *)FUN_00a2ca10(&DAT_00b3cfbc); /* WARNING: Could not recover jumptable at 0x00a30fd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindAttribLocation)(); return; } //@@ 00a30fe0 FUN_00a30fe0 void FUN_00a30fe0(void) { epoxy_glBindAttribLocationARB = (undefined *)FUN_00a2ca10(&DAT_00b3c440); /* WARNING: Could not recover jumptable at 0x00a31000. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindAttribLocationARB)(); return; } //@@ 00a31010 FUN_00a31010 void FUN_00a31010(void) { epoxy_glBindBuffer = (undefined *)FUN_00a2ca10(&DAT_00b2935c); /* WARNING: Could not recover jumptable at 0x00a31030. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBuffer)(); return; } //@@ 00a31040 FUN_00a31040 void FUN_00a31040(void) { epoxy_glBindBufferARB = (undefined *)FUN_00a2ca10(&DAT_00b28eb8); /* WARNING: Could not recover jumptable at 0x00a31060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferARB)(); return; } //@@ 00a31070 FUN_00a31070 void FUN_00a31070(void) { epoxy_glBindBufferBase = (undefined *)FUN_00a2ca10(&DAT_00b3c100); /* WARNING: Could not recover jumptable at 0x00a31090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferBase)(); return; } //@@ 00a310a0 FUN_00a310a0 void FUN_00a310a0(void) { epoxy_glBindBufferBaseEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a9f0); /* WARNING: Could not recover jumptable at 0x00a310c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferBaseEXT)(); return; } //@@ 00a310d0 FUN_00a310d0 void FUN_00a310d0(void) { epoxy_glBindBufferBaseNV = (undefined *)FUN_00a2ca10(&DAT_00b3b5a4); /* WARNING: Could not recover jumptable at 0x00a310f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferBaseNV)(); return; } //@@ 00a31100 FUN_00a31100 void FUN_00a31100(void) { epoxy_glBindBufferOffsetEXT = (undefined *)FUN_00a2ca10(&DAT_00b29510); /* WARNING: Could not recover jumptable at 0x00a31120. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferOffsetEXT)(); return; } //@@ 00a31130 FUN_00a31130 void FUN_00a31130(void) { epoxy_glBindBufferOffsetNV = (undefined *)FUN_00a2ca10(&DAT_00b26700); /* WARNING: Could not recover jumptable at 0x00a31150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferOffsetNV)(); return; } //@@ 00a31160 FUN_00a31160 void FUN_00a31160(void) { epoxy_glBindBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b27290); /* WARNING: Could not recover jumptable at 0x00a31180. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferRange)(); return; } //@@ 00a31190 FUN_00a31190 void FUN_00a31190(void) { epoxy_glBindBufferRangeEXT = (undefined *)FUN_00a2ca10(&DAT_00b29b94); /* WARNING: Could not recover jumptable at 0x00a311b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferRangeEXT)(); return; } //@@ 00a311c0 FUN_00a311c0 void FUN_00a311c0(void) { epoxy_glBindBufferRangeNV = (undefined *)FUN_00a2ca10(&DAT_00b2a5ac); /* WARNING: Could not recover jumptable at 0x00a311e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBufferRangeNV)(); return; } //@@ 00a311f0 FUN_00a311f0 void FUN_00a311f0(void) { epoxy_glBindBuffersBase = (undefined *)FUN_00a2ca10(&DAT_00b2a888); /* WARNING: Could not recover jumptable at 0x00a31210. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBuffersBase)(); return; } //@@ 00a31220 FUN_00a31220 void FUN_00a31220(void) { epoxy_glBindBuffersRange = (undefined *)FUN_00a2ca10(&DAT_00b288b0); /* WARNING: Could not recover jumptable at 0x00a31240. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindBuffersRange)(); return; } //@@ 00a31250 FUN_00a31250 void FUN_00a31250(void) { epoxy_glBindFragDataLocation = (undefined *)FUN_00a2ca10(&DAT_00b2a870); /* WARNING: Could not recover jumptable at 0x00a31270. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFragDataLocation)(); return; } //@@ 00a31280 FUN_00a31280 void FUN_00a31280(void) { epoxy_glBindFragDataLocationEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b6d8); /* WARNING: Could not recover jumptable at 0x00a312a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFragDataLocationEXT)(); return; } //@@ 00a312b0 FUN_00a312b0 void FUN_00a312b0(void) { epoxy_glBindFragDataLocationIndexed = (undefined *)FUN_00a2ca10(&DAT_00b3d6c0); /* WARNING: Could not recover jumptable at 0x00a312d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFragDataLocationIndexed)(); return; } //@@ 00a312e0 FUN_00a312e0 void FUN_00a312e0(void) { epoxy_glBindFragmentShaderATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a312f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFragmentShaderATI)(); return; } //@@ 00a31300 FUN_00a31300 void FUN_00a31300(void) { epoxy_glBindFramebuffer = (undefined *)FUN_00a2ca10(&DAT_00b25a30); /* WARNING: Could not recover jumptable at 0x00a31320. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFramebuffer)(); return; } //@@ 00a31330 FUN_00a31330 void FUN_00a31330(void) { epoxy_glBindFramebufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b2ac88); /* WARNING: Could not recover jumptable at 0x00a31350. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFramebufferEXT)(); return; } //@@ 00a31360 FUN_00a31360 void FUN_00a31360(void) { epoxy_glBindFramebufferOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindFramebufferOES)(); return; } //@@ 00a31380 FUN_00a31380 void FUN_00a31380(void) { epoxy_glBindImageTexture = (undefined *)FUN_00a2ca10(&DAT_00b27144); /* WARNING: Could not recover jumptable at 0x00a313a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindImageTexture)(); return; } //@@ 00a313b0 FUN_00a313b0 void FUN_00a313b0(void) { epoxy_glBindImageTextureEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a313c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindImageTextureEXT)(); return; } //@@ 00a313d0 FUN_00a313d0 void FUN_00a313d0(void) { epoxy_glBindImageTextures = (undefined *)FUN_00a2ca10(&DAT_00b290c4); /* WARNING: Could not recover jumptable at 0x00a313f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindImageTextures)(); return; } //@@ 00a31400 FUN_00a31400 void FUN_00a31400(void) { epoxy_glBindLightParameterEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindLightParameterEXT)(); return; } //@@ 00a31420 FUN_00a31420 void FUN_00a31420(void) { epoxy_glBindMaterialParameterEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31438. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindMaterialParameterEXT)(); return; } //@@ 00a31440 FUN_00a31440 void FUN_00a31440(void) { epoxy_glBindMultiTextureEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31458. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindMultiTextureEXT)(); return; } //@@ 00a31460 FUN_00a31460 void FUN_00a31460(void) { epoxy_glBindParameterEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31478. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindParameterEXT)(); return; } //@@ 00a31480 FUN_00a31480 void FUN_00a31480(void) { epoxy_glBindProgramARB = (undefined *)FUN_00a2ca10(&DAT_00b28d80); /* WARNING: Could not recover jumptable at 0x00a314a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindProgramARB)(); return; } //@@ 00a314b0 FUN_00a314b0 void FUN_00a314b0(void) { epoxy_glBindProgramNV = (undefined *)FUN_00a2ca10(&DAT_00b3d018); /* WARNING: Could not recover jumptable at 0x00a314d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindProgramNV)(); return; } //@@ 00a314e0 FUN_00a314e0 void FUN_00a314e0(void) { epoxy_glBindProgramPipeline = (undefined *)FUN_00a2ca10(&DAT_00b27f18); /* WARNING: Could not recover jumptable at 0x00a31500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindProgramPipeline)(); return; } //@@ 00a31510 FUN_00a31510 void FUN_00a31510(void) { epoxy_glBindProgramPipelineEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindProgramPipelineEXT)(); return; } //@@ 00a31530 FUN_00a31530 void FUN_00a31530(void) { epoxy_glBindRenderbuffer = (undefined *)FUN_00a2ca10(&DAT_00b3c908); /* WARNING: Could not recover jumptable at 0x00a31550. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindRenderbuffer)(); return; } //@@ 00a31560 FUN_00a31560 void FUN_00a31560(void) { epoxy_glBindRenderbufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b261dc); /* WARNING: Could not recover jumptable at 0x00a31580. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindRenderbufferEXT)(); return; } //@@ 00a31590 FUN_00a31590 void FUN_00a31590(void) { epoxy_glBindRenderbufferOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a315a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindRenderbufferOES)(); return; } //@@ 00a315b0 FUN_00a315b0 void FUN_00a315b0(void) { epoxy_glBindSampler = (undefined *)FUN_00a2ca10(&DAT_00b3cb30); /* WARNING: Could not recover jumptable at 0x00a315d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindSampler)(); return; } //@@ 00a315e0 FUN_00a315e0 void FUN_00a315e0(void) { epoxy_glBindSamplers = (undefined *)FUN_00a2ca10(&DAT_00b3c734); /* WARNING: Could not recover jumptable at 0x00a31600. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindSamplers)(); return; } //@@ 00a31610 FUN_00a31610 void FUN_00a31610(void) { epoxy_glBindTexGenParameterEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTexGenParameterEXT)(); return; } //@@ 00a31630 FUN_00a31630 void FUN_00a31630(void) { epoxy_glBindTexture = (undefined *)FUN_00a2ca10(&DAT_00b29574); /* WARNING: Could not recover jumptable at 0x00a31650. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTexture)(); return; } //@@ 00a31660 FUN_00a31660 void FUN_00a31660(void) { epoxy_glBindTextureEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d6c8); /* WARNING: Could not recover jumptable at 0x00a31680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTextureEXT)(); return; } //@@ 00a31690 FUN_00a31690 void FUN_00a31690(void) { epoxy_glBindTextureUnit = (undefined *)FUN_00a2ca10(&DAT_00b28c64); /* WARNING: Could not recover jumptable at 0x00a316b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTextureUnit)(); return; } //@@ 00a316c0 FUN_00a316c0 void FUN_00a316c0(void) { epoxy_glBindTextureUnitParameterEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a316d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTextureUnitParameterEXT)(); return; } //@@ 00a316e0 FUN_00a316e0 void FUN_00a316e0(void) { epoxy_glBindTextures = (undefined *)FUN_00a2ca10(&DAT_00b3b8fc); /* WARNING: Could not recover jumptable at 0x00a31700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTextures)(); return; } //@@ 00a31710 FUN_00a31710 void FUN_00a31710(void) { epoxy_glBindTransformFeedback = (undefined *)FUN_00a2ca10(&DAT_00b3bb14); /* WARNING: Could not recover jumptable at 0x00a31730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTransformFeedback)(); return; } //@@ 00a31740 FUN_00a31740 void FUN_00a31740(void) { epoxy_glBindTransformFeedbackNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindTransformFeedbackNV)(); return; } //@@ 00a31760 FUN_00a31760 void FUN_00a31760(void) { epoxy_glBindVertexArray = (undefined *)FUN_00a2ca10(&DAT_00b3c94c); /* WARNING: Could not recover jumptable at 0x00a31780. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVertexArray)(); return; } //@@ 00a31790 FUN_00a31790 void FUN_00a31790(void) { epoxy_glBindVertexArrayAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b262b8); /* WARNING: Could not recover jumptable at 0x00a317b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVertexArrayAPPLE)(); return; } //@@ 00a317c0 FUN_00a317c0 void FUN_00a317c0(void) { epoxy_glBindVertexArrayOES = (undefined *)FUN_00a2ca10(&DAT_00b25e24); /* WARNING: Could not recover jumptable at 0x00a317e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVertexArrayOES)(); return; } //@@ 00a317f0 FUN_00a317f0 void FUN_00a317f0(void) { epoxy_glBindVertexBuffer = (undefined *)FUN_00a2ca10(&DAT_00b26648); /* WARNING: Could not recover jumptable at 0x00a31810. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVertexBuffer)(); return; } //@@ 00a31820 FUN_00a31820 void FUN_00a31820(void) { epoxy_glBindVertexBuffers = (undefined *)FUN_00a2ca10(&DAT_00b2806c); /* WARNING: Could not recover jumptable at 0x00a31840. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVertexBuffers)(); return; } //@@ 00a31850 FUN_00a31850 void FUN_00a31850(void) { epoxy_glBindVertexShaderEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVertexShaderEXT)(); return; } //@@ 00a31870 FUN_00a31870 void FUN_00a31870(void) { epoxy_glBindVideoCaptureStreamBufferNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVideoCaptureStreamBufferNV)(); return; } //@@ 00a31890 FUN_00a31890 void FUN_00a31890(void) { epoxy_glBindVideoCaptureStreamTextureNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a318a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBindVideoCaptureStreamTextureNV)(); return; } //@@ 00a318b0 FUN_00a318b0 void FUN_00a318b0(void) { epoxy_glBinormal3bEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a318c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3bEXT)(); return; } //@@ 00a318d0 FUN_00a318d0 void FUN_00a318d0(void) { epoxy_glBinormal3bvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a318e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3bvEXT)(); return; } //@@ 00a318f0 FUN_00a318f0 void FUN_00a318f0(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glBinormal3dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glBinormal3dEXT)(param_1,param_2,param_3); return; } //@@ 00a31940 FUN_00a31940 void FUN_00a31940(void) { epoxy_glBinormal3dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31958. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3dvEXT)(); return; } //@@ 00a31960 FUN_00a31960 void FUN_00a31960(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glBinormal3fEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glBinormal3fEXT)(param_1,param_2,param_3); return; } //@@ 00a319a0 FUN_00a319a0 void FUN_00a319a0(void) { epoxy_glBinormal3fvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a319b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3fvEXT)(); return; } //@@ 00a319c0 FUN_00a319c0 void FUN_00a319c0(void) { epoxy_glBinormal3iEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a319d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3iEXT)(); return; } //@@ 00a319e0 FUN_00a319e0 void FUN_00a319e0(void) { epoxy_glBinormal3ivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a319f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3ivEXT)(); return; } //@@ 00a31a00 FUN_00a31a00 void FUN_00a31a00(void) { epoxy_glBinormal3sEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31a18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3sEXT)(); return; } //@@ 00a31a20 FUN_00a31a20 void FUN_00a31a20(void) { epoxy_glBinormal3svEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31a38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormal3svEXT)(); return; } //@@ 00a31a40 FUN_00a31a40 void FUN_00a31a40(void) { epoxy_glBinormalPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31a58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBinormalPointerEXT)(); return; } //@@ 00a31a60 FUN_00a31a60 void FUN_00a31a60(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glBitmap = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glBitmap)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a31ac0 FUN_00a31ac0 void FUN_00a31ac0(void) { epoxy_glBitmapxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31ad8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBitmapxOES)(); return; } //@@ 00a31b20 FUN_00a31b20 void FUN_00a31b20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glBlendColor = (undefined *)FUN_00a2ca10(&DAT_00b28844); (*(code *)epoxy_glBlendColor)(param_1,param_2,param_3,param_4); return; } //@@ 00a31b70 FUN_00a31b70 void FUN_00a31b70(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glBlendColorEXT = (undefined *)FUN_00a2ca10(&DAT_00b28cac); (*(code *)epoxy_glBlendColorEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a31bc0 FUN_00a31bc0 void FUN_00a31bc0(void) { epoxy_glBlendColorxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendColorxOES)(); return; } //@@ 00a31be0 FUN_00a31be0 void FUN_00a31be0(void) { epoxy_glBlendEquation = (undefined *)FUN_00a2ca10(&DAT_00b2acb0); /* WARNING: Could not recover jumptable at 0x00a31c00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquation)(); return; } //@@ 00a31c10 FUN_00a31c10 void FUN_00a31c10(void) { epoxy_glBlendEquationEXT = (undefined *)FUN_00a2ca10(&DAT_00b27004); /* WARNING: Could not recover jumptable at 0x00a31c30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationEXT)(); return; } //@@ 00a31c40 FUN_00a31c40 void FUN_00a31c40(void) { epoxy_glBlendEquationIndexedAMD = (undefined *)FUN_00a2ca10(&DAT_00b2691c); /* WARNING: Could not recover jumptable at 0x00a31c60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationIndexedAMD)(); return; } //@@ 00a31c70 FUN_00a31c70 void FUN_00a31c70(void) { epoxy_glBlendEquationOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31c88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationOES)(); return; } //@@ 00a31c90 FUN_00a31c90 void FUN_00a31c90(void) { epoxy_glBlendEquationSeparate = (undefined *)FUN_00a2ca10(&DAT_00b277b0); /* WARNING: Could not recover jumptable at 0x00a31cb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparate)(); return; } //@@ 00a31cc0 FUN_00a31cc0 void FUN_00a31cc0(void) { epoxy_glBlendEquationSeparateEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d094); /* WARNING: Could not recover jumptable at 0x00a31ce0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparateEXT)(); return; } //@@ 00a31cf0 FUN_00a31cf0 void FUN_00a31cf0(void) { epoxy_glBlendEquationSeparateIndexedAMD = (undefined *)FUN_00a2ca10(&DAT_00b26574); /* WARNING: Could not recover jumptable at 0x00a31d10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparateIndexedAMD)(); return; } //@@ 00a31d20 FUN_00a31d20 void FUN_00a31d20(void) { epoxy_glBlendEquationSeparateOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31d38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparateOES)(); return; } //@@ 00a31d40 FUN_00a31d40 void FUN_00a31d40(void) { epoxy_glBlendEquationSeparatei = (undefined *)FUN_00a2ca10(&DAT_00b3c024); /* WARNING: Could not recover jumptable at 0x00a31d60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparatei)(); return; } //@@ 00a31d70 FUN_00a31d70 void FUN_00a31d70(void) { epoxy_glBlendEquationSeparateiARB = (undefined *)FUN_00a2ca10(&DAT_00b3c9cc); /* WARNING: Could not recover jumptable at 0x00a31d90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparateiARB)(); return; } //@@ 00a31da0 FUN_00a31da0 void FUN_00a31da0(void) { epoxy_glBlendEquationSeparateiEXT = (undefined *)FUN_00a2ca10(&DAT_00b2556c); /* WARNING: Could not recover jumptable at 0x00a31dc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparateiEXT)(); return; } //@@ 00a31dd0 FUN_00a31dd0 void FUN_00a31dd0(void) { epoxy_glBlendEquationSeparateiOES = (undefined *)FUN_00a2ca10(&DAT_00b2b26c); /* WARNING: Could not recover jumptable at 0x00a31df0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationSeparateiOES)(); return; } //@@ 00a31e00 FUN_00a31e00 void FUN_00a31e00(void) { epoxy_glBlendEquationi = (undefined *)FUN_00a2ca10(&DAT_00b26af4); /* WARNING: Could not recover jumptable at 0x00a31e20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationi)(); return; } //@@ 00a31e30 FUN_00a31e30 void FUN_00a31e30(void) { epoxy_glBlendEquationiARB = (undefined *)FUN_00a2ca10(&DAT_00b3b9a8); /* WARNING: Could not recover jumptable at 0x00a31e50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationiARB)(); return; } //@@ 00a31e60 FUN_00a31e60 void FUN_00a31e60(void) { epoxy_glBlendEquationiEXT = (undefined *)FUN_00a2ca10(&DAT_00b25a54); /* WARNING: Could not recover jumptable at 0x00a31e80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationiEXT)(); return; } //@@ 00a31e90 FUN_00a31e90 void FUN_00a31e90(void) { epoxy_glBlendEquationiOES = (undefined *)FUN_00a2ca10(&DAT_00b255ec); /* WARNING: Could not recover jumptable at 0x00a31eb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendEquationiOES)(); return; } //@@ 00a31ec0 FUN_00a31ec0 void FUN_00a31ec0(void) { epoxy_glBlendFunc = (undefined *)FUN_00a2ca10("E\nE\nE\n"); /* WARNING: Could not recover jumptable at 0x00a31ee0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFunc)(); return; } //@@ 00a31ef0 FUN_00a31ef0 void FUN_00a31ef0(void) { epoxy_glBlendFuncIndexedAMD = (undefined *)FUN_00a2ca10(&DAT_00b3d738); /* WARNING: Could not recover jumptable at 0x00a31f10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncIndexedAMD)(); return; } //@@ 00a31f20 FUN_00a31f20 void FUN_00a31f20(void) { epoxy_glBlendFuncSeparate = (undefined *)FUN_00a2ca10(&DAT_00b3d2f8); /* WARNING: Could not recover jumptable at 0x00a31f40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparate)(); return; } //@@ 00a31f50 FUN_00a31f50 void FUN_00a31f50(void) { epoxy_glBlendFuncSeparateEXT = (undefined *)FUN_00a2ca10(&DAT_00b29d44); /* WARNING: Could not recover jumptable at 0x00a31f70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateEXT)(); return; } //@@ 00a31f80 FUN_00a31f80 void FUN_00a31f80(void) { epoxy_glBlendFuncSeparateINGR = (undefined *)FUN_00a2ca10(&DAT_00b3ba6c); /* WARNING: Could not recover jumptable at 0x00a31fa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateINGR)(); return; } //@@ 00a31fb0 FUN_00a31fb0 void FUN_00a31fb0(void) { epoxy_glBlendFuncSeparateIndexedAMD = (undefined *)FUN_00a2ca10(&DAT_00b2ab5c); /* WARNING: Could not recover jumptable at 0x00a31fd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateIndexedAMD)(); return; } //@@ 00a31fe0 FUN_00a31fe0 void FUN_00a31fe0(void) { epoxy_glBlendFuncSeparateOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a31ff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateOES)(); return; } //@@ 00a32000 FUN_00a32000 void FUN_00a32000(void) { epoxy_glBlendFuncSeparatei = (undefined *)FUN_00a2ca10(&DAT_00b2731c); /* WARNING: Could not recover jumptable at 0x00a32020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparatei)(); return; } //@@ 00a32030 FUN_00a32030 void FUN_00a32030(void) { epoxy_glBlendFuncSeparateiARB = (undefined *)FUN_00a2ca10(&DAT_00b3bf10); /* WARNING: Could not recover jumptable at 0x00a32050. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateiARB)(); return; } //@@ 00a32060 FUN_00a32060 void FUN_00a32060(void) { epoxy_glBlendFuncSeparateiEXT = (undefined *)FUN_00a2ca10(&DAT_00b25920); /* WARNING: Could not recover jumptable at 0x00a32080. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateiEXT)(); return; } //@@ 00a32090 FUN_00a32090 void FUN_00a32090(void) { epoxy_glBlendFuncSeparateiOES = (undefined *)FUN_00a2ca10(&DAT_00b3d260); /* WARNING: Could not recover jumptable at 0x00a320b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFuncSeparateiOES)(); return; } //@@ 00a320c0 FUN_00a320c0 void FUN_00a320c0(void) { epoxy_glBlendFunci = (undefined *)FUN_00a2ca10(&DAT_00b28864); /* WARNING: Could not recover jumptable at 0x00a320e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFunci)(); return; } //@@ 00a320f0 FUN_00a320f0 void FUN_00a320f0(void) { epoxy_glBlendFunciARB = (undefined *)FUN_00a2ca10(&DAT_00b27234); /* WARNING: Could not recover jumptable at 0x00a32110. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFunciARB)(); return; } //@@ 00a32120 FUN_00a32120 void FUN_00a32120(void) { epoxy_glBlendFunciEXT = (undefined *)FUN_00a2ca10(&DAT_00b2b03c); /* WARNING: Could not recover jumptable at 0x00a32140. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFunciEXT)(); return; } //@@ 00a32150 FUN_00a32150 void FUN_00a32150(void) { epoxy_glBlendFunciOES = (undefined *)FUN_00a2ca10(&DAT_00b26a44); /* WARNING: Could not recover jumptable at 0x00a32170. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendFunciOES)(); return; } //@@ 00a32180 FUN_00a32180 void FUN_00a32180(void) { epoxy_glBlendParameteriNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32198. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlendParameteriNV)(); return; } //@@ 00a321a0 FUN_00a321a0 void FUN_00a321a0(void) { epoxy_glBlitFramebuffer = (undefined *)FUN_00a2ca10(&DAT_00b29084); /* WARNING: Could not recover jumptable at 0x00a321c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlitFramebuffer)(); return; } //@@ 00a321d0 FUN_00a321d0 void FUN_00a321d0(void) { epoxy_glBlitFramebufferANGLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a321e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlitFramebufferANGLE)(); return; } //@@ 00a321f0 FUN_00a321f0 void FUN_00a321f0(void) { epoxy_glBlitFramebufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a704); /* WARNING: Could not recover jumptable at 0x00a32210. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlitFramebufferEXT)(); return; } //@@ 00a32220 FUN_00a32220 void FUN_00a32220(void) { epoxy_glBlitFramebufferNV = (undefined *)FUN_00a2ca10(&DAT_00b3c784); /* WARNING: Could not recover jumptable at 0x00a32240. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlitFramebufferNV)(); return; } //@@ 00a32250 FUN_00a32250 void FUN_00a32250(void) { epoxy_glBlitNamedFramebuffer = (undefined *)FUN_00a2ca10(&DAT_00b29154); /* WARNING: Could not recover jumptable at 0x00a32270. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBlitNamedFramebuffer)(); return; } //@@ 00a32280 FUN_00a32280 void FUN_00a32280(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glBufferAddressRangeNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glBufferAddressRangeNV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a322b0 FUN_00a322b0 void FUN_00a322b0(void) { epoxy_glBufferData = (undefined *)FUN_00a2ca10(&DAT_00b28ee4); /* WARNING: Could not recover jumptable at 0x00a322d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferData)(); return; } //@@ 00a322e0 FUN_00a322e0 void FUN_00a322e0(void) { epoxy_glBufferDataARB = (undefined *)FUN_00a2ca10(&DAT_00b26734); /* WARNING: Could not recover jumptable at 0x00a32300. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferDataARB)(); return; } //@@ 00a32310 FUN_00a32310 void FUN_00a32310(void) { epoxy_glBufferPageCommitmentARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferPageCommitmentARB)(); return; } //@@ 00a32330 FUN_00a32330 void FUN_00a32330(void) { epoxy_glBufferParameteriAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferParameteriAPPLE)(); return; } //@@ 00a32350 FUN_00a32350 void FUN_00a32350(void) { epoxy_glBufferStorage = (undefined *)FUN_00a2ca10(&DAT_00b26378); /* WARNING: Could not recover jumptable at 0x00a32370. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferStorage)(); return; } //@@ 00a32380 FUN_00a32380 void FUN_00a32380(void) { epoxy_glBufferStorageEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d53c); /* WARNING: Could not recover jumptable at 0x00a323a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferStorageEXT)(); return; } //@@ 00a323b0 FUN_00a323b0 void FUN_00a323b0(void) { epoxy_glBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b27654); /* WARNING: Could not recover jumptable at 0x00a323d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferSubData)(); return; } //@@ 00a323e0 FUN_00a323e0 void FUN_00a323e0(void) { epoxy_glBufferSubDataARB = (undefined *)FUN_00a2ca10(&DAT_00b26678); /* WARNING: Could not recover jumptable at 0x00a32400. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glBufferSubDataARB)(); return; } //@@ 00a32410 FUN_00a32410 void FUN_00a32410(void) { epoxy_glCallCommandListNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCallCommandListNV)(); return; } //@@ 00a32430 FUN_00a32430 void FUN_00a32430(void) { epoxy_glCallList = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32448. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCallList)(); return; } //@@ 00a32450 FUN_00a32450 void FUN_00a32450(void) { epoxy_glCallLists = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCallLists)(); return; } //@@ 00a32470 FUN_00a32470 void FUN_00a32470(void) { epoxy_glCheckFramebufferStatus = (undefined *)FUN_00a2ca10(&DAT_00b26070); /* WARNING: Could not recover jumptable at 0x00a32490. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCheckFramebufferStatus)(); return; } //@@ 00a324a0 FUN_00a324a0 void FUN_00a324a0(void) { epoxy_glCheckFramebufferStatusEXT = (undefined *)FUN_00a2ca10(&DAT_00b259d4); /* WARNING: Could not recover jumptable at 0x00a324c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCheckFramebufferStatusEXT)(); return; } //@@ 00a324d0 FUN_00a324d0 void FUN_00a324d0(void) { epoxy_glCheckFramebufferStatusOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a324e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCheckFramebufferStatusOES)(); return; } //@@ 00a324f0 FUN_00a324f0 void FUN_00a324f0(void) { epoxy_glCheckNamedFramebufferStatus = (undefined *)FUN_00a2ca10(&DAT_00b2b0d0); /* WARNING: Could not recover jumptable at 0x00a32510. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCheckNamedFramebufferStatus)(); return; } //@@ 00a32520 FUN_00a32520 void FUN_00a32520(void) { epoxy_glCheckNamedFramebufferStatusEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32538. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCheckNamedFramebufferStatusEXT)(); return; } //@@ 00a32540 FUN_00a32540 void FUN_00a32540(void) { epoxy_glClampColor = (undefined *)FUN_00a2ca10(&DAT_00b25b78); /* WARNING: Could not recover jumptable at 0x00a32560. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClampColor)(); return; } //@@ 00a32570 FUN_00a32570 void FUN_00a32570(void) { epoxy_glClampColorARB = (undefined *)FUN_00a2ca10(&DAT_00b28c20); /* WARNING: Could not recover jumptable at 0x00a32590. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClampColorARB)(); return; } //@@ 00a325a0 FUN_00a325a0 void FUN_00a325a0(void) { epoxy_glClear = (undefined *)FUN_00a2ca10("z\rz\rz\r"); /* WARNING: Could not recover jumptable at 0x00a325c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClear)(); return; } //@@ 00a325d0 FUN_00a325d0 void FUN_00a325d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glClearAccum = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glClearAccum)(param_1,param_2,param_3,param_4); return; } //@@ 00a32620 FUN_00a32620 void FUN_00a32620(void) { epoxy_glClearAccumxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32638. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearAccumxOES)(); return; } //@@ 00a32640 FUN_00a32640 void FUN_00a32640(void) { epoxy_glClearBufferData = (undefined *)FUN_00a2ca10(&DAT_00b26d80); /* WARNING: Could not recover jumptable at 0x00a32660. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearBufferData)(); return; } //@@ 00a32670 FUN_00a32670 void FUN_00a32670(void) { epoxy_glClearBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b291f4); /* WARNING: Could not recover jumptable at 0x00a32690. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearBufferSubData)(); return; } //@@ 00a326a0 FUN_00a326a0 void FUN_00a326a0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glClearBufferfi = (undefined *)FUN_00a2ca10(&DAT_00b260a8); (*(code *)epoxy_glClearBufferfi)(param_1,param_2,param_3,param_4); return; } //@@ 00a326e0 FUN_00a326e0 void FUN_00a326e0(void) { epoxy_glClearBufferfv = (undefined *)FUN_00a2ca10(&DAT_00b3b974); /* WARNING: Could not recover jumptable at 0x00a32700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearBufferfv)(); return; } //@@ 00a32710 FUN_00a32710 void FUN_00a32710(void) { epoxy_glClearBufferiv = (undefined *)FUN_00a2ca10(&DAT_00b2a5a8); /* WARNING: Could not recover jumptable at 0x00a32730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearBufferiv)(); return; } //@@ 00a32740 FUN_00a32740 void FUN_00a32740(void) { epoxy_glClearBufferuiv = (undefined *)FUN_00a2ca10(&DAT_00b3d390); /* WARNING: Could not recover jumptable at 0x00a32760. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearBufferuiv)(); return; } //@@ 00a32770 FUN_00a32770 void FUN_00a32770(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glClearColor = (undefined *)FUN_00a2ca10(&DAT_00b25b00); (*(code *)epoxy_glClearColor)(param_1,param_2,param_3,param_4); return; } //@@ 00a327c0 FUN_00a327c0 void FUN_00a327c0(void) { epoxy_glClearColorIiEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a327d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearColorIiEXT)(); return; } //@@ 00a327e0 FUN_00a327e0 void FUN_00a327e0(void) { epoxy_glClearColorIuiEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a327f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearColorIuiEXT)(); return; } //@@ 00a32800 FUN_00a32800 void FUN_00a32800(void) { epoxy_glClearColorx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearColorx)(); return; } //@@ 00a32820 FUN_00a32820 void FUN_00a32820(void) { epoxy_glClearColorxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32838. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearColorxOES)(); return; } //@@ 00a32840 FUN_00a32840 void FUN_00a32840(undefined8 param_1) { epoxy_glClearDepth = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glClearDepth)(param_1); return; } //@@ 00a32870 FUN_00a32870 void FUN_00a32870(undefined8 param_1) { epoxy_glClearDepthdNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glClearDepthdNV)(param_1); return; } //@@ 00a328a0 FUN_00a328a0 void FUN_00a328a0(undefined4 param_1) { epoxy_glClearDepthf = (undefined *)FUN_00a2ca10(&DAT_00b28be4); (*(code *)epoxy_glClearDepthf)(param_1); return; } //@@ 00a328d0 FUN_00a328d0 void FUN_00a328d0(undefined4 param_1) { epoxy_glClearDepthfOES = (undefined *)FUN_00a2ca10(&DAT_00b3c870); (*(code *)epoxy_glClearDepthfOES)(param_1); return; } //@@ 00a32900 FUN_00a32900 void FUN_00a32900(void) { epoxy_glClearDepthx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32918. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearDepthx)(); return; } //@@ 00a32920 FUN_00a32920 void FUN_00a32920(void) { epoxy_glClearDepthxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearDepthxOES)(); return; } //@@ 00a32940 FUN_00a32940 void FUN_00a32940(undefined4 param_1) { epoxy_glClearIndex = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glClearIndex)(param_1); return; } //@@ 00a32970 FUN_00a32970 void FUN_00a32970(void) { epoxy_glClearNamedBufferData = (undefined *)FUN_00a2ca10(&DAT_00b26bf0); /* WARNING: Could not recover jumptable at 0x00a32990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedBufferData)(); return; } //@@ 00a329a0 FUN_00a329a0 void FUN_00a329a0(void) { epoxy_glClearNamedBufferDataEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a329b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedBufferDataEXT)(); return; } //@@ 00a329c0 FUN_00a329c0 void FUN_00a329c0(void) { epoxy_glClearNamedBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b2af48); /* WARNING: Could not recover jumptable at 0x00a329e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedBufferSubData)(); return; } //@@ 00a329f0 FUN_00a329f0 void FUN_00a329f0(void) { epoxy_glClearNamedBufferSubDataEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32a08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedBufferSubDataEXT)(); return; } //@@ 00a32a10 FUN_00a32a10 void FUN_00a32a10(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glClearNamedFramebufferfi = (undefined *)FUN_00a2ca10(&DAT_00b2834c); (*(code *)epoxy_glClearNamedFramebufferfi)(param_1,param_2,param_3,param_4); return; } //@@ 00a32a50 FUN_00a32a50 void FUN_00a32a50(void) { epoxy_glClearNamedFramebufferfv = (undefined *)FUN_00a2ca10(&DAT_00b3b94c); /* WARNING: Could not recover jumptable at 0x00a32a70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedFramebufferfv)(); return; } //@@ 00a32a80 FUN_00a32a80 void FUN_00a32a80(void) { epoxy_glClearNamedFramebufferiv = (undefined *)FUN_00a2ca10(&DAT_00b25a14); /* WARNING: Could not recover jumptable at 0x00a32aa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedFramebufferiv)(); return; } //@@ 00a32ab0 FUN_00a32ab0 void FUN_00a32ab0(void) { epoxy_glClearNamedFramebufferuiv = (undefined *)FUN_00a2ca10(&DAT_00b2a848); /* WARNING: Could not recover jumptable at 0x00a32ad0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearNamedFramebufferuiv)(); return; } //@@ 00a32ae0 FUN_00a32ae0 void FUN_00a32ae0(void) { epoxy_glClearStencil = (undefined *)FUN_00a2ca10(&DAT_00b3d904); /* WARNING: Could not recover jumptable at 0x00a32b00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearStencil)(); return; } //@@ 00a32b10 FUN_00a32b10 void FUN_00a32b10(void) { epoxy_glClearTexImage = (undefined *)FUN_00a2ca10(&DAT_00b28f64); /* WARNING: Could not recover jumptable at 0x00a32b30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearTexImage)(); return; } //@@ 00a32b40 FUN_00a32b40 void FUN_00a32b40(void) { epoxy_glClearTexSubImage = (undefined *)FUN_00a2ca10(&DAT_00b2648c); /* WARNING: Could not recover jumptable at 0x00a32b60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClearTexSubImage)(); return; } //@@ 00a32b70 FUN_00a32b70 void FUN_00a32b70(void) { epoxy_glClientActiveTexture = (undefined *)FUN_00a2ca10(&DAT_00b268b0); /* WARNING: Could not recover jumptable at 0x00a32b90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClientActiveTexture)(); return; } //@@ 00a32ba0 FUN_00a32ba0 void FUN_00a32ba0(void) { epoxy_glClientActiveTextureARB = (undefined *)FUN_00a2ca10(&DAT_00b3cb88); /* WARNING: Could not recover jumptable at 0x00a32bc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClientActiveTextureARB)(); return; } //@@ 00a32bd0 FUN_00a32bd0 void FUN_00a32bd0(void) { epoxy_glClientActiveVertexStreamATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32be8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClientActiveVertexStreamATI)(); return; } //@@ 00a32bf0 FUN_00a32bf0 void FUN_00a32bf0(void) { epoxy_glClientAttribDefaultEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32c08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClientAttribDefaultEXT)(); return; } //@@ 00a32c10 FUN_00a32c10 void FUN_00a32c10(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glClientWaitSync = (undefined *)FUN_00a2ca10(&DAT_00b3cbd8); (*(code *)epoxy_glClientWaitSync)(param_1,param_2,param_3,param_4); return; } //@@ 00a32c50 FUN_00a32c50 void FUN_00a32c50(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glClientWaitSyncAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b26118); (*(code *)epoxy_glClientWaitSyncAPPLE)(param_1,param_2,param_3,param_4); return; } //@@ 00a32c90 FUN_00a32c90 void FUN_00a32c90(void) { epoxy_glClipControl = (undefined *)FUN_00a2ca10(&DAT_00b2a1e8); /* WARNING: Could not recover jumptable at 0x00a32cb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipControl)(); return; } //@@ 00a32cc0 FUN_00a32cc0 void FUN_00a32cc0(void) { epoxy_glClipPlane = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32cd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlane)(); return; } //@@ 00a32ce0 FUN_00a32ce0 void FUN_00a32ce0(void) { epoxy_glClipPlanef = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32cf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlanef)(); return; } //@@ 00a32d00 FUN_00a32d00 void FUN_00a32d00(void) { epoxy_glClipPlanefIMG = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlanefIMG)(); return; } //@@ 00a32d20 FUN_00a32d20 void FUN_00a32d20(void) { epoxy_glClipPlanefOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32d38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlanefOES)(); return; } //@@ 00a32d40 FUN_00a32d40 void FUN_00a32d40(void) { epoxy_glClipPlanex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32d58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlanex)(); return; } //@@ 00a32d60 FUN_00a32d60 void FUN_00a32d60(void) { epoxy_glClipPlanexIMG = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32d78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlanexIMG)(); return; } //@@ 00a32d80 FUN_00a32d80 void FUN_00a32d80(void) { epoxy_glClipPlanexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32d98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glClipPlanexOES)(); return; } //@@ 00a32da0 FUN_00a32da0 void FUN_00a32da0(void) { epoxy_glColor3b = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32db8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3b)(); return; } //@@ 00a32dc0 FUN_00a32dc0 void FUN_00a32dc0(void) { epoxy_glColor3bv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3bv)(); return; } //@@ 00a32de0 FUN_00a32de0 void FUN_00a32de0(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glColor3d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor3d)(param_1,param_2,param_3); return; } //@@ 00a32e30 FUN_00a32e30 void FUN_00a32e30(void) { epoxy_glColor3dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32e48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3dv)(); return; } //@@ 00a32e50 FUN_00a32e50 void FUN_00a32e50(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glColor3f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor3f)(param_1,param_2,param_3); return; } //@@ 00a32e90 FUN_00a32e90 void FUN_00a32e90(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glColor3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor3fVertex3fSUN)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a32f00 FUN_00a32f00 void FUN_00a32f00(void) { epoxy_glColor3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32f18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3fVertex3fvSUN)(); return; } //@@ 00a32f20 FUN_00a32f20 void FUN_00a32f20(void) { epoxy_glColor3fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32f38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3fv)(); return; } //@@ 00a32f40 FUN_00a32f40 void FUN_00a32f40(void) { epoxy_glColor3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32f58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3hNV)(); return; } //@@ 00a32f60 FUN_00a32f60 void FUN_00a32f60(void) { epoxy_glColor3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3hvNV)(); return; } //@@ 00a32f80 FUN_00a32f80 void FUN_00a32f80(void) { epoxy_glColor3i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32f98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3i)(); return; } //@@ 00a32fa0 FUN_00a32fa0 void FUN_00a32fa0(void) { epoxy_glColor3iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32fb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3iv)(); return; } //@@ 00a32fc0 FUN_00a32fc0 void FUN_00a32fc0(void) { epoxy_glColor3s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32fd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3s)(); return; } //@@ 00a32fe0 FUN_00a32fe0 void FUN_00a32fe0(void) { epoxy_glColor3sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a32ff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3sv)(); return; } //@@ 00a33000 FUN_00a33000 void FUN_00a33000(void) { epoxy_glColor3ub = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33018. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3ub)(); return; } //@@ 00a33020 FUN_00a33020 void FUN_00a33020(void) { epoxy_glColor3ubv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33038. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3ubv)(); return; } //@@ 00a33040 FUN_00a33040 void FUN_00a33040(void) { epoxy_glColor3ui = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33058. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3ui)(); return; } //@@ 00a33060 FUN_00a33060 void FUN_00a33060(void) { epoxy_glColor3uiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33078. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3uiv)(); return; } //@@ 00a33080 FUN_00a33080 void FUN_00a33080(void) { epoxy_glColor3us = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33098. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3us)(); return; } //@@ 00a330a0 FUN_00a330a0 void FUN_00a330a0(void) { epoxy_glColor3usv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a330b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3usv)(); return; } //@@ 00a330c0 FUN_00a330c0 void FUN_00a330c0(void) { epoxy_glColor3xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a330d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3xOES)(); return; } //@@ 00a330e0 FUN_00a330e0 void FUN_00a330e0(void) { epoxy_glColor3xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a330f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor3xvOES)(); return; } //@@ 00a33100 FUN_00a33100 void FUN_00a33100(void) { epoxy_glColor4b = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33118. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4b)(); return; } //@@ 00a33120 FUN_00a33120 void FUN_00a33120(void) { epoxy_glColor4bv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33138. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4bv)(); return; } //@@ 00a33140 FUN_00a33140 void FUN_00a33140(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glColor4d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor4d)(param_1,param_2,param_3,param_4); return; } //@@ 00a33190 FUN_00a33190 void FUN_00a33190(void) { epoxy_glColor4dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a331a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4dv)(); return; } //@@ 00a331b0 FUN_00a331b0 void FUN_00a331b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glColor4f = (undefined *)FUN_00a2ca10(&DAT_00b260b8); (*(code *)epoxy_glColor4f)(param_1,param_2,param_3,param_4); return; } //@@ 00a33200 FUN_00a33200 void FUN_00a33200(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_glColor4fNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor4fNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a33290 FUN_00a33290 void FUN_00a33290(void) { epoxy_glColor4fNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a332a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4fNormal3fVertex3fvSUN)(); return; } //@@ 00a332b0 FUN_00a332b0 void FUN_00a332b0(void) { epoxy_glColor4fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a332c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4fv)(); return; } //@@ 00a332d0 FUN_00a332d0 void FUN_00a332d0(void) { epoxy_glColor4hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a332e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4hNV)(); return; } //@@ 00a332f0 FUN_00a332f0 void FUN_00a332f0(void) { epoxy_glColor4hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4hvNV)(); return; } //@@ 00a33310 FUN_00a33310 void FUN_00a33310(void) { epoxy_glColor4i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4i)(); return; } //@@ 00a33330 FUN_00a33330 void FUN_00a33330(void) { epoxy_glColor4iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4iv)(); return; } //@@ 00a33350 FUN_00a33350 void FUN_00a33350(void) { epoxy_glColor4s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4s)(); return; } //@@ 00a33370 FUN_00a33370 void FUN_00a33370(void) { epoxy_glColor4sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4sv)(); return; } //@@ 00a33390 FUN_00a33390 void FUN_00a33390(void) { epoxy_glColor4ub = (undefined *)FUN_00a2ca10(&DAT_00b29020); /* WARNING: Could not recover jumptable at 0x00a333b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4ub)(); return; } //@@ 00a333c0 FUN_00a333c0 void FUN_00a333c0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glColor4ubVertex2fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor4ubVertex2fSUN)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a33410 FUN_00a33410 void FUN_00a33410(void) { epoxy_glColor4ubVertex2fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4ubVertex2fvSUN)(); return; } //@@ 00a33430 FUN_00a33430 void FUN_00a33430(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glColor4ubVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glColor4ubVertex3fSUN)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a33480 FUN_00a33480 void FUN_00a33480(void) { epoxy_glColor4ubVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33498. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4ubVertex3fvSUN)(); return; } //@@ 00a334a0 FUN_00a334a0 void FUN_00a334a0(void) { epoxy_glColor4ubv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a334b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4ubv)(); return; } //@@ 00a334c0 FUN_00a334c0 void FUN_00a334c0(void) { epoxy_glColor4ui = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a334d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4ui)(); return; } //@@ 00a334e0 FUN_00a334e0 void FUN_00a334e0(void) { epoxy_glColor4uiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a334f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4uiv)(); return; } //@@ 00a33500 FUN_00a33500 void FUN_00a33500(void) { epoxy_glColor4us = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33518. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4us)(); return; } //@@ 00a33520 FUN_00a33520 void FUN_00a33520(void) { epoxy_glColor4usv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33538. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4usv)(); return; } //@@ 00a33540 FUN_00a33540 void FUN_00a33540(void) { epoxy_glColor4x = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33558. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4x)(); return; } //@@ 00a33560 FUN_00a33560 void FUN_00a33560(void) { epoxy_glColor4xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4xOES)(); return; } //@@ 00a33580 FUN_00a33580 void FUN_00a33580(void) { epoxy_glColor4xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColor4xvOES)(); return; } //@@ 00a335a0 FUN_00a335a0 void FUN_00a335a0(void) { epoxy_glColorFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a335b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorFormatNV)(); return; } //@@ 00a335c0 FUN_00a335c0 void FUN_00a335c0(void) { epoxy_glColorFragmentOp1ATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a335d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorFragmentOp1ATI)(); return; } //@@ 00a335e0 FUN_00a335e0 void FUN_00a335e0(void) { epoxy_glColorFragmentOp2ATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a335f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorFragmentOp2ATI)(); return; } //@@ 00a33600 FUN_00a33600 void FUN_00a33600(void) { epoxy_glColorFragmentOp3ATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorFragmentOp3ATI)(); return; } //@@ 00a33620 FUN_00a33620 void FUN_00a33620(void) { epoxy_glColorMask = (undefined *)FUN_00a2ca10(&DAT_00b2b0e4); /* WARNING: Could not recover jumptable at 0x00a33640. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorMask)(); return; } //@@ 00a33650 FUN_00a33650 void FUN_00a33650(void) { epoxy_glColorMaskIndexedEXT = (undefined *)FUN_00a2ca10(&DAT_00b25a0c); /* WARNING: Could not recover jumptable at 0x00a33670. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorMaskIndexedEXT)(); return; } //@@ 00a33680 FUN_00a33680 void FUN_00a33680(void) { epoxy_glColorMaski = (undefined *)FUN_00a2ca10(&DAT_00b2a2bc); /* WARNING: Could not recover jumptable at 0x00a336a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorMaski)(); return; } //@@ 00a336b0 FUN_00a336b0 void FUN_00a336b0(void) { epoxy_glColorMaskiEXT = (undefined *)FUN_00a2ca10(&DAT_00b274e4); /* WARNING: Could not recover jumptable at 0x00a336d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorMaskiEXT)(); return; } //@@ 00a336e0 FUN_00a336e0 void FUN_00a336e0(void) { epoxy_glColorMaskiOES = (undefined *)FUN_00a2ca10(&DAT_00b3c2a8); /* WARNING: Could not recover jumptable at 0x00a33700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorMaskiOES)(); return; } //@@ 00a33710 FUN_00a33710 void FUN_00a33710(void) { epoxy_glColorMaterial = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33728. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorMaterial)(); return; } //@@ 00a33730 FUN_00a33730 void FUN_00a33730(void) { epoxy_glColorP3ui = (undefined *)FUN_00a2ca10(&DAT_00b2ac30); /* WARNING: Could not recover jumptable at 0x00a33750. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorP3ui)(); return; } //@@ 00a33760 FUN_00a33760 void FUN_00a33760(void) { epoxy_glColorP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b27cd0); /* WARNING: Could not recover jumptable at 0x00a33780. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorP3uiv)(); return; } //@@ 00a33790 FUN_00a33790 void FUN_00a33790(void) { epoxy_glColorP4ui = (undefined *)FUN_00a2ca10(&DAT_00b3c250); /* WARNING: Could not recover jumptable at 0x00a337b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorP4ui)(); return; } //@@ 00a337c0 FUN_00a337c0 void FUN_00a337c0(void) { epoxy_glColorP4uiv = (undefined *)FUN_00a2ca10(&DAT_00b2ab98); /* WARNING: Could not recover jumptable at 0x00a337e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorP4uiv)(); return; } //@@ 00a337f0 FUN_00a337f0 void FUN_00a337f0(void) { epoxy_glColorPointer = (undefined *)FUN_00a2ca10(&DAT_00b3b3ec); /* WARNING: Could not recover jumptable at 0x00a33810. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorPointer)(); return; } //@@ 00a33820 FUN_00a33820 void FUN_00a33820(void) { epoxy_glColorPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33838. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorPointerEXT)(); return; } //@@ 00a33840 FUN_00a33840 void FUN_00a33840(void) { epoxy_glColorPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33858. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorPointerListIBM)(); return; } //@@ 00a33860 FUN_00a33860 void FUN_00a33860(void) { epoxy_glColorPointervINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33878. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorPointervINTEL)(); return; } //@@ 00a33880 FUN_00a33880 void FUN_00a33880(void) { epoxy_glColorSubTable = (undefined *)FUN_00a2ca10(&DAT_00b3c1e4); /* WARNING: Could not recover jumptable at 0x00a338a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorSubTable)(); return; } //@@ 00a338b0 FUN_00a338b0 void FUN_00a338b0(void) { epoxy_glColorSubTableEXT = (undefined *)FUN_00a2ca10(&DAT_00b2ad94); /* WARNING: Could not recover jumptable at 0x00a338d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorSubTableEXT)(); return; } //@@ 00a338e0 FUN_00a338e0 void FUN_00a338e0(void) { epoxy_glColorTable = (undefined *)FUN_00a2ca10(&DAT_00b25f14); /* WARNING: Could not recover jumptable at 0x00a33900. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTable)(); return; } //@@ 00a33910 FUN_00a33910 void FUN_00a33910(void) { epoxy_glColorTableEXT = (undefined *)FUN_00a2ca10(&DAT_00b267dc); /* WARNING: Could not recover jumptable at 0x00a33930. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTableEXT)(); return; } //@@ 00a33940 FUN_00a33940 void FUN_00a33940(void) { epoxy_glColorTableParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b3ca70); /* WARNING: Could not recover jumptable at 0x00a33960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTableParameterfv)(); return; } //@@ 00a33970 FUN_00a33970 void FUN_00a33970(void) { epoxy_glColorTableParameterfvSGI = (undefined *)FUN_00a2ca10(&DAT_00b27738); /* WARNING: Could not recover jumptable at 0x00a33990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTableParameterfvSGI)(); return; } //@@ 00a339a0 FUN_00a339a0 void FUN_00a339a0(void) { epoxy_glColorTableParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b27590); /* WARNING: Could not recover jumptable at 0x00a339c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTableParameteriv)(); return; } //@@ 00a339d0 FUN_00a339d0 void FUN_00a339d0(void) { epoxy_glColorTableParameterivSGI = (undefined *)FUN_00a2ca10(0xb3c720); /* WARNING: Could not recover jumptable at 0x00a339f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTableParameterivSGI)(); return; } //@@ 00a33a00 FUN_00a33a00 void FUN_00a33a00(void) { epoxy_glColorTableSGI = (undefined *)FUN_00a2ca10(&DAT_00b3d26c); /* WARNING: Could not recover jumptable at 0x00a33a20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glColorTableSGI)(); return; } //@@ 00a33a30 FUN_00a33a30 void FUN_00a33a30(void) { epoxy_glCombinerInputNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33a48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCombinerInputNV)(); return; } //@@ 00a33a50 FUN_00a33a50 void FUN_00a33a50(void) { epoxy_glCombinerOutputNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33a68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCombinerOutputNV)(); return; } //@@ 00a33a70 FUN_00a33a70 void FUN_00a33a70(undefined4 param_1,undefined4 param_2) { epoxy_glCombinerParameterfNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glCombinerParameterfNV)(param_1,param_2); return; } //@@ 00a33aa0 FUN_00a33aa0 void FUN_00a33aa0(void) { epoxy_glCombinerParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33ab8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCombinerParameterfvNV)(); return; } //@@ 00a33ac0 FUN_00a33ac0 void FUN_00a33ac0(void) { epoxy_glCombinerParameteriNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33ad8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCombinerParameteriNV)(); return; } //@@ 00a33ae0 FUN_00a33ae0 void FUN_00a33ae0(void) { epoxy_glCombinerParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33af8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCombinerParameterivNV)(); return; } //@@ 00a33b00 FUN_00a33b00 void FUN_00a33b00(void) { epoxy_glCombinerStageParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33b18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCombinerStageParameterfvNV)(); return; } //@@ 00a33b20 FUN_00a33b20 void FUN_00a33b20(void) { epoxy_glCommandListSegmentsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33b38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCommandListSegmentsNV)(); return; } //@@ 00a33b40 FUN_00a33b40 void FUN_00a33b40(void) { epoxy_glCompileCommandListNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33b58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompileCommandListNV)(); return; } //@@ 00a33b60 FUN_00a33b60 void FUN_00a33b60(void) { epoxy_glCompileShader = (undefined *)FUN_00a2ca10(&DAT_00b3d9c0); /* WARNING: Could not recover jumptable at 0x00a33b80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompileShader)(); return; } //@@ 00a33b90 FUN_00a33b90 void FUN_00a33b90(void) { epoxy_glCompileShaderARB = (undefined *)FUN_00a2ca10(&DAT_00b270f4); /* WARNING: Could not recover jumptable at 0x00a33bb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompileShaderARB)(); return; } //@@ 00a33bc0 FUN_00a33bc0 void FUN_00a33bc0(void) { epoxy_glCompileShaderIncludeARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompileShaderIncludeARB)(); return; } //@@ 00a33be0 FUN_00a33be0 void FUN_00a33be0(void) { epoxy_glCompressedMultiTexImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33bf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedMultiTexImage1DEXT)(); return; } //@@ 00a33c00 FUN_00a33c00 void FUN_00a33c00(void) { epoxy_glCompressedMultiTexImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33c18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedMultiTexImage2DEXT)(); return; } //@@ 00a33c20 FUN_00a33c20 void FUN_00a33c20(void) { epoxy_glCompressedMultiTexImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33c38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedMultiTexImage3DEXT)(); return; } //@@ 00a33c40 FUN_00a33c40 void FUN_00a33c40(void) { epoxy_glCompressedMultiTexSubImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33c58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedMultiTexSubImage1DEXT)(); return; } //@@ 00a33c60 FUN_00a33c60 void FUN_00a33c60(void) { epoxy_glCompressedMultiTexSubImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33c78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedMultiTexSubImage2DEXT)(); return; } //@@ 00a33c80 FUN_00a33c80 void FUN_00a33c80(void) { epoxy_glCompressedMultiTexSubImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedMultiTexSubImage3DEXT)(); return; } //@@ 00a33ca0 FUN_00a33ca0 void FUN_00a33ca0(void) { epoxy_glCompressedTexImage1D = (undefined *)FUN_00a2ca10(&DAT_00b3bbe8); /* WARNING: Could not recover jumptable at 0x00a33cc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage1D)(); return; } //@@ 00a33cd0 FUN_00a33cd0 void FUN_00a33cd0(void) { epoxy_glCompressedTexImage1DARB = (undefined *)FUN_00a2ca10(&DAT_00b3b01c); /* WARNING: Could not recover jumptable at 0x00a33cf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage1DARB)(); return; } //@@ 00a33d00 FUN_00a33d00 void FUN_00a33d00(void) { epoxy_glCompressedTexImage2D = (undefined *)FUN_00a2ca10(&DAT_00b2a7dc); /* WARNING: Could not recover jumptable at 0x00a33d20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage2D)(); return; } //@@ 00a33d30 FUN_00a33d30 void FUN_00a33d30(void) { epoxy_glCompressedTexImage2DARB = (undefined *)FUN_00a2ca10(&DAT_00b292e8); /* WARNING: Could not recover jumptable at 0x00a33d50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage2DARB)(); return; } //@@ 00a33d60 FUN_00a33d60 void FUN_00a33d60(void) { epoxy_glCompressedTexImage3D = (undefined *)FUN_00a2ca10(&DAT_00b2a05c); /* WARNING: Could not recover jumptable at 0x00a33d80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage3D)(); return; } //@@ 00a33d90 FUN_00a33d90 void FUN_00a33d90(void) { epoxy_glCompressedTexImage3DARB = (undefined *)FUN_00a2ca10(&DAT_00b2a538); /* WARNING: Could not recover jumptable at 0x00a33db0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage3DARB)(); return; } //@@ 00a33dc0 FUN_00a33dc0 void FUN_00a33dc0(void) { epoxy_glCompressedTexImage3DOES = (undefined *)FUN_00a2ca10(&DAT_00b25c48); /* WARNING: Could not recover jumptable at 0x00a33de0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexImage3DOES)(); return; } //@@ 00a33df0 FUN_00a33df0 void FUN_00a33df0(void) { epoxy_glCompressedTexSubImage1D = (undefined *)FUN_00a2ca10(&DAT_00b29bb8); /* WARNING: Could not recover jumptable at 0x00a33e10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage1D)(); return; } //@@ 00a33e20 FUN_00a33e20 void FUN_00a33e20(void) { epoxy_glCompressedTexSubImage1DARB = (undefined *)FUN_00a2ca10(&DAT_00b26ef0); /* WARNING: Could not recover jumptable at 0x00a33e40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage1DARB)(); return; } //@@ 00a33e50 FUN_00a33e50 void FUN_00a33e50(void) { epoxy_glCompressedTexSubImage2D = (undefined *)FUN_00a2ca10(&DAT_00b29058); /* WARNING: Could not recover jumptable at 0x00a33e70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage2D)(); return; } //@@ 00a33e80 FUN_00a33e80 void FUN_00a33e80(void) { epoxy_glCompressedTexSubImage2DARB = (undefined *)FUN_00a2ca10(&DAT_00b25578); /* WARNING: Could not recover jumptable at 0x00a33ea0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage2DARB)(); return; } //@@ 00a33eb0 FUN_00a33eb0 void FUN_00a33eb0(void) { epoxy_glCompressedTexSubImage3D = (undefined *)FUN_00a2ca10(&DAT_00b3cc04); /* WARNING: Could not recover jumptable at 0x00a33ed0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage3D)(); return; } //@@ 00a33ee0 FUN_00a33ee0 void FUN_00a33ee0(void) { epoxy_glCompressedTexSubImage3DARB = (undefined *)FUN_00a2ca10(&DAT_00b3b274); /* WARNING: Could not recover jumptable at 0x00a33f00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage3DARB)(); return; } //@@ 00a33f10 FUN_00a33f10 void FUN_00a33f10(void) { epoxy_glCompressedTexSubImage3DOES = (undefined *)FUN_00a2ca10(&DAT_00b252d8); /* WARNING: Could not recover jumptable at 0x00a33f30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTexSubImage3DOES)(); return; } //@@ 00a33f40 FUN_00a33f40 void FUN_00a33f40(void) { epoxy_glCompressedTextureImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33f58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureImage1DEXT)(); return; } //@@ 00a33f60 FUN_00a33f60 void FUN_00a33f60(void) { epoxy_glCompressedTextureImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureImage2DEXT)(); return; } //@@ 00a33f80 FUN_00a33f80 void FUN_00a33f80(void) { epoxy_glCompressedTextureImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33f98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureImage3DEXT)(); return; } //@@ 00a33fa0 FUN_00a33fa0 void FUN_00a33fa0(void) { epoxy_glCompressedTextureSubImage1D = (undefined *)FUN_00a2ca10(&DAT_00b27f28); /* WARNING: Could not recover jumptable at 0x00a33fc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureSubImage1D)(); return; } //@@ 00a33fd0 FUN_00a33fd0 void FUN_00a33fd0(void) { epoxy_glCompressedTextureSubImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a33fe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureSubImage1DEXT)(); return; } //@@ 00a34000 FUN_00a34000 void FUN_00a34000(void) { epoxy_glCompressedTextureSubImage2D = (undefined *)FUN_00a2ca10(&DAT_00b3d988); /* WARNING: Could not recover jumptable at 0x00a34020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureSubImage2D)(); return; } //@@ 00a34030 FUN_00a34030 void FUN_00a34030(void) { epoxy_glCompressedTextureSubImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureSubImage2DEXT)(); return; } //@@ 00a34050 FUN_00a34050 void FUN_00a34050(void) { epoxy_glCompressedTextureSubImage3D = (undefined *)FUN_00a2ca10(&DAT_00b28de0); /* WARNING: Could not recover jumptable at 0x00a34070. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureSubImage3D)(); return; } //@@ 00a34080 FUN_00a34080 void FUN_00a34080(void) { epoxy_glCompressedTextureSubImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34098. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCompressedTextureSubImage3DEXT)(); return; } //@@ 00a340a0 FUN_00a340a0 void FUN_00a340a0(void) { epoxy_glConvolutionFilter1D = (undefined *)FUN_00a2ca10(&DAT_00b2afb0); /* WARNING: Could not recover jumptable at 0x00a340c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionFilter1D)(); return; } //@@ 00a340d0 FUN_00a340d0 void FUN_00a340d0(void) { epoxy_glConvolutionFilter1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b28f38); /* WARNING: Could not recover jumptable at 0x00a340f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionFilter1DEXT)(); return; } //@@ 00a34100 FUN_00a34100 void FUN_00a34100(void) { epoxy_glConvolutionFilter2D = (undefined *)FUN_00a2ca10(&DAT_00b3c3b0); /* WARNING: Could not recover jumptable at 0x00a34120. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionFilter2D)(); return; } //@@ 00a34130 FUN_00a34130 void FUN_00a34130(void) { epoxy_glConvolutionFilter2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3ba28); /* WARNING: Could not recover jumptable at 0x00a34150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionFilter2DEXT)(); return; } //@@ 00a34160 FUN_00a34160 void FUN_00a34160(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glConvolutionParameterf = (undefined *)FUN_00a2ca10(&DAT_00b287c4); (*(code *)epoxy_glConvolutionParameterf)(param_1,param_2,param_3); return; } //@@ 00a341a0 FUN_00a341a0 void FUN_00a341a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glConvolutionParameterfEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cd04); (*(code *)epoxy_glConvolutionParameterfEXT)(param_1,param_2,param_3); return; } //@@ 00a341e0 FUN_00a341e0 void FUN_00a341e0(void) { epoxy_glConvolutionParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b3d200); /* WARNING: Could not recover jumptable at 0x00a34200. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameterfv)(); return; } //@@ 00a34210 FUN_00a34210 void FUN_00a34210(void) { epoxy_glConvolutionParameterfvEXT = (undefined *)FUN_00a2ca10(&DAT_00b28654); /* WARNING: Could not recover jumptable at 0x00a34230. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameterfvEXT)(); return; } //@@ 00a34240 FUN_00a34240 void FUN_00a34240(void) { epoxy_glConvolutionParameteri = (undefined *)FUN_00a2ca10(&DAT_00b3d8c0); /* WARNING: Could not recover jumptable at 0x00a34260. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameteri)(); return; } //@@ 00a34270 FUN_00a34270 void FUN_00a34270(void) { epoxy_glConvolutionParameteriEXT = (undefined *)FUN_00a2ca10(&DAT_00b251f0); /* WARNING: Could not recover jumptable at 0x00a34290. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameteriEXT)(); return; } //@@ 00a342a0 FUN_00a342a0 void FUN_00a342a0(void) { epoxy_glConvolutionParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b3d998); /* WARNING: Could not recover jumptable at 0x00a342c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameteriv)(); return; } //@@ 00a342d0 FUN_00a342d0 void FUN_00a342d0(void) { epoxy_glConvolutionParameterivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b828); /* WARNING: Could not recover jumptable at 0x00a342f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameterivEXT)(); return; } //@@ 00a34300 FUN_00a34300 void FUN_00a34300(void) { epoxy_glConvolutionParameterxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameterxOES)(); return; } //@@ 00a34320 FUN_00a34320 void FUN_00a34320(void) { epoxy_glConvolutionParameterxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34338. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glConvolutionParameterxvOES)(); return; } //@@ 00a34340 FUN_00a34340 void FUN_00a34340(void) { epoxy_glCopyBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b3cbd0); /* WARNING: Could not recover jumptable at 0x00a34360. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyBufferSubData)(); return; } //@@ 00a34370 FUN_00a34370 void FUN_00a34370(void) { epoxy_glCopyBufferSubDataNV = (undefined *)FUN_00a2ca10(&DAT_00b3bdd8); /* WARNING: Could not recover jumptable at 0x00a34390. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyBufferSubDataNV)(); return; } //@@ 00a343a0 FUN_00a343a0 void FUN_00a343a0(void) { epoxy_glCopyColorSubTable = (undefined *)FUN_00a2ca10(&DAT_00b3d98c); /* WARNING: Could not recover jumptable at 0x00a343c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyColorSubTable)(); return; } //@@ 00a343d0 FUN_00a343d0 void FUN_00a343d0(void) { epoxy_glCopyColorSubTableEXT = (undefined *)FUN_00a2ca10(&DAT_00b28094); /* WARNING: Could not recover jumptable at 0x00a343f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyColorSubTableEXT)(); return; } //@@ 00a34400 FUN_00a34400 void FUN_00a34400(void) { epoxy_glCopyColorTable = (undefined *)FUN_00a2ca10(&DAT_00b3d154); /* WARNING: Could not recover jumptable at 0x00a34420. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyColorTable)(); return; } //@@ 00a34430 FUN_00a34430 void FUN_00a34430(void) { epoxy_glCopyColorTableSGI = (undefined *)FUN_00a2ca10(&DAT_00b26268); /* WARNING: Could not recover jumptable at 0x00a34450. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyColorTableSGI)(); return; } //@@ 00a34460 FUN_00a34460 void FUN_00a34460(void) { epoxy_glCopyConvolutionFilter1D = (undefined *)FUN_00a2ca10(&DAT_00b3bd94); /* WARNING: Could not recover jumptable at 0x00a34480. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyConvolutionFilter1D)(); return; } //@@ 00a34490 FUN_00a34490 void FUN_00a34490(void) { epoxy_glCopyConvolutionFilter1DEXT = (undefined *)FUN_00a2ca10(0xb3c700); /* WARNING: Could not recover jumptable at 0x00a344b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyConvolutionFilter1DEXT)(); return; } //@@ 00a344c0 FUN_00a344c0 void FUN_00a344c0(void) { epoxy_glCopyConvolutionFilter2D = (undefined *)FUN_00a2ca10(&DAT_00b3d768); /* WARNING: Could not recover jumptable at 0x00a344e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyConvolutionFilter2D)(); return; } //@@ 00a344f0 FUN_00a344f0 void FUN_00a344f0(void) { epoxy_glCopyConvolutionFilter2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3ca0c); /* WARNING: Could not recover jumptable at 0x00a34510. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyConvolutionFilter2DEXT)(); return; } //@@ 00a34520 FUN_00a34520 void FUN_00a34520(void) { epoxy_glCopyImageSubData = (undefined *)FUN_00a2ca10(&DAT_00b28b34); /* WARNING: Could not recover jumptable at 0x00a34540. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyImageSubData)(); return; } //@@ 00a34550 FUN_00a34550 void FUN_00a34550(void) { epoxy_glCopyImageSubDataEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a724); /* WARNING: Could not recover jumptable at 0x00a34570. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyImageSubDataEXT)(); return; } //@@ 00a34580 FUN_00a34580 void FUN_00a34580(void) { epoxy_glCopyImageSubDataNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyImageSubDataNV)(); return; } //@@ 00a345a0 FUN_00a345a0 void FUN_00a345a0(void) { epoxy_glCopyImageSubDataOES = (undefined *)FUN_00a2ca10(&DAT_00b3d1a0); /* WARNING: Could not recover jumptable at 0x00a345c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyImageSubDataOES)(); return; } //@@ 00a345d0 FUN_00a345d0 void FUN_00a345d0(void) { epoxy_glCopyMultiTexImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a345e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyMultiTexImage1DEXT)(); return; } //@@ 00a345f0 FUN_00a345f0 void FUN_00a345f0(void) { epoxy_glCopyMultiTexImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34608. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyMultiTexImage2DEXT)(); return; } //@@ 00a34610 FUN_00a34610 void FUN_00a34610(void) { epoxy_glCopyMultiTexSubImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyMultiTexSubImage1DEXT)(); return; } //@@ 00a34630 FUN_00a34630 void FUN_00a34630(void) { epoxy_glCopyMultiTexSubImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34648. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyMultiTexSubImage2DEXT)(); return; } //@@ 00a34650 FUN_00a34650 void FUN_00a34650(void) { epoxy_glCopyMultiTexSubImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34668. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyMultiTexSubImage3DEXT)(); return; } //@@ 00a34670 FUN_00a34670 void FUN_00a34670(void) { epoxy_glCopyNamedBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b27c18); /* WARNING: Could not recover jumptable at 0x00a34690. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyNamedBufferSubData)(); return; } //@@ 00a346a0 FUN_00a346a0 void FUN_00a346a0(void) { epoxy_glCopyPathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a346b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyPathNV)(); return; } //@@ 00a346c0 FUN_00a346c0 void FUN_00a346c0(void) { epoxy_glCopyPixels = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a346d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyPixels)(); return; } //@@ 00a346e0 FUN_00a346e0 void FUN_00a346e0(void) { epoxy_glCopyTexImage1D = (undefined *)FUN_00a2ca10(&DAT_00b2947c); /* WARNING: Could not recover jumptable at 0x00a34700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexImage1D)(); return; } //@@ 00a34710 FUN_00a34710 void FUN_00a34710(void) { epoxy_glCopyTexImage1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d5d0); /* WARNING: Could not recover jumptable at 0x00a34730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexImage1DEXT)(); return; } //@@ 00a34740 FUN_00a34740 void FUN_00a34740(void) { epoxy_glCopyTexImage2D = (undefined *)FUN_00a2ca10(&DAT_00b297b8); /* WARNING: Could not recover jumptable at 0x00a34760. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexImage2D)(); return; } //@@ 00a34770 FUN_00a34770 void FUN_00a34770(void) { epoxy_glCopyTexImage2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a4c8); /* WARNING: Could not recover jumptable at 0x00a34790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexImage2DEXT)(); return; } //@@ 00a347a0 FUN_00a347a0 void FUN_00a347a0(void) { epoxy_glCopyTexSubImage1D = (undefined *)FUN_00a2ca10(&DAT_00b3bcdc); /* WARNING: Could not recover jumptable at 0x00a347c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage1D)(); return; } //@@ 00a347d0 FUN_00a347d0 void FUN_00a347d0(void) { epoxy_glCopyTexSubImage1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b28acc); /* WARNING: Could not recover jumptable at 0x00a347f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage1DEXT)(); return; } //@@ 00a34800 FUN_00a34800 void FUN_00a34800(void) { epoxy_glCopyTexSubImage2D = (undefined *)FUN_00a2ca10(&DAT_00b27aa8); /* WARNING: Could not recover jumptable at 0x00a34820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage2D)(); return; } //@@ 00a34830 FUN_00a34830 void FUN_00a34830(void) { epoxy_glCopyTexSubImage2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b2906c); /* WARNING: Could not recover jumptable at 0x00a34850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage2DEXT)(); return; } //@@ 00a34860 FUN_00a34860 void FUN_00a34860(void) { epoxy_glCopyTexSubImage3D = (undefined *)FUN_00a2ca10(&DAT_00b2ae1c); /* WARNING: Could not recover jumptable at 0x00a34880. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage3D)(); return; } //@@ 00a34890 FUN_00a34890 void FUN_00a34890(void) { epoxy_glCopyTexSubImage3DEXT = (undefined *)FUN_00a2ca10(&DAT_00b29658); /* WARNING: Could not recover jumptable at 0x00a348b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage3DEXT)(); return; } //@@ 00a348c0 FUN_00a348c0 void FUN_00a348c0(void) { epoxy_glCopyTexSubImage3DOES = (undefined *)FUN_00a2ca10(&DAT_00b269e4); /* WARNING: Could not recover jumptable at 0x00a348e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTexSubImage3DOES)(); return; } //@@ 00a348f0 FUN_00a348f0 void FUN_00a348f0(void) { epoxy_glCopyTextureImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34908. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureImage1DEXT)(); return; } //@@ 00a34910 FUN_00a34910 void FUN_00a34910(void) { epoxy_glCopyTextureImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34928. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureImage2DEXT)(); return; } //@@ 00a34930 FUN_00a34930 void FUN_00a34930(void) { epoxy_glCopyTextureLevelsAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34948. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureLevelsAPPLE)(); return; } //@@ 00a34950 FUN_00a34950 void FUN_00a34950(void) { epoxy_glCopyTextureSubImage1D = (undefined *)FUN_00a2ca10(&DAT_00b3b2a8); /* WARNING: Could not recover jumptable at 0x00a34970. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureSubImage1D)(); return; } //@@ 00a34980 FUN_00a34980 void FUN_00a34980(void) { epoxy_glCopyTextureSubImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34998. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureSubImage1DEXT)(); return; } //@@ 00a349a0 FUN_00a349a0 void FUN_00a349a0(void) { epoxy_glCopyTextureSubImage2D = (undefined *)FUN_00a2ca10(&DAT_00b3c5f4); /* WARNING: Could not recover jumptable at 0x00a349c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureSubImage2D)(); return; } //@@ 00a349d0 FUN_00a349d0 void FUN_00a349d0(void) { epoxy_glCopyTextureSubImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a349e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureSubImage2DEXT)(); return; } //@@ 00a349f0 FUN_00a349f0 void FUN_00a349f0(void) { epoxy_glCopyTextureSubImage3D = (undefined *)FUN_00a2ca10(&DAT_00b3c890); /* WARNING: Could not recover jumptable at 0x00a34a10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureSubImage3D)(); return; } //@@ 00a34a20 FUN_00a34a20 void FUN_00a34a20(void) { epoxy_glCopyTextureSubImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34a38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCopyTextureSubImage3DEXT)(); return; } //@@ 00a34a40 FUN_00a34a40 void FUN_00a34a40(void) { epoxy_glCoverFillPathInstancedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34a58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverFillPathInstancedNV)(); return; } //@@ 00a34a60 FUN_00a34a60 void FUN_00a34a60(void) { epoxy_glCoverFillPathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34a78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverFillPathNV)(); return; } //@@ 00a34a80 FUN_00a34a80 void FUN_00a34a80(void) { epoxy_glCoverStrokePathInstancedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34a98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverStrokePathInstancedNV)(); return; } //@@ 00a34aa0 FUN_00a34aa0 void FUN_00a34aa0(void) { epoxy_glCoverStrokePathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34ab8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverStrokePathNV)(); return; } //@@ 00a34ac0 FUN_00a34ac0 void FUN_00a34ac0(void) { epoxy_glCoverageMaskNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34ad8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverageMaskNV)(); return; } //@@ 00a34ae0 FUN_00a34ae0 void FUN_00a34ae0(void) { epoxy_glCoverageModulationNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34af8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverageModulationNV)(); return; } //@@ 00a34b00 FUN_00a34b00 void FUN_00a34b00(void) { epoxy_glCoverageModulationTableNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34b18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverageModulationTableNV)(); return; } //@@ 00a34b20 FUN_00a34b20 void FUN_00a34b20(void) { epoxy_glCoverageOperationNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34b38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCoverageOperationNV)(); return; } //@@ 00a34b40 FUN_00a34b40 void FUN_00a34b40(void) { epoxy_glCreateBuffers = (undefined *)FUN_00a2ca10(&DAT_00b27de4); /* WARNING: Could not recover jumptable at 0x00a34b60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateBuffers)(); return; } //@@ 00a34b70 FUN_00a34b70 void FUN_00a34b70(void) { epoxy_glCreateCommandListsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34b88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateCommandListsNV)(); return; } //@@ 00a34b90 FUN_00a34b90 void FUN_00a34b90(void) { epoxy_glCreateFramebuffers = (undefined *)FUN_00a2ca10(&DAT_00b29c34); /* WARNING: Could not recover jumptable at 0x00a34bb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateFramebuffers)(); return; } //@@ 00a34bc0 FUN_00a34bc0 void FUN_00a34bc0(void) { epoxy_glCreatePerfQueryINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreatePerfQueryINTEL)(); return; } //@@ 00a34be0 FUN_00a34be0 void FUN_00a34be0(void) { epoxy_glCreateProgram = (undefined *)FUN_00a2ca10(&DAT_00b2847c); /* WARNING: Could not recover jumptable at 0x00a34bfc. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateProgram)(); return; } //@@ 00a34c20 FUN_00a34c20 void FUN_00a34c20(void) { epoxy_glCreateProgramPipelines = (undefined *)FUN_00a2ca10(&DAT_00b26b64); /* WARNING: Could not recover jumptable at 0x00a34c40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateProgramPipelines)(); return; } //@@ 00a34c50 FUN_00a34c50 void FUN_00a34c50(void) { epoxy_glCreateQueries = (undefined *)FUN_00a2ca10(&DAT_00b26d38); /* WARNING: Could not recover jumptable at 0x00a34c70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateQueries)(); return; } //@@ 00a34c80 FUN_00a34c80 void FUN_00a34c80(void) { epoxy_glCreateRenderbuffers = (undefined *)FUN_00a2ca10(&DAT_00b3b0d4); /* WARNING: Could not recover jumptable at 0x00a34ca0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateRenderbuffers)(); return; } //@@ 00a34cb0 FUN_00a34cb0 void FUN_00a34cb0(void) { epoxy_glCreateSamplers = (undefined *)FUN_00a2ca10(&DAT_00b29654); /* WARNING: Could not recover jumptable at 0x00a34cd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateSamplers)(); return; } //@@ 00a34ce0 FUN_00a34ce0 void FUN_00a34ce0(void) { epoxy_glCreateShader = (undefined *)FUN_00a2ca10("/ / > "); /* WARNING: Could not recover jumptable at 0x00a34d00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateShader)(); return; } //@@ 00a34d10 FUN_00a34d10 void FUN_00a34d10(void) { epoxy_glCreateShaderObjectARB = (undefined *)FUN_00a2ca10("> / / "); /* WARNING: Could not recover jumptable at 0x00a34d30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateShaderObjectARB)(); return; } //@@ 00a34d40 FUN_00a34d40 void FUN_00a34d40(void) { epoxy_glCreateShaderProgramEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34d58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateShaderProgramEXT)(); return; } //@@ 00a34d60 FUN_00a34d60 void FUN_00a34d60(void) { epoxy_glCreateShaderProgramv = (undefined *)FUN_00a2ca10("o o o "); /* WARNING: Could not recover jumptable at 0x00a34d80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateShaderProgramv)(); return; } //@@ 00a34d90 FUN_00a34d90 void FUN_00a34d90(void) { epoxy_glCreateShaderProgramvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateShaderProgramvEXT)(); return; } //@@ 00a34db0 FUN_00a34db0 void FUN_00a34db0(void) { epoxy_glCreateStatesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34dc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateStatesNV)(); return; } //@@ 00a34dd0 FUN_00a34dd0 void FUN_00a34dd0(void) { epoxy_glCreateSyncFromCLeventARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34de8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateSyncFromCLeventARB)(); return; } //@@ 00a34df0 FUN_00a34df0 void FUN_00a34df0(void) { epoxy_glCreateTextures = (undefined *)FUN_00a2ca10(&DAT_00b29150); /* WARNING: Could not recover jumptable at 0x00a34e10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateTextures)(); return; } //@@ 00a34e20 FUN_00a34e20 void FUN_00a34e20(void) { epoxy_glCreateTransformFeedbacks = (undefined *)FUN_00a2ca10(&DAT_00b28628); /* WARNING: Could not recover jumptable at 0x00a34e40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateTransformFeedbacks)(); return; } //@@ 00a34e50 FUN_00a34e50 void FUN_00a34e50(void) { epoxy_glCreateVertexArrays = (undefined *)FUN_00a2ca10(&DAT_00b3d424); /* WARNING: Could not recover jumptable at 0x00a34e70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCreateVertexArrays)(); return; } //@@ 00a34e80 FUN_00a34e80 void FUN_00a34e80(void) { epoxy_glCullFace = (undefined *)FUN_00a2ca10("\r!\r!\r!"); /* WARNING: Could not recover jumptable at 0x00a34ea0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCullFace)(); return; } //@@ 00a34eb0 FUN_00a34eb0 void FUN_00a34eb0(void) { epoxy_glCullParameterdvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34ec8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCullParameterdvEXT)(); return; } //@@ 00a34ed0 FUN_00a34ed0 void FUN_00a34ed0(void) { epoxy_glCullParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCullParameterfvEXT)(); return; } //@@ 00a34ef0 FUN_00a34ef0 void FUN_00a34ef0(void) { epoxy_glCurrentPaletteMatrixARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34f08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCurrentPaletteMatrixARB)(); return; } //@@ 00a34f10 FUN_00a34f10 void FUN_00a34f10(void) { epoxy_glCurrentPaletteMatrixOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34f28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glCurrentPaletteMatrixOES)(); return; } //@@ 00a34f30 FUN_00a34f30 void FUN_00a34f30(void) { epoxy_glDebugMessageCallback = (undefined *)FUN_00a2ca10(&DAT_00b2a668); /* WARNING: Could not recover jumptable at 0x00a34f50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageCallback)(); return; } //@@ 00a34f60 FUN_00a34f60 void FUN_00a34f60(void) { epoxy_glDebugMessageCallbackAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a34f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageCallbackAMD)(); return; } //@@ 00a34f80 FUN_00a34f80 void FUN_00a34f80(void) { epoxy_glDebugMessageCallbackARB = (undefined *)FUN_00a2ca10(&DAT_00b271d8); /* WARNING: Could not recover jumptable at 0x00a34fa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageCallbackARB)(); return; } //@@ 00a34fb0 FUN_00a34fb0 void FUN_00a34fb0(void) { epoxy_glDebugMessageCallbackKHR = (undefined *)FUN_00a2ca10(&DAT_00b3c38c); /* WARNING: Could not recover jumptable at 0x00a34fd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageCallbackKHR)(); return; } //@@ 00a34fe0 FUN_00a34fe0 void FUN_00a34fe0(void) { epoxy_glDebugMessageControl = (undefined *)FUN_00a2ca10(&DAT_00b3ca18); /* WARNING: Could not recover jumptable at 0x00a35000. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageControl)(); return; } //@@ 00a35010 FUN_00a35010 void FUN_00a35010(void) { epoxy_glDebugMessageControlARB = (undefined *)FUN_00a2ca10(&DAT_00b25e84); /* WARNING: Could not recover jumptable at 0x00a35030. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageControlARB)(); return; } //@@ 00a35040 FUN_00a35040 void FUN_00a35040(void) { epoxy_glDebugMessageControlKHR = (undefined *)FUN_00a2ca10(&DAT_00b3c5a4); /* WARNING: Could not recover jumptable at 0x00a35060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageControlKHR)(); return; } //@@ 00a35070 FUN_00a35070 void FUN_00a35070(void) { epoxy_glDebugMessageEnableAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35088. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageEnableAMD)(); return; } //@@ 00a35090 FUN_00a35090 void FUN_00a35090(void) { epoxy_glDebugMessageInsert = (undefined *)FUN_00a2ca10(&DAT_00b28ea0); /* WARNING: Could not recover jumptable at 0x00a350b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageInsert)(); return; } //@@ 00a350c0 FUN_00a350c0 void FUN_00a350c0(void) { epoxy_glDebugMessageInsertAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a350d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageInsertAMD)(); return; } //@@ 00a350e0 FUN_00a350e0 void FUN_00a350e0(void) { epoxy_glDebugMessageInsertARB = (undefined *)FUN_00a2ca10(&DAT_00b2a2f0); /* WARNING: Could not recover jumptable at 0x00a35100. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageInsertARB)(); return; } //@@ 00a35110 FUN_00a35110 void FUN_00a35110(void) { epoxy_glDebugMessageInsertKHR = (undefined *)FUN_00a2ca10(&DAT_00b25bb8); /* WARNING: Could not recover jumptable at 0x00a35130. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDebugMessageInsertKHR)(); return; } //@@ 00a35140 FUN_00a35140 void FUN_00a35140(void) { epoxy_glDeformSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35158. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeformSGIX)(); return; } //@@ 00a35160 FUN_00a35160 void FUN_00a35160(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4, undefined4 param_5,undefined8 param_6,undefined8 param_7,undefined4 param_8, undefined4 param_9,undefined8 param_10,undefined8 param_11,undefined4 param_12, undefined4 param_13,undefined4 param_14) { epoxy_glDeformationMap3dSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDeformationMap3dSGIX) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12,param_13,param_14); return; } //@@ 00a351f0 FUN_00a351f0 void FUN_00a351f0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12, undefined4 param_13,undefined4 param_14) { epoxy_glDeformationMap3fSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDeformationMap3fSGIX) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12,param_13,param_14); return; } //@@ 00a35270 FUN_00a35270 void FUN_00a35270(void) { epoxy_glDeleteAsyncMarkersSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35288. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteAsyncMarkersSGIX)(); return; } //@@ 00a35290 FUN_00a35290 void FUN_00a35290(void) { epoxy_glDeleteBuffers = (undefined *)FUN_00a2ca10(&DAT_00b3b3d8); /* WARNING: Could not recover jumptable at 0x00a352b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteBuffers)(); return; } //@@ 00a352c0 FUN_00a352c0 void FUN_00a352c0(void) { epoxy_glDeleteBuffersARB = (undefined *)FUN_00a2ca10(&DAT_00b3bbc4); /* WARNING: Could not recover jumptable at 0x00a352e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteBuffersARB)(); return; } //@@ 00a352f0 FUN_00a352f0 void FUN_00a352f0(void) { epoxy_glDeleteCommandListsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteCommandListsNV)(); return; } //@@ 00a35310 FUN_00a35310 void FUN_00a35310(void) { epoxy_glDeleteFencesAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteFencesAPPLE)(); return; } //@@ 00a35330 FUN_00a35330 void FUN_00a35330(void) { epoxy_glDeleteFencesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteFencesNV)(); return; } //@@ 00a35350 FUN_00a35350 void FUN_00a35350(void) { epoxy_glDeleteFragmentShaderATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteFragmentShaderATI)(); return; } //@@ 00a35370 FUN_00a35370 void FUN_00a35370(void) { epoxy_glDeleteFramebuffers = (undefined *)FUN_00a2ca10(&DAT_00b286a8); /* WARNING: Could not recover jumptable at 0x00a35390. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteFramebuffers)(); return; } //@@ 00a353a0 FUN_00a353a0 void FUN_00a353a0(void) { epoxy_glDeleteFramebuffersEXT = (undefined *)FUN_00a2ca10(&DAT_00b28cd4); /* WARNING: Could not recover jumptable at 0x00a353c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteFramebuffersEXT)(); return; } //@@ 00a353d0 FUN_00a353d0 void FUN_00a353d0(void) { epoxy_glDeleteFramebuffersOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a353e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteFramebuffersOES)(); return; } //@@ 00a353f0 FUN_00a353f0 void FUN_00a353f0(void) { epoxy_glDeleteLists = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteLists)(); return; } //@@ 00a35410 FUN_00a35410 void FUN_00a35410(void) { epoxy_glDeleteNamedStringARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteNamedStringARB)(); return; } //@@ 00a35430 FUN_00a35430 void FUN_00a35430(void) { epoxy_glDeleteNamesAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35448. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteNamesAMD)(); return; } //@@ 00a35450 FUN_00a35450 void FUN_00a35450(void) { epoxy_glDeleteObjectARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteObjectARB)(); return; } //@@ 00a35470 FUN_00a35470 void FUN_00a35470(void) { epoxy_glDeleteOcclusionQueriesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35488. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteOcclusionQueriesNV)(); return; } //@@ 00a35490 FUN_00a35490 void FUN_00a35490(void) { epoxy_glDeletePathsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a354a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeletePathsNV)(); return; } //@@ 00a354b0 FUN_00a354b0 void FUN_00a354b0(void) { epoxy_glDeletePerfMonitorsAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a354c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeletePerfMonitorsAMD)(); return; } //@@ 00a354d0 FUN_00a354d0 void FUN_00a354d0(void) { epoxy_glDeletePerfQueryINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a354e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeletePerfQueryINTEL)(); return; } //@@ 00a354f0 FUN_00a354f0 void FUN_00a354f0(void) { epoxy_glDeleteProgram = (undefined *)FUN_00a2ca10(&DAT_00b2aa18); /* WARNING: Could not recover jumptable at 0x00a35510. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteProgram)(); return; } //@@ 00a35520 FUN_00a35520 void FUN_00a35520(void) { epoxy_glDeleteProgramPipelines = (undefined *)FUN_00a2ca10("\\$\\$\\$"); /* WARNING: Could not recover jumptable at 0x00a35540. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteProgramPipelines)(); return; } //@@ 00a35550 FUN_00a35550 void FUN_00a35550(void) { epoxy_glDeleteProgramPipelinesEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35568. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteProgramPipelinesEXT)(); return; } //@@ 00a35570 FUN_00a35570 void FUN_00a35570(void) { epoxy_glDeleteProgramsARB = (undefined *)FUN_00a2ca10(&DAT_00b29890); /* WARNING: Could not recover jumptable at 0x00a35590. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteProgramsARB)(); return; } //@@ 00a355a0 FUN_00a355a0 void FUN_00a355a0(void) { epoxy_glDeleteProgramsNV = (undefined *)FUN_00a2ca10(&DAT_00b2a4a4); /* WARNING: Could not recover jumptable at 0x00a355c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteProgramsNV)(); return; } //@@ 00a355d0 FUN_00a355d0 void FUN_00a355d0(void) { epoxy_glDeleteQueries = (undefined *)FUN_00a2ca10(&DAT_00b297e8); /* WARNING: Could not recover jumptable at 0x00a355f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteQueries)(); return; } //@@ 00a35600 FUN_00a35600 void FUN_00a35600(void) { epoxy_glDeleteQueriesARB = (undefined *)FUN_00a2ca10(&DAT_00b255fc); /* WARNING: Could not recover jumptable at 0x00a35620. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteQueriesARB)(); return; } //@@ 00a35630 FUN_00a35630 void FUN_00a35630(void) { epoxy_glDeleteQueriesEXT = (undefined *)FUN_00a2ca10(&DAT_00b2ab58); /* WARNING: Could not recover jumptable at 0x00a35650. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteQueriesEXT)(); return; } //@@ 00a35660 FUN_00a35660 void FUN_00a35660(void) { epoxy_glDeleteRenderbuffers = (undefined *)FUN_00a2ca10(&DAT_00b282c4); /* WARNING: Could not recover jumptable at 0x00a35680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteRenderbuffers)(); return; } //@@ 00a35690 FUN_00a35690 void FUN_00a35690(void) { epoxy_glDeleteRenderbuffersEXT = (undefined *)FUN_00a2ca10(&DAT_00b283f0); /* WARNING: Could not recover jumptable at 0x00a356b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteRenderbuffersEXT)(); return; } //@@ 00a356c0 FUN_00a356c0 void FUN_00a356c0(void) { epoxy_glDeleteRenderbuffersOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a356d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteRenderbuffersOES)(); return; } //@@ 00a356e0 FUN_00a356e0 void FUN_00a356e0(void) { epoxy_glDeleteSamplers = (undefined *)FUN_00a2ca10("6%6%6%"); /* WARNING: Could not recover jumptable at 0x00a35700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteSamplers)(); return; } //@@ 00a35710 FUN_00a35710 void FUN_00a35710(void) { epoxy_glDeleteShader = (undefined *)FUN_00a2ca10(&DAT_00b3c650); /* WARNING: Could not recover jumptable at 0x00a35730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteShader)(); return; } //@@ 00a35740 FUN_00a35740 void FUN_00a35740(void) { epoxy_glDeleteStatesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteStatesNV)(); return; } //@@ 00a35760 FUN_00a35760 void FUN_00a35760(void) { epoxy_glDeleteSync = (undefined *)FUN_00a2ca10(&DAT_00b28dd0); /* WARNING: Could not recover jumptable at 0x00a35780. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteSync)(); return; } //@@ 00a35790 FUN_00a35790 void FUN_00a35790(void) { epoxy_glDeleteSyncAPPLE = (undefined *)FUN_00a2ca10("t%g%g%g%"); /* WARNING: Could not recover jumptable at 0x00a357b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteSyncAPPLE)(); return; } //@@ 00a357c0 FUN_00a357c0 void FUN_00a357c0(void) { epoxy_glDeleteTextures = (undefined *)FUN_00a2ca10(&DAT_00b294ec); /* WARNING: Could not recover jumptable at 0x00a357e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteTextures)(); return; } //@@ 00a357f0 FUN_00a357f0 void FUN_00a357f0(void) { epoxy_glDeleteTexturesEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35808. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteTexturesEXT)(); return; } //@@ 00a35810 FUN_00a35810 void FUN_00a35810(void) { epoxy_glDeleteTransformFeedbacks = (undefined *)FUN_00a2ca10(&DAT_00b3ca34); /* WARNING: Could not recover jumptable at 0x00a35830. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteTransformFeedbacks)(); return; } //@@ 00a35840 FUN_00a35840 void FUN_00a35840(void) { epoxy_glDeleteTransformFeedbacksNV = (undefined *)FUN_00a2ca10(&DAT_00b27414); /* WARNING: Could not recover jumptable at 0x00a35860. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteTransformFeedbacksNV)(); return; } //@@ 00a35870 FUN_00a35870 void FUN_00a35870(void) { epoxy_glDeleteVertexArrays = (undefined *)FUN_00a2ca10(&DAT_00b3d84c); /* WARNING: Could not recover jumptable at 0x00a35890. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteVertexArrays)(); return; } //@@ 00a358a0 FUN_00a358a0 void FUN_00a358a0(void) { epoxy_glDeleteVertexArraysAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b292c4); /* WARNING: Could not recover jumptable at 0x00a358c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteVertexArraysAPPLE)(); return; } //@@ 00a358d0 FUN_00a358d0 void FUN_00a358d0(void) { epoxy_glDeleteVertexArraysOES = (undefined *)FUN_00a2ca10(&DAT_00b290b8); /* WARNING: Could not recover jumptable at 0x00a358f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteVertexArraysOES)(); return; } //@@ 00a35900 FUN_00a35900 void FUN_00a35900(void) { epoxy_glDeleteVertexShaderEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35918. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDeleteVertexShaderEXT)(); return; } //@@ 00a35920 FUN_00a35920 void FUN_00a35920(undefined8 param_1,undefined8 param_2) { epoxy_glDepthBoundsEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDepthBoundsEXT)(param_1,param_2); return; } //@@ 00a35960 FUN_00a35960 void FUN_00a35960(undefined8 param_1,undefined8 param_2) { epoxy_glDepthBoundsdNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDepthBoundsdNV)(param_1,param_2); return; } //@@ 00a359a0 FUN_00a359a0 void FUN_00a359a0(void) { epoxy_glDepthFunc = (undefined *)FUN_00a2ca10("d&d&d&"); /* WARNING: Could not recover jumptable at 0x00a359c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDepthFunc)(); return; } //@@ 00a359d0 FUN_00a359d0 void FUN_00a359d0(void) { epoxy_glDepthMask = (undefined *)FUN_00a2ca10("p&p&p&"); /* WARNING: Could not recover jumptable at 0x00a359f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDepthMask)(); return; } //@@ 00a35a00 FUN_00a35a00 void FUN_00a35a00(undefined8 param_1,undefined8 param_2) { epoxy_glDepthRange = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDepthRange)(param_1,param_2); return; } //@@ 00a35a40 FUN_00a35a40 void FUN_00a35a40(void) { epoxy_glDepthRangeArrayfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35a58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDepthRangeArrayfvNV)(); return; } //@@ 00a35a60 FUN_00a35a60 void FUN_00a35a60(void) { epoxy_glDepthRangeArrayv = (undefined *)FUN_00a2ca10(&DAT_00b2ac84); /* WARNING: Could not recover jumptable at 0x00a35a80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDepthRangeArrayv)(); return; } //@@ 00a35a90 FUN_00a35a90 void FUN_00a35a90(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glDepthRangeIndexed = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glDepthRangeIndexed)(param_1,param_2,param_3); return; } //@@ 00a35ae0 FUN_00a35ae0 void FUN_00a35ae0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glDepthRangeIndexedfNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDepthRangeIndexedfNV)(param_1,param_2,param_3); return; } //@@ 00a35b20 FUN_00a35b20 void FUN_00a35b20(undefined8 param_1,undefined8 param_2) { epoxy_glDepthRangedNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDepthRangedNV)(param_1,param_2); return; } //@@ 00a35b60 FUN_00a35b60 void FUN_00a35b60(undefined4 param_1,undefined4 param_2) { epoxy_glDepthRangef = (undefined *)FUN_00a2ca10(&DAT_00b27d44); (*(code *)epoxy_glDepthRangef)(param_1,param_2); return; } //@@ 00a35ba0 FUN_00a35ba0 void FUN_00a35ba0(undefined4 param_1,undefined4 param_2) { epoxy_glDepthRangefOES = (undefined *)FUN_00a2ca10(&DAT_00b3b628); (*(code *)epoxy_glDepthRangefOES)(param_1,param_2); return; } //@@ 00a35be0 FUN_00a35be0 void FUN_00a35be0(void) { epoxy_glDepthRangex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35bf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDepthRangex)(); return; } //@@ 00a35c00 FUN_00a35c00 void FUN_00a35c00(void) { epoxy_glDepthRangexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35c18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDepthRangexOES)(); return; } //@@ 00a35c20 FUN_00a35c20 void FUN_00a35c20(void) { epoxy_glDetachObjectARB = (undefined *)FUN_00a2ca10("+\'=\'=\'"); /* WARNING: Could not recover jumptable at 0x00a35c40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDetachObjectARB)(); return; } //@@ 00a35c50 FUN_00a35c50 void FUN_00a35c50(void) { epoxy_glDetachShader = (undefined *)FUN_00a2ca10("=\'=\'+\'"); /* WARNING: Could not recover jumptable at 0x00a35c70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDetachShader)(); return; } //@@ 00a35c80 FUN_00a35c80 void FUN_00a35c80(void) { epoxy_glDetailTexFuncSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDetailTexFuncSGIS)(); return; } //@@ 00a35ca0 FUN_00a35ca0 void FUN_00a35ca0(void) { epoxy_glDisable = (undefined *)FUN_00a2ca10("`\'`\'`\'"); /* WARNING: Could not recover jumptable at 0x00a35cc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisable)(); return; } //@@ 00a35cd0 FUN_00a35cd0 void FUN_00a35cd0(void) { epoxy_glDisableClientState = (undefined *)FUN_00a2ca10(&DAT_00b3c57c); /* WARNING: Could not recover jumptable at 0x00a35cf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableClientState)(); return; } //@@ 00a35d00 FUN_00a35d00 void FUN_00a35d00(void) { epoxy_glDisableClientStateIndexedEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableClientStateIndexedEXT)(); return; } //@@ 00a35d20 FUN_00a35d20 void FUN_00a35d20(void) { epoxy_glDisableClientStateiEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35d38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableClientStateiEXT)(); return; } //@@ 00a35d40 FUN_00a35d40 void FUN_00a35d40(void) { epoxy_glDisableDriverControlQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35d58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableDriverControlQCOM)(); return; } //@@ 00a35d60 FUN_00a35d60 void FUN_00a35d60(void) { epoxy_glDisableIndexedEXT = (undefined *)FUN_00a2ca10(&DAT_00b28578); /* WARNING: Could not recover jumptable at 0x00a35d80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableIndexedEXT)(); return; } //@@ 00a35d90 FUN_00a35d90 void FUN_00a35d90(void) { epoxy_glDisableVariantClientStateEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVariantClientStateEXT)(); return; } //@@ 00a35db0 FUN_00a35db0 void FUN_00a35db0(void) { epoxy_glDisableVertexArrayAttrib = (undefined *)FUN_00a2ca10(&DAT_00b28b68); /* WARNING: Could not recover jumptable at 0x00a35dd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVertexArrayAttrib)(); return; } //@@ 00a35de0 FUN_00a35de0 void FUN_00a35de0(void) { epoxy_glDisableVertexArrayAttribEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVertexArrayAttribEXT)(); return; } //@@ 00a35e00 FUN_00a35e00 void FUN_00a35e00(void) { epoxy_glDisableVertexArrayEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35e18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVertexArrayEXT)(); return; } //@@ 00a35e20 FUN_00a35e20 void FUN_00a35e20(void) { epoxy_glDisableVertexAttribAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35e38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVertexAttribAPPLE)(); return; } //@@ 00a35e40 FUN_00a35e40 void FUN_00a35e40(void) { epoxy_glDisableVertexAttribArray = (undefined *)FUN_00a2ca10(&DAT_00b3d604); /* WARNING: Could not recover jumptable at 0x00a35e60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVertexAttribArray)(); return; } //@@ 00a35e70 FUN_00a35e70 void FUN_00a35e70(void) { epoxy_glDisableVertexAttribArrayARB = (undefined *)FUN_00a2ca10(&DAT_00b3b480); /* WARNING: Could not recover jumptable at 0x00a35e90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableVertexAttribArrayARB)(); return; } //@@ 00a35ea0 FUN_00a35ea0 void FUN_00a35ea0(void) { epoxy_glDisablei = (undefined *)FUN_00a2ca10(&DAT_00b3d35c); /* WARNING: Could not recover jumptable at 0x00a35ec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisablei)(); return; } //@@ 00a35ed0 FUN_00a35ed0 void FUN_00a35ed0(void) { epoxy_glDisableiEXT = (undefined *)FUN_00a2ca10(&DAT_00b3bf6c); /* WARNING: Could not recover jumptable at 0x00a35ef0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableiEXT)(); return; } //@@ 00a35f00 FUN_00a35f00 void FUN_00a35f00(void) { epoxy_glDisableiNV = (undefined *)FUN_00a2ca10(&DAT_00b2acf8); /* WARNING: Could not recover jumptable at 0x00a35f20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableiNV)(); return; } //@@ 00a35f30 FUN_00a35f30 void FUN_00a35f30(void) { epoxy_glDisableiOES = (undefined *)FUN_00a2ca10(&DAT_00b284a8); /* WARNING: Could not recover jumptable at 0x00a35f50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDisableiOES)(); return; } //@@ 00a35f60 FUN_00a35f60 void FUN_00a35f60(void) { epoxy_glDiscardFramebufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDiscardFramebufferEXT)(); return; } //@@ 00a35f80 FUN_00a35f80 void FUN_00a35f80(void) { epoxy_glDispatchCompute = (undefined *)FUN_00a2ca10(&DAT_00b29f7c); /* WARNING: Could not recover jumptable at 0x00a35fa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDispatchCompute)(); return; } //@@ 00a35fb0 FUN_00a35fb0 void FUN_00a35fb0(void) { epoxy_glDispatchComputeGroupSizeARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a35fc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDispatchComputeGroupSizeARB)(); return; } //@@ 00a35fd0 FUN_00a35fd0 void FUN_00a35fd0(void) { epoxy_glDispatchComputeIndirect = (undefined *)FUN_00a2ca10("&)&)&)"); /* WARNING: Could not recover jumptable at 0x00a35ff0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDispatchComputeIndirect)(); return; } //@@ 00a36000 FUN_00a36000 void FUN_00a36000(void) { epoxy_glDrawArrays = (undefined *)FUN_00a2ca10(&DAT_00b27898); /* WARNING: Could not recover jumptable at 0x00a36020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArrays)(); return; } //@@ 00a36030 FUN_00a36030 void FUN_00a36030(void) { epoxy_glDrawArraysEXT = (undefined *)FUN_00a2ca10(&DAT_00b25328); /* WARNING: Could not recover jumptable at 0x00a36050. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysEXT)(); return; } //@@ 00a36060 FUN_00a36060 void FUN_00a36060(void) { epoxy_glDrawArraysIndirect = (undefined *)FUN_00a2ca10("])])])"); /* WARNING: Could not recover jumptable at 0x00a36080. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysIndirect)(); return; } //@@ 00a36090 FUN_00a36090 void FUN_00a36090(void) { epoxy_glDrawArraysInstanced = (undefined *)FUN_00a2ca10(&DAT_00b3d9f4); /* WARNING: Could not recover jumptable at 0x00a360b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstanced)(); return; } //@@ 00a360c0 FUN_00a360c0 void FUN_00a360c0(void) { epoxy_glDrawArraysInstancedANGLE = (undefined *)FUN_00a2ca10(&DAT_00b3c220); /* WARNING: Could not recover jumptable at 0x00a360e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstancedANGLE)(); return; } //@@ 00a360f0 FUN_00a360f0 void FUN_00a360f0(void) { epoxy_glDrawArraysInstancedARB = (undefined *)FUN_00a2ca10(&DAT_00b25b38); /* WARNING: Could not recover jumptable at 0x00a36110. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstancedARB)(); return; } //@@ 00a36120 FUN_00a36120 void FUN_00a36120(void) { epoxy_glDrawArraysInstancedBaseInstance = (undefined *)FUN_00a2ca10(&DAT_00b3d71c); /* WARNING: Could not recover jumptable at 0x00a36140. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstancedBaseInstance)(); return; } //@@ 00a36150 FUN_00a36150 void FUN_00a36150(void) { epoxy_glDrawArraysInstancedBaseInstanceEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a168); /* WARNING: Could not recover jumptable at 0x00a36170. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstancedBaseInstanceEXT)(); return; } //@@ 00a36180 FUN_00a36180 void FUN_00a36180(void) { epoxy_glDrawArraysInstancedEXT = (undefined *)FUN_00a2ca10(&DAT_00b29218); /* WARNING: Could not recover jumptable at 0x00a361a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstancedEXT)(); return; } //@@ 00a361b0 FUN_00a361b0 void FUN_00a361b0(void) { epoxy_glDrawArraysInstancedNV = (undefined *)FUN_00a2ca10(&DAT_00b26d84); /* WARNING: Could not recover jumptable at 0x00a361d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawArraysInstancedNV)(); return; } //@@ 00a361e0 FUN_00a361e0 void FUN_00a361e0(void) { epoxy_glDrawBuffer = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a361f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffer)(); return; } //@@ 00a36200 FUN_00a36200 void FUN_00a36200(void) { epoxy_glDrawBuffers = (undefined *)FUN_00a2ca10("A*A*O*`*q*"); /* WARNING: Could not recover jumptable at 0x00a36220. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffers)(); return; } //@@ 00a36230 FUN_00a36230 void FUN_00a36230(void) { epoxy_glDrawBuffersARB = (undefined *)FUN_00a2ca10("O*A*A*`*q*"); /* WARNING: Could not recover jumptable at 0x00a36250. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffersARB)(); return; } //@@ 00a36260 FUN_00a36260 void FUN_00a36260(void) { epoxy_glDrawBuffersATI = (undefined *)FUN_00a2ca10("`*A*A*O*q*"); /* WARNING: Could not recover jumptable at 0x00a36280. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffersATI)(); return; } //@@ 00a36290 FUN_00a36290 void FUN_00a36290(void) { epoxy_glDrawBuffersEXT = (undefined *)FUN_00a2ca10("q*A*A*O*`*"); /* WARNING: Could not recover jumptable at 0x00a362b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffersEXT)(); return; } //@@ 00a362c0 FUN_00a362c0 void FUN_00a362c0(void) { epoxy_glDrawBuffersIndexedEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a362d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffersIndexedEXT)(); return; } //@@ 00a362e0 FUN_00a362e0 void FUN_00a362e0(void) { epoxy_glDrawBuffersNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a362f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawBuffersNV)(); return; } //@@ 00a36300 FUN_00a36300 void FUN_00a36300(void) { epoxy_glDrawCommandsAddressNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawCommandsAddressNV)(); return; } //@@ 00a36320 FUN_00a36320 void FUN_00a36320(void) { epoxy_glDrawCommandsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36338. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawCommandsNV)(); return; } //@@ 00a36340 FUN_00a36340 void FUN_00a36340(void) { epoxy_glDrawCommandsStatesAddressNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36358. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawCommandsStatesAddressNV)(); return; } //@@ 00a36360 FUN_00a36360 void FUN_00a36360(void) { epoxy_glDrawCommandsStatesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawCommandsStatesNV)(); return; } //@@ 00a36380 FUN_00a36380 void FUN_00a36380(void) { epoxy_glDrawElementArrayAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementArrayAPPLE)(); return; } //@@ 00a363a0 FUN_00a363a0 void FUN_00a363a0(void) { epoxy_glDrawElementArrayATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a363b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementArrayATI)(); return; } //@@ 00a363c0 FUN_00a363c0 void FUN_00a363c0(void) { epoxy_glDrawElements = (undefined *)FUN_00a2ca10("6+6+6+"); /* WARNING: Could not recover jumptable at 0x00a363e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElements)(); return; } //@@ 00a363f0 FUN_00a363f0 void FUN_00a363f0(void) { epoxy_glDrawElementsBaseVertex = (undefined *)FUN_00a2ca10("E+E+^+z+"); /* WARNING: Could not recover jumptable at 0x00a36410. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsBaseVertex)(); return; } //@@ 00a36420 FUN_00a36420 void FUN_00a36420(void) { epoxy_glDrawElementsBaseVertexEXT = (undefined *)FUN_00a2ca10(&DAT_00b28ef8); /* WARNING: Could not recover jumptable at 0x00a36440. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsBaseVertexEXT)(); return; } //@@ 00a36450 FUN_00a36450 void FUN_00a36450(void) { epoxy_glDrawElementsBaseVertexOES = (undefined *)FUN_00a2ca10(&DAT_00b277a8); /* WARNING: Could not recover jumptable at 0x00a36470. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsBaseVertexOES)(); return; } //@@ 00a36480 FUN_00a36480 void FUN_00a36480(void) { epoxy_glDrawElementsIndirect = (undefined *)FUN_00a2ca10(&DAT_00b264c8); /* WARNING: Could not recover jumptable at 0x00a364a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsIndirect)(); return; } //@@ 00a364b0 FUN_00a364b0 void FUN_00a364b0(void) { epoxy_glDrawElementsInstanced = (undefined *)FUN_00a2ca10(&DAT_00b3d030); /* WARNING: Could not recover jumptable at 0x00a364d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstanced)(); return; } //@@ 00a364e0 FUN_00a364e0 void FUN_00a364e0(void) { epoxy_glDrawElementsInstancedANGLE = (undefined *)FUN_00a2ca10(&DAT_00b3c114); /* WARNING: Could not recover jumptable at 0x00a36500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedANGLE)(); return; } //@@ 00a36510 FUN_00a36510 void FUN_00a36510(void) { epoxy_glDrawElementsInstancedARB = (undefined *)FUN_00a2ca10(&DAT_00b276b0); /* WARNING: Could not recover jumptable at 0x00a36530. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedARB)(); return; } //@@ 00a36540 FUN_00a36540 void FUN_00a36540(void) { epoxy_glDrawElementsInstancedBaseInstance = (undefined *)FUN_00a2ca10(&DAT_00b3d5a8); /* WARNING: Could not recover jumptable at 0x00a36560. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseInstance)(); return; } //@@ 00a36570 FUN_00a36570 void FUN_00a36570(void) { epoxy_glDrawElementsInstancedBaseInstanceEXT = (undefined *)FUN_00a2ca10(&DAT_00b29db8); /* WARNING: Could not recover jumptable at 0x00a36590. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseInstanceEXT)(); return; } //@@ 00a365a0 FUN_00a365a0 void FUN_00a365a0(void) { epoxy_glDrawElementsInstancedBaseVertex = (undefined *)FUN_00a2ca10(&DAT_00b28144); /* WARNING: Could not recover jumptable at 0x00a365c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseVertex)(); return; } //@@ 00a365d0 FUN_00a365d0 void FUN_00a365d0(void) { epoxy_glDrawElementsInstancedBaseVertexBaseInstance = (undefined *)FUN_00a2ca10(&DAT_00b26300); /* WARNING: Could not recover jumptable at 0x00a365f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseVertexBaseInstance)(); return; } //@@ 00a36600 FUN_00a36600 void FUN_00a36600(void) { epoxy_glDrawElementsInstancedBaseVertexBaseInstanceEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c5b8); /* WARNING: Could not recover jumptable at 0x00a36620. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseVertexBaseInstanceEXT)(); return; } //@@ 00a36630 FUN_00a36630 void FUN_00a36630(void) { epoxy_glDrawElementsInstancedBaseVertexEXT = (undefined *)FUN_00a2ca10(&DAT_00b25b48); /* WARNING: Could not recover jumptable at 0x00a36650. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseVertexEXT)(); return; } //@@ 00a36660 FUN_00a36660 void FUN_00a36660(void) { epoxy_glDrawElementsInstancedBaseVertexOES = (undefined *)FUN_00a2ca10(&DAT_00b279f4); /* WARNING: Could not recover jumptable at 0x00a36680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedBaseVertexOES)(); return; } //@@ 00a36690 FUN_00a36690 void FUN_00a36690(void) { epoxy_glDrawElementsInstancedEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d830); /* WARNING: Could not recover jumptable at 0x00a366b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedEXT)(); return; } //@@ 00a366c0 FUN_00a366c0 void FUN_00a366c0(void) { epoxy_glDrawElementsInstancedNV = (undefined *)FUN_00a2ca10(&DAT_00b2ab48); /* WARNING: Could not recover jumptable at 0x00a366e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawElementsInstancedNV)(); return; } //@@ 00a366f0 FUN_00a366f0 void FUN_00a366f0(void) { epoxy_glDrawMeshArraysSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawMeshArraysSUN)(); return; } //@@ 00a36710 FUN_00a36710 void FUN_00a36710(void) { epoxy_glDrawPixels = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36728. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawPixels)(); return; } //@@ 00a36730 FUN_00a36730 void FUN_00a36730(void) { epoxy_glDrawRangeElementArrayAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElementArrayAPPLE)(); return; } //@@ 00a36750 FUN_00a36750 void FUN_00a36750(void) { epoxy_glDrawRangeElementArrayATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36768. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElementArrayATI)(); return; } //@@ 00a36770 FUN_00a36770 void FUN_00a36770(void) { epoxy_glDrawRangeElements = (undefined *)FUN_00a2ca10(&DAT_00b27f74); /* WARNING: Could not recover jumptable at 0x00a36790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElements)(); return; } //@@ 00a367a0 FUN_00a367a0 void FUN_00a367a0(void) { epoxy_glDrawRangeElementsBaseVertex = (undefined *)FUN_00a2ca10(&DAT_00b3c344); /* WARNING: Could not recover jumptable at 0x00a367c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElementsBaseVertex)(); return; } //@@ 00a367d0 FUN_00a367d0 void FUN_00a367d0(void) { epoxy_glDrawRangeElementsBaseVertexEXT = (undefined *)FUN_00a2ca10(&DAT_00b25ae8); /* WARNING: Could not recover jumptable at 0x00a367f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElementsBaseVertexEXT)(); return; } //@@ 00a36800 FUN_00a36800 void FUN_00a36800(void) { epoxy_glDrawRangeElementsBaseVertexOES = (undefined *)FUN_00a2ca10(&DAT_00b26524); /* WARNING: Could not recover jumptable at 0x00a36820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElementsBaseVertexOES)(); return; } //@@ 00a36830 FUN_00a36830 void FUN_00a36830(void) { epoxy_glDrawRangeElementsEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a738); /* WARNING: Could not recover jumptable at 0x00a36850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawRangeElementsEXT)(); return; } //@@ 00a36860 FUN_00a36860 void FUN_00a36860(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glDrawTexfOES = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDrawTexfOES)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a368c0 FUN_00a368c0 void FUN_00a368c0(void) { epoxy_glDrawTexfvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a368d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexfvOES)(); return; } //@@ 00a368e0 FUN_00a368e0 void FUN_00a368e0(void) { epoxy_glDrawTexiOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a368f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexiOES)(); return; } //@@ 00a36900 FUN_00a36900 void FUN_00a36900(void) { epoxy_glDrawTexivOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36918. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexivOES)(); return; } //@@ 00a36920 FUN_00a36920 void FUN_00a36920(void) { epoxy_glDrawTexsOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexsOES)(); return; } //@@ 00a36940 FUN_00a36940 void FUN_00a36940(void) { epoxy_glDrawTexsvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36958. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexsvOES)(); return; } //@@ 00a36960 FUN_00a36960 void FUN_00a36960(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11) { epoxy_glDrawTextureNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glDrawTextureNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11); return; } //@@ 00a369f0 FUN_00a369f0 void FUN_00a369f0(void) { epoxy_glDrawTexxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36a08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexxOES)(); return; } //@@ 00a36a10 FUN_00a36a10 void FUN_00a36a10(void) { epoxy_glDrawTexxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36a28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTexxvOES)(); return; } //@@ 00a36a30 FUN_00a36a30 void FUN_00a36a30(void) { epoxy_glDrawTransformFeedback = (undefined *)FUN_00a2ca10(&DAT_00b2a540); /* WARNING: Could not recover jumptable at 0x00a36a50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTransformFeedback)(); return; } //@@ 00a36a60 FUN_00a36a60 void FUN_00a36a60(void) { epoxy_glDrawTransformFeedbackInstanced = (undefined *)FUN_00a2ca10(&DAT_00b2660c); /* WARNING: Could not recover jumptable at 0x00a36a80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTransformFeedbackInstanced)(); return; } //@@ 00a36a90 FUN_00a36a90 void FUN_00a36a90(void) { epoxy_glDrawTransformFeedbackNV = (undefined *)FUN_00a2ca10(&DAT_00b251b8); /* WARNING: Could not recover jumptable at 0x00a36ab0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTransformFeedbackNV)(); return; } //@@ 00a36ac0 FUN_00a36ac0 void FUN_00a36ac0(void) { epoxy_glDrawTransformFeedbackStream = (undefined *)FUN_00a2ca10(&DAT_00b28d68); /* WARNING: Could not recover jumptable at 0x00a36ae0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTransformFeedbackStream)(); return; } //@@ 00a36af0 FUN_00a36af0 void FUN_00a36af0(void) { epoxy_glDrawTransformFeedbackStreamInstanced = (undefined *)FUN_00a2ca10(&DAT_00b3afd4); /* WARNING: Could not recover jumptable at 0x00a36b10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glDrawTransformFeedbackStreamInstanced)(); return; } //@@ 00a36b20 FUN_00a36b20 void FUN_00a36b20(void) { epoxy_glEGLImageTargetRenderbufferStorageOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36b38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEGLImageTargetRenderbufferStorageOES)(); return; } //@@ 00a36b40 FUN_00a36b40 void FUN_00a36b40(void) { epoxy_glEGLImageTargetTexture2DOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36b58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEGLImageTargetTexture2DOES)(); return; } //@@ 00a36b60 FUN_00a36b60 void FUN_00a36b60(void) { epoxy_glEdgeFlag = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36b78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEdgeFlag)(); return; } //@@ 00a36b80 FUN_00a36b80 void FUN_00a36b80(void) { epoxy_glEdgeFlagFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36b98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEdgeFlagFormatNV)(); return; } //@@ 00a36ba0 FUN_00a36ba0 void FUN_00a36ba0(void) { epoxy_glEdgeFlagPointer = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36bb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEdgeFlagPointer)(); return; } //@@ 00a36bc0 FUN_00a36bc0 void FUN_00a36bc0(void) { epoxy_glEdgeFlagPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEdgeFlagPointerEXT)(); return; } //@@ 00a36be0 FUN_00a36be0 void FUN_00a36be0(void) { epoxy_glEdgeFlagPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36bf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEdgeFlagPointerListIBM)(); return; } //@@ 00a36c00 FUN_00a36c00 void FUN_00a36c00(void) { epoxy_glEdgeFlagv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36c18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEdgeFlagv)(); return; } //@@ 00a36c20 FUN_00a36c20 void FUN_00a36c20(void) { epoxy_glElementPointerAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36c38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glElementPointerAPPLE)(); return; } //@@ 00a36c40 FUN_00a36c40 void FUN_00a36c40(void) { epoxy_glElementPointerATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36c58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glElementPointerATI)(); return; } //@@ 00a36c60 FUN_00a36c60 void FUN_00a36c60(void) { epoxy_glEnable = (undefined *)FUN_00a2ca10(" 0 0 0"); /* WARNING: Could not recover jumptable at 0x00a36c80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnable)(); return; } //@@ 00a36c90 FUN_00a36c90 void FUN_00a36c90(void) { epoxy_glEnableClientState = (undefined *)FUN_00a2ca10(&DAT_00b25448); /* WARNING: Could not recover jumptable at 0x00a36cb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableClientState)(); return; } //@@ 00a36cc0 FUN_00a36cc0 void FUN_00a36cc0(void) { epoxy_glEnableClientStateIndexedEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36cd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableClientStateIndexedEXT)(); return; } //@@ 00a36ce0 FUN_00a36ce0 void FUN_00a36ce0(void) { epoxy_glEnableClientStateiEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36cf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableClientStateiEXT)(); return; } //@@ 00a36d00 FUN_00a36d00 void FUN_00a36d00(void) { epoxy_glEnableDriverControlQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableDriverControlQCOM)(); return; } //@@ 00a36d20 FUN_00a36d20 void FUN_00a36d20(void) { epoxy_glEnableIndexedEXT = (undefined *)FUN_00a2ca10(&DAT_00b258a4); /* WARNING: Could not recover jumptable at 0x00a36d40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableIndexedEXT)(); return; } //@@ 00a36d50 FUN_00a36d50 void FUN_00a36d50(void) { epoxy_glEnableVariantClientStateEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36d68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVariantClientStateEXT)(); return; } //@@ 00a36d70 FUN_00a36d70 void FUN_00a36d70(void) { epoxy_glEnableVertexArrayAttrib = (undefined *)FUN_00a2ca10(&DAT_00b3c770); /* WARNING: Could not recover jumptable at 0x00a36d90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVertexArrayAttrib)(); return; } //@@ 00a36da0 FUN_00a36da0 void FUN_00a36da0(void) { epoxy_glEnableVertexArrayAttribEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36db8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVertexArrayAttribEXT)(); return; } //@@ 00a36dc0 FUN_00a36dc0 void FUN_00a36dc0(void) { epoxy_glEnableVertexArrayEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVertexArrayEXT)(); return; } //@@ 00a36de0 FUN_00a36de0 void FUN_00a36de0(void) { epoxy_glEnableVertexAttribAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVertexAttribAPPLE)(); return; } //@@ 00a36e00 FUN_00a36e00 void FUN_00a36e00(void) { epoxy_glEnableVertexAttribArray = (undefined *)FUN_00a2ca10("&1&1@1@1"); /* WARNING: Could not recover jumptable at 0x00a36e20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVertexAttribArray)(); return; } //@@ 00a36e30 FUN_00a36e30 void FUN_00a36e30(void) { epoxy_glEnableVertexAttribArrayARB = (undefined *)FUN_00a2ca10(&DAT_00b252b8); /* WARNING: Could not recover jumptable at 0x00a36e50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableVertexAttribArrayARB)(); return; } //@@ 00a36e60 FUN_00a36e60 void FUN_00a36e60(void) { epoxy_glEnablei = (undefined *)FUN_00a2ca10(&DAT_00b29bd8); /* WARNING: Could not recover jumptable at 0x00a36e80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnablei)(); return; } //@@ 00a36e90 FUN_00a36e90 void FUN_00a36e90(void) { epoxy_glEnableiEXT = (undefined *)FUN_00a2ca10(&DAT_00b280a0); /* WARNING: Could not recover jumptable at 0x00a36eb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableiEXT)(); return; } //@@ 00a36ec0 FUN_00a36ec0 void FUN_00a36ec0(void) { epoxy_glEnableiNV = (undefined *)FUN_00a2ca10(&DAT_00b27598); /* WARNING: Could not recover jumptable at 0x00a36ee0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableiNV)(); return; } //@@ 00a36ef0 FUN_00a36ef0 void FUN_00a36ef0(void) { epoxy_glEnableiOES = (undefined *)FUN_00a2ca10(&DAT_00b3cac4); /* WARNING: Could not recover jumptable at 0x00a36f10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEnableiOES)(); return; } //@@ 00a36f20 FUN_00a36f20 void FUN_00a36f20(void) { PTR_FUN_00c120c8 = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a36f34. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c120c8)(); return; } //@@ 00a37000 FUN_00a37000 void FUN_00a37000(void) { epoxy_glEndPerfMonitorAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37018. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndPerfMonitorAMD)(); return; } //@@ 00a37020 FUN_00a37020 void FUN_00a37020(void) { epoxy_glEndPerfQueryINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37038. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndPerfQueryINTEL)(); return; } //@@ 00a37040 FUN_00a37040 void FUN_00a37040(void) { epoxy_glEndQuery = (undefined *)FUN_00a2ca10("<2<2G2"); /* WARNING: Could not recover jumptable at 0x00a37060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndQuery)(); return; } //@@ 00a37070 FUN_00a37070 void FUN_00a37070(void) { epoxy_glEndQueryARB = (undefined *)FUN_00a2ca10("G2<2<2"); /* WARNING: Could not recover jumptable at 0x00a37090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndQueryARB)(); return; } //@@ 00a370a0 FUN_00a370a0 void FUN_00a370a0(void) { epoxy_glEndQueryEXT = (undefined *)FUN_00a2ca10(&DAT_00b26e18); /* WARNING: Could not recover jumptable at 0x00a370c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndQueryEXT)(); return; } //@@ 00a370d0 FUN_00a370d0 void FUN_00a370d0(void) { epoxy_glEndQueryIndexed = (undefined *)FUN_00a2ca10(&DAT_00b26594); /* WARNING: Could not recover jumptable at 0x00a370f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndQueryIndexed)(); return; } //@@ 00a37100 FUN_00a37100 void FUN_00a37100(void) { epoxy_glEndTilingQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37118. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndTilingQCOM)(); return; } //@@ 00a371a0 FUN_00a371a0 void FUN_00a371a0(void) { epoxy_glEndVideoCaptureNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a371b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEndVideoCaptureNV)(); return; } //@@ 00a371c0 FUN_00a371c0 void FUN_00a371c0(undefined8 param_1) { epoxy_glEvalCoord1d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glEvalCoord1d)(param_1); return; } //@@ 00a371f0 FUN_00a371f0 void FUN_00a371f0(void) { epoxy_glEvalCoord1dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord1dv)(); return; } //@@ 00a37210 FUN_00a37210 void FUN_00a37210(undefined4 param_1) { epoxy_glEvalCoord1f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glEvalCoord1f)(param_1); return; } //@@ 00a37240 FUN_00a37240 void FUN_00a37240(void) { epoxy_glEvalCoord1fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37258. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord1fv)(); return; } //@@ 00a37260 FUN_00a37260 void FUN_00a37260(void) { epoxy_glEvalCoord1xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord1xOES)(); return; } //@@ 00a37280 FUN_00a37280 void FUN_00a37280(void) { epoxy_glEvalCoord1xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord1xvOES)(); return; } //@@ 00a372a0 FUN_00a372a0 void FUN_00a372a0(undefined8 param_1,undefined8 param_2) { epoxy_glEvalCoord2d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glEvalCoord2d)(param_1,param_2); return; } //@@ 00a372e0 FUN_00a372e0 void FUN_00a372e0(void) { epoxy_glEvalCoord2dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a372f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord2dv)(); return; } //@@ 00a37300 FUN_00a37300 void FUN_00a37300(undefined4 param_1,undefined4 param_2) { epoxy_glEvalCoord2f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glEvalCoord2f)(param_1,param_2); return; } //@@ 00a37340 FUN_00a37340 void FUN_00a37340(void) { epoxy_glEvalCoord2fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37358. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord2fv)(); return; } //@@ 00a37360 FUN_00a37360 void FUN_00a37360(void) { epoxy_glEvalCoord2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord2xOES)(); return; } //@@ 00a37380 FUN_00a37380 void FUN_00a37380(void) { epoxy_glEvalCoord2xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalCoord2xvOES)(); return; } //@@ 00a373a0 FUN_00a373a0 void FUN_00a373a0(void) { epoxy_glEvalMapsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a373b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalMapsNV)(); return; } //@@ 00a373c0 FUN_00a373c0 void FUN_00a373c0(void) { epoxy_glEvalMesh1 = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a373d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalMesh1)(); return; } //@@ 00a373e0 FUN_00a373e0 void FUN_00a373e0(void) { epoxy_glEvalMesh2 = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a373f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalMesh2)(); return; } //@@ 00a37400 FUN_00a37400 void FUN_00a37400(void) { epoxy_glEvalPoint1 = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalPoint1)(); return; } //@@ 00a37420 FUN_00a37420 void FUN_00a37420(void) { epoxy_glEvalPoint2 = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37438. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glEvalPoint2)(); return; } //@@ 00a37440 FUN_00a37440 void FUN_00a37440(void) { epoxy_glExecuteProgramNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37458. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExecuteProgramNV)(); return; } //@@ 00a37460 FUN_00a37460 void FUN_00a37460(void) { epoxy_glExtGetBufferPointervQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37478. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetBufferPointervQCOM)(); return; } //@@ 00a37480 FUN_00a37480 void FUN_00a37480(void) { epoxy_glExtGetBuffersQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37498. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetBuffersQCOM)(); return; } //@@ 00a374a0 FUN_00a374a0 void FUN_00a374a0(void) { epoxy_glExtGetFramebuffersQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a374b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetFramebuffersQCOM)(); return; } //@@ 00a374c0 FUN_00a374c0 void FUN_00a374c0(void) { epoxy_glExtGetProgramBinarySourceQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a374d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetProgramBinarySourceQCOM)(); return; } //@@ 00a374e0 FUN_00a374e0 void FUN_00a374e0(void) { epoxy_glExtGetProgramsQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a374f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetProgramsQCOM)(); return; } //@@ 00a37500 FUN_00a37500 void FUN_00a37500(void) { epoxy_glExtGetRenderbuffersQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37518. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetRenderbuffersQCOM)(); return; } //@@ 00a37520 FUN_00a37520 void FUN_00a37520(void) { epoxy_glExtGetShadersQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37538. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetShadersQCOM)(); return; } //@@ 00a37540 FUN_00a37540 void FUN_00a37540(void) { epoxy_glExtGetTexLevelParameterivQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37558. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetTexLevelParameterivQCOM)(); return; } //@@ 00a37560 FUN_00a37560 void FUN_00a37560(void) { epoxy_glExtGetTexSubImageQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetTexSubImageQCOM)(); return; } //@@ 00a37580 FUN_00a37580 void FUN_00a37580(void) { epoxy_glExtGetTexturesQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtGetTexturesQCOM)(); return; } //@@ 00a375a0 FUN_00a375a0 void FUN_00a375a0(void) { epoxy_glExtIsProgramBinaryQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a375b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtIsProgramBinaryQCOM)(); return; } //@@ 00a375c0 FUN_00a375c0 void FUN_00a375c0(void) { epoxy_glExtTexObjectStateOverrideiQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a375d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtTexObjectStateOverrideiQCOM)(); return; } //@@ 00a375e0 FUN_00a375e0 void FUN_00a375e0(void) { epoxy_glExtractComponentEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a375f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glExtractComponentEXT)(); return; } //@@ 00a37600 FUN_00a37600 void FUN_00a37600(void) { epoxy_glFeedbackBuffer = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFeedbackBuffer)(); return; } //@@ 00a37620 FUN_00a37620 void FUN_00a37620(void) { epoxy_glFeedbackBufferxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37638. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFeedbackBufferxOES)(); return; } //@@ 00a37640 FUN_00a37640 void FUN_00a37640(void) { epoxy_glFenceSync = (undefined *)FUN_00a2ca10(&DAT_00b28468); /* WARNING: Could not recover jumptable at 0x00a37660. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFenceSync)(); return; } //@@ 00a37670 FUN_00a37670 void FUN_00a37670(void) { epoxy_glFenceSyncAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b3af80); /* WARNING: Could not recover jumptable at 0x00a37690. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFenceSyncAPPLE)(); return; } //@@ 00a376a0 FUN_00a376a0 void FUN_00a376a0(void) { epoxy_glFinalCombinerInputNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a376b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFinalCombinerInputNV)(); return; } //@@ 00a376e0 FUN_00a376e0 void FUN_00a376e0(void) { epoxy_glFinishAsyncSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a376f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFinishAsyncSGIX)(); return; } //@@ 00a37700 FUN_00a37700 void FUN_00a37700(void) { epoxy_glFinishFenceAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37718. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFinishFenceAPPLE)(); return; } //@@ 00a37720 FUN_00a37720 void FUN_00a37720(void) { epoxy_glFinishFenceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37738. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFinishFenceNV)(); return; } //@@ 00a37740 FUN_00a37740 void FUN_00a37740(void) { epoxy_glFinishObjectAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFinishObjectAPPLE)(); return; } //@@ 00a377a0 FUN_00a377a0 void FUN_00a377a0(void) { epoxy_glFlushMappedBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b261e4); /* WARNING: Could not recover jumptable at 0x00a377c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushMappedBufferRange)(); return; } //@@ 00a377d0 FUN_00a377d0 void FUN_00a377d0(void) { epoxy_glFlushMappedBufferRangeAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b297d0); /* WARNING: Could not recover jumptable at 0x00a377f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushMappedBufferRangeAPPLE)(); return; } //@@ 00a37800 FUN_00a37800 void FUN_00a37800(void) { epoxy_glFlushMappedBufferRangeEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a650); /* WARNING: Could not recover jumptable at 0x00a37820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushMappedBufferRangeEXT)(); return; } //@@ 00a37830 FUN_00a37830 void FUN_00a37830(void) { epoxy_glFlushMappedNamedBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b3c948); /* WARNING: Could not recover jumptable at 0x00a37850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushMappedNamedBufferRange)(); return; } //@@ 00a37860 FUN_00a37860 void FUN_00a37860(void) { epoxy_glFlushMappedNamedBufferRangeEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37878. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushMappedNamedBufferRangeEXT)(); return; } //@@ 00a37880 FUN_00a37880 void FUN_00a37880(void) { epoxy_glFlushPixelDataRangeNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37898. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushPixelDataRangeNV)(); return; } //@@ 00a378c0 FUN_00a378c0 void FUN_00a378c0(void) { epoxy_glFlushStaticDataIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a378d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushStaticDataIBM)(); return; } //@@ 00a378e0 FUN_00a378e0 void FUN_00a378e0(void) { epoxy_glFlushVertexArrayRangeAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a378f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFlushVertexArrayRangeAPPLE)(); return; } //@@ 00a37920 FUN_00a37920 void FUN_00a37920(void) { epoxy_glFogCoordFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordFormatNV)(); return; } //@@ 00a37940 FUN_00a37940 void FUN_00a37940(void) { epoxy_glFogCoordPointer = (undefined *)FUN_00a2ca10(&DAT_00b3c1c4); /* WARNING: Could not recover jumptable at 0x00a37960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordPointer)(); return; } //@@ 00a37970 FUN_00a37970 void FUN_00a37970(void) { epoxy_glFogCoordPointerEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a638); /* WARNING: Could not recover jumptable at 0x00a37990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordPointerEXT)(); return; } //@@ 00a379a0 FUN_00a379a0 void FUN_00a379a0(void) { epoxy_glFogCoordPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a379b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordPointerListIBM)(); return; } //@@ 00a379c0 FUN_00a379c0 void FUN_00a379c0(undefined8 param_1) { epoxy_glFogCoordd = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glFogCoordd)(param_1); return; } //@@ 00a379f0 FUN_00a379f0 void FUN_00a379f0(undefined8 param_1) { epoxy_glFogCoorddEXT = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glFogCoorddEXT)(param_1); return; } //@@ 00a37a20 FUN_00a37a20 void FUN_00a37a20(void) { epoxy_glFogCoorddv = (undefined *)FUN_00a2ca10(&DAT_00b3b2c0); /* WARNING: Could not recover jumptable at 0x00a37a40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoorddv)(); return; } //@@ 00a37a50 FUN_00a37a50 void FUN_00a37a50(void) { epoxy_glFogCoorddvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2612c); /* WARNING: Could not recover jumptable at 0x00a37a70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoorddvEXT)(); return; } //@@ 00a37a80 FUN_00a37a80 void FUN_00a37a80(undefined4 param_1) { epoxy_glFogCoordf = (undefined *)FUN_00a2ca10(&DAT_00b26954); (*(code *)epoxy_glFogCoordf)(param_1); return; } //@@ 00a37ab0 FUN_00a37ab0 void FUN_00a37ab0(undefined4 param_1) { epoxy_glFogCoordfEXT = (undefined *)FUN_00a2ca10(&DAT_00b26278); (*(code *)epoxy_glFogCoordfEXT)(param_1); return; } //@@ 00a37ae0 FUN_00a37ae0 void FUN_00a37ae0(void) { epoxy_glFogCoordfv = (undefined *)FUN_00a2ca10(&DAT_00b29318); /* WARNING: Could not recover jumptable at 0x00a37b00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordfv)(); return; } //@@ 00a37b10 FUN_00a37b10 void FUN_00a37b10(void) { epoxy_glFogCoordfvEXT = (undefined *)FUN_00a2ca10(&DAT_00b29e84); /* WARNING: Could not recover jumptable at 0x00a37b30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordfvEXT)(); return; } //@@ 00a37b40 FUN_00a37b40 void FUN_00a37b40(void) { epoxy_glFogCoordhNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37b58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordhNV)(); return; } //@@ 00a37b60 FUN_00a37b60 void FUN_00a37b60(void) { epoxy_glFogCoordhvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37b78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogCoordhvNV)(); return; } //@@ 00a37b80 FUN_00a37b80 void FUN_00a37b80(void) { epoxy_glFogFuncSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37b98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogFuncSGIS)(); return; } //@@ 00a37ba0 FUN_00a37ba0 void FUN_00a37ba0(undefined4 param_1,undefined4 param_2) { epoxy_glFogf = (undefined *)FUN_00a2ca10(&DAT_00b27eb8); (*(code *)epoxy_glFogf)(param_1,param_2); return; } //@@ 00a37bd0 FUN_00a37bd0 void FUN_00a37bd0(void) { epoxy_glFogfv = (undefined *)FUN_00a2ca10(&DAT_00b3b878); /* WARNING: Could not recover jumptable at 0x00a37bf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogfv)(); return; } //@@ 00a37c00 FUN_00a37c00 void FUN_00a37c00(void) { epoxy_glFogi = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37c18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogi)(); return; } //@@ 00a37c20 FUN_00a37c20 void FUN_00a37c20(void) { epoxy_glFogiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37c38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogiv)(); return; } //@@ 00a37c40 FUN_00a37c40 void FUN_00a37c40(void) { epoxy_glFogx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37c58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogx)(); return; } //@@ 00a37c60 FUN_00a37c60 void FUN_00a37c60(void) { epoxy_glFogxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37c78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogxOES)(); return; } //@@ 00a37c80 FUN_00a37c80 void FUN_00a37c80(void) { epoxy_glFogxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogxv)(); return; } //@@ 00a37ca0 FUN_00a37ca0 void FUN_00a37ca0(void) { epoxy_glFogxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37cb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFogxvOES)(); return; } //@@ 00a37cc0 FUN_00a37cc0 void FUN_00a37cc0(void) { epoxy_glFragmentColorMaterialSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37cd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentColorMaterialSGIX)(); return; } //@@ 00a37ce0 FUN_00a37ce0 void FUN_00a37ce0(void) { epoxy_glFragmentCoverageColorNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37cf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentCoverageColorNV)(); return; } //@@ 00a37d00 FUN_00a37d00 void FUN_00a37d00(undefined4 param_1,undefined4 param_2) { epoxy_glFragmentLightModelfSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glFragmentLightModelfSGIX)(param_1,param_2); return; } //@@ 00a37d30 FUN_00a37d30 void FUN_00a37d30(void) { epoxy_glFragmentLightModelfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37d48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentLightModelfvSGIX)(); return; } //@@ 00a37d50 FUN_00a37d50 void FUN_00a37d50(void) { epoxy_glFragmentLightModeliSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37d68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentLightModeliSGIX)(); return; } //@@ 00a37d70 FUN_00a37d70 void FUN_00a37d70(void) { epoxy_glFragmentLightModelivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37d88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentLightModelivSGIX)(); return; } //@@ 00a37d90 FUN_00a37d90 void FUN_00a37d90(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glFragmentLightfSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glFragmentLightfSGIX)(param_1,param_2,param_3); return; } //@@ 00a37dc0 FUN_00a37dc0 void FUN_00a37dc0(void) { epoxy_glFragmentLightfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentLightfvSGIX)(); return; } //@@ 00a37de0 FUN_00a37de0 void FUN_00a37de0(void) { epoxy_glFragmentLightiSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentLightiSGIX)(); return; } //@@ 00a37e00 FUN_00a37e00 void FUN_00a37e00(void) { epoxy_glFragmentLightivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37e18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentLightivSGIX)(); return; } //@@ 00a37e20 FUN_00a37e20 void FUN_00a37e20(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glFragmentMaterialfSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glFragmentMaterialfSGIX)(param_1,param_2,param_3); return; } //@@ 00a37e50 FUN_00a37e50 void FUN_00a37e50(void) { epoxy_glFragmentMaterialfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37e68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentMaterialfvSGIX)(); return; } //@@ 00a37e70 FUN_00a37e70 void FUN_00a37e70(void) { epoxy_glFragmentMaterialiSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37e88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentMaterialiSGIX)(); return; } //@@ 00a37e90 FUN_00a37e90 void FUN_00a37e90(void) { epoxy_glFragmentMaterialivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37ea8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFragmentMaterialivSGIX)(); return; } //@@ 00a37ed0 FUN_00a37ed0 void FUN_00a37ed0(void) { epoxy_glFrameZoomSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFrameZoomSGIX)(); return; } //@@ 00a37ef0 FUN_00a37ef0 void FUN_00a37ef0(void) { epoxy_glFramebufferDrawBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37f08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferDrawBufferEXT)(); return; } //@@ 00a37f10 FUN_00a37f10 void FUN_00a37f10(void) { epoxy_glFramebufferDrawBuffersEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37f28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferDrawBuffersEXT)(); return; } //@@ 00a37f30 FUN_00a37f30 void FUN_00a37f30(void) { epoxy_glFramebufferParameteri = (undefined *)FUN_00a2ca10(&DAT_00b3d990); /* WARNING: Could not recover jumptable at 0x00a37f50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferParameteri)(); return; } //@@ 00a37f60 FUN_00a37f60 void FUN_00a37f60(void) { epoxy_glFramebufferReadBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferReadBufferEXT)(); return; } //@@ 00a37f80 FUN_00a37f80 void FUN_00a37f80(void) { epoxy_glFramebufferRenderbuffer = (undefined *)FUN_00a2ca10(&DAT_00b2764c); /* WARNING: Could not recover jumptable at 0x00a37fa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferRenderbuffer)(); return; } //@@ 00a37fb0 FUN_00a37fb0 void FUN_00a37fb0(void) { epoxy_glFramebufferRenderbufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b281ac); /* WARNING: Could not recover jumptable at 0x00a37fd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferRenderbufferEXT)(); return; } //@@ 00a37fe0 FUN_00a37fe0 void FUN_00a37fe0(void) { epoxy_glFramebufferRenderbufferOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a37ff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferRenderbufferOES)(); return; } //@@ 00a38000 FUN_00a38000 void FUN_00a38000(void) { epoxy_glFramebufferSampleLocationsfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38018. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferSampleLocationsfvNV)(); return; } //@@ 00a38020 FUN_00a38020 void FUN_00a38020(void) { epoxy_glFramebufferTexture = (undefined *)FUN_00a2ca10(&DAT_00b2ad24); /* WARNING: Could not recover jumptable at 0x00a38040. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture)(); return; } //@@ 00a38050 FUN_00a38050 void FUN_00a38050(void) { epoxy_glFramebufferTexture1D = (undefined *)FUN_00a2ca10(&DAT_00b3bfa8); /* WARNING: Could not recover jumptable at 0x00a38070. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture1D)(); return; } //@@ 00a38080 FUN_00a38080 void FUN_00a38080(void) { epoxy_glFramebufferTexture1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b265f8); /* WARNING: Could not recover jumptable at 0x00a380a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture1DEXT)(); return; } //@@ 00a380b0 FUN_00a380b0 void FUN_00a380b0(void) { epoxy_glFramebufferTexture2D = (undefined *)FUN_00a2ca10(&DAT_00b3cfa4); /* WARNING: Could not recover jumptable at 0x00a380d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture2D)(); return; } //@@ 00a380e0 FUN_00a380e0 void FUN_00a380e0(void) { epoxy_glFramebufferTexture2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b261d4); /* WARNING: Could not recover jumptable at 0x00a38100. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture2DEXT)(); return; } //@@ 00a38110 FUN_00a38110 void FUN_00a38110(void) { epoxy_glFramebufferTexture2DMultisampleEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38128. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture2DMultisampleEXT)(); return; } //@@ 00a38130 FUN_00a38130 void FUN_00a38130(void) { epoxy_glFramebufferTexture2DMultisampleIMG = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38148. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture2DMultisampleIMG)(); return; } //@@ 00a38150 FUN_00a38150 void FUN_00a38150(void) { epoxy_glFramebufferTexture2DOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38168. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture2DOES)(); return; } //@@ 00a38170 FUN_00a38170 void FUN_00a38170(void) { epoxy_glFramebufferTexture3D = (undefined *)FUN_00a2ca10(&DAT_00b29004); /* WARNING: Could not recover jumptable at 0x00a38190. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture3D)(); return; } //@@ 00a381a0 FUN_00a381a0 void FUN_00a381a0(void) { epoxy_glFramebufferTexture3DEXT = (undefined *)FUN_00a2ca10(&DAT_00b27b50); /* WARNING: Could not recover jumptable at 0x00a381c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture3DEXT)(); return; } //@@ 00a381d0 FUN_00a381d0 void FUN_00a381d0(void) { epoxy_glFramebufferTexture3DOES = (undefined *)FUN_00a2ca10(&DAT_00b26f64); /* WARNING: Could not recover jumptable at 0x00a381f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTexture3DOES)(); return; } //@@ 00a38200 FUN_00a38200 void FUN_00a38200(void) { epoxy_glFramebufferTextureARB = (undefined *)FUN_00a2ca10(&DAT_00b298f0); /* WARNING: Could not recover jumptable at 0x00a38220. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureARB)(); return; } //@@ 00a38230 FUN_00a38230 void FUN_00a38230(void) { epoxy_glFramebufferTextureEXT = (undefined *)FUN_00a2ca10(&DAT_00b291e4); /* WARNING: Could not recover jumptable at 0x00a38250. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureEXT)(); return; } //@@ 00a38260 FUN_00a38260 void FUN_00a38260(void) { epoxy_glFramebufferTextureFaceARB = (undefined *)FUN_00a2ca10(&DAT_00b3d2a4); /* WARNING: Could not recover jumptable at 0x00a38280. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureFaceARB)(); return; } //@@ 00a38290 FUN_00a38290 void FUN_00a38290(void) { epoxy_glFramebufferTextureFaceEXT = (undefined *)FUN_00a2ca10(&DAT_00b27d58); /* WARNING: Could not recover jumptable at 0x00a382b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureFaceEXT)(); return; } //@@ 00a382c0 FUN_00a382c0 void FUN_00a382c0(void) { epoxy_glFramebufferTextureLayer = (undefined *)FUN_00a2ca10(&DAT_00b29724); /* WARNING: Could not recover jumptable at 0x00a382e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureLayer)(); return; } //@@ 00a382f0 FUN_00a382f0 void FUN_00a382f0(void) { epoxy_glFramebufferTextureLayerARB = (undefined *)FUN_00a2ca10(&DAT_00b2aca4); /* WARNING: Could not recover jumptable at 0x00a38310. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureLayerARB)(); return; } //@@ 00a38320 FUN_00a38320 void FUN_00a38320(void) { epoxy_glFramebufferTextureLayerEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d750); /* WARNING: Could not recover jumptable at 0x00a38340. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureLayerEXT)(); return; } //@@ 00a38350 FUN_00a38350 void FUN_00a38350(void) { epoxy_glFramebufferTextureMultiviewOVR = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureMultiviewOVR)(); return; } //@@ 00a38370 FUN_00a38370 void FUN_00a38370(void) { epoxy_glFramebufferTextureOES = (undefined *)FUN_00a2ca10(&DAT_00b3b8e4); /* WARNING: Could not recover jumptable at 0x00a38390. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFramebufferTextureOES)(); return; } //@@ 00a383a0 FUN_00a383a0 void FUN_00a383a0(void) { epoxy_glFreeObjectBufferATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a383b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFreeObjectBufferATI)(); return; } //@@ 00a383c0 FUN_00a383c0 void FUN_00a383c0(void) { epoxy_glFrontFace = (undefined *)FUN_00a2ca10(&DAT_00b29934); /* WARNING: Could not recover jumptable at 0x00a383e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFrontFace)(); return; } //@@ 00a383f0 FUN_00a383f0 void FUN_00a383f0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glFrustum = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glFrustum)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a38460 FUN_00a38460 void FUN_00a38460(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glFrustumf = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glFrustumf)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a384d0 FUN_00a384d0 void FUN_00a384d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glFrustumfOES = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glFrustumfOES)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a38540 FUN_00a38540 void FUN_00a38540(void) { epoxy_glFrustumx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38558. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFrustumx)(); return; } //@@ 00a38560 FUN_00a38560 void FUN_00a38560(void) { epoxy_glFrustumxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glFrustumxOES)(); return; } //@@ 00a38580 FUN_00a38580 void FUN_00a38580(void) { epoxy_glGenAsyncMarkersSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenAsyncMarkersSGIX)(); return; } //@@ 00a385a0 FUN_00a385a0 void FUN_00a385a0(void) { epoxy_glGenBuffers = (undefined *)FUN_00a2ca10(&DAT_00b2777c); /* WARNING: Could not recover jumptable at 0x00a385c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenBuffers)(); return; } //@@ 00a385d0 FUN_00a385d0 void FUN_00a385d0(void) { epoxy_glGenBuffersARB = (undefined *)FUN_00a2ca10(&DAT_00b279ec); /* WARNING: Could not recover jumptable at 0x00a385f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenBuffersARB)(); return; } //@@ 00a38600 FUN_00a38600 void FUN_00a38600(void) { epoxy_glGenFencesAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenFencesAPPLE)(); return; } //@@ 00a38620 FUN_00a38620 void FUN_00a38620(void) { epoxy_glGenFencesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38638. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenFencesNV)(); return; } //@@ 00a38640 FUN_00a38640 void FUN_00a38640(void) { epoxy_glGenFragmentShadersATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38658. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenFragmentShadersATI)(); return; } //@@ 00a38660 FUN_00a38660 void FUN_00a38660(void) { epoxy_glGenFramebuffers = (undefined *)FUN_00a2ca10(&DAT_00b28ae8); /* WARNING: Could not recover jumptable at 0x00a38680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenFramebuffers)(); return; } //@@ 00a38690 FUN_00a38690 void FUN_00a38690(void) { epoxy_glGenFramebuffersEXT = (undefined *)FUN_00a2ca10(&DAT_00b26be8); /* WARNING: Could not recover jumptable at 0x00a386b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenFramebuffersEXT)(); return; } //@@ 00a386c0 FUN_00a386c0 void FUN_00a386c0(void) { epoxy_glGenFramebuffersOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a386d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenFramebuffersOES)(); return; } //@@ 00a386e0 FUN_00a386e0 void FUN_00a386e0(void) { epoxy_glGenLists = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a386f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenLists)(); return; } //@@ 00a38700 FUN_00a38700 void FUN_00a38700(void) { epoxy_glGenNamesAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38718. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenNamesAMD)(); return; } //@@ 00a38720 FUN_00a38720 void FUN_00a38720(void) { epoxy_glGenOcclusionQueriesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38738. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenOcclusionQueriesNV)(); return; } //@@ 00a38740 FUN_00a38740 void FUN_00a38740(void) { epoxy_glGenPathsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenPathsNV)(); return; } //@@ 00a38760 FUN_00a38760 void FUN_00a38760(void) { epoxy_glGenPerfMonitorsAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38778. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenPerfMonitorsAMD)(); return; } //@@ 00a38780 FUN_00a38780 void FUN_00a38780(void) { epoxy_glGenProgramPipelines = (undefined *)FUN_00a2ca10(&DAT_00b26d08); /* WARNING: Could not recover jumptable at 0x00a387a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenProgramPipelines)(); return; } //@@ 00a387b0 FUN_00a387b0 void FUN_00a387b0(void) { epoxy_glGenProgramPipelinesEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a387c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenProgramPipelinesEXT)(); return; } //@@ 00a387d0 FUN_00a387d0 void FUN_00a387d0(void) { epoxy_glGenProgramsARB = (undefined *)FUN_00a2ca10("M>M>^>"); /* WARNING: Could not recover jumptable at 0x00a387f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenProgramsARB)(); return; } //@@ 00a38800 FUN_00a38800 void FUN_00a38800(void) { epoxy_glGenProgramsNV = (undefined *)FUN_00a2ca10("^>M>M>"); /* WARNING: Could not recover jumptable at 0x00a38820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenProgramsNV)(); return; } //@@ 00a38830 FUN_00a38830 void FUN_00a38830(void) { epoxy_glGenQueries = (undefined *)FUN_00a2ca10("n>n>{>"); /* WARNING: Could not recover jumptable at 0x00a38850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenQueries)(); return; } //@@ 00a38860 FUN_00a38860 void FUN_00a38860(void) { epoxy_glGenQueriesARB = (undefined *)FUN_00a2ca10("{>n>n>"); /* WARNING: Could not recover jumptable at 0x00a38880. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenQueriesARB)(); return; } //@@ 00a38890 FUN_00a38890 void FUN_00a38890(void) { epoxy_glGenQueriesEXT = (undefined *)FUN_00a2ca10(&DAT_00b294c8); /* WARNING: Could not recover jumptable at 0x00a388b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenQueriesEXT)(); return; } //@@ 00a388c0 FUN_00a388c0 void FUN_00a388c0(void) { epoxy_glGenRenderbuffers = (undefined *)FUN_00a2ca10(&DAT_00b26484); /* WARNING: Could not recover jumptable at 0x00a388e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenRenderbuffers)(); return; } //@@ 00a388f0 FUN_00a388f0 void FUN_00a388f0(void) { epoxy_glGenRenderbuffersEXT = (undefined *)FUN_00a2ca10(&DAT_00b29ac4); /* WARNING: Could not recover jumptable at 0x00a38910. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenRenderbuffersEXT)(); return; } //@@ 00a38920 FUN_00a38920 void FUN_00a38920(void) { epoxy_glGenRenderbuffersOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenRenderbuffersOES)(); return; } //@@ 00a38940 FUN_00a38940 void FUN_00a38940(void) { epoxy_glGenSamplers = (undefined *)FUN_00a2ca10(&DAT_00b3c588); /* WARNING: Could not recover jumptable at 0x00a38960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenSamplers)(); return; } //@@ 00a38970 FUN_00a38970 void FUN_00a38970(void) { epoxy_glGenSymbolsEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38988. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenSymbolsEXT)(); return; } //@@ 00a38990 FUN_00a38990 void FUN_00a38990(void) { epoxy_glGenTextures = (undefined *)FUN_00a2ca10(&DAT_00b3bb74); /* WARNING: Could not recover jumptable at 0x00a389b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenTextures)(); return; } //@@ 00a389c0 FUN_00a389c0 void FUN_00a389c0(void) { epoxy_glGenTexturesEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a389d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenTexturesEXT)(); return; } //@@ 00a389e0 FUN_00a389e0 void FUN_00a389e0(void) { epoxy_glGenTransformFeedbacks = (undefined *)FUN_00a2ca10(&DAT_00b3d578); /* WARNING: Could not recover jumptable at 0x00a38a00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenTransformFeedbacks)(); return; } //@@ 00a38a10 FUN_00a38a10 void FUN_00a38a10(void) { epoxy_glGenTransformFeedbacksNV = (undefined *)FUN_00a2ca10(&DAT_00b2ac0c); /* WARNING: Could not recover jumptable at 0x00a38a30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenTransformFeedbacksNV)(); return; } //@@ 00a38a40 FUN_00a38a40 void FUN_00a38a40(void) { epoxy_glGenVertexArrays = (undefined *)FUN_00a2ca10("I?I?I?[?r?"); /* WARNING: Could not recover jumptable at 0x00a38a60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenVertexArrays)(); return; } //@@ 00a38a70 FUN_00a38a70 void FUN_00a38a70(void) { epoxy_glGenVertexArraysAPPLE = (undefined *)FUN_00a2ca10("[?I?I?I?r?"); /* WARNING: Could not recover jumptable at 0x00a38a90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenVertexArraysAPPLE)(); return; } //@@ 00a38aa0 FUN_00a38aa0 void FUN_00a38aa0(void) { epoxy_glGenVertexArraysOES = (undefined *)FUN_00a2ca10("r?I?I?I?[?"); /* WARNING: Could not recover jumptable at 0x00a38ac0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenVertexArraysOES)(); return; } //@@ 00a38ad0 FUN_00a38ad0 void FUN_00a38ad0(void) { epoxy_glGenVertexShadersEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38ae8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenVertexShadersEXT)(); return; } //@@ 00a38af0 FUN_00a38af0 void FUN_00a38af0(void) { epoxy_glGenerateMipmap = (undefined *)FUN_00a2ca10(&DAT_00b29258); /* WARNING: Could not recover jumptable at 0x00a38b10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenerateMipmap)(); return; } //@@ 00a38b20 FUN_00a38b20 void FUN_00a38b20(void) { epoxy_glGenerateMipmapEXT = (undefined *)FUN_00a2ca10(&DAT_00b27be4); /* WARNING: Could not recover jumptable at 0x00a38b40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenerateMipmapEXT)(); return; } //@@ 00a38b50 FUN_00a38b50 void FUN_00a38b50(void) { epoxy_glGenerateMipmapOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38b68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenerateMipmapOES)(); return; } //@@ 00a38b70 FUN_00a38b70 void FUN_00a38b70(void) { epoxy_glGenerateMultiTexMipmapEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38b88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenerateMultiTexMipmapEXT)(); return; } //@@ 00a38b90 FUN_00a38b90 void FUN_00a38b90(void) { epoxy_glGenerateTextureMipmap = (undefined *)FUN_00a2ca10(&DAT_00b2a734); /* WARNING: Could not recover jumptable at 0x00a38bb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenerateTextureMipmap)(); return; } //@@ 00a38bc0 FUN_00a38bc0 void FUN_00a38bc0(void) { epoxy_glGenerateTextureMipmapEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGenerateTextureMipmapEXT)(); return; } //@@ 00a38be0 FUN_00a38be0 void FUN_00a38be0(void) { epoxy_glGetActiveAtomicCounterBufferiv = (undefined *)FUN_00a2ca10(&DAT_00b29cac); /* WARNING: Could not recover jumptable at 0x00a38c00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveAtomicCounterBufferiv)(); return; } //@@ 00a38c10 FUN_00a38c10 void FUN_00a38c10(void) { epoxy_glGetActiveAttrib = (undefined *)FUN_00a2ca10("F@F@X@"); /* WARNING: Could not recover jumptable at 0x00a38c30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveAttrib)(); return; } //@@ 00a38c40 FUN_00a38c40 void FUN_00a38c40(void) { epoxy_glGetActiveAttribARB = (undefined *)FUN_00a2ca10("X@F@F@"); /* WARNING: Could not recover jumptable at 0x00a38c60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveAttribARB)(); return; } //@@ 00a38c70 FUN_00a38c70 void FUN_00a38c70(void) { epoxy_glGetActiveSubroutineName = (undefined *)FUN_00a2ca10(&DAT_00b29420); /* WARNING: Could not recover jumptable at 0x00a38c90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveSubroutineName)(); return; } //@@ 00a38ca0 FUN_00a38ca0 void FUN_00a38ca0(void) { epoxy_glGetActiveSubroutineUniformName = (undefined *)FUN_00a2ca10(&DAT_00b28650); /* WARNING: Could not recover jumptable at 0x00a38cc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveSubroutineUniformName)(); return; } //@@ 00a38cd0 FUN_00a38cd0 void FUN_00a38cd0(void) { epoxy_glGetActiveSubroutineUniformiv = (undefined *)FUN_00a2ca10(&DAT_00b2a5a0); /* WARNING: Could not recover jumptable at 0x00a38cf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveSubroutineUniformiv)(); return; } //@@ 00a38d00 FUN_00a38d00 void FUN_00a38d00(void) { epoxy_glGetActiveUniform = (undefined *)FUN_00a2ca10(&DAT_00b3b388); /* WARNING: Could not recover jumptable at 0x00a38d20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveUniform)(); return; } //@@ 00a38d30 FUN_00a38d30 void FUN_00a38d30(void) { epoxy_glGetActiveUniformARB = (undefined *)FUN_00a2ca10(&DAT_00b3cf48); /* WARNING: Could not recover jumptable at 0x00a38d50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveUniformARB)(); return; } //@@ 00a38d60 FUN_00a38d60 void FUN_00a38d60(void) { epoxy_glGetActiveUniformBlockName = (undefined *)FUN_00a2ca10(&DAT_00b3d288); /* WARNING: Could not recover jumptable at 0x00a38d80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveUniformBlockName)(); return; } //@@ 00a38d90 FUN_00a38d90 void FUN_00a38d90(void) { epoxy_glGetActiveUniformBlockiv = (undefined *)FUN_00a2ca10(&DAT_00b3b038); /* WARNING: Could not recover jumptable at 0x00a38db0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveUniformBlockiv)(); return; } //@@ 00a38dc0 FUN_00a38dc0 void FUN_00a38dc0(void) { epoxy_glGetActiveUniformName = (undefined *)FUN_00a2ca10(&DAT_00b3be98); /* WARNING: Could not recover jumptable at 0x00a38de0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveUniformName)(); return; } //@@ 00a38df0 FUN_00a38df0 void FUN_00a38df0(void) { epoxy_glGetActiveUniformsiv = (undefined *)FUN_00a2ca10("=A=A=A"); /* WARNING: Could not recover jumptable at 0x00a38e10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveUniformsiv)(); return; } //@@ 00a38e20 FUN_00a38e20 void FUN_00a38e20(void) { epoxy_glGetActiveVaryingNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38e38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetActiveVaryingNV)(); return; } //@@ 00a38e40 FUN_00a38e40 void FUN_00a38e40(void) { epoxy_glGetArrayObjectfvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38e58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetArrayObjectfvATI)(); return; } //@@ 00a38e60 FUN_00a38e60 void FUN_00a38e60(void) { epoxy_glGetArrayObjectivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38e78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetArrayObjectivATI)(); return; } //@@ 00a38e80 FUN_00a38e80 void FUN_00a38e80(void) { epoxy_glGetAttachedObjectsARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a38e98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetAttachedObjectsARB)(); return; } //@@ 00a38ea0 FUN_00a38ea0 void FUN_00a38ea0(void) { epoxy_glGetAttachedShaders = (undefined *)FUN_00a2ca10(&DAT_00b3c9a4); /* WARNING: Could not recover jumptable at 0x00a38ec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetAttachedShaders)(); return; } //@@ 00a38ed0 FUN_00a38ed0 void FUN_00a38ed0(void) { epoxy_glGetAttribLocation = (undefined *)FUN_00a2ca10(&DAT_00b3bd04); /* WARNING: Could not recover jumptable at 0x00a38ef0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetAttribLocation)(); return; } //@@ 00a38f00 FUN_00a38f00 void FUN_00a38f00(void) { epoxy_glGetAttribLocationARB = (undefined *)FUN_00a2ca10(&DAT_00b28134); /* WARNING: Could not recover jumptable at 0x00a38f20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetAttribLocationARB)(); return; } //@@ 00a38f30 FUN_00a38f30 void FUN_00a38f30(void) { epoxy_glGetBooleanIndexedvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2b1c8); /* WARNING: Could not recover jumptable at 0x00a38f50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBooleanIndexedvEXT)(); return; } //@@ 00a38f60 FUN_00a38f60 void FUN_00a38f60(void) { epoxy_glGetBooleani_v = (undefined *)FUN_00a2ca10(&DAT_00b3b558); /* WARNING: Could not recover jumptable at 0x00a38f80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBooleani_v)(); return; } //@@ 00a38f90 FUN_00a38f90 void FUN_00a38f90(void) { epoxy_glGetBooleanv = (undefined *)FUN_00a2ca10(&DAT_00b28a38); /* WARNING: Could not recover jumptable at 0x00a38fb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBooleanv)(); return; } //@@ 00a38fc0 FUN_00a38fc0 void FUN_00a38fc0(void) { epoxy_glGetBufferParameteri64v = (undefined *)FUN_00a2ca10(&DAT_00b25858); /* WARNING: Could not recover jumptable at 0x00a38fe0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferParameteri64v)(); return; } //@@ 00a39000 FUN_00a39000 void FUN_00a39000(void) { epoxy_glGetBufferParameteriv = (undefined *)FUN_00a2ca10(";B;B;BRB"); /* WARNING: Could not recover jumptable at 0x00a39020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferParameteriv)(); return; } //@@ 00a39030 FUN_00a39030 void FUN_00a39030(void) { epoxy_glGetBufferParameterivARB = (undefined *)FUN_00a2ca10(&DAT_00b25810); /* WARNING: Could not recover jumptable at 0x00a39050. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferParameterivARB)(); return; } //@@ 00a39060 FUN_00a39060 void FUN_00a39060(void) { epoxy_glGetBufferParameterui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39078. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferParameterui64vNV)(); return; } //@@ 00a39080 FUN_00a39080 void FUN_00a39080(void) { epoxy_glGetBufferPointerv = (undefined *)FUN_00a2ca10(&DAT_00b3bbe0); /* WARNING: Could not recover jumptable at 0x00a390a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferPointerv)(); return; } //@@ 00a390b0 FUN_00a390b0 void FUN_00a390b0(void) { epoxy_glGetBufferPointervARB = (undefined *)FUN_00a2ca10(&DAT_00b269c4); /* WARNING: Could not recover jumptable at 0x00a390d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferPointervARB)(); return; } //@@ 00a390e0 FUN_00a390e0 void FUN_00a390e0(void) { epoxy_glGetBufferPointervOES = (undefined *)FUN_00a2ca10(&DAT_00b290e8); /* WARNING: Could not recover jumptable at 0x00a39100. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferPointervOES)(); return; } //@@ 00a39110 FUN_00a39110 void FUN_00a39110(void) { epoxy_glGetBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b3afa0); /* WARNING: Could not recover jumptable at 0x00a39130. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferSubData)(); return; } //@@ 00a39140 FUN_00a39140 void FUN_00a39140(void) { epoxy_glGetBufferSubDataARB = (undefined *)FUN_00a2ca10(&DAT_00b27ed4); /* WARNING: Could not recover jumptable at 0x00a39160. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetBufferSubDataARB)(); return; } //@@ 00a39170 FUN_00a39170 void FUN_00a39170(void) { epoxy_glGetClipPlane = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39188. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetClipPlane)(); return; } //@@ 00a39190 FUN_00a39190 void FUN_00a39190(void) { epoxy_glGetClipPlanef = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a391a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetClipPlanef)(); return; } //@@ 00a391b0 FUN_00a391b0 void FUN_00a391b0(void) { epoxy_glGetClipPlanefOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a391c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetClipPlanefOES)(); return; } //@@ 00a391d0 FUN_00a391d0 void FUN_00a391d0(void) { epoxy_glGetClipPlanex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a391e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetClipPlanex)(); return; } //@@ 00a391f0 FUN_00a391f0 void FUN_00a391f0(void) { epoxy_glGetClipPlanexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetClipPlanexOES)(); return; } //@@ 00a39210 FUN_00a39210 void FUN_00a39210(void) { epoxy_glGetColorTable = (undefined *)FUN_00a2ca10(&DAT_00b2ac14); /* WARNING: Could not recover jumptable at 0x00a39230. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTable)(); return; } //@@ 00a39240 FUN_00a39240 void FUN_00a39240(void) { epoxy_glGetColorTableEXT = (undefined *)FUN_00a2ca10(&DAT_00b253ac); /* WARNING: Could not recover jumptable at 0x00a39260. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableEXT)(); return; } //@@ 00a39270 FUN_00a39270 void FUN_00a39270(void) { epoxy_glGetColorTableParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b29358); /* WARNING: Could not recover jumptable at 0x00a39290. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableParameterfv)(); return; } //@@ 00a392a0 FUN_00a392a0 void FUN_00a392a0(void) { epoxy_glGetColorTableParameterfvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2948c); /* WARNING: Could not recover jumptable at 0x00a392c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableParameterfvEXT)(); return; } //@@ 00a392d0 FUN_00a392d0 void FUN_00a392d0(void) { epoxy_glGetColorTableParameterfvSGI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a392e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableParameterfvSGI)(); return; } //@@ 00a392f0 FUN_00a392f0 void FUN_00a392f0(void) { epoxy_glGetColorTableParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b28ff0); /* WARNING: Could not recover jumptable at 0x00a39310. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableParameteriv)(); return; } //@@ 00a39320 FUN_00a39320 void FUN_00a39320(void) { epoxy_glGetColorTableParameterivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cd6c); /* WARNING: Could not recover jumptable at 0x00a39340. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableParameterivEXT)(); return; } //@@ 00a39350 FUN_00a39350 void FUN_00a39350(void) { epoxy_glGetColorTableParameterivSGI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableParameterivSGI)(); return; } //@@ 00a39370 FUN_00a39370 void FUN_00a39370(void) { epoxy_glGetColorTableSGI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetColorTableSGI)(); return; } //@@ 00a39390 FUN_00a39390 void FUN_00a39390(void) { epoxy_glGetCombinerInputParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a393a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCombinerInputParameterfvNV)(); return; } //@@ 00a393b0 FUN_00a393b0 void FUN_00a393b0(void) { epoxy_glGetCombinerInputParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a393c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCombinerInputParameterivNV)(); return; } //@@ 00a393d0 FUN_00a393d0 void FUN_00a393d0(void) { epoxy_glGetCombinerOutputParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a393e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCombinerOutputParameterfvNV)(); return; } //@@ 00a393f0 FUN_00a393f0 void FUN_00a393f0(void) { epoxy_glGetCombinerOutputParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCombinerOutputParameterivNV)(); return; } //@@ 00a39410 FUN_00a39410 void FUN_00a39410(void) { epoxy_glGetCombinerStageParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCombinerStageParameterfvNV)(); return; } //@@ 00a39430 FUN_00a39430 void FUN_00a39430(void) { epoxy_glGetCommandHeaderNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39448. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCommandHeaderNV)(); return; } //@@ 00a39450 FUN_00a39450 void FUN_00a39450(void) { epoxy_glGetCompressedMultiTexImageEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCompressedMultiTexImageEXT)(); return; } //@@ 00a39470 FUN_00a39470 void FUN_00a39470(void) { epoxy_glGetCompressedTexImage = (undefined *)FUN_00a2ca10(&DAT_00b272b8); /* WARNING: Could not recover jumptable at 0x00a39490. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCompressedTexImage)(); return; } //@@ 00a394a0 FUN_00a394a0 void FUN_00a394a0(void) { epoxy_glGetCompressedTexImageARB = (undefined *)FUN_00a2ca10(&DAT_00b27ccc); /* WARNING: Could not recover jumptable at 0x00a394c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCompressedTexImageARB)(); return; } //@@ 00a394d0 FUN_00a394d0 void FUN_00a394d0(void) { epoxy_glGetCompressedTextureImage = (undefined *)FUN_00a2ca10(&DAT_00b2b130); /* WARNING: Could not recover jumptable at 0x00a394f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCompressedTextureImage)(); return; } //@@ 00a39500 FUN_00a39500 void FUN_00a39500(void) { epoxy_glGetCompressedTextureImageEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39518. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCompressedTextureImageEXT)(); return; } //@@ 00a39520 FUN_00a39520 void FUN_00a39520(void) { epoxy_glGetCompressedTextureSubImage = (undefined *)FUN_00a2ca10(&DAT_00b3b71c); /* WARNING: Could not recover jumptable at 0x00a39540. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCompressedTextureSubImage)(); return; } //@@ 00a39550 FUN_00a39550 void FUN_00a39550(void) { epoxy_glGetConvolutionFilter = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39568. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionFilter)(); return; } //@@ 00a39570 FUN_00a39570 void FUN_00a39570(void) { epoxy_glGetConvolutionFilterEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39588. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionFilterEXT)(); return; } //@@ 00a39590 FUN_00a39590 void FUN_00a39590(void) { epoxy_glGetConvolutionParameterfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a395a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionParameterfv)(); return; } //@@ 00a395b0 FUN_00a395b0 void FUN_00a395b0(void) { epoxy_glGetConvolutionParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a395c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionParameterfvEXT)(); return; } //@@ 00a395d0 FUN_00a395d0 void FUN_00a395d0(void) { epoxy_glGetConvolutionParameteriv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a395e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionParameteriv)(); return; } //@@ 00a395f0 FUN_00a395f0 void FUN_00a395f0(void) { epoxy_glGetConvolutionParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39608. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionParameterivEXT)(); return; } //@@ 00a39610 FUN_00a39610 void FUN_00a39610(void) { epoxy_glGetConvolutionParameterxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetConvolutionParameterxvOES)(); return; } //@@ 00a39630 FUN_00a39630 void FUN_00a39630(void) { epoxy_glGetCoverageModulationTableNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39648. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetCoverageModulationTableNV)(); return; } //@@ 00a39650 FUN_00a39650 void FUN_00a39650(void) { epoxy_glGetDebugMessageLog = (undefined *)FUN_00a2ca10(&DAT_00b25fa8); /* WARNING: Could not recover jumptable at 0x00a39670. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDebugMessageLog)(); return; } //@@ 00a39680 FUN_00a39680 void FUN_00a39680(void) { epoxy_glGetDebugMessageLogAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39698. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDebugMessageLogAMD)(); return; } //@@ 00a396a0 FUN_00a396a0 void FUN_00a396a0(void) { epoxy_glGetDebugMessageLogARB = (undefined *)FUN_00a2ca10(&DAT_00b2a020); /* WARNING: Could not recover jumptable at 0x00a396c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDebugMessageLogARB)(); return; } //@@ 00a396d0 FUN_00a396d0 void FUN_00a396d0(void) { epoxy_glGetDebugMessageLogKHR = (undefined *)FUN_00a2ca10(&DAT_00b2a488); /* WARNING: Could not recover jumptable at 0x00a396f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDebugMessageLogKHR)(); return; } //@@ 00a39700 FUN_00a39700 void FUN_00a39700(void) { epoxy_glGetDetailTexFuncSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39718. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDetailTexFuncSGIS)(); return; } //@@ 00a39720 FUN_00a39720 void FUN_00a39720(void) { epoxy_glGetDoubleIndexedvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a1c8); /* WARNING: Could not recover jumptable at 0x00a39740. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDoubleIndexedvEXT)(); return; } //@@ 00a39750 FUN_00a39750 void FUN_00a39750(void) { epoxy_glGetDoublei_v = (undefined *)FUN_00a2ca10(&DAT_00b29b88); /* WARNING: Could not recover jumptable at 0x00a39770. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDoublei_v)(); return; } //@@ 00a39780 FUN_00a39780 void FUN_00a39780(void) { epoxy_glGetDoublei_vEXT = (undefined *)FUN_00a2ca10(&DAT_00b2ab9c); /* WARNING: Could not recover jumptable at 0x00a397a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDoublei_vEXT)(); return; } //@@ 00a397b0 FUN_00a397b0 void FUN_00a397b0(void) { epoxy_glGetDoublev = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a397c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDoublev)(); return; } //@@ 00a397d0 FUN_00a397d0 void FUN_00a397d0(void) { epoxy_glGetDriverControlStringQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a397e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDriverControlStringQCOM)(); return; } //@@ 00a397f0 FUN_00a397f0 void FUN_00a397f0(void) { epoxy_glGetDriverControlsQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39808. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetDriverControlsQCOM)(); return; } //@@ 00a39830 FUN_00a39830 void FUN_00a39830(void) { epoxy_glGetFenceivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39848. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFenceivNV)(); return; } //@@ 00a39850 FUN_00a39850 void FUN_00a39850(void) { epoxy_glGetFinalCombinerInputParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFinalCombinerInputParameterfvNV)(); return; } //@@ 00a39870 FUN_00a39870 void FUN_00a39870(void) { epoxy_glGetFinalCombinerInputParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFinalCombinerInputParameterivNV)(); return; } //@@ 00a39890 FUN_00a39890 void FUN_00a39890(void) { epoxy_glGetFirstPerfQueryIdINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a398a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFirstPerfQueryIdINTEL)(); return; } //@@ 00a398b0 FUN_00a398b0 void FUN_00a398b0(void) { epoxy_glGetFixedv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a398c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFixedv)(); return; } //@@ 00a398d0 FUN_00a398d0 void FUN_00a398d0(void) { epoxy_glGetFixedvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a398e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFixedvOES)(); return; } //@@ 00a398f0 FUN_00a398f0 void FUN_00a398f0(void) { epoxy_glGetFloatIndexedvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a2a4); /* WARNING: Could not recover jumptable at 0x00a39910. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFloatIndexedvEXT)(); return; } //@@ 00a39920 FUN_00a39920 void FUN_00a39920(void) { epoxy_glGetFloati_v = (undefined *)FUN_00a2ca10(&DAT_00b29f38); /* WARNING: Could not recover jumptable at 0x00a39940. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFloati_v)(); return; } //@@ 00a39950 FUN_00a39950 void FUN_00a39950(void) { epoxy_glGetFloati_vEXT = (undefined *)FUN_00a2ca10(&DAT_00b28adc); /* WARNING: Could not recover jumptable at 0x00a39970. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFloati_vEXT)(); return; } //@@ 00a39980 FUN_00a39980 void FUN_00a39980(void) { epoxy_glGetFloati_vNV = (undefined *)FUN_00a2ca10(&DAT_00b2842c); /* WARNING: Could not recover jumptable at 0x00a399a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFloati_vNV)(); return; } //@@ 00a399b0 FUN_00a399b0 void FUN_00a399b0(void) { epoxy_glGetFloatv = (undefined *)FUN_00a2ca10("BHBHBH"); /* WARNING: Could not recover jumptable at 0x00a399d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFloatv)(); return; } //@@ 00a399e0 FUN_00a399e0 void FUN_00a399e0(void) { epoxy_glGetFogFuncSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a399f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFogFuncSGIS)(); return; } //@@ 00a39a00 FUN_00a39a00 void FUN_00a39a00(void) { epoxy_glGetFragDataIndex = (undefined *)FUN_00a2ca10(&DAT_00b3caf8); /* WARNING: Could not recover jumptable at 0x00a39a20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragDataIndex)(); return; } //@@ 00a39a30 FUN_00a39a30 void FUN_00a39a30(void) { epoxy_glGetFragDataLocation = (undefined *)FUN_00a2ca10(&DAT_00b2531c); /* WARNING: Could not recover jumptable at 0x00a39a50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragDataLocation)(); return; } //@@ 00a39a60 FUN_00a39a60 void FUN_00a39a60(void) { epoxy_glGetFragDataLocationEXT = (undefined *)FUN_00a2ca10(&DAT_00b29990); /* WARNING: Could not recover jumptable at 0x00a39a80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragDataLocationEXT)(); return; } //@@ 00a39a90 FUN_00a39a90 void FUN_00a39a90(void) { epoxy_glGetFragmentLightfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39aa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragmentLightfvSGIX)(); return; } //@@ 00a39ab0 FUN_00a39ab0 void FUN_00a39ab0(void) { epoxy_glGetFragmentLightivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39ac8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragmentLightivSGIX)(); return; } //@@ 00a39ad0 FUN_00a39ad0 void FUN_00a39ad0(void) { epoxy_glGetFragmentMaterialfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39ae8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragmentMaterialfvSGIX)(); return; } //@@ 00a39af0 FUN_00a39af0 void FUN_00a39af0(void) { epoxy_glGetFragmentMaterialivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39b08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFragmentMaterialivSGIX)(); return; } //@@ 00a39b10 FUN_00a39b10 void FUN_00a39b10(void) { epoxy_glGetFramebufferAttachmentParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b27de8); /* WARNING: Could not recover jumptable at 0x00a39b30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFramebufferAttachmentParameteriv)(); return; } //@@ 00a39b40 FUN_00a39b40 void FUN_00a39b40(void) { epoxy_glGetFramebufferAttachmentParameterivEXT = (undefined *)FUN_00a2ca10(&DAT_00b271d0); /* WARNING: Could not recover jumptable at 0x00a39b60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFramebufferAttachmentParameterivEXT)(); return; } //@@ 00a39b70 FUN_00a39b70 void FUN_00a39b70(void) { epoxy_glGetFramebufferAttachmentParameterivOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39b88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFramebufferAttachmentParameterivOES)(); return; } //@@ 00a39b90 FUN_00a39b90 void FUN_00a39b90(void) { epoxy_glGetFramebufferParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b25c68); /* WARNING: Could not recover jumptable at 0x00a39bb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFramebufferParameteriv)(); return; } //@@ 00a39bc0 FUN_00a39bc0 void FUN_00a39bc0(void) { epoxy_glGetFramebufferParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetFramebufferParameterivEXT)(); return; } //@@ 00a39c60 FUN_00a39c60 void FUN_00a39c60(void) { epoxy_glGetHandleARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39c78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHandleARB)(); return; } //@@ 00a39c80 FUN_00a39c80 void FUN_00a39c80(void) { epoxy_glGetHistogram = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogram)(); return; } //@@ 00a39ca0 FUN_00a39ca0 void FUN_00a39ca0(void) { epoxy_glGetHistogramEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39cb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogramEXT)(); return; } //@@ 00a39cc0 FUN_00a39cc0 void FUN_00a39cc0(void) { epoxy_glGetHistogramParameterfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39cd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogramParameterfv)(); return; } //@@ 00a39ce0 FUN_00a39ce0 void FUN_00a39ce0(void) { epoxy_glGetHistogramParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39cf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogramParameterfvEXT)(); return; } //@@ 00a39d00 FUN_00a39d00 void FUN_00a39d00(void) { epoxy_glGetHistogramParameteriv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogramParameteriv)(); return; } //@@ 00a39d20 FUN_00a39d20 void FUN_00a39d20(void) { epoxy_glGetHistogramParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39d38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogramParameterivEXT)(); return; } //@@ 00a39d40 FUN_00a39d40 void FUN_00a39d40(void) { epoxy_glGetHistogramParameterxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39d58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetHistogramParameterxvOES)(); return; } //@@ 00a39d60 FUN_00a39d60 void FUN_00a39d60(void) { epoxy_glGetImageHandleARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39d78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetImageHandleARB)(); return; } //@@ 00a39d80 FUN_00a39d80 void FUN_00a39d80(void) { epoxy_glGetImageHandleNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39d98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetImageHandleNV)(); return; } //@@ 00a39da0 FUN_00a39da0 void FUN_00a39da0(void) { epoxy_glGetImageTransformParameterfvHP = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39db8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetImageTransformParameterfvHP)(); return; } //@@ 00a39dc0 FUN_00a39dc0 void FUN_00a39dc0(void) { epoxy_glGetImageTransformParameterivHP = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetImageTransformParameterivHP)(); return; } //@@ 00a39de0 FUN_00a39de0 void FUN_00a39de0(void) { epoxy_glGetInfoLogARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInfoLogARB)(); return; } //@@ 00a39e20 FUN_00a39e20 void FUN_00a39e20(void) { epoxy_glGetInteger64i_v = (undefined *)FUN_00a2ca10(&DAT_00b2666c); /* WARNING: Could not recover jumptable at 0x00a39e40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInteger64i_v)(); return; } //@@ 00a39e50 FUN_00a39e50 void FUN_00a39e50(void) { epoxy_glGetInteger64v = (undefined *)FUN_00a2ca10(&DAT_00b2a084); /* WARNING: Could not recover jumptable at 0x00a39e70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInteger64v)(); return; } //@@ 00a39e80 FUN_00a39e80 void FUN_00a39e80(void) { epoxy_glGetInteger64vAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b27f00); /* WARNING: Could not recover jumptable at 0x00a39ea0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInteger64vAPPLE)(); return; } //@@ 00a39eb0 FUN_00a39eb0 void FUN_00a39eb0(void) { epoxy_glGetIntegerIndexedvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d310); /* WARNING: Could not recover jumptable at 0x00a39ed0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetIntegerIndexedvEXT)(); return; } //@@ 00a39ee0 FUN_00a39ee0 void FUN_00a39ee0(void) { epoxy_glGetIntegeri_v = (undefined *)FUN_00a2ca10(&DAT_00b251d4); /* WARNING: Could not recover jumptable at 0x00a39f00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetIntegeri_v)(); return; } //@@ 00a39f10 FUN_00a39f10 void FUN_00a39f10(void) { epoxy_glGetIntegeri_vEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39f28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetIntegeri_vEXT)(); return; } //@@ 00a39f30 FUN_00a39f30 void FUN_00a39f30(void) { epoxy_glGetIntegerui64i_vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39f48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetIntegerui64i_vNV)(); return; } //@@ 00a39f50 FUN_00a39f50 void FUN_00a39f50(void) { epoxy_glGetIntegerui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39f68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetIntegerui64vNV)(); return; } //@@ 00a39f70 FUN_00a39f70 void FUN_00a39f70(void) { epoxy_glGetIntegerv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39f88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetIntegerv)(); return; } //@@ 00a39f90 FUN_00a39f90 void FUN_00a39f90(void) { epoxy_glGetInternalformatSampleivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a39fa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInternalformatSampleivNV)(); return; } //@@ 00a39fb0 FUN_00a39fb0 void FUN_00a39fb0(void) { epoxy_glGetInternalformati64v = (undefined *)FUN_00a2ca10(&DAT_00b26078); /* WARNING: Could not recover jumptable at 0x00a39fd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInternalformati64v)(); return; } //@@ 00a39fe0 FUN_00a39fe0 void FUN_00a39fe0(void) { epoxy_glGetInternalformativ = (undefined *)FUN_00a2ca10("TLTLTL"); /* WARNING: Could not recover jumptable at 0x00a3a000. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInternalformativ)(); return; } //@@ 00a3a010 FUN_00a3a010 void FUN_00a3a010(void) { epoxy_glGetInvariantBooleanvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a028. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInvariantBooleanvEXT)(); return; } //@@ 00a3a030 FUN_00a3a030 void FUN_00a3a030(void) { epoxy_glGetInvariantFloatvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInvariantFloatvEXT)(); return; } //@@ 00a3a050 FUN_00a3a050 void FUN_00a3a050(void) { epoxy_glGetInvariantIntegervEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a068. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetInvariantIntegervEXT)(); return; } //@@ 00a3a070 FUN_00a3a070 void FUN_00a3a070(void) { epoxy_glGetLightfv = (undefined *)FUN_00a2ca10(&DAT_00b29c80); /* WARNING: Could not recover jumptable at 0x00a3a090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLightfv)(); return; } //@@ 00a3a0a0 FUN_00a3a0a0 void FUN_00a3a0a0(void) { epoxy_glGetLightiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a0b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLightiv)(); return; } //@@ 00a3a0c0 FUN_00a3a0c0 void FUN_00a3a0c0(void) { epoxy_glGetLightxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a0d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLightxOES)(); return; } //@@ 00a3a0e0 FUN_00a3a0e0 void FUN_00a3a0e0(void) { epoxy_glGetLightxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a0f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLightxv)(); return; } //@@ 00a3a100 FUN_00a3a100 void FUN_00a3a100(void) { epoxy_glGetLightxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a118. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLightxvOES)(); return; } //@@ 00a3a120 FUN_00a3a120 void FUN_00a3a120(void) { epoxy_glGetListParameterfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a138. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetListParameterfvSGIX)(); return; } //@@ 00a3a140 FUN_00a3a140 void FUN_00a3a140(void) { epoxy_glGetListParameterivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a158. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetListParameterivSGIX)(); return; } //@@ 00a3a160 FUN_00a3a160 void FUN_00a3a160(void) { epoxy_glGetLocalConstantBooleanvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a178. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLocalConstantBooleanvEXT)(); return; } //@@ 00a3a180 FUN_00a3a180 void FUN_00a3a180(void) { epoxy_glGetLocalConstantFloatvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a198. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLocalConstantFloatvEXT)(); return; } //@@ 00a3a1a0 FUN_00a3a1a0 void FUN_00a3a1a0(void) { epoxy_glGetLocalConstantIntegervEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a1b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetLocalConstantIntegervEXT)(); return; } //@@ 00a3a1c0 FUN_00a3a1c0 void FUN_00a3a1c0(void) { epoxy_glGetMapAttribParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a1d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapAttribParameterfvNV)(); return; } //@@ 00a3a1e0 FUN_00a3a1e0 void FUN_00a3a1e0(void) { epoxy_glGetMapAttribParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a1f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapAttribParameterivNV)(); return; } //@@ 00a3a200 FUN_00a3a200 void FUN_00a3a200(void) { epoxy_glGetMapControlPointsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a218. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapControlPointsNV)(); return; } //@@ 00a3a220 FUN_00a3a220 void FUN_00a3a220(void) { epoxy_glGetMapParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a238. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapParameterfvNV)(); return; } //@@ 00a3a240 FUN_00a3a240 void FUN_00a3a240(void) { epoxy_glGetMapParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a258. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapParameterivNV)(); return; } //@@ 00a3a260 FUN_00a3a260 void FUN_00a3a260(void) { epoxy_glGetMapdv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapdv)(); return; } //@@ 00a3a280 FUN_00a3a280 void FUN_00a3a280(void) { epoxy_glGetMapfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapfv)(); return; } //@@ 00a3a2a0 FUN_00a3a2a0 void FUN_00a3a2a0(void) { epoxy_glGetMapiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a2b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapiv)(); return; } //@@ 00a3a2c0 FUN_00a3a2c0 void FUN_00a3a2c0(void) { epoxy_glGetMapxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a2d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMapxvOES)(); return; } //@@ 00a3a2e0 FUN_00a3a2e0 void FUN_00a3a2e0(void) { epoxy_glGetMaterialfv = (undefined *)FUN_00a2ca10(&DAT_00b2909c); /* WARNING: Could not recover jumptable at 0x00a3a300. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMaterialfv)(); return; } //@@ 00a3a310 FUN_00a3a310 void FUN_00a3a310(void) { epoxy_glGetMaterialiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMaterialiv)(); return; } //@@ 00a3a330 FUN_00a3a330 void FUN_00a3a330(void) { epoxy_glGetMaterialxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMaterialxOES)(); return; } //@@ 00a3a350 FUN_00a3a350 void FUN_00a3a350(void) { epoxy_glGetMaterialxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMaterialxv)(); return; } //@@ 00a3a370 FUN_00a3a370 void FUN_00a3a370(void) { epoxy_glGetMaterialxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMaterialxvOES)(); return; } //@@ 00a3a390 FUN_00a3a390 void FUN_00a3a390(void) { epoxy_glGetMinmax = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a3a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMinmax)(); return; } //@@ 00a3a3b0 FUN_00a3a3b0 void FUN_00a3a3b0(void) { epoxy_glGetMinmaxEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a3c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMinmaxEXT)(); return; } //@@ 00a3a3d0 FUN_00a3a3d0 void FUN_00a3a3d0(void) { epoxy_glGetMinmaxParameterfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a3e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMinmaxParameterfv)(); return; } //@@ 00a3a3f0 FUN_00a3a3f0 void FUN_00a3a3f0(void) { epoxy_glGetMinmaxParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMinmaxParameterfvEXT)(); return; } //@@ 00a3a410 FUN_00a3a410 void FUN_00a3a410(void) { epoxy_glGetMinmaxParameteriv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMinmaxParameteriv)(); return; } //@@ 00a3a430 FUN_00a3a430 void FUN_00a3a430(void) { epoxy_glGetMinmaxParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a448. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMinmaxParameterivEXT)(); return; } //@@ 00a3a450 FUN_00a3a450 void FUN_00a3a450(void) { epoxy_glGetMultiTexEnvfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexEnvfvEXT)(); return; } //@@ 00a3a470 FUN_00a3a470 void FUN_00a3a470(void) { epoxy_glGetMultiTexEnvivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a488. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexEnvivEXT)(); return; } //@@ 00a3a490 FUN_00a3a490 void FUN_00a3a490(void) { epoxy_glGetMultiTexGendvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a4a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexGendvEXT)(); return; } //@@ 00a3a4b0 FUN_00a3a4b0 void FUN_00a3a4b0(void) { epoxy_glGetMultiTexGenfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a4c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexGenfvEXT)(); return; } //@@ 00a3a4d0 FUN_00a3a4d0 void FUN_00a3a4d0(void) { epoxy_glGetMultiTexGenivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a4e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexGenivEXT)(); return; } //@@ 00a3a4f0 FUN_00a3a4f0 void FUN_00a3a4f0(void) { epoxy_glGetMultiTexImageEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a508. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexImageEXT)(); return; } //@@ 00a3a510 FUN_00a3a510 void FUN_00a3a510(void) { epoxy_glGetMultiTexLevelParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexLevelParameterfvEXT)(); return; } //@@ 00a3a530 FUN_00a3a530 void FUN_00a3a530(void) { epoxy_glGetMultiTexLevelParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a548. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexLevelParameterivEXT)(); return; } //@@ 00a3a550 FUN_00a3a550 void FUN_00a3a550(void) { epoxy_glGetMultiTexParameterIivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a568. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexParameterIivEXT)(); return; } //@@ 00a3a570 FUN_00a3a570 void FUN_00a3a570(void) { epoxy_glGetMultiTexParameterIuivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a588. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexParameterIuivEXT)(); return; } //@@ 00a3a590 FUN_00a3a590 void FUN_00a3a590(void) { epoxy_glGetMultiTexParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a5a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexParameterfvEXT)(); return; } //@@ 00a3a5b0 FUN_00a3a5b0 void FUN_00a3a5b0(void) { epoxy_glGetMultiTexParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3a5c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetMultiTexParameterivEXT)(); return; } //@@ 00a3a5d0 FUN_00a3a5d0 void FUN_00a3a5d0(void) { epoxy_glGetMultisamplefv = (undefined *)FUN_00a2ca10("d>dSd"); /* WARNING: Could not recover jumptable at 0x00a3c6b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformLocation)(); return; } //@@ 00a3c6c0 FUN_00a3c6c0 void FUN_00a3c6c0(void) { epoxy_glGetUniformLocationARB = (undefined *)FUN_00a2ca10("Sd>d>d"); /* WARNING: Could not recover jumptable at 0x00a3c6e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformLocationARB)(); return; } //@@ 00a3c6f0 FUN_00a3c6f0 void FUN_00a3c6f0(void) { epoxy_glGetUniformOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformOffsetEXT)(); return; } //@@ 00a3c710 FUN_00a3c710 void FUN_00a3c710(void) { epoxy_glGetUniformSubroutineuiv = (undefined *)FUN_00a2ca10(&DAT_00b27fac); /* WARNING: Could not recover jumptable at 0x00a3c730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformSubroutineuiv)(); return; } //@@ 00a3c740 FUN_00a3c740 void FUN_00a3c740(void) { epoxy_glGetUniformdv = (undefined *)FUN_00a2ca10(&DAT_00b3d51c); /* WARNING: Could not recover jumptable at 0x00a3c760. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformdv)(); return; } //@@ 00a3c770 FUN_00a3c770 void FUN_00a3c770(void) { epoxy_glGetUniformfv = (undefined *)FUN_00a2ca10(&DAT_00b28b20); /* WARNING: Could not recover jumptable at 0x00a3c790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformfv)(); return; } //@@ 00a3c7a0 FUN_00a3c7a0 void FUN_00a3c7a0(void) { epoxy_glGetUniformfvARB = (undefined *)FUN_00a2ca10(&DAT_00b2ae50); /* WARNING: Could not recover jumptable at 0x00a3c7c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformfvARB)(); return; } //@@ 00a3c7d0 FUN_00a3c7d0 void FUN_00a3c7d0(void) { epoxy_glGetUniformi64vNV = (undefined *)FUN_00a2ca10(&DAT_00b263dc); /* WARNING: Could not recover jumptable at 0x00a3c7f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformi64vNV)(); return; } //@@ 00a3c800 FUN_00a3c800 void FUN_00a3c800(void) { epoxy_glGetUniformiv = (undefined *)FUN_00a2ca10(&DAT_00b3b9b4); /* WARNING: Could not recover jumptable at 0x00a3c820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformiv)(); return; } //@@ 00a3c830 FUN_00a3c830 void FUN_00a3c830(void) { epoxy_glGetUniformivARB = (undefined *)FUN_00a2ca10(&DAT_00b3aeac); /* WARNING: Could not recover jumptable at 0x00a3c850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformivARB)(); return; } //@@ 00a3c860 FUN_00a3c860 void FUN_00a3c860(void) { epoxy_glGetUniformui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b2b038); /* WARNING: Could not recover jumptable at 0x00a3c880. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformui64vNV)(); return; } //@@ 00a3c890 FUN_00a3c890 void FUN_00a3c890(void) { epoxy_glGetUniformuiv = (undefined *)FUN_00a2ca10(&DAT_00b28808); /* WARNING: Could not recover jumptable at 0x00a3c8b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformuiv)(); return; } //@@ 00a3c8c0 FUN_00a3c8c0 void FUN_00a3c8c0(void) { epoxy_glGetUniformuivEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a554); /* WARNING: Could not recover jumptable at 0x00a3c8e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetUniformuivEXT)(); return; } //@@ 00a3c8f0 FUN_00a3c8f0 void FUN_00a3c8f0(void) { epoxy_glGetVariantArrayObjectfvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c908. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVariantArrayObjectfvATI)(); return; } //@@ 00a3c910 FUN_00a3c910 void FUN_00a3c910(void) { epoxy_glGetVariantArrayObjectivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c928. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVariantArrayObjectivATI)(); return; } //@@ 00a3c930 FUN_00a3c930 void FUN_00a3c930(void) { epoxy_glGetVariantBooleanvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c948. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVariantBooleanvEXT)(); return; } //@@ 00a3c950 FUN_00a3c950 void FUN_00a3c950(void) { epoxy_glGetVariantFloatvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c968. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVariantFloatvEXT)(); return; } //@@ 00a3c970 FUN_00a3c970 void FUN_00a3c970(void) { epoxy_glGetVariantIntegervEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c988. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVariantIntegervEXT)(); return; } //@@ 00a3c990 FUN_00a3c990 void FUN_00a3c990(void) { epoxy_glGetVariantPointervEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c9a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVariantPointervEXT)(); return; } //@@ 00a3c9b0 FUN_00a3c9b0 void FUN_00a3c9b0(void) { epoxy_glGetVaryingLocationNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3c9c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVaryingLocationNV)(); return; } //@@ 00a3c9d0 FUN_00a3c9d0 void FUN_00a3c9d0(void) { epoxy_glGetVertexArrayIndexed64iv = (undefined *)FUN_00a2ca10(&DAT_00b3aed4); /* WARNING: Could not recover jumptable at 0x00a3c9f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayIndexed64iv)(); return; } //@@ 00a3ca00 FUN_00a3ca00 void FUN_00a3ca00(void) { epoxy_glGetVertexArrayIndexediv = (undefined *)FUN_00a2ca10(&DAT_00b27cf8); /* WARNING: Could not recover jumptable at 0x00a3ca20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayIndexediv)(); return; } //@@ 00a3ca30 FUN_00a3ca30 void FUN_00a3ca30(void) { epoxy_glGetVertexArrayIntegeri_vEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ca48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayIntegeri_vEXT)(); return; } //@@ 00a3ca50 FUN_00a3ca50 void FUN_00a3ca50(void) { epoxy_glGetVertexArrayIntegervEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ca68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayIntegervEXT)(); return; } //@@ 00a3ca70 FUN_00a3ca70 void FUN_00a3ca70(void) { epoxy_glGetVertexArrayPointeri_vEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ca88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayPointeri_vEXT)(); return; } //@@ 00a3ca90 FUN_00a3ca90 void FUN_00a3ca90(void) { epoxy_glGetVertexArrayPointervEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3caa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayPointervEXT)(); return; } //@@ 00a3cab0 FUN_00a3cab0 void FUN_00a3cab0(void) { epoxy_glGetVertexArrayiv = (undefined *)FUN_00a2ca10(&DAT_00b28508); /* WARNING: Could not recover jumptable at 0x00a3cad0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexArrayiv)(); return; } //@@ 00a3cae0 FUN_00a3cae0 void FUN_00a3cae0(void) { epoxy_glGetVertexAttribArrayObjectfvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3caf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribArrayObjectfvATI)(); return; } //@@ 00a3cb00 FUN_00a3cb00 void FUN_00a3cb00(void) { epoxy_glGetVertexAttribArrayObjectivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cb18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribArrayObjectivATI)(); return; } //@@ 00a3cb20 FUN_00a3cb20 void FUN_00a3cb20(void) { epoxy_glGetVertexAttribIiv = (undefined *)FUN_00a2ca10(&DAT_00b3d248); /* WARNING: Could not recover jumptable at 0x00a3cb40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribIiv)(); return; } //@@ 00a3cb50 FUN_00a3cb50 void FUN_00a3cb50(void) { epoxy_glGetVertexAttribIivEXT = (undefined *)FUN_00a2ca10(&DAT_00b29250); /* WARNING: Could not recover jumptable at 0x00a3cb70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribIivEXT)(); return; } //@@ 00a3cb80 FUN_00a3cb80 void FUN_00a3cb80(void) { epoxy_glGetVertexAttribIuiv = (undefined *)FUN_00a2ca10(&DAT_00b3d698); /* WARNING: Could not recover jumptable at 0x00a3cba0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribIuiv)(); return; } //@@ 00a3cbb0 FUN_00a3cbb0 void FUN_00a3cbb0(void) { epoxy_glGetVertexAttribIuivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3da44); /* WARNING: Could not recover jumptable at 0x00a3cbd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribIuivEXT)(); return; } //@@ 00a3cbe0 FUN_00a3cbe0 void FUN_00a3cbe0(void) { epoxy_glGetVertexAttribLdv = (undefined *)FUN_00a2ca10("BgBgWg"); /* WARNING: Could not recover jumptable at 0x00a3cc00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribLdv)(); return; } //@@ 00a3cc10 FUN_00a3cc10 void FUN_00a3cc10(void) { epoxy_glGetVertexAttribLdvEXT = (undefined *)FUN_00a2ca10("WgBgBg"); /* WARNING: Could not recover jumptable at 0x00a3cc30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribLdvEXT)(); return; } //@@ 00a3cc40 FUN_00a3cc40 void FUN_00a3cc40(void) { epoxy_glGetVertexAttribLi64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cc58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribLi64vNV)(); return; } //@@ 00a3cc60 FUN_00a3cc60 void FUN_00a3cc60(void) { epoxy_glGetVertexAttribLui64vARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cc78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribLui64vARB)(); return; } //@@ 00a3cc80 FUN_00a3cc80 void FUN_00a3cc80(void) { epoxy_glGetVertexAttribLui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cc98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribLui64vNV)(); return; } //@@ 00a3cca0 FUN_00a3cca0 void FUN_00a3cca0(void) { epoxy_glGetVertexAttribPointerv = (undefined *)FUN_00a2ca10(&DAT_00b3ccb8); /* WARNING: Could not recover jumptable at 0x00a3ccc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribPointerv)(); return; } //@@ 00a3ccd0 FUN_00a3ccd0 void FUN_00a3ccd0(void) { epoxy_glGetVertexAttribPointervARB = (undefined *)FUN_00a2ca10(&DAT_00b3b338); /* WARNING: Could not recover jumptable at 0x00a3ccf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribPointervARB)(); return; } //@@ 00a3cd00 FUN_00a3cd00 void FUN_00a3cd00(void) { epoxy_glGetVertexAttribPointervNV = (undefined *)FUN_00a2ca10(&DAT_00b26810); /* WARNING: Could not recover jumptable at 0x00a3cd20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribPointervNV)(); return; } //@@ 00a3cd30 FUN_00a3cd30 void FUN_00a3cd30(void) { epoxy_glGetVertexAttribdv = (undefined *)FUN_00a2ca10(&DAT_00b3c868); /* WARNING: Could not recover jumptable at 0x00a3cd50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribdv)(); return; } //@@ 00a3cd60 FUN_00a3cd60 void FUN_00a3cd60(void) { epoxy_glGetVertexAttribdvARB = (undefined *)FUN_00a2ca10(&DAT_00b27d50); /* WARNING: Could not recover jumptable at 0x00a3cd80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribdvARB)(); return; } //@@ 00a3cd90 FUN_00a3cd90 void FUN_00a3cd90(void) { epoxy_glGetVertexAttribdvNV = (undefined *)FUN_00a2ca10(&DAT_00b3b5bc); /* WARNING: Could not recover jumptable at 0x00a3cdb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribdvNV)(); return; } //@@ 00a3cdc0 FUN_00a3cdc0 void FUN_00a3cdc0(void) { epoxy_glGetVertexAttribfv = (undefined *)FUN_00a2ca10("QhQheheh|h"); /* WARNING: Could not recover jumptable at 0x00a3cde0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribfv)(); return; } //@@ 00a3cdf0 FUN_00a3cdf0 void FUN_00a3cdf0(void) { epoxy_glGetVertexAttribfvARB = (undefined *)FUN_00a2ca10("ehehQhQh|h"); /* WARNING: Could not recover jumptable at 0x00a3ce10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribfvARB)(); return; } //@@ 00a3ce20 FUN_00a3ce20 void FUN_00a3ce20(void) { epoxy_glGetVertexAttribfvNV = (undefined *)FUN_00a2ca10("|hQhQheheh"); /* WARNING: Could not recover jumptable at 0x00a3ce40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribfvNV)(); return; } //@@ 00a3ce50 FUN_00a3ce50 void FUN_00a3ce50(void) { epoxy_glGetVertexAttribiv = (undefined *)FUN_00a2ca10(&DAT_00b29f70); /* WARNING: Could not recover jumptable at 0x00a3ce70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribiv)(); return; } //@@ 00a3ce80 FUN_00a3ce80 void FUN_00a3ce80(void) { epoxy_glGetVertexAttribivARB = (undefined *)FUN_00a2ca10(&DAT_00b3b75c); /* WARNING: Could not recover jumptable at 0x00a3cea0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribivARB)(); return; } //@@ 00a3ceb0 FUN_00a3ceb0 void FUN_00a3ceb0(void) { epoxy_glGetVertexAttribivNV = (undefined *)FUN_00a2ca10(&DAT_00b281b8); /* WARNING: Could not recover jumptable at 0x00a3ced0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVertexAttribivNV)(); return; } //@@ 00a3cee0 FUN_00a3cee0 void FUN_00a3cee0(void) { epoxy_glGetVideoCaptureStreamdvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cef8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoCaptureStreamdvNV)(); return; } //@@ 00a3cf00 FUN_00a3cf00 void FUN_00a3cf00(void) { epoxy_glGetVideoCaptureStreamfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cf18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoCaptureStreamfvNV)(); return; } //@@ 00a3cf20 FUN_00a3cf20 void FUN_00a3cf20(void) { epoxy_glGetVideoCaptureStreamivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cf38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoCaptureStreamivNV)(); return; } //@@ 00a3cf40 FUN_00a3cf40 void FUN_00a3cf40(void) { epoxy_glGetVideoCaptureivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cf58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoCaptureivNV)(); return; } //@@ 00a3cf60 FUN_00a3cf60 void FUN_00a3cf60(void) { epoxy_glGetVideoi64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cf78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoi64vNV)(); return; } //@@ 00a3cf80 FUN_00a3cf80 void FUN_00a3cf80(void) { epoxy_glGetVideoivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cf98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoivNV)(); return; } //@@ 00a3cfa0 FUN_00a3cfa0 void FUN_00a3cfa0(void) { epoxy_glGetVideoui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cfb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideoui64vNV)(); return; } //@@ 00a3cfc0 FUN_00a3cfc0 void FUN_00a3cfc0(void) { epoxy_glGetVideouivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cfd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetVideouivNV)(); return; } //@@ 00a3cfe0 FUN_00a3cfe0 void FUN_00a3cfe0(void) { epoxy_glGetnColorTable = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3cff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnColorTable)(); return; } //@@ 00a3d000 FUN_00a3d000 void FUN_00a3d000(void) { epoxy_glGetnColorTableARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d018. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnColorTableARB)(); return; } //@@ 00a3d020 FUN_00a3d020 void FUN_00a3d020(void) { epoxy_glGetnCompressedTexImage = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d038. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnCompressedTexImage)(); return; } //@@ 00a3d040 FUN_00a3d040 void FUN_00a3d040(void) { epoxy_glGetnCompressedTexImageARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d058. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnCompressedTexImageARB)(); return; } //@@ 00a3d060 FUN_00a3d060 void FUN_00a3d060(void) { epoxy_glGetnConvolutionFilter = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d078. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnConvolutionFilter)(); return; } //@@ 00a3d080 FUN_00a3d080 void FUN_00a3d080(void) { epoxy_glGetnConvolutionFilterARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d098. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnConvolutionFilterARB)(); return; } //@@ 00a3d0a0 FUN_00a3d0a0 void FUN_00a3d0a0(void) { epoxy_glGetnHistogram = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d0b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnHistogram)(); return; } //@@ 00a3d0c0 FUN_00a3d0c0 void FUN_00a3d0c0(void) { epoxy_glGetnHistogramARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d0d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnHistogramARB)(); return; } //@@ 00a3d0e0 FUN_00a3d0e0 void FUN_00a3d0e0(void) { epoxy_glGetnMapdv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d0f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMapdv)(); return; } //@@ 00a3d100 FUN_00a3d100 void FUN_00a3d100(void) { epoxy_glGetnMapdvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d118. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMapdvARB)(); return; } //@@ 00a3d120 FUN_00a3d120 void FUN_00a3d120(void) { epoxy_glGetnMapfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d138. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMapfv)(); return; } //@@ 00a3d140 FUN_00a3d140 void FUN_00a3d140(void) { epoxy_glGetnMapfvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d158. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMapfvARB)(); return; } //@@ 00a3d160 FUN_00a3d160 void FUN_00a3d160(void) { epoxy_glGetnMapiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d178. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMapiv)(); return; } //@@ 00a3d180 FUN_00a3d180 void FUN_00a3d180(void) { epoxy_glGetnMapivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d198. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMapivARB)(); return; } //@@ 00a3d1a0 FUN_00a3d1a0 void FUN_00a3d1a0(void) { epoxy_glGetnMinmax = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d1b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMinmax)(); return; } //@@ 00a3d1c0 FUN_00a3d1c0 void FUN_00a3d1c0(void) { epoxy_glGetnMinmaxARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d1d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnMinmaxARB)(); return; } //@@ 00a3d1e0 FUN_00a3d1e0 void FUN_00a3d1e0(void) { epoxy_glGetnPixelMapfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d1f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPixelMapfv)(); return; } //@@ 00a3d200 FUN_00a3d200 void FUN_00a3d200(void) { epoxy_glGetnPixelMapfvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d218. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPixelMapfvARB)(); return; } //@@ 00a3d220 FUN_00a3d220 void FUN_00a3d220(void) { epoxy_glGetnPixelMapuiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d238. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPixelMapuiv)(); return; } //@@ 00a3d240 FUN_00a3d240 void FUN_00a3d240(void) { epoxy_glGetnPixelMapuivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d258. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPixelMapuivARB)(); return; } //@@ 00a3d260 FUN_00a3d260 void FUN_00a3d260(void) { epoxy_glGetnPixelMapusv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPixelMapusv)(); return; } //@@ 00a3d280 FUN_00a3d280 void FUN_00a3d280(void) { epoxy_glGetnPixelMapusvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPixelMapusvARB)(); return; } //@@ 00a3d2a0 FUN_00a3d2a0 void FUN_00a3d2a0(void) { epoxy_glGetnPolygonStipple = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d2b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPolygonStipple)(); return; } //@@ 00a3d2c0 FUN_00a3d2c0 void FUN_00a3d2c0(void) { epoxy_glGetnPolygonStippleARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d2d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnPolygonStippleARB)(); return; } //@@ 00a3d2e0 FUN_00a3d2e0 void FUN_00a3d2e0(void) { epoxy_glGetnSeparableFilter = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d2f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnSeparableFilter)(); return; } //@@ 00a3d300 FUN_00a3d300 void FUN_00a3d300(void) { epoxy_glGetnSeparableFilterARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnSeparableFilterARB)(); return; } //@@ 00a3d320 FUN_00a3d320 void FUN_00a3d320(void) { epoxy_glGetnTexImage = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d338. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnTexImage)(); return; } //@@ 00a3d340 FUN_00a3d340 void FUN_00a3d340(void) { epoxy_glGetnTexImageARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d358. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnTexImageARB)(); return; } //@@ 00a3d360 FUN_00a3d360 void FUN_00a3d360(void) { epoxy_glGetnUniformdv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformdv)(); return; } //@@ 00a3d380 FUN_00a3d380 void FUN_00a3d380(void) { epoxy_glGetnUniformdvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformdvARB)(); return; } //@@ 00a3d3a0 FUN_00a3d3a0 void FUN_00a3d3a0(void) { epoxy_glGetnUniformfv = (undefined *)FUN_00a2ca10(&DAT_00b27f10); /* WARNING: Could not recover jumptable at 0x00a3d3c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformfv)(); return; } //@@ 00a3d3d0 FUN_00a3d3d0 void FUN_00a3d3d0(void) { epoxy_glGetnUniformfvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d3e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformfvARB)(); return; } //@@ 00a3d3f0 FUN_00a3d3f0 void FUN_00a3d3f0(void) { epoxy_glGetnUniformfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformfvEXT)(); return; } //@@ 00a3d410 FUN_00a3d410 void FUN_00a3d410(void) { epoxy_glGetnUniformfvKHR = (undefined *)FUN_00a2ca10(&DAT_00b3b488); /* WARNING: Could not recover jumptable at 0x00a3d430. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformfvKHR)(); return; } //@@ 00a3d440 FUN_00a3d440 void FUN_00a3d440(void) { epoxy_glGetnUniformiv = (undefined *)FUN_00a2ca10(&DAT_00b3c3c8); /* WARNING: Could not recover jumptable at 0x00a3d460. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformiv)(); return; } //@@ 00a3d470 FUN_00a3d470 void FUN_00a3d470(void) { epoxy_glGetnUniformivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d488. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformivARB)(); return; } //@@ 00a3d490 FUN_00a3d490 void FUN_00a3d490(void) { epoxy_glGetnUniformivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d4a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformivEXT)(); return; } //@@ 00a3d4b0 FUN_00a3d4b0 void FUN_00a3d4b0(void) { epoxy_glGetnUniformivKHR = (undefined *)FUN_00a2ca10(&DAT_00b3cbc8); /* WARNING: Could not recover jumptable at 0x00a3d4d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformivKHR)(); return; } //@@ 00a3d4e0 FUN_00a3d4e0 void FUN_00a3d4e0(void) { epoxy_glGetnUniformuiv = (undefined *)FUN_00a2ca10("BlBlgl"); /* WARNING: Could not recover jumptable at 0x00a3d500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformuiv)(); return; } //@@ 00a3d510 FUN_00a3d510 void FUN_00a3d510(void) { epoxy_glGetnUniformuivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformuivARB)(); return; } //@@ 00a3d530 FUN_00a3d530 void FUN_00a3d530(void) { epoxy_glGetnUniformuivKHR = (undefined *)FUN_00a2ca10("glBlBl"); /* WARNING: Could not recover jumptable at 0x00a3d550. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGetnUniformuivKHR)(); return; } //@@ 00a3d560 FUN_00a3d560 void FUN_00a3d560(void) { epoxy_glGlobalAlphaFactorbSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGlobalAlphaFactorbSUN)(); return; } //@@ 00a3d580 FUN_00a3d580 void FUN_00a3d580(undefined8 param_1) { epoxy_glGlobalAlphaFactordSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glGlobalAlphaFactordSUN)(param_1); return; } //@@ 00a3d5b0 FUN_00a3d5b0 void FUN_00a3d5b0(undefined4 param_1) { epoxy_glGlobalAlphaFactorfSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glGlobalAlphaFactorfSUN)(param_1); return; } //@@ 00a3d5e0 FUN_00a3d5e0 void FUN_00a3d5e0(void) { epoxy_glGlobalAlphaFactoriSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d5f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGlobalAlphaFactoriSUN)(); return; } //@@ 00a3d600 FUN_00a3d600 void FUN_00a3d600(void) { epoxy_glGlobalAlphaFactorsSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGlobalAlphaFactorsSUN)(); return; } //@@ 00a3d620 FUN_00a3d620 void FUN_00a3d620(void) { epoxy_glGlobalAlphaFactorubSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d638. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGlobalAlphaFactorubSUN)(); return; } //@@ 00a3d640 FUN_00a3d640 void FUN_00a3d640(void) { epoxy_glGlobalAlphaFactoruiSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d658. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGlobalAlphaFactoruiSUN)(); return; } //@@ 00a3d660 FUN_00a3d660 void FUN_00a3d660(void) { epoxy_glGlobalAlphaFactorusSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d678. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glGlobalAlphaFactorusSUN)(); return; } //@@ 00a3d680 FUN_00a3d680 void FUN_00a3d680(void) { epoxy_glHint = (undefined *)FUN_00a2ca10(">m>m>m"); /* WARNING: Could not recover jumptable at 0x00a3d6a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glHint)(); return; } //@@ 00a3d6b0 FUN_00a3d6b0 void FUN_00a3d6b0(void) { epoxy_glHintPGI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d6c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glHintPGI)(); return; } //@@ 00a3d6d0 FUN_00a3d6d0 void FUN_00a3d6d0(void) { epoxy_glHistogram = (undefined *)FUN_00a2ca10(&DAT_00b3ca8c); /* WARNING: Could not recover jumptable at 0x00a3d6f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glHistogram)(); return; } //@@ 00a3d700 FUN_00a3d700 void FUN_00a3d700(void) { epoxy_glHistogramEXT = (undefined *)FUN_00a2ca10(&DAT_00b286a4); /* WARNING: Could not recover jumptable at 0x00a3d720. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glHistogramEXT)(); return; } //@@ 00a3d730 FUN_00a3d730 void FUN_00a3d730(void) { epoxy_glIglooInterfaceSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIglooInterfaceSGIX)(); return; } //@@ 00a3d750 FUN_00a3d750 void FUN_00a3d750(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glImageTransformParameterfHP = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glImageTransformParameterfHP)(param_1,param_2,param_3); return; } //@@ 00a3d780 FUN_00a3d780 void FUN_00a3d780(void) { epoxy_glImageTransformParameterfvHP = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d798. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glImageTransformParameterfvHP)(); return; } //@@ 00a3d7a0 FUN_00a3d7a0 void FUN_00a3d7a0(void) { epoxy_glImageTransformParameteriHP = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d7b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glImageTransformParameteriHP)(); return; } //@@ 00a3d7c0 FUN_00a3d7c0 void FUN_00a3d7c0(void) { epoxy_glImageTransformParameterivHP = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d7d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glImageTransformParameterivHP)(); return; } //@@ 00a3d7e0 FUN_00a3d7e0 void FUN_00a3d7e0(void) { epoxy_glImportSyncEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d7f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glImportSyncEXT)(); return; } //@@ 00a3d800 FUN_00a3d800 void FUN_00a3d800(void) { epoxy_glIndexFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexFormatNV)(); return; } //@@ 00a3d820 FUN_00a3d820 void FUN_00a3d820(undefined4 param_1,undefined4 param_2) { epoxy_glIndexFuncEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIndexFuncEXT)(param_1,param_2); return; } //@@ 00a3d850 FUN_00a3d850 void FUN_00a3d850(void) { epoxy_glIndexMask = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexMask)(); return; } //@@ 00a3d870 FUN_00a3d870 void FUN_00a3d870(void) { epoxy_glIndexMaterialEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexMaterialEXT)(); return; } //@@ 00a3d890 FUN_00a3d890 void FUN_00a3d890(void) { epoxy_glIndexPointer = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d8a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexPointer)(); return; } //@@ 00a3d8b0 FUN_00a3d8b0 void FUN_00a3d8b0(void) { epoxy_glIndexPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d8c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexPointerEXT)(); return; } //@@ 00a3d8d0 FUN_00a3d8d0 void FUN_00a3d8d0(void) { epoxy_glIndexPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d8e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexPointerListIBM)(); return; } //@@ 00a3d8f0 FUN_00a3d8f0 void FUN_00a3d8f0(undefined8 param_1) { epoxy_glIndexd = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIndexd)(param_1); return; } //@@ 00a3d920 FUN_00a3d920 void FUN_00a3d920(void) { epoxy_glIndexdv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexdv)(); return; } //@@ 00a3d940 FUN_00a3d940 void FUN_00a3d940(undefined4 param_1) { epoxy_glIndexf = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIndexf)(param_1); return; } //@@ 00a3d970 FUN_00a3d970 void FUN_00a3d970(void) { epoxy_glIndexfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d988. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexfv)(); return; } //@@ 00a3d990 FUN_00a3d990 void FUN_00a3d990(void) { epoxy_glIndexi = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d9a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexi)(); return; } //@@ 00a3d9b0 FUN_00a3d9b0 void FUN_00a3d9b0(void) { epoxy_glIndexiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d9c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexiv)(); return; } //@@ 00a3d9d0 FUN_00a3d9d0 void FUN_00a3d9d0(void) { epoxy_glIndexs = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3d9e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexs)(); return; } //@@ 00a3d9f0 FUN_00a3d9f0 void FUN_00a3d9f0(void) { epoxy_glIndexsv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3da08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexsv)(); return; } //@@ 00a3da10 FUN_00a3da10 void FUN_00a3da10(void) { epoxy_glIndexub = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3da28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexub)(); return; } //@@ 00a3da30 FUN_00a3da30 void FUN_00a3da30(void) { epoxy_glIndexubv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3da48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexubv)(); return; } //@@ 00a3da50 FUN_00a3da50 void FUN_00a3da50(void) { epoxy_glIndexxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3da68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexxOES)(); return; } //@@ 00a3da70 FUN_00a3da70 void FUN_00a3da70(void) { epoxy_glIndexxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3da88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIndexxvOES)(); return; } //@@ 00a3dab0 FUN_00a3dab0 void FUN_00a3dab0(void) { epoxy_glInsertComponentEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3dac8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInsertComponentEXT)(); return; } //@@ 00a3dad0 FUN_00a3dad0 void FUN_00a3dad0(void) { epoxy_glInsertEventMarkerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3dae8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInsertEventMarkerEXT)(); return; } //@@ 00a3daf0 FUN_00a3daf0 void FUN_00a3daf0(void) { epoxy_glInstrumentsBufferSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3db08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInstrumentsBufferSGIX)(); return; } //@@ 00a3db10 FUN_00a3db10 void FUN_00a3db10(void) { epoxy_glInterleavedArrays = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3db28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInterleavedArrays)(); return; } //@@ 00a3db30 FUN_00a3db30 void FUN_00a3db30(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glInterpolatePathsNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glInterpolatePathsNV)(param_1,param_2,param_3,param_4); return; } //@@ 00a3db70 FUN_00a3db70 void FUN_00a3db70(void) { epoxy_glInvalidateBufferData = (undefined *)FUN_00a2ca10(&DAT_00b28748); /* WARNING: Could not recover jumptable at 0x00a3db90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateBufferData)(); return; } //@@ 00a3dba0 FUN_00a3dba0 void FUN_00a3dba0(void) { epoxy_glInvalidateBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b3b334); /* WARNING: Could not recover jumptable at 0x00a3dbc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateBufferSubData)(); return; } //@@ 00a3dbd0 FUN_00a3dbd0 void FUN_00a3dbd0(void) { epoxy_glInvalidateFramebuffer = (undefined *)FUN_00a2ca10(&DAT_00b2812c); /* WARNING: Could not recover jumptable at 0x00a3dbf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateFramebuffer)(); return; } //@@ 00a3dc00 FUN_00a3dc00 void FUN_00a3dc00(void) { epoxy_glInvalidateNamedFramebufferData = (undefined *)FUN_00a2ca10(&DAT_00b3ce04); /* WARNING: Could not recover jumptable at 0x00a3dc20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateNamedFramebufferData)(); return; } //@@ 00a3dc30 FUN_00a3dc30 void FUN_00a3dc30(void) { epoxy_glInvalidateNamedFramebufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b2a980); /* WARNING: Could not recover jumptable at 0x00a3dc50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateNamedFramebufferSubData)(); return; } //@@ 00a3dc60 FUN_00a3dc60 void FUN_00a3dc60(void) { epoxy_glInvalidateSubFramebuffer = (undefined *)FUN_00a2ca10(&DAT_00b3d8f4); /* WARNING: Could not recover jumptable at 0x00a3dc80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateSubFramebuffer)(); return; } //@@ 00a3dc90 FUN_00a3dc90 void FUN_00a3dc90(void) { epoxy_glInvalidateTexImage = (undefined *)FUN_00a2ca10(&DAT_00b2aa08); /* WARNING: Could not recover jumptable at 0x00a3dcb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateTexImage)(); return; } //@@ 00a3dcc0 FUN_00a3dcc0 void FUN_00a3dcc0(void) { epoxy_glInvalidateTexSubImage = (undefined *)FUN_00a2ca10(&DAT_00b29270); /* WARNING: Could not recover jumptable at 0x00a3dce0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glInvalidateTexSubImage)(); return; } //@@ 00a3dcf0 FUN_00a3dcf0 void FUN_00a3dcf0(void) { epoxy_glIsAsyncMarkerSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3dd08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsAsyncMarkerSGIX)(); return; } //@@ 00a3dd10 FUN_00a3dd10 void FUN_00a3dd10(void) { epoxy_glIsBuffer = (undefined *)FUN_00a2ca10(&DAT_00b3ccf8); /* WARNING: Could not recover jumptable at 0x00a3dd30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsBuffer)(); return; } //@@ 00a3dd40 FUN_00a3dd40 void FUN_00a3dd40(void) { epoxy_glIsBufferARB = (undefined *)FUN_00a2ca10(&DAT_00b3bdf0); /* WARNING: Could not recover jumptable at 0x00a3dd60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsBufferARB)(); return; } //@@ 00a3dd70 FUN_00a3dd70 void FUN_00a3dd70(void) { epoxy_glIsBufferResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3dd88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsBufferResidentNV)(); return; } //@@ 00a3dd90 FUN_00a3dd90 void FUN_00a3dd90(void) { epoxy_glIsCommandListNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3dda8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsCommandListNV)(); return; } //@@ 00a3ddb0 FUN_00a3ddb0 void FUN_00a3ddb0(void) { epoxy_glIsEnabled = (undefined *)FUN_00a2ca10(&DAT_00b3c9e4); /* WARNING: Could not recover jumptable at 0x00a3ddd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsEnabled)(); return; } //@@ 00a3dde0 FUN_00a3dde0 void FUN_00a3dde0(void) { epoxy_glIsEnabledIndexedEXT = (undefined *)FUN_00a2ca10(&DAT_00b27968); /* WARNING: Could not recover jumptable at 0x00a3de00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsEnabledIndexedEXT)(); return; } //@@ 00a3de10 FUN_00a3de10 void FUN_00a3de10(void) { epoxy_glIsEnabledi = (undefined *)FUN_00a2ca10(&DAT_00b2abf0); /* WARNING: Could not recover jumptable at 0x00a3de30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsEnabledi)(); return; } //@@ 00a3de40 FUN_00a3de40 void FUN_00a3de40(void) { epoxy_glIsEnablediEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b530); /* WARNING: Could not recover jumptable at 0x00a3de60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsEnablediEXT)(); return; } //@@ 00a3de70 FUN_00a3de70 void FUN_00a3de70(void) { epoxy_glIsEnablediNV = (undefined *)FUN_00a2ca10(&DAT_00b3cb38); /* WARNING: Could not recover jumptable at 0x00a3de90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsEnablediNV)(); return; } //@@ 00a3dea0 FUN_00a3dea0 void FUN_00a3dea0(void) { epoxy_glIsEnablediOES = (undefined *)FUN_00a2ca10(0xb3c6f4); /* WARNING: Could not recover jumptable at 0x00a3dec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsEnablediOES)(); return; } //@@ 00a3ded0 FUN_00a3ded0 void FUN_00a3ded0(void) { epoxy_glIsFenceAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3dee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsFenceAPPLE)(); return; } //@@ 00a3def0 FUN_00a3def0 void FUN_00a3def0(void) { epoxy_glIsFenceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3df08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsFenceNV)(); return; } //@@ 00a3df10 FUN_00a3df10 void FUN_00a3df10(void) { epoxy_glIsFramebuffer = (undefined *)FUN_00a2ca10(&DAT_00b26fe0); /* WARNING: Could not recover jumptable at 0x00a3df30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsFramebuffer)(); return; } //@@ 00a3df40 FUN_00a3df40 void FUN_00a3df40(void) { epoxy_glIsFramebufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b25ea8); /* WARNING: Could not recover jumptable at 0x00a3df60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsFramebufferEXT)(); return; } //@@ 00a3df70 FUN_00a3df70 void FUN_00a3df70(void) { epoxy_glIsFramebufferOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3df88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsFramebufferOES)(); return; } //@@ 00a3df90 FUN_00a3df90 void FUN_00a3df90(undefined4 param_1,undefined4 param_2) { epoxy_glIsImageHandleResidentARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIsImageHandleResidentARB)(param_1,param_2); return; } //@@ 00a3dfc0 FUN_00a3dfc0 void FUN_00a3dfc0(undefined4 param_1,undefined4 param_2) { epoxy_glIsImageHandleResidentNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIsImageHandleResidentNV)(param_1,param_2); return; } //@@ 00a3dff0 FUN_00a3dff0 void FUN_00a3dff0(void) { epoxy_glIsList = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e008. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsList)(); return; } //@@ 00a3e010 FUN_00a3e010 void FUN_00a3e010(void) { epoxy_glIsNameAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e028. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsNameAMD)(); return; } //@@ 00a3e030 FUN_00a3e030 void FUN_00a3e030(void) { epoxy_glIsNamedBufferResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsNamedBufferResidentNV)(); return; } //@@ 00a3e050 FUN_00a3e050 void FUN_00a3e050(void) { epoxy_glIsNamedStringARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e068. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsNamedStringARB)(); return; } //@@ 00a3e070 FUN_00a3e070 void FUN_00a3e070(void) { epoxy_glIsObjectBufferATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e088. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsObjectBufferATI)(); return; } //@@ 00a3e090 FUN_00a3e090 void FUN_00a3e090(void) { epoxy_glIsOcclusionQueryNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e0a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsOcclusionQueryNV)(); return; } //@@ 00a3e0b0 FUN_00a3e0b0 void FUN_00a3e0b0(void) { epoxy_glIsPathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e0c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsPathNV)(); return; } //@@ 00a3e0d0 FUN_00a3e0d0 void FUN_00a3e0d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glIsPointInFillPathNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIsPointInFillPathNV)(param_1,param_2,param_3,param_4); return; } //@@ 00a3e110 FUN_00a3e110 void FUN_00a3e110(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glIsPointInStrokePathNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIsPointInStrokePathNV)(param_1,param_2,param_3); return; } //@@ 00a3e150 FUN_00a3e150 void FUN_00a3e150(void) { epoxy_glIsProgram = (undefined *)FUN_00a2ca10(&DAT_00b26b24); /* WARNING: Could not recover jumptable at 0x00a3e170. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsProgram)(); return; } //@@ 00a3e180 FUN_00a3e180 void FUN_00a3e180(void) { epoxy_glIsProgramARB = (undefined *)FUN_00a2ca10("+r+r:r"); /* WARNING: Could not recover jumptable at 0x00a3e1a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsProgramARB)(); return; } //@@ 00a3e1b0 FUN_00a3e1b0 void FUN_00a3e1b0(void) { epoxy_glIsProgramNV = (undefined *)FUN_00a2ca10(":r+r+r"); /* WARNING: Could not recover jumptable at 0x00a3e1d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsProgramNV)(); return; } //@@ 00a3e1e0 FUN_00a3e1e0 void FUN_00a3e1e0(void) { epoxy_glIsProgramPipeline = (undefined *)FUN_00a2ca10("HrHrHr"); /* WARNING: Could not recover jumptable at 0x00a3e200. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsProgramPipeline)(); return; } //@@ 00a3e210 FUN_00a3e210 void FUN_00a3e210(void) { epoxy_glIsProgramPipelineEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e228. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsProgramPipelineEXT)(); return; } //@@ 00a3e230 FUN_00a3e230 void FUN_00a3e230(void) { epoxy_glIsQuery = (undefined *)FUN_00a2ca10("srsr}r"); /* WARNING: Could not recover jumptable at 0x00a3e250. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsQuery)(); return; } //@@ 00a3e260 FUN_00a3e260 void FUN_00a3e260(void) { epoxy_glIsQueryARB = (undefined *)FUN_00a2ca10("}rsrsr"); /* WARNING: Could not recover jumptable at 0x00a3e280. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsQueryARB)(); return; } //@@ 00a3e290 FUN_00a3e290 void FUN_00a3e290(void) { epoxy_glIsQueryEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d064); /* WARNING: Could not recover jumptable at 0x00a3e2b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsQueryEXT)(); return; } //@@ 00a3e2c0 FUN_00a3e2c0 void FUN_00a3e2c0(void) { epoxy_glIsRenderbuffer = (undefined *)FUN_00a2ca10(&DAT_00b3d5f0); /* WARNING: Could not recover jumptable at 0x00a3e2e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsRenderbuffer)(); return; } //@@ 00a3e2f0 FUN_00a3e2f0 void FUN_00a3e2f0(void) { epoxy_glIsRenderbufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b29914); /* WARNING: Could not recover jumptable at 0x00a3e310. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsRenderbufferEXT)(); return; } //@@ 00a3e320 FUN_00a3e320 void FUN_00a3e320(void) { epoxy_glIsRenderbufferOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e338. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsRenderbufferOES)(); return; } //@@ 00a3e340 FUN_00a3e340 void FUN_00a3e340(void) { epoxy_glIsSampler = (undefined *)FUN_00a2ca10(&DAT_00b3d7c4); /* WARNING: Could not recover jumptable at 0x00a3e360. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsSampler)(); return; } //@@ 00a3e370 FUN_00a3e370 void FUN_00a3e370(void) { epoxy_glIsShader = (undefined *)FUN_00a2ca10(&DAT_00b2a9bc); /* WARNING: Could not recover jumptable at 0x00a3e390. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsShader)(); return; } //@@ 00a3e3a0 FUN_00a3e3a0 void FUN_00a3e3a0(void) { epoxy_glIsStateNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e3b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsStateNV)(); return; } //@@ 00a3e3c0 FUN_00a3e3c0 void FUN_00a3e3c0(void) { epoxy_glIsSync = (undefined *)FUN_00a2ca10(&DAT_00b295c0); /* WARNING: Could not recover jumptable at 0x00a3e3e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsSync)(); return; } //@@ 00a3e3f0 FUN_00a3e3f0 void FUN_00a3e3f0(void) { epoxy_glIsSyncAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b281a4); /* WARNING: Could not recover jumptable at 0x00a3e410. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsSyncAPPLE)(); return; } //@@ 00a3e420 FUN_00a3e420 void FUN_00a3e420(void) { epoxy_glIsTexture = (undefined *)FUN_00a2ca10("\ns\ns\ns"); /* WARNING: Could not recover jumptable at 0x00a3e440. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsTexture)(); return; } //@@ 00a3e450 FUN_00a3e450 void FUN_00a3e450(void) { epoxy_glIsTextureEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsTextureEXT)(); return; } //@@ 00a3e470 FUN_00a3e470 void FUN_00a3e470(undefined4 param_1,undefined4 param_2) { epoxy_glIsTextureHandleResidentARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIsTextureHandleResidentARB)(param_1,param_2); return; } //@@ 00a3e4a0 FUN_00a3e4a0 void FUN_00a3e4a0(undefined4 param_1,undefined4 param_2) { epoxy_glIsTextureHandleResidentNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glIsTextureHandleResidentNV)(param_1,param_2); return; } //@@ 00a3e4d0 FUN_00a3e4d0 void FUN_00a3e4d0(void) { epoxy_glIsTransformFeedback = (undefined *)FUN_00a2ca10(&DAT_00b2820c); /* WARNING: Could not recover jumptable at 0x00a3e4f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsTransformFeedback)(); return; } //@@ 00a3e500 FUN_00a3e500 void FUN_00a3e500(void) { epoxy_glIsTransformFeedbackNV = (undefined *)FUN_00a2ca10(&DAT_00b27fbc); /* WARNING: Could not recover jumptable at 0x00a3e520. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsTransformFeedbackNV)(); return; } //@@ 00a3e530 FUN_00a3e530 void FUN_00a3e530(void) { epoxy_glIsVariantEnabledEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e548. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsVariantEnabledEXT)(); return; } //@@ 00a3e550 FUN_00a3e550 void FUN_00a3e550(void) { epoxy_glIsVertexArray = (undefined *)FUN_00a2ca10(&DAT_00b3d330); /* WARNING: Could not recover jumptable at 0x00a3e570. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsVertexArray)(); return; } //@@ 00a3e580 FUN_00a3e580 void FUN_00a3e580(void) { epoxy_glIsVertexArrayAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b279b4); /* WARNING: Could not recover jumptable at 0x00a3e5a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsVertexArrayAPPLE)(); return; } //@@ 00a3e5b0 FUN_00a3e5b0 void FUN_00a3e5b0(void) { epoxy_glIsVertexArrayOES = (undefined *)FUN_00a2ca10(&DAT_00b2546c); /* WARNING: Could not recover jumptable at 0x00a3e5d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsVertexArrayOES)(); return; } //@@ 00a3e5e0 FUN_00a3e5e0 void FUN_00a3e5e0(void) { epoxy_glIsVertexAttribEnabledAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e5f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glIsVertexAttribEnabledAPPLE)(); return; } //@@ 00a3e600 FUN_00a3e600 void FUN_00a3e600(void) { epoxy_glLabelObjectEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLabelObjectEXT)(); return; } //@@ 00a3e620 FUN_00a3e620 void FUN_00a3e620(void) { epoxy_glLightEnviSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e638. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightEnviSGIX)(); return; } //@@ 00a3e640 FUN_00a3e640 void FUN_00a3e640(undefined4 param_1,undefined4 param_2) { epoxy_glLightModelf = (undefined *)FUN_00a2ca10(&DAT_00b293a4); (*(code *)epoxy_glLightModelf)(param_1,param_2); return; } //@@ 00a3e670 FUN_00a3e670 void FUN_00a3e670(void) { epoxy_glLightModelfv = (undefined *)FUN_00a2ca10(&DAT_00b2681c); /* WARNING: Could not recover jumptable at 0x00a3e690. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModelfv)(); return; } //@@ 00a3e6a0 FUN_00a3e6a0 void FUN_00a3e6a0(void) { epoxy_glLightModeli = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e6b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModeli)(); return; } //@@ 00a3e6c0 FUN_00a3e6c0 void FUN_00a3e6c0(void) { epoxy_glLightModeliv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e6d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModeliv)(); return; } //@@ 00a3e6e0 FUN_00a3e6e0 void FUN_00a3e6e0(void) { epoxy_glLightModelx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e6f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModelx)(); return; } //@@ 00a3e700 FUN_00a3e700 void FUN_00a3e700(void) { epoxy_glLightModelxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e718. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModelxOES)(); return; } //@@ 00a3e720 FUN_00a3e720 void FUN_00a3e720(void) { epoxy_glLightModelxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e738. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModelxv)(); return; } //@@ 00a3e740 FUN_00a3e740 void FUN_00a3e740(void) { epoxy_glLightModelxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightModelxvOES)(); return; } //@@ 00a3e760 FUN_00a3e760 void FUN_00a3e760(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glLightf = (undefined *)FUN_00a2ca10(&DAT_00b26d34); (*(code *)epoxy_glLightf)(param_1,param_2,param_3); return; } //@@ 00a3e7a0 FUN_00a3e7a0 void FUN_00a3e7a0(void) { epoxy_glLightfv = (undefined *)FUN_00a2ca10(&DAT_00b29634); /* WARNING: Could not recover jumptable at 0x00a3e7c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightfv)(); return; } //@@ 00a3e7d0 FUN_00a3e7d0 void FUN_00a3e7d0(void) { epoxy_glLighti = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e7e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLighti)(); return; } //@@ 00a3e7f0 FUN_00a3e7f0 void FUN_00a3e7f0(void) { epoxy_glLightiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e808. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightiv)(); return; } //@@ 00a3e810 FUN_00a3e810 void FUN_00a3e810(void) { epoxy_glLightx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e828. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightx)(); return; } //@@ 00a3e830 FUN_00a3e830 void FUN_00a3e830(void) { epoxy_glLightxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e848. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightxOES)(); return; } //@@ 00a3e850 FUN_00a3e850 void FUN_00a3e850(void) { epoxy_glLightxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightxv)(); return; } //@@ 00a3e870 FUN_00a3e870 void FUN_00a3e870(void) { epoxy_glLightxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLightxvOES)(); return; } //@@ 00a3e890 FUN_00a3e890 void FUN_00a3e890(void) { epoxy_glLineStipple = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e8a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLineStipple)(); return; } //@@ 00a3e8b0 FUN_00a3e8b0 void FUN_00a3e8b0(undefined4 param_1) { epoxy_glLineWidth = (undefined *)FUN_00a2ca10(&DAT_00b27698); (*(code *)epoxy_glLineWidth)(param_1); return; } //@@ 00a3e8e0 FUN_00a3e8e0 void FUN_00a3e8e0(void) { epoxy_glLineWidthx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e8f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLineWidthx)(); return; } //@@ 00a3e900 FUN_00a3e900 void FUN_00a3e900(void) { epoxy_glLineWidthxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e918. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLineWidthxOES)(); return; } //@@ 00a3e920 FUN_00a3e920 void FUN_00a3e920(void) { epoxy_glLinkProgram = (undefined *)FUN_00a2ca10(&DAT_00b3c4b4); /* WARNING: Could not recover jumptable at 0x00a3e940. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLinkProgram)(); return; } //@@ 00a3e950 FUN_00a3e950 void FUN_00a3e950(void) { epoxy_glLinkProgramARB = (undefined *)FUN_00a2ca10(&DAT_00b26c64); /* WARNING: Could not recover jumptable at 0x00a3e970. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLinkProgramARB)(); return; } //@@ 00a3e980 FUN_00a3e980 void FUN_00a3e980(void) { epoxy_glListBase = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e998. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glListBase)(); return; } //@@ 00a3e9a0 FUN_00a3e9a0 void FUN_00a3e9a0(void) { epoxy_glListDrawCommandsStatesClientNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3e9b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glListDrawCommandsStatesClientNV)(); return; } //@@ 00a3e9c0 FUN_00a3e9c0 void FUN_00a3e9c0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glListParameterfSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glListParameterfSGIX)(param_1,param_2,param_3); return; } //@@ 00a3e9f0 FUN_00a3e9f0 void FUN_00a3e9f0(void) { epoxy_glListParameterfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ea08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glListParameterfvSGIX)(); return; } //@@ 00a3ea10 FUN_00a3ea10 void FUN_00a3ea10(void) { epoxy_glListParameteriSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ea28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glListParameteriSGIX)(); return; } //@@ 00a3ea30 FUN_00a3ea30 void FUN_00a3ea30(void) { epoxy_glListParameterivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ea48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glListParameterivSGIX)(); return; } //@@ 00a3ea70 FUN_00a3ea70 void FUN_00a3ea70(void) { epoxy_glLoadIdentityDeformationMapSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ea88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadIdentityDeformationMapSGIX)(); return; } //@@ 00a3ea90 FUN_00a3ea90 void FUN_00a3ea90(void) { epoxy_glLoadMatrixd = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3eaa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadMatrixd)(); return; } //@@ 00a3eab0 FUN_00a3eab0 void FUN_00a3eab0(void) { epoxy_glLoadMatrixf = (undefined *)FUN_00a2ca10(&DAT_00b28c68); /* WARNING: Could not recover jumptable at 0x00a3ead0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadMatrixf)(); return; } //@@ 00a3eae0 FUN_00a3eae0 void FUN_00a3eae0(void) { epoxy_glLoadMatrixx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3eaf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadMatrixx)(); return; } //@@ 00a3eb00 FUN_00a3eb00 void FUN_00a3eb00(void) { epoxy_glLoadMatrixxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3eb18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadMatrixxOES)(); return; } //@@ 00a3eb20 FUN_00a3eb20 void FUN_00a3eb20(void) { epoxy_glLoadName = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3eb38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadName)(); return; } //@@ 00a3eb60 FUN_00a3eb60 void FUN_00a3eb60(void) { epoxy_glLoadProgramNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3eb78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadProgramNV)(); return; } //@@ 00a3eb80 FUN_00a3eb80 void FUN_00a3eb80(void) { epoxy_glLoadTransposeMatrixd = (undefined *)FUN_00a2ca10(&DAT_00b258b0); /* WARNING: Could not recover jumptable at 0x00a3eba0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadTransposeMatrixd)(); return; } //@@ 00a3ebb0 FUN_00a3ebb0 void FUN_00a3ebb0(void) { epoxy_glLoadTransposeMatrixdARB = (undefined *)FUN_00a2ca10(&DAT_00b2a8a4); /* WARNING: Could not recover jumptable at 0x00a3ebd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadTransposeMatrixdARB)(); return; } //@@ 00a3ebe0 FUN_00a3ebe0 void FUN_00a3ebe0(void) { epoxy_glLoadTransposeMatrixf = (undefined *)FUN_00a2ca10(&DAT_00b25f54); /* WARNING: Could not recover jumptable at 0x00a3ec00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadTransposeMatrixf)(); return; } //@@ 00a3ec10 FUN_00a3ec10 void FUN_00a3ec10(void) { epoxy_glLoadTransposeMatrixfARB = (undefined *)FUN_00a2ca10(&DAT_00b3caa4); /* WARNING: Could not recover jumptable at 0x00a3ec30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadTransposeMatrixfARB)(); return; } //@@ 00a3ec40 FUN_00a3ec40 void FUN_00a3ec40(void) { epoxy_glLoadTransposeMatrixxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ec58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLoadTransposeMatrixxOES)(); return; } //@@ 00a3ec60 FUN_00a3ec60 void FUN_00a3ec60(void) { epoxy_glLockArraysEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ec78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLockArraysEXT)(); return; } //@@ 00a3ec80 FUN_00a3ec80 void FUN_00a3ec80(void) { epoxy_glLogicOp = (undefined *)FUN_00a2ca10(&DAT_00b3ba68); /* WARNING: Could not recover jumptable at 0x00a3eca0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glLogicOp)(); return; } //@@ 00a3ecb0 FUN_00a3ecb0 void FUN_00a3ecb0(void) { epoxy_glMakeBufferNonResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ecc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMakeBufferNonResidentNV)(); return; } //@@ 00a3ecd0 FUN_00a3ecd0 void FUN_00a3ecd0(void) { epoxy_glMakeBufferResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ece8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMakeBufferResidentNV)(); return; } //@@ 00a3ecf0 FUN_00a3ecf0 void FUN_00a3ecf0(undefined4 param_1,undefined4 param_2) { epoxy_glMakeImageHandleNonResidentARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeImageHandleNonResidentARB)(param_1,param_2); return; } //@@ 00a3ed20 FUN_00a3ed20 void FUN_00a3ed20(undefined4 param_1,undefined4 param_2) { epoxy_glMakeImageHandleNonResidentNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeImageHandleNonResidentNV)(param_1,param_2); return; } //@@ 00a3ed50 FUN_00a3ed50 void FUN_00a3ed50(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glMakeImageHandleResidentARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeImageHandleResidentARB)(param_1,param_2,param_3); return; } //@@ 00a3ed80 FUN_00a3ed80 void FUN_00a3ed80(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glMakeImageHandleResidentNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeImageHandleResidentNV)(param_1,param_2,param_3); return; } //@@ 00a3edb0 FUN_00a3edb0 void FUN_00a3edb0(void) { epoxy_glMakeNamedBufferNonResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3edc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMakeNamedBufferNonResidentNV)(); return; } //@@ 00a3edd0 FUN_00a3edd0 void FUN_00a3edd0(void) { epoxy_glMakeNamedBufferResidentNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ede8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMakeNamedBufferResidentNV)(); return; } //@@ 00a3edf0 FUN_00a3edf0 void FUN_00a3edf0(undefined4 param_1,undefined4 param_2) { epoxy_glMakeTextureHandleNonResidentARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeTextureHandleNonResidentARB)(param_1,param_2); return; } //@@ 00a3ee20 FUN_00a3ee20 void FUN_00a3ee20(undefined4 param_1,undefined4 param_2) { epoxy_glMakeTextureHandleNonResidentNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeTextureHandleNonResidentNV)(param_1,param_2); return; } //@@ 00a3ee50 FUN_00a3ee50 void FUN_00a3ee50(undefined4 param_1,undefined4 param_2) { epoxy_glMakeTextureHandleResidentARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeTextureHandleResidentARB)(param_1,param_2); return; } //@@ 00a3ee80 FUN_00a3ee80 void FUN_00a3ee80(undefined4 param_1,undefined4 param_2) { epoxy_glMakeTextureHandleResidentNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMakeTextureHandleResidentNV)(param_1,param_2); return; } //@@ 00a3eeb0 FUN_00a3eeb0 void FUN_00a3eeb0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glMap1d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMap1d)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a3ef00 FUN_00a3ef00 void FUN_00a3ef00(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glMap1f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMap1f)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a3ef50 FUN_00a3ef50 void FUN_00a3ef50(void) { epoxy_glMap1xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ef68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMap1xOES)(); return; } //@@ 00a3ef70 FUN_00a3ef70 void FUN_00a3ef70(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4, undefined4 param_5,undefined8 param_6,undefined8 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_glMap2d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMap2d) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a3eff0 FUN_00a3eff0 void FUN_00a3eff0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_glMap2f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMap2f) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a3f050 FUN_00a3f050 void FUN_00a3f050(void) { epoxy_glMap2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f068. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMap2xOES)(); return; } //@@ 00a3f070 FUN_00a3f070 void FUN_00a3f070(void) { epoxy_glMapBuffer = (undefined *)FUN_00a2ca10(&DAT_00b2a0b0); /* WARNING: Could not recover jumptable at 0x00a3f090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapBuffer)(); return; } //@@ 00a3f0a0 FUN_00a3f0a0 void FUN_00a3f0a0(void) { epoxy_glMapBufferARB = (undefined *)FUN_00a2ca10(&DAT_00b3cb80); /* WARNING: Could not recover jumptable at 0x00a3f0c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapBufferARB)(); return; } //@@ 00a3f0d0 FUN_00a3f0d0 void FUN_00a3f0d0(void) { epoxy_glMapBufferOES = (undefined *)FUN_00a2ca10(&DAT_00b25768); /* WARNING: Could not recover jumptable at 0x00a3f0f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapBufferOES)(); return; } //@@ 00a3f100 FUN_00a3f100 void FUN_00a3f100(void) { epoxy_glMapBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b28eec); /* WARNING: Could not recover jumptable at 0x00a3f120. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapBufferRange)(); return; } //@@ 00a3f130 FUN_00a3f130 void FUN_00a3f130(void) { epoxy_glMapBufferRangeEXT = (undefined *)FUN_00a2ca10(&DAT_00b3bcd4); /* WARNING: Could not recover jumptable at 0x00a3f150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapBufferRangeEXT)(); return; } //@@ 00a3f160 FUN_00a3f160 void FUN_00a3f160(void) { epoxy_glMapControlPointsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f178. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapControlPointsNV)(); return; } //@@ 00a3f180 FUN_00a3f180 void FUN_00a3f180(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glMapGrid1d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapGrid1d)(param_1,param_2,param_3); return; } //@@ 00a3f1c0 FUN_00a3f1c0 void FUN_00a3f1c0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glMapGrid1f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapGrid1f)(param_1,param_2,param_3); return; } //@@ 00a3f200 FUN_00a3f200 void FUN_00a3f200(void) { epoxy_glMapGrid1xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f218. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapGrid1xOES)(); return; } //@@ 00a3f220 FUN_00a3f220 void FUN_00a3f220(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glMapGrid2d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapGrid2d)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a3f280 FUN_00a3f280 void FUN_00a3f280(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glMapGrid2f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapGrid2f)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a3f2e0 FUN_00a3f2e0 void FUN_00a3f2e0(void) { epoxy_glMapGrid2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f2f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapGrid2xOES)(); return; } //@@ 00a3f300 FUN_00a3f300 void FUN_00a3f300(void) { epoxy_glMapNamedBuffer = (undefined *)FUN_00a2ca10(&DAT_00b3b078); /* WARNING: Could not recover jumptable at 0x00a3f320. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapNamedBuffer)(); return; } //@@ 00a3f330 FUN_00a3f330 void FUN_00a3f330(void) { epoxy_glMapNamedBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapNamedBufferEXT)(); return; } //@@ 00a3f350 FUN_00a3f350 void FUN_00a3f350(void) { epoxy_glMapNamedBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b2b174); /* WARNING: Could not recover jumptable at 0x00a3f370. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapNamedBufferRange)(); return; } //@@ 00a3f380 FUN_00a3f380 void FUN_00a3f380(void) { epoxy_glMapNamedBufferRangeEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapNamedBufferRangeEXT)(); return; } //@@ 00a3f3a0 FUN_00a3f3a0 void FUN_00a3f3a0(void) { epoxy_glMapObjectBufferATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f3b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapObjectBufferATI)(); return; } //@@ 00a3f3c0 FUN_00a3f3c0 void FUN_00a3f3c0(void) { epoxy_glMapParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f3d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapParameterfvNV)(); return; } //@@ 00a3f3e0 FUN_00a3f3e0 void FUN_00a3f3e0(void) { epoxy_glMapParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f3f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapParameterivNV)(); return; } //@@ 00a3f400 FUN_00a3f400 void FUN_00a3f400(void) { epoxy_glMapTexture2DINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMapTexture2DINTEL)(); return; } //@@ 00a3f420 FUN_00a3f420 void FUN_00a3f420(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glMapVertexAttrib1dAPPLE = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapVertexAttrib1dAPPLE)(param_1,param_2,param_3,param_4,param_5,param_6,param_7) ; return; } //@@ 00a3f470 FUN_00a3f470 void FUN_00a3f470(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glMapVertexAttrib1fAPPLE = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapVertexAttrib1fAPPLE)(param_1,param_2,param_3,param_4,param_5,param_6,param_7) ; return; } //@@ 00a3f4c0 FUN_00a3f4c0 void FUN_00a3f4c0(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined4 param_5,undefined4 param_6,undefined8 param_7,undefined8 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11) { epoxy_glMapVertexAttrib2dAPPLE = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapVertexAttrib2dAPPLE) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11); return; } //@@ 00a3f530 FUN_00a3f530 void FUN_00a3f530(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11) { epoxy_glMapVertexAttrib2fAPPLE = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMapVertexAttrib2fAPPLE) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11); return; } //@@ 00a3f5a0 FUN_00a3f5a0 void FUN_00a3f5a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glMaterialf = (undefined *)FUN_00a2ca10(&DAT_00b276d4); (*(code *)epoxy_glMaterialf)(param_1,param_2,param_3); return; } //@@ 00a3f5e0 FUN_00a3f5e0 void FUN_00a3f5e0(void) { epoxy_glMaterialfv = (undefined *)FUN_00a2ca10(&DAT_00b25cf8); /* WARNING: Could not recover jumptable at 0x00a3f600. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMaterialfv)(); return; } //@@ 00a3f610 FUN_00a3f610 void FUN_00a3f610(void) { epoxy_glMateriali = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMateriali)(); return; } //@@ 00a3f630 FUN_00a3f630 void FUN_00a3f630(void) { epoxy_glMaterialiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f648. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMaterialiv)(); return; } //@@ 00a3f650 FUN_00a3f650 void FUN_00a3f650(void) { epoxy_glMaterialx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f668. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMaterialx)(); return; } //@@ 00a3f670 FUN_00a3f670 void FUN_00a3f670(void) { epoxy_glMaterialxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f688. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMaterialxOES)(); return; } //@@ 00a3f690 FUN_00a3f690 void FUN_00a3f690(void) { epoxy_glMaterialxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f6a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMaterialxv)(); return; } //@@ 00a3f6b0 FUN_00a3f6b0 void FUN_00a3f6b0(void) { epoxy_glMaterialxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f6c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMaterialxvOES)(); return; } //@@ 00a3f6d0 FUN_00a3f6d0 void FUN_00a3f6d0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6,undefined8 param_7) { epoxy_glMatrixFrustumEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixFrustumEXT)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a3f740 FUN_00a3f740 void FUN_00a3f740(void) { epoxy_glMatrixIndexPointerARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixIndexPointerARB)(); return; } //@@ 00a3f760 FUN_00a3f760 void FUN_00a3f760(void) { epoxy_glMatrixIndexPointerOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f778. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixIndexPointerOES)(); return; } //@@ 00a3f780 FUN_00a3f780 void FUN_00a3f780(void) { epoxy_glMatrixIndexubvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f798. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixIndexubvARB)(); return; } //@@ 00a3f7a0 FUN_00a3f7a0 void FUN_00a3f7a0(void) { epoxy_glMatrixIndexuivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f7b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixIndexuivARB)(); return; } //@@ 00a3f7c0 FUN_00a3f7c0 void FUN_00a3f7c0(void) { epoxy_glMatrixIndexusvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f7d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixIndexusvARB)(); return; } //@@ 00a3f7e0 FUN_00a3f7e0 void FUN_00a3f7e0(void) { epoxy_glMatrixLoad3x2fNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f7f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoad3x2fNV)(); return; } //@@ 00a3f800 FUN_00a3f800 void FUN_00a3f800(void) { epoxy_glMatrixLoad3x3fNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoad3x3fNV)(); return; } //@@ 00a3f820 FUN_00a3f820 void FUN_00a3f820(void) { epoxy_glMatrixLoadIdentityEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f838. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoadIdentityEXT)(); return; } //@@ 00a3f840 FUN_00a3f840 void FUN_00a3f840(void) { epoxy_glMatrixLoadTranspose3x3fNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f858. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoadTranspose3x3fNV)(); return; } //@@ 00a3f860 FUN_00a3f860 void FUN_00a3f860(void) { epoxy_glMatrixLoadTransposedEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f878. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoadTransposedEXT)(); return; } //@@ 00a3f880 FUN_00a3f880 void FUN_00a3f880(void) { epoxy_glMatrixLoadTransposefEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f898. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoadTransposefEXT)(); return; } //@@ 00a3f8a0 FUN_00a3f8a0 void FUN_00a3f8a0(void) { epoxy_glMatrixLoaddEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f8b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoaddEXT)(); return; } //@@ 00a3f8c0 FUN_00a3f8c0 void FUN_00a3f8c0(void) { epoxy_glMatrixLoadfEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f8d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixLoadfEXT)(); return; } //@@ 00a3f8e0 FUN_00a3f8e0 void FUN_00a3f8e0(void) { epoxy_glMatrixMode = (undefined *)FUN_00a2ca10(&DAT_00b2b1c4); /* WARNING: Could not recover jumptable at 0x00a3f900. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMode)(); return; } //@@ 00a3f910 FUN_00a3f910 void FUN_00a3f910(void) { epoxy_glMatrixMult3x2fNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f928. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMult3x2fNV)(); return; } //@@ 00a3f930 FUN_00a3f930 void FUN_00a3f930(void) { epoxy_glMatrixMult3x3fNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f948. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMult3x3fNV)(); return; } //@@ 00a3f950 FUN_00a3f950 void FUN_00a3f950(void) { epoxy_glMatrixMultTranspose3x3fNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f968. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMultTranspose3x3fNV)(); return; } //@@ 00a3f970 FUN_00a3f970 void FUN_00a3f970(void) { epoxy_glMatrixMultTransposedEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f988. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMultTransposedEXT)(); return; } //@@ 00a3f990 FUN_00a3f990 void FUN_00a3f990(void) { epoxy_glMatrixMultTransposefEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f9a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMultTransposefEXT)(); return; } //@@ 00a3f9b0 FUN_00a3f9b0 void FUN_00a3f9b0(void) { epoxy_glMatrixMultdEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f9c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMultdEXT)(); return; } //@@ 00a3f9d0 FUN_00a3f9d0 void FUN_00a3f9d0(void) { epoxy_glMatrixMultfEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3f9e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixMultfEXT)(); return; } //@@ 00a3f9f0 FUN_00a3f9f0 void FUN_00a3f9f0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6,undefined8 param_7) { epoxy_glMatrixOrthoEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixOrthoEXT)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a3fa60 FUN_00a3fa60 void FUN_00a3fa60(void) { epoxy_glMatrixPopEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3fa78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixPopEXT)(); return; } //@@ 00a3fa80 FUN_00a3fa80 void FUN_00a3fa80(void) { epoxy_glMatrixPushEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3fa98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMatrixPushEXT)(); return; } //@@ 00a3faa0 FUN_00a3faa0 void FUN_00a3faa0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glMatrixRotatedEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixRotatedEXT)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a3fb00 FUN_00a3fb00 void FUN_00a3fb00(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glMatrixRotatefEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixRotatefEXT)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a3fb50 FUN_00a3fb50 void FUN_00a3fb50(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glMatrixScaledEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixScaledEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a3fba0 FUN_00a3fba0 void FUN_00a3fba0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMatrixScalefEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixScalefEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a3fbf0 FUN_00a3fbf0 void FUN_00a3fbf0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glMatrixTranslatedEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixTranslatedEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a3fc40 FUN_00a3fc40 void FUN_00a3fc40(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMatrixTranslatefEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMatrixTranslatefEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a3fc90 FUN_00a3fc90 void FUN_00a3fc90(void) { epoxy_glMemoryBarrier = (undefined *)FUN_00a2ca10("3}3}3}[}"); /* WARNING: Could not recover jumptable at 0x00a3fcb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMemoryBarrier)(); return; } //@@ 00a3fcc0 FUN_00a3fcc0 void FUN_00a3fcc0(void) { epoxy_glMemoryBarrierByRegion = (undefined *)FUN_00a2ca10("C}C}C}"); /* WARNING: Could not recover jumptable at 0x00a3fce0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMemoryBarrierByRegion)(); return; } //@@ 00a3fcf0 FUN_00a3fcf0 void FUN_00a3fcf0(void) { epoxy_glMemoryBarrierEXT = (undefined *)FUN_00a2ca10(&DAT_00b2aa0c); /* WARNING: Could not recover jumptable at 0x00a3fd10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMemoryBarrierEXT)(); return; } //@@ 00a3fd20 FUN_00a3fd20 void FUN_00a3fd20(undefined4 param_1) { epoxy_glMinSampleShading = (undefined *)FUN_00a2ca10(&DAT_00b2a418); (*(code *)epoxy_glMinSampleShading)(param_1); return; } //@@ 00a3fd50 FUN_00a3fd50 void FUN_00a3fd50(undefined4 param_1) { epoxy_glMinSampleShadingARB = (undefined *)FUN_00a2ca10(&DAT_00b26548); (*(code *)epoxy_glMinSampleShadingARB)(param_1); return; } //@@ 00a3fd80 FUN_00a3fd80 void FUN_00a3fd80(undefined4 param_1) { epoxy_glMinSampleShadingOES = (undefined *)FUN_00a2ca10(&DAT_00b29acc); (*(code *)epoxy_glMinSampleShadingOES)(param_1); return; } //@@ 00a3fdb0 FUN_00a3fdb0 void FUN_00a3fdb0(void) { epoxy_glMinmax = (undefined *)FUN_00a2ca10(&DAT_00b3bd98); /* WARNING: Could not recover jumptable at 0x00a3fdd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMinmax)(); return; } //@@ 00a3fde0 FUN_00a3fde0 void FUN_00a3fde0(void) { epoxy_glMinmaxEXT = (undefined *)FUN_00a2ca10(&DAT_00b291d8); /* WARNING: Could not recover jumptable at 0x00a3fe00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMinmaxEXT)(); return; } //@@ 00a3fe10 FUN_00a3fe10 void FUN_00a3fe10(void) { epoxy_glMultMatrixd = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3fe28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultMatrixd)(); return; } //@@ 00a3fe30 FUN_00a3fe30 void FUN_00a3fe30(void) { epoxy_glMultMatrixf = (undefined *)FUN_00a2ca10(&DAT_00b27784); /* WARNING: Could not recover jumptable at 0x00a3fe50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultMatrixf)(); return; } //@@ 00a3fe60 FUN_00a3fe60 void FUN_00a3fe60(void) { epoxy_glMultMatrixx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3fe78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultMatrixx)(); return; } //@@ 00a3fe80 FUN_00a3fe80 void FUN_00a3fe80(void) { epoxy_glMultMatrixxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3fe98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultMatrixxOES)(); return; } //@@ 00a3fea0 FUN_00a3fea0 void FUN_00a3fea0(void) { epoxy_glMultTransposeMatrixd = (undefined *)FUN_00a2ca10(&DAT_00b2a364); /* WARNING: Could not recover jumptable at 0x00a3fec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultTransposeMatrixd)(); return; } //@@ 00a3fed0 FUN_00a3fed0 void FUN_00a3fed0(void) { epoxy_glMultTransposeMatrixdARB = (undefined *)FUN_00a2ca10(&DAT_00b28208); /* WARNING: Could not recover jumptable at 0x00a3fef0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultTransposeMatrixdARB)(); return; } //@@ 00a3ff00 FUN_00a3ff00 void FUN_00a3ff00(void) { epoxy_glMultTransposeMatrixf = (undefined *)FUN_00a2ca10(&DAT_00b3b7e0); /* WARNING: Could not recover jumptable at 0x00a3ff20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultTransposeMatrixf)(); return; } //@@ 00a3ff30 FUN_00a3ff30 void FUN_00a3ff30(void) { epoxy_glMultTransposeMatrixfARB = (undefined *)FUN_00a2ca10(&DAT_00b3d784); /* WARNING: Could not recover jumptable at 0x00a3ff50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultTransposeMatrixfARB)(); return; } //@@ 00a3ff60 FUN_00a3ff60 void FUN_00a3ff60(void) { epoxy_glMultTransposeMatrixxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a3ff78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultTransposeMatrixxOES)(); return; } //@@ 00a3ff80 FUN_00a3ff80 void FUN_00a3ff80(void) { epoxy_glMultiDrawArrays = (undefined *)FUN_00a2ca10(&DAT_00b25a38); /* WARNING: Could not recover jumptable at 0x00a3ffa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArrays)(); return; } //@@ 00a3ffb0 FUN_00a3ffb0 void FUN_00a3ffb0(void) { epoxy_glMultiDrawArraysEXT = (undefined *)FUN_00a2ca10(&DAT_00b273f4); /* WARNING: Could not recover jumptable at 0x00a3ffd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysEXT)(); return; } //@@ 00a3ffe0 FUN_00a3ffe0 void FUN_00a3ffe0(void) { epoxy_glMultiDrawArraysIndirect = (undefined *)FUN_00a2ca10(&DAT_00b287e8); /* WARNING: Could not recover jumptable at 0x00a40000. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysIndirect)(); return; } //@@ 00a40010 FUN_00a40010 void FUN_00a40010(void) { epoxy_glMultiDrawArraysIndirectAMD = (undefined *)FUN_00a2ca10(&DAT_00b3b59c); /* WARNING: Could not recover jumptable at 0x00a40030. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysIndirectAMD)(); return; } //@@ 00a40040 FUN_00a40040 void FUN_00a40040(void) { epoxy_glMultiDrawArraysIndirectBindlessCountNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40058. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysIndirectBindlessCountNV)(); return; } //@@ 00a40060 FUN_00a40060 void FUN_00a40060(void) { epoxy_glMultiDrawArraysIndirectBindlessNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40078. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysIndirectBindlessNV)(); return; } //@@ 00a40080 FUN_00a40080 void FUN_00a40080(void) { epoxy_glMultiDrawArraysIndirectCountARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40098. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysIndirectCountARB)(); return; } //@@ 00a400a0 FUN_00a400a0 void FUN_00a400a0(void) { epoxy_glMultiDrawArraysIndirectEXT = (undefined *)FUN_00a2ca10(&DAT_00b25198); /* WARNING: Could not recover jumptable at 0x00a400c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawArraysIndirectEXT)(); return; } //@@ 00a400d0 FUN_00a400d0 void FUN_00a400d0(void) { epoxy_glMultiDrawElementArrayAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a400e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementArrayAPPLE)(); return; } //@@ 00a400f0 FUN_00a400f0 void FUN_00a400f0(void) { epoxy_glMultiDrawElements = (undefined *)FUN_00a2ca10(&DAT_00b26938); /* WARNING: Could not recover jumptable at 0x00a40110. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElements)(); return; } //@@ 00a40120 FUN_00a40120 void FUN_00a40120(void) { epoxy_glMultiDrawElementsBaseVertex = (undefined *)FUN_00a2ca10(&DAT_00b294f4); /* WARNING: Could not recover jumptable at 0x00a40140. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsBaseVertex)(); return; } //@@ 00a40150 FUN_00a40150 void FUN_00a40150(void) { epoxy_glMultiDrawElementsBaseVertexEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b3f0); /* WARNING: Could not recover jumptable at 0x00a40170. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsBaseVertexEXT)(); return; } //@@ 00a40180 FUN_00a40180 void FUN_00a40180(void) { epoxy_glMultiDrawElementsBaseVertexOES = (undefined *)FUN_00a2ca10(&DAT_00b2aeb8); /* WARNING: Could not recover jumptable at 0x00a401a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsBaseVertexOES)(); return; } //@@ 00a401b0 FUN_00a401b0 void FUN_00a401b0(void) { epoxy_glMultiDrawElementsEXT = (undefined *)FUN_00a2ca10(&DAT_00b26224); /* WARNING: Could not recover jumptable at 0x00a401d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsEXT)(); return; } //@@ 00a401e0 FUN_00a401e0 void FUN_00a401e0(void) { epoxy_glMultiDrawElementsIndirect = (undefined *)FUN_00a2ca10(&DAT_00b29310); /* WARNING: Could not recover jumptable at 0x00a40200. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsIndirect)(); return; } //@@ 00a40210 FUN_00a40210 void FUN_00a40210(void) { epoxy_glMultiDrawElementsIndirectAMD = (undefined *)FUN_00a2ca10(&DAT_00b3b518); /* WARNING: Could not recover jumptable at 0x00a40230. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsIndirectAMD)(); return; } //@@ 00a40240 FUN_00a40240 void FUN_00a40240(void) { epoxy_glMultiDrawElementsIndirectBindlessCountNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40258. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsIndirectBindlessCountNV)(); return; } //@@ 00a40260 FUN_00a40260 void FUN_00a40260(void) { epoxy_glMultiDrawElementsIndirectBindlessNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsIndirectBindlessNV)(); return; } //@@ 00a40280 FUN_00a40280 void FUN_00a40280(void) { epoxy_glMultiDrawElementsIndirectCountARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsIndirectCountARB)(); return; } //@@ 00a402a0 FUN_00a402a0 void FUN_00a402a0(void) { epoxy_glMultiDrawElementsIndirectEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cebc); /* WARNING: Could not recover jumptable at 0x00a402c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawElementsIndirectEXT)(); return; } //@@ 00a402d0 FUN_00a402d0 void FUN_00a402d0(void) { epoxy_glMultiDrawRangeElementArrayAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a402e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiDrawRangeElementArrayAPPLE)(); return; } //@@ 00a402f0 FUN_00a402f0 void FUN_00a402f0(void) { epoxy_glMultiModeDrawArraysIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiModeDrawArraysIBM)(); return; } //@@ 00a40310 FUN_00a40310 void FUN_00a40310(void) { epoxy_glMultiModeDrawElementsIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiModeDrawElementsIBM)(); return; } //@@ 00a40330 FUN_00a40330 void FUN_00a40330(void) { epoxy_glMultiTexBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexBufferEXT)(); return; } //@@ 00a40350 FUN_00a40350 void FUN_00a40350(void) { epoxy_glMultiTexCoord1bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1bOES)(); return; } //@@ 00a40370 FUN_00a40370 void FUN_00a40370(void) { epoxy_glMultiTexCoord1bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1bvOES)(); return; } //@@ 00a40390 FUN_00a40390 void FUN_00a40390(undefined4 param_1,undefined8 param_2) { epoxy_glMultiTexCoord1d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord1d)(param_1,param_2); return; } //@@ 00a403c0 FUN_00a403c0 void FUN_00a403c0(undefined4 param_1,undefined8 param_2) { epoxy_glMultiTexCoord1dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord1dARB)(param_1,param_2); return; } //@@ 00a403f0 FUN_00a403f0 void FUN_00a403f0(void) { epoxy_glMultiTexCoord1dv = (undefined *)FUN_00a2ca10(&DAT_00b3cfd8); /* WARNING: Could not recover jumptable at 0x00a40410. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1dv)(); return; } //@@ 00a40420 FUN_00a40420 void FUN_00a40420(void) { epoxy_glMultiTexCoord1dvARB = (undefined *)FUN_00a2ca10(&DAT_00b298c8); /* WARNING: Could not recover jumptable at 0x00a40440. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1dvARB)(); return; } //@@ 00a40450 FUN_00a40450 void FUN_00a40450(undefined4 param_1,undefined4 param_2) { epoxy_glMultiTexCoord1f = (undefined *)FUN_00a2ca10(&DAT_00b26abc); (*(code *)epoxy_glMultiTexCoord1f)(param_1,param_2); return; } //@@ 00a40480 FUN_00a40480 void FUN_00a40480(undefined4 param_1,undefined4 param_2) { epoxy_glMultiTexCoord1fARB = (undefined *)FUN_00a2ca10(&DAT_00b28ee0); (*(code *)epoxy_glMultiTexCoord1fARB)(param_1,param_2); return; } //@@ 00a404b0 FUN_00a404b0 void FUN_00a404b0(void) { epoxy_glMultiTexCoord1fv = (undefined *)FUN_00a2ca10(&DAT_00b27a74); /* WARNING: Could not recover jumptable at 0x00a404d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1fv)(); return; } //@@ 00a404e0 FUN_00a404e0 void FUN_00a404e0(void) { epoxy_glMultiTexCoord1fvARB = (undefined *)FUN_00a2ca10(&DAT_00b288e0); /* WARNING: Could not recover jumptable at 0x00a40500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1fvARB)(); return; } //@@ 00a40510 FUN_00a40510 void FUN_00a40510(void) { epoxy_glMultiTexCoord1hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1hNV)(); return; } //@@ 00a40530 FUN_00a40530 void FUN_00a40530(void) { epoxy_glMultiTexCoord1hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40548. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1hvNV)(); return; } //@@ 00a40550 FUN_00a40550 void FUN_00a40550(void) { epoxy_glMultiTexCoord1i = (undefined *)FUN_00a2ca10(&DAT_00b2aa14); /* WARNING: Could not recover jumptable at 0x00a40570. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1i)(); return; } //@@ 00a40580 FUN_00a40580 void FUN_00a40580(void) { epoxy_glMultiTexCoord1iARB = (undefined *)FUN_00a2ca10(&DAT_00b28a34); /* WARNING: Could not recover jumptable at 0x00a405a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1iARB)(); return; } //@@ 00a405b0 FUN_00a405b0 void FUN_00a405b0(void) { epoxy_glMultiTexCoord1iv = (undefined *)FUN_00a2ca10(&DAT_00b2a438); /* WARNING: Could not recover jumptable at 0x00a405d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1iv)(); return; } //@@ 00a405e0 FUN_00a405e0 void FUN_00a405e0(void) { epoxy_glMultiTexCoord1ivARB = (undefined *)FUN_00a2ca10(&DAT_00b28624); /* WARNING: Could not recover jumptable at 0x00a40600. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1ivARB)(); return; } //@@ 00a40610 FUN_00a40610 void FUN_00a40610(void) { epoxy_glMultiTexCoord1s = (undefined *)FUN_00a2ca10(&DAT_00b26ce4); /* WARNING: Could not recover jumptable at 0x00a40630. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1s)(); return; } //@@ 00a40640 FUN_00a40640 void FUN_00a40640(void) { epoxy_glMultiTexCoord1sARB = (undefined *)FUN_00a2ca10(&DAT_00b2874c); /* WARNING: Could not recover jumptable at 0x00a40660. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1sARB)(); return; } //@@ 00a40670 FUN_00a40670 void FUN_00a40670(void) { epoxy_glMultiTexCoord1sv = (undefined *)FUN_00a2ca10(&DAT_00b3ce38); /* WARNING: Could not recover jumptable at 0x00a40690. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1sv)(); return; } //@@ 00a406a0 FUN_00a406a0 void FUN_00a406a0(void) { epoxy_glMultiTexCoord1svARB = (undefined *)FUN_00a2ca10(&DAT_00b29af4); /* WARNING: Could not recover jumptable at 0x00a406c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1svARB)(); return; } //@@ 00a406d0 FUN_00a406d0 void FUN_00a406d0(void) { epoxy_glMultiTexCoord1xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a406e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1xOES)(); return; } //@@ 00a406f0 FUN_00a406f0 void FUN_00a406f0(void) { epoxy_glMultiTexCoord1xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord1xvOES)(); return; } //@@ 00a40710 FUN_00a40710 void FUN_00a40710(void) { epoxy_glMultiTexCoord2bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40728. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2bOES)(); return; } //@@ 00a40730 FUN_00a40730 void FUN_00a40730(void) { epoxy_glMultiTexCoord2bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2bvOES)(); return; } //@@ 00a40750 FUN_00a40750 void FUN_00a40750(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glMultiTexCoord2d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord2d)(param_1,param_2,param_3); return; } //@@ 00a407a0 FUN_00a407a0 void FUN_00a407a0(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glMultiTexCoord2dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord2dARB)(param_1,param_2,param_3); return; } //@@ 00a407f0 FUN_00a407f0 void FUN_00a407f0(void) { epoxy_glMultiTexCoord2dv = (undefined *)FUN_00a2ca10(&DAT_00b26724); /* WARNING: Could not recover jumptable at 0x00a40810. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2dv)(); return; } //@@ 00a40820 FUN_00a40820 void FUN_00a40820(void) { epoxy_glMultiTexCoord2dvARB = (undefined *)FUN_00a2ca10(&DAT_00b3d060); /* WARNING: Could not recover jumptable at 0x00a40840. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2dvARB)(); return; } //@@ 00a40850 FUN_00a40850 void FUN_00a40850(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glMultiTexCoord2f = (undefined *)FUN_00a2ca10(&DAT_00b3d358); (*(code *)epoxy_glMultiTexCoord2f)(param_1,param_2,param_3); return; } //@@ 00a40890 FUN_00a40890 void FUN_00a40890(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glMultiTexCoord2fARB = (undefined *)FUN_00a2ca10(&DAT_00b3bb30); (*(code *)epoxy_glMultiTexCoord2fARB)(param_1,param_2,param_3); return; } //@@ 00a408d0 FUN_00a408d0 void FUN_00a408d0(void) { epoxy_glMultiTexCoord2fv = (undefined *)FUN_00a2ca10(&DAT_00b291f0); /* WARNING: Could not recover jumptable at 0x00a408f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2fv)(); return; } //@@ 00a40900 FUN_00a40900 void FUN_00a40900(void) { epoxy_glMultiTexCoord2fvARB = (undefined *)FUN_00a2ca10(&DAT_00b295d4); /* WARNING: Could not recover jumptable at 0x00a40920. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2fvARB)(); return; } //@@ 00a40930 FUN_00a40930 void FUN_00a40930(void) { epoxy_glMultiTexCoord2hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40948. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2hNV)(); return; } //@@ 00a40950 FUN_00a40950 void FUN_00a40950(void) { epoxy_glMultiTexCoord2hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40968. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2hvNV)(); return; } //@@ 00a40970 FUN_00a40970 void FUN_00a40970(void) { epoxy_glMultiTexCoord2i = (undefined *)FUN_00a2ca10(&DAT_00b3c464); /* WARNING: Could not recover jumptable at 0x00a40990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2i)(); return; } //@@ 00a409a0 FUN_00a409a0 void FUN_00a409a0(void) { epoxy_glMultiTexCoord2iARB = (undefined *)FUN_00a2ca10(&DAT_00b26208); /* WARNING: Could not recover jumptable at 0x00a409c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2iARB)(); return; } //@@ 00a409d0 FUN_00a409d0 void FUN_00a409d0(void) { epoxy_glMultiTexCoord2iv = (undefined *)FUN_00a2ca10(&DAT_00b27d5c); /* WARNING: Could not recover jumptable at 0x00a409f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2iv)(); return; } //@@ 00a40a00 FUN_00a40a00 void FUN_00a40a00(void) { epoxy_glMultiTexCoord2ivARB = (undefined *)FUN_00a2ca10(&DAT_00b290c8); /* WARNING: Could not recover jumptable at 0x00a40a20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2ivARB)(); return; } //@@ 00a40a30 FUN_00a40a30 void FUN_00a40a30(void) { epoxy_glMultiTexCoord2s = (undefined *)FUN_00a2ca10(&DAT_00b273f0); /* WARNING: Could not recover jumptable at 0x00a40a50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2s)(); return; } //@@ 00a40a60 FUN_00a40a60 void FUN_00a40a60(void) { epoxy_glMultiTexCoord2sARB = (undefined *)FUN_00a2ca10(&DAT_00b3b184); /* WARNING: Could not recover jumptable at 0x00a40a80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2sARB)(); return; } //@@ 00a40a90 FUN_00a40a90 void FUN_00a40a90(void) { epoxy_glMultiTexCoord2sv = (undefined *)FUN_00a2ca10(&DAT_00b3c178); /* WARNING: Could not recover jumptable at 0x00a40ab0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2sv)(); return; } //@@ 00a40ac0 FUN_00a40ac0 void FUN_00a40ac0(void) { epoxy_glMultiTexCoord2svARB = (undefined *)FUN_00a2ca10(&DAT_00b268ac); /* WARNING: Could not recover jumptable at 0x00a40ae0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2svARB)(); return; } //@@ 00a40af0 FUN_00a40af0 void FUN_00a40af0(void) { epoxy_glMultiTexCoord2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40b08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2xOES)(); return; } //@@ 00a40b10 FUN_00a40b10 void FUN_00a40b10(void) { epoxy_glMultiTexCoord2xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40b28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord2xvOES)(); return; } //@@ 00a40b30 FUN_00a40b30 void FUN_00a40b30(void) { epoxy_glMultiTexCoord3bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40b48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3bOES)(); return; } //@@ 00a40b50 FUN_00a40b50 void FUN_00a40b50(void) { epoxy_glMultiTexCoord3bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40b68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3bvOES)(); return; } //@@ 00a40b70 FUN_00a40b70 void FUN_00a40b70(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glMultiTexCoord3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord3d)(param_1,param_2,param_3,param_4); return; } //@@ 00a40bc0 FUN_00a40bc0 void FUN_00a40bc0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glMultiTexCoord3dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord3dARB)(param_1,param_2,param_3,param_4); return; } //@@ 00a40c10 FUN_00a40c10 void FUN_00a40c10(void) { epoxy_glMultiTexCoord3dv = (undefined *)FUN_00a2ca10(&DAT_00b28350); /* WARNING: Could not recover jumptable at 0x00a40c30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3dv)(); return; } //@@ 00a40c40 FUN_00a40c40 void FUN_00a40c40(void) { epoxy_glMultiTexCoord3dvARB = (undefined *)FUN_00a2ca10(&DAT_00b3bc4c); /* WARNING: Could not recover jumptable at 0x00a40c60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3dvARB)(); return; } //@@ 00a40c70 FUN_00a40c70 void FUN_00a40c70(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMultiTexCoord3f = (undefined *)FUN_00a2ca10(&DAT_00b28f68); (*(code *)epoxy_glMultiTexCoord3f)(param_1,param_2,param_3,param_4); return; } //@@ 00a40cc0 FUN_00a40cc0 void FUN_00a40cc0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMultiTexCoord3fARB = (undefined *)FUN_00a2ca10(&DAT_00b28378); (*(code *)epoxy_glMultiTexCoord3fARB)(param_1,param_2,param_3,param_4); return; } //@@ 00a40d10 FUN_00a40d10 void FUN_00a40d10(void) { epoxy_glMultiTexCoord3fv = (undefined *)FUN_00a2ca10(&DAT_00b25524); /* WARNING: Could not recover jumptable at 0x00a40d30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3fv)(); return; } //@@ 00a40d40 FUN_00a40d40 void FUN_00a40d40(void) { epoxy_glMultiTexCoord3fvARB = (undefined *)FUN_00a2ca10(&DAT_00b29228); /* WARNING: Could not recover jumptable at 0x00a40d60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3fvARB)(); return; } //@@ 00a40d70 FUN_00a40d70 void FUN_00a40d70(void) { epoxy_glMultiTexCoord3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40d88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3hNV)(); return; } //@@ 00a40d90 FUN_00a40d90 void FUN_00a40d90(void) { epoxy_glMultiTexCoord3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3hvNV)(); return; } //@@ 00a40db0 FUN_00a40db0 void FUN_00a40db0(void) { epoxy_glMultiTexCoord3i = (undefined *)FUN_00a2ca10(&DAT_00b3c9f8); /* WARNING: Could not recover jumptable at 0x00a40dd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3i)(); return; } //@@ 00a40de0 FUN_00a40de0 void FUN_00a40de0(void) { epoxy_glMultiTexCoord3iARB = (undefined *)FUN_00a2ca10(&DAT_00b26ba8); /* WARNING: Could not recover jumptable at 0x00a40e00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3iARB)(); return; } //@@ 00a40e10 FUN_00a40e10 void FUN_00a40e10(void) { epoxy_glMultiTexCoord3iv = (undefined *)FUN_00a2ca10(&DAT_00b26704); /* WARNING: Could not recover jumptable at 0x00a40e30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3iv)(); return; } //@@ 00a40e40 FUN_00a40e40 void FUN_00a40e40(void) { epoxy_glMultiTexCoord3ivARB = (undefined *)FUN_00a2ca10(&DAT_00b28938); /* WARNING: Could not recover jumptable at 0x00a40e60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3ivARB)(); return; } //@@ 00a40e70 FUN_00a40e70 void FUN_00a40e70(void) { epoxy_glMultiTexCoord3s = (undefined *)FUN_00a2ca10(&DAT_00b3ca90); /* WARNING: Could not recover jumptable at 0x00a40e90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3s)(); return; } //@@ 00a40ea0 FUN_00a40ea0 void FUN_00a40ea0(void) { epoxy_glMultiTexCoord3sARB = (undefined *)FUN_00a2ca10(&DAT_00b252b4); /* WARNING: Could not recover jumptable at 0x00a40ec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3sARB)(); return; } //@@ 00a40ed0 FUN_00a40ed0 void FUN_00a40ed0(void) { epoxy_glMultiTexCoord3sv = (undefined *)FUN_00a2ca10(&DAT_00b256b8); /* WARNING: Could not recover jumptable at 0x00a40ef0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3sv)(); return; } //@@ 00a40f00 FUN_00a40f00 void FUN_00a40f00(void) { epoxy_glMultiTexCoord3svARB = (undefined *)FUN_00a2ca10(&DAT_00b2ab68); /* WARNING: Could not recover jumptable at 0x00a40f20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3svARB)(); return; } //@@ 00a40f30 FUN_00a40f30 void FUN_00a40f30(void) { epoxy_glMultiTexCoord3xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40f48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3xOES)(); return; } //@@ 00a40f50 FUN_00a40f50 void FUN_00a40f50(void) { epoxy_glMultiTexCoord3xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40f68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord3xvOES)(); return; } //@@ 00a40f70 FUN_00a40f70 void FUN_00a40f70(void) { epoxy_glMultiTexCoord4bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40f88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4bOES)(); return; } //@@ 00a40f90 FUN_00a40f90 void FUN_00a40f90(void) { epoxy_glMultiTexCoord4bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a40fa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4bvOES)(); return; } //@@ 00a40fb0 FUN_00a40fb0 void FUN_00a40fb0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glMultiTexCoord4d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord4d)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a41010 FUN_00a41010 void FUN_00a41010(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glMultiTexCoord4dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glMultiTexCoord4dARB)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a41070 FUN_00a41070 void FUN_00a41070(void) { epoxy_glMultiTexCoord4dv = (undefined *)FUN_00a2ca10(&DAT_00b3c730); /* WARNING: Could not recover jumptable at 0x00a41090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4dv)(); return; } //@@ 00a410a0 FUN_00a410a0 void FUN_00a410a0(void) { epoxy_glMultiTexCoord4dvARB = (undefined *)FUN_00a2ca10(&DAT_00b25ef4); /* WARNING: Could not recover jumptable at 0x00a410c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4dvARB)(); return; } //@@ 00a410d0 FUN_00a410d0 void FUN_00a410d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glMultiTexCoord4f = (undefined *)FUN_00a2ca10(&DAT_00b271b0); (*(code *)epoxy_glMultiTexCoord4f)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a41130 FUN_00a41130 void FUN_00a41130(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glMultiTexCoord4fARB = (undefined *)FUN_00a2ca10(&DAT_00b27c9c); (*(code *)epoxy_glMultiTexCoord4fARB)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a41190 FUN_00a41190 void FUN_00a41190(void) { epoxy_glMultiTexCoord4fv = (undefined *)FUN_00a2ca10(&DAT_00b27710); /* WARNING: Could not recover jumptable at 0x00a411b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4fv)(); return; } //@@ 00a411c0 FUN_00a411c0 void FUN_00a411c0(void) { epoxy_glMultiTexCoord4fvARB = (undefined *)FUN_00a2ca10(&DAT_00b2a774); /* WARNING: Could not recover jumptable at 0x00a411e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4fvARB)(); return; } //@@ 00a411f0 FUN_00a411f0 void FUN_00a411f0(void) { epoxy_glMultiTexCoord4hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4hNV)(); return; } //@@ 00a41210 FUN_00a41210 void FUN_00a41210(void) { epoxy_glMultiTexCoord4hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41228. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4hvNV)(); return; } //@@ 00a41230 FUN_00a41230 void FUN_00a41230(void) { epoxy_glMultiTexCoord4i = (undefined *)FUN_00a2ca10(&DAT_00b3ccc4); /* WARNING: Could not recover jumptable at 0x00a41250. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4i)(); return; } //@@ 00a41260 FUN_00a41260 void FUN_00a41260(void) { epoxy_glMultiTexCoord4iARB = (undefined *)FUN_00a2ca10(&DAT_00b26ba4); /* WARNING: Could not recover jumptable at 0x00a41280. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4iARB)(); return; } //@@ 00a41290 FUN_00a41290 void FUN_00a41290(void) { epoxy_glMultiTexCoord4iv = (undefined *)FUN_00a2ca10(&DAT_00b258b4); /* WARNING: Could not recover jumptable at 0x00a412b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4iv)(); return; } //@@ 00a412c0 FUN_00a412c0 void FUN_00a412c0(void) { epoxy_glMultiTexCoord4ivARB = (undefined *)FUN_00a2ca10(&DAT_00b3b264); /* WARNING: Could not recover jumptable at 0x00a412e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4ivARB)(); return; } //@@ 00a412f0 FUN_00a412f0 void FUN_00a412f0(void) { epoxy_glMultiTexCoord4s = (undefined *)FUN_00a2ca10(&DAT_00b3c798); /* WARNING: Could not recover jumptable at 0x00a41310. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4s)(); return; } //@@ 00a41320 FUN_00a41320 void FUN_00a41320(void) { epoxy_glMultiTexCoord4sARB = (undefined *)FUN_00a2ca10(&DAT_00b27eb4); /* WARNING: Could not recover jumptable at 0x00a41340. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4sARB)(); return; } //@@ 00a41350 FUN_00a41350 void FUN_00a41350(void) { epoxy_glMultiTexCoord4sv = (undefined *)FUN_00a2ca10(&DAT_00b3b964); /* WARNING: Could not recover jumptable at 0x00a41370. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4sv)(); return; } //@@ 00a41380 FUN_00a41380 void FUN_00a41380(void) { epoxy_glMultiTexCoord4svARB = (undefined *)FUN_00a2ca10(&DAT_00b289dc); /* WARNING: Could not recover jumptable at 0x00a413a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4svARB)(); return; } //@@ 00a413b0 FUN_00a413b0 void FUN_00a413b0(void) { epoxy_glMultiTexCoord4x = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a413c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4x)(); return; } //@@ 00a413d0 FUN_00a413d0 void FUN_00a413d0(void) { epoxy_glMultiTexCoord4xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a413e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4xOES)(); return; } //@@ 00a413f0 FUN_00a413f0 void FUN_00a413f0(void) { epoxy_glMultiTexCoord4xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoord4xvOES)(); return; } //@@ 00a41410 FUN_00a41410 void FUN_00a41410(void) { epoxy_glMultiTexCoordP1ui = (undefined *)FUN_00a2ca10(&DAT_00b256ac); /* WARNING: Could not recover jumptable at 0x00a41430. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP1ui)(); return; } //@@ 00a41440 FUN_00a41440 void FUN_00a41440(void) { epoxy_glMultiTexCoordP1uiv = (undefined *)FUN_00a2ca10(&DAT_00b273b4); /* WARNING: Could not recover jumptable at 0x00a41460. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP1uiv)(); return; } //@@ 00a41470 FUN_00a41470 void FUN_00a41470(void) { epoxy_glMultiTexCoordP2ui = (undefined *)FUN_00a2ca10(&DAT_00b29130); /* WARNING: Could not recover jumptable at 0x00a41490. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP2ui)(); return; } //@@ 00a414a0 FUN_00a414a0 void FUN_00a414a0(void) { epoxy_glMultiTexCoordP2uiv = (undefined *)FUN_00a2ca10(&DAT_00b28600); /* WARNING: Could not recover jumptable at 0x00a414c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP2uiv)(); return; } //@@ 00a414d0 FUN_00a414d0 void FUN_00a414d0(void) { epoxy_glMultiTexCoordP3ui = (undefined *)FUN_00a2ca10(&DAT_00b29cf0); /* WARNING: Could not recover jumptable at 0x00a414f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP3ui)(); return; } //@@ 00a41500 FUN_00a41500 void FUN_00a41500(void) { epoxy_glMultiTexCoordP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b29dec); /* WARNING: Could not recover jumptable at 0x00a41520. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP3uiv)(); return; } //@@ 00a41530 FUN_00a41530 void FUN_00a41530(void) { epoxy_glMultiTexCoordP4ui = (undefined *)FUN_00a2ca10(&DAT_00b27814); /* WARNING: Could not recover jumptable at 0x00a41550. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP4ui)(); return; } //@@ 00a41560 FUN_00a41560 void FUN_00a41560(void) { epoxy_glMultiTexCoordP4uiv = (undefined *)FUN_00a2ca10(&DAT_00b3c8c4); /* WARNING: Could not recover jumptable at 0x00a41580. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordP4uiv)(); return; } //@@ 00a41590 FUN_00a41590 void FUN_00a41590(void) { epoxy_glMultiTexCoordPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a415a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexCoordPointerEXT)(); return; } //@@ 00a415b0 FUN_00a415b0 void FUN_00a415b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMultiTexEnvfEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMultiTexEnvfEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a415f0 FUN_00a415f0 void FUN_00a415f0(void) { epoxy_glMultiTexEnvfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41608. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexEnvfvEXT)(); return; } //@@ 00a41610 FUN_00a41610 void FUN_00a41610(void) { epoxy_glMultiTexEnviEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexEnviEXT)(); return; } //@@ 00a41630 FUN_00a41630 void FUN_00a41630(void) { epoxy_glMultiTexEnvivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41648. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexEnvivEXT)(); return; } //@@ 00a41650 FUN_00a41650 void FUN_00a41650(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4) { epoxy_glMultiTexGendEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMultiTexGendEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a41690 FUN_00a41690 void FUN_00a41690(void) { epoxy_glMultiTexGendvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a416a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexGendvEXT)(); return; } //@@ 00a416b0 FUN_00a416b0 void FUN_00a416b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMultiTexGenfEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMultiTexGenfEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a416f0 FUN_00a416f0 void FUN_00a416f0(void) { epoxy_glMultiTexGenfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexGenfvEXT)(); return; } //@@ 00a41710 FUN_00a41710 void FUN_00a41710(void) { epoxy_glMultiTexGeniEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41728. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexGeniEXT)(); return; } //@@ 00a41730 FUN_00a41730 void FUN_00a41730(void) { epoxy_glMultiTexGenivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexGenivEXT)(); return; } //@@ 00a41750 FUN_00a41750 void FUN_00a41750(void) { epoxy_glMultiTexImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41768. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexImage1DEXT)(); return; } //@@ 00a41770 FUN_00a41770 void FUN_00a41770(void) { epoxy_glMultiTexImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41788. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexImage2DEXT)(); return; } //@@ 00a41790 FUN_00a41790 void FUN_00a41790(void) { epoxy_glMultiTexImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a417a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexImage3DEXT)(); return; } //@@ 00a417b0 FUN_00a417b0 void FUN_00a417b0(void) { epoxy_glMultiTexParameterIivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a417c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexParameterIivEXT)(); return; } //@@ 00a417d0 FUN_00a417d0 void FUN_00a417d0(void) { epoxy_glMultiTexParameterIuivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a417e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexParameterIuivEXT)(); return; } //@@ 00a417f0 FUN_00a417f0 void FUN_00a417f0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glMultiTexParameterfEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glMultiTexParameterfEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a41830 FUN_00a41830 void FUN_00a41830(void) { epoxy_glMultiTexParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41848. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexParameterfvEXT)(); return; } //@@ 00a41850 FUN_00a41850 void FUN_00a41850(void) { epoxy_glMultiTexParameteriEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexParameteriEXT)(); return; } //@@ 00a41870 FUN_00a41870 void FUN_00a41870(void) { epoxy_glMultiTexParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexParameterivEXT)(); return; } //@@ 00a41890 FUN_00a41890 void FUN_00a41890(void) { epoxy_glMultiTexRenderbufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a418a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexRenderbufferEXT)(); return; } //@@ 00a418b0 FUN_00a418b0 void FUN_00a418b0(void) { epoxy_glMultiTexSubImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a418c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexSubImage1DEXT)(); return; } //@@ 00a418d0 FUN_00a418d0 void FUN_00a418d0(void) { epoxy_glMultiTexSubImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a418e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexSubImage2DEXT)(); return; } //@@ 00a418f0 FUN_00a418f0 void FUN_00a418f0(void) { epoxy_glMultiTexSubImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41908. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glMultiTexSubImage3DEXT)(); return; } //@@ 00a41910 FUN_00a41910 void FUN_00a41910(void) { epoxy_glNamedBufferData = (undefined *)FUN_00a2ca10(&DAT_00b284d8); /* WARNING: Could not recover jumptable at 0x00a41930. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferData)(); return; } //@@ 00a41940 FUN_00a41940 void FUN_00a41940(void) { epoxy_glNamedBufferDataEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41958. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferDataEXT)(); return; } //@@ 00a41960 FUN_00a41960 void FUN_00a41960(void) { epoxy_glNamedBufferPageCommitmentARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41978. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferPageCommitmentARB)(); return; } //@@ 00a41980 FUN_00a41980 void FUN_00a41980(void) { epoxy_glNamedBufferPageCommitmentEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41998. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferPageCommitmentEXT)(); return; } //@@ 00a419a0 FUN_00a419a0 void FUN_00a419a0(void) { epoxy_glNamedBufferStorage = (undefined *)FUN_00a2ca10(&DAT_00b3bbbc); /* WARNING: Could not recover jumptable at 0x00a419c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferStorage)(); return; } //@@ 00a419d0 FUN_00a419d0 void FUN_00a419d0(void) { epoxy_glNamedBufferStorageEXT = (undefined *)FUN_00a2ca10(&DAT_00b2af40); /* WARNING: Could not recover jumptable at 0x00a419f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferStorageEXT)(); return; } //@@ 00a41a00 FUN_00a41a00 void FUN_00a41a00(void) { epoxy_glNamedBufferSubData = (undefined *)FUN_00a2ca10(&DAT_00b3c674); /* WARNING: Could not recover jumptable at 0x00a41a20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferSubData)(); return; } //@@ 00a41a30 FUN_00a41a30 void FUN_00a41a30(void) { epoxy_glNamedBufferSubDataEXT = (undefined *)FUN_00a2ca10(&DAT_00b29b64); /* WARNING: Could not recover jumptable at 0x00a41a50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedBufferSubDataEXT)(); return; } //@@ 00a41a60 FUN_00a41a60 void FUN_00a41a60(void) { epoxy_glNamedCopyBufferSubDataEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41a78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedCopyBufferSubDataEXT)(); return; } //@@ 00a41a80 FUN_00a41a80 void FUN_00a41a80(void) { epoxy_glNamedFramebufferDrawBuffer = (undefined *)FUN_00a2ca10(&DAT_00b2a6c0); /* WARNING: Could not recover jumptable at 0x00a41aa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferDrawBuffer)(); return; } //@@ 00a41ab0 FUN_00a41ab0 void FUN_00a41ab0(void) { epoxy_glNamedFramebufferDrawBuffers = (undefined *)FUN_00a2ca10(&DAT_00b27be0); /* WARNING: Could not recover jumptable at 0x00a41ad0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferDrawBuffers)(); return; } //@@ 00a41ae0 FUN_00a41ae0 void FUN_00a41ae0(void) { epoxy_glNamedFramebufferParameteri = (undefined *)FUN_00a2ca10(&DAT_00b255f8); /* WARNING: Could not recover jumptable at 0x00a41b00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferParameteri)(); return; } //@@ 00a41b10 FUN_00a41b10 void FUN_00a41b10(void) { epoxy_glNamedFramebufferParameteriEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41b28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferParameteriEXT)(); return; } //@@ 00a41b30 FUN_00a41b30 void FUN_00a41b30(void) { epoxy_glNamedFramebufferReadBuffer = (undefined *)FUN_00a2ca10(&DAT_00b2a578); /* WARNING: Could not recover jumptable at 0x00a41b50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferReadBuffer)(); return; } //@@ 00a41b60 FUN_00a41b60 void FUN_00a41b60(void) { epoxy_glNamedFramebufferRenderbuffer = (undefined *)FUN_00a2ca10(&DAT_00b3bfa4); /* WARNING: Could not recover jumptable at 0x00a41b80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferRenderbuffer)(); return; } //@@ 00a41b90 FUN_00a41b90 void FUN_00a41b90(void) { epoxy_glNamedFramebufferRenderbufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41ba8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferRenderbufferEXT)(); return; } //@@ 00a41bb0 FUN_00a41bb0 void FUN_00a41bb0(void) { epoxy_glNamedFramebufferSampleLocationsfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41bc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferSampleLocationsfvNV)(); return; } //@@ 00a41bd0 FUN_00a41bd0 void FUN_00a41bd0(void) { epoxy_glNamedFramebufferTexture = (undefined *)FUN_00a2ca10(&DAT_00b3cd28); /* WARNING: Could not recover jumptable at 0x00a41bf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTexture)(); return; } //@@ 00a41c00 FUN_00a41c00 void FUN_00a41c00(void) { epoxy_glNamedFramebufferTexture1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41c18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTexture1DEXT)(); return; } //@@ 00a41c20 FUN_00a41c20 void FUN_00a41c20(void) { epoxy_glNamedFramebufferTexture2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41c38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTexture2DEXT)(); return; } //@@ 00a41c40 FUN_00a41c40 void FUN_00a41c40(void) { epoxy_glNamedFramebufferTexture3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41c58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTexture3DEXT)(); return; } //@@ 00a41c60 FUN_00a41c60 void FUN_00a41c60(void) { epoxy_glNamedFramebufferTextureEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41c78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTextureEXT)(); return; } //@@ 00a41c80 FUN_00a41c80 void FUN_00a41c80(void) { epoxy_glNamedFramebufferTextureFaceEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTextureFaceEXT)(); return; } //@@ 00a41ca0 FUN_00a41ca0 void FUN_00a41ca0(void) { epoxy_glNamedFramebufferTextureLayer = (undefined *)FUN_00a2ca10(&DAT_00b27044); /* WARNING: Could not recover jumptable at 0x00a41cc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTextureLayer)(); return; } //@@ 00a41cd0 FUN_00a41cd0 void FUN_00a41cd0(void) { epoxy_glNamedFramebufferTextureLayerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41ce8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedFramebufferTextureLayerEXT)(); return; } //@@ 00a41cf0 FUN_00a41cf0 void FUN_00a41cf0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6,undefined8 param_7) { epoxy_glNamedProgramLocalParameter4dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glNamedProgramLocalParameter4dEXT) (param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a41d50 FUN_00a41d50 void FUN_00a41d50(void) { epoxy_glNamedProgramLocalParameter4dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41d68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameter4dvEXT)(); return; } //@@ 00a41d70 FUN_00a41d70 void FUN_00a41d70(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glNamedProgramLocalParameter4fEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glNamedProgramLocalParameter4fEXT) (param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a41dd0 FUN_00a41dd0 void FUN_00a41dd0(void) { epoxy_glNamedProgramLocalParameter4fvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41de8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameter4fvEXT)(); return; } //@@ 00a41df0 FUN_00a41df0 void FUN_00a41df0(void) { epoxy_glNamedProgramLocalParameterI4iEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41e08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameterI4iEXT)(); return; } //@@ 00a41e10 FUN_00a41e10 void FUN_00a41e10(void) { epoxy_glNamedProgramLocalParameterI4ivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41e28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameterI4ivEXT)(); return; } //@@ 00a41e30 FUN_00a41e30 void FUN_00a41e30(void) { epoxy_glNamedProgramLocalParameterI4uiEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41e48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameterI4uiEXT)(); return; } //@@ 00a41e50 FUN_00a41e50 void FUN_00a41e50(void) { epoxy_glNamedProgramLocalParameterI4uivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41e68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameterI4uivEXT)(); return; } //@@ 00a41e70 FUN_00a41e70 void FUN_00a41e70(void) { epoxy_glNamedProgramLocalParameters4fvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41e88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParameters4fvEXT)(); return; } //@@ 00a41e90 FUN_00a41e90 void FUN_00a41e90(void) { epoxy_glNamedProgramLocalParametersI4ivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41ea8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParametersI4ivEXT)(); return; } //@@ 00a41eb0 FUN_00a41eb0 void FUN_00a41eb0(void) { epoxy_glNamedProgramLocalParametersI4uivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41ec8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramLocalParametersI4uivEXT)(); return; } //@@ 00a41ed0 FUN_00a41ed0 void FUN_00a41ed0(void) { epoxy_glNamedProgramStringEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedProgramStringEXT)(); return; } //@@ 00a41ef0 FUN_00a41ef0 void FUN_00a41ef0(void) { epoxy_glNamedRenderbufferStorage = (undefined *)FUN_00a2ca10(&DAT_00b3b2c4); /* WARNING: Could not recover jumptable at 0x00a41f10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedRenderbufferStorage)(); return; } //@@ 00a41f20 FUN_00a41f20 void FUN_00a41f20(void) { epoxy_glNamedRenderbufferStorageEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41f38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedRenderbufferStorageEXT)(); return; } //@@ 00a41f40 FUN_00a41f40 void FUN_00a41f40(void) { epoxy_glNamedRenderbufferStorageMultisample = (undefined *)FUN_00a2ca10(&DAT_00b3d394); /* WARNING: Could not recover jumptable at 0x00a41f60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedRenderbufferStorageMultisample)(); return; } //@@ 00a41f70 FUN_00a41f70 void FUN_00a41f70(void) { epoxy_glNamedRenderbufferStorageMultisampleCoverageEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41f88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedRenderbufferStorageMultisampleCoverageEXT)(); return; } //@@ 00a41f90 FUN_00a41f90 void FUN_00a41f90(void) { epoxy_glNamedRenderbufferStorageMultisampleEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41fa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedRenderbufferStorageMultisampleEXT)(); return; } //@@ 00a41fb0 FUN_00a41fb0 void FUN_00a41fb0(void) { epoxy_glNamedStringARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41fc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNamedStringARB)(); return; } //@@ 00a41fd0 FUN_00a41fd0 void FUN_00a41fd0(void) { epoxy_glNewList = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a41fe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNewList)(); return; } //@@ 00a41ff0 FUN_00a41ff0 void FUN_00a41ff0(void) { epoxy_glNewObjectBufferATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42008. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNewObjectBufferATI)(); return; } //@@ 00a42010 FUN_00a42010 void FUN_00a42010(void) { epoxy_glNormal3b = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42028. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3b)(); return; } //@@ 00a42030 FUN_00a42030 void FUN_00a42030(void) { epoxy_glNormal3bv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3bv)(); return; } //@@ 00a42050 FUN_00a42050 void FUN_00a42050(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glNormal3d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glNormal3d)(param_1,param_2,param_3); return; } //@@ 00a420a0 FUN_00a420a0 void FUN_00a420a0(void) { epoxy_glNormal3dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a420b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3dv)(); return; } //@@ 00a420c0 FUN_00a420c0 void FUN_00a420c0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glNormal3f = (undefined *)FUN_00a2ca10(&DAT_00b2a7d0); (*(code *)epoxy_glNormal3f)(param_1,param_2,param_3); return; } //@@ 00a42110 FUN_00a42110 void FUN_00a42110(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glNormal3fVertex3fSUN)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a42180 FUN_00a42180 void FUN_00a42180(void) { epoxy_glNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42198. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3fVertex3fvSUN)(); return; } //@@ 00a421a0 FUN_00a421a0 void FUN_00a421a0(void) { epoxy_glNormal3fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a421b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3fv)(); return; } //@@ 00a421c0 FUN_00a421c0 void FUN_00a421c0(void) { epoxy_glNormal3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a421d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3hNV)(); return; } //@@ 00a421e0 FUN_00a421e0 void FUN_00a421e0(void) { epoxy_glNormal3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a421f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3hvNV)(); return; } //@@ 00a42200 FUN_00a42200 void FUN_00a42200(void) { epoxy_glNormal3i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42218. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3i)(); return; } //@@ 00a42220 FUN_00a42220 void FUN_00a42220(void) { epoxy_glNormal3iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42238. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3iv)(); return; } //@@ 00a42240 FUN_00a42240 void FUN_00a42240(void) { epoxy_glNormal3s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42258. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3s)(); return; } //@@ 00a42260 FUN_00a42260 void FUN_00a42260(void) { epoxy_glNormal3sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3sv)(); return; } //@@ 00a42280 FUN_00a42280 void FUN_00a42280(void) { epoxy_glNormal3x = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3x)(); return; } //@@ 00a422a0 FUN_00a422a0 void FUN_00a422a0(void) { epoxy_glNormal3xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a422b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3xOES)(); return; } //@@ 00a422c0 FUN_00a422c0 void FUN_00a422c0(void) { epoxy_glNormal3xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a422d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormal3xvOES)(); return; } //@@ 00a422e0 FUN_00a422e0 void FUN_00a422e0(void) { epoxy_glNormalFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a422f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalFormatNV)(); return; } //@@ 00a42300 FUN_00a42300 void FUN_00a42300(void) { epoxy_glNormalP3ui = (undefined *)FUN_00a2ca10(&DAT_00b26b68); /* WARNING: Could not recover jumptable at 0x00a42320. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalP3ui)(); return; } //@@ 00a42330 FUN_00a42330 void FUN_00a42330(void) { epoxy_glNormalP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b29958); /* WARNING: Could not recover jumptable at 0x00a42350. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalP3uiv)(); return; } //@@ 00a42360 FUN_00a42360 void FUN_00a42360(void) { epoxy_glNormalPointer = (undefined *)FUN_00a2ca10(&DAT_00b268b8); /* WARNING: Could not recover jumptable at 0x00a42380. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalPointer)(); return; } //@@ 00a42390 FUN_00a42390 void FUN_00a42390(void) { epoxy_glNormalPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a423a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalPointerEXT)(); return; } //@@ 00a423b0 FUN_00a423b0 void FUN_00a423b0(void) { epoxy_glNormalPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a423c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalPointerListIBM)(); return; } //@@ 00a423d0 FUN_00a423d0 void FUN_00a423d0(void) { epoxy_glNormalPointervINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a423e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalPointervINTEL)(); return; } //@@ 00a423f0 FUN_00a423f0 void FUN_00a423f0(void) { epoxy_glNormalStream3bATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3bATI)(); return; } //@@ 00a42410 FUN_00a42410 void FUN_00a42410(void) { epoxy_glNormalStream3bvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3bvATI)(); return; } //@@ 00a42430 FUN_00a42430 void FUN_00a42430(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glNormalStream3dATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glNormalStream3dATI)(param_1,param_2,param_3,param_4); return; } //@@ 00a42480 FUN_00a42480 void FUN_00a42480(void) { epoxy_glNormalStream3dvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42498. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3dvATI)(); return; } //@@ 00a424a0 FUN_00a424a0 void FUN_00a424a0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glNormalStream3fATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glNormalStream3fATI)(param_1,param_2,param_3,param_4); return; } //@@ 00a424f0 FUN_00a424f0 void FUN_00a424f0(void) { epoxy_glNormalStream3fvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42508. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3fvATI)(); return; } //@@ 00a42510 FUN_00a42510 void FUN_00a42510(void) { epoxy_glNormalStream3iATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3iATI)(); return; } //@@ 00a42530 FUN_00a42530 void FUN_00a42530(void) { epoxy_glNormalStream3ivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42548. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3ivATI)(); return; } //@@ 00a42550 FUN_00a42550 void FUN_00a42550(void) { epoxy_glNormalStream3sATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42568. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3sATI)(); return; } //@@ 00a42570 FUN_00a42570 void FUN_00a42570(void) { epoxy_glNormalStream3svATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42588. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glNormalStream3svATI)(); return; } //@@ 00a42590 FUN_00a42590 void FUN_00a42590(void) { epoxy_glObjectLabel = (undefined *)FUN_00a2ca10(&DAT_00b26b48); /* WARNING: Could not recover jumptable at 0x00a425b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glObjectLabel)(); return; } //@@ 00a425c0 FUN_00a425c0 void FUN_00a425c0(void) { epoxy_glObjectLabelKHR = (undefined *)FUN_00a2ca10(&DAT_00b26350); /* WARNING: Could not recover jumptable at 0x00a425e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glObjectLabelKHR)(); return; } //@@ 00a425f0 FUN_00a425f0 void FUN_00a425f0(void) { epoxy_glObjectPtrLabel = (undefined *)FUN_00a2ca10(&DAT_00b26930); /* WARNING: Could not recover jumptable at 0x00a42610. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glObjectPtrLabel)(); return; } //@@ 00a42620 FUN_00a42620 void FUN_00a42620(void) { epoxy_glObjectPtrLabelKHR = (undefined *)FUN_00a2ca10(&DAT_00b26de8); /* WARNING: Could not recover jumptable at 0x00a42640. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glObjectPtrLabelKHR)(); return; } //@@ 00a42650 FUN_00a42650 void FUN_00a42650(void) { epoxy_glObjectPurgeableAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42668. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glObjectPurgeableAPPLE)(); return; } //@@ 00a42670 FUN_00a42670 void FUN_00a42670(void) { epoxy_glObjectUnpurgeableAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42688. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glObjectUnpurgeableAPPLE)(); return; } //@@ 00a42690 FUN_00a42690 void FUN_00a42690(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glOrtho = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glOrtho)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a42700 FUN_00a42700 void FUN_00a42700(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glOrthof = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glOrthof)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a42770 FUN_00a42770 void FUN_00a42770(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glOrthofOES = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glOrthofOES)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a427e0 FUN_00a427e0 void FUN_00a427e0(void) { epoxy_glOrthox = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a427f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glOrthox)(); return; } //@@ 00a42800 FUN_00a42800 void FUN_00a42800(void) { epoxy_glOrthoxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glOrthoxOES)(); return; } //@@ 00a42820 FUN_00a42820 void FUN_00a42820(undefined4 param_1,undefined4 param_2) { epoxy_glPNTrianglesfATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPNTrianglesfATI)(param_1,param_2); return; } //@@ 00a42850 FUN_00a42850 void FUN_00a42850(void) { epoxy_glPNTrianglesiATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPNTrianglesiATI)(); return; } //@@ 00a42870 FUN_00a42870 void FUN_00a42870(void) { epoxy_glPassTexCoordATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPassTexCoordATI)(); return; } //@@ 00a42890 FUN_00a42890 void FUN_00a42890(undefined4 param_1) { epoxy_glPassThrough = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPassThrough)(param_1); return; } //@@ 00a428c0 FUN_00a428c0 void FUN_00a428c0(void) { epoxy_glPassThroughxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a428d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPassThroughxOES)(); return; } //@@ 00a428e0 FUN_00a428e0 void FUN_00a428e0(void) { epoxy_glPatchParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b26ce8); /* WARNING: Could not recover jumptable at 0x00a42900. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPatchParameterfv)(); return; } //@@ 00a42910 FUN_00a42910 void FUN_00a42910(void) { epoxy_glPatchParameteri = (undefined *)FUN_00a2ca10(&DAT_00b3ca94); /* WARNING: Could not recover jumptable at 0x00a42930. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPatchParameteri)(); return; } //@@ 00a42940 FUN_00a42940 void FUN_00a42940(void) { epoxy_glPatchParameteriEXT = (undefined *)FUN_00a2ca10(&DAT_00b262dc); /* WARNING: Could not recover jumptable at 0x00a42960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPatchParameteriEXT)(); return; } //@@ 00a42970 FUN_00a42970 void FUN_00a42970(void) { epoxy_glPatchParameteriOES = (undefined *)FUN_00a2ca10(&DAT_00b3c4bc); /* WARNING: Could not recover jumptable at 0x00a42990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPatchParameteriOES)(); return; } //@@ 00a429a0 FUN_00a429a0 void FUN_00a429a0(void) { epoxy_glPathColorGenNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a429b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathColorGenNV)(); return; } //@@ 00a429c0 FUN_00a429c0 void FUN_00a429c0(void) { epoxy_glPathCommandsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a429d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathCommandsNV)(); return; } //@@ 00a429e0 FUN_00a429e0 void FUN_00a429e0(void) { epoxy_glPathCoordsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a429f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathCoordsNV)(); return; } //@@ 00a42a00 FUN_00a42a00 void FUN_00a42a00(void) { epoxy_glPathCoverDepthFuncNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42a18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathCoverDepthFuncNV)(); return; } //@@ 00a42a20 FUN_00a42a20 void FUN_00a42a20(void) { epoxy_glPathDashArrayNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42a38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathDashArrayNV)(); return; } //@@ 00a42a40 FUN_00a42a40 void FUN_00a42a40(void) { epoxy_glPathFogGenNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42a58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathFogGenNV)(); return; } //@@ 00a42a60 FUN_00a42a60 void FUN_00a42a60(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glPathGlyphIndexArrayNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathGlyphIndexArrayNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a42aa0 FUN_00a42aa0 void FUN_00a42aa0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glPathGlyphIndexRangeNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathGlyphIndexRangeNV)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a42ae0 FUN_00a42ae0 void FUN_00a42ae0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glPathGlyphRangeNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathGlyphRangeNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a42b20 FUN_00a42b20 void FUN_00a42b20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_glPathGlyphsNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathGlyphsNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a42b70 FUN_00a42b70 void FUN_00a42b70(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glPathMemoryGlyphIndexArrayNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathMemoryGlyphIndexArrayNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a42bb0 FUN_00a42bb0 void FUN_00a42bb0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glPathParameterfNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathParameterfNV)(param_1,param_2,param_3); return; } //@@ 00a42be0 FUN_00a42be0 void FUN_00a42be0(void) { epoxy_glPathParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42bf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathParameterfvNV)(); return; } //@@ 00a42c00 FUN_00a42c00 void FUN_00a42c00(void) { epoxy_glPathParameteriNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42c18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathParameteriNV)(); return; } //@@ 00a42c20 FUN_00a42c20 void FUN_00a42c20(void) { epoxy_glPathParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42c38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathParameterivNV)(); return; } //@@ 00a42c40 FUN_00a42c40 void FUN_00a42c40(undefined4 param_1,undefined4 param_2) { epoxy_glPathStencilDepthOffsetNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPathStencilDepthOffsetNV)(param_1,param_2); return; } //@@ 00a42c80 FUN_00a42c80 void FUN_00a42c80(void) { epoxy_glPathStencilFuncNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathStencilFuncNV)(); return; } //@@ 00a42ca0 FUN_00a42ca0 void FUN_00a42ca0(void) { epoxy_glPathStringNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42cb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathStringNV)(); return; } //@@ 00a42cc0 FUN_00a42cc0 void FUN_00a42cc0(void) { epoxy_glPathSubCommandsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42cd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathSubCommandsNV)(); return; } //@@ 00a42ce0 FUN_00a42ce0 void FUN_00a42ce0(void) { epoxy_glPathSubCoordsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42cf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathSubCoordsNV)(); return; } //@@ 00a42d00 FUN_00a42d00 void FUN_00a42d00(void) { epoxy_glPathTexGenNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPathTexGenNV)(); return; } //@@ 00a42d60 FUN_00a42d60 void FUN_00a42d60(void) { epoxy_glPixelDataRangeNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42d78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelDataRangeNV)(); return; } //@@ 00a42d80 FUN_00a42d80 void FUN_00a42d80(void) { epoxy_glPixelMapfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42d98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelMapfv)(); return; } //@@ 00a42da0 FUN_00a42da0 void FUN_00a42da0(void) { epoxy_glPixelMapuiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42db8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelMapuiv)(); return; } //@@ 00a42dc0 FUN_00a42dc0 void FUN_00a42dc0(void) { epoxy_glPixelMapusv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelMapusv)(); return; } //@@ 00a42de0 FUN_00a42de0 void FUN_00a42de0(void) { epoxy_glPixelMapx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelMapx)(); return; } //@@ 00a42e00 FUN_00a42e00 void FUN_00a42e00(undefined4 param_1,undefined4 param_2) { epoxy_glPixelStoref = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPixelStoref)(param_1,param_2); return; } //@@ 00a42e30 FUN_00a42e30 void FUN_00a42e30(void) { epoxy_glPixelStorei = (undefined *)FUN_00a2ca10(&DAT_00b2af34); /* WARNING: Could not recover jumptable at 0x00a42e50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelStorei)(); return; } //@@ 00a42e60 FUN_00a42e60 void FUN_00a42e60(void) { epoxy_glPixelStorex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42e78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelStorex)(); return; } //@@ 00a42e80 FUN_00a42e80 void FUN_00a42e80(undefined4 param_1,undefined4 param_2) { epoxy_glPixelTexGenParameterfSGIS = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPixelTexGenParameterfSGIS)(param_1,param_2); return; } //@@ 00a42eb0 FUN_00a42eb0 void FUN_00a42eb0(void) { epoxy_glPixelTexGenParameterfvSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42ec8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTexGenParameterfvSGIS)(); return; } //@@ 00a42ed0 FUN_00a42ed0 void FUN_00a42ed0(void) { epoxy_glPixelTexGenParameteriSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTexGenParameteriSGIS)(); return; } //@@ 00a42ef0 FUN_00a42ef0 void FUN_00a42ef0(void) { epoxy_glPixelTexGenParameterivSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42f08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTexGenParameterivSGIS)(); return; } //@@ 00a42f10 FUN_00a42f10 void FUN_00a42f10(void) { epoxy_glPixelTexGenSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42f28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTexGenSGIX)(); return; } //@@ 00a42f30 FUN_00a42f30 void FUN_00a42f30(undefined4 param_1,undefined4 param_2) { epoxy_glPixelTransferf = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPixelTransferf)(param_1,param_2); return; } //@@ 00a42f60 FUN_00a42f60 void FUN_00a42f60(void) { epoxy_glPixelTransferi = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTransferi)(); return; } //@@ 00a42f80 FUN_00a42f80 void FUN_00a42f80(void) { epoxy_glPixelTransferxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42f98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTransferxOES)(); return; } //@@ 00a42fa0 FUN_00a42fa0 void FUN_00a42fa0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glPixelTransformParameterfEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPixelTransformParameterfEXT)(param_1,param_2,param_3); return; } //@@ 00a42fd0 FUN_00a42fd0 void FUN_00a42fd0(void) { epoxy_glPixelTransformParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a42fe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTransformParameterfvEXT)(); return; } //@@ 00a42ff0 FUN_00a42ff0 void FUN_00a42ff0(void) { epoxy_glPixelTransformParameteriEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43008. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTransformParameteriEXT)(); return; } //@@ 00a43010 FUN_00a43010 void FUN_00a43010(void) { epoxy_glPixelTransformParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43028. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelTransformParameterivEXT)(); return; } //@@ 00a43030 FUN_00a43030 void FUN_00a43030(undefined4 param_1,undefined4 param_2) { epoxy_glPixelZoom = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPixelZoom)(param_1,param_2); return; } //@@ 00a43070 FUN_00a43070 void FUN_00a43070(void) { epoxy_glPixelZoomxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43088. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPixelZoomxOES)(); return; } //@@ 00a43090 FUN_00a43090 void FUN_00a43090(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glPointAlongPathNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPointAlongPathNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a430d0 FUN_00a430d0 void FUN_00a430d0(undefined4 param_1,undefined4 param_2) { epoxy_glPointParameterf = (undefined *)FUN_00a2ca10(&DAT_00b27038); (*(code *)epoxy_glPointParameterf)(param_1,param_2); return; } //@@ 00a43100 FUN_00a43100 void FUN_00a43100(undefined4 param_1,undefined4 param_2) { epoxy_glPointParameterfARB = (undefined *)FUN_00a2ca10(&DAT_00b26024); (*(code *)epoxy_glPointParameterfARB)(param_1,param_2); return; } //@@ 00a43130 FUN_00a43130 void FUN_00a43130(undefined4 param_1,undefined4 param_2) { epoxy_glPointParameterfEXT = (undefined *)FUN_00a2ca10(&DAT_00b2ad30); (*(code *)epoxy_glPointParameterfEXT)(param_1,param_2); return; } //@@ 00a43160 FUN_00a43160 void FUN_00a43160(undefined4 param_1,undefined4 param_2) { epoxy_glPointParameterfSGIS = (undefined *)FUN_00a2ca10(&DAT_00b2a804); (*(code *)epoxy_glPointParameterfSGIS)(param_1,param_2); return; } //@@ 00a43190 FUN_00a43190 void FUN_00a43190(void) { epoxy_glPointParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b3c190); /* WARNING: Could not recover jumptable at 0x00a431b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterfv)(); return; } //@@ 00a431c0 FUN_00a431c0 void FUN_00a431c0(void) { epoxy_glPointParameterfvARB = (undefined *)FUN_00a2ca10(&DAT_00b29fa4); /* WARNING: Could not recover jumptable at 0x00a431e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterfvARB)(); return; } //@@ 00a431f0 FUN_00a431f0 void FUN_00a431f0(void) { epoxy_glPointParameterfvEXT = (undefined *)FUN_00a2ca10(&DAT_00b25be4); /* WARNING: Could not recover jumptable at 0x00a43210. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterfvEXT)(); return; } //@@ 00a43220 FUN_00a43220 void FUN_00a43220(void) { epoxy_glPointParameterfvSGIS = (undefined *)FUN_00a2ca10(&DAT_00b3b934); /* WARNING: Could not recover jumptable at 0x00a43240. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterfvSGIS)(); return; } //@@ 00a43250 FUN_00a43250 void FUN_00a43250(void) { epoxy_glPointParameteri = (undefined *)FUN_00a2ca10(&DAT_00b29c70); /* WARNING: Could not recover jumptable at 0x00a43270. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameteri)(); return; } //@@ 00a43280 FUN_00a43280 void FUN_00a43280(void) { epoxy_glPointParameteriNV = (undefined *)FUN_00a2ca10(&DAT_00b3af88); /* WARNING: Could not recover jumptable at 0x00a432a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameteriNV)(); return; } //@@ 00a432b0 FUN_00a432b0 void FUN_00a432b0(void) { epoxy_glPointParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b2a8f0); /* WARNING: Could not recover jumptable at 0x00a432d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameteriv)(); return; } //@@ 00a432e0 FUN_00a432e0 void FUN_00a432e0(void) { epoxy_glPointParameterivNV = (undefined *)FUN_00a2ca10(&DAT_00b26538); /* WARNING: Could not recover jumptable at 0x00a43300. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterivNV)(); return; } //@@ 00a43310 FUN_00a43310 void FUN_00a43310(void) { epoxy_glPointParameterx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterx)(); return; } //@@ 00a43330 FUN_00a43330 void FUN_00a43330(void) { epoxy_glPointParameterxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterxOES)(); return; } //@@ 00a43350 FUN_00a43350 void FUN_00a43350(void) { epoxy_glPointParameterxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterxv)(); return; } //@@ 00a43370 FUN_00a43370 void FUN_00a43370(void) { epoxy_glPointParameterxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointParameterxvOES)(); return; } //@@ 00a43390 FUN_00a43390 void FUN_00a43390(undefined4 param_1) { epoxy_glPointSize = (undefined *)FUN_00a2ca10(&DAT_00b26988); (*(code *)epoxy_glPointSize)(param_1); return; } //@@ 00a433c0 FUN_00a433c0 void FUN_00a433c0(void) { epoxy_glPointSizePointerOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a433d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointSizePointerOES)(); return; } //@@ 00a433e0 FUN_00a433e0 void FUN_00a433e0(void) { epoxy_glPointSizex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a433f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointSizex)(); return; } //@@ 00a43400 FUN_00a43400 void FUN_00a43400(void) { epoxy_glPointSizexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPointSizexOES)(); return; } //@@ 00a43420 FUN_00a43420 void FUN_00a43420(void) { epoxy_glPollAsyncSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43438. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPollAsyncSGIX)(); return; } //@@ 00a43440 FUN_00a43440 void FUN_00a43440(void) { epoxy_glPollInstrumentsSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43458. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPollInstrumentsSGIX)(); return; } //@@ 00a43460 FUN_00a43460 void FUN_00a43460(void) { epoxy_glPolygonMode = (undefined *)FUN_00a2ca10(&DAT_00b29bd4); /* WARNING: Could not recover jumptable at 0x00a43480. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPolygonMode)(); return; } //@@ 00a43490 FUN_00a43490 void FUN_00a43490(void) { epoxy_glPolygonModeNV = (undefined *)FUN_00a2ca10(&DAT_00b3cd00); /* WARNING: Could not recover jumptable at 0x00a434b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPolygonModeNV)(); return; } //@@ 00a434c0 FUN_00a434c0 void FUN_00a434c0(undefined4 param_1,undefined4 param_2) { epoxy_glPolygonOffset = (undefined *)FUN_00a2ca10(&DAT_00b26928); (*(code *)epoxy_glPolygonOffset)(param_1,param_2); return; } //@@ 00a43500 FUN_00a43500 void FUN_00a43500(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glPolygonOffsetClampEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPolygonOffsetClampEXT)(param_1,param_2,param_3); return; } //@@ 00a43540 FUN_00a43540 void FUN_00a43540(undefined4 param_1,undefined4 param_2) { epoxy_glPolygonOffsetEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPolygonOffsetEXT)(param_1,param_2); return; } //@@ 00a43580 FUN_00a43580 void FUN_00a43580(void) { epoxy_glPolygonOffsetx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPolygonOffsetx)(); return; } //@@ 00a435a0 FUN_00a435a0 void FUN_00a435a0(void) { epoxy_glPolygonOffsetxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a435b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPolygonOffsetxOES)(); return; } //@@ 00a435c0 FUN_00a435c0 void FUN_00a435c0(void) { epoxy_glPolygonStipple = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a435d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPolygonStipple)(); return; } //@@ 00a436c0 FUN_00a436c0 void FUN_00a436c0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12, undefined4 param_13,undefined4 param_14) { epoxy_glPresentFrameDualFillNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPresentFrameDualFillNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12,param_13,param_14); return; } //@@ 00a43710 FUN_00a43710 void FUN_00a43710(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12) { epoxy_glPresentFrameKeyedNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPresentFrameKeyedNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12); return; } //@@ 00a43760 FUN_00a43760 void FUN_00a43760(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glPrimitiveBoundingBoxEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPrimitiveBoundingBoxEXT) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a437e0 FUN_00a437e0 void FUN_00a437e0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glPrimitiveBoundingBoxOES = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glPrimitiveBoundingBoxOES) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a43860 FUN_00a43860 void FUN_00a43860(void) { epoxy_glPrimitiveRestartIndex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43878. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPrimitiveRestartIndex)(); return; } //@@ 00a43880 FUN_00a43880 void FUN_00a43880(void) { epoxy_glPrimitiveRestartIndexNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43898. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPrimitiveRestartIndexNV)(); return; } //@@ 00a438c0 FUN_00a438c0 void FUN_00a438c0(void) { epoxy_glPrioritizeTextures = (undefined *)FUN_00a2ca10(&DAT_00b26644); /* WARNING: Could not recover jumptable at 0x00a438e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPrioritizeTextures)(); return; } //@@ 00a438f0 FUN_00a438f0 void FUN_00a438f0(void) { epoxy_glPrioritizeTexturesEXT = (undefined *)FUN_00a2ca10(&DAT_00b2aaf8); /* WARNING: Could not recover jumptable at 0x00a43910. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPrioritizeTexturesEXT)(); return; } //@@ 00a43920 FUN_00a43920 void FUN_00a43920(void) { epoxy_glPrioritizeTexturesxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPrioritizeTexturesxOES)(); return; } //@@ 00a43940 FUN_00a43940 void FUN_00a43940(void) { epoxy_glProgramBinary = (undefined *)FUN_00a2ca10(&DAT_00b29030); /* WARNING: Could not recover jumptable at 0x00a43960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramBinary)(); return; } //@@ 00a43970 FUN_00a43970 void FUN_00a43970(void) { epoxy_glProgramBinaryOES = (undefined *)FUN_00a2ca10(&DAT_00b3cf24); /* WARNING: Could not recover jumptable at 0x00a43990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramBinaryOES)(); return; } //@@ 00a439a0 FUN_00a439a0 void FUN_00a439a0(void) { epoxy_glProgramBufferParametersIivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a439b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramBufferParametersIivNV)(); return; } //@@ 00a439c0 FUN_00a439c0 void FUN_00a439c0(void) { epoxy_glProgramBufferParametersIuivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a439d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramBufferParametersIuivNV)(); return; } //@@ 00a439e0 FUN_00a439e0 void FUN_00a439e0(void) { epoxy_glProgramBufferParametersfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a439f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramBufferParametersfvNV)(); return; } //@@ 00a43a00 FUN_00a43a00 void FUN_00a43a00(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glProgramEnvParameter4dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glProgramEnvParameter4dARB)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a43a60 FUN_00a43a60 void FUN_00a43a60(void) { epoxy_glProgramEnvParameter4dvARB = (undefined *)FUN_00a2ca10(&DAT_00b29598); /* WARNING: Could not recover jumptable at 0x00a43a80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameter4dvARB)(); return; } //@@ 00a43a90 FUN_00a43a90 void FUN_00a43a90(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramEnvParameter4fARB = (undefined *)FUN_00a2ca10(&DAT_00b26a28); (*(code *)epoxy_glProgramEnvParameter4fARB)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a43af0 FUN_00a43af0 void FUN_00a43af0(void) { epoxy_glProgramEnvParameter4fvARB = (undefined *)FUN_00a2ca10(&DAT_00b27d34); /* WARNING: Could not recover jumptable at 0x00a43b10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameter4fvARB)(); return; } //@@ 00a43b20 FUN_00a43b20 void FUN_00a43b20(void) { epoxy_glProgramEnvParameterI4iNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43b38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameterI4iNV)(); return; } //@@ 00a43b40 FUN_00a43b40 void FUN_00a43b40(void) { epoxy_glProgramEnvParameterI4ivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43b58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameterI4ivNV)(); return; } //@@ 00a43b60 FUN_00a43b60 void FUN_00a43b60(void) { epoxy_glProgramEnvParameterI4uiNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43b78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameterI4uiNV)(); return; } //@@ 00a43b80 FUN_00a43b80 void FUN_00a43b80(void) { epoxy_glProgramEnvParameterI4uivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43b98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameterI4uivNV)(); return; } //@@ 00a43ba0 FUN_00a43ba0 void FUN_00a43ba0(void) { epoxy_glProgramEnvParameters4fvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43bb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParameters4fvEXT)(); return; } //@@ 00a43bc0 FUN_00a43bc0 void FUN_00a43bc0(void) { epoxy_glProgramEnvParametersI4ivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParametersI4ivNV)(); return; } //@@ 00a43be0 FUN_00a43be0 void FUN_00a43be0(void) { epoxy_glProgramEnvParametersI4uivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43bf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramEnvParametersI4uivNV)(); return; } //@@ 00a43c00 FUN_00a43c00 void FUN_00a43c00(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glProgramLocalParameter4dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glProgramLocalParameter4dARB)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a43c60 FUN_00a43c60 void FUN_00a43c60(void) { epoxy_glProgramLocalParameter4dvARB = (undefined *)FUN_00a2ca10(&DAT_00b2a368); /* WARNING: Could not recover jumptable at 0x00a43c80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameter4dvARB)(); return; } //@@ 00a43c90 FUN_00a43c90 void FUN_00a43c90(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramLocalParameter4fARB = (undefined *)FUN_00a2ca10(&DAT_00b28744); (*(code *)epoxy_glProgramLocalParameter4fARB)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a43cf0 FUN_00a43cf0 void FUN_00a43cf0(void) { epoxy_glProgramLocalParameter4fvARB = (undefined *)FUN_00a2ca10(&DAT_00b3cd68); /* WARNING: Could not recover jumptable at 0x00a43d10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameter4fvARB)(); return; } //@@ 00a43d20 FUN_00a43d20 void FUN_00a43d20(void) { epoxy_glProgramLocalParameterI4iNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43d38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameterI4iNV)(); return; } //@@ 00a43d40 FUN_00a43d40 void FUN_00a43d40(void) { epoxy_glProgramLocalParameterI4ivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43d58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameterI4ivNV)(); return; } //@@ 00a43d60 FUN_00a43d60 void FUN_00a43d60(void) { epoxy_glProgramLocalParameterI4uiNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43d78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameterI4uiNV)(); return; } //@@ 00a43d80 FUN_00a43d80 void FUN_00a43d80(void) { epoxy_glProgramLocalParameterI4uivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43d98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameterI4uivNV)(); return; } //@@ 00a43da0 FUN_00a43da0 void FUN_00a43da0(void) { epoxy_glProgramLocalParameters4fvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43db8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParameters4fvEXT)(); return; } //@@ 00a43dc0 FUN_00a43dc0 void FUN_00a43dc0(void) { epoxy_glProgramLocalParametersI4ivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43dd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParametersI4ivNV)(); return; } //@@ 00a43de0 FUN_00a43de0 void FUN_00a43de0(void) { epoxy_glProgramLocalParametersI4uivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43df8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramLocalParametersI4uivNV)(); return; } //@@ 00a43e00 FUN_00a43e00 void FUN_00a43e00(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6,undefined8 param_7) { epoxy_glProgramNamedParameter4dNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramNamedParameter4dNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a43e60 FUN_00a43e60 void FUN_00a43e60(void) { epoxy_glProgramNamedParameter4dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43e78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramNamedParameter4dvNV)(); return; } //@@ 00a43e80 FUN_00a43e80 void FUN_00a43e80(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glProgramNamedParameter4fNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramNamedParameter4fNV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a43ee0 FUN_00a43ee0 void FUN_00a43ee0(void) { epoxy_glProgramNamedParameter4fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43ef8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramNamedParameter4fvNV)(); return; } //@@ 00a43f00 FUN_00a43f00 void FUN_00a43f00(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glProgramParameter4dNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramParameter4dNV)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a43f60 FUN_00a43f60 void FUN_00a43f60(void) { epoxy_glProgramParameter4dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameter4dvNV)(); return; } //@@ 00a43f80 FUN_00a43f80 void FUN_00a43f80(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramParameter4fNV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramParameter4fNV)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a43fe0 FUN_00a43fe0 void FUN_00a43fe0(void) { epoxy_glProgramParameter4fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a43ff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameter4fvNV)(); return; } //@@ 00a44000 FUN_00a44000 void FUN_00a44000(void) { epoxy_glProgramParameteri = (undefined *)FUN_00a2ca10(&DAT_00b26958); /* WARNING: Could not recover jumptable at 0x00a44020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameteri)(); return; } //@@ 00a44030 FUN_00a44030 void FUN_00a44030(void) { epoxy_glProgramParameteriARB = (undefined *)FUN_00a2ca10(&DAT_00b3c4c4); /* WARNING: Could not recover jumptable at 0x00a44050. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameteriARB)(); return; } //@@ 00a44060 FUN_00a44060 void FUN_00a44060(void) { epoxy_glProgramParameteriEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cdf8); /* WARNING: Could not recover jumptable at 0x00a44080. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameteriEXT)(); return; } //@@ 00a44090 FUN_00a44090 void FUN_00a44090(void) { epoxy_glProgramParameters4dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a440a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameters4dvNV)(); return; } //@@ 00a440b0 FUN_00a440b0 void FUN_00a440b0(void) { epoxy_glProgramParameters4fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a440c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramParameters4fvNV)(); return; } //@@ 00a440d0 FUN_00a440d0 void FUN_00a440d0(void) { epoxy_glProgramPathFragmentInputGenNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a440e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramPathFragmentInputGenNV)(); return; } //@@ 00a440f0 FUN_00a440f0 void FUN_00a440f0(void) { epoxy_glProgramStringARB = (undefined *)FUN_00a2ca10(&DAT_00b29e80); /* WARNING: Could not recover jumptable at 0x00a44110. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramStringARB)(); return; } //@@ 00a44120 FUN_00a44120 void FUN_00a44120(void) { epoxy_glProgramSubroutineParametersuivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a44138. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramSubroutineParametersuivNV)(); return; } //@@ 00a44140 FUN_00a44140 void FUN_00a44140(undefined4 param_1,undefined4 param_2,undefined8 param_3) { epoxy_glProgramUniform1d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glProgramUniform1d)(param_1,param_2,param_3); return; } //@@ 00a44180 FUN_00a44180 void FUN_00a44180(undefined4 param_1,undefined4 param_2,undefined8 param_3) { epoxy_glProgramUniform1dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniform1dEXT)(param_1,param_2,param_3); return; } //@@ 00a441b0 FUN_00a441b0 void FUN_00a441b0(void) { epoxy_glProgramUniform1dv = (undefined *)FUN_00a2ca10(&DAT_00b25c64); /* WARNING: Could not recover jumptable at 0x00a441d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1dv)(); return; } //@@ 00a441e0 FUN_00a441e0 void FUN_00a441e0(void) { epoxy_glProgramUniform1dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a441f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1dvEXT)(); return; } //@@ 00a44200 FUN_00a44200 void FUN_00a44200(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glProgramUniform1f = (undefined *)FUN_00a2ca10(&DAT_00b25b14); (*(code *)epoxy_glProgramUniform1f)(param_1,param_2,param_3); return; } //@@ 00a44240 FUN_00a44240 void FUN_00a44240(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glProgramUniform1fEXT = (undefined *)FUN_00a2ca10(&DAT_00b2abe4); (*(code *)epoxy_glProgramUniform1fEXT)(param_1,param_2,param_3); return; } //@@ 00a44280 FUN_00a44280 void FUN_00a44280(void) { epoxy_glProgramUniform1fv = (undefined *)FUN_00a2ca10(&DAT_00b28bb0); /* WARNING: Could not recover jumptable at 0x00a442a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1fv)(); return; } //@@ 00a442b0 FUN_00a442b0 void FUN_00a442b0(void) { epoxy_glProgramUniform1fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b285c0); /* WARNING: Could not recover jumptable at 0x00a442d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1fvEXT)(); return; } //@@ 00a442e0 FUN_00a442e0 void FUN_00a442e0(void) { epoxy_glProgramUniform1i = (undefined *)FUN_00a2ca10(&DAT_00b2636c); /* WARNING: Could not recover jumptable at 0x00a44300. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1i)(); return; } //@@ 00a44310 FUN_00a44310 void FUN_00a44310(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniform1i64NV = (undefined *)FUN_00a2ca10(&DAT_00b2580c); (*(code *)epoxy_glProgramUniform1i64NV)(param_1,param_2,param_3,param_4); return; } //@@ 00a44350 FUN_00a44350 void FUN_00a44350(void) { epoxy_glProgramUniform1i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b29134); /* WARNING: Could not recover jumptable at 0x00a44370. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1i64vNV)(); return; } //@@ 00a44380 FUN_00a44380 void FUN_00a44380(void) { epoxy_glProgramUniform1iEXT = (undefined *)FUN_00a2ca10(&DAT_00b27560); /* WARNING: Could not recover jumptable at 0x00a443a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1iEXT)(); return; } //@@ 00a443b0 FUN_00a443b0 void FUN_00a443b0(void) { epoxy_glProgramUniform1iv = (undefined *)FUN_00a2ca10(&DAT_00b2538c); /* WARNING: Could not recover jumptable at 0x00a443d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1iv)(); return; } //@@ 00a443e0 FUN_00a443e0 void FUN_00a443e0(void) { epoxy_glProgramUniform1ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b289a4); /* WARNING: Could not recover jumptable at 0x00a44400. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1ivEXT)(); return; } //@@ 00a44410 FUN_00a44410 void FUN_00a44410(void) { epoxy_glProgramUniform1ui = (undefined *)FUN_00a2ca10(&DAT_00b26e74); /* WARNING: Could not recover jumptable at 0x00a44430. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1ui)(); return; } //@@ 00a44440 FUN_00a44440 void FUN_00a44440(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniform1ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b29848); (*(code *)epoxy_glProgramUniform1ui64NV)(param_1,param_2,param_3,param_4); return; } //@@ 00a44480 FUN_00a44480 void FUN_00a44480(void) { epoxy_glProgramUniform1ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b25a8c); /* WARNING: Could not recover jumptable at 0x00a444a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1ui64vNV)(); return; } //@@ 00a444b0 FUN_00a444b0 void FUN_00a444b0(void) { epoxy_glProgramUniform1uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b29e54); /* WARNING: Could not recover jumptable at 0x00a444d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1uiEXT)(); return; } //@@ 00a444e0 FUN_00a444e0 void FUN_00a444e0(void) { epoxy_glProgramUniform1uiv = (undefined *)FUN_00a2ca10(&DAT_00b28e3c); /* WARNING: Could not recover jumptable at 0x00a44500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1uiv)(); return; } //@@ 00a44510 FUN_00a44510 void FUN_00a44510(void) { epoxy_glProgramUniform1uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d790); /* WARNING: Could not recover jumptable at 0x00a44530. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform1uivEXT)(); return; } //@@ 00a44540 FUN_00a44540 void FUN_00a44540(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glProgramUniform2d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glProgramUniform2d)(param_1,param_2,param_3,param_4); return; } //@@ 00a44590 FUN_00a44590 void FUN_00a44590(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glProgramUniform2dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniform2dEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a445d0 FUN_00a445d0 void FUN_00a445d0(void) { epoxy_glProgramUniform2dv = (undefined *)FUN_00a2ca10(&DAT_00b3b1c4); /* WARNING: Could not recover jumptable at 0x00a445f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2dv)(); return; } //@@ 00a44600 FUN_00a44600 void FUN_00a44600(void) { epoxy_glProgramUniform2dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a44618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2dvEXT)(); return; } //@@ 00a44620 FUN_00a44620 void FUN_00a44620(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniform2f = (undefined *)FUN_00a2ca10(&DAT_00b25408); (*(code *)epoxy_glProgramUniform2f)(param_1,param_2,param_3,param_4); return; } //@@ 00a44660 FUN_00a44660 void FUN_00a44660(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniform2fEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b160); (*(code *)epoxy_glProgramUniform2fEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a446a0 FUN_00a446a0 void FUN_00a446a0(void) { epoxy_glProgramUniform2fv = (undefined *)FUN_00a2ca10(&DAT_00b26b14); /* WARNING: Could not recover jumptable at 0x00a446c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2fv)(); return; } //@@ 00a446d0 FUN_00a446d0 void FUN_00a446d0(void) { epoxy_glProgramUniform2fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2b1a4); /* WARNING: Could not recover jumptable at 0x00a446f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2fvEXT)(); return; } //@@ 00a44700 FUN_00a44700 void FUN_00a44700(void) { epoxy_glProgramUniform2i = (undefined *)FUN_00a2ca10(&DAT_00b3cd88); /* WARNING: Could not recover jumptable at 0x00a44720. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2i)(); return; } //@@ 00a44730 FUN_00a44730 void FUN_00a44730(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramUniform2i64NV = (undefined *)FUN_00a2ca10(&DAT_00b3c048); (*(code *)epoxy_glProgramUniform2i64NV)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a44770 FUN_00a44770 void FUN_00a44770(void) { epoxy_glProgramUniform2i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3b900); /* WARNING: Could not recover jumptable at 0x00a44790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2i64vNV)(); return; } //@@ 00a447a0 FUN_00a447a0 void FUN_00a447a0(void) { epoxy_glProgramUniform2iEXT = (undefined *)FUN_00a2ca10(&DAT_00b271a4); /* WARNING: Could not recover jumptable at 0x00a447c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2iEXT)(); return; } //@@ 00a447d0 FUN_00a447d0 void FUN_00a447d0(void) { epoxy_glProgramUniform2iv = (undefined *)FUN_00a2ca10(&DAT_00b3b178); /* WARNING: Could not recover jumptable at 0x00a447f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2iv)(); return; } //@@ 00a44800 FUN_00a44800 void FUN_00a44800(void) { epoxy_glProgramUniform2ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c754); /* WARNING: Could not recover jumptable at 0x00a44820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2ivEXT)(); return; } //@@ 00a44830 FUN_00a44830 void FUN_00a44830(void) { epoxy_glProgramUniform2ui = (undefined *)FUN_00a2ca10(&DAT_00b3c5d0); /* WARNING: Could not recover jumptable at 0x00a44850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2ui)(); return; } //@@ 00a44860 FUN_00a44860 void FUN_00a44860(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramUniform2ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b26ab8); (*(code *)epoxy_glProgramUniform2ui64NV)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a448a0 FUN_00a448a0 void FUN_00a448a0(void) { epoxy_glProgramUniform2ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3c774); /* WARNING: Could not recover jumptable at 0x00a448c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2ui64vNV)(); return; } //@@ 00a448d0 FUN_00a448d0 void FUN_00a448d0(void) { epoxy_glProgramUniform2uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b257ac); /* WARNING: Could not recover jumptable at 0x00a448f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2uiEXT)(); return; } //@@ 00a44900 FUN_00a44900 void FUN_00a44900(void) { epoxy_glProgramUniform2uiv = (undefined *)FUN_00a2ca10(&DAT_00b26498); /* WARNING: Could not recover jumptable at 0x00a44920. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2uiv)(); return; } //@@ 00a44930 FUN_00a44930 void FUN_00a44930(void) { epoxy_glProgramUniform2uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cca0); /* WARNING: Could not recover jumptable at 0x00a44950. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform2uivEXT)(); return; } //@@ 00a44960 FUN_00a44960 void FUN_00a44960(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glProgramUniform3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glProgramUniform3d)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a449b0 FUN_00a449b0 void FUN_00a449b0(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glProgramUniform3dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniform3dEXT)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a44a00 FUN_00a44a00 void FUN_00a44a00(void) { epoxy_glProgramUniform3dv = (undefined *)FUN_00a2ca10(&DAT_00b3c3c4); /* WARNING: Could not recover jumptable at 0x00a44a20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3dv)(); return; } //@@ 00a44a30 FUN_00a44a30 void FUN_00a44a30(void) { epoxy_glProgramUniform3dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a44a48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3dvEXT)(); return; } //@@ 00a44a50 FUN_00a44a50 void FUN_00a44a50(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glProgramUniform3f = (undefined *)FUN_00a2ca10(&DAT_00b259e8); (*(code *)epoxy_glProgramUniform3f)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a44aa0 FUN_00a44aa0 void FUN_00a44aa0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glProgramUniform3fEXT = (undefined *)FUN_00a2ca10(&DAT_00b28ed4); (*(code *)epoxy_glProgramUniform3fEXT)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a44af0 FUN_00a44af0 void FUN_00a44af0(void) { epoxy_glProgramUniform3fv = (undefined *)FUN_00a2ca10(&DAT_00b26884); /* WARNING: Could not recover jumptable at 0x00a44b10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3fv)(); return; } //@@ 00a44b20 FUN_00a44b20 void FUN_00a44b20(void) { epoxy_glProgramUniform3fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b29ee0); /* WARNING: Could not recover jumptable at 0x00a44b40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3fvEXT)(); return; } //@@ 00a44b50 FUN_00a44b50 void FUN_00a44b50(void) { epoxy_glProgramUniform3i = (undefined *)FUN_00a2ca10(&DAT_00b27f68); /* WARNING: Could not recover jumptable at 0x00a44b70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3i)(); return; } //@@ 00a44b80 FUN_00a44b80 void FUN_00a44b80(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glProgramUniform3i64NV = (undefined *)FUN_00a2ca10(&DAT_00b284d4); (*(code *)epoxy_glProgramUniform3i64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a44bd0 FUN_00a44bd0 void FUN_00a44bd0(void) { epoxy_glProgramUniform3i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b27818); /* WARNING: Could not recover jumptable at 0x00a44bf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3i64vNV)(); return; } //@@ 00a44c00 FUN_00a44c00 void FUN_00a44c00(void) { epoxy_glProgramUniform3iEXT = (undefined *)FUN_00a2ca10(&DAT_00b29ec4); /* WARNING: Could not recover jumptable at 0x00a44c20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3iEXT)(); return; } //@@ 00a44c30 FUN_00a44c30 void FUN_00a44c30(void) { epoxy_glProgramUniform3iv = (undefined *)FUN_00a2ca10(&DAT_00b260e0); /* WARNING: Could not recover jumptable at 0x00a44c50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3iv)(); return; } //@@ 00a44c60 FUN_00a44c60 void FUN_00a44c60(void) { epoxy_glProgramUniform3ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b29c74); /* WARNING: Could not recover jumptable at 0x00a44c80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3ivEXT)(); return; } //@@ 00a44c90 FUN_00a44c90 void FUN_00a44c90(void) { epoxy_glProgramUniform3ui = (undefined *)FUN_00a2ca10(&DAT_00b25624); /* WARNING: Could not recover jumptable at 0x00a44cb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3ui)(); return; } //@@ 00a44cc0 FUN_00a44cc0 void FUN_00a44cc0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glProgramUniform3ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b29410); (*(code *)epoxy_glProgramUniform3ui64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a44d10 FUN_00a44d10 void FUN_00a44d10(void) { epoxy_glProgramUniform3ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3d980); /* WARNING: Could not recover jumptable at 0x00a44d30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3ui64vNV)(); return; } //@@ 00a44d40 FUN_00a44d40 void FUN_00a44d40(void) { epoxy_glProgramUniform3uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b28724); /* WARNING: Could not recover jumptable at 0x00a44d60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3uiEXT)(); return; } //@@ 00a44d70 FUN_00a44d70 void FUN_00a44d70(void) { epoxy_glProgramUniform3uiv = (undefined *)FUN_00a2ca10(&DAT_00b2ad88); /* WARNING: Could not recover jumptable at 0x00a44d90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3uiv)(); return; } //@@ 00a44da0 FUN_00a44da0 void FUN_00a44da0(void) { epoxy_glProgramUniform3uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b29414); /* WARNING: Could not recover jumptable at 0x00a44dc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform3uivEXT)(); return; } //@@ 00a44dd0 FUN_00a44dd0 void FUN_00a44dd0(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glProgramUniform4d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glProgramUniform4d)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a44e30 FUN_00a44e30 void FUN_00a44e30(undefined4 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { epoxy_glProgramUniform4dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniform4dEXT)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a44e90 FUN_00a44e90 void FUN_00a44e90(void) { epoxy_glProgramUniform4dv = (undefined *)FUN_00a2ca10(&DAT_00b3af40); /* WARNING: Could not recover jumptable at 0x00a44eb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4dv)(); return; } //@@ 00a44ec0 FUN_00a44ec0 void FUN_00a44ec0(void) { epoxy_glProgramUniform4dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a44ed8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4dvEXT)(); return; } //@@ 00a44ee0 FUN_00a44ee0 void FUN_00a44ee0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramUniform4f = (undefined *)FUN_00a2ca10(&DAT_00b3b608); (*(code *)epoxy_glProgramUniform4f)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a44f40 FUN_00a44f40 void FUN_00a44f40(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glProgramUniform4fEXT = (undefined *)FUN_00a2ca10(&DAT_00b2adb4); (*(code *)epoxy_glProgramUniform4fEXT)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a44fa0 FUN_00a44fa0 void FUN_00a44fa0(void) { epoxy_glProgramUniform4fv = (undefined *)FUN_00a2ca10(&DAT_00b3b61c); /* WARNING: Could not recover jumptable at 0x00a44fc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4fv)(); return; } //@@ 00a44fd0 FUN_00a44fd0 void FUN_00a44fd0(void) { epoxy_glProgramUniform4fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b16c); /* WARNING: Could not recover jumptable at 0x00a44ff0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4fvEXT)(); return; } //@@ 00a45000 FUN_00a45000 void FUN_00a45000(void) { epoxy_glProgramUniform4i = (undefined *)FUN_00a2ca10(&DAT_00b3b204); /* WARNING: Could not recover jumptable at 0x00a45020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4i)(); return; } //@@ 00a45030 FUN_00a45030 void FUN_00a45030(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_glProgramUniform4i64NV = (undefined *)FUN_00a2ca10(&DAT_00b3b774); (*(code *)epoxy_glProgramUniform4i64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a45080 FUN_00a45080 void FUN_00a45080(void) { epoxy_glProgramUniform4i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3da74); /* WARNING: Could not recover jumptable at 0x00a450a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4i64vNV)(); return; } //@@ 00a450b0 FUN_00a450b0 void FUN_00a450b0(void) { epoxy_glProgramUniform4iEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c504); /* WARNING: Could not recover jumptable at 0x00a450d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4iEXT)(); return; } //@@ 00a450e0 FUN_00a450e0 void FUN_00a450e0(void) { epoxy_glProgramUniform4iv = (undefined *)FUN_00a2ca10(&DAT_00b275c4); /* WARNING: Could not recover jumptable at 0x00a45100. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4iv)(); return; } //@@ 00a45110 FUN_00a45110 void FUN_00a45110(void) { epoxy_glProgramUniform4ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b26b80); /* WARNING: Could not recover jumptable at 0x00a45130. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4ivEXT)(); return; } //@@ 00a45140 FUN_00a45140 void FUN_00a45140(void) { epoxy_glProgramUniform4ui = (undefined *)FUN_00a2ca10(&DAT_00b27640); /* WARNING: Could not recover jumptable at 0x00a45160. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4ui)(); return; } //@@ 00a45170 FUN_00a45170 void FUN_00a45170(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_glProgramUniform4ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b2a2d0); (*(code *)epoxy_glProgramUniform4ui64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a451c0 FUN_00a451c0 void FUN_00a451c0(void) { epoxy_glProgramUniform4ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b297b4); /* WARNING: Could not recover jumptable at 0x00a451e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4ui64vNV)(); return; } //@@ 00a451f0 FUN_00a451f0 void FUN_00a451f0(void) { epoxy_glProgramUniform4uiEXT = (undefined *)FUN_00a2ca10(0xb3c6e0); /* WARNING: Could not recover jumptable at 0x00a45210. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4uiEXT)(); return; } //@@ 00a45220 FUN_00a45220 void FUN_00a45220(void) { epoxy_glProgramUniform4uiv = (undefined *)FUN_00a2ca10(&DAT_00b29eec); /* WARNING: Could not recover jumptable at 0x00a45240. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4uiv)(); return; } //@@ 00a45250 FUN_00a45250 void FUN_00a45250(void) { epoxy_glProgramUniform4uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b26164); /* WARNING: Could not recover jumptable at 0x00a45270. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniform4uivEXT)(); return; } //@@ 00a45280 FUN_00a45280 void FUN_00a45280(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniformHandleui64ARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniformHandleui64ARB)(param_1,param_2,param_3,param_4); return; } //@@ 00a452b0 FUN_00a452b0 void FUN_00a452b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniformHandleui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniformHandleui64NV)(param_1,param_2,param_3,param_4); return; } //@@ 00a452e0 FUN_00a452e0 void FUN_00a452e0(void) { epoxy_glProgramUniformHandleui64vARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a452f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformHandleui64vARB)(); return; } //@@ 00a45300 FUN_00a45300 void FUN_00a45300(void) { epoxy_glProgramUniformHandleui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformHandleui64vNV)(); return; } //@@ 00a45320 FUN_00a45320 void FUN_00a45320(void) { epoxy_glProgramUniformMatrix2dv = (undefined *)FUN_00a2ca10(&DAT_00b27504); /* WARNING: Could not recover jumptable at 0x00a45340. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2dv)(); return; } //@@ 00a45350 FUN_00a45350 void FUN_00a45350(void) { epoxy_glProgramUniformMatrix2dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2dvEXT)(); return; } //@@ 00a45370 FUN_00a45370 void FUN_00a45370(void) { epoxy_glProgramUniformMatrix2fv = (undefined *)FUN_00a2ca10(&DAT_00b25d1c); /* WARNING: Could not recover jumptable at 0x00a45390. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2fv)(); return; } //@@ 00a453a0 FUN_00a453a0 void FUN_00a453a0(void) { epoxy_glProgramUniformMatrix2fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b279c4); /* WARNING: Could not recover jumptable at 0x00a453c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2fvEXT)(); return; } //@@ 00a453d0 FUN_00a453d0 void FUN_00a453d0(void) { epoxy_glProgramUniformMatrix2x3dv = (undefined *)FUN_00a2ca10(&DAT_00b26844); /* WARNING: Could not recover jumptable at 0x00a453f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x3dv)(); return; } //@@ 00a45400 FUN_00a45400 void FUN_00a45400(void) { epoxy_glProgramUniformMatrix2x3dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x3dvEXT)(); return; } //@@ 00a45420 FUN_00a45420 void FUN_00a45420(void) { epoxy_glProgramUniformMatrix2x3fv = (undefined *)FUN_00a2ca10(&DAT_00b3bfc0); /* WARNING: Could not recover jumptable at 0x00a45440. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x3fv)(); return; } //@@ 00a45450 FUN_00a45450 void FUN_00a45450(void) { epoxy_glProgramUniformMatrix2x3fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b26da8); /* WARNING: Could not recover jumptable at 0x00a45470. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x3fvEXT)(); return; } //@@ 00a45480 FUN_00a45480 void FUN_00a45480(void) { epoxy_glProgramUniformMatrix2x4dv = (undefined *)FUN_00a2ca10(&DAT_00b26c24); /* WARNING: Could not recover jumptable at 0x00a454a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x4dv)(); return; } //@@ 00a454b0 FUN_00a454b0 void FUN_00a454b0(void) { epoxy_glProgramUniformMatrix2x4dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a454c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x4dvEXT)(); return; } //@@ 00a454d0 FUN_00a454d0 void FUN_00a454d0(void) { epoxy_glProgramUniformMatrix2x4fv = (undefined *)FUN_00a2ca10(&DAT_00b3c0e4); /* WARNING: Could not recover jumptable at 0x00a454f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x4fv)(); return; } //@@ 00a45500 FUN_00a45500 void FUN_00a45500(void) { epoxy_glProgramUniformMatrix2x4fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b256a0); /* WARNING: Could not recover jumptable at 0x00a45520. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix2x4fvEXT)(); return; } //@@ 00a45530 FUN_00a45530 void FUN_00a45530(void) { epoxy_glProgramUniformMatrix3dv = (undefined *)FUN_00a2ca10(&DAT_00b2ae18); /* WARNING: Could not recover jumptable at 0x00a45550. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3dv)(); return; } //@@ 00a45560 FUN_00a45560 void FUN_00a45560(void) { epoxy_glProgramUniformMatrix3dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3dvEXT)(); return; } //@@ 00a45580 FUN_00a45580 void FUN_00a45580(void) { epoxy_glProgramUniformMatrix3fv = (undefined *)FUN_00a2ca10(&DAT_00b3cc30); /* WARNING: Could not recover jumptable at 0x00a455a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3fv)(); return; } //@@ 00a455b0 FUN_00a455b0 void FUN_00a455b0(void) { epoxy_glProgramUniformMatrix3fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b28fdc); /* WARNING: Could not recover jumptable at 0x00a455d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3fvEXT)(); return; } //@@ 00a455e0 FUN_00a455e0 void FUN_00a455e0(void) { epoxy_glProgramUniformMatrix3x2dv = (undefined *)FUN_00a2ca10(&DAT_00b3bcb8); /* WARNING: Could not recover jumptable at 0x00a45600. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x2dv)(); return; } //@@ 00a45610 FUN_00a45610 void FUN_00a45610(void) { epoxy_glProgramUniformMatrix3x2dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x2dvEXT)(); return; } //@@ 00a45630 FUN_00a45630 void FUN_00a45630(void) { epoxy_glProgramUniformMatrix3x2fv = (undefined *)FUN_00a2ca10(&DAT_00b275f8); /* WARNING: Could not recover jumptable at 0x00a45650. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x2fv)(); return; } //@@ 00a45660 FUN_00a45660 void FUN_00a45660(void) { epoxy_glProgramUniformMatrix3x2fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b26414); /* WARNING: Could not recover jumptable at 0x00a45680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x2fvEXT)(); return; } //@@ 00a45690 FUN_00a45690 void FUN_00a45690(void) { epoxy_glProgramUniformMatrix3x4dv = (undefined *)FUN_00a2ca10(&DAT_00b3bf78); /* WARNING: Could not recover jumptable at 0x00a456b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x4dv)(); return; } //@@ 00a456c0 FUN_00a456c0 void FUN_00a456c0(void) { epoxy_glProgramUniformMatrix3x4dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a456d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x4dvEXT)(); return; } //@@ 00a456e0 FUN_00a456e0 void FUN_00a456e0(void) { epoxy_glProgramUniformMatrix3x4fv = (undefined *)FUN_00a2ca10(&DAT_00b29444); /* WARNING: Could not recover jumptable at 0x00a45700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x4fv)(); return; } //@@ 00a45710 FUN_00a45710 void FUN_00a45710(void) { epoxy_glProgramUniformMatrix3x4fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d428); /* WARNING: Could not recover jumptable at 0x00a45730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix3x4fvEXT)(); return; } //@@ 00a45740 FUN_00a45740 void FUN_00a45740(void) { epoxy_glProgramUniformMatrix4dv = (undefined *)FUN_00a2ca10(&DAT_00b3cbbc); /* WARNING: Could not recover jumptable at 0x00a45760. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4dv)(); return; } //@@ 00a45770 FUN_00a45770 void FUN_00a45770(void) { epoxy_glProgramUniformMatrix4dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45788. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4dvEXT)(); return; } //@@ 00a45790 FUN_00a45790 void FUN_00a45790(void) { epoxy_glProgramUniformMatrix4fv = (undefined *)FUN_00a2ca10(&DAT_00b27ea8); /* WARNING: Could not recover jumptable at 0x00a457b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4fv)(); return; } //@@ 00a457c0 FUN_00a457c0 void FUN_00a457c0(void) { epoxy_glProgramUniformMatrix4fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d384); /* WARNING: Could not recover jumptable at 0x00a457e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4fvEXT)(); return; } //@@ 00a457f0 FUN_00a457f0 void FUN_00a457f0(void) { epoxy_glProgramUniformMatrix4x2dv = (undefined *)FUN_00a2ca10(&DAT_00b26c0c); /* WARNING: Could not recover jumptable at 0x00a45810. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x2dv)(); return; } //@@ 00a45820 FUN_00a45820 void FUN_00a45820(void) { epoxy_glProgramUniformMatrix4x2dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45838. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x2dvEXT)(); return; } //@@ 00a45840 FUN_00a45840 void FUN_00a45840(void) { epoxy_glProgramUniformMatrix4x2fv = (undefined *)FUN_00a2ca10(&DAT_00b27208); /* WARNING: Could not recover jumptable at 0x00a45860. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x2fv)(); return; } //@@ 00a45870 FUN_00a45870 void FUN_00a45870(void) { epoxy_glProgramUniformMatrix4x2fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2afe8); /* WARNING: Could not recover jumptable at 0x00a45890. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x2fvEXT)(); return; } //@@ 00a458a0 FUN_00a458a0 void FUN_00a458a0(void) { epoxy_glProgramUniformMatrix4x3dv = (undefined *)FUN_00a2ca10(&DAT_00b2a8d8); /* WARNING: Could not recover jumptable at 0x00a458c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x3dv)(); return; } //@@ 00a458d0 FUN_00a458d0 void FUN_00a458d0(void) { epoxy_glProgramUniformMatrix4x3dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a458e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x3dvEXT)(); return; } //@@ 00a458f0 FUN_00a458f0 void FUN_00a458f0(void) { epoxy_glProgramUniformMatrix4x3fv = (undefined *)FUN_00a2ca10(&DAT_00b29718); /* WARNING: Could not recover jumptable at 0x00a45910. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x3fv)(); return; } //@@ 00a45920 FUN_00a45920 void FUN_00a45920(void) { epoxy_glProgramUniformMatrix4x3fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a2e0); /* WARNING: Could not recover jumptable at 0x00a45940. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformMatrix4x3fvEXT)(); return; } //@@ 00a45950 FUN_00a45950 void FUN_00a45950(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glProgramUniformui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glProgramUniformui64NV)(param_1,param_2,param_3,param_4); return; } //@@ 00a45980 FUN_00a45980 void FUN_00a45980(void) { epoxy_glProgramUniformui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45998. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramUniformui64vNV)(); return; } //@@ 00a459a0 FUN_00a459a0 void FUN_00a459a0(void) { epoxy_glProgramVertexLimitNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a459b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProgramVertexLimitNV)(); return; } //@@ 00a459c0 FUN_00a459c0 void FUN_00a459c0(void) { epoxy_glProvokingVertex = (undefined *)FUN_00a2ca10(&DAT_00b2a7a4); /* WARNING: Could not recover jumptable at 0x00a459e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProvokingVertex)(); return; } //@@ 00a459f0 FUN_00a459f0 void FUN_00a459f0(void) { epoxy_glProvokingVertexEXT = (undefined *)FUN_00a2ca10(&DAT_00b2b078); /* WARNING: Could not recover jumptable at 0x00a45a10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glProvokingVertexEXT)(); return; } //@@ 00a45a20 FUN_00a45a20 void FUN_00a45a20(void) { epoxy_glPushAttrib = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45a38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushAttrib)(); return; } //@@ 00a45a40 FUN_00a45a40 void FUN_00a45a40(void) { epoxy_glPushClientAttrib = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45a58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushClientAttrib)(); return; } //@@ 00a45a60 FUN_00a45a60 void FUN_00a45a60(void) { epoxy_glPushClientAttribDefaultEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45a78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushClientAttribDefaultEXT)(); return; } //@@ 00a45a80 FUN_00a45a80 void FUN_00a45a80(void) { epoxy_glPushDebugGroup = (undefined *)FUN_00a2ca10(&DAT_00b3b014); /* WARNING: Could not recover jumptable at 0x00a45aa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushDebugGroup)(); return; } //@@ 00a45ab0 FUN_00a45ab0 void FUN_00a45ab0(void) { epoxy_glPushDebugGroupKHR = (undefined *)FUN_00a2ca10(&DAT_00b27328); /* WARNING: Could not recover jumptable at 0x00a45ad0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushDebugGroupKHR)(); return; } //@@ 00a45ae0 FUN_00a45ae0 void FUN_00a45ae0(void) { epoxy_glPushGroupMarkerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45af8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushGroupMarkerEXT)(); return; } //@@ 00a45b20 FUN_00a45b20 void FUN_00a45b20(void) { epoxy_glPushName = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45b38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glPushName)(); return; } //@@ 00a45b40 FUN_00a45b40 void FUN_00a45b40(void) { epoxy_glQueryCounter = (undefined *)FUN_00a2ca10(&DAT_00b3d6f8); /* WARNING: Could not recover jumptable at 0x00a45b60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glQueryCounter)(); return; } //@@ 00a45b70 FUN_00a45b70 void FUN_00a45b70(void) { epoxy_glQueryCounterEXT = (undefined *)FUN_00a2ca10(&DAT_00b282cc); /* WARNING: Could not recover jumptable at 0x00a45b90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glQueryCounterEXT)(); return; } //@@ 00a45ba0 FUN_00a45ba0 void FUN_00a45ba0(void) { epoxy_glQueryMatrixxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45bb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glQueryMatrixxOES)(); return; } //@@ 00a45bc0 FUN_00a45bc0 void FUN_00a45bc0(void) { epoxy_glQueryObjectParameteruiAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45bd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glQueryObjectParameteruiAMD)(); return; } //@@ 00a45be0 FUN_00a45be0 void FUN_00a45be0(undefined8 param_1,undefined8 param_2) { epoxy_glRasterPos2d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRasterPos2d)(param_1,param_2); return; } //@@ 00a45c20 FUN_00a45c20 void FUN_00a45c20(void) { epoxy_glRasterPos2dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45c38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2dv)(); return; } //@@ 00a45c40 FUN_00a45c40 void FUN_00a45c40(undefined4 param_1,undefined4 param_2) { epoxy_glRasterPos2f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRasterPos2f)(param_1,param_2); return; } //@@ 00a45c80 FUN_00a45c80 void FUN_00a45c80(void) { epoxy_glRasterPos2fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45c98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2fv)(); return; } //@@ 00a45ca0 FUN_00a45ca0 void FUN_00a45ca0(void) { epoxy_glRasterPos2i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45cb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2i)(); return; } //@@ 00a45cc0 FUN_00a45cc0 void FUN_00a45cc0(void) { epoxy_glRasterPos2iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45cd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2iv)(); return; } //@@ 00a45ce0 FUN_00a45ce0 void FUN_00a45ce0(void) { epoxy_glRasterPos2s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45cf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2s)(); return; } //@@ 00a45d00 FUN_00a45d00 void FUN_00a45d00(void) { epoxy_glRasterPos2sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45d18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2sv)(); return; } //@@ 00a45d20 FUN_00a45d20 void FUN_00a45d20(void) { epoxy_glRasterPos2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45d38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2xOES)(); return; } //@@ 00a45d40 FUN_00a45d40 void FUN_00a45d40(void) { epoxy_glRasterPos2xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45d58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos2xvOES)(); return; } //@@ 00a45d60 FUN_00a45d60 void FUN_00a45d60(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glRasterPos3d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRasterPos3d)(param_1,param_2,param_3); return; } //@@ 00a45db0 FUN_00a45db0 void FUN_00a45db0(void) { epoxy_glRasterPos3dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45dc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3dv)(); return; } //@@ 00a45dd0 FUN_00a45dd0 void FUN_00a45dd0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glRasterPos3f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRasterPos3f)(param_1,param_2,param_3); return; } //@@ 00a45e10 FUN_00a45e10 void FUN_00a45e10(void) { epoxy_glRasterPos3fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45e28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3fv)(); return; } //@@ 00a45e30 FUN_00a45e30 void FUN_00a45e30(void) { epoxy_glRasterPos3i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45e48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3i)(); return; } //@@ 00a45e50 FUN_00a45e50 void FUN_00a45e50(void) { epoxy_glRasterPos3iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45e68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3iv)(); return; } //@@ 00a45e70 FUN_00a45e70 void FUN_00a45e70(void) { epoxy_glRasterPos3s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45e88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3s)(); return; } //@@ 00a45e90 FUN_00a45e90 void FUN_00a45e90(void) { epoxy_glRasterPos3sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45ea8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3sv)(); return; } //@@ 00a45eb0 FUN_00a45eb0 void FUN_00a45eb0(void) { epoxy_glRasterPos3xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45ec8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3xOES)(); return; } //@@ 00a45ed0 FUN_00a45ed0 void FUN_00a45ed0(void) { epoxy_glRasterPos3xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos3xvOES)(); return; } //@@ 00a45ef0 FUN_00a45ef0 void FUN_00a45ef0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glRasterPos4d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRasterPos4d)(param_1,param_2,param_3,param_4); return; } //@@ 00a45f40 FUN_00a45f40 void FUN_00a45f40(void) { epoxy_glRasterPos4dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45f58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4dv)(); return; } //@@ 00a45f60 FUN_00a45f60 void FUN_00a45f60(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glRasterPos4f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRasterPos4f)(param_1,param_2,param_3,param_4); return; } //@@ 00a45fb0 FUN_00a45fb0 void FUN_00a45fb0(void) { epoxy_glRasterPos4fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45fc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4fv)(); return; } //@@ 00a45fd0 FUN_00a45fd0 void FUN_00a45fd0(void) { epoxy_glRasterPos4i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a45fe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4i)(); return; } //@@ 00a45ff0 FUN_00a45ff0 void FUN_00a45ff0(void) { epoxy_glRasterPos4iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46008. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4iv)(); return; } //@@ 00a46010 FUN_00a46010 void FUN_00a46010(void) { epoxy_glRasterPos4s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46028. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4s)(); return; } //@@ 00a46030 FUN_00a46030 void FUN_00a46030(void) { epoxy_glRasterPos4sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4sv)(); return; } //@@ 00a46050 FUN_00a46050 void FUN_00a46050(void) { epoxy_glRasterPos4xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46068. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4xOES)(); return; } //@@ 00a46070 FUN_00a46070 void FUN_00a46070(void) { epoxy_glRasterPos4xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46088. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterPos4xvOES)(); return; } //@@ 00a46090 FUN_00a46090 void FUN_00a46090(void) { epoxy_glRasterSamplesEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cbb4); /* WARNING: Could not recover jumptable at 0x00a460b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRasterSamplesEXT)(); return; } //@@ 00a460c0 FUN_00a460c0 void FUN_00a460c0(void) { epoxy_glReadBuffer = (undefined *)FUN_00a2ca10(&DAT_00b27160); /* WARNING: Could not recover jumptable at 0x00a460e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadBuffer)(); return; } //@@ 00a460f0 FUN_00a460f0 void FUN_00a460f0(void) { epoxy_glReadBufferIndexedEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46108. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadBufferIndexedEXT)(); return; } //@@ 00a46110 FUN_00a46110 void FUN_00a46110(void) { epoxy_glReadBufferNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46128. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadBufferNV)(); return; } //@@ 00a46130 FUN_00a46130 void FUN_00a46130(void) { epoxy_glReadInstrumentsSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46148. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadInstrumentsSGIX)(); return; } //@@ 00a46150 FUN_00a46150 void FUN_00a46150(void) { epoxy_glReadPixels = (undefined *)FUN_00a2ca10(&DAT_00b3ce08); /* WARNING: Could not recover jumptable at 0x00a46170. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadPixels)(); return; } //@@ 00a46180 FUN_00a46180 void FUN_00a46180(void) { epoxy_glReadnPixels = (undefined *)FUN_00a2ca10(&DAT_00b26db4); /* WARNING: Could not recover jumptable at 0x00a461a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadnPixels)(); return; } //@@ 00a461b0 FUN_00a461b0 void FUN_00a461b0(void) { epoxy_glReadnPixelsARB = (undefined *)FUN_00a2ca10(&DAT_00b25a80); /* WARNING: Could not recover jumptable at 0x00a461d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadnPixelsARB)(); return; } //@@ 00a461e0 FUN_00a461e0 void FUN_00a461e0(void) { epoxy_glReadnPixelsEXT = (undefined *)FUN_00a2ca10(&DAT_00b26064); /* WARNING: Could not recover jumptable at 0x00a46200. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadnPixelsEXT)(); return; } //@@ 00a46210 FUN_00a46210 void FUN_00a46210(void) { epoxy_glReadnPixelsKHR = (undefined *)FUN_00a2ca10(&DAT_00b2a24c); /* WARNING: Could not recover jumptable at 0x00a46230. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReadnPixelsKHR)(); return; } //@@ 00a46240 FUN_00a46240 void FUN_00a46240(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glRectd = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRectd)(param_1,param_2,param_3,param_4); return; } //@@ 00a46290 FUN_00a46290 void FUN_00a46290(void) { epoxy_glRectdv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a462a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRectdv)(); return; } //@@ 00a462b0 FUN_00a462b0 void FUN_00a462b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glRectf = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRectf)(param_1,param_2,param_3,param_4); return; } //@@ 00a46300 FUN_00a46300 void FUN_00a46300(void) { epoxy_glRectfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRectfv)(); return; } //@@ 00a46320 FUN_00a46320 void FUN_00a46320(void) { epoxy_glRecti = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46338. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRecti)(); return; } //@@ 00a46340 FUN_00a46340 void FUN_00a46340(void) { epoxy_glRectiv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46358. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRectiv)(); return; } //@@ 00a46360 FUN_00a46360 void FUN_00a46360(void) { epoxy_glRects = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRects)(); return; } //@@ 00a46380 FUN_00a46380 void FUN_00a46380(void) { epoxy_glRectsv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRectsv)(); return; } //@@ 00a463a0 FUN_00a463a0 void FUN_00a463a0(void) { epoxy_glRectxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a463b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRectxOES)(); return; } //@@ 00a463c0 FUN_00a463c0 void FUN_00a463c0(void) { epoxy_glRectxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a463d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRectxvOES)(); return; } //@@ 00a463e0 FUN_00a463e0 void FUN_00a463e0(void) { epoxy_glReferencePlaneSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a463f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReferencePlaneSGIX)(); return; } //@@ 00a46420 FUN_00a46420 void FUN_00a46420(void) { epoxy_glRenderMode = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46438. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderMode)(); return; } //@@ 00a46440 FUN_00a46440 void FUN_00a46440(void) { epoxy_glRenderbufferStorage = (undefined *)FUN_00a2ca10(&DAT_00b27088); /* WARNING: Could not recover jumptable at 0x00a46460. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorage)(); return; } //@@ 00a46470 FUN_00a46470 void FUN_00a46470(void) { epoxy_glRenderbufferStorageEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a970); /* WARNING: Could not recover jumptable at 0x00a46490. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageEXT)(); return; } //@@ 00a464a0 FUN_00a464a0 void FUN_00a464a0(void) { epoxy_glRenderbufferStorageMultisample = (undefined *)FUN_00a2ca10(&DAT_00b2a594); /* WARNING: Could not recover jumptable at 0x00a464c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisample)(); return; } //@@ 00a464d0 FUN_00a464d0 void FUN_00a464d0(void) { epoxy_glRenderbufferStorageMultisampleANGLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a464e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisampleANGLE)(); return; } //@@ 00a464f0 FUN_00a464f0 void FUN_00a464f0(void) { epoxy_glRenderbufferStorageMultisampleAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46508. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisampleAPPLE)(); return; } //@@ 00a46510 FUN_00a46510 void FUN_00a46510(void) { epoxy_glRenderbufferStorageMultisampleCoverageNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisampleCoverageNV)(); return; } //@@ 00a46530 FUN_00a46530 void FUN_00a46530(void) { epoxy_glRenderbufferStorageMultisampleEXT = (undefined *)FUN_00a2ca10(&DAT_00b2b218); /* WARNING: Could not recover jumptable at 0x00a46550. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisampleEXT)(); return; } //@@ 00a46560 FUN_00a46560 void FUN_00a46560(void) { epoxy_glRenderbufferStorageMultisampleIMG = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisampleIMG)(); return; } //@@ 00a46580 FUN_00a46580 void FUN_00a46580(void) { epoxy_glRenderbufferStorageMultisampleNV = (undefined *)FUN_00a2ca10(&DAT_00b3aff4); /* WARNING: Could not recover jumptable at 0x00a465a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageMultisampleNV)(); return; } //@@ 00a465b0 FUN_00a465b0 void FUN_00a465b0(void) { epoxy_glRenderbufferStorageOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a465c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRenderbufferStorageOES)(); return; } //@@ 00a465d0 FUN_00a465d0 void FUN_00a465d0(void) { epoxy_glReplacementCodePointerSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a465e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodePointerSUN)(); return; } //@@ 00a465f0 FUN_00a465f0 void FUN_00a465f0(void) { epoxy_glReplacementCodeubSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46608. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeubSUN)(); return; } //@@ 00a46610 FUN_00a46610 void FUN_00a46610(void) { epoxy_glReplacementCodeubvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeubvSUN)(); return; } //@@ 00a46630 FUN_00a46630 void FUN_00a46630(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glReplacementCodeuiColor3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiColor3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a466a0 FUN_00a466a0 void FUN_00a466a0(void) { epoxy_glReplacementCodeuiColor3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a466b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiColor3fVertex3fvSUN)(); return; } //@@ 00a466c0 FUN_00a466c0 void FUN_00a466c0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11) { epoxy_glReplacementCodeuiColor4fNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiColor4fNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11); return; } //@@ 00a46750 FUN_00a46750 void FUN_00a46750(void) { epoxy_glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46768. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiColor4fNormal3fVertex3fvSUN)(); return; } //@@ 00a46770 FUN_00a46770 void FUN_00a46770(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glReplacementCodeuiColor4ubVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiColor4ubVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a467c0 FUN_00a467c0 void FUN_00a467c0(void) { epoxy_glReplacementCodeuiColor4ubVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a467d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiColor4ubVertex3fvSUN)(); return; } //@@ 00a467e0 FUN_00a467e0 void FUN_00a467e0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glReplacementCodeuiNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a46850 FUN_00a46850 void FUN_00a46850(void) { epoxy_glReplacementCodeuiNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiNormal3fVertex3fvSUN)(); return; } //@@ 00a46870 FUN_00a46870 void FUN_00a46870(void) { epoxy_glReplacementCodeuiSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiSUN)(); return; } //@@ 00a46890 FUN_00a46890 void FUN_00a46890(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12, undefined4 param_13) { epoxy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12,param_13); return; } //@@ 00a46940 FUN_00a46940 void FUN_00a46940(void) { epoxy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46958. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)(); return; } //@@ 00a46960 FUN_00a46960 void FUN_00a46960(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a469e0 FUN_00a469e0 void FUN_00a469e0(void) { epoxy_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a469f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)(); return; } //@@ 00a46a00 FUN_00a46a00 void FUN_00a46a00(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_glReplacementCodeuiTexCoord2fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiTexCoord2fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a46a60 FUN_00a46a60 void FUN_00a46a60(void) { epoxy_glReplacementCodeuiTexCoord2fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46a78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiTexCoord2fVertex3fvSUN)(); return; } //@@ 00a46a80 FUN_00a46a80 void FUN_00a46a80(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glReplacementCodeuiVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glReplacementCodeuiVertex3fSUN)(param_1,param_2,param_3,param_4); return; } //@@ 00a46ad0 FUN_00a46ad0 void FUN_00a46ad0(void) { epoxy_glReplacementCodeuiVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46ae8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuiVertex3fvSUN)(); return; } //@@ 00a46af0 FUN_00a46af0 void FUN_00a46af0(void) { epoxy_glReplacementCodeuivSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46b08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeuivSUN)(); return; } //@@ 00a46b10 FUN_00a46b10 void FUN_00a46b10(void) { epoxy_glReplacementCodeusSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46b28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeusSUN)(); return; } //@@ 00a46b30 FUN_00a46b30 void FUN_00a46b30(void) { epoxy_glReplacementCodeusvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46b48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glReplacementCodeusvSUN)(); return; } //@@ 00a46b50 FUN_00a46b50 void FUN_00a46b50(void) { epoxy_glRequestResidentProgramsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46b68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRequestResidentProgramsNV)(); return; } //@@ 00a46b70 FUN_00a46b70 void FUN_00a46b70(void) { epoxy_glResetHistogram = (undefined *)FUN_00a2ca10(&DAT_00b3d398); /* WARNING: Could not recover jumptable at 0x00a46b90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glResetHistogram)(); return; } //@@ 00a46ba0 FUN_00a46ba0 void FUN_00a46ba0(void) { epoxy_glResetHistogramEXT = (undefined *)FUN_00a2ca10(&DAT_00b26094); /* WARNING: Could not recover jumptable at 0x00a46bc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glResetHistogramEXT)(); return; } //@@ 00a46bd0 FUN_00a46bd0 void FUN_00a46bd0(void) { epoxy_glResetMinmax = (undefined *)FUN_00a2ca10(&DAT_00b3b6c0); /* WARNING: Could not recover jumptable at 0x00a46bf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glResetMinmax)(); return; } //@@ 00a46c00 FUN_00a46c00 void FUN_00a46c00(void) { epoxy_glResetMinmaxEXT = (undefined *)FUN_00a2ca10(&DAT_00b261c4); /* WARNING: Could not recover jumptable at 0x00a46c20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glResetMinmaxEXT)(); return; } //@@ 00a46cd0 FUN_00a46cd0 void FUN_00a46cd0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glRotated = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glRotated)(param_1,param_2,param_3,param_4); return; } //@@ 00a46d20 FUN_00a46d20 void FUN_00a46d20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glRotatef = (undefined *)FUN_00a2ca10(&DAT_00b2a7b4); (*(code *)epoxy_glRotatef)(param_1,param_2,param_3,param_4); return; } //@@ 00a46d70 FUN_00a46d70 void FUN_00a46d70(void) { epoxy_glRotatex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46d88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRotatex)(); return; } //@@ 00a46d90 FUN_00a46d90 void FUN_00a46d90(void) { epoxy_glRotatexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glRotatexOES)(); return; } //@@ 00a46db0 FUN_00a46db0 void FUN_00a46db0(undefined4 param_1,undefined4 param_2) { epoxy_glSampleCoverage = (undefined *)FUN_00a2ca10(&DAT_00b263e8); (*(code *)epoxy_glSampleCoverage)(param_1,param_2); return; } //@@ 00a46df0 FUN_00a46df0 void FUN_00a46df0(undefined4 param_1,undefined4 param_2) { epoxy_glSampleCoverageARB = (undefined *)FUN_00a2ca10(&DAT_00b2a1c0); (*(code *)epoxy_glSampleCoverageARB)(param_1,param_2); return; } //@@ 00a46e30 FUN_00a46e30 void FUN_00a46e30(void) { epoxy_glSampleCoveragex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46e48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSampleCoveragex)(); return; } //@@ 00a46e50 FUN_00a46e50 void FUN_00a46e50(void) { epoxy_glSampleCoveragexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46e68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSampleCoveragexOES)(); return; } //@@ 00a46e70 FUN_00a46e70 void FUN_00a46e70(void) { epoxy_glSampleMapATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46e88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSampleMapATI)(); return; } //@@ 00a46e90 FUN_00a46e90 void FUN_00a46e90(undefined4 param_1,undefined4 param_2) { epoxy_glSampleMaskEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d46c); (*(code *)epoxy_glSampleMaskEXT)(param_1,param_2); return; } //@@ 00a46ed0 FUN_00a46ed0 void FUN_00a46ed0(void) { epoxy_glSampleMaskIndexedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a46ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSampleMaskIndexedNV)(); return; } //@@ 00a46ef0 FUN_00a46ef0 void FUN_00a46ef0(undefined4 param_1,undefined4 param_2) { epoxy_glSampleMaskSGIS = (undefined *)FUN_00a2ca10(&DAT_00b29054); (*(code *)epoxy_glSampleMaskSGIS)(param_1,param_2); return; } //@@ 00a46f30 FUN_00a46f30 void FUN_00a46f30(void) { epoxy_glSampleMaski = (undefined *)FUN_00a2ca10(&DAT_00b25ae0); /* WARNING: Could not recover jumptable at 0x00a46f50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSampleMaski)(); return; } //@@ 00a46f60 FUN_00a46f60 void FUN_00a46f60(void) { epoxy_glSamplePatternEXT = (undefined *)FUN_00a2ca10(&DAT_00b25fe4); /* WARNING: Could not recover jumptable at 0x00a46f80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplePatternEXT)(); return; } //@@ 00a46f90 FUN_00a46f90 void FUN_00a46f90(void) { epoxy_glSamplePatternSGIS = (undefined *)FUN_00a2ca10(&DAT_00b2a0b8); /* WARNING: Could not recover jumptable at 0x00a46fb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplePatternSGIS)(); return; } //@@ 00a46fc0 FUN_00a46fc0 void FUN_00a46fc0(void) { epoxy_glSamplerParameterIiv = (undefined *)FUN_00a2ca10(&DAT_00b29128); /* WARNING: Could not recover jumptable at 0x00a46fe0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterIiv)(); return; } //@@ 00a47000 FUN_00a47000 void FUN_00a47000(void) { epoxy_glSamplerParameterIivEXT = (undefined *)FUN_00a2ca10(&DAT_00b26314); /* WARNING: Could not recover jumptable at 0x00a47020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterIivEXT)(); return; } //@@ 00a47030 FUN_00a47030 void FUN_00a47030(void) { epoxy_glSamplerParameterIivOES = (undefined *)FUN_00a2ca10(&DAT_00b3ba20); /* WARNING: Could not recover jumptable at 0x00a47050. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterIivOES)(); return; } //@@ 00a47060 FUN_00a47060 void FUN_00a47060(void) { epoxy_glSamplerParameterIuiv = (undefined *)FUN_00a2ca10(&DAT_00b2aac8); /* WARNING: Could not recover jumptable at 0x00a47080. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterIuiv)(); return; } //@@ 00a47090 FUN_00a47090 void FUN_00a47090(void) { epoxy_glSamplerParameterIuivEXT = (undefined *)FUN_00a2ca10(&DAT_00b27fe4); /* WARNING: Could not recover jumptable at 0x00a470b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterIuivEXT)(); return; } //@@ 00a470c0 FUN_00a470c0 void FUN_00a470c0(void) { epoxy_glSamplerParameterIuivOES = (undefined *)FUN_00a2ca10(&DAT_00b3b76c); /* WARNING: Could not recover jumptable at 0x00a470e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterIuivOES)(); return; } //@@ 00a470f0 FUN_00a470f0 void FUN_00a470f0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glSamplerParameterf = (undefined *)FUN_00a2ca10(&DAT_00b25218); (*(code *)epoxy_glSamplerParameterf)(param_1,param_2,param_3); return; } //@@ 00a47130 FUN_00a47130 void FUN_00a47130(void) { epoxy_glSamplerParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b26ec4); /* WARNING: Could not recover jumptable at 0x00a47150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameterfv)(); return; } //@@ 00a47160 FUN_00a47160 void FUN_00a47160(void) { epoxy_glSamplerParameteri = (undefined *)FUN_00a2ca10(&DAT_00b3cfd0); /* WARNING: Could not recover jumptable at 0x00a47180. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameteri)(); return; } //@@ 00a47190 FUN_00a47190 void FUN_00a47190(void) { epoxy_glSamplerParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b27020); /* WARNING: Could not recover jumptable at 0x00a471b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSamplerParameteriv)(); return; } //@@ 00a471c0 FUN_00a471c0 void FUN_00a471c0(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glScaled = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glScaled)(param_1,param_2,param_3); return; } //@@ 00a47210 FUN_00a47210 void FUN_00a47210(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glScalef = (undefined *)FUN_00a2ca10(&DAT_00b3c7b4); (*(code *)epoxy_glScalef)(param_1,param_2,param_3); return; } //@@ 00a47260 FUN_00a47260 void FUN_00a47260(void) { epoxy_glScalex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScalex)(); return; } //@@ 00a47280 FUN_00a47280 void FUN_00a47280(void) { epoxy_glScalexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScalexOES)(); return; } //@@ 00a472a0 FUN_00a472a0 void FUN_00a472a0(void) { epoxy_glScissor = (undefined *)FUN_00a2ca10(&DAT_00b3b28c); /* WARNING: Could not recover jumptable at 0x00a472c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissor)(); return; } //@@ 00a472d0 FUN_00a472d0 void FUN_00a472d0(void) { epoxy_glScissorArrayv = (undefined *)FUN_00a2ca10(&DAT_00b3c268); /* WARNING: Could not recover jumptable at 0x00a472f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissorArrayv)(); return; } //@@ 00a47300 FUN_00a47300 void FUN_00a47300(void) { epoxy_glScissorArrayvNV = (undefined *)FUN_00a2ca10(&DAT_00b26b5c); /* WARNING: Could not recover jumptable at 0x00a47320. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissorArrayvNV)(); return; } //@@ 00a47330 FUN_00a47330 void FUN_00a47330(void) { epoxy_glScissorIndexed = (undefined *)FUN_00a2ca10(&DAT_00b2a064); /* WARNING: Could not recover jumptable at 0x00a47350. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissorIndexed)(); return; } //@@ 00a47360 FUN_00a47360 void FUN_00a47360(void) { epoxy_glScissorIndexedNV = (undefined *)FUN_00a2ca10(&DAT_00b25548); /* WARNING: Could not recover jumptable at 0x00a47380. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissorIndexedNV)(); return; } //@@ 00a47390 FUN_00a47390 void FUN_00a47390(void) { epoxy_glScissorIndexedv = (undefined *)FUN_00a2ca10(&DAT_00b2a868); /* WARNING: Could not recover jumptable at 0x00a473b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissorIndexedv)(); return; } //@@ 00a473c0 FUN_00a473c0 void FUN_00a473c0(void) { epoxy_glScissorIndexedvNV = (undefined *)FUN_00a2ca10(&DAT_00b3c0f8); /* WARNING: Could not recover jumptable at 0x00a473e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glScissorIndexedvNV)(); return; } //@@ 00a473f0 FUN_00a473f0 void FUN_00a473f0(void) { epoxy_glSecondaryColor3b = (undefined *)FUN_00a2ca10(&DAT_00b28b94); /* WARNING: Could not recover jumptable at 0x00a47410. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3b)(); return; } //@@ 00a47420 FUN_00a47420 void FUN_00a47420(void) { epoxy_glSecondaryColor3bEXT = (undefined *)FUN_00a2ca10(&DAT_00b29c84); /* WARNING: Could not recover jumptable at 0x00a47440. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3bEXT)(); return; } //@@ 00a47450 FUN_00a47450 void FUN_00a47450(void) { epoxy_glSecondaryColor3bv = (undefined *)FUN_00a2ca10(&DAT_00b3d984); /* WARNING: Could not recover jumptable at 0x00a47470. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3bv)(); return; } //@@ 00a47480 FUN_00a47480 void FUN_00a47480(void) { epoxy_glSecondaryColor3bvEXT = (undefined *)FUN_00a2ca10(&DAT_00b260a4); /* WARNING: Could not recover jumptable at 0x00a474a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3bvEXT)(); return; } //@@ 00a474b0 FUN_00a474b0 void FUN_00a474b0(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glSecondaryColor3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glSecondaryColor3d)(param_1,param_2,param_3); return; } //@@ 00a47500 FUN_00a47500 void FUN_00a47500(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glSecondaryColor3dEXT = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glSecondaryColor3dEXT)(param_1,param_2,param_3); return; } //@@ 00a47550 FUN_00a47550 void FUN_00a47550(void) { epoxy_glSecondaryColor3dv = (undefined *)FUN_00a2ca10(&DAT_00b26254); /* WARNING: Could not recover jumptable at 0x00a47570. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3dv)(); return; } //@@ 00a47580 FUN_00a47580 void FUN_00a47580(void) { epoxy_glSecondaryColor3dvEXT = (undefined *)FUN_00a2ca10(&DAT_00b29f48); /* WARNING: Could not recover jumptable at 0x00a475a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3dvEXT)(); return; } //@@ 00a475b0 FUN_00a475b0 void FUN_00a475b0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glSecondaryColor3f = (undefined *)FUN_00a2ca10(&DAT_00b3afd8); (*(code *)epoxy_glSecondaryColor3f)(param_1,param_2,param_3); return; } //@@ 00a47600 FUN_00a47600 void FUN_00a47600(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glSecondaryColor3fEXT = (undefined *)FUN_00a2ca10(&DAT_00b251e0); (*(code *)epoxy_glSecondaryColor3fEXT)(param_1,param_2,param_3); return; } //@@ 00a47650 FUN_00a47650 void FUN_00a47650(void) { epoxy_glSecondaryColor3fv = (undefined *)FUN_00a2ca10(&DAT_00b26778); /* WARNING: Could not recover jumptable at 0x00a47670. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3fv)(); return; } //@@ 00a47680 FUN_00a47680 void FUN_00a47680(void) { epoxy_glSecondaryColor3fvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b6e8); /* WARNING: Could not recover jumptable at 0x00a476a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3fvEXT)(); return; } //@@ 00a476b0 FUN_00a476b0 void FUN_00a476b0(void) { epoxy_glSecondaryColor3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a476c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3hNV)(); return; } //@@ 00a476d0 FUN_00a476d0 void FUN_00a476d0(void) { epoxy_glSecondaryColor3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a476e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3hvNV)(); return; } //@@ 00a476f0 FUN_00a476f0 void FUN_00a476f0(void) { epoxy_glSecondaryColor3i = (undefined *)FUN_00a2ca10(&DAT_00b29000); /* WARNING: Could not recover jumptable at 0x00a47710. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3i)(); return; } //@@ 00a47720 FUN_00a47720 void FUN_00a47720(void) { epoxy_glSecondaryColor3iEXT = (undefined *)FUN_00a2ca10(&DAT_00b3ca88); /* WARNING: Could not recover jumptable at 0x00a47740. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3iEXT)(); return; } //@@ 00a47750 FUN_00a47750 void FUN_00a47750(void) { epoxy_glSecondaryColor3iv = (undefined *)FUN_00a2ca10(&DAT_00b24bcc); /* WARNING: Could not recover jumptable at 0x00a47770. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3iv)(); return; } //@@ 00a47780 FUN_00a47780 void FUN_00a47780(void) { epoxy_glSecondaryColor3ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b28d18); /* WARNING: Could not recover jumptable at 0x00a477a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3ivEXT)(); return; } //@@ 00a477b0 FUN_00a477b0 void FUN_00a477b0(void) { epoxy_glSecondaryColor3s = (undefined *)FUN_00a2ca10(&DAT_00b28b64); /* WARNING: Could not recover jumptable at 0x00a477d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3s)(); return; } //@@ 00a477e0 FUN_00a477e0 void FUN_00a477e0(void) { epoxy_glSecondaryColor3sEXT = (undefined *)FUN_00a2ca10(&DAT_00b279c0); /* WARNING: Could not recover jumptable at 0x00a47800. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3sEXT)(); return; } //@@ 00a47810 FUN_00a47810 void FUN_00a47810(void) { epoxy_glSecondaryColor3sv = (undefined *)FUN_00a2ca10(&DAT_00b2a7e4); /* WARNING: Could not recover jumptable at 0x00a47830. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3sv)(); return; } //@@ 00a47840 FUN_00a47840 void FUN_00a47840(void) { epoxy_glSecondaryColor3svEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b838); /* WARNING: Could not recover jumptable at 0x00a47860. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3svEXT)(); return; } //@@ 00a47870 FUN_00a47870 void FUN_00a47870(void) { epoxy_glSecondaryColor3ub = (undefined *)FUN_00a2ca10(&DAT_00b3bb80); /* WARNING: Could not recover jumptable at 0x00a47890. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3ub)(); return; } //@@ 00a478a0 FUN_00a478a0 void FUN_00a478a0(void) { epoxy_glSecondaryColor3ubEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a248); /* WARNING: Could not recover jumptable at 0x00a478c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3ubEXT)(); return; } //@@ 00a478d0 FUN_00a478d0 void FUN_00a478d0(void) { epoxy_glSecondaryColor3ubv = (undefined *)FUN_00a2ca10(&DAT_00b26868); /* WARNING: Could not recover jumptable at 0x00a478f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3ubv)(); return; } //@@ 00a47900 FUN_00a47900 void FUN_00a47900(void) { epoxy_glSecondaryColor3ubvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b3e0); /* WARNING: Could not recover jumptable at 0x00a47920. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3ubvEXT)(); return; } //@@ 00a47930 FUN_00a47930 void FUN_00a47930(void) { epoxy_glSecondaryColor3ui = (undefined *)FUN_00a2ca10(&DAT_00b28238); /* WARNING: Could not recover jumptable at 0x00a47950. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3ui)(); return; } //@@ 00a47960 FUN_00a47960 void FUN_00a47960(void) { epoxy_glSecondaryColor3uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b25e20); /* WARNING: Could not recover jumptable at 0x00a47980. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3uiEXT)(); return; } //@@ 00a47990 FUN_00a47990 void FUN_00a47990(void) { epoxy_glSecondaryColor3uiv = (undefined *)FUN_00a2ca10(&DAT_00b263d8); /* WARNING: Could not recover jumptable at 0x00a479b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3uiv)(); return; } //@@ 00a479c0 FUN_00a479c0 void FUN_00a479c0(void) { epoxy_glSecondaryColor3uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b28404); /* WARNING: Could not recover jumptable at 0x00a479e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3uivEXT)(); return; } //@@ 00a479f0 FUN_00a479f0 void FUN_00a479f0(void) { epoxy_glSecondaryColor3us = (undefined *)FUN_00a2ca10(&DAT_00b29bd0); /* WARNING: Could not recover jumptable at 0x00a47a10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3us)(); return; } //@@ 00a47a20 FUN_00a47a20 void FUN_00a47a20(void) { epoxy_glSecondaryColor3usEXT = (undefined *)FUN_00a2ca10(&DAT_00b3bd24); /* WARNING: Could not recover jumptable at 0x00a47a40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3usEXT)(); return; } //@@ 00a47a50 FUN_00a47a50 void FUN_00a47a50(void) { epoxy_glSecondaryColor3usv = (undefined *)FUN_00a2ca10(&DAT_00b3b960); /* WARNING: Could not recover jumptable at 0x00a47a70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3usv)(); return; } //@@ 00a47a80 FUN_00a47a80 void FUN_00a47a80(void) { epoxy_glSecondaryColor3usvEXT = (undefined *)FUN_00a2ca10(&DAT_00b26274); /* WARNING: Could not recover jumptable at 0x00a47aa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColor3usvEXT)(); return; } //@@ 00a47ab0 FUN_00a47ab0 void FUN_00a47ab0(void) { epoxy_glSecondaryColorFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47ac8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColorFormatNV)(); return; } //@@ 00a47ad0 FUN_00a47ad0 void FUN_00a47ad0(void) { epoxy_glSecondaryColorP3ui = (undefined *)FUN_00a2ca10(&DAT_00b3d6c4); /* WARNING: Could not recover jumptable at 0x00a47af0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColorP3ui)(); return; } //@@ 00a47b00 FUN_00a47b00 void FUN_00a47b00(void) { epoxy_glSecondaryColorP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b299d0); /* WARNING: Could not recover jumptable at 0x00a47b20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColorP3uiv)(); return; } //@@ 00a47b30 FUN_00a47b30 void FUN_00a47b30(void) { epoxy_glSecondaryColorPointer = (undefined *)FUN_00a2ca10(&DAT_00b26108); /* WARNING: Could not recover jumptable at 0x00a47b50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColorPointer)(); return; } //@@ 00a47b60 FUN_00a47b60 void FUN_00a47b60(void) { epoxy_glSecondaryColorPointerEXT = (undefined *)FUN_00a2ca10(&DAT_00b3bcb4); /* WARNING: Could not recover jumptable at 0x00a47b80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColorPointerEXT)(); return; } //@@ 00a47b90 FUN_00a47b90 void FUN_00a47b90(void) { epoxy_glSecondaryColorPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47ba8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSecondaryColorPointerListIBM)(); return; } //@@ 00a47bb0 FUN_00a47bb0 void FUN_00a47bb0(void) { epoxy_glSelectBuffer = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47bc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSelectBuffer)(); return; } //@@ 00a47bd0 FUN_00a47bd0 void FUN_00a47bd0(void) { epoxy_glSelectPerfMonitorCountersAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47be8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSelectPerfMonitorCountersAMD)(); return; } //@@ 00a47bf0 FUN_00a47bf0 void FUN_00a47bf0(void) { epoxy_glSeparableFilter2D = (undefined *)FUN_00a2ca10(&DAT_00b2b0e0); /* WARNING: Could not recover jumptable at 0x00a47c10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSeparableFilter2D)(); return; } //@@ 00a47c20 FUN_00a47c20 void FUN_00a47c20(void) { epoxy_glSeparableFilter2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b25414); /* WARNING: Could not recover jumptable at 0x00a47c40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSeparableFilter2DEXT)(); return; } //@@ 00a47c50 FUN_00a47c50 void FUN_00a47c50(void) { epoxy_glSetFenceAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47c68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSetFenceAPPLE)(); return; } //@@ 00a47c70 FUN_00a47c70 void FUN_00a47c70(void) { epoxy_glSetFenceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47c88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSetFenceNV)(); return; } //@@ 00a47c90 FUN_00a47c90 void FUN_00a47c90(void) { epoxy_glSetFragmentShaderConstantATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47ca8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSetFragmentShaderConstantATI)(); return; } //@@ 00a47cb0 FUN_00a47cb0 void FUN_00a47cb0(void) { epoxy_glSetInvariantEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47cc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSetInvariantEXT)(); return; } //@@ 00a47cd0 FUN_00a47cd0 void FUN_00a47cd0(void) { epoxy_glSetLocalConstantEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47ce8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSetLocalConstantEXT)(); return; } //@@ 00a47cf0 FUN_00a47cf0 void FUN_00a47cf0(void) { epoxy_glSetMultisamplefvAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47d08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSetMultisamplefvAMD)(); return; } //@@ 00a47d10 FUN_00a47d10 void FUN_00a47d10(void) { epoxy_glShadeModel = (undefined *)FUN_00a2ca10(&DAT_00b3b3f8); /* WARNING: Could not recover jumptable at 0x00a47d30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShadeModel)(); return; } //@@ 00a47d40 FUN_00a47d40 void FUN_00a47d40(void) { epoxy_glShaderBinary = (undefined *)FUN_00a2ca10(&DAT_00b3c580); /* WARNING: Could not recover jumptable at 0x00a47d60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderBinary)(); return; } //@@ 00a47d70 FUN_00a47d70 void FUN_00a47d70(void) { epoxy_glShaderOp1EXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47d88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderOp1EXT)(); return; } //@@ 00a47d90 FUN_00a47d90 void FUN_00a47d90(void) { epoxy_glShaderOp2EXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderOp2EXT)(); return; } //@@ 00a47db0 FUN_00a47db0 void FUN_00a47db0(void) { epoxy_glShaderOp3EXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47dc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderOp3EXT)(); return; } //@@ 00a47dd0 FUN_00a47dd0 void FUN_00a47dd0(void) { epoxy_glShaderSource = (undefined *)FUN_00a2ca10(&DAT_00b29490); /* WARNING: Could not recover jumptable at 0x00a47df0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderSource)(); return; } //@@ 00a47e00 FUN_00a47e00 void FUN_00a47e00(void) { epoxy_glShaderSourceARB = (undefined *)FUN_00a2ca10(&DAT_00b259c0); /* WARNING: Could not recover jumptable at 0x00a47e20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderSourceARB)(); return; } //@@ 00a47e30 FUN_00a47e30 void FUN_00a47e30(void) { epoxy_glShaderStorageBlockBinding = (undefined *)FUN_00a2ca10(&DAT_00b28ef4); /* WARNING: Could not recover jumptable at 0x00a47e50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glShaderStorageBlockBinding)(); return; } //@@ 00a47e60 FUN_00a47e60 void FUN_00a47e60(void) { epoxy_glSharpenTexFuncSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47e78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSharpenTexFuncSGIS)(); return; } //@@ 00a47e80 FUN_00a47e80 void FUN_00a47e80(undefined4 param_1,undefined4 param_2) { epoxy_glSpriteParameterfSGIX = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glSpriteParameterfSGIX)(param_1,param_2); return; } //@@ 00a47eb0 FUN_00a47eb0 void FUN_00a47eb0(void) { epoxy_glSpriteParameterfvSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47ec8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSpriteParameterfvSGIX)(); return; } //@@ 00a47ed0 FUN_00a47ed0 void FUN_00a47ed0(void) { epoxy_glSpriteParameteriSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47ee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSpriteParameteriSGIX)(); return; } //@@ 00a47ef0 FUN_00a47ef0 void FUN_00a47ef0(void) { epoxy_glSpriteParameterivSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47f08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSpriteParameterivSGIX)(); return; } //@@ 00a47f30 FUN_00a47f30 void FUN_00a47f30(void) { epoxy_glStartTilingQCOM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47f48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStartTilingQCOM)(); return; } //@@ 00a47f50 FUN_00a47f50 void FUN_00a47f50(void) { epoxy_glStateCaptureNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47f68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStateCaptureNV)(); return; } //@@ 00a47f70 FUN_00a47f70 void FUN_00a47f70(void) { epoxy_glStencilClearTagEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47f88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilClearTagEXT)(); return; } //@@ 00a47f90 FUN_00a47f90 void FUN_00a47f90(void) { epoxy_glStencilFillPathInstancedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47fa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilFillPathInstancedNV)(); return; } //@@ 00a47fb0 FUN_00a47fb0 void FUN_00a47fb0(void) { epoxy_glStencilFillPathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a47fc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilFillPathNV)(); return; } //@@ 00a47fd0 FUN_00a47fd0 void FUN_00a47fd0(void) { epoxy_glStencilFunc = (undefined *)FUN_00a2ca10(&DAT_00b27f48); /* WARNING: Could not recover jumptable at 0x00a47ff0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilFunc)(); return; } //@@ 00a48000 FUN_00a48000 void FUN_00a48000(void) { epoxy_glStencilFuncSeparate = (undefined *)FUN_00a2ca10(&DAT_00b3c480); /* WARNING: Could not recover jumptable at 0x00a48020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilFuncSeparate)(); return; } //@@ 00a48030 FUN_00a48030 void FUN_00a48030(void) { epoxy_glStencilFuncSeparateATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilFuncSeparateATI)(); return; } //@@ 00a48050 FUN_00a48050 void FUN_00a48050(void) { epoxy_glStencilMask = (undefined *)FUN_00a2ca10(&DAT_00b27788); /* WARNING: Could not recover jumptable at 0x00a48070. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilMask)(); return; } //@@ 00a48080 FUN_00a48080 void FUN_00a48080(void) { epoxy_glStencilMaskSeparate = (undefined *)FUN_00a2ca10(&DAT_00b3c0c8); /* WARNING: Could not recover jumptable at 0x00a480a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilMaskSeparate)(); return; } //@@ 00a480b0 FUN_00a480b0 void FUN_00a480b0(void) { epoxy_glStencilOp = (undefined *)FUN_00a2ca10(&DAT_00b26ca0); /* WARNING: Could not recover jumptable at 0x00a480d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilOp)(); return; } //@@ 00a480e0 FUN_00a480e0 void FUN_00a480e0(void) { epoxy_glStencilOpSeparate = (undefined *)FUN_00a2ca10(&DAT_00b2a880); /* WARNING: Could not recover jumptable at 0x00a48100. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilOpSeparate)(); return; } //@@ 00a48110 FUN_00a48110 void FUN_00a48110(void) { epoxy_glStencilOpSeparateATI = (undefined *)FUN_00a2ca10(&DAT_00b25398); /* WARNING: Could not recover jumptable at 0x00a48130. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilOpSeparateATI)(); return; } //@@ 00a48140 FUN_00a48140 void FUN_00a48140(void) { epoxy_glStencilOpValueAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48158. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilOpValueAMD)(); return; } //@@ 00a48160 FUN_00a48160 void FUN_00a48160(void) { epoxy_glStencilStrokePathInstancedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48178. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilStrokePathInstancedNV)(); return; } //@@ 00a48180 FUN_00a48180 void FUN_00a48180(void) { epoxy_glStencilStrokePathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48198. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilStrokePathNV)(); return; } //@@ 00a481a0 FUN_00a481a0 void FUN_00a481a0(void) { epoxy_glStencilThenCoverFillPathInstancedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a481b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilThenCoverFillPathInstancedNV)(); return; } //@@ 00a481c0 FUN_00a481c0 void FUN_00a481c0(void) { epoxy_glStencilThenCoverFillPathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a481d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilThenCoverFillPathNV)(); return; } //@@ 00a481e0 FUN_00a481e0 void FUN_00a481e0(void) { epoxy_glStencilThenCoverStrokePathInstancedNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a481f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilThenCoverStrokePathInstancedNV)(); return; } //@@ 00a48200 FUN_00a48200 void FUN_00a48200(void) { epoxy_glStencilThenCoverStrokePathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48218. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStencilThenCoverStrokePathNV)(); return; } //@@ 00a48220 FUN_00a48220 void FUN_00a48220(void) { epoxy_glStopInstrumentsSGIX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48238. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStopInstrumentsSGIX)(); return; } //@@ 00a48240 FUN_00a48240 void FUN_00a48240(void) { epoxy_glStringMarkerGREMEDY = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48258. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glStringMarkerGREMEDY)(); return; } //@@ 00a48260 FUN_00a48260 void FUN_00a48260(void) { epoxy_glSubpixelPrecisionBiasNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48278. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSubpixelPrecisionBiasNV)(); return; } //@@ 00a48280 FUN_00a48280 void FUN_00a48280(void) { epoxy_glSwizzleEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48298. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSwizzleEXT)(); return; } //@@ 00a482a0 FUN_00a482a0 void FUN_00a482a0(void) { epoxy_glSyncTextureINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a482b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glSyncTextureINTEL)(); return; } //@@ 00a482e0 FUN_00a482e0 void FUN_00a482e0(void) { epoxy_glTangent3bEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a482f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3bEXT)(); return; } //@@ 00a48300 FUN_00a48300 void FUN_00a48300(void) { epoxy_glTangent3bvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3bvEXT)(); return; } //@@ 00a48320 FUN_00a48320 void FUN_00a48320(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glTangent3dEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTangent3dEXT)(param_1,param_2,param_3); return; } //@@ 00a48370 FUN_00a48370 void FUN_00a48370(void) { epoxy_glTangent3dvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3dvEXT)(); return; } //@@ 00a48390 FUN_00a48390 void FUN_00a48390(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTangent3fEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTangent3fEXT)(param_1,param_2,param_3); return; } //@@ 00a483d0 FUN_00a483d0 void FUN_00a483d0(void) { epoxy_glTangent3fvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a483e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3fvEXT)(); return; } //@@ 00a483f0 FUN_00a483f0 void FUN_00a483f0(void) { epoxy_glTangent3iEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48408. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3iEXT)(); return; } //@@ 00a48410 FUN_00a48410 void FUN_00a48410(void) { epoxy_glTangent3ivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48428. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3ivEXT)(); return; } //@@ 00a48430 FUN_00a48430 void FUN_00a48430(void) { epoxy_glTangent3sEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48448. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3sEXT)(); return; } //@@ 00a48450 FUN_00a48450 void FUN_00a48450(void) { epoxy_glTangent3svEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangent3svEXT)(); return; } //@@ 00a48470 FUN_00a48470 void FUN_00a48470(void) { epoxy_glTangentPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48488. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTangentPointerEXT)(); return; } //@@ 00a48490 FUN_00a48490 void FUN_00a48490(void) { epoxy_glTbufferMask3DFX = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a484a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTbufferMask3DFX)(); return; } //@@ 00a484b0 FUN_00a484b0 void FUN_00a484b0(undefined4 param_1) { epoxy_glTessellationFactorAMD = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTessellationFactorAMD)(param_1); return; } //@@ 00a484e0 FUN_00a484e0 void FUN_00a484e0(void) { epoxy_glTessellationModeAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a484f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTessellationModeAMD)(); return; } //@@ 00a48500 FUN_00a48500 void FUN_00a48500(void) { epoxy_glTestFenceAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48518. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTestFenceAPPLE)(); return; } //@@ 00a48520 FUN_00a48520 void FUN_00a48520(void) { epoxy_glTestFenceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48538. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTestFenceNV)(); return; } //@@ 00a48540 FUN_00a48540 void FUN_00a48540(void) { epoxy_glTestObjectAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48558. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTestObjectAPPLE)(); return; } //@@ 00a48560 FUN_00a48560 void FUN_00a48560(void) { epoxy_glTexBuffer = (undefined *)FUN_00a2ca10(&DAT_00b271fc); /* WARNING: Could not recover jumptable at 0x00a48580. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBuffer)(); return; } //@@ 00a48590 FUN_00a48590 void FUN_00a48590(void) { epoxy_glTexBufferARB = (undefined *)FUN_00a2ca10(&DAT_00b3b728); /* WARNING: Could not recover jumptable at 0x00a485b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBufferARB)(); return; } //@@ 00a485c0 FUN_00a485c0 void FUN_00a485c0(void) { epoxy_glTexBufferEXT = (undefined *)FUN_00a2ca10(&DAT_00b29090); /* WARNING: Could not recover jumptable at 0x00a485e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBufferEXT)(); return; } //@@ 00a485f0 FUN_00a485f0 void FUN_00a485f0(void) { epoxy_glTexBufferOES = (undefined *)FUN_00a2ca10(&DAT_00b3b0b4); /* WARNING: Could not recover jumptable at 0x00a48610. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBufferOES)(); return; } //@@ 00a48620 FUN_00a48620 void FUN_00a48620(void) { epoxy_glTexBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b27b58); /* WARNING: Could not recover jumptable at 0x00a48640. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBufferRange)(); return; } //@@ 00a48650 FUN_00a48650 void FUN_00a48650(void) { epoxy_glTexBufferRangeEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c9f0); /* WARNING: Could not recover jumptable at 0x00a48670. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBufferRangeEXT)(); return; } //@@ 00a48680 FUN_00a48680 void FUN_00a48680(void) { epoxy_glTexBufferRangeOES = (undefined *)FUN_00a2ca10(&DAT_00b28b8c); /* WARNING: Could not recover jumptable at 0x00a486a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBufferRangeOES)(); return; } //@@ 00a486b0 FUN_00a486b0 void FUN_00a486b0(void) { epoxy_glTexBumpParameterfvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a486c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBumpParameterfvATI)(); return; } //@@ 00a486d0 FUN_00a486d0 void FUN_00a486d0(void) { epoxy_glTexBumpParameterivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a486e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexBumpParameterivATI)(); return; } //@@ 00a486f0 FUN_00a486f0 void FUN_00a486f0(void) { epoxy_glTexCoord1bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1bOES)(); return; } //@@ 00a48710 FUN_00a48710 void FUN_00a48710(void) { epoxy_glTexCoord1bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48728. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1bvOES)(); return; } //@@ 00a48730 FUN_00a48730 void FUN_00a48730(undefined8 param_1) { epoxy_glTexCoord1d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord1d)(param_1); return; } //@@ 00a48760 FUN_00a48760 void FUN_00a48760(void) { epoxy_glTexCoord1dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48778. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1dv)(); return; } //@@ 00a48780 FUN_00a48780 void FUN_00a48780(undefined4 param_1) { epoxy_glTexCoord1f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord1f)(param_1); return; } //@@ 00a487b0 FUN_00a487b0 void FUN_00a487b0(void) { epoxy_glTexCoord1fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a487c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1fv)(); return; } //@@ 00a487d0 FUN_00a487d0 void FUN_00a487d0(void) { epoxy_glTexCoord1hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a487e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1hNV)(); return; } //@@ 00a487f0 FUN_00a487f0 void FUN_00a487f0(void) { epoxy_glTexCoord1hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48808. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1hvNV)(); return; } //@@ 00a48810 FUN_00a48810 void FUN_00a48810(void) { epoxy_glTexCoord1i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48828. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1i)(); return; } //@@ 00a48830 FUN_00a48830 void FUN_00a48830(void) { epoxy_glTexCoord1iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48848. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1iv)(); return; } //@@ 00a48850 FUN_00a48850 void FUN_00a48850(void) { epoxy_glTexCoord1s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1s)(); return; } //@@ 00a48870 FUN_00a48870 void FUN_00a48870(void) { epoxy_glTexCoord1sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1sv)(); return; } //@@ 00a48890 FUN_00a48890 void FUN_00a48890(void) { epoxy_glTexCoord1xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a488a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1xOES)(); return; } //@@ 00a488b0 FUN_00a488b0 void FUN_00a488b0(void) { epoxy_glTexCoord1xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a488c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord1xvOES)(); return; } //@@ 00a488d0 FUN_00a488d0 void FUN_00a488d0(void) { epoxy_glTexCoord2bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a488e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2bOES)(); return; } //@@ 00a488f0 FUN_00a488f0 void FUN_00a488f0(void) { epoxy_glTexCoord2bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48908. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2bvOES)(); return; } //@@ 00a48910 FUN_00a48910 void FUN_00a48910(undefined8 param_1,undefined8 param_2) { epoxy_glTexCoord2d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2d)(param_1,param_2); return; } //@@ 00a48950 FUN_00a48950 void FUN_00a48950(void) { epoxy_glTexCoord2dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48968. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2dv)(); return; } //@@ 00a48970 FUN_00a48970 void FUN_00a48970(undefined4 param_1,undefined4 param_2) { epoxy_glTexCoord2f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2f)(param_1,param_2); return; } //@@ 00a489b0 FUN_00a489b0 void FUN_00a489b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glTexCoord2fColor3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2fColor3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a48a30 FUN_00a48a30 void FUN_00a48a30(void) { epoxy_glTexCoord2fColor3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48a48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2fColor3fVertex3fvSUN)(); return; } //@@ 00a48a50 FUN_00a48a50 void FUN_00a48a50(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12) { epoxy_glTexCoord2fColor4fNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2fColor4fNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12); return; } //@@ 00a48b00 FUN_00a48b00 void FUN_00a48b00(void) { epoxy_glTexCoord2fColor4fNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48b18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2fColor4fNormal3fVertex3fvSUN)(); return; } //@@ 00a48b20 FUN_00a48b20 void FUN_00a48b20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glTexCoord2fColor4ubVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2fColor4ubVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a48b90 FUN_00a48b90 void FUN_00a48b90(void) { epoxy_glTexCoord2fColor4ubVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48ba8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2fColor4ubVertex3fvSUN)(); return; } //@@ 00a48bb0 FUN_00a48bb0 void FUN_00a48bb0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glTexCoord2fNormal3fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2fNormal3fVertex3fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a48c30 FUN_00a48c30 void FUN_00a48c30(void) { epoxy_glTexCoord2fNormal3fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48c48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2fNormal3fVertex3fvSUN)(); return; } //@@ 00a48c50 FUN_00a48c50 void FUN_00a48c50(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glTexCoord2fVertex3fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord2fVertex3fSUN)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a48cb0 FUN_00a48cb0 void FUN_00a48cb0(void) { epoxy_glTexCoord2fVertex3fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48cc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2fVertex3fvSUN)(); return; } //@@ 00a48cd0 FUN_00a48cd0 void FUN_00a48cd0(void) { epoxy_glTexCoord2fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48ce8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2fv)(); return; } //@@ 00a48cf0 FUN_00a48cf0 void FUN_00a48cf0(void) { epoxy_glTexCoord2hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48d08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2hNV)(); return; } //@@ 00a48d10 FUN_00a48d10 void FUN_00a48d10(void) { epoxy_glTexCoord2hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48d28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2hvNV)(); return; } //@@ 00a48d30 FUN_00a48d30 void FUN_00a48d30(void) { epoxy_glTexCoord2i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48d48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2i)(); return; } //@@ 00a48d50 FUN_00a48d50 void FUN_00a48d50(void) { epoxy_glTexCoord2iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48d68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2iv)(); return; } //@@ 00a48d70 FUN_00a48d70 void FUN_00a48d70(void) { epoxy_glTexCoord2s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48d88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2s)(); return; } //@@ 00a48d90 FUN_00a48d90 void FUN_00a48d90(void) { epoxy_glTexCoord2sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2sv)(); return; } //@@ 00a48db0 FUN_00a48db0 void FUN_00a48db0(void) { epoxy_glTexCoord2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48dc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2xOES)(); return; } //@@ 00a48dd0 FUN_00a48dd0 void FUN_00a48dd0(void) { epoxy_glTexCoord2xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48de8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord2xvOES)(); return; } //@@ 00a48df0 FUN_00a48df0 void FUN_00a48df0(void) { epoxy_glTexCoord3bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48e08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3bOES)(); return; } //@@ 00a48e10 FUN_00a48e10 void FUN_00a48e10(void) { epoxy_glTexCoord3bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48e28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3bvOES)(); return; } //@@ 00a48e30 FUN_00a48e30 void FUN_00a48e30(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glTexCoord3d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord3d)(param_1,param_2,param_3); return; } //@@ 00a48e80 FUN_00a48e80 void FUN_00a48e80(void) { epoxy_glTexCoord3dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48e98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3dv)(); return; } //@@ 00a48ea0 FUN_00a48ea0 void FUN_00a48ea0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTexCoord3f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord3f)(param_1,param_2,param_3); return; } //@@ 00a48ee0 FUN_00a48ee0 void FUN_00a48ee0(void) { epoxy_glTexCoord3fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48ef8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3fv)(); return; } //@@ 00a48f00 FUN_00a48f00 void FUN_00a48f00(void) { epoxy_glTexCoord3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48f18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3hNV)(); return; } //@@ 00a48f20 FUN_00a48f20 void FUN_00a48f20(void) { epoxy_glTexCoord3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48f38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3hvNV)(); return; } //@@ 00a48f40 FUN_00a48f40 void FUN_00a48f40(void) { epoxy_glTexCoord3i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48f58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3i)(); return; } //@@ 00a48f60 FUN_00a48f60 void FUN_00a48f60(void) { epoxy_glTexCoord3iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3iv)(); return; } //@@ 00a48f80 FUN_00a48f80 void FUN_00a48f80(void) { epoxy_glTexCoord3s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48f98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3s)(); return; } //@@ 00a48fa0 FUN_00a48fa0 void FUN_00a48fa0(void) { epoxy_glTexCoord3sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48fb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3sv)(); return; } //@@ 00a48fc0 FUN_00a48fc0 void FUN_00a48fc0(void) { epoxy_glTexCoord3xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48fd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3xOES)(); return; } //@@ 00a48fe0 FUN_00a48fe0 void FUN_00a48fe0(void) { epoxy_glTexCoord3xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a48ff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord3xvOES)(); return; } //@@ 00a49000 FUN_00a49000 void FUN_00a49000(void) { epoxy_glTexCoord4bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49018. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4bOES)(); return; } //@@ 00a49020 FUN_00a49020 void FUN_00a49020(void) { epoxy_glTexCoord4bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49038. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4bvOES)(); return; } //@@ 00a49040 FUN_00a49040 void FUN_00a49040(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glTexCoord4d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord4d)(param_1,param_2,param_3,param_4); return; } //@@ 00a49090 FUN_00a49090 void FUN_00a49090(void) { epoxy_glTexCoord4dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a490a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4dv)(); return; } //@@ 00a490b0 FUN_00a490b0 void FUN_00a490b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glTexCoord4f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord4f)(param_1,param_2,param_3,param_4); return; } //@@ 00a49100 FUN_00a49100 void FUN_00a49100(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12, undefined4 param_13,undefined4 param_14,undefined4 param_15) { epoxy_glTexCoord4fColor4fNormal3fVertex4fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord4fColor4fNormal3fVertex4fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10, param_11,param_12,param_13,param_14,param_15); return; } //@@ 00a491d0 FUN_00a491d0 void FUN_00a491d0(void) { epoxy_glTexCoord4fColor4fNormal3fVertex4fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a491e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4fColor4fNormal3fVertex4fvSUN)(); return; } //@@ 00a491f0 FUN_00a491f0 void FUN_00a491f0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_glTexCoord4fVertex4fSUN = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexCoord4fVertex4fSUN) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a49270 FUN_00a49270 void FUN_00a49270(void) { epoxy_glTexCoord4fVertex4fvSUN = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49288. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4fVertex4fvSUN)(); return; } //@@ 00a49290 FUN_00a49290 void FUN_00a49290(void) { epoxy_glTexCoord4fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a492a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4fv)(); return; } //@@ 00a492b0 FUN_00a492b0 void FUN_00a492b0(void) { epoxy_glTexCoord4hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a492c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4hNV)(); return; } //@@ 00a492d0 FUN_00a492d0 void FUN_00a492d0(void) { epoxy_glTexCoord4hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a492e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4hvNV)(); return; } //@@ 00a492f0 FUN_00a492f0 void FUN_00a492f0(void) { epoxy_glTexCoord4i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4i)(); return; } //@@ 00a49310 FUN_00a49310 void FUN_00a49310(void) { epoxy_glTexCoord4iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4iv)(); return; } //@@ 00a49330 FUN_00a49330 void FUN_00a49330(void) { epoxy_glTexCoord4s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4s)(); return; } //@@ 00a49350 FUN_00a49350 void FUN_00a49350(void) { epoxy_glTexCoord4sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4sv)(); return; } //@@ 00a49370 FUN_00a49370 void FUN_00a49370(void) { epoxy_glTexCoord4xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4xOES)(); return; } //@@ 00a49390 FUN_00a49390 void FUN_00a49390(void) { epoxy_glTexCoord4xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a493a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoord4xvOES)(); return; } //@@ 00a493b0 FUN_00a493b0 void FUN_00a493b0(void) { epoxy_glTexCoordFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a493c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordFormatNV)(); return; } //@@ 00a493d0 FUN_00a493d0 void FUN_00a493d0(void) { epoxy_glTexCoordP1ui = (undefined *)FUN_00a2ca10(&DAT_00b3b798); /* WARNING: Could not recover jumptable at 0x00a493f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP1ui)(); return; } //@@ 00a49400 FUN_00a49400 void FUN_00a49400(void) { epoxy_glTexCoordP1uiv = (undefined *)FUN_00a2ca10(&DAT_00b2a6bc); /* WARNING: Could not recover jumptable at 0x00a49420. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP1uiv)(); return; } //@@ 00a49430 FUN_00a49430 void FUN_00a49430(void) { epoxy_glTexCoordP2ui = (undefined *)FUN_00a2ca10(&DAT_00b29f44); /* WARNING: Could not recover jumptable at 0x00a49450. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP2ui)(); return; } //@@ 00a49460 FUN_00a49460 void FUN_00a49460(void) { epoxy_glTexCoordP2uiv = (undefined *)FUN_00a2ca10(&DAT_00b3b29c); /* WARNING: Could not recover jumptable at 0x00a49480. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP2uiv)(); return; } //@@ 00a49490 FUN_00a49490 void FUN_00a49490(void) { epoxy_glTexCoordP3ui = (undefined *)FUN_00a2ca10(&DAT_00b26090); /* WARNING: Could not recover jumptable at 0x00a494b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP3ui)(); return; } //@@ 00a494c0 FUN_00a494c0 void FUN_00a494c0(void) { epoxy_glTexCoordP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b3b854); /* WARNING: Could not recover jumptable at 0x00a494e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP3uiv)(); return; } //@@ 00a494f0 FUN_00a494f0 void FUN_00a494f0(void) { epoxy_glTexCoordP4ui = (undefined *)FUN_00a2ca10(&DAT_00b3c0cc); /* WARNING: Could not recover jumptable at 0x00a49510. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP4ui)(); return; } //@@ 00a49520 FUN_00a49520 void FUN_00a49520(void) { epoxy_glTexCoordP4uiv = (undefined *)FUN_00a2ca10(&DAT_00b289a0); /* WARNING: Could not recover jumptable at 0x00a49540. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordP4uiv)(); return; } //@@ 00a49550 FUN_00a49550 void FUN_00a49550(void) { epoxy_glTexCoordPointer = (undefined *)FUN_00a2ca10(&DAT_00b3d61c); /* WARNING: Could not recover jumptable at 0x00a49570. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordPointer)(); return; } //@@ 00a49580 FUN_00a49580 void FUN_00a49580(void) { epoxy_glTexCoordPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordPointerEXT)(); return; } //@@ 00a495a0 FUN_00a495a0 void FUN_00a495a0(void) { epoxy_glTexCoordPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a495b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordPointerListIBM)(); return; } //@@ 00a495c0 FUN_00a495c0 void FUN_00a495c0(void) { epoxy_glTexCoordPointervINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a495d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexCoordPointervINTEL)(); return; } //@@ 00a495e0 FUN_00a495e0 void FUN_00a495e0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTexEnvf = (undefined *)FUN_00a2ca10(0xb3c71c); (*(code *)epoxy_glTexEnvf)(param_1,param_2,param_3); return; } //@@ 00a49620 FUN_00a49620 void FUN_00a49620(void) { epoxy_glTexEnvfv = (undefined *)FUN_00a2ca10(&DAT_00b2a2ec); /* WARNING: Could not recover jumptable at 0x00a49640. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnvfv)(); return; } //@@ 00a49650 FUN_00a49650 void FUN_00a49650(void) { epoxy_glTexEnvi = (undefined *)FUN_00a2ca10(&DAT_00b292a8); /* WARNING: Could not recover jumptable at 0x00a49670. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnvi)(); return; } //@@ 00a49680 FUN_00a49680 void FUN_00a49680(void) { epoxy_glTexEnviv = (undefined *)FUN_00a2ca10(&DAT_00b2a844); /* WARNING: Could not recover jumptable at 0x00a496a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnviv)(); return; } //@@ 00a496b0 FUN_00a496b0 void FUN_00a496b0(void) { epoxy_glTexEnvx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a496c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnvx)(); return; } //@@ 00a496d0 FUN_00a496d0 void FUN_00a496d0(void) { epoxy_glTexEnvxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a496e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnvxOES)(); return; } //@@ 00a496f0 FUN_00a496f0 void FUN_00a496f0(void) { epoxy_glTexEnvxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnvxv)(); return; } //@@ 00a49710 FUN_00a49710 void FUN_00a49710(void) { epoxy_glTexEnvxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49728. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexEnvxvOES)(); return; } //@@ 00a49730 FUN_00a49730 void FUN_00a49730(void) { epoxy_glTexFilterFuncSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexFilterFuncSGIS)(); return; } //@@ 00a49750 FUN_00a49750 void FUN_00a49750(undefined4 param_1,undefined4 param_2,undefined8 param_3) { epoxy_glTexGend = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexGend)(param_1,param_2,param_3); return; } //@@ 00a49780 FUN_00a49780 void FUN_00a49780(void) { epoxy_glTexGendv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49798. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGendv)(); return; } //@@ 00a497a0 FUN_00a497a0 void FUN_00a497a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTexGenf = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexGenf)(param_1,param_2,param_3); return; } //@@ 00a497d0 FUN_00a497d0 void FUN_00a497d0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTexGenfOES = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTexGenfOES)(param_1,param_2,param_3); return; } //@@ 00a49800 FUN_00a49800 void FUN_00a49800(void) { epoxy_glTexGenfv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGenfv)(); return; } //@@ 00a49820 FUN_00a49820 void FUN_00a49820(void) { epoxy_glTexGenfvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49838. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGenfvOES)(); return; } //@@ 00a49840 FUN_00a49840 void FUN_00a49840(void) { epoxy_glTexGeni = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49858. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGeni)(); return; } //@@ 00a49860 FUN_00a49860 void FUN_00a49860(void) { epoxy_glTexGeniOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49878. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGeniOES)(); return; } //@@ 00a49880 FUN_00a49880 void FUN_00a49880(void) { epoxy_glTexGeniv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49898. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGeniv)(); return; } //@@ 00a498a0 FUN_00a498a0 void FUN_00a498a0(void) { epoxy_glTexGenivOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a498b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGenivOES)(); return; } //@@ 00a498c0 FUN_00a498c0 void FUN_00a498c0(void) { epoxy_glTexGenxOES = (undefined *)FUN_00a2ca10(&DAT_00b259a8); /* WARNING: Could not recover jumptable at 0x00a498e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGenxOES)(); return; } //@@ 00a498f0 FUN_00a498f0 void FUN_00a498f0(void) { epoxy_glTexGenxvOES = (undefined *)FUN_00a2ca10(&DAT_00b29138); /* WARNING: Could not recover jumptable at 0x00a49910. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexGenxvOES)(); return; } //@@ 00a49920 FUN_00a49920 void FUN_00a49920(void) { epoxy_glTexImage1D = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage1D)(); return; } //@@ 00a49940 FUN_00a49940 void FUN_00a49940(void) { epoxy_glTexImage2D = (undefined *)FUN_00a2ca10(&DAT_00b3cdf0); /* WARNING: Could not recover jumptable at 0x00a49960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage2D)(); return; } //@@ 00a49970 FUN_00a49970 void FUN_00a49970(void) { epoxy_glTexImage2DMultisample = (undefined *)FUN_00a2ca10(&DAT_00b3cf78); /* WARNING: Could not recover jumptable at 0x00a49990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage2DMultisample)(); return; } //@@ 00a499a0 FUN_00a499a0 void FUN_00a499a0(void) { epoxy_glTexImage2DMultisampleCoverageNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a499b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage2DMultisampleCoverageNV)(); return; } //@@ 00a499c0 FUN_00a499c0 void FUN_00a499c0(void) { epoxy_glTexImage3D = (undefined *)FUN_00a2ca10(&DAT_00b26364); /* WARNING: Could not recover jumptable at 0x00a499e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage3D)(); return; } //@@ 00a499f0 FUN_00a499f0 void FUN_00a499f0(void) { epoxy_glTexImage3DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3aee4); /* WARNING: Could not recover jumptable at 0x00a49a10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage3DEXT)(); return; } //@@ 00a49a20 FUN_00a49a20 void FUN_00a49a20(void) { epoxy_glTexImage3DMultisample = (undefined *)FUN_00a2ca10(&DAT_00b29f34); /* WARNING: Could not recover jumptable at 0x00a49a40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage3DMultisample)(); return; } //@@ 00a49a50 FUN_00a49a50 void FUN_00a49a50(void) { epoxy_glTexImage3DMultisampleCoverageNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49a68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage3DMultisampleCoverageNV)(); return; } //@@ 00a49a70 FUN_00a49a70 void FUN_00a49a70(void) { epoxy_glTexImage3DOES = (undefined *)FUN_00a2ca10(&DAT_00b2a2f8); /* WARNING: Could not recover jumptable at 0x00a49a90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage3DOES)(); return; } //@@ 00a49aa0 FUN_00a49aa0 void FUN_00a49aa0(void) { epoxy_glTexImage4DSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49ab8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexImage4DSGIS)(); return; } //@@ 00a49ac0 FUN_00a49ac0 void FUN_00a49ac0(void) { epoxy_glTexPageCommitmentARB = (undefined *)FUN_00a2ca10(&DAT_00b25604); /* WARNING: Could not recover jumptable at 0x00a49ae0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexPageCommitmentARB)(); return; } //@@ 00a49af0 FUN_00a49af0 void FUN_00a49af0(void) { epoxy_glTexPageCommitmentEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cf68); /* WARNING: Could not recover jumptable at 0x00a49b10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexPageCommitmentEXT)(); return; } //@@ 00a49b20 FUN_00a49b20 void FUN_00a49b20(void) { epoxy_glTexParameterIiv = (undefined *)FUN_00a2ca10(&DAT_00b280c4); /* WARNING: Could not recover jumptable at 0x00a49b40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterIiv)(); return; } //@@ 00a49b50 FUN_00a49b50 void FUN_00a49b50(void) { epoxy_glTexParameterIivEXT = (undefined *)FUN_00a2ca10(&DAT_00b299d4); /* WARNING: Could not recover jumptable at 0x00a49b70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterIivEXT)(); return; } //@@ 00a49b80 FUN_00a49b80 void FUN_00a49b80(void) { epoxy_glTexParameterIivOES = (undefined *)FUN_00a2ca10(&DAT_00b2b248); /* WARNING: Could not recover jumptable at 0x00a49ba0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterIivOES)(); return; } //@@ 00a49bb0 FUN_00a49bb0 void FUN_00a49bb0(void) { epoxy_glTexParameterIuiv = (undefined *)FUN_00a2ca10(&DAT_00b27ae4); /* WARNING: Could not recover jumptable at 0x00a49bd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterIuiv)(); return; } //@@ 00a49be0 FUN_00a49be0 void FUN_00a49be0(void) { epoxy_glTexParameterIuivEXT = (undefined *)FUN_00a2ca10(&DAT_00b29194); /* WARNING: Could not recover jumptable at 0x00a49c00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterIuivEXT)(); return; } //@@ 00a49c10 FUN_00a49c10 void FUN_00a49c10(void) { epoxy_glTexParameterIuivOES = (undefined *)FUN_00a2ca10(&DAT_00b3b904); /* WARNING: Could not recover jumptable at 0x00a49c30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterIuivOES)(); return; } //@@ 00a49c40 FUN_00a49c40 void FUN_00a49c40(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTexParameterf = (undefined *)FUN_00a2ca10(&DAT_00b257c8); (*(code *)epoxy_glTexParameterf)(param_1,param_2,param_3); return; } //@@ 00a49c80 FUN_00a49c80 void FUN_00a49c80(void) { epoxy_glTexParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b275bc); /* WARNING: Could not recover jumptable at 0x00a49ca0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterfv)(); return; } //@@ 00a49cb0 FUN_00a49cb0 void FUN_00a49cb0(void) { epoxy_glTexParameteri = (undefined *)FUN_00a2ca10(&DAT_00b3d7e8); /* WARNING: Could not recover jumptable at 0x00a49cd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameteri)(); return; } //@@ 00a49ce0 FUN_00a49ce0 void FUN_00a49ce0(void) { epoxy_glTexParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b2a054); /* WARNING: Could not recover jumptable at 0x00a49d00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameteriv)(); return; } //@@ 00a49d10 FUN_00a49d10 void FUN_00a49d10(void) { epoxy_glTexParameterx = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49d28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterx)(); return; } //@@ 00a49d30 FUN_00a49d30 void FUN_00a49d30(void) { epoxy_glTexParameterxOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49d48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterxOES)(); return; } //@@ 00a49d50 FUN_00a49d50 void FUN_00a49d50(void) { epoxy_glTexParameterxv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49d68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterxv)(); return; } //@@ 00a49d70 FUN_00a49d70 void FUN_00a49d70(void) { epoxy_glTexParameterxvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49d88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexParameterxvOES)(); return; } //@@ 00a49d90 FUN_00a49d90 void FUN_00a49d90(void) { epoxy_glTexRenderbufferNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49da8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexRenderbufferNV)(); return; } //@@ 00a49db0 FUN_00a49db0 void FUN_00a49db0(void) { epoxy_glTexStorage1D = (undefined *)FUN_00a2ca10(&DAT_00b3c188); /* WARNING: Could not recover jumptable at 0x00a49dd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage1D)(); return; } //@@ 00a49de0 FUN_00a49de0 void FUN_00a49de0(void) { epoxy_glTexStorage1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b188); /* WARNING: Could not recover jumptable at 0x00a49e00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage1DEXT)(); return; } //@@ 00a49e10 FUN_00a49e10 void FUN_00a49e10(void) { epoxy_glTexStorage2D = (undefined *)FUN_00a2ca10(&DAT_00b2a878); /* WARNING: Could not recover jumptable at 0x00a49e30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage2D)(); return; } //@@ 00a49e40 FUN_00a49e40 void FUN_00a49e40(void) { epoxy_glTexStorage2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b27b74); /* WARNING: Could not recover jumptable at 0x00a49e60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage2DEXT)(); return; } //@@ 00a49e70 FUN_00a49e70 void FUN_00a49e70(void) { epoxy_glTexStorage2DMultisample = (undefined *)FUN_00a2ca10(&DAT_00b3c030); /* WARNING: Could not recover jumptable at 0x00a49e90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage2DMultisample)(); return; } //@@ 00a49ea0 FUN_00a49ea0 void FUN_00a49ea0(void) { epoxy_glTexStorage3D = (undefined *)FUN_00a2ca10(&DAT_00b25704); /* WARNING: Could not recover jumptable at 0x00a49ec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage3D)(); return; } //@@ 00a49ed0 FUN_00a49ed0 void FUN_00a49ed0(void) { epoxy_glTexStorage3DEXT = (undefined *)FUN_00a2ca10(&DAT_00b26690); /* WARNING: Could not recover jumptable at 0x00a49ef0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage3DEXT)(); return; } //@@ 00a49f00 FUN_00a49f00 void FUN_00a49f00(void) { epoxy_glTexStorage3DMultisample = (undefined *)FUN_00a2ca10(&DAT_00b25190); /* WARNING: Could not recover jumptable at 0x00a49f20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage3DMultisample)(); return; } //@@ 00a49f30 FUN_00a49f30 void FUN_00a49f30(void) { epoxy_glTexStorage3DMultisampleOES = (undefined *)FUN_00a2ca10(&DAT_00b28438); /* WARNING: Could not recover jumptable at 0x00a49f50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorage3DMultisampleOES)(); return; } //@@ 00a49f60 FUN_00a49f60 void FUN_00a49f60(void) { epoxy_glTexStorageSparseAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a49f78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexStorageSparseAMD)(); return; } //@@ 00a49f80 FUN_00a49f80 void FUN_00a49f80(void) { epoxy_glTexSubImage1D = (undefined *)FUN_00a2ca10(&DAT_00b3c264); /* WARNING: Could not recover jumptable at 0x00a49fa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage1D)(); return; } //@@ 00a49fb0 FUN_00a49fb0 void FUN_00a49fb0(void) { epoxy_glTexSubImage1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b28a74); /* WARNING: Could not recover jumptable at 0x00a49fd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage1DEXT)(); return; } //@@ 00a49fe0 FUN_00a49fe0 void FUN_00a49fe0(void) { epoxy_glTexSubImage2D = (undefined *)FUN_00a2ca10(&DAT_00b27120); /* WARNING: Could not recover jumptable at 0x00a4a000. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage2D)(); return; } //@@ 00a4a010 FUN_00a4a010 void FUN_00a4a010(void) { epoxy_glTexSubImage2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d970); /* WARNING: Could not recover jumptable at 0x00a4a030. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage2DEXT)(); return; } //@@ 00a4a040 FUN_00a4a040 void FUN_00a4a040(void) { epoxy_glTexSubImage3D = (undefined *)FUN_00a2ca10(&DAT_00b27628); /* WARNING: Could not recover jumptable at 0x00a4a060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage3D)(); return; } //@@ 00a4a070 FUN_00a4a070 void FUN_00a4a070(void) { epoxy_glTexSubImage3DEXT = (undefined *)FUN_00a2ca10(&DAT_00b27760); /* WARNING: Could not recover jumptable at 0x00a4a090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage3DEXT)(); return; } //@@ 00a4a0a0 FUN_00a4a0a0 void FUN_00a4a0a0(void) { epoxy_glTexSubImage3DOES = (undefined *)FUN_00a2ca10(&DAT_00b271f4); /* WARNING: Could not recover jumptable at 0x00a4a0c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage3DOES)(); return; } //@@ 00a4a0d0 FUN_00a4a0d0 void FUN_00a4a0d0(void) { epoxy_glTexSubImage4DSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a0e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexSubImage4DSGIS)(); return; } //@@ 00a4a130 FUN_00a4a130 void FUN_00a4a130(void) { epoxy_glTextureBuffer = (undefined *)FUN_00a2ca10(&DAT_00b25e80); /* WARNING: Could not recover jumptable at 0x00a4a150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureBuffer)(); return; } //@@ 00a4a160 FUN_00a4a160 void FUN_00a4a160(void) { epoxy_glTextureBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a178. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureBufferEXT)(); return; } //@@ 00a4a180 FUN_00a4a180 void FUN_00a4a180(void) { epoxy_glTextureBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b3c1c8); /* WARNING: Could not recover jumptable at 0x00a4a1a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureBufferRange)(); return; } //@@ 00a4a1b0 FUN_00a4a1b0 void FUN_00a4a1b0(void) { epoxy_glTextureBufferRangeEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a1c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureBufferRangeEXT)(); return; } //@@ 00a4a1d0 FUN_00a4a1d0 void FUN_00a4a1d0(void) { epoxy_glTextureColorMaskSGIS = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a1e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureColorMaskSGIS)(); return; } //@@ 00a4a1f0 FUN_00a4a1f0 void FUN_00a4a1f0(void) { epoxy_glTextureImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage1DEXT)(); return; } //@@ 00a4a210 FUN_00a4a210 void FUN_00a4a210(void) { epoxy_glTextureImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a228. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage2DEXT)(); return; } //@@ 00a4a230 FUN_00a4a230 void FUN_00a4a230(void) { epoxy_glTextureImage2DMultisampleCoverageNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a248. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage2DMultisampleCoverageNV)(); return; } //@@ 00a4a250 FUN_00a4a250 void FUN_00a4a250(void) { epoxy_glTextureImage2DMultisampleNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a268. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage2DMultisampleNV)(); return; } //@@ 00a4a270 FUN_00a4a270 void FUN_00a4a270(void) { epoxy_glTextureImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a288. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage3DEXT)(); return; } //@@ 00a4a290 FUN_00a4a290 void FUN_00a4a290(void) { epoxy_glTextureImage3DMultisampleCoverageNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a2a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage3DMultisampleCoverageNV)(); return; } //@@ 00a4a2b0 FUN_00a4a2b0 void FUN_00a4a2b0(void) { epoxy_glTextureImage3DMultisampleNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a2c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureImage3DMultisampleNV)(); return; } //@@ 00a4a2d0 FUN_00a4a2d0 void FUN_00a4a2d0(void) { epoxy_glTextureLightEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a2e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureLightEXT)(); return; } //@@ 00a4a2f0 FUN_00a4a2f0 void FUN_00a4a2f0(void) { epoxy_glTextureMaterialEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureMaterialEXT)(); return; } //@@ 00a4a310 FUN_00a4a310 void FUN_00a4a310(void) { epoxy_glTextureNormalEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureNormalEXT)(); return; } //@@ 00a4a330 FUN_00a4a330 void FUN_00a4a330(void) { epoxy_glTexturePageCommitmentEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTexturePageCommitmentEXT)(); return; } //@@ 00a4a350 FUN_00a4a350 void FUN_00a4a350(void) { epoxy_glTextureParameterIiv = (undefined *)FUN_00a2ca10(&DAT_00b3d7d8); /* WARNING: Could not recover jumptable at 0x00a4a370. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterIiv)(); return; } //@@ 00a4a380 FUN_00a4a380 void FUN_00a4a380(void) { epoxy_glTextureParameterIivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterIivEXT)(); return; } //@@ 00a4a3a0 FUN_00a4a3a0 void FUN_00a4a3a0(void) { epoxy_glTextureParameterIuiv = (undefined *)FUN_00a2ca10(&DAT_00b3b8e0); /* WARNING: Could not recover jumptable at 0x00a4a3c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterIuiv)(); return; } //@@ 00a4a3d0 FUN_00a4a3d0 void FUN_00a4a3d0(void) { epoxy_glTextureParameterIuivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a3e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterIuivEXT)(); return; } //@@ 00a4a3f0 FUN_00a4a3f0 void FUN_00a4a3f0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTextureParameterf = (undefined *)FUN_00a2ca10(&DAT_00b28044); (*(code *)epoxy_glTextureParameterf)(param_1,param_2,param_3); return; } //@@ 00a4a430 FUN_00a4a430 void FUN_00a4a430(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glTextureParameterfEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTextureParameterfEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a4a470 FUN_00a4a470 void FUN_00a4a470(void) { epoxy_glTextureParameterfv = (undefined *)FUN_00a2ca10(&DAT_00b27da8); /* WARNING: Could not recover jumptable at 0x00a4a490. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterfv)(); return; } //@@ 00a4a4a0 FUN_00a4a4a0 void FUN_00a4a4a0(void) { epoxy_glTextureParameterfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a4b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterfvEXT)(); return; } //@@ 00a4a4c0 FUN_00a4a4c0 void FUN_00a4a4c0(void) { epoxy_glTextureParameteri = (undefined *)FUN_00a2ca10(&DAT_00b3d694); /* WARNING: Could not recover jumptable at 0x00a4a4e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameteri)(); return; } //@@ 00a4a4f0 FUN_00a4a4f0 void FUN_00a4a4f0(void) { epoxy_glTextureParameteriEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a508. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameteriEXT)(); return; } //@@ 00a4a510 FUN_00a4a510 void FUN_00a4a510(void) { epoxy_glTextureParameteriv = (undefined *)FUN_00a2ca10(&DAT_00b3b874); /* WARNING: Could not recover jumptable at 0x00a4a530. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameteriv)(); return; } //@@ 00a4a540 FUN_00a4a540 void FUN_00a4a540(void) { epoxy_glTextureParameterivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a558. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureParameterivEXT)(); return; } //@@ 00a4a560 FUN_00a4a560 void FUN_00a4a560(void) { epoxy_glTextureRangeAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureRangeAPPLE)(); return; } //@@ 00a4a580 FUN_00a4a580 void FUN_00a4a580(void) { epoxy_glTextureRenderbufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureRenderbufferEXT)(); return; } //@@ 00a4a5a0 FUN_00a4a5a0 void FUN_00a4a5a0(void) { epoxy_glTextureStorage1D = (undefined *)FUN_00a2ca10(&DAT_00b29a04); /* WARNING: Could not recover jumptable at 0x00a4a5c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage1D)(); return; } //@@ 00a4a5d0 FUN_00a4a5d0 void FUN_00a4a5d0(void) { epoxy_glTextureStorage1DEXT = (undefined *)FUN_00a2ca10(&DAT_00b27594); /* WARNING: Could not recover jumptable at 0x00a4a5f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage1DEXT)(); return; } //@@ 00a4a600 FUN_00a4a600 void FUN_00a4a600(void) { epoxy_glTextureStorage2D = (undefined *)FUN_00a2ca10(&DAT_00b26fa8); /* WARNING: Could not recover jumptable at 0x00a4a620. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage2D)(); return; } //@@ 00a4a630 FUN_00a4a630 void FUN_00a4a630(void) { epoxy_glTextureStorage2DEXT = (undefined *)FUN_00a2ca10(&DAT_00b3bd38); /* WARNING: Could not recover jumptable at 0x00a4a650. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage2DEXT)(); return; } //@@ 00a4a660 FUN_00a4a660 void FUN_00a4a660(void) { epoxy_glTextureStorage2DMultisample = (undefined *)FUN_00a2ca10(&DAT_00b28d14); /* WARNING: Could not recover jumptable at 0x00a4a680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage2DMultisample)(); return; } //@@ 00a4a690 FUN_00a4a690 void FUN_00a4a690(void) { epoxy_glTextureStorage2DMultisampleEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a6a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage2DMultisampleEXT)(); return; } //@@ 00a4a6b0 FUN_00a4a6b0 void FUN_00a4a6b0(void) { epoxy_glTextureStorage3D = (undefined *)FUN_00a2ca10(&DAT_00b3c8c8); /* WARNING: Could not recover jumptable at 0x00a4a6d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage3D)(); return; } //@@ 00a4a6e0 FUN_00a4a6e0 void FUN_00a4a6e0(void) { epoxy_glTextureStorage3DEXT = (undefined *)FUN_00a2ca10(&DAT_00b27804); /* WARNING: Could not recover jumptable at 0x00a4a700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage3DEXT)(); return; } //@@ 00a4a710 FUN_00a4a710 void FUN_00a4a710(void) { epoxy_glTextureStorage3DMultisample = (undefined *)FUN_00a2ca10(&DAT_00b27b30); /* WARNING: Could not recover jumptable at 0x00a4a730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage3DMultisample)(); return; } //@@ 00a4a740 FUN_00a4a740 void FUN_00a4a740(void) { epoxy_glTextureStorage3DMultisampleEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorage3DMultisampleEXT)(); return; } //@@ 00a4a760 FUN_00a4a760 void FUN_00a4a760(void) { epoxy_glTextureStorageSparseAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a778. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureStorageSparseAMD)(); return; } //@@ 00a4a780 FUN_00a4a780 void FUN_00a4a780(void) { epoxy_glTextureSubImage1D = (undefined *)FUN_00a2ca10(&DAT_00b3d898); /* WARNING: Could not recover jumptable at 0x00a4a7a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureSubImage1D)(); return; } //@@ 00a4a7b0 FUN_00a4a7b0 void FUN_00a4a7b0(void) { epoxy_glTextureSubImage1DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a7c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureSubImage1DEXT)(); return; } //@@ 00a4a7d0 FUN_00a4a7d0 void FUN_00a4a7d0(void) { epoxy_glTextureSubImage2D = (undefined *)FUN_00a2ca10(&DAT_00b3bb7c); /* WARNING: Could not recover jumptable at 0x00a4a7f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureSubImage2D)(); return; } //@@ 00a4a800 FUN_00a4a800 void FUN_00a4a800(void) { epoxy_glTextureSubImage2DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureSubImage2DEXT)(); return; } //@@ 00a4a820 FUN_00a4a820 void FUN_00a4a820(void) { epoxy_glTextureSubImage3D = (undefined *)FUN_00a2ca10(&DAT_00b2924c); /* WARNING: Could not recover jumptable at 0x00a4a840. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureSubImage3D)(); return; } //@@ 00a4a850 FUN_00a4a850 void FUN_00a4a850(void) { epoxy_glTextureSubImage3DEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureSubImage3DEXT)(); return; } //@@ 00a4a870 FUN_00a4a870 void FUN_00a4a870(void) { epoxy_glTextureView = (undefined *)FUN_00a2ca10(&DAT_00b3c87c); /* WARNING: Could not recover jumptable at 0x00a4a890. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureView)(); return; } //@@ 00a4a8a0 FUN_00a4a8a0 void FUN_00a4a8a0(void) { epoxy_glTextureViewEXT = (undefined *)FUN_00a2ca10(&DAT_00b25cd8); /* WARNING: Could not recover jumptable at 0x00a4a8c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureViewEXT)(); return; } //@@ 00a4a8d0 FUN_00a4a8d0 void FUN_00a4a8d0(void) { epoxy_glTextureViewOES = (undefined *)FUN_00a2ca10(&DAT_00b29704); /* WARNING: Could not recover jumptable at 0x00a4a8f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTextureViewOES)(); return; } //@@ 00a4a900 FUN_00a4a900 void FUN_00a4a900(void) { epoxy_glTrackMatrixNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a918. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTrackMatrixNV)(); return; } //@@ 00a4a920 FUN_00a4a920 void FUN_00a4a920(void) { epoxy_glTransformFeedbackAttribsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a938. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackAttribsNV)(); return; } //@@ 00a4a940 FUN_00a4a940 void FUN_00a4a940(void) { epoxy_glTransformFeedbackBufferBase = (undefined *)FUN_00a2ca10(&DAT_00b3b758); /* WARNING: Could not recover jumptable at 0x00a4a960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackBufferBase)(); return; } //@@ 00a4a970 FUN_00a4a970 void FUN_00a4a970(void) { epoxy_glTransformFeedbackBufferRange = (undefined *)FUN_00a2ca10(&DAT_00b3cf74); /* WARNING: Could not recover jumptable at 0x00a4a990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackBufferRange)(); return; } //@@ 00a4a9a0 FUN_00a4a9a0 void FUN_00a4a9a0(void) { epoxy_glTransformFeedbackStreamAttribsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4a9b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackStreamAttribsNV)(); return; } //@@ 00a4a9c0 FUN_00a4a9c0 void FUN_00a4a9c0(void) { epoxy_glTransformFeedbackVaryings = (undefined *)FUN_00a2ca10(&DAT_00b26758); /* WARNING: Could not recover jumptable at 0x00a4a9e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackVaryings)(); return; } //@@ 00a4a9f0 FUN_00a4a9f0 void FUN_00a4a9f0(void) { epoxy_glTransformFeedbackVaryingsEXT = (undefined *)FUN_00a2ca10(&DAT_00b27194); /* WARNING: Could not recover jumptable at 0x00a4aa10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackVaryingsEXT)(); return; } //@@ 00a4aa20 FUN_00a4aa20 void FUN_00a4aa20(void) { epoxy_glTransformFeedbackVaryingsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4aa38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformFeedbackVaryingsNV)(); return; } //@@ 00a4aa40 FUN_00a4aa40 void FUN_00a4aa40(void) { epoxy_glTransformPathNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4aa58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTransformPathNV)(); return; } //@@ 00a4aa60 FUN_00a4aa60 void FUN_00a4aa60(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glTranslated = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glTranslated)(param_1,param_2,param_3); return; } //@@ 00a4aab0 FUN_00a4aab0 void FUN_00a4aab0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glTranslatef = (undefined *)FUN_00a2ca10(&DAT_00b28140); (*(code *)epoxy_glTranslatef)(param_1,param_2,param_3); return; } //@@ 00a4ab00 FUN_00a4ab00 void FUN_00a4ab00(void) { epoxy_glTranslatex = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ab18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTranslatex)(); return; } //@@ 00a4ab20 FUN_00a4ab20 void FUN_00a4ab20(void) { epoxy_glTranslatexOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ab38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glTranslatexOES)(); return; } //@@ 00a4ab40 FUN_00a4ab40 void FUN_00a4ab40(undefined4 param_1,undefined8 param_2) { epoxy_glUniform1d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glUniform1d)(param_1,param_2); return; } //@@ 00a4ab70 FUN_00a4ab70 void FUN_00a4ab70(void) { epoxy_glUniform1dv = (undefined *)FUN_00a2ca10(&DAT_00b3d074); /* WARNING: Could not recover jumptable at 0x00a4ab90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1dv)(); return; } //@@ 00a4aba0 FUN_00a4aba0 void FUN_00a4aba0(undefined4 param_1,undefined4 param_2) { epoxy_glUniform1f = (undefined *)FUN_00a2ca10(&DAT_00b3cfb4); (*(code *)epoxy_glUniform1f)(param_1,param_2); return; } //@@ 00a4abd0 FUN_00a4abd0 void FUN_00a4abd0(undefined4 param_1,undefined4 param_2) { epoxy_glUniform1fARB = (undefined *)FUN_00a2ca10(&DAT_00b3b344); (*(code *)epoxy_glUniform1fARB)(param_1,param_2); return; } //@@ 00a4ac00 FUN_00a4ac00 void FUN_00a4ac00(void) { epoxy_glUniform1fv = (undefined *)FUN_00a2ca10(&DAT_00b3bf48); /* WARNING: Could not recover jumptable at 0x00a4ac20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1fv)(); return; } //@@ 00a4ac30 FUN_00a4ac30 void FUN_00a4ac30(void) { epoxy_glUniform1fvARB = (undefined *)FUN_00a2ca10(&DAT_00b2ad98); /* WARNING: Could not recover jumptable at 0x00a4ac50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1fvARB)(); return; } //@@ 00a4ac60 FUN_00a4ac60 void FUN_00a4ac60(void) { epoxy_glUniform1i = (undefined *)FUN_00a2ca10(&DAT_00b27b14); /* WARNING: Could not recover jumptable at 0x00a4ac80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1i)(); return; } //@@ 00a4ac90 FUN_00a4ac90 void FUN_00a4ac90(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniform1i64NV = (undefined *)FUN_00a2ca10(&DAT_00b2a27c); (*(code *)epoxy_glUniform1i64NV)(param_1,param_2,param_3); return; } //@@ 00a4acc0 FUN_00a4acc0 void FUN_00a4acc0(void) { epoxy_glUniform1i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3cc78); /* WARNING: Could not recover jumptable at 0x00a4ace0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1i64vNV)(); return; } //@@ 00a4acf0 FUN_00a4acf0 void FUN_00a4acf0(void) { epoxy_glUniform1iARB = (undefined *)FUN_00a2ca10(&DAT_00b3b27c); /* WARNING: Could not recover jumptable at 0x00a4ad10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1iARB)(); return; } //@@ 00a4ad20 FUN_00a4ad20 void FUN_00a4ad20(void) { epoxy_glUniform1iv = (undefined *)FUN_00a2ca10(&DAT_00b3c9a8); /* WARNING: Could not recover jumptable at 0x00a4ad40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1iv)(); return; } //@@ 00a4ad50 FUN_00a4ad50 void FUN_00a4ad50(void) { epoxy_glUniform1ivARB = (undefined *)FUN_00a2ca10(&DAT_00b26d94); /* WARNING: Could not recover jumptable at 0x00a4ad70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1ivARB)(); return; } //@@ 00a4ad80 FUN_00a4ad80 void FUN_00a4ad80(void) { epoxy_glUniform1ui = (undefined *)FUN_00a2ca10(&DAT_00b2a034); /* WARNING: Could not recover jumptable at 0x00a4ada0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1ui)(); return; } //@@ 00a4adb0 FUN_00a4adb0 void FUN_00a4adb0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniform1ui64NV = (undefined *)FUN_00a2ca10(0xb3c70c); (*(code *)epoxy_glUniform1ui64NV)(param_1,param_2,param_3); return; } //@@ 00a4ade0 FUN_00a4ade0 void FUN_00a4ade0(void) { epoxy_glUniform1ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3ca10); /* WARNING: Could not recover jumptable at 0x00a4ae00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1ui64vNV)(); return; } //@@ 00a4ae10 FUN_00a4ae10 void FUN_00a4ae10(void) { epoxy_glUniform1uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b3d434); /* WARNING: Could not recover jumptable at 0x00a4ae30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1uiEXT)(); return; } //@@ 00a4ae40 FUN_00a4ae40 void FUN_00a4ae40(void) { epoxy_glUniform1uiv = (undefined *)FUN_00a2ca10(&DAT_00b3ca74); /* WARNING: Could not recover jumptable at 0x00a4ae60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1uiv)(); return; } //@@ 00a4ae70 FUN_00a4ae70 void FUN_00a4ae70(void) { epoxy_glUniform1uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b2adc0); /* WARNING: Could not recover jumptable at 0x00a4ae90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform1uivEXT)(); return; } //@@ 00a4aea0 FUN_00a4aea0 void FUN_00a4aea0(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glUniform2d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glUniform2d)(param_1,param_2,param_3); return; } //@@ 00a4aef0 FUN_00a4aef0 void FUN_00a4aef0(void) { epoxy_glUniform2dv = (undefined *)FUN_00a2ca10(&DAT_00b3d60c); /* WARNING: Could not recover jumptable at 0x00a4af10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2dv)(); return; } //@@ 00a4af20 FUN_00a4af20 void FUN_00a4af20(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniform2f = (undefined *)FUN_00a2ca10(&DAT_00b3cd18); (*(code *)epoxy_glUniform2f)(param_1,param_2,param_3); return; } //@@ 00a4af60 FUN_00a4af60 void FUN_00a4af60(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniform2fARB = (undefined *)FUN_00a2ca10(&DAT_00b29074); (*(code *)epoxy_glUniform2fARB)(param_1,param_2,param_3); return; } //@@ 00a4afa0 FUN_00a4afa0 void FUN_00a4afa0(void) { epoxy_glUniform2fv = (undefined *)FUN_00a2ca10(&DAT_00b3d350); /* WARNING: Could not recover jumptable at 0x00a4afc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2fv)(); return; } //@@ 00a4afd0 FUN_00a4afd0 void FUN_00a4afd0(void) { epoxy_glUniform2fvARB = (undefined *)FUN_00a2ca10(&DAT_00b288a8); /* WARNING: Could not recover jumptable at 0x00a4aff0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2fvARB)(); return; } //@@ 00a4b000 FUN_00a4b000 void FUN_00a4b000(void) { epoxy_glUniform2i = (undefined *)FUN_00a2ca10(&DAT_00b3ccc8); /* WARNING: Could not recover jumptable at 0x00a4b020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2i)(); return; } //@@ 00a4b030 FUN_00a4b030 void FUN_00a4b030(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glUniform2i64NV = (undefined *)FUN_00a2ca10(&DAT_00b3c52c); (*(code *)epoxy_glUniform2i64NV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4b070 FUN_00a4b070 void FUN_00a4b070(void) { epoxy_glUniform2i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3ca14); /* WARNING: Could not recover jumptable at 0x00a4b090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2i64vNV)(); return; } //@@ 00a4b0a0 FUN_00a4b0a0 void FUN_00a4b0a0(void) { epoxy_glUniform2iARB = (undefined *)FUN_00a2ca10(&DAT_00b26630); /* WARNING: Could not recover jumptable at 0x00a4b0c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2iARB)(); return; } //@@ 00a4b0d0 FUN_00a4b0d0 void FUN_00a4b0d0(void) { epoxy_glUniform2iv = (undefined *)FUN_00a2ca10(&DAT_00b28d00); /* WARNING: Could not recover jumptable at 0x00a4b0f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2iv)(); return; } //@@ 00a4b100 FUN_00a4b100 void FUN_00a4b100(void) { epoxy_glUniform2ivARB = (undefined *)FUN_00a2ca10(&DAT_00b2a49c); /* WARNING: Could not recover jumptable at 0x00a4b120. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2ivARB)(); return; } //@@ 00a4b130 FUN_00a4b130 void FUN_00a4b130(void) { epoxy_glUniform2ui = (undefined *)FUN_00a2ca10(&DAT_00b27528); /* WARNING: Could not recover jumptable at 0x00a4b150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2ui)(); return; } //@@ 00a4b160 FUN_00a4b160 void FUN_00a4b160(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glUniform2ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b3beb8); (*(code *)epoxy_glUniform2ui64NV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4b1a0 FUN_00a4b1a0 void FUN_00a4b1a0(void) { epoxy_glUniform2ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b257e8); /* WARNING: Could not recover jumptable at 0x00a4b1c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2ui64vNV)(); return; } //@@ 00a4b1d0 FUN_00a4b1d0 void FUN_00a4b1d0(void) { epoxy_glUniform2uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b270e0); /* WARNING: Could not recover jumptable at 0x00a4b1f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2uiEXT)(); return; } //@@ 00a4b200 FUN_00a4b200 void FUN_00a4b200(void) { epoxy_glUniform2uiv = (undefined *)FUN_00a2ca10(&DAT_00b3b420); /* WARNING: Could not recover jumptable at 0x00a4b220. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2uiv)(); return; } //@@ 00a4b230 FUN_00a4b230 void FUN_00a4b230(void) { epoxy_glUniform2uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3cc0c); /* WARNING: Could not recover jumptable at 0x00a4b250. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform2uivEXT)(); return; } //@@ 00a4b260 FUN_00a4b260 void FUN_00a4b260(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glUniform3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glUniform3d)(param_1,param_2,param_3,param_4); return; } //@@ 00a4b2b0 FUN_00a4b2b0 void FUN_00a4b2b0(void) { epoxy_glUniform3dv = (undefined *)FUN_00a2ca10(&DAT_00b3b768); /* WARNING: Could not recover jumptable at 0x00a4b2d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3dv)(); return; } //@@ 00a4b2e0 FUN_00a4b2e0 void FUN_00a4b2e0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glUniform3f = (undefined *)FUN_00a2ca10(&DAT_00b27604); (*(code *)epoxy_glUniform3f)(param_1,param_2,param_3,param_4); return; } //@@ 00a4b330 FUN_00a4b330 void FUN_00a4b330(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glUniform3fARB = (undefined *)FUN_00a2ca10(&DAT_00b3c7d8); (*(code *)epoxy_glUniform3fARB)(param_1,param_2,param_3,param_4); return; } //@@ 00a4b380 FUN_00a4b380 void FUN_00a4b380(void) { epoxy_glUniform3fv = (undefined *)FUN_00a2ca10(&DAT_00b27f20); /* WARNING: Could not recover jumptable at 0x00a4b3a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3fv)(); return; } //@@ 00a4b3b0 FUN_00a4b3b0 void FUN_00a4b3b0(void) { epoxy_glUniform3fvARB = (undefined *)FUN_00a2ca10(&DAT_00b25718); /* WARNING: Could not recover jumptable at 0x00a4b3d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3fvARB)(); return; } //@@ 00a4b3e0 FUN_00a4b3e0 void FUN_00a4b3e0(void) { epoxy_glUniform3i = (undefined *)FUN_00a2ca10(&DAT_00b3b294); /* WARNING: Could not recover jumptable at 0x00a4b400. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3i)(); return; } //@@ 00a4b410 FUN_00a4b410 void FUN_00a4b410(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glUniform3i64NV = (undefined *)FUN_00a2ca10(&DAT_00b2a800); (*(code *)epoxy_glUniform3i64NV)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a4b450 FUN_00a4b450 void FUN_00a4b450(void) { epoxy_glUniform3i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b29800); /* WARNING: Could not recover jumptable at 0x00a4b470. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3i64vNV)(); return; } //@@ 00a4b480 FUN_00a4b480 void FUN_00a4b480(void) { epoxy_glUniform3iARB = (undefined *)FUN_00a2ca10(&DAT_00b3bae4); /* WARNING: Could not recover jumptable at 0x00a4b4a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3iARB)(); return; } //@@ 00a4b4b0 FUN_00a4b4b0 void FUN_00a4b4b0(void) { epoxy_glUniform3iv = (undefined *)FUN_00a2ca10(&DAT_00b3c1bc); /* WARNING: Could not recover jumptable at 0x00a4b4d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3iv)(); return; } //@@ 00a4b4e0 FUN_00a4b4e0 void FUN_00a4b4e0(void) { epoxy_glUniform3ivARB = (undefined *)FUN_00a2ca10(&DAT_00b260c8); /* WARNING: Could not recover jumptable at 0x00a4b500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3ivARB)(); return; } //@@ 00a4b510 FUN_00a4b510 void FUN_00a4b510(void) { epoxy_glUniform3ui = (undefined *)FUN_00a2ca10(&DAT_00b27d14); /* WARNING: Could not recover jumptable at 0x00a4b530. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3ui)(); return; } //@@ 00a4b540 FUN_00a4b540 void FUN_00a4b540(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glUniform3ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b25b74); (*(code *)epoxy_glUniform3ui64NV)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a4b580 FUN_00a4b580 void FUN_00a4b580(void) { epoxy_glUniform3ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3b318); /* WARNING: Could not recover jumptable at 0x00a4b5a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3ui64vNV)(); return; } //@@ 00a4b5b0 FUN_00a4b5b0 void FUN_00a4b5b0(void) { epoxy_glUniform3uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b950); /* WARNING: Could not recover jumptable at 0x00a4b5d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3uiEXT)(); return; } //@@ 00a4b5e0 FUN_00a4b5e0 void FUN_00a4b5e0(void) { epoxy_glUniform3uiv = (undefined *)FUN_00a2ca10(&DAT_00b26e84); /* WARNING: Could not recover jumptable at 0x00a4b600. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3uiv)(); return; } //@@ 00a4b610 FUN_00a4b610 void FUN_00a4b610(void) { epoxy_glUniform3uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b0d8); /* WARNING: Could not recover jumptable at 0x00a4b630. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform3uivEXT)(); return; } //@@ 00a4b640 FUN_00a4b640 void FUN_00a4b640(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glUniform4d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glUniform4d)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4b6a0 FUN_00a4b6a0 void FUN_00a4b6a0(void) { epoxy_glUniform4dv = (undefined *)FUN_00a2ca10(&DAT_00b26104); /* WARNING: Could not recover jumptable at 0x00a4b6c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4dv)(); return; } //@@ 00a4b6d0 FUN_00a4b6d0 void FUN_00a4b6d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glUniform4f = (undefined *)FUN_00a2ca10(&DAT_00b3c058); (*(code *)epoxy_glUniform4f)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4b730 FUN_00a4b730 void FUN_00a4b730(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glUniform4fARB = (undefined *)FUN_00a2ca10(&DAT_00b26750); (*(code *)epoxy_glUniform4fARB)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4b790 FUN_00a4b790 void FUN_00a4b790(void) { epoxy_glUniform4fv = (undefined *)FUN_00a2ca10(&DAT_00b27f40); /* WARNING: Could not recover jumptable at 0x00a4b7b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4fv)(); return; } //@@ 00a4b7c0 FUN_00a4b7c0 void FUN_00a4b7c0(void) { epoxy_glUniform4fvARB = (undefined *)FUN_00a2ca10(&DAT_00b2a978); /* WARNING: Could not recover jumptable at 0x00a4b7e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4fvARB)(); return; } //@@ 00a4b7f0 FUN_00a4b7f0 void FUN_00a4b7f0(void) { epoxy_glUniform4i = (undefined *)FUN_00a2ca10(&DAT_00b2ae64); /* WARNING: Could not recover jumptable at 0x00a4b810. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4i)(); return; } //@@ 00a4b820 FUN_00a4b820 void FUN_00a4b820(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glUniform4i64NV = (undefined *)FUN_00a2ca10(&DAT_00b26e0c); (*(code *)epoxy_glUniform4i64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a4b870 FUN_00a4b870 void FUN_00a4b870(void) { epoxy_glUniform4i64vNV = (undefined *)FUN_00a2ca10(&DAT_00b2ab44); /* WARNING: Could not recover jumptable at 0x00a4b890. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4i64vNV)(); return; } //@@ 00a4b8a0 FUN_00a4b8a0 void FUN_00a4b8a0(void) { epoxy_glUniform4iARB = (undefined *)FUN_00a2ca10(&DAT_00b3c394); /* WARNING: Could not recover jumptable at 0x00a4b8c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4iARB)(); return; } //@@ 00a4b8d0 FUN_00a4b8d0 void FUN_00a4b8d0(void) { epoxy_glUniform4iv = (undefined *)FUN_00a2ca10(&DAT_00b2ab14); /* WARNING: Could not recover jumptable at 0x00a4b8f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4iv)(); return; } //@@ 00a4b900 FUN_00a4b900 void FUN_00a4b900(void) { epoxy_glUniform4ivARB = (undefined *)FUN_00a2ca10(&DAT_00b3bde8); /* WARNING: Could not recover jumptable at 0x00a4b920. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4ivARB)(); return; } //@@ 00a4b930 FUN_00a4b930 void FUN_00a4b930(void) { epoxy_glUniform4ui = (undefined *)FUN_00a2ca10(&DAT_00b3be24); /* WARNING: Could not recover jumptable at 0x00a4b950. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4ui)(); return; } //@@ 00a4b960 FUN_00a4b960 void FUN_00a4b960(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glUniform4ui64NV = (undefined *)FUN_00a2ca10(&DAT_00b3cd14); (*(code *)epoxy_glUniform4ui64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a4b9b0 FUN_00a4b9b0 void FUN_00a4b9b0(void) { epoxy_glUniform4ui64vNV = (undefined *)FUN_00a2ca10(&DAT_00b3cc14); /* WARNING: Could not recover jumptable at 0x00a4b9d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4ui64vNV)(); return; } //@@ 00a4b9e0 FUN_00a4b9e0 void FUN_00a4b9e0(void) { epoxy_glUniform4uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c4ac); /* WARNING: Could not recover jumptable at 0x00a4ba00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4uiEXT)(); return; } //@@ 00a4ba10 FUN_00a4ba10 void FUN_00a4ba10(void) { epoxy_glUniform4uiv = (undefined *)FUN_00a2ca10(&DAT_00b3b364); /* WARNING: Could not recover jumptable at 0x00a4ba30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4uiv)(); return; } //@@ 00a4ba40 FUN_00a4ba40 void FUN_00a4ba40(void) { epoxy_glUniform4uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a7e8); /* WARNING: Could not recover jumptable at 0x00a4ba60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniform4uivEXT)(); return; } //@@ 00a4ba70 FUN_00a4ba70 void FUN_00a4ba70(void) { epoxy_glUniformBlockBinding = (undefined *)FUN_00a2ca10(&DAT_00b3d188); /* WARNING: Could not recover jumptable at 0x00a4ba90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformBlockBinding)(); return; } //@@ 00a4baa0 FUN_00a4baa0 void FUN_00a4baa0(void) { epoxy_glUniformBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4bab8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformBufferEXT)(); return; } //@@ 00a4bac0 FUN_00a4bac0 void FUN_00a4bac0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniformHandleui64ARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glUniformHandleui64ARB)(param_1,param_2,param_3); return; } //@@ 00a4baf0 FUN_00a4baf0 void FUN_00a4baf0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniformHandleui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glUniformHandleui64NV)(param_1,param_2,param_3); return; } //@@ 00a4bb20 FUN_00a4bb20 void FUN_00a4bb20(void) { epoxy_glUniformHandleui64vARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4bb38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformHandleui64vARB)(); return; } //@@ 00a4bb40 FUN_00a4bb40 void FUN_00a4bb40(void) { epoxy_glUniformHandleui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4bb58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformHandleui64vNV)(); return; } //@@ 00a4bb60 FUN_00a4bb60 void FUN_00a4bb60(void) { epoxy_glUniformMatrix2dv = (undefined *)FUN_00a2ca10(&DAT_00b2a8a8); /* WARNING: Could not recover jumptable at 0x00a4bb80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2dv)(); return; } //@@ 00a4bb90 FUN_00a4bb90 void FUN_00a4bb90(void) { epoxy_glUniformMatrix2fv = (undefined *)FUN_00a2ca10(&DAT_00b258ec); /* WARNING: Could not recover jumptable at 0x00a4bbb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2fv)(); return; } //@@ 00a4bbc0 FUN_00a4bbc0 void FUN_00a4bbc0(void) { epoxy_glUniformMatrix2fvARB = (undefined *)FUN_00a2ca10(&DAT_00b2a7d4); /* WARNING: Could not recover jumptable at 0x00a4bbe0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2fvARB)(); return; } //@@ 00a4bbf0 FUN_00a4bbf0 void FUN_00a4bbf0(void) { epoxy_glUniformMatrix2x3dv = (undefined *)FUN_00a2ca10(&DAT_00b29828); /* WARNING: Could not recover jumptable at 0x00a4bc10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2x3dv)(); return; } //@@ 00a4bc20 FUN_00a4bc20 void FUN_00a4bc20(void) { epoxy_glUniformMatrix2x3fv = (undefined *)FUN_00a2ca10(&DAT_00b295f4); /* WARNING: Could not recover jumptable at 0x00a4bc40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2x3fv)(); return; } //@@ 00a4bc50 FUN_00a4bc50 void FUN_00a4bc50(void) { epoxy_glUniformMatrix2x3fvNV = (undefined *)FUN_00a2ca10(&DAT_00b3c738); /* WARNING: Could not recover jumptable at 0x00a4bc70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2x3fvNV)(); return; } //@@ 00a4bc80 FUN_00a4bc80 void FUN_00a4bc80(void) { epoxy_glUniformMatrix2x4dv = (undefined *)FUN_00a2ca10(&DAT_00b2a118); /* WARNING: Could not recover jumptable at 0x00a4bca0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2x4dv)(); return; } //@@ 00a4bcb0 FUN_00a4bcb0 void FUN_00a4bcb0(void) { epoxy_glUniformMatrix2x4fv = (undefined *)FUN_00a2ca10(&DAT_00b3b284); /* WARNING: Could not recover jumptable at 0x00a4bcd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2x4fv)(); return; } //@@ 00a4bce0 FUN_00a4bce0 void FUN_00a4bce0(void) { epoxy_glUniformMatrix2x4fvNV = (undefined *)FUN_00a2ca10(&DAT_00b26764); /* WARNING: Could not recover jumptable at 0x00a4bd00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix2x4fvNV)(); return; } //@@ 00a4bd10 FUN_00a4bd10 void FUN_00a4bd10(void) { epoxy_glUniformMatrix3dv = (undefined *)FUN_00a2ca10(&DAT_00b3bac0); /* WARNING: Could not recover jumptable at 0x00a4bd30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3dv)(); return; } //@@ 00a4bd40 FUN_00a4bd40 void FUN_00a4bd40(void) { epoxy_glUniformMatrix3fv = (undefined *)FUN_00a2ca10(&DAT_00b29424); /* WARNING: Could not recover jumptable at 0x00a4bd60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3fv)(); return; } //@@ 00a4bd70 FUN_00a4bd70 void FUN_00a4bd70(void) { epoxy_glUniformMatrix3fvARB = (undefined *)FUN_00a2ca10(&DAT_00b270b8); /* WARNING: Could not recover jumptable at 0x00a4bd90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3fvARB)(); return; } //@@ 00a4bda0 FUN_00a4bda0 void FUN_00a4bda0(void) { epoxy_glUniformMatrix3x2dv = (undefined *)FUN_00a2ca10(&DAT_00b3da94); /* WARNING: Could not recover jumptable at 0x00a4bdc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3x2dv)(); return; } //@@ 00a4bdd0 FUN_00a4bdd0 void FUN_00a4bdd0(void) { epoxy_glUniformMatrix3x2fv = (undefined *)FUN_00a2ca10(&DAT_00b2a4fc); /* WARNING: Could not recover jumptable at 0x00a4bdf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3x2fv)(); return; } //@@ 00a4be00 FUN_00a4be00 void FUN_00a4be00(void) { epoxy_glUniformMatrix3x2fvNV = (undefined *)FUN_00a2ca10(&DAT_00b29b5c); /* WARNING: Could not recover jumptable at 0x00a4be20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3x2fvNV)(); return; } //@@ 00a4be30 FUN_00a4be30 void FUN_00a4be30(void) { epoxy_glUniformMatrix3x4dv = (undefined *)FUN_00a2ca10(&DAT_00b3d128); /* WARNING: Could not recover jumptable at 0x00a4be50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3x4dv)(); return; } //@@ 00a4be60 FUN_00a4be60 void FUN_00a4be60(void) { epoxy_glUniformMatrix3x4fv = (undefined *)FUN_00a2ca10(&DAT_00b2ae3c); /* WARNING: Could not recover jumptable at 0x00a4be80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3x4fv)(); return; } //@@ 00a4be90 FUN_00a4be90 void FUN_00a4be90(void) { epoxy_glUniformMatrix3x4fvNV = (undefined *)FUN_00a2ca10(&DAT_00b26330); /* WARNING: Could not recover jumptable at 0x00a4beb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix3x4fvNV)(); return; } //@@ 00a4bec0 FUN_00a4bec0 void FUN_00a4bec0(void) { epoxy_glUniformMatrix4dv = (undefined *)FUN_00a2ca10(&DAT_00b29c38); /* WARNING: Could not recover jumptable at 0x00a4bee0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4dv)(); return; } //@@ 00a4bef0 FUN_00a4bef0 void FUN_00a4bef0(void) { epoxy_glUniformMatrix4fv = (undefined *)FUN_00a2ca10(&DAT_00b28ca4); /* WARNING: Could not recover jumptable at 0x00a4bf10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4fv)(); return; } //@@ 00a4bf20 FUN_00a4bf20 void FUN_00a4bf20(void) { epoxy_glUniformMatrix4fvARB = (undefined *)FUN_00a2ca10(&DAT_00b2a3b4); /* WARNING: Could not recover jumptable at 0x00a4bf40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4fvARB)(); return; } //@@ 00a4bf50 FUN_00a4bf50 void FUN_00a4bf50(void) { epoxy_glUniformMatrix4x2dv = (undefined *)FUN_00a2ca10(&DAT_00b252b0); /* WARNING: Could not recover jumptable at 0x00a4bf70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4x2dv)(); return; } //@@ 00a4bf80 FUN_00a4bf80 void FUN_00a4bf80(void) { epoxy_glUniformMatrix4x2fv = (undefined *)FUN_00a2ca10(&DAT_00b28c24); /* WARNING: Could not recover jumptable at 0x00a4bfa0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4x2fv)(); return; } //@@ 00a4bfb0 FUN_00a4bfb0 void FUN_00a4bfb0(void) { epoxy_glUniformMatrix4x2fvNV = (undefined *)FUN_00a2ca10(&DAT_00b3bf90); /* WARNING: Could not recover jumptable at 0x00a4bfd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4x2fvNV)(); return; } //@@ 00a4bfe0 FUN_00a4bfe0 void FUN_00a4bfe0(void) { epoxy_glUniformMatrix4x3dv = (undefined *)FUN_00a2ca10(&DAT_00b3d874); /* WARNING: Could not recover jumptable at 0x00a4c000. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4x3dv)(); return; } //@@ 00a4c010 FUN_00a4c010 void FUN_00a4c010(void) { epoxy_glUniformMatrix4x3fv = (undefined *)FUN_00a2ca10(&DAT_00b3b614); /* WARNING: Could not recover jumptable at 0x00a4c030. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4x3fv)(); return; } //@@ 00a4c040 FUN_00a4c040 void FUN_00a4c040(void) { epoxy_glUniformMatrix4x3fvNV = (undefined *)FUN_00a2ca10(&DAT_00b258f8); /* WARNING: Could not recover jumptable at 0x00a4c060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformMatrix4x3fvNV)(); return; } //@@ 00a4c070 FUN_00a4c070 void FUN_00a4c070(void) { epoxy_glUniformSubroutinesuiv = (undefined *)FUN_00a2ca10(&DAT_00b29824); /* WARNING: Could not recover jumptable at 0x00a4c090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformSubroutinesuiv)(); return; } //@@ 00a4c0a0 FUN_00a4c0a0 void FUN_00a4c0a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glUniformui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glUniformui64NV)(param_1,param_2,param_3); return; } //@@ 00a4c0d0 FUN_00a4c0d0 void FUN_00a4c0d0(void) { epoxy_glUniformui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c0e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUniformui64vNV)(); return; } //@@ 00a4c110 FUN_00a4c110 void FUN_00a4c110(void) { epoxy_glUnmapBuffer = (undefined *)FUN_00a2ca10(&DAT_00b284b4); /* WARNING: Could not recover jumptable at 0x00a4c130. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapBuffer)(); return; } //@@ 00a4c140 FUN_00a4c140 void FUN_00a4c140(void) { epoxy_glUnmapBufferARB = (undefined *)FUN_00a2ca10(&DAT_00b3c790); /* WARNING: Could not recover jumptable at 0x00a4c160. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapBufferARB)(); return; } //@@ 00a4c170 FUN_00a4c170 void FUN_00a4c170(void) { epoxy_glUnmapBufferOES = (undefined *)FUN_00a2ca10(&DAT_00b3cec4); /* WARNING: Could not recover jumptable at 0x00a4c190. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapBufferOES)(); return; } //@@ 00a4c1a0 FUN_00a4c1a0 void FUN_00a4c1a0(void) { epoxy_glUnmapNamedBuffer = (undefined *)FUN_00a2ca10(&DAT_00b279a8); /* WARNING: Could not recover jumptable at 0x00a4c1c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapNamedBuffer)(); return; } //@@ 00a4c1d0 FUN_00a4c1d0 void FUN_00a4c1d0(void) { epoxy_glUnmapNamedBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c1e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapNamedBufferEXT)(); return; } //@@ 00a4c1f0 FUN_00a4c1f0 void FUN_00a4c1f0(void) { epoxy_glUnmapObjectBufferATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapObjectBufferATI)(); return; } //@@ 00a4c210 FUN_00a4c210 void FUN_00a4c210(void) { epoxy_glUnmapTexture2DINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c228. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUnmapTexture2DINTEL)(); return; } //@@ 00a4c230 FUN_00a4c230 void FUN_00a4c230(void) { epoxy_glUpdateObjectBufferATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c248. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUpdateObjectBufferATI)(); return; } //@@ 00a4c250 FUN_00a4c250 void FUN_00a4c250(void) { epoxy_glUseProgram = (undefined *)FUN_00a2ca10(&DAT_00b2a7b8); /* WARNING: Could not recover jumptable at 0x00a4c270. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUseProgram)(); return; } //@@ 00a4c280 FUN_00a4c280 void FUN_00a4c280(void) { epoxy_glUseProgramObjectARB = (undefined *)FUN_00a2ca10(&DAT_00b2abdc); /* WARNING: Could not recover jumptable at 0x00a4c2a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUseProgramObjectARB)(); return; } //@@ 00a4c2b0 FUN_00a4c2b0 void FUN_00a4c2b0(void) { epoxy_glUseProgramStages = (undefined *)FUN_00a2ca10(&DAT_00b26708); /* WARNING: Could not recover jumptable at 0x00a4c2d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUseProgramStages)(); return; } //@@ 00a4c2e0 FUN_00a4c2e0 void FUN_00a4c2e0(void) { epoxy_glUseProgramStagesEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c2f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUseProgramStagesEXT)(); return; } //@@ 00a4c300 FUN_00a4c300 void FUN_00a4c300(void) { epoxy_glUseShaderProgramEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glUseShaderProgramEXT)(); return; } //@@ 00a4c340 FUN_00a4c340 void FUN_00a4c340(void) { epoxy_glVDPAUGetSurfaceivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c358. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUGetSurfaceivNV)(); return; } //@@ 00a4c360 FUN_00a4c360 void FUN_00a4c360(void) { epoxy_glVDPAUInitNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUInitNV)(); return; } //@@ 00a4c380 FUN_00a4c380 void FUN_00a4c380(void) { epoxy_glVDPAUIsSurfaceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUIsSurfaceNV)(); return; } //@@ 00a4c3a0 FUN_00a4c3a0 void FUN_00a4c3a0(void) { epoxy_glVDPAUMapSurfacesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c3b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUMapSurfacesNV)(); return; } //@@ 00a4c3c0 FUN_00a4c3c0 void FUN_00a4c3c0(void) { epoxy_glVDPAURegisterOutputSurfaceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c3d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAURegisterOutputSurfaceNV)(); return; } //@@ 00a4c3e0 FUN_00a4c3e0 void FUN_00a4c3e0(void) { epoxy_glVDPAURegisterVideoSurfaceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c3f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAURegisterVideoSurfaceNV)(); return; } //@@ 00a4c400 FUN_00a4c400 void FUN_00a4c400(void) { epoxy_glVDPAUSurfaceAccessNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUSurfaceAccessNV)(); return; } //@@ 00a4c420 FUN_00a4c420 void FUN_00a4c420(void) { epoxy_glVDPAUUnmapSurfacesNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c438. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUUnmapSurfacesNV)(); return; } //@@ 00a4c440 FUN_00a4c440 void FUN_00a4c440(void) { epoxy_glVDPAUUnregisterSurfaceNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c458. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVDPAUUnregisterSurfaceNV)(); return; } //@@ 00a4c460 FUN_00a4c460 void FUN_00a4c460(void) { epoxy_glValidateProgram = (undefined *)FUN_00a2ca10(&DAT_00b2719c); /* WARNING: Could not recover jumptable at 0x00a4c480. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glValidateProgram)(); return; } //@@ 00a4c490 FUN_00a4c490 void FUN_00a4c490(void) { epoxy_glValidateProgramARB = (undefined *)FUN_00a2ca10(&DAT_00b3cbac); /* WARNING: Could not recover jumptable at 0x00a4c4b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glValidateProgramARB)(); return; } //@@ 00a4c4c0 FUN_00a4c4c0 void FUN_00a4c4c0(void) { epoxy_glValidateProgramPipeline = (undefined *)FUN_00a2ca10(&DAT_00b3b2f4); /* WARNING: Could not recover jumptable at 0x00a4c4e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glValidateProgramPipeline)(); return; } //@@ 00a4c4f0 FUN_00a4c4f0 void FUN_00a4c4f0(void) { epoxy_glValidateProgramPipelineEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c508. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glValidateProgramPipelineEXT)(); return; } //@@ 00a4c510 FUN_00a4c510 void FUN_00a4c510(void) { epoxy_glVariantArrayObjectATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantArrayObjectATI)(); return; } //@@ 00a4c530 FUN_00a4c530 void FUN_00a4c530(void) { epoxy_glVariantPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c548. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantPointerEXT)(); return; } //@@ 00a4c550 FUN_00a4c550 void FUN_00a4c550(void) { epoxy_glVariantbvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c568. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantbvEXT)(); return; } //@@ 00a4c570 FUN_00a4c570 void FUN_00a4c570(void) { epoxy_glVariantdvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c588. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantdvEXT)(); return; } //@@ 00a4c590 FUN_00a4c590 void FUN_00a4c590(void) { epoxy_glVariantfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c5a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantfvEXT)(); return; } //@@ 00a4c5b0 FUN_00a4c5b0 void FUN_00a4c5b0(void) { epoxy_glVariantivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c5c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantivEXT)(); return; } //@@ 00a4c5d0 FUN_00a4c5d0 void FUN_00a4c5d0(void) { epoxy_glVariantsvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c5e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantsvEXT)(); return; } //@@ 00a4c5f0 FUN_00a4c5f0 void FUN_00a4c5f0(void) { epoxy_glVariantubvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c608. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantubvEXT)(); return; } //@@ 00a4c610 FUN_00a4c610 void FUN_00a4c610(void) { epoxy_glVariantuivEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c628. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantuivEXT)(); return; } //@@ 00a4c630 FUN_00a4c630 void FUN_00a4c630(void) { epoxy_glVariantusvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c648. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVariantusvEXT)(); return; } //@@ 00a4c650 FUN_00a4c650 void FUN_00a4c650(void) { epoxy_glVertex2bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c668. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2bOES)(); return; } //@@ 00a4c670 FUN_00a4c670 void FUN_00a4c670(void) { epoxy_glVertex2bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c688. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2bvOES)(); return; } //@@ 00a4c690 FUN_00a4c690 void FUN_00a4c690(undefined8 param_1,undefined8 param_2) { epoxy_glVertex2d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertex2d)(param_1,param_2); return; } //@@ 00a4c6d0 FUN_00a4c6d0 void FUN_00a4c6d0(void) { epoxy_glVertex2dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c6e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2dv)(); return; } //@@ 00a4c6f0 FUN_00a4c6f0 void FUN_00a4c6f0(undefined4 param_1,undefined4 param_2) { epoxy_glVertex2f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertex2f)(param_1,param_2); return; } //@@ 00a4c730 FUN_00a4c730 void FUN_00a4c730(void) { epoxy_glVertex2fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2fv)(); return; } //@@ 00a4c750 FUN_00a4c750 void FUN_00a4c750(void) { epoxy_glVertex2hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c768. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2hNV)(); return; } //@@ 00a4c770 FUN_00a4c770 void FUN_00a4c770(void) { epoxy_glVertex2hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c788. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2hvNV)(); return; } //@@ 00a4c790 FUN_00a4c790 void FUN_00a4c790(void) { epoxy_glVertex2i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c7a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2i)(); return; } //@@ 00a4c7b0 FUN_00a4c7b0 void FUN_00a4c7b0(void) { epoxy_glVertex2iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c7c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2iv)(); return; } //@@ 00a4c7d0 FUN_00a4c7d0 void FUN_00a4c7d0(void) { epoxy_glVertex2s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c7e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2s)(); return; } //@@ 00a4c7f0 FUN_00a4c7f0 void FUN_00a4c7f0(void) { epoxy_glVertex2sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c808. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2sv)(); return; } //@@ 00a4c810 FUN_00a4c810 void FUN_00a4c810(void) { epoxy_glVertex2xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c828. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2xOES)(); return; } //@@ 00a4c830 FUN_00a4c830 void FUN_00a4c830(void) { epoxy_glVertex2xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c848. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex2xvOES)(); return; } //@@ 00a4c850 FUN_00a4c850 void FUN_00a4c850(void) { epoxy_glVertex3bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3bOES)(); return; } //@@ 00a4c870 FUN_00a4c870 void FUN_00a4c870(void) { epoxy_glVertex3bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3bvOES)(); return; } //@@ 00a4c890 FUN_00a4c890 void FUN_00a4c890(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertex3d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertex3d)(param_1,param_2,param_3); return; } //@@ 00a4c8e0 FUN_00a4c8e0 void FUN_00a4c8e0(void) { epoxy_glVertex3dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c8f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3dv)(); return; } //@@ 00a4c900 FUN_00a4c900 void FUN_00a4c900(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertex3f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertex3f)(param_1,param_2,param_3); return; } //@@ 00a4c940 FUN_00a4c940 void FUN_00a4c940(void) { epoxy_glVertex3fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c958. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3fv)(); return; } //@@ 00a4c960 FUN_00a4c960 void FUN_00a4c960(void) { epoxy_glVertex3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c978. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3hNV)(); return; } //@@ 00a4c980 FUN_00a4c980 void FUN_00a4c980(void) { epoxy_glVertex3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c998. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3hvNV)(); return; } //@@ 00a4c9a0 FUN_00a4c9a0 void FUN_00a4c9a0(void) { epoxy_glVertex3i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c9b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3i)(); return; } //@@ 00a4c9c0 FUN_00a4c9c0 void FUN_00a4c9c0(void) { epoxy_glVertex3iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c9d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3iv)(); return; } //@@ 00a4c9e0 FUN_00a4c9e0 void FUN_00a4c9e0(void) { epoxy_glVertex3s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4c9f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3s)(); return; } //@@ 00a4ca00 FUN_00a4ca00 void FUN_00a4ca00(void) { epoxy_glVertex3sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ca18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3sv)(); return; } //@@ 00a4ca20 FUN_00a4ca20 void FUN_00a4ca20(void) { epoxy_glVertex3xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ca38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3xOES)(); return; } //@@ 00a4ca40 FUN_00a4ca40 void FUN_00a4ca40(void) { epoxy_glVertex3xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ca58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex3xvOES)(); return; } //@@ 00a4ca60 FUN_00a4ca60 void FUN_00a4ca60(void) { epoxy_glVertex4bOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ca78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4bOES)(); return; } //@@ 00a4ca80 FUN_00a4ca80 void FUN_00a4ca80(void) { epoxy_glVertex4bvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ca98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4bvOES)(); return; } //@@ 00a4caa0 FUN_00a4caa0 void FUN_00a4caa0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertex4d = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertex4d)(param_1,param_2,param_3,param_4); return; } //@@ 00a4caf0 FUN_00a4caf0 void FUN_00a4caf0(void) { epoxy_glVertex4dv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cb08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4dv)(); return; } //@@ 00a4cb10 FUN_00a4cb10 void FUN_00a4cb10(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glVertex4f = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertex4f)(param_1,param_2,param_3,param_4); return; } //@@ 00a4cb60 FUN_00a4cb60 void FUN_00a4cb60(void) { epoxy_glVertex4fv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cb78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4fv)(); return; } //@@ 00a4cb80 FUN_00a4cb80 void FUN_00a4cb80(void) { epoxy_glVertex4hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cb98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4hNV)(); return; } //@@ 00a4cba0 FUN_00a4cba0 void FUN_00a4cba0(void) { epoxy_glVertex4hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cbb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4hvNV)(); return; } //@@ 00a4cbc0 FUN_00a4cbc0 void FUN_00a4cbc0(void) { epoxy_glVertex4i = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cbd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4i)(); return; } //@@ 00a4cbe0 FUN_00a4cbe0 void FUN_00a4cbe0(void) { epoxy_glVertex4iv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cbf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4iv)(); return; } //@@ 00a4cc00 FUN_00a4cc00 void FUN_00a4cc00(void) { epoxy_glVertex4s = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cc18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4s)(); return; } //@@ 00a4cc20 FUN_00a4cc20 void FUN_00a4cc20(void) { epoxy_glVertex4sv = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cc38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4sv)(); return; } //@@ 00a4cc40 FUN_00a4cc40 void FUN_00a4cc40(void) { epoxy_glVertex4xOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cc58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4xOES)(); return; } //@@ 00a4cc60 FUN_00a4cc60 void FUN_00a4cc60(void) { epoxy_glVertex4xvOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cc78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertex4xvOES)(); return; } //@@ 00a4cc80 FUN_00a4cc80 void FUN_00a4cc80(void) { epoxy_glVertexArrayAttribBinding = (undefined *)FUN_00a2ca10(&DAT_00b3c47c); /* WARNING: Could not recover jumptable at 0x00a4cca0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayAttribBinding)(); return; } //@@ 00a4ccb0 FUN_00a4ccb0 void FUN_00a4ccb0(void) { epoxy_glVertexArrayAttribFormat = (undefined *)FUN_00a2ca10(&DAT_00b3c610); /* WARNING: Could not recover jumptable at 0x00a4ccd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayAttribFormat)(); return; } //@@ 00a4cce0 FUN_00a4cce0 void FUN_00a4cce0(void) { epoxy_glVertexArrayAttribIFormat = (undefined *)FUN_00a2ca10(&DAT_00b2adc8); /* WARNING: Could not recover jumptable at 0x00a4cd00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayAttribIFormat)(); return; } //@@ 00a4cd10 FUN_00a4cd10 void FUN_00a4cd10(void) { epoxy_glVertexArrayAttribLFormat = (undefined *)FUN_00a2ca10(&DAT_00b295d8); /* WARNING: Could not recover jumptable at 0x00a4cd30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayAttribLFormat)(); return; } //@@ 00a4cd40 FUN_00a4cd40 void FUN_00a4cd40(void) { epoxy_glVertexArrayBindVertexBufferEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cd58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayBindVertexBufferEXT)(); return; } //@@ 00a4cd60 FUN_00a4cd60 void FUN_00a4cd60(void) { epoxy_glVertexArrayBindingDivisor = (undefined *)FUN_00a2ca10(&DAT_00b26b20); /* WARNING: Could not recover jumptable at 0x00a4cd80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayBindingDivisor)(); return; } //@@ 00a4cd90 FUN_00a4cd90 void FUN_00a4cd90(void) { epoxy_glVertexArrayColorOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cda8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayColorOffsetEXT)(); return; } //@@ 00a4cdb0 FUN_00a4cdb0 void FUN_00a4cdb0(void) { epoxy_glVertexArrayEdgeFlagOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cdc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayEdgeFlagOffsetEXT)(); return; } //@@ 00a4cdd0 FUN_00a4cdd0 void FUN_00a4cdd0(void) { epoxy_glVertexArrayElementBuffer = (undefined *)FUN_00a2ca10(&DAT_00b3b05c); /* WARNING: Could not recover jumptable at 0x00a4cdf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayElementBuffer)(); return; } //@@ 00a4ce00 FUN_00a4ce00 void FUN_00a4ce00(void) { epoxy_glVertexArrayFogCoordOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ce18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayFogCoordOffsetEXT)(); return; } //@@ 00a4ce20 FUN_00a4ce20 void FUN_00a4ce20(void) { epoxy_glVertexArrayIndexOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ce38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayIndexOffsetEXT)(); return; } //@@ 00a4ce40 FUN_00a4ce40 void FUN_00a4ce40(void) { epoxy_glVertexArrayMultiTexCoordOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ce58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayMultiTexCoordOffsetEXT)(); return; } //@@ 00a4ce60 FUN_00a4ce60 void FUN_00a4ce60(void) { epoxy_glVertexArrayNormalOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ce78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayNormalOffsetEXT)(); return; } //@@ 00a4ce80 FUN_00a4ce80 void FUN_00a4ce80(void) { epoxy_glVertexArrayParameteriAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ce98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayParameteriAPPLE)(); return; } //@@ 00a4cea0 FUN_00a4cea0 void FUN_00a4cea0(void) { epoxy_glVertexArrayRangeAPPLE = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ceb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayRangeAPPLE)(); return; } //@@ 00a4cec0 FUN_00a4cec0 void FUN_00a4cec0(void) { epoxy_glVertexArrayRangeNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ced8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayRangeNV)(); return; } //@@ 00a4cee0 FUN_00a4cee0 void FUN_00a4cee0(void) { epoxy_glVertexArraySecondaryColorOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cef8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArraySecondaryColorOffsetEXT)(); return; } //@@ 00a4cf00 FUN_00a4cf00 void FUN_00a4cf00(void) { epoxy_glVertexArrayTexCoordOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cf18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayTexCoordOffsetEXT)(); return; } //@@ 00a4cf20 FUN_00a4cf20 void FUN_00a4cf20(void) { epoxy_glVertexArrayVertexAttribBindingEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cf38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribBindingEXT)(); return; } //@@ 00a4cf40 FUN_00a4cf40 void FUN_00a4cf40(void) { epoxy_glVertexArrayVertexAttribDivisorEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cf58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribDivisorEXT)(); return; } //@@ 00a4cf60 FUN_00a4cf60 void FUN_00a4cf60(void) { epoxy_glVertexArrayVertexAttribFormatEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cf78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribFormatEXT)(); return; } //@@ 00a4cf80 FUN_00a4cf80 void FUN_00a4cf80(void) { epoxy_glVertexArrayVertexAttribIFormatEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cf98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribIFormatEXT)(); return; } //@@ 00a4cfa0 FUN_00a4cfa0 void FUN_00a4cfa0(void) { epoxy_glVertexArrayVertexAttribIOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cfb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribIOffsetEXT)(); return; } //@@ 00a4cfc0 FUN_00a4cfc0 void FUN_00a4cfc0(void) { epoxy_glVertexArrayVertexAttribLFormatEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cfd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribLFormatEXT)(); return; } //@@ 00a4cfe0 FUN_00a4cfe0 void FUN_00a4cfe0(void) { epoxy_glVertexArrayVertexAttribLOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4cff8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribLOffsetEXT)(); return; } //@@ 00a4d000 FUN_00a4d000 void FUN_00a4d000(void) { epoxy_glVertexArrayVertexAttribOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d018. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexAttribOffsetEXT)(); return; } //@@ 00a4d020 FUN_00a4d020 void FUN_00a4d020(void) { epoxy_glVertexArrayVertexBindingDivisorEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d038. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexBindingDivisorEXT)(); return; } //@@ 00a4d040 FUN_00a4d040 void FUN_00a4d040(void) { epoxy_glVertexArrayVertexBuffer = (undefined *)FUN_00a2ca10(&DAT_00b3b858); /* WARNING: Could not recover jumptable at 0x00a4d060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexBuffer)(); return; } //@@ 00a4d070 FUN_00a4d070 void FUN_00a4d070(void) { epoxy_glVertexArrayVertexBuffers = (undefined *)FUN_00a2ca10(&DAT_00b2ac08); /* WARNING: Could not recover jumptable at 0x00a4d090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexBuffers)(); return; } //@@ 00a4d0a0 FUN_00a4d0a0 void FUN_00a4d0a0(void) { epoxy_glVertexArrayVertexOffsetEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d0b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexArrayVertexOffsetEXT)(); return; } //@@ 00a4d0c0 FUN_00a4d0c0 void FUN_00a4d0c0(undefined4 param_1,undefined8 param_2) { epoxy_glVertexAttrib1d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib1d)(param_1,param_2); return; } //@@ 00a4d0f0 FUN_00a4d0f0 void FUN_00a4d0f0(undefined4 param_1,undefined8 param_2) { epoxy_glVertexAttrib1dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib1dARB)(param_1,param_2); return; } //@@ 00a4d120 FUN_00a4d120 void FUN_00a4d120(undefined4 param_1,undefined8 param_2) { epoxy_glVertexAttrib1dNV = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib1dNV)(param_1,param_2); return; } //@@ 00a4d150 FUN_00a4d150 void FUN_00a4d150(void) { epoxy_glVertexAttrib1dv = (undefined *)FUN_00a2ca10(&DAT_00b2aa64); /* WARNING: Could not recover jumptable at 0x00a4d170. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1dv)(); return; } //@@ 00a4d180 FUN_00a4d180 void FUN_00a4d180(void) { epoxy_glVertexAttrib1dvARB = (undefined *)FUN_00a2ca10(&DAT_00b29e88); /* WARNING: Could not recover jumptable at 0x00a4d1a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1dvARB)(); return; } //@@ 00a4d1b0 FUN_00a4d1b0 void FUN_00a4d1b0(void) { epoxy_glVertexAttrib1dvNV = (undefined *)FUN_00a2ca10(&DAT_00b3c8a4); /* WARNING: Could not recover jumptable at 0x00a4d1d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1dvNV)(); return; } //@@ 00a4d1e0 FUN_00a4d1e0 void FUN_00a4d1e0(undefined4 param_1,undefined4 param_2) { epoxy_glVertexAttrib1f = (undefined *)FUN_00a2ca10(&DAT_00b277b8); (*(code *)epoxy_glVertexAttrib1f)(param_1,param_2); return; } //@@ 00a4d210 FUN_00a4d210 void FUN_00a4d210(undefined4 param_1,undefined4 param_2) { epoxy_glVertexAttrib1fARB = (undefined *)FUN_00a2ca10(&DAT_00b29908); (*(code *)epoxy_glVertexAttrib1fARB)(param_1,param_2); return; } //@@ 00a4d240 FUN_00a4d240 void FUN_00a4d240(undefined4 param_1,undefined4 param_2) { epoxy_glVertexAttrib1fNV = (undefined *)FUN_00a2ca10(&DAT_00b29864); (*(code *)epoxy_glVertexAttrib1fNV)(param_1,param_2); return; } //@@ 00a4d270 FUN_00a4d270 void FUN_00a4d270(void) { epoxy_glVertexAttrib1fv = (undefined *)FUN_00a2ca10(&DAT_00b3b694); /* WARNING: Could not recover jumptable at 0x00a4d290. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1fv)(); return; } //@@ 00a4d2a0 FUN_00a4d2a0 void FUN_00a4d2a0(void) { epoxy_glVertexAttrib1fvARB = (undefined *)FUN_00a2ca10(&DAT_00b26258); /* WARNING: Could not recover jumptable at 0x00a4d2c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1fvARB)(); return; } //@@ 00a4d2d0 FUN_00a4d2d0 void FUN_00a4d2d0(void) { epoxy_glVertexAttrib1fvNV = (undefined *)FUN_00a2ca10(&DAT_00b26358); /* WARNING: Could not recover jumptable at 0x00a4d2f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1fvNV)(); return; } //@@ 00a4d300 FUN_00a4d300 void FUN_00a4d300(void) { epoxy_glVertexAttrib1hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d318. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1hNV)(); return; } //@@ 00a4d320 FUN_00a4d320 void FUN_00a4d320(void) { epoxy_glVertexAttrib1hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d338. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1hvNV)(); return; } //@@ 00a4d340 FUN_00a4d340 void FUN_00a4d340(void) { epoxy_glVertexAttrib1s = (undefined *)FUN_00a2ca10(&DAT_00b2643c); /* WARNING: Could not recover jumptable at 0x00a4d360. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1s)(); return; } //@@ 00a4d370 FUN_00a4d370 void FUN_00a4d370(void) { epoxy_glVertexAttrib1sARB = (undefined *)FUN_00a2ca10(&DAT_00b25818); /* WARNING: Could not recover jumptable at 0x00a4d390. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1sARB)(); return; } //@@ 00a4d3a0 FUN_00a4d3a0 void FUN_00a4d3a0(void) { epoxy_glVertexAttrib1sNV = (undefined *)FUN_00a2ca10(&DAT_00b27c94); /* WARNING: Could not recover jumptable at 0x00a4d3c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1sNV)(); return; } //@@ 00a4d3d0 FUN_00a4d3d0 void FUN_00a4d3d0(void) { epoxy_glVertexAttrib1sv = (undefined *)FUN_00a2ca10(&DAT_00b3d664); /* WARNING: Could not recover jumptable at 0x00a4d3f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1sv)(); return; } //@@ 00a4d400 FUN_00a4d400 void FUN_00a4d400(void) { epoxy_glVertexAttrib1svARB = (undefined *)FUN_00a2ca10(&DAT_00b26670); /* WARNING: Could not recover jumptable at 0x00a4d420. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1svARB)(); return; } //@@ 00a4d430 FUN_00a4d430 void FUN_00a4d430(void) { epoxy_glVertexAttrib1svNV = (undefined *)FUN_00a2ca10(&DAT_00b2a008); /* WARNING: Could not recover jumptable at 0x00a4d450. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib1svNV)(); return; } //@@ 00a4d460 FUN_00a4d460 void FUN_00a4d460(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertexAttrib2d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib2d)(param_1,param_2,param_3); return; } //@@ 00a4d4b0 FUN_00a4d4b0 void FUN_00a4d4b0(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertexAttrib2dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib2dARB)(param_1,param_2,param_3); return; } //@@ 00a4d500 FUN_00a4d500 void FUN_00a4d500(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertexAttrib2dNV = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib2dNV)(param_1,param_2,param_3); return; } //@@ 00a4d550 FUN_00a4d550 void FUN_00a4d550(void) { epoxy_glVertexAttrib2dv = (undefined *)FUN_00a2ca10(&DAT_00b27ed8); /* WARNING: Could not recover jumptable at 0x00a4d570. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2dv)(); return; } //@@ 00a4d580 FUN_00a4d580 void FUN_00a4d580(void) { epoxy_glVertexAttrib2dvARB = (undefined *)FUN_00a2ca10(&DAT_00b283e8); /* WARNING: Could not recover jumptable at 0x00a4d5a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2dvARB)(); return; } //@@ 00a4d5b0 FUN_00a4d5b0 void FUN_00a4d5b0(void) { epoxy_glVertexAttrib2dvNV = (undefined *)FUN_00a2ca10(&DAT_00b3b228); /* WARNING: Could not recover jumptable at 0x00a4d5d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2dvNV)(); return; } //@@ 00a4d5e0 FUN_00a4d5e0 void FUN_00a4d5e0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexAttrib2f = (undefined *)FUN_00a2ca10(&DAT_00b3c930); (*(code *)epoxy_glVertexAttrib2f)(param_1,param_2,param_3); return; } //@@ 00a4d620 FUN_00a4d620 void FUN_00a4d620(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexAttrib2fARB = (undefined *)FUN_00a2ca10(&DAT_00b3d4c4); (*(code *)epoxy_glVertexAttrib2fARB)(param_1,param_2,param_3); return; } //@@ 00a4d660 FUN_00a4d660 void FUN_00a4d660(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexAttrib2fNV = (undefined *)FUN_00a2ca10(&DAT_00b25460); (*(code *)epoxy_glVertexAttrib2fNV)(param_1,param_2,param_3); return; } //@@ 00a4d6a0 FUN_00a4d6a0 void FUN_00a4d6a0(void) { epoxy_glVertexAttrib2fv = (undefined *)FUN_00a2ca10(&DAT_00b29274); /* WARNING: Could not recover jumptable at 0x00a4d6c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2fv)(); return; } //@@ 00a4d6d0 FUN_00a4d6d0 void FUN_00a4d6d0(void) { epoxy_glVertexAttrib2fvARB = (undefined *)FUN_00a2ca10(&DAT_00b2588c); /* WARNING: Could not recover jumptable at 0x00a4d6f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2fvARB)(); return; } //@@ 00a4d700 FUN_00a4d700 void FUN_00a4d700(void) { epoxy_glVertexAttrib2fvNV = (undefined *)FUN_00a2ca10(&DAT_00b251a0); /* WARNING: Could not recover jumptable at 0x00a4d720. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2fvNV)(); return; } //@@ 00a4d730 FUN_00a4d730 void FUN_00a4d730(void) { epoxy_glVertexAttrib2hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d748. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2hNV)(); return; } //@@ 00a4d750 FUN_00a4d750 void FUN_00a4d750(void) { epoxy_glVertexAttrib2hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4d768. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2hvNV)(); return; } //@@ 00a4d770 FUN_00a4d770 void FUN_00a4d770(void) { epoxy_glVertexAttrib2s = (undefined *)FUN_00a2ca10(&DAT_00b288fc); /* WARNING: Could not recover jumptable at 0x00a4d790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2s)(); return; } //@@ 00a4d7a0 FUN_00a4d7a0 void FUN_00a4d7a0(void) { epoxy_glVertexAttrib2sARB = (undefined *)FUN_00a2ca10(&DAT_00b275e8); /* WARNING: Could not recover jumptable at 0x00a4d7c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2sARB)(); return; } //@@ 00a4d7d0 FUN_00a4d7d0 void FUN_00a4d7d0(void) { epoxy_glVertexAttrib2sNV = (undefined *)FUN_00a2ca10(&DAT_00b27974); /* WARNING: Could not recover jumptable at 0x00a4d7f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2sNV)(); return; } //@@ 00a4d800 FUN_00a4d800 void FUN_00a4d800(void) { epoxy_glVertexAttrib2sv = (undefined *)FUN_00a2ca10(&DAT_00b27c68); /* WARNING: Could not recover jumptable at 0x00a4d820. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2sv)(); return; } //@@ 00a4d830 FUN_00a4d830 void FUN_00a4d830(void) { epoxy_glVertexAttrib2svARB = (undefined *)FUN_00a2ca10(&DAT_00b266f8); /* WARNING: Could not recover jumptable at 0x00a4d850. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2svARB)(); return; } //@@ 00a4d860 FUN_00a4d860 void FUN_00a4d860(void) { epoxy_glVertexAttrib2svNV = (undefined *)FUN_00a2ca10(&DAT_00b26a20); /* WARNING: Could not recover jumptable at 0x00a4d880. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib2svNV)(); return; } //@@ 00a4d890 FUN_00a4d890 void FUN_00a4d890(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertexAttrib3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib3d)(param_1,param_2,param_3,param_4); return; } //@@ 00a4d8e0 FUN_00a4d8e0 void FUN_00a4d8e0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertexAttrib3dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib3dARB)(param_1,param_2,param_3,param_4); return; } //@@ 00a4d930 FUN_00a4d930 void FUN_00a4d930(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertexAttrib3dNV = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib3dNV)(param_1,param_2,param_3,param_4); return; } //@@ 00a4d980 FUN_00a4d980 void FUN_00a4d980(void) { epoxy_glVertexAttrib3dv = (undefined *)FUN_00a2ca10(&DAT_00b3ba74); /* WARNING: Could not recover jumptable at 0x00a4d9a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3dv)(); return; } //@@ 00a4d9b0 FUN_00a4d9b0 void FUN_00a4d9b0(void) { epoxy_glVertexAttrib3dvARB = (undefined *)FUN_00a2ca10(&DAT_00b263e0); /* WARNING: Could not recover jumptable at 0x00a4d9d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3dvARB)(); return; } //@@ 00a4d9e0 FUN_00a4d9e0 void FUN_00a4d9e0(void) { epoxy_glVertexAttrib3dvNV = (undefined *)FUN_00a2ca10(&DAT_00b25ed4); /* WARNING: Could not recover jumptable at 0x00a4da00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3dvNV)(); return; } //@@ 00a4da10 FUN_00a4da10 void FUN_00a4da10(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glVertexAttrib3f = (undefined *)FUN_00a2ca10(&DAT_00b28340); (*(code *)epoxy_glVertexAttrib3f)(param_1,param_2,param_3,param_4); return; } //@@ 00a4da60 FUN_00a4da60 void FUN_00a4da60(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glVertexAttrib3fARB = (undefined *)FUN_00a2ca10(&DAT_00b3cd08); (*(code *)epoxy_glVertexAttrib3fARB)(param_1,param_2,param_3,param_4); return; } //@@ 00a4dab0 FUN_00a4dab0 void FUN_00a4dab0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glVertexAttrib3fNV = (undefined *)FUN_00a2ca10(&DAT_00b3d4a4); (*(code *)epoxy_glVertexAttrib3fNV)(param_1,param_2,param_3,param_4); return; } //@@ 00a4db00 FUN_00a4db00 void FUN_00a4db00(void) { epoxy_glVertexAttrib3fv = (undefined *)FUN_00a2ca10(&DAT_00b28120); /* WARNING: Could not recover jumptable at 0x00a4db20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3fv)(); return; } //@@ 00a4db30 FUN_00a4db30 void FUN_00a4db30(void) { epoxy_glVertexAttrib3fvARB = (undefined *)FUN_00a2ca10(&DAT_00b27b60); /* WARNING: Could not recover jumptable at 0x00a4db50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3fvARB)(); return; } //@@ 00a4db60 FUN_00a4db60 void FUN_00a4db60(void) { epoxy_glVertexAttrib3fvNV = (undefined *)FUN_00a2ca10(&DAT_00b27d38); /* WARNING: Could not recover jumptable at 0x00a4db80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3fvNV)(); return; } //@@ 00a4db90 FUN_00a4db90 void FUN_00a4db90(void) { epoxy_glVertexAttrib3hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4dba8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3hNV)(); return; } //@@ 00a4dbb0 FUN_00a4dbb0 void FUN_00a4dbb0(void) { epoxy_glVertexAttrib3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4dbc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3hvNV)(); return; } //@@ 00a4dbd0 FUN_00a4dbd0 void FUN_00a4dbd0(void) { epoxy_glVertexAttrib3s = (undefined *)FUN_00a2ca10(&DAT_00b2abb8); /* WARNING: Could not recover jumptable at 0x00a4dbf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3s)(); return; } //@@ 00a4dc00 FUN_00a4dc00 void FUN_00a4dc00(void) { epoxy_glVertexAttrib3sARB = (undefined *)FUN_00a2ca10(&DAT_00b3cc64); /* WARNING: Could not recover jumptable at 0x00a4dc20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3sARB)(); return; } //@@ 00a4dc30 FUN_00a4dc30 void FUN_00a4dc30(void) { epoxy_glVertexAttrib3sNV = (undefined *)FUN_00a2ca10(&DAT_00b3b094); /* WARNING: Could not recover jumptable at 0x00a4dc50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3sNV)(); return; } //@@ 00a4dc60 FUN_00a4dc60 void FUN_00a4dc60(void) { epoxy_glVertexAttrib3sv = (undefined *)FUN_00a2ca10(&DAT_00b2add8); /* WARNING: Could not recover jumptable at 0x00a4dc80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3sv)(); return; } //@@ 00a4dc90 FUN_00a4dc90 void FUN_00a4dc90(void) { epoxy_glVertexAttrib3svARB = (undefined *)FUN_00a2ca10(&DAT_00b254a8); /* WARNING: Could not recover jumptable at 0x00a4dcb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3svARB)(); return; } //@@ 00a4dcc0 FUN_00a4dcc0 void FUN_00a4dcc0(void) { epoxy_glVertexAttrib3svNV = (undefined *)FUN_00a2ca10(&DAT_00b29638); /* WARNING: Could not recover jumptable at 0x00a4dce0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib3svNV)(); return; } //@@ 00a4dcf0 FUN_00a4dcf0 void FUN_00a4dcf0(void) { epoxy_glVertexAttrib4Nbv = (undefined *)FUN_00a2ca10(&DAT_00b3d8fc); /* WARNING: Could not recover jumptable at 0x00a4dd10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Nbv)(); return; } //@@ 00a4dd20 FUN_00a4dd20 void FUN_00a4dd20(void) { epoxy_glVertexAttrib4NbvARB = (undefined *)FUN_00a2ca10(&DAT_00b28cf8); /* WARNING: Could not recover jumptable at 0x00a4dd40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NbvARB)(); return; } //@@ 00a4dd50 FUN_00a4dd50 void FUN_00a4dd50(void) { epoxy_glVertexAttrib4Niv = (undefined *)FUN_00a2ca10(&DAT_00b2a224); /* WARNING: Could not recover jumptable at 0x00a4dd70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Niv)(); return; } //@@ 00a4dd80 FUN_00a4dd80 void FUN_00a4dd80(void) { epoxy_glVertexAttrib4NivARB = (undefined *)FUN_00a2ca10(&DAT_00b28c84); /* WARNING: Could not recover jumptable at 0x00a4dda0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NivARB)(); return; } //@@ 00a4ddb0 FUN_00a4ddb0 void FUN_00a4ddb0(void) { epoxy_glVertexAttrib4Nsv = (undefined *)FUN_00a2ca10(&DAT_00b25f58); /* WARNING: Could not recover jumptable at 0x00a4ddd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Nsv)(); return; } //@@ 00a4dde0 FUN_00a4dde0 void FUN_00a4dde0(void) { epoxy_glVertexAttrib4NsvARB = (undefined *)FUN_00a2ca10(&DAT_00b2b030); /* WARNING: Could not recover jumptable at 0x00a4de00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NsvARB)(); return; } //@@ 00a4de10 FUN_00a4de10 void FUN_00a4de10(void) { epoxy_glVertexAttrib4Nub = (undefined *)FUN_00a2ca10(&DAT_00b3d164); /* WARNING: Could not recover jumptable at 0x00a4de30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Nub)(); return; } //@@ 00a4de40 FUN_00a4de40 void FUN_00a4de40(void) { epoxy_glVertexAttrib4NubARB = (undefined *)FUN_00a2ca10(&DAT_00b27280); /* WARNING: Could not recover jumptable at 0x00a4de60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NubARB)(); return; } //@@ 00a4de70 FUN_00a4de70 void FUN_00a4de70(void) { epoxy_glVertexAttrib4Nubv = (undefined *)FUN_00a2ca10(&DAT_00b25aa4); /* WARNING: Could not recover jumptable at 0x00a4de90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Nubv)(); return; } //@@ 00a4dea0 FUN_00a4dea0 void FUN_00a4dea0(void) { epoxy_glVertexAttrib4NubvARB = (undefined *)FUN_00a2ca10(&DAT_00b28cb4); /* WARNING: Could not recover jumptable at 0x00a4dec0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NubvARB)(); return; } //@@ 00a4ded0 FUN_00a4ded0 void FUN_00a4ded0(void) { epoxy_glVertexAttrib4Nuiv = (undefined *)FUN_00a2ca10(&DAT_00b3c124); /* WARNING: Could not recover jumptable at 0x00a4def0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Nuiv)(); return; } //@@ 00a4df00 FUN_00a4df00 void FUN_00a4df00(void) { epoxy_glVertexAttrib4NuivARB = (undefined *)FUN_00a2ca10(&DAT_00b3b3d0); /* WARNING: Could not recover jumptable at 0x00a4df20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NuivARB)(); return; } //@@ 00a4df30 FUN_00a4df30 void FUN_00a4df30(void) { epoxy_glVertexAttrib4Nusv = (undefined *)FUN_00a2ca10(&DAT_00b3afa4); /* WARNING: Could not recover jumptable at 0x00a4df50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4Nusv)(); return; } //@@ 00a4df60 FUN_00a4df60 void FUN_00a4df60(void) { epoxy_glVertexAttrib4NusvARB = (undefined *)FUN_00a2ca10(&DAT_00b3cc5c); /* WARNING: Could not recover jumptable at 0x00a4df80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4NusvARB)(); return; } //@@ 00a4df90 FUN_00a4df90 void FUN_00a4df90(void) { epoxy_glVertexAttrib4bv = (undefined *)FUN_00a2ca10(&DAT_00b27a38); /* WARNING: Could not recover jumptable at 0x00a4dfb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4bv)(); return; } //@@ 00a4dfc0 FUN_00a4dfc0 void FUN_00a4dfc0(void) { epoxy_glVertexAttrib4bvARB = (undefined *)FUN_00a2ca10(&DAT_00b26ee8); /* WARNING: Could not recover jumptable at 0x00a4dfe0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4bvARB)(); return; } //@@ 00a4dff0 FUN_00a4dff0 void FUN_00a4dff0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glVertexAttrib4d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib4d)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4e050 FUN_00a4e050 void FUN_00a4e050(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glVertexAttrib4dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib4dARB)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4e0b0 FUN_00a4e0b0 void FUN_00a4e0b0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glVertexAttrib4dNV = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttrib4dNV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4e110 FUN_00a4e110 void FUN_00a4e110(void) { epoxy_glVertexAttrib4dv = (undefined *)FUN_00a2ca10(&DAT_00b3c590); /* WARNING: Could not recover jumptable at 0x00a4e130. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4dv)(); return; } //@@ 00a4e140 FUN_00a4e140 void FUN_00a4e140(void) { epoxy_glVertexAttrib4dvARB = (undefined *)FUN_00a2ca10(&DAT_00b28b18); /* WARNING: Could not recover jumptable at 0x00a4e160. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4dvARB)(); return; } //@@ 00a4e170 FUN_00a4e170 void FUN_00a4e170(void) { epoxy_glVertexAttrib4dvNV = (undefined *)FUN_00a2ca10(&DAT_00b28214); /* WARNING: Could not recover jumptable at 0x00a4e190. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4dvNV)(); return; } //@@ 00a4e1a0 FUN_00a4e1a0 void FUN_00a4e1a0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glVertexAttrib4f = (undefined *)FUN_00a2ca10(&DAT_00b2ac24); (*(code *)epoxy_glVertexAttrib4f)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4e200 FUN_00a4e200 void FUN_00a4e200(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glVertexAttrib4fARB = (undefined *)FUN_00a2ca10(&DAT_00b27a14); (*(code *)epoxy_glVertexAttrib4fARB)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4e260 FUN_00a4e260 void FUN_00a4e260(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glVertexAttrib4fNV = (undefined *)FUN_00a2ca10(&DAT_00b3c4e4); (*(code *)epoxy_glVertexAttrib4fNV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4e2c0 FUN_00a4e2c0 void FUN_00a4e2c0(void) { epoxy_glVertexAttrib4fv = (undefined *)FUN_00a2ca10(&DAT_00b26004); /* WARNING: Could not recover jumptable at 0x00a4e2e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4fv)(); return; } //@@ 00a4e2f0 FUN_00a4e2f0 void FUN_00a4e2f0(void) { epoxy_glVertexAttrib4fvARB = (undefined *)FUN_00a2ca10(&DAT_00b3b490); /* WARNING: Could not recover jumptable at 0x00a4e310. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4fvARB)(); return; } //@@ 00a4e320 FUN_00a4e320 void FUN_00a4e320(void) { epoxy_glVertexAttrib4fvNV = (undefined *)FUN_00a2ca10(&DAT_00b26518); /* WARNING: Could not recover jumptable at 0x00a4e340. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4fvNV)(); return; } //@@ 00a4e350 FUN_00a4e350 void FUN_00a4e350(void) { epoxy_glVertexAttrib4hNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4e368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4hNV)(); return; } //@@ 00a4e370 FUN_00a4e370 void FUN_00a4e370(void) { epoxy_glVertexAttrib4hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4e388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4hvNV)(); return; } //@@ 00a4e390 FUN_00a4e390 void FUN_00a4e390(void) { epoxy_glVertexAttrib4iv = (undefined *)FUN_00a2ca10(&DAT_00b28fb4); /* WARNING: Could not recover jumptable at 0x00a4e3b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4iv)(); return; } //@@ 00a4e3c0 FUN_00a4e3c0 void FUN_00a4e3c0(void) { epoxy_glVertexAttrib4ivARB = (undefined *)FUN_00a2ca10(&DAT_00b28098); /* WARNING: Could not recover jumptable at 0x00a4e3e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4ivARB)(); return; } //@@ 00a4e3f0 FUN_00a4e3f0 void FUN_00a4e3f0(void) { epoxy_glVertexAttrib4s = (undefined *)FUN_00a2ca10(&DAT_00b27288); /* WARNING: Could not recover jumptable at 0x00a4e410. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4s)(); return; } //@@ 00a4e420 FUN_00a4e420 void FUN_00a4e420(void) { epoxy_glVertexAttrib4sARB = (undefined *)FUN_00a2ca10(&DAT_00b26ad8); /* WARNING: Could not recover jumptable at 0x00a4e440. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4sARB)(); return; } //@@ 00a4e450 FUN_00a4e450 void FUN_00a4e450(void) { epoxy_glVertexAttrib4sNV = (undefined *)FUN_00a2ca10(&DAT_00b3d3d4); /* WARNING: Could not recover jumptable at 0x00a4e470. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4sNV)(); return; } //@@ 00a4e480 FUN_00a4e480 void FUN_00a4e480(void) { epoxy_glVertexAttrib4sv = (undefined *)FUN_00a2ca10(&DAT_00b26698); /* WARNING: Could not recover jumptable at 0x00a4e4a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4sv)(); return; } //@@ 00a4e4b0 FUN_00a4e4b0 void FUN_00a4e4b0(void) { epoxy_glVertexAttrib4svARB = (undefined *)FUN_00a2ca10(&DAT_00b3cdd8); /* WARNING: Could not recover jumptable at 0x00a4e4d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4svARB)(); return; } //@@ 00a4e4e0 FUN_00a4e4e0 void FUN_00a4e4e0(void) { epoxy_glVertexAttrib4svNV = (undefined *)FUN_00a2ca10(&DAT_00b27d0c); /* WARNING: Could not recover jumptable at 0x00a4e500. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4svNV)(); return; } //@@ 00a4e510 FUN_00a4e510 void FUN_00a4e510(void) { epoxy_glVertexAttrib4ubNV = (undefined *)FUN_00a2ca10(&DAT_00b25f78); /* WARNING: Could not recover jumptable at 0x00a4e530. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4ubNV)(); return; } //@@ 00a4e540 FUN_00a4e540 void FUN_00a4e540(void) { epoxy_glVertexAttrib4ubv = (undefined *)FUN_00a2ca10(&DAT_00b274d0); /* WARNING: Could not recover jumptable at 0x00a4e560. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4ubv)(); return; } //@@ 00a4e570 FUN_00a4e570 void FUN_00a4e570(void) { epoxy_glVertexAttrib4ubvARB = (undefined *)FUN_00a2ca10(&DAT_00b27948); /* WARNING: Could not recover jumptable at 0x00a4e590. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4ubvARB)(); return; } //@@ 00a4e5a0 FUN_00a4e5a0 void FUN_00a4e5a0(void) { epoxy_glVertexAttrib4ubvNV = (undefined *)FUN_00a2ca10(&DAT_00b3b720); /* WARNING: Could not recover jumptable at 0x00a4e5c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4ubvNV)(); return; } //@@ 00a4e5d0 FUN_00a4e5d0 void FUN_00a4e5d0(void) { epoxy_glVertexAttrib4uiv = (undefined *)FUN_00a2ca10(&DAT_00b3b7e4); /* WARNING: Could not recover jumptable at 0x00a4e5f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4uiv)(); return; } //@@ 00a4e600 FUN_00a4e600 void FUN_00a4e600(void) { epoxy_glVertexAttrib4uivARB = (undefined *)FUN_00a2ca10(&DAT_00b25380); /* WARNING: Could not recover jumptable at 0x00a4e620. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4uivARB)(); return; } //@@ 00a4e630 FUN_00a4e630 void FUN_00a4e630(void) { epoxy_glVertexAttrib4usv = (undefined *)FUN_00a2ca10(&DAT_00b3ce78); /* WARNING: Could not recover jumptable at 0x00a4e650. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4usv)(); return; } //@@ 00a4e660 FUN_00a4e660 void FUN_00a4e660(void) { epoxy_glVertexAttrib4usvARB = (undefined *)FUN_00a2ca10(&DAT_00b3d508); /* WARNING: Could not recover jumptable at 0x00a4e680. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttrib4usvARB)(); return; } //@@ 00a4e690 FUN_00a4e690 void FUN_00a4e690(void) { epoxy_glVertexAttribArrayObjectATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4e6a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribArrayObjectATI)(); return; } //@@ 00a4e6b0 FUN_00a4e6b0 void FUN_00a4e6b0(void) { epoxy_glVertexAttribBinding = (undefined *)FUN_00a2ca10(&DAT_00b3b3e4); /* WARNING: Could not recover jumptable at 0x00a4e6d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribBinding)(); return; } //@@ 00a4e6e0 FUN_00a4e6e0 void FUN_00a4e6e0(void) { epoxy_glVertexAttribDivisor = (undefined *)FUN_00a2ca10(&DAT_00b28680); /* WARNING: Could not recover jumptable at 0x00a4e700. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribDivisor)(); return; } //@@ 00a4e710 FUN_00a4e710 void FUN_00a4e710(void) { epoxy_glVertexAttribDivisorANGLE = (undefined *)FUN_00a2ca10(&DAT_00b27ca4); /* WARNING: Could not recover jumptable at 0x00a4e730. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribDivisorANGLE)(); return; } //@@ 00a4e740 FUN_00a4e740 void FUN_00a4e740(void) { epoxy_glVertexAttribDivisorARB = (undefined *)FUN_00a2ca10(&DAT_00b3be54); /* WARNING: Could not recover jumptable at 0x00a4e760. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribDivisorARB)(); return; } //@@ 00a4e770 FUN_00a4e770 void FUN_00a4e770(void) { epoxy_glVertexAttribDivisorEXT = (undefined *)FUN_00a2ca10(&DAT_00b256d0); /* WARNING: Could not recover jumptable at 0x00a4e790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribDivisorEXT)(); return; } //@@ 00a4e7a0 FUN_00a4e7a0 void FUN_00a4e7a0(void) { epoxy_glVertexAttribDivisorNV = (undefined *)FUN_00a2ca10(&DAT_00b3bd74); /* WARNING: Could not recover jumptable at 0x00a4e7c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribDivisorNV)(); return; } //@@ 00a4e7d0 FUN_00a4e7d0 void FUN_00a4e7d0(void) { epoxy_glVertexAttribFormat = (undefined *)FUN_00a2ca10(&DAT_00b2aed4); /* WARNING: Could not recover jumptable at 0x00a4e7f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribFormat)(); return; } //@@ 00a4e800 FUN_00a4e800 void FUN_00a4e800(void) { epoxy_glVertexAttribFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4e818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribFormatNV)(); return; } //@@ 00a4e820 FUN_00a4e820 void FUN_00a4e820(void) { epoxy_glVertexAttribI1i = (undefined *)FUN_00a2ca10(&DAT_00b2a874); /* WARNING: Could not recover jumptable at 0x00a4e840. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1i)(); return; } //@@ 00a4e850 FUN_00a4e850 void FUN_00a4e850(void) { epoxy_glVertexAttribI1iEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c174); /* WARNING: Could not recover jumptable at 0x00a4e870. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1iEXT)(); return; } //@@ 00a4e880 FUN_00a4e880 void FUN_00a4e880(void) { epoxy_glVertexAttribI1iv = (undefined *)FUN_00a2ca10(&DAT_00b2af30); /* WARNING: Could not recover jumptable at 0x00a4e8a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1iv)(); return; } //@@ 00a4e8b0 FUN_00a4e8b0 void FUN_00a4e8b0(void) { epoxy_glVertexAttribI1ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b28b28); /* WARNING: Could not recover jumptable at 0x00a4e8d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1ivEXT)(); return; } //@@ 00a4e8e0 FUN_00a4e8e0 void FUN_00a4e8e0(void) { epoxy_glVertexAttribI1ui = (undefined *)FUN_00a2ca10(&DAT_00b3da04); /* WARNING: Could not recover jumptable at 0x00a4e900. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1ui)(); return; } //@@ 00a4e910 FUN_00a4e910 void FUN_00a4e910(void) { epoxy_glVertexAttribI1uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b2a8d4); /* WARNING: Could not recover jumptable at 0x00a4e930. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1uiEXT)(); return; } //@@ 00a4e940 FUN_00a4e940 void FUN_00a4e940(void) { epoxy_glVertexAttribI1uiv = (undefined *)FUN_00a2ca10(&DAT_00b2a0a0); /* WARNING: Could not recover jumptable at 0x00a4e960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1uiv)(); return; } //@@ 00a4e970 FUN_00a4e970 void FUN_00a4e970(void) { epoxy_glVertexAttribI1uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b25214); /* WARNING: Could not recover jumptable at 0x00a4e990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI1uivEXT)(); return; } //@@ 00a4e9a0 FUN_00a4e9a0 void FUN_00a4e9a0(void) { epoxy_glVertexAttribI2i = (undefined *)FUN_00a2ca10(&DAT_00b3d894); /* WARNING: Could not recover jumptable at 0x00a4e9c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2i)(); return; } //@@ 00a4e9d0 FUN_00a4e9d0 void FUN_00a4e9d0(void) { epoxy_glVertexAttribI2iEXT = (undefined *)FUN_00a2ca10(&DAT_00b29038); /* WARNING: Could not recover jumptable at 0x00a4e9f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2iEXT)(); return; } //@@ 00a4ea00 FUN_00a4ea00 void FUN_00a4ea00(void) { epoxy_glVertexAttribI2iv = (undefined *)FUN_00a2ca10(&DAT_00b3d420); /* WARNING: Could not recover jumptable at 0x00a4ea20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2iv)(); return; } //@@ 00a4ea30 FUN_00a4ea30 void FUN_00a4ea30(void) { epoxy_glVertexAttribI2ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b924); /* WARNING: Could not recover jumptable at 0x00a4ea50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2ivEXT)(); return; } //@@ 00a4ea60 FUN_00a4ea60 void FUN_00a4ea60(void) { epoxy_glVertexAttribI2ui = (undefined *)FUN_00a2ca10(&DAT_00b26130); /* WARNING: Could not recover jumptable at 0x00a4ea80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2ui)(); return; } //@@ 00a4ea90 FUN_00a4ea90 void FUN_00a4ea90(void) { epoxy_glVertexAttribI2uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b2775c); /* WARNING: Could not recover jumptable at 0x00a4eab0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2uiEXT)(); return; } //@@ 00a4eac0 FUN_00a4eac0 void FUN_00a4eac0(void) { epoxy_glVertexAttribI2uiv = (undefined *)FUN_00a2ca10(&DAT_00b29b54); /* WARNING: Could not recover jumptable at 0x00a4eae0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2uiv)(); return; } //@@ 00a4eaf0 FUN_00a4eaf0 void FUN_00a4eaf0(void) { epoxy_glVertexAttribI2uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b458); /* WARNING: Could not recover jumptable at 0x00a4eb10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI2uivEXT)(); return; } //@@ 00a4eb20 FUN_00a4eb20 void FUN_00a4eb20(void) { epoxy_glVertexAttribI3i = (undefined *)FUN_00a2ca10(&DAT_00b2a9fc); /* WARNING: Could not recover jumptable at 0x00a4eb40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3i)(); return; } //@@ 00a4eb50 FUN_00a4eb50 void FUN_00a4eb50(void) { epoxy_glVertexAttribI3iEXT = (undefined *)FUN_00a2ca10(&DAT_00b26848); /* WARNING: Could not recover jumptable at 0x00a4eb70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3iEXT)(); return; } //@@ 00a4eb80 FUN_00a4eb80 void FUN_00a4eb80(void) { epoxy_glVertexAttribI3iv = (undefined *)FUN_00a2ca10(&DAT_00b26e80); /* WARNING: Could not recover jumptable at 0x00a4eba0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3iv)(); return; } //@@ 00a4ebb0 FUN_00a4ebb0 void FUN_00a4ebb0(void) { epoxy_glVertexAttribI3ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3bc8c); /* WARNING: Could not recover jumptable at 0x00a4ebd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3ivEXT)(); return; } //@@ 00a4ebe0 FUN_00a4ebe0 void FUN_00a4ebe0(void) { epoxy_glVertexAttribI3ui = (undefined *)FUN_00a2ca10(&DAT_00b3b248); /* WARNING: Could not recover jumptable at 0x00a4ec00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3ui)(); return; } //@@ 00a4ec10 FUN_00a4ec10 void FUN_00a4ec10(void) { epoxy_glVertexAttribI3uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b29d98); /* WARNING: Could not recover jumptable at 0x00a4ec30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3uiEXT)(); return; } //@@ 00a4ec40 FUN_00a4ec40 void FUN_00a4ec40(void) { epoxy_glVertexAttribI3uiv = (undefined *)FUN_00a2ca10(&DAT_00b2ad3c); /* WARNING: Could not recover jumptable at 0x00a4ec60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3uiv)(); return; } //@@ 00a4ec70 FUN_00a4ec70 void FUN_00a4ec70(void) { epoxy_glVertexAttribI3uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b3b520); /* WARNING: Could not recover jumptable at 0x00a4ec90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI3uivEXT)(); return; } //@@ 00a4eca0 FUN_00a4eca0 void FUN_00a4eca0(void) { epoxy_glVertexAttribI4bv = (undefined *)FUN_00a2ca10(&DAT_00b25ef8); /* WARNING: Could not recover jumptable at 0x00a4ecc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4bv)(); return; } //@@ 00a4ecd0 FUN_00a4ecd0 void FUN_00a4ecd0(void) { epoxy_glVertexAttribI4bvEXT = (undefined *)FUN_00a2ca10(&DAT_00b26760); /* WARNING: Could not recover jumptable at 0x00a4ecf0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4bvEXT)(); return; } //@@ 00a4ed00 FUN_00a4ed00 void FUN_00a4ed00(void) { epoxy_glVertexAttribI4i = (undefined *)FUN_00a2ca10(&DAT_00b299b8); /* WARNING: Could not recover jumptable at 0x00a4ed20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4i)(); return; } //@@ 00a4ed30 FUN_00a4ed30 void FUN_00a4ed30(void) { epoxy_glVertexAttribI4iEXT = (undefined *)FUN_00a2ca10(&DAT_00b25f28); /* WARNING: Could not recover jumptable at 0x00a4ed50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4iEXT)(); return; } //@@ 00a4ed60 FUN_00a4ed60 void FUN_00a4ed60(void) { epoxy_glVertexAttribI4iv = (undefined *)FUN_00a2ca10(&DAT_00b3c970); /* WARNING: Could not recover jumptable at 0x00a4ed80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4iv)(); return; } //@@ 00a4ed90 FUN_00a4ed90 void FUN_00a4ed90(void) { epoxy_glVertexAttribI4ivEXT = (undefined *)FUN_00a2ca10(&DAT_00b259a0); /* WARNING: Could not recover jumptable at 0x00a4edb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4ivEXT)(); return; } //@@ 00a4edc0 FUN_00a4edc0 void FUN_00a4edc0(void) { epoxy_glVertexAttribI4sv = (undefined *)FUN_00a2ca10(&DAT_00b2a318); /* WARNING: Could not recover jumptable at 0x00a4ede0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4sv)(); return; } //@@ 00a4edf0 FUN_00a4edf0 void FUN_00a4edf0(void) { epoxy_glVertexAttribI4svEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c5f8); /* WARNING: Could not recover jumptable at 0x00a4ee10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4svEXT)(); return; } //@@ 00a4ee20 FUN_00a4ee20 void FUN_00a4ee20(void) { epoxy_glVertexAttribI4ubv = (undefined *)FUN_00a2ca10(&DAT_00b285a8); /* WARNING: Could not recover jumptable at 0x00a4ee40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4ubv)(); return; } //@@ 00a4ee50 FUN_00a4ee50 void FUN_00a4ee50(void) { epoxy_glVertexAttribI4ubvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c554); /* WARNING: Could not recover jumptable at 0x00a4ee70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4ubvEXT)(); return; } //@@ 00a4ee80 FUN_00a4ee80 void FUN_00a4ee80(void) { epoxy_glVertexAttribI4ui = (undefined *)FUN_00a2ca10(&DAT_00b25804); /* WARNING: Could not recover jumptable at 0x00a4eea0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4ui)(); return; } //@@ 00a4eeb0 FUN_00a4eeb0 void FUN_00a4eeb0(void) { epoxy_glVertexAttribI4uiEXT = (undefined *)FUN_00a2ca10(&DAT_00b2acb8); /* WARNING: Could not recover jumptable at 0x00a4eed0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4uiEXT)(); return; } //@@ 00a4eee0 FUN_00a4eee0 void FUN_00a4eee0(void) { epoxy_glVertexAttribI4uiv = (undefined *)FUN_00a2ca10(&DAT_00b288c8); /* WARNING: Could not recover jumptable at 0x00a4ef00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4uiv)(); return; } //@@ 00a4ef10 FUN_00a4ef10 void FUN_00a4ef10(void) { epoxy_glVertexAttribI4uivEXT = (undefined *)FUN_00a2ca10(&DAT_00b25a18); /* WARNING: Could not recover jumptable at 0x00a4ef30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4uivEXT)(); return; } //@@ 00a4ef40 FUN_00a4ef40 void FUN_00a4ef40(void) { epoxy_glVertexAttribI4usv = (undefined *)FUN_00a2ca10(&DAT_00b3b21c); /* WARNING: Could not recover jumptable at 0x00a4ef60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4usv)(); return; } //@@ 00a4ef70 FUN_00a4ef70 void FUN_00a4ef70(void) { epoxy_glVertexAttribI4usvEXT = (undefined *)FUN_00a2ca10(&DAT_00b25888); /* WARNING: Could not recover jumptable at 0x00a4ef90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribI4usvEXT)(); return; } //@@ 00a4efa0 FUN_00a4efa0 void FUN_00a4efa0(void) { epoxy_glVertexAttribIFormat = (undefined *)FUN_00a2ca10(&DAT_00b25608); /* WARNING: Could not recover jumptable at 0x00a4efc0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribIFormat)(); return; } //@@ 00a4efd0 FUN_00a4efd0 void FUN_00a4efd0(void) { epoxy_glVertexAttribIFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4efe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribIFormatNV)(); return; } //@@ 00a4f000 FUN_00a4f000 void FUN_00a4f000(void) { epoxy_glVertexAttribIPointer = (undefined *)FUN_00a2ca10(&DAT_00b27048); /* WARNING: Could not recover jumptable at 0x00a4f020. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribIPointer)(); return; } //@@ 00a4f030 FUN_00a4f030 void FUN_00a4f030(void) { epoxy_glVertexAttribIPointerEXT = (undefined *)FUN_00a2ca10(&DAT_00b25400); /* WARNING: Could not recover jumptable at 0x00a4f050. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribIPointerEXT)(); return; } //@@ 00a4f060 FUN_00a4f060 void FUN_00a4f060(undefined4 param_1,undefined8 param_2) { epoxy_glVertexAttribL1d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL1d)(param_1,param_2); return; } //@@ 00a4f090 FUN_00a4f090 void FUN_00a4f090(undefined4 param_1,undefined8 param_2) { epoxy_glVertexAttribL1dEXT = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL1dEXT)(param_1,param_2); return; } //@@ 00a4f0c0 FUN_00a4f0c0 void FUN_00a4f0c0(void) { epoxy_glVertexAttribL1dv = (undefined *)FUN_00a2ca10(&DAT_00b27f08); /* WARNING: Could not recover jumptable at 0x00a4f0e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL1dv)(); return; } //@@ 00a4f0f0 FUN_00a4f0f0 void FUN_00a4f0f0(void) { epoxy_glVertexAttribL1dvEXT = (undefined *)FUN_00a2ca10(&DAT_00b262e4); /* WARNING: Could not recover jumptable at 0x00a4f110. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL1dvEXT)(); return; } //@@ 00a4f120 FUN_00a4f120 void FUN_00a4f120(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexAttribL1i64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL1i64NV)(param_1,param_2,param_3); return; } //@@ 00a4f150 FUN_00a4f150 void FUN_00a4f150(void) { epoxy_glVertexAttribL1i64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f168. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL1i64vNV)(); return; } //@@ 00a4f170 FUN_00a4f170 void FUN_00a4f170(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexAttribL1ui64ARB = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL1ui64ARB)(param_1,param_2,param_3); return; } //@@ 00a4f1a0 FUN_00a4f1a0 void FUN_00a4f1a0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexAttribL1ui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL1ui64NV)(param_1,param_2,param_3); return; } //@@ 00a4f1d0 FUN_00a4f1d0 void FUN_00a4f1d0(void) { epoxy_glVertexAttribL1ui64vARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f1e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL1ui64vARB)(); return; } //@@ 00a4f1f0 FUN_00a4f1f0 void FUN_00a4f1f0(void) { epoxy_glVertexAttribL1ui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL1ui64vNV)(); return; } //@@ 00a4f210 FUN_00a4f210 void FUN_00a4f210(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertexAttribL2d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL2d)(param_1,param_2,param_3); return; } //@@ 00a4f260 FUN_00a4f260 void FUN_00a4f260(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertexAttribL2dEXT = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL2dEXT)(param_1,param_2,param_3); return; } //@@ 00a4f2b0 FUN_00a4f2b0 void FUN_00a4f2b0(void) { epoxy_glVertexAttribL2dv = (undefined *)FUN_00a2ca10(&DAT_00b3d488); /* WARNING: Could not recover jumptable at 0x00a4f2d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL2dv)(); return; } //@@ 00a4f2e0 FUN_00a4f2e0 void FUN_00a4f2e0(void) { epoxy_glVertexAttribL2dvEXT = (undefined *)FUN_00a2ca10(&DAT_00b26e58); /* WARNING: Could not recover jumptable at 0x00a4f300. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL2dvEXT)(); return; } //@@ 00a4f310 FUN_00a4f310 void FUN_00a4f310(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glVertexAttribL2i64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL2i64NV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4f350 FUN_00a4f350 void FUN_00a4f350(void) { epoxy_glVertexAttribL2i64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL2i64vNV)(); return; } //@@ 00a4f370 FUN_00a4f370 void FUN_00a4f370(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glVertexAttribL2ui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL2ui64NV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4f3b0 FUN_00a4f3b0 void FUN_00a4f3b0(void) { epoxy_glVertexAttribL2ui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f3c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL2ui64vNV)(); return; } //@@ 00a4f3d0 FUN_00a4f3d0 void FUN_00a4f3d0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertexAttribL3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL3d)(param_1,param_2,param_3,param_4); return; } //@@ 00a4f420 FUN_00a4f420 void FUN_00a4f420(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertexAttribL3dEXT = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL3dEXT)(param_1,param_2,param_3,param_4); return; } //@@ 00a4f470 FUN_00a4f470 void FUN_00a4f470(void) { epoxy_glVertexAttribL3dv = (undefined *)FUN_00a2ca10(&DAT_00b3b98c); /* WARNING: Could not recover jumptable at 0x00a4f490. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL3dv)(); return; } //@@ 00a4f4a0 FUN_00a4f4a0 void FUN_00a4f4a0(void) { epoxy_glVertexAttribL3dvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c284); /* WARNING: Could not recover jumptable at 0x00a4f4c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL3dvEXT)(); return; } //@@ 00a4f4d0 FUN_00a4f4d0 void FUN_00a4f4d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glVertexAttribL3i64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL3i64NV)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a4f510 FUN_00a4f510 void FUN_00a4f510(void) { epoxy_glVertexAttribL3i64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL3i64vNV)(); return; } //@@ 00a4f530 FUN_00a4f530 void FUN_00a4f530(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_glVertexAttribL3ui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL3ui64NV)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a4f570 FUN_00a4f570 void FUN_00a4f570(void) { epoxy_glVertexAttribL3ui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f588. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL3ui64vNV)(); return; } //@@ 00a4f590 FUN_00a4f590 void FUN_00a4f590(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glVertexAttribL4d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL4d)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4f5f0 FUN_00a4f5f0 void FUN_00a4f5f0(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glVertexAttribL4dEXT = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glVertexAttribL4dEXT)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a4f650 FUN_00a4f650 void FUN_00a4f650(void) { epoxy_glVertexAttribL4dv = (undefined *)FUN_00a2ca10(&DAT_00b26c1c); /* WARNING: Could not recover jumptable at 0x00a4f670. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL4dv)(); return; } //@@ 00a4f680 FUN_00a4f680 void FUN_00a4f680(void) { epoxy_glVertexAttribL4dvEXT = (undefined *)FUN_00a2ca10(&DAT_00b3c89c); /* WARNING: Could not recover jumptable at 0x00a4f6a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL4dvEXT)(); return; } //@@ 00a4f6b0 FUN_00a4f6b0 void FUN_00a4f6b0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glVertexAttribL4i64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL4i64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a4f6f0 FUN_00a4f6f0 void FUN_00a4f6f0(void) { epoxy_glVertexAttribL4i64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f708. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL4i64vNV)(); return; } //@@ 00a4f710 FUN_00a4f710 void FUN_00a4f710(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9) { epoxy_glVertexAttribL4ui64NV = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexAttribL4ui64NV) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9); return; } //@@ 00a4f750 FUN_00a4f750 void FUN_00a4f750(void) { epoxy_glVertexAttribL4ui64vNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f768. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribL4ui64vNV)(); return; } //@@ 00a4f770 FUN_00a4f770 void FUN_00a4f770(void) { epoxy_glVertexAttribLFormat = (undefined *)FUN_00a2ca10(&DAT_00b25388); /* WARNING: Could not recover jumptable at 0x00a4f790. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribLFormat)(); return; } //@@ 00a4f7a0 FUN_00a4f7a0 void FUN_00a4f7a0(void) { epoxy_glVertexAttribLFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f7b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribLFormatNV)(); return; } //@@ 00a4f7c0 FUN_00a4f7c0 void FUN_00a4f7c0(void) { epoxy_glVertexAttribLPointer = (undefined *)FUN_00a2ca10(&DAT_00b2a480); /* WARNING: Could not recover jumptable at 0x00a4f7e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribLPointer)(); return; } //@@ 00a4f7f0 FUN_00a4f7f0 void FUN_00a4f7f0(void) { epoxy_glVertexAttribLPointerEXT = (undefined *)FUN_00a2ca10(&DAT_00b276d8); /* WARNING: Could not recover jumptable at 0x00a4f810. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribLPointerEXT)(); return; } //@@ 00a4f820 FUN_00a4f820 void FUN_00a4f820(void) { epoxy_glVertexAttribP1ui = (undefined *)FUN_00a2ca10(&DAT_00b29b58); /* WARNING: Could not recover jumptable at 0x00a4f840. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP1ui)(); return; } //@@ 00a4f850 FUN_00a4f850 void FUN_00a4f850(void) { epoxy_glVertexAttribP1uiv = (undefined *)FUN_00a2ca10(&DAT_00b2a194); /* WARNING: Could not recover jumptable at 0x00a4f870. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP1uiv)(); return; } //@@ 00a4f880 FUN_00a4f880 void FUN_00a4f880(void) { epoxy_glVertexAttribP2ui = (undefined *)FUN_00a2ca10(&DAT_00b3b428); /* WARNING: Could not recover jumptable at 0x00a4f8a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP2ui)(); return; } //@@ 00a4f8b0 FUN_00a4f8b0 void FUN_00a4f8b0(void) { epoxy_glVertexAttribP2uiv = (undefined *)FUN_00a2ca10(&DAT_00b3cc18); /* WARNING: Could not recover jumptable at 0x00a4f8d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP2uiv)(); return; } //@@ 00a4f8e0 FUN_00a4f8e0 void FUN_00a4f8e0(void) { epoxy_glVertexAttribP3ui = (undefined *)FUN_00a2ca10(&DAT_00b28258); /* WARNING: Could not recover jumptable at 0x00a4f900. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP3ui)(); return; } //@@ 00a4f910 FUN_00a4f910 void FUN_00a4f910(void) { epoxy_glVertexAttribP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b28ca0); /* WARNING: Could not recover jumptable at 0x00a4f930. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP3uiv)(); return; } //@@ 00a4f940 FUN_00a4f940 void FUN_00a4f940(void) { epoxy_glVertexAttribP4ui = (undefined *)FUN_00a2ca10(&DAT_00b257c4); /* WARNING: Could not recover jumptable at 0x00a4f960. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP4ui)(); return; } //@@ 00a4f970 FUN_00a4f970 void FUN_00a4f970(void) { epoxy_glVertexAttribP4uiv = (undefined *)FUN_00a2ca10(&DAT_00b28464); /* WARNING: Could not recover jumptable at 0x00a4f990. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribP4uiv)(); return; } //@@ 00a4f9a0 FUN_00a4f9a0 void FUN_00a4f9a0(void) { epoxy_glVertexAttribParameteriAMD = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4f9b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribParameteriAMD)(); return; } //@@ 00a4f9c0 FUN_00a4f9c0 void FUN_00a4f9c0(void) { epoxy_glVertexAttribPointer = (undefined *)FUN_00a2ca10(&DAT_00b3c1e8); /* WARNING: Could not recover jumptable at 0x00a4f9e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribPointer)(); return; } //@@ 00a4f9f0 FUN_00a4f9f0 void FUN_00a4f9f0(void) { epoxy_glVertexAttribPointerARB = (undefined *)FUN_00a2ca10(&DAT_00b3b978); /* WARNING: Could not recover jumptable at 0x00a4fa10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribPointerARB)(); return; } //@@ 00a4fa20 FUN_00a4fa20 void FUN_00a4fa20(void) { epoxy_glVertexAttribPointerNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fa38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribPointerNV)(); return; } //@@ 00a4fa40 FUN_00a4fa40 void FUN_00a4fa40(void) { epoxy_glVertexAttribs1dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fa58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs1dvNV)(); return; } //@@ 00a4fa60 FUN_00a4fa60 void FUN_00a4fa60(void) { epoxy_glVertexAttribs1fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fa78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs1fvNV)(); return; } //@@ 00a4fa80 FUN_00a4fa80 void FUN_00a4fa80(void) { epoxy_glVertexAttribs1hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fa98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs1hvNV)(); return; } //@@ 00a4faa0 FUN_00a4faa0 void FUN_00a4faa0(void) { epoxy_glVertexAttribs1svNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fab8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs1svNV)(); return; } //@@ 00a4fac0 FUN_00a4fac0 void FUN_00a4fac0(void) { epoxy_glVertexAttribs2dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fad8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs2dvNV)(); return; } //@@ 00a4fae0 FUN_00a4fae0 void FUN_00a4fae0(void) { epoxy_glVertexAttribs2fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4faf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs2fvNV)(); return; } //@@ 00a4fb00 FUN_00a4fb00 void FUN_00a4fb00(void) { epoxy_glVertexAttribs2hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fb18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs2hvNV)(); return; } //@@ 00a4fb20 FUN_00a4fb20 void FUN_00a4fb20(void) { epoxy_glVertexAttribs2svNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fb38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs2svNV)(); return; } //@@ 00a4fb40 FUN_00a4fb40 void FUN_00a4fb40(void) { epoxy_glVertexAttribs3dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fb58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs3dvNV)(); return; } //@@ 00a4fb60 FUN_00a4fb60 void FUN_00a4fb60(void) { epoxy_glVertexAttribs3fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fb78. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs3fvNV)(); return; } //@@ 00a4fb80 FUN_00a4fb80 void FUN_00a4fb80(void) { epoxy_glVertexAttribs3hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fb98. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs3hvNV)(); return; } //@@ 00a4fba0 FUN_00a4fba0 void FUN_00a4fba0(void) { epoxy_glVertexAttribs3svNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fbb8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs3svNV)(); return; } //@@ 00a4fbc0 FUN_00a4fbc0 void FUN_00a4fbc0(void) { epoxy_glVertexAttribs4dvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fbd8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs4dvNV)(); return; } //@@ 00a4fbe0 FUN_00a4fbe0 void FUN_00a4fbe0(void) { epoxy_glVertexAttribs4fvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fbf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs4fvNV)(); return; } //@@ 00a4fc00 FUN_00a4fc00 void FUN_00a4fc00(void) { epoxy_glVertexAttribs4hvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fc18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs4hvNV)(); return; } //@@ 00a4fc20 FUN_00a4fc20 void FUN_00a4fc20(void) { epoxy_glVertexAttribs4svNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fc38. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs4svNV)(); return; } //@@ 00a4fc40 FUN_00a4fc40 void FUN_00a4fc40(void) { epoxy_glVertexAttribs4ubvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fc58. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexAttribs4ubvNV)(); return; } //@@ 00a4fc60 FUN_00a4fc60 void FUN_00a4fc60(void) { epoxy_glVertexBindingDivisor = (undefined *)FUN_00a2ca10(&DAT_00b3c158); /* WARNING: Could not recover jumptable at 0x00a4fc80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexBindingDivisor)(); return; } //@@ 00a4fc90 FUN_00a4fc90 void FUN_00a4fc90(void) { epoxy_glVertexBlendARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fca8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexBlendARB)(); return; } //@@ 00a4fcb0 FUN_00a4fcb0 void FUN_00a4fcb0(undefined4 param_1,undefined4 param_2) { epoxy_glVertexBlendEnvfATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexBlendEnvfATI)(param_1,param_2); return; } //@@ 00a4fce0 FUN_00a4fce0 void FUN_00a4fce0(void) { epoxy_glVertexBlendEnviATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fcf8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexBlendEnviATI)(); return; } //@@ 00a4fd00 FUN_00a4fd00 void FUN_00a4fd00(void) { epoxy_glVertexFormatNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fd18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexFormatNV)(); return; } //@@ 00a4fd20 FUN_00a4fd20 void FUN_00a4fd20(void) { epoxy_glVertexP2ui = (undefined *)FUN_00a2ca10(&DAT_00b287c8); /* WARNING: Could not recover jumptable at 0x00a4fd40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexP2ui)(); return; } //@@ 00a4fd50 FUN_00a4fd50 void FUN_00a4fd50(void) { epoxy_glVertexP2uiv = (undefined *)FUN_00a2ca10(&DAT_00b26204); /* WARNING: Could not recover jumptable at 0x00a4fd70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexP2uiv)(); return; } //@@ 00a4fd80 FUN_00a4fd80 void FUN_00a4fd80(void) { epoxy_glVertexP3ui = (undefined *)FUN_00a2ca10(&DAT_00b25c44); /* WARNING: Could not recover jumptable at 0x00a4fda0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexP3ui)(); return; } //@@ 00a4fdb0 FUN_00a4fdb0 void FUN_00a4fdb0(void) { epoxy_glVertexP3uiv = (undefined *)FUN_00a2ca10(&DAT_00b289f8); /* WARNING: Could not recover jumptable at 0x00a4fdd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexP3uiv)(); return; } //@@ 00a4fde0 FUN_00a4fde0 void FUN_00a4fde0(void) { epoxy_glVertexP4ui = (undefined *)FUN_00a2ca10(&DAT_00b3d79c); /* WARNING: Could not recover jumptable at 0x00a4fe00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexP4ui)(); return; } //@@ 00a4fe10 FUN_00a4fe10 void FUN_00a4fe10(void) { epoxy_glVertexP4uiv = (undefined *)FUN_00a2ca10(&DAT_00b27bd0); /* WARNING: Could not recover jumptable at 0x00a4fe30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexP4uiv)(); return; } //@@ 00a4fe40 FUN_00a4fe40 void FUN_00a4fe40(void) { epoxy_glVertexPointer = (undefined *)FUN_00a2ca10(&DAT_00b3c9ec); /* WARNING: Could not recover jumptable at 0x00a4fe60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexPointer)(); return; } //@@ 00a4fe70 FUN_00a4fe70 void FUN_00a4fe70(void) { epoxy_glVertexPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fe88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexPointerEXT)(); return; } //@@ 00a4fe90 FUN_00a4fe90 void FUN_00a4fe90(void) { epoxy_glVertexPointerListIBM = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fea8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexPointerListIBM)(); return; } //@@ 00a4feb0 FUN_00a4feb0 void FUN_00a4feb0(void) { epoxy_glVertexPointervINTEL = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4fec8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexPointervINTEL)(); return; } //@@ 00a4fed0 FUN_00a4fed0 void FUN_00a4fed0(undefined4 param_1,undefined8 param_2) { epoxy_glVertexStream1dATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream1dATI)(param_1,param_2); return; } //@@ 00a4ff00 FUN_00a4ff00 void FUN_00a4ff00(void) { epoxy_glVertexStream1dvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ff18. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream1dvATI)(); return; } //@@ 00a4ff20 FUN_00a4ff20 void FUN_00a4ff20(undefined4 param_1,undefined4 param_2) { epoxy_glVertexStream1fATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream1fATI)(param_1,param_2); return; } //@@ 00a4ff50 FUN_00a4ff50 void FUN_00a4ff50(void) { epoxy_glVertexStream1fvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ff68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream1fvATI)(); return; } //@@ 00a4ff70 FUN_00a4ff70 void FUN_00a4ff70(void) { epoxy_glVertexStream1iATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ff88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream1iATI)(); return; } //@@ 00a4ff90 FUN_00a4ff90 void FUN_00a4ff90(void) { epoxy_glVertexStream1ivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ffa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream1ivATI)(); return; } //@@ 00a4ffb0 FUN_00a4ffb0 void FUN_00a4ffb0(void) { epoxy_glVertexStream1sATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ffc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream1sATI)(); return; } //@@ 00a4ffd0 FUN_00a4ffd0 void FUN_00a4ffd0(void) { epoxy_glVertexStream1svATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a4ffe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream1svATI)(); return; } //@@ 00a4fff0 FUN_00a4fff0 void FUN_00a4fff0(undefined4 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glVertexStream2dATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream2dATI)(param_1,param_2,param_3); return; } //@@ 00a50030 FUN_00a50030 void FUN_00a50030(void) { epoxy_glVertexStream2dvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream2dvATI)(); return; } //@@ 00a50050 FUN_00a50050 void FUN_00a50050(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glVertexStream2fATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream2fATI)(param_1,param_2,param_3); return; } //@@ 00a50090 FUN_00a50090 void FUN_00a50090(void) { epoxy_glVertexStream2fvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a500a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream2fvATI)(); return; } //@@ 00a500b0 FUN_00a500b0 void FUN_00a500b0(void) { epoxy_glVertexStream2iATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a500c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream2iATI)(); return; } //@@ 00a500d0 FUN_00a500d0 void FUN_00a500d0(void) { epoxy_glVertexStream2ivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a500e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream2ivATI)(); return; } //@@ 00a500f0 FUN_00a500f0 void FUN_00a500f0(void) { epoxy_glVertexStream2sATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50108. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream2sATI)(); return; } //@@ 00a50110 FUN_00a50110 void FUN_00a50110(void) { epoxy_glVertexStream2svATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50128. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream2svATI)(); return; } //@@ 00a50130 FUN_00a50130 void FUN_00a50130(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glVertexStream3dATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream3dATI)(param_1,param_2,param_3,param_4); return; } //@@ 00a50180 FUN_00a50180 void FUN_00a50180(void) { epoxy_glVertexStream3dvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50198. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream3dvATI)(); return; } //@@ 00a501a0 FUN_00a501a0 void FUN_00a501a0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glVertexStream3fATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream3fATI)(param_1,param_2,param_3,param_4); return; } //@@ 00a501f0 FUN_00a501f0 void FUN_00a501f0(void) { epoxy_glVertexStream3fvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream3fvATI)(); return; } //@@ 00a50210 FUN_00a50210 void FUN_00a50210(void) { epoxy_glVertexStream3iATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50228. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream3iATI)(); return; } //@@ 00a50230 FUN_00a50230 void FUN_00a50230(void) { epoxy_glVertexStream3ivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50248. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream3ivATI)(); return; } //@@ 00a50250 FUN_00a50250 void FUN_00a50250(void) { epoxy_glVertexStream3sATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50268. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream3sATI)(); return; } //@@ 00a50270 FUN_00a50270 void FUN_00a50270(void) { epoxy_glVertexStream3svATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50288. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream3svATI)(); return; } //@@ 00a50290 FUN_00a50290 void FUN_00a50290(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { epoxy_glVertexStream4dATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream4dATI)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a502f0 FUN_00a502f0 void FUN_00a502f0(void) { epoxy_glVertexStream4dvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream4dvATI)(); return; } //@@ 00a50310 FUN_00a50310 void FUN_00a50310(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glVertexStream4fATI = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexStream4fATI)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a50360 FUN_00a50360 void FUN_00a50360(void) { epoxy_glVertexStream4fvATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50378. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream4fvATI)(); return; } //@@ 00a50380 FUN_00a50380 void FUN_00a50380(void) { epoxy_glVertexStream4iATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50398. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream4iATI)(); return; } //@@ 00a503a0 FUN_00a503a0 void FUN_00a503a0(void) { epoxy_glVertexStream4ivATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a503b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream4ivATI)(); return; } //@@ 00a503c0 FUN_00a503c0 void FUN_00a503c0(void) { epoxy_glVertexStream4sATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a503d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream4sATI)(); return; } //@@ 00a503e0 FUN_00a503e0 void FUN_00a503e0(void) { epoxy_glVertexStream4svATI = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a503f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexStream4svATI)(); return; } //@@ 00a50400 FUN_00a50400 void FUN_00a50400(void) { epoxy_glVertexWeightPointerEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexWeightPointerEXT)(); return; } //@@ 00a50420 FUN_00a50420 void FUN_00a50420(undefined4 param_1) { epoxy_glVertexWeightfEXT = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glVertexWeightfEXT)(param_1); return; } //@@ 00a50450 FUN_00a50450 void FUN_00a50450(void) { epoxy_glVertexWeightfvEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexWeightfvEXT)(); return; } //@@ 00a50470 FUN_00a50470 void FUN_00a50470(void) { epoxy_glVertexWeighthNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50488. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexWeighthNV)(); return; } //@@ 00a50490 FUN_00a50490 void FUN_00a50490(void) { epoxy_glVertexWeighthvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a504a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVertexWeighthvNV)(); return; } //@@ 00a504b0 FUN_00a504b0 void FUN_00a504b0(void) { epoxy_glVideoCaptureNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a504c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVideoCaptureNV)(); return; } //@@ 00a504d0 FUN_00a504d0 void FUN_00a504d0(void) { epoxy_glVideoCaptureStreamParameterdvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a504e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVideoCaptureStreamParameterdvNV)(); return; } //@@ 00a504f0 FUN_00a504f0 void FUN_00a504f0(void) { epoxy_glVideoCaptureStreamParameterfvNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50508. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVideoCaptureStreamParameterfvNV)(); return; } //@@ 00a50510 FUN_00a50510 void FUN_00a50510(void) { epoxy_glVideoCaptureStreamParameterivNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50528. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glVideoCaptureStreamParameterivNV)(); return; } //@@ 00a50530 FUN_00a50530 void FUN_00a50530(void) { epoxy_glViewport = (undefined *)FUN_00a2ca10(&DAT_00b29b40); /* WARNING: Could not recover jumptable at 0x00a50550. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glViewport)(); return; } //@@ 00a50560 FUN_00a50560 void FUN_00a50560(void) { epoxy_glViewportArrayv = (undefined *)FUN_00a2ca10(&DAT_00b3d9b8); /* WARNING: Could not recover jumptable at 0x00a50580. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glViewportArrayv)(); return; } //@@ 00a50590 FUN_00a50590 void FUN_00a50590(void) { epoxy_glViewportArrayvNV = (undefined *)FUN_00a2ca10(&DAT_00b27774); /* WARNING: Could not recover jumptable at 0x00a505b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glViewportArrayvNV)(); return; } //@@ 00a505c0 FUN_00a505c0 void FUN_00a505c0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glViewportIndexedf = (undefined *)FUN_00a2ca10(&DAT_00b29ad8); (*(code *)epoxy_glViewportIndexedf)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a50620 FUN_00a50620 void FUN_00a50620(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { epoxy_glViewportIndexedfNV = (undefined *)FUN_00a2ca10(&DAT_00b28b04); (*(code *)epoxy_glViewportIndexedfNV)(param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a50680 FUN_00a50680 void FUN_00a50680(void) { epoxy_glViewportIndexedfv = (undefined *)FUN_00a2ca10(&DAT_00b2a72c); /* WARNING: Could not recover jumptable at 0x00a506a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glViewportIndexedfv)(); return; } //@@ 00a506b0 FUN_00a506b0 void FUN_00a506b0(void) { epoxy_glViewportIndexedfvNV = (undefined *)FUN_00a2ca10(&DAT_00b3cbc0); /* WARNING: Could not recover jumptable at 0x00a506d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glViewportIndexedfvNV)(); return; } //@@ 00a506e0 FUN_00a506e0 void FUN_00a506e0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glWaitSync = (undefined *)FUN_00a2ca10(&DAT_00b2819c); (*(code *)epoxy_glWaitSync)(param_1,param_2,param_3,param_4); return; } //@@ 00a50720 FUN_00a50720 void FUN_00a50720(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glWaitSyncAPPLE = (undefined *)FUN_00a2ca10(&DAT_00b28eb0); (*(code *)epoxy_glWaitSyncAPPLE)(param_1,param_2,param_3,param_4); return; } //@@ 00a50760 FUN_00a50760 void FUN_00a50760(void) { epoxy_glWeightPathsNV = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50778. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightPathsNV)(); return; } //@@ 00a50780 FUN_00a50780 void FUN_00a50780(void) { epoxy_glWeightPointerARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50798. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightPointerARB)(); return; } //@@ 00a507a0 FUN_00a507a0 void FUN_00a507a0(void) { epoxy_glWeightPointerOES = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a507b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightPointerOES)(); return; } //@@ 00a507c0 FUN_00a507c0 void FUN_00a507c0(void) { epoxy_glWeightbvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a507d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightbvARB)(); return; } //@@ 00a507e0 FUN_00a507e0 void FUN_00a507e0(void) { epoxy_glWeightdvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a507f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightdvARB)(); return; } //@@ 00a50800 FUN_00a50800 void FUN_00a50800(void) { epoxy_glWeightfvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50818. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightfvARB)(); return; } //@@ 00a50820 FUN_00a50820 void FUN_00a50820(void) { epoxy_glWeightivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50838. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightivARB)(); return; } //@@ 00a50840 FUN_00a50840 void FUN_00a50840(void) { epoxy_glWeightsvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50858. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightsvARB)(); return; } //@@ 00a50860 FUN_00a50860 void FUN_00a50860(void) { epoxy_glWeightubvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50878. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightubvARB)(); return; } //@@ 00a50880 FUN_00a50880 void FUN_00a50880(void) { epoxy_glWeightuivARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a50898. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightuivARB)(); return; } //@@ 00a508a0 FUN_00a508a0 void FUN_00a508a0(void) { epoxy_glWeightusvARB = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a508b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWeightusvARB)(); return; } //@@ 00a508c0 FUN_00a508c0 void FUN_00a508c0(undefined8 param_1,undefined8 param_2) { epoxy_glWindowPos2d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glWindowPos2d)(param_1,param_2); return; } //@@ 00a50900 FUN_00a50900 void FUN_00a50900(undefined8 param_1,undefined8 param_2) { epoxy_glWindowPos2dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glWindowPos2dARB)(param_1,param_2); return; } //@@ 00a50940 FUN_00a50940 void FUN_00a50940(undefined8 param_1,undefined8 param_2) { epoxy_glWindowPos2dMESA = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glWindowPos2dMESA)(param_1,param_2); return; } //@@ 00a50980 FUN_00a50980 void FUN_00a50980(void) { epoxy_glWindowPos2dv = (undefined *)FUN_00a2ca10(&DAT_00b2a048); /* WARNING: Could not recover jumptable at 0x00a509a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2dv)(); return; } //@@ 00a509b0 FUN_00a509b0 void FUN_00a509b0(void) { epoxy_glWindowPos2dvARB = (undefined *)FUN_00a2ca10(&DAT_00b28230); /* WARNING: Could not recover jumptable at 0x00a509d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2dvARB)(); return; } //@@ 00a509e0 FUN_00a509e0 void FUN_00a509e0(void) { epoxy_glWindowPos2dvMESA = (undefined *)FUN_00a2ca10(&DAT_00b2aff4); /* WARNING: Could not recover jumptable at 0x00a50a00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2dvMESA)(); return; } //@@ 00a50a10 FUN_00a50a10 void FUN_00a50a10(undefined4 param_1,undefined4 param_2) { epoxy_glWindowPos2f = (undefined *)FUN_00a2ca10(&DAT_00b291d0); (*(code *)epoxy_glWindowPos2f)(param_1,param_2); return; } //@@ 00a50a50 FUN_00a50a50 void FUN_00a50a50(undefined4 param_1,undefined4 param_2) { epoxy_glWindowPos2fARB = (undefined *)FUN_00a2ca10(&DAT_00b27508); (*(code *)epoxy_glWindowPos2fARB)(param_1,param_2); return; } //@@ 00a50a90 FUN_00a50a90 void FUN_00a50a90(undefined4 param_1,undefined4 param_2) { epoxy_glWindowPos2fMESA = (undefined *)FUN_00a2ca10(&DAT_00b3bb48); (*(code *)epoxy_glWindowPos2fMESA)(param_1,param_2); return; } //@@ 00a50ad0 FUN_00a50ad0 void FUN_00a50ad0(void) { epoxy_glWindowPos2fv = (undefined *)FUN_00a2ca10(&DAT_00b2aa00); /* WARNING: Could not recover jumptable at 0x00a50af0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2fv)(); return; } //@@ 00a50b00 FUN_00a50b00 void FUN_00a50b00(void) { epoxy_glWindowPos2fvARB = (undefined *)FUN_00a2ca10(&DAT_00b3cda0); /* WARNING: Could not recover jumptable at 0x00a50b20. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2fvARB)(); return; } //@@ 00a50b30 FUN_00a50b30 void FUN_00a50b30(void) { epoxy_glWindowPos2fvMESA = (undefined *)FUN_00a2ca10(&DAT_00b255b4); /* WARNING: Could not recover jumptable at 0x00a50b50. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2fvMESA)(); return; } //@@ 00a50b60 FUN_00a50b60 void FUN_00a50b60(void) { epoxy_glWindowPos2i = (undefined *)FUN_00a2ca10(&DAT_00b2956c); /* WARNING: Could not recover jumptable at 0x00a50b80. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2i)(); return; } //@@ 00a50b90 FUN_00a50b90 void FUN_00a50b90(void) { epoxy_glWindowPos2iARB = (undefined *)FUN_00a2ca10(&DAT_00b2a7ac); /* WARNING: Could not recover jumptable at 0x00a50bb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2iARB)(); return; } //@@ 00a50bc0 FUN_00a50bc0 void FUN_00a50bc0(void) { epoxy_glWindowPos2iMESA = (undefined *)FUN_00a2ca10(&DAT_00b28b98); /* WARNING: Could not recover jumptable at 0x00a50be0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2iMESA)(); return; } //@@ 00a50bf0 FUN_00a50bf0 void FUN_00a50bf0(void) { epoxy_glWindowPos2iv = (undefined *)FUN_00a2ca10(&DAT_00b3c3bc); /* WARNING: Could not recover jumptable at 0x00a50c10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2iv)(); return; } //@@ 00a50c20 FUN_00a50c20 void FUN_00a50c20(void) { epoxy_glWindowPos2ivARB = (undefined *)FUN_00a2ca10(&DAT_00b2a5b8); /* WARNING: Could not recover jumptable at 0x00a50c40. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2ivARB)(); return; } //@@ 00a50c50 FUN_00a50c50 void FUN_00a50c50(void) { epoxy_glWindowPos2ivMESA = (undefined *)FUN_00a2ca10(&DAT_00b3b2d4); /* WARNING: Could not recover jumptable at 0x00a50c70. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2ivMESA)(); return; } //@@ 00a50c80 FUN_00a50c80 void FUN_00a50c80(void) { epoxy_glWindowPos2s = (undefined *)FUN_00a2ca10(&DAT_00b26fe8); /* WARNING: Could not recover jumptable at 0x00a50ca0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2s)(); return; } //@@ 00a50cb0 FUN_00a50cb0 void FUN_00a50cb0(void) { epoxy_glWindowPos2sARB = (undefined *)FUN_00a2ca10(&DAT_00b3c474); /* WARNING: Could not recover jumptable at 0x00a50cd0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2sARB)(); return; } //@@ 00a50ce0 FUN_00a50ce0 void FUN_00a50ce0(void) { epoxy_glWindowPos2sMESA = (undefined *)FUN_00a2ca10(&DAT_00b3d788); /* WARNING: Could not recover jumptable at 0x00a50d00. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2sMESA)(); return; } //@@ 00a50d10 FUN_00a50d10 void FUN_00a50d10(void) { epoxy_glWindowPos2sv = (undefined *)FUN_00a2ca10(&DAT_00b27b6c); /* WARNING: Could not recover jumptable at 0x00a50d30. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2sv)(); return; } //@@ 00a50d40 FUN_00a50d40 void FUN_00a50d40(void) { epoxy_glWindowPos2svARB = (undefined *)FUN_00a2ca10(&DAT_00b3b994); /* WARNING: Could not recover jumptable at 0x00a50d60. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2svARB)(); return; } //@@ 00a50d70 FUN_00a50d70 void FUN_00a50d70(void) { epoxy_glWindowPos2svMESA = (undefined *)FUN_00a2ca10(&DAT_00b3b220); /* WARNING: Could not recover jumptable at 0x00a50d90. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos2svMESA)(); return; } //@@ 00a50da0 FUN_00a50da0 void FUN_00a50da0(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glWindowPos3d = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glWindowPos3d)(param_1,param_2,param_3); return; } //@@ 00a50df0 FUN_00a50df0 void FUN_00a50df0(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glWindowPos3dARB = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glWindowPos3dARB)(param_1,param_2,param_3); return; } //@@ 00a50e40 FUN_00a50e40 void FUN_00a50e40(undefined8 param_1,undefined8 param_2,undefined8 param_3) { epoxy_glWindowPos3dMESA = (undefined *)FUN_00a2ca10(); (*(code *)epoxy_glWindowPos3dMESA)(param_1,param_2,param_3); return; } //@@ 00a50e90 FUN_00a50e90 void FUN_00a50e90(void) { epoxy_glWindowPos3dv = (undefined *)FUN_00a2ca10(&DAT_00b3b2a0); /* WARNING: Could not recover jumptable at 0x00a50eb0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3dv)(); return; } //@@ 00a50ec0 FUN_00a50ec0 void FUN_00a50ec0(void) { epoxy_glWindowPos3dvARB = (undefined *)FUN_00a2ca10(&DAT_00b275f0); /* WARNING: Could not recover jumptable at 0x00a50ee0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3dvARB)(); return; } //@@ 00a50ef0 FUN_00a50ef0 void FUN_00a50ef0(void) { epoxy_glWindowPos3dvMESA = (undefined *)FUN_00a2ca10(&DAT_00b2a18c); /* WARNING: Could not recover jumptable at 0x00a50f10. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3dvMESA)(); return; } //@@ 00a50f20 FUN_00a50f20 void FUN_00a50f20(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glWindowPos3f = (undefined *)FUN_00a2ca10(&DAT_00b3b778); (*(code *)epoxy_glWindowPos3f)(param_1,param_2,param_3); return; } //@@ 00a50f70 FUN_00a50f70 void FUN_00a50f70(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glWindowPos3fARB = (undefined *)FUN_00a2ca10(&DAT_00b3d078); (*(code *)epoxy_glWindowPos3fARB)(param_1,param_2,param_3); return; } //@@ 00a50fc0 FUN_00a50fc0 void FUN_00a50fc0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { epoxy_glWindowPos3fMESA = (undefined *)FUN_00a2ca10(&DAT_00b29cd4); (*(code *)epoxy_glWindowPos3fMESA)(param_1,param_2,param_3); return; } //@@ 00a51010 FUN_00a51010 void FUN_00a51010(void) { epoxy_glWindowPos3fv = (undefined *)FUN_00a2ca10(&DAT_00b29114); /* WARNING: Could not recover jumptable at 0x00a51030. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3fv)(); return; } //@@ 00a51040 FUN_00a51040 void FUN_00a51040(void) { epoxy_glWindowPos3fvARB = (undefined *)FUN_00a2ca10(&DAT_00b3d858); /* WARNING: Could not recover jumptable at 0x00a51060. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3fvARB)(); return; } //@@ 00a51070 FUN_00a51070 void FUN_00a51070(void) { epoxy_glWindowPos3fvMESA = (undefined *)FUN_00a2ca10(&DAT_00b26e10); /* WARNING: Could not recover jumptable at 0x00a51090. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3fvMESA)(); return; } //@@ 00a510a0 FUN_00a510a0 void FUN_00a510a0(void) { epoxy_glWindowPos3i = (undefined *)FUN_00a2ca10(&DAT_00b26b40); /* WARNING: Could not recover jumptable at 0x00a510c0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3i)(); return; } //@@ 00a510d0 FUN_00a510d0 void FUN_00a510d0(void) { epoxy_glWindowPos3iARB = (undefined *)FUN_00a2ca10(&DAT_00b3d274); /* WARNING: Could not recover jumptable at 0x00a510f0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3iARB)(); return; } //@@ 00a51100 FUN_00a51100 void FUN_00a51100(void) { epoxy_glWindowPos3iMESA = (undefined *)FUN_00a2ca10(&DAT_00b25c30); /* WARNING: Could not recover jumptable at 0x00a51120. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3iMESA)(); return; } //@@ 00a51130 FUN_00a51130 void FUN_00a51130(void) { epoxy_glWindowPos3iv = (undefined *)FUN_00a2ca10(&DAT_00b2a984); /* WARNING: Could not recover jumptable at 0x00a51150. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3iv)(); return; } //@@ 00a51160 FUN_00a51160 void FUN_00a51160(void) { epoxy_glWindowPos3ivARB = (undefined *)FUN_00a2ca10(&DAT_00b2714c); /* WARNING: Could not recover jumptable at 0x00a51180. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3ivARB)(); return; } //@@ 00a51190 FUN_00a51190 void FUN_00a51190(void) { epoxy_glWindowPos3ivMESA = (undefined *)FUN_00a2ca10(&DAT_00b3c614); /* WARNING: Could not recover jumptable at 0x00a511b0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3ivMESA)(); return; } //@@ 00a511c0 FUN_00a511c0 void FUN_00a511c0(void) { epoxy_glWindowPos3s = (undefined *)FUN_00a2ca10(&DAT_00b3bb34); /* WARNING: Could not recover jumptable at 0x00a511e0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3s)(); return; } //@@ 00a511f0 FUN_00a511f0 void FUN_00a511f0(void) { epoxy_glWindowPos3sARB = (undefined *)FUN_00a2ca10(&DAT_00b2ae88); /* WARNING: Could not recover jumptable at 0x00a51210. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3sARB)(); return; } //@@ 00a51220 FUN_00a51220 void FUN_00a51220(void) { epoxy_glWindowPos3sMESA = (undefined *)FUN_00a2ca10(&DAT_00b3c894); /* WARNING: Could not recover jumptable at 0x00a51240. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3sMESA)(); return; } //@@ 00a51250 FUN_00a51250 void FUN_00a51250(void) { epoxy_glWindowPos3sv = (undefined *)FUN_00a2ca10(&DAT_00b29158); /* WARNING: Could not recover jumptable at 0x00a51270. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3sv)(); return; } //@@ 00a51280 FUN_00a51280 void FUN_00a51280(void) { epoxy_glWindowPos3svARB = (undefined *)FUN_00a2ca10(&DAT_00b2abb0); /* WARNING: Could not recover jumptable at 0x00a512a0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3svARB)(); return; } //@@ 00a512b0 FUN_00a512b0 void FUN_00a512b0(void) { epoxy_glWindowPos3svMESA = (undefined *)FUN_00a2ca10(&DAT_00b293a8); /* WARNING: Could not recover jumptable at 0x00a512d0. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos3svMESA)(); return; } //@@ 00a512e0 FUN_00a512e0 void FUN_00a512e0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4) { epoxy_glWindowPos4dMESA = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glWindowPos4dMESA)(param_1,param_2,param_3,param_4); return; } //@@ 00a51330 FUN_00a51330 void FUN_00a51330(void) { epoxy_glWindowPos4dvMESA = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a51348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos4dvMESA)(); return; } //@@ 00a51350 FUN_00a51350 void FUN_00a51350(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_glWindowPos4fMESA = (undefined *)FUN_00a308f0(); (*(code *)epoxy_glWindowPos4fMESA)(param_1,param_2,param_3,param_4); return; } //@@ 00a513a0 FUN_00a513a0 void FUN_00a513a0(void) { epoxy_glWindowPos4fvMESA = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a513b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos4fvMESA)(); return; } //@@ 00a513c0 FUN_00a513c0 void FUN_00a513c0(void) { epoxy_glWindowPos4iMESA = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a513d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos4iMESA)(); return; } //@@ 00a513e0 FUN_00a513e0 void FUN_00a513e0(void) { epoxy_glWindowPos4ivMESA = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a513f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos4ivMESA)(); return; } //@@ 00a51400 FUN_00a51400 void FUN_00a51400(void) { epoxy_glWindowPos4sMESA = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a51418. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos4sMESA)(); return; } //@@ 00a51420 FUN_00a51420 void FUN_00a51420(void) { epoxy_glWindowPos4svMESA = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a51438. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWindowPos4svMESA)(); return; } //@@ 00a51440 FUN_00a51440 void FUN_00a51440(void) { epoxy_glWriteMaskEXT = (undefined *)FUN_00a308f0(); /* WARNING: Could not recover jumptable at 0x00a51458. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_glWriteMaskEXT)(); return; } //@@ 00a51460 FUN_00a51460 void FUN_00a51460(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if (*(void **)(in_ECX + 4) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 4),0); *(undefined4 *)(in_ECX + 4) = 0; } ExceptionList = local_10; return; } //@@ 00a51500 FUN_00a51500 void FUN_00a51500(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if ((void *)in_ECX[4] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[4],0); in_ECX[4] = 0; } *in_ECX = KAGE::System::UserProfileBase::vftable; ExceptionList = local_10; return; } //@@ 00a51570 FUN_00a51570 void FUN_00a51570(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { undefined4 *in_ECX; *in_ECX = param_1; in_ECX[1] = param_2; in_ECX[2] = param_7; in_ECX[3] = param_8; in_ECX[0x28] = param_3; in_ECX[0x29] = param_4; in_ECX[0x2a] = param_5; *(undefined1 *)(in_ECX + 7) = 0; in_ECX[6] = CCallResult:: vftable; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[8] = 0x450; *(undefined1 *)(in_ECX + 0xf) = 0; in_ECX[0xe] = CCallResult:: vftable; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0; in_ECX[0x10] = 0x452; *(undefined1 *)(in_ECX + 0x17) = 0; in_ECX[0x16] = CCallResult ::vftable; in_ECX[0x1a] = 0; in_ECX[0x1b] = 0; in_ECX[0x1c] = 0; in_ECX[0x1d] = 0; in_ECX[0x18] = 0x451; *(undefined1 *)(in_ECX + 0x1f) = 0; in_ECX[0x1e] = CCallResult::vftable ; in_ECX[0x22] = 0; in_ECX[0x23] = 0; in_ECX[0x24] = 0; in_ECX[0x25] = 0; in_ECX[0x20] = 0x457; in_ECX[0x26] = 0; in_ECX[0x2b] = param_6; return; } //@@ 00a51690 FUN_00a51690 void FUN_00a51690(byte param_1) { void *in_ECX; FUN_00a516c0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x34); } return; } //@@ 00a516c0 FUN_00a516c0 void FUN_00a516c0(void) { int *this; LPCRITICAL_SECTION p_Var1; undefined4 *in_ECX; *in_ECX = KAGE::System::LeaderboardManagerBase::vftable; p_Var1 = (LPCRITICAL_SECTION)in_ECX[0xb]; in_ECX[9] = KAGE::Mutex::vftable; if (p_Var1 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var1); operator_delete(p_Var1,0x1c); in_ECX[0xb] = 0; } *(byte *)(in_ECX + 10) = *(byte *)(in_ECX + 10) & 0xfe; in_ECX[9] = KAGE::MutexBase::vftable; FUN_00498f80(); p_Var1 = (LPCRITICAL_SECTION)in_ECX[6]; in_ECX[4] = KAGE::Mutex::vftable; if (p_Var1 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var1); operator_delete(p_Var1,0x1c); in_ECX[6] = 0; } *(byte *)(in_ECX + 5) = *(byte *)(in_ECX + 5) & 0xfe; this = in_ECX + 2; in_ECX[4] = KAGE::MutexBase::vftable; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(*this + 4)); operator_delete((void *)*this,0x18); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a51760 FUN_00a51760 undefined4 FUN_00a51760(void) { int in_ECX; if ((*(byte *)(in_ECX + 4) & 1) == 0) { (**(code **)(*(int *)(in_ECX + 0x10) + 4))(); (**(code **)(*(int *)(in_ECX + 0x24) + 4))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; } return 1; } //@@ 00a51790 KAGE::System::LeaderboardManager::get_result /* DB: ? under the LeaderboardManager mutex looks the handle up in the map (DAT_00c5ab18) and returns node value +0x14 or 0; Game::StartStageTransition (handles at Game+0x1d888/+0x1d890) prototype: db/protos.zhl, confirmed by RET 4 */ int KAGE::System::LeaderboardManager::get_result(uint handle) { uint uVar1; int iVar2; undefined1 local_1c [8]; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; uVar1 = handle; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; if (handle == 0) { return 0; } ExceptionList = &local_10; (**(code **)(DAT_00c5ab20 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_1c + 0x18)); _Find_lower_bound<>(local_1c,&handle); if (((*(char *)(local_14 + 0xd) == '\0') && (*(uint *)(local_14 + 0x10) <= uVar1)) && (local_14 != DAT_00c5ab18)) { iVar2 = *(int *)(local_14 + 0x14); } else { iVar2 = 0; } local_8 = 0; (**(code **)(DAT_00c5ab20 + 0x10))(); ExceptionList = local_10; return iVar2; } //@@ 00a51840 KAGE::System::LeaderboardManager::release_result /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? global LeaderboardManager (vftable set in 00406c10, map head DAT_00c5ab18, mutex DAT_00c5ab20): when enabled (flag bit0) frees the 0x18 result for a handle or all for -1 and erases it; Leaderboard::Show releases its four handles prototype: db/protos.zhl, confirmed by RET 4 */ void KAGE::System::LeaderboardManager::release_result(int handle) { int iVar1; void *pvVar2; int *piVar3; undefined1 local_1c [8]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar1 = handle; local_8 = 0xffffffff; puStack_c = &LAB_00b122d0; local_10 = ExceptionList; ExceptionList = &local_10; if ((((byte)DAT_00c5ab14 & 1) != 0) && (handle != 0)) { (**(code **)(DAT_00c5ab20 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_1c + 0x18)); if (iVar1 == -1) { handle = *DAT_00c5ab18; piVar3 = DAT_00c5ab18; if ((int *)handle != DAT_00c5ab18) { do { iVar1 = handle; pvVar2 = *(void **)(handle + 0x14); if (pvVar2 != (void *)0x0) { if (*(void **)((int)pvVar2 + 4) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)((int)pvVar2 + 4),0); *(undefined4 *)((int)pvVar2 + 4) = 0; } operator_delete(pvVar2,0x18); *(undefined4 *)(iVar1 + 0x14) = 0; piVar3 = DAT_00c5ab18; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&handle); } while ((int *)handle != piVar3); } FID_conflict__Erase_tree_>_> (&DAT_00c5ab18, (fuzzer_allocator_> *)&DAT_00c5ab18, (_Tree_node *)piVar3[1]); piVar3[1] = (int)piVar3; *piVar3 = (int)piVar3; piVar3[2] = (int)piVar3; _DAT_00c5ab1c = 0; } else { _Find_lower_bound<>(local_1c,&handle); if (((*(char *)((int)local_14 + 0xd) == '\0') && ((uint)local_14[4] <= (uint)iVar1)) && (local_14 != DAT_00c5ab18)) { if (local_14[5] != 0) { FUN_008d0bc0(local_14[5]); local_14[5] = 0; } pvVar2 = std_tree_extract(&DAT_00c5ab18,local_14); operator_delete(pvVar2,0x18); } } local_8 = 2; (**(code **)(DAT_00c5ab20 + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a519a0 leaderboard_find_async /* DB: ? (name, flag 0/1, callback, userdata): when the online service bit DAT_00c5ab14&1 is off calls callback(0, userdata) at once; otherwise news a 0xb0 request holding a copy of the name, FUN_00a51570(1,0,name,flag,callback,userdata) and submits it (FUN_00a52100); Leaderboard::get_leaderboard passes the ranking name with FUN_0085a8f0/FUN_0085a9d0 callbacks, Game::StartStageTransition too prototype: db/protos.zhl, confirmed by RET 16 */ byte leaderboard_find_async(byte *name,int mode,void *callback,void *userData) { byte bVar1; void *pvVar2; undefined4 uVar3; byte *pbVar4; char *_Dest; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12307; local_10 = ExceptionList; ExceptionList = &local_10; if (((byte)DAT_00c5ab14 & 1) == 0) { (*callback)(0,userData,__security_cookie ^ (int)register0x00000010 - 4U); ExceptionList = local_10; return 0; } pvVar2 = operator_new(0xb0); local_8 = 0; if (pvVar2 == (void *)0x0) { uVar3 = 0; } else { if (name == (byte *)0x0) { _Dest = (char *)0x0; } else { pbVar4 = name; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); _Dest = operator_new_tracked((uint)(pbVar4 + (1 - (int)(name + 1)))); pbVar4 = name; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); strncpy(_Dest,(char *)name,(size_t)(pbVar4 + (1 - (int)(name + 1)))); } uVar3 = FUN_00a51570(1,0,_Dest,(int)_Dest >> 0x1f,mode,mode >> 0x1f,callback,userData); } local_8 = 0xffffffff; bVar1 = FUN_00a52100(uVar3); ExceptionList = local_10; return bVar1; } //@@ 00a51aa0 FUN_00a51aa0 uint FUN_00a51aa0(undefined4 param_1,int param_2,void *param_3,undefined4 param_4,undefined4 param_5 ) { int iVar1; uint extraout_EAX; void *pvVar2; undefined4 uVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12347; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = FUN_00a51d10(param_1); if (iVar1 == 0) { KAGE_LogMessage(4,(byte *) "Attempting to upload score to leaderboard that hasn\'t been downloaded\n"); ExceptionList = local_10; return extraout_EAX & 0xffffff00; } if ((param_3 != (void *)0x0) && (DAT_00c5ab40 == 0)) { KAGE_LogMessage(0x10,(byte *) "Extra data has been specified but no extra data size has been specified\n" ); } pvVar2 = operator_new(0xb0); uVar4 = DAT_00c5ab40; local_8 = 0; if (pvVar2 == (void *)0x0) { uVar3 = 0; } else { if (param_3 == (void *)0x0) { pvVar2 = (void *)0x0; } else { pvVar2 = operator_new_tracked(DAT_00c5ab40); memcpy(pvVar2,param_3,uVar4); } uVar3 = FUN_00a51570(2,param_1,param_2,param_2 >> 0x1f,pvVar2,(int)pvVar2 >> 0x1f,param_4, param_5); } local_8 = 0xffffffff; uVar4 = FUN_00a52100(uVar3); ExceptionList = local_10; return uVar4; } //@@ 00a51bb0 FUN_00a51bb0 uint FUN_00a51bb0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { qword qVar1; int iVar2; uint extraout_EAX; undefined4 *puVar3; uint uVar4; undefined4 uVar5; qword *pqVar6; iVar2 = FUN_00a51d10(param_1); if (iVar2 == 0) { KAGE_LogMessage(4,(byte *) "Attempting to download entries from leaderboard that hasn\'t been downloaded\n" ); return extraout_EAX & 0xffffff00; } if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0xb4); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0xb4; *puVar3 = 0xb4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffff4b < (uint)qVar1); if (puVar3 != (undefined4 *)0xfffffffc) { uVar5 = FUN_00a51570(3,param_1,param_2,0,param_3,0,FUN_0085ab90,param_5); uVar4 = FUN_00a52100(uVar5); return uVar4; } } uVar4 = FUN_00a52100(0); return uVar4; } //@@ 00a51c60 FUN_00a51c60 uint FUN_00a51c60(undefined4 param_1,undefined4 param_2,undefined4 param_3) { qword qVar1; int iVar2; uint extraout_EAX; undefined4 *puVar3; uint uVar4; undefined4 uVar5; qword *pqVar6; iVar2 = FUN_00a51d10(param_1); if (iVar2 == 0) { KAGE_LogMessage(4,(byte *) "Attempting to download entries from leaderboard that hasn\'t been downloaded\n" ); return extraout_EAX & 0xffffff00; } if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0xb4); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0xb4; *puVar3 = 0xb4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffff4b < (uint)qVar1); if (puVar3 != (undefined4 *)0xfffffffc) { uVar5 = FUN_00a51570(4,param_1,0,0,0,0,param_2,param_3); uVar4 = FUN_00a52100(uVar5); return uVar4; } } uVar4 = FUN_00a52100(0); return uVar4; } //@@ 00a51d10 FUN_00a51d10 undefined4 FUN_00a51d10(uint param_1) { int *piVar1; int in_ECX; undefined4 uVar2; undefined1 local_1c [8]; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x10); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_1c + 0x18)); } _Find_lower_bound<>(local_1c,¶m_1); if ((*(char *)(local_14 + 0xd) != '\0') || (param_1 < *(uint *)(local_14 + 0x10))) { local_14 = *(int *)(in_ECX + 8); } if (local_14 == *(int *)(in_ECX + 8)) { uVar2 = 0; } else { uVar2 = *(undefined4 *)(local_14 + 0x14); } local_8 = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return uVar2; } //@@ 00a51dc0 leaderboard_request_complete /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? switch on the async op type (*param_1): 0/1 find ("Failed to get leaderboard '%s': %s", assigns a handle id from DAT_00c12934 under the service mutex), 2 download entries, upload score, attach UGC failures, then calls the stored callback (+8, userdata +0xc); callers are the Steam/EOS leaderboard result handlers 00a7df10/00a7e120/00a7e2b0/00a7e330 prototype: db/protos.zhl, confirmed by RET 4 */ void leaderboard_request_complete(void *request) { uint *ptr; void *pvVar1; int iVar2; char *pcVar3; char *pcVar4; code *pcVar5; undefined4 uVar6; char *format; undefined4 local_2c; undefined4 *local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1237d; local_10 = ExceptionList; local_18 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; switch(*(undefined4 *)request) { case 0: case 1: if (*(int *)((int)request + 0xa8) == 0) { KAGE_LogMessage(8,(byte *)"Failed to get leaderboard \'%s\': %s\n"); } else { (**(code **)(DAT_00c5ab20 + 0xc))(0xffffffff); local_8 = 0; iVar2 = DAT_00c12934 + 1; **(int **)((int)request + 0xa8) = DAT_00c12934; DAT_00c12934 = iVar2; local_28 = *(undefined4 **)((int)request + 0xa8); local_2c = *local_28; FUN_005cc810(&local_20,&local_2c); local_8 = 1; (**(code **)(DAT_00c5ab20 + 0x10))(); local_8 = 0xffffffff; } if (*(void **)((int)request + 0xa0) != (void *)0x0) { operator_delete(*(void **)((int)request + 0xa0),1); *(undefined4 *)((int)request + 0xa0) = 0; } if (*(code **)((int)request + 8) != (code *)0x0) { (**(code **)((int)request + 8)) (*(undefined4 *)((int)request + 0xa8),*(undefined4 *)((int)request + 0xc)); } goto switchD_00a51df8_default; case 2: pcVar5 = *(code **)((int)request + 8); if (pcVar5 == (code *)0x0) goto switchD_00a51df8_default; if (*(void **)((int)request + 0xa8) != (void *)0x0) { local_8 = 2; tracked_alloc(1,*(void **)((int)request + 0xa8),0); *(undefined4 *)((int)request + 0xa8) = 0; } local_8 = 0xffffffff; if (*(int *)((int)request + 0x98) == 0) { local_1c = *(undefined4 *)((int)request + 0xa0); local_20 = *(undefined4 *)((int)request + 0xa4); local_24 = *(undefined4 *)((int)request + 4); (*pcVar5)(&local_24,*(undefined4 *)((int)request + 0xc)); goto switchD_00a51df8_default; } iVar2 = FUN_00a51d10(*(undefined4 *)((int)request + 4)); pcVar4 = "Unknown"; if (*(char **)((int)request + 0x98) != (char *)0x0) { pcVar4 = *(char **)((int)request + 0x98); } if (iVar2 == 0) { pcVar3 = "Unknown"; format = "Failed to upload score to leaderboard \'%s\': %s\n"; } else { pcVar3 = *(char **)(iVar2 + 4); format = "Failed to upload score to leaderboard \'%s\': %s\n"; } break; case 3: case 4: case 5: pcVar5 = *(code **)((int)request + 8); if (pcVar5 == (code *)0x0) { pvVar1 = *(void **)((int)request + 0xa8); if (pvVar1 != (void *)0x0) { ptr = (uint *)((int)pvVar1 + -4); local_8 = 3; _eh_vector_destructor_iterator_(pvVar1,0x18,*ptr,FUN_00a51460); operator_delete(ptr,*ptr * 0x18 + 4); local_8 = 0xffffffff; *(undefined4 *)((int)request + 0xa8) = 0; } goto switchD_00a51df8_default; } if (*(int *)((int)request + 0x98) == 0) { local_20 = *(undefined4 *)((int)request + 0xa0); local_1c = *(undefined4 *)((int)request + 0xa8); local_24 = *(undefined4 *)((int)request + 4); (*pcVar5)(&local_24,*(undefined4 *)((int)request + 0xc)); goto switchD_00a51df8_default; } iVar2 = FUN_00a51d10(*(undefined4 *)((int)request + 4)); pcVar4 = "Unknown"; if (*(char **)((int)request + 0x98) != (char *)0x0) { pcVar4 = *(char **)((int)request + 0x98); } if (iVar2 == 0) { pcVar3 = "Unknown"; format = "Failed to download entries from leaderboard \'%s\': %s\n"; } else { pcVar3 = *(char **)(iVar2 + 4); format = "Failed to download entries from leaderboard \'%s\': %s\n"; } break; case 6: pcVar5 = *(code **)((int)request + 8); if (pcVar5 == (code *)0x0) goto switchD_00a51df8_default; if (*(int *)((int)request + 0x98) == 0) { local_28 = *(undefined4 **)((int)request + 4); (*pcVar5)(&local_28,*(undefined4 *)((int)request + 0xc),local_18); goto switchD_00a51df8_default; } iVar2 = FUN_00a51d10(*(undefined4 **)((int)request + 4)); pcVar4 = "Unknown"; if (*(char **)((int)request + 0x98) != (char *)0x0) { pcVar4 = *(char **)((int)request + 0x98); } if (iVar2 == 0) { pcVar3 = "Unknown"; } else { pcVar3 = *(char **)(iVar2 + 4); } format = "Failed to attach UGC to leaderboard \'%s\': %s\n"; break; default: goto switchD_00a51df8_default; } uVar6 = 8; KAGE_LogMessage(8,(byte *)format); (*pcVar5)(0,*(undefined4 *)((int)request + 0xc),uVar6,format,pcVar3,pcVar4); switchD_00a51df8_default: FUN_00a521f0(request); ExceptionList = local_10; return; } //@@ 00a52100 FUN_00a52100 undefined4 FUN_00a52100(int param_1) { undefined4 *puVar1; int iVar2; char cVar3; int *piVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b123bd; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(DAT_00c5ab34 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); iVar2 = DAT_00c5ab2c; if (DAT_00c5ab30 == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar4 = operator_new(0xc); local_8 = 0xffffffff; piVar4[2] = param_1; DAT_00c5ab30 = DAT_00c5ab30 + 1; puVar1 = *(undefined4 **)(iVar2 + 4); *piVar4 = iVar2; piVar4[1] = (int)puVar1; *(int **)(iVar2 + 4) = piVar4; *puVar1 = piVar4; (**(code **)(DAT_00c5ab34 + 0x10))(); cVar3 = (**(code **)(PTR_vftable_00c5ab10 + 0x18))(param_1); if (cVar3 == '\0') { FUN_00a521f0(param_1); ExceptionList = local_10; return 0; } ExceptionList = local_10; return 1; } //@@ 00a521f0 FUN_00a521f0 void FUN_00a521f0(void *param_1) { int *ptr; int *piVar1; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00af12f0; local_1c = ExceptionList; ExceptionList = &local_1c; (**(code **)(DAT_00c5ab34 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 0x10U); piVar1 = (int *)*DAT_00c5ab2c; do { ptr = piVar1; if (ptr == DAT_00c5ab2c) goto LAB_00a52273; piVar1 = (int *)*ptr; } while ((void *)ptr[2] != param_1); *(int **)ptr[1] = (int *)*ptr; *(int *)(*ptr + 4) = ptr[1]; DAT_00c5ab30 = DAT_00c5ab30 + -1; operator_delete(ptr,0xc); LAB_00a52273: if (param_1 != (void *)0x0) { *(undefined ***)((int)param_1 + 0x78) = CCallResult::vftable; FUN_00a52300(); *(undefined ***)((int)param_1 + 0x58) = CCallResult:: vftable; FUN_00a52300(); *(undefined ***)((int)param_1 + 0x38) = CCallResult::vftable; FUN_00a52300(); *(undefined ***)((int)param_1 + 0x18) = CCallResult::vftable; FUN_00a52300(); *(undefined4 *)((int)param_1 + 8) = 0; *(undefined4 *)((int)param_1 + 0xc) = 0; operator_delete(param_1,0xb0); } local_14 = 0; (**(code **)(DAT_00c5ab34 + 0x10))(); ExceptionList = local_1c; return; } //@@ 00a52300 FUN_00a52300 void FUN_00a52300(void) { int in_ECX; if (*(int *)(in_ECX + 0x10) != 0 || *(int *)(in_ECX + 0x14) != 0) { SteamAPI_UnregisterCallResult(); *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; } return; } //@@ 00a52340 FUN_00a52340 undefined4 FUN_00a52340(void) { return 0x10; } //@@ 00a52350 FUN_00a52350 void FUN_00a52350(undefined4 param_1) { int in_ECX; *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; (**(code **)(in_ECX + 0x1c))(param_1,0); return; } //@@ 00a52380 FUN_00a52380 void FUN_00a52380(undefined4 param_1,undefined4 param_2,int param_3,int param_4) { int in_ECX; if ((param_3 == *(int *)(in_ECX + 0x10)) && (param_4 == *(int *)(in_ECX + 0x14))) { *(undefined4 *)(in_ECX + 0x10) = 0; *(undefined4 *)(in_ECX + 0x14) = 0; (**(code **)(in_ECX + 0x1c))(param_1,param_2); } return; } //@@ 00a523c0 FUN_00a523c0 undefined4 FUN_00a523c0(void) { return 0x18; } //@@ 00a523d0 FUN_00a523d0 undefined4 FUN_00a523d0(void) { return 0x20; } //@@ 00a523e0 FUN_00a523e0 void FUN_00a523e0(byte param_1) { void *in_ECX; KAGE::Filesys::File::~File(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 00a52410 KAGE::Filesys::File::~File /* DB: sets File vftable, fclose(+0xc), state 2, frees path (+8) else FileStream vftable, then StreamBase vftable prototype: db/protos.zhl */ void __thiscall KAGE::Filesys::File::~File(void *this) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12420; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined ***)this = vftable; if (*(FILE **)((int)this + 0xc) != (FILE *)0x0) { fclose(*(FILE **)((int)this + 0xc)); *(undefined4 *)((int)this + 0xc) = 0; } *(undefined4 *)((int)this + 4) = 2; if (*(void **)((int)this + 8) == (void *)0x0) { *(undefined ***)this = FileStream::vftable; } else { local_8 = 0; tracked_alloc(1,*(void **)((int)this + 8),0); *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 4) = 2; } *(undefined ***)this = StreamBase::vftable; ExceptionList = local_10; return; } //@@ 00a524b0 file_exists /* DB: path_join then _access(path, 0) != -1; FileSystem::ResolvePath */ bool file_exists(void) { byte *_Filename; int iVar1; byte *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b02b00; local_10 = ExceptionList; ExceptionList = &local_10; _Filename = path_join(in_ECX,(byte *)0x0,0,0); if (_Filename == (byte *)0x0) { ExceptionList = local_10; return false; } iVar1 = _access((char *)_Filename,0); local_8 = 0; tracked_alloc(1,_Filename,0); ExceptionList = local_10; return iVar1 != -1; } //@@ 00a52540 KAGE::Filesys::File::open /* DB: vtable slot 9 (+0x24) of KAGE::Filesys::File (find.sh vtable); fopen(path_join(..),"rb") into +0xc, +4 pos = 0, +8 path; FileSystem::open_disk_file checks *(vt+0x24)==this function prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall KAGE::Filesys::File::open(void *this,byte *path) { byte *name; FILE *pFVar1; byte *pbVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0b60; local_10 = ExceptionList; ExceptionList = &local_10; name = path_join(path,(byte *)0x0,0,0); if (name != (byte *)0x0) { pFVar1 = fopen((char *)name,"rb"); *(FILE **)((int)this + 0xc) = pFVar1; if (pFVar1 != (FILE *)0x0) { *(undefined4 *)((int)this + 4) = 0; pbVar2 = path_join(name,(byte *)0x0,0,0); *(byte **)((int)this + 8) = pbVar2; local_8 = 0; tracked_alloc(1,name,0); ExceptionList = local_10; return 1; } local_8 = 1; tracked_alloc(1,name,0); } ExceptionList = local_10; return 0; } //@@ 00a52610 FUN_00a52610 bool FUN_00a52610(byte *param_1,char param_2) { byte *name; FILE *pFVar1; byte *pbVar2; int in_ECX; char *_Mode; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; name = path_join(param_1,DAT_00c5aa98,0,0); _Mode = "ab"; if (param_2 == '\0') { _Mode = "wb"; } pFVar1 = fopen((char *)name,_Mode); *(FILE **)(in_ECX + 0xc) = pFVar1; if (pFVar1 != (FILE *)0x0) { *(undefined4 *)(in_ECX + 4) = 1; pbVar2 = path_join(name,(byte *)0x0,0,0); *(byte **)(in_ECX + 8) = pbVar2; } if (name != (byte *)0x0) { local_8 = 0; tracked_alloc(1,name,0); } ExceptionList = local_10; return pFVar1 != (FILE *)0x0; } //@@ 00a526d0 FUN_00a526d0 void FUN_00a526d0(void) { int in_ECX; if (*(FILE **)(in_ECX + 0xc) != (FILE *)0x0) { fclose(*(FILE **)(in_ECX + 0xc)); *(undefined4 *)(in_ECX + 0xc) = 0; } return; } //@@ 00a526f0 FUN_00a526f0 void FUN_00a526f0(void) { int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(*in_ECX + 0x2c))(__security_cookie ^ (int)register0x00000010 - 4U); in_ECX[1] = 2; if ((void *)in_ECX[2] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[2],0); in_ECX[2] = 0; } ExceptionList = local_10; return; } //@@ 00a52760 FUN_00a52760 long FUN_00a52760(void) { long _Offset; long lVar1; int in_ECX; _Offset = ftell(*(FILE **)(in_ECX + 0xc)); fseek(*(FILE **)(in_ECX + 0xc),0,2); lVar1 = ftell(*(FILE **)(in_ECX + 0xc)); fseek(*(FILE **)(in_ECX + 0xc),_Offset,0); return lVar1; } //@@ 00a527b0 FUN_00a527b0 void FUN_00a527b0(void) { int in_ECX; ftell(*(FILE **)(in_ECX + 0xc)); return; } //@@ 00a527c0 FUN_00a527c0 void FUN_00a527c0(long param_1,int param_2) { int in_ECX; if (param_2 == 0) { fseek(*(FILE **)(in_ECX + 0xc),param_1,0); } else { if (param_2 == 1) { fseek(*(FILE **)(in_ECX + 0xc),param_1,1); return; } if (param_2 == 2) { fseek(*(FILE **)(in_ECX + 0xc),param_1,2); return; } } return; } //@@ 00a52820 FUN_00a52820 int FUN_00a52820(void *param_1,size_t param_2,size_t param_3) { size_t sVar1; int in_ECX; if (*(int *)(in_ECX + 4) == 0) { sVar1 = fread(param_1,param_2,param_3,*(FILE **)(in_ECX + 0xc)); return sVar1 * param_2; } return 0; } //@@ 00a52850 FUN_00a52850 int FUN_00a52850(void *param_1,size_t param_2,size_t param_3) { size_t sVar1; int in_ECX; if (*(int *)(in_ECX + 4) == 1) { sVar1 = fwrite(param_1,param_2,param_3,*(FILE **)(in_ECX + 0xc)); return sVar1 * param_2; } return 0; } //@@ 00a52880 FUN_00a52880 void FUN_00a52880(void) { int in_ECX; fflush(*(FILE **)(in_ECX + 0xc)); return; } //@@ 00a52890 flock /* DB: ECX=fd (_get_osfhandle), EDX=op: UnlockFileEx, then 1=LOCK_SH, 2=LOCK_EX (+4 LOCK_NB -> LOCKFILE_FAIL_IMMEDIATELY), 8=LOCK_UN returns 0, else errno EINVAL; used by PersistentGameData::Save, Isaac::SaveModData/LoadModData prototype: db/protos.zhl */ int __fastcall flock(int fd,int operation) { HANDLE hFile; uint uVar1; int *piVar2; BOOL BVar3; DWORD dwFlags; _OVERLAPPED local_18; hFile = (HANDLE)_get_osfhandle(fd); local_18.Internal = 0; local_18.InternalHigh = 0; local_18.u.s.Offset = 0; local_18.u.s.OffsetHigh = 0; local_18.hEvent = (HANDLE)0x0; UnlockFileEx(hFile,0,1,0,&local_18); uVar1 = operation & 0xfffffffb; if (uVar1 == 1) { dwFlags = (uint)operation >> 2 & 1; } else { if (uVar1 != 2) { if (uVar1 == 8) { return 0; } goto LAB_00a528ee; } dwFlags = ((uint)operation >> 2 & 1) + 2; } BVar3 = LockFileEx(hFile,dwFlags,0,1,0,&local_18); if (BVar3 != 0) { return 0; } LAB_00a528ee: piVar2 = _errno(); *piVar2 = 0x16; return -1; } //@@ 00a52940 KAGE::Network::Multiplayer::LobbySteam::request_lobby_data /* DB: ? ISteamMatchmaking (context 00c5c504) vfunc +0x70 (RequestLobbyData, slot 28) with the lobby CSteamID at this+8; on success stores (param_1,param_2) in the request map; Menu_OnlineLobbyList::Update prototype: db/protos.zhl, confirmed by RET 8 */ byte __thiscall KAGE::Network::Multiplayer::LobbySteam::request_lobby_data(void *this,void *callback,void *userData) { code *pcVar1; byte bVar2; uint uVar3; int *piVar4; undefined4 *puVar5; undefined4 extraout_ECX; undefined4 uVar6; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00b1244d; local_1c = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 0x10U; ExceptionList = &local_1c; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar3); if (*piVar4 == 0) { bVar2 = 0; } else { ::Lobby::refresh_members(this); puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar3); pcVar1 = *(code **)(*(int *)*puVar5 + 0x70); uVar6 = extraout_ECX; FUN_00a238e0(*(undefined4 *)((int)this + 8),*(undefined4 *)((int)this + 0xc)); bVar2 = (*pcVar1)(uVar6); if (bVar2 != 0) { local_14 = 0; puVar5 = (undefined4 *)FUN_00a533d0((int)this + 8); *puVar5 = callback; puVar5[1] = userData; } } ExceptionList = local_1c; return bVar2; } //@@ 00a52a10 FUN_00a52a10 void FUN_00a52a10(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Multiplayer::LobbyImplBase::vftable; std::vector::_Tidy(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x20); } return; } //@@ 00a52a40 FUN_00a52a40 void FUN_00a52a40(void) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Multiplayer::LobbyImplBase::vftable; std::vector::_Tidy(); return; } //@@ 00a52a50 FUN_00a52a50 undefined4 * FUN_00a52a50(void) { qword qVar1; undefined4 *puVar2; undefined4 *puVar3; qword *pqVar4; if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar2 = malloc(0x24); if (puVar2 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 0x24; *puVar2 = 0x24; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xffffffdb < (uint)qVar1); puVar3 = puVar2 + 1; if (puVar3 != (undefined4 *)0x0) { puVar2[3] = 0; puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0; puVar2[7] = 0; *puVar3 = KAGE::Network::Multiplayer::LobbySteam::vftable; return puVar3; } } return (undefined4 *)0x0; } //@@ 00a52ad0 FUN_00a52ad0 uint FUN_00a52ad0(void) { uint uVar1; uint uVar2; int in_ECX; uVar1 = *(uint *)(in_ECX + 0xc); uVar2 = 0; if (((*(int *)(in_ECX + 8) == 0 && uVar1 == 0) || (uVar2 = uVar1 & 0xf00000, uVar2 != 0x800000)) || ((uVar1 & 0x40000) == 0)) { return uVar2; } return 0x800001; } //@@ 00a52b10 KAGE::Network::Multiplayer::LobbySteam::get_members /* DB: vtable slot 6 of KAGE::Network::Multiplayer::LobbySteam (00b9e9a4; LobbyLocalhost's slot 6 FUN_00a9ec40 copies its member id vector): ISteamMatchmaking GetNumLobbyMembers (+0x44) / GetLobbyMemberByIndex (+0x48), GetLobbyMemberData (+0x60) "user_join_time" atoi, list sorted by join time ("list too long") */ void KAGE::Network::Multiplayer::LobbySteam::get_members(int *param_1) { code *pcVar1; int *piVar2; int *piVar3; uint uVar4; char cVar5; int *piVar6; undefined4 *puVar7; undefined4 *puVar8; char *_Str; int iVar9; undefined4 uVar10; int *in_ECX; undefined1 local_38 [8]; ulonglong local_30; int *local_28; int local_24; uint local_1c; int *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar3 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b12485; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; cVar5 = (**(code **)(*in_ECX + 0xc))(__security_cookie ^ (uint)(local_38 + 0x34)); if ((cVar5 == '\0') || (piVar6 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504), *piVar6 == 0)) { param_1[1] = *param_1; ExceptionList = local_10; return; } local_28 = (int *)0x0; local_24 = 0; local_28 = operator_new(0x18); *local_28 = (int)local_28; local_28[1] = (int)local_28; local_8 = 0; puVar7 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pcVar1 = *(code **)(*(int *)*puVar7 + 0x44); FUN_00a238e0(local_14[2],local_14[3]); local_1c = (*pcVar1)(); param_1 = (int *)0x0; if (local_1c != 0) { do { puVar7 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pcVar1 = *(code **)(*(int *)*puVar7 + 0x48); FUN_00a238e0(local_14[2],local_14[3]); puVar7 = (undefined4 *)(*pcVar1)(local_38); piVar6 = local_28; uVar10 = *puVar7; local_18 = (int *)puVar7[1]; if (local_24 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8._0_1_ = 1; local_30 = ZEXT48(&local_28); puVar8 = operator_new(0x18); local_8 = (uint)local_8._1_3_ << 8; local_30 = local_30 & 0xffffffff; puVar8[5] = local_18; puVar8[2] = 0xffffffff; puVar8[3] = 0xffffffff; puVar8[4] = uVar10; local_24 = local_24 + 1; puVar7 = (undefined4 *)piVar6[1]; *puVar8 = piVar6; puVar8[1] = puVar7; piVar6[1] = (int)puVar8; *puVar7 = puVar8; local_18 = (int *)(local_28[1] + 8); puVar7 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pcVar1 = *(code **)(*(int *)*puVar7 + 0x60); FUN_00a238e0(local_18[2],local_18[3]); FUN_00a238e0(local_14[2],local_14[3]); _Str = (char *)(*pcVar1)(); if ((_Str != (char *)0x0) && (*_Str != '\0')) { iVar9 = atoi(_Str); *local_18 = iVar9; local_18[1] = iVar9 >> 0x1f; } param_1 = (int *)((int)param_1 + 1); } while (param_1 < local_1c); } local_14 = (int *)local_24; local_18 = local_28; if ((local_24 != 0) && (local_24 != 1)) { FUN_00a535f0(param_1); uVar10 = FUN_00a535f0(param_1); piVar6 = local_18; iVar9 = FUN_00a53710(uVar10,param_1); *piVar6 = iVar9; } piVar6 = (int *)*local_28; if (piVar6 == local_28) { puVar7 = (undefined4 *)piVar3[1]; } else { do { piVar2 = (int *)piVar3[1]; if (piVar2 == (int *)piVar3[2]) { std::vector<8byte>::_Emplace_reallocate(piVar2,piVar6 + 4); } else { iVar9 = piVar6[5]; *piVar2 = piVar6[4]; piVar2[1] = iVar9; piVar3[1] = piVar3[1] + 8; } piVar6 = (int *)*piVar6; puVar7 = (undefined4 *)piVar3[1]; } while (piVar6 != local_28); } uVar4 = local_1c; iVar9 = (int)puVar7 - *piVar3; while ((uint)(iVar9 >> 3) < uVar4) { local_30 = 0; if (puVar7 == (undefined4 *)piVar3[2]) { std::vector<8byte>::_Emplace_reallocate(puVar7,&local_30); } else { *puVar7 = 0; puVar7[1] = 0; piVar3[1] = piVar3[1] + 8; } puVar7 = (undefined4 *)piVar3[1]; iVar9 = (int)puVar7 - *piVar3; } *(undefined4 *)local_28[1] = 0; puVar7 = (undefined4 *)*local_28; while (puVar7 != (undefined4 *)0x0) { puVar8 = (undefined4 *)*puVar7; operator_delete(puVar7,0x18); puVar7 = puVar8; } operator_delete(local_28,0x18); ExceptionList = local_10; return; } //@@ 00a52e20 FUN_00a52e20 undefined4 FUN_00a52e20(void) { char cVar1; int *piVar2; undefined4 *puVar3; undefined4 uVar4; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); uVar4 = (**(code **)(*(int *)*puVar3 + 0x80))(in_ECX[2],in_ECX[3]); return uVar4; } } return 0; } //@@ 00a52e80 FUN_00a52e80 undefined4 * FUN_00a52e80(undefined4 *param_1) { void *this; char cVar1; int *piVar2; int extraout_EAX; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b087ed; local_10 = ExceptionList; ExceptionList = &local_10; cVar1 = (**(code **)(*in_ECX + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if ((*piVar2 != 0) && (this = (void *)in_ECX[4], 7 < (uint)(in_ECX[5] - (int)this))) { *param_1 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); param_1[1] = extraout_EAX; local_8 = 0; *param_1 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(param_1); } ExceptionList = local_10; return param_1; } } param_1[1] = 0; *param_1 = KAGE::System::UserProfile::vftable; ExceptionList = local_10; return param_1; } //@@ 00a52f40 FUN_00a52f40 void FUN_00a52f40(undefined4 param_1,undefined4 param_2) { char cVar1; int *piVar2; undefined4 *puVar3; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); (**(code **)(*(int *)*puVar3 + 0x50))(in_ECX[2],in_ECX[3],param_1,param_2); } } return; } //@@ 00a52fa0 FUN_00a52fa0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a52fa0(undefined4 param_1) { char cVar1; int *piVar2; undefined4 *puVar3; int *in_ECX; undefined1 auStack_54 [4]; byte abStack_50 [68]; uint local_c; local_c = __security_cookie ^ (uint)auStack_54; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { sprintf(abStack_50,s__d); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); (**(code **)(*(int *)*puVar3 + 0x50))(in_ECX[2],in_ECX[3],param_1,abStack_50); } } return; } //@@ 00a53030 FUN_00a53030 byte * FUN_00a53030(undefined4 param_1) { char cVar1; int *piVar2; undefined4 *puVar3; byte *pbVar4; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pbVar4 = (byte *)(**(code **)(*(int *)*puVar3 + 0x4c))(in_ECX[2],in_ECX[3],param_1); return pbVar4; } } return &s_empty; } //@@ 00a530a0 FUN_00a530a0 int FUN_00a530a0(undefined4 param_1) { char cVar1; int *piVar2; undefined4 *puVar3; char *_Str; int iVar4; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); _Str = (char *)(**(code **)(*(int *)*puVar3 + 0x4c))(in_ECX[2],in_ECX[3],param_1); iVar4 = atoi(_Str); return iVar4; } } return 0; } //@@ 00a53110 FUN_00a53110 void FUN_00a53110(undefined4 param_1) { char cVar1; int *piVar2; undefined4 *puVar3; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); (**(code **)(*(int *)*puVar3 + 0x5c))(in_ECX[2],in_ECX[3],param_1); } } return; } //@@ 00a53170 FUN_00a53170 void FUN_00a53170(undefined4 param_1) { code *pcVar1; char cVar2; int *piVar3; undefined4 *puVar4; undefined4 uVar5; int *in_ECX; int *unaff_EDI; cVar2 = (**(code **)(*in_ECX + 0xc))(); if (cVar2 != '\0') { piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar3 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pcVar1 = *(code **)(*(int *)*puVar4 + 0x84); uVar5 = FUN_00a53350(); (*pcVar1)(in_ECX[2],in_ECX[3],uVar5); (**(code **)(*unaff_EDI + 0x24))("visibility",param_1); } } return; } //@@ 00a53200 FUN_00a53200 undefined4 FUN_00a53200(void) { char cVar1; undefined4 uVar2; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 == '\0') { return 3; } uVar2 = (**(code **)(*in_ECX + 0x30))("visibility"); return uVar2; } //@@ 00a53230 FUN_00a53230 void FUN_00a53230(undefined4 param_1) { char cVar1; int *piVar2; undefined4 *puVar3; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 != '\0') { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); (**(code **)(*(int *)*puVar3 + 0x88))(in_ECX[2],in_ECX[3],param_1); } } return; } //@@ 00a53290 KAGE::Network::Multiplayer::LobbySteam::find_or_create /* DB: ? builds a temporary LobbySteam (vftable 00b9e9a4) and calls the lobby registry FUN_00a71e10(out, lobbyId) that finds or clones the impl by 64-bit id; ModManager::RenderCustomCharacterMenu, Steam lobby code prototype: db/protos.zhl */ void * __fastcall KAGE::Network::Multiplayer::LobbySteam::find_or_create(void *outLobby,ulonglong *lobbyId) { uint size; void *ptr; undefined **local_34 [2]; undefined8 local_2c; void *local_24; undefined4 local_20; int local_1c; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b124bd; local_10 = ExceptionList; ExceptionList = &local_10; local_24 = (void *)0x0; local_2c = 0; local_20 = 0; local_1c = 0; local_34[0] = vftable; local_8 = 0; local_14 = outLobby; lobby_registry_find_or_create(local_34,outLobby,lobbyId); local_34[0] = LobbyImplBase::vftable; if (local_24 != (void *)0x0) { size = local_1c - (int)local_24 & 0xfffffff8; ptr = local_24; if (0xfff < size) { ptr = *(void **)((int)local_24 + -4); size = size + 0x23; if (0x1f < (uint)((int)local_24 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } ExceptionList = local_10; return outLobby; } //@@ 00a53350 FUN_00a53350 undefined4 FUN_00a53350(void) { undefined4 in_ECX; switch(in_ECX) { default: return 0; case 1: return 1; case 2: return 3; case 3: return 2; } } //@@ 00a53390 FUN_00a53390 void FUN_00a53390(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0x18); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x18); return; } //@@ 00a533d0 FUN_00a533d0 int FUN_00a533d0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)FUN_00a533f0(local_10,param_1); return *piVar1 + 0x18; } //@@ 00a533f0 FUN_00a533f0 void FUN_00a533f0(int *param_1,uint *param_2) { char cVar1; undefined4 *puVar2; int *piVar3; uint uVar4; undefined4 *puVar5; undefined4 *puVar6; undefined4 *puVar7; int *local_24; int local_20; int local_1c; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b07f0d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00a53660(&local_24,param_2); piVar3 = DAT_00c79a44; if (*(char *)(local_1c + 0xd) == '\0') { if ((*(uint *)(local_1c + 0x14) <= param_2[1]) && ((*(uint *)(local_1c + 0x14) < param_2[1] || (*(uint *)(local_1c + 0x10) <= *param_2)))) { *param_1 = local_1c; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } } if (DAT_00c79a48 == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } local_18 = &DAT_00c79a44; local_8 = 0; local_14 = 0; puVar5 = operator_new(0x20); uVar4 = param_2[1]; puVar5[4] = *param_2; puVar5[5] = uVar4; puVar5[6] = 0; puVar5[7] = 0; *puVar5 = piVar3; puVar5[1] = piVar3; puVar5[2] = piVar3; *(undefined2 *)(puVar5 + 3) = 0; piVar3 = DAT_00c79a44; DAT_00c79a48 = DAT_00c79a48 + 1; puVar5[1] = local_24; if (local_24 == piVar3) { *piVar3 = (int)puVar5; piVar3[1] = (int)puVar5; piVar3[2] = (int)puVar5; *(undefined1 *)(puVar5 + 3) = 1; } else { if (local_20 == 0) { local_24[2] = (int)puVar5; if (local_24 == (int *)piVar3[2]) { piVar3[2] = (int)puVar5; } } else { *local_24 = (int)puVar5; if (local_24 == (int *)*piVar3) { *piVar3 = (int)puVar5; } } cVar1 = *(char *)(puVar5[1] + 0xc); puVar7 = puVar5; while (cVar1 == '\0') { puVar2 = (undefined4 *)puVar7[1]; puVar6 = *(undefined4 **)puVar2[1]; if (puVar2 == puVar6) { puVar6 = (undefined4 *)((undefined4 *)puVar2[1])[2]; if (*(char *)(puVar6 + 3) == '\0') { LAB_00a53560: *(undefined1 *)(puVar2 + 3) = 1; *(undefined1 *)(puVar6 + 3) = 1; *(undefined1 *)(*(int *)(puVar7[1] + 4) + 0xc) = 0; puVar7 = *(undefined4 **)(puVar7[1] + 4); } else { if (puVar7 == (undefined4 *)puVar2[2]) { FUN_00415fe0(puVar2); puVar7 = puVar2; } *(undefined1 *)(puVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar7[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar7[1] + 4)); } } else { if (*(char *)(puVar6 + 3) == '\0') goto LAB_00a53560; if (puVar7 == (undefined4 *)*puVar2) { FUN_00415f80(puVar2); puVar7 = puVar2; } *(undefined1 *)(puVar7[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar7[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar7[1] + 4)); } cVar1 = *(char *)(puVar7[1] + 0xc); } *(undefined1 *)(piVar3[1] + 0xc) = 1; } *param_1 = (int)puVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a535f0 FUN_00a535f0 undefined4 FUN_00a535f0(undefined4 param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 *in_ECX; int in_EDX; if (in_EDX == 0) { return *in_ECX; } if (in_EDX == 1) { return *(undefined4 *)*in_ECX; } FUN_00a535f0(param_1); uVar1 = FUN_00a535f0(param_1); uVar2 = FUN_00a53710(uVar1,param_1); *in_ECX = uVar2; return uVar1; } //@@ 00a53660 FUN_00a53660 int * FUN_00a53660(int *param_1,uint *param_2) { uint uVar1; uint uVar2; undefined4 *puVar3; int iVar4; iVar4 = DAT_00c79a44; puVar3 = *(undefined4 **)(DAT_00c79a44 + 4); *param_1 = (int)puVar3; param_1[1] = 0; param_1[2] = iVar4; if (*(char *)((int)puVar3 + 0xd) == '\0') { uVar1 = *param_2; uVar2 = param_2[1]; do { *param_1 = (int)puVar3; if ((uVar2 < (uint)puVar3[5]) || ((uVar2 <= (uint)puVar3[5] && (uVar1 <= (uint)puVar3[4])))) { param_1[2] = (int)puVar3; iVar4 = 1; puVar3 = (undefined4 *)*puVar3; } else { puVar3 = (undefined4 *)puVar3[2]; iVar4 = 0; } param_1[1] = iVar4; } while (*(char *)((int)puVar3 + 0xd) == '\0'); } return param_1; } //@@ 00a536c0 FUN_00a536c0 void FUN_00a536c0(undefined4 param_1,int *param_2) { char cVar1; int *piVar2; cVar1 = *(char *)((int)param_2 + 0xd); while (cVar1 == '\0') { FUN_00a536c0(param_1,param_2[2]); piVar2 = (int *)*param_2; param_2[6] = 0; param_2[7] = 0; operator_delete(param_2,0x20); param_2 = piVar2; cVar1 = *(char *)((int)piVar2 + 0xd); } return; } //@@ 00a53710 FUN_00a53710 int * FUN_00a53710(int *param_1) { uint uVar1; uint uVar2; uint uVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 *puVar6; int *piVar7; int *in_ECX; int *in_EDX; int *piVar8; int *piVar9; bool bVar10; uVar1 = in_EDX[2]; uVar2 = in_EDX[3]; uVar3 = in_ECX[3]; piVar7 = in_EDX; piVar9 = in_ECX; if ((uVar1 == in_ECX[2]) && (uVar2 == uVar3)) { if ((uint)in_EDX[5] <= (uint)in_ECX[5]) { if ((uint)in_ECX[5] <= (uint)in_EDX[5]) { bVar10 = (uint)in_EDX[4] < (uint)in_ECX[4]; LAB_00a53749: if (!bVar10) goto LAB_00a53752; } LAB_00a5374b: bVar10 = true; goto joined_r0x00a53756; } } else if (uVar3 > uVar2 || uVar2 == uVar3) { if (uVar3 <= uVar2) { bVar10 = uVar1 < (uint)in_ECX[2]; goto LAB_00a53749; } goto LAB_00a5374b; } LAB_00a53752: bVar10 = false; joined_r0x00a53756: while (piVar8 = in_EDX, !bVar10) { piVar9 = (int *)*piVar9; if (piVar9 == in_EDX) { return in_ECX; } uVar3 = piVar9[3]; piVar7 = in_ECX; if ((uVar1 == piVar9[2]) && (uVar2 == uVar3)) { if ((uint)piVar9[5] < (uint)in_EDX[5]) goto LAB_00a5379b; if ((uint)piVar9[5] <= (uint)in_EDX[5]) { bVar10 = (uint)in_EDX[4] < (uint)piVar9[4]; LAB_00a53792: if (!bVar10) goto LAB_00a5379b; } LAB_00a53794: bVar10 = true; } else { if (uVar2 <= uVar3) { if (uVar3 <= uVar2) { bVar10 = uVar1 < (uint)piVar9[2]; goto LAB_00a53792; } goto LAB_00a53794; } LAB_00a5379b: bVar10 = false; } } do { in_EDX = (int *)*in_EDX; if (in_EDX == param_1) goto LAB_00a537e8; uVar1 = in_EDX[3]; uVar2 = piVar9[3]; if ((in_EDX[2] == piVar9[2]) && (uVar1 == uVar2)) { if ((uint)piVar9[5] < (uint)in_EDX[5]) goto LAB_00a537e2; if ((uint)piVar9[5] <= (uint)in_EDX[5]) { bVar10 = (uint)in_EDX[4] < (uint)piVar9[4]; LAB_00a537d9: if (!bVar10) goto LAB_00a537e2; } LAB_00a537db: bVar10 = true; } else { if (uVar1 <= uVar2) { if (uVar2 <= uVar1) { bVar10 = (uint)in_EDX[2] < (uint)piVar9[2]; goto LAB_00a537d9; } goto LAB_00a537db; } LAB_00a537e2: bVar10 = false; } if (!bVar10) { LAB_00a537e8: puVar4 = (undefined4 *)piVar8[1]; *puVar4 = in_EDX; puVar5 = (undefined4 *)in_EDX[1]; *puVar5 = piVar9; puVar6 = (undefined4 *)piVar9[1]; *puVar6 = piVar8; piVar9[1] = (int)puVar5; in_EDX[1] = (int)puVar4; piVar8[1] = (int)puVar6; if (in_EDX == param_1) { return piVar7; } do { piVar9 = (int *)*piVar9; if (piVar9 == in_EDX) { return piVar7; } uVar1 = in_EDX[3]; uVar2 = piVar9[3]; if ((in_EDX[2] == piVar9[2]) && (uVar1 == uVar2)) { if ((uint)piVar9[5] < (uint)in_EDX[5]) goto LAB_00a53845; if ((uint)piVar9[5] <= (uint)in_EDX[5]) { bVar10 = (uint)in_EDX[4] < (uint)piVar9[4]; LAB_00a5383c: if (!bVar10) goto LAB_00a53845; } LAB_00a5383e: bVar10 = true; } else { if (uVar1 <= uVar2) { if (uVar2 <= uVar1) { bVar10 = (uint)in_EDX[2] < (uint)piVar9[2]; goto LAB_00a5383c; } goto LAB_00a5383e; } LAB_00a53845: bVar10 = false; } piVar8 = in_EDX; } while (!bVar10); } } while( true ); } //@@ 00a53860 FUN_00a53860 void FUN_00a53860(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("SteamMatchMaking009"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 00a53880 FUN_00a53880 void FUN_00a53880(void) { FUN_00a538a0(); FUN_004b3950(); FUN_004b3950(); return; } //@@ 00a538a0 FUN_00a538a0 void FUN_00a538a0(void) { int iVar1; qword qVar2; void **ppvVar3; uint uVar4; int *in_ECX; int iVar5; qword *pqVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b124e0; iVar5 = in_ECX[1]; uVar4 = iVar5 - *in_ECX; ppvVar3 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar3, 0xf < uVar4) { iVar1 = *(int *)(iVar5 + -8); iVar5 = *(int *)(iVar5 + -0x10); if (iVar5 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar5 + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar4); free((void *)(iVar5 + -4)); *(undefined4 *)(in_ECX[1] + -0x10) = 0; } if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar1 + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar4); free((void *)(iVar1 + -4)); } iVar5 = in_ECX[1] + -0x10; in_ECX[1] = iVar5; ppvVar3 = ExceptionList; uVar4 = iVar5 - *in_ECX; } iVar5 = in_ECX[4]; if (0xf < (uint)(iVar5 - in_ECX[3])) { do { iVar5 = *(int *)(iVar5 + -0x10); if (iVar5 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(iVar5 + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar4); free((void *)(iVar5 + -4)); *(undefined4 *)(in_ECX[4] + -0x10) = 0; } in_ECX[4] = in_ECX[4] + -0x10; iVar5 = in_ECX[4]; } while ((iVar5 - in_ECX[3] & 0xfffffff0U) != 0); } ExceptionList = local_10; return; } //@@ 00a539d0 FUN_00a539d0 void FUN_00a539d0(void) { void *in_ECX; FUN_00a539f0(); FID_conflict__Tidy((void *)((int)in_ECX + 0xc)); FID_conflict__Tidy(in_ECX); return; } //@@ 00a539f0 FUN_00a539f0 void FUN_00a539f0(void) { int iVar1; uint uVar2; qword qVar3; uint uVar4; int *in_ECX; qword *pqVar5; code *pcVar6; int iVar7; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b12500; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar7 = in_ECX[1]; iVar1 = iVar7 - *in_ECX >> 0x1f; pcVar6 = free_exref; if ((iVar7 - *in_ECX) / 0x18 + iVar1 != iVar1) { do { iVar1 = *(int *)(iVar7 + -0x18); iVar7 = *(int *)(iVar7 + -0x10); if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); *(undefined4 *)(in_ECX[1] + -0x18) = 0; } if (iVar7 == 0) { pcVar6 = free_exref; } else { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar7 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; pcVar6 = free_exref; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar7 + -4)); } iVar7 = in_ECX[1] + -0x18; in_ECX[1] = iVar7; iVar1 = iVar7 - *in_ECX >> 0x1f; } while ((iVar7 - *in_ECX) / 0x18 + iVar1 != iVar1); } iVar7 = in_ECX[4]; iVar1 = iVar7 - in_ECX[3] >> 0x1f; if ((iVar7 - in_ECX[3]) / 0x18 + iVar1 != iVar1) { do { iVar7 = *(int *)(iVar7 + -0x18); if (iVar7 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar7 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); (*pcVar6)(iVar7 + -4,uVar4); *(undefined4 *)(in_ECX[4] + -0x18) = 0; } in_ECX[4] = in_ECX[4] + -0x18; iVar7 = in_ECX[4]; iVar1 = iVar7 - in_ECX[3] >> 0x1f; } while ((iVar7 - in_ECX[3]) / 0x18 + iVar1 != iVar1); } ExceptionList = local_10; return; } //@@ 00a53b70 FUN_00a53b70 void FUN_00a53b70(void) { undefined4 *in_ECX; *in_ECX = 0x32; in_ECX[1] = 1; in_ECX[2] = 1; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; return; } //@@ 00a53bc0 FUN_00a53bc0 void FUN_00a53bc0(void) { int in_ECX; FUN_00a539f0(); FID_conflict__Tidy((void *)(in_ECX + 0x18)); FID_conflict__Tidy((void *)(in_ECX + 0xc)); return; } //@@ 00a53be0 FUN_00a53be0 void FUN_00a53be0(int *param_1) { char cVar1; undefined4 uVar2; undefined4 *puVar3; int iVar4; int *piVar5; char *pcVar6; char *pcVar7; int in_ECX; char *pcVar8; char *pcVar9; undefined4 *puVar10; undefined1 local_34 [4]; undefined4 local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined8 local_20; puVar10 = (undefined4 *)*param_1; if (puVar10 != (undefined4 *)param_1[1]) { do { uVar2 = puVar10[4]; pcVar9 = (char *)*puVar10; pcVar7 = (char *)puVar10[2]; local_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; local_20 = 0; piVar5 = (int *)FUN_00a53e50(local_34,*(undefined4 *)(in_ECX + 0x10),&local_30); puVar3 = (undefined4 *)*piVar5; pcVar8 = (char *)0x0; if (pcVar9 != (char *)0x0) { pcVar8 = pcVar9; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); pcVar8 = operator_new_tracked((uint)(pcVar8 + (1 - (int)(pcVar9 + 1)))); pcVar6 = pcVar9; do { cVar1 = *pcVar6; pcVar6 = pcVar6 + 1; } while (cVar1 != '\0'); strncpy(pcVar8,pcVar9,(size_t)(pcVar6 + (1 - (int)(pcVar9 + 1)))); } *puVar3 = pcVar8; if (pcVar7 == (char *)0x0) { pcVar8 = (char *)0x0; } else { pcVar9 = pcVar7; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); pcVar8 = operator_new_tracked((uint)(pcVar9 + (1 - (int)(pcVar7 + 1)))); pcVar9 = pcVar7; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); strncpy(pcVar8,pcVar7,(size_t)(pcVar9 + (1 - (int)(pcVar7 + 1)))); } puVar10 = puVar10 + 6; puVar3[2] = pcVar8; puVar3[4] = uVar2; puVar3[3] = (int)pcVar8 >> 0x1f; } while (puVar10 != (undefined4 *)param_1[1]); } puVar10 = (undefined4 *)param_1[3]; if (puVar10 != (undefined4 *)param_1[4]) { do { uVar2 = puVar10[4]; pcVar9 = (char *)*puVar10; iVar4 = puVar10[2]; local_30 = 0; uStack_2c = 0; uStack_28 = 0; uStack_24 = 0; local_20 = 0; piVar5 = (int *)FUN_00a53e50(local_34,*(undefined4 *)(in_ECX + 0x1c),&local_30); puVar3 = (undefined4 *)*piVar5; pcVar7 = (char *)0x0; if (pcVar9 != (char *)0x0) { pcVar7 = pcVar9; do { cVar1 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar1 != '\0'); pcVar7 = operator_new_tracked((uint)(pcVar7 + (1 - (int)(pcVar9 + 1)))); pcVar8 = pcVar9; do { cVar1 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar1 != '\0'); strncpy(pcVar7,pcVar9,(size_t)(pcVar8 + (1 - (int)(pcVar9 + 1)))); } puVar10 = puVar10 + 6; puVar3[2] = iVar4; puVar3[4] = uVar2; puVar3[3] = iVar4 >> 0x1f; *puVar3 = pcVar7; } while (puVar10 != (undefined4 *)param_1[4]); } return; } //@@ 00a53dd0 FUN_00a53dd0 undefined4 * FUN_00a53dd0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; size_t _Size; undefined4 uVar5; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { uVar5 = FUN_009148c0(param_2,param_3); *param_1 = uVar5; return param_1; } uVar5 = *param_3; uVar2 = param_3[1]; uVar3 = param_3[2]; uVar4 = param_3[3]; if (param_2 == puVar1) { *puVar1 = uVar5; puVar1[1] = uVar2; puVar1[2] = uVar3; puVar1[3] = uVar4; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x10; *param_1 = param_2; return param_1; } _Size = (int)puVar1 + (-0x10 - (int)param_2); *puVar1 = puVar1[-4]; puVar1[1] = puVar1[-3]; puVar1[2] = puVar1[-2]; puVar1[3] = puVar1[-1]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x10; memmove((void *)((int)puVar1 - _Size),param_2,_Size); *param_2 = uVar5; param_2[1] = uVar2; param_2[2] = uVar3; param_2[3] = uVar4; *param_1 = param_2; return param_1; } //@@ 00a53e50 FUN_00a53e50 undefined4 * FUN_00a53e50(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3) { undefined8 uVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; size_t _Size; undefined4 uVar6; int in_ECX; puVar2 = *(undefined4 **)(in_ECX + 4); if (puVar2 == *(undefined4 **)(in_ECX + 8)) { uVar6 = FUN_00a53f00(param_2,param_3); *param_1 = uVar6; return param_1; } uVar6 = *param_3; uVar3 = param_3[1]; uVar4 = param_3[2]; uVar5 = param_3[3]; if (param_2 == puVar2) { *puVar2 = uVar6; puVar2[1] = uVar3; puVar2[2] = uVar4; puVar2[3] = uVar5; *(undefined8 *)(puVar2 + 4) = *(undefined8 *)(param_3 + 4); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x18; *param_1 = param_2; return param_1; } uVar1 = *(undefined8 *)(param_3 + 4); _Size = (int)puVar2 + (-0x18 - (int)param_2); *puVar2 = puVar2[-6]; puVar2[1] = puVar2[-5]; puVar2[2] = puVar2[-4]; puVar2[3] = puVar2[-3]; *(undefined8 *)(puVar2 + 4) = *(undefined8 *)(puVar2 + -2); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x18; memmove((void *)((int)puVar2 - _Size),param_2,_Size); *param_2 = uVar6; param_2[1] = uVar3; param_2[2] = uVar4; param_2[3] = uVar5; *(undefined8 *)(param_2 + 4) = uVar1; *param_1 = param_2; return param_1; } //@@ 00a53f00 FUN_00a53f00 undefined4 * FUN_00a53f00(void *param_1,undefined4 *param_2) { undefined4 *puVar1; int iVar2; void *pvVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; void *_Dst; int *in_ECX; uint uVar8; uint uVar9; void *ptr; iVar2 = *in_ECX; iVar4 = (in_ECX[1] - *in_ECX) / 0x18; if (iVar4 == 0xaaaaaaa) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar9 = (in_ECX[2] - *in_ECX) / 0x18; if (0xaaaaaaa - (uVar9 >> 1) < uVar9) { uVar8 = 0xaaaaaaa; } else { uVar9 = (uVar9 >> 1) + uVar9; uVar8 = iVar4 + 1U; if (iVar4 + 1U <= uVar9) { uVar8 = uVar9; } if (0xaaaaaaa < uVar8) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar8 * 0x18); puVar1 = (undefined4 *)((int)_Dst + (((int)param_1 - iVar2) / 0x18) * 0x18); uVar5 = param_2[1]; uVar6 = param_2[2]; uVar7 = param_2[3]; *puVar1 = *param_2; puVar1[1] = uVar5; puVar1[2] = uVar6; puVar1[3] = uVar7; *(undefined8 *)(puVar1 + 4) = *(undefined8 *)(param_2 + 4); pvVar3 = (void *)*in_ECX; if (param_1 == (void *)in_ECX[1]) { memmove(_Dst,pvVar3,in_ECX[1] - (int)pvVar3); } else { memmove(_Dst,pvVar3,(int)param_1 - (int)pvVar3); memmove(puVar1 + 6,param_1,in_ECX[1] - (int)param_1); } pvVar3 = (void *)*in_ECX; if (pvVar3 != (void *)0x0) { uVar9 = ((in_ECX[2] - (int)pvVar3) / 0x18) * 0x18; ptr = pvVar3; if (0xfff < uVar9) { ptr = *(void **)((int)pvVar3 + -4); uVar9 = uVar9 + 0x23; if (0x1f < (uint)((int)pvVar3 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar9); } *in_ECX = (int)_Dst; in_ECX[1] = (int)((int)_Dst + (iVar4 + 1) * 0x18); in_ECX[2] = (int)(uVar8 * 0x18 + (int)_Dst); return puVar1; } //@@ 00a54080 FUN_00a54080 void FUN_00a54080(byte param_1) { void *in_ECX; FUN_00a540b0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x188); } return; } //@@ 00a540b0 FUN_00a540b0 void FUN_00a540b0(void) { undefined4 *in_ECX; *in_ECX = KAGE::Network::MultiplayerManager::vftable; in_ECX[0x5d] = CCallbackImpl<24>::vftable; if ((*(byte *)(in_ECX + 0x5e) & 1) != 0) { SteamAPI_UnregisterCallback(in_ECX + 0x5d); } in_ECX[0x58] = CCallbackImpl<16>::vftable; if ((*(byte *)(in_ECX + 0x59) & 1) != 0) { SteamAPI_UnregisterCallback(in_ECX + 0x58); } in_ECX[0x50] = CCallResult::vftable; if (in_ECX[0x54] != 0 || in_ECX[0x55] != 0) { SteamAPI_UnregisterCallResult(in_ECX + 0x50,in_ECX[0x54],in_ECX[0x55]); in_ECX[0x54] = 0; in_ECX[0x55] = 0; } std::vector::_Tidy(); in_ECX[0x4a] = 0; in_ECX[0x4b] = 0; FUN_00a28d60(); return; } //@@ 00a54150 LobbySteam::find_by_id_string /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? stoull ("invalid stoull argument") of a string from a global table, returns a ConstLobby via LobbySteam::find_or_create; the ZHL ModManager::RenderCustomCharacterMenu match is only the MSVC EH prologue (real one is 008f8d00) */ undefined4 **** LobbySteam::find_by_id_string(undefined4 ****param_1) { byte bVar1; byte *text; int iVar2; int *piVar3; undefined4 extraout_EAX; byte *pbVar4; undefined4 ****ppppuVar5; undefined4 extraout_EDX; uint size; undefined4 ****ppppuVar6; undefined1 auStackY_d4 [128]; void *lobbyCtrl; ulonglong local_38; undefined4 ****local_30; undefined4 ****local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 ***local_8; local_8 = (undefined4 ***)0xffffffff; puStack_c = &LAB_00b1252d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_30 = param_1; iVar2 = FUN_00a7e400(); if (((iVar2 < 0) || (DAT_00c78d98 <= iVar2 + 1U)) || (text = *(byte **)(DAT_00c78d94 + (iVar2 + 1U) * 4), text == (byte *)0x0)) { *param_1 = (undefined4 ***)KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(); } else { local_1c = 0; local_18 = 0xf; local_2c[0] = (undefined4 ****)0x0; pbVar4 = text; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)local_2c,text,(int)pbVar4 - (int)(text + 1)); local_8 = (undefined4 ***)0x0; piVar3 = _errno(); ppppuVar5 = &local_30; ppppuVar6 = local_2c; if (0xf < local_18) { ppppuVar6 = local_2c[0]; } lobbyCtrl = (void *)0xa; *piVar3 = 0; local_38 = strtoull(ppppuVar6); if (ppppuVar6 == local_30) { lobbyCtrl = (void *)0xa54223; std::_Xinvalid_argument("invalid stoull argument"); local_38 = CONCAT44(extraout_EDX,extraout_EAX); } if (*piVar3 == 0x22) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("stoull argument out of range"); } KAGE::Network::Multiplayer::LobbySteam::find_or_create(auStackY_d4 + 0x84,&local_38); KAGE::Network::Multiplayer::ConstLobby::ConstLobby(param_1,ppppuVar5,lobbyCtrl); if (0xf < local_18) { size = local_18 + 1; ppppuVar5 = local_2c[0]; if (0xfff < size) { ppppuVar5 = (undefined4 ****)local_2c[0][-1]; size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ppppuVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppuVar5,size); } } ExceptionList = local_10; return param_1; } //@@ 00a542c0 KAGE::Network::MultiplayerManager::request_lobby_list /* DB: MultiplayerManager vtable slot 4 (vftable 00b9ebb0); dynamic_cast to ServiceLocalhost -> ServiceLocalhost::request_lobby_list 00a74a40, else ISteamMatchmaking AddRequestLobbyListResultCountFilter(+0x28, "Steam has a maximum of 50 lobby results"), FilterSlotsAvailable(+0x20), DistanceFilter(+0x24), "String filter value index out of bounds"; stores result callback/ctx at +0x128/+0x12c; callers Menu_OnlineLobbyList right after Multiplayer::set_service_provider prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall KAGE::Network::MultiplayerManager::request_lobby_list (void *this,void *filters,void *callback,void *userData) { int iVar1; int *piVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; code *pcVar7; code *pcVar8; undefined4 *puVar9; uint uVar10; undefined8 uVar11; void *pvVar12; undefined **ppuVar13; uint local_4c; undefined4 local_48; undefined4 local_44; void *local_40; int iStack_3c; int iStack_38; void *pvStack_34; int local_30; int local_2c; undefined4 *local_28; undefined4 *local_24; int local_20; void *local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1257d; local_10 = ExceptionList; ExceptionList = &local_10; local_1c = this; (**(code **)(PTR_vftable_00c5ab44 + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); iVar1 = DAT_00c79bf8; FUN_00a721b0(&DAT_00c79bf8,*(undefined4 *)(DAT_00c79bf8 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; DAT_00c79bfc = 0; local_8 = 0; (**(code **)(PTR_vftable_00c5ab44 + 0x10))(); local_8 = 0xffffffff; if ((*(int *)((int)this + 8) != 0) && (iVar1 = __RTDynamicCast(*(int *)((int)this + 8),0, &Multiplayer::ServiceBase::RTTI_Type_Descriptor, &Multiplayer::ServiceLocalhost::RTTI_Type_Descriptor,0), iVar1 != 0)) { __RTDynamicCast(*(undefined4 *)((int)this + 8),0,&Multiplayer::ServiceBase::RTTI_Type_Descriptor ,&Multiplayer::ServiceLocalhost::RTTI_Type_Descriptor,0); Multiplayer::ServiceLocalhost::request_lobby_list(filters,callback,userData); ExceptionList = local_10; return; } local_30 = 0; local_40 = (void *)0x0; iStack_3c = 0; iStack_38 = 0; pvStack_34 = (void *)0x0; local_2c = 0; local_8 = 1; FUN_00a539f0(); local_4c = *(uint *)filters; local_48 = *(undefined4 *)((int)filters + 4); local_44 = *(undefined4 *)((int)filters + 8); FUN_00a53be0((int)filters + 0xc); FUN_00a53be0((int)this + 0xd0); local_8 = 2; *(void **)((int)this + 0x128) = callback; *(void **)((int)this + 300) = userData; *(undefined4 *)((int)this + 0x130) = 0; puVar3 = *(undefined4 **)((int)this + 0x138); puVar9 = *(undefined4 **)((int)this + 0x134); if (puVar9 != puVar3) { do { (**(code **)*puVar9)(0); puVar9 = puVar9 + 3; } while (puVar9 != puVar3); puVar9 = *(undefined4 **)((int)this + 0x134); } pcVar8 = SteamInternal_ContextInit_exref; ppuVar13 = &PTR_FUN_00c5c504; *(undefined4 **)((int)this + 0x138) = puVar9; pvVar12 = (void *)0xa5444e; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (*piVar2 != 0) { uVar10 = local_4c; if (0x32 < local_4c) { KAGE_LogMessage(4,(byte *) "Steam has a maximum of 50 lobby results, the requested amount \'(%d)\' is above that value so results will be truncated" ); uVar10 = 0x32; } puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); (**(code **)(*(int *)*puVar3 + 0x28))(uVar10); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); (**(code **)(*(int *)*puVar3 + 0x20))(local_48); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); switch(local_44) { case 0: uVar4 = 0; break; default: uVar4 = 1; break; case 2: uVar4 = 2; break; case 3: uVar4 = 3; } (**(code **)(*(int *)*puVar3 + 0x24))(uVar4); uVar10 = 0; iVar1 = iStack_3c - (int)local_40 >> 0x1f; iVar6 = (iStack_3c - (int)local_40) / 0x18 + iVar1; if (iVar6 != iVar1) { filters = (void *)0x0; if (iVar6 != iVar1) goto LAB_00a54512; KAGE_LogMessage(0x10,(byte *)"String filter value index out of bounds\n"); while( true ) { uVar10 = uVar10 + 1; filters = (void *)((int)filters + 0x18); if ((uint)((iStack_3c - (int)local_40) / 0x18) <= uVar10) break; LAB_00a54512: local_18 = *(undefined4 *)((int)filters + (int)local_40); local_14 = *(undefined4 *)((int)filters + 8 + (int)local_40); iVar1 = *(int *)((int)filters + 0x10 + (int)local_40); if (iVar1 == 6) { KAGE_LogMessage(0x10,(byte *) "Steam does not provide an API for BestMatch using string values\n"); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pcVar7 = *(code **)(*(int *)*puVar3 + 0x14); switchD_00a545d1_caseD_2: uVar4 = 0; } else { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); pcVar7 = *(code **)(*(int *)*puVar3 + 0x14); switch(iVar1) { case 0: uVar4 = 0xffffffff; break; case 1: uVar4 = 0xfffffffe; break; default: goto switchD_00a545d1_caseD_2; case 3: uVar4 = 2; break; case 4: uVar4 = 1; break; case 5: uVar4 = 3; } } (*pcVar7)(local_18,local_14,uVar4); } } uVar10 = 0; iVar1 = local_30 - (int)pvStack_34 >> 0x1f; iVar6 = (local_30 - (int)pvStack_34) / 0x18 + iVar1; if (iVar6 != iVar1) { filters = (void *)0x0; if (iVar6 != iVar1) goto LAB_00a54608; KAGE_LogMessage(0x10,(byte *)"Number filter value index out of bounds\n"); while( true ) { uVar10 = uVar10 + 1; filters = (void *)((int)filters + 0x18); if ((uint)((local_30 - (int)pvStack_34) / 0x18) <= uVar10) break; LAB_00a54608: local_14 = *(undefined4 *)((int)filters + 8 + (int)pvStack_34); uVar4 = *(undefined4 *)((int)filters + (int)pvStack_34); iVar1 = *(int *)((int)filters + 0x10 + (int)pvStack_34); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); if (iVar1 == 6) { (**(code **)(*(int *)*puVar3 + 0x1c))(uVar4,local_14); } else { switch(iVar1) { case 0: uVar5 = 0xffffffff; break; case 1: uVar5 = 0xfffffffe; break; default: uVar5 = 0; break; case 3: uVar5 = 2; break; case 4: uVar5 = 1; break; case 5: uVar5 = 3; } (**(code **)(*(int *)*puVar3 + 0x18))(uVar4,local_14,uVar5); } } pcVar8 = SteamInternal_ContextInit_exref; } this = local_1c; *(int *)((int)local_1c + 0x130) = *(int *)((int)local_1c + 0x130) + 1; puVar3 = (undefined4 *)(*pcVar8)(&PTR_FUN_00c5c504); uVar11 = (**(code **)(*(int *)*puVar3 + 0x10))(); ppuVar13 = (undefined **)((int)this + 0x140); pvVar12 = this; FUN_00a55660(uVar11,this,ppuVar13); } *(int *)((int)this + 0x130) = *(int *)((int)this + 0x130) + 1; eos_lobby_search_find(&local_4c,pvVar12,ppuVar13); if (*(int *)((int)this + 0x130) == 0) { *(undefined4 *)((int)this + 0x128) = 0; *(undefined4 *)((int)this + 300) = 0; local_28 = (undefined4 *)0x0; local_24 = (undefined4 *)0x0; local_20 = 0; local_8 = CONCAT31(local_8._1_3_,3); (*callback)(&local_28,userData); puVar9 = local_24; puVar3 = local_28; if (local_28 != (undefined4 *)0x0) { for (; puVar3 != puVar9; puVar3 = puVar3 + 3) { (**(code **)*puVar3)(0); } uVar10 = ((local_20 - (int)local_28) / 0xc) * 0xc; puVar3 = local_28; if (0xfff < uVar10) { puVar3 = (undefined4 *)local_28[-1]; uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_28 + (-4 - (int)puVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar3,uVar10); } } FUN_00a539f0(); if (pvStack_34 != (void *)0x0) { uVar10 = ((local_2c - (int)pvStack_34) / 0x18) * 0x18; pvVar12 = pvStack_34; if (0xfff < uVar10) { pvVar12 = *(void **)((int)pvStack_34 + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)pvStack_34 + (-4 - (int)pvVar12))) goto LAB_00a54828; } operator_delete(pvVar12,uVar10); pvStack_34 = (void *)0x0; local_30 = 0; local_2c = 0; } if (local_40 != (void *)0x0) { uVar10 = ((iStack_38 - (int)local_40) / 0x18) * 0x18; pvVar12 = local_40; if (0xfff < uVar10) { pvVar12 = *(void **)((int)local_40 + -4); uVar10 = uVar10 + 0x23; if (0x1f < (uint)((int)local_40 + (-4 - (int)pvVar12))) { LAB_00a54828: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar10); } ExceptionList = local_10; return; } //@@ 00a54890 KAGE::Network::MultiplayerManager::invite_user_to_lobby /* DB: slot 5 of the KAGE::Network::MultiplayerManager vtable (was Multiplayer::invite_user_to_lobby) */ undefined1 KAGE::Network::MultiplayerManager::invite_user_to_lobby(int param_1) { char cVar1; undefined1 uVar2; uint uVar3; int iVar4; undefined4 *puVar5; int in_ECX; undefined4 uVar6; uint uVar7; undefined4 uVar8; int iVar9; int *local_34; int *local_30; undefined8 local_2c; int *local_24; code *local_1c; int *local_18; char local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b125f7; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar7 = 0; local_18 = (int *)0x0; iVar4 = *(int *)(param_1 + 4); if ((iVar4 != 0) && (*(int *)(iVar4 + 8) != 0 || *(int *)(iVar4 + 0xc) != 0)) { local_34 = (int *)0x0; local_30 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_34,(void *)(in_ECX + 0x24)); local_8 = 1; uVar7 = 0xd; local_18 = (int *)0xd; if ((local_34 != (int *)0x0) && (cVar1 = (**(code **)(*local_34 + 0xc))(), cVar1 != '\0')) { local_2c = 0xb9c1bc; local_24 = (int *)0x0; local_8 = 2; std::shared_ptr::assign((void *)((int)&local_2c + 4),(void *)(in_ECX + 0x24)); local_2c = CONCAT44(local_2c._4_4_,Multiplayer::Lobby::vftable); local_8 = 3; uVar7 = 0x3f; local_18 = (int *)0x3f; if (local_2c._4_4_ != 0) { iVar4 = __RTDynamicCast(local_2c._4_4_,0,&Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &Multiplayer::LobbySteam::RTTI_Type_Descriptor,0); local_11 = '\x01'; if (iVar4 != 0) goto LAB_00a54982; } } } local_11 = '\0'; LAB_00a54982: if ((uVar7 & 2) != 0) { uVar7 = uVar7 & 0xfffffffd; local_2c = CONCAT44(local_2c._4_4_,Multiplayer::ConstLobby::vftable); local_8 = 4; local_18 = (int *)uVar7; if (((local_24 != (int *)0x0) && (cVar1 = (**(code **)(*local_24 + 0xc))(uVar3), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)((int)&local_2c + 4); } } if ((((uVar7 & 1) != 0) && (local_8 = 5, local_30 != (int *)0x0)) && ((cVar1 = (**(code **)(*local_30 + 0xc))(), cVar1 != '\0' && (g_lobbyReleaseFn != (void *)0x0)) )) { (*g_lobbyReleaseFn)(&local_34); } local_8 = 0xffffffff; if (local_11 == '\0') { ExceptionList = local_10; return 0; } puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504); local_18 = (int *)*puVar5; local_34 = (int *)0x0; local_30 = (int *)0x0; local_1c = *(code **)(*local_18 + 0x40); local_8 = 6; std::shared_ptr::assign(&local_34,(void *)(in_ECX + 0x24)); local_8 = 7; iVar4 = *(int *)(param_1 + 4); if (iVar4 == 0) { local_2c = 0; local_2c._4_4_ = 0; local_2c._0_4_ = 0; uVar6 = local_2c._4_4_; uVar8 = (int)local_2c; } else { uVar6 = *(undefined4 *)(iVar4 + 0xc); uVar8 = *(undefined4 *)(iVar4 + 8); } if (local_34 == (int *)0x0) { local_2c = 0; local_2c._4_4_ = 0; local_2c._0_4_ = 0; iVar4 = (int)local_2c; iVar9 = local_2c._4_4_; } else { iVar4 = local_34[2]; iVar9 = local_34[3]; } FUN_00a238e0(uVar8,uVar6); FUN_00a238e0(iVar4,iVar9); uVar2 = (*local_1c)(); local_8 = 8; if (((local_30 != (int *)0x0) && (cVar1 = (**(code **)(*local_30 + 0xc))(), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_34); } ExceptionList = local_10; return uVar2; } //@@ 00a54b20 FUN_00a54b20 void FUN_00a54b20(uint *param_1) { undefined4 *puVar1; char cVar2; undefined4 *puVar3; void *pvVar4; uint uVar5; void *pvVar6; undefined1 auStackY_d4 [128]; undefined1 *lobbyPtr; undefined **local_3c [2]; int *local_34; undefined4 *local_30; undefined4 *local_2c; undefined4 *local_28; undefined1 local_24 [8]; undefined4 local_1c; undefined4 local_18; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined3 uStack_7; puStack_c = &LAB_00b12640; local_10 = ExceptionList; ExceptionList = &local_10; local_30 = (undefined4 *)0x0; local_2c = (undefined4 *)0x0; local_28 = (undefined4 *)0x0; local_8 = 0; uStack_7 = 0; uVar5 = 0; if (*param_1 != 0) { if (0x15555555 < *param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_00a55470(); uVar5 = *param_1; } pvVar6 = (void *)0x0; if (uVar5 != 0) { do { puVar3 = (undefined4 *)SteamInternal_ContextInit(); lobbyPtr = local_24; pvVar4 = pvVar6; puVar3 = (undefined4 *)(**(code **)(*(int *)*puVar3 + 0x30))(); local_1c = *puVar3; local_18 = puVar3[1]; KAGE::Network::Multiplayer::LobbySteam::find_or_create (auStackY_d4 + 0x80,(ulonglong *)&local_1c); pvVar4 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(local_3c,lobbyPtr,pvVar4); _local_8 = CONCAT31(uStack_7,1); if (local_2c == local_28) { std::vector::_Emplace_reallocate(); } else { *local_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_2c[1] = 0; local_2c[2] = 0; _local_8 = CONCAT31(uStack_7,2); std::shared_ptr::assign(local_2c + 1,(void *)((int)pvVar4 + 4)); local_2c = local_2c + 3; } local_3c[0] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 3; if (((local_34 != (int *)0x0) && (cVar2 = (**(code **)(*local_34 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } pvVar6 = (void *)((int)pvVar6 + 1); local_8 = 0; } while (pvVar6 < (void *)*param_1); } FUN_00a54d00(); puVar1 = local_2c; puVar3 = local_30; if (local_30 != (undefined4 *)0x0) { for (; puVar3 != puVar1; puVar3 = puVar3 + 3) { (**(code **)*puVar3)(); } uVar5 = (((int)local_28 - (int)local_30) / 0xc) * 0xc; puVar3 = local_30; if (0xfff < uVar5) { puVar3 = (undefined4 *)local_30[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_30 + (-4 - (int)puVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar3,uVar5); } ExceptionList = local_10; return; } //@@ 00a54ce0 FUN_00a54ce0 void FUN_00a54ce0(undefined4 param_1) { FUN_00a54d00(param_1); return; } //@@ 00a54d00 FUN_00a54d00 void FUN_00a54d00(int *param_1) { int *piVar1; int *piVar2; undefined4 *puVar3; int iVar4; uint uVar5; int in_ECX; int iVar6; undefined4 *puVar7; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12670; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x134); local_14 = 0; iVar6 = *param_1; iVar4 = param_1[1] - iVar6 >> 0x1f; if ((param_1[1] - iVar6) / 0xc + iVar4 != iVar4) { local_18 = 0; do { puVar3 = *(undefined4 **)(in_ECX + 0x138); if (puVar3 == *(undefined4 **)(in_ECX + 0x13c)) { std::vector::_Emplace_reallocate (puVar3,local_18 + iVar6); } else { *puVar3 = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar3[1] = 0; puVar3[2] = 0; local_8 = 0; std::shared_ptr::assign(puVar3 + 1,(void *)(local_18 + iVar6 + 4)); local_8 = 0xffffffff; *(int *)(in_ECX + 0x138) = *(int *)(in_ECX + 0x138) + 0xc; } local_14 = local_14 + 1; local_18 = local_18 + 0xc; iVar6 = *param_1; } while (local_14 < (uint)((param_1[1] - iVar6) / 0xc)); } piVar2 = (int *)(in_ECX + 0x130); *piVar2 = *piVar2 + -1; if ((*piVar2 == 0) && (*(code **)(in_ECX + 0x128) != (code *)0x0)) { (**(code **)(in_ECX + 0x128))(piVar1,*(undefined4 *)(in_ECX + 300),uVar5); puVar3 = *(undefined4 **)(in_ECX + 0x138); puVar7 = (undefined4 *)*piVar1; if (puVar7 != puVar3) { do { (**(code **)*puVar7)(0); puVar7 = puVar7 + 3; } while (puVar7 != puVar3); puVar7 = (undefined4 *)*piVar1; } *(undefined4 **)(in_ECX + 0x138) = puVar7; *(undefined4 *)(in_ECX + 0x128) = 0; *(undefined4 *)(in_ECX + 300) = 0; } ExceptionList = local_10; return; } //@@ 00a54e50 FUN_00a54e50 void FUN_00a54e50(undefined4 *param_1) { char cVar1; uint uVar2; undefined4 *puVar3; void *this; undefined1 local_20 [4]; int *local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1269d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; local_18 = *param_1; local_14 = param_1[1]; puVar3 = KAGE::Network::Multiplayer::LobbySteam::find_or_create(local_20,(ulonglong *)&local_18); local_8 = 0; this = (void *)__RTDynamicCast(*puVar3,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbySteam::RTTI_Type_Descriptor,0, uVar2); KAGE::Network::Multiplayer::LobbySteam::request_lobby_data(this,FUN_00a55110,(void *)0x0); local_8 = 1; if (local_1c != (int *)0x0) { cVar1 = (**(code **)(*local_1c + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_20); } } ExceptionList = local_10; return; } //@@ 00a54f00 KAGE::Network::MultiplayerManager::on_lobby_data_update /* DB: Steam CCallback static init FUN_00406850: obj 0xc79a50 (MultiplayerManager), func 0xa54f00, callback id 0x1f9=505=LobbyDataUpdate_t; lobby==member -> lobby data, else member data; Lobby::refresh_members on LobbySteam */ void KAGE::Network::MultiplayerManager::on_lobby_data_update(uint *param_1) { bool bVar1; char cVar2; uint uVar3; undefined8 *puVar4; uint uVar5; void *this; uint uVar6; undefined **local_24; int local_20; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b126e5; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar5 = *param_1; uVar6 = param_1[1]; if ((uVar5 == param_1[2]) && (uVar6 == param_1[3])) { FUN_00a53660(&local_24,param_1); if ((((*(char *)((int)local_1c + 0xd) == '\0') && (*(uint *)((int)local_1c + 0x14) <= uVar6)) && ((*(uint *)((int)local_1c + 0x14) < uVar6 || (*(uint *)((int)local_1c + 0x10) <= uVar5)))) && (local_1c != (int *)DAT_00c79a44)) { puVar4 = (undefined8 *)FUN_00a533d0(param_1); local_18 = *puVar4; local_8 = 0; if (*(code **)puVar4 != (code *)0x0) { (**(code **)puVar4)((-(uint)((char)param_1[4] != '\0') & 0xfffffff0) + 0x10,param_1, *(undefined4 *)((int)puVar4 + 4),uVar3); } FUN_00a551c0(param_1); ExceptionList = local_10; return; } } else { local_24 = Multiplayer::ConstLobby::vftable; local_20 = 0; local_1c = (int *)0x0; local_8 = 1; std::shared_ptr::assign(&local_20,&g_multiplayerLobbyPtr); if (local_20 == 0) { local_18 = 0; local_18._4_4_ = 0; local_18._0_4_ = 0; uVar5 = local_18._4_4_; uVar6 = (uint)local_18; } else { uVar5 = *(uint *)(local_20 + 0xc); uVar6 = *(uint *)(local_20 + 8); } if ((uVar6 == *param_1) && (uVar5 == param_1[1])) { bVar1 = true; } else { bVar1 = false; } local_24 = Multiplayer::ConstLobby::vftable; local_8 = 2; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_20); } } if (bVar1) { local_24 = Multiplayer::ConstLobby::vftable; local_20 = 0; local_1c = (int *)0x0; local_8 = 3; std::shared_ptr::assign(&local_20,&g_multiplayerLobbyPtr); local_24 = Multiplayer::Lobby::vftable; local_8 = 4; this = (void *)0x0; if (local_20 != 0) { this = (void *)__RTDynamicCast(local_20,0,&Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &Multiplayer::LobbySteam::RTTI_Type_Descriptor,0); } Lobby::refresh_members(this); local_24 = Multiplayer::ConstLobby::vftable; local_8 = 5; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_20); } } } } ExceptionList = local_10; return; } //@@ 00a55110 FUN_00a55110 void FUN_00a55110(undefined4 param_1,undefined4 param_2) { char cVar1; uint uVar2; undefined4 uVar3; int *piVar4; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1271d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; uVar3 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(param_2); local_8 = 0; piVar4 = (int *)*DAT_00c79b60; if (piVar4 != DAT_00c79b60) { do { (*(code *)piVar4[2])(uVar3,piVar4[3],uVar2); piVar4 = (int *)*piVar4; } while (piVar4 != DAT_00c79b60); } local_8 = 1; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_18); } } ExceptionList = local_10; return; } //@@ 00a551c0 FUN_00a551c0 int FUN_00a551c0(uint *param_1) { char cVar1; uint uVar2; int *piVar3; int *piVar4; int *piVar5; int *piVar6; void *ptr; int iVar7; int *node; int *piVar8; piVar3 = DAT_00c79a44; node = DAT_00c79a44; piVar8 = DAT_00c79a44; if (*(char *)(DAT_00c79a44[1] + 0xd) == '\0') { piVar5 = (int *)DAT_00c79a44[1]; do { uVar2 = piVar5[5]; if ((param_1[1] < uVar2) || ((param_1[1] <= uVar2 && (*param_1 <= (uint)piVar5[4])))) { if (*(char *)((int)piVar8 + 0xd) != '\0') { if ((param_1[1] <= uVar2) && ((param_1[1] < uVar2 || (*param_1 < (uint)piVar5[4])))) { piVar8 = piVar5; } } piVar6 = (int *)*piVar5; node = piVar5; } else { piVar6 = (int *)piVar5[2]; } piVar5 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } piVar5 = DAT_00c79a44 + 1; if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar5 = piVar8; } if (*(char *)(*piVar5 + 0xd) == '\0') { piVar5 = (int *)*piVar5; do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar6 = (int *)piVar5[2]; } else { piVar6 = (int *)*piVar5; piVar8 = piVar5; } piVar5 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } iVar7 = 0; piVar5 = node; while (piVar5 != piVar8) { piVar6 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar6 + 0xd) == '\0') { cVar1 = *(char *)(*piVar6 + 0xd); piVar5 = piVar6; piVar6 = (int *)*piVar6; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar6 + 0xd); piVar5 = piVar6; piVar6 = (int *)*piVar6; } } else { cVar1 = *(char *)(piVar5[1] + 0xd); piVar4 = (int *)piVar5[1]; piVar6 = piVar5; while ((piVar5 = piVar4, cVar1 == '\0' && (piVar6 == (int *)piVar5[2]))) { cVar1 = *(char *)(piVar5[1] + 0xd); piVar4 = (int *)piVar5[1]; piVar6 = piVar5; } } } if ((node == (int *)*DAT_00c79a44) && (*(char *)((int)piVar8 + 0xd) != '\0')) { param_1 = (uint *)node; FUN_00a536c0(&DAT_00c79a44,DAT_00c79a44[1]); piVar3[1] = (int)piVar3; *piVar3 = (int)piVar3; piVar3[2] = (int)piVar3; DAT_00c79a48 = 0; return iVar7; } while (node != piVar8) { param_1 = (uint *)node; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(&DAT_00c79a44,node); *(undefined4 *)((int)ptr + 0x18) = 0; *(undefined4 *)((int)ptr + 0x1c) = 0; operator_delete(ptr,0x20); node = (int *)param_1; } return iVar7; } //@@ 00a55330 std::vector::push_back /* DB: 12-byte elements: in-place ConstLobby copy (vftable + shared_ptr assign from param+4) or _Emplace_reallocate FUN_00a556c0; netplay_lobby_host_handle_message */ void std::vector::push_back(int param_1) { undefined4 *puVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12750; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { vector::_Emplace_reallocate(puVar1,param_1); ExceptionList = local_10; return; } *puVar1 = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar1[1] = 0; puVar1[2] = 0; local_8 = 0; shared_ptr::assign(puVar1 + 1,(void *)(param_1 + 4)); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0xc; ExceptionList = local_10; return; } //@@ 00a553c0 std::vector::_Tidy /* DB: ? vector of 12-byte polymorphic elements (vftable at +0, deleting dtor slot 0 called per element) then frees storage; called from MultiplayerManager dtor (00a540b0, next to CCallResult) and ServiceLocalhost dtor (00a73aa0); ConstLobby is 12 bytes (vftable, handle, impl ptr) in those dtors */ void std::vector::_Tidy(void) { uint size; int *in_ECX; undefined4 *puVar1; undefined4 *puVar2; puVar1 = (undefined4 *)*in_ECX; if (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)in_ECX[1]; if (puVar1 != puVar2) { do { (**(code **)*puVar1)(0); puVar1 = puVar1 + 3; } while (puVar1 != puVar2); puVar1 = (undefined4 *)*in_ECX; } size = ((in_ECX[2] - (int)puVar1) / 0xc) * 0xc; puVar2 = puVar1; if (0xfff < size) { puVar2 = (undefined4 *)puVar1[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar1 + (-4 - (int)puVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00a55440 FUN_00a55440 void FUN_00a55440(undefined4 *param_1,undefined4 *param_2) { for (; param_1 != param_2; param_1 = param_1 + 3) { (**(code **)*param_1)(0); } return; } //@@ 00a55470 FUN_00a55470 void FUN_00a55470(uint param_1) { int iVar1; int iVar2; void *pvVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12770; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x15555555 < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar3 = std::_Allocate(param_1 * 0xc); local_8 = 0; FUN_00a555c0(*in_ECX,in_ECX[1],pvVar3); FUN_00a55530(pvVar3,(iVar1 - iVar2) / 0xc,param_1); ExceptionList = local_10; return; } //@@ 00a55504 Catch_All@00a55504 void Catch_All_00a55504(void) { int unaff_EBP; deallocate(*(void **)(unaff_EBP + -0x18),*(uint *)(unaff_EBP + 8)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00a55530 FUN_00a55530 void FUN_00a55530(int param_1,int param_2,int param_3) { uint size; int *in_ECX; undefined4 *puVar1; undefined4 *puVar2; puVar1 = (undefined4 *)*in_ECX; if (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)in_ECX[1]; if (puVar1 != puVar2) { do { (**(code **)*puVar1)(0); puVar1 = puVar1 + 3; } while (puVar1 != puVar2); puVar1 = (undefined4 *)*in_ECX; } size = ((in_ECX[2] - (int)puVar1) / 0xc) * 0xc; puVar2 = puVar1; if (0xfff < size) { puVar2 = (undefined4 *)puVar1[-1]; size = size + 0x23; if (0x1f < (uint)((int)puVar1 + (-4 - (int)puVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,size); } *in_ECX = param_1; in_ECX[1] = param_1 + param_2 * 0xc; in_ECX[2] = param_1 + param_3 * 0xc; return; } //@@ 00a555c0 FUN_00a555c0 void FUN_00a555c0(int param_1,int param_2,undefined4 *param_3) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined3 uStack_7; puStack_c = &LAB_00b127a8; uStack_7 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 0xc) { *param_3 = KAGE::Network::Multiplayer::ConstLobby::vftable; param_3[1] = 0; param_3[2] = 0; local_8 = 1; std::shared_ptr::assign(param_3 + 1,(void *)(param_1 + 4)); param_3 = param_3 + 3; ppvVar1 = ExceptionList; } ExceptionList = local_10; return; } //@@ 00a55660 FUN_00a55660 void FUN_00a55660(int param_1,int param_2,undefined4 param_3) { int in_ECX; if (*(int *)(in_ECX + 0x10) != 0 || *(int *)(in_ECX + 0x14) != 0) { SteamAPI_UnregisterCallResult(); } *(undefined4 *)(in_ECX + 0x18) = param_3; *(int *)(in_ECX + 0x10) = param_1; *(int *)(in_ECX + 0x14) = param_2; *(code **)(in_ECX + 0x1c) = FUN_00a54b20; if (param_1 != 0 || param_2 != 0) { SteamAPI_RegisterCallResult(); } return; } //@@ 00a556c0 std::vector::_Emplace_reallocate /* DB: growth/max 0x15555555 by /0xc, element = ConstLobby vftable + shared_ptr assign; callers std::vector::push_back and 3 others */ undefined4 * std::vector::_Emplace_reallocate(int param_1,int param_2) { undefined4 *puVar1; uint uVar2; int iVar3; int iVar4; void *pvVar5; int *in_ECX; uint uVar6; void *local_10; undefined1 *puStack_c; uint local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b127e0; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *in_ECX; iVar4 = (in_ECX[1] - iVar3) / 0xc; if (iVar4 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = (in_ECX[2] - iVar3) / 0xc; if (0x15555555 - (uVar2 >> 1) < uVar2) { uVar6 = 0x15555555; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar6 = iVar4 + 1U; if (iVar4 + 1U <= uVar2) { uVar6 = uVar2; } if (0x15555555 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(uVar6 * 0xc); puVar1 = (undefined4 *)((int)pvVar5 + ((param_1 - iVar3) / 0xc) * 0xc); *puVar1 = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar1[1] = 0; puVar1[2] = 0; local_8 = 1; shared_ptr::assign(puVar1 + 1,(void *)(param_2 + 4)); local_8 = local_8 & 0xffffff00; if (param_1 == in_ECX[1]) { FUN_00a555c0(*in_ECX,in_ECX[1],pvVar5); } else { FUN_00a55910(*in_ECX,param_1,pvVar5); FUN_00a55910(param_1,in_ECX[1],puVar1 + 3); } FUN_00a55530(pvVar5,iVar4 + 1,uVar6); ExceptionList = local_10; return puVar1; } //@@ 00a5582b Catch_All@00a5582b void Catch_All_00a5582b(void) { int unaff_EBP; FUN_00a55440(*(undefined4 *)(unaff_EBP + -0x14),*(undefined4 *)(unaff_EBP + -0x1c)); deallocate(*(void **)(unaff_EBP + -0x28),*(uint *)(unaff_EBP + -0x20)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00a55860 FUN_00a55860 void FUN_00a55860(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<16>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } return; } //@@ 00a558a0 FUN_00a558a0 void FUN_00a558a0(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<24>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } return; } //@@ 00a558e0 FUN_00a558e0 void FUN_00a558e0(void) { undefined4 *puVar1; undefined4 *in_ECX; undefined4 *puVar2; puVar1 = (undefined4 *)in_ECX[1]; for (puVar2 = (undefined4 *)*in_ECX; puVar2 != puVar1; puVar2 = puVar2 + 3) { (**(code **)*puVar2)(0); } return; } //@@ 00a55910 FUN_00a55910 undefined4 * FUN_00a55910(int param_1,int param_2,undefined4 *param_3) { void **ppvVar1; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined3 uStack_7; puStack_c = &LAB_00b127a8; uStack_7 = 0; ppvVar1 = &local_10; local_10 = ExceptionList; for (; ExceptionList = ppvVar1, param_1 != param_2; param_1 = param_1 + 0xc) { *param_3 = KAGE::Network::Multiplayer::ConstLobby::vftable; param_3[1] = 0; param_3[2] = 0; local_8 = 1; std::shared_ptr::assign(param_3 + 1,(void *)(param_1 + 4)); param_3 = param_3 + 3; ppvVar1 = ExceptionList; } ExceptionList = local_10; return param_3; } //@@ 00a559b0 FUN_00a559b0 void FUN_00a559b0(void) { int in_ECX; /* WARNING: Could not recover jumptable at 0x00a559bc. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(in_ECX + 0x10))(); return; } //@@ 00a559c0 FUN_00a559c0 void FUN_00a559c0(undefined4 param_1) { int *in_ECX; (**(code **)(*in_ECX + 4))(param_1); return; } //@@ 00a559d0 FUN_00a559d0 void FUN_00a559d0(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<24>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a55a10 FUN_00a55a10 void FUN_00a55a10(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<16>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a55a50 FUN_00a55a50 void FUN_00a55a50(char *param_1,int param_2) { char cVar1; undefined4 *in_ECX; *in_ECX = KAGE::Util::String::CharacterIterator::vftable; in_ECX[1] = param_1; in_ECX[2] = param_1; if (param_2 != -1) { *in_ECX = KAGE::Util::String::CharacterIteratorUTF8::vftable; in_ECX[2] = param_1 + param_2; return; } cVar1 = *param_1; while (cVar1 != '\0') { param_1 = param_1 + 1; in_ECX[2] = param_1; cVar1 = *param_1; } *in_ECX = KAGE::Util::String::CharacterIteratorUTF8::vftable; return; } //@@ 00a55aa0 FUN_00a55aa0 undefined4 FUN_00a55aa0(void) { byte *pbVar1; int in_ECX; uint local_8; if (*(byte **)(in_ECX + 4) < *(byte **)(in_ECX + 8)) { local_8 = 0; pbVar1 = utf8_decode_next(*(byte **)(in_ECX + 4),&local_8,*(byte **)(in_ECX + 8)); *(byte **)(in_ECX + 4) = pbVar1; return local_8; } return 0; } //@@ 00a55ae0 FUN_00a55ae0 int FUN_00a55ae0(void) { char cVar1; char *pcVar2; int in_ECX; pcVar2 = *(char **)(in_ECX + 4); if (pcVar2 < *(char **)(in_ECX + 8)) { cVar1 = *pcVar2; *(char **)(in_ECX + 4) = pcVar2 + 1; return (int)cVar1; } return 0; } //@@ 00a55b00 FUN_00a55b00 void FUN_00a55b00(short *param_1,int param_2) { short sVar1; undefined4 *in_ECX; *in_ECX = KAGE::Util::String::CharacterIterator::vftable; in_ECX[1] = param_1; in_ECX[2] = param_1; if (param_2 != -1) { in_ECX[2] = param_1 + param_2; return; } sVar1 = *param_1; while (sVar1 != 0) { param_1 = param_1 + 1; in_ECX[2] = param_1; sVar1 = *param_1; } return; } //@@ 00a55b50 FUN_00a55b50 undefined2 FUN_00a55b50(void) { undefined2 uVar1; undefined2 *puVar2; int in_ECX; puVar2 = *(undefined2 **)(in_ECX + 4); if (puVar2 < *(undefined2 **)(in_ECX + 8)) { uVar1 = *puVar2; *(undefined2 **)(in_ECX + 4) = puVar2 + 1; return uVar1; } return 0; } //@@ 00a55b70 FormattedText::FormattedText /* DB: ? ctor from a single segment: zeroes flags and the segment vector (+4..+0xc), marks borrowed (bit0) and pushes the 12-byte segment param; OnlineChat::render */ void FormattedText::FormattedText(undefined1 *param_1) { undefined1 *puVar1; byte *in_ECX; undefined1 local_20 [4]; undefined4 local_1c; undefined2 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12810; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; local_8 = 0; local_20[0] = *param_1; local_1c = *(undefined4 *)(param_1 + 4); local_18 = *(undefined2 *)(param_1 + 8); *in_ECX = *in_ECX | 1; puVar1 = *(undefined1 **)(in_ECX + 8); if (puVar1 == *(undefined1 **)(in_ECX + 0xc)) { std::vector::_Emplace_reallocate(puVar1,local_20); } else { *puVar1 = local_20[0]; *(undefined4 *)(puVar1 + 4) = local_1c; *(undefined2 *)(puVar1 + 8) = local_18; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + 0xc; } ExceptionList = local_10; return; } //@@ 00a55c20 FUN_00a55c20 void FUN_00a55c20(void) { std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); return; } //@@ 00a55c40 FormattedText::set /* DB: ? clears the 12-byte segment vector (+4), parses the input (FUN_00a56350 with callback FUN_00a56750 and args), and when param_5 set deep-copies each segment buffer (flag bit0 cleared) else marks borrowed (bit0); same struct as 00a55e20; Font::measure_string, render_lobby_info prototype: db/protos.zhl, confirmed by RET 20 */ void __thiscall FormattedText::set(void *this,byte *text,void *measureContext,int maxLength,float scale, byte isCopySegments) { int *piVar1; int iVar2; void *_Dst; int iVar3; void *local_1c; float local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1283d; local_10 = ExceptionList; ExceptionList = &local_10; std::vector<12byte>::clear(__security_cookie ^ (int)register0x00000010 - 4U); local_1c = measureContext; local_18 = scale; piVar1 = (int *)((int)this + 4); local_8 = 0; parse(piVar1,FUN_00a56750,&local_1c); local_8 = 0xffffffff; if (isCopySegments == 0) { *(byte *)this = *(byte *)this | 1; ExceptionList = local_10; return; } _isCopySegments = 0; *(byte *)this = *(byte *)this & 0xfe; iVar3 = *(int *)((int)this + 8) - *piVar1; iVar2 = iVar3 >> 0x1f; if (iVar3 / 0xc + iVar2 != iVar2) { measureContext = (void *)0x0; do { iVar2 = *piVar1; _Dst = operator_new_tracked((uint)*(ushort *)((int)measureContext + iVar2 + 8)); memcpy(_Dst,*(void **)((int)measureContext + iVar2 + 4), (uint)*(ushort *)((int)measureContext + iVar2 + 8)); *(void **)((int)measureContext + iVar2 + 4) = _Dst; _isCopySegments = _isCopySegments + 1; measureContext = (void *)((int)measureContext + 0xc); } while (_isCopySegments < (uint)((*(int *)((int)this + 8) - *piVar1) / 0xc)); } ExceptionList = local_10; return; } //@@ 00a55d60 std::vector<12byte>::clear /* DB: stride 0xc */ void std::vector<12byte>::clear(void) { void *ptr; byte *in_ECX; int iVar1; int iVar2; int iVar3; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; iVar3 = *(int *)(in_ECX + 4); iVar2 = *(int *)(in_ECX + 8) - iVar3 >> 0x1f; iVar1 = (*(int *)(in_ECX + 8) - iVar3) / 0xc + iVar2; if ((iVar1 != iVar2) && ((*in_ECX & 1) == 0)) { local_14 = 0; if (iVar1 != iVar2) { iVar2 = 0; do { ptr = *(void **)(iVar2 + 4 + iVar3); if (ptr != (void *)0x0) { local_8 = 0; tracked_alloc(1,ptr,0); } local_14 = local_14 + 1; iVar3 = *(int *)(in_ECX + 4); iVar2 = iVar2 + 0xc; } while (local_14 < (uint)((*(int *)(in_ECX + 8) - iVar3) / 0xc)); } } *(int *)(in_ECX + 8) = iVar3; ExceptionList = local_10; return; } //@@ 00a55e20 FormattedText::operator_assign /* DB: ? copies flag byte and vector of 12-byte segments (+4), then when flag bit0 clear deep-copies each segment buffer (ptr +4, ushort len +8) with operator_new_tracked+memcpy; Font::measure_string, online_chat_text_input prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall FormattedText::operator_assign(void *this,void *other) { int *piVar1; void *_Dst; byte bVar2; int iVar3; int iVar4; int local_8; bVar2 = *(byte *)other; piVar1 = (int *)((int)this + 4); *(byte *)this = bVar2; if (piVar1 != (int *)((int)other + 4)) { std::vector<12byte>::assign(*(int *)((int)other + 4),*(undefined4 *)((int)other + 8),other); bVar2 = *(byte *)this; } if ((bVar2 & 1) == 0) { iVar3 = *(int *)((int)this + 8) - *piVar1; other = (void *)0x0; iVar4 = iVar3 >> 0x1f; if (iVar3 / 0xc + iVar4 != iVar4) { local_8 = 0; do { iVar4 = *piVar1 + local_8; _Dst = operator_new_tracked((uint)*(ushort *)(iVar4 + 8)); memcpy(_Dst,*(void **)(iVar4 + 4),(uint)*(ushort *)(iVar4 + 8)); *(void **)(iVar4 + 4) = _Dst; other = (void *)((int)other + 1); local_8 = local_8 + 0xc; } while (other < (void *)((*(int *)((int)this + 8) - *piVar1) / 0xc)); return this; } } return this; } //@@ 00a55ef0 FormattedText::split_lines /* DB: ? 8-bit twin of 00a56060: splits on "\n" and literal "\\n" (DAT_00b65584) into 12-byte segments; Font::measure_string */ void FormattedText::split_lines(void) { char *pcVar1; uint uVar2; undefined1 *puVar3; char cVar4; char *in_ECX; int iVar5; char *pcVar6; char cVar7; int in_EDX; char *pcVar8; char *pcVar9; char *pcVar10; undefined1 *puVar11; undefined1 local_24 [4]; char *local_20; short local_1c; char *local_18; int local_14; char *local_10; int local_c; char *local_8; iVar5 = 0; local_14 = 0; pcVar6 = in_ECX; if (*in_ECX != '\0') { do { pcVar6 = pcVar6 + 1; iVar5 = iVar5 + 1; } while (*pcVar6 != '\0'); local_14 = iVar5; } local_18 = in_ECX; local_c = in_EDX; do { cVar7 = *in_ECX; pcVar6 = in_ECX; local_20 = in_ECX; local_8 = in_ECX; if (cVar7 != '\0') { pcVar8 = in_ECX; cVar4 = cVar7; do { if (cVar4 == '\n') { pcVar9 = pcVar8; pcVar10 = pcVar8; local_10 = pcVar8; goto LAB_00a55f66; } cVar4 = pcVar8[1]; pcVar8 = pcVar8 + 1; } while (cVar4 != '\0'); } pcVar10 = (char *)0x0; local_10 = (char *)0x0; pcVar8 = (char *)0x0; pcVar9 = (char *)0x0; while (cVar7 != '\0') { LAB_00a55f66: uVar2 = 0; while (cVar7 == (&DAT_00b65584)[uVar2]) { uVar2 = uVar2 + 1; if (1 < uVar2) { uVar2 = (uint)(pcVar9 != (char *)0x0); if ((pcVar6 == (char *)0x0) || (pcVar9 <= pcVar6)) goto LAB_00a55fb8; uVar2 = 2; puVar11 = *(undefined1 **)(local_c + 8); puVar3 = *(undefined1 **)(local_c + 4); goto LAB_00a55fcb; } } pcVar1 = pcVar6 + 1; pcVar6 = pcVar6 + 1; cVar7 = *pcVar1; } if (pcVar8 == (char *)0x0) { pcVar10 = (char *)0x0; } uVar2 = (uint)(local_10 != (char *)0x0); pcVar9 = pcVar10; LAB_00a55fb8: pcVar6 = pcVar9; puVar11 = *(undefined1 **)(local_c + 8); puVar3 = *(undefined1 **)(local_c + 4); if (pcVar6 == (char *)0x0) { local_1c = (short)local_14 + ((short)local_18 - (short)in_ECX); local_24[0] = 0; if (puVar3 == puVar11) { std::vector::_Emplace_reallocate(puVar3,local_24); return; } *(char **)(puVar3 + 4) = in_ECX; *puVar3 = 0; *(short *)(puVar3 + 8) = local_1c; *(int *)(local_c + 4) = *(int *)(local_c + 4) + 0xc; return; } LAB_00a55fcb: local_1c = (short)pcVar6 - (short)in_ECX; local_24[0] = 0; if (puVar3 == puVar11) { std::vector::_Emplace_reallocate(puVar3,local_24); in_ECX = pcVar6 + uVar2; } else { *puVar3 = 0; *(char **)(puVar3 + 4) = in_ECX; *(short *)(puVar3 + 8) = local_1c; in_ECX = pcVar6 + uVar2; *(int *)(local_c + 4) = *(int *)(local_c + 4) + 0xc; } } while( true ); } //@@ 00a56060 FormattedText::split_lines_utf16 /* DB: ? splits a 16-bit string on newline separators (DAT_00b65584 "\n"/"\\n") into 12-byte segments {flags, ptr, ushort len} pushed onto the vector at EDX; Font::layout_glyphs */ void FormattedText::split_lines_utf16(void) { short *psVar1; short *in_ECX; int iVar2; uint uVar3; undefined1 *puVar4; short sVar5; short sVar6; int in_EDX; undefined1 *puVar7; short *psVar8; undefined1 local_2c [4]; short *local_28; undefined2 local_24; short *local_20; int local_1c; short *local_18; short *local_14; short *local_10; short *local_c; int local_8; iVar2 = 0; local_1c = 0; psVar1 = in_ECX; if (*in_ECX != 0) { do { psVar1 = psVar1 + 1; iVar2 = iVar2 + 1; } while (*psVar1 != 0); local_1c = iVar2; } local_20 = in_ECX; local_8 = in_EDX; do { sVar6 = *in_ECX; local_28 = in_ECX; local_c = in_ECX; if (sVar6 != 0) { local_10 = in_ECX; sVar5 = sVar6; do { if (sVar5 == 10) goto LAB_00a560e3; sVar5 = local_10[1]; local_10 = local_10 + 1; } while (sVar5 != 0); } local_10 = (short *)0x0; if (sVar6 != 0) { LAB_00a560e3: psVar1 = in_ECX; do { uVar3 = 0; while (sVar6 == (char)(&DAT_00b65584)[uVar3]) { uVar3 = uVar3 + 1; if (1 < uVar3) { uVar3 = (uint)(local_10 != (short *)0x0); psVar8 = local_10; if ((psVar1 == (short *)0x0) || (local_10 <= psVar1)) goto LAB_00a5614b; uVar3 = 2; puVar7 = *(undefined1 **)(local_8 + 8); puVar4 = *(undefined1 **)(local_8 + 4); goto LAB_00a56158; } } sVar6 = psVar1[1]; psVar1 = psVar1 + 1; } while (sVar6 != 0); } psVar8 = local_10; if (local_10 == (short *)0x0) { psVar8 = (short *)0x0; } uVar3 = (uint)(local_10 != (short *)0x0); LAB_00a5614b: psVar1 = psVar8; puVar7 = *(undefined1 **)(local_8 + 8); puVar4 = *(undefined1 **)(local_8 + 4); if (psVar1 == (short *)0x0) { local_2c[0] = 0; local_24 = (undefined2)((local_1c * 2 - (int)in_ECX) + (int)local_20 >> 1); if (puVar4 == puVar7) { local_18 = local_10; local_14 = local_10; std::vector::_Emplace_reallocate(puVar4,local_2c); return; } *(short **)(puVar4 + 4) = in_ECX; *puVar4 = 0; *(undefined2 *)(puVar4 + 8) = local_24; *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + 0xc; return; } LAB_00a56158: local_2c[0] = 0; local_24 = (undefined2)((int)psVar1 - (int)in_ECX >> 1); if (puVar4 == puVar7) { local_18 = local_10; local_14 = local_10; std::vector::_Emplace_reallocate(puVar4,local_2c); in_ECX = psVar1 + uVar3; } else { *(short **)(puVar4 + 4) = in_ECX; in_ECX = psVar1 + uVar3; *puVar4 = 0; *(undefined2 *)(puVar4 + 8) = local_24; *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + 0xc; } } while( true ); } //@@ 00a561f0 std::vector::_Emplace_reallocate /* DB: ? 12-byte element (byte,int,short copied), max 0x15555555, grows x1.5, _Xlen; only callers FormattedText::FormattedText/split_lines* (line records) */ undefined1 * std::vector::_Emplace_reallocate(int param_1,undefined1 *param_2) { undefined1 *puVar1; uint uVar2; int iVar3; int iVar4; void *pvVar5; int *in_ECX; uint uVar6; iVar3 = *in_ECX; iVar4 = (in_ECX[1] - iVar3) / 0xc; if (iVar4 == 0x15555555) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar2 = (in_ECX[2] - iVar3) / 0xc; if (0x15555555 - (uVar2 >> 1) < uVar2) { uVar6 = 0x15555555; } else { uVar2 = (uVar2 >> 1) + uVar2; uVar6 = iVar4 + 1U; if (iVar4 + 1U <= uVar2) { uVar6 = uVar2; } if (0x15555555 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pvVar5 = _Allocate(uVar6 * 0xc); puVar1 = (undefined1 *)((int)pvVar5 + ((param_1 - iVar3) / 0xc) * 0xc); *puVar1 = *param_2; *(undefined4 *)(puVar1 + 4) = *(undefined4 *)(param_2 + 4); *(undefined2 *)(puVar1 + 8) = *(undefined2 *)(param_2 + 8); if (param_1 == in_ECX[1]) { FUN_00a56d60(pvVar5,*in_ECX); } else { FUN_00a56300(*in_ECX,param_1,pvVar5); FUN_00a56300(param_1,in_ECX[1],puVar1 + 0xc); } FUN_00834fa0(pvVar5,iVar4 + 1,uVar6); return puVar1; } //@@ 00a56300 FUN_00a56300 undefined1 * FUN_00a56300(undefined2 *param_1,undefined2 *param_2,undefined1 *param_3) { undefined2 *puVar1; undefined2 *puVar2; undefined1 *puVar3; puVar3 = param_3; if (param_1 != param_2) { puVar2 = param_1 + 4; do { *puVar3 = *(undefined1 *)(puVar2 + -4); *(undefined4 *)(puVar3 + 4) = *(undefined4 *)(puVar2 + -2); puVar3 = puVar3 + 0xc; *(undefined2 *)(param_3 + (-0xc - (int)param_1) + (int)(puVar2 + 6)) = *puVar2; puVar1 = puVar2 + 2; puVar2 = puVar2 + 6; } while (puVar1 != param_2); } return puVar3; } //@@ 00a56350 FormattedText::parse /* DB: ? ECX=input string (strlen loop), (out, callback, arg); splits it into segments via FUN_00a561f0 and the callback; only caller FormattedText::set (DB note: "parses the input (FUN_00a56350 with callback FUN_00a56750)") */ void FormattedText::parse(int param_1,code *param_2,undefined4 param_3) { byte bVar1; byte *pbVar2; undefined1 *puVar3; qword qVar4; void *pvVar5; uint uVar6; char cVar7; byte *in_ECX; uint in_EDX; qword *pqVar8; byte *pbVar9; uint uVar10; byte *pbVar11; int iVar12; byte *pbVar13; byte local_50 [4]; byte *local_4c; short local_48; undefined1 local_44 [4]; byte *local_40; short local_3c; int local_38; uint local_34; uint local_30; byte *local_2c; void *local_28; uint local_24; uint local_20; byte *local_1c; byte *local_18; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1286d; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; iVar12 = 0; bVar1 = *in_ECX; pbVar13 = in_ECX; while (bVar1 != 0) { pbVar13 = pbVar13 + 1; iVar12 = iVar12 + 1; bVar1 = *pbVar13; } local_2c = in_ECX + iVar12; local_30 = 0x40; local_24 = 0; local_20 = in_EDX; local_1c = in_ECX; local_18 = in_ECX; local_38 = (*param_2)(&DAT_00b656ec,1,param_3,__security_cookie ^ (uint)(local_44 + 0x40)); local_28 = operator_new_tracked(0x40); if (in_ECX < local_2c) { do { pbVar13 = local_18; bVar1 = *in_ECX; uVar10 = (uint)bVar1 << 8; local_11 = 0; if (bVar1 != 0) { uVar10 = (uint)CONCAT11(bVar1,bVar1); pbVar9 = in_ECX; do { if ((char)uVar10 == ' ') goto LAB_00a56414; pbVar11 = pbVar9 + 1; uVar10 = CONCAT31((int3)(uVar10 >> 8),*pbVar11); pbVar9 = pbVar9 + 1; } while (*pbVar11 != 0); } pbVar9 = (byte *)0x0; if ((char)(uVar10 >> 8) != '\0') { LAB_00a56414: uVar10 = CONCAT31((int3)(uVar10 >> 8),(char)(uVar10 >> 8)); pbVar11 = in_ECX; do { if ((char)uVar10 == '\n') goto LAB_00a56436; pbVar2 = pbVar11 + 1; uVar10 = CONCAT31((int3)(uVar10 >> 8),*pbVar2); pbVar11 = pbVar11 + 1; } while (*pbVar2 != 0); } pbVar11 = (byte *)0x0; if ((char)(uVar10 >> 8) != '\0') { LAB_00a56436: uVar10 = CONCAT31((int3)(uVar10 >> 8),(char)(uVar10 >> 8)); do { uVar6 = 0; while ((char)uVar10 == (&DAT_00b65584)[uVar6]) { uVar6 = uVar6 + 1; if (1 < uVar6) goto LAB_00a5645c; } pbVar2 = in_ECX + 1; uVar10 = CONCAT31((int3)(uVar10 >> 8),*pbVar2); in_ECX = in_ECX + 1; } while (*pbVar2 != 0); } in_ECX = (byte *)0x0; LAB_00a5645c: if ((pbVar11 != (byte *)0x0) && (pbVar11 < pbVar9)) { pbVar9 = pbVar11; } if ((in_ECX != (byte *)0x0) && (in_ECX < pbVar9)) { pbVar9 = in_ECX; } pbVar11 = local_2c; if (pbVar9 != (byte *)0x0) { pbVar11 = pbVar9; } cVar7 = (char)(uVar10 >> 8); if (cVar7 == '\n') { uVar10 = 1; local_11 = 1; } else if ((cVar7 == '\\') && (local_18[1] == 0x6e)) { uVar10 = 2; local_11 = 1; } else { uVar10 = (int)pbVar11 - (int)local_18; } if (local_30 <= uVar10) { if (local_28 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } uVar6 = *(uint *)((int)local_28 + -4); qVar4 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar6; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar4 < uVar6); free((uint *)((int)local_28 + -4)); local_8 = local_8 & 0xffffff00; } local_30 = uVar10 + 1; local_28 = operator_new_tracked(local_30); } pvVar5 = local_28; memcpy(local_28,pbVar13,uVar10); *(undefined1 *)((int)pvVar5 + uVar10) = 0; local_34 = (*param_2)(pvVar5,uVar10,param_3); pbVar13 = local_18; uVar6 = CONCAT11(local_11,local_11) ^ 1; pbVar9 = local_18 + (uVar6 & 0xff) + uVar10; if ((local_20 < local_24 + local_34) || (local_11 != 0)) { if (local_24 == 0) { local_18 = pbVar9; } else { local_44[0] = 0; local_3c = ((short)local_18 - ((ushort)uVar6 & 0xff)) - (short)local_1c; local_40 = local_1c; puVar3 = *(undefined1 **)(param_1 + 4); if (puVar3 == *(undefined1 **)(param_1 + 8)) { local_18 = pbVar9; std::vector::_Emplace_reallocate(puVar3,local_44); } else { *puVar3 = 0; *(byte **)(puVar3 + 4) = local_1c; *(short *)(puVar3 + 8) = local_3c; *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 0xc; local_18 = pbVar9; } uVar6 = (uint)local_11 << 8; local_1c = pbVar13; if (local_11 != 0) { local_1c = local_18; } } pbVar13 = local_1c; local_24 = local_34; if ((char)(uVar6 >> 8) != '\0') { local_24 = 0; } if (local_20 < local_24) { if (uVar10 == 0xffffffff) { bVar1 = *local_1c; pbVar9 = local_1c; while (bVar1 != 0) { pbVar9 = pbVar9 + 1; bVar1 = *pbVar9; } } else { pbVar9 = local_1c + uVar10; } local_34 = (*param_2)(&DAT_00b6d4f8,1,param_3); do { if (pbVar9 <= local_1c) break; pbVar11 = local_1c; if (local_34 < local_20) { local_24 = (int)pbVar13 - (int)local_1c; do { if (pbVar9 <= pbVar11) break; if (pbVar13 < pbVar9) { local_24 = local_24 + 1; pbVar11 = pbVar13 + 1; } else { pbVar11 = pbVar13; } iVar12 = (*param_2)(local_1c,local_24,param_3); pbVar13 = pbVar11; } while (iVar12 + local_34 < local_20); if (pbVar11 == local_1c) goto LAB_00a5663d; } else { LAB_00a5663d: pbVar11 = pbVar11 + 1; } local_24 = (int)pbVar11 - (int)local_1c; local_48 = (short)local_24; pbVar2 = *(byte **)(param_1 + 4); local_50[0] = -(pbVar11 < pbVar9) & 2; local_4c = local_1c; if (pbVar2 == *(byte **)(param_1 + 8)) { std::vector::_Emplace_reallocate(pbVar2,local_50); } else { *pbVar2 = local_50[0]; *(byte **)(pbVar2 + 4) = local_1c; *(short *)(pbVar2 + 8) = local_48; *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 0xc; } local_1c = pbVar11; local_24 = (*param_2)(pbVar11,(int)pbVar9 - (int)pbVar11,param_3); } while (local_20 < local_24); } } else { local_24 = local_24 + local_38 + local_34; local_18 = pbVar9; } in_ECX = local_18; } while (local_18 < local_2c); in_ECX = local_1c; } pvVar5 = local_28; if (0 < (int)local_2c - (int)in_ECX) { local_48 = (short)local_2c - (short)in_ECX; local_50[0] = 0; puVar3 = *(undefined1 **)(param_1 + 4); local_4c = in_ECX; if (puVar3 == *(undefined1 **)(param_1 + 8)) { std::vector::_Emplace_reallocate(puVar3,local_50); } else { *puVar3 = 0; *(byte **)(puVar3 + 4) = in_ECX; *(short *)(puVar3 + 8) = local_48; *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 0xc; } } if (pvVar5 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } uVar10 = *(uint *)((int)pvVar5 + -4); qVar4 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar10; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar4 < uVar10); free((void *)((int)pvVar5 + -4)); } ExceptionList = local_10; return; } //@@ 00a56750 FUN_00a56750 void FUN_00a56750(byte *param_1,int param_2,undefined4 *param_3) { Font::get_string_width_n((Font *)*param_3,param_1,param_2); __ftoui3(); return; } //@@ 00a56790 FormattedText::split_lines_converted /* DB: ? splits UTF-16 text on '\n' and literal "\\n" into 12-byte segments, converting each piece through the callback param_2 (FUN_00a56bf0) with context param_3; Font::layout_glyphs */ void FormattedText::split_lines_converted(int param_1,code *param_2,undefined4 param_3) { ushort uVar1; byte *pbVar2; undefined1 *puVar3; qword qVar4; void *pvVar5; ushort *puVar6; ushort *puVar7; int iVar8; ushort *in_ECX; uint uVar9; ushort *in_EDX; qword *pqVar10; int iVar11; ushort *puVar12; uint uVar13; int iVar14; byte local_54 [4]; ushort *local_50; undefined2 local_4c; undefined1 local_48 [4]; ushort *local_44; short local_40; int local_3c; uint local_38; ushort *local_34; ushort *local_30; void *local_2c; ushort *local_28; ushort *local_24; ushort *local_20; ushort *local_1c; ushort *local_18; byte local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1289d; local_10 = ExceptionList; ExceptionList = &local_10; iVar11 = 0; local_8 = 0; uVar1 = *in_ECX; puVar12 = in_ECX; while (uVar1 != 0) { puVar12 = puVar12 + 1; iVar11 = iVar11 + 1; uVar1 = *puVar12; } local_34 = in_ECX + iVar11; local_20 = (ushort *)0x0; local_38 = 0x40; local_28 = in_EDX; local_1c = in_ECX; local_18 = in_ECX; local_3c = (*param_2)(&DAT_00b656ec,1,param_3,__security_cookie ^ (uint)(local_48 + 0x44)); local_2c = operator_new_tracked(0x80); puVar12 = in_ECX; if (in_ECX < local_34) { do { uVar1 = *puVar12; local_24 = (ushort *)(uint)uVar1; local_11 = 0; if (uVar1 != 0) { uVar13 = (uint)local_24; local_30 = puVar12; do { if ((short)uVar13 == 0x20) goto LAB_00a56878; puVar7 = local_30 + 1; uVar13 = (uint)*puVar7; local_30 = local_30 + 1; } while (*puVar7 != 0); } local_30 = (ushort *)0x0; if (uVar1 != 0) { LAB_00a56878: uVar13 = (uint)local_24; do { if ((short)uVar13 == 10) goto LAB_00a568b6; puVar7 = puVar12 + 1; uVar13 = (uint)*puVar7; puVar12 = puVar12 + 1; } while (*puVar7 != 0); } puVar12 = (ushort *)0x0; if (uVar1 != 0) { LAB_00a568b6: uVar13 = (uint)local_24; puVar7 = local_18; do { uVar9 = 0; while ((short)uVar13 == (short)(char)(&DAT_00b65584)[uVar9]) { uVar9 = uVar9 + 1; if (1 < uVar9) goto LAB_00a568e5; } puVar6 = puVar7 + 1; uVar13 = (uint)*puVar6; puVar7 = puVar7 + 1; } while (*puVar6 != 0); } puVar7 = (ushort *)0x0; LAB_00a568e5: puVar6 = local_30; if ((puVar12 != (ushort *)0x0) && (puVar12 < local_30)) { puVar6 = puVar12; } if ((puVar7 != (ushort *)0x0) && (puVar7 < puVar6)) { puVar6 = puVar7; } puVar12 = local_34; if (puVar6 != (ushort *)0x0) { puVar12 = puVar6; } if (uVar1 == 10) { uVar13 = 1; local_11 = 1; } else if ((uVar1 == 0x5c) && (local_18[1] == 0x6e)) { uVar13 = 2; local_11 = 1; } else { uVar13 = (int)puVar12 - (int)local_18 >> 1; } if (local_38 <= uVar13) { if (local_2c != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar9 = *(uint *)((int)local_2c + -4); qVar4 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar9; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar4 < uVar9); free((uint *)((int)local_2c + -4)); local_8 = local_8 & 0xffffff00; } local_38 = uVar13 + 1; local_2c = operator_new_tracked (-(uint)((int)((ulonglong)local_38 * 2 >> 0x20) != 0) | (uint)((ulonglong)local_38 * 2)); } memcpy(local_2c,local_18,uVar13 * 2); *(undefined2 *)(uVar13 * 2 + (int)local_2c) = 0; puVar7 = (ushort *)(*param_2)(local_2c,uVar13,param_3); local_30 = local_18; puVar12 = local_18 + (local_11 ^ 1) + uVar13; if ((local_28 < (ushort *)((int)local_20 + (int)puVar7)) || (local_11 != 0)) { if (local_20 != (ushort *)0x0) { local_40 = (short)((int)local_18 - (int)in_ECX >> 1) - (ushort)(local_11 ^ 1); local_48[0] = 0; puVar3 = *(undefined1 **)(param_1 + 4); local_44 = in_ECX; if (puVar3 == *(undefined1 **)(param_1 + 8)) { local_18 = puVar12; std::vector::_Emplace_reallocate(puVar3,local_48); } else { *puVar3 = 0; *(ushort **)(puVar3 + 4) = in_ECX; *(short *)(puVar3 + 8) = local_40; *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 0xc; local_18 = puVar12; } in_ECX = local_30; if (local_11 != 0) { in_ECX = local_18; } local_1c = in_ECX; puVar12 = local_18; } local_18 = puVar12; if (local_11 != 0) { puVar7 = (ushort *)0x0; } local_20 = puVar7; if (local_28 < puVar7) { if (uVar13 == 0xffffffff) { uVar1 = *local_1c; puVar12 = local_1c; while (uVar1 != 0) { puVar12 = puVar12 + 1; uVar1 = *puVar12; } } else { puVar12 = local_1c + uVar13; } local_30 = (ushort *)(*param_2)(&DAT_00b6d4f8,1,param_3); do { if (puVar12 <= local_1c) break; puVar7 = local_1c; if (local_30 < local_28) { local_24 = in_ECX; iVar11 = (int)in_ECX - (int)local_1c; do { in_ECX = local_24; if (puVar12 <= puVar7) break; iVar14 = iVar11 + 2; puVar7 = local_24 + 1; if (puVar12 <= local_24) { iVar14 = iVar11; puVar7 = local_24; } iVar8 = (*param_2)(local_1c,iVar14 >> 1,param_3); local_24 = puVar7; in_ECX = puVar7; iVar11 = iVar14; } while ((ushort *)(iVar8 + (int)local_30) < local_28); } puVar6 = puVar7 + 1; if (puVar7 != local_1c) { puVar6 = puVar7; } uVar13 = (int)puVar6 - (int)local_1c >> 1; local_24 = (ushort *)(uVar13 & 0xffff); local_4c = (undefined2)uVar13; local_54[0] = -(puVar6 < puVar12) & 2; pbVar2 = *(byte **)(param_1 + 4); local_50 = local_1c; if (pbVar2 == *(byte **)(param_1 + 8)) { std::vector::_Emplace_reallocate(pbVar2,local_54); } else { *pbVar2 = local_54[0]; *(ushort **)(pbVar2 + 4) = local_1c; *(undefined2 *)(pbVar2 + 8) = local_4c; *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 0xc; } local_1c = puVar6; local_20 = (ushort *)(*param_2)(puVar6,(int)puVar12 - (int)puVar6 >> 1,param_3); } while (local_28 < local_20); } } else { local_20 = (ushort *)((int)local_20 + local_3c + (int)puVar7); local_18 = puVar12; } in_ECX = local_1c; puVar12 = local_18; } while (local_18 < local_34); } pvVar5 = local_2c; iVar11 = (int)local_34 - (int)in_ECX >> 1; if (0 < iVar11) { local_4c = (undefined2)iVar11; local_54[0] = 0; puVar3 = *(undefined1 **)(param_1 + 4); local_50 = in_ECX; if (puVar3 == *(undefined1 **)(param_1 + 8)) { std::vector::_Emplace_reallocate(puVar3,local_54); } else { *puVar3 = 0; *(ushort **)(puVar3 + 4) = in_ECX; *(undefined2 *)(puVar3 + 8) = local_4c; *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 0xc; } } if (pvVar5 != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar10 = &g_allocatedBytesNoHeap; } else { pqVar10 = (qword *)((int)g_mainHeap + 0x30); } uVar13 = *(uint *)((int)pvVar5 + -4); qVar4 = *pqVar10; *(uint *)pqVar10 = (uint)*pqVar10 - uVar13; *(uint *)((int)pqVar10 + 4) = *(uint *)((int)pqVar10 + 4) - (uint)((uint)qVar4 < uVar13); free((void *)((int)pvVar5 + -4)); } ExceptionList = local_10; return; } //@@ 00a56bf0 FUN_00a56bf0 void FUN_00a56bf0(short *param_1,int param_2,undefined4 *param_3) { Font::get_string_width_utf16((Font *)*param_3,param_1,param_2); __ftoui3(); return; } //@@ 00a56c30 std::vector<12byte>::assign /* DB: assign(first,last) for 12-byte FormattedText segments: reuse when capacity fits else deallocate/_Allocate with growth (max 0x15555555); Font::layout_glyphs */ void std::vector<12byte>::assign(int param_1,int param_2) { uint uVar1; uint count; void *ptr; undefined4 uVar2; undefined4 *in_ECX; uint uVar3; uVar1 = (param_2 - param_1) / 0xc; ptr = (void *)*in_ECX; if (uVar1 <= (uint)((in_ECX[1] - (int)ptr) / 0xc)) { FUN_00a56da0(ptr); in_ECX[1] = (void *)((int)ptr + uVar1 * 0xc); return; } count = (in_ECX[2] - (int)ptr) / 0xc; if (count < uVar1) { if (0x15555555 < uVar1) { /* WARNING: Subroutine does not return */ _Xlen(); } if (0x15555555 - (count >> 1) < count) { uVar3 = 0x15555555; } else { uVar3 = (count >> 1) + count; if (uVar3 < uVar1) { uVar3 = uVar1; } } if (ptr != (void *)0x0) { deallocate(ptr,count); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } if (0x15555555 < uVar3) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } ptr = _Allocate(uVar3 * 0xc); *in_ECX = ptr; in_ECX[1] = ptr; in_ECX[2] = (void *)(uVar3 * 0xc + (int)ptr); } FUN_00a56da0(ptr); uVar2 = FUN_00a56d60(in_ECX[1]); in_ECX[1] = uVar2; return; } //@@ 00a56d60 FUN_00a56d60 undefined1 * FUN_00a56d60(undefined1 *param_1) { undefined2 *puVar1; undefined2 *in_ECX; undefined2 *in_EDX; undefined2 *puVar2; undefined1 *puVar3; puVar3 = param_1; if (in_ECX != in_EDX) { puVar2 = in_ECX + 4; do { *puVar3 = *(undefined1 *)(puVar2 + -4); *(undefined4 *)(puVar3 + 4) = *(undefined4 *)(puVar2 + -2); puVar3 = puVar3 + 0xc; *(undefined2 *)(param_1 + (-0xc - (int)in_ECX) + (int)(puVar2 + 6)) = *puVar2; puVar1 = puVar2 + 2; puVar2 = puVar2 + 6; } while (puVar1 != in_EDX); } return puVar3; } //@@ 00a56da0 FUN_00a56da0 undefined1 * FUN_00a56da0(undefined1 *param_1) { undefined2 *puVar1; undefined1 *in_ECX; undefined1 *in_EDX; if (in_ECX == in_EDX) { return param_1; } do { *param_1 = *in_ECX; *(undefined4 *)(param_1 + 4) = *(undefined4 *)(in_ECX + 4); puVar1 = (undefined2 *)(in_ECX + 8); in_ECX = in_ECX + 0xc; *(undefined2 *)(param_1 + 8) = *puVar1; param_1 = param_1 + 0xc; } while (in_ECX != in_EDX); return param_1; } //@@ 00a56de0 FUN_00a56de0 void FUN_00a56de0(byte param_1) { void *in_ECX; FUN_00a56e10(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x70); } return; } //@@ 00a56e10 FUN_00a56e10 void FUN_00a56e10(void) { undefined4 *in_ECX; *in_ECX = KAGE::System::FriendManager::vftable; in_ECX[0xe] = KAGE::EosFriendManager::vftable; in_ECX[0x16] = 0; in_ECX[0x17] = 0; std::vector::_Tidy(); FUN_00a7f0a0(); operator_delete((void *)in_ECX[0x10],0x10); std::vector::_Tidy(); std::vector::_Tidy(); in_ECX[1] = in_ECX[1] & 0xfffffffe; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[2] = 0; in_ECX[3] = 0; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a56ea0 steam_friends_get /* DB: ? ISteamFriends (SteamInternal_ContextInit 00c5c4f8) GetFriendCount(4 = k_EFriendFlagImmediate) vfunc +0xc and GetFriendByIndex +0x10, wraps each as UserProfile (find_or_create, load_steam_avatar when param_2) into the vector param_1; InviteFriendsMenu::load_graphics */ undefined4 * steam_friends_get(undefined4 *param_1,char param_2) { uint uVar1; int *piVar2; undefined4 *puVar3; int iVar4; int extraout_EAX; int in_ECX; int iVar5; undefined1 local_34 [8]; undefined **local_2c; undefined4 local_28; undefined **local_20; int local_1c; undefined4 local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b128f6; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; *param_1 = 0; param_1[1] = 0; param_1[2] = 0; local_8 = 0; local_18 = 1; local_14 = in_ECX; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8,uVar1); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8,uVar1); iVar4 = (**(code **)(*(int *)*puVar3 + 0xc))(4); iVar5 = 0; if (0 < iVar4) { do { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8,uVar1); puVar3 = (undefined4 *)(**(code **)(*(int *)*puVar3 + 0x10))(local_34,iVar5,4); local_2c = (undefined **)*puVar3; local_28 = puVar3[1]; local_20 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&local_2c); local_8 = 1; local_20 = KAGE::System::UserProfile::vftable; local_1c = extraout_EAX; if ((((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (param_2 != '\0')) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_20); } local_8 = 2; puVar3 = (undefined4 *)param_1[1]; if (puVar3 == (undefined4 *)param_1[2]) { std::vector::_Emplace_reallocate(puVar3,&local_20); } else { *puVar3 = KAGE::System::UserProfileBase::vftable; puVar3[1] = local_1c; *puVar3 = KAGE::System::UserProfile::vftable; param_1[1] = param_1[1] + 8; } iVar5 = iVar5 + 1; local_8 = local_8 & 0xffffff00; local_20 = KAGE::System::UserProfileBase::vftable; } while (iVar5 < iVar4); } in_ECX = local_14; } piVar2 = (int *)**(int **)(in_ECX + 0x40); if (piVar2 != *(int **)(in_ECX + 0x40)) { do { iVar4 = FUN_00a232c0(*(undefined4 *)(piVar2[2] + 0x10)); local_8 = 3; puVar3 = (undefined4 *)param_1[1]; if (puVar3 == (undefined4 *)param_1[2]) { std::vector::_Emplace_reallocate(puVar3,iVar4); } else { *puVar3 = KAGE::System::UserProfileBase::vftable; puVar3[1] = *(undefined4 *)(iVar4 + 4); *puVar3 = KAGE::System::UserProfile::vftable; param_1[1] = param_1[1] + 8; } local_8 = local_8 & 0xffffff00; piVar2 = (int *)*piVar2; local_2c = KAGE::System::UserProfileBase::vftable; } while (piVar2 != (int *)*(int *)(in_ECX + 0x40)); } ExceptionList = local_10; return param_1; } //@@ 00a57060 KAGE::System::FriendManager::request_friend_lobbies /* WARNING: Removing unreachable block (ram,0x00a571a7) */ /* WARNING: Removing unreachable block (ram,0x00a571c8) */ /* WARNING: Removing unreachable block (ram,0x00a571c0) */ /* WARNING: Removing unreachable block (ram,0x00a571d6) */ /* WARNING: Removing unreachable block (ram,0x00a5721d) */ /* WARNING: Removing unreachable block (ram,0x00a57228) */ /* WARNING: Removing unreachable block (ram,0x00a57231) */ /* WARNING: Removing unreachable block (ram,0x00a5723a) */ /* WARNING: Removing unreachable block (ram,0x00a57249) */ /* WARNING: Removing unreachable block (ram,0x00a57244) */ /* DB: ? FriendManager vtable slot 5 (slot 4 steam_friends_get): stores callback/ctx (+8/+0xc), for each friend ISteamFriends::GetFriendGamePlayed (+0x20) and RequestLobbyData on the friend's lobby (LobbySteam::request_lobby_data / find_or_create); callers Menu_OnlineLobbyList friends refresh 008e18b0/008e1fb0 Menu_OnlineLobbyList::on_lobby_list_received undefined4 KAGE::System::FriendManager::request_friend_lobbies(int param_1,int param_2) { code *pcVar1; int iVar2; char cVar3; undefined4 *puVar4; undefined4 uVar5; int *in_ECX; undefined4 uVar6; int iVar7; int local_3c; int local_38; undefined8 local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12935; local_10 = ExceptionList; ExceptionList = &local_10; in_ECX[2] = param_1; in_ECX[3] = param_2; in_ECX[6] = 0; FUN_00a57a10(); in_ECX[8] = in_ECX[7]; in_ECX[10] = 0; FUN_00a57a10(); in_ECX[0xc] = in_ECX[0xb]; (**(code **)(*in_ECX + 0x10))(); local_8 = 0; iVar7 = local_3c; if (local_3c != local_38) { do { puVar4 = (undefined4 *)SteamInternal_ContextInit(); pcVar1 = *(code **)(*(int *)*puVar4 + 0x20); iVar2 = *(int *)(iVar7 + 4); if (iVar2 == 0) { local_20 = 0; local_20._4_4_ = 0; local_20._0_4_ = 0; uVar5 = local_20._4_4_; uVar6 = (undefined4)local_20; } else { uVar5 = *(undefined4 *)(iVar2 + 0xc); uVar6 = *(undefined4 *)(iVar2 + 8); } FUN_00a238e0(uVar6,uVar5); cVar3 = (*pcVar1)(); if (cVar3 != '\0') { puVar4 = (undefined4 *)SteamInternal_ContextInit(); (**(code **)(*(int *)*puVar4 + 0x24))(); } iVar7 = iVar7 + 8; } while (iVar7 != local_38); } if (in_ECX[10] != 0) { in_ECX[6] = in_ECX[6] + 1; } local_8 = 0xffffffff; vector_UserProfile_destroy(&local_3c); in_ECX[6] = in_ECX[6] + 1; eos_friend_lobby_search_start(); if ((in_ECX[6] == 0) && (DAT_00c5ab58 != (code *)0x0)) { (*DAT_00c5ab58)(); DAT_00c5ab58 = (code *)0x0; DAT_00c5ab5c = 0; } ExceptionList = local_10; return 1; } //@@ 00a572d0 FUN_00a572d0 void FUN_00a572d0(int *param_1) { int *piVar1; undefined4 *puVar2; int iVar3; uint uVar4; int in_ECX; uint uVar5; uint extraout_ECX; int iVar6; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12978; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar5 = 0; local_14 = 0; iVar6 = *param_1; iVar3 = param_1[1] - iVar6 >> 0x1f; if ((param_1[1] - iVar6) / 0x14 + iVar3 != iVar3) { local_18 = 0; do { puVar2 = *(undefined4 **)(in_ECX + 0x20); iVar6 = local_18 + iVar6; if (puVar2 == *(undefined4 **)(in_ECX + 0x24)) { std::vector<20byte>::_Emplace_reallocate(puVar2,iVar6); } else { *puVar2 = KAGE::System::UserProfileBase::vftable; puVar2[1] = *(undefined4 *)(iVar6 + 4); *puVar2 = KAGE::System::UserProfile::vftable; puVar2[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar2[3] = 0; puVar2[4] = 0; local_8 = 1; std::shared_ptr::assign(puVar2 + 3,(void *)(iVar6 + 0xc)); local_8 = 0xffffffff; *(int *)(in_ECX + 0x20) = *(int *)(in_ECX + 0x20) + 0x14; } uVar5 = local_14 + 1; local_18 = local_18 + 0x14; iVar6 = *param_1; local_14 = uVar5; } while (uVar5 < (uint)((param_1[1] - iVar6) / 0x14)); } piVar1 = (int *)(in_ECX + 0x18); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { if (DAT_00c5ab58 != (code *)0x0) { (*DAT_00c5ab58)((undefined4 *)(in_ECX + 0x1c),DAT_00c5ab5c,uVar4); DAT_00c5ab58 = (code *)0x0; DAT_00c5ab5c = 0; uVar5 = extraout_ECX; } FUN_00a57a10(uVar5); *(undefined4 *)(in_ECX + 0x20) = *(undefined4 *)(in_ECX + 0x1c); } ExceptionList = local_10; return; } //@@ 00a57420 FUN_00a57420 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a57420(int param_1,undefined4 param_2,void *param_3) { char cVar1; uint uVar2; int extraout_EAX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined **local_3c; undefined4 local_38; undefined **local_34; undefined1 local_30 [4]; int *local_2c; undefined **local_28; void *local_24; int *local_20; undefined **local_1c [3]; void *local_10; undefined1 *puStack_c; undefined **local_8; local_8 = (undefined **)0xffffffff; puStack_c = &LAB_00b129c5; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_1c + 6); ExceptionList = &local_10; if (param_1 == 0) { KAGE::Network::Multiplayer::ConstLobby::ConstLobby(param_2); local_8 = (undefined **)0x0; Lobby::refresh_members(local_24); local_38 = 0; local_3c = KAGE::System::UserProfile::vftable; local_8._0_1_ = 1; local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(extraout_ECX); local_8._0_1_ = 2; local_1c[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(param_3); local_8._0_1_ = 3; local_1c[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_1c); } local_8._0_1_ = 2; local_1c[0] = KAGE::System::UserProfileBase::vftable; std::shared_ptr::assign(local_30,&local_24); FUN_00a575e0(&local_3c); local_34 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = (undefined **)CONCAT31(local_8._1_3_,4); if (((local_2c != (int *)0x0) && (cVar1 = (**(code **)(*local_2c + 0xc))(), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_30); } local_3c = KAGE::System::UserProfileBase::vftable; local_28 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = (undefined **)0x5; if (((local_20 != (int *)0x0) && (cVar1 = (**(code **)(*local_20 + 0xc))(), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_24); } } local_8 = (undefined **)0xffffffff; if (param_3 != (void *)0x0) { operator_delete(param_3,8); } _DAT_00c5ab78 = _DAT_00c5ab78 + -1; if (_DAT_00c5ab78 == 0) { FUN_00a572d0(&DAT_00c5ab7c); FUN_00a57a10(extraout_ECX_00,uVar2); DAT_00c5ab80 = DAT_00c5ab7c; } ExceptionList = local_10; return; } //@@ 00a575c0 FUN_00a575c0 void FUN_00a575c0(undefined4 param_1) { FUN_00a572d0(param_1); return; } //@@ 00a575e0 FUN_00a575e0 void FUN_00a575e0(int param_1) { undefined4 *puVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b067b8; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = *(undefined4 **)(in_ECX + 4); if (puVar1 == *(undefined4 **)(in_ECX + 8)) { std::vector<20byte>::_Emplace_reallocate(puVar1,param_1); ExceptionList = local_10; return; } *puVar1 = KAGE::System::UserProfileBase::vftable; puVar1[1] = *(undefined4 *)(param_1 + 4); *puVar1 = KAGE::System::UserProfile::vftable; puVar1[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar1[3] = 0; puVar1[4] = 0; local_8 = 1; std::shared_ptr::assign(puVar1 + 3,(void *)(param_1 + 0xc)); *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + 0x14; ExceptionList = local_10; return; } //@@ 00a57690 std::vector::_Tidy /* DB: ? destroys 0x14-byte elements via FUN_00a57a10 (per element ConstLobby at +8 released through g_lobbyReleaseFn) and frees storage; called from the FriendManager/EosFriendManager dtor 00a56e10 */ void std::vector::_Tidy(void) { void *pvVar1; int *in_ECX; uint size; void *ptr; if (*in_ECX != 0) { FUN_00a57a10(*in_ECX); pvVar1 = (void *)*in_ECX; size = ((in_ECX[2] - (int)pvVar1) / 0x14) * 0x14; ptr = pvVar1; if (0xfff < size) { ptr = *(void **)((int)pvVar1 + -4); size = size + 0x23; if (0x1f < (uint)((int)pvVar1 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; } return; } //@@ 00a57710 FUN_00a57710 void FUN_00a57710(void) { FUN_00a57a10(); return; } //@@ 00a57730 FUN_00a57730 void FUN_00a57730(int param_1) { undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12a08; local_10 = ExceptionList; ExceptionList = &local_10; *in_EDX = KAGE::System::UserProfileBase::vftable; in_EDX[1] = *(undefined4 *)(param_1 + 4); *in_EDX = KAGE::System::UserProfile::vftable; in_EDX[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; in_EDX[3] = 0; in_EDX[4] = 0; local_8 = 1; std::shared_ptr::assign(in_EDX + 3,(void *)(param_1 + 0xc)); ExceptionList = local_10; return; } //@@ 00a577b0 std::vector<20byte>::_Emplace_reallocate /* DB: 0x14-byte elements (max 0xccccccc), growth 1.5x, std::shared_ptr::assign member copy; callers FUN_00a572d0/FUN_00a575e0 */ undefined4 * std::vector<20byte>::_Emplace_reallocate(int param_1,undefined4 param_2) { uint uVar1; int iVar2; int iVar3; void *pvVar4; undefined4 *puVar5; int *in_ECX; uint uVar6; undefined4 *puVar7; int iVar8; void *ptr; uint local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12a50; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = *in_ECX; iVar3 = (in_ECX[1] - *in_ECX) / 0x14; if (iVar3 == 0xccccccc) { /* WARNING: Subroutine does not return */ _Xlen(); } uVar1 = iVar3 + 1; uVar6 = (in_ECX[2] - *in_ECX) / 0x14; if (0xccccccc - (uVar6 >> 1) < uVar6) { local_20 = 0xccccccc; } else { uVar6 = (uVar6 >> 1) + uVar6; local_20 = uVar1; if (uVar1 <= uVar6) { local_20 = uVar6; } if (0xccccccc < local_20) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } puVar5 = _Allocate(local_20 * 0x14); local_8._0_1_ = 0; local_8._1_3_ = 0; FUN_00a57730(param_2); iVar3 = in_ECX[1]; iVar8 = *in_ECX; if (param_1 == iVar3) { puVar7 = puVar5; for (; local_8._0_1_ = 1, iVar8 != iVar3; iVar8 = iVar8 + 0x14) { *puVar7 = KAGE::System::UserProfileBase::vftable; puVar7[1] = *(undefined4 *)(iVar8 + 4); *puVar7 = KAGE::System::UserProfile::vftable; puVar7[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; puVar7[3] = 0; puVar7[4] = 0; local_8._0_1_ = 3; shared_ptr::assign(puVar7 + 3,(void *)(iVar8 + 0xc)); puVar7 = puVar7 + 5; } FUN_00a57a10(iVar3); } else { FUN_00a57aa0(iVar8,param_1,puVar5); FUN_00a57aa0(param_1,in_ECX[1],puVar5 + ((param_1 - iVar2) / 0x14) * 5 + 5); } if (*in_ECX != 0) { FUN_00a57a10(*in_ECX); pvVar4 = (void *)*in_ECX; uVar6 = ((in_ECX[2] - (int)pvVar4) / 0x14) * 0x14; ptr = pvVar4; if (0xfff < uVar6) { ptr = *(void **)((int)pvVar4 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)pvVar4 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } *in_ECX = (int)puVar5; in_ECX[1] = (int)(puVar5 + uVar1 * 5); in_ECX[2] = (int)(puVar5 + local_20 * 5); ExceptionList = local_10; return puVar5 + ((param_1 - iVar2) / 0x14) * 5; } //@@ 00a579e5 Catch_All@00a579e5 void Catch_All_00a579e5(void) { int unaff_EBP; FUN_00a57710(*(undefined4 *)(unaff_EBP + -0x18),*(undefined4 *)(unaff_EBP + -0x2c)); deallocate(*(void **)(unaff_EBP + -0x14),*(uint *)(unaff_EBP + -0x28)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00a57a10 FUN_00a57a10 void FUN_00a57a10(void) { int iVar1; char cVar2; uint uVar3; int in_ECX; int in_EDX; int iVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (in_ECX != in_EDX) { iVar4 = in_ECX + 0xc; do { *(undefined ***)(iVar4 + -4) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)(iVar4 + 4) != (int *)0x0) { cVar2 = (**(code **)(**(int **)(iVar4 + 4) + 0xc))(uVar3); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(iVar4); } } *(undefined ***)(iVar4 + -0xc) = KAGE::System::UserProfileBase::vftable; iVar1 = iVar4 + 8; iVar4 = iVar4 + 0x14; } while (iVar1 != in_EDX); } ExceptionList = local_10; return; } //@@ 00a57aa0 FUN_00a57aa0 undefined4 * FUN_00a57aa0(int param_1,int param_2,undefined4 *param_3) { int iVar1; uint uVar2; undefined4 in_ECX; undefined4 extraout_ECX; void *value; void *local_10; undefined1 *puStack_c; undefined1 local_8; undefined1 auStack_7 [3]; puStack_c = &LAB_00b12a90; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(auStack_7 + 3); ExceptionList = &local_10; auStack_7 = (undefined1 [3])0x0; if (param_1 != param_2) { value = (void *)(param_1 + 0xc); do { *param_3 = KAGE::System::UserProfileBase::vftable; param_3[1] = *(undefined4 *)((int)value + -8); *param_3 = KAGE::System::UserProfile::vftable; param_3[2] = KAGE::Network::Multiplayer::ConstLobby::vftable; param_3[3] = 0; param_3[4] = 0; local_8 = 2; std::shared_ptr::assign(param_3 + 3,value); param_3 = param_3 + 5; iVar1 = (int)value + 8; in_ECX = extraout_ECX; value = (void *)((int)value + 0x14); } while (iVar1 != param_2); } local_8 = 0; FUN_00a57a10(in_ECX,uVar2); ExceptionList = local_10; return param_3; } //@@ 00a57b70 FUN_00a57b70 void FUN_00a57b70(void) { FUN_00a57a10(); return; } //@@ 00a57b80 FUN_00a57b80 void FUN_00a57b80(void) { undefined4 *in_ECX; in_ECX[1] = in_ECX[1] & 0xfffffffe; in_ECX[2] = 0; in_ECX[3] = 0; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a57ba0 FUN_00a57ba0 void FUN_00a57ba0(byte param_1) { undefined4 *in_ECX; in_ECX[4] = in_ECX[3]; *in_ECX = KAGE::Filesys::BufferedStreamBase::vftable; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; FUN_007dcd30(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x28); } return; } //@@ 00a57c00 FUN_00a57c00 void FUN_00a57c00(void) { undefined4 *in_ECX; in_ECX[4] = in_ECX[3]; *in_ECX = KAGE::Filesys::BufferedStreamBase::vftable; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; FUN_007dcd30(); return; } //@@ 00a57c40 FUN_00a57c40 undefined4 FUN_00a57c40(int param_1,int param_2) { int *in_ECX; uint uVar1; uint uVar2; in_ECX[2] = param_2; in_ECX[8] = 0; in_ECX[6] = 0; in_ECX[4] = in_ECX[3]; in_ECX[1] = param_1; uVar2 = param_1 - in_ECX[8]; in_ECX[7] = 0; uVar1 = 0; if (-1 < (int)uVar2) { uVar1 = uVar2; } in_ECX[9] = in_ECX[8]; if ((uint)in_ECX[2] < uVar1) { uVar1 = in_ECX[2]; } if (uVar1 != 0) { FUN_007dccd0(uVar1); (**(code **)(*in_ECX + 0x24))(in_ECX[8]); (**(code **)(*in_ECX + 0x28))(in_ECX[3],1,uVar1); } return 1; } //@@ 00a57cc0 FUN_00a57cc0 void FUN_00a57cc0(void) { int in_ECX; *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 0x10) = *(undefined4 *)(in_ECX + 0xc); *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0x1c) = 0; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(in_ECX + 0x24) = 0; return; } //@@ 00a57d00 FUN_00a57d00 void FUN_00a57d00(uint param_1) { int in_ECX; if (param_1 <= (uint)(*(int *)(in_ECX + 0x14) - *(int *)(in_ECX + 0xc))) { return; } if (0x7fffffff < param_1) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_00a2c860(); return; } //@@ 00a57d30 KAGE::Filesys::BufferedStream::seek /* DB: BufferedStream vftable slot 5: (offset, whence SEEK_SET/CUR/END(+4 size)) sets position +0x20, rebuffers when outside [+0x24, +0x24+len), cursor +0x1c */ void KAGE::Filesys::BufferedStream::seek(int param_1,int param_2) { void *in_ECX; uint uVar1; uint uVar2; uint uVar3; if (param_2 != 0) { if (param_2 == 1) { *(int *)((int)in_ECX + 0x20) = *(int *)((int)in_ECX + 0x20) + param_1; goto LAB_00a57d5f; } if (param_2 != 2) goto LAB_00a57d5f; param_1 = *(int *)((int)in_ECX + 4) + param_1; } *(int *)((int)in_ECX + 0x20) = param_1; LAB_00a57d5f: if (*(int *)((int)in_ECX + 0x18) == 0) { uVar2 = *(int *)((int)in_ECX + 0x10) - *(int *)((int)in_ECX + 0xc); } else { uVar2 = *(uint *)((int)in_ECX + 4); } uVar1 = *(uint *)((int)in_ECX + 0x20); uVar3 = *(uint *)((int)in_ECX + 0x24); if ((uVar1 < uVar3) || (uVar2 < uVar1 - uVar3)) { rebuffer(in_ECX); uVar1 = *(uint *)((int)in_ECX + 0x20); uVar3 = *(uint *)((int)in_ECX + 0x24); } *(uint *)((int)in_ECX + 0x1c) = uVar1 - uVar3; return; } //@@ 00a57da0 FUN_00a57da0 int FUN_00a57da0(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x18); if (iVar1 == 0) { iVar1 = *(int *)(in_ECX + 0xc); } return iVar1; } //@@ 00a57db0 KAGE::Filesys::BufferedStream::read /* DB: BufferedStream vftable slot 6: fread-style (dst,size,count) from buffer (+0xc..+0x10 or fixed data +0x18), rebuffer or direct read (vfunc +0x28) for large requests, total read +0x20 prototype: db/protos.zhl, confirmed by RET 12 */ uint __thiscall KAGE::Filesys::BufferedStream::read(void *this,void *buffer,uint size,uint count) { int iVar1; uint uVar2; uint uVar3; size_t _Size; uint uVar4; uint _Size_00; _Size_00 = size * count; if (_Size_00 == 0) { return 0; } uVar3 = *(uint *)((int)this + 0x18); size = 0; if (uVar3 == 0) { count = *(uint *)((int)this + 0xc); uVar4 = *(int *)((int)this + 0x10) - *(int *)((int)this + 0xc); } else { uVar4 = *(uint *)((int)this + 4); count = uVar3; } uVar2 = *(uint *)((int)this + 0x1c); if (uVar4 < *(int *)((int)this + 0x1c) + _Size_00) { _Size = uVar4 - uVar2; if ((int)_Size < 1) { uVar2 = _Size_00; } else { memcpy(buffer,(void *)(uVar2 + count),_Size); buffer = (void *)((int)buffer + _Size); *(int *)((int)this + 0x20) = *(int *)((int)this + 0x20) + _Size; uVar3 = *(uint *)((int)this + 0x18); uVar2 = _Size_00 - _Size; size = _Size; } if (uVar3 != 0) { return size; } *(undefined4 *)((int)this + 0x10) = *(undefined4 *)((int)this + 0xc); *(undefined4 *)((int)this + 0x1c) = 0; if (*(uint *)((int)this + 8) < uVar2) { iVar1 = (**(code **)(*(int *)this + 0x28))(buffer,1,uVar2); *(int *)((int)this + 0x20) = *(int *)((int)this + 0x20) + iVar1; return iVar1 + size; } rebuffer(this); uVar4 = *(int *)((int)this + 0x10) - *(int *)((int)this + 0xc); _Size_00 = uVar4; if (uVar2 <= uVar4) { _Size_00 = uVar2; } if (*(int *)((int)this + 0x18) != 0) { uVar4 = *(uint *)((int)this + 4); } uVar2 = *(uint *)((int)this + 0x1c); } if (uVar2 < uVar4) { memcpy(buffer,(void *)(uVar2 + count),_Size_00); *(int *)((int)this + 0x1c) = *(int *)((int)this + 0x1c) + _Size_00; *(int *)((int)this + 0x20) = *(int *)((int)this + 0x20) + _Size_00; return size + _Size_00; } return size; } //@@ 00a57eb0 KAGE::Filesys::BufferedStream::write /* DB: vtable slot 7 of KAGE::Filesys::BufferedStream; logs "Attempting to write to a read-only buffer" */ uint KAGE::Filesys::BufferedStream::write(void *param_1,int param_2,int param_3) { uint uVar1; int *in_ECX; uint _Size; if (in_ECX[6] != 0) { KAGE_LogMessage(0x10,(byte *)"Attempting to write to a read-only buffer\n"); } _Size = param_2 * param_3; if (_Size == 0) { return 0; } if ((uint)in_ECX[2] < _Size) { (**(code **)(*in_ECX + 0x20))(); (**(code **)(*in_ECX + 0x2c))(param_1,param_2,param_3); in_ECX[1] = in_ECX[1] + _Size; in_ECX[8] = in_ECX[8] + _Size; in_ECX[9] = in_ECX[8]; return _Size; } if ((uint)(in_ECX[4] - in_ECX[3]) < in_ECX[7] + _Size) { uVar1 = _Size + 0x1000 + (in_ECX[4] - in_ECX[3]); if ((uint)in_ECX[2] <= uVar1) { (**(code **)(*in_ECX + 0x20))(); uVar1 = _Size + 0x1000; } FUN_007dccd0(uVar1); } memcpy((void *)(in_ECX[7] + in_ECX[3]),param_1,_Size); in_ECX[8] = in_ECX[8] + _Size; in_ECX[7] = in_ECX[7] + _Size; in_ECX[1] = *(int *)((-(uint)((uint)in_ECX[1] < (uint)in_ECX[8]) & 0x1c) + 4 + (int)in_ECX); return _Size; } //@@ 00a57f80 FUN_00a57f80 void FUN_00a57f80(void) { int *in_ECX; if (in_ECX[6] != 0) { KAGE_LogMessage(0x10,(byte *)"Attempting to flush to a read-only buffer\n"); } (**(code **)(*in_ECX + 0x2c))(in_ECX[3],1,in_ECX[7]); in_ECX[9] = in_ECX[9] + in_ECX[7]; in_ECX[7] = 0; in_ECX[4] = in_ECX[3]; return; } //@@ 00a57fc0 KAGE::Filesys::BufferedStream::rebuffer /* DB: "Attempting to rebuffer data on a read-only buffer" (+0x18 set), refills the buffer from the underlying stream at the current position (vfunc +0x24 seek, +0x28 read), capacity +8 prototype: db/protos.zhl */ byte __thiscall KAGE::Filesys::BufferedStream::rebuffer(void *this) { uint uVar1; uint uVar2; if (*(int *)((int)this + 0x18) != 0) { KAGE_LogMessage(0x10,(byte *)"Attempting to rebuffer data on a read-only buffer"); } *(undefined4 *)((int)this + 0x10) = *(undefined4 *)((int)this + 0xc); uVar1 = *(int *)((int)this + 4) - *(int *)((int)this + 0x20); *(int *)((int)this + 0x24) = *(int *)((int)this + 0x20); uVar2 = 0; if (-1 < (int)uVar1) { uVar2 = uVar1; } *(undefined4 *)((int)this + 0x1c) = 0; if (*(uint *)((int)this + 8) < uVar2) { uVar2 = *(uint *)((int)this + 8); } if (uVar2 == 0) { return 0; } FUN_007dccd0(uVar2); (**(code **)(*(int *)this + 0x24))(*(undefined4 *)((int)this + 0x20)); (**(code **)(*(int *)this + 0x28))(*(undefined4 *)((int)this + 0xc),1,uVar2); return 1; } //@@ 00a58040 KAGE::Filesys::BufferedStream::BufferedStream /* DB: constructor: sets KAGE::Filesys::StreamBase then BufferedStream vftables at +0 and +0x28, zeroes buffer fields, size -1 and reserves the buffer (FUN_007dccd0); SaveSlotManager::constructor, write_game_state_to_stream prototype: db/protos.zhl, confirmed by RET 4 */ void * __thiscall KAGE::Filesys::BufferedStream::BufferedStream(void *this,int bufferSize) { uint uVar1; uint uVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12b18; local_10 = ExceptionList; ExceptionList = &local_10; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 0; *(undefined4 *)((int)this + 0x14) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 0x24) = 0; *(undefined ***)((int)this + 0x28) = StreamBase::vftable; local_8 = 1; *(undefined ***)this = vftable; *(undefined ***)((int)this + 0x28) = vftable; *(undefined4 *)((int)this + 8) = 0xffffffff; *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 0x18) = 0; *(undefined4 *)((int)this + 0x1c) = 0; *(undefined4 *)((int)this + 0x10) = *(undefined4 *)((int)this + 0xc); uVar1 = *(int *)((int)this + 4) - *(int *)((int)this + 0x20); *(int *)((int)this + 0x24) = *(int *)((int)this + 0x20); uVar2 = 0; if (-1 < (int)uVar1) { uVar2 = uVar1; } if (*(uint *)((int)this + 8) < uVar2) { uVar2 = *(uint *)((int)this + 8); } if (uVar2 != 0) { FUN_007dccd0(uVar2); if (*(code **)(*(int *)this + 0x24) != GridEntity_Statue::Render) { (**(code **)(*(int *)this + 0x24))(*(undefined4 *)((int)this + 0x20)); } if (*(code **)(*(int *)this + 0x28) != FUN_00a584b0) { (**(code **)(*(int *)this + 0x28))(*(undefined4 *)((int)this + 0xc),1,uVar2); } } if (bufferSize != 0) { FUN_007dccd0(bufferSize); } ExceptionList = local_10; return this; } //@@ 00a58170 FUN_00a58170 void FUN_00a58170(byte param_1) { void *in_ECX; FUN_00a58200(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x2c); } return; } //@@ 00a581a0 FUN_00a581a0 void FUN_00a581a0(undefined4 param_1,undefined4 param_2) { undefined4 *in_ECX; in_ECX[2] = param_2; in_ECX[1] = param_2; in_ECX[4] = 0; in_ECX[6] = param_1; in_ECX[3] = 0; in_ECX[5] = 0; in_ECX[9] = 0; in_ECX[8] = 0; in_ECX[7] = 0; in_ECX[4] = 0; *in_ECX = KAGE::Filesys::BufferedStream::vftable; in_ECX[10] = KAGE::Filesys::BufferedStream::vftable; return; } //@@ 00a58200 FUN_00a58200 void FUN_00a58200(void) { undefined4 *in_ECX; in_ECX[4] = in_ECX[3]; in_ECX[10] = KAGE::Filesys::StreamBase::vftable; *in_ECX = KAGE::Filesys::BufferedStreamBase::vftable; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[4] = in_ECX[3]; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; FUN_007dcd30(); return; } //@@ 00a58250 FUN_00a58250 undefined4 FUN_00a58250(void) { int in_ECX; return *(undefined4 *)(in_ECX + -0x24); } //@@ 00a58260 FUN_00a58260 undefined4 FUN_00a58260(void) { int in_ECX; return *(undefined4 *)(in_ECX + -8); } //@@ 00a58270 KAGE::Filesys::BufferedStream::seek_base2 /* DB: BufferedStream::seek (00a57d30, whence 0/1/2) reached through the second vtable at +0x28 (fields addressed at -0x24..-4); rebuffers when out of window; write_desync_dump */ void KAGE::Filesys::BufferedStream::seek_base2(int param_1,int param_2) { int in_ECX; uint uVar1; uint uVar2; uint uVar3; if (param_2 != 0) { if (param_2 == 1) { *(int *)(in_ECX + -8) = *(int *)(in_ECX + -8) + param_1; goto LAB_00a582a0; } if (param_2 != 2) goto LAB_00a582a0; param_1 = *(int *)(in_ECX + -0x24) + param_1; } *(int *)(in_ECX + -8) = param_1; LAB_00a582a0: if (*(int *)(in_ECX + -0x10) == 0) { uVar2 = *(int *)(in_ECX + -0x18) - *(int *)(in_ECX + -0x1c); } else { uVar2 = *(uint *)(in_ECX + -0x24); } uVar1 = *(uint *)(in_ECX + -8); uVar3 = *(uint *)(in_ECX + -4); if ((uVar1 < uVar3) || (uVar2 < uVar1 - uVar3)) { rebuffer((void *)(in_ECX + -0x28)); uVar1 = *(uint *)(in_ECX + -8); uVar3 = *(uint *)(in_ECX + -4); } *(uint *)(in_ECX + -0xc) = uVar1 - uVar3; return; } //@@ 00a582e0 memory_stream_read /* DB: ? fread-style (dst, size, count) on a buffer object addressed by negative offsets from ECX (+-0x1c begin, -0x18 end, -0xc cursor, -8 total read), memcpy of the available part; save/desync code (write_desync_dump, Menu_Save::load_slot_data) prototype: db/protos.zhl, confirmed by RET 12 */ uint __thiscall memory_stream_read(void *this,void *dst,uint size,uint count) { int iVar1; uint uVar2; size_t _Size; uint uVar3; uint _Size_00; _Size_00 = size * count; if (_Size_00 == 0) { return 0; } iVar1 = *(int *)((int)this + -0x10); size = 0; if (iVar1 == 0) { uVar3 = *(int *)((int)this + -0x18) - *(int *)((int)this + -0x1c); iVar1 = *(int *)((int)this + -0x1c); } else { uVar3 = *(uint *)((int)this + -0x24); } uVar2 = *(uint *)((int)this + -0xc); if (uVar3 < uVar2 + _Size_00) { _Size = uVar3 - uVar2; if ((int)_Size < 1) { uVar2 = _Size_00; } else { memcpy(dst,(void *)(iVar1 + uVar2),_Size); *(int *)((int)this + -8) = *(int *)((int)this + -8) + _Size; dst = (void *)((int)dst + _Size); uVar2 = _Size_00 - _Size; size = _Size; } if (*(int *)((int)this + -0x10) != 0) { return size; } *(undefined4 *)((int)this + -0x18) = *(undefined4 *)((int)this + -0x1c); *(undefined4 *)((int)this + -0xc) = 0; if (*(uint *)((int)this + -0x20) < uVar2) { iVar1 = (**(code **)(*(int *)((int)this + -0x28) + 0x28))(dst,1,uVar2); *(int *)((int)this + -8) = *(int *)((int)this + -8) + iVar1; return iVar1 + size; } KAGE::Filesys::BufferedStream::rebuffer((int *)((int)this + -0x28)); uVar3 = *(int *)((int)this + -0x18) - *(int *)((int)this + -0x1c); _Size_00 = uVar3; if (uVar2 <= uVar3) { _Size_00 = uVar2; } if (*(int *)((int)this + -0x10) != 0) { uVar3 = *(uint *)((int)this + -0x24); } uVar2 = *(uint *)((int)this + -0xc); } if (uVar2 < uVar3) { memcpy(dst,(void *)(iVar1 + uVar2),_Size_00); *(int *)((int)this + -0xc) = *(int *)((int)this + -0xc) + _Size_00; *(int *)((int)this + -8) = *(int *)((int)this + -8) + _Size_00; return size + _Size_00; } return size; } //@@ 00a583e0 buffered_stream_write /* DB: ? same body as KAGE::Filesys::BufferedStream vslot 7 (00a57eb0) but with ECX pointing 0x28 past the stream: "Attempting to write to a read-only buffer", flush+direct write when larger than the buffer, else memcpy; OnlineChat::broadcast_message, NetplayManager::send_remove_frame prototype: db/protos.zhl, confirmed by RET 12 */ uint __thiscall buffered_stream_write(void *this,void *data,uint size,uint count) { uint uVar1; uint _Size; if (*(int *)((int)this + -0x10) != 0) { KAGE_LogMessage(0x10,(byte *)"Attempting to write to a read-only buffer\n"); } _Size = size * count; if (_Size == 0) { return 0; } if (*(uint *)((int)this + -0x20) < _Size) { (**(code **)(*(int *)((int)this + -0x28) + 0x20))(); (**(code **)(*(int *)((int)this + -0x28) + 0x2c))(data,size,count); *(int *)((int)this + -0x24) = *(int *)((int)this + -0x24) + _Size; *(int *)((int)this + -8) = *(int *)((int)this + -8) + _Size; *(undefined4 *)((int)this + -4) = *(undefined4 *)((int)this + -8); return _Size; } uVar1 = *(int *)((int)this + -0x18) - *(int *)((int)this + -0x1c); if (uVar1 < *(int *)((int)this + -0xc) + _Size) { uVar1 = _Size + 0x1000 + uVar1; if (*(uint *)((int)this + -0x20) <= uVar1) { (**(code **)(*(int *)((int)this + -0x28) + 0x20))(); uVar1 = _Size + 0x1000; } FUN_007dccd0(uVar1); } memcpy((void *)(*(int *)((int)this + -0xc) + *(int *)((int)this + -0x1c)),data,_Size); *(int *)((int)this + -8) = *(int *)((int)this + -8) + _Size; *(int *)((int)this + -0xc) = *(int *)((int)this + -0xc) + _Size; *(undefined4 *)((int)this + -0x24) = *(undefined4 *) (((-(uint)(*(uint *)((int)this + -0x24) < *(uint *)((int)this + -8)) & 0x1c) - 0x24) + (int)this); return _Size; } //@@ 00a584b0 FUN_00a584b0 undefined4 FUN_00a584b0(void) { return 0; } //@@ 00a584b5 FUN_00a584b5 void FUN_00a584b5(void) { FUN_00a58170(); return; } //@@ 00a584bd FUN_00a584bd void FUN_00a584bd(void) { guard_check_icall(); return; } //@@ 00a584d0 FUN_00a584d0 int FUN_00a584d0(undefined1 param_1,int *param_2) { longlong lVar1; longlong lVar2; char cVar3; uint uVar4; int in_ECX; uint uVar5; ulonglong uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12b4d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; FUN_008ef1d0(¶m_1); uVar6 = GetTimeNs(); uVar5 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar5 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar5 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar5 = (uint)((ulonglong)lVar1 >> 0x20); *(uint *)(in_ECX + 8) = (uint)lVar1 >> 0x12 | uVar5 * 0x4000; *(uint *)(in_ECX + 0xc) = uVar5 >> 0x12; *(undefined1 *)(in_ECX + 0x10) = 0; local_8 = 1; if (param_2 != (int *)0x0) { cVar3 = (**(code **)(*param_2 + 0xc))(uVar4); if ((cVar3 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } } ExceptionList = local_10; return in_ECX; } //@@ 00a585c0 FUN_00a585c0 undefined8 FUN_00a585c0(void) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar4 = (uint)((ulonglong)lVar1 >> 0x20); uVar3 = (uint)lVar1 >> 0x12 | uVar4 * 0x4000; return CONCAT44(((uVar4 >> 0x12) - *(int *)(in_ECX + 0xc)) - (uint)(uVar3 < *(uint *)(in_ECX + 8)) ,uVar3 - *(uint *)(in_ECX + 8)); } //@@ 00a58640 FUN_00a58640 void FUN_00a58640(int param_1) { undefined4 uVar1; int in_ECX; if (in_ECX != param_1) { KAGE::SmartPointer::operator_assign(param_1); uVar1 = *(undefined4 *)(param_1 + 0xc); *(undefined4 *)(in_ECX + 8) = *(undefined4 *)(param_1 + 8); *(undefined4 *)(in_ECX + 0xc) = uVar1; *(undefined1 *)(in_ECX + 0x10) = *(undefined1 *)(param_1 + 0x10); } return; } //@@ 00a58670 FUN_00a58670 undefined8 FUN_00a58670(void) { longlong lVar1; longlong lVar2; int in_ECX; uint uVar3; uint uVar4; uint uVar5; ulonglong uVar6; uVar6 = GetTimeNs(); uVar4 = (uint)(uVar6 >> 0x20); lVar1 = (uVar6 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar4 * 0xd7b634db + ((uVar6 & 0xffffffff) * 0xd7b634db >> 0x20); uVar5 = (uint)((ulonglong)lVar2 >> 0x20); uVar3 = (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2); lVar1 = (ulonglong)uVar4 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar5,uVar3),uVar5 + uVar3); uVar4 = (uint)((ulonglong)lVar1 >> 0x20); uVar3 = (uint)lVar1 >> 0x12 | uVar4 * 0x4000; return CONCAT44(((uVar4 >> 0x12) - *(int *)(in_ECX + 0x24)) - (uint)(uVar3 < *(uint *)(in_ECX + 0x20)),uVar3 - *(uint *)(in_ECX + 0x20)); } //@@ 00a586f0 FUN_00a586f0 void FUN_00a586f0(byte param_1) { void *in_ECX; FUN_00a58860(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x40); } return; } //@@ 00a58720 FUN_00a58720 void FUN_00a58720(void) { int in_ECX; FUN_00a59be0((undefined4 *)(in_ECX + 4),*(undefined4 *)(*(int *)(in_ECX + 4) + 4)); operator_delete(*(void **)(in_ECX + 4),0x30); return; } //@@ 00a58740 FUN_00a58740 void FUN_00a58740(void *param_1) { undefined4 *this; int extraout_EAX; void *pvVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12b93; local_10 = ExceptionList; ExceptionList = &local_10; this = in_ECX + 3; *in_ECX = KAGE::Network::Multiplayer::ConnectionBase::vftable; *(undefined1 *)(in_ECX + 2) = 0; *this = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(param_1); in_ECX[4] = extraout_EAX; local_8 = 0; *this = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(this); } local_8 = 1; *(undefined2 *)(in_ECX + 5) = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 1; in_ECX[0xb] = 0; in_ECX[0xc] = 0; pvVar1 = operator_new(0x30); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0xb] = pvVar1; local_8 = CONCAT31(local_8._1_3_,2); in_ECX[0xd] = 1; in_ECX[0xe] = 0; in_ECX[0xf] = 0; pvVar1 = operator_new(0x30); *(void **)pvVar1 = pvVar1; *(void **)((int)pvVar1 + 4) = pvVar1; *(void **)((int)pvVar1 + 8) = pvVar1; *(undefined2 *)((int)pvVar1 + 0xc) = 0x101; in_ECX[0xe] = pvVar1; *(byte *)(in_ECX + 2) = *(byte *)(in_ECX + 2) | 1; ExceptionList = local_10; return; } //@@ 00a58860 FUN_00a58860 void FUN_00a58860(void) { int *piVar1; undefined4 *in_ECX; piVar1 = in_ECX + 0xe; *(byte *)(in_ECX + 2) = *(byte *)(in_ECX + 2) & 0xfe; *in_ECX = KAGE::Network::Multiplayer::ConnectionBase::vftable; FUN_00a59be0(piVar1,*(undefined4 *)(*piVar1 + 4)); operator_delete((void *)*piVar1,0x30); FUN_00a59be0(in_ECX + 0xb,*(undefined4 *)(in_ECX[0xb] + 4)); operator_delete((void *)in_ECX[0xb],0x30); in_ECX[3] = KAGE::System::UserProfileBase::vftable; return; } //@@ 00a588c0 KAGE::Network::Multiplayer::ConnectionBase::Update /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? slot 1 of the ConnectionBase/ConnectionLocalhost/ConnectionSteam/ConnectionEOS vftables (0xb9ed74, 0xba83a0/b8/d0; slot 0 0xa586f0 is the deleting dtor); periodically sends 'ping' with GetTimeNs ms, walks peer set (+0x2c) and pending list (+0x38) for timeouts */ void KAGE::Network::Multiplayer::ConnectionBase::Update(void) { int iVar1; longlong lVar2; longlong lVar3; longlong lVar4; ulonglong uVar5; int iVar6; char cVar7; uint uVar8; undefined4 extraout_ECX; uint uVar9; ulonglong uVar10; undefined8 uVar11; ulonglong uVar12; undefined1 auStackY_d8 [128]; int *piVar13; undefined4 local_2c; int local_28; int local_24; int local_20; int *local_1c; char local_18 [8]; undefined8 local_10; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); uVar10 = GetTimeNs(); uVar8 = (uint)(uVar10 >> 0x20); lVar2 = (uVar10 & 0xffffffff) * 0x431bde82; local_20 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0x431bde82; local_1c = (int *)lVar3; lVar4 = (ulonglong)uVar8 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); local_2c = (undefined4)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_20 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar9 = (uint)((ulonglong)lVar3 >> 0x20); uVar8 = (uint)lVar3 >> 0x12 | uVar9 * 0x4000; local_28 = ((uVar9 >> 0x12) - *(int *)(local_24 + 0x1c)) - (uint)(uVar8 < *(uint *)(local_24 + 0x18)); if ((local_28 != 0) || (1000 < uVar8 - *(uint *)(local_24 + 0x18))) { uVar10 = GetTimeNs(); uVar8 = (uint)(uVar10 >> 0x20); lVar2 = (uVar10 & 0xffffffff) * 0x431bde82; local_20 = (int)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar8 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); local_2c = (undefined4)(lVar3 + lVar2); lVar2 = (ulonglong)uVar8 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar3 >> 0x20), local_20 + (uint)CARRY4((uint)lVar2,(uint)lVar3)), (int)((ulonglong)(lVar3 + lVar2) >> 0x20)); uVar8 = (uint)((ulonglong)lVar2 >> 0x20); local_1c = (int *)(uVar8 >> 0x12); strncpy(local_18,"ping",4); local_10 = CONCAT44(local_1c,(uint)lVar2 >> 0x12 | uVar8 * 0x4000); FUN_00a2a030(local_24 + 0xc,extraout_ECX,local_18); uVar10 = GetTimeNs(); uVar8 = (uint)(uVar10 >> 0x20); lVar2 = (uVar10 & 0xffffffff) * 0x431bde82; lVar3 = (ulonglong)uVar8 * 0x431bde82; local_1c = (int *)lVar3; lVar4 = (ulonglong)uVar8 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20); local_2c = (undefined4)(lVar4 + lVar2); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)((ulonglong)lVar2 >> 0x20) + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar8 = (uint)((ulonglong)lVar3 >> 0x20); *(uint *)(local_24 + 0x18) = (uint)lVar3 >> 0x12 | uVar8 * 0x4000; *(uint *)(local_24 + 0x1c) = uVar8 >> 0x12; } local_20 = **(int **)(local_24 + 0x2c); if ((int *)local_20 != *(int **)(local_24 + 0x2c)) { do { iVar6 = local_20; uVar11 = FUN_00a585c0(); local_1c = (int *)uVar11; uVar8 = __ftoui3(); if (((int)((ulonglong)uVar11 >> 0x20) != 0) || (uVar8 < local_1c)) { FUN_00a5a2f0(); iVar1 = *(int *)(local_24 + 0x10); if (iVar1 == 0) { local_10 = 0; local_10._4_4_ = 0; local_10._0_4_ = 0; local_28 = local_10._4_4_; local_2c = (undefined4)local_10; } else { local_28 = *(int *)(iVar1 + 0xc); local_2c = *(undefined4 *)(iVar1 + 8); } piVar13 = (int *)0x0; local_1c = *(int **)(iVar6 + 0x18); if ((((*(int **)(iVar6 + 0x1c) != (int *)0x0) && (cVar7 = (**(code **)(**(int **)(iVar6 + 0x1c) + 4))(), cVar7 != '\0')) && (piVar13 != (int *)0x0)) && ((cVar7 = (**(code **)(*piVar13 + 0xc))(), cVar7 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStackY_d8 + 0x8c); } send_message(&local_2c,0); uVar12 = GetTimeNs(); uVar8 = (uint)(uVar12 >> 0x20); uVar10 = (uVar12 & 0xffffffff) * 0xd7b634db; lVar2 = (ulonglong)uVar8 * 0x431bde82; local_1c = (int *)lVar2; uVar5 = (ulonglong)uVar8 * 0xd7b634db + (uVar10 >> 0x20); local_10 = CONCAT44((int)((ulonglong)lVar2 >> 0x20),(int)uVar10); uVar9 = (uint)(uVar5 >> 0x20); uVar8 = (uint)((uVar12 & 0xffffffff) * 0x431bde82 + (uVar5 & 0xffffffff) >> 0x20); lVar2 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar9,uVar8),uVar9 + uVar8); uVar8 = (uint)((ulonglong)lVar2 >> 0x20); *(uint *)(iVar6 + 0x20) = (uint)lVar2 >> 0x12 | uVar8 * 0x4000; *(uint *)(iVar6 + 0x24) = uVar8 >> 0x12; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_20); } while (local_20 != *(int *)(local_24 + 0x2c)); } piVar13 = (int *)(local_24 + 0x38); local_20 = **(int **)(local_24 + 0x38); local_1c = piVar13; if ((int *)local_20 != *(int **)(local_24 + 0x38)) { do { if (*(char *)(local_20 + 0x14) == '\0') { uVar11 = FUN_00a585c0(); local_10 = CONCAT44((int)uVar11,(undefined4)local_10); uVar8 = __ftoui3(); piVar13 = local_1c; if (((int)((ulonglong)uVar11 >> 0x20) == 0) && (local_10._4_4_ <= uVar8)) goto LAB_00a58c1d; local_20 = FUN_00a598e0(); } else { LAB_00a58c1d: std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_20); } } while (local_20 != *piVar13); } return; } //@@ 00a58c40 FUN_00a58c40 void FUN_00a58c40(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 4) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 4) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } ExceptionList = local_10; return; } //@@ 00a58cb0 KAGE::Network::Connection::send_message /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? only caller FUN_00a78a10 (NetworkManager send: looks the peer's ConnectionBase up in a map, queues when absent, else calls this on it); timestamps with GetTimeNs/1e6, appends an "ackn" ack chunk when the reliable flag is set and acks are pending, sequence/fragment bookkeeping, SmartPointer */ undefined4 KAGE::Network::Connection::send_message(undefined4 param_1,uint *param_2,undefined4 param_3) { byte bVar1; ulonglong uVar2; longlong lVar3; longlong lVar4; int iVar5; uint *puVar6; uint *puVar7; char cVar8; undefined4 uVar9; int iVar10; int iVar11; int *piVar12; undefined4 in_ECX; uint uVar13; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; uint uVar14; ulonglong uVar15; uint **ppuVar16; undefined4 uVar17; undefined8 *puVar18; undefined1 local_68 [4]; int *local_64; undefined1 local_5c [4]; undefined4 local_58; uint local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined8 local_40; int local_38; int *local_34; undefined8 local_30; byte local_21; char local_20 [4]; uint *local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12c04; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; local_30 = CONCAT44(in_ECX,(undefined4)local_30); local_48 = param_1; local_1c = param_2; local_44 = param_3; local_4c = 0; uVar15 = GetTimeNs(); puVar6 = local_1c; uVar13 = (uint)(uVar15 >> 0x20); uVar2 = (uVar15 & 0xffffffff) * 0xd7b634db; lVar3 = (uVar15 & 0xffffffff) * 0x431bde82; local_40 = CONCAT44((int)((ulonglong)lVar3 >> 0x20),(int)uVar2); lVar4 = (ulonglong)uVar13 * 0x431bde82; local_50 = (undefined4)lVar4; uVar2 = (ulonglong)uVar13 * 0xd7b634db + (uVar2 >> 0x20); uVar14 = (uint)(uVar2 >> 0x20); lVar3 = lVar3 + (uVar2 & 0xffffffff); local_58 = (undefined4)lVar3; uVar13 = (uint)((ulonglong)lVar3 >> 0x20); lVar4 = lVar4 + (ulonglong)CONCAT14(CARRY4(uVar14,uVar13),uVar14 + uVar13); iVar5 = local_30._4_4_; uVar14 = (uint)((ulonglong)lVar4 >> 0x20); uVar13 = (uint)lVar4 >> 0x12 | uVar14 * 0x4000; *(uint *)(local_30._4_4_ + 0x20) = uVar13; *(uint *)(local_30._4_4_ + 0x24) = uVar14 >> 0x12; local_21 = (byte)local_1c[1] & 1; SmartPointer::reset(uVar13); local_8._0_1_ = 1; local_8._1_3_ = 0; if ((local_21 != 0) && (uVar13 = *(uint *)(iVar5 + 0x34), *puVar6 < uVar13)) { uVar17 = 4; strncpy(local_20,"ackn",4); local_1c = (uint *)(uVar13 - 1); FUN_00a2a030(iVar5 + 0xc,extraout_ECX,local_20,8,uVar17); uVar9 = local_48; SmartPointer::reset(extraout_ECX_00); local_8 = 2; goto LAB_00a5904c; } if (*(byte *)((int)puVar6 + 7) < 2) { local_1c = operator_new(0x20); local_8._0_1_ = 6; if (local_1c == (uint *)0x0) { uVar17 = 0; } else { iVar10 = *(int *)(iVar5 + 0x10); if (iVar10 == 0) { local_30._4_4_ = 0; local_30._0_4_ = 0; } else { local_30._0_4_ = *(undefined4 *)(iVar10 + 8); local_30._4_4_ = *(undefined4 *)(iVar10 + 0xc); } uVar17 = FUN_00a59d50(puVar6,local_44,&local_30); } local_8._0_1_ = 1; FUN_00915b40(uVar17); } else { local_30 = CONCAT44(CONCAT31(local_30._5_3_,local_21),*puVar6); FUN_00a595c0(&local_1c,&local_30); puVar7 = local_1c; if (local_1c == *(uint **)(iVar5 + 0x38)) { puVar18 = (undefined8 *)0x20; uVar17 = 0xa58e0b; local_1c = operator_new(0x20); local_8._0_1_ = 3; if (local_1c == (uint *)0x0) { uVar9 = 0; } else { iVar10 = *(int *)(iVar5 + 0x10); if (iVar10 == 0) { local_40._4_4_ = 0; local_40._0_4_ = 0; } else { local_40._0_4_ = *(undefined4 *)(iVar10 + 8); local_40._4_4_ = *(undefined4 *)(iVar10 + 0xc); } puVar18 = &local_40; uVar17 = local_44; uVar9 = FUN_00a59d50(puVar6,local_44,puVar18); } local_8._0_1_ = 1; FUN_00a2a690(uVar9); iVar10 = FUN_00a584d0(uVar17,puVar18); local_8 = CONCAT31(local_8._1_3_,4); iVar11 = FUN_00a595a0(&local_30); if (iVar11 != iVar10) { SmartPointer::operator_assign(iVar10); uVar17 = *(undefined4 *)(iVar10 + 0xc); *(undefined4 *)(iVar11 + 8) = *(undefined4 *)(iVar10 + 8); *(undefined4 *)(iVar11 + 0xc) = uVar17; *(undefined1 *)(iVar11 + 0x10) = *(undefined1 *)(iVar10 + 0x10); } local_8._0_1_ = 5; if (local_64 != (int *)0x0) { cVar8 = (**(code **)(*local_64 + 0xc))(); if ((cVar8 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_68); } } local_8._0_1_ = 1; } else { local_1c = (uint *)(local_1c[6] + 8); FUN_00a59d00(local_5c,(int)puVar6 + 6); if ((*(char *)(local_54 + 0xd) != '\0') || (*(byte *)((int)puVar6 + 6) < *(byte *)(local_54 + 0x10))) { local_54 = *local_1c; } if (local_54 == *(uint *)(puVar7[6] + 8)) { FUN_00a59ed0(puVar6,local_44); uVar13 = *(uint *)(puVar7[6] + 0xc); if ((uVar13 != 0) && (uVar13 == *(byte *)(*(int *)(**(int **)(puVar7[6] + 8) + 0x14) + 7))) { if ((char)puVar7[10] == '\0') { multiplayer_message_coalesce_fragments(0); SmartPointer::operator_assign(puVar7 + 6); } FUN_00a598e0(puVar7); } } } } uVar9 = local_48; uVar17 = 0; if (local_38 == 0) { LAB_00a59033: uVar9 = local_48; SmartPointer::reset(uVar17); local_8 = 9; } else { if (*(int *)(local_38 + 0xc) != 0) { piVar12 = *(int **)(**(int **)(local_38 + 8) + 0x14); bVar1 = *(byte *)(piVar12 + 1); if (((bVar1 & 1) != 0) && (iVar10 = *piVar12, iVar10 != *(int *)(iVar5 + 0x34))) { puVar18 = &local_30; local_30 = CONCAT35(local_30._5_3_,CONCAT14(bVar1,iVar10)) & 0xffffff01ffffffff; ppuVar16 = &local_1c; piVar12 = (int *)FUN_00a595c0(ppuVar16,puVar18); uVar17 = extraout_ECX_01; if (*piVar12 == *(int *)(iVar5 + 0x38)) { FUN_008ef1d0(&local_38); uVar17 = FUN_00a584d0(ppuVar16,puVar18); local_8._0_1_ = 8; FUN_00a595a0(&local_30); FUN_00a58640(uVar17); local_8._0_1_ = 1; FUN_00a58c40(); uVar17 = extraout_ECX_02; } goto LAB_00a59033; } if ((*(byte *)(*(int *)(**(int **)(local_38 + 8) + 0x14) + 4) & 1) != 0) { *(int *)(iVar5 + 0x34) = *(int *)(iVar5 + 0x34) + 1; } } FUN_008ef1d0(&local_38); local_8 = 7; } LAB_00a5904c: local_4c = 1; if (local_34 != (int *)0x0) { cVar8 = (**(code **)(*local_34 + 0xc))(); if ((cVar8 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_38); } } ExceptionList = local_10; return uVar9; } //@@ 00a590c0 FUN_00a590c0 undefined4 FUN_00a590c0(undefined4 param_1) { uint uVar1; char cVar2; int *piVar3; int iVar4; undefined4 uVar5; int in_ECX; undefined1 local_28 [4]; int *local_24; undefined4 local_20; undefined1 local_1c; undefined1 local_18 [4]; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12c56; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = 0; KAGE::SmartPointer::reset(in_ECX); local_8 = 1; local_20 = *(undefined4 *)(in_ECX + 0x34); local_1c = 1; piVar3 = (int *)FUN_00a595c0(local_18,&local_20); if (*piVar3 != *(int *)(in_ECX + 0x38)) { piVar3 = (int *)FUN_00a595a0(&local_20); uVar1 = *(uint *)(*piVar3 + 0xc); if ((uVar1 != 0) && (uVar1 == *(byte *)(*(int *)(**(int **)(*piVar3 + 8) + 0x14) + 7))) { *(int *)(in_ECX + 0x34) = *(int *)(in_ECX + 0x34) + 1; iVar4 = FUN_00a595a0(&local_20); if (*(char *)(iVar4 + 0x10) != '\0') { std::map::erase(&local_20); FUN_00a590c0(param_1); local_8 = 2; goto LAB_00a591b8; } uVar5 = FUN_00a595a0(&local_20); KAGE::SmartPointer::operator_assign(uVar5); std::map::erase(&local_20); } } FUN_008ef1d0(local_28); local_8 = 3; LAB_00a591b8: local_14 = 1; if (local_24 != (int *)0x0) { cVar2 = (**(code **)(*local_24 + 0xc))(); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_28); } } ExceptionList = local_10; return param_1; } //@@ 00a59200 FUN_00a59200 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a59200(void) { int iVar1; int in_ECX; undefined4 extraout_ECX; undefined4 uVar2; char local_10 [4]; int local_c; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10 + 0xc); uVar2 = 4; iVar1 = *(int *)(in_ECX + 0x34); strncpy(local_10,"ackn",4); local_c = iVar1 + -1; FUN_00a2a030(in_ECX + 0xc,extraout_ECX,local_10,8,uVar2); return; } //@@ 00a59250 FUN_00a59250 void FUN_00a59250(void) { int in_ECX; *(byte *)(in_ECX + 8) = *(byte *)(in_ECX + 8) | 1; return; } //@@ 00a59260 FUN_00a59260 void FUN_00a59260(void) { int in_ECX; *(byte *)(in_ECX + 8) = *(byte *)(in_ECX + 8) & 0xfe; return; } //@@ 00a59270 KAGE::Network::Multiplayer::ConnectionBase::handle_internal_message /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ConnectionBase vtable slot 4 (shared by ConnectionLocalhost/Steam/EOS): "This function should only be called on consolidated messages", answers "ping" with "pong" (FUN_00a2a030 send), on "pong" computes RTT from GetTimeNs into the peer profile, handles "ackn" */ undefined4 KAGE::Network::Multiplayer::ConnectionBase::handle_internal_message (undefined4 *param_1,int *param_2) { undefined4 uVar1; undefined4 uVar2; ulonglong uVar3; longlong lVar4; longlong lVar5; longlong lVar6; char cVar7; int iVar8; uint extraout_EAX; byte *pbVar9; uint in_ECX; uint extraout_ECX; uint uVar10; uint extraout_ECX_00; uint uVar11; undefined4 *puVar12; bool bVar13; ulonglong uVar14; undefined **local_38; uint local_34; undefined4 local_30; int local_2c; uint local_28; char local_24 [8]; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puVar12 = param_1; puStack_c = &LAB_00b12c9d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; local_8 = 0; local_34 = in_ECX; if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar8 = strncmp((char *)(*(int *)(*(int *)puVar12[2] + 0x14) + 8),"ping",4); puVar12 = param_1; if (iVar8 == 0) { if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar8 = *(int *)(*(int *)puVar12[2] + 0x14); uVar1 = *(undefined4 *)(iVar8 + 0x10); uVar2 = *(undefined4 *)(iVar8 + 0x14); strncpy(local_24,"pong",4); local_30 = *param_1; local_2c = param_1[1]; local_38 = System::UserProfileBase::vftable; local_1c = uVar1; local_18 = uVar2; UserProfile::find_or_create(&local_30); local_8._0_1_ = 1; local_38 = System::UserProfile::vftable; uVar10 = extraout_ECX; local_34 = extraout_EAX; if (((extraout_EAX != 0) && (uVar10 = *(uint *)(extraout_EAX + 8) | *(uint *)(extraout_EAX + 0xc), uVar10 != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_38); uVar10 = extraout_ECX_00; } local_8 = CONCAT31(local_8._1_3_,2); FUN_00a2a030(&local_38,uVar10,local_24,0x10,uVar10); local_8 = 3; } else { if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar8 = strncmp((char *)(*(int *)(*(int *)puVar12[2] + 0x14) + 8),"pong",4); puVar12 = param_1; if (iVar8 == 0) { uVar14 = GetTimeNs(); puVar12 = param_1; uVar10 = (uint)(uVar14 >> 0x20); uVar3 = (uVar14 & 0xffffffff) * 0xd7b634db; local_30 = (undefined4)uVar3; lVar4 = (uVar14 & 0xffffffff) * 0x431bde82; local_2c = (int)((ulonglong)lVar4 >> 0x20); lVar5 = (ulonglong)uVar10 * 0x431bde82; local_28 = (uint)lVar5; lVar6 = (ulonglong)uVar10 * 0xd7b634db + (uVar3 >> 0x20); local_1c = (undefined4)(lVar6 + lVar4); uVar10 = local_2c + (uint)CARRY4((uint)lVar4,(uint)lVar6); uVar11 = (uint)((ulonglong)(lVar6 + lVar4) >> 0x20); bVar13 = CARRY4(local_28,uVar11); iVar8 = local_28 + uVar11; if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages") ; } *(ushort *)(local_34 + 0x14) = ((ushort)((uint)iVar8 >> 0x12) | ((short)((ulonglong)lVar5 >> 0x20) + (ushort)CARRY4((uint)((ulonglong)lVar6 >> 0x20),uVar10) + (ushort)bVar13) * 0x4000) - *(short *)(*(int *)(*(int *)puVar12[2] + 0x14) + 0x10); local_8 = 4; } else { if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages") ; } iVar8 = strncmp((char *)(*(int *)(*(int *)puVar12[2] + 0x14) + 8),"ackn",4); puVar12 = param_1; if (iVar8 != 0) { local_8 = 6; if (((param_2 != (int *)0x0) && (cVar7 = (**(code **)(*param_2 + 0xc))(), cVar7 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } ExceptionList = local_10; return 0; } if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages") ; } local_34 = *(uint *)(*(int *)(*(int *)puVar12[2] + 0x14) + 0xc); local_28 = **(int **)(in_ECX + 0x2c); puVar12 = param_1; if ((int *)local_28 != *(int **)(in_ECX + 0x2c)) { do { uVar10 = local_28; if (local_34 < *(uint *)(local_28 + 0x10)) { std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_28); } else { local_30 = *puVar12; local_2c = puVar12[1]; pbVar9 = map_u64_bool_subscript ((void *)(*(int *)(local_28 + 0x18) + 0x18),(ulonglong *)&local_30); *pbVar9 = 1; local_28 = FUN_00a598e0(uVar10); puVar12 = param_1; } } while (local_28 != *(uint *)(in_ECX + 0x2c)); } local_8 = 5; } } if (((param_2 != (int *)0x0) && (cVar7 = (**(code **)(*param_2 + 0xc))(), cVar7 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } ExceptionList = local_10; return 1; } //@@ 00a595a0 FUN_00a595a0 int FUN_00a595a0(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x18; } //@@ 00a595c0 FUN_00a595c0 void FUN_00a595c0(int *param_1,uint *param_2) { int *in_ECX; undefined1 local_18 [8]; int local_10; FUN_00a59c90(local_18,param_2); if (*(char *)(local_10 + 0xd) == '\0') { if ((*(uint *)(local_10 + 0x10) <= *param_2) && ((*(uint *)(local_10 + 0x10) < *param_2 || (*(byte *)(local_10 + 0x14) <= (byte)param_2[1]))) ) { *param_1 = local_10; return; } } *param_1 = *in_ECX; return; } //@@ 00a59640 std::map::erase /* DB: ? equal_range on the same {uint, byte} key as 00a59970, erase(first,last) with clear fast path (FUN_00a59be0 erase-tree when range is whole map); called twice from FUN_00a590c0 */ int std::map::erase(uint *param_1) { int *piVar1; uint uVar2; uint uVar3; char cVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int *piVar7; int *piVar8; int *piVar9; int iVar10; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1690; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)*in_ECX; piVar5 = (int *)piVar1[1]; piVar8 = piVar1; piVar9 = piVar1; if (*(char *)((int)piVar5 + 0xd) == '\0') { uVar2 = *param_1; piVar6 = piVar5; do { uVar3 = piVar6[4]; if ((uVar2 < uVar3) || ((uVar2 <= uVar3 && ((byte)param_1[1] <= *(byte *)(piVar6 + 5))))) { if (*(char *)((int)piVar8 + 0xd) != '\0') { if ((uVar2 <= uVar3) && ((uVar2 < uVar3 || ((byte)param_1[1] < *(byte *)(piVar6 + 5))))) { piVar8 = piVar6; } } piVar7 = (int *)*piVar6; piVar9 = piVar6; } else { piVar7 = (int *)piVar6[2]; } piVar6 = piVar7; } while (*(char *)((int)piVar7 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar5 = (int *)*piVar8; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[4] < *param_1) || (((uint)piVar5[4] <= *param_1 && (*(byte *)(piVar5 + 5) <= (byte)param_1[1])))) { piVar6 = (int *)piVar5[2]; } else { piVar6 = (int *)*piVar5; piVar8 = piVar5; } piVar5 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } iVar10 = 0; local_18 = 0; piVar5 = piVar9; if (piVar9 != piVar8) { do { piVar6 = (int *)piVar5[2]; iVar10 = iVar10 + 1; if (*(char *)((int)piVar6 + 0xd) == '\0') { cVar4 = *(char *)(*piVar6 + 0xd); piVar5 = piVar6; piVar6 = (int *)*piVar6; while (cVar4 == '\0') { cVar4 = *(char *)(*piVar6 + 0xd); piVar5 = piVar6; piVar6 = (int *)*piVar6; } } else { cVar4 = *(char *)(piVar5[1] + 0xd); piVar7 = (int *)piVar5[1]; piVar6 = piVar5; while ((piVar5 = piVar7, cVar4 == '\0' && (piVar6 == (int *)piVar5[2]))) { cVar4 = *(char *)(piVar5[1] + 0xd); piVar7 = (int *)piVar5[1]; piVar6 = piVar5; } } } while (piVar5 != piVar8); local_18 = iVar10; } param_1 = (uint *)piVar9; if ((piVar9 == (int *)*piVar1) && (*(char *)((int)piVar8 + 0xd) != '\0')) { FUN_00a59be0(in_ECX,piVar1[1]); piVar1[1] = (int)piVar1; *piVar1 = (int)piVar1; piVar1[2] = (int)piVar1; in_ECX[1] = 0; } else if (piVar9 != piVar8) { do { piVar1 = (int *)param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar1); local_8 = 0; if (((*(int **)((int)ptr + 0x1c) != (int *)0x0) && (cVar4 = (**(code **)(**(int **)((int)ptr + 0x1c) + 0xc))(), cVar4 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)((int)ptr + 0x18); } local_8 = 0xffffffff; operator_delete(ptr,0x30); } while (param_1 != (uint *)piVar8); ExceptionList = local_10; return local_18; } ExceptionList = local_10; return local_18; } //@@ 00a59850 KAGE::SmartPointer::operator_assign /* DB: ? copy-and-swap: temp via FUN_008ef1d0 (copy ctor), swaps both words with ECX, releases the old refcount via g_multiplayerRelease; NetConnection::send_message, NetworkManager::receive_message */ void KAGE::SmartPointer::operator_assign(undefined4 param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; undefined4 *in_ECX; undefined1 local_1c [4]; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined4 *)FUN_008ef1d0(param_1); uVar1 = puVar4[1]; puVar4[1] = in_ECX[1]; in_ECX[1] = uVar1; uVar1 = *puVar4; *puVar4 = *in_ECX; *in_ECX = uVar1; local_8 = 0; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_1c); } } ExceptionList = local_10; return; } //@@ 00a598e0 FUN_00a598e0 void * FUN_00a598e0(void *param_1) { char cVar1; uint uVar2; void *ptr; void *in_ECX; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1360; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_14 = param_1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); ptr = std_tree_extract(in_ECX,param_1); local_8 = 0; if (*(int **)((int)ptr + 0x1c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)ptr + 0x1c) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)((int)ptr + 0x18); } } operator_delete(ptr,0x30); ExceptionList = local_10; return local_14; } //@@ 00a59970 std::map::try_emplace /* DB: ? MSVC _Tree insert keyed by {uint seq, byte channel} (compares +0x10 then byte), max_size 0x5555555 (0x30 nodes), value holds a KAGE::SmartPointer and GetTimeNs() send time; caller FUN_00a595a0 (net reliable-message queue; neighbour FUN_00a58cb0 handles 'ackn') */ void std::map::try_emplace(undefined4 *param_1,uint *param_2) { char cVar1; int *piVar2; int *piVar3; ulonglong uVar4; longlong lVar5; longlong lVar6; uint uVar7; int *in_ECX; int *piVar8; int *piVar9; int *piVar10; ulonglong uVar11; undefined4 uVar12; int *local_40; int local_3c; int *local_38; undefined4 local_34; int *local_24; int *local_20; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12ce5; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_20 = in_ECX; FUN_00a59c90(&local_40,param_2); if (*(char *)((int)local_38 + 0xd) == '\0') { local_18 = (uint)*(byte *)(local_38 + 5); local_14 = (uint)(byte)param_2[1]; if (((uint)local_38[4] <= *param_2) && (((uint)local_38[4] < *param_2 || (local_18 <= local_14)))) { *(undefined1 *)(param_1 + 1) = 0; piVar9 = local_38; goto LAB_00a59bbb; } } if (in_ECX[1] == 0x5555555) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar7); } local_14 = *in_ECX; local_8 = 0; uVar12 = 0x30; local_24 = (int *)0x0; local_24 = operator_new(0x30); local_8 = 1; uVar7 = param_2[1]; local_24[4] = *param_2; local_24[5] = uVar7; KAGE::SmartPointer::reset(uVar12); uVar11 = GetTimeNs(); piVar9 = local_24; uVar7 = (uint)(uVar11 >> 0x20); uVar4 = (uVar11 & 0xffffffff) * 0xd7b634db; local_1c = (undefined4)uVar4; lVar5 = (uVar11 & 0xffffffff) * 0x431bde82; local_18 = (uint)((ulonglong)lVar5 >> 0x20); lVar6 = (ulonglong)uVar7 * 0xd7b634db + (uVar4 >> 0x20); local_34 = (undefined4)(lVar6 + lVar5); lVar5 = (ulonglong)uVar7 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar6 >> 0x20), local_18 + CARRY4((uint)lVar5,(uint)lVar6)), (int)((ulonglong)(lVar6 + lVar5) >> 0x20)); uVar7 = (uint)((ulonglong)lVar5 >> 0x20); local_24[8] = (uint)lVar5 >> 0x12 | uVar7 * 0x4000; *(undefined1 *)(local_24 + 10) = 0; local_24[9] = uVar7 >> 0x12; *local_24 = local_14; local_24[1] = local_14; local_24[2] = local_14; *(undefined2 *)(local_24 + 3) = 0; piVar2 = (int *)*local_20; local_20[1] = local_20[1] + 1; local_24[1] = (int)local_40; if (local_40 == piVar2) { *piVar2 = (int)local_24; piVar2[1] = (int)local_24; piVar2[2] = (int)local_24; *(undefined1 *)(local_24 + 3) = 1; } else { if (local_3c == 0) { local_40[2] = (int)local_24; if (local_40 == (int *)piVar2[2]) { piVar2[2] = (int)local_24; } } else { *local_40 = (int)local_24; if (local_40 == (int *)*piVar2) { *piVar2 = (int)local_24; } } cVar1 = *(char *)(local_24[1] + 0xc); piVar10 = local_24; while (cVar1 == '\0') { piVar3 = (int *)piVar10[1]; piVar8 = *(int **)piVar3[1]; if (piVar3 == piVar8) { piVar8 = (int *)((undefined4 *)piVar3[1])[2]; if ((char)piVar8[3] == '\0') { LAB_00a59b5b: *(undefined1 *)(piVar3 + 3) = 1; *(undefined1 *)(piVar8 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar3[2]) { FUN_00415fe0(piVar3); piVar10 = piVar3; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar8[3] == '\0') goto LAB_00a59b5b; if (piVar10 == (int *)*piVar3) { FUN_00415f80(piVar3); piVar10 = piVar3; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar1 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *(undefined1 *)(param_1 + 1) = 1; LAB_00a59bbb: *param_1 = piVar9; ExceptionList = local_10; return; } //@@ 00a59be0 FUN_00a59be0 void FUN_00a59be0(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { FUN_00a59be0(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[7] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[7] + 0xc))(uVar4), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(param_2 + 6); } local_8 = 0xffffffff; operator_delete(param_2,0x30); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 00a59c90 FUN_00a59c90 int * FUN_00a59c90(int *param_1,uint *param_2) { char cVar1; byte bVar2; uint uVar3; uint uVar4; uint uVar5; int iVar6; int *in_ECX; undefined4 *puVar7; iVar6 = *in_ECX; puVar7 = *(undefined4 **)(iVar6 + 4); *param_1 = (int)puVar7; param_1[1] = 0; cVar1 = *(char *)((int)puVar7 + 0xd); param_1[2] = iVar6; if (cVar1 == '\0') { uVar3 = *param_2; uVar5 = param_2[1]; do { bVar2 = *(byte *)(puVar7 + 5); uVar4 = puVar7[4]; *param_1 = (int)puVar7; if ((uVar3 < uVar4) || ((uVar3 <= uVar4 && ((byte)uVar5 <= bVar2)))) { param_1[2] = (int)puVar7; iVar6 = 1; puVar7 = (undefined4 *)*puVar7; } else { puVar7 = (undefined4 *)puVar7[2]; iVar6 = 0; } param_1[1] = iVar6; } while (*(char *)((int)puVar7 + 0xd) == '\0'); } return param_1; } //@@ 00a59d00 FUN_00a59d00 int * FUN_00a59d00(int *param_1,byte *param_2) { byte bVar1; byte bVar2; int iVar3; undefined4 *puVar4; int *in_ECX; iVar3 = *in_ECX; puVar4 = *(undefined4 **)(iVar3 + 4); *param_1 = (int)puVar4; param_1[1] = 0; param_1[2] = iVar3; if (*(char *)((int)puVar4 + 0xd) == '\0') { bVar1 = *param_2; do { *param_1 = (int)puVar4; bVar2 = *(byte *)(puVar4 + 4); if (bVar1 <= bVar2) { param_1[2] = (int)puVar4; puVar4 = (undefined4 *)*puVar4; } else { puVar4 = (undefined4 *)puVar4[2]; } param_1[1] = (uint)(bVar1 <= bVar2); } while (*(char *)((int)puVar4 + 0xd) == '\0'); } return param_1; } //@@ 00a59d50 FUN_00a59d50 void FUN_00a59d50(undefined4 param_1,undefined4 param_2,undefined4 *param_3) { undefined4 uVar1; void *pvVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12d36; local_10 = ExceptionList; ExceptionList = &local_10; uVar1 = param_3[1]; *in_ECX = *param_3; in_ECX[1] = uVar1; in_ECX[2] = 0; in_ECX[3] = 0; pvVar2 = operator_new(0x1c); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; in_ECX[2] = pvVar2; in_ECX[4] = 0; in_ECX[5] = 0; local_8 = 1; in_ECX[6] = 0; in_ECX[7] = 0; pvVar2 = operator_new(0x20); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; in_ECX[6] = pvVar2; local_8 = CONCAT31(local_8._1_3_,2); FUN_00a59ed0(param_1,param_2); ExceptionList = local_10; return; } //@@ 00a59e20 FUN_00a59e20 int FUN_00a59e20(void) { int in_ECX; if (*(int *)(in_ECX + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } return *(int *)(**(int **)(in_ECX + 8) + 0x14) + 8; } //@@ 00a59e50 FUN_00a59e50 void FUN_00a59e50(int *param_1) { int *piVar1; int in_ECX; if (*(int *)(in_ECX + 0xc) != 0) { piVar1 = *(int **)(**(int **)(in_ECX + 8) + 0x14); if (*param_1 != *piVar1) { KAGE_LogMessage(0x10,(byte *)"Inconsistent message ID"); } if ((char)param_1[1] != (char)piVar1[1]) { KAGE_LogMessage(0x10,(byte *)"Inconsistent message flags"); } if (*(char *)((int)param_1 + 5) != *(char *)((int)piVar1 + 5)) { KAGE_LogMessage(0x10,(byte *)"Inconsistent message channel"); } if (*(char *)((int)param_1 + 7) != *(char *)((int)piVar1 + 7)) { KAGE_LogMessage(0x10,(byte *)"Inconsistent message total count"); } } return; } //@@ 00a59ed0 FUN_00a59ed0 void FUN_00a59ed0(int param_1,int param_2) { byte *pbVar1; int *piVar2; int in_ECX; undefined1 local_14 [8]; int local_c; pbVar1 = (byte *)(param_1 + 6); FUN_00a59d00(local_14,pbVar1); if (((*(char *)(local_c + 0xd) != '\0') || (*pbVar1 < *(byte *)(local_c + 0x10))) || (local_c == *(int *)(in_ECX + 8))) { FUN_00a59e50(param_1); piVar2 = (int *)FUN_00a5a360(pbVar1); *piVar2 = param_1; piVar2[1] = param_2; } return; } //@@ 00a59f30 FUN_00a59f30 void FUN_00a59f30(undefined4 *param_1,void *param_2,size_t param_3) { undefined4 uVar1; undefined4 *puVar2; undefined4 *puVar3; int in_ECX; undefined1 local_14 [8]; int local_c; FUN_00a59d00(local_14,(byte *)((int)param_1 + 6)); if (((*(char *)(local_c + 0xd) != '\0') || (*(byte *)((int)param_1 + 6) < *(byte *)(local_c + 0x10))) || (local_c == *(int *)(in_ECX + 8))) { FUN_00a59e50(param_1); puVar2 = tracked_alloc(0,(void *)0x0,(ulonglong)(param_3 + 8)); uVar1 = *param_1; puVar2[1] = param_1[1]; *puVar2 = uVar1; memcpy(puVar2 + 2,param_2,param_3); puVar3 = (undefined4 *)FUN_00a5a360((int)param_1 + 6); *puVar3 = puVar2; puVar3[1] = param_3 + 8; } return; } //@@ 00a59fd0 multiplayer_message_coalesce_fragments /* DB: ? walks a std::map of fragments (ECX+8), mallocs total size + 4 through the tracked heap (oom handlers), writes an 8-byte header then memcpy's each fragment payload (minus 8-byte header); from multiplayer_send_message and FUN_00a58cb0 */ void multiplayer_message_coalesce_fragments(uint *param_1) { char cVar1; undefined4 uVar2; qword qVar3; int iVar4; undefined4 *puVar5; int *piVar6; uint uVar7; uint *puVar8; undefined4 *puVar9; int in_ECX; uint _Size; int *piVar10; int *piVar11; qword *pqVar12; undefined4 *puVar13; bool bVar14; void *local_2c; int local_28; void *local_24; undefined4 *local_20; int local_1c; int local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12d6d; local_10 = ExceptionList; uVar7 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_1c = in_ECX; if (param_1 != (uint *)0x0) { local_1c = (int)param_1; } local_14 = 8; puVar13 = (undefined4 *)**(undefined4 **)(in_ECX + 8); while (puVar13 != *(undefined4 **)(in_ECX + 8)) { local_14 = local_14 + puVar13[6] + -8; puVar9 = (undefined4 *)puVar13[2]; if (*(char *)((int)puVar9 + 0xd) == '\0') { cVar1 = *(char *)((int)*puVar9 + 0xd); puVar13 = puVar9; puVar9 = (undefined4 *)*puVar9; while (cVar1 == '\0') { cVar1 = *(char *)((int)*puVar9 + 0xd); puVar13 = puVar9; puVar9 = (undefined4 *)*puVar9; } } else { cVar1 = *(char *)((int)puVar13[1] + 0xd); puVar5 = (undefined4 *)puVar13[1]; puVar9 = puVar13; while ((puVar13 = puVar5, cVar1 == '\0' && (puVar9 == (undefined4 *)puVar13[2]))) { cVar1 = *(char *)((int)puVar13[1] + 0xd); puVar5 = (undefined4 *)puVar13[1]; puVar9 = puVar13; } } } if (g_mainHeap == (void *)0x0) { pqVar12 = &g_allocatedBytesNoHeap; } else { pqVar12 = (qword *)((int)g_mainHeap + 0x30); } bVar14 = 0xfffffffb < local_14; _Size = local_14 + 4; local_18 = in_ECX; puVar8 = malloc(_Size); if (puVar8 == (uint *)0x0) { piVar10 = *(int **)g_memoryManager_oomHandlers; if (piVar10 != g_memoryManager_oomHandlers) { do { (*(code *)piVar10[2])(0x7fcb9dd6,piVar10[3],uVar7); piVar10 = (int *)*piVar10; } while (piVar10 != g_memoryManager_oomHandlers); } param_1 = (uint *)0x0; } else { *puVar8 = _Size; param_1 = puVar8 + 1; qVar3 = *pqVar12; *(uint *)pqVar12 = (uint)*pqVar12 + _Size; *(uint *)((int)pqVar12 + 4) = *(uint *)((int)pqVar12 + 4) + (uint)bVar14 + (uint)CARRY4((uint)qVar3,_Size); } puVar8 = param_1 + 2; piVar10 = *(int **)(local_18 + 8); uVar7 = **(uint **)(*piVar10 + 0x14); param_1[1] = (*(uint **)(*piVar10 + 0x14))[1]; *param_1 = uVar7; *(undefined1 *)((int)param_1 + 6) = 0; piVar11 = (int *)*piVar10; if (piVar11 != piVar10) { do { memcpy(puVar8,(void *)(piVar11[5] + 8),piVar11[6] - 8); puVar8 = (uint *)((int)puVar8 + piVar11[6] + -8); piVar10 = (int *)piVar11[2]; if (*(char *)((int)piVar10 + 0xd) == '\0') { cVar1 = *(char *)(*piVar10 + 0xd); piVar11 = piVar10; piVar10 = (int *)*piVar10; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar10 + 0xd); piVar11 = piVar10; piVar10 = (int *)*piVar10; } } else { cVar1 = *(char *)(piVar11[1] + 0xd); piVar6 = (int *)piVar11[1]; piVar10 = piVar11; while ((piVar11 = piVar6, cVar1 == '\0' && (piVar10 == (int *)piVar11[2]))) { cVar1 = *(char *)(piVar11[1] + 0xd); piVar6 = (int *)piVar11[1]; piVar10 = piVar11; } } } while (piVar11 != *(int **)(local_18 + 8)); } iVar4 = local_1c; puVar8 = param_1; FUN_00a5a210(); param_1 = (uint *)((uint)param_1 & 0xffffff); puVar13 = (undefined4 *)(iVar4 + 8); FUN_00a59d00(&local_2c,(int)¶m_1 + 3); if ((*(char *)((int)local_24 + 0xd) != '\0') || (*(char *)((int)local_24 + 0x10) != '\0')) { if (*(int *)(iVar4 + 0xc) == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(); } uVar2 = *puVar13; local_8 = 0; local_1c = 0; local_20 = puVar13; puVar9 = operator_new(0x1c); *(undefined1 *)(puVar9 + 4) = param_1._3_1_; *puVar9 = uVar2; puVar9[1] = uVar2; puVar9[2] = uVar2; *(undefined2 *)(puVar9 + 3) = 0; local_24 = std::_Tree::_Insert_node(puVar13,local_2c,local_28,puVar9); } *(uint **)((int)local_24 + 0x14) = puVar8; *(uint *)((int)local_24 + 0x18) = local_14; ExceptionList = local_10; return; } //@@ 00a5a210 FUN_00a5a210 void FUN_00a5a210(void) { undefined4 *this; char cVar1; int iVar2; uint uVar3; qword qVar4; int *piVar5; int in_ECX; qword *pqVar6; int *piVar7; int *piVar8; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; piVar8 = *(int **)(in_ECX + 8); this = (undefined4 *)(in_ECX + 8); piVar7 = (int *)*piVar8; if (piVar7 != piVar8) { do { iVar2 = piVar7[5]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar3; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); } piVar8 = (int *)piVar7[2]; if (*(char *)((int)piVar8 + 0xd) == '\0') { cVar1 = *(char *)(*piVar8 + 0xd); piVar7 = piVar8; piVar8 = (int *)*piVar8; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar8 + 0xd); piVar7 = piVar8; piVar8 = (int *)*piVar8; } } else { cVar1 = *(char *)(piVar7[1] + 0xd); piVar5 = (int *)piVar7[1]; piVar8 = piVar7; while ((piVar7 = piVar5, cVar1 == '\0' && (piVar8 == (int *)piVar7[2]))) { cVar1 = *(char *)(piVar7[1] + 0xd); piVar5 = (int *)piVar7[1]; piVar8 = piVar7; } } piVar8 = (int *)*this; } while (piVar7 != piVar8); } FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, (_Tree_node *)piVar8[1]); piVar8[1] = (int)piVar8; *piVar8 = (int)piVar8; piVar8[2] = (int)piVar8; *(undefined4 *)(in_ECX + 0xc) = 0; ExceptionList = local_10; return; } //@@ 00a5a2f0 FUN_00a5a2f0 void FUN_00a5a2f0(undefined4 param_1) { char cVar1; int *piVar2; int *piVar3; int *piVar4; int in_ECX; piVar4 = (int *)**(int **)(in_ECX + 8); if (piVar4 != *(int **)(in_ECX + 8)) { do { *(undefined4 *)piVar4[5] = param_1; piVar2 = (int *)piVar4[2]; if (*(char *)((int)piVar2 + 0xd) == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar4 = piVar2; piVar2 = (int *)*piVar2; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar2 + 0xd); piVar4 = piVar2; piVar2 = (int *)*piVar2; } } else { cVar1 = *(char *)(piVar4[1] + 0xd); piVar3 = (int *)piVar4[1]; piVar2 = piVar4; while ((piVar4 = piVar3, cVar1 == '\0' && (piVar2 == (int *)piVar4[2]))) { cVar1 = *(char *)(piVar4[1] + 0xd); piVar3 = (int *)piVar4[1]; piVar2 = piVar4; } } } while (piVar4 != *(int **)(in_ECX + 8)); } return; } //@@ 00a5a360 FUN_00a5a360 int FUN_00a5a360(byte *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12d9d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00a59d00(&local_24,param_1); if ((*(char *)((int)local_1c + 0xd) != '\0') || (*param_1 < *(byte *)((int)local_1c + 0x10))) { if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x1c); *(byte *)(newNode + 4) = *param_1; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(in_ECX,local_24,local_20,newNode); } ExceptionList = local_10; return (int)local_1c + 0x14; } //@@ 00a5a420 FUN_00a5a420 void FUN_00a5a420(void) { byte *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; if (((*in_ECX & 4) == 0) && (*(void **)(in_ECX + 4) != (void *)0x0)) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 4),0); in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[7] = 0; } ExceptionList = local_10; return; } //@@ 00a5a490 FUN_00a5a490 void FUN_00a5a490(byte param_1) { void *in_ECX; KAGE::Thread::~Thread(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a5a4c0 KAGE::Thread::~Thread /* DB: sets Thread::vftable, joins (WaitForSingleObject INFINITE + CloseHandle) the 0x28-byte native thread block at +8, deletes its critical section, then ThreadBase::vftable prototype: db/protos.zhl */ void __thiscall KAGE::Thread::~Thread(void *this) { undefined4 *puVar1; void *ptr; char cVar2; puVar1 = *(undefined4 **)((int)this + 8); *(undefined ***)this = vftable; if (puVar1 != (undefined4 *)0x0) { cVar2 = FUN_00a7f1e0(); if (cVar2 != '\0') { WaitForSingleObject((HANDLE)*puVar1,0xffffffff); CloseHandle((HANDLE)*puVar1); } ptr = *(void **)((int)this + 8); if (ptr != (void *)0x0) { cVar2 = FUN_00a7f1e0(); if (cVar2 != '\0') { /* WARNING: Subroutine does not return */ terminate(); } DeleteCriticalSection((LPCRITICAL_SECTION)((int)ptr + 4)); operator_delete(ptr,0x28); *(undefined4 *)((int)this + 8) = 0; } } *(undefined ***)this = ThreadBase::vftable; return; } //@@ 00a5a530 FUN_00a5a530 void FUN_00a5a530(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { char cVar1; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0x10))(); if (cVar1 != '\0') { KAGE_LogMessage(0x10,(byte *)"Thread is already running\n"); } (**(code **)(*in_ECX + 4))(param_1,param_2,0xffffffff,param_3,param_4); return; } //@@ 00a5a570 FUN_00a5a570 bool FUN_00a5a570(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { LPCRITICAL_SECTION lpCriticalSection; uint uVar1; char cVar2; uintptr_t *puVar3; undefined4 *puVar4; undefined4 *_ArgList; uintptr_t uVar5; int nPriority; BOOL BVar6; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12de7; local_10 = ExceptionList; ExceptionList = &local_10; cVar2 = (**(code **)(*in_ECX + 0x10))(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar2 != '\0') { KAGE_LogMessage(0x10,(byte *)"Thread is already running\n"); } (**(code **)(*in_ECX + 0xc))(); puVar3 = operator_new(0x28); local_8 = 0; if (puVar3 == (uintptr_t *)0x0) { puVar3 = (uintptr_t *)0x0; } else { puVar4 = operator_new(0xc); if (puVar4 == (undefined4 *)0x0) { puVar4 = (undefined4 *)0x0; } else { puVar4[1] = param_1; *puVar4 = in_ECX; puVar4[2] = param_5; } lpCriticalSection = (LPCRITICAL_SECTION)(puVar3 + 1); *(undefined1 *)(puVar3 + 7) = 0; InitializeCriticalSection(lpCriticalSection); EnterCriticalSection(lpCriticalSection); cVar2 = (char)puVar3[7]; while (cVar2 != '\0') { Sleep(1000); cVar2 = (char)puVar3[7]; } *(undefined1 *)(puVar3 + 7) = 1; uVar1 = (uint)local_8 >> 8; local_8 = CONCAT31((int3)uVar1,2); _ArgList = operator_new(0xc); *_ArgList = FUN_00a5a760; _ArgList[1] = puVar4; _ArgList[2] = puVar3; *(undefined1 *)(puVar3 + 8) = 0; uVar5 = _beginthreadex((void *)0x0,0,FUN_00a7f130,_ArgList,0,puVar3 + 9); *puVar3 = uVar5; if (uVar5 == 0) { *(undefined1 *)(puVar3 + 8) = 1; operator_delete(_ArgList,0xc); } *(undefined1 *)(puVar3 + 7) = 0; LeaveCriticalSection(lpCriticalSection); } in_ECX[2] = (int)puVar3; switch(param_2) { case 0: nPriority = -2; break; case 1: nPriority = -1; break; default: nPriority = 0; break; case 3: nPriority = 1; break; case 4: nPriority = 2; } BVar6 = SetThreadPriority((HANDLE)*puVar3,nPriority); ExceptionList = local_10; return BVar6 != 0; } //@@ 00a5a700 FUN_00a5a700 void FUN_00a5a700(void) { undefined4 *puVar1; void *ptr; char cVar2; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 8); if (puVar1 != (undefined4 *)0x0) { cVar2 = FUN_00a7f1e0(); if (cVar2 != '\0') { WaitForSingleObject((HANDLE)*puVar1,0xffffffff); CloseHandle((HANDLE)*puVar1); } ptr = *(void **)(in_ECX + 8); if (ptr != (void *)0x0) { cVar2 = FUN_00a7f1e0(); if (cVar2 != '\0') { /* WARNING: Subroutine does not return */ terminate(); } DeleteCriticalSection((LPCRITICAL_SECTION)((int)ptr + 4)); operator_delete(ptr,0x28); *(undefined4 *)(in_ECX + 8) = 0; } } return; } //@@ 00a5a760 FUN_00a5a760 void FUN_00a5a760(int *param_1) { int iVar1; code *pcVar2; int iVar3; iVar1 = *param_1; pcVar2 = (code *)param_1[1]; iVar3 = param_1[2]; operator_delete(param_1,0xc); *(byte *)(iVar1 + 4) = *(byte *)(iVar1 + 4) | 1; (*pcVar2)(iVar3); *(byte *)(iVar1 + 4) = *(byte *)(iVar1 + 4) & 0xfe; return; } //@@ 00a5a7a0 path_join /* DB: ECX=name, EDX=dir: tracked_alloc(len+2+extra), formats "%s/%s" or "%s%s" when dir ends in '/' or '\\', optional lowercase (param_1); used by ModEntry::parse_metadata_xml, string_table_translate, ModManager::UpdateWorkshopMods prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ byte * __cdecl path_join(byte *name,byte *dir,byte isLowercase,byte isAppendSlash) { byte bVar1; bool bVar2; qword qVar3; undefined4 *puVar4; uint _SizeInBytes; byte *pbVar5; byte *pbVar6; byte *pbVar7; int iVar8; qword *pqVar9; int iVar10; char *pcVar11; if (name == (byte *)0x0) { iVar8 = 0; } else { pbVar7 = name; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); iVar8 = (int)pbVar7 - (int)(name + 1); } if (dir == (byte *)0x0) { iVar10 = 0; } else { pbVar7 = dir; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); iVar10 = (int)pbVar7 - (int)(dir + 1); if ((iVar10 != 0) && ((dir[iVar10 + -1] == 0x2f || (dir[iVar10 + -1] == 0x5c)))) { bVar2 = true; goto LAB_00a5a7fb; } } bVar2 = false; LAB_00a5a7fb: if ((iVar8 != 0) || (iVar10 != 0)) { _SizeInBytes = isAppendSlash + 2 + iVar10 + iVar8; pbVar7 = tracked_alloc(0,(void *)0x0,(ulonglong)_SizeInBytes); if (iVar10 == 0) { strncpy_s((char *)pbVar7,_SizeInBytes,(char *)name,iVar8 + 1); } else if (iVar8 == 0) { strncpy_s((char *)pbVar7,_SizeInBytes,(char *)dir,iVar10 + 1); } else { if (bVar2) { pcVar11 = "%s%s"; } else { pcVar11 = "%s/%s"; } FUN_00652a30(pbVar7,_SizeInBytes,pcVar11,dir,name); } bVar1 = *pbVar7; pbVar5 = pbVar7; while (bVar1 != 0) { if ((isLowercase != 0) && ((byte)(*pbVar5 + 0xbf) < 0x1a)) { *pbVar5 = *pbVar5 + 0x20; } if (*pbVar5 == 0x5c) { *pbVar5 = 0x2f; } pbVar5 = pbVar5 + 1; bVar1 = *pbVar5; } if (isAppendSlash != 0) { pbVar5 = pbVar7; do { pbVar6 = pbVar5; pbVar5 = pbVar6 + 1; } while (*pbVar6 != 0); if (pbVar6[-1] != 0x2f) { strcat_s((char *)pbVar7,_SizeInBytes,"/"); } } return pbVar7; } if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(5); if (puVar4 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); uRam00000000 = 0; return (byte *)0x0; } qVar3 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 + 5; *puVar4 = 5; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) + (uint)(0xfffffffa < (uint)qVar3); *(byte *)(puVar4 + 1) = 0; return (byte *)(puVar4 + 1); } //@@ 00a5a940 FUN_00a5a940 byte FUN_00a5a940(void) { char cVar1; char *pcVar2; byte bVar3; char *in_ECX; char cVar4; char *in_EDX; char *pcVar5; char cVar6; int iVar7; char *pcVar8; if ((in_ECX == (char *)0x0) || (*in_ECX == '\0')) { bVar3 = 1; } else { if ((in_EDX != (char *)0x0) && (*in_EDX != '\0')) { do { if ((*in_ECX != '\\') && (*in_ECX != '/')) break; in_ECX = in_ECX + 1; } while (in_ECX != (char *)0x0); do { if ((*in_EDX != '\\') && (*in_EDX != '/')) break; in_EDX = in_EDX + 1; } while (in_EDX != (char *)0x0); pcVar2 = in_ECX; do { pcVar8 = pcVar2; pcVar2 = pcVar8 + 1; } while (*pcVar8 != '\0'); pcVar2 = in_EDX; do { pcVar5 = pcVar2; pcVar2 = pcVar5 + 1; } while (*pcVar5 != '\0'); if (pcVar8 != (char *)0x0) { while (in_ECX < pcVar8) { if (((*pcVar8 != '\\') && (*pcVar8 != '/')) || (pcVar8 = pcVar8 + -1, pcVar8 == (char *)0x0)) break; } } for (; ((pcVar5 != (char *)0x0 && (in_EDX < pcVar5)) && ((*pcVar5 == '\\' || (*pcVar5 == '/')))); pcVar5 = pcVar5 + -1) { } if ((int)pcVar8 - (int)in_ECX != (int)pcVar5 - (int)in_EDX) { return 0; } if (in_ECX <= pcVar8) { iVar7 = (int)in_EDX - (int)in_ECX; do { cVar1 = *in_ECX; cVar6 = in_ECX[iVar7]; cVar4 = cVar1 + ' '; if (0x19 < (byte)(cVar1 + 0xbfU)) { cVar4 = cVar1; } if (cVar4 == '\\') { cVar4 = '/'; } if ((byte)(cVar6 + 0xbfU) < 0x1a) { cVar6 = cVar6 + ' '; } if (cVar6 == '\\') { cVar6 = '/'; } if (cVar4 != cVar6) { return 0; } in_ECX = in_ECX + 1; } while (in_ECX <= pcVar8); } return 1; } bVar3 = 0; } if ((in_EDX == (char *)0x0) || (*in_EDX == '\0')) { return bVar3; } return bVar3 ^ 1; } //@@ 00a5aa80 FUN_00a5aa80 undefined4 FUN_00a5aa80(void) { undefined4 uVar1; int in_ECX; if (*(int *)(in_ECX + 0x40) != 0) { return 0x86000000; } if (*(int *)(in_ECX + 8) == 0) { return 0x860a0000; } uVar1 = 0x6cf0000; if (*(int *)(in_ECX + 4) == 0) { uVar1 = 0x6ca0000; } return uVar1; } //@@ 00a5aad0 FUN_00a5aad0 void FUN_00a5aad0(int param_1,int param_2) { uint uVar1; int iVar2; int in_ECX; int *in_EDX; uint uVar3; int iVar4; int local_c; iVar4 = 0x7fffffff; if (0 < in_ECX) { local_c = in_ECX; do { uVar1 = in_EDX[1] * *in_EDX - param_1 * param_2; uVar3 = (int)uVar1 >> 0x1f; iVar2 = (uVar1 ^ uVar3) - uVar3; if (iVar4 <= iVar2) { iVar2 = iVar4; } iVar4 = iVar2; in_EDX = in_EDX + 3; local_c = local_c + -1; } while (local_c != 0); } return; } //@@ 00a5ab30 glfw_createIcon /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW win32_window.c createIcon(image, xhot, yhot, icon): BITMAPV5HEADER 0x7c top-down, "Win32: Failed to create RGBA bitmap", "Win32: Failed to create mask bitmap", "Win32: Failed to create icon"/"cursor"; _glfwCreateWindowWin32, set icon/cursor prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl glfw_createIcon(void *image,int xHot,int yHot,int isIcon) { HDC hdc; HBITMAP pHVar1; HICON pHVar2; undefined1 *puVar3; int iVar4; ICONINFO local_b4; HBITMAP local_a0; DWORD local_9c; int local_98; HBITMAP local_94; undefined1 *local_90; BITMAPINFO local_8c; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; local_90 = (undefined1 *)0x0; local_98 = *(int *)((int)image + 8); local_9c = xHot; memset(&local_8c,0,0x7c); local_8c.bmiHeader.biWidth = *(LONG *)image; local_8c.bmiHeader.biHeight = -*(int *)((int)image + 4); local_8c.bmiHeader.biSize = 0x7c; local_8c.bmiHeader.biPlanes = 1; local_8c.bmiHeader.biBitCount = 0x20; local_8c.bmiHeader.biCompression = 3; local_8c.bmiColors[0].rgbBlue = '\0'; local_8c.bmiColors[0].rgbGreen = '\0'; local_8c.bmiColors[0].rgbRed = 0xff; local_8c.bmiColors[0].rgbReserved = '\0'; local_60 = 0xff00; local_5c = 0xff; local_58 = 0xff000000; hdc = GetDC((HWND)0x0); pHVar1 = CreateDIBSection(hdc,&local_8c,0,&local_90,(HANDLE)0x0,0); local_94 = pHVar1; ReleaseDC((HWND)0x0,hdc); if (pHVar1 == (HBITMAP)0x0) { _glfwInputErrorWin32(); return (void *)0x0; } local_b4.hbmMask = CreateBitmap(*(int *)image,*(int *)((int)image + 4),1,1,(void *)0x0); pHVar1 = local_94; local_a0 = local_b4.hbmMask; if (local_b4.hbmMask == (HBITMAP)0x0) { _glfwInputErrorWin32(); DeleteObject(local_94); return (void *)0x0; } iVar4 = 0; if (0 < *(int *)image * *(int *)((int)image + 4)) { puVar3 = (undefined1 *)(local_98 + 1); do { *local_90 = puVar3[1]; iVar4 = iVar4 + 1; local_90[1] = *puVar3; local_90[2] = puVar3[-1]; local_90[3] = puVar3[2]; local_90 = local_90 + 4; puVar3 = puVar3 + 4; } while (iVar4 < *(int *)image * *(int *)((int)image + 4)); } local_b4.xHotspot = local_9c; local_b4.yHotspot = yHot; local_b4.fIcon = isIcon; local_b4.hbmColor = local_94; pHVar2 = CreateIconIndirect(&local_b4); DeleteObject(pHVar1); DeleteObject(local_a0); if (pHVar2 == (HICON)0x0) { _glfwInputErrorWin32(); } return pHVar2; } //@@ 00a5ad50 FUN_00a5ad50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5ad50(int *param_1) { int iVar1; undefined4 uVar2; int in_ECX; int in_EDX; DWORD dwStyle; float fVar3; DWORD local_20; tagRECT local_1c; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); local_1c.left = 0; local_1c.top = 0; local_1c.right = 0; local_1c.bottom = 0; fVar3 = (float)*(int *)(in_ECX + 0x5c) / (float)*(int *)(in_ECX + 0x60); if (*(int *)(in_ECX + 0x40) == 0) { if (*(int *)(in_ECX + 8) == 0) { dwStyle = 0x860a0000; } else { dwStyle = 0x6cf0000; if (*(int *)(in_ECX + 4) == 0) { dwStyle = 0x6ca0000; } } local_20 = 0x40000; if (*(int *)(in_ECX + 0x10) == 0) goto LAB_00a5adcc; } else { dwStyle = 0x86000000; } local_20 = 0x40008; LAB_00a5adcc: iVar1 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar1 == 0) { AdjustWindowRectEx(&local_1c,dwStyle,0,local_20); } else { uVar2 = (*DAT_00c75aac)(*(undefined4 *)(in_ECX + 0x2b4)); (*DAT_00c75ab0)(&local_1c,dwStyle,0,local_20,uVar2); } if ((((in_EDX == 1) || (in_EDX == 7)) || (in_EDX == 2)) || (in_EDX == 8)) { param_1[3] = (((int)((float)(((param_1[2] - *param_1) - local_1c.right) + local_1c.left) / fVar3 ) + param_1[1]) - local_1c.top) + local_1c.bottom; } else { if ((in_EDX == 4) || (in_EDX == 5)) { param_1[1] = ((param_1[3] - (int)((float)(((param_1[2] - *param_1) - local_1c.right) + local_1c.left) / fVar3)) - local_1c.bottom) + local_1c.top; return; } if ((in_EDX == 3) || (in_EDX == 6)) { param_1[2] = ((int)((float)(((param_1[3] - param_1[1]) - local_1c.bottom) + local_1c.top) * fVar3) - local_1c.left) + *param_1 + local_1c.right; return; } } return; } //@@ 00a5af00 FUN_00a5af00 void FUN_00a5af00(void) { HCURSOR hCursor; int in_ECX; if ((*(int *)(in_ECX + 0x70) != 0x34001) && (*(int *)(in_ECX + 0x70) != 0x34004)) { SetCursor(DAT_00c75a7c); return; } if (*(int *)(in_ECX + 0x44) == 0) { hCursor = LoadCursorW((HINSTANCE)0x0,(LPCWSTR)&DAT_00007f00); SetCursor(hCursor); return; } SetCursor(*(HCURSOR *)(*(int *)(in_ECX + 0x44) + 4)); return; } //@@ 00a5af50 FUN_00a5af50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5af50(void) { int in_ECX; undefined1 local_18 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); GetClientRect(*(HWND *)(in_ECX + 0x2b4),(LPRECT)local_18); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)local_18); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)(local_18 + 8)); ClipCursor((RECT *)local_18); DAT_00c75a6c = in_ECX; return; } //@@ 00a5afc0 FUN_00a5afc0 void FUN_00a5afc0(void) { BOOL BVar1; int in_ECX; RAWINPUTDEVICE local_10; local_10.hwndTarget = *(HWND *)(in_ECX + 0x2b4); local_10.usUsagePage = 1; local_10.usUsage = 2; local_10.dwFlags = 0; BVar1 = RegisterRawInputDevices(&local_10,1,0xc); if (BVar1 == 0) { _glfwInputErrorWin32(); } return; } //@@ 00a5b010 FUN_00a5b010 void FUN_00a5b010(void) { BOOL BVar1; RAWINPUTDEVICE local_10; local_10.usUsagePage = 1; local_10.usUsage = 2; local_10.dwFlags = 1; local_10.hwndTarget = (HWND)0x0; BVar1 = RegisterRawInputDevices(&local_10,1,0xc); if (BVar1 == 0) { _glfwInputErrorWin32(); } return; } //@@ 00a5b050 FUN_00a5b050 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a5b050(void) { BOOL BVar1; HCURSOR hCursor; int in_ECX; undefined1 auStack_7c [40]; undefined1 local_54 [16]; uint local_44; local_44 = __security_cookie ^ (uint)auStack_7c; DAT_00c75a68 = in_ECX; BVar1 = GetCursorPos((LPPOINT)local_54); if (BVar1 != 0) { ScreenToClient(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)local_54); _DAT_00c75a58 = (double)(int)local_54._0_4_; _DAT_00c75a60 = (double)(int)local_54._4_4_; } if ((*(int *)(in_ECX + 0x70) == 0x34001) || (*(int *)(in_ECX + 0x70) == 0x34004)) { if (*(int *)(in_ECX + 0x44) == 0) { hCursor = LoadCursorW((HINSTANCE)0x0,(LPCWSTR)&DAT_00007f00); } else { hCursor = *(HCURSOR *)(*(int *)(in_ECX + 0x44) + 4); } } else { hCursor = DAT_00c75a7c; } SetCursor(hCursor); (*DAT_00c73720)(); (*DAT_00c736a4)(); GetClientRect(*(HWND *)(in_ECX + 0x2b4),(LPRECT)local_54); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)local_54); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)(local_54 + 8)); ClipCursor((RECT *)local_54); DAT_00c75a6c = in_ECX; if (*(int *)(in_ECX + 0x1f0) != 0) { local_54._8_4_ = *(LONG *)(in_ECX + 0x2b4); local_54._0_4_ = 0x20001; local_54._4_4_ = 0; BVar1 = RegisterRawInputDevices((PCRAWINPUTDEVICE)local_54,1,0xc); if (BVar1 == 0) { _glfwInputErrorWin32(); } } return; } //@@ 00a5b1d0 FUN_00a5b1d0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a5b1d0(void) { BOOL BVar1; HCURSOR hCursor; int in_ECX; RAWINPUTDEVICE local_14; if (*(int *)(in_ECX + 0x1f0) != 0) { local_14.usUsagePage = 1; local_14.usUsage = 2; local_14.dwFlags = 1; local_14.hwndTarget = (HWND)0x0; BVar1 = RegisterRawInputDevices(&local_14,1,0xc); if (BVar1 == 0) { _glfwInputErrorWin32(); } } DAT_00c75a68 = 0; ClipCursor((RECT *)0x0); local_14.dwFlags = (DWORD)_DAT_00c75a60; DAT_00c75a6c = 0; local_14._0_4_ = (BADTYPE)_DAT_00c75a58; *(DWORD *)(in_ECX + 0x2ec) = local_14.dwFlags; *(undefined4 *)(in_ECX + 0x2e8) = local_14._0_4_; ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)&local_14); SetCursorPos(local_14._0_4_,local_14.dwFlags); if ((*(int *)(in_ECX + 0x70) != 0x34001) && (*(int *)(in_ECX + 0x70) != 0x34004)) { SetCursor(DAT_00c75a7c); return; } if (*(int *)(in_ECX + 0x44) == 0) { hCursor = LoadCursorW((HINSTANCE)0x0,(LPCWSTR)&DAT_00007f00); SetCursor(hCursor); return; } SetCursor(*(HCURSOR *)(*(int *)(in_ECX + 0x44) + 4)); return; } //@@ 00a5b2d0 FUN_00a5b2d0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ BOOL FUN_00a5b2d0(void) { HWND hWnd; POINT Point; POINT pt; BOOL BVar1; HWND pHVar2; int in_ECX; undefined1 auStack_28 [4]; tagPOINT local_24; undefined1 local_1c [16]; uint local_c; local_c = __security_cookie ^ (uint)auStack_28; BVar1 = GetCursorPos(&local_24); if (BVar1 != 0) { hWnd = *(HWND *)(in_ECX + 0x2b4); Point.y = local_24.y; Point.x = local_24.x; pHVar2 = WindowFromPoint(Point); if (pHVar2 == hWnd) { GetClientRect(hWnd,(LPRECT)local_1c); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)local_1c); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)(local_1c + 8)); pt.y = local_24.y; pt.x = local_24.x; BVar1 = PtInRect((RECT *)local_1c,pt); return BVar1; } } return 0; } //@@ 00a5b380 FUN_00a5b380 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5b380(void) { uint uVar1; int iVar2; undefined4 uVar3; DWORD dwExStyle; int in_ECX; uint uVar4; undefined4 uVar5; undefined1 local_1c [12]; int iStack_10; uint local_c; local_c = __security_cookie ^ (uint)local_1c; uVar1 = GetWindowLongW(*(HWND *)(in_ECX + 0x2b4),-0x10); if (*(int *)(in_ECX + 0x40) == 0) { if (*(int *)(in_ECX + 8) == 0) { uVar4 = 0x860a0000; } else { uVar4 = 0x6cf0000; if (*(int *)(in_ECX + 4) == 0) { uVar4 = 0x6ca0000; } } } else { uVar4 = 0x86000000; } uVar4 = uVar1 & 0x7f30ffff | uVar4; GetClientRect(*(HWND *)(in_ECX + 0x2b4),(LPRECT)local_1c); iVar2 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar2 == 0) { dwExStyle = 0x40000; if ((*(int *)(in_ECX + 0x40) != 0) || (*(int *)(in_ECX + 0x10) != 0)) { dwExStyle = 0x40008; } AdjustWindowRectEx((LPRECT)local_1c,uVar4,0,dwExStyle); } else { uVar5 = 0x40000; if ((*(int *)(in_ECX + 0x40) != 0) || (*(int *)(in_ECX + 0x10) != 0)) { uVar5 = 0x40008; } uVar3 = (*DAT_00c75aac)(*(undefined4 *)(in_ECX + 0x2b4)); (*DAT_00c75ab0)(local_1c + -4,uVar4,0,uVar5,uVar3); } ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)local_1c); ClientToScreen(*(HWND *)(in_ECX + 0x2b4),(LPPOINT)(local_1c + 8)); SetWindowLongW(*(HWND *)(in_ECX + 0x2b4),-0x10,uVar4); SetWindowPos(*(HWND *)(in_ECX + 0x2b4),(HWND)0x0,local_1c._0_4_,local_1c._4_4_, local_1c._8_4_ - local_1c._0_4_,iStack_10 - local_1c._4_4_,0x34); return; } //@@ 00a5b4c0 glfw_updateFramebufferTransparency /* DB: GLFW win32_window.c updateFramebufferTransparency: IsWindowsVistaOrGreater, DwmIsCompositionEnabled (DAT_00c75abc), Win8 check + DwmGetColorizationColor, DwmEnableBlurBehindWindow(window->win32.handle +0x2b4) with CreateRectRgn(0,0,-1,-1); _glfwCreateWindowWin32 */ void glfw_updateFramebufferTransparency(void) { int iVar1; HRGN ho; int in_ECX; undefined4 extraout_ECX; undefined4 local_20; undefined4 uStack_1c; HRGN pHStack_18; undefined4 uStack_14; undefined1 local_10 [4]; int local_c; int local_8; iVar1 = _glfwIsWindowsVersionOrGreaterWin32(); if (iVar1 != 0) { iVar1 = (*DAT_00c75abc)(&local_8); if ((-1 < iVar1) && (local_8 != 0)) { iVar1 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX); if (iVar1 == 0) { iVar1 = (*DAT_00c75ac8)(local_10,&local_c); if ((iVar1 < 0) || (local_c != 0)) { uStack_1c = 0; pHStack_18 = (HRGN)0x0; uStack_14 = 0; local_20 = 1; (*DAT_00c75ac4)(*(undefined4 *)(in_ECX + 0x2b4),&local_20); return; } } ho = CreateRectRgn(0,0,-1,-1); uStack_14 = 0; local_20 = 3; uStack_1c = 1; pHStack_18 = ho; (*DAT_00c75ac4)(*(undefined4 *)(in_ECX + 0x2b4),&local_20); DeleteObject(ho); } } return; } //@@ 00a5b590 FUN_00a5b590 ushort FUN_00a5b590(void) { ushort uVar1; ushort uVar2; ushort uVar3; ushort uVar4; uVar1 = GetKeyState(0x10); uVar2 = GetKeyState(0x11); uVar4 = uVar1 >> 0xf | 2; if ((uVar2 & 0x8000) == 0) { uVar4 = uVar1 >> 0xf; } uVar2 = GetKeyState(0x12); uVar1 = uVar4 | 4; if ((uVar2 & 0x8000) == 0) { uVar1 = uVar4; } uVar2 = GetKeyState(0x5c); uVar3 = GetKeyState(0x5b); uVar4 = uVar1 | 8; if (-1 < (short)(uVar2 | uVar3)) { uVar4 = uVar1; } uVar2 = GetKeyState(0x14); uVar1 = uVar4 | 0x10; if ((uVar2 & 1) == 0) { uVar1 = uVar4; } uVar2 = GetKeyState(0x90); uVar4 = uVar1 | 0x20; if ((uVar2 & 1) == 0) { uVar4 = uVar1; } return uVar4; } //@@ 00a5b620 FUN_00a5b620 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5b620(void) { int in_ECX; tagMONITORINFO local_30; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; local_30.cbSize = 0x28; local_30.dwFlags = 0; local_30.rcMonitor.left = 0; local_30.rcMonitor.top = 0; local_30.rcMonitor.right = 0; local_30.rcMonitor.bottom = 0; local_30.rcWork.left = 0; local_30.rcWork.top = 0; local_30.rcWork.right = 0; local_30.rcWork.bottom = 0; GetMonitorInfoW(*(HMONITOR *)(*(int *)(in_ECX + 0x40) + 0xd0),&local_30); SetWindowPos(*(HWND *)(in_ECX + 0x2b4),(HWND)0xffffffff,local_30.rcMonitor.left, local_30.rcMonitor.top,local_30.rcMonitor.right - local_30.rcMonitor.left, local_30.rcMonitor.bottom - local_30.rcMonitor.top,0x114); return; } //@@ 00a5b6a0 FUN_00a5b6a0 void FUN_00a5b6a0(void) { int iVar1; int in_ECX; if (DAT_00c74cc0 == 0) { SetThreadExecutionState(0x80000002); SystemParametersInfoW(0x5e,0,&DAT_00c75a78,0); SystemParametersInfoW(0x5d,0,(PVOID)0x0,0); } if (*(int *)(*(int *)(in_ECX + 0x40) + 0x8c) == 0) { DAT_00c74cc0 = DAT_00c74cc0 + 1; } _glfwSetVideoModeWin32(); iVar1 = *(int *)(in_ECX + 0x40); if (iVar1 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0xa0); } *(int *)(iVar1 + 0x8c) = in_ECX; return; } //@@ 00a5b720 FUN_00a5b720 void FUN_00a5b720(void) { int iVar1; int in_ECX; if (*(int *)(*(int *)(in_ECX + 0x40) + 0x8c) == in_ECX) { DAT_00c74cc0 = DAT_00c74cc0 + -1; if (DAT_00c74cc0 == 0) { SetThreadExecutionState(0x80000000); SystemParametersInfoW(0x5d,DAT_00c75a78,(PVOID)0x0,0); } iVar1 = *(int *)(in_ECX + 0x40); if (iVar1 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0xa0); } *(undefined4 *)(iVar1 + 0x8c) = 0; iVar1 = *(int *)(in_ECX + 0x40); if (*(int *)(iVar1 + 0x198) != 0) { ChangeDisplaySettingsExW((LPCWSTR)(iVar1 + 0xd4),(DEVMODEW *)0x0,(HWND)0x0,4,(LPVOID)0x0); *(undefined4 *)(iVar1 + 0x198) = 0; } } return; } //@@ 00a5b7b0 windowProc /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_window.c: stored as wc.lpfnWndProc in _glfwCreateWindowWin32 (mov [ebp-0x64],0xa5b7b0); strings "Win32: Failed to retrieve raw input data", inlined _glfwInputDrop "paths != NULL" and _glfwInputWindowContentScale "xscale > 0.f" asserts */ LRESULT windowProc(HWND param_1,UINT param_2,HDROP param_3,HRAWINPUT param_4) { ushort uVar1; int iVar2; HRAWINPUT pHVar3; HWND pHVar4; int iVar5; LRESULT LVar6; undefined4 uVar7; HMONITOR hMonitor; UINT UVar8; HWND__ HVar9; BOOL BVar10; uint uVar11; UINT UVar12; void *pvVar13; int unaff_ESI; int *piVar14; LONG *pLVar15; char *pcVar16; int iStack_a8; int iStack_a4; HWND__ local_a0; HRAWINPUT local_9c; HWND__ local_98; HDROP local_94; HWND__ local_90; HWND local_8c; tagPOINT local_88; tagMSG local_80; HWND__ local_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; tagMONITORINFO tStack_50; uint local_14; local_14 = __security_cookie ^ (uint)&iStack_a8; local_9c = param_4; local_a0.unused = (uint)param_4 & 0xffff; local_8c = param_1; local_94 = param_3; local_98.unused = local_a0.unused; local_90.unused = local_a0.unused; local_88.x = local_a0.unused; local_60.unused = local_a0.unused; pHVar4 = GetPropW(param_1,L"GLFW"); local_80.hwnd = pHVar4; if (pHVar4 == (HWND)0x0) { if (param_2 == 0x81) { iVar5 = _glfwIsWindows10BuildOrGreaterWin32(); pHVar3 = local_9c; if (iVar5 != 0) { if ((local_9c->unused != 0) && (*(int *)(local_9c->unused + 0x3c) != 0)) { (*DAT_00c75aa4)(local_8c); LVar6 = DefWindowProcW((HWND)local_90.unused,0x81,(WPARAM)param_3,(LPARAM)pHVar3); return LVar6; } } } LVar6 = DefWindowProcW(local_8c,param_2,(WPARAM)param_3,(LPARAM)local_9c); return LVar6; } if (param_2 < 0x100) { if (param_2 == 0xff) { local_98.unused = 0; if ((DAT_00c75a68 == pHVar4) && (pHVar4[0x7c].unused != 0)) { GetRawInputData(local_9c,0x10000003,(LPVOID)0x0,(PUINT)&local_98,0x10); if ((uint)DAT_00c75a74.unused < (uint)local_98.unused) { if (DAT_00c75a70 != (HWND)0x0) { (*g_glfwDeallocate)(DAT_00c75a70,g_glfwAllocatorUser); } DAT_00c75a70 = (HWND)_glfw_calloc(); DAT_00c75a74.unused = local_98.unused; } local_98.unused = DAT_00c75a74.unused; UVar8 = GetRawInputData(local_9c,0x10000003,DAT_00c75a70,(PUINT)&local_98,0x10); if (UVar8 == 0xffffffff) { _glfwInputError(0x10008,"Win32: Failed to retrieve raw input data"); } else { local_90.unused = (int)DAT_00c75a70; if ((DAT_00c75a70[4].unused & 1) == 0) { local_a0.unused = DAT_00c75a70[7].unused; local_88.x = DAT_00c75a70[8].unused; } else { local_80.hwnd = (HWND)0x0; local_80.message = 0; if ((DAT_00c75a70[4].unused & 2) == 0) { local_a0.unused = GetSystemMetrics(0); iVar5 = 1; } else { iVar5 = GetSystemMetrics(0x4c); local_80.hwnd = (HWND)((int)&(local_80.hwnd)->unused + iVar5); iVar5 = GetSystemMetrics(0x4d); local_80.message = local_80.message + iVar5; local_a0.unused = GetSystemMetrics(0x4e); iVar5 = 0x4f; } iVar5 = GetSystemMetrics(iVar5); local_80.message = local_80.message + (int)(((float)((HWND)(local_90.unused + 0x20))->unused / 65535.0) * (float)iVar5); local_80.hwnd = (HWND)((int)&(local_80.hwnd)->unused + (int)(((float)((HWND)(local_90.unused + 0x1c))->unused / 65535.0) * (float)local_a0.unused)); ScreenToClient((HWND)pHVar4[0xad].unused,(LPPOINT)&local_80); local_a0.unused = (int)local_80.hwnd - pHVar4[0xba].unused; local_88.x = local_80.message - pHVar4[0xbb].unused; param_3 = local_94; } FUN_00a26000(); pHVar4[0xba].unused = pHVar4[0xba].unused + local_a0.unused; pHVar4[0xbb].unused = pHVar4[0xbb].unused + local_88.x; } } goto LAB_00a5c1be; } switch(param_2) { case 3: if (DAT_00c75a6c == pHVar4) { FUN_00a5af50(); } if ((code *)pHVar4[0x9c].unused == (code *)0x0) { return 0; } (*(code *)pHVar4[0x9c].unused) (pHVar4,(int)(short)local_a0.unused,(int)(short)((uint)local_9c >> 0x10)); return 0; default: goto LAB_00a5ca25; case 5: local_9c = (HRAWINPUT)((uint)local_9c >> 0x10); local_8c = (HWND)(uint)(param_3 == (HDROP)0x1); if ((param_3 == (HDROP)0x2) || ((pHVar4[0xb3].unused != 0 && (param_3 != (HDROP)0x0)))) { local_a0.unused = 1; } else { local_a0.unused = 0; } if (DAT_00c75a6c == pHVar4) { FUN_00a5af50(); } if ((HWND)pHVar4[0xb2].unused != local_8c) { FUN_00a6a870(); } if (pHVar4[0xb3].unused != local_a0.unused) { FUN_00a6a8d0(); } if (((local_98.unused & 0xffffU) != pHVar4[0xb8].unused) || (local_9c != (HRAWINPUT)pHVar4[0xb9].unused)) { pHVar4[0xb8].unused = local_98.unused & 0xffffU; pHVar4[0xb9].unused = (int)local_9c; FUN_00a6a930(local_9c); FUN_00a6a7f0(local_9c); } if ((pHVar4[0x10].unused != 0) && ((HWND)pHVar4[0xb2].unused != local_8c)) { if (param_3 == (HDROP)0x1) { FUN_00a5b720(); } else { FUN_00a5b6a0(); FUN_00a5b620(); } } pHVar4[0xb2].unused = (int)local_8c; pHVar4[0xb3].unused = local_a0.unused; return 0; case 7: if ((code *)pHVar4[0xa0].unused != (code *)0x0) { (*(code *)pHVar4[0xa0].unused)(pHVar4,1); } if (pHVar4[0xb1].unused == 0) { if (pHVar4[0x1c].unused == 0x34003) { FUN_00a5b050(); return 0; } if (pHVar4[0x1c].unused == 0x34004) { FUN_00a5af50(); return 0; } return 0; } break; case 8: if (pHVar4[0x1c].unused == 0x34003) { FUN_00a5b1d0(); } else if (pHVar4[0x1c].unused == 0x34004) { ClipCursor((RECT *)0x0); DAT_00c75a6c = (HWND)0x0; } if ((pHVar4[0x10].unused != 0) && (pHVar4[3].unused != 0)) { ShowWindow((HWND)pHVar4[0xad].unused,6); } FUN_00a6a710(); return 0; case 0xf: if ((code *)pHVar4[0x9f].unused != (code *)0x0) { (*(code *)pHVar4[0x9f].unused)(pHVar4); } break; case 0x10: pHVar4[7].unused = 1; if ((code *)pHVar4[0x9e].unused == (code *)0x0) { return 0; } (*(code *)pHVar4[0x9e].unused)(pHVar4); return 0; case 0x14: goto LAB_00a5cae8; case 0x20: if ((short)local_90.unused == 1) { FUN_00a5af00(); return 1; } break; case 0x21: if ((uint)local_9c >> 0x10 == 0x201) { if ((short)local_88.x != 1) { pHVar4[0xb1].unused = 1; } } break; case 0x24: local_80.hwnd = (HWND)0x0; local_80.message = 0; local_80.wParam = 0; local_80.lParam = 0; local_a0.unused = FUN_00a5aa80(); local_94 = (HDROP)func_0x00a5aab0(); if (pHVar4[0x10].unused == 0) { iVar5 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar5 == 0) { AdjustWindowRectEx((LPRECT)&local_80,local_a0.unused,0,(DWORD)local_94); } else { uVar7 = (*DAT_00c75aac)(pHVar4[0xad].unused); (*DAT_00c75ab0)(&local_88.y,iStack_a4,0,local_98.unused,uVar7); } pHVar3 = local_9c; if ((pHVar4[0x13].unused != -1) && (pHVar4[0x14].unused != -1)) { local_9c[6].unused = (pHVar4[0x13].unused - (int)local_80.hwnd) + local_80.wParam; local_9c[7].unused = (local_80.lParam - local_80.message) + pHVar4[0x14].unused; } if ((pHVar4[0x15].unused != -1) && (pHVar4[0x16].unused != -1)) { local_9c[8].unused = (pHVar4[0x15].unused - (int)local_80.hwnd) + local_80.wParam; local_9c[9].unused = (local_80.lParam - local_80.message) + pHVar4[0x16].unused; } if (pHVar4[2].unused == 0) { hMonitor = MonitorFromWindow((HWND)pHVar4[0xad].unused,2); tStack_50.rcMonitor.left = 0; tStack_50.rcMonitor.top = 0; tStack_50.rcMonitor.right = 0; tStack_50.rcMonitor.bottom = 0; tStack_50.rcWork.left = 0; tStack_50.rcWork.top = 0; tStack_50.rcWork.right = 0; tStack_50.rcWork.bottom = 0; tStack_50.dwFlags = 0; tStack_50.cbSize = 0x28; GetMonitorInfoW(hMonitor,&tStack_50); pHVar3[4].unused = tStack_50.rcWork.left - tStack_50.rcMonitor.left; pHVar3[5].unused = tStack_50.rcWork.top - tStack_50.rcMonitor.top; pHVar3[2].unused = tStack_50.rcWork.right - tStack_50.rcWork.left; pHVar3[3].unused = tStack_50.rcWork.bottom - tStack_50.rcWork.top; return 0; } return 0; } break; case 0x51: FUN_00a80d30(); break; case 0x85: case 0x86: if (pHVar4[2].unused == 0) { return 1; } goto LAB_00a5ca25; } goto LAB_00a5c1be; } if (param_2 < 0x113) { if (param_2 == 0x112) { uVar11 = (uint)param_3 & 0xfff0; if (uVar11 != 0xf100) { if (((uVar11 == 0xf140) || (uVar11 == 0xf170)) && (pHVar4[0x10].unused != 0)) { return 0; } goto LAB_00a5c1be; } LAB_00a5bf9a: if (pHVar4[0xb6].unused == 0) { return 0; } } else { switch(param_2) { case 0x100: case 0x101: case 0x104: case 0x105: local_98.unused = (uint)local_9c >> 0x10; local_88.x = ~((uint)local_9c >> 0x1f) & 1; local_90.unused = local_98.unused; local_94 = (HDROP)FUN_00a5b590(); HVar9.unused = local_98.unused & 0x1ff; if ((HWND)HVar9.unused == (HWND)0x0) { HVar9.unused = MapVirtualKeyW((UINT)param_3,0); } if ((HWND)HVar9.unused == (HWND)0x54) { HVar9.unused = 0x137; } else if ((HWND)HVar9.unused == (HWND)0x146) { HVar9.unused = 0x45; } else if ((HWND)HVar9.unused == (HWND)0x136) { HVar9.unused = 0x36; } local_a0.unused = (int)(short)(&DAT_00c74cc8)[HVar9.unused]; local_98.unused = HVar9.unused; if (param_3 == (HDROP)0x11) { if ((local_90.unused & 0x100U) == 0) { local_90.unused = GetMessageTime(); BVar10 = PeekMessageW(&local_80,(HWND)0x0,0,0,0); if (((BVar10 != 0) && ((((local_80.message == 0x100 || (local_80.message == 0x104)) || (local_80.message == 0x101)) || (local_80.message == 0x105)))) && ((local_80.wParam == 0x12 && (((uint)local_80.lParam >> 0x10 & 0x100) != 0)))) { if (local_80.time == local_90.unused) break; } local_a0.unused = 0x155; } else { local_a0.unused = 0x159; } } else if (param_3 == (HDROP)0xe5) break; if (((HWND)local_88.x == (HWND)0x0) && (param_3 == (HDROP)0x10)) { FUN_00a25c50(local_98.unused,0,local_94); HVar9.unused = local_88.x; } else { HVar9.unused = local_88.x; if (param_3 == (HDROP)0x2c) { FUN_00a25c50(local_98.unused,1,local_94); HVar9.unused = 0; } } FUN_00a25c50(local_98.unused,HVar9.unused,local_94); break; case 0x102: case 0x106: if ((param_3 < (HDROP)0xd800) || ((HDROP)0xdbff < param_3)) { local_a0.unused = 0; if ((param_3 < (HDROP)0xdc00) || ((HDROP)0xdfff < param_3)) { local_a0.unused = (uint)param_3 & 0xffff; } else { uVar1 = (ushort)pHVar4[0xbc].unused; if (uVar1 != 0) { local_a0.unused = ((uint)param_3 & 0xffff) + 0xfca02400 + (uint)uVar1 * 0x400; } } *(undefined2 *)&pHVar4[0xbc].unused = 0; uVar7 = FUN_00a5b590(param_2 != 0x106); FUN_00a25d60(uVar7); } else { *(short *)&pHVar4[0xbc].unused = (short)param_3; } if (param_2 != 0x106) { return 0; } goto LAB_00a5bf9a; case 0x109: if (param_3 == (HDROP)0xffff) { return 1; } local_90.unused = FUN_00a5b590(); if (local_90.unused != (local_90.unused & 0x3fU)) { _wassert(L"mods == (mods & GLFW_MOD_MASK)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x138); } if (param_3 < (HDROP)0x20) { return 0; } if (((HDROP)0x7e < param_3) && (param_3 < (HDROP)0xa0)) { return 0; } HVar9.unused = local_90.unused; if (pHVar4[0x1b].unused == 0) { HVar9.unused = local_90.unused & 0xffffffcf; } if ((code *)pHVar4[0xab].unused != (code *)0x0) { (*(code *)pHVar4[0xab].unused)(pHVar4,param_3,HVar9.unused); } if ((code *)pHVar4[0xaa].unused == (code *)0x0) { return 0; } (*(code *)pHVar4[0xaa].unused)(pHVar4,param_3); return 0; } } goto LAB_00a5c1be; } if (0x31e < param_2) { if (param_2 == 800) goto LAB_00a5cb03; goto LAB_00a5ca25; } if (param_2 == 0x31e) { LAB_00a5cb03: if (pHVar4[0xb4].unused == 0) { return 0; } glfw_updateFramebufferTransparency(); return 0; } switch(param_2) { case 0x200: local_94 = (HDROP)(int)(short)local_60.unused; local_a0.unused = (int)(short)((uint)local_9c >> 0x10); if (pHVar4[0xb0].unused == 0) { local_80.wParam = pHVar4[0xad].unused; local_80.lParam = 0; local_80.hwnd = (HWND)0x10; local_80.message = 2; TrackMouseEvent((LPTRACKMOUSEEVENT)&local_80); pHVar4[0xb0].unused = 1; if ((code *)pHVar4[0xa7].unused != (code *)0x0) { (*(code *)pHVar4[0xa7].unused)(pHVar4,1); } } if ((pHVar4[0x1c].unused != 0x34003) || ((DAT_00c75a68 == pHVar4 && (pHVar4[0x7c].unused == 0))) ) { FUN_00a26000(); pHVar4[0xba].unused = (int)local_94; pHVar4[0xbb].unused = local_a0.unused; return 0; } break; case 0x201: case 0x202: case 0x204: case 0x205: case 0x207: case 0x208: case 0x20b: case 0x20c: if ((param_2 == 0x201) || (param_2 == 0x202)) { if (param_2 != 0x201) goto LAB_00a5c2fe; } else if ((param_2 == 0x204) || (param_2 == 0x205)) { LAB_00a5c2fe: if (param_2 != 0x204) goto LAB_00a5c306; } else { if ((param_2 == 0x207) || (param_2 == 0x208)) { LAB_00a5c306: if (param_2 == 0x207) goto LAB_00a5c31e; } local_88.x = 0; if (param_2 != 0x20b) goto LAB_00a5c326; } LAB_00a5c31e: local_88.x = 1; LAB_00a5c326: iVar5 = 0; do { if (*(char *)((int)&pHVar4[0x1d].unused + iVar5) == '\x01') goto LAB_00a5c33f; iVar5 = iVar5 + 1; } while (iVar5 < 8); SetCapture(local_8c); LAB_00a5c33f: uVar7 = FUN_00a5b590(); FUN_00a25f20(local_88.x,uVar7); iVar5 = 0; do { if (*(char *)((int)&pHVar4[0x1d].unused + iVar5) == '\x01') goto LAB_00a5c36a; iVar5 = iVar5 + 1; } while (iVar5 < 8); ReleaseCapture(); LAB_00a5c36a: if (param_2 == 0x20b) { return 1; } if (param_2 == 0x20c) { return 1; } return 0; default: goto LAB_00a5c577; case 0x20a: FUN_00a25e20(); return 0; case 0x20e: FUN_00a25e20(); return 0; case 0x211: case 0x231: if (pHVar4[0xb1].unused == 0) { if (pHVar4[0x1c].unused == 0x34003) { FUN_00a5b1d0(); } else if (pHVar4[0x1c].unused == 0x34004) { ClipCursor((RECT *)0x0); DAT_00c75a6c = (HWND)0x0; } } goto LAB_00a5c577; case 0x212: case 0x232: if (pHVar4[0xb1].unused == 0) { if (pHVar4[0x1c].unused == 0x34003) { FUN_00a5b050(); } else if (pHVar4[0x1c].unused == 0x34004) { FUN_00a5af50(); } } LAB_00a5c577: if (param_2 == 0x231) { piVar14 = (int *)*DAT_00c799d0; if (piVar14 != DAT_00c799d0) { do { (*(code *)piVar14[2])(1,piVar14[3]); piVar14 = (int *)*piVar14; } while (piVar14 != DAT_00c799d0); return 1; } } else { if (param_2 != 0x232) break; piVar14 = (int *)*DAT_00c799d0; if (piVar14 != DAT_00c799d0) { do { (*(code *)piVar14[2])(0,piVar14[3]); piVar14 = (int *)*piVar14; } while (piVar14 != DAT_00c799d0); } } LAB_00a5cae8: return 1; case 0x214: if ((pHVar4[0x17].unused != -1) && (pHVar4[0x18].unused != -1)) { FUN_00a5ad50(local_9c); return 1; } break; case 0x215: if ((local_9c == (HRAWINPUT)0x0) && (pHVar4[0xb1].unused != 0)) { if (pHVar4[0x1c].unused == 0x34003) { FUN_00a5b050(); pHVar4[0xb1].unused = 0; } else { if (pHVar4[0x1c].unused == 0x34004) { FUN_00a5af50(); } pHVar4[0xb1].unused = 0; } } break; case 0x233: local_9c = (HRAWINPUT)DragQueryFileW(param_3,0xffffffff,(LPWSTR)0x0,0); local_a0.unused = _glfw_calloc(); DragQueryPoint(param_3,&local_88); FUN_00a26000(); if ((int)local_9c < 1) { _wassert(L"count > 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x197); } else { UVar8 = 0; do { UVar12 = DragQueryFileW(param_3,UVar8,(LPWSTR)0x0,0); local_90.unused = UVar12 + 1; if ((HWND)local_90.unused == (HWND)0x0) { LAB_00a5c912: local_98.unused = 0; } else { if ((HWND)0x7fffffff < (uint)local_90.unused) { pcVar16 = "Allocation size overflow"; uVar7 = 0x10004; LAB_00a5c90a: _glfwInputError(uVar7,pcVar16); goto LAB_00a5c912; } local_60.unused = local_90.unused * 2; pvVar13 = (void *)(*g_glfwAllocate)(local_60.unused,g_glfwAllocatorUser); if (pvVar13 == (void *)0x0) { pcVar16 = (char *)0x0; uVar7 = 0x10005; goto LAB_00a5c90a; } local_98.unused = (int)memset(pvVar13,0,local_60.unused); } DragQueryFileW(param_3,UVar8,(LPWSTR)local_98.unused,local_90.unused); uVar7 = FUN_00a80bb0(); *(undefined4 *)(local_a0.unused + UVar8 * 4) = uVar7; if ((HWND)local_98.unused != (HWND)0x0) { (*g_glfwDeallocate)(local_98.unused,g_glfwAllocatorUser); } UVar8 = UVar8 + 1; } while ((int)UVar8 < (int)local_9c); pHVar4 = local_80.hwnd; } if (local_a0.unused == 0) { _wassert(L"paths != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x198); } if ((code *)pHVar4[0xac].unused != (code *)0x0) { (*(code *)pHVar4[0xac].unused)(pHVar4,local_9c,local_a0.unused); } HVar9.unused = local_a0.unused; iVar5 = 0; if (0 < (int)local_9c) { do { iVar2 = *(int *)(HVar9.unused + iVar5 * 4); if (iVar2 != 0) { (*g_glfwDeallocate)(iVar2,g_glfwAllocatorUser); } iVar5 = iVar5 + 1; } while (iVar5 < (int)local_9c); param_3 = local_94; } if (local_a0.unused != 0) { (*g_glfwDeallocate)(local_a0.unused,g_glfwAllocatorUser); } DragFinish(param_3); return 0; case 0x2a3: pHVar4[0xb0].unused = 0; if ((code *)pHVar4[0xa7].unused == (code *)0x0) { return 0; } (*(code *)pHVar4[0xa7].unused)(pHVar4,0); return 0; case 0x2e0: local_a0.unused = (int)((float)((uint)param_3 >> 0x10) / 96.0); local_94 = (HDROP)((float)((uint)param_3 & 0xffff) / 96.0); if (pHVar4[0x10].unused == 0) { if (pHVar4[0xb5].unused == 0) { iVar5 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar5 == 0) goto code_r0x00a5c78b; } SetWindowPos((HWND)pHVar4[0xad].unused,(HWND)0x0,local_9c->unused,local_9c[1].unused, local_9c[2].unused - local_9c->unused,local_9c[3].unused - local_9c[1].unused, 0x14); } code_r0x00a5c78b: if ((float)local_a0.unused <= 0.0) { _wassert(L"xscale > 0.f", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x89); } if (3.4028235e+38 <= (float)local_a0.unused) { _wassert(L"xscale < FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x8a); } if ((float)local_94 <= 0.0) { _wassert(L"yscale > 0.f", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x8b); } if (3.4028235e+38 <= (float)local_94) { _wassert(L"yscale < FLT_MAX", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x8c); } if ((code *)pHVar4[0xa4].unused != (code *)0x0) { (*(code *)pHVar4[0xa4].unused)(pHVar4,local_a0.unused,local_94); } break; case 0x2e4: if (pHVar4[0xb5].unused == 0) { iVar5 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar5 != 0) { local_80.hwnd = (HWND)0x0; local_80.message = 0; local_80.wParam = 0; local_80.lParam = 0; local_60.unused = 0; uStack_5c = 0; uStack_58 = 0; uStack_54 = 0; uVar7 = (*DAT_00c75aac)(pHVar4[0xad].unused); uVar7 = func_0x00a5aab0(uVar7); uVar7 = FUN_00a5aa80(0,uVar7); pLVar15 = &local_88.y; (*DAT_00c75ab0)(pLVar15,uVar7); uVar7 = func_0x00a5aab0((uint)param_3 & 0xffff); uVar7 = FUN_00a5aa80(0,uVar7); (*DAT_00c75ab0)(&local_80.wParam,uVar7); *pLVar15 = *pLVar15 + ((unaff_ESI - iStack_a4) - (int)local_8c) + local_88.y; pLVar15[1] = (int)local_80.hwnd + pLVar15[1] + ((iStack_a8 - local_a0.unused) - local_88.x); return 1; } } } LAB_00a5c1be: LVar6 = DefWindowProcW(local_8c,param_2,(WPARAM)param_3,(LPARAM)local_9c); return LVar6; LAB_00a5ca25: if (param_2 == 0x4a) { local_80.hwnd = (HWND)__RTDynamicCast(g_multiplayerService,0, &KAGE::Network::Multiplayer::ServiceBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::ServiceLocalhost::RTTI_Type_Descriptor,0 ); pHVar3 = local_9c; if (local_80.hwnd == (HWND)0x0) { return 0; } pvVar13 = tracked_alloc(0,(void *)0x0,(ulonglong)(uint)local_9c[1].unused); memcpy(pvVar13,(void *)pHVar3[2].unused,pHVar3[1].unused); local_60.unused = (int)local_94; uStack_5c = 0xfefefefe; NetworkManager::receive_packet(local_80.hwnd,(ulonglong *)&local_60,pvVar13,pHVar3[1].unused); return 1; } goto LAB_00a5c577; } //@@ 00a5cd20 _glfwCreateWindowWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW win32_window.c: "Win32: Failed to register window class", "Win32: Failed to create window", GLFW_ICON, "Win32: Failed to query monitor DPI" */ undefined4 _glfwCreateWindowWin32(int param_1) { HMODULE hInst; LPCWSTR lpWindowName; HWND pHVar1; HDC hdc; undefined4 uVar2; HANDLE in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; int *in_EDX; float fVar3; float fVar4; wchar_t *name; UINT type; int iVar5; int cy; UINT fuLoad; DWORD local_94; DWORD local_90; LPCWSTR local_8c; HICON local_88; DWORD local_84; HMONITOR local_80; undefined1 local_7c [8]; WNDPROC local_74; int iStack_70; int iStack_6c; HINSTANCE pHStack_68; HICON local_64; HCURSOR pHStack_60; HBRUSH pHStack_5c; LPCWSTR pWStack_58; undefined8 local_54; tagMONITORINFO local_4c; tagRECT local_24; undefined4 local_14; local_14 = __security_cookie ^ (uint)(local_7c + 0x6c); if (*(int *)((int)in_ECX + 0x40) == 0) { if (*(int *)((int)in_ECX + 8) == 0) { local_84 = 0x860a0000; } else { local_84 = 0x6cf0000; if (*(int *)((int)in_ECX + 4) == 0) { local_84 = 0x6ca0000; } } local_94 = 0x40000; if (*(int *)((int)in_ECX + 0x10) != 0) goto LAB_00a5cdab; } else { local_84 = 0x86000000; LAB_00a5cdab: local_94 = 0x40008; } local_90 = local_84; if (DAT_00c74cba == 0) { local_7c._0_4_ = 0x30; memset(local_7c + 4,0,0x2c); local_7c._4_4_ = 0x23; local_74 = windowProc; pHStack_68 = DAT_00c74cb0; pHStack_60 = LoadCursorW((HINSTANCE)0x0,(LPCWSTR)&DAT_00007f00); fuLoad = 0x8040; cy = 0; iVar5 = 0; type = 1; name = L"GLFW_ICON"; local_54._0_4_ = L"GLFW30"; hInst = GetModuleHandleW((LPCWSTR)0x0); local_64 = LoadImageW(hInst,name,type,iVar5,cy,fuLoad); if (local_64 == (HICON)0x0) { local_64 = LoadImageW((HINSTANCE)0x0,(LPCWSTR)&DAT_00007f00,1,0,0,0x8040); } DAT_00c74cba = RegisterClassExW((WNDCLASSEXW *)local_7c); if (DAT_00c74cba == 0) { _glfwInputErrorWin32(); return 0; } } iVar5 = GetSystemMetrics(0x1000); if ((iVar5 != 0) && (DAT_00c75a7c == (void *)0x0)) { local_80 = (HMONITOR)GetSystemMetrics(0xd); local_8c = (LPCWSTR)GetSystemMetrics(0xe); local_88 = (HICON)_glfw_calloc(); if (local_88 == (HICON)0x0) { return 0; } local_24.top = (LONG)local_80; local_24.right = (LONG)local_8c; *(undefined1 *)((int)&local_88->unused + 3) = 1; local_24.bottom = (LONG)local_88; DAT_00c75a7c = glfw_createIcon(&local_24.top,0,0,0); (*g_glfwDeallocate)(local_88,g_glfwAllocatorUser); if (DAT_00c75a7c == (void *)0x0) { return 0; } } if (*(int *)((int)in_ECX + 0x40) == 0) { local_24.right = in_EDX[2]; local_24.bottom = in_EDX[3]; *(int *)((int)in_ECX + 0x2cc) = in_EDX[0xb]; local_24.left = 0; local_90 = local_84 | 0x1000000; if (in_EDX[0xb] == 0) { local_90 = local_84; } local_24.top = 0; AdjustWindowRectEx(&local_24,local_90,0,local_94); if ((*in_EDX == -0x80000000) && (in_EDX[1] == -0x80000000)) { local_80 = (HMONITOR)0x80000000; local_84 = -0x80000000; } else { local_80 = (HMONITOR)((int)(int *)local_24.left + *in_EDX); local_84 = in_EDX[1] + local_24.top; } local_8c = (LPCWSTR)(local_24.right - local_24.left); local_88 = (HICON)(local_24.bottom - local_24.top); } else { local_4c.cbSize = 0x28; local_4c.dwFlags = 0; local_4c.rcMonitor.left = 0; local_4c.rcMonitor.top = 0; local_4c.rcMonitor.right = 0; local_4c.rcMonitor.bottom = 0; local_4c.rcWork.left = 0; local_4c.rcWork.top = 0; local_4c.rcWork.right = 0; local_4c.rcWork.bottom = 0; GetMonitorInfoW(*(HMONITOR *)(*(int *)((int)in_ECX + 0x40) + 0xd0),&local_4c); local_8c = (LPCWSTR)(local_4c.rcMonitor.right - local_4c.rcMonitor.left); local_88 = (HICON)(local_4c.rcMonitor.bottom - local_4c.rcMonitor.top); local_80 = (HMONITOR)local_4c.rcMonitor.left; local_84 = local_4c.rcMonitor.top; } lpWindowName = (LPCWSTR)_glfwCreateWideStringFromUTF8Win32(); if (lpWindowName == (LPCWSTR)0x0) { return 0; } pHVar1 = CreateWindowExW(local_94,(LPCWSTR)(uint)DAT_00c74cba,lpWindowName,local_90,(int)local_80, local_84,(int)local_8c,(int)local_88,(HWND)0x0,(HMENU)0x0,DAT_00c74cb0, in_EDX); *(HWND *)((int)in_ECX + 0x2b4) = pHVar1; (*g_glfwDeallocate)(lpWindowName,g_glfwAllocatorUser); if (*(HWND *)((int)in_ECX + 0x2b4) == (HWND)0x0) { _glfwInputErrorWin32(); return 0; } SetPropW(*(HWND *)((int)in_ECX + 0x2b4),L"GLFW",in_ECX); iVar5 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX); if (iVar5 != 0) { (*DAT_00c75aa0)(*(undefined4 *)((int)in_ECX + 0x2b4),0x233,1,0); (*DAT_00c75aa0)(*(undefined4 *)((int)in_ECX + 0x2b4),0x4a,1,0); (*DAT_00c75aa0)(*(undefined4 *)((int)in_ECX + 0x2b4),0x49,1,0); } *(int *)((int)in_ECX + 0x2d4) = in_EDX[0xf]; *(int *)((int)in_ECX + 0x2d8) = in_EDX[0xd1]; *(int *)((int)in_ECX + 0x2dc) = in_EDX[0xd2]; if (*(int *)((int)in_ECX + 0x40) != 0) goto LAB_00a5d314; local_24.right = in_EDX[2]; local_24.bottom = in_EDX[3]; local_24.left = 0; local_24.top = 0; local_7c._4_4_ = 0x2c; local_74 = (WNDPROC)0x0; iStack_70 = 0; iStack_6c = 0; pHStack_68 = (HINSTANCE)0x0; local_64 = (HICON)0x0; pHStack_60 = (HCURSOR)0x0; pHStack_5c = (HBRUSH)0x0; pWStack_58 = (LPCWSTR)0x0; local_54._0_4_ = (LPCWSTR)0x0; local_54._4_4_ = (HICON)0x0; local_80 = MonitorFromWindow(*(HWND *)((int)in_ECX + 0x2b4),2); if (in_EDX[0xf] != 0) { iVar5 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX_00); if (iVar5 == 0) { hdc = GetDC((HWND)0x0); local_8c = (LPCWSTR)GetDeviceCaps(hdc,0x58); local_88 = (HICON)GetDeviceCaps(hdc,0x5a); ReleaseDC((HWND)0x0,hdc); } else { iVar5 = (*DAT_00c75ad4)(local_80,0,&local_8c,&local_88); if (iVar5 != 0) { _glfwInputError(0x10008,"Win32: Failed to query monitor DPI"); goto LAB_00a5d230; } } fVar4 = (float)((double)(int)local_8c + __uint_to_double_fixup[-((int)local_8c >> 0x1f)]) / 96.0 ; fVar3 = (float)((double)(int)local_88 + __uint_to_double_fixup[-((int)local_88 >> 0x1f)]) / 96.0 ; if ((0.0 < fVar4) && (0.0 < fVar3)) { local_24.right = (LONG)((float)local_24.right * fVar4); local_24.bottom = (LONG)((float)local_24.bottom * fVar3); } } LAB_00a5d230: iVar5 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar5 == 0) { AdjustWindowRectEx(&local_24,local_90,0,local_94); } else { uVar2 = (*DAT_00c75aac)(*(undefined4 *)((int)in_ECX + 0x2b4)); (*DAT_00c75ab0)(&local_24,local_90,0,local_94,uVar2); } GetWindowPlacement(*(HWND *)((int)in_ECX + 0x2b4),(WINDOWPLACEMENT *)(local_7c + 4)); OffsetRect(&local_24,(int)pHStack_5c - local_24.left,(int)pWStack_58 - local_24.top); iStack_70 = 0; pHStack_5c = (HBRUSH)local_24.left; pWStack_58 = (LPCWSTR)local_24.top; local_54._4_4_ = (HICON)local_24.bottom; local_54._0_4_ = (LPCWSTR)local_24.right; SetWindowPlacement(*(HWND *)((int)in_ECX + 0x2b4),(WINDOWPLACEMENT *)(local_7c + 4)); if ((in_EDX[0xb] != 0) && (in_EDX[7] == 0)) { local_4c.cbSize = 0x28; local_4c.dwFlags = 0; local_4c.rcMonitor.left = 0; local_4c.rcMonitor.top = 0; local_4c.rcMonitor.right = 0; local_4c.rcMonitor.bottom = 0; local_4c.rcWork.left = 0; local_4c.rcWork.top = 0; local_4c.rcWork.right = 0; local_4c.rcWork.bottom = 0; GetMonitorInfoW(local_80,&local_4c); SetWindowPos(*(HWND *)((int)in_ECX + 0x2b4),(HWND)0x0,local_4c.rcWork.left,local_4c.rcWork.top, local_4c.rcWork.right - local_4c.rcWork.left, local_4c.rcWork.bottom - local_4c.rcWork.top,0x14); } LAB_00a5d314: DragAcceptFiles(*(HWND *)((int)in_ECX + 0x2b4),1); if (*(int *)(param_1 + 0x3c) != 0) { glfw_updateFramebufferTransparency(); *(undefined4 *)((int)in_ECX + 0x2d0) = 1; } GetClientRect(*(HWND *)((int)in_ECX + 0x2b4),&local_24); if ((int *)((int)in_ECX + 0x2e0) != (int *)0x0) { *(int *)((int)in_ECX + 0x2e0) = local_24.right; } if ((int *)((int)in_ECX + 0x2e4) != (int *)0x0) { *(int *)((int)in_ECX + 0x2e4) = local_24.bottom; } return 1; } //@@ 00a5d390 FUN_00a5d390 undefined4 FUN_00a5d390(int param_1,int param_2,int *param_3,undefined4 param_4) { int iVar1; iVar1 = _glfwCreateWindowWin32(param_4); if (iVar1 == 0) { return 0; } if (*param_3 == 0) goto LAB_00a5d43f; iVar1 = param_3[1]; if (iVar1 == 0x36001) { iVar1 = _glfwInitWGL(); if (iVar1 == 0) { return 0; } iVar1 = _glfwCreateContextWGL(param_4); joined_r0x00a5d430: if (iVar1 == 0) { return 0; } } else { if (iVar1 == 0x36002) { iVar1 = _glfwInitEGL(); if (iVar1 == 0) { return 0; } iVar1 = _glfwCreateContextEGL(param_4); goto joined_r0x00a5d430; } if (iVar1 == 0x36003) { iVar1 = FUN_00a83b90(); if (iVar1 == 0) { return 0; } iVar1 = _glfwCreateContextOSMesa(param_4); goto joined_r0x00a5d430; } } iVar1 = _glfwRefreshContextAttribs(); if (iVar1 == 0) { return 0; } LAB_00a5d43f: if (*(int *)(param_2 + 0x38) != 0) { FUN_00a5e490(param_1,1); } if (*(int *)(param_1 + 0x40) == 0) { if ((*(int *)(param_2 + 0x18) != 0) && (FUN_00a5df80(param_1), *(int *)(param_2 + 0x20) != 0)) { FUN_00a5e030(param_1); } } else { FUN_00a5df80(param_1); BringWindowToTop(*(HWND *)(param_1 + 0x2b4)); SetForegroundWindow(*(HWND *)(param_1 + 0x2b4)); SetFocus(*(HWND *)(param_1 + 0x2b4)); FUN_00a5b6a0(); FUN_00a5b620(); if (*(int *)(param_2 + 0x30) != 0) { FUN_00a263e0(); return 1; } } return 1; } //@@ 00a5d4e0 FUN_00a5d4e0 void FUN_00a5d4e0(int param_1) { if (*(int *)(param_1 + 0x40) != 0) { FUN_00a5b720(); } if (*(code **)(param_1 + 0x240) != (code *)0x0) { (**(code **)(param_1 + 0x240))(param_1); } if (DAT_00c75a68 == param_1) { FUN_00a5b1d0(); } if (DAT_00c75a6c == param_1) { ClipCursor((RECT *)0x0); DAT_00c75a6c = 0; } if (*(HWND *)(param_1 + 0x2b4) != (HWND)0x0) { RemovePropW(*(HWND *)(param_1 + 0x2b4),L"GLFW"); DestroyWindow(*(HWND *)(param_1 + 0x2b4)); *(undefined4 *)(param_1 + 0x2b4) = 0; } if (*(HICON *)(param_1 + 0x2b8) != (HICON)0x0) { DestroyIcon(*(HICON *)(param_1 + 0x2b8)); } if (*(HICON *)(param_1 + 700) != (HICON)0x0) { DestroyIcon(*(HICON *)(param_1 + 700)); } return; } //@@ 00a5d580 FUN_00a5d580 void FUN_00a5d580(int param_1) { LPCWSTR lpString; lpString = (LPCWSTR)_glfwCreateWideStringFromUTF8Win32(); if (lpString != (LPCWSTR)0x0) { SetWindowTextW(*(HWND *)(param_1 + 0x2b4),lpString); (*g_glfwDeallocate)(lpString,g_glfwAllocatorUser); } return; } //@@ 00a5d5c0 FUN_00a5d5c0 void FUN_00a5d5c0(int param_1,int param_2) { int iVar1; int iVar2; void *pvVar3; void *image; void *local_8; if (param_2 == 0) { local_8 = (void *)GetClassLongW(*(HWND *)(param_1 + 0x2b4),-0xe); pvVar3 = (void *)GetClassLongW(*(HWND *)(param_1 + 0x2b4),-0x22); } else { iVar1 = GetSystemMetrics(0xc); iVar2 = GetSystemMetrics(0xb); pvVar3 = (void *)FUN_00a5aad0(iVar2,iVar1); iVar1 = GetSystemMetrics(0x32); iVar2 = GetSystemMetrics(0x31); image = (void *)FUN_00a5aad0(iVar2,iVar1); local_8 = glfw_createIcon(pvVar3,0,0,1); pvVar3 = glfw_createIcon(image,0,0,1); } SendMessageW(*(HWND *)(param_1 + 0x2b4),0x80,1,(LPARAM)local_8); SendMessageW(*(HWND *)(param_1 + 0x2b4),0x80,0,(LPARAM)pvVar3); if (*(HICON *)(param_1 + 0x2b8) != (HICON)0x0) { DestroyIcon(*(HICON *)(param_1 + 0x2b8)); } if (*(HICON *)(param_1 + 700) != (HICON)0x0) { DestroyIcon(*(HICON *)(param_1 + 700)); } if (param_2 != 0) { *(void **)(param_1 + 0x2b8) = local_8; *(void **)(param_1 + 700) = pvVar3; } return; } //@@ 00a5d6c0 FUN_00a5d6c0 void FUN_00a5d6c0(int param_1,LONG *param_2,LONG *param_3) { tagPOINT local_c; local_c.x = 0; local_c.y = 0; ClientToScreen(*(HWND *)(param_1 + 0x2b4),&local_c); if (param_2 != (LONG *)0x0) { *param_2 = local_c.x; } if (param_3 != (LONG *)0x0) { *param_3 = local_c.y; } return; } //@@ 00a5d710 FUN_00a5d710 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5d710(int param_1,int param_2,int param_3) { int iVar1; int iVar2; undefined4 uVar3; DWORD dwStyle; DWORD dwExStyle; undefined4 uVar4; undefined4 uVar5; tagRECT local_1c; uint local_c; local_c = __security_cookie ^ (uint)&local_1c; local_1c.left = param_2; local_1c.right = param_2; local_1c.top = param_3; local_1c.bottom = param_3; iVar2 = _glfwIsWindows10BuildOrGreaterWin32(); iVar1 = *(int *)(param_1 + 0x40); if (iVar2 == 0) { dwExStyle = 0x40000; if (((iVar1 == 0) && (*(int *)(param_1 + 0x10) == 0)) || (dwExStyle = 0x40008, iVar1 == 0)) { if (*(int *)(param_1 + 8) == 0) { dwStyle = 0x860a0000; } else { dwStyle = 0x6cf0000; if (*(int *)(param_1 + 4) == 0) { dwStyle = 0x6ca0000; } } } else { dwStyle = 0x86000000; } AdjustWindowRectEx(&local_1c,dwStyle,0,dwExStyle); } else { uVar4 = 0x40000; if (((iVar1 == 0) && (*(int *)(param_1 + 0x10) == 0)) || (uVar4 = 0x40008, iVar1 == 0)) { if (*(int *)(param_1 + 8) == 0) { uVar5 = 0x860a0000; } else { uVar5 = 0x6cf0000; if (*(int *)(param_1 + 4) == 0) { uVar5 = 0x6ca0000; } } } else { uVar5 = 0x86000000; } uVar3 = (*DAT_00c75aac)(*(undefined4 *)(param_1 + 0x2b4)); (*DAT_00c75ab0)((int)register0x00000010 + -0x20,uVar5,0,uVar4,uVar3); } SetWindowPos(*(HWND *)(param_1 + 0x2b4),(HWND)0x0,local_1c.left,local_1c.top,0,0,0x15); return; } //@@ 00a5d830 FUN_00a5d830 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5d830(int param_1,LONG *param_2,LONG *param_3) { tagRECT local_1c; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); GetClientRect(*(HWND *)(param_1 + 0x2b4),&local_1c); if (param_2 != (LONG *)0x0) { *param_2 = local_1c.right; } if (param_3 != (LONG *)0x0) { *param_3 = local_1c.bottom; } return; } //@@ 00a5d880 FUN_00a5d880 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5d880(int param_1,int param_2,int param_3) { int iVar1; int iVar2; undefined4 uVar3; DWORD dwStyle; DWORD dwExStyle; undefined4 uVar4; undefined4 uVar5; tagRECT local_1c; uint local_c; local_c = __security_cookie ^ (uint)&local_1c; if (*(int *)(param_1 + 0x40) == 0) { local_1c.right = param_2; local_1c.left = 0; local_1c.top = 0; local_1c.bottom = param_3; iVar2 = _glfwIsWindows10BuildOrGreaterWin32(); iVar1 = *(int *)(param_1 + 0x40); if (iVar2 == 0) { dwExStyle = 0x40000; if (((iVar1 == 0) && (*(int *)(param_1 + 0x10) == 0)) || (dwExStyle = 0x40008, iVar1 == 0)) { if (*(int *)(param_1 + 8) == 0) { dwStyle = 0x860a0000; } else { dwStyle = 0x6cf0000; if (*(int *)(param_1 + 4) == 0) { dwStyle = 0x6ca0000; } } } else { dwStyle = 0x86000000; } AdjustWindowRectEx(&local_1c,dwStyle,0,dwExStyle); } else { uVar4 = 0x40000; if (((iVar1 == 0) && (*(int *)(param_1 + 0x10) == 0)) || (uVar4 = 0x40008, iVar1 == 0)) { if (*(int *)(param_1 + 8) == 0) { uVar5 = 0x860a0000; } else { uVar5 = 0x6cf0000; if (*(int *)(param_1 + 4) == 0) { uVar5 = 0x6ca0000; } } } else { uVar5 = 0x86000000; } uVar3 = (*DAT_00c75aac)(*(undefined4 *)(param_1 + 0x2b4)); (*DAT_00c75ab0)((int)register0x00000010 + -0x20,uVar5,0,uVar4,uVar3); } SetWindowPos(*(HWND *)(param_1 + 0x2b4),(HWND)0x0,0,0,local_1c.right - local_1c.left, local_1c.bottom - local_1c.top,0x216); } else if (*(int *)(*(int *)(param_1 + 0x40) + 0x8c) == param_1) { FUN_00a5b6a0(); FUN_00a5b620(); return; } return; } //@@ 00a5d9e0 FUN_00a5d9e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5d9e0(int param_1,int param_2,int param_3,int param_4,int param_5) { tagRECT local_18; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (((param_2 != -1) && (param_3 != -1)) || ((param_4 != -1 && (param_5 != -1)))) { GetWindowRect(*(HWND *)(param_1 + 0x2b4),&local_18); MoveWindow(*(HWND *)(param_1 + 0x2b4),local_18.left,local_18.top,local_18.right - local_18.left, local_18.bottom - local_18.top,1); } return; } //@@ 00a5da50 FUN_00a5da50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5da50(int param_1,int param_2,int param_3) { tagRECT local_1c; uint local_c; local_c = __security_cookie ^ (uint)&local_1c; if ((param_2 != -1) && (param_3 != -1)) { GetWindowRect(*(HWND *)(param_1 + 0x2b4),&local_1c); FUN_00a5ad50(&local_1c); MoveWindow(*(HWND *)(param_1 + 0x2b4),local_1c.left,local_1c.top,local_1c.right - local_1c.left, local_1c.bottom - local_1c.top,1); } return; } //@@ 00a5dad0 FUN_00a5dad0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5dad0(int param_1,LONG *param_2,LONG *param_3) { tagRECT local_18; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; GetClientRect(*(HWND *)(param_1 + 0x2b4),&local_18); if (param_2 != (LONG *)0x0) { *param_2 = local_18.right; } if (param_3 != (LONG *)0x0) { *param_3 = local_18.bottom; } return; } //@@ 00a5db20 FUN_00a5db20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5db20(int param_1,int *param_2,int *param_3,int *param_4,int *param_5) { int iVar1; int iVar2; undefined4 uVar3; DWORD dwStyle; DWORD dwExStyle; undefined4 uVar4; undefined4 uVar5; int *local_3c; int *local_38; int *local_34; int *local_30; tagRECT local_2c; tagRECT local_1c; uint local_c; local_c = __security_cookie ^ (uint)&local_3c; local_34 = param_2; local_30 = param_3; local_38 = param_4; local_3c = param_5; GetClientRect(*(HWND *)(param_1 + 0x2b4),&local_1c); SetRect(&local_2c,0,0,local_1c.right,local_1c.bottom); iVar2 = _glfwIsWindows10BuildOrGreaterWin32(); iVar1 = *(int *)(param_1 + 0x40); if (iVar2 == 0) { dwExStyle = 0x40000; if (((iVar1 == 0) && (*(int *)(param_1 + 0x10) == 0)) || (dwExStyle = 0x40008, iVar1 == 0)) { if (*(int *)(param_1 + 8) == 0) { dwStyle = 0x860a0000; } else { dwStyle = 0x6cf0000; if (*(int *)(param_1 + 4) == 0) { dwStyle = 0x6ca0000; } } } else { dwStyle = 0x86000000; } AdjustWindowRectEx(&local_2c,dwStyle,0,dwExStyle); local_3c = param_5; local_38 = param_4; } else { uVar4 = 0x40000; if (((iVar1 == 0) && (*(int *)(param_1 + 0x10) == 0)) || (uVar4 = 0x40008, iVar1 == 0)) { if (*(int *)(param_1 + 8) == 0) { uVar5 = 0x860a0000; } else { uVar5 = 0x6cf0000; if (*(int *)(param_1 + 4) == 0) { uVar5 = 0x6ca0000; } } } else { uVar5 = 0x86000000; } uVar3 = (*DAT_00c75aac)(*(undefined4 *)(param_1 + 0x2b4)); (*DAT_00c75ab0)(&local_30,uVar5,0,uVar4,uVar3); } if (local_34 != (int *)0x0) { *local_34 = -local_2c.left; } if (local_30 != (int *)0x0) { *local_30 = -local_2c.top; } if (local_38 != (int *)0x0) { *local_38 = local_2c.right - local_1c.right; } if (local_3c != (int *)0x0) { *local_3c = local_2c.bottom - local_1c.bottom; } return; } //@@ 00a5dc90 FUN_00a5dc90 void FUN_00a5dc90(int param_1,float *param_2,float *param_3) { float *pfVar1; HMONITOR pHVar2; int iVar3; HDC hdc; undefined4 extraout_ECX; float *pfVar4; pHVar2 = MonitorFromWindow(*(HWND *)(param_1 + 0x2b4),2); pfVar1 = param_3; pfVar4 = param_2; if (param_2 != (float *)0x0) { *param_2 = 0.0; } if (param_3 != (float *)0x0) { *param_3 = 0.0; } iVar3 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX); if (iVar3 == 0) { hdc = GetDC((HWND)0x0); param_1 = GetDeviceCaps(hdc,0x58); param_3 = (float *)GetDeviceCaps(hdc,0x5a); ReleaseDC((HWND)0x0,hdc); pfVar4 = param_2; } else { iVar3 = (*DAT_00c75ad4)(pHVar2,0,¶m_1,¶m_3); if (iVar3 != 0) { _glfwInputError(0x10008,"Win32: Failed to query monitor DPI"); return; } } if (pfVar4 != (float *)0x0) { *pfVar4 = (float)((double)param_1 + __uint_to_double_fixup[-(param_1 >> 0x1f)]) / 96.0; } if (pfVar1 != (float *)0x0) { *pfVar1 = (float)((double)(int)param_3 + __uint_to_double_fixup[-((int)param_3 >> 0x1f)]) / 96.0 ; } return; } //@@ 00a5dd90 FUN_00a5dd90 void FUN_00a5dd90(int param_1) { ShowWindow(*(HWND *)(param_1 + 0x2b4),6); return; } //@@ 00a5ddb0 FUN_00a5ddb0 void FUN_00a5ddb0(int param_1) { ShowWindow(*(HWND *)(param_1 + 0x2b4),9); return; } //@@ 00a5ddd0 FUN_00a5ddd0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a5ddd0(int param_1) { BOOL BVar1; HMONITOR hMonitor; uint uVar2; int iVar3; undefined4 uVar4; LONG LVar5; undefined4 unaff_ESI; tagMONITORINFO *lpmi; DWORD local_58; uint local_54; tagRECT local_50; tagMONITORINFO local_3c; uint local_14; local_14 = __security_cookie ^ (uint)&local_58; BVar1 = IsWindowVisible(*(HWND *)(param_1 + 0x2b4)); if (BVar1 != 0) { ShowWindow(*(HWND *)(param_1 + 0x2b4),3); return; } lpmi = &local_3c; local_3c.cbSize = 0x28; local_3c.dwFlags = 0; local_3c.rcMonitor.left = 0; local_3c.rcMonitor.top = 0; local_3c.rcMonitor.right = 0; local_3c.rcMonitor.bottom = 0; local_3c.rcWork.left = 0; local_3c.rcWork.top = 0; local_3c.rcWork.right = 0; local_3c.rcWork.bottom = 0; hMonitor = MonitorFromWindow(*(HWND *)(param_1 + 0x2b4),2); GetMonitorInfoW(hMonitor,lpmi); local_50.left = local_3c.rcWork.left; local_50.top = local_3c.rcWork.top; local_50.right = local_3c.rcWork.right; local_50.bottom = local_3c.rcWork.bottom; if ((*(int *)(param_1 + 0x54) != -1) && (*(int *)(param_1 + 0x58) != -1)) { local_50.right = *(int *)(param_1 + 0x54) + local_3c.rcWork.left; if (local_3c.rcWork.right < local_50.right) { local_50.right = local_3c.rcWork.right; } local_50.bottom = local_3c.rcWork.top + *(int *)(param_1 + 0x58); if (local_3c.rcWork.bottom < local_50.bottom) { local_50.bottom = local_3c.rcWork.bottom; } } uVar2 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x10); uVar2 = uVar2 | 0x1000000; local_54 = uVar2; SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x10,uVar2); if (*(int *)(param_1 + 8) != 0) { local_58 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14); iVar3 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar3 == 0) { AdjustWindowRectEx(&local_50,uVar2,0,local_58); iVar3 = GetSystemMetrics(4); } else { uVar4 = (*DAT_00c75aac)(*(undefined4 *)(param_1 + 0x2b4)); (*DAT_00c75ab0)(&local_54,local_58,0,unaff_ESI,uVar4); iVar3 = (*DAT_00c75ab4)(4,uVar4); } OffsetRect(&local_50,0,iVar3); LVar5 = local_3c.rcWork.bottom; if (local_50.bottom < local_3c.rcWork.bottom) { LVar5 = local_50.bottom; } local_50.bottom = LVar5; } SetWindowPos(*(HWND *)(param_1 + 0x2b4),(HWND)0x0,local_50.left,local_50.top, local_50.right - local_50.left,local_50.bottom - local_50.top,0x34); return; } //@@ 00a5df80 FUN_00a5df80 void FUN_00a5df80(int param_1) { uint nCmdShow; _STARTUPINFOW local_48; nCmdShow = 8; if (*(int *)(param_1 + 0x2dc) != 0) { local_48.cb = 0x44; memset(&local_48.lpReserved,0,0x40); GetStartupInfoW(&local_48); if (((byte)local_48.dwFlags & 1) != 0) { nCmdShow = (uint)local_48.wShowWindow; } *(undefined4 *)(param_1 + 0x2dc) = 0; } ShowWindow(*(HWND *)(param_1 + 0x2b4),nCmdShow); return; } //@@ 00a5dff0 FUN_00a5dff0 void FUN_00a5dff0(int param_1) { ShowWindow(*(HWND *)(param_1 + 0x2b4),0); return; } //@@ 00a5e010 FUN_00a5e010 void FUN_00a5e010(int param_1) { FlashWindow(*(HWND *)(param_1 + 0x2b4),1); return; } //@@ 00a5e030 FUN_00a5e030 void FUN_00a5e030(int param_1) { BringWindowToTop(*(HWND *)(param_1 + 0x2b4)); SetForegroundWindow(*(HWND *)(param_1 + 0x2b4)); SetFocus(*(HWND *)(param_1 + 0x2b4)); return; } //@@ 00a5e060 _glfwSetWindowMonitorWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: glfw win32_window.c: platform table slot (stored at a8123d in _glfwConnectWin32), (window, monitor, xpos, ypos, width, height): same monitor -> acquire/fit; else AdjustWindowRectEx / _glfwIsWindows10BuildOrGreaterWin32 (AdjustWindowRectExForDpi), window style getStyle/getExStyle (00a5aa80) */ void _glfwSetWindowMonitorWin32 (int param_1,int param_2,int param_3,int param_4,int param_5,int param_6) { int iVar1; undefined4 uVar2; DWORD DVar3; DWORD DVar4; int cx; uint uVar5; uint uVar6; undefined4 uVar7; UINT uFlags; HWND hWndInsertAfter; LONG X; LONG Y; BOOL BVar8; undefined1 auStack_4c [4]; UINT local_48; tagRECT local_44; tagMONITORINFO local_34; uint local_c; local_c = __security_cookie ^ (uint)auStack_4c; if (*(int *)(param_1 + 0x40) == param_2) { if (param_2 != 0) { if (*(int *)(param_2 + 0x8c) == param_1) { FUN_00a5b6a0(); FUN_00a5b620(); return; } return; } local_44.right = param_5 + param_3; local_44.left = param_3; local_44.bottom = param_6 + param_4; local_44.top = param_4; iVar1 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar1 == 0) { DVar3 = 0x40000; if ((*(int *)(param_1 + 0x40) != 0) || (*(int *)(param_1 + 0x10) != 0)) { DVar3 = 0x40008; } BVar8 = 0; DVar4 = FUN_00a5aa80(); AdjustWindowRectEx(&local_44,DVar4,BVar8,DVar3); } else { uVar7 = 0x40000; if ((*(int *)(param_1 + 0x40) != 0) || (*(int *)(param_1 + 0x10) != 0)) { uVar7 = 0x40008; } uVar2 = (*DAT_00c75aac)(*(undefined4 *)(param_1 + 0x2b4)); uVar7 = FUN_00a5aa80(0,uVar7,uVar2); (*DAT_00c75ab0)(&local_48,uVar7); } iVar1 = local_44.bottom - local_44.top; cx = local_44.right - local_44.left; hWndInsertAfter = (HWND)0x0; X = local_44.left; Y = local_44.top; uFlags = 0x114; } else { if (*(int *)(param_1 + 0x40) != 0) { FUN_00a5b720(); } *(int *)(param_1 + 0x40) = param_2; if (param_2 == 0) { local_44.right = param_5 + param_3; local_44.bottom = param_6 + param_4; local_44.left = param_3; local_44.top = param_4; uVar5 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x10); local_48 = 0x110; if (*(int *)(param_1 + 8) != 0) { uVar6 = FUN_00a5aa80(); SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x10,uVar6 | uVar5 & 0x7fffffff); local_48 = 0x130; } hWndInsertAfter = (HWND)((*(int *)(param_1 + 0x10) != 0) - 2); iVar1 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar1 == 0) { DVar3 = 0x40000; if ((*(int *)(param_1 + 0x40) != 0) || (*(int *)(param_1 + 0x10) != 0)) { DVar3 = 0x40008; } BVar8 = 0; DVar4 = FUN_00a5aa80(); AdjustWindowRectEx(&local_44,DVar4,BVar8,DVar3); } else { uVar7 = 0x40000; if ((*(int *)(param_1 + 0x40) != 0) || (*(int *)(param_1 + 0x10) != 0)) { uVar7 = 0x40008; } uVar2 = (*DAT_00c75aac)(*(undefined4 *)(param_1 + 0x2b4)); uVar7 = FUN_00a5aa80(0,uVar7,uVar2); (*DAT_00c75ab0)(&local_48,uVar7); } iVar1 = local_44.bottom - local_44.top; cx = local_44.right - local_44.left; X = local_44.left; Y = local_44.top; uFlags = local_48; } else { local_34.cbSize = 0x28; uFlags = 0x150; local_34.rcMonitor.left = 0; local_34.rcMonitor.top = 0; local_34.rcMonitor.right = 0; local_34.rcMonitor.bottom = 0; local_34.dwFlags = 0; local_34.rcWork.left = 0; local_34.rcWork.top = 0; local_34.rcWork.right = 0; local_34.rcWork.bottom = 0; if (*(int *)(param_1 + 8) != 0) { uVar5 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x10); uVar6 = FUN_00a5aa80(); SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x10,uVar5 & 0xff30ffff | uVar6); uFlags = 0x170; } FUN_00a5b6a0(); GetMonitorInfoW(*(HMONITOR *)(*(int *)(param_1 + 0x40) + 0xd0),&local_34); iVar1 = local_34.rcMonitor.bottom - local_34.rcMonitor.top; cx = local_34.rcMonitor.right - local_34.rcMonitor.left; hWndInsertAfter = (HWND)0xffffffff; X = local_34.rcMonitor.left; Y = local_34.rcMonitor.top; } } SetWindowPos(*(HWND *)(param_1 + 0x2b4),hWndInsertAfter,X,Y,cx,iVar1,uFlags); return; } //@@ 00a5e340 FUN_00a5e340 bool FUN_00a5e340(int param_1) { HWND pHVar1; pHVar1 = GetActiveWindow(); return *(HWND *)(param_1 + 0x2b4) == pHVar1; } //@@ 00a5e360 FUN_00a5e360 void FUN_00a5e360(int param_1) { IsIconic(*(HWND *)(param_1 + 0x2b4)); return; } //@@ 00a5e380 FUN_00a5e380 void FUN_00a5e380(int param_1) { IsWindowVisible(*(HWND *)(param_1 + 0x2b4)); return; } //@@ 00a5e3a0 FUN_00a5e3a0 void FUN_00a5e3a0(int param_1) { IsZoomed(*(HWND *)(param_1 + 0x2b4)); return; } //@@ 00a5e3c0 FUN_00a5e3c0 void FUN_00a5e3c0(void) { FUN_00a5b2d0(); return; } //@@ 00a5e3d0 FUN_00a5e3d0 undefined4 FUN_00a5e3d0(int param_1) { int iVar1; undefined4 extraout_ECX; undefined1 uStack00000000; int iStack_18; undefined1 local_14 [4]; undefined1 auStack_10 [12]; if ((((*(int *)(param_1 + 0x2d0) == 0) || (iVar1 = _glfwIsWindowsVersionOrGreaterWin32(), iVar1 == 0)) || (iVar1 = (*DAT_00c75abc)(), iVar1 < 0)) || (iStack_18 == 0)) { return 0; } iVar1 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX); if (iVar1 == 0) { iVar1 = (*DAT_00c75ac8)(auStack_10,local_14); if (iVar1 < 0) { return 0; } if (&uStack00000000 != &DAT_00000014) { return 0; } } return 1; } //@@ 00a5e450 FUN_00a5e450 void FUN_00a5e450(void) { FUN_00a5b380(); return; } //@@ 00a5e460 FUN_00a5e460 void FUN_00a5e460(int param_1,int param_2) { SetWindowPos(*(HWND *)(param_1 + 0x2b4),(HWND)((param_2 != 0) - 2),0,0,0,0,0x13); return; } //@@ 00a5e490 FUN_00a5e490 void FUN_00a5e490(int param_1,int param_2) { uint uVar1; uint dwNewLong; COLORREF local_10; uint local_c; DWORD local_8; local_10 = 0; local_c = local_c & 0xffffff00; local_8 = 0; uVar1 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14); if ((uVar1 & 0x80000) != 0) { GetLayeredWindowAttributes(*(HWND *)(param_1 + 0x2b4),&local_10,(BYTE *)&local_c,&local_8); } if (param_2 != 0) { SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14,uVar1 | 0x80020); SetLayeredWindowAttributes(*(HWND *)(param_1 + 0x2b4),local_10,(BYTE)local_c,local_8); return; } dwNewLong = uVar1 & 0xffffffdf; if (((uVar1 & 0x80000) != 0) && ((local_8 & 2) == 0)) { dwNewLong = uVar1 & 0xfff7ffdf; } SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14,dwNewLong); return; } //@@ 00a5e540 FUN_00a5e540 float10 FUN_00a5e540(uint param_1) { uint uVar1; uint uVar2; BOOL BVar3; uint local_8; uVar1 = param_1; uVar2 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14); if ((uVar2 & 0x80000) != 0) { BVar3 = GetLayeredWindowAttributes (*(HWND *)(uVar1 + 0x2b4),(COLORREF *)0x0,(BYTE *)((int)¶m_1 + 3),&local_8 ); if ((BVar3 != 0) && ((local_8 & 2) != 0)) { return (float10)((float)(param_1 >> 0x18) / 255.0); } } return (float10)1; } //@@ 00a5e5b0 FUN_00a5e5b0 void FUN_00a5e5b0(int param_1,float param_2) { uint uVar1; uVar1 = GetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14); if ((1.0 <= param_2) && ((uVar1 & 0x20) == 0)) { SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14,uVar1 & 0xfff7ffff); return; } SetWindowLongW(*(HWND *)(param_1 + 0x2b4),-0x14,uVar1 | 0x80000); SetLayeredWindowAttributes(*(HWND *)(param_1 + 0x2b4),0,(BYTE)(int)(param_2 * 255.0),2); return; } //@@ 00a5e630 FUN_00a5e630 void FUN_00a5e630(int param_1,int param_2) { if (DAT_00c75a68 != param_1) { return; } if (param_2 == 0) { FUN_00a5b010(); return; } FUN_00a5afc0(); return; } //@@ 00a5e660 _glfwPollEventsWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_window.c: PeekMessageW loop, WM_QUIT (0x12) sets shouldClose on every window and calls close callback; key-release fixups (input.c asserts); stored in platform table (mov [ebp-0x28],0xa5e660 at 0xa81298), tail-called by glfwPollEvents 0xa5e8c6 */ void _glfwPollEventsWin32(void) { uint uVar1; undefined4 *puVar2; ushort uVar3; int iVar4; HWND hWnd; HANDLE pvVar5; uint uVar6; wchar_t *pwVar7; undefined4 uVar8; code *pcStack_64; int iStack_60; int iStack_5c; tagMSG local_58; tagRECT tStack_3c; uint auStack_2c [10]; auStack_2c[8] = __security_cookie ^ (uint)&pcStack_64; iVar4 = PeekMessageW(&local_58,(HWND)0x0,0,0,1); while (iVar4 != 0) { puVar2 = DAT_00c73ca0; if (local_58.message == 0x12) { for (; puVar2 != (undefined4 *)0x0; puVar2 = (undefined4 *)*puVar2) { puVar2[7] = 1; if ((code *)puVar2[0x9e] != (code *)0x0) { (*(code *)puVar2[0x9e])(puVar2); } } } else { TranslateMessage(&local_58); DispatchMessageW(&local_58); } iVar4 = PeekMessageW(&local_58,(HWND)0x0,0,0,1); } hWnd = GetActiveWindow(); if ((hWnd != (HWND)0x0) && (pvVar5 = GetPropW(hWnd,L"GLFW"), pvVar5 != (HANDLE)0x0)) { auStack_2c[0] = 0xa0; auStack_2c[1] = 0x154; auStack_2c[2] = 0xa1; auStack_2c[3] = 0x158; iStack_60 = 0; auStack_2c[4] = 0x5b; auStack_2c[5] = 0x157; auStack_2c[6] = 0x5c; auStack_2c[7] = 0x15b; tStack_3c.left = (LONG)GetKeyState_exref; pcStack_64 = _wassert_exref; do { uVar1 = auStack_2c[iStack_60 * 2 + 1]; iStack_5c = (int)*(short *)(&DAT_00c750c8 + uVar1 * 2); uVar3 = (*(code *)tStack_3c.left)(auStack_2c[iStack_60 * 2]); if (((uVar3 & 0x8000) == 0) && (*(char *)(uVar1 + 0x7c + (int)pvVar5) == '\x01')) { uVar6 = FUN_00a5b590(); if ((int)uVar1 < 0) { if (uVar1 != 0xffffffff) { uVar8 = 0x113; pwVar7 = L"key >= 0 || key == GLFW_KEY_UNKNOWN"; LAB_00a5e7b2: (*pcStack_64)(pwVar7, L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,uVar8); } } else if (0x15c < (int)uVar1) { uVar8 = 0x114; pwVar7 = L"key <= GLFW_KEY_LAST"; goto LAB_00a5e7b2; } if (uVar6 != (uVar6 & 0x3f)) { (*pcStack_64)(L"mods == (mods & GLFW_MOD_MASK)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x116); } if (uVar1 < 0x15d) { if (*(char *)(uVar1 + 0x7c + (int)pvVar5) == '\0') goto LAB_00a5e81a; *(byte *)((int)pvVar5 + uVar1 + 0x7c) = -(*(int *)((int)pvVar5 + 100) != 0) & 3; } if (*(int *)((int)pvVar5 + 0x6c) == 0) { uVar6 = uVar6 & 0xffffffcf; } if (*(code **)((int)pvVar5 + 0x2a4) != (code *)0x0) { (**(code **)((int)pvVar5 + 0x2a4))(pvVar5,uVar1,iStack_5c,0,uVar6); } } LAB_00a5e81a: iStack_60 = iStack_60 + 1; } while (iStack_60 < 4); } iVar4 = DAT_00c75a68; if (DAT_00c75a68 != 0) { GetClientRect(*(HWND *)(DAT_00c75a68 + 0x2b4),&tStack_3c); tStack_3c.left = tStack_3c.right / 2; if ((*(int *)(iVar4 + 0x2e8) != tStack_3c.left) || (*(int *)(iVar4 + 0x2ec) != tStack_3c.bottom / 2)) { *(LONG *)(iVar4 + 0x2e8) = tStack_3c.left; tStack_3c.top = tStack_3c.bottom / 2; *(LONG *)(iVar4 + 0x2ec) = tStack_3c.top; ClientToScreen(*(HWND *)(iVar4 + 0x2b4),(LPPOINT)&tStack_3c); SetCursorPos(tStack_3c.left,tStack_3c.top); } } return; } //@@ 00a5e8d0 FUN_00a5e8d0 void FUN_00a5e8d0(void) { DWORD dwMilliseconds; DWORD dwWakeMask; dwWakeMask = 0x4ff; dwMilliseconds = __dtoui3(); MsgWaitForMultipleObjects(0,(HANDLE *)0x0,0,dwMilliseconds,dwWakeMask); _glfwPollEventsWin32(); return; } //@@ 00a5e920 FUN_00a5e920 void FUN_00a5e920(int param_1,double *param_2,double *param_3) { BOOL BVar1; tagPOINT local_10; BVar1 = GetCursorPos(&local_10); if (BVar1 != 0) { ScreenToClient(*(HWND *)(param_1 + 0x2b4),&local_10); if (param_2 != (double *)0x0) { *param_2 = (double)local_10.x; } if (param_3 != (double *)0x0) { *param_3 = (double)local_10.y; } } return; } //@@ 00a5e980 FUN_00a5e980 void FUN_00a5e980(int param_1,int param_2,int param_3,double param_4) { param_2 = (int)(double)CONCAT44(param_3,param_2); *(int *)(param_1 + 0x2ec) = (int)param_4; *(int *)(param_1 + 0x2e8) = param_2; param_3 = (int)param_4; ClientToScreen(*(HWND *)(param_1 + 0x2b4),(LPPOINT)¶m_2); SetCursorPos(param_2,param_3); return; } //@@ 00a5e9d0 FUN_00a5e9d0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a5e9d0(int param_1,int param_2) { HWND pHVar1; BOOL BVar2; int iVar3; int local_4c; tagPOINT local_48 [8]; pHVar1 = GetActiveWindow(); if (*(HWND *)(param_1 + 0x2b4) != pHVar1) goto LAB_00a5eb0e; if (param_2 == 0x34003) { BVar2 = GetCursorPos(local_48); if (BVar2 != 0) { ScreenToClient(*(HWND *)(param_1 + 0x2b4),local_48); _DAT_00c75a58 = (double)local_48[0].x; _DAT_00c75a60 = (double)local_48[0].y; } (*DAT_00c73720)(); (*DAT_00c736a4)(param_1,(double)local_48[0].x * 0.5,(double)local_4c * 0.5); if (*(int *)(param_1 + 0x1f0) != 0) { FUN_00a5afc0(); } LAB_00a5ea9e: FUN_00a5af50(); if (param_2 == 0x34003) { DAT_00c75a68 = param_1; goto LAB_00a5eb0e; } } else { if ((DAT_00c75a68 == param_1) && (*(int *)(param_1 + 0x1f0) != 0)) { FUN_00a5b010(); } if (param_2 == 0x34004) goto LAB_00a5ea9e; ClipCursor((RECT *)0x0); DAT_00c75a6c = 0; } if (DAT_00c75a68 == param_1) { DAT_00c75a68 = 0; FUN_00a5e980(param_1,SUB84(_DAT_00c75a58,0),DAT_00c75a58_4,SUB84(_DAT_00c75a60,0),DAT_00c75a60_4 ); } LAB_00a5eb0e: iVar3 = FUN_00a5b2d0(); if (iVar3 != 0) { FUN_00a5af00(); } return; } //@@ 00a5eb30 FUN_00a5eb30 undefined * FUN_00a5eb30(uint param_1) { if (param_1 < 0x200) { if ((short)(&DAT_00c74cc8)[param_1] != -1) { return &DAT_00c75382 + (short)(&DAT_00c74cc8)[param_1] * 5; } } else { _glfwInputError(0x10004,"Invalid scancode %i",param_1); } return (undefined *)0x0; } //@@ 00a5eb70 FUN_00a5eb70 int FUN_00a5eb70(int param_1) { return (int)*(short *)(&DAT_00c750c8 + param_1 * 2); } //@@ 00a5eb80 FUN_00a5eb80 bool FUN_00a5eb80(int param_1,void *param_2,int param_3,int param_4) { void *pvVar1; pvVar1 = glfw_createIcon(param_2,param_3,param_4,0); *(void **)(param_1 + 4) = pvVar1; return pvVar1 != (void *)0x0; } //@@ 00a5ebb0 FUN_00a5ebb0 undefined4 FUN_00a5ebb0(int param_1,undefined4 param_2) { LPCWSTR name; HANDLE pvVar1; switch(param_2) { case 0x36001: name = (LPCWSTR)&DAT_00007f00; break; case 0x36002: name = (LPCWSTR)0x7f01; break; case 0x36003: name = (LPCWSTR)0x7f03; break; case 0x36004: name = (LPCWSTR)0x7f89; break; case 0x36005: name = (LPCWSTR)0x7f84; break; case 0x36006: name = (LPCWSTR)0x7f85; break; case 0x36007: name = (LPCWSTR)0x7f82; break; case 0x36008: name = (LPCWSTR)0x7f83; break; case 0x36009: name = (LPCWSTR)0x7f86; break; case 0x3600a: name = (LPCWSTR)0x7f88; break; default: _glfwInputError(0x10008,"Win32: Unknown standard cursor"); return 0; } pvVar1 = LoadImageW((HINSTANCE)0x0,name,2,0,0,0x8040); *(HANDLE *)(param_1 + 4) = pvVar1; if (pvVar1 == (HANDLE)0x0) { _glfwInputErrorWin32(); return 0; } return 1; } //@@ 00a5ec90 FUN_00a5ec90 void FUN_00a5ec90(int param_1) { if (*(HICON *)(param_1 + 4) != (HICON)0x0) { DestroyIcon(*(HICON *)(param_1 + 4)); } return; } //@@ 00a5ecb0 FUN_00a5ecb0 void FUN_00a5ecb0(void) { int iVar1; iVar1 = FUN_00a5b2d0(); if (iVar1 == 0) { return; } FUN_00a5af00(); return; } //@@ 00a5ecd0 FUN_00a5ecd0 void FUN_00a5ecd0(LPCSTR param_1) { int iVar1; HGLOBAL hMem; LPWSTR lpWideCharStr; int iVar2; iVar2 = 0; iVar1 = MultiByteToWideChar(0xfde9,0,param_1,-1,(LPWSTR)0x0,0); if (iVar1 != 0) { hMem = GlobalAlloc(2,iVar1 * 2); if (hMem == (HGLOBAL)0x0) { _glfwInputErrorWin32(); return; } lpWideCharStr = GlobalLock(hMem); if (lpWideCharStr != (LPWSTR)0x0) { MultiByteToWideChar(0xfde9,0,param_1,-1,lpWideCharStr,iVar1); GlobalUnlock(hMem); iVar1 = OpenClipboard(DAT_00c74cb4); while( true ) { if (iVar1 != 0) { EmptyClipboard(); SetClipboardData(0xd,hMem); /* WARNING: Could not recover jumptable at 0x00a5ed8d. Too many branches */ /* WARNING: Treating indirect jump as call */ CloseClipboard(); return; } Sleep(1); iVar2 = iVar2 + 1; if (iVar2 == 3) break; iVar1 = OpenClipboard(DAT_00c74cb4); } } _glfwInputErrorWin32(); GlobalFree(hMem); } return; } //@@ 00a5ee90 FUN_00a5ee90 undefined4 FUN_00a5ee90(int *param_1) { undefined8 *puVar1; int iVar2; if (DAT_00c74bf4 == 0) { return 0; } iVar2 = 0; if (DAT_00c74bf8 != 0) { if (DAT_00c737b8 == 0x37002) { iVar2 = 0x320d; } else if (DAT_00c737b8 == 0x37003) { iVar2 = 0x320e; } } if (DAT_00c74bfc != 0) { if (DAT_00c737b8 == 0x37004) { iVar2 = 0x3207; } else if (DAT_00c737b8 == 0x37005) { iVar2 = 0x3208; } } if ((DAT_00c74c00 == 0) || (DAT_00c737b8 != 0x37007)) { if (iVar2 == 0) { return 0; } } else { iVar2 = 0x3450; } puVar1 = (undefined8 *)(*g_glfwAllocate)(0xc,g_glfwAllocatorUser); if (puVar1 == (undefined8 *)0x0) { _glfwInputError(0x10005,0); puVar1 = (undefined8 *)0x0; } else { *puVar1 = 0; *(undefined4 *)(puVar1 + 1) = 0; } *param_1 = (int)puVar1; *(undefined4 *)puVar1 = 0x3203; *(int *)(*param_1 + 4) = iVar2; *(undefined4 *)(*param_1 + 8) = 0x3038; return 0x3202; } //@@ 00a5ef80 FUN_00a5ef80 undefined4 FUN_00a5ef80(int param_1) { return *(undefined4 *)(param_1 + 0x2b4); } //@@ 00a5ef90 FUN_00a5ef90 void FUN_00a5ef90(undefined4 *param_1) { if ((DAT_00c74c88 != 0) && (DAT_00c74c8c != 0)) { *param_1 = "VK_KHR_surface"; param_1[1] = "VK_KHR_win32_surface"; } return; } //@@ 00a5efc0 FUN_00a5efc0 undefined4 FUN_00a5efc0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { code *pcVar1; undefined4 uVar2; pcVar1 = (code *)(*DAT_00c74c84)(param_1,"vkGetPhysicalDeviceWin32PresentationSupportKHR"); if (pcVar1 == (code *)0x0) { _glfwInputError(0x10006,"Win32: Vulkan instance missing VK_KHR_win32_surface extension"); return 0; } uVar2 = (*pcVar1)(param_2,param_3); return uVar2; } //@@ 00a5f000 FUN_00a5f000 int FUN_00a5f000(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4) { code *pcVar1; int iVar2; undefined4 uVar3; undefined4 local_18; undefined8 local_14; undefined4 local_c; undefined4 local_8; pcVar1 = (code *)(*DAT_00c74c84)(param_1,"vkCreateWin32SurfaceKHR"); if (pcVar1 == (code *)0x0) { _glfwInputError(0x10006,"Win32: Vulkan instance missing VK_KHR_win32_surface extension"); return -7; } local_c = DAT_00c74cb0; local_14 = 0; local_18 = 0x3b9aed28; local_8 = *(undefined4 *)(param_2 + 0x2b4); iVar2 = (*pcVar1)(param_1,&local_18,param_3,param_4); if (iVar2 != 0) { uVar3 = FUN_00a838b0(); _glfwInputError(0x10008,"Win32: Failed to create Vulkan surface: %s",uVar3); } return iVar2; } //@@ 00a5f090 FUN_00a5f090 undefined4 FUN_00a5f090(void) { int in_ECX; if (_glfw == 0) { _glfwInputError(0x10001,0); return 0; } if (DAT_00c73694 == 0x60001) { return *(undefined4 *)(in_ECX + 0x2b4); } _glfwInputError(0x1000e,"Win32: Platform not initialized"); return 0; } //@@ 00a5f0e0 kage_system_init /* DB: ? SteamInternal_SteamAPI_Init("SteamUtils010"), srand(GetTimeNs/1e6), SetThreadExecutionState(ES_CONTINUOUS|ES_DISPLAY_REQUIRED), timeGetDevCaps + timeBeginPeriod, FUN_00a710a0; IsaacMain after init_engine_parameters */ void kage_system_init(void) { longlong lVar1; longlong lVar2; uint uVar3; ulonglong uVar4; SteamInternal_SteamAPI_Init("SteamUtils010",0); uVar4 = GetTimeNs(); uVar3 = (uint)(uVar4 >> 0x20); lVar1 = (uVar4 & 0xffffffff) * 0x431bde82; lVar2 = (ulonglong)uVar3 * 0xd7b634db + ((uVar4 & 0xffffffff) * 0xd7b634db >> 0x20); lVar1 = (ulonglong)uVar3 * 0x431bde82 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); srand((uint)lVar1 >> 0x12 | (int)((ulonglong)lVar1 >> 0x20) * 0x4000); SetThreadExecutionState(0x80000002); timeGetDevCaps((LPTIMECAPS)&DAT_00c7de70,8); timeBeginPeriod(DAT_00c7de70); KAGE::System::Init(); return; } //@@ 00a5f1a0 FUN_00a5f1a0 void FUN_00a5f1a0(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("SteamUser023"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 00a5f1c0 FUN_00a5f1c0 char * FUN_00a5f1c0(void) { int iVar1; int in_ECX; longlong lVar2; iVar1 = *(int *)(in_ECX + 4); if (iVar1 == 0) { return "???"; } lVar2 = __aullshr(); if (lVar2 == 0xfefefefe) { return "localhost"; } return *(char **)(iVar1 + 0x10); } //@@ 00a5f200 FUN_00a5f200 undefined4 FUN_00a5f200(void) { undefined4 uVar1; int *in_ECX; longlong lVar2; if ((in_ECX[1] == 0) || (lVar2 = __aullshr(), lVar2 != 0xfefefefe)) { /* WARNING: Could not recover jumptable at 0x00a5f22c. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*in_ECX + 0x2c))(); return uVar1; } return 1; } //@@ 00a5f230 FUN_00a5f230 undefined4 FUN_00a5f230(void) { undefined4 uVar1; int *in_ECX; longlong lVar2; if ((in_ECX[1] == 0) || (lVar2 = __aullshr(), lVar2 != 0xfefefefe)) { /* WARNING: Could not recover jumptable at 0x00a5f25e. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*in_ECX + 0x30))(); return uVar1; } return 0xfefefe00; } //@@ 00a5f260 KAGE::System::UserProfile::is_local_user /* DB: ? bool thiscall on a UserProfile (constructed with UserProfile vftable just before, from Lobby vfunc +0x20 owner); compares the profile id's high dword 0xfefefefe/id against the local user (FUN_00a5f090) or flag byte; GameOver::Render, Menu_OnlineLobby, NetplayManager prototype: db/protos.zhl */ byte __thiscall KAGE::System::UserProfile::is_local_user(void *this) { byte *pbVar1; int iVar2; int iVar3; longlong lVar4; pbVar1 = *(byte **)((int)this + 4); if (pbVar1 == (byte *)0x0) { return 0; } lVar4 = __aullshr(); if (lVar4 == 0xfefefefe) { iVar2 = *(int *)(pbVar1 + 8); iVar3 = FUN_00a5f090(); return iVar2 == iVar3; } if ((*(int *)(pbVar1 + 0x20) == 0) || (*(void **)(*(int *)(pbVar1 + 0x20) + 0x10) != g_eosLocalUserId)) { return *pbVar1 & 1; } return 1; } //@@ 00a5f2e0 FUN_00a5f2e0 uint FUN_00a5f2e0(void) { byte *pbVar1; uint in_EAX; int in_ECX; longlong lVar2; pbVar1 = *(byte **)(in_ECX + 4); if (pbVar1 == (byte *)0x0) { return in_EAX & 0xffffff00; } lVar2 = __aullshr(); if (lVar2 == 0xfefefefe) { return 0xfefefe01; } return CONCAT31((int3)((ulonglong)lVar2 >> 8),*pbVar1 >> 1) & 0xffffff01; } //@@ 00a5f310 FUN_00a5f310 undefined4 FUN_00a5f310(void) { undefined4 uVar1; int *in_ECX; longlong lVar2; if ((in_ECX[1] == 0) || (lVar2 = __aullshr(), lVar2 != 0xfefefefe)) { /* WARNING: Could not recover jumptable at 0x00a5f33e. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*in_ECX + 0x34))(); return uVar1; } return 0xfefefe00; } //@@ 00a5f340 FUN_00a5f340 uint FUN_00a5f340(void) { byte *pbVar1; uint in_EAX; int in_ECX; undefined8 uVar2; pbVar1 = *(byte **)(in_ECX + 4); if (pbVar1 != (byte *)0x0) { uVar2 = __aullshr(); if (((int)uVar2 != -0x1010102) || (in_EAX = 0xfefefefe, (int)((ulonglong)uVar2 >> 0x20) != 0)) { return CONCAT31((int3)((ulonglong)uVar2 >> 8),*pbVar1 >> 2) & 0xffffff01; } } return in_EAX & 0xffffff00; } //@@ 00a5f370 FUN_00a5f370 undefined4 FUN_00a5f370(void) { undefined4 uVar1; int *in_ECX; longlong lVar2; if ((in_ECX[1] == 0) || (lVar2 = __aullshr(), lVar2 != 0xfefefefe)) { /* WARNING: Could not recover jumptable at 0x00a5f39e. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = (**(code **)(*in_ECX + 0x38))(); return uVar1; } return 0xfefefe00; } //@@ 00a5f3a0 log_file_open /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: deletes the old global logger g_logFile, creates KAGE::Filesys::LoggerFile (0x10) and fopen(path, "wb"), stores the path, log level 0xff (DAT_00c79bdc); IsaacMain right after building "log.txt" path */ void log_file_open(byte *param_1) { undefined4 *puVar1; byte *name; FILE *pFVar2; byte *pbVar3; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12e2c; local_10 = ExceptionList; ExceptionList = &local_10; if (g_logFile != (void *)0x0) { (*(code *)**(undefined4 **)g_logFile)(1,__security_cookie ^ (int)register0x00000010 - 4U); g_logFile = (void *)0x0; } puVar1 = operator_new(0x10); if (puVar1 == (undefined4 *)0x0) { g_logFile = (void *)0x0; } else { puVar1[1] = 2; puVar1[2] = 0; puVar1[3] = 0; local_8 = 1; *puVar1 = KAGE::Filesys::LoggerFile::vftable; name = path_join(param_1,DAT_00c5aa98,0,0); pFVar2 = fopen((char *)name,"wb"); puVar1[3] = pFVar2; if (pFVar2 != (FILE *)0x0) { puVar1[1] = 1; pbVar3 = path_join(name,(byte *)0x0,0,0); puVar1[2] = pbVar3; } if (name != (byte *)0x0) { local_8 = CONCAT31(local_8._1_3_,2); tracked_alloc(1,name,0); } g_logFile = puVar1; } _DAT_00c79bdc = 0xff; ExceptionList = local_10; return; } //@@ 00a5f4b0 FUN_00a5f4b0 void FUN_00a5f4b0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Network::ManagerBase::vftable; in_ECX[4] = 0; in_ECX[5] = 0; FUN_00a1a500(); operator_delete((void *)in_ECX[2],0x10); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } return; } //@@ 00a5f510 FUN_00a5f510 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00a5f510(void) { LPCRITICAL_SECTION lpCriticalSection; int in_ECX; if ((DAT_00c5ab48 & 1) == 0) { lpCriticalSection = operator_new(0x1c); if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { lpCriticalSection = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; InitializeCriticalSection(lpCriticalSection); } DAT_00c5ab48 = DAT_00c5ab48 | 1; DAT_00c5ab4c = lpCriticalSection; } if (DAT_00c79b3c == '\0') { (**(code **)(DAT_00c79b54 + 4))(); DAT_00c79b3c = '\x01'; } if (((byte)g_multiplayerCommandThreadFlags & 1) == 0) { if (DAT_00c79a84 == '\0') { (**(code **)(DAT_00c79a9c + 4))(); DAT_00c79a84 = '\x01'; } (**(code **)(DAT_00c79aa8 + 4)) (FUN_00a9e950,2,0xffffffff,0x10000,&g_multiplayerCommandThreadFlags); g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags | 1; } else { KAGE_LogMessage(0x10,(byte *)"Command thread is already initialized\n"); } if (DAT_00c79ac0 == '\0') { (**(code **)(DAT_00c79ad8 + 4))(); DAT_00c79ac0 = '\x01'; } std::list>::push_back(FUN_00a732b0,&DAT_00c79a60); _DAT_00c79a54 = _DAT_00c79a54 | 1; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; return 1; } //@@ 00a5f630 FUN_00a5f630 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a5f630(void) { int in_ECX; if (((byte)g_multiplayerCommandThreadFlags & 1) != 0) { g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags | 2; (**(code **)(DAT_00c79aa8 + 0xc))(); KAGE::ThreadSafeQueue::shutdown(); g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags & 0xfc; } KAGE::ThreadSafeQueue::shutdown(); FUN_00a1d6b0(FUN_00a732b0); KAGE::ThreadSafeQueue::shutdown(); _DAT_00c79a54 = _DAT_00c79a54 & 0xfffffffe; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a5f6a0 FUN_00a5f6a0 void FUN_00a5f6a0(void) { int in_ECX; if ((*(byte *)(in_ECX + 4) & 1) != 0) { lobby_process_user_commands(); } return; } //@@ 00a5f6c0 FUN_00a5f6c0 undefined4 FUN_00a5f6c0(undefined4 param_1,undefined4 param_2) { int in_ECX; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 2; *(undefined4 *)(in_ECX + 0x10) = param_1; *(undefined4 *)(in_ECX + 0x14) = param_2; return 1; } //@@ 00a5f6e0 FUN_00a5f6e0 void FUN_00a5f6e0(void) { char cVar1; int *in_ECX; (**(code **)(*in_ECX + 0x10))(0,0); cVar1 = (**(code **)(*in_ECX + 0x18))(); while (cVar1 != '\0') { Sleep(10); cVar1 = (**(code **)(*in_ECX + 0x18))(); } /* WARNING: Could not recover jumptable at 0x00a5f71a. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 0x1c))(); return; } //@@ 00a5f720 FUN_00a5f720 void FUN_00a5f720(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::EosManager::vftable; in_ECX[0x14] = 0; in_ECX[0x15] = 0; FUN_00a70990(); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } return; } //@@ 00a5f770 KAGE::EosManager::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: KAGE::EosManager vtable slot 1 (RTTI); KAGE::System::Init calls it with ecx=0xc5abf0; EOS_Platform init, 'Failed to initialize EOS: %s', client id/secret/sandbox length checks */ uint KAGE::EosManager::Init(void) { char cVar1; int iVar2; uint extraout_EAX; uint uVar3; undefined4 uVar4; int in_ECX; char *pcVar5; undefined8 uVar6; undefined1 auStack_492 [2]; undefined1 auStack_48c [8]; undefined4 local_484; undefined4 local_480; undefined4 local_47c; undefined4 local_478; undefined4 local_474; undefined4 local_470; undefined4 local_46c; undefined4 local_468; undefined4 local_464; undefined4 uStack_460; char *pcStack_45c; char *pcStack_458; char *pcStack_454; char *pcStack_450; undefined4 uStack_44c; char *pcStack_448; undefined4 uStack_444; undefined4 uStack_440; char *pcStack_43c; undefined4 uStack_438; undefined4 uStack_434; undefined4 uStack_430; CHAR *pCStack_42c; undefined8 uStack_428; undefined8 uStack_420; undefined4 uStack_418; CHAR aCStack_414 [1032]; uint local_c; local_c = __security_cookie ^ (uint)auStack_48c; if ((*(byte *)(in_ECX + 4) & 1) == 0) { FUN_00a24530(); FUN_00a24530(); pcVar5 = DAT_00c79a14; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar5 - (int)(DAT_00c79a14 + 1))) { KAGE_LogMessage(0x10,(byte *) "Specified product ID is not valid: It is longer than the allowed size of %d\n" ); } pcVar5 = DAT_00c79a18; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar5 - (int)(DAT_00c79a18 + 1))) { KAGE_LogMessage(0x10,(byte *) "Specified sandbox ID is not valid: It is longer than the allowed size of %d\n" ); } pcVar5 = DAT_00c79a1c; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar5 - (int)(DAT_00c79a1c + 1))) { KAGE_LogMessage(0x10,(byte *) "Specified deployment ID is not valid: It is longer than the allowed size of %d\n" ); } pcVar5 = DAT_00c79a20; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar5 - (int)(DAT_00c79a20 + 1))) { KAGE_LogMessage(0x10,(byte *) "Specified client ID is not valid: It is longer than the allowed size of %d\n" ); } pcVar5 = DAT_00c79a24; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar5 - (int)(DAT_00c79a24 + 1))) { KAGE_LogMessage(0x10,(byte *) "Specified client secret is not valid: It is longer than the allowed size of %d\n" ); } pcVar5 = DAT_00c79a28; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); if (0x40 < (uint)((int)pcVar5 - (int)(DAT_00c79a28 + 1))) { KAGE_LogMessage(0x10,(byte *) "Specified encryption key is not valid: It is longer than the allowed size of %d\n" ); } local_474 = DAT_00c79a0c; local_470 = DAT_00c79a10; local_484 = 4; local_480 = 0; local_47c = 0; local_478 = 0; local_46c = 0; local_468 = 0; local_464 = 0; iVar2 = _EOS_Initialize_4(); if (iVar2 != 0) { _EOS_EResult_ToString_4(); KAGE_LogMessage(8,(byte *)"Failed to initialize EOS: %s\n"); return extraout_EAX & 0xffffff00; } pcStack_45c = DAT_00c79a14; pcStack_458 = DAT_00c79a18; pcStack_43c = DAT_00c79a1c; pcStack_454 = DAT_00c79a20; pcStack_450 = DAT_00c79a24; pcStack_448 = DAT_00c79a28; uStack_434 = 2; if (DAT_00c79a2c != '\0') { uStack_434 = 0x40; } uStack_460 = 0; uStack_438 = 0; uStack_428 = 0; uStack_420 = 0; uStack_418 = 0; local_464 = 0xe; uStack_44c = 0; uStack_444 = 0; uStack_440 = 0; uStack_430 = 0; memset(aCStack_414,0,0x400); GetTempPathA(0x400,aCStack_414); pCStack_42c = aCStack_414; iVar2 = _EOS_Platform_Create_4(); *(int *)(in_ECX + 0x14) = iVar2; if (iVar2 == 0) { KAGE_LogMessage(8,(byte *)"Failed to acquire EOS platform handle object\n"); uVar3 = _EOS_Shutdown_0(); return uVar3 & 0xffffff00; } (**(code **)(*(int *)(in_ECX + 0x30) + 4))(); uVar4 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform); uVar6 = _EOS_Lobby_AddNotifyLobbyInviteAccepted_16(uVar4); *(undefined8 *)(in_ECX + 0x40) = uVar6; uVar4 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,auStack_492 + -0x12,0,FUN_00a60c50); uVar6 = _EOS_Lobby_AddNotifyJoinLobbyAccepted_16(uVar4); local_c = (uint)uVar6; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; *(undefined8 *)(in_ECX + 0x48) = uVar6; } return CONCAT31((int3)(local_c >> 8),1); } //@@ 00a5fad0 FUN_00a5fad0 void FUN_00a5fad0(void) { uint uVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar2 = *(uint *)(in_ECX + 4); if ((uVar2 & 1) != 0) { if (*(void **)(in_ECX + 8) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 8),0); *(undefined4 *)(in_ECX + 8) = 0; uVar2 = *(uint *)(in_ECX + 4); } local_8 = 0xffffffff; *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0xc) = 0; *(undefined4 *)(in_ECX + 0x10) = 0; *(uint *)(in_ECX + 4) = uVar2 & 0xffffffef; (**(code **)(*(int *)(in_ECX + 0x30) + 8))(uVar1); _EOS_Platform_Release_4(*(undefined4 *)(in_ECX + 0x14)); _EOS_Shutdown_0(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; } ExceptionList = local_10; return; } //@@ 00a5fb80 FUN_00a5fb80 void FUN_00a5fb80(void) { int in_ECX; _EOS_Platform_Tick_4(*(undefined4 *)(in_ECX + 0x14)); eos_user_info_process_pending(); return; } //@@ 00a5fba0 eos_lobby_search_find /* DB: ? EOS backend of the lobby search FUN_00a542c0 (Menu_OnlineLobbyList callers; Steam branch has the "Steam has a maximum of 50 lobby results" strings): EOS_Platform_GetLobbyInterface, EOS_Lobby_CreateLobbySearch, SetParameter "KAGE_EOS_LOBBY_BUCKET_ID" plus number/string filters, EOS_LobbySearch_Find with callback FUN_00a60700; strings "Failed to create lobby search handle: %s" */ void eos_lobby_search_find(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; int iVar3; uint uVar4; int iVar5; undefined4 *puVar6; uint uVar7; int iVar8; undefined4 local_50; char *local_4c; char *local_48; int local_44; undefined4 local_40; undefined4 local_3c; undefined4 *local_34; undefined4 *local_30; int local_2c; undefined4 local_28; void *local_24; undefined4 local_20; uint local_1c; undefined4 local_18 [2]; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b12e8d; local_10 = ExceptionList; ExceptionList = &local_10; local_20 = 1; local_1c = *param_1; uVar2 = _EOS_Platform_GetLobbyInterface_4 (g_eosPlatform,&local_20,local_18,__security_cookie ^ (uint)(local_18 + 5)); iVar3 = _EOS_Lobby_CreateLobbySearch_12(uVar2); if (iVar3 == 0) { local_30 = &local_50; local_34 = (undefined4 *)0x1; local_44 = 0; local_3c = 0; local_50 = 1; local_40 = 3; local_4c = "bucket"; local_48 = "KAGE_EOS_LOBBY_BUCKET_ID"; local_2c = 0; _EOS_LobbySearch_SetParameter_8(local_18[0],&local_34); iVar3 = param_1[4]; iVar8 = param_1[3]; local_1c = 0; local_40 = 3; iVar5 = iVar3 - iVar8 >> 0x1f; if ((iVar3 - iVar8) / 0x18 + iVar5 != iVar5) { iVar5 = 0; do { uVar4 = local_1c; if (local_1c < (uint)((iVar3 - iVar8) / 0x18)) { local_4c = *(char **)(iVar5 + iVar8); local_48 = *(char **)(iVar5 + 8 + iVar8); switch(*(undefined4 *)(iVar5 + 0x10 + iVar8)) { case 0: local_2c = 4; break; case 1: local_2c = 5; break; default: local_2c = 0; break; case 3: local_2c = 3; break; case 4: local_2c = 2; break; case 5: local_2c = 1; } iVar3 = _EOS_LobbySearch_SetParameter_8(local_18[0],&local_34); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *)"Failed to add string parameter \'%s\' to filters list: %s\n") ; } } else { KAGE_LogMessage(0x10,(byte *)"String filter value index out of bounds\n"); } local_1c = uVar4 + 1; iVar5 = iVar5 + 0x18; iVar3 = param_1[4]; iVar8 = param_1[3]; } while (local_1c < (uint)((iVar3 - iVar8) / 0x18)); } uVar4 = 0; local_40 = 1; iVar3 = param_1[7]; iVar8 = param_1[6]; iVar5 = iVar3 - iVar8 >> 0x1f; if ((iVar3 - iVar8) / 0x18 + iVar5 != iVar5) { local_1c = 0; do { uVar7 = local_1c; if (uVar4 < (uint)((iVar3 - iVar8) / 0x18)) { local_4c = *(char **)(local_1c + iVar8); local_48 = *(char **)(local_1c + 8 + iVar8); local_44 = (int)local_48 >> 0x1f; switch(*(undefined4 *)(local_1c + 0x10 + iVar8)) { case 0: local_2c = 4; break; case 1: local_2c = 5; break; default: local_2c = 0; break; case 3: local_2c = 3; break; case 4: local_2c = 2; break; case 5: local_2c = 1; } iVar3 = _EOS_LobbySearch_SetParameter_8(local_18[0],&local_34); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *)"Failed to add number parameter \'%s\' to filters list: %s\n") ; } } else { KAGE_LogMessage(0x10,(byte *)"Number filter value index out of bounds\n"); uVar7 = local_1c; } local_1c = uVar7 + 0x18; uVar4 = uVar4 + 1; iVar3 = param_1[7]; iVar8 = param_1[6]; } while (uVar4 < (uint)((iVar3 - iVar8) / 0x18)); } local_24 = g_eosLocalUserId; DAT_00c5ac40 = FUN_00a54ce0; DAT_00c5ac44 = 0; local_28 = 1; _EOS_LobbySearch_Find_16(local_18[0],&local_28,local_18[0],eos_lobby_search_on_find); } else { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *)"Failed to create lobby search handle: %s\n"); local_34 = (undefined4 *)0x0; local_30 = (undefined4 *)0x0; local_2c = 0; uStack_8 = 0; FUN_00a54ce0(&local_34,0); puVar1 = local_30; puVar6 = local_34; if (local_34 != (undefined4 *)0x0) { for (; puVar6 != puVar1; puVar6 = puVar6 + 3) { (**(code **)*puVar6)(0); } uVar4 = ((local_2c - (int)local_34) / 0xc) * 0xc; puVar6 = local_34; if (0xfff < uVar4) { puVar6 = (undefined4 *)local_34[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)puVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar6,uVar4); ExceptionList = local_10; return; } } ExceptionList = local_10; return; } //@@ 00a5ffa0 FUN_00a5ffa0 void FUN_00a5ffa0(undefined4 param_1) { undefined4 uVar1; int iVar2; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 *local_20; undefined4 local_1c; char *local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_c = DAT_00c5abfc; local_10 = 1; uVar1 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&local_10,&local_8); iVar2 = _EOS_Presence_CreatePresenceModification_12(uVar1); if (iVar2 == 0) { local_14 = param_1; local_20 = &local_1c; local_1c = 1; local_18 = "KAGE_PRESENCE_LOBBY_ID"; local_28 = 1; local_24 = 1; _EOS_PresenceModification_SetData_8(local_8,&local_28); local_34 = 1; local_30 = DAT_00c5abfc; local_2c = local_8; uVar1 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform); _EOS_Presence_SetPresence_16(uVar1,&local_34,local_8,FUN_00a60a30); } return; } //@@ 00a60050 FUN_00a60050 void FUN_00a60050(void) { undefined4 uVar1; undefined4 local_38; longlong local_34; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 uStack_20; undefined4 *puStack_1c; undefined4 uStack_18; undefined8 uStack_14; undefined4 uStack_c; local_28 = 0; local_38 = 4; local_2c = 7; local_24 = 0x12; local_34 = (ulonglong)DAT_00c5abd8 << 0x20; if (DAT_00c5abd8 == 0) { DAT_00c5abf4 = DAT_00c5abf4 | 2; return; } KAGE_LogMessage(1,(byte *)"Logging in to EGS...\n"); DAT_00c5abf4 = DAT_00c5abf4 & 0xfffffffd; puStack_1c = &local_38; uStack_c = 0; uStack_20 = 3; uStack_14 = 0; uStack_18 = 7; uVar1 = _EOS_Platform_GetAuthInterface_4 (g_eosPlatform,&uStack_20,&PTR_vftable_00c5abf0,FUN_00a60430); _EOS_Auth_Login_16(uVar1); return; } //@@ 00a60100 FUN_00a60100 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a60100(int param_1) { char cVar1; char *_Source; uint uVar2; undefined4 uVar3; int iVar4; char *pcVar5; char *_Dest; undefined4 uStack_2c; undefined4 *puStack_28; undefined4 uStack_24; undefined4 uStack_20; void *pvStack_1c; undefined4 uStack_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; uVar3 = param_1; puStack_c = &LAB_00b12eb0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; DAT_00c5abfc = param_1; if (DAT_00c5abf8 != (void *)0x0) { local_8 = 0; tracked_alloc(1,DAT_00c5abf8,0); DAT_00c5abf8 = (void *)0x0; } local_8 = 0xffffffff; param_1 = 0; local_14 = 1; uVar3 = _EOS_Platform_GetAuthInterface_4(g_eosPlatform,&local_14,uVar3,¶m_1,uVar2); iVar4 = _EOS_Auth_CopyUserAuthToken_16(uVar3); if (iVar4 == 0) { _Source = *(char **)(param_1 + 0x10); if (_Source == (char *)0x0) { _Dest = (char *)0x0; } else { pcVar5 = _Source; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar5 + (1 - (int)(_Source + 1)))); pcVar5 = _Source; do { cVar1 = *pcVar5; pcVar5 = pcVar5 + 1; } while (cVar1 != '\0'); strncpy(_Dest,_Source,(size_t)(pcVar5 + (1 - (int)(_Source + 1)))); } DAT_00c5abf8 = _Dest; _EOS_Auth_Token_Release_4(param_1); pvStack_1c = DAT_00c5abf8; if (DAT_00c5abf8 == (void *)0x0) { DAT_00c5abf4 = DAT_00c5abf4 | 4; ExceptionList = local_10; return; } KAGE_LogMessage(1,(byte *)"Connecting to EOS...\n"); puStack_28 = &uStack_20; DAT_00c5abf4 = DAT_00c5abf4 & 0xfffffffb | 8; uStack_24 = 0; uStack_18 = 0; uStack_2c = 2; uStack_20 = 1; if (pvStack_1c != DAT_00c5abf8) { uStack_18 = 0x12; } uVar3 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&uStack_2c,0,FUN_00a60590); _EOS_Connect_Login_16(uVar3); } else { _EOS_EResult_ToString_4(iVar4); KAGE_LogMessage(8,(byte *)"Failed to retrieve user access token: %s\n"); _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffd; if (DAT_00c5abd0 != (code *)0x0) { (*DAT_00c5abd0)(0x12,DAT_00c5abd4); DAT_00c5abd0 = (code *)0x0; DAT_00c5abd4 = 0; ExceptionList = local_10; return; } } ExceptionList = local_10; return; } //@@ 00a602f0 FUN_00a602f0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a602f0(void) { undefined4 uVar1; int iVar2; undefined8 uVar3; undefined4 uStack_50; code *pcStack_4c; undefined4 uStack_48; void *pvStack_44; undefined4 **ppuStack_40; undefined4 uStack_3c; code *pcStack_38; undefined4 uStack_34; void *pvStack_30; undefined4 *puStack_2c; undefined4 uStack_10; undefined4 uStack_c; puStack_2c = (undefined4 *)0xa60306; KAGE_LogMessage(1,(byte *)"Successfully connected to EOS\n"); DAT_00c5abf4 = DAT_00c5abf4 | 0x10; uStack_c = DAT_00c5abfc; puStack_2c = &uStack_10; pvStack_30 = g_eosPlatform; uStack_10 = 1; uStack_34 = 0xa6033e; uStack_34 = _EOS_Platform_GetFriendsInterface_4(); pcStack_38 = (code *)0xa60345; _EOS_Friends_QueryFriends_16(); pcStack_38 = FUN_00a7e490; uStack_3c = 0xc5ab88; ppuStack_40 = &puStack_2c; puStack_2c = (undefined4 *)0x1; pvStack_44 = g_eosPlatform; uStack_48 = 0xa6036c; uStack_48 = _EOS_Platform_GetFriendsInterface_4(); pcStack_4c = (code *)0xa60373; _DAT_00c5abb0 = _EOS_Friends_AddNotifyFriendsUpdate_16(); pcStack_4c = FUN_00a7e600; uStack_50 = 0xc5ab88; uVar1 = _EOS_Platform_GetFriendsInterface_4(g_eosPlatform,&uStack_3c); _DAT_00c5abb8 = _EOS_Friends_AddNotifyBlockedUsersUpdate_16(uVar1); if (g_multiplayerService != (void *)0x0) { iVar2 = __RTDynamicCast(g_multiplayerService,0, &KAGE::Network::Multiplayer::ServiceBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::ServiceEOS::RTTI_Type_Descriptor,0); if (iVar2 != 0) { iVar2 = __RTDynamicCast(g_multiplayerService,0, &KAGE::Network::Multiplayer::ServiceBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::ServiceEOS::RTTI_Type_Descriptor,0); if (*(int *)(iVar2 + 0x48) == 0 && *(int *)(iVar2 + 0x4c) == 0) { uStack_50 = 1; uVar1 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&uStack_50,iVar2,FUN_00a770b0); uVar3 = _EOS_Lobby_AddNotifyLobbyMemberStatusReceived_16(uVar1); *(undefined8 *)(iVar2 + 0x48) = uVar3; } } } FUN_00a61170(0); return; } //@@ 00a60430 FUN_00a60430 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a60430(int *param_1) { int iVar1; undefined4 uVar2; undefined4 uStack_20; undefined4 uStack_1c; int iStack_18; undefined4 uStack_14; iVar1 = *param_1; if (iVar1 == 0) { KAGE_LogMessage(1,(byte *)"Successfully logged in to EGS\n"); FUN_00a60100(param_1[2]); return; } if (iVar1 == 3) { KAGE_LogMessage(1,(byte *)"EGS account has not been linked yet, linking now...\n"); iStack_18 = param_1[4]; uStack_1c = 0; uStack_14 = 0; uStack_20 = 1; uVar2 = _EOS_Platform_GetAuthInterface_4(g_eosPlatform,&uStack_20,0,FUN_00a60510); _EOS_Auth_LinkAccount_16(uVar2); return; } _EOS_EResult_ToString_4(iVar1); KAGE_LogMessage(8,(byte *)"Failed to log in to EGS: %s\n"); _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffd; if (DAT_00c5abd0 != (code *)0x0) { (*DAT_00c5abd0)(0x12,DAT_00c5abd4); DAT_00c5abd0 = (code *)0x0; DAT_00c5abd4 = 0; } return; } //@@ 00a60510 FUN_00a60510 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a60510(int *param_1) { if (*param_1 == 0) { KAGE_LogMessage(1,(byte *)"Successfully linked EGS account\n"); FUN_00a60100(param_1[2]); return; } _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to link EGS account: %s\n"); _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffd; if (DAT_00c5abd0 != (code *)0x0) { (*DAT_00c5abd0)(0x12,DAT_00c5abd4); DAT_00c5abd0 = (code *)0x0; DAT_00c5abd4 = 0; } return; } //@@ 00a60590 FUN_00a60590 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a60590(int *param_1) { int iVar1; undefined4 uVar2; undefined4 uStack_14; undefined4 uStack_10; int iStack_c; iVar1 = *param_1; if (iVar1 == 0) { g_eosLocalUserId = (void *)param_1[2]; FUN_00a602f0(); uStack_14 = 1; uVar2 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&uStack_14,0,&LAB_00a60680); _EOS_Connect_AddNotifyAuthExpiration_16(uVar2); return; } if (iVar1 == 3) { KAGE_LogMessage(1,(byte *) "Failed to connect to EOS because user was invalid, attempting to create a new user...\n" ); iStack_c = param_1[3]; uStack_10 = 1; uVar2 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&uStack_10,0,FUN_00a60690); _EOS_Connect_CreateUser_16(uVar2); return; } _EOS_EResult_ToString_4(iVar1); KAGE_LogMessage(1,(byte *)"Failed to connect to EOS: %s\n"); _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffd; if (DAT_00c5abd0 != (code *)0x0) { (*DAT_00c5abd0)(0x12,DAT_00c5abd4); DAT_00c5abd0 = (code *)0x0; DAT_00c5abd4 = 0; } return; } //@@ 00a60690 FUN_00a60690 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a60690(int *param_1) { if (*param_1 == 0) { g_eosLocalUserId = (void *)param_1[2]; FUN_00a602f0(); return; } _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(1,(byte *)"Failed to create user: %s\n"); _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffd; if (DAT_00c5abd0 != (code *)0x0) { (*DAT_00c5abd0)(0x12,DAT_00c5abd4); DAT_00c5abd0 = (code *)0x0; DAT_00c5abd4 = 0; } return; } //@@ 00a60700 eos_lobby_search_on_find /* DB: ? EOS_LobbySearch_Find completion callback pushed by FUN_00a5fba0: EOS_LobbySearch_GetSearchResultCount, CopySearchResultByIndex, LobbyDetails_CopyInfo, builds ConstLobby entries (vector _Emplace_reallocate), Lobby::refresh_members, LobbyDetails/LobbySearch_Release */ void eos_lobby_search_on_find(int param_1) { undefined4 uVar1; undefined4 *puVar2; int *piVar3; char cVar4; uint uVar5; int iVar6; void *pvVar7; undefined1 auStackY_108 [128]; undefined4 *puVar8; int *lobbyCtrl; undefined **local_4c [2]; int *local_44; undefined4 *local_40; undefined4 *local_3c; undefined4 *local_38; undefined4 local_34; uint local_30; undefined4 *local_2c; int *local_28; undefined4 local_24; undefined4 *local_20; undefined4 local_1c; int local_18; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12ef8; local_10 = ExceptionList; ExceptionList = &local_10; local_20 = (undefined4 *)0x1; local_24 = *(undefined4 *)(param_1 + 4); uVar5 = _EOS_LobbySearch_GetSearchResultCount_8(); local_40 = (undefined4 *)0x0; local_3c = (undefined4 *)0x0; local_38 = (undefined4 *)0x0; local_8 = 0; if (uVar5 == 0) { local_34 = 1; local_1c = 1; local_30 = 0; } else { if (0x15555555 < uVar5) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_00a55470(); local_34 = 1; local_1c = 1; local_30 = 0; do { iVar6 = _EOS_LobbySearch_CopySearchResultByIndex_12(); if ((iVar6 == 0) && (iVar6 = _EOS_LobbyDetails_CopyInfo_12(param_1), iVar6 == 0)) { FUN_00a84a90(); local_8 = CONCAT31(local_8._1_3_,1); uVar1 = *(undefined4 *)(local_18 + 0x14); iVar6 = __RTDynamicCast(local_2c,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor); *(undefined4 *)(iVar6 + 0x24) = uVar1; iVar6 = __RTDynamicCast(local_2c,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor); *(int *)(iVar6 + 0x28) = param_1; pvVar7 = (void *)__RTDynamicCast(local_2c,0, &KAGE::Network::Multiplayer::LobbyImplBase:: RTTI_Type_Descriptor); Lobby::refresh_members(pvVar7); piVar3 = local_28; puVar8 = (undefined4 *)0x0; lobbyCtrl = (int *)0x0; local_20 = local_2c; if ((local_28 != (int *)0x0) && (cVar4 = (**(code **)(*local_28 + 4))(), cVar4 != '\0')) { if ((lobbyCtrl != (int *)0x0) && ((cVar4 = (**(code **)(*lobbyCtrl + 0xc))(), cVar4 != '\0' && (g_lobbyReleaseFn != (void *)0x0)))) { (*g_lobbyReleaseFn)(auStackY_108 + 0x8c); } puVar8 = local_20; lobbyCtrl = piVar3; } pvVar7 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(local_4c,puVar8,lobbyCtrl); local_8 = CONCAT31(local_8._1_3_,2); if (local_3c == local_38) { std::vector::_Emplace_reallocate(); } else { local_20 = local_3c; *local_3c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_3c[1] = 0; local_3c[2] = 0; local_8 = CONCAT31(local_8._1_3_,3); std::shared_ptr::assign(local_3c + 1,(void *)((int)pvVar7 + 4)); local_3c = local_3c + 3; } local_4c[0] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 4; if (((local_44 != (int *)0x0) && (cVar4 = (**(code **)(*local_44 + 0xc))(), cVar4 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8._0_1_ = 5; if (((local_28 != (int *)0x0) && (cVar4 = (**(code **)(*local_28 + 0xc))(), cVar4 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(); } local_8 = (uint)local_8._1_3_ << 8; } else { _EOS_LobbyDetails_Release_4(); } _EOS_LobbyDetails_Info_Release_4(); local_30 = local_30 + 1; } while (local_30 < uVar5); } _EOS_LobbySearch_Release_4(); if (DAT_00c5ac40 != (code *)0x0) { (*DAT_00c5ac40)(); DAT_00c5ac40 = (code *)0x0; DAT_00c5ac44 = 0; } puVar2 = local_3c; puVar8 = local_40; if (local_40 != (undefined4 *)0x0) { for (; puVar8 != puVar2; puVar8 = puVar8 + 3) { (**(code **)*puVar8)(); } uVar5 = (((int)local_38 - (int)local_40) / 0xc) * 0xc; puVar8 = local_40; if (0xfff < uVar5) { puVar8 = (undefined4 *)local_40[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_40 + (-4 - (int)puVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar8,uVar5); } ExceptionList = local_10; return; } //@@ 00a60a30 FUN_00a60a30 void FUN_00a60a30(int *param_1) { if (*param_1 != 0) { _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to set presence: %s\n"); } _EOS_PresenceModification_Release_4(param_1[1]); return; } //@@ 00a60a70 FUN_00a60a70 void FUN_00a60a70(int param_1) { char cVar1; undefined4 uVar2; int iVar3; int iVar4; void *pvVar5; TypeDescriptor *lobbyPtr; void *lobbyCtrl; undefined **local_3c; undefined1 local_38 [4]; int *local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; int *local_24; undefined4 local_1c; int local_18 [2]; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12f35; local_10 = ExceptionList; ExceptionList = &local_10; local_30 = 1; local_2c = *(undefined4 *)(param_1 + 4); uVar2 = _EOS_Platform_GetLobbyInterface_4 (g_eosPlatform,&local_30,¶m_1,__security_cookie ^ (uint)(local_18 + 5)); iVar3 = _EOS_Lobby_CopyLobbyDetailsHandleByInviteId_12(uVar2); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(1,(byte *)"Failed to get details for invitation lobby: %s\n"); ExceptionList = local_10; return; } local_1c = 1; iVar3 = _EOS_LobbyDetails_CopyInfo_12(param_1,&local_1c,local_18); if (iVar3 != 0) { _EOS_LobbyDetails_Release_4(param_1); _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(1,(byte *)"Failed to get info for invitation lobby: %s\n"); ExceptionList = local_10; return; } FUN_00a84a90(); local_8 = 0; uVar2 = *(undefined4 *)(local_18[0] + 0x14); iVar4 = __RTDynamicCast(local_28,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); iVar3 = param_1; *(undefined4 *)(iVar4 + 0x24) = uVar2; iVar4 = __RTDynamicCast(local_28,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); *(int *)(iVar4 + 0x28) = iVar3; lobbyPtr = &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor; pvVar5 = (void *)__RTDynamicCast(local_28,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); lobbyCtrl = (void *)0xa60bb4; Lobby::refresh_members(pvVar5); FUN_00a28840(&local_28); pvVar5 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_3c,lobbyPtr,lobbyCtrl); local_8._0_1_ = 1; FUN_00a2a430(pvVar5); local_3c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,2); if (local_34 != (int *)0x0) { cVar1 = (**(code **)(*local_34 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_38); } } _EOS_LobbyDetails_Info_Release_4(local_18[0]); local_8 = 3; if (local_24 != (int *)0x0) { cVar1 = (**(code **)(*local_24 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_28); } } ExceptionList = local_10; return; } //@@ 00a60c50 FUN_00a60c50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a60c50(int param_1) { char cVar1; undefined4 uVar2; int iVar3; void *pvVar4; TypeDescriptor *lobbyPtr; void *lobbyCtrl; undefined **local_48; undefined1 local_44 [4]; int *local_40; undefined4 local_3c; undefined4 local_38; int *local_34; int local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; uint local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12f75; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_44 + 0x40); ExceptionList = &local_10; local_24 = 0; local_28 = 1; local_20 = *(undefined4 *)(param_1 + 8); local_1c = *(undefined4 *)(param_1 + 0xc); uVar2 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&local_28,&local_2c,local_18); iVar3 = _EOS_Lobby_CopyLobbyDetailsHandleByUiEventId_12(uVar2); if (iVar3 == 0) { local_3c = 1; iVar3 = _EOS_LobbyDetails_CopyInfo_12(local_2c,&local_3c,&local_30); if (iVar3 == 0) { FUN_00a84a90(); local_8 = 0; uVar2 = *(undefined4 *)(local_30 + 0x14); iVar3 = __RTDynamicCast(local_38,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar3 + 0x24) = uVar2; iVar3 = __RTDynamicCast(local_38,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); *(undefined4 *)(iVar3 + 0x28) = local_2c; lobbyPtr = &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor; pvVar4 = (void *)__RTDynamicCast(local_38,0, &KAGE::Network::Multiplayer::LobbyImplBase:: RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0 ); lobbyCtrl = (void *)0xa60d8a; Lobby::refresh_members(pvVar4); FUN_00a28840(&local_38); pvVar4 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_48,lobbyPtr,lobbyCtrl); local_8._0_1_ = 1; FUN_00a2a430(pvVar4); local_48 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,2); if (local_40 != (int *)0x0) { cVar1 = (**(code **)(*local_40 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_44); } } _EOS_LobbyDetails_Info_Release_4(local_30); local_8 = 3; if (local_34 != (int *)0x0) { cVar1 = (**(code **)(*local_34 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } } } else { _EOS_LobbyDetails_Release_4(local_2c); _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(1,(byte *)"Failed to get info for presence lobby: %s\n"); } } else { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(1,(byte *)"Failed to get details for presence lobby: %s\n"); } ExceptionList = local_10; return; } //@@ 00a60e30 FUN_00a60e30 void FUN_00a60e30(byte param_1) { void *in_ECX; FUN_00a60e60(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x30); } return; } //@@ 00a60e60 FUN_00a60e60 void FUN_00a60e60(void) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Manager::vftable; in_ECX[7] = CCallbackImpl<2572>::vftable; if ((*(byte *)(in_ECX + 8) & 1) != 0) { SteamAPI_UnregisterCallback(in_ECX + 7); } *in_ECX = KAGE::Network::ManagerBase::vftable; in_ECX[4] = 0; in_ECX[5] = 0; FUN_00a1a500(); operator_delete((void *)in_ECX[2],0x10); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00a60ec0 FUN_00a60ec0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00a60ec0(void) { int *piVar1; undefined4 *puVar2; LPCRITICAL_SECTION lpCriticalSection; int in_ECX; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar1 != 0) { puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); (**(code **)(*(int *)*puVar2 + 0x38))("epiconlineservices"); } if ((DAT_00c5ab48 & 1) == 0) { lpCriticalSection = operator_new(0x1c); if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { lpCriticalSection = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; InitializeCriticalSection(lpCriticalSection); } DAT_00c5ab48 = DAT_00c5ab48 | 1; DAT_00c5ab4c = lpCriticalSection; } if (DAT_00c79b3c == '\0') { (**(code **)(DAT_00c79b54 + 4))(); DAT_00c79b3c = '\x01'; } if (((byte)g_multiplayerCommandThreadFlags & 1) == 0) { if (DAT_00c79a84 == '\0') { (**(code **)(DAT_00c79a9c + 4))(); DAT_00c79a84 = '\x01'; } (**(code **)(DAT_00c79aa8 + 4)) (FUN_00a9e950,2,0xffffffff,0x10000,&g_multiplayerCommandThreadFlags); g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags | 1; } else { KAGE_LogMessage(0x10,(byte *)"Command thread is already initialized\n"); } if (DAT_00c79ac0 == '\0') { (**(code **)(DAT_00c79ad8 + 4))(); DAT_00c79ac0 = '\x01'; } std::list>::push_back(FUN_00a732b0,&DAT_00c79a60); _DAT_00c79a54 = _DAT_00c79a54 | 1; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; return 1; } //@@ 00a61000 FUN_00a61000 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a61000(void) { uint uVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0a10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(void **)(in_ECX + 0x18) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x18),0); *(undefined4 *)(in_ECX + 0x18) = 0; } local_8 = 0xffffffff; if (((byte)g_multiplayerCommandThreadFlags & 1) != 0) { g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags | 2; (**(code **)(DAT_00c79aa8 + 0xc))(uVar1); KAGE::ThreadSafeQueue::shutdown(); g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags & 0xfc; } KAGE::ThreadSafeQueue::shutdown(); FUN_00a1d6b0(FUN_00a732b0); KAGE::ThreadSafeQueue::shutdown(); _DAT_00c79a54 = _DAT_00c79a54 & 0xfffffffe; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; ExceptionList = local_10; return; } //@@ 00a610d0 FUN_00a610d0 uint FUN_00a610d0(code *param_1,undefined4 param_2) { uint uVar1; int in_ECX; if (g_multiplayerService != (void *)0x0) { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 2; *(code **)(in_ECX + 0x10) = param_1; *(undefined4 *)(in_ECX + 0x14) = param_2; uVar1 = (**(code **)(*(int *)g_multiplayerService + 0xc))(param_1,param_2); return uVar1; } uVar1 = 0; if (param_1 != (code *)0x0) { uVar1 = (*param_1)(0,param_2); } return uVar1 & 0xffffff00; } //@@ 00a61120 FUN_00a61120 undefined4 FUN_00a61120(void) { char cVar1; int *piVar2; undefined4 *puVar3; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar2 != 0) { puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); cVar1 = (**(code **)(*(int *)*puVar3 + 4))(); if ((cVar1 != '\0') && (g_multiplayerService != (void *)0x0)) { cVar1 = (**(code **)(*(int *)g_multiplayerService + 0x10))(); if (cVar1 != '\0') { return 1; } } } return 0; } //@@ 00a61170 FUN_00a61170 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a61170(int param_1) { char cVar1; uint uVar2; undefined4 in_ECX; int *piVar3; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; if (param_1 == 0) { eos_user_info_find_or_create(local_18,g_eosLocalUserId,in_ECX); local_8 = param_1; if (((local_14 != (int *)0x0) && (cVar1 = (**(code **)(*local_14 + 0xc))(), cVar1 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_18); } } local_8 = 0xffffffff; _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffd; if (DAT_00c5abd0 != (code *)0x0) { (*DAT_00c5abd0)(param_1,DAT_00c5abd4,uVar2); DAT_00c5abd0 = (code *)0x0; DAT_00c5abd4 = 0; } if ((param_1 == 0) && (piVar3 = (int *)*DAT_00c5abc8, piVar3 != DAT_00c5abc8)) { do { (*(code *)piVar3[2])(1,piVar3[3]); piVar3 = (int *)*piVar3; } while (piVar3 != DAT_00c5abc8); } ExceptionList = local_10; return; } //@@ 00a61250 FUN_00a61250 void FUN_00a61250(int param_1) { int iVar1; qword qVar2; uint uVar3; uint *puVar4; undefined4 uVar5; int in_ECX; undefined4 uStack_34; undefined4 *puStack_30; undefined4 uStack_2c; undefined4 uStack_28; int iStack_24; undefined4 uStack_20; uint local_1c; qword *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar1 = param_1; puStack_c = &LAB_00b01100; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(int *)(param_1 + 4) == 1) { if (*(void **)(in_ECX + 0x18) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x18),0); *(undefined4 *)(in_ECX + 0x18) = 0; } local_8 = 0xffffffff; local_14 = 1; _EOS_ByteArray_ToString_16 (iVar1 + 0xc,*(undefined4 *)(iVar1 + 8),(int)¶m_1 + 3,&local_14,uVar3); if (g_mainHeap == (void *)0x0) { local_18 = &g_allocatedBytesNoHeap; } else { local_18 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = local_14 + 4; local_1c = (uint)(0xfffffffb < local_14); puVar4 = malloc(uVar3); if (puVar4 == (uint *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar4 = (uint *)0x0; } else { *puVar4 = uVar3; qVar2 = *local_18; *(uint *)local_18 = (uint)*local_18 + uVar3; *(uint *)((int)local_18 + 4) = *(uint *)((int)local_18 + 4) + local_1c + (uint)CARRY4((uint)qVar2,uVar3); puVar4 = puVar4 + 1; } *(uint **)(in_ECX + 0x18) = puVar4; _EOS_ByteArray_ToString_16(iVar1 + 0xc,*(undefined4 *)(iVar1 + 8),puVar4,&local_14); if ((DAT_00c5abf4 & 2) != 0) { FUN_00a60050(); } if ((DAT_00c5abf4 & 4) != 0) { iVar1 = *(int *)(in_ECX + 0x18); if (iVar1 == 0) { DAT_00c5abf4 = DAT_00c5abf4 | 4; ExceptionList = local_10; return; } KAGE_LogMessage(1,(byte *)"Connecting to EOS...\n"); puStack_30 = &uStack_28; DAT_00c5abf4 = DAT_00c5abf4 & 0xfffffffb | 8; uStack_2c = 0; uStack_20 = 0; uStack_34 = 2; uStack_28 = 1; if (iVar1 != DAT_00c5abf8) { uStack_20 = 0x12; } iStack_24 = iVar1; uVar5 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&uStack_34,0,FUN_00a60590); _EOS_Connect_Login_16(uVar5); } } ExceptionList = local_10; return; } //@@ 00a61400 FUN_00a61400 void FUN_00a61400(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<2572>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } return; } //@@ 00a61440 FUN_00a61440 undefined4 FUN_00a61440(void) { return 0xa0c; } //@@ 00a61450 FUN_00a61450 void FUN_00a61450(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<2572>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a61490 FUN_00a61490 undefined4 FUN_00a61490(void) { int *piVar1; undefined4 *puVar2; undefined4 uVar3; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); if (*piVar1 == 0) { return 1; } puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4ec); uVar3 = (**(code **)(*(int *)*puVar2 + 0xc))(); return uVar3; } //@@ 00a614d0 buffer_decompress /* DB: ? (dst ECX, dstLen EDX power of two "Destination buffer length is not a power of two", src, srcLen): lazily allocates a global inflater, inits, then tinfl_decompress (misnamed tdefl_compress 00a85710) or memcpy + XOR keystream FUN_00a89d70; netplay message readers 00918d00, 0091ad50 */ size_t buffer_decompress(void *param_1,undefined4 *param_2) { char cVar1; undefined4 *in_ECX; size_t in_EDX; undefined4 *local_8; local_8 = in_ECX; cVar1 = FUN_00a15570(); if (cVar1 == '\0') { KAGE_LogMessage(0x10,(byte *)"Destination buffer length is not a power of two"); } if (g_deflateCompressor == (void *)0x0) { local_8 = operator_new(0x14); if (local_8 == (undefined4 *)0x0) { g_deflateCompressor = (undefined4 *)0x0; } else { *local_8 = 0; local_8[1] = 0; local_8[3] = 0; g_deflateCompressor = local_8; } } FUN_00a89c90(0); local_8 = param_2; if (*(char *)((int)g_deflateCompressor + 0x10) == '\0') { *(undefined1 *)((int)g_deflateCompressor + 0x10) = 0; tinfl_decompress(&local_8); return in_EDX; } memcpy(in_ECX,param_1,(size_t)param_2); FUN_00a89d70(in_ECX,param_2); return (size_t)param_2; } //@@ 00a615a0 FUN_00a615a0 void FUN_00a615a0(void) { undefined4 *in_ECX; operator_delete((void *)in_ECX[1],0x4df40); operator_delete((void *)in_ECX[3],0x2af0); operator_delete((void *)*in_ECX,0x810); operator_delete(in_ECX,0x14); return; } //@@ 00a615e0 FUN_00a615e0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a615e0(void) { int iVar1; void *ptr; char *pcVar2; int in_ECX; char *this; if (g_theoraVideoManager != (void *)0x0) { (*(code *)**(undefined4 **)g_theoraVideoManager)(1); } pcVar2 = DAT_00c79be4; g_theoraVideoManager = (void *)0x0; iVar1 = DAT_00c798d8; for (this = DAT_00c79be0; DAT_00c798d8 = iVar1, this != pcVar2; this = this + 0x34) { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); iVar1 = DAT_00c798d8; } _DAT_00c5ab08 = _DAT_00c5ab08 & 0xfffffffe; DAT_00c5ab14 = DAT_00c5ab14 & 0xfffffffe; _DAT_00c5af9c = _DAT_00c5af9c & 0xfffffffe; DAT_00c79be4 = DAT_00c79be0; FUN_00a23ee0(&DAT_00c798d8,*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; DAT_00c798dc = 0; g_userProfile = (void *)0x0; KAGE::SmartPointer::reset(&DAT_00c799d8,(void *)0x0); ptr = g_userProfileLock; if (g_userProfileLock != (void *)0x0) { DeleteCriticalSection(g_userProfileLock); operator_delete(ptr,0x1c); g_userProfileLock = (void *)0x0; } DAT_00c5aa74 = DAT_00c5aa74 & 0xfe; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a616c0 FUN_00a616c0 void FUN_00a616c0(void) { void *pvVar1; int in_ECX; undefined4 *puVar2; undefined4 in_XMM0_Da; undefined4 in_XMM0_Db; undefined4 *local_1c; undefined1 local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b12fed; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00a266a0(__security_cookie ^ (int)register0x00000010 - 4U); pvVar1 = g_theoraVideoManager; local_1c = (undefined4 *)0x0; local_18 = 0; puVar2 = *(undefined4 **)((int)g_theoraVideoManager + 0x28); local_14 = (float)(double)CONCAT44(in_XMM0_Db,in_XMM0_Da) - *(float *)(in_ECX + 0x2c); *(float *)(in_ECX + 0x2c) = (float)(double)CONCAT44(in_XMM0_Db,in_XMM0_Da); if (puVar2 != (undefined4 *)0x0) { local_1c = puVar2; Mutex::lock(puVar2); } local_8 = 0; puVar2 = *(undefined4 **)((int)pvVar1 + 0x10); if (puVar2 != *(undefined4 **)((int)pvVar1 + 0x14)) { do { FUN_00a90bc0(); (**(code **)(*(int *)*puVar2 + 0x18))(); puVar2 = puVar2 + 1; } while (puVar2 != *(undefined4 **)((int)pvVar1 + 0x14)); } if (local_1c != (undefined4 *)0x0) { *(undefined1 *)(local_1c + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_1c); local_1c = (undefined4 *)0x0; } Mutex::ScopeLock::~ScopeLock(&local_1c); ExceptionList = local_10; return; } //@@ 00a61790 FUN_00a61790 void FUN_00a61790(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::System::ManagerBase::vftable; FUN_00a1a500(); operator_delete((void *)in_ECX[9],0x10); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x2c); } return; } //@@ 00a617e0 FUN_00a617e0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00a617e0(void) { char cVar1; uint uVar2; int *piVar3; void *other; LPCRITICAL_SECTION lpCriticalSection; int in_ECX; undefined1 local_18 [4]; LPCRITICAL_SECTION local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1301d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8,uVar2); if (*piVar3 != 0) { piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510,uVar2); if (*piVar3 != 0) { _DAT_00c5ab08 = _DAT_00c5ab08 | 1; } } piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8,uVar2); if (*piVar3 != 0) { piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510,uVar2); if ((*piVar3 != 0) && ((DAT_00c5ab14 & 1) == 0)) { (**(code **)(DAT_00c5ab20 + 4))(); (**(code **)(DAT_00c5ab34 + 4))(); DAT_00c5ab14 = DAT_00c5ab14 | 1; } } _DAT_00c5af9c = _DAT_00c5af9c | 1; other = KAGE_Graphics::create_image (local_18,0xb24558,0x671,0,(byte *)"KAGE_UserProfileDefaultIcon"); local_8 = 0; KAGE::SmartPointer::operator_assign(&DAT_00c799d8,other); local_8 = 1; if (local_14 != (LPCRITICAL_SECTION)0x0) { cVar1 = (**(code **)(*(int *)local_14 + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(local_18); } } local_8 = 0xffffffff; if ((DAT_00c5aa74 & 1) == 0) { lpCriticalSection = operator_new(0x1c); if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { lpCriticalSection = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; local_14 = lpCriticalSection; InitializeCriticalSection(lpCriticalSection); } DAT_00c5aa74 = DAT_00c5aa74 | 1; g_userProfileLock = lpCriticalSection; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; ExceptionList = local_10; return 1; } //@@ 00a61940 FUN_00a61940 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a61940(void) { void *ptr; int iVar1; int in_ECX; iVar1 = DAT_00c798d8; _DAT_00c5ab08 = _DAT_00c5ab08 & 0xfffffffe; DAT_00c5ab14 = DAT_00c5ab14 & 0xfffffffe; _DAT_00c5af9c = _DAT_00c5af9c & 0xfffffffe; FUN_00a23ee0(&DAT_00c798d8,*(undefined4 *)(DAT_00c798d8 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; DAT_00c798dc = 0; g_userProfile = (void *)0x0; KAGE::SmartPointer::reset(&DAT_00c799d8,(void *)0x0); ptr = g_userProfileLock; if (g_userProfileLock != (void *)0x0) { DeleteCriticalSection(g_userProfileLock); operator_delete(ptr,0x1c); g_userProfileLock = (void *)0x0; } DAT_00c5aa74 = DAT_00c5aa74 & 0xfe; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a619d0 FUN_00a619d0 void FUN_00a619d0(undefined4 *param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *(undefined4 *)(in_ECX + 8) = *param_1; *(undefined4 *)(in_ECX + 0xc) = uVar1; *(undefined4 *)(in_ECX + 0x10) = uVar2; *(undefined4 *)(in_ECX + 0x14) = uVar3; *(undefined8 *)(in_ECX + 0x18) = *(undefined8 *)(param_1 + 4); *(undefined4 *)(in_ECX + 0x20) = param_1[6]; return; } //@@ 00a61a00 FUN_00a61a00 bool FUN_00a61a00(void) { int in_ECX; return *(int *)(in_ECX + 8) != 4; } //@@ 00a61a10 FUN_00a61a10 void FUN_00a61a10(void) { int in_ECX; *(undefined4 *)(in_ECX + 8) = 4; return; } //@@ 00a61a20 FUN_00a61a20 undefined * FUN_00a61a20(void) { return &DAT_00b6c514; } //@@ 00a61a30 FUN_00a61a30 void FUN_00a61a30(undefined4 param_1) { uint uVar1; int in_ECX; int *piVar2; if ((char)param_1 == '\0') { uVar1 = *(uint *)(in_ECX + 4) & 0xfffffffd; } else { uVar1 = *(uint *)(in_ECX + 4) | 2; } *(uint *)(in_ECX + 4) = uVar1; piVar2 = (int *)**(int **)(in_ECX + 0x24); if (piVar2 != *(int **)(in_ECX + 0x24)) { do { (*(code *)piVar2[2])(param_1,piVar2[3]); piVar2 = (int *)*piVar2; } while (piVar2 != (int *)*(int *)(in_ECX + 0x24)); } return; } //@@ 00a61a80 FUN_00a61a80 void FUN_00a61a80(byte param_1) { undefined4 *in_ECX; in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,8); } return; } //@@ 00a61ab0 FUN_00a61ab0 undefined4 FUN_00a61ab0(void) { int *piVar1; int in_ECX; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*piVar1 != 0) { piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar1 != 0) { *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; return 1; } } return 0; } //@@ 00a61af0 FUN_00a61af0 void FUN_00a61af0(undefined4 param_1) { undefined4 *puVar1; int in_ECX; if ((*(byte *)(in_ECX + 4) & 1) != 0) { puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar1 + 0x18))(param_1); puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar1 + 0x24))(); } return; } //@@ 00a61b30 FUN_00a61b30 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a61b30(undefined4 param_1) { undefined4 *puVar1; int in_ECX; byte *buffer; byte *pbVar2; byte local_18 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); if ((*(byte *)(in_ECX + 4) & 1) != 0) { buffer = local_18; pbVar2 = s__d; sprintf(buffer,s__d); puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8,buffer,pbVar2,param_1); (**(code **)(*(int *)*puVar1 + 0x18))(local_18); puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar1 + 0x24))(); } return; } //@@ 00a61ba0 FUN_00a61ba0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a61ba0(undefined4 param_1,int param_2,undefined4 param_3,int param_4) { char cVar1; undefined4 *puVar2; int *in_ECX; byte *buffer; char *pcVar3; undefined4 uVar4; undefined4 local_54; undefined4 local_50; int local_4c; byte local_48 [64]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_48 + 0x44); if ((*(byte *)(in_ECX + 1) & 1) != 0) { cVar1 = (**(code **)(*in_ECX + 0x2c))(param_1); if (cVar1 == '\0') { buffer = local_48; pcVar3 = "%s_stat"; uVar4 = param_1; sprintf(buffer,(byte *)"%s_stat"); local_4c = 0; puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8,buffer,pcVar3,uVar4); cVar1 = (**(code **)(*(int *)*puVar2 + 4))(local_48,&local_4c); if (cVar1 != '\0') { if ((local_4c < param_2) && (local_4c / param_4 != param_2 / param_4)) { local_54 = 0; local_50 = 0; puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar2 + 0xac))(param_1,&local_54,&local_50); puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar2 + 0x30))(param_1,param_2,local_50); } puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar2 + 0xc))(local_48,param_2); puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar2 + 0x24))(); return; } KAGE_LogMessage(8,(byte *) "Failed to set progress for achievement \'%s\', the stat \'%s\' does not exist\n" ); } } return; } //@@ 00a61cd0 FUN_00a61cd0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a61cd0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int *in_ECX; byte local_18 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); sprintf(local_18,s__d); (**(code **)(*in_ECX + 0x1c))(local_18,param_2,param_3,param_4); return; } //@@ 00a61d20 FUN_00a61d20 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a61d20(undefined4 param_1,undefined4 *param_2,undefined4 *param_3) { char cVar1; undefined4 *puVar2; byte *buffer; char *pcVar3; undefined4 uVar4; undefined4 local_54; undefined4 local_50; undefined4 local_4c; byte local_48 [64]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_48 + 0x44); buffer = local_48; pcVar3 = "%s_stat"; uVar4 = param_1; sprintf(buffer,(byte *)"%s_stat"); local_4c = 0; local_54 = 0; local_50 = 0; puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8,buffer,pcVar3,uVar4); cVar1 = (**(code **)(*(int *)*puVar2 + 4))(local_48,&local_4c); if (cVar1 != '\0') { puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); cVar1 = (**(code **)(*(int *)*puVar2 + 0xac))(param_1,&local_54,&local_50); if (cVar1 != '\0') { *param_2 = local_4c; *param_3 = local_50; return 1; } } KAGE_LogMessage(8,(byte *)"Could not retrieve progress for achievement \'%s\'\n"); return 0; } //@@ 00a61df0 FUN_00a61df0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a61df0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int *in_ECX; byte local_18 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); sprintf(local_18,s__d); (**(code **)(*in_ECX + 0x24))(local_18,param_2,param_3); return; } //@@ 00a61e50 FUN_00a61e50 uint FUN_00a61e50(undefined4 param_1) { uint uVar1; undefined4 *puVar2; uint in_ECX; undefined4 uStack_8; uVar1 = 0; uStack_8 = in_ECX & 0xffffff; if ((*(byte *)(in_ECX + 4) & 1) != 0) { puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); (**(code **)(*(int *)*puVar2 + 0x14))(param_1,(int)&uStack_8 + 3); uVar1 = uStack_8 >> 0x18; } return uVar1; } //@@ 00a61e90 FUN_00a61e90 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a61e90(void) { int *in_ECX; byte local_18 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); sprintf(local_18,s__d); (**(code **)(*in_ECX + 0x2c))(local_18); return; } //@@ 00a61ee0 FUN_00a61ee0 void FUN_00a61ee0(undefined4 param_1,undefined1 param_2) { __acrt_iob_func(1,¶m_2); FUN_008c5d20(); return; } //@@ 00a61f00 FUN_00a61f00 void FUN_00a61f00(undefined4 *param_1) { if (0xf < (uint)param_1[5]) { param_1 = (undefined4 *)*param_1; } FUN_00a61ee0(&DAT_00b6ec00,param_1); return; } //@@ 00a61f20 theoraplayer::init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: "Initializing theoraplayer with theora support." through the log fn PTR_00c5aa7c, creates g_theoraVideoManager = TheoraVideoManager::TheoraVideoManager, registers format "Theora" (0x34-byte entry) and VideoClip_Theora factory (FUN_00a8c430) */ void theoraplayer::init(void) { uint uVar1; char *pcVar2; undefined4 extraout_ECX; void *pvVar3; char local_b0 [24]; char local_98 [24]; code *local_80; char *local_74; void *local_70; undefined2 local_6c; undefined1 local_6a; undefined4 local_60; uint local_5c; void *local_58; undefined1 local_54; undefined4 local_48; uint local_44; code *local_40; char *local_3c [4]; undefined4 local_2c; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (char *)0xffffffff; puStack_18 = &LAB_00b130af; local_1c = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; local_2c = 0; local_28 = 0xf; local_3c[0] = (char *)0x0; local_24 = uVar1; local_3c[0] = std::_Allocate(0x30); local_2c = 0x2e; local_28 = 0x2f; builtin_strncpy(local_3c[0],"Initializing theoraplayer with theora support.",0x2f); local_14 = (char *)0x0; (*(code *)PTR_FUN_00c5aa7c)(local_3c,uVar1); local_14 = (char *)0xffffffff; if (0xf < local_28) { uVar1 = local_28 + 1; pcVar2 = local_3c[0]; if (0xfff < uVar1) { pcVar2 = *(char **)(local_3c[0] + -4); uVar1 = local_28 + 0x24; if ((char *)0x1f < local_3c[0] + (-4 - (int)pcVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar2,uVar1); } local_74 = operator_new(0x30); local_14 = (char *)0x1; if (local_74 == (void *)0x0) { g_theoraVideoManager = (void *)0x0; } else { g_theoraVideoManager = (void *)TheoraVideoManager::TheoraVideoManager(); } local_5c = 0xf; local_44 = 0xf; local_14 = (char *)0x2; local_70 = (void *)0x6f656854; local_6c = 0x6172; local_60 = 6; local_6a = 0; local_48 = 4; local_58 = (void *)0x76676f2e; local_54 = 0; local_74 = local_b0; local_40 = FUN_00a8c700; std::string::string(local_b0,&local_70); local_14._0_1_ = 3; std::string::string(local_98,&local_58); pcVar2 = DAT_00c79be4; local_80 = local_40; local_14._0_1_ = 4; if (DAT_00c79be4 == DAT_00c79be8) { FUN_00a621e0(DAT_00c79be4,local_b0); } else { local_74 = DAT_00c79be4; std::string::string(DAT_00c79be4,local_b0); local_14._0_1_ = 5; std::string::string(pcVar2 + 0x18,local_98); *(code **)(pcVar2 + 0x30) = local_80; DAT_00c79be4 = DAT_00c79be4 + 0x34; } local_14 = (char *)CONCAT31(local_14._1_3_,2); std::string::_Tidy_deallocate(local_98); std::string::_Tidy_deallocate(local_b0); FUN_00a8a970(extraout_ECX); if (0xf < local_44) { uVar1 = local_44 + 1; pvVar3 = local_58; if (0xfff < uVar1) { pvVar3 = *(void **)((int)local_58 + -4); uVar1 = local_44 + 0x24; if (0x1f < (uint)((int)local_58 + (-4 - (int)pvVar3))) goto LAB_00a6219a; } operator_delete(pvVar3,uVar1); } if (0xf < local_5c) { uVar1 = local_5c + 1; pvVar3 = local_70; if (0xfff < uVar1) { pvVar3 = *(void **)((int)local_70 + -4); uVar1 = local_5c + 0x24; if (0x1f < (uint)((int)local_70 + (-4 - (int)pvVar3))) { LAB_00a6219a: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar1); } ExceptionList = local_1c; return; } //@@ 00a621d0 FUN_00a621d0 void FUN_00a621d0(void) { (*(code *)PTR_FUN_00c5aa7c)(); return; } //@@ 00a621e0 FUN_00a621e0 char * FUN_00a621e0(char *param_1,void *param_2) { uint uVar1; int iVar2; char *pcVar3; char *pcVar4; int iVar5; uint uVar6; undefined4 extraout_ECX; uint uVar7; char *this; char *pcVar8; undefined4 uVar9; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b130ed; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = (int)param_1 - (int)DAT_00c79be0; iVar2 = ((int)DAT_00c79be4 - (int)DAT_00c79be0) / 0x34; if (iVar2 == 0x4ec4ec4) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar2 + 1; uVar7 = ((int)DAT_00c79be8 - (int)DAT_00c79be0) / 0x34; if (0x4ec4ec4 - (uVar7 >> 1) < uVar7) { uVar6 = 0x4ec4ec4; } else { uVar7 = (uVar7 >> 1) + uVar7; uVar6 = uVar1; if (uVar1 <= uVar7) { uVar6 = uVar7; } if (0x4ec4ec4 < uVar6) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } pcVar4 = std::_Allocate(uVar6 * 0x34); local_8 = 0; this = pcVar4 + (iVar5 / 0x34) * 0x34; std::string::string(this,param_2); local_8 = CONCAT31(local_8._1_3_,1); std::string::string(this + 0x18,(void *)((int)param_2 + 0x18)); *(undefined4 *)(this + 0x30) = *(undefined4 *)((int)param_2 + 0x30); pcVar8 = pcVar4; uVar9 = extraout_ECX; if (param_1 != DAT_00c79be4) { FUN_00a62400(pcVar4,extraout_ECX); pcVar8 = this + 0x34; } FUN_00a62400(pcVar8,uVar9); pcVar3 = DAT_00c79be4; pcVar8 = DAT_00c79be0; if (DAT_00c79be0 != (char *)0x0) { for (; pcVar8 != pcVar3; pcVar8 = pcVar8 + 0x34) { std::string::_Tidy_deallocate(pcVar8 + 0x18); std::string::_Tidy_deallocate(pcVar8); } uVar7 = (((int)DAT_00c79be8 - (int)DAT_00c79be0) / 0x34) * 0x34; pcVar8 = DAT_00c79be0; if (0xfff < uVar7) { pcVar8 = *(char **)(DAT_00c79be0 + -4); uVar7 = uVar7 + 0x23; if ((char *)0x1f < DAT_00c79be0 + (-4 - (int)pcVar8)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar8,uVar7); } DAT_00c79be0 = pcVar4; DAT_00c79be4 = pcVar4 + uVar1 * 0x34; DAT_00c79be8 = pcVar4 + uVar6 * 0x34; ExceptionList = local_10; return this; } //@@ 00a623c9 Catch_All@00a623c9 void Catch_All_00a623c9(void) { int unaff_EBP; FUN_007e27a0(*(undefined4 *)(unaff_EBP + -0x24),*(undefined4 *)(unaff_EBP + -0x24)); FUN_007e27d0(*(undefined4 *)(unaff_EBP + -0x28),*(undefined4 *)(unaff_EBP + -0x14)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00a62400 FUN_00a62400 void FUN_00a62400(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined4 *in_EDX; undefined4 *puVar6; if (in_ECX != in_EDX) { puVar5 = param_1; puVar6 = in_ECX + 0xb; do { *puVar5 = 0; puVar5[4] = 0; puVar5[5] = 0; uVar2 = puVar6[-10]; uVar3 = puVar6[-9]; uVar4 = puVar6[-8]; *puVar5 = puVar6[-0xb]; puVar5[1] = uVar2; puVar5[2] = uVar3; puVar5[3] = uVar4; *(undefined8 *)(puVar5 + 4) = *(undefined8 *)(puVar6 + -7); puVar6[-7] = 0; puVar6[-6] = 0xf; *(undefined1 *)(puVar6 + -0xb) = 0; puVar5[6] = 0; puVar5[10] = 0; *(undefined4 *)((int)param_1 + (-0x34 - (int)in_ECX) + (int)(puVar6 + 0xd)) = 0; uVar2 = puVar6[-4]; uVar3 = puVar6[-3]; uVar4 = puVar6[-2]; puVar5[6] = puVar6[-5]; puVar5[7] = uVar2; puVar5[8] = uVar3; puVar5[9] = uVar4; *(undefined8 *)(puVar5 + 10) = *(undefined8 *)(puVar6 + -1); puVar6[-1] = 0; *puVar6 = 0xf; *(undefined1 *)(puVar6 + -5) = 0; puVar5[0xc] = puVar6[1]; puVar1 = puVar6 + 2; puVar5 = puVar5 + 0xd; puVar6 = puVar6 + 0xd; } while (puVar1 != in_EDX); } return; } //@@ 00a624c0 FUN_00a624c0 void FUN_00a624c0(LPCSTR param_1,char param_2) { undefined4 uVar1; HMODULE hModule; FARPROC pFVar2; int *in_ECX; LPCSTR in_EDX; hModule = (HMODULE)*in_ECX; if (hModule == (HMODULE)0x0) { if (DAT_00c7ac6a == '\0') { uVar1 = __acrt_iob_func(2,"Attempting to dlopen() while in the dynamic linker.\n"); FUN_008c5d50(uVar1); /* WARNING: Subroutine does not return */ abort(); } hModule = LoadLibraryA(in_EDX); *in_ECX = (int)hModule; if (hModule == (HMODULE)0x0) { return; } } pFVar2 = GetProcAddress(hModule,param_1); if ((pFVar2 == (FARPROC)0x0) && (param_2 != '\0')) { uVar1 = __acrt_iob_func(2,"%s() not found in %s: %s\n",param_1); FUN_008c5d50(uVar1); /* WARNING: Subroutine does not return */ exit(1); } return; } //@@ 00a62550 epoxy_is_desktop_gl bool epoxy_is_desktop_gl(void) { char *_Str2; int iVar1; /* 0x662550 3087 epoxy_is_desktop_gl */ if (g_epoxyBeginCount == 0) { _Str2 = (char *)(*(code *)epoxy_glGetString)(0x1f02); if (_Str2 != (char *)0x0) { iVar1 = strncmp("OpenGL ES",_Str2,9); return iVar1 != 0; } } return true; } //@@ 00a62590 epoxy_internal_gl_version /* DB: libepoxy: glGetString(GL_VERSION 0x1f02) (returns error_version ECX if null), skips non-digits, sscanf "%i.%i" else exit(1), returns major*10+minor; callers epoxy_gl_version, epoxy_internal_has_gl_extension */ int epoxy_internal_gl_version(void) { char *pcVar1; int iVar2; int in_ECX; int local_c; int local_8; pcVar1 = (char *)(*(code *)epoxy_glGetString)(0x1f02); if (pcVar1 == (char *)0x0) { return in_ECX; } iVar2 = isdigit((int)*pcVar1); for (; (iVar2 == 0 && (*pcVar1 != '\0')); pcVar1 = pcVar1 + 1) { iVar2 = isdigit((int)pcVar1[1]); } iVar2 = FUN_00837090(pcVar1,"%i.%i",&local_8,&local_c); if (iVar2 != 2) { /* WARNING: Subroutine does not return */ exit(1); } return local_c + local_8 * 10; } //@@ 00a62610 epoxy_gl_version void epoxy_gl_version(void) { /* 0x662610 3083 epoxy_gl_version */ epoxy_internal_gl_version(); return; } //@@ 00a62620 FUN_00a62620 undefined4 FUN_00a62620(void) { char cVar1; char *pcVar2; char *in_ECX; char *in_EDX; char *pcVar3; pcVar3 = in_EDX; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); pcVar2 = strstr(in_ECX,in_EDX); while( true ) { if (pcVar2 == (char *)0x0) { return 0; } cVar1 = pcVar2[(int)pcVar3 - (int)(in_EDX + 1)]; if ((cVar1 == ' ') || (cVar1 == '\0')) break; pcVar2 = strstr(pcVar2 + ((int)pcVar3 - (int)(in_EDX + 1)),in_EDX); } return 1; } //@@ 00a62680 epoxy_internal_has_gl_extension /* DB: libepoxy dispatch_common.c: epoxy_gl_version < 30 -> glGetString(GL_EXTENSIONS 0x1f03) + epoxy_extension_in_string 00a62620, else glGetIntegerv(GL_NUM_EXTENSIONS 0x821d) and strcmp each glGetStringi; caller epoxy_has_gl_extension */ uint epoxy_internal_has_gl_extension(void) { byte bVar1; int iVar2; uint uVar3; byte *pbVar4; byte *in_ECX; byte *pbVar5; byte in_DL; bool bVar6; byte *local_8; local_8 = in_ECX; iVar2 = epoxy_internal_gl_version(); if (iVar2 < 0x1e) { iVar2 = (*(code *)epoxy_glGetString)(0x1f03); if (iVar2 != 0) { uVar3 = FUN_00a62620(); return uVar3; } } else { (*(code *)epoxy_glGetIntegerv)(0x821d,&local_8); if (local_8 != (byte *)0x0) { iVar2 = 0; pbVar5 = local_8; if (0 < (int)local_8) { do { pbVar4 = (byte *)(*(code *)epoxy_glGetStringi)(0x1f03,iVar2); pbVar5 = in_ECX; do { bVar1 = *pbVar5; bVar6 = bVar1 < *pbVar4; if (bVar1 != *pbVar4) { LAB_00a62710: pbVar5 = (byte *)(-(uint)bVar6 | 1); goto LAB_00a62715; } if (bVar1 == 0) break; bVar1 = pbVar5[1]; bVar6 = bVar1 < pbVar4[1]; if (bVar1 != pbVar4[1]) goto LAB_00a62710; pbVar5 = pbVar5 + 2; pbVar4 = pbVar4 + 2; } while (bVar1 != 0); pbVar5 = (byte *)0x0; LAB_00a62715: if (pbVar5 == (byte *)0x0) { return 1; } iVar2 = iVar2 + 1; } while (iVar2 < (int)local_8); } return (uint)pbVar5 & 0xffffff00; } } return (uint)in_DL; } //@@ 00a62740 epoxy_has_gl_extension void epoxy_has_gl_extension(void) { /* 0x662740 3085 epoxy_has_gl_extension */ epoxy_internal_has_gl_extension(); return; } //@@ 00a62750 FUN_00a62750 void FUN_00a62750(void) { FUN_00a624c0(); return; } //@@ 00a627d0 FUN_00a627d0 void FUN_00a627d0(void) { LOCK(); g_epoxyBeginCount = g_epoxyBeginCount + 1; UNLOCK(); /* WARNING: Could not recover jumptable at 0x00a627db. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c0feb0)(); return; } //@@ 00a62800 FUN_00a62800 void FUN_00a62800(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::ThreadBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,8); } return; } //@@ 00a62830 FUN_00a62830 void FUN_00a62830(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { char cVar1; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0x10))(); if (cVar1 != '\0') { KAGE_LogMessage(0x10,(byte *)"Thread is already running\n"); } (**(code **)(*in_ECX + 4))(param_1,param_2,0xffffffff,param_3,param_4); return; } //@@ 00a62870 FUN_00a62870 byte FUN_00a62870(void) { int in_ECX; return *(byte *)(in_ECX + 4) & 1; } //@@ 00a62880 VideoPlayer::unload /* DB: ? TheoraVideoManager::destroyVideoClip(this[1]), clears clip/flags, resets the RenderTarget SmartPointer (+8/+0xc, g_renderTargetReleaseFn); Manager::destructor */ void VideoPlayer::unload(void) { char cVar1; uint uVar2; undefined4 *in_ECX; undefined4 extraout_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; TheoraVideoManager::destroyVideoClip((void *)in_ECX[1]); in_ECX[1] = 0; *in_ECX = 0; *(undefined1 *)(in_ECX + 4) = 0; KAGE::SmartPointer::reset(extraout_ECX); local_8 = 0; if ((int *)in_ECX[3] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[3] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(in_ECX + 2); } } ExceptionList = local_10; return; } //@@ 00a62910 FUN_00a62910 undefined4 FUN_00a62910(byte *param_1) { int *this; int *this_00; byte bVar1; char cVar2; uint uVar3; int *piVar4; void *pvVar5; int iVar6; int width; int *in_ECX; undefined4 extraout_ECX; byte *pbVar7; longlong lVar8; KColor KStack_30; undefined1 auStack_1c [4]; int *local_18; byte *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1313f; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(auStack_1c + 0x18); ExceptionList = &local_10; TheoraVideoManager::destroyVideoClip((void *)in_ECX[1]); this = in_ECX + 2; in_ECX[1] = 0; *in_ECX = 0; *(undefined1 *)(in_ECX + 4) = 0; KAGE::SmartPointer::reset(extraout_ECX); piVar4 = operator_new(0x20); local_18 = piVar4; if (piVar4 == (int *)0x0) { piVar4 = (int *)0x0; } else { this_00 = piVar4 + 1; local_8 = 1; *piVar4 = (int)KAGE::System::TheoraDataSourceKAGE::vftable; *this_00 = 0; local_14 = param_1 + 1; piVar4[5] = 0; piVar4[6] = 0xf; *(char *)this_00 = '\0'; pbVar7 = param_1; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)this_00,param_1,(int)pbVar7 - (int)local_14); local_8 = CONCAT31(local_8._1_3_,2); pvVar5 = FileSystem::Open(&PTR_vftable_00c37a10,param_1,(int *)0x0); piVar4[7] = (int)pvVar5; } local_8 = 0xffffffff; *in_ECX = (int)piVar4; lVar8 = (**(code **)(*piVar4 + 8))(uVar3); if (lVar8 == 0) { if ((undefined4 *)*in_ECX != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*in_ECX)(1); *in_ECX = 0; ExceptionList = local_10; return 0; } } else { iVar6 = theora_create_video_clip(); in_ECX[1] = iVar6; if (iVar6 != 0) { KColor::SetFromARGB(&KStack_30,0); width = *(int *)(iVar6 + 0x60); if (*(char *)(iVar6 + 0x40) != '\0') { width = width / 2; } pvVar5 = KAGE_Graphics::create_render_target (auStack_1c,width,*(int *)(iVar6 + 100),(byte *)"VideoPlayerImage", &KStack_30); local_8 = 3; shared_ptr::operator_assign(this,pvVar5); local_8 = 4; if (local_18 != (int *)0x0) { cVar2 = (**(code **)(*local_18 + 0xc))(); if ((cVar2 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(auStack_1c); } } local_8 = 0xffffffff; piVar4 = (int *)*this; if ((piVar4[0xc] != 1) || (piVar4[0xd] != 1)) { (**(code **)(*piVar4 + 0x44))(1,1); piVar4[0xc] = 1; piVar4[0xd] = 1; piVar4 = (int *)*this; } (**(code **)(DAT_00c798e0 + 0x20))(piVar4,0,1); RenderTarget::Clear(&DAT_00c798e0); FUN_00a13460(1); ExceptionList = local_10; return 1; } } ExceptionList = local_10; return 0; } //@@ 00a62a10 FUN_00a62a10 undefined4 FUN_00a62a10(void) { char cVar1; int iVar2; int width; void *other; undefined4 in_ECX; int *unaff_EBX; int unaff_EBP; undefined4 *unaff_ESI; int *piVar3; undefined4 in_stack_fffffff4; undefined4 in_stack_fffffff8; undefined4 in_stack_fffffffc; iVar2 = theora_create_video_clip (in_ECX,*unaff_ESI,in_stack_fffffff4,in_stack_fffffff8,in_stack_fffffffc); unaff_ESI[1] = iVar2; if (iVar2 == 0) { ExceptionList = *(void **)(unaff_EBP + -0xc); return 0; } KColor::SetFromARGB((KColor *)(unaff_EBP + -0x2c),0); width = *(int *)(iVar2 + 0x60); if (*(char *)(iVar2 + 0x40) != '\0') { width = width / 2; } other = KAGE_Graphics::create_render_target ((void *)(unaff_EBP + -0x18),width,*(int *)(iVar2 + 100), (byte *)"VideoPlayerImage",(KColor *)(unaff_EBP + -0x2c)); *(undefined4 *)(unaff_EBP + -4) = 3; shared_ptr::operator_assign(unaff_EBX,other); *(undefined4 *)(unaff_EBP + -4) = 4; if (*(int **)(unaff_EBP + -0x14) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(unaff_EBP + -0x14) + 0xc))(); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(unaff_EBP + -0x18); } } *(undefined4 *)(unaff_EBP + -4) = 0xffffffff; piVar3 = (int *)*unaff_EBX; if ((piVar3[0xc] != 1) || (piVar3[0xd] != 1)) { (**(code **)(*piVar3 + 0x44))(1,1); piVar3[0xc] = 1; piVar3[0xd] = 1; piVar3 = (int *)*unaff_EBX; } (**(code **)(DAT_00c798e0 + 0x20))(piVar3,0,1); RenderTarget::Clear(&DAT_00c798e0); FUN_00a13460(1); ExceptionList = *(void **)(unaff_EBP + -0xc); return 1; } //@@ 00a62b10 VideoPlayer::render /* DB: thiscall, clip at this+4; only caller 0x95fcd0 = slot 5 of Cutscene::VideoPart vftable (0xb7c9f4); locks clip mutex, drops frames whose time passed (+0x9c dropped count), glBindTexture(this+8 +0x58) and draws the frame; neighbour of VideoPlayer::unload */ void VideoPlayer::render(undefined1 param_1) { undefined *puVar1; void *pvVar2; int *piVar3; int iVar4; code *pcVar5; uint uVar6; int *piVar7; int in_ECX; int *piVar8; undefined4 extraout_ECX; undefined *puVar9; int iVar10; int iVar11; undefined4 uVar12; float10 fVar13; KColor local_3c; void *local_28; undefined1 local_24; float local_20; undefined *local_1c; int *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1317d; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; puVar1 = *(undefined **)(in_ECX + 4); if (puVar1 == (undefined *)0x0) { return; } local_14 = in_ECX; ExceptionList = &local_10; local_1c = puVar1; if (*(int *)(puVar1 + 0x88) != -1) goto LAB_00a62d83; pvVar2 = *(void **)(*(int *)(puVar1 + 0x1c) + 0xc); local_28 = (void *)0x0; local_24 = 0; if (pvVar2 != (void *)0x0) { local_28 = pvVar2; Mutex::lock(pvVar2); } local_8 = 0; fVar13 = (float10)(**(code **)(**(int **)(puVar1 + 0x28) + 4))(uVar6); iVar10 = 0; local_18 = (int *)**(int **)(puVar1 + 0x1c); piVar7 = (int *)*local_18; local_20 = (float)*(int *)(puVar1 + 0x98) * *(float *)(puVar1 + 0x58) + (float)fVar13; piVar8 = piVar7; puVar9 = puVar1; iVar11 = iVar10; if (piVar7 == local_18) { LAB_00a62be2: iVar10 = 0; if (piVar7 != local_18) { while ((iVar4 = piVar7[2], *(char *)(iVar4 + 8) != '\0' && ((float)*(int *)(iVar4 + 0xc) * *(float *)(puVar1 + 0x58) + *(float *)(iVar4 + 4) + *(float *)(puVar9 + 0x5c) < local_20))) { iVar11 = iVar11 + -1; iVar10 = iVar10 + 1; if ((iVar11 == 1) || (piVar7 = (int *)*piVar7, piVar7 == local_18)) break; } if (0 < iVar10) { *(int *)(puVar9 + 0x9c) = *(int *)(puVar9 + 0x9c) + iVar10; FUN_00aaaae0(iVar10); } } } else { do { piVar3 = (int *)*piVar8; iVar11 = iVar10 + 1; if (*(char *)(piVar8[2] + 8) == '\0') { iVar11 = iVar10; } piVar8 = piVar3; iVar10 = iVar11; } while (piVar3 != local_18); puVar9 = local_1c; if (iVar11 != 1) goto LAB_00a62be2; } iVar11 = 0; if (*(char *)(*(int *)(*(int *)**(undefined4 **)(puVar9 + 0x1c) + 8) + 8) != '\0') { iVar11 = *(int *)(*(int *)**(undefined4 **)(puVar9 + 0x1c) + 8); } if (((iVar11 != 0) && (local_20 < (float)*(int *)(iVar11 + 0xc) * *(float *)(puVar9 + 0x58) + *(float *)(iVar11 + 4) )) && (puVar9[0x90] != '\0')) { iVar11 = 0; } local_8 = 0xffffffff; Mutex::ScopeLock::~ScopeLock(&local_28); if (iVar11 == 0) { } else { (*(code *)epoxy_glEnable)(0xde1); (*(code *)epoxy_glBindTexture)(0xde1,*(undefined4 *)(*(int *)(local_14 + 8) + 0x58)); local_1c = epoxy_glTexSubImage2D; local_20 = *(float *)(iVar11 + 0x18); iVar11 = *(int *)(local_14 + 4); if (iVar11 == 0) { uVar12 = 0; iVar10 = 0; } else { uVar12 = *(undefined4 *)(iVar11 + 100); iVar10 = *(int *)(iVar11 + 0x60) / 2; if (*(char *)(iVar11 + 0x40) == '\0') { iVar10 = *(int *)(iVar11 + 0x60); } } (*(code *)epoxy_glTexSubImage2D)(0xde1,0,0,0,iVar10,uVar12,0x1907,0x1401,local_20); iVar11 = *(int *)(local_14 + 4); *(int *)(iVar11 + 0xa0) = *(int *)(iVar11 + 0xa0) + 1; pvVar2 = *(void **)(*(int *)(iVar11 + 0x1c) + 0xc); local_28 = (void *)0x0; local_24 = 0; if (*(char *)(iVar11 + 0x90) == '\0') { if (pvVar2 != (void *)0x0) { local_28 = pvVar2; Mutex::lock(pvVar2); } local_8 = 1; FUN_00aaaae0(1); *(undefined1 *)(iVar11 + 0x90) = 1; local_8 = 0xffffffff; Mutex::ScopeLock::~ScopeLock(&local_28); } else { if (pvVar2 != (void *)0x0) { local_28 = pvVar2; Mutex::lock(pvVar2); } local_8 = 2; FUN_00aaaae0(1); local_8 = 0xffffffff; Mutex::ScopeLock::~ScopeLock(&local_28); } } LAB_00a62d83: pcVar5 = *(code **)(**(int **)(local_14 + 8) + 0x20); KColor::SetFromARGB(&local_3c,0xffffffff); (*pcVar5)(¶m_1,extraout_ECX); ExceptionList = local_10; return; } //@@ 00a62dc0 FUN_00a62dc0 char * FUN_00a62dc0(void) { char cVar1; char *pcVar2; char *_Dest; char *in_ECX; if (in_ECX == (char *)0x0) { return (char *)0x0; } pcVar2 = in_ECX; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar2 + (1 - (int)(in_ECX + 1)))); pcVar2 = in_ECX; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); strncpy(_Dest,in_ECX,(size_t)(pcVar2 + (1 - (int)(in_ECX + 1)))); return _Dest; } //@@ 00a62e10 FUN_00a62e10 char * FUN_00a62e10(void) { char *pcVar1; char cVar2; char *in_ECX; char *pcVar3; char *_Dest; if (in_ECX == (char *)0x0) { _Dest = (char *)0x0; } else { pcVar3 = in_ECX; do { cVar2 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar2 != '\0'); _Dest = operator_new_tracked((uint)(pcVar3 + (1 - (int)(in_ECX + 1)))); pcVar3 = in_ECX; do { cVar2 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar2 != '\0'); strncpy(_Dest,in_ECX,(size_t)(pcVar3 + (1 - (int)(in_ECX + 1)))); } cVar2 = *_Dest; pcVar3 = _Dest; while (cVar2 != '\0') { if ((byte)(cVar2 + 0xbfU) < 0x1a) { *pcVar3 = cVar2 + ' '; } pcVar1 = pcVar3 + 1; pcVar3 = pcVar3 + 1; cVar2 = *pcVar1; } return _Dest; } //@@ 00a62e70 FUN_00a62e70 uint FUN_00a62e70(uint param_1) { uint uVar1; int in_ECX; byte *pbVar2; uint in_EDX; byte *pbVar3; uint uVar4; bool bVar5; if (param_1 < 9) { if (param_1 == 0) { return 0; } } else { param_1 = 8; } if (7 < in_EDX) { return 0; } pbVar3 = (byte *)((int)&DAT_00c12980 + in_EDX); uVar4 = 8 - in_EDX; if (in_EDX + param_1 < 9) { uVar4 = param_1; } pbVar2 = (byte *)(in_ECX + in_EDX); while (uVar1 = uVar4 - 4, 3 < uVar4) { if (*(int *)pbVar2 != *(int *)pbVar3) goto LAB_00a62ec6; pbVar2 = pbVar2 + 4; pbVar3 = pbVar3 + 4; uVar4 = uVar1; } if (uVar1 != 0xfffffffc) { LAB_00a62ec6: bVar5 = *pbVar2 < *pbVar3; if ((*pbVar2 != *pbVar3) || ((uVar1 != 0xfffffffd && ((bVar5 = pbVar2[1] < pbVar3[1], pbVar2[1] != pbVar3[1] || ((uVar1 != 0xfffffffe && ((bVar5 = pbVar2[2] < pbVar3[2], pbVar2[2] != pbVar3[2] || ((uVar1 != 0xffffffff && (bVar5 = pbVar2[3] < pbVar3[3], pbVar2[3] != pbVar3[3])))))))))) )) { return -(uint)bVar5 | 1; } } return 0; } //@@ 00a62f10 FUN_00a62f10 void * FUN_00a62f10(int param_1,int param_2,int param_3) { void *_Dst; uint _Size; _Size = param_2 * param_3; if ((param_1 == 0) || (_Size == 0)) { _Dst = (void *)0x0; } else { _Dst = malloc(_Size); if (_Dst == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } if (_Size < 0x8001) { memset(_Dst,0,_Size); return _Dst; } memset(_Dst,0,0x8000); memset((void *)((int)_Dst + 0x8000),0,_Size - 0x8000); return _Dst; } //@@ 00a62f90 FUN_00a62f90 void FUN_00a62f90(int param_1,void *param_2) { if ((param_1 != 0) && (param_2 != (void *)0x0)) { free(param_2); } return; } //@@ 00a62fb0 FUN_00a62fb0 void FUN_00a62fb0(uint param_1) { uint uVar1; int in_ECX; byte *in_EDX; if ((*(byte *)(in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)(in_ECX + 100) & 0x800) != 0) { return; } } else if ((*(uint *)(in_ECX + 100) & 0x300) == 0x300) { return; } uVar1 = crc32(*(uint *)(in_ECX + 0x108),in_EDX,param_1); *(uint *)(in_ECX + 0x108) = uVar1; return; } //@@ 00a63000 png_info_destroy /* DB: libpng: frees info text array (+0x38, num_text +0x30, 0x10-byte png_text), +0xa0, +0xac, row_pointers +0xb0 (count byte +0xb5), then memset(info,0,0xb8) prototype: db/protos.zhl */ void __fastcall png_info_destroy(void *pngPtr,void *infoPtr) { int iVar1; code *pcVar2; int iVar3; int iVar4; int iVar5; int local_c; local_c = *(int *)((int)infoPtr + 0x38); if (local_c == 0) { if (pngPtr == (void *)0x0) goto LAB_00a63090; } else { iVar3 = 0; pcVar2 = free_exref; if (0 < *(int *)((int)infoPtr + 0x30)) { iVar4 = 0; iVar5 = local_c; do { if (pngPtr != (void *)0x0) { iVar1 = *(int *)(iVar4 + 4 + iVar5); if (iVar1 != 0) { (*pcVar2)(iVar1); iVar5 = *(int *)((int)infoPtr + 0x38); pcVar2 = free_exref; local_c = iVar5; } } iVar3 = iVar3 + 1; iVar4 = iVar4 + 0x10; } while (iVar3 < *(int *)((int)infoPtr + 0x30)); } if (pngPtr == (void *)0x0) { LAB_00a63090: pcVar2 = free_exref; goto LAB_00a63096; } if (local_c != 0) { (*pcVar2)(local_c); } } pcVar2 = free_exref; if (*(void **)((int)infoPtr + 0xa0) != (void *)0x0) { free(*(void **)((int)infoPtr + 0xa0)); } if (*(void **)((int)infoPtr + 0xac) != (void *)0x0) { free(*(void **)((int)infoPtr + 0xac)); } LAB_00a63096: iVar3 = *(int *)((int)infoPtr + 0xb0); if (iVar3 != 0) { iVar5 = 0; if (*(char *)((int)infoPtr + 0xb5) != '\0') { iVar4 = iVar3; do { if (pngPtr != (void *)0x0) { iVar1 = *(int *)(iVar4 + iVar5 * 4); if (iVar1 != 0) { (*pcVar2)(iVar1); iVar4 = *(int *)((int)infoPtr + 0xb0); iVar3 = iVar4; } } iVar5 = iVar5 + 1; } while (iVar5 < (int)(uint)*(byte *)((int)infoPtr + 0xb5)); } if ((pngPtr != (void *)0x0) && (iVar3 != 0)) { (*pcVar2)(iVar3); } } memset(infoPtr,0,0xb8); return; } //@@ 00a63100 FUN_00a63100 void FUN_00a63100(uint param_1,uint param_2,char param_3,byte param_4,undefined1 param_5, undefined1 param_6,undefined1 param_7) { char cVar1; undefined4 uVar2; byte bVar3; int in_ECX; uint *in_EDX; if ((in_ECX != 0) && (in_EDX != (uint *)0x0)) { *in_EDX = param_1; in_EDX[1] = param_2; *(undefined1 *)((int)in_EDX + 0x1a) = param_6; *(undefined1 *)((int)in_EDX + 0x1b) = param_7; *(char *)(in_EDX + 6) = param_3; *(byte *)((int)in_EDX + 0x19) = param_4; *(undefined1 *)(in_EDX + 7) = param_5; if (param_4 == 3) { *(undefined1 *)((int)in_EDX + 0x1d) = 1; cVar1 = '\x01'; } else { cVar1 = '\x03'; if ((param_4 & 2) == 0) { cVar1 = '\x01'; } *(char *)((int)in_EDX + 0x1d) = cVar1; if ((param_4 & 4) != 0) { cVar1 = cVar1 + '\x01'; *(char *)((int)in_EDX + 0x1d) = cVar1; } } bVar3 = param_3 * cVar1; *(byte *)((int)in_EDX + 0x1e) = bVar3; if ((uint)(0x7fffffff / (ulonglong)(bVar3 + 7 >> 3)) < param_1) { if (*(code **)(in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n", "Width too large to process image data; rowbytes will overflow."); FUN_008c5d50(uVar2); in_EDX[3] = 0; return; } (**(code **)(in_ECX + 0x44))(); in_EDX[3] = 0; return; } in_EDX[3] = bVar3 * param_1 + 7 >> 3; } return; } //@@ 00a631f0 FUN_00a631f0 void FUN_00a631f0(char *param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4,int param_5 ,char *param_6,int param_7) { size_t _Size; char cVar1; void *pvVar2; int in_ECX; char *pcVar3; int in_EDX; char *pcVar4; int iVar5; if ((in_ECX != 0) && (in_EDX != 0)) { pcVar4 = param_1; do { cVar1 = *pcVar4; pcVar4 = pcVar4 + 1; } while (cVar1 != '\0'); pcVar4 = pcVar4 + (1 - (int)(param_1 + 1)); if (pcVar4 == (char *)0x0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc((size_t)pcVar4); if (pvVar2 == (void *)0x0) { LAB_00a63359: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(void **)(in_EDX + 0xa0) = pvVar2; memcpy(pvVar2,param_1,(size_t)pcVar4); *(undefined4 *)(in_EDX + 0xa4) = param_2; *(undefined4 *)(in_EDX + 0xa8) = param_3; *(undefined1 *)(in_EDX + 0xb4) = param_4; *(char *)(in_EDX + 0xb5) = (char)param_5; pcVar4 = param_6; do { cVar1 = *pcVar4; pcVar4 = pcVar4 + 1; } while (cVar1 != '\0'); pcVar4 = pcVar4 + (1 - (int)(param_6 + 1)); if (pcVar4 == (char *)0x0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc((size_t)pcVar4); if (pvVar2 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(void **)(in_EDX + 0xac) = pvVar2; memcpy(pvVar2,param_6,(size_t)pcVar4); _Size = param_5 * 4 + 4; if (_Size == 0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc(_Size); if (pvVar2 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } iVar5 = 0; *(void **)(in_EDX + 0xb0) = pvVar2; *(undefined4 *)((int)pvVar2 + param_5 * 4) = 0; if (0 < param_5) { do { pcVar3 = *(char **)(param_7 + iVar5 * 4); pcVar4 = pcVar3 + 1; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); pcVar3 = pcVar3 + (1 - (int)pcVar4); if (pcVar3 == (char *)0x0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc((size_t)pcVar3); if (pvVar2 == (void *)0x0) goto LAB_00a63359; } *(void **)(*(int *)(in_EDX + 0xb0) + iVar5 * 4) = pvVar2; memcpy(*(void **)(*(int *)(in_EDX + 0xb0) + iVar5 * 4),*(void **)(param_7 + iVar5 * 4), (size_t)pcVar3); iVar5 = iVar5 + 1; } while (iVar5 < param_5); } *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x400; } return; } //@@ 00a63390 FUN_00a63390 void FUN_00a63390(undefined4 *param_1) { int iVar1; byte *pbVar2; byte bVar3; int iVar4; size_t _Size; void *_Dst; void *pvVar5; undefined4 uVar6; int in_ECX; byte *pbVar7; int in_EDX; undefined4 *puVar8; if ((in_ECX != 0) && (in_EDX != 0)) { iVar4 = *(int *)(in_EDX + 0x34); if (iVar4 < *(int *)(in_EDX + 0x30) + 1) { pvVar5 = *(void **)(in_EDX + 0x38); if (pvVar5 == (void *)0x0) { *(undefined4 *)(in_EDX + 0x34) = 9; *(undefined4 *)(in_EDX + 0x30) = 0; pvVar5 = malloc(0x90); if (pvVar5 == (void *)0x0) { LAB_00a6347e: /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(void **)(in_EDX + 0x38) = pvVar5; } else { iVar1 = *(int *)(in_EDX + 0x30) + 9; *(int *)(in_EDX + 0x34) = iVar1; _Size = iVar1 * 0x10; if (_Size == 0) { _Dst = (void *)0x0; } else { _Dst = malloc(_Size); if (_Dst == (void *)0x0) goto LAB_00a6347e; } *(void **)(in_EDX + 0x38) = _Dst; memcpy(_Dst,pvVar5,iVar4 << 4); free(pvVar5); } } puVar8 = (undefined4 *)(*(int *)(in_EDX + 0x30) * 0x10 + *(int *)(in_EDX + 0x38)); pbVar7 = (byte *)param_1[2]; if (pbVar7 == (byte *)0x0) { param_1[2] = &s_empty; pbVar7 = &s_empty; } if (*pbVar7 == 0) { puVar8[3] = 0; uVar6 = 0xffffffff; } else { pbVar2 = pbVar7 + 1; do { bVar3 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar3 != 0); puVar8[3] = (int)pbVar7 - (int)pbVar2; uVar6 = *param_1; } *puVar8 = uVar6; puVar8[2] = param_1[2]; puVar8[1] = param_1[1]; *(int *)(in_EDX + 0x30) = *(int *)(in_EDX + 0x30) + 1; } return; } //@@ 00a63490 png_write_info /* DB: libpng: also writes PLTE ("Valid palette required..."), bKGD, pCAL, zTXt (was png_write_info_before_PLTE) */ void png_write_info(void) { byte bVar1; byte bVar2; byte bVar3; byte bVar4; int iVar5; byte bVar6; undefined4 uVar7; void *in_ECX; uint uVar8; int in_EDX; byte *pbVar9; int iVar10; undefined4 local_10; byte local_c [6]; byte local_6; byte local_5; if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a639f3; (**(code **)((int)in_ECX + 0x4c))(); png_write_IHDR(*(undefined4 *)(in_EDX + 4),*(undefined1 *)(in_EDX + 0x18), *(undefined1 *)(in_EDX + 0x19),*(undefined1 *)(in_EDX + 0x1a), *(undefined1 *)(in_EDX + 0x1b)); uVar8 = *(uint *)(in_EDX + 8); if ((uVar8 & 1) != 0) { uVar7 = __dtoui3(); local_c[3] = (byte)uVar7; local_c[0] = (byte)((uint)uVar7 >> 0x18); local_c[1] = (byte)((uint)uVar7 >> 0x10); local_c[2] = (byte)((uint)uVar7 >> 8); png_write_chunk_header(in_ECX,(byte *)&DAT_00c12948,4); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a63561; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a63561: pbVar9 = local_c; iVar10 = 4; uVar8 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar9; pbVar9 = pbVar9 + 1; uVar8 = uVar8 >> 8 ^ *(uint *)(((bVar1 ^ uVar8) & 0xff) * 4 + 0xb4e460); iVar10 = iVar10 + -1; } while (iVar10 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar8; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a639f3; (**(code **)((int)in_ECX + 0x4c))(); uVar7 = *(undefined4 *)((int)in_ECX + 0x108); local_10._0_2_ = CONCAT11((char)((uint)uVar7 >> 0x10),(char)((uint)uVar7 >> 0x18)); local_10._3_1_ = (undefined1)uVar7; local_10._0_3_ = CONCAT12((char)((uint)uVar7 >> 8),(undefined2)local_10); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a639f3; (**(code **)((int)in_ECX + 0x4c))(); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 0x800) != 0) { local_5 = *(byte *)(in_EDX + 0x2c); if (3 < local_5) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { __acrt_iob_func(); FUN_008c5d50(); } else { (**(code **)((int)in_ECX + 0x44))(); } } local_6 = local_5; png_write_chunk_header(in_ECX,(byte *)&DAT_00c129c0,1); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a63661; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a63661: *(uint *)((int)in_ECX + 0x108) = ~(~*(uint *)((int)in_ECX + 0x108) >> 8 ^ *(uint *)((((uint)local_6 ^ ~*(uint *)((int)in_ECX + 0x108)) & 0xff) * 4 + 0xb4e460)); } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) { LAB_00a639f3: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x4c))(); uVar7 = *(undefined4 *)((int)in_ECX + 0x108); local_10._0_2_ = CONCAT11((char)((uint)uVar7 >> 0x10),(char)((uint)uVar7 >> 0x18)); local_10._3_1_ = (undefined1)uVar7; local_10._0_3_ = CONCAT12((char)((uint)uVar7 >> 8),(undefined2)local_10); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a639f3; (**(code **)((int)in_ECX + 0x4c))(); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 2) == 0) goto LAB_00a637ad; bVar1 = *(byte *)(in_EDX + 0x19); if ((bVar1 & 2) == 0) { bVar6 = *(byte *)(in_EDX + 0x47); if ((bVar6 == 0) || (*(byte *)((int)in_ECX + 0x120) < bVar6)) goto LAB_00a63784; local_10 = CONCAT31(local_10._1_3_,bVar6); iVar10 = 1; } else { bVar6 = 8; if (bVar1 != 3) { bVar6 = *(byte *)((int)in_ECX + 0x120); } bVar2 = *(byte *)(in_EDX + 0x44); if ((((bVar2 == 0) || (bVar6 < bVar2)) || (bVar3 = *(byte *)(in_EDX + 0x45), bVar3 == 0)) || (((bVar6 < bVar3 || (bVar4 = *(byte *)(in_EDX + 0x46), bVar4 == 0)) || (bVar6 < bVar4)))) { LAB_00a63784: if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { __acrt_iob_func(); FUN_008c5d50(); } else { (**(code **)((int)in_ECX + 0x44))(); } goto LAB_00a637ad; } iVar10 = 3; local_10._0_2_ = CONCAT11(bVar3,bVar2); local_10 = CONCAT22(CONCAT11(local_10._3_1_,bVar4),(undefined2)local_10); } if ((bVar1 & 4) != 0) { bVar1 = *(byte *)(in_EDX + 0x48); if ((bVar1 == 0) || (*(byte *)((int)in_ECX + 0x120) < bVar1)) { FUN_00a64630(); goto LAB_00a637ad; } local_c[iVar10 + -4] = bVar1; iVar10 = iVar10 + 1; } FUN_00a91030(&local_10,iVar10); LAB_00a637ad: uVar8 = *(uint *)(in_EDX + 8); if ((uVar8 & 4) != 0) { png_write_cHRM((double)*(float *)(in_EDX + 0x8c),(double)*(float *)(in_EDX + 0x90), (double)*(float *)(in_EDX + 0x94),(double)*(float *)(in_EDX + 0x98), (double)*(float *)(in_EDX + 0x9c)); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 8) == 0) { if (*(char *)(in_EDX + 0x19) == '\x03') { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } else { FUN_00a91610(); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 0x10) != 0) { if ((((*(uint *)((int)in_ECX + 0x68) & 0x80000) != 0) && (*(char *)(in_EDX + 0x19) == '\x03')) && (iVar10 = 0, *(short *)(in_EDX + 0x16) != 0)) { do { pbVar9 = (byte *)(iVar10 + *(int *)(in_EDX + 0x4c)); *pbVar9 = ~*pbVar9; iVar10 = iVar10 + 1; } while (iVar10 < (int)(uint)*(ushort *)(in_EDX + 0x16)); } png_write_tRNS(); } uVar8 = *(uint *)(in_EDX + 8); if ((uVar8 & 0x20) != 0) { png_write_bKGD(); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 0x40) != 0) { FUN_00a92070(); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 0x100) != 0) { FUN_00a92b70(*(undefined4 *)(in_EDX + 0x68),*(undefined1 *)(in_EDX + 0x6c)); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 0x400) != 0) { png_write_pCAL(*(undefined4 *)(in_EDX + 0xa4),*(undefined4 *)(in_EDX + 0xa8), *(undefined1 *)(in_EDX + 0xb4),*(undefined1 *)(in_EDX + 0xb5), *(undefined4 *)(in_EDX + 0xac),*(undefined4 *)(in_EDX + 0xb0)); uVar8 = *(uint *)(in_EDX + 8); } if ((char)uVar8 < '\0') { FUN_00a930b0(*(undefined4 *)(in_EDX + 0x74),*(undefined1 *)(in_EDX + 0x78)); uVar8 = *(uint *)(in_EDX + 8); } if ((uVar8 & 0x200) != 0) { FUN_00a931f0(); *(uint *)((int)in_ECX + 100) = *(uint *)((int)in_ECX + 100) | 0x10000; } local_10 = 0; if (0 < *(int *)(in_EDX + 0x30)) { iVar10 = 0; do { iVar5 = *(int *)(in_EDX + 0x38); if (*(int *)(iVar10 + iVar5) < 0) { if (*(int *)(iVar10 + iVar5) == -1) { FUN_00a92520(*(undefined4 *)(iVar10 + 8 + iVar5),*(undefined4 *)(iVar10 + 0xc + iVar5)); *(undefined4 *)(iVar10 + *(int *)(in_EDX + 0x38)) = 0xfffffffd; } } else { png_write_zTXt(); *(undefined4 *)(iVar10 + *(int *)(in_EDX + 0x38)) = 0xfffffffe; } iVar10 = iVar10 + 0x10; local_10 = local_10 + 1; } while (local_10 < *(int *)(in_EDX + 0x30)); } return; } //@@ 00a63a10 png_create_write_struct /* WARNING: Removing unreachable block (ram,0x00a63b83) */ /* DB: libpng 1.2.50: malloc 0x20c + setjmp, version check "1.2.50"/"Incompatible libpng version", error_fn FUN_009e6e90/error_ptr EDX, zbuf 0x2000, png_set_write_fn inlined (default write/flush, "Attempted to set both read_data_fn and write_data_fn in the same structure") */ void * png_create_write_struct(void) { void *_Dst; int iVar1; void *pvVar2; undefined4 uVar3; undefined4 in_EDX; _Dst = malloc(0x20c); if (_Dst != (void *)0x0) { memset(_Dst,0,0x20c); iVar1 = setjmp3(_Dst,0); if (iVar1 == 0) { *(undefined4 *)((int)_Dst + 0x48) = in_EDX; *(code **)((int)_Dst + 0x40) = FUN_009e6e90; *(undefined4 *)((int)_Dst + 0x44) = 0; *(undefined4 *)((int)_Dst + 0xa8) = 0x2000; pvVar2 = malloc(0x2000); if (pvVar2 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(void **)((int)_Dst + 0xa4) = pvVar2; *(undefined4 *)((int)_Dst + 0x5c) = 0; *(code **)((int)_Dst + 0x4c) = FUN_00a64770; *(code **)((int)_Dst + 0x144) = FUN_00a647a0; if (*(int *)((int)_Dst + 0x50) != 0) { *(undefined4 *)((int)_Dst + 0x50) = 0; if (*(code **)((int)_Dst + 0x44) == (code *)0x0) { uVar3 = __acrt_iob_func(2,"libpng warning: %s\n", "Attempted to set both read_data_fn and write_data_fn in"); FUN_008c5d50(uVar3); } else { (**(code **)((int)_Dst + 0x44))(_Dst); } if (*(code **)((int)_Dst + 0x44) != (code *)0x0) { (**(code **)((int)_Dst + 0x44))(_Dst); FUN_00a64160(); return _Dst; } uVar3 = __acrt_iob_func(2,"libpng warning: %s\n", "the same structure. Resetting read_data_fn to NULL."); FUN_008c5d50(uVar3); } FUN_00a64160(); return _Dst; } if (*(void **)((int)_Dst + 0xa4) != (void *)0x0) { free(*(void **)((int)_Dst + 0xa4)); } free(_Dst); } return (void *)0x0; } //@@ 00a63ba0 png_write_row /* DB: libpng (round 7 agent) */ void png_write_row(void) { byte bVar1; int in_ECX; uint _Size; void *in_EDX; if ((*(int *)(in_ECX + 0xdc) == 0) && (*(char *)(in_ECX + 0x11c) == '\0')) { FUN_00a932c0(); } if ((*(char *)(in_ECX + 0x11b) != '\0') && ((*(byte *)(in_ECX + 0x68) & 2) != 0)) { switch(*(undefined1 *)(in_ECX + 0x11c)) { case 0: if ((*(byte *)(in_ECX + 0xdc) & 7) != 0) { png_write_finish_row(); return; } break; case 1: if ((*(byte *)(in_ECX + 0xdc) & 7) != 0) goto LAB_00a63d3f; if (*(uint *)(in_ECX + 0xc0) < 5) { png_write_finish_row(); return; } break; case 2: if (((byte)*(undefined4 *)(in_ECX + 0xdc) & 7) != 4) { png_write_finish_row(); return; } break; case 3: if ((*(byte *)(in_ECX + 0xdc) & 3) != 0) goto LAB_00a63d3f; if (*(uint *)(in_ECX + 0xc0) < 3) { png_write_finish_row(); return; } break; case 4: if (((byte)*(undefined4 *)(in_ECX + 0xdc) & 3) != 2) { png_write_finish_row(); return; } break; case 5: if ((*(byte *)(in_ECX + 0xdc) & 1) != 0) goto LAB_00a63d3f; if (*(uint *)(in_ECX + 0xc0) < 2) { png_write_finish_row(); return; } break; case 6: if ((*(byte *)(in_ECX + 0xdc) & 1) == 0) goto LAB_00a63d3f; } } *(undefined1 *)(in_ECX + 0x100) = *(undefined1 *)(in_ECX + 0x11e); *(char *)(in_ECX + 0x101) = *(char *)(in_ECX + 0x120); *(char *)(in_ECX + 0x102) = *(char *)(in_ECX + 0x123); bVar1 = *(char *)(in_ECX + 0x120) * *(char *)(in_ECX + 0x123); *(int *)(in_ECX + 0xf8) = *(int *)(in_ECX + 0xcc); *(byte *)(in_ECX + 0x103) = bVar1; _Size = (uint)bVar1 * *(int *)(in_ECX + 0xcc) + 7 >> 3; *(uint *)(in_ECX + 0xfc) = _Size; memcpy((void *)(*(int *)(in_ECX + 0xe4) + 1),in_EDX,_Size); if ((((*(char *)(in_ECX + 0x11b) == '\0') || (5 < *(byte *)(in_ECX + 0x11c))) || ((*(byte *)(in_ECX + 0x68) & 2) == 0)) || (png_do_write_interlace(*(byte *)(in_ECX + 0x11c)), *(int *)(in_ECX + 0xf8) != 0)) { if (*(int *)(in_ECX + 0x68) != 0) { png_do_write_transformations(); } png_write_find_filter(); if (*(code **)(in_ECX + 0x194) != (code *)0x0) { (**(code **)(in_ECX + 0x194))(); } return; } LAB_00a63d3f: png_write_finish_row(); return; } //@@ 00a63db0 png_write_flush /* DB: libpng: if row_number < num_rows, png_compress_IDAT(NULL, 0, Z_SYNC_FLUSH) (inlined, "Call to NULL write function"/"zlib error"), flush_rows (+0x14c) = 0, output_flush_fn (+0x144); png_write_filtered_row when flush_rows >= flush_dist */ void png_write_flush(void) { byte *buffer; int iVar1; uint uVar2; void *in_ECX; if (*(uint *)((int)in_ECX + 0xdc) < *(uint *)((int)in_ECX + 200)) { while( true ) { iVar1 = deflate((void *)((int)in_ECX + 0x6c),2); if (iVar1 != 0) { if (*(int *)((int)in_ECX + 0x84) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } /* WARNING: Subroutine does not return */ FUN_00a64610(); } iVar1 = *(int *)((int)in_ECX + 0x7c); if (iVar1 != 0) break; uVar2 = *(uint *)((int)in_ECX + 0xa8); buffer = *(byte **)((int)in_ECX + 0xa4); png_write_chunk_header(in_ECX,(byte *)&DAT_00c12998,uVar2); if ((buffer != (byte *)0x0) && (uVar2 != 0)) { if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a63e32; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a63e32: uVar2 = crc32(*(uint *)((int)in_ECX + 0x108),buffer,uVar2); *(uint *)((int)in_ECX + 0x108) = uVar2; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a63f1e; (**(code **)((int)in_ECX + 0x4c))(); } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) { LAB_00a63f1e: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x4c))(); *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 4; *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); } if (*(int *)((int)in_ECX + 0xa8) != iVar1) { FUN_00a91030(*(undefined4 *)((int)in_ECX + 0xa4),*(int *)((int)in_ECX + 0xa8) - iVar1); *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 4; *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); } *(undefined4 *)((int)in_ECX + 0x14c) = 0; if (*(code **)((int)in_ECX + 0x144) != (code *)0x0) { (**(code **)((int)in_ECX + 0x144))(); } } return; } //@@ 00a63f30 png_destroy_write_struct /* DB: libpng pngwrite.c: (png_ptr_ptr ECX, info_ptr_ptr EDX): frees info text/palette/trans/row pointers (png_info_destroy inlined), then png_write_destroy and frees the structs; Entity_Familiar::RestoreState (misnamed PNG writer 009e86e0) */ void png_destroy_write_struct(void) { void *_Memory; void *_Memory_00; undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; undefined4 uVar13; undefined4 uVar14; undefined4 uVar15; undefined4 uVar16; undefined4 uVar17; undefined4 uVar18; undefined4 uVar19; undefined4 *in_ECX; void *pvVar20; undefined4 *in_EDX; void *local_10; int local_c; undefined4 *local_8; local_8 = (undefined4 *)0x0; if (in_ECX != (undefined4 *)0x0) { local_8 = (undefined4 *)*in_ECX; } if ((in_EDX != (undefined4 *)0x0) && (_Memory = (void *)*in_EDX, _Memory != (void *)0x0)) { if (local_8 != (undefined4 *)0x0) { if (*(void **)((int)_Memory + 0x38) != (void *)0x0) { free(*(void **)((int)_Memory + 0x38)); } if (*(void **)((int)_Memory + 0xa0) != (void *)0x0) { free(*(void **)((int)_Memory + 0xa0)); } if (*(void **)((int)_Memory + 0xac) != (void *)0x0) { free(*(void **)((int)_Memory + 0xac)); } } local_10 = *(void **)((int)_Memory + 0xb0); if (local_10 != (void *)0x0) { local_c = 0; if (*(char *)((int)_Memory + 0xb5) != '\0') { pvVar20 = local_10; do { if (local_8 != (undefined4 *)0x0) { _Memory_00 = *(void **)((int)pvVar20 + local_c * 4); if (_Memory_00 != (void *)0x0) { free(_Memory_00); pvVar20 = *(void **)((int)_Memory + 0xb0); local_10 = pvVar20; } } local_c = local_c + 1; } while (local_c < (int)(uint)*(byte *)((int)_Memory + 0xb5)); } if ((local_8 != (undefined4 *)0x0) && (local_10 != (void *)0x0)) { free(local_10); } } free(_Memory); *in_EDX = 0; } if (local_8 != (undefined4 *)0x0) { FUN_00a95a10(); if ((void *)local_8[0x29] != (void *)0x0) { free((void *)local_8[0x29]); } if ((void *)local_8[0x39] != (void *)0x0) { free((void *)local_8[0x39]); } if ((void *)local_8[0x38] != (void *)0x0) { free((void *)local_8[0x38]); } if ((void *)local_8[0x3a] != (void *)0x0) { free((void *)local_8[0x3a]); } if ((void *)local_8[0x3b] != (void *)0x0) { free((void *)local_8[0x3b]); } if ((void *)local_8[0x3c] != (void *)0x0) { free((void *)local_8[0x3c]); } if ((void *)local_8[0x3d] != (void *)0x0) { free((void *)local_8[0x3d]); } if ((void *)local_8[0x82] != (void *)0x0) { free((void *)local_8[0x82]); } if ((void *)local_8[0x7d] != (void *)0x0) { free((void *)local_8[0x7d]); } if ((void *)local_8[0x7e] != (void *)0x0) { free((void *)local_8[0x7e]); } if ((void *)local_8[0x7f] != (void *)0x0) { free((void *)local_8[0x7f]); } if ((void *)local_8[0x80] != (void *)0x0) { free((void *)local_8[0x80]); } if ((void *)local_8[0x81] != (void *)0x0) { free((void *)local_8[0x81]); } uVar4 = *local_8; uVar5 = local_8[1]; uVar6 = local_8[2]; uVar7 = local_8[3]; uVar1 = local_8[0x10]; uVar2 = local_8[0x11]; uVar8 = local_8[4]; uVar9 = local_8[5]; uVar10 = local_8[6]; uVar11 = local_8[7]; uVar12 = local_8[8]; uVar13 = local_8[9]; uVar14 = local_8[10]; uVar15 = local_8[0xb]; uVar16 = local_8[0xc]; uVar17 = local_8[0xd]; uVar18 = local_8[0xe]; uVar19 = local_8[0xf]; uVar3 = local_8[0x12]; memset(local_8 + 0x13,0,0x1c0); *local_8 = uVar4; local_8[1] = uVar5; local_8[2] = uVar6; local_8[3] = uVar7; local_8[0x10] = uVar1; local_8[0x11] = uVar2; local_8[0x12] = uVar3; local_8[4] = uVar8; local_8[5] = uVar9; local_8[6] = uVar10; local_8[7] = uVar11; local_8[8] = uVar12; local_8[9] = uVar13; local_8[10] = uVar14; local_8[0xb] = uVar15; local_8[0xc] = uVar16; local_8[0xd] = uVar17; local_8[0xe] = uVar18; local_8[0xf] = uVar19; free(local_8); *in_ECX = 0; } return; } //@@ 00a64160 FUN_00a64160 void FUN_00a64160(void) { void *pvVar1; int in_ECX; int iVar2; *(undefined2 *)(in_ECX + 0x1f0) = 1; if (*(int *)(in_ECX + 0x200) == 0) { pvVar1 = malloc(10); if (pvVar1 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(void **)(in_ECX + 0x200) = pvVar1; pvVar1 = malloc(10); if (pvVar1 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(void **)(in_ECX + 0x204) = pvVar1; **(undefined2 **)(in_ECX + 0x200) = 8; **(undefined2 **)(in_ECX + 0x204) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x200) + 2) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x204) + 2) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x200) + 4) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x204) + 4) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x200) + 6) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x204) + 6) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x200) + 8) = 8; *(undefined2 *)(*(int *)(in_ECX + 0x204) + 8) = 8; } iVar2 = 0; do { *(undefined2 *)(iVar2 + *(int *)(in_ECX + 0x200)) = 8; *(undefined2 *)(iVar2 + *(int *)(in_ECX + 0x204)) = 8; iVar2 = iVar2 + 2; } while (iVar2 < 10); return; } //@@ 00a64260 FUN_00a64260 void FUN_00a64260(void) { uint uVar1; uint uVar2; int in_ECX; int iVar3; uint *in_EDX; if ((*(char *)(in_ECX + 9) == '\x01') && (*(char *)(in_ECX + 8) == '\0')) { uVar1 = *(uint *)(in_ECX + 4); uVar2 = 0; if (uVar1 != 0) { if (0x3f < uVar1) { do { uVar2 = uVar2 + 0x40; *in_EDX = ~*in_EDX; in_EDX[1] = ~in_EDX[1]; in_EDX[2] = ~in_EDX[2]; in_EDX[3] = ~in_EDX[3]; in_EDX[4] = ~in_EDX[4]; in_EDX[5] = ~in_EDX[5]; in_EDX[6] = ~in_EDX[6]; in_EDX[7] = ~in_EDX[7]; in_EDX[8] = ~in_EDX[8]; in_EDX[9] = ~in_EDX[9]; in_EDX[10] = ~in_EDX[10]; in_EDX[0xb] = ~in_EDX[0xb]; in_EDX[0xc] = ~in_EDX[0xc]; in_EDX[0xd] = ~in_EDX[0xd]; in_EDX[0xe] = ~in_EDX[0xe]; in_EDX[0xf] = ~in_EDX[0xf]; in_EDX = in_EDX + 0x10; } while (uVar2 < (uVar1 & 0xffffffc0)); if (uVar1 <= uVar2) { return; } } iVar3 = uVar1 - uVar2; do { *(byte *)in_EDX = ~(byte)*in_EDX; in_EDX = (uint *)((int)in_EDX + 1); iVar3 = iVar3 + -1; } while (iVar3 != 0); } } return; } //@@ 00a642e0 FUN_00a642e0 void FUN_00a642e0(void) { byte bVar1; int in_ECX; undefined *puVar2; byte *in_EDX; byte *pbVar3; bVar1 = *(byte *)(in_ECX + 9); if (bVar1 < 8) { pbVar3 = in_EDX + *(int *)(in_ECX + 4); if (bVar1 == 1) { puVar2 = &DAT_00c5ac90; } else if (bVar1 == 2) { puVar2 = &DAT_00c5ad90; } else { if (bVar1 != 4) { return; } puVar2 = &DAT_00c5ae90; } for (; in_EDX < pbVar3; in_EDX = in_EDX + 1) { *in_EDX = puVar2[*in_EDX]; } } return; } //@@ 00a64320 png_do_strip_filler /* DB: libpng 1.2 png_do_strip_filler(row_info,row,flags): drops the filler/alpha byte(s) (PNG_FLAG_FILLER_AFTER 0x80 picks which side), fixes channels/pixel_depth/rowbytes; png_read_row (PNG_STRIP_ALPHA 0x40000, flags 0x80) and write transforms */ void png_do_strip_filler(uint param_1) { undefined1 *puVar1; uint uVar2; uint *in_ECX; uint uVar3; undefined1 *in_EDX; int iVar4; undefined1 *puVar5; uVar2 = *in_ECX; if (*(char *)((int)in_ECX + 10) != '\x04') { if (*(char *)((int)in_ECX + 10) == '\x02') { if (*(char *)((int)in_ECX + 9) == '\b') { if (uVar2 != 0) { uVar3 = uVar2; puVar5 = in_EDX; if ((param_1 & 0x80) != 0) { do { *puVar5 = *in_EDX; in_EDX = in_EDX + 2; uVar3 = uVar3 - 1; puVar5 = puVar5 + 1; } while (uVar3 != 0); *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = uVar2; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; *(undefined1 *)((int)in_ECX + 10) = 1; return; } do { puVar1 = in_EDX + 1; in_EDX = in_EDX + 2; *puVar5 = *puVar1; puVar5 = puVar5 + 1; uVar3 = uVar3 - 1; } while (uVar3 != 0); } *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = uVar2; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; *(undefined1 *)((int)in_ECX + 10) = 1; return; } if ((param_1 & 0x80) == 0) { if (uVar2 != 0) { uVar3 = uVar2; puVar5 = in_EDX; do { *puVar5 = in_EDX[2]; puVar5[1] = in_EDX[3]; uVar3 = uVar3 - 1; in_EDX = in_EDX + 4; puVar5 = puVar5 + 2; } while (uVar3 != 0); } } else if (1 < uVar2) { iVar4 = uVar2 - 1; puVar5 = in_EDX; do { puVar5[2] = in_EDX[4]; puVar5[3] = in_EDX[5]; iVar4 = iVar4 + -1; in_EDX = in_EDX + 4; puVar5 = puVar5 + 2; } while (iVar4 != 0); } *(undefined1 *)((int)in_ECX + 0xb) = 0x10; in_ECX[1] = uVar2 * 2; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; *(undefined1 *)((int)in_ECX + 10) = 1; } return; } if (*(char *)((int)in_ECX + 9) != '\b') { if ((param_1 & 0x80) == 0) { if (uVar2 != 0) { uVar3 = uVar2; puVar5 = in_EDX; do { *puVar5 = in_EDX[2]; puVar5[1] = in_EDX[3]; puVar5[2] = in_EDX[4]; puVar5[3] = in_EDX[5]; puVar5[4] = in_EDX[6]; puVar5[5] = in_EDX[7]; uVar3 = uVar3 - 1; in_EDX = in_EDX + 8; puVar5 = puVar5 + 6; } while (uVar3 != 0); } } else if (1 < uVar2) { iVar4 = uVar2 - 1; puVar5 = in_EDX; do { puVar5[6] = in_EDX[8]; puVar5[7] = in_EDX[9]; puVar5[8] = in_EDX[10]; puVar5[9] = in_EDX[0xb]; puVar5[10] = in_EDX[0xc]; puVar5[0xb] = in_EDX[0xd]; iVar4 = iVar4 + -1; in_EDX = in_EDX + 8; puVar5 = puVar5 + 6; } while (iVar4 != 0); } *(undefined1 *)((int)in_ECX + 0xb) = 0x30; in_ECX[1] = uVar2 * 6; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; *(undefined1 *)((int)in_ECX + 10) = 3; return; } if ((param_1 & 0x80) == 0) { if (uVar2 != 0) { uVar3 = uVar2; puVar5 = in_EDX; do { *puVar5 = in_EDX[1]; puVar5[1] = in_EDX[2]; puVar5[2] = in_EDX[3]; uVar3 = uVar3 - 1; in_EDX = in_EDX + 4; puVar5 = puVar5 + 3; } while (uVar3 != 0); } } else if (1 < uVar2) { iVar4 = uVar2 - 1; puVar5 = in_EDX; do { in_EDX[3] = puVar5[4]; in_EDX[4] = puVar5[5]; in_EDX[5] = puVar5[6]; iVar4 = iVar4 + -1; in_EDX = in_EDX + 3; puVar5 = puVar5 + 4; } while (iVar4 != 0); *(undefined1 *)((int)in_ECX + 0xb) = 0x18; in_ECX[1] = uVar2 * 3; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; *(undefined1 *)((int)in_ECX + 10) = 3; return; } *(undefined1 *)((int)in_ECX + 0xb) = 0x18; in_ECX[1] = uVar2 * 3; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; *(undefined1 *)((int)in_ECX + 10) = 3; return; } //@@ 00a64550 png_do_bgr /* DB: libpng: swaps R and B for RGB/RGBA 8 and 16-bit rows; png_read_row under PNG_BGR (1) and write transforms 00a94c80 png_do_write_transformations void png_do_bgr(void) { byte bVar1; undefined1 uVar2; int *in_ECX; undefined1 *in_EDX; undefined1 *puVar3; int iVar4; bVar1 = *(byte *)(in_ECX + 2); if ((bVar1 & 2) != 0) { iVar4 = *in_ECX; if (*(char *)((int)in_ECX + 9) == '\b') { if (bVar1 == 2) { if (iVar4 != 0) { do { uVar2 = *in_EDX; *in_EDX = in_EDX[2]; in_EDX[2] = uVar2; iVar4 = iVar4 + -1; in_EDX = in_EDX + 3; } while (iVar4 != 0); return; } } else if ((bVar1 == 6) && (iVar4 != 0)) { do { uVar2 = *in_EDX; *in_EDX = in_EDX[2]; in_EDX[2] = uVar2; iVar4 = iVar4 + -1; in_EDX = in_EDX + 4; } while (iVar4 != 0); return; } } else if (*(char *)((int)in_ECX + 9) == '\x10') { if (bVar1 == 2) { if (iVar4 != 0) { puVar3 = in_EDX + 1; do { uVar2 = puVar3[-1]; puVar3[-1] = puVar3[3]; puVar3[3] = uVar2; uVar2 = *puVar3; *puVar3 = puVar3[4]; puVar3[4] = uVar2; iVar4 = iVar4 + -1; puVar3 = puVar3 + 6; } while (iVar4 != 0); return; } } else if ((bVar1 == 6) && (iVar4 != 0)) { puVar3 = in_EDX + 1; do { uVar2 = puVar3[-1]; puVar3[-1] = puVar3[3]; puVar3[3] = uVar2; uVar2 = *puVar3; *puVar3 = puVar3[4]; puVar3[4] = uVar2; iVar4 = iVar4 + -1; puVar3 = puVar3 + 8; } while (iVar4 != 0); } } } return; } //@@ 00a64610 FUN_00a64610 void FUN_00a64610(void) { code *pcVar1; int in_ECX; if (*(code **)(in_ECX + 0x40) != (code *)0x0) { (**(code **)(in_ECX + 0x40))(); } FUN_00a64740(); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } //@@ 00a64630 FUN_00a64630 void FUN_00a64630(void) { undefined4 uVar1; int in_ECX; if (*(code **)(in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n"); FUN_008c5d50(uVar1); return; } (**(code **)(in_ECX + 0x44))(); return; } //@@ 00a64660 FUN_00a64660 void FUN_00a64660(undefined4 *param_1) { undefined4 *puVar1; byte bVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; int iVar7; int in_ECX; int in_EDX; uint uVar8; int iVar9; iVar6 = 0; iVar9 = 0; do { bVar2 = *(byte *)(in_ECX + 0x114 + iVar9); iVar9 = iVar9 + 1; uVar8 = (uint)bVar2; if ((uVar8 - 0x29 < 0x52) && ((uVar8 < 0x5b || (0x60 < uVar8)))) { *(byte *)(iVar6 + in_EDX) = bVar2; iVar7 = iVar6; } else { *(undefined1 *)(iVar6 + in_EDX) = 0x5b; *(undefined *)(iVar6 + 1 + in_EDX) = (&DAT_00b46880)[bVar2 >> 4]; *(undefined *)(iVar6 + 2 + in_EDX) = (&DAT_00b46880)[uVar8 & 0xf]; iVar7 = iVar6 + 3; *(undefined1 *)(iVar7 + in_EDX) = 0x5d; } iVar6 = iVar7 + 1; } while (iVar9 < 4); if (param_1 == (undefined4 *)0x0) { *(undefined1 *)(iVar6 + in_EDX) = 0; return; } *(undefined1 *)(iVar6 + in_EDX) = 0x3a; *(undefined1 *)(iVar7 + 2 + in_EDX) = 0x20; uVar3 = param_1[1]; uVar4 = param_1[2]; uVar5 = param_1[3]; puVar1 = (undefined4 *)(in_EDX + 2 + iVar6); *puVar1 = *param_1; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; uVar3 = param_1[5]; uVar4 = param_1[6]; uVar5 = param_1[7]; puVar1 = (undefined4 *)(in_EDX + 0x12 + iVar6); *puVar1 = param_1[4]; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; uVar3 = param_1[9]; uVar4 = param_1[10]; uVar5 = param_1[0xb]; puVar1 = (undefined4 *)(in_EDX + 0x22 + iVar6); *puVar1 = param_1[8]; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; uVar3 = param_1[0xd]; uVar4 = param_1[0xe]; uVar5 = param_1[0xf]; puVar1 = (undefined4 *)(in_EDX + 0x32 + iVar6); *puVar1 = param_1[0xc]; puVar1[1] = uVar3; puVar1[2] = uVar4; puVar1[3] = uVar5; *(undefined1 *)(in_EDX + 0x41 + iVar6) = 0; return; } //@@ 00a64710 FUN_00a64710 void FUN_00a64710(void) { FUN_00a64660(); /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a64740 FUN_00a64740 void FUN_00a64740(void) { undefined4 uVar1; int *in_ECX; uVar1 = __acrt_iob_func(2,"libpng error: %s\n"); FUN_008c5d50(uVar1); /* WARNING: Subroutine does not return */ longjmp(in_ECX,1); } //@@ 00a64770 FUN_00a64770 void FUN_00a64770(int param_1,undefined4 param_2,int param_3) { int iVar1; iVar1 = (**(code **)(**(int **)(param_1 + 0x5c) + 0x1c))(param_2,1,param_3); if (iVar1 != param_3) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } return; } //@@ 00a647a0 FUN_00a647a0 void FUN_00a647a0(int param_1) { if (*(FILE **)(param_1 + 0x5c) == (FILE *)0x0) { return; } /* WARNING: Could not recover jumptable at 0x00a647b1. Too many branches */ /* WARNING: Treating indirect jump as call */ fflush(*(FILE **)(param_1 + 0x5c)); return; } //@@ 00a647c0 FUN_00a647c0 void FUN_00a647c0(byte param_1) { undefined4 *in_ECX; g_mainHeap = (void *)0x0; *in_ECX = KAGE::Memory::MainHeap::vftable; KAGE::Memory::HeapBase::~HeapBase(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x40); } return; } //@@ 00a64800 FUN_00a64800 void FUN_00a64800(uint *param_1) { tracked_alloc(0,(void *)0x0,(ulonglong)*param_1); return; } //@@ 00a64820 FUN_00a64820 void FUN_00a64820(void *param_1,undefined4 param_2) { void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; if ((char)param_2 == '\0') { local_8 = 0; tracked_alloc(1,param_1,0); ExceptionList = local_10; return; } FUN_00a6f270(param_1,param_2); ExceptionList = local_10; return; } //@@ 00a648a0 FUN_00a648a0 undefined4 FUN_00a648a0(int param_1) { return *(undefined4 *)(param_1 + -4); } //@@ 00a648b0 tracked_alloc /* DB: malloc/free with byte counter in global (mode 0 alloc,1 free,2 merge) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl tracked_alloc(byte mode,void *ptr,ulonglong size) { qword qVar1; void *pvVar2; uint *puVar3; qword *pqVar4; uint uVar5; bool bVar6; pvVar2 = g_mainHeap; pqVar4 = (qword *)((int)g_mainHeap + 0x30); if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } if (mode != 0) { if (mode == 1) { if (ptr != (void *)0x0) { uVar5 = *(uint *)((int)ptr + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar5; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar5); free((void *)((int)ptr + -4)); } } else if (mode == 2) { puVar3 = (uint *)((int)g_mainHeap + 0x30); bVar6 = CARRY4(*puVar3,(uint)g_allocatedBytesNoHeap); *puVar3 = *puVar3 + (uint)g_allocatedBytesNoHeap; *(int *)((int)pvVar2 + 0x34) = *(int *)((int)pvVar2 + 0x34) + g_allocatedBytesNoHeap._4_4_ + (uint)bVar6; return (void *)0x0; } return (void *)0x0; } if (size._4_4_ != 0) { size = 0; } uVar5 = (uint)size + 4; puVar3 = malloc(uVar5); if (puVar3 == (uint *)0x0) { FUN_00a23200(0x7fcb9dd6); return (void *)0x0; } qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + uVar5; *puVar3 = uVar5; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (int)(size >> 0x20) + (uint)(0xfffffffb < (uint)size) + (uint)CARRY4((uint)qVar1,uVar5); return puVar3 + 1; } //@@ 00a64970 FUN_00a64970 void FUN_00a64970(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1310; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(*(int *)*in_ECX + 0x10))(__security_cookie ^ (int)register0x00000010 - 4U); ExceptionList = local_10; return; } //@@ 00a649b0 FUN_00a649b0 undefined1 FUN_00a649b0(void) { int in_ECX; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; return 1; } //@@ 00a649c0 FUN_00a649c0 void FUN_00a649c0(void) { int in_ECX; *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) & 0xfffffffe; return; } //@@ 00a649d0 FUN_00a649d0 void FUN_00a649d0(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImagePng::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a64a50 ImagePng::load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: slot 14 of KAGE::Graphics::ImagePng vftable (0xb9ff84+0x38 = 0xb9ffbc; image_load_jpeg is the same slot of ImageJpg at 0xba0020); PNG sibling of image_load_jpeg: PNG signature compare, PLTE, 'Width too large for libpng', 'Failed to load image %s because the component depth is not 8-bit' (only user), ImageBase::set_size, image_premultiply_alpha */ undefined4 ImagePng::load(int *param_1,undefined4 param_2) { int *piVar1; byte bVar2; char cVar3; undefined1 uVar4; int *piVar5; int iVar6; uint uVar7; uint uVar8; uint extraout_ECX; byte *pbVar9; undefined1 *puVar10; size_t _Size; int *piVar11; uint uVar12; ushort *puVar13; void *pvVar14; bool bVar15; ulonglong uVar16; char *pcVar17; size_t local_54; int local_50; void *local_4c; uint local_48; int *local_44; void *local_40; int *local_3c; byte *local_38; undefined4 local_34; int *local_30; ushort *local_2c; uint local_28; uint local_24; char local_1d; undefined4 local_1c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b131a0; local_10 = ExceptionList; local_14 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_30 = param_1; local_34 = param_2; if (param_1 != (int *)0x0) { local_38 = (byte *)0x0; local_1d = '\x01'; (**(code **)(*param_1 + 0x14))(&local_1c,1,8,local_14); piVar5 = &local_1c; pbVar9 = (byte *)&DAT_00c12980; uVar12 = 4; do { if (*piVar5 != *(int *)pbVar9) { bVar2 = (byte)*piVar5; bVar15 = bVar2 < *pbVar9; if ((((bVar2 == *pbVar9) && (bVar15 = *(byte *)((int)piVar5 + 1) < pbVar9[1], *(byte *)((int)piVar5 + 1) == pbVar9[1])) && (bVar15 = *(byte *)((int)piVar5 + 2) < pbVar9[2], *(byte *)((int)piVar5 + 2) == pbVar9[2])) && (bVar15 = *(byte *)((int)piVar5 + 3) < pbVar9[3], *(byte *)((int)piVar5 + 3) == pbVar9[3] )) { uVar12 = 0; } else { uVar12 = -(uint)bVar15 | 1; } goto LAB_00a64af1; } piVar5 = piVar5 + 1; pbVar9 = pbVar9 + 4; bVar15 = 3 < uVar12; uVar12 = uVar12 - 4; } while (bVar15); uVar12 = 0; LAB_00a64af1: if (uVar12 == 0) { piVar5 = (int *)FUN_00a96800(); local_3c = piVar5; if (piVar5 == (int *)0x0) { puVar13 = (ushort *)0x0; } else { puVar13 = malloc(0xb8); if ((puVar13 != (ushort *)0x0) && (memset(puVar13,0,0xb8), puVar13 != (ushort *)0x0)) { memset(puVar13,0,0xb8); } } local_2c = puVar13; if (piVar5 == (int *)0x0) { pvVar14 = (void *)0x0; } else { pvVar14 = malloc(0xb8); if ((pvVar14 != (void *)0x0) && (memset(pvVar14,0,0xb8), pvVar14 != (void *)0x0)) { memset(pvVar14,0,0xb8); } } piVar5[0x17] = (int)local_30; *(undefined1 *)(piVar5 + 0x49) = 8; local_40 = pvVar14; png_read_info(); iVar6 = setjmp3(local_3c,3,&DAT_00af08ab,local_8,&FuncInfo_00bb33fc); puVar13 = local_2c; piVar5 = local_3c; if (iVar6 == 0) { uVar12 = 0; local_30 = (int *)0x0; local_24 = 0; if ((local_3c != (int *)0x0) && (local_2c != (ushort *)0x0)) { local_28 = (uint)*local_2c; uVar12 = (uint)(byte)local_2c[0xc]; local_24 = (uint)local_2c[2]; local_30 = (int *)(uint)*(byte *)((int)local_2c + 0x19); if (local_30 == (int *)0x3) { uVar8 = 1; } else { uVar8 = (uint)local_30 & 2 | 1; } uVar7 = uVar8 + 1; if ((*(byte *)((int)local_2c + 0x19) & 4) == 0) { uVar7 = uVar8; } if ((uint)(0x7fffffff / (ulonglong)(uVar7 * uVar12 + 7 >> 3)) < local_28) { FUN_00a64630(); } } if (uVar12 == 8) { uVar16 = FUN_00a976e0(); piVar11 = local_44; local_28 = (uint)((uVar16 & 0xffff0000ffff) >> 0x20); bVar2 = ImageBase::set_size(local_44,local_28,(uint)(uVar16 & 0xffff0000ffff),local_28); if (bVar2 == 0) { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because set_size failed\n"); ExceptionList = local_10; return 0; } if ((piVar5 == (int *)0x0) || (puVar13 == (ushort *)0x0)) { local_48 = 0; } else { local_48 = *(uint *)(puVar13 + 6); } local_48 = local_48 / local_28; if ((*(byte *)(piVar5 + 0x19) & 0x40) == 0) { png_read_start_row(); } FUN_00a982d0(); if (puVar13 == (ushort *)0x0) { uVar12 = 0; } else { uVar12 = *(uint *)(puVar13 + 6); } local_28 = uVar12 / local_28; _Size = piVar11[6] * piVar11[7] * local_28; local_50 = (int)_Size >> 0x1f; local_54 = _Size; local_38 = KAGE_Memory::heap_alloc(2,(ulonglong *)&local_54); if (local_38 == (byte *)0x0) { pcVar17 = "Failed to load image \'%s\' because texel buffer allocation of size %d failed\n"; LAB_00a64de8: KAGE_LogMessage(8,(byte *)pcVar17); local_1d = 0; /* WARNING: Subroutine does not return */ longjmp(piVar5,1); } memset(local_38,0,_Size); pvVar14 = operator_new_tracked((local_24 & 0xffff) * 4); uVar12 = 0; if ((local_24 & 0xffff) != 0) { do { *(byte **)((int)pvVar14 + uVar12 * 4) = local_38 + piVar11[6] * uVar12 * local_28; uVar12 = uVar12 + 1; } while (uVar12 < (local_24 & 0xffff)); } if (*(char *)((int)piVar5 + 0x11b) == '\0') { local_24 = 1; } else { piVar5[0x1a] = piVar5[0x1a] | 2; local_24 = 7; } uVar12 = piVar5[0x31]; piVar5[0x32] = uVar12; local_4c = pvVar14; local_28 = uVar12; do { if (uVar12 != 0) { uVar8 = uVar12; do { png_read_row(uVar12); uVar8 = uVar8 - 1; uVar12 = extraout_ECX; } while (uVar8 != 0); uVar12 = local_28; pvVar14 = local_4c; } local_24 = local_24 - 1; } while (local_24 != 0); if (pvVar14 != (void *)0x0) { local_8 = 0; tracked_alloc(1,pvVar14,0); local_8 = 0xffffffff; } piVar1 = local_30; piVar11 = local_44; local_44[10] = 0xb; if (local_30 == (int *)0x3) { local_44[10] = 0; iVar6 = 0; } else if (local_48 == 3) { local_44[10] = 6; iVar6 = 6; } else { if (local_48 != 4) { pcVar17 = "Failed to load image \'%s\' because it has a unsupported number of channels (%d)\n"; goto LAB_00a64de8; } local_44[10] = 8; iVar6 = 8; } if ((((byte)g_graphicsManager_flags & 4) != 0) && (iVar6 == 8)) { image_premultiply_alpha(local_38,local_44[6],local_44[7]); } cVar3 = (**(code **)(*piVar11 + 0x58))(&local_38); if (cVar3 != '\0') { if (piVar1 == (int *)0x3) { uVar12 = 0; local_30 = (int *)0x0; local_24 = 0; local_28 = 0; if (local_2c != (ushort *)0x0) { if ((local_2c[4] & 8) != 0) { local_30 = *(int **)(local_2c + 8); uVar12 = (uint)local_2c[10]; } if ((local_2c != (ushort *)0x0) && ((local_2c[4] & 0x10) != 0)) { if (*(char *)((int)local_2c + 0x19) == '\x03') { local_24 = *(uint *)(local_2c + 0x26); } else { local_24 = 0; } local_28 = (uint)local_2c[0xb]; } } uVar12 = -(uint)(uVar12 != 0) & uVar12; uVar8 = 0x100; if (uVar12 < 0x100) { uVar8 = uVar12; } local_48 = FUN_00a66730(1,6,8); uVar12 = 0; if (uVar8 != 0) { puVar10 = (undefined1 *)(local_48 + 3); do { if ((int)uVar12 < (int)local_28) { uVar4 = *(undefined1 *)(uVar12 + local_24); } else { uVar4 = 0xff; } *puVar10 = uVar4; uVar12 = uVar12 + 1; puVar10 = puVar10 + 4; } while (uVar12 < uVar8); piVar11 = local_44; } (**(code **)(*piVar11 + 0xc))(local_48,uVar8,0); } png_read_end(); png_destroy_read_struct(&local_40); ExceptionList = local_10; return 1; } pcVar17 = "Failed to load image \'%s\' because bind_texel_data failed\n"; } else { pcVar17 = "Failed to load image \'%s\' because the component depth is not 8-bit.\n"; } KAGE_LogMessage(8,(byte *)pcVar17); local_1d = 0; /* WARNING: Subroutine does not return */ longjmp(piVar5,1); } if (local_1d != '\0') { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' due to an internal library error\n"); } if (local_38 != (byte *)0x0) { KAGE_Memory::heap_free(2,local_38); } piVar5 = local_3c; pvVar14 = local_40; png_read_destroy(local_40); if (local_2c != (ushort *)0x0) { if ((piVar5 != (int *)0x0) && (*(void **)(local_2c + 0x1c) != (void *)0x0)) { free(*(void **)(local_2c + 0x1c)); } free(local_2c); local_2c = (ushort *)0x0; } if (pvVar14 != (void *)0x0) { if ((piVar5 != (int *)0x0) && (*(void **)((int)pvVar14 + 0x38) != (void *)0x0)) { free(*(void **)((int)pvVar14 + 0x38)); } free(pvVar14); local_40 = (void *)0x0; } if (piVar5 != (int *)0x0) { free(piVar5); } } } ExceptionList = local_10; return 0; } //@@ 00a65040 FUN_00a65040 undefined4 FUN_00a65040(int param_1) { undefined4 *puVar1; undefined4 *puVar2; int iVar3; puVar2 = *(undefined4 **)(param_1 + 0x18); puVar1 = puVar2 + 8; iVar3 = (**(code **)(*(int *)puVar2[7] + 0x14))(puVar1,1,0x1000); if (iVar3 == 0) { *(undefined1 *)puVar1 = 0xff; iVar3 = 2; *(undefined1 *)((int)puVar2 + 0x21) = 0xd9; } *puVar2 = puVar1; puVar2[1] = iVar3; return 1; } //@@ 00a65080 FUN_00a65080 void FUN_00a65080(int param_1,int param_2) { undefined4 *puVar1; int *piVar2; undefined4 *puVar3; int iVar4; if (0 < param_2) { piVar2 = *(int **)(param_1 + 0x18); iVar4 = piVar2[1]; if (iVar4 < param_2) { do { puVar3 = *(undefined4 **)(param_1 + 0x18); param_2 = param_2 - iVar4; puVar1 = puVar3 + 8; iVar4 = (**(code **)(*(int *)puVar3[7] + 0x14))(puVar1,1,0x1000); if (iVar4 == 0) { *(undefined1 *)puVar1 = 0xff; iVar4 = 2; *(undefined1 *)((int)puVar3 + 0x21) = 0xd9; } *puVar3 = puVar1; puVar3[1] = iVar4; iVar4 = piVar2[1]; } while (iVar4 < param_2); } *piVar2 = *piVar2 + param_2; piVar2[1] = iVar4 - param_2; } return; } //@@ 00a650f0 FUN_00a650f0 void FUN_00a650f0(int *param_1) { /* WARNING: Subroutine does not return */ longjmp((int *)(*param_1 + 0x84),1); } //@@ 00a65110 FUN_00a65110 void FUN_00a65110(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImageJpg::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a65190 KAGE::Graphics::ImageJpg::load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: slot 14 of the KAGE::Graphics::ImageJpg vtable (0xba0020); loads a JPEG image (was image_load_jpeg) */ undefined4 KAGE::Graphics::ImageJpg::load(int param_1,undefined4 param_2) { undefined4 *puVar1; byte bVar2; char cVar3; int iVar4; int iVar5; undefined4 extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; size_t _Size; char *format; size_t local_2a8; int local_2a4; byte *local_2a0; int *local_29c; undefined4 local_298; byte *local_294; char local_28d; code *local_28c; code *local_288; code *local_284; code *local_280; code *local_27c; undefined1 local_278 [92]; undefined **local_21c; undefined4 local_218; undefined8 local_214; undefined4 local_20c; int local_208 [16]; code **local_1c8; undefined4 *local_1c4; undefined4 *local_1c0; char local_1b8; code *local_1b4; undefined4 *local_1b0; char local_188; char local_17e; uint local_16c; uint local_168; int local_160; uint local_150; undefined4 local_14c; undefined4 local_144; undefined4 local_bc; int local_a8; undefined4 *local_38; undefined4 *local_28; int local_10; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; local_298 = param_2; if (param_1 == 0) { return 0; } local_294 = (byte *)0x0; local_28d = '\x01'; memset(local_278,0,0x5c); local_1c8 = &local_28c; local_20c = 0; local_214 = 0; local_288 = FUN_00a9d270; local_284 = FUN_00a9d210; local_280 = FUN_00a9d2c0; local_27c = FUN_00a9d370; local_21c = &PTR_s_Bogus_message_code__d_00b4df58; local_218 = 0x80; local_28c = FUN_00a650f0; iVar4 = setjmp3(local_208,0); if (iVar4 != 0) { if (local_28d != '\0') { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' due to an internal library error\n"); } if (local_294 != (byte *)0x0) { KAGE_Memory::heap_free(2,local_294); } if (local_1c4 == (undefined4 *)0x0) { return 0; } (*(code *)local_1c4[10])(&local_1c8); return 0; } jpeg_CreateDecompress(extraout_ECX); if (local_1b0 == (undefined4 *)0x0) { local_1b0 = (undefined4 *)(*(code *)*local_1c4)(&local_1c8,0,0x1020); } local_1b0[7] = param_1; local_1b0[2] = guard_check_icall; local_1b0[3] = FUN_00a65040; local_1b0[4] = FUN_00a65080; local_1b0[5] = FUN_00a9d090; local_1b0[6] = guard_check_icall; local_1b0[1] = 0; *local_1b0 = 0; if ((local_1b4 != (code *)0xc8) && (local_1b4 != (code *)0xc9)) { local_1c8[5] = (code *)0x15; local_1c8[6] = local_1b4; if (*local_1c8 == FUN_00a650f0) { FUN_00a650f0(&local_1c8); } else { (**local_1c8)(&local_1c8); } } iVar4 = 0; switch(local_1b4) { case (code *)0xc8: (*(code *)local_28[1])(&local_1c8); if ((code *)local_1b0[2] != guard_check_icall) { (*(code *)local_1b0[2])(&local_1c8); } local_1b4 = (code *)0xc9; case (code *)0xc9: iVar4 = (*(code *)*local_28)(&local_1c8); if (iVar4 == 1) { default_decompress_parms(); local_1b4 = (code *)0xca; } break; case (code *)0xca: iVar4 = 1; break; case (code *)0xcb: case (code *)0xcc: case (code *)0xcd: case (code *)0xce: case (code *)0xcf: case (code *)0xd0: case (code *)0xd2: iVar4 = (*(code *)*local_28)(&local_1c8); break; default: local_1c8[5] = (code *)0x15; local_1c8[6] = local_1b4; if (*local_1c8 == FUN_00a650f0) { FUN_00a650f0(&local_1c8); } else { (**local_1c8)(&local_1c8); } } if ((iVar4 == 1) || (iVar4 != 2)) { LAB_00a654d0: if (local_1b4 != (code *)0xca) { if (local_1b4 == (code *)0xcb) goto LAB_00a65542; if (local_1b4 != (code *)0xcc) goto LAB_00a655cf; goto LAB_00a6560a; } *local_38 = FUN_00ab64a0; local_38[1] = FUN_00ab6600; *(undefined1 *)(local_38 + 2) = 0; *(undefined1 *)(local_38 + 0x19) = 0; libjpeg_jinit_master_decompress(); if (local_188 == '\0') { local_1b4 = (code *)0xcb; LAB_00a65542: if (*(char *)(local_28 + 4) != '\0') { do { if (local_1c0 != (undefined4 *)0x0) { (*(code *)*local_1c0)(&local_1c8); } do { iVar5 = (*(code *)*local_28)(&local_1c8); iVar4 = extraout_ECX_01; if (iVar5 == 0) goto LAB_00a65615; if (iVar5 == 2) goto LAB_00a655b5; } while (local_1c0 == (undefined4 *)0x0); if ((iVar5 == 3) || (iVar5 == 1)) { local_1c0[1] = local_1c0[1] + 1; if ((int)local_1c0[2] <= (int)local_1c0[1]) { local_1c0[2] = local_a8 + local_1c0[2]; } } } while( true ); } LAB_00a655b5: local_144 = local_14c; goto LAB_00a6560a; } local_1b4 = (code *)0xcf; iVar4 = extraout_ECX_00; } else { local_1c8[5] = (code *)0x35; if (*local_1c8 == FUN_00a650f0) { FUN_00a650f0(&local_1c8); } else { (**local_1c8)(&local_1c8); } if (local_1c4 == (undefined4 *)0x0) goto LAB_00a654d0; (*(code *)local_1c4[9])(&local_1c8,1); if (local_1b8 != '\0') { local_1b4 = (code *)0xc8; local_bc = 0; local_38[0x1b] = 0; goto LAB_00a654d0; } local_1b4 = (code *)0x64; LAB_00a655cf: local_1c8[5] = (code *)0x15; local_1c8[6] = local_1b4; if (*local_1c8 == FUN_00a650f0) { FUN_00a650f0(&local_1c8); } else { (**local_1c8)(&local_1c8); } LAB_00a6560a: libjpeg_output_pass_setup(); iVar4 = extraout_ECX_02; } LAB_00a65615: bVar2 = ::ImageBase::set_size(local_29c,local_16c,local_168,iVar4); iVar4 = local_160; if (bVar2 == 0) { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because set_size failed\n"); return 0; } _Size = local_29c[6] * local_29c[7] * local_160; local_2a4 = (int)_Size >> 0x1f; local_2a8 = _Size; local_294 = KAGE_Memory::heap_alloc(2,(ulonglong *)&local_2a8); if (local_294 == (byte *)0x0) { format = "Failed to load image \'%s\' because texel buffer allocation of size %d failed\n"; LAB_00a65690: KAGE_LogMessage(8,(byte *)format); } else { memset(local_294,0,_Size); if (local_150 < local_168) { do { local_2a0 = local_294 + local_29c[6] * local_150 * iVar4; jpeg_read_scanlines(local_150); } while (local_150 < local_168); } local_29c[10] = 0xb; if (local_160 == 3) { iVar4 = 6; } else { if (local_160 != 4) { format = "Failed to load image \'%s\' because it has a unsupported number of channels (%d)\n"; goto LAB_00a65690; } iVar4 = 8; } local_29c[10] = iVar4; if ((((byte)g_graphicsManager_flags & 4) != 0) && (iVar4 == 8)) { image_premultiply_alpha(local_294,local_29c[6],local_29c[7]); } cVar3 = (**(code **)(*local_29c + 0x58))(&local_294); if (cVar3 != '\0') { if (((local_1b4 == (code *)0xcd) || (local_1b4 == (code *)0xce)) && (local_188 == '\0')) { if (local_150 < local_168) { local_1c8[5] = (code *)0x45; if (*local_1c8 == FUN_00a650f0) { FUN_00a650f0(&local_1c8); } else { (**local_1c8)(&local_1c8); } } puVar1 = local_38; if ((code *)local_38[1] == FUN_00ab6600) { if (local_17e != '\0') { (**(code **)(local_10 + 0xc))(&local_1c8); } puVar1[0x1c] = puVar1[0x1c] + 1; local_1b4 = (code *)0xd2; } else { (*(code *)local_38[1])(&local_1c8); local_1b4 = (code *)0xd2; } } else if (local_1b4 == (code *)0xcf) { local_1b4 = (code *)0xd2; } else if (local_1b4 != (code *)0xd2) { local_1c8[5] = (code *)0x15; local_1c8[6] = local_1b4; if (*local_1c8 == FUN_00a650f0) { FUN_00a650f0(&local_1c8); } else { (**local_1c8)(&local_1c8); } } cVar3 = *(char *)((int)local_28 + 0x11); while (cVar3 == '\0') { iVar4 = (*(code *)*local_28)(&local_1c8); if (iVar4 == 0) goto LAB_00a65925; cVar3 = *(char *)((int)local_28 + 0x11); } if ((code *)local_1b0[6] != guard_check_icall) { (*(code *)local_1b0[6])(&local_1c8); } if (local_1c4 != (undefined4 *)0x0) { (*(code *)local_1c4[9])(&local_1c8,1); if (local_1b8 == '\0') { local_1b4 = (code *)0x64; } else { local_1b4 = (code *)0xc8; local_bc = 0; local_38[0x1b] = 0; } LAB_00a65925: if (local_1c4 != (undefined4 *)0x0) { (*(code *)local_1c4[10])(&local_1c8); } } return 1; } KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because bind_texel_data failed\n"); } local_28d = 0; /* WARNING: Subroutine does not return */ longjmp(local_208,1); } //@@ 00a659e0 FUN_00a659e0 void FUN_00a659e0(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImageBmp::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a65a60 ImageBmp::load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: slot 14 of KAGE::Graphics::ImageBmp vftable (0xba004c+0x38 = 0xba0084, same slot as ImagePng::load/image_load_jpeg); 'header type is invalid', 'compressed bitmaps are not supported', 'unsupported number of bits per pixel', ImageBase::set_size, image_premultiply_alpha */ undefined4 ImageBmp::load(int *param_1,undefined4 param_2) { byte bVar1; char cVar2; int *in_ECX; int unused; int iVar3; byte *unaff_EBX; void *unaff_ESI; int iVar4; undefined4 uVar5; undefined4 uVar6; undefined1 auStack_64 [2]; undefined1 uStack_62; undefined1 uStack_61; void *pvStack_60; size_t sStack_5c; uint uStack_58; undefined4 local_54; size_t sStack_50; int iStack_4c; short local_44 [5]; int iStack_3a; int iStack_36; undefined4 uStack_32; uint uStack_2e; ushort uStack_28; int iStack_26; uint local_c; local_c = __security_cookie ^ (uint)auStack_64; local_54 = param_2; if (param_1 == (int *)0x0) { return 0; } (**(code **)(*param_1 + 0x14))(local_44,0x36,1); if (local_44[0] != 0x4d42) { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because the header type is invalid\n"); return 0; } if (iStack_26 != 0) { KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because compressed bitmaps are not supported\n"); return 0; } if ((uStack_28 != 0x18) && (uStack_28 != 0x20)) { KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because it has a unsupported number of bits per pixel (%d)\n" ); return 0; } uStack_61 = 0 < (int)uStack_2e; if ((int)uStack_2e < 0) { uStack_2e = -uStack_2e; } bVar1 = ImageBase::set_size(in_ECX,uStack_32,uStack_2e,unused); if (bVar1 == 0) { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because set_size failed\n"); return 0; } uStack_58 = (uint)(uStack_28 >> 3); sStack_5c = in_ECX[6] * uStack_58 * in_ECX[7]; iStack_4c = (int)sStack_5c >> 0x1f; sStack_50 = sStack_5c; pvStack_60 = KAGE_Memory::heap_alloc(2,(ulonglong *)&sStack_50); if (pvStack_60 == (void *)0x0) { KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because texel buffer allocation of size %d failed\n" ); return 0; } memset(pvStack_60,0,sStack_5c); (**(code **)(*param_1 + 0xc))(iStack_3a,0); iVar4 = 0; if (0 < iStack_36) { do { if ((char)((uint)unaff_ESI >> 0x18) == '\0') { iVar3 = iVar4; } else { iVar3 = (iStack_36 - iVar4) + -1; } (**(code **)(*param_1 + 0x14)) (unaff_EBX + in_ECX[6] * iVar3 * (int)pvStack_60,1,(int)pvStack_60 * iStack_3a); iVar4 = iVar4 + 1; } while (iVar4 < iStack_36); } in_ECX[10] = 0xb; if (uStack_32._2_2_ == 0x18) { uVar6 = 6; in_ECX[10] = 6; uVar5 = 7; } else { if (uStack_32._2_2_ != 0x20) goto LAB_00a65c7a; uVar6 = 8; in_ECX[10] = 8; uVar5 = 10; } FUN_00a667b0(in_ECX[7],uVar5,uVar6); LAB_00a65c7a: if ((((byte)g_graphicsManager_flags & 4) != 0) && (in_ECX[10] == 8)) { image_premultiply_alpha(unaff_EBX,in_ECX[6],in_ECX[7]); } cVar2 = (**(code **)(*in_ECX + 0x58))(auStack_64 + -4); if (cVar2 == '\0') { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because bind_texel_data failed\n"); KAGE_Memory::heap_free(2,unaff_ESI); return 0; } return 1; } //@@ 00a65d00 FUN_00a65d00 void FUN_00a65d00(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImagePcx::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a65d80 KAGE::Graphics::ImagePcx::load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: vtable slot 14 of KAGE::Graphics::ImagePcx (same slot as image_load_jpeg in ImageJpg); strings "Pcx image \"%s\" has premultiplied alpha but premultipled alpha rendering is not turned on in KAGE", "Failed to load image ... set_size failed / texel buffer allocation / bind_texel_data failed / unsupported number of channels"; reads the 0x80-byte PCX header via stream vtable +0x14, ImageBase::set_size(xmax-xmin+1, ymax-ymin+1), RLE decode, image_premultiply_alpha; sibling of image_load_jpeg (00a65190) */ undefined4 KAGE::Graphics::ImagePcx::load(int *param_1,void *param_2) { ushort uVar1; ushort uVar2; byte bVar3; char cVar4; uint uVar5; int iVar6; int *in_ECX; int unused; byte bVar7; byte *_Size; undefined1 auStack_bc [3]; byte bStack_b9; void *local_b8; byte *pbStack_b4; uint uStack_b0; int *local_ac; uint uStack_a8; int *local_a4; byte *pbStack_a0; int iStack_9c; undefined4 uStack_94; undefined1 local_90 [4]; ushort uStack_8c; ushort uStack_8a; ushort uStack_88; ushort uStack_86; char cStack_50; byte bStack_4f; short sStack_4e; uint local_c; local_c = __security_cookie ^ (uint)auStack_bc; local_b8 = param_2; local_ac = param_1; if (param_1 != (int *)0x0) { local_a4 = in_ECX; (**(code **)(*param_1 + 0x14))(local_90,0x80,1); bVar3 = ::ImageBase::set_size (in_ECX,((uint)uStack_88 - (uint)uStack_8c) + 1, ((uint)uStack_86 - (uint)uStack_8a) + 1,unused); if (bVar3 != 0) { _Size = (byte *)((uint)bStack_4f * in_ECX[7] * in_ECX[6]); iStack_9c = (int)_Size >> 0x1f; pbStack_a0 = _Size; pbStack_b4 = KAGE_Memory::heap_alloc(2,(ulonglong *)&pbStack_a0); if (pbStack_b4 == (byte *)0x0) { KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because texel buffer allocation of size %d failed\n" ); return 0; } memset(pbStack_b4,0,(size_t)_Size); bVar3 = 0; uStack_b0 = 0; bVar7 = 0; if (in_ECX[5] != 0) { do { uVar5 = (uint)bStack_4f; uStack_a8 = 0; if (uVar5 != 0) { do { uStack_94 = 0; uStack_94._0_2_ = 0; pbStack_a0 = pbStack_b4 + uVar5 * uStack_b0 * in_ECX[6] + uStack_a8; uVar1 = (ushort)bStack_4f * sStack_4e; uVar2 = (ushort)uStack_94; do { for (; bVar3 != 0; bVar3 = bVar3 - 1) { if (uVar1 <= uVar2) goto LAB_00a65f4c; pbStack_a0[uVar2] = bVar7; uVar2 = uVar2 + bStack_4f; } bStack_b9 = 0; (**(code **)(*local_ac + 0x14))(&bStack_b9,1,1); bVar3 = bStack_b9; if ((bStack_b9 & 0xc0) == 0xc0) { bStack_b9 = 0; bVar3 = bVar3 & 0x3f; (**(code **)(*local_ac + 0x14))(&bStack_b9,1,1); } else { bVar3 = 1; } bVar7 = bStack_b9; } while (uVar2 < uVar1); LAB_00a65f4c: uVar5 = (uint)bStack_4f; uStack_a8 = uStack_a8 + 1; in_ECX = local_a4; } while (uStack_a8 < uVar5); } uStack_b0 = uStack_b0 + 1; } while (uStack_b0 < (uint)in_ECX[5]); } in_ECX[10] = 0xb; if (bStack_4f == 3) { iVar6 = 6; } else { if (bStack_4f != 4) { KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because it has a unsupported number of channels (%d)\n" ); KAGE_Memory::heap_free(2,pbStack_b4); return 0; } iVar6 = 8; } in_ECX[10] = iVar6; if (((byte)g_graphicsManager_flags & 4) == 0) { if (cStack_50 == '\x01') { KAGE_LogMessage(4,(byte *) "Pcx image \"%s\" has premultiplied alpha but premultipled alpha rendering is not turned on in KAGE\n" ); } } else if ((iVar6 == 8) && (cStack_50 == '\0')) { image_premultiply_alpha(pbStack_b4,in_ECX[6],in_ECX[7]); } cVar4 = (**(code **)(*in_ECX + 0x58))(&pbStack_b4); if (cVar4 == '\0') { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because bind_texel_data failed\n"); KAGE_Memory::heap_free(2,local_b8); return 0; } return 1; } KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because set_size failed\n"); } return 0; } //@@ 00a66080 FUN_00a66080 void FUN_00a66080(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImagePlatform::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a66100 FUN_00a66100 void FUN_00a66100(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImageRGBA::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a66180 FUN_00a66180 undefined4 FUN_00a66180(int *param_1) { int iVar1; int iVar2; byte bVar3; char cVar4; int *in_ECX; int unused; ushort unaff_DI; byte *pbVar5; byte *pbStack_30; uint uStack_2c; uint uVar6; undefined4 auStack_1c [2]; undefined4 local_14 [4]; if (param_1 != (int *)0x0) { uStack_2c = 1; pbStack_30 = (byte *)0x2; local_14[0] = 0; (**(code **)(*param_1 + 0x14))(); auStack_1c[0] = 0; (**(code **)(*param_1 + 0x14))(auStack_1c,2,1); bVar3 = ImageBase::set_size(in_ECX,(uint)unaff_DI,uStack_2c & 0xffff,unused); if (bVar3 != 0) { iVar1 = in_ECX[6]; iVar2 = in_ECX[7]; pbStack_30 = KAGE_Memory::heap_alloc(2,(ulonglong *)(auStack_1c + -3)); if (pbStack_30 == (byte *)0x0) { KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because texel buffer allocation of size %d failed\n" ); return 0; } memset(pbStack_30,0,iVar1 * iVar2 * 4); uVar6 = 0; pbVar5 = pbStack_30; if (in_ECX[5] != 0) { do { (**(code **)(*param_1 + 0x14))(pbVar5,1,in_ECX[4] << 2); uVar6 = uVar6 + 1; pbVar5 = pbVar5 + in_ECX[6] * 4; } while (uVar6 < (uint)in_ECX[5]); } if (((byte)g_graphicsManager_flags & 4) != 0) { image_premultiply_alpha(pbStack_30,in_ECX[6],in_ECX[7]); } in_ECX[10] = 8; cVar4 = (**(code **)(*in_ECX + 0x58))(&pbStack_30); if (cVar4 == '\0') { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because bind_texel_data failed\n"); KAGE_Memory::heap_free(2,local_14); return 0; } return 1; } KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because set_size failed\n"); } return 0; } //@@ 00a662f0 FUN_00a662f0 void FUN_00a662f0(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::PlatformRenderTarget::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a66370 FUN_00a66370 undefined4 FUN_00a66370(void) { undefined4 in_ECX; switch(in_ECX) { case 0: case 1: case 2: return 1; case 3: case 4: case 5: return 2; case 6: case 7: return 3; case 8: case 9: case 10: return 4; default: return 0; } } //@@ 00a663c0 image_premultiply_alpha /* DB: RGBA8 pixels (count = w*h): alpha 0 -> zero pixel, alpha 0xff kept, else rgb = table[(a<<8)|c] (DAT_00c23640, or DAT_00c13640 when g_graphicsManager_flags&8); image loaders when flags&4 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl image_premultiply_alpha(byte *pixels,int width,int height) { byte bVar1; byte *pbVar2; int iVar3; undefined *puVar4; iVar3 = width * height; puVar4 = &DAT_00c23640; if (((byte)g_graphicsManager_flags & 8) != 0) { puVar4 = &DAT_00c13640; } if (iVar3 != 0) { pbVar2 = pixels + 1; do { bVar1 = pbVar2[2]; if (bVar1 != 0xff) { if (bVar1 == 0) { pbVar2[-0xffffffff00000001] = 0; pbVar2[0] = 0; pbVar2[1] = 0; pbVar2[2] = 0; } else { pbVar2[-1] = puVar4[CONCAT11(bVar1,pbVar2[-1])]; *pbVar2 = puVar4[CONCAT11(bVar1,*pbVar2)]; pbVar2[1] = puVar4[CONCAT11(bVar1,pbVar2[1])]; } } pbVar2 = pbVar2 + 4; iVar3 = iVar3 + -1; } while (iVar3 != 0); } return; } //@@ 00a66440 FUN_00a66440 void FUN_00a66440(undefined4 param_1) { byte bVar1; byte bVar2; byte bVar3; byte bVar4; KColor *in_ECX; byte *in_EDX; switch(param_1) { case 0: KAGE_LogMessage(0x10,(byte *)"Cannot get texel color from an indexed texture\n"); case 6: bVar3 = in_EDX[2]; bVar4 = *in_EDX; goto LAB_00a66473; default: KColor::SetFromARGB(in_ECX,0xffff00ff); return; case 7: bVar3 = *in_EDX; bVar4 = in_EDX[2]; LAB_00a66473: bVar1 = in_EDX[1]; in_ECX->_unk = 0; in_ECX->_alpha = 1.0; in_ECX->_red = (float)bVar4 / 255.0; in_ECX->_green = (float)bVar1 / 255.0; in_ECX->_blue = (float)bVar3 / 255.0; return; case 8: bVar3 = in_EDX[2]; bVar4 = *in_EDX; break; case 9: bVar2 = *in_EDX; bVar3 = in_EDX[1]; bVar1 = in_EDX[2]; bVar4 = in_EDX[3]; goto LAB_00a664db; case 10: bVar3 = *in_EDX; bVar4 = in_EDX[2]; } bVar1 = in_EDX[1]; bVar2 = in_EDX[3]; LAB_00a664db: in_ECX->_unk = 0; in_ECX->_red = (float)bVar4 / 255.0; in_ECX->_green = (float)bVar1 / 255.0; in_ECX->_blue = (float)bVar3 / 255.0; in_ECX->_alpha = (float)bVar2 / 255.0; return; } //@@ 00a66590 FUN_00a66590 undefined4 FUN_00a66590(float *param_1) { undefined1 *in_ECX; int iVar1; undefined4 in_EDX; switch(in_EDX) { case 0: KAGE_LogMessage(0x10,(byte *)"Cannot set texel inside an indexed texture"); return 0; case 6: *in_ECX = (char)(int)(*param_1 * 255.0); in_ECX[1] = (char)(int)(param_1[1] * 255.0); in_ECX[2] = (char)(int)(param_1[2] * 255.0); return 1; case 7: *in_ECX = (char)(int)(param_1[2] * 255.0); in_ECX[1] = (char)(int)(param_1[1] * 255.0); in_ECX[2] = (char)(int)(*param_1 * 255.0); return 1; case 8: iVar1 = 0; do { in_ECX[iVar1] = (char)(int)(param_1[iVar1] * 255.0); iVar1 = iVar1 + 1; } while (iVar1 < 4); return 1; case 9: *in_ECX = (char)(int)(param_1[3] * 255.0); in_ECX[1] = (char)(int)(param_1[2] * 255.0); in_ECX[2] = (char)(int)(param_1[1] * 255.0); in_ECX[3] = (char)(int)(*param_1 * 255.0); return 1; case 10: *in_ECX = (char)(int)(param_1[2] * 255.0); in_ECX[1] = (char)(int)(param_1[1] * 255.0); in_ECX[2] = (char)(int)(*param_1 * 255.0); in_ECX[3] = (char)(int)(param_1[3] * 255.0); } return 1; } //@@ 00a66730 FUN_00a66730 void * FUN_00a66730(int param_1) { char cVar1; int iVar2; void *ptr; int in_EDX; int local_10 [3]; iVar2 = FUN_00a66370(); local_10[1] = 0; local_10[0] = iVar2 * in_EDX * param_1; ptr = KAGE_Memory::heap_alloc(2,(ulonglong *)local_10); cVar1 = image_convert_pixel_format(); if (cVar1 == '\0') { KAGE_Memory::heap_free(2,ptr); return (void *)0x0; } return ptr; } //@@ 00a667b0 FUN_00a667b0 undefined4 FUN_00a667b0(undefined4 param_1) { int iVar1; undefined4 uVar2; int *in_ECX; undefined4 extraout_ECX; undefined4 in_EDX; undefined8 uVar3; iVar1 = FUN_00a66370(); uVar3 = FUN_00a66370(); if (iVar1 == (int)uVar3) { uVar2 = image_convert_pixel_format(in_EDX,param_1,(int)((ulonglong)uVar3 >> 0x20),extraout_ECX); return uVar2; } iVar1 = FUN_00a66730(); if (iVar1 == 0) { return 0; } KAGE_Memory::heap_free(2,(void *)*in_ECX); *in_ECX = iVar1; return 1; } //@@ 00a66830 FUN_00a66830 void FUN_00a66830(undefined1 *param_1,byte param_2,undefined4 param_3,byte param_4,byte param_5, undefined4 param_6,byte param_7) { undefined1 uVar1; undefined1 uVar2; undefined1 *puVar3; int in_ECX; int in_EDX; undefined1 *puVar4; undefined1 *puVar5; int local_c; undefined1 *local_8; local_c = in_EDX * (int)param_1; if (local_c != 0) { local_8 = (undefined1 *)((uint)param_2 + in_ECX); param_1 = (undefined1 *)((uint)param_4 + in_ECX); puVar3 = (undefined1 *)(in_ECX + 1); puVar4 = (undefined1 *)((uint)param_7 + in_ECX); puVar5 = (undefined1 *)((uint)param_5 + in_ECX); do { uVar1 = *param_1; uVar2 = *puVar3; *puVar5 = *local_8; *puVar3 = uVar2; local_8 = local_8 + 3; *puVar4 = uVar1; param_1 = param_1 + 3; local_c = local_c + -1; puVar3 = puVar3 + 3; puVar4 = puVar4 + 3; puVar5 = puVar5 + 3; } while (local_c != 0); } return; } //@@ 00a668b0 FUN_00a668b0 void FUN_00a668b0(int param_1,undefined1 *param_2,byte param_3,undefined4 param_4,byte param_5, byte param_6,byte param_7,byte param_8,byte param_9) { undefined1 uVar1; undefined1 uVar2; undefined1 uVar3; int in_ECX; int in_EDX; undefined1 *puVar4; undefined1 *puVar5; undefined1 *local_14; undefined1 *local_10; undefined1 *local_c; undefined1 *local_8; param_1 = param_1 * (int)param_2; if (param_1 != 0) { local_14 = (undefined1 *)((uint)param_7 + in_EDX); local_10 = (undefined1 *)((uint)param_5 + in_ECX); local_8 = (undefined1 *)((uint)param_3 + in_ECX); local_c = (undefined1 *)(in_ECX + 1); puVar4 = (undefined1 *)((uint)param_9 + in_EDX); puVar5 = (undefined1 *)((uint)param_8 + in_EDX); param_2 = (undefined1 *)((uint)param_6 + in_EDX); do { uVar1 = *local_8; uVar2 = *local_c; uVar3 = *local_10; local_8 = local_8 + 3; *param_2 = uVar1; *local_14 = uVar2; local_14 = local_14 + 4; *puVar5 = uVar3; local_c = local_c + 3; local_10 = local_10 + 3; *puVar4 = 0xff; param_1 = param_1 + -1; puVar4 = puVar4 + 4; puVar5 = puVar5 + 4; param_2 = param_2 + 4; } while (param_1 != 0); } return; } //@@ 00a66960 FUN_00a66960 void FUN_00a66960(undefined1 *param_1,byte param_2,byte param_3,byte param_4,byte param_5, byte param_6,byte param_7,byte param_8,byte param_9) { undefined1 uVar1; undefined1 uVar2; undefined1 uVar3; int in_ECX; int in_EDX; undefined1 *puVar4; undefined1 *puVar5; int local_1c; undefined1 *local_18; undefined1 *local_14; undefined1 *local_10; undefined1 *local_c; undefined1 *local_8; local_1c = in_EDX * (int)param_1; if (local_1c != 0) { local_14 = (undefined1 *)((uint)param_4 + in_ECX); local_18 = (undefined1 *)((uint)param_5 + in_ECX); local_10 = (undefined1 *)((uint)param_3 + in_ECX); puVar4 = (undefined1 *)((uint)param_9 + in_ECX); puVar5 = (undefined1 *)((uint)param_8 + in_ECX); param_1 = (undefined1 *)((uint)param_2 + in_ECX); local_c = (undefined1 *)((uint)param_7 + in_ECX); local_8 = (undefined1 *)((uint)param_6 + in_ECX); do { uVar1 = *local_18; uVar2 = *local_10; uVar3 = *local_14; *local_8 = *param_1; *local_c = uVar2; *puVar5 = uVar3; local_10 = local_10 + 4; *puVar4 = uVar1; local_14 = local_14 + 4; local_18 = local_18 + 4; local_1c = local_1c + -1; puVar4 = puVar4 + 4; puVar5 = puVar5 + 4; param_1 = param_1 + 4; local_c = local_c + 4; local_8 = local_8 + 4; } while (local_1c != 0); } return; } //@@ 00a66a20 image_convert_pixel_format /* DB: ? (w, h, srcFmt, dstFmt) with ECX src / EDX dst: same format or same bytes-per-pixel (FUN_00a66370: fmt 0-2 ->1, 3-5 ->2, 6-7 ->3, 8-10 ->4) memcpy, else per-pair converters (6->7, 6->8 ...); callers FUN_00a66730 (alloc + convert) and FUN_00a667b0 (in-place) */ undefined4 image_convert_pixel_format(int param_1,int param_2,int param_3,int param_4) { int iVar1; void *in_ECX; int extraout_ECX; void *in_EDX; undefined8 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; iVar1 = FUN_00a66370(); if (extraout_ECX == param_4) { memcpy(in_EDX,in_ECX,iVar1 * param_1 * param_2); return 1; } uVar2 = FUN_00a66370(); iVar1 = (int)((ulonglong)uVar2 >> 0x20); if ((iVar1 == (int)uVar2) && (in_ECX != in_EDX)) { memcpy(in_EDX,in_ECX,iVar1 * param_1 * param_2); } if (param_3 == 6) { if (param_4 == 7) { FUN_00a66830(param_2,0,in_ECX,2,2,in_ECX,0); return 1; } if (param_4 == 8) { uVar9 = 3; uVar7 = 2; uVar6 = 1; uVar5 = 0; } else if (param_4 == 9) { uVar9 = 0; uVar7 = 1; uVar6 = 2; uVar5 = 3; } else { if (param_4 != 10) { return 0; } uVar9 = 3; uVar7 = 0; uVar6 = 1; uVar5 = 2; } uVar4 = 2; uVar3 = 0; } else { if (param_3 != 7) { if (param_3 == 8) { if (param_4 == 9) { uVar10 = 0; uVar8 = 1; uVar9 = 2; uVar7 = 3; } else { if (param_4 != 10) { return 0; } uVar10 = 3; uVar8 = 0; uVar9 = 1; uVar7 = 2; } uVar6 = 3; uVar5 = 2; uVar4 = 1; uVar3 = 0; } else if (param_3 == 9) { if (param_4 == 8) { uVar10 = 3; uVar8 = 2; uVar9 = 1; uVar7 = 0; uVar6 = 0; uVar5 = 1; uVar4 = 2; uVar3 = 3; } else { if (param_4 != 10) { return 0; } uVar10 = 3; uVar8 = 0; uVar9 = 1; uVar7 = 2; uVar6 = 0; uVar5 = 1; uVar4 = 2; uVar3 = 3; } } else { if (param_3 != 10) { return 0; } if (param_4 == 8) { uVar10 = 3; uVar8 = 2; uVar9 = 1; uVar7 = 0; uVar6 = 3; uVar5 = 0; uVar4 = 1; uVar3 = 2; } else { if (param_4 != 9) { return 0; } uVar10 = 0; uVar8 = 1; uVar9 = 2; uVar7 = 3; uVar6 = 3; uVar5 = 0; uVar4 = 1; uVar3 = 2; } } FUN_00a66960(param_2,uVar3,uVar4,uVar5,uVar6,uVar7,uVar9,uVar8,uVar10); return 1; } if (param_4 == 6) { FUN_00a66830(param_2,2,in_ECX,0,0,in_ECX,2); return 1; } if (param_4 == 8) { uVar9 = 3; uVar7 = 2; uVar6 = 1; uVar5 = 0; uVar4 = 0; uVar3 = 2; } else if (param_4 == 9) { uVar9 = 0; uVar7 = 1; uVar6 = 2; uVar5 = 3; uVar4 = 0; uVar3 = 2; } else { if (param_4 != 10) { return 0; } uVar9 = 3; uVar7 = 0; uVar6 = 1; uVar5 = 2; uVar4 = 0; uVar3 = 2; } } FUN_00a668b0(param_1,param_2,uVar3,in_ECX,uVar4,uVar5,uVar6,uVar7,uVar9); return 1; } //@@ 00a66c30 FUN_00a66c30 void FUN_00a66c30(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Graphics::ImagePalette::vftable; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x16,uVar1); FUN_00a12ad0(); *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } ExceptionList = local_10; return; } //@@ 00a66cb0 FUN_00a66cb0 undefined4 FUN_00a66cb0(int *param_1) { char cVar1; void *_Dst; void *pvVar2; int *in_ECX; void *ptr; size_t _Size; undefined1 auStack_12 [2]; size_t local_10 [3]; if (param_1 != (int *)0x0) { in_ECX[10] = 8; ImageBase::set_size(in_ECX,0x100,1,(int)in_ECX); local_10[1] = 0; _Size = in_ECX[7] * in_ECX[6] * 4; local_10[0] = _Size; _Dst = KAGE_Memory::heap_alloc(2,(ulonglong *)local_10); if (_Dst != (void *)0x0) { memset(_Dst,0,_Size); pvVar2 = (void *)(**(code **)(*param_1 + 4))(); ptr = (void *)0x100; if (pvVar2 < (void *)0x100) { ptr = pvVar2; } (**(code **)(*param_1 + 0x14))(_Dst,1); cVar1 = (**(code **)(*in_ECX + 0x58))(auStack_12 + -0xe); if (cVar1 == '\0') { KAGE_LogMessage(8,(byte *)"Failed to load image \'%s\' because bind_texel_data failed\n"); KAGE_Memory::heap_free(2,ptr); return 0; } return 1; } KAGE_LogMessage(8,(byte *) "Failed to load image \'%s\' because texel buffer allocation of size %d failed\n" ); } return 0; } //@@ 00a66d90 FUN_00a66d90 void FUN_00a66d90(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Graphics::RenderBatch::vftable; FUN_00a680d0(uVar2); FID_conflict__Tidy(in_ECX + 10); local_8 = 0; if ((int *)in_ECX[3] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[3] + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 2); } } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x44); } ExceptionList = local_10; return; } //@@ 00a66e30 RenderBatch::set_state /* DB: ? captures the image SmartPointer (ImageBase map lookup by +0x48), blend mode, DAT_00c79904..10, g_currentShader and copies the shader's uniform vector into the batch (+0x28); kage_graphics_flush new batch */ void RenderBatch::set_state(int param_1) { int *piVar1; int *piVar2; void *pvVar3; char cVar4; byte bVar5; ReferenceCountBase *pRVar6; undefined4 *other; int in_ECX; undefined4 local_3c; int *local_38; undefined4 local_34; ReferenceCountBase *local_30; ReferenceCountBase *local_2c; size_t local_28; void *local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; uint local_14; puStack_20 = (undefined1 *)((int)register0x00000010 + -4); local_14 = 0xffffffff; puStack_18 = &LAB_00b13216; local_1c = ExceptionList; ExceptionList = &local_1c; local_24 = (void *)0x0; if (param_1 == 0) { local_34 = 0; local_30 = (ReferenceCountBase *)0x0; pRVar6 = operator_new(0x18); local_14 = 1; local_2c = pRVar6; if (pRVar6 == (ReferenceCountBase *)0x0) { pRVar6 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar6); *(undefined ***)pRVar6 = ReferenceCount::vftable; *(undefined4 *)(pRVar6 + 0x14) = 0; } local_14 = local_14 & 0xffffff00; if (((local_30 != (ReferenceCountBase *)0x0) && (cVar4 = (**(code **)(*(int *)local_30 + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_34); } local_34 = 0; local_14 = 2; other = &local_34; local_24 = (void *)0x2; local_30 = pRVar6; } else { local_28 = *(size_t *)(param_1 + 0x48); puStack_20 = (undefined1 *)((int)register0x00000010 + -4); FUN_00a12280(&local_24,&local_28); if (local_24 != DAT_00c37988) { do { if (*(int *)(*(int *)((int)local_24 + 0x14) + 0x48) != *(int *)(param_1 + 0x48)) break; if (*(int *)((int)local_24 + 0x14) == param_1) { KAGE::SmartPointer::operator_assign(&local_3c,(void *)((int)local_24 + 0x14)); goto LAB_00a66ecc; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); } while (local_24 != DAT_00c37988); } KAGE::SmartPointer::SmartPointer(&local_3c,(void *)0x0); LAB_00a66ecc: local_14 = 0; other = &local_3c; local_24 = (void *)0x5; } KAGE::SmartPointer::operator_assign((void *)(in_ECX + 8),other); if (((uint)local_24 & 2) != 0) { local_24 = (void *)((uint)local_24 & 0xfffffffd); local_14 = 3; if (((local_30 != (ReferenceCountBase *)0x0) && (cVar4 = (**(code **)(*(int *)local_30 + 0xc))(), cVar4 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_34); } } if (((((uint)local_24 & 1) != 0) && (local_14 = 4, local_38 != (int *)0x0)) && ((cVar4 = (**(code **)(*local_38 + 0xc))(), cVar4 != '\0' && (g_imageReleaseFn != (void *)0x0)) )) { (*g_imageReleaseFn)(&local_3c); } local_14 = 0xffffffff; piVar1 = (int *)(in_ECX + 0x28); *(int *)(in_ECX + 0x10) = g_graphicsManager_blendMode[0]; *(int *)(in_ECX + 0x14) = g_graphicsManager_blendMode[1]; *(int *)(in_ECX + 0x18) = g_graphicsManager_blendMode[2]; *(int *)(in_ECX + 0x1c) = g_graphicsManager_blendMode[3]; *(int *)(in_ECX + 0x20) = g_graphicsManager_blendMode[4]; pvVar3 = g_currentShader; *(void **)(in_ECX + 0x24) = g_currentShader; piVar2 = (int *)((int)pvVar3 + 0x40); if (piVar1 != piVar2) { local_2c = (ReferenceCountBase *)*piVar2; local_28 = *(int *)((int)pvVar3 + 0x44) - (int)local_2c; local_24 = (void *)*piVar1; if ((uint)(*(int *)(in_ECX + 0x30) - (int)local_24 >> 2) < (uint)((int)local_28 >> 2)) { std::vector::reserve_clear((int)local_28 >> 2); local_24 = (void *)*piVar1; } memmove(local_24,local_2c,local_28); *(size_t *)(in_ECX + 0x2c) = (int)local_24 + local_28; } if ((((*(int *)(in_ECX + 0x10) == 0) && (*(int *)(in_ECX + 0x14) == 1)) && (*(int *)(in_ECX + 0x18) == 0)) && ((*(int *)(in_ECX + 0x1c) == 1 && (*(int *)(in_ECX + 0x20) == 0)))) { bVar5 = *(byte *)(in_ECX + 4) | 1; } else { bVar5 = *(byte *)(in_ECX + 4) & 0xfe; } *(byte *)(in_ECX + 4) = bVar5; ExceptionList = local_1c; return; } //@@ 00a670c0 RenderBatch::is_state_equal /* DB: ? compares a batch's state (vertex format +8 vs arg, blend mode +0x10 vs g_graphicsManager_blendMode, +0x14..+0x20 vs DAT_00c79904..10, shader +0x24 vs g_currentShader, uniform bytes +0x28 vs shader+0x40) and returns bool; kage_graphics_flush batch reuse */ uint RenderBatch::is_state_equal(void *param_1) { uint uVar1; void *pvVar2; undefined3 uVar3; int in_ECX; int *piVar4; int *piVar5; void *pvVar6; uint uVar7; pvVar2 = *(void **)(in_ECX + 8); if (((((pvVar2 != param_1) || (pvVar2 = *(void **)(in_ECX + 0x10), pvVar2 != (void *)g_graphicsManager_blendMode[0])) || (pvVar2 = *(void **)(in_ECX + 0x14), pvVar2 != (void *)g_graphicsManager_blendMode[1])) || ((pvVar2 = *(void **)(in_ECX + 0x18), pvVar2 != (void *)g_graphicsManager_blendMode[2] || (pvVar2 = *(void **)(in_ECX + 0x1c), pvVar2 != (void *)g_graphicsManager_blendMode[3])))) || ((pvVar2 = *(void **)(in_ECX + 0x20), pvVar2 != (void *)g_graphicsManager_blendMode[4] || (pvVar2 = *(void **)(in_ECX + 0x24), pvVar2 != g_currentShader)))) goto LAB_00a671a4; piVar5 = *(int **)((int)pvVar2 + 0x40); piVar4 = *(int **)(in_ECX + 0x28); pvVar6 = (void *)(*(int *)(in_ECX + 0x2c) - (int)piVar4 >> 2); pvVar2 = (void *)(*(int *)((int)pvVar2 + 0x44) - (int)piVar5 >> 2); if (pvVar6 != pvVar2) goto LAB_00a671a4; uVar7 = (int)pvVar6 * 4; while (uVar1 = uVar7 - 4, 3 < uVar7) { pvVar2 = (void *)*piVar4; if (pvVar2 != (void *)*piVar5) goto LAB_00a67166; piVar4 = piVar4 + 1; piVar5 = piVar5 + 1; uVar7 = uVar1; } if (uVar1 == 0xfffffffc) { LAB_00a67197: pvVar2 = (void *)CONCAT31((int3)((uint)pvVar2 >> 8),1); } else { LAB_00a67166: uVar3 = (undefined3)((uint)pvVar2 >> 8); pvVar2 = (void *)CONCAT31(uVar3,(char)*piVar4); if (((char)*piVar4 == (char)*piVar5) && ((uVar1 == 0xfffffffd || ((pvVar2 = (void *)CONCAT31(uVar3,*(char *)((int)piVar4 + 1)), *(char *)((int)piVar4 + 1) == *(char *)((int)piVar5 + 1) && ((uVar1 == 0xfffffffe || ((pvVar2 = (void *)CONCAT31(uVar3,*(char *)((int)piVar4 + 2)), *(char *)((int)piVar4 + 2) == *(char *)((int)piVar5 + 2) && ((uVar1 == 0xffffffff || (pvVar2 = (void *)CONCAT31(uVar3,*(char *)((int)piVar4 + 3)), *(char *)((int)piVar4 + 3) == *(char *)((int)piVar5 + 3))))))))))))) goto LAB_00a67197; pvVar2 = (void *)((uint)pvVar2 & 0xffffff00); } if ((char)pvVar2 != '\0') { return CONCAT31((int3)((uint)pvVar2 >> 8),1); } LAB_00a671a4: return (uint)pvVar2 & 0xffffff00; } //@@ 00a671b0 render_quad_draw /* WARNING: Removing unreachable block (ram,0x00a67b45) */ /* WARNING: Removing unreachable block (ram,0x00a67aff) */ /* WARNING: Removing unreachable block (ram,0x00a67b24) */ /* WARNING: Removing unreachable block (ram,0x00a67b34) */ /* WARNING: Removing unreachable block (ram,0x00a67b6b) */ /* WARNING: Removing unreachable block (ram,0x00a67b7b) */ /* WARNING: Removing unreachable block (ram,0x00a67b81) */ /* DB: KAGE renderer: takes (color/settings*, quad from render_quad_set_rect, flags) with ECX = quad renderer; builds vertices per attribute format (cases 1-8, "Unknown attribute format specified"), divides UVs by texture size at this+8 (+0x10/+0x14); callers Entity::PostRender, HUD, debug overlay prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall render_quad_draw(void *this,void *sourceQuads,void *colorQuads,uint count,int unused) { float *pfVar1; double dVar2; float fVar3; float fVar4; float fVar5; char cVar6; uint uVar7; int iVar8; uint uVar9; int iVar10; Vector *pVVar11; int iVar12; uint uVar13; int iVar14; float *pfVar15; SourceQuad *this_00; float *pfVar16; float10 fVar17; float fVar18; float fVar19; SourceQuad *local_74; float *local_68; float *local_4c; float *local_44; float *local_40; int local_3c; uint local_28; float local_24; void *local_1c; undefined1 *puStack_18; undefined4 local_14; local_14 = 0xffffffff; puStack_18 = &LAB_00b13255; local_1c = ExceptionList; ExceptionList = &local_1c; uVar7 = g_graphicsManager_flags & 0x10; if (uVar7 == 0) { local_24 = 0.0; } else { if (g_graphicsManager_renderTarget == (void *)0x0) { iVar8 = (**(code **)(DAT_00c798e0 + 0x30)) (__security_cookie ^ (int)register0x00000010 - 0x10U); } else { iVar8 = *(int *)((int)g_graphicsManager_renderTarget + 0x10); } if ((g_graphicsManager_renderTarget == (void *)0x0) || ((g_graphicsManager_flags & 0x20) != 0)) { local_24 = DAT_00c7997c; } else { local_24 = (float)((double)*(int *)((int)g_graphicsManager_renderTarget + 0x10) + __uint_to_double_fixup [-(*(int *)((int)g_graphicsManager_renderTarget + 0x10) >> 0x1f)]); } local_24 = (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) / local_24; if (g_graphicsManager_renderTarget == (void *)0x0) { iVar8 = (**(code **)(DAT_00c798e0 + 0x34))(); } else { iVar8 = *(int *)((int)g_graphicsManager_renderTarget + 0x14); } if ((g_graphicsManager_renderTarget == (void *)0x0) || ((g_graphicsManager_flags & 0x20) != 0)) { fVar18 = DAT_00c79980; } else { fVar18 = (float)((double)*(int *)((int)g_graphicsManager_renderTarget + 0x14) + __uint_to_double_fixup [-(*(int *)((int)g_graphicsManager_renderTarget + 0x14) >> 0x1f)]); } fVar18 = (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) / fVar18; if (fVar18 <= local_24) { local_24 = fVar18; } } uVar13 = g_graphicsManager_flags & 2; uVar9 = g_graphicsManager_flags & 4; local_74 = (SourceQuad *)0x0; local_68 = (float *)0x0; local_14 = 1; pfVar16 = (float *)0x0; if (count != 0) { if (0x71c71c7 < count) { /* WARNING: Subroutine does not return */ std::_Xlen(); } FUN_00a67f40(count); if (0x2492492 < count) { /* WARNING: Subroutine does not return */ std::_Xlen(); } std::vector::_Reallocate(count); this_00 = local_74; do { if (local_68 == (float *)0x0) { std::vector::_Emplace_reallocate(0,colorQuads); } else { render_quad_copy(local_68,colorQuads); local_68 = local_68 + 0x1c; } pfVar16 = local_68 + -0x1c; if (((uVar13 != 0) && (cVar6 = Quad::is_on_screen(), cVar6 == '\0')) || (local_68[-0xc] + local_68[-0x11] + local_68[-7] + local_68[-2] < 0.001)) { local_68 = pfVar16; } else { if (this_00 == (SourceQuad *)0x0) { std::vector::_Emplace_reallocate(0,sourceQuads); } else { SourceQuad::SourceQuad(this_00,sourceQuads); local_74 = this_00 + 1; } iVar8 = *(int *)((int)this + 8); if (iVar8 != 0) { if ((char)local_74[-1]._coordinateSpace != '\0') { iVar10 = *(int *)(iVar8 + 0x10); dVar2 = __uint_to_double_fixup[-(iVar10 >> 0x1f)]; iVar8 = *(int *)(iVar8 + 0x14); *(undefined1 *)&local_74[-1]._coordinateSpace = 0; fVar19 = (float)((double)iVar10 + dVar2); fVar18 = (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]); local_74[-1]._topLeft.x = local_74[-1]._topLeft.x / fVar19; local_74[-1]._topLeft.y = local_74[-1]._topLeft.y / fVar18; local_74[-1]._topRight.x = local_74[-1]._topRight.x / fVar19; local_74[-1]._topRight.y = local_74[-1]._topRight.y / fVar18; local_74[-1]._bottomLeft.x = local_74[-1]._bottomLeft.x / fVar19; local_74[-1]._bottomLeft.y = local_74[-1]._bottomLeft.y / fVar18; local_74[-1]._bottomRight.x = local_74[-1]._bottomRight.x / fVar19; local_74[-1]._bottomRight.y = local_74[-1]._bottomRight.y / fVar18; iVar8 = *(int *)((int)this + 8); } fVar18 = *(float *)(iVar8 + 0x24); fVar19 = local_74[-1]._topLeft.y; local_74[-1]._topLeft.x = *(float *)(iVar8 + 0x20) * local_74[-1]._topLeft.x; local_74[-1]._topLeft.y = fVar18 * fVar19; fVar18 = *(float *)(*(int *)((int)this + 8) + 0x24); fVar19 = local_74[-1]._topRight.y; local_74[-1]._topRight.x = *(float *)(*(int *)((int)this + 8) + 0x20) * local_74[-1]._topRight.x; local_74[-1]._topRight.y = fVar18 * fVar19; fVar18 = *(float *)(*(int *)((int)this + 8) + 0x24); fVar19 = local_74[-1]._bottomLeft.y; local_74[-1]._bottomLeft.x = *(float *)(*(int *)((int)this + 8) + 0x20) * local_74[-1]._bottomLeft.x; local_74[-1]._bottomLeft.y = fVar18 * fVar19; fVar18 = *(float *)(*(int *)((int)this + 8) + 0x24); fVar19 = local_74[-1]._bottomRight.y; local_74[-1]._bottomRight.x = *(float *)(*(int *)((int)this + 8) + 0x20) * local_74[-1]._bottomRight.x; local_74[-1]._bottomRight.y = fVar18 * fVar19; if ((uVar7 != 0) && ((*(int *)(*(int *)((int)this + 8) + 0x30) == 0 || (*(int *)(*(int *)((int)this + 8) + 0x34) == 0)))) { fVar18 = *pfVar16 * local_24; if (*pfVar16 == local_68[-0x18]) { fVar17 = (float10)roundf(fVar18); local_68[-0x18] = (float)(fVar17 / (float10)local_24); *pfVar16 = (float)(fVar17 / (float10)local_24); fVar17 = (float10)roundf(local_24 * local_68[-0x1b]); local_68[-0x19] = (float)(fVar17 / (float10)local_24); local_68[-0x1b] = (float)(fVar17 / (float10)local_24); fVar17 = (float10)roundf(local_24 * local_68[-0x16]); local_68[-0x16] = (float)(fVar17 / (float10)local_24); local_68[-0x1a] = (float)(fVar17 / (float10)local_24); fVar17 = (float10)roundf(local_24 * local_68[-0x15]); local_68[-0x15] = (float)(fVar17 / (float10)local_24); local_68[-0x17] = (float)(fVar17 / (float10)local_24); } else { roundf(fVar18); roundf(local_24 * local_68[-0x1b]); roundf(local_24 * local_68[-0x1a]); roundf(local_24 * local_68[-0x19]); roundf(local_24 * local_68[-0x18]); roundf(local_24 * local_68[-0x17]); roundf(local_24 * local_68[-0x16]); roundf(local_24 * local_68[-0x15]); } } } if (uVar9 != 0) { fVar18 = local_68[-0x11]; local_68[-0x14] = fVar18 * local_68[-0x14]; local_68[-0x13] = fVar18 * local_68[-0x13]; local_68[-0x12] = fVar18 * local_68[-0x12]; local_68[-0x11] = fVar18; local_68[-0x10] = 0.0; fVar18 = local_68[-0xc]; local_68[-0xf] = fVar18 * local_68[-0xf]; local_68[-0xe] = fVar18 * local_68[-0xe]; local_68[-0xd] = fVar18 * local_68[-0xd]; local_68[-0xc] = fVar18; local_68[-0xb] = 0.0; fVar18 = local_68[-7]; local_68[-10] = fVar18 * local_68[-10]; local_68[-9] = fVar18 * local_68[-9]; local_68[-8] = fVar18 * local_68[-8]; local_68[-7] = fVar18; local_68[-6] = 0.0; fVar18 = local_68[-2]; local_68[-5] = fVar18 * local_68[-5]; local_68[-4] = fVar18 * local_68[-4]; local_68[-3] = fVar18 * local_68[-3]; local_68[-2] = fVar18; local_68[-1] = 0.0; } this_00 = local_74; } sourceQuads = (void *)((int)sourceQuads + 0x24); colorQuads = (void *)((int)colorQuads + 0x70); count = count - 1; pfVar16 = local_68; } while (count != 0); } local_40 = (float *)0x0; local_44 = (float *)0x0; local_3c = (int)pfVar16 / 0x70; if (local_3c == 0) { pfVar16 = (float *)0x0; } else { iVar10 = FUN_00a24e10(); iVar8 = iVar10 * 3; pfVar16 = (float *)(**(code **)(*(int *)((int)this + 0x34) + 8))(local_3c * iVar10 * 4); if (((g_graphicsManager_renderTarget == (void *)0x0) && ((g_graphicsManager_flags & 0x40) == 0)) || ((g_graphicsManager_renderTarget != (void *)0x0 && (-1 < (char)g_graphicsManager_flags)))) { pVVar11 = &g_vectorZero; } else { pVVar11 = (Vector *)&DAT_00c79984; } fVar18 = pVVar11->x; fVar19 = pVVar11->y; if (local_3c != 0) { local_4c = pfVar16; do { local_28 = 0; iVar14 = *(int *)((int)this + 0x24); pfVar15 = local_4c; if (*(int *)(iVar14 + 0x10) != 0) { do { iVar14 = *(int *)(*(int *)(iVar14 + 0xc) + 4 + local_28 * 8); if (iVar14 == 5) { fVar3 = *local_40; pfVar15[1] = fVar19 + local_40[1]; *pfVar15 = fVar18 + fVar3; pfVar15[2] = DAT_00c798fc; fVar3 = local_40[2]; *(float *)((int)pfVar15 + iVar10 + 4) = fVar19 + local_40[3]; *(float *)((int)pfVar15 + iVar10) = fVar18 + fVar3; *(float *)((int)pfVar15 + iVar10 + 8) = DAT_00c798fc; fVar3 = local_40[4]; *(float *)((int)pfVar15 + iVar10 * 2 + 4) = fVar19 + local_40[5]; *(float *)((int)pfVar15 + iVar10 * 2) = fVar18 + fVar3; *(float *)((int)pfVar15 + iVar10 * 2 + 8) = DAT_00c798fc; fVar3 = local_40[7]; *(float *)((int)pfVar15 + iVar8) = fVar18 + local_40[6]; *(float *)((int)pfVar15 + iVar8 + 4) = fVar19 + fVar3; *(float *)((int)pfVar15 + iVar8 + 8) = DAT_00c798fc; } else if (iVar14 == 6) { fVar3 = local_40[9]; fVar4 = local_40[10]; fVar5 = local_40[0xb]; *pfVar15 = local_40[8]; pfVar15[1] = fVar3; pfVar15[2] = fVar4; pfVar15[3] = fVar5; fVar3 = local_40[0xe]; fVar4 = local_40[0xf]; fVar5 = local_40[0x10]; pfVar1 = (float *)((int)pfVar15 + iVar10); *pfVar1 = local_40[0xd]; pfVar1[1] = fVar3; pfVar1[2] = fVar4; pfVar1[3] = fVar5; fVar3 = local_40[0x13]; fVar4 = local_40[0x14]; fVar5 = local_40[0x15]; pfVar1 = (float *)((int)pfVar15 + iVar10 * 2); *pfVar1 = local_40[0x12]; pfVar1[1] = fVar3; pfVar1[2] = fVar4; pfVar1[3] = fVar5; fVar3 = local_40[0x18]; fVar4 = local_40[0x19]; fVar5 = local_40[0x1a]; pfVar1 = (float *)((int)pfVar15 + iVar10 * 3); *pfVar1 = local_40[0x17]; pfVar1[1] = fVar3; pfVar1[2] = fVar4; pfVar1[3] = fVar5; } else if (iVar14 == 7) { fVar3 = local_44[1]; *pfVar15 = *local_44; pfVar15[1] = fVar3; fVar3 = local_44[3]; *(float *)((int)pfVar15 + iVar10) = local_44[2]; *(float *)((int)pfVar15 + iVar10 + 4) = fVar3; fVar3 = local_44[5]; *(float *)((int)pfVar15 + iVar10 * 2) = local_44[4]; *(float *)((int)pfVar15 + iVar10 * 2 + 4) = fVar3; fVar3 = local_44[7]; *(float *)((int)pfVar15 + iVar8) = local_44[6]; *(float *)((int)pfVar15 + iVar8 + 4) = fVar3; } iVar14 = *(int *)((int)this + 0x24); switch(*(undefined4 *)(*(int *)(iVar14 + 0xc) + 4 + local_28 * 8)) { case 1: case 8: iVar12 = 4; break; case 2: case 7: iVar12 = 8; break; case 3: case 5: iVar12 = 0xc; break; case 4: case 6: iVar12 = 0x10; break; default: KAGE_LogMessage(0x10,(byte *)"Unknown attribute format specified\n"); iVar12 = 0; iVar14 = *(int *)((int)this + 0x24); } local_28 = local_28 + 1; pfVar15 = (float *)((int)pfVar15 + iVar12); } while (local_28 < *(uint *)(iVar14 + 0x10)); } local_40 = local_40 + 0x1c; local_44 = local_44 + 9; local_3c = local_3c + -1; DAT_00c798fc = DAT_00c798fc - 0.01; local_4c = local_4c + iVar10; } while (local_3c != 0); } } ExceptionList = local_1c; return pfVar16; } //@@ 00a67bd0 KAGE_Graphics::submit_batch /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? ECX=batch (vertex range +0x38/+0x3c, blend mode switch +0x10, shader +8 vtable +0x54): "Misaligned vertex data", "No shader set", "Unknwon blend function specified"; the DB note on KAGE_Graphics::flush_batches says each pending batch is submitted with FUN_00a67bd0 */ uint KAGE_Graphics::submit_batch(void) { short sVar1; undefined *puVar2; int *piVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined1 *puVar7; int iVar8; short *psVar9; int in_ECX; uint uVar10; int iVar11; short *psVar12; uint uVar13; int iVar14; int *local_24; code *local_20; uint local_1c; int local_18; uint local_14; uVar10 = *(int *)(*(int *)(in_ECX + 0x38) + 0xc + *(int *)(in_ECX + 0x3c) * 0x14) - *(int *)(*(int *)(in_ECX + 0x38) + 0x10 + *(int *)(in_ECX + 0x3c) * 0x14); if (uVar10 != 0) { local_18 = in_ECX; if (*(int **)(in_ECX + 8) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + 8) + 0x54))(0); } puVar2 = epoxy_glBlendEquation; switch(*(undefined4 *)(in_ECX + 0x10)) { case 0: uVar4 = 0x8006; break; case 1: uVar4 = 0x800a; break; case 2: uVar4 = 0x800b; break; case 3: uVar4 = 0x8007; break; case 4: uVar4 = 0x8008; break; default: KAGE_LogMessage(0x10,(byte *)"Unknwon blend function specified\n"); uVar4 = 0xffffffff; } (*(code *)puVar2)(uVar4); local_20 = (code *)epoxy_glBlendFuncSeparate; local_24 = (int *)FUN_00a18a20(); uVar4 = FUN_00a18a20(); uVar5 = FUN_00a18a20(); uVar6 = FUN_00a18a20(); (*local_20)(uVar6,uVar5,uVar4,local_24); in_ECX = local_18; g_currentShader = *(void **)(local_18 + 0x24); local_24 = g_currentShader; (**(code **)(*(int *)g_currentShader + 0xc))(local_18 + 0x28); puVar7 = (undefined1 *)FUN_00a14250(&local_24); piVar3 = DAT_00c7367c; *puVar7 = 1; (**(code **)(*piVar3 + 4))(); (**(code **)(*(int *)(in_ECX + 0x34) + 4))(); local_24 = *(int **)(*(int *)(in_ECX + 0x38) + 0x10 + *(int *)(in_ECX + 0x3c) * 0x14); local_20 = (code *)FUN_00a24e10(); local_1c = uVar10 / (uint)local_20; if (uVar10 % (uint)local_20 != 0) { KAGE_LogMessage(0x10,(byte *)"Misaligned vertex data"); } iVar11 = DAT_00c7367c[2]; iVar14 = DAT_00c7367c[1]; local_14 = *(uint *)(iVar14 + 8 + iVar11 * 0x14) >> 1; iVar8 = ((int)(local_1c + ((int)local_1c >> 0x1f & 3U)) >> 2) * 6 - local_14; if (0 < iVar8) { uVar13 = (uint)((ulonglong)local_14 * 0xaaaaaaab >> 0x20) & 0xfffffffc; (**(code **)(*DAT_00c7367c + 8))((iVar8 + local_14) * 2); iVar11 = DAT_00c7367c[2]; iVar14 = DAT_00c7367c[1]; iVar8 = *(int *)(iVar14 + 4 + iVar11 * 0x14); psVar12 = (short *)(*(int *)(iVar14 + 8 + iVar11 * 0x14) + iVar8); psVar9 = (short *)(iVar8 + local_14 * 2); if (psVar9 < psVar12) { do { sVar1 = (short)uVar13; uVar13 = uVar13 + 4; *psVar9 = sVar1; psVar9[2] = sVar1 + 1; psVar9[3] = sVar1 + 1; psVar9[1] = sVar1 + 2; psVar9[4] = sVar1 + 2; psVar9[5] = sVar1 + 3; psVar9 = psVar9 + 6; } while (psVar9 < psVar12); iVar11 = DAT_00c7367c[2]; iVar14 = DAT_00c7367c[1]; } in_ECX = local_18; } uVar4 = *(undefined4 *)(iVar14 + 4 + iVar11 * 0x14); if (g_currentShader == (void *)0x0) { KAGE_LogMessage(0x10,(byte *)"No shader set\n"); } uVar13 = local_1c; (**(code **)(*(int *)g_currentShader + 0x20))(local_24,local_1c,local_20); (*(code *)epoxy_glDrawElements)(4,(uVar13 >> 2) * 6,0x1403,uVar4); (**(code **)(*(int *)g_currentShader + 0x24))(local_24,uVar13,local_20); iVar11 = *(int *)(in_ECX + 0x38) + *(int *)(in_ECX + 0x3c) * 0x14; *(undefined4 *)(iVar11 + 0x10) = *(undefined4 *)(iVar11 + 0xc); (**(code **)(*DAT_00c7367c + 0xc))(); DAT_00c79928 = 0; DAT_00c7992c = 0; uRam00c79930 = 0; uRam00c79934 = 0; _DAT_00c79938 = 0; uRam00c7993c = 0; uRam00c79940 = 0; uRam00c79944 = 0; } *(byte *)(in_ECX + 4) = *(byte *)(in_ECX + 4) & 0xfc; return uVar10; } //@@ 00a67eb0 std::vector::_Reallocate /* DB: 0x70-byte elements (max 0x2492492): allocates, render_quad_copy each element, moves; caller render_quad_draw */ void std::vector::_Reallocate(uint param_1) { int iVar1; int iVar2; void *pvVar3; void *pvVar4; int *in_ECX; void *src; void *this; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x2492492 < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pvVar4 = _Allocate(param_1 * 0x70); pvVar3 = (void *)in_ECX[1]; this = pvVar4; for (src = (void *)*in_ECX; src != pvVar3; src = (void *)((int)src + 0x70)) { render_quad_copy(this,src); this = (void *)((int)this + 0x70); } _Change_array(pvVar4,(iVar1 - iVar2) / 0x70,param_1); return; } //@@ 00a67f40 FUN_00a67f40 void FUN_00a67f40(uint param_1) { int iVar1; int iVar2; FileSymbolInfo *pFVar3; int *in_ECX; undefined4 extraout_ECX; iVar1 = in_ECX[1]; iVar2 = *in_ECX; if (0x71c71c7 < param_1) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } pFVar3 = std::_Allocate(param_1 * 0x24); std::_Uninitialized_move(pFVar3,extraout_ECX); FID_conflict__Change_array(in_ECX,pFVar3,(iVar1 - iVar2) / 0x24,param_1); return; } //@@ 00a67fe0 KAGE::Graphics::GraphicsBufferObject::GraphicsBufferObject /* DB: ctor: zeroes +4..+0xc, sets GraphicsBufferObject vftable, FUN_00a68360, allocates a counted array of 0x14-byte elements via _eh_vector_constructor_iterator_ prototype: db/protos.zhl */ void * __thiscall KAGE::Graphics::GraphicsBufferObject::GraphicsBufferObject(void *this) { uint uVar1; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1329c; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)((int)this + 4) = 0; *(undefined4 *)((int)this + 8) = 0; *(undefined4 *)((int)this + 0xc) = 0; local_8 = 0; *(undefined ***)this = vftable; FUN_00a68360(uVar1); puVar2 = operator_new_tracked(0x18); local_8 = CONCAT31(local_8._1_3_,1); if (puVar2 == (undefined4 *)0x0) { *(undefined4 *)((int)this + 4) = 0; ExceptionList = local_10; return this; } *puVar2 = 1; _eh_vector_constructor_iterator_ (puVar2 + 1,0x14,1,(_func_void_void_ptr *)&LAB_00a67fa0, (_func_void_void_ptr *)&LAB_00a67fd0); *(undefined4 **)((int)this + 4) = puVar2 + 1; ExceptionList = local_10; return this; } //@@ 00a680a0 FUN_00a680a0 void FUN_00a680a0(byte param_1) { void *in_ECX; FUN_00a680d0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 00a680d0 FUN_00a680d0 void FUN_00a680d0(void) { uint uVar1; undefined4 *in_ECX; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = (undefined4 *)in_ECX[1]; *in_ECX = KAGE::Graphics::GraphicsBufferObject::vftable; if (puVar2 == (undefined4 *)0x0) goto LAB_00a68142; if ((void *)puVar2[1] == (void *)0x0) { LAB_00a68118: if (puVar2[-1] == 0) { operator_delete(puVar2 + -1,4); } else { (**(code **)*puVar2)(3,uVar1); } in_ECX[1] = 0; } else { KAGE_Memory::heap_free(1,(void *)puVar2[1]); puVar2 = (undefined4 *)in_ECX[1]; if (puVar2 != (undefined4 *)0x0) goto LAB_00a68118; } in_ECX[2] = 0; LAB_00a68142: *in_ECX = KAGE::Graphics::GraphicsBufferObjectBase::vftable; ExceptionList = local_10; return; } //@@ 00a68160 FUN_00a68160 int * FUN_00a68160(uint param_1) { int *ptr; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b10960; local_10 = ExceptionList; ExceptionList = &local_10; if ((param_1 & 2) == 0) { *in_ECX = (int)KAGE::Graphics::GraphicsBufferObjectBase::InternalBufferObjectBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } ExceptionList = local_10; return in_ECX; } ptr = in_ECX + -1; _eh_vector_destructor_iterator_(in_ECX,0x14,in_ECX[-1],(_func_void_void_ptr *)&LAB_00a67fd0); if ((param_1 & 1) != 0) { operator_delete(ptr,*ptr * 0x14 + 4); } ExceptionList = local_10; return ptr; } //@@ 00a68210 FUN_00a68210 void FUN_00a68210(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::GraphicsBufferObjectBase::InternalBufferObjectBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } return; } //@@ 00a68240 FUN_00a68240 void FUN_00a68240(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::GraphicsBufferObjectBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 00a68270 FUN_00a68270 void FUN_00a68270(void) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::GraphicsBufferObjectBase::vftable; return; } //@@ 00a68280 FUN_00a68280 int FUN_00a68280(int param_1) { int iVar1; int iVar2; void *_Dst; int in_ECX; int iVar3; int iVar4; int local_10 [3]; iVar3 = *(int *)(*(int *)(in_ECX + 4) + 8 + *(int *)(in_ECX + 8) * 0x14); iVar1 = *(int *)(in_ECX + 4) + *(int *)(in_ECX + 8) * 0x14; iVar4 = *(int *)(iVar1 + 0xc); iVar2 = ((iVar4 - iVar3) - *(int *)(iVar1 + 4)) + param_1; if (0 < iVar2) { local_10[1] = 0; iVar3 = iVar2 * 0x30 + iVar3; local_10[0] = iVar3; _Dst = KAGE_Memory::heap_alloc(1,(ulonglong *)local_10); if (*(size_t *)(iVar1 + 8) != 0) { memcpy(_Dst,*(void **)(iVar1 + 4),*(size_t *)(iVar1 + 8)); KAGE_Memory::heap_free(1,*(void **)(iVar1 + 4)); } iVar4 = *(int *)(iVar1 + 4); *(void **)(iVar1 + 4) = _Dst; *(int *)(iVar1 + 0x10) = (int)_Dst + (*(int *)(iVar1 + 0x10) - iVar4); iVar4 = (int)_Dst + (*(int *)(iVar1 + 0xc) - iVar4); *(int *)(iVar1 + 8) = iVar3; } *(int *)(iVar1 + 0xc) = param_1 + iVar4; return iVar4; } //@@ 00a68320 FUN_00a68320 void FUN_00a68320(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 4) + *(int *)(in_ECX + 8) * 0x14; *(undefined4 *)(iVar1 + 0xc) = *(undefined4 *)(iVar1 + 4); iVar1 = *(int *)(in_ECX + 4) + *(int *)(in_ECX + 8) * 0x14; *(undefined4 *)(iVar1 + 0x10) = *(undefined4 *)(iVar1 + 4); return; } //@@ 00a68350 FUN_00a68350 void FUN_00a68350(void) { int *in_ECX; in_ECX[2] = 0; /* WARNING: Could not recover jumptable at 0x00a68359. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(*in_ECX + 0xc))(); return; } //@@ 00a68360 FUN_00a68360 void FUN_00a68360(void) { int iVar1; undefined4 *puVar2; uint uVar3; int in_ECX; undefined1 local_20 [8]; void *local_18; uint local_14 [3]; uint local_8; if (*(int *)(in_ECX + 4) != 0) { iVar1 = *(int *)(*(int *)(in_ECX + 4) + 4); if (iVar1 != 0) { local_8 = 0; local_14[1] = 0; local_14[2] = local_14[2] & 0xffffff00; (**(code **)(PTR_vftable_00c37964 + 0x10))(1,&local_8,local_14 + 1,local_14 + 2); uVar3 = local_8; local_14[0] = local_8; _Find_lower_bound<>(local_20,local_14); if (((*(char *)((int)local_18 + 0xd) == '\0') && (*(uint *)((int)local_18 + 0x10) <= uVar3)) && (local_18 != g_memoryManager_heaps)) { (**(code **)(**(int **)((int)local_18 + 0x14) + 8))(iVar1,local_14[2]); } else { KAGE_LogMessage(0x10,(byte *)"Invalid heap identifier specified"); } } puVar2 = *(undefined4 **)(in_ECX + 4); if (puVar2 != (undefined4 *)0x0) { if (puVar2[-1] != 0) { (**(code **)*puVar2)(3); *(undefined4 *)(in_ECX + 4) = 0; *(undefined4 *)(in_ECX + 8) = 0; return; } operator_delete(puVar2 + -1,4); *(undefined4 *)(in_ECX + 4) = 0; } *(undefined4 *)(in_ECX + 8) = 0; } return; } //@@ 00a68440 FUN_00a68440 void FUN_00a68440(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::MutexBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,8); } return; } //@@ 00a68470 FUN_00a68470 undefined4 FUN_00a68470(void) { int in_ECX; *(byte *)(in_ECX + 4) = *(byte *)(in_ECX + 4) | 1; return 1; } //@@ 00a68480 FUN_00a68480 void FUN_00a68480(void) { int in_ECX; *(byte *)(in_ECX + 4) = *(byte *)(in_ECX + 4) & 0xfe; return; } //@@ 00a68490 GetTimeNs /* DB: src/anm2 decompile labels (GetTimeNs) prototype: db/protos.zhl */ ulonglong __cdecl GetTimeNs(void) { ulonglong uVar1; LARGE_INTEGER local_18; LARGE_INTEGER local_10; QueryPerformanceCounter(&local_18); QueryPerformanceFrequency(&local_10); FUN_00aefe80(); FUN_00aefe80(); uVar1 = __dtoul3(); return uVar1; } //@@ 00a684f0 FUN_00a684f0 void FUN_00a684f0(byte param_1) { undefined4 *this; undefined4 *in_ECX; *in_ECX = KAGE::Filesys::FileMap::vftable; FUN_00a68640(); this = in_ECX + 1; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[1] + 4)); operator_delete((void *)*this,0x18); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a68540 FUN_00a68540 void FUN_00a68540(void) { undefined4 *in_ECX; undefined4 *this; *in_ECX = KAGE::Filesys::FileMap::vftable; FUN_00a68640(); this = in_ECX + 1; FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, *(_Tree_node **)(in_ECX[1] + 4)); operator_delete((void *)*this,0x18); return; } //@@ 00a68570 FUN_00a68570 void FUN_00a68570(undefined4 param_1) { int *in_ECX; (**(code **)(*in_ECX + 0x18))(&s_empty,param_1); return; } //@@ 00a68590 FUN_00a68590 void FUN_00a68590(int param_1,uint param_2) { char cVar1; char *_Source; char *pcVar2; int *piVar3; int *in_ECX; uint uVar4; byte *filePath; uint uStack_18; int *piStack_14; undefined1 auStack_10 [12]; (**(code **)(*in_ECX + 0x10))(); uVar4 = 0; if (param_2 != 0) { piStack_14 = in_ECX + 1; do { _Source = *(char **)(param_1 + uVar4 * 4); if (_Source == (char *)0x0) { filePath = (byte *)0x0; } else { pcVar2 = _Source; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); filePath = operator_new_tracked((uint)(pcVar2 + (1 - (int)(_Source + 1)))); pcVar2 = _Source; do { cVar1 = *pcVar2; pcVar2 = pcVar2 + 1; } while (cVar1 != '\0'); strncpy((char *)filePath,_Source,(size_t)(pcVar2 + (1 - (int)(_Source + 1)))); } uStack_18 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(filePath); piVar3 = (int *)std::map::try_emplace(auStack_10,&uStack_18); uVar4 = uVar4 + 1; *(byte **)(*piVar3 + 0x14) = filePath; } while (uVar4 < param_2); } return; } //@@ 00a68630 FUN_00a68630 bool FUN_00a68630(void) { int in_ECX; return *(int *)(in_ECX + 8) != 0; } //@@ 00a68640 FUN_00a68640 void FUN_00a68640(void) { undefined4 *this; char cVar1; int iVar2; uint uVar3; qword qVar4; int *piVar5; int in_ECX; qword *pqVar6; int *piVar7; int *piVar8; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; piVar8 = *(int **)(in_ECX + 4); this = (undefined4 *)(in_ECX + 4); piVar7 = (int *)*piVar8; if (piVar7 != piVar8) { do { iVar2 = piVar7[5]; if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar3; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); piVar7[5] = 0; } piVar8 = (int *)piVar7[2]; if (*(char *)((int)piVar8 + 0xd) == '\0') { cVar1 = *(char *)(*piVar8 + 0xd); piVar7 = piVar8; piVar8 = (int *)*piVar8; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar8 + 0xd); piVar7 = piVar8; piVar8 = (int *)*piVar8; } } else { cVar1 = *(char *)(piVar7[1] + 0xd); piVar5 = (int *)piVar7[1]; piVar8 = piVar7; while ((piVar7 = piVar5, cVar1 == '\0' && (piVar8 == (int *)piVar7[2]))) { cVar1 = *(char *)(piVar7[1] + 0xd); piVar5 = (int *)piVar7[1]; piVar8 = piVar7; } } piVar8 = (int *)*this; } while (piVar7 != piVar8); } FID_conflict__Erase_tree_>_> (this,(fuzzer_allocator_> *)this, (_Tree_node *)piVar8[1]); piVar8[1] = (int)piVar8; *piVar8 = (int)piVar8; piVar8[2] = (int)piVar8; *(undefined4 *)(in_ECX + 8) = 0; ExceptionList = local_10; return; } //@@ 00a68730 FUN_00a68730 uint FUN_00a68730(byte *param_1) { uint uVar1; int in_ECX; undefined1 local_10 [8]; int local_8; uVar1 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(param_1); param_1 = (byte *)uVar1; _Find_lower_bound<>(local_10,¶m_1); if ((*(char *)(local_8 + 0xd) == '\0') && (*(uint *)(local_8 + 0x10) <= uVar1)) { return CONCAT31((int3)((uint)*(int *)(in_ECX + 4) >> 8),local_8 != *(int *)(in_ECX + 4)); } return *(uint *)(in_ECX + 4) & 0xffffff00; } //@@ 00a68790 FUN_00a68790 undefined4 FUN_00a68790(byte *param_1) { uint uVar1; undefined4 *puVar2; int in_ECX; undefined1 local_10 [8]; int local_8; uVar1 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(param_1); param_1 = (byte *)uVar1; _Find_lower_bound<>(local_10,¶m_1); if (((*(char *)(local_8 + 0xd) == '\0') && (*(uint *)(local_8 + 0x10) <= uVar1)) && (local_8 != *(int *)(in_ECX + 4))) { puVar2 = map_find_value((void *)(in_ECX + 4),(uint)¶m_1); return *puVar2; } return 0; } //@@ 00a687f0 KAGE::Filesys::FileMap::scan_directory /* WARNING: Removing unreachable block (ram,0x00a6897a) */ /* WARNING: Removing unreachable block (ram,0x00a68993) */ /* WARNING: Removing unreachable block (ram,0x00a689a7) */ /* DB: ? vtable slot 6 of KAGE::Filesys::FileMap (00ba04cc) and of ContentManagerBase::ContentMountPoint (00b81cf8): win32_opendir(path_join(...)), files (flag 1) hashed with GetPrimaryFilePathHash into the map (map_find_value), subdirectories (flag 2) queued and walked */ void KAGE::Filesys::FileMap::scan_directory(byte *param_1,byte *param_2) { int iVar1; uint uVar2; qword qVar3; byte *pbVar4; uint uVar5; byte *pbVar6; byte *pbVar7; undefined4 *puVar8; qword *pqVar9; uint uVar10; undefined4 *puVar11; undefined4 *local_38; byte *local_30; byte *local_2c; int local_28; uint local_24; int *local_20; byte *local_1c; undefined4 *local_18; byte *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b132d5; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pbVar6 = path_join(param_2,param_1,0,0); local_30 = (byte *)0x0; local_2c = (byte *)0x0; local_28 = 0; local_8 = 0; win32_opendir(pbVar6,(int)&local_30); puVar11 = (undefined4 *)0x0; local_38 = (undefined4 *)0x0; local_18 = (undefined4 *)0x0; local_8 = CONCAT31(local_8._1_3_,1); local_14 = (byte *)((int)local_2c - (int)local_30 >> 3); local_1c = (byte *)0x0; if (local_14 != (byte *)0x0) { pbVar6 = local_30 + 4; do { pbVar7 = local_1c; if ((pbVar6[-4] & 1) == 0) { if ((pbVar6[-4] & 2) != 0) { local_1c = path_join(*(byte **)pbVar6,param_2,0,0); if (puVar11 == local_18) { std::vector::_Emplace_reallocate(puVar11,&local_1c); local_18 = (undefined4 *)0x0; puVar11 = local_38; } else { *puVar11 = local_1c; local_38 = puVar11 + 1; puVar11 = local_38; } } } else { pbVar7 = path_join(*(byte **)pbVar6,param_2,0,0); local_24 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(pbVar7); puVar8 = map_find_value(local_20 + 1,(uint)&local_24); *puVar8 = pbVar7; pbVar7 = local_1c; } local_1c = pbVar7 + 1; pbVar6 = pbVar6 + 8; } while (local_1c < local_14); } uVar10 = 0; if ((int)puVar11 >> 2 != 0) { do { (**(code **)(*local_20 + 0x18))(param_1,*(undefined4 *)(uVar10 * 4),uVar5); iVar1 = *(int *)(uVar10 * 4); if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar2; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); local_8 = CONCAT31(local_8._1_3_,1); *(undefined4 *)(uVar10 * 4) = 0; } uVar10 = uVar10 + 1; } while (uVar10 < (uint)((int)puVar11 >> 2)); } pbVar4 = local_2c; pbVar7 = local_30; pbVar6 = local_30; if (local_30 != (byte *)0x0) { for (; pbVar6 != pbVar4; pbVar6 = pbVar6 + 8) { if (((*pbVar6 & 4) == 0) && (iVar1 = *(int *)(pbVar6 + 4), iVar1 != 0)) { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar1 + -4); qVar3 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 - uVar5; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) - (uint)((uint)qVar3 < uVar5); free((void *)(iVar1 + -4)); pbVar6[4] = 0; pbVar6[5] = 0; pbVar6[6] = 0; pbVar6[7] = 0; } } uVar5 = local_28 - (int)pbVar7 & 0xfffffff8; pbVar6 = pbVar7; if (0xfff < uVar5) { pbVar6 = *(byte **)(pbVar7 + -4); uVar5 = uVar5 + 0x23; if ((byte *)0x1f < pbVar7 + (-4 - (int)pbVar6)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pbVar6,uVar5); } ExceptionList = local_10; return; } //@@ 00a68a50 FUN_00a68a50 void FUN_00a68a50(int *param_1) { int iVar1; uint uVar2; void *pvVar3; void *pvVar4; undefined4 *puVar5; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1331c; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; in_ECX[3] = param_1; *in_ECX = KAGE::Filesys::ArchivedFile::vftable; in_ECX[4] = 0; in_ECX[5] = 0; iVar1 = *param_1; in_ECX[1] = &DAT_00c37a14 + iVar1 * 2; if ((&DAT_00c37a18)[iVar1 * 8] == '\x01') { pvVar3 = operator_new(0xc); local_8._0_1_ = 1; if (pvVar3 == (void *)0x0) { local_8 = (uint)local_8._1_3_ << 8; in_ECX[4] = 0; } else { pvVar4 = operator_new_tracked(0x10000); *(void **)((int)pvVar3 + 8) = pvVar4; local_8 = (uint)local_8._1_3_ << 8; in_ECX[4] = pvVar3; } } else if ((&DAT_00c37a18)[iVar1 * 8] == '\x02') { puVar5 = operator_new(0x14); if (puVar5 == (undefined4 *)0x0) { puVar5 = (undefined4 *)0x0; } else { *puVar5 = 0; puVar5[1] = 0; puVar5[3] = 0; } in_ECX[5] = puVar5; } pvVar3 = FileSystem::Open(&PTR_vftable_00c37a10,*(byte **)in_ECX[1],(int *)0x0); in_ECX[2] = pvVar3; FUN_00a68c50(uVar2); ExceptionList = local_10; return; } //@@ 00a68b50 FUN_00a68b50 void FUN_00a68b50(byte param_1) { void *in_ECX; KAGE::Filesys::ArchivedFile::~ArchivedFile(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc2c); } return; } //@@ 00a68b80 KAGE::Filesys::ArchivedFile::~ArchivedFile /* DB: sets ArchivedFile vftable, deletes the inner stream (+8 vfunc 0), frees +0x10 buffer, frees decompressor buffers (+0x14: 0x4df40, 0x2af0, 0x810, 0x14), then StreamBase vftable prototype: db/protos.zhl */ void __thiscall KAGE::Filesys::ArchivedFile::~ArchivedFile(void *this) { void *ptr; undefined4 *ptr_00; uint uVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)this = vftable; if (*(undefined4 **)((int)this + 8) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)((int)this + 8))(1,uVar1); } ptr = *(void **)((int)this + 0x10); if (ptr != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)((int)ptr + 8),0); operator_delete(ptr,0xc); } ptr_00 = *(undefined4 **)((int)this + 0x14); if (ptr_00 != (undefined4 *)0x0) { operator_delete((void *)ptr_00[1],0x4df40); operator_delete((void *)ptr_00[3],0x2af0); operator_delete((void *)*ptr_00,0x810); operator_delete(ptr_00,0x14); } *(undefined ***)this = StreamBase::vftable; ExceptionList = local_10; return; } //@@ 00a68c40 FUN_00a68c40 undefined4 FUN_00a68c40(void) { int in_ECX; return *(undefined4 *)(*(int *)(in_ECX + 0xc) + 0x10); } //@@ 00a68c50 FUN_00a68c50 void FUN_00a68c50(void) { char cVar1; int in_ECX; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0xc20) = 0; *(undefined4 *)(in_ECX + 0xc1c) = 0; *(undefined1 *)(in_ECX + 0xc28) = 0; cVar1 = *(char *)(*(int *)(in_ECX + 4) + 4); if (cVar1 == '\x01') { FUN_00a850f0(); (**(code **)(**(int **)(in_ECX + 8) + 0xc))(*(undefined4 *)(*(int *)(in_ECX + 0xc) + 0xc),0); return; } if (cVar1 == '\x02') { FUN_00a89c90(*(undefined4 *)(*(int *)(in_ECX + 0xc) + 8)); (**(code **)(**(int **)(in_ECX + 8) + 0xc))(*(undefined4 *)(*(int *)(in_ECX + 0xc) + 0xc),0); return; } *(uint *)(in_ECX + 0xc24) = *(uint *)(*(int *)(in_ECX + 0xc) + 8) ^ 0xf9524287 | 1; (**(code **)(**(int **)(in_ECX + 8) + 0xc))(*(undefined4 *)(*(int *)(in_ECX + 0xc) + 0xc),0); return; } //@@ 00a68cf0 KAGE::Filesys::ArchivedFile::refill_buffer /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strings 'ArchivedFile::refill_buffer LZW compressed buffer overflow.' / '... MiniZ compressed buffer overflow.'; caller is KAGE::Filesys::ArchivedFile vtable slot 5 (FUN_00a69510) */ void KAGE::Filesys::ArchivedFile::refill_buffer(void) { byte *pbVar1; char cVar2; int *piVar3; undefined4 uVar4; int iVar5; undefined1 *puVar6; uint in_ECX; byte *pbVar7; undefined1 uVar8; uint uVar9; int iVar10; uint uVar11; uint uVar12; int iVar13; int iVar14; uint local_8c; byte local_88 [128]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_88 + 0x84); uVar12 = *(uint *)(*(int *)(in_ECX + 0xc) + 0x10); if (uVar12 <= *(uint *)(in_ECX + 0x18)) { *(undefined1 *)(in_ECX + 0xc28) = 1; return; } piVar3 = *(int **)(in_ECX + 8); cVar2 = *(char *)(*(int *)(in_ECX + 4) + 4); local_8c = in_ECX; if (cVar2 == '\x01') { (**(code **)(*piVar3 + 0x14))(&local_8c,4,1); if (0x7ff < local_8c) { KAGE_LogMessage(0x10,(byte *)"ArchivedFile::refill_buffer LZW compressed buffer overflow.\n"); } (**(code **)(**(int **)(in_ECX + 8) + 0x14))(in_ECX + 0x1c,1,local_8c); uVar4 = lzw_decompress(in_ECX + 0x81c,in_ECX + 0x1c,local_8c); *(undefined4 *)(in_ECX + 0xc20) = uVar4; } else if (cVar2 == '\x02') { (**(code **)(*piVar3 + 0x14))(&local_8c,4,1); uVar9 = local_8c & 0x7fffffff; uVar12 = local_8c >> 0x1f; local_8c = uVar9; if (0x7ff < uVar9) { KAGE_LogMessage(0x10,(byte *)"ArchivedFile::refill_buffer MiniZ compressed buffer overflow.\n" ); } (**(code **)(**(int **)(in_ECX + 8) + 0x14))(in_ECX + 0x1c,1,local_8c); uVar4 = FUN_00a89f80(in_ECX + 0x81c,0x400,in_ECX + 0x1c,local_8c,uVar12); *(undefined4 *)(in_ECX + 0xc20) = uVar4; } else if (cVar2 == '\x05') { uVar4 = (**(code **)(*piVar3 + 0x14))(in_ECX + 0x81c,1,0x400); *(undefined4 *)(in_ECX + 0xc20) = uVar4; local_88[0] = 0xb0; local_88[1] = 0x22; local_88[2] = 0x5d; local_88[3] = 0x47; local_88[4] = 0xd3; local_88[5] = 0x1b; local_88[6] = 0x59; local_88[7] = 0xd1; local_88[8] = 0x97; local_88[9] = 0x37; local_88[10] = 0xfb; local_88[0xb] = 0xd2; iVar14 = -0x81c - in_ECX; local_88[0xc] = 0xc0; local_88[0xd] = 0x31; local_88[0xe] = 0x86; local_88[0xf] = 0xfd; iVar13 = -0x81b - in_ECX; local_88[0x10] = 0xb5; local_88[0x11] = 0xdd; local_88[0x12] = 0xac; local_88[0x13] = 0x4b; iVar5 = -0x81a - in_ECX; local_88[0x14] = 0xb4; local_88[0x15] = 1; local_88[0x16] = 0x15; local_88[0x17] = 0x52; local_88[0x18] = 1; local_88[0x19] = 10; local_88[0x1a] = 0x75; local_88[0x1b] = 8; iVar10 = -0x81d - in_ECX; local_88[0x1c] = 0x5d; local_88[0x1d] = 0x50; local_88[0x1e] = 0xfe; local_88[0x1f] = 0x8c; local_88[0x20] = 0xa8; local_88[0x21] = 0xaf; local_88[0x22] = 0xd5; local_88[0x23] = 0xcb; local_88[0x24] = 9; local_88[0x25] = 0xee; local_88[0x26] = 0xdc; local_88[0x27] = 0xca; local_88[0x28] = 0x76; local_88[0x29] = 0xc4; local_88[0x2a] = 0x3f; local_88[0x2b] = 0x67; local_88[0x2c] = 0xed; local_88[0x2d] = 9; local_88[0x2e] = 0x8f; local_88[0x2f] = 100; local_88[0x30] = 0x43; local_88[0x31] = 0x56; local_88[0x32] = 0x30; local_88[0x33] = 0x1a; local_88[0x34] = 0x89; local_88[0x35] = 0x2e; local_88[0x36] = 0xdf; local_88[0x37] = 0xf9; local_88[0x38] = 0xe4; local_88[0x39] = 0xb8; local_88[0x3a] = 0x13; local_88[0x3b] = 0x1a; local_88[0x3c] = 0xbe; local_88[0x3d] = 0xaf; local_88[0x3e] = 0xa4; local_88[0x3f] = 2; local_88[0x40] = 0xff; local_88[0x41] = 0x60; local_88[0x42] = 0x22; local_88[0x43] = 0xe0; local_88[0x44] = 0xb; local_88[0x45] = 0xff; local_88[0x46] = 0xae; local_88[0x47] = 0xc9; local_88[0x48] = 0x7d; local_88[0x49] = 0xa0; local_88[0x4a] = 0x27; local_88[0x4b] = 0xf9; local_88[0x4c] = 0x11; local_88[0x4d] = 99; local_88[0x4e] = 0x2f; local_88[0x4f] = 0xe1; local_88[0x50] = 0x20; local_88[0x51] = 0x7e; local_88[0x52] = 0x51; local_88[0x53] = 0xd7; local_88[0x54] = 0xe; local_88[0x55] = 0xcd; local_88[0x56] = 0xc4; local_88[0x57] = 0xd4; local_88[0x58] = 0xcf; local_88[0x59] = 0xcf; local_88[0x5a] = 0xa1; local_88[0x5b] = 0x88; local_88[0x5c] = 0x99; local_88[0x5d] = 0x42; local_88[0x5e] = 0x96; local_88[0x5f] = 0xcf; local_88[0x60] = 0xf0; local_88[0x61] = 0xc1; local_88[0x62] = 0x54; local_88[99] = 0xc3; local_88[100] = 0x36; local_88[0x65] = 0x94; local_88[0x66] = 0xc2; local_88[0x67] = 0x92; local_88[0x68] = 0xdc; local_88[0x69] = 0xb8; local_88[0x6a] = 99; local_88[0x6b] = 0xca; local_88[0x6c] = 0xca; local_88[0x6d] = 0x32; local_88[0x6e] = 0x12; local_88[0x6f] = 0x7a; local_88[0x70] = 0x3c; local_88[0x71] = 0x88; local_88[0x72] = 0x5f; local_88[0x73] = 0xd2; local_88[0x74] = 0x4b; local_88[0x75] = 0xc3; local_88[0x76] = 0xe4; local_88[0x77] = 0x69; local_88[0x78] = 0x74; local_88[0x79] = 0x32; local_88[0x7a] = 0xbd; local_88[0x7b] = 0x2c; local_88[0x7c] = 0x42; local_88[0x7d] = 0x28; local_88[0x7e] = 0xb2; local_88[0x7f] = 0x34; pbVar7 = (byte *)(in_ECX + 0x81d); do { pbVar7[-1] = pbVar7[-1] ^ local_88[(uint)(pbVar7 + iVar10) & 0x7f]; *pbVar7 = *pbVar7 ^ local_88[(uint)(pbVar7 + iVar14) & 0x7f]; pbVar7[1] = pbVar7[1] ^ local_88[(uint)(pbVar7 + iVar13) & 0x7f]; pbVar1 = pbVar7 + 4; pbVar7[2] = pbVar7[2] ^ local_88[(uint)(pbVar7 + iVar5) & 0x7f]; pbVar7 = pbVar1; in_ECX = local_8c; } while ((int)(pbVar1 + iVar10) < 0x400); } else { uVar9 = (uVar12 - *(uint *)(in_ECX + 0x18)) + 3 & 0xfffffffc; uVar12 = 0x400; if (uVar9 < 0x400) { uVar12 = uVar9; } uVar4 = (**(code **)(*piVar3 + 0x14))(in_ECX + 0x81c,1,uVar12); uVar12 = *(uint *)(in_ECX + 0xc24); *(undefined4 *)(in_ECX + 0xc20) = uVar4; puVar6 = (undefined1 *)(in_ECX + 0x81d); iVar5 = 0x100; do { uVar11 = *(uint *)(puVar6 + -1) ^ uVar12; uVar9 = uVar12 & 0xf; *(uint *)(puVar6 + -1) = uVar11; uVar8 = (undefined1)uVar11; if (uVar9 == 2) { puVar6[2] = uVar8; puVar6[-1] = (char)(uVar11 >> 0x18); uVar8 = puVar6[1]; puVar6[1] = *puVar6; LAB_00a6904c: *puVar6 = uVar8; } else if (uVar9 == 9) { *puVar6 = uVar8; uVar8 = puVar6[1]; puVar6[-1] = (char)(uVar11 >> 8); puVar6[1] = puVar6[2]; puVar6[2] = uVar8; } else if (uVar9 == 0xd) { puVar6[1] = uVar8; puVar6[-1] = (char)(uVar11 >> 0x10); uVar8 = puVar6[2]; puVar6[2] = *puVar6; goto LAB_00a6904c; } puVar6 = puVar6 + 4; uVar12 = uVar12 << 8 ^ uVar12; uVar12 = uVar12 ^ uVar12 >> 9; uVar12 = uVar12 << 0x17 ^ uVar12; iVar5 = iVar5 + -1; } while (iVar5 != 0); *(uint *)(in_ECX + 0xc24) = uVar12; } *(undefined4 *)(in_ECX + 0xc1c) = 0; return; } //@@ 00a69090 KAGE::Filesys::ArchivedFile::refill_buffer /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strings "ArchivedFile::refill_buffer LZW compressed buffer overflow." / "MiniZ compressed buffer overflow."; reads the next compressed chunk (size dword, max 0x7ff) through the inner stream vtable +0x14 and decompresses with lzw (00a85320) or miniz (00a89f80) by archive compression type */ void KAGE::Filesys::ArchivedFile::refill_buffer(uint param_1) { byte *pbVar1; char cVar2; int *piVar3; undefined4 uVar4; undefined1 *puVar5; int in_ECX; uint uVar6; byte *pbVar7; int iVar8; undefined1 uVar9; uint uVar10; uint uVar11; uint local_90; uint local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined4 local_7c; undefined4 local_78; undefined4 local_74; undefined4 local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined4 local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; uVar11 = *(uint *)(in_ECX + 0xc1c); uVar6 = -(uint)(uVar11 < *(uint *)(in_ECX + 0xc20)) & *(uint *)(in_ECX + 0xc20) - uVar11; uVar10 = param_1; if (uVar6 < param_1) { uVar10 = uVar6; } param_1 = param_1 - uVar10; uVar6 = uVar10 + *(int *)(in_ECX + 0x18); iVar8 = uVar11 + uVar10; *(uint *)(in_ECX + 0x18) = uVar6; *(int *)(in_ECX + 0xc1c) = iVar8; do { if ((param_1 == 0) || (*(char *)(in_ECX + 0xc28) != '\0')) { return; } uVar11 = *(uint *)(*(int *)(in_ECX + 0xc) + 0x10); if (uVar6 < uVar11) { piVar3 = *(int **)(in_ECX + 8); cVar2 = *(char *)(*(int *)(in_ECX + 4) + 4); if (cVar2 == '\x01') { (**(code **)(*piVar3 + 0x14))(&local_90,4,1); if (0x7ff < local_90) { KAGE_LogMessage(0x10,(byte *) "ArchivedFile::refill_buffer LZW compressed buffer overflow.\n"); } (**(code **)(**(int **)(in_ECX + 8) + 0x14))(in_ECX + 0x1c,1,local_90); uVar4 = lzw_decompress(in_ECX + 0x81c,in_ECX + 0x1c,local_90); *(undefined4 *)(in_ECX + 0xc20) = uVar4; } else if (cVar2 == '\x02') { (**(code **)(*piVar3 + 0x14))(&local_8c,4,1); uVar10 = local_8c & 0x7fffffff; uVar11 = local_8c >> 0x1f; local_8c = uVar10; if (0x7ff < uVar10) { KAGE_LogMessage(0x10,(byte *) "ArchivedFile::refill_buffer MiniZ compressed buffer overflow.\n"); } (**(code **)(**(int **)(in_ECX + 8) + 0x14))(in_ECX + 0x1c,1,local_8c); uVar4 = FUN_00a89f80(in_ECX + 0x81c,0x400,in_ECX + 0x1c,local_8c,uVar11); *(undefined4 *)(in_ECX + 0xc20) = uVar4; } else if (cVar2 == '\x05') { uVar4 = (**(code **)(*piVar3 + 0x14))(in_ECX + 0x81c,1,0x400); *(undefined4 *)(in_ECX + 0xc20) = uVar4; local_88 = 0x475d22b0; local_84 = 0xd1591bd3; local_80 = 0xd2fb3797; local_7c = 0xfd8631c0; local_78 = 0x4bacddb5; local_74 = 0x521501b4; local_70 = 0x8750a01; local_6c = 0x8cfe505d; local_68 = 0xcbd5afa8; local_64 = 0xcadcee09; local_60 = 0x673fc476; local_5c = 0x648f09ed; local_58 = 0x1a305643; local_54 = 0xf9df2e89; local_50 = 0x1a13b8e4; local_4c = 0x2a4afbe; local_48 = 0xe02260ff; local_44 = 0xc9aeff0b; local_40 = 0xf927a07d; local_3c = 0xe12f6311; local_38 = 0xd7517e20; local_34 = 0xd4c4cd0e; local_30 = 0x88a1cfcf; local_2c = 0xcf964299; local_28 = 0xc354c1f0; local_24 = 0x92c29436; local_20 = 0xca63b8dc; local_1c = 0x7a1232ca; local_18 = 0xd25f883c; local_14 = 0x69e4c34b; local_10 = 0x2cbd3274; local_c = 0x34b22842; pbVar7 = (byte *)(in_ECX + 0x81d); do { pbVar7[-1] = pbVar7[-1] ^ *(byte *)((int)&local_88 + ((uint)(pbVar7 + (-0x81d - in_ECX)) & 0x7f)); *pbVar7 = *pbVar7 ^ *(byte *)((int)&local_88 + ((uint)(pbVar7 + (-0x81c - in_ECX)) & 0x7f) ); pbVar7[1] = pbVar7[1] ^ *(byte *)((int)&local_88 + ((uint)(pbVar7 + (-0x81b - in_ECX)) & 0x7f)); pbVar1 = pbVar7 + 4; pbVar7[2] = pbVar7[2] ^ *(byte *)((int)&local_88 + ((uint)(pbVar7 + (-0x81a - in_ECX)) & 0x7f)); pbVar7 = pbVar1; } while ((int)(pbVar1 + (-0x81d - in_ECX)) < 0x400); } else { uVar10 = (uVar11 - uVar6) + 3 & 0xfffffffc; uVar11 = 0x400; if (uVar10 < 0x400) { uVar11 = uVar10; } uVar4 = (**(code **)(*piVar3 + 0x14))(in_ECX + 0x81c,1,uVar11); uVar11 = *(uint *)(in_ECX + 0xc24); *(undefined4 *)(in_ECX + 0xc20) = uVar4; puVar5 = (undefined1 *)(in_ECX + 0x81d); iVar8 = 0x100; do { uVar6 = *(uint *)(puVar5 + -1) ^ uVar11; uVar10 = uVar11 & 0xf; *(uint *)(puVar5 + -1) = uVar6; uVar9 = (undefined1)uVar6; if (uVar10 == 2) { puVar5[2] = uVar9; puVar5[-1] = (char)(uVar6 >> 0x18); uVar9 = puVar5[1]; puVar5[1] = *puVar5; LAB_00a6942c: *puVar5 = uVar9; } else if (uVar10 == 9) { *puVar5 = uVar9; uVar9 = puVar5[1]; puVar5[-1] = (char)(uVar6 >> 8); puVar5[1] = puVar5[2]; puVar5[2] = uVar9; } else if (uVar10 == 0xd) { puVar5[1] = uVar9; puVar5[-1] = (char)(uVar6 >> 0x10); uVar9 = puVar5[2]; puVar5[2] = *puVar5; goto LAB_00a6942c; } puVar5 = puVar5 + 4; uVar11 = uVar11 << 8 ^ uVar11; uVar11 = uVar11 ^ uVar11 >> 9; uVar11 = uVar11 << 0x17 ^ uVar11; iVar8 = iVar8 + -1; } while (iVar8 != 0); *(uint *)(in_ECX + 0xc24) = uVar11; } uVar6 = *(uint *)(in_ECX + 0x18); iVar8 = 0; } else { *(undefined1 *)(in_ECX + 0xc28) = 1; } uVar11 = *(uint *)(in_ECX + 0xc20); if (param_1 < *(uint *)(in_ECX + 0xc20)) { uVar11 = param_1; } param_1 = param_1 - uVar11; uVar6 = uVar6 + uVar11; iVar8 = iVar8 + uVar11; *(uint *)(in_ECX + 0x18) = uVar6; *(int *)(in_ECX + 0xc1c) = iVar8; } while( true ); } //@@ 00a694a0 FUN_00a694a0 void FUN_00a694a0(uint param_1,int param_2) { int in_ECX; uint uVar1; if (param_2 != 0) { if (param_2 == 1) { uVar1 = *(uint *)(in_ECX + 0x18); param_1 = param_1 + uVar1; goto LAB_00a694d9; } if (param_2 == 2) { uVar1 = *(uint *)(in_ECX + 0x18); param_1 = *(int *)(*(int *)(in_ECX + 0xc) + 0x10) + uVar1 + param_1; goto LAB_00a694d9; } } uVar1 = *(uint *)(in_ECX + 0x18); LAB_00a694d9: if (param_1 < uVar1) { FUN_00a68c50(); uVar1 = *(uint *)(in_ECX + 0x18); } KAGE::Filesys::ArchivedFile::refill_buffer(param_1 - uVar1); return; } //@@ 00a69500 FUN_00a69500 undefined1 FUN_00a69500(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0xc28); } //@@ 00a69510 FUN_00a69510 uint FUN_00a69510(void *param_1,uint param_2,int param_3) { int in_ECX; uint uVar1; uint uVar2; uVar1 = param_2 * param_3; uVar2 = *(uint *)(in_ECX + 0xc1c); param_2 = -(uint)(uVar2 < *(uint *)(in_ECX + 0xc20)) & *(uint *)(in_ECX + 0xc20) - uVar2; if (uVar1 < param_2) { param_2 = uVar1; } memcpy(param_1,(void *)(in_ECX + 0x81c + uVar2),param_2); *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + param_2; param_1 = (void *)((int)param_1 + param_2); *(int *)(in_ECX + 0xc1c) = *(int *)(in_ECX + 0xc1c) + param_2; uVar1 = uVar1 - param_2; if (uVar1 == 0) { return param_2; } do { if (*(char *)(in_ECX + 0xc28) != '\0') { return param_2; } KAGE::Filesys::ArchivedFile::refill_buffer(); if (*(char *)(in_ECX + 0xc28) == '\0') { uVar2 = *(uint *)(in_ECX + 0xc20); if (uVar1 < *(uint *)(in_ECX + 0xc20)) { uVar2 = uVar1; } memcpy(param_1,(void *)(in_ECX + 0x81c),uVar2); *(int *)(in_ECX + 0x18) = *(int *)(in_ECX + 0x18) + uVar2; param_2 = param_2 + uVar2; param_1 = (void *)((int)param_1 + uVar2); uVar1 = uVar1 - uVar2; *(int *)(in_ECX + 0xc1c) = *(int *)(in_ECX + 0xc1c) + uVar2; } } while (uVar1 != 0); return param_2; } //@@ 00a695e0 FUN_00a695e0 int FUN_00a695e0(char *param_1) { int iVar1; int *in_ECX; int iVar2; undefined4 uStack_8; uStack_8 = (uint)in_ECX & 0xffffff; iVar2 = 0; do { iVar1 = (**(code **)(*in_ECX + 0x14))((int)&uStack_8 + 3,1,1); if (iVar1 == 0) break; iVar2 = iVar2 + 1; *param_1 = uStack_8._3_1_; param_1 = param_1 + 1; } while (uStack_8._3_1_ != '\n'); *param_1 = '\0'; return iVar2; } //@@ 00a69620 FUN_00a69620 undefined4 FUN_00a69620(void) { KAGE_LogMessage(0x10,(byte *)"ArchivedFile::Write not implemented.\n"); return 0; } //@@ 00a69640 FUN_00a69640 void FUN_00a69640(void) { KAGE_LogMessage(0x10,(byte *)"ArchivedFile::Flush not implemented.\n"); return; } //@@ 00a69650 FUN_00a69650 undefined4 FUN_00a69650(uint param_1,uint param_2,undefined1 param_3) { int iVar1; uint uVar2; char cVar3; int in_ECX; undefined4 uVar4; uVar2 = param_2; if ((param_1 < *(uint *)(in_ECX + 0x10)) && (param_2 < *(uint *)(in_ECX + 0x14))) { cVar3 = FUN_00a66590(¶m_3); if (cVar3 != '\0') { iVar1 = *(int *)(in_ECX + 0x28); uVar4 = 0; if (iVar1 == 0) { KAGE_LogMessage(0x10,(byte *) "Cannot set texel color of a palette image, use a palette swap to achieve this\n" ); return 0; } if (iVar1 == 6) { uVar4 = 0x1907; } else if (iVar1 == 8) { uVar4 = 0x1908; } (*(code *)epoxy_glBindTexture)(0xde1,*(undefined4 *)(in_ECX + 0x58)); (*(code *)epoxy_glTexSubImage2D)(0xde1,0,param_1,uVar2,1,1,uVar4,0x1401,¶m_2); return 1; } } return 0; } //@@ 00a69700 FUN_00a69700 KColor * FUN_00a69700(KColor *param_1,uint param_2,uint param_3) { uint uVar1; int *in_ECX; KColor *extraout_ECX; uVar1 = param_2; if ((param_2 < (uint)in_ECX[4]) && (param_3 < (uint)in_ECX[5])) { param_2 = 0; (**(code **)(*in_ECX + 0x30))(uVar1,param_3,1,1,¶m_2); FUN_00a66440(in_ECX[10]); return param_1; } KColor::SetFromARGB(param_1,0xffffffff); return extraout_ECX; } //@@ 00a69760 FUN_00a69760 void FUN_00a69760(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { undefined1 uVar1; code *pcVar2; char cVar3; uint uVar4; void *pvVar5; undefined4 *puVar6; undefined4 uVar7; int iVar8; int in_ECX; undefined4 extraout_ECX; char *pcVar9; int local_1c; int *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af69ad; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pcVar9 = *(char **)(in_ECX + 0x44); if (*(char **)(in_ECX + 0x44) == (char *)0x0) { pcVar9 = "unknown"; if (*(char **)(in_ECX + 0x40) != (char *)0x0) { pcVar9 = *(char **)(in_ECX + 0x40); } } FUN_00a11780(&local_1c,pcVar9); local_8 = 0; if (local_1c != 0) { if (((DAT_00c7995c + DAT_00c79958 & 1) == 0) && (DAT_00c79954 <= DAT_00c7995c + 2U >> 1)) { std::deque::_Growmap(extraout_ECX); } DAT_00c79958 = DAT_00c79954 * 2 - 1 & DAT_00c79958; local_14 = DAT_00c7995c + DAT_00c79958; iVar8 = (DAT_00c79954 - 1 & local_14 >> 1) * 4; if (*(int *)(iVar8 + DAT_00c79950) == 0) { pvVar5 = operator_new(0x10); *(void **)(iVar8 + DAT_00c79950) = pvVar5; } iVar8 = *(int *)(iVar8 + DAT_00c79950); *(undefined4 *)(iVar8 + (local_14 & 1) * 8) = 0; *(undefined4 *)(iVar8 + 4 + (local_14 & 1) * 8) = 0; DAT_00c7995c = DAT_00c7995c + 1; puVar6 = (undefined4 *)FUN_009e3d30(uVar4); uVar7 = (**(code **)(DAT_00c798e0 + 0x28))(puVar6 + 1); *puVar6 = uVar7; (**(code **)(DAT_00c798e0 + 0x18))(local_1c,0); (*(code *)epoxy_glReadPixels)(param_1,param_2,param_3,param_4,0x1908,0x1401,param_5); if (DAT_00c7995c == 0) { KAGE_LogMessage(0x10,(byte *)"Render target stack empty\n"); } pcVar2 = *(code **)(DAT_00c798e0 + 0x18); iVar8 = FUN_009e3d30(); uVar1 = *(undefined1 *)(iVar8 + 4); puVar6 = (undefined4 *)FUN_009e3d30(); (*pcVar2)(*puVar6,uVar1); DAT_00c7995c = DAT_00c7995c + -1; if (DAT_00c7995c == 0) { DAT_00c79958 = 0; } } local_8 = 1; if (((local_18 != (int *)0x0) && (cVar3 = (**(code **)(*local_18 + 0xc))(), cVar3 != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_1c); } ExceptionList = local_10; return; } //@@ 00a69950 FUN_00a69950 void FUN_00a69950(void) { undefined4 *in_ECX; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[5] = 0; in_ECX[4] = 0; in_ECX[7] = 0; in_ECX[6] = 0; in_ECX[9] = 0; in_ECX[8] = 0; in_ECX[10] = 0xb; in_ECX[0xb] = 0; in_ECX[0xc] = 2; in_ECX[0xd] = 2; in_ECX[0xe] = 2; in_ECX[0xf] = 2; in_ECX[0x10] = 0; in_ECX[0x11] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0; *in_ECX = KAGE::Graphics::PlatformImage::vftable; in_ECX[0x16] = 0xffffffff; return; } //@@ 00a699f0 FUN_00a699f0 void FUN_00a699f0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x60); } return; } //@@ 00a69a20 FUN_00a69a20 void FUN_00a69a20(void) { undefined4 *in_ECX; *in_ECX = KAGE::Graphics::ImageBase::vftable; FID_conflict__Tidy(in_ECX + 0x13); return; } //@@ 00a69a30 FUN_00a69a30 void FUN_00a69a30(void) { int in_ECX; (*(code *)epoxy_glDeleteTextures)(1,in_ECX + 0x58); FUN_00a12ad0(); return; } //@@ 00a69a50 FUN_00a69a50 void FUN_00a69a50(int param_1,int param_2) { int in_ECX; (*(code *)epoxy_glBindTexture)(0xde1,*(undefined4 *)(in_ECX + 0x58)); (*(code *)epoxy_glTexParameteri)(0xde1,0x2801,(param_1 != 0) + 0x2600); (*(code *)epoxy_glTexParameteri)(0xde1,0x2800,(param_2 != 0) + 0x2600); return; } //@@ 00a69ab0 FUN_00a69ab0 void FUN_00a69ab0(int param_1,int param_2) { undefined4 uVar1; int in_ECX; undefined4 uVar2; (*(code *)epoxy_glBindTexture)(0xde1,*(undefined4 *)(in_ECX + 0x58)); uVar2 = 0x812f; uVar1 = 0x812f; if (param_1 == 0) { uVar1 = 0x2901; } (*(code *)epoxy_glTexParameteri)(0xde1,0x2802,uVar1); if (param_2 == 0) { uVar2 = 0x2901; } (*(code *)epoxy_glTexParameteri)(0xde1,0x2803,uVar2); return; } //@@ 00a69b10 FUN_00a69b10 int FUN_00a69b10(void) { if (DAT_00c7f620 == 0) { (*(code *)epoxy_glGetIntegerv)(0xd33,&DAT_00c7f620); } return DAT_00c7f620; } //@@ 00a69b30 FUN_00a69b30 undefined4 FUN_00a69b30(undefined4 *param_1) { int iVar1; int in_ECX; undefined4 uVar2; undefined4 uVar3; iVar1 = *(int *)(in_ECX + 0x28); uVar2 = 0; uVar3 = 0; if (iVar1 == 0) { uVar3 = 0x1903; uVar2 = 0x1903; } else if (iVar1 == 6) { uVar3 = 0x1907; uVar2 = 0x1907; if (((byte)g_graphicsManager_flags & 8) != 0) { uVar3 = 0x8c40; } } else if (iVar1 == 8) { uVar3 = 0x1908; uVar2 = 0x1908; if (((byte)g_graphicsManager_flags & 8) != 0) { uVar3 = 0x8c42; } } (*(code *)epoxy_glGenTextures)(1,(undefined4 *)(in_ECX + 0x58)); (*(code *)epoxy_glBindTexture)(0xde1,*(undefined4 *)(in_ECX + 0x58)); (*(code *)epoxy_glTexImage2D) (0xde1,0,uVar3,*(undefined4 *)(in_ECX + 0x18),*(undefined4 *)(in_ECX + 0x1c),0,uVar2, 0x1401,*param_1); KAGE_Memory::heap_free(2,(void *)*param_1); return 1; } //@@ 00a69be0 FUN_00a69be0 void FUN_00a69be0(void *param_1,size_t param_2) { realloc(param_1,param_2); return; } //@@ 00a69c00 glfw_terminate /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: GLFW 3.4 init.c static terminate(): destroys every window (FUN_00a6af90 glfwDestroyWindow) and cursor (FUN_00a26570), frees monitors (g_glfwMonitorCount, modes +0xb0, gamma +0xb4 via g_glfwDeallocate); from glfwInit FUN_00a6a420 failure path */ void glfw_terminate(void) { int iVar1; undefined4 *puVar2; DWORD dwTlsIndex; int iVar3; _DAT_00c74ca4 = 0; while (DAT_00c73ca0 != 0) { FUN_00a6af90(); } DAT_00c73ca0 = 0; while (DAT_00c73c9c != 0) { FUN_00a26570(); } iVar3 = 0; DAT_00c73c9c = 0; if (0 < g_glfwMonitorCount) { do { iVar1 = *(int *)(DAT_00c73ca4 + iVar3 * 4); if (*(int *)(iVar1 + 0xbc) != 0) { (*DAT_00c73704)(iVar1,iVar1 + 0xb0); } (*DAT_00c736e8)(iVar1); if (*(int *)(iVar1 + 0xb0) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 0xb0),g_glfwAllocatorUser); } if (*(int *)(iVar1 + 0xb4) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 0xb4),g_glfwAllocatorUser); } if (*(int *)(iVar1 + 0xb8) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 0xb8),g_glfwAllocatorUser); } *(undefined4 *)(iVar1 + 0xb0) = 0; *(undefined4 *)(iVar1 + 0xb4) = 0; *(undefined4 *)(iVar1 + 0xb8) = 0; *(undefined4 *)(iVar1 + 0xbc) = 0; if (*(int *)(iVar1 + 0xc0) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 0xc0),g_glfwAllocatorUser); } if (*(int *)(iVar1 + 0xc4) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 0xc4),g_glfwAllocatorUser); } if (*(int *)(iVar1 + 200) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 200),g_glfwAllocatorUser); } *(undefined4 *)(iVar1 + 0xc0) = 0; *(undefined4 *)(iVar1 + 0xc4) = 0; *(undefined4 *)(iVar1 + 200) = 0; *(undefined4 *)(iVar1 + 0xcc) = 0; if (*(int *)(iVar1 + 0x90) != 0) { (*g_glfwDeallocate)(*(int *)(iVar1 + 0x90),g_glfwAllocatorUser); } (*g_glfwDeallocate)(iVar1,g_glfwAllocatorUser); iVar3 = iVar3 + 1; } while (iVar3 < g_glfwMonitorCount); } if (DAT_00c73ca4 != 0) { (*g_glfwDeallocate)(DAT_00c73ca4,g_glfwAllocatorUser); } DAT_00c73ca4 = 0; g_glfwMonitorCount = 0; if (DAT_00c74b70 != 0) { (*g_glfwDeallocate)(DAT_00c74b70,g_glfwAllocatorUser); } DAT_00c74b70 = 0; DAT_00c74b74 = 0; if (DAT_00c74c78 != (HMODULE)0x0) { FreeLibrary(DAT_00c74c78); } (*DAT_00c736d8)(); (*DAT_00c7369c)(); _glfw = 0; puVar2 = DAT_00c73c98; while (puVar2 != (undefined4 *)0x0) { DAT_00c73c98 = (undefined4 *)*puVar2; (*g_glfwDeallocate)(puVar2,g_glfwAllocatorUser); puVar2 = DAT_00c73c98; } DAT_00c73c98 = puVar2; if (DAT_00c74b80 != 0) { DAT_00c74b84 = (DWORD)((ulonglong)_DAT_00c74b80 >> 0x20); dwTlsIndex = DAT_00c74b84; TlsFree(dwTlsIndex); } _DAT_00c74b80 = 0; if (DAT_00c74b78 != 0) { TlsFree(DAT_00c74b7c); } _DAT_00c74b78 = 0; if (DAT_00c74b88 != 0) { DeleteCriticalSection((LPCRITICAL_SECTION)&DAT_00c74b8c); } memset(&_glfw,0,0x2728); return; } //@@ 00a69e80 FUN_00a69e80 void * FUN_00a69e80(void) { char cVar1; void *pvVar2; char *in_ECX; char *pcVar3; pcVar3 = in_ECX; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); pcVar3 = pcVar3 + (1 - (int)(in_ECX + 1)); if (pcVar3 != (char *)0x0) { pvVar2 = (void *)(*g_glfwAllocate)(pcVar3,g_glfwAllocatorUser); if (pvVar2 != (void *)0x0) { pvVar2 = memset(pvVar2,0,(size_t)pcVar3); goto LAB_00a69ecc; } _glfwInputError(0x10005,0); } pvVar2 = (void *)0x0; LAB_00a69ecc: pcVar3 = in_ECX; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; pcVar3[(int)pvVar2 + (-1 - (int)in_ECX)] = cVar1; } while (cVar1 != '\0'); return pvVar2; } //@@ 00a69ef0 _glfw_calloc /* DB: GLFW init.c: count*size overflow -> _glfwInputError(GLFW_INVALID_VALUE 0x10004, "Allocation size overflow"), allocator (g_glfwAllocate, user g_glfwAllocatorUser) then memset 0, GLFW_OUT_OF_MEMORY 0x10005 on failure */ void * _glfw_calloc(void) { void *pvVar1; uint in_ECX; uint in_EDX; if ((in_ECX != 0) && (in_EDX != 0)) { if ((uint)(0xffffffff / (ulonglong)in_EDX) < in_ECX) { _glfwInputError(0x10004,"Allocation size overflow"); return (void *)0x0; } pvVar1 = (void *)(*g_glfwAllocate)(in_ECX * in_EDX,g_glfwAllocatorUser); if (pvVar1 != (void *)0x0) { pvVar1 = memset(pvVar1,0,in_ECX * in_EDX); return pvVar1; } _glfwInputError(0x10005,0); } return (void *)0x0; } //@@ 00a69f60 _glfwInputError /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW init.c _glfwInputError(code, format,...): builds "The GLFW library is not initialized" for 0x10001, "A platform-specific error occurred" ...; win32_thread.c path string nearby */ void _glfwInputError(int param_1,int param_2,undefined1 param_3) { char cVar1; uint *puVar2; undefined4 *lpTlsValue; void *_Dst; char *pcVar3; undefined1 auStack_414 [4]; char local_410 [12]; undefined4 uStack_404; undefined8 local_400; undefined4 uStack_3f8; char acStack_3f4 [4]; ulonglong local_3f0; uint uStack_3e8; char acStack_3e4 [16]; undefined4 uStack_3d4; char local_3d0 [959]; undefined1 uStack_11; uint local_c; local_c = __security_cookie ^ (uint)auStack_414; if (param_2 == 0) { if (param_1 == 0x10001) { local_3f0 = CONCAT44(local_3f0._4_4_,0x64657a); builtin_strncpy(local_410,"The GLFW lib",0xc); uStack_404._0_1_ = 'r'; uStack_404._1_1_ = 'a'; uStack_404._2_1_ = 'r'; uStack_404._3_1_ = 'y'; local_400 = 0x20746f6e20736920; uStack_3f8._0_1_ = 'i'; uStack_3f8._1_1_ = 'n'; uStack_3f8._2_1_ = 'i'; uStack_3f8._3_1_ = 't'; builtin_strncpy(acStack_3f4,"iali",4); } else { if (param_1 == 0x10002) { uStack_3f8._0_1_ = 'e'; uStack_3f8._1_1_ = 'x'; uStack_3f8._2_1_ = 't'; uStack_3f8._3_1_ = '\0'; builtin_strncpy(local_410,"There is no ",0xc); uStack_404._0_1_ = 'c'; uStack_404._1_1_ = 'u'; uStack_404._2_1_ = 'r'; uStack_404._3_1_ = 'r'; local_400 = 0x746e6f6320746e65; } else { if (param_1 == 0x10003) { local_3f0 = CONCAT44(local_3f0._4_4_,0x726574); builtin_strncpy(local_410,"Invalid argu",0xc); uStack_404._0_1_ = 'm'; uStack_404._1_1_ = 'e'; uStack_404._2_1_ = 'n'; uStack_404._3_1_ = 't'; local_400 = 0x756e6520726f6620; uStack_3f8._0_1_ = 'm'; uStack_3f8._1_1_ = ' '; uStack_3f8._2_1_ = 'p'; uStack_3f8._3_1_ = 'a'; builtin_strncpy(acStack_3f4,"rame",4); goto LAB_00a6a2d2; } if (param_1 == 0x10004) { uStack_3f8._0_1_ = 't'; uStack_3f8._1_1_ = 'e'; uStack_3f8._2_1_ = 'r'; uStack_3f8._3_1_ = '\0'; builtin_strncpy(local_410,"Invalid valu",0xc); uStack_404._0_1_ = 'e'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'f'; uStack_404._3_1_ = 'o'; local_400 = 0x656d617261702072; } else { if (param_1 == 0x10005) { builtin_strncpy(local_410 + 8,"emor",4); builtin_strncpy(local_410,"Out of m",8); uStack_404._0_1_ = 'y'; uStack_404._1_1_ = '\0'; goto LAB_00a6a2d2; } if (param_1 == 0x10006) { local_3f0 = local_3f0 & 0xffffffffffffff00; builtin_strncpy(local_410,"The requeste",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'A'; uStack_404._3_1_ = 'P'; local_400 = 0x616e752073692049; uStack_3f8._0_1_ = 'v'; uStack_3f8._1_1_ = 'a'; uStack_3f8._2_1_ = 'i'; uStack_3f8._3_1_ = 'l'; builtin_strncpy(acStack_3f4,"able",4); goto LAB_00a6a2d2; } if (param_1 == 0x10007) { uStack_3e8 = uStack_3e8 & 0xffffff00; builtin_strncpy(local_410,"The requeste",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'A'; uStack_404._3_1_ = 'P'; local_400 = 0x6f69737265762049; uStack_3f8._0_1_ = 'n'; uStack_3f8._1_1_ = ' '; uStack_3f8._2_1_ = 'i'; uStack_3f8._3_1_ = 's'; builtin_strncpy(acStack_3f4," una",4); local_3f0 = 0x656c62616c696176; goto LAB_00a6a2d2; } if (param_1 == 0x10008) { builtin_strncpy(local_410,"A platform-s",0xc); uStack_404._0_1_ = 'p'; uStack_404._1_1_ = 'e'; uStack_404._2_1_ = 'c'; uStack_404._3_1_ = 'i'; local_3f0 = CONCAT53(local_3f0._3_5_,0x6465); local_400 = 0x6f72726520636966; uStack_3f8._0_1_ = 'r'; uStack_3f8._1_1_ = ' '; uStack_3f8._2_1_ = 'o'; uStack_3f8._3_1_ = 'c'; builtin_strncpy(acStack_3f4,"curr",4); goto LAB_00a6a2d2; } if (param_1 == 0x10009) { local_3f0 = CONCAT44(local_3f0._4_4_,0x656c62); builtin_strncpy(local_410,"The requeste",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'f'; uStack_404._3_1_ = 'o'; local_400 = 0x2073692074616d72; uStack_3f8._0_1_ = 'u'; uStack_3f8._1_1_ = 'n'; uStack_3f8._2_1_ = 'a'; uStack_3f8._3_1_ = 'v'; builtin_strncpy(acStack_3f4,"aila",4); goto LAB_00a6a2d2; } if (param_1 == 0x1000a) { local_3f0 = CONCAT44(local_3f0._4_4_,0x747865); builtin_strncpy(local_410,"The specifie",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'w'; uStack_404._3_1_ = 'i'; local_400 = 0x73616820776f646e; uStack_3f8._0_1_ = ' '; uStack_3f8._1_1_ = 'n'; uStack_3f8._2_1_ = 'o'; uStack_3f8._3_1_ = ' '; builtin_strncpy(acStack_3f4,"cont",4); goto LAB_00a6a2d2; } if (param_1 == 0x1000b) { uStack_3e8 = CONCAT22(uStack_3e8._2_2_,0x65); builtin_strncpy(local_410,"The specifie",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'c'; uStack_404._3_1_ = 'u'; local_400 = 0x61687320726f7372; uStack_3f8._0_1_ = 'p'; uStack_3f8._1_1_ = 'e'; uStack_3f8._2_1_ = ' '; uStack_3f8._3_1_ = 'i'; builtin_strncpy(acStack_3f4,"s un",4); local_3f0 = 0x6c62616c69617661; goto LAB_00a6a2d2; } if (param_1 == 0x1000c) { builtin_strncpy(acStack_3e4 + 0xc,"tfor",4); builtin_strncpy(local_410,"The requeste",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'f'; uStack_404._3_1_ = 'e'; uStack_3d4._0_1_ = 'm'; uStack_3d4._1_1_ = '\0'; local_400 = 0x6163206572757461; uStack_3f8._0_1_ = 'n'; uStack_3f8._1_1_ = 'n'; uStack_3f8._2_1_ = 'o'; uStack_3f8._3_1_ = 't'; builtin_strncpy(acStack_3f4," be ",4); local_3f0 = 0x6e656d656c706d69; uStack_3e8._0_1_ = 't'; uStack_3e8._1_1_ = 'e'; uStack_3e8._2_1_ = 'd'; uStack_3e8._3_1_ = ' '; builtin_strncpy(acStack_3e4,"for this pla",0xc); goto LAB_00a6a2d2; } if (param_1 == 0x1000d) { builtin_strncpy(local_3d0,"form",5); builtin_strncpy(local_410,"The requeste",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'f'; uStack_404._3_1_ = 'e'; local_400 = 0x6168206572757461; uStack_3f8._0_1_ = 's'; uStack_3f8._1_1_ = ' '; uStack_3f8._2_1_ = 'n'; uStack_3f8._3_1_ = 'o'; builtin_strncpy(acStack_3f4,"t ye",4); local_3f0 = 0x69206e6565622074; uStack_3e8._0_1_ = 'm'; uStack_3e8._1_1_ = 'p'; uStack_3e8._2_1_ = 'l'; uStack_3e8._3_1_ = 'e'; builtin_strncpy(acStack_3e4,"mented for this ",0x10); uStack_3d4._0_1_ = 'p'; uStack_3d4._1_1_ = 'l'; uStack_3d4._2_1_ = 'a'; uStack_3d4._3_1_ = 't'; goto LAB_00a6a2d2; } if (param_1 == 0x1000e) { builtin_strncpy(local_410,"The requeste",0xc); uStack_404._0_1_ = 'd'; uStack_404._1_1_ = ' '; uStack_404._2_1_ = 'p'; uStack_404._3_1_ = 'l'; local_3f0 = CONCAT26(local_3f0._6_2_,0x656c62616c); local_400 = 0x69206d726f667461; uStack_3f8._0_1_ = 's'; uStack_3f8._1_1_ = ' '; uStack_3f8._2_1_ = 'u'; uStack_3f8._3_1_ = 'n'; builtin_strncpy(acStack_3f4,"avai",4); goto LAB_00a6a2d2; } uStack_3f8._0_1_ = 'R'; uStack_3f8._1_1_ = '\0'; builtin_strncpy(local_410,"ERROR: UNKNO",0xc); uStack_404._0_1_ = 'W'; uStack_404._1_1_ = 'N'; uStack_404._2_1_ = ' '; uStack_404._3_1_ = 'G'; local_400 = 0x4f5252452057464c; } } } } else { puVar2 = (uint *)FUN_0041d4c0(local_410,0x400,param_2,0,¶m_3); __stdio_common_vsprintf(*puVar2 | 2,puVar2[1]); uStack_11 = 0; } LAB_00a6a2d2: if (_glfw == 0) { lpTlsValue = (undefined4 *)&DAT_00c7de90; } else { if (DAT_00c74b78 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } lpTlsValue = TlsGetValue(DAT_00c74b7c); if (lpTlsValue == (undefined4 *)0x0) { _Dst = (void *)(*g_glfwAllocate)(0x408,g_glfwAllocatorUser); if (_Dst == (void *)0x0) { _glfwInputError(0x10005,0); lpTlsValue = (undefined4 *)0x0; } else { lpTlsValue = memset(_Dst,0,0x408); } if (DAT_00c74b78 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x45); } TlsSetValue(DAT_00c74b7c,lpTlsValue); if (DAT_00c74b88 != 1) { _wassert(L"mutex->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x59); } EnterCriticalSection((LPCRITICAL_SECTION)&DAT_00c74b8c); *lpTlsValue = DAT_00c73c98; DAT_00c73c98 = lpTlsValue; if (DAT_00c74b88 != 1) { _wassert(L"mutex->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x5f); } LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_00c74b8c); } } lpTlsValue[1] = param_1; pcVar3 = local_410; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; pcVar3[(int)((int)lpTlsValue + (7 - (int)local_410))] = cVar1; } while (cVar1 != '\0'); if (DAT_00c7de7c != (code *)0x0) { (*DAT_00c7de7c)(param_1,local_410); } return; } //@@ 00a6a420 glfwInit /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: glfw (round 7 agent) */ undefined4 glfwInit(void) { int iVar1; void *_Dst; uint uVar2; LARGE_INTEGER LStack_10; if (_glfw != 0) { return 1; } _glfw = 0; memset(&DAT_00c73694,0,0x120); memset(&DAT_00c737d4,0,0x25d4); _DAT_00c737b4 = 1; DAT_00c737b8 = 0x37001; uRam00c737bc = 0x60000; uRam00c737c0 = 0; _DAT_00c737c4 = 1; uRam00c737c8 = 1; uRam00c737cc = 1; uRam00c737d0 = 0x38001; g_glfwAllocate = _DAT_00c7de80; DAT_00c73688 = pcRam00c7de84; g_glfwDeallocate = pvRam00c7de88; g_glfwAllocatorUser = pvRam00c7de8c; if (_DAT_00c7de80 == (void *)0x0) { g_glfwAllocate = FUN_00837010; DAT_00c73688 = FUN_00a69be0; g_glfwDeallocate = FUN_00837030; } iVar1 = _glfwSelectPlatform(); if (iVar1 != 0) { iVar1 = (*DAT_00c73698)(); if (iVar1 != 0) { if (DAT_00c74b88 != 0) { _wassert(L"mutex->win32.allocated == GLFW_FALSE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x4b); } InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_00c74b8c); DAT_00c74b88 = 1; iVar1 = FUN_00a9dad0(); if ((iVar1 != 0) && (iVar1 = FUN_00a9dad0(), iVar1 != 0)) { FUN_00a9db20(); _Dst = (void *)(*g_glfwAllocate)(0x15d51,g_glfwAllocatorUser); if (_Dst == (void *)0x0) { _glfwInputError(0x10005,0); DAT_00c74b70 = (void *)0x0; } else { DAT_00c74b70 = memset(_Dst,0,0x15d51); } uVar2 = 0; do { iVar1 = parseMapping(); if (iVar1 != 0) { DAT_00c74b74 = DAT_00c74b74 + 1; } uVar2 = uVar2 + 4; } while (uVar2 < 0x5b4); QueryPerformanceFrequency((LARGE_INTEGER *)&DAT_00c74bb0); QueryPerformanceCounter(&LStack_10); _DAT_00c74ba8 = LStack_10.s.LowPart; _DAT_00c74bac = LStack_10.s.HighPart; _glfw = 1; memset(&DAT_00c73c64,0,0x30); _DAT_00c73c64 = 0x30001; _DAT_00c73c68 = 0x36001; _DAT_00c73c6c = 1; _DAT_00c73c70 = 0; memset(&DAT_00c73818,0,0x44c); _DAT_00c7382c = 1; _DAT_00c73830 = 1; _DAT_00c73834 = 1; _DAT_00c73838 = 1; _DAT_00c7383c = 1; _DAT_00c73848 = 1; _DAT_00c7384c = 1; DAT_00c73818 = 0x80000000; DAT_00c7381c = 0x80000000; _DAT_00c73858 = 1; memset(&DAT_00c737d4,0,0x44); _DAT_00c737d4 = 8; _DAT_00c737d8 = 8; _DAT_00c737dc = 8; _DAT_00c737e0 = 8; _DAT_00c737e4 = 0x18; _DAT_00c737e8 = 8; _DAT_00c7380c = 1; DAT_00c73c94 = 0xffffffff; return 1; } } glfw_terminate(); } return 0; } //@@ 00a6a710 FUN_00a6a710 void FUN_00a6a710(void) { int in_ECX; int in_EDX; uint uVar1; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x2d); } if ((in_EDX != 1) && (in_EDX != 0)) { _wassert(L"focused == GLFW_TRUE || focused == GLFW_FALSE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x2e); } if (*(code **)(in_ECX + 0x280) != (code *)0x0) { (**(code **)(in_ECX + 0x280))(); } uVar1 = 0; if (in_EDX == 0) { do { if (*(char *)(in_ECX + 0x7c + uVar1) == '\x01') { (*DAT_00c736c8)(uVar1); if (uVar1 < 0x15d) { if (*(char *)(in_ECX + 0x7c + uVar1) == '\0') goto LAB_00a6a7ac; *(byte *)(in_ECX + 0x7c + uVar1) = -(*(int *)(in_ECX + 100) != 0) & 3; } if (*(code **)(in_ECX + 0x2a4) != (code *)0x0) { (**(code **)(in_ECX + 0x2a4))(); } } LAB_00a6a7ac: uVar1 = uVar1 + 1; } while ((int)uVar1 < 0x15d); uVar1 = 0; do { if ((*(char *)(in_ECX + 0x74 + uVar1) == '\x01') && (uVar1 < 8)) { *(byte *)(in_ECX + 0x74 + uVar1) = -(*(int *)(in_ECX + 0x68) != 0) & 3; if (*(code **)(in_ECX + 0x294) != (code *)0x0) { (**(code **)(in_ECX + 0x294))(); } } uVar1 = uVar1 + 1; } while ((int)uVar1 < 8); } return; } //@@ 00a6a7f0 FUN_00a6a7f0 void FUN_00a6a7f0(int param_1) { int in_ECX; int in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x58); } if (in_EDX < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x59); } if (param_1 < 0) { _wassert(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x5a); } if (*(code **)(in_ECX + 0x274) != (code *)0x0) { (**(code **)(in_ECX + 0x274))(); } return; } //@@ 00a6a870 FUN_00a6a870 void FUN_00a6a870(void) { int in_ECX; int in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,100); } if ((in_EDX != 1) && (in_EDX != 0)) { _wassert(L"iconified == GLFW_TRUE || iconified == GLFW_FALSE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x65); } if (*(code **)(in_ECX + 0x284) != (code *)0x0) { (**(code **)(in_ECX + 0x284))(); } return; } //@@ 00a6a8d0 FUN_00a6a8d0 void FUN_00a6a8d0(void) { int in_ECX; int in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x6f); } if ((in_EDX != 1) && (in_EDX != 0)) { _wassert(L"maximized == GLFW_TRUE || maximized == GLFW_FALSE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x70); } if (*(code **)(in_ECX + 0x288) != (code *)0x0) { (**(code **)(in_ECX + 0x288))(); } return; } //@@ 00a6a930 FUN_00a6a930 void FUN_00a6a930(int param_1) { int in_ECX; int in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x7b); } if (in_EDX < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x7c); } if (param_1 < 0) { _wassert(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x7d); } if (*(code **)(in_ECX + 0x28c) != (code *)0x0) { (**(code **)(in_ECX + 0x28c))(); } return; } //@@ 00a6a9b0 glfwCreateWindow /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: GLFW 3.4 window.c: asserts "title != NULL", "width >= 0", "height >= 0", "Invalid window size %ix%i", copies _glfw.hints, _glfwIsValidContextConfig (00a6b1a0); caller FUN_00a19df0 */ undefined4 * glfwCreateWindow(int param_1,undefined4 param_2,undefined4 param_3) { void *_Dst; undefined4 *puVar1; undefined4 uVar2; int in_ECX; int iVar3; int in_EDX; int *piVar4; int *piVar5; undefined4 local_4e4; undefined4 uStack_4e0; undefined4 uStack_4dc; undefined4 uStack_4d8; undefined4 local_4d4; undefined4 uStack_4d0; undefined4 uStack_4cc; undefined4 uStack_4c8; undefined4 local_4c4; undefined4 uStack_4c0; undefined4 uStack_4bc; undefined4 uStack_4b8; undefined4 local_4b4; int local_4b0; int local_4ac; int local_4a8 [4]; int local_498; undefined4 local_494; undefined4 local_48c; undefined4 local_484; undefined4 local_480; undefined4 local_474; undefined4 local_470; undefined4 local_58; undefined4 uStack_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 local_48; undefined4 uStack_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 uStack_2c; undefined4 local_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 local_18; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); local_4ac = param_1; local_4b4 = param_3; local_4b0 = in_ECX; if (param_1 == 0) { _wassert(L"title != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0xbe); } if (in_ECX < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0xbf); } if (in_EDX < 0) { _wassert(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0xc0); } if (_glfw == 0) { _glfwInputError(0x10001,0); return (undefined4 *)0x0; } if ((in_ECX < 1) || (in_EDX < 1)) { _glfwInputError(0x10004,"Invalid window size %ix%i"); } else { local_18 = DAT_00c73814; local_58 = _DAT_00c737d4; uStack_54 = _DAT_00c737d8; uStack_50 = _DAT_00c737dc; uStack_4c = _DAT_00c737e0; piVar4 = &DAT_00c73818; piVar5 = local_4a8; for (iVar3 = 0x113; iVar3 != 0; iVar3 = iVar3 + -1) { *piVar5 = *piVar4; piVar4 = piVar4 + 1; piVar5 = piVar5 + 1; } local_48 = _DAT_00c737e4; uStack_44 = _DAT_00c737e8; uStack_40 = _DAT_00c737ec; uStack_3c = _DAT_00c737f0; local_498 = local_4ac; local_4a8[2] = local_4b0; local_38 = _DAT_00c737f4; uStack_34 = _DAT_00c737f8; uStack_30 = _DAT_00c737fc; uStack_2c = _DAT_00c73800; local_28 = _DAT_00c73804; uStack_24 = _DAT_00c73808; uStack_20 = _DAT_00c7380c; uStack_1c = _DAT_00c73810; local_4e4 = _DAT_00c73c64; uStack_4e0 = _DAT_00c73c68; uStack_4dc = _DAT_00c73c6c; uStack_4d8 = _DAT_00c73c70; local_4d4 = _DAT_00c73c74; uStack_4d0 = _DAT_00c73c78; uStack_4cc = _DAT_00c73c7c; uStack_4c8 = _DAT_00c73c80; local_4c4 = _DAT_00c73c84; uStack_4c0 = _DAT_00c73c88; uStack_4b8 = _DAT_00c73c90; uStack_4bc = local_4b4; iVar3 = _glfwIsValidContextConfig(); if (iVar3 != 0) { _Dst = (void *)(*g_glfwAllocate)(0x328,g_glfwAllocatorUser); if (_Dst == (void *)0x0) { _glfwInputError(0x10005,0); puVar1 = (undefined4 *)0x0; } else { puVar1 = memset(_Dst,0,0x328); } *puVar1 = DAT_00c73ca0; DAT_00c73ca0 = puVar1; puVar1[10] = local_4b0; puVar1[0xb] = in_EDX; puVar1[0xc] = local_58; puVar1[0xd] = uStack_54; puVar1[0xe] = uStack_50; puVar1[0xf] = DAT_00c73c94; puVar1[0x10] = 0; puVar1[1] = local_494; puVar1[2] = local_48c; puVar1[3] = local_484; puVar1[4] = local_480; puVar1[5] = local_474; puVar1[6] = local_470; puVar1[0x1c] = 0x34001; puVar1[9] = uStack_20; puVar1[0x13] = 0xffffffff; puVar1[0x14] = 0xffffffff; puVar1[0x15] = 0xffffffff; puVar1[0x16] = 0xffffffff; puVar1[0x17] = 0xffffffff; puVar1[0x18] = 0xffffffff; uVar2 = FUN_00a69e80(); puVar1[0x12] = uVar2; iVar3 = (*DAT_00c73708)(puVar1,local_4a8,&local_4e4,&local_58); if (iVar3 == 0) { FUN_00a6af90(); return (undefined4 *)0x0; } return puVar1; } } return (undefined4 *)0x0; } //@@ 00a6ac80 glfwWindowHint /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: GLFW 3.4 window.c: switch on hint (ECX) 0x20001.. storing _glfw.hints.window/framebuffer/context, 'Invalid window hint 0x%%08X'; called by KAGE window creation 0xa19df0 */ void glfwWindowHint(void) { int in_ECX; int in_EDX; if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if (in_ECX < 0x21002) { switch(in_ECX) { case 0x20001: _DAT_00c73838 = (uint)(in_EDX != 0); return; case 0x20003: _DAT_00c7382c = (uint)(in_EDX != 0); return; case 0x20004: _DAT_00c73830 = (uint)(in_EDX != 0); return; case 0x20005: _DAT_00c73834 = (uint)(in_EDX != 0); return; case 0x20006: _DAT_00c7383c = (uint)(in_EDX != 0); return; case 0x20007: _DAT_00c73840 = (uint)(in_EDX != 0); return; case 0x20008: _DAT_00c73844 = (uint)(in_EDX != 0); return; case 0x20009: _DAT_00c73848 = (uint)(in_EDX != 0); return; case 0x2000a: _DAT_00c73810 = (uint)(in_EDX != 0); return; case 0x2000c: _DAT_00c7384c = (uint)(in_EDX != 0); return; case 0x2000d: _DAT_00c73850 = (uint)(in_EDX != 0); return; case 0x2000e: DAT_00c73818 = in_EDX; return; case 0x2000f: DAT_00c7381c = in_EDX; return; } } else if (in_ECX < 0x22002) { if (in_ECX == 0x22001) { _DAT_00c73c64 = in_EDX; return; } switch(in_ECX) { case 0x21002: _DAT_00c737d8 = in_EDX; return; case 0x21003: _DAT_00c737dc = in_EDX; return; case 0x21004: _DAT_00c737e0 = in_EDX; return; case 0x21005: _DAT_00c737e4 = in_EDX; return; case 0x21006: _DAT_00c737e8 = in_EDX; return; case 0x21007: _DAT_00c737ec = in_EDX; return; case 0x21008: _DAT_00c737f0 = in_EDX; return; case 0x21009: _DAT_00c737f4 = in_EDX; return; case 0x2100a: _DAT_00c737f8 = in_EDX; return; case 0x2100b: _DAT_00c737fc = in_EDX; return; case 0x2100c: _DAT_00c73800 = (uint)(in_EDX != 0); return; case 0x2100d: _DAT_00c73804 = in_EDX; return; case 0x2100e: _DAT_00c73808 = (uint)(in_EDX != 0); return; case 0x2100f: DAT_00c73c94 = in_EDX; return; case 0x21010: _DAT_00c7380c = (uint)(in_EDX != 0); return; } } else { if (in_ECX < 0x23002) { if (in_ECX == 0x23001) { switchD_00a6ae1f_caseD_2200d: _DAT_00c73858 = (uint)(in_EDX != 0); return; } switch(in_ECX) { case 0x22002: _DAT_00c73c6c = in_EDX; return; case 0x22003: _DAT_00c73c70 = in_EDX; return; default: goto switchD_00a6acb4_caseD_20002; case 0x22005: _DAT_00c73c84 = in_EDX; return; case 0x22006: _DAT_00c73c74 = (uint)(in_EDX != 0); return; case 0x22007: _DAT_00c73c78 = (uint)(in_EDX != 0); return; case 0x22008: _DAT_00c73c80 = in_EDX; return; case 0x22009: _DAT_00c73c88 = in_EDX; return; case 0x2200a: _DAT_00c73c7c = (uint)(in_EDX != 0); return; case 0x2200b: _DAT_00c73c68 = in_EDX; return; case 0x2200c: _DAT_00c73854 = (uint)(in_EDX != 0); return; case 0x2200d: goto switchD_00a6ae1f_caseD_2200d; } } if (in_ECX == 0x23003) { _DAT_00c73c90 = (uint)(in_EDX != 0); return; } if (in_ECX == 0x25001) { _DAT_00c73b5c = (uint)(in_EDX != 0); return; } if (in_ECX == 0x25002) { _DAT_00c73b60 = (uint)(in_EDX != 0); return; } } switchD_00a6acb4_caseD_20002: _glfwInputError(0x10003,"Invalid window hint 0x%08X"); return; } //@@ 00a6af90 FUN_00a6af90 void FUN_00a6af90(void) { undefined4 **ppuVar1; undefined4 **ppuVar2; LPVOID pvVar3; undefined4 **in_ECX; if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if (in_ECX != (undefined4 **)0x0) { memset(in_ECX + 0x9c,0,0x44); if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } ppuVar2 = TlsGetValue(DAT_00c74b84); if (in_ECX == ppuVar2) { if (_glfw == 0) { _glfwInputError(0x10001,0); } else { if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar3 = TlsGetValue(DAT_00c74b84); if (pvVar3 != (LPVOID)0x0) { (**(code **)((int)pvVar3 + 0x22c))(0); } } } (*DAT_00c7370c)(); ppuVar2 = &DAT_00c73ca0; for (ppuVar1 = (undefined4 **)DAT_00c73ca0; ppuVar1 != in_ECX; ppuVar1 = (undefined4 **)*ppuVar1 ) { ppuVar2 = ppuVar1; } *ppuVar2 = *in_ECX; if (in_ECX[0x12] != (undefined4 *)0x0) { (*g_glfwDeallocate)(in_ECX[0x12],g_glfwAllocatorUser); } (*g_glfwDeallocate)(); } return; } //@@ 00a6b0a0 FUN_00a6b0a0 void FUN_00a6b0a0(undefined4 param_1,undefined4 param_2,int param_3,int param_4,int param_5) { int in_ECX; undefined4 in_EDX; if (in_ECX == 0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3df); } if (param_3 < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3e0); } if (param_4 < 0) { _wassert(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x3e1); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if ((param_3 < 1) || (param_4 < 1)) { _glfwInputError(0x10004,"Invalid window size %ix%i",param_3,param_4); return; } if ((param_5 < 0) && (param_5 != -1)) { _glfwInputError(0x10004,"Invalid refresh rate %i",param_5); return; } *(int *)(in_ECX + 0x28) = param_3; *(int *)(in_ECX + 0x2c) = param_4; *(int *)(in_ECX + 0x3c) = param_5; (*DAT_00c73758)(in_ECX,in_EDX,param_1,param_2,param_3,param_4,param_5); return; } //@@ 00a6b1a0 _glfwIsValidContextConfig /* DB: GLFW 3.4 context.c: "Invalid context creation API 0x%08X", "Invalid client API 0x%08X", "Context creation APIs do not match between contexts", profile/forward-compat/robustness/release checks; from glfwCreateWindow 00a6a9b0 glfwCreateWindow undefined4 _glfwIsValidContextConfig(void) { int iVar1; int iVar2; int iVar3; int *in_ECX; bool bVar4; bool bVar5; bool bVar6; iVar1 = in_ECX[1]; if (((iVar1 != 0x36001) && (iVar1 != 0x36002)) && (iVar1 != 0x36003)) { _glfwInputError(0x10003,"Invalid context creation API 0x%08X",iVar1); return 0; } iVar2 = *in_ECX; if (((iVar2 != 0) && (iVar2 != 0x30001)) && (iVar2 != 0x30002)) { _glfwInputError(0x10003,"Invalid client API 0x%08X",iVar2); return 0; } iVar3 = in_ECX[10]; if (iVar3 != 0) { if ((iVar2 == 0) || (*(int *)(iVar3 + 500) == 0)) { _glfwInputError(0x1000a,0); return 0; } if (iVar1 != *(int *)(iVar3 + 0x1f8)) { _glfwInputError(0x10003,"Context creation APIs do not match between contexts"); return 0; } } if (iVar2 != 0x30001) { if (iVar2 != 0x30002) goto LAB_00a6b32f; iVar1 = in_ECX[2]; if ((iVar1 < 1) || (iVar2 = in_ECX[3], iVar2 < 0)) { LAB_00a6b364: _glfwInputError(0x10004,"Invalid OpenGL ES version %i.%i",iVar1,in_ECX[3]); return 0; } if (iVar1 == 1) { if (1 < iVar2) goto LAB_00a6b364; } else if ((iVar1 == 2) && (0 < iVar2)) goto LAB_00a6b364; goto LAB_00a6b32f; } iVar1 = in_ECX[2]; if ((iVar1 < 1) || (iVar2 = in_ECX[3], iVar2 < 0)) goto LAB_00a6b2f6; if (iVar1 == 1) { bVar6 = SBORROW4(iVar2,5); bVar5 = iVar2 + -5 < 0; bVar4 = iVar2 == 5; LAB_00a6b280: if (!bVar4 && bVar6 == bVar5) { LAB_00a6b2f6: _glfwInputError(0x10004,"Invalid OpenGL version %i.%i",iVar1,in_ECX[3]); return 0; } } else { if (iVar1 == 2) { bVar6 = SBORROW4(iVar2,1); bVar5 = iVar2 + -1 < 0; bVar4 = iVar2 == 1; goto LAB_00a6b280; } if (iVar1 == 3) { bVar6 = SBORROW4(iVar2,3); bVar5 = iVar2 + -3 < 0; bVar4 = iVar2 == 3; goto LAB_00a6b280; } } iVar3 = in_ECX[7]; if (iVar3 != 0) { if ((iVar3 != 0x32001) && (iVar3 != 0x32002)) { _glfwInputError(0x10003,"Invalid OpenGL profile 0x%08X",iVar3); return 0; } if ((iVar1 < 3) || ((iVar1 == 3 && (iVar2 < 2)))) { _glfwInputError(0x10004,"Context profiles are only defined for OpenGL version 3.2 and above"); return 0; } } if ((in_ECX[4] != 0) && (iVar1 < 3)) { _glfwInputError(0x10004,"Forward-compatibility is only defined for OpenGL version 3.0 and above" ); return 0; } LAB_00a6b32f: iVar1 = in_ECX[8]; if (((iVar1 != 0) && (iVar1 != 0x31001)) && (iVar1 != 0x31002)) { _glfwInputError(0x10003,"Invalid context robustness mode 0x%08X",iVar1); return 0; } iVar1 = in_ECX[9]; if (((iVar1 == 0) || (iVar1 == 0x35002)) || (iVar1 == 0x35001)) { return 1; } _glfwInputError(0x10003,"Invalid context release behavior 0x%08X",iVar1); return 0; } //@@ 00a6b3c0 _glfwChooseFBConfig /* DB: GLFW context.c: scores each candidate (missing/extra color, depth, stencil, accum, aux, sRGB, stereo/doublebuffer) and returns the closest; callers choosePixelFormatWGL and chooseEGLConfig */ int * _glfwChooseFBConfig(int param_1) { uint uVar1; int *in_ECX; uint uVar2; int iVar3; int in_EDX; int *piVar4; uint uVar5; int iVar6; uint local_14; uint local_10; uint local_c; int *local_8; local_c = 0xffffffff; local_10 = 0xffffffff; local_14 = 0xffffffff; local_8 = (int *)0x0; piVar4 = (int *)0x0; if (param_1 != 0) { piVar4 = (int *)(in_EDX + 0x28); do { if ((in_ECX[0xb] < 1) || (piVar4[1] != 0)) { uVar2 = 0; if ((0 < in_ECX[3]) && (piVar4[-7] == 0)) { uVar2 = 1; } if ((0 < in_ECX[4]) && (piVar4[-6] == 0)) { uVar2 = uVar2 + 1; } iVar3 = in_ECX[5]; if ((0 < iVar3) && (piVar4[-5] == 0)) { uVar2 = uVar2 + 1; } iVar6 = in_ECX[10]; if ((0 < iVar6) && (*piVar4 < iVar6)) { uVar2 = uVar2 + (iVar6 - *piVar4); } if ((0 < in_ECX[0xc]) && (piVar4[2] == 0)) { uVar2 = uVar2 + 1; } uVar5 = uVar2 + 1; if (in_ECX[0xf] == piVar4[5]) { uVar5 = uVar2; } uVar2 = 0; if (*in_ECX != -1) { iVar6 = *in_ECX - piVar4[-10]; uVar2 = iVar6 * iVar6; } if (in_ECX[1] != -1) { iVar6 = in_ECX[1] - piVar4[-9]; uVar2 = uVar2 + iVar6 * iVar6; } if (in_ECX[2] != -1) { iVar6 = in_ECX[2] - piVar4[-8]; uVar2 = uVar2 + iVar6 * iVar6; } uVar1 = 0; if (in_ECX[3] != -1) { iVar6 = in_ECX[3] - piVar4[-7]; uVar1 = iVar6 * iVar6; } if (in_ECX[4] != -1) { iVar6 = in_ECX[4] - piVar4[-6]; uVar1 = uVar1 + iVar6 * iVar6; } if (iVar3 != -1) { uVar1 = uVar1 + (iVar3 - piVar4[-5]) * (iVar3 - piVar4[-5]); } if (in_ECX[6] != -1) { iVar3 = in_ECX[6] - piVar4[-4]; uVar1 = uVar1 + iVar3 * iVar3; } if (in_ECX[7] != -1) { iVar3 = in_ECX[7] - piVar4[-3]; uVar1 = uVar1 + iVar3 * iVar3; } if (in_ECX[8] != -1) { iVar3 = in_ECX[8] - piVar4[-2]; uVar1 = uVar1 + iVar3 * iVar3; } if (in_ECX[9] != -1) { iVar3 = in_ECX[9] - piVar4[-1]; uVar1 = uVar1 + iVar3 * iVar3; } if (in_ECX[0xc] != -1) { iVar3 = in_ECX[0xc] - piVar4[2]; uVar1 = uVar1 + iVar3 * iVar3; } if ((in_ECX[0xd] != 0) && (piVar4[3] == 0)) { uVar1 = uVar1 + 1; } if ((uVar5 < local_c) || ((uVar5 == local_c && ((uVar2 < local_10 || ((uVar2 == local_10 && (uVar1 < local_14))))) ))) { local_8 = piVar4 + -10; } if (piVar4 + -10 == local_8) { local_14 = uVar1; local_10 = uVar2; local_c = uVar5; } } piVar4 = piVar4 + 0x11; param_1 = param_1 + -1; } while (param_1 != 0); piVar4 = local_8; } return piVar4; } //@@ 00a6b570 _glfwRefreshContextAttribs /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 context.c: "Requested OpenGL version %i.%i, got version %i.%i", "OpenGL ES-CM ", GL_ARB_robustness/GL_KHR_context_flush_control, glGetString/glGetIntegerv lookups, win32_thread.c tls assert */ undefined4 _glfwRefreshContextAttribs(void) { char cVar1; int iVar2; LPVOID pvVar3; LPVOID pvVar4; undefined4 uVar5; code *pcVar6; char *pcVar7; int iVar8; LPVOID in_ECX; int *in_EDX; char *pcVar9; size_t _MaxCount; int local_28; char *local_20; char *local_1c; char *local_18 [4]; char *local_8; local_8 = (char *)(__security_cookie ^ (uint)(local_18 + 5)); local_18[0] = "OpenGL ES-CM "; *(int *)((int)in_ECX + 0x1f8) = in_EDX[1]; *(undefined4 *)((int)in_ECX + 500) = 0x30001; local_18[1] = "OpenGL ES-CL "; local_18[2] = "OpenGL ES "; local_18[3] = (char *)0x0; if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar3 = TlsGetValue(DAT_00c74b84); if (_glfw == 0) { _glfwInputError(0x10001,0); } else { if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar4 = TlsGetValue(DAT_00c74b84); if (*(int *)((int)in_ECX + 500) == 0) { _glfwInputError(0x1000a, "Cannot make current with a window that has no OpenGL or OpenGL ES context"); } else { if ((pvVar4 != (LPVOID)0x0) && (*(int *)((int)in_ECX + 0x1f8) != *(int *)((int)pvVar4 + 0x1f8))) { (**(code **)((int)pvVar4 + 0x22c))(0); } (**(code **)((int)in_ECX + 0x22c))(); } } if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar4 = TlsGetValue(DAT_00c74b84); if (pvVar4 != in_ECX) { return 0; } uVar5 = (**(code **)((int)in_ECX + 0x23c))("glGetIntegerv"); *(undefined4 *)((int)in_ECX + 0x224) = uVar5; pcVar6 = (code *)(**(code **)((int)in_ECX + 0x23c))("glGetString"); *(code **)((int)in_ECX + 0x228) = pcVar6; if ((*(int *)((int)in_ECX + 0x224) == 0) || (pcVar6 == (code *)0x0)) { _glfwInputError(0x10008,"Entry point retrieval is broken"); if (_glfw == 0) goto LAB_00a6ba57; if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } } else { local_20 = (char *)(*pcVar6)(0x1f02); if (local_20 == (char *)0x0) { pcVar7 = "OpenGL ES version string retrieval is broken"; if (*in_EDX == 0x30001) { pcVar7 = "OpenGL version string retrieval is broken"; } _glfwInputError(0x10008,pcVar7); FUN_00a6bbb0(); return 0; } local_28 = 0; pcVar7 = "OpenGL ES-CM "; do { local_1c = pcVar7 + 1; pcVar9 = pcVar7; do { cVar1 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar1 != '\0'); _MaxCount = (int)pcVar9 - (int)local_1c; iVar8 = strncmp(local_20,pcVar7,_MaxCount); if (iVar8 == 0) { *(undefined4 *)((int)in_ECX + 500) = 0x30002; pcVar9 = local_20 + _MaxCount; break; } local_28 = local_28 + 1; pcVar7 = local_18[local_28]; pcVar9 = local_20; } while (pcVar7 != (char *)0x0); iVar8 = FUN_00837090(pcVar9,"%d.%d.%d",(int *)((int)in_ECX + 0x1fc),(int)in_ECX + 0x200, (int)in_ECX + 0x204); if (iVar8 == 0) { pcVar7 = "No version found in OpenGL ES version string"; if (*(int *)((int)in_ECX + 500) == 0x30001) { pcVar7 = "No version found in OpenGL version string"; } _glfwInputError(0x10008,pcVar7); } else { iVar8 = *(int *)((int)in_ECX + 0x1fc); iVar2 = in_EDX[2]; if ((iVar2 <= iVar8) && ((iVar8 != iVar2 || (in_EDX[3] <= *(int *)((int)in_ECX + 0x200))))) { if (2 < iVar8) { iVar8 = (**(code **)((int)in_ECX + 0x23c))("glGetStringi"); *(int *)((int)in_ECX + 0x220) = iVar8; if (iVar8 == 0) { _glfwInputError(0x10008,"Entry point retrieval is broken"); FUN_00a6bbb0(); return 0; } } if (*(int *)((int)in_ECX + 500) == 0x30001) { if (2 < *(int *)((int)in_ECX + 0x1fc)) { (**(code **)((int)in_ECX + 0x224))(0x821e,&local_20); if (((uint)local_20 & 1) != 0) { *(undefined4 *)((int)in_ECX + 0x208) = 1; } if ((((uint)local_20 & 2) != 0) || ((iVar8 = FUN_00a6bc50(), iVar8 != 0 && (in_EDX[5] != 0)))) { *(undefined4 *)((int)in_ECX + 0x20c) = 1; } if (((uint)local_20 & 8) != 0) { *(undefined4 *)((int)in_ECX + 0x210) = 1; } } iVar8 = *(int *)((int)in_ECX + 0x1fc); if ((3 < iVar8) || ((iVar8 == 3 && (1 < *(int *)((int)in_ECX + 0x200))))) { (**(code **)((int)in_ECX + 0x224))(0x9126,&local_1c); if (((uint)local_1c & 2) == 0) { if (((uint)local_1c & 1) != 0) { *(undefined4 *)((int)in_ECX + 0x214) = 0x32001; goto LAB_00a6b94d; } iVar8 = FUN_00a6bc50(); if (iVar8 == 0) goto LAB_00a6b94d; } *(undefined4 *)((int)in_ECX + 0x214) = 0x32002; } } LAB_00a6b94d: iVar8 = FUN_00a6bc50(); if (iVar8 != 0) { (**(code **)((int)in_ECX + 0x224))(0x8256,&local_1c); if (local_1c == (char *)0x8252) { *(undefined4 *)((int)in_ECX + 0x218) = 0x31002; } else if (local_1c == (char *)0x8261) { *(undefined4 *)((int)in_ECX + 0x218) = 0x31001; } } iVar8 = FUN_00a6bc50(); if (iVar8 != 0) { (**(code **)((int)in_ECX + 0x224))(0x82fb,&local_1c); if (local_1c == (char *)0x0) { *(undefined4 *)((int)in_ECX + 0x21c) = 0x35002; } else if (local_1c == (char *)0x82fc) { *(undefined4 *)((int)in_ECX + 0x21c) = 0x35001; } } pcVar6 = (code *)(**(code **)((int)in_ECX + 0x23c))("glClear"); (*pcVar6)(0x4000); if (*(int *)((int)in_ECX + 0x24) != 0) { (**(code **)((int)in_ECX + 0x230))(); } FUN_00a6bbb0(); return 1; } pcVar7 = "Requested OpenGL ES version %i.%i, got version %i.%i"; if (*(int *)((int)in_ECX + 500) == 0x30001) { pcVar7 = "Requested OpenGL version %i.%i, got version %i.%i"; } _glfwInputError(0x10007,pcVar7,iVar2,in_EDX[3],iVar8,*(undefined4 *)((int)in_ECX + 0x200)); } if (_glfw == 0) { LAB_00a6ba57: _glfwInputError(0x10001,0); return 0; } if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } } pvVar4 = TlsGetValue(DAT_00c74b84); if ((pvVar3 != (LPVOID)0x0) && (*(int *)((int)pvVar3 + 500) == 0)) { _glfwInputError(0x1000a, "Cannot make current with a window that has no OpenGL or OpenGL ES context"); return 0; } if (pvVar4 != (LPVOID)0x0) { if ((pvVar3 != (LPVOID)0x0) && (*(int *)((int)pvVar3 + 0x1f8) == *(int *)((int)pvVar4 + 0x1f8))) goto LAB_00a6bb15; (**(code **)((int)pvVar4 + 0x22c))(0); } if (pvVar3 == (LPVOID)0x0) { return 0; } LAB_00a6bb15: (**(code **)((int)pvVar3 + 0x22c))(pvVar3); return 0; } //@@ 00a6bb40 FUN_00a6bb40 undefined4 FUN_00a6bb40(void) { char cVar1; char *pcVar2; char *in_ECX; char *pcVar3; char *in_EDX; pcVar2 = strstr(in_EDX,in_ECX); while( true ) { if (pcVar2 == (char *)0x0) { return 0; } pcVar3 = in_ECX; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); pcVar3 = pcVar2 + ((int)pcVar3 - (int)(in_ECX + 1)); if (((pcVar2 == in_EDX) || (pcVar2[-1] == ' ')) && ((*pcVar3 == ' ' || (*pcVar3 == '\0')))) break; pcVar2 = strstr(pcVar3,in_ECX); in_EDX = pcVar3; } return 1; } //@@ 00a6bbb0 FUN_00a6bbb0 void FUN_00a6bbb0(void) { LPVOID pvVar1; int in_ECX; if (_glfw == 0) { _glfwInputError(0x10001,0); return; } if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar1 = TlsGetValue(DAT_00c74b84); if ((in_ECX != 0) && (*(int *)(in_ECX + 500) == 0)) { _glfwInputError(0x1000a, "Cannot make current with a window that has no OpenGL or OpenGL ES context"); return; } if (pvVar1 != (LPVOID)0x0) { if ((in_ECX != 0) && (*(int *)(in_ECX + 0x1f8) == *(int *)((int)pvVar1 + 0x1f8))) goto LAB_00a6bc41; (**(code **)((int)pvVar1 + 0x22c))(0); } if (in_ECX == 0) { return; } LAB_00a6bc41: (**(code **)(in_ECX + 0x22c))(); return; } //@@ 00a6bc50 FUN_00a6bc50 undefined4 FUN_00a6bc50(void) { byte bVar1; LPVOID pvVar2; byte *pbVar3; uint uVar4; undefined4 uVar5; byte *in_ECX; byte *pbVar6; int iVar7; bool bVar8; byte *local_8; local_8 = in_ECX; if (in_ECX == (byte *)0x0) { _wassert(L"extension != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\context.c" ,0x2ad); } if (_glfw == 0) { _glfwInputError(0x10001,0); return 0; } if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar2 = TlsGetValue(DAT_00c74b84); if (pvVar2 == (LPVOID)0x0) { _glfwInputError(0x10002,"Cannot query extension without a current OpenGL or OpenGL ES context"); return 0; } if (*in_ECX == 0) { _glfwInputError(0x10004,"Extension name cannot be an empty string"); return 0; } if (*(int *)((int)pvVar2 + 0x1fc) < 3) { iVar7 = (**(code **)((int)pvVar2 + 0x228))(0x1f03); if (iVar7 == 0) { LAB_00a6bd7a: _glfwInputError(0x10008,"Extension string retrieval is broken"); return 0; } iVar7 = FUN_00a6bb40(); if (iVar7 != 0) { return 1; } } else { (**(code **)((int)pvVar2 + 0x224))(0x821d,&local_8); iVar7 = 0; if (0 < (int)local_8) { do { pbVar3 = (byte *)(**(code **)((int)pvVar2 + 0x220))(0x1f03,iVar7); if (pbVar3 == (byte *)0x0) goto LAB_00a6bd7a; pbVar6 = in_ECX; do { bVar1 = *pbVar3; bVar8 = bVar1 < *pbVar6; if (bVar1 != *pbVar6) { LAB_00a6bd58: uVar4 = -(uint)bVar8 | 1; goto LAB_00a6bd5d; } if (bVar1 == 0) break; bVar1 = pbVar3[1]; bVar8 = bVar1 < pbVar6[1]; if (bVar1 != pbVar6[1]) goto LAB_00a6bd58; pbVar3 = pbVar3 + 2; pbVar6 = pbVar6 + 2; } while (bVar1 != 0); uVar4 = 0; LAB_00a6bd5d: if (uVar4 == 0) { return 1; } iVar7 = iVar7 + 1; } while (iVar7 < (int)local_8); } } uVar5 = (**(code **)((int)pvVar2 + 0x238))(); return uVar5; } //@@ 00a6bdc0 FUN_00a6bdc0 int FUN_00a6bdc0(int *param_1,int *param_2) { int iVar1; int iVar2; int iVar3; iVar3 = param_2[4] + param_2[3] + param_2[2]; iVar2 = param_1[4] + param_1[3] + param_1[2]; iVar1 = *param_1; if (iVar2 != iVar3) { return iVar2 - iVar3; } if (param_1[1] * iVar1 != param_2[1] * *param_2) { return param_1[1] * iVar1 - param_2[1] * *param_2; } if (iVar1 == *param_2) { return param_1[5] - param_2[5]; } return iVar1 - *param_2; } //@@ 00a6be30 FUN_00a6be30 undefined4 FUN_00a6be30(void) { void *_Base; size_t in_ECX; if (*(int *)(in_ECX + 0x90) != 0) { return 1; } _Base = (void *)(*DAT_00c736f8)(); if (_Base == (void *)0x0) { return 0; } qsort(_Base,in_ECX,0x18,FUN_00a6bdc0); if (*(int *)(in_ECX + 0x90) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0x90),g_glfwAllocatorUser); } *(void **)(in_ECX + 0x90) = _Base; *(size_t *)(in_ECX + 0x94) = in_ECX; return 1; } //@@ 00a6beb0 _glfwInputMonitor /* DB: GLFW monitor.c asserts 'monitor != NULL', 'action == GLFW_CONNECTED || action == GLFW_DISCONNECTED', 'placement == _GLFW_INSERT_FIRST || ...'; _glfw_calloc/memmove of the monitor array */ void _glfwInputMonitor(int param_1) { undefined4 *puVar1; int *piVar2; int iVar3; int in_ECX; int in_EDX; undefined4 local_14; undefined4 local_10; undefined4 local_c; int local_8; local_8 = in_EDX; if (in_ECX == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0x61); } if ((in_EDX != 0x40001) && (in_EDX != 0x40002)) { _wassert(L"action == GLFW_CONNECTED || action == GLFW_DISCONNECTED", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0x62); } if ((param_1 != 0) && (param_1 != 1)) { _wassert(L"placement == _GLFW_INSERT_FIRST || placement == _GLFW_INSERT_LAST", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,99); } if (in_EDX == 0x40001) { g_glfwMonitorCount = g_glfwMonitorCount + 1; if (DAT_00c73ca4 == (int *)0x0) { piVar2 = (int *)_glfw_calloc(); } else if (g_glfwMonitorCount * 4 == 0) { (*g_glfwDeallocate)(DAT_00c73ca4,g_glfwAllocatorUser); piVar2 = (int *)0x0; } else { piVar2 = (int *)(*DAT_00c73688)(DAT_00c73ca4,g_glfwMonitorCount * 4); if (piVar2 == (int *)0x0) { _glfwInputError(0x10005,0); piVar2 = (int *)0x0; } } DAT_00c73ca4 = piVar2; if (param_1 == 0) { memmove(piVar2 + 1,piVar2,g_glfwMonitorCount * 4 - 4); *DAT_00c73ca4 = in_ECX; } else { piVar2[g_glfwMonitorCount + -1] = in_ECX; } } else { puVar1 = DAT_00c73ca0; if (in_EDX == 0x40002) { for (; puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)*puVar1) { if (puVar1[0x10] == in_ECX) { (*DAT_00c73720)(puVar1,&local_c,¶m_1); (*DAT_00c73758)(puVar1,0,0,0,local_c,param_1,0); (*DAT_00c73734)(puVar1,&local_14,&local_10,0,0); (*DAT_00c7371c)(puVar1,local_14,local_10); } } iVar3 = 0; if (0 < g_glfwMonitorCount) { piVar2 = DAT_00c73ca4; do { if (*piVar2 == in_ECX) { g_glfwMonitorCount = g_glfwMonitorCount + -1; memmove(piVar2,piVar2 + 1,(g_glfwMonitorCount - iVar3) * 4); break; } iVar3 = iVar3 + 1; piVar2 = piVar2 + 1; } while (iVar3 < g_glfwMonitorCount); } in_EDX = local_8; } } if (DAT_00c74ca4 != (code *)0x0) { (*DAT_00c74ca4)(); } if ((in_EDX == 0x40002) && (in_ECX != 0)) { (*DAT_00c736e8)(); if (*(int *)(in_ECX + 0xb0) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0xb0),g_glfwAllocatorUser); } if (*(int *)(in_ECX + 0xb4) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0xb4),g_glfwAllocatorUser); } if (*(int *)(in_ECX + 0xb8) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0xb8),g_glfwAllocatorUser); } *(undefined4 *)(in_ECX + 0xb0) = 0; *(undefined4 *)(in_ECX + 0xb4) = 0; *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; if (*(int *)(in_ECX + 0xc0) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0xc0),g_glfwAllocatorUser); } if (*(int *)(in_ECX + 0xc4) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0xc4),g_glfwAllocatorUser); } if (*(int *)(in_ECX + 200) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 200),g_glfwAllocatorUser); } *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xc4) = 0; *(undefined4 *)(in_ECX + 200) = 0; *(undefined4 *)(in_ECX + 0xcc) = 0; if (*(int *)(in_ECX + 0x90) != 0) { (*g_glfwDeallocate)(*(int *)(in_ECX + 0x90),g_glfwAllocatorUser); } (*g_glfwDeallocate)(); } return; } //@@ 00a6c190 FUN_00a6c190 char * FUN_00a6c190(undefined4 param_1) { void *_Dst; char *_Dest; char *in_ECX; undefined4 in_EDX; _Dst = (void *)(*g_glfwAllocate)(0x1ac,g_glfwAllocatorUser); if (_Dst == (void *)0x0) { _glfwInputError(0x10005,0); _Dest = (char *)0x0; } else { _Dest = memset(_Dst,0,0x1ac); } *(undefined4 *)(_Dest + 0x84) = in_EDX; *(undefined4 *)(_Dest + 0x88) = param_1; strncpy(_Dest,in_ECX,0x7f); return _Dest; } //@@ 00a6c200 FUN_00a6c200 void FUN_00a6c200(void) { void *pvVar1; undefined4 *in_ECX; uint in_EDX; if (in_EDX == 0) { in_ECX[3] = 0; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; return; } if (0x7fffffff < in_EDX) { _glfwInputError(0x10004,"Allocation size overflow"); *in_ECX = 0; _glfwInputError(0x10004,"Allocation size overflow"); in_ECX[1] = 0; _glfwInputError(0x10004,"Allocation size overflow"); in_ECX[3] = in_EDX; in_ECX[2] = 0; return; } pvVar1 = (void *)(*g_glfwAllocate)(in_EDX * 2,g_glfwAllocatorUser); if (pvVar1 == (void *)0x0) { _glfwInputError(0x10005,0); *in_ECX = 0; } else { pvVar1 = memset(pvVar1,0,in_EDX * 2); *in_ECX = pvVar1; } pvVar1 = (void *)(*g_glfwAllocate)(in_EDX * 2,g_glfwAllocatorUser); if (pvVar1 == (void *)0x0) { _glfwInputError(0x10005,0); in_ECX[1] = 0; } else { pvVar1 = memset(pvVar1,0,in_EDX * 2); in_ECX[1] = pvVar1; } pvVar1 = (void *)(*g_glfwAllocate)(in_EDX * 2,g_glfwAllocatorUser); if (pvVar1 == (void *)0x0) { _glfwInputError(0x10005,0); in_ECX[3] = in_EDX; in_ECX[2] = 0; return; } pvVar1 = memset(pvVar1,0,in_EDX * 2); in_ECX[3] = in_EDX; in_ECX[2] = pvVar1; return; } //@@ 00a6c340 FUN_00a6c340 void FUN_00a6c340(void) { int *in_ECX; if (*in_ECX != 0) { (*g_glfwDeallocate)(*in_ECX,g_glfwAllocatorUser); } if (in_ECX[1] != 0) { (*g_glfwDeallocate)(in_ECX[1],g_glfwAllocatorUser); } if (in_ECX[2] != 0) { (*g_glfwDeallocate)(in_ECX[2],g_glfwAllocatorUser); } *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; return; } //@@ 00a6c390 FUN_00a6c390 void FUN_00a6c390(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Input::InputDeviceKeyboard::vftable; FUN_00a1e2c0(); *in_ECX = KAGE::Input::InputDeviceBase::vftable; FUN_00a1e2c0(); FUN_004b3950(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x370); } return; } //@@ 00a6c3e0 FUN_00a6c3e0 void FUN_00a6c3e0(undefined4 param_1) { memset(&DAT_00c78c10,0,0x15d); memset(&DAT_00c78ab0,0,0x15d); memset(&DAT_00c78950,0,0x15d); FUN_00a6ce70(); keyboard_key_names_init(); FUN_00a1e210(param_1); return; } //@@ 00a6c440 FUN_00a6c440 char * FUN_00a6c440(void) { return "Keyboard"; } //@@ 00a6c450 FUN_00a6c450 undefined * FUN_00a6c450(uint param_1) { undefined *puVar1; if (param_1 < 0x15d) { return &DAT_00c75db0 + param_1 * 0x20; } puVar1 = (undefined *)FUN_00a1e360(); return puVar1; } //@@ 00a6c480 FUN_00a6c480 void FUN_00a6c480(void) { int *this; void *_Src; int iVar1; int in_ECX; uint count; void *_Dst; size_t _Size; iVar1 = DAT_00c799fc; _Src = DAT_00c799f8; this = (int *)(in_ECX + 0x10); if ((void **)this != &DAT_00c799f8) { _Dst = (void *)*this; count = DAT_00c799fc - (int)DAT_00c799f8 >> 4; if ((uint)(*(int *)(in_ECX + 0x18) - (int)_Dst >> 4) < count) { vector16_clear_and_reserve(this,count); _Dst = (void *)*this; } _Size = iVar1 - (int)_Src; memmove(_Dst,_Src,_Size); *(size_t *)(in_ECX + 0x14) = (int)_Dst + _Size; } return; } //@@ 00a6c4e0 FUN_00a6c4e0 uint FUN_00a6c4e0(void) { uint in_EAX; int in_ECX; if ((*(byte *)(in_ECX + 8) & 2) != 0) { in_EAX = 0; do { if ((&DAT_00c78c10)[in_EAX] != '\0') { return CONCAT31((int3)(in_EAX >> 8),1); } in_EAX = in_EAX + 1; } while (in_EAX < 0x15d); } return in_EAX & 0xffffff00; } //@@ 00a6c510 FUN_00a6c510 bool FUN_00a6c510(uint param_1) { int in_ECX; if (((*(byte *)(in_ECX + 8) & 2) == 0) || (0x15c < param_1)) { return false; } return (&DAT_00c78c10)[param_1] != '\0'; } //@@ 00a6c540 FUN_00a6c540 undefined4 FUN_00a6c540(uint param_1) { int in_ECX; if (((((*(byte *)(in_ECX + 8) & 2) == 0) || (0x15c < param_1)) || ((&DAT_00c78c10)[param_1] == '\0')) || ((&DAT_00c78950)[param_1] != '\0')) { return 0; } return 1; } //@@ 00a6c580 FUN_00a6c580 float10 FUN_00a6c580(float param_1) { char *pcVar1; int in_ECX; if (((*(byte *)(in_ECX + 8) & 2) == 0) || (0x15c < (uint)param_1)) { return (float10)0; } pcVar1 = &DAT_00c78c10 + (int)param_1; param_1 = 1.0; if (*pcVar1 == '\0') { param_1 = 0.0; } return (float10)param_1; } //@@ 00a6c5c0 FUN_00a6c5c0 uint FUN_00a6c5c0(void) { uint uVar1; int in_ECX; if ((*(byte *)(in_ECX + 8) & 2) != 0) { uVar1 = 0; do { if (((&DAT_00c78c10)[uVar1] != '\0') && ((&DAT_00c78950)[uVar1] == '\0')) { return uVar1; } uVar1 = uVar1 + 1; } while (uVar1 < 0x15d); } return 0xffffffff; } //@@ 00a6c5f0 FUN_00a6c5f0 void FUN_00a6c5f0(uint param_1) { if (param_1 < 0x15d) { (&DAT_00c78950)[param_1] = 1; } return; } //@@ 00a6c610 FUN_00a6c610 int FUN_00a6c610(void) { int *piVar1; int in_ECX; int local_c [2]; piVar1 = glfw_get_window_size(local_c,in_ECX); return *piVar1; } //@@ 00a6c630 FUN_00a6c630 int FUN_00a6c630(void) { int *piVar1; int in_ECX; int local_c [2]; piVar1 = glfw_get_window_size(local_c,in_ECX); return piVar1[1]; } //@@ 00a6c650 KAGE::Input::InputDeviceKeyboard::update /* DB: ? InputDeviceKeyboard vtable slot 30 (InputDeviceGamepad slot 30 = 00a22940): copies current key-state block (0x57 dwords) to previous, polls the GLFW window (GLFW_3.4 input.c asserts "window != NULL", cursor mode/position, glfw_get_window_size) */ undefined4 KAGE::Input::InputDeviceKeyboard::update(void) { char cVar1; byte bVar2; void *pvVar3; int *piVar4; int *in_ECX; int iVar5; int extraout_ECX; int extraout_ECX_00; int extraout_ECX_01; int extraout_ECX_02; int unused; int unaff_ESI; undefined4 *puVar6; undefined4 *puVar7; double dVar8; int iStack_98; float local_8c [2]; int *local_84; undefined8 local_80; undefined8 uStack_78; int iStack_70; int iStack_6c; int iStack_68; int iStack_64; int iStack_60; undefined8 uStack_5c; int iStack_48; int iStack_44; int local_40; int local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; uint local_2c; undefined4 local_28; bVar2 = (byte)DAT_00c57b1c & 4; puVar6 = (undefined4 *)&DAT_00c78c10; puVar7 = (undefined4 *)&DAT_00c78950; for (iVar5 = 0x57; iVar5 != 0; iVar5 = iVar5 + -1) { *puVar7 = *puVar6; puVar6 = puVar6 + 1; puVar7 = puVar7 + 1; } *(undefined1 *)puVar7 = *(undefined1 *)puVar6; puVar6 = &DAT_00c78ab0; puVar7 = (undefined4 *)&DAT_00c78c10; for (iVar5 = 0x57; iVar5 != 0; iVar5 = iVar5 + -1) { *puVar7 = *puVar6; puVar6 = puVar6 + 1; puVar7 = puVar7 + 1; } *(undefined1 *)puVar7 = *(undefined1 *)puVar6; pvVar3 = g_glfwWindow; local_84 = in_ECX; if (bVar2 != 0) { iVar5 = 0; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x2f9); iVar5 = extraout_ECX; } if (_glfw != 0) { cVar1 = *(char *)((int)pvVar3 + 0x74); if (cVar1 == '\x03') { *(undefined1 *)((int)pvVar3 + 0x74) = 0; } else if (cVar1 != '\x01') goto LAB_00a6c6cb; pvVar3 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x310); iVar5 = extraout_ECX_00; } local_80 = 0.0; uStack_78 = 0.0; if (_glfw == 0) { _glfwInputError(0x10001,0); iVar5 = extraout_ECX_01; } else if (*(int *)((int)pvVar3 + 0x70) == 0x34003) { local_80 = *(double *)((int)pvVar3 + 0x1e0); uStack_78 = *(double *)((int)pvVar3 + 0x1e8); } else { (*DAT_00c736a0)(pvVar3,&local_80,&uStack_78); iVar5 = extraout_ECX_02; } piVar4 = glfw_get_window_size((int *)local_8c,iVar5); if (local_80 <= 0.0) { local_80 = 0.0; } dVar8 = (double)*piVar4 + __uint_to_double_fixup[-(*piVar4 >> 0x1f)]; if (dVar8 <= local_80) { local_80 = dVar8; } piVar4 = glfw_get_window_size((int *)local_8c,unused); if (uStack_78 <= 0.0) { uStack_78 = 0.0; } local_38 = 0; local_3c = 0; local_30 = 0; local_34 = 0; local_28 = 0; dVar8 = (double)piVar4[1] + __uint_to_double_fixup[-(piVar4[1] >> 0x1f)]; local_2c = 0; if (dVar8 <= uStack_78) { uStack_78 = dVar8; } local_8c[0] = (float)uStack_78; (**(code **)(*local_84 + 0x68))(&local_40,1,0xcdcd); iStack_68 = local_38; iStack_64 = local_34; uStack_5c._0_4_ = local_2c; uStack_5c._4_4_ = local_28; iStack_6c = iStack_98; local_80._4_4_ = 1; iStack_60 = 0xcdcd; iStack_70 = unaff_ESI; memset(local_84 + 0x3a,0,0x284); if ((local_2c & 3) == 0) { iStack_64 = iStack_98; uStack_78._4_4_ = iStack_98; uStack_5c = CONCAT44(uStack_5c._4_4_,3); iStack_68 = unaff_ESI; uStack_78._0_4_ = unaff_ESI; } else { iStack_68 = local_40; iStack_64 = local_3c; uStack_78._0_4_ = iStack_48; uStack_78._4_4_ = iStack_44; uStack_5c = CONCAT44(uStack_5c._4_4_,2); } if ((char)uStack_5c == '\0') { return 1; } local_84[0x3a] = local_80._4_4_; local_84[0x3b] = (int)uStack_78; local_84[0x3c] = uStack_78._4_4_; local_84[0x3d] = iStack_70; local_84[0x3e] = iStack_6c; local_84[0x3f] = iStack_68; local_84[0x40] = iStack_64; local_84[0x41] = iStack_60; *(undefined8 *)(local_84 + 0x42) = uStack_5c; local_84[0xda] = local_84[0xda] + 1; return 1; } _glfwInputError(0x10001,0); } LAB_00a6c6cb: memset(local_84 + 0x3a,0,0x284); return 1; } //@@ 00a6c960 keyboard_key_names_init /* DB: ? only caller FUN_00a6c3e0 (input init: clears three 0x15d key tables then calls it); memset 0x2ba0 table of 32-byte names, 'A'..'Z', '0'..'9', strcpy_s "Space","Quote","Comma","Minus","Backspace","F1".."F25","CAPS LOCK"... */ void keyboard_key_names_init(void) { uint uVar1; undefined1 *puVar2; char *pcVar3; char cVar4; memset(&DAT_00c75db0,0,0x2ba0); uVar1 = 0x41; puVar2 = &DAT_00c765d0; do { *puVar2 = (char)uVar1; puVar2 = puVar2 + 0x20; uVar1 = uVar1 + 1; } while (uVar1 < 0x5b); cVar4 = '\0'; pcVar3 = &DAT_00c763b0; do { *pcVar3 = cVar4 + '0'; cVar4 = cVar4 + '\x01'; pcVar3 = pcVar3 + 0x20; } while ((int)pcVar3 < 0xc764d1); strcpy_s(&DAT_00c761b0,0x20,"Space"); strcpy_s(&DAT_00c76290,0x20,"Quote"); strcpy_s(&DAT_00c76330,0x20,"Comma"); strcpy_s(&DAT_00c76350,0x20,"Minus"); strcpy_s(&DAT_00c76370,0x20,"Period"); strcpy_s(&DAT_00c76390,0x20,"Slash"); strcpy_s(&DAT_00c76510,0x20,"Semicolon"); strcpy_s(&DAT_00c76550,0x20,"Equals"); strcpy_s(&DAT_00c76910,0x20,"L Curly"); strcpy_s(&DAT_00c76930,0x20,"Backslash"); strcpy_s(&DAT_00c76950,0x20,"R Brace"); strcpy_s(&DAT_00c769b0,0x20,"Grave"); strcpy_s(&DAT_00c771d0,0x20,"SQUIGGLE!"); strcpy_s(&DAT_00c771f0,0x20,"World"); strcpy_s(&DAT_00c77db0,0x20,"Esc"); strcpy_s(&DAT_00c77dd0,0x20,"Enter"); strcpy_s(&DAT_00c77df0,0x20,"Tab"); strcpy_s(&DAT_00c77e10,0x20,"Backspace"); strcpy_s(&DAT_00c77e30,0x20,"Insert"); strcpy_s(&DAT_00c77e50,0x20,"Delete"); strcpy_s(&DAT_00c77e70,0x20,"Right"); strcpy_s(&DAT_00c77e90,0x20,"Left"); strcpy_s(&DAT_00c77eb0,0x20,"Down"); strcpy_s(&DAT_00c77ed0,0x20,"Up"); strcpy_s(&DAT_00c77ef0,0x20,"PgUp"); strcpy_s(&DAT_00c77f10,0x20,"PgDn"); strcpy_s(&DAT_00c77f30,0x20,"Home"); strcpy_s(&DAT_00c77f50,0x20,"End"); strcpy_s(&DAT_00c780b0,0x20,"CAPS LOCK"); strcpy_s(&DAT_00c780d0,0x20,"Squirrel"); strcpy_s(&DAT_00c780f0,0x20,"Num Lock"); strcpy_s(&DAT_00c78110,0x20,"PRTSCN"); strcpy_s(&DAT_00c78130,0x20,"Pause"); strcpy_s(&DAT_00c781f0,0x20,"F1"); strcpy_s(&DAT_00c78210,0x20,"F2"); strcpy_s(&DAT_00c78230,0x20,"F3"); strcpy_s(&DAT_00c78250,0x20,"F4"); strcpy_s(&DAT_00c78270,0x20,"F5"); strcpy_s(&DAT_00c78290,0x20,"F6"); strcpy_s(&DAT_00c782b0,0x20,"F7"); strcpy_s(&DAT_00c782d0,0x20,"F8"); strcpy_s(&DAT_00c782f0,0x20,"F9"); strcpy_s(&DAT_00c78310,0x20,"F10"); strcpy_s(&DAT_00c78330,0x20,"F11"); strcpy_s(&DAT_00c78350,0x20,"F12"); strcpy_s(&DAT_00c78370,0x20,"F13"); strcpy_s(&DAT_00c78390,0x20,"F14"); strcpy_s(&DAT_00c783b0,0x20,"F15"); strcpy_s(&DAT_00c783d0,0x20,"F16"); strcpy_s(&DAT_00c783f0,0x20,"F17"); strcpy_s(&DAT_00c78410,0x20,"F18"); strcpy_s(&DAT_00c78430,0x20,"F19"); strcpy_s(&DAT_00c78450,0x20,"F20"); strcpy_s(&DAT_00c78470,0x20,"F21"); strcpy_s(&DAT_00c78490,0x20,"F22"); strcpy_s(&DAT_00c784b0,0x20,"F23"); strcpy_s(&DAT_00c784d0,0x20,"F24"); strcpy_s(&DAT_00c784f0,0x20,"F25"); strcpy_s(&DAT_00c785b0,0x20,"Numpad 0"); strcpy_s(&DAT_00c785d0,0x20,"Numpad 1"); strcpy_s(&DAT_00c785f0,0x20,"Numpad 2"); strcpy_s(&DAT_00c78610,0x20,"Numpad 3"); strcpy_s(&DAT_00c78630,0x20,"Numpad 4"); strcpy_s(&DAT_00c78650,0x20,"Numpad 5"); strcpy_s(&DAT_00c78670,0x20,"Numpad 6"); strcpy_s(&DAT_00c78690,0x20,"Numpad 7"); strcpy_s(&DAT_00c786b0,0x20,"Numpad 8"); strcpy_s(&DAT_00c786d0,0x20,"Numpad 9"); strcpy_s(&DAT_00c786f0,0x20,"Numpad ."); strcpy_s(&DAT_00c78710,0x20,"Numpad /"); strcpy_s(&DAT_00c78730,0x20,"Numpad x"); strcpy_s(&DAT_00c78750,0x20,"Numpad -"); strcpy_s(&DAT_00c78770,0x20,"Numpad +"); strcpy_s(&DAT_00c78790,0x20,"Num Enter"); strcpy_s(&DAT_00c787b0,0x20,"Numpad ="); strcpy_s(&DAT_00c78830,0x20,"L Shift"); strcpy_s(&DAT_00c78850,0x20,"L Ctrl"); strcpy_s(&DAT_00c78870,0x20,"L Alt"); strcpy_s(&DAT_00c78890,0x20,"L OS Key"); strcpy_s(&DAT_00c788b0,0x20,"R Shift"); strcpy_s(&DAT_00c788d0,0x20,"R Ctrl"); strcpy_s(&DAT_00c788f0,0x20,"R Alt"); strcpy_s(&DAT_00c78910,0x20,"R OS Key"); strcpy_s(&DAT_00c78930,0x20,"Menu"); return; } //@@ 00a6ce70 FUN_00a6ce70 void FUN_00a6ce70(void) { void *pvVar1; pvVar1 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x3b5); } if (_glfw == 0) { _glfwInputError(0x10001,0); return; } *(code **)((int)pvVar1 + 0x2a4) = FUN_00a6cec0; return; } //@@ 00a6cec0 FUN_00a6cec0 void FUN_00a6cec0(undefined4 param_1,uint param_2,undefined4 param_3,int param_4) { if (param_2 < 0x15d) { if (param_4 == 0) { *(undefined1 *)((int)&DAT_00c78ab0 + param_2) = 0; return; } if (param_4 == 1) { *(undefined1 *)((int)&DAT_00c78ab0 + param_2) = 1; } } return; } //@@ 00a6cef0 FUN_00a6cef0 undefined4 FUN_00a6cef0(undefined4 param_1,int param_2,int param_3,int param_4) { undefined4 uVar1; if (param_2 != 0x219) { /* WARNING: Could not recover jumptable at 0x00a6cf01. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar1 = DefWindowProcA(); return uVar1; } if (((param_3 == 0x8000) || (param_3 == 0x8004)) && (*(int *)(param_4 + 4) == 5)) { DAT_00c7ac6b = 1; } return 0; } //@@ 00a6cf80 FUN_00a6cf80 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a6cf80(void) { ATOM AVar1; HMODULE pHVar2; uint flags; code *pcVar3; int iVar4; undefined4 uVar5; undefined *puVar6; undefined4 *puVar7; undefined4 uVar8; char *pcVar9; undefined1 auStack_30 [4]; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_30; if (DAT_00c7e300 != '\0') { return; } _DAT_00c7e304 = 0; pHVar2 = LoadLibraryA("XInput1_4.dll"); if ((pHVar2 == (HMODULE)0x0) && (pHVar2 = LoadLibraryA("bin\\XInput1_4.dll"), pHVar2 == (HMODULE)0x0)) { pHVar2 = LoadLibraryA("XInput1_3.dll"); if ((pHVar2 != (HMODULE)0x0) || (pHVar2 = LoadLibraryA("bin\\XInput1_3.dll"), pHVar2 != (HMODULE)0x0)) { flags = 4; pcVar9 = "Failed to load Xinput 1.4, Using XInput 1.3, Some input devices may not work properly \n"; _DAT_00c7e304 = 1; goto LAB_00a6d055; } KAGE_LogMessage(8,(byte *) "Gamepad_init couldn\'t load XInput1_4.dll or XInput1_3.dll; proceeding with DInput only\n" ); DAT_00c7e301 = 0; _DAT_00c7e2f8 = (FARPROC)0x0; _DAT_00c7e304 = 0; } else { flags = 1; pcVar9 = "Using XInput 1.4 \n"; _DAT_00c7e304 = 2; LAB_00a6d055: KAGE_LogMessage(flags,(byte *)pcVar9); _DAT_00c7e2f8 = (FARPROC)0x0; DAT_00c7e301 = 1; DAT_00c7e29c = GetProcAddress(pHVar2,(LPCSTR)0x64); DAT_00c7e2dc = GetProcAddress(pHVar2,"XInputGetState"); DAT_00c7e2f0 = GetProcAddress(pHVar2,"XInputSetState"); DAT_00c7e2f4 = GetProcAddress(pHVar2,"XInputGetCapabilities"); pcVar3 = GetProcAddress_exref; if (_DAT_00c7e304 == 2) { _DAT_00c7e2f8 = GetProcAddress(pHVar2,(LPCSTR)0x6c); if (_DAT_00c7e2f8 == (FARPROC)0x0) { KAGE_LogMessage(8,(byte *) "XInputGetCapabilitiesEx_proc function not found in the XInput DLL. \n"); } goto LAB_00a6d013; } } pcVar3 = GetProcAddress_exref; LAB_00a6d013: pHVar2 = LoadLibraryA("DINPUT8.dll"); if (pHVar2 == (HMODULE)0x0) { KAGE_LogMessage(8,(byte *)"Gamepad_init fatal error: Couldn\'t load DINPUT8.dll \n"); /* WARNING: Subroutine does not return */ abort(); } pcVar3 = (code *)(*pcVar3)(pHVar2,"DirectInput8Create"); uVar8 = 0; puVar7 = &DAT_00c7e2fc; puVar6 = &UNK_00ba1e80; uVar5 = 0x800; _DAT_00c78d90 = pcVar3; pHVar2 = GetModuleHandleA((LPCSTR)0x0); iVar4 = (*pcVar3)(pHVar2,uVar5,puVar6,puVar7,uVar8); if (iVar4 != 0) { KAGE_LogMessage(8,(byte *)"Warning: DirectInput8Create returned 0x%X\n"); } DAT_00c7e300 = '\x01'; DAT_00c7ac6b = 1; FUN_00a6dab0(); memset(&DAT_00c7e2a0,0,0x3c); _DAT_00c7e2a0 = CoInitializeEx((LPVOID)0x0,2); if (_DAT_00c7e2a0 == -0x7ffefefa) { _DAT_00c7e2a0 = CoInitializeEx((LPVOID)0x0,0); } _DAT_00c7e2b8 = GetModuleHandleA((LPCSTR)0x0); _DAT_00c7e2cc = "Message"; _DAT_00c7e2ac = FUN_00a6cef0; _DAT_00c7e2a4 = 0x30; AVar1 = RegisterClassExA((WNDCLASSEXA *)&DAT_00c7e2a4); if (AVar1 == 0) { pcVar9 = "Failed to create register class for joystick autodetect"; } else { DAT_00c7e2d4 = CreateWindowExA(0,"Message",(LPCSTR)0x0,0,0,0,0,0,(HWND)0xfffffffd,(HMENU)0x0, (HINSTANCE)0x0,(LPVOID)0x0); if (DAT_00c7e2d4 == (HWND)0x0) { pcVar9 = "Failed to create message window for joystick autodetect"; } else { uStack_24 = 0; uStack_10 = 0; uStack_2c = 0x20; uStack_28 = 5; uStack_20 = 0x4d1e55b2; uStack_1c = 0x11cff16f; uStack_18 = 0x1100cb88; uStack_14 = 0x30000011; _DAT_00c7e2d8 = RegisterDeviceNotificationA(DAT_00c7e2d4,&uStack_2c,0); if (_DAT_00c7e2d8 != (HDEVNOTIFY)0x0) { return; } pcVar9 = "Failed to create notify device for joystick autodetect"; _DAT_00c7e2d8 = (HDEVNOTIFY)0x0; } } KAGE_LogMessage(1,(byte *)pcVar9); func_0x00a6cf30(); return; } //@@ 00a6d270 FUN_00a6d270 undefined4 FUN_00a6d270(int param_1,int param_2) { int iVar1; iVar1 = *(int *)(param_2 + 0x10); *(int *)(param_2 + 0x10) = iVar1 + 1; if ((*(byte *)(param_1 + 0x18) & 0x10) != 0) { *(int *)(param_2 + 0x10) = iVar1 + 2; } return 1; } //@@ 00a6d2a0 FUN_00a6d2a0 undefined4 FUN_00a6d2a0(undefined4 param_1,int param_2) { *(int *)(param_2 + 0x14) = *(int *)(param_2 + 0x14) + 1; return 1; } //@@ 00a6d2c0 deviceObjectCallback /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_joystick.c DirectInput object enum callback: axes/sliders/buttons/POVs into the object array, DIPROP_RANGE SetProperty ("Warning: IDIrectInputDevice8_SetProperty returned 0x%X"); pushed as a callback at 00a6d989 */ undefined4 deviceObjectCallback(int param_1,int param_2) { int iVar1; int iVar2; int *piVar3; int *piVar4; uint uVar5; int *piVar6; int iVar7; bool bVar8; int local_44; int local_40; int local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; uint local_c; local_c = __security_cookie ^ (uint)&local_44; local_40 = param_2; local_3c = param_1; iVar1 = *(int *)(param_2 + 0x20); iVar7 = *(int *)(param_2 + 0x10) + 1; *(int *)(param_2 + 0x10) = iVar7; if ((*(byte *)(param_1 + 0x18) & 0x10) != 0) { iVar2 = *(int *)(iVar1 + 0x20) * 4 + 0x20; *(int *)(*(int *)(iVar1 + 0x24) + -8 + iVar7 * 8) = iVar2; *(undefined1 *)(*(int *)(iVar1 + 0x24) + -4 + *(int *)(param_2 + 0x10) * 8) = 1; *(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1; *(int *)(*(int *)(iVar1 + 0x24) + -8 + *(int *)(param_2 + 0x10) * 8) = iVar2; *(undefined1 *)(*(int *)(iVar1 + 0x24) + -4 + *(int *)(param_2 + 0x10) * 8) = 1; *(int *)(iVar1 + 0x20) = *(int *)(iVar1 + 0x20) + 1; return 1; } piVar4 = (int *)(param_1 + 4); piVar6 = &DAT_00ba1e40; uVar5 = 0xc; piVar3 = piVar4; do { if (*piVar3 != *piVar6) { piVar6 = &DAT_00ba1e00; uVar5 = 0xc; piVar3 = piVar4; goto LAB_00a6d368; } piVar3 = piVar3 + 1; piVar6 = piVar6 + 1; bVar8 = 3 < uVar5; uVar5 = uVar5 - 4; } while (bVar8); iVar2 = 0; goto LAB_00a6d45d; while( true ) { piVar3 = piVar3 + 1; piVar6 = piVar6 + 1; bVar8 = uVar5 < 4; uVar5 = uVar5 - 4; if (bVar8) break; LAB_00a6d368: if (*piVar3 != *piVar6) { piVar6 = &DAT_00ba1df0; uVar5 = 0xc; piVar3 = piVar4; goto LAB_00a6d390; } } iVar2 = 4; goto LAB_00a6d45d; while( true ) { piVar3 = piVar3 + 1; piVar6 = piVar6 + 1; bVar8 = uVar5 < 4; uVar5 = uVar5 - 4; if (bVar8) break; LAB_00a6d390: if (*piVar3 != *piVar6) { piVar6 = &DAT_00ba1e20; uVar5 = 0xc; piVar3 = piVar4; goto LAB_00a6d3b7; } } iVar2 = 8; goto LAB_00a6d45d; while( true ) { piVar3 = piVar3 + 1; piVar6 = piVar6 + 1; bVar8 = uVar5 < 4; uVar5 = uVar5 - 4; if (bVar8) break; LAB_00a6d3b7: if (*piVar3 != *piVar6) { piVar6 = &DAT_00ba1e10; uVar5 = 0xc; piVar3 = piVar4; goto LAB_00a6d3e0; } } iVar2 = 0xc; goto LAB_00a6d45d; while( true ) { piVar3 = piVar3 + 1; piVar6 = piVar6 + 1; bVar8 = uVar5 < 4; uVar5 = uVar5 - 4; if (bVar8) break; LAB_00a6d3e0: if (*piVar3 != *piVar6) { piVar6 = &DAT_00ba1e70; uVar5 = 0xc; piVar3 = piVar4; goto LAB_00a6d404; } } iVar2 = 0x10; goto LAB_00a6d45d; while( true ) { piVar3 = piVar3 + 1; piVar6 = piVar6 + 1; bVar8 = uVar5 < 4; uVar5 = uVar5 - 4; if (bVar8) break; LAB_00a6d404: if (*piVar3 != *piVar6) { piVar3 = &DAT_00ba1e60; uVar5 = 0xc; goto LAB_00a6d426; } } iVar2 = 0x14; goto LAB_00a6d45d; while( true ) { piVar4 = piVar4 + 1; piVar3 = piVar3 + 1; bVar8 = uVar5 < 4; uVar5 = uVar5 - 4; if (bVar8) break; LAB_00a6d426: if (*piVar4 != *piVar3) { iVar2 = -1; goto LAB_00a6d45d; } } iVar2 = *(int *)(iVar1 + 0x1c) * 4 + 0x18; *(int *)(iVar1 + 0x1c) = *(int *)(iVar1 + 0x1c) + 1; iVar7 = *(int *)(param_2 + 0x10); LAB_00a6d45d: *(int *)(*(int *)(iVar1 + 0x24) + -8 + iVar7 * 8) = iVar2; *(undefined1 *)(*(int *)(iVar1 + 0x24) + -4 + *(int *)(param_2 + 0x10) * 8) = 0; local_1c = *(undefined4 *)(param_1 + 0x18); local_24 = 0x18; local_20 = 0x10; local_18 = 2; local_14 = 0xffff8000; local_10 = 0x7fff; local_44 = iVar1; iVar7 = (**(code **)(**(int **)(iVar1 + 0x14) + 0x18))(*(int **)(iVar1 + 0x14),4,&local_24); if (iVar7 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDIrectInputDevice8_SetProperty returned 0x%X\n"); } local_3c = *(undefined4 *)(param_1 + 0x18); local_44 = 0x14; local_40 = 0x10; uStack_38 = 2; uStack_34 = 0; iVar1 = (**(code **)(**(int **)(iVar1 + 0x14) + 0x18))(*(int **)(iVar1 + 0x14),5,&local_44); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDIrectInputDevice8_SetProperty returned 0x%X\n"); } return 1; } //@@ 00a6d530 FUN_00a6d530 undefined4 FUN_00a6d530(undefined4 param_1,int param_2) { *(int *)(*(int *)(*(int *)(param_2 + 0x20) + 0x28) + *(int *)(param_2 + 0x14) * 4) = *(int *)(param_2 + 0x14) + 0x30; *(int *)(param_2 + 0x14) = *(int *)(param_2 + 0x14) + 1; return 1; } //@@ 00a6d560 FUN_00a6d560 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a6d560(int param_1) { code *pcVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; UINT UVar6; PRAWINPUTDEVICELIST pRawInputDeviceList; int *piVar7; int iVar8; HWND pHVar9; undefined1 *puVar10; char *pcVar11; void *pvVar12; int *unaff_ESI; uint uVar13; int *piVar14; uint uVar15; uint uVar16; bool bVar17; int *piVar18; int *piVar19; int iVar20; undefined1 auStack_264 [4]; undefined4 uStack_260; int *piStack_25c; int iStack_258; int local_254; int aiStack_250 [5]; undefined2 uStack_23c; undefined2 uStack_238; char acStack_210 [516]; uint local_c; local_c = __security_cookie ^ (uint)auStack_264; local_254 = param_1; uStack_260 = (int *)CONCAT13(1,(undefined3)uStack_260); KAGE_LogMessage(1,(byte *)"DInput checking if device supports XInput (v = %d, p = %d) \n"); if (DAT_00c7e301 != '\0') { uVar16 = 0; do { piVar7 = *(int **)((int)&PTR_DAT_00ba1d80 + uVar16); uVar13 = 0xc; piVar14 = (int *)(param_1 + 0x14); while (*piVar14 == *piVar7) { piVar14 = piVar14 + 1; piVar7 = piVar7 + 1; bVar17 = uVar13 < 4; uVar13 = uVar13 - 4; if (bVar17) { KAGE_LogMessage(1,(byte *)"Device is compatible with XInput \n"); return 1; } } uVar16 = uVar16 + 4; } while (uVar16 < 0x20); piStack_25c = (int *)0x0; UVar6 = GetRawInputDeviceList((PRAWINPUTDEVICELIST)0x0,(PUINT)&piStack_25c,8); if ((UVar6 != 0xffffffff) && (piStack_25c != (int *)0x0)) { pRawInputDeviceList = malloc((int)piStack_25c << 3); KAGE_LogMessage(1,(byte *)"Checking device info using Raw Input \n"); UVar6 = GetRawInputDeviceList(pRawInputDeviceList,(PUINT)&piStack_25c,8); if ((UVar6 == 0xffffffff) && (piVar14 = (int *)0x0, piVar7 = piStack_25c, piStack_25c != (int *)0x0)) { do { aiStack_250[1] = 0x20; aiStack_250[2] = 0x200; aiStack_250[3] = 0x20; if (pRawInputDeviceList[(int)piVar14].dwType == 2) { UVar6 = GetRawInputDeviceInfoA (pRawInputDeviceList[(int)piVar14].hDevice,0x2000000b,aiStack_250 + 3, (PUINT)(aiStack_250 + 1)); if (((UVar6 != 0xffffffff) && (CONCAT22(uStack_238,uStack_23c) == *(int *)(local_254 + 0x14))) && (UVar6 = GetRawInputDeviceInfoA (pRawInputDeviceList[(int)piVar14].hDevice,0x20000007,acStack_210, (PUINT)(aiStack_250 + 2)), UVar6 != 0xffffffff)) { KAGE_LogMessage(1,(byte *)"Raw Device Info: %s \n"); pcVar11 = strstr(acStack_210,"IG_"); if (pcVar11 != (char *)0x0) { KAGE_LogMessage(1,(byte *)"Device is compatible with XInput \n"); return 1; } goto LAB_00a6d6dc; } piVar7 = piStack_25c; } piVar14 = (int *)((int)piVar14 + 1); } while (piVar14 < piVar7); } free(pRawInputDeviceList); } } LAB_00a6d6dc: KAGE_LogMessage(1,(byte *)"Device is not compatible with XInput \n"); uVar13 = 0; uVar16 = (int)DAT_00c79bf0 - (int)g_gamepadDevices >> 2; piStack_25c = (int *)(local_254 + 4); if (uVar16 != 0) { do { uVar15 = 0xc; piVar7 = *(int **)((int)g_gamepadDevices[uVar13] + 0x20); piVar14 = piStack_25c; while (piVar7 = piVar7 + 1, *piVar7 == *piVar14) { piVar14 = piVar14 + 1; bVar17 = uVar15 < 4; uVar15 = uVar15 - 4; if (bVar17) { return 1; } } uVar13 = uVar13 + 1; } while (uVar13 < uVar16); } KAGE_LogMessage(1,(byte *)"Using Direct Input to initialize new input device \n"); piVar7 = aiStack_250; iVar8 = (**(code **)(*DAT_00c7e2fc + 0xc))(DAT_00c7e2fc,piStack_25c,piVar7,0); if (iVar8 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDirectInput8_CreateDevice returned 0x%X\n"); } piVar14 = (int *)(auStack_264 + -4); piVar18 = uStack_260; iVar8 = (**(code **)*uStack_260)(uStack_260,&DAT_00ba1e30); if (iVar8 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDirectInputDevice8_QueryInterface returned 0x%X\n"); } (**(code **)(*unaff_ESI + 8))(unaff_ESI); pcVar1 = *(code **)(*piVar7 + 0x34); pHVar9 = GetActiveWindow(); iVar20 = 10; iVar8 = (*pcVar1)(piVar7); if (iVar8 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDirectInputDevice8_SetCooperativeLevel returned 0x%X\n"); } iVar8 = (**(code **)(*piVar14 + 0x2c))(piVar14); if (iVar8 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDirectInputDevice8_SetDataFormat returned 0x%X\n"); } piVar7 = &iStack_258; iStack_258 = 0x14; local_254 = 0x10; aiStack_250[0] = 0; aiStack_250[1] = 0; aiStack_250[2] = 0xffffffff; iVar8 = (**(code **)(*piVar18 + 0x18))(piVar18,1); if ((iVar8 != 2) && (iVar8 != 0)) { KAGE_LogMessage(8,(byte *)"Warning: IDirectInputDevice8_SetProperty returned 0x%X\n"); } piVar14 = malloc(0x24); puVar10 = malloc(0x30); uVar2 = *(undefined4 *)(iVar20 + 4); uVar3 = *(undefined4 *)(iVar20 + 8); uVar4 = *(undefined4 *)(iVar20 + 0xc); uVar5 = *(undefined4 *)(iVar20 + 0x10); *puVar10 = 0; *(undefined4 *)(puVar10 + 4) = uVar2; *(undefined4 *)(puVar10 + 8) = uVar3; *(undefined4 *)(puVar10 + 0xc) = uVar4; *(undefined4 *)(puVar10 + 0x10) = uVar5; *(HWND *)(puVar10 + 0x14) = pHVar9; puVar10[0x18] = 0; *(undefined4 *)(puVar10 + 0x1c) = 0; *(undefined4 *)(puVar10 + 0x20) = 0; piVar14[8] = (int)puVar10; iVar8 = DAT_00c7e298 + 1; *piVar14 = DAT_00c7e298; DAT_00c7e298 = iVar8; pcVar11 = _strdup((char *)(iVar20 + 300)); piVar14[1] = (int)pcVar11; *(undefined1 *)(piVar14 + 2) = 0; *(undefined2 *)((int)piVar14 + 10) = *(undefined2 *)(iVar20 + 0x14); *(undefined2 *)(piVar14 + 3) = *(undefined2 *)(iVar20 + 0x16); piVar14[4] = 0; piVar19 = piVar14; (**(code **)(pHVar9->unused + 0x10))(pHVar9,FUN_00a6d270,piVar14,0x13); piVar14[5] = 0; piVar18 = piVar14; (**(code **)(*piVar7 + 0x10))(piVar7,FUN_00a6d2a0,piVar14,0xc); pvVar12 = calloc(4,piVar14[4]); piVar14[6] = (int)pvVar12; pvVar12 = calloc(1,piVar14[5]); piVar14[7] = (int)pvVar12; pvVar12 = calloc(8,piVar14[4]); *(void **)(puVar10 + 0x24) = pvVar12; pvVar12 = calloc(4,piVar14[5]); *(void **)(puVar10 + 0x28) = pvVar12; piVar14[4] = 0; (**(code **)(*piVar19 + 0x10))(piVar19,deviceObjectCallback,piVar14,0x13); piVar14[5] = 0; (**(code **)(*piVar18 + 0x10))(piVar18,FUN_00a6d530,piVar14,0xc); if (DAT_00c79bf0 == DAT_00c79bf4) { FUN_00a6ef50(DAT_00c79bf0,&piStack_25c); piVar14 = piStack_25c; } else { *DAT_00c79bf0 = piVar14; DAT_00c79bf0 = DAT_00c79bf0 + 1; } if (DAT_00c75da8 != (code *)0x0) { (*DAT_00c75da8)(piVar14,DAT_00c78d8c); } return 1; } //@@ 00a6da10 Gamepad_removeDevice /* DB: ? libstem_gamepad: calls deviceRemoveCallback (DAT_00c78d7c, context DAT_00c78d88), frees private data (DirectInput device release vfunc +8, buffers), axis/button states and the record, memmove-removes it from the devices array g_gamepadDevices; Gamepad_processEvents */ void Gamepad_removeDevice(void) { void *_Memory; char *_Memory_00; int in_ECX; void **_Dst; if (DAT_00c78d7c != (code *)0x0) { (*DAT_00c78d7c)(g_gamepadDevices[in_ECX],DAT_00c78d88); } _Memory = g_gamepadDevices[in_ECX]; _Memory_00 = *(char **)((int)_Memory + 0x20); if (*_Memory_00 == '\0') { (**(code **)(**(int **)(_Memory_00 + 0x14) + 8))(*(int **)(_Memory_00 + 0x14)); free(*(void **)(_Memory_00 + 0x24)); free(*(void **)(_Memory_00 + 0x28)); free(*(void **)((int)_Memory + 4)); } free(_Memory_00); free(*(void **)((int)_Memory + 0x18)); free(*(void **)((int)_Memory + 0x1c)); free(_Memory); _Dst = g_gamepadDevices + in_ECX; memmove(_Dst,_Dst + 1,DAT_00c79bf0 - (int)(_Dst + 1)); DAT_00c79bf0 = DAT_00c79bf0 + -4; return; } //@@ 00a6dab0 FUN_00a6dab0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a6dab0(void) { code *pcVar1; int iVar2; BOOL BVar3; int *piVar4; undefined1 *puVar5; void *pvVar6; uint uVar7; uint uVar8; uint uVar9; tagMSG local_70; int *piStack_54; uint uStack_50; uint uStack_4c; undefined1 local_48 [20]; undefined1 auStack_34 [20]; ushort uStack_20; ushort uStack_1e; undefined4 local_14; local_14 = __security_cookie ^ (uint)(auStack_34 + 0x24); if (DAT_00c7e300 != '\0') { if (DAT_00c7e2d4 != (HWND)0x0) { iVar2 = PeekMessageA(&local_70,DAT_00c7e2d4,0,0,0); while (iVar2 != 0) { BVar3 = GetMessageA(&local_70,DAT_00c7e2d4,0,0); if (BVar3 != 0) { TranslateMessage(&local_70); DispatchMessageA(&local_70); } iVar2 = PeekMessageA(&local_70,DAT_00c7e2d4,0,0,0); } } if (DAT_00c7ac6b != '\0') { iVar2 = (**(code **)(*DAT_00c7e2fc + 0x10))(DAT_00c7e2fc,4,FUN_00a6d560,0,0); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"Warning: IDirectInput_EnumDevices returned 0x%X\n"); } DAT_00c7ac6b = '\0'; } if (DAT_00c7e301 != '\0') { uVar9 = 0; do { iVar2 = (*DAT_00c7e2f4)(uVar9,0,local_48); pvVar6 = (void *)(&DAT_00c7e2e0)[uVar9]; if (iVar2 == 0) { if (pvVar6 == (void *)0x0) { KAGE_LogMessage(1,(byte *)"Using XInput to initalize new device \n"); uStack_4c = 0; uStack_50 = 0; if ((_DAT_00c7e304 == 2) && (_DAT_00c7e2f8 != (code *)0x0)) { iVar2 = (*_DAT_00c7e2f8)(1,uVar9,0,auStack_34); if (iVar2 == 0) { uStack_4c = (uint)uStack_20; uStack_50 = (uint)uStack_1e; } else { KAGE_LogMessage(8,(byte *) "XInputGetCapabilitiesEx_proc() returned error %d, unable to retrieve Vendor or Product ID for device. (This happens when Steam overrides the device to be an generic XInput device) \n" ); } } piVar4 = malloc(0x24); piStack_54 = piVar4; puVar5 = malloc(0x30); *puVar5 = 1; *(uint *)(puVar5 + 0x2c) = uVar9; piVar4[8] = (int)puVar5; *piVar4 = DAT_00c7e298; DAT_00c7e298 = DAT_00c7e298 + 1; piVar4[1] = (int)(&PTR_s_XInput_Controller_1_00b468b0)[uVar9]; *(undefined1 *)(piVar4 + 2) = *puVar5; *(short *)((int)piVar4 + 10) = (short)uStack_4c; *(short *)(piVar4 + 3) = (short)uStack_50; piVar4[4] = 6; piVar4[5] = 0xf; pvVar6 = calloc(4,piVar4[4]); piVar4[6] = (int)pvVar6; pvVar6 = calloc(1,piVar4[5]); piVar4[7] = (int)pvVar6; if (DAT_00c79bf0 == DAT_00c79bf4) { FUN_00a6ef50(DAT_00c79bf0,&piStack_54); piVar4 = piStack_54; } else { *DAT_00c79bf0 = piVar4; DAT_00c79bf0 = DAT_00c79bf0 + 1; } pcVar1 = DAT_00c75da8; (&DAT_00c7e2e0)[uVar9] = piVar4; if (pcVar1 != (code *)0x0) { (*pcVar1)(piVar4,DAT_00c78d8c); } } } else if (pvVar6 != (void *)0x0) { uVar8 = 0; uVar7 = (int)DAT_00c79bf0 - (int)g_gamepadDevices >> 2; if (uVar7 != 0) { do { if (g_gamepadDevices[uVar8] == pvVar6) { Gamepad_removeDevice(); break; } uVar8 = uVar8 + 1; } while (uVar8 < uVar7); } (&DAT_00c7e2e0)[uVar9] = 0; } uVar9 = uVar9 + 1; } while (uVar9 < 4); } } return; } //@@ 00a6dd30 Gamepad_updatePOVAxes /* DB: ? libstem_gamepad windows DirectInput: maps a POV hat value (centi-degrees, -1 centered) to x/y axis states -1/0/1 at device axisStates (+0x18)[axis], calling the axis-move callback DAT_00c78d70 on change; caller Gamepad_processEvents (misnamed 00a6de60) */ void Gamepad_updatePOVAxes(undefined1 *param_1) { float fVar1; uint uVar2; int in_ECX; code *pcVar3; int in_EDX; int iVar4; undefined1 *puVar5; uVar2 = (uint)param_1; pcVar3 = DAT_00c78d70; if ((short)param_1 == -1) { puVar5 = (undefined1 *)0x0; param_1 = (undefined1 *)0x0; goto LAB_00a6dda1; } param_1 = (undefined1 *)0x3f800000; if ((uVar2 == 0) || (17999 < uVar2)) { if (uVar2 < 0x4651) { puVar5 = (undefined1 *)0x0; goto LAB_00a6de38; } puVar5 = &DAT_bf800000; if (uVar2 < 0x6979) goto LAB_00a6de38; } else { puVar5 = (undefined1 *)0x3f800000; LAB_00a6de38: if (8999 < uVar2) { if ((uVar2 < 0x2329) || (26999 < uVar2)) { param_1 = (undefined1 *)0x0; } goto LAB_00a6dda1; } } param_1 = &DAT_bf800000; LAB_00a6dda1: iVar4 = *(int *)(in_ECX + 0x18); fVar1 = *(float *)(iVar4 + in_EDX * 4); *(undefined1 **)(iVar4 + in_EDX * 4) = puVar5; if (((float)puVar5 != fVar1) && (pcVar3 != (code *)0x0)) { (*pcVar3)(); iVar4 = *(int *)(in_ECX + 0x18); pcVar3 = DAT_00c78d70; } fVar1 = *(float *)(iVar4 + 4 + in_EDX * 4); *(undefined1 **)(iVar4 + (in_EDX + 1) * 4) = param_1; if (((float)param_1 != fVar1) && (pcVar3 != (code *)0x0)) { (*pcVar3)(); } return; } //@@ 00a6de60 Gamepad_processEvents /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? libstem_gamepad: POV-to-axes and remove-device helpers, called from Manager::Update and the input poll; the ZHL KAGE_Filesys_FileManager::LoadArchiveFile signature matched wrongly prototype: db/protos.zhl */ void __cdecl Gamepad_processEvents(void) { void *pvVar1; byte isButtonDown; char buttonState; uint uVar2; int iVar3; code *callback; int *piVar4; uint uVar5; undefined1 in_XMM0 [16]; float axisValue; undefined4 uVar6; undefined4 uVar7; LARGE_INTEGER directInputTime; LARGE_INTEGER xinputTime; char *devicePrivateCopy; uint eventIndex; uint deviceIndex; uint eventCount; undefined8 local_154; int axisX; int axisY; int axisZ; int axisRx; int axisRy; int axisRz; int slider0; int slider1; undefined4 pov0; undefined4 pov1; undefined4 pov2; undefined4 pov3; char diButtons [228]; undefined1 xinputStateEx [4]; undefined2 exButtons; undefined1 exLeftTrigger; undefined1 exRightTrigger; short exThumbLX; short exThumbLY; short exThumbRX; short exThumbRY; undefined1 xinputState [4]; undefined4 buttonsAndTriggers; short thumbLX; short thumbLY; short thumbRX; short thumbRY; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; char *devicePrivate; float prevAxisValue; local_8 = 0xffffffff; puStack_c = &LAB_00b13340; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(xinputState + 0x20); ExceptionList = &local_10; if ((DAT_00c7e300 != '\0') && (DAT_00c9ba98 == '\0')) { DAT_00c9ba98 = 1; deviceIndex = 0; local_14 = uVar2; if (DAT_00c79bf0 - (int)g_gamepadDevices >> 2 != 0) { do { uVar5 = deviceIndex; pvVar1 = g_gamepadDevices[deviceIndex]; devicePrivate = *(char **)((int)pvVar1 + 0x20); devicePrivateCopy = devicePrivate; if (*devicePrivate == '\0') { iVar3 = (**(code **)(**(int **)(devicePrivate + 0x14) + 100)) (*(int **)(devicePrivate + 0x14),uVar2); if ((iVar3 == -0x7ff8ffe2) || (iVar3 == -0x7ff8fff4)) { (**(code **)(**(int **)(devicePrivate + 0x14) + 0x1c))(*(int **)(devicePrivate + 0x14)); (**(code **)(**(int **)(devicePrivate + 0x14) + 100))(*(int **)(devicePrivate + 0x14)); } piVar4 = *(int **)(devicePrivate + 0x14); if (devicePrivate[0x18] == '\0') { iVar3 = (**(code **)(*piVar4 + 0x24))(piVar4,0x110,&axisX); if ((iVar3 == -0x7ff8ffe2) || (iVar3 == -0x7ff8fff4)) { (**(code **)(**(int **)(devicePrivate + 0x14) + 0x1c)) (*(int **)(devicePrivate + 0x14)); iVar3 = (**(code **)(**(int **)(devicePrivate + 0x14) + 0x24)) (*(int **)(devicePrivate + 0x14),0x110,&axisX); } if (iVar3 == 0) { if (DAT_00c9ba90 == 0 && DAT_00c9ba94 == 0) { QueryPerformanceFrequency((LARGE_INTEGER *)&DAT_00c9ba90); } QueryPerformanceCounter(&directInputTime); uVar5 = 0; FUN_00aefe80(); local_154 = in_XMM0._0_8_; FUN_00aefe80(); in_XMM0._0_8_ = (double)(float)(local_154 / in_XMM0._0_8_); in_XMM0._8_8_ = 0; local_154 = in_XMM0._0_8_; if (*(int *)((int)pvVar1 + 0x14) != 0) { do { buttonState = diButtons[uVar5]; if ((buttonState != '\0') != (bool)*(char *)(*(int *)((int)pvVar1 + 0x1c) + uVar5) ) { *(bool *)(*(int *)((int)pvVar1 + 0x1c) + uVar5) = buttonState != '\0'; if (buttonState == '\0') { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6ea9c; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6ea9c: (*callback)(pvVar1,uVar5,in_XMM0._0_4_,in_XMM0._4_4_,uVar7); in_XMM0._8_8_ = 0; in_XMM0._0_8_ = local_154; } } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar1 + 0x14)); } uVar5 = 0; if (*(int *)((int)pvVar1 + 0x10) != 0) { callback = DAT_00c78d70; do { uVar7 = in_XMM0._0_4_; uVar6 = in_XMM0._4_4_; switch(*(undefined4 *)(*(int *)(devicePrivate + 0x24) + uVar5 * 8)) { case 0: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(axisX + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue == prevAxisValue) || (callback == (code *)0x0)) break; (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; case 4: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(axisY + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 8: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(axisZ + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 0xc: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(axisRx + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 0x10: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(axisRy + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 0x14: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(axisRz + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 0x18: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(slider0 + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 0x1c: prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(slider1 + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,uVar5,axisValue,prevAxisValue,uVar7,uVar6,DAT_00c75dac); goto LAB_00a6ee80; } break; case 0x20: uVar7 = pov0; goto LAB_00a6ee70; case 0x24: uVar7 = pov1; goto LAB_00a6ee70; case 0x28: uVar7 = pov2; goto LAB_00a6ee70; case 0x2c: uVar7 = pov3; LAB_00a6ee70: Gamepad_updatePOVAxes(uVar7); uVar5 = uVar5 + 1; LAB_00a6ee80: callback = DAT_00c78d70; } in_XMM0._8_8_ = 0; in_XMM0._0_8_ = local_154; uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar1 + 0x10)); } LAB_00a6ee98: uVar5 = deviceIndex; } else { Gamepad_removeDevice(); uVar5 = uVar5 - 1; } } else { eventCount = 0xffffffff; iVar3 = (**(code **)(*piVar4 + 0x28))(piVar4,0x14,0,&eventCount,1); if ((iVar3 == -0x7ff8ffe2) || (iVar3 == -0x7ff8fff4)) { (**(code **)(**(int **)(devicePrivate + 0x14) + 0x1c)) (*(int **)(devicePrivate + 0x14)); iVar3 = (**(code **)(**(int **)(devicePrivate + 0x14) + 0x28)) (*(int **)(devicePrivate + 0x14),0x14,0,&eventCount,1); } if (iVar3 < 0) { Gamepad_removeDevice(); uVar5 = uVar5 - 1; } else { piVar4 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)eventCount * 0x14 >> 0x20) != 0) | (uint)((ulonglong)eventCount * 0x14))); local_154 = (double)CONCAT44(piVar4,(undefined4)local_154); iVar3 = (**(code **)(**(int **)(devicePrivate + 0x14) + 0x28)) (*(int **)(devicePrivate + 0x14),0x14,piVar4,&eventCount,0); uVar5 = deviceIndex; if (-1 < iVar3) { eventIndex = 0; if (eventCount != 0) { do { uVar5 = 0; if (*(int *)((int)pvVar1 + 0x14) != 0) { do { if (*piVar4 == *(int *)(*(int *)(devicePrivateCopy + 0x28) + uVar5 * 4)) { iVar3 = piVar4[1]; in_XMM0._0_8_ = ((double)piVar4[2] + __uint_to_double_fixup[-(piVar4[2] >> 0x1f)]) / 1000.0; in_XMM0._8_8_ = 0; if ((iVar3 != 0) != (bool)*(char *)(*(int *)((int)pvVar1 + 0x1c) + uVar5)) { *(bool *)(*(int *)((int)pvVar1 + 0x1c) + uVar5) = iVar3 != 0; if (iVar3 == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e876; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e876: (*callback)(pvVar1,uVar5,in_XMM0._0_8_,uVar7); } } } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar1 + 0x14)); } uVar5 = 0; if (*(int *)((int)pvVar1 + 0x10) != 0) { do { if (*piVar4 == *(int *)(*(int *)(devicePrivateCopy + 0x24) + uVar5 * 8)) { in_XMM0._0_8_ = ((double)piVar4[2] + __uint_to_double_fixup[-(piVar4[2] >> 0x1f)]) / 1000.0; in_XMM0._8_8_ = 0; if (*(char *)(*(int *)(devicePrivateCopy + 0x24) + 4 + uVar5 * 8) == '\0') { prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4); axisValue = (float)(piVar4[1] + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - 1.0; *(float *)(*(int *)((int)pvVar1 + 0x18) + uVar5 * 4) = axisValue; if ((axisValue != prevAxisValue) && (DAT_00c78d70 != (code *)0x0)) { (*DAT_00c78d70)(pvVar1,uVar5,axisValue,prevAxisValue,in_XMM0._0_8_, DAT_00c75dac); } } else { Gamepad_updatePOVAxes(piVar4[1]); uVar5 = uVar5 + 1; } } uVar5 = uVar5 + 1; } while (uVar5 < *(uint *)((int)pvVar1 + 0x10)); } eventIndex = eventIndex + 1; piVar4 = piVar4 + 5; } while (eventIndex < eventCount); piVar4 = local_154._4_4_; } local_8 = 0; tracked_alloc(1,piVar4,0); local_8 = 0xffffffff; goto LAB_00a6ee98; } Gamepad_removeDevice(); uVar5 = uVar5 - 1; } } } else { if (DAT_00c7e29c == (code *)0x0) { iVar3 = (*DAT_00c7e2dc)(*(undefined4 *)(devicePrivate + 0x2c),xinputState); } else { iVar3 = (*DAT_00c7e29c)(*(undefined4 *)(devicePrivate + 0x2c),xinputStateEx); thumbLX = exThumbLX; thumbLY = exThumbLY; thumbRX = exThumbRX; thumbRY = exThumbRY; buttonsAndTriggers = CONCAT13(exRightTrigger,CONCAT12(exLeftTrigger,exButtons)); } if (iVar3 == 0) { if (DAT_00c9ba90 == 0 && DAT_00c9ba94 == 0) { QueryPerformanceFrequency((LARGE_INTEGER *)&DAT_00c9ba90); } QueryPerformanceCounter(&xinputTime); FUN_00aefe80(); local_154 = in_XMM0._0_8_; FUN_00aefe80(); local_154 = (double)(float)(local_154 / in_XMM0._0_8_); if (((byte)buttonsAndTriggers & 1) != **(byte **)((int)pvVar1 + 0x1c)) { **(byte **)((int)pvVar1 + 0x1c) = (byte)buttonsAndTriggers & 1; if ((buttonsAndTriggers & 1) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6dfe1; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6dfe1: (*callback)(pvVar1,0,local_154,uVar7); } } isButtonDown = (byte)buttonsAndTriggers >> 1 & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 1)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 1) = isButtonDown; if (isButtonDown == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e02f; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e02f: (*callback)(pvVar1,1,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)buttonsAndTriggers >> 2 & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 2)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 2) = isButtonDown; if (isButtonDown == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e076; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e076: (*callback)(pvVar1,2,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)buttonsAndTriggers >> 3 & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 3)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 3) = isButtonDown; if (isButtonDown == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e0c5; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e0c5: (*callback)(pvVar1,3,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)buttonsAndTriggers >> 4 & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 4)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 4) = isButtonDown; if (isButtonDown == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e114; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e114: (*callback)(pvVar1,4,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)buttonsAndTriggers >> 5 & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 5)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 5) = isButtonDown; if (isButtonDown == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e163; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e163: (*callback)(pvVar1,5,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)buttonsAndTriggers >> 6 & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 6)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 6) = isButtonDown; if (isButtonDown == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e1b2; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e1b2: (*callback)(pvVar1,6,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } buttonState = -((char)(byte)buttonsAndTriggers >> 7); if (buttonState != *(char *)(*(int *)((int)pvVar1 + 0x1c) + 7)) { *(char *)(*(int *)((int)pvVar1 + 0x1c) + 7) = buttonState; if (buttonState == '\0') { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e201; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e201: (*callback)(pvVar1,7,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)(buttonsAndTriggers >> 8) & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 8)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 8) = isButtonDown; if ((buttonsAndTriggers & 0x100) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e250; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e250: (*callback)(pvVar1,8,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)(buttonsAndTriggers >> 9) & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 9)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 9) = isButtonDown; if ((buttonsAndTriggers >> 9 & 1) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e29f; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e29f: (*callback)(pvVar1,9,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)(buttonsAndTriggers >> 0xc) & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 10)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 10) = isButtonDown; if ((buttonsAndTriggers >> 0xc & 1) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e2ee; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e2ee: (*callback)(pvVar1,10,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7); } } isButtonDown = (byte)(buttonsAndTriggers >> 0xd) & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 0xb)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 0xb) = isButtonDown; if ((buttonsAndTriggers >> 0xd & 1) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e33d; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e33d: (*callback)(pvVar1,0xb,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7) ; } } isButtonDown = (byte)(buttonsAndTriggers >> 0xe) & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 0xc)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 0xc) = isButtonDown; if ((buttonsAndTriggers >> 0xe & 1) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e38c; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e38c: (*callback)(pvVar1,0xc,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7) ; } } buttonState = -((char)(buttonsAndTriggers >> 8) >> 7); if (buttonState != *(char *)(*(int *)((int)pvVar1 + 0x1c) + 0xd)) { *(char *)(*(int *)((int)pvVar1 + 0x1c) + 0xd) = buttonState; if ((short)buttonsAndTriggers < 0) { if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; goto LAB_00a6e3db; } } else if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; LAB_00a6e3db: (*callback)(pvVar1,0xd,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7) ; } } isButtonDown = (byte)(buttonsAndTriggers >> 10) & 1; if (isButtonDown != *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 0xe)) { *(byte *)(*(int *)((int)pvVar1 + 0x1c) + 0xe) = isButtonDown; if ((buttonsAndTriggers >> 10 & 1) == 0) { if (g_gamepadButtonUpCallback != (void *)0x0) { callback = g_gamepadButtonUpCallback; uVar7 = DAT_00c78d80; goto LAB_00a6e42a; } } else if (g_gamepadButtonDownCallback != (void *)0x0) { callback = g_gamepadButtonDownCallback; uVar7 = DAT_00c78d84; LAB_00a6e42a: (*callback)(pvVar1,0xe,SUB84(local_154,0),(int)((ulonglong)local_154 >> 0x20),uVar7) ; } } callback = DAT_00c78d70; in_XMM0._0_12_ = ZEXT812(0x3f800000); in_XMM0._12_4_ = 0; prevAxisValue = **(float **)((int)pvVar1 + 0x18); axisValue = (float)(thumbLX + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - in_XMM0._0_4_; **(float **)((int)pvVar1 + 0x18) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,0,axisValue,prevAxisValue,SUB84(local_154,0), (int)((ulonglong)local_154 >> 0x20),DAT_00c75dac); in_XMM0 = ZEXT816(0x3f800000); callback = DAT_00c78d70; } prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + 4); axisValue = (float)(thumbLY + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - in_XMM0._0_4_; *(float *)(*(int *)((int)pvVar1 + 0x18) + 4) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,1,axisValue,prevAxisValue,SUB84(local_154,0), (int)((ulonglong)local_154 >> 0x20),DAT_00c75dac); in_XMM0 = ZEXT816(0x3f800000); callback = DAT_00c78d70; } prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + 8); axisValue = (float)(thumbRX + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - in_XMM0._0_4_; *(float *)(*(int *)((int)pvVar1 + 0x18) + 8) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,2,axisValue,prevAxisValue,SUB84(local_154,0), (int)((ulonglong)local_154 >> 0x20),DAT_00c75dac); in_XMM0 = ZEXT816(0x3f800000); callback = DAT_00c78d70; } prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + 0xc); axisValue = (float)(thumbRY + 0x8000) / 65535.0; axisValue = (axisValue + axisValue) - in_XMM0._0_4_; *(float *)(*(int *)((int)pvVar1 + 0x18) + 0xc) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,3,axisValue,prevAxisValue,SUB84(local_154,0), (int)((ulonglong)local_154 >> 0x20),DAT_00c75dac); in_XMM0 = ZEXT816(0x3f800000); callback = DAT_00c78d70; } prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + 0x10); axisValue = (float)(buttonsAndTriggers >> 0x10 & 0xff) / 127.5 - in_XMM0._0_4_; *(float *)(*(int *)((int)pvVar1 + 0x18) + 0x10) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { (*callback)(pvVar1,4,axisValue,prevAxisValue,SUB84(local_154,0), (int)((ulonglong)local_154 >> 0x20),DAT_00c75dac); in_XMM0 = ZEXT816(0x3f800000); callback = DAT_00c78d70; } prevAxisValue = *(float *)(*(int *)((int)pvVar1 + 0x18) + 0x14); axisValue = (float)(buttonsAndTriggers >> 0x18) / 127.5 - in_XMM0._0_4_; *(float *)(*(int *)((int)pvVar1 + 0x18) + 0x14) = axisValue; if ((axisValue != prevAxisValue) && (callback != (code *)0x0)) { in_XMM0._8_8_ = 0; in_XMM0._0_8_ = local_154; (*callback)(pvVar1,5,axisValue,prevAxisValue,SUB84(local_154,0), (int)((ulonglong)local_154 >> 0x20),DAT_00c75dac); } } else { (&DAT_00c7e2e0)[*(int *)(devicePrivate + 0x2c)] = 0; Gamepad_removeDevice(); uVar5 = uVar5 - 1; } } deviceIndex = uVar5 + 1; } while (deviceIndex < (uint)(DAT_00c79bf0 - (int)g_gamepadDevices >> 2)); } DAT_00c9ba98 = '\0'; } ExceptionList = local_10; return; } //@@ 00a6ef50 FUN_00a6ef50 void ** FUN_00a6ef50(void **param_1,undefined4 *param_2) { uint uVar1; void **ppvVar2; int iVar3; void **_Dst; uint uVar4; uint uVar5; void **ptr; int iVar6; iVar3 = (int)DAT_00c79bf0 - (int)g_gamepadDevices >> 2; iVar6 = (int)param_1 - (int)g_gamepadDevices; if (iVar3 == 0x3fffffff) { /* WARNING: Subroutine does not return */ std::_Xlen(); } uVar1 = iVar3 + 1; uVar4 = (int)DAT_00c79bf4 - (int)g_gamepadDevices >> 2; if (0x3fffffff - (uVar4 >> 1) < uVar4) { uVar5 = 0x3fffffff; } else { uVar4 = (uVar4 >> 1) + uVar4; uVar5 = uVar1; if (uVar1 <= uVar4) { uVar5 = uVar4; } if (0x3fffffff < uVar5) { /* WARNING: Subroutine does not return */ FUN_0040cee0(); } } _Dst = std::_Allocate(uVar5 * 4); ppvVar2 = _Dst + (iVar6 >> 2); *ppvVar2 = (void *)*param_2; if (param_1 == DAT_00c79bf0) { memmove(_Dst,g_gamepadDevices,(int)DAT_00c79bf0 - (int)g_gamepadDevices); } else { memmove(_Dst,g_gamepadDevices,(int)param_1 - (int)g_gamepadDevices); memmove(ppvVar2 + 1,param_1,(int)DAT_00c79bf0 - (int)param_1); } if (g_gamepadDevices != (void **)0x0) { uVar4 = (int)DAT_00c79bf4 - (int)g_gamepadDevices & 0xfffffffc; ptr = g_gamepadDevices; if (0xfff < uVar4) { ptr = g_gamepadDevices[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)g_gamepadDevices + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } g_gamepadDevices = _Dst; DAT_00c79bf0 = _Dst + uVar1; DAT_00c79bf4 = _Dst + uVar5; return ppvVar2; } //@@ 00a6f090 FUN_00a6f090 void FUN_00a6f090(byte param_1) { void *in_ECX; KAGE::Memory::HeapBase::~HeapBase(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x40); } return; } //@@ 00a6f0c0 KAGE::Memory::HeapBase::~HeapBase /* DB: sets HeapBase::vftable, frees each 0x1098-byte page in its list (+0x1c), resets counters, destroys the Mutex at +0x10; 00a6f090 is its scalar deleting dtor prototype: db/protos.zhl */ void __thiscall KAGE::Memory::HeapBase::~HeapBase(void *this) { undefined4 *puVar1; LPCRITICAL_SECTION lpCriticalSection; undefined4 *ptr; uint uVar2; int *piVar3; int *piVar4; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b10960; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined ***)this = vftable; piVar3 = *(int **)((int)this + 0x1c); piVar4 = (int *)*piVar3; if (piVar4 != piVar3) { do { if ((void *)piVar4[2] != (void *)0x0) { operator_delete((void *)piVar4[2],0x1098); piVar4[2] = 0; } piVar4 = (int *)*piVar4; piVar3 = *(int **)((int)this + 0x1c); } while (piVar4 != piVar3); } *(undefined4 *)piVar3[1] = 0; ptr = (undefined4 *)*piVar3; while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; operator_delete(ptr,0xc); ptr = puVar1; } *(undefined4 *)*(undefined4 *)((int)this + 0x1c) = *(undefined4 *)((int)this + 0x1c); *(int *)(*(int *)((int)this + 0x1c) + 4) = *(int *)((int)this + 0x1c); *(undefined4 *)((int)this + 0x20) = 0; *(undefined4 *)((int)this + 8) = 0xffffffff; (**(code **)(*(int *)((int)this + 0x10) + 8))(uVar2); *(undefined4 *)((int)this + 0x30) = 0; *(undefined4 *)((int)this + 0x34) = 0; *(undefined4 *)((int)this + 0x28) = 0; *(undefined4 *)((int)this + 0x2c) = 0; FUN_0042c780(); FUN_00498f80(); lpCriticalSection = *(LPCRITICAL_SECTION *)((int)this + 0x18); *(undefined ***)((int)this + 0x10) = Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); *(undefined4 *)((int)this + 0x18) = 0; } *(byte *)((int)this + 0x14) = *(byte *)((int)this + 0x14) & 0xfe; *(undefined ***)((int)this + 0x10) = MutexBase::vftable; ExceptionList = local_10; return; } //@@ 00a6f1e0 FUN_00a6f1e0 int FUN_00a6f1e0(undefined4 param_1,undefined4 param_2) { uint *puVar1; uint uVar2; int iVar3; int in_ECX; int *unaff_EBX; int *piVar4; int *piVar5; undefined8 local_14; local_14 = CONCAT44(local_14._4_4_,(int *)(in_ECX + 0x10)); (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff); local_14 = 0; piVar5 = (int *)**(int **)(in_ECX + 0x1c); piVar4 = (int *)(in_ECX + 0x10); if (piVar5 != *(int **)(in_ECX + 0x1c)) { do { iVar3 = FUN_00a9dea0(param_1,param_2,&local_14); if (iVar3 != 0) { (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); puVar1 = (uint *)(in_ECX + 0x30); uVar2 = *puVar1; *puVar1 = *puVar1 + (uint)local_14; *(int *)(in_ECX + 0x34) = *(int *)(in_ECX + 0x34) + local_14._4_4_ + (uint)CARRY4(uVar2,(uint)local_14); return iVar3; } piVar5 = (int *)*piVar5; } while (piVar5 != (int *)*(int *)(in_ECX + 0x1c)); piVar4 = unaff_EBX; } (**(code **)(*piVar4 + 0x10))(); return 0; } //@@ 00a6f270 FUN_00a6f270 void FUN_00a6f270(uint param_1,char param_2) { undefined4 *puVar1; uint *puVar2; int iVar3; uint uVar4; int iVar5; int *piVar6; int in_ECX; uint uVar7; uint uVar8; uint uVar9; uint uVar10; uint *puVar11; uint *puVar12; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1337d; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(*(int *)(in_ECX + 0x10) + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); if (param_2 == '\0') { for (puVar1 = (undefined4 *)**(undefined4 **)(in_ECX + 0x1c); puVar1 != *(undefined4 **)(in_ECX + 0x1c); puVar1 = (undefined4 *)*puVar1) { puVar2 = (uint *)puVar1[2]; if ((*puVar2 <= param_1) && (param_1 < puVar2[2] + *puVar2)) { if (param_1 == 0) { *(undefined4 *)(in_ECX + 0x30) = *(undefined4 *)(in_ECX + 0x30); *(undefined4 *)(in_ECX + 0x34) = *(undefined4 *)(in_ECX + 0x34); } else { iVar3 = *(int *)(param_1 - 0x1c); puVar11 = (uint *)(param_1 - 0x20); uVar4 = *puVar11; iVar5 = *(int *)(param_1 - 0x18); *(undefined1 *)(param_1 - 0xc) = 1; uVar9 = uVar4; if ((iVar5 != 0) && (*(char *)(iVar5 + 0x14) != '\0')) { FUN_00a9e170(iVar5); uVar8 = *puVar11; puVar11 = *(uint **)(param_1 - 0x18); uVar7 = uVar8 + 0x20; iVar5 = *(int *)(param_1 - 0x1c); uVar9 = *puVar11; *puVar11 = *puVar11 + uVar7; puVar11[1] = puVar11[1] + iVar5 + (uint)(0xffffffdf < uVar8) + (uint)CARRY4(uVar9,uVar7) ; puVar11 = *(uint **)(param_1 - 0x18); uVar9 = *puVar11; uVar8 = (int)puVar11 + uVar9 + 0x20; uVar8 = -(uint)(uVar8 < puVar2[2] + *puVar2) & uVar8; if (uVar8 != 0) { *(uint **)(uVar8 + 8) = puVar11; uVar9 = *puVar11; } } uVar9 = (int)puVar11 + uVar9 + 0x20; puVar12 = (uint *)(-(uint)(uVar9 < puVar2[2] + *puVar2) & uVar9); if ((puVar12 != (uint *)0x0) && ((char)puVar12[5] != '\0')) { FUN_00a9e170(puVar12); uVar8 = *puVar12; uVar7 = puVar12[1]; uVar10 = uVar8 + 0x20; uVar9 = *puVar11; *puVar11 = *puVar11 + uVar10; puVar11[1] = puVar11[1] + uVar7 + (0xffffffdf < uVar8) + (uint)CARRY4(uVar9,uVar10); uVar9 = (int)puVar11 + *puVar11 + 0x20; uVar9 = -(uint)(uVar9 < puVar2[2] + *puVar2) & uVar9; if (uVar9 != 0) { *(uint **)(uVar9 + 8) = puVar11; } } FUN_00a9e0f0(puVar11); puVar2 = (uint *)(in_ECX + 0x30); uVar9 = *puVar2; *puVar2 = *puVar2 - uVar4; *(int *)(in_ECX + 0x34) = (*(int *)(in_ECX + 0x34) - iVar3) - (uint)(uVar9 < uVar4); } break; } } } else { local_14 = CONCAT31((int3)((uint)in_ECX >> 8),param_2); iVar3 = *(int *)(in_ECX + 0x38); if (*(int *)(in_ECX + 0x3c) == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar6 = operator_new(0x10); local_8 = 0xffffffff; piVar6[2] = param_1; piVar6[3] = local_14; *(int *)(in_ECX + 0x3c) = *(int *)(in_ECX + 0x3c) + 1; puVar1 = *(undefined4 **)(iVar3 + 4); *piVar6 = iVar3; piVar6[1] = (int)puVar1; *(int **)(iVar3 + 4) = piVar6; *puVar1 = piVar6; } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); ExceptionList = local_10; return; } //@@ 00a6f440 FUN_00a6f440 undefined8 FUN_00a6f440(void) { int *piVar1; uint uVar2; uint uVar4; uint uVar3; int iVar5; int iVar6; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x10); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } uVar2 = *(uint *)(in_ECX + 0x28); uVar3 = *(uint *)(in_ECX + 0x30); uVar4 = *(uint *)(in_ECX + 0x30); iVar5 = *(int *)(in_ECX + 0x2c); iVar6 = *(int *)(in_ECX + 0x34); local_8 = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return CONCAT44((iVar5 - iVar6) - (uint)(uVar2 < uVar3),uVar2 - uVar4); } //@@ 00a6f4d0 FUN_00a6f4d0 undefined8 FUN_00a6f4d0(void) { int *piVar1; undefined8 uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x10); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } uVar2 = *(undefined8 *)(in_ECX + 0x30); local_8 = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return uVar2; } //@@ 00a6f550 FUN_00a6f550 undefined8 FUN_00a6f550(void) { int in_ECX; return *(undefined8 *)(in_ECX + 0x28); } //@@ 00a6f560 FUN_00a6f560 undefined8 FUN_00a6f560(uint param_1) { int *piVar1; undefined4 *puVar2; uint uVar3; int in_ECX; undefined4 local_1c; undefined4 uStack_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b133a0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0x10); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); } puVar2 = (undefined4 *)**(undefined4 **)(in_ECX + 0x1c); do { if (puVar2 == *(undefined4 **)(in_ECX + 0x1c)) { uStack_18 = 0; local_1c = 0; LAB_00a6f5df: local_8 = 1; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return CONCAT44(uStack_18,local_1c); } uVar3 = *(uint *)puVar2[2]; if ((uVar3 <= param_1) && (param_1 < ((uint *)puVar2[2])[2] + uVar3)) { local_1c = *(undefined4 *)(param_1 - 0x20); uStack_18 = *(undefined4 *)(param_1 - 0x1c); goto LAB_00a6f5df; } puVar2 = (undefined4 *)*puVar2; } while( true ); } //@@ 00a6f620 FUN_00a6f620 undefined4 FUN_00a6f620(uint param_1) { undefined4 *puVar1; uint uVar2; int in_ECX; (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff); puVar1 = (undefined4 *)**(undefined4 **)(in_ECX + 0x1c); while( true ) { if (puVar1 == *(undefined4 **)(in_ECX + 0x1c)) { (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); return 0; } uVar2 = *(uint *)puVar1[2]; if ((uVar2 <= param_1) && (param_1 < ((uint *)puVar1[2])[2] + uVar2)) break; puVar1 = (undefined4 *)*puVar1; } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); return 1; } //@@ 00a6f680 FUN_00a6f680 undefined4 FUN_00a6f680(void) { undefined4 uVar1; int iVar2; int in_ECX; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; int local_8; local_10 = DAT_00c5abfc; local_14 = 1; local_c = *(undefined4 *)(in_ECX + 0x14); uVar1 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&local_14); iVar2 = _EOS_Presence_HasPresence_8(uVar1); if (iVar2 != 0) { local_1c = DAT_00c5abfc; local_18 = *(undefined4 *)(in_ECX + 0x14); local_8 = 0; local_20 = 3; uVar1 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&local_20,&local_8); iVar2 = _EOS_Presence_CopyPresence_12(uVar1); if (iVar2 == 0) { uVar1 = 0; switch(*(undefined4 *)(local_8 + 4)) { case 0: _EOS_Presence_Info_Release_4(local_8); return 0; case 1: _EOS_Presence_Info_Release_4(local_8); return 1; case 2: case 3: _EOS_Presence_Info_Release_4(local_8); return 3; case 4: uVar1 = 2; } _EOS_Presence_Info_Release_4(local_8); return uVar1; } } return 0; } //@@ 00a6f770 KAGE::System::UserProfile::set_id /* DB: ? ECX=UserProfile (id u64 at +8/+0xc as in UserProfile::find_or_create users): when the new id param_1 differs, under the profile mutex removes the old key from the global profile map (FUN_00a24210 find, std_tree_extract) and re-inserts under the new id (FUN_00a70a10), re-points g_userProfile if it was the local user, then copies the display name param_2 and flag bits into the Epic user info (FUN_00a23bb0, SmartPointer); 4 callers: EOS product-user mapping 00a6fa10, localhost 00a703f0, "user_id"/"user_name" parsers 00a772a0/00a776a0 prototype: db/protos.zhl, confirmed by RET 8 */ void __thiscall KAGE::System::UserProfile::set_id(void *this,ulonglong *userId,byte *displayName) { uint *this_00; undefined4 uVar1; bool bVar2; char cVar3; void *ptr; byte *extraout_EAX; int iVar4; byte *pbVar5; uint uVar6; undefined4 extraout_ECX; byte *pbVar7; byte bVar8; char *_Dest; undefined1 local_30 [8]; void *local_28; undefined8 local_24; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b133cd; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = this; if (((int)*userId != 0 || *(int *)((int)userId + 4) != 0) && ((this_00 = (uint *)((int)this + 8), *(int *)((int)this + 8) != (int)*userId || (*(int *)((int)this + 0xc) != *(int *)((int)userId + 4))))) { if (g_userProfile == (void *)0x0) { local_24 = 0; local_24._4_4_ = (int *)0x0; local_24._0_4_ = (byte *)0x0; iVar4 = (int)local_24._4_4_; uVar6 = (uint)(byte *)local_24; } else { iVar4 = *(int *)((int)g_userProfile + 0xc); uVar6 = *(uint *)((int)g_userProfile + 8); } if ((*this_00 != uVar6) || (bVar2 = true, *(int *)((int)this + 0xc) != iVar4)) { bVar2 = false; } (**(code **)(PTR_vftable_00c5aa70 + 0xc)) (0xffffffff,__security_cookie ^ (uint)(local_18 + 0x14)); if (((g_userProfile != (void *)0x0) && (*this_00 == *(uint *)((int)g_userProfile + 8))) && (*(int *)((int)this + 0xc) == *(int *)((int)g_userProfile + 0xc))) { g_userProfile = (void *)0x0; } FUN_00a24210(local_30,this_00); if (*(char *)((int)local_28 + 0xd) == '\0') { if (((*(uint *)((int)local_28 + 0x14) <= *(uint *)((int)this + 0xc)) && ((*(uint *)((int)local_28 + 0x14) < *(uint *)((int)this + 0xc) || (*(uint *)((int)local_28 + 0x10) <= *this_00)))) && (local_28 != DAT_00c798d8)) { ptr = std_tree_extract(&DAT_00c798d8,local_28); FUN_00a70fe0(); operator_delete(ptr,0x40); } } local_8 = 0; (**(code **)(PTR_vftable_00c5aa70 + 0x10))(); local_8 = 0xffffffff; uVar1 = *(undefined4 *)((int)userId + 4); *this_00 = (uint)*userId; *(undefined4 *)((int)this + 0xc) = uVar1; eos_user_info_find_or_create(&DAT_00c5ac08,local_18,local_14); local_8 = 1; if (local_14 != (int *)0x0) { cVar3 = (**(code **)(*local_14 + 0xc))(); if ((cVar3 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_18); } } local_8 = 0xffffffff; if (bVar2) { ::UserProfile::find_or_create(this_00); g_userProfile = extraout_EAX; *extraout_EAX = *extraout_EAX | 1; } } iVar4 = FUN_00a23bb0(); if (iVar4 == 0) { SmartPointer::SmartPointer(extraout_ECX); } else { FUN_00a23df0(iVar4 + 0x20); } local_8 = 2; if ((byte *)local_24 != (byte *)0x0) { pbVar5 = (byte *)FUN_00a23bb0(); if (pbVar5 != (byte *)0x0) { pbVar7 = *(byte **)(pbVar5 + 0x10); if (pbVar7 != displayName) { if (pbVar7 != (byte *)0x0) { local_8._0_1_ = 3; tracked_alloc(1,pbVar7,0); local_8 = CONCAT31(local_8._1_3_,2); pbVar5[0x10] = 0; pbVar5[0x11] = 0; pbVar5[0x12] = 0; pbVar5[0x13] = 0; } if (displayName == (byte *)0x0) { _Dest = (char *)0x0; } else { pbVar7 = displayName; do { bVar8 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar8 != 0); _Dest = operator_new_tracked((uint)(pbVar7 + (1 - (int)(displayName + 1)))); pbVar7 = displayName; do { bVar8 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar8 != 0); strncpy(_Dest,(char *)displayName,(size_t)(pbVar7 + (1 - (int)(displayName + 1)))); } *(char **)(pbVar5 + 0x10) = _Dest; bVar8 = *pbVar5 | 2; if ((*(byte *)local_24 & 2) == 0) { bVar8 = *pbVar5 & 0xfd; } *pbVar5 = bVar8; if ((*(byte *)local_24 & 4) == 0) { bVar8 = bVar8 & 0xfb; } else { bVar8 = bVar8 | 4; } *pbVar5 = bVar8; } } } local_8 = 4; if (local_24._4_4_ != (int *)0x0) { cVar3 = (**(code **)(*local_24._4_4_ + 0xc))(); if ((cVar3 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_24); } } ExceptionList = local_10; return; } //@@ 00a6fa10 eos_on_query_product_user_id_mappings /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: EOS callback: pushed as the completion callback of _EOS_Connect_QueryProductUserIdMappings in 00a6fc30 and 00a70020; logs "Failed to retrieve product ID mapping: %s" (EOS_EResult_ToString), EOS_Connect_CopyProductUserInfo, external account type 0 (Epic) / 1 (Steam id string) else "Unsupported platform for user", stores the user (FUN_00a6f770), ExternalAccountInfo_Release, then queries EOS UserInfo with callback 00a6fd70 */ void eos_on_query_product_user_id_mappings(int *param_1) { void *this; int iVar1; char cVar2; undefined4 uVar3; undefined4 extraout_ECX; void *ptr; uint size; undefined1 local_58 [4]; int *local_54; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined8 local_40; int local_34; void *local_30 [5]; uint local_1c; uint local_18; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b133fd; local_10 = ExceptionList; local_18 = __security_cookie ^ (uint)(local_30 + 0xb); ExceptionList = &local_10; if (*param_1 == 0) { this = (void *)param_1[1]; local_34 = 0; local_40 = CONCAT44(*(undefined4 *)((int)this + 0x10),1); uVar3 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&local_40,&local_34,local_18); _EOS_Connect_CopyProductUserInfo_12(uVar3); local_40 = 0; iVar1 = *(int *)(local_34 + 0x10); *(int *)((int)this + 0x18) = iVar1; if (iVar1 == 0) { local_40 = FUN_00a15a30(); } else if (iVar1 == 1) { std::string::string_from_cstr((char *)local_30,*(byte **)(local_34 + 0xc)); local_8 = (void *)0x0; local_40 = FUN_0085be70(extraout_ECX); local_8 = (void *)0xffffffff; if (0xf < local_1c) { size = local_1c + 1; ptr = local_30[0]; if (0xfff < size) { ptr = *(void **)((int)local_30[0] + -4); size = local_1c + 0x24; if (0x1f < (uint)((int)local_30[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } } else if (iVar1 != 5) { KAGE_LogMessage(0x10,(byte *)"Unsupported platform for user\n"); } KAGE::System::UserProfile::set_id(this,&local_40,*(byte **)(local_34 + 8)); _EOS_Connect_ExternalAccountInfo_Release_4(local_34); if (*(int *)((int)this + 0x14) == 0) { local_4c = DAT_00c5abfc; local_50 = 1; local_48 = *(undefined4 *)(local_34 + 0xc); local_44 = *(undefined4 *)((int)this + 0x18); uVar3 = _EOS_Platform_GetUserInfoInterface_4(g_eosPlatform,&local_50,this,FUN_00a6fd70); _EOS_UserInfo_QueryUserInfoByExternalAccount_16(uVar3); } else { eos_user_info_find_or_create(&DAT_00c5ac08,local_58,this); local_8 = (void *)0x1; if (local_54 != (int *)0x0) { cVar2 = (**(code **)(*local_54 + 0xc))(); if ((cVar2 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_58); } } local_48 = DAT_00c5abfc; local_44 = *(undefined4 *)((int)this + 0x14); local_4c = 1; uVar3 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&local_4c,this,FUN_00a6fe30); _EOS_Presence_QueryPresence_16(uVar3); } } else { _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to retrieve product ID mapping: %s\n"); } ExceptionList = local_10; return; } //@@ 00a6fc30 FUN_00a6fc30 void FUN_00a6fc30(int *param_1) { int iVar1; void *pvVar2; undefined4 uVar3; undefined4 local_38; void *local_34; undefined4 local_30; undefined4 *local_2c; undefined4 local_28; undefined4 local_24; void *local_20; undefined4 local_1c; void *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1840; local_10 = ExceptionList; ExceptionList = &local_10; if (*param_1 != 0) { _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to retrieve account ID mapping: %s\n"); ExceptionList = local_10; return; } iVar1 = param_1[1]; local_20 = g_eosLocalUserId; local_24 = 1; local_1c = 0; local_14 = 1; _EOS_EpicAccountId_ToString_12 (*(undefined4 *)(iVar1 + 0x14),(int)¶m_1 + 3,&local_14, __security_cookie ^ (int)register0x00000010 - 4U); pvVar2 = operator_new_tracked(local_14); _EOS_EpicAccountId_ToString_12(*(undefined4 *)(iVar1 + 0x14),pvVar2,&local_14); local_18 = pvVar2; uVar3 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&local_24); uVar3 = _EOS_Connect_GetExternalAccountMapping_8(uVar3); *(undefined4 *)(iVar1 + 0x10) = uVar3; if (local_18 != (void *)0x0) { local_8 = 0; tracked_alloc(1,local_18,0); } local_34 = g_eosLocalUserId; local_30 = 0; local_38 = 2; local_28 = 1; local_2c = (undefined4 *)(iVar1 + 0x10); uVar3 = _EOS_Platform_GetConnectInterface_4 (g_eosPlatform,&local_38,iVar1,eos_on_query_product_user_id_mappings); _EOS_Connect_QueryProductUserIdMappings_16(uVar3); ExceptionList = local_10; return; } //@@ 00a6fd70 FUN_00a6fd70 void FUN_00a6fd70(int param_1) { void *user; char cVar1; uint uVar2; undefined4 uVar3; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_18 + 0x14); ExceptionList = &local_10; user = *(void **)(param_1 + 4); *(undefined4 *)((int)user + 0x14) = *(undefined4 *)(param_1 + 0x14); eos_user_info_find_or_create(&DAT_00c5ac08,local_18,user); local_8 = 0; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_18); } } local_20 = DAT_00c5abfc; local_24 = 1; local_1c = *(undefined4 *)((int)user + 0x14); uVar3 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&local_24,user,FUN_00a6fe30); _EOS_Presence_QueryPresence_16(uVar3); ExceptionList = local_10; return; } //@@ 00a6fe30 FUN_00a6fe30 void FUN_00a6fe30(int *param_1) { *(byte *)param_1[1] = *(byte *)param_1[1] | 1; if (*param_1 != 0) { _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to retrieve user presence info: %s\n"); } return; } //@@ 00a6fe70 eos_user_info_process_pending /* DB: ? KAGE::System::update right after EOS_Platform_Tick: under its mutex ("Invalid mutex object specified") walks pending queries (list of {vector, callback, ctx}), and when every id resolves to a cached SmartPointer calls the callback and frees the 0x1c node */ void eos_user_info_process_pending(void) { uint uVar1; char cVar2; int *in_ECX; undefined4 extraout_ECX; int *piVar3; uint *puVar4; int *ptr; int *piVar5; undefined1 local_30 [8]; int local_28; byte *local_24; int *local_20; int *local_1c; uint local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1343d; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(byte *)(in_ECX + 7) & 1) != 0) { piVar3 = in_ECX + 6; local_1c = piVar3; local_14 = in_ECX; if (piVar3 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar3 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_30 + 0x2c)); } local_8 = 0; ptr = *(int **)local_14[4]; if (ptr != (int *)local_14[4]) { do { puVar4 = (uint *)ptr[2]; if (puVar4 == (uint *)ptr[3]) { piVar3 = local_14; } else { do { uVar1 = *puVar4; local_18 = uVar1; _Find_lower_bound<>(local_30,&local_18); piVar3 = local_14; if (((*(char *)(local_28 + 0xd) == '\0') && (*(uint *)(local_28 + 0x10) <= uVar1)) && (local_28 != *local_14)) { FUN_00a23df0(local_28 + 0x14); } else { KAGE::SmartPointer::SmartPointer(extraout_ECX); } if ((local_24 == (byte *)0x0) || ((*local_24 & 1) == 0)) { local_8._0_1_ = 1; if ((local_20 != (int *)0x0) && ((cVar2 = (**(code **)(*local_20 + 0xc))(), cVar2 != '\0' && (g_profileReleaseFn != (void *)0x0)))) { (*g_profileReleaseFn)(&local_24); } local_8 = (uint)local_8._1_3_ << 8; piVar5 = (int *)*ptr; goto LAB_00a6ff2f; } local_8._0_1_ = 2; if (((local_20 != (int *)0x0) && (cVar2 = (**(code **)(*local_20 + 0xc))(), cVar2 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_24); } puVar4 = puVar4 + 1; local_8 = (uint)local_8._1_3_ << 8; } while (puVar4 != (uint *)ptr[3]); } (*(code *)ptr[5])(ptr + 2,ptr[6]); piVar5 = (int *)*ptr; *(int **)ptr[1] = piVar5; *(int *)(*ptr + 4) = ptr[1]; piVar3[5] = piVar3[5] + -1; ptr[5] = 0; ptr[6] = 0; FID_conflict__Tidy(ptr + 2); operator_delete(ptr,0x1c); LAB_00a6ff2f: ptr = piVar5; } while (piVar5 != (int *)local_14[4]); piVar3 = local_1c; } local_8 = 3; (**(code **)(*piVar3 + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a70020 GridEntity_Door::play_animation /* ZHL [exact] __thiscall void GridEntity_Door::play_animation(); prototype: db/protos.zhl, confirmed by RET 16 */ void * __thiscall GridEntity_Door::play_animation (GridEntity_Door *this,void *outUserInfo,void *productUserId,void *epicAccountId, byte isFlag) { char isLastRef; uint securityCookie; undefined4 uVar1; byte *userQuery; void *pvVar2; undefined1 uStack00000013; undefined4 local_54; void *local_50; undefined4 local_4c; int **local_48; undefined4 local_44; undefined4 local_40; void *local_3c; void *local_38; void **local_34; int *local_30; undefined1 local_2c [4]; int *local_28; void *accountIdString; byte *newUserQuery; uint accountIdStringSize; uint constructedFlags; GridEntity_Door *savedThis; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b134ad; local_10 = ExceptionList; securityCookie = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; local_8 = 0; constructedFlags = 0; savedThis = this; KAGE::SmartPointer::SmartPointer(this); pvVar2 = productUserId; local_8 = 0; constructedFlags = 1; if (*(int *)outUserInfo == 0) { if (productUserId != (void *)0x0) { uVar1 = FUN_00a706b0(local_2c,productUserId); local_8 = 1; KAGE::SmartPointer::operator_assign(uVar1); local_8 = 2; if (local_28 != (int *)0x0) { isLastRef = (**(code **)(*local_28 + 0xc))(securityCookie); if ((isLastRef != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_2c); } } local_8 = local_8 & 0xffffff00; } if (*(int *)outUserInfo == 0) { if (epicAccountId != (void *)0x0) { uVar1 = FUN_00a70710(local_2c,epicAccountId); local_8 = 3; KAGE::SmartPointer::operator_assign(uVar1); local_8 = 4; if (local_28 != (int *)0x0) { isLastRef = (**(code **)(*local_28 + 0xc))(); if ((isLastRef != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_2c); } } local_8 = local_8 & 0xffffff00; } if (*(int *)outUserInfo == 0) { userQuery = operator_new(0x20); local_8 = 5; newUserQuery = userQuery; if (userQuery == (byte *)0x0) { userQuery = (byte *)0x0; } else { *userQuery = isFlag; local_28 = pvVar2; userQuery[8] = 0; userQuery[9] = 0; userQuery[10] = 0; userQuery[0xb] = 0; userQuery[0xc] = 0; userQuery[0xd] = 0; userQuery[0xe] = 0; userQuery[0xf] = 0; *(void **)(userQuery + 0x10) = pvVar2; *(void **)(userQuery + 0x14) = epicAccountId; userQuery[0x18] = 0xff; userQuery[0x19] = 0xff; userQuery[0x1a] = 0xff; userQuery[0x1b] = 0xff; if (pvVar2 == (void *)0x0) { userQuery[0x18] = 0; userQuery[0x19] = 0; userQuery[0x1a] = 0; userQuery[0x1b] = 0; accountIdStringSize = 1; _EOS_EpicAccountId_ToString_12(epicAccountId,&uStack00000013,&accountIdStringSize); pvVar2 = operator_new_tracked(accountIdStringSize); _EOS_EpicAccountId_ToString_12 (*(undefined4 *)(newUserQuery + 0x14),pvVar2,&accountIdStringSize); userQuery = newUserQuery; local_3c = g_eosLocalUserId; local_34 = &accountIdString; local_40 = 1; local_38 = (void *)0x0; local_30 = (int *)0x1; accountIdString = pvVar2; uVar1 = _EOS_Platform_GetConnectInterface_4 (g_eosPlatform,&local_40,newUserQuery,FUN_00a6fc30); _EOS_Connect_QueryExternalAccountMappings_16(uVar1); if (accountIdString != (void *)0x0) { local_8 = CONCAT31(local_8._1_3_,6); tracked_alloc(1,accountIdString,0); } } else { local_50 = g_eosLocalUserId; local_48 = &local_28; local_4c = 0; local_54 = 2; local_44 = 1; uVar1 = _EOS_Platform_GetConnectInterface_4 (g_eosPlatform,&local_54,userQuery, eos_on_query_product_user_id_mappings); _EOS_Connect_QueryProductUserIdMappings_16(uVar1); } } local_8 = local_8 & 0xffffff00; KAGE::SmartPointer::reset(userQuery); } } this = savedThis; } pvVar2 = productUserId; if (productUserId != (void *)0x0) { _Find_lower_bound<>(&local_38,&productUserId); if (((*(char *)((int)local_30 + 0xd) != '\0') || (pvVar2 < (void *)local_30[4])) || (local_30 == *(int **)this)) { local_38 = pvVar2; FUN_00a23df0(outUserInfo); constructedFlags = 3; local_8 = 7; FUN_00a70d20(local_2c,&local_38); local_8 = 8; if (local_30 != (int *)0x0) { isLastRef = (**(code **)(*local_30 + 0xc))(); if ((isLastRef != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_34); } } local_8 = local_8 & 0xffffff00; } } pvVar2 = epicAccountId; if (epicAccountId != (void *)0x0) { _Find_lower_bound<>(&local_38,&epicAccountId); if (((*(char *)((int)local_30 + 0xd) != '\0') || (pvVar2 < (void *)local_30[4])) || (local_30 == (int *)(this->_desc)._variant)) { local_38 = pvVar2; FUN_00a23df0(outUserInfo); constructedFlags = constructedFlags | 4; local_8 = 9; FUN_00a70d20(local_2c,&local_38); local_8 = 10; if (local_30 != (int *)0x0) { isLastRef = (**(code **)(*local_30 + 0xc))(); if ((isLastRef != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_34); } } } } ExceptionList = local_10; return outUserInfo; } //@@ 00a70380 FUN_00a70380 void FUN_00a70380(void) { char cVar1; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*(int **)(in_ECX + 8) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 8) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(in_ECX + 4); } } ExceptionList = local_10; return; } //@@ 00a703f0 eos_user_info_find_or_create /* DB: ? (out, EOS user id): finds a SmartPointer in the ECX map (_Find_lower_bound), else creates one (FUN_00a70710) whose display name is "localhost" for id 0xfefefefe, "???" without g_userProfile, else the profile's name; FUN_00a61170 calls it with g_eosLocalUserId */ undefined4 * eos_user_info_find_or_create(undefined4 *param_1,void *param_2) { void *pvVar1; char cVar2; int *piVar3; undefined4 uVar4; void *pvVar5; char *displayName; GridEntity_Door *in_ECX; undefined4 extraout_ECX; uint uVar6; longlong lVar7; undefined1 local_44 [8]; int local_3c; undefined4 local_38; int *piStack_34; void *local_2c; undefined **local_28; int *local_24; void *local_20; uint local_1c; char local_15; void *local_10; undefined1 *puStack_c; uint local_8; puStack_c = &LAB_00b13538; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; local_1c = 0; KAGE::SmartPointer::SmartPointer(in_ECX); pvVar1 = param_2; local_8 = 0; local_1c = 1; local_20 = param_2; _Find_lower_bound<>(local_44,&local_20); if (((*(char *)(local_3c + 0xd) == '\0') && (*(void **)(local_3c + 0x10) <= pvVar1)) && (local_3c != *(int *)in_ECX)) { FUN_00a23df0(local_3c + 0x14); } else { KAGE::SmartPointer::SmartPointer(extraout_ECX); } local_8 = 1; uVar6 = 0xb; local_1c = 0xb; piVar3 = (int *)KAGE::SmartPointer::operator_assign(&local_28); if (*piVar3 == 0) { uVar4 = FUN_00a70710(&local_38,0); local_8 = 2; uVar6 = 0xf; local_1c = 0xf; piVar3 = (int *)KAGE::SmartPointer::operator_assign(uVar4); local_15 = '\x01'; if (*piVar3 != 0) goto LAB_00a704cb; } else { LAB_00a704cb: local_15 = '\0'; } if ((uVar6 & 4) != 0) { uVar6 = uVar6 & 0xfffffffb; local_8 = 3; local_1c = uVar6; if (((piStack_34 != (int *)0x0) && (cVar2 = (**(code **)(*piStack_34 + 0xc))(), cVar2 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_38); } } local_8 = 0; if ((uVar6 & 2) != 0) { uVar6 = uVar6 & 0xfffffffd; local_8 = 4; local_1c = uVar6; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(), cVar2 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_28); } local_8 = local_8 & 0xffffff00; } if (local_15 != '\0') { pvVar5 = GridEntity_Door::play_animation(in_ECX,&local_38,pvVar1,(void *)0x0,0); local_8 = 5; KAGE::SmartPointer::operator_assign(pvVar5); local_8 = 6; if (((piStack_34 != (int *)0x0) && (cVar2 = (**(code **)(*piStack_34 + 0xc))(), cVar2 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_38); } local_8 = local_8 & 0xffffff00; } if ((pvVar1 != (void *)0x0) && (((_Find_lower_bound<>(local_44,¶m_2), *(char *)(local_3c + 0xd) != '\0' || (pvVar1 < *(void **)(local_3c + 0x10))) || (local_3c == *(int *)in_ECX)))) { local_2c = pvVar1; FUN_00a23df0(param_1); local_1c = uVar6 | 0x10; local_8 = 7; FUN_00a70d20(&local_38,&local_2c); local_8 = 8; if (((local_24 != (int *)0x0) && (cVar2 = (**(code **)(*local_24 + 0xc))(), cVar2 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_28); } } pvVar1 = g_userProfile; local_24 = g_userProfile; local_28 = KAGE::System::UserProfile::vftable; local_8 = 0xb; if (g_userProfile == (void *)0x0) { LAB_00a70665: displayName = &DAT_00b6d12c; } else { lVar7 = __aullshr(); if (lVar7 == 0xfefefefe) { displayName = "localhost"; } else { if (pvVar1 == (void *)0x0) goto LAB_00a70665; displayName = *(char **)((int)pvVar1 + 0x10); } if (pvVar1 != (void *)0x0) { local_38 = *(undefined4 *)((int)pvVar1 + 8); piStack_34 = *(int **)((int)pvVar1 + 0xc); goto LAB_00a70678; } } piStack_34 = (int *)0x0; local_38 = 0; LAB_00a70678: KAGE::System::UserProfile::set_id((void *)*param_1,(ulonglong *)&local_38,(byte *)displayName); KAGE::SmartPointer::operator_assign(param_1); ExceptionList = local_10; return param_1; } //@@ 00a706b0 FUN_00a706b0 undefined4 FUN_00a706b0(undefined4 param_1,uint param_2) { int *in_ECX; undefined4 extraout_ECX; undefined1 local_10 [8]; int local_8; _Find_lower_bound<>(local_10,¶m_2); if (((*(char *)(local_8 + 0xd) == '\0') && (*(uint *)(local_8 + 0x10) <= param_2)) && (local_8 != *in_ECX)) { FUN_00a23df0(local_8 + 0x14); return param_1; } KAGE::SmartPointer::SmartPointer(extraout_ECX); return param_1; } //@@ 00a70710 FUN_00a70710 undefined4 FUN_00a70710(undefined4 param_1,uint param_2) { int in_ECX; undefined1 local_10 [8]; int local_8; _Find_lower_bound<>(local_10,¶m_2); if (((*(char *)(local_8 + 0xd) == '\0') && (*(uint *)(local_8 + 0x10) <= param_2)) && (local_8 != *(int *)(in_ECX + 8))) { FUN_00a23df0(local_8 + 0x14); return param_1; } KAGE::SmartPointer::SmartPointer(local_8); return param_1; } //@@ 00a70770 FUN_00a70770 void FUN_00a70770(int *param_1,undefined4 param_2,undefined4 param_3) { int *piVar1; int *piVar2; undefined4 *puVar3; char cVar4; size_t *psVar5; GridEntity_Door *in_ECX; int iVar6; int *piVar7; uint uVar8; undefined1 local_28 [4]; int *local_24; int *local_20; void *local_1c; size_t local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1357d; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = &(in_ECX->_desc)._varData; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_28 + 0x24)); } piVar7 = &(in_ECX->_desc)._spawnCount; local_8 = 1; local_18 = *piVar7; local_24 = piVar7; if ((in_ECX->_desc)._spawnSeed == 0x9249249) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 2; local_1c = (void *)0x0; local_20 = piVar7; psVar5 = operator_new(0x1c); psVar5[2] = 0; psVar5[3] = 0; psVar5[4] = 0; psVar5[5] = 0; psVar5[6] = 0; piVar2 = &(in_ECX->_desc)._spawnSeed; *piVar2 = *piVar2 + 1; puVar3 = *(undefined4 **)(local_18 + 4); *psVar5 = local_18; psVar5[1] = (size_t)puVar3; *(size_t **)(local_18 + 4) = psVar5; *puVar3 = psVar5; local_8 = local_8 & 0xffffff00; iVar6 = *(int *)(*piVar7 + 4); piVar7 = (int *)(iVar6 + 8); if (piVar7 != param_1) { local_1c = (void *)*param_1; local_18 = param_1[1] - (int)local_1c; local_14 = (void *)*piVar7; if ((uint)(*(int *)(iVar6 + 0x10) - (int)local_14 >> 2) < (uint)((int)local_18 >> 2)) { std::vector::reserve_clear((int)local_18 >> 2); local_14 = (void *)*piVar7; } memmove(local_14,local_1c,local_18); *(size_t *)(iVar6 + 0xc) = (int)local_14 + local_18; } uVar8 = 0; iVar6 = *(int *)(*local_24 + 4); *(undefined4 *)(iVar6 + 0x14) = param_2; *(undefined4 *)(iVar6 + 0x18) = param_3; iVar6 = *param_1; if (param_1[1] - iVar6 >> 2 != 0) { do { GridEntity_Door::play_animation(in_ECX,local_28,*(void **)(iVar6 + uVar8 * 4),(void *)0x0,0); local_8._0_1_ = 3; if (((local_24 != (int *)0x0) && (cVar4 = (**(code **)(*local_24 + 0xc))(), cVar4 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_28); } local_8 = (uint)local_8._1_3_ << 8; uVar8 = uVar8 + 1; iVar6 = *param_1; } while (uVar8 < (uint)(param_1[1] - iVar6 >> 2)); } local_8 = 4; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a70950 FUN_00a70950 void FUN_00a70950(void) { void *in_ECX; *(undefined4 *)((int)in_ECX + 0xc) = 0; *(undefined4 *)((int)in_ECX + 0x10) = 0; FID_conflict__Tidy(in_ECX); return; } //@@ 00a70970 FUN_00a70970 void FUN_00a70970(void) { int *in_ECX; FUN_00a70d50(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x1c); return; } //@@ 00a70990 FUN_00a70990 void FUN_00a70990(void) { LPCRITICAL_SECTION lpCriticalSection; int *in_ECX; lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[8]; in_ECX[6] = (int)KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[8] = 0; } *(byte *)(in_ECX + 7) = *(byte *)(in_ECX + 7) & 0xfe; in_ECX[6] = (int)KAGE::MutexBase::vftable; FUN_00a70cc0(); FUN_00a70d50(in_ECX + 2,*(undefined4 *)(in_ECX[2] + 4)); operator_delete((void *)in_ECX[2],0x1c); FUN_00a70d50(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x1c); return; } //@@ 00a70a10 eos_user_info_find_or_create /* DB: ? looks a user up in two EpicUserInfo maps (_Find_lower_bound on EOS ids at +0x10/+0x14), else builds one (FUN_00a70710) as KAGE::SmartPointer and registers it via UserProfile::find_or_create; callers FUN_00a6f770/00a6fa10/00a6fd70 ('Failed to retrieve product ID mapping: %s', 'Unsupported platform for user') prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall eos_user_info_find_or_create(void *this,void *outUserInfo,void *user) { int *piVar1; uint uVar2; char cVar3; undefined4 uVar4; int iVar5; int extraout_EAX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; uint uVar6; undefined1 local_40 [8]; int local_38; undefined1 local_34 [4]; uint *local_30; uint local_2c; undefined4 local_28; int *local_24 [3]; uint local_18; int *local_14; void *local_10; undefined1 *puStack_c; uint local_8; puStack_c = &LAB_00b135de; local_10 = ExceptionList; ExceptionList = &local_10; local_30 = (uint *)((int)user + 0x10); local_8 = 0; local_18 = 0; piVar1 = (int *)*local_30; local_24[0] = piVar1; local_14 = this; _Find_lower_bound<>(local_40,local_24); if (((*(char *)(local_38 + 0xd) == '\0') && (*(int **)(local_38 + 0x10) <= piVar1)) && (local_38 != *(int *)this)) { FUN_00a23df0(local_38 + 0x14); } else { KAGE::SmartPointer::SmartPointer(extraout_ECX); } local_8 = 0; uVar6 = 3; local_18 = 3; if (*(int *)outUserInfo == 0) { uVar4 = FUN_00a70710(&local_28,*(undefined4 *)((int)user + 0x14)); local_8 = 1; KAGE::SmartPointer::operator_assign(uVar4); local_8 = 2; if (((local_24[0] != (int *)0x0) && (cVar3 = (**(code **)(*local_24[0] + 0xc))(), cVar3 != '\0') ) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_28); } local_8 = local_8 & 0xffffff00; if (*(int *)outUserInfo == 0) { iVar5 = FUN_00a23bb0(); uVar6 = 7; if (iVar5 == 0) { KAGE::SmartPointer::SmartPointer(extraout_ECX_00); } else { FUN_00a23df0(iVar5 + 0x20); } local_18 = 7; local_8 = 3; KAGE::SmartPointer::operator_assign(&local_28); local_8 = 4; if (((local_24[0] != (int *)0x0) && (cVar3 = (**(code **)(*local_24[0] + 0xc))(), cVar3 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_28); } local_8 = local_8 & 0xffffff00; } } local_2c = *(uint *)((int)user + 8); local_28 = *(undefined4 *)((int)user + 0xc); UserProfile::find_or_create(&local_2c); if (extraout_EAX != 0) { KAGE::SmartPointer::operator_assign(outUserInfo); } uVar2 = *local_30; if ((uVar2 != 0) && (((_Find_lower_bound<>(local_40,local_30), *(char *)(local_38 + 0xd) != '\0' || (uVar2 < *(uint *)(local_38 + 0x10))) || (local_38 == *local_14)))) { local_2c = uVar2; FUN_00a23df0(outUserInfo); uVar6 = uVar6 | 8; local_8 = 5; local_18 = uVar6; FUN_00a70d20(local_34,&local_2c); local_8 = 6; if (((local_24[0] != (int *)0x0) && (cVar3 = (**(code **)(*local_24[0] + 0xc))(), cVar3 != '\0') ) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_28); } local_8 = local_8 & 0xffffff00; } uVar2 = *(uint *)((int)user + 0x14); if (uVar2 != 0) { piVar1 = local_14 + 2; _Find_lower_bound<>(local_40,(uint *)((int)user + 0x14)); if (((*(char *)(local_38 + 0xd) != '\0') || (uVar2 < *(uint *)(local_38 + 0x10))) || (local_38 == *piVar1)) { local_2c = uVar2; FUN_00a23df0(outUserInfo); local_18 = uVar6 | 0x10; local_8 = 7; FUN_00a70d20(local_34,&local_2c); local_8 = 8; if (((local_24[0] != (int *)0x0) && (cVar3 = (**(code **)(*local_24[0] + 0xc))(), cVar3 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_28); } } } ExceptionList = local_10; return outUserInfo; } //@@ 00a70cc0 FUN_00a70cc0 void FUN_00a70cc0(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; puVar1[5] = 0; puVar1[6] = 0; FID_conflict__Tidy(puVar1 + 2); operator_delete(puVar1,0x1c); puVar1 = puVar2; } operator_delete((void *)*in_ECX,0x1c); return; } //@@ 00a70d20 FUN_00a70d20 void FUN_00a70d20(undefined4 *param_1,undefined4 param_2) { undefined4 local_10; undefined1 local_c; FUN_00a70e00(&local_10,param_2); *param_1 = local_10; *(undefined1 *)(param_1 + 1) = local_c; return; } //@@ 00a70d50 FUN_00a70d50 void FUN_00a70d50(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { FUN_00a70d50(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[6] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[6] + 0xc))(uVar4), cVar3 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(param_2 + 5); } local_8 = 0xffffffff; operator_delete(param_2,0x1c); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 00a70e00 FUN_00a70e00 void FUN_00a70e00(int *param_1,uint *param_2) { undefined8 uVar1; char cVar2; int iVar3; int *piVar4; int *piVar5; uint uVar6; undefined8 *puVar7; int *piVar8; int *in_ECX; int *piVar9; int *piVar10; int *local_28; int iStack_24; undefined1 local_1c [8]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13615; local_10 = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar7 = (undefined8 *)_Find_lower_bound<>(local_1c,param_2); iVar3 = *(int *)(puVar7 + 1); uVar1 = *puVar7; if ((*(char *)(iVar3 + 0xd) == '\0') && (*(uint *)(iVar3 + 0x10) <= *param_2)) { *param_1 = iVar3; *(undefined1 *)(param_1 + 1) = 0; ExceptionList = local_10; return; } if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar6); } iVar3 = *in_ECX; local_8 = 0; local_14 = (int *)0x0; piVar8 = operator_new(0x1c); local_8 = 1; piVar8[4] = *param_2; local_14 = piVar8; FUN_00a23df0(param_2 + 1); local_28 = (int *)uVar1; *piVar8 = iVar3; piVar8[1] = iVar3; piVar8[2] = iVar3; *(undefined2 *)(piVar8 + 3) = 0; piVar4 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; piVar8[1] = (int)local_28; if (local_28 == piVar4) { *piVar4 = (int)piVar8; piVar4[1] = (int)piVar8; piVar4[2] = (int)piVar8; *(undefined1 *)(piVar8 + 3) = 1; } else { iStack_24 = (int)((ulonglong)uVar1 >> 0x20); if (iStack_24 == 0) { local_28[2] = (int)piVar8; if (local_28 == (int *)piVar4[2]) { piVar4[2] = (int)piVar8; } } else { *local_28 = (int)piVar8; if (local_28 == (int *)*piVar4) { *piVar4 = (int)piVar8; } } cVar2 = *(char *)(piVar8[1] + 0xc); piVar10 = piVar8; while (cVar2 == '\0') { piVar5 = (int *)piVar10[1]; piVar9 = *(int **)piVar5[1]; if (piVar5 == piVar9) { piVar9 = (int *)((undefined4 *)piVar5[1])[2]; if ((char)piVar9[3] == '\0') { LAB_00a70f5c: *(undefined1 *)(piVar5 + 3) = 1; *(undefined1 *)(piVar9 + 3) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; piVar10 = *(int **)(piVar10[1] + 4); } else { if (piVar10 == (int *)piVar5[2]) { FUN_00415fe0(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(piVar10[1] + 4)); } } else { if ((char)piVar9[3] == '\0') goto LAB_00a70f5c; if (piVar10 == (int *)*piVar5) { FUN_00415f80(piVar5); piVar10 = piVar5; } *(undefined1 *)(piVar10[1] + 0xc) = 1; *(undefined1 *)(*(int *)(piVar10[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(piVar10[1] + 4)); } cVar2 = *(char *)(piVar10[1] + 0xc); } *(undefined1 *)(piVar4[1] + 0xc) = 1; } *param_1 = (int)piVar8; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a70fe0 FUN_00a70fe0 void FUN_00a70fe0(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00afb440; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(void **)(in_ECX + 0x10) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0x10),0); *(undefined4 *)(in_ECX + 0x10) = 0; } local_8 = 1; if (*(int **)(in_ECX + 0x24) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x24) + 0xc))(uVar2); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(in_ECX + 0x20); } } local_8 = 2; if (*(int **)(in_ECX + 0x18) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x18) + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x14); } } ExceptionList = local_10; return; } //@@ 00a710a0 KAGE::System::Init /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? "KAGE has already been initialized", "Command thread is already initialized", OpenAL ALC_SOFT_system_events/alcReopenDeviceSOFT, epiconlineservices, FileSystem::load_mount_points; only caller kage_system_init */ undefined4 KAGE::System::Init(void) { uint *puVar1; char cVar2; uint uVar3; undefined4 *puVar4; void *pvVar5; byte *ptr; int *piVar6; LPCRITICAL_SECTION lpCriticalSection; undefined4 in_ECX; undefined4 in_EDX; bool bVar7; byte *local_1c; LPCRITICAL_SECTION local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13685; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (DAT_00c78aad != '\0') { KAGE_LogMessage(0x10,(byte *)"KAGE has already been initialized\n"); } DAT_00c78d94 = in_EDX; DAT_00c78d98 = in_ECX; puVar4 = operator_new(0x40); local_14 = puVar4; if (puVar4 == (undefined4 *)0x0) { puVar4 = (undefined4 *)0x0; } else { *puVar4 = Memory::HeapBase::vftable; puVar4[2] = 0x7fcb9dd6; *(undefined1 *)(puVar4 + 3) = 0; *(undefined1 *)(puVar4 + 5) = 0; puVar4[4] = Mutex::vftable; puVar4[6] = 0; local_8 = 1; puVar4[7] = 0; puVar4[8] = 0; pvVar5 = operator_new(0xc); *(void **)pvVar5 = pvVar5; *(void **)((int)pvVar5 + 4) = pvVar5; puVar4[7] = pvVar5; local_8._0_1_ = 2; puVar4[10] = 0; puVar4[0xb] = 0; puVar4[0xc] = 0; puVar4[0xd] = 0; puVar4[0xe] = 0; puVar4[0xf] = 0; pvVar5 = operator_new(0x10); *(void **)pvVar5 = pvVar5; *(void **)((int)pvVar5 + 4) = pvVar5; puVar4[0xe] = pvVar5; local_8 = CONCAT31(local_8._1_3_,3); *(byte *)(puVar4 + 3) = *(byte *)(puVar4 + 3) | 1; if (*(code **)(puVar4[4] + 4) == FUN_00a15770) { FUN_00a15770(); } else { (**(code **)(puVar4[4] + 4))(uVar3); } *puVar4 = Memory::MainHeap::vftable; puVar4[10] = DAT_00c79a04; puVar4[0xb] = 0; puVar1 = puVar4 + 0xc; bVar7 = CARRY4(*puVar1,(uint)g_allocatedBytesNoHeap); *puVar1 = *puVar1 + (uint)g_allocatedBytesNoHeap; puVar4[0xd] = puVar4[0xd] + g_allocatedBytesNoHeap._4_4_ + (uint)bVar7; g_mainHeap = puVar4; } local_8 = 0xffffffff; FUN_00a23230(puVar4); _DAT_00c37968 = _DAT_00c37968 | 1; FileSystem::load_mount_points(&PTR_vftable_00c379e0); local_18 = (LPCRITICAL_SECTION)0xffffffff; ptr = path_join(&s_empty,&s_empty,0,1); local_8 = 5; local_1c = ptr; FUN_00a15f10(&local_1c); if (ptr != (byte *)0x0) { local_8 = 6; tracked_alloc(1,ptr,0); } local_8 = 0xffffffff; _DAT_00c379e4 = _DAT_00c379e4 | 1; memset(&DAT_00c37b14,0,0x20004); cVar2 = Graphics::Manager::Init(); if (cVar2 != '\0') { cVar2 = Sound::ManagerOpenAL::Init(); if (cVar2 != '\0') { _DAT_00c5aaec = alcGetProcAddress(DAT_00c5aad8,"alcDevicePauseSOFT"); _DAT_00c5aaf0 = alcGetProcAddress(DAT_00c5aad8,"alcDeviceResumeSOFT"); DAT_00c5aaf4 = (code *)alcGetProcAddress(DAT_00c5aad8,"alcEventControlSOFT"); DAT_00c5aaf8 = (code *)alcGetProcAddress(DAT_00c5aad8,"alcEventCallbackSOFT"); _DAT_00c5aafc = alcGetProcAddress(DAT_00c5aad8,"alcReopenDeviceSOFT"); LOCK(); DAT_00c5ab00 = 0; UNLOCK(); cVar2 = alcIsExtensionPresent(0,"ALC_SOFT_system_events"); if (cVar2 == '\x01') { local_14 = (undefined4 *)0x19d6; (*DAT_00c5aaf4)(1,&local_14,1); (*DAT_00c5aaf8)(FUN_00a9e890,&PTR_vftable_00c5aaa0); } } cVar2 = FUN_00a21980(); if (cVar2 != '\0') { cVar2 = FUN_00a8c430(); if (cVar2 != '\0') { piVar6 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar6 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); (**(code **)(*(int *)*puVar4 + 0x38))("epiconlineservices"); } if ((DAT_00c5ab48 & 1) == 0) { lpCriticalSection = operator_new(0x1c); local_18 = lpCriticalSection; if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { DAT_00c5ab4c = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; InitializeCriticalSection(lpCriticalSection); DAT_00c5ab4c = lpCriticalSection; } DAT_00c5ab48 = DAT_00c5ab48 | 1; } if (DAT_00c79b3c == '\0') { (**(code **)(DAT_00c79b54 + 4))(); DAT_00c79b3c = '\x01'; } if (((byte)g_multiplayerCommandThreadFlags & 1) == 0) { if (DAT_00c79a84 == '\0') { (**(code **)(DAT_00c79a9c + 4))(); DAT_00c79a84 = '\x01'; } (**(code **)(DAT_00c79aa8 + 4)) (FUN_00a9e950,2,0xffffffff,0x10000,&g_multiplayerCommandThreadFlags); g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags | 1; } else { KAGE_LogMessage(0x10,(byte *)"Command thread is already initialized\n"); } if (DAT_00c79ac0 == '\0') { (**(code **)(DAT_00c79ad8 + 4))(); DAT_00c79ac0 = '\x01'; } std::list>::push_back(FUN_00a732b0,&DAT_00c79a60); _DAT_00c79a54 = _DAT_00c79a54 | 1; _DAT_00c5abc4 = _DAT_00c5abc4 | 1; _DAT_00c5aa84 = _DAT_00c5aa84 | 1; EosManager::Init(); DAT_00c78aad = 1; ExceptionList = local_10; return 1; } } } ExceptionList = local_10; return 0; } //@@ 00a714e0 KAGE::System::update /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? per-frame engine tick: optional input poll (FUN_00a21cb0 -> Gamepad_processEvents), time delta, updates every TheoraVideoManager clip (vfunc +0x18) under its mutex, periodic logger flush (g_logFile vfunc +0x20), sound timers, map of timed handles, EOS_Platform_Tick; ModManager::UpdateWorkshopMods loop */ void KAGE::System::update(void) { int *piVar1; longlong lVar2; longlong lVar3; longlong lVar4; char in_CL; uint uVar5; uint uVar6; undefined4 *puVar7; int *ptr; int *piVar8; void *pvVar9; undefined4 in_XMM0_Da; float fVar10; undefined4 in_XMM0_Db; ulonglong uVar11; ulonglong uVar12; undefined4 *local_1c; uint local_18; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b136bd; local_10 = ExceptionList; ExceptionList = &local_10; if (in_CL != '\0') { FUN_00a21cb0(__security_cookie ^ (int)register0x00000010 - 4U); } FUN_00a266a0(); pvVar9 = g_theoraVideoManager; fVar10 = (float)(double)CONCAT44(in_XMM0_Db,in_XMM0_Da); local_1c = (undefined4 *)0x0; local_18 = local_18 & 0xffffff00; local_14 = (void *)(fVar10 - _DAT_00c5ac74); puVar7 = *(undefined4 **)((int)g_theoraVideoManager + 0x28); _DAT_00c5ac74 = fVar10; if (puVar7 != (undefined4 *)0x0) { local_1c = puVar7; ::Mutex::lock(puVar7); } local_8 = 0; puVar7 = *(undefined4 **)((int)pvVar9 + 0x10); if (puVar7 != *(undefined4 **)((int)pvVar9 + 0x14)) { do { FUN_00a90bc0(); (**(code **)(*(int *)*puVar7 + 0x18))(); puVar7 = puVar7 + 1; } while (puVar7 != *(undefined4 **)((int)pvVar9 + 0x14)); } if (local_1c != (undefined4 *)0x0) { *(undefined1 *)(local_1c + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_1c); local_1c = (undefined4 *)0x0; } local_8 = 0xffffffff; ::Mutex::ScopeLock::~ScopeLock(&local_1c); uVar11 = GetTimeNs(); uVar5 = (uint)(uVar11 >> 0x20); uVar12 = (uVar11 & 0xffffffff) * 0xd7b634db; local_1c = (undefined4 *)uVar12; lVar2 = (uVar11 & 0xffffffff) * 0x431bde82; local_18 = (uint)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar5 * 0x431bde82; local_14 = (void *)lVar3; lVar4 = (ulonglong)uVar5 * 0xd7b634db + (uVar12 >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), local_18 + CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); uVar6 = (uint)((ulonglong)lVar3 >> 0x20); uVar5 = (uint)lVar3 >> 0x12 | uVar6 * 0x4000; if (((uVar6 >> 0x12) - _DAT_00c5aa8c != (uint)(uVar5 < _DAT_00c5aa88)) || (DAT_00c5aa90 <= uVar5 - _DAT_00c5aa88)) { if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(); } uVar12 = GetTimeNs(); uVar5 = (uint)(uVar12 >> 0x20); lVar2 = (uVar12 & 0xffffffff) * 0x431bde82; local_14 = (void *)((ulonglong)lVar2 >> 0x20); lVar3 = (ulonglong)uVar5 * 0x431bde82; local_18 = (uint)lVar3; lVar4 = (ulonglong)uVar5 * 0xd7b634db + ((uVar12 & 0xffffffff) * 0xd7b634db >> 0x20); lVar3 = lVar3 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar4 >> 0x20), (int)local_14 + (uint)CARRY4((uint)lVar2,(uint)lVar4)), (int)((ulonglong)(lVar4 + lVar2) >> 0x20)); _DAT_00c5aa8c = (uint)((ulonglong)lVar3 >> 0x20); _DAT_00c5aa88 = (uint)lVar3 >> 0x12 | _DAT_00c5aa8c * 0x4000; _DAT_00c5aa8c = _DAT_00c5aa8c >> 0x12; } if ((DAT_00c5abc4 & 1) != 0) { lobby_process_user_commands(); } local_14 = *(void **)g_memoryManager_heaps; pvVar9 = g_memoryManager_heaps; if (local_14 != g_memoryManager_heaps) { do { piVar1 = *(int **)((int)local_14 + 0x14); if (((*(byte *)(piVar1 + 3) & 1) != 0) && (ptr = *(int **)piVar1[0xe], ptr != (int *)piVar1[0xe])) { do { piVar8 = ptr + 3; *(char *)piVar8 = (char)*piVar8 + -1; if ((char)*piVar8 == '\0') { (**(code **)(*piVar1 + 8))(ptr[2],0); piVar8 = (int *)*ptr; *(int **)ptr[1] = piVar8; *(int *)(*ptr + 4) = ptr[1]; piVar1[0xf] = piVar1[0xf] + -1; operator_delete(ptr,0x10); } else { piVar8 = (int *)*ptr; } ptr = piVar8; } while (piVar8 != (int *)piVar1[0xe]); pvVar9 = g_memoryManager_heaps; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } while (local_14 != pvVar9); } _EOS_Platform_Tick_4(g_eosPlatform); eos_user_info_process_pending(); ExceptionList = local_10; return; } //@@ 00a71770 kage_shutdown /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: ? only call from IsaacMain (0093140e): releases EOS (_EOS_Platform_Release, _EOS_Shutdown), closes g_logFile, frees g_deflateCompressor, stops the multiplayer command thread (ThreadSafeQueue::shutdown x3), clears g_theoraVideoManager and global string tables */ void kage_shutdown(void) { int iVar1; qword qVar2; LPCRITICAL_SECTION ptr; char *pcVar3; void *pvVar4; uint uVar5; int *piVar6; undefined4 *puVar7; qword *pqVar8; char *this; int *piVar9; undefined4 *puVar10; void *pvVar11; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b136e0; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((DAT_00c5abf4 & 1) != 0) { if (DAT_00c5abf8 != (void *)0x0) { local_8 = 0; tracked_alloc(1,DAT_00c5abf8,0); DAT_00c5abf8 = (void *)0x0; } local_8 = 0xffffffff; DAT_00c5abf4 = DAT_00c5abf4 & 0xffffffef; DAT_00c5abfc = 0; g_eosLocalUserId = (void *)0x0; g_eosPlatform = (void *)0x0; (**(code **)(DAT_00c5ac20 + 8))(uVar5); _EOS_Platform_Release_4(g_eosPlatform); _EOS_Shutdown_0(); DAT_00c5abf4 = DAT_00c5abf4 & 0xfffffffe; } if ((g_logFile != (void *)0x0) && ((**(code **)(*(int *)g_logFile + 0x20))(), g_logFile != (void *)0x0)) { (*(code *)**(undefined4 **)g_logFile)(1); g_logFile = (void *)0x0; } pvVar11 = DAT_00c7de50; _DAT_00c79bdc = 0; if (DAT_00c7de50 != (void *)0x0) { local_8 = 1; tracked_alloc(1,*(void **)((int)DAT_00c7de50 + 8),0); local_8 = 0xffffffff; operator_delete(pvVar11,0xc); DAT_00c7de50 = (void *)0x0; } if (g_deflateCompressor != (void *)0x0) { FUN_00a615a0(g_deflateCompressor); g_deflateCompressor = (void *)0x0; } if (DAT_00c5abd8 != (void *)0x0) { local_8 = 2; tracked_alloc(1,DAT_00c5abd8,0); local_8 = 0xffffffff; DAT_00c5abd8 = (void *)0x0; } if (((byte)g_multiplayerCommandThreadFlags & 1) != 0) { g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags | 2; (**(code **)(DAT_00c79aa8 + 0xc))(); KAGE::ThreadSafeQueue::shutdown(); g_multiplayerCommandThreadFlags._0_1_ = (byte)g_multiplayerCommandThreadFlags & 0xfc; } KAGE::ThreadSafeQueue::shutdown(); FUN_00a1d6b0(FUN_00a732b0); KAGE::ThreadSafeQueue::shutdown(); _DAT_00c79a54 = _DAT_00c79a54 & 0xfffffffe; _DAT_00c5abc4 = _DAT_00c5abc4 & 0xfffffffe; if (g_theoraVideoManager != (void *)0x0) { (*(code *)**(undefined4 **)g_theoraVideoManager)(1); } pcVar3 = DAT_00c79be4; g_theoraVideoManager = (void *)0x0; iVar1 = DAT_00c798d8; for (this = DAT_00c79be0; DAT_00c798d8 = iVar1, this != pcVar3; this = this + 0x34) { std::string::_Tidy_deallocate(this + 0x18); std::string::_Tidy_deallocate(this); iVar1 = DAT_00c798d8; } _DAT_00c5ab08 = _DAT_00c5ab08 & 0xfffffffe; DAT_00c5ab14 = DAT_00c5ab14 & 0xfffffffe; _DAT_00c5af9c = _DAT_00c5af9c & 0xfffffffe; DAT_00c79be4 = DAT_00c79be0; FUN_00a23ee0(&DAT_00c798d8,*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; DAT_00c798dc = 0; g_userProfile = (void *)0x0; KAGE::SmartPointer::reset(&DAT_00c799d8,(void *)0x0); pvVar11 = g_userProfileLock; if (g_userProfileLock != (void *)0x0) { DeleteCriticalSection(g_userProfileLock); operator_delete(pvVar11,0x1c); g_userProfileLock = (void *)0x0; } DAT_00c5aa74 = DAT_00c5aa74 & 0xfe; _DAT_00c5ac4c = _DAT_00c5ac4c & 0xfffffffe; FUN_00a177f0(); if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(); } _DAT_00c5aa84 = _DAT_00c5aa84 & 0xfffffffe; FUN_00a21b70(); FUN_00a9e5a0(); FUN_00a13060(); (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); (*(code *)epoxy_glDeleteFramebuffers)(1,&DAT_00c7998c); (*(code *)epoxy_glDeleteRenderbuffers)(1,&DAT_00c79990); FUN_00a6af90(); g_glfwWindow = (void *)0x0; piVar6 = DAT_00c379f8; piVar9 = DAT_00c379f4; if (DAT_00c379f4 != DAT_00c379f8) { do { if ((undefined4 *)*piVar9 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar9)(1); *piVar9 = 0; piVar6 = DAT_00c379f8; } piVar9 = piVar9 + 1; } while (piVar9 != piVar6); } DAT_00c379ec = DAT_00c379e8; puVar7 = DAT_00c37a04; puVar10 = DAT_00c37a00; DAT_00c379f8 = DAT_00c379f4; if (DAT_00c37a00 != DAT_00c37a04) { do { piVar6 = (int *)*puVar10; if (piVar6 != (int *)0x0) { iVar1 = *piVar6; if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar1 + -4); qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 - uVar5; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) - (uint)((uint)qVar2 < uVar5); free((void *)(iVar1 + -4)); local_8 = 0xffffffff; *piVar6 = 0; } operator_delete(piVar6,8); *puVar10 = 0; puVar7 = DAT_00c37a04; } puVar10 = puVar10 + 1; } while (puVar10 != puVar7); } _DAT_00c379e4 = _DAT_00c379e4 & 0xfffffffe; local_14 = *(void **)g_memoryManager_heaps; pvVar11 = g_memoryManager_heaps; DAT_00c37a04 = DAT_00c37a00; if (local_14 != g_memoryManager_heaps) { do { pvVar4 = local_14; if (*(undefined4 **)((int)local_14 + 0x14) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)((int)local_14 + 0x14))(1); *(undefined4 *)((int)pvVar4 + 0x14) = 0; pvVar11 = g_memoryManager_heaps; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } while (local_14 != pvVar11); } FID_conflict__Erase_tree_>_> (&g_memoryManager_heaps, (fuzzer_allocator_> *)&g_memoryManager_heaps, *(_Tree_node **)((int)pvVar11 + 4)); *(void **)((int)pvVar11 + 4) = pvVar11; *(void **)pvVar11 = pvVar11; *(void **)((int)pvVar11 + 8) = pvVar11; ptr = DAT_00c37960; _DAT_00c37968 = _DAT_00c37968 & 0xfffffffe; _DAT_00c37970 = 0; if (DAT_00c7de48 == 2) { if (DAT_00c37960 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(DAT_00c37960); operator_delete(ptr,0x1c); DAT_00c37960 = (LPCRITICAL_SECTION)0x0; } DAT_00c3795c = DAT_00c3795c & 0xfe; DAT_00c7de48 = 1; } DAT_00c78aad = 0; ExceptionList = local_10; return; } //@@ 00a71c20 FUN_00a71c20 undefined4 FUN_00a71c20(void) { uint uVar1; int in_ECX; uVar1 = *(uint *)(in_ECX + 8) | *(uint *)(in_ECX + 0xc); if (uVar1 == 0) { return 0; } return CONCAT31((int3)(uVar1 >> 8),1); } //@@ 00a71c40 Lobby::refresh_members /* DB: ? thiscall: snapshots the member id vector at +0x10, calls vfunc +0x18 to refill it, compares 8-byte ids and on change notifies via g_multiplayerLobbyPtr; LobbySteam::request_lobby_data, Multiplayer::handle_member_status prototype: db/protos.zhl */ void __thiscall Lobby::refresh_members(void *this) { int *piVar1; char cVar2; uint uVar3; int iVar4; void *ptr; uint uVar5; int iVar6; bool bVar7; int *local_40; int local_3c; undefined4 local_34; void *local_30; undefined4 uStack_2c; undefined **ppuStack_28; int iStack_24; int *local_20; undefined8 local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1371d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x10); local_1c = (ulonglong)(uint)local_1c; FUN_00915d70(piVar1); local_8 = 0; *(int *)((int)this + 0x14) = *piVar1; (**(code **)(*(int *)this + 0x18))(piVar1,uVar3); uVar5 = *(int *)((int)this + 0x14) - *piVar1 >> 3; bVar7 = local_3c - (int)local_40 >> 3 != uVar5; uVar3 = 0; if (uVar5 != 0) { iVar6 = *piVar1 - (int)local_40; do { if (bVar7) goto LAB_00a71cd9; if ((*local_40 == *(int *)(iVar6 + (int)local_40)) && (local_40[1] == *(int *)(iVar6 + 4 + (int)local_40))) { bVar7 = false; } else { bVar7 = true; } uVar3 = uVar3 + 1; local_40 = local_40 + 2; } while (uVar3 < uVar5); } if (bVar7) { LAB_00a71cd9: cVar2 = (**(code **)(*(int *)this + 0xc))(); if (cVar2 == '\0') goto LAB_00a71d47; ppuStack_28 = KAGE::Network::Multiplayer::ConstLobby::vftable; iStack_24 = 0; local_20 = (int *)0x0; local_8._0_1_ = 1; std::shared_ptr::assign(&iStack_24,&g_multiplayerLobbyPtr); local_8 = (uint)local_8._1_3_ << 8; uVar3 = 7; ppuStack_28 = KAGE::Network::Multiplayer::Lobby::vftable; if (iStack_24 == 0) { local_1c = 0; local_1c._4_4_ = 0; local_1c._0_4_ = 0; iVar6 = local_1c._4_4_; iVar4 = (uint)local_1c; } else { iVar6 = *(int *)(iStack_24 + 0xc); iVar4 = *(int *)(iStack_24 + 8); } if ((*(int *)((int)this + 8) == iVar4) && (*(int *)((int)this + 0xc) == iVar6)) { bVar7 = true; goto LAB_00a71d4c; } } else { LAB_00a71d47: uVar3 = local_1c._4_4_; } bVar7 = false; LAB_00a71d4c: if ((uVar3 & 1) != 0) { ppuStack_28 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 2; if (local_20 != (int *)0x0) { cVar2 = (**(code **)(*local_20 + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&iStack_24); } } local_8 = (uint)local_8._1_3_ << 8; } if (bVar7) { local_34 = 1; local_30 = (void *)0x0; uStack_2c = 0; ppuStack_28 = (undefined **)0x0; iStack_24 = 0; local_20 = (int *)0x0; local_8 = CONCAT31(local_8._1_3_,3); FUN_00a2a5a0(&local_34); if (local_30 != (void *)0x0) { uVar3 = (int)ppuStack_28 - (int)local_30 & 0xfffffff8; ptr = local_30; if (0xfff < uVar3) { ptr = *(void **)((int)local_30 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_30 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } } std::vector::_Tidy(); ExceptionList = local_10; return; } //@@ 00a71e10 lobby_registry_find_or_create /* DB: ? (out, uint64 id*): looks up a 64-bit lobby id map (FUN_00a72260), creates via vfunc +8 and inserts (FUN_00a720a0) when missing, returns a SmartPointer; LobbySteam::find_or_create, LobbyLocalhost::find_or_create prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall lobby_registry_find_or_create(void *this,void *outPointer,ulonglong *lobbyId) { int iVar1; undefined4 uVar2; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined1 local_20 [4]; int local_1c; int local_18; undefined **local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1374d; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = &PTR_vftable_00c5ab44; (**(code **)(PTR_vftable_00c5ab44 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_20 + 0x1c)); local_8 = 0; FUN_00a72260(local_20,lobbyId); if (*(char *)(local_18 + 0xd) == '\0') { if ((*(uint *)(local_18 + 0x14) <= *(uint *)((int)lobbyId + 4)) && (((*(uint *)(local_18 + 0x14) < *(uint *)((int)lobbyId + 4) || (*(uint *)(local_18 + 0x10) <= (uint)*lobbyId)) && (local_18 != DAT_00c79bf8)))) goto LAB_00a71eb8; } local_2c = (**(code **)(*(int *)this + 8))(); local_34 = (undefined4)*lobbyId; local_30 = *(undefined4 *)((int)lobbyId + 4); FUN_00a720a0(&local_1c,&local_34); uVar2 = *(undefined4 *)((int)lobbyId + 4); iVar1 = *(int *)(local_1c + 0x18); *(int *)(iVar1 + 8) = (int)*lobbyId; *(undefined4 *)(iVar1 + 0xc) = uVar2; LAB_00a71eb8: uVar2 = FUN_00a71fc0(lobbyId); FUN_00a28840(uVar2); local_8 = 1; (**(code **)(PTR_vftable_00c5ab44 + 0x10))(); ExceptionList = local_10; return outPointer; } //@@ 00a71f00 FUN_00a71f00 void FUN_00a71f00(void) { undefined4 extraout_ECX; uint *in_EDX; undefined1 local_24 [8]; int local_1c; undefined **local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1377d; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = &PTR_vftable_00c5ab44; (**(code **)(PTR_vftable_00c5ab44 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_24 + 0x20)); local_8 = 0; FUN_00a72260(local_24,in_EDX); if (*(char *)(local_1c + 0xd) == '\0') { if ((*(uint *)(local_1c + 0x14) <= in_EDX[1]) && (((*(uint *)(local_1c + 0x14) < in_EDX[1] || (*(uint *)(local_1c + 0x10) <= *in_EDX)) && (local_1c != DAT_00c79bf8)))) { FUN_00a28840(local_1c + 0x18); local_8 = 1; goto LAB_00a71f9a; } } KAGE::SmartPointer::SmartPointer(extraout_ECX); local_8 = 2; LAB_00a71f9a: (**(code **)(PTR_vftable_00c5ab44 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a71fc0 FUN_00a71fc0 int FUN_00a71fc0(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; void *local_24; int local_20; void *local_1c; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b137ad; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00a72260(&local_24,param_1); uVar1 = DAT_00c79bf8; if (*(char *)((int)local_1c + 0xd) == '\0') { if ((*(uint *)((int)local_1c + 0x14) <= param_1[1]) && ((*(uint *)((int)local_1c + 0x14) < param_1[1] || (*(uint *)((int)local_1c + 0x10) <= *param_1)))) goto LAB_00a7207b; } if (DAT_00c79bfc == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } local_18 = &DAT_00c79bf8; local_8 = 0; local_14 = 0; newNode = operator_new(0x20); uVar2 = *param_1; newNode[5] = param_1[1]; newNode[4] = uVar2; newNode[6] = 0; newNode[7] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(&DAT_00c79bf8,local_24,local_20,newNode); LAB_00a7207b: ExceptionList = local_10; return (int)local_1c + 0x18; } //@@ 00a720a0 FUN_00a720a0 void FUN_00a720a0(int *param_1,uint *param_2) { undefined8 uVar1; undefined4 uVar2; uint uVar3; undefined8 *puVar4; undefined4 *newNode; void *pvVar5; undefined1 uVar6; void *local_28; int iStack_24; undefined1 local_1c [4]; undefined4 *local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b137e5; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; puVar4 = (undefined8 *)FUN_00a72260(local_1c,param_2); uVar2 = DAT_00c79bf8; pvVar5 = *(void **)(puVar4 + 1); uVar1 = *puVar4; if (*(char *)((int)pvVar5 + 0xd) == '\0') { if ((*(uint *)((int)pvVar5 + 0x14) <= param_2[1]) && ((*(uint *)((int)pvVar5 + 0x14) < param_2[1] || (*(uint *)((int)pvVar5 + 0x10) <= *param_2))) ) { uVar6 = 0; goto LAB_00a72187; } } if (DAT_00c79bfc == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar3); } local_18 = &DAT_00c79bf8; local_8 = 0; local_14 = (undefined4 *)0x0; newNode = operator_new(0x20); local_8 = 1; uVar3 = param_2[1]; newNode[4] = *param_2; newNode[5] = uVar3; uVar3 = param_2[2]; newNode[6] = 0; newNode[7] = 0; local_14 = newNode; FUN_00a28930(uVar3); iStack_24 = (int)((ulonglong)uVar1 >> 0x20); *newNode = uVar2; local_28 = (void *)uVar1; newNode[1] = uVar2; newNode[2] = uVar2; *(undefined2 *)(newNode + 3) = 0; pvVar5 = std::_Tree::_Insert_node(&DAT_00c79bf8,local_28,iStack_24,newNode); uVar6 = 1; LAB_00a72187: *param_1 = (int)pvVar5; *(undefined1 *)(param_1 + 1) = uVar6; ExceptionList = local_10; return; } //@@ 00a721b0 FUN_00a721b0 void FUN_00a721b0(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { FUN_00a721b0(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[7] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[7] + 0xc))(uVar4), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(param_2 + 6); } local_8 = 0xffffffff; operator_delete(param_2,0x20); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 00a72260 FUN_00a72260 int * FUN_00a72260(int *param_1,uint *param_2) { uint uVar1; uint uVar2; undefined4 *puVar3; int iVar4; iVar4 = DAT_00c79bf8; puVar3 = *(undefined4 **)(DAT_00c79bf8 + 4); *param_1 = (int)puVar3; param_1[1] = 0; param_1[2] = iVar4; if (*(char *)((int)puVar3 + 0xd) == '\0') { uVar1 = *param_2; uVar2 = param_2[1]; do { *param_1 = (int)puVar3; if ((uVar2 < (uint)puVar3[5]) || ((uVar2 <= (uint)puVar3[5] && (uVar1 <= (uint)puVar3[4])))) { param_1[2] = (int)puVar3; iVar4 = 1; puVar3 = (undefined4 *)*puVar3; } else { puVar3 = (undefined4 *)puVar3[2]; iVar4 = 0; } param_1[1] = iVar4; } while (*(char *)((int)puVar3 + 0xd) == '\0'); } return param_1; } //@@ 00a722c0 KAGE::Network::MultiplayerManager::update_lobby_members /* DB: ? first call of lobby_process_user_commands (MultiplayerManager vtable slot 3): if lobby +0x88 valid, refreshes UserProfile::find_or_create/load_steam_avatar for ids +0x90, Lobby::get_members, members missing from the lobby list -> Multiplayer::handle_member_status(..,2), then posts CommandThread commands 3 and 6 (ctx +0x9c/+0xa0) */ void KAGE::Network::MultiplayerManager::update_lobby_members(void) { int *piVar1; int iVar2; char cVar3; int extraout_EAX; int iVar4; undefined4 uVar5; void *in_ECX; code *extraout_ECX; undefined4 uVar6; code *pcVar7; uint uVar8; code *pcVar9; void *pvVar10; void *ptr; undefined8 uVar11; undefined4 local_5c; void *local_58; undefined4 uStack_54; int iStack_50; undefined4 uStack_4c; undefined4 local_48; undefined4 local_44; void *local_40; int local_3c; code *local_38; code *local_34; undefined4 *local_30; undefined8 local_2c; undefined8 local_24; undefined4 *local_1c; code *local_18; undefined4 *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1383d; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(int **)((int)in_ECX + 0x88) != (int *)0x0) && (cVar3 = (**(code **)(**(int **)((int)in_ECX + 0x88) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U), cVar3 != '\0')) { uVar8 = 0; iVar4 = *(int *)((int)in_ECX + 0x90); if (*(int *)((int)in_ECX + 0x94) - iVar4 >> 3 != 0) { do { local_24 = CONCAT44(local_24._4_4_,System::UserProfileBase::vftable); UserProfile::find_or_create((void *)(iVar4 + uVar8 * 8)); local_8 = 0; local_24._0_4_ = System::UserProfile::vftable; local_24._4_4_ = (int *)extraout_EAX; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_24); } local_8 = 0xffffffff; iVar4 = FUN_00a28590(&local_24); local_24 = CONCAT44(local_24._4_4_,System::UserProfileBase::vftable); if (iVar4 == -1) goto LAB_00a725ee; uVar8 = uVar8 + 1; iVar4 = *(int *)((int)in_ECX + 0x90); } while (uVar8 < (uint)(*(int *)((int)in_ECX + 0x94) - iVar4 >> 3)); } local_38 = (code *)0x0; local_34 = (code *)0x0; local_30 = (undefined4 *)0x0; local_8 = 1; Multiplayer::Lobby::get_members((void *)((int)in_ECX + 0x10),&local_38,0); local_1c = (undefined4 *)((int)local_34 - (int)local_38 >> 3); local_14 = (undefined4 *)0x0; if (local_1c != (undefined4 *)0x0) { pcVar7 = local_38; do { iVar4 = *(int *)((int)in_ECX + 0x88); local_18 = pcVar7; if (iVar4 != 0) { iVar2 = *(int *)(iVar4 + 0x10); uVar8 = 0; if (*(int *)(iVar4 + 0x14) - iVar2 >> 3 != 0) { do { uVar11 = FUN_00a23920(); pcVar7 = extraout_ECX; if ((*(int *)(iVar2 + uVar8 * 8) == (int)uVar11) && (*(int *)(iVar2 + 4 + uVar8 * 8) == (int)((ulonglong)uVar11 >> 0x20))) { if (uVar8 != 0xffffffff) { local_18 = extraout_ECX; goto LAB_00a72464; } break; } uVar8 = uVar8 + 1; } while (uVar8 < (uint)(*(int *)(*(int *)((int)in_ECX + 0x88) + 0x14) - iVar2 >> 3)); } } iVar4 = *(int *)(pcVar7 + 4); if (iVar4 == 0) { local_24 = 0; local_24._4_4_ = (int *)0x0; local_24._0_4_ = (undefined **)0x0; uVar5 = local_24._4_4_; uVar6 = (undefined **)local_24; } else { uVar5 = *(undefined4 *)(iVar4 + 0xc); uVar6 = *(undefined4 *)(iVar4 + 8); } local_2c = CONCAT44(uVar5,uVar6); ::Multiplayer::handle_member_status((void *)((int)in_ECX + 0x10),&local_2c,2); LAB_00a72464: pcVar7 = local_18 + 8; local_14 = (undefined4 *)((int)local_14 + 1); } while (local_14 < local_1c); local_18 = pcVar7; } pcVar7 = local_38; local_5c = 3; local_58 = (void *)0x0; uStack_54 = 0; iStack_50 = 0; uStack_4c = 0; local_48 = 0; local_8._0_1_ = 2; local_2c = 0; std::vector<8byte>::_Emplace_reallocate(0,&local_2c); CommandThread::post_command(in_ECX,&local_5c); local_8._0_1_ = 1; if (local_58 != (void *)0x0) { uVar8 = (iStack_50 - (int)local_58 >> 3) * 8; pvVar10 = local_58; if (0xfff < uVar8) { pvVar10 = *(void **)((int)local_58 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)local_58 + (-4 - (int)pvVar10))) goto LAB_00a7271d; } operator_delete(pvVar10,uVar8); } local_5c = 6; local_58 = (void *)0x0; uStack_54 = 0; iStack_50 = 0; uStack_4c = 0; local_48 = 0; local_8._0_1_ = 3; local_2c = 1; std::vector<8byte>::_Emplace_reallocate(0,&local_2c); uStack_4c = *(undefined4 *)((int)in_ECX + 0x9c); local_48 = *(undefined4 *)((int)in_ECX + 0xa0); CommandThread::post_command(in_ECX,&local_5c); local_8._0_1_ = 1; if (local_58 != (void *)0x0) { uVar8 = (iStack_50 - (int)local_58 >> 3) * 8; pvVar10 = local_58; if (0xfff < uVar8) { pvVar10 = *(void **)((int)local_58 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)local_58 + (-4 - (int)pvVar10))) goto LAB_00a7271d; } operator_delete(pvVar10,uVar8); } if (pcVar7 != (code *)0x0) { local_8 = 4; pcVar9 = pcVar7; if (pcVar7 != local_34) { do { (*(code *)**(undefined4 **)pcVar9)(0); pcVar9 = pcVar9 + 8; } while (pcVar9 != local_34); } local_8._0_1_ = 0xff; local_8._1_3_ = 0xffffff; uVar8 = ((int)local_30 - (int)pcVar7 >> 3) * 8; pcVar9 = pcVar7; if (0xfff < uVar8) { pcVar9 = *(code **)(pcVar7 + -4); uVar8 = uVar8 + 0x23; if ((code *)0x1f < pcVar7 + (-4 - (int)pcVar9)) goto LAB_00a7271d; } operator_delete(pcVar9,uVar8); } } LAB_00a725ee: pvVar10 = (void *)0x0; local_44 = 0; pcVar7 = (code *)0x0; local_40 = (void *)0x0; local_3c = 0; local_38 = (code *)0x0; local_34 = (code *)0x0; local_30 = (undefined4 *)0x0; local_8._0_1_ = 5; local_8._1_3_ = 0; local_24 = CONCAT44((int)in_ECX + 0x78,(undefined **)local_24); while ((**(code **)(*(int *)((int)in_ECX + 0x78) + 0xc))(0xffffffff), *(int *)((int)in_ECX + 0x74) != 0) { local_14 = *(undefined4 **) (*(int *)((int)in_ECX + 0x68) + (*(int *)((int)in_ECX + 0x6c) - 1U & *(uint *)((int)in_ECX + 0x70)) * 4); local_44 = *local_14; if (&local_40 != (void **)(local_14 + 1)) { local_1c = (undefined4 *)local_14[1]; local_18 = (code *)(local_14[2] - (int)local_1c); if ((uint)((int)pcVar7 - (int)pvVar10 >> 3) < (uint)((int)local_18 >> 3)) { std::vector<8byte>::_Clear_and_reserve((int)local_18 >> 3); pcVar7 = local_38; pvVar10 = local_40; } memmove(pvVar10,local_1c,(size_t)local_18); local_3c = (int)local_18 + (int)pvVar10; } local_30 = (undefined4 *)local_14[5]; local_34 = (code *)local_14[4]; iVar4 = *(int *)(*(int *)((int)in_ECX + 0x68) + (*(int *)((int)in_ECX + 0x6c) - 1U & *(uint *)((int)in_ECX + 0x70)) * 4); *(undefined4 *)(iVar4 + 0x10) = 0; *(undefined4 *)(iVar4 + 0x14) = 0; local_1c = local_30; local_18 = local_34; std::vector::_Tidy(); piVar1 = (int *)((int)in_ECX + 0x74); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)((int)in_ECX + 0x70) = 0; } else { *(int *)((int)in_ECX + 0x70) = *(int *)((int)in_ECX + 0x70) + 1; } (**(code **)(*(int *)((int)in_ECX + 0x78) + 0x10))(); (*local_18)(0,(int)in_ECX + 0x10,local_1c); } (**(code **)(*local_24._4_4_ + 0x10))(); if (pvVar10 != (void *)0x0) { uVar8 = (int)pcVar7 - (int)pvVar10 & 0xfffffff8; ptr = pvVar10; if (0xfff < uVar8) { ptr = *(void **)((int)pvVar10 + -4); uVar8 = uVar8 + 0x23; if (0x1f < (uint)((int)pvVar10 + (-4 - (int)ptr))) { LAB_00a7271d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar8); } ExceptionList = local_10; return; } //@@ 00a72740 KAGE::Network::Multiplayer::Lobby::Lobby /* DB: ctor from ConstLobby: ConstLobby vftable, copies shared_ptr from param+4, then Lobby vftable; Menu_OnlineLobby::init_lobby_view */ void KAGE::Network::Multiplayer::Lobby::Lobby(int param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b12750; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = ConstLobby::vftable; in_ECX[1] = 0; in_ECX[2] = 0; local_8 = 0; std::shared_ptr::assign(in_ECX + 1,(void *)(param_1 + 4)); *in_ECX = vftable; ExceptionList = local_10; return; } //@@ 00a727b0 KAGE::Network::MultiplayerManager::create_lobby /* DB: ? same pattern as MultiplayerManager::join_lobby 00a72a20: if a lobby is active posts CommandThread command 3 (leave), then command 1 with (type param_1, max members param_2) and command 2 with callback FUN_00907c80 ("Successfully created lobby %llu"/"Failed to create lobby"); callers "Creating public lobby..." 00907230 and "Creating friend lobby..." 00907460 */ void KAGE::Network::MultiplayerManager::create_lobby (uint param_1,uint param_2,undefined4 param_3,undefined4 param_4) { char cVar1; void *in_ECX; void *pvVar2; uint uVar3; undefined4 local_34; void *local_30; uint *puStack_2c; uint *puStack_28; code *pcStack_24; undefined4 local_20; ulonglong local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1387d; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)((int)in_ECX + 0x14) != (int *)0x0) { cVar1 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if (cVar1 != '\0') { local_34 = 3; local_30 = (void *)0x0; puStack_2c = (uint *)0x0; puStack_28 = (uint *)0x0; pcStack_24 = (code *)0x0; local_20 = 0; local_8 = 0; local_1c = 0; std::vector<8byte>::_Emplace_reallocate(0,&local_1c); CommandThread::post_command(in_ECX,&local_34); local_8 = 0xffffffff; if (local_30 != (void *)0x0) { uVar3 = ((int)puStack_28 - (int)local_30 >> 3) * 8; pvVar2 = local_30; if (0xfff < uVar3) { pvVar2 = *(void **)((int)local_30 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar2))) goto LAB_00a729f5; } operator_delete(pvVar2,uVar3); } } } local_34 = 1; local_30 = (void *)0x0; puStack_2c = (uint *)0x0; puStack_28 = (uint *)0x0; pcStack_24 = (code *)0x0; local_20 = 0; local_8 = 1; local_1c = 0; std::vector<8byte>::_Emplace_reallocate(0,&local_1c); local_1c = (ulonglong)(int)param_1; if (puStack_2c == puStack_28) { std::vector<8byte>::_Emplace_reallocate(puStack_2c,&local_1c); } else { *puStack_2c = param_1; puStack_2c[1] = (int)param_1 >> 0x1f; puStack_2c = puStack_2c + 2; } local_1c = (ulonglong)param_2; if (puStack_2c == puStack_28) { std::vector<8byte>::_Emplace_reallocate(puStack_2c,&local_1c); } else { *puStack_2c = param_2; puStack_2c[1] = 0; puStack_2c = puStack_2c + 2; } CommandThread::post_command(in_ECX,&local_34); local_8 = 0xffffffff; if (local_30 != (void *)0x0) { uVar3 = ((int)puStack_28 - (int)local_30 >> 3) * 8; pvVar2 = local_30; if (0xfff < uVar3) { pvVar2 = *(void **)((int)local_30 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar2))) goto LAB_00a729f5; } operator_delete(pvVar2,uVar3); } local_34 = 2; local_30 = (void *)0x0; puStack_2c = (uint *)0x0; puStack_28 = (uint *)0x0; pcStack_24 = (code *)0x0; local_20 = 0; local_8 = 2; local_1c = 1; std::vector<8byte>::_Emplace_reallocate(0,&local_1c); local_1c = 0; if (puStack_2c == puStack_28) { std::vector<8byte>::_Emplace_reallocate(puStack_2c,&local_1c); } else { *puStack_2c = 0; puStack_2c[1] = 0; puStack_2c = puStack_2c + 2; } local_20 = param_4; pcStack_24 = FUN_00907c80; CommandThread::post_command(in_ECX,&local_34); if (local_30 != (void *)0x0) { uVar3 = (int)puStack_28 - (int)local_30 & 0xfffffff8; pvVar2 = local_30; if (0xfff < uVar3) { pvVar2 = *(void **)((int)local_30 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar2))) { LAB_00a729f5: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar3); } ExceptionList = local_10; return; } //@@ 00a72a20 KAGE::Network::MultiplayerManager::join_lobby /* DB: ? if a lobby is active queues event type 3 (leave), then queues event type 2 with the target lobby id (param+4 -> +8/+0xc) and callback FUN_00908660 through FUN_00a73100; only caller online_lobby_join */ void KAGE::Network::MultiplayerManager::join_lobby (int param_1,undefined4 param_2,undefined4 param_3) { int iVar1; char cVar2; void *in_ECX; void *pvVar3; uint uVar4; undefined4 local_38; void *local_34; undefined4 *puStack_30; undefined4 *puStack_2c; code *pcStack_28; undefined4 local_24; undefined8 local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b138b5; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int **)((int)in_ECX + 0x14) != (int *)0x0) { cVar2 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U); if (cVar2 != '\0') { local_38 = 3; local_34 = (void *)0x0; puStack_30 = (undefined4 *)0x0; puStack_2c = (undefined4 *)0x0; pcStack_28 = (code *)0x0; local_24 = 0; local_8 = 0; local_20 = 0; std::vector<8byte>::_Emplace_reallocate(0,&local_20); CommandThread::post_command(in_ECX,&local_38); local_8 = 0xffffffff; if (local_34 != (void *)0x0) { uVar4 = ((int)puStack_2c - (int)local_34 >> 3) * 8; pvVar3 = local_34; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_34 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)pvVar3))) goto LAB_00a72b9e; } operator_delete(pvVar3,uVar4); } } } local_38 = 2; local_34 = (void *)0x0; puStack_30 = (undefined4 *)0x0; puStack_2c = (undefined4 *)0x0; pcStack_28 = (code *)0x0; local_24 = 0; local_8 = 1; local_20 = 1; std::vector<8byte>::_Emplace_reallocate(0,&local_20); iVar1 = *(int *)(param_1 + 4); if (iVar1 == 0) { local_20._4_4_ = 0; local_20._0_4_ = 0; } else { local_20._0_4_ = *(undefined4 *)(iVar1 + 8); local_20._4_4_ = *(undefined4 *)(iVar1 + 0xc); } if (puStack_30 == puStack_2c) { std::vector<8byte>::_Emplace_reallocate(puStack_30,&local_20); } else { *puStack_30 = (undefined4)local_20; puStack_30[1] = local_20._4_4_; puStack_30 = puStack_30 + 2; } local_24 = param_3; pcStack_28 = FUN_00908660; CommandThread::post_command(in_ECX,&local_38); if (local_34 != (void *)0x0) { uVar4 = (int)puStack_2c - (int)local_34 & 0xfffffff8; pvVar3 = local_34; if (0xfff < uVar4) { pvVar3 = *(void **)((int)local_34 + -4); uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)pvVar3))) { LAB_00a72b9e: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar4); } ExceptionList = local_10; return; } //@@ 00a72bc0 KAGE::Network::MultiplayerManager::request_user_profiles /* DB: ? ECX=0xc79a60 (MultiplayerManager+0x10, its Lobby handle at +0x10 = 0xc79a70); takes a vector user ids + callback: no active lobby -> callback(0x10, empty Lobby); ids match lobby members -> UserProfile::find_or_create + load_steam_avatar each then callback(0, lobby); else Lobby::get_members and CommandThread::post_command; called from netplay code at 0x91287f with players lacking a profile */ void KAGE::Network::MultiplayerManager::request_user_profiles (int *param_1,undefined4 param_2,undefined4 param_3) { undefined4 *puVar1; undefined4 *puVar2; int *piVar3; void *this; char cVar4; int iVar5; int extraout_EAX; int extraout_EAX_00; void *in_ECX; undefined4 extraout_ECX; int *piVar6; void *ptr; undefined4 uVar7; int iVar8; uint uVar9; undefined **ppuVar10; int iVar11; uint uVar12; undefined **ppuVar13; undefined **ppuVar14; undefined8 uVar15; undefined4 local_4c; void *local_48; int *piStack_44; int *piStack_40; undefined4 uStack_3c; undefined4 local_38; undefined **local_34; undefined **local_30; int *local_2c; int local_28; void *local_24; undefined8 local_20; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13915; local_10 = ExceptionList; ExceptionList = &local_10; uVar7 = 0; if ((*(int **)((int)in_ECX + 0x14) == (int *)0x0) || (local_24 = in_ECX, cVar4 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0xc)) (__security_cookie ^ (int)register0x00000010 - 4U), uVar7 = extraout_ECX, cVar4 == '\0')) { local_34 = Multiplayer::ConstLobby::vftable; SmartPointer::SmartPointer(uVar7); local_34 = Multiplayer::Lobby::vftable; local_8 = 0; FUN_00708430(0x10,&local_34,param_3); local_34 = Multiplayer::ConstLobby::vftable; local_8 = 1; if ((local_2c != (int *)0x0) && ((cVar4 = (**(code **)(*local_2c + 0xc))(), cVar4 != '\0' && (g_lobbyReleaseFn != (void *)0x0)))) { (*g_lobbyReleaseFn)(&local_30); } } else { iVar11 = *(int *)((int)in_ECX + 0x14); iVar8 = param_1[1]; piVar6 = (int *)*param_1; iVar5 = iVar8 - (int)piVar6 >> 3; if (iVar11 == 0) { iVar11 = 0; } else { iVar11 = *(int *)(iVar11 + 0x14) - *(int *)(iVar11 + 0x10) >> 3; } if (iVar5 == iVar11) { uVar12 = 0; if (iVar5 != 0) { do { local_20 = CONCAT44(local_20._4_4_,System::UserProfileBase::vftable); UserProfile::find_or_create(piVar6 + uVar12 * 2); local_8 = 2; local_20._0_4_ = System::UserProfile::vftable; local_20._4_4_ = (undefined **)extraout_EAX; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_20); } local_8 = 0xffffffff; iVar11 = FUN_00a28590(&local_20); piVar6 = (int *)*param_1; local_20 = CONCAT44(local_20._4_4_,System::UserProfileBase::vftable); if (iVar11 == -1) { iVar8 = param_1[1]; goto LAB_00a72ccc; } uVar12 = uVar12 + 1; } while (uVar12 < (uint)(param_1[1] - (int)piVar6 >> 3)); } FUN_00708430(0,(void *)((int)in_ECX + 0x10),param_3); ExceptionList = local_10; return; } LAB_00a72ccc: if (g_userProfile == (void *)0x0) { local_20 = 0; local_20._4_4_ = (undefined **)0x0; local_20._0_4_ = (undefined **)0x0; iVar11 = (int)(undefined **)local_20; iVar5 = (int)local_20._4_4_; } else { iVar11 = *(int *)((int)g_userProfile + 8); iVar5 = *(int *)((int)g_userProfile + 0xc); } uVar12 = 0; uVar9 = iVar8 - (int)piVar6 >> 3; if (uVar9 == 0) { ExceptionList = local_10; return; } while ((*piVar6 != iVar11 || (piVar6[1] != iVar5))) { uVar12 = uVar12 + 1; piVar6 = piVar6 + 2; if (uVar9 <= uVar12) { ExceptionList = local_10; return; } } local_34 = (undefined **)0x0; local_30 = (undefined **)0x0; local_2c = (int *)0x0; local_8 = 3; Multiplayer::Lobby::get_members((void *)((int)in_ECX + 0x10),&local_34,1); local_20._4_4_ = local_34; ppuVar10 = local_34; if (local_34 != local_30) { do { uVar9 = 0; uVar12 = param_1[1] - *param_1 >> 3; local_20._4_4_ = ppuVar10; if (uVar12 != 0) { do { uVar15 = FUN_00a23920(); ppuVar10 = local_20._4_4_; iVar11 = *param_1; if (((int)uVar15 == *(int *)(iVar11 + uVar9 * 8)) && ((int)((ulonglong)uVar15 >> 0x20) == *(int *)(iVar11 + 4 + uVar9 * 8))) { puVar1 = (undefined4 *)(iVar11 + uVar9 * 8); puVar2 = *(undefined4 **)((int)local_24 + 0x94); if (puVar2 == *(undefined4 **)((int)local_24 + 0x98)) { std::vector<8byte>::_Emplace_reallocate(puVar2,puVar1); } else { uVar7 = puVar1[1]; *puVar2 = *puVar1; puVar2[1] = uVar7; *(int *)((int)local_24 + 0x94) = *(int *)((int)local_24 + 0x94) + 8; } break; } uVar9 = uVar9 + 1; } while (uVar9 < uVar12); } ppuVar10 = ppuVar10 + 2; local_20._4_4_ = ppuVar10; } while (ppuVar10 != local_30); } this = local_24; local_20 = CONCAT44(local_20._4_4_,System::UserProfileBase::vftable); UserProfile::find_or_create(*(void **)((int)local_24 + 0x90)); local_8._0_1_ = 4; local_20 = CONCAT44(extraout_EAX_00,System::UserProfile::vftable); ppuVar10 = System::UserProfile::vftable; if (((extraout_EAX_00 != 0) && (*(int *)(extraout_EAX_00 + 8) != 0 || *(int *)(extraout_EAX_00 + 0xc) != 0)) && (*(int *)(extraout_EAX_00 + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_20); ppuVar10 = (undefined **)local_20; } local_8._0_1_ = 5; cVar4 = (*(code *)ppuVar10[5])(); if (cVar4 != '\0') { local_4c = 4; local_48 = (void *)0x0; piStack_44 = (int *)0x0; piStack_40 = (int *)0x0; uStack_3c = 0; local_38 = 0; local_8 = CONCAT31(local_8._1_3_,6); local_28 = 1; local_24 = (void *)0x0; std::vector<8byte>::_Emplace_reallocate(0,&local_28); if (*(int **)((int)this + 0x14) == (int *)0x0) { local_28 = 0; } else { local_28 = (**(code **)(**(int **)((int)this + 0x14) + 0x3c))(); } local_24 = (void *)(local_28 >> 0x1f); if (piStack_44 == piStack_40) { std::vector<8byte>::_Emplace_reallocate(piStack_44,&local_28); } else { *piStack_44 = local_28; piStack_44[1] = (int)local_24; piStack_44 = piStack_44 + 2; } piVar3 = piStack_40; piVar6 = piStack_44; if (*(int **)((int)this + 0x14) == (int *)0x0) { local_28 = 0; } else { local_28 = (**(code **)(**(int **)((int)this + 0x14) + 0x1c))(); } local_24 = (void *)0x0; if (piVar6 == piVar3) { std::vector<8byte>::_Emplace_reallocate(piVar6,&local_28); } else { *piVar6 = local_28; piVar6[1] = 0; piStack_44 = piVar6 + 2; } CommandThread::post_command(this,&local_4c); local_8 = CONCAT31(local_8._1_3_,3); if (local_48 != (void *)0x0) { uVar12 = ((int)piStack_40 - (int)local_48 >> 3) * 8; ptr = local_48; if (0xfff < uVar12) { ptr = *(void **)((int)local_48 + -4); uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)local_48 + (-4 - (int)ptr))) goto LAB_00a72f85; } operator_delete(ptr,uVar12); } } ppuVar14 = local_30; ppuVar10 = local_34; *(code **)((int)this + 0x9c) = FUN_00708430; *(undefined4 *)((int)this + 0xa0) = param_3; if (local_34 != (undefined **)0x0) { local_8 = 7; for (ppuVar13 = local_34; ppuVar13 != ppuVar14; ppuVar13 = ppuVar13 + 2) { (**(code **)*ppuVar13)(0); } uVar12 = (int)local_2c - (int)ppuVar10 & 0xfffffff8; ppuVar14 = ppuVar10; if (0xfff < uVar12) { ppuVar14 = (undefined **)ppuVar10[-1]; uVar12 = uVar12 + 0x23; if (0x1f < (uint)((int)ppuVar10 + (-4 - (int)ppuVar14))) { LAB_00a72f85: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppuVar14,uVar12); ExceptionList = local_10; return; } } ExceptionList = local_10; return; } //@@ 00a73020 multiplayer_lobby_state_destroy /* DB: ? teardown of a MultiplayerManagerBase member: clears +0x9c/+0xa0, vector _Tidy, releases ConstLobby at +0x84 and +0x10, FUN_00a28ca0, multiplayer_connection_state_destroy 00a9e8c0; called from MultiplayerManagerBase dtor 00a28d60 */ void multiplayer_lobby_state_destroy(void) { char cVar1; uint uVar2; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0b40; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0x9c) = 0; *(undefined4 *)(in_ECX + 0xa0) = 0; std::vector::_Tidy(uVar2); *(undefined ***)(in_ECX + 0x84) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if (*(int **)(in_ECX + 0x8c) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x8c) + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 0x88); } } KAGE::ThreadSafeQueue::~ThreadSafeQueue(); multiplayer_connection_state_destroy(); *(undefined ***)(in_ECX + 0x10) = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (*(int **)(in_ECX + 0x18) != (int *)0x0) { cVar1 = (**(code **)(**(int **)(in_ECX + 0x18) + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 0x14); } } ExceptionList = local_10; return; } //@@ 00a73100 CommandThread::post_command /* DB: ? "Command thread is not initialized" (+0x1c flag); packs the command (id, data, callback LAB_00a733c0) into vector<8byte> args and queues it; MultiplayerManager::join_lobby, netplay_lobby_handle_join_message prototype: db/protos.zhl, confirmed by RET 4 */ void __thiscall CommandThread::post_command(void *this,void *command) { undefined4 local_38 [2]; undefined4 *local_30; undefined4 *local_2c; undefined4 local_28; undefined4 local_24; undefined1 *local_20; int local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1394d; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(byte *)((int)this + 0x1c) & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Command thread is not initialized\n"); } local_38[0] = *(undefined4 *)command; FUN_00915d70((int)command + 4); local_28 = *(undefined4 *)((int)command + 0x10); local_24 = *(undefined4 *)((int)command + 0x14); local_8 = 0; local_20 = &LAB_00a733c0; local_1c = 0; if (local_30 == local_2c) { std::vector<8byte>::_Emplace_reallocate(local_30,&local_20); } else { *local_30 = &LAB_00a733c0; local_30[1] = 0; local_30 = local_30 + 2; } local_1c = (int)this >> 0x1f; local_20 = this; if (local_30 == local_2c) { std::vector<8byte>::_Emplace_reallocate(local_30,&local_20); } else { *local_30 = this; local_30[1] = local_1c; local_30 = local_30 + 2; } FUN_00a2a5a0(local_38); local_28 = 0; local_24 = 0; std::vector::_Tidy(); ExceptionList = local_10; return; } //@@ 00a73200 FUN_00a73200 uint FUN_00a73200(int param_1) { code *pcVar1; undefined4 uVar2; uint uVar3; int *extraout_EAX; int *piVar4; int in_ECX; undefined1 local_2c [12]; undefined8 local_20 [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1397d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)local_20 + 0x1cU; if (*(int *)(in_ECX + 4) == 0) { return CONCAT31((int3)((uint)&local_10 >> 8),1); } piVar4 = *(int **)(param_1 + 4); if ((*piVar4 == 1) && (piVar4[1] == 0)) { pcVar1 = *(code **)(param_1 + 0x10); if (pcVar1 != (code *)0x0) { uVar2 = *(undefined4 *)(param_1 + 0x14); local_20[0] = 0; ExceptionList = &local_10; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(local_20); local_8 = 0; (*pcVar1)(*(undefined4 *)(in_ECX + 4),local_2c,uVar2,uVar3); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(local_2c); piVar4 = extraout_EAX; } *(undefined4 *)(in_ECX + 4) = 0; } ExceptionList = local_10; return (uint)piVar4 & 0xffffff00; } //@@ 00a732b0 FUN_00a732b0 void FUN_00a732b0(undefined4 param_1,int param_2,undefined4 param_3,int param_4) { int *_Src; int *piVar1; int iVar2; int *_Dst; int iStack_c; int iStack_8; switch(param_3) { case 1: case 2: case 3: case 4: piVar1 = *(int **)(param_4 + 0x94); _Dst = *(int **)(param_4 + 0x90); if ((((int)piVar1 - (int)_Dst & 0xfffffff8U) != 0) && (_Dst != piVar1)) { iVar2 = *(int *)(param_2 + 4); while( true ) { if (iVar2 == 0) { iStack_8 = 0; iStack_c = 0; } else { iStack_c = *(int *)(iVar2 + 8); iStack_8 = *(int *)(iVar2 + 0xc); } _Src = _Dst + 2; if ((*_Dst == iStack_c) && (_Dst[1] == iStack_8)) break; _Dst = _Src; if (_Src == piVar1) { return; } } memmove(_Dst,_Src,*(int *)(param_4 + 0x94) - (int)_Src); *(int *)(param_4 + 0x94) = *(int *)(param_4 + 0x94) + -8; } } return; } //@@ 00a73360 FUN_00a73360 void FUN_00a73360(undefined4 param_1,int param_2,byte *param_3) { byte bVar1; int iVar2; undefined4 uVar3; *(undefined4 *)(param_3 + 4) = param_1; iVar2 = *(int *)(param_2 + 4); if (iVar2 == 0) { param_3[0xc] = 0; param_3[0xd] = 0; param_3[0xe] = 0; param_3[0xf] = 0; bVar1 = *param_3; param_3[8] = 0; param_3[9] = 0; param_3[10] = 0; param_3[0xb] = 0; *param_3 = bVar1 | 1; return; } uVar3 = *(undefined4 *)(iVar2 + 8); *(undefined4 *)(param_3 + 0xc) = *(undefined4 *)(iVar2 + 0xc); *(undefined4 *)(param_3 + 8) = uVar3; *param_3 = *param_3 | 1; return; } //@@ 00a73aa0 FUN_00a73aa0 void FUN_00a73aa0(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Network::Multiplayer::ServiceLocalhost::vftable; in_ECX[0x1a] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 0; if ((int *)in_ECX[0x1c] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[0x1c] + 0xc))(uVar2); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(in_ECX + 0x1b); } } std::vector::_Tidy(); in_ECX[0x13] = 0; in_ECX[0x14] = 0; in_ECX[0x11] = 0; in_ECX[0x12] = 0; KAGE::Network::Multiplayer::ServiceBase::~ServiceBase(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x74); } ExceptionList = local_10; return; } //@@ 00a73b60 KAGE::Network::Multiplayer::ServiceLocalhost::update /* DB: ? ServiceLocalhost vtable slot 2 (ServiceSteam/EOS slot 2 = 00a75280/00a76180 read packets): under mutex +0x10 walks peers (map +8), collects those whose HWND fails IsWindow and drops them via Multiplayer::handle_member_status */ void KAGE::Network::Multiplayer::ServiceLocalhost::update(void) { int *_Dst; ulonglong *puVar1; char cVar2; BOOL BVar3; int in_ECX; uint size; undefined4 uVar4; int *piVar5; int iVar6; HWND hWnd; ulonglong *userId; ulonglong *puVar7; undefined **local_4c; undefined4 local_48; int *local_44; undefined **local_40; int local_3c; int *local_38; ulonglong *local_34; ulonglong *local_30; ulonglong *local_2c; int *local_28; int local_24; int local_20; ulonglong *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b13a5d; local_10 = ExceptionList; ExceptionList = &local_10; puVar7 = (ulonglong *)0x0; local_18._4_4_ = (ulonglong *)0x0; local_34 = (ulonglong *)0x0; local_30 = (ulonglong *)0x0; local_1c = (ulonglong *)0x0; local_2c = (ulonglong *)0x0; piVar5 = (int *)(in_ECX + 0x10); local_8 = 0; local_28 = piVar5; local_20 = in_ECX; (**(code **)(*piVar5 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); local_24 = **(int **)(local_20 + 8); if ((int *)local_24 != *(int **)(local_20 + 8)) { do { iVar6 = *(int *)(*(int *)(local_24 + 0x18) + 0x10); if (iVar6 == 0) { local_18 = 0; local_18._4_4_ = (ulonglong *)0x0; local_18._0_4_ = (HWND)0x0; uVar4 = local_18._4_4_; hWnd = (HWND)local_18; } else { local_18 = *(undefined8 *)(iVar6 + 8); uVar4 = *(undefined4 *)(iVar6 + 0xc); hWnd = *(HWND *)(iVar6 + 8); } BVar3 = IsWindow(hWnd); if (BVar3 == 0) { if (puVar7 == local_1c) { std::vector<8byte>::_Emplace_reallocate(puVar7,&local_18); local_1c = local_2c; puVar7 = local_30; } else { *(HWND *)puVar7 = hWnd; *(undefined4 *)((int)puVar7 + 4) = uVar4; local_30 = puVar7 + 1; puVar7 = local_30; } } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_24); } while (local_24 != *(int *)(local_20 + 8)); local_18._4_4_ = local_34; piVar5 = local_28; } (**(code **)(*piVar5 + 0x10))(); userId = local_18._4_4_; if (local_18._4_4_ != puVar7) { do { local_40 = ConstLobby::vftable; local_3c = 0; local_38 = (int *)0x0; local_8._0_1_ = 1; std::shared_ptr::assign(&local_3c,&g_multiplayerLobbyPtr); local_40 = Lobby::vftable; local_8 = CONCAT31(local_8._1_3_,2); if (local_3c == 0) { iVar6 = 0; } else { iVar6 = __RTDynamicCast(local_3c,0,&LobbyImplBase::RTTI_Type_Descriptor, &LobbyLocalhost::RTTI_Type_Descriptor,0); } puVar1 = local_30; piVar5 = *(int **)(iVar6 + 0x20); do { _Dst = piVar5; if (_Dst == *(int **)(iVar6 + 0x24)) goto LAB_00a73ce0; piVar5 = _Dst + 2; puVar7 = local_30; } while ((*_Dst != (int)*userId) || (_Dst[1] != *(int *)((int)userId + 4))); memmove(_Dst,piVar5,(int)*(int **)(iVar6 + 0x24) - (int)piVar5); *(int *)(iVar6 + 0x24) = *(int *)(iVar6 + 0x24) + -8; puVar7 = puVar1; LAB_00a73ce0: local_40 = ConstLobby::vftable; local_8._0_1_ = 3; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_3c); } local_4c = ConstLobby::vftable; local_48 = 0; local_44 = (int *)0x0; local_8._0_1_ = 4; std::shared_ptr::assign(&local_48,&g_multiplayerLobbyPtr); local_4c = Lobby::vftable; local_8._0_1_ = 5; ::Multiplayer::handle_member_status(&local_4c,userId,1); local_4c = ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,6); if (((local_44 != (int *)0x0) && (cVar2 = (**(code **)(*local_44 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_48); } userId = userId + 1; } while (userId != puVar7); } local_8 = 0xffffffff; if (local_18._4_4_ != (ulonglong *)0x0) { size = (int)local_1c - (int)local_18._4_4_ & 0xfffffff8; puVar7 = local_18._4_4_; if (0xfff < size) { puVar7 = *(ulonglong **)((int)local_18._4_4_ + -4); size = size + 0x23; if (0x1f < (uint)((int)local_18._4_4_ + (-4 - (int)puVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar7,size); } FUN_00a77f70(); ExceptionList = local_10; return; } //@@ 00a73de0 FUN_00a73de0 undefined1 FUN_00a73de0(code *param_1,undefined4 param_2) { (*param_1)(0,param_2); return 0; } //@@ 00a73e00 netplay_lobby_host_handle_message /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? virtual (no callers): dispatches consolidated lobby messages by 4cc "lhcj"/"lhnj"/"lhrj"/"lhum"/"lhwm", "This function should only be called on consolidated messages", RTTI casts to KAGE::Network message types */ undefined1 netplay_lobby_host_handle_message(undefined4 *param_1,int *param_2) { undefined4 *puVar1; char cVar2; undefined1 uVar3; uint uVar4; int *piVar5; int *extraout_EAX; int extraout_EAX_00; int in_ECX; uint extraout_ECX; uint extraout_ECX_00; int iVar6; undefined *puVar7; TypeDescriptor *lobbyPtr; TypeDescriptor *pTVar8; void *pvVar9; undefined4 uVar10; int **lobbyCtrl; int *local_58; int *piStack_54; undefined **local_48; int local_44; undefined **local_40; int *local_3c; int *local_38; undefined **local_34; int *local_30; uint local_28; int local_24; undefined1 local_20; int local_1c; undefined1 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puVar1 = param_1; puStack_c = &LAB_00b13afd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; local_1c = in_ECX; local_14 = uVar4; if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } piVar5 = (int *)strncmp((char *)(*(int *)(*(int *)puVar1[2] + 0x14) + 8),"lhcj",4); puVar1 = param_1; if (piVar5 == (int *)0x0) { local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 1; local_3c = piVar5; local_38 = piVar5; std::shared_ptr::assign(&local_3c,&g_multiplayerLobbyPtr); local_40 = KAGE::Network::Multiplayer::Lobby::vftable; local_8._0_1_ = 2; if (local_3c == (int *)0x0) { iVar6 = 0; } else { iVar6 = __RTDynamicCast(local_3c,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyLocalhost::RTTI_Type_Descriptor,0, uVar4); } if ((((*(byte *)(iVar6 + 0x2c) == 0) || ((uint)*(byte *)(iVar6 + 0x2c) <= (uint)(*(int *)(iVar6 + 0x24) - *(int *)(iVar6 + 0x20) >> 3))) || (*(char *)(iVar6 + 0x34) == '\0')) || (*(int *)(iVar6 + 0x30) == 0)) { uVar3 = 0; } else { uVar3 = 1; } strncpy((char *)&local_1c,"lhnj",4); local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 3; local_18 = uVar3; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_3c); } local_8 = (uint)local_8._1_3_ << 8; local_48 = (undefined **)*param_1; local_44 = param_1[1]; local_34 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&local_48); local_8._0_1_ = 4; local_34 = KAGE::System::UserProfile::vftable; uVar4 = extraout_ECX; local_30 = extraout_EAX; if (((extraout_EAX != (int *)0x0) && (uVar4 = extraout_EAX[2] | extraout_EAX[3], uVar4 != 0)) && (extraout_EAX[5] == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_34); uVar4 = extraout_ECX_00; } local_8 = CONCAT31(local_8._1_3_,5); FUN_00a2a030(&local_34,uVar4,&local_1c,5,uVar4); local_8 = 6; LAB_00a74405: if (((param_2 != (int *)0x0) && (cVar2 = (**(code **)(*param_2 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } ExceptionList = local_10; return 1; } if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } puVar7 = &DAT_00ba22e8; iVar6 = strncmp((char *)(*(int *)(*(int *)puVar1[2] + 0x14) + 8),"lhnj",4); puVar1 = param_1; if (iVar6 == 0) { if (param_1[3] != 1) { puVar7 = (undefined *)0x10; KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } if (*(char *)(*(int *)(*(int *)puVar1[2] + 0x14) + 0xc) != '\0') { local_48 = (undefined **)*param_1; local_44 = param_1[1]; pvVar9 = (void *)0xa74017; KAGE::Network::Multiplayer::LobbyLocalhost::find_or_create(); local_8._0_1_ = 7; FUN_00a28840(&local_34); pvVar9 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_40,puVar7,pvVar9); local_8._0_1_ = 8; std::vector::push_back(pvVar9); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_40); local_8._0_1_ = 9; if (((local_30 != (int *)0x0) && (cVar2 = (**(code **)(*local_30 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_34); } local_8 = (uint)local_8._1_3_ << 8; } *(int *)(in_ECX + 0x54) = *(int *)(in_ECX + 0x54) + 1; if (*(int *)(in_ECX + 0x54) == *(int *)(in_ECX + 0x58)) { (**(code **)(in_ECX + 0x4c))(in_ECX + 0x5c,*(undefined4 *)(in_ECX + 0x50)); } local_8 = 10; goto LAB_00a74405; } if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar6 = strncmp((char *)(*(int *)(*(int *)puVar1[2] + 0x14) + 8),"lhrj",4); puVar1 = param_1; if (iVar6 == 0) { pvVar9 = Multiplayer::get_lobby(&DAT_00c79a50,&local_40); local_8 = CONCAT31(local_8._1_3_,0xb); if (*(int *)((int)pvVar9 + 4) != 0) { __RTDynamicCast(*(int *)((int)pvVar9 + 4),0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyLocalhost::RTTI_Type_Descriptor,0); } local_34 = (undefined **)*param_1; local_30 = (int *)param_1[1]; KAGE::Network::Multiplayer::LobbyLocalhost::add_member(&local_34); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_40); local_8 = 0xc; goto LAB_00a74405; } if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar6 = strncmp((char *)(*(int *)(*(int *)puVar1[2] + 0x14) + 8),"lhum",4); puVar1 = param_1; if (iVar6 != 0) { if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } uVar10 = 4; puVar7 = &DAT_00ba232c; iVar6 = strncmp((char *)(*(int *)(*(int *)puVar1[2] + 0x14) + 8),"lhwm",4); if (iVar6 != 0) { FUN_008ef1d0(¶m_1); uVar3 = netplay_lobby_handle_join_message(puVar7,uVar10); FUN_00708d40(); ExceptionList = local_10; return uVar3; } uVar10 = FUN_00a59e20(); lobbyPtr = (TypeDescriptor *)0xa74284; LobbyLocalhost::read_welcome_message(uVar10); KAGE::Network::Multiplayer::LobbyLocalhost::find_or_create(); local_8._0_1_ = 0x10; lobbyCtrl = (int **)0xa742ac; iVar6 = FUN_00a75030(); uVar4 = 0; *(undefined1 *)(iVar6 + 0x2c) = local_20; if (local_28 != 0) { do { lobbyCtrl = (int **)0x0; pTVar8 = &KAGE::Network::Multiplayer::LobbyLocalhost::RTTI_Type_Descriptor; iVar6 = __RTDynamicCast(local_34,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor); if (uVar4 < local_28) { local_48 = KAGE::System::UserProfileBase::vftable; lobbyCtrl = (int **)0xa74300; UserProfile::find_or_create((void *)(local_24 + uVar4 * 8)); local_8._0_1_ = 0x11; local_48 = KAGE::System::UserProfile::vftable; local_44 = extraout_EAX_00; if (((extraout_EAX_00 != 0) && (*(int *)(extraout_EAX_00 + 8) != 0 || *(int *)(extraout_EAX_00 + 0xc) != 0)) && (*(int *)(extraout_EAX_00 + 0x14) == 0)) { lobbyCtrl = (int **)0xa74328; KAGE::System::UserProfile::load_steam_avatar(&local_48); } } else { local_48 = KAGE::System::UserProfile::vftable; local_44 = 0; } local_8._0_1_ = 0x12; if (local_44 == 0) { piStack_54 = (int *)0x0; local_58 = (int *)0x0; } else { local_58 = *(int **)(local_44 + 8); piStack_54 = *(int **)(local_44 + 0xc); } lobbyPtr = *(TypeDescriptor **)(iVar6 + 0x24); local_3c = local_58; local_38 = piStack_54; if (lobbyPtr == *(TypeDescriptor **)(iVar6 + 0x28)) { lobbyCtrl = &local_3c; std::vector<8byte>::_Emplace_reallocate(lobbyPtr,lobbyCtrl); } else { lobbyPtr->pVFTable = local_58; lobbyPtr->spare = piStack_54; *(int *)(iVar6 + 0x24) = *(int *)(iVar6 + 0x24) + 8; lobbyPtr = pTVar8; } local_8._0_1_ = 0x10; uVar4 = uVar4 + 1; local_48 = KAGE::System::UserProfileBase::vftable; } while (uVar4 < local_28); in_ECX = local_1c; } FUN_00a28840(&local_34); pvVar9 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_40,lobbyPtr,lobbyCtrl); local_8._0_1_ = 0x13; std::shared_ptr::assign((void *)(in_ECX + 0x6c),(void *)((int)pvVar9 + 4)); local_8._0_1_ = 0x10; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_40); (**(code **)(in_ECX + 0x44)) ((-(uint)(local_28 != 0) & 0xffffffee) + 0x12,in_ECX + 0x68, *(undefined4 *)(in_ECX + 0x48)); local_8 = CONCAT31(local_8._1_3_,0x14); if (((local_30 != (int *)0x0) && (cVar2 = (**(code **)(*local_30 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_34); } local_8 = 0x15; goto LAB_00a74405; } if (param_1[3] != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar6 = *(int *)(*(int *)puVar1[2] + 0x14); if (*(int *)(iVar6 + 0x18) == 0) { Multiplayer::get_lobby(&DAT_00c79a50,&local_40); local_8 = CONCAT31(local_8._1_3_,0xd); FUN_00a75010(); local_34 = *(undefined ***)(iVar6 + 0x10); local_30 = *(int **)(iVar6 + 0x14); FUN_00a9f0e0(&local_34); } else { if (*(int *)(iVar6 + 0x18) != 1) goto LAB_00a741f8; Multiplayer::get_lobby(&DAT_00c79a50,&local_40); local_8 = CONCAT31(local_8._1_3_,0xe); FUN_00a75010(); local_34 = *(undefined ***)(iVar6 + 0x10); local_30 = *(int **)(iVar6 + 0x14); FUN_00a9f120(&local_34); } local_8 = local_8 & 0xffffff00; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_40); LAB_00a741f8: local_34 = *(undefined ***)(iVar6 + 0x10); local_30 = *(int **)(iVar6 + 0x14); iVar6 = *(int *)(iVar6 + 0x18); pvVar9 = Multiplayer::get_lobby(&DAT_00c79a50,&local_40); local_8 = CONCAT31(local_8._1_3_,0xf); Multiplayer::handle_member_status(pvVar9,(ulonglong *)&local_34,iVar6); KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(&local_40); FUN_00708d40(); ExceptionList = local_10; return 1; } //@@ 00a74470 FUN_00a74470 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a74470(undefined4 *param_1,undefined4 param_2,undefined4 param_3) { WPARAM wParam; LRESULT LVar1; DWORD dwMessageId; DWORD dwLanguageId; byte *lpBuffer; DWORD nSize; va_list *Arguments; undefined4 local_218; undefined4 local_214; undefined4 local_210; ULONG_PTR local_20c; byte local_208 [512]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_208 + 0x204); local_214 = param_3; local_218 = 0; local_210 = param_2; if (_glfw == 0) { _glfwInputError(0x10001,0); wParam = 0; } else if (DAT_00c73694 == 0x60001) { wParam = *(WPARAM *)((int)g_glfwWindow + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized"); wParam = 0; } local_20c = 0; LVar1 = SendMessageTimeoutA((HWND)*param_1,0x4a,wParam,(LPARAM)&local_218,0,0x40,&local_20c); if (LVar1 == 0) { Arguments = (va_list *)0x0; nSize = 0x200; lpBuffer = local_208; dwLanguageId = 0x400; dwMessageId = GetLastError(); FormatMessageA(0x1200,(LPCVOID)0x0,dwMessageId,dwLanguageId,(LPSTR)lpBuffer,nSize,Arguments); } else { if (local_20c != 0) { return 1; } sprintf(local_208,(byte *)"Packet was actively rejected"); } KAGE_LogMessage(8,(byte *)"Failed to send localhost data, result = %s\n"); return 0; } //@@ 00a745a0 FUN_00a745a0 void FUN_00a745a0(undefined4 param_1,undefined1 param_2,code *param_3,undefined4 param_4) { char cVar1; int iVar2; int in_ECX; TypeDescriptor *lobbyPtr; void *pvVar3; undefined **local_2c; undefined1 local_28 [4]; int *local_24; undefined4 local_20; undefined4 local_1c; undefined4 local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13b45; local_10 = ExceptionList; ExceptionList = &local_10; if (_glfw == 0) { _glfwInputError(0x10001,0,__security_cookie ^ (uint)(local_28 + 0x24)); local_20 = 0; } else if (DAT_00c73694 == 0x60001) { local_20 = *(undefined4 *)((int)g_glfwWindow + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized", __security_cookie ^ (uint)(local_28 + 0x24)); local_20 = 0; } local_1c = 0xfefefefe; KAGE::Network::Multiplayer::LobbyLocalhost::find_or_create(); pvVar3 = (void *)0x0; lobbyPtr = &KAGE::Network::Multiplayer::LobbyLocalhost::RTTI_Type_Descriptor; local_8 = 0; iVar2 = __RTDynamicCast(local_18,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor); *(undefined4 *)(iVar2 + 0x30) = param_1; iVar2 = __RTDynamicCast(local_18,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyLocalhost::RTTI_Type_Descriptor,0); *(undefined1 *)(iVar2 + 0x2c) = param_2; FUN_00a28840(&local_18); pvVar3 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_2c,lobbyPtr,pvVar3); local_8._0_1_ = 1; std::shared_ptr::assign((void *)(in_ECX + 0x6c),(void *)((int)pvVar3 + 4)); local_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 2; if (local_24 != (int *)0x0) { cVar1 = (**(code **)(*local_24 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_28); } } local_8 = (uint)local_8._1_3_ << 8; (*param_3)(0,in_ECX + 0x68,param_4); local_8 = 3; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } ExceptionList = local_10; return; } //@@ 00a74710 KAGE::Network::Multiplayer::ServiceLocalhost::join_lobby /* DB: ServiceLocalhost vtable slot 8, same slot as ServiceEOS FUN_00a76650 which calls EOS_Lobby_JoinLobby; stores callback at +0x44/+0x48, sends 'lhrj' (localhost request join) packet via FUN_00a2a030, else calls callback(0,...) */ void KAGE::Network::Multiplayer::ServiceLocalhost::join_lobby (int param_1,code *param_2,undefined4 param_3) { int iVar1; undefined4 *puVar2; char cVar3; uint uVar4; undefined4 uVar5; int *extraout_EAX; int extraout_EAX_00; int in_ECX; uint extraout_ECX; uint extraout_ECX_00; undefined4 uVar6; undefined4 local_28; undefined4 uStack_24; undefined8 local_20; undefined **local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13b9d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar1 = *(int *)(param_1 + 4); if (iVar1 == 0) { local_20 = 0; local_20._4_4_ = 0; local_20._0_4_ = 0; uVar5 = local_20._4_4_; uVar6 = (undefined4)local_20; } else { uVar5 = *(undefined4 *)(iVar1 + 0xc); uVar6 = *(undefined4 *)(iVar1 + 8); } _local_28 = CONCAT44(uVar5,uVar6); local_18 = System::UserProfileBase::vftable; UserProfile::find_or_create(&local_28); local_8 = 0; local_18 = System::UserProfile::vftable; local_14 = extraout_EAX; if (((extraout_EAX != (int *)0x0) && (extraout_EAX[2] != 0 || extraout_EAX[3] != 0)) && (extraout_EAX[5] == 0)) { System::UserProfile::load_steam_avatar(&local_18); } local_8 = 1; cVar3 = (*(code *)local_18[5])(uVar4); local_8 = 0xffffffff; if (cVar3 == '\0') { *(code **)(in_ECX + 0x44) = param_2; *(undefined4 *)(in_ECX + 0x48) = param_3; strncpy((char *)¶m_2,"lhrj",4); iVar1 = *(int *)(param_1 + 4); if (iVar1 == 0) { uStack_24 = 0; local_28 = 0; } else { local_28 = *(undefined4 *)(iVar1 + 8); uStack_24 = *(undefined4 *)(iVar1 + 0xc); } local_20 = CONCAT44(local_20._4_4_,System::UserProfileBase::vftable); UserProfile::find_or_create(&local_28); local_8 = 4; local_20 = CONCAT44(extraout_EAX_00,System::UserProfile::vftable); uVar4 = extraout_ECX; if (((extraout_EAX_00 != 0) && (uVar4 = *(uint *)(extraout_EAX_00 + 8) | *(uint *)(extraout_EAX_00 + 0xc), uVar4 != 0)) && (*(int *)(extraout_EAX_00 + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_20); uVar4 = extraout_ECX_00; } local_8 = 5; FUN_00a2a030(&local_20,uVar4,¶m_2,4,uVar4); } else { iVar1 = *(int *)(param_1 + 4); if (iVar1 == 0) { uStack_24 = 0; local_28 = 0; } else { local_28 = *(undefined4 *)(iVar1 + 8); uStack_24 = *(undefined4 *)(iVar1 + 0xc); } FUN_00a71f00(); local_8 = 2; iVar1 = *(int *)(param_1 + 4); if (iVar1 == 0) { uStack_24 = 0; local_28 = 0; } else { local_28 = *(undefined4 *)(iVar1 + 8); uStack_24 = *(undefined4 *)(iVar1 + 0xc); } puVar2 = (undefined4 *)local_18[9]; if (puVar2 == (undefined4 *)local_18[10]) { std::vector<8byte>::_Emplace_reallocate(puVar2,&local_28); } else { *puVar2 = local_28; puVar2[1] = uStack_24; local_18[9] = local_18[9] + 8; } (*param_2)(0,param_1,param_3); local_8 = 3; if (local_14 != (int *)0x0) { cVar3 = (**(code **)(*local_14 + 0xc))(); if ((cVar3 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); ExceptionList = local_10; return; } } } ExceptionList = local_10; return; } //@@ 00a74940 FUN_00a74940 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a74940(code *param_1,undefined4 param_2) { char cVar1; uint uVar2; undefined4 extraout_ECX; undefined4 uVar3; undefined4 uVar4; undefined *puVar5; undefined4 uVar6; undefined **local_44; undefined1 local_40 [4]; int *local_3c; undefined4 local_38; undefined8 local_34; char local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13bcd; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; local_38 = param_2; if (g_userProfile == (void *)0x0) { local_34 = 0; local_34._4_4_ = 0; local_34._0_4_ = 0; uVar3 = (undefined4)local_34; uVar4 = local_34._4_4_; } else { uVar3 = *(undefined4 *)((int)g_userProfile + 8); uVar4 = *(undefined4 *)((int)g_userProfile + 0xc); } uVar6 = 4; puVar5 = &DAT_00ba22d8; local_14 = uVar2; strncpy(local_2c,"lhum",4); local_1c = 1; local_24 = uVar3; local_20 = uVar4; FUN_00a2a070(extraout_ECX,local_2c,puVar5,uVar6); local_34 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_34); local_8 = 0; (*param_1)(0,&local_44,local_38,uVar2); local_44 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_3c != (int *)0x0) { cVar1 = (**(code **)(*local_3c + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_40); } } ExceptionList = local_10; return; } //@@ 00a74a40 KAGE::Network::Multiplayer::ServiceLocalhost::request_lobby_list /* DB: called by MultiplayerManager::request_lobby_list 00a542c0 KAGE::Network::MultiplayerManager::request_lobby_list ECX = __RTDynamicCast(service, ServiceBase -> ServiceLocalhost); scans filters for "process_name", enumerates local lobbies ("lhcj"), returns ConstLobby results to the callback */ void KAGE::Network::Multiplayer::ServiceLocalhost::request_lobby_list (int param_1,code *param_2,undefined4 param_3) { byte bVar1; int iVar2; qword qVar3; char cVar4; uint uVar5; char *pcVar6; uint uVar7; int extraout_EAX; int in_ECX; byte *pbVar8; char *pcVar9; uint extraout_ECX; uint extraout_ECX_00; int iVar10; qword *pqVar11; undefined4 *puVar12; undefined4 *puVar13; uint uVar14; bool bVar15; char *local_38; undefined4 *local_34; undefined4 *local_30; int local_2c; undefined4 local_28; undefined4 local_24; undefined **local_20 [2]; int *local_18; void *local_10; undefined1 *puStack_c; undefined **local_8; local_8 = (undefined **)0xffffffff; puStack_c = &LAB_00b13c1d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (uint)(local_20 + 7); ExceptionList = &local_10; uVar14 = 0; puVar13 = *(undefined4 **)(param_1 + 0xc); iVar10 = *(int *)(param_1 + 0x10) - (int)puVar13; iVar2 = iVar10 >> 0x1f; if (iVar10 / 0x18 + iVar2 != iVar2) { do { pbVar8 = (byte *)*puVar13; pcVar6 = "process_name"; do { bVar1 = *pcVar6; bVar15 = bVar1 < *pbVar8; if (bVar1 != *pbVar8) { LAB_00a74ab7: uVar7 = -(uint)bVar15 | 1; goto LAB_00a74abc; } if (bVar1 == 0) break; bVar1 = pcVar6[1]; bVar15 = bVar1 < pbVar8[1]; if (bVar1 != pbVar8[1]) goto LAB_00a74ab7; pcVar6 = pcVar6 + 2; pbVar8 = pbVar8 + 2; } while (bVar1 != 0); uVar7 = 0; LAB_00a74abc: if (uVar7 == 0) goto LAB_00a74af9; uVar14 = uVar14 + 1; puVar13 = puVar13 + 6; } while (uVar14 < (uint)((*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0xc)) / 0x18)); } GetModuleFileNameA((HMODULE)0x0,&DAT_00c7e308,0x104); LAB_00a74af9: local_34 = (undefined4 *)0x0; local_30 = (undefined4 *)0x0; local_2c = 0; local_8._0_1_ = 0; local_8._1_3_ = 0; pcVar6 = (char *)FUN_00a74e00(uVar5); if (pcVar6 == (char *)0x0) { local_38 = (char *)0x0; } else { pcVar9 = pcVar6; do { cVar4 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar4 != '\0'); local_38 = operator_new_tracked((uint)(pcVar9 + (1 - (int)(pcVar6 + 1)))); pcVar9 = pcVar6; do { cVar4 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar4 != '\0'); strncpy(local_38,pcVar6,(size_t)(pcVar9 + (1 - (int)(pcVar6 + 1)))); } EnumWindows(FUN_00a74e70,(LPARAM)&local_38); puVar13 = *(undefined4 **)(in_ECX + 0x60); local_18 = (int *)(in_ECX + 0x5c); puVar12 = (undefined4 *)*local_18; if (puVar12 != puVar13) { do { (**(code **)*puVar12)(0); puVar12 = puVar12 + 3; } while (puVar12 != puVar13); puVar12 = *(undefined4 **)(in_ECX + 0x5c); } *(undefined4 **)(in_ECX + 0x60) = puVar12; *(int *)(in_ECX + 0x58) = (int)local_30 - (int)local_34 >> 2; *(undefined4 *)(in_ECX + 0x54) = 0; strncpy((char *)¶m_1,"lhcj",4); puVar13 = local_34; if (local_34 != local_30) { do { local_28 = *puVar13; local_24 = 0xfefefefe; local_20[0] = System::UserProfileBase::vftable; UserProfile::find_or_create(&local_28); local_8._0_1_ = 1; local_20[0] = System::UserProfile::vftable; uVar5 = extraout_ECX; if (((extraout_EAX != 0) && (uVar5 = *(uint *)(extraout_EAX + 8) | *(uint *)(extraout_EAX + 0xc), uVar5 != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { System::UserProfile::load_steam_avatar(local_20); uVar5 = extraout_ECX_00; } local_8._0_1_ = 2; cVar4 = FUN_00a2a030(local_20,uVar5,¶m_1,4,uVar5); if (cVar4 == '\0') { *(int *)(in_ECX + 0x58) = *(int *)(in_ECX + 0x58) + -1; } local_8._0_1_ = 0; puVar13 = puVar13 + 1; local_20[0] = System::UserProfileBase::vftable; } while (puVar13 != local_30); } if (*(int *)(in_ECX + 0x58) == 0) { (*param_2)(local_18,param_3); } else { *(code **)(in_ECX + 0x4c) = param_2; *(undefined4 *)(in_ECX + 0x50) = param_3; } if (local_38 != (char *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar11 = &g_allocatedBytesNoHeap; } else { pqVar11 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(local_38 + -4); qVar3 = *pqVar11; *(uint *)pqVar11 = (uint)*pqVar11 - uVar5; *(uint *)((int)pqVar11 + 4) = *(uint *)((int)pqVar11 + 4) - (uint)((uint)qVar3 < uVar5); free(local_38 + -4); local_38 = (char *)0x0; } if (local_34 != (undefined4 *)0x0) { uVar5 = local_2c - (int)local_34 & 0xfffffffc; puVar13 = local_34; if (0xfff < uVar5) { puVar13 = (undefined4 *)local_34[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)puVar13))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar13,uVar5); } ExceptionList = local_10; return; } //@@ 00a74d00 FUN_00a74d00 void FUN_00a74d00(void) { int in_ECX; FID_conflict__Tidy((void *)(in_ECX + 4)); return; } //@@ 00a74d10 FUN_00a74d10 void FUN_00a74d10(ulonglong *param_1) { int *piVar1; byte bVar2; uint uVar3; void *in_ECX; undefined4 local_2c; undefined4 local_28; undefined4 *local_24; undefined1 local_1c [4]; undefined4 *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13c5c; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; bVar2 = connection_map_contains(in_ECX,param_1); if (bVar2 != 0) { KAGE_LogMessage(0x10,(byte *)"Trying to add a redundant network connection\n"); } piVar1 = (int *)((int)in_ECX + 0x10); local_14 = piVar1; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,uVar3); } local_8 = 0; local_24 = operator_new(0x40); local_8._0_1_ = 1; local_18 = local_24; if (local_24 == (undefined4 *)0x0) { local_24 = (undefined4 *)0x0; } else { FUN_00a58740(param_1); *local_24 = KAGE::Network::Multiplayer::ConnectionLocalhost::vftable; } local_8 = (uint)local_8._1_3_ << 8; local_2c = (undefined4)*param_1; local_28 = *(undefined4 *)((int)param_1 + 4); FUN_00a75050(local_1c,&local_2c); local_8 = 2; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a74e00 FUN_00a74e00 char * FUN_00a74e00(void) { char *pcVar1; char *pcVar2; char *pcVar3; char *in_ECX; pcVar3 = strchr(in_ECX,0x2f); pcVar1 = in_ECX; while (pcVar2 = pcVar3, pcVar2 != (char *)0x0) { pcVar3 = strchr(pcVar2 + 1,0x2f); pcVar1 = pcVar2; } pcVar3 = strchr(in_ECX,0x5c); while (pcVar2 = pcVar3, pcVar2 != (char *)0x0) { pcVar3 = strchr(pcVar2 + 1,0x5c); in_ECX = pcVar2; } if (pcVar1 == in_ECX) { return pcVar1; } if (pcVar1 <= in_ECX) { pcVar1 = in_ECX; } return pcVar1 + 1; } //@@ 00a74e70 FUN_00a74e70 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ undefined4 FUN_00a74e70(HWND param_1,undefined4 *param_2) { byte bVar1; undefined4 *puVar2; HWND pHVar3; BOOL BVar4; HWND hWnd; LONG LVar5; DWORD DVar6; HANDLE hObject; int iVar7; byte *pbVar8; uint uVar9; byte *pbVar10; bool bVar11; HWND local_40; undefined4 *local_3c; DWORD local_38; tagTITLEBARINFO local_34; undefined4 local_8; local_8 = __security_cookie ^ (int)&local_34 + 0x30U; local_3c = param_2; local_40 = param_1; if (_glfw == 0) { _glfwInputError(0x10001,0); pHVar3 = (HWND)0x0; } else if (DAT_00c73694 == 0x60001) { pHVar3 = *(HWND *)((int)g_glfwWindow + 0x2b4); } else { _glfwInputError(0x1000e,"Win32: Platform not initialized"); pHVar3 = (HWND)0x0; } if ((param_1 != pHVar3) && (BVar4 = IsWindowVisible(param_1), BVar4 != 0)) { pHVar3 = GetAncestor(param_1,3); if (pHVar3 != (HWND)0x0) { do { hWnd = GetLastActivePopup(pHVar3); BVar4 = IsWindowVisible(hWnd); if (BVar4 != 0) { if (hWnd != pHVar3) { return 1; } break; } bVar11 = hWnd != pHVar3; pHVar3 = hWnd; } while (bVar11); } local_34.cbSize = 0x2c; GetTitleBarInfo(param_1,&local_34); if (((local_34.rgstate[0] & 0x8000) == 0) && (LVar5 = GetWindowLongA(param_1,-0x14), -1 < (char)LVar5)) { local_38 = 0; DVar6 = GetWindowThreadProcessId(param_1,&local_38); if ((DVar6 != 0) && (hObject = OpenProcess(0x1000,0,local_38), hObject != (HANDLE)0x0)) { iVar7 = K32GetProcessImageFileNameA(hObject,&DAT_00c7e308,0x104); CloseHandle(hObject); if (iVar7 != 0) { pbVar8 = (byte *)FUN_00a74e00(); pbVar10 = (byte *)*local_3c; do { bVar1 = *pbVar10; bVar11 = bVar1 < *pbVar8; if (bVar1 != *pbVar8) { LAB_00a74fd1: uVar9 = -(uint)bVar11 | 1; goto LAB_00a74fd6; } if (bVar1 == 0) break; bVar1 = pbVar10[1]; bVar11 = bVar1 < pbVar8[1]; if (bVar1 != pbVar8[1]) goto LAB_00a74fd1; pbVar10 = pbVar10 + 2; pbVar8 = pbVar8 + 2; } while (bVar1 != 0); uVar9 = 0; LAB_00a74fd6: if (uVar9 == 0) { puVar2 = (undefined4 *)local_3c[2]; if (puVar2 == (undefined4 *)local_3c[3]) { std::vector<4byte>::_Emplace_reallocate(puVar2,&local_40); } else { *puVar2 = param_1; local_3c[2] = local_3c[2] + 4; } } } } } } return 1; } //@@ 00a75010 FUN_00a75010 void FUN_00a75010(void) { int in_ECX; if (*(int *)(in_ECX + 4) == 0) { return; } __RTDynamicCast(*(int *)(in_ECX + 4),0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyLocalhost::RTTI_Type_Descriptor,0); return; } //@@ 00a75030 FUN_00a75030 void FUN_00a75030(void) { __RTDynamicCast(); return; } //@@ 00a75050 FUN_00a75050 void FUN_00a75050(int *param_1,uint *param_2) { uint *puVar1; undefined8 uVar2; char cVar3; uint uVar4; undefined8 *puVar5; undefined4 *newNode; ReferenceCountBase *pRVar6; void *pvVar7; undefined4 *in_ECX; undefined1 uVar8; void *local_34; int iStack_30; undefined1 local_28 [8]; undefined4 *local_20; ReferenceCountBase *local_1c; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13ca4; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; local_18 = in_ECX; puVar5 = (undefined8 *)FUN_00731ee0(local_28,param_2); pvVar7 = *(void **)(puVar5 + 1); uVar2 = *puVar5; if (*(char *)((int)pvVar7 + 0xd) == '\0') { if ((*(uint *)((int)pvVar7 + 0x14) <= param_2[1]) && ((*(uint *)((int)pvVar7 + 0x14) < param_2[1] || (*(uint *)((int)pvVar7 + 0x10) <= *param_2))) ) { uVar8 = 0; goto LAB_00a7518d; } } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } local_14 = *in_ECX; local_8 = 0; local_20 = (undefined4 *)0x0; newNode = operator_new(0x20); local_8 = 1; puVar1 = newNode + 6; uVar4 = param_2[1]; newNode[4] = *param_2; newNode[5] = uVar4; uVar4 = param_2[2]; *puVar1 = 0; newNode[7] = 0; local_20 = newNode; pRVar6 = operator_new(0x18); local_8._0_1_ = 2; local_1c = pRVar6; if (pRVar6 == (ReferenceCountBase *)0x0) { pRVar6 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar6); *(undefined ***)pRVar6 = ReferenceCount::vftable; *(uint *)(pRVar6 + 0x14) = uVar4; } local_8 = CONCAT31(local_8._1_3_,1); if ((int *)newNode[7] != (int *)0x0) { cVar3 = (**(code **)(*(int *)newNode[7] + 0xc))(); if ((cVar3 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(puVar1); } } *puVar1 = uVar4; iStack_30 = (int)((ulonglong)uVar2 >> 0x20); newNode[7] = pRVar6; local_34 = (void *)uVar2; *newNode = local_14; newNode[1] = local_14; newNode[2] = local_14; *(undefined2 *)(newNode + 3) = 0; pvVar7 = std::_Tree::_Insert_node(local_18,local_34,iStack_30,newNode); uVar8 = 1; LAB_00a7518d: *param_1 = (int)pvVar7; *(undefined1 *)(param_1 + 1) = uVar8; ExceptionList = local_10; return; } //@@ 00a751b0 FUN_00a751b0 void FUN_00a751b0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Multiplayer::ServiceSteam::vftable; in_ECX[0x26] = CCallbackImpl<32>::vftable; if ((*(byte *)(in_ECX + 0x27) & 1) != 0) { SteamAPI_UnregisterCallback(in_ECX + 0x26); } in_ECX[0x1e] = CCallResult::vftable; if (in_ECX[0x22] != 0 || in_ECX[0x23] != 0) { SteamAPI_UnregisterCallResult(in_ECX + 0x1e,in_ECX[0x22],in_ECX[0x23]); in_ECX[0x22] = 0; in_ECX[0x23] = 0; } in_ECX[0x16] = CCallResult::vftable; if (in_ECX[0x1a] != 0 || in_ECX[0x1b] != 0) { SteamAPI_UnregisterCallResult(in_ECX + 0x16,in_ECX[0x1a],in_ECX[0x1b]); in_ECX[0x1a] = 0; in_ECX[0x1b] = 0; } in_ECX[0x14] = 0; in_ECX[0x15] = 0; in_ECX[0x12] = 0; in_ECX[0x13] = 0; KAGE::Network::Multiplayer::ServiceBase::~ServiceBase(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xb0); } return; } //@@ 00a75280 FUN_00a75280 void FUN_00a75280(void) { code *pcVar1; qword qVar2; char cVar3; int *piVar4; undefined4 *puVar5; uint *puVar6; uint unaff_EBX; uint _Size; void *unaff_EDI; qword *pqVar7; bool bVar8; int iVar9; undefined8 uStack_24; undefined4 uStack_18; undefined4 uStack_14; pcVar1 = SteamInternal_ContextInit_exref; uStack_24._4_4_ = 0; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c51c); iVar9 = *piVar4; while (iVar9 != 0) { puVar5 = (undefined4 *)(*pcVar1)(&PTR_FUN_00c5c51c); cVar3 = (**(code **)(*(int *)*puVar5 + 4))((int)&uStack_24 + 4,0); if (cVar3 == '\0') break; if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } bVar8 = 0xfffffffb < uStack_24._4_4_; _Size = uStack_24._4_4_ + 4; puVar6 = malloc(_Size); if (puVar6 == (uint *)0x0) { piVar4 = *(int **)g_memoryManager_oomHandlers; if (piVar4 != g_memoryManager_oomHandlers) { do { (*(code *)piVar4[2])(0x7fcb9dd6,piVar4[3]); piVar4 = (int *)*piVar4; } while (piVar4 != g_memoryManager_oomHandlers); } puVar6 = (uint *)0x0; } else { *puVar6 = _Size; qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + _Size; puVar6 = puVar6 + 1; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)bVar8 + (uint)CARRY4((uint)qVar2,_Size); } pcVar1 = SteamInternal_ContextInit_exref; uStack_14 = 0; uStack_18 = 0; puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c51c); iVar9 = 0; (**(code **)(*(int *)*puVar5 + 8))(puVar6,uStack_24._4_4_,(int)&uStack_24 + 4,&uStack_18); uStack_24._4_4_ = unaff_EBX; NetworkManager::receive_packet(unaff_EDI,&uStack_24,puVar6,iVar9); piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c51c); iVar9 = *piVar4; } FUN_00a77f70(); return; } //@@ 00a753d0 FUN_00a753d0 uint FUN_00a753d0(code *param_1,undefined4 param_2) { uint uVar1; uVar1 = 0; if (param_1 != (code *)0x0) { uVar1 = (*param_1)(0,param_2); } return uVar1 & 0xffffff00; } //@@ 00a753f0 FUN_00a753f0 bool FUN_00a753f0(void) { int *piVar1; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c51c); return *piVar1 != 0; } //@@ 00a75410 FUN_00a75410 void FUN_00a75410(undefined4 *param_1,undefined4 param_2,undefined4 param_3) { undefined4 *puVar1; puVar1 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c51c); (*(code *)**(undefined4 **)*puVar1)(*param_1,param_1[1],param_2,param_3,1,0); return; } //@@ 00a75460 FUN_00a75460 void FUN_00a75460(undefined4 param_1,undefined4 param_2,code *param_3,undefined4 param_4) { char cVar1; uint uVar2; int *piVar3; undefined4 *puVar4; undefined4 uVar5; int in_ECX; longlong lVar6; undefined **local_24; undefined1 local_20 [4]; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13cdd; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar2); if (*piVar3 == 0) { local_18 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 0; (*param_3)(3,&local_24,param_4); local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (((local_1c != (int *)0x0) && (cVar1 = (**(code **)(*local_1c + 0xc))(), cVar1 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_20); ExceptionList = local_10; return; } } else { *(undefined4 *)(in_ECX + 0x44) = param_1; *(code **)(in_ECX + 0x48) = param_3; *(undefined4 *)(in_ECX + 0x4c) = param_4; puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar2); switch(param_1) { default: uVar5 = 0; break; case 1: uVar5 = 1; break; case 2: uVar5 = 3; break; case 3: uVar5 = 2; } lVar6 = (**(code **)(*(int *)*puVar4 + 0x34))(uVar5,param_2); if (*(int *)(in_ECX + 0x68) != 0 || *(int *)(in_ECX + 0x6c) != 0) { SteamAPI_UnregisterCallResult (in_ECX + 0x58,*(undefined4 *)(in_ECX + 0x68),*(int *)(in_ECX + 0x6c)); } *(longlong *)(in_ECX + 0x68) = lVar6; *(int *)(in_ECX + 0x70) = in_ECX; *(code **)(in_ECX + 0x74) = FUN_00a759f0; if (lVar6 != 0) { SteamAPI_RegisterCallResult(in_ECX + 0x58,lVar6); } } ExceptionList = local_10; return; } //@@ 00a755d0 FUN_00a755d0 void FUN_00a755d0(int param_1,code *param_2,undefined4 param_3) { code *pcVar1; int iVar2; char cVar3; uint uVar4; int *piVar5; undefined4 *puVar6; undefined4 uVar7; int in_ECX; undefined4 uVar8; longlong lVar9; undefined **local_24; undefined1 local_20 [4]; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13cdd; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_20 + 0x1c); ExceptionList = &local_10; piVar5 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar4); if (*piVar5 == 0) { local_18 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 0; (*param_2)(3,&local_24,param_3); local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_1c != (int *)0x0) { cVar3 = (**(code **)(*local_1c + 0xc))(); if ((cVar3 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_20); ExceptionList = local_10; return; } } } else { *(code **)(in_ECX + 0x50) = param_2; *(undefined4 *)(in_ECX + 0x54) = param_3; puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar4); pcVar1 = *(code **)(*(int *)*puVar6 + 0x38); iVar2 = *(int *)(param_1 + 4); if (iVar2 == 0) { local_18 = 0; local_18._4_4_ = 0; local_18._0_4_ = 0; uVar7 = local_18._4_4_; uVar8 = (undefined4)local_18; } else { uVar7 = *(undefined4 *)(iVar2 + 0xc); uVar8 = *(undefined4 *)(iVar2 + 8); } FUN_00a238e0(uVar8,uVar7); lVar9 = (*pcVar1)(); if (*(int *)(in_ECX + 0x88) != 0 || *(int *)(in_ECX + 0x8c) != 0) { SteamAPI_UnregisterCallResult (in_ECX + 0x78,*(undefined4 *)(in_ECX + 0x88),*(int *)(in_ECX + 0x8c)); } *(longlong *)(in_ECX + 0x88) = lVar9; *(int *)(in_ECX + 0x90) = in_ECX; *(code **)(in_ECX + 0x94) = FUN_00a75c10; if (lVar9 != 0) { SteamAPI_RegisterCallResult(in_ECX + 0x78,lVar9); } } ExceptionList = local_10; return; } //@@ 00a75740 FUN_00a75740 void FUN_00a75740(code *param_1,undefined4 param_2) { code *pcVar1; char cVar2; uint uVar3; int *piVar4; undefined4 *puVar5; undefined4 uVar6; undefined4 uVar7; undefined **local_30; int local_2c; int *local_28; undefined **local_24; int local_20; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13d25; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar3); if (*piVar4 == 0) { local_18 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 0; (*param_1)(3,&local_24,param_2); local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_1c == (int *)0x0) { ExceptionList = local_10; return; } cVar2 = (**(code **)(*local_1c + 0xc))(); if (cVar2 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } piVar4 = &local_20; } else { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c504,uVar3); local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_20 = 0; local_1c = (int *)0x0; pcVar1 = *(code **)(*(int *)*puVar5 + 0x3c); local_8 = 2; std::shared_ptr::assign(&local_20,&g_multiplayerLobbyPtr); local_24 = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 3; if (local_20 == 0) { local_18 = 0; local_18._4_4_ = 0; local_18._0_4_ = 0; uVar6 = local_18._4_4_; uVar7 = (undefined4)local_18; } else { uVar6 = *(undefined4 *)(local_20 + 0xc); uVar7 = *(undefined4 *)(local_20 + 8); } FUN_00a238e0(uVar7,uVar6); (*pcVar1)(); local_24 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 4; if (((local_1c != (int *)0x0) && (cVar2 = (**(code **)(*local_1c + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_20); } local_8 = 0xffffffff; local_18 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_8 = 5; (*param_1)(0,&local_30,param_2); local_30 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 6; if (local_28 == (int *)0x0) { ExceptionList = local_10; return; } cVar2 = (**(code **)(*local_28 + 0xc))(); if (cVar2 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } piVar4 = &local_2c; } (*g_lobbyReleaseFn)(piVar4); ExceptionList = local_10; return; } //@@ 00a75900 FUN_00a75900 void FUN_00a75900(ulonglong *param_1) { int *piVar1; byte bVar2; uint uVar3; void *in_ECX; undefined4 local_2c; undefined4 local_28; undefined4 *local_24; undefined1 local_1c [4]; undefined4 *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13c5c; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; bVar2 = connection_map_contains(in_ECX,param_1); if (bVar2 != 0) { KAGE_LogMessage(0x10,(byte *)"Trying to add a redundant network connection\n"); } piVar1 = (int *)((int)in_ECX + 0x10); local_14 = piVar1; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,uVar3); } local_8 = 0; local_24 = operator_new(0x40); local_8._0_1_ = 1; local_18 = local_24; if (local_24 == (undefined4 *)0x0) { local_24 = (undefined4 *)0x0; } else { FUN_00a58740(param_1); *local_24 = KAGE::Network::Multiplayer::ConnectionSteam::vftable; } local_8 = (uint)local_8._1_3_ << 8; local_2c = (undefined4)*param_1; local_28 = *(undefined4 *)((int)param_1 + 4); FUN_00a75f30(local_1c,&local_2c); local_8 = 2; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a759f0 FUN_00a759f0 void FUN_00a759f0(undefined4 *param_1,char param_2) { undefined4 uVar1; char cVar2; uint uVar3; void *pvVar4; int *piVar5; int in_ECX; int iVar6; TypeDescriptor *lobbyPtr; undefined **local_28; undefined1 local_24 [4]; int *local_20; undefined **local_1c; undefined4 local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13d6d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; iVar6 = 0; if (param_2 != '\0') { iVar6 = 0x12; } switch(*param_1) { case 2: iVar6 = 0x12; break; case 3: iVar6 = 3; break; default: _param_2 = *(code **)(in_ECX + 0x48); if (iVar6 != 0) goto LAB_00a75a51; KAGE::Network::Multiplayer::LobbySteam::find_or_create(&local_18,(ulonglong *)(param_1 + 2)); local_8 = iVar6; pvVar4 = (void *)__RTDynamicCast(local_18,0, &KAGE::Network::Multiplayer::LobbyImplBase:: RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbySteam::RTTI_Type_Descriptor,0 ); Lobby::refresh_members(pvVar4); lobbyPtr = &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor; piVar5 = (int *)__RTDynamicCast(local_18,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor ,&KAGE::Network::Multiplayer::LobbySteam::RTTI_Type_Descriptor,0 ); pvVar4 = (void *)0xa75b50; (**(code **)(*piVar5 + 0x38))(*(undefined4 *)(in_ECX + 0x44)); uVar1 = *(undefined4 *)(in_ECX + 0x4c); FUN_00a28840(&local_18); pvVar4 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_28,lobbyPtr,pvVar4); local_8._0_1_ = 1; (*_param_2)(0,pvVar4,uVar1); local_28 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,2); if (((local_20 != (int *)0x0) && (cVar2 = (**(code **)(*local_20 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_24); } local_8 = 3; if ((local_14 == (int *)0x0) || (cVar2 = (**(code **)(*local_14 + 0xc))(), cVar2 == '\0')) goto LAB_00a75aa9; goto joined_r0x00a75bcd; case 0xf: iVar6 = 6; break; case 0x10: iVar6 = 5; break; case 0x19: iVar6 = 9; } _param_2 = *(code **)(in_ECX + 0x48); LAB_00a75a51: uVar1 = *(undefined4 *)(in_ECX + 0x4c); local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(in_ECX); local_8 = 4; (*_param_2)(iVar6,&local_1c,uVar1,uVar3); local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if ((local_14 != (int *)0x0) && (cVar2 = (**(code **)(*local_14 + 0xc))(), cVar2 != '\0')) { joined_r0x00a75bcd: if (g_lobbyReleaseFn != (code *)0x0) { (*g_lobbyReleaseFn)(&local_18); } } LAB_00a75aa9: *(undefined4 *)(in_ECX + 0x48) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; ExceptionList = local_10; return; } //@@ 00a75c10 FUN_00a75c10 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a75c10(ulonglong *param_1,char param_2) { code *pcVar1; char cVar2; int *piVar3; undefined4 *puVar4; int in_ECX; int iVar5; undefined1 auStackY_104 [128]; void *lobbyPtr; void *lobbyCtrl; undefined **local_58 [2]; int *local_50; undefined **local_4c; int *local_44; ulonglong *local_3c; code *local_38; byte local_34 [32]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13da5; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_34 + 0x30); ExceptionList = &local_10; iVar5 = 0; local_3c = param_1; if (param_2 != '\0') { iVar5 = 0x12; } switch((int)param_1[2]) { case 2: break; case 3: case 7: case 8: case 9: break; case 4: break; case 5: break; case 6: break; case 10: case 0xb: break; default: local_38 = *(code **)(in_ECX + 0x50); if (iVar5 != 0) goto LAB_00a75c72; piVar3 = (int *)SteamInternal_ContextInit(); if (*piVar3 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(); (**(code **)(*(int *)*puVar4 + 0xc))(); } sprintf(local_34,&DAT_00ba23d0); puVar4 = (undefined4 *)SteamInternal_ContextInit(); pcVar1 = *(code **)(*(int *)*puVar4 + 100); lobbyPtr = *(void **)local_3c; FUN_00a238e0(); lobbyCtrl = (void *)0xa75d90; (*pcVar1)(); KAGE::Network::Multiplayer::LobbySteam::find_or_create(auStackY_104 + 0x84,local_3c); KAGE::Network::Multiplayer::ConstLobby::ConstLobby(local_58,lobbyPtr,lobbyCtrl); local_8 = 0; (*local_38)(0); local_58[0] = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_50 == (int *)0x0) { ExceptionList = local_10; return; } cVar2 = (**(code **)(*local_50 + 0xc))(); if (cVar2 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } goto LAB_00a75cc4; } local_38 = *(code **)(in_ECX + 0x50); LAB_00a75c72: local_4c = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(); local_8 = 2; (*local_38)(); local_4c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 3; if (((local_44 != (int *)0x0) && (cVar2 = (**(code **)(*local_44 + 0xc))(), cVar2 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { LAB_00a75cc4: (*g_lobbyReleaseFn)(); } ExceptionList = local_10; return; } //@@ 00a75ef0 FUN_00a75ef0 void FUN_00a75ef0(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<32>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x14); } return; } //@@ 00a75f30 FUN_00a75f30 void FUN_00a75f30(int *param_1,uint *param_2) { uint *puVar1; undefined8 uVar2; char cVar3; uint uVar4; undefined8 *puVar5; undefined4 *newNode; ReferenceCountBase *pRVar6; void *pvVar7; undefined4 *in_ECX; undefined1 uVar8; void *local_34; int iStack_30; undefined1 local_28 [8]; undefined4 *local_20; ReferenceCountBase *local_1c; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13ca4; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; local_18 = in_ECX; puVar5 = (undefined8 *)FUN_00731ee0(local_28,param_2); pvVar7 = *(void **)(puVar5 + 1); uVar2 = *puVar5; if (*(char *)((int)pvVar7 + 0xd) == '\0') { if ((*(uint *)((int)pvVar7 + 0x14) <= param_2[1]) && ((*(uint *)((int)pvVar7 + 0x14) < param_2[1] || (*(uint *)((int)pvVar7 + 0x10) <= *param_2))) ) { uVar8 = 0; goto LAB_00a7606d; } } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } local_14 = *in_ECX; local_8 = 0; local_20 = (undefined4 *)0x0; newNode = operator_new(0x20); local_8 = 1; puVar1 = newNode + 6; uVar4 = param_2[1]; newNode[4] = *param_2; newNode[5] = uVar4; uVar4 = param_2[2]; *puVar1 = 0; newNode[7] = 0; local_20 = newNode; pRVar6 = operator_new(0x18); local_8._0_1_ = 2; local_1c = pRVar6; if (pRVar6 == (ReferenceCountBase *)0x0) { pRVar6 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar6); *(undefined ***)pRVar6 = ReferenceCount::vftable; *(uint *)(pRVar6 + 0x14) = uVar4; } local_8 = CONCAT31(local_8._1_3_,1); if ((int *)newNode[7] != (int *)0x0) { cVar3 = (**(code **)(*(int *)newNode[7] + 0xc))(); if ((cVar3 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(puVar1); } } *puVar1 = uVar4; iStack_30 = (int)((ulonglong)uVar2 >> 0x20); newNode[7] = pRVar6; local_34 = (void *)uVar2; *newNode = local_14; newNode[1] = local_14; newNode[2] = local_14; *(undefined2 *)(newNode + 3) = 0; pvVar7 = std::_Tree::_Insert_node(local_18,local_34,iStack_30,newNode); uVar8 = 1; LAB_00a7606d: *param_1 = (int)pvVar7; *(undefined1 *)(param_1 + 1) = uVar8; ExceptionList = local_10; return; } //@@ 00a76090 FUN_00a76090 void FUN_00a76090(undefined4 *param_1) { undefined4 uVar1; uVar1 = SteamAPI_GetHSteamUser("SteamNetworking006"); uVar1 = SteamInternal_FindOrCreateUserInterface(uVar1); *param_1 = uVar1; return; } //@@ 00a760b0 FUN_00a760b0 void FUN_00a760b0(byte param_1) { undefined4 *in_ECX; *in_ECX = CCallbackImpl<32>::vftable; if ((*(byte *)(in_ECX + 1) & 1) != 0) { SteamAPI_UnregisterCallback(); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00a760f0 FUN_00a760f0 void FUN_00a760f0(byte param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 *in_ECX; uVar1 = in_ECX[0x12]; uVar2 = in_ECX[0x13]; *in_ECX = KAGE::Network::Multiplayer::ServiceEOS::vftable; uVar3 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform); _EOS_Lobby_RemoveNotifyLobbyMemberStatusReceived_12(uVar3,uVar1,uVar2); in_ECX[0x12] = 0; in_ECX[0x13] = 0; in_ECX[0x18] = 0; in_ECX[0x19] = 0; in_ECX[0x16] = 0; in_ECX[0x17] = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0; KAGE::Network::Multiplayer::ServiceBase::~ServiceBase(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x68); } return; } //@@ 00a76180 FUN_00a76180 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a76180(void) { uint uVar1; qword qVar2; char cVar3; undefined4 uVar4; int iVar5; void *buffer; qword *pqVar6; undefined4 local_78; void *local_74; uint local_70; undefined4 local_6c; undefined4 local_68; undefined4 local_64; undefined4 local_60; void *local_5c; undefined4 local_58; int local_54; int *local_50; void *local_4c; void *local_48; undefined1 local_41; uint local_40; undefined1 local_3c [40]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13ddd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_3c + 0x38); ExceptionList = &local_10; local_5c = g_eosLocalUserId; local_58 = 0; local_60 = 2; local_40 = 0; uVar4 = _EOS_Platform_GetP2PInterface_4(g_eosPlatform,&local_60,&local_40,local_14); iVar5 = _EOS_P2P_GetNextReceivedPacketSize_12(uVar4); uVar1 = local_70; local_70 = local_40; do { local_40 = local_70; if (iVar5 != 0) { local_70 = uVar1; FUN_00a77f70(); ExceptionList = local_10; return; } local_6c = 0; local_78 = 2; local_74 = g_eosLocalUserId; buffer = operator_new_tracked(local_70); uVar4 = _EOS_Platform_GetP2PInterface_4 (g_eosPlatform,&local_78,&local_4c,local_3c,&local_41,buffer,&local_40); iVar5 = _EOS_P2P_ReceivePacket_28(uVar4); if (iVar5 == 0) { GridEntity_Door::play_animation ((GridEntity_Door *)&DAT_00c5ac08,&local_54,local_4c,(void *)0x0,0); local_8 = 0; local_68 = *(undefined4 *)(local_54 + 8); local_64 = *(undefined4 *)(local_54 + 0xc); NetworkManager::receive_packet(local_48,(ulonglong *)&local_68,buffer,local_40); local_8 = 1; if (((local_50 != (int *)0x0) && (cVar3 = (**(code **)(*local_50 + 0xc))(), cVar3 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_54); } LAB_00a762dc: local_8 = 0xffffffff; } else if (buffer != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)buffer + -4); qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar1; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar2 < uVar1); free((void *)((int)buffer + -4)); goto LAB_00a762dc; } uVar4 = _EOS_Platform_GetP2PInterface_4(g_eosPlatform,&local_60,&local_40); iVar5 = _EOS_P2P_GetNextReceivedPacketSize_12(uVar4); uVar1 = local_70; local_70 = local_40; } while( true ); } //@@ 00a76330 FUN_00a76330 undefined4 FUN_00a76330(code *param_1,undefined4 param_2) { int iVar1; undefined4 uVar2; undefined4 uStack_1c; undefined4 *puStack_18; undefined4 uStack_14; undefined4 uStack_10; int iStack_c; undefined4 uStack_8; if ((DAT_00c5abf4 & 0x10) != 0) { (*param_1)(0,param_2); return 0; } if (DAT_00c5abd8 == 0) { KAGE_LogMessage(0x10,(byte *)"Authorization ticket is NULL\n"); if (DAT_00c5abd8 == 0) { DAT_00c5abf4 = DAT_00c5abf4 | 4; return 1; } } iVar1 = DAT_00c5abd8; KAGE_LogMessage(1,(byte *)"Connecting to EOS...\n"); puStack_18 = &uStack_10; DAT_00c5abf4 = DAT_00c5abf4 & 0xfffffffb | 8; uStack_14 = 0; uStack_8 = 0; uStack_1c = 2; uStack_10 = 1; if (iVar1 != DAT_00c5abf8) { uStack_8 = 0x12; } iStack_c = iVar1; uVar2 = _EOS_Platform_GetConnectInterface_4(g_eosPlatform,&uStack_1c,0,FUN_00a60590); _EOS_Connect_Login_16(uVar2); return 1; } //@@ 00a76410 FUN_00a76410 uint FUN_00a76410(void) { return CONCAT31((uint3)(DAT_00c5abf4 >> 0xc),(char)(DAT_00c5abf4 >> 4)) & 0xffffff01; } //@@ 00a76420 FUN_00a76420 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ bool FUN_00a76420(void *param_1,undefined4 param_2,undefined4 param_3) { char cVar1; uint uVar2; int extraout_EAX; int *piVar3; undefined4 uVar4; int iVar5; undefined4 local_74; void *local_70; undefined4 local_6c; undefined4 *local_68; undefined4 local_64; undefined4 local_60; undefined4 local_5c; undefined4 local_58; undefined4 local_54; undefined4 local_50; undefined1 local_4c [4]; int *local_48; undefined **local_44 [2]; undefined4 local_3c; char local_38 [36]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13e25; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_38 + 0x34); ExceptionList = &local_10; local_44[0] = KAGE::System::UserProfileBase::vftable; local_14 = uVar2; UserProfile::find_or_create(param_1); local_8 = 0; local_44[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_44); } local_8 = 1; builtin_strncpy(local_38,"KAGE_P2P_SOCKET_ID",0x13); local_38[0x13] = '\0'; local_38[0x14] = '\0'; local_38[0x15] = '\0'; local_38[0x16] = '\0'; local_38[0x17] = '\0'; local_38[0x18] = '\0'; local_38[0x19] = '\0'; local_38[0x1a] = '\0'; local_38[0x1b] = '\0'; local_38[0x1c] = '\0'; local_38[0x1d] = '\0'; local_38[0x1e] = '\0'; local_38[0x1f] = '\0'; local_38[0x20] = '\0'; local_38[0x21] = '\0'; local_38[0x22] = '\0'; local_70 = g_eosLocalUserId; local_38[0x23] = 0; local_3c = 1; local_64 = 0; local_50 = 0; local_74 = 3; piVar3 = (int *)FUN_00a239e0(local_4c); local_6c = *(undefined4 *)(*piVar3 + 0x10); local_8._0_1_ = 2; if (local_48 != (int *)0x0) { cVar1 = (**(code **)(*local_48 + 0xc))(uVar2); if ((cVar1 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_4c); } } local_8 = CONCAT31(local_8._1_3_,1); local_68 = &local_3c; local_60 = param_3; local_5c = param_2; local_58 = 1; local_54 = 0; uVar4 = _EOS_Platform_GetP2PInterface_4(g_eosPlatform,&local_74); iVar5 = _EOS_P2P_SendPacket_8(uVar4); if (iVar5 != 0) { _EOS_EResult_ToString_4(iVar5); KAGE_LogMessage(8,(byte *)"Failed to send P2P data: %s\n"); } ExceptionList = local_10; return iVar5 == 0; } //@@ 00a765a0 FUN_00a765a0 void FUN_00a765a0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { undefined4 uVar1; int in_ECX; undefined4 local_48; void *local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; char *local_30; undefined8 local_2c; undefined8 local_24; undefined4 local_1c; undefined8 local_18; undefined8 local_10; undefined4 local_8; local_44 = g_eosLocalUserId; local_2c = 0; local_24 = 0; local_18 = 0; local_10 = 0; local_8 = 0; local_48 = 10; local_38 = 1; local_34 = 1; local_1c = 1; local_30 = "KAGE_EOS_LOBBY_BUCKET_ID"; local_40 = param_2; if (param_1 == 1) { local_3c = 1; } else if (param_1 == 3) { local_3c = 0; } else { local_3c = 2; } *(undefined4 *)(in_ECX + 0x50) = param_3; *(undefined4 *)(in_ECX + 0x54) = param_4; uVar1 = _EOS_Platform_GetLobbyInterface_4 (g_eosPlatform,&local_48,param_2, KAGE::Network::Multiplayer::ServiceEOS::on_create_lobby_complete); _EOS_Lobby_CreateLobby_16(uVar1); return; } //@@ 00a76650 FUN_00a76650 void FUN_00a76650(int param_1,code *param_2,undefined4 param_3) { char cVar1; byte bVar2; uint uVar3; int *piVar4; undefined4 *puVar5; int iVar6; undefined4 uVar7; int in_ECX; undefined4 local_40; undefined4 local_3c; void *local_38; undefined4 local_34; undefined8 local_30; undefined4 local_28; undefined8 local_24; undefined **local_1c; undefined **local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13e65; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar4 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510,uVar3); if (*piVar4 != 0) { puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c510,uVar3); cVar1 = (**(code **)(*(int *)*puVar5 + 4))(); if ((cVar1 != '\0') && (g_multiplayerService != (void *)0x0)) { cVar1 = (**(code **)(*(int *)g_multiplayerService + 0x10))(); if (cVar1 != '\0') { if (*(int **)(param_1 + 4) == (int *)0x0) { local_14 = (int *)0x0; } else { iVar6 = (**(code **)(**(int **)(param_1 + 4) + 0x20))(&local_24); local_14 = *(int **)(iVar6 + 4); local_24 = CONCAT44(local_24._4_4_,KAGE::System::UserProfileBase::vftable); } local_18 = KAGE::System::UserProfile::vftable; local_8 = 2; bVar2 = KAGE::System::UserProfile::is_local_user(&local_18); local_8 = 0xffffffff; if (bVar2 != 0) { (*param_2)(0,param_1,param_3); ExceptionList = local_10; return; } *(code **)(in_ECX + 0x58) = param_2; *(undefined4 *)(in_ECX + 0x5c) = param_3; local_30 = 0; local_28 = 0; local_40 = 5; iVar6 = 0; if (*(int *)(param_1 + 4) != 0) { iVar6 = __RTDynamicCast(*(int *)(param_1 + 4),0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); } local_3c = *(undefined4 *)(iVar6 + 0x28); local_38 = g_eosLocalUserId; local_34 = 1; uVar7 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&local_40); _EOS_Lobby_JoinLobby_16(uVar7); ExceptionList = local_10; return; } } } local_24 = 0; KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_24); local_8 = 0; (*param_2)(3,&local_1c,param_3); local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } ExceptionList = local_10; return; } //@@ 00a76830 FUN_00a76830 void FUN_00a76830(undefined4 param_1,undefined4 param_2) { char cVar1; uint uVar2; int iVar3; undefined4 uVar4; int in_ECX; undefined4 local_28; void *local_24; undefined4 local_20; undefined **local_1c; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b08b55; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0x60) = param_1; *(undefined4 *)(in_ECX + 100) = param_2; local_28 = 1; local_24 = g_eosLocalUserId; local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_18 = 0; local_14 = (int *)0x0; local_8 = 0; std::shared_ptr::assign(&local_18,&g_multiplayerLobbyPtr); local_1c = KAGE::Network::Multiplayer::Lobby::vftable; local_8 = 1; iVar3 = 0; if (local_18 != 0) { iVar3 = __RTDynamicCast(local_18,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0,uVar2); } local_20 = *(undefined4 *)(iVar3 + 0x20); local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 2; if (local_14 != (int *)0x0) { cVar1 = (**(code **)(*local_14 + 0xc))(); if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_18); } } uVar4 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&local_28,0,FUN_00a76ff0); _EOS_Lobby_LeaveLobby_16(uVar4); ExceptionList = local_10; return; } //@@ 00a76930 FUN_00a76930 void FUN_00a76930(ulonglong *param_1) { int *piVar1; byte bVar2; uint uVar3; void *in_ECX; undefined4 local_2c; undefined4 local_28; undefined4 *local_24; undefined1 local_1c [4]; undefined4 *local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13c5c; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_1c + 0x18); ExceptionList = &local_10; bVar2 = connection_map_contains(in_ECX,param_1); if (bVar2 != 0) { KAGE_LogMessage(0x10,(byte *)"Trying to add a redundant network connection\n"); } piVar1 = (int *)((int)in_ECX + 0x10); local_14 = piVar1; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,uVar3); } local_8 = 0; local_24 = operator_new(0x40); local_8._0_1_ = 1; local_18 = local_24; if (local_24 == (undefined4 *)0x0) { local_24 = (undefined4 *)0x0; } else { FUN_00a58740(param_1); *local_24 = KAGE::Network::Multiplayer::ConnectionEOS::vftable; } local_8 = (uint)local_8._1_3_ << 8; local_2c = (undefined4)*param_1; local_28 = *(undefined4 *)((int)param_1 + 4); FUN_00a77a90(local_1c,&local_2c); local_8 = 2; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return; } //@@ 00a76a20 KAGE::Network::Multiplayer::ServiceEOS::on_create_lobby_complete /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: pushed as the completion callback by ServiceEOS vtable slot 7 (FUN_00a765a0 EOS_Lobby_CreateLobby); 'Failed to create EOS lobby: %s', sets user_id/user_name member attributes, 'localhost' */ void KAGE::Network::Multiplayer::ServiceEOS::on_create_lobby_complete(int *param_1) { code *pcVar1; int iVar2; char cVar3; uint uVar4; int iVar5; int iVar6; undefined4 uVar7; char *lobbyPtr; void *pvVar8; undefined4 uVar9; undefined ***pppuVar10; longlong lVar11; byte *buffer; undefined *puVar12; char *lobbyCtrl; undefined **ppuStack_74; undefined **local_70; int *local_6c; undefined **local_68; undefined8 local_64; undefined **local_5c; int *local_58; byte local_54 [64]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13eb5; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_54 + 0x50); ExceptionList = &local_10; local_14 = uVar4; iVar5 = __RTDynamicCast(g_multiplayerService,0,&ServiceBase::RTTI_Type_Descriptor, &RTTI_Type_Descriptor,0,uVar4); pcVar1 = *(code **)(iVar5 + 0x50); if (*param_1 != 0) { uVar9 = _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to create EOS lobby: %s\n"); uVar7 = *(undefined4 *)(iVar5 + 0x54); ppuStack_74 = ConstLobby::vftable; SmartPointer::SmartPointer(uVar9); local_8 = 5; (*pcVar1)(0x12,&ppuStack_74,uVar7); ppuStack_74 = ConstLobby::vftable; local_8 = 6; if (local_6c == (int *)0x0) { ExceptionList = local_10; return; } cVar3 = (**(code **)(*local_6c + 0xc))(); if (cVar3 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } pppuVar10 = &local_70; goto LAB_00a76c5e; } FUN_00a84a90(); local_8 = 0; iVar2 = param_1[1]; iVar6 = __RTDynamicCast(local_5c,0,&LobbyImplBase::RTTI_Type_Descriptor, &LobbyEOS::RTTI_Type_Descriptor,0,uVar4); local_70 = System::UserProfile::vftable; *(int *)(iVar6 + 0x24) = iVar2; pvVar8 = g_userProfile; local_6c = g_userProfile; local_8 = CONCAT31(local_8._1_3_,1); if (g_userProfile == (void *)0x0) { local_64 = 0; local_64._4_4_ = (int *)0x0; local_64._0_4_ = 0; uVar7 = local_64._4_4_; uVar9 = (undefined4)local_64; } else { uVar7 = *(undefined4 *)((int)g_userProfile + 0xc); uVar9 = *(undefined4 *)((int)g_userProfile + 8); } buffer = local_54; puVar12 = &DAT_00ba24e0; sprintf(buffer,&DAT_00ba24e0); __RTDynamicCast(local_5c,0,&LobbyImplBase::RTTI_Type_Descriptor,&LobbyEOS::RTTI_Type_Descriptor,0, buffer,puVar12,uVar9,uVar7); FUN_00a84b90("user_id",local_54,"add member string value"); uVar7 = __RTDynamicCast(local_5c,0,&LobbyImplBase::RTTI_Type_Descriptor, &LobbyEOS::RTTI_Type_Descriptor,0); local_64 = CONCAT44(uVar7,(undefined4)local_64); if (pvVar8 == (void *)0x0) { LAB_00a76b5e: lobbyPtr = "???"; } else { lVar11 = __aullshr(); if (lVar11 == 0xfefefefe) { lobbyPtr = "localhost"; } else { if (pvVar8 == (void *)0x0) goto LAB_00a76b5e; lobbyPtr = *(char **)((int)pvVar8 + 0x10); } } lobbyCtrl = "add member string value"; FUN_00a84b90("user_name",lobbyPtr,"add member string value"); uVar7 = *(undefined4 *)(iVar5 + 0x54); FUN_00a28840(&local_5c); pvVar8 = ConstLobby::ConstLobby(&local_68,lobbyPtr,lobbyCtrl); local_8._0_1_ = 2; (*pcVar1)(0,pvVar8,uVar7); local_68 = ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,3); if (((local_64._4_4_ != (int *)0x0) && (cVar3 = (**(code **)(*local_64._4_4_ + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_64); } local_8 = 4; if (local_58 == (int *)0x0) { ExceptionList = local_10; return; } cVar3 = (**(code **)(*local_58 + 0xc))(); if (cVar3 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } pppuVar10 = &local_5c; LAB_00a76c5e: (*g_lobbyReleaseFn)(pppuVar10); ExceptionList = local_10; return; } //@@ 00a76c90 eos_join_lobby_callback /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? EOS completion callback pushed (push 0xa76c90 at 0xa76787) with the EOS_Lobby_JoinLobby call through 0xb18044 in FUN_00a76650; 'Failed to join EOS lobby: %%s' with EOS_EResult_ToString, dynamic_cast to ServiceEOS, reads user_id/user_name member attributes */ void eos_join_lobby_callback(int *param_1) { code *pcVar1; void *pvVar2; char cVar3; uint uVar4; int iVar5; undefined4 uVar6; char *pcVar7; int *piVar8; uint uVar9; undefined4 uVar10; undefined **ptr; int **ppiVar11; longlong lVar12; byte *buffer; undefined *puVar13; undefined8 local_74; int local_6c; int *local_68; int *local_64; undefined **local_60; int *local_5c; int *local_58; byte local_54 [64]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13f05; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_54 + 0x50); ExceptionList = &local_10; local_14 = uVar4; iVar5 = __RTDynamicCast(g_multiplayerService,0, &KAGE::Network::Multiplayer::ServiceBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::ServiceEOS::RTTI_Type_Descriptor,0,uVar4); pcVar1 = *(code **)(iVar5 + 0x58); if (*param_1 != 0) { uVar10 = _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to join EOS lobby: %s\n"); uVar6 = *(undefined4 *)(iVar5 + 0x5c); local_60 = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(uVar10); local_8 = 4; (*pcVar1)(0x12,&local_60,uVar6); local_60 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 5; if (local_58 == (int *)0x0) { ExceptionList = local_10; return; } cVar3 = (**(code **)(*local_58 + 0xc))(); if (cVar3 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } ppiVar11 = &local_5c; goto LAB_00a76fc6; } FUN_00a84a90(); local_8 = 0; iVar5 = __RTDynamicCast(local_68,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0,uVar4); _EOS_LobbyDetails_Release_4(*(undefined4 *)(iVar5 + 0x28)); iVar5 = __RTDynamicCast(local_68,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); pvVar2 = g_userProfile; *(undefined4 *)(iVar5 + 0x28) = 0; local_8 = CONCAT31(local_8._1_3_,1); if (pvVar2 == (void *)0x0) { local_74 = 0; local_74._4_4_ = 0; local_74._0_4_ = 0; uVar6 = local_74._4_4_; uVar10 = (undefined4)local_74; } else { uVar6 = *(undefined4 *)((int)pvVar2 + 0xc); uVar10 = *(undefined4 *)((int)pvVar2 + 8); } buffer = local_54; puVar13 = &DAT_00ba24e0; sprintf(buffer,&DAT_00ba24e0); __RTDynamicCast(local_68,0,&KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0,buffer,puVar13, uVar10,uVar6); FUN_00a84b90("user_id",local_54,"add member string value"); __RTDynamicCast(local_68,0,&KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); if (pvVar2 == (void *)0x0) { LAB_00a76df0: pcVar7 = "???"; } else { lVar12 = __aullshr(); if (lVar12 == 0xfefefefe) { pcVar7 = "localhost"; } else { if (pvVar2 == (void *)0x0) goto LAB_00a76df0; pcVar7 = *(char **)((int)pvVar2 + 0x10); } } FUN_00a84b90("user_name",pcVar7,"add member string value"); piVar8 = operator_new(8); iVar5 = local_68[3]; *piVar8 = local_68[2]; piVar8[1] = iVar5; iVar5 = __RTDynamicCast(local_68,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); cVar3 = FUN_00a84900(); if (cVar3 != '\0') { local_6c = 1; uVar4 = _EOS_LobbyDetails_GetMemberCount_8(*(undefined4 *)(iVar5 + 0x28),&local_6c); local_60 = (undefined **)0x0; local_5c = (int *)0x0; local_58 = (int *)0x0; local_8 = CONCAT31(local_8._1_3_,2); local_74 = 1; if (uVar4 != 0) { do { local_6c = _EOS_LobbyDetails_GetMemberByIndex_8(*(undefined4 *)(iVar5 + 0x28),&local_74); if (local_6c != 0) { if (local_5c == local_58) { std::vector<4byte>::_Emplace_reallocate(local_5c,&local_6c); } else { *local_5c = local_6c; local_5c = local_5c + 1; } } uVar9 = local_74._4_4_ + 1; local_74 = CONCAT44(uVar9,(undefined4)local_74); } while (uVar9 < uVar4); } if ((uint)((int)local_5c - (int)local_60) < 4) { KAGE::Network::Multiplayer::ServiceEOS::load_lobby_member_attributes(&local_60); } else { FUN_00a70770(&local_60,KAGE::Network::Multiplayer::ServiceEOS::load_lobby_member_attributes, piVar8); } local_8 = CONCAT31(local_8._1_3_,1); if (local_60 != (undefined **)0x0) { uVar4 = ((int)local_58 - (int)local_60 >> 2) * 4; ptr = local_60; if (0xfff < uVar4) { ptr = (undefined **)local_60[-1]; uVar4 = uVar4 + 0x23; if (0x1f < (uint)((int)local_60 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar4); } } local_8 = 3; if (local_64 == (int *)0x0) { ExceptionList = local_10; return; } cVar3 = (**(code **)(*local_64 + 0xc))(); if (cVar3 == '\0') { ExceptionList = local_10; return; } if (g_lobbyReleaseFn == (void *)0x0) { ExceptionList = local_10; return; } ppiVar11 = &local_68; LAB_00a76fc6: (*g_lobbyReleaseFn)(ppiVar11); ExceptionList = local_10; return; } //@@ 00a76ff0 FUN_00a76ff0 void FUN_00a76ff0(void) { code *pcVar1; undefined4 uVar2; char cVar3; int iVar4; undefined4 uVar5; undefined **local_1c; undefined1 local_18 [4]; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1271d; local_10 = ExceptionList; ExceptionList = &local_10; uVar5 = 0; iVar4 = __RTDynamicCast(g_multiplayerService,0, &KAGE::Network::Multiplayer::ServiceBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::ServiceEOS::RTTI_Type_Descriptor,0, __security_cookie ^ (uint)(local_18 + 0x14)); local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; pcVar1 = *(code **)(iVar4 + 0x60); uVar2 = *(undefined4 *)(iVar4 + 100); KAGE::SmartPointer::SmartPointer(uVar5); local_8 = 0; (*pcVar1)(0,&local_1c,uVar2); local_1c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = 1; if (local_14 != (int *)0x0) { cVar3 = (**(code **)(*local_14 + 0xc))(); if ((cVar3 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(local_18); } } FUN_00a5ffa0(&s_empty); ExceptionList = local_10; return; } //@@ 00a770b0 FUN_00a770b0 void FUN_00a770b0(int param_1) { undefined4 uVar1; char cVar2; uint uVar3; undefined4 *puVar4; int *piVar5; void *pvVar6; undefined **ppuVar7; int status; ulonglong *userId; undefined **local_2c; undefined **local_28; undefined **local_24; undefined4 local_20; int *local_1c; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13f4d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar5 = &local_18; pvVar6 = *(void **)(param_1 + 8); GridEntity_Door::play_animation((GridEntity_Door *)&DAT_00c5ac08,piVar5,pvVar6,(void *)0x0,0); local_8 = 0; ppuVar7 = *(undefined ***)(param_1 + 0xc); if (ppuVar7 == (undefined **)0x0) { local_8 = 1; local_2c = ppuVar7; local_28 = ppuVar7; local_24 = ppuVar7; puVar4 = operator_new(0x10); std::vector<4byte>::_Emplace_reallocate(0,(undefined4 *)(param_1 + 8)); piVar5 = (int *)FUN_00a84a90(); uVar1 = *(undefined4 *)(*piVar5 + 0xc); *puVar4 = *(undefined4 *)(*piVar5 + 8); puVar4[1] = uVar1; local_8._0_1_ = 2; if (local_1c != (int *)0x0) { cVar2 = (**(code **)(*local_1c + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_20); } } local_8._0_1_ = 1; puVar4[2] = *(undefined4 *)(param_1 + 8); FUN_00a70770(&local_2c,eos_lobby_member_on_user_info,puVar4); local_8 = (uint)local_8._1_3_ << 8; if (local_2c != (undefined **)0x0) { uVar3 = ((int)local_24 - (int)local_2c >> 2) * 4; ppuVar7 = local_2c; if (0xfff < uVar3) { ppuVar7 = (undefined **)local_2c[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_2c + (-4 - (int)ppuVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppuVar7,uVar3); } } else { if (ppuVar7 == (undefined **)0x1) { status = 1; } else if (ppuVar7 == (undefined **)0x2) { status = 2; } else { if (ppuVar7 != (undefined **)0x3) goto LAB_00a77255; status = 3; } local_20 = *(undefined4 *)(local_18 + 8); local_1c = *(int **)(local_18 + 0xc); userId = (ulonglong *)&local_20; FUN_00a84a90(); pvVar6 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_2c,piVar5,pvVar6); local_8._0_1_ = 3; Multiplayer::handle_member_status(pvVar6,userId,status); local_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,4); if (local_24 != (undefined **)0x0) { cVar2 = (**(code **)(*local_24 + 0xc))(uVar3); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_28); } } } LAB_00a77255: local_8 = 5; if (local_14 != (int *)0x0) { cVar2 = (**(code **)(*local_14 + 0xc))(); if ((cVar2 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_18); } } ExceptionList = local_10; return; } //@@ 00a772a0 KAGE::Network::Multiplayer::ServiceEOS::load_lobby_member_attributes /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? dynamic_cast ServiceBase->ServiceEOS, for each member id reads lobby member attributes "user_id" (std::stoull) and "user_name" via FUN_00a84e50 on LobbyEOS and stores them in the EpicUserInfo map; from the EOS join-lobby completion FUN_00a76c90 ("Failed to join EOS lobby: %s") and pushed as a callback */ void KAGE::Network::Multiplayer::ServiceEOS::load_lobby_member_attributes (int *param_1,void *param_2) { undefined4 uVar1; char cVar2; int iVar3; undefined4 *puVar4; void *value; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 uVar5; uint uVar6; uint *puVar7; char *pcVar8; uint uVar9; ulonglong uVar10; undefined1 local_78 [8]; int local_70; undefined **local_6c; int local_68; int *local_64; code *local_60; int local_5c; void *local_58; undefined4 *local_54; undefined8 local_50; undefined8 local_48; int *local_40; undefined **local_3c; void *local_38; int *local_34; uint local_30; undefined4 local_2c; uint local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13fb6; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_78 + 0x74); ExceptionList = &local_10; local_48 = (ulonglong)(uint)local_48; local_58 = param_2; local_5c = __RTDynamicCast(g_multiplayerService,0,&ServiceBase::RTTI_Type_Descriptor, &RTTI_Type_Descriptor,0,local_14); local_60 = *(code **)(local_5c + 0x58); ConstLobby::ConstLobby(param_2); local_8 = 0; puVar7 = (uint *)*param_1; uVar5 = extraout_ECX; uVar9 = 0; if (puVar7 != (uint *)param_1[1]) { do { uVar6 = *puVar7; local_30 = uVar6; _Find_lower_bound<>(local_78,&local_30); if ((*(char *)(local_70 + 0xd) != '\0') || (iVar3 = local_70, uVar6 < *(uint *)(local_70 + 0x10))) { iVar3 = DAT_00c5ac08; } uVar6 = uVar9 | 2; local_48 = CONCAT44(uVar9,(uint)local_48) | 0x200000000; if (iVar3 == DAT_00c5ac08) { SmartPointer::SmartPointer(DAT_00c5ac08); } else { FUN_00a23df0(iVar3 + 0x14); } local_8._0_1_ = 1; if (local_38 != (void *)0x0) { if (local_68 != 0) { __RTDynamicCast(local_68,0,&LobbyImplBase::RTTI_Type_Descriptor, &LobbyEOS::RTTI_Type_Descriptor,0); } PTR_s_empty_00c5c52c = &s_empty; FUN_00a84e50("user_id",&PTR_s_empty_00c5c52c,*puVar7); local_40 = (int *)PTR_s_empty_00c5c52c; if ((PTR_s_empty_00c5c52c == (undefined *)0x0) || (*PTR_s_empty_00c5c52c == '\0')) { local_48 = 0; uVar10 = 0; } else { local_1c = 0; local_18 = 0xf; local_2c = (undefined4 *)0x0; pcVar8 = PTR_s_empty_00c5c52c; do { cVar2 = *pcVar8; pcVar8 = pcVar8 + 1; } while (cVar2 != '\0'); uVar9 = (int)pcVar8 - (int)(PTR_s_empty_00c5c52c + 1); if (uVar9 < 0x10) { local_1c = uVar9; memmove(&local_2c,PTR_s_empty_00c5c52c,uVar9); *(undefined1 *)((int)&local_2c + uVar9) = 0; } else { if (0x7fffffff < uVar9) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } local_30 = uVar9 | 0xf; if (local_30 < 0x80000000) { if (local_30 < 0x16) { local_30 = 0x16; } } else { local_30 = 0x7fffffff; } puVar4 = std::_Allocate(local_30 + 1); local_18 = local_30; local_1c = uVar9; memcpy(puVar4,local_40,uVar9); *(undefined1 *)((int)puVar4 + uVar9) = 0; local_2c = puVar4; } local_8._0_1_ = 2; uVar6 = local_48._4_4_ | 1; local_48 = local_48 | 0x100000000; local_40 = _errno(); puVar4 = &local_2c; if (0xf < local_18) { puVar4 = local_2c; } *local_40 = 0; uVar10 = strtoull(puVar4,&local_54,10); if (puVar4 == local_54) { std::_Xinvalid_argument("invalid stoull argument"); goto LAB_00a77691; } if (*local_40 == 0x22) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("stoull argument out of range"); } } local_8._0_1_ = 1; local_8._1_3_ = 0; local_50 = uVar10; if ((uVar6 & 1) != 0) { uVar6 = uVar6 & 0xfffffffe; if (0xf < local_18) { uVar9 = local_18 + 1; puVar4 = local_2c; if (0xfff < uVar9) { puVar4 = (undefined4 *)local_2c[-1]; uVar9 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c + (-4 - (int)puVar4))) { LAB_00a77691: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar4,uVar9); } } if (local_68 != 0) { __RTDynamicCast(local_68,0,&LobbyImplBase::RTTI_Type_Descriptor, &LobbyEOS::RTTI_Type_Descriptor,0); } PTR_s_empty_00c5c52c = &s_empty; FUN_00a84e50("user_name",&PTR_s_empty_00c5c52c,*puVar7); System::UserProfile::set_id(local_38,&local_50,PTR_s_empty_00c5c52c); } local_8._0_1_ = 3; uVar5 = 0; if (local_34 != (int *)0x0) { cVar2 = (**(code **)(*local_34 + 0xc))(); uVar5 = extraout_ECX_00; if ((cVar2 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_38); uVar5 = extraout_ECX_01; } } puVar7 = puVar7 + 1; local_8 = (uint)local_8._1_3_ << 8; uVar9 = uVar6; } while (puVar7 != (uint *)param_1[1]); param_2 = local_58; } local_3c = ConstLobby::vftable; uVar1 = *(undefined4 *)(local_5c + 0x5c); SmartPointer::SmartPointer(uVar5); local_8._0_1_ = 4; value = (void *)FUN_00a71f00(); local_8._0_1_ = 5; std::shared_ptr::assign(&local_38,value); local_8._0_1_ = 6; if (local_50._4_4_ != (int *)0x0) { cVar2 = (**(code **)(*local_50._4_4_ + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_50); } } local_8._0_1_ = 7; (*local_60)(0,&local_3c,uVar1); local_3c = ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,8); if (local_34 != (int *)0x0) { cVar2 = (**(code **)(*local_34 + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_38); } } if (param_2 != (void *)0x0) { operator_delete(param_2,8); } local_6c = ConstLobby::vftable; local_8 = 9; if (local_64 != (int *)0x0) { cVar2 = (**(code **)(*local_64 + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_68); } } ExceptionList = local_10; return; } //@@ 00a776a0 eos_lobby_member_on_user_info /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: ? callback passed to FUN_00a70770 (EOS user info query) by FUN_00a770b0 (EOS lobby member update notify, pushed at a2966f/a603f1): once the user info is known reads lobby member attributes "user_id"/"user_name" (FUN_00a84e50), std::stoull ("invalid stoull argument"), then Multiplayer::handle_member_status */ void eos_lobby_member_on_user_info(undefined4 param_1,int param_2) { bool bVar1; undefined *puVar2; char cVar3; uint uVar4; int *piVar5; undefined4 extraout_EAX; undefined4 extraout_EDX; int *piVar6; char *pcVar7; ulonglong uVar8; void **outUserInfo; void *pvVar9; ulonglong *userId; int status; void *local_4c; int *local_48; undefined1 *local_44; undefined8 local_40; undefined **local_38; undefined8 local_34; undefined4 local_2c; undefined **local_20; uint local_1c; int *local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1402e; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_44 = (undefined1 *)0x0; local_40 = CONCAT44(param_2,(undefined4)local_40); local_14 = uVar4; __RTDynamicCast(g_multiplayerService,0, &KAGE::Network::Multiplayer::ServiceBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::ServiceEOS::RTTI_Type_Descriptor,0,uVar4); outUserInfo = &local_4c; pvVar9 = *(void **)(param_2 + 8); GridEntity_Door::play_animation((GridEntity_Door *)&DAT_00c5ac08,outUserInfo,pvVar9,(void *)0x0,0) ; local_8 = 0; if (local_4c != (void *)0x0) { local_38 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_34._0_4_ = 0; local_34._4_4_ = (int *)0x0; local_8 = 1; std::shared_ptr::assign(&local_34,&g_multiplayerLobbyPtr); local_38 = KAGE::Network::Multiplayer::Lobby::vftable; bVar1 = false; local_8._0_1_ = 2; if ((int)local_34 != 0) { __RTDynamicCast((int)local_34,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0,uVar4); } PTR_s_empty_00c5c52c = &s_empty; FUN_00a84e50("user_id",&PTR_s_empty_00c5c52c,*(undefined4 *)((int)local_4c + 0x10)); puVar2 = PTR_s_empty_00c5c52c; local_44 = PTR_s_empty_00c5c52c; local_38 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 3; if (((local_34._4_4_ != (int *)0x0) && (cVar3 = (**(code **)(*local_34._4_4_ + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_34); } local_8 = (uint)local_8._1_3_ << 8; if ((puVar2 == (undefined *)0x0) || (*puVar2 == '\0')) { uVar8 = 0; } else { local_1c = 0; local_18 = (int *)&DAT_0000000f; local_2c = (int *)0x0; pcVar7 = puVar2; do { cVar3 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar3 != '\0'); uVar4 = (int)pcVar7 - (int)(puVar2 + 1); if (uVar4 < 0x10) { local_1c = uVar4; memmove(&local_2c,puVar2,uVar4); *(undefined1 *)((int)&local_2c + uVar4) = 0; } else { if (0x7fffffff < uVar4) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } piVar6 = (int *)(uVar4 | 0xf); if (piVar6 < (int *)0x80000000) { if (piVar6 < (int *)0x16) { piVar6 = (int *)0x16; } } else { piVar6 = (int *)0x7fffffff; } piVar5 = std::_Allocate((uint)((int)piVar6 + 1)); local_1c = uVar4; local_18 = piVar6; memcpy(piVar5,local_44,uVar4); *(undefined1 *)((int)piVar5 + uVar4) = 0; local_2c = piVar5; } local_8 = CONCAT31(local_8._1_3_,4); bVar1 = true; local_44 = &DAT_00000007; piVar5 = _errno(); piVar6 = &local_2c; if (&DAT_0000000f < local_18) { piVar6 = local_2c; } *piVar5 = 0; uVar8 = strtoull(piVar6,(int **)((int)&local_34 + 4),10); if (piVar6 == local_34._4_4_) { std::_Xinvalid_argument("invalid stoull argument"); uVar8 = CONCAT44(extraout_EDX,extraout_EAX); } if (*piVar5 == 0x22) { /* WARNING: Subroutine does not return */ std::_Xout_of_range("stoull argument out of range"); } } local_40 = uVar8; local_8 = 0; if ((bVar1) && (&DAT_0000000f < local_18)) { piVar5 = (int *)((int)local_18 + 1); piVar6 = local_2c; if ((int *)0xfff < piVar5) { piVar6 = (int *)local_2c[-1]; piVar5 = local_18 + 9; if (0x1f < (uint)((int)local_2c + (-4 - (int)piVar6))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar6,(uint)piVar5); } local_38 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_34._0_4_ = 0; local_34._4_4_ = (int *)0x0; local_8._0_1_ = 5; std::shared_ptr::assign(&local_34,&g_multiplayerLobbyPtr); local_38 = KAGE::Network::Multiplayer::Lobby::vftable; local_8._0_1_ = 6; if ((int)local_34 != 0) { __RTDynamicCast((int)local_34,0, &KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor, &KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); } PTR_s_empty_00c5c52c = &s_empty; outUserInfo = (void **)0xa77996; FUN_00a84e50("user_name",&PTR_s_empty_00c5c52c,*(undefined4 *)((int)local_4c + 0x10)); puVar2 = PTR_s_empty_00c5c52c; local_38 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8._0_1_ = 7; if (((local_34._4_4_ != (int *)0x0) && (cVar3 = (**(code **)(*local_34._4_4_ + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_34); } local_8 = (uint)local_8._1_3_ << 8; pvVar9 = (void *)0xa779dc; KAGE::System::UserProfile::set_id(local_4c,&local_40,puVar2); } local_34._0_4_ = *(int *)((int)local_4c + 8); local_34._4_4_ = *(int **)((int)local_4c + 0xc); userId = &local_34; status = 0; FUN_00a84970(); pvVar9 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_20,outUserInfo,pvVar9); local_8._0_1_ = 8; Multiplayer::handle_member_status(pvVar9,userId,status); local_20 = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,9); if (((local_18 != (int *)0x0) && (cVar3 = (**(code **)(*local_18 + 0xc))(), cVar3 != '\0')) && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_1c); } local_8 = 10; if (((local_48 != (int *)0x0) && (cVar3 = (**(code **)(*local_48 + 0xc))(), cVar3 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_4c); } ExceptionList = local_10; return; } //@@ 00a77a90 FUN_00a77a90 void FUN_00a77a90(int *param_1,uint *param_2) { uint *puVar1; undefined8 uVar2; char cVar3; uint uVar4; undefined8 *puVar5; undefined4 *newNode; ReferenceCountBase *pRVar6; void *pvVar7; undefined4 *in_ECX; undefined1 uVar8; void *local_34; int iStack_30; undefined1 local_28 [8]; undefined4 *local_20; ReferenceCountBase *local_1c; undefined4 *local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b13ca4; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_28 + 0x24); ExceptionList = &local_10; local_18 = in_ECX; puVar5 = (undefined8 *)FUN_00731ee0(local_28,param_2); pvVar7 = *(void **)(puVar5 + 1); uVar2 = *puVar5; if (*(char *)((int)pvVar7 + 0xd) == '\0') { if ((*(uint *)((int)pvVar7 + 0x14) <= param_2[1]) && ((*(uint *)((int)pvVar7 + 0x14) < param_2[1] || (*(uint *)((int)pvVar7 + 0x10) <= *param_2))) ) { uVar8 = 0; goto LAB_00a77bcd; } } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar4); } local_14 = *in_ECX; local_8 = 0; local_20 = (undefined4 *)0x0; newNode = operator_new(0x20); local_8 = 1; puVar1 = newNode + 6; uVar4 = param_2[1]; newNode[4] = *param_2; newNode[5] = uVar4; uVar4 = param_2[2]; *puVar1 = 0; newNode[7] = 0; local_20 = newNode; pRVar6 = operator_new(0x18); local_8._0_1_ = 2; local_1c = pRVar6; if (pRVar6 == (ReferenceCountBase *)0x0) { pRVar6 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar6); *(undefined ***)pRVar6 = ReferenceCount::vftable; *(uint *)(pRVar6 + 0x14) = uVar4; } local_8 = CONCAT31(local_8._1_3_,1); if ((int *)newNode[7] != (int *)0x0) { cVar3 = (**(code **)(*(int *)newNode[7] + 0xc))(); if ((cVar3 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(puVar1); } } *puVar1 = uVar4; iStack_30 = (int)((ulonglong)uVar2 >> 0x20); newNode[7] = pRVar6; local_34 = (void *)uVar2; *newNode = local_14; newNode[1] = local_14; newNode[2] = local_14; *(undefined2 *)(newNode + 3) = 0; pvVar7 = std::_Tree::_Insert_node(local_18,local_34,iStack_30,newNode); uVar8 = 1; LAB_00a77bcd: *param_1 = (int)pvVar7; *(undefined1 *)(param_1 + 1) = uVar8; ExceptionList = local_10; return; } //@@ 00a77bf0 KAGE::Network::Multiplayer::ServiceBase::ServiceBase /* DB: constructor: stores ServiceBase::vftable, builds three std::list/map sentinels each guarded by a KAGE::Mutex (vftable at +0x10,+0x24,+0x38), sets g_multiplayerRelease; Multiplayer::set_service_provider calls it on operator_new(0x74/0xb0/0x68) before storing ServiceLocalhost/ServiceSteam/ServiceEOS vftables */ void KAGE::Network::Multiplayer::ServiceBase::ServiceBase(void) { uint uVar1; void *pvVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b140a7; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = vftable; *(undefined1 *)(in_ECX + 1) = 0; in_ECX[2] = 0; in_ECX[3] = 0; pvVar2 = operator_new(0x20); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; in_ECX[2] = pvVar2; *(undefined1 *)(in_ECX + 5) = 0; in_ECX[4] = Mutex::vftable; in_ECX[6] = 0; local_8 = 1; in_ECX[7] = 0; in_ECX[8] = 0; pvVar2 = operator_new(0x1c); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *(void **)((int)pvVar2 + 8) = pvVar2; *(undefined2 *)((int)pvVar2 + 0xc) = 0x101; in_ECX[7] = pvVar2; *(undefined1 *)(in_ECX + 10) = 0; in_ECX[9] = Mutex::vftable; in_ECX[0xb] = 0; local_8._0_1_ = 3; in_ECX[0xc] = 0; in_ECX[0xd] = 0; pvVar2 = operator_new(0x10); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; in_ECX[0xc] = pvVar2; *(undefined1 *)(in_ECX + 0xf) = 0; in_ECX[0xe] = Mutex::vftable; in_ECX[0x10] = 0; local_8 = CONCAT31(local_8._1_3_,5); g_multiplayerRelease = FUN_00a79280; if (*(code **)(in_ECX[4] + 4) == FUN_00a15770) { FUN_00a15770(); } else { (**(code **)(in_ECX[4] + 4))(uVar1); } if (*(code **)(in_ECX[9] + 4) == FUN_00a15770) { FUN_00a15770(); } else { (**(code **)(in_ECX[9] + 4))(); } if (*(code **)(in_ECX[0xe] + 4) == FUN_00a15770) { FUN_00a15770(); ExceptionList = local_10; return; } (**(code **)(in_ECX[0xe] + 4))(); ExceptionList = local_10; return; } //@@ 00a77d60 std::basic_stringbuf,std::allocator_>::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::basic_stringbuf,class std::allocator >::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::basic_stringbuf,std::allocator_>:: _scalar_deleting_destructor_ (basic_stringbuf,std::allocator_> *this,uint param_1) { KAGE::Network::Multiplayer::ServiceBase::~ServiceBase(this); if ((param_1 & 1) != 0) { operator_delete(this,0x44); } return this; } //@@ 00a77d90 FUN_00a77d90 void FUN_00a77d90(void) { int *in_ECX; std::map::_Erase_tree(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x20); return; } //@@ 00a77db0 FUN_00a77db0 void FUN_00a77db0(void) { int *in_ECX; FUN_00a79d10(in_ECX,*(undefined4 *)(*in_ECX + 4)); operator_delete((void *)*in_ECX,0x1c); return; } //@@ 00a77dd0 KAGE::Network::Multiplayer::ServiceBase::~ServiceBase /* DB: sets ServiceBase::vftable, clears its list, destroys three KAGE::Mutex members (DeleteCriticalSection, MutexBase::vftable) and trees; called from ServiceLocalhost dtor 00a73aa0 and other service dtors prototype: db/protos.zhl */ void __thiscall KAGE::Network::Multiplayer::ServiceBase::~ServiceBase(void *this) { int *piVar1; int iVar2; LPCRITICAL_SECTION p_Var3; uint uVar4; int *piVar5; int *piVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b03a50; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x10); *(undefined ***)this = vftable; (**(code **)(*(int *)((int)this + 0x10) + 0xc))(0xffffffff,uVar4); iVar2 = *(int *)((int)this + 8); piVar5 = (int *)((int)this + 8); std::map::_Erase_tree(piVar5,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)((int)this + 0xc) = 0; (**(code **)(*piVar1 + 0x10))(); FUN_00a78940(); (**(code **)(*(int *)((int)this + 0x24) + 8))(); (**(code **)(*(int *)((int)this + 0x38) + 8))(); (**(code **)(*piVar1 + 8))(); p_Var3 = *(LPCRITICAL_SECTION *)((int)this + 0x40); *(undefined ***)((int)this + 0x38) = Mutex::vftable; if (p_Var3 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var3); operator_delete(p_Var3,0x1c); *(undefined4 *)((int)this + 0x40) = 0; } *(byte *)((int)this + 0x3c) = *(byte *)((int)this + 0x3c) & 0xfe; *(undefined ***)((int)this + 0x38) = MutexBase::vftable; FUN_00a799d0(); operator_delete(*(void **)((int)this + 0x30),0x10); p_Var3 = *(LPCRITICAL_SECTION *)((int)this + 0x2c); *(undefined ***)((int)this + 0x24) = Mutex::vftable; if (p_Var3 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var3); operator_delete(p_Var3,0x1c); *(undefined4 *)((int)this + 0x2c) = 0; } *(byte *)((int)this + 0x28) = *(byte *)((int)this + 0x28) & 0xfe; *(undefined ***)((int)this + 0x24) = MutexBase::vftable; piVar6 = (int *)((int)this + 0x1c); FUN_00a79d10(piVar6,*(undefined4 *)(*piVar6 + 4)); operator_delete((void *)*piVar6,0x1c); p_Var3 = *(LPCRITICAL_SECTION *)((int)this + 0x18); *piVar1 = (int)Mutex::vftable; if (p_Var3 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(p_Var3); operator_delete(p_Var3,0x1c); *(undefined4 *)((int)this + 0x18) = 0; } *(byte *)((int)this + 0x14) = *(byte *)((int)this + 0x14) & 0xfe; *piVar1 = (int)MutexBase::vftable; std::map::_Erase_tree(piVar5,*(undefined4 *)(*piVar5 + 4)); operator_delete((void *)*piVar5,0x20); ExceptionList = local_10; return; } //@@ 00a77f70 FUN_00a77f70 void FUN_00a77f70(void) { int iVar1; char cVar2; int *piVar3; int *in_ECX; undefined1 auStackY_dc [128]; int *piVar4; undefined1 local_3c [4]; int *local_38; int *local_30; code *local_2c; int local_24; int *local_20; int *local_18; code *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b140ed; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = in_ECX; (**(code **)(in_ECX[4] + 0xc))(); FUN_00a79720(); local_8 = 0; (**(code **)(in_ECX[4] + 0x10))(); local_14 = *(code **)local_2c; if (local_14 != local_2c) { do { (**(code **)(**(int **)(local_14 + 0x18) + 4))(); std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_14); } while (local_14 != local_2c); } NetworkManager::receive_message(in_ECX,&local_24,0xff,1); while (local_24 != 0) { local_8._0_1_ = 1; local_14 = *(code **)(*in_ECX + 0x18); piVar4 = (int *)0x0; if ((((local_20 != (int *)0x0) && (cVar2 = (**(code **)(*local_20 + 4))(), cVar2 != '\0')) && (piVar4 != (int *)0x0)) && ((cVar2 = (**(code **)(*piVar4 + 0xc))(), cVar2 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStackY_dc + 0x84); } in_ECX = local_18; (*local_14)(); NetworkManager::receive_message(in_ECX,local_3c,0xff,1); local_8._0_1_ = 2; piVar3 = (int *)FUN_008ef1d0(); piVar4 = (int *)piVar3[1]; piVar3[1] = (int)local_20; iVar1 = *piVar3; *piVar3 = local_24; local_8._0_1_ = 3; local_24 = iVar1; local_20 = piVar4; if (((local_30 != (int *)0x0) && (cVar2 = (**(code **)(*local_30 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } local_8._0_1_ = 4; if (((local_38 != (int *)0x0) && (cVar2 = (**(code **)(*local_38 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } } local_8 = CONCAT31(local_8._1_3_,5); if (((local_20 != (int *)0x0) && (cVar2 = (**(code **)(*local_20 + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } std::map::_Erase_tree(); operator_delete(local_2c,0x20); ExceptionList = local_10; return; } //@@ 00a78160 NetConnection::send_message /* DB: ? locks the mutex at ECX+0x24 ("Invalid mutex object specified"), builds a message with id from global counter DAT_00c73678, splits the payload into ceil(len/1092) chunks of <=0x444 bytes each queued with header {id, type param_2, chunk count, index, reliable param_5} (FUN_00a59f30); netplay lobby/menu senders prototype: db/protos.zhl, confirmed by RET 20 */ void * __thiscall NetConnection::send_message (void *this,void *outMessage,int messageType,void *data,uint length,byte isReliable) { undefined4 *puVar1; uint7 uVar2; void *pvVar3; uint uVar4; int *piVar5; int iVar6; uint uVar7; undefined8 local_38; void *local_2c; undefined4 local_28; int *local_24; int local_20; uint local_1c; void *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b14166; local_10 = ExceptionList; ExceptionList = &local_10; piVar5 = (int *)((int)this + 0x24); local_8 = 0; local_28 = 0; local_2c = this; local_24 = piVar5; if (piVar5 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar5 + 0xc))(); } local_8 = 1; local_18 = operator_new(0x20); local_8._0_1_ = 2; if (local_18 != (void *)0x0) { *(undefined4 *)((int)local_18 + 8) = 0; puVar1 = (undefined4 *)((int)local_18 + 8); uVar4 = 0; if (data != (void *)0x0) { uVar4 = length; } *(undefined4 *)((int)local_18 + 0xc) = 0; length = (uint)puVar1; pvVar3 = operator_new(0x1c); *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; *(undefined2 *)((int)pvVar3 + 0xc) = 0x101; *puVar1 = pvVar3; *(undefined4 *)((int)local_18 + 0x10) = 0; *(undefined4 *)((int)local_18 + 0x14) = 0; puVar1 = (undefined4 *)((int)local_18 + 0x18); local_8._0_1_ = 4; *puVar1 = 0; *(undefined4 *)((int)local_18 + 0x1c) = 0; length = (uint)puVar1; pvVar3 = operator_new(0x20); *(void **)pvVar3 = pvVar3; *(void **)((int)pvVar3 + 4) = pvVar3; *(void **)((int)pvVar3 + 8) = pvVar3; *(undefined2 *)((int)pvVar3 + 0xc) = 0x101; *puVar1 = pvVar3; iVar6 = DAT_00c73678; local_8._0_1_ = 5; local_20 = DAT_00c73678; local_38 = (double)((float)((double)(int)uVar4 + __uint_to_double_fixup[-((int)uVar4 >> 0x1f)]) / 1092.0); DAT_00c73678 = DAT_00c73678 + 1; local_38 = ceil(local_38); local_1c = __dtoui3(); length = 0; if (local_1c != 0) { pvVar3 = data; do { local_38._0_7_ = (uint7)(byte)length << 0x30; uVar7 = uVar4; if (0x444 < uVar4) { uVar7 = 0x444; } uVar2 = (uint7)(int7)local_38 >> 0x28; local_38._0_5_ = CONCAT14((undefined1)messageType,iVar6); local_38 = (double)CONCAT17((char)local_1c,CONCAT25((short)uVar2,(undefined5)local_38)); local_38._0_6_ = CONCAT15(isReliable,(undefined5)local_38); FUN_00a59f30(&local_38,pvVar3,uVar7); uVar4 = uVar4 - uVar7; length = length + 1; pvVar3 = (void *)((int)pvVar3 + uVar7); piVar5 = local_24; iVar6 = local_20; } while (length < local_1c); } } local_8 = CONCAT31(local_8._1_3_,1); FUN_00a2a690(); messageType = *(int *)outMessage; local_28 = 1; FUN_00a79480(&messageType); KAGE::SmartPointer::operator_assign(); local_8 = 6; (**(code **)(*piVar5 + 0x10))(); ExceptionList = local_10; return outMessage; } //@@ 00a78370 KAGE::Network::Multiplayer::ConnectionBase::send_message /* DB: ? thiscall, callers multiplayer_send_message and ConnectionBase::Update(0xa588c0); 'Invalid mutex object specified', if reliable and connection_map_contains(peer) stores packet with sequence (+0x28)++ in resend map, then sends chunks via vtable +0x14 */ bool KAGE::Network::Multiplayer::ConnectionBase::send_message (ulonglong *param_1,char param_2,undefined4 *param_3,int *param_4) { int iVar1; int *piVar2; bool bVar3; int *piVar4; byte bVar5; char cVar6; uint uVar7; int *piVar8; int iVar9; int *in_ECX; undefined4 *puVar10; undefined4 uVar11; undefined1 local_44 [4]; int *local_40; undefined4 local_2c; undefined1 local_28; int local_24; int *local_20; int *local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b141b5; local_10 = ExceptionList; uVar7 = __security_cookie ^ (uint)(local_44 + 0x40); ExceptionList = &local_10; local_8 = 0; if ((param_2 != '\0') && (bVar5 = connection_map_contains(in_ECX,param_1), bVar5 != 0)) { local_18 = in_ECX + 4; if (local_18 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*local_18 + 0xc))(0xffffffff); } local_8._0_1_ = 1; piVar8 = (int *)FUN_00a79650(param_1); iVar1 = *piVar8; puVar10 = ¶m_3; uVar11 = 0xa783fb; FUN_008ef1d0(puVar10); local_8._0_1_ = 2; if ((*(int *)(local_24 + 0xc) != 0) && ((*(byte *)(*(int *)(**(int **)(local_24 + 8) + 0x14) + 4) & 1) != 0)) { local_2c = *(undefined4 *)(iVar1 + 0x28); local_28 = 1; FUN_008ef1d0(&local_24); iVar9 = FUN_00a584d0(uVar11,puVar10); local_8 = CONCAT31(local_8._1_3_,3); local_14 = FUN_00a595a0(&local_2c); if (local_14 != iVar9) { SmartPointer::operator_assign(iVar9); uVar11 = *(undefined4 *)(iVar9 + 0xc); *(undefined4 *)(local_14 + 8) = *(undefined4 *)(iVar9 + 8); *(undefined4 *)(local_14 + 0xc) = uVar11; *(undefined1 *)(local_14 + 0x10) = *(undefined1 *)(iVar9 + 0x10); } local_8._0_1_ = 4; if (((local_40 != (int *)0x0) && (cVar6 = (**(code **)(*local_40 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_44); } FUN_00a5a2f0(*(undefined4 *)(iVar1 + 0x28)); *(int *)(iVar1 + 0x28) = *(int *)(iVar1 + 0x28) + 1; } local_8._0_1_ = 5; if (((local_20 != (int *)0x0) && (cVar6 = (**(code **)(*local_20 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_24); } local_8._0_1_ = 6; (**(code **)(in_ECX[4] + 0x10))(); local_8 = (uint)local_8._1_3_ << 8; } bVar3 = true; uVar11 = *(undefined4 *)((int)param_1 + 4); *param_3 = (int)*param_1; param_3[1] = uVar11; piVar8 = *(int **)param_3[2]; puVar10 = param_3; if (piVar8 != (int *)param_3[2]) { do { if (bVar3) { cVar6 = (**(code **)(*in_ECX + 0x14))(puVar10,piVar8[5],piVar8[6],uVar7); puVar10 = param_3; if (cVar6 == '\0') goto LAB_00a7852f; bVar3 = true; } else { LAB_00a7852f: bVar3 = false; } piVar2 = (int *)piVar8[2]; if (*(char *)((int)piVar2 + 0xd) == '\0') { cVar6 = *(char *)(*piVar2 + 0xd); piVar8 = piVar2; piVar2 = (int *)*piVar2; while (cVar6 == '\0') { cVar6 = *(char *)(*piVar2 + 0xd); piVar8 = piVar2; piVar2 = (int *)*piVar2; } } else { cVar6 = *(char *)(piVar8[1] + 0xd); piVar4 = (int *)piVar8[1]; piVar2 = piVar8; while ((piVar8 = piVar4, cVar6 == '\0' && (piVar2 == (int *)piVar8[2]))) { cVar6 = *(char *)(piVar8[1] + 0xd); piVar4 = (int *)piVar8[1]; piVar2 = piVar8; } } } while (piVar8 != (int *)puVar10[2]); } local_8 = 7; if (((param_4 != (int *)0x0) && (cVar6 = (**(code **)(*param_4 + 0xc))(), cVar6 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_3); } ExceptionList = local_10; return bVar3; } //@@ 00a785c0 FUN_00a785c0 bool FUN_00a785c0(char param_1,void *param_2,int *param_3) { int iVar1; bool bVar2; int *piVar3; byte bVar4; char cVar5; int in_ECX; undefined1 auStackY_cc [128]; void *message; void *messageRefCount; int *messageRefCount_00; undefined4 *local_2c; undefined **local_20; void *local_1c; undefined4 *local_18 [2]; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1420e; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (param_2 == (void *)0x0) { bVar2 = false; } else { messageRefCount = (void *)0xffffffff; bVar2 = true; (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(); FUN_00a79720(); local_8 = CONCAT31(local_8._1_3_,1); message = (void *)0xa7862a; (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); local_18[0] = (undefined4 *)*local_2c; piVar3 = param_3; while (param_3 = piVar3, local_18[0] != local_2c) { iVar1 = local_18[0][6]; message = (void *)0x0; messageRefCount_00 = (int *)0x0; local_1c = param_2; if ((piVar3 != (int *)0x0) && (cVar5 = (**(code **)(*piVar3 + 4))(), cVar5 != '\0')) { if ((messageRefCount_00 != (int *)0x0) && ((cVar5 = (**(code **)(*messageRefCount_00 + 0xc))(), cVar5 != '\0' && (g_multiplayerRelease != (void *)0x0)))) { (*g_multiplayerRelease)(auStackY_cc + 0x84); } message = local_1c; messageRefCount_00 = piVar3; } bVar4 = multiplayer_send_message((void *)(iVar1 + 0xc),message,messageRefCount_00); if ((bVar4 == 0) || (!bVar2)) { bVar2 = false; } else { bVar2 = true; } messageRefCount = (void *)0xa786bc; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)local_18); piVar3 = param_3; } if (param_1 != '\0') { local_20 = KAGE::System::UserProfile::vftable; local_8._1_3_ = (undefined3)((uint)local_8 >> 8); local_8 = CONCAT31(local_8._1_3_,2); local_1c = g_userProfile; FUN_008ef1d0(¶m_2); bVar4 = multiplayer_send_message(&local_20,message,messageRefCount); if ((bVar4 == 0) || (bVar2 == false)) { bVar2 = false; } else { bVar2 = true; } } std::map::_Erase_tree(); operator_delete(local_2c,0x20); } local_8 = 3; if (((param_3 != (int *)0x0) && (cVar5 = (**(code **)(*param_3 + 0xc))(), cVar5 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(); } ExceptionList = local_10; return bVar2; } //@@ 00a78770 NetworkManager::receive_message /* DB: ? under the mutex at this+0x38 walks the message list at this+0x30, returns (into param_1) the first message whose channel byte (+5) == param_2, removing it when param_3; HUD::ShowFortuneText calls (out,8,0) peek and (out,8,1) pop on g_multiplayerService prototype: db/protos.zhl, confirmed by RET 12 */ void * __thiscall NetworkManager::receive_message(void *this,void *outMessage,byte channel,byte isRemove) { int *piVar1; uint uVar2; undefined4 *puVar3; int iVar4; bool bVar5; byte *pbVar6; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar7; int *piVar8; undefined1 local_54 [8]; void *local_4c; undefined4 local_48; undefined4 local_44; uint local_40; uint local_3c; uint local_38; uint local_34; void *local_30; undefined4 local_2c; int *local_28; uint local_24; undefined4 local_20; int *local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1425e; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x38); local_8 = 0; local_20 = 0; local_28 = piVar1; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); uVar7 = extraout_ECX; } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_54 + 0x50)); uVar7 = extraout_ECX_00; } local_8 = 1; KAGE::SmartPointer::reset(uVar7); local_20 = 1; local_30 = (void *)0x0; local_2c = 0; local_30 = operator_new(0x20); *(void **)local_30 = local_30; *(void **)((int)local_30 + 4) = local_30; *(void **)((int)local_30 + 8) = local_30; *(undefined2 *)((int)local_30 + 0xc) = 0x101; local_1c = (int *)((int)this + 0x30); local_8 = CONCAT31(local_8._1_3_,2); piVar8 = *(int **)*local_1c; if (piVar8 != (int *)*local_1c) { do { uVar2 = *(uint *)piVar8[2]; local_34 = ((uint *)piVar8[2])[1]; local_38 = uVar2; local_24 = local_34; FUN_00731ee0(local_54,&local_38); if ((((*(char *)((int)local_4c + 0xd) == '\0') && (*(uint *)((int)local_4c + 0x14) <= local_24)) && ((*(uint *)((int)local_4c + 0x14) < local_24 || (*(uint *)((int)local_4c + 0x10) <= uVar2) ))) && (local_4c != local_30)) { local_3c = local_24; local_40 = uVar2; pbVar6 = map_u64_bool_subscript(&local_30,(ulonglong *)&local_40); if (*pbVar6 != 0) goto LAB_00a7887b; bVar5 = false; } else { LAB_00a7887b: bVar5 = true; } puVar3 = (undefined4 *)piVar8[2]; iVar4 = *(int *)(*(int *)puVar3[2] + 0x14); if (*(byte *)(iVar4 + 5) == channel) { if ((puVar3[3] == 0) || (((*(byte *)(iVar4 + 4) & 1) == 0 || (bVar5)))) { KAGE::SmartPointer::operator_assign(piVar8 + 2); if (isRemove != 0) { FUN_00a793c0(&channel,piVar8); } break; } LAB_00a788d1: local_48 = *puVar3; local_44 = puVar3[1]; pbVar6 = map_u64_bool_subscript(&local_30,(ulonglong *)&local_48); *pbVar6 = 0; } else if ((puVar3[3] != 0) && ((*(byte *)(iVar4 + 4) & 1) != 0)) goto LAB_00a788d1; piVar8 = (int *)*piVar8; } while (piVar8 != (int *)*local_1c); } FID_conflict__Erase_tree_>_> (&local_30,(fuzzer_allocator_> *)&local_30, *(_Tree_node **)((int)local_30 + 4)); operator_delete(local_30,0x20); local_8 = 3; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return outMessage; } //@@ 00a78940 FUN_00a78940 void FUN_00a78940(void) { int iVar1; int iVar2; int in_ECX; int local_c; int local_8; (**(code **)(*(int *)(in_ECX + 0x38) + 0xc))(0xffffffff); FUN_00a799d0(); *(undefined4 *)*(undefined4 *)(in_ECX + 0x30) = *(undefined4 *)(in_ECX + 0x30); *(int *)(*(int *)(in_ECX + 0x30) + 4) = *(int *)(in_ECX + 0x30); *(undefined4 *)(in_ECX + 0x34) = 0; (**(code **)(*(int *)(in_ECX + 0x38) + 0x10))(); (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff); local_c = **(int **)(in_ECX + 8); if ((int *)local_c != *(int **)(in_ECX + 8)) { do { iVar1 = *(int *)(local_c + 0x18); iVar2 = *(int *)(iVar1 + 0x2c); FUN_00a59be0(iVar1 + 0x2c,*(undefined4 *)(iVar2 + 4)); *(int *)(iVar2 + 4) = iVar2; *(int *)iVar2 = iVar2; *(int *)(iVar2 + 8) = iVar2; *(undefined4 *)(iVar1 + 0x30) = 0; local_8 = **(int **)(iVar1 + 0x38); if ((int *)local_8 != *(int **)(iVar1 + 0x38)) { do { *(undefined1 *)(local_8 + 0x28) = 1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_8); } while (local_8 != *(int *)(iVar1 + 0x38)); } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)&local_c); } while (local_c != *(int *)(in_ECX + 8)); } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); return; } //@@ 00a78a10 NetworkManager::receive_packet /* DB: ? called by ServiceSteam slot 2 (00a75280) right after ISteamNetworking::ReadP2PPacket (+8) and by ServiceEOS slot 2 (00a76180): (sender u64, buffer, size); finds the peer in the map +8 under mutex +0x10, creates a connection for unknown senders, else consolidates the packet (FUN_00a58cb0 "ackn") and appends messages to list +0x30 under mutex +0x38 (the list NetworkManager::receive_message 00a78770 NetworkManager::receive_message prototype: db/protos.zhl, confirmed by RET 12 */ void __thiscall NetworkManager::receive_packet(void *this,ulonglong *sender,void *buffer,int size) { int iVar1; undefined4 *puVar2; char cVar3; int *piVar4; void *pvVar5; undefined4 uVar6; int *piVar7; undefined4 extraout_ECX; undefined4 extraout_ECX_00; int *piVar8; undefined1 local_40 [4]; undefined1 local_3c [4]; int *local_38; undefined1 local_34 [4]; int *local_30; int local_2c; int *local_28; int local_24; int *local_20; int *local_1c; int *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b142ee; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = (int *)0x0; (**(code **)(*(int *)((int)this + 0x10) + 0xc)) (0xffffffff,__security_cookie ^ (uint)(local_34 + 0x30)); FUN_00731ee0(local_40,sender); if (*(char *)((int)local_38 + 0xd) == '\0') { if (((uint)local_38[5] <= *(uint *)((int)sender + 4)) && ((piVar8 = local_38, (uint)local_38[5] < *(uint *)((int)sender + 4) || ((uint)local_38[4] <= (uint)*sender)))) goto LAB_00a78a78; } piVar8 = *(int **)((int)this + 8); LAB_00a78a78: KAGE::SmartPointer::SmartPointer(extraout_ECX); local_8 = 0; if (piVar8 != *(int **)((int)this + 8)) { piVar4 = (int *)FUN_00a79360(piVar8 + 6); piVar8 = (int *)piVar4[1]; piVar4[1] = (int)local_28; iVar1 = *piVar4; *piVar4 = local_2c; local_8._0_1_ = 1; local_2c = iVar1; local_28 = piVar8; if (((local_30 != (int *)0x0) && (cVar3 = (**(code **)(*local_30 + 0xc))(), cVar3 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(local_34); } local_8 = (uint)local_8._1_3_ << 8; } (**(code **)(*(int *)((int)this + 0x10) + 0x10))(); if (local_2c == 0) { if ((*(byte *)((int)buffer + 4) & 1) == 0) { (**(code **)(*(int *)((int)this + 0x38) + 0xc))(0xffffffff); pvVar5 = operator_new(0x20); local_8._0_1_ = 2; if (pvVar5 == (void *)0x0) { uVar6 = 0; } else { uVar6 = FUN_00a59d50(buffer,size,sender); } local_8 = (uint)local_8._1_3_ << 8; FUN_00a2a690(uVar6); local_8._0_1_ = 3; FUN_00a2a510(&local_1c); local_8._0_1_ = 4; if (((local_18 != (int *)0x0) && (cVar3 = (**(code **)(*local_18 + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_1c); } local_8 = (uint)local_8._1_3_ << 8; (**(code **)(*(int *)((int)this + 0x38) + 0x10))(); } } else { KAGE::Network::Connection::send_message(&local_24,buffer,size); local_8._0_1_ = 5; if (local_24 != 0) { piVar8 = (int *)((int)this + 0x38); (**(code **)(*(int *)((int)this + 0x38) + 0xc))(0xffffffff); FUN_00a2a510(&local_24); (**(code **)(*piVar8 + 0x10))(); if ((*(int *)(local_24 + 0xc) == 0) || ((*(byte *)(*(int *)(**(int **)(local_24 + 8) + 0x14) + 4) & 1) == 0)) { uVar6 = KAGE::SmartPointer::reset(extraout_ECX_00); local_8 = 7; local_18 = (int *)0x2; } else { uVar6 = FUN_00a590c0(local_3c); local_8 = CONCAT31(local_8._1_3_,6); local_18 = (int *)0x1; } KAGE::SmartPointer::operator_assign(uVar6); if (((uint)local_18 & 2) != 0) { local_18 = (int *)((uint)local_18 & 0xfffffffd); local_8 = 8; if (((local_30 != (int *)0x0) && (cVar3 = (**(code **)(*local_30 + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_34); } } local_8._1_3_ = 0; if (((uint)local_18 & 1) != 0) { local_8 = 9; if (((local_38 != (int *)0x0) && (cVar3 = (**(code **)(*local_38 + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_3c); } } if (local_24 != 0) { do { local_8._0_1_ = 5; (**(code **)(*piVar8 + 0xc))(0xffffffff); iVar1 = *(int *)((int)this + 0x30); if (*(int *)((int)this + 0x34) == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8._0_1_ = 10; local_18 = (int *)0x0; local_1c = (int *)((int)this + 0x30); piVar4 = operator_new(0x10); local_18 = piVar4; FUN_008ef1d0(&local_24); local_8._0_1_ = 5; *(int *)((int)this + 0x34) = *(int *)((int)this + 0x34) + 1; local_18 = (int *)0x0; puVar2 = *(undefined4 **)(iVar1 + 4); *piVar4 = iVar1; piVar4[1] = (int)puVar2; *(int **)(iVar1 + 4) = piVar4; *puVar2 = piVar4; (**(code **)(*piVar8 + 0x10))(); uVar6 = FUN_00a590c0(local_34); local_8._0_1_ = 0xc; piVar7 = (int *)FUN_008ef1d0(uVar6); piVar4 = (int *)piVar7[1]; piVar7[1] = (int)local_20; iVar1 = *piVar7; *piVar7 = local_24; local_8._0_1_ = 0xd; local_24 = iVar1; local_20 = piVar4; if (((local_38 != (int *)0x0) && (cVar3 = (**(code **)(*local_38 + 0xc))(), cVar3 != '\0') ) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_3c); } local_8._0_1_ = 0xe; if (((local_30 != (int *)0x0) && (cVar3 = (**(code **)(*local_30 + 0xc))(), cVar3 != '\0') ) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(local_34); } local_8._0_1_ = 5; } while (local_24 != 0); FUN_00a59200(); } } local_8 = CONCAT31(local_8._1_3_,0xf); if (((local_20 != (int *)0x0) && (cVar3 = (**(code **)(*local_20 + 0xc))(), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(&local_24); } } local_8 = 0x10; if (((local_28 != (int *)0x0) && (cVar3 = (**(code **)(*local_28 + 0xc))(), cVar3 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(&local_2c); } ExceptionList = local_10; return; } //@@ 00a78e10 netplay_lobby_handle_join_message /* DB: ? consolidated-message check ("This function should only be called on consolidated messages"), tag "join": looks up the lobby by id (ConstLobby 00a282c0) and queues a type-5 lobby event with its id; netplay_lobby_host_handle_message non-"lhwm" path */ undefined1 netplay_lobby_handle_join_message(ulonglong *param_1,int *param_2) { code *pcVar1; ulonglong *puVar2; char cVar3; byte bVar4; undefined1 uVar5; uint uVar6; int iVar7; undefined4 uVar8; void *in_ECX; void *ptr; undefined4 local_44; void *local_40; undefined4 *puStack_3c; undefined4 *puStack_38; undefined4 uStack_34; undefined4 local_30; undefined **local_2c; undefined4 local_28; int *local_24; int *local_20; int *local_1c; undefined8 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puVar2 = param_1; puStack_c = &LAB_00b14335; local_10 = ExceptionList; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; if (*(int *)((int)param_1 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } iVar7 = strncmp((char *)(*(int *)(**(int **)(puVar2 + 1) + 0x14) + 8),"join",4); puVar2 = param_1; if (iVar7 == 0) { if (*(int *)((int)param_1 + 0xc) != 1) { KAGE_LogMessage(0x10,(byte *)"This function should only be called on consolidated messages"); } if (*(int *)(*(int *)(**(int **)(puVar2 + 1) + 0x14) + 0x18) == 0) { local_18 = *(ulonglong *)(*(int *)(**(int **)(puVar2 + 1) + 0x14) + 0x10); iVar7 = KAGE::Network::Multiplayer::ConstLobby::ConstLobby(&local_18); local_44 = 5; local_40 = (void *)0x0; puStack_3c = (undefined4 *)0x0; puStack_38 = (undefined4 *)0x0; uStack_34 = 0; local_30 = 0; local_8 = CONCAT31(local_8._1_3_,2); local_18 = 1; std::vector<8byte>::_Emplace_reallocate(0,&local_18); iVar7 = *(int *)(iVar7 + 4); if (iVar7 == 0) { local_18._4_4_ = 0; local_18._0_4_ = 0; } else { local_18._0_4_ = *(undefined4 *)(iVar7 + 8); local_18._4_4_ = *(undefined4 *)(iVar7 + 0xc); } if (puStack_3c == puStack_38) { std::vector<8byte>::_Emplace_reallocate(puStack_3c,&local_18); } else { *puStack_3c = (undefined4)local_18; puStack_3c[1] = local_18._4_4_; puStack_3c = puStack_3c + 2; } CommandThread::post_command(&DAT_00c79a60,&local_44); local_8._0_1_ = 1; if (local_40 != (void *)0x0) { uVar6 = ((int)puStack_38 - (int)local_40 >> 3) * 8; ptr = local_40; if (0xfff < uVar6) { ptr = *(void **)((int)local_40 + -4); uVar6 = uVar6 + 0x23; if (0x1f < (uint)((int)local_40 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar6); } local_2c = KAGE::Network::Multiplayer::ConstLobby::vftable; local_8 = CONCAT31(local_8._1_3_,3); if (local_24 != (int *)0x0) { cVar3 = (**(code **)(*local_24 + 0xc))(); if ((cVar3 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_28); } } } uVar5 = 1; } else { local_18 = *param_1; bVar4 = connection_map_contains(in_ECX,&local_18); if (bVar4 == 0) { uVar5 = 0; } else { (**(code **)(*(int *)((int)in_ECX + 0x10) + 0xc))(0xffffffff,uVar6); local_28 = (undefined4)*param_1; local_24 = *(int **)((int)param_1 + 4); uVar8 = FUN_00a79650(&local_28); FUN_00a79360(uVar8); local_8._0_1_ = 4; (**(code **)(*(int *)((int)in_ECX + 0x10) + 0x10))(); pcVar1 = *(code **)(*local_20 + 0x10); FUN_008ef1d0(¶m_1); uVar5 = (*pcVar1)(); local_8 = CONCAT31(local_8._1_3_,5); if (local_1c != (int *)0x0) { cVar3 = (**(code **)(*local_1c + 0xc))(); if ((cVar3 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(&local_20); } } } } local_8 = 6; if (param_2 != (int *)0x0) { cVar3 = (**(code **)(*param_2 + 0xc))(); if ((cVar3 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(¶m_1); } } ExceptionList = local_10; return uVar5; } //@@ 00a790b0 NetworkManager::get_peer /* DB: ? under the mutex at this+0x10 looks a 64-bit user id up in the map (FUN_00731ee0, head this+8) and returns a shared_ptr copy of the peer (FUN_00a79360) or an empty one; NetplayManager::try_advance_frame, NetplayManager::send_message prototype: db/protos.zhl, confirmed by RET 8 */ void * __thiscall NetworkManager::get_peer(void *this,void *outPeer,ulonglong *userId) { int *piVar1; undefined1 local_20 [8]; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1436d; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x10); local_14 = piVar1; if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_20 + 0x1c)); } local_8 = 0; FUN_00731ee0(local_20,userId); if (*(char *)(local_18 + 0xd) == '\0') { if ((*(uint *)(local_18 + 0x14) <= *(uint *)((int)userId + 4)) && ((*(uint *)(local_18 + 0x14) < *(uint *)((int)userId + 4) || (*(uint *)(local_18 + 0x10) <= (uint)*userId)))) goto LAB_00a79132; } local_18 = *(int *)((int)this + 8); LAB_00a79132: if (local_18 == *(int *)((int)this + 8)) { KAGE::SmartPointer::SmartPointer(local_18); local_8 = 2; } else { FUN_00a79360(local_18 + 0x18); local_8 = 1; } (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return outPeer; } //@@ 00a79180 FUN_00a79180 void FUN_00a79180(void) { int iVar1; int in_ECX; (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff); iVar1 = *(int *)(in_ECX + 8); std::map::_Erase_tree((int *)(in_ECX + 8),*(undefined4 *)(iVar1 + 4)); *(int *)(iVar1 + 4) = iVar1; *(int *)iVar1 = iVar1; *(int *)(iVar1 + 8) = iVar1; *(undefined4 *)(in_ECX + 0xc) = 0; (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); FUN_00a78940(); return; } //@@ 00a791d0 connection_map_contains /* DB: ? thiscall (uint64 id*): locks the mutex at +0x10 ("Invalid mutex object specified"), lower_bound in the 64-bit keyed map (head +8), unlocks, returns found; NetConnection send paths, Multiplayer::handle_member_status prototype: db/protos.zhl, confirmed by RET 4 */ byte __thiscall connection_map_contains(void *this,ulonglong *id) { int *piVar1; int iVar2; int iVar3; undefined1 local_1c [8]; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)((int)this + 0x10); if (piVar1 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_1c + 0x18)); } FUN_00731ee0(local_1c,id); if (*(char *)(local_14 + 0xd) == '\0') { if ((*(uint *)(local_14 + 0x14) <= *(uint *)((int)id + 4)) && ((*(uint *)(local_14 + 0x14) < *(uint *)((int)id + 4) || (*(uint *)(local_14 + 0x10) <= (uint)*id)))) { iVar2 = *(int *)((int)this + 8); iVar3 = local_14; goto LAB_00a7924f; } } iVar2 = *(int *)((int)this + 8); iVar3 = iVar2; LAB_00a7924f: local_8 = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return iVar3 != iVar2; } //@@ 00a79280 FUN_00a79280 void FUN_00a79280(int *param_1) { short sVar1; int iVar2; code *pcVar3; int *piVar4; int *piVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar4 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; ExceptionList = &local_10; if ((*param_1 != 0) && (iVar2 = param_1[1], iVar2 != 0)) { (**(code **)(*(int *)(iVar2 + 8) + 0xc)) (0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); sVar1 = *(short *)(iVar2 + 4); (**(code **)(*(int *)(iVar2 + 8) + 0x10))(); if (sVar1 == 1) { pcVar3 = *(code **)(*piVar4 + 0x10); if (pcVar3 != (code *)0x0) { FUN_008ef1d0(piVar4); (*pcVar3)(); } piVar5 = (int *)((int)g_multiplayerService + 0x24); if (piVar5 == (int *)0x0) { KAGE_LogMessage(0x10,(byte *)"Invalid mutex object specified"); } else { (**(code **)(*piVar5 + 0xc))(0xffffffff); } param_1 = (int *)*piVar4; FUN_00a794a0(¶m_1); local_8 = 0; (**(code **)(*piVar5 + 0x10))(); } } ExceptionList = local_10; return; } //@@ 00a79360 FUN_00a79360 void FUN_00a79360(undefined4 *param_1) { int *piVar1; undefined4 uVar2; char cVar3; undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; piVar1 = (int *)param_1[1]; uVar2 = *param_1; if (piVar1 != (int *)0x0) { cVar3 = (**(code **)(*piVar1 + 4))(); if (cVar3 != '\0') { if ((int *)in_ECX[1] != (int *)0x0) { cVar3 = (**(code **)(*(int *)in_ECX[1] + 0xc))(); if ((cVar3 != '\0') && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(); } } in_ECX[1] = piVar1; *in_ECX = uVar2; } } return; } //@@ 00a793c0 FUN_00a793c0 void FUN_00a793c0(int *param_1,int *param_2) { int iVar1; char cVar2; uint uVar3; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af1360; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; iVar1 = *param_2; *(int *)param_2[1] = iVar1; *(int *)(*param_2 + 4) = param_2[1]; *(int *)(in_ECX + 4) = *(int *)(in_ECX + 4) + -1; local_8 = 0; if ((int *)param_2[3] != (int *)0x0) { cVar2 = (**(code **)(*(int *)param_2[3] + 0xc))(uVar3); if ((cVar2 != '\0') && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(param_2 + 2); } } operator_delete(param_2,0x10); *param_1 = iVar1; ExceptionList = local_10; return; } //@@ 00a79460 FUN_00a79460 void FUN_00a79460(void) { undefined4 *in_ECX; FUN_00a799d0(); operator_delete((void *)*in_ECX,0x10); return; } //@@ 00a79480 FUN_00a79480 int FUN_00a79480(undefined4 param_1) { int *piVar1; undefined1 local_10 [12]; piVar1 = (int *)std::map::try_emplace(local_10,param_1); return *piVar1 + 0x14; } //@@ 00a794a0 FUN_00a794a0 int FUN_00a794a0(uint *param_1) { int *piVar1; char cVar2; int *piVar3; int *piVar4; void *ptr; undefined4 *in_ECX; int *piVar5; int iVar6; int *piVar7; int *piVar8; int local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)*in_ECX; piVar4 = (int *)piVar1[1]; piVar7 = piVar1; piVar8 = piVar1; if (*(char *)((int)piVar4 + 0xd) == '\0') { piVar3 = piVar4; do { if ((uint)piVar3[4] < *param_1) { piVar5 = (int *)piVar3[2]; } else { if ((*(char *)((int)piVar8 + 0xd) != '\0') && (*param_1 < (uint)piVar3[4])) { piVar8 = piVar3; } piVar5 = (int *)*piVar3; piVar7 = piVar3; } piVar3 = piVar5; } while (*(char *)((int)piVar5 + 0xd) == '\0'); } if (*(char *)((int)piVar8 + 0xd) == '\0') { piVar4 = (int *)*piVar8; } if (*(char *)((int)piVar4 + 0xd) == '\0') { do { if (*param_1 < (uint)piVar4[4]) { piVar3 = (int *)*piVar4; piVar8 = piVar4; } else { piVar3 = (int *)piVar4[2]; } piVar4 = piVar3; } while (*(char *)((int)piVar3 + 0xd) == '\0'); } iVar6 = 0; local_1c = 0; piVar4 = piVar7; if (piVar7 != piVar8) { do { piVar3 = (int *)piVar4[2]; iVar6 = iVar6 + 1; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar2 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; while (cVar2 == '\0') { cVar2 = *(char *)(*piVar3 + 0xd); piVar4 = piVar3; piVar3 = (int *)*piVar3; } } else { cVar2 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; while ((piVar4 = piVar5, cVar2 == '\0' && (piVar3 == (int *)piVar4[2]))) { cVar2 = *(char *)(piVar4[1] + 0xd); piVar5 = (int *)piVar4[1]; piVar3 = piVar4; } } } while (piVar4 != piVar8); local_1c = iVar6; } param_1 = (uint *)piVar7; if ((piVar7 == (int *)*piVar1) && (*(char *)((int)piVar8 + 0xd) != '\0')) { FUN_00a79d10(in_ECX,piVar1[1]); piVar1[1] = (int)piVar1; *piVar1 = (int)piVar1; piVar1[2] = (int)piVar1; in_ECX[1] = 0; } else if (piVar7 != piVar8) { do { piVar1 = (int *)param_1; std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = std_tree_extract(in_ECX,piVar1); local_8 = 0; if (((*(int **)((int)ptr + 0x18) != (int *)0x0) && (cVar2 = (**(code **)(**(int **)((int)ptr + 0x18) + 0xc))(), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)((int)ptr + 0x14); } local_8 = 0xffffffff; operator_delete(ptr,0x1c); } while (param_1 != (uint *)piVar8); ExceptionList = local_10; return local_1c; } ExceptionList = local_10; return local_1c; } //@@ 00a79650 FUN_00a79650 int FUN_00a79650(uint *param_1) { undefined4 uVar1; uint uVar2; undefined4 *newNode; undefined4 *in_ECX; void *local_24; int local_20; void *local_1c; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1439d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; FUN_00731ee0(&local_24,param_1); if (*(char *)((int)local_1c + 0xd) == '\0') { if ((*(uint *)((int)local_1c + 0x14) <= param_1[1]) && ((*(uint *)((int)local_1c + 0x14) < param_1[1] || (*(uint *)((int)local_1c + 0x10) <= *param_1)))) goto LAB_00a79700; } if (in_ECX[1] == 0x7ffffff) { /* WARNING: Subroutine does not return */ FUN_004170d0(uVar2); } uVar1 = *in_ECX; local_8 = 0; local_14 = 0; newNode = operator_new(0x20); uVar2 = *param_1; newNode[5] = param_1[1]; newNode[4] = uVar2; newNode[6] = 0; newNode[7] = 0; *newNode = uVar1; newNode[1] = uVar1; newNode[2] = uVar1; *(undefined2 *)(newNode + 3) = 0; local_1c = std::_Tree::_Insert_node(in_ECX,local_24,local_20,newNode); LAB_00a79700: ExceptionList = local_10; return (int)local_1c + 0x18; } //@@ 00a79720 FUN_00a79720 void FUN_00a79720(int *param_1) { char cVar1; int *piVar2; int *piVar3; int iVar4; int iVar5; int *piVar6; void *pvVar7; undefined4 uVar8; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b143cd; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = 0; in_ECX[1] = 0; pvVar7 = operator_new(0x20); *(void **)pvVar7 = pvVar7; *(void **)((int)pvVar7 + 4) = pvVar7; *(void **)((int)pvVar7 + 8) = pvVar7; *(undefined2 *)((int)pvVar7 + 0xc) = 0x101; *in_ECX = (int)pvVar7; local_8 = 0; uVar8 = FUN_00a79df0(*(undefined4 *)(*param_1 + 4),pvVar7,param_1); *(undefined4 *)(*in_ECX + 4) = uVar8; piVar2 = (int *)*in_ECX; in_ECX[1] = param_1[1]; piVar3 = (int *)piVar2[1]; if (*(char *)((int)piVar3 + 0xd) == '\0') { cVar1 = *(char *)(*piVar3 + 0xd); piVar6 = (int *)*piVar3; while (cVar1 == '\0') { cVar1 = *(char *)(*piVar6 + 0xd); piVar3 = piVar6; piVar6 = (int *)*piVar6; } *piVar2 = (int)piVar3; iVar4 = *(int *)(*in_ECX + 4); iVar5 = *(int *)(iVar4 + 8); cVar1 = *(char *)(iVar5 + 0xd); while (cVar1 == '\0') { cVar1 = *(char *)(*(int *)(iVar5 + 8) + 0xd); iVar4 = iVar5; iVar5 = *(int *)(iVar5 + 8); } *(int *)(*in_ECX + 8) = iVar4; } else { *piVar2 = (int)piVar2; *(int *)(*in_ECX + 8) = *in_ECX; } ExceptionList = local_10; return; } //@@ 00a79800 std::map::erase /* DB: erase(key): equal_range on the 64-bit key (+0x10/+0x14), counts, clears the whole tree via std::map::_Erase_tree when the range is everything, else _Extract + release ConnectionPtr (g_connectionReleaseFn) + delete 0x20 node; returns count; caller Multiplayer::handle_member_status */ int std::map::erase(uint *param_1) { int *piVar1; uint uVar2; char cVar3; int *piVar4; int *piVar5; void *ptr; undefined4 *in_ECX; int *piVar6; int iVar7; int *piVar8; int *piVar9; int local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af5df0; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)*in_ECX; piVar5 = (int *)piVar1[1]; piVar4 = piVar5; piVar8 = piVar1; piVar9 = piVar1; if (*(char *)((int)piVar5 + 0xd) == '\0') { do { uVar2 = piVar4[5]; if ((param_1[1] < uVar2) || ((param_1[1] <= uVar2 && (*param_1 <= (uint)piVar4[4])))) { if (*(char *)((int)piVar9 + 0xd) != '\0') { if ((param_1[1] <= uVar2) && ((param_1[1] < uVar2 || (*param_1 < (uint)piVar4[4])))) { piVar9 = piVar4; } } piVar6 = (int *)*piVar4; piVar8 = piVar4; } else { piVar6 = (int *)piVar4[2]; } piVar4 = piVar6; } while (*(char *)((int)piVar6 + 0xd) == '\0'); } if (*(char *)((int)piVar9 + 0xd) == '\0') { piVar5 = (int *)*piVar9; } if (*(char *)((int)piVar5 + 0xd) == '\0') { do { if (((uint)piVar5[5] < param_1[1]) || (((uint)piVar5[5] <= param_1[1] && ((uint)piVar5[4] <= *param_1)))) { piVar4 = (int *)piVar5[2]; } else { piVar4 = (int *)*piVar5; piVar9 = piVar5; } piVar5 = piVar4; } while (*(char *)((int)piVar4 + 0xd) == '\0'); } iVar7 = 0; local_1c = 0; piVar5 = piVar8; if (piVar8 != piVar9) { do { piVar4 = (int *)piVar5[2]; iVar7 = iVar7 + 1; if (*(char *)((int)piVar4 + 0xd) == '\0') { cVar3 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; while (cVar3 == '\0') { cVar3 = *(char *)(*piVar4 + 0xd); piVar5 = piVar4; piVar4 = (int *)*piVar4; } } else { cVar3 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; while ((piVar5 = piVar6, cVar3 == '\0' && (piVar4 == (int *)piVar5[2]))) { cVar3 = *(char *)(piVar5[1] + 0xd); piVar6 = (int *)piVar5[1]; piVar4 = piVar5; } } } while (piVar5 != piVar9); local_1c = iVar7; } param_1 = (uint *)piVar8; if ((piVar8 == (int *)*piVar1) && (*(char *)((int)piVar9 + 0xd) != '\0')) { _Erase_tree(in_ECX,piVar1[1]); piVar1[1] = (int)piVar1; *piVar1 = (int)piVar1; piVar1[2] = (int)piVar1; in_ECX[1] = 0; } else if (piVar8 != piVar9) { do { piVar1 = (int *)param_1; _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); ptr = _Tree::_Extract(in_ECX,piVar1); local_8 = 0; if (((*(int **)((int)ptr + 0x1c) != (int *)0x0) && (cVar3 = (**(code **)(**(int **)((int)ptr + 0x1c) + 0xc))(), cVar3 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)((int)ptr + 0x18); } local_8 = 0xffffffff; operator_delete(ptr,0x20); } while (param_1 != (uint *)piVar9); ExceptionList = local_10; return local_1c; } ExceptionList = local_10; return local_1c; } //@@ 00a799d0 FUN_00a799d0 void FUN_00a799d0(void) { undefined4 *puVar1; undefined4 *ptr; char cVar2; uint uVar3; undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; puStack_c = &LAB_00af1360; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)in_EDX[1] = 0; ptr = (undefined4 *)*in_EDX; while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; local_8 = 0; if ((((int *)ptr[3] != (int *)0x0) && (cVar2 = (**(code **)(*(int *)ptr[3] + 0xc))(uVar3), cVar2 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(ptr + 2); } local_8 = 0xffffffff; operator_delete(ptr,0x10); ptr = puVar1; } ExceptionList = local_10; return; } //@@ 00a79a60 std::map::try_emplace /* DB: MSVC _Tree lower-bound on uint key (node+0x10), returns existing node or allocates 0x1c node (key + 8 zeroed bytes), max_size 0x9249249 check, insert+rebalance; caller FUN_00a79480 (NetConnection send path) */ void std::map::try_emplace(undefined4 *param_1,uint *param_2) { char cVar1; int *piVar2; undefined4 *puVar3; int *piVar4; undefined4 *puVar5; undefined4 *in_ECX; undefined4 *puVar6; int *piVar7; undefined4 *puVar8; bool bVar9; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b143fd; local_10 = ExceptionList; piVar2 = (int *)*in_ECX; bVar9 = false; local_14 = (int *)piVar2[1]; piVar7 = piVar2; if (*(char *)((int)local_14 + 0xd) == '\0') { piVar4 = local_14; do { local_14 = piVar4; bVar9 = *param_2 <= (uint)local_14[4]; if (bVar9) { piVar4 = (int *)*local_14; piVar7 = local_14; } else { piVar4 = (int *)local_14[2]; } } while (*(char *)((int)piVar4 + 0xd) == '\0'); } if ((*(char *)((int)piVar7 + 0xd) == '\0') && ((uint)piVar7[4] <= *param_2)) { *param_1 = piVar7; *(undefined1 *)(param_1 + 1) = 0; return; } ExceptionList = &local_10; if (in_ECX[1] == 0x9249249) { /* WARNING: Subroutine does not return */ FUN_004170d0(__security_cookie ^ (int)register0x00000010 - 4U); } local_8 = 0; puVar5 = operator_new(0x1c); puVar5[4] = *param_2; puVar5[5] = 0; puVar5[6] = 0; *puVar5 = piVar2; puVar5[1] = piVar2; puVar5[2] = piVar2; *(undefined2 *)(puVar5 + 3) = 0; piVar2 = (int *)*in_ECX; in_ECX[1] = in_ECX[1] + 1; puVar5[1] = local_14; if (local_14 == piVar2) { *piVar2 = (int)puVar5; piVar2[1] = (int)puVar5; piVar2[2] = (int)puVar5; *(undefined1 *)(puVar5 + 3) = 1; } else { if (bVar9) { *local_14 = (int)puVar5; if (local_14 == (int *)*piVar2) { *piVar2 = (int)puVar5; } } else { local_14[2] = (int)puVar5; if (local_14 == (int *)piVar2[2]) { piVar2[2] = (int)puVar5; } } cVar1 = *(char *)(puVar5[1] + 0xc); puVar8 = puVar5; while (cVar1 == '\0') { puVar3 = (undefined4 *)puVar8[1]; puVar6 = *(undefined4 **)puVar3[1]; if (puVar3 == puVar6) { puVar6 = (undefined4 *)((undefined4 *)puVar3[1])[2]; if (*(char *)(puVar6 + 3) == '\0') goto LAB_00a79bda; if (puVar8 == (undefined4 *)puVar3[2]) { FUN_00415fe0(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415f80(*(undefined4 *)(puVar8[1] + 4)); } else if (*(char *)(puVar6 + 3) == '\0') { LAB_00a79bda: *(undefined1 *)(puVar3 + 3) = 1; *(undefined1 *)(puVar6 + 3) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; puVar8 = *(undefined4 **)(puVar8[1] + 4); } else { if (puVar8 == (undefined4 *)*puVar3) { FUN_00415f80(puVar3); puVar8 = puVar3; } *(undefined1 *)(puVar8[1] + 0xc) = 1; *(undefined1 *)(*(int *)(puVar8[1] + 4) + 0xc) = 0; FUN_00415fe0(*(undefined4 *)(puVar8[1] + 4)); } cVar1 = *(char *)(puVar8[1] + 0xc); } *(undefined1 *)(piVar2[1] + 0xc) = 1; } *param_1 = puVar5; *(undefined1 *)(param_1 + 1) = 1; ExceptionList = local_10; return; } //@@ 00a79c60 std::map::_Erase_tree /* DB: recursive _Erase of 0x20-byte nodes whose value SmartPointer (+0x18/+0x1c) is released through the ConnectionBase release fn g_connectionReleaseFn (same as KAGE::SmartPointer); NetworkManager code */ void std::map::_Erase_tree(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { _Erase_tree(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[7] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[7] + 0xc))(uVar4), cVar3 != '\0')) && (g_connectionReleaseFn != (void *)0x0)) { (*g_connectionReleaseFn)(param_2 + 6); } local_8 = 0xffffffff; operator_delete(param_2,0x20); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 00a79d10 FUN_00a79d10 void FUN_00a79d10(undefined4 param_1,int *param_2) { int *piVar1; void **ppvVar2; char cVar3; uint uVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af1380; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; cVar3 = *(char *)((int)param_2 + 0xd); ppvVar2 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar2, cVar3 == '\0') { FUN_00a79d10(param_1,param_2[2]); piVar1 = (int *)*param_2; local_8 = 0; if ((((int *)param_2[6] != (int *)0x0) && (cVar3 = (**(code **)(*(int *)param_2[6] + 0xc))(uVar4), cVar3 != '\0')) && (g_multiplayerRelease != (void *)0x0)) { (*g_multiplayerRelease)(param_2 + 5); } local_8 = 0xffffffff; operator_delete(param_2,0x1c); ppvVar2 = ExceptionList; param_2 = piVar1; cVar3 = *(char *)((int)piVar1 + 0xd); } ExceptionList = local_10; return; } //@@ 00a79dc0 FUN_00a79dc0 void FUN_00a79dc0(void) { int *piVar1; undefined4 *in_ECX; piVar1 = (int *)in_ECX[1]; if (piVar1 != (int *)0x0) { std::map::_Erase_tree(*in_ECX,*(undefined4 *)(*piVar1 + 4)); operator_delete((void *)*piVar1,0x20); } return; } //@@ 00a79df0 FUN_00a79df0 int * FUN_00a79df0(undefined4 *param_1,int param_2,undefined4 param_3) { int *piVar1; int iVar2; int *piVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1442d; local_10 = ExceptionList; ExceptionList = &local_10; piVar3 = (int *)*in_ECX; if (*(char *)((int)param_1 + 0xd) == '\0') { local_8 = 0; piVar1 = operator_new(0x20); iVar2 = param_1[5]; piVar1[4] = param_1[4]; piVar1[5] = iVar2; FUN_00a79360(param_1 + 6); *piVar1 = (int)piVar3; piVar1[2] = (int)piVar3; *(undefined2 *)(piVar1 + 3) = 0; piVar1[1] = param_2; *(undefined1 *)(piVar1 + 3) = *(undefined1 *)(param_1 + 3); local_8 = 1; if (*(char *)((int)piVar3 + 0xd) != '\0') { piVar3 = piVar1; } iVar2 = FUN_00a79df0(*param_1,piVar1,param_3); *piVar1 = iVar2; iVar2 = FUN_00a79df0(param_1[2],piVar1,param_3); piVar1[2] = iVar2; } ExceptionList = local_10; return piVar3; } //@@ 00a79ecf Catch_All@00a79ecf void Catch_All_00a79ecf(void) { undefined4 uVar1; int unaff_EBP; undefined4 uVar2; uVar2 = *(undefined4 *)(unaff_EBP + 8); uVar1 = Config::GetCollectibles(uVar2); std::map::_Erase_tree(uVar1,uVar2); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)0x0,(ThrowInfo *)0x0); } //@@ 00a79ef0 FUN_00a79ef0 int FUN_00a79ef0(void) { uint uVar1; uint uVar2; int iVar3; uint in_ECX; uint in_EDX; if ((in_ECX != 0) && (in_EDX != 0)) { uVar1 = in_ECX & 0xffff | (in_ECX >> 0x10) % in_EDX << 0x10; uVar2 = uVar1 / in_EDX; if (((in_ECX >> 0x10) / in_EDX == 0) && (uVar2 < 0x10000)) { iVar3 = (uVar1 % in_EDX << 0x10) / in_EDX + uVar2 * 0x10000; if (iVar3 == 0) { iVar3 = 1; } return iVar3; } } return -1; } //@@ 00a79f40 FUN_00a79f40 undefined4 FUN_00a79f40(void) { int iVar1; uint uVar2; uint uVar3; uint uVar4; int *in_ECX; iVar1 = FUN_00a79ef0(); in_ECX[7] = iVar1; uVar2 = FUN_00a79ef0(); uVar3 = FUN_00a79ef0(); if (0xfffffff < uVar2) { return 0; } uVar4 = uVar2 * 3 + 0xffff >> 0x10; in_ECX[1] = uVar4; uVar4 = uVar4 * 0x10000 + uVar2 * -3; *in_ECX = uVar2 * 3; in_ECX[2] = uVar4; if (0xffff < uVar4) { _wassert(L"configuration->stretched_kernel_radius_delta < CLOWNRESAMPLER_TO_FIXED_POINT_FROM_INTEGER(1)" ,L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\clownresampler.h", 0x445); } in_ECX[3] = (uVar3 & 0x3fffff) >> 6; return 1; } //@@ 00a79ff0 ClownResampler_LowLevel_Resample /* DB: clownresampler.h asserts 'kernel_index < CLOWNRESAMPLER_COUNT_OF(precomputed->lanczos_kernel_table)', 'min_relative/max_relative <= configuration->integer_stretched_kernel_radius' (Lanczos kernel convolution); caller FUN_00a7a360 (HighLevel_Resample) */ undefined4 ClownResampler_LowLevel_Resample(int param_1,uint *param_2,code *param_3,undefined4 param_4) { short sVar1; undefined1 auVar2 [16]; undefined1 auVar3 [16]; undefined1 auVar4 [16]; undefined1 auVar5 [16]; int iVar6; int *piVar7; char cVar8; uint uVar9; ulonglong *puVar10; int iVar11; uint uVar12; int *in_ECX; int in_EDX; uint uVar13; short *psVar14; uint uVar15; undefined1 auVar16 [16]; undefined1 auVar17 [16]; undefined1 auVar18 [16]; undefined1 auVar19 [16]; undefined1 auVar20 [16]; int local_2c [4]; uint local_1c [3]; int *local_10; uint local_c; ulonglong *local_8; uVar13 = in_ECX[5]; uVar15 = *param_2; if (uVar13 < uVar15) { local_2c[2] = 0x10; local_2c[3] = in_EDX; local_10 = in_ECX; do { piVar7 = local_10; iVar11 = in_ECX[6]; uVar15 = in_ECX[4]; uVar9 = (uint)(in_ECX[2] + 0xffff + iVar11) >> 0x10; local_c = (uint)(*in_ECX + iVar11) >> 0x10; local_2c[0] = 0; local_2c[1] = 0; local_1c[2] = (uVar13 + uVar9) * uVar15; uVar12 = local_10[1]; local_1c[0] = (uVar13 + uVar12 + local_c) * uVar15; uVar13 = (uVar9 * 0x10000 - iVar11) * local_10[3] >> 0x10; local_1c[1] = uVar13; if (uVar12 < uVar9) { _wassert(L"min_relative <= configuration->integer_stretched_kernel_radius", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\clownresampler.h" ,0x45c); uVar12 = piVar7[1]; } if (uVar12 < local_c) { _wassert(L"max_relative <= configuration->integer_stretched_kernel_radius", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\clownresampler.h" ,0x45d); } local_c = 0; if (local_1c[2] < local_1c[0]) { local_8 = (ulonglong *)(param_1 + local_1c[2] * 2); do { uVar12 = local_1c[2]; if (0x17ff < uVar13) { _wassert(L"kernel_index < CLOWNRESAMPLER_COUNT_OF(precomputed->lanczos_kernel_table)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\clownresampler.h" ,0x465); } iVar6 = local_2c[2]; iVar11 = *(int *)(local_2c[3] + uVar13 * 4); local_c = local_c + iVar11; uVar13 = 0; if (uVar15 != 0) { if ((7 < uVar15) && (1 < __isa_available)) { puVar10 = local_8; do { auVar16._8_8_ = 0; auVar16._0_8_ = *puVar10; auVar17 = pmovsxwd(auVar16,auVar16); auVar18._4_4_ = iVar11; auVar18._0_4_ = iVar11; auVar18._8_4_ = iVar11; auVar18._12_4_ = iVar11; auVar18 = pmulld(auVar17,auVar18); auVar19._8_8_ = 0; auVar19._0_8_ = puVar10[1]; local_2c[uVar13] = ((int)((-(uint)(auVar18._0_4_ < 0) & 0xffff) + auVar18._0_4_) >> iVar6) + local_2c[uVar13]; local_2c[uVar13 + 1] = ((int)((-(uint)(auVar18._4_4_ < 0) & 0xffff) + auVar18._4_4_) >> iVar6) + local_2c[uVar13 + 1]; local_2c[uVar13 + 2] = ((int)((-(uint)(auVar18._8_4_ < 0) & 0xffff) + auVar18._8_4_) >> iVar6) + local_2c[uVar13 + 2]; local_2c[uVar13 + 3] = ((int)((-(uint)(auVar18._12_4_ < 0) & 0xffff) + auVar18._12_4_) >> iVar6) + local_2c[uVar13 + 3]; auVar18 = pmovsxwd(auVar19,auVar19); auVar17._4_4_ = iVar11; auVar17._0_4_ = iVar11; auVar17._8_4_ = iVar11; auVar17._12_4_ = iVar11; auVar18 = pmulld(auVar18,auVar17); auVar20._0_4_ = ((int)((-(uint)(auVar18._0_4_ < 0) & 0xffff) + auVar18._0_4_) >> iVar6) + local_1c[uVar13]; auVar20._4_4_ = ((int)((-(uint)(auVar18._4_4_ < 0) & 0xffff) + auVar18._4_4_) >> iVar6) + local_1c[uVar13 + 1]; auVar20._8_4_ = ((int)((-(uint)(auVar18._8_4_ < 0) & 0xffff) + auVar18._8_4_) >> iVar6) + local_1c[uVar13 + 2]; auVar20._12_4_ = ((int)((-(uint)(auVar18._12_4_ < 0) & 0xffff) + auVar18._12_4_) >> iVar6) + local_1c[uVar13 + 3]; *(undefined1 (*) [16])(local_1c + uVar13) = auVar20; uVar13 = uVar13 + 8; puVar10 = puVar10 + 2; } while (uVar13 < (uVar15 & 0xfffffff8)); if (uVar15 <= uVar13) goto LAB_00a7a1c7; } psVar14 = (short *)(param_1 + (uVar13 + uVar12) * 2); do { sVar1 = *psVar14; psVar14 = psVar14 + 1; local_2c[uVar13] = local_2c[uVar13] + ((int)(sVar1 * iVar11 + (sVar1 * iVar11 >> 0x1f & 0xffffU)) >> 0x10); uVar13 = uVar13 + 1; } while (uVar13 < uVar15); uVar12 = local_1c[2]; } LAB_00a7a1c7: local_8 = (ulonglong *)((int)local_8 + uVar15 * 2); local_1c[2] = uVar12 + uVar15; uVar13 = local_1c[1] + local_10[3]; local_1c[1] = uVar13; } while (uVar12 + uVar15 < local_1c[0]); } iVar11 = (int)(0x80000000 / (ulonglong)local_c); uVar13 = 0; if (uVar15 != 0) { if ((0xf < uVar15) && (1 < __isa_available)) { do { auVar2._4_4_ = iVar11; auVar2._0_4_ = iVar11; auVar2._8_4_ = iVar11; auVar2._12_4_ = iVar11; auVar18 = pmulld(*(undefined1 (*) [16])(local_2c + uVar13),auVar2); local_2c[uVar13] = (int)((-(uint)(auVar18._0_4_ < 0) & 0x7fff) + auVar18._0_4_) >> 0xf; local_2c[uVar13 + 1] = (int)((-(uint)(auVar18._4_4_ < 0) & 0x7fff) + auVar18._4_4_) >> 0xf; local_2c[uVar13 + 2] = (int)((-(uint)(auVar18._8_4_ < 0) & 0x7fff) + auVar18._8_4_) >> 0xf; local_2c[uVar13 + 3] = (int)((-(uint)(auVar18._12_4_ < 0) & 0x7fff) + auVar18._12_4_) >> 0xf; auVar3._4_4_ = iVar11; auVar3._0_4_ = iVar11; auVar3._8_4_ = iVar11; auVar3._12_4_ = iVar11; auVar18 = pmulld(*(undefined1 (*) [16])(local_1c + uVar13),auVar3); local_1c[uVar13] = (int)((-(uint)(auVar18._0_4_ < 0) & 0x7fff) + auVar18._0_4_) >> 0xf; local_1c[uVar13 + 1] = (int)((-(uint)(auVar18._4_4_ < 0) & 0x7fff) + auVar18._4_4_) >> 0xf; local_1c[uVar13 + 2] = (int)((-(uint)(auVar18._8_4_ < 0) & 0x7fff) + auVar18._8_4_) >> 0xf; local_1c[uVar13 + 3] = (int)((-(uint)(auVar18._12_4_ < 0) & 0x7fff) + auVar18._12_4_) >> 0xf; auVar4._4_4_ = iVar11; auVar4._0_4_ = iVar11; auVar4._8_4_ = iVar11; auVar4._12_4_ = iVar11; auVar18 = pmulld(*(undefined1 (*) [16])(local_1c + uVar13 + 4),auVar4); local_1c[uVar13 + 4] = (int)((-(uint)(auVar18._0_4_ < 0) & 0x7fff) + auVar18._0_4_) >> 0xf; (&local_8)[uVar13] = (ulonglong *)((int)((-(uint)(auVar18._4_4_ < 0) & 0x7fff) + auVar18._4_4_) >> 0xf); local_1c[uVar13 + 6] = (int)((-(uint)(auVar18._8_4_ < 0) & 0x7fff) + auVar18._8_4_) >> 0xf; *(int *)((int)register0x00000010 + uVar13 * 4) = (int)((-(uint)(auVar18._12_4_ < 0) & 0x7fff) + auVar18._12_4_) >> 0xf; auVar5._4_4_ = iVar11; auVar5._0_4_ = iVar11; auVar5._8_4_ = iVar11; auVar5._12_4_ = iVar11; auVar18 = pmulld(*(undefined1 (*) [16])(¶m_1 + uVar13),auVar5); (¶m_1)[uVar13] = (int)((-(uint)(auVar18._0_4_ < 0) & 0x7fff) + auVar18._0_4_) >> 0xf ; (¶m_2)[uVar13] = (uint *)((int)((-(uint)(auVar18._4_4_ < 0) & 0x7fff) + auVar18._4_4_) >> 0xf); (¶m_3)[uVar13] = (code *)((int)((-(uint)(auVar18._8_4_ < 0) & 0x7fff) + auVar18._8_4_) >> 0xf); (¶m_4)[uVar13] = (int)((-(uint)(auVar18._12_4_ < 0) & 0x7fff) + auVar18._12_4_) >> 0xf; uVar13 = uVar13 + 0x10; } while (uVar13 < (uVar15 & 0xfffffff0)); if (uVar15 <= uVar13) goto LAB_00a7a2f3; } do { local_2c[uVar13] = (int)(local_2c[uVar13] * iVar11 + (local_2c[uVar13] * iVar11 >> 0x1f & 0x7fffU)) >> 0xf; uVar13 = uVar13 + 1; } while (uVar13 < uVar15); } LAB_00a7a2f3: in_ECX = local_10; iVar11 = local_10[6]; local_10[6] = local_10[7] + iVar11; local_10[5] = local_10[5] + ((uint)(local_10[7] + iVar11) >> 0x10); *(undefined2 *)((int)local_10 + 0x1a) = 0; cVar8 = (*param_3)(param_4,local_2c,local_10[4]); uVar13 = in_ECX[5]; uVar15 = *param_2; if (cVar8 == '\0') { uVar12 = uVar13; if (uVar15 <= uVar13) { uVar12 = uVar15; } *param_2 = uVar15 - uVar12; in_ECX[5] = uVar13 - uVar12; return 0; } } while (uVar13 < uVar15); } *param_2 = 0; in_ECX[5] = uVar13 - uVar15; return 1; } //@@ 00a7a360 ClownResampler_HighLevel_Resample /* DB: clownresampler (round 7 agent) */ uint ClownResampler_HighLevel_Resample(code *param_1,undefined4 param_2,undefined4 param_3) { int iVar1; int iVar2; int iVar3; uint uVar4; int in_ECX; int iVar5; uint local_8; iVar1 = *(int *)(in_ECX + 0x2028) * *(int *)(in_ECX + 0x10); iVar2 = *(int *)(in_ECX + 0x202c); while (iVar2 != 0) { iVar2 = (*param_1)(param_3,in_ECX + ((iVar1 * 2 - *(int *)(in_ECX + 0x10) * iVar2) + 0x10) * 2, iVar2); iVar3 = 0; if (iVar2 == 0) goto LAB_00a7a426; iVar2 = *(int *)(in_ECX + 0x202c) - iVar2; *(int *)(in_ECX + 0x202c) = iVar2; } iVar5 = *(int *)(in_ECX + 0x2020); iVar2 = *(int *)(in_ECX + 0x2024); do { if (iVar5 == iVar2) { memmove((void *)(in_ECX + 0x20),(void *)(iVar2 + iVar1 * -2),iVar1 * 4); *(int *)(in_ECX + 0x2020) = in_ECX + 0x20 + iVar1 * 2; iVar2 = (*param_1)(param_3,in_ECX + 0x20 + iVar1 * 4, (iVar1 * -2 + 0x1000U) / *(uint *)(in_ECX + 0x10)); uVar4 = *(uint *)(in_ECX + 0x10); iVar5 = *(int *)(in_ECX + 0x2020); iVar3 = iVar5 + uVar4 * iVar2 * 2; *(int *)(in_ECX + 0x2024) = iVar3; if (iVar5 == iVar3) { LAB_00a7a426: return CONCAT31((int3)((uint)iVar3 >> 8),1); } } else { uVar4 = *(uint *)(in_ECX + 0x10); iVar3 = *(int *)(in_ECX + 0x2024); } local_8 = (uint)(iVar3 - iVar5 >> 1) / uVar4; uVar4 = ClownResampler_LowLevel_Resample (iVar5 + *(int *)(in_ECX + 4) * uVar4 * -2,&local_8,param_2,param_3); iVar2 = *(int *)(in_ECX + 0x2024); iVar5 = iVar2 + *(int *)(in_ECX + 0x10) * local_8 * -2; *(int *)(in_ECX + 0x2020) = iVar5; if ((char)uVar4 == '\0') { return uVar4 & 0xffffff00; } } while( true ); } //@@ 00a7a4a0 FUN_00a7a4a0 uint FUN_00a7a4a0(int *param_1,void *param_2,uint param_3) { uint uVar1; uVar1 = *(uint *)(*param_1 + 0x2030); if (param_3 < uVar1) { uVar1 = param_3; } memset(param_2,0,*(int *)(*param_1 + 0x10) * uVar1 * 2); *(int *)(*param_1 + 0x2030) = *(int *)(*param_1 + 0x2030) - uVar1; return uVar1; } //@@ 00a7a4e0 FUN_00a7a4e0 void FUN_00a7a4e0(int param_1,undefined4 param_2,undefined4 param_3) { (**(code **)(param_1 + 4))(*(undefined4 *)(param_1 + 8),param_2,param_3); return; } //@@ 00a7a510 organya_song_load /* DB: string "Organya track uses unsupported drum type: Instrument Index = %d, Drum Type = %d"; FileSystem::ResolvePath+open_archive_file/KAGE::Filesys::File::open, reads u16 wait, u8 beats/steps, s32 repeat start/end, samples-per-tick = wait*44100/1000, then 16 tracks (8 melody + 8 drum) of freq/wave/pipi/note count; callers 00a7cc60/00a7cfd0 render the org to PCM */ undefined4 organya_song_load(byte *param_1) { int iVar1; longlong lVar2; qword qVar3; byte bVar4; char cVar5; ushort uVar6; byte *path; void *pvVar7; size_t *psVar8; undefined4 uVar9; ushort uVar10; int in_ECX; size_t _Size; uint uVar11; byte *pbVar12; undefined4 *puVar13; qword *pqVar14; int *piVar15; int *piVar16; int local_28; undefined4 local_24; undefined4 local_20; byte *local_1c; int local_18; undefined1 local_13; undefined1 local_12; undefined1 local_11; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00afa5b0; local_10 = ExceptionList; ExceptionList = &local_10; local_18 = in_ECX; FUN_00a7af50(__security_cookie ^ (int)register0x00000010 - 4U); FUN_00a7aa70(); if (param_1 == (byte *)0x0) { ExceptionList = local_10; return 0; } if (*param_1 == 0) { ExceptionList = local_10; return 0; } local_1c = (byte *)0x0; path = FileSystem::ResolvePath(param_1); FileSystem::open_archive_file(&PTR_vftable_00c37a10,path,&local_1c); pbVar12 = local_1c; if (local_1c == (byte *)0x0) { if (path == (byte *)0x0) goto LAB_00a7a616; if (*path != 0) { param_1 = operator_new(0x10); if (param_1 == (byte *)0x0) { pbVar12 = (byte *)0x0; } else { param_1[4] = 2; param_1[5] = 0; param_1[6] = 0; param_1[7] = 0; param_1[8] = 0; param_1[9] = 0; param_1[10] = 0; param_1[0xb] = 0; *(undefined ***)param_1 = KAGE::Filesys::File::vftable; param_1[0xc] = 0; param_1[0xd] = 0; param_1[0xe] = 0; param_1[0xf] = 0; pbVar12 = param_1; } if (*(code **)(*(int *)pbVar12 + 0x24) == KAGE::Filesys::File::open) { bVar4 = KAGE::Filesys::File::open(pbVar12,path); } else { bVar4 = (**(code **)(*(int *)pbVar12 + 0x24))(); } if (bVar4 == 0) { (*(code *)**(undefined4 **)pbVar12)(1); pbVar12 = (byte *)0x0; } } local_8 = 1; } else { if (path == (byte *)0x0) goto LAB_00a7a616; local_8 = 0; } tracked_alloc(1,path,0); local_8 = 0xffffffff; LAB_00a7a616: if (pbVar12 == (byte *)0x0) { ExceptionList = local_10; return 0; } (**(code **)(*(int *)pbVar12 + 0x14))(); param_1 = (byte *)0x0; (**(code **)(*(int *)pbVar12 + 0x14))(¶m_1,2,1); *(undefined2 *)(in_ECX + 6) = param_1._0_2_; param_1 = (byte *)((uint)param_1 & 0xffffff); (**(code **)(*(int *)pbVar12 + 0x14))((int)¶m_1 + 3,1,1); *(undefined1 *)(in_ECX + 8) = param_1._3_1_; param_1 = (byte *)((uint)param_1 & 0xffffff); (**(code **)(*(int *)pbVar12 + 0x14))((int)¶m_1 + 3,1,1); *(undefined1 *)(in_ECX + 9) = param_1._3_1_; param_1 = (byte *)0x0; (**(code **)(*(int *)pbVar12 + 0x14))(¶m_1,4,1); *(byte **)(in_ECX + 0x10) = param_1; param_1 = (byte *)0x0; (**(code **)(*(int *)pbVar12 + 0x14))(¶m_1,4,1); *(byte **)(in_ECX + 0x14) = param_1; uVar11 = ((uint)*(ushort *)(in_ECX + 6) * 0xac44) / 1000; *(uint *)(in_ECX + 0xc) = uVar11; pvVar7 = tracked_alloc(0,(void *)0x0,(ulonglong)(uVar11 << 2)); *(void **)(in_ECX + 0x2069c) = pvVar7; lVar2 = (ulonglong)(uint)(*(int *)(in_ECX + 0xc) * 2) * 4; pvVar7 = tracked_alloc(0,(void *)0x0, (ulonglong)(-(uint)((int)((ulonglong)lVar2 >> 0x20) != 0) | (uint)lVar2)); *(void **)(in_ECX + 0x206a0) = pvVar7; uVar11 = 0; puVar13 = (undefined4 *)(local_18 + 0x60); do { param_1 = (byte *)0x0; (**(code **)(*(int *)pbVar12 + 0x14))(¶m_1,2,1); *(undefined2 *)(puVar13 + -0x12) = param_1._0_2_; param_1 = (byte *)((uint)param_1 & 0xffffff); (**(code **)(*(int *)pbVar12 + 0x14))((int)¶m_1 + 3,1,1); *(undefined1 *)((int)puVar13 + -0x46) = param_1._3_1_; param_1 = (byte *)((uint)param_1 & 0xffffff); (**(code **)(*(int *)pbVar12 + 0x14))((int)¶m_1 + 3,1,1); *(undefined1 *)((int)puVar13 + -0x45) = param_1._3_1_; local_20 = 0; (**(code **)(*(int *)pbVar12 + 0x14))(&local_20,2,1); *(undefined2 *)(puVar13 + -0x10) = (undefined2)local_20; puVar13[-2] = 1; puVar13[-1] = 0; *puVar13 = 0; cVar5 = FUN_00a79f40(0xac44,0xac44); if (cVar5 != '\0') { iVar1 = puVar13[-5]; puVar13[0x804] = iVar1; puVar13[0x806] = iVar1; puVar13[0x805] = iVar1; memset(puVar13 + 2,0,puVar13[-2] * iVar1 * 2); iVar1 = (int)puVar13 + (puVar13[-2] * puVar13[0x804] + 4) * 2; puVar13[0x803] = iVar1; puVar13[0x802] = iVar1; } if ((7 < uVar11) && (*(short *)(puVar13 + -0x10) != 0)) { switch(*(undefined1 *)((int)puVar13 + -0x46)) { case 0: case 2: case 4: case 5: case 6: break; default: KAGE_LogMessage(8,(byte *) "Organya track uses unsupported drum type: Instrument Index = %d, Drum Type = %d\n" ); *(undefined1 *)((int)puVar13 + -0x46) = 0; } } uVar11 = uVar11 + 1; puVar13 = puVar13 + 0x81a; } while (uVar11 < 0x10); piVar16 = (int *)(local_18 + 0x1c); local_28 = 0x10; do { if (*(ushort *)(piVar16 + 1) != 0) { uVar11 = (uint)*(ushort *)(piVar16 + 1) * 8; if (g_mainHeap == (void *)0x0) { pqVar14 = &g_allocatedBytesNoHeap; } else { pqVar14 = (qword *)((int)g_mainHeap + 0x30); } _Size = uVar11 + 4; psVar8 = malloc(_Size); if (psVar8 == (size_t *)0x0) { piVar15 = *(int **)g_memoryManager_oomHandlers; if (piVar15 != g_memoryManager_oomHandlers) { do { (*(code *)piVar15[2])(0x7fcb9dd6,piVar15[3]); piVar15 = (int *)*piVar15; } while (piVar15 != g_memoryManager_oomHandlers); } psVar8 = (size_t *)0x0; } else { *psVar8 = _Size; qVar3 = *pqVar14; *(uint *)pqVar14 = (uint)*pqVar14 + _Size; *(uint *)((int)pqVar14 + 4) = *(uint *)((int)pqVar14 + 4) + (uint)(0xfffffffb < uVar11) + (uint)CARRY4((uint)qVar3,_Size); psVar8 = psVar8 + 1; } uVar11 = 0; *piVar16 = (int)psVar8; uVar6 = 0; if ((short)piVar16[1] != 0) { do { local_24 = 0; (**(code **)(*(int *)pbVar12 + 0x14))(&local_24,4,1); *(undefined4 *)(*piVar16 + uVar11 * 8) = local_24; uVar11 = uVar11 + 1; uVar6 = *(ushort *)(piVar16 + 1); } while (uVar11 < uVar6); } uVar11 = 0; uVar10 = 0; if (uVar6 != 0) { do { param_1 = (byte *)((uint)param_1 & 0xffffff); (**(code **)(*(int *)pbVar12 + 0x14))((int)¶m_1 + 3,1,1); *(undefined1 *)(*piVar16 + 4 + uVar11 * 8) = param_1._3_1_; uVar11 = uVar11 + 1; uVar10 = *(ushort *)(piVar16 + 1); } while (uVar11 < uVar10); } uVar11 = 0; uVar6 = 0; if (uVar10 != 0) { do { local_11 = 0; (**(code **)(*(int *)pbVar12 + 0x14))(&local_11,1,1); *(undefined1 *)(*piVar16 + 5 + uVar11 * 8) = local_11; uVar11 = uVar11 + 1; uVar6 = *(ushort *)(piVar16 + 1); } while (uVar11 < uVar6); } uVar11 = 0; uVar10 = 0; if (uVar6 != 0) { do { local_12 = 0; (**(code **)(*(int *)pbVar12 + 0x14))(&local_12,1,1); *(undefined1 *)(*piVar16 + 6 + uVar11 * 8) = local_12; uVar11 = uVar11 + 1; uVar10 = *(ushort *)(piVar16 + 1); } while (uVar11 < uVar10); } uVar11 = 0; if (uVar10 != 0) { do { local_13 = 0; (**(code **)(*(int *)pbVar12 + 0x14))(&local_13,1,1); *(undefined1 *)(*piVar16 + 7 + uVar11 * 8) = local_13; uVar11 = uVar11 + 1; } while (uVar11 < *(ushort *)(piVar16 + 1)); } } piVar16 = piVar16 + 0x81a; local_28 = local_28 + -1; } while (local_28 != 0); if (*(int *)(local_18 + 0x14) < 1) { uVar9 = *(undefined4 *)(local_18 + 0x10); } else { uVar9 = 0; } FUN_00a7b4c0(uVar9); (*(code *)**(undefined4 **)pbVar12)(1); ExceptionList = local_10; return 1; } //@@ 00a7aa70 FUN_00a7aa70 void FUN_00a7aa70(void) { int iVar1; uint uVar2; qword qVar3; uint uVar4; void *in_ECX; qword *pqVar5; int *piVar6; code *pcVar7; int iVar8; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b124e0; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; piVar6 = (int *)((int)in_ECX + 0x1c); iVar8 = 0x10; do { iVar1 = *piVar6; if (iVar1 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); *piVar6 = 0; } piVar6 = piVar6 + 0x81a; iVar8 = iVar8 + -1; } while (iVar8 != 0); memset(in_ECX,0,0x2069c); iVar8 = *(int *)((int)in_ECX + 0x2069c); if (iVar8 == 0) { pcVar7 = free_exref; } else { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar8 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; pcVar7 = free_exref; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar8 + -4)); *(undefined4 *)((int)in_ECX + 0x2069c) = 0; } iVar8 = *(int *)((int)in_ECX + 0x206a0); if (iVar8 != 0) { if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar8 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); (*pcVar7)(iVar8 + -4,uVar4); *(undefined4 *)((int)in_ECX + 0x206a0) = 0; } ExceptionList = local_10; return; } //@@ 00a7ab90 org_render_samples /* DB: ? Organya mixer: called from KAGE::Sound::SampleSourceOrg slot 7 (FUN_00a7cc60) and StreamSourceOrg slot 27 (FUN_00a7cef0); per tick walks 8 melody + 8 drum tracks' note events (index <8 -> melody), wave tables, pow for pitch, returns a mixed buffer and its size (memset silence at end of song) */ undefined4 org_render_samples(int *param_1) { char cVar1; byte bVar2; int iVar3; bool bVar4; ushort uVar5; short sVar6; int iVar7; short sVar8; int in_ECX; uint uVar9; undefined2 uVar10; char *pcVar11; int *piVar12; uint uVar13; uint local_14; if (*(int *)(in_ECX + 0x14) <= *(int *)(in_ECX + 0x20698)) { memset(*(void **)(in_ECX + 0x2069c),0,*(int *)(in_ECX + 0xc) << 2); memset(*(void **)(in_ECX + 0x206a0),0,*(int *)(in_ECX + 0xc) << 3); *param_1 = 0; return *(undefined4 *)(in_ECX + 0x2069c); } piVar12 = (int *)(in_ECX + 0x2074); local_14 = 0; do { iVar7 = piVar12[-0x816]; if (iVar7 != 0) { uVar13 = piVar12[-0x812]; if ((uVar13 < *(ushort *)(piVar12 + -0x815)) && (*(int *)(in_ECX + 0x20698) == *(int *)(iVar7 + uVar13 * 8))) { piVar12[-0x812] = uVar13 + 1; cVar1 = *(char *)(iVar7 + 4 + uVar13 * 8); if (cVar1 != -1) { if (local_14 < 8) { *(char *)((int)piVar12 + -0x2052) = cVar1; *(bool *)((int)piVar12 + 9) = local_14 < 8; uVar5 = 1; *(undefined1 *)(piVar12 + 2) = 1; if (*(char *)((int)piVar12 + -0x2059) == '\0') { uVar5 = (ushort)*(byte *)(iVar7 + 5 + uVar13 * 8); } } else { *(undefined2 *)((int)piVar12 + -0x204a) = 0; iVar3 = piVar12[-1]; piVar12[1] = iVar3; *piVar12 = iVar3; memset(piVar12 + -0x803,0,piVar12[-0x807] * iVar3 * 2); iVar3 = (int)piVar12 + (piVar12[-1] * piVar12[-0x807] + -0x1006) * 2; piVar12[-2] = iVar3; piVar12[-3] = iVar3; *(undefined1 *)((int)piVar12 + -0x2052) = *(undefined1 *)(iVar7 + 4 + uVar13 * 8); *(bool *)((int)piVar12 + 9) = local_14 < 8; *(undefined1 *)(piVar12 + 2) = 1; switch(*(undefined1 *)((int)piVar12 + -0x205a)) { case 0: uVar5 = (ushort)DAT_00c79c04; break; default: uVar5 = (ushort)DAT_00c79bfc; break; case 2: uVar5 = (ushort)DAT_00c79c0c; break; case 4: uVar5 = DAT_00c79c24; break; case 5: uVar5 = DAT_00c79c14; break; case 6: uVar5 = DAT_00c79c1c; } } *(ushort *)(piVar12 + -0x813) = uVar5; } bVar2 = *(byte *)(iVar7 + 7 + uVar13 * 8); bVar4 = false; if (bVar2 != 0xff) { sVar8 = (bVar2 - 6) * 0x1ae; if (sVar8 < -1) { sVar6 = -2; } else if (sVar8 < 2) { sVar6 = sVar8; } else { sVar6 = 2; } *(short *)((int)piVar12 + -0x204e) = sVar8 - sVar6; bVar4 = true; } bVar2 = *(byte *)(iVar7 + 6 + uVar13 * 8); if (bVar2 == 0xff) { if (!bVar4) goto LAB_00a7ae4e; } else { *(ushort *)(piVar12 + -0x814) = (bVar2 - 0xff) * 8; } sVar8 = -10000; if (-10000 < (short)piVar12[-0x814]) { sVar8 = (short)piVar12[-0x814]; } if (-1 < sVar8) { sVar8 = 0; } pow(10.0,(float)(int)sVar8 / 2000.0); FUN_00a7b180(piVar12 + -0x811,-*(short *)((int)piVar12 + -0x204e)); FUN_00a7b180(piVar12 + -0x80e,*(undefined2 *)((int)piVar12 + -0x204e)); } LAB_00a7ae4e: if (local_14 < 8) { if ((short)piVar12[-0x813] == 0) { *(undefined1 *)((int)piVar12 + 9) = 0; } else { *(short *)(piVar12 + -0x813) = (short)piVar12[-0x813] + -1; } } } local_14 = local_14 + 1; piVar12 = piVar12 + 0x81a; } while (local_14 < 0x10); memset(*(void **)(in_ECX + 0x206a0),0,*(int *)(in_ECX + 0xc) << 3); pcVar11 = (char *)(in_ECX + 0x207c); uVar13 = 0; do { if (*pcVar11 != '\0') { FUN_00a7b200(*(undefined4 *)(in_ECX + 0x206a0),uVar13,*(undefined4 *)(in_ECX + 0xc)); } uVar13 = uVar13 + 1; pcVar11 = pcVar11 + 0x2068; } while (uVar13 < 0x10); uVar13 = *(uint *)(in_ECX + 0xc); uVar9 = 0; if ((uVar13 & 0x7fffffff) != 0) { do { iVar7 = *(int *)(*(int *)(in_ECX + 0x206a0) + uVar9 * 4); if (iVar7 < -0x7fff) { iVar7 = -0x8000; LAB_00a7aef3: uVar10 = (undefined2)iVar7; } else { if (iVar7 < 0x7fff) goto LAB_00a7aef3; uVar10 = 0x7fff; } *(undefined2 *)(*(int *)(in_ECX + 0x2069c) + uVar9 * 2) = uVar10; uVar9 = uVar9 + 1; uVar13 = *(uint *)(in_ECX + 0xc); } while (uVar9 < uVar13 * 2); } *(int *)(in_ECX + 0x20698) = *(int *)(in_ECX + 0x20698) + 1; *param_1 = uVar13 * 4; return *(undefined4 *)(in_ECX + 0x2069c); } //@@ 00a7af50 FUN_00a7af50 void FUN_00a7af50(void) { uint uVar1; undefined *puVar2; uint uVar3; uint uVar4; undefined **local_44; uint local_40; undefined4 local_3c; undefined *local_38; undefined *local_34; int local_30; undefined *local_2c; int local_28; uint local_24; uint local_20; undefined **local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1445d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (DAT_00c79c00 == 0) { local_38 = (undefined *)0x0; local_30 = 0; local_3c = 0x8cb6; local_40 = 0x8cb6; local_2c = &DAT_00b3db48; local_20 = 0; local_24 = 0; local_28 = 0; local_34 = (undefined *)0x0; local_44 = KAGE::Filesys::BufferedStream::vftable; local_1c = KAGE::Filesys::BufferedStream::vftable; local_8 = 0; local_14 = 0; KAGE::Filesys::BufferedStream::read(&local_44,&local_14,2,1); uVar3 = local_14 & 0xffff; if (7 < (ushort)local_14) { uVar3 = 8; } local_18 = uVar3; memset(&DAT_00c79c00,0,0x40); uVar4 = 0; if ((short)uVar3 != 0) { do { local_14 = 0; if ((code *)local_1c[5] == memory_stream_read) { KAGE::Filesys::BufferedStream::read(&local_44,&local_14,4,1); } else { (*(code *)local_1c[5])(&local_14,4,1,uVar1); } (&DAT_00c79c04)[uVar4 * 2] = local_14; if (local_14 != 0) { puVar2 = local_38; if (local_2c != (undefined *)0x0) { puVar2 = local_2c; } puVar2 = puVar2 + local_24; local_24 = local_24 + local_14; (&DAT_00c79c00)[uVar4 * 2] = (int)puVar2; uVar3 = (int)local_34 - (int)local_38; if (local_2c != (undefined *)0x0) { uVar3 = local_40; } if ((local_24 < local_20) || (uVar3 < local_24 - local_20)) { KAGE::Filesys::BufferedStream::rebuffer(&local_44); } local_28 = local_24 - local_20; } uVar4 = uVar4 + 1; } while (uVar4 < (local_18 & 0xffff)); } local_1c = KAGE::Filesys::StreamBase::vftable; local_44 = KAGE::Filesys::BufferedStreamBase::vftable; local_40 = 0; local_3c = 0; local_2c = (undefined *)0x0; local_28 = 0; local_24 = 0; local_20 = 0; if (local_38 != (undefined *)0x0) { uVar1 = local_30 - (int)local_38; puVar2 = local_38; local_34 = local_38; if (0xfff < uVar1) { puVar2 = *(undefined **)(local_38 + -4); uVar1 = uVar1 + 0x23; if ((undefined *)0x1f < local_38 + (-4 - (int)puVar2)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar2,uVar1); } } ExceptionList = local_10; return; } //@@ 00a7b140 FUN_00a7b140 undefined4 FUN_00a7b140(void) { int in_ECX; switch(*(undefined1 *)(in_ECX + 2)) { case 0: return 0; default: return 0xff; case 2: return 1; case 4: return 4; case 5: return 2; case 6: return 3; } } //@@ 00a7b180 FUN_00a7b180 void FUN_00a7b180(int *param_1,short param_2) { int iVar1; int *in_ECX; float fVar2; if (param_2 < -9999) { param_2 = -10000; } if (-1 < param_2) { param_2 = 0; } fVar2 = pow(10.0,(float)(int)param_2 / 2000.0); iVar1 = (int)(fVar2 * 4096.0) * *in_ECX; iVar1 = (int)((iVar1 >> 0x1f & 0xfffU) + iVar1) >> 0xc; param_1[1] = iVar1; *(short *)(param_1 + 2) = (short)((iVar1 - *param_1) / 0xb0); return; } //@@ 00a7b200 FUN_00a7b200 int FUN_00a7b200(undefined1 param_1,uint param_2,int param_3) { int iVar1; char cVar2; int in_ECX; int iVar3; undefined1 *local_50; undefined4 *local_4c; int local_48; undefined4 *local_44; undefined4 local_40; undefined4 *puStack_3c; code *pcStack_38; undefined1 **ppuStack_34; undefined4 *local_2c; int local_28; undefined **local_24; undefined4 local_20; undefined4 uStack_1c; undefined4 **ppuStack_18; undefined1 **ppuStack_14; undefined *local_10; undefined4 local_c [2]; iVar3 = in_ECX + 0x18 + param_2 * 0x2068; if (param_2 < 8) { local_c[0] = 0x100; local_10 = &DAT_00b468c0 + (uint)*(byte *)(iVar3 + 2) * 0x100; } else { cVar2 = FUN_00a7b140(); local_c[0] = (&DAT_00c79c04)[cVar2 * 2]; local_10 = (undefined *)(&DAT_00c79c00)[cVar2 * 2]; } local_40 = *(undefined4 *)(iVar3 + 0x30); puStack_3c = *(undefined4 **)(iVar3 + 0x34); pcStack_38 = *(code **)(iVar3 + 0x38); ppuStack_34 = *(undefined1 ***)(iVar3 + 0x3c); local_20 = *(undefined4 *)(iVar3 + 0x40); uStack_1c = *(undefined4 *)(iVar3 + 0x44); ppuStack_18 = *(undefined4 ***)(iVar3 + 0x48); ppuStack_14 = *(undefined1 ***)(iVar3 + 0x4c); cVar2 = FUN_00a79f40(0xac44,0xac44); if (((cVar2 == '\0') || (*(uint *)(iVar3 + 0x2058) < *(uint *)(iVar3 + 0x34))) || ((uint)(0x1000 / (ulonglong)*(uint *)(iVar3 + 0x40)) <= *(uint *)(iVar3 + 0x34) * 2)) { *(undefined4 *)(iVar3 + 0x30) = local_40; *(undefined4 **)(iVar3 + 0x34) = puStack_3c; *(code **)(iVar3 + 0x38) = pcStack_38; *(undefined1 ***)(iVar3 + 0x3c) = ppuStack_34; *(undefined4 *)(iVar3 + 0x40) = local_20; *(undefined4 *)(iVar3 + 0x44) = uStack_1c; *(undefined4 ***)(iVar3 + 0x48) = ppuStack_18; *(undefined1 ***)(iVar3 + 0x4c) = ppuStack_14; } local_2c = local_c; local_24 = &local_10; local_50 = ¶m_1; local_4c = ¶m_2; local_44 = ¶m_3; param_2 = 0; local_48 = iVar3; local_28 = iVar3; if (param_3 == 0) { return 0; } do { ppuStack_18 = &local_2c; ppuStack_14 = &local_50; cVar2 = ClownResampler_HighLevel_Resample(FUN_00a7b530,FUN_00a7b5a0,&ppuStack_18); if (cVar2 != '\0') { if (*(char *)(iVar3 + 0x2065) == '\0') { ppuStack_34 = &local_50; pcStack_38 = FUN_00a7b5c0; puStack_3c = (undefined4 *)(iVar3 + 0x30); cVar2 = ClownResampler_HighLevel_Resample(FUN_00a7a4a0,FUN_00a7a4e0,&puStack_3c); if (cVar2 != '\0') { *(undefined1 *)(iVar3 + 0x2064) = 0; iVar1 = *(int *)(iVar3 + 0x2058); *(int *)(iVar3 + 0x2060) = iVar1; *(int *)(iVar3 + 0x205c) = iVar1; memset((void *)(iVar3 + 0x50),0,*(int *)(iVar3 + 0x40) * iVar1 * 2); iVar1 = iVar3 + (*(int *)(iVar3 + 0x40) * *(int *)(iVar3 + 0x2058) + 0x28) * 2; *(int *)(iVar3 + 0x2054) = iVar1; *(int *)(iVar3 + 0x2050) = iVar1; return param_2; } } else { *(undefined2 *)(iVar3 + 0x12) = 0; } } } while (param_2 != param_3); return param_2; } //@@ 00a7b3f0 FUN_00a7b3f0 undefined4 FUN_00a7b3f0(short *param_1) { int *piVar1; short sVar2; int iVar3; int iVar4; undefined4 *in_ECX; int iVar5; int iVar6; sVar2 = *param_1; iVar4 = in_ECX[2]; iVar3 = *(int *)(iVar4 + 0x18); iVar6 = *(int *)(iVar4 + 0x1c) - iVar3; if (iVar6 < 0) { iVar6 = iVar3 - *(int *)(iVar4 + 0x1c); } iVar5 = (int)*(short *)(iVar4 + 0x20); if ((int)*(short *)(iVar4 + 0x20) <= -iVar6) { iVar5 = -iVar6; } if (iVar5 < iVar6) { iVar6 = iVar5; } *(int *)(iVar4 + 0x18) = iVar3 + iVar6; iVar4 = (iVar3 + iVar6) * (int)sVar2; piVar1 = (int *)(*(int *)*in_ECX + *(int *)in_ECX[1] * 8); *piVar1 = *piVar1 + ((int)(iVar4 + (iVar4 >> 0x1f & 0xfffU)) >> 0xc); iVar4 = in_ECX[2]; iVar3 = *(int *)(iVar4 + 0x24); iVar6 = *(int *)(iVar4 + 0x28) - iVar3; if (iVar6 < 0) { iVar6 = iVar3 - *(int *)(iVar4 + 0x28); } iVar5 = (int)*(short *)(iVar4 + 0x2c); if ((int)*(short *)(iVar4 + 0x2c) <= -iVar6) { iVar5 = -iVar6; } if (iVar5 < iVar6) { iVar6 = iVar5; } *(int *)(iVar4 + 0x24) = iVar3 + iVar6; iVar4 = (iVar3 + iVar6) * (int)sVar2; piVar1 = (int *)(*(int *)*in_ECX + *(int *)in_ECX[1] * 8 + 4); *piVar1 = *piVar1 + ((int)(iVar4 + (iVar4 >> 0x1f & 0xfffU)) >> 0xc); *(int *)in_ECX[1] = *(int *)in_ECX[1] + 1; return CONCAT31((int3)((uint)*(int *)in_ECX[1] >> 8),*(int *)in_ECX[1] != *(int *)in_ECX[3]); } //@@ 00a7b4c0 FUN_00a7b4c0 void FUN_00a7b4c0(int param_1) { undefined4 uVar1; uint uVar2; int in_ECX; int *piVar3; uint *puVar4; uVar1 = param_1; param_1 = 0x10; *(undefined4 *)(in_ECX + 0x20698) = uVar1; puVar4 = (uint *)(in_ECX + 0x2c); do { *puVar4 = 0; *(undefined2 *)(puVar4 + -1) = 0; if ((ushort)puVar4[-3] != 0) { piVar3 = (int *)puVar4[-4]; uVar2 = 0; do { if (*(int *)(in_ECX + 0x20698) <= *piVar3) break; uVar2 = uVar2 + 1; piVar3 = piVar3 + 2; *puVar4 = uVar2; } while (uVar2 < (ushort)puVar4[-3]); } puVar4 = puVar4 + 0x81a; param_1 = param_1 + -1; if (param_1 == 0) { return; } } while( true ); } //@@ 00a7b530 FUN_00a7b530 uint FUN_00a7b530(int *param_1,int param_2,uint param_3) { undefined4 *puVar1; uint uVar2; int iVar3; puVar1 = (undefined4 *)*param_1; iVar3 = puVar1[1]; uVar2 = *(int *)*puVar1 - (uint)*(ushort *)(iVar3 + 0x12); if (uVar2 < param_3) { param_3 = uVar2; } uVar2 = 0; if (param_3 != 0) { do { *(short *)(param_2 + uVar2 * 2) = *(char *)((uint)*(ushort *)(puVar1[1] + 0x12) + *(int *)puVar1[2] + uVar2) * 0x100; uVar2 = uVar2 + 1; } while (uVar2 < param_3); iVar3 = puVar1[1]; } *(short *)(iVar3 + 0x12) = *(short *)(iVar3 + 0x12) + (short)param_3; return param_3; } //@@ 00a7b5a0 FUN_00a7b5a0 void FUN_00a7b5a0(undefined4 param_1,undefined4 param_2) { undefined4 in_ECX; FUN_00a7b3f0(param_2,in_ECX); return; } //@@ 00a7b5c0 FUN_00a7b5c0 void FUN_00a7b5c0(undefined4 param_1,undefined4 param_2) { undefined4 in_ECX; FUN_00a7b3f0(param_2,in_ECX); return; } //@@ 00a7b5e0 FUN_00a7b5e0 void FUN_00a7b5e0(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Sound::SampleSourceWav::vftable; FUN_00a9fe40(uVar2); in_ECX[0x14] = 0; in_ECX[0x13] = 0; FUN_00a9f980(); *in_ECX = KAGE::Sound::SampleSourceBase::vftable; local_8 = CONCAT31(local_8._1_3_,1); if ((int *)in_ECX[0x12] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[0x12] + 0xc))(); if ((cVar1 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(in_ECX + 0x11); } } *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,100); } ExceptionList = local_10; return; } //@@ 00a7b6a0 KAGE::Sound::SampleSourceWav::load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: vtable slot 7 of KAGE::Sound::SampleSourceWav (RTTI vftable 00ba2974): FileSystem::ResolvePath / open_archive_file / KAGE::Filesys::File::open, reads into KAGE_Memory::heap_alloc buffer, WAV parse FUN_00a7b940; string "Not enough memory to load WAV file: %s" */ undefined4 KAGE::Sound::SampleSourceWav::load(byte *param_1) { qword qVar1; byte bVar2; uint uVar3; byte *path; void *pvVar4; undefined4 *puVar5; undefined4 *puVar6; Entity_Player *pEVar7; qword *pqVar8; int local_3c; int local_38; int local_34; Entity_Player *local_30; Entity_Player *local_2c; int *local_28; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14480; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; if (param_1 == (byte *)0x0) { return 0; } if (*param_1 == 0) { return 0; } local_2c = (Entity_Player *)0x0; ExceptionList = &local_10; local_14 = uVar3; path = FileSystem::ResolvePath(param_1); FileSystem::open_archive_file(&PTR_vftable_00c37a10,path,&local_2c); pEVar7 = local_2c; if (local_2c == (Entity_Player *)0x0) { if (path != (byte *)0x0) { if (*path != 0) { local_30 = operator_new(0x10); if (local_30 == (Entity_Player *)0x0) { pEVar7 = (Entity_Player *)0x0; } else { *(undefined4 *)&local_30->field_0x4 = 2; (local_30->_damageEvents)._begin = (void *)0x0; *(undefined ***)local_30 = Filesys::File::vftable; (local_30->_damageEvents)._end = (void *)0x0; pEVar7 = local_30; } if (*(code **)(*(int *)pEVar7 + 0x24) == Filesys::File::open) { bVar2 = Filesys::File::open(pEVar7,path); } else { bVar2 = (**(code **)(*(int *)pEVar7 + 0x24))(path,uVar3); } if (bVar2 == 0) { (*(code *)**(undefined4 **)pEVar7)(1); pEVar7 = (Entity_Player *)0x0; } } local_8 = 1; LAB_00a7b785: tracked_alloc(1,path,0); local_8 = 0xffffffff; } } else if (path != (byte *)0x0) { local_8 = 0; goto LAB_00a7b785; } if (pEVar7 == (Entity_Player *)0x0) { ExceptionList = local_10; return 0; } local_34 = 0; local_30 = (Entity_Player *)0x0; Entity_Player::AddTrinket(pEVar7,&local_34,1); (**(code **)(*(int *)pEVar7 + 0xc))(0,0); local_38 = local_34 >> 0x1f; local_3c = local_34; pvVar4 = KAGE_Memory::heap_alloc(0,(ulonglong *)&local_3c); local_28[0x14] = (int)pvVar4; if (pvVar4 != (void *)0x0) { Entity_Player::AddTrinket(pEVar7,local_28 + 0x13,0); } (*(code *)**(undefined4 **)pEVar7)(1); if (local_28[0x14] == 0) { KAGE_LogMessage(1,(byte *)"Not enough memory to load WAV file: %s\n"); ExceptionList = local_10; return 0; } if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } puVar5 = malloc(0xc); if (puVar5 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 + 0xc; *puVar5 = 0xc; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) + (uint)(0xfffffff3 < (uint)qVar1); puVar6 = puVar5 + 1; if (puVar6 != (undefined4 *)0x0) { *puVar6 = 0; puVar5[2] = 0; goto LAB_00a7b86b; } } puVar6 = (undefined4 *)0x0; LAB_00a7b86b: FUN_00a7b940(puVar6); *(int *)local_28[0x11] = local_28[0x14]; *(int *)(local_28[0x11] + 4) = local_28[0x13]; *(undefined1 *)(local_28 + 2) = 1; (**(code **)(*local_28 + 4))(*(undefined4 *)local_28[0x11],((undefined4 *)local_28[0x11])[1]); ExceptionList = local_10; return 1; } //@@ 00a7b8d0 FUN_00a7b8d0 void FUN_00a7b8d0(int param_1) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int in_ECX; if (param_1 != 0) { uVar1 = *(undefined4 *)(in_ECX + 0x50); *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(in_ECX + 0x4c); *(undefined4 *)(param_1 + 0x50) = uVar1; uVar1 = *(undefined4 *)(in_ECX + 0x58); uVar2 = *(undefined4 *)(in_ECX + 0x5c); uVar3 = *(undefined4 *)(in_ECX + 0x60); *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(in_ECX + 0x54); *(undefined4 *)(param_1 + 0x58) = uVar1; *(undefined4 *)(param_1 + 0x5c) = uVar2; *(undefined4 *)(param_1 + 0x60) = uVar3; } FUN_00a9f870(param_1); return; } //@@ 00a7b900 FUN_00a7b900 void FUN_00a7b900(void) { int in_ECX; *(undefined4 *)(in_ECX + 0x50) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; FUN_00a9f980(); return; } //@@ 00a7b920 FUN_00a7b920 undefined2 FUN_00a7b920(void) { int in_ECX; return *(undefined2 *)(in_ECX + 0x56); } //@@ 00a7b930 FUN_00a7b930 bool FUN_00a7b930(void) { int in_ECX; return *(short *)(in_ECX + 0x62) == 0x10; } //@@ 00a7b940 FUN_00a7b940 void FUN_00a7b940(undefined4 param_1) { char cVar1; uint uVar2; ReferenceCountBase *this; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; this = operator_new(0x18); local_8 = 0; if (this == (ReferenceCountBase *)0x0) { this = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(this); *(undefined ***)this = ReferenceCount::vftable; *(undefined4 *)(this + 0x14) = param_1; } local_8 = 0xffffffff; if ((int *)in_ECX[1] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[1] + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(); } } in_ECX[1] = this; *in_ECX = param_1; ExceptionList = local_10; return; } //@@ 00a7b9e0 FUN_00a7b9e0 undefined4 FUN_00a7b9e0(void) { short sVar1; undefined4 uVar2; int *in_ECX; (**(code **)(in_ECX[2] + 0xc))(0xffffffff); if (((short)in_ECX[1] == 0) || (sVar1 = (short)in_ECX[1] + -1, *(short *)(in_ECX + 1) = sVar1, sVar1 != 0)) { (**(code **)(in_ECX[2] + 0x10))(); return 1; } (**(code **)(in_ECX[2] + 0x10))(); if ((void *)in_ECX[5] != (void *)0x0) { operator_delete((void *)in_ECX[5],8); in_ECX[5] = 0; } /* WARNING: Could not recover jumptable at 0x00a7ba2d. Too many branches */ /* WARNING: Treating indirect jump as call */ uVar2 = (**(code **)(*in_ECX + 0x14))(); return uVar2; } //@@ 00a7ba40 FUN_00a7ba40 void FUN_00a7ba40(byte param_1) { char cVar1; uint uVar2; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b144b0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = (int)KAGE::Sound::StreamSourceWav::vftable; FUN_00a2ba90(in_ECX); if (*(code **)(*in_ECX + 0x38) == FUN_00a9fde0) { cVar1 = FUN_00a9fde0(); } else { cVar1 = (**(code **)(*in_ECX + 0x38))(uVar2); } if (cVar1 != '\0') { FUN_00a9fe40(); } FUN_00aa03e0(); local_8 = CONCAT31(local_8._1_3_,1); *in_ECX = (int)KAGE::Sound::StreamSourceBase::vftable; _eh_vector_destructor_iterator_(in_ECX + 0x17,0xc,4,FUN_00aa00b0); *in_ECX = (int)KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xa8); } ExceptionList = local_10; return; } //@@ 00a7bb00 FUN_00a7bb00 uint FUN_00a7bb00(undefined4 param_1) { uint uVar1; int in_ECX; uVar1 = (**(code **)(**(int **)(in_ECX + 0x58) + 0x14))(param_1,1,0x10000); if (uVar1 < 0x10000) { (**(code **)(**(int **)(in_ECX + 0x58) + 0xc))(*(undefined4 *)(in_ECX + 0xa4),0); } return uVar1; } //@@ 00a7bb40 FUN_00a7bb40 uint FUN_00a7bb40(byte *param_1) { byte bVar1; uint uVar2; byte *path; uint3 extraout_var; Entity_Player *pEVar3; byte *pbVar4; undefined4 uVar5; int in_ECX; Entity_Player *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6910; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((param_1 == (byte *)0x0) || (*param_1 == 0)) { *(undefined4 *)(in_ECX + 0x58) = 0; pbVar4 = param_1; goto LAB_00a7bc86; } local_14 = (Entity_Player *)0x0; path = FileSystem::ResolvePath(param_1); FileSystem::open_archive_file(&PTR_vftable_00c37a10,path,&local_14); pbVar4 = (byte *)((uint)extraout_var << 8); pEVar3 = local_14; if (local_14 == (Entity_Player *)0x0) { if (path != (byte *)0x0) { if (*path != 0) { pEVar3 = operator_new(0x10); if (pEVar3 == (Entity_Player *)0x0) { pEVar3 = (Entity_Player *)0x0; } else { *(undefined4 *)&pEVar3->field_0x4 = 2; (pEVar3->_damageEvents)._begin = (void *)0x0; *(undefined ***)pEVar3 = KAGE::Filesys::File::vftable; (pEVar3->_damageEvents)._end = (void *)0x0; } if (*(code **)(*(int *)pEVar3 + 0x24) == KAGE::Filesys::File::open) { bVar1 = KAGE::Filesys::File::open(pEVar3,path); } else { bVar1 = (**(code **)(*(int *)pEVar3 + 0x24))(path,uVar2); } if (bVar1 == 0) { (*(code *)**(undefined4 **)pEVar3)(1); pEVar3 = (Entity_Player *)0x0; } } local_8 = 1; LAB_00a7bc21: pbVar4 = tracked_alloc(1,path,0); local_8 = 0xffffffff; } } else if (path != (byte *)0x0) { local_8 = 0; goto LAB_00a7bc21; } *(Entity_Player **)(in_ECX + 0x58) = pEVar3; if (pEVar3 != (Entity_Player *)0x0) { Entity_Player::AddTrinket(pEVar3,0,0); uVar5 = (**(code **)(**(int **)(in_ECX + 0x58) + 8))(); *(undefined4 *)(in_ECX + 0xa4) = uVar5; uVar2 = FUN_00aa02b0(param_1); ExceptionList = local_10; return uVar2; } LAB_00a7bc86: ExceptionList = local_10; return (uint)pbVar4 & 0xffffff00; } //@@ 00a7bcb0 FUN_00a7bcb0 undefined2 FUN_00a7bcb0(void) { int in_ECX; return *(undefined2 *)(in_ECX + 0x96); } //@@ 00a7bcc0 FUN_00a7bcc0 bool FUN_00a7bcc0(void) { int in_ECX; return *(short *)(in_ECX + 0xa2) == 0x10; } //@@ 00a7bcd0 FUN_00a7bcd0 void FUN_00a7bcd0(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Sound::SampleSourceOgg::vftable; FUN_00a9fe40(uVar2); FUN_00a9f980(); *in_ECX = KAGE::Sound::SampleSourceBase::vftable; local_8 = CONCAT31(local_8._1_3_,1); if ((int *)in_ECX[0x12] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[0x12] + 0xc))(); if ((cVar1 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(in_ECX + 0x11); } } *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } ExceptionList = local_10; return; } //@@ 00a7bd80 KAGE::Sound::SampleSourceOgg::load /* DB: vtable slot 7 of KAGE::Sound::SampleSourceOgg (RTTI vftable 00ba2aa4, same slot as SampleSourceWav::load 00a7b6a0): FileSystem::ResolvePath/open_archive_file, decodes with stb_vorbis (FUN_00aa7340/aa78e0/aa7fb0); strings "Could not decode OGG file %s.", "memory allocation error." */ undefined4 KAGE::Sound::SampleSourceOgg::load(byte *param_1) { qword qVar1; byte bVar2; uint uVar3; byte *path; size_t _Size; int *ptr; int iVar4; undefined4 *puVar5; undefined4 *puVar6; int *in_ECX; qword *pqVar7; int *piVar8; int local_44; undefined4 local_40; int local_3c; undefined4 local_38; undefined4 *local_30; undefined4 local_2c; int *local_28; void *local_24; size_t local_20; int *local_1c; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b144d0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; if (param_1 == (byte *)0x0) { return 0; } if (*param_1 == 0) { return 0; } local_1c = (int *)0x0; ExceptionList = &local_10; local_14 = in_ECX; path = FileSystem::ResolvePath(param_1); FileSystem::open_archive_file(&PTR_vftable_00c37a10,path,&local_1c); piVar8 = local_1c; if (local_1c == (int *)0x0) { if (path != (byte *)0x0) { if (*path != 0) { local_28 = operator_new(0x10); if (local_28 == (int *)0x0) { piVar8 = (int *)0x0; } else { local_28[1] = 2; local_28[2] = 0; *local_28 = (int)Filesys::File::vftable; local_28[3] = 0; piVar8 = local_28; } if (*(code **)(*piVar8 + 0x24) == Filesys::File::open) { bVar2 = Filesys::File::open(piVar8,path); } else { bVar2 = (**(code **)(*piVar8 + 0x24))(path,uVar3); } if (bVar2 == 0) { (**(code **)*piVar8)(1); piVar8 = (int *)0x0; } } local_8 = 1; LAB_00a7be64: tracked_alloc(1,path,0); local_8 = 0xffffffff; } } else if (path != (byte *)0x0) { local_8 = 0; goto LAB_00a7be64; } if (piVar8 == (int *)0x0) { ExceptionList = local_10; return 0; } (**(code **)(*piVar8 + 0xc))(0,0); uVar3 = (**(code **)(*piVar8 + 4))(); local_24 = operator_new_tracked(uVar3); local_20 = (**(code **)(*piVar8 + 0x14))(local_24,uVar3,1); (**(code **)*piVar8)(1); local_2c = 0x4b000; if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } local_30 = malloc(0x4b004); if (local_30 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); local_30 = (undefined4 *)0x0; } else { *local_30 = 0x4b004; local_30 = local_30 + 1; qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0x4b004; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xfffb4ffb < (uint)qVar1); } piVar8 = (int *)FUN_00aa78e0(&local_28,&local_30); if (piVar8 == (int *)0x0) { KAGE_LogMessage(1,(byte *)"Could not decode OGG file %s.\n"); ExceptionList = local_10; return 0; } local_3c = piVar8[1]; in_ECX[0x13] = local_3c; in_ECX[0x15] = *piVar8; _Size = local_3c << 0xc; local_3c = local_3c << 0xd; in_ECX[0x14] = 1; local_18 = 0; param_1 = (byte *)0x0; local_38 = 0; local_20 = _Size; ptr = KAGE_Memory::heap_alloc(0,(ulonglong *)&local_3c); if (ptr == (int *)0x0) { LAB_00a7c053: vorbis_deinit(); if (piVar8[0x18] == 0) { free(piVar8); } KAGE_LogMessage(1,(byte *)"memory allocation error.\n"); ExceptionList = local_10; return 0; } iVar4 = FUN_00aa7fb0(ptr,_Size); while (iVar4 != 0) { local_18 = local_18 + iVar4; local_28 = (int *)local_14[0x13]; param_1 = (byte *)((int)param_1 + (int)local_28 * iVar4); if ((int)_Size < (int)(local_20 + (int)param_1)) { local_44 = _Size * 4; local_40 = 0; local_28 = KAGE_Memory::heap_alloc(0,(ulonglong *)&local_44); if (local_28 == (int *)0x0) { KAGE_Memory::heap_free(0,ptr); goto LAB_00a7c053; } memcpy(local_28,ptr,_Size); KAGE_Memory::heap_free(0,ptr); _Size = _Size * 2; ptr = local_28; } iVar4 = FUN_00aa7fb0((int)ptr + (int)param_1 * 2,_Size - (int)param_1); } if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } puVar5 = malloc(0xc); if (puVar5 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 + 0xc; *puVar5 = 0xc; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) + (uint)(0xfffffff3 < (uint)qVar1); puVar6 = puVar5 + 1; if (puVar6 != (undefined4 *)0x0) { *puVar6 = 0; puVar5[2] = 0; goto LAB_00a7c0a0; } } puVar6 = (undefined4 *)0x0; LAB_00a7c0a0: FUN_00a7b940(puVar6); *(int **)local_14[0x11] = ptr; *(int *)(local_14[0x11] + 4) = local_14[0x13] * local_18 * 2; if (local_30 != (undefined4 *)0x0) { local_8 = 2; tracked_alloc(1,local_30,0); local_8 = 0xffffffff; } if (local_24 != (void *)0x0) { local_8 = 3; tracked_alloc(1,local_24,0); local_8 = 0xffffffff; } *(undefined1 *)(local_14 + 2) = 1; (**(code **)(*local_14 + 4))(*(undefined4 *)local_14[0x11],((undefined4 *)local_14[0x11])[1]); ExceptionList = local_10; return 1; } //@@ 00a7c160 FUN_00a7c160 void FUN_00a7c160(int param_1) { int in_ECX; if (param_1 != 0) { *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(in_ECX + 0x4c); *(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(in_ECX + 0x50); *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(in_ECX + 0x54); } FUN_00a9f870(); return; } //@@ 00a7c190 FUN_00a7c190 undefined4 FUN_00a7c190(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x50); } //@@ 00a7c1a0 FUN_00a7c1a0 undefined4 FUN_00a7c1a0(void) { int in_ECX; return *(undefined4 *)(in_ECX + 0x54); } //@@ 00a7c1b0 FUN_00a7c1b0 void FUN_00a7c1b0(byte param_1) { LPCRITICAL_SECTION lpCriticalSection; char cVar1; uint uVar2; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = (int)KAGE::Sound::StreamSourceOgg::vftable; FUN_00a2ba90(in_ECX); if (*(code **)(*in_ECX + 0x38) == FUN_00a9fde0) { cVar1 = FUN_00a9fde0(); } else { cVar1 = (**(code **)(*in_ECX + 0x38))(uVar2); } if (cVar1 != '\0') { FUN_00a9fe40(); } FUN_00a7c9a0(); std::string::_Tidy_deallocate((char *)(in_ECX + 0x2b)); lpCriticalSection = (LPCRITICAL_SECTION)in_ECX[0x2a]; in_ECX[0x28] = (int)KAGE::Mutex::vftable; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(lpCriticalSection); operator_delete(lpCriticalSection,0x1c); in_ECX[0x2a] = 0; } *(byte *)(in_ECX + 0x29) = *(byte *)(in_ECX + 0x29) & 0xfe; in_ECX[0x28] = (int)KAGE::MutexBase::vftable; local_8 = CONCAT31(local_8._1_3_,1); *in_ECX = (int)KAGE::Sound::StreamSourceBase::vftable; _eh_vector_destructor_iterator_(in_ECX + 0x17,0xc,4,FUN_00aa00b0); *in_ECX = (int)KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc4); } ExceptionList = local_10; return; } //@@ 00a7c2c0 FUN_00a7c2c0 int FUN_00a7c2c0(undefined4 param_1) { char cVar1; int iVar2; int iVar3; int *in_ECX; (**(code **)(in_ECX[0x28] + 0xc))(0xffffffff); if (in_ECX[0x26] == 0) { (**(code **)(in_ECX[0x28] + 0x10))(); return -1; } iVar2 = (**(code **)(*in_ECX + 0x60))(); iVar3 = (**(code **)(*in_ECX + 0x60))(); (**(code **)(*in_ECX + 0x60))(); iVar2 = FUN_00aa7fb0(param_1,iVar3 * (int)(0x10000 / (ulonglong)(uint)(iVar2 * 2))); if (0 < iVar2) goto LAB_00a7c39c; if (*(char *)((int)in_ECX + 9) == '\0') { cVar1 = (**(code **)(*in_ECX + 0x70))(); if (cVar1 != '\0') { iVar2 = -1; goto LAB_00a7c39c; } if (*(char *)((int)in_ECX + 9) == '\0') goto LAB_00a7c39c; } iVar3 = in_ECX[0x25]; if (*(char *)(iVar3 + 0x30) == '\0') { FUN_00aa1590(); *(undefined4 *)(iVar3 + 0x3f0) = 0; *(undefined1 *)(iVar3 + 0x571) = 1; *(undefined4 *)(iVar3 + 0x574) = 0xffffffff; FUN_00aa50a0(); } else { *(undefined4 *)(iVar3 + 0x74) = 2; } LAB_00a7c39c: iVar3 = (**(code **)(*in_ECX + 0x60))(); (**(code **)(in_ECX[0x28] + 0x10))(); return iVar3 * iVar2 * 2; } //@@ 00a7c3d0 FUN_00a7c3d0 uint FUN_00a7c3d0(undefined4 param_1,undefined4 *param_2,undefined4 *param_3) { qword qVar1; void *pvVar2; uint in_EAX; undefined4 *puVar3; undefined4 uVar4; uint extraout_EAX; qword *pqVar5; int local_c [2]; pvVar2 = g_mainHeap; if ((param_2 != (undefined4 *)0x0) && (param_3 != (undefined4 *)0x0)) { param_3[1] = 0x4b000; if (pvVar2 == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)pvVar2 + 0x30); } puVar3 = malloc(0x4b004); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar3 = (undefined4 *)0x0; } else { qVar1 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 + 0x4b004; *puVar3 = 0x4b004; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) + (uint)(0xfffb4ffb < (uint)qVar1); puVar3 = puVar3 + 1; } *param_3 = puVar3; local_c[0] = 0; uVar4 = FUN_00aa7770(local_c,param_3); *param_2 = uVar4; if (local_c[0] == 0) { return 1; } KAGE_LogMessage(1,(byte *)"stb_vorbis_open_file returned error %d.\n"); in_EAX = extraout_EAX; } return in_EAX & 0xffffff00; } //@@ 00a7c490 FUN_00a7c490 undefined4 FUN_00a7c490(void) { byte bVar1; int iVar2; char cVar3; int *in_ECX; byte *pbVar4; byte *local_1c; undefined4 uStack_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b01e90; local_10 = ExceptionList; ExceptionList = &local_10; cVar3 = (**(code **)(*in_ECX + 0x18))(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar3 != '\0') { (**(code **)(*in_ECX + 0x14))(&local_1c); KAGE_LogMessage(1,(byte *)"Queued Path %s\n"); if ((void *)in_ECX[0x26] != (void *)0x0) { uStack_8 = 0; tracked_alloc(1,(void *)in_ECX[0x26],0); uStack_8 = 0xffffffff; in_ECX[0x26] = 0; } if ((undefined4 *)in_ECX[0x16] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX[0x16])(1); in_ECX[0x16] = 0; } pbVar4 = local_1c; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)(in_ECX + 0x2b),local_1c,(int)pbVar4 - (int)(local_1c + 1)); iVar2 = local_14[3]; in_ECX[0x16] = iVar2; if (iVar2 != 0) { in_ECX[0x25] = *local_14; iVar2 = local_14[2]; in_ECX[0x26] = local_14[1]; in_ECX[0x27] = iVar2; (**(code **)(*in_ECX + 0x40))(uStack_18); if (local_1c != (byte *)0x0) { uStack_8 = 1; tracked_alloc(1,local_1c,0); local_1c = (byte *)0x0; } operator_delete(local_14,0x10); ExceptionList = local_10; return 1; } } ExceptionList = local_10; return 0; } //@@ 00a7c5e0 FUN_00a7c5e0 uint FUN_00a7c5e0(byte *param_1) { byte bVar1; uint uVar2; byte *pbVar3; int *piVar4; std_string *psVar5; int in_ECX; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af6910; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((param_1 == (byte *)0x0) || (*param_1 == 0)) { piVar4 = (int *)0x0; } else { local_14 = (int *)0x0; pbVar3 = FileSystem::ResolvePath(param_1); FileSystem::open_archive_file(&PTR_vftable_00c37a10,pbVar3,&local_14); piVar4 = local_14; if (local_14 == (int *)0x0) { if (pbVar3 == (byte *)0x0) goto LAB_00a7c6e2; if (*pbVar3 != 0) { piVar4 = operator_new(0x10); if (piVar4 == (int *)0x0) { piVar4 = (int *)0x0; } else { piVar4[1] = 2; piVar4[2] = 0; *piVar4 = (int)KAGE::Filesys::File::vftable; piVar4[3] = 0; } if (*(code **)(*piVar4 + 0x24) == KAGE::Filesys::File::open) { bVar1 = KAGE::Filesys::File::open(piVar4,pbVar3); } else { bVar1 = (**(code **)(*piVar4 + 0x24))(pbVar3,uVar2); } if (bVar1 == 0) { (**(code **)*piVar4)(1); piVar4 = (int *)0x0; } } local_8 = 1; } else { if (pbVar3 == (byte *)0x0) goto LAB_00a7c6e2; local_8 = 0; } tracked_alloc(1,pbVar3,0); local_8 = 0xffffffff; } LAB_00a7c6e2: *(int **)(in_ECX + 0x58) = piVar4; pbVar3 = param_1; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); psVar5 = std::string::assign((char *)(in_ECX + 0xac),param_1,(int)pbVar3 - (int)(param_1 + 1)); if ((*(int *)(in_ECX + 0x58) == 0) || (psVar5 = (std_string *)FUN_00a7c3d0(*(int *)(in_ECX + 0x58),in_ECX + 0x94,in_ECX + 0x98), (char)psVar5 == '\0')) { ExceptionList = local_10; return (uint)psVar5 & 0xffffff00; } uVar2 = FUN_00aa02b0(param_1); ExceptionList = local_10; return uVar2; } //@@ 00a7c760 KAGE::Sound::StreamSourceOgg::open /* DB: ? slot 3 of KAGE::Sound::StreamSourceOgg vftable (0xba2b5c, RTTI col 0xbb1fd8); locks this+0xa0, FileSystem::ResolvePath/open_archive_file/KAGE::Filesys::File::open on param path, tracked_alloc buffers */ undefined4 KAGE::Sound::StreamSourceOgg::open(byte *param_1,undefined1 param_2) { int *piVar1; int iVar2; undefined8 *puVar3; qword qVar4; byte bVar5; char cVar6; byte *pbVar7; int *piVar8; undefined4 *puVar9; void *pvVar10; int in_ECX; uint count; int iVar11; uint uVar12; qword *pqVar13; undefined4 uStack_24; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b08420; local_10 = ExceptionList; ExceptionList = &local_10; piVar1 = (int *)(in_ECX + 0xa0); (**(code **)(*piVar1 + 0xc))(0xffffffff,__security_cookie ^ (int)register0x00000010 - 4U); if ((param_1 == (byte *)0x0) || (*param_1 == 0)) goto LAB_00a7c8cf; local_14 = (int *)0x0; pbVar7 = FileSystem::ResolvePath(param_1); FileSystem::open_archive_file(&PTR_vftable_00c37a10,pbVar7,&local_14); piVar8 = local_14; if (local_14 == (int *)0x0) { if (pbVar7 != (byte *)0x0) { if (*pbVar7 != 0) { piVar8 = operator_new(0x10); if (piVar8 == (int *)0x0) { piVar8 = (int *)0x0; } else { piVar8[1] = 2; piVar8[2] = 0; *piVar8 = (int)Filesys::File::vftable; piVar8[3] = 0; } if (*(code **)(*piVar8 + 0x24) == Filesys::File::open) { bVar5 = Filesys::File::open(piVar8,pbVar7); } else { bVar5 = (**(code **)(*piVar8 + 0x24))(); } if (bVar5 == 0) { (**(code **)*piVar8)(1); piVar8 = (int *)0x0; } } local_8 = 1; LAB_00a7c853: tracked_alloc(1,pbVar7,0); local_8 = 0xffffffff; } } else if (pbVar7 != (byte *)0x0) { local_8 = 0; goto LAB_00a7c853; } if (piVar8 != (int *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar13 = &g_allocatedBytesNoHeap; } else { pqVar13 = (qword *)((int)g_mainHeap + 0x30); } puVar9 = malloc(0x14); if (puVar9 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar9 = (undefined4 *)0x0; } else { qVar4 = *pqVar13; *(uint *)pqVar13 = (uint)*pqVar13 + 0x14; *puVar9 = 0x14; *(uint *)((int)pqVar13 + 4) = *(uint *)((int)pqVar13 + 4) + (uint)(0xffffffeb < (uint)qVar4); puVar9 = puVar9 + 1; } puVar9[1] = 0; cVar6 = FUN_00a7c3d0(piVar8,puVar9,puVar9 + 1); if (cVar6 != '\0') { puVar9[3] = piVar8; pbVar7 = path_join(param_1,(byte *)0x0,0,0); uStack_24 = CONCAT31(uStack_24._1_3_,param_2); count = *(uint *)(in_ECX + 0x24); uVar12 = *(uint *)(in_ECX + 0x1c); if (uVar12 <= count + 1) { std_deque_growmap((void *)(in_ECX + 0x14),count); uVar12 = *(uint *)(in_ECX + 0x1c); count = *(uint *)(in_ECX + 0x24); } *(uint *)(in_ECX + 0x20) = *(uint *)(in_ECX + 0x20) & uVar12 - 1; iVar2 = (count + *(int *)(in_ECX + 0x20) & uVar12 - 1) * 4; iVar11 = *(int *)(in_ECX + 0x18); if (*(int *)(iVar11 + iVar2) == 0) { pvVar10 = operator_new(0xc); *(void **)(iVar2 + *(int *)(in_ECX + 0x18)) = pvVar10; iVar11 = *(int *)(in_ECX + 0x18); } puVar3 = *(undefined8 **)(iVar2 + iVar11); *puVar3 = CONCAT44(uStack_24,pbVar7); *(undefined4 **)(puVar3 + 1) = puVar9; *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 1; *(undefined1 *)(in_ECX + 0x90) = 0; (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return 1; } operator_delete(puVar9,0x10); } LAB_00a7c8cf: (**(code **)(*piVar1 + 0x10))(); ExceptionList = local_10; return 0; } //@@ 00a7c9a0 FUN_00a7c9a0 void FUN_00a7c9a0(void) { void *ptr; char cVar1; int *in_ECX; undefined1 local_1c [8]; void *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01e90; local_10 = ExceptionList; ExceptionList = &local_10; (**(code **)(in_ECX[0x28] + 0xc))(0xffffffff,__security_cookie ^ (uint)(local_1c + 0x18)); cVar1 = (**(code **)(*in_ECX + 0x18))(); while (cVar1 != '\0') { (**(code **)(*in_ECX + 0x14))(local_1c); ptr = local_14; if (local_14 != (void *)0x0) { if (*(void **)((int)local_14 + 4) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)((int)local_14 + 4),0); local_8 = 0xffffffff; *(undefined4 *)((int)ptr + 4) = 0; } if (*(undefined4 **)((int)ptr + 0xc) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)((int)ptr + 0xc))(1); *(undefined4 *)((int)ptr + 0xc) = 0; } operator_delete(ptr,0x10); } cVar1 = (**(code **)(*in_ECX + 0x18))(); } if ((void *)in_ECX[0x26] != (void *)0x0) { local_8 = 1; tracked_alloc(1,(void *)in_ECX[0x26],0); local_8 = 0xffffffff; in_ECX[0x26] = 0; } (**(code **)(in_ECX[0x28] + 0x10))(); FUN_00aa03e0(); ExceptionList = local_10; return; } //@@ 00a7cab0 FUN_00a7cab0 void FUN_00a7cab0(void) { char cVar1; undefined4 *puVar2; int *in_ECX; undefined1 local_8 [4]; cVar1 = (**(code **)(*in_ECX + 0x38))(); if (cVar1 == '\0') { (**(code **)(DAT_00c5aac8 + 0xc))(0xffffffff); for (puVar2 = DAT_00c5aabc; puVar2 != DAT_00c5aac0; puVar2 = puVar2 + 1) { if ((int *)*puVar2 == in_ECX) { (**(code **)(DAT_00c5aac8 + 0x10))(); return; } } (**(code **)(DAT_00c5aac8 + 0x10))(); (**(code **)(DAT_00c5aac8 + 0xc))(0xffffffff); if (DAT_00c5aac0 == DAT_00c5aac4) { std::vector<4byte>::_Emplace_reallocate(DAT_00c5aac0,local_8); } else { *DAT_00c5aac0 = in_ECX; DAT_00c5aac0 = DAT_00c5aac0 + 1; } (**(code **)(DAT_00c5aac8 + 0x10))(); if ((in_ECX[0xd] != 0) && (cVar1 = (**(code **)(*in_ECX + 0x38))(), cVar1 == '\0')) { (**(code **)(PTR_vftable_00c5aaa0 + 0xc))(); alSourcePlay(in_ECX[0xd]); } } return; } //@@ 00a7cb90 FUN_00a7cb90 undefined4 FUN_00a7cb90(void) { int in_ECX; return *(undefined4 *)(*(int *)(in_ECX + 0x94) + 4); } //@@ 00a7cba0 FUN_00a7cba0 undefined4 FUN_00a7cba0(void) { int in_ECX; return **(undefined4 **)(in_ECX + 0x94); } //@@ 00a7cbb0 FUN_00a7cbb0 void FUN_00a7cbb0(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Sound::SampleSourceOrg::vftable; FUN_00a9fe40(uVar2); FUN_00a9f980(); *in_ECX = KAGE::Sound::SampleSourceBase::vftable; local_8 = CONCAT31(local_8._1_3_,1); if ((int *)in_ECX[0x12] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[0x12] + 0xc))(); if ((cVar1 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(in_ECX + 0x11); } } *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x4c); } ExceptionList = local_10; return; } //@@ 00a7cc60 FUN_00a7cc60 /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a7cc60(undefined4 param_1) { void *_Size; undefined4 uVar1; int iVar2; void *_Src; int *in_ECX; void *_Dst; void *pvStack_206bc; undefined1 auStack_206b8 [12]; int iStack_206ac; int iStack_206a8; int iStack_206a4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1451d; local_10 = ExceptionList; ExceptionList = &local_10; memset(auStack_206b8,0,0x2069c); local_8 = 0; organya_song_load(param_1); local_8 = 1; pvStack_206bc = operator_new(8); local_8._0_1_ = 2; if (pvStack_206bc == (void *)0x0) { uVar1 = 0; } else if (iStack_206a4 < iStack_206a8) { uVar1 = FUN_00a9f760(0); } else { iVar2 = 0; if (iStack_206a8 < 1) { iVar2 = iStack_206a8; } uVar1 = FUN_00a9f760((iStack_206a4 - iVar2) * iStack_206ac * 4); } local_8 = CONCAT31(local_8._1_3_,1); FUN_00a7b940(uVar1); pvStack_206bc = (void *)0x0; _Dst = *(void **)in_ECX[0x11]; _Src = (void *)org_render_samples(&pvStack_206bc); _Size = pvStack_206bc; while ((pvStack_206bc = _Size, _Src != (void *)0x0 && (_Size != (void *)0x0))) { memcpy(_Dst,_Src,(size_t)_Size); _Dst = (void *)((int)_Dst + (int)_Size); _Src = (void *)org_render_samples(&pvStack_206bc); _Size = pvStack_206bc; } *(undefined1 *)(in_ECX + 2) = 1; (**(code **)(*in_ECX + 4))(*(undefined4 *)in_ECX[0x11],((undefined4 *)in_ECX[0x11])[1]); FUN_00a7aa70(); ExceptionList = local_10; return 1; } //@@ 00a7cdd0 FUN_00a7cdd0 void FUN_00a7cdd0(undefined4 param_1) { KAGE_LogMessage(0x10,(byte *)"TODO: Unimplemented\n"); FUN_00a9f870(param_1); return; } //@@ 00a7ce00 FUN_00a7ce00 void FUN_00a7ce00(byte param_1) { char cVar1; uint uVar2; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = (int)KAGE::Sound::StreamSourceOrg::vftable; FUN_00a2ba90(in_ECX); if (*(code **)(*in_ECX + 0x38) == FUN_00a9fde0) { cVar1 = FUN_00a9fde0(); } else { cVar1 = (**(code **)(*in_ECX + 0x38))(uVar2); } if (cVar1 != '\0') { FUN_00a9fe40(); } FUN_00a7aa70(); in_ECX[0x81cf] = 0; in_ECX[0x81ce] = 0; FUN_00aa03e0(); FUN_00a7aa70(); local_8 = CONCAT31(local_8._1_3_,1); *in_ECX = (int)KAGE::Sound::StreamSourceBase::vftable; _eh_vector_destructor_iterator_(in_ECX + 0x17,0xc,4,FUN_00aa00b0); *in_ECX = (int)KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x20740); } ExceptionList = local_10; return; } //@@ 00a7cef0 FUN_00a7cef0 int FUN_00a7cef0(void *param_1) { void *_Src; int in_ECX; uint uVar1; void *pvVar2; uint _Size; int local_c; int local_8; uVar1 = 0x10000; local_c = 0; local_8 = 0; _Src = *(void **)(in_ECX + 0x20738); do { if ((_Src == (void *)0x0) || (pvVar2 = *(void **)(in_ECX + 0x2073c), pvVar2 == _Src)) { _Src = (void *)org_render_samples(&local_8); *(void **)(in_ECX + 0x20738) = _Src; pvVar2 = (void *)((int)_Src + local_8); *(void **)(in_ECX + 0x2073c) = pvVar2; if (local_8 == 0) { if (*(char *)(in_ECX + 9) != '\0') { FUN_00a7b4c0(*(undefined4 *)(in_ECX + 0xa4)); _Src = (void *)org_render_samples(&local_8); *(void **)(in_ECX + 0x20738) = _Src; pvVar2 = (void *)((int)_Src + local_8); *(void **)(in_ECX + 0x2073c) = pvVar2; } if (local_8 == 0) { return local_c; } } } _Size = (int)pvVar2 - (int)_Src; if (uVar1 <= (uint)((int)pvVar2 - (int)_Src)) { _Size = uVar1; } memcpy(param_1,_Src,_Size); *(int *)(in_ECX + 0x20738) = *(int *)(in_ECX + 0x20738) + _Size; local_c = local_c + _Size; param_1 = (void *)((int)param_1 + _Size); _Src = *(void **)(in_ECX + 0x20738); uVar1 = uVar1 - _Size; } while (uVar1 != 0); return local_c; } //@@ 00a7cfd0 FUN_00a7cfd0 void FUN_00a7cfd0(undefined4 param_1) { char cVar1; cVar1 = organya_song_load(param_1); if (cVar1 == '\0') { return; } FUN_00aa02b0(param_1); return; } //@@ 00a7d000 FUN_00a7d000 void FUN_00a7d000(void) { int in_ECX; FUN_00a7aa70(); *(undefined4 *)(in_ECX + 0x2073c) = 0; *(undefined4 *)(in_ECX + 0x20738) = 0; FUN_00aa03e0(); return; } //@@ 00a7d030 FUN_00a7d030 undefined4 FUN_00a7d030(void) { return 0xac44; } //@@ 00a7d040 FUN_00a7d040 void FUN_00a7d040(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x28); } return; } //@@ 00a7d070 FUN_00a7d070 void FUN_00a7d070(undefined8 param_1,undefined4 param_2) { int iVar1; undefined8 *puVar2; void *pvVar3; int in_ECX; uint count; int iVar4; uint uVar5; uVar5 = *(uint *)(in_ECX + 0x1c); count = *(uint *)(in_ECX + 0x24); if (uVar5 <= count + 1) { std_deque_growmap((void *)(in_ECX + 0x14),count); uVar5 = *(uint *)(in_ECX + 0x1c); count = *(uint *)(in_ECX + 0x24); } *(uint *)(in_ECX + 0x20) = *(uint *)(in_ECX + 0x20) & uVar5 - 1; iVar1 = (count + *(int *)(in_ECX + 0x20) & uVar5 - 1) * 4; iVar4 = *(int *)(in_ECX + 0x18); if (*(int *)(iVar4 + iVar1) == 0) { pvVar3 = operator_new(0xc); *(void **)(iVar1 + *(int *)(in_ECX + 0x18)) = pvVar3; iVar4 = *(int *)(in_ECX + 0x18); } puVar2 = *(undefined8 **)(iVar1 + iVar4); *puVar2 = param_1; *(undefined4 *)(puVar2 + 1) = param_2; *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 1; return; } //@@ 00a7d0e0 FUN_00a7d0e0 void FUN_00a7d0e0(undefined8 *param_1) { int *piVar1; int iVar2; undefined8 uVar3; undefined8 *puVar4; undefined4 uVar5; int in_ECX; puVar4 = *(undefined8 **) (*(int *)(in_ECX + 0x18) + (*(int *)(in_ECX + 0x1c) - 1U & *(uint *)(in_ECX + 0x20)) * 4 ); uVar3 = *puVar4; uVar5 = *(undefined4 *)(puVar4 + 1); piVar1 = (int *)(in_ECX + 0x24); *piVar1 = *piVar1 + -1; iVar2 = *piVar1; *param_1 = uVar3; *(undefined4 *)(param_1 + 1) = uVar5; if (iVar2 == 0) { *(undefined4 *)(in_ECX + 0x20) = 0; return; } *(int *)(in_ECX + 0x20) = *(int *)(in_ECX + 0x20) + 1; return; } //@@ 00a7d120 FUN_00a7d120 bool FUN_00a7d120(void) { int in_ECX; return *(int *)(in_ECX + 0x24) != 0; } //@@ 00a7d130 FUN_00a7d130 undefined1 FUN_00a7d130(void) { int in_ECX; *(undefined1 *)(in_ECX + 8) = 1; return 1; } //@@ 00a7d140 FUN_00a7d140 undefined4 FUN_00a7d140(int param_1) { int in_ECX; if (param_1 != 0) { *(undefined4 *)(param_1 + 4) = *(undefined4 *)(in_ECX + 4); *(undefined1 *)(param_1 + 8) = *(undefined1 *)(in_ECX + 8); } return 1; } //@@ 00a7d160 FUN_00a7d160 void FUN_00a7d160(void) { undefined8 uVar1; int iVar2; undefined8 *puVar3; void *ptr; uint uVar4; qword qVar5; int in_ECX; qword *pqVar6; int local_1c; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b01e90; local_10 = ExceptionList; ExceptionList = &local_10; if (*(void **)(in_ECX + 0xc) != (void *)0x0) { local_8 = 0; tracked_alloc(1,*(void **)(in_ECX + 0xc),0); *(undefined4 *)(in_ECX + 0xc) = 0; } iVar2 = *(int *)(in_ECX + 0x24); *(undefined4 *)(in_ECX + 0x10) = 0; while (iVar2 != 0) { puVar3 = *(undefined8 **) (*(int *)(in_ECX + 0x18) + (*(int *)(in_ECX + 0x1c) - 1U & *(uint *)(in_ECX + 0x20)) * 4); uVar1 = *puVar3; ptr = *(void **)(puVar3 + 1); *(int *)(in_ECX + 0x24) = iVar2 + -1; if (iVar2 + -1 == 0) { *(undefined4 *)(in_ECX + 0x20) = 0; } else { *(int *)(in_ECX + 0x20) = *(int *)(in_ECX + 0x20) + 1; } local_1c = (int)uVar1; if (local_1c != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar4 = *(uint *)(local_1c + -4); qVar5 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar4; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar5 < uVar4); free((void *)(local_1c + -4)); } if (ptr != (void *)0x0) { operator_delete(ptr,0); } iVar2 = *(int *)(in_ECX + 0x24); } *(undefined1 *)(in_ECX + 8) = 0; ExceptionList = local_10; return; } //@@ 00a7d250 FUN_00a7d250 void FUN_00a7d250(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 9) = param_1; return; } //@@ 00a7d260 FUN_00a7d260 void FUN_00a7d260(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Sound::ManagerOpenAL::vftable; KAGE::Thread::~Thread(in_ECX + 0x10); FUN_00a2af30(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x4c); } return; } //@@ 00a7d2a0 KAGE::Sound::ManagerOpenAL::Init /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: KAGE::Sound::ManagerOpenAL vtable slot 1 (RTTI); alcOpenDevice/alcCreateContext/alcMakeContextCurrent, 'Failed to open OpenAL device', starts the OpenAL processing thread; called from KAGE::System::Init and KAGE::Sound::Manager slot 1 (FUN_00a9e4f0) */ undefined4 KAGE::Sound::ManagerOpenAL::Init(void) { char cVar1; int iVar2; void *pvVar3; HMODULE hModule; int *in_ECX; undefined4 *puVar4; uint uVar5; WCHAR *lpFilename; char *format; DWORD nSize; undefined4 local_250; undefined4 uStack_24c; undefined1 *puStack_248; undefined4 uStack_244; undefined4 local_240; undefined4 local_23c; undefined4 local_238; undefined4 uStack_234; undefined4 uStack_230; undefined4 uStack_22c; undefined4 local_228; undefined4 local_224; undefined4 local_220; WCHAR local_21c [260]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1456a; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_21c + 0x10c); ExceptionList = &local_10; iVar2 = alcOpenDevice(0,local_14); in_ECX[0xe] = iVar2; if (iVar2 == 0) { format = "Failed to open OpenAL device\n"; } else { local_238 = 0x1991; uStack_234 = 0x1402; uStack_230 = 0x1990; uStack_22c = 0x1501; local_228 = 0x19ac; local_224 = 0x19ae; local_220 = 0; iVar2 = alcCreateContext(iVar2,&local_238); in_ECX[0xd] = iVar2; if (iVar2 == 0) { format = "Failed to create OpenAL context\n"; } else { cVar1 = alcMakeContextCurrent(iVar2); if (cVar1 == '\0') { format = "Failed to make current OpenAL context\n"; } else { alcProcessContext(in_ECX[0xd]); pvVar3 = operator_new_tracked(0x300); if (pvVar3 == (void *)0x0) { pvVar3 = (void *)0x0; } else { iVar2 = 0x40; puVar4 = (undefined4 *)((int)pvVar3 + 8); do { puVar4[-2] = 0; puVar4[-1] = 0; *puVar4 = 0; iVar2 = iVar2 + -1; puVar4 = puVar4 + 3; } while (iVar2 != 0); } local_8 = 0xffffffff; uVar5 = 0; in_ECX[0xf] = (int)pvVar3; do { cVar1 = (**(code **)(*in_ECX + 0x30))(in_ECX[0xf] + uVar5,in_ECX[0xf] + uVar5 + 4,1); if (cVar1 == '\0') { ExceptionList = local_10; return 0; } uVar5 = uVar5 + 0xc; } while (uVar5 < 0x300); alListener3f(0x1004,0,0,0); local_250 = 0; uStack_24c = 0; puStack_248 = &DAT_bf800000; uStack_244 = 0; local_240 = 0x3f800000; local_23c = 0; alListenerfv(0x100f,&local_250); cVar1 = (**(code **)(in_ECX[0x10] + 8))(FUN_00a7da80,3,0x1000); if (cVar1 != '\0') { nSize = 0x104; lpFilename = local_21c; hModule = GetModuleHandleW(L"OpenAL32.dll"); GetModuleFileNameW(hModule,lpFilename,nSize); KAGE_LogMessage(1,(byte *)"OpenAL DLL loaded from: %ls\n"); alcGetString(in_ECX[0xe],0x1006); alGetString(0xb001); KAGE_LogMessage(1,(byte *)"OpenAL AL_VENDOR : %s\n"); alGetString(0xb003); KAGE_LogMessage(1,(byte *)"OpenAL AL_RENDERER : %s\n"); alGetString(0xb002); KAGE_LogMessage(1,(byte *)"OpenAL AL_VERSION : %s\n"); KAGE_LogMessage(1,(byte *)"OpenAL ALC_EXTENSIONS : %s\n"); (**(code **)(in_ECX[4] + 4))(); (**(code **)(in_ECX[10] + 4))(); in_ECX[1] = in_ECX[1] | 1; g_soundReleaseFn = FUN_00a2bb10; ExceptionList = local_10; return 1; } format = "Failed to start up OpenAL processing thread\n"; } } } KAGE_LogMessage(8,(byte *)format); ExceptionList = local_10; return 0; } //@@ 00a7d550 FUN_00a7d550 void FUN_00a7d550(void) { qword qVar1; uint uVar2; int iVar3; int *in_ECX; qword *pqVar4; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; in_ECX[1] = in_ECX[1] | 4; (**(code **)(in_ECX[0x10] + 0xc))(uVar2); iVar3 = in_ECX[2]; g_soundReleaseFn = (void *)0x0; FUN_00a2bcb0(in_ECX + 2,*(undefined4 *)(iVar3 + 4)); *(int *)(iVar3 + 4) = iVar3; *(int *)iVar3 = iVar3; *(int *)(iVar3 + 8) = iVar3; in_ECX[3] = 0; (**(code **)(in_ECX[4] + 8))(); (**(code **)(in_ECX[10] + 8))(); in_ECX[1] = in_ECX[1] & 0xfffffffe; uVar2 = 0; do { (**(code **)(*in_ECX + 0x38))(in_ECX[0xf] + uVar2,in_ECX[0xf] + uVar2 + 4,1); uVar2 = uVar2 + 0xc; } while (uVar2 < 0x300); iVar3 = in_ECX[0xf]; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar2 = *(uint *)(iVar3 + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar2; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar2); free((void *)(iVar3 + -4)); local_8 = 0xffffffff; in_ECX[0xf] = 0; } iVar3 = alGetError(); if (iVar3 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered source shutdown. Error = %d\n"); } if (in_ECX[0xd] != 0) { alcMakeContextCurrent(0); alcDestroyContext(in_ECX[0xd]); in_ECX[0xd] = 0; } if (in_ECX[0xe] != 0) { alcCloseDevice(in_ECX[0xe]); in_ECX[0xe] = 0; } ExceptionList = local_10; return; } //@@ 00a7d690 FUN_00a7d690 void FUN_00a7d690(void) { char cVar1; int iVar2; int *in_ECX; if ((*(byte *)(in_ECX + 1) & 1) != 0) { cVar1 = (**(code **)(*in_ECX + 0x20))(); if (cVar1 == '\0') { in_ECX[1] = in_ECX[1] | 2; iVar2 = alGetError(); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered before suspend. Error = %d\n"); } (**(code **)(DAT_00c5aab0 + 0xc))(0xffffffff); alcMakeContextCurrent(0); (**(code **)(DAT_00c5aab0 + 0x10))(); iVar2 = alGetError(); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered after suspend. Error = %d\n"); } } } return; } //@@ 00a7d710 FUN_00a7d710 void FUN_00a7d710(void) { char cVar1; int iVar2; int *in_ECX; if ((*(byte *)(in_ECX + 1) & 1) != 0) { cVar1 = (**(code **)(*in_ECX + 0x20))(); if (cVar1 != '\0') { iVar2 = alGetError(); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered before resume. Error = %d\n"); } (**(code **)(DAT_00c5aab0 + 0xc))(0xffffffff); alcMakeContextCurrent(in_ECX[0xd]); (**(code **)(DAT_00c5aab0 + 0x10))(); iVar2 = alGetError(); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered after resume. Error = %d\n"); } in_ECX[1] = in_ECX[1] & 0xfffffffd; } } return; } //@@ 00a7d790 FUN_00a7d790 void FUN_00a7d790(void *param_1) { void *pvVar1; char cVar2; uint uVar3; void *pvVar4; int in_ECX; uint uVar5; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar4 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (param_1 != (void *)0x0) { uVar5 = 0; do { pvVar1 = *(void **)(uVar5 + 8 + *(int *)(in_ECX + 0x3c)); if (pvVar1 == pvVar4) { *(undefined4 *)((int)pvVar1 + 0x34) = 0; *(undefined4 *)(uVar5 + 8 + *(int *)(in_ECX + 0x3c)) = 0; alSourceStop(*(undefined4 *)(uVar5 + *(int *)(in_ECX + 0x3c)),uVar3); alSourcei(*(undefined4 *)(uVar5 + *(int *)(in_ECX + 0x3c)),0x1009,0); } uVar5 = uVar5 + 0xc; } while (uVar5 < 0x300); } if ((*(byte *)(in_ECX + 4) & 1) == 0) { KAGE_LogMessage(0x10,(byte *)"Sound manager has not been initialized\n"); } if (pvVar4 != (void *)0x0) { (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff); local_14 = *(undefined4 *)((int)pvVar4 + 0x10); FUN_00a12280(¶m_1,&local_14); if (param_1 != *(void **)(in_ECX + 8)) { do { if (*(int *)((int)*(void **)((int)param_1 + 0x14) + 0x10) != *(int *)((int)pvVar4 + 0x10)) break; if (*(void **)((int)param_1 + 0x14) == pvVar4) { pvVar4 = std_tree_extract((void *)(in_ECX + 8),param_1); local_8 = 0; if (((*(int **)((int)pvVar4 + 0x18) != (int *)0x0) && (cVar2 = (**(code **)(**(int **)((int)pvVar4 + 0x18) + 0xc))(), cVar2 != '\0')) && (g_soundReleaseFn != (void *)0x0)) { (*g_soundReleaseFn)((int)pvVar4 + 0x14); } local_8 = 0xffffffff; operator_delete(pvVar4,0x1c); break; } std:: _Tree_unchecked_const_iterator_>,std::_Iterator_base0> ::operator++((_Tree_unchecked_const_iterator_>,std::_Iterator_base0> *)¶m_1); } while (param_1 != *(void **)(in_ECX + 8)); } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a7d8e0 FUN_00a7d8e0 uint FUN_00a7d8e0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { int iVar1; uint extraout_EAX; uint uVar2; alGenSources(1,param_1); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered when creating source object. Error = %d\n"); return extraout_EAX & 0xffffff00; } alGenBuffers(param_3,param_2); iVar1 = alGetError(); if (iVar1 == 0) { return 1; } KAGE_LogMessage(8,(byte *)"OpenAL error encountered when creating buffer object. Error = %d\n"); uVar2 = alDeleteSources(1,param_1); return uVar2 & 0xffffff00; } //@@ 00a7d960 FUN_00a7d960 bool FUN_00a7d960(undefined4 *param_1,undefined4 *param_2,undefined4 param_3) { int iVar1; int in_ECX; int iVar2; uint uVar3; int iVar4; int local_8; iVar4 = 0; uVar3 = 0; local_8 = in_ECX; while( true ) { alGetSourcei(*(undefined4 *)(*(int *)(in_ECX + 0x3c) + uVar3),0x1010,&local_8); if ((local_8 != 0x1012) && (local_8 != 0x1013)) break; uVar3 = uVar3 + 0xc; iVar4 = iVar4 + 1; if (0x2ff < uVar3) { return false; } } iVar2 = *(int *)(in_ECX + 0x3c); iVar1 = *(int *)(iVar2 + 8 + iVar4 * 0xc); if ((iVar1 != 0) && (*(int *)(iVar1 + 0x34) == *(int *)(iVar2 + iVar4 * 0xc))) { *(undefined4 *)(iVar1 + 0x34) = 0; iVar2 = *(int *)(in_ECX + 0x3c); } alSourceStop(*(undefined4 *)(iVar2 + iVar4 * 0xc)); alSourcei(*(undefined4 *)(*(int *)(in_ECX + 0x3c) + iVar4 * 0xc),0x1009,0); *(undefined4 *)(*(int *)(in_ECX + 0x3c) + 8 + iVar4 * 0xc) = param_3; *param_1 = *(undefined4 *)(*(int *)(in_ECX + 0x3c) + iVar4 * 0xc); *param_2 = *(undefined4 *)(*(int *)(in_ECX + 0x3c) + 4 + iVar4 * 0xc); iVar4 = alGetError(); if (iVar4 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered when assigning source data. Error = %d\n"); } return iVar4 == 0; } //@@ 00a7da40 FUN_00a7da40 void FUN_00a7da40(undefined4 *param_1,void *param_2,int param_3) { alDeleteSources(1,param_1); alDeleteBuffers(param_3,param_2); *param_1 = 0; memset(param_2,0,param_3 * 4); return; } //@@ 00a7da80 FUN_00a7da80 void FUN_00a7da80(int *param_1) { byte bVar1; char cVar2; bVar1 = *(byte *)(param_1 + 1); while ((bVar1 & 4) == 0) { cVar2 = (**(code **)(*param_1 + 0x20))(); if (cVar2 == '\0') { (**(code **)(*param_1 + 0x3c))(); } Sleep(5); bVar1 = *(byte *)(param_1 + 1); } return; } //@@ 00a7dac0 FUN_00a7dac0 void FUN_00a7dac0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Sound::ManagerOpenAL::vftable; KAGE::Thread::~Thread(in_ECX + 0x10); FUN_00a2af30(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,100); } return; } //@@ 00a7db00 FUN_00a7db00 void FUN_00a7db00(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::System::LeaderboardManager::vftable; FUN_00a516c0(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x34); } return; } //@@ 00a7db30 FUN_00a7db30 undefined4 FUN_00a7db30(void) { int *piVar1; int in_ECX; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*piVar1 != 0) { piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar1 != 0) { if ((*(byte *)(in_ECX + 4) & 1) == 0) { (**(code **)(*(int *)(in_ECX + 0x10) + 4))(); (**(code **)(*(int *)(in_ECX + 0x24) + 4))(); *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; } return 1; } } return 0; } //@@ 00a7db80 FUN_00a7db80 undefined4 FUN_00a7db80(undefined4 *param_1) { code *pcVar1; int *piVar2; int iVar3; undefined4 *puVar4; int iVar5; undefined4 *puVar6; int in_ECX; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 extraout_ECX_01; undefined4 extraout_ECX_02; undefined4 extraout_ECX_03; double dVar7; undefined8 uVar8; longlong lVar9; double dVar10; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*piVar2 == 0) { return 0; } iVar3 = FUN_00a51d10(param_1[1]); param_1[4] = param_1; puVar4 = param_1 + 4; switch(*param_1) { case 0: puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); uVar8 = (**(code **)(*(int *)*puVar6 + 0x58))(param_1[0x28]); FUN_00a7e360(uVar8,puVar4,extraout_ECX); return 1; case 1: iVar3 = param_1[0x2a]; puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); uVar8 = (**(code **)(*(int *)*puVar6 + 0x54))(param_1[0x28],2 - (uint)(iVar3 != 0),1); FUN_00a7e360(uVar8,puVar4,extraout_ECX_00); return 1; case 2: if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Leaderboard data is not valid\n"); } puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); lVar9 = (**(code **)(*(int *)*puVar6 + 0x78)) (*(undefined4 *)(iVar3 + 0x10),*(undefined4 *)(iVar3 + 0x14),1,param_1[0x28], param_1[0x2a],*(uint *)(in_ECX + 0x30) >> 2); puVar6 = param_1 + 0xe; if (param_1[0x12] != 0 || param_1[0x13] != 0) { SteamAPI_UnregisterCallResult(puVar6,param_1[0x12],param_1[0x13]); } param_1[0x15] = FUN_00a7e2b0; break; case 3: if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Leaderboard data is not valid\n"); } puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); uVar8 = (**(code **)(*(int *)*puVar6 + 0x6c)) (*(undefined4 *)(iVar3 + 0x10),*(undefined4 *)(iVar3 + 0x14),0,param_1[0x28], param_1[0x2a]); FUN_00a7e3b0(uVar8,puVar4,extraout_ECX_01); return 1; case 4: if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Leaderboard data is not valid\n"); } iVar5 = param_1[0x28]; dVar7 = __uint_to_double_fixup[-(iVar5 >> 0x1f)]; puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); dVar7 = (double)((float)((double)iVar5 + dVar7) * 0.5); pcVar1 = *(code **)(*(int *)*puVar4 + 0x6c); dVar10 = ceil(dVar7); iVar5 = (int)dVar10; dVar7 = floor(dVar7); uVar8 = (*pcVar1)(*(undefined4 *)(iVar3 + 0x10),*(undefined4 *)(iVar3 + 0x14),1,-(int)dVar7, iVar5); FUN_00a7e3b0(uVar8,param_1 + 4,extraout_ECX_02); return 1; case 5: if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Leaderboard data is not valid\n"); } puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); uVar8 = (**(code **)(*(int *)*puVar6 + 0x6c)) (*(undefined4 *)(iVar3 + 0x10),*(undefined4 *)(iVar3 + 0x14),2,0xffffffff, 0xffffffff); FUN_00a7e3b0(uVar8,puVar4,extraout_ECX_03); return 1; case 6: if (iVar3 == 0) { KAGE_LogMessage(0x10,(byte *)"Leaderboard data is not valid\n"); } puVar6 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); lVar9 = (**(code **)(*(int *)*puVar6 + 0x7c)) (*(undefined4 *)(iVar3 + 0x10),*(undefined4 *)(iVar3 + 0x14),param_1[0x28], param_1[0x29]); puVar6 = param_1 + 0x1e; if (param_1[0x22] != 0 || param_1[0x23] != 0) { SteamAPI_UnregisterCallResult(puVar6,param_1[0x22],param_1[0x23]); } param_1[0x25] = FUN_00a7e330; break; default: KAGE_LogMessage(0x10,(byte *)"Unknown task type\n"); return 0; } puVar6[6] = puVar4; *(longlong *)(puVar6 + 4) = lVar9; if (lVar9 != 0) { SteamAPI_RegisterCallResult(puVar6,lVar9); } return 1; } //@@ 00a7df10 steam_leaderboard_scores_downloaded /* DB: ? Steam LeaderboardScoresDownloaded_t handler (hSteamLeaderboardEntries +8, cEntryCount +0x10): allocates 0x28-byte entries at request+0xa0 (count +0xa8), ISteamUserStats::GetDownloadedLeaderboardEntry (+0x74) with details buffer DAT_00c5ab40, UserProfile::find_or_create + avatar per entry, then FUN_00a51dc0 completes ("Failed to get leaderboard '%s'"); caller 00a7e310 */ void steam_leaderboard_scores_downloaded(int param_1,undefined4 param_2,void *param_3) { int iVar1; int iVar2; qword qVar3; uint uVar4; void *_Dst; undefined4 *puVar5; int extraout_EAX; qword *pqVar6; uint uVar7; int iVar8; uint *puVar9; uint uVar10; undefined4 local_50; undefined4 local_4c; undefined4 local_48; undefined4 local_44; undefined4 local_38; undefined4 local_34; undefined4 local_30; undefined4 local_2c; undefined **local_24; int local_20; uint local_1c; uint *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b145da; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; uVar10 = *(uint *)(param_1 + 0x10); uVar7 = -(uint)((int)((ulonglong)uVar10 * 0x28 >> 0x20) != 0) | (uint)((ulonglong)uVar10 * 0x28); local_1c = uVar10; local_18 = operator_new_tracked(-(uint)(0xfffffffb < uVar7) | uVar7 + 4); local_8 = 0; if (local_18 == (uint *)0x0) { puVar9 = (uint *)0x0; } else { puVar9 = local_18 + 1; *local_18 = uVar10; _eh_vector_constructor_iterator_ (puVar9,0x28,uVar10,(_func_void_void_ptr *)&LAB_00a514c0,FUN_00a51500); } iVar8 = 0; *(uint **)((int)param_3 + 0xa0) = puVar9; *(uint *)((int)param_3 + 0xa8) = uVar10; if (0 < (int)uVar10) { local_18 = (uint *)0x0; do { puVar9 = local_18; uVar10 = DAT_00c5ab40; local_8 = 0xffffffff; iVar1 = *(int *)((int)param_3 + 0xa0); local_4c = 0; local_50 = 0; if (DAT_00c5ab40 != 0) { iVar2 = *(int *)((int)local_18 + iVar1 + 0x10); if (iVar2 != 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } uVar7 = *(uint *)(iVar2 + -4); qVar3 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 - uVar7; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) - (uint)((uint)qVar3 < uVar7); free((void *)(iVar2 + -4)); *(undefined4 *)((int)puVar9 + iVar1 + 0x10) = 0; } local_8 = 0xffffffff; *(uint *)((int)puVar9 + iVar1 + 0x14) = uVar10; _Dst = operator_new_tracked(uVar10); *(void **)((int)puVar9 + iVar1 + 0x10) = _Dst; memset(_Dst,0,*(size_t *)((int)puVar9 + iVar1 + 0x14)); } puVar5 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8,uVar4); (**(code **)(*(int *)*puVar5 + 0x74)) (*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc),iVar8,&local_50, *(undefined4 *)((int)puVar9 + iVar1 + 0x10), *(uint *)((int)puVar9 + iVar1 + 0x14) >> 2); uVar10 = DAT_00c5ab14 & 2; local_2c = local_4c; local_30 = local_50; local_24 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(&local_30); local_8 = 2; local_24 = KAGE::System::UserProfile::vftable; local_20 = extraout_EAX; if ((((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (uVar10 != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(&local_24); } iVar8 = iVar8 + 1; *(int *)((int)puVar9 + iVar1 + 4) = local_20; *(undefined4 *)((int)puVar9 + iVar1 + 8) = local_48; *(undefined4 *)((int)puVar9 + iVar1 + 0xc) = local_44; *(undefined4 *)((int)puVar9 + iVar1 + 0x18) = local_38; local_18 = local_18 + 10; *(undefined4 *)((int)puVar9 + iVar1 + 0x1c) = local_34; local_24 = KAGE::System::UserProfileBase::vftable; } while (iVar8 < (int)local_1c); } local_8 = 0xffffffff; leaderboard_request_complete(param_3); ExceptionList = local_10; return; } //@@ 00a7e120 FUN_00a7e120 void FUN_00a7e120(undefined4 *param_1) { char cVar1; void *request; qword qVar2; undefined4 *puVar3; undefined4 *puVar4; char *_Source; int iVar5; undefined4 uVar6; undefined4 *in_ECX; char *pcVar7; qword *pqVar8; char *_Dest; request = (void *)*in_ECX; if (*(char *)(param_1 + 2) == '\0') { *(undefined4 *)((int)request + 0xa8) = 0; *(char **)((int)request + 0x98) = "Leaderboard not found"; leaderboard_request_complete(request); return; } if (g_mainHeap == (void *)0x0) { pqVar8 = &g_allocatedBytesNoHeap; } else { pqVar8 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x1c); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar2 = *pqVar8; *(uint *)pqVar8 = (uint)*pqVar8 + 0x1c; *puVar3 = 0x1c; *(uint *)((int)pqVar8 + 4) = *(uint *)((int)pqVar8 + 4) + (uint)(0xffffffe3 < (uint)qVar2); puVar4 = puVar3 + 1; if (puVar4 != (undefined4 *)0x0) { puVar3[2] = 0; puVar3[3] = 2; puVar3[4] = 0; goto LAB_00a7e187; } } puVar4 = (undefined4 *)0x0; LAB_00a7e187: *(undefined4 **)((int)request + 0xa8) = puVar4; puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); _Source = (char *)(**(code **)(*(int *)*puVar3 + 0x5c))(*param_1,param_1[1]); if (_Source == (char *)0x0) { _Dest = (char *)0x0; } else { pcVar7 = _Source; do { cVar1 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar7 + (1 - (int)(_Source + 1)))); pcVar7 = _Source; do { cVar1 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar1 != '\0'); strncpy(_Dest,_Source,(size_t)(pcVar7 + (1 - (int)(_Source + 1)))); } *(char **)(*(int *)((int)request + 0xa8) + 4) = _Dest; puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); iVar5 = (**(code **)(*(int *)*puVar3 + 100))(*param_1,param_1[1]); if (iVar5 == 1) { *(undefined4 *)(*(int *)((int)request + 0xa8) + 8) = 1; } else if (iVar5 == 2) { *(undefined4 *)(*(int *)((int)request + 0xa8) + 8) = 0; } puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); uVar6 = (**(code **)(*(int *)*puVar3 + 0x60))(*param_1,param_1[1]); *(undefined4 *)(*(int *)((int)request + 0xa8) + 0xc) = uVar6; iVar5 = *(int *)((int)request + 0xa8); uVar6 = param_1[1]; *(undefined4 *)(iVar5 + 0x10) = *param_1; *(undefined4 *)(iVar5 + 0x14) = uVar6; leaderboard_request_complete(request); return; } //@@ 00a7e2b0 FUN_00a7e2b0 void FUN_00a7e2b0(char *param_1) { void *request; uint uVar1; int iVar2; undefined4 *in_ECX; request = (void *)*in_ECX; if (*param_1 == '\0') { *(char **)((int)request + 0x98) = "Operation failed"; leaderboard_request_complete(request); return; } uVar1 = *(uint *)(param_1 + 0x1c); iVar2 = *(int *)(param_1 + 0x18); *(int *)((int)request + 0xa0) = iVar2; *(uint *)((int)request + 0xa4) = uVar1 | iVar2 >> 0x1f; leaderboard_request_complete(request); return; } //@@ 00a7e310 FUN_00a7e310 void FUN_00a7e310(undefined4 param_1) { undefined4 *in_ECX; steam_leaderboard_scores_downloaded(param_1,in_ECX,*in_ECX); return; } //@@ 00a7e330 FUN_00a7e330 void FUN_00a7e330(int *param_1,char param_2) { void *request; undefined4 *in_ECX; request = (void *)*in_ECX; if ((param_2 != '\0') || (*param_1 != 1)) { *(char **)((int)request + 0x98) = "Operation failed"; } leaderboard_request_complete(request); return; } //@@ 00a7e360 FUN_00a7e360 void FUN_00a7e360(int param_1,int param_2,undefined4 param_3) { int in_ECX; if (*(int *)(in_ECX + 0x10) != 0 || *(int *)(in_ECX + 0x14) != 0) { SteamAPI_UnregisterCallResult(); } *(undefined4 *)(in_ECX + 0x18) = param_3; *(int *)(in_ECX + 0x10) = param_1; *(int *)(in_ECX + 0x14) = param_2; *(code **)(in_ECX + 0x1c) = FUN_00a7e120; if (param_1 != 0 || param_2 != 0) { SteamAPI_RegisterCallResult(); } return; } //@@ 00a7e3b0 FUN_00a7e3b0 void FUN_00a7e3b0(int param_1,int param_2,undefined4 param_3) { int in_ECX; if (*(int *)(in_ECX + 0x10) != 0 || *(int *)(in_ECX + 0x14) != 0) { SteamAPI_UnregisterCallResult(); } *(undefined4 *)(in_ECX + 0x18) = param_3; *(int *)(in_ECX + 0x10) = param_1; *(int *)(in_ECX + 0x14) = param_2; *(code **)(in_ECX + 0x1c) = FUN_00a7e310; if (param_1 != 0 || param_2 != 0) { SteamAPI_RegisterCallResult(); } return; } //@@ 00a7e400 FUN_00a7e400 uint FUN_00a7e400(void) { int iVar1; uint uVar2; uVar2 = 0; if (DAT_00c78d98 != 0) { do { iVar1 = _stricmp(*(char **)(DAT_00c78d94 + uVar2 * 4),"+connect_lobby"); if (iVar1 == 0) { return uVar2; } uVar2 = uVar2 + 1; } while (uVar2 < DAT_00c78d98); } return 0xffffffff; } //@@ 00a7e440 FUN_00a7e440 void FUN_00a7e440(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::EosFriendManager::vftable; in_ECX[8] = 0; in_ECX[9] = 0; std::vector::_Tidy(); FUN_00a7f0a0(); operator_delete((void *)in_ECX[2],0x10); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x38); } return; } //@@ 00a7e490 FUN_00a7e490 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00a7e490(uint param_1) { uint uVar1; int iVar2; char cVar3; uint uVar4; byte *pbVar5; undefined4 extraout_ECX; byte bVar6; int *ptr; undefined1 local_24 [8]; int local_1c; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar2 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b1460d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; uVar1 = *(uint *)(param_1 + 8); param_1 = uVar1; _Find_lower_bound<>(local_24,¶m_1); if (((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= uVar1)) && (local_1c != DAT_00c5ac10)) { FUN_00a23df0(local_1c + 0x14); } else { KAGE::SmartPointer::SmartPointer(extraout_ECX); } local_8 = 0; if (local_18 != 0) { pbVar5 = (byte *)FUN_00a23bb0(uVar4); bVar6 = *pbVar5 | 2; if (*(int *)(iVar2 + 0x10) != 3) { bVar6 = *pbVar5 & 0xfd; } *pbVar5 = bVar6; if (*(int *)(iVar2 + 0x10) == 3) { FUN_00a7f010(&local_18); } else if ((*(int *)(iVar2 + 0xc) == 3) && (ptr = (int *)*DAT_00c5ab90, ptr != DAT_00c5ab90)) { do { if ((*(int *)(ptr[2] + 8) == *(int *)(local_18 + 8)) && (*(int *)(ptr[2] + 0xc) == *(int *)(local_18 + 0xc))) { *(int *)ptr[1] = *ptr; *(int *)(*ptr + 4) = ptr[1]; _DAT_00c5ab94 = _DAT_00c5ab94 + -1; local_8 = CONCAT31(local_8._1_3_,1); if (((int *)ptr[3] != (int *)0x0) && ((cVar3 = (**(code **)(*(int *)ptr[3] + 0xc))(), cVar3 != '\0' && (g_profileReleaseFn != (void *)0x0)))) { (*g_profileReleaseFn)(ptr + 2); } operator_delete(ptr,0x10); break; } ptr = (int *)*ptr; } while (ptr != DAT_00c5ab90); } } local_8 = 2; if (((local_14 != (int *)0x0) && (cVar3 = (**(code **)(*local_14 + 0xc))(), cVar3 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_18); } ExceptionList = local_10; return; } //@@ 00a7e600 FUN_00a7e600 void FUN_00a7e600(uint param_1) { uint uVar1; int iVar2; char cVar3; uint uVar4; byte *pbVar5; byte bVar6; undefined4 extraout_ECX; undefined1 local_24 [8]; int local_1c; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; iVar2 = param_1; local_8 = 0xffffffff; puStack_c = &LAB_00b1463d; local_10 = ExceptionList; uVar4 = __security_cookie ^ (uint)(local_24 + 0x20); ExceptionList = &local_10; uVar1 = *(uint *)(param_1 + 8); param_1 = uVar1; _Find_lower_bound<>(local_24,¶m_1); if (((*(char *)(local_1c + 0xd) == '\0') && (*(uint *)(local_1c + 0x10) <= uVar1)) && (local_1c != DAT_00c5ac10)) { FUN_00a23df0(local_1c + 0x14); } else { KAGE::SmartPointer::SmartPointer(extraout_ECX); } local_8 = 0; if (local_18 != 0) { pbVar5 = (byte *)FUN_00a23bb0(uVar4); if (*(int *)(iVar2 + 0xc) == 0) { bVar6 = *pbVar5 & 0xfb; } else { bVar6 = *pbVar5 | 4; } *pbVar5 = bVar6; } local_8 = 1; if (local_14 != (int *)0x0) { cVar3 = (**(code **)(*local_14 + 0xc))(); if ((cVar3 != '\0') && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_18); } } ExceptionList = local_10; return; } //@@ 00a7e6e0 eos_friend_lobby_search_start /* DB: ? EOS glue (ECX = unnamed lobby-search object, friend list at +8/+0xc): for each friend with presence (_EOS_Platform_GetPresenceInterface, _EOS_Presence_HasPresence/CopyPresence) reads "KAGE_PRESENCE_LOBBY_ID", creates a lobby search per friend; strings "Failed to copy friend presence info: %s", "Failed to create friend lobby search handle: %s", "Failed to set lobby ID for friend lobby search: %s"; called from FUN_00a57060 (friends-only lobby mode) */ undefined4 eos_friend_lobby_search_start(void) { byte bVar1; qword qVar2; int iVar3; undefined4 uVar4; uint uVar5; undefined4 *puVar6; int in_ECX; undefined4 unaff_EBX; byte *pbVar7; int unaff_ESI; int *piVar8; undefined4 unaff_EDI; qword *pqVar9; undefined4 *puVar10; bool bVar11; char *pcVar12; int local_50; undefined4 uStack_4c; undefined1 auStack_48 [4]; byte *pbStack_44; undefined4 uStack_40; byte *local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 uStack_14; undefined4 uStack_10; undefined4 uStack_c; pbVar7 = (byte *)(in_ECX + 0x14); *(undefined4 *)(in_ECX + 0x10) = 0; local_3c = pbVar7; FUN_00a57a10(); *(undefined4 *)(in_ECX + 0x18) = *(undefined4 *)pbVar7; if (*(int *)(in_ECX + 0xc) != 0) { piVar8 = (int *)**(int **)(in_ECX + 8); local_50 = in_ECX; if (piVar8 != *(int **)(in_ECX + 8)) { do { iVar3 = FUN_00a6f680(); if (iVar3 != 0) { local_1c = DAT_00c5abfc; local_20 = 1; local_18 = *(undefined4 *)(piVar8[2] + 0x14); uVar4 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&local_20); iVar3 = _EOS_Presence_HasPresence_8(uVar4); if (iVar3 != 0) { pbVar7 = &s_empty; uStack_10 = DAT_00c5abfc; uStack_4c = 0; uStack_14 = 3; pbStack_44 = &s_empty; uStack_c = *(undefined4 *)(piVar8[2] + 0x14); uVar4 = _EOS_Platform_GetPresenceInterface_4(g_eosPlatform,&uStack_14,&uStack_4c); iVar3 = _EOS_Presence_CopyPresence_12(uVar4); if (iVar3 == 0) { iVar3 = 0; if (*(int *)(unaff_ESI + 0x1c) < 1) { LAB_00a7e885: _EOS_Presence_Info_Release_4(unaff_ESI); if (pbVar7 == (byte *)0x0) goto LAB_00a7e7df; } else { local_50 = *(int *)(unaff_ESI + 0x20); puVar6 = (undefined4 *)(local_50 + 4); do { pbVar7 = (byte *)*puVar6; pcVar12 = "KAGE_PRESENCE_LOBBY_ID"; do { bVar1 = *pbVar7; bVar11 = bVar1 < (byte)*pcVar12; if (bVar1 != *pcVar12) { LAB_00a7e857: uVar5 = -(uint)bVar11 | 1; goto LAB_00a7e85c; } if (bVar1 == 0) break; bVar1 = pbVar7[1]; bVar11 = bVar1 < (byte)pcVar12[1]; if (bVar1 != pcVar12[1]) goto LAB_00a7e857; pbVar7 = pbVar7 + 2; pcVar12 = pcVar12 + 2; } while (bVar1 != 0); uVar5 = 0; LAB_00a7e85c: if (uVar5 == 0) { pbVar7 = *(byte **)(local_50 + 8 + iVar3 * 0xc); goto LAB_00a7e885; } iVar3 = iVar3 + 1; puVar6 = puVar6 + 3; } while (iVar3 < *(int *)(unaff_ESI + 0x1c)); _EOS_Presence_Info_Release_4(unaff_ESI); pbVar7 = pbStack_44; } if (*pbVar7 == 0) goto LAB_00a7e7df; uStack_38 = 1; uStack_34 = 1; uVar4 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&uStack_38,auStack_48); iVar3 = _EOS_Lobby_CreateLobbySearch_12(uVar4); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); pcVar12 = "Failed to create friend lobby search handle: %s\n"; goto LAB_00a7e7d1; } if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } puVar6 = malloc(0x14); if (puVar6 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); LAB_00a7e90d: puVar10 = (undefined4 *)0x0; } else { *puVar6 = 0x14; qVar2 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 + 0x14; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) + (uint)(0xffffffeb < (uint)qVar2); puVar10 = puVar6 + 1; if (puVar10 == (undefined4 *)0x0) goto LAB_00a7e90d; puVar6[2] = 0; puVar6[3] = 0; } *puVar10 = unaff_EDI; KAGE::SmartPointer::operator_assign(piVar8 + 2); puVar10[3] = unaff_EBX; uStack_40 = 1; local_3c = pbVar7; iVar3 = _EOS_LobbySearch_SetLobbyId_8(unaff_EBX,&uStack_40); if (iVar3 == 0) { local_3c = g_eosLocalUserId; uStack_40 = 1; _EOS_LobbySearch_Find_16(unaff_EDI,&uStack_40,puVar10,&LAB_00a7ec80); *(int *)(local_50 + 0x10) = *(int *)(local_50 + 0x10) + 1; goto LAB_00a7e7df; } _EOS_EResult_ToString_4(iVar3); pcVar12 = "Failed to set lobby ID for friend lobby search: %s\n"; } else { _EOS_EResult_ToString_4(iVar3); pcVar12 = "Failed to copy friend presence info: %s\n"; } LAB_00a7e7d1: KAGE_LogMessage(8,(byte *)pcVar12); } } LAB_00a7e7df: piVar8 = (int *)*piVar8; } while (piVar8 != (int *)*(int *)(local_50 + 8)); pbVar7 = local_3c; } if (*(int *)(local_50 + 0x10) != 0) { *(code **)(local_50 + 0x20) = FUN_00a575c0; *(undefined4 *)(local_50 + 0x24) = 0; return 1; } } FUN_00a575c0(pbVar7,0); return 0; } //@@ 00a7e9d0 FUN_00a7e9d0 void FUN_00a7e9d0(int *param_1) { undefined4 *puVar1; char cVar2; undefined4 uVar3; void *pvVar4; int iVar5; int *piVar6; int iVar7; code *pcVar8; int *piVar9; undefined4 uStack_44; int iStack_40; int iStack_3c; undefined4 local_38; int local_34; int local_30; undefined4 local_2c; int *local_28; int *local_24; int *local_20; int local_1c; int local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; pcVar8 = _EOS_Platform_GetFriendsInterface_4_exref; local_8 = 0xffffffff; puStack_c = &LAB_00b14675; local_10 = ExceptionList; ExceptionList = &local_10; iVar7 = param_1[1]; local_1c = iVar7; if (*param_1 == 0) { local_28 = (int *)param_1[2]; local_2c = 1; uVar3 = _EOS_Platform_GetFriendsInterface_4(g_eosPlatform,&local_2c); local_18 = _EOS_Friends_GetFriendsCount_8(uVar3); piVar9 = (int *)(iVar7 + 8); FUN_00a7f0a0(); local_38 = 1; local_30 = 0; *(int *)*piVar9 = *piVar9; *(int *)(*piVar9 + 4) = *piVar9; *(undefined4 *)(iVar7 + 0xc) = 0; local_34 = param_1[2]; if (0 < local_18) { do { uVar3 = (*pcVar8)(g_eosPlatform,&local_38); pvVar4 = (void *)_EOS_Friends_GetFriendAtIndex_8(uVar3); iVar5 = _EOS_EpicAccountId_IsValid_4(pvVar4); if (iVar5 == 0) { KAGE_LogMessage(8,(byte *) "Failed to retrieve friend at index %d from EOS: Friend user profile is invalid\n" ); } else { GridEntity_Door::play_animation ((GridEntity_Door *)&DAT_00c5ac08,&local_2c,(void *)0x0,pvVar4,2); local_8 = 0; iVar5 = *piVar9; if (*(int *)(iVar7 + 0xc) == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 1; local_20 = (int *)0x0; local_24 = piVar9; piVar6 = operator_new(0x10); local_20 = piVar6; FUN_00a23df0(&local_2c); *(int *)(iVar7 + 0xc) = *(int *)(iVar7 + 0xc) + 1; puVar1 = *(undefined4 **)(iVar5 + 4); *piVar6 = iVar5; piVar6[1] = (int)puVar1; *(int **)(iVar5 + 4) = piVar6; local_20 = (int *)0x0; *puVar1 = piVar6; local_8 = 3; if (((local_28 != (int *)0x0) && (cVar2 = (**(code **)(*local_28 + 0xc))(), cVar2 != '\0') ) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_2c); } local_8 = 0xffffffff; } local_30 = local_30 + 1; pcVar8 = _EOS_Platform_GetFriendsInterface_4_exref; } while (local_30 < local_18); } KAGE_LogMessage(1,(byte *)"Successfully retrieved list of %d friends from EOS\n"); local_28 = (int *)param_1[2]; local_2c = 1; uVar3 = (*pcVar8)(g_eosPlatform,&local_2c); iVar7 = _EOS_Friends_GetBlockedUsersCount_8(uVar3); iStack_40 = param_1[2]; uStack_44 = 1; iStack_3c = 0; if (0 < iVar7) { do { uVar3 = (*pcVar8)(g_eosPlatform,&uStack_44); pvVar4 = (void *)_EOS_Friends_GetBlockedUserAtIndex_8(uVar3); iVar5 = _EOS_EpicAccountId_IsValid_4(pvVar4); if (iVar5 != 0) { GridEntity_Door::play_animation ((GridEntity_Door *)&DAT_00c5ac08,&local_24,(void *)0x0,pvVar4,4); local_8 = 4; if (((local_20 != (int *)0x0) && (cVar2 = (**(code **)(*local_20 + 0xc))(), cVar2 != '\0') ) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_24); } local_8 = 0xffffffff; } iStack_3c = iStack_3c + 1; pcVar8 = _EOS_Platform_GetFriendsInterface_4_exref; } while (iStack_3c < iVar7); ExceptionList = local_10; return; } } else { _EOS_EResult_ToString_4(*param_1,__security_cookie ^ (int)register0x00000010 - 4U); KAGE_LogMessage(8,(byte *)"Failed to retrieve friends list from EOS: %s\n"); } ExceptionList = local_10; return; } //@@ 00a7f010 FUN_00a7f010 void FUN_00a7f010(undefined4 param_1) { int iVar1; undefined4 *puVar2; int *piVar3; int *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b11ffd; local_10 = ExceptionList; ExceptionList = &local_10; iVar1 = *in_ECX; if (in_ECX[1] == 0xfffffff) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar3 = operator_new(0x10); FUN_00a23df0(param_1); in_ECX[1] = in_ECX[1] + 1; puVar2 = *(undefined4 **)(iVar1 + 4); *piVar3 = iVar1; piVar3[1] = (int)puVar2; *(int **)(iVar1 + 4) = piVar3; *puVar2 = piVar3; ExceptionList = local_10; return; } //@@ 00a7f0a0 FUN_00a7f0a0 void FUN_00a7f0a0(void) { undefined4 *puVar1; undefined4 *ptr; char cVar2; uint uVar3; undefined4 *in_EDX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_10 = ExceptionList; puStack_c = &LAB_00af1360; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)in_EDX[1] = 0; ptr = (undefined4 *)*in_EDX; while (ptr != (undefined4 *)0x0) { puVar1 = (undefined4 *)*ptr; local_8 = 0; if ((((int *)ptr[3] != (int *)0x0) && (cVar2 = (**(code **)(*(int *)ptr[3] + 0xc))(uVar3), cVar2 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(ptr + 2); } local_8 = 0xffffffff; operator_delete(ptr,0x10); ptr = puVar1; } ExceptionList = local_10; return; } //@@ 00a7f130 FUN_00a7f130 undefined4 FUN_00a7f130(undefined4 *param_1) { char cVar1; int iVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b14700; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; (*(code *)*param_1)(param_1[1]); iVar2 = param_1[2]; EnterCriticalSection((LPCRITICAL_SECTION)(iVar2 + 4)); cVar1 = *(char *)(iVar2 + 0x1c); while (cVar1 != '\0') { Sleep(1000); cVar1 = *(char *)(iVar2 + 0x1c); } *(undefined1 *)(iVar2 + 0x1c) = 1; *(undefined1 *)(param_1[2] + 0x20) = 1; operator_delete(param_1,0xc); *(undefined1 *)(iVar2 + 0x1c) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)(iVar2 + 4)); ExceptionList = local_10; return 0; } //@@ 00a7f1ca Catch_All@00a7f1ca void Catch_All_00a7f1ca(void) { /* WARNING: Subroutine does not return */ terminate(); } //@@ 00a7f1e0 FUN_00a7f1e0 bool FUN_00a7f1e0(void) { char cVar1; int in_ECX; EnterCriticalSection((LPCRITICAL_SECTION)(in_ECX + 4)); cVar1 = *(char *)(in_ECX + 0x1c); while (cVar1 != '\0') { Sleep(1000); cVar1 = *(char *)(in_ECX + 0x1c); } *(undefined1 *)(in_ECX + 0x1c) = 1; cVar1 = *(char *)(in_ECX + 0x20); *(undefined1 *)(in_ECX + 0x1c) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)(in_ECX + 4)); return cVar1 == '\0'; } //@@ 00a7f230 FUN_00a7f230 void FUN_00a7f230(void) { LPCRITICAL_SECTION lpCriticalSection; undefined4 *in_ECX; lpCriticalSection = (LPCRITICAL_SECTION)*in_ECX; if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; LeaveCriticalSection(lpCriticalSection); } return; } //@@ 00a7f250 glfw_findPixelFormatAttribValue /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 wgl_context.c findPixelFormatAttribValue(attribs, count, values, attrib): linear search, else "WGL: Unknown pixel format attribute requested" via FormatMessageW "%s: %s"; caller choosePixelFormatWGL */ undefined4 glfw_findPixelFormatAttribValue(int param_1,int param_2) { int iVar1; DWORD DVar2; int in_ECX; int in_EDX; DWORD dwLanguageId; WCHAR *lpBuffer; DWORD nSize; va_list *Arguments; WCHAR local_c08 [1024]; CHAR local_408 [1024]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_408 + 0x404); iVar1 = 0; if (0 < in_EDX) { do { if (*(int *)(in_ECX + iVar1 * 4) == param_2) { return *(undefined4 *)(param_1 + iVar1 * 4); } iVar1 = iVar1 + 1; } while (iVar1 < in_EDX); } memset(local_c08,0,0x800); memset(local_408,0,0x400); lpBuffer = local_c08; Arguments = (va_list *)0x0; nSize = 0x400; dwLanguageId = 0x400; DVar2 = GetLastError(); FormatMessageW(0x12ff,(LPCVOID)0x0,DVar2 & 0xffff,dwLanguageId,lpBuffer,nSize,Arguments); WideCharToMultiByte(0xfde9,0,local_c08,-1,local_408,0x400,(LPCSTR)0x0,(LPBOOL)0x0); _glfwInputError(0x10008,"%s: %s","WGL: Unknown pixel format attribute requested",local_408); return 0; } //@@ 00a7f340 glfw_choosePixelFormatWGL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 wgl_context.c choosePixelFormatWGL: "WGL: Failed to retrieve pixel format attributes", "WGL: The driver does not appear to support OpenGL", "WGL: Failed to find a suitable pixel format"; calls _glfwInputError 00a69f60 _glfwInputError undefined4 glfw_choosePixelFormatWGL(int param_1) { bool bVar1; void *pvVar2; int iVar3; void *_Dst; int iVar4; int in_ECX; int *in_EDX; size_t _Size; undefined4 *puVar5; int iVar6; undefined4 uVar7; char *pcVar8; void *local_188; void *local_184; int local_180; int local_17c; tagPIXELFORMATDESCRIPTOR local_178; undefined1 local_150 [160]; undefined4 local_b0 [41]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); iVar6 = 0; local_180 = param_1; local_17c = 0; pvVar2 = (void *)DescribePixelFormat(*(HDC *)(in_ECX + 0x264),1,0x28,(LPPIXELFORMATDESCRIPTOR)0x0) ; local_188 = pvVar2; if (DAT_00c75d88 != 0) { iVar6 = 0x16; local_b0[0] = 0x2010; local_b0[1] = 0x2001; local_b0[2] = 0x2013; local_b0[3] = 0x2003; local_b0[0x14] = 0x2012; local_b0[4] = 0x2015; local_b0[5] = 0x2016; local_b0[6] = 0x2017; local_b0[7] = 0x2018; local_b0[0x15] = 0x2011; local_b0[8] = 0x2019; local_b0[9] = 0x201a; local_b0[10] = 0x201b; local_b0[0xb] = 0x201c; local_b0[0xc] = 0x2022; local_b0[0xd] = 0x2023; local_b0[0xe] = 0x201d; local_b0[0xf] = 0x201e; local_b0[0x10] = 0x201f; local_b0[0x11] = 0x2020; local_b0[0x12] = 0x2021; local_b0[0x13] = 0x2024; if (DAT_00c75d7c != 0) { local_b0[0x16] = 0x2042; iVar6 = 0x17; } if (*in_EDX == 0x30001) { if ((DAT_00c75d80 != 0) || (DAT_00c75d84 != 0)) { local_b0[iVar6] = 0x20a9; goto LAB_00a7f447; } } else if (DAT_00c75d78 != 0) { local_b0[iVar6] = 0x309d; LAB_00a7f447: iVar6 = iVar6 + 1; } local_188 = (void *)0x2000; iVar3 = (*DAT_00c75d64)(*(undefined4 *)(in_ECX + 0x264),1,0,1,&local_188,&local_184); if (iVar3 == 0) { _glfwInputErrorWin32(); return 0; } local_188 = local_184; if ((int)pvVar2 < (int)local_184) { local_188 = pvVar2; } } pvVar2 = local_188; if (local_188 == (void *)0x0) { _glfwInputError(0x10006,"WGL: The driver does not appear to support OpenGL"); return 0; } if (local_188 < (void *)0x3c3c3c4) { _Size = (int)local_188 * 0x44; _Dst = (void *)(*g_glfwAllocate)(_Size,g_glfwAllocatorUser); if (_Dst == (void *)0x0) { pcVar8 = (char *)0x0; uVar7 = 0x10005; goto LAB_00a7f4fa; } local_184 = memset(_Dst,0,_Size); } else { pcVar8 = "Allocation size overflow"; uVar7 = 0x10004; LAB_00a7f4fa: _glfwInputError(uVar7,pcVar8); local_184 = (void *)0x0; } if (0 < (int)pvVar2) { puVar5 = (undefined4 *)((int)local_184 + 0x34); iVar3 = 1; do { if (DAT_00c75d88 == 0) { iVar4 = DescribePixelFormat(*(HDC *)(in_ECX + 0x264),iVar3,0x28,&local_178); if (iVar4 != 0) { if (((((local_178.dwFlags & 4) != 0) && ((local_178.dwFlags & 0x20) != 0)) && (((local_178.dwFlags & 0x1000) != 0 || ((local_178.dwFlags & 0x40) == 0)))) && ((local_178.iPixelType == '\0' && ((local_178.dwFlags & 1) == *(uint *)(local_180 + 0x38))))) { puVar5[-0xd] = (uint)local_178.cRedBits; puVar5[-0xc] = (uint)local_178.cGreenBits; puVar5[-0xb] = (uint)local_178.cBlueBits; puVar5[-10] = (uint)local_178.cAlphaBits; puVar5[-9] = (uint)local_178.cDepthBits; puVar5[-8] = (uint)local_178.cStencilBits; puVar5[-7] = (uint)local_178.cAccumRedBits; puVar5[-6] = (uint)local_178.cAccumGreenBits; puVar5[-5] = (uint)local_178.cAccumBlueBits; puVar5[-4] = (uint)local_178.cAccumAlphaBits; puVar5[-3] = (uint)local_178.cAuxBuffers; if ((local_178.dwFlags & 2) != 0) { puVar5[-2] = 1; } goto LAB_00a7f93c; } goto LAB_00a7f975; } LAB_00a7f9be: _glfwInputErrorWin32(); goto LAB_00a7f9c8; } iVar4 = (*DAT_00c75d64)(*(HDC *)(in_ECX + 0x264),iVar3,0,iVar6,local_b0,local_150); if (iVar4 == 0) goto LAB_00a7f9be; iVar4 = glfw_findPixelFormatAttribValue(local_150,0x2010); if ((((iVar4 != 0) && (iVar4 = glfw_findPixelFormatAttribValue(local_150,0x2001), iVar4 != 0)) && (iVar4 = glfw_findPixelFormatAttribValue(local_150,0x2013), iVar4 == 0x202b)) && ((iVar4 = glfw_findPixelFormatAttribValue(local_150,0x2003), iVar4 != 0x2025 && (iVar4 = glfw_findPixelFormatAttribValue(local_150,0x2011), iVar4 == *(int *)(local_180 + 0x38))))) { uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2015); puVar5[-0xd] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2017); puVar5[-0xc] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2019); puVar5[-0xb] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x201b); puVar5[-10] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2022); puVar5[-9] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2023); puVar5[-8] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x201e); puVar5[-7] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x201f); puVar5[-6] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2020); puVar5[-5] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2021); puVar5[-4] = uVar7; uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2024); puVar5[-3] = uVar7; iVar4 = glfw_findPixelFormatAttribValue(local_150,0x2012); if (iVar4 != 0) { puVar5[-2] = 1; } if (DAT_00c75d7c != 0) { uVar7 = glfw_findPixelFormatAttribValue(local_150,0x2042); puVar5[-1] = uVar7; } if (*in_EDX == 0x30001) { if (((DAT_00c75d80 == 0) && (DAT_00c75d84 == 0)) || (iVar4 = glfw_findPixelFormatAttribValue(local_150,0x20a9), iVar4 == 0)) goto LAB_00a7f93c; local_17c = local_17c + 1; *puVar5 = 1; puVar5[3] = iVar3; puVar5 = puVar5 + 0x11; } else if ((DAT_00c75d78 == 0) || (iVar4 = glfw_findPixelFormatAttribValue(local_150,0x309d), iVar4 != 0x3089)) { LAB_00a7f93c: local_17c = local_17c + 1; puVar5[3] = iVar3; puVar5 = puVar5 + 0x11; } else { local_17c = local_17c + 1; *puVar5 = 1; puVar5[3] = iVar3; puVar5 = puVar5 + 0x11; } } LAB_00a7f975: pvVar2 = local_184; bVar1 = iVar3 < (int)local_188; iVar3 = iVar3 + 1; } while (bVar1); if (local_17c != 0) { iVar6 = _glfwChooseFBConfig(local_17c); if (iVar6 != 0) { uVar7 = *(undefined4 *)(iVar6 + 0x40); if (pvVar2 != (void *)0x0) { (*g_glfwDeallocate)(pvVar2,g_glfwAllocatorUser); } return uVar7; } _glfwInputError(0x10009,"WGL: Failed to find a suitable pixel format"); goto LAB_00a7f9ce; } } _glfwInputError(0x10006,"WGL: The driver does not appear to support OpenGL"); LAB_00a7f9c8: pvVar2 = local_184; LAB_00a7f9ce: if (pvVar2 != (void *)0x0) { (*g_glfwDeallocate)(pvVar2,g_glfwAllocatorUser); } return 0; } //@@ 00a7fa50 FUN_00a7fa50 void FUN_00a7fa50(LPVOID param_1) { int iVar1; if (param_1 == (LPVOID)0x0) { iVar1 = (*DAT_00c75d58)(0,0); if (iVar1 != 0) goto LAB_00a7fac3; } else { iVar1 = (*DAT_00c75d58)(*(undefined4 *)((int)param_1 + 0x264), *(undefined4 *)((int)param_1 + 0x268)); if (iVar1 != 0) { if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x45); } TlsSetValue(DAT_00c74b84,param_1); return; } } _glfwInputErrorWin32(); LAB_00a7fac3: if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x45); } TlsSetValue(DAT_00c74b84,(LPVOID)0x0); return; } //@@ 00a7fb00 FUN_00a7fb00 void FUN_00a7fb00(int param_1) { int iVar1; undefined4 extraout_ECX; uint uVar2; int local_c [2]; if (((*(int *)(param_1 + 0x40) == 0) && (iVar1 = _glfwIsWindowsVersionOrGreaterWin32(), iVar1 == 0)) && (iVar1 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX), iVar1 != 0)) { local_c[0] = 0; iVar1 = (*DAT_00c75abc)(local_c); if ((-1 < iVar1) && (local_c[0] != 0)) { uVar2 = (int)*(uint *)(param_1 + 0x26c) >> 0x1f; for (iVar1 = (*(uint *)(param_1 + 0x26c) ^ uVar2) - uVar2; iVar1 != 0; iVar1 = iVar1 + -1) { (*DAT_00c75ac0)(); } } } SwapBuffers(*(HDC *)(param_1 + 0x264)); return; } //@@ 00a7fb80 FUN_00a7fb80 void FUN_00a7fb80(undefined4 param_1) { LPVOID pvVar1; int iVar2; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar3; undefined4 extraout_ECX_01; int local_c [2]; if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar1 = TlsGetValue(DAT_00c74b84); uVar3 = extraout_ECX; if (pvVar1 == (LPVOID)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\wgl_context.c" ,0x15e); uVar3 = extraout_ECX_00; } *(undefined4 *)((int)pvVar1 + 0x26c) = param_1; if (*(int *)((int)pvVar1 + 0x40) == 0) { iVar2 = _glfwIsWindowsVersionOrGreaterWin32(uVar3); if (iVar2 == 0) { iVar2 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX_01); if (iVar2 != 0) { local_c[0] = 0; iVar2 = (*DAT_00c75abc)(local_c); if ((-1 < iVar2) && (local_c[0] != 0)) { param_1 = 0; } } } } if (DAT_00c75d74 != 0) { (*DAT_00c75d60)(param_1); } return; } //@@ 00a7fc40 FUN_00a7fc40 undefined4 FUN_00a7fc40(void) { undefined4 uVar1; int iVar2; if (DAT_00c75d6c == (code *)0x0) { if (DAT_00c75d68 == (code *)0x0) { return 0; } iVar2 = (*DAT_00c75d68)(); } else { uVar1 = (*DAT_00c75d50)(); iVar2 = (*DAT_00c75d6c)(uVar1); } if (iVar2 == 0) { return 0; } uVar1 = FUN_00a6bb40(); return uVar1; } //@@ 00a7fc80 FUN_00a7fc80 void FUN_00a7fc80(LPCSTR param_1) { int iVar1; iVar1 = (*DAT_00c75d4c)(param_1); if (iVar1 == 0) { GetProcAddress(DAT_00c75d40,param_1); } return; } //@@ 00a7fcb0 FUN_00a7fcb0 void FUN_00a7fcb0(int param_1) { if (*(int *)(param_1 + 0x268) != 0) { (*DAT_00c75d48)(*(int *)(param_1 + 0x268)); *(undefined4 *)(param_1 + 0x268) = 0; } return; } //@@ 00a7fce0 _glfwInitWGL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW wgl_context.c: 'WGL: Failed to load opengl32.dll', dummy context, loads wglCreateContextAttribsARB/WGL_ARB_* extensions */ undefined4 _glfwInitWGL(void) { HDC hdc; int iVar1; BOOL BVar2; int iVar3; int iVar4; int iVar5; PIXELFORMATDESCRIPTOR *ppfd; PIXELFORMATDESCRIPTOR local_50; undefined4 local_14; local_14 = __security_cookie ^ (int)register0x00000010 - 0x10U; if (DAT_00c75d40 == (HMODULE)0x0) { DAT_00c75d40 = LoadLibraryA("opengl32.dll"); if (DAT_00c75d40 == (HMODULE)0x0) { _glfwInputErrorWin32(); return 0; } DAT_00c75d44 = GetProcAddress(DAT_00c75d40,"wglCreateContext"); DAT_00c75d48 = GetProcAddress(DAT_00c75d40,"wglDeleteContext"); DAT_00c75d4c = GetProcAddress(DAT_00c75d40,"wglGetProcAddress"); DAT_00c75d50 = GetProcAddress(DAT_00c75d40,"wglGetCurrentDC"); DAT_00c75d54 = GetProcAddress(DAT_00c75d40,"wglGetCurrentContext"); DAT_00c75d58 = GetProcAddress(DAT_00c75d40,"wglMakeCurrent"); DAT_00c75d5c = GetProcAddress(DAT_00c75d40,"wglShareLists"); hdc = GetDC(DAT_00c74cb4); ppfd = &local_50; local_50.cGreenBits = '\0'; local_50.cGreenShift = '\0'; local_50.cBlueBits = '\0'; local_50.cBlueShift = '\0'; local_50.cAlphaBits = '\0'; local_50.cAlphaShift = '\0'; local_50.cAccumBits = '\0'; local_50.cAccumRedBits = '\0'; local_50.cAccumGreenBits = '\0'; local_50.cAccumBlueBits = '\0'; local_50.cAccumAlphaBits = '\0'; local_50.cDepthBits = '\0'; local_50.cStencilBits = '\0'; local_50.cAuxBuffers = '\0'; local_50.iLayerType = '\0'; local_50.bReserved = '\0'; local_50.dwLayerMask = 0; local_50.dwVisibleMask = 0; local_50.dwDamageMask = 0; local_50.nSize = 0x28; local_50.nVersion = 1; local_50.dwFlags = 0x25; local_50.iPixelType = '\0'; local_50.cColorBits = '\x18'; local_50.cRedBits = '\0'; local_50.cRedShift = '\0'; iVar1 = ChoosePixelFormat(hdc,ppfd); BVar2 = SetPixelFormat(hdc,iVar1,ppfd); if (BVar2 == 0) { _glfwInputErrorWin32(); return 0; } iVar1 = (*DAT_00c75d44)(hdc); if (iVar1 == 0) { _glfwInputErrorWin32(); return 0; } iVar3 = (*DAT_00c75d50)(); iVar4 = (*DAT_00c75d54)(); iVar5 = (*DAT_00c75d58)(hdc,iVar1); if (iVar5 == 0) { _glfwInputErrorWin32(); (*DAT_00c75d58)(iVar3,iVar4); (*DAT_00c75d48)(iVar1); return 0; } DAT_00c75d68 = (*DAT_00c75d4c)("wglGetExtensionsStringEXT"); DAT_00c75d6c = (*DAT_00c75d4c)("wglGetExtensionsStringARB"); DAT_00c75d70 = (*DAT_00c75d4c)("wglCreateContextAttribsARB"); DAT_00c75d60 = (*DAT_00c75d4c)("wglSwapIntervalEXT"); DAT_00c75d64 = (*DAT_00c75d4c)("wglGetPixelFormatAttribivARB"); DAT_00c75d7c = FUN_00a7fc40("WGL_ARB_multisample"); DAT_00c75d80 = FUN_00a7fc40("WGL_ARB_framebuffer_sRGB"); DAT_00c75d84 = FUN_00a7fc40("WGL_EXT_framebuffer_sRGB"); DAT_00c75d8c = FUN_00a7fc40("WGL_ARB_create_context"); DAT_00c75d90 = FUN_00a7fc40("WGL_ARB_create_context_profile"); DAT_00c75d94 = FUN_00a7fc40("WGL_EXT_create_context_es2_profile"); DAT_00c75d98 = FUN_00a7fc40("WGL_ARB_create_context_robustness"); DAT_00c75d9c = FUN_00a7fc40("WGL_ARB_create_context_no_error"); DAT_00c75d74 = FUN_00a7fc40("WGL_EXT_swap_control"); DAT_00c75d78 = FUN_00a7fc40("WGL_EXT_colorspace"); DAT_00c75d88 = FUN_00a7fc40("WGL_ARB_pixel_format"); DAT_00c75da0 = FUN_00a7fc40("WGL_ARB_context_flush_control"); (*DAT_00c75d58)(iVar3,iVar4); (*DAT_00c75d48)(iVar1); } return 1; } //@@ 00a80010 _glfwCreateContextWGL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 wgl_context.c: GetDC(window+0x2b4), glfw_choosePixelFormatWGL, SetPixelFormat, all 'WGL: Failed to create OpenGL context' etc. strings */ undefined4 _glfwCreateContextWGL(undefined4 param_1) { HDC pHVar1; int iVar2; int iVar3; BOOL BVar4; uint uVar5; DWORD DVar6; int in_ECX; int *in_EDX; undefined4 uVar7; char *pcVar8; int local_ec; uint local_e8; uint local_e4; tagPIXELFORMATDESCRIPTOR local_e0; uint local_b8 [41]; uint local_14; local_14 = __security_cookie ^ (uint)(local_b8 + 0x2a); local_ec = 0; if (in_EDX[10] != 0) { local_ec = *(int *)(in_EDX[10] + 0x268); } pHVar1 = GetDC(*(HWND *)(in_ECX + 0x2b4)); *(HDC *)(in_ECX + 0x264) = pHVar1; if (pHVar1 == (HDC)0x0) { pcVar8 = "WGL: Failed to retrieve DC for window"; uVar7 = 0x10008; goto LAB_00a8050e; } iVar2 = glfw_choosePixelFormatWGL(param_1); if (iVar2 == 0) { return 0; } iVar3 = DescribePixelFormat(*(HDC *)(in_ECX + 0x264),iVar2,0x28,&local_e0); if (iVar3 == 0) { _glfwInputErrorWin32(); return 0; } BVar4 = SetPixelFormat(*(HDC *)(in_ECX + 0x264),iVar2,&local_e0); if (BVar4 == 0) { _glfwInputErrorWin32(); return 0; } if (*in_EDX == 0x30001) { if ((in_EDX[4] != 0) && (DAT_00c75d8c == 0)) { pcVar8 = "WGL: A forward compatible OpenGL context requested but WGL_ARB_create_context is unavailable" ; uVar7 = 0x10007; goto LAB_00a8050e; } if ((in_EDX[7] != 0) && (DAT_00c75d90 == 0)) { pcVar8 = "WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable"; uVar7 = 0x10007; goto LAB_00a8050e; } } else if (((DAT_00c75d8c == 0) || (DAT_00c75d90 == 0)) || (DAT_00c75d94 == 0)) { pcVar8 = "WGL: OpenGL ES requested but WGL_ARB_create_context_es2_profile is unavailable"; uVar7 = 0x10006; goto LAB_00a8050e; } if (DAT_00c75d8c == 0) { iVar2 = (*DAT_00c75d44)(*(undefined4 *)(in_ECX + 0x264)); *(int *)(in_ECX + 0x268) = iVar2; if (iVar2 == 0) { _glfwInputErrorWin32(); return 0; } if ((local_ec != 0) && (iVar2 = (*DAT_00c75d5c)(local_ec,iVar2), iVar2 == 0)) { _glfwInputErrorWin32(); return 0; } goto LAB_00a804b0; } iVar2 = 0; uVar5 = 0; if (*in_EDX == 0x30001) { uVar5 = -(uint)(in_EDX[4] != 0) & 2; if (in_EDX[7] == 0x32001) { local_e8 = 1; } else { local_e8 = 0; if (in_EDX[7] == 0x32002) { local_e8 = 2; } } } else { local_e8 = 4; } local_e4 = uVar5 | 1; if (in_EDX[5] == 0) { local_e4 = uVar5; } iVar3 = in_EDX[8]; if ((iVar3 != 0) && (DAT_00c75d98 != 0)) { if (iVar3 == 0x31001) { local_b8[1] = 0x8261; LAB_00a80220: iVar2 = 2; local_b8[0] = 0x8256; } else if (iVar3 == 0x31002) { local_b8[1] = 0x8252; goto LAB_00a80220; } local_e4 = local_e4 | 4; } iVar3 = in_EDX[9]; if ((iVar3 != 0) && (DAT_00c75da0 != 0)) { if (iVar3 == 0x35002) { local_b8[iVar2] = 0x2097; local_b8[iVar2 + 1] = 0; } else { if (iVar3 != 0x35001) goto LAB_00a80289; local_b8[iVar2] = 0x2097; local_b8[iVar2 + 1] = 0x2098; } iVar2 = iVar2 + 2; } LAB_00a80289: if ((in_EDX[6] != 0) && (DAT_00c75d9c != 0)) { local_b8[iVar2] = 0x31b3; local_b8[iVar2 + 1] = 1; iVar2 = iVar2 + 2; } uVar5 = in_EDX[2]; if ((uVar5 != 1) || (in_EDX[3] != 0)) { local_b8[iVar2] = 0x2091; local_b8[iVar2 + 1] = uVar5; uVar5 = in_EDX[3]; local_b8[iVar2 + 2] = 0x2092; local_b8[iVar2 + 3] = uVar5; iVar2 = iVar2 + 4; } if (local_e4 != 0) { if (0x27 < iVar2 + 1U) { _wassert(L"((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\wgl_context.c" ,0x2ae); } local_b8[iVar2] = 0x2094; local_b8[iVar2 + 1] = local_e4; iVar2 = iVar2 + 2; } if (local_e8 != 0) { if (0x27 < iVar2 + 1U) { _wassert(L"((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\wgl_context.c" ,0x2b1); } local_b8[iVar2] = 0x9126; local_b8[iVar2 + 1] = local_e8; iVar2 = iVar2 + 2; } if (0x27 < iVar2 + 1U) { _wassert(L"((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\wgl_context.c" ,0x2b3); } local_b8[iVar2] = 0; local_b8[iVar2 + 1] = 0; iVar2 = (*DAT_00c75d70)(*(undefined4 *)(in_ECX + 0x264),local_ec,local_b8); *(int *)(in_ECX + 0x268) = iVar2; if (iVar2 == 0) { DVar6 = GetLastError(); if (DVar6 == 0xc0072095) { pcVar8 = "WGL: Driver does not support OpenGL ES version %i.%i"; if (*in_EDX == 0x30001) { pcVar8 = "WGL: Driver does not support OpenGL version %i.%i"; } _glfwInputError(0x10007,pcVar8,in_EDX[2],in_EDX[3]); return 0; } if (DVar6 == 0xc0072096) { pcVar8 = "WGL: Driver does not support the requested OpenGL profile"; uVar7 = 0x10007; } else if (DVar6 == 0xc0072054) { pcVar8 = "WGL: The share context is not compatible with the requested context"; uVar7 = 0x10004; } else if (*in_EDX == 0x30001) { pcVar8 = "WGL: Failed to create OpenGL context"; uVar7 = 0x10007; } else { pcVar8 = "WGL: Failed to create OpenGL ES context"; uVar7 = 0x10007; } LAB_00a8050e: _glfwInputError(uVar7,pcVar8); return 0; } LAB_00a804b0: *(code **)(in_ECX + 0x22c) = FUN_00a7fa50; *(code **)(in_ECX + 0x230) = FUN_00a7fb00; *(code **)(in_ECX + 0x234) = FUN_00a7fb80; *(code **)(in_ECX + 0x238) = FUN_00a7fc40; *(code **)(in_ECX + 0x23c) = FUN_00a7fc80; *(code **)(in_ECX + 0x240) = FUN_00a7fcb0; return 1; } //@@ 00a80530 loadLibraries /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: glfw win32_init.c: GetModuleHandleExW(&_glfw), LoadLibraryA user32.dll ("Win32: Failed to load user32.dll") + SetProcessDPIAware/ChangeWindowMessageFilterEx/EnableNonClientDpiScaling/..., dinput8.dll DirectInput8Create, xinput1_4..xinput1_1 XInputGetCapabilities/XInputGetState, dwmapi.dll, shcore.dll, ntdll.dll RtlVerifyVersionInfo; called from _glfwInitWin32 (00a812f0) */ undefined4 loadLibraries(void) { undefined4 uVar1; BOOL BVar2; char *lpLibFileName; int iVar3; char *local_1c [4]; undefined4 local_c; char *local_8; local_8 = (char *)(__security_cookie ^ (uint)(local_1c + 6)); BVar2 = GetModuleHandleExW(6,(LPCWSTR)&_glfw,(HMODULE *)&DAT_00c74cb0); if (BVar2 == 0) { _glfwInputErrorWin32(); return 0; } DAT_00c75a98 = LoadLibraryA("user32.dll"); if (DAT_00c75a98 == (HMODULE)0x0) { _glfwInputErrorWin32(); return 0; } DAT_00c75a9c = GetProcAddress(DAT_00c75a98,"SetProcessDPIAware"); DAT_00c75aa0 = GetProcAddress(DAT_00c75a98,"ChangeWindowMessageFilterEx"); DAT_00c75aa4 = GetProcAddress(DAT_00c75a98,"EnableNonClientDpiScaling"); DAT_00c75aa8 = GetProcAddress(DAT_00c75a98,"SetProcessDpiAwarenessContext"); DAT_00c75aac = GetProcAddress(DAT_00c75a98,"GetDpiForWindow"); DAT_00c75ab0 = GetProcAddress(DAT_00c75a98,"AdjustWindowRectExForDpi"); DAT_00c75ab4 = GetProcAddress(DAT_00c75a98,"GetSystemMetricsForDpi"); DAT_00c75a80 = LoadLibraryA("dinput8.dll"); if (DAT_00c75a80 != (HMODULE)0x0) { DAT_00c75a84 = GetProcAddress(DAT_00c75a80,"DirectInput8Create"); } iVar3 = 0; local_1c[0] = "xinput1_3.dll"; lpLibFileName = "xinput1_4.dll"; local_1c[1] = "xinput9_1_0.dll"; local_1c[2] = "xinput1_2.dll"; local_1c[3] = "xinput1_1.dll"; local_c = 0; uVar1 = DAT_00c75a8c; do { DAT_00c75a8c = (HMODULE)uVar1; DAT_00c75a8c = LoadLibraryA(lpLibFileName); if (DAT_00c75a8c != (HMODULE)0x0) { DAT_00c75a90 = GetProcAddress(DAT_00c75a8c,"XInputGetCapabilities"); DAT_00c75a94 = GetProcAddress(DAT_00c75a8c,"XInputGetState"); break; } lpLibFileName = local_1c[iVar3]; iVar3 = iVar3 + 1; uVar1 = 0; } while (lpLibFileName != (LPCSTR)0x0); DAT_00c75ab8 = LoadLibraryA("dwmapi.dll"); if (DAT_00c75ab8 != (HMODULE)0x0) { DAT_00c75abc = GetProcAddress(DAT_00c75ab8,"DwmIsCompositionEnabled"); DAT_00c75ac0 = GetProcAddress(DAT_00c75ab8,"DwmFlush"); DAT_00c75ac4 = GetProcAddress(DAT_00c75ab8,"DwmEnableBlurBehindWindow"); DAT_00c75ac8 = GetProcAddress(DAT_00c75ab8,"DwmGetColorizationColor"); } DAT_00c75acc = LoadLibraryA("shcore.dll"); if (DAT_00c75acc != (HMODULE)0x0) { DAT_00c75ad0 = GetProcAddress(DAT_00c75acc,"SetProcessDpiAwareness"); DAT_00c75ad4 = GetProcAddress(DAT_00c75acc,"GetDpiForMonitor"); } DAT_00c75ad8 = LoadLibraryA("ntdll.dll"); if (DAT_00c75ad8 != (HMODULE)0x0) { DAT_00c75adc = GetProcAddress(DAT_00c75ad8,"RtlVerifyVersionInfo"); } return 1; } //@@ 00a80770 glfw_createKeyTables /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: GLFW win32_init.c createKeyTables: memset keycodes (0x400) and scancodes (0x2ba) to -1, then fills GLFW_KEY_* values (0x100 ESCAPE, '0'..'9', 'A'..'Z' ...); caller FUN_00a812f0 (_glfwInitWin32, 'GLFW3 Helper' window) */ void glfw_createKeyTables(void) { int iVar1; memset(&DAT_00c74cc8,-1,0x400); memset(&DAT_00c750c8,-1,0x2ba); _DAT_00c74cf4 = 0x55; _DAT_00c74d40 = 0x1240123; uRam00c74d44 = 0x1260125; uRam00c74d48 = 0x1280127; uRam00c74d4c = 0x12a0129; _DAT_00c74f66 = 0x10d; DAT_00c74cca = 0x100; _DAT_00c74f56 = 0x10c; _DAT_00c74f52 = 0x11a; _DAT_00c74d3e = 0x122; _DAT_00c74d50 = 299; _DAT_00c74da4 = 0x138; _DAT_00c74db4 = 0x139; _DAT_00c74d02 = 0x155; _DAT_00c74f7e = 0x157; _DAT_00c74d34 = 0x158; _DAT_00c74f5e = 0x107; _DAT_00c74cdc = 0x300039; _DAT_00c74ccc = 0x320031; _DAT_00c74cd0 = 0x340033; _DAT_00c74cd4 = 0x360035; _DAT_00c74cd8 = 0x380037; _DAT_00c74d04 = 0x530041; _DAT_00c74d28 = 0x4e0042; _DAT_00c74d24 = 0x560043; _DAT_00c74d08 = 0x460044; _DAT_00c74cec = 0x520045; _DAT_00c74d0c = &DAT_00480047; _DAT_00c74cf6 = 0x4f0049; _DAT_00c74d10 = 0x4b004a; _DAT_00c74d14 = 0x3b004c; _DAT_00c74d2c = 0x2c004d; _DAT_00c74cfa = 0x5b0050; _DAT_00c74ce8 = 0x570051; _DAT_00c74cf0 = 0x590054; _DAT_00c74d20 = 0x58005a; _DAT_00c74d18 = &DAT_00600027; _DAT_00c74d1c = &DAT_005c0154; _DAT_00c74ce0 = 0x3d002d; _DAT_00c74d30 = 0x2f002e; _DAT_00c74cfe = 0x101005d; _DAT_00c74d74 = 0x12c00a2; _DAT_00c74ce4 = 0x1020103; _DAT_00c74f6c = 0x1050104; _DAT_00c74f80 = 0x15c015b; _DAT_00c74f68 = 0x10b0108; _DAT_00c74f58 = 0x10a0109; _DAT_00c74d52 = 0x119011c; _DAT_00c74d3a = 0x1180020; _DAT_00c74d78 = 0x150012d; _DAT_00c74d90 = 0x12f012e; uRam00c74d94 = 0x1310130; uRam00c74d98 = 0x1330132; uRam00c74d9c = 0x1350134; _DAT_00c74da0 = 0x1370136; _DAT_00c74d36 = 0x156014c; _DAT_00c74f36 = 0x15a011b; _DAT_00c74f00 = 0x159014f; _DAT_00c74f62 = 0x106; _DAT_00c74d6a = 0x1400143; _DAT_00c74d66 = 0x1420141; _DAT_00c74d5e = 0x1450144; _DAT_00c74d62 = 0x14e0146; _DAT_00c74d6e = 0x14a; _DAT_00c74f32 = 0x14b; iVar1 = 0; _DAT_00c74d56 = 0x1480147; _DAT_00c74d5a = 0x14d0149; do { if (0 < (short)(&DAT_00c74cc8)[iVar1]) { *(short *)(&DAT_00c750c8 + (short)(&DAT_00c74cc8)[iVar1] * 2) = (short)iVar1; } iVar1 = iVar1 + 1; } while (iVar1 < 0x200); return; } //@@ 00a80a40 FUN_00a80a40 void FUN_00a80a40(HWND param_1,UINT param_2,WPARAM param_3,int param_4) { undefined4 *puVar1; if (param_2 == 0x7e) { _glfwPollMonitorsWin32(); } else if ((param_2 == 0x219) && (DAT_00c73cac != 0)) { if (param_3 == 0x8000) { if ((param_4 != 0) && (*(int *)(param_4 + 4) == 5)) { FUN_00aa8a00(); } } else if (((param_3 == 0x8004) && (param_4 != 0)) && (*(int *)(param_4 + 4) == 5)) { puVar1 = &DAT_00c73cb0; do { if (puVar1[1] != 0) { _glfwPollJoystickWin32(puVar1,0); } puVar1 = puVar1 + 0x3b; } while ((int)puVar1 < 0xc74a85); } } DefWindowProcW(param_1,param_2,param_3,param_4); return; } //@@ 00a80ae0 _glfwCreateWideStringFromUTF8Win32 /* DB: GLFW win32_init.c: MultiByteToWideChar(CP_UTF8 0xfde9) size query, _glfw_calloc ("Allocation size overflow"), "Win32: Failed to convert string from UTF-8"; _glfwCreateWindowWin32 */ LPWSTR _glfwCreateWideStringFromUTF8Win32(void) { uint cchWideChar; void *_Dst; int iVar1; LPCSTR in_ECX; LPWSTR lpWideCharStr; undefined4 uVar2; char *pcVar3; cchWideChar = MultiByteToWideChar(0xfde9,0,in_ECX,-1,(LPWSTR)0x0,0); if (cchWideChar == 0) { _glfwInputErrorWin32(); return (LPWSTR)0x0; } if (cchWideChar < 0x80000000) { _Dst = (void *)(*g_glfwAllocate)(cchWideChar * 2,g_glfwAllocatorUser); if (_Dst != (void *)0x0) { lpWideCharStr = memset(_Dst,0,cchWideChar * 2); goto LAB_00a80b60; } pcVar3 = (char *)0x0; uVar2 = 0x10005; } else { pcVar3 = "Allocation size overflow"; uVar2 = 0x10004; } _glfwInputError(uVar2,pcVar3); lpWideCharStr = (LPWSTR)0x0; LAB_00a80b60: iVar1 = MultiByteToWideChar(0xfde9,0,in_ECX,-1,lpWideCharStr,cchWideChar); if (iVar1 != 0) { return lpWideCharStr; } _glfwInputErrorWin32(); if (lpWideCharStr != (LPWSTR)0x0) { (*g_glfwDeallocate)(lpWideCharStr,g_glfwAllocatorUser); } return (LPWSTR)0x0; } //@@ 00a80bb0 FUN_00a80bb0 LPSTR FUN_00a80bb0(void) { size_t _Size; void *_Dst; LPSTR lpMultiByteStr; int iVar1; LPCWSTR in_ECX; _Size = WideCharToMultiByte(0xfde9,0,in_ECX,-1,(LPSTR)0x0,0,(LPCSTR)0x0,(LPBOOL)0x0); if (_Size == 0) { _glfwInputErrorWin32(); return (LPSTR)0x0; } _Dst = (void *)(*g_glfwAllocate)(_Size,g_glfwAllocatorUser); if (_Dst == (void *)0x0) { _glfwInputError(0x10005,0); lpMultiByteStr = (LPSTR)0x0; } else { lpMultiByteStr = memset(_Dst,0,_Size); } iVar1 = WideCharToMultiByte(0xfde9,0,in_ECX,-1,lpMultiByteStr,_Size,(LPCSTR)0x0,(LPBOOL)0x0); if (iVar1 != 0) { return lpMultiByteStr; } _glfwInputErrorWin32(); if (lpMultiByteStr != (LPSTR)0x0) { (*g_glfwDeallocate)(lpMultiByteStr,g_glfwAllocatorUser); } return (LPSTR)0x0; } //@@ 00a80c70 _glfwInputErrorWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: FormatMessageW(GetLastError()) -> WideCharToMultiByte UTF-8 -> _glfwInputError("%s: %s"); callers _glfwCreateWindowWin32, glfw_choosePixelFormatWGL */ void _glfwInputErrorWin32(void) { DWORD DVar1; DWORD dwLanguageId; WCHAR *lpBuffer; DWORD nSize; va_list *Arguments; WCHAR local_c0c [1024]; CHAR local_40c [1028]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_40c + 0x408); memset(local_c0c,0,0x800); memset(local_40c,0,0x400); lpBuffer = local_c0c; Arguments = (va_list *)0x0; nSize = 0x400; dwLanguageId = 0x400; DVar1 = GetLastError(); FormatMessageW(0x12ff,(LPCVOID)0x0,DVar1 & 0xffff,dwLanguageId,lpBuffer,nSize,Arguments); WideCharToMultiByte(0xfde9,0,local_c0c,-1,local_40c,0x400,(LPCSTR)0x0,(LPBOOL)0x0); _glfwInputError(); return; } //@@ 00a80d30 FUN_00a80d30 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a80d30(void) { UINT wVirtKey; int iVar1; UINT *pUVar2; uint uVar3; UINT uCode; UINT aUStackY_5e4 [274]; undefined4 uStackY_19c; LPSTR local_168; BYTE local_128 [256]; WCHAR local_28 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_28 + 0x12); memset(local_128,0,0x100); memset(&DAT_00c75382,0,0x6d1); local_168 = &DAT_00c75422; uVar3 = 0x20; pUVar2 = aUStackY_5e4; do { uCode = (UINT)*(short *)(&DAT_00c750c8 + uVar3 * 2); if (uCode != 0xffffffff) { if ((uVar3 < 0x140) || (0x14e < uVar3)) { wVirtKey = MapVirtualKeyW(uCode,1); } else { wVirtKey = *pUVar2; } iVar1 = ToUnicode(wVirtKey,uCode,local_128,local_28,0x10,0); if (iVar1 == -1) { iVar1 = ToUnicode(wVirtKey,uCode,local_128,local_28,0x10,0); } if (0 < iVar1) { uStackY_19c = 0xa80ebe; WideCharToMultiByte(0xfde9,0,local_28,1,local_168,5,(LPCSTR)0x0,(LPBOOL)0x0); } } uVar3 = uVar3 + 1; local_168 = local_168 + 5; pUVar2 = pUVar2 + 1; } while ((int)uVar3 < 0x15d); return; } //@@ 00a80ef0 _glfwIsWindowsVersionOrGreaterWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW win32: fills OSVERSIONINFOEXW (size 0x11c, major 6, minor EDX, sp 0), VerSetConditionMask for MAJOR|MINOR|SPMAJOR and calls RtlVerifyVersionInfo (DAT_00c75adc), returns == 0; callers _glfwCreateWindowWin32 and other win32 platform code */ bool _glfwIsWindowsVersionOrGreaterWin32(void) { int iVar1; uint in_EDX; undefined8 uVar2; undefined4 uStack_160; undefined4 uStack_15c; undefined8 uStack_158; undefined4 uStack_150; undefined4 uStack_14c; undefined4 uStack_148; undefined1 auStack_134 [4]; undefined4 local_130; undefined4 local_12c; uint local_128; undefined4 local_124; undefined4 local_120; undefined1 local_11c [256]; undefined2 local_1c; undefined4 local_1a; undefined2 local_16; uint local_c; local_c = __security_cookie ^ (uint)auStack_134; local_128 = in_EDX & 0xffff; local_130 = 0x11c; local_12c = 6; local_124 = 0; local_120 = 0; uStack_148 = 0xa80f43; memset(local_11c,0,0x100); local_1c = 0; local_1a = 0; uStack_148 = 0; local_16 = 0; uStack_14c = 0xa80f6d; uStack_158 = VerSetConditionMask(); uStack_14c = 3; uStack_150 = 1; uStack_15c = 0xa80f75; uVar2 = VerSetConditionMask(); uStack_15c = 3; uStack_160 = 0x20; uVar2 = VerSetConditionMask(uVar2); iVar1 = (*DAT_00c75adc)(&uStack_160,0x23,uVar2); return iVar1 == 0; } //@@ 00a80fb0 _glfwIsWindows10BuildOrGreaterWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW win32_init.c: OSVERSIONINFOEXW (0x11c) major 10 minor 0 build ECX, VerSetConditionMask BUILDNUMBER/MINORVERSION/MAJORVERSION, RtlVerifyVersionInfo (DAT_00c75adc) == 0; win32 window code */ bool _glfwIsWindows10BuildOrGreaterWin32(void) { int iVar1; uint in_ECX; undefined8 uVar2; undefined4 local_12c; undefined4 local_128; undefined4 local_124; uint local_120; undefined1 local_11c [276]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_11c + 0x118); local_120 = in_ECX & 0xffff; local_12c = 0x11c; local_128 = 10; local_124 = 0; memset(local_11c,0,0x10c); uVar2 = VerSetConditionMask(0,0,2,3); uVar2 = VerSetConditionMask(uVar2,1,3); uVar2 = VerSetConditionMask(uVar2,4,3); iVar1 = (*DAT_00c75adc)(&local_12c,7,uVar2); return iVar1 == 0; } //@@ 00a81050 _glfwConnectWin32 /* DB: GLFW 3.4 win32_init.c: no callees, fills a local _GLFWplatform (first field 0x60001 GLFW_PLATFORM_WIN32, then init/terminate/... including pollJoystick 00aa8d90 _glfwPollJoystickWin32 getVideoModes 00a82190) and copies 0x48 dwords to *platform, returns 1; called from glfwInit's platform select FUN_00a9db50 */ undefined4 _glfwConnectWin32(undefined4 param_1,undefined4 *param_2) { int iVar1; code **ppcVar2; code *local_124 [4]; code *local_114; code *local_110; code *local_10c; code *local_108; code *local_104; code *local_100; code *local_fc; code *local_f8; code *local_f4; code *local_f0; code *local_ec; undefined1 *local_e8; undefined1 *local_e4; undefined1 *local_e0; code *local_dc; undefined1 *local_d8; code *local_d4; code *local_d0; code *local_cc; code *local_c8; code *local_c4; code *local_c0; code *local_bc; code *local_b8; code *local_b4; code *local_b0; code *local_ac; code *local_a8; code *local_a4; code *local_a0; code *local_9c; code *local_98; code *local_94; code *local_90; code *local_8c; code *local_88; code *local_84; code *local_80; code *local_7c; code *local_78; code *local_74; code *local_70; code *local_6c; code *local_68; code *local_64; code *local_60; code *local_5c; code *local_58; code *local_54; code *local_50; code *local_4c; code *local_48; code *local_44; code *local_40; code *local_3c; code *local_38; code *local_34; code *local_30; code *local_2c; undefined1 *local_28; code *local_24; undefined1 *local_20; code *local_1c; undefined1 *local_18; code *local_14; code *local_10; code *local_c; code *local_8; local_124[0] = (code *)0x60001; local_124[1] = _glfwInitWin32; local_124[2] = (code *)&LAB_00a814f0; local_124[3] = FUN_00a5e920; local_114 = FUN_00a5e980; local_110 = FUN_00a5e9d0; local_10c = FUN_00a5e630; local_108 = FUN_0042d7e0; local_104 = FUN_00a5eb80; local_100 = FUN_00a5ebb0; local_fc = FUN_00a5ec90; local_f8 = FUN_00a5ecb0; local_f4 = FUN_00a5eb30; local_f0 = FUN_00a5eb70; local_ec = FUN_00a5ecd0; local_e8 = &LAB_00a5edb0; local_e4 = &LAB_00aa8c10; local_e0 = &LAB_00aa8c60; local_dc = _glfwPollJoystickWin32; local_d8 = &LAB_00aa9350; local_d4 = FUN_00aa9360; local_d0 = guard_check_icall; local_cc = FUN_00a81f70; local_c8 = FUN_00a82000; local_c4 = FUN_00a820f0; local_c0 = _glfwGetVideoModesWin32; local_bc = FUN_00a82500; local_b8 = FUN_00a82600; local_b4 = FUN_00a826a0; local_b0 = FUN_00a5d390; local_ac = FUN_00a5d4e0; local_a8 = FUN_00a5d580; local_a4 = FUN_00a5d5c0; local_a0 = FUN_00a5d6c0; local_9c = FUN_00a5d710; local_98 = FUN_00a5d830; local_94 = FUN_00a5d880; local_90 = FUN_00a5d9e0; local_8c = FUN_00a5da50; local_88 = FUN_00a5dad0; local_84 = FUN_00a5db20; local_80 = FUN_00a5dc90; local_7c = FUN_00a5dd90; local_78 = FUN_00a5ddb0; local_74 = FUN_00a5ddd0; local_70 = FUN_00a5df80; local_6c = FUN_00a5dff0; local_68 = FUN_00a5e010; local_64 = FUN_00a5e030; local_60 = _glfwSetWindowMonitorWin32; local_5c = FUN_00a5e340; local_58 = FUN_00a5e360; local_54 = FUN_00a5e380; local_50 = FUN_00a5e3a0; local_4c = FUN_00a5e3c0; local_48 = FUN_00a5e3d0; local_44 = FUN_00a5e540; local_40 = FUN_00a5e450; local_3c = FUN_00a5e450; local_38 = FUN_00a5e460; local_34 = FUN_00a5e5b0; local_30 = FUN_00a5e490; local_2c = _glfwPollEventsWin32; local_28 = &LAB_00a5e8c0; local_24 = FUN_00a5e8d0; local_20 = &LAB_00a5e900; local_1c = FUN_00a5ee90; local_18 = &LAB_00a5ef70; local_14 = FUN_00a5ef80; local_10 = FUN_00a5ef90; local_c = FUN_00a5efc0; local_8 = FUN_00a5f000; ppcVar2 = local_124; for (iVar1 = 0x48; iVar1 != 0; iVar1 = iVar1 + -1) { *param_2 = *ppcVar2; ppcVar2 = ppcVar2 + 1; param_2 = param_2 + 1; } return 1; } //@@ 00a812f0 _glfwInitWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4: pointer stored in the _GLFWplatform table built by _glfwConnectWin32 (00a81050, mov [ebp-0x11c],0xa812f0); loadLibraries/createKeyTables, DPI awareness by _glfwIsWindows10BuildOrGreaterWin32/_glfwIsWindowsVersionOrGreaterWin32, helper window "GLFW3 Helper"/"GLFW message window", then _glfwPollMonitorsWin32 */ undefined4 _glfwInitWin32(void) { int iVar1; undefined4 extraout_ECX; undefined4 extraout_ECX_00; WNDCLASSEXW local_78; tagMSG tStack_48; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined4 uStack_20; undefined4 uStack_1c; undefined4 uStack_18; undefined4 uStack_14; undefined4 uStack_10; uint local_c; local_c = __security_cookie ^ (uint)&local_78; iVar1 = loadLibraries(); if (iVar1 != 0) { glfw_createKeyTables(); FUN_00a80d30(); iVar1 = _glfwIsWindows10BuildOrGreaterWin32(); if (iVar1 == 0) { iVar1 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX); if (iVar1 == 0) { iVar1 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX_00); if (iVar1 != 0) { (*DAT_00c75a9c)(); } } else { (*DAT_00c75ad0)(2); } } else { (*DAT_00c75aa8)(0xfffffffc); } local_78.cbSize = 0x30; memset(&local_78.style,0,0x2c); local_78.hInstance = DAT_00c74cb0; local_78.style = 0x20; local_78.lpfnWndProc = FUN_00a80a40; local_78.lpszClassName = L"GLFW3 Helper"; DAT_00c74cb8 = RegisterClassExW(&local_78); if (DAT_00c74cb8 == 0) { _glfwInputErrorWin32(); return 0; } DAT_00c74cb4 = CreateWindowExW(0x300,(LPCWSTR)(uint)DAT_00c74cb8,L"GLFW message window", 0x6000000,0,0,1,1,(HWND)0x0,(HMENU)0x0,DAT_00c74cb0,(LPVOID)0x0); if (DAT_00c74cb4 != (HWND)0x0) { ShowWindow(DAT_00c74cb4,0); uStack_24 = 0; uStack_10 = 0; uStack_2c = 0x20; uStack_28 = 5; uStack_20 = 0x4d1e55b2; uStack_1c = 0x11cff16f; uStack_18 = 0x1100cb88; uStack_14 = 0x30000011; DAT_00c74cbc = RegisterDeviceNotificationW(DAT_00c74cb4,&uStack_2c,0); iVar1 = PeekMessageW(&tStack_48,DAT_00c74cb4,0,0,1); while (iVar1 != 0) { TranslateMessage(&tStack_48); DispatchMessageW(&tStack_48); iVar1 = PeekMessageW(&tStack_48,DAT_00c74cb4,0,0,1); } _glfwPollMonitorsWin32(); return 1; } _glfwInputErrorWin32(); } return 0; } //@@ 00a81630 FUN_00a81630 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a81630(HMONITOR param_1,undefined4 param_2,undefined4 param_3,int param_4) { ushort uVar1; BOOL BVar2; ushort *puVar3; uint uVar4; ushort *puVar5; bool bVar6; tagMONITORINFO local_78; ushort local_50 [34]; uint local_c; local_c = __security_cookie ^ (uint)&local_78; memset(&local_78.rcMonitor,0,100); local_78.cbSize = 0x68; BVar2 = GetMonitorInfoW(param_1,&local_78); if (BVar2 != 0) { puVar3 = (ushort *)(param_4 + 0xd4); puVar5 = local_50; do { uVar1 = *puVar5; bVar6 = uVar1 < *puVar3; if (uVar1 != *puVar3) { LAB_00a816a6: uVar4 = -(uint)bVar6 | 1; goto LAB_00a816ab; } if (uVar1 == 0) break; uVar1 = puVar5[1]; bVar6 = uVar1 < puVar3[1]; if (uVar1 != puVar3[1]) goto LAB_00a816a6; puVar5 = puVar5 + 2; puVar3 = puVar3 + 2; } while (uVar1 != 0); uVar4 = 0; LAB_00a816ab: if (uVar4 == 0) { *(HMONITOR *)(param_4 + 0xd0) = param_1; return 1; } } return 1; } //@@ 00a816f0 createMonitor /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: glfw win32_monitor.c static createMonitor(adapter, display): EnumDisplaySettingsW(adapter->DeviceName), CreateDCW(L"DISPLAY"), widthMM/heightMM via GetDeviceCaps (HORZSIZE/VERTSIZE or LOGPIXELS on old Windows), _glfwAllocMonitor (00a6c190), DISPLAY_DEVICE_MODESPRUNED flag; called twice from _glfwPollMonitorsWin32 (00a81980) */ int createMonitor(void) { double dVar1; WCHAR WVar2; int iVar3; HDC hdc; int iVar4; int in_ECX; undefined4 extraout_ECX; LPCWSTR pWVar5; int in_EDX; LPCWSTR pWVar6; double dVar7; DEVMODEW local_fc; RECT local_18; undefined4 local_8; local_8 = __security_cookie ^ (uint)((&local_fc)[1].dmDeviceName + 0xe); iVar3 = FUN_00a80bb0(); if (iVar3 == 0) { return 0; } memset(&local_fc,0,0xdc); pWVar5 = (LPCWSTR)(in_ECX + 4); local_fc.dmSize = 0xdc; EnumDisplaySettingsW(pWVar5,0xffffffff,&local_fc); hdc = CreateDCW(L"DISPLAY",pWVar5,(LPCWSTR)0x0,(DEVMODEW *)0x0); iVar4 = _glfwIsWindowsVersionOrGreaterWin32(extraout_ECX); if (iVar4 == 0) { GetDeviceCaps(hdc,0x58); dVar7 = (double)(int)local_fc.dmPelsHeight; dVar1 = __uint_to_double_fixup[-((int)local_fc.dmPelsHeight >> 0x1f)]; iVar4 = GetDeviceCaps(hdc,0x5a); iVar4 = (int)(((float)(dVar7 + dVar1) * 25.4) / (float)iVar4); } else { GetDeviceCaps(hdc,4); iVar4 = GetDeviceCaps(hdc,6); } DeleteDC(hdc); iVar4 = FUN_00a6c190(iVar4); (*g_glfwDeallocate)(iVar3,g_glfwAllocatorUser); if ((*(uint *)(in_ECX + 0x144) & 0x8000000) != 0) { *(undefined4 *)(iVar4 + 0x194) = 1; } pWVar6 = pWVar5; do { WVar2 = *pWVar6; pWVar6 = pWVar6 + 1; *(WCHAR *)((iVar4 - (int)pWVar5) + 0xd2 + (int)pWVar6) = WVar2; } while (WVar2 != L'\0'); WideCharToMultiByte(0xfde9,0,pWVar5,-1,(LPSTR)(iVar4 + 0x154),0x20,(LPCSTR)0x0,(LPBOOL)0x0); if (in_EDX != 0) { pWVar6 = (LPCWSTR)(in_EDX + 4); pWVar5 = pWVar6; do { WVar2 = *pWVar5; pWVar5 = pWVar5 + 1; *(WCHAR *)((iVar4 - (int)pWVar6) + 0x112 + (int)pWVar5) = WVar2; } while (WVar2 != L'\0'); WideCharToMultiByte(0xfde9,0,pWVar6,-1,(LPSTR)(iVar4 + 0x174),0x20,(LPCSTR)0x0,(LPBOOL)0x0); } local_18.right = local_fc.dmPelsWidth + local_fc.field6_0x4c.field1.dmPosition.x; local_18.bottom = local_fc.dmPelsHeight + local_fc.field6_0x4c.field1.dmPosition.y; local_18.left = local_fc.field6_0x4c.field1.dmPosition.x; local_18.top = local_fc.field6_0x4c.field1.dmPosition.y; EnumDisplayMonitors((HDC)0x0,&local_18,FUN_00a81630,iVar4); return iVar4; } //@@ 00a81980 _glfwPollMonitorsWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_monitor.c: copies _glfw.monitors (g_glfwMonitorCount, "Allocation size overflow"), EnumDisplayDevices adapters/displays (DISPLAY_DEVICE.DeviceName memset 0x344), _glfwInputMonitor; callers _glfwInitWin32 and helperWindowProc (WM_DISPLAYCHANGE) */ void _glfwPollMonitorsWin32(void) { size_t _Size; WCHAR WVar1; int iVar2; int iVar3; int iVar4; BOOL BVar5; WCHAR *pWVar6; uint uVar7; WCHAR *pWVar8; void *pvVar9; DWORD iDevNum; bool bVar10; undefined4 uVar11; char *pcVar12; uint local_6ac; DWORD local_6a8; DWORD local_6a4; _DISPLAY_DEVICEW local_6a0; _DISPLAY_DEVICEW local_358; uint local_c; iVar3 = g_glfwMonitorCount; local_c = __security_cookie ^ (uint)&local_6ac; pvVar9 = (void *)0x0; if (g_glfwMonitorCount == 0) goto LAB_00a81a11; if ((uint)g_glfwMonitorCount < 0x40000000) { _Size = g_glfwMonitorCount * 4; pvVar9 = (void *)(*g_glfwAllocate)(_Size,g_glfwAllocatorUser); if (pvVar9 == (void *)0x0) { pcVar12 = (char *)0x0; uVar11 = 0x10005; goto LAB_00a819ef; } pvVar9 = memset(pvVar9,0,_Size); } else { pcVar12 = "Allocation size overflow"; uVar11 = 0x10004; LAB_00a819ef: _glfwInputError(uVar11,pcVar12); pvVar9 = (void *)0x0; } memcpy(pvVar9,DAT_00c73ca4,g_glfwMonitorCount << 2); LAB_00a81a11: local_6a4 = 0; memset(local_6a0.DeviceName,0,0x344); local_6a0.cb = 0x348; iVar4 = EnumDisplayDevicesW((LPCWSTR)0x0,0,&local_6a0,0); while (iVar4 != 0) { if ((local_6a0.StateFlags & 1) != 0) { iDevNum = 0; local_6a8 = 0; local_6ac = ~(local_6a0.StateFlags >> 2) & 1; memset(local_358.DeviceName,0,0x344); local_358.cb = 0x348; BVar5 = EnumDisplayDevicesW(local_6a0.DeviceName,0,&local_358,0); if (BVar5 != 0) { do { if (((byte)local_358.StateFlags & 1) != 0) { iVar4 = 0; if (0 < iVar3) { do { iVar2 = *(int *)((int)pvVar9 + iVar4 * 4); if (iVar2 != 0) { pWVar6 = local_358.DeviceName; pWVar8 = (WCHAR *)(iVar2 + 0x114); do { WVar1 = *pWVar8; bVar10 = (ushort)WVar1 < (ushort)*pWVar6; if (WVar1 != *pWVar6) { LAB_00a81b0e: uVar7 = -(uint)bVar10 | 1; goto LAB_00a81b13; } if (WVar1 == L'\0') break; WVar1 = pWVar8[1]; bVar10 = (ushort)WVar1 < (ushort)pWVar6[1]; if (WVar1 != pWVar6[1]) goto LAB_00a81b0e; pWVar8 = pWVar8 + 2; pWVar6 = pWVar6 + 2; } while (WVar1 != L'\0'); uVar7 = 0; LAB_00a81b13: if (uVar7 == 0) { *(undefined4 *)((int)pvVar9 + iVar4 * 4) = 0; EnumDisplayMonitors((HDC)0x0,(LPCRECT)0x0,FUN_00a81630, *(LPARAM *)((int)DAT_00c73ca4 + iVar4 * 4)); if (iVar4 < iVar3) goto LAB_00a81b73; break; } } iVar4 = iVar4 + 1; } while (iVar4 < iVar3); } iVar4 = createMonitor(); if (iVar4 == 0) goto LAB_00a81c9b; _glfwInputMonitor(local_6ac); local_6ac = 1; LAB_00a81b73: iDevNum = local_6a8; } iDevNum = iDevNum + 1; local_6a8 = iDevNum; memset(local_358.DeviceName,0,0x344); local_358.cb = 0x348; BVar5 = EnumDisplayDevicesW(local_6a0.DeviceName,iDevNum,&local_358,0); } while (BVar5 != 0); if (iDevNum != 0) goto LAB_00a81c39; } iVar4 = 0; if (0 < iVar3) { do { iVar2 = *(int *)((int)pvVar9 + iVar4 * 4); if (iVar2 != 0) { pWVar6 = local_6a0.DeviceName; pWVar8 = (WCHAR *)(iVar2 + 0xd4); do { WVar1 = *pWVar8; bVar10 = (ushort)WVar1 < (ushort)*pWVar6; if (WVar1 != *pWVar6) { LAB_00a81bfc: uVar7 = -(uint)bVar10 | 1; goto LAB_00a81c01; } if (WVar1 == L'\0') break; WVar1 = pWVar8[1]; bVar10 = (ushort)WVar1 < (ushort)pWVar6[1]; if (WVar1 != pWVar6[1]) goto LAB_00a81bfc; pWVar8 = pWVar8 + 2; pWVar6 = pWVar6 + 2; } while (WVar1 != L'\0'); uVar7 = 0; LAB_00a81c01: if (uVar7 == 0) { *(undefined4 *)((int)pvVar9 + iVar4 * 4) = 0; if (iVar4 < iVar3) goto LAB_00a81c39; break; } } iVar4 = iVar4 + 1; } while (iVar4 < iVar3); } iVar4 = createMonitor(); if (iVar4 == 0) goto LAB_00a81c9b; _glfwInputMonitor(local_6ac); } LAB_00a81c39: local_6a4 = local_6a4 + 1; memset(local_6a0.DeviceName,0,0x344); local_6a0.cb = 0x348; iVar4 = EnumDisplayDevicesW((LPCWSTR)0x0,local_6a4,&local_6a0,0); } iVar4 = 0; if (0 < iVar3) { do { if (*(int *)((int)pvVar9 + iVar4 * 4) != 0) { _glfwInputMonitor(0); } iVar4 = iVar4 + 1; } while (iVar4 < iVar3); } LAB_00a81c9b: if (pvVar9 != (void *)0x0) { (*g_glfwDeallocate)(pvVar9,g_glfwAllocatorUser); } return; } //@@ 00a81cd0 _glfwSetVideoModeWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_monitor.c: "Win32: Failed to set video mode: %s" with ChangeDisplaySettingsEx result strings ("The system uses DualView", "Graphics mode not supported"...), inlined _glfwChooseVideoMode over modes +0x90/count +0x94; caller acquireMonitor */ void _glfwSetVideoModeWin32(void) { int iVar1; uint uVar2; uint uVar3; LONG LVar4; char *pcVar5; int in_ECX; uint uVar6; int *in_EDX; uint uVar7; DWORD *pDVar8; DWORD *pDVar9; int local_114; uint local_110; uint local_10c; uint local_108; DEVMODEW local_104; undefined1 local_20 [24]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_20 + 0x1c); local_108 = 0xffffffff; local_110 = 0xffffffff; pDVar8 = (DWORD *)0x0; local_10c = 0xffffffff; iVar1 = FUN_00a6be30(); if ((iVar1 != 0) && (local_114 = *(int *)(in_ECX + 0x94), 0 < local_114)) { pDVar9 = *(DWORD **)(in_ECX + 0x90); do { uVar6 = 0; if (in_EDX[2] != -1) { uVar2 = pDVar9[2] - in_EDX[2]; uVar6 = (int)uVar2 >> 0x1f; uVar6 = (uVar2 ^ uVar6) - uVar6; } if (in_EDX[3] != -1) { uVar2 = pDVar9[3] - in_EDX[3]; uVar7 = (int)uVar2 >> 0x1f; uVar6 = uVar6 + ((uVar2 ^ uVar7) - uVar7); } if (in_EDX[4] != -1) { uVar2 = pDVar9[4] - in_EDX[4]; uVar7 = (int)uVar2 >> 0x1f; uVar6 = uVar6 + ((uVar2 ^ uVar7) - uVar7); } uVar2 = (*pDVar9 - *in_EDX) * (*pDVar9 - *in_EDX) + (pDVar9[1] - in_EDX[1]) * (pDVar9[1] - in_EDX[1]); uVar7 = (int)uVar2 >> 0x1f; uVar7 = (uVar2 ^ uVar7) - uVar7; if (in_EDX[5] == -1) { uVar2 = ~pDVar9[5]; } else { uVar3 = pDVar9[5] - in_EDX[5]; uVar2 = (int)uVar3 >> 0x1f; uVar2 = (uVar3 ^ uVar2) - uVar2; } if ((uVar6 < local_110) || ((uVar6 == local_110 && ((uVar7 < local_108 || ((uVar7 == local_108 && (uVar2 < local_10c)))))))) { pDVar8 = pDVar9; local_110 = uVar6; local_10c = uVar2; local_108 = uVar7; } pDVar9 = pDVar9 + 6; local_114 = local_114 + -1; } while (local_114 != 0); } FUN_00a82500(in_ECX,local_20); iVar1 = FUN_00a6bdc0(local_20,pDVar8); if (iVar1 != 0) { memset(&local_104,0,0xdc); local_104.dmFields = (DWORD)&LAB_005bfffd_3; local_104.dmSize = 0xdc; local_104.dmPelsWidth = *pDVar8; local_104.dmPelsHeight = pDVar8[1]; local_104.dmBitsPerPel = pDVar8[4] + pDVar8[3] + pDVar8[2]; local_104.dmDisplayFrequency = pDVar8[5]; if ((local_104.dmBitsPerPel < 0xf) || (0x17 < local_104.dmBitsPerPel)) { local_104.dmBitsPerPel = 0x20; } LVar4 = ChangeDisplaySettingsExW((LPCWSTR)(in_ECX + 0xd4),&local_104,(HWND)0x0,4,(LPVOID)0x0); if (LVar4 == 0) { *(undefined4 *)(in_ECX + 0x198) = 1; return; } if (LVar4 == -6) { pcVar5 = "The system uses DualView"; } else if (LVar4 == -4) { pcVar5 = "Invalid flags"; } else if (LVar4 == -2) { pcVar5 = "Graphics mode not supported"; } else if (LVar4 == -5) { pcVar5 = "Invalid parameter"; } else if (LVar4 == -1) { pcVar5 = "Graphics mode failed"; } else if (LVar4 == -3) { pcVar5 = "Failed to write to registry"; } else { pcVar5 = "Computer restart required"; if (LVar4 != 1) { pcVar5 = "Unknown error"; } } _glfwInputError(0x10008,"Win32: Failed to set video mode: %s",pcVar5); } return; } //@@ 00a81f70 FUN_00a81f70 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a81f70(int param_1,LONG *param_2,LONG *param_3) { DEVMODEW local_e4; undefined4 local_8; local_8 = __security_cookie ^ (uint)((&local_e4)[1].dmDeviceName + 2); memset(&local_e4,0,0xdc); local_e4.dmSize = 0xdc; EnumDisplaySettingsExW((LPCWSTR)(param_1 + 0xd4),0xffffffff,&local_e4,4); if (param_2 != (LONG *)0x0) { *param_2 = local_e4.field6_0x4c.field1.dmPosition.x; } if (param_3 != (LONG *)0x0) { *param_3 = local_e4.field6_0x4c.field1.dmPosition.y; } return; } //@@ 00a82000 FUN_00a82000 void FUN_00a82000(int param_1,float *param_2,float *param_3) { undefined4 uVar1; float *pfVar2; int iVar3; HDC hdc; float *pfVar4; pfVar2 = param_3; pfVar4 = param_2; uVar1 = *(undefined4 *)(param_1 + 0xd0); if (param_2 != (float *)0x0) { *param_2 = 0.0; } if (param_3 != (float *)0x0) { *param_3 = 0.0; } iVar3 = _glfwIsWindowsVersionOrGreaterWin32(); if (iVar3 == 0) { hdc = GetDC((HWND)0x0); param_1 = GetDeviceCaps(hdc,0x58); param_3 = (float *)GetDeviceCaps(hdc,0x5a); ReleaseDC((HWND)0x0,hdc); pfVar4 = param_2; } else { iVar3 = (*DAT_00c75ad4)(uVar1,0,¶m_1,¶m_3); if (iVar3 != 0) { _glfwInputError(0x10008,"Win32: Failed to query monitor DPI"); return; } } if (pfVar4 != (float *)0x0) { *pfVar4 = (float)((double)param_1 + __uint_to_double_fixup[-(param_1 >> 0x1f)]) / 96.0; } if (pfVar2 != (float *)0x0) { *pfVar2 = (float)((double)(int)param_3 + __uint_to_double_fixup[-((int)param_3 >> 0x1f)]) / 96.0 ; } return; } //@@ 00a820f0 FUN_00a820f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a820f0(int param_1,int *param_2,int *param_3,int *param_4,int *param_5) { undefined1 auStack_3c [4]; int *local_38; tagMONITORINFO local_34; uint local_c; local_c = __security_cookie ^ (uint)auStack_3c; local_38 = param_2; local_34.cbSize = 0x28; local_34.rcMonitor.left = 0; local_34.rcMonitor.top = 0; local_34.rcMonitor.right = 0; local_34.rcMonitor.bottom = 0; local_34.dwFlags = 0; local_34.rcWork.left = 0; local_34.rcWork.top = 0; local_34.rcWork.right = 0; local_34.rcWork.bottom = 0; GetMonitorInfoW(*(HMONITOR *)(param_1 + 0xd0),&local_34); if (local_38 != (int *)0x0) { *local_38 = local_34.rcWork.left; } if (param_3 != (int *)0x0) { *param_3 = local_34.rcWork.top; } if (param_4 != (int *)0x0) { *param_4 = local_34.rcWork.right - local_34.rcWork.left; } if (param_5 != (int *)0x0) { *param_5 = local_34.rcWork.bottom - local_34.rcWork.top; } return; } //@@ 00a82190 _glfwGetVideoModesWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_monitor.c: slot 25 (getVideoModes) of the _GLFWplatform table in _glfwConnectWin32 ([ebp-0xbc]); EnumDisplaySettingsW loop over monitor +0xd4 adapter name, dmBitsPerPel split into RGB bits (32 -> 8/8/8), dedup, "Allocation size overflow" (_glfw_calloc) */ undefined4 * _glfwGetVideoModesWin32(int param_1,int *param_2) { DWORD *pDVar1; DWORD DVar2; BOOL BVar3; DWORD DVar4; int iVar5; LONG LVar6; void *_Dst; int iVar7; int *piVar8; undefined4 *puVar9; uint _Size; undefined4 uVar10; char *pcVar11; undefined1 auStack_158 [4]; int *local_154; DWORD local_150; DWORD local_140; int local_13c; DWORD local_138; DWORD local_130; DWORD local_12c; int local_128; uint local_124; DWORD local_120; DWORD DStack_11c; DWORD DStack_118; DWORD DStack_114; DWORD local_110; DWORD DStack_10c; DEVMODEW local_f8; uint local_14; local_14 = __security_cookie ^ (uint)auStack_158; puVar9 = (undefined4 *)0x0; local_13c = param_1; local_130 = 0; local_128 = 0; *param_2 = 0; local_154 = param_2; memset(&local_f8,0,0xdc); local_f8.dmSize = 0xdc; BVar3 = EnumDisplaySettingsW((LPCWSTR)(local_13c + 0xd4),0,&local_f8); if (BVar3 != 0) { local_124 = 0; do { local_130 = local_130 + 1; if (0xe < local_f8.dmBitsPerPel) { local_140 = local_f8.dmPelsHeight; DStack_11c = local_f8.dmPelsHeight; local_120 = local_f8.dmPelsWidth; DStack_10c = local_f8.dmDisplayFrequency; if (local_f8.dmBitsPerPel == 0x20) { iVar7 = 0; local_110 = 8; LAB_00a82263: local_12c = local_110 + 1; DStack_114 = local_110; } else { local_150 = (int)local_f8.dmBitsPerPel / 3; iVar7 = (int)local_f8.dmBitsPerPel % 3; local_110 = local_150; if (iVar7 < 1) goto LAB_00a82263; local_12c = local_150 + 1; DStack_114 = local_12c; } if (iVar7 == 2) { } else { local_12c = local_110; } iVar7 = 0; local_138 = local_110; DStack_118 = local_12c; if (0 < *local_154) { piVar8 = puVar9 + 3; local_150 = DStack_114 + local_12c + local_110; local_140 = local_f8.dmPelsHeight * local_f8.dmPelsWidth; do { DVar4 = piVar8[-1] + piVar8[1] + *piVar8; DVar2 = piVar8[-3]; if (DVar4 == local_150) { if (piVar8[-2] * DVar2 == local_140) { if (DVar2 == local_f8.dmPelsWidth) { iVar5 = piVar8[2] - local_f8.dmDisplayFrequency; } else { iVar5 = DVar2 - local_f8.dmPelsWidth; } } else { iVar5 = piVar8[-2] * DVar2 - local_140; } } else { iVar5 = DVar4 - local_150; } if (iVar5 == 0) { if (iVar7 < *local_154) goto LAB_00a823f4; break; } iVar7 = iVar7 + 1; piVar8 = piVar8 + 6; } while (iVar7 < *local_154); } if ((*(int *)(local_13c + 0x194) == 0) || (LVar6 = ChangeDisplaySettingsExW ((LPCWSTR)(local_13c + 0xd4),&local_f8,(HWND)0x0,2,(LPVOID)0x0), LVar6 == 0)) { if (*local_154 == local_128) { local_128 = local_128 + 0x80; _Size = local_124 + 0xc00; local_124 = _Size; if (puVar9 == (undefined4 *)0x0) { if (_Size != 0) { if ((int)(0xffffffff / (ulonglong)_Size) == 0) { pcVar11 = "Allocation size overflow"; uVar10 = 0x10004; goto LAB_00a823c9; } _Dst = (void *)(*g_glfwAllocate)(_Size,g_glfwAllocatorUser); if (_Dst == (void *)0x0) goto LAB_00a823c2; puVar9 = memset(_Dst,0,_Size); goto LAB_00a823d3; } } else if (_Size == 0) { (*g_glfwDeallocate)(puVar9,g_glfwAllocatorUser); } else { puVar9 = (undefined4 *)(*DAT_00c73688)(puVar9,_Size); if (puVar9 != (undefined4 *)0x0) goto LAB_00a823d3; LAB_00a823c2: pcVar11 = (char *)0x0; uVar10 = 0x10005; LAB_00a823c9: _glfwInputError(uVar10,pcVar11); } puVar9 = (undefined4 *)0x0; } LAB_00a823d3: *local_154 = *local_154 + 1; iVar7 = *local_154; pDVar1 = puVar9 + iVar7 * 6 + -6; *pDVar1 = local_120; pDVar1[1] = DStack_11c; pDVar1[2] = DStack_118; pDVar1[3] = DStack_114; puVar9[iVar7 * 6 + -2] = local_110; (puVar9 + iVar7 * 6 + -2)[1] = DStack_10c; } } LAB_00a823f4: memset(&local_f8,0,0xdc); local_f8.dmSize = 0xdc; BVar3 = EnumDisplaySettingsW((LPCWSTR)(local_13c + 0xd4),local_130,&local_f8); } while (BVar3 != 0); param_2 = local_154; } if (*param_2 == 0) { puVar9 = (undefined4 *)(*g_glfwAllocate)(0x18,g_glfwAllocatorUser); if (puVar9 == (undefined4 *)0x0) { _glfwInputError(0x10005,0); puVar9 = (undefined4 *)0x0; } else { *puVar9 = 0; puVar9[1] = 0; puVar9[2] = 0; puVar9[3] = 0; *(undefined8 *)(puVar9 + 4) = 0; } FUN_00a82500(local_13c,puVar9); *param_2 = 1; } return puVar9; } //@@ 00a82500 FUN_00a82500 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a82500(int param_1,DWORD *param_2) { DWORD DVar1; BOOL BVar2; DEVMODEW local_ec; undefined4 local_8; local_8 = __security_cookie ^ (uint)((&local_ec)[1].dmDeviceName + 6); memset(&local_ec,0,0xdc); local_ec.dmSize = 0xdc; BVar2 = EnumDisplaySettingsW((LPCWSTR)(param_1 + 0xd4),0xffffffff,&local_ec); if (BVar2 == 0) { _glfwInputError(0x10008,"Win32: Failed to query display settings"); return 0; } *param_2 = local_ec.dmPelsWidth; param_2[1] = local_ec.dmPelsHeight; param_2[5] = local_ec.dmDisplayFrequency; if (local_ec.dmBitsPerPel == 0x20) { param_2[4] = 8; param_2[3] = 8; param_2[2] = 8; } else { DVar1 = (int)local_ec.dmBitsPerPel / 3; param_2[4] = DVar1; param_2[3] = DVar1; param_2[2] = DVar1; if (0 < (int)local_ec.dmBitsPerPel % 3) { param_2[3] = DVar1 + 1; } if ((int)local_ec.dmBitsPerPel % 3 == 2) { param_2[2] = DVar1 + 1; } } return 1; } //@@ 00a82600 FUN_00a82600 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a82600(int param_1,undefined4 *param_2) { HDC hdc; int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 local_608 [128]; undefined4 local_408 [128]; undefined4 local_208 [128]; uint local_8; local_8 = __security_cookie ^ (uint)(local_208 + 0x81); hdc = CreateDCW(L"DISPLAY",(LPCWSTR)(param_1 + 0xd4),(LPCWSTR)0x0,(DEVMODEW *)0x0); GetDeviceGammaRamp(hdc,local_608); DeleteDC(hdc); FUN_00a6c200(); puVar2 = local_608; puVar3 = (undefined4 *)*param_2; for (iVar1 = 0x80; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } puVar2 = local_408; puVar3 = (undefined4 *)param_2[1]; for (iVar1 = 0x80; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } puVar2 = local_208; puVar3 = (undefined4 *)param_2[2]; for (iVar1 = 0x80; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } return 1; } //@@ 00a826a0 FUN_00a826a0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a826a0(int param_1,undefined4 *param_2) { HDC hdc; int iVar1; undefined4 *puVar2; undefined4 *puVar3; undefined4 local_608 [128]; undefined4 local_408 [128]; undefined4 local_208 [128]; uint local_8; local_8 = __security_cookie ^ (uint)(local_208 + 0x81); if (param_2[3] != 0x100) { _glfwInputError(0x10008,"Win32: Gamma ramp size must be 256"); return; } puVar2 = (undefined4 *)*param_2; puVar3 = local_608; for (iVar1 = 0x80; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } puVar2 = (undefined4 *)param_2[1]; puVar3 = local_408; for (iVar1 = 0x80; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } puVar2 = (undefined4 *)param_2[2]; puVar3 = local_208; for (iVar1 = 0x80; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar3 = *puVar2; puVar2 = puVar2 + 1; puVar3 = puVar3 + 1; } hdc = CreateDCW(L"DISPLAY",(LPCWSTR)(param_1 + 0xd4),(LPCWSTR)0x0,(DEVMODEW *)0x0); SetDeviceGammaRamp(hdc,local_608); DeleteDC(hdc); return; } //@@ 00a82750 glfw_getEGLErrorString /* DB: GLFW egl_context.c getEGLErrorString: switch 0x3000 EGL_SUCCESS "Success" .. 0x300e EGL_CONTEXT_LOST, default "ERROR: UNKNOWN EGL ERROR"; callers chooseEGLConfig, _glfwCreateContextEGL prototype: db/protos.zhl */ byte * __fastcall glfw_getEGLErrorString(int error) { switch(error) { case 0x3000: return (byte *)"Success"; case 0x3001: return (byte *)"EGL is not or could not be initialized"; case 0x3002: return (byte *)"EGL cannot access a requested resource"; case 0x3003: return (byte *)"EGL failed to allocate resources for the requested operation"; case 0x3004: return (byte *)"An unrecognized attribute or attribute value was passed in the attribute list"; case 0x3005: return (byte *)"An EGLConfig argument does not name a valid EGL frame buffer configuration"; case 0x3006: return (byte *)"An EGLContext argument does not name a valid EGL rendering context"; case 0x3007: return (byte *) "The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer valid" ; case 0x3008: return (byte *)"An EGLDisplay argument does not name a valid EGL display connection"; case 0x3009: return (byte *)"Arguments are inconsistent"; case 0x300a: return (byte *)"A NativePixmapType argument does not refer to a valid native pixmap"; case 0x300b: return (byte *)"A NativeWindowType argument does not refer to a valid native window"; case 0x300c: return (byte *)"One or more argument values are invalid"; case 0x300d: return (byte *) "An EGLSurface argument does not name a valid surface configured for GL rendering"; case 0x300e: return (byte *)"The application must destroy all contexts and reinitialise"; default: return (byte *)"ERROR: UNKNOWN EGL ERROR"; } } //@@ 00a82800 glfw_chooseEGLConfig /* DB: GLFW egl_context.c chooseEGLConfig: strings "EGL: No EGLConfigs returned", "EGL: Failed to find support for OpenGL ES 2 or later", "EGL: Stereo rendering not supported", "EGL: Failed to find a suitable EGLConfig"; only caller _glfwCreateContextEGL */ bool glfw_chooseEGLConfig(undefined4 *param_1) { int iVar1; char *pcVar2; int *in_ECX; int in_EDX; undefined4 *puVar3; int iVar4; int iVar5; undefined4 uVar6; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_3c; undefined4 local_38; undefined4 local_34; undefined4 local_30; uint local_2c; byte local_28 [4]; int local_24; int local_20; int local_1c; int local_18; int local_14; uint local_10; int local_c; int local_8; local_18 = 0; if (*in_ECX == 0x30002) { local_10 = 1; if (in_ECX[2] != 1) { local_10 = 4; } } else { local_10 = 8; } if (*(int *)(in_EDX + 0x2c) != 0) { _glfwInputError(0x10009,"EGL: Stereo rendering not supported"); return false; } local_1c = in_EDX; (*DAT_00c74c10)(g_glfwEglDisplay,0,0,&local_8); if (local_8 == 0) { _glfwInputError(0x10006,"EGL: No EGLConfigs returned"); return false; } iVar1 = _glfw_calloc(); local_14 = iVar1; (*DAT_00c74c10)(g_glfwEglDisplay,iVar1,local_8,&local_8); local_20 = _glfw_calloc(); iVar5 = 0; local_c = 0; iVar4 = 0; if (0 < local_8) { puVar3 = (undefined4 *)(local_20 + 8); do { uVar6 = *(undefined4 *)(iVar1 + iVar5 * 4); (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x303f,&local_24); if ((local_24 == 0x308e) && ((*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3033,local_28), (local_28[0] & 4) != 0)) { (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3040,&local_2c); if ((local_2c & local_10) == 0) { local_18 = 1; } else { (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3024,&local_30); puVar3[-2] = local_30; (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3023,&local_34); puVar3[-1] = local_34; (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3022,&local_38); *puVar3 = local_38; (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3021,&local_3c); puVar3[1] = local_3c; (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3025,&local_40); puVar3[2] = local_40; (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3026,&local_44); puVar3[3] = local_44; (*DAT_00c74c0c)(g_glfwEglDisplay,uVar6,0x3031,&local_48); puVar3[10] = local_48; local_c = local_c + 1; puVar3[0xc] = *(undefined4 *)(local_1c + 0x38); puVar3[0xe] = uVar6; puVar3 = puVar3 + 0x11; } } iVar5 = iVar5 + 1; iVar1 = local_14; } while (iVar5 < local_8); iVar4 = local_18; } iVar5 = _glfwChooseFBConfig(local_c); if (iVar5 == 0) { if (iVar4 == 0) { pcVar2 = "EGL: Failed to find a suitable EGLConfig"; uVar6 = 0x10009; } else if (*in_ECX == 0x30002) { pcVar2 = "EGL: Failed to find support for OpenGL ES 2 or later"; if (in_ECX[2] == 1) { pcVar2 = "EGL: Failed to find support for OpenGL ES 1.x"; } uVar6 = 0x10006; } else { pcVar2 = "EGL: Failed to find support for OpenGL"; uVar6 = 0x10006; } _glfwInputError(uVar6,pcVar2); } else { *param_1 = *(undefined4 *)(iVar5 + 0x40); } if (iVar1 != 0) { (*g_glfwDeallocate)(iVar1,g_glfwAllocatorUser); } if (local_20 != 0) { (*g_glfwDeallocate)(local_20,g_glfwAllocatorUser); } return iVar5 != 0; } //@@ 00a82ad0 FUN_00a82ad0 void FUN_00a82ad0(LPVOID param_1) { int iVar1; byte *pbVar2; if (param_1 == (LPVOID)0x0) { iVar1 = (*DAT_00c74c38)(g_glfwEglDisplay,0,0,0); if (iVar1 == 0) { iVar1 = (*DAT_00c74c18)(); pbVar2 = glfw_getEGLErrorString(iVar1); _glfwInputError(0x10008,"EGL: Failed to clear current context: %s",pbVar2); return; } } else { iVar1 = (*DAT_00c74c38)(g_glfwEglDisplay,*(undefined4 *)((int)param_1 + 0x24c), *(undefined4 *)((int)param_1 + 0x24c), *(undefined4 *)((int)param_1 + 0x248)); if (iVar1 == 0) { iVar1 = (*DAT_00c74c18)(); pbVar2 = glfw_getEGLErrorString(iVar1); _glfwInputError(0x10008,"EGL: Failed to make context current: %s",pbVar2); return; } } if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x45); } TlsSetValue(DAT_00c74b84,param_1); return; } //@@ 00a82b90 FUN_00a82b90 void FUN_00a82b90(LPVOID param_1) { LPVOID pvVar1; if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar1 = TlsGetValue(DAT_00c74b84); if (param_1 == pvVar1) { (*DAT_00c74c3c)(g_glfwEglDisplay,*(undefined4 *)((int)param_1 + 0x24c)); return; } _glfwInputError(0x10008, "EGL: The context must be current on the calling thread when swapping buffers"); return; } //@@ 00a82bf0 FUN_00a82bf0 void FUN_00a82bf0(undefined4 param_1) { (*DAT_00c74c40)(g_glfwEglDisplay,param_1); return; } //@@ 00a82c10 FUN_00a82c10 undefined4 FUN_00a82c10(void) { int iVar1; iVar1 = (*DAT_00c74c44)(g_glfwEglDisplay,0x3055); if (iVar1 != 0) { iVar1 = FUN_00a6bb40(); if (iVar1 != 0) { return 1; } } return 0; } //@@ 00a82c50 FUN_00a82c50 void FUN_00a82c50(LPCSTR param_1) { LPVOID pvVar1; FARPROC pFVar2; if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x3f); } pvVar1 = TlsGetValue(DAT_00c74b84); if (pvVar1 == (LPVOID)0x0) { _wassert(L"window != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\egl_context.c" ,0x138); } if ((*(HMODULE *)((int)pvVar1 + 0x250) == (HMODULE)0x0) || (pFVar2 = GetProcAddress(*(HMODULE *)((int)pvVar1 + 0x250),param_1), pFVar2 == (FARPROC)0x0)) { (*DAT_00c74c48)(param_1); return; } return; } //@@ 00a82cc0 FUN_00a82cc0 void FUN_00a82cc0(int param_1) { if (((DAT_00c73694 != 0x60004) || (*(int *)(param_1 + 500) != 0x30001)) && (*(HMODULE *)(param_1 + 0x250) != (HMODULE)0x0)) { FreeLibrary(*(HMODULE *)(param_1 + 0x250)); *(undefined4 *)(param_1 + 0x250) = 0; } if (*(int *)(param_1 + 0x24c) != 0) { (*DAT_00c74c2c)(g_glfwEglDisplay,*(int *)(param_1 + 0x24c)); *(undefined4 *)(param_1 + 0x24c) = 0; } if (*(int *)(param_1 + 0x248) != 0) { (*DAT_00c74c30)(g_glfwEglDisplay,*(int *)(param_1 + 0x248)); *(undefined4 *)(param_1 + 0x248) = 0; } return; } //@@ 00a82d40 _glfwInitEGL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: GLFW egl_context.c: 'EGL: Library not found', loads EGL.dll entry points, eglGetPlatformDisplayEXT, EGL_ANGLE_platform_* extension checks */ undefined4 _glfwInitEGL(void) { void *pvVar1; char *pcVar2; undefined4 uVar3; byte *pbVar4; int iVar5; int local_24; char *local_20 [3]; char *local_14; local_14 = (char *)(__security_cookie ^ (uint)(local_20 + 4)); local_24 = 0; local_20[0] = "libEGL.dll"; local_20[1] = "EGL.dll"; local_20[2] = (char *)0x0; if (g_glfwEglHandle != (void *)0x0) { return 1; } iVar5 = 0; pcVar2 = "libEGL.dll"; pvVar1 = g_glfwEglHandle; while (g_glfwEglHandle = pvVar1, g_glfwEglHandle = LoadLibraryA(pcVar2), g_glfwEglHandle == (HMODULE)0x0) { pcVar2 = local_20[iVar5 + 1]; iVar5 = iVar5 + 1; pvVar1 = (void *)0x0; if (pcVar2 == (LPCSTR)0x0) { _glfwInputError(0x10006,"EGL: Library not found"); return 0; } } iVar5 = strncmp(local_20[iVar5],"lib",3); DAT_00c74bc8 = (uint)(iVar5 == 0); DAT_00c74c0c = GetProcAddress(g_glfwEglHandle,"eglGetConfigAttrib"); DAT_00c74c10 = GetProcAddress(g_glfwEglHandle,"eglGetConfigs"); DAT_00c74c14 = GetProcAddress(g_glfwEglHandle,"eglGetDisplay"); DAT_00c74c18 = GetProcAddress(g_glfwEglHandle,"eglGetError"); DAT_00c74c1c = GetProcAddress(g_glfwEglHandle,"eglInitialize"); DAT_00c74c20 = GetProcAddress(g_glfwEglHandle,"eglTerminate"); DAT_00c74c24 = GetProcAddress(g_glfwEglHandle,"eglBindAPI"); DAT_00c74c28 = GetProcAddress(g_glfwEglHandle,"eglCreateContext"); DAT_00c74c2c = GetProcAddress(g_glfwEglHandle,"eglDestroySurface"); DAT_00c74c30 = GetProcAddress(g_glfwEglHandle,"eglDestroyContext"); DAT_00c74c34 = GetProcAddress(g_glfwEglHandle,"eglCreateWindowSurface"); DAT_00c74c38 = GetProcAddress(g_glfwEglHandle,"eglMakeCurrent"); DAT_00c74c3c = GetProcAddress(g_glfwEglHandle,"eglSwapBuffers"); DAT_00c74c40 = GetProcAddress(g_glfwEglHandle,"eglSwapInterval"); DAT_00c74c44 = GetProcAddress(g_glfwEglHandle,"eglQueryString"); DAT_00c74c48 = GetProcAddress(g_glfwEglHandle,"eglGetProcAddress"); if ((((((DAT_00c74c0c == (FARPROC)0x0) || (DAT_00c74c10 == (FARPROC)0x0)) || (DAT_00c74c14 == (FARPROC)0x0)) || ((DAT_00c74c18 == (FARPROC)0x0 || (DAT_00c74c1c == (FARPROC)0x0)))) || (((DAT_00c74c20 == (FARPROC)0x0 || ((DAT_00c74c24 == (FARPROC)0x0 || (DAT_00c74c28 == (FARPROC)0x0)))) || (DAT_00c74c2c == (FARPROC)0x0)))) || ((((DAT_00c74c30 == (FARPROC)0x0 || (DAT_00c74c34 == (FARPROC)0x0)) || (DAT_00c74c38 == (FARPROC)0x0)) || (((DAT_00c74c3c == (FARPROC)0x0 || (DAT_00c74c40 == (FARPROC)0x0)) || ((DAT_00c74c44 == (FARPROC)0x0 || (DAT_00c74c48 == (FARPROC)0x0)))))))) { _glfwInputError(0x10008,"EGL: Failed to load required entry points"); if (g_glfwEglDisplay != (void *)0x0) { (*DAT_00c74c20)(g_glfwEglDisplay); g_glfwEglDisplay = (void *)0x0; } if (g_glfwEglHandle == (void *)0x0) { return 0; } FreeLibrary(g_glfwEglHandle); g_glfwEglHandle = (void *)0x0; return 0; } iVar5 = (*DAT_00c74c44)(0,0x3055); if ((iVar5 == 0) || (iVar5 = (*DAT_00c74c18)(), iVar5 != 0x3000)) { if (DAT_00c74be0 == 0) goto LAB_00a8309b; } else { DAT_00c74be0 = 1; } DAT_00c74be4 = FUN_00a6bb40(); _DAT_00c74be8 = FUN_00a6bb40(); _DAT_00c74bec = FUN_00a6bb40(); DAT_00c74bf4 = FUN_00a6bb40(); DAT_00c74bf8 = FUN_00a6bb40(); DAT_00c74bfc = FUN_00a6bb40(); DAT_00c74c00 = FUN_00a6bb40(); _DAT_00c74c04 = FUN_00a6bb40(); LAB_00a8309b: if (DAT_00c74be4 != 0) { DAT_00c74c4c = (code *)(*DAT_00c74c48)("eglGetPlatformDisplayEXT"); DAT_00c74c50 = (*DAT_00c74c48)("eglCreatePlatformWindowSurfaceEXT"); } DAT_00c74bb8 = (*DAT_00c7379c)(&local_24); if (DAT_00c74bb8 == 0) { uVar3 = (*DAT_00c737a0)(); g_glfwEglDisplay = (void *)(*DAT_00c74c14)(uVar3); } else { uVar3 = (*DAT_00c737a0)(local_24); g_glfwEglDisplay = (void *)(*DAT_00c74c4c)(DAT_00c74bb8,uVar3); } if (local_24 != 0) { (*g_glfwDeallocate)(local_24,g_glfwAllocatorUser); } if (g_glfwEglDisplay == (void *)0x0) { iVar5 = (*DAT_00c74c18)(); pbVar4 = glfw_getEGLErrorString(iVar5); pcVar2 = "EGL: Failed to get EGL display: %s"; } else { iVar5 = (*DAT_00c74c1c)(g_glfwEglDisplay,&DAT_00c74bc0,&DAT_00c74bc4); if (iVar5 != 0) { DAT_00c74bcc = FUN_00a82c10("EGL_KHR_create_context"); DAT_00c74bd0 = FUN_00a82c10("EGL_KHR_create_context_no_error"); DAT_00c74bd4 = FUN_00a82c10("EGL_KHR_gl_colorspace"); DAT_00c74bd8 = FUN_00a82c10("EGL_KHR_get_all_proc_addresses"); DAT_00c74bdc = FUN_00a82c10("EGL_KHR_context_flush_control"); DAT_00c74bf0 = FUN_00a82c10("EGL_EXT_present_opaque"); return 1; } iVar5 = (*DAT_00c74c18)(); pbVar4 = glfw_getEGLErrorString(iVar5); pcVar2 = "EGL: Failed to initialize EGL: %s"; } _glfwInputError(0x10006,pcVar2,pbVar4); FUN_00a83250(); return 0; } //@@ 00a83250 FUN_00a83250 void FUN_00a83250(void) { if (g_glfwEglDisplay != (void *)0x0) { (*DAT_00c74c20)(g_glfwEglDisplay); g_glfwEglDisplay = (void *)0x0; } if (g_glfwEglHandle != (void *)0x0) { FreeLibrary(g_glfwEglHandle); g_glfwEglHandle = (void *)0x0; } return; } //@@ 00a83290 _glfwCreateContextEGL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW egl_context.c: "EGL: Failed to create context: %s", "EGL: Failed to bind OpenGL", attribs assert */ undefined4 _glfwCreateContextEGL(char **param_1) { char *_Str1; int iVar1; byte *pbVar2; uint uVar3; undefined4 uVar4; HMODULE pHVar5; int in_ECX; int *in_EDX; uint uVar6; int iVar7; undefined4 local_e4; char **local_e0; int *local_dc; uint local_d8; int local_d4; uint local_d0 [41]; char *local_2c; char *local_28; undefined4 local_24; char *local_20; char *local_1c; undefined4 local_18; uint local_14; local_14 = __security_cookie ^ (uint)(local_d0 + 0x30); local_d4 = 0; iVar7 = 0; local_e0 = param_1; if (g_glfwEglDisplay == (void *)0x0) { _glfwInputError(0x10006,"EGL: API not available"); return 0; } if (in_EDX[10] != 0) { local_d4 = *(int *)(in_EDX[10] + 0x248); } local_dc = in_EDX; iVar1 = glfw_chooseEGLConfig(&local_e4); if (iVar1 == 0) { return 0; } if (*local_dc == 0x30002) { iVar1 = (*DAT_00c74c24)(0x30a0); if (iVar1 == 0) { iVar7 = (*DAT_00c74c18)(); pbVar2 = glfw_getEGLErrorString(iVar7); _glfwInputError(0x10006,"EGL: Failed to bind OpenGL ES: %s",pbVar2); return 0; } } else { iVar1 = (*DAT_00c74c24)(0x30a2); if (iVar1 == 0) { iVar7 = (*DAT_00c74c18)(); pbVar2 = glfw_getEGLErrorString(iVar7); _glfwInputError(0x10006,"EGL: Failed to bind OpenGL: %s",pbVar2); return 0; } } if (DAT_00c74bcc == 0) { if (*local_dc == 0x30002) { local_d0[1] = local_dc[2]; iVar7 = 2; local_d0[0] = 0x3098; } } else { uVar3 = 0; local_d8 = 0; if (*local_dc == 0x30001) { uVar3 = -(uint)(local_dc[4] != 0) & 2; if (local_dc[7] == 0x32001) { local_d8 = 1; } else if (local_dc[7] == 0x32002) { local_d8 = 2; } } uVar6 = uVar3 | 1; if (local_dc[5] == 0) { uVar6 = uVar3; } iVar1 = local_dc[8]; if (iVar1 != 0) { if (iVar1 == 0x31001) { local_d0[1] = 0x31be; LAB_00a83451: iVar7 = 2; local_d0[0] = 0x31bd; } else if (iVar1 == 0x31002) { local_d0[1] = 0x31bf; goto LAB_00a83451; } uVar6 = uVar6 | 4; } uVar3 = local_dc[2]; if ((uVar3 != 1) || (local_dc[3] != 0)) { local_d0[iVar7] = 0x3098; local_d0[iVar7 + 1] = uVar3; uVar3 = local_dc[3]; local_d0[iVar7 + 2] = 0x30fb; local_d0[iVar7 + 3] = uVar3; iVar7 = iVar7 + 4; } if ((local_dc[6] != 0) && (DAT_00c74bd0 != 0)) { local_d0[iVar7] = 0x31b3; local_d0[iVar7 + 1] = 1; iVar7 = iVar7 + 2; } if (local_d8 != 0) { local_d0[iVar7] = 0x30fd; local_d0[iVar7 + 1] = local_d8; iVar7 = iVar7 + 2; } if (uVar6 != 0) { local_d0[iVar7] = 0x30fc; local_d0[iVar7 + 1] = uVar6; iVar7 = iVar7 + 2; } } if (DAT_00c74bdc != 0) { if (local_dc[9] == 0x35002) { if (0x27 < iVar7 + 1U) { _wassert(L"((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\egl_context.c" ,0x29f); } local_d0[iVar7] = 0x2097; local_d0[iVar7 + 1] = 0; } else { if (local_dc[9] != 0x35001) goto LAB_00a835b6; if (0x27 < iVar7 + 1U) { _wassert(L"((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\egl_context.c" ,0x2a4); } local_d0[iVar7] = 0x2097; local_d0[iVar7 + 1] = 0x2098; } iVar7 = iVar7 + 2; } LAB_00a835b6: if (0x27 < iVar7 + 1U) { _wassert(L"((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\egl_context.c" ,0x2a8); } local_d0[iVar7] = 0x3038; local_d0[iVar7 + 1] = 0x3038; iVar7 = (*DAT_00c74c28)(g_glfwEglDisplay,local_e4,local_d4,local_d0); *(int *)(in_ECX + 0x248) = iVar7; if (iVar7 == 0) { iVar7 = (*DAT_00c74c18)(); pbVar2 = glfw_getEGLErrorString(iVar7); _glfwInputError(0x10007,"EGL: Failed to create context: %s",pbVar2); return 0; } iVar7 = 0; if ((local_e0[0xd] != (char *)0x0) && (DAT_00c74bd4 != 0)) { local_d0[0] = 0x309d; iVar7 = 2; local_d0[1] = 0x3089; } if (local_e0[0xe] == (char *)0x0) { local_d0[iVar7] = 0x3086; local_d0[iVar7 + 1] = 0x3085; iVar7 = iVar7 + 2; } if ((DAT_00c73694 == 0x60003) && (DAT_00c74bf0 != 0)) { local_d0[iVar7] = 0x31df; local_d0[iVar7 + 1] = (uint)(local_e0[0xf] == (char *)0x0); iVar7 = iVar7 + 2; } local_d0[iVar7] = 0x3038; local_d0[iVar7 + 1] = 0x3038; uVar4 = (*DAT_00c737a4)(); if ((DAT_00c74bb8 == 0) || (DAT_00c74bb8 == 0x3202)) { iVar7 = (*DAT_00c74c34)(g_glfwEglDisplay,local_e4,uVar4,local_d0); } else { iVar7 = (*DAT_00c74c50)(g_glfwEglDisplay,local_e4,uVar4,local_d0); } *(int *)(in_ECX + 0x24c) = iVar7; if (iVar7 == 0) { iVar7 = (*DAT_00c74c18)(); pbVar2 = glfw_getEGLErrorString(iVar7); _glfwInputError(0x10008,"EGL: Failed to create window surface: %s",pbVar2); return 0; } *(undefined4 *)(in_ECX + 0x244) = local_e4; if (DAT_00c74bd8 == 0) { local_2c = "GLESv1_CM.dll"; local_28 = "libGLES_CM.dll"; local_24 = 0; local_20 = "GLESv2.dll"; local_1c = "libGLESv2.dll"; local_18 = 0; local_e4 = 0; if (*local_dc == 0x30002) { local_d4 = 0; local_e0 = &local_20; if (local_dc[2] == 1) { local_e0 = &local_2c; } _Str1 = *local_e0; while (_Str1 != (char *)0x0) { iVar7 = strncmp(_Str1,"lib",3); if (DAT_00c74bc8 == (iVar7 == 0)) { pHVar5 = LoadLibraryA(_Str1); *(HMODULE *)(in_ECX + 0x250) = pHVar5; if (pHVar5 != (HMODULE)0x0) break; } local_d4 = local_d4 + 1; _Str1 = local_e0[local_d4]; } } if (*(int *)(in_ECX + 0x250) == 0) { _glfwInputError(0x10006,"EGL: Failed to load client library"); return 0; } } *(code **)(in_ECX + 0x22c) = FUN_00a82ad0; *(code **)(in_ECX + 0x230) = FUN_00a82b90; *(code **)(in_ECX + 0x234) = FUN_00a82bf0; *(code **)(in_ECX + 0x238) = FUN_00a82c10; *(code **)(in_ECX + 0x23c) = FUN_00a82c50; *(code **)(in_ECX + 0x240) = FUN_00a82cc0; return 1; } //@@ 00a838b0 FUN_00a838b0 char * FUN_00a838b0(void) { int in_ECX; if (in_ECX < -10) { if (in_ECX == -0xb) { return "A requested format is not supported on this device"; } if (in_ECX < -0x3b9acdeb) { if (in_ECX == -0x3b9acdec) { return "A surface has changed in such a way that it is no longer compatible with the swapchain"; } if (in_ECX == -0x3b9af4f9) { return "A validation layer found an error"; } if (in_ECX == -0x3b9ad5b9) { return "The display used by a swapchain does not use the same presentable image layout"; } } else { if (in_ECX == -0x3b9aca01) { return "The requested window is already connected to a VkSurfaceKHR, or to some other non-Vulkan API" ; } if (in_ECX == -1000000000) { return "A surface is no longer available"; } } } else if (in_ECX < 0x3b9acdec) { if (in_ECX == 0x3b9acdeb) { return "A swapchain no longer matches the surface properties exactly, but can still be used"; } switch(in_ECX) { case 0: return "Success"; case 1: return "A fence or query has not yet completed"; case 2: return "A wait operation has not completed in the specified time"; case 3: return "An event is signaled"; case 4: return "An event is unsignaled"; case 5: return "A return array was too small for the result"; case -10: return "Too many objects of the type have already been created"; case -9: return "The requested version of Vulkan is not supported by the driver or is otherwise incompatible"; case -8: return "A requested feature is not supported"; case -7: return "A requested extension is not supported"; case -6: return "A requested layer is not present or could not be loaded"; case -5: return "Mapping of a memory object has failed"; case -4: return "The logical or physical device has been lost"; case -3: return "Initialization of an object could not be completed for implementation-specific reasons"; case -2: return "A device memory allocation has failed"; case -1: return "A host memory allocation has failed"; } } return "ERROR: UNKNOWN VULKAN ERROR"; } //@@ 00a839e0 FUN_00a839e0 void FUN_00a839e0(LPVOID param_1) { LPVOID lpTlsValue; int iVar1; uint uVar2; void *pvVar3; undefined4 uVar4; char *pcVar5; int local_8; lpTlsValue = param_1; if (param_1 == (LPVOID)0x0) goto LAB_00a83ae6; (*DAT_00c73730)(param_1,&local_8,¶m_1); pvVar3 = *(void **)((int)lpTlsValue + 0x260); if (pvVar3 == (void *)0x0) { LAB_00a83a3b: uVar2 = local_8 * (int)param_1; if (uVar2 == 0) { LAB_00a83a98: pvVar3 = (void *)0x0; } else { if ((uint)(0xffffffff / (ulonglong)uVar2) < 4) { pcVar5 = "Allocation size overflow"; uVar4 = 0x10004; LAB_00a83a90: _glfwInputError(uVar4,pcVar5); goto LAB_00a83a98; } pvVar3 = (void *)(*g_glfwAllocate)(uVar2 * 4,g_glfwAllocatorUser); if (pvVar3 == (void *)0x0) { pcVar5 = (char *)0x0; uVar4 = 0x10005; goto LAB_00a83a90; } pvVar3 = memset(pvVar3,0,uVar2 * 4); } *(int *)((int)lpTlsValue + 600) = local_8; *(void **)((int)lpTlsValue + 0x260) = pvVar3; *(LPVOID *)((int)lpTlsValue + 0x25c) = param_1; } else if ((local_8 != *(int *)((int)lpTlsValue + 600)) || (param_1 != *(LPVOID *)((int)lpTlsValue + 0x25c))) { if (pvVar3 != (void *)0x0) { (*g_glfwDeallocate)(pvVar3,g_glfwAllocatorUser); } goto LAB_00a83a3b; } iVar1 = (*DAT_00c74c64)(*(undefined4 *)((int)lpTlsValue + 0x254),pvVar3,0x1401,local_8,param_1); if (iVar1 == 0) { _glfwInputError(0x10008,"OSMesa: Failed to make context current"); return; } LAB_00a83ae6: if (DAT_00c74b80 != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x45); } TlsSetValue(DAT_00c74b84,lpTlsValue); return; } //@@ 00a83b20 FUN_00a83b20 void FUN_00a83b20(undefined4 param_1) { (*DAT_00c74c70)(param_1); return; } //@@ 00a83b30 FUN_00a83b30 void FUN_00a83b30(int param_1) { if (*(int *)(param_1 + 0x254) != 0) { (*DAT_00c74c60)(*(int *)(param_1 + 0x254)); *(undefined4 *)(param_1 + 0x254) = 0; } if (*(int *)(param_1 + 0x260) != 0) { (*g_glfwDeallocate)(*(int *)(param_1 + 0x260),g_glfwAllocatorUser); *(undefined4 *)(param_1 + 600) = 0; *(undefined4 *)(param_1 + 0x25c) = 0; } return; } //@@ 00a83b90 FUN_00a83b90 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a83b90(void) { int iVar1; char *lpLibFileName; int iVar2; char *local_1c [2]; char *local_14; local_14 = (char *)(__security_cookie ^ (uint)(local_1c + 3)); local_1c[0] = "OSMesa.dll"; local_1c[1] = (char *)0x0; if (DAT_00c74c54 != (HMODULE)0x0) { return 1; } iVar2 = 0; lpLibFileName = "libOSMesa.dll"; iVar1 = (int)DAT_00c74c54; while (DAT_00c74c54 = (HMODULE)iVar1, DAT_00c74c54 = LoadLibraryA(lpLibFileName), DAT_00c74c54 == (HMODULE)0x0) { lpLibFileName = local_1c[iVar2]; iVar2 = iVar2 + 1; iVar1 = 0; if (lpLibFileName == (LPCSTR)0x0) { _glfwInputError(0x10006,"OSMesa: Library not found"); return 0; } } DAT_00c74c58 = GetProcAddress(DAT_00c74c54,"OSMesaCreateContextExt"); DAT_00c74c5c = GetProcAddress(DAT_00c74c54,"OSMesaCreateContextAttribs"); DAT_00c74c60 = GetProcAddress(DAT_00c74c54,"OSMesaDestroyContext"); DAT_00c74c64 = GetProcAddress(DAT_00c74c54,"OSMesaMakeCurrent"); DAT_00c74c68 = GetProcAddress(DAT_00c74c54,"OSMesaGetColorBuffer"); DAT_00c74c6c = GetProcAddress(DAT_00c74c54,"OSMesaGetDepthBuffer"); DAT_00c74c70 = GetProcAddress(DAT_00c74c54,"OSMesaGetProcAddress"); if ((((DAT_00c74c58 != (FARPROC)0x0) && (DAT_00c74c60 != (FARPROC)0x0)) && (DAT_00c74c64 != (FARPROC)0x0)) && (((DAT_00c74c68 != (FARPROC)0x0 && (DAT_00c74c6c != (FARPROC)0x0)) && (DAT_00c74c70 != (FARPROC)0x0)))) { return 1; } _glfwInputError(0x10008,"OSMesa: Failed to load required entry points"); if (DAT_00c74c54 == (HMODULE)0x0) { return 0; } FreeLibrary(DAT_00c74c54); DAT_00c74c54 = (HMODULE)0x0; return 0; } //@@ 00a83d20 _glfwCreateContextOSMesa /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 osmesa_context.c: 'OSMesa: OpenGL ES is not available on OSMesa', 'OSMesa: OpenGL profiles unavailable', 'OSMesa: Failed to create context', OSMesaCreateContextExt(0x1908 GL_RGBA, depth, stencil, accum) */ undefined4 _glfwCreateContextOSMesa(int param_1) { int iVar1; int in_ECX; int iVar2; int *in_EDX; int iVar3; undefined4 local_bc; int local_b8 [4]; undefined4 local_a8; undefined4 local_a4; undefined4 local_a0; int local_9c; int local_98 [33]; uint local_14; local_14 = __security_cookie ^ (uint)(local_98 + 0x22); local_bc = 0; iVar3 = *(int *)(param_1 + 0x24) + *(int *)(param_1 + 0x20) + *(int *)(param_1 + 0x1c) + *(int *)(param_1 + 0x18); if (*in_EDX == 0x30002) { _glfwInputError(0x10006,"OSMesa: OpenGL ES is not available on OSMesa"); return 0; } if (in_EDX[10] != 0) { local_bc = *(undefined4 *)(in_EDX[10] + 0x254); } if (DAT_00c74c5c == (code *)0x0) { if (in_EDX[7] != 0) { _glfwInputError(0x10007,"OSMesa: OpenGL profiles unavailable"); return 0; } iVar3 = (*DAT_00c74c58)(0x1908,*(undefined4 *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x14), iVar3,local_bc); goto LAB_00a83f12; } local_b8[3] = *(undefined4 *)(param_1 + 0x10); local_a4 = *(undefined4 *)(param_1 + 0x14); iVar2 = 8; local_b8[0] = 0x22; local_b8[1] = 0x1908; local_b8[2] = 0x30; local_a8 = 0x31; local_a0 = 0x32; if (in_EDX[7] == 0x32001) { local_98[1] = 0x34; LAB_00a83e32: iVar2 = 10; local_98[0] = 0x33; } else if (in_EDX[7] == 0x32002) { local_98[1] = 0x35; goto LAB_00a83e32; } iVar1 = in_EDX[2]; if ((iVar1 != 1) || (in_EDX[3] != 0)) { local_b8[iVar2] = 0x36; local_b8[iVar2 + 1] = iVar1; iVar1 = in_EDX[3]; local_b8[iVar2 + 2] = 0x37; local_b8[iVar2 + 3] = iVar1; iVar2 = iVar2 + 4; } local_9c = iVar3; if (in_EDX[4] != 0) { _glfwInputError(0x10007,"OSMesa: Forward-compatible contexts not supported"); return 0; } local_b8[iVar2] = 0; local_b8[iVar2 + 1] = 0; iVar3 = (*DAT_00c74c5c)(local_b8,local_bc); LAB_00a83f12: *(int *)(in_ECX + 0x254) = iVar3; if (iVar3 == 0) { _glfwInputError(0x10007,"OSMesa: Failed to create context"); return 0; } *(code **)(in_ECX + 0x22c) = FUN_00a839e0; *(code **)(in_ECX + 0x230) = guard_check_icall; *(code **)(in_ECX + 0x234) = guard_check_icall; *(code **)(in_ECX + 0x238) = Weapon::GetFocusEntity; *(code **)(in_ECX + 0x23c) = FUN_00a83b20; *(code **)(in_ECX + 0x240) = FUN_00a83b30; return 1; } //@@ 00a83fa0 FUN_00a83fa0 void FUN_00a83fa0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Filesys::LoggerFile::vftable; KAGE::Filesys::File::~File(in_ECX); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 00a83fd0 FUN_00a83fd0 int FUN_00a83fd0(void *param_1,size_t param_2,size_t param_3) { size_t sVar1; int in_ECX; if (*(int *)(in_ECX + 4) == 1) { sVar1 = fwrite(param_1,param_2,param_3,*(FILE **)(in_ECX + 0xc)); fflush(*(FILE **)(in_ECX + 0xc)); return sVar1 * param_2; } fflush(*(FILE **)(in_ECX + 0xc)); return 0; } //@@ 00a84030 FUN_00a84030 void FUN_00a84030(byte param_1) { void *in_ECX; KAGE::Network::Multiplayer::LobbyEOS::~LobbyEOS(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x30); } return; } //@@ 00a84060 KAGE::Network::Multiplayer::LobbyEOS::~LobbyEOS /* DB: sets LobbyEOS vftable, frees +0x20 (tracked), EOS_LobbyDetails_Release(+0x28), then LobbyImplBase vftable and member vector _Tidy */ void KAGE::Network::Multiplayer::LobbyEOS::~LobbyEOS(void) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = vftable; if ((void *)in_ECX[8] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[8],0); in_ECX[8] = 0; } _EOS_LobbyDetails_Release_4(in_ECX[10],uVar1); in_ECX[10] = 0; *in_ECX = LobbyImplBase::vftable; std::vector::_Tidy(); ExceptionList = local_10; return; } //@@ 00a840f0 FUN_00a840f0 undefined4 * FUN_00a840f0(void) { qword qVar1; undefined4 *puVar2; undefined4 *puVar3; qword *pqVar4; if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar2 = malloc(0x34); if (puVar2 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 0x34; *puVar2 = 0x34; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xffffffcb < (uint)qVar1); puVar3 = puVar2 + 1; if (puVar3 != (undefined4 *)0x0) { puVar2[3] = 0; puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0; puVar2[7] = 0; *puVar3 = KAGE::Network::Multiplayer::LobbyEOS::vftable; puVar2[9] = 0; puVar2[10] = 0; puVar2[0xb] = 0; return puVar3; } } return (undefined4 *)0x0; } //@@ 00a84190 FUN_00a84190 void FUN_00a84190(void) { void *in_ECX; _EOS_LobbyDetails_Release_4(*(undefined4 *)((int)in_ECX + 0x28)); *(undefined4 *)((int)in_ECX + 0x28) = 0; FUN_00a5ffa0(*(undefined4 *)((int)in_ECX + 0x20)); Lobby::refresh_members(in_ECX); return; } //@@ 00a841c0 KAGE::Network::Multiplayer::LobbyEOS::get_members /* DB: ? LobbyEOS vftable 00ba5520 slot 6: FUN_00a84900 lobby details, _EOS_LobbyDetails_GetMemberByIndex per member, wraps each in ReferenceCount looked up in the EOS user map (DAT_00c5ac08), pushes into the out vector */ void KAGE::Network::Multiplayer::LobbyEOS::get_members(int *param_1) { undefined4 uVar1; undefined4 *puVar2; bool bVar3; char cVar4; void *pvVar5; ReferenceCountBase *pRVar6; int *piVar7; int iVar8; int in_ECX; uint uVar9; undefined8 local_4c; undefined1 local_44 [4]; int *local_40; undefined1 local_3c [4]; int *local_38; undefined4 local_34; uint local_30; int local_2c; ReferenceCountBase *local_28; ReferenceCountBase *local_24; uint local_20; int local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14755; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = 0; local_18 = 0; local_1c = in_ECX; cVar4 = FUN_00a84900(__security_cookie ^ (uint)(local_3c + 0x38)); if (cVar4 != '\0') { local_18 = 1; local_20 = _EOS_LobbyDetails_GetMemberCount_8(*(undefined4 *)(in_ECX + 0x28),&local_18); local_34 = 1; local_30 = 0; uVar9 = 0; if (local_20 != 0) { do { pvVar5 = (void *)_EOS_LobbyDetails_GetMemberByIndex_8 (*(undefined4 *)(local_1c + 0x28),&local_34); local_2c = 0; local_28 = (ReferenceCountBase *)0x0; pRVar6 = operator_new(0x18); local_8 = 0; local_24 = pRVar6; if (pRVar6 == (ReferenceCountBase *)0x0) { pRVar6 = (ReferenceCountBase *)0x0; } else { ReferenceCountBase::ReferenceCountBase(pRVar6); *(undefined ***)pRVar6 = ReferenceCount::vftable; *(undefined4 *)(pRVar6 + 0x14) = 0; } local_8 = 0xffffffff; if (((local_28 != (ReferenceCountBase *)0x0) && (cVar4 = (**(code **)(*(int *)local_28 + 0xc))(), cVar4 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_2c); } local_2c = 0; local_8 = 1; local_28 = pRVar6; if (pvVar5 == (void *)0x0) { LAB_00a8433a: bVar3 = false; } else { pvVar5 = GridEntity_Door::play_animation ((GridEntity_Door *)&DAT_00c5ac08,local_44,pvVar5,(void *)0x0,0); local_8 = CONCAT31(local_8._1_3_,2); local_18 = uVar9 | 1; local_14 = local_18; piVar7 = (int *)FUN_00a23df0(pvVar5); pRVar6 = (ReferenceCountBase *)piVar7[1]; piVar7[1] = (int)local_28; iVar8 = *piVar7; *piVar7 = local_2c; local_8 = 3; local_2c = iVar8; local_28 = pRVar6; if (((local_38 != (int *)0x0) && (cVar4 = (**(code **)(*local_38 + 0xc))(), cVar4 != '\0') ) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_3c); } if (local_2c == 0) goto LAB_00a8433a; bVar3 = true; } local_8 = 1; if ((local_14 & 1) != 0) { local_14 = local_14 & 0xfffffffe; local_8 = 4; if (((local_40 != (int *)0x0) && (cVar4 = (**(code **)(*local_40 + 0xc))(), cVar4 != '\0') ) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(local_44); } local_8 = CONCAT31(local_8._1_3_,1); } if (bVar3) { uVar1 = *(undefined4 *)(local_2c + 0xc); local_4c = *(undefined8 *)(local_2c + 8); puVar2 = (undefined4 *)param_1[1]; if (puVar2 == (undefined4 *)param_1[2]) { std::vector<8byte>::_Emplace_reallocate(puVar2,&local_4c); } else { *puVar2 = *(undefined4 *)(local_2c + 8); puVar2[1] = uVar1; param_1[1] = param_1[1] + 8; } } local_8 = 5; if (((local_28 != (ReferenceCountBase *)0x0) && (cVar4 = (**(code **)(*(int *)local_28 + 0xc))(), cVar4 != '\0')) && (g_profileReleaseFn != (void *)0x0)) { (*g_profileReleaseFn)(&local_2c); } local_8 = 0xffffffff; local_30 = local_30 + 1; uVar9 = local_14; } while (local_30 < local_20); } uVar9 = local_20; puVar2 = (undefined4 *)param_1[1]; iVar8 = (int)puVar2 - *param_1; while ((uint)(iVar8 >> 3) < uVar9) { local_4c = 0; if (puVar2 == (undefined4 *)param_1[2]) { std::vector<8byte>::_Emplace_reallocate(puVar2,&local_4c); } else { *puVar2 = 0; puVar2[1] = 0; param_1[1] = param_1[1] + 8; } puVar2 = (undefined4 *)param_1[1]; iVar8 = (int)puVar2 - *param_1; } } ExceptionList = local_10; return; } //@@ 00a84460 FUN_00a84460 undefined4 * FUN_00a84460(undefined4 *param_1) { char cVar1; undefined4 uVar2; int in_ECX; undefined4 local_8; cVar1 = FUN_00a84900(); if (cVar1 == '\0') { param_1[1] = 0; *param_1 = KAGE::System::UserProfile::vftable; return param_1; } local_8 = 1; uVar2 = _EOS_LobbyDetails_GetLobbyOwner_8(*(undefined4 *)(in_ECX + 0x28),&local_8); FUN_00a232c0(uVar2); return param_1; } //@@ 00a844b0 FUN_00a844b0 void FUN_00a844b0(undefined4 param_1,undefined4 param_2) { FUN_00a84b90(param_1,param_2,"add lobby string value"); return; } //@@ 00a844d0 FUN_00a844d0 void FUN_00a844d0(undefined4 param_1,undefined4 param_2) { undefined4 in_ECX; FUN_00a84cf0(param_1,param_2,in_ECX); return; } //@@ 00a844f0 FUN_00a844f0 undefined * FUN_00a844f0(undefined4 param_1) { PTR_s_empty_00c5c528 = &s_empty; FUN_00a84e50(param_1,&PTR_s_empty_00c5c528,0); return PTR_s_empty_00c5c528; } //@@ 00a84520 FUN_00a84520 undefined4 FUN_00a84520(undefined4 param_1) { undefined4 in_ECX; undefined4 local_8; local_8 = 0; FUN_00a84f50(param_1,&local_8,in_ECX); return local_8; } //@@ 00a84550 FUN_00a84550 void FUN_00a84550(void) { char *pcVar1; undefined4 uVar2; int iVar3; int in_ECX; undefined1 *puVar4; undefined4 *puVar5; undefined1 auStack_1e [2]; undefined4 local_1c; void *local_18; undefined4 local_14; pcVar1 = strstr("remove lobby value","member"); local_1c = 1; local_18 = g_eosLocalUserId; local_14 = *(undefined4 *)(in_ECX + 0x20); puVar5 = &local_1c; uVar2 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,puVar5); iVar3 = _EOS_Lobby_UpdateLobbyModification_12(uVar2); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *) "Failed to %s \'%s\' because a modification handle could not be created: %s\n" ); return; } puVar4 = auStack_1e + -0xe; if (pcVar1 == (char *)0x0) { iVar3 = _EOS_LobbyModification_RemoveAttribute_8(puVar5,puVar4); } else { iVar3 = _EOS_LobbyModification_RemoveMemberAttribute_8(); } if (iVar3 == 0) { puVar4 = auStack_1e + -10; uVar2 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,puVar4,0,FUN_00a84b60); _EOS_Lobby_UpdateLobby_16(uVar2); _EOS_LobbyModification_Release_4(puVar4); return; } _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *)"Failed to %s \'%s\': %s\n"); _EOS_LobbyModification_Release_4(puVar4); return; } //@@ 00a84680 FUN_00a84680 void FUN_00a84680(int param_1) { undefined4 uVar1; int iVar2; int in_ECX; void *pvStack_2c; undefined4 *puStack_28; undefined1 *puStack_24; undefined1 local_20 [12]; undefined4 local_14; void *local_10; undefined4 local_c; puStack_24 = local_20; local_10 = g_eosLocalUserId; local_c = *(undefined4 *)(in_ECX + 0x20); puStack_28 = &local_14; local_14 = 1; pvStack_2c = g_eosPlatform; uVar1 = _EOS_Platform_GetLobbyInterface_4(); iVar2 = _EOS_Lobby_UpdateLobbyModification_12(uVar1); if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *) "Failed to set lobby visibility because a modification handle could not be created: %s\n" ); return; } pvStack_2c = (void *)0x1; if (param_1 != 0) { if (param_1 == 1) { puStack_28 = (undefined4 *)0x1; goto LAB_00a84710; } if (param_1 == 3) { puStack_28 = (undefined4 *)0x0; goto LAB_00a84710; } } puStack_28 = (undefined4 *)0x2; LAB_00a84710: iVar2 = _EOS_LobbyModification_SetPermissionLevel_8(uVar1,&pvStack_2c); if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *)"Failed to set lobby visibility: %s\n"); } _EOS_LobbyModification_Release_4(uVar1); return; } //@@ 00a84750 FUN_00a84750 undefined4 FUN_00a84750(void) { char cVar1; int iVar2; int in_ECX; undefined4 uVar3; int local_c [2]; cVar1 = FUN_00a84900(); if (cVar1 == '\0') { KAGE_LogMessage(8,(byte *) "Failed to get lobby visibility because a details handle couldn\'t be retrieved\n" ); return 3; } local_c[1] = 1; iVar2 = _EOS_LobbyDetails_CopyInfo_12(*(undefined4 *)(in_ECX + 0x28),local_c + 1,local_c); if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *)"Failed to get lobby visibility: %s\n"); return 3; } uVar3 = 3; if ((*(int *)(local_c[0] + 0xc) != 0) && (*(int *)(local_c[0] + 0xc) == 1)) { uVar3 = 1; } _EOS_LobbyDetails_Info_Release_4(local_c[0]); return uVar3; } //@@ 00a847e0 FUN_00a847e0 void FUN_00a847e0(void) { undefined4 uVar1; int iVar2; int in_ECX; void **ppvVar3; undefined1 **ppuVar4; void *pvStack_2c; undefined4 *puStack_28; undefined1 *puStack_24; undefined1 local_18 [4]; undefined4 local_14; void *local_10; undefined4 local_c; local_10 = g_eosLocalUserId; local_c = *(undefined4 *)(in_ECX + 0x20); puStack_24 = local_18; puStack_28 = &local_14; local_14 = 1; pvStack_2c = g_eosPlatform; uVar1 = _EOS_Platform_GetLobbyInterface_4(); iVar2 = _EOS_Lobby_UpdateLobbyModification_12(uVar1); if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *) "Failed to set lobby %s because a modification handle could not be created: %s\n" ); return; } puStack_24 = (undefined1 *)0x1; ppuVar4 = &puStack_24; iVar2 = _EOS_LobbyModification_SetBucketId_8(puStack_28,ppuVar4); if (iVar2 == 0) { ppvVar3 = &pvStack_2c; pvStack_2c = (void *)0x1; puStack_28 = (undefined4 *)uVar1; uVar1 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,ppvVar3,0,FUN_00a84b60); _EOS_Lobby_UpdateLobby_16(uVar1); _EOS_LobbyModification_Release_4(ppvVar3); return; } _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *)"Failed to set lobby %s: %s\n"); _EOS_LobbyModification_Release_4(ppuVar4); return; } //@@ 00a84900 FUN_00a84900 bool FUN_00a84900(void) { undefined4 uVar1; int iVar2; int in_ECX; undefined4 local_10; undefined4 local_c; void *local_8; if (*(int *)(in_ECX + 0x28) != 0) { return true; } local_8 = g_eosLocalUserId; local_c = *(undefined4 *)(in_ECX + 0x20); local_10 = 1; uVar1 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&local_10,(int *)(in_ECX + 0x28)); iVar2 = _EOS_Lobby_CopyLobbyDetailsHandle_12(uVar1); if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *)"Failed to get lobby details handle: %s\n"); } return iVar2 == 0; } //@@ 00a84970 FUN_00a84970 void FUN_00a84970(void) { uint uVar1; qword qVar2; uint uVar3; void *in_ECX; ulonglong *in_EDX; qword *pqVar4; void *ptr; undefined **local_44 [2]; undefined8 local_3c; void *local_34; undefined4 local_30; int local_2c; int local_24; undefined4 local_20; undefined4 local_1c; void *local_10; undefined1 *puStack_c; undefined **local_8; puStack_c = &LAB_00b1478d; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_44 + 0x10); ExceptionList = &local_10; local_34 = (void *)0x0; local_3c = 0; local_30 = 0; local_2c = 0; local_44[0] = KAGE::Network::Multiplayer::LobbyEOS::vftable; local_24 = 0; local_20 = 0; local_1c = 0; local_8 = (undefined **)0x0; lobby_registry_find_or_create(local_44,in_ECX,in_EDX); local_44[0] = KAGE::Network::Multiplayer::LobbyEOS::vftable; if (local_24 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)(local_24 + -4); qVar2 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar1; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar2 < uVar1); free((void *)(local_24 + -4)); local_24 = 0; } _EOS_LobbyDetails_Release_4(local_1c,uVar3); local_1c = 0; local_44[0] = KAGE::Network::Multiplayer::LobbyImplBase::vftable; if (local_34 != (void *)0x0) { uVar3 = local_2c - (int)local_34 & 0xfffffff8; ptr = local_34; if (0xfff < uVar3) { ptr = *(void **)((int)local_34 + -4); uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } ExceptionList = local_10; return; } //@@ 00a84a90 FUN_00a84a90 void FUN_00a84a90(void) { char cVar1; int iVar2; undefined4 *in_ECX; char *pcVar3; char *in_EDX; char *_Dest; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b147ce; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; FUN_00a15a30(__security_cookie ^ (int)register0x00000010 - 4U); FUN_00a84970(); local_8 = 0; if (in_EDX == (char *)0x0) { _Dest = (char *)0x0; } else { pcVar3 = in_EDX; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar3 + (1 - (int)(in_EDX + 1)))); pcVar3 = in_EDX; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); strncpy(_Dest,in_EDX,(size_t)(pcVar3 + (1 - (int)(in_EDX + 1)))); } iVar2 = __RTDynamicCast(*in_ECX,0,&KAGE::Network::Multiplayer::LobbyImplBase::RTTI_Type_Descriptor ,&KAGE::Network::Multiplayer::LobbyEOS::RTTI_Type_Descriptor,0); *(char **)(iVar2 + 0x20) = _Dest; ExceptionList = local_10; return; } //@@ 00a84b60 FUN_00a84b60 void FUN_00a84b60(int *param_1) { if (*param_1 != 0) { _EOS_EResult_ToString_4(*param_1); KAGE_LogMessage(8,(byte *)"Failed to update lobby: %s\n"); } return; } //@@ 00a84b90 FUN_00a84b90 void FUN_00a84b90(undefined4 param_1,undefined4 param_2,char *param_3) { char *pcVar1; undefined4 uVar2; int iVar3; int in_ECX; undefined4 unaff_EDI; code *pcVar4; void *pvVar5; undefined4 uStack_3c; undefined4 *local_38; undefined4 uStack_34; undefined4 uStack_30; undefined4 local_2c; void *local_28; undefined4 local_24; undefined4 uStack_20; undefined4 uStack_1c; pcVar1 = strstr(param_3,"member"); local_2c = 1; local_28 = g_eosLocalUserId; local_24 = *(undefined4 *)(in_ECX + 0x20); pvVar5 = g_eosPlatform; uVar2 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,&local_2c); iVar3 = _EOS_Lobby_UpdateLobbyModification_12(uVar2); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *) "Failed to %s \'%s\' because a modification handle could not be created: %s\n" ); return; } local_28 = (void *)param_2; local_38 = &uStack_30; local_24 = 0; uStack_1c = 0; uStack_30 = 1; local_2c = param_1; uStack_20 = 3; uStack_3c = 2; uStack_34 = 0; if (pcVar1 == (char *)0x0) { iVar3 = _EOS_LobbyModification_AddAttribute_8(unaff_EDI,&uStack_3c); } else { iVar3 = _EOS_LobbyModification_AddMemberAttribute_8(); } if (iVar3 == 0) { pcVar4 = FUN_00a84b60; uVar2 = _EOS_Platform_GetLobbyInterface_4 (g_eosPlatform,(int)register0x00000010 + -0x4c,0,FUN_00a84b60); _EOS_Lobby_UpdateLobby_16(uVar2); _EOS_LobbyModification_Release_4(pcVar4); return; } _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *)"Failed to %s \'%s\': %s\n"); _EOS_LobbyModification_Release_4(pvVar5); return; } //@@ 00a84cf0 FUN_00a84cf0 void FUN_00a84cf0(undefined4 param_1,int param_2) { char *pcVar1; undefined4 uVar2; int iVar3; int in_ECX; void **ppvVar4; undefined1 *puVar5; void *pvStack_4c; undefined4 *puVar6; undefined1 auStack_36 [10]; undefined4 local_2c; void *local_28; int local_24; undefined4 uStack_20; undefined4 uStack_1c; pvStack_4c = (void *)0xa84d0d; pcVar1 = strstr("add lobby number value","member"); local_2c = 1; local_28 = g_eosLocalUserId; local_24 = *(undefined4 *)(in_ECX + 0x20); puVar6 = &local_2c; pvStack_4c = g_eosPlatform; uVar2 = _EOS_Platform_GetLobbyInterface_4(); iVar3 = _EOS_Lobby_UpdateLobbyModification_12(uVar2); if (iVar3 != 0) { _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *) "Failed to %s \'%s\' because a modification handle could not be created: %s\n" ); return; } local_24 = param_2 >> 0x1f; local_28 = (void *)param_2; puVar5 = auStack_36 + -6; uStack_1c = 0; local_2c = param_1; uStack_20 = 1; if (pcVar1 == (char *)0x0) { iVar3 = _EOS_LobbyModification_AddAttribute_8(puVar6,puVar5); } else { iVar3 = _EOS_LobbyModification_AddMemberAttribute_8(); } if (iVar3 == 0) { ppvVar4 = &pvStack_4c; pvStack_4c = (void *)0x1; uVar2 = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,ppvVar4,0,FUN_00a84b60); _EOS_Lobby_UpdateLobby_16(uVar2); _EOS_LobbyModification_Release_4(ppvVar4); return; } _EOS_EResult_ToString_4(iVar3); KAGE_LogMessage(8,(byte *)"Failed to %s \'%s\': %s\n"); _EOS_LobbyModification_Release_4(puVar5); return; } //@@ 00a84e50 FUN_00a84e50 /* WARNING: Restarted to delay deadcode elimination for space: stack */ undefined4 FUN_00a84e50(int param_1,undefined4 *param_2,int param_3) { char cVar1; int iVar2; int in_ECX; undefined4 *puStack_24; undefined4 local_18; int local_14; int local_10; int local_c; cVar1 = FUN_00a84900(); if (cVar1 == '\0') { KAGE_LogMessage(8,(byte *) "Failed to get lobby value \'%s\' because a details handle couldn\'t be retrieved\n" ); return 0; } local_18 = 0; local_14 = 1; if (param_3 == 0) { local_10 = param_1; iVar2 = _EOS_LobbyDetails_CopyAttributeByKey_12(*(undefined4 *)(in_ECX + 0x28),&local_14); } else { local_10 = param_3; local_c = param_1; iVar2 = _EOS_LobbyDetails_CopyMemberAttributeByKey_12(*(undefined4 *)(in_ECX + 0x28),&local_14); } puStack_24 = &local_18; if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *)"Failed to get lobby value \'%s\': %s\n"); return 0; } if (*(int *)(local_14 + 0x10) == 3) { *param_2 = *(undefined4 *)(local_14 + 8); _EOS_Lobby_Attribute_Release_4(puStack_24); return 1; } KAGE_LogMessage(8,(byte *) "Failed to get lobby value \'%s\' because the value is not the correct type\n"); _EOS_Lobby_Attribute_Release_4(puStack_24); return 0; } //@@ 00a84f50 FUN_00a84f50 undefined4 FUN_00a84f50(undefined4 param_1,undefined4 *param_2) { char cVar1; int iVar2; int in_ECX; int unaff_EDI; undefined4 local_14; undefined4 local_10; undefined4 local_c; cVar1 = FUN_00a84900(); if (cVar1 == '\0') { KAGE_LogMessage(8,(byte *) "Failed to get lobby value \'%s\' because a details handle couldn\'t be retrieved\n" ); return 0; } local_14 = 0; local_10 = 1; local_c = param_1; iVar2 = _EOS_LobbyDetails_CopyAttributeByKey_12 (*(undefined4 *)(in_ECX + 0x28),&local_10,&local_14); if (iVar2 != 0) { _EOS_EResult_ToString_4(iVar2); KAGE_LogMessage(8,(byte *)"Failed to get lobby value \'%s\': %s\n"); return 0; } if (*(int *)(*(int *)(unaff_EDI + 4) + 0x10) == 1) { *param_2 = *(undefined4 *)(*(int *)(unaff_EDI + 4) + 8); _EOS_Lobby_Attribute_Release_4(unaff_EDI); return 1; } KAGE_LogMessage(8,(byte *) "Failed to get lobby value \'%s\' because the value is not the correct type\n"); _EOS_Lobby_Attribute_Release_4(unaff_EDI); return 0; } //@@ 00a85020 FUN_00a85020 int FUN_00a85020(int param_1,int *param_2,undefined1 *param_3) { int *piVar1; int iVar2; int in_ECX; int iVar3; uint uVar4; iVar3 = 0xfff; if (param_1 != -1) { iVar2 = *(int *)(in_ECX + 8); do { piVar1 = (int *)(iVar2 + param_1 * 0x10); *(char *)(iVar3 + 0xc9baa0) = (char)piVar1[3]; iVar3 = iVar3 + -1; param_1 = *piVar1; } while (param_1 != -1); } uVar4 = iVar3 + 1; *param_3 = *(undefined1 *)(iVar3 + 0xc9baa1); iVar3 = 0x1000 - uVar4; for (; uVar4 < 0x1000; uVar4 = uVar4 + 1) { *(undefined1 *)*param_2 = *(undefined1 *)(uVar4 + 0xc9baa0); *param_2 = *param_2 + 1; } return iVar3; } //@@ 00a85090 FUN_00a85090 uint FUN_00a85090(byte param_1) { byte *pbVar1; int iVar2; byte bVar3; int *in_ECX; uint uVar4; int iVar5; bVar3 = *(byte *)(in_ECX + 4); uVar4 = in_ECX[3]; if (bVar3 < param_1) { iVar2 = *in_ECX; iVar5 = in_ECX[2]; do { pbVar1 = (byte *)(iVar2 + iVar5); bVar3 = bVar3 + 8; iVar5 = iVar5 + 1; uVar4 = uVar4 << 8 | (uint)*pbVar1; in_ECX[2] = iVar5; iVar2 = *in_ECX; in_ECX[3] = uVar4; *(byte *)(in_ECX + 4) = bVar3; } while (bVar3 < param_1); } *(byte *)(in_ECX + 4) = bVar3 - param_1; return (1 << (param_1 & 0x1f)) - 1U & uVar4 >> (bVar3 - param_1 & 0x1f); } //@@ 00a850f0 FUN_00a850f0 void FUN_00a850f0(void) { int iVar1; undefined4 *in_ECX; char cVar2; cVar2 = '\0'; iVar1 = 0; do { *(char *)(in_ECX[2] + 0xc + iVar1) = cVar2; cVar2 = cVar2 + '\x01'; *(undefined4 *)(iVar1 + in_ECX[2]) = 0xffffffff; *(undefined4 *)(in_ECX[2] + 4 + iVar1) = 0xffffffff; *(undefined4 *)(in_ECX[2] + 8 + iVar1) = 0xffffffff; iVar1 = iVar1 + 0x10; } while (iVar1 < 0x1000); *in_ECX = 0x100; in_ECX[1] = 8; return; } //@@ 00a85140 lzw_compress /* DB: ? LZW encoder: dictionary trie (global DAT_00c7de50: code width +4, 0x10-byte nodes {?, first child +4, next sibling +8, byte +0xc}), emits variable-width codes into a bit buffer, "ERROR! Cannot flush BitBuffer, not enough space left."; write_game_state_to_stream ("Buffer overflow" check) */ uint lzw_compress(int param_1,byte *param_2,int param_3) { byte *pbVar1; uint *puVar2; uint uVar3; char cVar4; byte bVar5; byte bVar6; byte bVar7; uint uVar8; uint uVar9; int iVar10; uint uVar11; uint uVar12; uint *puVar13; uint local_c; uint local_8; uVar12 = 0; pbVar1 = param_2 + param_3; local_c = 0; uVar11 = 0; cVar4 = '\0'; uVar3 = (uint)*param_2; do { param_2 = param_2 + 1; if (param_2 == pbVar1) { bVar7 = (byte)DAT_00c7de50[1]; bVar6 = cVar4 + bVar7; uVar11 = (1 << (bVar7 & 0x1f)) - 1U & uVar3 | local_c << (bVar7 & 0x1f); while (7 < bVar6) { bVar6 = bVar6 - 8; *(char *)(uVar12 + param_1) = (char)(uVar11 >> (bVar6 & 0x1f)); uVar12 = uVar12 + 1; } if (uVar12 < (uint)(param_3 * 2)) { if (bVar6 != 0) { *(byte *)(uVar12 + param_1) = (('\x01' << (bVar6 & 0x1f)) - 1U & (byte)uVar11) << (8 - bVar6 & 0x1f); return uVar12 + 1; } } else { KAGE_LogMessage(1,(byte *)"ERROR! Cannot flush BitBuffer, not enough space left.\n"); } return uVar12; } bVar7 = *param_2; cVar4 = (char)uVar11; uVar11 = (uint)CONCAT11(bVar7,cVar4); if (uVar3 != 0xffffffff) { uVar8 = DAT_00c7de50[2]; for (local_8 = *(uint *)(uVar8 + 4 + uVar3 * 0x10); local_8 != 0xffffffff; local_8 = *(uint *)(uVar8 + 8 + local_8 * 0x10)) { if (*(byte *)(uVar8 + 0xc + local_8 * 0x10) == bVar7) goto LAB_00a85289; } } bVar6 = (byte)DAT_00c7de50[1]; bVar5 = cVar4 + bVar6; uVar11 = (uint)CONCAT11(bVar7,bVar5); local_c = local_c << (bVar6 & 0x1f) | (1 << (bVar6 & 0x1f)) - 1U & uVar3; puVar2 = DAT_00c7de50; while (DAT_00c7de50 = puVar2, 7 < bVar5) { bVar5 = (char)uVar11 - 8; uVar11 = CONCAT31((int3)(uVar11 >> 8),bVar5); *(char *)(uVar12 + param_1) = (char)(local_c >> (bVar5 & 0x1f)); uVar12 = uVar12 + 1; puVar2 = DAT_00c7de50; } uVar8 = puVar2[1]; uVar9 = *puVar2; if ((uint)(1 << ((byte)uVar8 & 0x1f)) <= uVar9) { do { uVar8 = uVar8 + 1; } while ((uint)(1 << ((byte)uVar8 & 0x1f)) <= uVar9); puVar2[1] = uVar8; } bVar7 = (byte)(uVar11 >> 8); if ((uVar3 != 0xffffffff) && (uVar9 < 0x1000)) { puVar13 = (uint *)(uVar9 * 0x10 + puVar2[2]); iVar10 = uVar3 * 0x10 + puVar2[2]; *(byte *)(puVar13 + 3) = bVar7; *puVar13 = uVar3; puVar13[1] = 0xffffffff; puVar13[2] = *(uint *)(iVar10 + 4); *(uint *)(iVar10 + 4) = *puVar2; *puVar2 = *puVar2 + 1; uVar9 = *puVar2; } if (0xfff < uVar9) { iVar10 = 0; do { *(undefined4 *)(iVar10 + 4 + puVar2[2]) = 0xffffffff; iVar10 = iVar10 + 0x10; } while (iVar10 < 0x1000); *puVar2 = 0x100; puVar2[1] = 8; } local_8 = (uint)bVar7; LAB_00a85289: cVar4 = (char)uVar11; uVar3 = local_8; } while( true ); } //@@ 00a85320 lzw_decompress /* DB: counterpart of lzw_compress (00a85140): ECX = LZW state (next code +0, code width +4, dictionary +8 of 0x10-byte entries, reset to 0x100 / 8 bits at 0x1000 codes), bit reader over the input, "ERROR! wrong code %u"; callers KAGE::Filesys::ArchivedFile::refill_buffer (00a69090), 00a68cf0, 0091826a */ int lzw_decompress(undefined1 param_1,int param_2,uint param_3) { byte *pbVar1; uint uVar2; int iVar3; uint uVar4; int iVar5; uint *in_ECX; byte bVar6; uint uVar7; uint *puVar8; uint local_24; uint local_20; byte local_1c; uint local_14; uint local_10; uVar4 = param_3; iVar3 = param_2; local_24 = 0; local_20 = 0; local_1c = 0; local_10 = FUN_00a85090((char)in_ECX[1]); param_3 = FUN_00a85020(local_10,¶m_1,(int)¶m_2 + 3); local_14 = 0; if (uVar4 != 0) { while( true ) { if (0xfff < *in_ECX + 1) { iVar5 = 0; do { *(undefined4 *)(in_ECX[2] + 4 + iVar5) = 0xffffffff; iVar5 = iVar5 + 0x10; } while (iVar5 < 0x1000); *in_ECX = 0x100; in_ECX[1] = 8; if (local_1c < 8) { do { pbVar1 = (byte *)(local_24 + iVar3); local_1c = local_1c + 8; local_24 = local_24 + 1; local_20 = local_20 << 8 | (uint)*pbVar1; } while (local_1c < 8); local_14 = local_24; } local_1c = local_1c - 8; local_10 = local_20 >> (local_1c & 0x1f) & 0xff; iVar5 = FUN_00a85020(local_10,¶m_1,(int)¶m_2 + 3); param_3 = param_3 + iVar5; } if (uVar4 <= local_24) break; uVar7 = in_ECX[1]; uVar2 = *in_ECX; if ((uint)(1 << ((byte)uVar7 & 0x1f)) <= uVar2) { do { uVar7 = uVar7 + 1; } while ((uint)(1 << ((byte)uVar7 & 0x1f)) <= uVar2); in_ECX[1] = uVar7; local_24 = local_14; } bVar6 = (byte)uVar7; if (local_1c < bVar6) { do { local_1c = local_1c + 8; pbVar1 = (byte *)(local_24 + iVar3); local_24 = local_24 + 1; local_20 = local_20 << 8 | (uint)*pbVar1; } while (local_1c < bVar6); local_14 = local_24; } local_1c = local_1c - bVar6; uVar7 = local_20 >> (local_1c & 0x1f) & (1 << (bVar6 & 0x1f)) - 1U; if (uVar7 == uVar2) { if ((local_10 != 0xffffffff) && (uVar2 < 0x1000)) { puVar8 = (uint *)(uVar2 * 0x10 + in_ECX[2]); iVar5 = local_10 * 0x10 + in_ECX[2]; *(undefined1 *)(puVar8 + 3) = param_2._3_1_; *puVar8 = local_10; puVar8[1] = 0xffffffff; puVar8[2] = *(uint *)(iVar5 + 4); *(uint *)(iVar5 + 4) = *in_ECX; *in_ECX = *in_ECX + 1; local_24 = local_14; } iVar5 = FUN_00a85020(uVar7,¶m_1,(int)¶m_2 + 3); param_3 = param_3 + iVar5; } else { if (uVar2 < uVar7) { KAGE_LogMessage(1,(byte *)"ERROR! wrong code %u\n"); return 0; } iVar5 = FUN_00a85020(uVar7,¶m_1,(int)¶m_2 + 3); param_3 = param_3 + iVar5; if (local_10 != 0xffffffff) { if (*in_ECX < 0x1000) { iVar5 = local_10 * 0x10 + in_ECX[2]; puVar8 = (uint *)(*in_ECX * 0x10 + in_ECX[2]); *(undefined1 *)(puVar8 + 3) = param_2._3_1_; *puVar8 = local_10; puVar8[1] = 0xffffffff; puVar8[2] = *(uint *)(iVar5 + 4); *(uint *)(iVar5 + 4) = *in_ECX; *in_ECX = *in_ECX + 1; local_24 = local_14; } } } local_10 = uVar7; if (uVar4 <= local_24) { return param_3; } } } return param_3; } //@@ 00a855a0 FUN_00a855a0 int FUN_00a855a0(uint param_1) { int iVar1; uint in_ECX; byte *in_EDX; byte *pbVar2; byte *pbVar3; uint uVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; byte *pbVar12; uint local_10; byte *local_8; uVar4 = in_ECX & 0xffff; local_10 = in_ECX >> 0x10; pbVar2 = (byte *)(param_1 % 0x15b0); if (in_EDX == (byte *)0x0) { return 1; } while (param_1 != 0) { pbVar3 = (byte *)0x0; if (&DAT_00000007 < pbVar2) { iVar1 = 7 - (int)in_EDX; do { pbVar3 = pbVar3 + 8; iVar5 = uVar4 + *in_EDX; iVar6 = iVar5 + (uint)in_EDX[1]; iVar7 = iVar6 + (uint)in_EDX[2]; iVar8 = iVar7 + (uint)in_EDX[3]; iVar9 = iVar8 + (uint)in_EDX[4]; iVar10 = iVar9 + (uint)in_EDX[5]; iVar11 = iVar10 + (uint)in_EDX[6]; pbVar12 = in_EDX + 7; in_EDX = in_EDX + 8; uVar4 = iVar11 + (uint)*pbVar12; local_10 = local_10 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 + uVar4; } while (in_EDX + iVar1 < pbVar2); } iVar1 = 0; if (pbVar3 < pbVar2) { if ((uint)((int)pbVar2 - (int)pbVar3) < 2) { iVar5 = 0; uVar4 = uVar4 + *in_EDX; local_10 = local_10 + uVar4; in_EDX = in_EDX + 1; } else { iVar7 = ((uint)(pbVar2 + (-2 - (int)pbVar3)) >> 1) + 1; iVar6 = iVar7 * 2; iVar1 = 0; iVar5 = iVar1; do { pbVar12 = in_EDX; iVar5 = iVar5 + uVar4 + *pbVar12; in_EDX = pbVar12 + 2; uVar4 = uVar4 + *pbVar12 + (uint)pbVar12[1]; iVar1 = iVar1 + uVar4; iVar7 = iVar7 + -1; } while (iVar7 != 0); if (pbVar3 + iVar6 < pbVar2) { uVar4 = uVar4 + *in_EDX; local_10 = local_10 + uVar4; in_EDX = pbVar12 + 3; } } local_10 = local_10 + iVar1 + iVar5; } uVar4 = uVar4 % 0xfff1; local_10 = local_10 % 0xfff1; local_8 = (byte *)0x15b0; param_1 = param_1 - (int)pbVar2; pbVar2 = local_8; } return uVar4 + local_10 * 0x10000; } //@@ 00a85710 tinfl_decompress /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: miniz: switch(r->m_state) state machine, stored-block nlen ^ 0xffff check, -3 (TINFL_STATUS_BAD_PARAM) for a non power-of-two buffer; the TDEFL strings are table reads misshown as string offsets */ int tinfl_decompress(int *param_1,byte *param_2,byte *param_3,uint *param_4,uint param_5) { uint uVar1; byte *pbVar2; byte *pbVar3; ushort uVar4; short sVar5; ushort *puVar6; uint uVar7; byte *pbVar8; byte bVar9; undefined4 *in_ECX; uint uVar10; uint uVar11; int iVar12; uint uVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; ushort *in_EDX; uint uVar21; ushort *puVar22; byte *pbVar23; byte *pbVar24; size_t _Size; bool bVar25; uint local_d8; uint local_d0; byte *local_cc; uint local_c8; uint local_c4; byte *local_c0; byte *local_bc; uint local_b8; byte *local_b4; uint local_a8; byte *local_a0; int local_98; ushort *local_94; uint local_90; int local_8c [16]; uint local_4c [17]; uint local_8; local_8 = __security_cookie ^ (uint)(local_4c + 0x12); puVar6 = (ushort *)(*param_1 + (int)in_EDX); local_98 = -1; pbVar3 = param_3 + *param_4; uVar10 = param_5 & 4; local_a0 = param_3; if (uVar10 == 0) { local_c0 = param_3 + (*param_4 - (int)param_2); local_cc = local_c0 + -1; if (((uint)local_c0 & (uint)local_cc) != 0) goto LAB_00a8720b; } else { local_cc = (byte *)0xffffffff; local_c0 = (byte *)0x0; } if (param_3 < param_2) { LAB_00a8720b: *param_4 = 0; *param_1 = 0; return -3; } local_b8 = in_ECX[8]; local_a8 = in_ECX[0xe]; local_90 = in_ECX[9]; pbVar23 = (byte *)in_ECX[1]; local_c4 = in_ECX[10]; local_d8 = in_ECX[0xf]; uVar13 = local_a8; local_94 = in_EDX; puVar22 = in_EDX; switch(*in_ECX) { case 0: pbVar23 = (byte *)0x0; in_ECX[3] = 0; in_ECX[2] = 0; local_c4 = 0; local_90 = 0; local_b8 = 0; local_a8 = 0; in_ECX[7] = 1; in_ECX[4] = 1; uVar13 = 0; if ((param_5 & 1) != 0) { if (puVar6 <= in_EDX) goto LAB_00a858a1; local_94 = (ushort *)((int)in_EDX + 1); uVar13 = (uint)(byte)*in_EDX; goto LAB_00a858b9; } goto joined_r0x00a861d6; case 1: if (in_EDX < puVar6) { local_94 = (ushort *)((int)in_EDX + 1); uVar13 = (uint)(byte)*in_EDX; } else { LAB_00a858a1: if ((param_5 & 2) != 0) { iVar12 = 1; local_98 = 1; *in_ECX = 1; break; } uVar13 = 0; } LAB_00a858b9: in_ECX[2] = uVar13; if (local_94 < puVar6) { uVar4 = *local_94; local_94 = (ushort *)((int)local_94 + 1); uVar13 = (uint)(byte)uVar4; } else { LAB_00a858e6: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 2; local_98 = 1; local_94 = local_94; break; } uVar13 = 0; } goto LAB_00a85907; case 2: if (puVar6 <= in_EDX) goto LAB_00a858e6; uVar13 = (uint)(byte)*in_EDX; local_94 = (ushort *)((int)in_EDX + 1); LAB_00a85907: in_ECX[3] = uVar13; if ((((in_ECX[2] * 0x100 + uVar13) % 0x1f == 0) && ((*(byte *)(in_ECX + 3) & 0x20) == 0)) && (((byte)in_ECX[2] & 0xf) == 8)) { local_90 = 0; } else { local_90 = 1; } if (uVar10 == 0) { pbVar24 = (byte *)(1 << ((char)((uint)in_ECX[2] >> 4) + 8U & 0x1f)); if ((pbVar24 < (byte *)0x8001) && (pbVar24 <= local_c0)) { uVar13 = 0; } else { uVar13 = 1; } local_90 = local_90 | uVar13; } uVar13 = local_a8; puVar22 = local_94; if (local_90 == 0) { joined_r0x00a861d6: for (; local_a8 = uVar13, pbVar23 < 3; pbVar23 = (byte *)((int)pbVar23 + 8)) { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a861f5: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a861e0: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 3; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } bVar9 = (byte)pbVar23; uVar13 = local_a8 | uVar13 << (bVar9 & 0x1f); } pbVar23 = (byte *)((int)pbVar23 - 3); uVar13 = local_a8 & 7; local_a8 = local_a8 >> 3; in_ECX[5] = uVar13; uVar13 = uVar13 >> 1; in_ECX[6] = uVar13; if (uVar13 != 0) { if (uVar13 != 3) { local_b4 = pbVar23; if (uVar13 == 1) { in_ECX[0xb] = 0x120; in_ECX[0xc] = 0x20; in_ECX[0x378] = &DAT_05050505; in_ECX[0x379] = &DAT_05050505; in_ECX[0x37a] = &DAT_05050505; in_ECX[0x37b] = &DAT_05050505; in_ECX[0x37c] = &DAT_05050505; in_ECX[0x37d] = &DAT_05050505; in_ECX[0x37e] = &DAT_05050505; in_ECX[0x37f] = &DAT_05050505; memset(in_ECX + 0x10,8,0x90); memset(in_ECX + 0x34,9,0x70); *(undefined8 *)(in_ECX + 0x50) = 0x707070707070707; *(undefined8 *)(in_ECX + 0x52) = 0x707070707070707; *(undefined8 *)(in_ECX + 0x54) = 0x707070707070707; in_ECX[0x56] = 0x8080808; in_ECX[0x57] = 0x8080808; } else { for (local_90 = 0; local_90 < 3; local_90 = local_90 + 1) { if (local_b4 < (uint)(int)(char)(&DAT_00ba55b4)[local_90]) { do { pbVar23 = local_b4; if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a86597: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a86582: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0xb; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } local_b4 = (byte *)((int)pbVar23 + 8); local_a8 = local_a8 | uVar13 << ((byte)pbVar23 & 0x1f); } while (local_b4 < (uint)(int)(char)(&DAT_00ba55b4)[local_90]); } uVar13 = (1 << ((&DAT_00ba55b4)[local_90] & 0x1f)) - 1U & local_a8; in_ECX[local_90 + 0xb] = uVar13; local_a8 = local_a8 >> ((&DAT_00ba55b4)[local_90] & 0x1f); local_b4 = (byte *)((int)local_b4 - (int)(char)(&DAT_00ba55b4)[local_90]); in_ECX[local_90 + 0xb] = *(int *)(&DAT_00ba5a98 + local_90 * 4) + uVar13; } memset(in_ECX + 0x6e0,0,0x120); for (local_90 = 0; pbVar23 = local_b4, local_90 < (uint)in_ECX[0xd]; local_90 = local_90 + 1) { for (; pbVar23 < 3; pbVar23 = (byte *)((int)pbVar23 + 8)) { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a8665e: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a86649: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0xe; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } local_a8 = local_a8 | uVar13 << ((byte)pbVar23 & 0x1f); } bVar9 = (byte)local_a8; local_a8 = local_a8 >> 3; local_b4 = (byte *)((int)pbVar23 - 3); *(byte *)((byte)(&DAT_00ba5b24)[local_90] + 0x1b80 + (int)in_ECX) = bVar9 & 7; } in_ECX[0xd] = 0x13; } while (iVar12 = in_ECX[6], -1 < iVar12) { iVar14 = iVar12 * 0xda0; iVar15 = iVar14 + 0x40; memset(local_8c,0,0x40); memset(in_ECX + iVar12 * 0x368 + 0x58,0,0xc80); uVar7 = 0; uVar13 = in_ECX[in_ECX[6] + 0xb]; if (uVar13 != 0) { do { iVar12 = uVar7 + iVar15; uVar7 = uVar7 + 1; local_8c[*(byte *)((int)in_ECX + iVar12)] = local_8c[*(byte *)((int)in_ECX + iVar12)] + 1; } while (uVar7 < uVar13); } iVar16 = 0; uVar7 = 4; iVar12 = 0; local_4c[1] = 0; local_4c[0] = 0; local_d0 = 0; local_c0 = (byte *)0x0; do { iVar18 = (iVar12 + *(int *)((int)local_8c + uVar7)) * 2; iVar16 = iVar16 + *(int *)((int)local_8c + uVar7); iVar12 = *(int *)((int)local_8c + uVar7 + 4); local_c0 = (byte *)((int)local_c0 + iVar12); *(int *)((int)local_4c + uVar7 + 4) = iVar18; iVar17 = *(int *)((int)local_8c + uVar7 + 8); iVar12 = (iVar18 + iVar12) * 2; local_d0 = local_d0 + iVar17; *(int *)((int)local_4c + uVar7 + 8) = iVar12; iVar12 = (iVar12 + iVar17) * 2; *(int *)((int)local_4c + uVar7 + 0xc) = iVar12; uVar7 = uVar7 + 0xc; } while (uVar7 < 0x3d); if ((iVar12 != 0x10000) && (1 < iVar16 + local_d0 + (int)local_c0)) { goto switchD_00a8580e_caseD_23; } local_d0 = 0; if (uVar13 != 0) { iVar12 = -1; do { bVar9 = *(byte *)((int)in_ECX + local_d0 + iVar15); uVar13 = (uint)bVar9; if (uVar13 != 0) { local_c8 = local_4c[uVar13]; local_4c[uVar13] = local_c8 + 1; uVar7 = 0; local_c0 = (byte *)uVar13; do { uVar21 = uVar7; uVar11 = local_c8 & 1; uVar1 = uVar21 * 2; uVar7 = uVar1 | uVar11; local_c0 = (byte *)((int)local_c0 - 1); local_c8 = local_c8 >> 1; } while (local_c0 != (byte *)0x0); if (uVar13 < 0xb) { if (uVar7 < 0x400) { iVar16 = 1 << (bVar9 & 0x1f); puVar22 = (ushort *)((int)in_ECX + uVar7 * 2 + iVar15 + 0x120); do { *puVar22 = (ushort)bVar9 << 9 | (ushort)local_d0; uVar7 = uVar7 + iVar16; puVar22 = puVar22 + iVar16; } while (uVar7 < 0x400); } } else { uVar11 = uVar1 & 0x3ff | uVar11; iVar16 = (int)*(short *)((int)in_ECX + uVar11 * 2 + iVar14 + 0x160); iVar17 = iVar12; if (iVar16 == 0) { *(short *)((int)in_ECX + uVar11 * 2 + iVar14 + 0x160) = (short)iVar12; iVar17 = iVar12 + -2; iVar16 = iVar12; } uVar7 = (uVar21 & 0x7fffffff) >> 8; if (0xb < uVar13) { iVar12 = uVar13 - 0xb; do { uVar7 = uVar7 >> 1; iVar16 = (uVar7 & 1) - iVar16; sVar5 = *(short *)((int)in_ECX + iVar16 * 2 + iVar14 + 0x95e); if (sVar5 == 0) { *(short *)((int)in_ECX + iVar16 * 2 + iVar14 + 0x95e) = (short)iVar17; iVar16 = iVar17; iVar17 = iVar17 + -2; } else { iVar16 = (int)sVar5; } iVar12 = iVar12 + -1; } while (iVar12 != 0); } *(ushort *)((int)in_ECX + ((uVar7 >> 1 & 1) - iVar16) * 2 + iVar14 + 0x95e) = (ushort)local_d0; iVar12 = iVar17; } } local_d0 = local_d0 + 1; } while (local_d0 < (uint)in_ECX[in_ECX[6] + 0xb]); pbVar23 = local_b4; } iVar12 = in_ECX[6]; if (iVar12 == 2) { local_90 = 0; while (local_90 < (uint)(in_ECX[0xc] + in_ECX[0xb])) { puVar22 = local_94; if (pbVar23 < 0xf) { if ((int)puVar6 - (int)local_94 < 2) { do { uVar13 = (uint)*(short *)((int)in_ECX + (local_a8 & 0x3ff) * 2 + 0x1ca0); if ((int)uVar13 < 0) { if (10 < pbVar23) { iVar12 = 10; do { uVar13 = (uint)*(short *)((int)in_ECX + ((local_a8 >> ((byte)iVar12 & 0x1f) & 1) + ~uVar13) * 2 + 0x24a0); puVar22 = local_94; if (-1 < (int)uVar13) goto LAB_00a869e1; uVar7 = iVar12 + 2; iVar12 = iVar12 + 1; } while (uVar7 <= pbVar23); } } else if ((int)uVar13 >> 9 != 0) { if ((uint)((int)uVar13 >> 9) <= pbVar23) { LAB_00a869e1: break; } } if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a86a71: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a86a5c: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x10; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } bVar9 = (byte)pbVar23; pbVar23 = (byte *)((int)pbVar23 + 8); local_a8 = local_a8 | uVar13 << (bVar9 & 0x1f); } while (pbVar23 < 0xf); } else { puVar22 = local_94 + 1; local_a8 = local_a8 | (uint)*(byte *)((int)local_94 + 1) << ((byte)pbVar23 + 8 & 0x1f) | (uint)(byte)*local_94 << ((byte)pbVar23 & 0x1f); pbVar23 = (byte *)((int)pbVar23 + 0x10); local_94 = puVar22; } } local_b8 = (uint)*(short *)((int)in_ECX + (local_a8 & 0x3ff) * 2 + 0x1ca0); if ((int)local_b8 < 0) { iVar12 = 10; do { bVar9 = (byte)iVar12; iVar12 = iVar12 + 1; local_b8 = (uint)*(short *)((int)in_ECX + ((local_a8 >> (bVar9 & 0x1f) & 1) + ~local_b8) * 2 + 0x24a0); } while ((int)local_b8 < 0); } else { iVar12 = (int)local_b8 >> 9; local_b8 = local_b8 & 0x1ff; } local_a8 = local_a8 >> ((byte)iVar12 & 0x1f); pbVar23 = (byte *)((int)pbVar23 - iVar12); if (local_b8 < 0x10) { *(char *)((int)in_ECX + local_90 + 0x2924) = (char)local_b8; local_90 = local_90 + 1; local_b4 = pbVar23; } else { if ((local_b8 == 0x10) && (local_90 == 0)) goto switchD_00a8580e_caseD_11; local_c4 = (uint)*(char *)((int)L"bits <= ((1U << len) - 1U)" + local_b8 + 0x28); if (pbVar23 < local_c4) { do { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a86b61: puVar22 = (ushort *)((int)puVar22 + 1); uVar7 = (uint)bVar9; uVar13 = (uint)pbVar23; local_94 = puVar22; } else { LAB_00a86b4c: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x12; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar7 = 0; uVar13 = (uint)pbVar23; } pbVar23 = (byte *)(uVar13 + 8); local_a8 = local_a8 | uVar7 << ((byte)uVar13 & 0x1f); } while (pbVar23 < local_c4); } pbVar23 = (byte *)((int)pbVar23 - local_c4); uVar13 = (1 << ((byte)local_c4 & 0x1f)) - 1U & local_a8; local_a8 = local_a8 >> ((byte)local_c4 & 0x1f); _Size = uVar13 + (int)*(char *)((int)L"bits <= ((1U << len) - 1U)" + local_b8 + 0x2c); if (local_b8 == 0x10) { uVar13 = (uint)*(byte *)((int)in_ECX + local_90 + 0x2923); } else { uVar13 = 0; } memset((void *)((int)in_ECX + local_90 + 0x2924),uVar13,_Size); local_90 = local_90 + _Size; local_b4 = pbVar23; } } if (local_90 != in_ECX[0xc] + in_ECX[0xb]) goto switchD_00a8580e_caseD_15; memcpy(in_ECX + 0x10,in_ECX + 0xa49,in_ECX[0xb]); memcpy(in_ECX + 0x378,(void *)(in_ECX[0xb] + 0x2924 + (int)in_ECX),in_ECX[0xc]); iVar12 = in_ECX[6]; } in_ECX[6] = iVar12 + -1; puVar22 = local_94; } uVar13 = local_a8; LAB_00a85b61: while( true ) { bVar9 = (byte)pbVar23; if (((int)puVar6 - (int)puVar22 < 4) || ((int)pbVar3 - (int)local_a0 < 2)) break; if (pbVar23 < 0xf) { uVar4 = *puVar22; puVar22 = puVar22 + 1; uVar13 = uVar13 | (uint)uVar4 << (bVar9 & 0x1f); pbVar23 = (byte *)((int)pbVar23 + 0x10); local_94 = puVar22; } local_90 = (uint)*(short *)((int)in_ECX + (uVar13 & 0x3ff) * 2 + 0x160); if ((int)local_90 < 0) { iVar12 = 10; do { bVar9 = (byte)iVar12; iVar12 = iVar12 + 1; local_90 = (uint)*(short *)((int)in_ECX + ((uVar13 >> (bVar9 & 0x1f) & 1) + ~local_90) * 2 + 0x960) ; } while ((int)local_90 < 0); puVar22 = local_94; } else { iVar12 = (int)local_90 >> 9; } local_a8 = uVar13 >> ((byte)iVar12 & 0x1f); pbVar23 = (byte *)((int)pbVar23 - iVar12); if ((local_90 & 0x100) != 0) goto LAB_00a85e32; if (pbVar23 < 0xf) { uVar4 = *puVar22; puVar22 = puVar22 + 1; local_a8 = local_a8 | (uint)uVar4 << ((byte)pbVar23 & 0x1f); pbVar23 = (byte *)((int)pbVar23 + 0x10); local_94 = puVar22; } local_b4 = (byte *)(int)*(short *)((int)in_ECX + (local_a8 & 0x3ff) * 2 + 0x160); if ((int)local_b4 < 0) { iVar12 = 10; do { bVar9 = (byte)iVar12; iVar12 = iVar12 + 1; local_b4 = (byte *)(int)*(short *)((int)in_ECX + ((local_a8 >> (bVar9 & 0x1f) & 1) + ~(uint)local_b4) * 2 + 0x960); } while ((int)local_b4 < 0); puVar22 = local_94; } else { iVar12 = (int)local_b4 >> 9; } pbVar23 = (byte *)((int)pbVar23 - iVar12); local_a8 = local_a8 >> ((byte)iVar12 & 0x1f); *local_a0 = (byte)local_90; pbVar24 = local_a0 + 1; if (((uint)local_b4 & 0x100) != 0) { local_90 = (uint)local_b4; local_a0 = pbVar24; goto LAB_00a85e32; } local_a0 = local_a0 + 2; *pbVar24 = (byte)local_b4; uVar13 = local_a8; } if (pbVar23 < 0xf) { if ((int)puVar6 - (int)puVar22 < 2) { do { uVar7 = (uint)*(short *)((int)in_ECX + (uVar13 & 0x3ff) * 2 + 0x160); if ((int)uVar7 < 0) { if (10 < pbVar23) { iVar12 = 10; do { uVar7 = (uint)*(short *)((int)in_ECX + ((uVar13 >> ((byte)iVar12 & 0x1f) & 1) + ~uVar7) * 2 + 0x960); puVar22 = local_94; if (-1 < (int)uVar7) goto LAB_00a85ce2; uVar1 = iVar12 + 2; iVar12 = iVar12 + 1; } while (uVar1 <= pbVar23); } } else if ((int)uVar7 >> 9 != 0) { if ((uint)((int)uVar7 >> 9) <= pbVar23) { LAB_00a85ce2: break; } } if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; local_a8 = uVar13; LAB_00a85d72: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a85d5d: local_a8 = uVar13; if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x17; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } bVar9 = (byte)pbVar23; pbVar23 = (byte *)((int)pbVar23 + 8); uVar13 = local_a8 | uVar13 << (bVar9 & 0x1f); } while (pbVar23 < 0xf); } else { pbVar24 = (byte *)((int)puVar22 + 1); uVar4 = *puVar22; puVar22 = puVar22 + 1; uVar13 = local_a8 | (uint)*pbVar24 << (bVar9 + 8 & 0x1f) | (uint)(byte)uVar4 << (bVar9 & 0x1f); pbVar23 = (byte *)((int)pbVar23 + 0x10); local_94 = puVar22; } } local_90 = (uint)*(short *)((int)in_ECX + (uVar13 & 0x3ff) * 2 + 0x160); if ((int)local_90 < 0) { iVar12 = 10; do { bVar9 = (byte)iVar12; iVar12 = iVar12 + 1; local_90 = (uint)*(short *)((int)in_ECX + ((uVar13 >> (bVar9 & 0x1f) & 1) + ~local_90) * 2 + 0x960); } while ((int)local_90 < 0); puVar22 = local_94; } else { iVar12 = (int)local_90 >> 9; local_90 = local_90 & 0x1ff; } local_a8 = uVar13 >> ((byte)iVar12 & 0x1f); pbVar23 = (byte *)((int)pbVar23 - iVar12); if (local_90 < 0x100) { switchD_00a8580e_caseD_18: if (pbVar3 <= local_a0) { iVar12 = 2; *in_ECX = 0x18; local_98 = 2; local_94 = puVar22; break; } *local_a0 = (byte)local_90; local_a0 = local_a0 + 1; uVar13 = local_a8; goto LAB_00a85b61; } LAB_00a85e32: local_90 = local_90 & 0x1ff; uVar13 = local_a8; if (local_90 != 0x100) { local_c4 = *(uint *)( L"(cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE)" + local_90 * 2 + 0x4e); local_90 = *(uint *)(L"lookahead_size >= cur_match_len" + local_90 * 2 + 2); if (local_c4 != 0) { if (pbVar23 < local_c4) { do { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a85e8e: puVar22 = (ushort *)((int)puVar22 + 1); uVar7 = (uint)bVar9; uVar13 = (uint)pbVar23; local_94 = puVar22; } else { LAB_00a85e79: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x19; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar7 = 0; uVar13 = (uint)pbVar23; } pbVar23 = (byte *)(uVar13 + 8); local_a8 = local_a8 | uVar7 << ((byte)uVar13 & 0x1f); } while (pbVar23 < local_c4); } pbVar23 = (byte *)((int)pbVar23 - local_c4); uVar13 = (1 << ((byte)local_c4 & 0x1f)) - 1U & local_a8; local_a8 = local_a8 >> ((byte)local_c4 & 0x1f); local_90 = local_90 + uVar13; } if (pbVar23 < 0xf) { if ((int)puVar6 - (int)puVar22 < 2) { do { uVar13 = (uint)*(short *)((int)in_ECX + (local_a8 & 0x3ff) * 2 + 0xf00); if ((int)uVar13 < 0) { if (10 < pbVar23) { iVar12 = 10; do { uVar13 = (uint)*(short *)((int)in_ECX + ((local_a8 >> ((byte)iVar12 & 0x1f) & 1) + ~uVar13) * 2 + 0x1700); puVar22 = local_94; if (-1 < (int)uVar13) goto LAB_00a85ef5; uVar7 = iVar12 + 2; iVar12 = iVar12 + 1; } while (uVar7 <= pbVar23); } } else if ((int)uVar13 >> 9 != 0) { if ((uint)((int)uVar13 >> 9) <= pbVar23) { LAB_00a85ef5: break; } } if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a85f7f: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a85f6a: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x1a; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } bVar9 = (byte)pbVar23; pbVar23 = (byte *)((int)pbVar23 + 8); local_a8 = local_a8 | uVar13 << (bVar9 & 0x1f); } while (pbVar23 < 0xf); } else { pbVar24 = (byte *)((int)puVar22 + 1); uVar4 = *puVar22; puVar22 = puVar22 + 1; local_a8 = local_a8 | (uint)*pbVar24 << ((byte)pbVar23 + 8 & 0x1f) | (uint)(byte)uVar4 << ((byte)pbVar23 & 0x1f); pbVar23 = (byte *)((int)pbVar23 + 0x10); local_94 = puVar22; } } uVar13 = (uint)*(short *)((int)in_ECX + (local_a8 & 0x3ff) * 2 + 0xf00); if ((int)uVar13 < 0) { iVar12 = 10; do { bVar9 = (byte)iVar12; iVar12 = iVar12 + 1; uVar13 = (uint)*(short *)((int)in_ECX + ((local_a8 >> (bVar9 & 0x1f) & 1) + ~uVar13) * 2 + 0x1700); } while ((int)uVar13 < 0); puVar22 = local_94; } else { iVar12 = (int)uVar13 >> 9; uVar13 = uVar13 & 0x1ff; } local_a8 = local_a8 >> ((byte)iVar12 & 0x1f); pbVar23 = (byte *)((int)pbVar23 - iVar12); local_c4 = *(uint *)(&DAT_00ba5b38 + uVar13 * 4); local_b8 = *(uint *)(&DAT_00ba5c38 + uVar13 * 4); if (local_c4 != 0) { if (pbVar23 < local_c4) { do { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a8605e: puVar22 = (ushort *)((int)puVar22 + 1); uVar7 = (uint)bVar9; uVar13 = (uint)pbVar23; local_94 = puVar22; } else { LAB_00a86049: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x1b; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar7 = 0; uVar13 = (uint)pbVar23; } pbVar23 = (byte *)(uVar13 + 8); local_a8 = local_a8 | uVar7 << ((byte)uVar13 & 0x1f); } while (pbVar23 < local_c4); } pbVar23 = (byte *)((int)pbVar23 - local_c4); uVar13 = (1 << ((byte)local_c4 & 0x1f)) - 1U & local_a8; local_a8 = local_a8 >> ((byte)local_c4 & 0x1f); local_b8 = local_b8 + uVar13; } local_d8 = (int)local_a0 - (int)param_2; if ((local_d8 < local_b8) && (uVar10 != 0)) goto switchD_00a8580e_caseD_25; pbVar24 = param_2 + (local_d8 - local_b8 & (uint)local_cc); pbVar8 = pbVar24; if (pbVar24 < local_a0) { pbVar8 = local_a0; } uVar13 = local_a8; if (pbVar3 < pbVar8 + local_90) { while (uVar7 = local_90 - 1, bVar25 = local_90 != 0, local_90 = uVar7, bVar25) { switchD_00a8580e_caseD_35: if (pbVar3 <= local_a0) { iVar12 = 2; *in_ECX = 0x35; local_98 = 2; local_a8 = uVar13; local_94 = puVar22; goto LAB_00a86fbb; } uVar7 = local_d8 - local_b8; local_d8 = local_d8 + 1; *local_a0 = param_2[uVar7 & (uint)local_cc]; puVar22 = local_94; local_a0 = local_a0 + 1; } } else { if ((local_90 < 9) || (local_b8 < local_90)) { LAB_00a8616a: pbVar8 = pbVar24; do { pbVar24 = pbVar8 + 3; *local_a0 = *pbVar8; local_90 = local_90 - 3; local_a0[1] = pbVar8[1]; local_a0[2] = pbVar8[2]; local_a0 = local_a0 + 3; pbVar8 = pbVar24; } while (2 < (int)local_90); puVar22 = local_94; if (0 < (int)local_90) { *local_a0 = *pbVar24; if (1 < (int)local_90) { LAB_00a85b49: local_a0[1] = pbVar24[1]; } LAB_00a85b55: local_a0 = local_a0 + local_90; puVar22 = local_94; } } else { pbVar8 = pbVar24 + (local_90 & 0xfffffff8); do { *(undefined4 *)local_a0 = *(undefined4 *)pbVar24; pbVar2 = pbVar24 + 4; pbVar24 = pbVar24 + 8; *(undefined4 *)(local_a0 + 4) = *(undefined4 *)pbVar2; local_a0 = local_a0 + 8; } while (pbVar24 < pbVar8); local_90 = local_90 & 7; if (2 < local_90) goto LAB_00a8616a; if (local_90 != 0) { *local_a0 = *pbVar24; if (1 < local_90) goto LAB_00a85b49; goto LAB_00a85b55; } } } goto LAB_00a85b61; } goto LAB_00a861c9; } goto switchD_00a8580e_caseD_a; } if (pbVar23 < ((uint)pbVar23 & 7)) { do { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a86254: puVar22 = (ushort *)((int)puVar22 + 1); uVar7 = (uint)bVar9; uVar13 = (uint)pbVar23; local_94 = puVar22; } else { LAB_00a8623f: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 5; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar7 = 0; uVar13 = (uint)pbVar23; } pbVar23 = (byte *)(uVar13 + 8); local_a8 = local_a8 | uVar7 << ((byte)uVar13 & 0x1f); } while (pbVar23 < ((uint)pbVar23 & 7)); } local_a8 = local_a8 >> (sbyte)((uint)pbVar23 & 7); pbVar23 = (byte *)((int)pbVar23 - ((uint)pbVar23 & 7)); local_90 = 0; uVar13 = local_a8; LAB_00a8627d: while (local_90 < 4) { if (pbVar23 == (byte *)0x0) { if (puVar22 < puVar6) { uVar4 = *puVar22; puVar22 = (ushort *)((int)puVar22 + 1); *(byte *)((int)in_ECX + local_90 + 0x2920) = (byte)uVar4; local_90 = local_90 + 1; local_94 = puVar22; } else { LAB_00a862ea: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 7; local_98 = 1; local_a8 = uVar13; local_94 = puVar22; goto LAB_00a86fbb; } *(undefined1 *)((int)in_ECX + local_90 + 0x2920) = 0; local_90 = local_90 + 1; } } else { if (pbVar23 < 8) { do { local_a8 = uVar13; if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a862b2: puVar22 = (ushort *)((int)puVar22 + 1); uVar7 = (uint)bVar9; uVar13 = (uint)pbVar23; local_94 = puVar22; } else { LAB_00a8629d: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 6; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar7 = 0; uVar13 = (uint)pbVar23; } pbVar23 = (byte *)(uVar13 + 8); uVar13 = local_a8 | uVar7 << ((byte)uVar13 & 0x1f); } while (pbVar23 < 8); } *(char *)((int)in_ECX + local_90 + 0x2920) = (char)uVar13; pbVar23 = (byte *)((int)pbVar23 - 8); local_a8 = uVar13 >> 8; local_90 = local_90 + 1; uVar13 = local_a8; } } local_90 = (uint)*(ushort *)(in_ECX + 0xa48); if (local_90 != (*(ushort *)((int)in_ECX + 0x2922) ^ 0xffff)) goto switchD_00a8580e_caseD_27; while( true ) { if (local_90 == 0) break; if (pbVar23 == (byte *)0x0) goto switchD_00a8580e_caseD_9; for (; local_a8 = uVar13, pbVar23 < 8; pbVar23 = (byte *)((int)pbVar23 + 8)) { if (puVar22 < puVar6) { bVar9 = (byte)*puVar22; LAB_00a86391: puVar22 = (ushort *)((int)puVar22 + 1); uVar13 = (uint)bVar9; local_94 = puVar22; } else { LAB_00a8637c: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x33; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; } bVar9 = (byte)pbVar23; uVar13 = local_a8 | uVar13 << (bVar9 & 0x1f); } local_b8 = local_a8 & 0xff; local_a8 = local_a8 >> 8; pbVar23 = (byte *)((int)pbVar23 - 8); LAB_00a863c8: if (pbVar3 <= local_a0) { iVar12 = 2; *in_ECX = 0x34; local_98 = 2; local_94 = puVar22; goto LAB_00a86fbb; } local_90 = local_90 - 1; *local_a0 = (byte)local_b8; uVar13 = local_a8; puVar22 = local_94; local_a0 = local_a0 + 1; } LAB_00a861c9: if ((*(byte *)(in_ECX + 5) & 1) != 0) goto LAB_00a86dad; goto joined_r0x00a861d6; } switchD_00a8580e_caseD_24: iVar12 = -1; *in_ECX = 0x24; local_98 = -1; break; case 3: if (puVar6 <= in_EDX) goto LAB_00a861e0; bVar9 = (byte)*in_EDX; goto LAB_00a861f5; default: iVar12 = -1; break; case 5: if (puVar6 <= in_EDX) goto LAB_00a8623f; bVar9 = (byte)*in_EDX; goto LAB_00a86254; case 6: if (puVar6 <= in_EDX) goto LAB_00a8629d; bVar9 = (byte)*in_EDX; goto LAB_00a862b2; case 7: if (puVar6 <= in_EDX) goto LAB_00a862ea; puVar22 = (ushort *)((int)in_EDX + 1); *(byte *)((int)in_ECX + local_90 + 0x2920) = (byte)*in_EDX; local_90 = local_90 + 1; local_94 = puVar22; goto LAB_00a8627d; case 9: goto switchD_00a8580e_caseD_9; case 10: switchD_00a8580e_caseD_a: iVar12 = -1; *in_ECX = 10; local_98 = -1; local_94 = puVar22; break; case 0xb: if (puVar6 <= in_EDX) goto LAB_00a86582; bVar9 = (byte)*in_EDX; goto LAB_00a86597; case 0xe: if (puVar6 <= in_EDX) goto LAB_00a86649; bVar9 = (byte)*in_EDX; goto LAB_00a8665e; case 0x10: if (puVar6 <= in_EDX) goto LAB_00a86a5c; bVar9 = (byte)*in_EDX; goto LAB_00a86a71; case 0x11: switchD_00a8580e_caseD_11: iVar12 = -1; *in_ECX = 0x11; local_98 = -1; local_94 = puVar22; break; case 0x12: if (puVar6 <= in_EDX) goto LAB_00a86b4c; bVar9 = (byte)*in_EDX; goto LAB_00a86b61; case 0x15: switchD_00a8580e_caseD_15: iVar12 = -1; *in_ECX = 0x15; local_98 = -1; break; case 0x17: if (puVar6 <= in_EDX) goto LAB_00a85d5d; bVar9 = (byte)*in_EDX; goto LAB_00a85d72; case 0x18: goto switchD_00a8580e_caseD_18; case 0x19: if (puVar6 <= in_EDX) goto LAB_00a85e79; bVar9 = (byte)*in_EDX; goto LAB_00a85e8e; case 0x1a: if (puVar6 <= in_EDX) goto LAB_00a85f6a; bVar9 = (byte)*in_EDX; goto LAB_00a85f7f; case 0x1b: if (puVar6 <= in_EDX) goto LAB_00a86049; bVar9 = (byte)*in_EDX; goto LAB_00a8605e; case 0x20: if (puVar6 <= in_EDX) goto LAB_00a86e87; uVar10 = (uint)(byte)*in_EDX; puVar22 = (ushort *)((int)in_EDX + 1); goto LAB_00a86e92; case 0x22: goto switchD_00a8580e_caseD_22; case 0x23: switchD_00a8580e_caseD_23: iVar12 = -1; *in_ECX = 0x23; local_98 = -1; break; case 0x24: goto switchD_00a8580e_caseD_24; case 0x25: switchD_00a8580e_caseD_25: iVar12 = -1; *in_ECX = 0x25; local_98 = -1; local_94 = puVar22; break; case 0x26: goto LAB_00a86430; case 0x27: switchD_00a8580e_caseD_27: iVar12 = -1; *in_ECX = 0x27; local_98 = -1; local_a8 = uVar13; local_94 = puVar22; break; case 0x28: switchD_00a8580e_caseD_28: iVar12 = -1; *in_ECX = 0x28; local_98 = -1; local_a8 = uVar13; local_94 = puVar22; break; case 0x29: if (puVar6 <= in_EDX) goto LAB_00a86f44; uVar13 = (uint)(byte)*in_EDX; puVar22 = (ushort *)((int)in_EDX + 1); uVar10 = (uint)pbVar23; goto LAB_00a86f55; case 0x2a: if (puVar6 <= in_EDX) goto LAB_00a86efd; local_b4 = (byte *)(uint)(byte)*in_EDX; puVar22 = (ushort *)((int)in_EDX + 1); goto LAB_00a86f14; case 0x33: if (puVar6 <= in_EDX) goto LAB_00a8637c; bVar9 = (byte)*in_EDX; goto LAB_00a86391; case 0x34: goto LAB_00a863c8; case 0x35: goto switchD_00a8580e_caseD_35; } LAB_00a86fbb: in_ECX[8] = local_b8; in_ECX[9] = local_90; in_ECX[10] = local_c4; in_ECX[0xf] = local_d8; in_ECX[0xe] = local_a8; uVar10 = (int)local_a0 - (int)param_3; in_ECX[1] = pbVar23; *param_1 = (int)local_94 - (int)in_EDX; *param_4 = uVar10; if (((param_5 & 9) != 0) && (-1 < iVar12)) { uVar13 = in_ECX[7] & 0xffff; local_c0 = (byte *)((uint)in_ECX[7] >> 0x10); pbVar3 = (byte *)(uVar10 % 0x15b0); local_bc = param_3; while (uVar10 != 0) { pbVar23 = (byte *)0x0; if (&DAT_00000007 < pbVar3) { iVar12 = 7 - (int)local_bc; do { pbVar23 = pbVar23 + 8; iVar14 = uVar13 + *local_bc; iVar15 = iVar14 + (uint)local_bc[1]; iVar16 = iVar15 + (uint)local_bc[2]; iVar17 = iVar16 + (uint)local_bc[3]; iVar18 = iVar17 + (uint)local_bc[4]; iVar19 = iVar18 + (uint)local_bc[5]; iVar20 = iVar19 + (uint)local_bc[6]; uVar13 = iVar20 + (uint)local_bc[7]; local_bc = local_bc + 8; local_c0 = (byte *)((int)local_c0 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + iVar19 + iVar20 + uVar13); } while (local_bc + iVar12 < pbVar3); } iVar12 = 0; if (pbVar23 < pbVar3) { if ((uint)((int)pbVar3 - (int)pbVar23) < 2) { iVar14 = 0; LAB_00a8716a: uVar13 = uVar13 + *local_bc; local_c0 = (byte *)((int)local_c0 + uVar13); local_bc = local_bc + 1; } else { iVar16 = ((uint)(pbVar3 + (-2 - (int)pbVar23)) >> 1) + 1; iVar15 = iVar16 * 2; iVar14 = 0; do { bVar9 = *local_bc; pbVar24 = local_bc + 1; iVar14 = iVar14 + uVar13 + bVar9; local_bc = local_bc + 2; uVar13 = uVar13 + bVar9 + (uint)*pbVar24; iVar12 = iVar12 + uVar13; iVar16 = iVar16 + -1; } while (iVar16 != 0); if (pbVar23 + iVar15 < pbVar3) goto LAB_00a8716a; } local_c0 = (byte *)((int)local_c0 + iVar12 + iVar14); } uVar13 = uVar13 % 0xfff1; local_c0 = (byte *)((uint)local_c0 % 0xfff1); local_b4 = (byte *)0x15b0; uVar10 = uVar10 - (int)pbVar3; pbVar3 = local_b4; } iVar14 = (int)local_c0 * 0x10000 + uVar13; in_ECX[7] = iVar14; iVar12 = local_98; if (((local_98 == 0) && ((param_5 & 1) != 0)) && (iVar14 != in_ECX[4])) { iVar12 = -2; } } return iVar12; while( true ) { uVar13 = (int)pbVar3 - (int)local_a0; if ((uint)((int)puVar6 - (int)puVar22) <= (uint)((int)pbVar3 - (int)local_a0)) { uVar13 = (int)puVar6 - (int)puVar22; } uVar7 = local_90; if (uVar13 < local_90) { uVar7 = uVar13; } memcpy(local_a0,puVar22,uVar7); puVar22 = (ushort *)((int)puVar22 + uVar7); local_90 = local_90 - uVar7; local_a0 = local_a0 + uVar7; uVar13 = local_a8; if (local_90 == 0) break; switchD_00a8580e_caseD_9: if (pbVar3 <= local_a0) { iVar12 = 2; local_98 = 2; *in_ECX = 9; local_a8 = uVar13; local_94 = puVar22; goto LAB_00a86fbb; } LAB_00a86430: if (puVar6 <= puVar22) { if ((param_5 & 2) == 0) goto switchD_00a8580e_caseD_28; iVar12 = 1; *in_ECX = 0x26; local_98 = 1; local_a8 = uVar13; local_94 = puVar22; goto LAB_00a86fbb; } } local_94 = puVar22; goto LAB_00a861c9; LAB_00a86dad: if ((param_5 & 1) != 0) { for (; pbVar23 < ((uint)pbVar23 & 7); pbVar23 = (byte *)((int)pbVar23 + 8)) { local_a8 = uVar13; if (puVar22 < puVar6) { uVar10 = (uint)(byte)*puVar22; puVar22 = (ushort *)((int)puVar22 + 1); } else { LAB_00a86e87: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x20; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar10 = 0; } LAB_00a86e92: uVar13 = local_a8 | uVar10 << ((byte)pbVar23 & 0x1f); } uVar13 = uVar13 >> (sbyte)((uint)pbVar23 & 7); pbVar23 = (byte *)((int)pbVar23 - ((uint)pbVar23 & 7)); for (local_90 = 0; local_90 < 4; local_90 = local_90 + 1) { if (pbVar23 == (byte *)0x0) { local_a8 = uVar13; if (puVar22 < puVar6) { local_b4 = (byte *)(uint)(byte)*puVar22; puVar22 = (ushort *)((int)puVar22 + 1); } else { LAB_00a86efd: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x2a; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } local_b4 = (byte *)0x0; uVar13 = local_a8; } } else { if (pbVar23 < 8) { do { local_a8 = uVar13; if (puVar22 < puVar6) { uVar13 = (uint)(byte)*puVar22; puVar22 = (ushort *)((int)puVar22 + 1); uVar10 = (uint)pbVar23; } else { LAB_00a86f44: if ((param_5 & 2) != 0) { iVar12 = 1; *in_ECX = 0x29; local_98 = 1; local_94 = puVar22; goto LAB_00a86fbb; } uVar13 = 0; uVar10 = (uint)pbVar23; } LAB_00a86f55: pbVar23 = (byte *)(uVar10 + 8); uVar13 = local_a8 | uVar13 << ((byte)uVar10 & 0x1f); } while (pbVar23 < 8); } local_b4 = (byte *)(uVar13 & 0xff); pbVar23 = (byte *)((int)pbVar23 - 8); uVar13 = uVar13 >> 8; } LAB_00a86f14: in_ECX[4] = in_ECX[4] << 8 | (uint)local_b4; } } switchD_00a8580e_caseD_22: iVar12 = 0; *in_ECX = 0x22; local_98 = 0; local_a8 = uVar13; local_94 = puVar22; goto LAB_00a86fbb; } //@@ 00a87300 tdefl_optimize_huffman_table /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: miniz: num_codes[33] memset 0x84, counts m_huff_code_sizes[table][i] when static_table, this=tdefl_compressor, EDX=table_num */ void tdefl_optimize_huffman_table(int param_1,int param_2,int param_3) { ushort *puVar1; byte bVar2; ushort uVar3; uint *puVar4; byte bVar5; int in_ECX; byte *pbVar6; int iVar7; int iVar8; int iVar9; uint uVar10; int in_EDX; int iVar11; int iVar12; ushort *puVar13; uint uVar14; undefined2 *puVar15; uint uVar16; int *piVar17; uint uVar18; uint local_15b0; byte *local_15a8; ushort *local_15a4; int local_159c; int local_1598; uint local_1594; ushort *local_1590; ushort local_158c [576]; int local_110c [256]; uint local_d0c [256]; ushort local_90c [576]; int local_48c [223]; uint auStack_110 [33]; int local_8c [33]; uint local_8; local_8 = __security_cookie ^ (uint)(local_8c + 0x22); memset(local_8c,0,0x84); if (param_3 != 0) { if (0 < param_1) { pbVar6 = (byte *)(in_ECX + 0x8f12 + in_EDX * 0x120); iVar11 = param_1; do { bVar2 = *pbVar6; pbVar6 = pbVar6 + 1; local_8c[bVar2] = local_8c[bVar2] + 1; iVar11 = iVar11 + -1; } while (iVar11 != 0); } goto LAB_00a878a7; } uVar14 = 0; iVar7 = in_EDX * 0x240 + in_ECX; local_1594 = 0; iVar11 = 0; if (0 < param_1) { do { uVar3 = *(ushort *)(iVar7 + 0x8192 + iVar11 * 2); if (uVar3 != 0) { local_90c[uVar14 * 2] = uVar3; local_90c[uVar14 * 2 + 1] = (ushort)iVar11; uVar14 = uVar14 + 1; } iVar11 = iVar11 + 1; } while (iVar11 < param_1); local_1594 = uVar14; } local_15b0 = 2; local_15a4 = local_90c; memset(local_110c,0,0x800); uVar14 = 0; if (local_1594 != 0) { do { uVar3 = local_90c[uVar14 * 2]; uVar14 = uVar14 + 1; local_110c[uVar3 & 0xff] = local_110c[uVar3 & 0xff] + 1; local_d0c[uVar3 >> 8] = local_d0c[uVar3 >> 8] + 1; } while (uVar14 < local_1594); } puVar4 = local_d0c; do { if (local_1594 != *puVar4) break; local_15b0 = local_15b0 - 1; puVar4 = puVar4 + -0x100; } while (1 < local_15b0); bVar2 = 0; if (local_15b0 != 0) { piVar17 = local_110c; local_159c = (int)local_48c - (int)piVar17; puVar13 = local_158c; do { local_1590 = puVar13; puVar13 = local_15a4; iVar11 = 0; iVar8 = 0x100; do { *(int *)((int)piVar17 + local_159c) = iVar11; iVar11 = iVar11 + *piVar17; piVar17 = piVar17 + 1; iVar8 = iVar8 + -1; } while (iVar8 != 0); if (local_1594 != 0) { uVar14 = 0; do { *(uint *)(local_1590 + local_48c[(*(uint *)(puVar13 + uVar14 * 2) & 0xffff) >> (bVar2 & 0x1f) & 0xff] * 2) = *(uint *)(puVar13 + uVar14 * 2); iVar11 = uVar14 * 2; uVar14 = uVar14 + 1; local_48c[puVar13[iVar11] >> (bVar2 & 0x1f) & 0xff] = local_48c[puVar13[iVar11] >> (bVar2 & 0x1f) & 0xff] + 1; } while (uVar14 < local_1594); } bVar2 = bVar2 + 8; local_159c = local_159c + -0x400; local_15b0 = local_15b0 - 1; local_15a4 = local_1590; } while (local_15b0 != 0); } if (local_1594 != 0) { if (local_1594 == 1) { *local_15a4 = 1; } else { iVar11 = local_1594 - 1; *local_15a4 = *local_15a4 + local_15a4[2]; iVar12 = 0; local_1598 = 1; iVar8 = 2; if (1 < iVar11) { do { if ((iVar8 < (int)local_1594) && (iVar9 = iVar8 * 2, local_15a4[iVar9] <= local_15a4[iVar12 * 2])) { local_1590 = local_15a4 + local_1598 * 2; iVar8 = iVar8 + 1; local_15a4[local_1598 * 2] = local_15a4[iVar9]; } else { local_1590 = local_15a4 + local_1598 * 2; *local_1590 = local_15a4[iVar12 * 2]; local_15a4[iVar12 * 2] = (ushort)local_1598; iVar12 = iVar12 + 1; } if ((iVar8 < (int)local_1594) && ((local_1598 <= iVar12 || (local_15a4[iVar8 * 2] <= local_15a4[iVar12 * 2])))) { iVar9 = iVar8 * 2; iVar8 = iVar8 + 1; *local_1590 = local_15a4[iVar9] + *local_1590; } else { *local_1590 = *local_1590 + local_15a4[iVar12 * 2]; local_15a4[iVar12 * 2] = (ushort)local_1598; iVar12 = iVar12 + 1; } local_1598 = local_1598 + 1; } while (local_1598 < iVar11); } iVar8 = local_1594 - 2; iVar12 = local_1594 - 3; local_15a4[iVar8 * 2] = 0; for (; -1 < iVar12; iVar12 = iVar12 + -1) { local_15a4[iVar12 * 2] = local_15a4[(uint)local_15a4[iVar12 * 2] * 2] + 1; } iVar12 = 1; local_1590 = (ushort *)0x0; do { iVar9 = 0; if (iVar8 < 0) { LAB_00a876ac: iVar12 = iVar12 - iVar9; do { local_15a4[iVar11 * 2] = (ushort)local_1590; iVar11 = iVar11 + -1; iVar12 = iVar12 + -1; } while (iVar12 != 0); } else { do { if ((ushort *)(uint)local_15a4[iVar8 * 2] != local_1590) break; iVar9 = iVar9 + 1; iVar8 = iVar8 + -1; } while (-1 < iVar8); if (iVar9 < iVar12) goto LAB_00a876ac; } iVar12 = iVar9 * 2; local_1590 = (ushort *)((int)local_1590 + 1); } while (0 < iVar12); if ((int)local_1594 < 1) goto LAB_00a876e4; } iVar11 = 0; do { iVar8 = iVar11 * 2; iVar11 = iVar11 + 1; local_8c[local_15a4[iVar8]] = local_8c[local_15a4[iVar8]] + 1; } while (iVar11 < (int)local_1594); } LAB_00a876e4: iVar11 = 0; if (1 < (int)local_1594) { iVar8 = param_2 + 1; bVar2 = (byte)param_2; iVar12 = param_2; if (iVar8 < 0x21) { iVar9 = local_8c[param_2]; do { iVar9 = iVar9 + local_8c[iVar8]; iVar8 = iVar8 + 1; local_8c[param_2] = iVar9; } while (iVar8 < 0x21); local_1590 = (ushort *)0x0; local_159c = 0; if (1 < param_2) goto LAB_00a87732; } else { LAB_00a87732: local_1590 = (ushort *)0x0; local_159c = 0; do { bVar5 = bVar2 - (char)iVar12; local_1590 = (ushort *)((int)local_1590 + (local_8c[iVar12] << (bVar5 & 0x1f))); iVar8 = iVar12 + 0x20; iVar12 = iVar12 + -2; local_159c = local_159c + (auStack_110[iVar8] << (bVar5 + 1 & 0x1f)); } while (1 < iVar12); } if (0 < iVar12) { iVar11 = local_8c[iVar12] << (bVar2 - (char)iVar12 & 0x1f); } iVar11 = iVar11 + (int)local_1590 + local_159c; iVar8 = 1 << (bVar2 & 0x1f); if (iVar11 != iVar8) { iVar11 = iVar11 - iVar8; do { local_8c[param_2] = local_8c[param_2] + -1; iVar8 = param_2; do { iVar12 = iVar8; iVar8 = iVar12 + -1; if (iVar8 < 1) goto LAB_00a877f5; } while (local_8c[iVar8] == 0); local_8c[iVar12] = local_8c[iVar12] + 2; local_8c[iVar8] = local_8c[iVar8] + -1; LAB_00a877f5: iVar11 = iVar11 + -1; } while (iVar11 != 0); } } memset((void *)(in_EDX * 0x120 + in_ECX + 0x8f12),0,0x120); memset((void *)(iVar7 + 0x8852),0,0x240); iVar11 = 1; if (0 < param_2) { do { iVar7 = local_8c[iVar11]; if (0 < iVar7) { puVar13 = local_15a4 + local_1594 * 2 + 1; local_1594 = local_1594 - iVar7; do { puVar1 = puVar13 + -2; puVar13 = puVar13 + -2; iVar7 = iVar7 + -1; *(char *)((uint)*puVar1 + in_ECX + 0x8f12 + in_EDX * 0x120) = (char)iVar11; } while (0 < iVar7); } iVar11 = iVar11 + 1; } while (iVar11 <= param_2); } LAB_00a878a7: iVar11 = 0; auStack_110[1] = 0; if (1 < param_2) { param_2 = param_2 + -1; iVar7 = 0; do { iVar11 = (iVar11 + *(int *)((int)local_8c + iVar7 + 4)) * 2; *(int *)((int)auStack_110 + iVar7 + 8) = iVar11; param_2 = param_2 + -1; iVar7 = iVar7 + 4; } while (param_2 != 0); } if (0 < param_1) { local_15a8 = (byte *)(in_EDX * 0x120 + 0x8f12 + in_ECX); puVar15 = (undefined2 *)(in_ECX + in_EDX * 0x240 + 0x8852); do { uVar14 = (uint)*local_15a8; uVar18 = 0; if (uVar14 != 0) { uVar16 = auStack_110[uVar14]; auStack_110[uVar14] = uVar16 + 1; do { uVar10 = uVar16 & 1; uVar16 = uVar16 >> 1; uVar14 = uVar14 - 1; uVar18 = uVar18 * 2 | uVar10; } while (0 < (int)uVar14); *puVar15 = (short)uVar18; } local_15a8 = local_15a8 + 1; puVar15 = puVar15 + 1; param_1 = param_1 + -1; } while (param_1 != 0); } return; } //@@ 00a87970 miniz::tdefl_start_dynamic_block /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: miniz.cpp asserts "code < TDEFL_MAX_HUFF_SYMBOLS_2" and "bits <= ((1U << len) - 1U)" (tdefl_start_dynamic_block/tdefl_optimize_huffman_table inlined) */ void miniz::tdefl_start_dynamic_block(void) { short *psVar1; byte bVar2; code *pcVar3; undefined1 uVar4; uint3 uVar7; uint uVar5; byte *pbVar6; int in_ECX; uint uVar8; int iVar9; byte bVar10; size_t _Size; uint uVar11; size_t _Size_00; uint uVar12; uint local_2ac; uint local_2a8; uint local_2a4; int local_2a0; uint local_298; int local_294; uint local_290; uint local_28c; byte local_288 [320]; byte local_148 [320]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_148 + 0x144); local_2a0 = CONCAT31(local_2a0._1_3_,0xff); *(undefined2 *)(in_ECX + 0x8392) = 1; tdefl_optimize_huffman_table(0x120,0xf,0); tdefl_optimize_huffman_table(0x20,0xf,0); _Size = 0x11e; do { if (*(char *)(in_ECX + 0x8f11 + _Size) != '\0') break; _Size = _Size - 1; } while (0x101 < (int)_Size); _Size_00 = 0x1e; do { if (*(char *)(in_ECX + 0x9031 + _Size_00) != '\0') break; _Size_00 = _Size_00 - 1; } while (1 < (int)_Size_00); memcpy(local_288,(void *)(in_ECX + 0x8f12),_Size); memcpy(local_288 + _Size,(void *)(in_ECX + 0x9032),_Size_00); uVar8 = 0; *(undefined4 *)(in_ECX + 0x8612) = 0; *(undefined4 *)(in_ECX + 0x8616) = 0; *(undefined4 *)(in_ECX + 0x861a) = 0; *(undefined4 *)(in_ECX + 0x861e) = 0; uVar12 = 0; local_298 = 0; *(undefined4 *)(in_ECX + 0x8622) = 0; *(undefined4 *)(in_ECX + 0x8626) = 0; *(undefined4 *)(in_ECX + 0x862a) = 0; *(undefined4 *)(in_ECX + 0x862e) = 0; *(undefined4 *)(in_ECX + 0x8632) = 0; local_28c = 0; uVar11 = 0; *(undefined2 *)(in_ECX + 0x8636) = 0; local_2a4 = 0; if (_Size_00 + _Size == 0) goto LAB_00a87d5f; uVar5 = 0xff00; do { bVar2 = local_288[local_2a4]; uVar7 = (uint3)(uVar5 >> 8); uVar5 = CONCAT31(uVar7,bVar2); local_290 = CONCAT31(local_290._1_3_,bVar2); if (bVar2 == 0) { if (uVar8 != 0) { if (uVar8 < 3) { psVar1 = (short *)(in_ECX + 0x8612 + (uint)uVar7 * 2); *psVar1 = *psVar1 + (short)uVar8; memset(local_148 + uVar12,local_2a0,uVar8); uVar5 = 0; uVar12 = uVar12 + local_298; } else { *(short *)(in_ECX + 0x8632) = *(short *)(in_ECX + 0x8632) + 1; local_148[uVar12] = 0x10; local_148[uVar12 + 1] = (char)uVar8 - 3; uVar12 = uVar12 + 2; } uVar8 = 0; local_298 = 0; local_28c = uVar12; } uVar11 = uVar11 + 1; if (uVar11 == 0x8a) { *(short *)(in_ECX + 0x8636) = *(short *)(in_ECX + 0x8636) + 1; (local_148 + uVar12)[0] = 0x12; (local_148 + uVar12)[1] = 0x7f; uVar12 = uVar12 + 2; uVar11 = 0; goto LAB_00a87c77; } } else { if (uVar11 != 0) { if (uVar11 < 3) { *(short *)(in_ECX + 0x8612) = *(short *)(in_ECX + 0x8612) + (short)uVar11; do { uVar11 = uVar11 - 1; local_28c = uVar12 + 1; if (0x13f < uVar12) goto LAB_00a88164; local_148[uVar12] = 0; uVar12 = local_28c; } while (uVar11 != 0); uVar5 = (uint)bVar2; } else { local_28c = uVar12 + 2; if (uVar11 < 0xb) { *(short *)(in_ECX + 0x8634) = *(short *)(in_ECX + 0x8634) + 1; bVar10 = (char)uVar11 - 3; local_148[uVar12] = 0x11; } else { *(short *)(in_ECX + 0x8636) = *(short *)(in_ECX + 0x8636) + 1; bVar10 = (char)uVar11 - 0xb; local_148[uVar12] = 0x12; } local_148[uVar12 + 1] = bVar10; } uVar5 = (uint)CONCAT11((undefined1)local_2a0,(char)uVar5); uVar11 = 0; uVar12 = local_28c; } bVar10 = (byte)(uVar5 >> 8); if ((byte)uVar5 == bVar10) { uVar8 = uVar8 + 1; local_298 = uVar8; if (uVar8 != 6) goto LAB_00a87c7d; *(short *)(in_ECX + 0x8632) = *(short *)(in_ECX + 0x8632) + 1; (local_148 + uVar12)[0] = 0x10; (local_148 + uVar12)[1] = 3; uVar12 = uVar12 + 2; uVar8 = 0; local_298 = 0; } else { if (uVar8 != 0) { if (uVar8 < 3) { psVar1 = (short *)(in_ECX + 0x8612 + (uint)bVar10 * 2); *psVar1 = *psVar1 + (short)uVar8; memset(local_148 + uVar12,local_2a0,uVar8); uVar5 = (uint)bVar2; uVar12 = uVar12 + local_298; } else { *(short *)(in_ECX + 0x8632) = *(short *)(in_ECX + 0x8632) + 1; local_148[uVar12] = 0x10; local_148[uVar12 + 1] = (char)uVar8 - 3; uVar12 = uVar12 + 2; } uVar8 = 0; local_298 = 0; } psVar1 = (short *)(in_ECX + 0x8612 + (uVar5 & 0xff) * 2); *psVar1 = *psVar1 + 1; uVar5 = (uint)bVar2; local_148[uVar12] = bVar2; uVar12 = uVar12 + 1; } LAB_00a87c77: local_28c = uVar12; } LAB_00a87c7d: local_2a4 = local_2a4 + 1; uVar4 = (undefined1)uVar5; uVar5 = (uint)CONCAT11(uVar4,uVar4); local_2a0 = CONCAT31(local_2a0._1_3_,uVar4); } while (local_2a4 < _Size_00 + _Size); if (uVar8 == 0) { if (uVar11 == 0) goto LAB_00a87d5f; if (uVar11 < 3) { *(short *)(in_ECX + 0x8612) = *(short *)(in_ECX + 0x8612) + (short)uVar11; uVar8 = uVar12; do { uVar11 = uVar11 - 1; uVar12 = uVar8 + 1; if (0x13f < uVar8) { LAB_00a88164: FUN_00aef86f(); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } local_148[uVar8] = 0; uVar8 = uVar12; local_28c = uVar12; } while (uVar11 != 0); goto LAB_00a87d5f; } pbVar6 = local_148 + uVar12; iVar9 = uVar12 + 1; uVar12 = uVar12 + 2; if (uVar11 < 0xb) { *(short *)(in_ECX + 0x8634) = *(short *)(in_ECX + 0x8634) + 1; *pbVar6 = 0x11; local_148[iVar9] = (char)uVar11 - 3; local_28c = uVar12; goto LAB_00a87d5f; } *(short *)(in_ECX + 0x8636) = *(short *)(in_ECX + 0x8636) + 1; *pbVar6 = 0x12; local_148[iVar9] = (char)uVar11 - 0xb; } else if (uVar8 < 3) { psVar1 = (short *)(in_ECX + 0x8612 + (uVar5 & 0xff) * 2); *psVar1 = *psVar1 + (short)uVar8; memset(local_148 + uVar12,local_290,uVar8); uVar12 = uVar12 + local_298; } else { *(short *)(in_ECX + 0x8632) = *(short *)(in_ECX + 0x8632) + 1; local_148[uVar12] = 0x10; local_148[uVar12 + 1] = (char)uVar8 - 3; uVar12 = uVar12 + 2; } local_28c = uVar12; LAB_00a87d5f: tdefl_optimize_huffman_table(0x13,7,0); uVar8 = *(int *)(in_ECX + 0x44) + 2; local_2a8 = 2 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = local_2a8; *(uint *)(in_ECX + 0x44) = uVar8; if (7 < uVar8) { do { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)local_2a8; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } uVar8 = *(int *)(in_ECX + 0x44) - 8; local_2a8 = *(uint *)(in_ECX + 0x48) >> 8; *(uint *)(in_ECX + 0x48) = local_2a8; *(uint *)(in_ECX + 0x44) = uVar8; } while (7 < uVar8); } if (0x1f < _Size - 0x101) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x2c0); local_2a8 = *(uint *)(in_ECX + 0x48); uVar8 = *(uint *)(in_ECX + 0x44); } uVar11 = uVar8 + 5; local_2a8 = _Size - 0x101 << ((byte)uVar8 & 0x1f) | local_2a8; *(uint *)(in_ECX + 0x44) = uVar11; *(uint *)(in_ECX + 0x48) = local_2a8; while (7 < uVar11) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)local_2a8; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } uVar11 = *(int *)(in_ECX + 0x44) - 8; local_2a8 = *(uint *)(in_ECX + 0x48) >> 8; *(uint *)(in_ECX + 0x48) = local_2a8; *(uint *)(in_ECX + 0x44) = uVar11; } if (0x1f < _Size_00 - 1) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x2c1); local_2a8 = *(uint *)(in_ECX + 0x48); uVar11 = *(uint *)(in_ECX + 0x44); } uVar8 = uVar11 + 5; local_2a8 = _Size_00 - 1 << ((byte)uVar11 & 0x1f) | local_2a8; *(uint *)(in_ECX + 0x44) = uVar8; *(uint *)(in_ECX + 0x48) = local_2a8; while (7 < uVar8) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)local_2a8; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; local_2a8 = (uint)*(byte *)(in_ECX + 0x48); uVar8 = *(uint *)(in_ECX + 0x44); } iVar9 = 0x12; do { if (*(char *)((byte)(&DAT_00b4d290)[iVar9] + 0x9152 + in_ECX) != '\0') break; iVar9 = iVar9 + -1; } while (-1 < iVar9); local_290 = iVar9 + 1; if ((int)local_290 < 4) { local_290 = 4; uVar8 = 0; } else { uVar8 = iVar9 - 3; if (0xf < uVar8) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x2c4); } } uVar11 = uVar8 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar11; uVar8 = *(int *)(in_ECX + 0x44) + 4; *(uint *)(in_ECX + 0x44) = uVar8; while (7 < uVar8) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar11; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar11 = (uint)*(byte *)(in_ECX + 0x48); uVar8 = *(uint *)(in_ECX + 0x44); } local_294 = 0; if (0 < (int)local_290) { do { uVar12 = (uint)*(byte *)((byte)(&DAT_00b4d290)[local_294] + 0x9152 + in_ECX); if (7 < uVar12) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x2c5 ); } uVar8 = uVar12 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar8; uVar12 = *(int *)(in_ECX + 0x44) + 3; *(uint *)(in_ECX + 0x44) = uVar12; while (7 < uVar12) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar8; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar8 = (uint)*(byte *)(in_ECX + 0x48); uVar12 = *(uint *)(in_ECX + 0x44); } local_294 = local_294 + 1; } while (local_294 < (int)local_290); uVar12 = local_28c; } local_290 = 0; if (uVar12 != 0) { do { uVar8 = (uint)local_148[local_290]; if (0x12 < uVar8) { _wassert(L"code < TDEFL_MAX_HUFF_SYMBOLS_2", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x2c9 ); } uVar11 = (uint)*(ushort *)(in_ECX + 0x8cd2 + uVar8 * 2); bVar2 = *(byte *)(in_ECX + 0x9152 + uVar8); if ((1 << (bVar2 & 0x1f)) - 1U < uVar11) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x2ca ); } local_2ac = (uint)bVar2 + *(int *)(in_ECX + 0x44); uVar11 = uVar11 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar11; *(uint *)(in_ECX + 0x44) = local_2ac; uVar5 = uVar11; if (7 < local_2ac) { do { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar5; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } uVar12 = *(uint *)(in_ECX + 0x48); local_2ac = *(int *)(in_ECX + 0x44) - 8; uVar11 = uVar12 >> 8; *(uint *)(in_ECX + 0x48) = uVar11; uVar5 = uVar12 >> 8 & 0xff; *(uint *)(in_ECX + 0x44) = local_2ac; } while (7 < local_2ac); uVar12 = local_28c; } if (0xf < uVar8) { bVar2 = local_148[local_290 + 1]; bVar10 = *(byte *)((int)L"bits <= ((1U << len) - 1U)" + uVar8 + 0x28); if ((1 << (bVar10 & 0x1f)) - 1U < (uint)bVar2) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x2cb); uVar11 = *(uint *)(in_ECX + 0x48); local_2ac = *(uint *)(in_ECX + 0x44); } uVar8 = local_2ac + (int)(char)bVar10; uVar11 = (uint)bVar2 << ((byte)local_2ac & 0x1f) | uVar11; *(uint *)(in_ECX + 0x44) = uVar8; *(uint *)(in_ECX + 0x48) = uVar11; while (7 < uVar8) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar11; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar11 = (uint)*(byte *)(in_ECX + 0x48); uVar8 = *(uint *)(in_ECX + 0x44); } local_290 = local_290 + 1; } local_290 = local_290 + 1; } while (local_290 < uVar12); } return; } //@@ 00a88170 tdefl_compress_lz_codes /* DB: miniz (KAGE\Source\Core\External\miniz.cpp) asserts "d->m_huff_code_sizes[0][lit]", "bits <= ((1U << len) - 1U)", "d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]"; tail-jumped from tdefl_compress_block 00a88560 */ bool tdefl_compress_lz_codes(void) { ushort *puVar1; ushort uVar2; byte bVar3; uint uVar4; uint uVar5; uint uVar6; byte bVar7; int in_ECX; uint uVar8; uint uVar9; uint uVar10; ushort *local_14; uint local_8; local_8 = 1; local_14 = (ushort *)(in_ECX + 0x9272); if (local_14 < *(ushort **)(in_ECX + 0x28)) { do { if (local_8 == 1) { local_8 = (byte)*local_14 | 0x100; local_14 = (ushort *)((int)local_14 + 1); } uVar9 = (uint)(byte)*local_14; puVar1 = (ushort *)((int)local_14 + 1); if ((local_8 & 1) == 0) { bVar7 = *(byte *)(uVar9 + 0x8f12 + in_ECX); if (bVar7 == 0) { _wassert(L"d->m_huff_code_sizes[0][lit]", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x35f); bVar7 = *(byte *)(uVar9 + 0x8f12 + in_ECX); } uVar9 = (uint)*(ushort *)(in_ECX + 0x8852 + uVar9 * 2); if ((1 << (bVar7 & 0x1f)) - 1U < uVar9) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x360); } uVar4 = uVar9 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar4; uVar9 = *(int *)(in_ECX + 0x44) + (uint)bVar7; *(uint *)(in_ECX + 0x44) = uVar9; while (local_14 = puVar1, 7 < uVar9) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar4; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar4 = (uint)*(byte *)(in_ECX + 0x48); uVar9 = *(uint *)(in_ECX + 0x44); } } else { local_14 = (ushort *)((int)local_14 + 3); uVar2 = *puVar1; uVar8 = (uint)uVar2; uVar4 = (uint)*(ushort *)(&DAT_00b4e260 + uVar9 * 2); if (*(char *)(uVar4 + 0x8f12 + in_ECX) == '\0') { _wassert(L"d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x34c); uVar4 = (uint)*(ushort *)(&DAT_00b4e260 + uVar9 * 2); } bVar7 = *(byte *)(uVar4 + 0x8f12 + in_ECX); uVar4 = (uint)*(ushort *)(in_ECX + 0x8852 + uVar4 * 2); if ((1 << (bVar7 & 0x1f)) - 1U < uVar4) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x34d); } uVar10 = (uint)bVar7 + *(int *)(in_ECX + 0x44); uVar4 = uVar4 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar4; *(uint *)(in_ECX + 0x44) = uVar10; while (7 < uVar10) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar4; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } uVar10 = *(int *)(in_ECX + 0x44) - 8; uVar4 = *(uint *)(in_ECX + 0x48) >> 8; *(uint *)(in_ECX + 0x48) = uVar4; *(uint *)(in_ECX + 0x44) = uVar10; } bVar7 = (&DAT_00b4e160)[uVar9]; uVar6 = *(uint *)(&DAT_00b4ccd0 + (uint)bVar7 * 4); if ((1 << (bVar7 & 0x1f)) - 1U < (uVar6 & uVar9)) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x34e); uVar4 = *(uint *)(in_ECX + 0x48); uVar10 = *(uint *)(in_ECX + 0x44); } uVar5 = bVar7 + uVar10; uVar4 = (uVar6 & uVar9) << ((byte)uVar10 & 0x1f) | uVar4; *(uint *)(in_ECX + 0x44) = uVar5; *(uint *)(in_ECX + 0x48) = uVar4; while (7 < uVar5) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar4; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar4 = (uint)*(byte *)(in_ECX + 0x48); uVar5 = *(uint *)(in_ECX + 0x44); } if (uVar8 < 0x200) { bVar7 = (&DAT_00b4d090)[uVar8]; bVar3 = (&DAT_00b4ce90)[uVar8]; } else { uVar2 = uVar2 >> 8; bVar7 = (&DAT_00b4ce10)[uVar2]; bVar3 = (&DAT_00b4cd90)[uVar2]; } uVar9 = (uint)bVar7; bVar7 = *(byte *)(uVar9 + 0x9032 + in_ECX); if (bVar7 == 0) { _wassert(L"d->m_huff_code_sizes[1][sym]", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x358); bVar7 = *(byte *)(uVar9 + 0x9032 + in_ECX); } uVar9 = (uint)*(ushort *)(in_ECX + 0x8a92 + uVar9 * 2); if ((1 << (bVar7 & 0x1f)) - 1U < uVar9) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x359); } uVar4 = (uint)bVar7 + *(int *)(in_ECX + 0x44); uVar9 = uVar9 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar9; *(uint *)(in_ECX + 0x44) = uVar4; while (7 < uVar4) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar9; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } uVar4 = *(int *)(in_ECX + 0x44) - 8; uVar9 = *(uint *)(in_ECX + 0x48) >> 8; *(uint *)(in_ECX + 0x48) = uVar9; *(uint *)(in_ECX + 0x44) = uVar4; } uVar10 = *(uint *)(&DAT_00b4ccd0 + (uint)bVar3 * 4); if ((1 << (bVar3 & 0x1f)) - 1U < (uVar10 & uVar8)) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x35a); uVar9 = *(uint *)(in_ECX + 0x48); uVar4 = *(uint *)(in_ECX + 0x44); } uVar6 = bVar3 + uVar4; uVar9 = (uVar10 & uVar8) << ((byte)uVar4 & 0x1f) | uVar9; *(uint *)(in_ECX + 0x44) = uVar6; *(uint *)(in_ECX + 0x48) = uVar9; while (7 < uVar6) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar9; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar9 = (uint)*(byte *)(in_ECX + 0x48); uVar6 = *(uint *)(in_ECX + 0x44); } } local_8 = local_8 >> 1; } while (local_14 < *(ushort **)(in_ECX + 0x28)); } bVar7 = *(byte *)(in_ECX + 0x9012); uVar2 = *(ushort *)(in_ECX + 0x8a52); if ((1 << (bVar7 & 0x1f)) - 1U < (uint)uVar2) { _wassert(L"bits <= ((1U << len) - 1U)", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x364); } uVar4 = (uint)uVar2 << ((byte)*(int *)(in_ECX + 0x44) & 0x1f) | *(uint *)(in_ECX + 0x48); *(uint *)(in_ECX + 0x48) = uVar4; uVar9 = *(int *)(in_ECX + 0x44) + (uint)bVar7; *(uint *)(in_ECX + 0x44) = uVar9; while (7 < uVar9) { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar4; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar4 = (uint)*(byte *)(in_ECX + 0x48); uVar9 = *(uint *)(in_ECX + 0x44); } return *(uint *)(in_ECX + 0x30) < *(uint *)(in_ECX + 0x34); } //@@ 00a88560 FUN_00a88560 void FUN_00a88560(void) { uint uVar1; int in_ECX; uint uVar2; int in_EDX; if (in_EDX == 0) { miniz::tdefl_start_dynamic_block(); } else { memset((void *)(in_ECX + 0x8f12),8,0x90); memset((void *)(in_ECX + 0x8fa2),9,0x70); *(undefined8 *)(in_ECX + 0x9012) = 0x707070707070707; *(undefined8 *)(in_ECX + 0x901a) = 0x707070707070707; *(undefined8 *)(in_ECX + 0x9022) = 0x707070707070707; *(undefined4 *)(in_ECX + 0x902a) = 0x8080808; *(undefined4 *)(in_ECX + 0x902e) = 0x8080808; *(undefined1 **)(in_ECX + 0x9032) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x9036) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x903a) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x903e) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x9042) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x9046) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x904a) = &DAT_05050505; *(undefined1 **)(in_ECX + 0x904e) = &DAT_05050505; tdefl_optimize_huffman_table(0x120,0xf,1); tdefl_optimize_huffman_table(0x20,0xf,1); uVar2 = *(uint *)(in_ECX + 0x48) | 1 << (*(uint *)(in_ECX + 0x44) & 0x1f); uVar1 = *(uint *)(in_ECX + 0x44) + 2; *(uint *)(in_ECX + 0x48) = uVar2; *(uint *)(in_ECX + 0x44) = uVar1; if (7 < uVar1) { do { if (*(undefined1 **)(in_ECX + 0x30) < *(undefined1 **)(in_ECX + 0x34)) { **(undefined1 **)(in_ECX + 0x30) = (char)uVar2; *(int *)(in_ECX + 0x30) = *(int *)(in_ECX + 0x30) + 1; } *(uint *)(in_ECX + 0x48) = *(uint *)(in_ECX + 0x48) >> 8; *(int *)(in_ECX + 0x44) = *(int *)(in_ECX + 0x44) + -8; uVar2 = (uint)*(byte *)(in_ECX + 0x48); } while (7 < *(uint *)(in_ECX + 0x44)); tdefl_compress_lz_codes(); return; } } tdefl_compress_lz_codes(); return; } //@@ 00a88650 tdefl_flush_block /* DB: miniz.cpp asserts "!d->m_output_flush_remaining" (0x37e) and "d->m_pOutput_buf < d->m_pOutput_buf_end" (0x3b5); writes zlib header 0x78 when TDEFL_WRITE_ZLIB_HEADER (0x1000), static/dynamic block selection via FUN_00a88560; callers tdefl_compress_normal, tdefl_compress prototype: db/protos.zhl */ int __fastcall tdefl_flush_block(void *compressor,int flush) { bool bVar1; void *pvVar2; uint uVar3; uint uVar4; uint uVar5; undefined1 *puVar6; int iVar7; int local_10; uint local_8; local_10 = 0; if (((*(uint *)((int)compressor + 8) & 0x80000) == 0) || (bVar1 = true, *(uint *)((int)compressor + 0x24) < (uint)(*(int *)((int)compressor + 0x1c) - *(int *)((int)compressor + 0x40)))) { bVar1 = false; } if ((*(int *)compressor == 0) && (0x14ccb < (uint)(**(int **)((int)compressor + 0x7c) - *(int *)((int)compressor + 0x8c)))) { pvVar2 = (void *)(*(int *)((int)compressor + 0x74) + *(int *)((int)compressor + 0x8c)); } else { pvVar2 = (void *)((int)compressor + 0x39272); } *(void **)((int)compressor + 0x30) = pvVar2; *(int *)((int)compressor + 0x34) = (int)pvVar2 + 0x14cbc; if (*(int *)((int)compressor + 0x5c) != 0) { _wassert(L"!d->m_output_flush_remaining", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x37e); } *(undefined4 *)((int)compressor + 0x58) = 0; *(undefined4 *)((int)compressor + 0x5c) = 0; **(byte **)((int)compressor + 0x2c) = **(byte **)((int)compressor + 0x2c) >> (*(byte *)((int)compressor + 0x38) & 0x1f); *(int *)((int)compressor + 0x28) = *(int *)((int)compressor + 0x28) - (uint)(*(int *)((int)compressor + 0x38) == 8); if (((*(uint *)((int)compressor + 8) & 0x1000) != 0) && (*(int *)((int)compressor + 100) == 0)) { uVar4 = 0x78 << ((byte)*(int *)((int)compressor + 0x44) & 0x1f) | *(uint *)((int)compressor + 0x48); *(uint *)((int)compressor + 0x48) = uVar4; uVar3 = *(int *)((int)compressor + 0x44) + 8; *(uint *)((int)compressor + 0x44) = uVar3; while (7 < uVar3) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar4; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } uVar3 = *(int *)((int)compressor + 0x44) - 8; uVar4 = *(uint *)((int)compressor + 0x48) >> 8; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = uVar3; } uVar4 = uVar4 | 1 << (uVar3 & 0x1f); uVar3 = uVar3 + 8; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = uVar3; while (7 < uVar3) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar4; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar4 = (uint)*(byte *)((int)compressor + 0x48); uVar3 = *(uint *)((int)compressor + 0x44); } } local_8 = *(int *)((int)compressor + 0x44) + 1; uVar3 = (uint)(flush == 4) << ((byte)*(int *)((int)compressor + 0x44) & 0x1f) | *(uint *)((int)compressor + 0x48); *(uint *)((int)compressor + 0x48) = uVar3; *(uint *)((int)compressor + 0x44) = local_8; if (local_8 < 8) { puVar6 = *(undefined1 **)((int)compressor + 0x30); uVar4 = uVar3; } else { do { puVar6 = *(undefined1 **)((int)compressor + 0x30); if (puVar6 < *(undefined1 **)((int)compressor + 0x34)) { *puVar6 = (char)uVar3; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; puVar6 = *(undefined1 **)((int)compressor + 0x30); } local_8 = *(int *)((int)compressor + 0x44) - 8; uVar4 = *(uint *)((int)compressor + 0x48) >> 8; *(uint *)((int)compressor + 0x48) = uVar4; uVar3 = uVar4 & 0xff; *(uint *)((int)compressor + 0x44) = local_8; } while (7 < local_8); } if (bVar1) { LAB_00a88814: if ((uint)(*(int *)((int)compressor + 0x1c) - *(int *)((int)compressor + 0x40)) <= *(uint *)((int)compressor + 0x24)) { local_8 = local_8 + 2; *(undefined1 **)((int)compressor + 0x30) = puVar6; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = local_8; while (7 < local_8) { if (puVar6 < *(undefined1 **)((int)compressor + 0x34)) { *puVar6 = (char)uVar4; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } local_8 = *(int *)((int)compressor + 0x44) - 8; puVar6 = *(undefined1 **)((int)compressor + 0x30); uVar4 = *(uint *)((int)compressor + 0x48) >> 8; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = local_8; } if (local_8 != 0) { *(uint *)((int)compressor + 0x48) = uVar4; *(undefined4 *)((int)compressor + 0x44) = 8; do { if (puVar6 < *(undefined1 **)((int)compressor + 0x34)) { *puVar6 = (char)uVar4; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; puVar6 = *(undefined1 **)((int)compressor + 0x30); uVar4 = (uint)*(byte *)((int)compressor + 0x48); } while (7 < *(uint *)((int)compressor + 0x44)); } uVar3 = *(uint *)((int)compressor + 0x3c); iVar7 = 2; do { uVar4 = (uVar3 & 0xffff) << ((byte)*(int *)((int)compressor + 0x44) & 0x1f) | *(uint *)((int)compressor + 0x48); uVar3 = *(int *)((int)compressor + 0x44) + 0x10; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = uVar3; while (7 < uVar3) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar4; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar4 = (uint)*(byte *)((int)compressor + 0x48); uVar3 = *(uint *)((int)compressor + 0x44); } uVar3 = *(uint *)((int)compressor + 0x3c) ^ 0xffff; *(uint *)((int)compressor + 0x3c) = uVar3; iVar7 = iVar7 + -1; } while (iVar7 != 0); uVar4 = 0; if (uVar3 != 0) { do { uVar3 = *(int *)((int)compressor + 0x44) + 8; uVar5 = (uint)*(byte *)((*(int *)((int)compressor + 0x40) + uVar4 & 0x7fff) + 0x90 + (int)compressor) << ((byte)*(int *)((int)compressor + 0x44) & 0x1f) | *(uint *)((int)compressor + 0x48); *(uint *)((int)compressor + 0x48) = uVar5; *(uint *)((int)compressor + 0x44) = uVar3; while (7 < uVar3) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar5; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar5 = (uint)*(byte *)((int)compressor + 0x48); uVar3 = *(uint *)((int)compressor + 0x44); } uVar4 = uVar4 + 1; } while (uVar4 < *(uint *)((int)compressor + 0x3c)); } goto LAB_00a88955; } } else { local_10 = FUN_00a88560(); if ((*(uint *)((int)compressor + 0x3c) != 0) && (*(uint *)((int)compressor + 0x3c) <= (*(int *)((int)compressor + 0x30) - (int)puVar6) + 1U)) goto LAB_00a88814; } if (local_10 == 0) { *(undefined1 **)((int)compressor + 0x30) = puVar6; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = local_8; FUN_00a88560(); } LAB_00a88955: if (flush != 0) { if (flush == 4) { if (*(int *)((int)compressor + 0x44) != 0) { uVar3 = (uint)*(byte *)((int)compressor + 0x48); *(undefined4 *)((int)compressor + 0x44) = 8; do { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar3; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar3 = *(uint *)((int)compressor + 0x48); } while (7 < *(uint *)((int)compressor + 0x44)); } if ((*(uint *)((int)compressor + 8) & 0x1000) != 0) { uVar3 = *(uint *)((int)compressor + 0x18); iVar7 = 4; do { uVar5 = (uVar3 >> 0x18) << ((byte)*(int *)((int)compressor + 0x44) & 0x1f) | *(uint *)((int)compressor + 0x48); uVar4 = *(int *)((int)compressor + 0x44) + 8; *(uint *)((int)compressor + 0x48) = uVar5; *(uint *)((int)compressor + 0x44) = uVar4; while (7 < uVar4) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar5; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar5 = (uint)*(byte *)((int)compressor + 0x48); uVar4 = *(uint *)((int)compressor + 0x44); } uVar3 = uVar3 << 8; iVar7 = iVar7 + -1; } while (iVar7 != 0); } } else { uVar3 = *(uint *)((int)compressor + 0x48); uVar4 = *(int *)((int)compressor + 0x44) + 3; uVar5 = 0; *(uint *)((int)compressor + 0x44) = uVar4; while (7 < uVar4) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar3; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } uVar4 = *(int *)((int)compressor + 0x44) - 8; uVar3 = *(uint *)((int)compressor + 0x48) >> 8; *(uint *)((int)compressor + 0x48) = uVar3; *(uint *)((int)compressor + 0x44) = uVar4; } if (uVar4 != 0) { *(uint *)((int)compressor + 0x48) = uVar3; *(undefined4 *)((int)compressor + 0x44) = 8; do { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar3; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar3 = (uint)*(byte *)((int)compressor + 0x48); } while (7 < *(uint *)((int)compressor + 0x44)); } iVar7 = 2; do { uVar4 = uVar5 << ((byte)*(int *)((int)compressor + 0x44) & 0x1f) | *(uint *)((int)compressor + 0x48); uVar3 = *(int *)((int)compressor + 0x44) + 0x10; *(uint *)((int)compressor + 0x48) = uVar4; *(uint *)((int)compressor + 0x44) = uVar3; while (7 < uVar3) { if (*(undefined1 **)((int)compressor + 0x30) < *(undefined1 **)((int)compressor + 0x34)) { **(undefined1 **)((int)compressor + 0x30) = (char)uVar4; *(int *)((int)compressor + 0x30) = *(int *)((int)compressor + 0x30) + 1; } *(uint *)((int)compressor + 0x48) = *(uint *)((int)compressor + 0x48) >> 8; *(int *)((int)compressor + 0x44) = *(int *)((int)compressor + 0x44) + -8; uVar4 = (uint)*(byte *)((int)compressor + 0x48); uVar3 = *(uint *)((int)compressor + 0x44); } uVar5 = uVar5 ^ 0xffff; iVar7 = iVar7 + -1; } while (iVar7 != 0); } } if (*(uint *)((int)compressor + 0x34) <= *(uint *)((int)compressor + 0x30)) { _wassert(L"d->m_pOutput_buf < d->m_pOutput_buf_end", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x3b5); } memset((void *)((int)compressor + 0x8192),0,0x280); *(int *)((int)compressor + 100) = *(int *)((int)compressor + 100) + 1; *(int *)((int)compressor + 0x28) = (int)compressor + 0x9273; *(int *)((int)compressor + 0x2c) = (int)compressor + 0x9272; *(int *)((int)compressor + 0x40) = *(int *)((int)compressor + 0x40) + *(int *)((int)compressor + 0x3c); *(undefined4 *)((int)compressor + 0x38) = 8; *(undefined4 *)((int)compressor + 0x3c) = 0; uVar3 = *(int *)((int)compressor + 0x30) - (int)pvVar2; if (uVar3 != 0) { if (*(int *)compressor == 0) { if (pvVar2 == (void *)((int)compressor + 0x39272)) { uVar4 = **(int **)((int)compressor + 0x7c) - *(int *)((int)compressor + 0x8c); if (uVar3 < uVar4) { uVar4 = uVar3; } memcpy((void *)(*(int *)((int)compressor + 0x74) + *(int *)((int)compressor + 0x8c)), (void *)((int)compressor + 0x39272),uVar4); *(int *)((int)compressor + 0x8c) = *(int *)((int)compressor + 0x8c) + uVar4; iVar7 = uVar3 - uVar4; if (iVar7 != 0) { *(uint *)((int)compressor + 0x58) = uVar4; *(int *)((int)compressor + 0x5c) = iVar7; return iVar7; } } else { *(int *)((int)compressor + 0x8c) = *(int *)((int)compressor + 0x8c) + uVar3; } } else { **(int **)((int)compressor + 0x78) = *(int *)((int)compressor + 0x84) - *(int *)((int)compressor + 0x70); iVar7 = (**(code **)compressor) ((int)compressor + 0x39272,uVar3,*(undefined4 *)((int)compressor + 4)); if (iVar7 == 0) { *(undefined4 *)((int)compressor + 0x6c) = 0xffffffff; return -1; } } } return *(int *)((int)compressor + 0x5c); } //@@ 00a88bb0 tdefl_compress_fast /* DB: miniz.cpp asserts '(cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) ...' and 'lookahead_size >= cur_match_len' (tdefl_compress_fast), calls tdefl_flush_block; called next to tdefl_compress_normal in FUN_00a89de0 (= tdefl_compress) */ bool tdefl_compress_fast(void) { short *psVar1; void *_Src; uint *puVar2; uint *puVar3; uint *puVar4; uint uVar5; byte bVar6; void *in_ECX; uint uVar7; byte bVar8; ushort uVar9; uint uVar10; byte *pbVar11; ushort uVar12; uint uVar13; uint uVar14; uint *puVar15; int iVar16; int local_38; uint local_2c; uint local_24; uint local_20; uint local_1c; int local_18; uint local_14; byte *local_10; int local_c; byte *local_8; local_38 = 8; local_14 = *(uint *)((int)in_ECX + 0x24); local_1c = *(uint *)((int)in_ECX + 0x1c); local_10 = *(byte **)((int)in_ECX + 0x28); local_8 = *(byte **)((int)in_ECX + 0x2c); uVar5 = *(uint *)((int)in_ECX + 0x20); local_18 = *(int *)((int)in_ECX + 0x3c); local_20 = local_1c & 0x7fff; local_c = *(int *)((int)in_ECX + 0x38); do { uVar14 = *(uint *)((int)in_ECX + 0x88); if (uVar14 == 0) { local_24 = uVar5; if ((*(int *)((int)in_ECX + 0x80) == 0) || (uVar5 == 0)) { LAB_00a8909b: *(uint *)((int)in_ECX + 0x1c) = local_1c; *(uint *)((int)in_ECX + 0x24) = local_14; *(uint *)((int)in_ECX + 0x20) = local_24; *(byte **)((int)in_ECX + 0x28) = local_10; *(int *)((int)in_ECX + 0x38) = local_c; *(int *)((int)in_ECX + 0x3c) = local_18; *(byte **)((int)in_ECX + 0x2c) = local_8; return true; } } uVar13 = local_1c + uVar5; local_2c = uVar14; if (0x1000 - uVar5 <= uVar14) { local_2c = 0x1000 - uVar5; } local_24 = uVar5 + local_2c; *(uint *)((int)in_ECX + 0x88) = uVar14 - local_2c; if (local_2c != 0) { _Src = *(void **)((int)in_ECX + 0x84); do { uVar13 = uVar13 & 0x7fff; uVar5 = 0x8000 - uVar13; if (local_2c <= 0x8000 - uVar13) { uVar5 = local_2c; } memcpy((void *)((int)in_ECX + uVar13 + 0x90),_Src,uVar5); if (uVar13 < 0x101) { uVar14 = 0x101 - uVar13; if (uVar5 < 0x101 - uVar13) { uVar14 = uVar5; } memcpy((void *)((int)in_ECX + uVar13 + 0x8090),*(void **)((int)in_ECX + 0x84),uVar14); } uVar13 = uVar13 + uVar5; *(int *)((int)in_ECX + 0x84) = *(int *)((int)in_ECX + 0x84) + uVar5; _Src = *(void **)((int)in_ECX + 0x84); local_2c = local_2c - uVar5; } while (local_2c != 0); } uVar5 = 0x8000 - local_24; if (local_14 <= 0x8000 - local_24) { uVar5 = local_14; } local_14 = uVar5; if ((*(int *)((int)in_ECX + 0x80) == 0) && (local_24 < 0x1000)) goto LAB_00a8909b; if (3 < local_24) { do { uVar14 = 1; puVar2 = (uint *)(local_20 + 0x90 + (int)in_ECX); uVar5 = *puVar2; uVar13 = uVar5 & 0xffffff; uVar7 = (uVar13 >> 0x11 ^ uVar13) & 0xfff; uVar10 = (uint)*(ushort *)((int)in_ECX + uVar7 * 2 + 0x29272); *(short *)((int)in_ECX + uVar7 * 2 + 0x29272) = (short)local_1c; uVar7 = (local_1c & 0xffff) - uVar10 & 0xffff; if ((local_14 < uVar7) || (puVar15 = (uint *)((int)in_ECX + (uVar10 & 0x7fff) + 0x90), (*puVar15 & 0xffffff) != uVar13)) { *local_10 = (byte)uVar13; *local_8 = *local_8 >> 1; psVar1 = (short *)((int)in_ECX + (uVar5 & 0xff) * 2 + 0x8192); *psVar1 = *psVar1 + 1; iVar16 = 1; } else { iVar16 = 0x20; puVar3 = puVar2; do { uVar12 = *(ushort *)((int)puVar3 + 2); puVar4 = (uint *)((int)puVar3 + 2); uVar9 = *(ushort *)((int)puVar15 + 2); if (uVar12 != uVar9) break; puVar4 = puVar3 + 1; bVar8 = (byte)puVar3[1]; bVar6 = (byte)puVar15[1]; if ((ushort)puVar3[1] != (ushort)puVar15[1]) { LAB_00a88dcc: uVar9 = (ushort)bVar6; uVar12 = (ushort)bVar8; break; } puVar4 = (uint *)((int)puVar3 + 6); bVar8 = (byte)*(ushort *)((int)puVar3 + 6); bVar6 = (byte)*(ushort *)((int)puVar15 + 6); if (*(ushort *)((int)puVar3 + 6) != *(ushort *)((int)puVar15 + 6)) goto LAB_00a88dcc; puVar4 = puVar3 + 2; uVar9 = (ushort)puVar15[2]; puVar15 = puVar15 + 2; uVar12 = (ushort)puVar3[2] & 0xff; if ((ushort)puVar3[2] != uVar9) break; uVar9 = (ushort)*puVar15; iVar16 = iVar16 + -1; puVar3 = puVar4; } while (iVar16 != 0); uVar10 = (uint)((char)uVar12 == (char)uVar9) + ((int)puVar4 - (int)puVar2 >> 1) * 2; if (iVar16 == 0) { uVar10 = -(uint)(uVar7 != 0) & 0x102; } if ((uVar10 < 3) || ((uVar10 == 3 && (0x1fff < uVar7)))) { uVar14 = 1; *local_10 = (byte)uVar13; *local_8 = *local_8 >> 1; psVar1 = (short *)((int)in_ECX + (uVar5 & 0xff) * 2 + 0x8192); *psVar1 = *psVar1 + 1; iVar16 = 1; } else { uVar14 = local_24; if (uVar10 < local_24) { uVar14 = uVar10; } if (((uVar14 < 3) || (uVar7 == 0)) || (0x8000 < uVar7)) { _wassert(L"(cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE)" , L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp" ,0x457); } uVar7 = uVar7 - 1; *local_10 = (char)uVar14 - 3; *(short *)(local_10 + 1) = (short)uVar7; *local_8 = *local_8 >> 1 | 0x80; bVar6 = (&DAT_00b4ce10)[uVar7 >> 8]; if (uVar7 < 0x200) { bVar6 = (&DAT_00b4d090)[uVar7 & 0x1ff]; } psVar1 = (short *)((int)in_ECX + (uint)bVar6 * 2 + 0x83d2); *psVar1 = *psVar1 + 1; psVar1 = (short *)((int)in_ECX + (uint)*(ushort *)(&DAT_00b4e25a + uVar14 * 2) * 2 + 0x8192); *psVar1 = *psVar1 + 1; iVar16 = 3; } } pbVar11 = local_10 + iVar16; iVar16 = local_c + -1; local_c = iVar16; if (iVar16 == 0) { local_c = local_38; } local_10 = pbVar11 + 1; if (iVar16 != 0) { local_10 = pbVar11; pbVar11 = local_8; } local_8 = pbVar11; local_1c = local_1c + uVar14; local_18 = local_18 + uVar14; uVar5 = local_14 + uVar14; local_14 = 0x8000; if (uVar5 < 0x8000) { local_14 = uVar5; } local_20 = local_20 + uVar14 & 0x7fff; if (local_24 < uVar14) { _wassert(L"lookahead_size >= cur_match_len", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x474); } local_24 = local_24 - uVar14; if ((byte *)((int)in_ECX + 0x1926aU) < local_10) { *(byte **)((int)in_ECX + 0x28) = local_10; *(uint *)((int)in_ECX + 0x24) = local_14; *(int *)((int)in_ECX + 0x3c) = local_18; *(byte **)((int)in_ECX + 0x2c) = local_8; *(uint *)((int)in_ECX + 0x1c) = local_1c; *(uint *)((int)in_ECX + 0x20) = local_24; *(int *)((int)in_ECX + 0x38) = local_c; iVar16 = tdefl_flush_block(in_ECX,0); if (iVar16 != 0) goto LAB_00a890c5; local_18 = *(int *)((int)in_ECX + 0x3c); local_10 = *(byte **)((int)in_ECX + 0x28); local_8 = *(byte **)((int)in_ECX + 0x2c); local_c = *(int *)((int)in_ECX + 0x38); } } while (3 < local_24); } uVar5 = 0; if (local_24 != 0) { do { local_18 = local_18 + 1; bVar6 = *(byte *)(local_20 + 0x90 + (int)in_ECX); *local_10 = bVar6; *local_8 = *local_8 >> 1; iVar16 = local_c + -1; if (iVar16 == 0) { local_8 = local_10 + 1; local_c = local_38; } else { local_c = iVar16; } local_10 = local_10 + (2 - (uint)(iVar16 != 0)); local_1c = local_1c + 1; psVar1 = (short *)((int)in_ECX + (uint)bVar6 * 2 + 0x8192); *psVar1 = *psVar1 + 1; uVar5 = local_14 + 1; local_14 = 0x8000; if (uVar5 < 0x8000) { local_14 = uVar5; } local_20 = local_20 + 1 & 0x7fff; local_24 = local_24 - 1; if ((byte *)((int)in_ECX + 0x1926aU) < local_10) { *(uint *)((int)in_ECX + 0x1c) = local_1c; *(uint *)((int)in_ECX + 0x24) = local_14; *(int *)((int)in_ECX + 0x3c) = local_18; *(byte **)((int)in_ECX + 0x2c) = local_8; *(uint *)((int)in_ECX + 0x20) = local_24; *(byte **)((int)in_ECX + 0x28) = local_10; *(int *)((int)in_ECX + 0x38) = local_c; iVar16 = tdefl_flush_block(in_ECX,0); if (iVar16 != 0) { LAB_00a890c5: return -1 < iVar16; } local_18 = *(int *)((int)in_ECX + 0x3c); local_10 = *(byte **)((int)in_ECX + 0x28); local_8 = *(byte **)((int)in_ECX + 0x2c); local_c = *(int *)((int)in_ECX + 0x38); } } while (local_24 != 0); uVar5 = 0; } } while( true ); } //@@ 00a890e0 tdefl_compress_normal /* DB: miniz.cpp asserts "d->m_lookahead_size >= len_to_move", "max_match_len <= TDEFL_MAX_MATCH_LEN" (tdefl_find_match inlined), "(match_len >= TDEFL_MIN_MATCH_LEN)..." (tdefl_record_match inlined); caller 00a89de0 tdefl_compress tdefl_compress */ bool tdefl_compress_normal(void) { int *piVar1; byte bVar2; short sVar3; short sVar4; int iVar5; uint uVar6; byte *pbVar7; char *pcVar8; int iVar9; void *in_ECX; uint uVar10; short *psVar11; short *psVar12; uint uVar13; uint uVar14; int iVar15; uint uVar16; short *psVar17; short *psVar18; short *psVar19; uint local_40; uint local_30; uint local_24; byte *local_1c; uint local_18; uint local_14; uint local_10; uint local_8; local_1c = *(byte **)((int)in_ECX + 0x84); local_18 = *(uint *)((int)in_ECX + 0x88); iVar5 = *(int *)((int)in_ECX + 0x80); do { if ((local_18 == 0) && ((iVar5 == 0 || (*(int *)((int)in_ECX + 0x20) == 0)))) { LAB_00a899ab: *(byte **)((int)in_ECX + 0x84) = local_1c; *(uint *)((int)in_ECX + 0x88) = local_18; return true; } local_14 = *(uint *)((int)in_ECX + 0x20); if (*(int *)((int)in_ECX + 0x24) + local_14 < 2) { if (local_18 != 0) { do { if (0x101 < local_14) break; bVar2 = *local_1c; local_18 = local_18 - 1; uVar16 = *(int *)((int)in_ECX + 0x1c) + local_14 & 0x7fff; local_1c = local_1c + 1; *(byte *)(uVar16 + 0x90 + (int)in_ECX) = bVar2; if (uVar16 < 0x101) { *(byte *)(uVar16 + 0x8090 + (int)in_ECX) = bVar2; } local_14 = *(int *)((int)in_ECX + 0x20) + 1; *(uint *)((int)in_ECX + 0x20) = local_14; if (2 < *(int *)((int)in_ECX + 0x24) + local_14) { local_14 = local_14 + *(int *)((int)in_ECX + 0x1c) + -3; uVar16 = ((uint)*(byte *)((local_14 & 0x7fff) + 0x90 + (int)in_ECX) << 10 ^ (uint)bVar2) & 0x7fff ^ (uint)*(byte *)((local_14 + 1 & 0x7fff) + 0x90 + (int)in_ECX) << 5; *(undefined2 *)((int)in_ECX + (local_14 & 0x7fff) * 2 + 0x19272) = *(undefined2 *)((int)in_ECX + uVar16 * 2 + 0x29272); *(short *)((int)in_ECX + uVar16 * 2 + 0x29272) = (short)local_14; local_14 = *(uint *)((int)in_ECX + 0x20); } } while (local_18 != 0); } } else { uVar6 = *(int *)((int)in_ECX + 0x1c) + local_14; uVar16 = uVar6 - 2; uVar13 = (uint)*(byte *)((uVar16 & 0x7fff) + 0x90 + (int)in_ECX) << 5 ^ (uint)*(byte *)((uVar6 - 1 & 0x7fff) + 0x90 + (int)in_ECX); uVar14 = local_18; if (0x102 - local_14 <= local_18) { uVar14 = 0x102 - local_14; } local_14 = local_14 + uVar14; pbVar7 = local_1c + uVar14; local_18 = local_18 - uVar14; *(uint *)((int)in_ECX + 0x20) = local_14; if (local_1c != pbVar7) { do { uVar6 = uVar6 & 0x7fff; bVar2 = *local_1c; local_1c = local_1c + 1; *(byte *)(uVar6 + 0x90 + (int)in_ECX) = bVar2; if (uVar6 < 0x101) { *(byte *)(uVar6 + 0x8090 + (int)in_ECX) = bVar2; } uVar6 = uVar6 + 1; uVar13 = (uVar13 << 5 ^ (uint)bVar2) & 0x7fff; *(undefined2 *)((int)in_ECX + (uVar16 & 0x7fff) * 2 + 0x19272) = *(undefined2 *)((int)in_ECX + uVar13 * 2 + 0x29272); *(short *)((int)in_ECX + uVar13 * 2 + 0x29272) = (short)uVar16; uVar16 = uVar16 + 1; } while (local_1c != pbVar7); local_14 = *(uint *)((int)in_ECX + 0x20); } } uVar16 = 0x8000 - local_14; if (*(uint *)((int)in_ECX + 0x24) <= 0x8000 - local_14) { uVar16 = *(uint *)((int)in_ECX + 0x24); } *(uint *)((int)in_ECX + 0x24) = uVar16; if ((iVar5 == 0) && (local_14 < 0x102)) goto LAB_00a899ab; local_40 = 1; local_10 = 0; local_24 = 2; if (*(uint *)((int)in_ECX + 0x50) != 0) { local_24 = *(uint *)((int)in_ECX + 0x50); } uVar6 = *(uint *)((int)in_ECX + 0x1c); uVar14 = uVar6 & 0x7fff; local_8 = local_24; if ((*(uint *)((int)in_ECX + 8) & 0x90000) == 0) { iVar9 = *(int *)((-(uint)(local_24 < 0x20) & 0xfffffffc) + 0x10 + (int)in_ECX); psVar17 = (short *)(uVar14 + 0x90 + (int)in_ECX); sVar3 = *(short *)(uVar14 + local_24 + 0x8f + (int)in_ECX); sVar4 = *psVar17; if (0x102 < local_14) { _wassert(L"max_match_len <= TDEFL_MAX_MATCH_LEN", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x3e0 ); } uVar13 = uVar14; if (local_24 < local_14) { LAB_00a89400: do { uVar10 = uVar6 & 0xffff; do { iVar9 = iVar9 + -1; if (((iVar9 == 0) || (uVar13 = (uint)*(ushort *)((int)in_ECX + uVar13 * 2 + 0x19272), uVar13 == 0)) || (local_30 = uVar10 - uVar13 & 0xffff, uVar16 < local_30)) goto LAB_00a895bd; uVar13 = uVar13 & 0x7fff; if (*(short *)(local_24 + uVar13 + 0x8f + (int)in_ECX) == sVar3) break; uVar13 = (uint)*(ushort *)((int)in_ECX + uVar13 * 2 + 0x19272); if ((uVar13 == 0) || (local_30 = uVar10 - uVar13 & 0xffff, uVar16 < local_30)) goto LAB_00a895bd; uVar13 = uVar13 & 0x7fff; if (*(short *)(local_24 + uVar13 + 0x8f + (int)in_ECX) == sVar3) break; uVar13 = (uint)*(ushort *)((int)in_ECX + uVar13 * 2 + 0x19272); if ((uVar13 == 0) || (local_30 = uVar10 - uVar13 & 0xffff, uVar16 < local_30)) goto LAB_00a895bd; uVar13 = uVar13 & 0x7fff; } while (*(short *)(local_24 + uVar13 + 0x8f + (int)in_ECX) != sVar3); if (local_30 == 0) goto LAB_00a895bd; psVar18 = (short *)((int)in_ECX + uVar13 + 0x90); } while (*psVar18 != sVar4); iVar15 = 0x20; psVar11 = psVar17; do { psVar12 = psVar11 + 1; psVar19 = psVar18 + 1; if (psVar11[1] != *psVar19) goto LAB_00a89545; psVar12 = psVar11 + 2; psVar19 = psVar18 + 2; if (psVar11[2] != *psVar19) break; psVar12 = psVar11 + 3; psVar19 = psVar18 + 3; if (psVar11[3] != *psVar19) break; psVar12 = psVar11 + 4; psVar19 = psVar18 + 4; if (psVar11[4] != *psVar19) break; iVar15 = iVar15 + -1; psVar11 = psVar12; psVar18 = psVar19; } while (iVar15 != 0); if (iVar15 != 0) { LAB_00a89545: uVar10 = (uint)((char)*psVar12 == (char)*psVar19) + ((int)psVar12 - (int)psVar17 >> 1) * 2 ; if (local_24 < uVar10) { local_10 = local_30; local_24 = uVar10; if (local_14 < uVar10) { local_24 = local_14; } local_8 = local_24; if (local_24 == local_14) goto LAB_00a895bd; sVar3 = *(short *)(uVar14 + local_24 + 0x8f + (int)in_ECX); } goto LAB_00a89400; } local_8 = 0x102; if (local_14 < 0x102) { local_8 = local_14; } local_10 = local_30; } LAB_00a895bd: if ((local_8 != 3) || (local_10 < 0x2000)) goto LAB_00a895ca; LAB_00a895df: local_10 = 0; local_8 = 0; } else { if ((uVar16 == 0) || ((*(uint *)((int)in_ECX + 8) & 0x80000) != 0)) goto LAB_00a895bd; local_8 = 0; if (local_14 != 0) { pcVar8 = (char *)((int)in_ECX + uVar14 + 0x90); do { if (*pcVar8 != *(char *)((uVar14 - 1 & 0x7fff) + 0x90 + (int)in_ECX)) break; local_8 = local_8 + 1; pcVar8 = pcVar8 + 1; } while (local_8 < *(uint *)((int)in_ECX + 0x20)); if (2 < local_8) { local_10 = 1; goto LAB_00a895bd; } } local_8 = 0; LAB_00a895ca: if ((uVar14 == local_10) || (((*(uint *)((int)in_ECX + 8) & 0x20000) != 0 && (local_8 < 6)))) goto LAB_00a895df; } uVar16 = *(uint *)((int)in_ECX + 0x50); if (uVar16 == 0) { if (local_10 == 0) { bVar2 = *(byte *)(uVar14 + 0x90 + (int)in_ECX); *(int *)((int)in_ECX + 0x3c) = *(int *)((int)in_ECX + 0x3c) + 1; **(byte **)((int)in_ECX + 0x28) = bVar2; *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; **(byte **)((int)in_ECX + 0x2c) = **(byte **)((int)in_ECX + 0x2c) >> 1; piVar1 = (int *)((int)in_ECX + 0x38); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)((int)in_ECX + 0x38) = 8; *(int *)((int)in_ECX + 0x2c) = *(int *)((int)in_ECX + 0x28); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; } psVar17 = (short *)((int)in_ECX + (uint)bVar2 * 2 + 0x8192); *psVar17 = *psVar17 + 1; local_8 = local_40; } else if (((*(int *)((int)in_ECX + 0x14) == 0) && ((*(uint *)((int)in_ECX + 8) & 0x10000) == 0) ) && (local_8 < 0x80)) { bVar2 = *(byte *)(uVar14 + 0x90 + (int)in_ECX); *(uint *)((int)in_ECX + 0x4c) = local_10; *(uint *)((int)in_ECX + 0x54) = (uint)bVar2; *(uint *)((int)in_ECX + 0x50) = local_8; local_8 = local_40; } else { if (((local_8 < 3) || (local_10 == 0)) || (0x8000 < local_10)) { _wassert(L"(match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE)" ,L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x4b0); } *(int *)((int)in_ECX + 0x3c) = *(int *)((int)in_ECX + 0x3c) + local_8; local_10 = local_10 - 1; **(char **)((int)in_ECX + 0x28) = (char)local_8 + -3; *(char *)(*(int *)((int)in_ECX + 0x28) + 1) = (char)local_10; *(char *)(*(int *)((int)in_ECX + 0x28) + 2) = (char)(local_10 >> 8); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 3; **(byte **)((int)in_ECX + 0x2c) = **(byte **)((int)in_ECX + 0x2c) >> 1 | 0x80; piVar1 = (int *)((int)in_ECX + 0x38); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)((int)in_ECX + 0x38) = 8; *(int *)((int)in_ECX + 0x2c) = *(int *)((int)in_ECX + 0x28); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; } bVar2 = (&DAT_00b4ce10)[local_10 >> 8 & 0x7f]; if (local_10 < 0x200) { bVar2 = (&DAT_00b4d090)[local_10 & 0x1ff]; } psVar17 = (short *)((int)in_ECX + (uint)bVar2 * 2 + 0x83d2); *psVar17 = *psVar17 + 1; if (2 < local_8) { psVar17 = (short *)((int)in_ECX + (uint)*(ushort *)(&DAT_00b4e25a + local_8 * 2) * 2 + 0x8192); *psVar17 = *psVar17 + 1; } } } else if (uVar16 < local_8) { bVar2 = *(byte *)((int)in_ECX + 0x54); *(int *)((int)in_ECX + 0x3c) = *(int *)((int)in_ECX + 0x3c) + 1; **(byte **)((int)in_ECX + 0x28) = bVar2; *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; **(byte **)((int)in_ECX + 0x2c) = **(byte **)((int)in_ECX + 0x2c) >> 1; piVar1 = (int *)((int)in_ECX + 0x38); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)((int)in_ECX + 0x38) = 8; *(int *)((int)in_ECX + 0x2c) = *(int *)((int)in_ECX + 0x28); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; } psVar17 = (short *)((int)in_ECX + (uint)bVar2 * 2 + 0x8192); *psVar17 = *psVar17 + 1; if (local_8 < 0x80) { bVar2 = *(byte *)(uVar14 + 0x90 + (int)in_ECX); *(uint *)((int)in_ECX + 0x4c) = local_10; *(uint *)((int)in_ECX + 0x54) = (uint)bVar2; *(uint *)((int)in_ECX + 0x50) = local_8; local_8 = local_40; } else { if ((local_10 == 0) || (0x8000 < local_10)) { _wassert(L"(match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE)" ,L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x4b0); } *(int *)((int)in_ECX + 0x3c) = *(int *)((int)in_ECX + 0x3c) + local_8; local_10 = local_10 - 1; **(char **)((int)in_ECX + 0x28) = (char)local_8 + -3; *(char *)(*(int *)((int)in_ECX + 0x28) + 1) = (char)local_10; *(char *)(*(int *)((int)in_ECX + 0x28) + 2) = (char)(local_10 >> 8); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 3; **(byte **)((int)in_ECX + 0x2c) = **(byte **)((int)in_ECX + 0x2c) >> 1 | 0x80; piVar1 = (int *)((int)in_ECX + 0x38); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)((int)in_ECX + 0x38) = 8; *(int *)((int)in_ECX + 0x2c) = *(int *)((int)in_ECX + 0x28); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; } bVar2 = (&DAT_00b4ce10)[local_10 >> 8 & 0x7f]; if (local_10 < 0x200) { bVar2 = (&DAT_00b4d090)[local_10 & 0x1ff]; } psVar17 = (short *)((int)in_ECX + (uint)bVar2 * 2 + 0x83d2); *psVar17 = *psVar17 + 1; psVar17 = (short *)((int)in_ECX + (uint)*(ushort *)(&DAT_00b4e25a + local_8 * 2) * 2 + 0x8192); *psVar17 = *psVar17 + 1; *(undefined4 *)((int)in_ECX + 0x50) = 0; } } else { uVar6 = *(uint *)((int)in_ECX + 0x4c); if (((uVar16 < 3) || (uVar6 == 0)) || (0x8000 < uVar6)) { _wassert(L"(match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE)" ,L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp", 0x4b0); } *(int *)((int)in_ECX + 0x3c) = *(int *)((int)in_ECX + 0x3c) + uVar16; uVar6 = uVar6 - 1; **(char **)((int)in_ECX + 0x28) = (char)uVar16 + -3; *(char *)(*(int *)((int)in_ECX + 0x28) + 1) = (char)uVar6; *(char *)(*(int *)((int)in_ECX + 0x28) + 2) = (char)(uVar6 >> 8); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 3; **(byte **)((int)in_ECX + 0x2c) = **(byte **)((int)in_ECX + 0x2c) >> 1 | 0x80; piVar1 = (int *)((int)in_ECX + 0x38); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)((int)in_ECX + 0x38) = 8; *(int *)((int)in_ECX + 0x2c) = *(int *)((int)in_ECX + 0x28); *(int *)((int)in_ECX + 0x28) = *(int *)((int)in_ECX + 0x28) + 1; } bVar2 = (&DAT_00b4ce10)[uVar6 >> 8 & 0x7f]; if (uVar6 < 0x200) { bVar2 = (&DAT_00b4d090)[uVar6 & 0x1ff]; } psVar17 = (short *)((int)in_ECX + (uint)bVar2 * 2 + 0x83d2); *psVar17 = *psVar17 + 1; if (2 < uVar16) { psVar17 = (short *)((int)in_ECX + (uint)*(ushort *)(&DAT_00b4e25a + uVar16 * 2) * 2 + 0x8192 ); *psVar17 = *psVar17 + 1; } local_8 = *(int *)((int)in_ECX + 0x50) - 1; *(undefined4 *)((int)in_ECX + 0x50) = 0; } *(int *)((int)in_ECX + 0x1c) = *(int *)((int)in_ECX + 0x1c) + local_8; uVar16 = *(uint *)((int)in_ECX + 0x20); if (uVar16 < local_8) { _wassert(L"d->m_lookahead_size >= len_to_move", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\miniz.cpp",0x526); uVar16 = *(uint *)((int)in_ECX + 0x20); } *(uint *)((int)in_ECX + 0x20) = uVar16 - local_8; local_8 = *(int *)((int)in_ECX + 0x24) + local_8; uVar16 = 0x8000; if (local_8 < 0x8000) { uVar16 = local_8; } *(uint *)((int)in_ECX + 0x24) = uVar16; if (((int)in_ECX + 0x1926aU < *(uint *)((int)in_ECX + 0x28)) || ((0x7c00 < *(uint *)((int)in_ECX + 0x3c) && ((*(uint *)((int)in_ECX + 0x3c) <= (*(uint *)((int)in_ECX + 0x28) - (int)in_ECX) * 0x73 - 0x41c936 >> 7 || ((*(uint *)((int)in_ECX + 8) & 0x80000) != 0)))))) { *(byte **)((int)in_ECX + 0x84) = local_1c; *(uint *)((int)in_ECX + 0x88) = local_18; iVar9 = tdefl_flush_block(in_ECX,0); if (iVar9 != 0) { return -1 < iVar9; } } } while( true ); } //@@ 00a899e0 FUN_00a899e0 undefined4 FUN_00a899e0(void) { int in_ECX; uint _Size; if (*(int **)(in_ECX + 0x78) != (int *)0x0) { **(int **)(in_ECX + 0x78) = *(int *)(in_ECX + 0x84) - *(int *)(in_ECX + 0x70); } if (*(int **)(in_ECX + 0x7c) != (int *)0x0) { _Size = **(int **)(in_ECX + 0x7c) - *(int *)(in_ECX + 0x8c); if (*(uint *)(in_ECX + 0x5c) <= _Size) { _Size = *(size_t *)(in_ECX + 0x5c); } memcpy((void *)(*(int *)(in_ECX + 0x74) + *(int *)(in_ECX + 0x8c)), (void *)(*(int *)(in_ECX + 0x58) + 0x39272 + in_ECX),_Size); *(int *)(in_ECX + 0x58) = *(int *)(in_ECX + 0x58) + _Size; *(int *)(in_ECX + 0x5c) = *(int *)(in_ECX + 0x5c) - _Size; *(int *)(in_ECX + 0x8c) = *(int *)(in_ECX + 0x8c) + _Size; **(undefined4 **)(in_ECX + 0x7c) = *(undefined4 *)(in_ECX + 0x8c); } if ((*(int *)(in_ECX + 0x60) == 0) || (*(int *)(in_ECX + 0x5c) != 0)) { return 0; } return 1; } //@@ 00a89a60 FUN_00a89a60 undefined4 FUN_00a89a60(void) { undefined4 *in_ECX; *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0x200; in_ECX[3] = 0xac; in_ECX[5] = 0; in_ECX[4] = 0x2c; memset((void *)((int)in_ECX + 0x29272),0,0x10000); in_ECX[0x11] = 0; in_ECX[10] = (int)in_ECX + 0x9273; in_ECX[0xb] = (int)in_ECX + 0x9272; in_ECX[0xc] = (int)in_ECX + 0x39272; in_ECX[0xd] = (int)in_ECX + 0x39272; in_ECX[0x10] = 0; in_ECX[0xf] = 0; in_ECX[9] = 0; in_ECX[8] = 0; in_ECX[7] = 0; in_ECX[0x1a] = 0; in_ECX[0x12] = 0; in_ECX[0x19] = 0; in_ECX[0x18] = 0; in_ECX[0x17] = 0; in_ECX[0x16] = 0; in_ECX[0xe] = 8; in_ECX[0x1b] = 0; in_ECX[0x15] = 0; in_ECX[0x14] = 0; in_ECX[0x13] = 0; in_ECX[6] = 1; in_ECX[0x1c] = 0; in_ECX[0x1d] = 0; in_ECX[0x1e] = 0; in_ECX[0x1f] = 0; in_ECX[0x20] = 0; in_ECX[0x21] = 0; in_ECX[0x22] = 0; in_ECX[0x23] = 0; memset((void *)((int)in_ECX + 0x8192),0,0x280); return 0; } //@@ 00a89ba0 FUN_00a89ba0 void FUN_00a89ba0(void) { qword qVar1; void *pvVar2; undefined4 *puVar3; undefined4 uVar4; undefined4 *puVar5; qword *pqVar6; pvVar2 = g_deflateCompressor; if (*(int *)((int)g_deflateCompressor + 4) == 0) { if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x4df44); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar5 = (undefined4 *)0x0; } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x4df44; puVar5 = puVar3 + 1; *puVar3 = 0x4df44; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xfffb20bb < (uint)qVar1); } *(undefined4 **)((int)pvVar2 + 4) = puVar5; } FUN_00a89a60(); *(undefined1 *)((int)pvVar2 + 8) = 0; operator_delete(*(void **)pvVar2,0x810); if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x814); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x814; *puVar3 = 0x814; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xfffff7eb < (uint)qVar1); if (puVar3 != (undefined4 *)0xfffffffc) { uVar4 = FUN_00aa93e0(0); *(undefined4 *)pvVar2 = uVar4; return; } } *(undefined4 *)pvVar2 = 0; return; } //@@ 00a89c90 FUN_00a89c90 void FUN_00a89c90(undefined4 param_1) { qword qVar1; undefined4 *puVar2; undefined4 uVar3; undefined4 *in_ECX; qword *pqVar4; puVar2 = (undefined4 *)in_ECX[3]; if (puVar2 == (undefined4 *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar2 = malloc(0x2af4); if (puVar2 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar2 = (undefined4 *)0x0; } else { qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 0x2af4; *puVar2 = 0x2af4; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xffffd50b < (uint)qVar1); puVar2 = puVar2 + 1; } in_ECX[3] = puVar2; } *puVar2 = 0; *(undefined1 *)(in_ECX + 4) = 0; operator_delete((void *)*in_ECX,0x810); if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar2 = malloc(0x814); if (puVar2 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 0x814; *puVar2 = 0x814; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xfffff7eb < (uint)qVar1); if (puVar2 != (undefined4 *)0xfffffffc) { uVar3 = FUN_00aa93e0(param_1); *in_ECX = uVar3; return; } } *in_ECX = 0; return; } //@@ 00a89d70 FUN_00a89d70 void FUN_00a89d70(int param_1,uint param_2) { uint *puVar1; uint uVar2; int *in_ECX; undefined4 *extraout_ECX; uint uVar3; uint uVar4; uVar3 = 0; uVar4 = 0; if (param_2 != 0) { do { if ((uVar4 & 3) == 0) { puVar1 = (uint *)*in_ECX; uVar3 = puVar1[*puVar1 + 1]; uVar2 = *puVar1 + 1; *puVar1 = uVar2; if (0xff < uVar2) { FUN_00aa94a0(); *extraout_ECX = 0; } } else { uVar3 = uVar3 >> 8; } *(byte *)(uVar4 + param_1) = *(byte *)(uVar4 + param_1) ^ (byte)uVar3; uVar4 = uVar4 + 1; } while (uVar4 < param_2); } return; } //@@ 00a89de0 tdefl_compress /* DB: miniz (round 7 agent) */ size_t tdefl_compress(void *param_1,size_t param_2,void *param_3,size_t param_4) { int *compressor; void *pvVar1; int iVar2; size_t local_c; size_t local_8; pvVar1 = g_deflateCompressor; local_c = param_4; local_8 = param_2; if (*(char *)((int)g_deflateCompressor + 8) != '\0') { memcpy(param_1,param_3,param_4); FUN_00a89d70(param_1,param_4); return param_4; } compressor = *(int **)((int)g_deflateCompressor + 4); if (compressor == (int *)0x0) { *(undefined1 *)((int)g_deflateCompressor + 8) = 0; return 0; } compressor[0x1e] = (int)&local_c; compressor[0x1c] = (int)param_3; compressor[0x1d] = (int)param_1; compressor[0x1f] = (int)&local_8; compressor[0x21] = (int)param_3; compressor[0x22] = param_4; compressor[0x23] = 0; compressor[0x20] = 4; if ((((*compressor != 0) || (compressor[0x1b] != 0)) || ((param_4 != 0 && (param_3 == (void *)0x0)))) || ((param_2 != 0 && (param_1 == (void *)0x0)))) { local_8 = 0; compressor[0x1b] = -2; LAB_00a89f4b: *(undefined1 *)((int)pvVar1 + 8) = 0; return local_8; } compressor[0x1a] = compressor[0x1a] | 1; if ((compressor[0x17] == 0) && (compressor[0x18] == 0)) { if (((compressor[2] & 0xfffU) == 1) && ((compressor[2] & 0xb4000U) == 0x4000)) { iVar2 = tdefl_compress_fast(); } else { iVar2 = tdefl_compress_normal(); } if (iVar2 == 0) goto LAB_00a89f4b; if (((compressor[2] & 0x3000U) != 0) && (param_3 != (void *)0x0)) { iVar2 = FUN_00a855a0(compressor[0x21] - (int)param_3); compressor[6] = iVar2; } if (((compressor[8] == 0) && (compressor[0x22] == 0)) && (compressor[0x17] == 0)) { iVar2 = tdefl_flush_block(compressor,4); if (iVar2 < 0) goto LAB_00a89f4b; compressor[0x18] = 1; } } iVar2 = FUN_00a899e0(); compressor[0x1b] = iVar2; *(undefined1 *)((int)pvVar1 + 8) = 0; return local_8; } //@@ 00a89f80 FUN_00a89f80 size_t FUN_00a89f80(void *param_1,size_t param_2,void *param_3,size_t param_4,byte param_5) { size_t _Size; char cVar1; int in_ECX; size_t local_8; _Size = param_4; local_8 = param_4; param_4 = param_2; if (*(char *)(in_ECX + 0x10) == '\0') { if ((param_5 == 0) && (_Size == param_2)) { cVar1 = '\x01'; } else { cVar1 = '\0'; } *(char *)(in_ECX + 0x10) = cVar1; if (cVar1 == '\0') { tinfl_decompress(&local_8,param_1,param_1,¶m_4,(param_5 ^ 1) * 2); return param_4; } } memcpy(param_1,param_3,_Size); FUN_00a89d70(param_1,_Size); return _Size; } //@@ 00a8a010 FUN_00a8a010 undefined4 * FUN_00a8a010(undefined4 *param_1) { char *pcVar1; *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; pcVar1 = std::_Allocate(0x20); param_1[4] = 0x15; param_1[5] = 0x1f; builtin_strncpy(pcVar1,"TheoraplayerException",0x16); *param_1 = pcVar1; return param_1; } //@@ 00a8a070 FUN_00a8a070 char * FUN_00a8a070(char *param_1) { int in_ECX; std::string::string(param_1,(void *)(in_ECX + 4)); return param_1; } //@@ 00a8a090 TheoraVideoManager::TheoraVideoManager /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: theoraplayer ctor log 'Initializing Theoraplayer Video Playback Library (', '- libtheora version:', '- libvorbis version:' */ void TheoraVideoManager::TheoraVideoManager(void) { byte bVar1; void *pvVar2; undefined4 *unused; LPCRITICAL_SECTION lpCriticalSection; std_string *psVar3; std_string *this; undefined4 *puVar4; byte *text; byte *******pppppppbVar5; undefined4 *in_ECX; byte *pbVar6; char *ptr; uint uVar7; void *local_b4 [4]; undefined4 local_a4; uint local_a0; void *local_9c; undefined4 uStack_98; undefined4 uStack_94; undefined4 uStack_90; undefined8 local_8c; byte *******local_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined8 local_74; std_string local_6c; void *local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined8 local_44; std_string local_3c; uint local_24; char *pcStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; pcStack_20 = (char *)((int)register0x00000010 + 0xfffffffc); puStack_18 = &LAB_00b148a4; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)((int)register0x00000010 + 0xfffffff0U); ExceptionList = &local_1c; *in_ECX = theoraplayer::Manager::vftable; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; local_14 = 1; in_ECX[7] = 0; in_ECX[8] = 0; pvVar2 = operator_new(0xc); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; in_ECX[7] = pvVar2; local_14 = CONCAT31(local_14._1_3_,2); in_ECX[9] = 8; unused = operator_new(8); if (unused == (undefined4 *)0x0) { puVar4 = (undefined4 *)0x0; } else { *unused = 0; *(undefined1 *)(unused + 1) = 0; lpCriticalSection = malloc(0x18); *unused = lpCriticalSection; InitializeCriticalSection(lpCriticalSection); puVar4 = unused; } in_ECX[10] = puVar4; in_ECX[0xb] = 0; local_14._0_1_ = 3; psVar3 = int_to_string(&local_6c,0); local_14._0_1_ = 4; this = int_to_string(&local_3c,2); local_14._0_1_ = 5; puVar4 = std::string::append(this->_buf,&DAT_00b1cebc,1); local_84 = (byte *******)*puVar4; uStack_80 = puVar4[1]; uStack_7c = puVar4[2]; uStack_78 = puVar4[3]; local_74 = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 6; std::string::concat_move((char *)local_b4,(int)unused,&local_84,psVar3); local_14._0_1_ = 5; if (0xf < local_74._4_4_) { uVar7 = local_74._4_4_ + 1; pppppppbVar5 = local_84; if (0xfff < uVar7) { pppppppbVar5 = (byte *******)local_84[-1]; uVar7 = local_74._4_4_ + 0x24; if (0x1f < (uint)((int)local_84 + (-4 - (int)pppppppbVar5))) goto LAB_00a8a2b8; } operator_delete(pppppppbVar5,uVar7); } local_14._0_1_ = 4; if (0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; psVar3 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar7) { psVar3 = (std_string *)((std_string *)(local_3c._buf._0_4_ + 0xffffffe8))->_capacity; uVar7 = local_3c._capacity + 0x24; if (0x1f < (uint)(local_3c._buf._0_4_ + (-4 - (int)psVar3))) goto LAB_00a8a2b8; } operator_delete(psVar3,uVar7); } local_14._0_1_ = 3; local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf._0_4_ = local_3c._buf._0_4_ & 0xffffff00; if (0xf < local_6c._capacity) { uVar7 = local_6c._capacity + 1; pvVar2 = (void *)local_6c._buf._0_4_; if (0xfff < uVar7) { pvVar2 = *(void **)(local_6c._buf._0_4_ + -4); uVar7 = local_6c._capacity + 0x24; if (0x1f < (uint)(local_6c._buf._0_4_ + (-4 - (int)pvVar2))) { LAB_00a8a2b8: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar7); } psVar3 = std_string_insert(local_b4,0,(byte *)"Initializing Theoraplayer Video Playback Library (" ,0x32); local_9c = *(void **)psVar3->_buf; uStack_98 = *(undefined4 *)(psVar3->_buf + 4); uStack_94 = *(undefined4 *)(psVar3->_buf + 8); uStack_90 = *(undefined4 *)(psVar3->_buf + 0xc); local_8c._0_4_ = psVar3->_size; local_8c._4_4_ = psVar3->_capacity; psVar3->_size = 0; psVar3->_capacity = 0xf; psVar3->_buf[0] = '\0'; local_14._0_1_ = 0xb; puVar4 = std::string::append((char *)&local_9c,&DAT_00ba5d8c,2); local_84 = (byte *******)*puVar4; uStack_80 = puVar4[1]; uStack_7c = puVar4[2]; uStack_78 = puVar4[3]; local_74 = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 0xd; if (0xf < local_8c._4_4_) { uVar7 = local_8c._4_4_ + 1; pvVar2 = local_9c; if (0xfff < uVar7) { pvVar2 = *(void **)((int)local_9c + -4); uVar7 = local_8c._4_4_ + 0x24; if (0x1f < (uint)((int)local_9c + (-4 - (int)pvVar2))) goto LAB_00a8a3d7; } operator_delete(pvVar2,uVar7); } local_8c = 0xf00000000; local_9c = (void *)((uint)local_9c & 0xffffff00); local_14._0_1_ = 0xe; if (0xf < local_a0) { uVar7 = local_a0 + 1; pvVar2 = local_b4[0]; if (0xfff < uVar7) { pvVar2 = *(void **)((int)local_b4[0] + -4); uVar7 = local_a0 + 0x24; if (0x1f < (uint)((int)local_b4[0] + (-4 - (int)pvVar2))) { LAB_00a8a3d7: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar7); } local_a4 = 0; local_a0 = 0xf; local_b4[0] = (void *)((uint)local_b4[0] & 0xffffff00); text = (byte *)FUN_00adbec0(); local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf._0_4_ = (void *)0x0; pbVar6 = text; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); std::string::assign(local_6c._buf,text,(int)pbVar6 - (int)(text + 1)); local_14._0_1_ = 0xf; psVar3 = std_string_insert(&local_6c,0,(byte *)" - libtheora version: ",0x17); local_54 = *(void **)psVar3->_buf; uStack_50 = *(undefined4 *)(psVar3->_buf + 4); uStack_4c = *(undefined4 *)(psVar3->_buf + 8); uStack_48 = *(undefined4 *)(psVar3->_buf + 0xc); local_44._0_4_ = psVar3->_size; local_44._4_4_ = psVar3->_capacity; psVar3->_size = 0; psVar3->_capacity = 0xf; psVar3->_buf[0] = '\0'; local_14._0_1_ = 0x10; puVar4 = std::string::append((char *)&local_54,&DAT_00b66310,1); local_3c._buf._0_4_ = *puVar4; local_3c._buf._4_4_ = puVar4[1]; local_3c._buf._8_4_ = puVar4[2]; local_3c._buf._12_4_ = puVar4[3]; local_3c._16_8_ = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 0x11; psVar3 = &local_3c; if (0xf < local_3c._capacity) { psVar3 = (std_string *)local_3c._buf._0_4_; } std::string::append((char *)&local_84,(byte *)psVar3,local_3c._size); local_14._0_1_ = 0x10; if (0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; psVar3 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar7) { psVar3 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar7 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar3))) goto LAB_00a8a57d; } operator_delete(psVar3,uVar7); } local_14._0_1_ = 0xf; if (0xf < local_44._4_4_) { uVar7 = local_44._4_4_ + 1; pvVar2 = local_54; if (0xfff < uVar7) { pvVar2 = *(void **)((int)local_54 + -4); uVar7 = local_44._4_4_ + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar2))) goto LAB_00a8a57d; } operator_delete(pvVar2,uVar7); } local_14._0_1_ = 0xe; local_44 = 0xf00000000; local_54 = (void *)((uint)local_54 & 0xffffff00); if (0xf < local_6c._capacity) { uVar7 = local_6c._capacity + 1; pvVar2 = (void *)local_6c._buf._0_4_; if (0xfff < uVar7) { pvVar2 = *(void **)(local_6c._buf._0_4_ + -4); uVar7 = local_6c._capacity + 0x24; if (0x1f < (uint)(local_6c._buf._0_4_ + (-4 - (int)pvVar2))) { LAB_00a8a57d: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar7); } local_6c._size = 0; local_6c._capacity = 0xf; local_6c._buf[0] = '\0'; local_6c._buf[1] = '\0'; local_6c._buf[2] = '\0'; local_6c._buf[3] = '\0'; local_6c._buf._0_4_ = std::_Allocate(0x20); local_6c._size = 0x18; local_6c._capacity = 0x1f; builtin_strncpy((char *)local_6c._buf._0_4_,"Xiph.Org libVorbis 1.3.4",0x19); local_14._0_1_ = 0x12; psVar3 = std_string_insert(&local_6c,0,(byte *)" - libvorbis version: ",0x17); local_54 = *(void **)psVar3->_buf; uStack_50 = *(undefined4 *)(psVar3->_buf + 4); uStack_4c = *(undefined4 *)(psVar3->_buf + 8); uStack_48 = *(undefined4 *)(psVar3->_buf + 0xc); local_44._0_4_ = psVar3->_size; local_44._4_4_ = psVar3->_capacity; psVar3->_size = 0; psVar3->_capacity = 0xf; psVar3->_buf[0] = '\0'; local_14._0_1_ = 0x13; puVar4 = std::string::append((char *)&local_54,&DAT_00b66310,1); local_3c._buf._0_4_ = *puVar4; local_3c._buf._4_4_ = puVar4[1]; local_3c._buf._8_4_ = puVar4[2]; local_3c._buf._12_4_ = puVar4[3]; local_3c._16_8_ = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 0x14; psVar3 = &local_3c; if (0xf < local_3c._capacity) { psVar3 = (std_string *)local_3c._buf._0_4_; } std::string::append((char *)&local_84,(byte *)psVar3,local_3c._size); local_14._0_1_ = 0x13; if (0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; psVar3 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar7) { psVar3 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar7 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar3))) goto LAB_00a8a71f; } operator_delete(psVar3,uVar7); } local_14._0_1_ = 0x12; if (0xf < local_44._4_4_) { uVar7 = local_44._4_4_ + 1; pvVar2 = local_54; if (0xfff < uVar7) { pvVar2 = *(void **)((int)local_54 + -4); uVar7 = local_44._4_4_ + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar2))) goto LAB_00a8a71f; } operator_delete(pvVar2,uVar7); } local_14._0_1_ = 0xe; local_44 = 0xf00000000; local_54 = (void *)((uint)local_54 & 0xffffff00); if (0xf < local_6c._capacity) { uVar7 = local_6c._capacity + 1; ptr = (char *)local_6c._buf._0_4_; if (0xfff < uVar7) { ptr = *(char **)(local_6c._buf._0_4_ + -4); uVar7 = local_6c._capacity + 0x24; if ((char *)0x1f < (char *)(local_6c._buf._0_4_ + (-4 - (int)ptr))) { LAB_00a8a71f: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar7); } if (0x7fffffffU - (int)(std_string *)local_74 < 0x24) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } pppppppbVar5 = (byte *******)&local_84; if (0xf < local_74._4_4_) { pppppppbVar5 = local_84; } std::string::concat(local_3c._buf,(int)unused,(std_string *)local_74,(byte *)pppppppbVar5, (uint)(std_string *)local_74,(byte *)"------------------------------------", 0x24); local_14 = CONCAT31(local_14._1_3_,0x15); (*(code *)PTR_FUN_00c5aa7c)(&local_3c); if (0xf < local_3c._capacity) { uVar7 = local_3c._capacity + 1; psVar3 = (std_string *)local_3c._buf._0_4_; if (0xfff < uVar7) { psVar3 = (std_string *)((std_string *)(local_3c._buf._0_4_ + -0x18))->_capacity; uVar7 = local_3c._capacity + 0x24; if ((byte *)0x1f < (byte *)(local_3c._buf._0_4_ + (-4 - (int)psVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar3,uVar7); } if (0xf < local_74._4_4_) { uVar7 = local_74._4_4_ + 1; pppppppbVar5 = local_84; if (0xfff < uVar7) { pppppppbVar5 = (byte *******)local_84[-1]; uVar7 = local_74._4_4_ + 0x24; if ((byte *)0x1f < (byte *)((int)local_84 + (-4 - (int)pppppppbVar5))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pppppppbVar5,uVar7); } ExceptionList = local_1c; return; } //@@ 00a8a810 FUN_00a8a810 void FUN_00a8a810(byte param_1) { int iVar1; undefined4 *puVar2; uint uVar3; undefined4 *in_ECX; int *piVar4; undefined4 *local_18; undefined1 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b02430; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = theoraplayer::Manager::vftable; piVar4 = (int *)in_ECX[1]; if (piVar4 != (int *)in_ECX[2]) { do { iVar1 = *piVar4; *(undefined1 *)(iVar1 + 0x14) = 0; if (*(HANDLE *)(iVar1 + 0x10) != (HANDLE)0x0) { WaitForSingleObject(*(HANDLE *)(iVar1 + 0x10),0xffffffff); if (*(HANDLE *)(iVar1 + 0x10) != (HANDLE)0x0) { CloseHandle(*(HANDLE *)(iVar1 + 0x10)); *(undefined4 *)(iVar1 + 0x10) = 0; } } *(undefined1 *)(iVar1 + 4) = 0; if ((undefined4 *)*piVar4 != (undefined4 *)0x0) { (*(code *)**(undefined4 **)*piVar4)(1,uVar3); } piVar4 = piVar4 + 1; } while (piVar4 != (int *)in_ECX[2]); piVar4 = (int *)in_ECX[1]; } in_ECX[2] = piVar4; puVar2 = (undefined4 *)in_ECX[10]; local_18 = (undefined4 *)0x0; local_14 = 0; if (puVar2 != (undefined4 *)0x0) { local_18 = puVar2; Mutex::lock(puVar2); } piVar4 = (int *)in_ECX[4]; if (piVar4 != (int *)in_ECX[5]) { do { if ((int *)*piVar4 != (int *)0x0) { (**(code **)(*(int *)*piVar4 + 4))(1); } piVar4 = piVar4 + 1; } while (piVar4 != (int *)in_ECX[5]); piVar4 = (int *)in_ECX[4]; } in_ECX[5] = piVar4; if (local_18 != (undefined4 *)0x0) { *(undefined1 *)(local_18 + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_18); local_18 = (undefined4 *)0x0; } puVar2 = (undefined4 *)in_ECX[10]; if (puVar2 != (undefined4 *)0x0) { DeleteCriticalSection((LPCRITICAL_SECTION)*puVar2); free((void *)*puVar2); operator_delete(puVar2,8); } Mutex::ScopeLock::~ScopeLock(&local_18); FUN_00498f80(); FID_conflict__Tidy(in_ECX + 4); FID_conflict__Tidy(in_ECX + 1); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x30); } ExceptionList = local_10; return; } //@@ 00a8a970 FUN_00a8a970 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a8a970(void) { undefined4 *puVar1; void *pvVar2; uint uVar3; std_string *psVar4; void *pvVar5; int iVar6; int local_58; void *local_54 [4]; uint local_44; uint local_40; void *local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; pvVar2 = g_theoraVideoManager; puStack_20 = (undefined1 *)(local_54 + 0x14); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00afdee5; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_54 + 0x11); ExceptionList = &local_1c; local_58 = *(int *)((int)g_theoraVideoManager + 8) - *(int *)((int)g_theoraVideoManager + 4) >> 2; if (local_58 != 1) { local_24 = uVar3; psVar4 = int_to_string((std_string *)local_54,1); local_14 = (void *)0x0; psVar4 = std_string_insert(psVar4,0,(byte *)"Changing number of worker threads to: ",0x26); local_3c = *(void **)psVar4->_buf; uStack_38 = *(undefined4 *)(psVar4->_buf + 4); uStack_34 = *(undefined4 *)(psVar4->_buf + 8); uStack_30 = *(undefined4 *)(psVar4->_buf + 0xc); local_2c._0_4_ = psVar4->_size; local_2c._4_4_ = psVar4->_capacity; psVar4->_size = 0; psVar4->_capacity = 0xf; psVar4->_buf[0] = '\0'; local_14._0_1_ = 1; (*(code *)PTR_FUN_00c5aa7c)(&local_3c,uVar3); local_14 = (void *)((uint)local_14._1_3_ << 8); if (0xf < local_2c._4_4_) { uVar3 = local_2c._4_4_ + 1; pvVar5 = local_3c; if (0xfff < uVar3) { pvVar5 = *(void **)((int)local_3c + -4); uVar3 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar5))) goto LAB_00a8aaa5; } operator_delete(pvVar5,uVar3); } local_14 = (void *)0xffffffff; local_2c = 0xf00000000; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_40) { uVar3 = local_40 + 1; pvVar5 = local_54[0]; if (0xfff < uVar3) { pvVar5 = *(void **)((int)local_54[0] + -4); uVar3 = local_40 + 0x24; if (0x1f < (uint)((int)local_54[0] + (-4 - (int)pvVar5))) { LAB_00a8aaa5: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar5,uVar3); } local_44 = 0; local_40 = 0xf; local_54[0] = (void *)((uint)local_54[0] & 0xffffff00); if (local_58 < 1) { TheoraVideoManager::createWorkerThreads(1 - local_58); } else { local_58 = local_58 + -1; if (0 < local_58) { iVar6 = *(int *)((int)pvVar2 + 8); do { puVar1 = *(undefined4 **)(iVar6 + -4); *(undefined1 *)(puVar1 + 5) = 0; if ((HANDLE)puVar1[4] != (HANDLE)0x0) { WaitForSingleObject((HANDLE)puVar1[4],0xffffffff); if ((HANDLE)puVar1[4] != (HANDLE)0x0) { CloseHandle((HANDLE)puVar1[4]); puVar1[4] = 0; } } *(undefined1 *)(puVar1 + 1) = 0; (**(code **)*puVar1)(1); *(int *)((int)pvVar2 + 8) = *(int *)((int)pvVar2 + 8) + -4; local_58 = local_58 + -1; iVar6 = *(int *)((int)pvVar2 + 8); } while (0 < local_58); } } } ExceptionList = local_1c; return; } //@@ 00a8ab60 theora_create_video_clip /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? theoraplayer strings "Creating video from data source"; ZHL called it Menu_Game::Update */ int * __thiscall theora_create_video_clip(undefined4 param_1,int *param_2) { uint *puVar1; byte bVar2; std_string *psVar3; void *pvVar4; std_string *psVar5; undefined4 *puVar6; byte *b; byte ****ppppbVar7; uint uVar8; byte *pbVar9; int *piVar10; uint uStack_104; undefined4 *local_f0; undefined1 local_ec; void *local_e8; int *local_e4; int *local_e0; void *local_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined8 local_b0; void *local_a8 [5]; uint local_94; void *local_90 [4]; undefined4 local_80; uint local_7c; void *local_78 [4]; undefined4 local_68; uint local_64; void *local_60; undefined4 uStack_5c; undefined4 uStack_58; undefined4 uStack_54; undefined4 local_50; uint uStack_4c; byte ****local_48 [4]; uint local_38; uint local_34; void *local_30; undefined4 uStack_2c; undefined4 uStack_28; undefined4 uStack_24; undefined8 local_20; uint local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; byte ***local_8; pvVar4 = g_theoraVideoManager; local_8 = (byte ***)0xffffffff; puStack_c = &LAB_00b14934; local_10 = ExceptionList; uStack_104 = __security_cookie ^ (uint)(local_48 + 0x11); local_14 = (undefined1 *)&uStack_104; ExceptionList = &local_10; local_e0 = param_2; local_e8 = g_theoraVideoManager; puVar6 = *(undefined4 **)((int)g_theoraVideoManager + 0x28); local_f0 = (undefined4 *)0x0; local_ec = 0; local_18 = uStack_104; puVar1 = &uStack_104; if (puVar6 != (undefined4 *)0x0) { local_f0 = puVar6; Mutex::lock(puVar6); puVar1 = (uint *)local_14; } local_14 = (undefined1 *)puVar1; local_8 = (byte ***)0x0; local_e4 = *(int **)((int)pvVar4 + 0x24); piVar10 = (int *)0x0; psVar3 = int_to_string((std_string *)local_a8,(int)local_e4); local_8._0_1_ = 1; pvVar4 = (void *)(**(code **)(*local_e0 + 0x18))(local_90); local_8._0_1_ = 2; psVar5 = std_string_insert(pvVar4,0,(byte *)"Creating video from data source: ",0x21); local_30 = *(void **)psVar5->_buf; uStack_2c = *(undefined4 *)(psVar5->_buf + 4); uStack_28 = *(undefined4 *)(psVar5->_buf + 8); uStack_24 = *(undefined4 *)(psVar5->_buf + 0xc); local_20._0_4_ = psVar5->_size; local_20._4_4_ = psVar5->_capacity; psVar5->_size = 0; psVar5->_capacity = 0xf; psVar5->_buf[0] = '\0'; local_8._0_1_ = 3; puVar6 = std::string::append((char *)&local_30,&DAT_00ba5d50,2); local_c0 = (void *)*puVar6; uStack_bc = puVar6[1]; uStack_b8 = puVar6[2]; uStack_b4 = puVar6[3]; local_b0 = *(undefined8 *)(puVar6 + 4); puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_8._0_1_ = 4; std::string::concat_move((char *)local_78,(int)local_e8,&local_c0,psVar3); local_8._0_1_ = 5; puVar6 = std::string::append((char *)local_78,(byte *)" precached frames].",0x13); local_60 = (void *)*puVar6; uStack_5c = puVar6[1]; uStack_58 = puVar6[2]; uStack_54 = puVar6[3]; local_50 = puVar6[4]; uStack_4c = puVar6[5]; puVar6[4] = 0; puVar6[5] = 0xf; *(undefined1 *)puVar6 = 0; local_8._0_1_ = 6; (*(code *)PTR_FUN_00c5aa7c)(&local_60); local_8._0_1_ = 5; if (0xf < uStack_4c) { uVar8 = uStack_4c + 1; pvVar4 = local_60; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_60 + -4); uVar8 = uStack_4c + 0x24; if (0x1f < (uint)((int)local_60 + (-4 - (int)pvVar4))) goto LAB_00a8ae70; } operator_delete(pvVar4,uVar8); } local_8._0_1_ = 4; local_50 = 0; uStack_4c = 0xf; local_60 = (void *)((uint)local_60 & 0xffffff00); if (0xf < local_64) { uVar8 = local_64 + 1; pvVar4 = local_78[0]; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_78[0] + -4); uVar8 = local_64 + 0x24; if (0x1f < (uint)((int)local_78[0] + (-4 - (int)pvVar4))) goto LAB_00a8ae70; } operator_delete(pvVar4,uVar8); } local_8._0_1_ = 3; local_68 = 0; local_64 = 0xf; local_78[0] = (void *)((uint)local_78[0] & 0xffffff00); if (0xf < local_b0._4_4_) { uVar8 = local_b0._4_4_ + 1; pvVar4 = local_c0; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_c0 + -4); uVar8 = local_b0._4_4_ + 0x24; if (0x1f < (uint)((int)local_c0 + (-4 - (int)pvVar4))) goto LAB_00a8ae70; } operator_delete(pvVar4,uVar8); } local_8._0_1_ = 2; if (0xf < local_20._4_4_) { uVar8 = local_20._4_4_ + 1; pvVar4 = local_30; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_30 + -4); uVar8 = local_20._4_4_ + 0x24; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar4))) goto LAB_00a8ae70; } operator_delete(pvVar4,uVar8); } local_8._0_1_ = 1; local_20 = 0xf00000000; local_30 = (void *)((uint)local_30 & 0xffffff00); if (0xf < local_7c) { uVar8 = local_7c + 1; pvVar4 = local_90[0]; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_90[0] + -4); uVar8 = local_7c + 0x24; if (0x1f < (uint)((int)local_90[0] + (-4 - (int)pvVar4))) goto LAB_00a8ae70; } operator_delete(pvVar4,uVar8); } local_8._0_1_ = 0; local_80 = 0; local_7c = 0xf; local_90[0] = (void *)((uint)local_90[0] & 0xffffff00); if (0xf < local_94) { uVar8 = local_94 + 1; pvVar4 = local_a8[0]; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_a8[0] + -4); uVar8 = local_94 + 0x24; if (0x1f < (uint)((int)local_a8[0] + (-4 - (int)pvVar4))) { LAB_00a8ae70: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar8); } (**(code **)(*local_e0 + 4))(local_48); local_8 = (byte ***)CONCAT31(local_8._1_3_,7); ppppbVar7 = (byte ****)local_48; if (0xf < local_34) { ppppbVar7 = local_48[0]; } bVar2 = str_eq((byte *)ppppbVar7,local_38,&s_empty,0); if ((bVar2 == 0) && (pbVar9 = DAT_00c79be0, DAT_00c79be0 != DAT_00c79be4)) { do { b = pbVar9; if (0xf < *(uint *)(pbVar9 + 0x14)) { b = *(byte **)pbVar9; } ppppbVar7 = (byte ****)local_48; if (0xf < local_34) { ppppbVar7 = local_48[0]; } bVar2 = str_eq((byte *)ppppbVar7,local_38,b,*(uint *)(pbVar9 + 0x10)); if (bVar2 != 0) { piVar10 = (int *)(**(code **)(pbVar9 + 0x30))(local_e0,1,local_e4,0); local_e4 = piVar10; if (piVar10 != (int *)0x0) { local_8 = (byte ***)CONCAT31(local_8._1_3_,8); (**(code **)(*piVar10 + 8))(local_e0); local_8 = (byte ***)0x7; (**(code **)(*piVar10 + 0x10))(); puVar6 = *(undefined4 **)((int)local_e8 + 0x14); if (puVar6 == *(undefined4 **)((int)local_e8 + 0x18)) { std::vector<4byte>::_Emplace_reallocate(puVar6,&local_e4); } else { *puVar6 = piVar10; *(int *)((int)local_e8 + 0x14) = *(int *)((int)local_e8 + 0x14) + 4; } goto LAB_00a8b05e; } break; } pbVar9 = pbVar9 + 0x34; } while (pbVar9 != DAT_00c79be4); } pvVar4 = (void *)(**(code **)(*local_e0 + 0x18))((std_string *)local_a8); local_8._0_1_ = 10; psVar3 = std_string_insert(pvVar4,0,(byte *)"ERROR: Failed creating video clip: ",0x23); local_30 = *(void **)psVar3->_buf; uStack_2c = *(undefined4 *)(psVar3->_buf + 4); uStack_28 = *(undefined4 *)(psVar3->_buf + 8); uStack_24 = *(undefined4 *)(psVar3->_buf + 0xc); local_20._0_4_ = psVar3->_size; local_20._4_4_ = psVar3->_capacity; psVar3->_size = 0; psVar3->_capacity = 0xf; psVar3->_buf[0] = '\0'; local_8 = (byte ***)CONCAT31(local_8._1_3_,0xb); (*(code *)PTR_FUN_00c5aa7c)(&local_30); if (0xf < local_20._4_4_) { uVar8 = local_20._4_4_ + 1; pvVar4 = local_30; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_30 + -4); uVar8 = local_20._4_4_ + 0x24; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar4))) goto LAB_00a8afdf; } operator_delete(pvVar4,uVar8); } local_20 = 0xf00000000; local_30 = (void *)((uint)local_30 & 0xffffff00); if (0xf < local_94) { uVar8 = local_94 + 1; pvVar4 = local_a8[0]; if (0xfff < uVar8) { pvVar4 = *(void **)((int)local_a8[0] + -4); uVar8 = local_94 + 0x24; if (0x1f < (uint)((int)local_a8[0] + (-4 - (int)pvVar4))) { LAB_00a8afdf: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar4,uVar8); } LAB_00a8b05e: if (local_f0 != (undefined4 *)0x0) { *(undefined1 *)(local_f0 + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_f0); local_f0 = (undefined4 *)0x0; } if (0xf < local_34) { uVar8 = local_34 + 1; ppppbVar7 = local_48[0]; if (0xfff < uVar8) { ppppbVar7 = (byte ****)local_48[0][-1]; uVar8 = local_34 + 0x24; if ((byte *)0x1f < (byte *)((int)local_48[0] + (-4 - (int)ppppbVar7))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ppppbVar7,uVar8); } local_38 = 0; local_34 = 0xf; local_48[0] = (byte ****)((uint)local_48[0] & 0xffffff00); Mutex::ScopeLock::~ScopeLock(&local_f0); ExceptionList = local_10; return piVar10; } //@@ 00a8b0f1 Catch@00a8b0f1 void Catch_00a8b0f1(void) { int unaff_EBP; (**(code **)(**(int **)(unaff_EBP + -0xe0) + 4))(1); FUN_00a8b130(*(undefined4 *)(unaff_EBP + -0xf0)); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)(unaff_EBP + -0xd8),(ThrowInfo *)&DAT_00bd5d50); } //@@ 00a8b130 FUN_00a8b130 void FUN_00a8b130(int param_1) { undefined4 *in_ECX; *in_ECX = theoraplayer::_Exception::vftable; std::string::string((char *)(in_ECX + 1),(void *)(param_1 + 4)); return; } //@@ 00a8b160 FUN_00a8b160 void FUN_00a8b160(byte param_1) { undefined4 *in_ECX; *in_ECX = theoraplayer::_Exception::vftable; std::string::_Tidy_deallocate((char *)(in_ECX + 1)); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x1c); } return; } //@@ 00a8b190 TheoraVideoManager::destroyVideoClip /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: strings "Destroying video clip: ", " - Waiting for WorkerThread to finish decoding in order to destroy", " - WorkerThread done, destroying clip now..."; removes the clip from the manager list and deletes it; Manager::update_state_loading prototype: db/protos.zhl, confirmed by RET 4 */ void TheoraVideoManager::destroyVideoClip(void *clip) { undefined4 **ppuVar1; undefined4 *puVar2; int *piVar3; undefined4 *puVar4; int *_Dst; void *pvVar5; uint uVar6; std_string *psVar7; void *pvVar8; char *pcVar9; undefined4 **ppuVar10; void *local_7c; undefined1 local_78; undefined4 **local_74; char local_6d; void *local_6c [4]; undefined4 local_5c; uint local_58; void *local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; uint local_44; uint uStack_40; char *local_3c [3]; undefined4 *local_30; undefined4 *local_2c; undefined4 **local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; pvVar5 = g_theoraVideoManager; puStack_20 = (undefined1 *)(local_3c + 0xe); local_14 = (char *)0xffffffff; puStack_18 = &LAB_00b1498d; local_1c = ExceptionList; uVar6 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; if (clip != (void *)0x0) { local_24 = uVar6; std::string::string((char *)local_6c,(void *)((int)clip + 4)); local_14 = (char *)0x0; psVar7 = std_string_insert(local_6c,0,(byte *)"Destroying video clip: ",0x17); local_54 = *(void **)psVar7->_buf; uStack_50 = *(undefined4 *)(psVar7->_buf + 4); uStack_4c = *(undefined4 *)(psVar7->_buf + 8); uStack_48 = *(undefined4 *)(psVar7->_buf + 0xc); local_44 = psVar7->_size; uStack_40 = psVar7->_capacity; psVar7->_size = 0; psVar7->_capacity = 0xf; psVar7->_buf[0] = '\0'; local_14._0_1_ = 1; (*(code *)PTR_FUN_00c5aa7c)(&local_54,uVar6); local_14 = (char *)((uint)local_14._1_3_ << 8); if (0xf < uStack_40) { uVar6 = uStack_40 + 1; pvVar8 = local_54; if (0xfff < uVar6) { pvVar8 = *(void **)((int)local_54 + -4); uVar6 = uStack_40 + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar8))) goto LAB_00a8b2be; } operator_delete(pvVar8,uVar6); } local_14 = (char *)0xffffffff; local_44 = 0; uStack_40 = 0xf; local_54 = (void *)((uint)local_54 & 0xffffff00); if (0xf < local_58) { uVar6 = local_58 + 1; pvVar8 = local_6c[0]; if (0xfff < uVar6) { pvVar8 = *(void **)((int)local_6c[0] + -4); uVar6 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar8))) { LAB_00a8b2be: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar6); } pvVar8 = *(void **)((int)pvVar5 + 0x28); local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); local_7c = (void *)0x0; local_78 = 0; if (pvVar8 != (void *)0x0) { local_7c = pvVar8; Mutex::lock(pvVar8); } local_14 = (char *)0x2; local_6d = '\0'; if (*(int *)((int)clip + 0x30) != 0) { do { if (local_6d == '\0') { local_2c = (undefined4 *)0x0; local_28 = (undefined4 **)0xf; local_3c[0] = (char *)0x0; local_3c[0] = std::_Allocate(0x50); local_2c = (undefined4 *)0x42; local_28 = (undefined4 **)0x4f; builtin_strncpy(local_3c[0], " - Waiting for WorkerThread to finish decoding in order to destroy",0x43) ; local_14._0_1_ = 3; (*(code *)PTR_FUN_00c5aa7c)(local_3c); local_14 = (char *)CONCAT31(local_14._1_3_,2); if (0xf < local_28) { uVar6 = (int)local_28 + 1; pcVar9 = local_3c[0]; if (0xfff < uVar6) { pcVar9 = *(char **)(local_3c[0] + -4); uVar6 = (int)local_28 + 0x24; if ((char *)0x1f < local_3c[0] + (-4 - (int)pcVar9)) goto LAB_00a8b2be; } operator_delete(pcVar9,uVar6); } local_6d = '\x01'; } Sleep(1); } while (*(int *)((int)clip + 0x30) != 0); if (local_6d != '\0') { local_2c = (undefined4 *)0x0; local_28 = (undefined4 **)0xf; local_3c[0] = (char *)0x0; local_3c[0] = std::_Allocate(0x30); local_2c = (undefined4 *)0x2c; local_28 = (undefined4 **)0x2f; builtin_strncpy(local_3c[0]," - WorkerThread done, destroying clip now...",0x2d); local_14._0_1_ = 4; (*(code *)PTR_FUN_00c5aa7c)(local_3c); local_14 = (char *)CONCAT31(local_14._1_3_,2); if (0xf < local_28) { uVar6 = (int)local_28 + 1; pcVar9 = local_3c[0]; if (0xfff < uVar6) { pcVar9 = *(char **)(local_3c[0] + -4); uVar6 = (int)local_28 + 0x24; if ((char *)0x1f < local_3c[0] + (-4 - (int)pcVar9)) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar9,uVar6); } } } piVar3 = *(int **)((int)pvVar5 + 0x10); do { _Dst = piVar3; if (_Dst == *(int **)((int)pvVar5 + 0x14)) goto LAB_00a8b4d0; piVar3 = _Dst + 1; } while ((void *)*_Dst != clip); memmove(_Dst,piVar3,(int)*(int **)((int)pvVar5 + 0x14) - (int)piVar3); *(int *)((int)pvVar5 + 0x14) = *(int *)((int)pvVar5 + 0x14) + -4; LAB_00a8b4d0: local_30 = (undefined4 *)((int)pvVar5 + 0x1c); local_74 = (undefined4 **)*local_30; local_28 = &local_2c; local_2c = (undefined4 *)0x0; puVar2 = local_2c; if ((undefined4 **)*local_74 != local_74) { ppuVar10 = (undefined4 **)*local_74; do { ppuVar1 = (undefined4 **)*ppuVar10; if (ppuVar10[2] == clip) { *(int *)((int)pvVar5 + 0x20) = *(int *)((int)pvVar5 + 0x20) + -1; puVar2 = *ppuVar10; *ppuVar10 = (undefined4 *)0x0; piVar3 = ppuVar10[1]; *piVar3 = (int)puVar2; puVar2[1] = piVar3; *local_28 = ppuVar10; local_28 = ppuVar10; } ppuVar10 = ppuVar1; puVar2 = local_2c; } while (ppuVar1 != local_74); } while (puVar2 != (undefined4 *)0x0) { puVar4 = (undefined4 *)*puVar2; operator_delete(puVar2,0xc); puVar2 = puVar4; } (**(code **)(*(int *)clip + 4))(1); Mutex::ScopeLock::~ScopeLock(&local_7c); } ExceptionList = local_1c; return; } //@@ 00a8b570 TheoraVideoManager::createWorkerThreads /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: theoraplayer: (n) loop allocating 0x20-byte worker thread objects named "Theoraplayer Worker Thread", starting them ("WARNING: Thread ... already running, cannot start!") and pushing into the manager vector; caller 00a8a970 (TheoraVideoManager init, next to TheoraVideoManager::destroyVideoClip) */ void TheoraVideoManager::createWorkerThreads(int param_1) { byte bVar1; qword qVar2; uint uVar3; undefined4 *puVar4; HANDLE pvVar5; int in_ECX; byte *pbVar6; void *ptr; uint size; int *piVar7; undefined4 *puVar8; qword *pqVar9; undefined4 *local_438 [2]; int local_430; void *local_42c [4]; undefined4 local_41c; uint local_418; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b149d0; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; local_430 = 0; local_14 = uVar3; if (0 < param_1) { do { if (g_mainHeap == (void *)0x0) { pqVar9 = &g_allocatedBytesNoHeap; } else { pqVar9 = (qword *)((int)g_mainHeap + 0x30); } puVar4 = malloc(0x20); if (puVar4 == (undefined4 *)0x0) { piVar7 = *(int **)g_memoryManager_oomHandlers; if (piVar7 != g_memoryManager_oomHandlers) { do { (*(code *)piVar7[2])(0x7fcb9dd6,piVar7[3],uVar3); piVar7 = (int *)*piVar7; } while (piVar7 != g_memoryManager_oomHandlers); } LAB_00a8b601: puVar8 = (undefined4 *)0x0; } else { *puVar4 = 0x20; qVar2 = *pqVar9; *(uint *)pqVar9 = (uint)*pqVar9 + 0x20; *(uint *)((int)pqVar9 + 4) = *(uint *)((int)pqVar9 + 4) + (uint)(0xffffffdf < (uint)qVar2); puVar8 = puVar4 + 1; if (puVar8 == (undefined4 *)0x0) goto LAB_00a8b601; *puVar8 = theoraplayer::Thread::vftable; *(undefined1 *)(puVar4 + 2) = 0; puVar4[3] = puVar8; puVar4[5] = 0; *(undefined1 *)(puVar4 + 6) = 0; puVar4[4] = FUN_00aaad10; *puVar8 = theoraplayer::WorkerThread::vftable; puVar4[7] = 0; } puVar4 = *(undefined4 **)(in_ECX + 8); local_438[0] = puVar8; if (puVar4 == *(undefined4 **)(in_ECX + 0xc)) { std::vector<4byte>::_Emplace_reallocate(puVar4,local_438); } else { *puVar4 = puVar8; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + 4; } if (*(char *)(puVar8 + 5) == '\0') { *(undefined1 *)(puVar8 + 5) = 1; if ((HANDLE)puVar8[4] != (HANDLE)0x0) { CloseHandle((HANDLE)puVar8[4]); puVar8[4] = 0; } pvVar5 = CreateThread((LPSECURITY_ATTRIBUTES)0x0,0,FUN_00aab120,puVar8 + 2,0,(LPDWORD)0x0); puVar8[4] = pvVar5; } else { memset(local_414,0,0x400); sprintf(local_414,(byte *)"WARNING: Thread \'%s\' \'<0x%p>\' already running, cannot start!" ); pbVar6 = local_414; local_41c = 0; local_418 = 0xf; local_42c[0] = (void *)0x0; do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; } while (bVar1 != 0); std::string::assign((char *)local_42c,local_414,(int)pbVar6 - (int)(local_414 + 1)); local_8 = 0; (*(code *)PTR_FUN_00c5aa7c)(local_42c); local_8 = 0xffffffff; if (0xf < local_418) { size = local_418 + 1; ptr = local_42c[0]; if (0xfff < size) { ptr = *(void **)((int)local_42c[0] + -4); size = local_418 + 0x24; if (0x1f < (uint)((int)local_42c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } local_41c = 0; local_418 = 0xf; local_42c[0] = (void *)((uint)local_42c[0] & 0xffffff00); } local_430 = local_430 + 1; } while (local_430 < param_1); } ExceptionList = local_10; return; } //@@ 00a8b7d0 TheoraVideoManager::requestWork /* DB: libtheoraplayer: reads g_theoraVideoManager, locks its mutex (+0x28), iterates clips (+0x10..+0x14) scoring by queued frames/priority into vector<20byte>, returns chosen clip; only caller FUN_00aaad10 worker-thread loop (Sleep(100) when null) */ int TheoraVideoManager::requestWork(undefined4 param_1) { void *pvVar1; undefined4 *puVar2; int iVar3; char cVar4; uint uVar5; int *piVar6; int *piVar7; int iVar8; void *pvVar9; int *piVar10; float10 fVar11; float fVar12; undefined1 *puVar13; float fVar14; int local_58; int iStack_54; float fStack_50; float fStack_4c; int local_48; int *local_44; int *local_40; int *local_3c; void *local_38; undefined1 local_34; undefined4 *local_30; float local_2c; int *local_28; int local_24; uint local_20; void *local_1c; int *local_18; float local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; pvVar9 = g_theoraVideoManager; local_8 = 0xffffffff; puStack_c = &LAB_00b14a1d; local_10 = ExceptionList; uVar5 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_1c = g_theoraVideoManager; local_38 = (void *)0x0; local_34 = 0; pvVar1 = *(void **)((int)g_theoraVideoManager + 0x28); if (pvVar1 != (void *)0x0) { local_38 = pvVar1; Mutex::lock(pvVar1); } local_24 = 0; local_18 = (int *)0x0; piVar10 = (int *)0x0; local_14 = 0.0; local_44 = (int *)0x0; local_40 = (int *)0x0; local_28 = (int *)0x0; local_3c = (int *)0x0; local_8 = 1; local_20 = 0; do { iVar8 = (int)piVar10 - (int)local_18 >> 0x1f; if (((int)piVar10 - (int)local_18) / 0x14 + iVar8 != iVar8) break; piVar7 = *(int **)((int)pvVar9 + 0x10); if (piVar7 != *(int **)((int)local_1c + 0x14)) { do { iVar8 = *piVar7; if (*(int *)(iVar8 + 0x30) == 0) { if (*(int *)(iVar8 + 0x50) == *(int *)(iVar8 + 0x8c)) { if (((int)local_20 < 1) && (cVar4 = (**(code **)(**(int **)(iVar8 + 0x28) + 0x10))(uVar5), cVar4 == '\0')) { if (*(char *)(*piVar7 + 0x75) != '\0') goto LAB_00a8b968; } iVar8 = *piVar7; if (*(int *)(iVar8 + 0x88) == -1) { local_18 = (int *)FUN_00aaa4a0(); iVar8 = *piVar7; } else { local_18 = (int *)0x0; } if (local_18 != *(int **)(*(int *)(iVar8 + 0x1c) + 4)) { iStack_54 = *(int *)(iVar8 + 0x54); local_58 = iVar8; fVar11 = (float10)(**(code **)(**(int **)(iVar8 + 0x28) + 8))(); local_2c = (float)fVar11; iVar8 = *(int *)(*piVar7 + 0x3c); local_24 = local_24 + iVar8; fStack_50 = (float)(int)local_18 / (local_2c * *(float *)(*piVar7 + 0x70)); fVar14 = fStack_50; if (fStack_50 <= local_14) { fVar14 = local_14; } fStack_4c = (float)iVar8; local_14 = fVar14; if (piVar10 == local_28) { std::vector<20byte>::_Emplace_reallocate(piVar10,&local_58); local_28 = local_3c; piVar10 = local_40; } else { *piVar10 = local_58; piVar10[1] = iStack_54; piVar10[2] = (int)fStack_50; piVar10[3] = (int)fStack_4c; piVar10[4] = local_48; local_40 = piVar10 + 5; piVar10 = local_40; } } } } LAB_00a8b968: piVar7 = piVar7 + 1; } while (piVar7 != *(int **)((int)local_1c + 0x14)); local_18 = local_44; } local_20 = local_20 + 1; pvVar9 = local_1c; } while ((int)local_20 < 2); pvVar1 = local_1c; fVar14 = 0.0; if (local_24 == 0) { local_24 = 1; } if (local_14 == 0.0) { local_14 = 1.0; } piVar7 = local_18; if (local_18 != piVar10) { piVar6 = local_18; do { piVar6[3] = (int)((float)piVar6[3] / (float)local_24); fVar12 = (1.0 - ((float)piVar6[2] / local_14) * 0.5) * (float)piVar6[1]; piVar6[1] = (int)fVar12; fVar14 = fVar14 + fVar12; piVar6 = piVar6 + 5; } while (piVar6 != piVar10); } for (; piVar7 != piVar10; piVar7 = piVar7 + 5) { piVar7[4] = (int)((float)piVar7[1] / fVar14); } puVar13 = &DAT_bf800000; iVar8 = 0; local_24 = 0; piVar7 = local_18; if (local_18 != piVar10) { do { if ((float)puVar13 < (float)piVar7[4] - (float)piVar7[3]) { iVar8 = *piVar7; puVar13 = (undefined1 *)((float)piVar7[4] - (float)piVar7[3]); } piVar7 = piVar7 + 5; } while (piVar7 != piVar10); local_24 = iVar8; if (iVar8 != 0) { *(undefined4 *)(iVar8 + 0x30) = param_1; iVar8 = *(int *)((int)local_1c + 0x14) - *(int *)((int)local_1c + 0x10) >> 2; local_20 = (iVar8 + -1) * 0x32; if (1 < iVar8) { local_30 = (undefined4 *)((int)local_1c + 0x1c); iVar8 = *(int *)*local_30; if (*(int *)((int)local_1c + 0x20) == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = CONCAT31(local_8._1_3_,2); local_2c = 0.0; piVar10 = operator_new(0xc); piVar10[2] = local_24; *(int *)((int)pvVar1 + 0x20) = *(int *)((int)pvVar1 + 0x20) + 1; puVar2 = *(undefined4 **)(iVar8 + 4); *piVar10 = iVar8; piVar10[1] = (int)puVar2; *(int **)(iVar8 + 4) = piVar10; *puVar2 = piVar10; *(int *)(local_24 + 0x3c) = *(int *)(local_24 + 0x3c) + 1; } if (local_20 < *(uint *)((int)pvVar1 + 0x20)) { do { piVar10 = *(int **)(*(int *)((int)pvVar1 + 0x1c) + 4); iVar8 = piVar10[2]; iVar3 = *piVar10; *(int *)((int)pvVar1 + 0x20) = *(int *)((int)pvVar1 + 0x20) + -1; *(int *)piVar10[1] = iVar3; *(int *)(iVar3 + 4) = piVar10[1]; operator_delete(piVar10,0xc); *(int *)(iVar8 + 0x3c) = *(int *)(iVar8 + 0x3c) + -1; } while (local_20 < *(uint *)((int)pvVar1 + 0x20)); } } } if (local_18 != (int *)0x0) { uVar5 = (((int)local_28 - (int)local_18) / 0x14) * 0x14; piVar10 = local_18; if (0xfff < uVar5) { piVar10 = (int *)local_18[-1]; uVar5 = uVar5 + 0x23; if (0x1f < (uint)((int)local_18 + (-4 - (int)piVar10))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(piVar10,uVar5); } Mutex::ScopeLock::~ScopeLock(&local_38); ExceptionList = local_10; return local_24; } //@@ 00a8bba0 std::_Facet_base::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::_Facet_base::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::_Facet_base::_scalar_deleting_destructor_(_Facet_base *this,uint param_1) { *(undefined ***)this = theoraplayer::AudioInterfaceFactory::vftable; if ((param_1 & 1) != 0) { operator_delete(this,4); } return this; } //@@ 00a8bbd0 FUN_00a8bbd0 void FUN_00a8bbd0(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::System::TheoraDataSourceKAGE::vftable; if ((undefined4 *)in_ECX[7] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX[7])(1,uVar1); in_ECX[7] = 0; } std::string::assign((char *)(in_ECX + 1),&s_empty,0); std::string::_Tidy_deallocate((char *)(in_ECX + 1)); *in_ECX = theoraplayer::DataSource::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x20); } ExceptionList = local_10; return; } //@@ 00a8bc60 FUN_00a8bc60 undefined4 FUN_00a8bc60(undefined4 param_1,undefined4 param_2) { undefined4 uVar1; int in_ECX; if (*(int **)(in_ECX + 0x1c) == (int *)0x0) { return 0; } uVar1 = (**(code **)(**(int **)(in_ECX + 0x1c) + 0x14))(param_1,1,param_2); return uVar1; } //@@ 00a8bc90 FUN_00a8bc90 void FUN_00a8bc90(undefined4 param_1) { int in_ECX; if (*(int **)(in_ECX + 0x1c) != (int *)0x0) { (**(code **)(**(int **)(in_ECX + 0x1c) + 0xc))(param_1,0); } return; } //@@ 00a8bcb0 FUN_00a8bcb0 undefined4 FUN_00a8bcb0(void) { undefined4 uVar1; int in_ECX; if (*(int **)(in_ECX + 0x1c) == (int *)0x0) { return 0; } uVar1 = (**(code **)(**(int **)(in_ECX + 0x1c) + 8))(); return uVar1; } //@@ 00a8bcd0 FUN_00a8bcd0 undefined4 FUN_00a8bcd0(void) { undefined4 uVar1; int in_ECX; if (*(int **)(in_ECX + 0x1c) == (int *)0x0) { return 0; } uVar1 = (**(code **)(**(int **)(in_ECX + 0x1c) + 4))(); return uVar1; } //@@ 00a8bcf0 FUN_00a8bcf0 undefined4 * FUN_00a8bcf0(undefined4 *param_1) { *param_1 = 0; param_1[4] = 0; param_1[5] = 0xf; *(undefined1 *)param_1 = 0; param_1[4] = 6; memmove(param_1,"Theora",6); *(undefined1 *)((int)param_1 + 6) = 0; return param_1; } //@@ 00a8bd30 FUN_00a8bd30 void FUN_00a8bd30(byte param_1) { int *piVar1; uint uVar2; int iVar3; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af6790; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::System::TheoraAudioInterfaceKAGE::vftable; in_ECX[4] = KAGE::System::TheoraAudioInterfaceKAGE::vftable; if ((void *)in_ECX[0xb] != (void *)0x0) { local_8 = 1; tracked_alloc(1,(void *)in_ECX[0xb],0); local_8 = local_8 & 0xffffff00; in_ECX[0xb] = 0; } if (in_ECX[8] != 0) { alDeleteSources(1,in_ECX + 8,uVar2); } if (in_ECX[0x13] != 0) { while( true ) { alDeleteBuffers(1,*(int *)(in_ECX[0x10] + ((uint)in_ECX[0x12] >> 1 & in_ECX[0x11] - 1) * 4) + (in_ECX[0x12] & 1) * 8); piVar1 = in_ECX + 0x13; *piVar1 = *piVar1 + -1; if (*piVar1 == 0) break; in_ECX[0x12] = in_ECX[0x12] + 1; } in_ECX[0x12] = 0; } iVar3 = alGetError(); if (iVar3 != 0) { KAGE_LogMessage(1,(byte *)"Error destroying Theora Audio Interface: %d\n"); } std::deque<4byte>::~deque(); in_ECX[4] = theoraplayer::Timer::vftable; *in_ECX = theoraplayer::AudioInterface::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x50); } ExceptionList = local_10; return; } //@@ 00a8be40 FUN_00a8be40 void FUN_00a8be40(float param_1) { int iVar1; int in_ECX; int iVar2; float fVar3; int local_8; if (*(int *)(in_ECX + 0x10) != 0) { local_8 = in_ECX; alGetSourcei(*(int *)(in_ECX + 0x10),0x1016,&local_8); iVar2 = 0; if (0 < local_8) { do { iVar1 = (**(code **)(*(int *)(in_ECX + -0x10) + 0xc))(); *(int *)(in_ECX + 0x28) = *(int *)(in_ECX + 0x28) + iVar1; iVar2 = iVar2 + 1; } while (iVar2 < local_8); } if (local_8 != 0) { alGetSourcef(*(undefined4 *)(in_ECX + 0x10),0x1024,in_ECX + 0x20); } param_1 = param_1 + *(float *)(in_ECX + 0x20); *(float *)(in_ECX + 0x20) = param_1; param_1 = (float)((double)*(int *)(in_ECX + 0x28) + __uint_to_double_fixup[-(*(int *)(in_ECX + 0x28) >> 0x1f)]) / (float)*(int *)(in_ECX + -4) + param_1; *(float *)(in_ECX + 4) = param_1; fVar3 = *(float *)(*(int *)(in_ECX + -0xc) + 0x58); if (param_1 <= fVar3) { fVar3 = param_1; } *(float *)(in_ECX + 4) = fVar3; } return; } //@@ 00a8bf10 FUN_00a8bf10 void FUN_00a8bf10(void) { int in_ECX; if (*(int *)(in_ECX + 0x10) != 0) { alSourcePlay(*(int *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0xc) = 0; } return; } //@@ 00a8bf30 FUN_00a8bf30 void FUN_00a8bf30(void) { int in_ECX; if (*(int *)(in_ECX + 0x10) != 0) { alSourcePause(*(int *)(in_ECX + 0x10)); *(undefined1 *)(in_ECX + 0xc) = 1; } return; } //@@ 00a8bf50 FUN_00a8bf50 void FUN_00a8bf50(float param_1) { int iVar1; int in_ECX; if (*(int *)(in_ECX + 0x10) != 0) { alSourceStop(*(int *)(in_ECX + 0x10)); iVar1 = *(int *)(in_ECX + 0x3c); while (iVar1 != 0) { (**(code **)(*(int *)(in_ECX + -0x10) + 0xc))(); iVar1 = *(int *)(in_ECX + 0x3c); } *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 0x20) = 0; *(float *)(in_ECX + 4) = param_1; iVar1 = (int)((float)*(int *)(in_ECX + -4) * param_1); *(int *)(in_ECX + 0x28) = iVar1; *(int *)(in_ECX + 0x24) = iVar1; } return; } //@@ 00a8bfd0 FUN_00a8bfd0 void FUN_00a8bfd0(int param_1,int param_2) { uint uVar1; void *pvVar2; int in_ECX; int iVar3; uint uVar4; bool bVar5; undefined1 *puVar6; int local_20; int iStack_18; int iStack_14; undefined4 local_10; uint uStack_c; if ((*(int *)(in_ECX + 0x20) != 0) && (local_20 = 0, 0 < param_2)) { do { uVar1 = *(uint *)(in_ECX + 0x24); bVar5 = uVar1 == *(uint *)(in_ECX + 0x28); if (uVar1 < *(uint *)(in_ECX + 0x28)) { puVar6 = *(undefined1 **)(param_1 + local_20 * 4); if ((float)puVar6 <= -1.0) { puVar6 = &DAT_bf800000; } if (1.0 <= (float)puVar6) { puVar6 = (undefined1 *)0x3f800000; } *(short *)(*(int *)(in_ECX + 0x2c) + uVar1 * 2) = (short)(int)((float)puVar6 * 32767.0); *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 1; bVar5 = *(int *)(in_ECX + 0x24) == *(int *)(in_ECX + 0x28); } if (bVar5) { alGenBuffers(1,&local_10); uStack_c = *(uint *)(in_ECX + 0x24) / *(uint *)(in_ECX + 8); alBufferData(local_10,(uint)(*(int *)(in_ECX + 8) != 1) * 2 + 0x1101, *(undefined4 *)(in_ECX + 0x2c),*(uint *)(in_ECX + 0x24) * 2, *(undefined4 *)(in_ECX + 0xc)); alSourceQueueBuffers(*(undefined4 *)(in_ECX + 0x20),1,&local_10); *(int *)(in_ECX + 0x34) = *(int *)(in_ECX + 0x34) + *(uint *)(in_ECX + 0x24) / *(uint *)(in_ECX + 8); iVar3 = *(int *)(in_ECX + 0x4c); uVar1 = *(uint *)(in_ECX + 0x48); if (((uVar1 + iVar3 & 1) == 0) && (*(uint *)(in_ECX + 0x44) <= iVar3 + 2U >> 1)) { std::deque::_Growmap(iVar3); uVar1 = *(uint *)(in_ECX + 0x48); iVar3 = *(int *)(in_ECX + 0x4c); } uVar1 = *(int *)(in_ECX + 0x44) * 2 - 1U & uVar1; uVar4 = iVar3 + uVar1; *(uint *)(in_ECX + 0x48) = uVar1; uVar1 = *(int *)(in_ECX + 0x44) - 1U & uVar4 >> 1; iStack_18 = *(int *)(in_ECX + 0x40); if (*(int *)(iStack_18 + uVar1 * 4) == 0) { pvVar2 = operator_new(0x10); *(void **)(*(int *)(in_ECX + 0x40) + uVar1 * 4) = pvVar2; iStack_18 = *(int *)(in_ECX + 0x40); } uVar4 = uVar4 & 1; iVar3 = *(int *)(iStack_18 + uVar1 * 4); *(undefined4 *)(iVar3 + uVar4 * 8) = local_10; *(uint *)(iVar3 + 4 + uVar4 * 8) = uStack_c; *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + 1; *(undefined4 *)(in_ECX + 0x24) = 0; alGetSourcei(*(undefined4 *)(in_ECX + 0x20),0x1010,&iStack_14); if (iStack_14 != 0x1012) { alSourcePlay(*(undefined4 *)(in_ECX + 0x20)); } } local_20 = local_20 + 1; } while (local_20 < param_2); } return; } //@@ 00a8c180 FUN_00a8c180 float10 FUN_00a8c180(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x34) - *(int *)(in_ECX + 0x38); return (float10)((float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) / (float)*(int *)(in_ECX + 0xc)); } //@@ 00a8c1c0 FUN_00a8c1c0 undefined4 FUN_00a8c1c0(void) { int *piVar1; int iVar2; int in_ECX; uint uVar3; undefined4 local_c; undefined4 local_8; uVar3 = *(uint *)(in_ECX + 0x48) & 1; iVar2 = *(int *)(*(int *)(in_ECX + 0x40) + (*(uint *)(in_ECX + 0x48) >> 1 & *(int *)(in_ECX + 0x44) - 1U) * 4); local_c = *(undefined4 *)(iVar2 + uVar3 * 8); local_8 = *(undefined4 *)(iVar2 + 4 + uVar3 * 8); piVar1 = (int *)(in_ECX + 0x4c); *piVar1 = *piVar1 + -1; if (*piVar1 == 0) { *(undefined4 *)(in_ECX + 0x48) = 0; } else { *(int *)(in_ECX + 0x48) = *(int *)(in_ECX + 0x48) + 1; } alSourceUnqueueBuffers(*(undefined4 *)(in_ECX + 0x20),1,&local_c); alDeleteBuffers(1,&local_c); return local_8; } //@@ 00a8c230 FUN_00a8c230 undefined4 * FUN_00a8c230(int param_1,int param_2,int param_3) { undefined4 *puVar1; longlong lVar2; uint uVar3; uint uVar4; undefined4 *puVar5; undefined4 *puVar6; void *pvVar7; undefined4 *puVar8; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14a72; local_10 = ExceptionList; uVar4 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar5 = operator_new(0x50); if (puVar5 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } puVar5[1] = param_1; puVar5[2] = param_2; puVar5[3] = param_3; puVar8 = puVar5 + 4; *puVar8 = theoraplayer::Timer::vftable; puVar5[5] = 0; puVar5[6] = 0x3f800000; *(undefined1 *)(puVar5 + 7) = 0; local_8 = 2; puVar1 = puVar5 + 0xf; *puVar5 = KAGE::System::TheoraAudioInterfaceKAGE::vftable; *puVar8 = KAGE::System::TheoraAudioInterfaceKAGE::vftable; puVar5[8] = 0; puVar5[9] = 0; puVar5[0xc] = 0; puVar5[0xd] = 0; puVar5[0xe] = 0; *puVar1 = 0; puVar5[0x10] = 0; puVar5[0x11] = 0; puVar5[0x12] = 0; puVar5[0x13] = 0; puVar6 = operator_new(8); puVar6[1] = 0; *puVar1 = puVar6; *puVar6 = puVar1; local_8 = CONCAT31(local_8._1_3_,3); if ((DAT_00c5aaa4 & 1) != 0) { uVar3 = (param_2 * param_3) / 10; puVar5[10] = uVar3; lVar2 = (ulonglong)uVar3 * 2; pvVar7 = operator_new_tracked(-(uint)((int)((ulonglong)lVar2 >> 0x20) != 0) | (uint)lVar2); puVar5[0xb] = pvVar7; alGenSources(1,puVar5 + 8,uVar4); if (puVar8 == (undefined4 *)0x0) { puVar8 = *(undefined4 **)(param_1 + 0x2c); } *(undefined4 **)(param_1 + 0x28) = puVar8; } ExceptionList = local_10; return puVar5; } //@@ 00a8c39b FUN_00a8c39b void FUN_00a8c39b(void) { FUN_00a8bd30(); return; } //@@ 00a8c3b0 FUN_00a8c3b0 undefined1 FUN_00a8c3b0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0xc); } //@@ 00a8c3c0 FUN_00a8c3c0 void FUN_00a8c3c0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::System::Manager::vftable; in_ECX[0xc] = CCallbackImpl<16>::vftable; if ((*(byte *)(in_ECX + 0xd) & 1) != 0) { SteamAPI_UnregisterCallback(in_ECX + 0xc); } *in_ECX = KAGE::System::ManagerBase::vftable; FUN_00a1a500(); operator_delete((void *)in_ECX[9],0x10); in_ECX[1] = in_ECX[1] & 0xfffffffe; *in_ECX = KAGE::ManagerBase::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x44); } return; } //@@ 00a8c430 FUN_00a8c430 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ undefined4 FUN_00a8c430(void) { char cVar1; int *piVar2; void *pvVar3; LPCRITICAL_SECTION lpCriticalSection; undefined4 *puVar4; byte *extraout_EAX; int in_ECX; undefined4 in_XMM0_Da; undefined4 in_XMM0_Db; undefined4 local_24; int *local_20; undefined1 local_18 [4]; LPCRITICAL_SECTION local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14a9d; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00a266a0(__security_cookie ^ (uint)(local_18 + 0x14)); *(float *)(in_ECX + 0x2c) = (float)(double)CONCAT44(in_XMM0_Db,in_XMM0_Da); theoraplayer::init(); pvVar3 = g_theoraVideoManager; *(undefined ***)((int)g_theoraVideoManager + 0x2c) = &PTR_vftable_00c5af90; *(undefined4 *)((int)pvVar3 + 0x24) = 0x10; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*piVar2 != 0) { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar2 != 0) { _DAT_00c5ab08 = _DAT_00c5ab08 | 1; } } piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); if (*piVar2 != 0) { piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if ((*piVar2 != 0) && ((DAT_00c5ab14 & 1) == 0)) { (**(code **)(DAT_00c5ab20 + 4))(); (**(code **)(DAT_00c5ab34 + 4))(); DAT_00c5ab14 = DAT_00c5ab14 | 1; } } _DAT_00c5af9c = _DAT_00c5af9c | 1; pvVar3 = KAGE_Graphics::create_image (&local_24,0xb24558,0x671,0,(byte *)"KAGE_UserProfileDefaultIcon"); local_8 = 0; KAGE::SmartPointer::operator_assign(&DAT_00c799d8,pvVar3); local_8 = 1; if (local_20 != (int *)0x0) { cVar1 = (**(code **)(*local_20 + 0xc))(); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&local_24); } } local_8 = 0xffffffff; if ((DAT_00c5aa74 & 1) == 0) { lpCriticalSection = operator_new(0x1c); local_14 = lpCriticalSection; if (lpCriticalSection == (LPCRITICAL_SECTION)0x0) { g_userProfileLock = (LPCRITICAL_SECTION)0x0; } else { *(undefined1 *)&lpCriticalSection[1].DebugInfo = 0; InitializeCriticalSection(lpCriticalSection); g_userProfileLock = lpCriticalSection; } DAT_00c5aa74 = DAT_00c5aa74 | 1; } *(uint *)(in_ECX + 4) = *(uint *)(in_ECX + 4) | 1; piVar2 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); if (*piVar2 != 0) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); puVar4 = (undefined4 *)(**(code **)(*(int *)*puVar4 + 8))(local_18); local_24 = *puVar4; local_20 = (int *)puVar4[1]; UserProfile::find_or_create(&local_24); g_userProfile = extraout_EAX; *extraout_EAX = *extraout_EAX | 1; } ExceptionList = local_10; return 1; } //@@ 00a8c600 FUN_00a8c600 void FUN_00a8c600(void *param_1) { int iVar1; int extraout_EAX; undefined **local_18 [2]; void *local_10; undefined1 *puStack_c; undefined **local_8; local_8 = (undefined **)0xffffffff; puStack_c = &LAB_00b14ad5; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(uint *)((int)param_1 + 8) & 0x1201) == 0) { if ((*(uint *)((int)param_1 + 8) & 0x40) != 0) { local_18[0] = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(param_1); local_8 = (undefined **)0x0; local_18[0] = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(local_18); } local_8 = (undefined **)0x1; (*(code *)local_18[0][10])(); } ExceptionList = local_10; return; } iVar1 = FUN_00a23bb0(__security_cookie ^ (uint)(local_18 + 5)); if (iVar1 == 0) { UserProfile::find_or_create(param_1); ExceptionList = local_10; return; } steam_user_profile_update(iVar1); ExceptionList = local_10; return; } //@@ 00a8c6d0 FUN_00a8c6d0 void FUN_00a8c6d0(byte param_1) { void *in_ECX; theoraplayer::VideoClip_Theora::~VideoClip_Theora(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x528); } return; } //@@ 00a8c700 FUN_00a8c700 undefined4 * FUN_00a8c700(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { undefined4 *puVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14b17; local_10 = ExceptionList; ExceptionList = &local_10; puVar1 = operator_new(0x528); local_8 = 0; if (puVar1 == (undefined4 *)0x0) { ExceptionList = local_10; return (undefined4 *)0x0; } theoraplayer::VideoClip::VideoClip(param_1,param_2,param_3,param_4); puVar1[0x29] = 0; puVar1[0x2a] = 0; puVar1[0x2b] = 0; *puVar1 = theoraplayer::VideoClip_Theora::vftable; puVar1[0x101] = 0; puVar1[0x100] = 0; puVar1[0x147] = 0; puVar1[0x146] = 0; puVar1[0x148] = 0; puVar1[0x149] = 0; ExceptionList = local_10; return puVar1; } //@@ 00a8c7e0 theoraplayer::VideoClip_Theora::~VideoClip_Theora /* DB: resets VideoClip_Theora::vftable, th_decode_free/th_setup_free on +0x404/+0x400, vorbis_dsp_clear, vorbis block/info/comment clear, AudioPacketQueue::destroyAllAudioPackets; only caller the scalar deleting dtor 00a8c6d0 (vtable slot 0) */ void theoraplayer::VideoClip_Theora::~VideoClip_Theora(void) { void *pvVar1; undefined4 *puVar2; uint uVar3; undefined4 *in_ECX; undefined4 *puVar4; int local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b14b40; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = vftable; if (in_ECX[0x101] != 0) { FUN_00adeb70(in_ECX[0x101],uVar3); FUN_00ae0010(in_ECX[0x100]); if (in_ECX[8] != 0) { vorbis_dsp_clear(in_ECX + 0x10a); pvVar1 = (void *)in_ECX[0x140]; FUN_00aacae0(); if ((void *)in_ECX[0x137] != (void *)0x0) { free((void *)in_ECX[0x137]); } if (pvVar1 != (void *)0x0) { puVar4 = (undefined4 *)((int)pvVar1 + 0xc); local_14 = 0; do { puVar2 = (undefined4 *)*puVar4; if ((void *)puVar2[2] != (void *)0x0) { free((void *)puVar2[2]); } *puVar2 = 0; puVar2[1] = 0; puVar2[2] = 0; puVar2[3] = 0; puVar2[4] = 0; if (local_14 != 7) { free((void *)*puVar4); } local_14 = local_14 + 1; puVar4 = puVar4 + 1; } while (local_14 < 0xf); free(pvVar1); } memset(in_ECX + 0x126,0,0x70); } if (in_ECX + 0x92 != (undefined4 *)0x0) { pvVar1 = (void *)in_ECX[0x92]; if (pvVar1 != (void *)0x0) { free(pvVar1); } if ((void *)in_ECX[0x96] != (void *)0x0) { free((void *)in_ECX[0x96]); } if ((void *)in_ECX[0x97] != (void *)0x0) { free((void *)in_ECX[0x97]); } memset(in_ECX + 0x92,0,0x168); } FUN_00adf8f0(in_ECX + 0xfc); FUN_00adf950(in_ECX + 0xec); if (in_ECX + 0x38 != (undefined4 *)0x0) { pvVar1 = (void *)in_ECX[0x38]; if (pvVar1 != (void *)0x0) { free(pvVar1); } if ((void *)in_ECX[0x3c] != (void *)0x0) { free((void *)in_ECX[0x3c]); } if ((void *)in_ECX[0x3d] != (void *)0x0) { free((void *)in_ECX[0x3d]); } memset(in_ECX + 0x38,0,0x168); } FUN_00aa9bb0(); vorbis_info_clear(in_ECX + 0x102); if (in_ECX + 0x2c != (undefined4 *)0x0) { pvVar1 = (void *)in_ECX[0x2c]; if (pvVar1 != (void *)0x0) { free(pvVar1); } in_ECX[0x2c] = 0; in_ECX[0x2d] = 0; in_ECX[0x2e] = 0; in_ECX[0x2f] = 0; *(undefined8 *)(in_ECX + 0x30) = 0; in_ECX[0x32] = 0; } } ::AudioPacketQueue::destroyAllAudioPackets(); FUN_00a90a00(); ExceptionList = local_10; return; } //@@ 00a8ca10 VideoClip_Theora::_load /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Removing unreachable block (ram,0x00a8ce6e) */ /* WARNING: Removing unreachable block (ram,0x00a8ce7e) */ /* DB: theoraplayer: calls readTheoraVorbisHeaders, FrameQueue::setSize, vorbis_synthesis_init, th_granule_frame; "unable to determine file duration!" is theoraplayer's _load message (was KAGE_Audio::open_sound_file) */ void VideoClip_Theora::_load(undefined4 param_1) { int *syncState; uint uVar1; void *pvVar2; undefined4 *puVar3; undefined4 *puVar4; LPCRITICAL_SECTION p_Var5; size_t _Size; int iVar6; char *ptr; undefined1 *puVar7; int in_ECX; uint uVar8; undefined4 extraout_ECX; int iVar9; ulonglong uVar10; longlong lVar11; int local_40; uint local_34; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14b84; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *(undefined4 *)(in_ECX + 0x24) = param_1; readTheoraVorbisHeaders(uVar1); pvVar2 = th_decode_alloc((void *)(in_ECX + 0x3b0),*(void **)(in_ECX + 0x400)); iVar6 = *(int *)(in_ECX + 0x3b4); *(void **)(in_ECX + 0x404) = pvVar2; *(undefined4 *)(in_ECX + 100) = *(undefined4 *)(in_ECX + 0x3b8); *(undefined4 *)(in_ECX + 0x80) = *(undefined4 *)(in_ECX + 0x3bc); *(undefined4 *)(in_ECX + 0x84) = *(undefined4 *)(in_ECX + 0x3c0); *(undefined4 *)(in_ECX + 0x78) = *(undefined4 *)(in_ECX + 0x3c4); *(int *)(in_ECX + 0x60) = iVar6; *(undefined4 *)(in_ECX + 0x7c) = *(undefined4 *)(in_ECX + 0x3c8); *(int *)(in_ECX + 0x68) = iVar6; if (*(char *)(in_ECX + 0x41) != '\0') { uVar1 = iVar6 - 1U | (int)(iVar6 - 1U) >> 1; uVar1 = uVar1 | (int)uVar1 >> 2; uVar1 = uVar1 | (int)uVar1 >> 4; uVar1 = uVar1 | (int)uVar1 >> 8; *(uint *)(in_ECX + 0x68) = ((int)uVar1 >> 0x10 | uVar1) + 1; } *(float *)(in_ECX + 0x70) = (float)((double)*(int *)(in_ECX + 0x3cc) + __uint_to_double_fixup[-(*(int *)(in_ECX + 0x3cc) >> 0x1f)]) / (float)((double)*(int *)(in_ECX + 0x3d0) + __uint_to_double_fixup[-(*(int *)(in_ECX + 0x3d0) >> 0x1f)]); puVar3 = operator_new(0x10); local_8 = 0; if (puVar3 == (undefined4 *)0x0) { puVar3 = (undefined4 *)0x0; } else { *puVar3 = 0; puVar3[1] = 0; pvVar2 = operator_new(0xc); *(void **)pvVar2 = pvVar2; *(void **)((int)pvVar2 + 4) = pvVar2; *puVar3 = pvVar2; local_8 = CONCAT31(local_8._1_3_,1); puVar4 = operator_new(8); if (puVar4 == (undefined4 *)0x0) { puVar3[2] = in_ECX; puVar3[3] = 0; } else { *puVar4 = 0; *(undefined1 *)(puVar4 + 1) = 0; p_Var5 = malloc(0x18); *puVar4 = p_Var5; InitializeCriticalSection(p_Var5); puVar3[3] = puVar4; puVar3[2] = in_ECX; } } local_8 = 0xffffffff; *(undefined4 **)(in_ECX + 0x1c) = puVar3; FrameQueue::setSize(); uVar10 = (**(code **)(**(int **)(in_ECX + 0x24) + 8))(); uVar1 = (uint)uVar10; syncState = (int *)(in_ECX + 0xb0); local_34 = 1; do { if (-1 < *(int *)(in_ECX + 0xb4)) { *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xc4) = 0; *(undefined4 *)(in_ECX + 200) = 0; } uVar8 = local_34 * 0x1000; if (((longlong)uVar10 < 0x100000000) && ((0x7fffffffffffffff < uVar10 || (uVar1 < uVar8)))) { local_40 = 0; } else { local_40 = uVar1 + local_34 * -0x1000; } (**(code **)(**(int **)(in_ECX + 0x24) + 0x14))(local_40); iVar6 = *(int *)(in_ECX + 0xb4); if (iVar6 < 0) { iVar9 = 0; } else { iVar9 = *(int *)(in_ECX + 0xbc); if (iVar9 != 0) { *(int *)(in_ECX + 0xb8) = *(int *)(in_ECX + 0xb8) - iVar9; if (0 < (int)*(size_t *)(in_ECX + 0xb8)) { memmove((void *)*syncState,(void *)(iVar9 + *syncState),*(size_t *)(in_ECX + 0xb8)); iVar6 = *(int *)(in_ECX + 0xb4); } *(undefined4 *)(in_ECX + 0xbc) = 0; } iVar9 = *(int *)(in_ECX + 0xb8); if (iVar6 - iVar9 < (int)uVar8) { _Size = iVar9 + 0x1000 + uVar8; if ((void *)*syncState == (void *)0x0) { pvVar2 = malloc(_Size); } else { pvVar2 = realloc((void *)*syncState,_Size); } if (pvVar2 == (void *)0x0) { if ((void *)*syncState != (void *)0x0) { free((void *)*syncState); } iVar9 = 0; *syncState = 0; *(undefined4 *)(in_ECX + 0xb4) = 0; *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined8 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 200) = 0; goto LAB_00a8ccf4; } *syncState = (int)pvVar2; *(size_t *)(in_ECX + 0xb4) = _Size; iVar9 = *(int *)(in_ECX + 0xb8); } iVar9 = *syncState + iVar9; } LAB_00a8ccf4: iVar6 = (**(code **)(**(int **)(in_ECX + 0x24) + 0x10))(iVar9,uVar8); if ((-1 < *(int *)(in_ECX + 0xb4)) && (iVar6 = iVar6 + *(int *)(in_ECX + 0xb8), iVar6 <= *(int *)(in_ECX + 0xb4))) { *(int *)(in_ECX + 0xb8) = iVar6; } ogg_sync_pageseek(); iVar6 = ogg_sync_pageout(syncState,(void *)(in_ECX + 0xcc)); while (iVar6 != 0) { if ((iVar6 != -1) && (*(int *)(*(int *)(in_ECX + 0xcc) + 0xe) == *(int *)(in_ECX + 0x398))) { lVar11 = ogg_page_granulepos((void *)(in_ECX + 0xcc)); if (lVar11 < 0) { iVar6 = *(int *)(in_ECX + 0x6c); if (iVar6 < 1) goto LAB_00a8cda4; } else { lVar11 = th_granule_frame(*(void **)(in_ECX + 0x404),lVar11); iVar6 = (int)lVar11; } *(int *)(in_ECX + 0x6c) = iVar6 + 1; } LAB_00a8cda4: iVar6 = ogg_sync_pageout(syncState,(void *)(in_ECX + 0xcc)); } iVar6 = *(int *)(in_ECX + 0x6c); } while ((((iVar6 < 1) && (-1 < (longlong)uVar10)) && ((0xffffffff < (longlong)uVar10 || (uVar8 <= uVar1)))) && (local_34 = local_34 + 1, local_34 < 0x33)); if (iVar6 < 0) { ptr = std::_Allocate(0x30); builtin_strncpy(ptr,"unable to determine file duration!",0x23); local_8 = 2; (*(code *)PTR_FUN_00c5aa7c)(); local_8 = 0xffffffff; operator_delete(ptr,0x30); } else { *(float *)(in_ECX + 0x58) = (float)iVar6 / *(float *)(in_ECX + 0x70); } if (-1 < *(int *)(in_ECX + 0xb4)) { *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xc4) = 0; *(undefined4 *)(in_ECX + 200) = 0; } (**(code **)(**(int **)(in_ECX + 0x24) + 0x14))(0,0); if (0 < *(int *)(in_ECX + 0x51c)) { iVar6 = _vds_shared_init(extraout_ECX); if (iVar6 == 0) { vorbis_synthesis_restart(); } else { vorbis_dsp_clear((void *)(in_ECX + 0x428)); } memset((void *)(in_ECX + 0x498),0,0x70); *(undefined4 *)(in_ECX + 0x4e4) = 0; *(int **)(in_ECX + 0x4d8) = (int *)(in_ECX + 0x428); *(undefined4 *)(in_ECX + 0x4dc) = 0; if (*(int *)(in_ECX + 0x428) != 0) { pvVar2 = calloc(1,0x48); *(void **)(in_ECX + 0x500) = pvVar2; iVar6 = 0; *(undefined4 *)((int)pvVar2 + 4) = 0xc61c3c00; do { if (iVar6 == 7) { puVar3 = (undefined4 *)(in_ECX + 0x49c); } else { puVar3 = calloc(1,0x14); } *(undefined4 **)((int)pvVar2 + iVar6 * 4 + 0xc) = puVar3; *puVar3 = 0; puVar3[1] = 0; puVar3[2] = 0; puVar3[3] = 0; puVar3[4] = 0; puVar7 = malloc(0x100); puVar3[2] = puVar7; iVar6 = iVar6 + 1; puVar3[3] = puVar7; *puVar7 = 0; puVar3[4] = 0x100; } while (iVar6 < 0xf); } pvVar2 = g_theoraVideoManager; *(undefined4 *)(in_ECX + 0xa8) = *(undefined4 *)(in_ECX + 0x40c); *(undefined4 *)(in_ECX + 0xa4) = *(undefined4 *)(in_ECX + 0x410); if (*(int **)((int)pvVar2 + 0x2c) != (int *)0x0) { iVar6 = (**(code **)(**(int **)((int)pvVar2 + 0x2c) + 4)) (in_ECX,*(undefined4 *)(in_ECX + 0x40c),*(undefined4 *)(in_ECX + 0x410)); *(int *)(in_ECX + 0x20) = iVar6; if (iVar6 != 0) { if (*(int *)(in_ECX + 0x34) != 0) goto LAB_00a8d071; puVar3 = operator_new(8); if (puVar3 == (undefined4 *)0x0) { puVar3 = (undefined4 *)0x0; } else { *puVar3 = 0; *(undefined1 *)(puVar3 + 1) = 0; p_Var5 = malloc(0x18); *puVar3 = p_Var5; InitializeCriticalSection(p_Var5); } *(undefined4 **)(in_ECX + 0x34) = puVar3; if (*(int *)(in_ECX + 0x20) != 0) goto LAB_00a8d071; } puVar3 = *(undefined4 **)(in_ECX + 0x34); if (puVar3 != (undefined4 *)0x0) { DeleteCriticalSection((LPCRITICAL_SECTION)*puVar3); free((void *)*puVar3); operator_delete(puVar3,8); *(undefined4 *)(in_ECX + 0x34) = 0; } } } LAB_00a8d071: *(float *)(in_ECX + 0x5c) = 1.0 / *(float *)(in_ECX + 0x70); ExceptionList = local_10; return; } //@@ 00a8d0a0 VideoClip_Theora::_readData /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: theoraplayer::VideoClip_Theora vtable slot 3 (after slot 2 VideoClip_Theora::_load); reads 4096-byte chunks from the data source, on EOF logs ' finished playing' unless autoRestart, ogg_sync_pageout/ogg_stream_pagein for theora+vorbis streams, granulepos -> time */ undefined4 VideoClip_Theora::_readData(void) { std_string *allocSource; byte bVar1; undefined4 uVar2; int iVar3; int in_ECX; int iVar4; void *ptr; uint size; byte bVar5; byte *left; float10 fVar6; undefined1 auVar7 [16]; double dVar8; longlong lVar9; float local_38; float local_30; void *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b1252d; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; auVar7 = ZEXT816(0); local_38 = 0.0; bVar5 = 0; fVar6 = (float10)(**(code **)(**(int **)(in_ECX + 0x28) + 4))(local_14); local_30 = (float)fVar6; if (*(char *)(in_ECX + 0x91) == '\0') { auVar7 = ZEXT416((uint)local_30); } else { local_30 = 0.0; } do { uVar2 = FUN_00aac1a0(); iVar3 = (**(code **)(**(int **)(in_ECX + 0x24) + 0x10))(uVar2,0x1000); if ((-1 < *(int *)(in_ECX + 0xb4)) && (iVar4 = *(int *)(in_ECX + 0xb8) + iVar3, iVar4 <= *(int *)(in_ECX + 0xb4))) { *(int *)(in_ECX + 0xb8) = iVar4; } if (iVar3 == 0) { if (*(char *)(in_ECX + 0x4c) == '\0') { *(undefined1 *)(in_ECX + 0x74) = 1; allocSource = *(std_string **)(in_ECX + 0x14); left = (byte *)(in_ECX + 4); if (0x7fffffffU - (int)allocSource < 0x11) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < *(uint *)(in_ECX + 0x18)) { left = *(byte **)left; } std::string::concat((char *)local_2c,(int)local_38,allocSource,left,(uint)allocSource, (byte *)" finished playing",0x11); local_8 = (void *)0x0; (*(code *)PTR_FUN_00c5aa7c)(local_2c); if (0xf < local_18) { size = local_18 + 1; ptr = local_2c[0]; if (0xfff < size) { ptr = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); } } ExceptionList = local_10; return 0; } iVar3 = ogg_sync_pageout((void *)(in_ECX + 0xb0),(void *)(in_ECX + 0xcc)); bVar1 = 0; while (0 < iVar3) { iVar3 = *(int *)(*(int *)(in_ECX + 0xcc) + 0xe); if (iVar3 == *(int *)(in_ECX + 0x398)) { ogg_stream_pagein(); } if ((*(int *)(in_ECX + 0x20) != 0) && (iVar3 == *(int *)(in_ECX + 0x230))) { lVar9 = ogg_page_granulepos((int *)(in_ECX + 0xcc)); if (lVar9 == -1) { dVar8 = -1.0; } else { FUN_00aefe80(); dVar8 = auVar7._0_8_; if (lVar9 < 0) { dVar8 = dVar8 + 2.0 + 9.223372036854776e+18 + 9.223372036854776e+18; } dVar8 = dVar8 / (double)*(int *)(*(int *)(in_ECX + 0x42c) + 8); } local_38 = (float)dVar8; auVar7 = ZEXT416((uint)local_38); bVar5 = *(byte *)(*(int *)(in_ECX + 0xcc) + 5) & 4; ogg_stream_pagein(); } iVar3 = ogg_sync_pageout((void *)(in_ECX + 0xb0),(void *)(in_ECX + 0xcc)); bVar1 = bVar5; } } while (((*(int *)(in_ECX + 0x20) != 0) && (bVar1 == 0)) && (auVar7 = ZEXT416((uint)(local_30 + 1.0)), local_38 < local_30 + 1.0)); ExceptionList = local_10; return 1; } //@@ 00a8d350 theoraplayer::VideoClip_Theora::_decodeNextFrame /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: VideoClip_Theora vtable slot 4: frame queue requestEmptyFrame (FUN_00aaabb0), ogg_stream_packetout up to 100 tries, th_decode_packetin, th_granule_time/th_granule_frame, timer vtable +4 */ undefined4 theoraplayer::VideoClip_Theora::_decodeNextFrame(void) { int *piVar1; void *this; char cVar2; int iVar3; undefined4 uVar4; int *in_ECX; int iVar5; float10 fVar6; ulonglong uVar7; undefined1 local_ac [32]; undefined4 local_8c; undefined4 local_88; undefined4 local_84; undefined4 local_80; undefined8 local_7c; undefined8 local_74; undefined4 local_6c; undefined4 local_68; undefined4 local_64; float local_60; undefined4 local_5c; undefined4 local_58; void *local_54; float local_50; int *local_4c; char local_45; undefined1 local_44 [8]; undefined4 local_3c; undefined4 local_38; undefined4 local_2c; undefined4 local_28; undefined4 local_1c; undefined4 local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14bbd; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_44 + 0x40); ExceptionList = &local_10; if (((char)in_ECX[0x1d] == '\0') && (local_4c = (int *)FUN_00aaabb0(local_14), local_4c != (int *)0x0)) { local_45 = '\0'; LAB_00a8d3a3: do { iVar3 = -1; iVar5 = 0; do { if (99 < iVar5) break; piVar1 = in_ECX + 0x92; if ((piVar1 == (int *)0x0) || (*piVar1 == 0)) { iVar3 = 0; break; } iVar3 = ogg_stream_packetout(piVar1,local_ac); iVar5 = iVar5 + 1; } while (iVar3 < 0); if (0 < iVar3) { iVar3 = th_decode_packetin(in_ECX[0x101],local_ac,&local_5c); if ((iVar3 == 0) || (iVar3 == 1)) { fVar6 = (float10)FUN_00ae2110(in_ECX[0x101],local_5c,local_58); local_60 = (float)fVar6; uVar7 = th_granule_frame((void *)in_ECX[0x101],CONCAT44(local_58,local_5c)); fVar6 = (float10)(**(code **)(*(int *)in_ECX[10] + 4))(); piVar1 = local_4c; local_50 = (float)fVar6; if ((local_50 <= local_60) || ((*(char *)((int)in_ECX + 0x91) != '\0' || ((uVar7 & 0xf) == 0)))) { local_4c[1] = (int)(local_60 - (float)in_ECX[0x17]); local_4c[3] = in_ECX[0x25]; local_4c[7] = (int)uVar7; in_ECX[0x149] = (int)uVar7; FUN_00adf8c0(in_ECX[0x101],local_44); local_88 = local_38; local_6c = local_3c; local_84 = local_28; local_68 = local_2c; local_80 = local_18; local_64 = local_1c; local_8c = 0; local_7c = 0; local_74 = 0; (**(code **)(*piVar1 + 4))(&local_8c); cVar2 = local_45; goto LAB_00a8d480; } in_ECX[0x27] = in_ECX[0x27] + 1; } goto LAB_00a8d3a3; } cVar2 = (**(code **)(*in_ECX + 0xc))(); } while (cVar2 != '\0'); *(undefined1 *)((int)local_4c + 9) = 0; cVar2 = (char)in_ECX[0x13]; LAB_00a8d480: if (in_ECX[8] != 0) { this = (void *)in_ECX[0xd]; local_54 = (void *)0x0; local_50 = (float)((uint)local_50 & 0xffffff00); if (this != (void *)0x0) { local_54 = this; Mutex::lock(this); } local_8 = 0; (**(code **)(*in_ECX + 0x14))(); local_8 = 0xffffffff; Mutex::ScopeLock::~ScopeLock(&local_54); } if (cVar2 != '\0') { in_ECX[0x25] = in_ECX[0x25] + 1; (**(code **)(*in_ECX + 0x20))(); } uVar4 = 1; } else { uVar4 = 0; } ExceptionList = local_10; return uVar4; } //@@ 00a8d580 VideoClip_Theora::_decodeAudio /* DB: theoraplayer: returns float, -1.0 when restarted (+0x91); drains vorbis pcm (+0x10c..+0x110) into an interleaved float buffer, else ogg_stream_packetout -> vorbis_synthesis -> vorbis_synthesis_blockin; sits next to VideoClip_Theora::_load/_executeSeek */ float10 VideoClip_Theora::_decodeAudio(void) { int *streamState; float fVar1; float fVar2; float fVar3; double dVar4; double dVar5; int iVar6; int iVar7; int iVar8; int iVar9; longlong lVar10; bool bVar11; char cVar12; undefined4 *puVar13; int iVar14; float *_Dst; uint uVar15; int *in_ECX; float *pfVar16; int iVar17; uint uVar18; int iVar19; undefined1 auVar20 [16]; undefined1 *local_48; undefined1 local_28 [16]; uint local_18; uint local_14; if (*(char *)((int)in_ECX + 0x91) != '\0') { return (float10)-1.0; } iVar6 = in_ECX[0x29]; local_48 = &DAT_bf800000; bVar11 = false; dVar4 = __uint_to_double_fixup[-(iVar6 >> 0x1f)]; iVar7 = in_ECX[0x149]; dVar5 = __uint_to_double_fixup[-(iVar7 >> 0x1f)]; fVar1 = (float)in_ECX[0x1c]; iVar8 = *(int *)(in_ECX[7] + 4); fVar2 = (float)in_ECX[0x1c]; puVar13 = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)(uint)in_ECX[0x2a] * 4 >> 0x20) != 0) | (uint)((ulonglong)(uint)in_ECX[0x2a] * 4))); *puVar13 = 0; LAB_00a8d666: iVar19 = in_ECX[0x110]; if ((-1 < iVar19) && (iVar14 = in_ECX[0x10f], iVar19 < iVar14)) { iVar9 = in_ECX[0x10b]; iVar17 = 0; if (0 < *(int *)(iVar9 + 4)) { do { *(int *)(in_ECX[0x10d] + iVar17 * 4) = *(int *)(in_ECX[0x10c] + iVar17 * 4) + in_ECX[0x110] * 4; iVar17 = iVar17 + 1; } while (iVar17 < *(int *)(iVar9 + 4)); iVar19 = in_ECX[0x110]; iVar14 = in_ECX[0x10f]; } iVar9 = in_ECX[0x10d]; iVar14 = iVar14 - iVar19; if (iVar14 != 0) { if (0 < iVar14) { iVar19 = in_ECX[0x2a]; fVar3 = (float)in_ECX[0x12]; lVar10 = (ulonglong)(uint)(iVar19 * iVar14) * 4; _Dst = tracked_alloc(0,(void *)0x0, (ulonglong) (-(uint)((int)((ulonglong)lVar10 >> 0x20) != 0) | (uint)lVar10)); memset(_Dst,0,iVar19 * iVar14 * 4); if (1.0 <= fVar3) { if (0.0 < fVar3) { uVar15 = in_ECX[0x2a]; iVar19 = 0; pfVar16 = _Dst; do { uVar18 = 0; if (uVar15 != 0) { do { iVar17 = uVar18 * 4; uVar18 = uVar18 + 1; *pfVar16 = *(float *)(*(int *)(iVar9 + iVar17) + iVar19 * 4); pfVar16 = pfVar16 + 1; uVar15 = in_ECX[0x2a]; } while (uVar18 < uVar15); } iVar19 = iVar19 + 1; } while (iVar19 < iVar14); } } else { uVar15 = in_ECX[0x2a]; iVar19 = 0; pfVar16 = _Dst; do { uVar18 = 0; if (uVar15 != 0) { do { iVar17 = uVar18 * 4; uVar18 = uVar18 + 1; *pfVar16 = fVar3 * *(float *)(*(int *)(iVar9 + iVar17) + iVar19 * 4); pfVar16 = pfVar16 + 1; uVar15 = in_ECX[0x2a]; } while (uVar18 < uVar15); } iVar19 = iVar19 + 1; } while (iVar19 < iVar14); } FUN_00aadbf0(_Dst,in_ECX[0x2a] * iVar14); in_ECX[0x148] = in_ECX[0x148] + iVar14; if (bVar11) { local_48 = (undefined1 *)((float)iVar14 / (float)in_ECX[0x104] + (float)local_48); } if (in_ECX[0x110] + iVar14 <= in_ECX[0x10f]) { in_ECX[0x110] = in_ECX[0x110] + iVar14; } } goto LAB_00a8d666; } } streamState = in_ECX + 0x38; if (((streamState == (int *)0x0) || (*streamState == 0)) || (iVar19 = ogg_stream_packetout(streamState,local_28), iVar19 < 1)) { if (((float)iVar8 / fVar2 + 1.0 <= (float)((double)in_ECX[0x148] + __uint_to_double_fixup[-(in_ECX[0x148] >> 0x1f)]) * (1.0 / (float)((double)iVar6 + dVar4)) - (float)((double)iVar7 + dVar5) / fVar1) || (cVar12 = (**(code **)(*in_ECX + 0xc))(), cVar12 == '\0')) { return (float10)(float)local_48; } } else { iVar19 = FUN_00aada30(); if (iVar19 == 0) { auVar20 = ZEXT816(0); if ((0.0 <= (float)local_48) || ((int)local_14 < 0)) { if (0.0 <= (float)local_48) { bVar11 = true; } } else if ((local_18 & local_14) == 0xffffffff) { local_48 = &DAT_bf800000; } else { FUN_00aefe80(); local_48 = (undefined1 *)(float)(auVar20._0_8_ / (double)*(int *)(in_ECX[0x10b] + 8)); } vorbis_synthesis_blockin(); } } goto LAB_00a8d666; } //@@ 00a8d950 FUN_00a8d950 void FUN_00a8d950(void) { void *this; int *piVar1; int *ptr; int iVar2; uint uVar3; qword qVar4; int in_ECX; qword *pqVar5; void *local_18; char local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14bfd; local_10 = ExceptionList; ExceptionList = &local_10; if (*(int *)(in_ECX + 0x20) != 0) { local_14 = (**(code **)(**(int **)(in_ECX + 0x28) + 0x10)) (__security_cookie ^ (int)register0x00000010 - 4U); if (local_14 == '\0') { this = *(void **)(in_ECX + 0x34); piVar1 = *(int **)(in_ECX + 0x20); local_18 = (void *)0x0; if (this != (void *)0x0) { local_18 = this; Mutex::lock(this); } local_8 = 0; while (ptr = *(int **)(in_ECX + 0xac), ptr != (int *)0x0) { *(int *)(in_ECX + 0xac) = ptr[2]; (**(code **)(*piVar1 + 4))(*ptr,ptr[1]); iVar2 = *ptr; if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } if (iVar2 != 0) { uVar3 = *(uint *)(iVar2 + -4); qVar4 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar3; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar4 < uVar3); free((void *)(iVar2 + -4)); } local_8 = local_8 & 0xffffff00; operator_delete(ptr,0xc); } Mutex::ScopeLock::~ScopeLock(&local_18); } } ExceptionList = local_10; return; } //@@ 00a8da40 VideoClip_Theora::_executeSeek /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: theoraplayer: "[seek]: fineseeking failed, _readData failed!", calls _seekPage and ogg_stream_reset (was audio_stream_seek) */ void VideoClip_Theora::_executeSeek(void) { int *streamState; std_string *allocSource; char cVar1; void *pvVar2; int iVar3; int iVar4; int *in_ECX; int iVar5; undefined4 *puVar6; uint size; byte *left; float10 fVar7; float fVar8; float fVar9; float fVar10; float fVar11; longlong lVar12; undefined1 local_78 [16]; undefined1 local_68 [4]; int local_64; float local_58; undefined4 *local_54; undefined1 local_50; undefined4 local_4c; undefined4 local_48; undefined8 local_44; float local_3c; char local_35; void *local_34; char local_2d; void *local_2c [5]; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; void *local_8; local_8 = (void *)0xffffffff; puStack_c = &LAB_00b14c35; local_10 = ExceptionList; local_14 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; local_34 = (void *)((float)in_ECX[0x22] / (float)in_ECX[0x1c]); (**(code **)(*(int *)in_ECX[10] + 0x24))(local_34,local_14); local_35 = (**(code **)(*(int *)in_ECX[10] + 0x10))(); if (local_35 == '\0') { (**(code **)(*(int *)in_ECX[10] + 0x1c))(); } *(undefined1 *)(in_ECX + 0x1d) = 0; *(undefined1 *)((int)in_ECX + 0x91) = 0; FUN_00aaaa90(); streamState = in_ECX + 0x92; in_ECX[0x26] = 0; in_ECX[0x25] = 0; ogg_stream_reset(); FUN_00adeb70(in_ECX[0x101]); pvVar2 = th_decode_alloc(in_ECX + 0xec,(void *)in_ECX[0x100]); in_ECX[0x101] = (int)pvVar2; local_54 = (undefined4 *)0x0; local_50 = 0; local_8 = (void *)0x0; if (in_ECX[8] != 0) { puVar6 = (undefined4 *)in_ECX[0xd]; if (puVar6 != (undefined4 *)0x0) { local_54 = puVar6; Mutex::lock(puVar6); } ogg_stream_reset(); vorbis_synthesis_restart(); AudioPacketQueue::destroyAllAudioPackets(); } iVar3 = _seekPage(in_ECX[0x22],1); iVar4 = 0; if (0 < iVar3 + -1) { iVar4 = iVar3 + -1; } _seekPage(iVar4,0); local_2d = '\0'; if (iVar3 < 2) { if ((((char)in_ECX[0xec] == '\x03') && (*(char *)((int)in_ECX + 0x3b1) == '\x02')) && (*(char *)((int)in_ECX + 0x3b2) == '\0')) { local_44 = 0; local_44._0_4_ = 0; local_4c = (undefined4)local_44; } else { local_4c = 1; } local_48 = 0; th_decode_ctl(in_ECX[0x101],5,&local_4c,8); local_2d = '\x01'; } iVar4 = in_ECX[0x22]; while (iVar4 != 0) { if (((streamState == (int *)0x0) || (*streamState == 0)) || (iVar4 = ogg_stream_packetout(streamState,local_78), iVar4 < 1)) { cVar1 = (**(code **)(*in_ECX + 0xc))(); if (cVar1 == '\0') { allocSource = (std_string *)in_ECX[5]; left = (byte *)(in_ECX + 1); if (0x7fffffffU - (int)allocSource < 0x2e) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < (uint)in_ECX[6]) { left = *(byte **)left; } std::string::concat((char *)local_2c,(int)local_44._4_4_,allocSource,left,(uint)allocSource, (byte *)" [seek]: fineseeking failed, _readData failed!",0x2e); local_8 = (void *)CONCAT31(local_8._1_3_,1); (*(code *)PTR_FUN_00c5aa7c)(local_2c); if (0xf < local_18) { size = local_18 + 1; pvVar2 = local_2c[0]; if (0xfff < size) { pvVar2 = *(void **)((int)local_2c[0] + -4); size = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)pvVar2))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,size); } goto LAB_00a8e01d; } } else { if (local_2d == '\0') { if (local_64 < 0) goto LAB_00a8ddfc; th_decode_ctl(in_ECX[0x101],5,local_68,8); local_2d = '\x01'; } iVar4 = th_decode_packetin(in_ECX[0x101],local_78,&local_4c); if (((iVar4 == 0) || (iVar4 == 1)) && (lVar12 = th_granule_frame((void *)in_ECX[0x101],CONCAT44(local_48,local_4c)), in_ECX[0x22] + -1 <= (int)lVar12)) break; } LAB_00a8ddfc: iVar4 = in_ECX[0x22]; } if (in_ECX[8] != 0) { fVar7 = (float10)(**(code **)(*in_ECX + 0x14))(); pvVar2 = local_34; while (fVar10 = (float)fVar7, local_3c = fVar10, local_34 = pvVar2, fVar10 < 0.0) { (**(code **)(*in_ECX + 0xc))(); fVar7 = (float10)(**(code **)(*in_ECX + 0x14))(); pvVar2 = local_34; } iVar5 = 0; iVar4 = in_ECX[0x29]; iVar3 = in_ECX[0x2b]; fVar11 = (float)((double)in_ECX[0x2a] + __uint_to_double_fixup[-(in_ECX[0x2a] >> 0x1f)]) * (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]); local_44 = CONCAT44(fVar11,(undefined4)local_44); for (; iVar3 != 0; iVar3 = *(int *)(iVar3 + 8)) { iVar5 = iVar5 + *(int *)(iVar3 + 4); } puVar6 = (undefined4 *)in_ECX[0x2b]; fVar9 = (float)iVar5 / (float)((double)(in_ECX[0x2a] * iVar4) + __uint_to_double_fixup[-(in_ECX[0x2a] * iVar4 >> 0x1f)]); fVar8 = fVar10 - fVar9; if (puVar6 != (undefined4 *)0x0) { if ((float)pvVar2 <= fVar8) { iVar3 = 0; iVar4 = (int)((fVar8 - (float)pvVar2) * fVar11); if (0 < iVar4) { lVar12 = (ulonglong)(uint)(puVar6[1] + iVar4) * 4; local_34 = operator_new_tracked (-(uint)((int)((ulonglong)lVar12 >> 0x20) != 0) | (uint)lVar12); memset(local_34,0,iVar4 * 4); puVar6 = (undefined4 *)in_ECX[0x2b]; if (0 < puVar6[1] + iVar4) { do { *(undefined4 *)((int)local_34 + iVar3 * 4) = *(undefined4 *)(*(int *)in_ECX[0x2b] + iVar3 * 4); iVar3 = iVar3 + 1; puVar6 = (undefined4 *)in_ECX[0x2b]; } while (iVar3 < puVar6[1] + iVar4); } local_8._0_1_ = 4; tracked_alloc(1,(void *)*puVar6,0); local_8 = (void *)((uint)local_8._1_3_ << 8); *(void **)in_ECX[0x2b] = local_34; } } else { do { iVar4 = puVar6[1]; fVar8 = (fVar10 - fVar9) + (float)iVar4 / fVar11; if ((float)pvVar2 <= fVar8) { local_34 = (void *)(int)((fVar8 - (float)pvVar2) * fVar11); if (iVar4 - (int)local_34 < 1) { if (puVar6 != (undefined4 *)0x0) { in_ECX[0x2b] = puVar6[2]; local_8._0_1_ = 2; tracked_alloc(1,(void *)*puVar6,0); local_8 = (void *)((uint)local_8._1_3_ << 8); operator_delete(puVar6,0xc); } } else { if ((int)local_34 < iVar4) { pvVar2 = local_34; iVar4 = 0; do { iVar3 = (int)pvVar2 * 4; pvVar2 = (void *)((int)pvVar2 + 1); *(undefined4 *)(iVar4 + *(int *)in_ECX[0x2b]) = *(undefined4 *)(*(int *)in_ECX[0x2b] + iVar3); puVar6 = (undefined4 *)in_ECX[0x2b]; iVar4 = iVar4 + 4; } while ((int)pvVar2 < (int)puVar6[1]); } puVar6[1] = puVar6[1] - (int)local_34; } break; } local_58 = fVar9 - (float)iVar4 / fVar11; if (puVar6 != (undefined4 *)0x0) { in_ECX[0x2b] = puVar6[2]; local_8._0_1_ = 3; tracked_alloc(1,(void *)*puVar6,0); local_8 = (void *)((uint)local_8._1_3_ << 8); operator_delete(puVar6,0xc); puVar6 = (undefined4 *)in_ECX[0x2b]; fVar10 = local_3c; fVar11 = local_44._4_4_; pvVar2 = local_34; } fVar9 = local_58; } while (puVar6 != (undefined4 *)0x0); } } in_ECX[0x149] = in_ECX[0x22]; iVar4 = __ftoui3(); in_ECX[0x148] = iVar4; if (local_54 != (undefined4 *)0x0) { *(undefined1 *)(local_54 + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_54); local_54 = (undefined4 *)0x0; } } if (local_35 == '\0') { (**(code **)(*(int *)in_ECX[10] + 0x18))(); } in_ECX[0x22] = -1; LAB_00a8e01d: Mutex::ScopeLock::~ScopeLock(&local_54); ExceptionList = local_10; return; } //@@ 00a8e050 FUN_00a8e050 void FUN_00a8e050(void) { int *streamState; char cVar1; void *pvVar2; int iVar3; int in_ECX; undefined8 uStack_38; undefined1 auStack_28 [36]; cVar1 = (**(code **)(**(int **)(in_ECX + 0x28) + 0x10))(); if (cVar1 == '\0') { (**(code **)(**(int **)(in_ECX + 0x28) + 0x1c))(); } uStack_38 = (ulonglong)(uint)uStack_38; th_decode_ctl(*(undefined4 *)(in_ECX + 0x404),5,(int)&uStack_38 + 4,4); FUN_00adeb70(*(undefined4 *)(in_ECX + 0x404)); pvVar2 = th_decode_alloc((void *)(in_ECX + 0x3b0),*(void **)(in_ECX + 0x400)); *(void **)(in_ECX + 0x404) = pvVar2; ogg_stream_reset(); if (*(int *)(in_ECX + 0x20) != 0) { *(undefined4 *)(in_ECX + 0x520) = 0; streamState = (int *)(in_ECX + 0xe0); while ((streamState != (int *)0x0 && (*streamState != 0))) { iVar3 = ogg_stream_packetout(streamState,auStack_28); if (iVar3 < 1) break; iVar3 = FUN_00aada30(); if (iVar3 == 0) { vorbis_synthesis_blockin(); } } ogg_stream_reset(); } if (-1 < *(int *)(in_ECX + 0xb4)) { *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xc4) = 0; *(undefined4 *)(in_ECX + 200) = 0; } (**(code **)(**(int **)(in_ECX + 0x24) + 0x14))(0,0); uStack_38 = 0; th_decode_ctl(*(undefined4 *)(in_ECX + 0x404),5,&uStack_38,8); *(undefined1 *)(in_ECX + 0x74) = 0; *(undefined1 *)(in_ECX + 0x91) = 1; if (cVar1 == '\0') { (**(code **)(**(int **)(in_ECX + 0x28) + 0x18))(); } return; } //@@ 00a8e1b0 VideoClip_Theora::_seekPage /* DB: theoraplayer _seekPage(targetFrame, returnKeyFrame): bisection over the data source (vfunc +8 size, +0x14 seek) resetting ogg sync (+0xb0..+0xd8), ogg_sync_pageseek/pageout up to 1000 iterations and granule-to-frame comparison; only caller VideoClip_Theora::_executeSeek (audio_stream_seek) */ undefined4 VideoClip_Theora::_seekPage(int param_1,char param_2) { undefined4 *syncState; size_t _Size; int iVar1; longlong lVar2; int iVar3; undefined4 uVar4; void *pvVar5; int in_ECX; int *piVar6; longlong lVar7; longlong lVar8; longlong lVar9; longlong lVar10; longlong lVar11; undefined8 uVar12; int iStack_20; lVar7 = (**(code **)(**(int **)(in_ECX + 0x24) + 8))(); if (param_1 == 0) { (**(code **)(**(int **)(in_ECX + 0x24) + 0x14))(0,0); lVar2 = 0; } else { syncState = (undefined4 *)(in_ECX + 0xb0); lVar2 = 0; iStack_20 = 0; do { if (-1 < *(int *)(in_ECX + 0xb4)) { *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xc4) = 0; *(undefined4 *)(in_ECX + 200) = 0; } piVar6 = *(int **)(in_ECX + 0x24); lVar8 = __alldiv(lVar7,2,0); lVar9 = __alldiv(lVar2,2,0); (**(code **)(*piVar6 + 0x14))(); *(undefined4 *)(in_ECX + 0xcc) = 0; *(undefined4 *)(in_ECX + 0xd0) = 0; *(undefined4 *)(in_ECX + 0xd4) = 0; *(undefined4 *)(in_ECX + 0xd8) = 0; ogg_sync_pageseek(); lVar11 = lVar2; if (iStack_20 < 1000) { do { do { while( true ) { piVar6 = (int *)(in_ECX + 0xcc); iVar3 = ogg_sync_pageout(syncState,piVar6); if (iVar3 == 1) break; iVar3 = *(int *)(in_ECX + 0xb4); if (-1 < iVar3) { iVar1 = *(int *)(in_ECX + 0xbc); if (iVar1 != 0) { *(int *)(in_ECX + 0xb8) = *(int *)(in_ECX + 0xb8) - iVar1; if (0 < (int)*(size_t *)(in_ECX + 0xb8)) { memmove((void *)*syncState,(void *)((int)*syncState + iVar1), *(size_t *)(in_ECX + 0xb8)); iVar3 = *(int *)(in_ECX + 0xb4); } *(undefined4 *)(in_ECX + 0xbc) = 0; } if (iVar3 - *(int *)(in_ECX + 0xb8) < 0x1000) { _Size = *(int *)(in_ECX + 0xb8) + 0x2000; if ((void *)*syncState == (void *)0x0) { pvVar5 = malloc(_Size); } else { pvVar5 = realloc((void *)*syncState,_Size); } if (pvVar5 == (void *)0x0) { if ((void *)*syncState != (void *)0x0) { free((void *)*syncState); } *syncState = 0; *(undefined4 *)(in_ECX + 0xb4) = 0; *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined8 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 200) = 0; } else { *syncState = pvVar5; *(size_t *)(in_ECX + 0xb4) = _Size; } } } iVar3 = (**(code **)(**(int **)(in_ECX + 0x24) + 0x10))(); if (iVar3 == 0) goto LAB_00a8e375; if ((-1 < *(int *)(in_ECX + 0xb4)) && (iVar3 = iVar3 + *(int *)(in_ECX + 0xb8), iVar3 <= *(int *)(in_ECX + 0xb4))) { *(int *)(in_ECX + 0xb8) = iVar3; } } } while (*(int *)(*piVar6 + 0xe) != *(int *)(in_ECX + 0x398)); lVar10 = ogg_page_granulepos(piVar6); } while (((int)((ulonglong)lVar10 >> 0x20) == 0 || lVar10 < 0) && (lVar10 < 0)); lVar11 = th_granule_frame(*(void **)(in_ECX + 0x404),lVar10); iVar3 = (int)lVar11; if ((iVar3 < param_1) && (param_1 - iVar3 < 10)) break; lVar10 = lVar8 + lVar9; lVar11 = lVar9 + lVar8; if (iVar3 < param_1 + -1) goto LAB_00a8e375; } else { LAB_00a8e375: lVar10 = lVar7; lVar2 = lVar11; } lVar7 = lVar10; iStack_20 = iStack_20 + 1; } while (iStack_20 < 100); } if (param_2 != '\0') { uVar4 = __allshr(); return uVar4; } if (-1 < *(int *)(in_ECX + 0xb4)) { *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined4 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 0xc4) = 0; *(undefined4 *)(in_ECX + 200) = 0; } *(undefined4 *)(in_ECX + 0xcc) = 0; *(undefined4 *)(in_ECX + 0xd0) = 0; *(undefined4 *)(in_ECX + 0xd4) = 0; *(undefined4 *)(in_ECX + 0xd8) = 0; ogg_sync_pageseek(); if (param_1 != 0) { iVar3 = **(int **)(in_ECX + 0x24); uVar12 = __alldiv(lVar7 + lVar2,2,0); (**(code **)(iVar3 + 0x14))(uVar12); } return 0xffffffff; } //@@ 00a8e530 VideoClip_Theora::readTheoraVorbisHeaders /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: theoraplayer VideoClip_Theora.cpp _readTheoraVorbisHeaders: "Error parsing Theora stream headers!", "Invalid theora stream!", "End of file found prematurely!" */ void VideoClip_Theora::readTheoraVorbisHeaders(void) { int *piVar1; uint uVar2; void *pvVar3; int iVar4; undefined1 *pExceptionObject; int in_ECX; int iVar5; void **ppvVar6; int *syncState; undefined4 *puVar7; undefined4 uVar8; void *local_200 [4]; void *local_1f0; void *local_1ec; undefined4 local_1e8; undefined4 local_b0; undefined1 local_98 [32]; int local_78; undefined4 *local_74; size_t local_70; int local_6c; undefined4 *local_68; undefined1 local_64 [28]; undefined1 local_48 [28]; char local_2c [24]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14c8d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; syncState = (int *)(in_ECX + 0xb0); *syncState = 0; *(undefined4 *)(in_ECX + 0xb4) = 0; *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; local_68 = (undefined4 *)(in_ECX + 0xe0); *(undefined8 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 200) = 0; *(undefined4 *)(in_ECX + 0xcc) = 0; *(undefined4 *)(in_ECX + 0xd0) = 0; *(undefined4 *)(in_ECX + 0xd4) = 0; *(undefined4 *)(in_ECX + 0xd8) = 0; local_6c = in_ECX; local_14 = uVar2; memset(local_68,0,0x168); local_74 = (undefined4 *)(in_ECX + 0x248); memset(local_74,0,0x168); memset((void *)(in_ECX + 0x3b0),0,0x40); *(undefined4 *)(in_ECX + 0x3f0) = 0; *(undefined4 *)(in_ECX + 0x3f4) = 0; *(undefined4 *)(in_ECX + 0x3f8) = 0; *(undefined4 *)(in_ECX + 0x3fc) = 0; *(undefined4 *)(in_ECX + 0x408) = 0; *(undefined4 *)(in_ECX + 0x40c) = 0; *(undefined4 *)(in_ECX + 0x410) = 0; *(undefined4 *)(in_ECX + 0x414) = 0; *(undefined4 *)(in_ECX + 0x418) = 0; *(undefined4 *)(in_ECX + 0x41c) = 0; *(undefined4 *)(in_ECX + 0x420) = 0; *(undefined4 *)(in_ECX + 0x424) = 0; memset((void *)(in_ECX + 0x428),0,0xe0); *(undefined4 *)(in_ECX + 0x508) = 0; *(undefined4 *)(in_ECX + 0x50c) = 0; *(undefined4 *)(in_ECX + 0x510) = 0; *(undefined4 *)(in_ECX + 0x514) = 0; if (syncState != (int *)0x0) { *(undefined4 *)(in_ECX + 0xb4) = 0xffffffff; *syncState = 0; *(undefined4 *)(in_ECX + 0xb4) = 0; *(undefined4 *)(in_ECX + 0xb8) = 0; *(undefined4 *)(in_ECX + 0xbc) = 0; *(undefined8 *)(in_ECX + 0xc0) = 0; *(undefined4 *)(in_ECX + 200) = 0; } FUN_00adf940(in_ECX + 0x3f0,uVar2); FUN_00adf970(in_ECX + 0x3b0); *(undefined4 *)(in_ECX + 0x408) = 0; *(undefined4 *)(in_ECX + 0x40c) = 0; *(undefined4 *)(in_ECX + 0x410) = 0; *(undefined4 *)(in_ECX + 0x414) = 0; *(undefined4 *)(in_ECX + 0x418) = 0; *(undefined4 *)(in_ECX + 0x41c) = 0; *(undefined4 *)(in_ECX + 0x420) = 0; *(undefined4 *)(in_ECX + 0x424) = 0; pvVar3 = calloc(1,0xe50); *(void **)(in_ECX + 0x424) = pvVar3; pvVar3 = g_theoraVideoManager; *(undefined4 *)(in_ECX + 0x508) = 0; *(undefined4 *)(in_ECX + 0x50c) = 0; *(undefined4 *)(in_ECX + 0x510) = 0; *(undefined4 *)(in_ECX + 0x514) = 0; local_78 = *(int *)((int)pvVar3 + 0x2c); do { iVar4 = syncState[1]; if (iVar4 < 0) { iVar5 = 0; } else { iVar5 = syncState[3]; if (iVar5 != 0) { syncState[2] = syncState[2] - iVar5; if (0 < syncState[2]) { memmove((void *)*syncState,(void *)(*syncState + iVar5),syncState[2]); iVar4 = syncState[1]; } syncState[3] = 0; } iVar5 = syncState[2]; if (iVar4 - iVar5 < 0x1000) { local_70 = iVar5 + 0x2000; if ((void *)*syncState == (void *)0x0) { pvVar3 = malloc(local_70); } else { pvVar3 = realloc((void *)*syncState,local_70); } if (pvVar3 == (void *)0x0) { if ((void *)*syncState != (void *)0x0) { free((void *)*syncState); } iVar5 = 0; *syncState = 0; syncState[1] = 0; syncState[2] = 0; syncState[3] = 0; syncState[4] = 0; syncState[5] = 0; syncState[6] = 0; goto LAB_00a8e707; } iVar5 = syncState[2]; *syncState = (int)pvVar3; syncState[1] = local_70; } iVar5 = *syncState + iVar5; } LAB_00a8e707: iVar4 = (**(code **)(**(int **)(in_ECX + 0x24) + 0x10))(iVar5,0x1000); if ((-1 < *(int *)(in_ECX + 0xb4)) && (iVar5 = *(int *)(in_ECX + 0xb8) + iVar4, iVar5 <= *(int *)(in_ECX + 0xb4))) { *(int *)(in_ECX + 0xb8) = iVar5; } if (iVar4 == 0) goto LAB_00a8e9c1; iVar4 = ogg_sync_pageout(syncState,(void *)(in_ECX + 0xcc)); while (0 < iVar4) { if ((*(byte *)(*(int *)(in_ECX + 0xcc) + 5) & 2) == 0) { if (0 < *(int *)(in_ECX + 0x518)) { ogg_stream_pagein(); } iVar4 = *(int *)(in_ECX + 0x51c); goto joined_r0x00a8e9b2; } uVar8 = *(undefined4 *)(*(int *)(in_ECX + 0xcc) + 0xe); memset(local_200,0,0x168); local_200[1] = (void *)0x4000; local_1e8 = 0x400; local_200[0] = malloc(0x4000); local_1f0 = malloc(0x1000); local_1ec = malloc(0x2000); if (local_200[0] == (void *)0x0) { LAB_00a8e815: if (local_1f0 != (void *)0x0) { free(local_1f0); } if (local_1ec != (void *)0x0) { free(local_1ec); } memset(local_200,0,0x168); } else { if ((local_1f0 == (void *)0x0) || (local_1ec == (void *)0x0)) { free(local_200[0]); goto LAB_00a8e815; } local_b0 = uVar8; } ogg_stream_pagein(); if (local_200[0] != (void *)0x0) { ogg_stream_packetout(local_200,local_98); } pvVar3 = local_200[0]; if ((*(int *)(in_ECX + 0x518) == 0) && (iVar4 = FUN_00adffc0(in_ECX + 0x3b0,in_ECX + 0x3f0,in_ECX + 0x400,local_98), 0 < iVar4)) { ppvVar6 = local_200; puVar7 = local_74; for (iVar4 = 0x5a; iVar4 != 0; iVar4 = iVar4 + -1) { *puVar7 = *ppvVar6; ppvVar6 = ppvVar6 + 1; puVar7 = puVar7 + 1; } *(undefined4 *)(local_6c + 0x518) = 1; in_ECX = local_6c; } else if ((local_78 == 0) || ((*(int *)(in_ECX + 0x51c) != 0 || (iVar4 = vorbis_synthesis_headerin(local_98), iVar4 < 0)))) { if (pvVar3 != (void *)0x0) { free(pvVar3); } if (local_1f0 != (void *)0x0) { free(local_1f0); } if (local_1ec != (void *)0x0) { free(local_1ec); } memset(local_200,0,0x168); } else { ppvVar6 = local_200; puVar7 = local_68; for (iVar4 = 0x5a; iVar4 != 0; iVar4 = iVar4 + -1) { *puVar7 = *ppvVar6; ppvVar6 = ppvVar6 + 1; puVar7 = puVar7 + 1; } *(undefined4 *)(local_6c + 0x51c) = 1; in_ECX = local_6c; } syncState = (int *)(in_ECX + 0xb0); iVar4 = ogg_sync_pageout(syncState,(void *)(in_ECX + 0xcc)); } } while( true ); joined_r0x00a8e9b2: if (0 < iVar4) { ogg_stream_pagein(); } LAB_00a8e9c1: do { iVar4 = *(int *)(in_ECX + 0x518); if (((iVar4 < 1) || (2 < iVar4)) && ((*(int *)(in_ECX + 0x51c) == 0 || (2 < *(int *)(in_ECX + 0x51c))))) { ExceptionList = local_10; return; } while ((((0 < iVar4 && (iVar4 < 3)) && (piVar1 = (int *)(in_ECX + 0x248), piVar1 != (int *)0x0)) && (*piVar1 != 0))) { iVar4 = ogg_stream_packetout(piVar1,local_98); if (iVar4 == 0) break; if (iVar4 < 0) { std::string::string_from_cstr(local_2c,(byte *)"Error parsing Theora stream headers!"); local_8 = 0; uVar8 = 0x312; goto LAB_00a8ec9c; } iVar4 = FUN_00adffc0(in_ECX + 0x3b0,in_ECX + 0x3f0,in_ECX + 0x400,local_98); if (iVar4 == 0) { std::string::string_from_cstr(local_2c,(byte *)"Invalid theora stream!"); local_8 = 1; uVar8 = 0x316; goto LAB_00a8ec9c; } iVar4 = *(int *)(in_ECX + 0x518) + 1; *(int *)(in_ECX + 0x518) = iVar4; } if (*(int *)(in_ECX + 0x51c) < 3) { while( true ) { piVar1 = (int *)(in_ECX + 0xe0); if ((piVar1 == (int *)0x0) || (*piVar1 == 0)) goto LAB_00a8eac1; iVar4 = ogg_stream_packetout(piVar1,local_98); if (iVar4 == 0) goto LAB_00a8eac1; if (iVar4 < 0) break; iVar4 = vorbis_synthesis_headerin(local_98); if (iVar4 != 0) { std::string::string_from_cstr(local_2c,(byte *)"Invalid stream!"); local_8 = 3; uVar8 = 0x323; goto LAB_00a8ec9c; } *(int *)(in_ECX + 0x51c) = *(int *)(in_ECX + 0x51c) + 1; if (2 < *(int *)(in_ECX + 0x51c)) goto LAB_00a8eac1; } std::string::string_from_cstr(local_2c,(byte *)"Error parsing vorbis stream headers!"); local_8 = 2; uVar8 = 799; LAB_00a8ec9c: theoraplayer::_Exception::_Exception (local_2c, "F:\\NicalisSVN\\KAGE\\trunk\\Build\\External\\LibTheora\\theoraplayer\\src\\formats\\Theora\\VideoClip_Theora.cpp" ,uVar8); pExceptionObject = local_48; goto LAB_00a8ecb5; } LAB_00a8eac1: iVar4 = ogg_sync_pageout(syncState,(void *)(in_ECX + 0xcc)); if (0 < iVar4) break; iVar4 = syncState[1]; if (iVar4 < 0) { iVar5 = 0; } else { iVar5 = syncState[3]; if (iVar5 != 0) { syncState[2] = syncState[2] - iVar5; if (0 < syncState[2]) { memmove((void *)*syncState,(void *)(*syncState + iVar5),syncState[2]); iVar4 = syncState[1]; } syncState[3] = 0; } iVar5 = syncState[2]; if (iVar4 - iVar5 < 0x1000) { local_68 = (undefined4 *)(iVar5 + 0x2000); if ((void *)*syncState == (void *)0x0) { pvVar3 = malloc((size_t)local_68); } else { pvVar3 = realloc((void *)*syncState,(size_t)local_68); } if (pvVar3 == (void *)0x0) { if ((void *)*syncState != (void *)0x0) { free((void *)*syncState); } iVar5 = 0; *syncState = 0; syncState[1] = 0; syncState[2] = 0; syncState[3] = 0; syncState[4] = 0; syncState[5] = 0; syncState[6] = 0; goto LAB_00a8eba8; } iVar5 = syncState[2]; *syncState = (int)pvVar3; syncState[1] = (int)local_68; } iVar5 = *syncState + iVar5; } LAB_00a8eba8: iVar4 = (**(code **)(**(int **)(in_ECX + 0x24) + 0x10))(iVar5,0x1000); if ((-1 < *(int *)(in_ECX + 0xb4)) && (iVar5 = *(int *)(in_ECX + 0xb8) + iVar4, iVar5 <= *(int *)(in_ECX + 0xb4))) { *(int *)(in_ECX + 0xb8) = iVar5; } if (iVar4 == 0) { std::string::string_from_cstr(local_2c,(byte *)"End of file found prematurely!"); local_8 = 4; theoraplayer::_Exception::_Exception (local_2c, "F:\\NicalisSVN\\KAGE\\trunk\\Build\\External\\LibTheora\\theoraplayer\\src\\formats\\Theora\\VideoClip_Theora.cpp" ,0x33a); pExceptionObject = local_64; LAB_00a8ecb5: /* WARNING: Subroutine does not return */ _CxxThrowException(pExceptionObject,(ThrowInfo *)&DAT_00bd5d50); } } while( true ); if (0 < *(int *)(in_ECX + 0x518)) { ogg_stream_pagein(); } iVar4 = *(int *)(in_ECX + 0x51c); goto joined_r0x00a8e9b2; } //@@ 00a8ecc0 wgl_provider_resolver /* DB: libepoxy wgl_generated_dispatch.c: switch over provider enum, epoxy_wglGetProcAddress("wglGetExtensionsStringARB"), entrypoint name table indexed from "wglAllocateMemoryNV", WGL_* extension names, "Implementation unexpectedly missing WGL_ARB_extensions_string. Probably a libepoxy bug." */ void wgl_provider_resolver(int param_1) { char cVar1; int iVar2; code *pcVar3; undefined4 uVar4; int *in_EDX; int iVar5; iVar5 = 0; iVar2 = *in_EDX; while (iVar2 != 0) { /* WARNING: Could not find normalized switch variable to match jumptable */ switch(iVar2) { case 0: goto switchD_00a8ece9_caseD_0; case 1: FUN_00a62750(); return; case 2: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 == (code *)0x0) break; (*pcVar3)(iVar2); LAB_00a8f2b4: cVar1 = FUN_00a62620(); if (cVar1 != '\0') { LAB_00a8f2d4: (*(code *)epoxy_wglGetProcAddress)("wglAllocateMemoryNV" + *(ushort *)(param_1 + iVar5 * 2)) ; return; } goto switchD_00a8ece9_default; case 3: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 4: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 5: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 6: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 7: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 8: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 9: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 10: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0xb: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0xc: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0xd: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0xe: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0xf: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x10: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x11: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x12: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x13: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x14: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x15: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x16: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x17: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x18: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x19: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x1a: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x1b: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x1c: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x1d: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x1e: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x1f: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; case 0x20: iVar2 = (*(code *)epoxy_wglGetCurrentDC)(); if (iVar2 == 0) goto LAB_00a8f2d4; pcVar3 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar3 != (code *)0x0) { (*pcVar3)(iVar2); goto LAB_00a8f2b4; } break; default: goto switchD_00a8ece9_default; } uVar4 = __acrt_iob_func(2, "Implementation unexpectedly missing WGL_ARB_extensions_string. Probably a libepoxy bug.\n" ); FUN_008c5d50(uVar4); switchD_00a8ece9_default: iVar5 = iVar5 + 1; iVar2 = in_EDX[iVar5]; } switchD_00a8ece9_caseD_0: /* WARNING: Subroutine does not return */ /* WARNING: This code block may not be properly labeled as switch case */ abort(); } //@@ 00a8f390 FUN_00a8f390 void FUN_00a8f390(void) { undefined1 local_8 [4]; wgl_provider_resolver(local_8); return; } //@@ 00a8f3c0 FUN_00a8f3c0 void FUN_00a8f3c0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { epoxy_wglAllocateMemoryNV = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglAllocateMemoryNV)(param_1,param_2,param_3,param_4); return; } //@@ 00a8f400 FUN_00a8f400 void FUN_00a8f400(void) { epoxy_wglAssociateImageBufferEventsI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f415. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglAssociateImageBufferEventsI3D)(); return; } //@@ 00a8f440 FUN_00a8f440 void FUN_00a8f440(void) { epoxy_wglBindDisplayColorTableEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f456. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBindDisplayColorTableEXT)(); return; } //@@ 00a8f460 FUN_00a8f460 void FUN_00a8f460(void) { epoxy_wglBindSwapBarrierNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f476. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBindSwapBarrierNV)(); return; } //@@ 00a8f480 FUN_00a8f480 void FUN_00a8f480(void) { epoxy_wglBindTexImageARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f496. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBindTexImageARB)(); return; } //@@ 00a8f4a0 FUN_00a8f4a0 void FUN_00a8f4a0(void) { epoxy_wglBindVideoCaptureDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f4b6. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBindVideoCaptureDeviceNV)(); return; } //@@ 00a8f4c0 FUN_00a8f4c0 void FUN_00a8f4c0(void) { epoxy_wglBindVideoDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f4d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBindVideoDeviceNV)(); return; } //@@ 00a8f4e0 FUN_00a8f4e0 void FUN_00a8f4e0(void) { epoxy_wglBindVideoImageNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f4f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBindVideoImageNV)(); return; } //@@ 00a8f500 FUN_00a8f500 void FUN_00a8f500(void) { epoxy_wglBlitContextFramebufferAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f518. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglBlitContextFramebufferAMD)(); return; } //@@ 00a8f520 FUN_00a8f520 void FUN_00a8f520(void) { epoxy_wglChoosePixelFormatARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f538. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglChoosePixelFormatARB)(); return; } //@@ 00a8f540 FUN_00a8f540 void FUN_00a8f540(void) { epoxy_wglChoosePixelFormatEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f558. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglChoosePixelFormatEXT)(); return; } //@@ 00a8f560 FUN_00a8f560 void FUN_00a8f560(void) { epoxy_wglCopyContext = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f578. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCopyContext)(); return; } //@@ 00a8f580 FUN_00a8f580 void FUN_00a8f580(void) { epoxy_wglCopyImageSubDataNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f598. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCopyImageSubDataNV)(); return; } //@@ 00a8f5a0 FUN_00a8f5a0 void FUN_00a8f5a0(void) { epoxy_wglCreateAffinityDCNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f5b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateAffinityDCNV)(); return; } //@@ 00a8f5c0 FUN_00a8f5c0 void FUN_00a8f5c0(void) { epoxy_wglCreateAssociatedContextAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f5d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateAssociatedContextAMD)(); return; } //@@ 00a8f5e0 FUN_00a8f5e0 void FUN_00a8f5e0(void) { epoxy_wglCreateAssociatedContextAttribsAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f5f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateAssociatedContextAttribsAMD)(); return; } //@@ 00a8f600 FUN_00a8f600 void FUN_00a8f600(void) { epoxy_wglCreateBufferRegionARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f618. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateBufferRegionARB)(); return; } //@@ 00a8f620 FUN_00a8f620 void FUN_00a8f620(void) { epoxy_wglCreateContext = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f638. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateContext)(); return; } //@@ 00a8f640 FUN_00a8f640 void FUN_00a8f640(void) { epoxy_wglCreateContextAttribsARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f658. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateContextAttribsARB)(); return; } //@@ 00a8f660 FUN_00a8f660 void FUN_00a8f660(void) { epoxy_wglCreateDisplayColorTableEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f678. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateDisplayColorTableEXT)(); return; } //@@ 00a8f680 FUN_00a8f680 void FUN_00a8f680(void) { epoxy_wglCreateImageBufferI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f698. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateImageBufferI3D)(); return; } //@@ 00a8f6a0 FUN_00a8f6a0 void FUN_00a8f6a0(void) { epoxy_wglCreateLayerContext = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f6b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreateLayerContext)(); return; } //@@ 00a8f6c0 FUN_00a8f6c0 void FUN_00a8f6c0(void) { epoxy_wglCreatePbufferARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f6d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreatePbufferARB)(); return; } //@@ 00a8f6e0 FUN_00a8f6e0 void FUN_00a8f6e0(void) { epoxy_wglCreatePbufferEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f6f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglCreatePbufferEXT)(); return; } //@@ 00a8f700 FUN_00a8f700 void FUN_00a8f700(void) { epoxy_wglDXCloseDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f718. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXCloseDeviceNV)(); return; } //@@ 00a8f720 FUN_00a8f720 void FUN_00a8f720(void) { epoxy_wglDXLockObjectsNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f738. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXLockObjectsNV)(); return; } //@@ 00a8f740 FUN_00a8f740 void FUN_00a8f740(void) { epoxy_wglDXObjectAccessNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f758. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXObjectAccessNV)(); return; } //@@ 00a8f760 FUN_00a8f760 void FUN_00a8f760(void) { epoxy_wglDXOpenDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f778. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXOpenDeviceNV)(); return; } //@@ 00a8f780 FUN_00a8f780 void FUN_00a8f780(void) { epoxy_wglDXRegisterObjectNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f798. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXRegisterObjectNV)(); return; } //@@ 00a8f7a0 FUN_00a8f7a0 void FUN_00a8f7a0(void) { epoxy_wglDXSetResourceShareHandleNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f7b8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXSetResourceShareHandleNV)(); return; } //@@ 00a8f7c0 FUN_00a8f7c0 void FUN_00a8f7c0(void) { epoxy_wglDXUnlockObjectsNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f7d8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXUnlockObjectsNV)(); return; } //@@ 00a8f7e0 FUN_00a8f7e0 void FUN_00a8f7e0(void) { epoxy_wglDXUnregisterObjectNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f7f8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDXUnregisterObjectNV)(); return; } //@@ 00a8f800 FUN_00a8f800 void FUN_00a8f800(undefined4 param_1,undefined4 param_2) { epoxy_wglDelayBeforeSwapNV = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglDelayBeforeSwapNV)(param_1,param_2); return; } //@@ 00a8f830 FUN_00a8f830 void FUN_00a8f830(void) { epoxy_wglDeleteAssociatedContextAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f848. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDeleteAssociatedContextAMD)(); return; } //@@ 00a8f850 FUN_00a8f850 void FUN_00a8f850(void) { epoxy_wglDeleteBufferRegionARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f868. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDeleteBufferRegionARB)(); return; } //@@ 00a8f870 FUN_00a8f870 void FUN_00a8f870(void) { epoxy_wglDeleteContext = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f888. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDeleteContext)(); return; } //@@ 00a8f890 FUN_00a8f890 void FUN_00a8f890(void) { epoxy_wglDeleteDCNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f8a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDeleteDCNV)(); return; } //@@ 00a8f8b0 FUN_00a8f8b0 void FUN_00a8f8b0(void) { epoxy_wglDescribeLayerPlane = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f8c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDescribeLayerPlane)(); return; } //@@ 00a8f8d0 FUN_00a8f8d0 void FUN_00a8f8d0(void) { epoxy_wglDestroyDisplayColorTableEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f8e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDestroyDisplayColorTableEXT)(); return; } //@@ 00a8f8f0 FUN_00a8f8f0 void FUN_00a8f8f0(void) { epoxy_wglDestroyImageBufferI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f908. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDestroyImageBufferI3D)(); return; } //@@ 00a8f910 FUN_00a8f910 void FUN_00a8f910(void) { epoxy_wglDestroyPbufferARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f928. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDestroyPbufferARB)(); return; } //@@ 00a8f930 FUN_00a8f930 void FUN_00a8f930(void) { epoxy_wglDestroyPbufferEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f948. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDestroyPbufferEXT)(); return; } //@@ 00a8f970 FUN_00a8f970 void FUN_00a8f970(void) { epoxy_wglDisableGenlockI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f988. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglDisableGenlockI3D)(); return; } //@@ 00a8f9b0 FUN_00a8f9b0 void FUN_00a8f9b0(void) { epoxy_wglEnableGenlockI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8f9c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglEnableGenlockI3D)(); return; } //@@ 00a8f9f0 FUN_00a8f9f0 void FUN_00a8f9f0(void) { epoxy_wglEnumGpuDevicesNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fa08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglEnumGpuDevicesNV)(); return; } //@@ 00a8fa10 FUN_00a8fa10 void FUN_00a8fa10(void) { epoxy_wglEnumGpusFromAffinityDCNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fa28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglEnumGpusFromAffinityDCNV)(); return; } //@@ 00a8fa30 FUN_00a8fa30 void FUN_00a8fa30(void) { epoxy_wglEnumGpusNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fa48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglEnumGpusNV)(); return; } //@@ 00a8fa50 FUN_00a8fa50 void FUN_00a8fa50(void) { epoxy_wglEnumerateVideoCaptureDevicesNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fa68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglEnumerateVideoCaptureDevicesNV)(); return; } //@@ 00a8fa70 FUN_00a8fa70 void FUN_00a8fa70(void) { epoxy_wglEnumerateVideoDevicesNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fa88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglEnumerateVideoDevicesNV)(); return; } //@@ 00a8fa90 FUN_00a8fa90 void FUN_00a8fa90(void) { epoxy_wglFreeMemoryNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8faa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglFreeMemoryNV)(); return; } //@@ 00a8fab0 FUN_00a8fab0 void FUN_00a8fab0(void) { epoxy_wglGenlockSampleRateI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fac8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGenlockSampleRateI3D)(); return; } //@@ 00a8fad0 FUN_00a8fad0 void FUN_00a8fad0(void) { epoxy_wglGenlockSourceDelayI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fae8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGenlockSourceDelayI3D)(); return; } //@@ 00a8faf0 FUN_00a8faf0 void FUN_00a8faf0(void) { epoxy_wglGenlockSourceEdgeI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fb08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGenlockSourceEdgeI3D)(); return; } //@@ 00a8fb10 FUN_00a8fb10 void FUN_00a8fb10(void) { epoxy_wglGenlockSourceI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fb28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGenlockSourceI3D)(); return; } //@@ 00a8fb30 FUN_00a8fb30 void FUN_00a8fb30(void) { epoxy_wglGetContextGPUIDAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fb48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetContextGPUIDAMD)(); return; } //@@ 00a8fb90 FUN_00a8fb90 void FUN_00a8fb90(void) { epoxy_wglGetCurrentDC = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fba4. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetCurrentDC)(); return; } //@@ 00a8fbf0 FUN_00a8fbf0 void FUN_00a8fbf0(void) { epoxy_wglGetDefaultProcAddress = (undefined *)wgl_provider_resolver(&DAT_00b3db44); /* WARNING: Could not recover jumptable at 0x00a8fc0b. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetDefaultProcAddress)(); return; } //@@ 00a8fc10 FUN_00a8fc10 void FUN_00a8fc10(void) { epoxy_wglGetDigitalVideoParametersI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fc28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetDigitalVideoParametersI3D)(); return; } //@@ 00a8fc30 FUN_00a8fc30 void FUN_00a8fc30(void) { epoxy_wglGetExtensionsStringARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fc48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetExtensionsStringARB)(); return; } //@@ 00a8fc70 FUN_00a8fc70 void FUN_00a8fc70(void) { epoxy_wglGetFrameUsageI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fc88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetFrameUsageI3D)(); return; } //@@ 00a8fc90 FUN_00a8fc90 void FUN_00a8fc90(void) { epoxy_wglGetGPUIDsAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fca8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGPUIDsAMD)(); return; } //@@ 00a8fcb0 FUN_00a8fcb0 void FUN_00a8fcb0(void) { epoxy_wglGetGPUInfoAMD = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fcc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGPUInfoAMD)(); return; } //@@ 00a8fcd0 FUN_00a8fcd0 void FUN_00a8fcd0(void) { epoxy_wglGetGammaTableI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fce8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGammaTableI3D)(); return; } //@@ 00a8fcf0 FUN_00a8fcf0 void FUN_00a8fcf0(void) { epoxy_wglGetGammaTableParametersI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fd08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGammaTableParametersI3D)(); return; } //@@ 00a8fd10 FUN_00a8fd10 void FUN_00a8fd10(void) { epoxy_wglGetGenlockSampleRateI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fd28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGenlockSampleRateI3D)(); return; } //@@ 00a8fd30 FUN_00a8fd30 void FUN_00a8fd30(void) { epoxy_wglGetGenlockSourceDelayI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fd48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGenlockSourceDelayI3D)(); return; } //@@ 00a8fd50 FUN_00a8fd50 void FUN_00a8fd50(void) { epoxy_wglGetGenlockSourceEdgeI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fd68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGenlockSourceEdgeI3D)(); return; } //@@ 00a8fd70 FUN_00a8fd70 void FUN_00a8fd70(void) { epoxy_wglGetGenlockSourceI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fd88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetGenlockSourceI3D)(); return; } //@@ 00a8fd90 FUN_00a8fd90 void FUN_00a8fd90(void) { epoxy_wglGetLayerPaletteEntries = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fda8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetLayerPaletteEntries)(); return; } //@@ 00a8fdb0 FUN_00a8fdb0 void FUN_00a8fdb0(void) { epoxy_wglGetMscRateOML = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fdc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetMscRateOML)(); return; } //@@ 00a8fdd0 FUN_00a8fdd0 void FUN_00a8fdd0(void) { epoxy_wglGetPbufferDCARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fde8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetPbufferDCARB)(); return; } //@@ 00a8fdf0 FUN_00a8fdf0 void FUN_00a8fdf0(void) { epoxy_wglGetPbufferDCEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fe08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetPbufferDCEXT)(); return; } //@@ 00a8fe10 FUN_00a8fe10 void FUN_00a8fe10(void) { epoxy_wglGetPixelFormatAttribfvARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fe28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetPixelFormatAttribfvARB)(); return; } //@@ 00a8fe30 FUN_00a8fe30 void FUN_00a8fe30(void) { epoxy_wglGetPixelFormatAttribfvEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fe48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetPixelFormatAttribfvEXT)(); return; } //@@ 00a8fe50 FUN_00a8fe50 void FUN_00a8fe50(void) { epoxy_wglGetPixelFormatAttribivARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fe68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetPixelFormatAttribivARB)(); return; } //@@ 00a8fe70 FUN_00a8fe70 void FUN_00a8fe70(void) { epoxy_wglGetPixelFormatAttribivEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fe88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetPixelFormatAttribivEXT)(); return; } //@@ 00a8fe90 FUN_00a8fe90 void FUN_00a8fe90(void) { epoxy_wglGetProcAddress = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fea8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetProcAddress)(); return; } //@@ 00a8fed0 FUN_00a8fed0 void FUN_00a8fed0(void) { epoxy_wglGetSyncValuesOML = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8fee8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetSyncValuesOML)(); return; } //@@ 00a8fef0 FUN_00a8fef0 void FUN_00a8fef0(void) { epoxy_wglGetVideoDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ff08. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetVideoDeviceNV)(); return; } //@@ 00a8ff10 FUN_00a8ff10 void FUN_00a8ff10(void) { epoxy_wglGetVideoInfoNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ff28. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglGetVideoInfoNV)(); return; } //@@ 00a8ff30 FUN_00a8ff30 void FUN_00a8ff30(void) { epoxy_wglIsEnabledFrameLockI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ff48. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglIsEnabledFrameLockI3D)(); return; } //@@ 00a8ff50 FUN_00a8ff50 void FUN_00a8ff50(void) { epoxy_wglIsEnabledGenlockI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ff68. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglIsEnabledGenlockI3D)(); return; } //@@ 00a8ff70 FUN_00a8ff70 void FUN_00a8ff70(void) { epoxy_wglJoinSwapGroupNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ff88. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglJoinSwapGroupNV)(); return; } //@@ 00a8ff90 FUN_00a8ff90 void FUN_00a8ff90(void) { epoxy_wglLoadDisplayColorTableEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ffa8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglLoadDisplayColorTableEXT)(); return; } //@@ 00a8ffb0 FUN_00a8ffb0 void FUN_00a8ffb0(void) { epoxy_wglLockVideoCaptureDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ffc8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglLockVideoCaptureDeviceNV)(); return; } //@@ 00a8ffd0 FUN_00a8ffd0 void FUN_00a8ffd0(void) { PTR_FUN_00c13488 = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a8ffe8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c13488)(); return; } //@@ 00a8fff0 FUN_00a8fff0 void FUN_00a8fff0(void) { PTR_FUN_00c135a0 = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90008. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c135a0)(); return; } //@@ 00a90010 FUN_00a90010 void FUN_00a90010(void) { PTR_FUN_00c1357c = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90028. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c1357c)(); return; } //@@ 00a90030 FUN_00a90030 void FUN_00a90030(void) { PTR_FUN_00c1346c = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90048. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c1346c)(); return; } //@@ 00a90050 FUN_00a90050 void FUN_00a90050(void) { epoxy_wglQueryCurrentContextNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90068. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryCurrentContextNV)(); return; } //@@ 00a90070 FUN_00a90070 void FUN_00a90070(void) { epoxy_wglQueryFrameCountNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90088. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryFrameCountNV)(); return; } //@@ 00a90090 FUN_00a90090 void FUN_00a90090(void) { epoxy_wglQueryFrameLockMasterI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a900a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryFrameLockMasterI3D)(); return; } //@@ 00a900b0 FUN_00a900b0 void FUN_00a900b0(void) { epoxy_wglQueryFrameTrackingI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a900c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryFrameTrackingI3D)(); return; } //@@ 00a900d0 FUN_00a900d0 void FUN_00a900d0(void) { epoxy_wglQueryGenlockMaxSourceDelayI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a900e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryGenlockMaxSourceDelayI3D)(); return; } //@@ 00a900f0 FUN_00a900f0 void FUN_00a900f0(void) { epoxy_wglQueryMaxSwapGroupsNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90108. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryMaxSwapGroupsNV)(); return; } //@@ 00a90110 FUN_00a90110 void FUN_00a90110(void) { epoxy_wglQueryPbufferARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90128. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryPbufferARB)(); return; } //@@ 00a90130 FUN_00a90130 void FUN_00a90130(void) { epoxy_wglQueryPbufferEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90148. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryPbufferEXT)(); return; } //@@ 00a90150 FUN_00a90150 void FUN_00a90150(void) { epoxy_wglQuerySwapGroupNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90168. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQuerySwapGroupNV)(); return; } //@@ 00a90170 FUN_00a90170 void FUN_00a90170(void) { epoxy_wglQueryVideoCaptureDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90188. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglQueryVideoCaptureDeviceNV)(); return; } //@@ 00a90190 FUN_00a90190 void FUN_00a90190(void) { epoxy_wglRealizeLayerPalette = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a901a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglRealizeLayerPalette)(); return; } //@@ 00a901b0 FUN_00a901b0 void FUN_00a901b0(void) { epoxy_wglReleaseImageBufferEventsI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a901c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleaseImageBufferEventsI3D)(); return; } //@@ 00a901d0 FUN_00a901d0 void FUN_00a901d0(void) { epoxy_wglReleasePbufferDCARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a901e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleasePbufferDCARB)(); return; } //@@ 00a901f0 FUN_00a901f0 void FUN_00a901f0(void) { epoxy_wglReleasePbufferDCEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90208. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleasePbufferDCEXT)(); return; } //@@ 00a90210 FUN_00a90210 void FUN_00a90210(void) { epoxy_wglReleaseTexImageARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90228. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleaseTexImageARB)(); return; } //@@ 00a90230 FUN_00a90230 void FUN_00a90230(void) { epoxy_wglReleaseVideoCaptureDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90248. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleaseVideoCaptureDeviceNV)(); return; } //@@ 00a90250 FUN_00a90250 void FUN_00a90250(void) { epoxy_wglReleaseVideoDeviceNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90268. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleaseVideoDeviceNV)(); return; } //@@ 00a90270 FUN_00a90270 void FUN_00a90270(void) { epoxy_wglReleaseVideoImageNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90288. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglReleaseVideoImageNV)(); return; } //@@ 00a90290 FUN_00a90290 void FUN_00a90290(void) { epoxy_wglResetFrameCountNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a902a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglResetFrameCountNV)(); return; } //@@ 00a902b0 FUN_00a902b0 void FUN_00a902b0(void) { epoxy_wglRestoreBufferRegionARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a902c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglRestoreBufferRegionARB)(); return; } //@@ 00a902d0 FUN_00a902d0 void FUN_00a902d0(void) { epoxy_wglSaveBufferRegionARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a902e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSaveBufferRegionARB)(); return; } //@@ 00a902f0 FUN_00a902f0 void FUN_00a902f0(void) { epoxy_wglSendPbufferToVideoNV = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90308. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSendPbufferToVideoNV)(); return; } //@@ 00a90310 FUN_00a90310 void FUN_00a90310(void) { epoxy_wglSetDigitalVideoParametersI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90328. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSetDigitalVideoParametersI3D)(); return; } //@@ 00a90330 FUN_00a90330 void FUN_00a90330(void) { epoxy_wglSetGammaTableI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90348. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSetGammaTableI3D)(); return; } //@@ 00a90350 FUN_00a90350 void FUN_00a90350(void) { epoxy_wglSetGammaTableParametersI3D = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90368. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSetGammaTableParametersI3D)(); return; } //@@ 00a90370 FUN_00a90370 void FUN_00a90370(void) { epoxy_wglSetLayerPaletteEntries = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90388. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSetLayerPaletteEntries)(); return; } //@@ 00a90390 FUN_00a90390 void FUN_00a90390(void) { epoxy_wglSetPbufferAttribARB = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a903a8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSetPbufferAttribARB)(); return; } //@@ 00a903b0 FUN_00a903b0 void FUN_00a903b0(void) { epoxy_wglSetStereoEmitterState3DL = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a903c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSetStereoEmitterState3DL)(); return; } //@@ 00a903d0 FUN_00a903d0 void FUN_00a903d0(void) { epoxy_wglShareLists = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a903e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglShareLists)(); return; } //@@ 00a903f0 FUN_00a903f0 void FUN_00a903f0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7) { epoxy_wglSwapBuffersMscOML = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglSwapBuffersMscOML)(param_1,param_2,param_3,param_4,param_5,param_6,param_7); return; } //@@ 00a90430 FUN_00a90430 void FUN_00a90430(void) { epoxy_wglSwapIntervalEXT = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90448. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSwapIntervalEXT)(); return; } //@@ 00a90450 FUN_00a90450 void FUN_00a90450(void) { epoxy_wglSwapLayerBuffers = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a90468. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglSwapLayerBuffers)(); return; } //@@ 00a90470 FUN_00a90470 void FUN_00a90470(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_wglSwapLayerBuffersMscOML = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglSwapLayerBuffersMscOML) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a904b0 FUN_00a904b0 void FUN_00a904b0(void) { epoxy_wglUseFontBitmapsA = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a904c8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglUseFontBitmapsA)(); return; } //@@ 00a904d0 FUN_00a904d0 void FUN_00a904d0(void) { epoxy_wglUseFontBitmapsW = (undefined *)FUN_00a8f390(); /* WARNING: Could not recover jumptable at 0x00a904e8. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)epoxy_wglUseFontBitmapsW)(); return; } //@@ 00a904f0 FUN_00a904f0 void FUN_00a904f0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_wglUseFontOutlines = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglUseFontOutlines) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a90540 FUN_00a90540 void FUN_00a90540(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_wglUseFontOutlinesA = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglUseFontOutlinesA) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a90590 FUN_00a90590 void FUN_00a90590(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8) { epoxy_wglUseFontOutlinesW = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglUseFontOutlinesW) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8); return; } //@@ 00a905e0 FUN_00a905e0 void FUN_00a905e0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined4 param_9,undefined4 param_10) { epoxy_wglWaitForMscOML = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglWaitForMscOML) (param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10); return; } //@@ 00a90620 FUN_00a90620 void FUN_00a90620(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6) { epoxy_wglWaitForSbcOML = (undefined *)FUN_00a8f390(); (*(code *)epoxy_wglWaitForSbcOML)(param_1,param_2,param_3,param_4,param_5,param_6); return; } //@@ 00a90650 theoraplayer::VideoClip::VideoClip /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: sets theoraplayer::VideoClip::vftable, FrameQueue::setSize, throws _Exception "Invalid output mode: FORMAT_UNDEFINED for video: " (src VideoClip.cpp); only caller is the VideoClip_Theora ctor 00a8c700 */ void theoraplayer::VideoClip::VideoClip (int *param_1,int param_2,undefined4 param_3,undefined1 param_4) { int iVar1; int iVar2; int iVar3; undefined1 uVar4; void *ptr; LPCRITICAL_SECTION lpCriticalSection; int *piVar5; undefined4 *puVar6; undefined4 uVar7; undefined4 *in_ECX; uint size; void *pvVar8; uint uVar9; void *local_64; int *local_60; int *local_5c; undefined1 local_58 [28]; void *local_3c [5]; uint local_28; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_3c + 0xe); puStack_18 = &LAB_00b14ce0; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_3c + 0xb); ExceptionList = &local_1c; piVar5 = in_ECX + 1; *in_ECX = vftable; *piVar5 = 0; in_ECX[5] = 0; in_ECX[6] = 0xf; *(undefined1 *)piVar5 = 0; local_14 = (void *)0x0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0; in_ECX[0xf] = 0; *(undefined2 *)(in_ECX + 0x10) = 0; in_ECX[0x11] = 4; in_ECX[0x12] = 0x3f800000; *(undefined1 *)(in_ECX + 0x13) = 0; in_ECX[0x14] = 0; in_ECX[0x15] = 0x3f800000; in_ECX[0x16] = &DAT_bf800000; in_ECX[0x17] = 0; in_ECX[0x18] = 0; in_ECX[0x19] = 0; in_ECX[0x1a] = 0; in_ECX[0x1b] = 0xffffffff; in_ECX[0x1c] = 0x3f800000; *(undefined2 *)(in_ECX + 0x1d) = 0; in_ECX[0x1e] = 0; in_ECX[0x1f] = 0; in_ECX[0x20] = 0; in_ECX[0x21] = 0; in_ECX[0x22] = 0xffffffff; in_ECX[0x23] = 0; *(undefined2 *)(in_ECX + 0x24) = 0; in_ECX[0x25] = 0; in_ECX[0x26] = 0; in_ECX[0x27] = 0; in_ECX[0x28] = 0; local_60 = piVar5; local_5c = (int *)(**(code **)(*param_1 + 0x18))(local_3c,local_24); if (piVar5 != local_5c) { uVar9 = in_ECX[6]; if (0xf < uVar9) { pvVar8 = (void *)*piVar5; size = uVar9 + 1; ptr = pvVar8; if (0xfff < size) { ptr = *(void **)((int)pvVar8 + -4); size = uVar9 + 0x24; if (0x1f < (uint)((int)pvVar8 + (-4 - (int)ptr))) goto LAB_00a9085b; } operator_delete(ptr,size); } in_ECX[5] = 0; in_ECX[6] = 0xf; *(undefined1 *)piVar5 = 0; iVar1 = local_5c[1]; iVar2 = local_5c[2]; iVar3 = local_5c[3]; *piVar5 = *local_5c; in_ECX[2] = iVar1; in_ECX[3] = iVar2; in_ECX[4] = iVar3; *(undefined8 *)(in_ECX + 5) = *(undefined8 *)(local_5c + 4); local_5c[4] = 0; local_5c[5] = 0xf; *(undefined1 *)local_5c = 0; } if (0xf < local_28) { uVar9 = local_28 + 1; pvVar8 = local_3c[0]; if (0xfff < uVar9) { pvVar8 = *(void **)((int)local_3c[0] + -4); uVar9 = local_28 + 0x24; if (0x1f < (uint)((int)local_3c[0] + (-4 - (int)pvVar8))) { LAB_00a9085b: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar9); } in_ECX[0x11] = param_3; in_ECX[0x23] = param_2; *(undefined1 *)((int)in_ECX + 0x41) = param_4; local_5c = operator_new(8); if (local_5c == (undefined4 *)0x0) { piVar5 = (undefined4 *)0x0; } else { *local_5c = 0; *(undefined1 *)(local_5c + 1) = 0; lpCriticalSection = malloc(0x18); *local_5c = (int)lpCriticalSection; InitializeCriticalSection(lpCriticalSection); piVar5 = local_5c; } in_ECX[0xe] = piVar5; local_5c = operator_new(0x10); if (local_5c == (undefined4 *)0x0) { puVar6 = (undefined4 *)0x0; } else { *local_5c = (int)Timer::vftable; local_5c[1] = 0; local_5c[2] = 0x3f800000; *(undefined1 *)(local_5c + 3) = 0; puVar6 = local_5c; } in_ECX[0xb] = puVar6; in_ECX[10] = puVar6; if (param_2 == 0) { uVar7 = FUN_006941b0(local_60); local_14 = (void *)CONCAT31(local_14._1_3_,1); _Exception::_Exception (uVar7, "F:\\NicalisSVN\\KAGE\\trunk\\Build\\External\\LibTheora\\theoraplayer\\src\\VideoClip.cpp" ,0x92); /* WARNING: Subroutine does not return */ _CxxThrowException(local_58,(ThrowInfo *)&DAT_00bd5d50); } if (in_ECX[0x14] != param_2) { in_ECX[0x23] = param_2; if (((((param_2 == 2) || (param_2 == 4)) || (param_2 == 7)) || ((param_2 == 9 || (param_2 == 0xd)))) || ((param_2 == 0xf || ((param_2 == 0x12 || (param_2 == 0x14)))))) { uVar4 = 1; } else { uVar4 = 0; } *(undefined1 *)(in_ECX + 0x10) = uVar4; if (in_ECX[0xc] != 0) { pvVar8 = (void *)in_ECX[0xe]; local_64 = (void *)0x0; local_60 = (int *)((uint)local_60 & 0xffffff00); if (pvVar8 != (void *)0x0) { local_64 = pvVar8; Mutex::lock(pvVar8); } local_14 = (void *)CONCAT31(local_14._1_3_,2); FrameQueue::setSize(*(undefined4 *)(in_ECX[7] + 4)); Mutex::ScopeLock::~ScopeLock(&local_64); } in_ECX[0x14] = in_ECX[0x23]; } ExceptionList = local_1c; return; } //@@ 00a909d0 FUN_00a909d0 void FUN_00a909d0(byte param_1) { void *in_ECX; FUN_00a90a00(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xa4); } return; } //@@ 00a90a00 FUN_00a90a00 void FUN_00a90a00(void) { int *ptr; undefined4 *this; uint uVar1; undefined4 *in_ECX; undefined4 *puVar2; int *piVar3; undefined4 *local_20; undefined1 local_1c; undefined4 *local_18; undefined1 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14d10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; puVar2 = (undefined4 *)in_ECX[0xe]; *in_ECX = theoraplayer::VideoClip::vftable; local_20 = (undefined4 *)0x0; local_1c = 0; if (puVar2 != (undefined4 *)0x0) { local_20 = puVar2; Mutex::lock(puVar2); } if ((undefined4 *)in_ECX[0xb] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX[0xb])(1,uVar1); } if ((undefined4 *)in_ECX[9] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)in_ECX[9])(1); } ptr = (int *)in_ECX[7]; if (ptr != (int *)0x0) { local_8 = 0; piVar3 = *(int **)*ptr; if (piVar3 != (int *)*ptr) { do { if ((undefined4 *)piVar3[2] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)piVar3[2])(1); } piVar3 = (int *)*piVar3; } while (piVar3 != (int *)*ptr); } FUN_00aaac20(); puVar2 = (undefined4 *)ptr[3]; if (puVar2 != (undefined4 *)0x0) { DeleteCriticalSection((LPCRITICAL_SECTION)*puVar2); free((void *)*puVar2); operator_delete(puVar2,8); } FUN_00498f80(); local_8 = 0xffffffff; operator_delete(ptr,0x10); } puVar2 = (undefined4 *)in_ECX[8]; if (puVar2 == (undefined4 *)0x0) goto LAB_00a90b53; this = (undefined4 *)in_ECX[0xd]; local_18 = (undefined4 *)0x0; local_14 = 0; if (this == (undefined4 *)0x0) { LAB_00a90b0a: (**(code **)*puVar2)(1); } else { local_18 = this; Mutex::lock(this); puVar2 = (undefined4 *)in_ECX[8]; if (puVar2 != (undefined4 *)0x0) goto LAB_00a90b0a; } if (local_18 != (undefined4 *)0x0) { *(undefined1 *)(local_18 + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_18); local_18 = (undefined4 *)0x0; } puVar2 = (undefined4 *)in_ECX[0xd]; if (puVar2 != (undefined4 *)0x0) { DeleteCriticalSection((LPCRITICAL_SECTION)*puVar2); free((void *)*puVar2); operator_delete(puVar2,8); } Mutex::ScopeLock::~ScopeLock(&local_18); LAB_00a90b53: if (local_20 != (undefined4 *)0x0) { *(undefined1 *)(local_20 + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_20); local_20 = (undefined4 *)0x0; } puVar2 = (undefined4 *)in_ECX[0xe]; if (puVar2 != (undefined4 *)0x0) { DeleteCriticalSection((LPCRITICAL_SECTION)*puVar2); free((void *)*puVar2); operator_delete(puVar2,8); } Mutex::ScopeLock::~ScopeLock(&local_20); std::string::_Tidy_deallocate((char *)(in_ECX + 1)); ExceptionList = local_10; return; } //@@ 00a90bc0 FUN_00a90bc0 void FUN_00a90bc0(void) { float fVar1; float fVar2; char cVar3; int iVar4; int in_ECX; float10 fVar5; float fVar6; float in_XMM1_Da; cVar3 = (**(code **)(**(int **)(in_ECX + 0x28) + 0x10))(); if (cVar3 != '\0') { (**(code **)(**(int **)(in_ECX + 0x28) + 0x14))(0); return; } fVar5 = (float10)(**(code **)(**(int **)(in_ECX + 0x28) + 4))(); fVar2 = (float)fVar5; fVar5 = (float10)(**(code **)(**(int **)(in_ECX + 0x28) + 8))(); fVar1 = *(float *)(in_ECX + 0x58); fVar6 = (float)fVar5 * in_XMM1_Da + fVar2; if (fVar6 < fVar1) { (**(code **)(**(int **)(in_ECX + 0x28) + 0x14))(in_XMM1_Da); } else { if ((*(char *)(in_ECX + 0x4c) != '\0') && (*(char *)(in_ECX + 0x91) != '\0')) { iVar4 = *(int *)(in_ECX + 0x98); do { fVar6 = fVar6 - fVar1; iVar4 = iVar4 + 1; } while (fVar1 <= fVar6); *(int *)(in_ECX + 0x98) = iVar4; (**(code **)(**(int **)(in_ECX + 0x28) + 0x24))(fVar6); return; } if (fVar2 != fVar1) { (**(code **)(**(int **)(in_ECX + 0x28) + 0x14))((fVar1 - fVar2) / (float)fVar5); return; } } return; } //@@ 00a90ca0 KAGE_Graphics_RenderTargetBase::RenderTargetBase /* DB: ctor: base ctor FUN_00a69950, stores KAGE::Graphics::RenderTargetBase::vftable, ImageBase::set_size(w,h), heap_alloc w*h*4 texel buffer ("Could not allocate %d bytes to store texel data for render target") filled with the clear color; KAGE_Graphics::create_render_target then overwrites the vftable with PlatformRenderTarget */ int * KAGE_Graphics_RenderTargetBase::RenderTargetBase(uint param_1,uint param_2,char *param_3) { char cVar1; void *_Dst; uint uVar2; uint uVar3; uint uVar4; int iVar5; char *_Dest; code *pcVar6; int *in_ECX; void *this; char *pcVar7; size_t _Size; undefined4 uVar8; size_t local_1c [2]; int *local_14; void *local_10; undefined1 *puStack_c; size_t local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14d3d; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; FUN_00a69950(__security_cookie ^ (uint)(local_1c + 6)); local_8 = 0; *in_ECX = (int)KAGE::Graphics::RenderTargetBase::vftable; in_ECX[2] = in_ECX[2] | 2; in_ECX[3] = in_ECX[3]; ImageBase::set_size(this,param_1,param_2,(int)this); in_ECX[10] = 8; local_1c[1] = 0; _Size = in_ECX[7] * in_ECX[6] * 4; local_1c[0] = _Size; _Dst = KAGE_Memory::heap_alloc(2,(ulonglong *)local_1c); if (_Dst == (void *)0x0) { KAGE_LogMessage(8,(byte *)"Could not allocate %d bytes to store texel data for render target\n") ; ExceptionList = local_10; return in_ECX; } uVar2 = __ftoui3(); uVar3 = __ftoui3(); uVar4 = __ftoui3(); iVar5 = __ftoui3(); memset(_Dst,(uVar3 & 0xff | (uVar4 & 0xff) << 8) << 8 | uVar2 & 0xff | iVar5 << 0x18,_Size); uVar8 = 0; param_2 = 0; iVar5 = local_14[10]; if (iVar5 == 0) { uVar8 = 0x1903; param_2 = 0x1903; } else if (iVar5 == 6) { uVar8 = 0x1907; param_2 = 0x1907; if (((byte)g_graphicsManager_flags & 8) != 0) { uVar8 = 0x8c40; } } else if (iVar5 == 8) { uVar8 = 0x1908; param_2 = 0x1908; if (((byte)g_graphicsManager_flags & 8) != 0) { uVar8 = 0x8c42; } } (*(code *)epoxy_glGenTextures)(1,local_14 + 0x16); (*(code *)epoxy_glBindTexture)(0xde1,local_14[0x16]); (*(code *)epoxy_glTexImage2D)(0xde1,0,uVar8,local_14[6],local_14[7],0,param_2,0x1401,_Dst); KAGE_Memory::heap_free(2,_Dst); if ((void *)local_14[0x10] != (void *)0x0) { local_8._0_1_ = 1; tracked_alloc(1,(void *)local_14[0x10],0); local_8 = (uint)local_8._1_3_ << 8; local_14[0x10] = 0; } if (param_3 == (char *)0x0) { local_14[0x10] = 0; param_3 = (char *)local_14[0x11]; pcVar6 = *(code **)(*local_14 + 0x5c); if (param_3 == (char *)0x0) { param_3 = "unknown"; } } else { pcVar7 = param_3; do { cVar1 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar1 != '\0'); _Dest = operator_new_tracked((uint)(pcVar7 + (1 - (int)(param_3 + 1)))); pcVar7 = param_3; do { cVar1 = *pcVar7; pcVar7 = pcVar7 + 1; } while (cVar1 != '\0'); strncpy(_Dest,param_3,(size_t)(pcVar7 + (1 - (int)(param_3 + 1)))); local_14[0x10] = (int)_Dest; pcVar6 = *(code **)(*local_14 + 0x5c); } if (pcVar6 != GridEntity_Statue::Render) { (*pcVar6)(param_3); } FUN_00a12c00(); ExceptionList = local_10; return local_14; } //@@ 00a90f30 crc32 /* DB: zlib crc32(crc=ECX, buf=EDX, len): ~crc, 8-byte unrolled table loop with table 0xb4e460, ~result; callers png_crc_read/png_crc_finish/png_write_filtered_row prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ uint __cdecl crc32(uint crc,byte *buffer,uint length) { byte *pbVar1; byte bVar2; uint uVar3; uint uVar4; if (buffer == (byte *)0x0) { return 0; } uVar3 = ~crc; if (7 < length) { uVar4 = length >> 3; do { length = length - 8; uVar3 = uVar3 >> 8 ^ *(uint *)(((*buffer ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar3 = uVar3 >> 8 ^ *(uint *)(((buffer[1] ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar3 = uVar3 >> 8 ^ *(uint *)(((buffer[2] ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar3 = uVar3 >> 8 ^ *(uint *)(((buffer[3] ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar3 = uVar3 >> 8 ^ *(uint *)(((buffer[4] ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar3 = uVar3 >> 8 ^ *(uint *)(((buffer[5] ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar3 = uVar3 >> 8 ^ *(uint *)(((buffer[6] ^ uVar3) & 0xff) * 4 + 0xb4e460); pbVar1 = buffer + 7; buffer = buffer + 8; uVar3 = uVar3 >> 8 ^ *(uint *)(((*pbVar1 ^ uVar3) & 0xff) * 4 + 0xb4e460); uVar4 = uVar4 - 1; } while (uVar4 != 0); } for (; length != 0; length = length - 1) { bVar2 = *buffer; buffer = buffer + 1; uVar3 = uVar3 >> 8 ^ *(uint *)(((bVar2 ^ uVar3) & 0xff) * 4 + 0xb4e460); } return ~uVar3; } //@@ 00a91030 FUN_00a91030 void FUN_00a91030(int param_1,uint param_2) { void *in_ECX; byte *in_EDX; png_write_chunk_header(in_ECX,in_EDX,param_2); if ((param_1 != 0) && (param_2 != 0)) { FUN_00a62fb0(param_2); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a910a4; (**(code **)((int)in_ECX + 0x4c))(); } if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); return; } LAB_00a910a4: /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a910c0 png_write_chunk_header /* DB: libpng: write_fn (+0x4c, "Call to NULL write function" via FUN_00a64610), resets crc (+0x108) and computes it over the 4-byte chunk name (EDX) honouring the critical/ancillary crc flags; PngWriter::write_end (IEND), png_write_filtered_row prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl png_write_chunk_header(void *pngPtr,byte *chunkName,uint length) { byte bVar1; uint uVar2; uint uVar3; uint uVar4; int iVar5; uVar3 = length; uVar4 = length >> 0x18; uVar2 = length >> 0x10; length = CONCAT13((char)uVar3,CONCAT12((char)(uVar3 >> 8),CONCAT11((char)uVar2,(char)uVar4))); if (*(code **)((int)pngPtr + 0x4c) != (code *)0x0) { (**(code **)((int)pngPtr + 0x4c))(pngPtr,&length,4); if (*(code **)((int)pngPtr + 0x4c) != (code *)0x0) { (**(code **)((int)pngPtr + 0x4c))(pngPtr,chunkName,4); *(undefined4 *)((int)pngPtr + 0x108) = 0; if ((*(byte *)((int)pngPtr + 0x114) & 0x20) == 0) { if ((*(uint *)((int)pngPtr + 100) & 0x800) == 0) goto LAB_00a9113b; } else if ((*(uint *)((int)pngPtr + 100) & 0x300) != 0x300) { LAB_00a9113b: iVar5 = 4; if (chunkName == (byte *)0x0) { *(undefined4 *)((int)pngPtr + 0x108) = 0; return; } uVar4 = 0xffffffff; do { bVar1 = *chunkName; chunkName = chunkName + 1; uVar4 = uVar4 >> 8 ^ *(uint *)(((bVar1 ^ uVar4) & 0xff) * 4 + 0xb4e460); iVar5 = iVar5 + -1; } while (iVar5 != 0); *(uint *)((int)pngPtr + 0x108) = ~uVar4; return; } return; } } /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a91190 FUN_00a91190 void FUN_00a91190(void) { int in_ECX; if (*(code **)(in_ECX + 0x4c) == (code *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)(in_ECX + 0x4c))(); return; } //@@ 00a911e0 png_write_IHDR /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngwutil.c: called from png_write_info_before_PLTE; switch on color_type/bit_depth with "Invalid bit depth for RGB image"/"...paletted image", "Invalid compression type specified", "Invalid filter type specified", "Invalid interlace type specified", then png_write_chunk_header + crc32 */ void png_write_IHDR(undefined4 param_1,uint param_2,undefined4 param_3,int param_4,int param_5, int param_6) { undefined4 uVar1; void *in_ECX; uint uVar2; char cVar3; int in_EDX; undefined4 *puVar4; undefined4 uVar5; undefined4 local_1c; byte local_18; undefined1 local_17; undefined1 local_16; undefined1 local_15; undefined1 local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; undefined1 local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; switch(param_3) { case 0: switch(param_2) { case 1: case 2: case 4: case 8: case 0x10: switchD_00a91261_caseD_1: *(undefined1 *)((int)in_ECX + 0x122) = 1; break; default: /* WARNING: Subroutine does not return */ FUN_00a64610(); } break; default: /* WARNING: Subroutine does not return */ FUN_00a64610(); case 2: if ((param_2 != 8) && (param_2 != 0x10)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(undefined1 *)((int)in_ECX + 0x122) = 3; break; case 3: switch(param_2) { case 1: case 2: case 4: case 8: goto switchD_00a91261_caseD_1; default: /* WARNING: Subroutine does not return */ FUN_00a64610(); } case 4: if ((param_2 != 8) && (param_2 != 0x10)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(undefined1 *)((int)in_ECX + 0x122) = 2; break; case 6: if ((param_2 != 8) && (param_2 != 0x10)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(undefined1 *)((int)in_ECX + 0x122) = 4; } local_1c = in_EDX; if (param_4 != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid compression type specified"); FUN_008c5d50(uVar5); } else { (**(code **)((int)in_ECX + 0x44))(); } param_4 = 0; } if (param_5 != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid filter type specified"); FUN_008c5d50(uVar5); } else { (**(code **)((int)in_ECX + 0x44))(); } param_5 = 0; } if ((param_6 != 0) && (param_6 != 1)) { FUN_00a64630(); param_6 = 1; } local_c = (undefined1)param_6; *(undefined1 *)((int)in_ECX + 0x11b) = local_c; local_f = (undefined1)param_3; *(undefined1 *)((int)in_ECX + 0x11e) = local_f; uVar2 = (uint)*(byte *)((int)in_ECX + 0x122) * (param_2 & 0xff); *(byte *)((int)in_ECX + 0x123) = *(byte *)((int)in_ECX + 0x122); local_10 = (undefined1)param_2; *(undefined1 *)((int)in_ECX + 0x11f) = local_10; local_15 = (undefined1)local_1c; *(char *)((int)in_ECX + 0x121) = (char)uVar2; *(undefined1 *)((int)in_ECX + 0x120) = local_10; *(int *)((int)in_ECX + 0xc0) = local_1c; *(uint *)((int)in_ECX + 0xd0) = (uVar2 & 0xff) * local_1c + 7 >> 3; local_18 = (byte)((uint)local_1c >> 0x18); local_17 = (undefined1)((uint)local_1c >> 0x10); local_16 = (undefined1)((uint)local_1c >> 8); local_14 = (undefined1)((uint)param_1 >> 0x18); local_13 = (undefined1)((uint)param_1 >> 0x10); local_12 = (undefined1)((uint)param_1 >> 8); local_e = (undefined1)param_4; local_d = (undefined1)param_5; *(undefined4 *)((int)in_ECX + 0xc4) = param_1; *(int *)((int)in_ECX + 0xcc) = local_1c; local_11 = (undefined1)param_1; png_write_chunk_header(in_ECX,(byte *)&DAT_00c129a0,0xd); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) != 0) goto LAB_00a91432; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) == 0x300) goto LAB_00a91432; uVar2 = crc32(*(uint *)((int)in_ECX + 0x108),&local_18,0xd); *(uint *)((int)in_ECX + 0x108) = uVar2; LAB_00a91432: if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); uVar5 = *(undefined4 *)((int)in_ECX + 0x108); local_1c._3_1_ = (undefined1)uVar5; local_1c._0_3_ = CONCAT12((char)((uint)uVar5 >> 8), CONCAT11((char)((uint)uVar5 >> 0x10),(char)((uint)uVar5 >> 0x18))); if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { uVar5 = 4; puVar4 = &local_1c; (**(code **)((int)in_ECX + 0x4c))(); cVar3 = *(char *)((int)in_ECX + 0x11d); *(code **)((int)in_ECX + 0x8c) = FUN_00a62f10; *(code **)((int)in_ECX + 0x90) = FUN_00a62f90; *(void **)((int)in_ECX + 0x94) = in_ECX; if (cVar3 == '\0') { if ((*(char *)((int)in_ECX + 0x11e) == '\x03') || (*(byte *)((int)in_ECX + 0x11f) < 8)) { *(undefined1 *)((int)in_ECX + 0x11d) = 8; cVar3 = '\b'; } else { *(undefined1 *)((int)in_ECX + 0x11d) = 0xf8; cVar3 = -8; } } uVar2 = *(uint *)((int)in_ECX + 100); if ((uVar2 & 1) == 0) { *(uint *)((int)in_ECX + 0xbc) = (uint)(cVar3 != '\b'); } if ((uVar2 & 2) == 0) { *(undefined4 *)((int)in_ECX + 0xac) = 0xffffffff; } if ((uVar2 & 4) == 0) { *(undefined4 *)((int)in_ECX + 0xb8) = 8; } if ((uVar2 & 8) == 0) { *(undefined4 *)((int)in_ECX + 0xb4) = 0xf; } if ((uVar2 & 0x10) == 0) { *(undefined4 *)((int)in_ECX + 0xb0) = 8; uVar1 = 8; } else { uVar1 = *(undefined4 *)((int)in_ECX + 0xb0); } deflateInit2_(uVar1,*(undefined4 *)((int)in_ECX + 0xb4),*(undefined4 *)((int)in_ECX + 0xb8), *(undefined4 *)((int)in_ECX + 0xbc),puVar4,uVar5); *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); *(undefined4 *)((int)in_ECX + 0x60) = 1; return; } } /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a91610 FUN_00a91610 void FUN_00a91610(uint param_1) { byte bVar1; uint uVar2; undefined4 uVar3; void *in_ECX; int in_EDX; byte *pbVar4; undefined1 *puVar5; int iVar6; uint local_c; byte local_8 [4]; if ((param_1 == 0) || (0x100 < param_1)) { if (*(char *)((int)in_ECX + 0x11e) == '\x03') { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar3 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid number of colors in palette"); FUN_008c5d50(uVar3); return; } (**(code **)((int)in_ECX + 0x44))(); return; } *(short *)((int)in_ECX + 0x110) = (short)param_1; png_write_chunk_header(in_ECX,(byte *)(s_PLTE_00c12987 + 1),param_1 * 3); local_c = 0; if (param_1 != 0) { puVar5 = (undefined1 *)(in_EDX + 2); do { local_8[0] = puVar5[-2]; local_8[1] = puVar5[-1]; local_8[2] = *puVar5; if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a91695; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a91695: pbVar4 = local_8; iVar6 = 3; uVar2 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; uVar2 = uVar2 >> 8 ^ *(uint *)(((bVar1 ^ uVar2) & 0xff) * 4 + 0xb4e460); iVar6 = iVar6 + -1; } while (iVar6 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar2; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a91770; (**(code **)((int)in_ECX + 0x4c))(); local_c = local_c + 1; puVar5 = puVar5 + 3; } while (local_c < param_1); } if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 2; return; } LAB_00a91770: /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a91790 png_write_cHRM /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng 1.2 pngwutil.c floating-point png_write_cHRM: 'Invalid cHRM white/red/green/blue point specified' warnings, __dtoui3 (x*100000+0.5) conversions; called from png_write_info_before_PLTE */ void png_write_cHRM(double param_1,double param_2,double param_3,double param_4,double param_5) { undefined4 uVar1; int in_ECX; double in_XMM1_Qa; double in_XMM2_Qa; double in_XMM3_Qa; undefined1 local_28; undefined1 local_27; undefined1 local_26; undefined1 local_25; undefined1 local_24; undefined1 local_23; undefined1 local_22; undefined1 local_21; undefined1 local_20; undefined1 local_1f; undefined1 local_1e; undefined1 local_1d; undefined1 local_1c; undefined1 local_1b; undefined1 local_1a; undefined1 local_19; undefined1 local_18; undefined1 local_17; undefined1 local_16; undefined1 local_15; undefined1 local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; undefined1 local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined1 local_b; undefined1 local_a; undefined1 local_9; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if ((((in_XMM1_Qa < 0.0) || (0.8 < in_XMM1_Qa)) || (in_XMM2_Qa < 0.0)) || ((0.8 < in_XMM2_Qa || (1.0 < in_XMM1_Qa + in_XMM2_Qa)))) { if (*(code **)(in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid cHRM white point specified"); FUN_008c5d50(uVar1); return; } (**(code **)(in_ECX + 0x44))(); return; } uVar1 = __dtoui3(); local_28 = (undefined1)((uint)uVar1 >> 0x18); local_27 = (undefined1)((uint)uVar1 >> 0x10); local_26 = (undefined1)((uint)uVar1 >> 8); local_25 = (undefined1)uVar1; uVar1 = __dtoui3(); local_24 = (undefined1)((uint)uVar1 >> 0x18); local_23 = (undefined1)((uint)uVar1 >> 0x10); local_22 = (undefined1)((uint)uVar1 >> 8); local_21 = (undefined1)uVar1; if (((0.0 <= in_XMM3_Qa) && (in_XMM3_Qa <= 0.8)) && ((0.0 <= param_1 && ((param_1 <= 0.8 && (in_XMM3_Qa + param_1 <= 1.0)))))) { uVar1 = __dtoui3(); local_20 = (undefined1)((uint)uVar1 >> 0x18); local_1f = (undefined1)((uint)uVar1 >> 0x10); local_1e = (undefined1)((uint)uVar1 >> 8); local_1d = (undefined1)uVar1; uVar1 = __dtoui3(); local_1c = (undefined1)((uint)uVar1 >> 0x18); local_1b = (undefined1)((uint)uVar1 >> 0x10); local_1a = (undefined1)((uint)uVar1 >> 8); local_19 = (undefined1)uVar1; if ((((0.0 <= param_2) && (param_2 <= 0.8)) && (0.0 <= param_3)) && ((param_3 <= 0.8 && (param_2 + param_3 <= 1.0)))) { uVar1 = __dtoui3(); local_18 = (undefined1)((uint)uVar1 >> 0x18); local_17 = (undefined1)((uint)uVar1 >> 0x10); local_16 = (undefined1)((uint)uVar1 >> 8); local_15 = (undefined1)uVar1; uVar1 = __dtoui3(); local_14 = (undefined1)((uint)uVar1 >> 0x18); local_13 = (undefined1)((uint)uVar1 >> 0x10); local_12 = (undefined1)((uint)uVar1 >> 8); local_11 = (undefined1)uVar1; if (((0.0 <= param_4) && (param_4 <= 0.8)) && ((0.0 <= param_5 && ((param_5 <= 0.8 && (param_4 + param_5 <= 1.0)))))) { uVar1 = __dtoui3(); local_10 = (undefined1)((uint)uVar1 >> 0x18); local_f = (undefined1)((uint)uVar1 >> 0x10); local_e = (undefined1)((uint)uVar1 >> 8); local_d = (undefined1)uVar1; uVar1 = __dtoui3(); local_9 = (undefined1)uVar1; local_b = (undefined1)((uint)uVar1 >> 0x10); local_c = (undefined1)((uint)uVar1 >> 0x18); local_a = (undefined1)((uint)uVar1 >> 8); FUN_00a91030(&local_28,0x20); return; } FUN_00a64630(); return; } FUN_00a64630(); return; } FUN_00a64630(); return; } //@@ 00a91b50 png_write_tRNS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngwutil.c: palette (3) num_trans check "Invalid number of transparent colors specified", gray/RGB cases, "Can't write tRNS with an alpha channel", png_write_chunk_header */ void png_write_tRNS(int param_1,int param_2,int param_3) { byte bVar1; code *pcVar2; undefined4 uVar3; void *in_ECX; uint uVar4; byte *pbVar5; int iVar6; byte local_10 [4]; undefined1 local_c; undefined1 local_b; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10 + 0xc); if (param_3 == 3) { if ((0 < param_2) && (param_2 <= (int)(uint)*(ushort *)((int)in_ECX + 0x110))) { FUN_00a91030(); return; } if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar3 = __acrt_iob_func(2,"libpng warning: %s\n", "Invalid number of transparent colors specified"); FUN_008c5d50(uVar3); return; } (**(code **)((int)in_ECX + 0x44))(); return; } if (param_3 != 0) { if (param_3 != 2) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar3 = __acrt_iob_func(2,"libpng warning: %s\n","Can\'t write tRNS with an alpha channel"); FUN_008c5d50(uVar3); return; } (**(code **)((int)in_ECX + 0x44))(); return; } local_10[1] = (byte)*(undefined2 *)(param_1 + 2); local_10[0] = (byte)((ushort)*(undefined2 *)(param_1 + 2) >> 8); local_10[3] = (byte)*(undefined2 *)(param_1 + 4); local_10[2] = (byte)((ushort)*(undefined2 *)(param_1 + 4) >> 8); local_b = (undefined1)*(undefined2 *)(param_1 + 6); local_c = (undefined1)((ushort)*(undefined2 *)(param_1 + 6) >> 8); png_write_chunk_header(in_ECX,(byte *)&DAT_00c129a8,6); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a91d2f; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a91d2f: pbVar5 = local_10; iVar6 = 6; uVar4 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; uVar4 = uVar4 >> 8 ^ *(uint *)(((bVar1 ^ uVar4) & 0xff) * 4 + 0xb4e460); iVar6 = iVar6 + -1; } while (iVar6 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar4; } pcVar2 = *(code **)((int)in_ECX + 0x4c); goto joined_r0x00a91d67; } local_10[1] = (byte)*(undefined2 *)(param_1 + 8); local_10[0] = (byte)((ushort)*(undefined2 *)(param_1 + 8) >> 8); png_write_chunk_header(in_ECX,(byte *)&DAT_00c129a8,2); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a91c33; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a91c33: pbVar5 = local_10; iVar6 = 2; uVar4 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; uVar4 = uVar4 >> 8 ^ *(uint *)(((bVar1 ^ uVar4) & 0xff) * 4 + 0xb4e460); iVar6 = iVar6 + -1; } while (iVar6 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar4; } pcVar2 = *(code **)((int)in_ECX + 0x4c); joined_r0x00a91d67: if (pcVar2 != (code *)0x0) { (*pcVar2)(); if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); return; } } /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a91dd0 png_write_bKGD /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngwutil.c: string "Invalid background palette index"; png_write_chunk_header; called from the png_write_info body 00a63490 png_write_info void png_write_bKGD(uint param_1) { byte bVar1; undefined4 uVar2; code *pcVar3; void *in_ECX; uint uVar4; byte *in_EDX; byte *pbVar5; int iVar6; byte local_10 [4]; undefined1 local_c; undefined1 local_b; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10 + 0xc); if (param_1 != 3) { if ((param_1 & 2) == 0) { local_10[1] = (byte)*(undefined2 *)(in_EDX + 8); local_10[0] = (byte)((ushort)*(undefined2 *)(in_EDX + 8) >> 8); png_write_chunk_header(in_ECX,(byte *)&DAT_00c12958,2); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a91fd5; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a91fd5: pbVar5 = local_10; iVar6 = 2; uVar4 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; uVar4 = uVar4 >> 8 ^ *(uint *)(((bVar1 ^ uVar4) & 0xff) * 4 + 0xb4e460); iVar6 = iVar6 + -1; } while (iVar6 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar4; } pcVar3 = *(code **)((int)in_ECX + 0x4c); } else { local_10[1] = (byte)*(undefined2 *)(in_EDX + 2); local_10[0] = (byte)((ushort)*(undefined2 *)(in_EDX + 2) >> 8); local_10[3] = (byte)*(undefined2 *)(in_EDX + 4); local_10[2] = (byte)((ushort)*(undefined2 *)(in_EDX + 4) >> 8); local_b = (undefined1)*(undefined2 *)(in_EDX + 6); local_c = (undefined1)((ushort)*(undefined2 *)(in_EDX + 6) >> 8); png_write_chunk_header(in_ECX,(byte *)&DAT_00c12958,6); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a91f50; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a91f50: pbVar5 = local_10; iVar6 = 6; uVar4 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; uVar4 = uVar4 >> 8 ^ *(uint *)(((bVar1 ^ uVar4) & 0xff) * 4 + 0xb4e460); iVar6 = iVar6 + -1; } while (iVar6 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar4; } pcVar3 = *(code **)((int)in_ECX + 0x4c); } if (pcVar3 != (code *)0x0) { (*pcVar3)(); pcVar3 = *(code **)((int)in_ECX + 0x4c); if (pcVar3 == (code *)0x0) goto LAB_00a9205e; goto LAB_00a92042; } goto LAB_00a9205e; } local_10[0] = *in_EDX; if (*(ushort *)((int)in_ECX + 0x110) < (ushort)local_10[0]) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid background palette index"); FUN_008c5d50(uVar2); return; } (**(code **)((int)in_ECX + 0x44))(); return; } png_write_chunk_header(in_ECX,(byte *)&DAT_00c12958,1); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a91e7e; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a91e7e: *(uint *)((int)in_ECX + 0x108) = ~(~*(uint *)((int)in_ECX + 0x108) >> 8 ^ *(uint *)((((uint)local_10[0] ^ ~*(uint *)((int)in_ECX + 0x108)) & 0xff) * 4 + 0xb4e460)); } if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); pcVar3 = *(code **)((int)in_ECX + 0x4c); if (pcVar3 != (code *)0x0) { LAB_00a92042: (*pcVar3)(); return; } } LAB_00a9205e: /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a92070 FUN_00a92070 void FUN_00a92070(int param_1) { byte bVar1; undefined2 uVar2; undefined4 uVar3; uint uVar4; void *in_ECX; int in_EDX; byte *pbVar5; int iVar6; int iVar7; byte local_8 [4]; if ((int)(uint)*(ushort *)((int)in_ECX + 0x110) < param_1) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar3 = __acrt_iob_func(2,"libpng warning: %s\n", "Invalid number of histogram entries specified"); FUN_008c5d50(uVar3); return; } (**(code **)((int)in_ECX + 0x44))(); return; } png_write_chunk_header(in_ECX,(byte *)&DAT_00c12940,param_1 * 2); iVar6 = 0; if (0 < param_1) { do { uVar2 = *(undefined2 *)(in_EDX + iVar6 * 2); local_8[1] = (char)uVar2; local_8[0] = (byte)((ushort)uVar2 >> 8); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a92113; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a92113: pbVar5 = local_8; iVar7 = 2; uVar4 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; uVar4 = uVar4 >> 8 ^ *(uint *)(((bVar1 ^ uVar4) & 0xff) * 4 + 0xb4e460); iVar7 = iVar7 + -1; } while (iVar7 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar4; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a9219b; (**(code **)((int)in_ECX + 0x4c))(); iVar6 = iVar6 + 1; } while (iVar6 < param_1); } if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); return; } LAB_00a9219b: /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a921b0 png_check_keyword /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng: "zero length keyword", "invalid keyword character 0x%02X", "leading/trailing spaces removed from keyword", "keyword length must be 1 - 79 characters"; callers png_write_zTXt and neighbouring png_write_tEXt/iTXt prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ uint __cdecl png_check_keyword(void *pngPtr,byte *key,byte *newKey) { char *pcVar1; bool bVar2; byte bVar3; char cVar4; undefined4 uVar5; char *pcVar6; int iVar7; byte *pbVar8; uint uVar9; char *pcVar10; byte local_88 [40]; undefined1 local_60 [84]; uint local_c; undefined1 auStack_8 [4]; local_c = __security_cookie ^ (uint)(auStack_8 + 4); newKey[0] = 0; newKey[1] = 0; newKey[2] = 0; newKey[3] = 0; if (key != (byte *)0x0) { pbVar8 = key; do { bVar3 = *pbVar8; pbVar8 = pbVar8 + 1; } while (bVar3 != 0); uVar9 = (int)pbVar8 - (int)(key + 1); if (uVar9 != 0) { if ((pngPtr == (void *)0x0) || (uVar9 + 1 == 0)) { pbVar8 = (byte *)0x0; } else { pbVar8 = malloc(uVar9 + 1); if (pbVar8 == (byte *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(byte **)newKey = pbVar8; bVar3 = *key; if (bVar3 != 0) { iVar7 = (int)key - (int)pbVar8; do { if (((char)bVar3 < ' ') || (('~' < (char)bVar3 && (bVar3 < 0xa1)))) { sprintf(local_88,(byte *)"invalid keyword character 0x%02X"); FUN_00a64660(local_88); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_60); FUN_008c5d50(uVar5); } else { (**(code **)((int)pngPtr + 0x44))(pngPtr,local_60); } bVar3 = 0x20; } *pbVar8 = bVar3; pbVar8 = pbVar8 + 1; bVar3 = pbVar8[iVar7]; } while (bVar3 != 0); } *pbVar8 = 0; pcVar10 = (char *)(*(int *)newKey + -1 + uVar9); if (*pcVar10 == ' ') { FUN_00a64660("trailing spaces removed from keyword"); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_60); FUN_008c5d50(uVar5); } else { (**(code **)((int)pngPtr + 0x44))(pngPtr,local_60); } cVar4 = *pcVar10; while (cVar4 == ' ') { *pcVar10 = '\0'; pcVar10 = pcVar10 + -1; uVar9 = uVar9 - 1; cVar4 = *pcVar10; } } pcVar10 = *(char **)newKey; cVar4 = *pcVar10; if (cVar4 == ' ') { FUN_00a64660("leading spaces removed from keyword"); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_60); FUN_008c5d50(uVar5); } else { (**(code **)((int)pngPtr + 0x44))(pngPtr,local_60); } cVar4 = *pcVar10; while (cVar4 == ' ') { pcVar6 = pcVar10 + 1; pcVar10 = pcVar10 + 1; uVar9 = uVar9 - 1; cVar4 = *pcVar6; } } bVar2 = false; pcVar6 = *(char **)newKey; while (cVar4 != '\0') { if (cVar4 == ' ') { if (bVar2) { uVar9 = uVar9 - 1; bVar2 = true; } else { *pcVar6 = ' '; bVar2 = true; pcVar6 = pcVar6 + 1; } } else { *pcVar6 = cVar4; pcVar6 = pcVar6 + 1; bVar2 = false; } pcVar1 = pcVar10 + 1; pcVar10 = pcVar10 + 1; cVar4 = *pcVar1; } *pcVar6 = '\0'; if (uVar9 == 0) { FUN_00a64660("zero length keyword"); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_60); FUN_008c5d50(uVar5); return 0; } (**(code **)((int)pngPtr + 0x44))(pngPtr,local_60); return 0; } if (0x4f < uVar9) { FUN_00a64660("keyword length must be 1 - 79 characters"); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_60); FUN_008c5d50(uVar5); } else { (**(code **)((int)pngPtr + 0x44))(pngPtr,local_60); } uVar9 = 0x4f; **(undefined1 **)(newKey + 0x13c) = 0; } return uVar9; } } FUN_00a64660("zero length keyword"); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_60); FUN_008c5d50(uVar5); return 0; } (**(code **)((int)pngPtr + 0x44))(pngPtr,local_60); return 0; } //@@ 00a92520 FUN_00a92520 void FUN_00a92520(char *param_1,int param_2) { uint uVar1; undefined4 uVar2; void *in_ECX; byte *in_EDX; void *local_8; if ((in_EDX == (byte *)0x0) || (uVar1 = png_check_keyword(in_ECX,in_EDX,(byte *)&local_8), uVar1 == 0)) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n","Empty keyword in tEXt chunk"); FUN_008c5d50(uVar2); return; } (**(code **)((int)in_ECX + 0x44))(); return; } if ((param_1 == (char *)0x0) || (*param_1 == '\0')) { param_2 = 0; } png_write_chunk_header(in_ECX,(byte *)&DAT_00c129b8,uVar1 + 1 + param_2); if ((local_8 != (void *)0x0) && (uVar1 + 1 != 0)) { FUN_00a62fb0(uVar1 + 1); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a92625; (**(code **)((int)in_ECX + 0x4c))(); } if ((param_2 != 0) && (param_1 != (char *)0x0)) { FUN_00a62fb0(param_2); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) { LAB_00a92625: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x4c))(); } FUN_00a91190(); if (in_ECX == (void *)0x0) { return; } if (local_8 == (void *)0x0) { return; } free(local_8); return; } //@@ 00a92640 png_write_zTXt /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng: "Empty keyword in zTXt chunk", "Unknown zTXt compression type %d", zlib error; called from PngWriter::write_end text-chunk loop and png_write_info_before_PLTE */ void png_write_zTXt(char *param_1,undefined4 param_2,uint param_3) { uint uVar1; uint uVar2; uint uVar3; int iVar4; void *pvVar5; void *pvVar6; undefined4 uVar7; void *in_ECX; byte *in_EDX; void *pvVar8; int local_50; int local_4c; void *local_44; int local_40; byte local_3c [52]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_3c + 0x38); local_40 = 0; local_4c = 0; if ((in_EDX == (byte *)0x0) || (uVar3 = png_check_keyword(in_ECX,in_EDX,(byte *)&local_44), uVar3 == 0)) { if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); return; } uVar7 = __acrt_iob_func(2,"libpng warning: %s\n","Empty keyword in zTXt chunk"); FUN_008c5d50(uVar7); } else { if ((param_1 != (char *)0x0) && ((*param_1 != '\0' && (param_3 != 0xffffffff)))) { if ((in_ECX != (void *)0x0) && (local_44 != (void *)0x0)) { free(local_44); } if (0 < (int)param_3) { sprintf(local_3c,(byte *)"Unknown zTXt compression type %d"); FUN_00a64630(); param_3 = 0; } *(undefined4 *)((int)in_ECX + 0x70) = param_2; *(char **)((int)in_ECX + 0x6c) = param_1; pvVar8 = (void *)0x10; *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); local_44 = (void *)0x10; pvVar6 = (void *)0x0; do { iVar4 = deflate((void *)((int)in_ECX + 0x6c),0); if (iVar4 != 0) { LAB_00a92984: if (*(int *)((int)in_ECX + 0x84) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } /* WARNING: Subroutine does not return */ FUN_00a64610(); } pvVar5 = pvVar6; if (*(int *)((int)in_ECX + 0x7c) == 0) { if (*(int *)((int)in_ECX + 0x70) == 0) break; if (local_4c <= local_40) { iVar4 = local_40 + 4; if (pvVar6 == (void *)0x0) { if (pvVar8 == (void *)0x0) { pvVar5 = (void *)0x0; local_4c = iVar4; } else { pvVar5 = malloc((size_t)pvVar8); local_4c = iVar4; if (pvVar5 == (void *)0x0) goto LAB_00a92b3a; } } else { if (local_44 == (void *)0x0) { pvVar5 = (void *)0x0; } else { pvVar5 = malloc((size_t)local_44); if (pvVar5 == (void *)0x0) goto LAB_00a92b3a; } memcpy(pvVar5,pvVar6,local_4c << 2); free(pvVar6); pvVar8 = local_44; local_4c = iVar4; } } if (*(size_t *)((int)in_ECX + 0xa8) == 0) { pvVar6 = (void *)0x0; } else { pvVar6 = malloc(*(size_t *)((int)in_ECX + 0xa8)); if (pvVar6 == (void *)0x0) goto LAB_00a92b3a; } *(void **)(((int)pvVar8 - 0x10U) + (int)pvVar5) = pvVar6; memcpy(pvVar6,*(void **)((int)in_ECX + 0xa4),*(size_t *)((int)in_ECX + 0xa8)); local_40 = local_40 + 1; pvVar8 = (void *)((int)pvVar8 + 4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); local_44 = pvVar8; } pvVar6 = pvVar5; } while (*(int *)((int)in_ECX + 0x70) != 0); pvVar8 = (void *)(local_40 * 4 + 0x10); do { local_44 = pvVar8; while( true ) { iVar4 = deflate((void *)((int)in_ECX + 0x6c),4); if ((iVar4 != 0) && (iVar4 != 1)) goto LAB_00a92984; uVar1 = *(uint *)((int)in_ECX + 0x7c); if ((uVar1 == 0) && (iVar4 == 0)) break; if (iVar4 == 1) { uVar2 = *(uint *)((int)in_ECX + 0xa8); iVar4 = uVar2 * local_40; if (uVar1 < uVar2) { iVar4 = iVar4 + (uVar2 - uVar1); } png_write_chunk_header(in_ECX,(byte *)&DAT_00c129c8,uVar3 + 2 + iVar4); if (uVar3 + 1 != 0) { FUN_00a62fb0(uVar3 + 1); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a92b4b; (**(code **)((int)in_ECX + 0x4c))(); } if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a929a0; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a929a0: *(uint *)((int)in_ECX + 0x108) = ~(~*(uint *)((int)in_ECX + 0x108) >> 8 ^ *(uint *)(((param_3 & 0xff ^ ~*(uint *)((int)in_ECX + 0x108)) & 0xff) * 4 + 0xb4e460)); } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a92b4b; (**(code **)((int)in_ECX + 0x4c))(); local_50 = 0; iVar4 = local_40; if (local_40 < 1) goto LAB_00a92a47; goto LAB_00a929e5; } } pvVar6 = pvVar5; if (local_4c <= local_40) { iVar4 = local_40 + 4; if (pvVar5 == (void *)0x0) { if (pvVar8 == (void *)0x0) { pvVar6 = (void *)0x0; local_4c = iVar4; } else { pvVar6 = malloc((size_t)pvVar8); local_4c = iVar4; if (pvVar6 == (void *)0x0) goto LAB_00a92b3a; } } else { if (local_44 == (void *)0x0) { pvVar6 = (void *)0x0; } else { pvVar6 = malloc((size_t)local_44); if (pvVar6 == (void *)0x0) { LAB_00a92b3a: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } memcpy(pvVar6,pvVar5,local_4c << 2); free(pvVar5); pvVar8 = local_44; local_4c = iVar4; } } if (*(size_t *)((int)in_ECX + 0xa8) == 0) { pvVar5 = (void *)0x0; } else { pvVar5 = malloc(*(size_t *)((int)in_ECX + 0xa8)); if (pvVar5 == (void *)0x0) goto LAB_00a92b3a; } *(void **)(((int)pvVar8 - 0x10U) + (int)pvVar6) = pvVar5; memcpy(pvVar5,*(void **)((int)in_ECX + 0xa4),*(size_t *)((int)in_ECX + 0xa8)); local_40 = local_40 + 1; pvVar8 = (void *)((int)pvVar8 + 4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); pvVar5 = pvVar6; } while( true ); } FUN_00a92520(param_1,0); if ((in_ECX != (void *)0x0) && (local_44 != (void *)0x0)) { free(local_44); return; } } return; while( true ) { if (pvVar8 != (void *)0x0) { free(pvVar8); iVar4 = local_40; } local_50 = local_50 + 1; if (iVar4 <= local_50) break; LAB_00a929e5: pvVar8 = *(void **)((int)pvVar5 + local_50 * 4); if (pvVar8 != (void *)0x0) { if (*(int *)((int)in_ECX + 0xa8) != 0) { FUN_00a62fb0(*(int *)((int)in_ECX + 0xa8)); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a92b4b; (**(code **)((int)in_ECX + 0x4c))(); pvVar8 = *(void **)((int)pvVar5 + local_50 * 4); } iVar4 = local_40; } } LAB_00a92a47: if ((local_4c != 0) && (pvVar5 != (void *)0x0)) { free(pvVar5); } if (((*(uint *)((int)in_ECX + 0x7c) < *(uint *)((int)in_ECX + 0xa8)) && (iVar4 = *(uint *)((int)in_ECX + 0xa8) - *(uint *)((int)in_ECX + 0x7c), *(int *)((int)in_ECX + 0xa4) != 0)) && (iVar4 != 0)) { FUN_00a62fb0(iVar4); if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) { LAB_00a92b4b: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x4c))(); } FUN_00a91190(); FUN_00a955e0(); return; } //@@ 00a92b70 FUN_00a92b70 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a92b70(undefined4 param_1,int param_2) { undefined4 uVar1; uint uVar2; void *in_ECX; undefined4 in_EDX; byte local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; undefined1 local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (1 < param_2) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Unrecognized unit type for oFFs chunk"); FUN_008c5d50(uVar1); } else { (**(code **)((int)in_ECX + 0x44))(); } } local_14 = (byte)((uint)in_EDX >> 0x18); local_13 = (undefined1)((uint)in_EDX >> 0x10); local_12 = (undefined1)((uint)in_EDX >> 8); local_10 = (undefined1)((uint)param_1 >> 0x18); local_f = (undefined1)((uint)param_1 >> 0x10); local_e = (undefined1)((uint)param_1 >> 8); local_d = (undefined1)param_1; local_11 = (undefined1)in_EDX; local_c = (undefined1)param_2; png_write_chunk_header(in_ECX,(byte *)&DAT_00c12978,9); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) != 0) goto LAB_00a92c43; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) == 0x300) goto LAB_00a92c43; uVar2 = crc32(*(uint *)((int)in_ECX + 0x108),&local_14,9); *(uint *)((int)in_ECX + 0x108) = uVar2; LAB_00a92c43: if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); return; } } /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a92cb0 png_write_pCAL /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Type propagation algorithm not settling */ /* DB: libpng pngwutil.c: strings "Unrecognized equation type for pCAL chunk", "Out of Memory"; png_write_chunk_header + crc32; called from the png_write_info body 00a63490 png_write_info void png_write_pCAL(undefined4 param_1,undefined4 param_2,int param_3,int param_4,byte *param_5, undefined4 *param_6) { char *pcVar1; int iVar2; byte bVar3; char cVar4; byte *buffer; undefined4 uVar5; uint uVar6; byte *pbVar7; uint uVar8; void *in_ECX; char *pcVar9; byte *in_EDX; int *piVar10; int iVar11; byte *local_34; byte *local_30; int local_2c; int local_28; int local_24; byte *local_20; int local_1c; undefined4 local_18; byte local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; undefined1 local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined1 local_b; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; local_1c = param_4; local_30 = param_5; if (3 < param_3) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n","Unrecognized equation type for pCAL chunk"); FUN_008c5d50(uVar5); } else { (**(code **)((int)in_ECX + 0x44))(); } } uVar6 = png_check_keyword(in_ECX,in_EDX,(byte *)&local_34); uVar8 = uVar6 + 1; local_20 = local_30; do { bVar3 = *local_20; local_20 = local_20 + 1; } while (bVar3 != 0); local_20 = local_20 + ((uint)(local_1c != 0) - (int)(local_30 + 1)); pbVar7 = local_20 + uVar6 + 0xb; if ((in_ECX == (void *)0x0) || (local_1c * 4 == 0)) { local_18 = (void *)0x0; } else { local_18 = malloc(local_1c * 4); if (local_18 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } iVar11 = 0; local_2c = 0; local_28 = 0; if (1 < local_1c) { local_24 = local_1c + -1; piVar10 = (int *)((int)local_18 + 4); do { pcVar9 = (char *)param_6[iVar11]; pcVar1 = pcVar9 + 1; do { cVar4 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar4 != '\0'); local_2c = local_2c + (int)(pcVar9 + ((uint)(iVar11 != local_24) - (int)pcVar1)); piVar10[-1] = (int)(pcVar9 + ((uint)(iVar11 != local_24) - (int)pcVar1)); pcVar9 = *(char **)(((int)param_6 - (int)local_18) + (int)piVar10); pcVar1 = pcVar9 + 1; do { cVar4 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar4 != '\0'); iVar2 = iVar11 + 1; iVar11 = iVar11 + 2; local_28 = local_28 + (int)(pcVar9 + ((uint)(iVar2 != local_24) - (int)pcVar1)); *piVar10 = (int)(pcVar9 + ((uint)(iVar2 != local_24) - (int)pcVar1)); piVar10 = piVar10 + 2; } while (iVar11 < local_24); } if (iVar11 < local_1c) { pcVar9 = (char *)param_6[iVar11]; pcVar1 = pcVar9 + 1; do { cVar4 = *pcVar9; pcVar9 = pcVar9 + 1; } while (cVar4 != '\0'); pbVar7 = pbVar7 + (int)(pcVar9 + ((uint)(iVar11 != local_1c + -1) - (int)pcVar1)); *(char **)((int)local_18 + iVar11 * 4) = pcVar9 + ((uint)(iVar11 != local_1c + -1) - (int)pcVar1); } png_write_chunk_header(in_ECX,(byte *)&DAT_00c12970,local_28 + local_2c + (int)pbVar7); pbVar7 = local_34; if ((local_34 != (byte *)0x0) && (uVar8 != 0)) { if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a92e7e; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a92e7e: uVar6 = crc32(*(uint *)((int)in_ECX + 0x108),local_34,uVar8); *(uint *)((int)in_ECX + 0x108) = uVar6; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a93088; (**(code **)((int)in_ECX + 0x4c))(in_ECX,pbVar7,uVar8); } local_14 = (byte)((uint)param_1 >> 0x18); local_13 = (undefined1)((uint)param_1 >> 0x10); local_12 = (undefined1)((uint)param_1 >> 8); local_11 = (undefined1)param_1; local_10 = (undefined1)((uint)param_2 >> 0x18); local_f = (undefined1)((uint)param_2 >> 0x10); local_e = (undefined1)((uint)param_2 >> 8); local_c = (undefined1)param_3; local_b = (undefined1)local_1c; local_d = (undefined1)param_2; if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a92f14; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a92f14: uVar8 = crc32(*(uint *)((int)in_ECX + 0x108),&local_14,10); *(uint *)((int)in_ECX + 0x108) = uVar8; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a93088; (**(code **)((int)in_ECX + 0x4c))(in_ECX,&local_14,10); if ((local_30 != (byte *)0x0) && (local_20 != (byte *)0x0)) { if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a92f73; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a92f73: uVar8 = crc32(*(uint *)((int)in_ECX + 0x108),local_30,(uint)local_20); *(uint *)((int)in_ECX + 0x108) = uVar8; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a93088; (**(code **)((int)in_ECX + 0x4c))(in_ECX,local_30,local_20); } if (pbVar7 != (byte *)0x0) { free(pbVar7); } local_20 = (byte *)0x0; if (0 < local_1c) { pbVar7 = (byte *)((int)local_18 - (int)param_6); iVar11 = local_1c; local_34 = pbVar7; do { uVar8 = *(uint *)(pbVar7 + (int)param_6); buffer = (byte *)*param_6; if (buffer != (byte *)0x0) { if (uVar8 != 0) { if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a92ff2; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a92ff2: uVar6 = crc32(*(uint *)((int)in_ECX + 0x108),buffer,uVar8); *(uint *)((int)in_ECX + 0x108) = uVar6; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a93088; (**(code **)((int)in_ECX + 0x4c))(in_ECX,buffer,uVar8); pbVar7 = local_34; iVar11 = local_1c; } } local_20 = local_20 + 1; param_6 = param_6 + 1; } while ((int)local_20 < iVar11); } if (local_18 != (void *)0x0) { free(local_18); } uVar5 = *(undefined4 *)((int)in_ECX + 0x108); local_18 = (void *)CONCAT13((char)uVar5, CONCAT12((char)((uint)uVar5 >> 8), CONCAT11((char)((uint)uVar5 >> 0x10), (char)((uint)uVar5 >> 0x18)))); if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(in_ECX,&local_18,4); return; } LAB_00a93088: /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a930b0 FUN_00a930b0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a930b0(undefined4 param_1,int param_2) { undefined4 uVar1; uint uVar2; void *in_ECX; undefined4 in_EDX; byte local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; undefined1 local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (1 < param_2) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Unrecognized unit type for pHYs chunk"); FUN_008c5d50(uVar1); } else { (**(code **)((int)in_ECX + 0x44))(); } } local_14 = (byte)((uint)in_EDX >> 0x18); local_13 = (undefined1)((uint)in_EDX >> 0x10); local_12 = (undefined1)((uint)in_EDX >> 8); local_10 = (undefined1)((uint)param_1 >> 0x18); local_f = (undefined1)((uint)param_1 >> 0x10); local_e = (undefined1)((uint)param_1 >> 8); local_d = (undefined1)param_1; local_11 = (undefined1)in_EDX; local_c = (undefined1)param_2; png_write_chunk_header(in_ECX,(byte *)&DAT_00c12968,9); if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) != 0) goto LAB_00a93183; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) == 0x300) goto LAB_00a93183; uVar2 = crc32(*(uint *)((int)in_ECX + 0x108),&local_14,9); *(uint *)((int)in_ECX + 0x108) = uVar2; LAB_00a93183: if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); if (*(code **)((int)in_ECX + 0x4c) != (code *)0x0) { (**(code **)((int)in_ECX + 0x4c))(); return; } } /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a931f0 FUN_00a931f0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a931f0(void) { undefined4 uVar1; int in_ECX; undefined2 *in_EDX; undefined1 local_10; undefined1 local_f; undefined1 local_e; char local_d; byte local_c; undefined1 local_b; undefined1 local_a; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (((((byte)(*(char *)(in_EDX + 1) - 1U) < 0xc) && (local_d = *(char *)((int)in_EDX + 3), (byte)(local_d - 1U) < 0x1f)) && (local_c = *(byte *)(in_EDX + 2), local_c < 0x18)) && (*(byte *)(in_EDX + 3) < 0x3d)) { local_f = (undefined1)*in_EDX; local_10 = (undefined1)((ushort)*in_EDX >> 8); local_e = *(undefined1 *)(in_EDX + 1); local_b = *(undefined1 *)((int)in_EDX + 5); local_a = *(undefined1 *)(in_EDX + 3); FUN_00a91030(&local_10,7); return; } if (*(code **)(in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid time specified for tIME chunk"); FUN_008c5d50(uVar1); return; } (**(code **)(in_ECX + 0x44))(); return; } //@@ 00a932c0 FUN_00a932c0 void FUN_00a932c0(void) { undefined1 *puVar1; size_t _Size; void *_Dst; uint uVar2; int in_ECX; uint uVar3; size_t sVar4; sVar4 = ((uint)*(byte *)(in_ECX + 0x123) * (uint)*(byte *)(in_ECX + 0x120) * *(int *)(in_ECX + 0xc0) + 7 >> 3) + 1; puVar1 = malloc(sVar4); if (puVar1 == (undefined1 *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(undefined1 **)(in_ECX + 0xe4) = puVar1; *puVar1 = 0; if ((*(byte *)(in_ECX + 0x11d) & 0x10) != 0) { _Size = *(int *)(in_ECX + 0xd0) + 1; if (_Size == 0) { puVar1 = (undefined1 *)0x0; } else { puVar1 = malloc(_Size); if (puVar1 == (undefined1 *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(undefined1 **)(in_ECX + 0xe8) = puVar1; *puVar1 = 1; } if ((*(byte *)(in_ECX + 0x11d) & 0xe0) != 0) { _Dst = malloc(sVar4); if (_Dst == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(void **)(in_ECX + 0xe0) = _Dst; memset(_Dst,0,sVar4); if ((*(byte *)(in_ECX + 0x11d) & 0x20) != 0) { sVar4 = *(int *)(in_ECX + 0xd0) + 1; if (sVar4 == 0) { puVar1 = (undefined1 *)0x0; } else { puVar1 = malloc(sVar4); if (puVar1 == (undefined1 *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(undefined1 **)(in_ECX + 0xec) = puVar1; *puVar1 = 2; } if ((*(byte *)(in_ECX + 0x11d) & 0x40) != 0) { sVar4 = *(int *)(in_ECX + 0xd0) + 1; if (sVar4 == 0) { puVar1 = (undefined1 *)0x0; } else { puVar1 = malloc(sVar4); if (puVar1 == (undefined1 *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(undefined1 **)(in_ECX + 0xf0) = puVar1; *puVar1 = 3; } if (*(char *)(in_ECX + 0x11d) < '\0') { sVar4 = *(int *)(in_ECX + 0xd0) + 1; if (sVar4 == 0) { puVar1 = (undefined1 *)0x0; } else { puVar1 = malloc(sVar4); if (puVar1 == (undefined1 *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(undefined1 **)(in_ECX + 0xf4) = puVar1; *puVar1 = 4; } } uVar3 = *(uint *)(in_ECX + 0xc4); uVar2 = *(uint *)(in_ECX + 0xc0); if ((*(char *)(in_ECX + 0x11b) != '\0') && ((*(byte *)(in_ECX + 0x68) & 2) == 0)) { uVar2 = uVar2 + 7 >> 3; uVar3 = uVar3 + 7 >> 3; } *(uint *)(in_ECX + 200) = uVar3; *(uint *)(in_ECX + 0xcc) = uVar2; *(undefined4 *)(in_ECX + 0x7c) = *(undefined4 *)(in_ECX + 0xa8); *(undefined4 *)(in_ECX + 0x78) = *(undefined4 *)(in_ECX + 0xa4); return; } //@@ 00a93480 png_write_finish_row /* DB: libpng: ++row_number; at num_rows, interlaced -> next pass using png_pass_start/inc tables (7 passes) and clears prev_row, else finishes the IDAT stream ("zlib error"); caller png_write_filtered_row */ void png_write_finish_row(void) { byte bVar1; uint uVar2; uint uVar3; int iVar4; int in_ECX; *(int *)(in_ECX + 0xdc) = *(int *)(in_ECX + 0xdc) + 1; if (*(uint *)(in_ECX + 200) <= *(uint *)(in_ECX + 0xdc)) { if (*(char *)(in_ECX + 0x11b) != '\0') { bVar1 = *(byte *)(in_ECX + 0x11c); *(undefined4 *)(in_ECX + 0xdc) = 0; if ((*(byte *)(in_ECX + 0x68) & 2) == 0) { do { bVar1 = bVar1 + 1; *(byte *)(in_ECX + 0x11c) = bVar1; if (6 < bVar1) break; iVar4 = (uint)bVar1 * 4; uVar2 = (*(int *)(in_ECX + 0xc0) + -1 + (*(uint *)(&DAT_00b46840 + iVar4) - *(int *)(&DAT_00b46860 + iVar4))) / *(uint *)(&DAT_00b46840 + iVar4); *(uint *)(in_ECX + 0xcc) = uVar2; uVar3 = (*(int *)(in_ECX + 0xc4) + -1 + (*(uint *)(&DAT_00b46800 + iVar4) - *(int *)(&DAT_00b46820 + iVar4))) / *(uint *)(&DAT_00b46800 + iVar4); *(uint *)(in_ECX + 200) = uVar3; } while ((uVar2 == 0) || (uVar3 == 0)); } else { bVar1 = bVar1 + 1; *(byte *)(in_ECX + 0x11c) = bVar1; } if (bVar1 < 7) { if (*(void **)(in_ECX + 0xe0) == (void *)0x0) { return; } memset(*(void **)(in_ECX + 0xe0),0, ((uint)*(byte *)(in_ECX + 0x123) * (uint)*(byte *)(in_ECX + 0x120) * *(int *)(in_ECX + 0xc0) + 7 >> 3) + 1); return; } } do { while( true ) { iVar4 = deflate((void *)(in_ECX + 0x6c),4); if ((iVar4 != 0) && (iVar4 != 1)) { if (*(int *)(in_ECX + 0x84) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } /* WARNING: Subroutine does not return */ FUN_00a64610(); } uVar2 = *(uint *)(in_ECX + 0x7c); if ((uVar2 != 0) || (iVar4 != 0)) break; FUN_00a91030(*(undefined4 *)(in_ECX + 0xa4),*(undefined4 *)(in_ECX + 0xa8)); *(uint *)(in_ECX + 0x60) = *(uint *)(in_ECX + 0x60) | 4; *(undefined4 *)(in_ECX + 0x78) = *(undefined4 *)(in_ECX + 0xa4); *(undefined4 *)(in_ECX + 0x7c) = *(undefined4 *)(in_ECX + 0xa8); } } while (iVar4 != 1); if (uVar2 < *(uint *)(in_ECX + 0xa8)) { FUN_00a91030(*(undefined4 *)(in_ECX + 0xa4),*(uint *)(in_ECX + 0xa8) - uVar2); *(uint *)(in_ECX + 0x60) = *(uint *)(in_ECX + 0x60) | 4; } FUN_00a955e0(); } return; } //@@ 00a93640 png_do_write_interlace /* DB: libpng pngwutil.c: returns if pass > 5, png_pass_start/inc tables (0xb46860), per bit-depth (1/2/4/other) packing then memcpy; only caller png_write_row (0xa63ba0) */ void png_do_write_interlace(int param_1) { byte bVar1; uint _Size; uint uVar2; undefined1 uVar3; uint *in_ECX; undefined1 *in_EDX; int iVar4; uint uVar5; undefined1 *_Src; bool bVar6; undefined1 *local_10; undefined1 *local_c; if (5 < param_1) { return; } bVar1 = *(byte *)((int)in_ECX + 0xb); uVar2 = *in_ECX; uVar5 = *(uint *)(&DAT_00b46860 + param_1 * 4); local_c = in_EDX; if (bVar1 == 1) { iVar4 = 7; local_10 = (undefined1 *)0x0; if (uVar2 <= uVar5) goto LAB_00a93825; do { local_10 = (undefined1 *) ((uint)local_10 | ((byte)in_EDX[uVar5 >> 3] >> (7 - ((byte)uVar5 & 7) & 0x1f) & 1) << ((byte)iVar4 & 0x1f)); uVar3 = SUB41(local_10,0); if (iVar4 == 0) { *local_c = uVar3; iVar4 = 7; local_c = local_c + 1; uVar3 = 0; local_10 = (undefined1 *)0x0; } else { iVar4 = iVar4 + -1; } uVar5 = uVar5 + *(int *)(&DAT_00b46840 + param_1 * 4); } while (uVar5 < uVar2); bVar6 = iVar4 == 7; local_10 = local_c; } else if (bVar1 == 2) { iVar4 = 6; local_10 = (undefined1 *)0x0; if (uVar2 <= uVar5) goto LAB_00a93825; do { local_10 = (undefined1 *) ((uint)local_10 | ((byte)in_EDX[uVar5 >> 2] >> (('\x03' - ((byte)uVar5 & 3)) * '\x02' & 0x1f) & 3) << ((byte)iVar4 & 0x1f)); uVar3 = SUB41(local_10,0); if (iVar4 == 0) { *local_c = uVar3; iVar4 = 6; local_c = local_c + 1; uVar3 = 0; local_10 = (undefined1 *)0x0; } else { iVar4 = iVar4 + -2; } uVar5 = uVar5 + *(int *)(&DAT_00b46840 + param_1 * 4); } while (uVar5 < uVar2); bVar6 = iVar4 == 6; local_10 = local_c; } else { if (bVar1 != 4) { _Size = (uint)(bVar1 >> 3); if (uVar5 < uVar2) { iVar4 = *(int *)(&DAT_00b46840 + param_1 * 4); _Src = in_EDX + uVar5 * _Size; do { if (in_EDX != _Src) { memcpy(in_EDX,_Src,_Size); } in_EDX = in_EDX + _Size; _Src = _Src + iVar4 * _Size; uVar5 = uVar5 + *(int *)(&DAT_00b46840 + param_1 * 4); } while (uVar5 < uVar2); } goto LAB_00a93825; } iVar4 = 4; local_c = (undefined1 *)0x0; local_10 = in_EDX; if (uVar2 <= uVar5) goto LAB_00a93825; do { local_c = (undefined1 *) ((uint)local_c | ((byte)in_EDX[uVar5 >> 1] >> (((byte)uVar5 & 1) * -4 + 4 & 0x1f) & 0xf) << ((byte)iVar4 & 0x1f)); uVar3 = SUB41(local_c,0); if (iVar4 == 0) { *local_10 = uVar3; iVar4 = 4; local_10 = local_10 + 1; uVar3 = 0; local_c = (undefined1 *)0x0; } else { iVar4 = iVar4 + -4; } uVar5 = uVar5 + *(int *)(&DAT_00b46840 + param_1 * 4); } while (uVar5 < uVar2); bVar6 = iVar4 == 4; } if (!bVar6) { *local_10 = uVar3; } LAB_00a93825: uVar2 = ((*in_ECX - 1) + (*(uint *)(&DAT_00b46840 + param_1 * 4) - *(int *)(&DAT_00b46860 + param_1 * 4))) / *(uint *)(&DAT_00b46840 + param_1 * 4); *in_ECX = uVar2; in_ECX[1] = *(byte *)((int)in_ECX + 0xb) * uVar2 + 7 >> 3; return; } //@@ 00a93860 png_write_find_filter /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: libpng: caller 00a63ba0 png_write_row png_write_row (interlace pass switch on row_number&7 / width<5, then do_write_interlace 00a93640, do_write_transformations 00a94c80, this, then write_row_fn callback at +0x194); SIMD filter heuristic over row bytes; sibling 00a94b10 png_write_filtered_row "zlib error"/"Call to NULL write function" */ void png_write_find_filter(void) { byte *pbVar1; byte bVar2; char cVar3; undefined1 *puVar4; undefined4 uVar5; undefined4 uVar6; short sVar7; short sVar8; short sVar9; short sVar10; char cVar11; char cVar12; char cVar13; char cVar14; char cVar15; char cVar16; char cVar17; char cVar18; char cVar19; char cVar20; char cVar21; char cVar22; char cVar23; char cVar24; char cVar25; char cVar26; char cVar27; char cVar28; char cVar29; char cVar30; char cVar31; char cVar32; char cVar33; char cVar34; char cVar35; char cVar36; char cVar37; char cVar38; char cVar39; char cVar40; char cVar41; char cVar42; char cVar43; char cVar44; char cVar45; char cVar46; char cVar47; char cVar48; char cVar49; char cVar50; char cVar51; char cVar52; char cVar53; char cVar54; char cVar55; char cVar56; unkuint10 Var57; unkuint10 Var58; unkbyte10 Var59; undefined1 auVar60 [13]; undefined1 auVar61 [11]; undefined1 auVar62 [13]; undefined1 auVar63 [11]; undefined1 auVar64 [13]; undefined1 auVar65 [11]; undefined1 auVar66 [13]; undefined1 auVar67 [11]; undefined1 auVar68 [13]; undefined1 auVar69 [11]; undefined1 auVar70 [13]; undefined1 auVar71 [11]; undefined1 auVar72 [13]; undefined1 auVar73 [11]; undefined1 auVar74 [13]; undefined1 auVar75 [11]; undefined1 auVar76 [13]; undefined1 auVar77 [13]; undefined1 auVar78 [14]; undefined1 auVar79 [14]; undefined1 auVar80 [14]; undefined1 auVar81 [14]; undefined1 auVar82 [14]; undefined1 auVar83 [14]; undefined1 auVar84 [14]; undefined1 auVar85 [14]; uint6 uVar86; uint6 uVar87; uint5 uVar88; byte bVar89; uint uVar90; byte *pbVar91; byte *pbVar92; byte bVar93; int in_ECX; uint uVar94; undefined4 *puVar95; char *pcVar96; char *pcVar97; uint uVar98; int in_EDX; uint uVar99; char *pcVar100; uint uVar101; int iVar102; uint uVar103; char *pcVar104; uint uVar105; undefined1 auVar106 [16]; undefined1 auVar107 [16]; undefined1 auVar108 [16]; undefined1 auVar109 [16]; undefined1 auVar110 [16]; undefined1 auVar111 [16]; undefined1 auVar112 [16]; undefined1 auVar113 [16]; undefined1 auVar114 [16]; ushort uVar129; undefined1 auVar115 [16]; undefined1 auVar116 [16]; undefined1 auVar117 [16]; undefined1 auVar118 [16]; undefined1 auVar121 [16]; undefined1 auVar120 [16]; undefined1 auVar119 [16]; undefined1 auVar122 [16]; undefined1 auVar125 [16]; undefined1 auVar124 [16]; undefined1 auVar123 [16]; undefined1 auVar126 [16]; undefined1 auVar127 [16]; undefined1 auVar128 [16]; ushort uVar145; undefined1 auVar130 [16]; undefined1 auVar131 [16]; undefined1 auVar132 [16]; undefined1 auVar133 [16]; undefined1 auVar134 [16]; undefined1 auVar137 [16]; undefined1 auVar136 [16]; undefined1 auVar135 [16]; undefined1 auVar138 [16]; undefined1 auVar141 [16]; undefined1 auVar140 [16]; undefined1 auVar139 [16]; undefined1 auVar142 [16]; undefined1 auVar143 [16]; undefined1 auVar144 [16]; byte bVar146; byte bVar169; int iVar170; undefined1 auVar149 [16]; undefined1 auVar148 [16]; undefined1 auVar147 [16]; undefined1 auVar151 [16]; undefined1 auVar150 [16]; undefined1 auVar154 [16]; undefined1 auVar153 [16]; undefined1 auVar152 [16]; undefined1 auVar156 [16]; undefined1 auVar155 [16]; undefined1 auVar159 [16]; undefined1 auVar158 [16]; undefined1 auVar157 [16]; undefined1 auVar161 [16]; undefined1 auVar160 [16]; undefined1 auVar164 [16]; undefined1 auVar163 [16]; undefined1 auVar162 [16]; undefined1 auVar166 [16]; undefined1 auVar165 [16]; undefined1 auVar167 [16]; undefined1 auVar168 [16]; int iVar171; int iVar172; int iVar173; int iVar174; int iVar175; int iVar176; int iVar177; int iVar178; uint local_48; int local_44; byte *local_40; byte *local_3c; byte *local_38; char *local_34; byte *local_30; undefined1 *local_2c; uint local_28; byte *local_24; byte *local_20; undefined1 *local_1c; char *local_14; uVar101 = *(uint *)(in_EDX + 4); bVar146 = *(byte *)(in_ECX + 0x11d); iVar102 = *(int *)(in_ECX + 0xe0); bVar2 = *(byte *)(in_ECX + 0x1f1); puVar4 = *(undefined1 **)(in_ECX + 0xe4); uVar103 = *(byte *)(in_EDX + 0xb) + 7 >> 3; uVar94 = (uint)bVar2; local_1c = (undefined1 *)0x7fffffff; if ((bVar146 & 8) != 0) { local_1c = (undefined1 *)0x7fffffff; if (bVar146 != 8) { uVar99 = 0; uVar90 = 0; local_1c = (undefined1 *)0x0; puVar95 = (undefined4 *)(puVar4 + 1); local_38 = (byte *)0x0; if (uVar101 != 0) { if (7 < uVar101) { iVar175 = 0; iVar176 = 0; iVar177 = 0; iVar178 = 0; iVar171 = 0; iVar172 = 0; iVar173 = 0; iVar174 = 0; do { uVar5 = *puVar95; Var57 = CONCAT91((unkuint9)0,(char)((uint)uVar5 >> 0x18)); auVar61[10] = 0; auVar61._0_10_ = Var57; auVar149[4] = (char)((uint)uVar5 >> 0x10); auVar149._0_4_ = uVar5; auVar149._5_11_ = auVar61 << 8; auVar60[0xc] = 0; auVar60._0_12_ = auVar149._4_12_; auVar148._0_2_ = (ushort)uVar5; auVar148[2] = (char)((uint)uVar5 >> 8); auVar148._3_13_ = auVar60 << 8; auVar147._2_14_ = auVar148._2_14_; auVar147._0_2_ = auVar148._0_2_ & 0xff; uVar129 = (ushort)Var57; auVar78._10_2_ = 0; auVar78._0_10_ = auVar147._0_10_; auVar78._12_2_ = uVar129; uVar86 = CONCAT42(auVar78._10_4_,auVar149._4_2_); auVar151._0_4_ = auVar147._0_4_; auVar151._4_2_ = auVar148._2_2_; auVar151._6_10_ = (unkuint10)uVar86 << 0x10; auVar150._4_12_ = auVar151._4_12_; auVar150._0_4_ = auVar151._0_4_ & 0xffff; uVar90 = uVar90 + 8; auVar115._0_8_ = CONCAT44(-(uint)(auVar151._4_4_ < 0x80),-(uint)(auVar150._0_4_ < 0x80)) ; iVar170 = (int)uVar86; auVar115._8_4_ = -(uint)(iVar170 < 0x80); auVar115._12_4_ = -(uint)(uVar129 < 0x80); auVar131._0_4_ = 0x100 - auVar150._0_4_; auVar131._4_4_ = 0x100 - auVar151._4_4_; auVar131._8_4_ = 0x100 - iVar170; auVar131._12_4_ = 0x100 - (uint)uVar129; auVar130._8_4_ = auVar115._8_4_; auVar130._0_8_ = auVar115._0_8_; auVar130._12_4_ = auVar115._12_4_; auVar131 = ~auVar130 & auVar131 | auVar150 & auVar115; uVar5 = puVar95[1]; Var57 = CONCAT91((unkuint9)0,(char)((uint)uVar5 >> 0x18)); auVar63[10] = 0; auVar63._0_10_ = Var57; auVar154[4] = (char)((uint)uVar5 >> 0x10); auVar154._0_4_ = uVar5; auVar154._5_11_ = auVar63 << 8; auVar62[0xc] = 0; auVar62._0_12_ = auVar154._4_12_; auVar153._0_2_ = (ushort)uVar5; auVar153[2] = (char)((uint)uVar5 >> 8); auVar153._3_13_ = auVar62 << 8; auVar152._2_14_ = auVar153._2_14_; auVar152._0_2_ = auVar153._0_2_ & 0xff; iVar175 = iVar175 + auVar131._0_4_; iVar176 = iVar176 + auVar131._4_4_; iVar177 = iVar177 + auVar131._8_4_; iVar178 = iVar178 + auVar131._12_4_; uVar129 = (ushort)Var57; auVar79._10_2_ = 0; auVar79._0_10_ = auVar152._0_10_; auVar79._12_2_ = uVar129; uVar86 = CONCAT42(auVar79._10_4_,auVar154._4_2_); auVar156._0_4_ = auVar152._0_4_; auVar156._4_2_ = auVar153._2_2_; auVar156._6_10_ = (unkuint10)uVar86 << 0x10; auVar155._4_12_ = auVar156._4_12_; auVar155._0_4_ = auVar156._0_4_ & 0xffff; puVar95 = puVar95 + 2; auVar116._0_8_ = CONCAT44(-(uint)(auVar156._4_4_ < 0x80),-(uint)(auVar155._0_4_ < 0x80)) ; iVar170 = (int)uVar86; auVar116._8_4_ = -(uint)(iVar170 < 0x80); auVar116._12_4_ = -(uint)(uVar129 < 0x80); auVar106._0_4_ = 0x100 - auVar155._0_4_; auVar106._4_4_ = 0x100 - auVar156._4_4_; auVar106._8_4_ = 0x100 - iVar170; auVar106._12_4_ = 0x100 - (uint)uVar129; auVar132._8_4_ = auVar116._8_4_; auVar132._0_8_ = auVar116._0_8_; auVar132._12_4_ = auVar116._12_4_; auVar131 = ~auVar132 & auVar106 | auVar155 & auVar116; iVar171 = iVar171 + auVar131._0_4_; iVar172 = iVar172 + auVar131._4_4_; iVar173 = iVar173 + auVar131._8_4_; iVar174 = iVar174 + auVar131._12_4_; } while (uVar90 < (uVar101 & 0xfffffff8)); uVar99 = iVar171 + iVar175 + iVar173 + iVar177 + iVar172 + iVar176 + iVar174 + iVar178; local_38 = (byte *)uVar90; local_1c = (undefined1 *)uVar99; if (uVar101 <= uVar90) goto LAB_00a939d7; } pbVar91 = local_38; do { uVar90 = (uint)*(byte *)((int)puVar95 + ((int)local_38 - (int)pbVar91)); if (0x7f < uVar90) { uVar90 = 0x100 - uVar90; } local_38 = (byte *)((int)local_38 + 1); uVar99 = uVar99 + uVar90; } while (local_38 < uVar101); local_1c = (undefined1 *)uVar99; } LAB_00a939d7: if (*(char *)(in_ECX + 0x1f0) == '\x02') { local_2c = (undefined1 *)((uint)local_1c & 0xffff); local_38 = (byte *)((uint)local_1c >> 10 & 0x3fffc0); iVar171 = 0; if (uVar94 != 0) { iVar172 = *(int *)(in_ECX + 500); do { if (*(char *)(iVar172 + iVar171) == '\0') { uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1f8) + iVar171 * 2); local_2c = (undefined1 *)(uVar90 * (int)local_2c >> 8); local_38 = (byte *)(uVar90 * (int)local_38 >> 8); iVar172 = *(int *)(in_ECX + 500); } iVar171 = iVar171 + 1; } while (iVar171 < (int)uVar94); } uVar90 = (uint)**(ushort **)(in_ECX + 0x200) * (int)local_38 >> 3; if (uVar90 < 0x3fffc1) { local_1c = (undefined1 *) (((uint)**(ushort **)(in_ECX + 0x200) * (int)local_2c >> 3) + uVar90 * 0x400); } else { local_1c = (undefined1 *)0x7fffffff; } } goto LAB_00a93a6b; } goto LAB_00a93eae; } LAB_00a93a6b: if (bVar146 == 0x10) { pcVar104 = puVar4 + 1; pcVar96 = (char *)(*(int *)(in_ECX + 0xe8) + 1); local_30 = (byte *)0x0; pcVar100 = pcVar104; if (uVar103 != 0) { uVar90 = uVar103; do { cVar3 = *pcVar100; pcVar100 = pcVar100 + 1; *pcVar96 = cVar3; pcVar96 = pcVar96 + 1; uVar90 = uVar90 - 1; } while (uVar90 != 0); local_30 = (byte *)uVar103; } uVar103 = uVar101 - (int)local_30; if (local_30 < uVar101) { if (0x3f < uVar103) { if (((puVar4 + uVar101 < pcVar96 + (int)local_30) || (pcVar96 + (uVar101 - 1) < pcVar104 + (int)local_30)) && ((pcVar100 + (uVar101 - 1) < pcVar96 + (int)local_30 || (pcVar96 + (uVar101 - 1) < pcVar100 + (int)local_30)))) { do { cVar3 = pcVar104[1]; cVar11 = pcVar104[2]; cVar12 = pcVar104[3]; cVar13 = pcVar104[4]; cVar14 = pcVar104[5]; cVar15 = pcVar104[6]; cVar16 = pcVar104[7]; cVar17 = pcVar104[8]; cVar18 = pcVar104[9]; cVar19 = pcVar104[10]; cVar20 = pcVar104[0xb]; cVar21 = pcVar104[0xc]; cVar22 = pcVar104[0xd]; cVar23 = pcVar104[0xe]; cVar24 = pcVar104[0xf]; local_30 = (byte *)((int)local_30 + 0x40); cVar25 = pcVar100[1]; cVar26 = pcVar100[2]; cVar27 = pcVar100[3]; cVar28 = pcVar100[4]; cVar29 = pcVar100[5]; cVar30 = pcVar100[6]; cVar31 = pcVar100[7]; cVar32 = pcVar100[8]; cVar33 = pcVar100[9]; cVar34 = pcVar100[10]; cVar35 = pcVar100[0xb]; cVar36 = pcVar100[0xc]; cVar37 = pcVar100[0xd]; cVar38 = pcVar100[0xe]; cVar39 = pcVar100[0xf]; cVar40 = pcVar104[0x10]; cVar41 = pcVar104[0x11]; cVar42 = pcVar104[0x12]; cVar43 = pcVar104[0x13]; cVar44 = pcVar104[0x14]; cVar45 = pcVar104[0x15]; cVar46 = pcVar104[0x16]; cVar47 = pcVar104[0x17]; cVar48 = pcVar104[0x18]; cVar49 = pcVar104[0x19]; cVar50 = pcVar104[0x1a]; cVar51 = pcVar104[0x1b]; cVar52 = pcVar104[0x1c]; cVar53 = pcVar104[0x1d]; cVar54 = pcVar104[0x1e]; cVar55 = pcVar104[0x1f]; *pcVar96 = *pcVar100 - *pcVar104; pcVar96[1] = cVar25 - cVar3; pcVar96[2] = cVar26 - cVar11; pcVar96[3] = cVar27 - cVar12; pcVar96[4] = cVar28 - cVar13; pcVar96[5] = cVar29 - cVar14; pcVar96[6] = cVar30 - cVar15; pcVar96[7] = cVar31 - cVar16; pcVar96[8] = cVar32 - cVar17; pcVar96[9] = cVar33 - cVar18; pcVar96[10] = cVar34 - cVar19; pcVar96[0xb] = cVar35 - cVar20; pcVar96[0xc] = cVar36 - cVar21; pcVar96[0xd] = cVar37 - cVar22; pcVar96[0xe] = cVar38 - cVar23; pcVar96[0xf] = cVar39 - cVar24; cVar3 = pcVar100[0x11]; cVar11 = pcVar100[0x12]; cVar12 = pcVar100[0x13]; cVar13 = pcVar100[0x14]; cVar14 = pcVar100[0x15]; cVar15 = pcVar100[0x16]; cVar16 = pcVar100[0x17]; cVar17 = pcVar100[0x18]; cVar18 = pcVar100[0x19]; cVar19 = pcVar100[0x1a]; cVar20 = pcVar100[0x1b]; cVar21 = pcVar100[0x1c]; cVar22 = pcVar100[0x1d]; cVar23 = pcVar100[0x1e]; cVar24 = pcVar100[0x1f]; cVar25 = pcVar104[0x20]; cVar26 = pcVar104[0x21]; cVar27 = pcVar104[0x22]; cVar28 = pcVar104[0x23]; cVar29 = pcVar104[0x24]; cVar30 = pcVar104[0x25]; cVar31 = pcVar104[0x26]; cVar32 = pcVar104[0x27]; cVar33 = pcVar104[0x28]; cVar34 = pcVar104[0x29]; cVar35 = pcVar104[0x2a]; cVar36 = pcVar104[0x2b]; cVar37 = pcVar104[0x2c]; cVar38 = pcVar104[0x2d]; cVar39 = pcVar104[0x2e]; cVar56 = pcVar104[0x2f]; pcVar96[0x10] = pcVar100[0x10] - cVar40; pcVar96[0x11] = cVar3 - cVar41; pcVar96[0x12] = cVar11 - cVar42; pcVar96[0x13] = cVar12 - cVar43; pcVar96[0x14] = cVar13 - cVar44; pcVar96[0x15] = cVar14 - cVar45; pcVar96[0x16] = cVar15 - cVar46; pcVar96[0x17] = cVar16 - cVar47; pcVar96[0x18] = cVar17 - cVar48; pcVar96[0x19] = cVar18 - cVar49; pcVar96[0x1a] = cVar19 - cVar50; pcVar96[0x1b] = cVar20 - cVar51; pcVar96[0x1c] = cVar21 - cVar52; pcVar96[0x1d] = cVar22 - cVar53; pcVar96[0x1e] = cVar23 - cVar54; pcVar96[0x1f] = cVar24 - cVar55; cVar3 = pcVar100[0x21]; cVar11 = pcVar100[0x22]; cVar12 = pcVar100[0x23]; cVar13 = pcVar100[0x24]; cVar14 = pcVar100[0x25]; cVar15 = pcVar100[0x26]; cVar16 = pcVar100[0x27]; cVar17 = pcVar100[0x28]; cVar18 = pcVar100[0x29]; cVar19 = pcVar100[0x2a]; cVar20 = pcVar100[0x2b]; cVar21 = pcVar100[0x2c]; cVar22 = pcVar100[0x2d]; cVar23 = pcVar100[0x2e]; cVar24 = pcVar100[0x2f]; cVar40 = pcVar104[0x30]; cVar41 = pcVar104[0x31]; cVar42 = pcVar104[0x32]; cVar43 = pcVar104[0x33]; cVar44 = pcVar104[0x34]; cVar45 = pcVar104[0x35]; cVar46 = pcVar104[0x36]; cVar47 = pcVar104[0x37]; cVar48 = pcVar104[0x38]; cVar49 = pcVar104[0x39]; cVar50 = pcVar104[0x3a]; cVar51 = pcVar104[0x3b]; cVar52 = pcVar104[0x3c]; cVar53 = pcVar104[0x3d]; cVar54 = pcVar104[0x3e]; cVar55 = pcVar104[0x3f]; pcVar104 = pcVar104 + 0x40; pcVar96[0x20] = pcVar100[0x20] - cVar25; pcVar96[0x21] = cVar3 - cVar26; pcVar96[0x22] = cVar11 - cVar27; pcVar96[0x23] = cVar12 - cVar28; pcVar96[0x24] = cVar13 - cVar29; pcVar96[0x25] = cVar14 - cVar30; pcVar96[0x26] = cVar15 - cVar31; pcVar96[0x27] = cVar16 - cVar32; pcVar96[0x28] = cVar17 - cVar33; pcVar96[0x29] = cVar18 - cVar34; pcVar96[0x2a] = cVar19 - cVar35; pcVar96[0x2b] = cVar20 - cVar36; pcVar96[0x2c] = cVar21 - cVar37; pcVar96[0x2d] = cVar22 - cVar38; pcVar96[0x2e] = cVar23 - cVar39; pcVar96[0x2f] = cVar24 - cVar56; pcVar97 = pcVar100 + 0x30; cVar3 = pcVar100[0x31]; cVar11 = pcVar100[0x32]; cVar12 = pcVar100[0x33]; cVar13 = pcVar100[0x34]; cVar14 = pcVar100[0x35]; cVar15 = pcVar100[0x36]; cVar16 = pcVar100[0x37]; cVar17 = pcVar100[0x38]; cVar18 = pcVar100[0x39]; cVar19 = pcVar100[0x3a]; cVar20 = pcVar100[0x3b]; cVar21 = pcVar100[0x3c]; cVar22 = pcVar100[0x3d]; cVar23 = pcVar100[0x3e]; cVar24 = pcVar100[0x3f]; pcVar100 = pcVar100 + 0x40; pcVar96[0x30] = *pcVar97 - cVar40; pcVar96[0x31] = cVar3 - cVar41; pcVar96[0x32] = cVar11 - cVar42; pcVar96[0x33] = cVar12 - cVar43; pcVar96[0x34] = cVar13 - cVar44; pcVar96[0x35] = cVar14 - cVar45; pcVar96[0x36] = cVar15 - cVar46; pcVar96[0x37] = cVar16 - cVar47; pcVar96[0x38] = cVar17 - cVar48; pcVar96[0x39] = cVar18 - cVar49; pcVar96[0x3a] = cVar19 - cVar50; pcVar96[0x3b] = cVar20 - cVar51; pcVar96[0x3c] = cVar21 - cVar52; pcVar96[0x3d] = cVar22 - cVar53; pcVar96[0x3e] = cVar23 - cVar54; pcVar96[0x3f] = cVar24 - cVar55; pcVar96 = pcVar96 + 0x40; } while (local_30 < uVar101 - (uVar103 & 0x3f)); if (uVar101 <= local_30) goto LAB_00a93b82; } } iVar102 = uVar101 - (int)local_30; pcVar97 = pcVar96; do { *pcVar97 = pcVar97[(int)pcVar100 - (int)pcVar96] - (pcVar97 + 1)[(int)(pcVar104 + (-1 - (int)pcVar96))]; iVar102 = iVar102 + -1; pcVar97 = pcVar97 + 1; } while (iVar102 != 0); } LAB_00a93b82: local_24 = *(byte **)(in_ECX + 0xe8); goto LAB_00a94abd; } if ((bVar146 & 0x10) == 0) { LAB_00a93eae: local_30 = puVar4; } else { local_2c = (undefined1 *)0x0; local_3c = local_1c; if (*(char *)(in_ECX + 0x1f0) == '\x02') { local_28 = (uint)local_1c & 0xffff; local_38 = (byte *)((uint)local_1c >> 10 & 0x3fffc0); if (uVar94 != 0) { iVar171 = *(int *)(in_ECX + 500); iVar172 = 0; do { if (*(char *)(iVar171 + iVar172) == '\x01') { uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1fc) + iVar172 * 2); iVar171 = *(int *)(in_ECX + 500); local_28 = local_28 * uVar90 >> 8; local_38 = (byte *)((int)local_38 * uVar90 >> 8); } iVar172 = iVar172 + 1; } while (iVar172 < (int)uVar94); } uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x204) + 2); uVar99 = uVar90 * (int)local_38 >> 3; if (uVar99 < 0x3fffc1) { local_3c = (byte *)((uVar90 * local_28 >> 3) + uVar99 * 0x400); } else { local_3c = (byte *)0x7fffffff; } } pbVar91 = puVar4 + 1; local_38 = (byte *)(*(int *)(in_ECX + 0xe8) + 1); local_28 = 0; local_24 = pbVar91; if (uVar103 != 0) { if (7 < uVar103) { local_28 = 0; if ((puVar4 + uVar103 < local_38) || ((byte *)(*(int *)(in_ECX + 0xe8) + uVar103) < pbVar91) ) { iVar175 = 0; iVar176 = 0; iVar177 = 0; iVar178 = 0; iVar171 = 0; iVar172 = 0; iVar173 = 0; iVar174 = 0; local_28 = 0; do { uVar5 = *(undefined4 *)local_24; *(undefined4 *)local_38 = uVar5; Var57 = CONCAT91((unkuint9)0,(char)((uint)uVar5 >> 0x18)); auVar65[10] = 0; auVar65._0_10_ = Var57; auVar159[4] = (char)((uint)uVar5 >> 0x10); auVar159._0_4_ = uVar5; auVar159._5_11_ = auVar65 << 8; auVar64[0xc] = 0; auVar64._0_12_ = auVar159._4_12_; auVar158._0_2_ = (ushort)uVar5; auVar158[2] = (char)((uint)uVar5 >> 8); auVar158._3_13_ = auVar64 << 8; auVar157._2_14_ = auVar158._2_14_; auVar157._0_2_ = auVar158._0_2_ & 0xff; local_28 = local_28 + 8; uVar129 = (ushort)Var57; auVar80._10_2_ = 0; auVar80._0_10_ = auVar157._0_10_; auVar80._12_2_ = uVar129; uVar86 = CONCAT42(auVar80._10_4_,auVar159._4_2_); auVar161._0_4_ = auVar157._0_4_; auVar161._4_2_ = auVar158._2_2_; auVar161._6_10_ = (unkuint10)uVar86 << 0x10; auVar160._4_12_ = auVar161._4_12_; auVar160._0_4_ = auVar161._0_4_ & 0xffff; auVar133._0_8_ = CONCAT44(-(uint)(auVar161._4_4_ < 0x80),-(uint)(auVar160._0_4_ < 0x80)) ; iVar170 = (int)uVar86; auVar133._8_4_ = -(uint)(iVar170 < 0x80); auVar133._12_4_ = -(uint)(uVar129 < 0x80); auVar107._0_4_ = 0x100 - auVar160._0_4_; auVar107._4_4_ = 0x100 - auVar161._4_4_; auVar107._8_4_ = 0x100 - iVar170; auVar107._12_4_ = 0x100 - (uint)uVar129; auVar117._8_4_ = auVar133._8_4_; auVar117._0_8_ = auVar133._0_8_; auVar117._12_4_ = auVar133._12_4_; uVar5 = *(undefined4 *)(local_24 + 4); auVar131 = ~auVar117 & auVar107 | auVar133 & auVar160; *(undefined4 *)(local_38 + 4) = uVar5; Var57 = CONCAT91((unkuint9)0,(char)((uint)uVar5 >> 0x18)); auVar67[10] = 0; auVar67._0_10_ = Var57; auVar164[4] = (char)((uint)uVar5 >> 0x10); auVar164._0_4_ = uVar5; auVar164._5_11_ = auVar67 << 8; auVar66[0xc] = 0; auVar66._0_12_ = auVar164._4_12_; auVar163._0_2_ = (ushort)uVar5; auVar163[2] = (char)((uint)uVar5 >> 8); auVar163._3_13_ = auVar66 << 8; auVar162._2_14_ = auVar163._2_14_; auVar162._0_2_ = auVar163._0_2_ & 0xff; iVar175 = iVar175 + auVar131._0_4_; iVar176 = iVar176 + auVar131._4_4_; iVar177 = iVar177 + auVar131._8_4_; iVar178 = iVar178 + auVar131._12_4_; uVar129 = (ushort)Var57; auVar81._10_2_ = 0; auVar81._0_10_ = auVar162._0_10_; auVar81._12_2_ = uVar129; uVar86 = CONCAT42(auVar81._10_4_,auVar164._4_2_); auVar166._0_4_ = auVar162._0_4_; auVar166._4_2_ = auVar163._2_2_; auVar166._6_10_ = (unkuint10)uVar86 << 0x10; auVar165._4_12_ = auVar166._4_12_; auVar165._0_4_ = auVar166._0_4_ & 0xffff; local_24 = local_24 + 8; auVar134._0_8_ = CONCAT44(-(uint)(auVar166._4_4_ < 0x80),-(uint)(auVar165._0_4_ < 0x80)) ; iVar170 = (int)uVar86; auVar134._8_4_ = -(uint)(iVar170 < 0x80); auVar134._12_4_ = -(uint)(uVar129 < 0x80); auVar118._8_4_ = auVar134._8_4_; auVar118._0_8_ = auVar134._0_8_; auVar118._12_4_ = auVar134._12_4_; auVar108._0_4_ = 0x100 - auVar165._0_4_; auVar108._4_4_ = 0x100 - auVar166._4_4_; auVar108._8_4_ = 0x100 - iVar170; auVar108._12_4_ = 0x100 - (uint)uVar129; auVar131 = ~auVar118 & auVar108 | auVar134 & auVar165; local_38 = local_38 + 8; iVar171 = iVar171 + auVar131._0_4_; iVar172 = iVar172 + auVar131._4_4_; iVar173 = iVar173 + auVar131._8_4_; iVar174 = iVar174 + auVar131._12_4_; } while (local_28 < (uVar103 & 0xfffffff8)); local_2c = (undefined1 *) (iVar171 + iVar175 + iVar173 + iVar177 + iVar172 + iVar176 + iVar174 + iVar178) ; if (uVar103 <= local_28) goto LAB_00a93d94; } } local_44 = uVar103 - local_28; do { bVar89 = *local_24; *local_38 = bVar89; uVar90 = (uint)bVar89; if (0x7f < uVar90) { uVar90 = 0x100 - uVar90; } local_2c = (undefined1 *)((int)local_2c + uVar90); local_24 = local_24 + 1; local_38 = local_38 + 1; local_44 = local_44 + -1; } while (local_44 != 0); local_28 = uVar103; } LAB_00a93d94: if (local_28 < *(uint *)(in_EDX + 4)) { iVar171 = (int)pbVar91 - (int)local_38; iVar172 = (int)local_24 - (int)local_38; do { bVar89 = local_38[iVar172]; bVar93 = local_38[iVar171]; *local_38 = bVar89 - bVar93; uVar90 = (uint)(byte)(bVar89 - bVar93); if (0x7f < uVar90) { uVar90 = 0x100 - uVar90; } local_2c = (undefined1 *)((int)local_2c + uVar90); if (local_3c < local_2c) break; local_28 = local_28 + 1; local_38 = local_38 + 1; } while (local_28 < *(uint *)(in_EDX + 4)); } if (*(char *)(in_ECX + 0x1f0) == '\x02') { local_3c = (byte *)((uint)local_2c & 0xffff); local_40 = (byte *)((uint)local_2c >> 10 & 0x3fffc0); if (bVar2 != 0) { iVar171 = *(int *)(in_ECX + 500); iVar172 = 0; do { if (*(char *)(iVar171 + iVar172) == '\x01') { uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1fc) + iVar172 * 2); local_3c = (byte *)((int)local_3c * uVar90 >> 8); local_40 = (byte *)(uVar90 * (int)local_40 >> 8); iVar171 = *(int *)(in_ECX + 500); } iVar172 = iVar172 + 1; } while (iVar172 < (int)uVar94); } uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x204) + 2); uVar99 = uVar90 * (int)local_40 >> 3; if (uVar99 < 0x3fffc1) { local_2c = (undefined1 *)((uVar90 * (int)local_3c >> 3) + uVar99 * 0x400); } else { local_2c = (undefined1 *)0x7fffffff; } } if (local_1c <= local_2c) goto LAB_00a93eae; local_1c = local_2c; local_30 = *(undefined1 **)(in_ECX + 0xe8); } if (bVar146 != 0x20) { local_2c = local_30; local_24 = local_1c; if ((bVar146 & 0x20) != 0) { uVar90 = (uint)local_1c; if (*(char *)(in_ECX + 0x1f0) == '\x02') { local_40 = (byte *)((uint)local_1c & 0xffff); uVar90 = (uint)local_1c >> 10 & 0x3fffc0; if (bVar2 != 0) { iVar171 = 0; local_48 = uVar90; do { if (*(char *)(*(int *)(in_ECX + 500) + iVar171) == '\x02') { uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1fc) + iVar171 * 2); local_40 = (byte *)((int)local_40 * uVar90 >> 8); uVar90 = uVar90 * local_48 >> 8; local_48 = uVar90; } iVar171 = iVar171 + 1; } while (iVar171 < (int)uVar94); } uVar99 = (uint)*(ushort *)(*(int *)(in_ECX + 0x204) + 4); uVar90 = uVar99 * uVar90 >> 3; if (uVar90 < 0x3fffc1) { uVar90 = (uVar99 * (int)local_40 >> 3) + uVar90 * 0x400; } else { uVar90 = 0x7fffffff; } } local_24 = (byte *)0x0; local_38 = *(byte **)(in_ECX + 0xec); local_48 = 0; if (uVar101 != 0) { pcVar100 = puVar4 + 1; do { local_38 = local_38 + 1; bVar89 = *pcVar100 - (pcVar100 + 1)[iVar102 - (int)(puVar4 + 1)]; *local_38 = bVar89; uVar99 = (uint)bVar89; if (0x7f < uVar99) { uVar99 = 0x100 - uVar99; } local_24 = (byte *)((int)local_24 + uVar99); if (uVar90 < local_24) break; local_48 = local_48 + 1; pcVar100 = pcVar100 + 1; } while (local_48 < uVar101); } if (*(char *)(in_ECX + 0x1f0) == '\x02') { uVar90 = (uint)local_24 & 0xffff; iVar171 = 0; uVar99 = (uint)local_24 >> 10 & 0x3fffc0; if (bVar2 != 0) { iVar172 = *(int *)(in_ECX + 500); do { if (*(char *)(iVar172 + iVar171) == '\x02') { uVar98 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1f8) + iVar171 * 2); iVar172 = *(int *)(in_ECX + 500); uVar90 = uVar90 * uVar98 >> 8; uVar99 = uVar99 * uVar98 >> 8; } iVar171 = iVar171 + 1; } while (iVar171 < (int)uVar94); } uVar98 = (uint)*(ushort *)(*(int *)(in_ECX + 0x200) + 4); uVar99 = uVar99 * uVar98 >> 3; if (uVar99 < 0x3fffc1) { local_24 = (byte *)((uVar90 * uVar98 >> 3) + uVar99 * 0x400); } else { local_24 = (byte *)0x7fffffff; } } if (local_24 < local_1c) { local_2c = *(undefined1 **)(in_ECX + 0xec); } else { local_24 = local_1c; } } local_28 = (uint)local_24; if (bVar146 != 0x40) { local_1c = local_2c; if ((bVar146 & 0x40) != 0) { if (*(char *)(in_ECX + 0x1f0) == '\x02') { local_3c = (byte *)((uint)local_24 & 0xffff); local_40 = (byte *)((uint)local_24 >> 10 & 0x3fffc0); if (bVar2 != 0) { iVar172 = 0; iVar171 = *(int *)(in_ECX + 500); do { if (*(char *)(iVar171 + iVar172) == '\x03') { uVar90 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1fc) + iVar172 * 2); iVar171 = *(int *)(in_ECX + 500); local_3c = (byte *)((int)local_3c * uVar90 >> 8); local_40 = (byte *)((int)local_40 * uVar90 >> 8); } iVar172 = iVar172 + 1; } while (iVar172 < (int)uVar94); } uVar99 = (uint)*(ushort *)(*(int *)(in_ECX + 0x204) + 6); uVar90 = (int)local_40 * uVar99 >> 3; if (uVar90 < 0x3fffc1) { local_24 = (byte *)(((int)local_3c * uVar99 >> 3) + uVar90 * 0x400); } else { local_24 = (byte *)0x7fffffff; } } uVar90 = 0; local_3c = puVar4 + 1; local_2c = (undefined1 *)0x0; local_40 = (byte *)(*(int *)(in_ECX + 0xf0) + 1); pbVar91 = (byte *)(iVar102 + 1); local_38 = local_3c; if (uVar103 != 0) { local_48 = uVar103; do { bVar89 = *pbVar91; pbVar91 = pbVar91 + 1; bVar93 = *local_38; local_38 = local_38 + 1; bVar93 = bVar93 - (bVar89 >> 1); *local_40 = bVar93; local_40 = local_40 + 1; uVar99 = (uint)bVar93; if (0x7f < uVar99) { uVar99 = 0x100 - uVar99; } uVar90 = uVar90 + uVar99; local_48 = local_48 - 1; } while (local_48 != 0); local_2c = (undefined1 *)uVar103; } if (local_2c < uVar101) { pbVar92 = local_40; do { bVar89 = *local_38 - (char)((uint)pbVar92[(int)pbVar91 - (int)local_40] + (uint)*local_3c >> 1); uVar99 = (uint)bVar89; *pbVar92 = bVar89; if (0x7f < uVar99) { uVar99 = 0x100 - uVar99; } uVar90 = uVar90 + uVar99; if (local_24 < uVar90) break; local_2c = (undefined1 *)((int)local_2c + 1); pbVar92 = pbVar92 + 1; local_3c = local_3c + 1; local_38 = local_38 + 1; } while (local_2c < uVar101); } if (*(char *)(in_ECX + 0x1f0) == '\x02') { uVar99 = uVar90 & 0xffff; uVar90 = uVar90 >> 10 & 0x3fffc0; if (bVar2 != 0) { iVar171 = *(int *)(in_ECX + 500); iVar172 = 0; do { if (*(char *)(iVar171 + iVar172) == '\0') { uVar98 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1f8) + iVar172 * 2); iVar171 = *(int *)(in_ECX + 500); uVar99 = uVar99 * uVar98 >> 8; uVar90 = uVar90 * uVar98 >> 8; } iVar172 = iVar172 + 1; } while (iVar172 < (int)uVar94); } uVar98 = (uint)*(ushort *)(*(int *)(in_ECX + 0x200) + 6); uVar90 = uVar98 * uVar90 >> 3; if (uVar90 < 0x3fffc1) { uVar90 = (uVar99 * uVar98 >> 3) + uVar90 * 0x400; } else { uVar90 = 0x7fffffff; } } if (uVar90 < local_28) { local_1c = *(undefined1 **)(in_ECX + 0xf0); local_28 = uVar90; } } uVar90 = local_28; if (bVar146 == 0x80) { pcVar96 = (char *)(iVar102 + 1); pbVar92 = puVar4 + 1; pcVar100 = (char *)(*(int *)(in_ECX + 0xf4) + 1); local_48 = 0; pbVar91 = pbVar92; local_34 = pcVar96; if (uVar103 != 0) { uVar90 = uVar103; do { bVar146 = *pbVar91; pbVar91 = pbVar91 + 1; cVar3 = *local_34; local_34 = local_34 + 1; *pcVar100 = bVar146 - cVar3; pcVar100 = pcVar100 + 1; uVar90 = uVar90 - 1; } while (uVar90 != 0); local_48 = uVar103; } uVar103 = local_48; if (local_48 < uVar101) { iVar171 = (int)local_34 - (int)pbVar92; iVar102 = (int)pcVar96 - (int)pbVar92; uVar90 = local_48; do { pbVar1 = pbVar92 + iVar171; bVar146 = pbVar92[iVar102]; local_48._0_1_ = *pbVar92; pbVar92 = pbVar92 + 1; uVar105 = (uint)*pbVar1 - (uint)bVar146; uVar99 = (uint)(byte)local_48 - (uint)bVar146; iVar172 = (uVar105 ^ (int)uVar105 >> 0x1f) - ((int)uVar105 >> 0x1f); iVar173 = (uVar99 ^ (int)uVar99 >> 0x1f) - ((int)uVar99 >> 0x1f); uVar98 = (int)(uVar99 + uVar105) >> 0x1f; iVar174 = (uVar99 + uVar105 ^ uVar98) - uVar98; if (((iVar173 < iVar172) || (iVar174 < iVar172)) && (local_48._0_1_ = bVar146, iVar173 <= iVar174)) { local_48._0_1_ = *pbVar1; } pcVar100[uVar90 - uVar103] = pbVar91[uVar90 - uVar103] - (byte)local_48; uVar90 = uVar90 + 1; } while (uVar90 < uVar101); } local_24 = *(byte **)(in_ECX + 0xf4); goto LAB_00a94abd; } local_24 = local_1c; if (-1 < (char)bVar146) goto LAB_00a94abd; local_30 = (byte *)0x0; if (*(char *)(in_ECX + 0x1f0) == '\x02') { local_40 = (byte *)(local_28 & 0xffff); uVar99 = local_28 >> 10 & 0x3fffc0; if (bVar2 != 0) { iVar171 = 0; local_48 = uVar99; do { if (*(char *)(*(int *)(in_ECX + 500) + iVar171) == '\x04') { uVar99 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1fc) + iVar171 * 2); local_40 = (byte *)((int)local_40 * uVar99 >> 8); uVar99 = uVar99 * local_48 >> 8; local_48 = uVar99; } iVar171 = iVar171 + 1; } while (iVar171 < (int)uVar94); } uVar98 = (uint)*(ushort *)(*(int *)(in_ECX + 0x204) + 8); uVar99 = uVar98 * uVar99 >> 3; if (uVar99 < 0x3fffc1) { local_28 = (uVar98 * (int)local_40 >> 3) + uVar99 * 0x400; } else { local_28 = 0x7fffffff; } } uVar99 = 0; pbVar91 = puVar4 + 1; iVar171 = *(int *)(in_ECX + 0xf4); pcVar100 = (char *)(iVar102 + 1); local_38 = (byte *)(iVar171 + 1); local_1c = (undefined1 *)0x0; local_20 = pbVar91; local_14 = pcVar100; if (uVar103 == 0) { LAB_00a94909: } else { if (7 < uVar103) { local_1c = (undefined1 *)0x0; if ((((byte *)(iVar102 + uVar103) < local_38) || ((char *)(iVar171 + uVar103) < pcVar100)) && ((puVar4 + uVar103 < local_38 || ((byte *)(iVar171 + uVar103) < pbVar91)))) { iVar174 = 0; iVar175 = 0; iVar176 = 0; iVar177 = 0; iVar102 = 0; iVar171 = 0; iVar172 = 0; iVar173 = 0; do { uVar5 = *(undefined4 *)local_14; uVar6 = *(undefined4 *)local_20; bVar146 = (char)uVar6 - (char)uVar5; bVar89 = (char)((uint)uVar6 >> 8) - (char)((uint)uVar5 >> 8); bVar93 = (char)((uint)uVar6 >> 0x10) - (char)((uint)uVar5 >> 0x10); bVar169 = (char)((uint)uVar6 >> 0x18) - (char)((uint)uVar5 >> 0x18); local_1c = (undefined1 *)((int)local_1c + 8); *(uint *)local_38 = CONCAT13(bVar169,CONCAT12(bVar93,CONCAT11(bVar89,bVar146))); auVar76[0xc] = bVar169; auVar76._0_12_ = ZEXT812(0); uVar88 = CONCAT32(auVar76._10_3_,(ushort)bVar93); Var59 = CONCAT82((ulonglong)uVar88 << 0x10,(ushort)bVar89); auVar167._0_4_ = CONCAT31(0,bVar146); auVar167._4_10_ = Var59; auVar167._14_2_ = 0; uVar99 = (uint)Var59; auVar143._0_8_ = CONCAT44(-(uint)(uVar99 < 0x80),-(uint)(auVar167._0_4_ < 0x80)); iVar178 = (int)uVar88; auVar143._8_4_ = -(uint)(iVar178 < 0x80); auVar143._12_4_ = -(uint)(bVar169 < 0x80); auVar113._0_4_ = 0x100 - auVar167._0_4_; auVar113._4_4_ = 0x100 - uVar99; auVar113._8_4_ = 0x100 - iVar178; auVar113._12_4_ = 0x100 - (uint)(ushort)bVar169; auVar127._8_4_ = auVar143._8_4_; auVar127._0_8_ = auVar143._0_8_; auVar127._12_4_ = auVar143._12_4_; uVar5 = *(undefined4 *)(local_20 + 4); uVar6 = *(undefined4 *)(local_14 + 4); auVar131 = ~auVar127 & auVar113 | auVar143 & auVar167; bVar146 = (char)uVar5 - (char)uVar6; bVar89 = (char)((uint)uVar5 >> 8) - (char)((uint)uVar6 >> 8); bVar93 = (char)((uint)uVar5 >> 0x10) - (char)((uint)uVar6 >> 0x10); bVar169 = (char)((uint)uVar5 >> 0x18) - (char)((uint)uVar6 >> 0x18); *(uint *)(local_38 + 4) = CONCAT13(bVar169,CONCAT12(bVar93,CONCAT11(bVar89,bVar146))); iVar174 = iVar174 + auVar131._0_4_; iVar175 = iVar175 + auVar131._4_4_; iVar176 = iVar176 + auVar131._8_4_; iVar177 = iVar177 + auVar131._12_4_; auVar77[0xc] = bVar169; auVar77._0_12_ = ZEXT812(0); uVar88 = CONCAT32(auVar77._10_3_,(ushort)bVar93); Var59 = CONCAT82((ulonglong)uVar88 << 0x10,(ushort)bVar89); auVar168._0_4_ = CONCAT31(0,bVar146); auVar168._4_10_ = Var59; auVar168._14_2_ = 0; local_14 = local_14 + 8; uVar99 = (uint)Var59; auVar144._0_8_ = CONCAT44(-(uint)(uVar99 < 0x80),-(uint)(auVar168._0_4_ < 0x80)); iVar178 = (int)uVar88; auVar144._8_4_ = -(uint)(iVar178 < 0x80); auVar144._12_4_ = -(uint)(bVar169 < 0x80); auVar128._8_4_ = auVar144._8_4_; auVar128._0_8_ = auVar144._0_8_; auVar128._12_4_ = auVar144._12_4_; auVar114._0_4_ = 0x100 - auVar168._0_4_; auVar114._4_4_ = 0x100 - uVar99; auVar114._8_4_ = 0x100 - iVar178; auVar114._12_4_ = 0x100 - (uint)(ushort)bVar169; local_20 = local_20 + 8; local_38 = local_38 + 8; auVar131 = ~auVar128 & auVar114 | auVar144 & auVar168; iVar102 = iVar102 + auVar131._0_4_; iVar171 = iVar171 + auVar131._4_4_; iVar172 = iVar172 + auVar131._8_4_; iVar173 = iVar173 + auVar131._12_4_; } while (local_1c < (uVar103 & 0xfffffff8)); uVar99 = iVar102 + iVar174 + iVar172 + iVar176 + iVar171 + iVar175 + iVar173 + iVar177; local_30 = (byte *)uVar99; if (uVar103 <= local_1c) goto LAB_00a94909; } } iVar102 = uVar103 - (int)local_1c; while( true ) { bVar146 = *local_20; cVar3 = *local_14; local_14 = local_14 + 1; local_20 = local_20 + 1; *local_38 = bVar146 - cVar3; uVar98 = (uint)(byte)(bVar146 - cVar3); if (0x7f < uVar98) { uVar98 = 0x100 - uVar98; } uVar99 = uVar99 + uVar98; iVar102 = iVar102 + -1; if (iVar102 == 0) break; local_38 = local_38 + 1; } local_38 = local_38 + 1; local_30 = (byte *)uVar99; local_1c = (undefined1 *)uVar103; } if (local_1c < uVar101) { iVar171 = (int)local_14 - (int)pbVar91; iVar102 = (int)pcVar100 - (int)pbVar91; do { bVar146 = pbVar91[iVar102]; pbVar92 = pbVar91 + iVar171; local_48._0_1_ = *pbVar91; pbVar91 = pbVar91 + 1; uVar103 = (uint)(byte)local_48 - (uint)bVar146; uVar98 = (uint)*pbVar92 - (uint)bVar146; iVar172 = (uVar98 ^ (int)uVar98 >> 0x1f) - ((int)uVar98 >> 0x1f); iVar173 = (uVar103 ^ (int)uVar103 >> 0x1f) - ((int)uVar103 >> 0x1f); uVar99 = (int)(uVar103 + uVar98) >> 0x1f; iVar174 = (uVar103 + uVar98 ^ uVar99) - uVar99; if (((iVar173 < iVar172) || (iVar174 < iVar172)) && (local_48._0_1_ = bVar146, iVar173 <= iVar174)) { local_48._0_1_ = *pbVar92; } bVar146 = *local_20; local_20 = local_20 + 1; uVar103 = (uint)(byte)(bVar146 - (byte)local_48); *local_38 = bVar146 - (byte)local_48; local_38 = local_38 + 1; if (0x7f < uVar103) { uVar103 = 0x100 - uVar103; } local_30 = (byte *)((int)local_30 + uVar103); } while ((local_30 <= local_28) && (local_1c = (undefined1 *)((int)local_1c + 1), local_1c < uVar101)); } if (*(char *)(in_ECX + 0x1f0) == '\x02') { uVar103 = (uint)local_30 & 0xffff; iVar102 = 0; uVar101 = (uint)local_30 >> 10 & 0x3fffc0; if (bVar2 != 0) { iVar171 = *(int *)(in_ECX + 500); do { if (*(char *)(iVar171 + iVar102) == '\x04') { uVar99 = (uint)*(ushort *)(*(int *)(in_ECX + 0x1f8) + iVar102 * 2); iVar171 = *(int *)(in_ECX + 500); uVar103 = uVar103 * uVar99 >> 8; uVar101 = uVar101 * uVar99 >> 8; } iVar102 = iVar102 + 1; } while (iVar102 < (int)uVar94); } uVar99 = (uint)*(ushort *)(*(int *)(in_ECX + 0x200) + 8); uVar101 = uVar101 * uVar99 >> 3; if (uVar101 < 0x3fffc1) { local_30 = (byte *)((uVar103 * uVar99 >> 3) + uVar101 * 0x400); } else { local_30 = (byte *)0x7fffffff; } } if (local_30 < uVar90) { local_24 = *(byte **)(in_ECX + 0xf4); } goto LAB_00a94abd; } local_20 = puVar4 + 1; pcVar100 = (char *)(*(int *)(in_ECX + 0xf0) + 1); local_30 = (byte *)(iVar102 + 1); local_1c = (undefined1 *)0x0; pbVar91 = local_20; if (uVar103 != 0) { uVar90 = uVar103; do { bVar146 = *local_30; local_30 = local_30 + 1; bVar89 = *pbVar91; pbVar91 = pbVar91 + 1; *pcVar100 = bVar89 - (bVar146 >> 1); pcVar100 = pcVar100 + 1; uVar90 = uVar90 - 1; } while (uVar90 != 0); local_1c = (undefined1 *)uVar103; } uVar103 = uVar101 - (int)local_1c; if (local_1c < uVar101) { if (7 < uVar103) { if ((((puVar4 + uVar101 < pcVar100 + (int)local_1c) || (pcVar100 + (uVar101 - 1) < local_20 + (int)local_1c)) && ((local_30 + (uVar101 - 1) < pcVar100 + (int)local_1c || (pcVar100 + (uVar101 - 1) < local_30 + (int)local_1c)))) && ((pbVar91 + (uVar101 - 1) < pcVar100 + (int)local_1c || (pcVar100 + (uVar101 - 1) < pbVar91 + (int)local_1c)))) { do { uVar5 = *(undefined4 *)local_30; uVar6 = *(undefined4 *)local_20; Var57 = CONCAT91((unkuint9)0,(char)((uint)uVar6 >> 0x18)); auVar69[10] = 0; auVar69._0_10_ = Var57; auVar121[4] = (char)((uint)uVar6 >> 0x10); auVar121._0_4_ = uVar6; auVar121._5_11_ = auVar69 << 8; auVar68[0xc] = 0; auVar68._0_12_ = auVar121._4_12_; auVar120._0_2_ = (ushort)uVar6; auVar120[2] = (char)((uint)uVar6 >> 8); auVar120._3_13_ = auVar68 << 8; auVar119._2_14_ = auVar120._2_14_; auVar119._0_2_ = auVar120._0_2_ & 0xff; Var58 = CONCAT91((unkuint9)0,(char)((uint)uVar5 >> 0x18)); auVar71[10] = 0; auVar71._0_10_ = Var58; auVar137[4] = (char)((uint)uVar5 >> 0x10); auVar137._0_4_ = uVar5; auVar137._5_11_ = auVar71 << 8; auVar70[0xc] = 0; auVar70._0_12_ = auVar137._4_12_; auVar136._0_2_ = (ushort)uVar5; auVar136[2] = (char)((uint)uVar5 >> 8); auVar136._3_13_ = auVar70 << 8; auVar135._2_14_ = auVar136._2_14_; auVar135._0_2_ = auVar136._0_2_ & 0xff; uVar129 = (ushort)Var57; auVar82._10_2_ = 0; auVar82._0_10_ = auVar119._0_10_; auVar82._12_2_ = uVar129; uVar86 = CONCAT42(auVar82._10_4_,auVar121._4_2_); auVar122._0_4_ = auVar119._0_4_; auVar122._4_2_ = auVar120._2_2_; auVar122._6_10_ = (unkuint10)uVar86 << 0x10; uVar145 = (ushort)Var58; auVar83._10_2_ = 0; auVar83._0_10_ = auVar135._0_10_; auVar83._12_2_ = uVar145; uVar87 = CONCAT42(auVar83._10_4_,auVar137._4_2_); auVar138._0_4_ = auVar135._0_4_; auVar138._4_2_ = auVar136._2_2_; auVar138._6_10_ = (unkuint10)uVar87 << 0x10; iVar102 = (int)uVar87 + (int)uVar86; local_1c = (undefined1 *)((int)local_1c + 8); uVar5 = *(undefined4 *)pbVar91; uVar6 = *(undefined4 *)(local_30 + 4); auVar109._0_4_ = (int)((auVar138._0_4_ & 0xffff) + (auVar122._0_4_ & 0xffff)) >> 1; auVar109._4_4_ = auVar138._4_4_ + auVar122._4_4_ >> 1; auVar109._8_4_ = (int)((-(uint)(iVar102 < 0) & 1) + iVar102) >> 1; auVar109._12_4_ = (int)((uint)uVar145 + (uint)uVar129) >> 1; local_30 = local_30 + 8; auVar131 = pshuflw(auVar109,auVar109,0xd8); auVar131 = pshufhw(auVar131,auVar131,0xd8); auVar110._0_4_ = auVar131._0_4_; auVar110._12_4_ = auVar131._12_4_; auVar110._4_4_ = auVar131._8_4_; auVar110._8_4_ = auVar131._4_4_; auVar110 = auVar110 & _DAT_00baba30; sVar7 = auVar110._0_2_; sVar8 = auVar110._2_2_; sVar9 = auVar110._4_2_; sVar10 = auVar110._6_2_; Var57 = CONCAT91((unkuint9)0,(char)((uint)uVar6 >> 0x18)); auVar73[10] = 0; auVar73._0_10_ = Var57; auVar141[4] = (char)((uint)uVar6 >> 0x10); auVar141._0_4_ = uVar6; auVar141._5_11_ = auVar73 << 8; auVar72[0xc] = 0; auVar72._0_12_ = auVar141._4_12_; auVar140._0_2_ = (ushort)uVar6; auVar140[2] = (char)((uint)uVar6 >> 8); auVar140._3_13_ = auVar72 << 8; auVar139._2_14_ = auVar140._2_14_; auVar139._0_2_ = auVar140._0_2_ & 0xff; *(uint *)pcVar100 = CONCAT13((char)((uint)uVar5 >> 0x18) - ((0 < sVar10) * (sVar10 < 0x100) * auVar110[6] - (0xff < sVar10)), CONCAT12((char)((uint)uVar5 >> 0x10) - ((0 < sVar9) * (sVar9 < 0x100) * auVar110[4] - (0xff < sVar9)), CONCAT11((char)((uint)uVar5 >> 8) - ((0 < sVar8) * (sVar8 < 0x100) * auVar110[2] - (0xff < sVar8)), (char)uVar5 - ((0 < sVar7) * (sVar7 < 0x100) * auVar110[0] - (0xff < sVar7))))); uVar5 = *(undefined4 *)(local_20 + 4); local_20 = local_20 + 8; Var58 = CONCAT91((unkuint9)0,(char)((uint)uVar5 >> 0x18)); auVar75[10] = 0; auVar75._0_10_ = Var58; auVar125[4] = (char)((uint)uVar5 >> 0x10); auVar125._0_4_ = uVar5; auVar125._5_11_ = auVar75 << 8; auVar74[0xc] = 0; auVar74._0_12_ = auVar125._4_12_; auVar124._0_2_ = (ushort)uVar5; auVar124[2] = (char)((uint)uVar5 >> 8); auVar124._3_13_ = auVar74 << 8; auVar123._2_14_ = auVar124._2_14_; auVar123._0_2_ = auVar124._0_2_ & 0xff; uVar129 = (ushort)Var58; auVar84._10_2_ = 0; auVar84._0_10_ = auVar123._0_10_; auVar84._12_2_ = uVar129; uVar86 = CONCAT42(auVar84._10_4_,auVar125._4_2_); auVar126._0_4_ = auVar123._0_4_; auVar126._4_2_ = auVar124._2_2_; auVar126._6_10_ = (unkuint10)uVar86 << 0x10; uVar145 = (ushort)Var57; auVar85._10_2_ = 0; auVar85._0_10_ = auVar139._0_10_; auVar85._12_2_ = uVar145; uVar87 = CONCAT42(auVar85._10_4_,auVar141._4_2_); auVar142._0_4_ = auVar139._0_4_; auVar142._4_2_ = auVar140._2_2_; auVar142._6_10_ = (unkuint10)uVar87 << 0x10; iVar102 = (int)uVar87 + (int)uVar86; uVar5 = *(undefined4 *)(pbVar91 + 4); pbVar91 = pbVar91 + 8; auVar111._0_4_ = (int)((auVar142._0_4_ & 0xffff) + (auVar126._0_4_ & 0xffff)) >> 1; auVar111._4_4_ = auVar142._4_4_ + auVar126._4_4_ >> 1; auVar111._8_4_ = (int)((-(uint)(iVar102 < 0) & 1) + iVar102) >> 1; auVar111._12_4_ = (int)((uint)uVar145 + (uint)uVar129) >> 1; auVar131 = pshuflw(auVar111,auVar111,0xd8); auVar131 = pshufhw(auVar131,auVar131,0xd8); auVar112._0_4_ = auVar131._0_4_; auVar112._12_4_ = auVar131._12_4_; auVar112._4_4_ = auVar131._8_4_; auVar112._8_4_ = auVar131._4_4_; auVar112 = auVar112 & _DAT_00baba30; sVar7 = auVar112._0_2_; sVar8 = auVar112._2_2_; sVar9 = auVar112._4_2_; sVar10 = auVar112._6_2_; *(uint *)(pcVar100 + 4) = CONCAT13((char)((uint)uVar5 >> 0x18) - ((0 < sVar10) * (sVar10 < 0x100) * auVar112[6] - (0xff < sVar10)), CONCAT12((char)((uint)uVar5 >> 0x10) - ((0 < sVar9) * (sVar9 < 0x100) * auVar112[4] - (0xff < sVar9)), CONCAT11((char)((uint)uVar5 >> 8) - ((0 < sVar8) * (sVar8 < 0x100) * auVar112[2] - (0xff < sVar8)), (char)uVar5 - ((0 < sVar7) * (sVar7 < 0x100) * auVar112[0] - (0xff < sVar7))))); pcVar100 = pcVar100 + 8; } while (local_1c < uVar101 - (uVar103 & 7)); if (uVar101 <= local_1c) goto LAB_00a9436a; } } iVar102 = uVar101 - (int)local_1c; pcVar96 = pcVar100; do { bVar146 = *local_20; local_20 = local_20 + 1; *pcVar96 = *pbVar91 - (char)((uint)(byte)pcVar96[(int)local_30 - (int)pcVar100] + (uint)bVar146 >> 1); iVar102 = iVar102 + -1; pcVar96 = pcVar96 + 1; pbVar91 = pbVar91 + 1; } while (iVar102 != 0); } LAB_00a9436a: local_24 = *(byte **)(in_ECX + 0xf0); goto LAB_00a94abd; } uVar103 = 0; iVar171 = *(int *)(in_ECX + 0xec); pcVar96 = puVar4 + 1; pcVar100 = (char *)(iVar171 + 1); pcVar104 = (char *)(iVar102 + 1); if (uVar101 != 0) { if (0x3f < uVar101) { if ((((char *)(iVar102 + uVar101) < pcVar100) || ((char *)(iVar171 + uVar101) < pcVar104)) && ((puVar4 + uVar101 < pcVar100 || ((char *)(iVar171 + uVar101) < pcVar96)))) { uVar103 = 0; do { cVar3 = pcVar104[1]; cVar11 = pcVar104[2]; cVar12 = pcVar104[3]; cVar13 = pcVar104[4]; cVar14 = pcVar104[5]; cVar15 = pcVar104[6]; cVar16 = pcVar104[7]; cVar17 = pcVar104[8]; cVar18 = pcVar104[9]; cVar19 = pcVar104[10]; cVar20 = pcVar104[0xb]; cVar21 = pcVar104[0xc]; cVar22 = pcVar104[0xd]; cVar23 = pcVar104[0xe]; cVar24 = pcVar104[0xf]; uVar103 = uVar103 + 0x40; cVar25 = pcVar96[1]; cVar26 = pcVar96[2]; cVar27 = pcVar96[3]; cVar28 = pcVar96[4]; cVar29 = pcVar96[5]; cVar30 = pcVar96[6]; cVar31 = pcVar96[7]; cVar32 = pcVar96[8]; cVar33 = pcVar96[9]; cVar34 = pcVar96[10]; cVar35 = pcVar96[0xb]; cVar36 = pcVar96[0xc]; cVar37 = pcVar96[0xd]; cVar38 = pcVar96[0xe]; cVar39 = pcVar96[0xf]; cVar40 = pcVar104[0x10]; cVar41 = pcVar104[0x11]; cVar42 = pcVar104[0x12]; cVar43 = pcVar104[0x13]; cVar44 = pcVar104[0x14]; cVar45 = pcVar104[0x15]; cVar46 = pcVar104[0x16]; cVar47 = pcVar104[0x17]; cVar48 = pcVar104[0x18]; cVar49 = pcVar104[0x19]; cVar50 = pcVar104[0x1a]; cVar51 = pcVar104[0x1b]; cVar52 = pcVar104[0x1c]; cVar53 = pcVar104[0x1d]; cVar54 = pcVar104[0x1e]; cVar55 = pcVar104[0x1f]; *pcVar100 = *pcVar96 - *pcVar104; pcVar100[1] = cVar25 - cVar3; pcVar100[2] = cVar26 - cVar11; pcVar100[3] = cVar27 - cVar12; pcVar100[4] = cVar28 - cVar13; pcVar100[5] = cVar29 - cVar14; pcVar100[6] = cVar30 - cVar15; pcVar100[7] = cVar31 - cVar16; pcVar100[8] = cVar32 - cVar17; pcVar100[9] = cVar33 - cVar18; pcVar100[10] = cVar34 - cVar19; pcVar100[0xb] = cVar35 - cVar20; pcVar100[0xc] = cVar36 - cVar21; pcVar100[0xd] = cVar37 - cVar22; pcVar100[0xe] = cVar38 - cVar23; pcVar100[0xf] = cVar39 - cVar24; cVar3 = pcVar96[0x11]; cVar11 = pcVar96[0x12]; cVar12 = pcVar96[0x13]; cVar13 = pcVar96[0x14]; cVar14 = pcVar96[0x15]; cVar15 = pcVar96[0x16]; cVar16 = pcVar96[0x17]; cVar17 = pcVar96[0x18]; cVar18 = pcVar96[0x19]; cVar19 = pcVar96[0x1a]; cVar20 = pcVar96[0x1b]; cVar21 = pcVar96[0x1c]; cVar22 = pcVar96[0x1d]; cVar23 = pcVar96[0x1e]; cVar24 = pcVar96[0x1f]; cVar25 = pcVar104[0x20]; cVar26 = pcVar104[0x21]; cVar27 = pcVar104[0x22]; cVar28 = pcVar104[0x23]; cVar29 = pcVar104[0x24]; cVar30 = pcVar104[0x25]; cVar31 = pcVar104[0x26]; cVar32 = pcVar104[0x27]; cVar33 = pcVar104[0x28]; cVar34 = pcVar104[0x29]; cVar35 = pcVar104[0x2a]; cVar36 = pcVar104[0x2b]; cVar37 = pcVar104[0x2c]; cVar38 = pcVar104[0x2d]; cVar39 = pcVar104[0x2e]; cVar56 = pcVar104[0x2f]; pcVar100[0x10] = pcVar96[0x10] - cVar40; pcVar100[0x11] = cVar3 - cVar41; pcVar100[0x12] = cVar11 - cVar42; pcVar100[0x13] = cVar12 - cVar43; pcVar100[0x14] = cVar13 - cVar44; pcVar100[0x15] = cVar14 - cVar45; pcVar100[0x16] = cVar15 - cVar46; pcVar100[0x17] = cVar16 - cVar47; pcVar100[0x18] = cVar17 - cVar48; pcVar100[0x19] = cVar18 - cVar49; pcVar100[0x1a] = cVar19 - cVar50; pcVar100[0x1b] = cVar20 - cVar51; pcVar100[0x1c] = cVar21 - cVar52; pcVar100[0x1d] = cVar22 - cVar53; pcVar100[0x1e] = cVar23 - cVar54; pcVar100[0x1f] = cVar24 - cVar55; cVar3 = pcVar96[0x21]; cVar11 = pcVar96[0x22]; cVar12 = pcVar96[0x23]; cVar13 = pcVar96[0x24]; cVar14 = pcVar96[0x25]; cVar15 = pcVar96[0x26]; cVar16 = pcVar96[0x27]; cVar17 = pcVar96[0x28]; cVar18 = pcVar96[0x29]; cVar19 = pcVar96[0x2a]; cVar20 = pcVar96[0x2b]; cVar21 = pcVar96[0x2c]; cVar22 = pcVar96[0x2d]; cVar23 = pcVar96[0x2e]; cVar24 = pcVar96[0x2f]; cVar40 = pcVar104[0x30]; cVar41 = pcVar104[0x31]; cVar42 = pcVar104[0x32]; cVar43 = pcVar104[0x33]; cVar44 = pcVar104[0x34]; cVar45 = pcVar104[0x35]; cVar46 = pcVar104[0x36]; cVar47 = pcVar104[0x37]; cVar48 = pcVar104[0x38]; cVar49 = pcVar104[0x39]; cVar50 = pcVar104[0x3a]; cVar51 = pcVar104[0x3b]; cVar52 = pcVar104[0x3c]; cVar53 = pcVar104[0x3d]; cVar54 = pcVar104[0x3e]; cVar55 = pcVar104[0x3f]; pcVar104 = pcVar104 + 0x40; pcVar100[0x20] = pcVar96[0x20] - cVar25; pcVar100[0x21] = cVar3 - cVar26; pcVar100[0x22] = cVar11 - cVar27; pcVar100[0x23] = cVar12 - cVar28; pcVar100[0x24] = cVar13 - cVar29; pcVar100[0x25] = cVar14 - cVar30; pcVar100[0x26] = cVar15 - cVar31; pcVar100[0x27] = cVar16 - cVar32; pcVar100[0x28] = cVar17 - cVar33; pcVar100[0x29] = cVar18 - cVar34; pcVar100[0x2a] = cVar19 - cVar35; pcVar100[0x2b] = cVar20 - cVar36; pcVar100[0x2c] = cVar21 - cVar37; pcVar100[0x2d] = cVar22 - cVar38; pcVar100[0x2e] = cVar23 - cVar39; pcVar100[0x2f] = cVar24 - cVar56; pcVar97 = pcVar96 + 0x30; cVar3 = pcVar96[0x31]; cVar11 = pcVar96[0x32]; cVar12 = pcVar96[0x33]; cVar13 = pcVar96[0x34]; cVar14 = pcVar96[0x35]; cVar15 = pcVar96[0x36]; cVar16 = pcVar96[0x37]; cVar17 = pcVar96[0x38]; cVar18 = pcVar96[0x39]; cVar19 = pcVar96[0x3a]; cVar20 = pcVar96[0x3b]; cVar21 = pcVar96[0x3c]; cVar22 = pcVar96[0x3d]; cVar23 = pcVar96[0x3e]; cVar24 = pcVar96[0x3f]; pcVar96 = pcVar96 + 0x40; pcVar100[0x30] = *pcVar97 - cVar40; pcVar100[0x31] = cVar3 - cVar41; pcVar100[0x32] = cVar11 - cVar42; pcVar100[0x33] = cVar12 - cVar43; pcVar100[0x34] = cVar13 - cVar44; pcVar100[0x35] = cVar14 - cVar45; pcVar100[0x36] = cVar15 - cVar46; pcVar100[0x37] = cVar16 - cVar47; pcVar100[0x38] = cVar17 - cVar48; pcVar100[0x39] = cVar18 - cVar49; pcVar100[0x3a] = cVar19 - cVar50; pcVar100[0x3b] = cVar20 - cVar51; pcVar100[0x3c] = cVar21 - cVar52; pcVar100[0x3d] = cVar22 - cVar53; pcVar100[0x3e] = cVar23 - cVar54; pcVar100[0x3f] = cVar24 - cVar55; pcVar100 = pcVar100 + 0x40; } while (uVar103 < (uVar101 & 0xffffffc0)); if (uVar101 <= uVar103) goto LAB_00a93f82; } else { uVar103 = 0; } } iVar102 = uVar101 - uVar103; pcVar97 = pcVar100; do { *pcVar97 = pcVar97[(int)pcVar96 - (int)pcVar100] - (pcVar97 + 1)[(int)(pcVar104 + (-1 - (int)pcVar100))]; iVar102 = iVar102 + -1; pcVar97 = pcVar97 + 1; } while (iVar102 != 0); } LAB_00a93f82: local_24 = *(byte **)(in_ECX + 0xec); LAB_00a94abd: png_write_filtered_row(); if (*(char *)(in_ECX + 0x1f1) != '\0') { iVar102 = 1; if (1 < bVar2) { do { *(undefined1 *)(*(int *)(in_ECX + 500) + iVar102) = *(undefined1 *)(*(int *)(in_ECX + 500) + -1 + iVar102); iVar102 = iVar102 + 1; } while (iVar102 < (int)uVar94); } *(byte *)(iVar102 + *(int *)(in_ECX + 500)) = *local_24; } return; } //@@ 00a94b10 png_write_filtered_row /* DB: libpng pngwutil.c: zstream next_in = filtered row (+0x6c), avail_in = rowbytes+1, deflate loop ("zlib error"), flushes IDAT when avail_out==0 through write_data_fn (+0x4c, "Call to NULL write function"), CRC update; caller png_write_find_filter */ void png_write_filtered_row(void) { byte *buffer; int iVar1; uint uVar2; void *in_ECX; undefined4 in_EDX; *(undefined4 *)((int)in_ECX + 0x6c) = in_EDX; *(int *)((int)in_ECX + 0x70) = *(int *)((int)in_ECX + 0xfc) + 1; do { iVar1 = deflate((void *)((int)in_ECX + 0x6c),0); if (iVar1 != 0) { if (*(int *)((int)in_ECX + 0x84) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (*(int *)((int)in_ECX + 0x7c) == 0) { uVar2 = *(uint *)((int)in_ECX + 0xa8); buffer = *(byte **)((int)in_ECX + 0xa4); png_write_chunk_header(in_ECX,(byte *)&DAT_00c12998,uVar2); if ((buffer != (byte *)0x0) && (uVar2 != 0)) { if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a94b85; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a94b85: uVar2 = crc32(*(uint *)((int)in_ECX + 0x108),buffer,uVar2); *(uint *)((int)in_ECX + 0x108) = uVar2; } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) goto LAB_00a94c6d; (**(code **)((int)in_ECX + 0x4c))(); } if (*(code **)((int)in_ECX + 0x4c) == (code *)0x0) { LAB_00a94c6d: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x4c))(); *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 4; *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); } if (*(int *)((int)in_ECX + 0x70) == 0) { iVar1 = *(int *)((int)in_ECX + 0xe0); if (iVar1 != 0) { *(undefined4 *)((int)in_ECX + 0xe0) = *(undefined4 *)((int)in_ECX + 0xe4); *(int *)((int)in_ECX + 0xe4) = iVar1; } png_write_finish_row(); uVar2 = *(int *)((int)in_ECX + 0x14c) + 1; *(uint *)((int)in_ECX + 0x14c) = uVar2; if ((*(uint *)((int)in_ECX + 0x148) != 0) && (*(uint *)((int)in_ECX + 0x148) <= uVar2)) { png_write_flush(); } return; } } while( true ); } //@@ 00a94c80 png_do_write_transformations /* DB: libpng pngwtran.c: only caller FUN_00a63ba0 (png_write_row: png_write_finish_row, png_write_find_filter); transformation flags at +0x68: USER_TRANSFORM 0x100000 callback +0x58, FILLER 0x8000 png_do_strip_filler, PACKSWAP 0x10000, PACK 4, ..., png_do_bgr */ void png_do_write_transformations(void) { int *piVar1; char cVar2; undefined1 uVar3; int in_ECX; int iVar4; byte *pbVar5; undefined1 *puVar6; byte bVar7; uint uVar8; uint uVar9; uint uVar10; int iVar11; byte *pbVar12; bool bVar13; uVar8 = *(uint *)(in_ECX + 0x68); if (((uVar8 & 0x100000) != 0) && (*(code **)(in_ECX + 0x58) != (code *)0x0)) { (**(code **)(in_ECX + 0x58))(); uVar8 = *(uint *)(in_ECX + 0x68); } piVar1 = (int *)(in_ECX + 0xf8); if ((uVar8 & 0x8000) != 0) { png_do_strip_filler(*(undefined4 *)(in_ECX + 100)); uVar8 = *(uint *)(in_ECX + 0x68); } if ((uVar8 & 0x10000) != 0) { FUN_00a642e0(); uVar8 = *(uint *)(in_ECX + 0x68); } if ((uVar8 & 4) == 0) goto LAB_00a94e4c; cVar2 = *(char *)(in_ECX + 0x11f); pbVar5 = (byte *)(*(int *)(in_ECX + 0xe4) + 1); if ((*(char *)(in_ECX + 0x101) != '\b') || (*(char *)(in_ECX + 0x102) != '\x01')) goto LAB_00a94e4c; pbVar12 = pbVar5; if (cVar2 == '\x01') { iVar11 = *piVar1; uVar8 = 0x80; if (iVar11 != 0) { uVar9 = 0; do { uVar10 = uVar9 | uVar8; if (*pbVar5 == 0) { uVar10 = uVar9; } if (uVar8 < 2) { *pbVar12 = (byte)uVar10; uVar8 = 0x80; pbVar12 = pbVar12 + 1; uVar10 = 0; } else { uVar8 = (int)uVar8 >> 1; } bVar7 = (byte)uVar10; iVar11 = iVar11 + -1; pbVar5 = pbVar5 + 1; uVar9 = uVar10; } while (iVar11 != 0); bVar13 = uVar8 == 0x80; LAB_00a94e0e: if (!bVar13) { *pbVar12 = bVar7; } } } else if (cVar2 == '\x02') { iVar11 = *piVar1; uVar8 = 0; iVar4 = 6; if (iVar11 != 0) { do { uVar8 = uVar8 | (*pbVar5 & 3) << ((byte)iVar4 & 0x1f); if (iVar4 == 0) { *pbVar12 = (byte)uVar8; iVar4 = 6; pbVar12 = pbVar12 + 1; uVar8 = 0; } else { iVar4 = iVar4 + -2; } bVar7 = (byte)uVar8; pbVar5 = pbVar5 + 1; iVar11 = iVar11 + -1; } while (iVar11 != 0); bVar13 = iVar4 == 6; goto LAB_00a94e0e; } } else if (cVar2 == '\x04') { iVar11 = *piVar1; uVar8 = 0; iVar4 = 4; if (iVar11 != 0) { do { uVar8 = uVar8 | (*pbVar5 & 0xf) << ((byte)iVar4 & 0x1f); if (iVar4 == 0) { *pbVar12 = (byte)uVar8; iVar4 = 4; pbVar12 = pbVar12 + 1; uVar8 = 0; } else { iVar4 = iVar4 + -4; } bVar7 = (byte)uVar8; pbVar5 = pbVar5 + 1; iVar11 = iVar11 + -1; } while (iVar11 != 0); bVar13 = iVar4 == 4; goto LAB_00a94e0e; } } bVar7 = cVar2 * *(char *)(in_ECX + 0x102); *(char *)(in_ECX + 0x101) = cVar2; *(byte *)(in_ECX + 0x103) = bVar7; *(uint *)(in_ECX + 0xfc) = (uint)bVar7 * *(int *)(in_ECX + 0xf8) + 7 >> 3; uVar8 = *(uint *)(in_ECX + 0x68); LAB_00a94e4c: if ((uVar8 & 8) != 0) { png_do_shift(in_ECX + 0x179); uVar8 = *(uint *)(in_ECX + 0x68); } if (((uVar8 & 0x10) != 0) && (*(char *)(in_ECX + 0x101) == '\x10')) { iVar11 = (uint)*(byte *)(in_ECX + 0x102) * *(int *)(in_ECX + 0xf8); puVar6 = (undefined1 *)(*(int *)(in_ECX + 0xe4) + 1); if (iVar11 != 0) { do { uVar3 = *puVar6; *puVar6 = puVar6[1]; puVar6[1] = uVar3; iVar11 = iVar11 + -1; puVar6 = puVar6 + 2; } while (iVar11 != 0); uVar8 = *(uint *)(in_ECX + 0x68); } } if ((uVar8 & 0x80000) != 0) { FUN_00a952b0(); uVar8 = *(uint *)(in_ECX + 0x68); } if ((uVar8 & 0x20000) != 0) { FUN_00a951b0(); uVar8 = *(uint *)(in_ECX + 0x68); } if ((uVar8 & 1) != 0) { png_do_bgr(); uVar8 = *(uint *)(in_ECX + 0x68); } if ((uVar8 & 0x20) != 0) { FUN_00a64260(); } return; } //@@ 00a94f10 png_do_shift /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngwtran.c: ECX=row_info (color_type +2, bit_depth +9), param = png_color_8p sig_bit (red/green/blue/gray bytes 0..3): shift_start/shift_dec per channel, skipped for palette (color_type 3); called from png_do_write_transformations (00a94c80) */ void png_do_shift(byte *param_1) { byte bVar1; byte bVar2; byte bVar3; ushort uVar4; ushort uVar5; ushort uVar6; int *in_ECX; uint uVar7; byte *in_EDX; int iVar8; int iVar9; byte *local_3c; int local_38; uint local_34; uint local_30; byte local_29; uint local_28 [4]; int local_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(local_18 + 5); bVar1 = *(byte *)(in_ECX + 2); if (bVar1 != 3) { bVar2 = *(byte *)((int)in_ECX + 9); uVar7 = (uint)bVar2; if ((bVar1 & 2) == 0) { local_30 = 1; local_28[0] = (uint)param_1[3]; local_38 = uVar7 - local_28[0]; local_18[0] = local_38; } else { local_30 = 3; local_28[0] = (uint)*param_1; local_38 = uVar7 - local_28[0]; local_18[0] = local_38; local_28[1] = (uint)param_1[1]; local_18[1] = uVar7 - param_1[1]; local_28[2] = (uint)param_1[2]; local_18[2] = uVar7 - param_1[2]; } if ((bVar1 & 4) == 0) { uVar7 = local_28[0]; } else { bVar1 = param_1[4]; local_18[local_30] = uVar7 - bVar1; local_28[local_30] = (uint)bVar1; local_30 = local_30 + 1; uVar7 = local_28[0]; } local_3c = in_EDX; if (bVar2 < 8) { local_30 = in_ECX[1]; if ((param_1[3] == 1) && (bVar2 == 2)) { local_29 = 0x55; } else if ((bVar2 != 4) || (local_29 = 0x11, param_1[3] != 3)) { local_29 = 0xff; } if (local_30 != 0) { do { bVar1 = *local_3c; *local_3c = 0; if ((int)-uVar7 < local_38) { iVar9 = (uint)bVar1 << 8; iVar8 = local_38; do { if (iVar8 < 1) { bVar2 = bVar1 >> (-(byte)iVar8 & 0x1f) & local_29; } else { bVar2 = (char)((uint)iVar9 >> 8) << ((byte)iVar8 & 0x1f); } iVar8 = iVar8 - local_28[0]; bVar2 = (byte)iVar9 | bVar2; iVar9 = CONCAT31((int3)((uint)iVar9 >> 8),bVar2); } while ((int)-uVar7 < iVar8); *local_3c = bVar2; } local_3c = local_3c + 1; local_30 = local_30 + -1; } while (local_30 != 0); return; } } else { uVar7 = *in_ECX * local_30; local_34 = 0; if (bVar2 == 8) { if (uVar7 != 0) { do { bVar1 = *local_3c; *local_3c = 0; iVar8 = local_18[local_34 % local_30]; iVar9 = -local_28[local_34 % local_30]; if (iVar9 < iVar8) { bVar2 = 0; do { if (iVar8 < 1) { bVar3 = bVar1 >> (-(byte)iVar8 & 0x1f); } else { bVar3 = bVar1 << ((byte)iVar8 & 0x1f); } iVar8 = iVar8 - local_28[local_34 % local_30]; bVar2 = bVar2 | bVar3; } while (iVar9 < iVar8); *local_3c = bVar2; } local_3c = local_3c + 1; local_34 = local_34 + 1; } while (local_34 < uVar7); return; } } else if (uVar7 != 0) { do { uVar5 = CONCAT11(*local_3c,local_3c[1]); uVar6 = 0; for (iVar8 = local_18[local_34 % local_30]; (int)-local_28[local_34 % local_30] < iVar8; iVar8 = iVar8 - local_28[local_34 % local_30]) { if (iVar8 < 1) { uVar4 = uVar5 >> (-(byte)iVar8 & 0x1f); } else { uVar4 = uVar5 << ((byte)iVar8 & 0x1f); } uVar6 = uVar6 | uVar4; } *local_3c = (byte)(uVar6 >> 8); local_34 = local_34 + 1; local_3c[1] = (byte)uVar6; local_3c = local_3c + 2; } while (local_34 < uVar7); } } } return; } //@@ 00a951b0 FUN_00a951b0 void FUN_00a951b0(void) { undefined1 uVar1; undefined1 uVar2; int *in_ECX; undefined1 *in_EDX; undefined1 *puVar3; int iVar4; if ((char)in_ECX[2] == '\x06') { iVar4 = *in_ECX; if (*(char *)((int)in_ECX + 9) == '\b') { puVar3 = in_EDX; if (iVar4 != 0) { do { uVar1 = *puVar3; *in_EDX = puVar3[1]; in_EDX[1] = puVar3[2]; in_EDX[2] = puVar3[3]; in_EDX[3] = uVar1; iVar4 = iVar4 + -1; in_EDX = in_EDX + 4; puVar3 = puVar3 + 4; } while (iVar4 != 0); return; } } else { puVar3 = in_EDX; if (iVar4 != 0) { do { uVar1 = *puVar3; uVar2 = puVar3[1]; *in_EDX = puVar3[2]; in_EDX[1] = puVar3[3]; in_EDX[2] = puVar3[4]; in_EDX[3] = puVar3[5]; in_EDX[4] = puVar3[6]; in_EDX[5] = puVar3[7]; in_EDX[6] = uVar1; in_EDX[7] = uVar2; iVar4 = iVar4 + -1; in_EDX = in_EDX + 8; puVar3 = puVar3 + 8; } while (iVar4 != 0); return; } } } else if ((char)in_ECX[2] == '\x04') { iVar4 = *in_ECX; puVar3 = in_EDX; if (*(char *)((int)in_ECX + 9) == '\b') { if (iVar4 != 0) { do { uVar1 = *puVar3; *in_EDX = puVar3[1]; in_EDX[1] = uVar1; iVar4 = iVar4 + -1; in_EDX = in_EDX + 2; puVar3 = puVar3 + 2; } while (iVar4 != 0); return; } } else { for (; iVar4 != 0; iVar4 = iVar4 + -1) { uVar1 = *in_EDX; uVar2 = in_EDX[1]; *puVar3 = in_EDX[2]; puVar3[1] = in_EDX[3]; puVar3[2] = uVar1; puVar3[3] = uVar2; in_EDX = in_EDX + 4; puVar3 = puVar3 + 4; } } } return; } //@@ 00a952b0 FUN_00a952b0 void FUN_00a952b0(void) { int *in_ECX; undefined1 *in_EDX; undefined1 *puVar1; int iVar2; if ((char)in_ECX[2] == '\x06') { iVar2 = *in_ECX; if (*(char *)((int)in_ECX + 9) == '\b') { puVar1 = in_EDX; if (iVar2 != 0) { do { *puVar1 = *in_EDX; puVar1[1] = in_EDX[1]; puVar1[2] = in_EDX[2]; puVar1[3] = ~in_EDX[3]; iVar2 = iVar2 + -1; in_EDX = in_EDX + 4; puVar1 = puVar1 + 4; } while (iVar2 != 0); return; } } else { puVar1 = in_EDX; if (iVar2 != 0) { do { *puVar1 = *in_EDX; puVar1[1] = in_EDX[1]; puVar1[2] = in_EDX[2]; puVar1[3] = in_EDX[3]; puVar1[4] = in_EDX[4]; puVar1[5] = in_EDX[5]; puVar1[6] = ~in_EDX[6]; puVar1[7] = ~in_EDX[7]; iVar2 = iVar2 + -1; in_EDX = in_EDX + 8; puVar1 = puVar1 + 8; } while (iVar2 != 0); return; } } } else if ((char)in_ECX[2] == '\x04') { iVar2 = *in_ECX; puVar1 = in_EDX; if (*(char *)((int)in_ECX + 9) == '\b') { if (iVar2 != 0) { do { *puVar1 = *in_EDX; puVar1[1] = ~in_EDX[1]; iVar2 = iVar2 + -1; in_EDX = in_EDX + 2; puVar1 = puVar1 + 2; } while (iVar2 != 0); return; } } else { for (; iVar2 != 0; iVar2 = iVar2 + -1) { *puVar1 = *in_EDX; puVar1[1] = in_EDX[1]; puVar1[2] = ~in_EDX[2]; puVar1[3] = ~in_EDX[3]; in_EDX = in_EDX + 4; puVar1 = puVar1 + 4; } } } return; } //@@ 00a953b0 deflateInit2_ /* DB: zlib deflate.c: default zalloc/zfree, level -1 -> 6, checks method==8, windowBits 9..15 (abs, <0 = raw), memLevel 1..9, strategy, allocates 0x16b8 deflate_state, w_size/hash_bits=(memLevel+7)/... 'insufficient memory' (ERR_MSG(Z_MEM_ERROR)); caller png_write_IHDR (FUN_00a911e0) */ undefined4 deflateInit2_(int param_1,uint param_2,int param_3,uint param_4) { uint uVar1; uint uVar2; int *piVar3; size_t sVar4; void *pvVar5; undefined4 uVar6; int in_ECX; code *pcVar7; uint in_EDX; int iVar8; if (in_ECX != 0) { pcVar7 = *(code **)(in_ECX + 0x20); *(undefined4 *)(in_ECX + 0x18) = 0; if (pcVar7 == (code *)0x0) { *(undefined4 *)(in_ECX + 0x28) = 0; pcVar7 = FUN_00aadd90; *(code **)(in_ECX + 0x20) = FUN_00aadd90; } if (*(int *)(in_ECX + 0x24) == 0) { *(code **)(in_ECX + 0x24) = FUN_00aaddb0; } uVar2 = 6; if (in_EDX != 0xffffffff) { uVar2 = in_EDX; } iVar8 = (param_2 ^ (int)param_2 >> 0x1f) - ((int)param_2 >> 0x1f); if ((((param_3 - 1U < 9) && (param_1 == 8)) && (iVar8 - 9U < 7)) && ((uVar2 < 10 && (param_4 < 3)))) { if (pcVar7 == FUN_00aadd90) { piVar3 = calloc(1,0x16b8); } else { piVar3 = (int *)(*pcVar7)(*(undefined4 *)(in_ECX + 0x28)); } if (piVar3 != (int *)0x0) { *(int **)(in_ECX + 0x1c) = piVar3; piVar3[6] = param_2 >> 0x1f; sVar4 = 1 << ((byte)iVar8 & 0x1f); piVar3[9] = sVar4; piVar3[10] = iVar8; piVar3[0xb] = sVar4 - 1; piVar3[0x12] = param_3 + 7; iVar8 = 1 << ((byte)(param_3 + 7) & 0x1f); piVar3[0x11] = iVar8; piVar3[0x13] = iVar8 + -1; *piVar3 = in_ECX; piVar3[0x14] = (param_3 + 9U) / 3; if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { pvVar5 = calloc(sVar4,2); } else { pvVar5 = (void *)(**(code **)(in_ECX + 0x20))(*(undefined4 *)(in_ECX + 0x28)); } piVar3[0xc] = (int)pvVar5; if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { pvVar5 = calloc(piVar3[9],2); } else { pvVar5 = (void *)(**(code **)(in_ECX + 0x20))(*(undefined4 *)(in_ECX + 0x28)); } piVar3[0xe] = (int)pvVar5; if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { pvVar5 = calloc(piVar3[0x11],2); } else { pvVar5 = (void *)(**(code **)(in_ECX + 0x20))(*(undefined4 *)(in_ECX + 0x28)); } piVar3[0xf] = (int)pvVar5; sVar4 = 1 << ((char)param_3 + 6U & 0x1f); piVar3[0x5a5] = sVar4; if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { pvVar5 = calloc(sVar4,4); } else { pvVar5 = (void *)(**(code **)(in_ECX + 0x20))(*(undefined4 *)(in_ECX + 0x28)); } uVar1 = piVar3[0x5a5]; piVar3[2] = (int)pvVar5; piVar3[3] = uVar1 * 4; if (((piVar3[0xc] != 0) && (piVar3[0xe] != 0)) && ((piVar3[0xf] != 0 && (pvVar5 != (void *)0x0)))) { *(undefined1 *)((int)piVar3 + 0x1d) = 8; piVar3[0x5a7] = (int)pvVar5 + (uVar1 & 0xfffffffe); piVar3[0x5a4] = (int)((int)pvVar5 + uVar1 * 3); piVar3[0x1f] = uVar2; piVar3[0x20] = param_4; uVar6 = FUN_00a955e0(); return uVar6; } *(char **)(in_ECX + 0x18) = "insufficient memory"; FUN_00a95a10(); } return 0xfffffffc; } } return 0xfffffffe; } //@@ 00a955e0 FUN_00a955e0 undefined4 FUN_00a955e0(void) { int iVar1; undefined4 uVar2; int in_ECX; int iVar3; if ((((in_ECX == 0) || (iVar1 = *(int *)(in_ECX + 0x1c), iVar1 == 0)) || (*(int *)(in_ECX + 0x20) == 0)) || (*(int *)(in_ECX + 0x24) == 0)) { return 0xfffffffe; } *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *(undefined4 *)(in_ECX + 0x2c) = 2; iVar3 = *(int *)(iVar1 + 0x18); *(undefined4 *)(iVar1 + 0x14) = 0; *(undefined4 *)(iVar1 + 0x10) = *(undefined4 *)(iVar1 + 8); if (iVar3 < 0) { *(undefined4 *)(iVar1 + 0x18) = 0; iVar3 = 0; } uVar2 = 0x2a; if (iVar3 != 0) { uVar2 = 0x71; } *(undefined4 *)(iVar1 + 4) = uVar2; *(undefined4 *)(in_ECX + 0x30) = 1; *(int *)(iVar1 + 0xb10) = iVar1 + 0x8c; *(int *)(iVar1 + 0xb1c) = iVar1 + 0x980; *(int *)(iVar1 + 0xb28) = iVar1 + 0xa74; *(undefined4 *)(iVar1 + 0x20) = 0; *(undefined ***)(iVar1 + 0xb18) = &PTR_DAT_00c5b018; *(undefined ***)(iVar1 + 0xb24) = &PTR_DAT_00c5b02c; *(undefined **)(iVar1 + 0xb30) = &DAT_00c5b040; *(undefined2 *)(iVar1 + 0x16b0) = 0; *(undefined4 *)(iVar1 + 0x16b4) = 0; *(undefined4 *)(iVar1 + 0x16ac) = 8; FUN_00aadf00(); *(int *)(iVar1 + 0x34) = *(int *)(iVar1 + 0x24) * 2; *(undefined2 *)(*(int *)(iVar1 + 0x3c) + -2 + *(int *)(iVar1 + 0x44) * 2) = 0; memset(*(void **)(iVar1 + 0x3c),0,*(int *)(iVar1 + 0x44) * 2 - 2); iVar3 = *(int *)(iVar1 + 0x7c); *(uint *)(iVar1 + 0x78) = (uint)*(ushort *)(&DAT_00b4cd1a + iVar3 * 0xc); *(uint *)(iVar1 + 0x84) = (uint)*(ushort *)(&DAT_00b4cd18 + iVar3 * 0xc); *(uint *)(iVar1 + 0x88) = (uint)*(ushort *)(&DAT_00b4cd1c + iVar3 * 0xc); *(uint *)(iVar1 + 0x74) = (uint)*(ushort *)(&DAT_00b4cd1e + iVar3 * 0xc); *(undefined4 *)(iVar1 + 100) = 0; *(undefined4 *)(iVar1 + 0x54) = 0; *(undefined4 *)(iVar1 + 0x6c) = 0; *(undefined4 *)(iVar1 + 0x70) = 2; *(undefined4 *)(iVar1 + 0x58) = 2; *(undefined4 *)(iVar1 + 0x60) = 0; *(undefined4 *)(iVar1 + 0x40) = 0; return 0; } //@@ 00a95770 FUN_00a95770 void FUN_00a95770(void) { int in_ECX; undefined4 in_EDX; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)((uint)in_EDX >> 8); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(char *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = (char)in_EDX; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; return; } //@@ 00a957a0 FUN_00a957a0 void FUN_00a957a0(void) { int *piVar1; int iVar2; int in_ECX; uint _Size; iVar2 = *(int *)(in_ECX + 0x1c); _Size = *(uint *)(in_ECX + 0x10); if (*(uint *)(iVar2 + 0x14) <= *(uint *)(in_ECX + 0x10)) { _Size = *(size_t *)(iVar2 + 0x14); } if (_Size != 0) { memcpy(*(void **)(in_ECX + 0xc),*(void **)(iVar2 + 0x10),_Size); *(int *)(in_ECX + 0xc) = *(int *)(in_ECX + 0xc) + _Size; piVar1 = (int *)(*(int *)(in_ECX + 0x1c) + 0x10); *piVar1 = *piVar1 + _Size; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + _Size; *(int *)(in_ECX + 0x10) = *(int *)(in_ECX + 0x10) - _Size; piVar1 = (int *)(*(int *)(in_ECX + 0x1c) + 0x14); *piVar1 = *piVar1 - _Size; iVar2 = *(int *)(in_ECX + 0x1c); if (*(int *)(iVar2 + 0x14) == 0) { *(undefined4 *)(iVar2 + 0x10) = *(undefined4 *)(iVar2 + 8); } } return; } //@@ 00a957f0 deflate /* DB: zlib deflate(strm=ECX, flush=EDX): "stream error"/"buffer error", status 0x2a INIT_STATE -> 0x71 BUSY_STATE, 0x29a FINISH_STATE, returns Z_STREAM_ERROR -2 / Z_BUF_ERROR -5; callers include png_write_filtered_row prototype: db/protos.zhl */ int __fastcall deflate(void *stream,int flush) { undefined4 *puVar1; int iVar2; if (((stream == (void *)0x0) || (puVar1 = *(undefined4 **)((int)stream + 0x1c), puVar1 == (undefined4 *)0x0)) || (4 < (uint)flush)) { return -2; } if (((*(int *)((int)stream + 0xc) == 0) || ((*(int *)stream == 0 && (*(int *)((int)stream + 4) != 0)))) || ((puVar1[1] == 0x29a && (flush != 4)))) { *(char **)((int)stream + 0x18) = "stream error"; return -2; } if (*(int *)((int)stream + 0x10) == 0) { LAB_00a959e8: *(char **)((int)stream + 0x18) = "buffer error"; return -5; } iVar2 = puVar1[8]; *puVar1 = stream; puVar1[8] = flush; if (puVar1[1] == 0x2a) { puVar1[1] = 0x71; FUN_00a95770(); if (puVar1[0x19] != 0) { FUN_00a95770(); FUN_00a95770(); } *(undefined4 *)((int)stream + 0x30) = 1; } if (puVar1[5] == 0) { if (((*(int *)((int)stream + 4) == 0) && (flush <= iVar2)) && (flush != 4)) goto LAB_00a959e8; } else { FUN_00a957a0(); if (*(int *)((int)stream + 0x10) == 0) { puVar1[8] = 0xffffffff; return 0; } } if ((puVar1[1] == 0x29a) && (*(int *)((int)stream + 4) != 0)) goto LAB_00a959e8; if ((*(int *)((int)stream + 4) == 0) && (puVar1[0x1b] == 0)) { if (flush == 0) { return 0; } if (puVar1[1] == 0x29a) goto LAB_00a9598a; } iVar2 = (*(code *)(&PTR_deflate_stored_00b4cd20)[puVar1[0x1f] * 3])(puVar1,flush); if ((iVar2 == 2) || (iVar2 == 3)) { puVar1[1] = 0x29a; } if ((iVar2 == 0) || (iVar2 == 2)) { if (*(int *)((int)stream + 0x10) != 0) { return 0; } LAB_00a959d8: puVar1[8] = 0xffffffff; return 0; } if (iVar2 == 1) { FUN_00aaeda0(0,0); FUN_00a957a0(); if (*(int *)((int)stream + 0x10) == 0) goto LAB_00a959d8; } LAB_00a9598a: if (flush != 4) { return 0; } if (puVar1[6] == 0) { FUN_00a95770(); FUN_00a95770(); FUN_00a957a0(); puVar1[6] = 0xffffffff; return (uint)(puVar1[5] == 0); } return 1; } //@@ 00a95a10 FUN_00a95a10 undefined4 FUN_00a95a10(void) { int iVar1; int iVar2; undefined4 uVar3; int in_ECX; if (((in_ECX == 0) || (iVar2 = *(int *)(in_ECX + 0x1c), iVar2 == 0)) || ((iVar1 = *(int *)(iVar2 + 4), iVar1 != 0x2a && ((iVar1 != 0x71 && (iVar1 != 0x29a)))))) { return 0xfffffffe; } if (*(int *)(iVar2 + 8) != 0) { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),*(int *)(iVar2 + 8)); iVar2 = *(int *)(in_ECX + 0x1c); } if (*(int *)(iVar2 + 0x3c) != 0) { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),*(int *)(iVar2 + 0x3c)); iVar2 = *(int *)(in_ECX + 0x1c); } if (*(int *)(iVar2 + 0x38) != 0) { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),*(int *)(iVar2 + 0x38)); iVar2 = *(int *)(in_ECX + 0x1c); } if (*(int *)(iVar2 + 0x30) != 0) { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),*(int *)(iVar2 + 0x30)); iVar2 = *(int *)(in_ECX + 0x1c); } (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),iVar2); *(undefined4 *)(in_ECX + 0x1c) = 0; uVar3 = 0; if (iVar1 == 0x71) { uVar3 = 0xfffffffd; } return uVar3; } //@@ 00a95ac0 FUN_00a95ac0 char * FUN_00a95ac0(void) { char *pcVar1; char *pcVar2; char *pcVar3; char *pcVar4; char *pcVar5; int in_ECX; uint in_EDX; char *pcVar6; char *pcVar7; char *pcVar8; uint local_1c; uint local_c; char local_6; char local_5; pcVar8 = *(char **)(in_ECX + 0x70); pcVar2 = (char *)(*(int *)(in_ECX + 100) + *(int *)(in_ECX + 0x30)); if (*(int *)(in_ECX + 0x24) - 0x106U < *(uint *)(in_ECX + 100)) { local_1c = (*(int *)(in_ECX + 100) - *(int *)(in_ECX + 0x24)) + 0x106; } else { local_1c = 0; } pcVar1 = pcVar2 + 0x102; local_5 = pcVar2[(int)(pcVar8 + -1)]; local_6 = pcVar2[(int)pcVar8]; pcVar5 = *(char **)(in_ECX + 0x6c); local_c = *(uint *)(in_ECX + 0x74) >> 2; if (pcVar8 < *(char **)(in_ECX + 0x84)) { local_c = *(uint *)(in_ECX + 0x74); } pcVar6 = *(char **)(in_ECX + 0x88); if (pcVar5 < *(char **)(in_ECX + 0x88)) { pcVar6 = pcVar5; } do { pcVar7 = (char *)(*(int *)(in_ECX + 0x30) + in_EDX); pcVar4 = pcVar8; if ((((pcVar7[(int)pcVar8] == local_6) && (pcVar7[(int)(pcVar8 + -1)] == local_5)) && (*pcVar7 == *pcVar2)) && (pcVar7[1] == pcVar2[1])) { pcVar7 = pcVar7 + 2; pcVar4 = pcVar2 + 2; while (((((pcVar3 = pcVar4 + 1, pcVar4[1] == pcVar7[1] && (pcVar3 = pcVar4 + 2, pcVar4[2] == pcVar7[2])) && ((pcVar3 = pcVar4 + 3, pcVar4[3] == pcVar7[3] && ((pcVar3 = pcVar4 + 4, pcVar4[4] == pcVar7[4] && (pcVar3 = pcVar4 + 5, pcVar4[5] == pcVar7[5])))))) && (pcVar3 = pcVar4 + 6, pcVar4[6] == pcVar7[6])) && (pcVar3 = pcVar4 + 7, pcVar4[7] == pcVar7[7]))) { pcVar3 = pcVar4 + 8; pcVar7 = pcVar7 + 8; if ((pcVar4[8] != *pcVar7) || (pcVar4 = pcVar3, pcVar1 <= pcVar3)) break; } pcVar4 = pcVar3 + (0x102 - (int)pcVar1); if ((int)pcVar8 < (int)pcVar4) { *(uint *)(in_ECX + 0x68) = in_EDX; if ((int)pcVar6 <= (int)pcVar4) { LAB_00a95c36: if (pcVar4 <= pcVar5) { pcVar5 = pcVar4; } return pcVar5; } local_5 = pcVar2[(int)(pcVar3 + (0x101 - (int)pcVar1))]; local_6 = pcVar2[(int)pcVar4]; } else { pcVar4 = pcVar8; } } in_EDX = (uint)*(ushort *)(*(int *)(in_ECX + 0x38) + (*(uint *)(in_ECX + 0x2c) & in_EDX) * 2); if ((in_EDX <= local_1c) || (local_c = local_c - 1, pcVar8 = pcVar4, local_c == 0)) goto LAB_00a95c36; } while( true ); } //@@ 00a95c50 FUN_00a95c50 void FUN_00a95c50(void) { ushort *puVar1; uint _Size; int *piVar2; int iVar3; void *_Src; short sVar4; int iVar5; int *in_ECX; short *psVar6; int iVar7; uint uVar8; int iVar9; uint uVar10; uint _Size_00; _Size = in_ECX[9]; uVar10 = in_ECX[0x1b]; do { uVar8 = in_ECX[0x19]; _Size_00 = (in_ECX[0xd] - uVar8) - uVar10; if (_Size_00 == 0) { if ((uVar8 == 0) && (uVar10 == 0)) { _Size_00 = _Size; } else { LAB_00a95c8e: if (in_ECX[9] + -0x106 + _Size <= uVar8) { memcpy((void *)in_ECX[0xc],(void *)(in_ECX[0xc] + _Size),_Size); iVar9 = in_ECX[0x11]; in_ECX[0x1a] = in_ECX[0x1a] - _Size; in_ECX[0x19] = in_ECX[0x19] - _Size; in_ECX[0x15] = in_ECX[0x15] - _Size; psVar6 = (short *)(in_ECX[0xf] + iVar9 * 2); do { puVar1 = (ushort *)(psVar6 + -1); psVar6 = psVar6 + -1; sVar4 = *puVar1 - (short)_Size; if (*puVar1 < _Size) { sVar4 = 0; } *psVar6 = sVar4; iVar9 = iVar9 + -1; } while (iVar9 != 0); psVar6 = (short *)(in_ECX[0xe] + _Size * 2); uVar10 = _Size; do { puVar1 = (ushort *)(psVar6 + -1); psVar6 = psVar6 + -1; sVar4 = *puVar1 - (short)_Size; if (*puVar1 < _Size) { sVar4 = 0; } *psVar6 = sVar4; uVar10 = uVar10 - 1; } while (uVar10 != 0); _Size_00 = _Size_00 + _Size; } } } else { if (_Size_00 != 0xffffffff) goto LAB_00a95c8e; _Size_00 = 0xfffffffe; } piVar2 = (int *)*in_ECX; uVar10 = piVar2[1]; if (uVar10 == 0) { return; } iVar9 = in_ECX[0x19]; iVar7 = in_ECX[0x1b]; iVar3 = in_ECX[0xc]; if (uVar10 <= _Size_00) { _Size_00 = uVar10; } if (_Size_00 == 0) { _Size_00 = 0; } else { _Src = (void *)*piVar2; piVar2[1] = uVar10 - _Size_00; if (*(int *)(piVar2[7] + 0x18) == 0) { iVar5 = FUN_00aaddd0(piVar2[0xc],_Src,_Size_00); piVar2[0xc] = iVar5; } memcpy((void *)(iVar9 + iVar7 + iVar3),_Src,_Size_00); *piVar2 = *piVar2 + _Size_00; piVar2[2] = piVar2[2] + _Size_00; iVar7 = in_ECX[0x1b]; } uVar10 = iVar7 + _Size_00; in_ECX[0x1b] = uVar10; if (2 < uVar10) { uVar8 = (uint)*(byte *)(in_ECX[0xc] + in_ECX[0x19]); in_ECX[0x10] = uVar8; in_ECX[0x10] = (uVar8 << ((byte)in_ECX[0x14] & 0x1f) ^ (uint)((byte *)(in_ECX[0xc] + in_ECX[0x19]))[1]) & in_ECX[0x13]; } if (0x105 < uVar10) { return; } if (*(int *)(*in_ECX + 4) == 0) { return; } } while( true ); } //@@ 00a95de0 deflate_stored /* DB: zlib deflate.c (1.2.x) deflate_stored(s, flush): max_block_size = min(0xffff, pending_buf_size-5), fill_window (FUN_00a95c50) when lookahead <= 1, _tr_flush_block (FUN_00aaeeb0) with last = flush==Z_FINISH(4) */ char deflate_stored(int *param_1,int param_2) { int *piVar1; uint uVar2; int iVar3; int iVar4; char cVar5; uint uVar6; uint uVar7; uVar7 = 0xffff; if (param_1[3] - 5U < 0xffff) { uVar7 = param_1[3] - 5U; } do { uVar6 = param_1[0x1b]; if (uVar6 < 2) { FUN_00a95c50(); uVar6 = param_1[0x1b]; if (uVar6 == 0) { if (param_2 == 0) { return '\0'; } _tr_flush_block(param_1[0x19] - param_1[0x15],param_2 == 4); iVar3 = *param_1; param_1[0x15] = param_1[0x19]; iVar4 = *(int *)(iVar3 + 0x1c); uVar7 = *(uint *)(iVar3 + 0x10); if (*(uint *)(iVar4 + 0x14) <= *(uint *)(iVar3 + 0x10)) { uVar7 = *(size_t *)(iVar4 + 0x14); } if (uVar7 != 0) { memcpy(*(void **)(iVar3 + 0xc),*(void **)(iVar4 + 0x10),uVar7); *(int *)(iVar3 + 0xc) = *(int *)(iVar3 + 0xc) + uVar7; piVar1 = (int *)(*(int *)(iVar3 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar7; *(int *)(iVar3 + 0x14) = *(int *)(iVar3 + 0x14) + uVar7; *(int *)(iVar3 + 0x10) = *(int *)(iVar3 + 0x10) - uVar7; piVar1 = (int *)(*(int *)(iVar3 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar7; iVar3 = *(int *)(iVar3 + 0x1c); if (*(int *)(iVar3 + 0x14) == 0) { *(undefined4 *)(iVar3 + 0x10) = *(undefined4 *)(iVar3 + 8); } } if (*(int *)(*param_1 + 0x10) != 0) { return (param_2 == 4) * '\x02' + '\x01'; } cVar5 = '\0'; if (param_2 == 4) { cVar5 = '\x02'; } return cVar5; } } piVar1 = param_1 + 0x19; *piVar1 = *piVar1 + uVar6; uVar2 = param_1[0x19]; param_1[0x1b] = 0; uVar6 = param_1[0x15] + uVar7; if ((*piVar1 == 0) || (uVar6 <= uVar2)) { param_1[0x19] = uVar6; param_1[0x1b] = uVar2 - uVar6; _tr_flush_block(uVar7,0); iVar3 = *param_1; param_1[0x15] = param_1[0x19]; iVar4 = *(int *)(iVar3 + 0x1c); uVar6 = *(uint *)(iVar3 + 0x10); if (*(uint *)(iVar4 + 0x14) <= *(uint *)(iVar3 + 0x10)) { uVar6 = *(size_t *)(iVar4 + 0x14); } if (uVar6 != 0) { memcpy(*(void **)(iVar3 + 0xc),*(void **)(iVar4 + 0x10),uVar6); *(int *)(iVar3 + 0xc) = *(int *)(iVar3 + 0xc) + uVar6; piVar1 = (int *)(*(int *)(iVar3 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar6; *(int *)(iVar3 + 0x14) = *(int *)(iVar3 + 0x14) + uVar6; *(int *)(iVar3 + 0x10) = *(int *)(iVar3 + 0x10) - uVar6; piVar1 = (int *)(*(int *)(iVar3 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar6; iVar3 = *(int *)(iVar3 + 0x1c); if (*(int *)(iVar3 + 0x14) == 0) { *(undefined4 *)(iVar3 + 0x10) = *(undefined4 *)(iVar3 + 8); } } if (*(int *)(*param_1 + 0x10) == 0) { return '\0'; } } if (param_1[9] - 0x106U <= (uint)(param_1[0x19] - param_1[0x15])) { _tr_flush_block(param_1[0x19] - param_1[0x15],0); iVar3 = *param_1; param_1[0x15] = param_1[0x19]; iVar4 = *(int *)(iVar3 + 0x1c); uVar6 = *(uint *)(iVar3 + 0x10); if (*(uint *)(iVar4 + 0x14) <= *(uint *)(iVar3 + 0x10)) { uVar6 = *(size_t *)(iVar4 + 0x14); } if (uVar6 != 0) { memcpy(*(void **)(iVar3 + 0xc),*(void **)(iVar4 + 0x10),uVar6); *(int *)(iVar3 + 0xc) = *(int *)(iVar3 + 0xc) + uVar6; piVar1 = (int *)(*(int *)(iVar3 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar6; *(int *)(iVar3 + 0x14) = *(int *)(iVar3 + 0x14) + uVar6; *(int *)(iVar3 + 0x10) = *(int *)(iVar3 + 0x10) - uVar6; piVar1 = (int *)(*(int *)(iVar3 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar6; iVar3 = *(int *)(iVar3 + 0x1c); if (*(int *)(iVar3 + 0x14) == 0) { *(undefined4 *)(iVar3 + 0x10) = *(undefined4 *)(iVar3 + 8); } } if (*(int *)(*param_1 + 0x10) == 0) { return '\0'; } } } while( true ); } //@@ 00a96000 deflate_fast /* DB: zlib deflate.c: twin of deflate_slow (00a96370) without match_available: lookahead < 0x106 -> fill_window, FLUSH_BLOCK via _tr_flush_block (00aaeeb0) + flush_pending; no direct callers (configuration_table) */ char deflate_fast(int *param_1,int param_2) { int *piVar1; int iVar2; int *piVar3; char cVar4; short sVar5; int iVar6; ushort uVar7; uint uVar8; byte bVar9; bool bVar10; piVar3 = param_1; param_1 = (int *)0x0; do { uVar8 = piVar3[0x1b]; if (uVar8 < 0x106) { FUN_00a95c50(); uVar8 = piVar3[0x1b]; if ((uVar8 < 0x106) && (param_2 == 0)) { return '\0'; } if (uVar8 == 0) { _tr_flush_block(piVar3[0x19] - piVar3[0x15],param_2 == 4); iVar6 = *piVar3; piVar3[0x15] = piVar3[0x19]; iVar2 = *(int *)(iVar6 + 0x1c); uVar8 = *(uint *)(iVar6 + 0x10); if (*(uint *)(iVar2 + 0x14) <= *(uint *)(iVar6 + 0x10)) { uVar8 = *(size_t *)(iVar2 + 0x14); } if (uVar8 != 0) { memcpy(*(void **)(iVar6 + 0xc),*(void **)(iVar2 + 0x10),uVar8); *(int *)(iVar6 + 0xc) = *(int *)(iVar6 + 0xc) + uVar8; piVar1 = (int *)(*(int *)(iVar6 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar8; *(int *)(iVar6 + 0x14) = *(int *)(iVar6 + 0x14) + uVar8; *(int *)(iVar6 + 0x10) = *(int *)(iVar6 + 0x10) - uVar8; piVar1 = (int *)(*(int *)(iVar6 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar8; iVar6 = *(int *)(iVar6 + 0x1c); if (*(int *)(iVar6 + 0x14) == 0) { *(undefined4 *)(iVar6 + 0x10) = *(undefined4 *)(iVar6 + 8); } } if (*(int *)(*piVar3 + 0x10) != 0) { return (param_2 == 4) * '\x02' + '\x01'; } cVar4 = '\0'; if (param_2 == 4) { cVar4 = '\x02'; } return cVar4; } } if (2 < uVar8) { uVar8 = (piVar3[0x10] << ((byte)piVar3[0x14] & 0x1f) ^ (uint)*(byte *)(piVar3[0x19] + 2U + piVar3[0xc])) & piVar3[0x13]; piVar3[0x10] = uVar8; uVar7 = *(ushort *)(piVar3[0xf] + uVar8 * 2); param_1 = (int *)(uint)uVar7; *(ushort *)(piVar3[0xe] + (piVar3[0xb] & piVar3[0x19]) * 2) = uVar7; *(short *)(piVar3[0xf] + piVar3[0x10] * 2) = (short)piVar3[0x19]; } if (((param_1 != (int *)0x0) && ((uint)(piVar3[0x19] - (int)param_1) <= piVar3[9] - 0x106U)) && (piVar3[0x20] != 2)) { iVar6 = FUN_00a95ac0(); piVar3[0x16] = iVar6; } if ((uint)piVar3[0x16] < 3) { bVar9 = *(byte *)(piVar3[0xc] + piVar3[0x19]); *(undefined2 *)(piVar3[0x5a7] + piVar3[0x5a6] * 2) = 0; *(byte *)(piVar3[0x5a6] + piVar3[0x5a4]) = bVar9; piVar3[0x5a6] = piVar3[0x5a6] + 1; *(short *)(piVar3 + bVar9 + 0x23) = (short)piVar3[bVar9 + 0x23] + 1; bVar10 = piVar3[0x5a6] == piVar3[0x5a5] + -1; piVar3[0x1b] = piVar3[0x1b] + -1; LAB_00a96225: piVar3[0x19] = piVar3[0x19] + 1; iVar6 = piVar3[0x19]; } else { bVar9 = (char)piVar3[0x16] - 3; sVar5 = (short)piVar3[0x19] - (short)piVar3[0x1a]; *(short *)(piVar3[0x5a7] + piVar3[0x5a6] * 2) = sVar5; uVar7 = sVar5 - 1; *(byte *)(piVar3[0x5a6] + piVar3[0x5a4]) = bVar9; piVar3[0x5a6] = piVar3[0x5a6] + 1; *(short *)(piVar3 + (byte)(&DAT_00b4fa00)[bVar9] + 0x124) = (short)piVar3[(byte)(&DAT_00b4fa00)[bVar9] + 0x124] + 1; if (uVar7 < 0x100) { bVar9 = (&DAT_00b4fb00)[uVar7]; } else { bVar9 = (&DAT_00b4fc00)[uVar7 >> 7]; } *(short *)(piVar3 + bVar9 + 0x260) = (short)piVar3[bVar9 + 0x260] + 1; uVar8 = piVar3[0x16]; bVar10 = piVar3[0x5a6] == piVar3[0x5a5] + -1; iVar6 = piVar3[0x1b]; piVar3[0x1b] = iVar6 - uVar8; if ((uVar8 <= (uint)piVar3[0x1e]) && (2 < iVar6 - uVar8)) { piVar3[0x16] = uVar8 - 1; do { piVar3[0x19] = piVar3[0x19] + 1; uVar8 = ((uint)*(byte *)(piVar3[0x19] + 2U + piVar3[0xc]) ^ piVar3[0x10] << ((byte)piVar3[0x14] & 0x1f)) & piVar3[0x13]; piVar3[0x10] = uVar8; uVar7 = *(ushort *)(piVar3[0xf] + uVar8 * 2); param_1 = (int *)(uint)uVar7; *(ushort *)(piVar3[0xe] + (piVar3[0x19] & piVar3[0xb]) * 2) = uVar7; *(short *)(piVar3[0xf] + piVar3[0x10] * 2) = (short)piVar3[0x19]; piVar1 = piVar3 + 0x16; *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); goto LAB_00a96225; } iVar6 = piVar3[0x19] + uVar8; piVar3[0x19] = iVar6; piVar3[0x16] = 0; uVar8 = (uint)*(byte *)(piVar3[0xc] + iVar6); piVar3[0x10] = uVar8; piVar3[0x10] = (uVar8 << ((byte)piVar3[0x14] & 0x1f) ^ (uint)*(byte *)(piVar3[0xc] + 1 + iVar6)) & piVar3[0x13]; } if (bVar10) { _tr_flush_block(iVar6 - piVar3[0x15],0); iVar6 = *piVar3; piVar3[0x15] = piVar3[0x19]; iVar2 = *(int *)(iVar6 + 0x1c); uVar8 = *(uint *)(iVar6 + 0x10); if (*(uint *)(iVar2 + 0x14) <= *(uint *)(iVar6 + 0x10)) { uVar8 = *(size_t *)(iVar2 + 0x14); } if (uVar8 != 0) { memcpy(*(void **)(iVar6 + 0xc),*(void **)(iVar2 + 0x10),uVar8); *(int *)(iVar6 + 0xc) = *(int *)(iVar6 + 0xc) + uVar8; piVar1 = (int *)(*(int *)(iVar6 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar8; *(int *)(iVar6 + 0x14) = *(int *)(iVar6 + 0x14) + uVar8; *(int *)(iVar6 + 0x10) = *(int *)(iVar6 + 0x10) - uVar8; piVar1 = (int *)(*(int *)(iVar6 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar8; iVar6 = *(int *)(iVar6 + 0x1c); if (*(int *)(iVar6 + 0x14) == 0) { *(undefined4 *)(iVar6 + 0x10) = *(undefined4 *)(iVar6 + 8); } } if (*(int *)(*piVar3 + 0x10) == 0) { return '\0'; } } } while( true ); } //@@ 00a96370 deflate_slow /* DB: zlib deflate.c: lookahead < MIN_LOOKAHEAD 0x106 -> fill_window (00a95c50), match_available (+0x60) emits the last literal via sym_buf/dyn_ltree freq++, FLUSH_BLOCK via _tr_flush_block (00aaeeb0) + flush_pending memcpy into strm; no direct callers (configuration_table function pointer) */ char deflate_slow(int *param_1,int param_2) { int *piVar1; int iVar2; int iVar3; int iVar4; int iVar5; char cVar6; short sVar7; ushort uVar8; uint uVar9; byte bVar10; uint uVar11; uint local_8; local_8 = 0; do { uVar9 = param_1[0x1b]; if (uVar9 < 0x106) { FUN_00a95c50(); uVar9 = param_1[0x1b]; if ((uVar9 < 0x106) && (param_2 == 0)) { return '\0'; } if (uVar9 == 0) { if (param_1[0x18] != 0) { bVar10 = *(byte *)(param_1[0x19] + -1 + param_1[0xc]); *(undefined2 *)(param_1[0x5a7] + param_1[0x5a6] * 2) = 0; *(byte *)(param_1[0x5a4] + param_1[0x5a6]) = bVar10; param_1[0x5a6] = param_1[0x5a6] + 1; *(short *)(param_1 + bVar10 + 0x23) = (short)param_1[bVar10 + 0x23] + 1; param_1[0x18] = 0; } _tr_flush_block(param_1[0x19] - param_1[0x15],param_2 == 4); iVar2 = *param_1; param_1[0x15] = param_1[0x19]; iVar3 = *(int *)(iVar2 + 0x1c); uVar9 = *(uint *)(iVar2 + 0x10); if (*(uint *)(iVar3 + 0x14) <= *(uint *)(iVar2 + 0x10)) { uVar9 = *(size_t *)(iVar3 + 0x14); } if (uVar9 != 0) { memcpy(*(void **)(iVar2 + 0xc),*(void **)(iVar3 + 0x10),uVar9); *(int *)(iVar2 + 0xc) = *(int *)(iVar2 + 0xc) + uVar9; piVar1 = (int *)(*(int *)(iVar2 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar9; *(int *)(iVar2 + 0x14) = *(int *)(iVar2 + 0x14) + uVar9; *(int *)(iVar2 + 0x10) = *(int *)(iVar2 + 0x10) - uVar9; piVar1 = (int *)(*(int *)(iVar2 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar9; iVar2 = *(int *)(iVar2 + 0x1c); if (*(int *)(iVar2 + 0x14) == 0) { *(undefined4 *)(iVar2 + 0x10) = *(undefined4 *)(iVar2 + 8); } } if (*(int *)(*param_1 + 0x10) != 0) { return (param_2 == 4) * '\x02' + '\x01'; } cVar6 = '\0'; if (param_2 == 4) { cVar6 = '\x02'; } return cVar6; } } if (2 < uVar9) { uVar9 = (param_1[0x10] << ((byte)param_1[0x14] & 0x1f) ^ (uint)*(byte *)(param_1[0xc] + 2 + param_1[0x19])) & param_1[0x13]; param_1[0x10] = uVar9; uVar8 = *(ushort *)(param_1[0xf] + uVar9 * 2); local_8 = (uint)uVar8; *(ushort *)(param_1[0xe] + (param_1[0xb] & param_1[0x19]) * 2) = uVar8; *(short *)(param_1[0xf] + param_1[0x10] * 2) = (short)param_1[0x19]; } uVar11 = 2; uVar9 = param_1[0x16]; param_1[0x17] = param_1[0x1a]; param_1[0x1c] = uVar9; param_1[0x16] = 2; if (((local_8 != 0) && (uVar9 < (uint)param_1[0x1e])) && (param_1[0x19] - local_8 <= param_1[9] - 0x106U)) { uVar11 = 2; if (param_1[0x20] != 2) { uVar11 = FUN_00a95ac0(); uVar9 = param_1[0x1c]; param_1[0x16] = uVar11; } if ((uVar11 < 6) && ((param_1[0x20] == 1 || ((uVar11 == 3 && (0x1000 < (uint)(param_1[0x19] - param_1[0x1a])))) ))) { param_1[0x16] = 2; uVar11 = 2; } } if ((uVar9 < 3) || (uVar9 < uVar11)) { if (param_1[0x18] == 0) { param_1[0x19] = param_1[0x19] + 1; param_1[0x1b] = param_1[0x1b] + -1; param_1[0x18] = 1; } else { bVar10 = *(byte *)(param_1[0xc] + -1 + param_1[0x19]); *(undefined2 *)(param_1[0x5a7] + param_1[0x5a6] * 2) = 0; *(byte *)(param_1[0x5a4] + param_1[0x5a6]) = bVar10; param_1[0x5a6] = param_1[0x5a6] + 1; *(short *)(param_1 + bVar10 + 0x23) = (short)param_1[bVar10 + 0x23] + 1; if (param_1[0x5a6] == param_1[0x5a5] + -1) { _tr_flush_block(param_1[0x19] - param_1[0x15],0); iVar2 = *param_1; param_1[0x15] = param_1[0x19]; iVar3 = *(int *)(iVar2 + 0x1c); uVar9 = *(uint *)(iVar2 + 0x10); if (*(uint *)(iVar3 + 0x14) <= *(uint *)(iVar2 + 0x10)) { uVar9 = *(size_t *)(iVar3 + 0x14); } if (uVar9 != 0) { memcpy(*(void **)(iVar2 + 0xc),*(void **)(iVar3 + 0x10),uVar9); *(int *)(iVar2 + 0xc) = *(int *)(iVar2 + 0xc) + uVar9; piVar1 = (int *)(*(int *)(iVar2 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar9; *(int *)(iVar2 + 0x14) = *(int *)(iVar2 + 0x14) + uVar9; *(int *)(iVar2 + 0x10) = *(int *)(iVar2 + 0x10) - uVar9; piVar1 = (int *)(*(int *)(iVar2 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar9; iVar2 = *(int *)(iVar2 + 0x1c); if (*(int *)(iVar2 + 0x14) == 0) { *(undefined4 *)(iVar2 + 0x10) = *(undefined4 *)(iVar2 + 8); } } } param_1[0x19] = param_1[0x19] + 1; param_1[0x1b] = param_1[0x1b] + -1; if (*(int *)(*param_1 + 0x10) == 0) { return '\0'; } } } else { iVar2 = param_1[0x1b]; bVar10 = (char)uVar9 - 3; iVar3 = param_1[0x19]; sVar7 = (short)iVar3 - (short)param_1[0x17]; *(short *)(param_1[0x5a7] + param_1[0x5a6] * 2) = sVar7 + -1; uVar8 = sVar7 - 2; *(byte *)(param_1[0x5a4] + param_1[0x5a6]) = bVar10; param_1[0x5a6] = param_1[0x5a6] + 1; *(short *)(param_1 + (byte)(&DAT_00b4fa00)[bVar10] + 0x124) = (short)param_1[(byte)(&DAT_00b4fa00)[bVar10] + 0x124] + 1; if (uVar8 < 0x100) { bVar10 = (&DAT_00b4fb00)[uVar8]; } else { bVar10 = (&DAT_00b4fc00)[uVar8 >> 7]; } *(short *)(param_1 + bVar10 + 0x260) = (short)param_1[bVar10 + 0x260] + 1; iVar4 = param_1[0x5a5]; iVar5 = param_1[0x5a6]; param_1[0x1b] = param_1[0x1b] + (1 - param_1[0x1c]); param_1[0x1c] = param_1[0x1c] + -2; do { uVar9 = param_1[0x19] + 1; param_1[0x19] = uVar9; if (uVar9 <= (uint)(iVar2 + -3 + iVar3)) { uVar11 = (param_1[0x10] << ((byte)param_1[0x14] & 0x1f) ^ (uint)*(byte *)(param_1[0xc] + 2 + uVar9)) & param_1[0x13]; param_1[0x10] = uVar11; uVar8 = *(ushort *)(param_1[0xf] + uVar11 * 2); local_8 = (uint)uVar8; *(ushort *)(param_1[0xe] + (param_1[0xb] & uVar9) * 2) = uVar8; *(short *)(param_1[0xf] + param_1[0x10] * 2) = (short)param_1[0x19]; uVar9 = param_1[0x19]; } piVar1 = param_1 + 0x1c; *piVar1 = *piVar1 + -1; } while (*piVar1 != 0); param_1[0x18] = 0; param_1[0x16] = 2; param_1[0x19] = uVar9 + 1; if (iVar5 == iVar4 + -1) { _tr_flush_block((uVar9 + 1) - param_1[0x15],0); iVar2 = *param_1; param_1[0x15] = param_1[0x19]; iVar3 = *(int *)(iVar2 + 0x1c); uVar9 = *(uint *)(iVar2 + 0x10); if (*(uint *)(iVar3 + 0x14) <= *(uint *)(iVar2 + 0x10)) { uVar9 = *(size_t *)(iVar3 + 0x14); } if (uVar9 != 0) { memcpy(*(void **)(iVar2 + 0xc),*(void **)(iVar3 + 0x10),uVar9); *(int *)(iVar2 + 0xc) = *(int *)(iVar2 + 0xc) + uVar9; piVar1 = (int *)(*(int *)(iVar2 + 0x1c) + 0x10); *piVar1 = *piVar1 + uVar9; *(int *)(iVar2 + 0x14) = *(int *)(iVar2 + 0x14) + uVar9; *(int *)(iVar2 + 0x10) = *(int *)(iVar2 + 0x10) - uVar9; piVar1 = (int *)(*(int *)(iVar2 + 0x1c) + 0x14); *piVar1 = *piVar1 - uVar9; iVar2 = *(int *)(iVar2 + 0x1c); if (*(int *)(iVar2 + 0x14) == 0) { *(undefined4 *)(iVar2 + 0x10) = *(undefined4 *)(iVar2 + 8); } } if (*(int *)(*param_1 + 0x10) == 0) { return '\0'; } } } } while( true ); } //@@ 00a96800 FUN_00a96800 /* WARNING: Removing unreachable block (ram,0x00a96922) */ void * FUN_00a96800(void) { void *_Dst; int iVar1; void *pvVar2; undefined4 uVar3; undefined4 extraout_ECX; _Dst = malloc(0x20c); if (_Dst != (void *)0x0) { memset(_Dst,0,0x20c); iVar1 = setjmp3(_Dst,0); if (iVar1 == 0) { *(undefined4 *)((int)_Dst + 0x48) = 0; *(undefined4 *)((int)_Dst + 0x40) = 0; *(undefined4 *)((int)_Dst + 0x44) = 0; *(undefined4 *)((int)_Dst + 0xa8) = 0x2000; pvVar2 = malloc(0x2000); if (pvVar2 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(void **)((int)_Dst + 0xa4) = pvVar2; *(code **)((int)_Dst + 0x8c) = FUN_00a62f10; *(code **)((int)_Dst + 0x90) = FUN_00a62f90; *(void **)((int)_Dst + 0x94) = _Dst; uVar3 = FUN_00aaf7e0(); switch(uVar3) { case 0: *(undefined4 *)((int)_Dst + 0x78) = *(undefined4 *)((int)_Dst + 0xa4); *(undefined4 *)((int)_Dst + 0x7c) = *(undefined4 *)((int)_Dst + 0xa8); FUN_00aafdb0(extraout_ECX); return _Dst; case 0xfffffffa: /* WARNING: Subroutine does not return */ FUN_00a64610(); default: /* WARNING: Subroutine does not return */ FUN_00a64610(); case 0xfffffffc: case 0xfffffffe: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } if (*(void **)((int)_Dst + 0xa4) != (void *)0x0) { free(*(void **)((int)_Dst + 0xa4)); } free(_Dst); } return (void *)0x0; } //@@ 00a96980 png_read_info /* DB: libpng: signature check ("Not a PNG file", "PNG file corrupted by ASCII conversion"), chunk loop with "Missing IHDR before IDAT"/"Missing PLTE before IDAT", dispatches png_handle_* (00ab0xxx..00ab2xxx incl. png_handle_pCAL 00ab1bc0); caller image loader 00a64a50 ImagePng::load void png_read_info(void) { byte bVar1; int iVar2; int iVar3; code *pcVar4; void *in_ECX; uint uVar5; byte *pbVar6; uint local_10; bVar1 = *(byte *)((int)in_ECX + 0x124); if (bVar1 < 8) { iVar3 = -(uint)bVar1; local_10 = iVar3 + 8; if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) goto LAB_00a96c8d; (**(code **)((int)in_ECX + 0x50))(); *(undefined1 *)((int)in_ECX + 0x124) = 8; iVar2 = FUN_00a62e70(local_10); if (iVar2 != 0) { if ((bVar1 < 4) && (iVar3 = FUN_00a62e70(iVar3 + 4), iVar3 != 0)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } /* WARNING: Subroutine does not return */ FUN_00a64610(); } } pcVar4 = *(code **)((int)in_ECX + 0x50); if (pcVar4 != (code *)0x0) { do { pbVar6 = (byte *)((int)in_ECX + 0x114); (*pcVar4)(); *(undefined4 *)((int)in_ECX + 0x108) = 0; iVar3 = (((local_10 & 0xff) * 0x100 + (local_10 >> 8 & 0xff)) * 0x100 + (local_10 >> 0x10 & 0xff)) * 0x100 + (local_10 >> 0x18); if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) break; (**(code **)((int)in_ECX + 0x50))(); if ((*pbVar6 & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a96a8b; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a96a8b: if (pbVar6 == (byte *)0x0) { uVar5 = 0; } else { iVar2 = 4; uVar5 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar6; pbVar6 = pbVar6 + 1; uVar5 = uVar5 >> 8 ^ *(uint *)(((bVar1 ^ uVar5) & 0xff) * 4 + 0xb4e460); iVar2 = iVar2 + -1; } while (iVar2 != 0); uVar5 = ~uVar5; } *(uint *)((int)in_ECX + 0x108) = uVar5; } iVar2 = *(int *)((int)in_ECX + 0x114); if (iVar2 == DAT_00c129a0) { png_handle_IHDR(iVar3); } else if (iVar2 == s_PLTE_00c12987._1_4_) { FUN_00ab0330(iVar3); } else if (iVar2 == DAT_00c12990) { FUN_00ab04d0(iVar3); } else { if (iVar2 == DAT_00c12998) { uVar5 = *(uint *)((int)in_ECX + 0x60); if ((uVar5 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((*(char *)((int)in_ECX + 0x11e) == '\x03') && ((uVar5 & 2) == 0)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(int *)((int)in_ECX + 0x104) = iVar3; *(uint *)((int)in_ECX + 0x60) = uVar5 | 4; return; } if (iVar2 == DAT_00c12958) { FUN_00ab1540(); } else if (iVar2 == DAT_00c12950) { png_handle_cHRM(in_ECX); } else if (iVar2 == DAT_00c12948) { FUN_00ab0540(); } else if (iVar2 == DAT_00c12940) { FUN_00ab1740(); } else if (iVar2 == DAT_00c12978) { FUN_00ab1a50(); } else if (iVar2 == DAT_00c12970) { png_handle_pCAL(); } else if (iVar2 == DAT_00c12968) { FUN_00ab18e0(); } else if (iVar2 == DAT_00c12960) { FUN_00ab06d0(); } else if (iVar2 == DAT_00c129c0) { png_handle_sRGB(); } else if (iVar2 == DAT_00c129b8) { FUN_00ab2040(); } else if (iVar2 == DAT_00c129b0) { FUN_00ab1ef0(); } else if (iVar2 == DAT_00c129a8) { png_handle_tRNS(); } else if (iVar2 == DAT_00c129c8) { png_handle_zTXt(); } else { FUN_00ab2580(iVar3); } } pcVar4 = *(code **)((int)in_ECX + 0x50); } while (pcVar4 != (code *)0x0); } LAB_00a96c8d: /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00a96cc0 png_read_row /* DB: libpng: "Invalid attempt to read row data", "Not enough image data", "Extra compressed data"; calls png_read_filter_row, png_do_read_interlace, png_read_finish_row */ void png_read_row(void) { byte *pbVar1; byte bVar2; uint uVar3; void *in_ECX; uint length; void *in_EDX; byte *pbVar4; int iVar5; uint local_8; if ((*(byte *)((int)in_ECX + 100) & 0x40) == 0) { png_read_start_row(); } if ((*(char *)((int)in_ECX + 0x11b) != '\0') && ((*(byte *)((int)in_ECX + 0x68) & 2) != 0)) { switch(*(undefined1 *)((int)in_ECX + 0x11c)) { case 0: if ((*(byte *)((int)in_ECX + 0xdc) & 7) != 0) { LAB_00a96db4: png_read_finish_row(); return; } break; case 1: if ((*(byte *)((int)in_ECX + 0xdc) & 7) != 0) goto LAB_00a96db4; if (*(uint *)((int)in_ECX + 0xc0) < 5) { png_read_finish_row(); return; } break; case 2: if (((byte)*(undefined4 *)((int)in_ECX + 0xdc) & 7) != 4) { png_read_finish_row(); return; } break; case 3: if ((*(byte *)((int)in_ECX + 0xdc) & 3) != 0) goto LAB_00a96db4; if (*(uint *)((int)in_ECX + 0xc0) < 3) { png_read_finish_row(); return; } break; case 4: if (((byte)*(undefined4 *)((int)in_ECX + 0xdc) & 3) != 2) { png_read_finish_row(); return; } break; case 5: if ((*(byte *)((int)in_ECX + 0xdc) & 1) != 0) goto LAB_00a96db4; if (*(uint *)((int)in_ECX + 0xc0) < 2) { png_read_finish_row(); return; } break; case 6: if ((*(byte *)((int)in_ECX + 0xdc) & 1) == 0) goto LAB_00a96db4; } } if ((*(byte *)((int)in_ECX + 0x60) & 4) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xe4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xd4); do { if (*(int *)((int)in_ECX + 0x70) == 0) { uVar3 = *(uint *)((int)in_ECX + 0x104); if (uVar3 == 0) { pbVar1 = (byte *)((int)in_ECX + 0x114); do { png_crc_finish(in_ECX,0); if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) { LAB_00a970be: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x50))(); *(undefined4 *)((int)in_ECX + 0x108) = 0; *(uint *)((int)in_ECX + 0x104) = (((local_8 & 0xff) * 0x100 + (local_8 >> 8 & 0xff)) * 0x100 + (local_8 >> 0x10 & 0xff)) * 0x100 + (local_8 >> 0x18); if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) goto LAB_00a970be; (**(code **)((int)in_ECX + 0x50))(); if ((*pbVar1 & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a96e81; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a96e81: iVar5 = 4; uVar3 = ~*(uint *)((int)in_ECX + 0x108); pbVar4 = pbVar1; do { bVar2 = *pbVar4; pbVar4 = pbVar4 + 1; uVar3 = uVar3 >> 8 ^ *(uint *)(((bVar2 ^ uVar3) & 0xff) * 4 + 0xb4e460); iVar5 = iVar5 + -1; } while (iVar5 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar3; } if (*(int *)pbVar1 != DAT_00c12998) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } uVar3 = *(uint *)((int)in_ECX + 0x104); } while (uVar3 == 0); } length = *(uint *)((int)in_ECX + 0xa8); *(uint *)((int)in_ECX + 0x70) = length; *(byte **)((int)in_ECX + 0x6c) = *(byte **)((int)in_ECX + 0xa4); if (uVar3 < length) { *(uint *)((int)in_ECX + 0x70) = uVar3; length = uVar3; } png_crc_read(in_ECX,*(byte **)((int)in_ECX + 0xa4),length); *(int *)((int)in_ECX + 0x104) = *(int *)((int)in_ECX + 0x104) - *(int *)((int)in_ECX + 0x70); } iVar5 = inflate((void *)((int)in_ECX + 0x6c)); if (iVar5 == 1) { if (((*(int *)((int)in_ECX + 0x7c) != 0) || (*(int *)((int)in_ECX + 0x70) != 0)) || (*(int *)((int)in_ECX + 0x104) != 0)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 8; *(uint *)((int)in_ECX + 100) = *(uint *)((int)in_ECX + 100) | 0x20; goto LAB_00a96f48; } if (iVar5 != 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (*(int *)((int)in_ECX + 0x7c) == 0) { LAB_00a96f48: *(undefined1 *)((int)in_ECX + 0x100) = *(undefined1 *)((int)in_ECX + 0x11e); *(undefined1 *)((int)in_ECX + 0x102) = *(undefined1 *)((int)in_ECX + 0x122); *(undefined1 *)((int)in_ECX + 0x101) = *(undefined1 *)((int)in_ECX + 0x11f); *(byte *)((int)in_ECX + 0x103) = *(byte *)((int)in_ECX + 0x121); *(int *)((int)in_ECX + 0xf8) = *(int *)((int)in_ECX + 0xd8); *(uint *)((int)in_ECX + 0xfc) = (uint)*(byte *)((int)in_ECX + 0x121) * *(int *)((int)in_ECX + 0xd8) + 7 >> 3; png_read_filter_row(*(undefined1 **)((int)in_ECX + 0xe4) + 1,*(int *)((int)in_ECX + 0xe0) + 1, **(undefined1 **)((int)in_ECX + 0xe4)); memcpy(*(void **)((int)in_ECX + 0xe0),*(void **)((int)in_ECX + 0xe4), *(int *)((int)in_ECX + 0xd0) + 1); if (*(int *)((int)in_ECX + 0x68) != 0) { png_do_read_transformations(); } if ((*(char *)((int)in_ECX + 0x11b) == '\0') || ((*(uint *)((int)in_ECX + 0x68) & 2) == 0)) { if (in_EDX != (void *)0x0) { memcpy(in_EDX,(void *)(*(int *)((int)in_ECX + 0xe4) + 1), (uint)*(byte *)((int)in_ECX + 0x103) * *(int *)((int)in_ECX + 0xc0) + 7 >> 3); } } else { if (*(byte *)((int)in_ECX + 0x11c) < 6) { png_do_read_interlace(*(byte *)((int)in_ECX + 0x11c),*(uint *)((int)in_ECX + 0x68)); } if (in_EDX != (void *)0x0) { png_combine_row(*(undefined4 *)(&DAT_00b3db28 + (uint)*(byte *)((int)in_ECX + 0x11c) * 4)) ; } } png_read_finish_row(); if (*(code **)((int)in_ECX + 400) == (code *)0x0) { return; } (**(code **)((int)in_ECX + 400))(); return; } } while( true ); } //@@ 00a97100 png_read_end /* DB: libpng pngread.c: called by image_load_png after rows (0xa65015); png_crc_finish, chunk loop dispatching png_handle_* (cHRM 0xab0830, zTXt 0xab2140 ...), 'Too many IDAT's found' */ void png_read_end(void) { byte bVar1; void *in_ECX; uint uVar2; byte *pbVar3; int iVar4; int iVar5; uint local_10; png_crc_finish(in_ECX,0); do { if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) { LAB_00a97378: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x50))(); pbVar3 = (byte *)((int)in_ECX + 0x114); *(undefined4 *)((int)in_ECX + 0x108) = 0; iVar5 = (((local_10 & 0xff) * 0x100 + (local_10 >> 8 & 0xff)) * 0x100 + (local_10 >> 0x10 & 0xff)) * 0x100 + (local_10 >> 0x18); if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) goto LAB_00a97378; (**(code **)((int)in_ECX + 0x50))(); if ((*pbVar3 & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00a9719c; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00a9719c: if (pbVar3 == (byte *)0x0) { uVar2 = 0; } else { iVar4 = 4; uVar2 = ~*(uint *)((int)in_ECX + 0x108); do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; uVar2 = uVar2 >> 8 ^ *(uint *)(((bVar1 ^ uVar2) & 0xff) * 4 + 0xb4e460); iVar4 = iVar4 + -1; } while (iVar4 != 0); uVar2 = ~uVar2; } *(uint *)((int)in_ECX + 0x108) = uVar2; } iVar4 = *(int *)((int)in_ECX + 0x114); if (iVar4 == DAT_00c129a0) { png_handle_IHDR(iVar5); } else if (iVar4 == DAT_00c12998) { if ((iVar5 != 0) || ((*(byte *)((int)in_ECX + 0x60) & 8) != 0)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } png_crc_finish(in_ECX,0); } else if (iVar4 == s_PLTE_00c12987._1_4_) { FUN_00ab0330(); } else if (iVar4 == DAT_00c12990) { FUN_00ab04d0(); } else if (iVar4 == DAT_00c12958) { FUN_00ab1540(); } else if (iVar4 == DAT_00c12950) { png_handle_cHRM(in_ECX); } else if (iVar4 == DAT_00c12948) { FUN_00ab0540(); } else if (iVar4 == DAT_00c12940) { FUN_00ab1740(); } else if (iVar4 == DAT_00c12978) { FUN_00ab1a50(); } else if (iVar4 == DAT_00c12970) { png_handle_pCAL(); } else if (iVar4 == DAT_00c12968) { FUN_00ab18e0(); } else if (iVar4 == DAT_00c12960) { FUN_00ab06d0(); } else if (iVar4 == DAT_00c129c0) { png_handle_sRGB(); } else if (iVar4 == DAT_00c129b8) { FUN_00ab2040(); } else if (iVar4 == DAT_00c129b0) { FUN_00ab1ef0(); } else if (iVar4 == DAT_00c129a8) { png_handle_tRNS(); } else if (iVar4 == DAT_00c129c8) { png_handle_zTXt(); } else { FUN_00ab2580(iVar5); } if ((*(byte *)((int)in_ECX + 0x60) & 0x10) != 0) { return; } } while( true ); } //@@ 00a973a0 png_destroy_read_struct /* DB: libpng (round 7 agent) */ void png_destroy_read_struct(undefined4 *param_1) { undefined4 *in_ECX; undefined4 *in_EDX; void *_Memory; void *_Memory_00; void *local_8; local_8 = (void *)0x0; _Memory_00 = (void *)0x0; _Memory = (void *)0x0; if (in_ECX != (undefined4 *)0x0) { _Memory_00 = (void *)*in_ECX; } if (in_EDX != (undefined4 *)0x0) { local_8 = (void *)*in_EDX; } if (param_1 != (undefined4 *)0x0) { _Memory = (void *)*param_1; } png_read_destroy(_Memory); if (local_8 != (void *)0x0) { if ((_Memory_00 != (void *)0x0) && (*(void **)((int)local_8 + 0x38) != (void *)0x0)) { free(*(void **)((int)local_8 + 0x38)); } free(local_8); *in_EDX = 0; } if (_Memory != (void *)0x0) { if ((_Memory_00 != (void *)0x0) && (*(void **)((int)_Memory + 0x38) != (void *)0x0)) { free(*(void **)((int)_Memory + 0x38)); } free(_Memory); *param_1 = 0; } if (_Memory_00 != (void *)0x0) { free(_Memory_00); *in_ECX = 0; } return; } //@@ 00a97450 png_read_destroy /* DB: libpng 1.2 pngread.c: png_info_destroy(info_ptr), png_info_destroy(end_info), frees zbuf/big_row_buf/prev_row/palette/trans/hist/gamma tables by free_me flags; called from png_destroy_read_struct (FUN_00a973a0) and the inlined copy in FUN_00a64a50 */ void png_read_destroy(void *param_1) { void *pvVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; undefined4 uVar9; undefined4 uVar10; undefined4 uVar11; undefined4 uVar12; undefined4 uVar13; undefined4 uVar14; undefined4 uVar15; undefined4 uVar16; undefined4 uVar17; undefined4 uVar18; undefined4 uVar19; undefined4 uVar20; uint uVar21; void *pvVar22; undefined4 *in_ECX; void *in_EDX; int iVar23; void *pvVar24; int iVar25; if (in_EDX != (void *)0x0) { png_info_destroy(in_ECX,in_EDX); } if (param_1 != (void *)0x0) { png_info_destroy(in_ECX,param_1); } if (in_ECX != (undefined4 *)0x0) { if ((void *)in_ECX[0x29] != (void *)0x0) { free((void *)in_ECX[0x29]); } if ((void *)in_ECX[0x39] != (void *)0x0) { free((void *)in_ECX[0x39]); } if ((void *)in_ECX[0x38] != (void *)0x0) { free((void *)in_ECX[0x38]); } if ((void *)in_ECX[0x79] != (void *)0x0) { free((void *)in_ECX[0x79]); } if ((void *)in_ECX[0x7a] != (void *)0x0) { free((void *)in_ECX[0x7a]); } if ((void *)in_ECX[0x57] != (void *)0x0) { free((void *)in_ECX[0x57]); } if ((void *)in_ECX[0x58] != (void *)0x0) { free((void *)in_ECX[0x58]); } if ((void *)in_ECX[0x59] != (void *)0x0) { free((void *)in_ECX[0x59]); } } uVar21 = in_ECX[0x19]; if (((uVar21 & 0x1000) != 0) && ((void *)in_ECX[0x43] != (void *)0x0)) { free((void *)in_ECX[0x43]); uVar21 = in_ECX[0x19]; } if (((uVar21 & 0x2000) != 0) && ((void *)in_ECX[0x60] != (void *)0x0)) { free((void *)in_ECX[0x60]); uVar21 = in_ECX[0x19]; } if (((uVar21 & 0x4000) != 0) && ((void *)in_ECX[0x7b] != (void *)0x0)) { free((void *)in_ECX[0x7b]); } pvVar22 = (void *)in_ECX[0x5a]; pvVar24 = pvVar22; if (pvVar22 == (void *)0x0) { LAB_00a9759b: if (pvVar24 != (void *)0x0) goto LAB_00a9759f; } else { iVar25 = 0; iVar23 = 1 << (8U - (char)in_ECX[0x54] & 0x1f); if (0 < iVar23) { do { pvVar1 = *(void **)((int)pvVar22 + iVar25 * 4); if (pvVar1 != (void *)0x0) { free(pvVar1); pvVar22 = (void *)in_ECX[0x5a]; pvVar24 = pvVar22; } iVar25 = iVar25 + 1; } while (iVar25 < iVar23); goto LAB_00a9759b; } LAB_00a9759f: free(pvVar24); } pvVar22 = (void *)in_ECX[0x5b]; pvVar24 = pvVar22; if (pvVar22 == (void *)0x0) { LAB_00a975eb: if (pvVar24 != (void *)0x0) goto LAB_00a975ef; } else { iVar25 = 0; iVar23 = 1 << (8U - (char)in_ECX[0x54] & 0x1f); if (0 < iVar23) { do { pvVar1 = *(void **)((int)pvVar22 + iVar25 * 4); if (pvVar1 != (void *)0x0) { free(pvVar1); pvVar22 = (void *)in_ECX[0x5b]; pvVar24 = pvVar22; } iVar25 = iVar25 + 1; } while (iVar25 < iVar23); goto LAB_00a975eb; } LAB_00a975ef: free(pvVar24); } pvVar22 = (void *)in_ECX[0x5c]; pvVar24 = pvVar22; if (pvVar22 == (void *)0x0) { LAB_00a9763b: if (pvVar24 == (void *)0x0) goto LAB_00a97645; } else { iVar25 = 0; iVar23 = 1 << (8U - (char)in_ECX[0x54] & 0x1f); if (0 < iVar23) { do { pvVar1 = *(void **)((int)pvVar22 + iVar25 * 4); if (pvVar1 != (void *)0x0) { free(pvVar1); pvVar22 = (void *)in_ECX[0x5c]; pvVar24 = pvVar22; } iVar25 = iVar25 + 1; } while (iVar25 < iVar23); goto LAB_00a9763b; } } free(pvVar24); LAB_00a97645: if ((void *)in_ECX[0x82] != (void *)0x0) { free((void *)in_ECX[0x82]); } FUN_00aaf700(); if ((void *)in_ECX[0x6a] != (void *)0x0) { free((void *)in_ECX[0x6a]); } uVar5 = *in_ECX; uVar6 = in_ECX[1]; uVar7 = in_ECX[2]; uVar8 = in_ECX[3]; uVar2 = in_ECX[0x10]; uVar3 = in_ECX[0x11]; uVar9 = in_ECX[4]; uVar10 = in_ECX[5]; uVar11 = in_ECX[6]; uVar12 = in_ECX[7]; uVar13 = in_ECX[8]; uVar14 = in_ECX[9]; uVar15 = in_ECX[10]; uVar16 = in_ECX[0xb]; uVar17 = in_ECX[0xc]; uVar18 = in_ECX[0xd]; uVar19 = in_ECX[0xe]; uVar20 = in_ECX[0xf]; uVar4 = in_ECX[0x12]; memset(in_ECX + 0x13,0,0x1c0); *in_ECX = uVar5; in_ECX[1] = uVar6; in_ECX[2] = uVar7; in_ECX[3] = uVar8; in_ECX[0x11] = uVar3; in_ECX[0x12] = uVar4; in_ECX[4] = uVar9; in_ECX[5] = uVar10; in_ECX[6] = uVar11; in_ECX[7] = uVar12; in_ECX[0x10] = uVar2; in_ECX[8] = uVar13; in_ECX[9] = uVar14; in_ECX[10] = uVar15; in_ECX[0xb] = uVar16; in_ECX[0xc] = uVar17; in_ECX[0xd] = uVar18; in_ECX[0xe] = uVar19; in_ECX[0xf] = uVar20; return; } //@@ 00a976e0 FUN_00a976e0 void FUN_00a976e0(void) { int in_ECX; undefined4 in_XMM1_Da; undefined4 in_XMM1_Db; double in_XMM2_Qa; if (0.05 < ABS((double)CONCAT44(in_XMM1_Db,in_XMM1_Da) * in_XMM2_Qa - 1.0)) { *(uint *)(in_ECX + 0x68) = *(uint *)(in_ECX + 0x68) | 0x2000; } *(float *)(in_ECX + 0x154) = (float)in_XMM2_Qa; *(float *)(in_ECX + 0x158) = (float)(double)CONCAT44(in_XMM1_Db,in_XMM1_Da); return; } //@@ 00a97730 png_init_read_transformations /* DB: ? libpng pngrtran.c: png_ptr->transformations (+0x68) & PNG_EXPAND(0x100), color_type (+0x11e)==PALETTE(3) copies palette[trans] into trans_color (+0x132..0x136), gamma tables via pow (FUN_00a9ae80); called from 00ab33f0 png_read_start_row "Out of Memory") */ void png_init_read_transformations(void) { char *pcVar1; char *pcVar2; float fVar3; byte bVar4; char cVar5; byte bVar6; byte bVar7; ushort uVar8; char cVar9; char cVar10; char cVar11; char cVar12; char cVar13; char cVar14; char cVar15; char cVar16; char cVar17; char cVar18; char cVar19; char cVar20; char cVar21; char cVar22; byte bVar23; byte bVar24; ushort uVar25; short sVar26; int in_ECX; uint uVar27; int iVar28; uint uVar29; int iVar30; int iVar31; int iVar32; ushort uVar33; ushort uVar34; byte *pbVar35; ushort uVar36; double dVar37; double dVar38; double dVar39; double dVar40; double dVar41; undefined2 local_48; byte *local_44; byte local_30; byte local_18; byte local_10; bVar4 = *(byte *)(in_ECX + 0x11e); if ((*(uint *)(in_ECX + 0x68) & 0x100) == 0) goto switchD_00a97786_caseD_3; if ((bVar4 & 2) != 0) { if (bVar4 == 3) { iVar30 = *(int *)(in_ECX + 0x10c); iVar31 = (uint)*(byte *)(in_ECX + 0x130) * 3; *(ushort *)(in_ECX + 0x132) = (ushort)*(byte *)(iVar31 + iVar30); *(ushort *)(in_ECX + 0x134) = (ushort)*(byte *)(iVar31 + 1 + iVar30); *(ushort *)(in_ECX + 0x136) = (ushort)*(byte *)(iVar31 + 2 + iVar30); if ((*(uint *)(in_ECX + 0x68) & 0x81000) == 0x80000) { uVar29 = (uint)*(ushort *)(in_ECX + 0x112); iVar30 = 0; if ((uVar29 != 0) && (0x3f < uVar29)) { uVar27 = *(uint *)(in_ECX + 0x180); if ((in_ECX + 0x180U < uVar27) || ((uVar29 - 1) + uVar27 < in_ECX + 0x180U)) { do { pcVar1 = (char *)(uVar27 + iVar30); cVar5 = pcVar1[1]; cVar9 = pcVar1[2]; cVar10 = pcVar1[3]; cVar11 = pcVar1[4]; cVar12 = pcVar1[5]; cVar13 = pcVar1[6]; cVar14 = pcVar1[7]; cVar15 = pcVar1[8]; cVar16 = pcVar1[9]; cVar17 = pcVar1[10]; cVar18 = pcVar1[0xb]; cVar19 = pcVar1[0xc]; cVar20 = pcVar1[0xd]; cVar21 = pcVar1[0xe]; cVar22 = pcVar1[0xf]; pcVar2 = (char *)(uVar27 + iVar30); *pcVar2 = -1 - *pcVar1; pcVar2[1] = -1 - cVar5; pcVar2[2] = -1 - cVar9; pcVar2[3] = -1 - cVar10; pcVar2[4] = -1 - cVar11; pcVar2[5] = -1 - cVar12; pcVar2[6] = -1 - cVar13; pcVar2[7] = -1 - cVar14; pcVar2[8] = -1 - cVar15; pcVar2[9] = -1 - cVar16; pcVar2[10] = -1 - cVar17; pcVar2[0xb] = -1 - cVar18; pcVar2[0xc] = -1 - cVar19; pcVar2[0xd] = -1 - cVar20; pcVar2[0xe] = -1 - cVar21; pcVar2[0xf] = -1 - cVar22; pcVar1 = (char *)(uVar27 + 0x10 + iVar30); cVar5 = pcVar1[1]; cVar9 = pcVar1[2]; cVar10 = pcVar1[3]; cVar11 = pcVar1[4]; cVar12 = pcVar1[5]; cVar13 = pcVar1[6]; cVar14 = pcVar1[7]; cVar15 = pcVar1[8]; cVar16 = pcVar1[9]; cVar17 = pcVar1[10]; cVar18 = pcVar1[0xb]; cVar19 = pcVar1[0xc]; cVar20 = pcVar1[0xd]; cVar21 = pcVar1[0xe]; cVar22 = pcVar1[0xf]; pcVar2 = (char *)(uVar27 + 0x10 + iVar30); *pcVar2 = -1 - *pcVar1; pcVar2[1] = -1 - cVar5; pcVar2[2] = -1 - cVar9; pcVar2[3] = -1 - cVar10; pcVar2[4] = -1 - cVar11; pcVar2[5] = -1 - cVar12; pcVar2[6] = -1 - cVar13; pcVar2[7] = -1 - cVar14; pcVar2[8] = -1 - cVar15; pcVar2[9] = -1 - cVar16; pcVar2[10] = -1 - cVar17; pcVar2[0xb] = -1 - cVar18; pcVar2[0xc] = -1 - cVar19; pcVar2[0xd] = -1 - cVar20; pcVar2[0xe] = -1 - cVar21; pcVar2[0xf] = -1 - cVar22; pcVar1 = (char *)(uVar27 + 0x20 + iVar30); cVar5 = pcVar1[1]; cVar9 = pcVar1[2]; cVar10 = pcVar1[3]; cVar11 = pcVar1[4]; cVar12 = pcVar1[5]; cVar13 = pcVar1[6]; cVar14 = pcVar1[7]; cVar15 = pcVar1[8]; cVar16 = pcVar1[9]; cVar17 = pcVar1[10]; cVar18 = pcVar1[0xb]; cVar19 = pcVar1[0xc]; cVar20 = pcVar1[0xd]; cVar21 = pcVar1[0xe]; cVar22 = pcVar1[0xf]; pcVar2 = (char *)(uVar27 + 0x20 + iVar30); *pcVar2 = -1 - *pcVar1; pcVar2[1] = -1 - cVar5; pcVar2[2] = -1 - cVar9; pcVar2[3] = -1 - cVar10; pcVar2[4] = -1 - cVar11; pcVar2[5] = -1 - cVar12; pcVar2[6] = -1 - cVar13; pcVar2[7] = -1 - cVar14; pcVar2[8] = -1 - cVar15; pcVar2[9] = -1 - cVar16; pcVar2[10] = -1 - cVar17; pcVar2[0xb] = -1 - cVar18; pcVar2[0xc] = -1 - cVar19; pcVar2[0xd] = -1 - cVar20; pcVar2[0xe] = -1 - cVar21; pcVar2[0xf] = -1 - cVar22; pcVar1 = (char *)(uVar27 + 0x30 + iVar30); cVar5 = pcVar1[1]; cVar9 = pcVar1[2]; cVar10 = pcVar1[3]; cVar11 = pcVar1[4]; cVar12 = pcVar1[5]; cVar13 = pcVar1[6]; cVar14 = pcVar1[7]; cVar15 = pcVar1[8]; cVar16 = pcVar1[9]; cVar17 = pcVar1[10]; cVar18 = pcVar1[0xb]; cVar19 = pcVar1[0xc]; cVar20 = pcVar1[0xd]; cVar21 = pcVar1[0xe]; cVar22 = pcVar1[0xf]; pcVar2 = (char *)(uVar27 + 0x30 + iVar30); *pcVar2 = -1 - *pcVar1; pcVar2[1] = -1 - cVar5; pcVar2[2] = -1 - cVar9; pcVar2[3] = -1 - cVar10; pcVar2[4] = -1 - cVar11; pcVar2[5] = -1 - cVar12; pcVar2[6] = -1 - cVar13; pcVar2[7] = -1 - cVar14; pcVar2[8] = -1 - cVar15; pcVar2[9] = -1 - cVar16; pcVar2[10] = -1 - cVar17; pcVar2[0xb] = -1 - cVar18; pcVar2[0xc] = -1 - cVar19; pcVar2[0xd] = -1 - cVar20; pcVar2[0xe] = -1 - cVar21; pcVar2[0xf] = -1 - cVar22; iVar30 = iVar30 + 0x40; } while (iVar30 < (int)(uVar29 & 0xffffffc0)); } } for (; iVar30 < (int)uVar29; iVar30 = iVar30 + 1) { pbVar35 = (byte *)(*(int *)(in_ECX + 0x180) + iVar30); *pbVar35 = ~*pbVar35; } } } goto switchD_00a97786_caseD_3; } switch(*(undefined1 *)(in_ECX + 0x11f)) { case 1: sVar26 = *(short *)(in_ECX + 0x138) * 0xff; break; case 2: sVar26 = *(short *)(in_ECX + 0x138) * 0x55; *(short *)(in_ECX + 0x138) = sVar26; goto LAB_00a977ed; default: goto switchD_00a97786_caseD_3; case 4: sVar26 = *(short *)(in_ECX + 0x138) * 0x11; break; case 8: case 0x10: sVar26 = *(short *)(in_ECX + 0x138); LAB_00a977ed: *(short *)(in_ECX + 0x136) = sVar26; *(short *)(in_ECX + 0x134) = sVar26; *(short *)(in_ECX + 0x132) = sVar26; goto switchD_00a97786_caseD_3; } *(short *)(in_ECX + 0x138) = sVar26; *(short *)(in_ECX + 0x136) = sVar26; *(short *)(in_ECX + 0x134) = sVar26; *(short *)(in_ECX + 0x132) = sVar26; switchD_00a97786_caseD_3: *(undefined8 *)(in_ECX + 0x13a) = *(undefined8 *)(in_ECX + 0x130); *(undefined2 *)(in_ECX + 0x142) = *(undefined2 *)(in_ECX + 0x138); if ((*(uint *)(in_ECX + 0x68) & 0x2000) == 0) { if (((char)*(uint *)(in_ECX + 0x68) < '\0') && (bVar4 == 3)) { bVar23 = *(byte *)(in_ECX + 0x132); iVar30 = 0; uVar8 = *(ushort *)(in_ECX + 0x112); bVar24 = *(byte *)(in_ECX + 0x134); local_48 = CONCAT11(bVar24,bVar23); bVar6 = *(byte *)(in_ECX + 0x136); if (uVar8 != 0) { local_44 = (byte *)(*(int *)(in_ECX + 0x10c) + 2); do { bVar7 = *(byte *)(iVar30 + *(int *)(in_ECX + 0x180)); if (bVar7 == 0) { *(undefined2 *)(local_44 + -2) = local_48; *local_44 = bVar6; } else if (bVar7 != 0xff) { uVar34 = (0xff - (ushort)bVar7) * (ushort)bVar23 + (ushort)local_44[-2] * (ushort)bVar7 + 0x80; local_44[-2] = (byte)((uint)(uVar34 >> 8) + (uint)uVar34 >> 8); bVar7 = *(byte *)(*(int *)(in_ECX + 0x180) + iVar30); uVar34 = (0xff - (ushort)bVar7) * (ushort)bVar24 + (ushort)local_44[-1] * (ushort)bVar7 + 0x80; local_44[-1] = (byte)((uint)(uVar34 >> 8) + (uint)uVar34 >> 8); bVar7 = *(byte *)(*(int *)(in_ECX + 0x180) + iVar30); uVar34 = (0xff - (ushort)bVar7) * (ushort)bVar6 + (ushort)*local_44 * (ushort)bVar7 + 0x80; *local_44 = (byte)((uint)(uVar34 >> 8) + (uint)uVar34 >> 8); } iVar30 = iVar30 + 1; local_44 = local_44 + 3; } while (iVar30 < (int)(uint)uVar8); } } goto LAB_00a981da; } libpng_png_build_gamma_table(); if ((*(byte *)(in_ECX + 0x68) & 0x80) == 0) { if (bVar4 == 3) { uVar29 = (uint)*(ushort *)(in_ECX + 0x110); if (uVar29 != 0) { pbVar35 = (byte *)(*(int *)(in_ECX + 0x10c) + 2); do { pbVar35[-2] = *(byte *)((uint)pbVar35[-2] + *(int *)(in_ECX + 0x15c)); pbVar35[-1] = *(byte *)((uint)pbVar35[-1] + *(int *)(in_ECX + 0x15c)); *pbVar35 = *(byte *)((uint)*pbVar35 + *(int *)(in_ECX + 0x15c)); uVar29 = uVar29 - 1; pbVar35 = pbVar35 + 3; } while (uVar29 != 0); } } goto LAB_00a981da; } cVar5 = *(char *)(in_ECX + 0x128); if (bVar4 != 3) { iVar30 = (1 << (*(byte *)(in_ECX + 0x11f) & 0x1f)) + -1; dVar38 = (double)iVar30 + __uint_to_double_fixup[-(iVar30 >> 0x1f)]; if ((bVar4 & 2) == 0) { dVar39 = (double)*(ushort *)(in_ECX + 0x138) / dVar38; dVar37 = dVar39; libm_sse2_pow_precise(); *(short *)(in_ECX + 0x142) = (short)(int)(dVar37 * dVar38 + 0.5); libm_sse2_pow_precise(); *(short *)(in_ECX + 0x138) = (short)(int)(dVar39 * dVar38 + 0.5); } else { dVar39 = (double)*(ushort *)(in_ECX + 0x132) / dVar38; dVar37 = dVar39; libm_sse2_pow_precise(); *(short *)(in_ECX + 0x13c) = (short)(int)(dVar37 * dVar38 + 0.5); dVar40 = (double)*(ushort *)(in_ECX + 0x134) / dVar38; dVar37 = dVar40; libm_sse2_pow_precise(); *(short *)(in_ECX + 0x13e) = (short)(int)(dVar37 * dVar38 + 0.5); dVar41 = (double)*(ushort *)(in_ECX + 0x136) / dVar38; dVar37 = dVar41; libm_sse2_pow_precise(); *(short *)(in_ECX + 0x140) = (short)(int)(dVar37 * dVar38 + 0.5); libm_sse2_pow_precise(); *(short *)(in_ECX + 0x132) = (short)(int)(dVar39 * dVar38 + 0.5); libm_sse2_pow_precise(); *(short *)(in_ECX + 0x134) = (short)(int)(dVar40 * dVar38 + 0.5); libm_sse2_pow_precise(); *(short *)(in_ECX + 0x136) = (short)(int)(dVar41 * dVar38 + 0.5); } goto LAB_00a981da; } iVar30 = *(int *)(in_ECX + 0x10c); uVar8 = *(ushort *)(in_ECX + 0x110); if (cVar5 == '\x02') { iVar31 = *(int *)(in_ECX + 0x15c); local_48 = CONCAT11(*(undefined1 *)((uint)*(ushort *)(in_ECX + 0x134) + iVar31), *(undefined1 *)(iVar31 + (uint)*(ushort *)(in_ECX + 0x132))); bVar23 = *(byte *)((uint)*(ushort *)(in_ECX + 0x136) + iVar31); iVar31 = *(int *)(in_ECX + 0x164); uVar25 = (ushort)*(byte *)(iVar31 + (uint)*(ushort *)(in_ECX + 0x132)); uVar36 = (ushort)*(byte *)(iVar31 + (uint)*(ushort *)(in_ECX + 0x136)); uVar34 = (ushort)*(byte *)(iVar31 + (uint)*(ushort *)(in_ECX + 0x134)); } else { dVar38 = 1.0; if (cVar5 != '\x01') { if (cVar5 == '\x02') { fVar3 = *(float *)(in_ECX + 0x154); } else { if (cVar5 != '\x03') goto LAB_00a97a3b; fVar3 = *(float *)(in_ECX + 300); } dVar38 = 1.0 / (double)(fVar3 * *(float *)(in_ECX + 0x158)); } LAB_00a97a3b: if (0.05 <= ABS(dVar38 - 1.0)) { dVar38 = (double)*(ushort *)(in_ECX + 0x132) / 255.0; libm_sse2_pow_precise(); uVar34 = *(ushort *)(in_ECX + 0x134); dVar37 = (double)uVar34 / 255.0; libm_sse2_pow_precise(); local_48 = CONCAT11((char)(int)(dVar37 * 255.0 + 0.5),(char)(int)(dVar38 * 255.0 + 0.5)); uVar36 = *(ushort *)(in_ECX + 0x136); dVar38 = (double)uVar36 / 255.0; libm_sse2_pow_precise(); bVar23 = (byte)(int)(dVar38 * 255.0 + 0.5); uVar25 = *(ushort *)(in_ECX + 0x132); } else { uVar34 = *(ushort *)(in_ECX + 0x134); local_48 = CONCAT11(*(undefined1 *)(in_ECX + 0x134),*(undefined1 *)(in_ECX + 0x132)); bVar23 = *(byte *)(in_ECX + 0x136); uVar25 = *(ushort *)(in_ECX + 0x132); uVar36 = *(ushort *)(in_ECX + 0x136); } dVar38 = (double)uVar25 / 255.0; libm_sse2_pow_precise(); uVar25 = (ushort)(int)(dVar38 * 255.0 + 0.5); dVar38 = (double)uVar34 / 255.0; libm_sse2_pow_precise(); uVar34 = (ushort)(int)(dVar38 * 255.0 + 0.5); dVar38 = (double)uVar36 / 255.0; libm_sse2_pow_precise(); uVar36 = (ushort)(int)(dVar38 * 255.0 + 0.5); } uVar29 = 0; if (uVar8 != 0) { pbVar35 = (byte *)(iVar30 + 2); do { if ((uVar29 < *(ushort *)(in_ECX + 0x112)) && (bVar24 = *(byte *)(uVar29 + *(int *)(in_ECX + 0x180)), bVar24 != 0xff)) { if (bVar24 != 0) { uVar33 = (ushort)*(byte *)((uint)pbVar35[-2] + *(int *)(in_ECX + 0x164)) * (ushort)bVar24 + (0xff - (ushort)bVar24) * (uVar25 & 0xff) + 0x80; pbVar35[-2] = *(byte *)(((uint)(uVar33 >> 8) + (uint)uVar33 >> 8 & 0xff) + *(int *)(in_ECX + 0x160)); bVar24 = *(byte *)(*(int *)(in_ECX + 0x180) + uVar29); uVar33 = (ushort)*(byte *)((uint)pbVar35[-1] + *(int *)(in_ECX + 0x164)) * (ushort)bVar24 + (0xff - (ushort)bVar24) * (uVar34 & 0xff) + 0x80; pbVar35[-1] = *(byte *)(((uint)(uVar33 >> 8) + (uint)uVar33 >> 8 & 0xff) + *(int *)(in_ECX + 0x160)); bVar24 = *(byte *)(*(int *)(in_ECX + 0x180) + uVar29); uVar33 = (ushort)*(byte *)((uint)*pbVar35 + *(int *)(in_ECX + 0x164)) * (ushort)bVar24 + (0xff - (ushort)bVar24) * (uVar36 & 0xff) + 0x80; iVar30 = *(int *)(in_ECX + 0x160); uVar27 = (uint)(uVar33 >> 8) + (uint)uVar33 >> 8 & 0xff; goto LAB_00a97d91; } *(undefined2 *)(pbVar35 + -2) = local_48; bVar24 = bVar23; } else { pbVar35[-2] = *(byte *)((uint)pbVar35[-2] + *(int *)(in_ECX + 0x15c)); uVar27 = (uint)*pbVar35; pbVar35[-1] = *(byte *)((uint)pbVar35[-1] + *(int *)(in_ECX + 0x15c)); iVar30 = *(int *)(in_ECX + 0x15c); LAB_00a97d91: bVar24 = *(byte *)(uVar27 + iVar30); } uVar29 = uVar29 + 1; *pbVar35 = bVar24; pbVar35 = pbVar35 + 3; } while ((int)uVar29 < (int)(uint)uVar8); } LAB_00a981da: if (((*(byte *)(in_ECX + 0x68) & 8) != 0) && (bVar4 == 3)) { uVar29 = (uint)*(ushort *)(in_ECX + 0x110); iVar30 = 8 - (uint)*(byte *)(in_ECX + 0x174); iVar31 = 8 - (uint)*(byte *)(in_ECX + 0x175); iVar28 = 8 - (uint)*(byte *)(in_ECX + 0x176); if ((iVar30 < 0) || (8 < iVar30)) { iVar30 = 0; } if ((iVar31 < 0) || (8 < iVar31)) { iVar31 = 0; } if ((iVar28 < 0) || (8 < iVar28)) { iVar28 = 0; } if (*(ushort *)(in_ECX + 0x110) != 0) { iVar32 = 0; do { local_30 = (byte)iVar30; pbVar35 = (byte *)(iVar32 + *(int *)(in_ECX + 0x10c)); *pbVar35 = *pbVar35 >> (local_30 & 0x1f); local_10 = (byte)iVar31; pbVar35 = (byte *)(iVar32 + 1 + *(int *)(in_ECX + 0x10c)); *pbVar35 = *pbVar35 >> (local_10 & 0x1f); local_18 = (byte)iVar28; pbVar35 = (byte *)(iVar32 + 2 + *(int *)(in_ECX + 0x10c)); *pbVar35 = *pbVar35 >> (local_18 & 0x1f); uVar29 = uVar29 - 1; iVar32 = iVar32 + 3; } while (uVar29 != 0); } } return; } //@@ 00a982d0 FUN_00a982d0 void FUN_00a982d0(void) { byte bVar1; uint uVar2; int in_ECX; int *in_EDX; char cVar3; if ((*(uint *)(in_ECX + 0x68) & 0x1000) == 0) goto LAB_00a98319; if (*(byte *)((int)in_EDX + 0x19) == 3) { *(char *)((int)in_EDX + 0x19) = (*(short *)(in_ECX + 0x112) != 0) * '\x04' + '\x02'; LAB_00a9830e: *(undefined1 *)(in_EDX + 6) = 8; } else { if (*(short *)(in_ECX + 0x112) != 0) { *(byte *)((int)in_EDX + 0x19) = *(byte *)((int)in_EDX + 0x19) | 4; } if (*(byte *)(in_EDX + 6) < 8) goto LAB_00a9830e; } *(undefined2 *)((int)in_EDX + 0x16) = 0; LAB_00a98319: uVar2 = *(uint *)(in_ECX + 0x68); if ((char)uVar2 < '\0') { *(byte *)((int)in_EDX + 0x19) = *(byte *)((int)in_EDX + 0x19) & 0xfb; *(undefined2 *)((int)in_EDX + 0x16) = 0; *(undefined8 *)((int)in_EDX + 0x5a) = *(undefined8 *)(in_ECX + 0x130); *(undefined2 *)((int)in_EDX + 0x62) = *(undefined2 *)(in_ECX + 0x138); uVar2 = *(uint *)(in_ECX + 0x68); } if ((uVar2 & 0x2000) != 0) { in_EDX[10] = *(int *)(in_ECX + 0x154); uVar2 = *(uint *)(in_ECX + 0x68); } if (((uVar2 & 0x400) != 0) && ((char)in_EDX[6] == '\x10')) { *(undefined1 *)(in_EDX + 6) = 8; uVar2 = *(uint *)(in_ECX + 0x68); } if (((uVar2 & 0x40) != 0) && ((((*(char *)((int)in_EDX + 0x19) == '\x02' || (*(char *)((int)in_EDX + 0x19) == '\x06')) && (*(int *)(in_ECX + 0x1e4) != 0)) && ((char)in_EDX[6] == '\b')))) { *(undefined1 *)((int)in_EDX + 0x19) = 3; uVar2 = *(uint *)(in_ECX + 0x68); } if (((uVar2 & 4) != 0) && (*(byte *)(in_EDX + 6) < 8)) { *(undefined1 *)(in_EDX + 6) = 8; uVar2 = *(uint *)(in_ECX + 0x68); } bVar1 = *(byte *)((int)in_EDX + 0x19); if ((uVar2 & 0x4000) != 0) { bVar1 = bVar1 | 2; *(byte *)((int)in_EDX + 0x19) = bVar1; } if ((bVar1 == 3) || ((bVar1 & 2) == 0)) { cVar3 = '\x01'; *(undefined1 *)((int)in_EDX + 0x1d) = 1; } else { *(undefined1 *)((int)in_EDX + 0x1d) = 3; cVar3 = '\x03'; } if ((*(uint *)(in_ECX + 0x68) & 0x40000) != 0) { bVar1 = bVar1 & 0xfb; *(byte *)((int)in_EDX + 0x19) = bVar1; } if ((bVar1 & 4) != 0) { cVar3 = cVar3 + '\x01'; *(char *)((int)in_EDX + 0x1d) = cVar3; } if (((*(uint *)(in_ECX + 0x68) & 0x8000) != 0) && ((bVar1 == 2 || (bVar1 == 0)))) { cVar3 = cVar3 + '\x01'; *(char *)((int)in_EDX + 0x1d) = cVar3; } bVar1 = (char)in_EDX[6] * cVar3; *(byte *)((int)in_EDX + 0x1e) = bVar1; in_EDX[3] = (uint)bVar1 * *in_EDX + 7 >> 3; return; } //@@ 00a98430 png_do_read_transformations /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng 1.2: "NULL row buffer for row %ld, pass %d", "png_do_dither returned rowbytes=0", calls png_do_read_filler; only caller is the real png_read_row 00a96cc0 png_read_row png_read_row) */ void png_do_read_transformations(void) { undefined1 uVar1; int iVar2; uint uVar3; byte *pbVar4; uint uVar5; int in_ECX; undefined1 *puVar6; uint *puVar7; byte *pbVar8; undefined1 *puVar9; byte bVar10; int iVar11; byte *pbVar12; int iVar13; int iVar14; undefined *puVar15; bool bVar16; byte *local_44; byte local_3c [52]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_3c + 0x38); if (*(int *)(in_ECX + 0xe4) == 0) { sprintf(local_3c,(byte *)"NULL row buffer for row %ld, pass %d"); /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((*(uint *)(in_ECX + 0x68) & 0x1000) != 0) { if (*(char *)(in_ECX + 0x100) == '\x03') { png_do_expand_palette (*(undefined4 *)(in_ECX + 0x10c),*(undefined4 *)(in_ECX + 0x180), *(short *)(in_ECX + 0x112)); } else { if (*(short *)(in_ECX + 0x112) == 0) { iVar14 = 0; } else { iVar14 = in_ECX + 0x184; } png_do_expand(iVar14); } } uVar5 = *(uint *)(in_ECX + 0x68); if ((uVar5 & 0x40000) != 0) { png_do_strip_filler(0x80); uVar5 = *(uint *)(in_ECX + 0x68); } if (((uVar5 & 0x4000) != 0) && ((*(uint *)(in_ECX + 100) & 0x20000) == 0)) { png_do_gray_to_rgb(); uVar5 = *(uint *)(in_ECX + 0x68); } if (((char)uVar5 < '\0') && ((*(short *)(in_ECX + 0x112) != 0 || ((*(byte *)(in_ECX + 0x11e) & 4) != 0)))) { png_do_background(in_ECX + 0x184,in_ECX + 0x130,in_ECX + 0x13a,*(undefined4 *)(in_ECX + 0x15c), *(undefined4 *)(in_ECX + 0x160),*(undefined4 *)(in_ECX + 0x164), *(undefined4 *)(in_ECX + 0x168),*(undefined4 *)(in_ECX + 0x16c), *(undefined4 *)(in_ECX + 0x170),*(undefined4 *)(in_ECX + 0x150)); uVar5 = *(uint *)(in_ECX + 0x68); } if (((uVar5 & 0x2000) != 0) && (((-1 < (char)uVar5 || ((*(short *)(in_ECX + 0x112) == 0 && ((*(byte *)(in_ECX + 0x11e) & 4) == 0)))) && (*(char *)(in_ECX + 0x11e) != '\x03')))) { png_do_gamma(*(undefined4 *)(in_ECX + 0x15c),*(undefined4 *)(in_ECX + 0x168), *(undefined4 *)(in_ECX + 0x150)); uVar5 = *(uint *)(in_ECX + 0x68); } if (((uVar5 & 0x400) != 0) && (puVar6 = (undefined1 *)(*(int *)(in_ECX + 0xe4) + 1), *(char *)(in_ECX + 0x101) == '\x10')) { bVar10 = *(byte *)(in_ECX + 0x102); iVar14 = (uint)bVar10 * *(int *)(in_ECX + 0xf8); puVar9 = puVar6; if (iVar14 != 0) { do { uVar1 = *puVar6; puVar6 = puVar6 + 2; *puVar9 = uVar1; puVar9 = puVar9 + 1; iVar14 = iVar14 + -1; } while (iVar14 != 0); bVar10 = *(byte *)(in_ECX + 0x102); } *(byte *)(in_ECX + 0x103) = bVar10 << 3; *(undefined1 *)(in_ECX + 0x101) = 8; *(uint *)(in_ECX + 0xfc) = (uint)bVar10 * *(int *)(in_ECX + 0xf8); } if (((*(byte *)(in_ECX + 0x68) & 0x40) != 0) && (png_do_dither(*(undefined4 *)(in_ECX + 0x1e4),*(undefined4 *)(in_ECX + 0x1e8)), *(int *)(in_ECX + 0xfc) == 0)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((((*(byte *)(in_ECX + 0x68) & 0x20) != 0) && (*(char *)(in_ECX + 0x101) == '\x01')) && (*(char *)(in_ECX + 0x100) == '\0')) { uVar3 = 0; uVar5 = *(uint *)(in_ECX + 0xfc); puVar7 = (uint *)(*(int *)(in_ECX + 0xe4) + 1); if (uVar5 != 0) { if (0x3f < uVar5) { do { uVar3 = uVar3 + 0x40; *puVar7 = ~*puVar7; puVar7[1] = ~puVar7[1]; puVar7[2] = ~puVar7[2]; puVar7[3] = ~puVar7[3]; puVar7[4] = ~puVar7[4]; puVar7[5] = ~puVar7[5]; puVar7[6] = ~puVar7[6]; puVar7[7] = ~puVar7[7]; puVar7[8] = ~puVar7[8]; puVar7[9] = ~puVar7[9]; puVar7[10] = ~puVar7[10]; puVar7[0xb] = ~puVar7[0xb]; puVar7[0xc] = ~puVar7[0xc]; puVar7[0xd] = ~puVar7[0xd]; puVar7[0xe] = ~puVar7[0xe]; puVar7[0xf] = ~puVar7[0xf]; puVar7 = puVar7 + 0x10; } while (uVar3 < (uVar5 & 0xffffffc0)); if (uVar5 <= uVar3) goto LAB_00a986da; } iVar14 = uVar5 - uVar3; do { *(byte *)puVar7 = ~(byte)*puVar7; puVar7 = (uint *)((int)puVar7 + 1); iVar14 = iVar14 + -1; } while (iVar14 != 0); } } LAB_00a986da: uVar5 = *(uint *)(in_ECX + 0x68); if ((uVar5 & 8) != 0) { png_do_unshift(in_ECX + 0x179); uVar5 = *(uint *)(in_ECX + 0x68); } if ((uVar5 & 4) != 0) { iVar14 = *(int *)(in_ECX + 0xe4); bVar10 = *(byte *)(in_ECX + 0x101); iVar11 = iVar14 + 1; if (bVar10 < 8) { iVar2 = *(int *)(in_ECX + 0xf8); if (bVar10 == 1) { local_44 = (byte *)(iVar14 + iVar2); iVar14 = 7 - (iVar2 - 1U & 7); if (iVar2 != 0) { iVar13 = iVar2; pbVar8 = (byte *)((iVar2 - 1U >> 3) + iVar11); do { *local_44 = *pbVar8 >> ((byte)iVar14 & 0x1f) & 1; local_44 = local_44 + -1; pbVar12 = pbVar8 + -1; if (iVar14 != 7) { pbVar12 = pbVar8; } bVar16 = iVar14 != 7; iVar11 = iVar14 + 1; iVar14 = 0; if (bVar16) { iVar14 = iVar11; } iVar13 = iVar13 + -1; pbVar8 = pbVar12; } while (iVar13 != 0); } } else if (bVar10 == 2) { local_44 = (byte *)(iVar14 + iVar2); iVar14 = (3 - (iVar2 - 1U & 3)) * 2; if (iVar2 != 0) { iVar13 = iVar2; pbVar8 = (byte *)((iVar2 - 1U >> 2) + iVar11); do { *local_44 = *pbVar8 >> ((byte)iVar14 & 0x1f) & 3; local_44 = local_44 + -1; pbVar12 = pbVar8 + -1; if (iVar14 != 6) { pbVar12 = pbVar8; } bVar16 = iVar14 != 6; iVar11 = iVar14 + 2; iVar14 = 0; if (bVar16) { iVar14 = iVar11; } iVar13 = iVar13 + -1; pbVar8 = pbVar12; } while (iVar13 != 0); } } else if (bVar10 == 4) { if (iVar2 != 0) { pbVar8 = (byte *)((iVar2 - 1U >> 1) + iVar11); iVar11 = (1 - (iVar2 - 1U & 1)) * 4; iVar13 = iVar2; pbVar12 = (byte *)(iVar14 + iVar2); do { *pbVar12 = *pbVar8 >> ((byte)iVar11 & 0x1f) & 0xf; pbVar4 = pbVar8 + -1; if (iVar11 != 4) { pbVar4 = pbVar8; } iVar14 = 0; if (iVar11 != 4) { iVar14 = 4; } iVar13 = iVar13 + -1; pbVar8 = pbVar4; iVar11 = iVar14; pbVar12 = pbVar12 + -1; } while (iVar13 != 0); } } *(undefined1 *)(in_ECX + 0x101) = 8; *(byte *)(in_ECX + 0x103) = *(byte *)(in_ECX + 0x102) << 3; *(uint *)(in_ECX + 0xfc) = (uint)*(byte *)(in_ECX + 0x102) * iVar2; uVar5 = *(uint *)(in_ECX + 0x68); } } if ((uVar5 & 1) != 0) { png_do_bgr(); uVar5 = *(uint *)(in_ECX + 0x68); } if ((uVar5 & 0x10000) != 0) { bVar10 = *(byte *)(in_ECX + 0x101); pbVar8 = (byte *)(*(int *)(in_ECX + 0xe4) + 1); if (bVar10 < 8) { pbVar12 = (byte *)(*(int *)(in_ECX + 0xe4) + 1 + *(int *)(in_ECX + 0xfc)); if (bVar10 == 1) { puVar15 = &DAT_00c5ac90; } else if (bVar10 == 2) { puVar15 = &DAT_00c5ad90; } else { if (bVar10 != 4) goto LAB_00a988f0; puVar15 = &DAT_00c5ae90; } if (pbVar8 < pbVar12) { do { *pbVar8 = puVar15[*pbVar8]; pbVar8 = pbVar8 + 1; } while (pbVar8 < pbVar12); uVar5 = *(uint *)(in_ECX + 0x68); } } } LAB_00a988f0: if (((uVar5 & 0x4000) != 0) && ((*(uint *)(in_ECX + 100) & 0x20000) != 0)) { png_do_gray_to_rgb(); uVar5 = *(uint *)(in_ECX + 0x68); } if ((uVar5 & 0x8000) != 0) { FUN_00a98e60(*(undefined2 *)(in_ECX + 0x126),*(undefined4 *)(in_ECX + 100)); uVar5 = *(uint *)(in_ECX + 0x68); } if ((uVar5 & 0x80000) != 0) { png_do_read_invert_alpha(); uVar5 = *(uint *)(in_ECX + 0x68); } if ((uVar5 & 0x20000) != 0) { png_do_read_swap_alpha(); uVar5 = *(uint *)(in_ECX + 0x68); } if (((uVar5 & 0x10) != 0) && (*(char *)(in_ECX + 0x101) == '\x10')) { iVar14 = (uint)*(byte *)(in_ECX + 0x102) * *(int *)(in_ECX + 0xf8); puVar6 = (undefined1 *)(*(int *)(in_ECX + 0xe4) + 1); if (iVar14 != 0) { do { uVar1 = *puVar6; *puVar6 = puVar6[1]; puVar6[1] = uVar1; iVar14 = iVar14 + -1; puVar6 = puVar6 + 2; } while (iVar14 != 0); uVar5 = *(uint *)(in_ECX + 0x68); } } if (((uVar5 & 0x100000) != 0) && (*(code **)(in_ECX + 0x54) != (code *)0x0)) { (**(code **)(in_ECX + 0x54))(in_ECX,in_ECX + 0xf8,*(int *)(in_ECX + 0xe4) + 1); } return; } //@@ 00a98a20 png_do_unshift /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng: for non-palette rows computes per-channel shifts bit_depth - sig_bit (param png_color_8: red/green/blue or gray, alpha) and shifts samples right (2/4/8/16-bit cases); only caller png_read_row */ uint png_do_unshift(byte *param_1) { bool bVar1; byte bVar2; byte bVar3; byte bVar4; int *in_ECX; byte *in_EDX; uint uVar5; int iVar6; uint uVar7; uint uVar8; ushort uVar9; uint uVar10; uint local_24; uint local_20; int local_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(local_18 + 5); bVar2 = *(byte *)(in_ECX + 2); uVar5 = CONCAT31((int3)((__security_cookie ^ (uint)(local_18 + 5)) >> 8),bVar2); if (bVar2 != 3) { uVar5 = (uint)*(byte *)((int)in_ECX + 9); iVar6 = *in_ECX; if ((bVar2 & 2) == 0) { local_18[0] = uVar5 - param_1[3]; local_20 = 1; } else { local_18[0] = uVar5 - *param_1; local_18[1] = uVar5 - param_1[1]; local_18[2] = uVar5 - param_1[2]; local_20 = 3; } if ((bVar2 & 4) != 0) { local_18[local_20] = uVar5 - param_1[4]; local_20 = local_20 + 1; } uVar5 = 0; if (local_20 != 0) { bVar1 = false; do { if (local_18[uVar5] < 1) { local_18[uVar5] = 0; } else { bVar1 = true; } uVar5 = uVar5 + 1; } while ((int)uVar5 < (int)local_20); if (bVar1) { bVar2 = *(byte *)((int)in_ECX + 9); uVar5 = bVar2 - 2; if (uVar5 < 0xf) { uVar5 = (uint)*(byte *)((int)&PTR_caseD_3_00a98c28 + bVar2 + 2); switch(bVar2) { case 2: iVar6 = in_ECX[1]; if (iVar6 != 0) { do { uVar5 = *in_EDX >> 1 & 0xffffff55; *in_EDX = (byte)uVar5; iVar6 = iVar6 + -1; in_EDX = in_EDX + 1; } while (iVar6 != 0); return uVar5; } break; case 4: iVar6 = in_ECX[1]; bVar4 = (byte)local_18[0]; uVar5 = 0xf >> (bVar4 & 0x1f); bVar2 = (byte)uVar5; if (iVar6 != 0) { do { bVar3 = *in_EDX >> (bVar4 & 0x1f) & ((byte)(0xf0 >> (bVar4 & 0x1f)) & 0xf0 | bVar2); uVar5 = CONCAT31((int3)(uVar5 >> 8),bVar3); *in_EDX = bVar3; iVar6 = iVar6 + -1; in_EDX = in_EDX + 1; } while (iVar6 != 0); return uVar5; } break; case 8: uVar7 = iVar6 * local_20; uVar8 = 0; if (uVar7 != 0) { do { uVar10 = uVar8 + 1; uVar5 = uVar8 / local_20; *in_EDX = *in_EDX >> (*(byte *)(local_18 + uVar8 % local_20) & 0x1f); in_EDX = in_EDX + 1; uVar8 = uVar10; } while (uVar10 < uVar7); return uVar5; } break; case 0x10: uVar8 = iVar6 * local_20; uVar5 = 0; local_24 = 0; if (uVar8 != 0) { do { uVar9 = CONCAT11(*in_EDX,in_EDX[1]) >> ((byte)local_18[local_24 % local_20] & 0x1f); in_EDX[1] = (byte)uVar9; *in_EDX = (byte)(uVar9 >> 8); uVar5 = local_24 + 1; in_EDX = in_EDX + 2; local_24 = uVar5; } while (uVar5 < uVar8); } } } } } } return uVar5; } //@@ 00a98c40 png_do_read_swap_alpha /* DB: libpng: RGBA->ARGB (moves the trailing alpha byte(s) in front, 8 and 16-bit); png_read_row under PNG_SWAP_ALPHA 0x20000 */ void png_do_read_swap_alpha(void) { undefined1 uVar1; undefined1 uVar2; undefined1 *puVar3; int *in_ECX; int in_EDX; undefined1 *puVar4; int iVar5; iVar5 = *in_ECX; if ((char)in_ECX[2] == '\x06') { puVar3 = (undefined1 *)(in_ECX[1] + in_EDX); if (*(char *)((int)in_ECX + 9) == '\b') { puVar4 = puVar3; if (iVar5 != 0) { do { uVar1 = puVar3[-1]; puVar4[-1] = puVar3[-2]; puVar4[-2] = puVar3[-3]; puVar4[-3] = puVar3[-4]; puVar4[-4] = uVar1; iVar5 = iVar5 + -1; puVar3 = puVar3 + -4; puVar4 = puVar4 + -4; } while (iVar5 != 0); return; } } else if (iVar5 != 0) { puVar4 = puVar3; do { uVar1 = puVar3[-1]; uVar2 = puVar3[-2]; puVar4[-1] = puVar3[-3]; puVar4[-2] = puVar3[-4]; puVar4[-3] = puVar3[-5]; puVar4[-4] = puVar3[-6]; puVar4[-5] = puVar3[-7]; puVar4[-6] = puVar3[-8]; puVar4[-7] = uVar1; puVar4[-8] = uVar2; iVar5 = iVar5 + -1; puVar3 = puVar3 + -8; puVar4 = puVar4 + -8; } while (iVar5 != 0); return; } } else if ((char)in_ECX[2] == '\x04') { puVar3 = (undefined1 *)(in_ECX[1] + in_EDX); puVar4 = puVar3; if (*(char *)((int)in_ECX + 9) == '\b') { if (iVar5 != 0) { do { uVar1 = puVar3[-1]; puVar3 = puVar3 + -2; puVar4[-1] = *puVar3; puVar4[-2] = uVar1; iVar5 = iVar5 + -1; puVar4 = puVar4 + -2; } while (iVar5 != 0); return; } } else { for (; iVar5 != 0; iVar5 = iVar5 + -1) { uVar1 = puVar3[-1]; uVar2 = puVar3[-2]; puVar4[-1] = puVar3[-3]; puVar4[-2] = puVar3[-4]; puVar4[-3] = uVar1; puVar4[-4] = uVar2; puVar3 = puVar3 + -4; puVar4 = puVar4 + -4; } } } return; } //@@ 00a98d50 png_do_read_invert_alpha /* DB: libpng: RGBA/GA rows (color_type 6 / 4): alpha byte(s) replaced by ~alpha walking from the end; png_read_row under PNG_INVERT_ALPHA 0x80000 */ void png_do_read_invert_alpha(void) { byte *pbVar1; undefined1 *puVar2; int *in_ECX; int in_EDX; undefined1 *puVar3; int iVar4; iVar4 = *in_ECX; if ((char)in_ECX[2] == '\x06') { puVar2 = (undefined1 *)(in_ECX[1] + in_EDX); if (*(char *)((int)in_ECX + 9) == '\b') { puVar3 = puVar2; if (iVar4 != 0) { do { puVar3[-1] = ~puVar2[-1]; puVar3[-2] = puVar2[-2]; puVar3[-3] = puVar2[-3]; puVar3[-4] = puVar2[-4]; iVar4 = iVar4 + -1; puVar2 = puVar2 + -4; puVar3 = puVar3 + -4; } while (iVar4 != 0); return; } } else { puVar3 = puVar2; if (iVar4 != 0) { do { puVar3[-1] = ~puVar2[-1]; puVar3[-2] = ~puVar2[-2]; puVar3[-3] = puVar2[-3]; puVar3[-4] = puVar2[-4]; puVar3[-5] = puVar2[-5]; puVar3[-6] = puVar2[-6]; puVar3[-7] = puVar2[-7]; puVar3[-8] = puVar2[-8]; iVar4 = iVar4 + -1; puVar2 = puVar2 + -8; puVar3 = puVar3 + -8; } while (iVar4 != 0); return; } } } else if ((char)in_ECX[2] == '\x04') { puVar2 = (undefined1 *)(in_ECX[1] + in_EDX); puVar3 = puVar2; if (*(char *)((int)in_ECX + 9) == '\b') { if (iVar4 != 0) { do { pbVar1 = puVar2 + -1; puVar2 = puVar2 + -2; puVar3[-1] = ~*pbVar1; puVar3[-2] = *puVar2; iVar4 = iVar4 + -1; puVar3 = puVar3 + -2; } while (iVar4 != 0); return; } } else { for (; iVar4 != 0; iVar4 = iVar4 + -1) { puVar3[-1] = ~puVar2[-1]; puVar3[-2] = ~puVar2[-2]; puVar3[-3] = puVar2[-3]; puVar3[-4] = puVar2[-4]; puVar2 = puVar2 + -4; puVar3 = puVar3 + -4; } } } return; } //@@ 00a98e60 FUN_00a98e60 void FUN_00a98e60(undefined4 param_1,byte param_2) { undefined1 *puVar1; uint uVar2; undefined1 uVar3; uint *in_ECX; undefined1 *puVar4; int in_EDX; undefined1 *puVar5; undefined1 uVar6; int iVar7; uint uVar8; uVar2 = *in_ECX; uVar6 = (undefined1)param_1; uVar3 = (undefined1)((uint)param_1 >> 8); if ((char)in_ECX[2] == '\0') { if (*(char *)((int)in_ECX + 9) == '\b') { puVar4 = (undefined1 *)(uVar2 + in_EDX); puVar5 = puVar4 + uVar2; if ((param_2 & 0x80) == 0) { if (uVar2 != 0) { uVar8 = uVar2; do { puVar1 = puVar4 + -1; puVar4 = puVar4 + -1; puVar5[-1] = *puVar1; puVar5 = puVar5 + -2; *puVar5 = uVar6; uVar8 = uVar8 - 1; } while (uVar8 != 0); } } else if (1 < uVar2) { iVar7 = uVar2 - 1; do { puVar5[-1] = uVar6; puVar4 = puVar4 + -1; puVar5 = puVar5 + -2; *puVar5 = *puVar4; iVar7 = iVar7 + -1; } while (iVar7 != 0); *(undefined2 *)((int)in_ECX + 10) = 0x1002; in_ECX[1] = uVar2 * 2; return; } *(undefined2 *)((int)in_ECX + 10) = 0x1002; in_ECX[1] = uVar2 * 2; return; } if (*(char *)((int)in_ECX + 9) == '\x10') { puVar4 = (undefined1 *)(uVar2 + in_EDX); if ((param_2 & 0x80) == 0) { if (uVar2 != 0) { puVar5 = puVar4 + uVar2; uVar8 = uVar2; do { puVar1 = puVar4 + -1; puVar4 = puVar4 + -2; puVar5[-1] = *puVar1; puVar5[-2] = *puVar4; puVar5[-3] = uVar3; puVar5[-4] = uVar6; uVar8 = uVar8 - 1; puVar5 = puVar5 + -4; } while (uVar8 != 0); } *(undefined2 *)((int)in_ECX + 10) = 0x1002; in_ECX[1] = uVar2 * 2; return; } if (1 < uVar2) { iVar7 = uVar2 - 1; puVar5 = puVar4 + uVar2; do { puVar5[-1] = uVar3; puVar5[-2] = uVar6; puVar5[-3] = puVar4[-1]; puVar5[-4] = puVar4[-2]; iVar7 = iVar7 + -1; puVar4 = puVar4 + -2; puVar5 = puVar5 + -4; } while (iVar7 != 0); } *(undefined2 *)((int)in_ECX + 10) = 0x2002; in_ECX[1] = uVar2 * 2; return; } } else if ((char)in_ECX[2] == '\x02') { if (*(char *)((int)in_ECX + 9) == '\b') { puVar4 = (undefined1 *)(in_EDX + uVar2 * 3); if ((param_2 & 0x80) == 0) { if (uVar2 != 0) { puVar5 = puVar4 + uVar2; uVar8 = uVar2; do { puVar5[-1] = puVar4[-1]; puVar5[-2] = puVar4[-2]; puVar5[-3] = puVar4[-3]; puVar5[-4] = uVar6; uVar8 = uVar8 - 1; puVar4 = puVar4 + -3; puVar5 = puVar5 + -4; } while (uVar8 != 0); } } else if (1 < uVar2) { iVar7 = uVar2 - 1; puVar5 = puVar4 + uVar2; do { puVar5[-1] = uVar6; puVar5[-2] = puVar4[-1]; puVar5[-3] = puVar4[-2]; puVar5[-4] = puVar4[-3]; iVar7 = iVar7 + -1; puVar4 = puVar4 + -3; puVar5 = puVar5 + -4; } while (iVar7 != 0); *(undefined2 *)((int)in_ECX + 10) = 0x2004; in_ECX[1] = uVar2 * 4; return; } *(undefined2 *)((int)in_ECX + 10) = 0x2004; in_ECX[1] = uVar2 * 4; return; } if (*(char *)((int)in_ECX + 9) == '\x10') { puVar4 = (undefined1 *)(in_EDX + uVar2 * 3); if ((param_2 & 0x80) == 0) { if (uVar2 != 0) { puVar5 = puVar4 + uVar2; uVar8 = uVar2; do { puVar5[-1] = puVar4[-1]; puVar5[-2] = puVar4[-2]; puVar5[-3] = puVar4[-3]; puVar5[-4] = puVar4[-4]; puVar5[-5] = puVar4[-5]; puVar5[-6] = puVar4[-6]; puVar5[-7] = uVar3; puVar5[-8] = uVar6; uVar8 = uVar8 - 1; puVar4 = puVar4 + -6; puVar5 = puVar5 + -8; } while (uVar8 != 0); } } else if (1 < uVar2) { iVar7 = uVar2 - 1; puVar5 = puVar4 + uVar2; do { puVar5[-1] = uVar3; puVar5[-2] = uVar6; puVar5[-3] = puVar4[-1]; puVar5[-4] = puVar4[-2]; puVar5[-5] = puVar4[-3]; puVar5[-6] = puVar4[-4]; puVar5[-7] = puVar4[-5]; puVar5[-8] = puVar4[-6]; iVar7 = iVar7 + -1; puVar4 = puVar4 + -6; puVar5 = puVar5 + -8; } while (iVar7 != 0); } *(undefined2 *)((int)in_ECX + 10) = 0x4004; in_ECX[1] = uVar2 * 4; } } return; } //@@ 00a98e6a png_do_read_filler /* DB: libpng pngrtran.c: tail of the function entered at 0xa98e60 (10-byte prologue, called from 0xa98932 inside the read-transformations routine); between png_do_read_invert_alpha and png_do_gray_to_rgb; inserts filler byte per pixel, 8/16-bit, PNG_FLAG_FILLER_AFTER (0x80) branch */ void png_do_read_filler(void) { undefined1 *puVar1; uint uVar2; uint in_EAX; uint uVar3; uint *in_ECX; undefined1 *puVar4; int in_EDX; undefined1 *puVar5; undefined1 unaff_BL; int unaff_EBP; int iVar6; uVar3 = in_EAX >> 8; *(uint **)(unaff_EBP + -4) = in_ECX; *(uint *)(unaff_EBP + 8) = uVar3; uVar2 = *in_ECX; if ((char)in_ECX[2] == '\0') { if (*(char *)((int)in_ECX + 9) == '\b') { puVar4 = (undefined1 *)(uVar2 + in_EDX); puVar5 = puVar4 + uVar2; if ((*(byte *)(unaff_EBP + 0xc) & 0x80) == 0) { if (uVar2 != 0) { uVar3 = uVar2; do { puVar1 = puVar4 + -1; puVar4 = puVar4 + -1; puVar5[-1] = *puVar1; puVar5 = puVar5 + -2; *puVar5 = unaff_BL; uVar3 = uVar3 - 1; } while (uVar3 != 0); in_ECX = *(uint **)(unaff_EBP + -4); } } else if (1 < uVar2) { iVar6 = uVar2 - 1; do { puVar5[-1] = unaff_BL; puVar4 = puVar4 + -1; puVar5 = puVar5 + -2; *puVar5 = *puVar4; iVar6 = iVar6 + -1; } while (iVar6 != 0); iVar6 = *(int *)(unaff_EBP + -4); *(undefined2 *)(iVar6 + 10) = 0x1002; *(uint *)(iVar6 + 4) = uVar2 * 2; return; } *(undefined2 *)((int)in_ECX + 10) = 0x1002; in_ECX[1] = uVar2 * 2; return; } if (*(char *)((int)in_ECX + 9) != '\x10') { return; } puVar4 = (undefined1 *)(uVar2 + in_EDX); if ((*(byte *)(unaff_EBP + 0xc) & 0x80) == 0) { if (uVar2 != 0) { puVar5 = puVar4 + uVar2; uVar3 = uVar2; do { puVar1 = puVar4 + -1; puVar4 = puVar4 + -2; puVar5[-1] = *puVar1; puVar5[-2] = *puVar4; puVar5[-3] = (char)*(undefined4 *)(unaff_EBP + 8); puVar5[-4] = unaff_BL; uVar3 = uVar3 - 1; puVar5 = puVar5 + -4; } while (uVar3 != 0); in_ECX = *(uint **)(unaff_EBP + -4); } *(undefined2 *)((int)in_ECX + 10) = 0x1002; in_ECX[1] = uVar2 * 2; return; } if (1 < uVar2) { iVar6 = uVar2 - 1; puVar5 = puVar4 + uVar2; do { puVar5[-1] = (char)uVar3; puVar5[-2] = unaff_BL; puVar5[-3] = puVar4[-1]; puVar5[-4] = puVar4[-2]; uVar3 = *(uint *)(unaff_EBP + 8); iVar6 = iVar6 + -1; puVar4 = puVar4 + -2; puVar5 = puVar5 + -4; } while (iVar6 != 0); in_ECX = *(uint **)(unaff_EBP + -4); } *(undefined2 *)((int)in_ECX + 10) = 0x2002; in_ECX[1] = uVar2 * 2; return; } if ((char)in_ECX[2] != '\x02') { return; } if (*(char *)((int)in_ECX + 9) == '\b') { puVar4 = (undefined1 *)(in_EDX + uVar2 * 3); if ((*(byte *)(unaff_EBP + 0xc) & 0x80) == 0) { if (uVar2 != 0) { puVar5 = puVar4 + uVar2; uVar3 = uVar2; do { puVar5[-1] = puVar4[-1]; puVar5[-2] = puVar4[-2]; puVar5[-3] = puVar4[-3]; puVar5[-4] = unaff_BL; uVar3 = uVar3 - 1; puVar4 = puVar4 + -3; puVar5 = puVar5 + -4; } while (uVar3 != 0); in_ECX = *(uint **)(unaff_EBP + -4); } } else if (1 < uVar2) { iVar6 = uVar2 - 1; puVar5 = puVar4 + uVar2; do { puVar5[-1] = unaff_BL; puVar5[-2] = puVar4[-1]; puVar5[-3] = puVar4[-2]; puVar5[-4] = puVar4[-3]; iVar6 = iVar6 + -1; puVar4 = puVar4 + -3; puVar5 = puVar5 + -4; } while (iVar6 != 0); iVar6 = *(int *)(unaff_EBP + -4); *(undefined2 *)(iVar6 + 10) = 0x2004; *(uint *)(iVar6 + 4) = uVar2 * 4; return; } *(undefined2 *)((int)in_ECX + 10) = 0x2004; in_ECX[1] = uVar2 * 4; return; } if (*(char *)((int)in_ECX + 9) != '\x10') { return; } puVar4 = (undefined1 *)(in_EDX + uVar2 * 3); if ((*(byte *)(unaff_EBP + 0xc) & 0x80) == 0) { if (uVar2 == 0) goto LAB_00a990d3; puVar5 = puVar4 + uVar2; uVar3 = uVar2; do { puVar5[-1] = puVar4[-1]; puVar5[-2] = puVar4[-2]; puVar5[-3] = puVar4[-3]; puVar5[-4] = puVar4[-4]; puVar5[-5] = puVar4[-5]; puVar5[-6] = puVar4[-6]; puVar5[-7] = (char)*(undefined4 *)(unaff_EBP + 8); puVar5[-8] = unaff_BL; uVar3 = uVar3 - 1; puVar4 = puVar4 + -6; puVar5 = puVar5 + -8; } while (uVar3 != 0); } else { if (uVar2 < 2) goto LAB_00a990d3; iVar6 = uVar2 - 1; puVar5 = puVar4 + uVar2; do { puVar5[-1] = (char)*(undefined4 *)(unaff_EBP + 8); puVar5[-2] = unaff_BL; puVar5[-3] = puVar4[-1]; puVar5[-4] = puVar4[-2]; puVar5[-5] = puVar4[-3]; puVar5[-6] = puVar4[-4]; puVar5[-7] = puVar4[-5]; puVar5[-8] = puVar4[-6]; iVar6 = iVar6 + -1; puVar4 = puVar4 + -6; puVar5 = puVar5 + -8; } while (iVar6 != 0); } in_ECX = *(uint **)(unaff_EBP + -4); LAB_00a990d3: *(undefined2 *)((int)in_ECX + 10) = 0x4004; in_ECX[1] = uVar2 * 4; return; } //@@ 00a990f0 png_do_gray_to_rgb /* DB: libpng: row_info ECX (bit depth +9, color type +8), row EDX: copies each gray sample into R,G,B (8-bit and 16-bit, with/without alpha) from the end backwards; only caller png_read_row */ void png_do_gray_to_rgb(void) { byte bVar1; byte bVar2; int iVar3; int *in_ECX; undefined1 *puVar4; int in_EDX; undefined1 *puVar5; int iVar6; bVar1 = *(byte *)((int)in_ECX + 9); iVar3 = *in_ECX; if ((7 < bVar1) && (bVar2 = *(byte *)(in_ECX + 2), (bVar2 & 2) == 0)) { if (bVar2 == 0) { if (bVar1 == 8) { puVar5 = (undefined1 *)(iVar3 + in_EDX); if (iVar3 != 0) { puVar4 = puVar5 + iVar3 * 2 + -1; iVar6 = iVar3; do { puVar5 = puVar5 + -1; *puVar4 = *puVar5; puVar4[-1] = *puVar5; puVar4[-2] = *puVar5; iVar6 = iVar6 + -1; puVar4 = puVar4 + -3; } while (iVar6 != 0); } } else { iVar6 = in_EDX + iVar3 * 2; if (iVar3 != 0) { puVar5 = (undefined1 *)(iVar6 + iVar3 * 4 + -1); puVar4 = (undefined1 *)(iVar6 + -1); iVar6 = iVar3; do { *puVar5 = *puVar4; puVar5[-1] = puVar4[-1]; puVar5[-2] = *puVar4; puVar5[-3] = puVar4[-1]; puVar5[-4] = *puVar4; puVar5[-5] = puVar4[-1]; iVar6 = iVar6 + -1; puVar5 = puVar5 + -6; puVar4 = puVar4 + -2; } while (iVar6 != 0); } } } else if (bVar2 == 4) { if (bVar1 == 8) { iVar6 = in_EDX + iVar3 * 2; if (iVar3 != 0) { puVar5 = (undefined1 *)(iVar3 * 2 + -1 + iVar6); puVar4 = (undefined1 *)(iVar6 + -1); iVar6 = iVar3; do { *puVar5 = *puVar4; puVar5[-1] = puVar4[-1]; puVar5[-2] = puVar4[-1]; puVar5[-3] = puVar4[-1]; iVar6 = iVar6 + -1; puVar5 = puVar5 + -4; puVar4 = puVar4 + -2; } while (iVar6 != 0); } } else { iVar6 = in_EDX + iVar3 * 4; if (iVar3 != 0) { puVar5 = (undefined1 *)(iVar3 * 4 + -1 + iVar6); puVar4 = (undefined1 *)(iVar6 + -1); iVar6 = iVar3; do { *puVar5 = *puVar4; puVar5[-1] = puVar4[-1]; puVar5[-2] = puVar4[-2]; puVar5[-3] = puVar4[-3]; puVar5[-4] = puVar4[-2]; puVar5[-5] = puVar4[-3]; puVar5[-6] = puVar4[-2]; puVar5[-7] = puVar4[-3]; iVar6 = iVar6 + -1; puVar5 = puVar5 + -8; puVar4 = puVar4 + -4; } while (iVar6 != 0); } } } *(char *)((int)in_ECX + 10) = *(char *)((int)in_ECX + 10) + '\x02'; *(byte *)(in_ECX + 2) = *(byte *)(in_ECX + 2) | 2; bVar1 = *(char *)((int)in_ECX + 9) * *(char *)((int)in_ECX + 10); *(byte *)((int)in_ECX + 0xb) = bVar1; in_ECX[1] = (uint)bVar1 * iVar3 + 7 >> 3; } return; } //@@ 00a99280 png_do_background /* DB: libpng pngrtran.c: switch on row_info bit_depth, compares pixels to trans_color and replaces with background; caller 00a98430 png_do_read_transformations png_do_read_transformations ("png_do_dither returned rowbytes=0") */ void png_do_background(int param_1,uint param_2,int param_3,int param_4,int param_5,int param_6, int param_7,int param_8,int param_9,byte param_10) { byte bVar1; byte bVar2; undefined2 uVar3; uint uVar4; byte bVar7; uint uVar5; uint uVar6; uint *in_ECX; ushort uVar8; byte *in_EDX; int iVar9; byte bVar10; byte *pbVar11; short sVar12; int iVar13; uint local_24; uint local_20; byte *local_1c; byte *local_18; byte *local_10; iVar9 = param_2; uVar4 = *in_ECX; if (param_2 == 0) { return; } bVar7 = (byte)in_ECX[2]; if ((bVar7 & 4) != 0) { if (bVar7 == 3) { return; } if (param_1 == 0) { return; } } local_1c = (byte *)uVar4; switch(bVar7) { case 0: switch(*(undefined1 *)((int)in_ECX + 9)) { case 1: local_10 = (byte *)0x7; if (uVar4 != 0) { do { bVar7 = (byte)local_10; if ((ushort)(*in_EDX >> (bVar7 & 0x1f) & 1) == *(ushort *)(param_1 + 8)) { bVar10 = (byte)(0x7f7f >> (7 - bVar7 & 0x1f)) & *in_EDX; *in_EDX = bVar10; *in_EDX = *(char *)(param_2 + 8) << (bVar7 & 0x1f) | bVar10; } if (local_10 == (byte *)0x0) { local_10 = (byte *)0x7; in_EDX = in_EDX + 1; } else { local_10 = (byte *)((int)local_10 + -1); } local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } break; case 2: if (param_4 == 0) { local_10 = (byte *)0x6; if (uVar4 != 0) { do { bVar7 = (byte)local_10; if ((ushort)(*in_EDX >> (bVar7 & 0x1f) & 3) == *(ushort *)(param_1 + 8)) { bVar10 = (byte)(0x3f3f >> (6 - bVar7 & 0x1f)) & *in_EDX; *in_EDX = bVar10; *in_EDX = *(char *)(param_2 + 8) << (bVar7 & 0x1f) | bVar10; } if (local_10 == (byte *)0x0) { local_10 = (byte *)0x6; in_EDX = in_EDX + 1; } else { local_10 = (byte *)((int)local_10 + -2); } local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } else { local_10 = (byte *)0x6; if (uVar4 != 0) { local_18 = (byte *)uVar4; do { bVar10 = (byte)local_10; bVar7 = *in_EDX; local_1c._0_1_ = (byte)(0x3f3f >> (6 - bVar10 & 0x1f)); if ((ushort)(bVar7 >> (bVar10 & 0x1f) & 3) == *(ushort *)(param_1 + 8)) { *in_EDX = bVar7 & (byte)local_1c; bVar7 = *(char *)(param_2 + 8) << (bVar10 & 0x1f) | bVar7 & (byte)local_1c; } else { uVar5 = bVar7 >> (bVar10 & 0x1f) & 3; bVar7 = bVar7 & (byte)local_1c | (*(byte *)((((uVar5 * 4 | uVar5) << 2 | uVar5) << 2 | uVar5) + param_4) >> 6) << (bVar10 & 0x1f); } *in_EDX = bVar7; if (local_10 == (byte *)0x0) { local_10 = (byte *)0x6; in_EDX = in_EDX + 1; } else { local_10 = (byte *)((int)local_10 + -2); } local_18 = (byte *)((int)local_18 - 1); } while (local_18 != (byte *)0x0); } } break; case 4: if (param_4 == 0) { local_18 = (byte *)0x4; if (uVar4 != 0) { do { bVar7 = (byte)local_18; if ((ushort)(*in_EDX >> (bVar7 & 0x1f) & 0xf) == *(ushort *)(param_1 + 8)) { bVar10 = (byte)(0xf0f >> (4 - bVar7 & 0x1f)) & *in_EDX; *in_EDX = bVar10; *in_EDX = *(char *)(param_2 + 8) << (bVar7 & 0x1f) | bVar10; } if (local_18 == (byte *)0x0) { local_18 = (byte *)0x4; in_EDX = in_EDX + 1; } else { local_18 = (byte *)((int)local_18 + -4); } local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } else { local_10 = (byte *)0x4; if (uVar4 != 0) { do { bVar10 = (byte)local_10; bVar7 = *in_EDX; local_18._0_1_ = (byte)(0xf0f >> (4 - bVar10 & 0x1f)); if ((ushort)(bVar7 >> (bVar10 & 0x1f) & 0xf) == *(ushort *)(param_1 + 8)) { *in_EDX = (byte)local_18 & bVar7; bVar7 = *(char *)(param_2 + 8) << (bVar10 & 0x1f) | (byte)local_18 & bVar7; } else { uVar5 = bVar7 >> (bVar10 & 0x1f) & 0xf; bVar7 = (byte)local_18 & bVar7 | (*(byte *)((uVar5 << 4 | uVar5) + param_4) >> 4) << (bVar10 & 0x1f); } *in_EDX = bVar7; if (local_10 == (byte *)0x0) { local_10 = (byte *)0x4; in_EDX = in_EDX + 1; } else { local_10 = (byte *)((int)local_10 + -4); } local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } break; case 8: uVar5 = uVar4; if (param_4 == 0) { for (; uVar5 != 0; uVar5 = uVar5 - 1) { if ((ushort)*in_EDX == *(ushort *)(param_1 + 8)) { *in_EDX = *(byte *)(param_2 + 8); } in_EDX = in_EDX + 1; } } else if (uVar4 != 0) { param_2 = uVar4; do { if ((ushort)*in_EDX == *(ushort *)(param_1 + 8)) { bVar7 = *(byte *)(iVar9 + 8); } else { bVar7 = *(byte *)((uint)*in_EDX + param_4); } *in_EDX = bVar7; in_EDX = in_EDX + 1; param_2 = param_2 - 1; } while (param_2 != 0); } break; case 0x10: if (param_7 == 0) { if (uVar4 != 0) { param_2 = uVar4; do { if (CONCAT11(*in_EDX,in_EDX[1]) == *(short *)(param_1 + 8)) { *in_EDX = *(byte *)(iVar9 + 9); in_EDX[1] = *(byte *)(iVar9 + 8); } in_EDX = in_EDX + 2; param_2 = param_2 - 1; } while (param_2 != 0); } } else if (uVar4 != 0) { do { if (CONCAT11(*in_EDX,in_EDX[1]) == *(short *)(param_1 + 8)) { *in_EDX = *(byte *)(param_2 + 9); uVar8 = (ushort)*(byte *)(param_2 + 8); } else { uVar8 = *(ushort *) (*(int *)(param_7 + (uint)(in_EDX[1] >> (param_10 & 0x1f)) * 4) + (uint)*in_EDX * 2); *in_EDX = (byte)(uVar8 >> 8); } in_EDX[1] = (byte)uVar8; in_EDX = in_EDX + 2; local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } break; case 2: if (uVar4 != 0) { if (*(char *)((int)in_ECX + 9) == '\b') { if (param_4 == 0) { pbVar11 = in_EDX + 2; uVar5 = uVar4; do { if ((((ushort)pbVar11[-2] == *(ushort *)(param_1 + 2)) && ((ushort)pbVar11[-1] == *(ushort *)(param_1 + 4))) && ((ushort)*pbVar11 == *(ushort *)(param_1 + 6))) { pbVar11[-2] = *(byte *)(param_2 + 2); pbVar11[-1] = *(byte *)(param_2 + 4); *pbVar11 = *(byte *)(param_2 + 6); } pbVar11 = pbVar11 + 3; uVar5 = uVar5 - 1; } while (uVar5 != 0); } else { pbVar11 = in_EDX + 1; param_2 = uVar4; do { if ((((ushort)pbVar11[-1] == *(ushort *)(param_1 + 2)) && ((ushort)*pbVar11 == *(ushort *)(param_1 + 4))) && ((ushort)pbVar11[1] == *(ushort *)(param_1 + 6))) { pbVar11[-1] = *(byte *)(iVar9 + 2); *pbVar11 = *(byte *)(iVar9 + 4); bVar7 = *(byte *)(iVar9 + 6); } else { pbVar11[-1] = *(byte *)((uint)pbVar11[-1] + param_4); *pbVar11 = *(byte *)((uint)*pbVar11 + param_4); bVar7 = *(byte *)((uint)pbVar11[1] + param_4); } pbVar11[1] = bVar7; pbVar11 = pbVar11 + 3; param_2 = param_2 - 1; } while (param_2 != 0); } } else { local_18 = in_EDX + 2; if (param_7 == 0) { param_2 = uVar4; do { if (((CONCAT11(local_18[-2],local_18[-1]) == *(short *)(param_1 + 2)) && (CONCAT11(*local_18,local_18[1]) == *(short *)(param_1 + 4))) && (CONCAT11(local_18[2],local_18[3]) == *(short *)(param_1 + 6))) { local_18[-2] = *(byte *)(iVar9 + 3); local_18[-1] = *(byte *)(iVar9 + 2); *local_18 = *(byte *)(iVar9 + 5); local_18[1] = *(byte *)(iVar9 + 4); local_18[2] = *(byte *)(iVar9 + 7); local_18[3] = *(byte *)(iVar9 + 6); } local_18 = local_18 + 6; param_2 = param_2 - 1; } while (param_2 != 0); } else { do { if (((CONCAT11(local_18[-2],local_18[-1]) == *(short *)(param_1 + 2)) && (CONCAT11(*local_18,local_18[1]) == *(short *)(param_1 + 4))) && (CONCAT11(local_18[2],local_18[3]) == *(short *)(param_1 + 6))) { local_18[-2] = *(byte *)(param_2 + 3); local_18[-1] = *(byte *)(param_2 + 2); *local_18 = *(byte *)(param_2 + 5); local_18[1] = *(byte *)(param_2 + 4); local_18[2] = *(byte *)(param_2 + 7); uVar8 = (ushort)*(byte *)(param_2 + 6); } else { uVar3 = *(undefined2 *) (*(int *)(param_7 + (uint)(local_18[-1] >> (param_10 & 0x1f)) * 4) + (uint)local_18[-2] * 2); local_18[-1] = (byte)uVar3; local_18[-2] = (byte)((ushort)uVar3 >> 8); uVar3 = *(undefined2 *) (*(int *)(param_7 + (uint)(local_18[1] >> (param_10 & 0x1f)) * 4) + (uint)*local_18 * 2); local_18[1] = (byte)uVar3; *local_18 = (byte)((ushort)uVar3 >> 8); uVar8 = *(ushort *) (*(int *)(param_7 + (uint)(local_18[3] >> (param_10 & 0x1f)) * 4) + (uint)local_18[2] * 2); local_18[2] = (byte)(uVar8 >> 8); } local_18[3] = (byte)uVar8; local_18 = local_18 + 6; local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } } break; case 4: if (*(char *)((int)in_ECX + 9) == '\b') { if (((param_6 == 0) || (param_5 == 0)) || (param_4 == 0)) { local_1c = (byte *)0x0; local_18 = in_EDX; if (uVar4 != 0) { do { bVar7 = local_18[1]; if (bVar7 == 0xff) { bVar7 = *local_18; } else if (bVar7 == 0) { bVar7 = *(byte *)(param_2 + 8); } else { uVar8 = (0xff - (ushort)bVar7) * *(short *)(param_3 + 8) + (ushort)*local_18 * (ushort)bVar7 + 0x80; bVar7 = (byte)((uint)(uVar8 >> 8) + (uint)uVar8 >> 8); } in_EDX[(int)local_1c] = bVar7; local_18 = local_18 + 2; local_1c = (byte *)((int)local_1c + 1); } while (local_1c < uVar4); } goto LAB_00a9a275; } local_1c = (byte *)0x0; pbVar11 = in_EDX; if (uVar4 != 0) { do { bVar7 = pbVar11[1]; if (bVar7 == 0xff) { bVar7 = *(byte *)((uint)*pbVar11 + param_4); } else if (bVar7 == 0) { bVar7 = *(byte *)(param_2 + 8); } else { uVar8 = (0xff - (ushort)bVar7) * *(short *)(param_3 + 8) + (ushort)*(byte *)((uint)*pbVar11 + param_6) * (ushort)bVar7 + 0x80; bVar7 = *(byte *)(((uint)(uVar8 >> 8) + (uint)uVar8 >> 8 & 0xff) + param_5); } in_EDX[(int)local_1c] = bVar7; local_1c = (byte *)((int)local_1c + 1); pbVar11 = pbVar11 + 2; } while (local_1c < uVar4); } } else if (((param_7 == 0) || (param_8 == 0)) || (param_9 == 0)) { if (uVar4 != 0) { pbVar11 = in_EDX + 3; do { uVar8 = CONCAT11(pbVar11[-1],*pbVar11); if (uVar8 == 0xffff) { *(undefined2 *)in_EDX = *(undefined2 *)(pbVar11 + -3); } else if (uVar8 == 0) { *in_EDX = *(byte *)(param_2 + 9); in_EDX[1] = *(byte *)(param_2 + 8); } else { uVar5 = (0xffff - (uint)uVar8) * (uint)*(ushort *)(param_3 + 8) + (uint)CONCAT11(pbVar11[-3],pbVar11[-2]) * (uint)uVar8 + 0x8000; iVar9 = (uVar5 >> 0x10) + uVar5; in_EDX[1] = (byte)((uint)iVar9 >> 0x10); *in_EDX = (byte)((uint)iVar9 >> 0x18); } pbVar11 = pbVar11 + 4; in_EDX = in_EDX + 2; local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } else if (uVar4 != 0) { local_1c = in_EDX + 1; local_10 = (byte *)uVar4; do { uVar8 = CONCAT11(local_1c[1],local_1c[2]); if (uVar8 == 0xffff) { uVar8 = *(ushort *) (*(int *)(param_7 + (uint)(*local_1c >> (param_10 & 0x1f)) * 4) + (uint)local_1c[-1] * 2); LAB_00a99b7c: *in_EDX = (byte)(uVar8 >> 8); } else { if (uVar8 != 0) { uVar5 = (0xffff - (uint)uVar8) * (uint)*(ushort *)(param_3 + 8) + (uint)*(ushort *) (*(int *)(param_9 + (uint)(*local_1c >> (param_10 & 0x1f)) * 4) + (uint)local_1c[-1] * 2) * (uint)uVar8 + 0x8000; uVar5 = (uVar5 >> 0x10) + uVar5; uVar8 = *(ushort *) (*(int *)(param_8 + ((uVar5 >> 0x10 & 0xff) >> (param_10 & 0x1f)) * 4) + (uVar5 >> 0x18) * 2); goto LAB_00a99b7c; } *in_EDX = *(byte *)(param_2 + 9); uVar8 = (ushort)*(byte *)(param_2 + 8); } in_EDX[1] = (byte)uVar8; local_1c = local_1c + 4; in_EDX = in_EDX + 2; local_10 = (byte *)((int)local_10 - 1); } while (local_10 != (byte *)0x0); } break; case 6: if (*(char *)((int)in_ECX + 9) == '\b') { if (((param_6 == 0) || (param_5 == 0)) || (param_4 == 0)) { if (uVar4 != 0) { local_18 = in_EDX + 1; local_10 = local_18; do { bVar7 = local_18[2]; if (bVar7 == 0xff) { local_10[-1] = local_18[-1]; *local_10 = *local_18; bVar7 = local_18[1]; } else if (bVar7 == 0) { local_10[-1] = *(byte *)(param_2 + 2); *local_10 = *(byte *)(param_2 + 4); bVar7 = *(byte *)(param_2 + 6); } else { sVar12 = 0xff - (ushort)bVar7; uVar8 = (ushort)local_18[-1] * (ushort)bVar7 + *(short *)(param_2 + 2) * sVar12 + 0x80 ; local_10[-1] = (byte)((uint)(uVar8 >> 8) + (uint)uVar8 >> 8); uVar8 = (ushort)*local_18 * (ushort)bVar7 + sVar12 * *(short *)(param_2 + 4) + 0x80; *local_10 = (byte)((uint)(uVar8 >> 8) + (uint)uVar8 >> 8); uVar8 = (ushort)local_18[1] * (ushort)bVar7 + sVar12 * *(short *)(param_2 + 6) + 0x80; bVar7 = (byte)((uint)(uVar8 >> 8) + (uint)uVar8 >> 8); } local_10[1] = bVar7; local_18 = local_18 + 4; local_10 = local_10 + 3; local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } else if (uVar4 != 0) { local_18 = in_EDX + 1; local_10 = local_18; do { bVar7 = local_10[2]; if (bVar7 == 0xff) { local_18[-1] = *(byte *)((uint)local_10[-1] + param_4); *local_18 = *(byte *)((uint)*local_10 + param_4); bVar7 = *(byte *)((uint)local_10[1] + param_4); } else if (bVar7 == 0) { local_18[-1] = *(byte *)(param_2 + 2); *local_18 = *(byte *)(param_2 + 4); bVar7 = *(byte *)(param_2 + 6); } else { sVar12 = 0xff - (ushort)bVar7; uVar8 = (ushort)*(byte *)((uint)local_10[-1] + param_6) * (ushort)bVar7 + *(short *)(param_3 + 2) * sVar12 + 0x80; local_18[-1] = *(byte *)(((uint)(uVar8 >> 8) + (uint)uVar8 >> 8 & 0xff) + param_5); uVar8 = (ushort)*(byte *)((uint)*local_10 + param_6) * (ushort)bVar7 + *(short *)(param_3 + 4) * sVar12 + 0x80; *local_18 = *(byte *)(((uint)(uVar8 >> 8) + (uint)uVar8 >> 8 & 0xff) + param_5); uVar8 = (ushort)*(byte *)((uint)local_10[1] + param_6) * (ushort)bVar7 + *(short *)(param_3 + 6) * sVar12 + 0x80; bVar7 = *(byte *)(((uint)(uVar8 >> 8) + (uint)uVar8 >> 8 & 0xff) + param_5); } local_18[1] = bVar7; local_10 = local_10 + 4; local_18 = local_18 + 3; local_1c = (byte *)((int)local_1c - 1); } while (local_1c != (byte *)0x0); } } else if (((param_7 == 0) || (param_8 == 0)) || (param_9 == 0)) { if (uVar4 != 0) { local_10 = in_EDX + 2; local_1c = in_EDX + 7; local_20 = uVar4; do { uVar8 = CONCAT11(local_1c[-1],*local_1c); uVar5 = (uint)uVar8; if (uVar8 == 0xffff) { *(undefined4 *)(local_10 + -2) = *(undefined4 *)(local_1c + -7); *(undefined2 *)(local_10 + 2) = *(undefined2 *)(local_1c + -3); } else if (uVar8 == 0) { local_10[-2] = *(byte *)(param_2 + 3); local_10[-1] = *(byte *)(param_2 + 2); *local_10 = *(byte *)(param_2 + 5); local_10[1] = *(byte *)(param_2 + 4); local_10[2] = *(byte *)(param_2 + 7); local_10[3] = *(byte *)(param_2 + 6); } else { bVar7 = local_1c[-5]; bVar10 = local_1c[-4]; bVar1 = local_1c[-3]; bVar2 = local_1c[-2]; iVar13 = 0xffff - uVar5; uVar6 = (uint)*(ushort *)(param_2 + 2) * iVar13 + CONCAT11(local_1c[-7],local_1c[-6]) * uVar5 + 0x8000; iVar9 = (uVar6 >> 0x10) + uVar6; local_10[-2] = (byte)((uint)iVar9 >> 0x18); local_10[-1] = (byte)((uint)iVar9 >> 0x10); uVar6 = (uint)*(ushort *)(param_2 + 4) * iVar13 + ((CONCAT11(bVar1,bVar7) & 0xff) * 0x100 + (CONCAT11(bVar2,bVar10) & 0xff)) * uVar5 + 0x8000; iVar9 = (uVar6 >> 0x10) + uVar6; *local_10 = (byte)((uint)iVar9 >> 0x18); local_10[1] = (byte)((uint)iVar9 >> 0x10); uVar5 = (uint)*(ushort *)(param_2 + 6) * iVar13 + CONCAT11(bVar1,bVar2) * uVar5 + 0x8000 ; iVar9 = (uVar5 >> 0x10) + uVar5; local_10[3] = (byte)((uint)iVar9 >> 0x10); local_10[2] = (byte)((uint)iVar9 >> 0x18); } local_1c = local_1c + 8; local_10 = local_10 + 6; local_20 = local_20 - 1; } while (local_20 != 0); } } else if (uVar4 != 0) { local_18 = in_EDX + 2; local_10 = in_EDX + 1; local_24 = uVar4; do { uVar8 = CONCAT11(local_10[5],local_10[6]); uVar5 = (uint)uVar8; if (uVar8 == 0xffff) { uVar3 = *(undefined2 *) (*(int *)(param_7 + (uint)(*local_10 >> (param_10 & 0x1f)) * 4) + (uint)local_10[-1] * 2); local_18[-1] = (byte)uVar3; local_18[-2] = (byte)((ushort)uVar3 >> 8); uVar3 = *(undefined2 *) (*(int *)(param_7 + (uint)(local_10[2] >> (param_10 & 0x1f)) * 4) + (uint)local_10[1] * 2); local_18[1] = (byte)uVar3; *local_18 = (byte)((ushort)uVar3 >> 8); uVar8 = *(ushort *) (*(int *)(param_7 + (uint)(local_10[4] >> (param_10 & 0x1f)) * 4) + (uint)local_10[3] * 2); LAB_00a9a0d5: local_18[2] = (byte)(uVar8 >> 8); } else { if (uVar8 != 0) { iVar9 = 0xffff - uVar5; uVar6 = (uint)*(ushort *)(param_2 + 2) * iVar9 + *(ushort *) (*(int *)(param_9 + (uint)(*local_10 >> (param_10 & 0x1f)) * 4) + (uint)local_10[-1] * 2) * uVar5 + 0x8000; uVar6 = (uVar6 >> 0x10) + uVar6; uVar3 = *(undefined2 *) (*(int *)(param_8 + ((uVar6 >> 0x10 & 0xff) >> (param_10 & 0x1f)) * 4) + (uVar6 >> 0x18) * 2); local_18[-2] = (byte)((ushort)uVar3 >> 8); local_18[-1] = (byte)uVar3; uVar6 = (uint)*(ushort *)(param_2 + 4) * iVar9 + 0x8000 + *(ushort *) (*(int *)(param_9 + (uint)(local_10[2] >> (param_10 & 0x1f)) * 4) + (uint)local_10[1] * 2) * uVar5; uVar6 = (uVar6 >> 0x10) + uVar6; uVar3 = *(undefined2 *) (*(int *)(param_8 + ((uVar6 >> 0x10 & 0xff) >> (param_10 & 0x1f)) * 4) + (uVar6 >> 0x18) * 2); local_18[1] = (byte)uVar3; *local_18 = (byte)((ushort)uVar3 >> 8); uVar5 = (uint)*(ushort *)(param_2 + 6) * iVar9 + 0x8000 + *(ushort *) (*(int *)(param_9 + (uint)(local_10[4] >> (param_10 & 0x1f)) * 4) + (uint)local_10[3] * 2) * uVar5; uVar5 = (uVar5 >> 0x10) + uVar5; uVar8 = *(ushort *) (*(int *)(param_8 + ((uVar5 >> 0x10 & 0xff) >> (param_10 & 0x1f)) * 4) + (uVar5 >> 0x18) * 2); goto LAB_00a9a0d5; } local_18[-2] = *(byte *)(param_2 + 3); local_18[-1] = *(byte *)(param_2 + 2); *local_18 = *(byte *)(param_2 + 5); local_18[1] = *(byte *)(param_2 + 4); local_18[2] = *(byte *)(param_2 + 7); uVar8 = (ushort)*(byte *)(param_2 + 6); } local_18[3] = (byte)uVar8; local_10 = local_10 + 8; local_18 = local_18 + 6; local_24 = local_24 - 1; } while (local_24 != 0); } } LAB_00a9a275: if (((byte)in_ECX[2] & 4) != 0) { *(char *)((int)in_ECX + 10) = *(char *)((int)in_ECX + 10) + -1; *(byte *)(in_ECX + 2) = (byte)in_ECX[2] & 0xfb; bVar7 = *(char *)((int)in_ECX + 9) * *(char *)((int)in_ECX + 10); *(byte *)((int)in_ECX + 0xb) = bVar7; in_ECX[1] = bVar7 * uVar4 + 7 >> 3; } return; } //@@ 00a9a2f0 png_do_gamma /* DB: libpng: (row_info, row, gamma_table, gamma_16_table, gamma_shift): switch on color_type, maps 2/4/8/16-bit samples through gamma_table (+0x15c) / gamma_16_table (+0x168); png_read_row */ void png_do_gamma(int param_1,int param_2,byte param_3) { undefined2 uVar1; byte bVar2; int iVar3; uint uVar4; uint uVar5; int *in_ECX; byte *in_EDX; int iVar6; uint uVar7; uint uVar8; byte *local_8; bVar2 = *(byte *)((int)in_ECX + 9); iVar6 = *in_ECX; if (((bVar2 < 9) && (param_1 != 0)) || ((bVar2 == 0x10 && (param_2 != 0)))) { switch((char)in_ECX[2]) { case '\0': if (bVar2 == 2) { if (iVar6 == 0) { return; } iVar3 = (iVar6 - 1U >> 2) + 1; local_8 = in_EDX; do { uVar8 = (uint)*local_8; uVar4 = uVar8 & 0xc0; uVar7 = uVar8 & 0xc; uVar5 = uVar8 & 0x30; uVar8 = uVar8 & 3; *local_8 = (byte)((byte)(*(byte *)(((uVar7 * 4 | uVar7) << 2 | uVar7 >> 2 | uVar7) + param_1) & 0xcf | *(byte *)((((uVar8 * 4 | uVar8) << 2 | uVar8) << 2 | uVar8) + param_1) >> 2) >> 2 | *(byte *)(((uVar5 >> 2 | uVar5) >> 2 | uVar5 * 4 | uVar5) + param_1) & 0xc3) >> 2 | *(byte *)((((uVar4 >> 2 | uVar4) >> 2 | uVar4) >> 2 | uVar4) + param_1) & 0xc0; local_8 = local_8 + 1; iVar3 = iVar3 + -1; } while (iVar3 != 0); bVar2 = *(byte *)((int)in_ECX + 9); } if (bVar2 == 4) { if (iVar6 != 0) { iVar6 = (iVar6 - 1U >> 1) + 1; do { bVar2 = *in_EDX; uVar4 = bVar2 & 0xf; *in_EDX = *(byte *)(((uint)(bVar2 >> 4) | bVar2 & 0xf0) + param_1) & 0xf0 | *(byte *)((uVar4 << 4 | uVar4) + param_1) >> 4; iVar6 = iVar6 + -1; in_EDX = in_EDX + 1; } while (iVar6 != 0); return; } } else if (bVar2 == 8) { if (iVar6 != 0) { do { *in_EDX = *(byte *)((uint)*in_EDX + param_1); iVar6 = iVar6 + -1; in_EDX = in_EDX + 1; } while (iVar6 != 0); return; } } else if ((bVar2 == 0x10) && (iVar6 != 0)) { do { uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[1] >> (param_3 & 0x1f)) * 4) + (uint)*in_EDX * 2); in_EDX[1] = (byte)uVar1; *in_EDX = (byte)((ushort)uVar1 >> 8); iVar6 = iVar6 + -1; in_EDX = in_EDX + 2; } while (iVar6 != 0); } break; case '\x02': if (bVar2 == 8) { if (iVar6 != 0) { do { *in_EDX = *(byte *)((uint)*in_EDX + param_1); in_EDX[1] = *(byte *)((uint)in_EDX[1] + param_1); in_EDX[2] = *(byte *)((uint)in_EDX[2] + param_1); iVar6 = iVar6 + -1; in_EDX = in_EDX + 3; } while (iVar6 != 0); return; } } else if (iVar6 != 0) { do { uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[1] >> (param_3 & 0x1f)) * 4) + (uint)*in_EDX * 2); in_EDX[1] = (byte)uVar1; *in_EDX = (byte)((ushort)uVar1 >> 8); uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[3] >> (param_3 & 0x1f)) * 4) + (uint)in_EDX[2] * 2); in_EDX[3] = (byte)uVar1; in_EDX[2] = (byte)((ushort)uVar1 >> 8); uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[5] >> (param_3 & 0x1f)) * 4) + (uint)in_EDX[4] * 2); in_EDX[5] = (byte)uVar1; in_EDX[4] = (byte)((ushort)uVar1 >> 8); iVar6 = iVar6 + -1; in_EDX = in_EDX + 6; } while (iVar6 != 0); return; } break; case '\x04': if (bVar2 == 8) { if (iVar6 != 0) { do { *in_EDX = *(byte *)((uint)*in_EDX + param_1); iVar6 = iVar6 + -1; in_EDX = in_EDX + 2; } while (iVar6 != 0); return; } } else if (iVar6 != 0) { do { uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[1] >> (param_3 & 0x1f)) * 4) + (uint)*in_EDX * 2); in_EDX[1] = (byte)uVar1; *in_EDX = (byte)((ushort)uVar1 >> 8); iVar6 = iVar6 + -1; in_EDX = in_EDX + 4; } while (iVar6 != 0); return; } break; case '\x06': if (bVar2 == 8) { if (iVar6 != 0) { do { *in_EDX = *(byte *)((uint)*in_EDX + param_1); in_EDX[1] = *(byte *)((uint)in_EDX[1] + param_1); in_EDX[2] = *(byte *)((uint)in_EDX[2] + param_1); iVar6 = iVar6 + -1; in_EDX = in_EDX + 4; } while (iVar6 != 0); return; } } else if (iVar6 != 0) { do { uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[1] >> (param_3 & 0x1f)) * 4) + (uint)*in_EDX * 2); in_EDX[1] = (byte)uVar1; *in_EDX = (byte)((ushort)uVar1 >> 8); uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[3] >> (param_3 & 0x1f)) * 4) + (uint)in_EDX[2] * 2); in_EDX[3] = (byte)uVar1; in_EDX[2] = (byte)((ushort)uVar1 >> 8); uVar1 = *(undefined2 *) (*(int *)(param_2 + (uint)(in_EDX[5] >> (param_3 & 0x1f)) * 4) + (uint)in_EDX[4] * 2); in_EDX[5] = (byte)uVar1; in_EDX[4] = (byte)((ushort)uVar1 >> 8); iVar6 = iVar6 + -1; in_EDX = in_EDX + 8; } while (iVar6 != 0); return; } } } return; } //@@ 00a9a6d0 png_do_expand_palette /* DB: libpng: returns unless color_type == PALETTE(3); unpacks 1/2/4-bit indices to 8 then expands to RGB/RGBA using palette and trans (num_trans); png_read_row under PNG_EXPAND (0x1000) with palette color type */ void png_do_expand_palette(int param_1,int param_2,int param_3) { int iVar1; byte bVar2; undefined1 uVar3; byte *pbVar4; uint *in_ECX; int in_EDX; undefined1 *puVar5; int iVar6; byte *pbVar7; uint uVar8; uint uVar9; bool bVar10; int local_18; byte *local_14; uVar9 = *in_ECX; if ((char)in_ECX[2] != '\x03') { return; } bVar2 = *(byte *)((int)in_ECX + 9); if (bVar2 < 8) { if (bVar2 == 1) { local_14 = (byte *)(in_EDX + -1 + uVar9); local_18 = 7 - (uVar9 - 1 & 7); if (uVar9 != 0) { pbVar7 = (byte *)((uVar9 - 1 >> 3) + in_EDX); uVar8 = uVar9; do { *local_14 = *pbVar7 >> ((byte)local_18 & 0x1f) & 1; local_14 = local_14 + -1; iVar6 = local_18 + 1; pbVar4 = pbVar7 + -1; if (local_18 != 7) { pbVar4 = pbVar7; } bVar10 = local_18 != 7; local_18 = 0; if (bVar10) { local_18 = iVar6; } uVar8 = uVar8 - 1; pbVar7 = pbVar4; } while (uVar8 != 0); *(undefined1 *)((int)in_ECX + 9) = 8; *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = uVar9; goto LAB_00a9a86c; } } else if (bVar2 == 2) { local_14 = (byte *)(in_EDX + -1 + uVar9); iVar6 = (3 - (uVar9 - 1 & 3)) * 2; pbVar7 = (byte *)((uVar9 - 1 >> 2) + in_EDX); uVar8 = uVar9; if (uVar9 != 0) { do { *local_14 = *pbVar7 >> ((byte)iVar6 & 0x1f) & 3; local_14 = local_14 + -1; pbVar4 = pbVar7 + -1; if (iVar6 != 6) { pbVar4 = pbVar7; } bVar10 = iVar6 != 6; iVar1 = iVar6 + 2; iVar6 = 0; if (bVar10) { iVar6 = iVar1; } uVar8 = uVar8 - 1; pbVar7 = pbVar4; } while (uVar8 != 0); *(undefined1 *)((int)in_ECX + 9) = 8; *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = uVar9; goto LAB_00a9a86c; } } else if (bVar2 == 4) { local_14 = (byte *)(in_EDX + -1 + uVar9); iVar6 = (uVar9 & 1) << 2; pbVar7 = (byte *)((uVar9 - 1 >> 1) + in_EDX); uVar8 = uVar9; if (uVar9 != 0) { do { *local_14 = *pbVar7 >> ((byte)iVar6 & 0x1f) & 0xf; local_14 = local_14 + -1; pbVar4 = pbVar7 + -1; if (iVar6 != 4) { pbVar4 = pbVar7; } bVar10 = iVar6 != 4; iVar1 = iVar6 + 4; iVar6 = 0; if (bVar10) { iVar6 = iVar1; } uVar8 = uVar8 - 1; pbVar7 = pbVar4; } while (uVar8 != 0); *(undefined1 *)((int)in_ECX + 9) = 8; *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = uVar9; goto LAB_00a9a86c; } } *(undefined1 *)((int)in_ECX + 9) = 8; *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = uVar9; } else if (bVar2 != 8) { return; } LAB_00a9a86c: pbVar7 = (byte *)(in_EDX + -1 + uVar9); if (param_2 == 0) { uVar8 = uVar9 * 3; puVar5 = (undefined1 *)(in_EDX + -1 + uVar8); for (; uVar9 != 0; uVar9 = uVar9 - 1) { *puVar5 = *(undefined1 *)((uint)*pbVar7 * 3 + 2 + param_1); puVar5[-1] = *(undefined1 *)((uint)*pbVar7 * 3 + 1 + param_1); puVar5[-2] = *(undefined1 *)(param_1 + (uint)*pbVar7 * 3); pbVar7 = pbVar7 + -1; puVar5 = puVar5 + -3; } in_ECX[2] = 0x18030802; in_ECX[1] = uVar8; return; } uVar8 = uVar9 * 4; puVar5 = (undefined1 *)(in_EDX + -1 + uVar8); for (; uVar9 != 0; uVar9 = uVar9 - 1) { if ((int)(uint)*pbVar7 < param_3) { uVar3 = *(undefined1 *)((uint)*pbVar7 + param_2); } else { uVar3 = 0xff; } *puVar5 = uVar3; puVar5[-1] = *(undefined1 *)((uint)*pbVar7 * 3 + 2 + param_1); puVar5[-2] = *(undefined1 *)((uint)*pbVar7 * 3 + 1 + param_1); bVar2 = *pbVar7; pbVar7 = pbVar7 + -1; puVar5[-3] = *(undefined1 *)(param_1 + (uint)bVar2 * 3); puVar5 = puVar5 + -4; } in_ECX[2] = 0x20040806; in_ECX[1] = uVar8; return; } //@@ 00a9a960 png_do_expand /* DB: libpng: expands 1/2/4-bit gray (and palette-less color) rows to 8 bits, scaling the tRNS gray value (param trans_color +8) by 0xff/0x55/0x11 and adding alpha where it matches; only caller png_read_row */ void png_do_expand(int param_1) { undefined1 *puVar1; int iVar2; char cVar3; undefined1 uVar4; int iVar5; int *in_ECX; byte bVar6; int in_EDX; undefined1 *puVar7; ushort uVar8; byte *pbVar9; undefined1 *puVar10; int iVar11; int iVar12; byte *pbVar13; char *pcVar14; char *pcVar15; byte *local_18; iVar2 = *in_ECX; local_18 = (byte *)iVar2; if ((char)in_ECX[2] == '\0') { if (param_1 == 0) { uVar8 = 0; } else { uVar8 = *(ushort *)(param_1 + 8); } bVar6 = *(byte *)((int)in_ECX + 9); if (bVar6 < 8) { if (bVar6 == 1) { uVar8 = uVar8 * 0xff; pcVar14 = (char *)(in_EDX + -1 + iVar2); pbVar9 = (byte *)((iVar2 - 1U >> 3) + in_EDX); iVar11 = 7 - (iVar2 - 1U & 7); for (iVar12 = iVar2; iVar12 != 0; iVar12 = iVar12 + -1) { *pcVar14 = -((*pbVar9 >> ((byte)iVar11 & 0x1f) & 1) != 0); if (iVar11 == 7) { iVar11 = 0; pbVar9 = pbVar9 + -1; } else { iVar11 = iVar11 + 1; } pcVar14 = pcVar14 + -1; } } else if (bVar6 == 2) { uVar8 = uVar8 * 0x55; pbVar13 = (byte *)(in_EDX + -1 + iVar2); pbVar9 = (byte *)((iVar2 - 1U >> 2) + in_EDX); iVar12 = (3 - (iVar2 - 1U & 3)) * 2; if (iVar2 != 0) { do { bVar6 = *pbVar9 >> ((byte)iVar12 & 0x1f) & 3; *pbVar13 = ((bVar6 << 2 | bVar6) << 2 | bVar6) << 2 | bVar6; if (iVar12 == 6) { iVar12 = 0; pbVar9 = pbVar9 + -1; } else { iVar12 = iVar12 + 2; } pbVar13 = pbVar13 + -1; local_18 = (byte *)((int)local_18 + -1); } while (local_18 != (byte *)0x0); } } else if (bVar6 == 4) { uVar8 = uVar8 * 0x11; local_18 = (byte *)(in_EDX + -1 + iVar2); if (iVar2 != 0) { iVar12 = (iVar2 - 1U & 1) * -4 + 4; pbVar9 = (byte *)((iVar2 - 1U >> 1) + in_EDX); iVar11 = iVar2; do { bVar6 = *pbVar9 >> ((byte)iVar12 & 0x1f); *local_18 = bVar6 << 4 | bVar6 & 0xf; local_18 = local_18 + -1; pbVar13 = pbVar9 + -1; if (iVar12 != 4) { pbVar13 = pbVar9; } iVar5 = 0; if (iVar12 != 4) { iVar5 = 4; } iVar11 = iVar11 + -1; iVar12 = iVar5; pbVar9 = pbVar13; } while (iVar11 != 0); } } *(undefined1 *)((int)in_ECX + 9) = 8; bVar6 = 8; *(undefined1 *)((int)in_ECX + 0xb) = 8; in_ECX[1] = iVar2; } if (param_1 == 0) { return; } if (bVar6 == 8) { if (iVar2 != 0) { pbVar9 = (byte *)(in_EDX + -1 + iVar2); pcVar14 = (char *)(in_EDX + -1 + iVar2 * 2); iVar12 = iVar2; do { *pcVar14 = -(*pbVar9 != uVar8); pcVar14[-1] = *pbVar9; iVar12 = iVar12 + -1; pbVar9 = pbVar9 + -1; pcVar14 = pcVar14 + -2; } while (iVar12 != 0); } } else if (bVar6 == 0x10) { if (iVar2 != 0) { pcVar14 = (char *)(in_ECX[1] * 2 + -1 + in_EDX); pcVar15 = (char *)(in_EDX + -1 + in_ECX[1]); local_18 = (byte *)iVar2; do { cVar3 = -(CONCAT11(pcVar15[-1],*pcVar15) != uVar8); local_18 = (byte *)((int)local_18 + -1); *pcVar14 = cVar3; pcVar14[-1] = cVar3; pcVar14[-2] = *pcVar15; pcVar14[-3] = pcVar15[-1]; pcVar14 = pcVar14 + -4; pcVar15 = pcVar15 + -2; } while (local_18 != (byte *)0x0); } } *(undefined1 *)(in_ECX + 2) = 4; bVar6 = *(char *)((int)in_ECX + 9) * '\x02'; *(undefined1 *)((int)in_ECX + 10) = 2; } else { if ((char)in_ECX[2] != '\x02') { return; } if (param_1 == 0) { return; } if (*(char *)((int)in_ECX + 9) == '\b') { pbVar9 = (byte *)(in_EDX + -1 + in_ECX[1]); puVar10 = (undefined1 *)(in_EDX + -1 + iVar2 * 4); if (iVar2 != 0) { do { if ((((ushort)pbVar9[-2] == *(ushort *)(param_1 + 2)) && ((ushort)pbVar9[-1] == *(ushort *)(param_1 + 4))) && ((ushort)*pbVar9 == *(ushort *)(param_1 + 6))) { uVar4 = 0; } else { uVar4 = 0xff; } *puVar10 = uVar4; puVar10[-1] = *pbVar9; puVar10[-2] = pbVar9[-1]; pbVar13 = pbVar9 + -2; pbVar9 = pbVar9 + -3; puVar10[-3] = *pbVar13; puVar10 = puVar10 + -4; local_18 = (byte *)((int)local_18 + -1); } while (local_18 != (byte *)0x0); } } else if (*(char *)((int)in_ECX + 9) == '\x10') { puVar7 = (undefined1 *)(in_EDX + -1 + in_ECX[1]); puVar10 = (undefined1 *)(in_EDX + -1 + iVar2 * 8); for (iVar12 = iVar2; iVar12 != 0; iVar12 = iVar12 + -1) { if (((CONCAT11(puVar7[-5],puVar7[-4]) == *(short *)(param_1 + 2)) && (CONCAT11(puVar7[-3],puVar7[-2]) == *(short *)(param_1 + 4))) && (CONCAT11(puVar7[-1],*puVar7) == *(short *)(param_1 + 6))) { uVar4 = 0; } else { uVar4 = 0xff; } *puVar10 = uVar4; puVar10[-1] = uVar4; puVar10[-2] = *puVar7; puVar10[-3] = puVar7[-1]; puVar10[-4] = puVar7[-2]; puVar10[-5] = puVar7[-3]; puVar10[-6] = puVar7[-4]; puVar1 = puVar7 + -5; puVar7 = puVar7 + -6; puVar10[-7] = *puVar1; puVar10 = puVar10 + -8; } } *(undefined1 *)(in_ECX + 2) = 6; *(undefined1 *)((int)in_ECX + 10) = 4; bVar6 = *(char *)((int)in_ECX + 9) << 2; } *(byte *)((int)in_ECX + 0xb) = bVar6; in_ECX[1] = (uint)bVar6 * iVar2 >> 3; return; } //@@ 00a9ad20 png_do_dither /* DB: libpng 1.2 pngrtran.c png_do_dither(row_info,row,palette_lookup,dither_lookup): RGB/RGBA 8-bit -> palette index via 5-bit-per-channel lookup, sets color_type PALETTE(3), channels 1; png_read_row under PNG_DITHER (0x40) ("png_do_dither returned rowbytes=0") */ void png_do_dither(int param_1,int param_2) { char cVar1; byte bVar2; int *in_ECX; byte *in_EDX; int iVar3; byte *pbVar4; int local_8; cVar1 = (char)in_ECX[2]; iVar3 = *in_ECX; local_8 = iVar3; if (cVar1 == '\x02') { if ((param_1 != 0) && (*(char *)((int)in_ECX + 9) == '\b')) { bVar2 = 8; if (iVar3 != 0) { pbVar4 = in_EDX; do { local_8 = local_8 + -1; *pbVar4 = *(byte *)((((*in_EDX & 0xf8) << 5 | in_EDX[1] & 0xf8) << 2 | (uint)(in_EDX[2] >> 3)) + param_1); in_EDX = in_EDX + 3; pbVar4 = pbVar4 + 1; } while (local_8 != 0); *(byte *)((int)in_ECX + 0xb) = *(byte *)((int)in_ECX + 9); *(undefined1 *)(in_ECX + 2) = 3; *(undefined1 *)((int)in_ECX + 10) = 1; in_ECX[1] = (uint)*(byte *)((int)in_ECX + 9) * iVar3 + 7 >> 3; return; } LAB_00a9ae2e: *(byte *)((int)in_ECX + 0xb) = bVar2; *(undefined1 *)(in_ECX + 2) = 3; *(undefined1 *)((int)in_ECX + 10) = 1; in_ECX[1] = (uint)bVar2 * iVar3 + 7 >> 3; return; } } else if (cVar1 == '\x06') { if ((param_1 != 0) && (*(char *)((int)in_ECX + 9) == '\b')) { bVar2 = 8; if (iVar3 != 0) { pbVar4 = in_EDX; do { local_8 = local_8 + -1; *pbVar4 = *(byte *)((((*in_EDX & 0xf8) << 5 | in_EDX[1] & 0xf8) << 2 | (uint)(in_EDX[2] >> 3)) + param_1); in_EDX = in_EDX + 4; pbVar4 = pbVar4 + 1; } while (local_8 != 0); bVar2 = *(byte *)((int)in_ECX + 9); } goto LAB_00a9ae2e; } } else if (((cVar1 == '\x03') && (param_2 != 0)) && (*(char *)((int)in_ECX + 9) == '\b')) { for (; iVar3 != 0; iVar3 = iVar3 + -1) { *in_EDX = *(byte *)((uint)*in_EDX + param_2); in_EDX = in_EDX + 1; } } return; } //@@ 00a9ae80 libpng_png_build_gamma_table /* DB: ? libpng: malloc(256) table[i] = pow(i/255, gamma)*255+.5 stored at png_ptr+0x15c, "Out of Memory" (png_malloc string); caller 00a97730 png_init_read_transformations void libpng_png_build_gamma_table(void) { size_t _Size; byte bVar1; void *pvVar2; int iVar3; uint uVar4; int iVar5; byte bVar6; int in_ECX; uint uVar7; code *pcVar8; uint uVar9; int iVar10; int iVar11; uint uVar12; int iVar13; double dVar14; uint local_10; if (*(byte *)(in_ECX + 0x11f) < 9) { pvVar2 = malloc(0x100); if (pvVar2 == (void *)0x0) { LAB_00a9b523: /* WARNING: Subroutine does not return */ FUN_00a64610(); } iVar10 = 0; *(void **)(in_ECX + 0x15c) = pvVar2; do { dVar14 = (double)iVar10 / 255.0; libm_sse2_pow_precise(); *(char *)(iVar10 + *(int *)(in_ECX + 0x15c)) = (char)(int)(dVar14 * 255.0 + 0.5); iVar10 = iVar10 + 1; } while (iVar10 < 0x100); if ((*(byte *)(in_ECX + 0x68) & 0x80) != 0) { pvVar2 = malloc(0x100); if (pvVar2 != (void *)0x0) { iVar10 = 0; *(void **)(in_ECX + 0x164) = pvVar2; do { dVar14 = (double)iVar10 / 255.0; libm_sse2_pow_precise(); *(char *)(iVar10 + *(int *)(in_ECX + 0x164)) = (char)(int)(dVar14 * 255.0 + 0.5); iVar10 = iVar10 + 1; } while (iVar10 < 0x100); pvVar2 = malloc(0x100); if (pvVar2 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } iVar10 = 0; *(void **)(in_ECX + 0x160) = pvVar2; do { dVar14 = (double)iVar10 / 255.0; libm_sse2_pow_precise(); *(char *)(iVar10 + *(int *)(in_ECX + 0x160)) = (char)(int)(dVar14 * 255.0 + 0.5); iVar10 = iVar10 + 1; } while (iVar10 < 0x100); return; } LAB_00a9b50b: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } else { if ((*(byte *)(in_ECX + 0x11e) & 2) == 0) { uVar7 = (uint)*(byte *)(in_ECX + 0x177); } else { bVar1 = *(byte *)(in_ECX + 0x175); if (*(byte *)(in_ECX + 0x175) <= *(byte *)(in_ECX + 0x174)) { bVar1 = *(byte *)(in_ECX + 0x174); } uVar7 = (uint)*(byte *)(in_ECX + 0x176); if ((uint)*(byte *)(in_ECX + 0x176) <= (uint)bVar1) { uVar7 = (uint)bVar1; } } uVar4 = *(uint *)(in_ECX + 0x68); uVar7 = -(uint)(uVar7 != 0) & 0x10 - uVar7; if (((uVar4 & 0x400) == 0) || (4 < (int)uVar7)) { if (8 < (int)uVar7) { uVar7 = 8; } } else { uVar7 = 5; } uVar9 = 0; if (-1 < (int)uVar7) { uVar9 = uVar7; } *(uint *)(in_ECX + 0x150) = uVar9 & 0xff; bVar1 = (byte)uVar9; bVar6 = 8 - bVar1; iVar10 = 1 << (bVar6 & 0x1f); _Size = iVar10 * 4; if (_Size == 0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc(_Size); if (pvVar2 == (void *)0x0) goto LAB_00a9b523; uVar4 = *(uint *)(in_ECX + 0x68); } pcVar8 = malloc_exref; *(void **)(in_ECX + 0x168) = pvVar2; iVar11 = 0; if ((uVar4 & 0x480) == 0x400) { if (0 < iVar10) { do { iVar3 = (*pcVar8)(0x200); if (iVar3 == 0) goto LAB_00a9b52f; *(int *)(*(int *)(in_ECX + 0x168) + iVar11 * 4) = iVar3; iVar11 = iVar11 + 1; pcVar8 = malloc_exref; } while (iVar11 < iVar10); } uVar7 = 0; local_10 = 0; do { libm_sse2_pow_precise(); uVar4 = __dtoui3(); if (uVar7 <= uVar4) { uVar12 = uVar7; do { uVar7 = uVar12 + 1; *(ushort *) (*(int *)(*(int *)(in_ECX + 0x168) + (0xff >> (bVar1 & 0x1f) & uVar12) * 4) + (uVar12 >> (bVar6 & 0x1f)) * 2) = (ushort)((local_10 & 0xffff) << 8) | (ushort)local_10 ; uVar12 = uVar7; } while (uVar7 <= uVar4); } local_10 = local_10 + 1; } while ((int)local_10 < 0x100); if (uVar7 < (uint)(iVar10 << 8)) { do { uVar12 = 0xff >> (bVar1 & 0x1f) & uVar7; uVar4 = uVar7 >> (bVar6 & 0x1f); uVar7 = uVar7 + 1; *(undefined2 *)(*(int *)(*(int *)(in_ECX + 0x168) + uVar12 * 4) + uVar4 * 2) = 0xffff; } while (uVar7 < (uint)(iVar10 << 8)); } } else if (0 < iVar10) { do { iVar3 = (*pcVar8)(0x200); if (iVar3 == 0) goto LAB_00a9b52f; *(int *)(*(int *)(in_ECX + 0x168) + iVar11 * 4) = iVar3; iVar3 = *(int *)(&UNK_00b4e860 + uVar9 * 4); iVar13 = 0; do { iVar5 = iVar13 * 0x100 + ((uint)(iVar3 * iVar11) >> 4); dVar14 = ((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) / 65535.0; libm_sse2_pow_precise(); *(short *)(*(int *)(*(int *)(in_ECX + 0x168) + iVar11 * 4) + iVar13 * 2) = (short)(int)(dVar14 * 65535.0 + 0.5); iVar13 = iVar13 + 1; } while (iVar13 < 0x100); iVar11 = iVar11 + 1; pcVar8 = malloc_exref; } while (iVar11 < iVar10); } if ((*(byte *)(in_ECX + 0x68) & 0x80) != 0) { if (_Size == 0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc(_Size); if (pvVar2 == (void *)0x0) { LAB_00a9b52f: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } iVar11 = 0; *(void **)(in_ECX + 0x170) = pvVar2; if (0 < iVar10) { do { pvVar2 = malloc(0x200); if (pvVar2 == (void *)0x0) goto LAB_00a9b53b; *(void **)(*(int *)(in_ECX + 0x170) + iVar11 * 4) = pvVar2; iVar3 = *(int *)(&UNK_00b4e860 + uVar9 * 4); iVar13 = 0; do { iVar5 = iVar13 * 0x100 + ((uint)(iVar3 * iVar11) >> 4); dVar14 = ((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) / 65535.0; libm_sse2_pow_precise(); *(short *)(*(int *)(*(int *)(in_ECX + 0x170) + iVar11 * 4) + iVar13 * 2) = (short)(int)(dVar14 * 65535.0 + 0.5); iVar13 = iVar13 + 1; } while (iVar13 < 0x100); iVar11 = iVar11 + 1; } while (iVar11 < iVar10); } if (iVar10 * 4 == 0) { pvVar2 = (void *)0x0; } else { pvVar2 = malloc(iVar10 * 4); if (pvVar2 == (void *)0x0) { LAB_00a9b53b: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } iVar11 = 0; *(void **)(in_ECX + 0x16c) = pvVar2; if (0 < iVar10) { do { pvVar2 = malloc(0x200); if (pvVar2 == (void *)0x0) goto LAB_00a9b50b; *(void **)(*(int *)(in_ECX + 0x16c) + iVar11 * 4) = pvVar2; iVar3 = *(int *)(&UNK_00b4e860 + uVar9 * 4); iVar13 = 0; do { iVar5 = iVar13 * 0x100 + ((uint)(iVar3 * iVar11) >> 4); dVar14 = ((double)iVar5 + __uint_to_double_fixup[-(iVar5 >> 0x1f)]) / 65535.0; libm_sse2_pow_precise(); *(short *)(*(int *)(*(int *)(in_ECX + 0x16c) + iVar11 * 4) + iVar13 * 2) = (short)(int)(dVar14 * 65535.0 + 0.5); iVar13 = iVar13 + 1; } while (iVar13 < 0x100); iVar11 = iVar11 + 1; } while (iVar11 < iVar10); } } } return; } //@@ 00a9b550 get_sof /* DB: libjpeg(-turbo) jdmarker.c get_sof(cinfo, is_prog, is_lossless, is_arith): JERR_SOF_DUPLICATE (0x3c) if marker->saw_SOF, stores progressive_mode (+0xc9), master->lossless, arith_code (+0xca), reads bytes through src->fill_input_buffer */ uint get_sof(undefined1 param_1,undefined1 param_2) { undefined1 uVar1; undefined1 uVar2; byte bVar3; undefined4 *puVar4; uint uVar5; int iVar6; int *in_ECX; int iVar7; undefined1 in_DL; int iVar8; undefined1 *puVar9; byte *pbVar10; byte *pbVar11; puVar4 = (undefined4 *)in_ECX[6]; puVar9 = (undefined1 *)*puVar4; iVar8 = puVar4[1]; if (*(char *)(in_ECX[0x69] + 0xd) != '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x3c; (**(code **)*in_ECX)(); } *(undefined1 *)((int)in_ECX + 0xc9) = in_DL; *(undefined1 *)(in_ECX[100] + 9) = param_1; *(undefined1 *)((int)in_ECX + 0xca) = param_2; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; puVar9 = (undefined1 *)*puVar4; iVar8 = puVar4[1]; } uVar1 = *puVar9; puVar9 = puVar9 + 1; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; puVar9 = (undefined1 *)*puVar4; iVar8 = puVar4[1]; } uVar2 = *puVar9; pbVar10 = puVar9 + 1; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar10 = (byte *)*puVar4; iVar8 = puVar4[1]; } pbVar11 = pbVar10 + 1; in_ECX[0x30] = (uint)*pbVar10; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar11 = (byte *)*puVar4; iVar8 = puVar4[1]; } pbVar10 = pbVar11 + 1; iVar7 = (uint)*pbVar11 << 8; in_ECX[8] = iVar7; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar10 = (byte *)*puVar4; iVar8 = puVar4[1]; iVar7 = in_ECX[8]; } pbVar11 = pbVar10 + 1; in_ECX[8] = (uint)*pbVar10 + iVar7; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar11 = (byte *)*puVar4; iVar8 = puVar4[1]; } pbVar10 = pbVar11 + 1; iVar7 = (uint)*pbVar11 << 8; in_ECX[7] = iVar7; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar10 = (byte *)*puVar4; iVar8 = puVar4[1]; iVar7 = in_ECX[7]; } pbVar11 = pbVar10 + 1; in_ECX[7] = (uint)*pbVar10 + iVar7; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') { LAB_00a9b8a3: return uVar5 & 0xffffff00; } pbVar11 = (byte *)*puVar4; iVar8 = puVar4[1]; } iVar8 = iVar8 + -1; iVar7 = *in_ECX; pbVar10 = pbVar11 + 1; in_ECX[9] = (uint)*pbVar11; *(int *)(iVar7 + 0x18) = in_ECX[99]; *(int *)(iVar7 + 0x1c) = in_ECX[7]; *(int *)(iVar7 + 0x20) = in_ECX[8]; *(int *)(iVar7 + 0x24) = in_ECX[9]; *(undefined4 *)(*in_ECX + 0x14) = 0x66; (**(code **)(*in_ECX + 4))(in_ECX,1); if (((in_ECX[8] == 0) || (in_ECX[7] == 0)) || (iVar7 = in_ECX[9], iVar7 < 1)) { *(undefined4 *)(*in_ECX + 0x14) = 0x21; (**(code **)*in_ECX)(in_ECX); iVar7 = in_ECX[9]; } if (CONCAT11(uVar1,uVar2) - 8 != iVar7 * 3) { *(undefined4 *)(*in_ECX + 0x14) = 0xc; (**(code **)*in_ECX)(in_ECX); iVar7 = in_ECX[9]; } iVar6 = in_ECX[0x31]; if (iVar6 == 0) { iVar6 = (**(code **)in_ECX[1])(in_ECX,1,in_ECX[9] * 0x58); iVar7 = in_ECX[9]; in_ECX[0x31] = iVar6; } _param_2 = 0; if (0 < iVar7) { _param_1 = (uint *)(iVar6 + 8); do { _param_1[-1] = _param_2; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar10 = (byte *)*puVar4; iVar8 = puVar4[1]; } pbVar11 = pbVar10 + 1; _param_1[-2] = (uint)*pbVar10; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar11 = (byte *)*puVar4; iVar8 = puVar4[1]; } bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; *_param_1 = (uint)(bVar3 >> 4); _param_1[1] = bVar3 & 0xf; iVar8 = iVar8 + -1; if (iVar8 == 0) { uVar5 = (*(code *)puVar4[3])(in_ECX); if ((char)uVar5 == '\0') goto LAB_00a9b8a3; pbVar11 = (byte *)*puVar4; iVar8 = puVar4[1]; } iVar8 = iVar8 + -1; _param_1[2] = (uint)*pbVar11; pbVar10 = pbVar11 + 1; iVar7 = *in_ECX; *(uint *)(iVar7 + 0x18) = _param_1[-2]; *(uint *)(iVar7 + 0x1c) = *_param_1; *(uint *)(iVar7 + 0x20) = _param_1[1]; *(uint *)(iVar7 + 0x24) = _param_1[2]; *(undefined4 *)(*in_ECX + 0x14) = 0x67; (**(code **)(*in_ECX + 4))(in_ECX,1); _param_2 = _param_2 + 1; _param_1 = _param_1 + 0x16; } while ((int)_param_2 < in_ECX[9]); } iVar7 = in_ECX[0x69]; *(undefined1 *)(iVar7 + 0xd) = 1; *puVar4 = pbVar10; puVar4[1] = iVar8; return CONCAT31((int3)((uint)iVar7 >> 8),1); } //@@ 00a9b8b0 get_sos /* DB: libjpeg jdmarker.c: only caller read_markers FUN_00a9cac0; first ERREXIT JERR_SOS_NO_SOF when marker->saw_SOF (+0xd of cinfo->marker) is false, then reads the length and component count bytes through the source manager (fill_input_buffer at src+0xc) */ uint get_sos(void) { undefined1 uVar1; undefined1 uVar2; byte bVar3; int *piVar4; uint uVar5; int iVar6; int *in_ECX; uint uVar7; int *piVar8; uint uVar9; int iVar10; undefined1 *puVar11; byte *pbVar12; uint *puVar13; byte *pbVar14; int *local_18; int local_14; piVar4 = (int *)in_ECX[6]; puVar11 = (undefined1 *)*piVar4; iVar10 = piVar4[1]; if (*(char *)(in_ECX[0x69] + 0xd) == '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x40; (**(code **)*in_ECX)(); } if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; puVar11 = (undefined1 *)*piVar4; iVar10 = piVar4[1]; } uVar1 = *puVar11; puVar11 = puVar11 + 1; iVar10 = iVar10 + -1; if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; puVar11 = (undefined1 *)*piVar4; iVar10 = piVar4[1]; } uVar2 = *puVar11; pbVar12 = puVar11 + 1; iVar10 = iVar10 + -1; if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; pbVar12 = (byte *)*piVar4; iVar10 = piVar4[1]; } bVar3 = *pbVar12; iVar10 = iVar10 + -1; uVar7 = (uint)bVar3; pbVar12 = pbVar12 + 1; *(undefined4 *)(*in_ECX + 0x14) = 0x69; *(uint *)(*in_ECX + 0x18) = uVar7; (**(code **)(*in_ECX + 4))(); if ((((uint)CONCAT11(uVar1,uVar2) != uVar7 * 2 + 6) || (uVar7 == 0)) || (4 < bVar3)) { *(undefined4 *)(*in_ECX + 0x14) = 0xc; (**(code **)*in_ECX)(); } in_ECX[0x4a] = uVar7; local_18 = in_ECX + 0x4b; *local_18 = 0; in_ECX[0x4c] = 0; in_ECX[0x4d] = 0; in_ECX[0x4e] = 0; local_14 = 0; if (bVar3 != 0) { do { if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; pbVar12 = (byte *)*piVar4; iVar10 = piVar4[1]; } uVar9 = (uint)*pbVar12; pbVar12 = pbVar12 + 1; iVar10 = iVar10 + -1; if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; pbVar12 = (byte *)*piVar4; iVar10 = piVar4[1]; } bVar3 = *pbVar12; iVar10 = iVar10 + -1; pbVar12 = pbVar12 + 1; iVar6 = 0; puVar13 = (uint *)in_ECX[0x31]; if (0 < in_ECX[9]) { piVar8 = in_ECX + 0x4b; do { if (3 < iVar6) break; if ((uVar9 == *puVar13) && (*piVar8 == 0)) goto LAB_00a9ba95; iVar6 = iVar6 + 1; piVar8 = piVar8 + 1; puVar13 = puVar13 + 0x16; } while (iVar6 < in_ECX[9]); } *(undefined4 *)(*in_ECX + 0x14) = 4; *(uint *)(*in_ECX + 0x18) = uVar9; (**(code **)*in_ECX)(); LAB_00a9ba95: *local_18 = (int)puVar13; puVar13[5] = (uint)(bVar3 >> 4); puVar13[6] = bVar3 & 0xf; iVar6 = *in_ECX; *(uint *)(iVar6 + 0x18) = uVar9; *(uint *)(iVar6 + 0x1c) = puVar13[5]; *(uint *)(iVar6 + 0x20) = puVar13[6]; *(undefined4 *)(*in_ECX + 0x14) = 0x6a; (**(code **)(*in_ECX + 4))(); if (0 < local_14) { piVar8 = in_ECX + 0x4b; iVar6 = local_14; do { if ((uint *)*piVar8 == puVar13) { *(undefined4 *)(*in_ECX + 0x14) = 4; *(uint *)(*in_ECX + 0x18) = uVar9; (**(code **)*in_ECX)(); } piVar8 = piVar8 + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); } local_18 = local_18 + 1; local_14 = local_14 + 1; } while (local_14 < (int)uVar7); } if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; pbVar12 = (byte *)*piVar4; iVar10 = piVar4[1]; } pbVar14 = pbVar12 + 1; in_ECX[0x5c] = (uint)*pbVar12; iVar10 = iVar10 + -1; if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') goto LAB_00a9bb87; pbVar14 = (byte *)*piVar4; iVar10 = piVar4[1]; } pbVar12 = pbVar14 + 1; in_ECX[0x5d] = (uint)*pbVar14; iVar10 = iVar10 + -1; if (iVar10 == 0) { uVar5 = (*(code *)piVar4[3])(); if ((char)uVar5 == '\0') { LAB_00a9bb87: return uVar5 & 0xffffff00; } pbVar12 = (byte *)*piVar4; iVar10 = piVar4[1]; } bVar3 = *pbVar12; in_ECX[0x5f] = bVar3 & 0xf; iVar6 = *in_ECX; in_ECX[0x5e] = (uint)(bVar3 >> 4); *(int *)(iVar6 + 0x18) = in_ECX[0x5c]; *(int *)(iVar6 + 0x1c) = in_ECX[0x5d]; *(int *)(iVar6 + 0x20) = in_ECX[0x5e]; *(int *)(iVar6 + 0x24) = in_ECX[0x5f]; *(undefined4 *)(*in_ECX + 0x14) = 0x6b; (**(code **)(*in_ECX + 4))(); *(undefined4 *)(in_ECX[0x69] + 0x10) = 0; in_ECX[0x1f] = in_ECX[0x1f] + 1; *piVar4 = (int)(pbVar12 + 1); piVar4[1] = iVar10 + -1; return CONCAT31((int3)((uint)(iVar10 + -1) >> 8),1); } //@@ 00a9bc20 FUN_00a9bc20 uint FUN_00a9bc20(void) { byte bVar1; byte bVar2; undefined4 *puVar3; uint uVar4; uint uVar5; int *in_ECX; byte *pbVar6; int iVar7; byte *local_14; int local_c; puVar3 = (undefined4 *)in_ECX[6]; iVar7 = puVar3[1]; local_14 = (byte *)*puVar3; if (iVar7 == 0) { uVar4 = (*(code *)puVar3[3])(); if ((char)uVar4 == '\0') goto LAB_00a9bd97; local_14 = (byte *)*puVar3; iVar7 = puVar3[1]; } bVar1 = *local_14; local_14 = local_14 + 1; iVar7 = iVar7 + -1; if (iVar7 == 0) { uVar4 = (*(code *)puVar3[3])(); if ((char)uVar4 == '\0') { LAB_00a9bd97: return uVar4 & 0xffffff00; } local_14 = (byte *)*puVar3; iVar7 = puVar3[1]; } local_c = (uint)bVar1 * 0x100 + -2 + (uint)*local_14; local_14 = local_14 + 1; iVar7 = iVar7 + -1; if (0 < local_c) { do { if (iVar7 == 0) { uVar4 = (*(code *)puVar3[3])(); if ((char)uVar4 == '\0') goto LAB_00a9bd97; local_14 = (byte *)*puVar3; iVar7 = puVar3[1]; } bVar1 = *local_14; local_14 = local_14 + 1; uVar5 = (uint)bVar1; iVar7 = iVar7 + -1; if (iVar7 == 0) { uVar4 = (*(code *)puVar3[3])(); if ((char)uVar4 == '\0') goto LAB_00a9bd97; local_14 = (byte *)*puVar3; iVar7 = puVar3[1]; } bVar2 = *local_14; iVar7 = iVar7 + -1; local_14 = local_14 + 1; local_c = local_c + -2; *(undefined4 *)(*in_ECX + 0x14) = 0x51; *(uint *)(*in_ECX + 0x18) = uVar5; *(uint *)(*in_ECX + 0x1c) = (uint)bVar2; (**(code **)(*in_ECX + 4))(); if (bVar1 < 0x20) { pbVar6 = (byte *)(uVar5 + 0xdb + (int)in_ECX); if (bVar1 < 0x10) { *(byte *)(uVar5 + 0xcb + (int)in_ECX) = bVar2 & 0xf; *pbVar6 = bVar2 >> 4; if (bVar2 >> 4 < (bVar2 & 0xf)) { *(undefined4 *)(*in_ECX + 0x14) = 0x1e; *(uint *)(*in_ECX + 0x18) = (uint)bVar2; (**(code **)*in_ECX)(); } } else { *pbVar6 = bVar2; } } else { *(undefined4 *)(*in_ECX + 0x14) = 0x1d; *(uint *)(*in_ECX + 0x18) = uVar5; (**(code **)*in_ECX)(); *(byte *)(uVar5 + 0xdb + (int)in_ECX) = bVar2; } } while (0 < local_c); } if (local_c != 0) { *(undefined4 *)(*in_ECX + 0x14) = 0xc; (**(code **)*in_ECX)(); } *puVar3 = local_14; puVar3[1] = iVar7; return CONCAT31((int3)((uint)local_14 >> 8),1); } //@@ 00a9bdd0 get_dht /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jdmarker.c: called from read_markers (a9ccb2); reads marker length (INPUT_2BYTES via src->fill_input_buffer), loops tables: index byte traced with JTRC_DHT (0x52), 16 bit counts, up to 256 huffval bytes into a local [256] buffer */ undefined4 get_dht(void) { byte bVar1; byte bVar2; undefined4 *puVar3; char cVar4; uint *puVar5; int *in_ECX; int iVar6; int iVar7; uint uVar8; int iVar9; byte *pbVar10; undefined4 *puVar11; byte *local_134; int local_12c; int local_128; int local_124; byte local_11c [256]; uint local_1c; uint uStack_18; uint uStack_14; uint uStack_10; byte local_c; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_11c + 0x118); puVar3 = (undefined4 *)in_ECX[6]; iVar9 = puVar3[1]; pbVar10 = (byte *)*puVar3; if (iVar9 == 0) { cVar4 = (*(code *)puVar3[3])(); if (cVar4 == '\0') { return 0; } pbVar10 = (byte *)*puVar3; iVar9 = puVar3[1]; } bVar1 = *pbVar10; pbVar10 = pbVar10 + 1; iVar9 = iVar9 + -1; if (iVar9 == 0) { cVar4 = (*(code *)puVar3[3])(in_ECX); if (cVar4 == '\0') { return 0; } pbVar10 = (byte *)*puVar3; iVar9 = puVar3[1]; } iVar9 = iVar9 + -1; local_134 = pbVar10 + 1; local_124 = (uint)bVar1 * 0x100 + -2 + (uint)*pbVar10; do { if (local_124 < 0x11) { if (local_124 != 0) { *(undefined4 *)(*in_ECX + 0x14) = 0xc; (**(code **)*in_ECX)(in_ECX); } *puVar3 = local_134; puVar3[1] = iVar9; return 1; } if (iVar9 == 0) { cVar4 = (*(code *)puVar3[3])(in_ECX); if (cVar4 == '\0') { return 0; } local_134 = (byte *)*puVar3; iVar9 = puVar3[1]; } iVar9 = iVar9 + -1; bVar1 = *local_134; uVar8 = (uint)bVar1; local_134 = local_134 + 1; *(undefined4 *)(*in_ECX + 0x14) = 0x52; *(uint *)(*in_ECX + 0x18) = uVar8; (**(code **)(*in_ECX + 4))(in_ECX,1); local_1c = local_1c & 0xffffff00; local_128 = 0; local_12c = 1; do { if (iVar9 == 0) { cVar4 = (*(code *)puVar3[3])(in_ECX); if (cVar4 == '\0') { return 0; } local_134 = (byte *)*puVar3; iVar9 = puVar3[1]; } bVar2 = *local_134; iVar9 = iVar9 + -1; local_11c[local_12c + 0x100] = bVar2; local_134 = local_134 + 1; local_12c = local_12c + 1; local_128 = local_128 + (uint)bVar2; } while (local_12c < 0x11); iVar6 = *in_ECX; *(uint *)(iVar6 + 0x18) = local_1c >> 8 & 0xff; *(uint *)(iVar6 + 0x1c) = local_1c >> 0x10 & 0xff; *(uint *)(iVar6 + 0x20) = local_1c >> 0x18; *(uint *)(iVar6 + 0x24) = uStack_18 & 0xff; *(uint *)(iVar6 + 0x28) = uStack_18 >> 8 & 0xff; *(uint *)(iVar6 + 0x2c) = uStack_18 >> 0x10 & 0xff; *(uint *)(iVar6 + 0x30) = uStack_18 >> 0x18; *(uint *)(iVar6 + 0x34) = uStack_14 & 0xff; *(undefined4 *)(*in_ECX + 0x14) = 0x58; (**(code **)(*in_ECX + 4))(in_ECX,2); iVar6 = *in_ECX; *(uint *)(iVar6 + 0x18) = uStack_14 >> 8 & 0xff; *(uint *)(iVar6 + 0x1c) = uStack_14 >> 0x10 & 0xff; *(uint *)(iVar6 + 0x20) = uStack_14 >> 0x18; *(uint *)(iVar6 + 0x24) = uStack_10 & 0xff; *(uint *)(iVar6 + 0x28) = uStack_10 >> 8 & 0xff; *(uint *)(iVar6 + 0x2c) = uStack_10 >> 0x10 & 0xff; *(uint *)(iVar6 + 0x30) = uStack_10 >> 0x18; *(uint *)(iVar6 + 0x34) = (uint)local_c; *(undefined4 *)(*in_ECX + 0x14) = 0x58; (**(code **)(*in_ECX + 4))(in_ECX,2); if ((0x100 < local_128) || (local_124 + -0x11 < local_128)) { *(undefined4 *)(*in_ECX + 0x14) = 9; (**(code **)*in_ECX)(in_ECX); } local_12c = 0; if (0 < local_128) { do { if (iVar9 == 0) { cVar4 = (*(code *)puVar3[3])(in_ECX); if (cVar4 == '\0') { return 0; } local_134 = (byte *)*puVar3; iVar9 = puVar3[1]; } iVar9 = iVar9 + -1; local_11c[local_12c] = *local_134; local_134 = local_134 + 1; local_12c = local_12c + 1; } while (local_12c < local_128); } memset(local_11c + local_128,0,0x100 - local_128); local_124 = (local_124 + -0x11) - local_128; if ((bVar1 & 0x10) == 0) { if (3 < uVar8) { *(undefined4 *)(*in_ECX + 0x14) = 0x1f; *(uint *)(*in_ECX + 0x18) = uVar8; (**(code **)*in_ECX)(in_ECX); } iVar6 = uVar8 + 0x28; } else { iVar6 = uVar8 - 0x10; if ((iVar6 < 0) || (3 < iVar6)) { *(undefined4 *)(*in_ECX + 0x14) = 0x1f; *(int *)(*in_ECX + 0x18) = iVar6; (**(code **)*in_ECX)(in_ECX); iVar6 = uVar8 + 0x1c; } else { iVar6 = uVar8 + 0x1c; } } puVar5 = (uint *)in_ECX[iVar6]; if (puVar5 == (uint *)0x0) { puVar5 = (uint *)(**(code **)in_ECX[1])(in_ECX,0,0x112); *(undefined1 *)((int)puVar5 + 0x111) = 0; in_ECX[iVar6] = (int)puVar5; } *puVar5 = local_1c; puVar5[1] = uStack_18; puVar5[2] = uStack_14; puVar5[3] = uStack_10; *(byte *)(puVar5 + 4) = local_c; pbVar10 = local_11c; puVar11 = (undefined4 *)(in_ECX[iVar6] + 0x11); for (iVar7 = 0x40; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar11 = *(undefined4 *)pbVar10; pbVar10 = pbVar10 + 4; puVar11 = puVar11 + 1; } } while( true ); } //@@ 00a9c1a0 get_dqt /* DB: libjpeg jdmarker.c: reads 2-byte length from cinfo->src (next_input_byte/bytes_in_buffer/fill_input_buffer), JTRC_DQT(0x53), JERR_DQT_INDEX(0x20), allocs quant_tbl_ptrs[n] at cinfo+0x90, natural-order loop, JTRC_QUANTVALS(0x5f) */ undefined4 get_dqt(void) { byte bVar1; undefined4 *puVar2; int iVar3; char cVar4; uint uVar5; ushort uVar6; int *in_ECX; int iVar7; uint uVar8; int iVar9; int iVar10; byte *pbVar11; ushort *puVar12; int local_18; int *local_14; puVar2 = (undefined4 *)in_ECX[6]; iVar9 = puVar2[1]; pbVar11 = (byte *)*puVar2; if (iVar9 == 0) { cVar4 = (*(code *)puVar2[3])(); if (cVar4 == '\0') { return 0; } pbVar11 = (byte *)*puVar2; iVar9 = puVar2[1]; } bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; iVar9 = iVar9 + -1; if (iVar9 == 0) { cVar4 = (*(code *)puVar2[3])(in_ECX); if (cVar4 == '\0') { return 0; } pbVar11 = (byte *)*puVar2; iVar9 = puVar2[1]; } iVar7 = (uint)bVar1 * 0x100 + -2 + (uint)*pbVar11; iVar9 = iVar9 + -1; pbVar11 = pbVar11 + 1; do { if (iVar7 < 1) { if (iVar7 != 0) { *(undefined4 *)(*in_ECX + 0x14) = 0xc; (**(code **)*in_ECX)(in_ECX); } *puVar2 = pbVar11; puVar2[1] = iVar9; return 1; } if (iVar9 == 0) { cVar4 = (*(code *)puVar2[3])(in_ECX); if (cVar4 == '\0') { return 0; } pbVar11 = (byte *)*puVar2; iVar9 = puVar2[1]; } iVar9 = iVar9 + -1; uVar5 = (uint)(*pbVar11 >> 4); uVar8 = *pbVar11 & 0xf; pbVar11 = pbVar11 + 1; *(undefined4 *)(*in_ECX + 0x14) = 0x53; *(uint *)(*in_ECX + 0x18) = uVar8; *(uint *)(*in_ECX + 0x1c) = uVar5; (**(code **)(*in_ECX + 4))(in_ECX,1); if (3 < uVar8) { *(undefined4 *)(*in_ECX + 0x14) = 0x20; *(uint *)(*in_ECX + 0x18) = uVar8; (**(code **)*in_ECX)(in_ECX); } local_18 = in_ECX[uVar8 + 0x24]; if (local_18 == 0) { local_18 = (**(code **)in_ECX[1])(in_ECX,0,0x82); *(undefined1 *)(local_18 + 0x80) = 0; in_ECX[uVar8 + 0x24] = local_18; } local_14 = &DAT_00b4fd00; do { if (uVar5 == 0) { if (iVar9 == 0) { cVar4 = (*(code *)puVar2[3])(in_ECX); if (cVar4 == '\0') { return 0; } pbVar11 = (byte *)*puVar2; iVar9 = puVar2[1]; } uVar6 = (ushort)*pbVar11; } else { if (iVar9 == 0) { cVar4 = (*(code *)puVar2[3])(in_ECX); if (cVar4 == '\0') { return 0; } pbVar11 = (byte *)*puVar2; iVar9 = puVar2[1]; } bVar1 = *pbVar11; pbVar11 = pbVar11 + 1; iVar9 = iVar9 + -1; if (iVar9 == 0) { cVar4 = (*(code *)puVar2[3])(in_ECX); if (cVar4 == '\0') { return 0; } pbVar11 = (byte *)*puVar2; iVar9 = puVar2[1]; } uVar6 = CONCAT11(bVar1,*pbVar11); } iVar9 = iVar9 + -1; iVar10 = *local_14; pbVar11 = pbVar11 + 1; local_14 = local_14 + 1; *(ushort *)(local_18 + iVar10 * 2) = uVar6; } while ((int)local_14 < 0xb4fe00); if (1 < *(int *)(*in_ECX + 0x68)) { iVar10 = 8; puVar12 = (ushort *)(local_18 + 4); do { iVar3 = *in_ECX; *(uint *)(iVar3 + 0x18) = (uint)puVar12[-2]; *(uint *)(iVar3 + 0x1c) = (uint)puVar12[-1]; *(uint *)(iVar3 + 0x20) = (uint)*puVar12; *(uint *)(iVar3 + 0x24) = (uint)puVar12[1]; *(uint *)(iVar3 + 0x28) = (uint)puVar12[2]; *(uint *)(iVar3 + 0x2c) = (uint)puVar12[3]; *(uint *)(iVar3 + 0x30) = (uint)puVar12[4]; *(uint *)(iVar3 + 0x34) = (uint)puVar12[5]; *(undefined4 *)(*in_ECX + 0x14) = 0x5f; (**(code **)(*in_ECX + 4))(in_ECX,2); puVar12 = puVar12 + 8; iVar10 = iVar10 + -1; } while (iVar10 != 0); } iVar10 = 0x81; if (uVar5 == 0) { iVar10 = 0x41; } iVar7 = iVar7 - iVar10; } while( true ); } //@@ 00a9c450 examine_app0 /* DB: libjpeg jdmarker.c: (datalen, remaining) with EDX data: "JFIF\0" -> saw_JFIF_marker (+0x100), version/density bytes, TRACE JTRC_JFIF 0x59, warn JWRN_JFIF_MAJOR 0x7a, thumbnail JTRC 0x5c; only caller get_interesting_appn FUN_00a9c770 */ void examine_app0(uint param_1,int param_2) { char cVar1; int iVar2; int *in_ECX; byte bVar3; byte bVar4; char *in_EDX; param_2 = param_2 + param_1; if (param_1 < 0xe) { if (5 < param_1) goto LAB_00a9c5db; } else if (*in_EDX == 'J') { if ((((in_EDX[1] == 'F') && (in_EDX[2] == 'I')) && (in_EDX[3] == 'F')) && (in_EDX[4] == '\0')) { *(undefined1 *)(in_ECX + 0x40) = 1; cVar1 = in_EDX[5]; *(char *)((int)in_ECX + 0x101) = cVar1; *(char *)((int)in_ECX + 0x102) = in_EDX[6]; *(char *)((int)in_ECX + 0x103) = in_EDX[7]; *(ushort *)(in_ECX + 0x41) = CONCAT11(in_EDX[8],in_EDX[9]); *(ushort *)((int)in_ECX + 0x106) = CONCAT11(in_EDX[10],in_EDX[0xb]); bVar3 = 1; if (cVar1 != '\x01') { *(undefined4 *)(*in_ECX + 0x14) = 0x7a; *(uint *)(*in_ECX + 0x18) = (uint)*(byte *)((int)in_ECX + 0x101); *(uint *)(*in_ECX + 0x1c) = (uint)*(byte *)((int)in_ECX + 0x102); (**(code **)(*in_ECX + 4))(); bVar3 = *(byte *)((int)in_ECX + 0x101); } iVar2 = *in_ECX; *(uint *)(iVar2 + 0x18) = (uint)bVar3; *(uint *)(iVar2 + 0x1c) = (uint)*(byte *)((int)in_ECX + 0x102); *(uint *)(iVar2 + 0x20) = (uint)*(ushort *)(in_ECX + 0x41); *(uint *)(iVar2 + 0x24) = (uint)*(ushort *)((int)in_ECX + 0x106); *(uint *)(iVar2 + 0x28) = (uint)*(byte *)((int)in_ECX + 0x103); *(undefined4 *)(*in_ECX + 0x14) = 0x59; (**(code **)(*in_ECX + 4))(); bVar3 = in_EDX[0xc]; bVar4 = in_EDX[0xd]; if (bVar3 != 0 || bVar4 != 0) { *(undefined4 *)(*in_ECX + 0x14) = 0x5c; *(uint *)(*in_ECX + 0x18) = (uint)(byte)in_EDX[0xc]; *(uint *)(*in_ECX + 0x1c) = (uint)(byte)in_EDX[0xd]; (**(code **)(*in_ECX + 4))(); bVar4 = in_EDX[0xd]; bVar3 = in_EDX[0xc]; } param_2 = param_2 + -0xe; if (param_2 == (uint)bVar3 * (uint)bVar4 * 3) { return; } *(undefined4 *)(*in_ECX + 0x14) = 0x5a; goto LAB_00a9c66e; } LAB_00a9c5db: if (((*in_EDX == 'J') && (in_EDX[1] == 'F')) && ((in_EDX[2] == 'X' && ((in_EDX[3] == 'X' && (in_EDX[4] == '\0')))))) { cVar1 = in_EDX[5]; iVar2 = *in_ECX; if (cVar1 == '\x10') { *(undefined4 *)(iVar2 + 0x14) = 0x6e; } else { if (cVar1 != '\x11') { if (cVar1 == '\x13') { *(undefined4 *)(iVar2 + 0x14) = 0x70; *(int *)(*in_ECX + 0x18) = param_2; (**(code **)(*in_ECX + 4))(); return; } *(undefined4 *)(iVar2 + 0x14) = 0x5b; *(uint *)(*in_ECX + 0x18) = (uint)(byte)in_EDX[5]; *(int *)(*in_ECX + 0x1c) = param_2; (**(code **)(*in_ECX + 4))(); return; } *(undefined4 *)(iVar2 + 0x14) = 0x6f; } goto LAB_00a9c66e; } } *(undefined4 *)(*in_ECX + 0x14) = 0x4f; LAB_00a9c66e: *(int *)(*in_ECX + 0x18) = param_2; (**(code **)(*in_ECX + 4))(); return; } //@@ 00a9c690 FUN_00a9c690 void FUN_00a9c690(uint param_1,int param_2) { char cVar1; byte bVar2; char cVar3; char cVar4; char cVar5; int iVar6; int *in_ECX; char *in_EDX; if ((((param_1 < 0xc) || (*in_EDX != 'A')) || (in_EDX[1] != 'd')) || (((in_EDX[2] != 'o' || (in_EDX[3] != 'b')) || (in_EDX[4] != 'e')))) { *(undefined4 *)(*in_ECX + 0x14) = 0x50; *(uint *)(*in_ECX + 0x18) = param_1 + param_2; (**(code **)(*in_ECX + 4))(); return; } cVar1 = in_EDX[8]; bVar2 = in_EDX[0xb]; cVar3 = in_EDX[7]; iVar6 = *in_ECX; cVar4 = in_EDX[5]; cVar5 = in_EDX[6]; *(uint *)(iVar6 + 0x20) = (uint)CONCAT11(in_EDX[9],in_EDX[10]); *(uint *)(iVar6 + 0x18) = (uint)CONCAT11(cVar4,cVar5); *(uint *)(iVar6 + 0x1c) = (uint)CONCAT11(cVar3,cVar1); *(uint *)(iVar6 + 0x24) = (uint)bVar2; *(undefined4 *)(*in_ECX + 0x14) = 0x4e; (**(code **)(*in_ECX + 4))(); *(byte *)((int)in_ECX + 0x109) = bVar2; *(undefined1 *)(in_ECX + 0x42) = 1; return; } //@@ 00a9c770 FUN_00a9c770 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00a9c770(int *param_1) { byte bVar1; undefined4 *puVar2; char cVar3; uint uVar4; int iVar5; int iVar6; byte *pbVar7; uint local_28; uint local_24; byte local_18 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_18 + 0x14); puVar2 = (undefined4 *)param_1[6]; iVar6 = puVar2[1]; pbVar7 = (byte *)*puVar2; if (iVar6 == 0) { cVar3 = (*(code *)puVar2[3])(param_1); if (cVar3 == '\0') { return 0; } pbVar7 = (byte *)*puVar2; iVar6 = puVar2[1]; } bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; iVar6 = iVar6 + -1; if (iVar6 == 0) { cVar3 = (*(code *)puVar2[3])(param_1); if (cVar3 == '\0') { return 0; } pbVar7 = (byte *)*puVar2; iVar6 = puVar2[1]; } uVar4 = (uint)bVar1 * 0x100 + -2 + (uint)*pbVar7; iVar6 = iVar6 + -1; pbVar7 = pbVar7 + 1; if ((int)uVar4 < 0xe) { if ((int)uVar4 < 1) { local_24 = 0; goto LAB_00a9c838; } local_24 = uVar4; if (uVar4 == 0) goto LAB_00a9c838; } else { local_24 = 0xe; } local_28 = 0; do { if (iVar6 == 0) { cVar3 = (*(code *)puVar2[3])(param_1); if (cVar3 == '\0') { return 0; } pbVar7 = (byte *)*puVar2; iVar6 = puVar2[1]; } iVar6 = iVar6 + -1; local_18[local_28] = *pbVar7; pbVar7 = pbVar7 + 1; local_28 = local_28 + 1; } while (local_28 < local_24); LAB_00a9c838: iVar5 = uVar4 - local_24; if (param_1[99] == 0xe0) { examine_app0(local_24,iVar5); } else if (param_1[99] == 0xee) { FUN_00a9c690(local_24,iVar5); } else { *(undefined4 *)(*param_1 + 0x14) = 0x46; *(int *)(*param_1 + 0x18) = param_1[99]; (**(code **)*param_1)(param_1); } *puVar2 = pbVar7; puVar2[1] = iVar6; if (0 < iVar5) { (**(code **)(param_1[6] + 0x10))(param_1,iVar5); } return 1; } //@@ 00a9c8e0 FUN_00a9c8e0 undefined4 FUN_00a9c8e0(byte *param_1) { byte bVar1; undefined4 *puVar2; int *piVar3; char cVar4; byte *pbVar5; int iVar6; int iVar7; piVar3 = (int *)param_1; puVar2 = *(undefined4 **)((int)param_1 + 0x18); iVar7 = puVar2[1]; pbVar5 = (byte *)*puVar2; if (iVar7 == 0) { cVar4 = (*(code *)puVar2[3])(param_1); if (cVar4 == '\0') { return 0; } pbVar5 = (byte *)*puVar2; iVar7 = puVar2[1]; } bVar1 = *pbVar5; iVar7 = iVar7 + -1; pbVar5 = pbVar5 + 1; if (iVar7 == 0) { cVar4 = (*(code *)puVar2[3])(param_1); if (cVar4 == '\0') { return 0; } iVar7 = puVar2[1]; pbVar5 = (byte *)*puVar2; } param_1 = pbVar5; iVar6 = (uint)*param_1 + (uint)bVar1 * 0x100 + -2; *(undefined4 *)(*piVar3 + 0x14) = 0x5d; *(int *)(*piVar3 + 0x18) = piVar3[99]; *(int *)(*piVar3 + 0x1c) = iVar6; (**(code **)(*piVar3 + 4))(piVar3,1); *puVar2 = param_1 + 1; puVar2[1] = iVar7 + -1; if (0 < iVar6) { (**(code **)(piVar3[6] + 0x10))(piVar3,iVar6); } return 1; } //@@ 00a9c9a0 FUN_00a9c9a0 uint FUN_00a9c9a0(void) { int *piVar1; byte bVar2; undefined4 *puVar3; uint uVar4; int *in_ECX; int iVar5; byte *pbVar6; puVar3 = (undefined4 *)in_ECX[6]; pbVar6 = (byte *)*puVar3; iVar5 = puVar3[1]; do { if (iVar5 == 0) { uVar4 = (*(code *)puVar3[3])(in_ECX); if ((char)uVar4 == '\0') { LAB_00a9ca50: return uVar4 & 0xffffff00; } pbVar6 = (byte *)*puVar3; iVar5 = puVar3[1]; } bVar2 = *pbVar6; while( true ) { pbVar6 = pbVar6 + 1; iVar5 = iVar5 + -1; if (bVar2 == 0xff) break; *(int *)(in_ECX[0x69] + 0x14) = *(int *)(in_ECX[0x69] + 0x14) + 1; *puVar3 = pbVar6; puVar3[1] = iVar5; if (iVar5 == 0) { uVar4 = (*(code *)puVar3[3])(in_ECX); if ((char)uVar4 == '\0') goto LAB_00a9ca50; pbVar6 = (byte *)*puVar3; iVar5 = puVar3[1]; } bVar2 = *pbVar6; } do { if (iVar5 == 0) { uVar4 = (*(code *)puVar3[3])(in_ECX); if ((char)uVar4 == '\0') goto LAB_00a9ca50; pbVar6 = (byte *)*puVar3; iVar5 = puVar3[1]; } uVar4 = (uint)*pbVar6; iVar5 = iVar5 + -1; pbVar6 = pbVar6 + 1; } while (uVar4 == 0xff); if (uVar4 != 0) { if (*(int *)(in_ECX[0x69] + 0x14) != 0) { *(undefined4 *)(*in_ECX + 0x14) = 0x77; *(undefined4 *)(*in_ECX + 0x18) = *(undefined4 *)(in_ECX[0x69] + 0x14); *(uint *)(*in_ECX + 0x1c) = uVar4; (**(code **)(*in_ECX + 4))(in_ECX,0xffffffff); *(undefined4 *)(in_ECX[0x69] + 0x14) = 0; } in_ECX[99] = uVar4; *puVar3 = pbVar6; puVar3[1] = iVar5; return 1; } piVar1 = (int *)(in_ECX[0x69] + 0x14); *piVar1 = *piVar1 + 2; *puVar3 = pbVar6; puVar3[1] = iVar5; } while( true ); } //@@ 00a9cac0 FUN_00a9cac0 undefined4 FUN_00a9cac0(int *param_1) { byte bVar1; undefined1 uVar2; undefined1 uVar3; undefined4 *puVar4; int *piVar5; char cVar6; byte *pbVar7; uint uVar8; undefined1 *puVar9; undefined1 *puVar10; int iVar11; undefined4 uVar12; undefined4 uVar13; piVar5 = param_1; iVar11 = param_1[99]; LAB_00a9cad0: if (iVar11 == 0) { if (*(char *)(piVar5[0x69] + 0xc) == '\0') { puVar4 = (undefined4 *)piVar5[6]; iVar11 = puVar4[1]; pbVar7 = (byte *)*puVar4; if (iVar11 == 0) { cVar6 = (*(code *)puVar4[3])(piVar5); if (cVar6 == '\0') { return 0; } pbVar7 = (byte *)*puVar4; iVar11 = puVar4[1]; } bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; iVar11 = iVar11 + -1; if (iVar11 == 0) { cVar6 = (*(code *)puVar4[3])(piVar5); if (cVar6 == '\0') { return 0; } pbVar7 = (byte *)*puVar4; iVar11 = puVar4[1]; } uVar8 = (uint)*pbVar7; if ((bVar1 != 0xff) || (uVar8 != 0xd8)) { *(undefined4 *)(*piVar5 + 0x14) = 0x37; *(uint *)(*piVar5 + 0x18) = (uint)bVar1; *(uint *)(*piVar5 + 0x1c) = uVar8; (**(code **)*piVar5)(piVar5); } piVar5[99] = uVar8; puVar4[1] = iVar11 + -1; *puVar4 = pbVar7 + 1; } else { cVar6 = FUN_00a9c9a0(); if (cVar6 == '\0') { return 0; } } } switch(piVar5[99]) { case 1: case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: *(undefined4 *)(*piVar5 + 0x14) = 0x5e; *(int *)(*piVar5 + 0x18) = piVar5[99]; (**(code **)(*piVar5 + 4))(piVar5,1); piVar5[99] = 0; iVar11 = 0; goto LAB_00a9cad0; default: *(undefined4 *)(*piVar5 + 0x14) = 0x46; goto LAB_00a9ce37; case 0xc0: case 0xc1: uVar13 = 0; goto LAB_00a9cc52; case 0xc2: uVar13 = 0; uVar12 = 0; goto LAB_00a9cc56; case 0xc3: uVar13 = 0; uVar12 = 1; goto LAB_00a9cc56; case 0xc4: cVar6 = get_dht(); break; case 0xc5: case 0xc6: case 199: case 200: case 0xcd: case 0xce: case 0xcf: *(undefined4 *)(*piVar5 + 0x14) = 0x3e; LAB_00a9ce37: *(int *)(*piVar5 + 0x18) = piVar5[99]; (**(code **)*piVar5)(piVar5); piVar5[99] = 0; iVar11 = 0; goto LAB_00a9cad0; case 0xc9: uVar13 = 1; LAB_00a9cc52: uVar12 = 0; goto LAB_00a9cc56; case 0xca: uVar13 = 1; uVar12 = 0; goto LAB_00a9cc56; case 0xcb: uVar13 = 1; uVar12 = 1; LAB_00a9cc56: cVar6 = get_sof(uVar12,uVar13); break; case 0xcc: cVar6 = FUN_00a9bc20(); break; case 0xd8: *(undefined4 *)(*piVar5 + 0x14) = 0x68; (**(code **)(*piVar5 + 4))(piVar5,1); if (*(char *)(piVar5[0x69] + 0xc) != '\0') { *(undefined4 *)(*piVar5 + 0x14) = 0x3f; (**(code **)*piVar5)(piVar5); } iVar11 = 0x10; puVar9 = (undefined1 *)((int)piVar5 + 0xdb); do { puVar9[-0x10] = 0; *puVar9 = 1; puVar9[0x10] = 5; iVar11 = iVar11 + -1; puVar9 = puVar9 + 1; } while (iVar11 != 0); piVar5[0x3f] = 0; piVar5[10] = 0; *(undefined2 *)((int)piVar5 + 0x109) = 0; *(undefined2 *)(piVar5 + 0x40) = 0x100; *(undefined4 *)((int)piVar5 + 0x102) = 0x10001; *(undefined2 *)((int)piVar5 + 0x106) = 1; *(undefined1 *)(piVar5 + 0x42) = 0; *(undefined1 *)(piVar5[0x69] + 0xc) = 1; iVar11 = 0; piVar5[99] = 0; goto LAB_00a9cad0; case 0xd9: *(undefined4 *)(*piVar5 + 0x14) = 0x57; (**(code **)(*piVar5 + 4))(piVar5,1); piVar5[99] = 0; return 2; case 0xda: cVar6 = get_sos(); if (cVar6 == '\0') { return 0; } piVar5[99] = 0; return 1; case 0xdb: cVar6 = get_dqt(); break; case 0xdc: cVar6 = FUN_00a9c8e0(piVar5); break; case 0xdd: goto LAB_00a9ccc2; case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef: cVar6 = (**(code **)(piVar5[0x69] + -0x364 + piVar5[99] * 4))(piVar5); break; case 0xfe: cVar6 = (**(code **)(piVar5[0x69] + 0x18))(piVar5); } if (cVar6 == '\0') { return 0; } piVar5[99] = 0; iVar11 = 0; goto LAB_00a9cad0; LAB_00a9ccc2: puVar4 = (undefined4 *)piVar5[6]; iVar11 = puVar4[1]; puVar9 = (undefined1 *)*puVar4; if (iVar11 == 0) { cVar6 = (*(code *)puVar4[3])(piVar5); if (cVar6 == '\0') { return 0; } puVar9 = (undefined1 *)*puVar4; iVar11 = puVar4[1]; } uVar2 = *puVar9; puVar9 = puVar9 + 1; iVar11 = iVar11 + -1; if (iVar11 == 0) { cVar6 = (*(code *)puVar4[3])(piVar5); if (cVar6 == '\0') { return 0; } puVar9 = (undefined1 *)*puVar4; iVar11 = puVar4[1]; } iVar11 = iVar11 + -1; puVar10 = puVar9 + 1; if (CONCAT11(uVar2,*puVar9) != 4) { *(undefined4 *)(*piVar5 + 0x14) = 0xc; (**(code **)*piVar5)(piVar5); } if (iVar11 == 0) { cVar6 = (*(code *)puVar4[3])(piVar5); if (cVar6 == '\0') { return 0; } puVar10 = (undefined1 *)*puVar4; iVar11 = puVar4[1]; } uVar2 = *puVar10; param_1 = (int *)(puVar10 + 1); iVar11 = iVar11 + -1; if (iVar11 == 0) { cVar6 = (*(code *)puVar4[3])(piVar5); if (cVar6 == '\0') { return 0; } param_1 = (int *)*puVar4; iVar11 = puVar4[1]; } uVar3 = *(undefined1 *)param_1; *(undefined4 *)(*piVar5 + 0x14) = 0x54; *(uint *)(*piVar5 + 0x18) = (uint)CONCAT11(uVar2,uVar3); (**(code **)(*piVar5 + 4))(piVar5,1); piVar5[0x3f] = (uint)CONCAT11(uVar2,uVar3); *puVar4 = (undefined1 *)((int)param_1 + 1); puVar4[1] = iVar11 + -1; iVar11 = 0; piVar5[99] = 0; goto LAB_00a9cad0; } //@@ 00a9d000 FUN_00a9d000 uint FUN_00a9d000(int *param_1) { uint uVar1; if (param_1[99] == 0) { uVar1 = FUN_00a9c9a0(); if ((char)uVar1 == '\0') goto LAB_00a9d086; } if (param_1[99] == *(int *)(param_1[0x69] + 0x10) + 0xd0) { *(undefined4 *)(*param_1 + 0x14) = 100; *(undefined4 *)(*param_1 + 0x18) = *(undefined4 *)(param_1[0x69] + 0x10); (**(code **)(*param_1 + 4))(param_1,3); param_1[99] = 0; } else { uVar1 = (**(code **)(param_1[6] + 0x14))(param_1,*(int *)(param_1[0x69] + 0x10)); if ((char)uVar1 == '\0') { LAB_00a9d086: return uVar1 & 0xffffff00; } } *(uint *)(param_1[0x69] + 0x10) = *(int *)(param_1[0x69] + 0x10) + 1U & 7; return 1; } //@@ 00a9d090 FUN_00a9d090 undefined4 FUN_00a9d090(int *param_1,int param_2) { char cVar1; int iVar2; int iVar3; iVar3 = param_1[99]; *(undefined4 *)(*param_1 + 0x14) = 0x7c; *(int *)(*param_1 + 0x18) = iVar3; *(int *)(*param_1 + 0x1c) = param_2; (**(code **)(*param_1 + 4))(param_1,0xffffffff); do { if (iVar3 < 0xc0) { LAB_00a9d0ca: iVar2 = 2; } else if (((iVar3 - 0xd0U < 8) && (iVar3 != (param_2 + 1U & 7) + 0xd0)) && (iVar3 != (param_2 + 2U & 7) + 0xd0)) { if ((iVar3 == (param_2 - 1U & 7) + 0xd0) || (iVar3 == (param_2 - 2U & 7) + 0xd0)) goto LAB_00a9d0ca; iVar2 = 1; } else { iVar2 = 3; } *(undefined4 *)(*param_1 + 0x14) = 99; *(int *)(*param_1 + 0x18) = iVar3; *(int *)(*param_1 + 0x1c) = iVar2; (**(code **)(*param_1 + 4))(param_1,4); if (iVar2 == 1) { param_1[99] = 0; return 1; } if (iVar2 == 2) { cVar1 = FUN_00a9c9a0(); if (cVar1 == '\0') { return 0; } iVar3 = param_1[99]; } else if (iVar2 == 3) { return 1; } } while( true ); } //@@ 00a9d190 FUN_00a9d190 void FUN_00a9d190(int param_1) { int iVar1; iVar1 = *(int *)(param_1 + 0x1a4); *(undefined4 *)(param_1 + 0xc4) = 0; *(undefined4 *)(param_1 + 0x7c) = 0; *(undefined4 *)(param_1 + 0x18c) = 0; *(undefined2 *)(iVar1 + 0xc) = 0; *(undefined4 *)(iVar1 + 0x14) = 0; *(undefined4 *)(iVar1 + 0xa0) = 0; return; } //@@ 00a9d1d0 FUN_00a9d1d0 int FUN_00a9d1d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined1 param_5) { undefined4 *puVar1; int iVar2; puVar1 = (undefined4 *)FUN_0041d4c0(param_1,param_2,param_3,param_4,0,¶m_5); iVar2 = __stdio_common_vsnprintf_s(*puVar1,puVar1[1]); if (iVar2 < 0) { iVar2 = -1; } return iVar2; } //@@ 00a9d210 FUN_00a9d210 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00a9d210(int *param_1) { undefined4 uVar1; undefined1 local_d0 [200]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_d0 + 0xcc); (**(code **)(*param_1 + 0xc))(param_1,local_d0); uVar1 = __acrt_iob_func(2,&DAT_00b6ec00,local_d0); FUN_008c5d50(uVar1); return; } //@@ 00a9d270 FUN_00a9d270 void FUN_00a9d270(int *param_1,int param_2) { int iVar1; int iVar2; iVar1 = *param_1; if (-1 < param_2) { if (param_2 <= *(int *)(iVar1 + 0x68)) { (**(code **)(iVar1 + 8))(param_1); } return; } iVar2 = *(int *)(iVar1 + 0x6c); if ((iVar2 == 0) || (2 < *(int *)(iVar1 + 0x68))) { (**(code **)(iVar1 + 8))(param_1); iVar2 = *(int *)(iVar1 + 0x6c); } *(int *)(iVar1 + 0x6c) = iVar2 + 1; return; } //@@ 00a9d2c0 FUN_00a9d2c0 void FUN_00a9d2c0(int *param_1,undefined4 param_2) { char *pcVar1; char *pcVar2; int iVar3; int iVar4; char cVar5; char *pcVar6; bool bVar7; iVar3 = *param_1; iVar4 = *(int *)(iVar3 + 0x14); if ((iVar4 < 1) || (*(int *)(iVar3 + 0x74) < iVar4)) { if ((*(int *)(iVar3 + 0x78) != 0) && ((*(int *)(iVar3 + 0x7c) <= iVar4 && (iVar4 <= *(int *)(iVar3 + 0x80))))) { pcVar6 = *(char **)(*(int *)(iVar3 + 0x78) + (iVar4 - *(int *)(iVar3 + 0x7c)) * 4); goto LAB_00a9d2fa; } } else { pcVar6 = *(char **)(*(int *)(iVar3 + 0x70) + iVar4 * 4); LAB_00a9d2fa: if (pcVar6 != (char *)0x0) goto LAB_00a9d306; } *(int *)(iVar3 + 0x18) = iVar4; pcVar6 = (char *)**(undefined4 **)(iVar3 + 0x70); LAB_00a9d306: cVar5 = *pcVar6; pcVar2 = pcVar6; do { if (cVar5 == '\0') goto LAB_00a9d320; pcVar1 = pcVar2 + 1; pcVar2 = pcVar2 + 1; bVar7 = cVar5 != '%'; cVar5 = *pcVar1; } while (bVar7); if (*pcVar1 == 's') { FUN_00a9d1d0(param_2,200,0xffffffff,pcVar6,iVar3 + 0x18); return; } LAB_00a9d320: FUN_00a9d1d0(param_2,200,0xffffffff,pcVar6,*(undefined4 *)(iVar3 + 0x18), *(undefined4 *)(iVar3 + 0x1c),*(undefined4 *)(iVar3 + 0x20), *(undefined4 *)(iVar3 + 0x24),*(undefined4 *)(iVar3 + 0x28), *(undefined4 *)(iVar3 + 0x2c),*(undefined4 *)(iVar3 + 0x30), *(undefined4 *)(iVar3 + 0x34)); return; } //@@ 00a9d370 FUN_00a9d370 void FUN_00a9d370(int *param_1) { *(undefined4 *)(*param_1 + 0x6c) = 0; *(undefined4 *)(*param_1 + 0x14) = 0; return; } //@@ 00a9d390 jpeg_CreateDecompress /* DB: libjpeg jdapi.c: keeps err/client_data, memset rest, is_decompressor=1, jinit_memory_mgr inlined (malloc 0x54 method table, max_memory_to_use 1000000000, JERR_OUT_OF_MEMORY 0x38); image_load_jpeg */ void jpeg_CreateDecompress(void) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; int iVar4; void *_Dst; int *in_ECX; iVar4 = *in_ECX; iVar1 = in_ECX[3]; in_ECX[2] = 0; memset((void *)((int)in_ECX + 0x11),0,0x1af); *in_ECX = iVar4; in_ECX[3] = iVar1; *(undefined1 *)(in_ECX + 4) = 1; in_ECX[1] = 0; puVar2 = malloc(0x54); if (puVar2 == (undefined4 *)0x0) { *(undefined4 *)(*in_ECX + 0x14) = 0x38; *(undefined4 *)(*in_ECX + 0x18) = 0; (**(code **)*in_ECX)(); } in_ECX[1] = (int)puVar2; in_ECX[2] = 0; in_ECX[6] = 0; in_ECX[0x24] = 0; in_ECX[0x25] = 0; in_ECX[0x26] = 0; in_ECX[0x27] = 0; *puVar2 = alloc_small; puVar2[1] = FUN_00ab3810; puVar2[2] = alloc_sarray; puVar2[3] = FUN_00ab3b30; puVar2[4] = FUN_00ab3bf0; puVar2[5] = FUN_00ab3c60; puVar2[6] = realize_virt_arrays; puVar2[7] = FUN_00ab4090; puVar2[8] = FUN_00ab4220; puVar2[9] = FUN_00ab4370; puVar2[10] = FUN_00ab4480; puVar2[0xc] = 1000000000; puVar2[0xb] = 0; puVar2[0xe] = 0; puVar2[0x10] = 0; puVar2[0xd] = 0; puVar2[0xf] = 0; in_ECX[0x28] = 0; in_ECX[0x2c] = 0; in_ECX[0x29] = 0; in_ECX[0x2d] = 0; in_ECX[0x2a] = 0; in_ECX[0x2e] = 0; in_ECX[0x2b] = 0; in_ECX[0x2f] = 0; puVar2[0x11] = 0; puVar2[0x12] = 0; puVar2[0x13] = 0x54; in_ECX[0x43] = 0; puVar3 = (undefined4 *)(*(code *)*puVar2)(); in_ECX[0x69] = (int)puVar3; iVar4 = 0x10; *puVar3 = FUN_00a9d190; puVar3[1] = FUN_00a9cac0; puVar3[2] = FUN_00a9d000; puVar3[6] = FUN_00a9c8e0; puVar3[0x17] = 0; puVar2 = puVar3 + 0x18; do { puVar2[-0x11] = FUN_00a9c8e0; *puVar2 = 0; iVar4 = iVar4 + -1; puVar2 = puVar2 + 1; } while (iVar4 != 0); puVar3[7] = FUN_00a9c770; puVar3[0x15] = FUN_00a9c770; iVar4 = in_ECX[0x69]; in_ECX[0x31] = 0; in_ECX[0x1f] = 0; in_ECX[99] = 0; *(undefined2 *)(iVar4 + 0xc) = 0; *(undefined4 *)(iVar4 + 0x14) = 0; *(undefined4 *)(iVar4 + 0xa0) = 0; puVar2 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x68] = (int)puVar2; *puVar2 = FUN_00ab4b10; puVar2[1] = FUN_00ab4be0; puVar2[2] = FUN_00ab4a00; puVar2[3] = FUN_00ab4af0; *(undefined2 *)(puVar2 + 4) = 0; *(undefined1 *)(puVar2 + 5) = 1; in_ECX[0x30] = 8; in_ECX[5] = 200; _Dst = (void *)(**(code **)in_ECX[1])(); in_ECX[100] = (int)_Dst; memset(_Dst,0,0x80); return; } //@@ 00a9d620 default_decompress_parms /* DB: libjpeg(-turbo) jdapimin.c: switch on num_components (+0x24): 1 GRAYSCALE, 3 JFIF/Adobe transform, 4 CMYK/YCCK (JWRN_ADOBE_XFORM 0x74), sets jpeg_color_space (+0x28) / out_color_space (+0x2c); from 00a653f3 */ void default_decompress_parms(void) { int *piVar1; int iVar2; int iVar3; int iVar4; int *in_ECX; int iVar5; iVar5 = in_ECX[9]; if (iVar5 == 1) { in_ECX[10] = 1; in_ECX[0xb] = 1; goto LAB_00a9d7e9; } if (iVar5 != 3) { if (iVar5 == 4) { if (((char)in_ECX[0x42] == '\0') || (*(char *)((int)in_ECX + 0x109) == '\0')) { in_ECX[10] = 4; in_ECX[0xb] = 4; } else { if (*(char *)((int)in_ECX + 0x109) != '\x02') { *(undefined4 *)(*in_ECX + 0x14) = 0x74; *(uint *)(*in_ECX + 0x18) = (uint)*(byte *)((int)in_ECX + 0x109); (**(code **)(*in_ECX + 4))(); } in_ECX[10] = 5; in_ECX[0xb] = 4; } } else { in_ECX[10] = 0; in_ECX[0xb] = 0; } goto LAB_00a9d7e9; } if ((char)in_ECX[0x40] != '\0') { in_ECX[10] = 3; in_ECX[0xb] = 2; goto LAB_00a9d7e9; } if ((char)in_ECX[0x42] == '\0') { piVar1 = (int *)in_ECX[0x31]; iVar5 = *piVar1; iVar2 = piVar1[0x16]; iVar3 = piVar1[0x2c]; if (iVar5 == 1) { if ((iVar2 == 2) && (iVar3 == 3)) { in_ECX[10] = (*(char *)(in_ECX[100] + 9) == '\0') + 2; in_ECX[0xb] = 2; goto LAB_00a9d7e9; } } else if (((iVar5 == 0x52) && (iVar2 == 0x47)) && (iVar3 == 0x42)) { in_ECX[10] = 2; in_ECX[0xb] = 2; goto LAB_00a9d7e9; } iVar4 = *in_ECX; *(int *)(iVar4 + 0x18) = iVar5; *(int *)(iVar4 + 0x1c) = iVar2; *(int *)(iVar4 + 0x20) = iVar3; *(undefined4 *)(*in_ECX + 0x14) = 0x71; (**(code **)(*in_ECX + 4))(); iVar5 = 2; if (*(char *)(in_ECX[100] + 9) == '\0') goto LAB_00a9d7ca; } else { if (*(char *)((int)in_ECX + 0x109) == '\0') { in_ECX[10] = 2; in_ECX[0xb] = 2; goto LAB_00a9d7e9; } if (*(char *)((int)in_ECX + 0x109) != '\x01') { *(undefined4 *)(*in_ECX + 0x14) = 0x74; *(uint *)(*in_ECX + 0x18) = (uint)*(byte *)((int)in_ECX + 0x109); (**(code **)(*in_ECX + 4))(); in_ECX[10] = 3; in_ECX[0xb] = 2; goto LAB_00a9d7e9; } LAB_00a9d7ca: iVar5 = 3; } in_ECX[10] = iVar5; in_ECX[0xb] = 2; LAB_00a9d7e9: in_ECX[0xc] = 1; in_ECX[0xd] = 1; in_ECX[0xe] = 0; in_ECX[0xf] = 0x3ff00000; *(undefined2 *)(in_ECX + 0x10) = 0; in_ECX[0x11] = 0; *(undefined2 *)(in_ECX + 0x12) = 0x101; *(undefined1 *)((int)in_ECX + 0x4a) = 0; in_ECX[0x13] = 2; *(undefined1 *)(in_ECX + 0x14) = 1; in_ECX[0x15] = 0x100; in_ECX[0x1d] = 0; *(undefined2 *)(in_ECX + 0x16) = 0; *(undefined1 *)((int)in_ECX + 0x5a) = 0; return; } //@@ 00a9d840 libjpeg_output_pass_setup /* DB: libjpeg jdapi.c output_pass_setup: if global_state != DSTATE_PRESCAN (0xcc) calls master->prepare_for_output_pass, output_scanline = 0, state = 0xcc; then loops while master->is_dummy_pass (master +8); only caller image_load_jpeg */ uint libjpeg_output_pass_setup(void) { uint *puVar1; code *pcVar2; uint uVar3; int iVar4; int *in_ECX; uint uVar5; uint uVar6; if (in_ECX[5] != 0xcc) { (**(code **)in_ECX[100])(); in_ECX[0x1e] = 0; in_ECX[5] = 0xcc; } if (*(char *)(in_ECX[100] + 8) != '\0') { uVar5 = in_ECX[0x1e]; puVar1 = (uint *)(in_ECX + 0x1e); do { if (uVar5 < (uint)in_ECX[0x18]) { do { uVar6 = uVar5; if (in_ECX[2] != 0) { *(uint *)(in_ECX[2] + 4) = uVar5; *(int *)(in_ECX[2] + 8) = in_ECX[0x18]; (**(code **)in_ECX[2])(); uVar6 = *puVar1; } iVar4 = in_ECX[0x65]; if (in_ECX[0x30] < 9) { if (*(int *)(iVar4 + 4) == 0) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); iVar4 = in_ECX[0x65]; } pcVar2 = *(code **)(iVar4 + 4); } else if (in_ECX[0x30] < 0xd) { if (*(int *)(iVar4 + 8) == 0) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); iVar4 = in_ECX[0x65]; } pcVar2 = *(code **)(iVar4 + 8); } else { if (*(int *)(iVar4 + 0xc) == 0) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); iVar4 = in_ECX[0x65]; } pcVar2 = *(code **)(iVar4 + 0xc); } uVar3 = (*pcVar2)(); uVar5 = *puVar1; if (uVar5 == uVar6) { return uVar3 & 0xffffff00; } } while (uVar5 < (uint)in_ECX[0x18]); } (**(code **)(in_ECX[100] + 4))(); (**(code **)in_ECX[100])(); *puVar1 = 0; uVar5 = 0; } while (*(char *)(in_ECX[100] + 8) != '\0'); } iVar4 = (*(char *)((int)in_ECX + 0x41) != '\0') + 0xcd; in_ECX[5] = iVar4; return CONCAT31((int3)((uint)iVar4 >> 8),1); } //@@ 00a9d9c0 jpeg_read_scanlines /* DB: libjpeg jdapi.c: global_state must be DSTATE_SCANNING 0xcd (JERR_BAD_STATE 0x15), output_scanline >= output_height -> JWRN_TOO_MUCH_DATA 0x7e warning, progress monitor (+8) pass_counter/limit, main->process_data; image_load_jpeg row loop */ undefined4 jpeg_read_scanlines(void) { int iVar1; int *in_ECX; iVar1 = in_ECX[0x30]; if (*(char *)(in_ECX[100] + 9) == '\0') { if (iVar1 == 8) goto LAB_00a9da0b; } else if ((iVar1 < 9) && (1 < iVar1)) goto LAB_00a9da0b; *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); LAB_00a9da0b: if (in_ECX[5] != 0xcd) { *(undefined4 *)(*in_ECX + 0x14) = 0x15; *(int *)(*in_ECX + 0x18) = in_ECX[5]; (**(code **)*in_ECX)(); } if ((uint)in_ECX[0x18] <= (uint)in_ECX[0x1e]) { *(undefined4 *)(*in_ECX + 0x14) = 0x7e; (**(code **)(*in_ECX + 4))(); return 0; } if (in_ECX[2] != 0) { *(int *)(in_ECX[2] + 4) = in_ECX[0x1e]; *(int *)(in_ECX[2] + 8) = in_ECX[0x18]; (**(code **)in_ECX[2])(); } iVar1 = in_ECX[0x65]; if (*(int *)(iVar1 + 4) == 0) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); iVar1 = in_ECX[0x65]; } (**(code **)(iVar1 + 4))(); in_ECX[0x1e] = in_ECX[0x1e]; return 0; } //@@ 00a9dad0 FUN_00a9dad0 undefined4 FUN_00a9dad0(void) { DWORD DVar1; int *in_ECX; if (*in_ECX != 0) { _wassert(L"tls->win32.allocated == GLFW_FALSE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x29); } DVar1 = TlsAlloc(); in_ECX[1] = DVar1; if (DVar1 == 0xffffffff) { _glfwInputError(0x10008,"Win32: Failed to allocate TLS index"); return 0; } *in_ECX = 1; return 1; } //@@ 00a9db20 FUN_00a9db20 void FUN_00a9db20(void) { int *in_ECX; LPVOID in_EDX; if (*in_ECX != 1) { _wassert(L"tls->win32.allocated == GLFW_TRUE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" ,0x45); } TlsSetValue(in_ECX[1],in_EDX); return; } //@@ 00a9db50 _glfwSelectPlatform /* DB: GLFW 3.4 platform.c: 'Invalid platform ID 0x%%08X', 'The requested platform is not supported' via _glfwInputError; only caller FUN_00a6a420 (glfwInit) */ undefined4 _glfwSelectPlatform(void) { undefined4 uVar1; int in_ECX; int iVar2; undefined4 *in_EDX; code **ppcVar3; code *local_124 [4]; code *local_114; code *local_110; code *local_10c; code *local_108; code *local_104; code *local_100; code *local_fc; code *local_f8; code *local_f4; code *local_f0; code *local_ec; undefined1 *local_e8; code *local_e4; code *local_e0; code *local_dc; code *local_d8; code *local_d4; code *local_d0; code *local_cc; code *local_c8; code *local_c4; code *local_c0; code *local_bc; code *local_b8; code *local_b4; code *local_b0; code *local_ac; code *local_a8; code *local_a4; code *local_a0; code *local_9c; code *local_98; code *local_94; code *local_90; code *local_8c; code *local_88; code *local_84; code *local_80; code *local_7c; code *local_78; code *local_74; code *local_70; code *local_6c; code *local_68; code *local_64; code *local_60; code *local_5c; code *local_58; code *local_54; code *local_50; code *local_4c; code *local_48; code *local_44; code *local_40; code *local_3c; code *local_38; code *local_34; code *local_30; code *local_2c; code *local_28; code *local_24; code *local_20; code *local_1c; code *local_18; code *local_14; code *local_10; code *local_c; undefined1 *local_8; if (in_ECX == 0x60000) { uVar1 = _glfwConnectWin32(0x60001); return uVar1; } if ((((in_ECX == 0x60001) || (in_ECX == 0x60002)) || (in_ECX == 0x60003)) || (in_ECX == 0x60004)) { if (in_ECX == 0x60001) { uVar1 = _glfwConnectWin32(); return uVar1; } _glfwInputError(0x1000e,"The requested platform is not supported"); return 0; } if (in_ECX != 0x60005) { _glfwInputError(0x10003,"Invalid platform ID 0x%08X"); return 0; } local_124[0] = (code *)0x60005; local_124[1] = (code *)&LAB_00ab6630; local_124[2] = (code *)&LAB_00ab6a20; local_124[3] = FUN_00acc410; local_114 = FUN_00acc460; local_110 = guard_check_icall; local_10c = guard_check_icall; local_108 = FUN_0042d7e0; local_104 = FUN_0042d7e0; local_100 = FUN_0042d7e0; local_fc = guard_check_icall; local_f8 = guard_check_icall; local_f4 = FUN_00acc4d0; local_f0 = FUN_00acc7a0; local_ec = FUN_00acc490; local_e8 = &LAB_00acc4c0; local_e4 = FUN_0042d7e0; local_e0 = guard_check_icall; local_dc = Weapon::GetFocusEntity; local_d8 = FUN_00a17170; local_d4 = guard_check_icall; local_d0 = FUN_00acc7c0; local_cc = FUN_00acc7e0; local_c8 = FUN_00acc0e0; local_c4 = FUN_00acc800; local_c0 = FUN_00acc840; local_bc = FUN_00acc8b0; local_b8 = FUN_00acc8f0; local_b4 = FUN_00acca40; local_b0 = FUN_00acbc10; local_ac = FUN_00acbdc0; local_a8 = guard_check_icall; local_a4 = guard_check_icall; local_a0 = FUN_00acbe80; local_9c = FUN_00acbeb0; local_98 = FUN_00acbf00; local_94 = FUN_00acbf30; local_90 = FUN_00acc010; local_8c = FUN_00acc010; local_88 = FUN_00acbf00; local_84 = FUN_00acc050; local_80 = FUN_00acc0e0; local_7c = FUN_00acc100; local_78 = FUN_00acc170; local_74 = FUN_00acc1e0; local_70 = FUN_00acc320; local_6c = FUN_00acc340; local_68 = guard_check_icall; local_64 = FUN_00acc370; local_60 = FUN_00acbe10; local_5c = FUN_00acc3d0; local_58 = FUN_00acc3f0; local_54 = FUN_00acc400; local_50 = FUN_00acc210; local_4c = FUN_00acc220; local_48 = FUN_00acc280; local_44 = FUN_00acc2f0; local_40 = FUN_00acc290; local_3c = FUN_00acc2b0; local_38 = FUN_00acc2d0; local_34 = FUN_00acc300; local_30 = guard_check_icall; local_2c = guard_check_icall; local_28 = guard_check_icall; local_24 = guard_check_icall; local_20 = guard_check_icall; local_1c = Weapon::GetFocusEntity; local_18 = Weapon::GetFocusEntity; local_14 = Weapon::GetFocusEntity; local_10 = guard_check_icall; local_c = Weapon::GetFocusEntity; local_8 = &LAB_00acc7b0; ppcVar3 = local_124; for (iVar2 = 0x48; iVar2 != 0; iVar2 = iVar2 + -1) { *in_EDX = *ppcVar3; ppcVar3 = ppcVar3 + 1; in_EDX = in_EDX + 1; } return 1; } //@@ 00a9dea0 FUN_00a9dea0 uint * FUN_00a9dea0(uint *param_1,int param_2,uint *param_3) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; uint uVar8; int iVar9; uint *puVar10; undefined4 uVar11; int *in_ECX; uint uVar12; uint uVar13; uint *puVar14; uint local_14; int local_10; uint local_c; uint local_8; uVar13 = param_2 + 0xfU & 0xfffffff0; local_8 = 0; param_2 = 0; local_10 = param_1[1] + (uint)CARRY4(uVar13,*param_1) + (uint)(0xfffffff0 < uVar13 + *param_1); local_14 = uVar13 + *param_1 + 0xf & 0xfffffff0; FUN_00a9e060(&local_14,&local_8,¶m_2); uVar12 = -1 << ((char)param_2 + 1U & 0x1f) & in_ECX[local_8 + 0x405]; uVar8 = local_8; if (uVar12 == 0) { local_c = -1 << ((char)local_8 + 1U & 0x1f) & in_ECX[0x404]; if (local_c == 0) { return (uint *)0x0; } local_8 = uVar12; uVar8 = FUN_00a9e280(); uVar12 = in_ECX[uVar8 + 0x405]; } local_8 = 0; local_c = uVar12; iVar9 = FUN_00a9e280(); puVar14 = (uint *)in_ECX[uVar8 * 0x20 + iVar9 + 4]; if (puVar14 == (uint *)0x0) { return (uint *)0x0; } FUN_00a9e170(puVar14); *(undefined1 *)(puVar14 + 5) = 0; iVar9 = (uVar13 + 0x1f + (int)puVar14 & ~(uVar13 - 1)) - (int)puVar14; uVar12 = iVar9 - 0x20; if (uVar12 < 0x41) { if ((uVar12 != 0) && (puVar10 = (uint *)puVar14[2], puVar10 != (uint *)0x0)) { uVar13 = *puVar14; uVar1 = puVar14[1]; uVar2 = puVar14[2]; uVar3 = puVar14[3]; uVar4 = puVar14[4]; uVar5 = puVar14[5]; uVar6 = puVar14[6]; uVar7 = puVar14[7]; uVar8 = *puVar10; *puVar10 = *puVar10 + uVar12; puVar10[1] = puVar10[1] + (uint)CARRY4(uVar8,uVar12); puVar14 = (uint *)((int)puVar14 + uVar12); *puVar14 = uVar13 - uVar12; puVar14[1] = uVar1 - (uVar13 < uVar12); puVar14[2] = uVar2; puVar14[3] = uVar3; puVar14[4] = uVar4; puVar14[5] = uVar5; puVar14[6] = uVar6; puVar14[7] = uVar7; uVar12 = *puVar14 + 0x20 + (int)puVar14; uVar12 = -(uint)(uVar12 < (uint)(in_ECX[2] + *in_ECX)) & uVar12; if (uVar12 != 0) { *(uint **)(uVar12 + 8) = puVar14; } } } else { local_c = iVar9 - 0x40; local_8 = 0; puVar10 = (uint *)FUN_00a9e220(puVar14,&local_c); *(undefined1 *)(puVar14 + 5) = 1; FUN_00a9e0f0(puVar14); *(undefined1 *)(puVar10 + 5) = 0; puVar14 = puVar10; } local_10 = param_1[1] + (uint)(0xfffffff0 < *param_1); local_14 = *param_1 + 0xf & 0xfffffff0; local_8 = (puVar14[1] - local_10) - (uint)(*puVar14 < local_14); if ((local_8 != 0) || (0x40 < *puVar14 - local_14)) { uVar11 = FUN_00a9e220(puVar14,&local_14); FUN_00a9e0f0(uVar11); } if (param_3 != (uint *)0x0) { uVar12 = puVar14[1]; *param_3 = *puVar14; param_3[1] = uVar12; } puVar14[4] = 0; puVar14[3] = 0; return puVar14 + 8; } //@@ 00a9e060 FUN_00a9e060 void FUN_00a9e060(uint *param_1,uint *param_2,uint *param_3) { uint uVar1; uint uVar2; uint uVar3; int iVar4; iVar4 = 0; uVar1 = 0x3f; do { uVar3 = 1 << (uVar1 & 0x1f); uVar2 = 0; if (0x1f < uVar1) { uVar2 = uVar3; } uVar3 = uVar3 ^ uVar2; if (0x3f < uVar1) { uVar2 = uVar3; } if ((uVar3 & *param_1) != 0 || (uVar2 & param_1[1]) != 0) break; iVar4 = iVar4 + 1; uVar1 = uVar1 - 1; } while (-1 < (int)uVar1); uVar3 = 0x3b - iVar4; uVar1 = __aullshr(); if ((int)uVar3 < 0) { *param_2 = 0; *param_3 = uVar1 ^ 0x10; return; } if (0x1f < uVar3) { uVar3 = 0x1f; } *param_2 = uVar3; *param_3 = uVar1 ^ 0x10; return; } //@@ 00a9e0f0 FUN_00a9e0f0 void FUN_00a9e0f0(int param_1) { int iVar1; int iVar2; int in_ECX; uint local_c; uint local_8; local_8 = 0; local_c = 0; FUN_00a9e060(param_1,&local_8,&local_c); iVar1 = in_ECX + (local_8 * 0x20 + local_c) * 4; iVar2 = *(int *)(iVar1 + 0x10); *(int *)(param_1 + 0x10) = iVar2; *(undefined4 *)(param_1 + 0xc) = 0; if (iVar2 != 0) { *(int *)(iVar2 + 0xc) = param_1; } *(int *)(iVar1 + 0x10) = param_1; *(uint *)(in_ECX + 0x1010) = *(uint *)(in_ECX + 0x1010) | 1 << (local_8 & 0x1f); *(uint *)(in_ECX + 0x1014 + local_8 * 4) = *(uint *)(in_ECX + 0x1014 + local_8 * 4) | 1 << (local_c & 0x1f); return; } //@@ 00a9e170 FUN_00a9e170 void FUN_00a9e170(int param_1) { int iVar1; int iVar2; uint uVar3; int in_ECX; uint local_c; uint local_8; local_8 = 0; local_c = 0; FUN_00a9e060(param_1,&local_8,&local_c); if (*(int *)(param_1 + 0xc) != 0) { *(undefined4 *)(*(int *)(param_1 + 0xc) + 0x10) = *(undefined4 *)(param_1 + 0x10); } if (*(int *)(param_1 + 0x10) != 0) { *(undefined4 *)(*(int *)(param_1 + 0x10) + 0xc) = *(undefined4 *)(param_1 + 0xc); } iVar2 = local_8 * 0x20 + local_c; iVar1 = in_ECX + iVar2 * 4; if (*(int *)(in_ECX + 0x10 + iVar2 * 4) == param_1) { *(undefined4 *)(iVar1 + 0x10) = *(undefined4 *)(param_1 + 0x10); } *(undefined4 *)(param_1 + 0x10) = 0; *(undefined4 *)(param_1 + 0xc) = 0; if ((*(int *)(iVar1 + 0x10) == 0) && (uVar3 = *(uint *)(in_ECX + 0x1014 + local_8 * 4) & ~(1 << (local_c & 0x1f)), *(uint *)(in_ECX + 0x1014 + local_8 * 4) = uVar3, uVar3 == 0)) { *(uint *)(in_ECX + 0x1010) = *(uint *)(in_ECX + 0x1010) & ~(1 << (local_8 & 0x1f)); } return; } //@@ 00a9e220 FUN_00a9e220 int * FUN_00a9e220(uint *param_1,uint *param_2) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; int *in_ECX; uint uVar5; int *piVar6; uVar4 = *param_1; uVar1 = param_1[1]; piVar6 = (int *)((int)param_1 + *param_2 + 0x20); uVar2 = *param_2; uVar5 = uVar4 - *param_2; uVar3 = param_2[1]; *piVar6 = uVar5 - 0x20; piVar6[2] = (int)param_1; piVar6[1] = ((uVar1 - uVar3) - (uint)(uVar4 < uVar2)) + -1 + (uint)(0x1f < uVar5); *(undefined1 *)(piVar6 + 5) = 1; uVar4 = -(uint)((int)piVar6 + uVar5 < (uint)(in_ECX[2] + *in_ECX)) & (int)piVar6 + uVar5; if (uVar4 != 0) { *(int **)(uVar4 + 8) = piVar6; } uVar4 = param_2[1]; *param_1 = *param_2; param_1[1] = uVar4; return piVar6; } //@@ 00a9e280 FUN_00a9e280 int FUN_00a9e280(void) { uint *in_ECX; uint uVar1; uint uVar2; uint uVar3; int iVar4; iVar4 = 0; uVar2 = 0; while( true ) { uVar3 = 1 << (uVar2 & 0x1f); uVar1 = 0; if (0x1f < uVar2) { uVar1 = uVar3; } uVar3 = uVar3 ^ uVar1; if (0x3f < uVar2) { uVar1 = uVar3; } if ((uVar3 & *in_ECX) != 0 || (uVar1 & in_ECX[1]) != 0) break; uVar2 = uVar2 + 1; iVar4 = iVar4 + 1; if (0x3f < (int)uVar2) { return iVar4; } } return iVar4; } //@@ 00a9e2d0 steam_user_profile_update /* DB: ? Steam glue (param = user profile impl: steam id +8/+0xc, name buffer +0x10, flags +0): if the id is the local SteamUser (ISteamUser vfunc +8 GetSteamID) copies ISteamFriends::GetPersonaName, else GetFriendPersonaName (+0x1c), GetFriendRelationship (+0x14) == 3 sets flag 2 (friend), scans GetFriendCount/GetFriendByIndex(0x200 k_EFriendFlagIgnored) to set flag 4; callers std::map::try_emplace and 00a8c600 */ void steam_user_profile_update(byte *param_1) { void *ptr; uint uVar1; qword qVar2; int *piVar3; undefined4 *puVar4; undefined4 uVar5; int iVar6; qword *pqVar7; int iVar8; longlong lVar9; undefined1 local_20 [8]; undefined1 local_18 [8]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b10fa0; local_10 = ExceptionList; ExceptionList = &local_10; lVar9 = __aullshr(__security_cookie ^ (uint)(local_18 + 0x14)); if (((lVar9 != 0xfefefefe) && (piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c510), *piVar3 != 0)) && (piVar3 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8), *piVar3 != 0)) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c510); piVar3 = (int *)(**(code **)(*(int *)*puVar4 + 8))(local_18); ptr = *(void **)(param_1 + 0x10); if ((*(int *)(param_1 + 8) == *piVar3) && (*(int *)(param_1 + 0xc) == piVar3[1])) { if (ptr != (void *)0x0) { local_8 = 0; tracked_alloc(1,ptr,0); local_8 = 0xffffffff; param_1[0x10] = 0; param_1[0x11] = 0; param_1[0x12] = 0; param_1[0x13] = 0; } puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); (*(code *)**(undefined4 **)*puVar4)(); uVar5 = FUN_00a62dc0(); *(undefined4 *)(param_1 + 0x10) = uVar5; ExceptionList = local_10; return; } if (ptr != (void *)0x0) { if (g_mainHeap == (void *)0x0) { pqVar7 = &g_allocatedBytesNoHeap; } else { pqVar7 = (qword *)((int)g_mainHeap + 0x30); } uVar1 = *(uint *)((int)ptr + -4); qVar2 = *pqVar7; *(uint *)pqVar7 = (uint)*pqVar7 - uVar1; *(uint *)((int)pqVar7 + 4) = *(uint *)((int)pqVar7 + 4) - (uint)((uint)qVar2 < uVar1); free((void *)((int)ptr + -4)); local_8 = 0xffffffff; param_1[0x10] = 0; param_1[0x11] = 0; param_1[0x12] = 0; param_1[0x13] = 0; } puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); (**(code **)(*(int *)*puVar4 + 0x1c)) (*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc)); uVar5 = FUN_00a62dc0(); *(undefined4 *)(param_1 + 0x10) = uVar5; puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); iVar6 = (**(code **)(*(int *)*puVar4 + 0x14)) (*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc)); if (iVar6 == 3) { *param_1 = *param_1 | 2; } puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); iVar6 = (**(code **)(*(int *)*puVar4 + 0xc))(0x200); iVar8 = 0; if (0 < iVar6) { while( true ) { puVar4 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c4f8); piVar3 = (int *)(**(code **)(*(int *)*puVar4 + 0x10))(local_20,iVar8,0x200); if ((*piVar3 == *(int *)(param_1 + 8)) && (piVar3[1] == *(int *)(param_1 + 0xc))) break; iVar8 = iVar8 + 1; if (iVar6 <= iVar8) { ExceptionList = local_10; return; } } *param_1 = *param_1 | 4; } } ExceptionList = local_10; return; } //@@ 00a9e4f0 KAGE::Sound::Manager::Init /* DB: slot 1 of the KAGE::Sound::Manager vtable */ undefined1 KAGE::Sound::Manager::Init(void) { char cVar1; undefined4 uVar2; int in_ECX; undefined4 local_8; cVar1 = ManagerOpenAL::Init(); if (cVar1 == '\0') { return 0; } uVar2 = alcGetProcAddress(*(undefined4 *)(in_ECX + 0x38),"alcDevicePauseSOFT"); *(undefined4 *)(in_ECX + 0x4c) = uVar2; uVar2 = alcGetProcAddress(*(undefined4 *)(in_ECX + 0x38),"alcDeviceResumeSOFT"); *(undefined4 *)(in_ECX + 0x50) = uVar2; uVar2 = alcGetProcAddress(*(undefined4 *)(in_ECX + 0x38),"alcEventControlSOFT"); *(undefined4 *)(in_ECX + 0x54) = uVar2; uVar2 = alcGetProcAddress(*(undefined4 *)(in_ECX + 0x38),"alcEventCallbackSOFT"); *(undefined4 *)(in_ECX + 0x58) = uVar2; uVar2 = alcGetProcAddress(*(undefined4 *)(in_ECX + 0x38),"alcReopenDeviceSOFT"); *(undefined4 *)(in_ECX + 0x5c) = uVar2; LOCK(); *(undefined1 *)(in_ECX + 0x60) = 0; UNLOCK(); cVar1 = alcIsExtensionPresent(0,"ALC_SOFT_system_events"); if (cVar1 == '\x01') { local_8 = 0x19d6; (**(code **)(in_ECX + 0x54))(1,&local_8,1); (**(code **)(in_ECX + 0x58))(FUN_00a9e890); } return 1; } //@@ 00a9e5a0 FUN_00a9e5a0 void FUN_00a9e5a0(void) { qword qVar1; char cVar2; int iVar3; int *in_ECX; qword *pqVar4; uint uVar5; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; local_10 = ExceptionList; ExceptionList = &local_10; local_14 = in_ECX; cVar2 = alcIsExtensionPresent (0,"ALC_SOFT_system_events",__security_cookie ^ (int)register0x00000010 - 4U); if (cVar2 == '\x01') { local_14 = (int *)0x19d6; (*(code *)in_ECX[0x15])(1,&local_14,0); (*(code *)in_ECX[0x16])(0,0); } in_ECX[1] = in_ECX[1] | 4; (**(code **)(in_ECX[0x10] + 0xc))(); iVar3 = in_ECX[2]; g_soundReleaseFn = (void *)0x0; FUN_00a2bcb0(in_ECX + 2,*(undefined4 *)(iVar3 + 4)); *(int *)(iVar3 + 4) = iVar3; *(int *)iVar3 = iVar3; *(int *)(iVar3 + 8) = iVar3; in_ECX[3] = 0; (**(code **)(in_ECX[4] + 8))(); (**(code **)(in_ECX[10] + 8))(); in_ECX[1] = in_ECX[1] & 0xfffffffe; uVar5 = 0; do { (**(code **)(*in_ECX + 0x38))(in_ECX[0xf] + uVar5,in_ECX[0xf] + uVar5 + 4,1); uVar5 = uVar5 + 0xc; } while (uVar5 < 0x300); iVar3 = in_ECX[0xf]; if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } uVar5 = *(uint *)(iVar3 + -4); qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 - uVar5; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) - (uint)((uint)qVar1 < uVar5); free((void *)(iVar3 + -4)); local_8 = 0xffffffff; in_ECX[0xf] = 0; } iVar3 = alGetError(); if (iVar3 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered source shutdown. Error = %d\n"); } if (in_ECX[0xd] != 0) { alcMakeContextCurrent(0); alcDestroyContext(in_ECX[0xd]); in_ECX[0xd] = 0; } if (in_ECX[0xe] != 0) { alcCloseDevice(in_ECX[0xe]); in_ECX[0xe] = 0; } ExceptionList = local_10; return; } //@@ 00a9e720 FUN_00a9e720 /* WARNING: Removing unreachable block (ram,0x00a9e841) */ /* WARNING: Removing unreachable block (ram,0x00a9e850) */ /* WARNING: Removing unreachable block (ram,0x00a9e860) */ /* WARNING: Removing unreachable block (ram,0x00a9e866) */ void FUN_00a9e720(void) { char cVar1; uint uVar2; int in_ECX; undefined4 *puVar3; undefined4 *puVar4; undefined4 *local_28; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b1209d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if (*(char *)(in_ECX + 0x60) != '\0') { KAGE_LogMessage(1,(byte *)"OpenAL-SOFT device has changed, re-opening the device\n"); (**(code **)(in_ECX + 0x4c))(*(undefined4 *)(in_ECX + 0x38)); (**(code **)(in_ECX + 0x5c))(*(undefined4 *)(in_ECX + 0x38),0,0); (**(code **)(in_ECX + 0x50))(*(undefined4 *)(in_ECX + 0x38)); LOCK(); *(undefined1 *)(in_ECX + 0x60) = 0; UNLOCK(); } if (((*(uint *)(in_ECX + 4) & 1) != 0) && ((*(uint *)(in_ECX + 4) & 2) == 0)) { (**(code **)(*(int *)(in_ECX + 0x10) + 0xc))(0xffffffff,uVar2); (**(code **)(*(int *)(in_ECX + 0x28) + 0xc))(0xffffffff); puVar4 = (undefined4 *)0x0; local_28 = (undefined4 *)0x0; local_8 = 0; puVar3 = *(undefined4 **)(in_ECX + 0x1c); if (puVar3 != *(undefined4 **)(in_ECX + 0x20)) { do { cVar1 = (**(code **)(*(int *)*puVar3 + 0x74))(); if (cVar1 != '\0') { if (puVar4 == (undefined4 *)0x0) { std::vector<4byte>::_Emplace_reallocate(0,puVar3); puVar4 = local_28; } else { *puVar4 = *puVar3; local_28 = puVar4 + 1; puVar4 = local_28; } } puVar3 = puVar3 + 1; } while (puVar3 != *(undefined4 **)(in_ECX + 0x20)); } puVar3 = (undefined4 *)0x0; (**(code **)(*(int *)(in_ECX + 0x28) + 0x10))(); if (puVar4 != (undefined4 *)0x0) { do { (**(code **)(*(int *)*puVar3 + 0x3c))(); puVar3 = puVar3 + 1; } while (puVar3 != puVar4); } (**(code **)(*(int *)(in_ECX + 0x10) + 0x10))(); } ExceptionList = local_10; return; } //@@ 00a9e890 FUN_00a9e890 void FUN_00a9e890(int param_1,int param_2) { int in_stack_00000018; if ((param_1 == 0x19d6) && (param_2 == 0x19d4)) { *(undefined1 *)(in_stack_00000018 + 0x60) = 1; KAGE_LogMessage(1,(byte *)"OpenAL-SOFT device has changed\n"); } return; } //@@ 00a9e8c0 multiplayer_connection_state_destroy /* DB: ? destructor-like teardown of a sub-object of MultiplayerManagerBase: if flag bit0 set marks bit1, vfunc +0xc on +0x2c, FUN_00a2a8d0, clears flags; frees map head (+0x38, 0x10) via FUN_00a1a500; only callers FUN_00a73020 and an unwind funclet */ void multiplayer_connection_state_destroy(void) { uint uVar1; byte *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b10960; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((*in_ECX & 1) != 0) { *in_ECX = *in_ECX | 2; (**(code **)(*(int *)(in_ECX + 0x2c) + 0xc))(uVar1); KAGE::ThreadSafeQueue::shutdown(); *in_ECX = *in_ECX & 0xfc; } FUN_00a1a500(); operator_delete(*(void **)(in_ECX + 0x38),0x10); KAGE::Thread::~Thread(in_ECX + 0x2c); KAGE::ThreadSafeQueue::~ThreadSafeQueue(); ExceptionList = local_10; return; } //@@ 00a9e950 FUN_00a9e950 void FUN_00a9e950(byte *param_1) { byte *pbVar1; undefined4 *puVar2; byte bVar3; int iVar4; void **ppvVar5; uint uVar6; undefined4 *puVar7; uint size; void *pvVar8; size_t _Size; int *piVar9; undefined4 local_34; void *local_30; int iStack_2c; int iStack_28; undefined4 uStack_24; undefined4 local_20; undefined4 *local_1c; void *local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b14d6d; uVar6 = __security_cookie ^ (int)register0x00000010 - 4U; bVar3 = *param_1; ppvVar5 = &local_10; local_10 = ExceptionList; do { ExceptionList = ppvVar5; if ((bVar3 & 2) != 0) { ExceptionList = local_10; return; } local_34 = 0; local_30 = (void *)0x0; iStack_2c = 0; iStack_28 = 0; uStack_24 = 0; local_20 = 0; local_8 = 0; (**(code **)(*(int *)(param_1 + 0x20) + 0xc))(0xffffffff,uVar6); if (*(int *)(param_1 + 0x1c) == 0) { (**(code **)(*(int *)(param_1 + 0x20) + 0x10))(); } else { local_1c = *(undefined4 **) (*(int *)(param_1 + 0x10) + (*(int *)(param_1 + 0x14) - 1U & *(uint *)(param_1 + 0x18)) * 4); local_34 = *local_1c; if (&local_30 != (void **)(local_1c + 1)) { local_18 = (void *)local_1c[1]; _Size = local_1c[2] - (int)local_18; if ((uint)(iStack_28 - (int)local_30 >> 3) < (uint)((int)_Size >> 3)) { std::vector<8byte>::_Clear_and_reserve((int)_Size >> 3); } pvVar8 = local_30; memmove(local_30,local_18,_Size); iStack_2c = (int)pvVar8 + _Size; } uStack_24 = local_1c[4]; local_20 = local_1c[5]; iVar4 = *(int *)(*(int *)(param_1 + 0x10) + (*(int *)(param_1 + 0x14) - 1U & *(uint *)(param_1 + 0x18)) * 4); *(undefined4 *)(iVar4 + 0x10) = 0; *(undefined4 *)(iVar4 + 0x14) = 0; std::vector::_Tidy(); pbVar1 = param_1 + 0x1c; *(int *)pbVar1 = *(int *)pbVar1 + -1; if (*(int *)pbVar1 == 0) { param_1[0x18] = 0; param_1[0x19] = 0; param_1[0x1a] = 0; param_1[0x1b] = 0; } else { *(int *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) + 1; } (**(code **)(*(int *)(param_1 + 0x20) + 0x10))(); puVar7 = (undefined4 *)(iStack_2c + -8); puVar2 = (undefined4 *)(iStack_2c + -0x10); iStack_2c = iStack_2c + -0x10; if ((code *)*puVar2 != (code *)0x0) { (*(code *)*puVar2)(&local_34,*puVar7); } } piVar9 = (int *)**(int **)(param_1 + 0x38); if (piVar9 != *(int **)(param_1 + 0x38)) { do { (*(code *)piVar9[2])(piVar9[3]); piVar9 = (int *)*piVar9; } while (piVar9 != (int *)*(int *)(param_1 + 0x38)); } local_8 = 0xffffffff; uStack_24 = 0; local_20 = 0; if (local_30 != (void *)0x0) { size = iStack_28 - (int)local_30 & 0xfffffff8; pvVar8 = local_30; if (0xfff < size) { pvVar8 = *(void **)((int)local_30 + -4); size = size + 0x23; if (0x1f < (uint)((int)local_30 + (-4 - (int)pvVar8))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,size); } bVar3 = *param_1; ppvVar5 = ExceptionList; } while( true ); } //@@ 00a9eb30 FUN_00a9eb30 void FUN_00a9eb30(void) { undefined4 *in_ECX; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; *in_ECX = KAGE::Network::Multiplayer::LobbyLocalhost::vftable; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[10] = 0; *(undefined1 *)(in_ECX + 0xb) = 0; in_ECX[0xc] = 3; *(undefined1 *)(in_ECX + 0xd) = 1; return; } //@@ 00a9eb80 FUN_00a9eb80 void FUN_00a9eb80(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Multiplayer::LobbyLocalhost::vftable; std::vector::_Tidy(); *in_ECX = KAGE::Network::Multiplayer::LobbyImplBase::vftable; std::vector::_Tidy(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x38); } return; } //@@ 00a9ebc0 FUN_00a9ebc0 void FUN_00a9ebc0(void) { undefined4 *in_ECX; *in_ECX = KAGE::Network::Multiplayer::LobbyLocalhost::vftable; std::vector::_Tidy(); *in_ECX = KAGE::Network::Multiplayer::LobbyImplBase::vftable; std::vector::_Tidy(); return; } //@@ 00a9ebe0 FUN_00a9ebe0 undefined4 FUN_00a9ebe0(void) { qword qVar1; undefined4 *puVar2; undefined4 uVar3; qword *pqVar4; if (g_mainHeap == (void *)0x0) { pqVar4 = &g_allocatedBytesNoHeap; } else { pqVar4 = (qword *)((int)g_mainHeap + 0x30); } puVar2 = malloc(0x3c); if (puVar2 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); } else { qVar1 = *pqVar4; *(uint *)pqVar4 = (uint)*pqVar4 + 0x3c; *puVar2 = 0x3c; *(uint *)((int)pqVar4 + 4) = *(uint *)((int)pqVar4 + 4) + (uint)(0xffffffc3 < (uint)qVar1); if (puVar2 != (undefined4 *)0xfffffffc) { uVar3 = FUN_00a9eb30(); return uVar3; } } return 0; } //@@ 00a9ec40 FUN_00a9ec40 void FUN_00a9ec40(int *param_1) { void *_Src; int in_ECX; size_t _Size; void *_Dst; if (param_1 != (int *)(in_ECX + 0x20)) { _Src = *(void **)(in_ECX + 0x20); _Size = *(int *)(in_ECX + 0x24) - (int)_Src; _Dst = (void *)*param_1; if ((uint)(param_1[2] - (int)_Dst >> 3) < (uint)((int)_Size >> 3)) { std::vector<8byte>::_Clear_and_reserve((int)_Size >> 3); _Dst = (void *)*param_1; } memmove(_Dst,_Src,_Size); param_1[1] = (int)_Dst + _Size; } return; } //@@ 00a9eca0 FUN_00a9eca0 undefined1 FUN_00a9eca0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x2c); } //@@ 00a9ecb0 FUN_00a9ecb0 undefined4 * FUN_00a9ecb0(undefined4 *param_1) { void *this; int extraout_EAX; int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b087ed; local_10 = ExceptionList; this = *(void **)(in_ECX + 0x20); if ((uint)(*(int *)(in_ECX + 0x24) - (int)this) < 8) { param_1[1] = 0; *param_1 = KAGE::System::UserProfile::vftable; return param_1; } ExceptionList = &local_10; *param_1 = KAGE::System::UserProfileBase::vftable; UserProfile::find_or_create(this); param_1[1] = extraout_EAX; local_8 = 0; *param_1 = KAGE::System::UserProfile::vftable; if (((extraout_EAX != 0) && (*(int *)(extraout_EAX + 8) != 0 || *(int *)(extraout_EAX + 0xc) != 0) ) && (*(int *)(extraout_EAX + 0x14) == 0)) { KAGE::System::UserProfile::load_steam_avatar(param_1); } ExceptionList = local_10; return param_1; } //@@ 00a9ed50 FUN_00a9ed50 void FUN_00a9ed50(void) { KAGE_LogMessage(8,(byte *)"Localhost lobby values currently not supported\n"); return; } //@@ 00a9ed70 FUN_00a9ed70 byte * FUN_00a9ed70(void) { KAGE_LogMessage(8,(byte *)"Localhost lobby values currently not supported\n"); return &s_empty; } //@@ 00a9ed90 FUN_00a9ed90 undefined4 FUN_00a9ed90(void) { KAGE_LogMessage(8,(byte *)"Localhost lobby values currently not supported\n"); return 0; } //@@ 00a9edb0 FUN_00a9edb0 void FUN_00a9edb0(void) { KAGE_LogMessage(8,(byte *)"Localhost lobby values currently not supported\n"); return; } //@@ 00a9edd0 FUN_00a9edd0 void FUN_00a9edd0(undefined1 param_1) { int in_ECX; *(undefined1 *)(in_ECX + 0x34) = param_1; return; } //@@ 00a9ede0 KAGE::Network::Multiplayer::LobbyLocalhost::add_member /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? if the lobby is full (count byte +0x2c vs members vector +0x20..+0x24) or closed (+0x34/+0x30) replies to the user (FUN_00a2a030); else appends the 64-bit user id, then broadcasts "lhum" and calls Multiplayer member-status 00a2a0b0(lobby, user, 0 = joined); netplay_lobby_host_handle_message */ void KAGE::Network::Multiplayer::LobbyLocalhost::add_member(ulonglong *param_1) { int *piVar1; char cVar2; uint uVar3; void *pvVar4; int extraout_EAX; int extraout_EAX_00; int in_ECX; uint extraout_ECX; uint extraout_ECX_00; uint extraout_ECX_01; uint extraout_ECX_02; undefined **ptr; undefined *puVar5; undefined4 uVar6; undefined **local_44; undefined4 local_40; int *local_3c; undefined **local_38; uint local_34; int local_30; char local_2c [8]; undefined4 local_24; undefined4 local_20; undefined4 local_1c; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14dcd; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_2c + 0x28); ExceptionList = &local_10; local_14 = uVar3; if ((((*(byte *)(in_ECX + 0x2c) == 0) || (piVar1 = *(int **)(in_ECX + 0x24), (uint)*(byte *)(in_ECX + 0x2c) <= (uint)((int)piVar1 - *(int *)(in_ECX + 0x20) >> 3))) || (*(char *)(in_ECX + 0x34) == '\0')) || (*(int *)(in_ECX + 0x30) == 0)) { local_30 = 0; local_34 = 0; local_44 = (undefined **)0x0; local_40 = 0; local_3c = (int *)0x0; local_8 = 0; pvVar4 = (void *)FUN_00a9f4b0(&local_30,uVar3); local_8 = 0xffffffff; if (local_44 != (undefined **)0x0) { uVar3 = (int)local_3c - (int)local_44 & 0xfffffff8; ptr = local_44; if (0xfff < uVar3) { ptr = (undefined **)local_44[-1]; uVar3 = uVar3 + 0x23; if (0x1f < (uint)((int)local_44 + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } local_38 = System::UserProfileBase::vftable; UserProfile::find_or_create(param_1); local_8 = 1; local_38 = System::UserProfile::vftable; uVar3 = extraout_ECX_01; if (((extraout_EAX_00 != 0) && (uVar3 = *(uint *)(extraout_EAX_00 + 8) | *(uint *)(extraout_EAX_00 + 0xc), uVar3 != 0)) && (*(int *)(extraout_EAX_00 + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_38); uVar3 = extraout_ECX_02; } local_8 = 2; FUN_00a2a030(&local_38,uVar3,pvVar4,local_30,uVar3); if (pvVar4 != (void *)0x0) { local_8 = 3; tracked_alloc(1,pvVar4,0); } } else { local_30 = *(int *)((int)param_1 + 4); if ((int)*param_1 != 0 || local_30 != 0) { if (piVar1 == *(int **)(in_ECX + 0x28)) { std::vector<8byte>::_Emplace_reallocate(piVar1,param_1); } else { *piVar1 = (int)*param_1; piVar1[1] = local_30; *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 8; } local_34 = (uint)*(byte *)(in_ECX + 0x2c); local_30 = 0; pvVar4 = (void *)FUN_00a9f4b0(&local_30,uVar3); local_38 = System::UserProfileBase::vftable; UserProfile::find_or_create(param_1); local_8 = 4; local_38 = System::UserProfile::vftable; uVar3 = extraout_ECX; if (((extraout_EAX != 0) && (uVar3 = *(uint *)(extraout_EAX + 8) | *(uint *)(extraout_EAX + 0xc), uVar3 != 0)) && (*(int *)(extraout_EAX + 0x14) == 0)) { System::UserProfile::load_steam_avatar(&local_38); uVar3 = extraout_ECX_00; } local_8 = 5; FUN_00a2a030(&local_38,uVar3,pvVar4,local_30,uVar3); if (pvVar4 != (void *)0x0) { local_8 = 6; tracked_alloc(1,pvVar4,0); } } local_8 = 0xffffffff; uVar6 = 4; puVar5 = &DAT_00ba22d8; strncpy(local_2c,"lhum",4); local_24 = (undefined4)*param_1; local_20 = *(undefined4 *)((int)param_1 + 4); local_1c = 0; FUN_00a2a070(local_20,local_2c,puVar5,uVar6); local_44 = ConstLobby::vftable; local_40 = 0; local_3c = (int *)0x0; local_8 = 7; std::shared_ptr::assign(&local_40,&g_multiplayerLobbyPtr); local_44 = Lobby::vftable; local_8 = 8; ::Multiplayer::handle_member_status(&local_44,param_1,0); local_44 = ConstLobby::vftable; local_8 = 9; if (local_3c != (int *)0x0) { cVar2 = (**(code **)(*local_3c + 0xc))(); if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) { (*g_lobbyReleaseFn)(&local_40); } } } ExceptionList = local_10; return; } //@@ 00a9f0e0 FUN_00a9f0e0 void FUN_00a9f0e0(undefined4 *param_1) { undefined4 *puVar1; undefined4 uVar2; int in_ECX; puVar1 = *(undefined4 **)(in_ECX + 0x24); if (puVar1 == *(undefined4 **)(in_ECX + 0x28)) { std::vector<8byte>::_Emplace_reallocate(puVar1,param_1); return; } uVar2 = param_1[1]; *puVar1 = *param_1; puVar1[1] = uVar2; *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + 8; return; } //@@ 00a9f120 FUN_00a9f120 void FUN_00a9f120(int *param_1) { int *_Src; int *piVar1; int *_Dst; int in_ECX; piVar1 = *(int **)(in_ECX + 0x24); if (*(int **)(in_ECX + 0x20) != piVar1) { _Dst = *(int **)(in_ECX + 0x20); while ((_Src = _Dst + 2, *_Dst != *param_1 || (_Dst[1] != param_1[1]))) { _Dst = _Src; if (_Src == piVar1) { return; } } memmove(_Dst,_Src,(int)piVar1 - (int)_Src); *(int *)(in_ECX + 0x24) = *(int *)(in_ECX + 0x24) + -8; } return; } //@@ 00a9f180 KAGE::Network::Multiplayer::LobbyLocalhost::find_or_create /* DB: ? builds a temporary LobbyLocalhost (vftable 00ba8330) and calls the lobby registry FUN_00a71e10(out, lobbyId) that finds or clones the impl by 64-bit id; same shape as LobbySteam 00a53290; netplay_lobby_host_handle_message */ void KAGE::Network::Multiplayer::LobbyLocalhost::find_or_create(void) { void *in_ECX; uint uVar1; ulonglong *in_EDX; void *pvVar2; undefined **local_4c [2]; undefined8 local_44; void *local_3c; undefined4 local_38; int local_34; void *local_2c; undefined4 local_28; int local_24; undefined1 local_20; undefined4 local_1c; undefined1 local_18; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b14e0d; local_10 = ExceptionList; ExceptionList = &local_10; local_3c = (void *)0x0; local_44 = 0; local_38 = 0; local_34 = 0; local_4c[0] = vftable; local_2c = (void *)0x0; local_28 = 0; local_24 = 0; local_20 = 0; local_1c = 3; local_18 = 1; local_8 = 0; lobby_registry_find_or_create(local_4c,in_ECX,in_EDX); local_4c[0] = vftable; if (local_2c != (void *)0x0) { uVar1 = local_24 - (int)local_2c & 0xfffffff8; pvVar2 = local_2c; if (0xfff < uVar1) { pvVar2 = *(void **)((int)local_2c + -4); uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)local_2c + (-4 - (int)pvVar2))) goto LAB_00a9f283; } operator_delete(pvVar2,uVar1); local_2c = (void *)0x0; local_28 = 0; local_24 = 0; } local_4c[0] = LobbyImplBase::vftable; if (local_3c != (void *)0x0) { uVar1 = local_34 - (int)local_3c & 0xfffffff8; pvVar2 = local_3c; if (0xfff < uVar1) { pvVar2 = *(void **)((int)local_3c + -4); uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar2))) { LAB_00a9f283: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar1); } ExceptionList = local_10; return; } //@@ 00a9f2b0 LobbyLocalhost::read_welcome_message /* DB: ? copies tag "lhwm" into ECX, reads 4-byte tag from the memory stream and dies "Invalid localhost welcome message\n" on mismatch, then member count (*8 bytes, rebuffer) and fields; netplay_lobby_host_handle_message "lhwm" branch */ void LobbyLocalhost::read_welcome_message(void *param_1) { uint uVar1; int iVar2; void *pvVar3; char *in_ECX; undefined **local_40; uint local_3c; undefined4 local_38; void *local_34; void *local_30; int local_2c; void *local_28; int local_24; uint local_20; uint local_1c; undefined **local_18; char local_14 [4]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14e3d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_14 + 0x10); ExceptionList = &local_10; strncpy(in_ECX,"lhwm",4); local_34 = (void *)0x0; local_2c = 0; local_38 = 0xff; local_3c = 0xff; local_28 = param_1; local_1c = 0; local_20 = 0; local_24 = 0; local_30 = (void *)0x0; local_40 = KAGE::Filesys::BufferedStream::vftable; local_18 = KAGE::Filesys::BufferedStream::vftable; local_8 = 0; memory_stream_read(&local_18,local_14,4,1); iVar2 = strncmp(local_14,"lhwm",4); if (iVar2 != 0) { KAGE_LogMessage(0x10,(byte *)"Invalid localhost welcome message\n"); } param_1 = (void *)0x0; if ((code *)local_18[5] == memory_stream_read) { memory_stream_read(&local_18,¶m_1,4,1); } else { (*(code *)local_18[5])(¶m_1,4,1,uVar1); } pvVar3 = local_34; if (local_28 != (void *)0x0) { pvVar3 = local_28; } *(uint *)(in_ECX + 8) = (int)pvVar3 + local_20; local_20 = local_20 + (int)param_1 * 8; *(void **)(in_ECX + 4) = param_1; param_1 = (void *)((int)local_30 - (int)local_34); if (local_28 != (void *)0x0) { param_1 = (void *)local_3c; } if ((local_20 < local_1c) || (param_1 < local_20 - local_1c)) { KAGE::Filesys::BufferedStream::rebuffer(&local_40); } local_24 = local_20 - local_1c; param_1 = (void *)0x0; if ((code *)local_18[5] == memory_stream_read) { memory_stream_read(&local_18,¶m_1,4,1); } else { (*(code *)local_18[5])(¶m_1); } *(void **)(in_ECX + 0xc) = param_1; local_18 = KAGE::Filesys::StreamBase::vftable; local_40 = KAGE::Filesys::BufferedStreamBase::vftable; local_3c = 0; local_38 = 0; local_30 = local_34; local_28 = (void *)0x0; local_24 = 0; local_20 = 0; local_1c = 0; if (local_34 != (void *)0x0) { uVar1 = local_2c - (int)local_34; pvVar3 = local_34; if (0xfff < uVar1) { pvVar3 = *(void **)((int)local_34 + -4); uVar1 = uVar1 + 0x23; if (0x1f < (uint)((int)local_34 + (-4 - (int)pvVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar3,uVar1); } ExceptionList = local_10; return; } //@@ 00a9f4b0 FUN_00a9f4b0 void * FUN_00a9f4b0(size_t *param_1) { uint uVar1; void *_Dst; int *in_ECX; int *in_EDX; void *_Src; undefined **local_40; uint local_3c; undefined4 local_38; void *local_34; void *local_30; void *local_28; undefined4 local_24; undefined4 local_20; undefined4 local_1c; undefined **local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14e3d; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; KAGE::Filesys::BufferedStream::BufferedStream(&local_40,0); local_8 = 0; buffered_stream_write(&local_18,&DAT_00ba232c,4,1); local_14 = in_ECX[1] - *in_ECX >> 3; (*(code *)local_18[7])(&local_14,4,1,uVar1); buffered_stream_write(&local_18,(void *)*in_ECX,8,in_ECX[1] - *in_ECX >> 3); local_14 = *in_EDX; (*(code *)local_18[7])(&local_14,4,1); _Dst = operator_new_tracked(local_3c); _Src = local_34; if (local_28 != (void *)0x0) { _Src = local_28; } memcpy(_Dst,_Src,local_3c); local_18 = KAGE::Filesys::StreamBase::vftable; local_40 = KAGE::Filesys::BufferedStreamBase::vftable; *param_1 = local_3c; local_3c = 0; local_38 = 0; local_30 = local_34; local_28 = (void *)0x0; local_24 = 0; local_20 = 0; local_1c = 0; FUN_007dcd30(); ExceptionList = local_10; return _Dst; } //@@ 00a9f5d0 FUN_00a9f5d0 void FUN_00a9f5d0(void) { int iVar1; undefined4 *puVar2; int in_ECX; undefined4 uStack_10; undefined4 uStack_c; puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c51c); iVar1 = *(int *)(in_ECX + 0x10); if (iVar1 == 0) { uStack_c = 0; uStack_10 = 0; } else { uStack_10 = *(undefined4 *)(iVar1 + 8); uStack_c = *(undefined4 *)(iVar1 + 0xc); } (**(code **)(*(int *)*puVar2 + 0x10))(uStack_10,uStack_c); *(byte *)(in_ECX + 8) = *(byte *)(in_ECX + 8) & 0xfe; return; } //@@ 00a9f630 Entity_Player::AddTrinket /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* ZHL [prefix25/28] __thiscall void Entity_Player::AddTrinket(int type, bool firsttime); */ void __thiscall Entity_Player::AddTrinket(Entity_Player *this,int param_2,char param_3) { uint uVar1; uint unaff_EBX; int unaff_ESI; uint uVar2; int iVar3; uint uVar4; uint unaff_EDI; undefined4 uStack_2c; uint *puStack_28; int iStack_24; int local_1c; undefined1 auStack_18 [12]; uint local_c; local_c = __security_cookie ^ (uint)&uStack_2c; local_1c = param_2; uVar1 = (**(code **)(*(int *)this + 4))(); (**(code **)(*(int *)this + 0x14))(auStack_18,0xc,1); uVar2 = 0xc; if (iStack_24 != 0x46464952) { KAGE_LogMessage(0x10,(byte *)"Not RIFF format.\n"); } if (local_1c != 0x45564157) { KAGE_LogMessage(0x10,(byte *)"Not Wave format.\n"); } if (0xc < uVar1) { do { (**(code **)(*(int *)this + 0x14))(auStack_18 + -0x1c,8,1); iVar3 = uVar2 + 8; if (unaff_ESI == 0x20746d66) { (**(code **)(*(int *)this + 0x14))(uStack_2c,0x10,1); uVar4 = uVar2 + 0x18; if (0x10 < unaff_EBX) { (**(code **)(*(int *)this + 0x14))(auStack_18 + -0x20,2,1); iVar3 = uVar2 + 0x1a; uVar2 = unaff_EDI & 0xffff; LAB_00a9f733: uVar4 = iVar3 + uVar2; if (uVar4 == uVar1) { return; } (**(code **)(*(int *)this + 0xc))(uVar2,1); } } else { if (unaff_ESI != 0x61746164) { uVar2 = unaff_EBX; goto LAB_00a9f733; } if (puStack_28 == (uint *)0x0) { return; } *puStack_28 = unaff_EBX; if (param_3 != '\0') { return; } (**(code **)(*(int *)this + 0x14))(puStack_28[1],1,unaff_EBX); uVar4 = iVar3 + unaff_EBX; } uVar2 = uVar4; } while (uVar4 < uVar1); } return; } //@@ 00a9f760 FUN_00a9f760 void FUN_00a9f760(undefined4 param_1) { void *pvVar1; undefined4 *in_ECX; undefined4 local_10; undefined4 local_c; local_10 = param_1; local_c = 0; in_ECX[1] = param_1; pvVar1 = KAGE_Memory::heap_alloc(0,(ulonglong *)&local_10); *in_ECX = pvVar1; if (pvVar1 == (void *)0x0) { KAGE_LogMessage(8,(byte *)"Failed to allocate memory for sample audio buffer\n"); } return; } //@@ 00a9f7b0 FUN_00a9f7b0 void FUN_00a9f7b0(byte param_1) { char cVar1; uint uVar2; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Sound::SampleSourceBase::vftable; local_8 = 0; if ((int *)in_ECX[0x12] != (int *)0x0) { cVar1 = (**(code **)(*(int *)in_ECX[0x12] + 0xc))(uVar2); if ((cVar1 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(in_ECX + 0x11); } } *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x4c); } ExceptionList = local_10; return; } //@@ 00a9f840 FUN_00a9f840 undefined4 FUN_00a9f840(void) { int in_ECX; return *(undefined4 *)(*(int *)(in_ECX + 0x44) + 4); } //@@ 00a9f850 FUN_00a9f850 undefined4 FUN_00a9f850(void) { int *in_ECX; *(undefined1 *)(in_ECX + 2) = 1; (**(code **)(*in_ECX + 4))(*(undefined4 *)in_ECX[0x11],((undefined4 *)in_ECX[0x11])[1]); return 1; } //@@ 00a9f870 FUN_00a9f870 undefined4 FUN_00a9f870(int *param_1) { int *piVar1; int iVar2; uint uVar3; char cVar4; int *piVar5; int in_ECX; int iVar6; int local_18; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; ExceptionList = &local_10; if (param_1 != (int *)0x0) { piVar1 = *(int **)(in_ECX + 0x48); iVar2 = *(int *)(in_ECX + 0x44); local_18 = 0; local_14 = (int *)0x0; piVar5 = (int *)0x0; iVar6 = 0; if (piVar1 != (int *)0x0) { cVar4 = (**(code **)(*piVar1 + 4))(__security_cookie ^ (int)register0x00000010 - 4U); if (cVar4 == '\0') { piVar5 = local_14; iVar6 = local_18; } else { if (local_14 != (int *)0x0) { cVar4 = (**(code **)(*local_14 + 0xc))(); if ((cVar4 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(&local_18); } } piVar5 = piVar1; iVar6 = iVar2; } } local_14 = (int *)param_1[0x12]; param_1[0x12] = (int)piVar5; local_18 = param_1[0x11]; param_1[0x11] = iVar6; local_8 = 0; if (local_14 != (int *)0x0) { cVar4 = (**(code **)(*local_14 + 0xc))(); if ((cVar4 != '\0') && (DAT_00c7f624 != (code *)0x0)) { (*DAT_00c7f624)(&local_18); } } local_8 = 0xffffffff; (**(code **)(*param_1 + 4))(*(undefined4 *)param_1[0x11],((undefined4 *)param_1[0x11])[1]); iVar2 = *(int *)(in_ECX + 4); param_1[1] = iVar2; ExceptionList = (void *)CONCAT31((int3)((uint)iVar2 >> 8),*(undefined1 *)(in_ECX + 8)); *(undefined1 *)(param_1 + 2) = *(undefined1 *)(in_ECX + 8); } uVar3 = (uint)ExceptionList >> 8; ExceptionList = local_10; return CONCAT31((int3)uVar3,1); } //@@ 00a9f980 FUN_00a9f980 void FUN_00a9f980(void) { int *piVar1; short sVar2; int iVar3; undefined4 *puVar4; int in_ECX; piVar1 = (int *)(in_ECX + 0x44); if ((*(int *)(in_ECX + 0x44) != 0) && (iVar3 = *(int *)(in_ECX + 0x48), iVar3 != 0)) { (**(code **)(*(int *)(iVar3 + 8) + 0xc))(0xffffffff); sVar2 = *(short *)(iVar3 + 4); (**(code **)(*(int *)(iVar3 + 8) + 0x10))(); if (sVar2 == 1) { puVar4 = (undefined4 *)*piVar1; if ((void *)*puVar4 != (void *)0x0) { KAGE_Memory::heap_free(0,(void *)*puVar4); puVar4 = (undefined4 *)*piVar1; } *puVar4 = 0; *(undefined4 *)(*piVar1 + 4) = 0; } } FUN_00a7b940(0); FUN_00a7d160(); return; } //@@ 00a9fa00 FUN_00a9fa00 void FUN_00a9fa00(undefined4 param_1) { int *in_ECX; (**(code **)(*in_ECX + 0x3c))(); FUN_00a9fb80(param_1); return; } //@@ 00a9fa20 FUN_00a9fa20 void FUN_00a9fa20(void) { undefined4 *puVar1; undefined4 *puVar2; undefined4 *in_ECX; puVar1 = in_ECX + 5; *in_ECX = KAGE::Sound::SoundSourceBase::vftable; *(undefined2 *)(in_ECX + 2) = 0; in_ECX[3] = 0; in_ECX[4] = 0; *puVar1 = 0; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; puVar2 = operator_new(8); puVar2[1] = 0; *puVar1 = puVar2; *puVar2 = puVar1; *in_ECX = KAGE::Sound::SoundSourcePlatformBase::vftable; in_ECX[10] = 0; in_ECX[0xb] = 0; in_ECX[0xc] = 0; in_ECX[0xd] = 0; in_ECX[0xe] = 0x3f800000; in_ECX[0xf] = 0; in_ECX[0x10] = 0x3f800000; return; } //@@ 00a9fad0 FUN_00a9fad0 void FUN_00a9fad0(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x44); } return; } //@@ 00a9fb00 FUN_00a9fb00 undefined4 FUN_00a9fb00(int param_1,int param_2) { int iVar1; int *in_ECX; in_ECX[10] = param_1; in_ECX[0xb] = param_2; iVar1 = (**(code **)(*in_ECX + 100))(); if (iVar1 == 0) { iVar1 = (**(code **)(*in_ECX + 0x60))(); in_ECX[0xc] = (-(uint)(iVar1 != 1) & 2) + 0x1100; return 1; } if (iVar1 == 1) { iVar1 = (**(code **)(*in_ECX + 0x60))(); in_ECX[0xc] = (-(uint)(iVar1 != 1) & 2) + 0x1101; return 1; } KAGE_LogMessage(0x10,(byte *)"Unknown audio format."); return 1; } //@@ 00a9fb80 FUN_00a9fb80 void FUN_00a9fb80(void) { int iVar1; int *piVar2; char cVar3; undefined4 uVar4; int *in_ECX; uint uVar5; int iVar6; int local_c; int *local_8; local_8 = in_ECX; cVar3 = (**(code **)(*in_ECX + 0x38))(); if (((cVar3 == '\0') && (in_ECX[10] != 0)) && (in_ECX[0xb] != 0)) { iVar6 = 0; uVar5 = 0; while ((alGetSourcei(*(undefined4 *)(uVar5 + DAT_00c5aadc),0x1010,&local_c), local_c == 0x1012 || (local_c == 0x1013))) { uVar5 = uVar5 + 0xc; iVar6 = iVar6 + 1; if (0x2ff < uVar5) { return; } } iVar1 = *(int *)(DAT_00c5aadc + 8 + iVar6 * 0xc); if ((iVar1 != 0) && (*(int *)(iVar1 + 0x34) == *(int *)(DAT_00c5aadc + iVar6 * 0xc))) { *(undefined4 *)(iVar1 + 0x34) = 0; } alSourceStop(*(undefined4 *)(DAT_00c5aadc + iVar6 * 0xc)); alSourcei(*(undefined4 *)(DAT_00c5aadc + iVar6 * 0xc),0x1009,0); piVar2 = local_8; *(int **)(DAT_00c5aadc + 8 + iVar6 * 0xc) = local_8; local_8[0xd] = *(int *)(DAT_00c5aadc + iVar6 * 0xc); local_8 = *(int **)(DAT_00c5aadc + 4 + iVar6 * 0xc); iVar6 = alGetError(); if (iVar6 == 0) { alSourcei(piVar2[0xd],0x1007,*(undefined1 *)((int)piVar2 + 9)); uVar4 = (**(code **)(*piVar2 + 0x68))(); alBufferData(local_8,piVar2[0xc],piVar2[10],piVar2[0xb],uVar4); alSourcei(piVar2[0xd],0x1009,local_8); (**(code **)(*piVar2 + 0x48))(piVar2[0xe]); (**(code **)(*piVar2 + 0x50))(piVar2[0xf]); (**(code **)(*piVar2 + 0x58))(piVar2[0x10]); alSourcePlay(piVar2[0xd]); iVar6 = alGetError(); if (iVar6 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } else { KAGE_LogMessage(8,(byte *)"OpenAL error encountered when assigning source data. Error = %d\n") ; } } return; } //@@ 00a9fd40 FUN_00a9fd40 void FUN_00a9fd40(void) { char cVar1; int iVar2; int *in_ECX; if (in_ECX[0xd] != 0) { cVar1 = (**(code **)(*in_ECX + 0x38))(); if (cVar1 != '\0') { alSourcePause(in_ECX[0xd]); iVar2 = alGetError(); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } } return; } //@@ 00a9fd90 FUN_00a9fd90 void FUN_00a9fd90(void) { char cVar1; int iVar2; int *in_ECX; if (in_ECX[0xd] != 0) { cVar1 = (**(code **)(*in_ECX + 0x38))(); if (cVar1 == '\0') { alSourcePlay(in_ECX[0xd]); iVar2 = alGetError(); if (iVar2 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } } return; } //@@ 00a9fde0 FUN_00a9fde0 bool FUN_00a9fde0(void) { int iVar1; int in_ECX; int local_8; if (*(int *)(in_ECX + 0x34) == 0) { return false; } local_8 = 0; alGetSourcei(*(int *)(in_ECX + 0x34),0x1010,&local_8); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } return local_8 == 0x1012; } //@@ 00a9fe40 FUN_00a9fe40 void FUN_00a9fe40(void) { int iVar1; int in_ECX; int local_8; if (*(int *)(in_ECX + 0x34) != 0) { local_8 = 0; alGetSourcei(*(int *)(in_ECX + 0x34),0x1010,&local_8); if (local_8 != 0x1014) { alSourceStop(*(undefined4 *)(in_ECX + 0x34)); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } } return; } //@@ 00a9feb0 FUN_00a9feb0 void FUN_00a9feb0(char param_1) { int iVar1; int in_ECX; if (param_1 != *(char *)(in_ECX + 9)) { if (*(int *)(in_ECX + 0x34) != 0) { alSourcei(*(int *)(in_ECX + 0x34),0x1007,param_1); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } *(char *)(in_ECX + 9) = param_1; } return; } //@@ 00a9ff10 FUN_00a9ff10 void FUN_00a9ff10(undefined4 param_1) { int iVar1; int in_ECX; *(undefined4 *)(in_ECX + 0x38) = param_1; if (*(int *)(in_ECX + 0x34) != 0) { alSourcef(*(int *)(in_ECX + 0x34),0x100a,param_1); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } return; } //@@ 00a9ff60 FUN_00a9ff60 float10 FUN_00a9ff60(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x38); } //@@ 00a9ff90 FUN_00a9ff90 void FUN_00a9ff90(float param_1) { int iVar1; int in_ECX; float fVar2; float fVar3; undefined4 uVar4; iVar1 = *(int *)(in_ECX + 0x34); *(float *)(in_ECX + 0x3c) = param_1; if (iVar1 != 0) { fVar2 = sin((param_1 + 1.0) * 3.1415927 * 0.5); uVar4 = 0; fVar3 = cos((param_1 - 1.0) * 3.1415927 * 0.5); alSource3f(iVar1,0x1004,fVar3,uVar4,fVar2); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } return; } //@@ 00aa0040 FUN_00aa0040 float10 FUN_00aa0040(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x3c); } //@@ 00aa0050 FUN_00aa0050 void FUN_00aa0050(undefined4 param_1) { int iVar1; int in_ECX; *(undefined4 *)(in_ECX + 0x40) = param_1; if (*(int *)(in_ECX + 0x34) != 0) { alSourcef(*(int *)(in_ECX + 0x34),0x1003,param_1); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"%s encountered OpenAL error: %d\n"); } } return; } //@@ 00aa00a0 FUN_00aa00a0 float10 FUN_00aa00a0(void) { int in_ECX; return (float10)*(float *)(in_ECX + 0x40); } //@@ 00aa00b0 FUN_00aa00b0 void FUN_00aa00b0(void) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; ExceptionList = &local_10; if ((void *)in_ECX[1] != (void *)0x0) { KAGE_Memory::heap_free(0,(void *)in_ECX[1]); in_ECX[1] = 0; } *in_ECX = 0; in_ECX[2] = 0; ExceptionList = local_10; return; } //@@ 00aa0110 FUN_00aa0110 void FUN_00aa0110(void) { uint uVar1; undefined4 *in_ECX; undefined4 *puVar2; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14e6d; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00a9fa20(__security_cookie ^ (int)register0x00000010 - 4U); *in_ECX = KAGE::Sound::StreamSourcePlatformBase::vftable; puVar2 = in_ECX + 0x11; uVar1 = 0; do { *puVar2 = 0; puVar2 = puVar2 + 1; *(undefined1 *)((int)in_ECX + uVar1 + 0x54) = 1; uVar1 = uVar1 + 1; } while (uVar1 < 4); local_8 = 0; *in_ECX = KAGE::Sound::StreamSourceBase::vftable; in_ECX[0x16] = 0; _eh_vector_constructor_iterator_(in_ECX + 0x17,0xc,4,FUN_00424510,FUN_00aa00b0); in_ECX[0x23] = 0; *(undefined1 *)(in_ECX + 0x24) = 0; ExceptionList = local_10; return; } //@@ 00aa01c0 FUN_00aa01c0 void FUN_00aa01c0(byte param_1) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_8 = 0; *in_ECX = KAGE::Sound::StreamSourceBase::vftable; _eh_vector_destructor_iterator_(in_ECX + 0x17,0xc,4,FUN_00aa00b0); *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(uVar1); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x94); } ExceptionList = local_10; return; } //@@ 00aa0240 FUN_00aa0240 void FUN_00aa0240(void) { uint uVar1; undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0d10; local_10 = ExceptionList; uVar1 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; *in_ECX = KAGE::Sound::StreamSourceBase::vftable; _eh_vector_destructor_iterator_(in_ECX + 0x17,0xc,4,FUN_00aa00b0); *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(uVar1); ExceptionList = local_10; return; } //@@ 00aa02a0 FUN_00aa02a0 undefined4 FUN_00aa02a0(void) { return 0x40000; } //@@ 00aa02b0 FUN_00aa02b0 uint FUN_00aa02b0(void) { void *pvVar1; int iVar2; uint extraout_EAX; uint uVar3; int *in_ECX; int iVar4; int *piVar5; undefined4 local_10; undefined4 local_c; iVar4 = 4; piVar5 = in_ECX + 0x19; do { local_10 = 0x10000; local_c = 0; pvVar1 = KAGE_Memory::heap_alloc(0,(ulonglong *)&local_10); piVar5[-1] = (int)pvVar1; if (((char)in_ECX[0x24] == '\0') && (pvVar1 != (void *)0x0)) { iVar2 = (**(code **)(*in_ECX + 0x6c))(pvVar1); if (iVar2 < 1) { piVar5[-2] = 0; if ((iVar2 == 0) && (*(char *)((int)in_ECX + 9) == '\0')) { *(undefined1 *)(in_ECX + 0x24) = 1; } } else { *piVar5 = iVar2; piVar5[-2] = 2; } } piVar5 = piVar5 + 3; iVar4 = iVar4 + -1; } while (iVar4 != 0); alGenSources(1,in_ECX + 0xd); iVar4 = alGetError(); if (iVar4 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered when creating source object. Error = %d\n"); return extraout_EAX & 0xffffff00; } alGenBuffers(4,in_ECX + 0x11); iVar4 = alGetError(); if (iVar4 == 0) { *(undefined1 *)(in_ECX + 2) = 1; return 1; } KAGE_LogMessage(8,(byte *)"OpenAL error encountered when creating buffer object. Error = %d\n"); uVar3 = alDeleteSources(1,in_ECX + 0xd); return uVar3 & 0xffffff00; } //@@ 00aa03c0 FUN_00aa03c0 undefined1 FUN_00aa03c0(void) { KAGE_LogMessage(0x10,(byte *)"Cloning sound streams is not currently supported\n"); return 0; } //@@ 00aa03e0 FUN_00aa03e0 void FUN_00aa03e0(void) { int in_ECX; undefined4 *puVar1; int iVar2; if (*(undefined4 **)(in_ECX + 0x58) != (undefined4 *)0x0) { (**(code **)**(undefined4 **)(in_ECX + 0x58))(1); *(undefined4 *)(in_ECX + 0x58) = 0; } FUN_00a2ba90(in_ECX); puVar1 = (undefined4 *)(in_ECX + 0x60); iVar2 = 4; do { if ((void *)*puVar1 != (void *)0x0) { KAGE_Memory::heap_free(0,(void *)*puVar1); *puVar1 = 0; } puVar1[1] = 0; puVar1[-1] = 0; puVar1 = puVar1 + 3; iVar2 = iVar2 + -1; } while (iVar2 != 0); *(undefined1 *)(in_ECX + 0x90) = 0; *(undefined1 *)(in_ECX + 9) = 0; FUN_00a7d160(); alDeleteSources(1,(undefined4 *)(in_ECX + 0x34)); alDeleteBuffers(4,(undefined4 *)(in_ECX + 0x44)); *(undefined4 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x50) = 0; return; } //@@ 00aa0470 FUN_00aa0470 void FUN_00aa0470(void) { char cVar1; int *in_ECX; FUN_00a2ba90(in_ECX); cVar1 = (**(code **)(*in_ECX + 0x38))(); if (cVar1 == '\0') { return; } FUN_00a9fe40(); return; } //@@ 00aa0490 FUN_00aa0490 void FUN_00aa0490(void) { uint uVar1; int *in_ECX; int *piVar2; uint uVar3; int iVar4; uint local_14; int local_10; int *local_c; uint local_8; local_14 = 0; local_c = in_ECX + 0x17; do { if (*local_c == 3) { local_8 = 0; alGetSourcei(in_ECX[0xd],0x1016,&local_8); uVar3 = 0; if (local_8 != 0) { do { local_10 = 0; alSourceUnqueueBuffers(in_ECX[0xd],1,&local_10); piVar2 = in_ECX + 0x11; uVar1 = 0; do { if (local_10 == *piVar2) { *(undefined1 *)(uVar1 + 0x54 + (int)in_ECX) = 1; break; } uVar1 = uVar1 + 1; piVar2 = piVar2 + 1; } while (uVar1 < 4); uVar3 = uVar3 + 1; } while (uVar3 < local_8); } if (*(char *)((int)in_ECX + local_14 + 0x54) != '\0') { *local_c = 0; } } piVar2 = in_ECX + 0x17; if (((char)in_ECX[0x24] == '\0') && (*local_c == 0)) { if (in_ECX[local_14 * 3 + 0x18] != 0) { iVar4 = (**(code **)(*in_ECX + 0x6c))(in_ECX[local_14 * 3 + 0x18]); if (iVar4 < 1) { in_ECX[local_14 * 3 + 0x17] = 0; if ((iVar4 == 0) && (*(char *)((int)in_ECX + 9) == '\0')) { *(undefined1 *)(in_ECX + 0x24) = 1; } } else { in_ECX[local_14 * 3 + 0x19] = iVar4; in_ECX[local_14 * 3 + 0x17] = 2; } } goto LAB_00aa0580; } local_14 = local_14 + 1; local_c = local_c + 3; if (3 < local_14) { LAB_00aa0580: iVar4 = 4; do { if (*piVar2 == 2) { (**(code **)(*in_ECX + 4))(piVar2[1],piVar2[2]); *piVar2 = 3; } piVar2 = piVar2 + 3; iVar4 = iVar4 + -1; } while (iVar4 != 0); (**(code **)(*in_ECX + 0x78))(); return; } } while( true ); } //@@ 00aa05c0 FUN_00aa05c0 uint FUN_00aa05c0(void) { int *in_EAX; int in_ECX; uint uVar1; if (*(char *)(in_ECX + 0x90) != '\0') { uVar1 = 0; in_EAX = (int *)(in_ECX + 0x5c); while (*in_EAX == 0) { uVar1 = uVar1 + 1; in_EAX = in_EAX + 3; if (3 < uVar1) { return CONCAT31((int3)((uint)in_EAX >> 8),1); } } } return (uint)in_EAX & 0xffffff00; } //@@ 00aa05f0 FUN_00aa05f0 undefined1 FUN_00aa05f0(void) { int in_ECX; return *(undefined1 *)(in_ECX + 0x90); } //@@ 00aa0600 FUN_00aa0600 void FUN_00aa0600(byte param_1) { undefined4 *in_ECX; *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x58); } return; } //@@ 00aa0630 FUN_00aa0630 void FUN_00aa0630(void) { undefined4 *in_ECX; *in_ECX = KAGE::Sound::SoundSourceBase::vftable; std::deque<12byte>::~deque(); return; } //@@ 00aa0640 FUN_00aa0640 undefined4 FUN_00aa0640(undefined4 param_1,int param_2) { char cVar1; int iVar2; undefined4 uVar3; int *in_ECX; uint uVar4; iVar2 = (**(code **)(*in_ECX + 100))(); if (iVar2 == 0) { iVar2 = (**(code **)(*in_ECX + 0x60))(); iVar2 = (-(uint)(iVar2 != 1) & 2) + 0x1100; } else if (iVar2 == 1) { iVar2 = (**(code **)(*in_ECX + 0x60))(); iVar2 = (-(uint)(iVar2 != 1) & 2) + 0x1101; } else { KAGE_LogMessage(0x10,(byte *)"Unknown audio format."); iVar2 = param_2; } uVar4 = 0; do { if (*(char *)((int)in_ECX + uVar4 + 0x54) != '\0') { uVar3 = (**(code **)(*in_ECX + 0x68))(); alBufferData(in_ECX[uVar4 + 0x11],iVar2,param_1,param_2,uVar3); alSourceQueueBuffers(in_ECX[0xd],1,in_ECX + uVar4 + 0x11); *(undefined1 *)(uVar4 + 0x54 + (int)in_ECX) = 0; cVar1 = (**(code **)(*in_ECX + 0x38))(); if (cVar1 == '\0') { alSourcePlay(in_ECX[0xd]); } return 1; } uVar4 = uVar4 + 1; } while (uVar4 < 4); return 1; } //@@ 00aa0720 FUN_00aa0720 uint FUN_00aa0720(void) { int iVar1; uint extraout_EAX; uint uVar2; int in_ECX; alGenSources(1,in_ECX + 0x34); iVar1 = alGetError(); if (iVar1 != 0) { KAGE_LogMessage(8,(byte *)"OpenAL error encountered when creating source object. Error = %d\n"); return extraout_EAX & 0xffffff00; } alGenBuffers(4,in_ECX + 0x44); iVar1 = alGetError(); if (iVar1 == 0) { *(undefined1 *)(in_ECX + 8) = 1; return 1; } KAGE_LogMessage(8,(byte *)"OpenAL error encountered when creating buffer object. Error = %d\n"); uVar2 = alDeleteSources(1,in_ECX + 0x34); return uVar2 & 0xffffff00; } //@@ 00aa07a0 FUN_00aa07a0 void FUN_00aa07a0(void) { int in_ECX; FUN_00a7d160(); alDeleteSources(1,(undefined4 *)(in_ECX + 0x34)); alDeleteBuffers(4,(undefined4 *)(in_ECX + 0x44)); *(undefined4 *)(in_ECX + 0x34) = 0; *(undefined4 *)(in_ECX + 0x44) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; *(undefined4 *)(in_ECX + 0x4c) = 0; *(undefined4 *)(in_ECX + 0x50) = 0; return; } //@@ 00aa07e0 FUN_00aa07e0 void FUN_00aa07e0(void) { char cVar1; int *in_ECX; if (in_ECX[0xd] != 0) { cVar1 = (**(code **)(*in_ECX + 0x38))(); if (cVar1 == '\0') { (**(code **)(PTR_vftable_00c5aaa0 + 0xc))(); alSourcePlay(in_ECX[0xd]); } } return; } //@@ 00aa0820 FUN_00aa0820 void FUN_00aa0820(char param_1) { int in_ECX; if (param_1 != *(char *)(in_ECX + 9)) { *(char *)(in_ECX + 9) = param_1; } return; } //@@ 00aa0840 FUN_00aa0840 void * FUN_00aa0840(void) { int iVar1; void *pvVar2; int in_ECX; int in_EDX; uint _Size; int iVar3; _Size = in_EDX + 3U & 0xfffffffc; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + _Size; if (*(int *)(in_ECX + 0x60) == 0) { if (_Size != 0) { pvVar2 = malloc(_Size); return pvVar2; } } else { iVar1 = *(int *)(in_ECX + 0x68); iVar3 = _Size + iVar1; if (iVar3 <= *(int *)(in_ECX + 0x6c)) { *(int *)(in_ECX + 0x68) = iVar3; return (void *)(iVar1 + *(int *)(in_ECX + 0x60)); } } return (void *)0x0; } //@@ 00aa0880 FUN_00aa0880 uint FUN_00aa0880(void) { uint in_ECX; uint uVar1; uVar1 = (in_ECX >> 1 ^ in_ECX * 2) & 0x55555555 ^ in_ECX * 2; uVar1 = (uVar1 >> 2 ^ uVar1 * 4) & 0x33333333 ^ uVar1 * 4; uVar1 = (uVar1 >> 4 ^ uVar1 << 4) & 0xf0f0f0f ^ uVar1 << 4; uVar1 = (uVar1 >> 8 ^ uVar1 << 8) & 0xff00ff ^ uVar1 << 8; return uVar1 << 0x10 | uVar1 >> 0x10; } //@@ 00aa08f0 stb_vorbis::ilog /* DB: bit count of n via 16-entry log2 table DAT_00ba8c50 with ranges <16, <512, <16K, <512K, <16M, <512M, <2^31 (stb_vorbis ilog); callers inverse_mdct, start_decoder, vorbis_decode_packet_rest prototype: db/protos.zhl */ int __fastcall stb_vorbis::ilog(int n) { if (0x3fff < (uint)n) { if ((uint)n < 0x1000000) { if ((uint)n < 0x80000) { return (char)(&DAT_00ba8c50)[n >> 0xf] + 0xf; } return (char)(&DAT_00ba8c50)[n >> 0x14] + 0x14; } if ((uint)n < 0x20000000) { return (char)(&DAT_00ba8c50)[n >> 0x19] + 0x19; } if ((uint)n < 0x80000000) { return (char)(&DAT_00ba8c50)[n >> 0x1e] + 0x1e; } return 0; } if ((uint)n < 0x10) { return (int)(char)(&DAT_00ba8c50)[n]; } if ((uint)n < 0x200) { return (char)(&DAT_00ba8c50)[n >> 5] + 5; } return (char)(&DAT_00ba8c50)[n >> 10] + 10; } //@@ 00aa0990 stb_vorbis::compute_codewords /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: stb_vorbis: asserts "c->sorted_entries == 0" and "available[y] == 0" (ogg.cpp 0x3fe), available[32] memset 0x80, first non-NO_CODE (0xff) entry, add_entry inlined; only caller start_decoder */ undefined4 stb_vorbis::compute_codewords(int param_1,int *param_2) { undefined1 uVar1; uint uVar2; byte bVar3; byte bVar4; byte bVar5; int in_ECX; uint uVar6; int in_EDX; int iVar7; uint uVar8; int local_98; int local_94; uint local_88 [32]; uint local_8; local_8 = __security_cookie ^ (uint)(local_88 + 0x21); memset(local_88,0,0x80); local_98 = 0; if (0 < param_1) { do { if (*(char *)(in_EDX + local_98) != -1) break; local_98 = local_98 + 1; } while (local_98 < param_1); } if (local_98 == param_1) { if (*(int *)(in_ECX + 0x82c) != 0) { _wassert(L"c->sorted_entries == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x3fe); } } else { uVar1 = *(undefined1 *)(in_EDX + local_98); local_94 = 1; if (*(char *)(in_ECX + 0x17) == '\0') { (*(undefined4 **)(in_ECX + 0x20))[local_98] = 0; } else { **(undefined4 **)(in_ECX + 0x20) = 0; **(undefined1 **)(in_ECX + 8) = uVar1; *param_2 = local_98; } bVar5 = *(byte *)(in_EDX + local_98); iVar7 = 1; if (bVar5 != 0) { bVar4 = 0x1f; do { bVar3 = bVar4 & 0x1f; bVar4 = bVar4 - 1; local_88[iVar7] = 1 << bVar3; iVar7 = iVar7 + 1; } while (iVar7 <= (int)(uint)bVar5); } local_98 = local_98 + 1; if (local_98 < param_1) { do { bVar5 = *(byte *)(in_EDX + local_98); uVar8 = (uint)bVar5; if (uVar8 != 0xff) { if (bVar5 != 0) { do { if (local_88[uVar8] != 0) break; uVar8 = uVar8 - 1; } while (0 < (int)uVar8); } if (uVar8 == 0) { _wassert(L"0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp", 0x413); return 0; } uVar2 = local_88[uVar8]; iVar7 = local_94 + 1; local_88[uVar8] = 0; uVar6 = (uVar2 >> 1 ^ uVar2 * 2) & 0x55555555 ^ uVar2 * 2; uVar6 = (uVar6 >> 2 ^ uVar6 * 4) & 0x33333333 ^ uVar6 * 4; uVar6 = (uVar6 >> 4 ^ uVar6 << 4) & 0xf0f0f0f ^ uVar6 << 4; uVar6 = (uVar6 >> 8 ^ uVar6 << 8) & 0xff00ff ^ uVar6 << 8; uVar6 = uVar6 << 0x10 | uVar6 >> 0x10; if (*(char *)(in_ECX + 0x17) == '\0') { *(uint *)(*(int *)(in_ECX + 0x20) + local_98 * 4) = uVar6; } else { *(uint *)(*(int *)(in_ECX + 0x20) + local_94 * 4) = uVar6; *(byte *)(local_94 + *(int *)(in_ECX + 8)) = bVar5; param_2[local_94] = local_98; } uVar6 = (uint)*(byte *)(in_EDX + local_98); local_94 = iVar7; if ((int)uVar8 < (int)uVar6) { iVar7 = 0x20 - uVar6; do { if (local_88[uVar6] != 0) { _wassert(L"available[y] == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp" ,0x41a); } bVar5 = (byte)iVar7; iVar7 = iVar7 + 1; local_88[uVar6] = (1 << (bVar5 & 0x1f)) + uVar2; uVar6 = uVar6 - 1; } while ((int)uVar8 < (int)uVar6); } } local_98 = local_98 + 1; } while (local_98 < param_1); } } return 1; } //@@ 00aa0c20 cmpAddrMapByPos /* Library Function - Single Match int __cdecl cmpAddrMapByPos(void const *,void const *) Library: Visual Studio 2017 Release */ int __cdecl cmpAddrMapByPos(void *param_1,void *param_2) { if (*(uint *)param_1 < *(uint *)param_2) { return -1; } return (uint)(*(uint *)param_2 < *(uint *)param_1); } //@@ 00aa0c40 stb_vorbis::compute_sorted_huffman /* DB: stb_vorbis setup: builds sorted_codewords / sorted_values for a codebook; asserts "c->sorted_codewords[x] == code", "k == c->sorted_entries", "len != NO_CODE" (ogg.cpp); only caller stb_vorbis::start_decoder */ void stb_vorbis::compute_sorted_huffman(int param_1) { uint uVar1; undefined4 uVar2; size_t _NumOfElements; int in_ECX; code *pcVar3; int in_EDX; uint uVar4; uint uVar5; uint uVar6; int *piVar7; byte bVar8; size_t sVar9; int iVar10; int local_c; int local_8; if (*(char *)(in_ECX + 0x17) == '\0') { sVar9 = 0; iVar10 = 0; pcVar3 = _wassert_exref; if (0 < *(int *)(in_ECX + 4)) { do { bVar8 = *(byte *)(iVar10 + in_EDX); if (*(char *)(in_ECX + 0x17) == '\0') { if ((bVar8 != 0xff) && (10 < bVar8)) goto LAB_00aa0c9e; } else { if (bVar8 == 0xff) { (*pcVar3)(L"len != NO_CODE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp", 0x443); } LAB_00aa0c9e: uVar2 = FUN_00aa0880(); *(undefined4 *)(*(int *)(in_ECX + 0x824) + sVar9 * 4) = uVar2; sVar9 = sVar9 + 1; pcVar3 = _wassert_exref; } iVar10 = iVar10 + 1; } while (iVar10 < *(int *)(in_ECX + 4)); } _NumOfElements = *(size_t *)(in_ECX + 0x82c); if (sVar9 != _NumOfElements) { (*pcVar3)(L"k == c->sorted_entries", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x457); _NumOfElements = *(size_t *)(in_ECX + 0x82c); } } else { _NumOfElements = *(size_t *)(in_ECX + 0x82c); iVar10 = 0; if (0 < (int)_NumOfElements) { do { uVar4 = *(uint *)(*(int *)(in_ECX + 0x20) + iVar10 * 4); uVar4 = (uVar4 >> 1 ^ uVar4 * 2) & 0x55555555 ^ uVar4 * 2; uVar4 = (uVar4 >> 2 ^ uVar4 * 4) & 0x33333333 ^ uVar4 * 4; uVar4 = (uVar4 >> 4 ^ uVar4 << 4) & 0xf0f0f0f ^ uVar4 << 4; uVar4 = (uVar4 >> 8 ^ uVar4 << 8) & 0xff00ff ^ uVar4 << 8; *(uint *)(*(int *)(in_ECX + 0x824) + iVar10 * 4) = uVar4 << 0x10 | uVar4 >> 0x10; iVar10 = iVar10 + 1; _NumOfElements = *(size_t *)(in_ECX + 0x82c); } while (iVar10 < (int)_NumOfElements); } } qsort(*(void **)(in_ECX + 0x824),_NumOfElements,4,cmpAddrMapByPos); *(undefined4 *)(*(int *)(in_ECX + 0x824) + *(int *)(in_ECX + 0x82c) * 4) = 0xffffffff; if (*(char *)(in_ECX + 0x17) == '\0') { iVar10 = *(int *)(in_ECX + 4); } else { iVar10 = *(int *)(in_ECX + 0x82c); } local_c = 0; if (0 < iVar10) { do { if (*(char *)(in_ECX + 0x17) == '\0') { bVar8 = *(byte *)(in_EDX + local_c); if ((bVar8 != 0xff) && (10 < bVar8)) goto LAB_00aa0e0e; } else { bVar8 = *(byte *)(in_EDX + *(int *)(param_1 + local_c * 4)); if (bVar8 == 0xff) { _wassert(L"len != NO_CODE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x443 ); } LAB_00aa0e0e: uVar4 = *(uint *)(in_ECX + 0x82c); uVar5 = *(uint *)(local_c * 4 + *(int *)(in_ECX + 0x20)); uVar5 = (uVar5 >> 1 ^ uVar5 * 2) & 0x55555555 ^ uVar5 * 2; uVar5 = (uVar5 >> 2 ^ uVar5 * 4) & 0x33333333 ^ uVar5 * 4; uVar5 = (uVar5 >> 4 ^ uVar5 << 4) & 0xf0f0f0f ^ uVar5 << 4; uVar5 = (uVar5 >> 8 ^ uVar5 << 8) & 0xff00ff ^ uVar5 << 8; uVar5 = uVar5 << 0x10 | uVar5 >> 0x10; local_8 = 0; if (1 < (int)uVar4) { local_8 = 0; do { uVar6 = uVar4 >> 1; uVar1 = *(uint *)(*(int *)(in_ECX + 0x824) + (uVar6 + local_8) * 4); if (uVar1 <= uVar5) { local_8 = uVar6 + local_8; } uVar4 = uVar4 - uVar6; if (uVar5 < uVar1) { uVar4 = uVar6; } } while (1 < (int)uVar4); } if (*(uint *)(local_8 * 4 + *(int *)(in_ECX + 0x824)) != uVar5) { _wassert(L"c->sorted_codewords[x] == code", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x475 ); } piVar7 = (int *)(*(int *)(in_ECX + 0x828) + local_8 * 4); if (*(char *)(in_ECX + 0x17) == '\0') { *piVar7 = local_c; } else { *piVar7 = *(int *)(local_c * 4 + param_1); *(byte *)(local_8 + *(int *)(in_ECX + 8)) = bVar8; } } local_c = local_c + 1; } while (local_c < iVar10); } return; } //@@ 00aa0f40 stb_vorbis::init_blocksize /* DB: stb_vorbis init_blocksize(f, b=EDX, n): setup_malloc n/2,n/2,n/4 floats into A[b] (+0x43c), B[b] (+0x444), C[b] (+0x44c) and window/bitrev, compute_twiddle_factors via cos/sin; only caller start_decoder */ undefined4 stb_vorbis::init_blocksize(int param_1) { size_t sVar1; int iVar2; int iVar3; void *pvVar4; int iVar5; int in_ECX; int iVar6; code *pcVar7; uint uVar8; int in_EDX; float *pfVar9; uint uVar10; int iVar11; float *pfVar12; double dVar13; double dVar14; int iStack_44; int local_2c; float *local_18; iVar6 = param_1 >> 1; iVar2 = param_1 >> 2; iVar3 = param_1 >> 3; sVar1 = iVar6 * 4; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + sVar1; pcVar7 = malloc_exref; if (*(int *)(in_ECX + 0x60) == 0) { if (sVar1 == 0) goto LAB_00aa0fc4; pvVar4 = malloc(sVar1); pcVar7 = malloc_exref; } else { iVar5 = *(int *)(in_ECX + 0x68); if (*(int *)(in_ECX + 0x6c) < (int)(iVar5 + sVar1)) { LAB_00aa0fc4: pvVar4 = (void *)0x0; } else { pvVar4 = (void *)(iVar5 + *(int *)(in_ECX + 0x60)); *(size_t *)(in_ECX + 0x68) = iVar5 + sVar1; } } *(void **)(in_ECX + 0x43c + in_EDX * 4) = pvVar4; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + sVar1; if (*(int *)(in_ECX + 0x60) == 0) { if (sVar1 == 0) goto LAB_00aa0ff7; iVar5 = (*pcVar7)(sVar1); } else { iVar5 = *(int *)(in_ECX + 0x68); iVar11 = sVar1 + iVar5; if (*(int *)(in_ECX + 0x6c) < iVar11) { LAB_00aa0ff7: iVar5 = 0; } else { *(int *)(in_ECX + 0x68) = iVar11; iVar5 = *(int *)(in_ECX + 0x60) + iVar5; } } *(int *)(in_ECX + 0x444 + in_EDX * 4) = iVar5; sVar1 = iVar2 * 4; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + sVar1; if (*(int *)(in_ECX + 0x60) == 0) { if (sVar1 != 0) { pfVar12 = malloc(sVar1); goto LAB_00aa103f; } } else { iVar5 = sVar1 + *(int *)(in_ECX + 0x68); if (iVar5 <= *(int *)(in_ECX + 0x6c)) { pfVar12 = (float *)(*(int *)(in_ECX + 0x68) + *(int *)(in_ECX + 0x60)); *(int *)(in_ECX + 0x68) = iVar5; goto LAB_00aa103f; } } pfVar12 = (float *)0x0; LAB_00aa103f: pfVar9 = *(float **)(in_ECX + 0x43c + in_EDX * 4); *(float **)(in_ECX + 0x44c + in_EDX * 4) = pfVar12; if (((pfVar9 != (float *)0x0) && (iVar5 = *(int *)(in_ECX + 0x444 + in_EDX * 4), iVar5 != 0)) && (pfVar12 != (float *)0x0)) { if (0 < iVar2) { local_18 = (float *)(iVar5 + 4); iVar11 = 0; iVar5 = (int)pfVar9 - iVar5; local_2c = 1; do { dVar13 = (double)(((float)iVar11 * 3.1415927) / (float)param_1); dVar14 = dVar13; libm_sse2_cos_precise(); *pfVar9 = (float)dVar14; libm_sse2_sin_precise(); *(float *)(iVar5 + (int)local_18) = (float)-dVar13; dVar13 = (double)((((float)local_2c * 3.1415927) / (float)param_1) * 0.5); dVar14 = dVar13; libm_sse2_cos_precise(); local_18[-1] = (float)dVar14 * 0.5; libm_sse2_sin_precise(); pfVar9 = pfVar9 + 2; local_2c = local_2c + 2; iVar11 = iVar11 + 4; *local_18 = (float)dVar13 * 0.5; local_18 = local_18 + 2; iVar2 = iVar2 + -1; } while (iVar2 != 0); } if (0 < iVar3) { iVar2 = 2; iStack_44 = iVar3; do { dVar13 = (double)(((float)iVar2 * 3.1415927) / (float)param_1); dVar14 = dVar13; libm_sse2_cos_precise(); *pfVar12 = (float)dVar14; libm_sse2_sin_precise(); iVar2 = iVar2 + 4; iStack_44 = iStack_44 + -1; pfVar12[1] = (float)-dVar13; pfVar12 = pfVar12 + 2; } while (iStack_44 != 0); } iVar2 = FUN_00aa0840(); *(int *)(in_ECX + 0x454 + in_EDX * 4) = iVar2; if (iVar2 != 0) { iVar5 = 0; if (0 < iVar6) { do { dVar14 = (((double)iVar5 + 0.5) / (double)iVar6) * 0.5 * 3.1415927410125732; libm_sse2_sin_precise(); dVar14 = (double)((float)dVar14 * (float)dVar14) * 1.5707963705062866; libm_sse2_sin_precise(); *(float *)(iVar2 + iVar5 * 4) = (float)dVar14; iVar5 = iVar5 + 1; } while (iVar5 < iVar6); } iVar2 = FUN_00aa0840(); *(int *)(in_ECX + 0x45c + in_EDX * 4) = iVar2; if (iVar2 != 0) { iVar6 = ilog(param_1); uVar10 = 0; if (0 < iVar3) { do { uVar8 = (uVar10 >> 1 ^ uVar10 * 2) & 0x55555555 ^ uVar10 * 2; uVar8 = (uVar8 >> 2 ^ uVar8 * 4) & 0x33333333 ^ uVar8 * 4; uVar8 = (uVar8 >> 4 ^ uVar8 << 4) & 0xf0f0f0f ^ uVar8 << 4; uVar8 = (uVar8 >> 8 ^ uVar8 << 8) & 0xff00ff ^ uVar8 << 8; *(short *)(iVar2 + uVar10 * 2) = (short)(((uVar8 << 0x10 | uVar8 >> 0x10) >> (0x24U - (char)iVar6 & 0x1f)) << 2); uVar10 = uVar10 + 1; } while ((int)uVar10 < iVar3); } return 1; } } } *(undefined4 *)(in_ECX + 0x74) = 3; return 0; } //@@ 00aa1380 FUN_00aa1380 uint FUN_00aa1380(ushort *param_1,ushort *param_2) { if (*param_1 < *param_2) { return 0xffffffff; } return (uint)(*param_2 < *param_1); } //@@ 00aa13a0 FUN_00aa13a0 undefined1 FUN_00aa13a0(void) { undefined1 uVar1; undefined1 *puVar2; int iVar3; uint in_ECX; undefined4 uStack_8; puVar2 = *(undefined1 **)(in_ECX + 0x20); if (puVar2 == (undefined1 *)0x0) { uStack_8 = in_ECX & 0xffffff; iVar3 = (**(code **)(**(int **)(in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (0 < iVar3) { return uStack_8._3_1_; } } else if (puVar2 < *(undefined1 **)(in_ECX + 0x28)) { uVar1 = *puVar2; *(undefined1 **)(in_ECX + 0x20) = puVar2 + 1; return uVar1; } *(undefined4 *)(in_ECX + 0x70) = 1; return 0; } //@@ 00aa13f0 stb_vorbis::get32 /* DB: stb_vorbis: four inlined get8 reads (memory stream +0x20/+0x28 or file callback, eof +0x70) combined little-endian; callers start_page_no_capturepattern 00aa1610, start_decoder */ int stb_vorbis::get32(void) { byte bVar1; undefined1 *puVar2; byte *pbVar3; int iVar4; undefined1 uVar5; undefined1 uVar6; uint in_ECX; uint uVar7; int iVar8; undefined4 uStack_8; puVar2 = *(undefined1 **)(in_ECX + 0x20); if (puVar2 == (undefined1 *)0x0) { uStack_8 = in_ECX & 0xffffff; iVar8 = (**(code **)(**(int **)(in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (iVar8 < 1) { *(undefined4 *)(in_ECX + 0x70) = 1; uVar5 = 0; } else { uVar5 = uStack_8._3_1_; } } else { uStack_8 = in_ECX; if (puVar2 < *(undefined1 **)(in_ECX + 0x28)) { uVar5 = *puVar2; *(undefined1 **)(in_ECX + 0x20) = puVar2 + 1; } else { *(undefined4 *)(in_ECX + 0x70) = 1; uVar5 = 0; } } puVar2 = *(undefined1 **)(in_ECX + 0x20); if (puVar2 == (undefined1 *)0x0) { uStack_8 = uStack_8 & 0xffffff; iVar8 = (**(code **)(**(int **)(in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (iVar8 < 1) { *(undefined4 *)(in_ECX + 0x70) = 1; uVar6 = 0; } else { uVar6 = uStack_8._3_1_; } } else if (puVar2 < *(undefined1 **)(in_ECX + 0x28)) { uVar6 = *puVar2; *(undefined1 **)(in_ECX + 0x20) = puVar2 + 1; } else { *(undefined4 *)(in_ECX + 0x70) = 1; uVar6 = 0; } pbVar3 = *(byte **)(in_ECX + 0x20); if (pbVar3 == (byte *)0x0) { uStack_8 = uStack_8 & 0xffffff; iVar8 = (**(code **)(**(int **)(in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (iVar8 < 1) { *(undefined4 *)(in_ECX + 0x70) = 1; uVar7 = 0; } else { uVar7 = uStack_8 >> 0x18; } } else if (pbVar3 < *(byte **)(in_ECX + 0x28)) { uVar7 = (uint)*pbVar3; *(byte **)(in_ECX + 0x20) = pbVar3 + 1; } else { *(undefined4 *)(in_ECX + 0x70) = 1; uVar7 = 0; } iVar8 = (uint)CONCAT11(uVar6,uVar5) + uVar7 * 0x10000; pbVar3 = *(byte **)(in_ECX + 0x20); if (pbVar3 == (byte *)0x0) { uStack_8 = uStack_8 & 0xffffff; iVar4 = (**(code **)(**(int **)(in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (0 < iVar4) { return (uStack_8 & 0xff000000) + iVar8; } } else if (pbVar3 < *(byte **)(in_ECX + 0x28)) { bVar1 = *pbVar3; *(byte **)(in_ECX + 0x20) = pbVar3 + 1; return (uint)bVar1 * 0x1000000 + iVar8; } *(undefined4 *)(in_ECX + 0x70) = 1; return iVar8; } //@@ 00aa1540 FUN_00aa1540 undefined4 FUN_00aa1540(size_t param_1) { void *_Src; size_t sVar1; int in_ECX; void *in_EDX; _Src = *(void **)(in_ECX + 0x20); if (_Src == (void *)0x0) { sVar1 = (**(code **)(**(int **)(in_ECX + 0x14) + 0x14))(); if (sVar1 != param_1) goto LAB_00aa1580; } else { if (*(uint *)(in_ECX + 0x28) < (int)_Src + param_1) { LAB_00aa1580: *(undefined4 *)(in_ECX + 0x70) = 1; return 0; } memcpy(in_EDX,_Src,param_1); *(int *)(in_ECX + 0x20) = *(int *)(in_ECX + 0x20) + param_1; } return 1; } //@@ 00aa1590 FUN_00aa1590 undefined4 FUN_00aa1590(void) { uint uVar1; uint uVar2; int in_ECX; uint in_EDX; if (*(char *)(in_ECX + 0x30) == '\0') { *(undefined4 *)(in_ECX + 0x70) = 0; if (*(int *)(in_ECX + 0x20) == 0) { uVar1 = *(int *)(in_ECX + 0x18) + in_EDX; if ((uVar1 < in_EDX) || (0x7fffffff < in_EDX)) { uVar1 = 0x7fffffff; *(undefined4 *)(in_ECX + 0x70) = 1; } (**(code **)(**(int **)(in_ECX + 0x14) + 0xc))(uVar1,0); uVar2 = (**(code **)(**(int **)(in_ECX + 0x14) + 8))(); if (uVar2 == uVar1) { return 1; } } else { uVar1 = *(int *)(in_ECX + 0x24) + in_EDX; if (uVar1 < *(uint *)(in_ECX + 0x28)) { *(uint *)(in_ECX + 0x20) = uVar1; return 1; } *(uint *)(in_ECX + 0x20) = *(uint *)(in_ECX + 0x28); } *(undefined4 *)(in_ECX + 0x70) = 1; } return 0; } //@@ 00aa1610 stb_vorbis::start_page_no_capturepattern /* DB: reads stream version byte (error 0x1f VORBIS_invalid_stream_structure_version), page flag, granule/serial/sequence get32, segment count and table into +0x470; stb_vorbis::start_page, start_packet prototype: db/protos.zhl */ int __thiscall stb_vorbis::start_page_no_capturepattern(void *this) { void *_Dst; byte *pbVar1; void *_Src; undefined1 uVar2; int iVar3; int iVar4; undefined4 uVar5; uint uVar6; uint uVar7; char *pcVar8; char cVar9; int iVar10; int iVar11; char local_5; pcVar8 = *(char **)((int)this + 0x20); if (pcVar8 == (char *)0x0) { local_5 = '\0'; iVar3 = (**(code **)(**(int **)((int)this + 0x14) + 0x14))(&local_5,1,1); if (iVar3 < 1) goto LAB_00aa1648; cVar9 = local_5; LAB_00aa16c9: if (cVar9 != '\0') { *(undefined4 *)((int)this + 0x74) = 0x1f; return 0; } } else { if (pcVar8 < *(char **)((int)this + 0x28)) { cVar9 = *pcVar8; *(char **)((int)this + 0x20) = pcVar8 + 1; goto LAB_00aa16c9; } LAB_00aa1648: *(undefined4 *)((int)this + 0x70) = 1; } uVar2 = FUN_00aa13a0(); *(undefined1 *)((int)this + 0x56f) = uVar2; iVar3 = get32(); iVar4 = get32(); get32(); uVar5 = get32(); *(undefined4 *)((int)this + 0x468) = uVar5; get32(); uVar6 = FUN_00aa13a0(); _Src = *(void **)((int)this + 0x20); _Dst = (void *)((int)this + 0x470); uVar6 = uVar6 & 0xff; *(uint *)((int)this + 0x46c) = uVar6; if (_Src == (void *)0x0) { uVar7 = (**(code **)(**(int **)((int)this + 0x14) + 0x14))(_Dst,1,uVar6); if (uVar7 != uVar6) goto LAB_00aa178a; } else { if (*(uint *)((int)this + 0x28) < (int)_Src + uVar6) { LAB_00aa178a: *(undefined4 *)((int)this + 0x70) = 1; *(undefined4 *)((int)this + 0x74) = 10; return 0; } memcpy(_Dst,_Src,uVar6); *(int *)((int)this + 0x20) = *(int *)((int)this + 0x20) + uVar6; } *(undefined4 *)((int)this + 0x58c) = 0xfffffffe; if ((iVar3 != -1) || (iVar4 != -1)) { iVar4 = *(int *)((int)this + 0x46c); for (pcVar8 = (char *)((int)this + iVar4 + 0x46f); iVar4 = iVar4 + -1, *pcVar8 == -1; pcVar8 = pcVar8 + -1) { } *(int *)((int)this + 0x58c) = iVar4; *(int *)((int)this + 0x590) = iVar3; } if (*(char *)((int)this + 0x571) != '\0') { iVar4 = *(int *)((int)this + 0x46c); iVar11 = 0; iVar10 = 0; if (0 < iVar4) { do { pbVar1 = (byte *)((int)_Dst + iVar10); iVar10 = iVar10 + 1; iVar11 = iVar11 + (uint)*pbVar1; } while (iVar10 < iVar4); } iVar10 = *(int *)((int)this + 0x34); *(int *)((int)this + 0x38) = iVar10; *(int *)((int)this + 0x3c) = iVar4 + 0x1b + iVar10 + iVar11; *(int *)((int)this + 0x40) = iVar10; *(undefined4 *)((int)this + 0x44) = 0; *(int *)((int)this + 0x48) = iVar3; } *(undefined4 *)((int)this + 0x574) = 0; return 1; } //@@ 00aa17b0 stb_vorbis::start_page /* DB: stb_vorbis: matches the "OggS" capture through get8 (00aa13a0), then start_page_no_capturepattern (00aa1610); error 0x1e VORBIS_missing_capture_pattern */ int stb_vorbis::start_page(void) { char *pcVar1; char cVar2; int iVar3; void *in_ECX; undefined4 uStack_8; pcVar1 = *(char **)((int)in_ECX + 0x20); if (pcVar1 == (char *)0x0) { uStack_8 = (void *)((uint)in_ECX & 0xffffff); iVar3 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (iVar3 < 1) goto LAB_00aa17e3; cVar2 = uStack_8._3_1_; } else { if (*(char **)((int)in_ECX + 0x28) <= pcVar1) { LAB_00aa17e3: *(undefined4 *)((int)in_ECX + 0x70) = 1; goto LAB_00aa17ea; } cVar2 = *pcVar1; *(char **)((int)in_ECX + 0x20) = pcVar1 + 1; uStack_8 = in_ECX; } if (cVar2 == 'O') { cVar2 = FUN_00aa13a0(); if (cVar2 == 'g') { cVar2 = FUN_00aa13a0(); if (cVar2 == 'g') { cVar2 = FUN_00aa13a0(); if (cVar2 == 'S') { iVar3 = start_page_no_capturepattern(in_ECX); return iVar3; } } } } LAB_00aa17ea: *(undefined4 *)((int)in_ECX + 0x74) = 0x1e; return 0; } //@@ 00aa1830 stb_vorbis::start_packet /* DB: stb_vorbis start_packet: while next_seg == -1 runs start_page (capture "OggS" inlined); then last_seg=0, valid_bits=0, packet_bytes=0, bytes_in_seg=0, returns 1 */ undefined4 stb_vorbis::start_packet(void) { char *pcVar1; int iVar2; char cVar3; void *in_ECX; undefined4 local_8; iVar2 = *(int *)((int)in_ECX + 0x574); local_8 = in_ECX; while( true ) { if (iVar2 != -1) { *(undefined4 *)((int)in_ECX + 0x578) = 0; *(undefined4 *)((int)in_ECX + 0x584) = 0; *(undefined4 *)((int)in_ECX + 0x588) = 0; *(undefined1 *)((int)in_ECX + 0x570) = 0; return 1; } pcVar1 = *(char **)((int)in_ECX + 0x20); if (pcVar1 == (char *)0x0) break; if (*(char **)((int)in_ECX + 0x28) <= pcVar1) goto LAB_00aa199a; cVar3 = *pcVar1; *(char **)((int)in_ECX + 0x20) = pcVar1 + 1; LAB_00aa187b: if (cVar3 != 'O') goto LAB_00aa19a1; pcVar1 = *(char **)((int)in_ECX + 0x20); if (pcVar1 == (char *)0x0) { local_8._0_3_ = (uint3)(ushort)local_8; iVar2 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0x14))((int)&local_8 + 2,1,1); if (0 < iVar2) { cVar3 = local_8._2_1_; goto LAB_00aa18bb; } goto LAB_00aa199a; } if (*(char **)((int)in_ECX + 0x28) <= pcVar1) goto LAB_00aa199a; cVar3 = *pcVar1; *(char **)((int)in_ECX + 0x20) = pcVar1 + 1; LAB_00aa18bb: if (cVar3 != 'g') goto LAB_00aa19a1; pcVar1 = *(char **)((int)in_ECX + 0x20); if (pcVar1 == (char *)0x0) { local_8._0_2_ = (ushort)(byte)local_8; iVar2 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0x14))((int)&local_8 + 1,1,1); if (0 < iVar2) { cVar3 = local_8._1_1_; goto LAB_00aa18fb; } goto LAB_00aa199a; } if (*(char **)((int)in_ECX + 0x28) <= pcVar1) goto LAB_00aa199a; cVar3 = *pcVar1; *(char **)((int)in_ECX + 0x20) = pcVar1 + 1; LAB_00aa18fb: if (cVar3 != 'g') goto LAB_00aa19a1; pcVar1 = *(char **)((int)in_ECX + 0x20); if (pcVar1 == (char *)0x0) { local_8 = (void *)((uint)local_8 & 0xffffff00); iVar2 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0x14))(&local_8,1,1); if (iVar2 < 1) goto LAB_00aa199a; cVar3 = (byte)local_8; } else { if (*(char **)((int)in_ECX + 0x28) <= pcVar1) goto LAB_00aa199a; cVar3 = *pcVar1; *(char **)((int)in_ECX + 0x20) = pcVar1 + 1; } if (cVar3 != 'S') goto LAB_00aa19a1; iVar2 = start_page_no_capturepattern(in_ECX); if (iVar2 == 0) { return 0; } if ((*(byte *)((int)in_ECX + 0x56f) & 1) != 0) { *(undefined4 *)((int)in_ECX + 0x74) = 0x20; return 0; } iVar2 = *(int *)((int)in_ECX + 0x574); } local_8 = (void *)((uint)local_8 & 0xffffff); iVar2 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0x14))((int)&local_8 + 3,1,1); if (0 < iVar2) { cVar3 = local_8._3_1_; goto LAB_00aa187b; } LAB_00aa199a: *(undefined4 *)((int)in_ECX + 0x70) = 1; LAB_00aa19a1: *(undefined4 *)((int)in_ECX + 0x74) = 0x1e; return 0; } //@@ 00aa19b0 FUN_00aa19b0 undefined4 FUN_00aa19b0(void) { char cVar1; int iVar2; undefined4 uVar3; void *in_ECX; if (*(int *)((int)in_ECX + 0x574) != -1) { LAB_00aa1a2b: uVar3 = stb_vorbis::start_packet(); return uVar3; } cVar1 = FUN_00aa13a0(); if (*(int *)((int)in_ECX + 0x70) == 0) { if ((((cVar1 == 'O') && (cVar1 = FUN_00aa13a0(), cVar1 == 'g')) && (cVar1 = FUN_00aa13a0(), cVar1 == 'g')) && (cVar1 = FUN_00aa13a0(), cVar1 == 'S')) { iVar2 = stb_vorbis::start_page_no_capturepattern(in_ECX); if (iVar2 == 0) { return 0; } if ((*(byte *)((int)in_ECX + 0x56f) & 1) != 0) { *(undefined4 *)((int)in_ECX + 0x578) = 0; *(undefined1 *)((int)in_ECX + 0x570) = 0; *(undefined4 *)((int)in_ECX + 0x74) = 0x20; return 0; } goto LAB_00aa1a2b; } *(undefined4 *)((int)in_ECX + 0x74) = 0x1e; } return 0; } //@@ 00aa1a40 stb_vorbis::next_segment /* DB: stb_vorbis next_segment: returns 0 if last_seg (+0x578); when next_seg (+0x574) == -1 sets last_seg_which and calls start_page (00aa17b0), checks continued-packet flag (+0x56f, error 0x20); assert "f->bytes_in_seg == 0"; segment table +0x470 prototype: db/protos.zhl */ int __thiscall stb_vorbis::next_segment(void *this) { byte bVar1; int iVar2; int iVar3; if (*(int *)((int)this + 0x578) != 0) { return 0; } if (*(int *)((int)this + 0x574) == -1) { *(int *)((int)this + 0x57c) = *(int *)((int)this + 0x46c) + -1; iVar3 = start_page(); if (iVar3 == 0) { *(undefined4 *)((int)this + 0x578) = 1; return 0; } if ((*(byte *)((int)this + 0x56f) & 1) == 0) { *(undefined4 *)((int)this + 0x74) = 0x20; return 0; } } iVar2 = *(int *)((int)this + 0x574); bVar1 = *(byte *)(iVar2 + 0x470 + (int)this); iVar3 = iVar2 + 1; *(int *)((int)this + 0x574) = iVar3; if (bVar1 < 0xff) { *(undefined4 *)((int)this + 0x578) = 1; *(int *)((int)this + 0x57c) = iVar2; } if (*(int *)((int)this + 0x46c) <= iVar3) { iVar3 = -1; } *(int *)((int)this + 0x574) = iVar3; if (*(char *)((int)this + 0x570) != '\0') { _wassert(L"f->bytes_in_seg == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x5c4); } *(byte *)((int)this + 0x570) = bVar1; return (uint)bVar1; } //@@ 00aa1b10 stb_vorbis::get8_packet_raw /* DB: ogg.cpp assert "f->bytes_in_seg > 0"; decrements bytes_in_seg (+0x570), increments +0x588, reads one byte from the memory stream (+0x20/+0x28) or the file callback; callers stb_vorbis_decode_residue, vorbis_decode_packet_rest, start_decoder prototype: db/protos.zhl */ int __thiscall stb_vorbis::get8_packet_raw(void *this) { byte bVar1; byte *pbVar2; char cVar3; int iVar4; undefined4 uStack_8; uStack_8 = this; if (*(char *)((int)this + 0x570) == '\0') { if (*(int *)((int)this + 0x578) == 0) { iVar4 = next_segment(this); if (iVar4 != 0) goto LAB_00aa1b3a; } return -1; } LAB_00aa1b3a: cVar3 = *(char *)((int)this + 0x570); if (cVar3 == '\0') { _wassert(L"f->bytes_in_seg > 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x5d3); cVar3 = *(char *)((int)this + 0x570); } *(int *)((int)this + 0x588) = *(int *)((int)this + 0x588) + 1; *(char *)((int)this + 0x570) = cVar3 + -1; pbVar2 = *(byte **)((int)this + 0x20); if (pbVar2 == (byte *)0x0) { uStack_8 = (void *)((uint)uStack_8 & 0xffffff); iVar4 = (**(code **)(**(int **)((int)this + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (0 < iVar4) { return (uint)uStack_8 >> 0x18; } } else if (pbVar2 < *(byte **)((int)this + 0x28)) { bVar1 = *pbVar2; *(byte **)((int)this + 0x20) = pbVar2 + 1; return (uint)bVar1; } *(undefined4 *)((int)this + 0x70) = 1; return 0; } //@@ 00aa1bc0 stb_vorbis::flush_packet /* DB: loops get8_packet_raw inlined: next_segment (FUN_00aa1a40) when bytes_in_seg is 0 and not last_seg, assert "f->bytes_in_seg > 0" (ogg.cpp line 0x5d3), --bytes_in_seg, ++packet_bytes, get8 until EOP; stb_vorbis::start_decoder, vorbis_decode_packet_rest */ void stb_vorbis::flush_packet(void) { uint uVar1; char cVar2; int iVar3; void *in_ECX; undefined4 uStack_8; uStack_8 = in_ECX; LAB_00aa1bd0: while( true ) { if (*(char *)((int)in_ECX + 0x570) == '\0') { if (*(int *)((int)in_ECX + 0x578) != 0) { return; } iVar3 = next_segment(in_ECX); if (iVar3 == 0) { return; } } cVar2 = *(char *)((int)in_ECX + 0x570); if (cVar2 == '\0') { _wassert(L"f->bytes_in_seg > 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x5d3); cVar2 = *(char *)((int)in_ECX + 0x570); } *(int *)((int)in_ECX + 0x588) = *(int *)((int)in_ECX + 0x588) + 1; *(char *)((int)in_ECX + 0x570) = cVar2 + -1; uVar1 = *(uint *)((int)in_ECX + 0x20); if (uVar1 == 0) goto LAB_00aa1c31; if (*(uint *)((int)in_ECX + 0x28) <= uVar1) break; *(uint *)((int)in_ECX + 0x20) = uVar1 + 1; } goto LAB_00aa1c49; LAB_00aa1c31: uStack_8 = (void *)((uint)uStack_8 & 0xffffff); iVar3 = (**(code **)(**(int **)((int)in_ECX + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (iVar3 < 1) { LAB_00aa1c49: *(undefined4 *)((int)in_ECX + 0x70) = 1; } goto LAB_00aa1bd0; } //@@ 00aa1c60 stb_vorbis::get_bits /* DB: stb_vorbis get_bits(f, n=EDX): valid_bits +0x584 / acc +0x580, n>24 splits into two reads (<<24), refills from get8_packet_raw with assert "f->bytes_in_seg > 0" (ogg.cpp line 0x5d3); start_decoder, vorbis_decode_packet_rest prototype: db/protos.zhl */ uint __thiscall stb_vorbis::get_bits(void *this,int bitCount) { byte bVar1; byte *pbVar2; char cVar3; uint uVar4; uint uVar5; int iVar6; undefined4 uStack_8; iVar6 = *(int *)((int)this + 0x584); if (iVar6 < 0) { return 0; } if (iVar6 < bitCount) { uStack_8 = this; if (0x18 < bitCount) { uVar4 = get_bits(this,0x18); uVar5 = get_bits(this,bitCount + -0x18); return uVar5 * 0x1000000 + uVar4; } if (iVar6 == 0) { *(undefined4 *)((int)this + 0x580) = 0; } do { if ((*(char *)((int)this + 0x570) == '\0') && ((*(int *)((int)this + 0x578) != 0 || (iVar6 = next_segment(this), iVar6 == 0)))) { *(undefined4 *)((int)this + 0x584) = 0xffffffff; return 0; } cVar3 = *(char *)((int)this + 0x570); if (cVar3 == '\0') { _wassert(L"f->bytes_in_seg > 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x5d3); cVar3 = *(char *)((int)this + 0x570); } *(int *)((int)this + 0x588) = *(int *)((int)this + 0x588) + 1; *(char *)((int)this + 0x570) = cVar3 + -1; pbVar2 = *(byte **)((int)this + 0x20); if (pbVar2 == (byte *)0x0) { uStack_8 = (void *)((uint)uStack_8 & 0xffffff); iVar6 = (**(code **)(**(int **)((int)this + 0x14) + 0x14))((int)&uStack_8 + 3,1,1); if (iVar6 < 1) { *(undefined4 *)((int)this + 0x70) = 1; uVar4 = 0; } else { uVar4 = (uint)uStack_8 >> 0x18; } } else if (pbVar2 < *(byte **)((int)this + 0x28)) { bVar1 = *pbVar2; *(byte **)((int)this + 0x20) = pbVar2 + 1; uVar4 = (uint)bVar1; } else { *(undefined4 *)((int)this + 0x70) = 1; uVar4 = 0; } *(int *)((int)this + 0x580) = *(int *)((int)this + 0x580) + (uVar4 << ((byte)*(int *)((int)this + 0x584) & 0x1f)); iVar6 = *(int *)((int)this + 0x584) + 8; *(int *)((int)this + 0x584) = iVar6; } while (iVar6 < bitCount); if (iVar6 < 0) { return 0; } } uVar4 = *(uint *)((int)this + 0x580); *(uint *)((int)this + 0x580) = uVar4 >> ((byte)bitCount & 0x1f); *(int *)((int)this + 0x584) = iVar6 - bitCount; return (1 << ((byte)bitCount & 0x1f)) - 1U & uVar4; } //@@ 00aa1dc0 stb_vorbis::codebook_decode_scalar_raw /* DB: ogg.cpp asserts "c->sorted_codewords || c->codewords" and "!c->sparse"; refills the bit accumulator (+0x580/+0x584) via stb_vorbis::get8_packet_raw to 24 bits then decodes one codeword for codebook EDX; callers stb_vorbis_decode_residue, vorbis_decode_packet_rest prototype: db/protos.zhl */ int __fastcall stb_vorbis::codebook_decode_scalar_raw(void *vorbis,void *codebook) { byte bVar1; uint uVar2; uint uVar3; int iVar4; uint uVar5; uint uVar6; uint uVar7; int iVar8; bool bVar9; if (*(int *)((int)vorbis + 0x584) < 0x19) { if (*(int *)((int)vorbis + 0x584) == 0) { *(undefined4 *)((int)vorbis + 0x580) = 0; } do { if (((*(int *)((int)vorbis + 0x578) != 0) && (*(char *)((int)vorbis + 0x570) == '\0')) || (iVar4 = get8_packet_raw(vorbis), iVar4 == -1)) break; *(int *)((int)vorbis + 0x580) = *(int *)((int)vorbis + 0x580) + (iVar4 << ((byte)*(int *)((int)vorbis + 0x584) & 0x1f)); iVar4 = *(int *)((int)vorbis + 0x584) + 8; *(int *)((int)vorbis + 0x584) = iVar4; } while (iVar4 < 0x19); } if ((*(int *)((int)codebook + 0x824) == 0) && (*(int *)((int)codebook + 0x20) == 0)) { _wassert(L"c->sorted_codewords || c->codewords", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x62f); } iVar4 = *(int *)((int)codebook + 4); if (iVar4 < 9) { bVar9 = *(int *)((int)codebook + 0x20) == 0; } else { bVar9 = *(int *)((int)codebook + 0x824) != 0; } if (bVar9) { uVar2 = *(uint *)((int)vorbis + 0x580); uVar5 = FUN_00aa0880(); uVar7 = *(uint *)((int)codebook + 0x82c); iVar4 = 0; if (1 < (int)uVar7) { iVar4 = 0; do { uVar6 = uVar7 >> 1; uVar3 = *(uint *)(*(int *)((int)codebook + 0x824) + (uVar6 + iVar4) * 4); if (uVar3 <= uVar5) { iVar4 = uVar6 + iVar4; } uVar7 = uVar7 - uVar6; if (uVar5 < uVar3) { uVar7 = uVar6; } } while (1 < (int)uVar7); } if (*(char *)((int)codebook + 0x17) == '\0') { iVar4 = *(int *)(*(int *)((int)codebook + 0x828) + iVar4 * 4); } bVar1 = *(byte *)(*(int *)((int)codebook + 8) + iVar4); if ((int)(uint)bVar1 <= *(int *)((int)vorbis + 0x584)) { *(uint *)((int)vorbis + 0x580) = uVar2 >> (bVar1 & 0x1f); *(uint *)((int)vorbis + 0x584) = *(int *)((int)vorbis + 0x584) - (uint)bVar1; return iVar4; } } else { if (*(char *)((int)codebook + 0x17) != '\0') { _wassert(L"!c->sparse", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x650); iVar4 = *(int *)((int)codebook + 4); } iVar8 = 0; if (0 < iVar4) { do { bVar1 = *(byte *)(*(int *)((int)codebook + 8) + iVar8); if ((bVar1 != 0xff) && (*(uint *)(*(int *)((int)codebook + 0x20) + iVar8 * 4) == ((1 << (bVar1 & 0x1f)) - 1U & *(uint *)((int)vorbis + 0x580)))) { if ((int)(uint)bVar1 <= *(int *)((int)vorbis + 0x584)) { *(uint *)((int)vorbis + 0x580) = *(uint *)((int)vorbis + 0x580) >> (bVar1 & 0x1f); *(uint *)((int)vorbis + 0x584) = *(int *)((int)vorbis + 0x584) - (uint)*(byte *)(iVar8 + *(int *)((int)codebook + 8)); return iVar8; } goto LAB_00aa1f5f; } iVar8 = iVar8 + 1; } while (iVar8 < *(int *)((int)codebook + 4)); } *(undefined4 *)((int)vorbis + 0x74) = 0x15; } LAB_00aa1f5f: *(undefined4 *)((int)vorbis + 0x584) = 0; return -1; } //@@ 00aa1fb0 stb_vorbis::codebook_decode_start /* DB: stb_vorbis: errors when lookup_type (+0x15) is 0, refills the bit buffer to 10 bits via get8_packet_raw, fast-table decode then codebook_decode_scalar_raw; asserts "z < c->sorted_entries" for sparse books; callers stb_vorbis_decode_residue, codebook_decode 00aa20b0 */ int stb_vorbis::codebook_decode_start(void) { int *piVar1; byte bVar2; void *in_ECX; void *in_EDX; int iVar3; iVar3 = -1; if (*(char *)((int)in_EDX + 0x15) != '\0') { if (*(int *)((int)in_ECX + 0x584) < 10) { if (*(int *)((int)in_ECX + 0x584) == 0) { *(undefined4 *)((int)in_ECX + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar3 = get8_packet_raw(in_ECX), iVar3 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar3 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)) ; iVar3 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar3; } while (iVar3 < 0x19); } iVar3 = (int)*(short *)((int)in_EDX + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (iVar3 < 0) { iVar3 = codebook_decode_scalar_raw(in_ECX,in_EDX); } else { bVar2 = *(byte *)(*(int *)((int)in_EDX + 8) + iVar3); piVar1 = (int *)((int)in_ECX + 0x584); *piVar1 = *piVar1 - (uint)bVar2; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar2 & 0x1f); if (*piVar1 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; iVar3 = -1; } } if ((*(char *)((int)in_EDX + 0x17) != '\0') && (*(int *)((int)in_EDX + 0x82c) <= iVar3)) { _wassert(L"z < c->sorted_entries", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x6b1); } if (-1 < iVar3) { return iVar3; } if ((*(char *)((int)in_ECX + 0x570) == '\0') && (*(int *)((int)in_ECX + 0x578) != 0)) { return iVar3; } } *(undefined4 *)((int)in_ECX + 0x74) = 0x15; return iVar3; } //@@ 00aa20b0 stb_vorbis::codebook_decode /* DB: stb_vorbis codebook_decode(f,c,output,len): codebook_decode_start then adds dimensions entries of multiplicands (sequence_p +0x16 accumulates) into output; decode_residue rtype 1 path */ undefined4 stb_vorbis::codebook_decode(uint *param_1,uint param_2) { int iVar1; float *pfVar2; uint uVar3; float fVar4; float fVar5; int iVar6; uint uVar7; float *pfVar8; int iVar9; int iVar10; uint *in_EDX; int iVar11; float fVar12; iVar6 = codebook_decode_start(); if (iVar6 < 0) { return 0; } uVar3 = *in_EDX; if ((int)uVar3 < (int)param_2) { param_2 = uVar3; } iVar6 = uVar3 * iVar6; iVar10 = 0; if (*(char *)((int)in_EDX + 0x16) == '\0') { if (0 < (int)param_2) { if (0xf < param_2) { uVar3 = in_EDX[7]; iVar10 = 0; if ((((uint *)(uVar3 + (iVar6 + -1 + param_2) * 4) < param_1) || (param_1 + (param_2 - 1) < (uint *)(uVar3 + iVar6 * 4))) && ((in_EDX + 7 < param_1 || (param_1 + (param_2 - 1) < in_EDX + 7)))) { uVar7 = param_2 & 0x8000000f; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffff0) + 1; } pfVar8 = (float *)(param_1 + 8); iVar11 = iVar6 * 4 + 0x20; do { pfVar2 = (float *)(iVar11 + -0x20 + uVar3); fVar12 = pfVar2[1]; fVar4 = pfVar2[2]; fVar5 = pfVar2[3]; iVar10 = iVar10 + 0x10; pfVar8[-8] = *pfVar2 + 0.0 + pfVar8[-8]; pfVar8[-7] = fVar12 + 0.0 + pfVar8[-7]; pfVar8[-6] = fVar4 + 0.0 + pfVar8[-6]; pfVar8[-5] = fVar5 + 0.0 + pfVar8[-5]; pfVar2 = (float *)(iVar11 + -0x10 + uVar3); fVar12 = pfVar2[1]; fVar4 = pfVar2[2]; fVar5 = pfVar2[3]; pfVar8[-4] = *pfVar2 + 0.0 + pfVar8[-4]; pfVar8[-3] = fVar12 + 0.0 + pfVar8[-3]; pfVar8[-2] = fVar4 + 0.0 + pfVar8[-2]; pfVar8[-1] = fVar5 + 0.0 + pfVar8[-1]; pfVar2 = (float *)(iVar11 + uVar3); fVar12 = pfVar2[1]; fVar4 = pfVar2[2]; fVar5 = pfVar2[3]; *pfVar8 = *pfVar2 + 0.0 + *pfVar8; pfVar8[1] = fVar12 + 0.0 + pfVar8[1]; pfVar8[2] = fVar4 + 0.0 + pfVar8[2]; pfVar8[3] = fVar5 + 0.0 + pfVar8[3]; pfVar2 = (float *)(iVar11 + 0x10 + uVar3); fVar12 = pfVar2[1]; fVar4 = pfVar2[2]; fVar5 = pfVar2[3]; iVar11 = iVar11 + 0x40; pfVar8[4] = *pfVar2 + 0.0 + pfVar8[4]; pfVar8[5] = fVar12 + 0.0 + pfVar8[5]; pfVar8[6] = fVar4 + 0.0 + pfVar8[6]; pfVar8[7] = fVar5 + 0.0 + pfVar8[7]; pfVar8 = pfVar8 + 0x10; } while (iVar10 < (int)(param_2 - uVar7)); if ((int)param_2 <= iVar10) { return 1; } } } if (3 < (int)(param_2 - iVar10)) { iVar11 = (iVar10 + iVar6) * 4; pfVar8 = (float *)(param_1 + iVar10 + 2); iVar9 = ((param_2 - iVar10) - 4 >> 2) + 1; iVar10 = iVar10 + iVar9 * 4; do { pfVar8[-2] = *(float *)(iVar11 + in_EDX[7]) + 0.0 + pfVar8[-2]; pfVar8[-1] = *(float *)(iVar11 + 4 + in_EDX[7]) + 0.0 + pfVar8[-1]; *pfVar8 = *(float *)(iVar11 + 8 + in_EDX[7]) + 0.0 + *pfVar8; iVar1 = iVar11 + 0xc; iVar11 = iVar11 + 0x10; pfVar8[1] = *(float *)(iVar1 + in_EDX[7]) + 0.0 + pfVar8[1]; pfVar8 = pfVar8 + 4; iVar9 = iVar9 + -1; } while (iVar9 != 0); if ((int)param_2 <= iVar10) { return 1; } } iVar6 = (iVar6 + iVar10) * 4; do { pfVar8 = (float *)(iVar6 + in_EDX[7]); iVar6 = iVar6 + 4; param_1[iVar10] = (uint)(*pfVar8 + 0.0 + (float)param_1[iVar10]); iVar10 = iVar10 + 1; } while (iVar10 < (int)param_2); } } else { fVar12 = 0.0; if (0 < (int)param_2) { iVar6 = iVar6 * 4; do { fVar12 = fVar12 + *(float *)(iVar6 + in_EDX[7]); iVar6 = iVar6 + 4; param_1[iVar10] = (uint)(fVar12 + (float)param_1[iVar10]); iVar10 = iVar10 + 1; fVar12 = fVar12 + (float)in_EDX[3]; } while (iVar10 < (int)param_2); return 1; } } return 1; } //@@ 00aa2310 stb_vorbis::codebook_decode_deinterleave_repeat /* DB: stb_vorbis general-ch version (outputs, ch, &c_inter, &p_inter, len, total): assert "!c->sparse || z < c->sorted_entries", lookup_type error 0x15, divides by ch; decode_residue's ch!=2 path (the ch==2 path calls 00aa2580) */ undefined4 stb_vorbis::codebook_decode_deinterleave_repeat (int param_1,int param_2,int *param_3,int *param_4,int param_5,int param_6) { int iVar1; int *piVar2; byte bVar3; int iVar4; int iVar5; void *in_ECX; int *in_EDX; int iVar6; int iVar7; float local_18; int local_10; int local_c; iVar6 = *param_3; local_c = *in_EDX; iVar5 = *param_4; if (*(char *)((int)in_EDX + 0x15) == '\0') { LAB_00aa256c: *(undefined4 *)((int)in_ECX + 0x74) = 0x15; return 0; } do { if (param_6 < 1) { *param_3 = iVar6; *param_4 = iVar5; return 1; } local_18 = 0.0; if (*(int *)((int)in_ECX + 0x584) < 10) { if (*(int *)((int)in_ECX + 0x584) == 0) { *(undefined4 *)((int)in_ECX + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar4 = get8_packet_raw(in_ECX), iVar4 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar4 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)) ; iVar4 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar4; } while (iVar4 < 0x19); } local_10 = (int)*(short *)((int)in_EDX + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (local_10 < 0) { local_10 = codebook_decode_scalar_raw(in_ECX,in_EDX); } else { bVar3 = *(byte *)(in_EDX[2] + local_10); piVar2 = (int *)((int)in_ECX + 0x584); *piVar2 = *piVar2 - (uint)bVar3; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar3 & 0x1f); if (*piVar2 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; local_10 = -1; } } if ((*(char *)((int)in_EDX + 0x17) != '\0') && (in_EDX[0x20b] <= local_10)) { _wassert(L"!c->sparse || z < c->sorted_entries", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x70f); } if (local_10 < 0) { if ((*(char *)((int)in_ECX + 0x570) == '\0') && (*(int *)((int)in_ECX + 0x578) != 0)) { return 0; } goto LAB_00aa256c; } if (param_2 * param_5 < iVar5 * param_2 + local_c + iVar6) { local_c = (param_5 - iVar5) * param_2 + iVar6; } if (*(char *)((int)in_EDX + 0x16) == '\0') { if (0 < local_c) { iVar4 = *in_EDX * local_10 * 4; iVar7 = iVar5; local_18 = (float)local_c; do { iVar5 = *(int *)(param_1 + iVar6 * 4); *(float *)(iVar5 + iVar7 * 4) = *(float *)(iVar4 + in_EDX[7]) + 0.0 + *(float *)(iVar5 + iVar7 * 4); iVar1 = iVar6 + 1; iVar5 = iVar7 + 1; if (iVar1 != param_2) { iVar5 = iVar7; } iVar6 = 0; if (iVar1 != param_2) { iVar6 = iVar1; } iVar4 = iVar4 + 4; local_18 = (float)((int)local_18 + -1); iVar7 = iVar5; } while (local_18 != 0.0); } } else if (0 < local_c) { iVar4 = *in_EDX * local_10 * 4; iVar7 = iVar5; local_10 = local_c; do { iVar1 = iVar6 + 1; local_18 = local_18 + *(float *)(iVar4 + in_EDX[7]); iVar6 = *(int *)(param_1 + iVar6 * 4); *(float *)(iVar6 + iVar7 * 4) = local_18 + *(float *)(iVar6 + iVar7 * 4); iVar5 = iVar7 + 1; if (iVar1 != param_2) { iVar5 = iVar7; } iVar6 = 0; if (iVar1 != param_2) { iVar6 = iVar1; } iVar4 = iVar4 + 4; local_10 = local_10 + -1; iVar7 = iVar5; } while (local_10 != 0); } param_6 = param_6 - local_c; } while( true ); } //@@ 00aa2580 stb_vorbis::codebook_decode_deinterleave_repeat_2 /* DB: stb_vorbis: the ch==2 path (&1, >>1, no ch argument); the general version is 00aa2310 stb_vorbis::codebook_decode_deinterleave_repeat undefined4 stb_vorbis::codebook_decode_deinterleave_repeat_2 (int *param_1,uint *param_2,int *param_3,int param_4,int param_5) { int *piVar1; int iVar2; byte bVar3; int iVar4; int iVar5; void *in_ECX; float *pfVar6; int *in_EDX; int iVar7; uint uVar8; int iVar9; uint uVar10; int iVar11; bool bVar12; int local_1c; float local_18; uint local_14; uint local_10; int local_c; uVar8 = *param_2; local_c = *in_EDX; iVar11 = *param_3; local_10 = uVar8; if (*(char *)((int)in_EDX + 0x15) == '\0') { LAB_00aa266d: *(undefined4 *)((int)in_ECX + 0x74) = 0x15; return 0; } do { if (param_5 < 1) { *param_2 = uVar8; *param_3 = iVar11; return 1; } local_18 = 0.0; if (*(int *)((int)in_ECX + 0x584) < 10) { if (*(int *)((int)in_ECX + 0x584) == 0) { *(undefined4 *)((int)in_ECX + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar5 = get8_packet_raw(in_ECX), iVar5 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar5 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)) ; iVar5 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar5; } while (iVar5 < 0x19); } local_1c = (int)*(short *)((int)in_EDX + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (local_1c < 0) { local_1c = codebook_decode_scalar_raw(in_ECX,in_EDX); if (local_1c < 0) goto LAB_00aa265b; } else { bVar3 = *(byte *)(in_EDX[2] + local_1c); piVar1 = (int *)((int)in_ECX + 0x584); *piVar1 = *piVar1 - (uint)bVar3; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar3 & 0x1f); if (*piVar1 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; LAB_00aa265b: if ((*(char *)((int)in_ECX + 0x570) == '\0') && (*(int *)((int)in_ECX + 0x578) != 0)) { return 0; } goto LAB_00aa266d; } } if (param_4 * 2 < (int)(local_c + iVar11 * 2 + uVar8)) { local_c = uVar8 + (param_4 - iVar11) * 2; } local_1c = *in_EDX * local_1c; if (*(char *)((int)in_EDX + 0x16) == '\0') { bVar12 = uVar8 != 1; if (bVar12) { iVar5 = param_1[1]; } else { uVar8 = 0; local_10 = 0; iVar5 = param_1[1]; *(float *)(iVar5 + iVar11 * 4) = *(float *)(in_EDX[7] + local_1c * 4) + 0.0 + *(float *)(iVar5 + iVar11 * 4); iVar11 = iVar11 + 1; } local_14 = (uint)!bVar12; uVar10 = (uint)!bVar12; iVar4 = *param_1; iVar9 = uVar10 + 1; if (iVar9 < local_c) { pfVar6 = (float *)(iVar5 + iVar11 * 4); iVar5 = param_1[1]; iVar7 = (local_14 + local_1c) * 4; uVar10 = local_14; do { iVar9 = iVar9 + 2; iVar11 = iVar11 + 1; uVar10 = uVar10 + 2; *(float *)((iVar4 - iVar5) + (int)pfVar6) = *(float *)(iVar7 + in_EDX[7]) + 0.0 + *(float *)((iVar4 - iVar5) + (int)pfVar6); iVar2 = iVar7 + 4; iVar7 = iVar7 + 8; *pfVar6 = *(float *)(iVar2 + in_EDX[7]) + 0.0 + *pfVar6; pfVar6 = pfVar6 + 1; } while (iVar9 < local_c); uVar8 = local_10; } if ((int)uVar10 < local_c) { local_10 = uVar8 + 1; *(float *)(param_1[uVar8] + iVar11 * 4) = *(float *)(in_EDX[7] + (local_1c + uVar10) * 4) + 0.0 + *(float *)(param_1[uVar8] + iVar11 * 4); uVar8 = local_10; if (local_10 == 2) { iVar11 = iVar11 + 1; local_10 = 0; uVar8 = local_10; } } } else if (0 < local_c) { local_1c = local_1c * 4; iVar5 = local_c; iVar9 = iVar11; do { local_18 = local_18 + *(float *)(local_1c + in_EDX[7]); *(float *)(param_1[uVar8] + iVar9 * 4) = local_18 + *(float *)(param_1[uVar8] + iVar9 * 4); iVar11 = iVar9 + 1; if (uVar8 != 1) { iVar11 = iVar9; } local_1c = local_1c + 4; uVar8 = -(uint)(uVar8 != 1) & uVar8 + 1; iVar5 = iVar5 + -1; iVar9 = iVar11; local_10 = uVar8; } while (iVar5 != 0); } param_5 = param_5 - local_c; } while( true ); } //@@ 00aa2850 stb_vorbis_decode_residue /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* DB: stb_vorbis decode_residue(f, residue_buffers, ch, n, rn, do_not_decode): Residue r = cfg+rn*0x18 with classbook byte at +0xd indexing f->codebooks (f+0x8c, Codebook stride 0x830), (end-begin)/part_size, temp_alloc; region holds stb_vorbis asserts */ void stb_vorbis_decode_residue(int param_1,int param_2,int param_3,int param_4) { byte bVar1; short sVar2; int iVar3; int iVar4; uint uVar5; int iVar6; int iVar7; void *in_ECX; int *piVar8; int *in_EDX; int iVar9; float *pfVar10; void *pvVar11; int iVar12; int iVar13; float fVar14; float fVar15; int local_64 [4]; int local_54; int local_4c; int local_48; int local_3c; int local_38; int *local_34; uint local_30; float *local_2c; uint local_28; uint *local_24; int *local_20; void *local_1c; int local_18; int local_14; int local_10; int local_c; uint local_8; local_8 = __security_cookie ^ (uint)(local_64 + 0x18); local_c = param_3 * 3; local_14 = *(int *)((int)in_ECX + 0x19c); sVar2 = *(short *)((int)in_ECX + param_3 * 2 + 0x11c); iVar13 = *(int *)((int)in_ECX + 4); iVar3 = *(int *)((uint)*(byte *)(local_14 + 0xd + param_3 * 0x18) * 0x830 + *(int *)((int)in_ECX + 0x8c)); local_24 = (uint *)(local_14 + (local_c + 1) * 8); uVar5 = (uint)(*(int *)(local_14 + 4 + param_3 * 0x18) - *(int *)(local_14 + param_3 * 0x18)) / *local_24; iVar4 = *(int *)((int)in_ECX + 0x6c); if (*(int *)((int)in_ECX + 0x60) == 0) { local_34 = local_64 + -4; } else { iVar6 = iVar4 - (uVar5 * 4 + 4) * iVar13; if (iVar6 < *(int *)((int)in_ECX + 0x68)) { local_34 = (int *)0x0; } else { local_34 = (int *)(*(int *)((int)in_ECX + 0x60) + iVar6); *(int *)((int)in_ECX + 0x6c) = iVar6; } } iVar6 = 0; piVar8 = local_34 + iVar13; local_28 = uVar5; local_1c = in_ECX; if (0 < iVar13) { do { local_34[iVar6] = (int)piVar8; iVar6 = iVar6 + 1; piVar8 = piVar8 + uVar5; } while (iVar6 < iVar13); } iVar13 = 0; if (0 < param_1) { do { if (*(char *)(iVar13 + param_4) == '\0') { memset((void *)in_EDX[iVar13],0,param_2 * 4); } iVar13 = iVar13 + 1; } while (iVar13 < param_1); in_ECX = local_1c; } if ((sVar2 == 2) && (param_1 != 1)) { iVar13 = 0; if (0 < param_1) { do { if (*(char *)(iVar13 + param_4) == '\0') break; iVar13 = iVar13 + 1; } while (iVar13 < param_1); } if (iVar13 != param_1) { local_10 = 0; do { iVar13 = 0; if (param_1 == 2) { if (0 < (int)local_28) { local_18 = 0; do { in_ECX = local_1c; uVar5 = *local_24 * iVar13 + *(int *)(local_14 + local_c * 8); local_30 = uVar5 & 1; local_2c = (float *)((int)uVar5 >> 1); if (local_10 == 0) { pvVar11 = (void *)((uint)*(byte *)(local_14 + 0xd + local_c * 8) * 0x830 + *(int *)((int)local_1c + 0x8c)); if (*(int *)((int)local_1c + 0x584) < 10) { if (*(int *)((int)local_1c + 0x584) == 0) { *(undefined4 *)((int)local_1c + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar6 = stb_vorbis::get8_packet_raw(in_ECX), iVar6 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar6 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)); iVar6 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar6; } while (iVar6 < 0x19); } iVar6 = (int)*(short *)((int)pvVar11 + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (iVar6 < 0) { iVar6 = stb_vorbis::codebook_decode_scalar_raw(in_ECX,pvVar11); } else { bVar1 = *(byte *)(*(int *)((int)pvVar11 + 8) + iVar6); piVar8 = (int *)((int)in_ECX + 0x584); *piVar8 = *piVar8 - (uint)bVar1; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar1 & 0x1f); if (*piVar8 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; iVar6 = -1; } } if (*(char *)((int)pvVar11 + 0x17) != '\0') { iVar6 = *(int *)(*(int *)((int)pvVar11 + 0x828) + iVar6 * 4); } if (iVar6 == -1) goto LAB_00aa3082; *(undefined4 *)(local_18 + *local_34) = *(undefined4 *)(*(int *)(local_14 + 0x10 + local_c * 8) + iVar6 * 4); } iVar6 = 0; if (0 < iVar3) { do { if ((int)local_28 <= iVar13) break; in_ECX = local_1c; if (*(short *)(*(int *)(local_14 + 0x14 + local_c * 8) + (local_10 + (uint)*(byte *)(*(int *)(*local_34 + local_18) + iVar6) * 8) * 2) < 0) { uVar5 = *local_24 * iVar13 + *(int *)(local_14 + local_c * 8) + *local_24; local_30 = uVar5 & 1; local_2c = (float *)((int)uVar5 >> 1); } else { iVar7 = stb_vorbis::codebook_decode_deinterleave_repeat_2 (in_EDX,&local_30,&local_2c,param_2,*local_24); if (iVar7 == 0) goto LAB_00aa3082; } iVar6 = iVar6 + 1; iVar13 = iVar13 + 1; } while (iVar6 < iVar3); } local_18 = local_18 + 4; } while (iVar13 < (int)local_28); } } else if (0 < (int)local_28) { local_20 = (int *)0x0; do { in_ECX = local_1c; iVar6 = *local_24 * iVar13 + *(int *)(local_14 + local_c * 8); local_2c = (float *)(iVar6 / param_1); local_30 = iVar6 % param_1; if (local_10 == 0) { pvVar11 = (void *)((uint)*(byte *)(local_14 + 0xd + local_c * 8) * 0x830 + *(int *)((int)local_1c + 0x8c)); if (*(int *)((int)local_1c + 0x584) < 10) { if (*(int *)((int)local_1c + 0x584) == 0) { *(undefined4 *)((int)local_1c + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar6 = stb_vorbis::get8_packet_raw(in_ECX), iVar6 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar6 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)); iVar6 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar6; } while (iVar6 < 0x19); } iVar6 = (int)*(short *)((int)pvVar11 + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (iVar6 < 0) { iVar6 = stb_vorbis::codebook_decode_scalar_raw(in_ECX,pvVar11); } else { bVar1 = *(byte *)(*(int *)((int)pvVar11 + 8) + iVar6); piVar8 = (int *)((int)in_ECX + 0x584); *piVar8 = *piVar8 - (uint)bVar1; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar1 & 0x1f); if (*piVar8 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; iVar6 = -1; } } if (*(char *)((int)pvVar11 + 0x17) != '\0') { iVar6 = *(int *)(*(int *)((int)pvVar11 + 0x828) + iVar6 * 4); } if (iVar6 == -1) goto LAB_00aa3082; *(undefined4 *)((int)local_20 + *local_34) = *(undefined4 *)(*(int *)(local_14 + 0x10 + local_c * 8) + iVar6 * 4); } iVar6 = 0; if (0 < iVar3) { do { if ((int)local_28 <= iVar13) break; in_ECX = local_1c; if (*(short *)(*(int *)(local_14 + 0x14 + local_c * 8) + (local_10 + (uint)*(byte *)(*(int *)((int)local_20 + *local_34) + iVar6) * 8) * 2) < 0) { iVar7 = *local_24 + *local_24 * iVar13 + *(int *)(local_14 + local_c * 8); local_2c = (float *)(iVar7 / param_1); local_30 = iVar7 % param_1; } else { iVar7 = stb_vorbis::codebook_decode_deinterleave_repeat (in_EDX,param_1,&local_30,&local_2c,param_2,*local_24); if (iVar7 == 0) goto LAB_00aa3082; } iVar6 = iVar6 + 1; iVar13 = iVar13 + 1; } while (iVar6 < iVar3); } local_20 = local_20 + 1; } while (iVar13 < (int)local_28); } local_10 = local_10 + 1; } while (local_10 < 8); } } else { local_30 = 0; uVar5 = local_28; do { iVar13 = 0; local_54 = 0; if (0 < (int)uVar5) { local_10 = 0; do { if (local_30 == 0) { local_38 = 0; if (0 < param_1) { do { if (*(char *)(local_38 + param_4) == '\0') { pvVar11 = (void *)((uint)*(byte *)(local_14 + 0xd + local_c * 8) * 0x830 + *(int *)((int)in_ECX + 0x8c)); if (*(int *)((int)in_ECX + 0x584) < 10) { if (*(int *)((int)in_ECX + 0x584) == 0) { *(undefined4 *)((int)in_ECX + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar13 = stb_vorbis::get8_packet_raw(in_ECX), iVar13 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar13 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)); iVar13 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar13; } while (iVar13 < 0x19); } iVar13 = (int)*(short *)((int)pvVar11 + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (iVar13 < 0) { iVar13 = stb_vorbis::codebook_decode_scalar_raw(in_ECX,pvVar11); } else { bVar1 = *(byte *)(*(int *)((int)pvVar11 + 8) + iVar13); piVar8 = (int *)((int)in_ECX + 0x584); *piVar8 = *piVar8 - (uint)bVar1; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar1 & 0x1f); if (*piVar8 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; iVar13 = -1; } } if (*(char *)((int)pvVar11 + 0x17) != '\0') { iVar13 = *(int *)(*(int *)((int)pvVar11 + 0x828) + iVar13 * 4); } if (iVar13 == -1) goto LAB_00aa307f; *(undefined4 *)(local_10 + local_34[local_38]) = *(undefined4 *)(*(int *)(local_14 + 0x10 + local_c * 8) + iVar13 * 4); } local_38 = local_38 + 1; uVar5 = local_28; iVar13 = local_54; } while (local_38 < param_1); } } local_18 = 0; if (0 < iVar3) { do { if ((int)uVar5 <= iVar13) break; local_48 = 0; iVar6 = local_18; if (0 < param_1) { local_20 = in_EDX; do { pvVar11 = local_1c; if (*(char *)(local_48 + param_4) == '\0') { iVar13 = (int)*(short *)(*(int *)(local_14 + 0x14 + local_c * 8) + (local_30 + (uint)*(byte *)(*(int *)(*(int *)(((int)local_34 - (int)in_EDX) + (int)local_20) + local_10) + iVar6) * 8) * 2); if (-1 < iVar13) { iVar6 = *local_20; uVar5 = *local_24; piVar8 = (int *)(iVar13 * 0x830 + *(int *)((int)in_ECX + 0x8c)); iVar13 = uVar5 * local_54 + *(int *)(local_14 + local_c * 8); if (sVar2 == 0) { local_3c = 0; iVar7 = (int)uVar5 / *piVar8; if (0 < iVar7) { iVar12 = uVar5 - iVar13; local_2c = (float *)(iVar6 + iVar13 * 4); do { iVar13 = stb_vorbis::codebook_decode_start(piVar8); fVar15 = 0.0; if (iVar13 < 0) goto LAB_00aa307f; local_4c = 0; iVar6 = *piVar8; iVar9 = iVar6; if (iVar12 <= iVar6) { iVar9 = iVar12; } if (0 < iVar9) { iVar13 = iVar6 * iVar13 * 4; pfVar10 = local_2c; do { fVar14 = fVar15 + *(float *)(piVar8[7] + iVar13); *pfVar10 = fVar14 + *pfVar10; if (*(char *)((int)piVar8 + 0x16) != '\0') { fVar15 = fVar14; } iVar13 = iVar13 + 4; pfVar10 = pfVar10 + iVar7; local_4c = local_4c + 1; } while (local_4c < iVar9); } iVar12 = iVar12 + -1; local_2c = local_2c + 1; local_3c = local_3c + 1; } while (local_3c < iVar7); } } else { iVar7 = 0; if (0 < (int)uVar5) { do { iVar12 = stb_vorbis::codebook_decode(iVar6 + iVar13 * 4,uVar5 - iVar7); if (iVar12 == 0) goto LAB_00aa307f; iVar7 = iVar7 + *piVar8; iVar13 = iVar13 + *piVar8; } while (iVar7 < (int)uVar5); } pvVar11 = local_1c; } in_ECX = pvVar11; } iVar6 = local_18; } local_48 = local_48 + 1; local_20 = local_20 + 1; } while (local_48 < param_1); iVar13 = local_54; } local_18 = iVar6 + 1; iVar13 = iVar13 + 1; uVar5 = local_28; local_54 = iVar13; } while (local_18 < iVar3); } local_10 = local_10 + 4; } while (iVar13 < (int)uVar5); } local_30 = local_30 + 1; } while ((int)local_30 < 8); LAB_00aa307f: in_ECX = local_1c; } LAB_00aa3082: *(int *)((int)in_ECX + 0x6c) = iVar4; return; } //@@ 00aa30a0 stb_vorbis::imdct_step3_iter0_loop /* DB: stb_vorbis: assert "(n & 3) == 0" (ogg.cpp 0x995), A stride 8 butterfly; inverse_mdct calls it twice first */ void stb_vorbis::imdct_step3_iter0_loop(int param_1,int param_2,float *param_3) { float *pfVar1; float *pfVar2; uint in_ECX; float *pfVar3; int in_EDX; int iVar4; float *pfVar5; float fVar6; float fVar7; pfVar5 = (float *)(in_EDX + (param_1 + param_2) * 4); if ((in_ECX & 3) != 0) { _wassert(L"(n & 3) == 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0x995); } iVar4 = (int)in_ECX >> 2; if (0 < iVar4) { pfVar3 = (float *)((int)pfVar5 - (param_2 * 4 + 8)); do { fVar7 = pfVar3[2] - *pfVar5; fVar6 = pfVar3[1] - pfVar5[-1]; pfVar3[2] = *pfVar5 + pfVar3[2]; pfVar3[1] = pfVar3[1] + pfVar5[-1]; *pfVar5 = fVar7 * *param_3 - fVar6 * param_3[1]; pfVar5[-1] = fVar6 * *param_3 + fVar7 * param_3[1]; fVar7 = *pfVar3 - pfVar5[-2]; fVar6 = pfVar3[-1] - pfVar5[-3]; *pfVar3 = *pfVar3 + pfVar5[-2]; pfVar3[-1] = pfVar3[-1] + pfVar5[-3]; pfVar5[-2] = fVar7 * param_3[8] - fVar6 * param_3[9]; pfVar5[-3] = fVar6 * param_3[8] + fVar7 * param_3[9]; fVar7 = pfVar3[-2] - pfVar5[-4]; fVar6 = pfVar3[-3] - pfVar5[-5]; pfVar3[-2] = pfVar3[-2] + pfVar5[-4]; pfVar3[-3] = pfVar3[-3] + pfVar5[-5]; pfVar5[-4] = fVar7 * param_3[0x10] - fVar6 * param_3[0x11]; pfVar5[-5] = fVar6 * param_3[0x10] + fVar7 * param_3[0x11]; fVar7 = pfVar3[-4] - pfVar5[-6]; fVar6 = pfVar3[-5] - pfVar5[-7]; pfVar3[-4] = pfVar5[-6] + pfVar3[-4]; pfVar3[-5] = pfVar3[-5] + pfVar5[-7]; pfVar5[-6] = fVar7 * param_3[0x18] - fVar6 * param_3[0x19]; pfVar1 = param_3 + 0x18; pfVar2 = param_3 + 0x19; param_3 = param_3 + 0x20; pfVar5[-7] = fVar6 * *pfVar1 + fVar7 * *pfVar2; iVar4 = iVar4 + -1; pfVar5 = pfVar5 + -8; pfVar3 = pfVar3 + -8; } while (0 < iVar4); } return; } //@@ 00aa3270 stb_vorbis::imdct_step3_inner_r_loop /* DB: stb_vorbis imdct step3 inner r loop (lim=n>>2, e, d0, A, k1 stride param_4 = 16 or 1<> 2; pfVar4 = (float *)(in_EDX + (param_1 + param_2) * 4); if (0 < iVar5) { pfVar3 = (float *)((int)pfVar4 - (param_2 * 4 + 8)); do { fVar7 = pfVar3[2] - *pfVar4; fVar6 = pfVar3[1] - pfVar4[-1]; pfVar3[2] = *pfVar4 + pfVar3[2]; pfVar3[1] = pfVar3[1] + pfVar4[-1]; *pfVar4 = fVar7 * *param_3 - fVar6 * param_3[1]; pfVar1 = param_3 + param_4; pfVar4[-1] = fVar7 * param_3[1] + fVar6 * *param_3; fVar7 = *pfVar3 - pfVar4[-2]; fVar6 = pfVar3[-1] - pfVar4[-3]; *pfVar3 = *pfVar3 + pfVar4[-2]; pfVar3[-1] = pfVar3[-1] + pfVar4[-3]; pfVar4[-2] = fVar7 * *pfVar1 - fVar6 * pfVar1[1]; pfVar2 = pfVar1 + param_4; pfVar4[-3] = fVar7 * pfVar1[1] + fVar6 * *pfVar1; fVar7 = pfVar3[-2] - pfVar4[-4]; fVar6 = pfVar3[-3] - pfVar4[-5]; pfVar3[-2] = pfVar3[-2] + pfVar4[-4]; pfVar3[-3] = pfVar3[-3] + pfVar4[-5]; pfVar4[-4] = fVar7 * *pfVar2 - fVar6 * pfVar2[1]; pfVar1 = pfVar2 + param_4; pfVar4[-5] = fVar7 * pfVar2[1] + fVar6 * *pfVar2; fVar7 = pfVar3[-4] - pfVar4[-6]; fVar6 = pfVar3[-5] - pfVar4[-7]; pfVar3[-4] = pfVar3[-4] + pfVar4[-6]; pfVar3[-5] = pfVar3[-5] + pfVar4[-7]; pfVar4[-6] = fVar7 * *pfVar1 - fVar6 * pfVar1[1]; iVar5 = iVar5 + -1; pfVar3 = pfVar3 + -8; param_3 = pfVar1 + param_4; pfVar4[-7] = fVar7 * pfVar1[1] + fVar6 * *pfVar1; pfVar4 = pfVar4 + -8; } while (0 < iVar5); } return; } //@@ 00aa3430 stb_vorbis::imdct_step3_inner_s_loop /* DB: stb_vorbis inverse MDCT helper with 7 args (n, e, i_off, k_off, A, a_off, k0 in ECX/EDX + stack), loads A[0],A[1],A[a_off],A[a_off+1] and does the butterfly; only caller inverse_mdct */ void stb_vorbis::imdct_step3_inner_s_loop (int param_1,int param_2,float *param_3,int param_4,int param_5) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; int in_ECX; float *pfVar9; int in_EDX; float *pfVar10; float fVar11; float fVar12; fVar1 = param_3[param_4 + 1]; fVar2 = param_3[param_4]; fVar3 = *param_3; fVar4 = param_3[1]; fVar5 = param_3[param_4 * 2]; fVar6 = param_3[param_4 * 2 + 1]; fVar7 = param_3[param_4 * 3]; fVar8 = param_3[param_4 * 3 + 1]; pfVar10 = (float *)(in_EDX + (param_1 + param_2) * 4); if (0 < in_ECX) { pfVar9 = (float *)((int)pfVar10 - (param_2 * 4 + 8)); do { fVar12 = pfVar9[2] - *pfVar10; fVar11 = pfVar9[1] - pfVar10[-1]; pfVar9[2] = pfVar9[2] + *pfVar10; pfVar9[1] = pfVar9[1] + pfVar10[-1]; *pfVar10 = fVar12 * fVar3 - fVar11 * fVar4; pfVar10[-1] = fVar12 * fVar4 + fVar11 * fVar3; fVar12 = *pfVar9 - pfVar10[-2]; fVar11 = pfVar9[-1] - pfVar10[-3]; *pfVar9 = *pfVar9 + pfVar10[-2]; pfVar9[-1] = pfVar9[-1] + pfVar10[-3]; pfVar10[-2] = fVar12 * fVar2 - fVar11 * fVar1; pfVar10[-3] = fVar12 * fVar1 + fVar11 * fVar2; fVar12 = pfVar9[-2] - pfVar10[-4]; fVar11 = pfVar9[-3] - pfVar10[-5]; pfVar9[-2] = pfVar9[-2] + pfVar10[-4]; pfVar9[-3] = pfVar9[-3] + pfVar10[-5]; pfVar10[-4] = fVar12 * fVar5 - fVar11 * fVar6; pfVar10[-5] = fVar12 * fVar6 + fVar11 * fVar5; fVar12 = pfVar9[-4] - pfVar10[-6]; fVar11 = pfVar9[-5] - pfVar10[-7]; pfVar9[-4] = pfVar9[-4] + pfVar10[-6]; pfVar9[-5] = pfVar9[-5] + pfVar10[-7]; pfVar10[-6] = fVar12 * fVar7 - fVar11 * fVar8; pfVar10[-7] = fVar12 * fVar8 + fVar11 * fVar7; pfVar10 = pfVar10 + -param_5; in_ECX = in_ECX + -1; pfVar9 = pfVar9 + -param_5; } while (0 < in_ECX); } return; } //@@ 00aa3620 stb_vorbis::imdct_step3_inner_s_loop_ld654 /* DB: stb_vorbis inverse MDCT 16-wide butterfly with A2 = A[base_n>>3] (param_3>>3); last step call in inverse_mdct */ void stb_vorbis::imdct_step3_inner_s_loop_ld654(int param_1,int param_2,int param_3) { float fVar1; float *pfVar2; int in_ECX; int in_EDX; float *pfVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; float fVar19; float fVar20; float fVar21; fVar1 = *(float *)(param_2 + (param_3 >> 3) * 4); pfVar2 = (float *)(in_EDX + param_1 * 4); pfVar3 = pfVar2 + in_ECX * -0x10; for (; pfVar3 < pfVar2; pfVar2 = pfVar2 + -0x10) { fVar13 = pfVar2[-1] - pfVar2[-9]; fVar10 = pfVar2[-9] + pfVar2[-1]; fVar4 = *pfVar2 - pfVar2[-8]; fVar6 = pfVar2[-8] + *pfVar2; fVar17 = pfVar2[-3] - pfVar2[-0xb]; fVar11 = pfVar2[-0xb] + pfVar2[-3]; fVar7 = pfVar2[-2] - pfVar2[-10]; fVar14 = pfVar2[-10] + pfVar2[-2]; fVar15 = pfVar2[-0xe] - pfVar2[-6]; fVar12 = pfVar2[-6] + pfVar2[-0xe]; fVar5 = (fVar17 + fVar7) * fVar1; fVar8 = pfVar2[-5] - pfVar2[-0xd]; fVar18 = (fVar17 - fVar7) * fVar1; fVar7 = pfVar2[-0xc] - pfVar2[-4]; fVar20 = pfVar2[-4] + pfVar2[-0xc]; fVar17 = pfVar2[-7] - pfVar2[-0xf]; fVar16 = pfVar2[-0xf] + pfVar2[-7]; fVar21 = pfVar2[-0xd] + pfVar2[-5]; fVar9 = fVar6 - fVar20; fVar20 = fVar20 + fVar6; fVar19 = (fVar17 + fVar15) * fVar1; fVar17 = (fVar15 - fVar17) * fVar1; fVar6 = fVar12 + fVar14; fVar14 = fVar14 - fVar12; fVar12 = fVar11 - fVar16; fVar16 = fVar16 + fVar11; *pfVar2 = fVar6 + fVar20; pfVar2[-2] = fVar20 - fVar6; fVar6 = fVar10 - fVar21; fVar21 = fVar21 + fVar10; pfVar2[-4] = fVar12 + fVar9; pfVar2[-6] = fVar9 - fVar12; fVar9 = fVar4 + fVar8; fVar4 = fVar4 - fVar8; pfVar2[-1] = fVar16 + fVar21; pfVar2[-3] = fVar21 - fVar16; pfVar2[-7] = fVar6 + fVar14; fVar12 = fVar19 + fVar5; pfVar2[-5] = fVar6 - fVar14; fVar5 = fVar5 - fVar19; fVar14 = fVar18 - fVar17; fVar17 = fVar17 + fVar18; pfVar2[-8] = fVar12 + fVar9; pfVar2[-10] = fVar9 - fVar12; pfVar2[-0xc] = fVar14 + fVar4; pfVar2[-0xe] = fVar4 - fVar14; fVar4 = fVar13 + fVar7; fVar13 = fVar13 - fVar7; pfVar2[-9] = fVar17 + fVar4; pfVar2[-0xb] = fVar4 - fVar17; pfVar2[-0xd] = fVar13 - fVar5; pfVar2[-0xf] = fVar13 + fVar5; } return; } //@@ 00aa38a0 inverse_mdct /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* DB: stb_vorbis (KAGE ogg.cpp): (vorb* f, int blocktype) with buffer in ECX, n in EDX; n>>1,>>2,>>3 strides, f->A[blocktype] twiddles at f+0x43c, temp_alloc via f+0x60/0x68/0x6c; caller 00aa44d0 stb_vorbis::vorbis_decode_packet_rest vorbis_decode_packet_rest */ void inverse_mdct(int param_1,int param_2) { float *pfVar1; float *pfVar2; float *pfVar3; float *pfVar4; int iVar5; byte bVar6; int iVar7; int iVar8; float *pfVar9; float *pfVar10; int iVar11; uint uVar12; float *pfVar13; float *pfVar14; float *in_ECX; int iVar15; uint uVar16; int in_EDX; float *pfVar17; int iVar18; int iVar19; int iVar20; float *pfVar21; float fVar22; float fVar23; float fVar24; float fVar25; float fVar26; float fVar27; float local_54 [4]; int local_44; int local_38; float *local_24; uint local_18; ushort *local_14; float *local_10; float *local_c; iVar18 = in_EDX >> 2; iVar15 = in_EDX >> 1; iVar7 = in_EDX >> 3; iVar5 = *(int *)(param_1 + 0x6c); if (*(int *)(param_1 + 0x60) == 0) { pfVar9 = local_54 + -3; } else { iVar8 = iVar5 + iVar15 * -4; if (iVar8 < *(int *)(param_1 + 0x68)) { pfVar9 = (float *)0x0; } else { *(int *)(param_1 + 0x6c) = iVar8; pfVar9 = (float *)(iVar8 + *(int *)(param_1 + 0x60)); } } pfVar13 = pfVar9 + iVar15 + -2; pfVar17 = *(float **)(param_1 + 0x43c + param_2 * 4); pfVar21 = pfVar17; for (pfVar14 = in_ECX; pfVar14 != in_ECX + iVar15; pfVar14 = pfVar14 + 4) { pfVar13[1] = *pfVar21 * *pfVar14 - pfVar21[1] * pfVar14[2]; fVar22 = *pfVar21; pfVar10 = pfVar21 + 1; pfVar21 = pfVar21 + 2; *pfVar13 = fVar22 * pfVar14[2] + *pfVar10 * *pfVar14; pfVar13 = pfVar13 + -2; } pfVar14 = in_ECX + iVar15 + -3; for (; pfVar9 <= pfVar13; pfVar13 = pfVar13 + -2) { pfVar13[1] = -pfVar14[2] * *pfVar21 - -*pfVar14 * pfVar21[1]; fVar22 = *pfVar14; pfVar10 = pfVar21 + 1; fVar23 = *pfVar21; pfVar21 = pfVar21 + 2; pfVar1 = pfVar14 + 2; pfVar14 = pfVar14 + -4; *pfVar13 = -fVar22 * fVar23 - *pfVar10 * *pfVar1; } pfVar13 = pfVar17 + iVar15 + -8; if (pfVar17 <= pfVar13) { pfVar14 = pfVar9 + iVar18 + 2; pfVar21 = in_ECX + 1; pfVar10 = (float *)(((2 - iVar18) * 4 - (int)in_ECX) + (int)(in_ECX + iVar18) + (int)pfVar9); local_24 = in_ECX + iVar18; do { fVar22 = pfVar14[-2]; fVar23 = pfVar10[-2]; fVar24 = pfVar14[-1] - *(float *)(((int)pfVar9 - (int)in_ECX) + (int)pfVar21); local_24[1] = pfVar14[-1] + *(float *)(((int)pfVar9 - (int)in_ECX) + (int)pfVar21); *local_24 = pfVar10[-2] + pfVar14[-2]; *pfVar21 = fVar24 * pfVar13[4] - (fVar22 - fVar23) * pfVar13[5]; pfVar21[-1] = (fVar22 - fVar23) * pfVar13[4] + fVar24 * pfVar13[5]; fVar22 = *pfVar14; fVar25 = pfVar14[1] - pfVar10[1]; fVar23 = *pfVar10; local_24[3] = pfVar10[1] + pfVar14[1]; fVar24 = *pfVar10; pfVar10 = pfVar10 + 4; *(float *)(((int)in_ECX - (int)pfVar9) + (int)pfVar14) = *pfVar14 + fVar24; pfVar14 = pfVar14 + 4; pfVar21[2] = fVar25 * *pfVar13 - (fVar22 - fVar23) * pfVar13[1]; pfVar1 = pfVar13 + 1; fVar24 = *pfVar13; pfVar13 = pfVar13 + -8; pfVar21[1] = fVar25 * *pfVar1 + (fVar22 - fVar23) * fVar24; pfVar21 = pfVar21 + 4; local_24 = local_24 + 4; } while (pfVar17 <= pfVar13); } iVar8 = stb_vorbis::ilog(in_EDX); iVar11 = iVar15 + -1; stb_vorbis::imdct_step3_iter0_loop(iVar11,-iVar7,pfVar17); stb_vorbis::imdct_step3_iter0_loop((iVar15 - iVar18) + -1,-iVar7,pfVar17); iVar19 = -(in_EDX >> 4); stb_vorbis::imdct_step3_inner_r_loop(iVar11,iVar19,pfVar17,0x10); stb_vorbis::imdct_step3_inner_r_loop((iVar15 - iVar7) + -1,iVar19,pfVar17,0x10); stb_vorbis::imdct_step3_inner_r_loop(iVar15 + iVar7 * -2 + -1,iVar19,pfVar17,0x10); stb_vorbis::imdct_step3_inner_r_loop(iVar15 + iVar7 * -3 + -1,iVar19,pfVar17,0x10); local_38 = 2; local_44 = 2; iVar7 = iVar8 + -4 >> 1; if (2 < iVar7) { local_18 = 4; do { iVar19 = in_EDX >> ((char)local_44 + 2U & 0x1f); local_18 = local_18 << 1 | (uint)((int)local_18 < 0); if (0 < (int)local_18) { bVar6 = (char)local_44 + 3U & 0x1f; iVar20 = iVar11; local_14 = (ushort *)local_18; do { stb_vorbis::imdct_step3_inner_r_loop (iVar20,-(iVar19 >> 1),pfVar17,1 << bVar6 | 1U >> 0x20 - bVar6); iVar20 = iVar20 - iVar19; local_14 = (ushort *)((int)local_14 - 1); } while (local_14 != (ushort *)0x0); } local_38 = local_44 + 1; local_44 = local_38; } while (local_38 < iVar7); } if (local_38 < iVar8 + -7) { bVar6 = (byte)local_38 & 0x1f; uVar12 = 1 << bVar6 | 1U >> 0x20 - bVar6; local_14 = (ushort *)(local_38 + 6); local_38 = (iVar8 + -7) - local_38; do { iVar7 = in_EDX >> ((byte)local_14 - 4 & 0x1f); uVar16 = uVar12 << 3 | uVar12 >> 0x1d; uVar12 = uVar12 << 1 | (uint)((int)uVar12 < 0); iVar8 = in_EDX >> ((byte)local_14 & 0x1f); if (0 < iVar8) { pfVar13 = pfVar17; iVar19 = iVar11; do { stb_vorbis::imdct_step3_inner_s_loop(iVar19,-(iVar7 >> 1),pfVar13,uVar16,iVar7); iVar8 = iVar8 + -1; pfVar13 = pfVar13 + uVar16 * 4; iVar19 = iVar19 + -8; } while (0 < iVar8); } local_14 = (ushort *)((int)local_14 + 1); local_38 = local_38 + -1; } while (local_38 != 0); } stb_vorbis::imdct_step3_inner_s_loop_ld654(iVar11,pfVar17,in_EDX); local_14 = *(ushort **)(param_1 + 0x45c + param_2 * 4); pfVar13 = pfVar9 + iVar15 + -4; pfVar17 = pfVar9 + iVar18 + -4; if (pfVar9 <= pfVar17) { pfVar21 = (float *)(((6 - iVar18) * 4 - (int)pfVar9) + (int)pfVar13 + (int)pfVar17); do { uVar12 = (uint)*local_14; pfVar21[1] = in_ECX[uVar12]; *pfVar21 = in_ECX[uVar12 + 1]; pfVar17[3] = in_ECX[uVar12 + 2]; pfVar17[2] = in_ECX[uVar12 + 3]; uVar12 = (uint)local_14[1]; pfVar21[-1] = in_ECX[uVar12]; pfVar21[-2] = in_ECX[uVar12 + 1]; pfVar17[1] = in_ECX[uVar12 + 2]; *pfVar17 = in_ECX[uVar12 + 3]; pfVar17 = pfVar17 + -4; local_14 = local_14 + 2; pfVar21 = pfVar21 + -4; } while (pfVar9 <= pfVar17); } if (pfVar9 < pfVar13) { pfVar21 = (float *)(*(int *)(param_1 + 0x44c + param_2 * 4) + 8); pfVar17 = pfVar9 + 2; do { fVar22 = pfVar17[-1] + pfVar13[3]; fVar24 = pfVar17[-2] - pfVar13[2]; fVar23 = pfVar17[-2] + pfVar13[2]; fVar25 = pfVar21[-2] * fVar22 + pfVar21[-1] * fVar24; fVar24 = pfVar21[-1] * fVar22 - pfVar21[-2] * fVar24; fVar22 = pfVar17[-1] - pfVar13[3]; pfVar17[-2] = fVar23 + fVar25; pfVar17[-1] = fVar22 + fVar24; pfVar13[2] = fVar23 - fVar25; pfVar13[3] = fVar24 - fVar22; fVar22 = *pfVar21; pfVar14 = pfVar21 + 1; fVar23 = pfVar17[1] + pfVar13[1]; pfVar21 = pfVar21 + 4; fVar26 = *pfVar17 - *pfVar13; fVar27 = *pfVar14 * fVar23 - fVar22 * fVar26; fVar25 = *pfVar17 + *pfVar13; fVar24 = pfVar17[1] - pfVar13[1]; fVar22 = *pfVar14 * fVar26 + fVar22 * fVar23; *pfVar17 = fVar25 + fVar22; pfVar17[1] = fVar24 + fVar27; *pfVar13 = fVar25 - fVar22; pfVar13[1] = fVar27 - fVar24; pfVar13 = pfVar13 + -4; pfVar14 = pfVar17 + 2; pfVar17 = pfVar17 + 4; } while (pfVar14 < pfVar13); } pfVar13 = in_ECX + iVar15 + -4; pfVar17 = pfVar9 + iVar15 + -8; if (pfVar17 < pfVar9) { *(int *)(param_1 + 0x6c) = iVar5; return; } pfVar21 = in_ECX + 2; pfVar14 = (float *)(*(int *)(param_1 + 0x444 + param_2 * 4) + iVar15 * 4 + -8); local_10 = pfVar13 + (in_EDX - iVar15) + 2; local_c = in_ECX + iVar15 + 2; do { fVar22 = pfVar14[1] * pfVar17[6] - *pfVar14 * pfVar17[7]; fVar23 = -pfVar17[6] * *pfVar14 - pfVar14[1] * pfVar17[7]; pfVar21[-2] = fVar22; pfVar13[3] = -fVar22; local_c[-2] = fVar23; local_10[1] = fVar23; fVar22 = pfVar14[-1] * pfVar17[4] - pfVar14[-2] * pfVar17[5]; fVar23 = -pfVar17[4] * pfVar14[-2] - pfVar14[-1] * pfVar17[5]; pfVar21[-1] = fVar22; pfVar13[2] = -fVar22; local_c[-1] = fVar23; *local_10 = fVar23; fVar22 = pfVar14[-3] * pfVar17[2] - pfVar14[-4] * pfVar17[3]; fVar23 = -pfVar17[2] * pfVar14[-4] - pfVar14[-3] * pfVar17[3]; *pfVar21 = fVar22; pfVar13[1] = -fVar22; *local_c = fVar23; local_10[-1] = fVar23; pfVar10 = pfVar14 + -5; fVar22 = *pfVar17; pfVar1 = pfVar14 + -6; pfVar2 = pfVar17 + 1; pfVar3 = pfVar17 + 1; pfVar17 = pfVar17 + -8; pfVar4 = pfVar14 + -6; pfVar14 = pfVar14 + -8; fVar23 = *pfVar10 * fVar22 - *pfVar1 * *pfVar2; fVar22 = -fVar22 * *pfVar4 - *pfVar10 * *pfVar3; pfVar21[1] = fVar23; *pfVar13 = -fVar23; pfVar21 = pfVar21 + 4; local_c[1] = fVar22; pfVar13 = pfVar13 + -4; local_10[-2] = fVar22; local_10 = local_10 + -4; local_c = local_c + 4; } while (pfVar9 <= pfVar17); *(int *)(param_1 + 0x6c) = iVar5; return; } //@@ 00aa40e0 stb_vorbis::do_floor /* DB: stb_vorbis do_floor(f, map, i, n, target, finalY): floor type check (error 0x15 VORBIS_invalid_stream), floor1 at f+0x114 stride 0x63c, sorted_order +0x346, Xlist +0x152, floor1_multiplier +0x634, inlined draw_line multiplying target by inverse_db_table DAT_00b4e8a0; only caller vorbis_decode_packet_rest */ undefined4 stb_vorbis::do_floor(int param_1,int param_2,int param_3,short *param_4) { float fVar1; uint uVar2; uint uVar3; uint uVar4; float *pfVar5; int in_ECX; int iVar6; int iVar7; int in_EDX; int iVar8; uint uVar9; uint uVar10; uint uVar11; uint uVar12; uint uVar13; int iVar14; int local_10; int local_c; uVar13 = param_2 >> 1; uVar2 = (uint)*(byte *)(*(byte *)(*(int *)(in_EDX + 4) + 2 + param_1 * 3) + 9 + in_EDX); if (*(short *)(in_ECX + 0x94 + uVar2 * 2) == 0) { *(undefined4 *)(in_ECX + 0x74) = 0x15; return 0; } uVar10 = 0; iVar8 = uVar2 * 0x63c + *(int *)(in_ECX + 0x114); iVar6 = (int)*param_4 * (uint)*(byte *)(iVar8 + 0x634); local_10 = 1; iVar14 = iVar6; uVar2 = uVar10; local_c = iVar6; if (1 < *(int *)(iVar8 + 0x638)) { do { uVar11 = (uint)*(byte *)(iVar8 + 0x346 + local_10); iVar14 = iVar6; uVar2 = uVar10; if (-1 < param_4[uVar11]) { iVar14 = (int)param_4[uVar11] * (uint)*(byte *)(iVar8 + 0x634); uVar2 = (uint)*(ushort *)(iVar8 + 0x152 + uVar11 * 2); uVar12 = iVar14 - iVar6; iVar6 = 0; iVar7 = uVar2 - uVar10; uVar9 = (int)uVar12 >> 0x1f; uVar3 = (int)uVar12 / iVar7; uVar11 = uVar13; if ((int)uVar2 <= (int)uVar13) { uVar11 = uVar2; } *(float *)(param_3 + uVar10 * 4) = *(float *)(&DAT_00b4e8a0 + local_c * 4) * *(float *)(param_3 + uVar10 * 4); while (uVar10 = uVar10 + 1, (int)uVar10 < (int)uVar11) { iVar6 = iVar6 + (((uVar12 ^ uVar9) - uVar9) - ((uVar3 ^ (int)uVar3 >> 0x1f) - ((int)uVar3 >> 0x1f)) * iVar7); if (iVar6 < iVar7) { uVar4 = uVar3; } else { iVar6 = iVar6 - iVar7; uVar4 = (uVar9 & 0xfffffffe) + 1 + uVar3; } local_c = local_c + uVar4; *(float *)(param_3 + uVar10 * 4) = *(float *)(&DAT_00b4e8a0 + local_c * 4) * *(float *)(param_3 + uVar10 * 4); } local_c = iVar14; } local_10 = local_10 + 1; iVar6 = iVar14; uVar10 = uVar2; } while (local_10 < *(int *)(iVar8 + 0x638)); } if ((int)uVar2 < (int)uVar13) { if (0xf < uVar13 - uVar2) { fVar1 = *(float *)(&DAT_00b4e8a0 + iVar14 * 4); uVar10 = uVar13 - uVar2 & 0x8000000f; if ((int)uVar10 < 0) { uVar10 = (uVar10 - 1 | 0xfffffff0) + 1; } pfVar5 = (float *)(param_3 + 0x20 + uVar2 * 4); do { uVar2 = uVar2 + 0x10; pfVar5[-8] = pfVar5[-8] * fVar1; pfVar5[-7] = pfVar5[-7] * fVar1; pfVar5[-6] = pfVar5[-6] * fVar1; pfVar5[-5] = pfVar5[-5] * fVar1; pfVar5[-4] = fVar1 * pfVar5[-4]; pfVar5[-3] = fVar1 * pfVar5[-3]; pfVar5[-2] = fVar1 * pfVar5[-2]; pfVar5[-1] = fVar1 * pfVar5[-1]; *pfVar5 = *pfVar5 * fVar1; pfVar5[1] = pfVar5[1] * fVar1; pfVar5[2] = pfVar5[2] * fVar1; pfVar5[3] = pfVar5[3] * fVar1; pfVar5[4] = pfVar5[4] * fVar1; pfVar5[5] = pfVar5[5] * fVar1; pfVar5[6] = pfVar5[6] * fVar1; pfVar5[7] = pfVar5[7] * fVar1; pfVar5 = pfVar5 + 0x10; } while ((int)uVar2 < (int)(uVar13 - uVar10)); if ((int)uVar13 <= (int)uVar2) { return 1; } } fVar1 = *(float *)(&DAT_00b4e8a0 + iVar14 * 4); if (3 < (int)(uVar13 - uVar2)) { iVar14 = uVar2 + 2; iVar6 = ((uVar13 - uVar2) - 4 >> 2) + 1; uVar2 = uVar2 + iVar6 * 4; pfVar5 = (float *)(param_3 + iVar14 * 4); do { pfVar5[-2] = pfVar5[-2] * fVar1; pfVar5[-1] = pfVar5[-1] * fVar1; *pfVar5 = *pfVar5 * fVar1; pfVar5[1] = pfVar5[1] * fVar1; iVar6 = iVar6 + -1; pfVar5 = pfVar5 + 4; } while (iVar6 != 0); if ((int)uVar13 <= (int)uVar2) { return 1; } } do { *(float *)(param_3 + uVar2 * 4) = fVar1 * *(float *)(param_3 + uVar2 * 4); uVar2 = uVar2 + 1; } while ((int)uVar2 < (int)uVar13); } return 1; } //@@ 00aa4340 FUN_00aa4340 undefined4 FUN_00aa4340(int *param_1,int *param_2,int *param_3,uint *param_4) { char *pcVar1; int iVar2; uint uVar3; void *in_ECX; int iVar4; int *in_EDX; int iVar5; int iVar6; uint local_c; *(undefined4 *)((int)in_ECX + 0x5f4) = 0; *(undefined4 *)((int)in_ECX + 0x5f0) = 0; if (*(int *)((int)in_ECX + 0x70) == 0) { while (iVar2 = FUN_00aa19b0(), iVar2 != 0) { uVar3 = stb_vorbis::get_bits(in_ECX,1); if (uVar3 == 0) { if ((*(int *)((int)in_ECX + 0x60) != 0) && (*(int *)((int)in_ECX + 100) != *(int *)((int)in_ECX + 0x6c))) { _wassert(L"f->alloc.alloc_buffer_length_in_bytes == f->temp_offset", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0xc5d ); } iVar2 = stb_vorbis::ilog(*(int *)((int)in_ECX + 0x1a8) + -1); uVar3 = stb_vorbis::get_bits(in_ECX,iVar2); if (uVar3 == 0xffffffff) { return 0; } if (*(int *)((int)in_ECX + 0x1a8) <= (int)uVar3) { return 0; } *param_4 = uVar3; iVar2 = uVar3 * 3 + 0xd6; pcVar1 = (char *)((int)in_ECX + iVar2 * 2); if (*(char *)((int)in_ECX + iVar2 * 2) == '\0') { iVar2 = *(int *)((int)in_ECX + 0x80); local_c = 0; iVar5 = iVar2 >> 1; } else { iVar2 = *(int *)((int)in_ECX + 0x84); uVar3 = stb_vorbis::get_bits(in_ECX,1); local_c = stb_vorbis::get_bits(in_ECX,1); iVar5 = iVar2 >> 1; if ((*pcVar1 != '\0') && (uVar3 == 0)) { iVar4 = iVar2 - *(int *)((int)in_ECX + 0x80) >> 2; iVar6 = *(int *)((int)in_ECX + 0x80) + iVar2 >> 2; goto LAB_00aa4483; } } iVar4 = 0; iVar6 = iVar5; LAB_00aa4483: *in_EDX = iVar4; *param_1 = iVar6; if ((*pcVar1 != '\0') && (local_c == 0)) { iVar5 = iVar2 * 3; iVar2 = iVar5 + *(int *)((int)in_ECX + 0x80) >> 2; iVar5 = iVar5 - *(int *)((int)in_ECX + 0x80) >> 2; } *param_2 = iVar5; *param_3 = iVar2; return 1; } if (*(char *)((int)in_ECX + 0x30) != '\0') { *(undefined4 *)((int)in_ECX + 0x74) = 0x23; return 0; } do { iVar2 = stb_vorbis::get8_packet_raw(in_ECX); *(undefined4 *)((int)in_ECX + 0x584) = 0; } while (iVar2 != -1); if (*(int *)((int)in_ECX + 0x70) != 0) { return 0; } } } return 0; } //@@ 00aa44d0 stb_vorbis::vorbis_decode_packet_rest /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: stb_vorbis assert "f->alloc.alloc_buffer_length_in_bytes == f->temp_offset" (vorbis_decode_packet_rest), ogg.cpp */ undefined4 stb_vorbis::vorbis_decode_packet_rest (byte *param_1,int param_2,undefined4 param_3,int param_4,int param_5,int *param_6) { int *piVar1; ushort *puVar2; short *psVar3; float fVar4; byte bVar5; byte bVar6; undefined2 *puVar7; code *pcVar8; short sVar9; undefined2 uVar10; short sVar11; int iVar12; uint uVar13; int iVar14; uint uVar15; uint uVar16; int iVar17; int iVar18; int iVar19; undefined4 uVar20; float *pfVar21; void *in_ECX; int *in_EDX; int iVar22; byte *pbVar23; void *pvVar24; undefined4 *puVar25; float fVar26; float fVar27; int *local_984; int local_980; int local_978; int local_974; uint local_960; byte *local_958; uint local_954; undefined1 local_949; int local_948 [52]; int aiStack_878 [204]; int local_548 [192]; char local_248 [256]; undefined4 local_148 [16]; undefined1 local_108 [256]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_108 + 0x104); iVar22 = *(int *)((int)in_ECX + (uint)*param_1 * 4 + 0x78); puVar2 = (ushort *)(*(int *)((int)in_ECX + 0x1a4) + (uint)param_1[1] * 0x28); iVar19 = *(int *)((int)in_ECX + 4); iVar12 = iVar22 >> 1; local_980 = 0; if (0 < iVar19) { local_984 = (int *)((int)in_ECX + 0x3f4); local_978 = 0; do { local_948[local_980] = 0; uVar13 = (uint)*(byte *)(*(byte *)(*(int *)(puVar2 + 2) + 2 + local_978) + 9 + (int)puVar2); if (*(short *)((int)in_ECX + uVar13 * 2 + 0x94) == 0) { *(undefined4 *)((int)in_ECX + 0x74) = 0x15; return 0; } pbVar23 = (byte *)(uVar13 * 0x63c + *(int *)((int)in_ECX + 0x114)); uVar13 = get_bits(in_ECX,1); if (uVar13 == 0) { LAB_00aa4b8f: local_948[local_980] = 1; } else { puVar7 = (undefined2 *)*local_984; local_958 = (byte *)0x2; iVar19 = *(int *)(&DAT_00ba8c3c + (uint)pbVar23[0x634] * 4); iVar14 = ilog(iVar19); uVar13 = get_bits(in_ECX,iVar14 + -1); *puVar7 = (short)uVar13; iVar14 = ilog(iVar19); uVar13 = get_bits(in_ECX,iVar14 + -1); puVar7[1] = (short)uVar13; local_974 = 0; if (*pbVar23 != 0) { do { uVar15 = (uint)pbVar23[local_974 + 1]; uVar13 = 0; local_954 = (uint)pbVar23[uVar15 + 0x21]; bVar5 = pbVar23[uVar15 + 0x31]; if (bVar5 != 0) { pvVar24 = (void *)((uint)pbVar23[uVar15 + 0x41] * 0x830 + *(int *)((int)in_ECX + 0x8c) ); if (*(int *)((int)in_ECX + 0x584) < 10) { if (*(int *)((int)in_ECX + 0x584) == 0) { *(undefined4 *)((int)in_ECX + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar14 = get8_packet_raw(in_ECX), iVar14 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar14 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)); iVar14 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar14; } while (iVar14 < 0x19); } uVar13 = (uint)*(short *)((int)pvVar24 + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if ((int)uVar13 < 0) { uVar13 = codebook_decode_scalar_raw(in_ECX,pvVar24); } else { bVar6 = *(byte *)(*(int *)((int)pvVar24 + 8) + uVar13); piVar1 = (int *)((int)in_ECX + 0x584); *piVar1 = *piVar1 - (uint)bVar6; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar6 & 0x1f); if (*piVar1 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; uVar13 = 0xffffffff; } } if (*(char *)((int)pvVar24 + 0x17) != '\0') { uVar13 = *(uint *)(*(int *)((int)pvVar24 + 0x828) + uVar13 * 4); } } if (local_954 != 0) { do { uVar16 = uVar13 & (1 << (bVar5 & 0x1f)) - 1U; uVar13 = (int)uVar13 >> (bVar5 & 0x1f); if (*(short *)(pbVar23 + (uVar16 + uVar15 * 8) * 2 + 0x52) < 0) { uVar10 = 0; } else { pvVar24 = (void *)(*(short *)(pbVar23 + (uVar16 + uVar15 * 8) * 2 + 0x52) * 0x830 + *(int *)((int)in_ECX + 0x8c)); if (*(int *)((int)in_ECX + 0x584) < 10) { if (*(int *)((int)in_ECX + 0x584) == 0) { *(undefined4 *)((int)in_ECX + 0x580) = 0; } do { if (((*(int *)((int)in_ECX + 0x578) != 0) && (*(char *)((int)in_ECX + 0x570) == '\0')) || (iVar14 = get8_packet_raw(in_ECX), iVar14 == -1)) break; *(int *)((int)in_ECX + 0x580) = *(int *)((int)in_ECX + 0x580) + (iVar14 << ((byte)*(int *)((int)in_ECX + 0x584) & 0x1f)); iVar14 = *(int *)((int)in_ECX + 0x584) + 8; *(int *)((int)in_ECX + 0x584) = iVar14; } while (iVar14 < 0x19); } iVar14 = (int)*(short *)((int)pvVar24 + (*(uint *)((int)in_ECX + 0x580) & 0x3ff) * 2 + 0x24); if (iVar14 < 0) { iVar14 = codebook_decode_scalar_raw(in_ECX,pvVar24); } else { bVar6 = *(byte *)(*(int *)((int)pvVar24 + 8) + iVar14); piVar1 = (int *)((int)in_ECX + 0x584); *piVar1 = *piVar1 - (uint)bVar6; *(uint *)((int)in_ECX + 0x580) = *(uint *)((int)in_ECX + 0x580) >> (bVar6 & 0x1f); if (*piVar1 < 0) { *(undefined4 *)((int)in_ECX + 0x584) = 0; iVar14 = -1; } } if (*(char *)((int)pvVar24 + 0x17) != '\0') { iVar14 = *(int *)(*(int *)((int)pvVar24 + 0x828) + iVar14 * 4); } uVar10 = (undefined2)iVar14; } local_954 = local_954 - 1; iVar14 = (int)local_958 + 1; puVar7[(int)local_958] = uVar10; local_958 = (byte *)iVar14; } while (local_954 != 0); } local_974 = local_974 + 1; } while (local_974 < (int)(uint)*pbVar23); } if (*(int *)((int)in_ECX + 0x584) == -1) goto LAB_00aa4b8f; iVar14 = *(int *)(pbVar23 + 0x638); local_248[0] = '\x01'; local_248[1] = '\x01'; local_960 = 2; if (2 < iVar14) { local_958 = pbVar23 + 0x445; do { uVar13 = (uint)local_958[-1]; uVar15 = (uint)*local_958; uVar16 = (int)(short)puVar7[uVar15] - (int)(short)puVar7[uVar13]; iVar17 = (int)(((uVar16 ^ (int)uVar16 >> 0x1f) - ((int)uVar16 >> 0x1f)) * ((uint)*(ushort *)(local_958 + -0x2ef) - (uint)*(ushort *)(pbVar23 + uVar13 * 2 + 0x152))) / (int)((uint)*(ushort *)(pbVar23 + uVar15 * 2 + 0x152) - (uint)*(ushort *)(pbVar23 + uVar13 * 2 + 0x152)); iVar14 = -iVar17; if (-1 < (int)uVar16) { iVar14 = iVar17; } iVar14 = (short)puVar7[uVar13] + iVar14; psVar3 = puVar7 + local_960; uVar16 = (uint)*psVar3; iVar18 = iVar19 - iVar14; iVar17 = iVar14; if (iVar18 < iVar14) { iVar17 = iVar18; } sVar11 = (short)iVar14; if (uVar16 == 0) { if (0xff < local_960) goto LAB_00aa4f0c; local_248[local_960] = '\0'; } else { local_248[uVar15] = '\x01'; local_248[uVar13] = '\x01'; local_248[local_960] = '\x01'; if ((int)uVar16 < iVar17 * 2) { if ((uVar16 & 1) == 0) { sVar11 = (short)((int)uVar16 >> 1) + sVar11; } else { sVar11 = sVar11 - (short)((int)(uVar16 + 1) >> 1); } } else { sVar9 = *psVar3; if (iVar18 <= iVar14) { sVar9 = (short)iVar18 + -1 + (sVar11 - *psVar3); } sVar11 = sVar9; } } local_960 = local_960 + 1; *psVar3 = sVar11; local_958 = local_958 + 2; iVar14 = *(int *)(pbVar23 + 0x638); } while ((int)local_960 < iVar14); } iVar19 = 0; if (0 < iVar14) { do { if (local_248[iVar19] == '\0') { puVar7[iVar19] = 0xffff; } iVar19 = iVar19 + 1; } while (iVar19 < *(int *)(pbVar23 + 0x638)); } } local_980 = local_980 + 1; iVar19 = *(int *)((int)in_ECX + 4); local_978 = local_978 + 3; local_984 = local_984 + 1; } while (local_980 < iVar19); } if ((*(int *)((int)in_ECX + 0x60) != 0) && (*(int *)((int)in_ECX + 100) != *(int *)((int)in_ECX + 0x6c))) { _wassert(L"f->alloc.alloc_buffer_length_in_bytes == f->temp_offset", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0xcf1); iVar19 = *(int *)((int)in_ECX + 4); } memcpy(local_548,local_948,iVar19 * 4); uVar13 = (uint)*puVar2; if (uVar13 != 0) { pbVar23 = (byte *)(*(int *)(puVar2 + 2) + 1); do { bVar5 = pbVar23[-1]; if ((local_948[bVar5] == 0) || (local_948[*pbVar23] == 0)) { local_948[*pbVar23] = 0; local_948[bVar5] = 0; } pbVar23 = pbVar23 + 3; uVar13 = uVar13 - 1; } while (uVar13 != 0); } local_954 = 0; if ((char)puVar2[4] != '\0') { do { uVar13 = 0; iVar19 = 0; if (0 < *(int *)((int)in_ECX + 4)) { iVar14 = *(int *)(puVar2 + 2); puVar25 = (undefined4 *)((int)in_ECX + 0x330); iVar17 = 0; do { if (*(byte *)(iVar17 + 2 + iVar14) == local_954) { if (local_948[iVar19] == 0) { if (0xff < uVar13) { LAB_00aa4f0c: FUN_00aef86f(); pcVar8 = (code *)swi(3); uVar20 = (*pcVar8)(); return uVar20; } uVar20 = *puVar25; local_949 = 0; } else { uVar20 = 0; local_949 = 1; } local_108[uVar13] = local_949; local_148[uVar13] = uVar20; uVar13 = uVar13 + 1; } iVar19 = iVar19 + 1; iVar17 = iVar17 + 3; puVar25 = puVar25 + 1; } while (iVar19 < *(int *)((int)in_ECX + 4)); } stb_vorbis_decode_residue (uVar13,iVar12,*(undefined1 *)((int)puVar2 + local_954 + 0x18),local_108); local_954 = local_954 + 1; } while ((int)local_954 < (int)(uint)(byte)puVar2[4]); } if ((*(int *)((int)in_ECX + 0x60) != 0) && (*(int *)((int)in_ECX + 100) != *(int *)((int)in_ECX + 0x6c))) { _wassert(L"f->alloc.alloc_buffer_length_in_bytes == f->temp_offset", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0xd11); } iVar19 = *puVar2 - 1; if (-1 < iVar19) { iVar14 = iVar19 * 3; do { pfVar21 = *(float **) ((int)in_ECX + (uint)*(byte *)(*(int *)(puVar2 + 2) + 1 + iVar14) * 4 + 0x330); if (0 < iVar12) { iVar18 = *(int *)((int)in_ECX + (uint)*(byte *)(*(int *)(puVar2 + 2) + iVar14) * 4 + 0x330) - (int)pfVar21; iVar17 = iVar12; do { fVar26 = *(float *)(iVar18 + (int)pfVar21); fVar4 = *pfVar21; fVar27 = fVar26; if (fVar26 <= 0.0) { if (fVar4 <= 0.0) { fVar26 = fVar26 - fVar4; goto LAB_00aa4d04; } fVar27 = fVar26 + fVar4; } else { if (fVar4 <= 0.0) { fVar26 = fVar26 + fVar4; } else { fVar27 = fVar26 - fVar4; } LAB_00aa4d04: } *(float *)(iVar18 + (int)pfVar21) = fVar26; *pfVar21 = fVar27; pfVar21 = pfVar21 + 1; iVar17 = iVar17 + -1; } while (iVar17 != 0); } iVar14 = iVar14 + -3; iVar19 = iVar19 + -1; } while (-1 < iVar19); } iVar19 = *(int *)((int)in_ECX + 4); iVar14 = 0; if (0 < iVar19) { iVar17 = 0x330; do { if (*(int *)((int)aiStack_878 + iVar17) == 0) { do_floor(iVar14,iVar22,*(undefined4 *)((int)in_ECX + iVar17), *(undefined4 *)((int)in_ECX + iVar17 + 0xc4),puVar2); } else { memset(*(void **)((int)in_ECX + iVar17),0,iVar12 << 2); } iVar19 = *(int *)((int)in_ECX + 4); iVar14 = iVar14 + 1; iVar17 = iVar17 + 4; } while (iVar14 < iVar19); } iVar14 = 0; if (0 < iVar19) { do { inverse_mdct(in_ECX,*param_1); iVar14 = iVar14 + 1; } while (iVar14 < *(int *)((int)in_ECX + 4)); } flush_packet(); if (*(char *)((int)in_ECX + 0x571) == '\0') { if (*(int *)((int)in_ECX + 0x594) != 0) { param_2 = param_2 + *(int *)((int)in_ECX + 0x594); *param_6 = param_2; *(undefined4 *)((int)in_ECX + 0x594) = 0; } } else { *(undefined4 *)((int)in_ECX + 0x438) = 1; *(int *)((int)in_ECX + 0x434) = -iVar12; *(undefined1 *)((int)in_ECX + 0x571) = 0; *(int *)((int)in_ECX + 0x594) = iVar22 - param_5; } if (*(int *)((int)in_ECX + 0x57c) == *(int *)((int)in_ECX + 0x58c)) { if ((*(int *)((int)in_ECX + 0x438) != 0) && ((*(byte *)((int)in_ECX + 0x56f) & 4) != 0)) { uVar13 = (*(int *)((int)in_ECX + 0x590) - iVar22) + param_5; if (uVar13 < (uint)(*(int *)((int)in_ECX + 0x434) + param_5)) { iVar22 = 0; if (*(uint *)((int)in_ECX + 0x434) <= uVar13) { iVar22 = uVar13 - *(int *)((int)in_ECX + 0x434); } *in_EDX = iVar22 + param_2; *(int *)((int)in_ECX + 0x434) = *(int *)((int)in_ECX + 0x434) + iVar22 + param_2; return 1; } } *(undefined4 *)((int)in_ECX + 0x438) = 1; *(int *)((int)in_ECX + 0x434) = (*(int *)((int)in_ECX + 0x590) - iVar12) + param_2; } if (*(int *)((int)in_ECX + 0x438) != 0) { *(int *)((int)in_ECX + 0x434) = *(int *)((int)in_ECX + 0x434) + (param_4 - param_2); } if ((*(int *)((int)in_ECX + 0x60) != 0) && (*(int *)((int)in_ECX + 100) != *(int *)((int)in_ECX + 0x6c))) { _wassert(L"f->alloc.alloc_buffer_length_in_bytes == f->temp_offset", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp",0xd7e); } *in_EDX = param_5; return 1; } //@@ 00aa4f20 FUN_00aa4f20 int FUN_00aa4f20(int param_1,int param_2) { float *pfVar1; float fVar2; float fVar3; int iVar4; float *pfVar5; float *pfVar6; int in_ECX; float *pfVar7; int iVar8; int in_EDX; float *pfVar9; undefined4 *puVar10; int iVar11; undefined4 *puVar12; int *local_14; undefined4 *local_10; iVar4 = *(int *)(in_ECX + 0x3f0); if (iVar4 != 0) { if (iVar4 * 2 == *(int *)(in_ECX + 0x80)) { pfVar5 = *(float **)(in_ECX + 0x454); } else if (iVar4 * 2 == *(int *)(in_ECX + 0x84)) { pfVar5 = *(float **)(in_ECX + 0x458); } else { _wassert(L"0",L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp", 0xc20); pfVar5 = (float *)0x0; } local_10 = (undefined4 *)0x0; if (0 < *(int *)(in_ECX + 4)) { local_14 = (int *)(in_ECX + 0x330); do { if (0 < iVar4) { iVar8 = local_14[0x20]; pfVar6 = (float *)(*local_14 + param_1 * 4); pfVar9 = pfVar5 + iVar4 + -1; pfVar7 = pfVar5; iVar11 = iVar4; do { pfVar1 = (float *)((iVar8 - (int)pfVar5) + (int)pfVar7); fVar2 = *pfVar9; pfVar9 = pfVar9 + -1; fVar3 = *pfVar7; pfVar7 = pfVar7 + 1; *pfVar6 = *pfVar1 * fVar2 + *pfVar6 * fVar3; pfVar6 = pfVar6 + 1; iVar11 = iVar11 + -1; } while (iVar11 != 0); } local_10 = (undefined4 *)((int)local_10 + 1); local_14 = local_14 + 1; } while ((int)local_10 < *(int *)(in_ECX + 4)); } } iVar4 = *(int *)(in_ECX + 0x3f0); local_14 = (int *)0x0; *(int *)(in_ECX + 0x3f0) = in_EDX - param_2; if (0 < *(int *)(in_ECX + 4)) { local_10 = (undefined4 *)(in_ECX + 0x3b0); do { if (param_2 < in_EDX) { puVar12 = (undefined4 *)(local_10[-0x20] + param_2 * 4); iVar8 = param_2; puVar10 = (undefined4 *)*local_10; do { iVar8 = iVar8 + 1; *puVar10 = *puVar12; puVar12 = puVar12 + 1; puVar10 = puVar10 + 1; } while (iVar8 < in_EDX); } local_14 = (int *)((int)local_14 + 1); local_10 = local_10 + 1; } while ((int)local_14 < *(int *)(in_ECX + 4)); } if (iVar4 == 0) { return 0; } if (param_2 <= in_EDX) { in_EDX = param_2; } *(int *)(in_ECX + 0x598) = *(int *)(in_ECX + 0x598) + (in_EDX - param_1); return in_EDX - param_1; } //@@ 00aa50a0 FUN_00aa50a0 void FUN_00aa50a0(void) { int iVar1; int in_ECX; int local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; iVar1 = FUN_00aa4340(&local_14,&local_c,&local_10,&local_18); if (iVar1 != 0) { iVar1 = stb_vorbis::vorbis_decode_packet_rest (in_ECX + (local_18 * 3 + 0xd6) * 2,local_8,local_14,local_c,local_10,&local_8 ); if (iVar1 != 0) { FUN_00aa4f20(local_8,local_c); } } return; } //@@ 00aa5120 stb_vorbis::is_whole_packet_present /* DB: stb_vorbis: from the current segment (+0x574) walks the page's segment lengths (+0x46c count, +0x470 table) and following page headers in memory (+0x20) to verify the whole packet is buffered; only caller stb_vorbis::start_decoder */ undefined4 stb_vorbis::is_whole_packet_present(void) { int iVar1; bool bVar2; int in_ECX; int iVar3; int *piVar4; int *piVar5; int *piVar6; byte *pbVar7; uint uVar8; bVar2 = true; iVar3 = *(int *)(in_ECX + 0x574); piVar5 = *(int **)(in_ECX + 0x20); if (iVar3 != -1) { iVar1 = *(int *)(in_ECX + 0x46c); if (iVar3 < iVar1) { pbVar7 = (byte *)(in_ECX + 0x470 + iVar3); do { piVar5 = (int *)((int)piVar5 + (uint)*pbVar7); if (*pbVar7 != 0xff) break; iVar3 = iVar3 + 1; pbVar7 = pbVar7 + 1; } while (iVar3 < iVar1); } if (iVar3 < iVar1 + -1) { LAB_00aa51c2: *(undefined4 *)(in_ECX + 0x74) = 0x15; return 0; } if (iVar3 == iVar1) { iVar3 = -1; } if (*(int **)(in_ECX + 0x28) < piVar5) goto LAB_00aa5239; bVar2 = false; if (iVar3 != -1) { return 1; } } while ((byte *)((int)piVar5 + 0x1aU) < *(byte **)(in_ECX + 0x28)) { if ((*piVar5 != DAT_00c5af94) || ((char)piVar5[1] != '\0')) goto LAB_00aa51c2; if (bVar2) { if ((*(int *)(in_ECX + 0x3f0) != 0) && ((*(byte *)((int)piVar5 + 5) & 1) != 0)) goto LAB_00aa51c2; } else if ((*(byte *)((int)piVar5 + 5) & 1) == 0) goto LAB_00aa51c2; uVar8 = (uint)*(byte *)((int)piVar5 + 0x1aU); piVar6 = (int *)((int)piVar5 + uVar8 + 0x1b); if (*(int **)(in_ECX + 0x28) < piVar6) break; iVar3 = 0; piVar4 = *(int **)(in_ECX + 0x28); if (uVar8 != 0) { do { piVar6 = (int *)((int)piVar6 + (uint)*(byte *)((int)piVar5 + iVar3 + 0x1b)); if (*(char *)((int)piVar5 + iVar3 + 0x1b) != -1) break; iVar3 = iVar3 + 1; } while (iVar3 < (int)uVar8); piVar4 = *(int **)(in_ECX + 0x28); } if (iVar3 < (int)(uVar8 - 1)) goto LAB_00aa51c2; if (iVar3 == *(int *)(in_ECX + 0x46c)) { iVar3 = -1; } if (piVar4 < piVar6) break; bVar2 = false; piVar5 = piVar6; if (iVar3 != -1) { return 1; } } LAB_00aa5239: *(undefined4 *)(in_ECX + 0x74) = 1; return 0; } //@@ 00aa5250 stb_vorbis::start_decoder /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: stb_vorbis lookup1_values asserts "pow((float) r+1, dim) > entries", ogg.cpp, "vorbis" header check */ undefined4 stb_vorbis::start_decoder(void) { undefined2 uVar1; float fVar2; char cVar3; byte bVar4; undefined1 uVar5; short sVar6; ushort uVar7; int iVar8; uint uVar9; int iVar10; void *pvVar11; uint uVar12; size_t sVar13; undefined4 *puVar14; int *in_ECX; char *pcVar15; byte *pbVar16; uint uVar17; int *piVar18; int iVar19; byte *pbVar20; uint *puVar21; ushort *puVar22; short *psVar23; int *piVar24; bool bVar25; double dVar26; int local_49c; double local_498; undefined8 local_490; int local_478; byte *local_470; int local_468; int *local_464; void *local_460; void *local_45c; int *local_458; byte *local_454; char local_44d; byte *local_44c; byte local_448 [2]; byte abStack_446 [998]; byte abStack_60 [68]; int local_1c; short local_18 [2]; undefined4 local_14; local_14 = __security_cookie ^ (uint)(local_18 + 4); local_49c = 0; iVar8 = start_page(); if (iVar8 == 0) { return 0; } bVar4 = *(byte *)((int)in_ECX + 0x56f); if ((((((bVar4 & 2) != 0) && ((bVar4 & 4) == 0)) && ((bVar4 & 1) == 0)) && ((in_ECX[0x11b] == 1 && ((char)in_ECX[0x11c] == '\x1e')))) && (cVar3 = FUN_00aa13a0(), cVar3 == '\x01')) { iVar8 = FUN_00aa1540(6); if (iVar8 == 0) { in_ECX[0x1d] = 10; return 0; } pcVar15 = s_vorbis_00c5c530; pbVar20 = (byte *)&local_1c; iVar8 = 2; if (local_1c == s_vorbis_00c5c530._0_4_) { pbVar20 = (byte *)local_18; iVar8 = -2; pcVar15 = s_vorbis_00c5c530 + 4; } bVar25 = *pbVar20 < (byte)*pcVar15; if (((*pbVar20 == *pcVar15) && (bVar25 = pbVar20[1] < (byte)pcVar15[1], pbVar20[1] == pcVar15[1])) && ((iVar8 == -2 || ((bVar25 = pbVar20[2] < (byte)pcVar15[2], pbVar20[2] == pcVar15[2] && (bVar25 = pbVar20[3] < (byte)pcVar15[3], pbVar20[3] == pcVar15[3])))))) { uVar9 = 0; } else { uVar9 = -(uint)bVar25 | 1; } if ((uVar9 == 0) && (iVar8 = get32(), iVar8 == 0)) { uVar9 = FUN_00aa13a0(); uVar9 = uVar9 & 0xff; in_ECX[1] = uVar9; if (uVar9 != 0) { if (0x10 < uVar9) { in_ECX[0x1d] = 5; return 0; } iVar8 = get32(); *in_ECX = iVar8; if (iVar8 != 0) { get32(); get32(); get32(); uVar9 = FUN_00aa13a0(); uVar17 = (uVar9 & 0xff) >> 4; uVar9 = uVar9 & 0xf; in_ECX[0x20] = 1 << (sbyte)uVar9; in_ECX[0x21] = 1 << (sbyte)uVar17; if ((((5 < uVar9) && (uVar9 < 0xe)) && (uVar17 - 6 < 8)) && (uVar9 <= uVar17)) { uVar9 = FUN_00aa13a0(); if ((uVar9 & 1) == 0) goto LAB_00aa52a1; iVar8 = start_page(); if (iVar8 == 0) { return 0; } iVar8 = start_packet(); if (iVar8 == 0) { return 0; } do { iVar8 = next_segment(in_ECX); if (in_ECX[8] == 0) { iVar10 = (**(code **)(*(int *)in_ECX[5] + 8))(); (**(code **)(*(int *)in_ECX[5] + 0xc))(iVar10 + iVar8,0); } else { uVar9 = in_ECX[8] + iVar8; in_ECX[8] = uVar9; if ((uint)in_ECX[10] <= uVar9) { in_ECX[0x1c] = 1; } } *(undefined1 *)(in_ECX + 0x15c) = 0; } while (iVar8 != 0); iVar8 = start_packet(); if (iVar8 == 0) { return 0; } if (((char)in_ECX[0xc] == '\0') || (iVar8 = is_whole_packet_present(), iVar8 != 0)) { iVar8 = 0; do { uVar9 = (-(uint)((uint)(iVar8 * 0x1000000) < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ iVar8 * 0x2000000; uVar9 = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; uVar9 = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; uVar9 = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; uVar9 = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; uVar9 = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; uVar9 = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; (&DAT_00c7e410)[iVar8] = (-(uint)(uVar9 < 0x80000000) & 0xfb3ee249) + 0x4c11db7 ^ uVar9 * 2; iVar8 = iVar8 + 1; } while (iVar8 < 0x100); iVar8 = get8_packet_raw(in_ECX); in_ECX[0x161] = 0; if (iVar8 == 5) { iVar8 = 0; do { iVar10 = get8_packet_raw(in_ECX); abStack_60[iVar8 + 0x44] = (byte)iVar10; iVar8 = iVar8 + 1; in_ECX[0x161] = 0; } while (iVar8 < 6); if ((local_1c == s_vorbis_00c5c530._0_4_) && (local_18[0] == s_vorbis_00c5c530._4_2_)) { uVar9 = get_bits(in_ECX,8); in_ECX[0x22] = uVar9 + 1; pvVar11 = (void *)FUN_00aa0840(); in_ECX[0x23] = (int)pvVar11; if (pvVar11 == (void *)0x0) { LAB_00aa6432: in_ECX[0x1d] = 3; return 0; } memset(pvVar11,0,in_ECX[0x22] * 0x830); local_468 = 0; if (0 < in_ECX[0x22]) { local_490 = 0; do { local_45c = (void *)0x0; piVar18 = (int *)(local_468 * 0x830 + in_ECX[0x23]); uVar9 = get_bits(in_ECX,8); if ((((char)uVar9 != 'B') || (uVar9 = get_bits(in_ECX,8), (char)uVar9 != 'C')) || (uVar9 = get_bits(in_ECX,8), (char)uVar9 != 'V')) goto LAB_00aa6462; uVar9 = get_bits(in_ECX,8); uVar17 = get_bits(in_ECX,8); *piVar18 = uVar17 * 0x100 + (uVar9 & 0xff); uVar9 = get_bits(in_ECX,8); uVar17 = get_bits(in_ECX,8); uVar12 = get_bits(in_ECX,8); piVar18[1] = (uVar12 * 0x100 + (uVar17 & 0xff)) * 0x100 + (uVar9 & 0xff); uVar9 = get_bits(in_ECX,1); if (uVar9 == 0) { uVar17 = get_bits(in_ECX,1); cVar3 = (char)uVar17; } else { cVar3 = '\0'; } *(char *)((int)piVar18 + 0x17) = cVar3; iVar8 = in_ECX[0x18]; uVar17 = piVar18[1] + 3U & 0xfffffffc; if (cVar3 == '\0') { in_ECX[2] = in_ECX[2] + uVar17; if (iVar8 == 0) { if (uVar17 == 0) goto LAB_00aa57db; local_460 = malloc(uVar17); } else { iVar10 = in_ECX[0x1a]; iVar19 = uVar17 + iVar10; if (in_ECX[0x1b] < iVar19) { LAB_00aa57db: local_460 = (void *)0x0; } else { in_ECX[0x1a] = iVar19; local_460 = (void *)(iVar8 + iVar10); } } piVar18[2] = (int)local_460; } else if (iVar8 == 0) { local_460 = malloc(uVar17); } else { iVar10 = in_ECX[0x1b] - uVar17; if (iVar10 < in_ECX[0x1a]) goto LAB_00aa6432; local_460 = (void *)(iVar8 + iVar10); in_ECX[0x1b] = iVar10; } if (local_460 == (void *)0x0) goto LAB_00aa6432; if (uVar9 == 0) { local_454 = (byte *)piVar18[1]; local_44c = (byte *)0x0; if (0 < (int)local_454) { do { if ((*(char *)((int)piVar18 + 0x17) == '\0') || (uVar9 = get_bits(in_ECX,1), uVar9 != 0)) { local_45c = (void *)((int)local_45c + 1); uVar9 = get_bits(in_ECX,5); cVar3 = (char)uVar9 + '\x01'; } else { cVar3 = -1; } *(char *)((int)local_44c + (int)local_460) = cVar3; local_454 = (byte *)piVar18[1]; local_44c = (byte *)((int)local_44c + 1); } while ((int)local_44c < (int)local_454); } } else { local_464 = (int *)0x0; local_44c = (byte *)get_bits(in_ECX,5); local_454 = (byte *)piVar18[1]; if (0 < (int)local_454) { do { local_44c = (byte *)((int)local_44c + 1); iVar8 = ilog((int)local_454 - (int)local_464); uVar9 = get_bits(in_ECX,iVar8); iVar8 = uVar9 + (int)local_464; if (piVar18[1] < iVar8) goto LAB_00aa6462; memset((void *)((int)local_464 + (int)local_460),(int)local_44c,uVar9); local_454 = (byte *)piVar18[1]; local_464 = (int *)iVar8; } while (iVar8 < (int)local_454); } } if (*(char *)((int)piVar18 + 0x17) == '\0') { LAB_00aa59a4: pvVar11 = (void *)0x0; iVar8 = 0; local_45c = (void *)0x0; if ((int)local_454 < 1) { cVar3 = '\0'; } else { do { if ((10 < *(byte *)(iVar8 + (int)local_460)) && (*(byte *)(iVar8 + (int)local_460) != 0xff)) { local_45c = (void *)((int)local_45c + 1); } iVar8 = iVar8 + 1; } while (iVar8 < (int)local_454); cVar3 = *(char *)((int)piVar18 + 0x17); pvVar11 = local_45c; } piVar18[0x20b] = (int)pvVar11; local_45c = (void *)0x0; if (cVar3 != '\0') goto LAB_00aa5a04; sVar13 = piVar18[1] * 4; in_ECX[2] = in_ECX[2] + sVar13; if (in_ECX[0x18] == 0) { if (sVar13 == 0) goto LAB_00aa641b; pvVar11 = malloc(sVar13); } else { iVar8 = in_ECX[0x1a]; iVar10 = sVar13 + iVar8; if (in_ECX[0x1b] < iVar10) goto LAB_00aa641b; in_ECX[0x1a] = iVar10; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } piVar18[8] = (int)pvVar11; if (pvVar11 == (void *)0x0) goto LAB_00aa6432; } else { if ((int)local_454 >> 2 <= (int)local_45c) { if (in_ECX[4] < (int)local_454) { in_ECX[4] = (int)local_454; local_454 = (byte *)piVar18[1]; } uVar9 = (int)local_454 + 3U & 0xfffffffc; in_ECX[2] = in_ECX[2] + uVar9; if (in_ECX[0x18] == 0) { if (uVar9 == 0) goto LAB_00aa5954; pvVar11 = malloc(uVar9); } else { iVar8 = in_ECX[0x1a]; iVar10 = uVar9 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa5954: pvVar11 = (void *)0x0; } else { in_ECX[0x1a] = iVar10; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } } piVar18[2] = (int)pvVar11; memcpy(pvVar11,local_460,piVar18[1]); if (in_ECX[0x18] == 0) { free(local_460); } else { in_ECX[0x1b] = in_ECX[0x1b] + (piVar18[1] + 3U & 0xfffffffc); } local_460 = (void *)piVar18[2]; local_454 = (byte *)piVar18[1]; *(undefined1 *)((int)piVar18 + 0x17) = 0; goto LAB_00aa59a4; } if (*(char *)((int)piVar18 + 0x17) == '\0') goto LAB_00aa59a4; piVar18[0x20b] = (int)local_45c; pvVar11 = local_45c; LAB_00aa5a04: local_45c = (void *)0x0; if (pvVar11 != (void *)0x0) { uVar9 = (int)pvVar11 + 3U & 0xfffffffc; in_ECX[2] = in_ECX[2] + uVar9; if (in_ECX[0x18] == 0) { if (uVar9 == 0) goto LAB_00aa642b; pvVar11 = malloc(uVar9); } else { iVar8 = in_ECX[0x1a]; iVar10 = uVar9 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa642b: piVar18[2] = 0; goto LAB_00aa6432; } in_ECX[0x1a] = iVar10; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } piVar18[2] = (int)pvVar11; if (pvVar11 == (void *)0x0) goto LAB_00aa6432; if (in_ECX[0x18] == 0) { pvVar11 = malloc(piVar18[0x20b] * 4); } else { iVar8 = in_ECX[0x1b] + piVar18[0x20b] * -4; if (iVar8 < in_ECX[0x1a]) { LAB_00aa641b: piVar18[8] = 0; in_ECX[0x1d] = 3; return 0; } in_ECX[0x1b] = iVar8; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } piVar18[8] = (int)pvVar11; if (pvVar11 == (void *)0x0) goto LAB_00aa6432; if (in_ECX[0x18] == 0) { local_45c = malloc(piVar18[0x20b] * 4); } else { iVar8 = in_ECX[0x1b] + piVar18[0x20b] * -4; if (iVar8 < in_ECX[0x1a]) goto LAB_00aa6432; in_ECX[0x1b] = iVar8; local_45c = (void *)(iVar8 + in_ECX[0x18]); } if (local_45c == (void *)0x0) goto LAB_00aa6432; } uVar9 = piVar18[1] + piVar18[0x20b] * 8; if ((uint)in_ECX[4] < uVar9) { in_ECX[4] = uVar9; } } iVar8 = compute_codewords(piVar18[1],local_45c); if (iVar8 == 0) { if ((*(char *)((int)piVar18 + 0x17) != '\0') && (in_ECX[0x18] == 0)) { LAB_00aa6459: free(local_45c); } goto LAB_00aa6462; } if (piVar18[0x20b] != 0) { sVar13 = piVar18[0x20b] * 4 + 4; in_ECX[2] = in_ECX[2] + sVar13; if (in_ECX[0x18] == 0) { if (sVar13 == 0) goto LAB_00aa5ba7; pvVar11 = malloc(sVar13); } else { iVar8 = in_ECX[0x1a]; iVar10 = sVar13 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa5ba7: pvVar11 = (void *)0x0; } else { in_ECX[0x1a] = iVar10; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } } piVar18[0x209] = (int)pvVar11; sVar13 = piVar18[0x20b] * 4 + 4; in_ECX[2] = in_ECX[2] + sVar13; if (in_ECX[0x18] == 0) { if (sVar13 == 0) goto LAB_00aa5c05; puVar14 = malloc(sVar13); LAB_00aa5be9: piVar18[0x20a] = (int)puVar14; if (puVar14 != (undefined4 *)0x0) { piVar18[0x20a] = (int)(puVar14 + 1); *puVar14 = 0xffffffff; } } else { iVar8 = in_ECX[0x1a]; iVar10 = sVar13 + iVar8; if (iVar10 <= in_ECX[0x1b]) { in_ECX[0x1a] = iVar10; puVar14 = (undefined4 *)(iVar8 + in_ECX[0x18]); goto LAB_00aa5be9; } LAB_00aa5c05: piVar18[0x20a] = 0; } compute_sorted_huffman(local_45c); } if (*(char *)((int)piVar18 + 0x17) != '\0') { if (in_ECX[0x18] == 0) { free(local_45c); if (in_ECX[0x18] == 0) { free((void *)piVar18[8]); if (in_ECX[0x18] == 0) { free(local_460); } else { in_ECX[0x1b] = in_ECX[0x1b] + (piVar18[1] + 3U & 0xfffffffc); } } else { in_ECX[0x1b] = in_ECX[0x1b] + piVar18[0x20b] * 4; in_ECX[0x1b] = in_ECX[0x1b] + (piVar18[1] + 3U & 0xfffffffc); } } else { in_ECX[0x1b] = in_ECX[0x1b] + piVar18[0x20b] * 4; in_ECX[0x1b] = in_ECX[0x1b] + piVar18[0x20b] * 4; in_ECX[0x1b] = in_ECX[0x1b] + (piVar18[1] + 3U & 0xfffffffc); } piVar18[8] = 0; } piVar24 = piVar18 + 9; for (iVar8 = 0x200; iVar8 != 0; iVar8 = iVar8 + -1) { *piVar24 = -1; piVar24 = piVar24 + 1; } if (*(char *)((int)piVar18 + 0x17) == '\0') { local_454 = (byte *)piVar18[1]; } else { local_454 = (byte *)piVar18[0x20b]; } if ((int)local_454 < 0x8000) { if (0 < (int)local_454) goto LAB_00aa5d01; } else { local_454 = (byte *)0x7fff; LAB_00aa5d01: iVar8 = piVar18[2]; local_44c = (byte *)0x0; do { if (*(byte *)(iVar8 + (int)local_44c) < 0xb) { if (*(char *)((int)piVar18 + 0x17) == '\0') { uVar9 = *(uint *)(piVar18[8] + (int)local_44c * 4); } else { uVar9 = *(uint *)(piVar18[0x209] + (int)local_44c * 4); uVar9 = (uVar9 >> 1 ^ uVar9 * 2) & 0x55555555 ^ uVar9 * 2; uVar9 = (uVar9 >> 2 ^ uVar9 * 4) & 0x33333333 ^ uVar9 * 4; uVar9 = (uVar9 >> 4 ^ uVar9 << 4) & 0xf0f0f0f ^ uVar9 << 4; uVar9 = (uVar9 >> 8 ^ uVar9 << 8) & 0xff00ff ^ uVar9 << 8; uVar9 = uVar9 << 0x10 | uVar9 >> 0x10; } for (; uVar9 < 0x400; uVar9 = uVar9 + (1 << (*(byte *)(piVar18[2] + (int)local_44c) & 0x1f ))) { *(short *)((int)piVar18 + uVar9 * 2 + 0x24) = (short)local_44c; } iVar8 = piVar18[2]; } local_44c = (byte *)((int)local_44c + 1); } while ((int)local_44c < (int)local_454); } uVar9 = get_bits(in_ECX,4); bVar4 = (byte)uVar9; *(byte *)((int)piVar18 + 0x15) = bVar4; if (2 < bVar4) goto LAB_00aa6462; if (bVar4 != 0) { uVar9 = get_bits(in_ECX,0x20); fVar2 = (float)(uVar9 & 0x1fffff) + 0.0; if ((int)uVar9 < 0) { fVar2 = -fVar2; } dVar26 = ldexp((double)fVar2,(uVar9 >> 0x15 & 0x3ff) - 0x314); piVar18[3] = (int)(float)dVar26; uVar9 = get_bits(in_ECX,0x20); fVar2 = (float)(uVar9 & 0x1fffff) + 0.0; if ((int)uVar9 < 0) { fVar2 = -fVar2; } dVar26 = ldexp((double)fVar2,(uVar9 >> 0x15 & 0x3ff) - 0x314); piVar18[4] = (int)(float)dVar26; uVar9 = get_bits(in_ECX,4); *(char *)(piVar18 + 5) = (char)uVar9 + '\x01'; uVar9 = get_bits(in_ECX,1); *(char *)((int)piVar18 + 0x16) = (char)uVar9; if (*(char *)((int)piVar18 + 0x15) == '\x01') { iVar10 = piVar18[1]; iVar8 = *piVar18; dVar26 = (double)iVar10; libm_sse2_log_precise(); dVar26 = (double)((float)dVar26 / (float)iVar8); libm_sse2_exp_precise(); dVar26 = floor(dVar26); iVar19 = (int)dVar26; dVar26 = (double)((float)iVar19 + 1.0); libm_sse2_pow_precise(); dVar26 = floor(dVar26); iVar8 = iVar19 + 1; if (iVar10 < (int)dVar26) { iVar8 = iVar19; } dVar26 = (double)((float)iVar8 + 1.0); libm_sse2_pow_precise(); if (dVar26 <= (double)iVar10) { _wassert(L"pow((float) r+1, dim) > entries", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp" ,0x48e); } dVar26 = (double)iVar8; libm_sse2_pow_precise(); local_498 = floor(dVar26); if (iVar10 < (int)local_498) { _wassert(L"(int) floor(pow((float) r, dim)) <= entries", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp" ,0x48f); } } else { iVar8 = *piVar18 * piVar18[1]; } piVar18[6] = iVar8; uVar9 = iVar8 * 2 + 3U & 0xfffffffc; if (in_ECX[0x18] == 0) { local_45c = malloc(uVar9); } else { iVar8 = in_ECX[0x1b] - uVar9; if (iVar8 < in_ECX[0x1a]) goto LAB_00aa6432; in_ECX[0x1b] = iVar8; local_45c = (void *)(iVar8 + in_ECX[0x18]); } if (local_45c == (void *)0x0) goto LAB_00aa6432; local_44c = (byte *)0x0; if (0 < piVar18[6]) { do { uVar9 = get_bits(in_ECX,(uint)*(byte *)(piVar18 + 5)); if (uVar9 == 0xffffffff) { if (in_ECX[0x18] == 0) goto LAB_00aa6459; in_ECX[0x1b] = in_ECX[0x1b] + (piVar18[6] * 2 + 3U & 0xfffffffc); goto LAB_00aa6462; } *(short *)((int)local_45c + (int)local_44c * 2) = (short)uVar9; local_44c = (byte *)((int)local_44c + 1); } while ((int)local_44c < piVar18[6]); } if (*(char *)((int)piVar18 + 0x15) == '\x01') { cVar3 = *(char *)((int)piVar18 + 0x17); if ((cVar3 == '\0') || (piVar18[0x20b] != 0)) { iVar8 = FUN_00aa0840(); piVar18[7] = iVar8; if (iVar8 == 0) { if (in_ECX[0x18] == 0) { free(local_45c); in_ECX[0x1d] = 3; return 0; } iVar8 = piVar18[6]; in_ECX[0x1d] = 3; in_ECX[0x1b] = in_ECX[0x1b] + (iVar8 * 2 + 3U & 0xfffffffc); return 0; } if (cVar3 == '\0') { iVar8 = piVar18[1]; } else { iVar8 = piVar18[0x20b]; } local_464 = (int *)0x0; if (0 < iVar8) { do { if (cVar3 == '\0') { local_454 = (byte *)local_464; } else { local_454 = *(byte **)(piVar18[0x20a] + (int)local_464 * 4); } iVar10 = 0; local_44c = (byte *)0x1; if (0 < *piVar18) { uVar9 = piVar18[6]; do { iVar19 = *piVar18 * (int)local_464 + iVar10; iVar10 = iVar10 + 1; *(float *)(piVar18[7] + iVar19 * 4) = (float)*(ushort *) ((int)local_45c + (int)(((longlong)(int)local_454 / (longlong)(int)local_44c & 0xffffffffU) % (ulonglong)uVar9) * 2) * (float)piVar18[4] + (float)piVar18[3]; uVar9 = piVar18[6]; local_44c = (byte *)(uVar9 * (int)local_44c); } while (iVar10 < *piVar18); } local_464 = (int *)((int)local_464 + 1); } while ((int)local_464 < iVar8); } if (in_ECX[0x18] == 0) { free(local_45c); *(undefined1 *)((int)piVar18 + 0x15) = 2; } else { in_ECX[0x1b] = in_ECX[0x1b] + (piVar18[6] * 2 + 3U & 0xfffffffc); *(undefined1 *)((int)piVar18 + 0x15) = 2; } } } else { iVar8 = FUN_00aa0840(); iVar10 = 0; piVar18[7] = iVar8; iVar8 = piVar18[6]; if (0 < iVar8) { do { *(float *)(piVar18[7] + iVar10 * 4) = (float)*(ushort *)((int)local_45c + iVar10 * 2) * (float)piVar18[4] + (float)piVar18[3]; iVar10 = iVar10 + 1; iVar8 = piVar18[6]; } while (iVar10 < iVar8); } if (in_ECX[0x18] == 0) { free(local_45c); } else { in_ECX[0x1b] = in_ECX[0x1b] + (iVar8 * 2 + 3U & 0xfffffffc); } } if ((*(char *)((int)piVar18 + 0x15) == '\x02') && (*(char *)((int)piVar18 + 0x16) != '\0')) { iVar8 = 1; if (1 < piVar18[6]) { do { *(undefined4 *)(piVar18[7] + iVar8 * 4) = *(undefined4 *)(piVar18[7] + -4 + iVar8 * 4); iVar8 = iVar8 + 1; } while (iVar8 < piVar18[6]); } *(undefined1 *)((int)piVar18 + 0x16) = 0; } } local_468 = local_468 + 1; } while (local_468 < in_ECX[0x22]); } iVar8 = 0; uVar9 = get_bits(in_ECX,6); bVar4 = (char)uVar9 + 1; if (bVar4 != 0) { do { uVar9 = get_bits(in_ECX,0x10); if (uVar9 != 0) goto LAB_00aa6462; iVar8 = iVar8 + 1; } while (iVar8 < (int)(uint)bVar4); } uVar9 = get_bits(in_ECX,6); in_ECX[0x24] = uVar9 + 1; iVar8 = FUN_00aa0840(); in_ECX[0x45] = iVar8; local_478 = 0; if (0 < in_ECX[0x24]) { local_458 = in_ECX + 0x25; local_45c = (void *)0x0; do { uVar9 = get_bits(in_ECX,0x10); *(short *)local_458 = (short)uVar9; if (1 < (uVar9 & 0xffff)) goto LAB_00aa6462; pbVar20 = (byte *)(in_ECX[0x45] + (int)local_45c); if ((short)uVar9 == 0) { uVar9 = get_bits(in_ECX,8); *pbVar20 = (byte)uVar9; uVar9 = get_bits(in_ECX,0x10); *(short *)(pbVar20 + 2) = (short)uVar9; uVar9 = get_bits(in_ECX,0x10); *(short *)(pbVar20 + 4) = (short)uVar9; uVar9 = get_bits(in_ECX,6); pbVar20[6] = (byte)uVar9; uVar9 = get_bits(in_ECX,8); pbVar20[7] = (byte)uVar9; uVar9 = get_bits(in_ECX,4); bVar4 = (char)uVar9 + 1; local_458 = (int *)0x0; pbVar20[8] = bVar4; if (bVar4 != 0) { do { uVar9 = get_bits(in_ECX,8); pbVar20[(int)local_458 + 9] = (byte)uVar9; local_458 = (int *)((int)local_458 + 1); } while ((int)local_458 < (int)(uint)pbVar20[8]); } in_ECX[0x1d] = 4; return 0; } local_464 = (int *)0xffffffff; uVar9 = get_bits(in_ECX,5); *pbVar20 = (byte)uVar9; local_468 = 0; if ((byte)uVar9 != 0) { piVar18 = local_464; do { uVar9 = get_bits(in_ECX,4); pbVar20[local_468 + 1] = (byte)uVar9; local_464 = (int *)(uVar9 & 0xff); if ((int)(uVar9 & 0xff) <= (int)piVar18) { local_464 = piVar18; } local_468 = local_468 + 1; piVar18 = local_464; } while (local_468 < (int)(uint)*pbVar20); } local_460 = (void *)0x0; if (-1 < (int)local_464) { local_454 = pbVar20 + 0x31; local_44c = pbVar20 + 0x52; do { uVar9 = get_bits(in_ECX,3); local_454[-0x10] = (char)uVar9 + 1; uVar9 = get_bits(in_ECX,2); *local_454 = (byte)uVar9; if ((byte)uVar9 != 0) { uVar9 = get_bits(in_ECX,8); local_454[0x10] = (byte)uVar9; if (in_ECX[0x22] <= (int)(uVar9 & 0xff)) goto LAB_00aa6462; } local_468 = 0; if (0 < 1 << (*local_454 & 0x1f)) { local_470 = local_44c; do { uVar9 = get_bits(in_ECX,8); sVar6 = (short)uVar9 + -1; *(short *)local_470 = sVar6; if (in_ECX[0x22] <= (int)sVar6) goto LAB_00aa6462; local_470 = local_470 + 2; local_468 = local_468 + 1; } while (local_468 < 1 << (*local_454 & 0x1f)); } local_454 = local_454 + 1; local_460 = (void *)((int)local_460 + 1); local_44c = local_44c + 0x10; } while ((int)local_460 <= (int)local_464); } uVar9 = get_bits(in_ECX,2); pbVar20[0x634] = (char)uVar9 + 1; uVar9 = get_bits(in_ECX,4); pbVar20[0x635] = (byte)uVar9; pbVar20[0x152] = 0; pbVar20[0x153] = 0; *(short *)(pbVar20 + 0x154) = 1 << ((byte)uVar9 & 0x1f); pbVar20[0x638] = 2; pbVar20[0x639] = 0; pbVar20[0x63a] = 0; pbVar20[0x63b] = 0; local_44c = (byte *)0x0; sVar13 = 2; if (*pbVar20 != 0) { do { bVar4 = pbVar20[(int)local_44c + 1]; local_468 = 0; if (pbVar20[bVar4 + 0x21] != 0) { do { uVar9 = get_bits(in_ECX,(uint)pbVar20[0x635]); *(short *)(pbVar20 + *(int *)(pbVar20 + 0x638) * 2 + 0x152) = (short)uVar9; *(int *)(pbVar20 + 0x638) = *(int *)(pbVar20 + 0x638) + 1; local_468 = local_468 + 1; } while (local_468 < (int)(uint)pbVar20[bVar4 + 0x21]); } local_44c = (byte *)((int)local_44c + 1); } while ((int)local_44c < (int)(uint)*pbVar20); sVar13 = *(size_t *)(pbVar20 + 0x638); } iVar8 = 0; if (0 < (int)sVar13) { pbVar16 = pbVar20 + 0x152; do { uVar1 = *(undefined2 *)pbVar16; pbVar16 = pbVar16 + 2; *(undefined2 *)(abStack_446 + (iVar8 * 2 + -1) * 2) = uVar1; *(short *)(abStack_446 + iVar8 * 4) = (short)iVar8; iVar8 = iVar8 + 1; sVar13 = *(size_t *)(pbVar20 + 0x638); } while (iVar8 < (int)sVar13); } qsort(local_448,sVar13,4,FUN_00aa1380); iVar8 = *(int *)(pbVar20 + 0x638); iVar10 = 0; if (0 < iVar8) { do { pbVar20[iVar10 + 0x346] = abStack_446[iVar10 * 4]; iVar10 = iVar10 + 1; iVar8 = *(int *)(pbVar20 + 0x638); } while (iVar10 < iVar8); } iVar10 = 2; if (2 < iVar8) { do { local_44c = (byte *)0x10000; uVar9 = 0; local_464 = (int *)0xffffffff; if (0 < iVar10) { do { uVar7 = *(ushort *)(pbVar20 + uVar9 * 2 + 0x152); uVar17 = (uint)uVar7; if (((int)local_464 < (int)uVar17) && (uVar7 < *(ushort *)(pbVar20 + iVar10 * 2 + 0x152))) { local_498 = (double)((ulonglong)uVar9 << 0x20); local_464 = (int *)uVar17; } if ((uVar17 < local_44c) && (*(ushort *)(pbVar20 + iVar10 * 2 + 0x152) < uVar7)) { local_490 = (ulonglong)uVar9 << 0x20; local_44c = (byte *)uVar17; } uVar9 = uVar9 + 1; } while ((int)uVar9 < iVar10); } pbVar20[iVar10 * 2 + 0x440] = (byte)((ulonglong)local_498 >> 0x20); pbVar20[iVar10 * 2 + 0x441] = (byte)((ulonglong)local_490 >> 0x20); iVar10 = iVar10 + 1; iVar8 = *(int *)(pbVar20 + 0x638); } while (iVar10 < iVar8); } if (iVar8 <= local_49c) { iVar8 = local_49c; } local_458 = (int *)((int)local_458 + 2); local_45c = (void *)((int)local_45c + 0x63c); local_478 = local_478 + 1; local_49c = iVar8; } while (local_478 < in_ECX[0x24]); } uVar9 = get_bits(in_ECX,6); in_ECX[0x46] = uVar9 + 1; iVar8 = FUN_00aa0840(); in_ECX[0x67] = iVar8; local_478 = 0; if (0 < in_ECX[0x46]) { local_464 = in_ECX + 0x47; local_468 = 0; do { puVar21 = (uint *)(in_ECX[0x67] + local_468); uVar9 = get_bits(in_ECX,0x10); *(short *)local_464 = (short)uVar9; if (2 < (uVar9 & 0xffff)) goto LAB_00aa6462; uVar9 = get_bits(in_ECX,0x18); *puVar21 = uVar9; uVar9 = get_bits(in_ECX,0x18); puVar21[1] = uVar9; uVar9 = get_bits(in_ECX,0x18); puVar21[2] = uVar9 + 1; uVar9 = get_bits(in_ECX,6); *(char *)(puVar21 + 3) = (char)uVar9 + '\x01'; uVar9 = get_bits(in_ECX,8); *(char *)((int)puVar21 + 0xd) = (char)uVar9; local_458 = (int *)0x0; bVar4 = 0; if ((char)puVar21[3] != '\0') { do { local_44d = '\0'; uVar9 = get_bits(in_ECX,3); uVar17 = get_bits(in_ECX,1); if (uVar17 != 0) { uVar17 = get_bits(in_ECX,5); local_44d = (char)uVar17; } bVar4 = (byte)puVar21[3]; abStack_60[(int)local_458] = local_44d * '\b' + (char)uVar9; local_458 = (int *)((int)local_458 + 1); } while ((int)local_458 < (int)(uint)bVar4); } sVar13 = (uint)bVar4 * 0x10; in_ECX[2] = in_ECX[2] + sVar13; if (in_ECX[0x18] == 0) { if (bVar4 == 0) goto LAB_00aa6a71; pvVar11 = malloc(sVar13); } else { iVar8 = in_ECX[0x1a]; iVar10 = sVar13 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa6a71: pvVar11 = (void *)0x0; } else { in_ECX[0x1a] = iVar10; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } } puVar21[5] = (uint)pvVar11; local_44c = (byte *)0x0; if ((char)puVar21[3] != '\0') { do { bVar4 = abStack_60[(int)local_44c]; local_458 = (int *)0x0; do { iVar8 = ((int)local_458 + (int)local_44c * 8) * 2; local_490._4_4_ = (uint)bVar4; if ((local_490._4_4_ & 1 << ((byte)local_458 & 0x1f)) == 0) { *(undefined2 *)(iVar8 + puVar21[5]) = 0xffff; } else { uVar9 = get_bits(in_ECX,8); *(short *)(iVar8 + puVar21[5]) = (short)uVar9; if (in_ECX[0x22] <= (int)*(short *)(puVar21[5] + iVar8)) goto LAB_00aa6462; } local_458 = (int *)((int)local_458 + 1); } while ((int)local_458 < 8); local_44c = (byte *)((int)local_44c + 1); } while ((int)local_44c < (int)(uint)(byte)puVar21[3]); } sVar13 = *(int *)((uint)*(byte *)((int)puVar21 + 0xd) * 0x830 + 4 + in_ECX[0x23]) * 4; in_ECX[2] = in_ECX[2] + sVar13; if (in_ECX[0x18] == 0) { if (sVar13 == 0) goto LAB_00aa6dc5; pvVar11 = malloc(sVar13); } else { iVar8 = in_ECX[0x1a]; iVar10 = sVar13 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa6dc5: puVar21[4] = 0; goto LAB_00aa6dcc; } in_ECX[0x1a] = iVar10; pvVar11 = (void *)(in_ECX[0x18] + iVar8); } puVar21[4] = (uint)pvVar11; if (pvVar11 == (void *)0x0) { LAB_00aa6dcc: in_ECX[0x1d] = 3; return 0; } memset(pvVar11,0, *(int *)((uint)*(byte *)((int)puVar21 + 0xd) * 0x830 + 4 + in_ECX[0x23] ) << 2); bVar4 = *(byte *)((int)puVar21 + 0xd); local_454 = (byte *)0x0; if (0 < *(int *)((uint)bVar4 * 0x830 + 4 + in_ECX[0x23])) { do { iVar8 = *(int *)((uint)bVar4 * 0x830 + in_ECX[0x23]); uVar9 = iVar8 + 3U & 0xfffffffc; in_ECX[2] = in_ECX[2] + uVar9; if (in_ECX[0x18] == 0) { if (uVar9 == 0) goto LAB_00aa6c6b; local_45c = malloc(uVar9); } else { iVar10 = in_ECX[0x1a]; iVar19 = uVar9 + iVar10; if (in_ECX[0x1b] < iVar19) { LAB_00aa6c6b: local_45c = (void *)0x0; } else { in_ECX[0x1a] = iVar19; local_45c = (void *)(iVar10 + in_ECX[0x18]); } } *(void **)(puVar21[4] + (int)local_454 * 4) = local_45c; iVar8 = iVar8 + -1; if (-1 < iVar8) { uVar9 = (uint)(byte)puVar21[3]; local_470 = local_454; do { *(char *)(iVar8 + *(int *)(puVar21[4] + (int)local_454 * 4)) = (char)((int)local_470 % (int)uVar9); uVar9 = (uint)(byte)puVar21[3]; local_470 = (byte *)((int)local_470 / (int)uVar9); iVar8 = iVar8 + -1; } while (-1 < iVar8); } local_454 = (byte *)((int)local_454 + 1); bVar4 = *(byte *)((int)puVar21 + 0xd); } while ((int)local_454 < *(int *)((uint)bVar4 * 0x830 + 4 + in_ECX[0x23])); } local_478 = local_478 + 1; local_464 = (int *)((int)local_464 + 2); local_468 = local_468 + 0x18; } while (local_478 < in_ECX[0x46]); } uVar9 = get_bits(in_ECX,6); in_ECX[0x68] = uVar9 + 1; iVar8 = FUN_00aa0840(); in_ECX[0x69] = iVar8; local_468 = 0; if (0 < in_ECX[0x68]) { local_464 = (int *)0x0; do { puVar22 = (ushort *)(in_ECX[0x69] + (int)local_464); uVar9 = get_bits(in_ECX,0x10); if (uVar9 != 0) goto LAB_00aa6462; uVar9 = (in_ECX[1] + 1) * 3 & 0xfffffffc; in_ECX[2] = in_ECX[2] + uVar9; if (in_ECX[0x18] == 0) { if (uVar9 == 0) goto LAB_00aa6de8; pvVar11 = malloc(uVar9); } else { iVar8 = in_ECX[0x1a]; iVar10 = uVar9 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa6de8: pvVar11 = (void *)0x0; } else { in_ECX[0x1a] = iVar10; pvVar11 = (void *)(in_ECX[0x18] + iVar8); } } *(void **)(puVar22 + 2) = pvVar11; uVar9 = get_bits(in_ECX,1); if (uVar9 == 0) { uVar5 = 1; } else { uVar9 = get_bits(in_ECX,4); uVar5 = (undefined1)uVar9; } *(undefined1 *)(puVar22 + 4) = uVar5; uVar9 = get_bits(in_ECX,1); if (uVar9 == 0) { *puVar22 = 0; } else { uVar9 = get_bits(in_ECX,8); uVar7 = (short)uVar9 + 1; local_458 = (int *)0x0; *puVar22 = uVar7; if (uVar7 != 0) { iVar8 = in_ECX[1]; local_44c = (byte *)0x0; do { iVar8 = ilog(iVar8); uVar9 = get_bits(in_ECX,iVar8 + -1); *(char *)((int)local_44c + *(int *)(puVar22 + 2)) = (char)uVar9; iVar8 = ilog(in_ECX[1]); uVar9 = get_bits(in_ECX,iVar8 + -1); *(char *)(*(int *)(puVar22 + 2) + 1 + (int)local_44c) = (char)uVar9; if (((in_ECX[1] <= (int)(uint)*(byte *)(*(int *)(puVar22 + 2) + (int)local_44c)) || (bVar4 = *(byte *)(*(int *)(puVar22 + 2) + 1 + (int)local_44c), in_ECX[1] <= (int)(uint)bVar4)) || (*(byte *)(*(int *)(puVar22 + 2) + (int)local_44c) == bVar4)) goto LAB_00aa6462; local_44c = (byte *)((int)local_44c + 3); local_458 = (int *)((int)local_458 + 1); iVar8 = in_ECX[1]; } while ((int)local_458 < (int)(uint)*puVar22); } } uVar9 = get_bits(in_ECX,2); if (uVar9 != 0) goto LAB_00aa6462; bVar4 = (byte)puVar22[4]; if (bVar4 < 2) { iVar8 = 0; if (0 < in_ECX[1]) { iVar10 = 0; do { iVar10 = iVar10 + 3; iVar8 = iVar8 + 1; *(undefined1 *)(*(int *)(puVar22 + 2) + -1 + iVar10) = 0; } while (iVar8 < in_ECX[1]); bVar4 = (byte)puVar22[4]; } } else { local_458 = (int *)0x0; if (0 < in_ECX[1]) { local_478 = 0; do { uVar9 = get_bits(in_ECX,4); *(char *)(*(int *)(puVar22 + 2) + 2 + local_478) = (char)uVar9; bVar4 = (byte)puVar22[4]; if (bVar4 <= *(byte *)(*(int *)(puVar22 + 2) + 2 + local_478)) goto LAB_00aa6462; local_478 = local_478 + 3; local_458 = (int *)((int)local_458 + 1); } while ((int)local_458 < in_ECX[1]); } } if (bVar4 != 0) { local_44c = (byte *)((int)puVar22 + 9); do { get_bits(in_ECX,8); uVar9 = get_bits(in_ECX,8); *local_44c = (byte)uVar9; uVar9 = get_bits(in_ECX,8); local_44c[0xf] = (byte)uVar9; if ((in_ECX[0x24] <= (int)(uint)*local_44c) || (in_ECX[0x46] <= (int)(uVar9 & 0xff))) goto LAB_00aa6462; local_44c = local_44c + 1; } while ((int)(local_44c + (-9 - (int)puVar22)) < (int)(uint)(byte)puVar22[4]); } local_468 = local_468 + 1; local_464 = (int *)((int)local_464 + 0x28); } while (local_468 < in_ECX[0x68]); } uVar9 = get_bits(in_ECX,6); local_458 = (int *)0x0; in_ECX[0x6a] = uVar9 + 1; if (0 < (int)(uVar9 + 1)) { psVar23 = (short *)((int)in_ECX + 0x1ae); do { uVar9 = get_bits(in_ECX,1); *(char *)(psVar23 + -1) = (char)uVar9; uVar9 = get_bits(in_ECX,0x10); *psVar23 = (short)uVar9; uVar9 = get_bits(in_ECX,0x10); psVar23[1] = (short)uVar9; uVar9 = get_bits(in_ECX,8); *(char *)((int)psVar23 + -1) = (char)uVar9; if (((*psVar23 != 0) || (psVar23[1] != 0)) || (in_ECX[0x68] <= (int)(uVar9 & 0xff))) goto LAB_00aa6462; psVar23 = psVar23 + 3; local_458 = (int *)((int)local_458 + 1); } while ((int)local_458 < in_ECX[0x6a]); } flush_packet(); in_ECX[0xfc] = 0; local_458 = (int *)0x0; if (0 < in_ECX[1]) { piVar18 = in_ECX + 0xec; uVar9 = local_49c * 2 + 3U & 0xfffffffc; do { sVar13 = in_ECX[0x21] * 4; in_ECX[2] = in_ECX[2] + sVar13; if (in_ECX[0x18] == 0) { if (sVar13 == 0) goto LAB_00aa717c; pvVar11 = malloc(sVar13); } else { iVar8 = in_ECX[0x1a]; iVar10 = sVar13 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa717c: pvVar11 = (void *)0x0; } else { in_ECX[0x1a] = iVar10; pvVar11 = (void *)(iVar8 + in_ECX[0x18]); } } piVar18[-0x20] = (int)pvVar11; uVar17 = (in_ECX[0x21] & 0x3fffffffU) * 2 + 3 & 0xfffffffc; in_ECX[2] = in_ECX[2] + uVar17; if (in_ECX[0x18] == 0) { if (uVar17 == 0) goto LAB_00aa71c5; pvVar11 = malloc(uVar17); } else { iVar8 = in_ECX[0x1a]; iVar10 = uVar17 + iVar8; if (in_ECX[0x1b] < iVar10) { LAB_00aa71c5: pvVar11 = (void *)0x0; } else { in_ECX[0x1a] = iVar10; pvVar11 = (void *)(in_ECX[0x18] + iVar8); } } *piVar18 = (int)pvVar11; in_ECX[2] = in_ECX[2] + uVar9; if (in_ECX[0x18] == 0) { if (uVar9 == 0) goto LAB_00aa720f; pvVar11 = malloc(uVar9); } else { iVar8 = in_ECX[0x1a] + uVar9; if (in_ECX[0x1b] < iVar8) { LAB_00aa720f: pvVar11 = (void *)0x0; } else { pvVar11 = (void *)(in_ECX[0x18] + in_ECX[0x1a]); in_ECX[0x1a] = iVar8; } } piVar18[0x11] = (int)pvVar11; piVar18 = piVar18 + 1; local_458 = (int *)((int)local_458 + 1); } while ((int)local_458 < in_ECX[1]); } iVar8 = init_blocksize(in_ECX[0x20]); if (iVar8 == 0) { return 0; } iVar8 = init_blocksize(in_ECX[0x21]); if (iVar8 == 0) { return 0; } uVar9 = 0; in_ECX[0x1e] = in_ECX[0x20]; in_ECX[0x1f] = in_ECX[0x21]; iVar8 = in_ECX[0x46]; uVar17 = (in_ECX[0x21] & 0x3fffffffU) << 1; if (0 < iVar8) { piVar18 = (int *)in_ECX[0x67]; do { uVar12 = (uint)(piVar18[1] - *piVar18) / (uint)piVar18[2]; if ((int)uVar9 < (int)uVar12) { uVar9 = uVar12; } iVar8 = iVar8 + -1; piVar18 = piVar18 + 6; } while (iVar8 != 0); } uVar9 = (uVar9 + 1) * in_ECX[1] * 4; in_ECX[3] = uVar9; if (uVar9 < uVar17) { in_ECX[3] = uVar17; uVar9 = uVar17; } *(undefined1 *)((int)in_ECX + 0x571) = 1; if (in_ECX[0x18] != 0) { uVar17 = in_ECX[0x1b]; if (uVar17 != in_ECX[0x19]) { _wassert(L"f->temp_offset == f->alloc.alloc_buffer_length_in_bytes", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp" ,0x1008); uVar9 = in_ECX[3]; uVar17 = in_ECX[0x1b]; } if (uVar17 < in_ECX[0x1a] + 0x5f8 + uVar9) goto LAB_00aa6432; } iVar8 = FUN_00aa7640(); in_ECX[0xd] = iVar8; return 1; } } } else if (in_ECX[0x1d] != 0x15) { return 0; } } LAB_00aa6462: in_ECX[0x1d] = 0x14; return 0; } } } } LAB_00aa52a1: in_ECX[0x1d] = 0x22; return 0; } //@@ 00aa7340 vorbis_deinit /* DB: stb_vorbis vorbis_deinit: frees residue classdata/part books, codebooks, floor/mapping/residue configs unless alloc_buffer (+0x60) is set; callers stb_vorbis_close path (FUN_00aa78e0) and SampleSourceOgg slot 7 (FUN_00a7bd80) */ void vorbis_deinit(void) { int in_ECX; int iVar1; int iVar2; int iVar3; undefined4 *puVar4; int local_10; int local_c; int local_8; local_8 = 0; if (0 < *(int *)(in_ECX + 0x118)) { local_c = 0; do { iVar1 = *(int *)(in_ECX + 0x19c) + local_c; if (*(int *)(iVar1 + 0x10) == 0) { LAB_00aa73e2: if (*(int *)(in_ECX + 0x60) == 0) { free(*(void **)(iVar1 + 0x14)); } } else { local_10 = 0; if (0 < *(int *)((uint)*(byte *)(iVar1 + 0xd) * 0x830 + 4 + *(int *)(in_ECX + 0x8c))) { do { if (*(int *)(in_ECX + 0x60) == 0) { free(*(void **)(*(int *)(iVar1 + 0x10) + local_10 * 4)); } local_10 = local_10 + 1; } while (local_10 < *(int *)((uint)*(byte *)(iVar1 + 0xd) * 0x830 + 4 + *(int *)(in_ECX + 0x8c))); } if (*(int *)(in_ECX + 0x60) == 0) { free(*(void **)(iVar1 + 0x10)); goto LAB_00aa73e2; } } local_8 = local_8 + 1; local_c = local_c + 0x18; } while (local_8 < *(int *)(in_ECX + 0x118)); } if (*(int *)(in_ECX + 0x8c) != 0) { local_10 = 0; if (0 < *(int *)(in_ECX + 0x88)) { local_c = 0; do { iVar2 = *(int *)(in_ECX + 0x8c) + local_c; iVar1 = *(int *)(in_ECX + 0x60); if (iVar1 == 0) { free(*(void **)(iVar2 + 8)); iVar1 = *(int *)(in_ECX + 0x60); if (iVar1 == 0) { free(*(void **)(iVar2 + 0x1c)); iVar1 = *(int *)(in_ECX + 0x60); if (iVar1 == 0) { free(*(void **)(iVar2 + 0x20)); iVar1 = *(int *)(in_ECX + 0x60); if (iVar1 == 0) { free(*(void **)(iVar2 + 0x824)); iVar1 = *(int *)(in_ECX + 0x60); } } } } if (iVar1 == 0) { free((void *)(-(uint)(*(int *)(iVar2 + 0x828) != 0) & *(int *)(iVar2 + 0x828) - 4U)); } local_10 = local_10 + 1; local_c = local_c + 0x830; } while (local_10 < *(int *)(in_ECX + 0x88)); } if (*(int *)(in_ECX + 0x60) == 0) { free(*(void **)(in_ECX + 0x8c)); } } iVar1 = *(int *)(in_ECX + 0x60); if (iVar1 == 0) { free(*(void **)(in_ECX + 0x114)); iVar1 = *(int *)(in_ECX + 0x60); } if (iVar1 == 0) { free(*(void **)(in_ECX + 0x19c)); iVar1 = *(int *)(in_ECX + 0x60); } iVar3 = 0; iVar2 = iVar1; if (0 < *(int *)(in_ECX + 0x1a0)) { local_10 = 0; do { if (iVar1 == 0) { free(*(void **)(*(int *)(in_ECX + 0x1a4) + 4 + local_10)); iVar1 = *(int *)(in_ECX + 0x60); iVar2 = iVar1; } iVar3 = iVar3 + 1; local_10 = local_10 + 0x28; } while (iVar3 < *(int *)(in_ECX + 0x1a0)); } if (iVar2 == 0) { free(*(void **)(in_ECX + 0x1a4)); } local_c = 0; if (0 < *(int *)(in_ECX + 4)) { puVar4 = (undefined4 *)(in_ECX + 0x3b0); do { if (((*(int *)(in_ECX + 0x60) == 0) && (free((void *)puVar4[-0x20]), *(int *)(in_ECX + 0x60) == 0)) && (free((void *)*puVar4), *(int *)(in_ECX + 0x60) == 0)) { free((void *)puVar4[0x11]); } local_c = local_c + 1; puVar4 = puVar4 + 1; } while (local_c < *(int *)(in_ECX + 4)); } puVar4 = (undefined4 *)(in_ECX + 0x444); local_10 = 2; do { if (((*(int *)(in_ECX + 0x60) == 0) && (free((void *)puVar4[-2]), *(int *)(in_ECX + 0x60) == 0)) && ((free((void *)*puVar4), *(int *)(in_ECX + 0x60) == 0 && (free((void *)puVar4[2]), *(int *)(in_ECX + 0x60) == 0)))) { free((void *)puVar4[4]); } puVar4 = puVar4 + 1; local_10 = local_10 + -1; } while (local_10 != 0); if (*(int *)(in_ECX + 0x1c) != 0) { (**(code **)(**(int **)(in_ECX + 0x14) + 0x34))(); } return; } //@@ 00aa7600 FUN_00aa7600 void * FUN_00aa7600(void) { int iVar1; int iVar2; void *pvVar3; int in_ECX; *(int *)(in_ECX + 8) = *(int *)(in_ECX + 8) + 0x5f8; if (*(int *)(in_ECX + 0x60) == 0) { pvVar3 = malloc(0x5f8); return pvVar3; } iVar2 = *(int *)(in_ECX + 0x68); iVar1 = iVar2 + 0x5f8; if (*(int *)(in_ECX + 0x6c) < iVar1) { return (void *)0x0; } *(int *)(in_ECX + 0x68) = iVar1; return (void *)(*(int *)(in_ECX + 0x60) + iVar2); } //@@ 00aa7640 FUN_00aa7640 int FUN_00aa7640(void) { int iVar1; int in_ECX; if (*(char *)(in_ECX + 0x30) != '\0') { return 0; } if (*(int *)(in_ECX + 0x20) == 0) { iVar1 = (**(code **)(**(int **)(in_ECX + 0x14) + 8))(); return iVar1 - *(int *)(in_ECX + 0x18); } return *(int *)(in_ECX + 0x20) - *(int *)(in_ECX + 0x24); } //@@ 00aa7670 FUN_00aa7670 int FUN_00aa7670(int *param_1) { int iVar1; int in_ECX; int *piVar2; int iVar3; int local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; int local_8; if (*(char *)(in_ECX + 0x30) != '\0') { *(undefined4 *)(in_ECX + 0x74) = 2; return 0; } iVar1 = FUN_00aa4340(&local_14,&local_10,&local_c,&local_18); if ((iVar1 == 0) || (iVar1 = stb_vorbis::vorbis_decode_packet_rest (in_ECX + (local_18 * 3 + 0xd6) * 2,local_8,local_14,local_10,local_c, &local_8), iVar1 == 0)) { *(undefined4 *)(in_ECX + 0x5f4) = 0; *(undefined4 *)(in_ECX + 0x5f0) = 0; return 0; } iVar1 = FUN_00aa4f20(local_8,local_10); iVar3 = 0; if (0 < *(int *)(in_ECX + 4)) { piVar2 = (int *)(in_ECX + 0x370); do { iVar3 = iVar3 + 1; *piVar2 = piVar2[-0x10] + local_8 * 4; piVar2 = piVar2 + 1; } while (iVar3 < *(int *)(in_ECX + 4)); } *(int *)(in_ECX + 0x5f0) = local_8; *(int *)(in_ECX + 0x5f4) = iVar1 + local_8; if (param_1 != (int *)0x0) { *param_1 = in_ECX + 0x370; } return iVar1; } //@@ 00aa7770 FUN_00aa7770 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ int * FUN_00aa7770(undefined4 *param_1,int *param_2) { undefined4 uVar1; int iVar2; int *piVar3; int *in_ECX; int *piVar4; int *piVar5; undefined1 auStack_60c [4]; int aiStack_608 [6]; undefined4 uStack_5f0; undefined4 uStack_5ec; undefined4 uStack_5e8; undefined4 uStack_5dc; int iStack_5a8; uint uStack_5a4; int iStack_5a0; uint uStack_59c; undefined4 uStack_598; undefined4 uStack_594; undefined4 uStack_57c; undefined4 uStack_6c; uint local_c; local_c = __security_cookie ^ (uint)auStack_60c; uVar1 = (**(code **)(*in_ECX + 4))(); memset(aiStack_608,0,0x5f8); if (param_2 != (int *)0x0) { iStack_5a8 = *param_2; uStack_5a4 = param_2[1] + 3U & 0xfffffffc; uStack_59c = uStack_5a4; } uStack_598 = 0; uStack_594 = 0; uStack_5e8 = 0; uStack_57c = 0; uStack_6c = 0xffffffff; uStack_5f0 = (**(code **)(*in_ECX + 8))(); uStack_5ec = 1; uStack_5dc = uVar1; iVar2 = stb_vorbis::start_decoder(); if (iVar2 != 0) { aiStack_608[2] = aiStack_608[2] + 0x5f8; if (iStack_5a8 == 0) { piVar3 = malloc(0x5f8); } else { piVar3 = (int *)(iStack_5a8 + iStack_5a0); if ((int)uStack_59c < iStack_5a0 + 0x5f8) goto LAB_00aa788e; iStack_5a0 = iStack_5a0 + 0x5f8; } if (piVar3 != (int *)0x0) { piVar4 = aiStack_608; piVar5 = piVar3; for (iVar2 = 0x17e; iVar2 != 0; iVar2 = iVar2 + -1) { *piVar5 = *piVar4; piVar4 = piVar4 + 1; piVar5 = piVar5 + 1; } FUN_00aa50a0(); return piVar3; } } LAB_00aa788e: KAGE_LogMessage(1,(byte *)"STB_VORBIS error %d!\n"); if (param_1 != (undefined4 *)0x0) { *param_1 = uStack_594; } vorbis_deinit(); return (int *)0x0; } //@@ 00aa78e0 FUN_00aa78e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 * FUN_00aa78e0(undefined4 *param_1,undefined4 *param_2) { int iVar1; undefined4 *puVar2; int in_ECX; int in_EDX; undefined4 *puVar3; undefined4 *puVar4; undefined4 local_604 [5]; undefined4 local_5f0; undefined4 local_5e8; int local_5dc; undefined1 local_5d4; undefined4 local_5a4; uint local_5a0; uint local_598; undefined4 local_594; undefined4 local_590; undefined4 local_578; undefined4 local_68; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (in_ECX != 0) { memset(local_604,0,0x5f8); if (param_2 != (undefined4 *)0x0) { local_5a4 = *param_2; local_5a0 = param_2[1] + 3 & 0xfffffffc; local_598 = local_5a0; } local_5dc = in_EDX + in_ECX; local_594 = 0; local_590 = 0; local_578 = 0; local_68 = 0xffffffff; local_5e8 = 0; local_5f0 = 0; local_5d4 = 0; iVar1 = stb_vorbis::start_decoder(); if (iVar1 != 0) { puVar2 = (undefined4 *)FUN_00aa7600(); if (puVar2 != (undefined4 *)0x0) { puVar3 = local_604; puVar4 = puVar2; for (iVar1 = 0x17e; iVar1 != 0; iVar1 = iVar1 + -1) { *puVar4 = *puVar3; puVar3 = puVar3 + 1; puVar4 = puVar4 + 1; } FUN_00aa50a0(); return puVar2; } } if (param_1 != (undefined4 *)0x0) { *param_1 = local_590; } vorbis_deinit(); } return (undefined4 *)0x0; } //@@ 00aa7a10 stb_vorbis::compute_stereo_samples /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: stb_vorbis: only caller FUN_00aa7e80 (convert_channels_short_interleaved, float*384 -> short clamp); 32-float local buffer filled 16 frames at a time, per channel channel_position mask table DAT_00b4eca0[num_c*6] tested for PLAYBACK_LEFT|RIGHT (6) / LEFT (2) / RIGHT (4) */ void stb_vorbis::compute_stereo_samples(int param_1,int param_2,int param_3) { float *pfVar1; float fVar2; float fVar3; byte bVar4; float *pfVar5; int in_ECX; int iVar6; int iVar7; int in_EDX; int iVar8; int iVar9; undefined2 *puVar10; int local_9c; int local_98; int local_94; byte *local_8c; float local_88 [32]; float local_8; local_8 = (float)(__security_cookie ^ (uint)(local_88 + 0x21)); local_98 = 0; if (0 < param_3) { local_9c = param_3; local_94 = param_2 * 4 + 8; iVar9 = 0x10; do { memset(local_88,0,0x80); iVar6 = local_9c; if (local_98 + iVar9 <= param_3) { iVar6 = iVar9; } iVar9 = 0; if (0 < in_EDX) { local_8c = &DAT_00b4eca0 + in_EDX * 6; do { bVar4 = *local_8c & 6; if (bVar4 == 6) { iVar7 = 0; if (0 < iVar6) { pfVar5 = (float *)(*(int *)(param_1 + iVar9 * 4) + -8 + local_94); do { fVar2 = *pfVar5; pfVar5 = pfVar5 + 1; fVar3 = local_88[iVar7 * 2 + 1]; local_88[iVar7 * 2] = fVar2 + local_88[iVar7 * 2]; local_88[iVar7 * 2 + 1] = fVar2 + fVar3; iVar7 = iVar7 + 1; } while (iVar7 < iVar6); } } else if (bVar4 == 2) { iVar7 = 0; if (iVar6 < 4) { if (0 < iVar6) { iVar8 = *(int *)(param_1 + iVar9 * 4); goto LAB_00aa7b9a; } } else { iVar8 = *(int *)(param_1 + iVar9 * 4); pfVar5 = (float *)(local_94 + iVar8); do { local_88[iVar7 * 2] = pfVar5[-2] + local_88[iVar7 * 2]; local_88[iVar7 * 2 + 2] = pfVar5[-1] + local_88[iVar7 * 2 + 2]; local_88[iVar7 * 2 + 4] = local_88[iVar7 * 2 + 4] + *pfVar5; pfVar1 = pfVar5 + 1; pfVar5 = pfVar5 + 4; local_88[iVar7 * 2 + 6] = *pfVar1 + local_88[iVar7 * 2 + 6]; iVar7 = iVar7 + 4; } while (iVar7 < iVar6 + -3); if (iVar7 < iVar6) { LAB_00aa7b9a: pfVar5 = (float *)(iVar8 + (local_98 + iVar7 + param_2) * 4); do { fVar2 = *pfVar5; pfVar5 = pfVar5 + 1; local_88[iVar7 * 2] = local_88[iVar7 * 2] + fVar2; iVar7 = iVar7 + 1; } while (iVar7 < iVar6); } } } else if (bVar4 == 4) { iVar7 = 0; if (iVar6 < 4) { if (0 < iVar6) { iVar8 = *(int *)(param_1 + iVar9 * 4); goto LAB_00aa7c50; } } else { iVar8 = *(int *)(param_1 + iVar9 * 4); pfVar5 = (float *)(local_94 + iVar8); do { local_88[iVar7 * 2 + 1] = pfVar5[-2] + local_88[iVar7 * 2 + 1]; local_88[iVar7 * 2 + 3] = pfVar5[-1] + local_88[iVar7 * 2 + 3]; local_88[iVar7 * 2 + 5] = local_88[iVar7 * 2 + 5] + *pfVar5; pfVar1 = pfVar5 + 1; pfVar5 = pfVar5 + 4; local_88[iVar7 * 2 + 7] = *pfVar1 + local_88[iVar7 * 2 + 7]; iVar7 = iVar7 + 4; } while (iVar7 < iVar6 + -3); if (iVar7 < iVar6) { LAB_00aa7c50: pfVar5 = (float *)(iVar8 + (local_98 + iVar7 + param_2) * 4); do { fVar2 = *pfVar5; pfVar5 = pfVar5 + 1; local_88[iVar7 * 2 + 1] = fVar2 + local_88[iVar7 * 2 + 1]; iVar7 = iVar7 + 1; } while (iVar7 < iVar6); } } } iVar9 = iVar9 + 1; local_8c = local_8c + 1; } while (iVar9 < in_EDX); } iVar9 = 0; if (3 < iVar6 * 2) { puVar10 = (undefined2 *)(in_ECX + (local_98 * 2 + 2) * 2); do { iVar7 = (int)(local_88[iVar9] + 384.0) + -0x43c00000; if (0xffff < (int)(local_88[iVar9] + 384.0) + 0xbc408000U) { iVar7 = (iVar7 >> 0x1f & 0xffff0001U) + 0x7fff; } fVar2 = local_88[iVar9 + 1]; puVar10[-2] = (short)iVar7; iVar7 = (int)(fVar2 + 384.0) + -0x43c00000; if (0xffff < (int)(fVar2 + 384.0) + 0xbc408000U) { iVar7 = (iVar7 >> 0x1f & 0xffff0001U) + 0x7fff; } fVar2 = local_88[iVar9 + 2]; puVar10[-1] = (short)iVar7; iVar7 = (int)(fVar2 + 384.0) + -0x43c00000; if (0xffff < (int)(fVar2 + 384.0) + 0xbc408000U) { iVar7 = (iVar7 >> 0x1f & 0xffff0001U) + 0x7fff; } fVar2 = local_88[iVar9 + 3]; *puVar10 = (short)iVar7; iVar7 = (int)(fVar2 + 384.0) + -0x43c00000; if (0xffff < (int)(fVar2 + 384.0) + 0xbc408000U) { iVar7 = (iVar7 >> 0x1f & 0xffff0001U) + 0x7fff; } puVar10[1] = (short)iVar7; iVar9 = iVar9 + 4; puVar10 = puVar10 + 4; } while (iVar9 < iVar6 * 2 + -3); } if (iVar9 < iVar6 * 2) { puVar10 = (undefined2 *)(in_ECX + (local_98 * 2 + iVar9) * 2); do { iVar7 = (int)(local_88[iVar9] + 384.0) + -0x43c00000; if (0xffff < (int)(local_88[iVar9] + 384.0) + 0xbc408000U) { iVar7 = (iVar7 >> 0x1f & 0xffff0001U) + 0x7fff; } *puVar10 = (short)iVar7; iVar9 = iVar9 + 1; puVar10 = puVar10 + 1; } while (iVar9 < iVar6 * 2); } local_98 = local_98 + 0x10; local_9c = local_9c + -0x10; local_94 = local_94 + 0x40; iVar9 = iVar6; } while (local_98 < param_3); } return; } //@@ 00aa7e80 FUN_00aa7e80 void FUN_00aa7e80(int param_1,int param_2,int param_3,int param_4) { int in_ECX; int iVar1; uint uVar2; undefined4 *in_EDX; uint uVar3; int iVar4; undefined4 *puVar5; float fVar6; int local_8; if (((in_ECX == param_1) || (2 < in_ECX)) || (6 < param_1)) { if (in_ECX < param_1) { param_1 = in_ECX; } if (0 < param_4) { local_8 = param_3 << 2; do { iVar4 = 0; if (0 < param_1) { do { fVar6 = *(float *)(*(int *)(param_2 + iVar4 * 4) + local_8) + 384.0; iVar1 = (int)fVar6 + -0x43c00000; if (0xffff < (int)fVar6 + 0xbc408000U) { iVar1 = (iVar1 >> 0x1f & 0xffff0001U) + 0x7fff; } *(short *)in_EDX = (short)iVar1; iVar4 = iVar4 + 1; in_EDX = (undefined4 *)((int)in_EDX + 2); } while (iVar4 < param_1); } if (iVar4 < in_ECX) { uVar3 = in_ECX - iVar4; puVar5 = in_EDX; for (uVar2 = (uVar3 & 0x7fffffff) >> 1; uVar2 != 0; uVar2 = uVar2 - 1) { *puVar5 = 0; puVar5 = puVar5 + 1; } in_EDX = (undefined4 *)((int)in_EDX + uVar3 * 2); for (uVar2 = (uint)((uVar3 & 1) != 0); uVar2 != 0; uVar2 = uVar2 - 1) { *(undefined2 *)puVar5 = 0; puVar5 = (undefined4 *)((int)puVar5 + 2); } } local_8 = local_8 + 4; param_4 = param_4 + -1; } while (param_4 != 0); } } else if ((in_ECX == 2) || (_wassert(L"buf_c == 2", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Core\\External\\ogg.cpp", 0x1441), 0 < in_ECX)) { do { stb_vorbis::compute_stereo_samples(param_2,param_3,param_4); in_ECX = in_ECX + -1; } while (in_ECX != 0); return; } return; } //@@ 00aa7fb0 FUN_00aa7fb0 int FUN_00aa7fb0(undefined4 param_1,int param_2) { int iVar1; int in_ECX; int iVar2; int in_EDX; int iVar3; undefined1 local_c [8]; param_2 = param_2 / in_EDX; iVar3 = 0; if (param_2 < 1) { return 0; } do { iVar2 = *(int *)(in_ECX + 0x5f4) - *(int *)(in_ECX + 0x5f0); iVar1 = param_2 - iVar3; if (iVar2 + iVar3 < param_2) { iVar1 = iVar2; } iVar2 = *(int *)(in_ECX + 0x5f0); if (iVar1 != 0) { FUN_00aa7e80(*(undefined4 *)(in_ECX + 4),in_ECX + 0x330,iVar2,iVar1); iVar2 = *(int *)(in_ECX + 0x5f0); } iVar3 = iVar3 + iVar1; *(int *)(in_ECX + 0x5f0) = iVar1 + iVar2; } while (((iVar3 != param_2) && (iVar1 = FUN_00aa7670(local_c), iVar1 != 0)) && (iVar3 < param_2)) ; return iVar3; } //@@ 00aa8070 FUN_00aa8070 int FUN_00aa8070(int *param_1,int *param_2) { if (param_1[1] == param_2[1]) { return *param_1 - *param_2; } return param_1[1] - param_2[1]; } //@@ 00aa8090 FUN_00aa8090 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ undefined4 FUN_00aa8090(void) { size_t _Size; UINT UVar1; void *_Dst; uint uVar2; PRAWINPUTDEVICELIST pRawInputDeviceList; uint uVar3; undefined4 uVar4; char *pcVar5; undefined1 auStack_158 [12]; uint local_14c [2]; int *local_144; undefined4 local_140; undefined4 uStack_13c; undefined4 uStack_138; undefined4 uStack_134; undefined4 local_130; undefined4 uStack_12c; undefined4 uStack_128; undefined4 uStack_124; char local_118 [255]; undefined1 local_19; uint local_14; local_14 = __security_cookie ^ (uint)auStack_158; local_14c[0] = 0; UVar1 = GetRawInputDeviceList((PRAWINPUTDEVICELIST)0x0,local_14c,8); if (UVar1 != 0) { return 0; } if (local_14c[0] != 0) { if (local_14c[0] < 0x20000000) { _Size = local_14c[0] * 8; _Dst = (void *)(*g_glfwAllocate)(_Size,g_glfwAllocatorUser); if (_Dst != (void *)0x0) { pRawInputDeviceList = memset(_Dst,0,_Size); goto LAB_00aa8124; } pcVar5 = (char *)0x0; uVar4 = 0x10005; } else { pcVar5 = "Allocation size overflow"; uVar4 = 0x10004; } _glfwInputError(uVar4,pcVar5); } pRawInputDeviceList = (PRAWINPUTDEVICELIST)0x0; LAB_00aa8124: UVar1 = GetRawInputDeviceList(pRawInputDeviceList,local_14c,8); if (UVar1 == 0xffffffff) { if (pRawInputDeviceList != (PRAWINPUTDEVICELIST)0x0) { (*g_glfwDeallocate)(pRawInputDeviceList,g_glfwAllocatorUser); } return 0; } uVar3 = 0; uVar2 = local_14c[0]; if (local_14c[0] != 0) { do { if (pRawInputDeviceList[uVar3].dwType == 2) { local_14c[1] = 0x20; uStack_13c = 0; uStack_138 = 0; uStack_134 = 0; local_130 = 0; uStack_12c = 0; uStack_128 = 0; uStack_124 = 0; local_140 = 0x20; UVar1 = GetRawInputDeviceInfoA (pRawInputDeviceList[uVar3].hDevice,0x2000000b,&local_140,local_14c + 1); if (UVar1 != 0xffffffff) { if (CONCAT22((undefined2)uStack_134,(undefined2)uStack_138) == *local_144) { memset(local_118,0,0x100); local_14c[1] = 0x100; UVar1 = GetRawInputDeviceInfoA (pRawInputDeviceList[uVar3].hDevice,0x20000007,local_118,local_14c + 1 ); if (UVar1 == 0xffffffff) break; local_19 = 0; pcVar5 = strstr(local_118,"IG_"); if (pcVar5 != (char *)0x0) { uVar4 = 1; goto LAB_00aa8233; } } } uVar2 = local_14c[0]; } uVar3 = uVar3 + 1; } while (uVar3 < uVar2); } uVar4 = 0; LAB_00aa8233: if (pRawInputDeviceList != (PRAWINPUTDEVICELIST)0x0) { (*g_glfwDeallocate)(pRawInputDeviceList,g_glfwAllocatorUser); } return uVar4; } //@@ 00aa8270 FUN_00aa8270 void FUN_00aa8270(void) { int *piVar1; void *in_ECX; if (in_ECX == (void *)0x0) { _wassert(L"js != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1a2); } *(undefined4 *)((int)in_ECX + 4) = 0; if (DAT_00c74ca8 != (code *)0x0) { (*DAT_00c74ca8)(((int)in_ECX + -0xc73cb0) / 0xec,0x40002); } piVar1 = *(int **)((int)in_ECX + 0xd4); if (piVar1 != (int *)0x0) { (**(code **)(*piVar1 + 0x20))(piVar1); (**(code **)(**(int **)((int)in_ECX + 0xd4) + 8))(*(int **)((int)in_ECX + 0xd4)); } if (*(int *)((int)in_ECX + 0xcc) != 0) { (*g_glfwDeallocate)(*(int *)((int)in_ECX + 0xcc),g_glfwAllocatorUser); } if (*(int *)((int)in_ECX + 8) != 0) { (*g_glfwDeallocate)(*(int *)((int)in_ECX + 8),g_glfwAllocatorUser); } if (*(int *)((int)in_ECX + 0x10) != 0) { (*g_glfwDeallocate)(*(int *)((int)in_ECX + 0x10),g_glfwAllocatorUser); } if (*(int *)((int)in_ECX + 0x18) != 0) { (*g_glfwDeallocate)(*(int *)((int)in_ECX + 0x18),g_glfwAllocatorUser); } memset(in_ECX,0,0xec); return; } //@@ 00aa8360 deviceObjectCallback /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW win32_joystick.c DirectInput EnumObjects callback (pushed with DIDFT_AXIS|BUTTON|POV = 0x1f at aa87c7): compares guidType with GUID_Slider/axis GUIDs (DAT_00b4ecec/cc), axis/slider/button/POV objects, POV offset DIJOFS_POV(n)=0x20+4n type 3 */ undefined4 deviceObjectCallback(int param_1,undefined4 *param_2) { int *piVar1; byte bVar2; int iVar3; int *piVar4; byte *pbVar5; int *piVar6; uint uVar7; int *piVar8; bool bVar9; undefined4 local_20; undefined4 local_1c; undefined4 local_18; undefined4 local_14; undefined4 local_10; undefined4 local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; piVar1 = (int *)(param_2[1] + param_2[2] * 8); bVar2 = *(byte *)(param_1 + 0x18); if ((bVar2 & 3) != 0) { piVar8 = (int *)(param_1 + 4); uVar7 = 0xc; piVar6 = &DAT_00b4ecec; piVar4 = piVar8; do { if (*piVar4 != *piVar6) { piVar6 = &DAT_00b4eccc; uVar7 = 0xc; piVar4 = piVar8; goto LAB_00aa83d0; } piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = 3 < uVar7; uVar7 = uVar7 - 4; } while (bVar9); iVar3 = param_2[4] * 4 + 0x18; goto LAB_00aa84aa; } if ((bVar2 & 0xc) == 0) { if ((bVar2 & 0x10) != 0) { iVar3 = param_2[6]; piVar1[1] = 3; *piVar1 = iVar3 * 4 + 0x20; param_2[6] = param_2[6] + 1; } } else { iVar3 = param_2[5]; piVar1[1] = 2; *piVar1 = iVar3 + 0x30; param_2[5] = param_2[5] + 1; } goto LAB_00aa8588; while( true ) { piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = uVar7 < 4; uVar7 = uVar7 - 4; if (bVar9) break; LAB_00aa83d0: if (*piVar4 != *piVar6) { piVar6 = &DAT_00b4ed2c; uVar7 = 0xc; piVar4 = piVar8; goto LAB_00aa83f4; } } iVar3 = 0; goto LAB_00aa84aa; while( true ) { piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = uVar7 < 4; uVar7 = uVar7 - 4; if (bVar9) break; LAB_00aa83f4: if (*piVar4 != *piVar6) { piVar6 = &DAT_00b4ed3c; uVar7 = 0xc; piVar4 = piVar8; goto LAB_00aa8420; } } iVar3 = 4; goto LAB_00aa84aa; while( true ) { piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = uVar7 < 4; uVar7 = uVar7 - 4; if (bVar9) break; LAB_00aa8420: if (*piVar4 != *piVar6) { piVar6 = &DAT_00b4ecdc; uVar7 = 0xc; piVar4 = piVar8; goto LAB_00aa8444; } } iVar3 = 8; goto LAB_00aa84aa; LAB_00aa8468: if (*piVar4 == *piVar6) goto code_r0x00aa846e; piVar6 = &DAT_00b4ed1c; uVar7 = 0xc; piVar4 = piVar8; do { if (*piVar4 != *piVar6) { return 1; } piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = 3 < uVar7; uVar7 = uVar7 - 4; } while (bVar9); iVar3 = 0x14; goto LAB_00aa84aa; code_r0x00aa846e: piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = uVar7 < 4; uVar7 = uVar7 - 4; if (bVar9) goto code_r0x00aa8479; goto LAB_00aa8468; code_r0x00aa8479: iVar3 = 0x10; goto LAB_00aa84aa; while( true ) { piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; bVar9 = uVar7 < 4; uVar7 = uVar7 - 4; if (bVar9) break; LAB_00aa8444: if (*piVar4 != *piVar6) { piVar6 = &DAT_00b4ed4c; uVar7 = 0xc; piVar4 = piVar8; goto LAB_00aa8468; } } iVar3 = 0xc; LAB_00aa84aa: *piVar1 = iVar3; local_20 = 0x18; local_1c = 0x10; local_14 = 2; local_18 = *(undefined4 *)(param_1 + 0x18); local_10 = 0xffff8000; local_c = 0x7fff; iVar3 = (**(code **)(*(int *)*param_2 + 0x18))((int *)*param_2,4,&local_20); if (-1 < iVar3) { pbVar5 = (byte *)&DAT_00b4ecec; uVar7 = 0xc; do { if (*piVar8 != *(int *)pbVar5) { bVar2 = (byte)*piVar8; bVar9 = bVar2 < *pbVar5; if ((((bVar2 == *pbVar5) && (bVar9 = *(byte *)((int)piVar8 + 1) < pbVar5[1], *(byte *)((int)piVar8 + 1) == pbVar5[1])) && (bVar9 = *(byte *)((int)piVar8 + 2) < pbVar5[2], *(byte *)((int)piVar8 + 2) == pbVar5[2] )) && (bVar9 = *(byte *)((int)piVar8 + 3) < pbVar5[3], *(byte *)((int)piVar8 + 3) == pbVar5[3])) { uVar7 = 0; } else { uVar7 = -(uint)bVar9 | 1; } goto LAB_00aa853a; } piVar8 = piVar8 + 1; pbVar5 = pbVar5 + 4; bVar9 = 3 < uVar7; uVar7 = uVar7 - 4; } while (bVar9); uVar7 = 0; LAB_00aa853a: if (uVar7 == 0) { piVar1[1] = 1; param_2[4] = param_2[4] + 1; } else { piVar1[1] = 0; param_2[3] = param_2[3] + 1; } LAB_00aa8588: param_2[2] = param_2[2] + 1; } return 1; } //@@ 00aa8a00 FUN_00aa8a00 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00aa8a00(void) { int *piVar1; int iVar2; uint uVar3; undefined1 local_4c; undefined1 local_4b; byte local_38 [36]; undefined4 local_14; local_14 = __security_cookie ^ (uint)(local_38 + 0x28); if (DAT_00c75a8c != 0) { uVar3 = 0; do { iVar2 = 0; piVar1 = &DAT_00c73d84; do { if (((piVar1[-0x34] != 0) && (*piVar1 == 0)) && (piVar1[1] == uVar3)) { LAB_00aa8ac1: if (iVar2 < 0x10) goto LAB_00aa8b98; break; } if (((piVar1[7] != 0) && (piVar1[0x3b] == 0)) && (piVar1[0x3c] == uVar3)) { iVar2 = iVar2 + 1; goto LAB_00aa8ac1; } if (((piVar1[0x42] != 0) && (piVar1[0x76] == 0)) && (piVar1[0x77] == uVar3)) { iVar2 = iVar2 + 2; goto LAB_00aa8ac1; } if (((piVar1[0x7d] != 0) && (piVar1[0xb1] == 0)) && (piVar1[0xb2] == uVar3)) { iVar2 = iVar2 + 3; goto LAB_00aa8ac1; } piVar1 = piVar1 + 0xec; iVar2 = iVar2 + 4; } while ((int)piVar1 < 0xc74b59); iVar2 = (*DAT_00c75a90)(uVar3,0,&local_4c); if (iVar2 == 0) { sprintf(local_38,(byte *)"78696e707574%02x000000000000000000"); switch(local_4b) { case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; case 6: break; default: break; case 8: } iVar2 = FUN_00a26240(6,10,1); if (iVar2 != 0) { *(uint *)(iVar2 + 0xd8) = uVar3; *(undefined4 *)(iVar2 + 4) = 1; if (DAT_00c74ca8 != (code *)0x0) { (*DAT_00c74ca8)((iVar2 + -0xc73cb0) / 0xec,0x40001); } } } LAB_00aa8b98: uVar3 = uVar3 + 1; } while (uVar3 < 4); } if ((DAT_00c75a88 != (int *)0x0) && (iVar2 = (**(code **)(*DAT_00c75a88 + 0x10))(DAT_00c75a88,4,&LAB_00aa85b0,0,0), iVar2 < 0)) { _glfwInputError(0x10008,"Failed to enumerate DirectInput8 devices"); } return; } //@@ 00aa8d90 _glfwPollJoystickWin32 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: GLFW 3.4 win32_joystick.c: slot 18 (pollJoystick) of the _GLFWplatform table built by _glfwConnectWin32 00a81050 _glfwConnectWin32 inlined _glfwInputJoystickAxis/Button/Hat asserts "axis < js->axisCount", "button >= 0", "value == GLFW_PRESS || value == GLFW_RELEASE" (input.c) */ undefined4 _glfwPollJoystickWin32(int param_1,int param_2) { int *piVar1; int iVar2; byte bVar3; int iVar4; byte bVar5; code *pcVar6; uint uVar7; int unaff_ESI; undefined1 uVar8; int iStack_a8; int iStack_a4; uint local_9c; undefined4 local_98; undefined4 local_94; ushort local_90 [6]; undefined1 auStack_84 [4]; undefined1 local_80 [64]; ushort auStack_40 [26]; uint local_c; local_c = __security_cookie ^ (uint)&iStack_a8; piVar1 = *(int **)(param_1 + 0xd4); if (piVar1 == (int *)0x0) { auStack_40[8] = 0x1000; auStack_40[9] = 0x2000; auStack_40[10] = 0x4000; auStack_40[0xb] = 0x8000; auStack_40[0xc] = 0x100; auStack_40[0xd] = 0x200; auStack_40[0xe] = 0x20; auStack_40[0xf] = 0x10; auStack_40[0x10] = 0x40; auStack_40[0x11] = 0x80; iVar4 = (*DAT_00c75a94)(*(undefined4 *)(param_1 + 0xd8)); if (iVar4 == 0) { if (param_2 == 0) { return 1; } iVar4 = (int)(short)local_98; if (*(int *)(param_1 + 0xc) < 1) { _wassert(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } **(float **)(param_1 + 8) = ((float)iVar4 + 0.5) / 32767.5; if (*(int *)(param_1 + 0xc) < 2) { _wassert(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } *(float *)(*(int *)(param_1 + 8) + 4) = -((float)(int)local_98._2_2_ + 0.5) / 32767.5; iVar4 = (int)(short)local_94; if (*(int *)(param_1 + 0xc) < 3) { _wassert(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } *(float *)(*(int *)(param_1 + 8) + 8) = ((float)iVar4 + 0.5) / 32767.5; if (*(int *)(param_1 + 0xc) < 4) { _wassert(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } *(float *)(*(int *)(param_1 + 8) + 0xc) = -((float)(int)local_94._2_2_ + 0.5) / 32767.5; uVar7 = local_9c >> 0x10; if (*(int *)(param_1 + 0xc) < 5) { _wassert(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } *(float *)(*(int *)(param_1 + 8) + 0x10) = (float)(uVar7 & 0xff) / 127.5 - 1.0; uVar7 = local_9c >> 0x18; if (*(int *)(param_1 + 0xc) < 6) { _wassert(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } iVar4 = 0; *(float *)(*(int *)(param_1 + 8) + 0x14) = (float)uVar7 / 127.5 - 1.0; do { uVar8 = (auStack_40[iVar4] & (ushort)local_9c) != 0; if (*(int *)(param_1 + 0x14) <= iVar4) { _wassert(L"button < js->buttonCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1bf); } *(undefined1 *)(iVar4 + *(int *)(param_1 + 0x10)) = uVar8; iVar4 = iVar4 + 1; } while (iVar4 < 10); bVar5 = (byte)local_9c & 1; bVar3 = bVar5 | 2; if ((local_9c & 8) == 0) { bVar3 = bVar5; } bVar5 = bVar3 | 4; if ((local_9c & 2) == 0) { bVar5 = bVar3; } bVar3 = bVar5 | 8; if ((local_9c & 4) == 0) { bVar3 = bVar5; } bVar5 = bVar3 & 0xf5; if ((bVar3 & 10) != 10) { bVar5 = bVar3; } bVar3 = bVar5 & 0xfa; if ((bVar5 & 5) != 5) { bVar3 = bVar5; } FUN_00a26130(bVar3); return 1; } if (iVar4 != 0x48f) { return 0; } } else { local_9c = 0; local_98 = 0; local_94 = 0; memset(local_80,0,0x50); (**(code **)(*piVar1 + 100))(); iVar4 = (**(code **)(**(int **)(param_1 + 0xd4) + 0x24)) (*(int **)(param_1 + 0xd4),0x50,auStack_84); if ((iVar4 == -0x7ff8fff4) || (iVar4 == -0x7ff8ffe2)) { (**(code **)(**(int **)(param_1 + 0xd4) + 0x1c))(*(int **)(param_1 + 0xd4)); (**(code **)(**(int **)(param_1 + 0xd4) + 100))(*(int **)(param_1 + 0xd4)); iVar4 = (**(code **)(**(int **)(param_1 + 0xd4) + 0x24)) (*(int **)(param_1 + 0xd4),0x50,&local_98); } if (-1 < iVar4) { if ((param_2 != 0) && (iVar4 = 0, 0 < *(int *)(param_1 + 0xd0))) { pcVar6 = _wassert_exref; do { iVar2 = *(int *)(*(int *)(param_1 + 0xcc) + iVar4 * 8); switch(*(undefined4 *)(*(int *)(param_1 + 0xcc) + 4 + iVar4 * 8)) { case 0: case 1: iVar2 = *(int *)((int)local_90 + iVar2); if (unaff_ESI < 0) { (*pcVar6)(L"axis >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b3); pcVar6 = _wassert_exref; } if (*(int *)(param_1 + 0xc) <= unaff_ESI) { (*pcVar6)(L"axis < js->axisCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1b4); } *(float *)(*(int *)(param_1 + 8) + unaff_ESI * 4) = ((float)iVar2 + 0.5) / 32767.5; unaff_ESI = unaff_ESI + 1; break; case 2: bVar3 = *(byte *)((int)local_90 + iVar2) >> 7; if (iStack_a8 < 0) { (*pcVar6)(L"button >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1be); pcVar6 = _wassert_exref; } if (*(int *)(param_1 + 0x14) <= iStack_a8) { (*pcVar6)(L"button < js->buttonCount", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1bf); } if ((bVar3 != 1) && (bVar3 != 0)) { _wassert(L"value == GLFW_PRESS || value == GLFW_RELEASE", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" ,0x1c0); } *(byte *)(iStack_a8 + *(int *)(param_1 + 0x10)) = bVar3; iStack_a8 = iStack_a8 + 1; break; case 3: auStack_40[0] = 1; auStack_40[1] = 0; auStack_40[2] = 3; auStack_40[3] = 0; auStack_40[4] = 2; auStack_40[5] = 0; auStack_40[6] = 6; auStack_40[7] = 0; auStack_40[8] = 4; auStack_40[9] = 0; auStack_40[10] = 0xc; auStack_40[0xb] = 0; auStack_40[0xc] = 8; auStack_40[0xd] = 0; auStack_40[0xe] = 9; auStack_40[0xf] = 0; auStack_40[0x10] = 0; auStack_40[0x11] = 0; uVar7 = *(ushort *)((int)local_90 + iVar2) / 0x1194; if (8 < uVar7) { uVar7 = 8; } FUN_00a26130((char)auStack_40[uVar7 * 2]); iStack_a4 = iStack_a4 + 1; break; default: goto switchD_00aa8e86_default; } pcVar6 = _wassert_exref; switchD_00aa8e86_default: iVar4 = iVar4 + 1; } while (iVar4 < *(int *)(param_1 + 0xd0)); } return 1; } } FUN_00aa8270(); return 0; } //@@ 00aa9360 FUN_00aa9360 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00aa9360(byte *param_1) { byte bVar1; byte *pbVar2; uint uVar3; byte *pbVar4; bool bVar5; char local_2c [36]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_2c + 0x28); pbVar2 = &DAT_00ba8de4; pbVar4 = param_1 + 0x14; do { bVar1 = *pbVar4; bVar5 = bVar1 < *pbVar2; if (bVar1 != *pbVar2) { LAB_00aa93a0: uVar3 = -(uint)bVar5 | 1; goto LAB_00aa93a5; } if (bVar1 == 0) break; bVar1 = pbVar4[1]; bVar5 = bVar1 < pbVar2[1]; if (bVar1 != pbVar2[1]) goto LAB_00aa93a0; pbVar4 = pbVar4 + 2; pbVar2 = pbVar2 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00aa93a5: if (uVar3 == 0) { strncpy(local_2c,(char *)param_1,0x20); sprintf(param_1,(byte *)"03000000%.4s0000%.4s000000000000"); } return; } //@@ 00aa93e0 FUN_00aa93e0 uint * FUN_00aa93e0(uint *param_1) { byte bVar1; uint *in_ECX; uint uVar2; uint uVar3; uint uVar4; longlong lVar5; int local_8; local_8 = 0x100; uVar4 = ((int)param_1 << 0xf ^ (uint)param_1) << 8 ^ (uint)param_1 >> 9 ^ (uint)param_1; uVar2 = (uint)param_1; param_1 = in_ECX; do { param_1 = param_1 + 1; lVar5 = __allmul(uVar4,uVar2,0x4c957f2d,0x5851f42d); uVar3 = (uint)((ulonglong)(lVar5 + 0x7f) >> 0x20); bVar1 = (byte)(uVar2 >> 0x18); uVar4 = (uVar4 >> 0x1b | uVar2 << 5) ^ uVar2 >> 0xd; *param_1 = uVar4 << (-(bVar1 >> 3) & 0x1f) | uVar4 >> (bVar1 >> 3); local_8 = local_8 + -1; uVar4 = (uint)(lVar5 + 0x7f); uVar2 = uVar3; } while (local_8 != 0); isaac_randinit(uVar3); *in_ECX = 0; return in_ECX; } //@@ 00aa94a0 FUN_00aa94a0 void FUN_00aa94a0(void) { uint uVar1; uint uVar2; int in_ECX; uint uVar3; uint uVar4; uint *puVar5; *(int *)(in_ECX + 0x80c) = *(int *)(in_ECX + 0x80c) + 1; *(int *)(in_ECX + 0x808) = *(int *)(in_ECX + 0x808) + *(int *)(in_ECX + 0x80c); uVar4 = 0; puVar5 = (uint *)(in_ECX + 0x404); do { uVar2 = *puVar5; switch(uVar4 & 3) { case 0: uVar1 = *(uint *)(in_ECX + 0x804); uVar3 = uVar1 << 0xd; break; case 1: uVar1 = *(uint *)(in_ECX + 0x804); uVar3 = uVar1 >> 6; break; case 2: uVar1 = *(uint *)(in_ECX + 0x804); uVar3 = uVar1 * 4; break; case 3: uVar1 = *(uint *)(in_ECX + 0x804); uVar3 = uVar1 >> 0x10; } *(uint *)(in_ECX + 0x804) = uVar3 ^ uVar1; uVar3 = uVar4 - 0x80; uVar4 = uVar4 + 1; *(int *)(in_ECX + 0x804) = *(int *)(in_ECX + 0x804) + *(int *)(in_ECX + 0x404 + (uVar3 & 0xff) * 4); uVar3 = *(int *)(in_ECX + 0x404 + (uVar2 >> 2 & 0xff) * 4) + *(int *)(in_ECX + 0x804) + *(int *)(in_ECX + 0x808); *puVar5 = uVar3; uVar2 = *(int *)(in_ECX + 0x404 + (uVar3 >> 10 & 0xff) * 4) + uVar2; *(uint *)(in_ECX + 0x808) = uVar2; puVar5[-0x100] = uVar2; puVar5 = puVar5 + 1; } while (uVar4 < 0x100); return; } //@@ 00aa9580 isaac_randinit /* DB: Bob Jenkins ISAAC randinit: golden-ratio pre-mixed constants (0x1367df5a, 0xd92a4a78, 0xc4efea1b ...), mix shifts <<11 >>2 <<8 >>16 <<10 >>4 <<8 >>9 over randrsl, clears aa/bb/cc (+0x804..+0x80c), then isaac() FUN_00aa94a0; from FUN_00aa93e0 */ void isaac_randinit(void) { int *piVar1; int in_ECX; uint uVar2; undefined4 *extraout_ECX; int iVar3; uint uVar4; uint uVar5; int iVar6; uint uVar7; uint uVar8; uint uVar9; int local_20; int *local_18; uint local_14; uint local_10; int local_c; uint local_8; local_c = 0x1367df5a; *(undefined4 *)(in_ECX + 0x80c) = 0; iVar3 = -0x6a26ffa7; *(undefined4 *)(in_ECX + 0x808) = 0; iVar6 = -0x3ce9c1b5; *(undefined4 *)(in_ECX + 0x804) = 0; uVar9 = 0xf421ad8; uVar5 = 0xd92a4a78; local_14 = 0xa51a3c49; local_8 = 0xc4efea1b; local_10 = 0x30609119; local_18 = (int *)0x20; piVar1 = (int *)(in_ECX + 8); do { uVar7 = iVar6 + piVar1[1]; uVar2 = local_c + piVar1[-1] ^ (iVar3 + *piVar1) * 0x800; iVar6 = uVar9 + piVar1[2] + uVar2; uVar4 = iVar3 + *piVar1 + uVar7 ^ uVar7 >> 2; uVar5 = uVar5 + piVar1[3] + uVar4; uVar8 = uVar7 + iVar6 ^ iVar6 * 0x100; iVar3 = local_14 + piVar1[4] + uVar8; uVar9 = iVar6 + uVar5 ^ uVar5 >> 0x10; uVar7 = local_8 + piVar1[5] + uVar9; uVar5 = uVar5 + iVar3 ^ iVar3 * 0x400; iVar6 = local_10 + piVar1[6] + uVar5; local_14 = iVar3 + uVar7 ^ uVar7 >> 4; uVar2 = uVar2 + local_14; local_8 = uVar7 + iVar6 ^ iVar6 * 0x100; iVar3 = uVar4 + local_8; local_10 = iVar6 + uVar2 ^ uVar2 >> 9; piVar1[0x100] = iVar3; iVar6 = uVar8 + local_10; local_c = uVar2 + iVar3; local_18 = (int *)((int)local_18 + -1); piVar1[0x102] = uVar9; piVar1[0x105] = local_8; piVar1[0xff] = local_c; piVar1[0x106] = local_10; piVar1[0x101] = iVar6; piVar1[0x103] = uVar5; piVar1[0x104] = local_14; piVar1 = piVar1 + 8; } while (local_18 != (int *)0x0); local_18 = (int *)(in_ECX + 0x408); local_20 = 0x20; do { uVar4 = iVar6 + local_18[1]; uVar2 = local_18[-1] + local_c ^ (iVar3 + *local_18) * 0x800; iVar6 = uVar9 + local_18[2] + uVar2; uVar7 = iVar3 + *local_18 + uVar4 ^ uVar4 >> 2; uVar5 = uVar5 + local_18[3] + uVar7; uVar4 = uVar4 + iVar6 ^ iVar6 * 0x100; iVar3 = local_14 + local_18[4] + uVar4; uVar9 = iVar6 + uVar5 ^ uVar5 >> 0x10; local_8 = local_8 + local_18[5] + uVar9; uVar5 = uVar5 + iVar3 ^ iVar3 * 0x400; iVar6 = local_10 + local_18[6] + uVar5; local_14 = iVar3 + local_8 ^ local_8 >> 4; uVar2 = uVar2 + local_14; local_8 = local_8 + iVar6 ^ iVar6 * 0x100; iVar3 = uVar7 + local_8; local_c = uVar2 + iVar3; local_10 = iVar6 + uVar2 ^ uVar2 >> 9; iVar6 = uVar4 + local_10; local_18[4] = local_14; local_18[-1] = local_c; *local_18 = iVar3; local_18[1] = iVar6; local_18[2] = uVar9; local_18[3] = uVar5; local_18[5] = local_8; local_18[6] = local_10; local_18 = local_18 + 8; local_20 = local_20 + -1; } while (local_20 != 0); FUN_00aa94a0(); *extraout_ECX = 0; return; } //@@ 00aa97f0 FUN_00aa97f0 void FUN_00aa97f0(int param_1) { FUN_00ab6bc0(*(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x28), *(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0x24), *(undefined4 *)(param_1 + 0x10),*(int *)(param_1 + 0x1c) * 3,&DAT_00b5e4e0, *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18)); return; } //@@ 00aa9830 FUN_00aa9830 void FUN_00aa9830(int param_1) { FUN_00ab6d00(*(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x28), *(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0x24), *(undefined4 *)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e4e0, *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18)); *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 3; FUN_00ab6e40(); return; } //@@ 00aa9880 FUN_00aa9880 void FUN_00aa9880(int param_1) { FUN_00ab6d00(*(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x28), *(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0x24), *(undefined4 *)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e4e0, *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18)); return; } //@@ 00aa98c0 FUN_00aa98c0 void FUN_00aa98c0(int param_1) { I420ToRGBAMatrix(*(byte **)(param_1 + 4),*(int *)(param_1 + 0x20),*(byte **)(param_1 + 0xc), *(int *)(param_1 + 0x28),*(byte **)(param_1 + 8),*(int *)(param_1 + 0x24), *(byte **)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e4e0, *(int *)(param_1 + 0x14),*(int *)(param_1 + 0x18)); FUN_00ab6e40(); return; } //@@ 00aa9910 FUN_00aa9910 void FUN_00aa9910(int param_1) { I420ToRGBAMatrix(*(byte **)(param_1 + 4),*(int *)(param_1 + 0x20),*(byte **)(param_1 + 0xc), *(int *)(param_1 + 0x28),*(byte **)(param_1 + 8),*(int *)(param_1 + 0x24), *(byte **)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e4e0, *(int *)(param_1 + 0x14),*(int *)(param_1 + 0x18)); return; } //@@ 00aa9950 FUN_00aa9950 void FUN_00aa9950(int param_1) { FUN_00ab6bc0(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0x24), *(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x28), *(undefined4 *)(param_1 + 0x10),*(int *)(param_1 + 0x1c) * 3,&DAT_00b5e5c0, *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18)); return; } //@@ 00aa9990 FUN_00aa9990 void FUN_00aa9990(int param_1) { FUN_00ab6d00(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0x24), *(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x28), *(undefined4 *)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e5c0, *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18)); *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 3; FUN_00ab6e40(); return; } //@@ 00aa99e0 FUN_00aa99e0 void FUN_00aa99e0(int param_1) { FUN_00ab6d00(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0x24), *(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x28), *(undefined4 *)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e5c0, *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18)); return; } //@@ 00aa9a20 FUN_00aa9a20 void FUN_00aa9a20(int param_1) { I420ToRGBAMatrix(*(byte **)(param_1 + 4),*(int *)(param_1 + 0x20),*(byte **)(param_1 + 8), *(int *)(param_1 + 0x24),*(byte **)(param_1 + 0xc),*(int *)(param_1 + 0x28), *(byte **)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e5c0, *(int *)(param_1 + 0x14),*(int *)(param_1 + 0x18)); FUN_00ab6e40(); return; } //@@ 00aa9a70 FUN_00aa9a70 void FUN_00aa9a70(int param_1) { I420ToRGBAMatrix(*(byte **)(param_1 + 4),*(int *)(param_1 + 0x20),*(byte **)(param_1 + 8), *(int *)(param_1 + 0x24),*(byte **)(param_1 + 0xc),*(int *)(param_1 + 0x28), *(byte **)(param_1 + 0x10),*(int *)(param_1 + 0x1c) << 2,&DAT_00b5e5c0, *(int *)(param_1 + 0x14),*(int *)(param_1 + 0x18)); return; } //@@ 00aa9ab0 FUN_00aa9ab0 void FUN_00aa9ab0(int param_1) { uint uVar1; int iVar2; int iVar3; byte bVar4; byte bVar5; int *in_ECX; byte *in_EDX; uint uVar6; do { if (param_1 == 0) { return; } iVar2 = in_ECX[4]; param_1 = param_1 + -1; iVar3 = in_ECX[1]; uVar1 = iVar3 + 8; if (*in_ECX < iVar2 + -4) { LAB_00aa9b09: bVar4 = (byte)iVar3; bVar5 = *(byte *)in_ECX[3] >> (bVar4 & 0x1f); if ((((8 < (int)uVar1) && (bVar5 = bVar5 | ((byte *)in_ECX[3])[1] << (8 - bVar4 & 0x1f), 0x10 < (int)uVar1)) && (bVar5 = bVar5 | *(char *)(in_ECX[3] + 2) << (0x10 - bVar4 & 0x1f), 0x18 < (int)uVar1)) && (bVar5 = bVar5 | *(char *)(in_ECX[3] + 3) << (0x18 - bVar4 & 0x1f), 0x20 < (int)uVar1)) { bVar5 = bVar5 | *(char *)(in_ECX[3] + 4) << (0x20 - bVar4 & 0x1f); } uVar6 = uVar1; if ((int)uVar1 < 0) { uVar6 = iVar3 + 0xf; } in_ECX[3] = in_ECX[3] + ((int)uVar6 >> 3); *in_ECX = *in_ECX + ((int)uVar6 >> 3); in_ECX[1] = uVar1 & 7; } else if (iVar2 - (iVar3 + 0xf >> 3) < *in_ECX) { in_ECX[3] = 0; bVar5 = 0xff; *in_ECX = iVar2; in_ECX[1] = 1; } else { if (uVar1 != 0) goto LAB_00aa9b09; bVar5 = 0; } *in_EDX = bVar5; in_EDX = in_EDX + 1; } while( true ); } //@@ 00aa9bb0 FUN_00aa9bb0 void FUN_00aa9bb0(void) { void *_Memory; void *pvVar1; void *_Memory_00; int *in_ECX; int iVar2; if (in_ECX != (int *)0x0) { _Memory_00 = (void *)*in_ECX; if (_Memory_00 != (void *)0x0) { iVar2 = 0; if (0 < in_ECX[2]) { pvVar1 = _Memory_00; do { _Memory = *(void **)((int)pvVar1 + iVar2 * 4); if (_Memory != (void *)0x0) { free(_Memory); pvVar1 = (void *)*in_ECX; _Memory_00 = pvVar1; } iVar2 = iVar2 + 1; } while (iVar2 < in_ECX[2]); } free(_Memory_00); } if ((void *)in_ECX[1] != (void *)0x0) { free((void *)in_ECX[1]); } if ((void *)in_ECX[3] != (void *)0x0) { free((void *)in_ECX[3]); } *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; } return; } //@@ 00aa9c20 vorbis_info_clear /* DB: libvorbis: ECX=vorbis_info, codec_setup at +0x1c: frees mode params, then per maps/floors/residues calls the backend free_info vtables (PTR_00b4f9b4/00b4f938), books, psy; caller vorbis_synthesis_headerin (error path) prototype: db/protos.zhl */ void __fastcall vorbis_info_clear(void *info) { void *pvVar1; void *_Memory; undefined4 *_Memory_00; int iVar2; int *piVar3; int local_10; undefined4 *local_c; undefined4 *local_8; _Memory = *(void **)((int)info + 0x1c); if (_Memory != (void *)0x0) { iVar2 = 0; if (0 < *(int *)((int)_Memory + 8)) { local_c = (undefined4 *)((int)_Memory + 0x20); do { if ((void *)*local_c != (void *)0x0) { free((void *)*local_c); } iVar2 = iVar2 + 1; local_c = local_c + 1; } while (iVar2 < *(int *)((int)_Memory + 8)); } local_c = (undefined4 *)0x0; if (0 < *(int *)((int)_Memory + 0xc)) { piVar3 = (int *)((int)_Memory + 0x120); do { if (piVar3[0x40] != 0) { (**(code **)((&PTR_PTR_00b4f9b4)[*piVar3] + 8))(piVar3[0x40]); } local_c = (undefined4 *)((int)local_c + 1); piVar3 = piVar3 + 1; } while ((int)local_c < *(int *)((int)_Memory + 0xc)); } local_c = (undefined4 *)0x0; if (0 < *(int *)((int)_Memory + 0x10)) { piVar3 = (int *)((int)_Memory + 800); do { if (piVar3[0x40] != 0) { (**(code **)((&PTR_DAT_00b4f938)[*piVar3] + 0xc))(piVar3[0x40]); } local_c = (undefined4 *)((int)local_c + 1); piVar3 = piVar3 + 1; } while ((int)local_c < *(int *)((int)_Memory + 0x10)); } local_c = (undefined4 *)0x0; if (0 < *(int *)((int)_Memory + 0x14)) { piVar3 = (int *)((int)_Memory + 0x520); do { if (piVar3[0x40] != 0) { (**(code **)((&PTR_DAT_00b4f7b4)[*piVar3] + 0xc))(piVar3[0x40]); } local_c = (undefined4 *)((int)local_c + 1); piVar3 = piVar3 + 1; } while ((int)local_c < *(int *)((int)_Memory + 0x14)); } local_10 = 0; if (0 < *(int *)((int)_Memory + 0x18)) { local_8 = (undefined4 *)((int)_Memory + 0x720); local_c = (undefined4 *)0x0; do { _Memory_00 = (undefined4 *)*local_8; if ((_Memory_00 != (undefined4 *)0x0) && (_Memory_00[9] != 0)) { if ((void *)_Memory_00[8] != (void *)0x0) { free((void *)_Memory_00[8]); } if ((void *)_Memory_00[2] != (void *)0x0) { free((void *)_Memory_00[2]); } *_Memory_00 = 0; _Memory_00[1] = 0; _Memory_00[2] = 0; _Memory_00[3] = 0; _Memory_00[4] = 0; _Memory_00[5] = 0; _Memory_00[6] = 0; _Memory_00[7] = 0; *(undefined8 *)(_Memory_00 + 8) = 0; free(_Memory_00); } if (*(int *)((int)_Memory + 0xb20) != 0) { pvVar1 = (void *)((int)local_c + *(int *)((int)_Memory + 0xb20)); if (*(void **)((int)pvVar1 + 0x10) != (void *)0x0) { free(*(void **)((int)pvVar1 + 0x10)); } if (*(void **)((int)pvVar1 + 0x14) != (void *)0x0) { free(*(void **)((int)pvVar1 + 0x14)); } if (*(void **)((int)pvVar1 + 0x18) != (void *)0x0) { free(*(void **)((int)pvVar1 + 0x18)); } if (*(void **)((int)pvVar1 + 0x1c) != (void *)0x0) { free(*(void **)((int)pvVar1 + 0x1c)); } if (*(void **)((int)pvVar1 + 0x20) != (void *)0x0) { free(*(void **)((int)pvVar1 + 0x20)); } memset(pvVar1,0,0x38); } local_8 = local_8 + 1; local_10 = local_10 + 1; local_c = (undefined4 *)((int)local_c + 0x38); } while (local_10 < *(int *)((int)_Memory + 0x18)); } if (*(void **)((int)_Memory + 0xb20) != (void *)0x0) { free(*(void **)((int)_Memory + 0xb20)); } local_10 = 0; if (0 < *(int *)((int)_Memory + 0x1c)) { local_c = (undefined4 *)((int)_Memory + 0xb24); do { pvVar1 = (void *)*local_c; if (pvVar1 != (void *)0x0) { memset(pvVar1,0,0x208); free(pvVar1); } local_10 = local_10 + 1; local_c = local_c + 1; } while (local_10 < *(int *)((int)_Memory + 0x1c)); } free(_Memory); } *(undefined4 *)info = 0; *(undefined4 *)((int)info + 4) = 0; *(undefined4 *)((int)info + 8) = 0; *(undefined4 *)((int)info + 0xc) = 0; *(undefined4 *)((int)info + 0x10) = 0; *(undefined4 *)((int)info + 0x14) = 0; *(undefined4 *)((int)info + 0x18) = 0; *(undefined4 *)((int)info + 0x1c) = 0; return; } //@@ 00aa9e80 _vorbis_unpack_books /* DB: libvorbis info.c: ci=vi->codec_setup (+0x1c, returns OV_EBADHEADER -129 if null), ci->books (+0x18)=oggpack_read(8)+1, calloc/unpack each static codebook into book_param (+0x720), then times/floors/residues/maps/modes; only caller vorbis_synthesis_headerin */ undefined4 _vorbis_unpack_books(void) { int iVar1; int iVar2; int iVar3; void *pvVar4; undefined4 uVar5; int iVar6; void *in_ECX; int *piVar7; int *local_c; iVar6 = *(int *)((int)in_ECX + 0x1c); if (iVar6 == 0) { return 0xffffff7f; } iVar1 = FUN_00ab7120(); *(int *)(iVar6 + 0x18) = iVar1 + 1; if (0 < iVar1 + 1) { local_c = (int *)(iVar6 + 0x720); iVar1 = 0; do { iVar2 = vorbis_staticbook_unpack(); *local_c = iVar2; if (iVar2 == 0) goto LAB_00aaa136; iVar1 = iVar1 + 1; local_c = local_c + 1; } while (iVar1 < *(int *)(iVar6 + 0x18)); iVar1 = FUN_00ab7120(); if (0 < iVar1 + 1) { iVar2 = 0; do { iVar3 = FUN_00ab7120(); if (iVar3 != 0) goto LAB_00aaa136; iVar2 = iVar2 + 1; } while (iVar2 < iVar1 + 1); iVar1 = FUN_00ab7120(); *(int *)(iVar6 + 0x10) = iVar1 + 1; if (0 < iVar1 + 1) { local_c = (int *)0x0; piVar7 = (int *)(iVar6 + 0x420); do { iVar1 = FUN_00ab7120(); piVar7[-0x40] = iVar1; if ((iVar1 < 0) || (1 < iVar1)) goto LAB_00aaa136; iVar1 = (**(code **)((&PTR_DAT_00b4f938)[iVar1] + 4))(in_ECX); *piVar7 = iVar1; if (iVar1 == 0) goto LAB_00aaa136; piVar7 = piVar7 + 1; local_c = (int *)((int)local_c + 1); } while ((int)local_c < *(int *)(iVar6 + 0x10)); iVar1 = FUN_00ab7120(); *(int *)(iVar6 + 0x14) = iVar1 + 1; if (0 < iVar1 + 1) { local_c = (int *)0x0; piVar7 = (int *)(iVar6 + 0x620); do { iVar1 = FUN_00ab7120(); piVar7[-0x40] = iVar1; if ((iVar1 < 0) || (2 < iVar1)) goto LAB_00aaa136; iVar1 = (**(code **)((&PTR_DAT_00b4f7b4)[iVar1] + 4))(in_ECX); *piVar7 = iVar1; if (iVar1 == 0) goto LAB_00aaa136; piVar7 = piVar7 + 1; local_c = (int *)((int)local_c + 1); } while ((int)local_c < *(int *)(iVar6 + 0x14)); iVar1 = FUN_00ab7120(); *(int *)(iVar6 + 0xc) = iVar1 + 1; if (0 < iVar1 + 1) { local_c = (int *)0x0; piVar7 = (int *)(iVar6 + 0x220); do { iVar1 = FUN_00ab7120(); piVar7[-0x40] = iVar1; if ((iVar1 < 0) || (0 < iVar1)) goto LAB_00aaa136; iVar1 = (**(code **)((&PTR_PTR_00b4f9b4)[iVar1] + 4))(in_ECX); *piVar7 = iVar1; if (iVar1 == 0) goto LAB_00aaa136; piVar7 = piVar7 + 1; local_c = (int *)((int)local_c + 1); } while ((int)local_c < *(int *)(iVar6 + 0xc)); iVar1 = FUN_00ab7120(); *(int *)(iVar6 + 8) = iVar1 + 1; if (0 < iVar1 + 1) { local_c = (int *)0x0; piVar7 = (int *)(iVar6 + 0x20); do { pvVar4 = calloc(1,0x10); *piVar7 = (int)pvVar4; uVar5 = FUN_00ab7120(); *(undefined4 *)*piVar7 = uVar5; uVar5 = FUN_00ab7120(); *(undefined4 *)(*piVar7 + 4) = uVar5; uVar5 = FUN_00ab7120(); *(undefined4 *)(*piVar7 + 8) = uVar5; uVar5 = FUN_00ab7120(); *(undefined4 *)(*piVar7 + 0xc) = uVar5; iVar1 = *piVar7; if ((((0 < *(int *)(iVar1 + 4)) || (0 < *(int *)(iVar1 + 8))) || (*(int *)(iVar6 + 0xc) <= *(int *)(iVar1 + 0xc))) || (*(int *)(iVar1 + 0xc) < 0) ) goto LAB_00aaa136; piVar7 = piVar7 + 1; local_c = (int *)((int)local_c + 1); } while ((int)local_c < *(int *)(iVar6 + 8)); iVar6 = FUN_00ab7120(); if (iVar6 == 1) { return 0; } } } } } } } LAB_00aaa136: vorbis_info_clear(in_ECX); return 0xffffff7b; } //@@ 00aaa150 vorbis_synthesis_headerin /* WARNING: Removing unreachable block (ram,0x00aaa1b5) */ /* WARNING: Removing unreachable block (ram,0x00aaa1c1) */ /* WARNING: Removing unreachable block (ram,0x00aaa33a) */ /* WARNING: Removing unreachable block (ram,0x00aaa343) */ /* WARNING: Removing unreachable block (ram,0x00aaa349) */ /* WARNING: Removing unreachable block (ram,0x00aaa350) */ /* WARNING: Removing unreachable block (ram,0x00aaa35c) */ /* WARNING: Removing unreachable block (ram,0x00aaa36f) */ /* WARNING: Removing unreachable block (ram,0x00aaa37b) */ /* WARNING: Removing unreachable block (ram,0x00aaa402) */ /* WARNING: Removing unreachable block (ram,0x00aaa408) */ /* WARNING: Removing unreachable block (ram,0x00aaa40f) */ /* WARNING: Removing unreachable block (ram,0x00aaa413) */ /* WARNING: Removing unreachable block (ram,0x00aaa41b) */ /* WARNING: Removing unreachable block (ram,0x00aaa431) */ /* WARNING: Removing unreachable block (ram,0x00aaa1ca) */ /* WARNING: Removing unreachable block (ram,0x00aaa1fb) */ /* WARNING: Removing unreachable block (ram,0x00aaa205) */ /* WARNING: Removing unreachable block (ram,0x00aaa21c) */ /* WARNING: Removing unreachable block (ram,0x00aaa22a) */ /* WARNING: Removing unreachable block (ram,0x00aaa260) */ /* WARNING: Removing unreachable block (ram,0x00aaa282) */ /* WARNING: Removing unreachable block (ram,0x00aaa2a5) */ /* WARNING: Removing unreachable block (ram,0x00aaa2b0) */ /* WARNING: Removing unreachable block (ram,0x00aaa2c3) */ /* WARNING: Removing unreachable block (ram,0x00aaa2de) */ /* WARNING: Removing unreachable block (ram,0x00aaa30c) */ /* WARNING: Removing unreachable block (ram,0x00aaa31e) */ /* WARNING: Removing unreachable block (ram,0x00aaa327) */ /* WARNING: Removing unreachable block (ram,0x00aaa1cf) */ /* WARNING: Removing unreachable block (ram,0x00aaa1d8) */ /* WARNING: Removing unreachable block (ram,0x00aaa1e1) */ /* WARNING: Removing unreachable block (ram,0x00aaa1ea) */ /* DB: libvorbis info.c: oggpack_readinit, packtype read 8 bits, _v_readstring 6 == "vorbis" else OV_ENOTVORBIS(-132), packtype 1/3/5 -> _vorbis_unpack_info/comment/books, returns OV_EBADHEADER(-133) for null op; VideoClip_Theora::readTheoraVorbisHeaders ("Invalid stream!") */ undefined4 vorbis_synthesis_headerin(int param_1) { if (param_1 == 0) { return 0xffffff7b; } FUN_00ab7120(); FUN_00aa9ab0(6); return 0xffffff7c; } //@@ 00aaa450 FUN_00aaa450 int FUN_00aaa450(void) { void *this; undefined4 *in_ECX; int iVar1; void *local_10; undefined1 local_c; local_10 = (void *)0x0; local_c = 0; this = (void *)in_ECX[3]; if (this != (void *)0x0) { local_10 = this; Mutex::lock(this); } iVar1 = 0; if (*(char *)(*(int *)(*(int *)*in_ECX + 8) + 8) != '\0') { iVar1 = *(int *)(*(int *)*in_ECX + 8); } Mutex::ScopeLock::~ScopeLock(&local_10); return iVar1; } //@@ 00aaa4a0 FUN_00aaa4a0 int FUN_00aaa4a0(void) { int *piVar1; void *this; undefined4 *puVar2; int iVar3; int iVar4; int *in_ECX; void *local_10; undefined1 local_c; local_10 = (void *)0x0; local_c = 0; this = (void *)in_ECX[3]; if (this != (void *)0x0) { local_10 = this; Mutex::lock(this); } puVar2 = *(undefined4 **)*in_ECX; iVar4 = 0; while (iVar3 = iVar4, puVar2 != (undefined4 *)*in_ECX) { piVar1 = puVar2 + 2; puVar2 = (undefined4 *)*puVar2; iVar4 = iVar3 + 1; if (*(char *)(*piVar1 + 8) == '\0') { iVar4 = iVar3; } } Mutex::ScopeLock::~ScopeLock(&local_10); return iVar3; } //@@ 00aaa500 FrameQueue::setSize /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: theoraplayer FrameQueue::setSize(n): locks the queue mutex, deletes existing frames (vfunc 0) and clears the list, allocates n VideoFrame (0x20, FUN_00aba8b0), logs "FrameQueue: unable to create N frames, out of memory. Created N frames."; called by VideoClip_Theora::_load with the precached count (this+0x44) */ void FrameQueue::setSize(int param_1) { byte bVar1; int iVar2; uint uVar3; undefined4 *puVar4; int *piVar5; std_string *psVar6; int *in_ECX; byte *pbVar7; void *pvVar8; void *local_150; undefined1 local_14c; void *local_148; int local_144; int local_140; int local_13c; void *local_138; undefined4 uStack_134; undefined4 uStack_130; undefined4 uStack_12c; undefined8 local_128; void *local_120 [4]; undefined4 local_110; uint local_10c; void *local_108 [4]; undefined4 local_f8; uint local_f4; void *local_f0 [4]; undefined4 local_e0; uint local_dc; void *local_d8; undefined4 uStack_d4; undefined4 uStack_d0; undefined4 uStack_cc; undefined8 local_c8; void *local_c0; undefined4 uStack_bc; undefined4 uStack_b8; undefined4 uStack_b4; undefined8 local_b0; byte local_a8 [64]; byte local_68 [68]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; puStack_20 = local_68 + 100; local_14 = 0xffffffff; puStack_18 = &LAB_00b14eff; local_1c = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_68 + 0x58); ExceptionList = &local_1c; pvVar8 = (void *)in_ECX[3]; local_13c = param_1; local_150 = (void *)0x0; local_14c = 0; local_24 = uVar3; pbVar7 = local_68 + 100; if (pvVar8 != (void *)0x0) { local_150 = pvVar8; Mutex::lock(pvVar8); pbVar7 = puStack_20; } puStack_20 = pbVar7; local_14._0_1_ = 0; local_14._1_3_ = 0; if (in_ECX[1] != 0) { piVar5 = *(int **)*in_ECX; if (piVar5 != (int *)*in_ECX) { do { if ((undefined4 *)piVar5[2] != (undefined4 *)0x0) { (*(code *)**(undefined4 **)piVar5[2])(1,uVar3); } piVar5 = (int *)*piVar5; } while (piVar5 != (int *)*in_ECX); } FUN_00aaac20(); } local_140 = 0; if (0 < local_13c) { do { iVar2 = in_ECX[2]; local_148 = operator_new(0x20); local_14._0_1_ = 1; if (local_148 == (void *)0x0) { puVar4 = (undefined4 *)0x0; } else { puVar4 = (undefined4 *)FUN_00aba8b0(iVar2); } local_14 = (uint)local_14._1_3_ << 8; if (puVar4[6] == 0) { (**(code **)*puVar4)(1); puVar4 = (undefined4 *)0x0; } if (puVar4 == (undefined4 *)0x0) { memset(local_68,0,0x40); sprintf(local_68,s__d); pbVar7 = local_68; local_f8 = 0; local_f4 = 0xf; local_108[0] = (void *)0x0; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)local_108,local_68,(int)pbVar7 - (int)(local_68 + 1)); local_14._0_1_ = 2; memset(local_a8,0,0x40); sprintf(local_a8,s__d); pbVar7 = local_a8; local_e0 = 0; local_dc = 0xf; local_f0[0] = (void *)0x0; do { bVar1 = *pbVar7; pbVar7 = pbVar7 + 1; } while (bVar1 != 0); std::string::assign((char *)local_f0,local_a8,(int)pbVar7 - (int)(local_a8 + 1)); local_14._0_1_ = 3; psVar6 = std_string_insert(local_f0,0,(byte *)"FrameQueue: unable to create ",0x1d); local_d8 = *(void **)psVar6->_buf; uStack_d4 = *(undefined4 *)(psVar6->_buf + 4); uStack_d0 = *(undefined4 *)(psVar6->_buf + 8); uStack_cc = *(undefined4 *)(psVar6->_buf + 0xc); local_c8._0_4_ = psVar6->_size; local_c8._4_4_ = psVar6->_capacity; psVar6->_size = 0; psVar6->_capacity = 0xf; psVar6->_buf[0] = '\0'; local_14._0_1_ = 4; puVar4 = std::string::append((char *)&local_d8,(byte *)" frames, out of memory. Created ", 0x20); local_138 = (void *)*puVar4; uStack_134 = puVar4[1]; uStack_130 = puVar4[2]; uStack_12c = puVar4[3]; local_128 = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 5; std::string::concat_move((char *)local_120,(int)local_148,&local_138,local_108); local_14._0_1_ = 6; puVar4 = std::string::append((char *)local_120,(byte *)" frames.",8); local_c0 = (void *)*puVar4; uStack_bc = puVar4[1]; uStack_b8 = puVar4[2]; uStack_b4 = puVar4[3]; local_b0 = *(undefined8 *)(puVar4 + 4); puVar4[4] = 0; puVar4[5] = 0xf; *(undefined1 *)puVar4 = 0; local_14._0_1_ = 7; (*(code *)PTR_FUN_00c5aa7c)(&local_c0); if (0xf < local_b0._4_4_) { uVar3 = local_b0._4_4_ + 1; pvVar8 = local_c0; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_c0 + -4); uVar3 = local_b0._4_4_ + 0x24; if (0x1f < (uint)((int)local_c0 + (-4 - (int)pvVar8))) goto LAB_00aaaa49; } operator_delete(pvVar8,uVar3); } local_b0 = 0xf00000000; local_c0 = (void *)((uint)local_c0 & 0xffffff00); if (0xf < local_10c) { uVar3 = local_10c + 1; pvVar8 = local_120[0]; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_120[0] + -4); uVar3 = local_10c + 0x24; if (0x1f < (uint)((int)local_120[0] + (-4 - (int)pvVar8))) goto LAB_00aaaa49; } operator_delete(pvVar8,uVar3); } local_110 = 0; local_10c = 0xf; local_120[0] = (void *)((uint)local_120[0] & 0xffffff00); if (0xf < local_128._4_4_) { uVar3 = local_128._4_4_ + 1; pvVar8 = local_138; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_138 + -4); uVar3 = local_128._4_4_ + 0x24; if (0x1f < (uint)((int)local_138 + (-4 - (int)pvVar8))) goto LAB_00aaaa49; } operator_delete(pvVar8,uVar3); } if (0xf < local_c8._4_4_) { uVar3 = local_c8._4_4_ + 1; pvVar8 = local_d8; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_d8 + -4); uVar3 = local_c8._4_4_ + 0x24; if (0x1f < (uint)((int)local_d8 + (-4 - (int)pvVar8))) goto LAB_00aaaa49; } operator_delete(pvVar8,uVar3); } local_c8 = 0xf00000000; local_d8 = (void *)((uint)local_d8 & 0xffffff00); if (0xf < local_dc) { uVar3 = local_dc + 1; pvVar8 = local_f0[0]; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_f0[0] + -4); uVar3 = local_dc + 0x24; if (0x1f < (uint)((int)local_f0[0] + (-4 - (int)pvVar8))) goto LAB_00aaaa49; } operator_delete(pvVar8,uVar3); } local_e0 = 0; local_dc = 0xf; local_f0[0] = (void *)((uint)local_f0[0] & 0xffffff00); if (0xf < local_f4) { uVar3 = local_f4 + 1; pvVar8 = local_108[0]; if (0xfff < uVar3) { pvVar8 = *(void **)((int)local_108[0] + -4); uVar3 = local_f4 + 0x24; if (0x1f < (uint)((int)local_108[0] + (-4 - (int)pvVar8))) { LAB_00aaaa49: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar8,uVar3); } break; } local_144 = *in_ECX; if (in_ECX[1] == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_14._0_1_ = 8; piVar5 = operator_new(0xc); local_14._0_1_ = 0; piVar5[2] = (int)puVar4; in_ECX[1] = in_ECX[1] + 1; puVar4 = *(undefined4 **)(local_144 + 4); *piVar5 = local_144; local_140 = local_140 + 1; piVar5[1] = (int)puVar4; *(int **)(local_144 + 4) = piVar5; *puVar4 = piVar5; } while (local_140 < local_13c); } Mutex::ScopeLock::~ScopeLock(&local_150); ExceptionList = local_1c; return; } //@@ 00aaaa90 FUN_00aaaa90 void FUN_00aaaa90(void) { void *this; int *piVar1; int *in_ECX; void *local_10; undefined1 local_c; local_10 = (void *)0x0; local_c = 0; this = (void *)in_ECX[3]; if (this != (void *)0x0) { local_10 = this; Mutex::lock(this); } piVar1 = *(int **)*in_ECX; if (piVar1 != (int *)*in_ECX) { do { *(undefined2 *)(piVar1[2] + 8) = 0; piVar1 = (int *)*piVar1; } while (piVar1 != (int *)*in_ECX); } Mutex::ScopeLock::~ScopeLock(&local_10); return; } //@@ 00aaaae0 FUN_00aaaae0 void FUN_00aaaae0(int param_1) { int iVar1; int iVar2; undefined4 *puVar3; int *piVar4; int *in_ECX; int iVar5; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b14f3d; local_10 = ExceptionList; ExceptionList = &local_10; iVar5 = 0; if (0 < param_1) { do { local_8 = 0xffffffff; iVar1 = *(int *)(*(int *)*in_ECX + 8); *(undefined2 *)(iVar1 + 8) = 0; piVar4 = *(int **)*in_ECX; iVar2 = *piVar4; in_ECX[1] = in_ECX[1] + -1; *(int *)piVar4[1] = iVar2; *(int *)(iVar2 + 4) = piVar4[1]; operator_delete(piVar4,0xc); iVar2 = *in_ECX; if (in_ECX[1] == 0x15555555) { /* WARNING: Subroutine does not return */ std::_Xlength_error("list too long"); } local_8 = 0; piVar4 = operator_new(0xc); iVar5 = iVar5 + 1; piVar4[2] = iVar1; in_ECX[1] = in_ECX[1] + 1; puVar3 = *(undefined4 **)(iVar2 + 4); *piVar4 = iVar2; piVar4[1] = (int)puVar3; *(int **)(iVar2 + 4) = piVar4; *puVar3 = piVar4; } while (iVar5 < param_1); } ExceptionList = local_10; return; } //@@ 00aaabb0 FUN_00aaabb0 undefined4 FUN_00aaabb0(void) { void *this; undefined4 *puVar1; undefined4 uVar2; int *in_ECX; void *local_10; undefined1 local_c; local_10 = (void *)0x0; local_c = 0; this = (void *)in_ECX[3]; if (this != (void *)0x0) { local_10 = this; Mutex::lock(this); } puVar1 = *(undefined4 **)*in_ECX; while( true ) { if (puVar1 == (undefined4 *)*in_ECX) { Mutex::ScopeLock::~ScopeLock(&local_10); return 0; } if (*(char *)(puVar1[2] + 9) == '\0') break; puVar1 = (undefined4 *)*puVar1; } *(undefined1 *)(puVar1[2] + 9) = 1; *(undefined1 *)(puVar1[2] + 8) = 0; uVar2 = puVar1[2]; Mutex::ScopeLock::~ScopeLock(&local_10); return uVar2; } //@@ 00aaac20 FUN_00aaac20 void FUN_00aaac20(void) { undefined4 *puVar1; undefined4 *puVar2; int *in_ECX; puVar1 = (undefined4 *)*in_ECX; *(undefined4 *)puVar1[1] = 0; puVar1 = (undefined4 *)*puVar1; while (puVar1 != (undefined4 *)0x0) { puVar2 = (undefined4 *)*puVar1; operator_delete(puVar1,0xc); puVar1 = puVar2; } *(int *)*in_ECX = *in_ECX; *(int *)(*in_ECX + 4) = *in_ECX; in_ECX[1] = 0; return; } //@@ 00aaac60 int_to_string /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? sprintf(buf[64], "%d" (s__d)) into the std::string at ECX; theora_create_video_clip, TheoraVideoManager::TheoraVideoManager prototype: db/protos.zhl */ std_string * __fastcall int_to_string(std_string *outString,int value) { byte bVar1; byte *pbVar2; byte local_48 [64]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_48 + 0x44); memset(local_48,0,0x40); sprintf(local_48,s__d); pbVar2 = local_48; outString->_buf[0] = '\0'; outString->_buf[1] = '\0'; outString->_buf[2] = '\0'; outString->_buf[3] = '\0'; outString->_size = 0; outString->_capacity = 0xf; outString->_buf[0] = '\0'; do { bVar1 = *pbVar2; pbVar2 = pbVar2 + 1; } while (bVar1 != 0); std::string::assign(outString->_buf,local_48,(int)pbVar2 - (int)(local_48 + 1)); return outString; } //@@ 00aaace0 FUN_00aaace0 void FUN_00aaace0(byte param_1) { undefined4 *in_ECX; *in_ECX = theoraplayer::WorkerThread::vftable; FUN_00aab170(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x1c); } return; } //@@ 00aaad10 FUN_00aaad10 void FUN_00aaad10(int param_1) { undefined4 *this; char cVar1; uint uVar2; int *piVar3; DWORD dwMilliseconds; undefined4 *local_18; undefined1 local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b14f6d; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; local_18 = (undefined4 *)0x0; local_14 = 0; local_8 = 0; if (*(char *)(param_1 + 4) != '\0') { while (*(char *)(param_1 + 0x14) != '\0') { piVar3 = (int *)TheoraVideoManager::requestWork(param_1); *(int **)(param_1 + 0x18) = piVar3; if (piVar3 == (int *)0x0) { if ((*(char *)(param_1 + 4) == '\0') || (*(char *)(param_1 + 0x14) == '\0')) break; dwMilliseconds = 100; LAB_00aaadf1: Sleep(dwMilliseconds); } else { this = (undefined4 *)piVar3[0xe]; if ((local_18 == (undefined4 *)0x0) && (this != (undefined4 *)0x0)) { local_18 = this; Mutex::lock(this); piVar3 = *(int **)(param_1 + 0x18); } if (-1 < piVar3[0x22]) { (**(code **)(*piVar3 + 0x1c))(uVar2); piVar3 = *(int **)(param_1 + 0x18); } cVar1 = (**(code **)(*piVar3 + 0x10))(); if (*(int *)(*(int *)(param_1 + 0x18) + 0x30) == param_1) { *(undefined4 *)(*(int *)(param_1 + 0x18) + 0x30) = 0; *(undefined4 *)(param_1 + 0x18) = 0; } if (local_18 != (undefined4 *)0x0) { *(undefined1 *)(local_18 + 1) = 0; LeaveCriticalSection((LPCRITICAL_SECTION)*local_18); local_18 = (undefined4 *)0x0; } if (cVar1 == '\0') { dwMilliseconds = 1; goto LAB_00aaadf1; } } if (*(char *)(param_1 + 4) == '\0') break; } } Mutex::ScopeLock::~ScopeLock(&local_18); ExceptionList = local_10; return; } //@@ 00aaae20 Mutex::ScopeLock::~ScopeLock /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: theoraplayer ScopeLock: releases held mutex (clears locked flag, LeaveCriticalSection), and when logUnhandledUnlocks (this[1]) logs "WARNING: '<0x%p>' has been scope-unlocked automatically!" via log function PTR 00c5aa7c; video clip code prototype: db/protos.zhl */ void __thiscall Mutex::ScopeLock::~ScopeLock(void *this) { byte bVar1; undefined4 *puVar2; uint uVar3; byte *pbVar4; void *ptr; void *local_42c [4]; undefined4 local_41c; uint local_418; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b14f90; local_10 = ExceptionList; uVar3 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; puVar2 = *(undefined4 **)this; if (puVar2 != (undefined4 *)0x0) { *(undefined1 *)(puVar2 + 1) = 0; local_14 = uVar3; LeaveCriticalSection((LPCRITICAL_SECTION)*puVar2); *(undefined4 *)this = 0; if (*(char *)((int)this + 4) != '\0') { memset(local_414,0,0x400); sprintf(local_414,(byte *)"WARNING: \'<0x%p>\' has been scope-unlocked automatically!"); pbVar4 = local_414; local_42c[0] = (void *)0x0; local_41c = 0; local_418 = 0xf; do { bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; } while (bVar1 != 0); std::string::assign((char *)local_42c,local_414,(int)pbVar4 - (int)(local_414 + 1)); (*(code *)PTR_FUN_00c5aa7c)(local_42c,uVar3); if (0xf < local_418) { uVar3 = local_418 + 1; ptr = local_42c[0]; if (0xfff < uVar3) { ptr = *(void **)((int)local_42c[0] + -4); uVar3 = local_418 + 0x24; if (0x1f < (uint)((int)local_42c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar3); } } } ExceptionList = local_10; return; } //@@ 00aaaf50 Mutex::lock /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: EnterCriticalSection(*this); sets locked byte this+4, and if it was already set logs "WARNING: '<0x%p>' is deadlocked!"; used by theora video and audio stream code prototype: db/protos.zhl */ void __thiscall Mutex::lock(void *this) { byte bVar1; uint uVar2; byte *pbVar3; void *ptr; void *local_42c [4]; undefined4 local_41c; uint local_418; byte local_414 [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14fd0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (uint)(local_414 + 0x410); ExceptionList = &local_10; local_14 = uVar2; EnterCriticalSection(*(LPCRITICAL_SECTION *)this); if (*(char *)((int)this + 4) == '\0') { *(undefined1 *)((int)this + 4) = 1; ExceptionList = local_10; return; } memset(local_414,0,0x400); sprintf(local_414,(byte *)"WARNING: \'<0x%p>\' is deadlocked!"); pbVar3 = local_414; local_41c = 0; local_418 = 0xf; local_42c[0] = (void *)0x0; do { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; } while (bVar1 != 0); std::string::assign((char *)local_42c,local_414,(int)pbVar3 - (int)(local_414 + 1)); local_8 = 0; (*(code *)PTR_FUN_00c5aa7c)(local_42c,uVar2); if (0xf < local_418) { uVar2 = local_418 + 1; ptr = local_42c[0]; if (0xfff < uVar2) { ptr = *(void **)((int)local_42c[0] + -4); uVar2 = local_418 + 0x24; if (0x1f < (uint)((int)local_42c[0] + (-4 - (int)ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } do { Sleep(1); } while( true ); } //@@ 00aab090 FUN_00aab090 void FUN_00aab090(void) { uint uStack_3c; ULONG_PTR local_2c; char *local_28; undefined4 local_20; undefined1 *local_1c; void *local_14; code *pcStack_10; uint local_c; undefined4 local_8; pcStack_10 = __except_handler4; local_14 = ExceptionList; local_c = __security_cookie ^ 0xbd5938; uStack_3c = __security_cookie ^ (int)register0x00000010 - 4U; local_1c = (undefined1 *)&uStack_3c; ExceptionList = &local_14; local_2c = 0x1000; local_28 = "Theoraplayer Worker Thread"; local_20 = 0; local_8 = 0; RaiseException(0x406d1388,0,4,&local_2c); ExceptionList = local_14; return; } //@@ 00aab120 FUN_00aab120 undefined4 FUN_00aab120(void) { GetCurrentThreadId(); FUN_00aab090(); FUN_00aab2c0(); return 0; } //@@ 00aab140 FUN_00aab140 void FUN_00aab140(byte param_1) { void *in_ECX; FUN_00aab170(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x18); } return; } //@@ 00aab170 FUN_00aab170 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00aab170(void) { HANDLE hObject; uint uVar1; undefined4 *in_ECX; int iVar2; undefined4 *puVar3; char *pcVar4; undefined4 *local_2c [4]; undefined4 local_1c; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 *puStack_8; puStack_8 = (undefined4 *)0xffffffff; puStack_c = &LAB_00b15000; local_10 = ExceptionList; uVar1 = __security_cookie ^ (uint)(local_2c + 10); ExceptionList = &local_10; *in_ECX = theoraplayer::Thread::vftable; local_14 = uVar1; if (*(char *)(in_ECX + 5) != '\0') { local_2c[0] = std::_Allocate(0x90); local_1c = 0x80; local_18 = 0x8f; pcVar4 = "Thread still executing in destructor! Attempting \'stop\', but this may be unsafe. The thread should be joined before deleting it." ; puVar3 = local_2c[0]; for (iVar2 = 0x20; iVar2 != 0; iVar2 = iVar2 + -1) { *puVar3 = *(undefined4 *)pcVar4; pcVar4 = pcVar4 + 4; puVar3 = puVar3 + 1; } *(undefined1 *)(local_2c[0] + 0x20) = 0; (*(code *)PTR_FUN_00c5aa7c)(local_2c,uVar1); if (0xf < local_18) { uVar1 = local_18 + 1; puVar3 = local_2c[0]; if (0xfff < uVar1) { puVar3 = (undefined4 *)local_2c[0][-1]; uVar1 = local_18 + 0x24; if (0x1f < (uint)((int)local_2c[0] + (-4 - (int)puVar3))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(puVar3,uVar1); } hObject = (HANDLE)in_ECX[4]; local_1c = 0; local_18 = 0xf; local_2c[0] = (undefined4 *)((uint)local_2c[0] & 0xffffff00); if (*(char *)(in_ECX + 5) == '\0') { if (hObject != (HANDLE)0x0) { CloseHandle(hObject); in_ECX[4] = 0; } } else { *(undefined1 *)(in_ECX + 5) = 0; if (hObject != (HANDLE)0x0) { TerminateThread(hObject,0); if ((HANDLE)in_ECX[4] != (HANDLE)0x0) { CloseHandle((HANDLE)in_ECX[4]); in_ECX[4] = 0; } } *(undefined1 *)(in_ECX + 1) = 0; } } if ((HANDLE)in_ECX[4] != (HANDLE)0x0) { CloseHandle((HANDLE)in_ECX[4]); in_ECX[4] = 0; } ExceptionList = local_10; return; } //@@ 00aab2c0 FUN_00aab2c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00aab2c0(void) { int in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b1504b; local_10 = ExceptionList; ExceptionList = &local_10; if ((*(char *)(in_ECX + 0x14) != '\0') && (*(int *)(in_ECX + 0xc) != 0)) { *(undefined1 *)(in_ECX + 4) = 1; local_8 = 0; (**(code **)(in_ECX + 0xc))(); } *(undefined1 *)(in_ECX + 4) = 0; *(undefined1 *)(in_ECX + 0x14) = 0; ExceptionList = local_10; return; } //@@ 00aab33d Catch@00aab33d void Catch_00aab33d(void) { int *piVar1; undefined4 uVar2; int unaff_EBP; memset((void *)(unaff_EBP + -0x414),0,0x400); sprintf((byte *)(unaff_EBP + -0x414),(byte *)"FATAL: Thread \'%s\' \'<0x%p>\':"); piVar1 = *(int **)(unaff_EBP + -0x468); uVar2 = (**(code **)(*piVar1 + 8))(unaff_EBP + -0x444); *(undefined1 *)(unaff_EBP + -4) = 2; FUN_00856390(uVar2); *(undefined1 *)(unaff_EBP + -4) = 3; FUN_00a621d0(); std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x42c)); *(undefined1 *)(unaff_EBP + -4) = 1; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x444)); FUN_00a8b130(piVar1); /* WARNING: Subroutine does not return */ _CxxThrowException((void *)(unaff_EBP + -0x460),(ThrowInfo *)&DAT_00bd5d50); } //@@ 00aab3e0 theoraplayer::_Exception::_Exception /* DB: constructor: sets theoraplayer::_Exception::vftable, empty std::string message at +4, then fills it from (message, file, line) via FUN_00aab470; VideoClip_Theora::readTheoraVorbisHeaders throws it */ void theoraplayer::_Exception::_Exception(undefined4 param_1,undefined4 param_2,undefined4 param_3) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b15090; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = vftable; in_ECX[1] = 0; in_ECX[5] = 0; in_ECX[6] = 0xf; *(undefined1 *)(in_ECX + 1) = 0; local_8 = 0; _setInternalMessage(param_1,param_2,param_3); ExceptionList = local_10; return; } //@@ 00aab470 theoraplayer::_Exception::_setInternalMessage /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? builds the message std::string from (message, file, line) with int_to_string and "FATAL: " prefix; only caller theoraplayer::_Exception::_Exception (DB note) */ void theoraplayer::_Exception::_setInternalMessage(byte *param_1,byte *param_2,int param_3) { uint *puVar1; undefined8 uVar2; byte bVar3; int iVar4; int iVar5; int iVar6; std_string *psVar7; std_string *psVar8; undefined4 *puVar9; int *piVar10; int in_ECX; byte *pbVar11; void *ptr; void *pvVar12; uint uVar13; void **right; void *local_cc [5]; uint local_b8; void *local_b4; int iStack_b0; int iStack_ac; int iStack_a8; undefined8 local_a4; void *local_9c [4]; undefined4 local_8c; uint local_88; void *local_84; undefined4 uStack_80; undefined4 uStack_7c; undefined4 uStack_78; undefined8 local_74; void *local_6c [4]; undefined4 local_5c; uint local_58; void *local_54; undefined4 uStack_50; undefined4 uStack_4c; undefined4 uStack_48; undefined8 local_44; void *local_3c; undefined4 uStack_38; undefined4 uStack_34; undefined4 uStack_30; undefined8 local_2c; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; void *local_14; puStack_20 = (undefined1 *)(local_6c + 0x1a); local_14 = (void *)0xffffffff; puStack_18 = &LAB_00b150f3; local_1c = ExceptionList; local_24 = __security_cookie ^ (uint)(local_6c + 0x17); ExceptionList = &local_1c; psVar7 = int_to_string((std_string *)local_cc,param_3); local_14 = (void *)0x0; local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)0x0; pbVar11 = param_2; do { bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; } while (bVar3 != 0); std::string::assign((char *)local_6c,param_2,(int)pbVar11 - (int)(param_2 + 1)); local_14._0_1_ = 1; psVar8 = std_string_insert(local_6c,0,&DAT_00b6d4d0,1); local_54 = *(void **)psVar8->_buf; uStack_50 = *(undefined4 *)(psVar8->_buf + 4); uStack_4c = *(undefined4 *)(psVar8->_buf + 8); uStack_48 = *(undefined4 *)(psVar8->_buf + 0xc); local_44._0_4_ = psVar8->_size; local_44._4_4_ = psVar8->_capacity; psVar8->_size = 0; psVar8->_capacity = 0xf; psVar8->_buf[0] = '\0'; local_14._0_1_ = 2; puVar9 = std::string::append((char *)&local_54,&DAT_00b66134,1); local_84 = (void *)*puVar9; uStack_80 = puVar9[1]; uStack_7c = puVar9[2]; uStack_78 = puVar9[3]; local_74 = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; local_14._0_1_ = 3; std::string::concat_move((char *)local_9c,in_ECX,&local_84,psVar7); local_14._0_1_ = 4; puVar9 = std::string::append((char *)local_9c,&DAT_00ba90e4,2); local_3c = (void *)*puVar9; uStack_38 = puVar9[1]; uStack_34 = puVar9[2]; uStack_30 = puVar9[3]; local_2c = *(undefined8 *)(puVar9 + 4); puVar9[4] = 0; puVar9[5] = 0xf; *(undefined1 *)puVar9 = 0; local_14._0_1_ = 5; puVar1 = (uint *)(param_1 + 0x10); if (0xf < *(uint *)(param_1 + 0x14)) { param_1 = *(byte **)param_1; } piVar10 = std::string::append((char *)&local_3c,param_1,*puVar1); right = (void **)(in_ECX + 4); pvVar12 = (void *)*piVar10; iVar4 = piVar10[1]; iVar5 = piVar10[2]; iVar6 = piVar10[3]; uVar2 = *(undefined8 *)(piVar10 + 4); piVar10[4] = 0; piVar10[5] = 0xf; *(undefined1 *)piVar10 = 0; local_b4 = pvVar12; iStack_b0 = iVar4; iStack_ac = iVar5; iStack_a8 = iVar6; local_a4 = uVar2; if (right == &local_b4) { local_a4._4_4_ = (uint)((ulonglong)uVar2 >> 0x20); if (0xf < local_a4._4_4_) { uVar13 = local_a4._4_4_ + 1; ptr = pvVar12; if (0xfff < uVar13) { ptr = *(void **)((int)pvVar12 + -4); uVar13 = local_a4._4_4_ + 0x24; if (0x1f < (uint)((int)pvVar12 + (-4 - (int)ptr))) goto LAB_00aab848; } operator_delete(ptr,uVar13); uVar2 = local_a4; } } else { std::string::_Tidy_deallocate((char *)right); *right = pvVar12; *(int *)(in_ECX + 8) = iVar4; *(int *)(in_ECX + 0xc) = iVar5; *(int *)(in_ECX + 0x10) = iVar6; *(undefined8 *)(in_ECX + 0x14) = uVar2; uVar2 = local_a4; } local_a4 = uVar2; local_14._0_1_ = 4; if (0xf < local_2c._4_4_) { uVar13 = local_2c._4_4_ + 1; pvVar12 = local_3c; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_3c + -4); uVar13 = local_2c._4_4_ + 0x24; if (0x1f < (uint)((int)local_3c + (-4 - (int)pvVar12))) goto LAB_00aab848; } operator_delete(pvVar12,uVar13); } local_14._0_1_ = 3; local_2c = 0xf00000000; local_3c = (void *)((uint)local_3c & 0xffffff00); if (0xf < local_88) { uVar13 = local_88 + 1; pvVar12 = local_9c[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_9c[0] + -4); uVar13 = local_88 + 0x24; if (0x1f < (uint)((int)local_9c[0] + (-4 - (int)pvVar12))) goto LAB_00aab848; } operator_delete(pvVar12,uVar13); } local_14._0_1_ = 2; local_8c = 0; local_88 = 0xf; local_9c[0] = (void *)((uint)local_9c[0] & 0xffffff00); if (0xf < local_74._4_4_) { uVar13 = local_74._4_4_ + 1; pvVar12 = local_84; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_84 + -4); uVar13 = local_74._4_4_ + 0x24; if (0x1f < (uint)((int)local_84 + (-4 - (int)pvVar12))) goto LAB_00aab848; } operator_delete(pvVar12,uVar13); } local_14._0_1_ = 1; if (0xf < local_44._4_4_) { uVar13 = local_44._4_4_ + 1; pvVar12 = local_54; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_54 + -4); uVar13 = local_44._4_4_ + 0x24; if (0x1f < (uint)((int)local_54 + (-4 - (int)pvVar12))) goto LAB_00aab848; } operator_delete(pvVar12,uVar13); } local_14._0_1_ = 0; local_44 = 0xf00000000; local_54 = (void *)((uint)local_54 & 0xffffff00); if (0xf < local_58) { uVar13 = local_58 + 1; pvVar12 = local_6c[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_6c[0] + -4); uVar13 = local_58 + 0x24; if (0x1f < (uint)((int)local_6c[0] + (-4 - (int)pvVar12))) goto LAB_00aab848; } operator_delete(pvVar12,uVar13); } local_14._0_1_ = 0xff; local_14._1_3_ = 0xffffff; local_5c = 0; local_58 = 0xf; local_6c[0] = (void *)((uint)local_6c[0] & 0xffffff00); if (0xf < local_b8) { uVar13 = local_b8 + 1; pvVar12 = local_cc[0]; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_cc[0] + -4); uVar13 = local_b8 + 0x24; if (0x1f < (uint)((int)local_cc[0] + (-4 - (int)pvVar12))) { LAB_00aab848: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar13); } psVar7 = *(std_string **)(in_ECX + 0x14); if (0x7fffffffU - (int)psVar7 < 7) { /* WARNING: Subroutine does not return */ std::string::_Xlen(); } if (0xf < *(uint *)(in_ECX + 0x18)) { right = *right; } std::string::concat((char *)&local_84,in_ECX,psVar7,(byte *)"FATAL: ",7,(byte *)right,(uint)psVar7 ); local_14 = (void *)0x6; (*(code *)PTR_FUN_00c5aa7c)(&local_84); if (0xf < local_74._4_4_) { uVar13 = local_74._4_4_ + 1; pvVar12 = local_84; if (0xfff < uVar13) { pvVar12 = *(void **)((int)local_84 + -4); uVar13 = local_74._4_4_ + 0x24; if (0x1f < (uint)((int)local_84 + (-4 - (int)pvVar12))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar12,uVar13); } ExceptionList = local_1c; return; } //@@ 00aab900 std::_Facet_base::`scalar_deleting_destructor' /* Library Function - Single Match public: virtual void * __thiscall std::_Facet_base::`scalar deleting destructor'(unsigned int) Library: Visual Studio 2019 Release */ void * __thiscall std::_Facet_base::_scalar_deleting_destructor_(_Facet_base *this,uint param_1) { *(undefined ***)this = theoraplayer::DataSource::vftable; if ((param_1 & 1) != 0) { operator_delete(this,4); } return this; } //@@ 00aab930 FUN_00aab930 void FUN_00aab930(void) { undefined4 *in_ECX; *in_ECX = theoraplayer::DataSource::vftable; return; } //@@ 00aab940 FUN_00aab940 void FUN_00aab940(byte param_1) { undefined4 *in_ECX; *in_ECX = theoraplayer::AudioInterface::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 00aab970 FUN_00aab970 void FUN_00aab970(void) { undefined4 *in_ECX; *in_ECX = theoraplayer::AudioInterface::vftable; return; } //@@ 00aab980 FUN_00aab980 void FUN_00aab980(byte param_1) { undefined4 *in_ECX; *in_ECX = theoraplayer::Timer::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x10); } return; } //@@ 00aab9b0 FUN_00aab9b0 void FUN_00aab9b0(void) { undefined4 *in_ECX; *in_ECX = theoraplayer::Timer::vftable; return; } //@@ 00aab9c0 FUN_00aab9c0 void FUN_00aab9c0(float param_1) { char cVar1; int *in_ECX; cVar1 = (**(code **)(*in_ECX + 0x10))(); if (cVar1 == '\0') { in_ECX[1] = (int)(param_1 * (float)in_ECX[2] + (float)in_ECX[1]); } return; } //@@ 00aab9f0 FUN_00aab9f0 void FUN_00aab9f0(void) { int in_ECX; *(undefined1 *)(in_ECX + 0xc) = 0; return; } //@@ 00aaba00 FUN_00aaba00 void FUN_00aaba00(void) { int in_ECX; *(undefined1 *)(in_ECX + 0xc) = 1; return; } //@@ 00aaba10 FUN_00aaba10 void FUN_00aaba10(byte param_1) { void *in_ECX; FUN_00aaba40(); if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x80); } return; } //@@ 00aaba40 FUN_00aaba40 void FUN_00aaba40(void) { undefined4 *in_ECX; *in_ECX = KAGE::System::UgcManager::vftable; in_ECX[0x18] = CCallResult::vftable; if (in_ECX[0x1c] != 0 || in_ECX[0x1d] != 0) { SteamAPI_UnregisterCallResult(in_ECX + 0x18,in_ECX[0x1c],in_ECX[0x1d]); in_ECX[0x1c] = 0; in_ECX[0x1d] = 0; } in_ECX[0x10] = CCallResult::vftable; if (in_ECX[0x14] != 0 || in_ECX[0x15] != 0) { SteamAPI_UnregisterCallResult(in_ECX + 0x10,in_ECX[0x14],in_ECX[0x15]); in_ECX[0x14] = 0; in_ECX[0x15] = 0; } in_ECX[8] = CCallResult::vftable; if (in_ECX[0xc] != 0 || in_ECX[0xd] != 0) { SteamAPI_UnregisterCallResult(in_ECX + 8,in_ECX[0xc],in_ECX[0xd]); in_ECX[0xc] = 0; in_ECX[0xd] = 0; } in_ECX[1] = in_ECX[1] & 0xfffffffe; in_ECX[6] = 0; in_ECX[7] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[2] = 0; in_ECX[3] = 0; *in_ECX = KAGE::ManagerBase::vftable; return; } //@@ 00aabb10 FUN_00aabb10 undefined4 FUN_00aabb10(undefined4 param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined4 param_5 ) { int *piVar1; undefined4 *puVar2; int iVar3; int in_ECX; longlong lVar4; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if (*piVar1 == 0) { return 0; } puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); (*(code *)**(undefined4 **)*puVar2)(param_1,param_2); *(undefined4 *)(in_ECX + 8) = param_4; *(undefined4 *)(in_ECX + 0xc) = param_5; puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); lVar4 = (**(code **)(*(int *)*puVar2 + 0x1c))(param_1); iVar3 = param_3; if (*(int *)(param_3 + 0x30) != 0 || *(int *)(param_3 + 0x34) != 0) { SteamAPI_UnregisterCallResult (param_3 + 0x20,*(undefined4 *)(param_3 + 0x30),*(int *)(param_3 + 0x34)); } *(int *)(param_3 + 0x38) = iVar3; *(longlong *)(param_3 + 0x30) = lVar4; *(code **)(param_3 + 0x3c) = FUN_00aabd40; if (lVar4 != 0) { SteamAPI_RegisterCallResult(param_3 + 0x20,lVar4); } return 1; } //@@ 00aabbd0 FUN_00aabbd0 undefined4 FUN_00aabbd0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int *piVar1; undefined4 *puVar2; int in_ECX; undefined4 unaff_EDI; longlong lVar3; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if (*piVar1 == 0) { return 0; } *(undefined4 *)(in_ECX + 0x10) = param_3; *(undefined4 *)(in_ECX + 0x14) = param_4; puVar2 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); lVar3 = (**(code **)(*(int *)*puVar2 + 0x60))(param_1,param_2,0); if (*(int *)(in_ECX + 0x50) != 0 || *(int *)(in_ECX + 0x54) != 0) { SteamAPI_UnregisterCallResult(in_ECX + 0x40,*(int *)(in_ECX + 0x50),*(int *)(in_ECX + 0x54)); } *(undefined4 *)(in_ECX + 0x58) = unaff_EDI; *(longlong *)(in_ECX + 0x50) = lVar3; *(code **)(in_ECX + 0x5c) = FUN_00aabd90; if (lVar3 != 0) { SteamAPI_RegisterCallResult(in_ECX + 0x40,lVar3); } return 1; } //@@ 00aabc80 FUN_00aabc80 undefined4 FUN_00aabc80(undefined4 param_1,int param_2,uint param_3,undefined4 param_4,undefined4 param_5) { int *piVar1; int iVar2; undefined4 *puVar3; int in_ECX; longlong lVar4; piVar1 = (int *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); if (*piVar1 == 0) { return 0; } *(undefined4 *)(in_ECX + 0x18) = param_4; *(undefined4 *)(in_ECX + 0x1c) = param_5; iVar2 = KAGE::System::LeaderboardManager::get_result(param_3); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00bf93c8); lVar4 = (**(code **)(*(int *)*puVar3 + 0x7c)) (*(undefined4 *)(iVar2 + 0x10),*(undefined4 *)(iVar2 + 0x14),param_1); iVar2 = param_2; if (*(int *)(param_2 + 0x70) != 0 || *(int *)(param_2 + 0x74) != 0) { SteamAPI_UnregisterCallResult (param_2 + 0x60,*(undefined4 *)(param_2 + 0x70),*(int *)(param_2 + 0x74)); } *(int *)(param_2 + 0x78) = iVar2; *(longlong *)(param_2 + 0x70) = lVar4; *(code **)(param_2 + 0x7c) = FUN_00aabe70; if (lVar4 != 0) { SteamAPI_RegisterCallResult(param_2 + 0x60,lVar4); } return 1; } //@@ 00aabd40 FUN_00aabd40 void FUN_00aabd40(int *param_1,char param_2) { code *pcVar1; int in_ECX; uint3 uVar2; pcVar1 = *(code **)(in_ECX + 8); if (pcVar1 != (code *)0x0) { uVar2 = (uint3)((uint)in_ECX >> 8); if ((param_2 == '\0') && (*param_1 == 1)) { (*pcVar1)(param_1[2],param_1[3],CONCAT31(uVar2,1),*(undefined4 *)(in_ECX + 0xc)); return; } (*pcVar1)(param_1[2],param_1[3],(uint)uVar2 << 8,*(undefined4 *)(in_ECX + 0xc)); } return; } //@@ 00aabd90 FUN_00aabd90 void FUN_00aabd90(int *param_1,char param_2) { code *pcVar1; uint uVar2; undefined4 *puVar3; int in_ECX; void *ptr; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0cf0; local_10 = ExceptionList; uVar2 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; pcVar1 = *(code **)(in_ECX + 0x10); if (pcVar1 != (code *)0x0) { ptr = (void *)0x0; if ((param_2 == '\0') && (*param_1 == 1)) { _param_2 = 1; ptr = tracked_alloc(0,(void *)0x0,(ulonglong)(uint)param_1[5]); puVar3 = (undefined4 *)SteamInternal_ContextInit(&PTR_FUN_00c5c3a4); (**(code **)(*(int *)*puVar3 + 0x6c))(param_1[2],param_1[3],ptr,param_1[5],0,0); } else { _param_2 = 0; } (*pcVar1)(ptr,param_1[5],_param_2,*(undefined4 *)(in_ECX + 0x14),uVar2); if (ptr != (void *)0x0) { local_8 = 0; tracked_alloc(1,ptr,0); } } ExceptionList = local_10; return; } //@@ 00aabe70 FUN_00aabe70 void FUN_00aabe70(int *param_1,char param_2) { code *pcVar1; int *in_EAX; int in_ECX; pcVar1 = *(code **)(in_ECX + 0x18); if (pcVar1 != (code *)0x0) { if ((param_2 == '\0') && (in_EAX = param_1, *param_1 == 1)) { (*pcVar1)(1,*(undefined4 *)(in_ECX + 0x1c)); return; } (*pcVar1)((uint)in_EAX & 0xffffff00,*(undefined4 *)(in_ECX + 0x1c)); } return; } //@@ 00aabeb0 FUN_00aabeb0 undefined4 FUN_00aabeb0(void) { return 0x128; } //@@ 00aabec0 FUN_00aabec0 undefined4 FUN_00aabec0(void) { return 0x118; } //@@ 00aabed0 ogg_page_granulepos /* DB: libogg: returns the 64-bit value at page->header+6 (bytes 6..13); VideoClip_Theora::_load duration scan, _seekPage prototype: db/protos.zhl */ longlong __fastcall ogg_page_granulepos(void *page) { uint uVar1; uVar1 = *(uint *)(*(int *)page + 10); return CONCAT44((((uVar1 >> 0x18) << 8 | (uVar1 & 0xffffff) >> 0x10) << 8 | (uVar1 << 8 & 0xffffff) >> 0x10) << 8 | (uVar1 << 8 & 0xffff) >> 8, *(undefined4 *)(*(int *)page + 6)); } //@@ 00aabf60 FUN_00aabf60 undefined4 FUN_00aabf60(void) { undefined4 *in_ECX; if (in_ECX != (undefined4 *)0x0) { if ((void *)*in_ECX != (void *)0x0) { free((void *)*in_ECX); } if ((void *)in_ECX[4] != (void *)0x0) { free((void *)in_ECX[4]); } if ((void *)in_ECX[5] != (void *)0x0) { free((void *)in_ECX[5]); } memset(in_ECX,0,0x168); } return 0; } //@@ 00aabfb0 FUN_00aabfb0 undefined4 FUN_00aabfb0(void) { size_t sVar1; int iVar2; void *pvVar3; undefined4 *in_ECX; int in_EDX; size_t _NewSize; iVar2 = in_ECX[1]; if ((int)in_ECX[2] < iVar2 - in_EDX) { return 0; } if (iVar2 <= 0x7fffffff - in_EDX) { sVar1 = iVar2 + in_EDX; _NewSize = sVar1 + 0x400; if (0x7ffffbfe < (int)sVar1) { _NewSize = sVar1; } pvVar3 = realloc((void *)*in_ECX,_NewSize); if (pvVar3 != (void *)0x0) { in_ECX[1] = _NewSize; *in_ECX = pvVar3; return 0; } } if ((void *)*in_ECX != (void *)0x0) { free((void *)*in_ECX); } if ((void *)in_ECX[4] != (void *)0x0) { free((void *)in_ECX[4]); } if ((void *)in_ECX[5] != (void *)0x0) { free((void *)in_ECX[5]); } memset(in_ECX,0,0x168); return 0xffffffff; } //@@ 00aac040 FUN_00aac040 undefined4 FUN_00aac040(void) { uint uVar1; int iVar2; void *pvVar3; undefined4 *in_ECX; int in_EDX; uint uVar4; iVar2 = in_ECX[6]; if ((int)in_ECX[7] < iVar2 - in_EDX) { return 0; } if (iVar2 <= 0x7fffffff - in_EDX) { uVar1 = iVar2 + in_EDX; uVar4 = uVar1 + 0x20; if (0x7fffffde < (int)uVar1) { uVar4 = uVar1; } pvVar3 = realloc((void *)in_ECX[4], -(uint)((int)((ulonglong)uVar4 * 4 >> 0x20) != 0) | (uint)((ulonglong)uVar4 * 4)); if (pvVar3 != (void *)0x0) { in_ECX[4] = pvVar3; pvVar3 = realloc((void *)in_ECX[5], -(uint)((int)((ulonglong)uVar4 * 8 >> 0x20) != 0) | (uint)((ulonglong)uVar4 * 8)); if (pvVar3 == (void *)0x0) { FUN_00aabf60(); return 0xffffffff; } in_ECX[5] = pvVar3; in_ECX[6] = uVar4; return 0; } } if ((void *)*in_ECX != (void *)0x0) { free((void *)*in_ECX); } if ((void *)in_ECX[4] != (void *)0x0) { free((void *)in_ECX[4]); } if ((void *)in_ECX[5] != (void *)0x0) { free((void *)in_ECX[5]); } memset(in_ECX,0,0x168); return 0xffffffff; } //@@ 00aac110 ogg_page_checksum_set /* DB: libogg: zeroes header bytes 22..25, crc over header (len +4) and body (+8, len +0xc) with table 0xb4ed60 (msb-first), stores little-endian; ogg_sync_pageseek, ogg_sync_pageout */ void ogg_page_checksum_set(void) { byte *pbVar1; int iVar2; uint uVar3; int *in_ECX; int iVar4; if (in_ECX != (int *)0x0) { iVar2 = *in_ECX; uVar3 = 0; iVar4 = 0; *(undefined4 *)(iVar2 + 0x16) = 0; if (0 < in_ECX[1]) { do { pbVar1 = (byte *)(iVar2 + iVar4); iVar4 = iVar4 + 1; uVar3 = uVar3 << 8 ^ *(uint *)(&DAT_00b4ed60 + ((uint)*pbVar1 ^ uVar3 >> 0x18) * 4); } while (iVar4 < in_ECX[1]); } iVar4 = 0; if (0 < in_ECX[3]) { do { pbVar1 = (byte *)(in_ECX[2] + iVar4); iVar4 = iVar4 + 1; uVar3 = uVar3 << 8 ^ *(uint *)(&DAT_00b4ed60 + ((uint)*pbVar1 ^ uVar3 >> 0x18) * 4); } while (iVar4 < in_ECX[3]); } *(char *)(iVar2 + 0x16) = (char)uVar3; *(char *)(iVar2 + 0x17) = (char)(uVar3 >> 8); *(char *)(iVar2 + 0x18) = (char)(uVar3 >> 0x10); *(char *)(iVar2 + 0x19) = (char)(uVar3 >> 0x18); } return; } //@@ 00aac1a0 FUN_00aac1a0 int FUN_00aac1a0(void) { int iVar1; void *pvVar2; int *in_ECX; int iVar3; int in_EDX; size_t _Size; iVar1 = in_ECX[1]; if (iVar1 < 0) { return 0; } iVar3 = in_ECX[3]; if (iVar3 != 0) { in_ECX[2] = in_ECX[2] - iVar3; if (0 < in_ECX[2]) { memmove((void *)*in_ECX,(void *)(*in_ECX + iVar3),in_ECX[2]); iVar1 = in_ECX[1]; } in_ECX[3] = 0; } iVar3 = in_ECX[2]; if (iVar1 - iVar3 < in_EDX) { _Size = in_EDX + 0x1000 + iVar3; if ((void *)*in_ECX == (void *)0x0) { pvVar2 = malloc(_Size); } else { pvVar2 = realloc((void *)*in_ECX,_Size); } if (pvVar2 == (void *)0x0) { if ((void *)*in_ECX != (void *)0x0) { free((void *)*in_ECX); } *in_ECX = 0; in_ECX[1] = 0; in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; return 0; } iVar3 = in_ECX[2]; *in_ECX = (int)pvVar2; in_ECX[1] = _Size; } return *in_ECX + iVar3; } //@@ 00aac240 ogg_sync_pageseek /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libogg: needs 27 header bytes, "OggS" capture compare, header length 27+segments, body sum, saves/zeroes CRC at +0x16 and recomputes via ogg_page_checksum_set 00aac110, fills ogg_page {header, header_len, body, body_len} */ int ogg_sync_pageseek(void) { int iVar1; byte bVar2; uint uVar3; void *pvVar4; int *in_ECX; int iVar5; int iVar6; int *in_EDX; int iVar7; int iVar8; int *piVar9; bool bVar10; iVar5 = in_ECX[2] - in_ECX[3]; piVar9 = (int *)(*in_ECX + in_ECX[3]); if (-1 < in_ECX[1]) { iVar8 = in_ECX[5]; if (iVar8 == 0) { if (iVar5 < 0x1b) { return 0; } if ((*piVar9 == 0x5367674f) || ((((bVar2 = (byte)*piVar9, bVar10 = bVar2 < 0x4f, bVar2 == 0x4f && (bVar10 = *(byte *)((int)piVar9 + 1) < 0x67, *(byte *)((int)piVar9 + 1) == 0x67)) && (bVar10 = *(byte *)((int)piVar9 + 2) < 0x67, *(byte *)((int)piVar9 + 2) == 0x67)) && (bVar10 = *(byte *)((int)piVar9 + 3) < 0x53, *(byte *)((int)piVar9 + 3) == 0x53)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar10 | 1; } if (uVar3 != 0) goto LAB_00aac32c; iVar8 = *(byte *)((int)piVar9 + 0x1a) + 0x1b; if (iVar5 < iVar8) { return 0; } iVar6 = 0; if (*(byte *)((int)piVar9 + 0x1a) != 0) { iVar7 = in_ECX[6]; do { iVar1 = iVar6 + 0x1b; iVar6 = iVar6 + 1; iVar7 = iVar7 + (uint)*(byte *)((int)piVar9 + iVar1); in_ECX[6] = iVar7; } while (iVar6 < (int)(uint)*(byte *)((int)piVar9 + 0x1a)); } in_ECX[5] = iVar8; } if (in_ECX[6] + iVar8 <= iVar5) { iVar8 = *(int *)((int)piVar9 + 0x16); *(undefined4 *)((int)piVar9 + 0x16) = 0; ogg_page_checksum_set(); if (iVar8 == *(int *)((int)piVar9 + 0x16)) { iVar5 = *in_ECX; iVar8 = in_ECX[3]; if (in_EDX != (int *)0x0) { *in_EDX = iVar5 + iVar8; in_EDX[1] = in_ECX[5]; in_EDX[2] = in_ECX[5] + iVar5 + iVar8; in_EDX[3] = in_ECX[6]; iVar8 = in_ECX[3]; } iVar5 = in_ECX[5]; iVar6 = in_ECX[6]; in_ECX[4] = 0; in_ECX[5] = 0; in_ECX[6] = 0; in_ECX[3] = iVar8 + iVar5 + iVar6; return iVar5 + iVar6; } *(int *)((int)piVar9 + 0x16) = iVar8; LAB_00aac32c: iVar8 = *in_ECX; in_ECX[5] = 0; in_ECX[6] = 0; pvVar4 = memchr((void *)((int)piVar9 + 1),0x4f,iVar5 - 1); if (pvVar4 == (void *)0x0) { pvVar4 = (void *)(in_ECX[2] + iVar8); } in_ECX[3] = (int)pvVar4 - iVar8; return (int)piVar9 - (int)pvVar4; } } return 0; } //@@ 00aac3e0 ogg_sync_pageout /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ECX ogg_sync_state, EDX ogg_page: loops the inlined pageseek (needs 27 header bytes, "OggS" capture, memchr for the next 'O' on resync); KAGE_Audio::open_sound_file, VideoClip_Theora::readTheoraVorbisHeaders prototype: db/protos.zhl */ int __fastcall ogg_sync_pageout(void *syncState,void *page) { int iVar1; byte bVar2; uint uVar3; void *pvVar4; int iVar5; int iVar6; int iVar7; int *piVar8; bool bVar9; undefined1 auStack_2c [4]; int local_28; int *local_24; int *local_20; int local_1c; int local_18; undefined4 local_14; int local_10; uint local_c; local_c = __security_cookie ^ (uint)auStack_2c; local_24 = page; if (-1 < *(int *)((int)syncState + 4)) { while( true ) { local_28 = *(int *)((int)syncState + 8) - *(int *)((int)syncState + 0xc); piVar8 = (int *)(*(int *)syncState + *(int *)((int)syncState + 0xc)); if (*(int *)((int)syncState + 4) < 0) break; iVar5 = *(int *)((int)syncState + 0x14); if (iVar5 == 0) { if (local_28 < 0x1b) { return 0; } if ((*piVar8 == 0x5367674f) || ((((bVar2 = (byte)*piVar8, bVar9 = bVar2 < 0x4f, bVar2 == 0x4f && (bVar9 = *(byte *)((int)piVar8 + 1) < 0x67, *(byte *)((int)piVar8 + 1) == 0x67)) && (bVar9 = *(byte *)((int)piVar8 + 2) < 0x67, *(byte *)((int)piVar8 + 2) == 0x67)) && (bVar9 = *(byte *)((int)piVar8 + 3) < 0x53, *(byte *)((int)piVar8 + 3) == 0x53)))) { uVar3 = 0; } else { uVar3 = -(uint)bVar9 | 1; } if (uVar3 == 0) { iVar5 = *(byte *)((int)piVar8 + 0x1a) + 0x1b; if (local_28 < iVar5) { return 0; } iVar6 = 0; if (*(byte *)((int)piVar8 + 0x1a) != 0) { iVar7 = *(int *)((int)syncState + 0x18); do { iVar1 = iVar6 + 0x1b; iVar6 = iVar6 + 1; iVar7 = iVar7 + (uint)*(byte *)((int)piVar8 + iVar1); *(int *)((int)syncState + 0x18) = iVar7; } while (iVar6 < (int)(uint)*(byte *)((int)piVar8 + 0x1a)); } *(int *)((int)syncState + 0x14) = iVar5; goto LAB_00aac49a; } LAB_00aac4e4: iVar5 = *(int *)syncState; *(undefined4 *)((int)syncState + 0x14) = 0; *(undefined4 *)((int)syncState + 0x18) = 0; pvVar4 = memchr((void *)((int)piVar8 + 1),0x4f,local_28 - 1); if (pvVar4 == (void *)0x0) { pvVar4 = (void *)(*(int *)((int)syncState + 8) + iVar5); } iVar6 = (int)piVar8 - (int)pvVar4; iVar5 = (int)pvVar4 - iVar5; } else { LAB_00aac49a: if (local_28 < *(int *)((int)syncState + 0x18) + iVar5) { return 0; } iVar5 = *(int *)((int)piVar8 + 0x16); *(undefined4 *)((int)piVar8 + 0x16) = 0; local_1c = *(int *)((int)syncState + 0x14); local_18 = local_1c + (int)piVar8; local_14 = *(undefined4 *)((int)syncState + 0x18); local_20 = piVar8; local_10 = iVar5; ogg_page_checksum_set(); if (local_10 != *(int *)((int)piVar8 + 0x16)) { *(int *)((int)piVar8 + 0x16) = iVar5; goto LAB_00aac4e4; } iVar6 = *(int *)syncState; iVar5 = *(int *)((int)syncState + 0xc); if (local_24 != (int *)0x0) { *local_24 = iVar6 + iVar5; local_24[1] = *(int *)((int)syncState + 0x14); local_24[2] = *(int *)((int)syncState + 0x14) + iVar6 + iVar5; local_24[3] = *(int *)((int)syncState + 0x18); iVar5 = *(int *)((int)syncState + 0xc); } iVar6 = *(int *)((int)syncState + 0x18) + *(int *)((int)syncState + 0x14); *(undefined4 *)((int)syncState + 0x10) = 0; iVar5 = iVar5 + iVar6; *(undefined4 *)((int)syncState + 0x14) = 0; *(undefined4 *)((int)syncState + 0x18) = 0; } *(int *)((int)syncState + 0xc) = iVar5; if (0 < iVar6) { return 1; } if (iVar6 == 0) { return 0; } if (*(int *)((int)syncState + 0x10) == 0) { *(undefined4 *)((int)syncState + 0x10) = 1; return -1; } } } return 0; } //@@ 00aac5c0 ogg_stream_pagein /* DB: libogg: ECX = ogg_stream_state, EDX = ogg_page: reads header version/flags (+4/+5), serialno (+0xe), pageno (+0x12), segments (+0x1a); compacts returned body/lacing (memmove), checks serial, handles page gaps and appends lacing/body; callers VideoClip_Theora::readTheoraVorbisHeaders, FUN_00a8d0a0 */ undefined4 ogg_stream_pagein(void) { int *piVar1; uint *puVar2; char cVar3; byte bVar4; byte bVar5; int iVar6; void *_Dst; int iVar7; byte bVar8; uint uVar9; int iVar10; int iVar11; uint uVar12; int *in_ECX; int *in_EDX; byte *pbVar13; int iVar14; size_t _Size; int iVar15; longlong lVar16; void *local_30; undefined4 local_14; undefined4 local_10; local_30 = (void *)in_EDX[2]; _Size = in_EDX[3]; iVar6 = *in_EDX; iVar15 = 0; cVar3 = *(char *)(iVar6 + 4); bVar4 = *(byte *)(iVar6 + 5); bVar8 = bVar4 & 2; lVar16 = ogg_page_granulepos(in_EDX); iVar11 = *(int *)(iVar6 + 0xe); iVar7 = *(int *)(iVar6 + 0x12); uVar9 = (uint)*(byte *)(iVar6 + 0x1a); if ((in_ECX != (int *)0x0) && (_Dst = (void *)*in_ECX, _Dst != (void *)0x0)) { iVar10 = in_ECX[3]; iVar14 = in_ECX[9]; if (iVar10 != 0) { piVar1 = in_ECX + 2; *piVar1 = *piVar1 - iVar10; if (*piVar1 != 0) { memmove(_Dst,(void *)(iVar10 + (int)_Dst),in_ECX[2]); } in_ECX[3] = 0; } if (iVar14 != 0) { iVar10 = in_ECX[7]; if (iVar10 - iVar14 != 0) { memmove((void *)in_ECX[4],(void *)(in_ECX[4] + iVar14 * 4),(iVar10 - iVar14) * 4); memmove((void *)in_ECX[5],(void *)(in_ECX[5] + iVar14 * 8),(in_ECX[7] - iVar14) * 8); iVar10 = in_ECX[7]; } in_ECX[9] = 0; in_ECX[8] = in_ECX[8] - iVar14; in_ECX[7] = iVar10 - iVar14; } if (((iVar11 == in_ECX[0x54]) && (cVar3 == '\0')) && (iVar11 = FUN_00aac040(), iVar11 == 0)) { iVar11 = in_ECX[0x55]; if (iVar7 != iVar11) { iVar10 = in_ECX[8]; if (iVar10 < in_ECX[7]) { iVar11 = in_ECX[2]; iVar14 = in_ECX[7] - iVar10; pbVar13 = (byte *)(in_ECX[4] + iVar10 * 4); do { bVar5 = *pbVar13; pbVar13 = pbVar13 + 4; iVar11 = iVar11 - (uint)bVar5; in_ECX[2] = iVar11; iVar14 = iVar14 + -1; } while (iVar14 != 0); iVar11 = in_ECX[0x55]; } in_ECX[7] = iVar10; if (iVar11 != -1) { *(undefined4 *)(in_ECX[4] + iVar10 * 4) = 0x400; in_ECX[7] = in_ECX[7] + 1; in_ECX[8] = in_ECX[8] + 1; } } if ((((bVar4 & 1) != 0) && ((in_ECX[7] < 1 || (*(int *)(in_ECX[4] + -4 + in_ECX[7] * 4) == 0x400)))) && (bVar8 = 0, uVar9 != 0)) { do { uVar12 = (uint)*(byte *)(iVar15 + 0x1b + iVar6); iVar15 = iVar15 + 1; local_30 = (void *)((int)local_30 + uVar12); _Size = _Size - uVar12; if (uVar12 < 0xff) break; } while (iVar15 < (int)uVar9); } if (_Size != 0) { iVar11 = FUN_00aabfb0(); if (iVar11 != 0) { return 0xffffffff; } memcpy((void *)(in_ECX[2] + *in_ECX),local_30,_Size); in_ECX[2] = in_ECX[2] + _Size; } local_30 = (void *)0xffffffff; if (iVar15 < (int)uVar9) { iVar11 = in_ECX[7]; do { bVar5 = *(byte *)(iVar6 + 0x1b + iVar15); *(uint *)(in_ECX[4] + iVar11 * 4) = (uint)bVar5; iVar11 = in_ECX[5]; iVar10 = in_ECX[7]; *(undefined4 *)(iVar11 + iVar10 * 8) = 0xffffffff; *(undefined4 *)(iVar11 + 4 + iVar10 * 8) = 0xffffffff; if (bVar8 != 0) { puVar2 = (uint *)(in_ECX[4] + in_ECX[7] * 4); *puVar2 = *puVar2 | 0x100; bVar8 = 0; } iVar15 = iVar15 + 1; if (bVar5 == 0xff) { iVar11 = in_ECX[7] + 1; in_ECX[7] = iVar11; } else { local_30 = (void *)in_ECX[7]; iVar11 = (int)local_30 + 1; in_ECX[7] = iVar11; in_ECX[8] = iVar11; } } while (iVar15 < (int)uVar9); if (local_30 != (void *)0xffffffff) { iVar6 = in_ECX[5]; local_14 = (undefined4)lVar16; *(undefined4 *)(iVar6 + (int)local_30 * 8) = local_14; local_10 = (undefined4)((ulonglong)lVar16 >> 0x20); *(undefined4 *)(iVar6 + 4 + (int)local_30 * 8) = local_10; } } if ((bVar4 & 4) != 0) { in_ECX[0x52] = 1; if (0 < in_ECX[7]) { puVar2 = (uint *)(in_ECX[4] + -4 + in_ECX[7] * 4); *puVar2 = *puVar2 | 0x200; } } in_ECX[0x55] = iVar7 + 1; return 0; } } return 0xffffffff; } //@@ 00aac8f0 ogg_stream_reset /* DB: libogg: returns -1 if !os || !os->body_data, zeroes body_fill/returned, lacing_fill/packet/returned, header_fill, e_o_s, b_o_s, pageno=-1 (+0x154), packetno/granulepos 64-bit zero */ undefined4 ogg_stream_reset(void) { int *in_ECX; if ((in_ECX == (int *)0x0) || (*in_ECX == 0)) { return 0xffffffff; } in_ECX[2] = 0; in_ECX[3] = 0; in_ECX[7] = 0; in_ECX[8] = 0; in_ECX[9] = 0; in_ECX[0x51] = 0; in_ECX[0x52] = 0; in_ECX[0x53] = 0; in_ECX[0x55] = -1; in_ECX[0x56] = 0; in_ECX[0x57] = 0; in_ECX[0x58] = 0; in_ECX[0x59] = 0; return 0; } //@@ 00aac980 ogg_stream_packetout /* DB: libogg _packetout: ECX = ogg_stream_state, EDX = ogg_packet; lacing value flags 0x400 (hole -> packetno++, return -1), 0x200 eos, 0x100 bos, sums 0xff continuation segments, fills packet/granulepos/packetno; caller loops while < 0 before th_decode_packetin (VideoClip_Theora::readTheoraVorbisHeaders) prototype: db/protos.zhl */ int __fastcall ogg_stream_packetout(void *streamState,void *packet) { uint *puVar1; uint uVar2; undefined4 uVar3; uint uVar4; int iVar5; int iVar6; uint uVar7; uint local_8; iVar6 = *(int *)((int)streamState + 0x24); if (*(int *)((int)streamState + 0x20) <= iVar6) { return 0; } uVar2 = *(uint *)(*(int *)((int)streamState + 0x10) + iVar6 * 4); iVar5 = *(int *)((int)streamState + 0x10) + iVar6 * 4; if ((uVar2 & 0x400) != 0) { puVar1 = (uint *)((int)streamState + 0x158); uVar2 = *puVar1; *puVar1 = *puVar1 + 1; *(int *)((int)streamState + 0x15c) = *(int *)((int)streamState + 0x15c) + (uint)(0xfffffffe < uVar2); *(int *)((int)streamState + 0x24) = iVar6 + 1; return -1; } local_8 = uVar2 & 0xff; uVar7 = uVar2 & 0x200; if (local_8 == 0xff) { local_8 = 0xff; do { puVar1 = (uint *)(iVar5 + 4); iVar5 = iVar5 + 4; iVar6 = iVar6 + 1; uVar4 = *puVar1 & 0xff; if ((*puVar1 & 0x200) != 0) { uVar7 = 0x200; } local_8 = local_8 + uVar4; } while (uVar4 == 0xff); } if (packet != (void *)0x0) { *(uint *)((int)packet + 0xc) = uVar7; *(uint *)((int)packet + 8) = uVar2 & 0x100; *(int *)packet = *(int *)((int)streamState + 0xc) + *(int *)streamState; uVar3 = *(undefined4 *)((int)streamState + 0x15c); *(undefined4 *)((int)packet + 0x18) = *(undefined4 *)((int)streamState + 0x158); *(undefined4 *)((int)packet + 0x1c) = uVar3; uVar3 = *(undefined4 *)(*(int *)((int)streamState + 0x14) + iVar6 * 8); *(undefined4 *)((int)packet + 0x14) = *(undefined4 *)(*(int *)((int)streamState + 0x14) + 4 + iVar6 * 8); *(undefined4 *)((int)packet + 0x10) = uVar3; *(uint *)((int)packet + 4) = local_8; } *(int *)((int)streamState + 0xc) = *(int *)((int)streamState + 0xc) + local_8; puVar1 = (uint *)((int)streamState + 0x158); uVar2 = *puVar1; *puVar1 = *puVar1 + 1; *(int *)((int)streamState + 0x15c) = *(int *)((int)streamState + 0x15c) + (uint)(0xfffffffe < uVar2); *(int *)((int)streamState + 0x24) = iVar6 + 1; return 1; } //@@ 00aaca80 FUN_00aaca80 int FUN_00aaca80(void) { undefined4 *puVar1; void *pvVar2; int in_ECX; int iVar3; int in_EDX; uint _Size; _Size = in_EDX + 7U & 0xfffffff8; iVar3 = *(int *)(in_ECX + 0x48); if (*(int *)(in_ECX + 0x4c) < (int)(iVar3 + _Size)) { if (*(int *)(in_ECX + 0x44) != 0) { puVar1 = malloc(8); *(int *)(in_ECX + 0x50) = *(int *)(in_ECX + 0x50) + *(int *)(in_ECX + 0x48); puVar1[1] = *(undefined4 *)(in_ECX + 0x54); *puVar1 = *(undefined4 *)(in_ECX + 0x44); *(undefined4 **)(in_ECX + 0x54) = puVar1; } *(uint *)(in_ECX + 0x4c) = _Size; pvVar2 = malloc(_Size); *(void **)(in_ECX + 0x44) = pvVar2; iVar3 = 0; } *(uint *)(in_ECX + 0x48) = iVar3 + _Size; return *(int *)(in_ECX + 0x44) + iVar3; } //@@ 00aacae0 FUN_00aacae0 void FUN_00aacae0(void) { undefined8 *puVar1; undefined8 *_Memory; void *pvVar2; int in_ECX; _Memory = *(undefined8 **)(in_ECX + 0x54); while (_Memory != (undefined8 *)0x0) { puVar1 = *(undefined8 **)((int)_Memory + 4); free(*(void **)_Memory); *_Memory = 0; free(_Memory); _Memory = puVar1; } if (*(int *)(in_ECX + 0x50) != 0) { pvVar2 = realloc(*(void **)(in_ECX + 0x44),*(int *)(in_ECX + 0x4c) + *(int *)(in_ECX + 0x50)); *(void **)(in_ECX + 0x44) = pvVar2; *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + *(int *)(in_ECX + 0x50); *(undefined4 *)(in_ECX + 0x50) = 0; } *(undefined4 *)(in_ECX + 0x54) = 0; *(undefined4 *)(in_ECX + 0x48) = 0; return; } //@@ 00aacb50 _vds_shared_init /* DB: libvorbis block.c: memset(v,0,0x70), backend calloc(0x88), modebits=ilog2(ci->modes), transform calloc+mdct_init x2, window ilog2(blocksizes)-6, fullbooks calloc(books,0x38)+vorbis_book_init_decode with vorbis_dsp_clear/-1 on failure, pcm arrays, floor/residue look via _floor_P/_residue_P tables; returns 1 when codec_setup NULL; caller then calls vorbis_synthesis_restart (vorbis_synthesis_init inlined into VideoClip_Theora::_load) */ undefined4 _vds_shared_init(void) { int *piVar1; undefined4 *puVar2; void *pvVar3; void *pvVar4; undefined4 uVar5; void *in_ECX; int in_EDX; uint uVar6; int iVar7; int iVar8; int *piVar9; int local_20; int *local_1c; int local_18; int *local_14; int local_10; piVar1 = *(int **)(in_EDX + 0x1c); if (piVar1 == (int *)0x0) { return 1; } memset(in_ECX,0,0x70); pvVar3 = calloc(1,0x88); *(int *)((int)in_ECX + 4) = in_EDX; *(void **)((int)in_ECX + 0x68) = pvVar3; iVar8 = 0; uVar6 = piVar1[2] - 1; if (piVar1[2] == 0) { uVar6 = 0; } for (; uVar6 != 0; uVar6 = uVar6 >> 1) { iVar8 = iVar8 + 1; } *(int *)((int)pvVar3 + 0x2c) = iVar8; pvVar4 = calloc(1,4); *(void **)((int)pvVar3 + 0xc) = pvVar4; pvVar4 = calloc(1,4); *(void **)((int)pvVar3 + 0x10) = pvVar4; pvVar4 = calloc(1,0x14); **(undefined4 **)((int)pvVar3 + 0xc) = pvVar4; pvVar4 = calloc(1,0x14); **(undefined4 **)((int)pvVar3 + 0x10) = pvVar4; mdct_init(); mdct_init(); iVar8 = 0; uVar6 = *piVar1 - 1; if (*piVar1 == 0) { uVar6 = 0; } for (; uVar6 != 0; uVar6 = uVar6 >> 1) { iVar8 = iVar8 + 1; } iVar7 = 0; *(int *)((int)pvVar3 + 4) = iVar8 + -6; uVar6 = piVar1[1] - 1; if (piVar1[1] == 0) { uVar6 = 0; } for (; uVar6 != 0; uVar6 = uVar6 >> 1) { iVar7 = iVar7 + 1; } *(int *)((int)pvVar3 + 8) = iVar7 + -6; if (piVar1[0x2c8] == 0) { pvVar4 = calloc(piVar1[6],0x38); piVar1[0x2c8] = (int)pvVar4; local_20 = 0; if (0 < piVar1[6]) { local_14 = piVar1 + 0x1c8; local_1c = local_14; do { if ((*local_1c == 0) || (iVar8 = vorbis_book_init_decode(), iVar8 != 0)) { local_18 = 0; if (0 < piVar1[6]) { do { puVar2 = (undefined4 *)*local_14; if (puVar2 != (undefined4 *)0x0) { if (puVar2[9] != 0) { if ((void *)puVar2[8] != (void *)0x0) { free((void *)puVar2[8]); } if ((void *)puVar2[2] != (void *)0x0) { free((void *)puVar2[2]); } *puVar2 = 0; puVar2[1] = 0; puVar2[2] = 0; puVar2[3] = 0; puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0; puVar2[7] = 0; *(undefined8 *)(puVar2 + 8) = 0; free(puVar2); } *local_14 = 0; } local_18 = local_18 + 1; local_14 = local_14 + 1; } while (local_18 < piVar1[6]); } vorbis_dsp_clear(in_ECX); return 0xffffffff; } puVar2 = (undefined4 *)*local_1c; if (puVar2[9] != 0) { if ((void *)puVar2[8] != (void *)0x0) { free((void *)puVar2[8]); } if ((void *)puVar2[2] != (void *)0x0) { free((void *)puVar2[2]); } *puVar2 = 0; puVar2[1] = 0; puVar2[2] = 0; puVar2[3] = 0; puVar2[4] = 0; puVar2[5] = 0; puVar2[6] = 0; puVar2[7] = 0; *(undefined8 *)(puVar2 + 8) = 0; free(puVar2); } local_20 = local_20 + 1; *local_1c = 0; local_1c = local_1c + 1; } while (local_20 < piVar1[6]); } } *(int *)((int)in_ECX + 0x10) = piVar1[1]; pvVar4 = malloc(*(int *)(in_EDX + 4) << 2); *(void **)((int)in_ECX + 8) = pvVar4; pvVar4 = malloc(*(int *)(in_EDX + 4) << 2); *(void **)((int)in_ECX + 0xc) = pvVar4; iVar8 = 0; if (0 < *(int *)(in_EDX + 4)) { do { pvVar4 = calloc(*(size_t *)((int)in_ECX + 0x10),4); *(void **)(*(int *)((int)in_ECX + 8) + iVar8 * 4) = pvVar4; iVar8 = iVar8 + 1; } while (iVar8 < *(int *)(in_EDX + 4)); } *(undefined4 *)((int)in_ECX + 0x24) = 0; *(undefined4 *)((int)in_ECX + 0x28) = 0; iVar8 = piVar1[1]; *(int *)((int)in_ECX + 0x30) = iVar8 / 2; *(int *)((int)in_ECX + 0x14) = iVar8 / 2; pvVar4 = calloc(piVar1[4],4); *(void **)((int)pvVar3 + 0x30) = pvVar4; pvVar4 = calloc(piVar1[5],4); *(void **)((int)pvVar3 + 0x34) = pvVar4; local_10 = 0; if (0 < piVar1[4]) { piVar9 = piVar1 + 200; do { uVar5 = (**(code **)((&PTR_DAT_00b4f938)[*piVar9] + 8))(in_ECX,piVar9[0x40]); piVar9 = piVar9 + 1; *(undefined4 *)((*(int *)((int)pvVar3 + 0x30) - (int)piVar1) + -0x324 + (int)piVar9) = uVar5; local_10 = local_10 + 1; } while (local_10 < piVar1[4]); } local_10 = 0; if (0 < piVar1[5]) { piVar9 = piVar1 + 0x148; do { uVar5 = (**(code **)((&PTR_DAT_00b4f7b4)[*piVar9] + 8))(in_ECX,piVar9[0x40]); piVar9 = piVar9 + 1; *(undefined4 *)((*(int *)((int)pvVar3 + 0x34) - (int)piVar1) + -0x524 + (int)piVar9) = uVar5; local_10 = local_10 + 1; } while (local_10 < piVar1[5]); } return 0; } //@@ 00aacf20 vorbis_dsp_clear /* DB: libvorbis: frees the backend_state (+0x68): envelope lookup (7 band window buffers stride 0x10 = VE_BANDS), mdct/fft lookups, window and residue/floor state, memsets the private state (0xb4) ; callers KAGE_Audio::open_sound_file, theora/vorbis video teardown prototype: db/protos.zhl */ void __fastcall vorbis_dsp_clear(void *dspState) { int iVar1; undefined4 *puVar2; int iVar3; int iVar4; void *pvVar5; undefined4 *puVar6; int iVar7; int iVar8; code *pcVar9; int local_20; int local_1c; int local_10; int local_8; pcVar9 = free_exref; if (dspState != (void *)0x0) { iVar1 = *(int *)((int)dspState + 4); if (iVar1 == 0) { local_8 = 0; } else { local_8 = *(int *)(iVar1 + 0x1c); } puVar2 = *(undefined4 **)((int)dspState + 0x68); if (puVar2 != (undefined4 *)0x0) { pvVar5 = (void *)*puVar2; if (pvVar5 != (void *)0x0) { if ((undefined4 *)((int)pvVar5 + 0x10) != (undefined4 *)0x0) { if (*(void **)((int)pvVar5 + 0x18) != (void *)0x0) { free(*(void **)((int)pvVar5 + 0x18)); } if (*(void **)((int)pvVar5 + 0x1c) != (void *)0x0) { free(*(void **)((int)pvVar5 + 0x1c)); } *(undefined4 *)((int)pvVar5 + 0x10) = 0; *(undefined4 *)((int)pvVar5 + 0x14) = 0; *(undefined4 *)((int)pvVar5 + 0x18) = 0; *(undefined4 *)((int)pvVar5 + 0x1c) = 0; *(undefined4 *)((int)pvVar5 + 0x20) = 0; } puVar6 = (undefined4 *)((int)pvVar5 + 0x30); iVar4 = 7; do { free((void *)*puVar6); puVar6 = puVar6 + 4; iVar4 = iVar4 + -1; } while (iVar4 != 0); free(*(void **)((int)pvVar5 + 0x24)); free(*(void **)((int)pvVar5 + 0x98)); free(*(void **)((int)pvVar5 + 0xa0)); memset(pvVar5,0,0xb4); free((void *)*puVar2); } if ((undefined4 *)puVar2[3] != (undefined4 *)0x0) { puVar6 = *(undefined4 **)puVar2[3]; if (puVar6 != (undefined4 *)0x0) { if ((void *)puVar6[2] != (void *)0x0) { free((void *)puVar6[2]); } if ((void *)puVar6[3] != (void *)0x0) { free((void *)puVar6[3]); } *puVar6 = 0; puVar6[1] = 0; puVar6[2] = 0; puVar6[3] = 0; puVar6[4] = 0; } free(*(void **)puVar2[3]); free((void *)puVar2[3]); } if ((undefined4 *)puVar2[4] != (undefined4 *)0x0) { puVar6 = *(undefined4 **)puVar2[4]; if (puVar6 != (undefined4 *)0x0) { if ((void *)puVar6[2] != (void *)0x0) { free((void *)puVar6[2]); } if ((void *)puVar6[3] != (void *)0x0) { free((void *)puVar6[3]); } *puVar6 = 0; puVar6[1] = 0; puVar6[2] = 0; puVar6[3] = 0; puVar6[4] = 0; } free(*(void **)puVar2[4]); free((void *)puVar2[4]); } iVar4 = puVar2[0xc]; if (iVar4 != 0) { if (local_8 != 0) { iVar7 = 0; if (0 < *(int *)(local_8 + 0x10)) { do { (**(code **)((&PTR_DAT_00b4f938)[*(int *)(local_8 + 800 + iVar7 * 4)] + 0x10)) (*(undefined4 *)(puVar2[0xc] + iVar7 * 4)); iVar7 = iVar7 + 1; } while (iVar7 < *(int *)(local_8 + 0x10)); iVar4 = puVar2[0xc]; pcVar9 = free_exref; } } (*pcVar9)(iVar4); } iVar4 = puVar2[0xd]; if (iVar4 != 0) { if (local_8 != 0) { iVar7 = 0; if (0 < *(int *)(local_8 + 0x14)) { do { (**(code **)((&PTR_DAT_00b4f7b4)[*(int *)(local_8 + 0x520 + iVar7 * 4)] + 0x10)) (*(undefined4 *)(puVar2[0xd] + iVar7 * 4)); iVar7 = iVar7 + 1; } while (iVar7 < *(int *)(local_8 + 0x14)); iVar4 = puVar2[0xd]; pcVar9 = free_exref; } } (*pcVar9)(iVar4); } if (puVar2[0xe] != 0) { if ((local_8 != 0) && (local_1c = 0, 0 < *(int *)(local_8 + 0x1c))) { local_20 = 0; do { pvVar5 = (void *)(puVar2[0xe] + local_20); if (pvVar5 != (void *)0x0) { if (*(int *)((int)pvVar5 + 0x10) != 0) { (*pcVar9)(*(int *)((int)pvVar5 + 0x10)); } if (*(int *)((int)pvVar5 + 0x14) != 0) { (*pcVar9)(*(int *)((int)pvVar5 + 0x14)); } if (*(int *)((int)pvVar5 + 0x18) != 0) { (*pcVar9)(*(int *)((int)pvVar5 + 0x18)); } if (*(int *)((int)pvVar5 + 8) != 0) { local_10 = 0; do { iVar4 = 0; do { (*pcVar9)(*(undefined4 *) (*(int *)(*(int *)((int)pvVar5 + 8) + local_10) + iVar4)); iVar4 = iVar4 + 4; } while (iVar4 < 0x20); (*pcVar9)(*(undefined4 *)(*(int *)((int)pvVar5 + 8) + local_10)); local_10 = local_10 + 4; } while (local_10 < 0x44); (*pcVar9)(*(undefined4 *)((int)pvVar5 + 8)); } if (*(int *)((int)pvVar5 + 0xc) != 0) { iVar4 = 0; do { (*pcVar9)(*(undefined4 *)(*(int *)((int)pvVar5 + 0xc) + iVar4)); iVar4 = iVar4 + 4; } while (iVar4 < 0xc); (*pcVar9)(*(undefined4 *)((int)pvVar5 + 0xc)); } memset(pvVar5,0,0x34); } local_1c = local_1c + 1; local_20 = local_20 + 0x34; } while (local_1c < *(int *)(local_8 + 0x1c)); } (*pcVar9)(puVar2[0xe]); } puVar6 = (undefined4 *)puVar2[0xf]; if (puVar6 != (undefined4 *)0x0) { *puVar6 = 0; puVar6[1] = 0; puVar6[2] = 0; puVar6[3] = 0; puVar6[4] = 0; puVar6[5] = 0; puVar6[6] = 0; puVar6[7] = 0; puVar6[8] = 0; (*pcVar9)(puVar6); } memset(puVar2 + 0x14,0,0x30); if ((undefined8 *)(puVar2 + 5) != (undefined8 *)0x0) { if (puVar2[6] != 0) { (*pcVar9)(puVar2[6]); } if (puVar2[7] != 0) { (*pcVar9)(puVar2[7]); } *(undefined8 *)(puVar2 + 5) = 0; puVar2[7] = 0; } if ((undefined8 *)(puVar2 + 8) != (undefined8 *)0x0) { if (puVar2[9] != 0) { (*pcVar9)(puVar2[9]); } if (puVar2[10] != 0) { (*pcVar9)(puVar2[10]); } *(undefined8 *)(puVar2 + 8) = 0; puVar2[10] = 0; } } iVar4 = *(int *)((int)dspState + 8); if (iVar4 != 0) { iVar7 = iVar4; if ((iVar1 != 0) && (iVar8 = 0, 0 < *(int *)(iVar1 + 4))) { do { iVar3 = *(int *)(iVar4 + iVar8 * 4); if (iVar3 != 0) { (*pcVar9)(iVar3); iVar4 = *(int *)((int)dspState + 8); iVar7 = iVar4; } iVar8 = iVar8 + 1; } while (iVar8 < *(int *)(iVar1 + 4)); } (*pcVar9)(iVar7); if (*(int *)((int)dspState + 0xc) != 0) { (*pcVar9)(*(int *)((int)dspState + 0xc)); } } if (puVar2 != (undefined4 *)0x0) { if (puVar2[0x10] != 0) { (*pcVar9)(puVar2[0x10]); } if (puVar2[0x11] != 0) { (*pcVar9)(puVar2[0x11]); } if (puVar2[0x12] != 0) { (*pcVar9)(puVar2[0x12]); } (*pcVar9)(puVar2); } memset(dspState,0,0x70); } return; } //@@ 00aad330 vorbis_synthesis_restart /* DB: libvorbis: reads halfrate_flag (+0xe48), sets centerW/pcm_current, pcm_returned/granulepos/sequence = -1 (was AudioStream::reset) */ undefined4 vorbis_synthesis_restart(void) { int iVar1; undefined4 uVar2; byte bVar3; int in_ECX; int iVar4; iVar1 = *(int *)(in_ECX + 0x68); if (((iVar1 == 0) || (*(int *)(in_ECX + 4) == 0)) || (iVar4 = *(int *)(*(int *)(in_ECX + 4) + 0x1c), iVar4 == 0)) { return 0xffffffff; } uVar2 = *(undefined4 *)(iVar4 + 0xe48); iVar4 = *(int *)(iVar4 + 4); *(undefined4 *)(in_ECX + 0x18) = 0xffffffff; *(undefined4 *)(in_ECX + 0x38) = 0xffffffff; bVar3 = (byte)uVar2; *(undefined4 *)(in_ECX + 0x3c) = 0xffffffff; iVar4 = iVar4 >> (bVar3 + 1 & 0x1f); *(int *)(in_ECX + 0x30) = iVar4; *(int *)(in_ECX + 0x14) = iVar4 >> (bVar3 & 0x1f); *(undefined4 *)(in_ECX + 0x40) = 0xffffffff; *(undefined4 *)(in_ECX + 0x44) = 0xffffffff; *(undefined4 *)(in_ECX + 0x20) = 0; *(undefined4 *)(iVar1 + 0x80) = 0xffffffff; *(undefined4 *)(iVar1 + 0x84) = 0xffffffff; return 0; } //@@ 00aad3b0 vorbis_synthesis_blockin /* DB: libvorbis: v->lW = v->W; v->W = vb->W (edx[7]); v->nW = -1; vb->granulepos edx[0xe..0xf]; v->granulepos/sequence = -1 */ undefined4 vorbis_synthesis_blockin(void) { uint *puVar1; float *pfVar2; float fVar3; int *piVar4; undefined *puVar5; byte bVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; uint uVar14; uint uVar15; byte bVar16; int in_ECX; float *pfVar17; float *pfVar18; float *pfVar19; undefined4 *puVar20; int *in_EDX; undefined4 *puVar21; int iVar22; int iVar23; int iVar24; int iVar25; uint uVar26; int iVar27; uint uVar28; int iVar29; int local_54; int iStack_50; int local_20; int local_1c; iVar29 = *(int *)(in_ECX + 4); piVar4 = *(int **)(iVar29 + 0x1c); iVar22 = *(int *)(in_ECX + 0x68); iVar13 = piVar4[0x392]; if ((in_EDX == (int *)0x0) || ((*(int *)(in_ECX + 0x18) < *(int *)(in_ECX + 0x14) && (*(int *)(in_ECX + 0x18) != -1)))) { return 0xffffff7d; } uVar15 = *(uint *)(in_ECX + 0x40); *(undefined4 *)(in_ECX + 0x24) = *(undefined4 *)(in_ECX + 0x28); *(int *)(in_ECX + 0x28) = in_EDX[7]; *(undefined4 *)(in_ECX + 0x2c) = 0xffffffff; if ((uVar15 & *(uint *)(in_ECX + 0x44)) != 0xffffffff) { iVar12 = in_EDX[0xe]; iVar7 = in_EDX[0xf]; if ((uVar15 + 1 == iVar12) && (*(uint *)(in_ECX + 0x44) + (uint)(0xfffffffe < uVar15) == iVar7)) goto LAB_00aad458; } *(undefined4 *)(in_ECX + 0x38) = 0xffffffff; *(undefined4 *)(in_ECX + 0x3c) = 0xffffffff; *(undefined4 *)(iVar22 + 0x80) = 0xffffffff; *(undefined4 *)(iVar22 + 0x84) = 0xffffffff; iVar12 = in_EDX[0xe]; iVar7 = in_EDX[0xf]; LAB_00aad458: *(int *)(in_ECX + 0x40) = iVar12; *(int *)(in_ECX + 0x44) = iVar7; bVar6 = (byte)iVar13; if (*in_EDX != 0) { bVar16 = bVar6 + 1; iVar8 = piVar4[*(int *)(in_ECX + 0x28)] >> (bVar16 & 0x1f); iVar9 = *piVar4 >> (bVar16 & 0x1f); iVar10 = piVar4[1] >> (bVar16 & 0x1f); uVar14 = in_EDX[0x16]; puVar1 = (uint *)(in_ECX + 0x48); uVar15 = *puVar1; *puVar1 = *puVar1 + uVar14; *(int *)(in_ECX + 0x4c) = *(int *)(in_ECX + 0x4c) + ((int)uVar14 >> 0x1f) + (uint)CARRY4(uVar15,uVar14); uVar14 = in_EDX[0x17]; puVar1 = (uint *)(in_ECX + 0x50); uVar15 = *puVar1; *puVar1 = *puVar1 + uVar14; *(int *)(in_ECX + 0x54) = *(int *)(in_ECX + 0x54) + ((int)uVar14 >> 0x1f) + (uint)CARRY4(uVar15,uVar14); uVar14 = in_EDX[0x18]; puVar1 = (uint *)(in_ECX + 0x58); uVar15 = *puVar1; *puVar1 = *puVar1 + uVar14; *(int *)(in_ECX + 0x5c) = *(int *)(in_ECX + 0x5c) + ((int)uVar14 >> 0x1f) + (uint)CARRY4(uVar15,uVar14); uVar14 = in_EDX[0x19]; puVar1 = (uint *)(in_ECX + 0x60); uVar15 = *puVar1; *puVar1 = *puVar1 + uVar14; *(int *)(in_ECX + 100) = *(int *)(in_ECX + 100) + ((int)uVar14 >> 0x1f) + (uint)CARRY4(uVar15,uVar14); iVar12 = *(int *)(in_ECX + 0x30); iVar7 = 0; if (iVar12 == 0) { iVar7 = iVar10; } local_20 = 0; iVar11 = iVar10; if (iVar12 == 0) { iVar11 = 0; } if (0 < *(int *)(iVar29 + 4)) { do { if (*(int *)(in_ECX + 0x24) == 0) { puVar5 = (&PTR_DAT_00b5dd40)[*(int *)(iVar22 + 4) - iVar13]; pfVar17 = (float *)(*(int *)(*(int *)(in_ECX + 8) + local_20 * 4) + iVar7 * 4); iVar12 = *(int *)(*in_EDX + local_20 * 4); if (*(int *)(in_ECX + 0x28) == 0) { if (0 < iVar9) { pfVar19 = (float *)(puVar5 + (iVar9 + -1) * 4); iVar27 = (int)puVar5 - (int)pfVar17; iVar24 = iVar9; do { fVar3 = *pfVar19; pfVar18 = (float *)(iVar27 + (int)pfVar17); pfVar19 = pfVar19 + -1; *pfVar17 = *(float *)((int)pfVar18 + (iVar12 - (int)puVar5)) * *pfVar18 + fVar3 * *pfVar17; pfVar17 = pfVar17 + 1; iVar24 = iVar24 + -1; } while (iVar24 != 0); } } else { local_1c = 0; iVar12 = iVar12 + (iVar10 / 2 - iVar9 / 2) * 4; if (0 < iVar9) { pfVar19 = (float *)(puVar5 + (iVar9 + -1) * 4); pfVar18 = pfVar17; iVar24 = iVar9; do { fVar3 = *pfVar19; pfVar2 = (float *)(((int)puVar5 - (int)pfVar17) + (int)pfVar18); pfVar19 = pfVar19 + -1; *pfVar18 = *(float *)((int)pfVar2 + (iVar12 - (int)puVar5)) * *pfVar2 + fVar3 * *pfVar18; pfVar18 = pfVar18 + 1; iVar24 = iVar24 + -1; local_1c = iVar9; } while (iVar24 != 0); } iVar24 = iVar9 / 2 + iVar10 / 2; if (local_1c < iVar24) { if (3 < iVar24 - local_1c) { iVar27 = local_1c + 3; iVar25 = local_1c + 1; iVar23 = ((iVar24 - local_1c) - 4U >> 2) + 1; local_1c = local_1c + iVar23 * 4; pfVar19 = pfVar17 + iVar25; pfVar18 = (float *)(iVar12 + iVar27 * 4); do { pfVar19[-1] = pfVar18[-3]; *pfVar19 = *(float *)((iVar12 - (int)pfVar17) + -0x10 + (int)(pfVar19 + 4)); pfVar19[1] = pfVar18[-1]; pfVar19[2] = *pfVar18; iVar23 = iVar23 + -1; pfVar19 = pfVar19 + 4; pfVar18 = pfVar18 + 4; } while (iVar23 != 0); if (iVar24 <= local_1c) goto LAB_00aad76a; } iVar24 = iVar24 - local_1c; pfVar19 = pfVar17 + local_1c; do { *pfVar19 = *(float *)((int)pfVar19 + (iVar12 - (int)pfVar17)); iVar24 = iVar24 + -1; pfVar19 = pfVar19 + 1; } while (iVar24 != 0); } } } else if (*(int *)(in_ECX + 0x28) == 0) { puVar5 = (&PTR_DAT_00b5dd40)[*(int *)(iVar22 + 4) - iVar13]; pfVar17 = (float *)(*(int *)(*(int *)(in_ECX + 8) + local_20 * 4) + ((iVar10 / 2 - iVar9 / 2) + iVar7) * 4); iVar12 = *(int *)(*in_EDX + local_20 * 4); if (0 < iVar9) { pfVar19 = (float *)(puVar5 + (iVar9 + -1) * 4); iVar27 = (int)puVar5 - (int)pfVar17; iVar24 = iVar9; do { fVar3 = *pfVar19; pfVar18 = (float *)(iVar27 + (int)pfVar17); pfVar19 = pfVar19 + -1; *pfVar17 = *(float *)((int)pfVar18 + (iVar12 - (int)puVar5)) * *pfVar18 + fVar3 * *pfVar17; pfVar17 = pfVar17 + 1; iVar24 = iVar24 + -1; } while (iVar24 != 0); } } else { puVar5 = (&PTR_DAT_00b5dd40)[*(int *)(iVar22 + 8) - iVar13]; pfVar17 = (float *)(*(int *)(*(int *)(in_ECX + 8) + local_20 * 4) + iVar7 * 4); iVar12 = *(int *)(*in_EDX + local_20 * 4); if (0 < iVar10) { pfVar19 = (float *)(puVar5 + (iVar10 + -1) * 4); iVar27 = (int)puVar5 - (int)pfVar17; iVar24 = iVar10; do { fVar3 = *pfVar19; pfVar18 = (float *)(iVar27 + (int)pfVar17); pfVar19 = pfVar19 + -1; *pfVar17 = *(float *)((int)pfVar18 + (iVar12 - (int)puVar5)) * *pfVar18 + fVar3 * *pfVar17; pfVar17 = pfVar17 + 1; iVar24 = iVar24 + -1; } while (iVar24 != 0); } } LAB_00aad76a: iVar24 = *(int *)(*(int *)(in_ECX + 8) + local_20 * 4) + iVar11 * 4; iVar12 = 0; iVar27 = *(int *)(*in_EDX + local_20 * 4) + iVar8 * 4; if (3 < iVar8) { iVar25 = (iVar8 - 4U >> 2) + 1; iVar12 = iVar25 * 4; puVar20 = (undefined4 *)(iVar24 + 4); puVar21 = (undefined4 *)(iVar27 + 0xc); do { puVar20[-1] = puVar21[-3]; *puVar20 = *(undefined4 *)((iVar27 - iVar24) + -0x10 + (int)(puVar20 + 4)); puVar20[1] = puVar21[-1]; puVar20[2] = *puVar21; iVar25 = iVar25 + -1; puVar20 = puVar20 + 4; puVar21 = puVar21 + 4; } while (iVar25 != 0); } if (iVar12 < iVar8) { iVar25 = iVar8 - iVar12; puVar20 = (undefined4 *)(iVar24 + iVar12 * 4); do { *puVar20 = *(undefined4 *)((int)puVar20 + (iVar27 - iVar24)); iVar25 = iVar25 + -1; puVar20 = puVar20 + 1; } while (iVar25 != 0); } local_20 = local_20 + 1; } while (local_20 < *(int *)(iVar29 + 4)); iVar12 = *(int *)(in_ECX + 0x30); } iVar29 = 0; if (iVar12 == 0) { iVar29 = iVar10; } *(int *)(in_ECX + 0x30) = iVar29; if (*(int *)(in_ECX + 0x18) == -1) { *(int *)(in_ECX + 0x18) = iVar11; *(int *)(in_ECX + 0x14) = iVar11; } else { *(int *)(in_ECX + 0x18) = iVar7; *(int *)(in_ECX + 0x14) = (((int)((piVar4[*(int *)(in_ECX + 0x28)] >> 0x1f & 3U) + piVar4[*(int *)(in_ECX + 0x28)]) >> 2) + ((int)(piVar4[*(int *)(in_ECX + 0x24)] + (piVar4[*(int *)(in_ECX + 0x24)] >> 0x1f & 3U)) >> 2) >> (bVar6 & 0x1f)) + iVar7; } } uVar15 = *(uint *)(iVar22 + 0x80); if ((uVar15 & *(uint *)(iVar22 + 0x84)) == 0xffffffff) { iStack_50 = 0; local_54 = 0; } else { uVar14 = ((int)(piVar4[*(int *)(in_ECX + 0x24)] + (piVar4[*(int *)(in_ECX + 0x24)] >> 0x1f & 3U) ) >> 2) + ((int)((piVar4[*(int *)(in_ECX + 0x28)] >> 0x1f & 3U) + piVar4[*(int *)(in_ECX + 0x28)] ) >> 2); local_54 = uVar14 + uVar15; iStack_50 = ((int)uVar14 >> 0x1f) + *(uint *)(iVar22 + 0x84) + (uint)CARRY4(uVar14,uVar15); } *(int *)(iVar22 + 0x80) = local_54; *(int *)(iVar22 + 0x84) = iStack_50; uVar15 = *(uint *)(in_ECX + 0x38); if ((uVar15 & *(uint *)(in_ECX + 0x3c)) == 0xffffffff) { uVar15 = in_EDX[0xc]; uVar14 = in_EDX[0xd]; if ((uVar15 & uVar14) != 0xffffffff) { *(uint *)(in_ECX + 0x38) = uVar15; *(uint *)(in_ECX + 0x3c) = uVar14; if (((int)uVar14 <= *(int *)(iVar22 + 0x84)) && (((int)uVar14 < *(int *)(iVar22 + 0x84) || (uVar15 < *(uint *)(iVar22 + 0x80))))) { iVar29 = *(int *)(in_ECX + 0x14); iVar13 = *(uint *)(iVar22 + 0x80) - in_EDX[0xc]; iVar22 = 0; if (-1 < iVar13) { iVar22 = iVar13; } if (in_EDX[0xb] == 0) { iVar22 = (iVar22 >> (bVar6 & 0x1f)) + *(int *)(in_ECX + 0x18); *(int *)(in_ECX + 0x18) = iVar22; if (iVar29 < iVar22) { *(int *)(in_ECX + 0x18) = iVar29; } } else { iVar13 = iVar29 - *(int *)(in_ECX + 0x18) << (bVar6 & 0x1f); if (iVar22 <= iVar13) { iVar13 = iVar22; } *(int *)(in_ECX + 0x14) = iVar29 - (iVar13 >> (bVar6 & 0x1f)); } } } } else { uVar14 = ((int)(piVar4[*(int *)(in_ECX + 0x24)] + (piVar4[*(int *)(in_ECX + 0x24)] >> 0x1f & 3U) ) >> 2) + ((int)((piVar4[*(int *)(in_ECX + 0x28)] >> 0x1f & 3U) + piVar4[*(int *)(in_ECX + 0x28)] ) >> 2); uVar28 = uVar14 + uVar15; *(uint *)(in_ECX + 0x38) = uVar28; uVar26 = ((int)uVar14 >> 0x1f) + *(int *)(in_ECX + 0x3c) + (uint)CARRY4(uVar14,uVar15); *(uint *)(in_ECX + 0x3c) = uVar26; uVar15 = in_EDX[0xc]; uVar14 = in_EDX[0xd]; if (((uVar15 & uVar14) != 0xffffffff) && ((uVar28 != uVar15 || (uVar26 != uVar14)))) { if (((int)uVar14 <= (int)uVar26) && (((((int)uVar14 < (int)uVar26 || (uVar15 < uVar28)) && (iVar29 = uVar28 - uVar15, iVar29 != 0)) && (in_EDX[0xb] != 0)))) { iVar22 = *(int *)(in_ECX + 0x14) - *(int *)(in_ECX + 0x18) << (bVar6 & 0x1f); if (iVar29 <= iVar22) { iVar22 = iVar29; } iVar29 = 0; if (-1 < iVar22) { iVar29 = iVar22; } *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) - (iVar29 >> (bVar6 & 0x1f)); uVar15 = in_EDX[0xc]; uVar14 = in_EDX[0xd]; } *(uint *)(in_ECX + 0x38) = uVar15; *(uint *)(in_ECX + 0x3c) = uVar14; } } if (in_EDX[0xb] != 0) { *(undefined4 *)(in_ECX + 0x20) = 1; } return 0; } //@@ 00aada30 FUN_00aada30 undefined4 FUN_00aada30(void) { int iVar1; int *piVar2; undefined4 uVar3; int *in_ECX; int *in_EDX; int iVar4; int *piVar5; int iVar6; int local_8; if (in_ECX == (int *)0x0) { iVar1 = 0; LAB_00aada63: iVar6 = 0; iVar4 = 0; } else { iVar1 = in_ECX[0x10]; if (iVar1 == 0) goto LAB_00aada63; iVar4 = *(int *)(iVar1 + 4); iVar6 = *(int *)(iVar1 + 0x68); if (iVar4 != 0) { local_8 = *(int *)(iVar4 + 0x1c); piVar5 = in_ECX + 1; goto LAB_00aada82; } } piVar5 = (int *)(-(uint)(in_ECX != (int *)0x0) & (uint)(in_ECX + 1)); local_8 = 0; if (iVar1 == 0) { return 0xffffff78; } LAB_00aada82: if ((((iVar6 != 0) && (iVar4 != 0)) && (local_8 != 0)) && (piVar5 != (int *)0x0)) { FUN_00aacae0(); *piVar5 = 0; piVar5[1] = 0; piVar5[2] = 0; piVar5[3] = 0; piVar5[4] = 0; iVar1 = *in_EDX; piVar5[3] = iVar1; piVar5[2] = iVar1; piVar5[4] = in_EDX[1]; iVar1 = FUN_00ab7120(); if (iVar1 != 0) { return 0xffffff79; } iVar1 = FUN_00ab7120(); if (iVar1 != -1) { in_ECX[10] = iVar1; piVar2 = (int *)(local_8 + iVar1 * 4 + 0x20); piVar5 = (int *)*piVar2; if (piVar5 != (int *)0x0) { iVar1 = *piVar5; in_ECX[7] = iVar1; if (iVar1 == 0) { in_ECX[6] = 0; in_ECX[8] = 0; iVar1 = 0; } else { iVar1 = FUN_00ab7120(); in_ECX[6] = iVar1; iVar1 = FUN_00ab7120(); in_ECX[8] = iVar1; if (iVar1 == -1) { return 0xffffff78; } iVar1 = in_ECX[7]; } iVar6 = in_EDX[5]; in_ECX[0xc] = in_EDX[4]; in_ECX[0xe] = in_EDX[6]; in_ECX[0xb] = in_EDX[3]; in_ECX[0xd] = iVar6; in_ECX[0xf] = in_EDX[7]; in_ECX[9] = *(int *)(local_8 + iVar1 * 4); iVar1 = FUN_00aaca80(); iVar6 = 0; *in_ECX = iVar1; if (0 < *(int *)(iVar4 + 4)) { do { uVar3 = FUN_00aaca80(); *(undefined4 *)(*in_ECX + iVar6 * 4) = uVar3; iVar6 = iVar6 + 1; } while (iVar6 < *(int *)(iVar4 + 4)); } uVar3 = (**(code **)((&PTR_PTR_00b4f9b4) [*(int *)(local_8 + 0x120 + *(int *)(*piVar2 + 0xc) * 4)] + 0x10))(); return uVar3; } } } return 0xffffff78; } //@@ 00aadbf0 FUN_00aadbf0 void FUN_00aadbf0(undefined4 param_1,undefined4 param_2) { int iVar1; qword qVar2; undefined4 *puVar3; int iVar4; int in_ECX; undefined4 *puVar5; qword *pqVar6; if (g_mainHeap == (void *)0x0) { pqVar6 = &g_allocatedBytesNoHeap; } else { pqVar6 = (qword *)((int)g_mainHeap + 0x30); } puVar3 = malloc(0x10); if (puVar3 == (undefined4 *)0x0) { FUN_00a23200(0x7fcb9dd6); puVar5 = (undefined4 *)0x0; } else { qVar2 = *pqVar6; *(uint *)pqVar6 = (uint)*pqVar6 + 0x10; puVar5 = puVar3 + 1; *puVar3 = 0x10; *(uint *)((int)pqVar6 + 4) = *(uint *)((int)pqVar6 + 4) + (uint)(0xffffffef < (uint)qVar2); } *puVar5 = param_1; puVar5[1] = param_2; iVar1 = *(int *)(in_ECX + 8); puVar5[2] = 0; if (iVar1 == 0) { *(undefined4 **)(in_ECX + 8) = puVar5; return; } do { iVar4 = iVar1; iVar1 = *(int *)(iVar4 + 8); } while (iVar1 != 0); *(undefined4 **)(iVar4 + 8) = puVar5; return; } //@@ 00aadc80 AudioPacketQueue::destroyAllAudioPackets /* DB: ? theoraplayer: walks the list at this+8 freeing node->pcm (tracked new[]) and the 0xc-byte node {pcm, count, next}; callers VideoClip teardown 00a8c7e0 theoraplayer::VideoClip_Theora::~VideoClip_Theora VideoClip_Theora::_executeSeek (audio_stream_seek) */ void AudioPacketQueue::destroyAllAudioPackets(void) { int *ptr; int iVar1; uint uVar2; qword qVar3; void **ppvVar4; int in_ECX; qword *pqVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00af0eb0; ptr = *(int **)(in_ECX + 8); ppvVar4 = &local_10; local_10 = ExceptionList; while (ExceptionList = ppvVar4, ptr != (int *)0x0) { *(int *)(in_ECX + 8) = ptr[2]; iVar1 = *ptr; if (g_mainHeap == (void *)0x0) { pqVar5 = &g_allocatedBytesNoHeap; } else { pqVar5 = (qword *)((int)g_mainHeap + 0x30); } if (iVar1 != 0) { uVar2 = *(uint *)(iVar1 + -4); qVar3 = *pqVar5; *(uint *)pqVar5 = (uint)*pqVar5 - uVar2; *(uint *)((int)pqVar5 + 4) = *(uint *)((int)pqVar5 + 4) - (uint)((uint)qVar3 < uVar2); free((void *)(iVar1 + -4)); } operator_delete(ptr,0xc); ppvVar4 = ExceptionList; ptr = *(int **)(in_ECX + 8); } ExceptionList = local_10; return; } //@@ 00aadd10 epoxy_has_wgl_extension uint epoxy_has_wgl_extension(undefined4 param_1) { code *pcVar1; undefined4 uVar2; uint uVar3; /* 0x6add10 3086 epoxy_has_wgl_extension */ pcVar1 = (code *)(*(code *)epoxy_wglGetProcAddress)("wglGetExtensionsStringARB"); if (pcVar1 == (code *)0x0) { uVar2 = __acrt_iob_func(2, "Implementation unexpectedly missing WGL_ARB_extensions_string. Probably a libepoxy bug.\n" ); uVar3 = FUN_008c5d50(uVar2); return uVar3 & 0xffffff00; } (*pcVar1)(param_1); uVar3 = FUN_00a62620(); return uVar3; } //@@ 00aadd50 FUN_00aadd50 void FUN_00aadd50(void) { /* WARNING: Could not recover jumptable at 0x00aadd54. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c1346c)(); return; } //@@ 00aadd60 FUN_00aadd60 void FUN_00aadd60(void) { /* WARNING: Could not recover jumptable at 0x00aadd64. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c135a0)(); return; } //@@ 00aadd70 FUN_00aadd70 void FUN_00aadd70(void) { /* WARNING: Could not recover jumptable at 0x00aadd74. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c1357c)(); return; } //@@ 00aadd80 FUN_00aadd80 void FUN_00aadd80(void) { /* WARNING: Could not recover jumptable at 0x00aadd84. Too many branches */ /* WARNING: Treating indirect jump as call */ (*(code *)PTR_FUN_00c13488)(); return; } //@@ 00aadd90 FUN_00aadd90 void FUN_00aadd90(undefined4 param_1,size_t param_2,size_t param_3) { calloc(param_2,param_3); return; } //@@ 00aaddb0 FUN_00aaddb0 void FUN_00aaddb0(undefined4 param_1,void *param_2) { free(param_2); return; } //@@ 00aaddd0 FUN_00aaddd0 uint FUN_00aaddd0(uint param_1,byte *param_2,uint param_3) { byte *pbVar1; byte bVar2; uint uVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; uint uVar19; uint uVar20; uVar3 = param_1 & 0xffff; param_1 = param_1 >> 0x10; if (param_2 == (byte *)0x0) { return 1; } while (param_3 != 0) { uVar19 = 0x15b0; if (param_3 < 0x15b0) { uVar19 = param_3; } param_3 = param_3 - uVar19; if (0xf < (int)uVar19) { uVar20 = uVar19 >> 4; uVar19 = uVar19 + uVar20 * -0x10; do { iVar4 = uVar3 + *param_2; iVar5 = iVar4 + (uint)param_2[1]; iVar6 = iVar5 + (uint)param_2[2]; iVar7 = iVar6 + (uint)param_2[3]; iVar8 = iVar7 + (uint)param_2[4]; iVar9 = iVar8 + (uint)param_2[5]; iVar10 = iVar9 + (uint)param_2[6]; iVar11 = iVar10 + (uint)param_2[7]; iVar12 = iVar11 + (uint)param_2[8]; iVar13 = iVar12 + (uint)param_2[9]; iVar14 = iVar13 + (uint)param_2[10]; iVar15 = iVar14 + (uint)param_2[0xb]; iVar16 = iVar15 + (uint)param_2[0xc]; iVar17 = iVar16 + (uint)param_2[0xd]; iVar18 = iVar17 + (uint)param_2[0xe]; pbVar1 = param_2 + 0xf; param_2 = param_2 + 0x10; uVar3 = iVar18 + (uint)*pbVar1; param_1 = param_1 + iVar4 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 + iVar12 + iVar13 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + uVar3; uVar20 = uVar20 - 1; } while (uVar20 != 0); } for (; uVar19 != 0; uVar19 = uVar19 - 1) { bVar2 = *param_2; param_2 = param_2 + 1; uVar3 = uVar3 + bVar2; param_1 = param_1 + uVar3; } uVar3 = uVar3 % 0xfff1; param_1 = param_1 % 0xfff1; } return param_1 << 0x10 | uVar3; } //@@ 00aadf00 FUN_00aadf00 void FUN_00aadf00(void) { undefined2 *puVar1; int in_ECX; int iVar2; iVar2 = 0x11e; puVar1 = (undefined2 *)(in_ECX + 0x8c); do { *puVar1 = 0; iVar2 = iVar2 + -1; puVar1 = puVar1 + 2; } while (iVar2 != 0); iVar2 = 0x1e; puVar1 = (undefined2 *)(in_ECX + 0x980); do { *puVar1 = 0; iVar2 = iVar2 + -1; puVar1 = puVar1 + 2; } while (iVar2 != 0); iVar2 = 0x13; puVar1 = (undefined2 *)(in_ECX + 0xa74); do { *puVar1 = 0; iVar2 = iVar2 + -1; puVar1 = puVar1 + 2; } while (iVar2 != 0); *(undefined4 *)(in_ECX + 0x16a4) = 0; *(undefined4 *)(in_ECX + 0x16a0) = 0; *(undefined4 *)(in_ECX + 0x16a8) = 0; *(undefined4 *)(in_ECX + 0x1698) = 0; *(undefined2 *)(in_ECX + 0x48c) = 1; return; } //@@ 00aadf90 FUN_00aadf90 void FUN_00aadf90(int param_1) { ushort uVar1; ushort uVar2; int iVar3; int iVar4; int iVar5; int in_ECX; int in_EDX; int iVar6; int iVar7; iVar5 = *(int *)(in_ECX + 0x1448); iVar3 = *(int *)(in_ECX + 0xb54 + param_1 * 4); iVar6 = param_1 * 2; if (iVar6 <= iVar5) { do { iVar7 = iVar6; if (iVar6 < iVar5) { iVar5 = *(int *)(in_ECX + 0xb58 + iVar6 * 4); iVar4 = *(int *)(in_ECX + 0xb54 + iVar6 * 4); uVar1 = *(ushort *)(in_EDX + iVar5 * 4); uVar2 = *(ushort *)(in_EDX + iVar4 * 4); if ((uVar1 < uVar2) || ((uVar1 == uVar2 && (*(byte *)(iVar5 + 0x1450 + in_ECX) <= *(byte *)(iVar4 + 0x1450 + in_ECX))))) { iVar7 = iVar6 + 1; } } iVar5 = *(int *)(in_ECX + 0xb54 + iVar7 * 4); uVar1 = *(ushort *)(in_EDX + iVar3 * 4); uVar2 = *(ushort *)(in_EDX + iVar5 * 4); if (uVar1 < uVar2) { *(int *)(in_ECX + 0xb54 + param_1 * 4) = iVar3; return; } if ((uVar1 == uVar2) && (*(byte *)(iVar3 + 0x1450 + in_ECX) <= *(byte *)(iVar5 + 0x1450 + in_ECX))) break; *(int *)(in_ECX + 0xb54 + param_1 * 4) = iVar5; iVar5 = *(int *)(in_ECX + 0x1448); iVar6 = iVar7 * 2; param_1 = iVar7; } while (iVar6 <= iVar5); } *(int *)(in_ECX + 0xb54 + param_1 * 4) = iVar3; return; } //@@ 00aae060 gen_bitlen /* DB: zlib trees.c: only caller build_tree FUN_00aae270 (heap of HEAP_SIZE 573 = 0x23d at s+0xb54, heap_len +0x1448, heap_max +0x144c); clears bl_count[16] (+0xb34), overflow fixup, opt_len (+0x16a0) / static_len (+0x16a4) updates */ void gen_bitlen(void) { short *psVar1; ushort uVar2; short sVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; ushort *puVar9; uint uVar10; int in_ECX; uint uVar11; int *in_EDX; int iVar12; int iVar13; uint uVar14; int iVar15; int *piVar16; int local_28; int *local_24; iVar4 = in_EDX[1]; piVar16 = (int *)in_EDX[2]; iVar5 = *in_EDX; iVar13 = *piVar16; uVar14 = piVar16[4]; iVar6 = piVar16[1]; iVar7 = piVar16[2]; *(undefined4 *)(in_ECX + 0xb34) = 0; *(undefined4 *)(in_ECX + 0xb38) = 0; *(undefined4 *)(in_ECX + 0xb3c) = 0; *(undefined4 *)(in_ECX + 0xb40) = 0; *(undefined4 *)(in_ECX + 0xb44) = 0; *(undefined4 *)(in_ECX + 0xb48) = 0; *(undefined4 *)(in_ECX + 0xb4c) = 0; *(undefined4 *)(in_ECX + 0xb50) = 0; *(undefined2 *)(iVar5 + 2 + *(int *)(in_ECX + 0xb54 + *(int *)(in_ECX + 0x144c) * 4) * 4) = 0; local_28 = *(int *)(in_ECX + 0x144c) + 1; if (local_28 < 0x23d) { local_24 = (int *)(in_ECX + 0xb54 + local_28 * 4); local_28 = 0x23d - local_28; iVar15 = 0; do { iVar8 = *local_24; puVar9 = (ushort *)(iVar8 * 4 + iVar5); uVar11 = *(ushort *)(iVar5 + 2 + (uint)puVar9[1] * 4) + 1; iVar12 = iVar15 + 1; uVar10 = uVar14; if ((int)uVar11 <= (int)uVar14) { iVar12 = iVar15; uVar10 = uVar11; } puVar9[1] = (ushort)uVar10; if (iVar8 <= iVar4) { psVar1 = (short *)(in_ECX + 0xb34 + uVar10 * 2); *psVar1 = *psVar1 + 1; iVar15 = 0; if (iVar7 <= iVar8) { iVar15 = *(int *)(iVar6 + (iVar8 - iVar7) * 4); } uVar2 = *puVar9; *(int *)(in_ECX + 0x16a0) = *(int *)(in_ECX + 0x16a0) + (uVar10 + iVar15) * (uint)uVar2; if (iVar13 != 0) { *(int *)(in_ECX + 0x16a4) = *(int *)(in_ECX + 0x16a4) + ((uint)*(ushort *)(iVar8 * 4 + 2 + iVar13) + iVar15) * (uint)uVar2; } } local_24 = local_24 + 1; local_28 = local_28 + -1; iVar15 = iVar12; } while (local_28 != 0); if (iVar12 != 0) { puVar9 = (ushort *)(in_ECX + (uVar14 + 0x59a) * 2); do { psVar1 = (short *)(in_ECX + (uVar14 + 0x599) * 2); sVar3 = *(short *)(in_ECX + (uVar14 + 0x599) * 2); uVar10 = uVar14; while (uVar10 = uVar10 - 1, sVar3 == 0) { psVar1 = psVar1 + -1; sVar3 = *psVar1; } psVar1 = (short *)(in_ECX + 0xb36 + uVar10 * 2); *psVar1 = *psVar1 + 2; psVar1 = (short *)(in_ECX + 0xb34 + uVar10 * 2); *psVar1 = *psVar1 + -1; iVar12 = iVar12 + -2; *puVar9 = *puVar9 - 1; } while (0 < iVar12); iVar13 = 0x23d; for (; uVar14 != 0; uVar14 = uVar14 - 1) { uVar10 = (uint)*puVar9; if (uVar10 != 0) { piVar16 = (int *)(in_ECX + (iVar13 + 0x2d5) * 4); do { iVar13 = iVar13 + -1; piVar16 = piVar16 + -1; iVar6 = *piVar16; if (iVar6 <= iVar4) { if (*(ushort *)(iVar5 + 2 + iVar6 * 4) != uVar14) { *(int *)(in_ECX + 0x16a0) = *(int *)(in_ECX + 0x16a0) + (uVar14 - *(ushort *)(iVar5 + 2 + iVar6 * 4)) * (uint)*(ushort *)(iVar5 + iVar6 * 4); *(short *)(iVar5 + 2 + iVar6 * 4) = (short)uVar14; } uVar10 = uVar10 - 1; } } while (uVar10 != 0); } puVar9 = puVar9 + -1; } } } return; } //@@ 00aae270 build_tree /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: zlib trees.c: heap_len (+0x1448) = 0, heap_max (+0x144c) = HEAP_SIZE 573 (0x23d), depth[] +0x1450, heap[] +0xb58; called 3 times from _tr_flush_block FUN_00aaeeb0; callees pqdownheap/gen_bitlen */ void build_tree(void) { byte bVar1; short sVar2; int iVar3; undefined4 uVar4; uint uVar5; int iVar6; int iVar7; uint uVar8; uint uVar9; int in_ECX; int iVar10; uint uVar11; ushort uVar12; int *in_EDX; uint uVar13; byte bVar14; short *psVar15; int iVar16; int local_30; int local_2c; ushort auStack_28 [16]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(auStack_28 + 0x12); local_2c = -1; iVar3 = *in_EDX; iVar16 = *(int *)in_EDX[2]; local_30 = ((int *)in_EDX[2])[3]; iVar7 = 0; iVar10 = 0; *(undefined4 *)(in_ECX + 0x1448) = 0; *(undefined4 *)(in_ECX + 0x144c) = 0x23d; if (0 < local_30) { do { if (*(short *)(iVar3 + iVar10 * 4) == 0) { *(undefined2 *)(iVar3 + 2 + iVar10 * 4) = 0; } else { *(int *)(in_ECX + 0x1448) = *(int *)(in_ECX + 0x1448) + 1; *(int *)(in_ECX + 0xb54 + *(int *)(in_ECX + 0x1448) * 4) = iVar10; *(undefined1 *)(in_ECX + 0x1450 + iVar10) = 0; local_2c = iVar10; } iVar10 = iVar10 + 1; } while (iVar10 < local_30); iVar7 = *(int *)(in_ECX + 0x1448); if (1 < iVar7) goto LAB_00aae35d; } do { iVar6 = local_2c + 1; iVar10 = local_2c + 1; if (1 < local_2c) { iVar6 = local_2c; iVar10 = 0; } local_2c = iVar6; *(int *)(in_ECX + 0x1448) = iVar7 + 1; *(int *)(in_ECX + 0xb54 + (iVar7 + 1) * 4) = iVar10; *(undefined2 *)(iVar3 + iVar10 * 4) = 1; *(undefined1 *)(in_ECX + 0x1450 + iVar10) = 0; *(int *)(in_ECX + 0x16a0) = *(int *)(in_ECX + 0x16a0) + -1; if (iVar16 != 0) { *(int *)(in_ECX + 0x16a4) = *(int *)(in_ECX + 0x16a4) - (uint)*(ushort *)(iVar16 + 2 + iVar10 * 4); } iVar7 = *(int *)(in_ECX + 0x1448); } while (iVar7 < 2); LAB_00aae35d: in_EDX[1] = local_2c; for (iVar16 = *(int *)(in_ECX + 0x1448) / 2; 0 < iVar16; iVar16 = iVar16 + -1) { FUN_00aadf90(iVar16); } iVar16 = *(int *)(in_ECX + 0x1448); do { uVar4 = *(undefined4 *)(in_ECX + 0xb54 + iVar16 * 4); iVar7 = *(int *)(in_ECX + 0xb58); *(int *)(in_ECX + 0x1448) = iVar16 + -1; *(undefined4 *)(in_ECX + 0xb58) = uVar4; FUN_00aadf90(1); *(int *)(in_ECX + 0x144c) = *(int *)(in_ECX + 0x144c) + -1; iVar16 = *(int *)(in_ECX + 0xb58); psVar15 = (short *)(iVar3 + iVar16 * 4); *(int *)(in_ECX + 0xb54 + *(int *)(in_ECX + 0x144c) * 4) = iVar7; *(int *)(in_ECX + 0x144c) = *(int *)(in_ECX + 0x144c) + -1; *(int *)(in_ECX + 0xb54 + *(int *)(in_ECX + 0x144c) * 4) = iVar16; *(short *)(iVar3 + local_30 * 4) = *psVar15 + *(short *)(iVar3 + iVar7 * 4); bVar1 = *(byte *)(in_ECX + 0x1450 + iVar16); bVar14 = *(byte *)(in_ECX + 0x1450 + iVar7); if (bVar14 < bVar1) { bVar14 = bVar1; } *(byte *)(in_ECX + 0x1450 + local_30) = bVar14 + 1; psVar15[1] = (short)local_30; *(short *)(iVar3 + 2 + iVar7 * 4) = (short)local_30; *(int *)(in_ECX + 0xb58) = local_30; FUN_00aadf90(1); iVar16 = *(int *)(in_ECX + 0x1448); local_30 = local_30 + 1; } while (1 < iVar16); *(int *)(in_ECX + 0x144c) = *(int *)(in_ECX + 0x144c) + -1; *(undefined4 *)(in_ECX + 0xb54 + *(int *)(in_ECX + 0x144c) * 4) = *(undefined4 *)(in_ECX + 0xb58); gen_bitlen(); uVar12 = 0; psVar15 = (short *)(in_ECX + 0xb34); iVar16 = 1; do { sVar2 = *psVar15; psVar15 = psVar15 + 1; uVar12 = (sVar2 + uVar12) * 2; auStack_28[iVar16] = uVar12; iVar16 = iVar16 + 1; } while (iVar16 < 0x10); iVar16 = 0; if (-1 < local_2c) { do { uVar13 = (uint)*(ushort *)(iVar3 + 2 + iVar16 * 4); if (uVar13 != 0) { uVar8 = (uint)auStack_28[uVar13]; auStack_28[uVar13] = auStack_28[uVar13] + 1; uVar5 = 0; do { uVar9 = uVar5; uVar13 = uVar13 - 1; uVar11 = uVar8 & 1; uVar8 = uVar8 >> 1; uVar5 = (uVar9 | uVar11) * 2; } while (0 < (int)uVar13); *(ushort *)(iVar3 + iVar16 * 4) = (ushort)uVar9 | (ushort)uVar11; } iVar16 = iVar16 + 1; } while (iVar16 <= local_2c); } return; } //@@ 00aae510 FUN_00aae510 void FUN_00aae510(int param_1) { short *psVar1; ushort uVar2; int iVar3; int in_ECX; int in_EDX; int iVar4; uint uVar5; uint uVar6; int iVar7; int local_10; uint local_c; ushort *local_8; local_c = 0xffffffff; uVar2 = *(ushort *)(in_EDX + 2); iVar3 = 0; *(undefined2 *)(in_EDX + 6 + param_1 * 4) = 0xffff; if (-1 < param_1) { iVar7 = 0x8a; if (uVar2 != 0) { iVar7 = 7; } local_8 = (ushort *)(in_EDX + 6); iVar4 = (uVar2 != 0) + 3; local_10 = param_1 + 1; uVar5 = (uint)uVar2; do { iVar3 = iVar3 + 1; uVar6 = (uint)*local_8; if ((iVar7 <= iVar3) || (uVar5 != uVar6)) { if (iVar3 < iVar4) { psVar1 = (short *)(in_ECX + 0xa74 + uVar5 * 4); *psVar1 = *psVar1 + (short)iVar3; } else if (uVar5 == 0) { if (iVar3 < 0xb) { *(short *)(in_ECX + 0xab8) = *(short *)(in_ECX + 0xab8) + 1; } else { *(short *)(in_ECX + 0xabc) = *(short *)(in_ECX + 0xabc) + 1; } } else { if (uVar5 != local_c) { psVar1 = (short *)(in_ECX + 0xa74 + uVar5 * 4); *psVar1 = *psVar1 + 1; } *(short *)(in_ECX + 0xab4) = *(short *)(in_ECX + 0xab4) + 1; } iVar3 = 0; local_c = uVar5; if (uVar6 == 0) { iVar7 = 0x8a; iVar4 = 3; } else if (uVar5 == uVar6) { iVar7 = 6; iVar4 = 3; } else { iVar7 = 7; iVar4 = 4; } } local_8 = local_8 + 2; local_10 = local_10 + -1; uVar5 = uVar6; } while (local_10 != 0); } return; } //@@ 00aae610 send_tree /* DB: zlib trees.c: ECX=deflate_state (bi_buf +0x16b0, bi_valid +0x16b4, pending_buf +8, pending +0x14, bl_tree at +0xa74), EDX=tree, arg max_code; max_count 138/7, min_count 3/4, REP_3_6/REPZ codes; called twice from send_all_trees FUN_00aaeb30 */ void send_tree(int param_1) { char cVar1; undefined2 uVar2; uint uVar3; int in_ECX; int iVar4; int iVar5; ushort uVar6; ushort uVar7; int in_EDX; int iVar8; uint uVar9; uint uVar10; ushort uVar11; int iVar12; int local_18; ushort *local_14; uVar9 = (uint)*(ushort *)(in_EDX + 2); uVar10 = 0xffffffff; if (-1 < param_1) { iVar8 = 0x8a; if (uVar9 != 0) { iVar8 = 7; } local_14 = (ushort *)(in_EDX + 6); iVar4 = (uVar9 != 0) + 3; local_18 = param_1 + 1; iVar5 = 0; do { iVar12 = iVar5 + 1; uVar3 = (uint)*local_14; if ((iVar8 <= iVar12) || (uVar9 != uVar3)) { if (iVar12 < iVar4) { do { iVar8 = *(int *)(in_ECX + 0x16b4); uVar10 = (uint)*(ushort *)(in_ECX + 0xa76 + uVar9 * 4); uVar11 = *(ushort *)(in_ECX + (uVar9 + 0x29d) * 4); uVar6 = uVar11 << ((byte)iVar8 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - uVar10) < iVar8) { *(ushort *)(in_ECX + 0x16b0) = uVar6; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar6; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar6 = uVar11 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar8 = *(int *)(in_ECX + 0x16b4) + -0x10; } *(uint *)(in_ECX + 0x16b4) = iVar8 + uVar10; *(ushort *)(in_ECX + 0x16b0) = uVar6; iVar12 = iVar12 + -1; } while (iVar12 != 0); } else if (uVar9 == 0) { iVar8 = *(int *)(in_ECX + 0x16b4); if (iVar12 < 0xb) { uVar11 = *(ushort *)(in_ECX + 0xab8); uVar6 = *(ushort *)(in_ECX + 0xaba); uVar7 = uVar11 << ((byte)iVar8 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - (uint)uVar6) < iVar8) { *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar7 = uVar11 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar8 = *(int *)(in_ECX + 0x16b4) + -0x10; } iVar8 = iVar8 + (uint)uVar6; *(int *)(in_ECX + 0x16b4) = iVar8; *(ushort *)(in_ECX + 0x16b0) = uVar7; if (iVar8 < 0xe) { iVar5 = iVar8 + 3; goto LAB_00aae9c8; } uVar11 = (ushort)(iVar5 + -2); uVar7 = uVar11 << ((byte)iVar8 & 0x1f) | uVar7; *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar2 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xd; *(ushort *)(in_ECX + 0x16b0) = uVar11 >> (0x10U - (char)uVar2 & 0x1f); } else { uVar11 = *(ushort *)(in_ECX + 0xabc); uVar6 = *(ushort *)(in_ECX + 0xabe); uVar7 = uVar11 << ((byte)iVar8 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - (uint)uVar6) < iVar8) { *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar7 = uVar11 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar8 = *(int *)(in_ECX + 0x16b4) + -0x10; } iVar8 = iVar8 + (uint)uVar6; *(int *)(in_ECX + 0x16b4) = iVar8; *(ushort *)(in_ECX + 0x16b0) = uVar7; if (iVar8 < 10) { *(ushort *)(in_ECX + 0x16b0) = (short)iVar5 + -10 << ((byte)iVar8 & 0x1f) | uVar7; *(int *)(in_ECX + 0x16b4) = iVar8 + 7; } else { uVar11 = (ushort)(iVar5 + -10); uVar7 = uVar11 << ((byte)iVar8 & 0x1f) | uVar7; *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); cVar1 = *(char *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -9; *(ushort *)(in_ECX + 0x16b0) = uVar11 >> (0x10U - cVar1 & 0x1f); } } } else { if (uVar9 != uVar10) { uVar10 = (uint)*(ushort *)(in_ECX + 0xa76 + uVar9 * 4); uVar11 = *(ushort *)(in_ECX + 0xa74 + uVar9 * 4); iVar8 = *(int *)(in_ECX + 0x16b4); uVar6 = uVar11 << ((byte)iVar8 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - uVar10) < iVar8) { *(ushort *)(in_ECX + 0x16b0) = uVar6; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar6; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar6 = uVar11 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar8 = *(int *)(in_ECX + 0x16b4) + -0x10; } *(uint *)(in_ECX + 0x16b4) = iVar8 + uVar10; *(ushort *)(in_ECX + 0x16b0) = uVar6; iVar12 = iVar5; } uVar11 = *(ushort *)(in_ECX + 0xab4); iVar8 = *(int *)(in_ECX + 0x16b4); uVar6 = *(ushort *)(in_ECX + 0xab6); uVar7 = uVar11 << ((byte)iVar8 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - (uint)uVar6) < iVar8) { *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar7 = uVar11 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar8 = *(int *)(in_ECX + 0x16b4) + -0x10; } iVar8 = iVar8 + (uint)uVar6; *(int *)(in_ECX + 0x16b4) = iVar8; *(ushort *)(in_ECX + 0x16b0) = uVar7; if (iVar8 < 0xf) { iVar5 = iVar8 + 2; LAB_00aae9c8: *(int *)(in_ECX + 0x16b4) = iVar5; *(ushort *)(in_ECX + 0x16b0) = (short)iVar12 + -3 << ((byte)iVar8 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); } else { uVar11 = (ushort)(iVar12 + -3); uVar7 = uVar11 << ((byte)iVar8 & 0x1f) | uVar7; *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar2 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xe; *(ushort *)(in_ECX + 0x16b0) = uVar11 >> (0x10U - (char)uVar2 & 0x1f); } } iVar12 = 0; uVar10 = uVar9; if (uVar3 == 0) { iVar8 = 0x8a; iVar4 = 3; } else if (uVar9 == uVar3) { iVar8 = 6; iVar4 = 3; } else { iVar8 = 7; iVar4 = 4; } } local_14 = local_14 + 2; local_18 = local_18 + -1; uVar9 = uVar3; iVar5 = iVar12; } while (local_18 != 0); } return; } //@@ 00aaeb30 send_all_trees /* DB: zlib trees.c: send_bits(lcodes-257,5), send_bits(dcodes-1,5), send_bits(blcodes-4,4) on bi_buf +0x16b0/bi_valid +0x16b4, then send_tree; only caller _tr_flush_block (00aaeeb0) passes l_desc.max_code+1, d_desc.max_code+1 */ void send_all_trees(int param_1,int param_2) { int iVar1; char cVar2; undefined2 uVar3; int in_ECX; ushort uVar4; int in_EDX; int iVar5; int iVar6; ushort uVar7; iVar6 = *(int *)(in_ECX + 0x16b4); if (iVar6 < 0xc) { iVar5 = iVar6 + 5; uVar7 = (short)in_EDX + -0x101 << ((byte)iVar6 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(int *)(in_ECX + 0x16b4) = iVar5; } else { uVar7 = (short)in_EDX - 0x101; uVar4 = uVar7 << ((byte)iVar6 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar4; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar4; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar3 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xb; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar5 = *(int *)(in_ECX + 0x16b4); uVar7 = uVar7 >> (0x10U - (char)uVar3 & 0x1f); } *(ushort *)(in_ECX + 0x16b0) = uVar7; if (iVar5 < 0xc) { iVar6 = iVar5 + 5; *(int *)(in_ECX + 0x16b4) = iVar6; uVar4 = (short)param_1 + -1 << ((byte)iVar5 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); } else { uVar4 = (short)param_1 - 1; uVar7 = uVar4 << ((byte)iVar5 & 0x1f) | uVar7; *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar3 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xb; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar6 = *(int *)(in_ECX + 0x16b4); uVar4 = uVar4 >> (0x10U - (char)uVar3 & 0x1f); } *(ushort *)(in_ECX + 0x16b0) = uVar4; if (iVar6 < 0xd) { iVar5 = iVar6 + 4; *(int *)(in_ECX + 0x16b4) = iVar5; uVar7 = (short)param_2 + -4 << ((byte)iVar6 & 0x1f) | uVar4; } else { uVar7 = (short)param_2 - 4; uVar4 = uVar7 << ((byte)iVar6 & 0x1f) | uVar4; *(ushort *)(in_ECX + 0x16b0) = uVar4; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar4; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar3 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xc; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar5 = *(int *)(in_ECX + 0x16b4); uVar7 = uVar7 >> (0x10U - (char)uVar3 & 0x1f); } iVar6 = 0; *(ushort *)(in_ECX + 0x16b0) = uVar7; if (0 < param_2) { do { iVar1 = in_ECX + (uint)(byte)(&DAT_00b4f750)[iVar6] * 4; if (iVar5 < 0xe) { *(ushort *)(in_ECX + 0x16b0) = *(ushort *)(in_ECX + 0x16b0) | *(short *)(iVar1 + 0xa76) << ((byte)iVar5 & 0x1f); iVar5 = iVar5 + 3; *(int *)(in_ECX + 0x16b4) = iVar5; } else { uVar7 = *(ushort *)(iVar1 + 0xa76); *(ushort *)(in_ECX + 0x16b0) = *(ushort *)(in_ECX + 0x16b0) | uVar7 << ((byte)iVar5 & 0x1f); *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)*(undefined2 *)(in_ECX + 0x16b0); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); cVar2 = *(char *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xd; iVar5 = *(int *)(in_ECX + 0x16b4); *(ushort *)(in_ECX + 0x16b0) = uVar7 >> (0x10U - cVar2 & 0x1f); } iVar6 = iVar6 + 1; } while (iVar6 < param_2); } send_tree(in_EDX + -1); send_tree(param_1 + -1); return; } //@@ 00aaeda0 FUN_00aaeda0 void FUN_00aaeda0(int param_1,ushort param_2) { undefined2 uVar1; int iVar2; byte bVar3; int in_ECX; ushort uVar4; undefined1 *in_EDX; iVar2 = *(int *)(in_ECX + 0x16b4); if (iVar2 < 0xe) { *(int *)(in_ECX + 0x16b4) = iVar2 + 3; param_2 = param_2 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); } else { uVar4 = param_2 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar4; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar4; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar1 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xd; param_2 = param_2 >> (0x10U - (char)uVar1 & 0x1f); } *(ushort *)(in_ECX + 0x16b0) = param_2; FUN_00aaf650(); *(undefined4 *)(in_ECX + 0x16ac) = 8; *(byte *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (byte)param_1; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; bVar3 = (byte)((uint)param_1 >> 8); *(byte *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = bVar3; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(byte *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = ~(byte)param_1; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(byte *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = ~bVar3; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar2 = *(int *)(in_ECX + 0x14); for (; param_1 != 0; param_1 = param_1 + -1) { *(undefined1 *)(iVar2 + *(int *)(in_ECX + 8)) = *in_EDX; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar2 = *(int *)(in_ECX + 0x14); in_EDX = in_EDX + 1; } return; } //@@ 00aaeeb0 _tr_flush_block /* DB: zlib trees.c: detect_data_type sum over dyn_ltree (+0x8c..), build_tree x2 (FUN_00aae270), scan_tree, build_bl_tree with bl_order table, opt_len+3*(max_blindex+1)+5+5+4 -> stored/static/dynamic choice, calls send_all_trees (00aaeb30); callers deflate_stored/fast/slow */ void _tr_flush_block(int param_1,int param_2) { undefined2 uVar1; short sVar2; uint uVar3; byte bVar4; int in_ECX; ushort *puVar5; byte *pbVar6; ushort uVar7; int in_EDX; int iVar8; uint uVar9; int iVar10; int iVar11; int iVar12; int iVar13; uint uVar14; iVar10 = 0; if (*(int *)(in_ECX + 0x7c) < 1) { uVar9 = param_1 + 5; uVar14 = uVar9; } else { if (*(char *)(in_ECX + 0x1c) == '\x02') { iVar12 = 0; puVar5 = (ushort *)(in_ECX + 0xac); iVar8 = 0x3c; do { iVar11 = iVar8; iVar12 = iVar12 + (uint)puVar5[-2]; iVar10 = iVar10 + (uint)*puVar5; iVar8 = iVar11 + -1; puVar5 = puVar5 + 4; } while (iVar8 != 0); iVar13 = 0; iVar8 = 0; iVar11 = iVar11 + 0x3f; puVar5 = (ushort *)(in_ECX + 0x290); do { iVar13 = iVar13 + (uint)puVar5[-2]; iVar8 = iVar8 + (uint)*puVar5; iVar11 = iVar11 + -1; puVar5 = puVar5 + 4; } while (iVar11 != 0); *(bool *)(in_ECX + 0x1c) = (uint)*(ushort *)(in_ECX + 0x90) + (uint)*(ushort *)(in_ECX + 0x8c) + (uint)*(ushort *)(in_ECX + 0x94) + (uint)*(ushort *)(in_ECX + 0x98) + (uint)*(ushort *)(in_ECX + 0x9c) + (uint)*(ushort *)(in_ECX + 0xa0) + (uint)*(ushort *)(in_ECX + 0xa4) + iVar8 + iVar13 <= (uint)*(ushort *)(in_ECX + 0x288) + iVar10 + iVar12 >> 2; } build_tree(); build_tree(); FUN_00aae510(*(undefined4 *)(in_ECX + 0xb14)); FUN_00aae510(*(undefined4 *)(in_ECX + 0xb20)); build_tree(); iVar10 = 0x12; pbVar6 = &DAT_00b4f760; do { if (*(short *)(in_ECX + 0xa76 + (uint)pbVar6[2] * 4) != 0) break; if (*(short *)(in_ECX + 0xa76 + (uint)pbVar6[1] * 4) != 0) { iVar10 = iVar10 + -1; break; } if (*(short *)(in_ECX + 0xa76 + (uint)*pbVar6 * 4) != 0) { iVar10 = iVar10 + -2; break; } if (*(short *)(in_ECX + 0xa76 + (uint)pbVar6[-1] * 4) != 0) { iVar10 = iVar10 + -3; break; } pbVar6 = pbVar6 + -4; iVar10 = iVar10 + -4; } while (0xb4f750 < (int)pbVar6); *(int *)(in_ECX + 0x16a0) = *(int *)(in_ECX + 0x16a0) + iVar10 * 3 + 0x11; uVar9 = *(int *)(in_ECX + 0x16a4) + 10U >> 3; uVar3 = *(int *)(in_ECX + 0x16a0) + 10U >> 3; uVar14 = uVar9; if (uVar3 < uVar9) { uVar14 = uVar3; } } if ((uVar14 < param_1 + 4U) || (in_EDX == 0)) { iVar8 = *(int *)(in_ECX + 0x16b4); bVar4 = (byte)iVar8; sVar2 = (short)param_2; if (uVar9 == uVar14) { if (iVar8 < 0xe) { *(int *)(in_ECX + 0x16b4) = iVar8 + 3; uVar7 = sVar2 + 2 << (bVar4 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); } else { uVar7 = sVar2 + 2U << (bVar4 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar1 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xd; uVar7 = (ushort)(sVar2 + 2U) >> (0x10U - (char)uVar1 & 0x1f); } *(ushort *)(in_ECX + 0x16b0) = uVar7; compress_block(&DAT_00b4f210); } else { if (iVar8 < 0xe) { *(int *)(in_ECX + 0x16b4) = iVar8 + 3; uVar7 = sVar2 + 4 << (bVar4 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); } else { uVar7 = sVar2 + 4U << (bVar4 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); uVar1 = *(undefined2 *)(in_ECX + 0x16b4); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + -0xd; uVar7 = (ushort)(sVar2 + 4U) >> (0x10U - (char)uVar1 & 0x1f); } *(ushort *)(in_ECX + 0x16b0) = uVar7; send_all_trees(*(int *)(in_ECX + 0xb20) + 1,iVar10 + 1); compress_block(in_ECX + 0x980); } } else { FUN_00aaeda0(param_1,param_2); } FUN_00aadf00(); if (param_2 != 0) { FUN_00aaf650(); } return; } //@@ 00aaf210 compress_block /* DB: zlib trees.c: emits l_buf(+0x1690)/d_buf(+0x169c) symbols using bi_buf(+0x16b0)/bi_valid(+0x16b4), _length_code table DAT_00b4fa00; both callers inside _tr_flush_block 00aaeeb0 _tr_flush_block void compress_block(int param_1) { byte bVar1; int in_ECX; int iVar2; ushort uVar3; int in_EDX; uint uVar4; int iVar5; uint uVar6; ushort uVar7; uint uVar8; ushort uVar9; uint uVar10; uVar4 = 0; if (*(int *)(in_ECX + 0x1698) != 0) { do { uVar8 = (uint)*(ushort *)(*(int *)(in_ECX + 0x169c) + uVar4 * 2); bVar1 = *(byte *)(uVar4 + *(int *)(in_ECX + 0x1690)); uVar10 = (uint)bVar1; uVar4 = uVar4 + 1; if (uVar8 == 0) { iVar2 = *(int *)(in_ECX + 0x16b4); uVar8 = (uint)*(ushort *)(in_EDX + 2 + uVar10 * 4); uVar9 = *(ushort *)(in_EDX + uVar10 * 4); if ((int)(0x10 - uVar8) < iVar2) { uVar7 = uVar9 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar5 = (uVar8 - 0x10) + *(int *)(in_ECX + 0x16b4); uVar9 = uVar9 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); } else { iVar5 = iVar2 + uVar8; uVar9 = uVar9 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); } *(ushort *)(in_ECX + 0x16b0) = uVar9; *(int *)(in_ECX + 0x16b4) = iVar5; } else { iVar2 = (uint)(byte)(&DAT_00b4fa00)[uVar10] * 4; uVar6 = (uint)*(ushort *)(iVar2 + 0x406 + in_EDX); iVar5 = *(int *)(in_ECX + 0x16b4); uVar9 = *(ushort *)(in_EDX + 0x404 + (uint)(byte)(&DAT_00b4fa00)[uVar10] * 4); uVar7 = uVar9 << ((byte)iVar5 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - uVar6) < iVar5) { *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar7 = uVar9 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar5 = (uVar6 - 0x10) + *(int *)(in_ECX + 0x16b4); } else { iVar5 = uVar6 + iVar5; } *(int *)(in_ECX + 0x16b4) = iVar5; *(ushort *)(in_ECX + 0x16b0) = uVar7; iVar5 = *(int *)(&DAT_00b4f940 + iVar2); if (iVar5 != 0) { uVar9 = (ushort)bVar1 - (short)*(undefined4 *)(&DAT_00b4f190 + iVar2); iVar2 = *(int *)(in_ECX + 0x16b4); if (0x10 - iVar5 < iVar2) { uVar7 = uVar9 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(ushort *)(in_ECX + 0x16b0) = uVar9 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + iVar5 + -0x10; } else { *(ushort *)(in_ECX + 0x16b0) = *(ushort *)(in_ECX + 0x16b0) | uVar9 << ((byte)iVar2 & 0x1f); *(int *)(in_ECX + 0x16b4) = iVar2 + iVar5; } } uVar10 = uVar8 - 1; if (uVar10 < 0x100) { bVar1 = (&DAT_00b4faff)[uVar8]; } else { bVar1 = (&DAT_00b4fc00)[uVar10 >> 7]; } iVar5 = *(int *)(in_ECX + 0x16b4); iVar2 = (uint)bVar1 * 4; uVar8 = (uint)*(ushort *)(iVar2 + 2 + param_1); uVar9 = *(ushort *)(iVar2 + param_1); uVar7 = uVar9 << ((byte)iVar5 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - uVar8) < iVar5) { *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar7 = uVar9 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar5 = (uVar8 - 0x10) + *(int *)(in_ECX + 0x16b4); } else { iVar5 = uVar8 + iVar5; } *(int *)(in_ECX + 0x16b4) = iVar5; *(ushort *)(in_ECX + 0x16b0) = uVar7; iVar5 = *(int *)(&DAT_00b4f8c0 + iVar2); if (iVar5 != 0) { uVar9 = (short)uVar10 - (short)*(undefined4 *)(&DAT_00b4f7c0 + iVar2); iVar2 = *(int *)(in_ECX + 0x16b4); if (0x10 - iVar5 < iVar2) { uVar7 = uVar9 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); *(ushort *)(in_ECX + 0x16b0) = uVar7; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar7; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(ushort *)(in_ECX + 0x16b0) = uVar9 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); *(int *)(in_ECX + 0x16b4) = *(int *)(in_ECX + 0x16b4) + iVar5 + -0x10; } else { *(ushort *)(in_ECX + 0x16b0) = *(ushort *)(in_ECX + 0x16b0) | uVar9 << ((byte)iVar2 & 0x1f); *(int *)(in_ECX + 0x16b4) = iVar2 + iVar5; } } } } while (uVar4 < *(uint *)(in_ECX + 0x1698)); } uVar9 = *(ushort *)(in_EDX + 0x400); uVar7 = *(ushort *)(in_EDX + 0x402); iVar2 = *(int *)(in_ECX + 0x16b4); uVar3 = uVar9 << ((byte)iVar2 & 0x1f) | *(ushort *)(in_ECX + 0x16b0); if ((int)(0x10 - (uint)uVar7) < iVar2) { *(ushort *)(in_ECX + 0x16b0) = uVar3; *(char *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = (char)uVar3; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; *(undefined1 *)(*(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 8)) = *(undefined1 *)(in_ECX + 0x16b1); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; uVar3 = uVar9 >> (0x10U - *(char *)(in_ECX + 0x16b4) & 0x1f); iVar2 = *(int *)(in_ECX + 0x16b4) + -0x10; } *(uint *)(in_ECX + 0x16b4) = iVar2 + (uint)uVar7; *(ushort *)(in_ECX + 0x16b0) = uVar3; *(uint *)(in_ECX + 0x16ac) = (uint)*(ushort *)(in_EDX + 0x402); return; } //@@ 00aaf650 FUN_00aaf650 void FUN_00aaf650(void) { undefined1 uVar1; int in_ECX; int iVar2; int iVar3; if (*(int *)(in_ECX + 0x16b4) < 9) { if (*(int *)(in_ECX + 0x16b4) < 1) goto LAB_00aaf696; iVar3 = *(int *)(in_ECX + 8); iVar2 = *(int *)(in_ECX + 0x14); uVar1 = *(undefined1 *)(in_ECX + 0x16b0); } else { *(undefined1 *)(*(int *)(in_ECX + 8) + *(int *)(in_ECX + 0x14)) = *(undefined1 *)(in_ECX + 0x16b0); *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; iVar3 = *(int *)(in_ECX + 0x14); iVar2 = *(int *)(in_ECX + 8); uVar1 = *(undefined1 *)(in_ECX + 0x16b1); } *(undefined1 *)(iVar3 + iVar2) = uVar1; *(int *)(in_ECX + 0x14) = *(int *)(in_ECX + 0x14) + 1; LAB_00aaf696: *(undefined2 *)(in_ECX + 0x16b0) = 0; *(undefined4 *)(in_ECX + 0x16b4) = 0; return; } //@@ 00aaf6b0 FUN_00aaf6b0 undefined4 FUN_00aaf6b0(void) { uint *puVar1; int in_ECX; if ((in_ECX == 0) || (puVar1 = *(uint **)(in_ECX + 0x1c), puVar1 == (uint *)0x0)) { return 0xfffffffe; } *(undefined4 *)(in_ECX + 0x14) = 0; *(undefined4 *)(in_ECX + 8) = 0; *(undefined4 *)(in_ECX + 0x18) = 0; *puVar1 = -(uint)(puVar1[3] != 0) & 7; FUN_00abd870(0); return 0; } //@@ 00aaf700 FUN_00aaf700 undefined4 FUN_00aaf700(void) { int *piVar1; int iVar2; int in_ECX; if (((in_ECX == 0) || (*(int *)(in_ECX + 0x1c) == 0)) || (*(code **)(in_ECX + 0x24) == (code *)0x0)) { return 0xfffffffe; } piVar1 = *(int **)(*(int *)(in_ECX + 0x1c) + 0x14); if (piVar1 != (int *)0x0) { iVar2 = *piVar1; if ((iVar2 == 4) || (iVar2 == 5)) { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),piVar1[3]); iVar2 = *piVar1; } if (iVar2 == 6) { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),piVar1[1]); } iVar2 = piVar1[10]; *piVar1 = 0; piVar1[7] = 0; piVar1[8] = 0; piVar1[0xd] = iVar2; piVar1[0xc] = iVar2; if ((code *)piVar1[0xe] != (code *)0x0) { iVar2 = (*(code *)piVar1[0xe])(0,0,0); piVar1[0xf] = iVar2; *(int *)(in_ECX + 0x30) = iVar2; iVar2 = piVar1[10]; } (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),iVar2); (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),piVar1[9]); (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),piVar1); } (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28),*(undefined4 *)(in_ECX + 0x1c)); *(undefined4 *)(in_ECX + 0x1c) = 0; return 0; } //@@ 00aaf7e0 FUN_00aaf7e0 undefined4 FUN_00aaf7e0(void) { code *pcVar1; void *pvVar2; undefined4 *_Memory; int in_ECX; undefined4 uVar3; if (in_ECX == 0) { return 0xfffffffe; } pcVar1 = *(code **)(in_ECX + 0x20); *(undefined4 *)(in_ECX + 0x18) = 0; if (pcVar1 == (code *)0x0) { *(undefined4 *)(in_ECX + 0x28) = 0; uVar3 = 0; *(code **)(in_ECX + 0x20) = FUN_00aadd90; pcVar1 = FUN_00aadd90; } else { uVar3 = *(undefined4 *)(in_ECX + 0x28); } if (*(int *)(in_ECX + 0x24) == 0) { *(code **)(in_ECX + 0x24) = FUN_00aaddb0; } if (pcVar1 == FUN_00aadd90) { pvVar2 = calloc(1,0x18); } else { pvVar2 = (void *)(*pcVar1)(uVar3); } *(void **)(in_ECX + 0x1c) = pvVar2; if (pvVar2 == (void *)0x0) { return 0xfffffffc; } *(undefined4 *)((int)pvVar2 + 0x14) = 0; pcVar1 = FUN_00aaddd0; *(undefined4 *)(*(int *)(in_ECX + 0x1c) + 0xc) = 0; *(undefined4 *)(*(int *)(in_ECX + 0x1c) + 0x10) = 0xf; if (*(int *)(*(int *)(in_ECX + 0x1c) + 0xc) != 0) { pcVar1 = (code *)0x0; } if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { _Memory = calloc(1,0x40); } else { _Memory = (undefined4 *)(**(code **)(in_ECX + 0x20))(*(undefined4 *)(in_ECX + 0x28)); } if (_Memory != (undefined4 *)0x0) { if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { pvVar2 = calloc(8,0x5a0); } else { pvVar2 = (void *)(**(code **)(in_ECX + 0x20))(*(undefined4 *)(in_ECX + 0x28)); } _Memory[9] = pvVar2; uVar3 = *(undefined4 *)(in_ECX + 0x28); if (pvVar2 == (void *)0x0) { pcVar1 = *(code **)(in_ECX + 0x24); if (pcVar1 == FUN_00aaddb0) { free(_Memory); goto LAB_00aaf953; } } else { if (*(code **)(in_ECX + 0x20) == FUN_00aadd90) { pvVar2 = calloc(1,0x8000); } else { pvVar2 = (void *)(**(code **)(in_ECX + 0x20))(uVar3); } _Memory[10] = pvVar2; if (pvVar2 != (void *)0x0) { *_Memory = 0; _Memory[0xb] = (int)pvVar2 + 0x8000; _Memory[0xe] = pcVar1; _Memory[7] = 0; _Memory[8] = 0; _Memory[0xd] = pvVar2; _Memory[0xc] = pvVar2; if (pcVar1 != (code *)0x0) { uVar3 = (*pcVar1)(0,0,0); _Memory[0xf] = uVar3; *(undefined4 *)(in_ECX + 0x30) = uVar3; } *(undefined4 **)(*(int *)(in_ECX + 0x1c) + 0x14) = _Memory; FUN_00aaf6b0(); return 0; } if (*(code **)(in_ECX + 0x24) == FUN_00aaddb0) { free((void *)_Memory[9]); } else { (**(code **)(in_ECX + 0x24))(*(undefined4 *)(in_ECX + 0x28)); } pcVar1 = *(code **)(in_ECX + 0x24); if (pcVar1 == FUN_00aaddb0) { free(_Memory); goto LAB_00aaf953; } uVar3 = *(undefined4 *)(in_ECX + 0x28); } (*pcVar1)(uVar3); } LAB_00aaf953: *(undefined4 *)(*(int *)(in_ECX + 0x1c) + 0x14) = 0; FUN_00aaf700(); return 0xfffffffc; } //@@ 00aaf9d0 inflate /* DB: zlib 1.1.x inflate(): 14-mode state machine, 'incorrect header check','unknown compression method','invalid window size','need dictionary','incorrect data check', calls inflate_blocks (0xabd900); used by libpng png_read_row/png_handle_zTXt/0xab3120 prototype: db/protos.zhl */ int __fastcall inflate(void *stream) { int *piVar1; byte bVar2; undefined4 *puVar3; uint uVar4; uint *puVar5; int iVar6; if (((stream != (void *)0x0) && (puVar5 = *(uint **)((int)stream + 0x1c), puVar5 != (uint *)0x0)) && (*(int *)stream != 0)) { uVar4 = *puVar5; iVar6 = -5; if (uVar4 < 0xe) { do { switch((&switchD_00aafa12::switchdataD_00aafd40)[uVar4]) { case (undefined *)0xaafa19: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; puVar5[1] = (uint)bVar2; if ((bVar2 & 0xf) == 8) { puVar3 = *(undefined4 **)((int)stream + 0x1c); if (((uint)puVar3[1] >> 4) + 8 <= (uint)puVar3[4]) { *puVar3 = 1; goto switchD_00aafa12_caseD_aafa7e; } *puVar3 = 0xd; *(char **)((int)stream + 0x18) = "invalid window size"; } else { **(undefined4 **)((int)stream + 0x1c) = 0xd; *(char **)((int)stream + 0x18) = "unknown compression method"; } goto LAB_00aafc0a; case (undefined *)0xaafa7e: switchD_00aafa12_caseD_aafa7e: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; puVar3 = *(undefined4 **)((int)stream + 0x1c); *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; if ((puVar3[1] * 0x100 + (uint)bVar2) % 0x1f != 0) { *puVar3 = 0xd; *(char **)((int)stream + 0x18) = "incorrect header check"; goto LAB_00aafc0a; } if ((bVar2 & 0x20) != 0) { *puVar3 = 2; goto switchD_00aafa12_caseD_aafc36; } *puVar3 = 7; break; case (undefined *)0xaafad5: iVar6 = inflate_blocks(iVar6); if (iVar6 == -3) { **(undefined4 **)((int)stream + 0x1c) = 0xd; *(undefined4 *)(*(int *)((int)stream + 0x1c) + 4) = 0; iVar6 = -3; } else { if (iVar6 == 0) { return 0; } if (iVar6 != 1) { return iVar6; } iVar6 = 0; FUN_00abd870(*(int *)((int)stream + 0x1c) + 4); puVar3 = *(undefined4 **)((int)stream + 0x1c); if (puVar3[3] == 0) { *puVar3 = 8; goto switchD_00aafa12_caseD_aafb42; } *puVar3 = 0xc; } break; case (undefined *)0xaafb42: switchD_00aafa12_caseD_aafb42: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; *(uint *)(*(int *)((int)stream + 0x1c) + 8) = (uint)bVar2 << 0x18; **(undefined4 **)((int)stream + 0x1c) = 9; case (undefined *)0xaafb70: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; piVar1 = (int *)(*(int *)((int)stream + 0x1c) + 8); *piVar1 = *piVar1 + (uint)bVar2 * 0x10000; **(undefined4 **)((int)stream + 0x1c) = 10; switchD_00aafa12_caseD_aafb9e: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; piVar1 = (int *)(*(int *)((int)stream + 0x1c) + 8); *piVar1 = *piVar1 + (uint)bVar2 * 0x100; **(undefined4 **)((int)stream + 0x1c) = 0xb; switchD_00aafa12_caseD_aafbcc: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; piVar1 = (int *)(*(int *)((int)stream + 0x1c) + 8); *piVar1 = *piVar1 + (uint)bVar2; puVar3 = *(undefined4 **)((int)stream + 0x1c); if (puVar3[1] == puVar3[2]) { *puVar3 = 0xc; switchD_00aafa12_caseD_aafd04: return 1; } *puVar3 = 0xd; *(char **)((int)stream + 0x18) = "incorrect data check"; LAB_00aafc0a: iVar6 = 0; *(undefined4 *)(*(int *)((int)stream + 0x1c) + 4) = 5; break; case (undefined *)0xaafb9e: goto switchD_00aafa12_caseD_aafb9e; case (undefined *)0xaafbcc: goto switchD_00aafa12_caseD_aafbcc; case (undefined *)0xaafc36: switchD_00aafa12_caseD_aafc36: if (*(int *)((int)stream + 4) == 0) { return iVar6; } *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; *(uint *)(*(int *)((int)stream + 0x1c) + 8) = (uint)bVar2 << 0x18; **(undefined4 **)((int)stream + 0x1c) = 3; case (undefined *)0xaafc64: if (*(int *)((int)stream + 4) != 0) { *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; piVar1 = (int *)(*(int *)((int)stream + 0x1c) + 8); *piVar1 = *piVar1 + (uint)bVar2 * 0x10000; **(undefined4 **)((int)stream + 0x1c) = 4; switchD_00aafa12_caseD_aafc92: if (*(int *)((int)stream + 4) != 0) { *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; iVar6 = 0; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; piVar1 = (int *)(*(int *)((int)stream + 0x1c) + 8); *piVar1 = *piVar1 + (uint)bVar2 * 0x100; **(undefined4 **)((int)stream + 0x1c) = 5; switchD_00aafa12_caseD_aafcbc: if (*(int *)((int)stream + 4) != 0) { *(int *)((int)stream + 8) = *(int *)((int)stream + 8) + 1; *(int *)((int)stream + 4) = *(int *)((int)stream + 4) + -1; bVar2 = **(byte **)stream; *(byte **)stream = *(byte **)stream + 1; piVar1 = (int *)(*(int *)((int)stream + 0x1c) + 8); *piVar1 = *piVar1 + (uint)bVar2; *(undefined4 *)((int)stream + 0x30) = (*(undefined4 **)((int)stream + 0x1c))[2]; **(undefined4 **)((int)stream + 0x1c) = 6; return 2; } } } return iVar6; case (undefined *)0xaafc92: goto switchD_00aafa12_caseD_aafc92; case (undefined *)0xaafcbc: goto switchD_00aafa12_caseD_aafcbc; case (undefined *)0xaafd04: goto switchD_00aafa12_caseD_aafd04; case (undefined *)0xaafd10: *puVar5 = 0xd; *(char **)((int)stream + 0x18) = "need dictionary"; *(undefined4 *)(*(int *)((int)stream + 0x1c) + 4) = 0; return -2; case (undefined *)0xaafd33: return -3; } puVar5 = *(uint **)((int)stream + 0x1c); uVar4 = *puVar5; } while (uVar4 < 0xe); } } return -2; } //@@ 00aafd80 FUN_00aafd80 void FUN_00aafd80(int param_1,undefined4 param_2,int param_3) { int iVar1; iVar1 = (**(code **)(**(int **)(param_1 + 0x5c) + 0x14))(param_2,1,param_3); if (iVar1 != param_3) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } return; } //@@ 00aafdb0 FUN_00aafdb0 void FUN_00aafdb0(void) { undefined4 uVar1; int in_ECX; *(undefined4 *)(in_ECX + 0x5c) = 0; *(code **)(in_ECX + 0x50) = FUN_00aafd80; if (*(int *)(in_ECX + 0x4c) != 0) { *(undefined4 *)(in_ECX + 0x4c) = 0; if (*(code **)(in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n", "It\'s an error to set both read_data_fn and write_data_fn in the "); FUN_008c5d50(uVar1); } else { (**(code **)(in_ECX + 0x44))(); } if (*(code **)(in_ECX + 0x44) != (code *)0x0) { (**(code **)(in_ECX + 0x44))(); *(undefined4 *)(in_ECX + 0x144) = 0; return; } uVar1 = __acrt_iob_func(2,"libpng warning: %s\n", "same structure. Resetting write_data_fn to NULL."); FUN_008c5d50(uVar1); } *(undefined4 *)(in_ECX + 0x144) = 0; return; } //@@ 00aafe40 FUN_00aafe40 undefined4 FUN_00aafe40(void) { undefined1 *in_ECX; return CONCAT31(CONCAT21(CONCAT11(*in_ECX,in_ECX[1]),in_ECX[2]),in_ECX[3]); } //@@ 00aafe60 png_crc_read /* DB: libpng: png_read_data inlined (own error "Call to NULL read function" when read_data_fn +0x50 is NULL, else calls it), then png_calculate_crc's flag tests (ancillary/critical CRC ignore flags +0x114/+0x64) and updates png_ptr->crc (+0x108) via FUN_00a90f30 (crc32); called by png_crc_finish and the png_handle_* chunk readers prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl png_crc_read(void *pngPtr,byte *buffer,uint length) { uint uVar1; if (*(code **)((int)pngPtr + 0x50) == (code *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)pngPtr + 0x50))(pngPtr,buffer,length); if ((*(byte *)((int)pngPtr + 0x114) & 0x20) == 0) { if ((*(uint *)((int)pngPtr + 100) & 0x800) == 0) goto LAB_00aafe9d; } else if ((*(uint *)((int)pngPtr + 100) & 0x300) != 0x300) { LAB_00aafe9d: uVar1 = crc32(*(uint *)((int)pngPtr + 0x108),buffer,length); *(uint *)((int)pngPtr + 0x108) = uVar1; return; } return; } //@@ 00aafed0 png_crc_finish /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng: ECX = png_ptr, EDX = bytes to skip: reads and CRCs the rest of the chunk in buffer-size pieces through the read function (+0x50, "Call to NULL read function"), then checks the CRC honoring the ancillary/critical CRC flags (+0x64 0x300/0x800) and reports "CRC error"; called by the png_handle_* chunk readers prototype: db/protos.zhl */ int __fastcall png_crc_finish(void *pngPtr,uint skip) { uint uVar1; byte *buffer; code *pcVar2; uint uVar3; undefined4 uVar4; int iVar5; bool bVar6; uint local_5c; undefined1 local_58 [80]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_58 + 0x54); uVar1 = *(uint *)((int)pngPtr + 0xa8); for (; uVar1 < skip; skip = skip - uVar1) { if (*(code **)((int)pngPtr + 0x50) == (code *)0x0) goto LAB_00ab0089; local_5c = *(uint *)((int)pngPtr + 0xa8); buffer = *(byte **)((int)pngPtr + 0xa4); (**(code **)((int)pngPtr + 0x50))(pngPtr,buffer,local_5c); if ((*(byte *)((int)pngPtr + 0x114) & 0x20) == 0) { if ((*(uint *)((int)pngPtr + 100) & 0x800) == 0) goto LAB_00aaff37; } else if ((*(uint *)((int)pngPtr + 100) & 0x300) != 0x300) { LAB_00aaff37: uVar3 = crc32(*(uint *)((int)pngPtr + 0x108),buffer,local_5c); *(uint *)((int)pngPtr + 0x108) = uVar3; } } if (skip != 0) { png_crc_read(pngPtr,*(byte **)((int)pngPtr + 0xa4),skip); } bVar6 = true; if ((*(byte *)((int)pngPtr + 0x114) & 0x20) == 0) { if ((*(uint *)((int)pngPtr + 100) & 0x800) != 0) { bVar6 = false; } } else { bVar6 = (*(uint *)((int)pngPtr + 100) & 0x300) != 0x300; } if (*(code **)((int)pngPtr + 0x50) == (code *)0x0) { LAB_00ab0089: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)pngPtr + 0x50))(pngPtr,&local_5c,4); if ((!bVar6) || ((((local_5c & 0xff) * 0x100 + (local_5c >> 8 & 0xff)) * 0x100 + (local_5c >> 0x10 & 0xff)) * 0x100 + (local_5c >> 0x18) == *(int *)((int)pngPtr + 0x108))) { return 0; } if ((*(byte *)((int)pngPtr + 0x114) & 0x20) == 0) { if ((*(uint *)((int)pngPtr + 100) & 0x400) == 0) goto LAB_00ab0095; } else if ((*(uint *)((int)pngPtr + 100) & 0x200) != 0) { LAB_00ab0095: FUN_00a64710(); pcVar2 = (code *)swi(3); iVar5 = (*pcVar2)(); return iVar5; } FUN_00a64660("CRC error"); if (*(code **)((int)pngPtr + 0x44) == (code *)0x0) { uVar4 = __acrt_iob_func(2,"libpng warning: %s\n",local_58); FUN_008c5d50(uVar4); return 1; } (**(code **)((int)pngPtr + 0x44))(pngPtr,local_58); return 1; } //@@ 00ab00b0 png_handle_IHDR /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngrutil.c: "Out of place IHDR", "Invalid IHDR chunk", width/height 0..0x7fffffff, bit depth/color type/compression/filter/interlace checks, png_crc_read(13)/png_crc_finish */ void png_handle_IHDR(int param_1) { void *in_ECX; uint uVar1; uint uVar2; uint uVar3; uint uVar4; byte local_18; undefined1 local_17; undefined1 local_16; undefined1 local_15; undefined1 local_14; undefined1 local_13; undefined1 local_12; undefined4 local_11; char local_d; byte local_c; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if (*(int *)((int)in_ECX + 0x60) != 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (param_1 != 0xd) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(undefined4 *)((int)in_ECX + 0x60) = 1; png_crc_read(in_ECX,&local_18,0xd); png_crc_finish(in_ECX,0); uVar3 = local_11 >> 8 & 0xff; uVar4 = CONCAT31(CONCAT21(CONCAT11(local_18,local_17),local_16),local_15); uVar2 = (uint)CONCAT21(CONCAT11(local_14,local_13),local_12) * 0x100 + (local_11 & 0xff); if ((((uVar4 == 0) || (0x7fffffff < uVar4)) || (uVar2 == 0)) || (0x7fffffff < uVar2)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (((uVar3 != 1) && (uVar3 != 2)) && ((uVar3 != 4 && ((uVar3 != 8 && (uVar3 != 0x10)))))) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (((local_11._2_1_ == 1) || (local_11._2_1_ == 5)) || (6 < local_11._2_1_)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (local_11._2_1_ == 3) { if (8 < uVar3) { LAB_00ab02d8: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } else if ((((local_11._2_1_ == 2) || (local_11._2_1_ == 4)) || (local_11._2_1_ == 6)) && (uVar3 < 8)) goto LAB_00ab02d8; if (1 < local_c) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (local_11 >> 0x18 != 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (local_d != '\0') { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(uint *)((int)in_ECX + 0xc4) = uVar2; *(uint *)((int)in_ECX + 0xc0) = uVar4; *(char *)((int)in_ECX + 0x11f) = (char)(local_11 >> 8); *(byte *)((int)in_ECX + 0x11b) = local_c; *(byte *)((int)in_ECX + 0x11e) = local_11._2_1_; switch(local_11._2_1_) { case 0: case 3: *(undefined1 *)((int)in_ECX + 0x122) = 1; break; case 2: *(undefined1 *)((int)in_ECX + 0x122) = 3; break; case 4: *(undefined1 *)((int)in_ECX + 0x122) = 2; break; case 6: *(undefined1 *)((int)in_ECX + 0x122) = 4; } uVar1 = *(byte *)((int)in_ECX + 0x122) * uVar3; *(char *)((int)in_ECX + 0x121) = (char)uVar1; *(uint *)((int)in_ECX + 0xd0) = (uVar1 & 0xff) * uVar4 + 7 >> 3; FUN_00a63100(uVar4,uVar2,uVar3,local_11._2_1_,local_c,0,0); return; } //@@ 00ab0330 FUN_00ab0330 void FUN_00ab0330(uint param_1) { uint uVar1; int iVar2; undefined4 uVar3; int iVar4; void *in_ECX; int in_EDX; int iVar5; undefined1 *puVar6; byte local_8; undefined1 local_7; undefined1 local_6; uVar1 = *(uint *)((int)in_ECX + 0x60); if ((uVar1 & 1) != 0) { if ((uVar1 & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar3 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid PLTE after IDAT"); FUN_008c5d50(uVar3); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } if ((uVar1 & 2) != 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(uint *)((int)in_ECX + 0x60) = uVar1 | 2; if (param_1 == (param_1 / 3) * 3) { iVar2 = (int)param_1 / 3; iVar4 = FUN_00a62f10(); *(uint *)((int)in_ECX + 100) = *(uint *)((int)in_ECX + 100) | 0x1000; if (0 < iVar2) { iVar5 = iVar2; puVar6 = (undefined1 *)(iVar4 + 2); do { png_crc_read(in_ECX,&local_8,3); puVar6[-2] = local_8; puVar6[-1] = local_7; *puVar6 = local_6; iVar5 = iVar5 + -1; puVar6 = puVar6 + 3; } while (iVar5 != 0); } png_crc_finish(in_ECX,0); *(int *)((int)in_ECX + 0x10c) = iVar4; *(short *)((int)in_ECX + 0x110) = (short)iVar2; if (in_EDX != 0) { *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 8; *(int *)(in_EDX + 0x10) = iVar4; *(short *)(in_EDX + 0x14) = (short)iVar2; } if ((((*(char *)((int)in_ECX + 0x11e) == '\x03') && (in_EDX != 0)) && ((*(byte *)(in_EDX + 8) & 0x10) != 0)) && (*(ushort *)((int)in_ECX + 0x110) < *(ushort *)((int)in_ECX + 0x112))) { FUN_00a64630(); *(undefined2 *)((int)in_ECX + 0x112) = *(undefined2 *)((int)in_ECX + 0x110); } return; } if (*(char *)((int)in_ECX + 0x11e) != '\x03') { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } } /* WARNING: Subroutine does not return */ FUN_00a64610(); } //@@ 00ab04d0 FUN_00ab04d0 void FUN_00ab04d0(uint param_1) { undefined4 uVar1; void *in_ECX; if (((byte)*(uint *)((int)in_ECX + 0x60) & 5) != 5) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 0x18; if (param_1 != 0) { if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Incorrect IEND chunk length"); FUN_008c5d50(uVar1); } png_crc_finish(in_ECX,param_1); return; } //@@ 00ab0540 FUN_00ab0540 void FUN_00ab0540(uint param_1) { uint uVar1; undefined4 uVar2; int iVar3; void *in_ECX; int in_EDX; float fVar4; char *pcVar5; void *local_8; uVar1 = *(uint *)((int)in_ECX + 0x60); if ((uVar1 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar1 & 4) == 0) { local_8 = in_ECX; if ((uVar1 & 2) == 0) { if ((in_EDX != 0) && ((*(uint *)(in_EDX + 8) & 0x801) == 1)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } } else if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n","Out of place gAMA chunk"); FUN_008c5d50(uVar2); } else { (**(code **)((int)in_ECX + 0x44))(); } if (param_1 == 4) { png_crc_read(in_ECX,(byte *)&local_8,4); iVar3 = png_crc_finish(in_ECX,0); if (((iVar3 == 0) && (iVar3 = ((((uint)local_8 & 0xff) * 0x100 + ((uint)local_8 >> 8 & 0xff)) * 0x100 + ((uint)local_8 >> 0x10 & 0xff)) * 0x100 + ((uint)local_8 >> 0x18), iVar3 != 0)) && (((*(uint *)(in_EDX + 8) & 0x800) == 0 || (iVar3 == 45000)))) { fVar4 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) / 100000.0; *(float *)((int)in_ECX + 0x154) = fVar4; *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 1; *(float *)(in_EDX + 0x28) = fVar4; } return; } pcVar5 = "Incorrect gAMA chunk length"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } } else { pcVar5 = "Invalid gAMA after IDAT"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } } uVar2 = __acrt_iob_func(2,"libpng warning: %s\n",pcVar5); FUN_008c5d50(uVar2); png_crc_finish(in_ECX,param_1); return; } //@@ 00ab06d0 FUN_00ab06d0 void FUN_00ab06d0(uint param_1) { undefined1 uVar1; undefined4 uVar2; uint uVar3; int iVar4; void *in_ECX; int in_EDX; byte local_8 [4]; local_8[0] = 0; local_8[1] = 0; local_8[2] = 0; local_8[3] = 0; uVar3 = *(uint *)((int)in_ECX + 0x60); if ((uVar3 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar3 & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid sBIT after IDAT"); FUN_008c5d50(uVar2); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } if ((uVar3 & 2) == 0) { if ((in_EDX != 0) && ((*(byte *)(in_EDX + 8) & 2) != 0)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } } else { FUN_00a64630(); } uVar3 = 3; if (*(char *)((int)in_ECX + 0x11e) != '\x03') { uVar3 = (uint)*(byte *)((int)in_ECX + 0x122); } if (param_1 != uVar3) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } png_crc_read(in_ECX,local_8,uVar3); iVar4 = png_crc_finish(in_ECX,0); if (iVar4 == 0) { if ((*(byte *)((int)in_ECX + 0x11e) & 2) == 0) { *(byte *)((int)in_ECX + 0x177) = local_8[0]; local_8[3] = local_8[1]; } else { *(byte *)((int)in_ECX + 0x174) = local_8[0]; *(byte *)((int)in_ECX + 0x175) = local_8[1]; *(byte *)((int)in_ECX + 0x176) = local_8[2]; } *(byte *)((int)in_ECX + 0x178) = local_8[3]; if (in_EDX != 0) { *(undefined4 *)(in_EDX + 0x44) = *(undefined4 *)((int)in_ECX + 0x174); uVar1 = *(undefined1 *)((int)in_ECX + 0x178); *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 2; *(undefined1 *)(in_EDX + 0x48) = uVar1; } } return; } //@@ 00ab0830 png_handle_cHRM /* DB: libpng: "Duplicate cHRM chunk", "Invalid cHRM white point", "wx=%f, wy=%f..."; called from the chunk loops png_read_end (00a97100) and 00a96980 png_read_info a weak ZHL match KAGE_Graphics_ImageManager::apply_frame_images) */ void __thiscall png_handle_cHRM(void *this) { uint uVar1; code *pcVar2; undefined4 uVar3; int iVar4; int in_EDX; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; uint in_stack_00000004; uint local_14; uVar1 = *(uint *)((int)this + 0x60); if ((uVar1 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar1 & 4) == 0) { if ((uVar1 & 2) == 0) { if ((in_EDX != 0) && ((*(uint *)(in_EDX + 8) & 0x804) == 4)) { FUN_00a64630(); png_crc_finish(this,in_stack_00000004); return; } } else if (*(code **)((int)this + 0x44) == (code *)0x0) { __acrt_iob_func(); FUN_008c5d50(); } else { (**(code **)((int)this + 0x44))(this); } if (in_stack_00000004 == 0x20) { png_crc_read(this,(byte *)&local_14,4); iVar4 = (((local_14 & 0xff) * 0x100 + (local_14 >> 8 & 0xff)) * 0x100 + (local_14 >> 0x10 & 0xff)) * 0x100 + (local_14 >> 0x18); fVar5 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; png_crc_read(this,(byte *)&local_14,4); iVar4 = (((local_14 & 0xff) * 0x100 + (local_14 >> 8 & 0xff)) * 0x100 + (local_14 >> 0x10 & 0xff)) * 0x100 + (local_14 >> 0x18); fVar10 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; if ((((fVar5 < 0.0) || (0.8 < fVar5)) || (fVar10 < 0.0)) || ((0.8 < fVar10 || (1.0 < fVar10 + fVar5)))) { if (*(code **)((int)this + 0x44) == (code *)0x0) { __acrt_iob_func(); FUN_008c5d50(); } else { (**(code **)((int)this + 0x44))(this,"Invalid cHRM white point"); } png_crc_finish(this,0x18); } else { png_crc_read(this,(byte *)&local_14,4); iVar4 = FUN_00aafe40(); fVar6 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; png_crc_read(this,(byte *)&local_14,4); iVar4 = FUN_00aafe40(); fVar11 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; if (((fVar6 < 0.0) || (0.8 < fVar6)) || ((fVar11 < 0.0 || ((0.8 < fVar11 || (1.0 < fVar11 + fVar6)))))) { FUN_00a64630(); png_crc_finish(this,0x10); return; } png_crc_read(this,(byte *)&local_14,4); iVar4 = FUN_00aafe40(); fVar7 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; png_crc_read(this,(byte *)&local_14,4); iVar4 = FUN_00aafe40(); fVar12 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; if ((((fVar7 < 0.0) || (0.8 < fVar7)) || (fVar12 < 0.0)) || ((0.8 < fVar12 || (1.0 < fVar12 + fVar7)))) { FUN_00a64630(); png_crc_finish(this,8); return; } png_crc_read(this,(byte *)&local_14,4); iVar4 = FUN_00aafe40(); fVar8 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; png_crc_read(this,(byte *)&local_14,4); iVar4 = FUN_00aafe40(); fVar9 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) / 100000.0; if (((fVar8 < 0.0) || (0.8 < fVar8)) || ((fVar9 < 0.0 || ((0.8 < fVar9 || (1.0 < fVar9 + fVar8)))))) { FUN_00a64630(); png_crc_finish(this,0); return; } iVar4 = png_crc_finish(this,0); if (iVar4 == 0) { if ((*(uint *)(in_EDX + 8) & 0x800) == 0) { *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 4; *(float *)(in_EDX + 0x80) = fVar5; *(float *)(in_EDX + 0x84) = fVar10; *(float *)(in_EDX + 0x88) = fVar6; *(float *)(in_EDX + 0x8c) = fVar11; *(float *)(in_EDX + 0x90) = fVar7; *(float *)(in_EDX + 0x94) = fVar12; *(float *)(in_EDX + 0x98) = fVar8; *(float *)(in_EDX + 0x9c) = fVar9; return; } if ((((0.001 < ABS(fVar5 - 0.3127)) || (0.001 < ABS(fVar10 - 0.329))) || (0.001 < ABS(fVar6 - 0.64))) || (((0.001 < ABS(fVar11 - 0.33) || (0.001 < ABS(fVar7 - 0.3))) || ((0.001 < ABS(fVar12 - 0.6) || ((0.001 < ABS(fVar8 - 0.15) || (0.001 < ABS(fVar9 - 0.06))))))))) { FUN_00a64630(); uVar3 = __acrt_iob_func(2,"wx=%f, wy=%f, rx=%f, ry=%f\n",(double)fVar5,(double)fVar10, (double)fVar6,(double)fVar11); FUN_008c5d50(uVar3); uVar3 = __acrt_iob_func(2,"gx=%f, gy=%f, bx=%f, by=%f\n",(double)fVar7,(double)fVar12, (double)fVar8,(double)fVar9); FUN_008c5d50(uVar3); return; } } } return; } pcVar2 = *(code **)((int)this + 0x44); if (pcVar2 == (code *)0x0) { __acrt_iob_func(); FUN_008c5d50(); png_crc_finish(this,in_stack_00000004); return; } } else { pcVar2 = *(code **)((int)this + 0x44); if (pcVar2 == (code *)0x0) { __acrt_iob_func(); FUN_008c5d50(); png_crc_finish(this,in_stack_00000004); return; } } (*pcVar2)(this); png_crc_finish(this,in_stack_00000004); return; } //@@ 00ab0fc0 png_handle_sRGB /* DB: libpng pngrutil.c: strings "Missing IHDR before sRGB", "Invalid sRGB after IDAT", "Out of place sRGB chunk", "Duplicate sRGB chunk", "Incorrect sRGB chunk length", "Unknown sRGB intent", "Ignoring incorrect gAMA value when sRGB is also present"; png_crc_read/png_crc_finish; called from the chunk dispatchers 00a96980/00a97100 png_read_end void png_handle_sRGB(uint param_1) { float fVar1; undefined4 uVar2; int iVar3; uint uVar4; void *in_ECX; int in_EDX; byte local_11; uVar4 = *(uint *)((int)in_ECX + 0x60); if ((uVar4 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar4 & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid sRGB after IDAT"); FUN_008c5d50(uVar2); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } if ((uVar4 & 2) == 0) { if ((in_EDX != 0) && ((*(uint *)(in_EDX + 8) & 0x800) != 0)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } } else if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar2 = __acrt_iob_func(2,"libpng warning: %s\n"); FUN_008c5d50(uVar2); } else { (**(code **)((int)in_ECX + 0x44))(); } if (param_1 != 1) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } png_crc_read(in_ECX,&local_11,1); iVar3 = png_crc_finish(in_ECX,0); if (iVar3 == 0) { if (3 < local_11) { FUN_00a64630(); return; } uVar4 = *(uint *)(in_EDX + 8); if (((uVar4 & 1) != 0) && (iVar3 = __dtoui3(), iVar3 != 45000)) { FUN_00a64630(); fVar1 = *(float *)((int)in_ECX + 0x154); uVar2 = __acrt_iob_func(); FUN_008c5d50(uVar2,"gamma=%f\n",(double)fVar1); uVar4 = *(uint *)(in_EDX + 8); } if (((uVar4 & 4) != 0) && (((((0.001 < ABS(*(float *)(in_EDX + 0x80) - 0.3127) || (0.001 < ABS(*(float *)(in_EDX + 0x84) - 0.329))) || (0.001 < ABS(*(float *)(in_EDX + 0x88) - 0.64))) || ((0.001 < ABS(*(float *)(in_EDX + 0x8c) - 0.33) || (0.001 < ABS(*(float *)(in_EDX + 0x90) - 0.3))))) || ((0.001 < ABS(*(float *)(in_EDX + 0x94) - 0.6) || ((0.001 < ABS(*(float *)(in_EDX + 0x98) - 0.15) || (0.001 < ABS(*(float *)(in_EDX + 0x9c) - 0.06))))))))) { FUN_00a64630(); } *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x805; *(byte *)(in_EDX + 0x2c) = local_11; *(undefined4 *)(in_EDX + 0x28) = 0x3ee66666; *(undefined4 *)(in_EDX + 0x80) = 0x3ea01a37; *(undefined4 *)(in_EDX + 0x84) = 0x3ea872b0; *(undefined4 *)(in_EDX + 0x88) = 0x3f23d70a; *(undefined4 *)(in_EDX + 0x8c) = 0x3ea8f5c3; *(undefined4 *)(in_EDX + 0x90) = 0x3e99999a; *(undefined4 *)(in_EDX + 0x94) = 0x3f19999a; *(undefined4 *)(in_EDX + 0x98) = 0x3e19999a; *(undefined4 *)(in_EDX + 0x9c) = 0x3d75c28f; } return; } //@@ 00ab1300 png_handle_tRNS /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngrutil.c: strings "Missing IHDR before tRNS", "Invalid tRNS after IDAT", "Duplicate tRNS chunk", "Missing PLTE before tRNS", "Incorrect tRNS chunk length", "Zero length tRNS chunk", "tRNS chunk not allowed with alpha channel"; palette (color_type 3) / gray / RGB cases, png_crc_read/finish; called from the chunk dispatchers 00a96980/00a97100 png_read_end void png_handle_tRNS(uint param_1) { char cVar1; uint uVar2; undefined2 uVar3; undefined4 uVar4; byte *buffer; int iVar5; short sVar6; void *in_ECX; int in_EDX; byte local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined1 local_b; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; uVar2 = *(uint *)((int)in_ECX + 0x60); if ((uVar2 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar2 & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar4 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid tRNS after IDAT"); FUN_008c5d50(uVar4); } else { (**(code **)((int)in_ECX + 0x44))(); } goto LAB_00ab1509; } if ((in_EDX != 0) && ((*(byte *)(in_EDX + 8) & 0x10) != 0)) goto LAB_00ab1502; cVar1 = *(char *)((int)in_ECX + 0x11e); if (cVar1 == '\x03') { if ((uVar2 & 2) == 0) { FUN_00a64630(); } else if (*(ushort *)((int)in_ECX + 0x110) < param_1) goto LAB_00ab1502; if (param_1 != 0) { buffer = malloc(param_1); if (buffer == (byte *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *(uint *)((int)in_ECX + 100) = *(uint *)((int)in_ECX + 100) | 0x2000; *(byte **)((int)in_ECX + 0x180) = buffer; png_crc_read(in_ECX,buffer,param_1); uVar3 = (undefined2)param_1; goto LAB_00ab1491; } FUN_00a64630(); param_1 = 0; goto LAB_00ab1509; } if (cVar1 == '\x02') { if (param_1 == 6) { png_crc_read(in_ECX,&local_10,6); *(ushort *)((int)in_ECX + 0x186) = CONCAT11(local_10,local_f); *(ushort *)((int)in_ECX + 0x188) = CONCAT11(local_e,local_d); *(ushort *)((int)in_ECX + 0x18a) = CONCAT11(local_c,local_b); goto LAB_00ab148c; } } else if ((cVar1 == '\0') && (param_1 == 2)) { png_crc_read(in_ECX,&local_10,2); *(ushort *)((int)in_ECX + 0x18c) = CONCAT11(local_10,local_f); LAB_00ab148c: uVar3 = 1; LAB_00ab1491: *(undefined2 *)((int)in_ECX + 0x112) = uVar3; iVar5 = png_crc_finish(in_ECX,0); if (iVar5 != 0) { return; } sVar6 = *(short *)((int)in_ECX + 0x112); if (in_EDX == 0) { return; } if (*(int *)((int)in_ECX + 0x180) != 0) { *(int *)(in_EDX + 0x4c) = *(int *)((int)in_ECX + 0x180); } if ((undefined8 *)((int)in_ECX + 0x184) != (undefined8 *)0x0) { *(undefined8 *)(in_EDX + 0x50) = *(undefined8 *)((int)in_ECX + 0x184); *(undefined2 *)(in_EDX + 0x58) = *(undefined2 *)((int)in_ECX + 0x18c); if (sVar6 == 0) { sVar6 = 1; } } *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x10; *(short *)(in_EDX + 0x16) = sVar6; return; } LAB_00ab1502: FUN_00a64630(); LAB_00ab1509: png_crc_finish(in_ECX,param_1); return; } //@@ 00ab1540 FUN_00ab1540 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00ab1540(uint param_1) { byte bVar1; undefined2 uVar2; ushort uVar3; undefined4 uVar4; uint uVar5; int iVar6; void *in_ECX; byte *pbVar7; int in_EDX; byte local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined1 local_b; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; uVar5 = *(uint *)((int)in_ECX + 0x60); if ((uVar5 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar5 & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar4 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid bKGD after IDAT"); FUN_008c5d50(uVar4); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } bVar1 = *(byte *)((int)in_ECX + 0x11e); if (((bVar1 != 3) || ((uVar5 & 2) != 0)) && ((in_EDX == 0 || ((*(byte *)(in_EDX + 8) & 0x20) == 0)))) { if (bVar1 == 3) { uVar5 = 1; } else { uVar5 = (bVar1 & 2 | 1) * 2; } if (param_1 == uVar5) { png_crc_read(in_ECX,&local_10,uVar5); iVar6 = png_crc_finish(in_ECX,0); if (iVar6 == 0) { if (*(byte *)((int)in_ECX + 0x11e) == 3) { *(byte *)((int)in_ECX + 0x130) = local_10; pbVar7 = (byte *)((uint)local_10 * 3 + *(int *)((int)in_ECX + 0x10c)); *(ushort *)((int)in_ECX + 0x132) = (ushort)*pbVar7; *(ushort *)((int)in_ECX + 0x134) = (ushort)pbVar7[1]; uVar3 = (ushort)pbVar7[2]; } else if ((*(byte *)((int)in_ECX + 0x11e) & 2) == 0) { uVar3 = CONCAT11(local_10,local_f); *(ushort *)((int)in_ECX + 0x138) = uVar3; *(ushort *)((int)in_ECX + 0x134) = uVar3; *(ushort *)((int)in_ECX + 0x132) = uVar3; } else { *(ushort *)((int)in_ECX + 0x132) = CONCAT11(local_10,local_f); *(ushort *)((int)in_ECX + 0x134) = CONCAT11(local_e,local_d); uVar3 = CONCAT11(local_c,local_b); } *(ushort *)((int)in_ECX + 0x136) = uVar3; if (in_EDX != 0) { *(undefined8 *)(in_EDX + 0x5a) = *(undefined8 *)((int)in_ECX + 0x130); uVar2 = *(undefined2 *)((int)in_ECX + 0x138); *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x20; *(undefined2 *)(in_EDX + 0x62) = uVar2; } } return; } } FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } //@@ 00ab1740 FUN_00ab1740 void FUN_00ab1740(uint param_1) { uint uVar1; undefined4 uVar2; void *pvVar3; void *in_ECX; int in_EDX; int iVar4; char *pcVar5; uint local_8; uVar1 = *(uint *)((int)in_ECX + 0x60); if ((uVar1 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar1 & 4) == 0) { if ((uVar1 & 2) != 0) { if ((in_EDX != 0) && ((*(byte *)(in_EDX + 8) & 0x40) != 0)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } if (param_1 != (uint)*(ushort *)((int)in_ECX + 0x110) * 2) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } local_8 = (int)param_1 / 2; if (local_8 * 2 == 0) { pvVar3 = (void *)0x0; } else { pvVar3 = malloc(local_8 * 2); if (pvVar3 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } uVar1 = local_8; *(uint *)((int)in_ECX + 100) = *(uint *)((int)in_ECX + 100) | 0x4000; iVar4 = 0; *(void **)((int)in_ECX + 0x1ec) = pvVar3; if (0 < (int)local_8) { do { png_crc_read(in_ECX,(byte *)&local_8,2); *(ushort *)(*(int *)((int)in_ECX + 0x1ec) + iVar4 * 2) = (short)((local_8 & 0xff) * 0x100) + ((ushort)local_8 >> 8); iVar4 = iVar4 + 1; } while (iVar4 < (int)uVar1); } iVar4 = png_crc_finish(in_ECX,0); if ((iVar4 == 0) && (in_EDX != 0)) { uVar2 = *(undefined4 *)((int)in_ECX + 0x1ec); *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x40; *(undefined4 *)(in_EDX + 0x7c) = uVar2; } return; } pcVar5 = "Missing PLTE before hIST"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } } else { pcVar5 = "Invalid hIST after IDAT"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } } uVar2 = __acrt_iob_func(2,"libpng warning: %s\n",pcVar5); FUN_008c5d50(uVar2); png_crc_finish(in_ECX,param_1); return; } //@@ 00ab18e0 FUN_00ab18e0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00ab18e0(uint param_1) { undefined4 uVar1; int iVar2; void *in_ECX; int in_EDX; byte local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; byte local_10; undefined4 local_f; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if ((*(uint *)((int)in_ECX + 0x60) & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((*(uint *)((int)in_ECX + 0x60) & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid pHYS after IDAT"); FUN_008c5d50(uVar1); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } if ((in_EDX != 0) && ((*(byte *)(in_EDX + 8) & 0x80) != 0)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } if (param_1 != 9) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } png_crc_read(in_ECX,&local_14,9); iVar2 = png_crc_finish(in_ECX,0); if ((iVar2 == 0) && (in_EDX != 0)) { *(uint *)(in_EDX + 0x70) = CONCAT31(CONCAT21(CONCAT11(local_14,local_13),local_12),local_11); *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x80; *(uint *)(in_EDX + 0x74) = (((uint)local_10 * 0x100 + (local_f & 0xff)) * 0x100 + (local_f >> 8 & 0xff)) * 0x100 + (local_f >> 0x10 & 0xff); *(undefined1 *)(in_EDX + 0x78) = local_f._3_1_; } return; } //@@ 00ab1a50 FUN_00ab1a50 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00ab1a50(uint param_1) { undefined4 uVar1; int iVar2; void *in_ECX; int in_EDX; byte local_14; undefined1 local_13; undefined1 local_12; undefined1 local_11; byte local_10; undefined4 local_f; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; if ((*(uint *)((int)in_ECX + 0x60) & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((*(uint *)((int)in_ECX + 0x60) & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar1 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid oFFs after IDAT"); FUN_008c5d50(uVar1); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } if ((in_EDX != 0) && ((*(uint *)(in_EDX + 8) & 0x100) != 0)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } if (param_1 != 9) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } png_crc_read(in_ECX,&local_14,9); iVar2 = png_crc_finish(in_ECX,0); if ((iVar2 == 0) && (in_EDX != 0)) { *(uint *)(in_EDX + 100) = CONCAT31(CONCAT21(CONCAT11(local_14,local_13),local_12),local_11); *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x100; *(uint *)(in_EDX + 0x68) = (((uint)local_10 * 0x100 + (local_f & 0xff)) * 0x100 + (local_f >> 8 & 0xff)) * 0x100 + (local_f >> 0x10 & 0xff); *(undefined1 *)(in_EDX + 0x6c) = local_f._3_1_; } return; } //@@ 00ab1bc0 png_handle_pCAL /* DB: libpng pngrutil.c: "Missing IHDR before pCAL", "Invalid pCAL after IDAT", "Duplicate pCAL chunk", "Invalid pCAL data", "Unrecognized equation type for pCAL chunk"; callers png_read_info and png_read_end */ void png_handle_pCAL(uint param_1) { byte bVar1; byte bVar2; byte bVar3; byte bVar4; byte bVar5; byte bVar6; byte bVar7; byte bVar8; byte bVar9; byte bVar10; byte bVar11; undefined4 uVar12; int iVar13; void *in_ECX; byte *pbVar14; int in_EDX; uint uVar15; byte *pbVar16; byte *pbVar17; code *pcVar18; char *pcVar19; void *local_10; byte *local_c; if ((*(uint *)((int)in_ECX + 0x60) & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((*(uint *)((int)in_ECX + 0x60) & 4) != 0) { if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar12 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid pCAL after IDAT"); FUN_008c5d50(uVar12); png_crc_finish(in_ECX,param_1); return; } (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } if ((in_EDX != 0) && ((*(uint *)(in_EDX + 8) & 0x400) != 0)) { FUN_00a64630(); png_crc_finish(in_ECX,param_1); return; } if (param_1 + 1 == 0) { local_c = (byte *)0x0; } else { local_c = malloc(param_1 + 1); if (local_c == (byte *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } png_crc_read(in_ECX,local_c,param_1); iVar13 = png_crc_finish(in_ECX,0); if (iVar13 != 0) { if (local_c == (byte *)0x0) { return; } free(local_c); return; } pbVar16 = local_c + param_1; *pbVar16 = 0; bVar1 = *local_c; pbVar14 = local_c; while (bVar1 != 0) { pbVar14 = pbVar14 + 1; bVar1 = *pbVar14; } if (pbVar14 + 0xc < pbVar16) { bVar1 = pbVar14[1]; bVar2 = pbVar14[2]; bVar3 = pbVar14[3]; bVar4 = pbVar14[4]; bVar5 = pbVar14[6]; bVar6 = pbVar14[5]; bVar7 = pbVar14[7]; bVar8 = pbVar14[8]; bVar9 = pbVar14[10]; bVar10 = pbVar14[9]; pbVar14 = pbVar14 + 0xb; if (bVar10 == 0) { if (bVar9 == 2) goto LAB_00ab1dcd; } else if ((bVar10 == 1) || (bVar10 == 2)) { if (bVar9 == 3) goto LAB_00ab1dcd; } else { if (bVar10 != 3) { if (3 < bVar10) { FUN_00a64630(); } LAB_00ab1dcd: bVar11 = *pbVar14; pbVar17 = pbVar14; while (bVar11 != 0) { pbVar17 = pbVar17 + 1; bVar11 = *pbVar17; } uVar15 = (uint)bVar9; if (uVar15 == 0) { local_10 = (void *)0x0; } else { local_10 = malloc(uVar15 * 4); if (local_10 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } iVar13 = 0; if (uVar15 != 0) { do { pbVar17 = pbVar17 + 1; *(byte **)((int)local_10 + iVar13 * 4) = pbVar17; bVar9 = *pbVar17; while (bVar9 != 0) { if (pbVar16 < pbVar17) goto LAB_00ab1e71; pbVar17 = pbVar17 + 1; bVar9 = *pbVar17; } if (pbVar16 < pbVar17) { LAB_00ab1e71: if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar12 = __acrt_iob_func(2,"libpng warning: %s\n","Invalid pCAL data"); FUN_008c5d50(uVar12); pcVar18 = free_exref; free(local_c); } else { (**(code **)((int)in_ECX + 0x44))(); pcVar18 = free_exref; free(local_c); } goto LAB_00ab1e5d; } iVar13 = iVar13 + 1; } while (iVar13 < (int)uVar15); } FUN_00a631f0(local_c,CONCAT31(CONCAT21(CONCAT11(bVar1,bVar2),bVar3),bVar4), CONCAT31(CONCAT21(CONCAT11(bVar6,bVar5),bVar7),bVar8),bVar10,uVar15,pbVar14, local_10); pcVar18 = free_exref; free(local_c); LAB_00ab1e5d: if (local_10 != (void *)0x0) { (*pcVar18)(local_10); } return; } if (bVar9 == 4) goto LAB_00ab1dcd; } pcVar19 = "Invalid pCAL parameters for equation type"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); free(local_c); return; } } else { pcVar19 = "Invalid pCAL data"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); free(local_c); return; } } uVar12 = __acrt_iob_func(2,"libpng warning: %s\n",pcVar19); FUN_008c5d50(uVar12); free(local_c); return; } //@@ 00ab1ef0 FUN_00ab1ef0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00ab1ef0(uint param_1) { uint uVar1; undefined4 uVar2; int iVar3; void *in_ECX; int in_EDX; char *pcVar4; undefined4 local_18; undefined4 local_14; byte local_10; undefined1 local_f; undefined1 local_e; undefined1 local_d; undefined1 local_c; undefined1 local_b; undefined1 local_a; undefined4 local_8; local_8 = __security_cookie ^ (int)register0x00000010 - 4U; uVar1 = *(uint *)((int)in_ECX + 0x60); if ((uVar1 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((in_EDX == 0) || ((*(uint *)(in_EDX + 8) & 0x200) == 0)) { if ((uVar1 & 4) != 0) { *(uint *)((int)in_ECX + 0x60) = uVar1 | 8; } if (param_1 == 7) { png_crc_read(in_ECX,&local_10,7); iVar3 = png_crc_finish(in_ECX,0); if (iVar3 == 0) { local_14 = CONCAT31(CONCAT21(CONCAT11(local_14._3_1_,local_a),local_b),local_c); local_18 = CONCAT22(CONCAT11(local_d,local_e),CONCAT11(local_10,local_f)); if (in_EDX != 0) { *(uint *)(in_EDX + 8) = *(uint *)(in_EDX + 8) | 0x200; *(undefined4 *)(in_EDX + 0x3c) = local_18; *(undefined4 *)(in_EDX + 0x40) = local_14; } } return; } pcVar4 = "Incorrect tIME chunk length"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } } else { pcVar4 = "Duplicate tIME chunk"; if (*(code **)((int)in_ECX + 0x44) != (code *)0x0) { (**(code **)((int)in_ECX + 0x44))(); png_crc_finish(in_ECX,param_1); return; } } uVar2 = __acrt_iob_func(2,"libpng warning: %s\n",pcVar4); FUN_008c5d50(uVar2); png_crc_finish(in_ECX,param_1); return; } //@@ 00ab2040 FUN_00ab2040 void FUN_00ab2040(uint param_1) { byte bVar1; uint uVar2; byte *buffer; int iVar3; byte *pbVar4; undefined4 *_Memory; void *in_ECX; byte *pbVar5; undefined4 extraout_ECX; uVar2 = *(uint *)((int)in_ECX + 0x60); if ((uVar2 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar2 & 4) != 0) { *(uint *)((int)in_ECX + 0x60) = uVar2 | 8; } if (param_1 + 1 == 0) { buffer = (byte *)0x0; } else { buffer = malloc(param_1 + 1); if (buffer == (byte *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } png_crc_read(in_ECX,buffer,param_1); iVar3 = png_crc_finish(in_ECX,0); if (iVar3 == 0) { buffer[param_1] = 0; bVar1 = *buffer; pbVar4 = buffer; while (bVar1 != 0) { pbVar4 = pbVar4 + 1; bVar1 = *pbVar4; } pbVar5 = pbVar4 + 1; if (pbVar4 == buffer + param_1) { pbVar5 = pbVar4; } _Memory = malloc(0x10); if (_Memory == (undefined4 *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *_Memory = 0xffffffff; _Memory[1] = buffer; _Memory[2] = pbVar5; FUN_00a63390(_Memory,extraout_ECX); free(_Memory); } else if (buffer != (byte *)0x0) { free(buffer); return; } return; } //@@ 00ab2140 png_handle_zTXt /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng pngrutil.c: 'Missing IHDR before zTXt', 'Zero length zTXt chunk', 'Unknown zTXt compression type %d', png_crc_read/png_crc_finish */ void png_handle_zTXt(uint param_1) { byte bVar1; uint uVar2; uint *puVar3; int iVar4; undefined4 uVar5; int iVar6; size_t _Size; int *_Memory; void *in_ECX; int iVar7; undefined4 extraout_ECX; int iVar8; size_t sVar9; byte *pbVar10; byte *pbVar11; size_t _Size_00; byte *_Dst; int local_50; byte *local_40; byte local_3c [52]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_3c + 0x38); local_50 = -1; uVar2 = *(uint *)((int)in_ECX + 0x60); if ((uVar2 & 1) == 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if ((uVar2 & 4) != 0) { *(uint *)((int)in_ECX + 0x60) = uVar2 | 8; } if (param_1 + 1 == 0) { local_40 = (byte *)0x0; } else { local_40 = malloc(param_1 + 1); if (local_40 == (byte *)0x0) { LAB_00ab2565: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } png_crc_read(in_ECX,local_40,param_1); iVar4 = png_crc_finish(in_ECX,0); if (iVar4 == 0) { local_40[param_1] = 0; bVar1 = *local_40; pbVar10 = local_40; while (bVar1 != 0) { pbVar10 = pbVar10 + 1; bVar1 = *pbVar10; } if (pbVar10 == local_40 + param_1) { pbVar11 = pbVar10; if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n","Zero length zTXt chunk"); FUN_008c5d50(uVar5); } else { (**(code **)((int)in_ECX + 0x44))(); } } else { local_50 = (int)(char)pbVar10[1]; pbVar11 = pbVar10 + 1; if (local_50 == 0) { pbVar10 = pbVar10 + 2; *(byte **)((int)in_ECX + 0x6c) = pbVar10; _Size_00 = (int)pbVar10 - (int)local_40; *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); pbVar10 = local_40 + (param_1 - (int)pbVar10); sVar9 = 0; _Dst = (byte *)0x0; *(byte **)((int)in_ECX + 0x70) = pbVar10; *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); while (pbVar10 != (byte *)0x0) { iVar4 = inflate((void *)((int)in_ECX + 0x6c)); if ((iVar4 != 0) && (iVar4 != 1)) { FUN_00a64630(); if ((in_ECX != (void *)0xffffff94) && (puVar3 = *(uint **)((int)in_ECX + 0x88), puVar3 != (uint *)0x0)) { *(undefined4 *)((int)in_ECX + 0x80) = 0; *(undefined4 *)((int)in_ECX + 0x74) = 0; *(undefined4 *)((int)in_ECX + 0x84) = 0; *puVar3 = -(uint)(puVar3[3] != 0) & 7; FUN_00abd870(0); } *(undefined4 *)((int)in_ECX + 0x70) = 0; if (_Dst == (byte *)0x0) { sVar9 = _Size_00 + 0x1b; if (sVar9 == 0) { _Dst = (byte *)0x0; } else { _Dst = malloc(sVar9); if (_Dst == (byte *)0x0) goto LAB_00ab2565; } memcpy(_Dst,local_40,_Size_00); } _Dst[sVar9 - 1] = 0; pbVar10 = (byte *)0x1b; if (local_40 + (param_1 - (int)_Dst) + -1 < (byte *)0x1a) { pbVar10 = local_40 + (param_1 - (int)_Dst); } memcpy(_Dst + _Size_00,s_Error_decoding_zTXt_chunk_00c5c538,(size_t)pbVar10); break; } iVar7 = *(int *)((int)in_ECX + 0x7c); if ((iVar7 == 0) || (iVar4 == 1)) { iVar8 = *(int *)((int)in_ECX + 0xa8); iVar6 = (iVar8 - iVar7) + 1; if (_Dst == (byte *)0x0) { sVar9 = iVar6 + _Size_00; if (sVar9 == 0) { _Dst = (byte *)0x0; } else { _Dst = malloc(sVar9); if (_Dst == (byte *)0x0) goto LAB_00ab2565; iVar8 = *(int *)((int)in_ECX + 0xa8); iVar7 = *(int *)((int)in_ECX + 0x7c); } memcpy(_Dst + _Size_00,*(void **)((int)in_ECX + 0xa4),iVar8 - iVar7); memcpy(_Dst,local_40,_Size_00); sVar9 = (*(int *)((int)in_ECX + 0xa8) - *(int *)((int)in_ECX + 0x7c)) + _Size_00; } else { _Size = iVar6 + sVar9; if (_Size == 0) { pbVar10 = (byte *)0x0; } else { pbVar10 = malloc(_Size); if (pbVar10 == (byte *)0x0) goto LAB_00ab2565; } memcpy(pbVar10,_Dst,sVar9); free(_Dst); memcpy(pbVar10 + sVar9,*(void **)((int)in_ECX + 0xa4), *(int *)((int)in_ECX + 0xa8) - *(int *)((int)in_ECX + 0x7c)); sVar9 = sVar9 + (*(int *)((int)in_ECX + 0xa8) - *(int *)((int)in_ECX + 0x7c)); _Dst = pbVar10; } _Dst[sVar9] = 0; if (iVar4 == 1) break; *(undefined4 *)((int)in_ECX + 0x78) = *(undefined4 *)((int)in_ECX + 0xa4); *(undefined4 *)((int)in_ECX + 0x7c) = *(undefined4 *)((int)in_ECX + 0xa8); } pbVar10 = *(byte **)((int)in_ECX + 0x70); } if ((in_ECX != (void *)0xffffff94) && (puVar3 = *(uint **)((int)in_ECX + 0x88), puVar3 != (uint *)0x0)) { *(undefined4 *)((int)in_ECX + 0x80) = 0; *(undefined4 *)((int)in_ECX + 0x74) = 0; *(undefined4 *)((int)in_ECX + 0x84) = 0; *puVar3 = -(uint)(puVar3[3] != 0) & 7; FUN_00abd870(0); } *(undefined4 *)((int)in_ECX + 0x70) = 0; free(local_40); pbVar11 = _Dst + _Size_00; local_40 = _Dst; } else { sprintf(local_3c,(byte *)"Unknown zTXt compression type %d"); if (*(code **)((int)in_ECX + 0x44) == (code *)0x0) { uVar5 = __acrt_iob_func(2,"libpng warning: %s\n",local_3c); FUN_008c5d50(uVar5); } else { (**(code **)((int)in_ECX + 0x44))(); } pbVar10 = (byte *)0x1b; if (local_40 + (param_1 - (int)pbVar11) + -1 < (byte *)0x1a) { pbVar10 = local_40 + (param_1 - (int)pbVar11); } memcpy(pbVar11,s_Error_decoding_zTXt_chunk_00c5c538,(size_t)pbVar10); } } _Memory = malloc(0x10); if (_Memory == (int *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } *_Memory = local_50; _Memory[1] = (int)local_40; _Memory[2] = (int)pbVar11; FUN_00a63390(_Memory,extraout_ECX); free(_Memory); } else if (local_40 != (byte *)0x0) { free(local_40); return; } return; } //@@ 00ab2580 FUN_00ab2580 void FUN_00ab2580(uint param_1) { byte bVar1; void *in_ECX; bVar1 = *(byte *)((int)in_ECX + 0x114); if (((0x51 < (byte)(bVar1 - 0x29)) || ((((0x5a < bVar1 && (bVar1 < 0x61)) || (bVar1 = *(byte *)((int)in_ECX + 0x115), 0x51 < (byte)(bVar1 - 0x29))) || ((0x5a < bVar1 && (bVar1 < 0x61)))))) || ((bVar1 = *(byte *)((int)in_ECX + 0x116), 0x51 < (byte)(bVar1 - 0x29) || (((0x5a < bVar1 && (bVar1 < 0x61)) || ((bVar1 = *(byte *)((int)in_ECX + 0x117), 0x51 < (byte)(bVar1 - 0x29) || ((0x5a < bVar1 && (bVar1 < 0x61)))))))))) { FUN_00a64710(); return; } if ((*(byte *)((int)in_ECX + 0x114) & 0x20) == 0) { FUN_00a64710(); return; } if ((*(uint *)((int)in_ECX + 0x60) & 4) != 0) { *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 8; } png_crc_finish(in_ECX,param_1); return; } //@@ 00ab2620 png_combine_row /* DB: libpng pngrutil.c: only caller the row reader FUN_00a96cc0 with the pass display mask table DAT_00b3db28[pass]; mask 0xff -> memcpy (row_info pixel_depth * width +7 >>3) from row_buf+1, else per-pixel masked merge honoring PNG_PACKSWAP (transformations & 0x10000) */ void png_combine_row(uint param_1) { uint uVar1; int in_ECX; uint uVar2; byte *in_EDX; byte bVar3; uint uVar4; byte *_Src; uint local_c; int local_8; uVar2 = (uint)*(byte *)(in_ECX + 0x103); if (param_1 == 0xff) { memcpy(in_EDX,(void *)(*(int *)(in_ECX + 0xe4) + 1),*(int *)(in_ECX + 0xc0) * uVar2 + 7 >> 3); return; } local_8 = *(int *)(in_ECX + 0xc0); _Src = (byte *)(*(int *)(in_ECX + 0xe4) + 1); if (uVar2 == 1) { uVar4 = *(uint *)(in_ECX + 0x68) & 0x10000; local_c = 0x80; uVar2 = 0; uVar1 = 0; if (uVar4 == 0) { uVar2 = 7; uVar1 = 7; } for (; local_8 != 0; local_8 = local_8 + -1) { if ((param_1 & local_c) != 0) { bVar3 = (byte)uVar2; *in_EDX = (byte)(0x7f7f >> (7 - bVar3 & 0x1f)) & *in_EDX | (*_Src >> (bVar3 & 0x1f) & 1) << (bVar3 & 0x1f); } if (uVar2 == (-(uint)(uVar4 != 0) & 7)) { _Src = _Src + 1; in_EDX = in_EDX + 1; uVar2 = uVar1; } else { uVar2 = uVar2 + (uint)(uVar4 != 0) * 2 + -1; } if (local_c == 1) { local_c = 0x80; } else { local_c = (int)local_c >> 1; } } } else if (uVar2 == 2) { uVar1 = *(uint *)(in_ECX + 0x68) & 0x10000; local_c = 0x80; uVar2 = 0; if (uVar1 == 0) { uVar2 = 6; } uVar4 = uVar2; if (local_8 != 0) { do { if ((param_1 & local_c) != 0) { bVar3 = (byte)uVar4; *in_EDX = (byte)(0x3f3f >> (6 - bVar3 & 0x1f)) & *in_EDX | (*_Src >> (bVar3 & 0x1f) & 3) << (bVar3 & 0x1f); } if (uVar4 == (-(uint)(uVar1 != 0) & 6)) { _Src = _Src + 1; in_EDX = in_EDX + 1; uVar4 = uVar2; } else { uVar4 = uVar4 + (uint)(uVar1 != 0) * 4 + -2; } if (local_c == 1) { local_c = 0x80; } else { local_c = (int)local_c >> 1; } local_8 = local_8 + -1; } while (local_8 != 0); return; } } else if (uVar2 == 4) { uVar1 = *(uint *)(in_ECX + 0x68) & 0x10000; local_c = 0x80; uVar2 = 0; if (uVar1 == 0) { uVar2 = 4; } uVar4 = uVar2; if (local_8 != 0) { do { if ((param_1 & local_c) != 0) { bVar3 = (byte)uVar4; *in_EDX = (byte)(0xf0f >> (4 - bVar3 & 0x1f)) & *in_EDX | (*_Src >> (bVar3 & 0x1f) & 0xf) << (bVar3 & 0x1f); } if (uVar4 == (-(uint)(uVar1 != 0) & 4)) { _Src = _Src + 1; in_EDX = in_EDX + 1; uVar4 = uVar2; } else { uVar4 = uVar4 + (uint)(uVar1 != 0) * 8 + -4; } if (local_c == 1) { local_c = 0x80; } else { local_c = (int)local_c >> 1; } local_8 = local_8 + -1; } while (local_8 != 0); return; } } else { uVar2 = (uint)(*(byte *)(in_ECX + 0x103) >> 3); bVar3 = 0x80; if (local_8 != 0) { do { if (((byte)param_1 & bVar3) != 0) { memcpy(in_EDX,_Src,uVar2); } _Src = _Src + uVar2; in_EDX = in_EDX + uVar2; if (bVar3 == 1) { bVar3 = 0x80; } else { bVar3 = bVar3 >> 1; } local_8 = local_8 + -1; } while (local_8 != 0); return; } } return; } //@@ 00ab28f0 png_do_read_interlace /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libpng: (row_info ECX, row EDX, pass, transformations): expands a row by png_pass_inc[pass] (table DAT_00b46840) with 1/2/4-bit paths honouring PNG_PACKSWAP (0x10000); called from png_read_row (00a96cc0) */ void png_do_read_interlace(int param_1,uint param_2) { byte bVar1; uint uVar2; byte *pbVar3; uint uVar4; uint *in_ECX; int in_EDX; int iVar5; void *_Dst; byte *pbVar6; uint uVar7; uint uVar8; uint uVar9; bool bVar10; uint local_34; int local_30; uint local_2c; uint local_28; byte *local_24; int local_20; byte *local_1c; byte *local_18; undefined1 local_10 [8]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10 + 0xc); if ((in_EDX != 0) && (in_ECX != (uint *)0x0)) { uVar2 = *in_ECX; uVar7 = uVar2 * *(int *)(&DAT_00b46840 + param_1 * 4); bVar1 = *(byte *)((int)in_ECX + 0xb); uVar9 = uVar7 - 1; if (bVar1 == 1) { local_18 = (byte *)((uVar2 - 1 >> 3) + in_EDX); pbVar6 = (byte *)((uVar9 >> 3) + in_EDX); param_2 = param_2 & 0x10000; local_1c = (byte *)(uVar2 - 1 & 7); local_28 = 0; uVar9 = uVar7 - 1 & 7; iVar5 = (uint)(param_2 == 0) * 2 + -1; uVar8 = 0; if (param_2 == 0) { uVar8 = 7; } uVar4 = -(uint)(param_2 != 0) & 7; if (uVar2 != 0) { if (param_2 == 0) { local_1c = (byte *)(7 - (int)local_1c); } if (param_2 == 0) { uVar9 = 7 - uVar9; } do { bVar1 = *local_18; local_20 = *(int *)(&DAT_00b46840 + param_1 * 4); if (0 < local_20) { do { *pbVar6 = (byte)(0x7f7f >> (7 - (byte)uVar9 & 0x1f)) & *pbVar6 | (bVar1 >> ((byte)local_1c & 0x1f) & 1) << ((byte)uVar9 & 0x1f); if (uVar9 == uVar8) { pbVar6 = pbVar6 + -1; uVar9 = uVar4; } else { uVar9 = uVar9 + iVar5; } local_20 = local_20 + -1; } while (local_20 != 0); } if (local_1c == (byte *)uVar8) { local_18 = local_18 + -1; local_1c = (byte *)uVar4; } else { local_1c = (byte *)((int)local_1c + iVar5); } local_28 = local_28 + 1; } while (local_28 < *in_ECX); } } else if (bVar1 == 2) { pbVar6 = (byte *)((uVar9 >> 2) + in_EDX); local_24 = (byte *)((uVar2 - 1 >> 2) + in_EDX); if ((param_2 & 0x10000) == 0) { local_2c = 0; local_1c = (byte *)0x6; local_18 = (byte *)0x2; local_28 = (3 - (uVar2 - 1 & 3)) * 2; uVar9 = (3 - (uVar7 - 1 & 3)) * 2; } else { local_2c = 6; local_18 = (byte *)0xfffffffe; local_28 = uVar2 * 2 - 1 & 6; uVar9 = uVar7 * 2 - 1 & 6; local_1c = (byte *)0x0; } local_34 = 0; if (uVar2 != 0) { do { bVar1 = *local_24; local_20 = *(int *)(&DAT_00b46840 + param_1 * 4); if (0 < local_20) { pbVar3 = pbVar6; do { uVar2 = (int)local_18 + uVar9; *pbVar3 = (byte)(0x3f3f >> (6 - (byte)uVar9 & 0x1f)) & *pbVar3 | (bVar1 >> ((byte)local_28 & 0x1f) & 3) << ((byte)uVar9 & 0x1f); bVar10 = (byte *)uVar9 != local_1c; pbVar6 = pbVar3 + -1; uVar9 = local_2c; if (bVar10) { pbVar6 = pbVar3; uVar9 = uVar2; } local_20 = local_20 + -1; pbVar3 = pbVar6; } while (local_20 != 0); } local_34 = local_34 + 1; pbVar3 = local_24 + -1; if ((byte *)local_28 != local_1c) { pbVar3 = local_24; } uVar2 = (int)local_18 + local_28; bVar10 = (byte *)local_28 != local_1c; local_28 = local_2c; if (bVar10) { local_28 = uVar2; } local_24 = pbVar3; } while (local_34 < *in_ECX); } } else if (bVar1 == 4) { pbVar6 = (byte *)((uVar9 >> 1) + in_EDX); if ((param_2 & 0x10000) == 0) { local_28 = 0; local_24 = (byte *)0x4; local_2c = (uVar2 - 1 & 1) * -4 + 4; local_30 = 4; uVar9 = (uVar7 - 1 & 1) * -4 + 4; } else { local_28 = 4; local_30 = -4; local_2c = uVar2 * -4 - 1 & 4; uVar9 = uVar7 * -4 - 1 & 4; local_24 = (byte *)0x0; } local_18 = (byte *)0x0; if (uVar2 != 0) { local_1c = (byte *)((uVar2 - 1 >> 1) + in_EDX); do { bVar1 = *local_1c; local_34 = *(uint *)(&DAT_00b46840 + param_1 * 4); if (0 < (int)local_34) { pbVar3 = pbVar6; do { uVar2 = local_30 + uVar9; *pbVar3 = (byte)(0xf0f >> (4 - (byte)uVar9 & 0x1f)) & *pbVar3 | (bVar1 >> ((byte)local_2c & 0x1f) & 0xf) << ((byte)uVar9 & 0x1f); bVar10 = (byte *)uVar9 != local_24; pbVar6 = pbVar3 + -1; uVar9 = local_28; if (bVar10) { pbVar6 = pbVar3; uVar9 = uVar2; } local_34 = local_34 + -1; pbVar3 = pbVar6; } while (local_34 != 0); } local_18 = (byte *)((int)local_18 + 1); pbVar3 = local_1c + -1; if ((byte *)local_2c != local_24) { pbVar3 = local_1c; } uVar2 = local_30 + local_2c; bVar10 = (byte *)local_2c != local_24; local_2c = local_28; if (bVar10) { local_2c = uVar2; } local_1c = pbVar3; } while (local_18 < *in_ECX); } } else { uVar8 = (uint)(bVar1 >> 3); local_1c = (byte *)((uVar2 - 1) * uVar8 + in_EDX); _Dst = (void *)(uVar9 * uVar8 + in_EDX); local_18 = (byte *)0x0; if (uVar2 != 0) { do { memcpy(local_10,local_1c,uVar8); iVar5 = *(int *)(&DAT_00b46840 + param_1 * 4); if (0 < iVar5) { do { memcpy(_Dst,local_10,uVar8); _Dst = (void *)((int)_Dst - uVar8); iVar5 = iVar5 + -1; } while (iVar5 != 0); } local_18 = (byte *)((int)local_18 + 1); local_1c = (byte *)((int)local_1c - uVar8); } while (local_18 < *in_ECX); } } *in_ECX = uVar7; in_ECX[1] = *(byte *)((int)in_ECX + 0xb) * uVar7 + 7 >> 3; } return; } //@@ 00ab2d80 png_read_filter_row /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: libpng: switch on filter type 0 none/1 sub/2 up/3 avg/4 paeth over (row, prev_row) with row_info bpp, default "Bad adaptive filter type"; from png_read_row 00a96cc0 png_read_row void png_read_filter_row(byte *param_1,byte *param_2,int param_3) { byte *pbVar1; undefined4 uVar2; undefined4 uVar3; uint uVar4; short sVar5; short sVar6; short sVar7; short sVar8; byte bVar9; byte bVar10; byte bVar11; byte bVar12; byte bVar13; byte bVar14; byte bVar15; byte bVar16; byte bVar17; byte bVar18; byte bVar19; byte bVar20; byte bVar21; byte bVar22; byte bVar23; byte bVar24; byte bVar25; byte bVar26; byte bVar27; byte bVar28; byte bVar29; byte bVar30; byte bVar31; byte bVar32; byte bVar33; byte bVar34; byte bVar35; byte bVar36; byte bVar37; byte bVar38; unkuint10 Var39; undefined1 auVar40 [13]; undefined1 auVar41 [11]; undefined1 auVar42 [13]; undefined1 auVar43 [11]; undefined1 auVar44 [13]; undefined1 auVar45 [13]; undefined1 auVar46 [14]; undefined1 auVar47 [14]; uint6 uVar48; uint6 uVar49; uint5 uVar50; uint5 uVar51; int iVar52; int iVar53; int iVar54; byte *pbVar55; int iVar56; int in_EDX; uint uVar57; uint uVar58; int iVar59; uint uVar60; byte *pbVar61; undefined1 auVar62 [16]; undefined1 auVar63 [16]; byte bVar70; ushort uVar71; undefined1 auVar66 [16]; undefined1 auVar65 [16]; undefined1 auVar64 [16]; undefined1 auVar67 [16]; undefined1 auVar68 [16]; undefined1 auVar69 [16]; byte bVar76; ushort uVar77; undefined1 auVar74 [16]; undefined1 auVar73 [16]; undefined1 auVar72 [16]; undefined1 auVar75 [16]; switch(param_3) { case 0: break; case 1: uVar57 = *(uint *)(in_EDX + 4); uVar60 = *(byte *)(in_EDX + 0xb) + 7 >> 3; uVar58 = uVar57 - uVar60; pbVar61 = param_1 + uVar60; if (uVar60 < uVar57) { if ((0x3f < uVar58) && ((param_1 + (uVar57 - 1) < pbVar61 + uVar60 || (pbVar61 + (uVar57 - 1) < pbVar61)))) { do { uVar60 = uVar60 + 0x40; bVar70 = param_1[1]; bVar76 = param_1[2]; bVar9 = param_1[3]; bVar10 = param_1[4]; bVar11 = param_1[5]; bVar12 = param_1[6]; bVar13 = param_1[7]; bVar14 = param_1[8]; bVar15 = param_1[9]; bVar16 = param_1[10]; bVar17 = param_1[0xb]; bVar18 = param_1[0xc]; bVar19 = param_1[0xd]; bVar20 = param_1[0xe]; bVar21 = param_1[0xf]; *pbVar61 = *param_1 + *pbVar61; pbVar61[1] = bVar70 + pbVar61[1]; pbVar61[2] = bVar76 + pbVar61[2]; pbVar61[3] = bVar9 + pbVar61[3]; pbVar61[4] = bVar10 + pbVar61[4]; pbVar61[5] = bVar11 + pbVar61[5]; pbVar61[6] = bVar12 + pbVar61[6]; pbVar61[7] = bVar13 + pbVar61[7]; pbVar61[8] = bVar14 + pbVar61[8]; pbVar61[9] = bVar15 + pbVar61[9]; pbVar61[10] = bVar16 + pbVar61[10]; pbVar61[0xb] = bVar17 + pbVar61[0xb]; pbVar61[0xc] = bVar18 + pbVar61[0xc]; pbVar61[0xd] = bVar19 + pbVar61[0xd]; pbVar61[0xe] = bVar20 + pbVar61[0xe]; pbVar61[0xf] = bVar21 + pbVar61[0xf]; bVar70 = param_1[0x11]; bVar76 = param_1[0x12]; bVar9 = param_1[0x13]; bVar10 = param_1[0x14]; bVar11 = param_1[0x15]; bVar12 = param_1[0x16]; bVar13 = param_1[0x17]; bVar14 = param_1[0x18]; bVar15 = param_1[0x19]; bVar16 = param_1[0x1a]; bVar17 = param_1[0x1b]; bVar18 = param_1[0x1c]; bVar19 = param_1[0x1d]; bVar20 = param_1[0x1e]; bVar21 = param_1[0x1f]; pbVar61[0x10] = param_1[0x10] + pbVar61[0x10]; pbVar61[0x11] = bVar70 + pbVar61[0x11]; pbVar61[0x12] = bVar76 + pbVar61[0x12]; pbVar61[0x13] = bVar9 + pbVar61[0x13]; pbVar61[0x14] = bVar10 + pbVar61[0x14]; pbVar61[0x15] = bVar11 + pbVar61[0x15]; pbVar61[0x16] = bVar12 + pbVar61[0x16]; pbVar61[0x17] = bVar13 + pbVar61[0x17]; pbVar61[0x18] = bVar14 + pbVar61[0x18]; pbVar61[0x19] = bVar15 + pbVar61[0x19]; pbVar61[0x1a] = bVar16 + pbVar61[0x1a]; pbVar61[0x1b] = bVar17 + pbVar61[0x1b]; pbVar61[0x1c] = bVar18 + pbVar61[0x1c]; pbVar61[0x1d] = bVar19 + pbVar61[0x1d]; pbVar61[0x1e] = bVar20 + pbVar61[0x1e]; pbVar61[0x1f] = bVar21 + pbVar61[0x1f]; bVar70 = param_1[0x21]; bVar76 = param_1[0x22]; bVar9 = param_1[0x23]; bVar10 = param_1[0x24]; bVar11 = param_1[0x25]; bVar12 = param_1[0x26]; bVar13 = param_1[0x27]; bVar14 = param_1[0x28]; bVar15 = param_1[0x29]; bVar16 = param_1[0x2a]; bVar17 = param_1[0x2b]; bVar18 = param_1[0x2c]; bVar19 = param_1[0x2d]; bVar20 = param_1[0x2e]; bVar21 = param_1[0x2f]; pbVar61[0x20] = param_1[0x20] + pbVar61[0x20]; pbVar61[0x21] = bVar70 + pbVar61[0x21]; pbVar61[0x22] = bVar76 + pbVar61[0x22]; pbVar61[0x23] = bVar9 + pbVar61[0x23]; pbVar61[0x24] = bVar10 + pbVar61[0x24]; pbVar61[0x25] = bVar11 + pbVar61[0x25]; pbVar61[0x26] = bVar12 + pbVar61[0x26]; pbVar61[0x27] = bVar13 + pbVar61[0x27]; pbVar61[0x28] = bVar14 + pbVar61[0x28]; pbVar61[0x29] = bVar15 + pbVar61[0x29]; pbVar61[0x2a] = bVar16 + pbVar61[0x2a]; pbVar61[0x2b] = bVar17 + pbVar61[0x2b]; pbVar61[0x2c] = bVar18 + pbVar61[0x2c]; pbVar61[0x2d] = bVar19 + pbVar61[0x2d]; pbVar61[0x2e] = bVar20 + pbVar61[0x2e]; pbVar61[0x2f] = bVar21 + pbVar61[0x2f]; pbVar55 = param_1 + 0x30; bVar70 = param_1[0x31]; bVar76 = param_1[0x32]; bVar9 = param_1[0x33]; bVar10 = param_1[0x34]; bVar11 = param_1[0x35]; bVar12 = param_1[0x36]; bVar13 = param_1[0x37]; bVar14 = param_1[0x38]; bVar15 = param_1[0x39]; bVar16 = param_1[0x3a]; bVar17 = param_1[0x3b]; bVar18 = param_1[0x3c]; bVar19 = param_1[0x3d]; bVar20 = param_1[0x3e]; bVar21 = param_1[0x3f]; param_1 = param_1 + 0x40; pbVar61[0x30] = *pbVar55 + pbVar61[0x30]; pbVar61[0x31] = bVar70 + pbVar61[0x31]; pbVar61[0x32] = bVar76 + pbVar61[0x32]; pbVar61[0x33] = bVar9 + pbVar61[0x33]; pbVar61[0x34] = bVar10 + pbVar61[0x34]; pbVar61[0x35] = bVar11 + pbVar61[0x35]; pbVar61[0x36] = bVar12 + pbVar61[0x36]; pbVar61[0x37] = bVar13 + pbVar61[0x37]; pbVar61[0x38] = bVar14 + pbVar61[0x38]; pbVar61[0x39] = bVar15 + pbVar61[0x39]; pbVar61[0x3a] = bVar16 + pbVar61[0x3a]; pbVar61[0x3b] = bVar17 + pbVar61[0x3b]; pbVar61[0x3c] = bVar18 + pbVar61[0x3c]; pbVar61[0x3d] = bVar19 + pbVar61[0x3d]; pbVar61[0x3e] = bVar20 + pbVar61[0x3e]; pbVar61[0x3f] = bVar21 + pbVar61[0x3f]; pbVar61 = pbVar61 + 0x40; } while (uVar60 < uVar57 - (uVar58 & 0x3f)); if (uVar57 <= uVar60) { return; } } iVar56 = uVar57 - uVar60; pbVar55 = pbVar61; do { *pbVar55 = *pbVar55 + pbVar55[(int)param_1 - (int)pbVar61]; iVar56 = iVar56 + -1; pbVar55 = pbVar55 + 1; } while (iVar56 != 0); } break; case 2: uVar57 = *(uint *)(in_EDX + 4); uVar58 = 0; if (uVar57 != 0) { if ((0x3f < uVar57) && ((param_2 + (uVar57 - 1) < param_1 || (param_1 + (uVar57 - 1) < param_2)))) { do { uVar58 = uVar58 + 0x40; bVar70 = param_2[1]; bVar76 = param_2[2]; bVar9 = param_2[3]; bVar10 = param_2[4]; bVar11 = param_2[5]; bVar12 = param_2[6]; bVar13 = param_2[7]; bVar14 = param_2[8]; bVar15 = param_2[9]; bVar16 = param_2[10]; bVar17 = param_2[0xb]; bVar18 = param_2[0xc]; bVar19 = param_2[0xd]; bVar20 = param_2[0xe]; bVar21 = param_2[0xf]; bVar22 = param_2[0x10]; bVar23 = param_2[0x11]; bVar24 = param_2[0x12]; bVar25 = param_2[0x13]; bVar26 = param_2[0x14]; bVar27 = param_2[0x15]; bVar28 = param_2[0x16]; bVar29 = param_2[0x17]; bVar30 = param_2[0x18]; bVar31 = param_2[0x19]; bVar32 = param_2[0x1a]; bVar33 = param_2[0x1b]; bVar34 = param_2[0x1c]; bVar35 = param_2[0x1d]; bVar36 = param_2[0x1e]; bVar37 = param_2[0x1f]; *param_1 = *param_1 + *param_2; param_1[1] = param_1[1] + bVar70; param_1[2] = param_1[2] + bVar76; param_1[3] = param_1[3] + bVar9; param_1[4] = param_1[4] + bVar10; param_1[5] = param_1[5] + bVar11; param_1[6] = param_1[6] + bVar12; param_1[7] = param_1[7] + bVar13; param_1[8] = param_1[8] + bVar14; param_1[9] = param_1[9] + bVar15; param_1[10] = param_1[10] + bVar16; param_1[0xb] = param_1[0xb] + bVar17; param_1[0xc] = param_1[0xc] + bVar18; param_1[0xd] = param_1[0xd] + bVar19; param_1[0xe] = param_1[0xe] + bVar20; param_1[0xf] = param_1[0xf] + bVar21; bVar70 = param_2[0x20]; bVar76 = param_2[0x21]; bVar9 = param_2[0x22]; bVar10 = param_2[0x23]; bVar11 = param_2[0x24]; bVar12 = param_2[0x25]; bVar13 = param_2[0x26]; bVar14 = param_2[0x27]; bVar15 = param_2[0x28]; bVar16 = param_2[0x29]; bVar17 = param_2[0x2a]; bVar18 = param_2[0x2b]; bVar19 = param_2[0x2c]; bVar20 = param_2[0x2d]; bVar21 = param_2[0x2e]; bVar38 = param_2[0x2f]; param_1[0x10] = param_1[0x10] + bVar22; param_1[0x11] = param_1[0x11] + bVar23; param_1[0x12] = param_1[0x12] + bVar24; param_1[0x13] = param_1[0x13] + bVar25; param_1[0x14] = param_1[0x14] + bVar26; param_1[0x15] = param_1[0x15] + bVar27; param_1[0x16] = param_1[0x16] + bVar28; param_1[0x17] = param_1[0x17] + bVar29; param_1[0x18] = param_1[0x18] + bVar30; param_1[0x19] = param_1[0x19] + bVar31; param_1[0x1a] = param_1[0x1a] + bVar32; param_1[0x1b] = param_1[0x1b] + bVar33; param_1[0x1c] = param_1[0x1c] + bVar34; param_1[0x1d] = param_1[0x1d] + bVar35; param_1[0x1e] = param_1[0x1e] + bVar36; param_1[0x1f] = param_1[0x1f] + bVar37; bVar22 = param_2[0x30]; bVar23 = param_2[0x31]; bVar24 = param_2[0x32]; bVar25 = param_2[0x33]; bVar26 = param_2[0x34]; bVar27 = param_2[0x35]; bVar28 = param_2[0x36]; bVar29 = param_2[0x37]; bVar30 = param_2[0x38]; bVar31 = param_2[0x39]; bVar32 = param_2[0x3a]; bVar33 = param_2[0x3b]; bVar34 = param_2[0x3c]; bVar35 = param_2[0x3d]; bVar36 = param_2[0x3e]; bVar37 = param_2[0x3f]; param_2 = param_2 + 0x40; param_1[0x20] = param_1[0x20] + bVar70; param_1[0x21] = param_1[0x21] + bVar76; param_1[0x22] = param_1[0x22] + bVar9; param_1[0x23] = param_1[0x23] + bVar10; param_1[0x24] = param_1[0x24] + bVar11; param_1[0x25] = param_1[0x25] + bVar12; param_1[0x26] = param_1[0x26] + bVar13; param_1[0x27] = param_1[0x27] + bVar14; param_1[0x28] = param_1[0x28] + bVar15; param_1[0x29] = param_1[0x29] + bVar16; param_1[0x2a] = param_1[0x2a] + bVar17; param_1[0x2b] = param_1[0x2b] + bVar18; param_1[0x2c] = param_1[0x2c] + bVar19; param_1[0x2d] = param_1[0x2d] + bVar20; param_1[0x2e] = param_1[0x2e] + bVar21; param_1[0x2f] = param_1[0x2f] + bVar38; param_1[0x30] = bVar22 + param_1[0x30]; param_1[0x31] = bVar23 + param_1[0x31]; param_1[0x32] = bVar24 + param_1[0x32]; param_1[0x33] = bVar25 + param_1[0x33]; param_1[0x34] = bVar26 + param_1[0x34]; param_1[0x35] = bVar27 + param_1[0x35]; param_1[0x36] = bVar28 + param_1[0x36]; param_1[0x37] = bVar29 + param_1[0x37]; param_1[0x38] = bVar30 + param_1[0x38]; param_1[0x39] = bVar31 + param_1[0x39]; param_1[0x3a] = bVar32 + param_1[0x3a]; param_1[0x3b] = bVar33 + param_1[0x3b]; param_1[0x3c] = bVar34 + param_1[0x3c]; param_1[0x3d] = bVar35 + param_1[0x3d]; param_1[0x3e] = bVar36 + param_1[0x3e]; param_1[0x3f] = bVar37 + param_1[0x3f]; param_1 = param_1 + 0x40; } while (uVar58 < (uVar57 & 0xffffffc0)); if (uVar57 <= uVar58) { return; } } iVar56 = uVar57 - uVar58; pbVar61 = param_1; do { *pbVar61 = *pbVar61 + pbVar61[(int)param_2 - (int)param_1]; iVar56 = iVar56 + -1; pbVar61 = pbVar61 + 1; } while (iVar56 != 0); return; } break; case 3: uVar57 = *(byte *)(in_EDX + 0xb) + 7 >> 3; uVar58 = *(int *)(in_EDX + 4) - uVar57; pbVar61 = param_1; for (; uVar57 != 0; uVar57 = uVar57 - 1) { /* WARNING: Read-only address (ram,0x00baba30) is written */ bVar70 = *param_2; param_2 = param_2 + 1; *pbVar61 = *pbVar61 + (bVar70 >> 1); pbVar61 = pbVar61 + 1; } /* WARNING: Read-only address (ram,0x00baba30) is written */ uVar57 = 0; if (uVar58 != 0) { if (((7 < uVar58) && ((param_2 + (uVar58 - 1) < pbVar61 || (pbVar61 + (uVar58 - 1) < param_2)))) && ((param_1 + (uVar58 - 1) < pbVar61 || (pbVar61 + (uVar58 - 1) < param_1)))) { do { uVar2 = *(undefined4 *)param_1; uVar3 = *(undefined4 *)param_2; uVar57 = uVar57 + 8; Var39 = CONCAT91((unkuint9)0,(char)((uint)uVar3 >> 0x18)); auVar41[10] = 0; auVar41._0_10_ = Var39; auVar66[4] = (char)((uint)uVar3 >> 0x10); auVar66._0_4_ = uVar3; auVar66._5_11_ = auVar41 << 8; auVar40[0xc] = 0; auVar40._0_12_ = auVar66._4_12_; auVar65._0_2_ = (ushort)uVar3; auVar65[2] = (char)((uint)uVar3 >> 8); auVar65._3_13_ = auVar40 << 8; auVar64._2_14_ = auVar65._2_14_; auVar64._0_2_ = auVar65._0_2_ & 0xff; uVar71 = (ushort)Var39; auVar46._10_2_ = 0; auVar46._0_10_ = auVar64._0_10_; auVar46._12_2_ = uVar71; uVar48 = CONCAT42(auVar46._10_4_,auVar66._4_2_); auVar67._0_4_ = auVar64._0_4_; auVar67._4_2_ = auVar65._2_2_; auVar67._6_10_ = (unkuint10)uVar48 << 0x10; Var39 = CONCAT91((unkuint9)0,(char)((uint)uVar2 >> 0x18)); auVar43[10] = 0; auVar43._0_10_ = Var39; auVar74[4] = (char)((uint)uVar2 >> 0x10); auVar74._0_4_ = uVar2; auVar74._5_11_ = auVar43 << 8; auVar42[0xc] = 0; auVar42._0_12_ = auVar74._4_12_; auVar73._0_2_ = (ushort)uVar2; auVar73[2] = (char)((uint)uVar2 >> 8); auVar73._3_13_ = auVar42 << 8; auVar72._2_14_ = auVar73._2_14_; auVar72._0_2_ = auVar73._0_2_ & 0xff; uVar77 = (ushort)Var39; auVar47._10_2_ = 0; auVar47._0_10_ = auVar72._0_10_; auVar47._12_2_ = uVar77; uVar49 = CONCAT42(auVar47._10_4_,auVar74._4_2_); auVar75._0_4_ = auVar72._0_4_; auVar75._4_2_ = auVar73._2_2_; auVar75._6_10_ = (unkuint10)uVar49 << 0x10; iVar56 = (int)uVar49 + (int)uVar48; uVar60 = *(uint *)(param_1 + 4); auVar62._0_4_ = (int)((auVar75._0_4_ & 0xffff) + (auVar67._0_4_ & 0xffff)) >> 1; auVar62._4_4_ = auVar75._4_4_ + auVar67._4_4_ >> 1; auVar62._8_4_ = (int)((-(uint)(iVar56 < 0) & 1) + iVar56) >> 1; auVar62._12_4_ = (int)((uint)uVar77 + (uint)uVar71) >> 1; param_1 = param_1 + 8; auVar62 = pshuflw(auVar62,auVar62,0xd8); auVar62 = pshufhw(auVar62,auVar62,0xd8); auVar68._4_4_ = auVar62._8_4_; auVar68._0_4_ = auVar62._0_4_; auVar68._8_4_ = auVar62._4_4_; auVar68._12_4_ = auVar62._12_4_; auVar68 = auVar68 & _DAT_00baba30; uVar2 = *(undefined4 *)pbVar61; sVar5 = auVar68._0_2_; sVar6 = auVar68._2_2_; sVar7 = auVar68._4_2_; sVar8 = auVar68._6_2_; *(uint *)pbVar61 = CONCAT13(((0 < sVar8) * (sVar8 < 0x100) * auVar68[6] - (0xff < sVar8)) + (char)((uint)uVar2 >> 0x18), CONCAT12(((0 < sVar7) * (sVar7 < 0x100) * auVar68[4] - (0xff < sVar7)) + (char)((uint)uVar2 >> 0x10), CONCAT11(((0 < sVar6) * (sVar6 < 0x100) * auVar68[2] - (0xff < sVar6)) + (char)((uint)uVar2 >> 8), ((0 < sVar5) * (sVar5 < 0x100) * auVar68[0] - (0xff < sVar5)) + (char)uVar2))); uVar4 = *(uint *)(param_2 + 4); param_2 = param_2 + 8; bVar70 = (byte)(uVar4 >> 0x18); auVar44[0xc] = bVar70; auVar44._0_12_ = ZEXT812(0); uVar50 = CONCAT32(auVar44._10_3_,(ushort)(byte)(uVar4 >> 0x10)); bVar76 = (byte)(uVar60 >> 0x18); auVar45[0xc] = bVar76; auVar45._0_12_ = ZEXT812(0); uVar51 = CONCAT32(auVar45._10_3_,(ushort)(byte)(uVar60 >> 0x10)); iVar56 = (int)uVar51 + (int)uVar50; auVar63._0_4_ = (int)((uVar60 & 0xff) + (uVar4 & 0xff)) >> 1; auVar63._4_4_ = (int)CONCAT82((ulonglong)uVar51 << 0x10,(ushort)(byte)(uVar60 >> 8)) + (int)CONCAT82((ulonglong)uVar50 << 0x10,(ushort)(byte)(uVar4 >> 8)) >> 1; auVar63._8_4_ = (int)((-(uint)(iVar56 < 0) & 1) + iVar56) >> 1; auVar63._12_4_ = (int)((uint)bVar76 + (uint)bVar70) >> 1; auVar62 = pshuflw(auVar63,auVar63,0xd8); auVar62 = pshufhw(auVar62,auVar62,0xd8); auVar69._4_4_ = auVar62._8_4_; auVar69._0_4_ = auVar62._0_4_; auVar69._8_4_ = auVar62._4_4_; auVar69._12_4_ = auVar62._12_4_; auVar69 = auVar69 & _DAT_00baba30; uVar2 = *(undefined4 *)(pbVar61 + 4); sVar5 = auVar69._0_2_; sVar6 = auVar69._2_2_; sVar7 = auVar69._4_2_; sVar8 = auVar69._6_2_; *(uint *)(pbVar61 + 4) = CONCAT13(((0 < sVar8) * (sVar8 < 0x100) * auVar69[6] - (0xff < sVar8)) + (char)((uint)uVar2 >> 0x18), CONCAT12(((0 < sVar7) * (sVar7 < 0x100) * auVar69[4] - (0xff < sVar7)) + (char)((uint)uVar2 >> 0x10), CONCAT11(((0 < sVar6) * (sVar6 < 0x100) * auVar69[2] - (0xff < sVar6)) + (char)((uint)uVar2 >> 8), ((0 < sVar5) * (sVar5 < 0x100) * auVar69[0] - (0xff < sVar5)) + (char)uVar2))); pbVar61 = pbVar61 + 8; } while (uVar57 < (uVar58 & 0xfffffff8)); if (uVar58 <= uVar57) { return; } } iVar56 = uVar58 - uVar57; pbVar55 = pbVar61; do { *pbVar55 = *pbVar55 + (char)((uint)pbVar55[(int)param_1 - (int)pbVar61] + (uint)*param_2 >> 1); iVar56 = iVar56 + -1; pbVar55 = pbVar55 + 1; param_2 = param_2 + 1; } while (iVar56 != 0); return; } break; case 4: uVar57 = *(byte *)(in_EDX + 0xb) + 7 >> 3; param_3 = *(int *)(in_EDX + 4) - uVar57; pbVar61 = param_1; pbVar55 = param_2; for (; uVar57 != 0; uVar57 = uVar57 - 1) { /* WARNING: Read-only address (ram,0x00baba30) is written */ bVar70 = *pbVar55; pbVar55 = pbVar55 + 1; *pbVar61 = *pbVar61 + bVar70; pbVar61 = pbVar61 + 1; } /* WARNING: Read-only address (ram,0x00baba30) is written */ if (param_3 != 0) { iVar59 = (int)param_1 - (int)param_2; iVar56 = (int)pbVar55 - (int)param_2; do { pbVar55 = param_2 + iVar56; bVar70 = *param_2; pbVar1 = param_2 + iVar59; uVar60 = (uint)*pbVar55 - (uint)bVar70; param_2 = param_2 + 1; uVar57 = (uint)*pbVar1 - (uint)bVar70; iVar52 = (uVar60 ^ (int)uVar60 >> 0x1f) - ((int)uVar60 >> 0x1f); iVar53 = (uVar57 ^ (int)uVar57 >> 0x1f) - ((int)uVar57 >> 0x1f); uVar58 = (int)(uVar57 + uVar60) >> 0x1f; iVar54 = (uVar57 + uVar60 ^ uVar58) - uVar58; if (((iVar53 < iVar52) || (bVar76 = *pbVar1, iVar54 < iVar52)) && (bVar76 = bVar70, iVar53 <= iVar54)) { bVar76 = *pbVar55; } *pbVar61 = *pbVar61 + bVar76; pbVar61 = pbVar61 + 1; param_3 = param_3 + -1; } while (param_3 != 0); return; } break; default: /* WARNING: Subroutine does not return */ FUN_00a64610(); } /* WARNING: Read-only address (ram,0x00baba30) is written */ return; } //@@ 00ab3120 png_read_finish_row /* DB: libpng 1.2 pngrutil.c: interlace pass advance, then drains IDAT ('Not enough image data', 'Call to NULL read function' via inlined png_read_data, png_crc_read/png_crc_finish), 'Extra compressed data', 'Decompression Error', 'Extra compression data'; called 7x from png_read_row (FUN_00a96cc0) */ void png_read_finish_row(void) { byte *pbVar1; uint uVar2; void *in_ECX; uint length; byte *pbVar3; byte bVar4; int iVar5; uint local_c; undefined1 local_5; *(int *)((int)in_ECX + 0xdc) = *(int *)((int)in_ECX + 0xdc) + 1; if (*(uint *)((int)in_ECX + 200) <= *(uint *)((int)in_ECX + 0xdc)) { if (*(char *)((int)in_ECX + 0x11b) != '\0') { *(undefined4 *)((int)in_ECX + 0xdc) = 0; memset(*(void **)((int)in_ECX + 0xe0),0,*(int *)((int)in_ECX + 0xd0) + 1); bVar4 = *(byte *)((int)in_ECX + 0x11c); do { bVar4 = bVar4 + 1; *(byte *)((int)in_ECX + 0x11c) = bVar4; if (6 < bVar4) goto LAB_00ab3209; local_c = (uint)bVar4 * 4; uVar2 = (*(int *)((int)in_ECX + 0xc0) + -1 + (*(uint *)(&DAT_00b46840 + local_c) - *(int *)(&DAT_00b46860 + local_c))) / *(uint *)(&DAT_00b46840 + local_c); *(uint *)((int)in_ECX + 0xd8) = uVar2; *(uint *)((int)in_ECX + 0xd4) = (*(byte *)((int)in_ECX + 0x121) * uVar2 + 7 >> 3) + 1; if ((*(byte *)((int)in_ECX + 0x68) & 2) != 0) { return; } *(uint *)((int)in_ECX + 200) = ((*(int *)((int)in_ECX + 0xc4) - *(int *)(&DAT_00b46820 + local_c)) + -1 + *(uint *)(&DAT_00b46800 + local_c)) / *(uint *)(&DAT_00b46800 + local_c); } while (uVar2 == 0); if (bVar4 < 7) { return; } } LAB_00ab3209: if ((*(byte *)((int)in_ECX + 100) & 0x20) == 0) { *(undefined4 *)((int)in_ECX + 0x7c) = 1; *(undefined1 **)((int)in_ECX + 0x78) = &local_5; do { if (*(int *)((int)in_ECX + 0x70) == 0) { uVar2 = *(uint *)((int)in_ECX + 0x104); if (uVar2 == 0) { pbVar1 = (byte *)((int)in_ECX + 0x114); do { png_crc_finish(in_ECX,0); if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) { LAB_00ab33cc: /* WARNING: Subroutine does not return */ FUN_00a64610(); } (**(code **)((int)in_ECX + 0x50))(); *(undefined4 *)((int)in_ECX + 0x108) = 0; *(uint *)((int)in_ECX + 0x104) = (((local_c & 0xff) * 0x100 + (local_c >> 8 & 0xff)) * 0x100 + (local_c >> 0x10 & 0xff)) * 0x100 + (local_c >> 0x18); if (*(code **)((int)in_ECX + 0x50) == (code *)0x0) goto LAB_00ab33cc; (**(code **)((int)in_ECX + 0x50))(); if ((*pbVar1 & 0x20) == 0) { if ((*(uint *)((int)in_ECX + 100) & 0x800) == 0) goto LAB_00ab32c5; } else if ((*(uint *)((int)in_ECX + 100) & 0x300) != 0x300) { LAB_00ab32c5: iVar5 = 4; uVar2 = ~*(uint *)((int)in_ECX + 0x108); pbVar3 = pbVar1; do { bVar4 = *pbVar3; pbVar3 = pbVar3 + 1; uVar2 = uVar2 >> 8 ^ *(uint *)(((bVar4 ^ uVar2) & 0xff) * 4 + 0xb4e460); iVar5 = iVar5 + -1; } while (iVar5 != 0); *(uint *)((int)in_ECX + 0x108) = ~uVar2; } if (*(int *)pbVar1 != DAT_00c12998) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } uVar2 = *(uint *)((int)in_ECX + 0x104); } while (uVar2 == 0); } length = *(uint *)((int)in_ECX + 0xa8); *(uint *)((int)in_ECX + 0x70) = length; *(byte **)((int)in_ECX + 0x6c) = *(byte **)((int)in_ECX + 0xa4); if (uVar2 < length) { *(uint *)((int)in_ECX + 0x70) = uVar2; length = uVar2; } png_crc_read(in_ECX,*(byte **)((int)in_ECX + 0xa4),length); *(int *)((int)in_ECX + 0x104) = *(int *)((int)in_ECX + 0x104) - *(int *)((int)in_ECX + 0x70); } iVar5 = inflate((void *)((int)in_ECX + 0x6c)); if (iVar5 == 1) { if (((*(int *)((int)in_ECX + 0x7c) != 0) && (*(int *)((int)in_ECX + 0x70) == 0)) && (*(int *)((int)in_ECX + 0x104) == 0)) { *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 8; *(uint *)((int)in_ECX + 100) = *(uint *)((int)in_ECX + 100) | 0x20; *(undefined4 *)((int)in_ECX + 0x7c) = 0; break; } goto LAB_00ab33b4; } if (iVar5 != 0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } if (*(int *)((int)in_ECX + 0x7c) == 0) { LAB_00ab33b4: /* WARNING: Subroutine does not return */ FUN_00a64610(); } } while( true ); } if ((*(int *)((int)in_ECX + 0x104) != 0) || (*(int *)((int)in_ECX + 0x70) != 0)) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } FUN_00aaf6b0(); *(uint *)((int)in_ECX + 0x60) = *(uint *)((int)in_ECX + 0x60) | 8; } return; } //@@ 00ab33f0 png_read_start_row /* DB: libpng 1.2: calls png_init_read_transformations, computes row buffer size, png_malloc ('Out of Memory'); called from FUN_00a96cc0 (png_read_row) and the image loader FUN_00a64a50 when PNG_FLAG_ROW_INIT (0x40) is unset */ void png_read_start_row(void) { char cVar1; uint uVar2; uint uVar3; uint uVar4; size_t _Size; void *pvVar5; int iVar6; int in_ECX; byte bVar7; uint local_c; *(undefined4 *)(in_ECX + 0x70) = 0; png_init_read_transformations(); uVar2 = *(uint *)(in_ECX + 0x68); uVar3 = *(uint *)(in_ECX + 0xc4); if (*(char *)(in_ECX + 0x11b) == '\0') { bVar7 = *(byte *)(in_ECX + 0x121); *(uint *)(in_ECX + 200) = uVar3; uVar3 = *(uint *)(in_ECX + 0xc0); uVar4 = *(uint *)(in_ECX + 0xd0); local_c = uVar3; } else { if ((uVar2 & 2) == 0) { uVar3 = uVar3 + 7 >> 3; } *(uint *)(in_ECX + 200) = uVar3; uVar3 = ((*(uint *)(&DAT_00b46840 + (uint)*(byte *)(in_ECX + 0x11c) * 4) - *(int *)(&DAT_00b46860 + (uint)*(byte *)(in_ECX + 0x11c) * 4)) + (*(uint *)(in_ECX + 0xc0) - 1)) / *(uint *)(&DAT_00b46840 + (uint)*(byte *)(in_ECX + 0x11c) * 4); bVar7 = *(byte *)(in_ECX + 0x121); uVar4 = bVar7 * uVar3 + 7 >> 3; local_c = *(uint *)(in_ECX + 0xc0); } *(uint *)(in_ECX + 0xd8) = uVar3; *(uint *)(in_ECX + 0xd4) = uVar4 + 1; uVar3 = (uint)bVar7; if (((uVar2 & 4) != 0) && (*(byte *)(in_ECX + 0x11f) < 8)) { uVar3 = 8; } uVar4 = uVar3; if ((uVar2 & 0x1000) != 0) { cVar1 = *(char *)(in_ECX + 0x11e); if (cVar1 == '\x03') { uVar4 = (uint)(*(short *)(in_ECX + 0x112) != 0) * 8 + 0x18; } else if (cVar1 == '\0') { if (uVar3 < 8) { uVar3 = 8; } uVar4 = uVar3 * 2; if (*(short *)(in_ECX + 0x112) == 0) { uVar4 = uVar3; } } else if ((cVar1 == '\x02') && (*(short *)(in_ECX + 0x112) != 0)) { uVar4 = (uVar3 * 4) / 3; } } if ((uVar2 & 0x8000) != 0) { cVar1 = *(char *)(in_ECX + 0x11e); if (cVar1 == '\x03') { uVar4 = 0x20; } else { if (cVar1 == '\0') { uVar3 = 0x10; if (8 < uVar4) { uVar3 = 0x20; } } else { if (cVar1 != '\x02') goto LAB_00ab355b; uVar3 = 0x40; if (uVar4 < 0x21) { uVar3 = 0x20; } } uVar4 = uVar3; } } LAB_00ab355b: if ((uVar2 & 0x4000) != 0) { if (((*(short *)(in_ECX + 0x112) == 0) || ((uVar2 & 0x1000) == 0)) && (*(char *)(in_ECX + 0x11e) != '\x04')) { if (uVar4 < 9) { uVar4 = 0x18; } else if (uVar4 < 0x11) { uVar4 = 0x30; } } else if (uVar4 < 0x11) { uVar4 = 0x20; } else if (uVar4 < 0x21) { uVar4 = 0x40; } } _Size = ((int)(uVar4 + 7) >> 3) + 1 + ((local_c + 7 & 0xfffffff8) * uVar4 >> 3); if (_Size == 0) { pvVar5 = (void *)0x0; } else { pvVar5 = malloc(_Size); if (pvVar5 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } } *(void **)(in_ECX + 0xe4) = pvVar5; iVar6 = *(int *)(in_ECX + 0xd0); if (iVar6 + 1U == 0) { pvVar5 = (void *)0x0; } else { pvVar5 = malloc(iVar6 + 1U); if (pvVar5 == (void *)0x0) { /* WARNING: Subroutine does not return */ FUN_00a64610(); } iVar6 = *(int *)(in_ECX + 0xd0); } *(void **)(in_ECX + 0xe0) = pvVar5; memset(pvVar5,0,iVar6 + 1); *(uint *)(in_ECX + 100) = *(uint *)(in_ECX + 100) | 0x40; return; } //@@ 00ab3640 FUN_00ab3640 void FUN_00ab3640(int param_1,int param_2,int param_3,size_t param_4) { undefined4 *puVar1; undefined4 *puVar2; void *_Src; void *_Dst; int in_ECX; int in_EDX; puVar1 = (undefined4 *)(in_ECX + in_EDX * 4); puVar2 = (undefined4 *)(param_1 + param_2 * 4); for (; 0 < param_3; param_3 = param_3 + -1) { _Src = (void *)*puVar1; puVar1 = puVar1 + 1; _Dst = (void *)*puVar2; puVar2 = puVar2 + 1; memcpy(_Dst,_Src,param_4); } return; } //@@ 00ab3690 alloc_small /* DB: libjpeg jmemmgr.c alloc_small(cinfo, pool_id, sizeofobject): JERR_OUT_OF_MEMORY (0x38) over MAX_ALLOC_CHUNK 1000000000, JERR_BAD_POOL_ID (0xf) for pool >= 2, first_pool_slop/extra_pool_slop tables, small_list walk; callers jpeg_CreateDecompress and other jmem users prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl alloc_small(void *cinfo,int poolId,uint sizeOfObject) { uint uVar1; int *piVar2; int iVar3; undefined4 *puVar4; uint uVar5; undefined4 *puVar6; undefined4 *puVar7; uint uVar8; uint uVar9; iVar3 = *(int *)((int)cinfo + 4); if (1000000000 < sizeOfObject) { *(undefined4 *)(*(int *)cinfo + 0x14) = 0x38; *(undefined4 *)(*(int *)cinfo + 0x18) = 7; (*(code *)**(undefined4 **)cinfo)(cinfo); } uVar8 = sizeOfObject + 7 & 0xfffffff8; uVar1 = uVar8 + 0x13; if (1000000000 < uVar1) { *(undefined4 *)(*(int *)cinfo + 0x14) = 0x38; *(undefined4 *)(*(int *)cinfo + 0x18) = 1; (*(code *)**(undefined4 **)cinfo)(cinfo); } if ((poolId < 0) || (1 < poolId)) { *(undefined4 *)(*(int *)cinfo + 0x14) = 0xf; *(int *)(*(int *)cinfo + 0x18) = poolId; (*(code *)**(undefined4 **)cinfo)(cinfo); } sizeOfObject = 0; puVar4 = (undefined4 *)(iVar3 + poolId * 4 + 0x34); puVar7 = (undefined4 *)*puVar4; while (puVar6 = puVar7, puVar6 != (undefined4 *)0x0) { if (uVar8 <= (uint)puVar6[2]) goto LAB_00ab37e1; sizeOfObject = (uint)puVar6; puVar7 = (undefined4 *)*puVar6; } if ((undefined4 *)sizeOfObject == (undefined4 *)0x0) { uVar5 = *(uint *)(&DAT_00b4f188 + poolId * 4); } else { uVar5 = *(uint *)(&DAT_00b4f204 + poolId * 4); } uVar9 = 1000000000 - uVar1; if (uVar5 <= 1000000000 - uVar1) { uVar9 = uVar5; } puVar6 = malloc(uVar9 + uVar1); while (puVar6 == (undefined4 *)0x0) { uVar9 = uVar9 >> 1; if (uVar9 < 0x32) { *(undefined4 *)(*(int *)cinfo + 0x14) = 0x38; *(undefined4 *)(*(int *)cinfo + 0x18) = 2; (*(code *)**(undefined4 **)cinfo)(cinfo); } puVar6 = malloc(uVar9 + uVar1); } piVar2 = (int *)(iVar3 + 0x4c); *piVar2 = *piVar2 + uVar9 + uVar1; *puVar6 = 0; puVar6[2] = uVar8 + uVar9; puVar6[1] = 0; if ((undefined4 *)sizeOfObject == (undefined4 *)0x0) { sizeOfObject = (uint)puVar4; } *(undefined4 **)sizeOfObject = puVar6; LAB_00ab37e1: puVar7 = puVar6 + 3; if (((uint)puVar7 & 7) != 0) { puVar7 = (undefined4 *)(((uint)puVar7 & 0xfffffff8) + 8); } iVar3 = puVar6[1]; puVar6[2] = puVar6[2] - uVar8; puVar6[1] = iVar3 + uVar8; return (void *)(iVar3 + (int)puVar7); } //@@ 00ab3810 FUN_00ab3810 undefined4 * FUN_00ab3810(int *param_1,int param_2,uint param_3) { int iVar1; undefined4 *puVar2; undefined4 *puVar3; uint uVar4; iVar1 = param_1[1]; if (1000000000 < param_3) { *(undefined4 *)(*param_1 + 0x14) = 0x38; *(undefined4 *)(*param_1 + 0x18) = 8; (**(code **)*param_1)(param_1); } uVar4 = param_3 + 7 & 0xfffffff8; if (1000000000 < uVar4 + 0x13) { *(undefined4 *)(*param_1 + 0x14) = 0x38; *(undefined4 *)(*param_1 + 0x18) = 3; (**(code **)*param_1)(param_1); } if ((param_2 < 0) || (1 < param_2)) { *(undefined4 *)(*param_1 + 0x14) = 0xf; *(int *)(*param_1 + 0x18) = param_2; (**(code **)*param_1)(param_1); } puVar2 = malloc(uVar4 + 0x13); if (puVar2 == (undefined4 *)0x0) { *(undefined4 *)(*param_1 + 0x14) = 0x38; *(undefined4 *)(*param_1 + 0x18) = 4; (**(code **)*param_1)(param_1); } puVar2[1] = uVar4; *(int *)(iVar1 + 0x4c) = *(int *)(iVar1 + 0x4c) + uVar4 + 0x13; *puVar2 = *(undefined4 *)(iVar1 + 0x3c + param_2 * 4); puVar3 = puVar2 + 3; *(undefined4 **)(iVar1 + 0x3c + param_2 * 4) = puVar2; puVar2[2] = 0; if (((uint)puVar3 & 7) != 0) { puVar3 = (undefined4 *)(((uint)puVar3 & 0xfffffff8) + 8); } return puVar3; } //@@ 00ab3900 alloc_sarray /* DB: libjpeg(-turbo) jmemmgr.c alloc_sarray (mem->pub +8 = 0xab3900 at 00a9d430): sample size by data_precision (+0x48 / +0x0c0 > 8 ->2), MAX_ALLOC_CHUNK 1000000000 (JERR_WIDTH_OVERFLOW 0x38), (1000000000-12)/rowsize rows per chunk, alloc_small for the pointer array */ void * alloc_sarray(int *param_1,int param_2,uint param_3,uint param_4) { int iVar1; int iVar2; uint uVar3; void *pvVar4; int iVar5; uint uVar6; uint uVar7; uint uVar8; uint uVar9; iVar5 = param_1[1]; if ((char)param_1[4] == '\0') { iVar1 = param_1[0x12]; } else { iVar1 = param_1[0x30]; } if (iVar1 < 0xd) { uVar8 = (8 < iVar1) + 1; } else { uVar8 = 2; } if (1000000000 < param_3) { *(undefined4 *)(*param_1 + 0x14) = 0x38; *(undefined4 *)(*param_1 + 0x18) = 9; (**(code **)*param_1)(param_1); } iVar2 = (int)(0x10 / (ulonglong)uVar8); uVar7 = (param_3 - 1) + iVar2 & -iVar2; uVar3 = (uint)(0x3b9ac9f4 / (ulonglong)(uVar8 * uVar7)); if (uVar3 == 0) { *(undefined4 *)(*param_1 + 0x14) = 0x48; (**(code **)*param_1)(param_1); } uVar9 = param_4; if ((int)uVar3 < (int)param_4) { uVar9 = uVar3; } *(uint *)(iVar5 + 0x50) = uVar9; uVar3 = param_4 * 4; if (iVar1 < 9) { pvVar4 = alloc_small(param_1,param_2,uVar3); uVar3 = 0; if (param_4 != 0) { do { uVar6 = param_4 - uVar3; if (uVar9 < param_4 - uVar3) { uVar6 = uVar9; } uVar9 = uVar6; iVar5 = FUN_00ab3810(param_1,param_2,uVar8 * uVar9 * uVar7); for (uVar6 = uVar9; uVar6 != 0; uVar6 = uVar6 - 1) { *(int *)((int)pvVar4 + uVar3 * 4) = iVar5; uVar3 = uVar3 + 1; iVar5 = iVar5 + uVar7; } } while (uVar3 < param_4); return pvVar4; } } else if (iVar1 < 0xd) { pvVar4 = alloc_small(param_1,param_2,uVar3); uVar3 = 0; if (param_4 != 0) { do { uVar6 = param_4 - uVar3; if (uVar9 < param_4 - uVar3) { uVar6 = uVar9; } uVar9 = uVar6; iVar5 = FUN_00ab3810(param_1,param_2,uVar8 * uVar9 * uVar7); if (uVar9 != 0) { uVar6 = uVar9; do { *(int *)((int)pvVar4 + uVar3 * 4) = iVar5; uVar3 = uVar3 + 1; iVar5 = iVar5 + uVar7 * 2; uVar6 = uVar6 - 1; } while (uVar6 != 0); } } while (uVar3 < param_4); return pvVar4; } } else { pvVar4 = alloc_small(param_1,param_2,uVar3); uVar3 = 0; if (param_4 != 0) { do { uVar6 = param_4 - uVar3; if (uVar9 < param_4 - uVar3) { uVar6 = uVar9; } uVar9 = uVar6; iVar5 = FUN_00ab3810(param_1,param_2,uVar8 * uVar9 * uVar7); if (uVar9 != 0) { uVar6 = uVar9; do { *(int *)((int)pvVar4 + uVar3 * 4) = iVar5; uVar3 = uVar3 + 1; iVar5 = iVar5 + uVar7 * 2; uVar6 = uVar6 - 1; } while (uVar6 != 0); } } while (uVar3 < param_4); } } return pvVar4; } //@@ 00ab3b30 FUN_00ab3b30 void * FUN_00ab3b30(int *param_1,int param_2,int param_3,uint param_4) { uint uVar1; void *pvVar2; uint uVar3; int iVar4; uint uVar5; iVar4 = param_1[1]; uVar1 = (uint)(0x3b9ac9f4 / (ulonglong)(uint)(param_3 * 0x80)); if (uVar1 == 0) { *(undefined4 *)(*param_1 + 0x14) = 0x48; (**(code **)*param_1)(param_1); } uVar5 = param_4; if ((int)uVar1 < (int)param_4) { uVar5 = uVar1; } *(uint *)(iVar4 + 0x50) = uVar5; pvVar2 = alloc_small(param_1,param_2,param_4 * 4); uVar1 = 0; if (param_4 != 0) { do { uVar3 = param_4 - uVar1; if (uVar5 < param_4 - uVar1) { uVar3 = uVar5; } iVar4 = FUN_00ab3810(param_1,param_2,uVar3 * param_3 * 0x80); for (uVar5 = uVar3; uVar5 != 0; uVar5 = uVar5 - 1) { *(int *)((int)pvVar2 + uVar1 * 4) = iVar4; uVar1 = uVar1 + 1; iVar4 = iVar4 + param_3 * 0x80; } uVar5 = uVar3; } while (uVar1 < param_4); } return pvVar2; } //@@ 00ab3bf0 FUN_00ab3bf0 undefined4 * FUN_00ab3bf0(int *param_1,int param_2,undefined1 param_3,undefined4 param_4,undefined4 param_5, undefined4 param_6) { int iVar1; undefined4 *puVar2; iVar1 = param_1[1]; if (param_2 != 1) { *(undefined4 *)(*param_1 + 0x14) = 0xf; *(int *)(*param_1 + 0x18) = param_2; (**(code **)*param_1)(param_1); } puVar2 = alloc_small(param_1,param_2,0x78); puVar2[1] = param_5; puVar2[2] = param_4; puVar2[3] = param_6; *puVar2 = 0; *(undefined1 *)(puVar2 + 8) = param_3; *(undefined1 *)((int)puVar2 + 0x22) = 0; puVar2[9] = *(undefined4 *)(iVar1 + 0x44); *(undefined4 **)(iVar1 + 0x44) = puVar2; return puVar2; } //@@ 00ab3c60 FUN_00ab3c60 undefined4 * FUN_00ab3c60(int *param_1,int param_2,undefined1 param_3,undefined4 param_4,undefined4 param_5, undefined4 param_6) { int iVar1; undefined4 *puVar2; iVar1 = param_1[1]; if (param_2 != 1) { *(undefined4 *)(*param_1 + 0x14) = 0xf; *(int *)(*param_1 + 0x18) = param_2; (**(code **)*param_1)(param_1); } puVar2 = alloc_small(param_1,param_2,0x78); puVar2[1] = param_5; puVar2[2] = param_4; puVar2[3] = param_6; *puVar2 = 0; *(undefined1 *)(puVar2 + 8) = param_3; *(undefined1 *)((int)puVar2 + 0x22) = 0; puVar2[9] = *(undefined4 *)(iVar1 + 0x48); *(undefined4 **)(iVar1 + 0x48) = puVar2; return puVar2; } //@@ 00ab3cd0 realize_virt_arrays /* DB: libjpeg jmemmgr.c: stored as mem->pub.realize_virt_arrays ([esi+0x18] at a9d44c in jinit_memory_mgr, inside jpeg_CreateDecompress); walks virt_sarray_list/virt_barray_list (mem+0x44/+0x48, next at +0x24) summing space (sample size 1 or 2 by data_precision), overflow -> JERR_OUT_OF_MEMORY (0x38) code 10, then alloc_sarray/alloc_barray (00ab3900/00ab3b30) */ void realize_virt_arrays(int *param_1) { int iVar1; int *piVar2; int iVar3; uint uVar4; uint uVar5; uint local_8; iVar1 = param_1[1]; if ((char)param_1[4] == '\0') { iVar3 = param_1[0x12]; } else { iVar3 = param_1[0x30]; } if (iVar3 < 0xd) { iVar3 = (8 < iVar3) + 1; } else { iVar3 = 2; } piVar2 = *(int **)(iVar1 + 0x44); uVar5 = 0; local_8 = 0; for (; piVar2 != (int *)0x0; piVar2 = (int *)piVar2[9]) { if (*piVar2 == 0) { uVar4 = piVar2[1] * piVar2[2] * iVar3; local_8 = local_8 + piVar2[3] * piVar2[2] * iVar3; if (~uVar5 < uVar4) { *(undefined4 *)(*param_1 + 0x14) = 0x38; *(undefined4 *)(*param_1 + 0x18) = 10; (**(code **)*param_1)(param_1); } uVar5 = uVar5 + uVar4; } } for (piVar2 = *(int **)(iVar1 + 0x48); piVar2 != (int *)0x0; piVar2 = (int *)piVar2[9]) { if (*piVar2 == 0) { local_8 = local_8 + piVar2[3] * piVar2[2] * 0x80; uVar4 = piVar2[1] * piVar2[2] * 0x80; if (~uVar5 < uVar4) { *(undefined4 *)(*param_1 + 0x14) = 0x38; *(undefined4 *)(*param_1 + 0x18) = 0xb; (**(code **)*param_1)(param_1); } uVar5 = uVar5 + uVar4; } } if (local_8 != 0) { uVar4 = *(uint *)(param_1[1] + 0x2c); if ((uVar4 == 0) || (uVar4 = -(uint)(*(uint *)(iVar1 + 0x4c) < uVar4) & uVar4 - *(uint *)(iVar1 + 0x4c), uVar5 <= uVar4)) { local_8 = 1000000000; } else { local_8 = uVar4 / local_8; if (local_8 == 0) { local_8 = 1; } } for (piVar2 = *(int **)(iVar1 + 0x44); piVar2 != (int *)0x0; piVar2 = (int *)piVar2[9]) { if (*piVar2 == 0) { iVar3 = piVar2[1]; if (local_8 < (iVar3 - 1U) / (uint)piVar2[3] + 1) { piVar2[4] = piVar2[3] * local_8; *(undefined4 *)(*param_1 + 0x14) = 0x33; (**(code **)*param_1)(param_1); iVar3 = piVar2[4]; *(undefined1 *)((int)piVar2 + 0x22) = 1; } else { piVar2[4] = iVar3; } iVar3 = alloc_sarray(param_1,1,piVar2[2],iVar3); *piVar2 = iVar3; piVar2[5] = *(int *)(iVar1 + 0x50); piVar2[6] = 0; piVar2[7] = 0; *(undefined1 *)((int)piVar2 + 0x21) = 0; } } for (piVar2 = *(int **)(iVar1 + 0x48); piVar2 != (int *)0x0; piVar2 = (int *)piVar2[9]) { if (*piVar2 == 0) { iVar3 = piVar2[1]; if (local_8 < (iVar3 - 1U) / (uint)piVar2[3] + 1) { piVar2[4] = piVar2[3] * local_8; *(undefined4 *)(*param_1 + 0x14) = 0x33; (**(code **)*param_1)(param_1); iVar3 = piVar2[4]; *(undefined1 *)((int)piVar2 + 0x22) = 1; } else { piVar2[4] = iVar3; } iVar3 = FUN_00ab3b30(param_1,1,piVar2[2],iVar3); *piVar2 = iVar3; piVar2[5] = *(int *)(iVar1 + 0x50); piVar2[6] = 0; piVar2[7] = 0; *(undefined1 *)((int)piVar2 + 0x21) = 0; } } } return; } //@@ 00ab3f20 FUN_00ab3f20 void FUN_00ab3f20(char param_1) { int iVar1; int iVar2; code *pcVar3; int in_ECX; int iVar4; int *in_EDX; int iVar5; int iVar6; int local_c; if (*(char *)(in_ECX + 0x10) == '\0') { iVar2 = *(int *)(in_ECX + 0x48); } else { iVar2 = *(int *)(in_ECX + 0xc0); } if (iVar2 < 0xd) { iVar2 = (8 < iVar2) + 1; } else { iVar2 = 2; } iVar1 = in_EDX[2]; iVar4 = in_EDX[4]; iVar5 = in_EDX[6] * iVar1 * iVar2; local_c = 0; if (0 < iVar4) { iVar6 = in_EDX[5]; do { if (iVar4 - local_c <= iVar6) { iVar6 = iVar4 - local_c; } iVar4 = in_EDX[7] - (in_EDX[6] + local_c); if (iVar6 < iVar4) { iVar4 = iVar6; } iVar6 = in_EDX[1] - (in_EDX[6] + local_c); if (iVar4 < iVar6) { iVar6 = iVar4; } if (iVar6 < 1) { return; } iVar6 = iVar6 * iVar1 * iVar2; if (param_1 == '\0') { pcVar3 = (code *)in_EDX[10]; } else { pcVar3 = (code *)in_EDX[0xb]; } (*pcVar3)(in_ECX,in_EDX + 10,*(undefined4 *)(*in_EDX + local_c * 4),iVar5,iVar6); iVar5 = iVar5 + iVar6; iVar6 = in_EDX[5]; iVar4 = in_EDX[4]; local_c = local_c + iVar6; } while (local_c < iVar4); } return; } //@@ 00ab3ff0 FUN_00ab3ff0 void FUN_00ab3ff0(char param_1) { int iVar1; int iVar2; code *pcVar3; undefined4 in_ECX; int *in_EDX; int iVar4; int iVar5; int local_c; local_c = 0; iVar1 = in_EDX[2]; iVar4 = in_EDX[6] * iVar1 * 0x80; iVar2 = in_EDX[4]; if (0 < iVar2) { iVar5 = in_EDX[5]; do { if (iVar2 - local_c <= iVar5) { iVar5 = iVar2 - local_c; } iVar2 = in_EDX[7] - (in_EDX[6] + local_c); if (iVar2 <= iVar5) { iVar5 = iVar2; } iVar2 = in_EDX[1] - (in_EDX[6] + local_c); if (iVar5 < iVar2) { iVar2 = iVar5; } if (iVar2 < 1) { return; } iVar2 = iVar2 * iVar1 * 0x80; if (param_1 == '\0') { pcVar3 = (code *)in_EDX[10]; } else { pcVar3 = (code *)in_EDX[0xb]; } (*pcVar3)(in_ECX,in_EDX + 10,*(undefined4 *)(*in_EDX + local_c * 4),iVar4,iVar2); iVar4 = iVar4 + iVar2; iVar5 = in_EDX[5]; iVar2 = in_EDX[4]; local_c = local_c + iVar5; } while (local_c < iVar2); } return; } //@@ 00ab4090 FUN_00ab4090 int FUN_00ab4090(int *param_1,int *param_2,uint param_3,uint param_4,char param_5) { uint uVar1; int iVar2; int *piVar3; int iVar4; uint uVar5; piVar3 = param_1; uVar1 = param_3 + param_4; if ((char)param_1[4] == '\0') { iVar4 = param_1[0x12]; } else { iVar4 = param_1[0x30]; } if (iVar4 < 0xd) { param_1 = (int *)((8 < iVar4) + 1); } else { param_1 = (int *)0x2; } if ((((uint)param_2[1] < uVar1) || ((uint)param_2[3] < param_4)) || (*param_2 == 0)) { *(undefined4 *)(*piVar3 + 0x14) = 0x17; (**(code **)*piVar3)(piVar3); } if ((param_3 < (uint)param_2[6]) || ((uint)(param_2[4] + param_2[6]) < uVar1)) { if (*(char *)((int)param_2 + 0x22) == '\0') { *(undefined4 *)(*piVar3 + 0x14) = 0x47; (**(code **)*piVar3)(piVar3); } if (*(char *)((int)param_2 + 0x21) != '\0') { FUN_00ab3f20(1); *(undefined1 *)((int)param_2 + 0x21) = 0; } uVar5 = param_3; if (param_3 <= (uint)param_2[6]) { uVar5 = 0; if (-1 < (int)(uVar1 - param_2[4])) { uVar5 = uVar1 - param_2[4]; } } param_2[6] = uVar5; FUN_00ab3f20(0); } uVar5 = param_2[7]; if (uVar5 < uVar1) { if (uVar5 < param_3) { if (param_5 != '\0') { *(undefined4 *)(*piVar3 + 0x14) = 0x17; (**(code **)*piVar3)(piVar3); } uVar5 = param_3; } if (param_5 != '\0') { param_2[7] = uVar1; } if ((char)param_2[8] != '\0') { iVar4 = param_2[2]; iVar2 = param_2[6]; for (uVar5 = uVar5 - param_2[6]; uVar5 < uVar1 - iVar2; uVar5 = uVar5 + 1) { memset(*(void **)(*param_2 + uVar5 * 4),0,iVar4 * (int)param_1); } goto LAB_00ab41cd; } if (param_5 == '\0') { *(undefined4 *)(*piVar3 + 0x14) = 0x17; (**(code **)*piVar3)(piVar3); return *param_2 + (param_3 - param_2[6]) * 4; } } else { LAB_00ab41cd: if (param_5 == '\0') goto LAB_00ab41d7; } *(undefined1 *)((int)param_2 + 0x21) = 1; LAB_00ab41d7: return *param_2 + (param_3 - param_2[6]) * 4; } //@@ 00ab4220 FUN_00ab4220 int FUN_00ab4220(int *param_1,int *param_2,uint param_3,uint param_4,char param_5) { uint uVar1; int iVar2; int iVar3; uint uVar4; uVar1 = param_3 + param_4; if ((((uint)param_2[1] < uVar1) || ((uint)param_2[3] < param_4)) || (*param_2 == 0)) { *(undefined4 *)(*param_1 + 0x14) = 0x17; (**(code **)*param_1)(param_1); } if ((param_3 < (uint)param_2[6]) || ((uint)(param_2[4] + param_2[6]) < uVar1)) { if (*(char *)((int)param_2 + 0x22) == '\0') { *(undefined4 *)(*param_1 + 0x14) = 0x47; (**(code **)*param_1)(param_1); } if (*(char *)((int)param_2 + 0x21) != '\0') { FUN_00ab3ff0(1); *(undefined1 *)((int)param_2 + 0x21) = 0; } uVar4 = param_3; if (param_3 <= (uint)param_2[6]) { uVar4 = 0; if (-1 < (int)(uVar1 - param_2[4])) { uVar4 = uVar1 - param_2[4]; } } param_2[6] = uVar4; FUN_00ab3ff0(0); } uVar4 = param_2[7]; if (uVar4 < uVar1) { if (uVar4 < param_3) { if (param_5 != '\0') { *(undefined4 *)(*param_1 + 0x14) = 0x17; (**(code **)*param_1)(param_1); } uVar4 = param_3; } if (param_5 != '\0') { param_2[7] = uVar1; } if ((char)param_2[8] != '\0') { iVar2 = param_2[2]; iVar3 = param_2[6]; for (uVar4 = uVar4 - param_2[6]; uVar4 < uVar1 - iVar3; uVar4 = uVar4 + 1) { memset(*(void **)(*param_2 + uVar4 * 4),0,iVar2 << 7); } goto LAB_00ab432d; } if (param_5 == '\0') { *(undefined4 *)(*param_1 + 0x14) = 0x17; (**(code **)*param_1)(param_1); return *param_2 + (param_3 - param_2[6]) * 4; } } else { LAB_00ab432d: if (param_5 == '\0') goto LAB_00ab4337; } *(undefined1 *)((int)param_2 + 0x21) = 1; LAB_00ab4337: return *param_2 + (param_3 - param_2[6]) * 4; } //@@ 00ab4370 FUN_00ab4370 void FUN_00ab4370(int *param_1,int param_2) { int iVar1; int iVar2; undefined4 *puVar3; int iVar4; undefined4 *puVar5; iVar1 = param_1[1]; if ((param_2 < 0) || (1 < param_2)) { *(undefined4 *)(*param_1 + 0x14) = 0xf; *(int *)(*param_1 + 0x18) = param_2; (**(code **)*param_1)(param_1); } if (param_2 == 1) { for (iVar2 = *(int *)(iVar1 + 0x44); iVar2 != 0; iVar2 = *(int *)(iVar2 + 0x24)) { if (*(char *)(iVar2 + 0x22) != '\0') { *(undefined1 *)(iVar2 + 0x22) = 0; (**(code **)(iVar2 + 0x30))(param_1,iVar2 + 0x28); } } iVar2 = *(int *)(iVar1 + 0x48); *(undefined4 *)(iVar1 + 0x44) = 0; for (; iVar2 != 0; iVar2 = *(int *)(iVar2 + 0x24)) { if (*(char *)(iVar2 + 0x22) != '\0') { *(undefined1 *)(iVar2 + 0x22) = 0; (**(code **)(iVar2 + 0x30))(param_1,iVar2 + 0x28); } } *(undefined4 *)(iVar1 + 0x48) = 0; } puVar3 = *(undefined4 **)(iVar1 + 0x3c + param_2 * 4); *(undefined4 *)(iVar1 + 0x3c + param_2 * 4) = 0; while (puVar3 != (undefined4 *)0x0) { iVar2 = puVar3[2]; iVar4 = puVar3[1]; puVar5 = (undefined4 *)*puVar3; free(puVar3); *(int *)(iVar1 + 0x4c) = *(int *)(iVar1 + 0x4c) - (iVar4 + iVar2 + 0x13); puVar3 = puVar5; } puVar3 = *(undefined4 **)(iVar1 + 0x34 + param_2 * 4); *(undefined4 *)(iVar1 + 0x34 + param_2 * 4) = 0; while (puVar3 != (undefined4 *)0x0) { iVar2 = puVar3[2]; iVar4 = puVar3[1]; puVar5 = (undefined4 *)*puVar3; free(puVar3); *(int *)(iVar1 + 0x4c) = *(int *)(iVar1 + 0x4c) - (iVar4 + iVar2 + 0x13); puVar3 = puVar5; } return; } //@@ 00ab4480 FUN_00ab4480 void FUN_00ab4480(int param_1) { int iVar1; int iVar2; undefined4 *puVar3; int iVar4; undefined4 *puVar5; int local_8; local_8 = 1; do { iVar1 = *(int *)(param_1 + 4); if (local_8 == 1) { for (iVar2 = *(int *)(iVar1 + 0x44); iVar2 != 0; iVar2 = *(int *)(iVar2 + 0x24)) { if (*(char *)(iVar2 + 0x22) != '\0') { *(undefined1 *)(iVar2 + 0x22) = 0; (**(code **)(iVar2 + 0x30))(param_1,iVar2 + 0x28); } } iVar2 = *(int *)(iVar1 + 0x48); *(undefined4 *)(iVar1 + 0x44) = 0; for (; iVar2 != 0; iVar2 = *(int *)(iVar2 + 0x24)) { if (*(char *)(iVar2 + 0x22) != '\0') { *(undefined1 *)(iVar2 + 0x22) = 0; (**(code **)(iVar2 + 0x30))(param_1,iVar2 + 0x28); } } *(undefined4 *)(iVar1 + 0x48) = 0; } puVar3 = *(undefined4 **)(iVar1 + 0x3c + local_8 * 4); *(undefined4 *)(iVar1 + 0x3c + local_8 * 4) = 0; while (puVar3 != (undefined4 *)0x0) { iVar2 = puVar3[2]; iVar4 = puVar3[1]; puVar5 = (undefined4 *)*puVar3; free(puVar3); *(int *)(iVar1 + 0x4c) = *(int *)(iVar1 + 0x4c) - (iVar4 + iVar2 + 0x13); puVar3 = puVar5; } puVar3 = *(undefined4 **)(iVar1 + 0x34 + local_8 * 4); *(undefined4 *)(iVar1 + 0x34 + local_8 * 4) = 0; while (puVar3 != (undefined4 *)0x0) { iVar2 = puVar3[2]; iVar4 = puVar3[1]; puVar5 = (undefined4 *)*puVar3; free(puVar3); *(int *)(iVar1 + 0x4c) = *(int *)(iVar1 + 0x4c) - (iVar4 + iVar2 + 0x13); puVar3 = puVar5; } local_8 = local_8 + -1; } while (-1 < local_8); free(*(void **)(param_1 + 4)); *(undefined4 *)(param_1 + 4) = 0; return; } //@@ 00ab45a0 initial_setup /* DB: libjpeg-turbo jcmaster.c (compressor): ECX=cinfo; image_height/width > JPEG_MAX_DIMENSION 0xffdc -> JERR_IMAGE_TOO_BIG (0x2a), data_precision 8/12 (or 2..16 when lossless, master+9) -> JERR_BAD_PRECISION (0x10), num_components > 10 -> JERR_COMPONENT_COUNT (0x1b), then per-component sampling factors; called from jinit_c_master_control 00ab4b10 */ void initial_setup(void) { int *in_ECX; int iVar1; int iVar2; int iVar3; int iVar4; int *piVar5; int local_c; int local_8; iVar4 = 8; iVar1 = in_ECX[100]; if (*(char *)(iVar1 + 9) != '\0') { iVar4 = 1; } if ((0xffdc < in_ECX[8]) || (0xffdc < in_ECX[7])) { *(undefined4 *)(*in_ECX + 0x14) = 0x2a; *(undefined4 *)(*in_ECX + 0x18) = 0xffdc; (**(code **)*in_ECX)(); iVar1 = in_ECX[100]; } iVar3 = in_ECX[0x30]; if (*(char *)(iVar1 + 9) == '\0') { if ((iVar3 == 8) || (iVar3 == 0xc)) goto LAB_00ab4638; } else if ((1 < iVar3) && (iVar3 < 0x11)) goto LAB_00ab4638; *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); LAB_00ab4638: iVar1 = in_ECX[9]; if (10 < iVar1) { *(undefined4 *)(*in_ECX + 0x14) = 0x1b; *(int *)(*in_ECX + 0x18) = in_ECX[9]; *(undefined4 *)(*in_ECX + 0x1c) = 10; (**(code **)*in_ECX)(); iVar1 = in_ECX[9]; } iVar3 = in_ECX[0x31]; iVar2 = 1; in_ECX[0x44] = 1; in_ECX[0x45] = 1; local_8 = 0; if (0 < iVar1) { iVar3 = 1; piVar5 = (int *)(in_ECX[0x31] + 0xc); do { iVar1 = piVar5[-1]; if (((3 < iVar1 - 1U) || (*piVar5 < 1)) || (4 < *piVar5)) { *(undefined4 *)(*in_ECX + 0x14) = 0x13; (**(code **)*in_ECX)(); iVar3 = in_ECX[0x44]; iVar1 = piVar5[-1]; iVar2 = in_ECX[0x45]; } if (iVar3 <= iVar1) { iVar3 = iVar1; } in_ECX[0x44] = iVar3; if (iVar2 <= *piVar5) { iVar2 = *piVar5; } local_8 = local_8 + 1; in_ECX[0x45] = iVar2; piVar5 = piVar5 + 0x16; iVar1 = in_ECX[9]; } while (local_8 < iVar1); iVar3 = in_ECX[0x31]; } in_ECX[0x60] = iVar4; in_ECX[0x61] = (int)&DAT_00b4fd00; in_ECX[0x62] = 0x3f; in_ECX[0x47] = iVar4; in_ECX[0x46] = iVar4; local_c = 0; if (0 < iVar1) { piVar5 = (int *)(iVar3 + 0x24); local_8 = 0x3c; while( true ) { piVar5[1] = iVar4; *piVar5 = iVar4; piVar5[-2] = (in_ECX[7] * piVar5[-7] + -1 + in_ECX[0x44] * iVar4) / (in_ECX[0x44] * iVar4); piVar5[-1] = (in_ECX[8] * piVar5[-6] + -1 + in_ECX[0x45] * iVar4) / (in_ECX[0x45] * iVar4); *(undefined4 *)(local_8 + -0x28 + in_ECX[100]) = 0; *(int *)(local_8 + in_ECX[100]) = piVar5[-2] + -1; piVar5[2] = (in_ECX[7] * piVar5[-7] + -1 + in_ECX[0x44]) / in_ECX[0x44]; iVar1 = in_ECX[8]; iVar3 = in_ECX[0x45]; *(undefined1 *)(piVar5 + 4) = 1; piVar5[0xb] = 0; piVar5[3] = (iVar1 * piVar5[-6] + -1 + iVar3) / iVar3; piVar5 = piVar5 + 0x16; local_c = local_c + 1; iVar1 = in_ECX[9]; if (iVar1 <= local_c) break; local_8 = local_8 + 4; } iVar2 = in_ECX[0x45]; } in_ECX[0x48] = (in_ECX[8] + -1 + iVar2 * iVar4) / (iVar2 * iVar4); if ((in_ECX[0x4a] < iVar1) || (*(char *)((int)in_ECX + 0xc9) != '\0')) { *(undefined1 *)(in_ECX[0x68] + 0x10) = 1; return; } *(undefined1 *)(in_ECX[0x68] + 0x10) = 0; return; } //@@ 00ab4850 FUN_00ab4850 uint FUN_00ab4850(void) { uint uVar1; int *in_ECX; uint uVar2; uint uVar3; int iVar4; int iVar5; int *local_c; uint local_8; iVar4 = 8; iVar5 = in_ECX[0x4a]; if (*(char *)(in_ECX[100] + 9) != '\0') { iVar4 = 1; } if (iVar5 == 1) { iVar5 = in_ECX[0x4b]; in_ECX[0x4f] = *(int *)(iVar5 + 0x1c); in_ECX[0x50] = *(int *)(iVar5 + 0x20); *(undefined4 *)(iVar5 + 0x44) = *(undefined4 *)(iVar5 + 0x24); uVar1 = *(uint *)(iVar5 + 0x20); uVar3 = *(uint *)(iVar5 + 0xc); uVar2 = uVar1 % uVar3; *(undefined4 *)(iVar5 + 0x38) = 1; *(undefined4 *)(iVar5 + 0x3c) = 1; *(undefined4 *)(iVar5 + 0x40) = 1; if (uVar2 == 0) { uVar2 = *(uint *)(iVar5 + 0xc); } *(undefined4 *)(iVar5 + 0x48) = 1; *(uint *)(iVar5 + 0x4c) = uVar2; in_ECX[0x51] = 1; in_ECX[0x52] = 0; return uVar1 / uVar3; } if ((iVar5 < 1) || (4 < iVar5)) { *(undefined4 *)(*in_ECX + 0x14) = 0x1b; *(int *)(*in_ECX + 0x18) = in_ECX[0x4a]; *(undefined4 *)(*in_ECX + 0x1c) = 4; (**(code **)*in_ECX)(); iVar5 = in_ECX[0x4a]; } in_ECX[0x51] = 0; local_8 = 0; in_ECX[0x4f] = (in_ECX[7] + -1 + in_ECX[0x44] * iVar4) / (in_ECX[0x44] * iVar4); uVar1 = (in_ECX[8] + -1 + in_ECX[0x45] * iVar4) / (in_ECX[0x45] * iVar4); in_ECX[0x50] = uVar1; if (0 < iVar5) { local_c = in_ECX + 0x4b; do { iVar5 = *local_c; uVar1 = *(uint *)(iVar5 + 0xc); uVar3 = *(uint *)(iVar5 + 8); iVar4 = uVar1 * uVar3; *(uint *)(iVar5 + 0x38) = uVar3; *(uint *)(iVar5 + 0x3c) = uVar1; *(int *)(iVar5 + 0x40) = iVar4; *(uint *)(iVar5 + 0x44) = *(int *)(iVar5 + 0x24) * uVar3; uVar2 = *(uint *)(iVar5 + 0x1c) % uVar3; if (uVar2 == 0) { uVar2 = uVar3; } *(uint *)(iVar5 + 0x48) = uVar2; uVar3 = *(uint *)(iVar5 + 0x20) % uVar1; if (uVar3 == 0) { uVar3 = uVar1; } *(uint *)(iVar5 + 0x4c) = uVar3; if (10 < in_ECX[0x51] + iVar4) { *(undefined4 *)(*in_ECX + 0x14) = 0xe; (**(code **)*in_ECX)(); } for (; 0 < iVar4; iVar4 = iVar4 + -1) { in_ECX[in_ECX[0x51] + 0x52] = local_8; in_ECX[0x51] = in_ECX[0x51] + 1; } uVar1 = local_8 + 1; local_c = local_c + 1; local_8 = uVar1; } while ((int)uVar1 < in_ECX[0x4a]); } return uVar1; } //@@ 00ab4a00 FUN_00ab4a00 void FUN_00ab4a00(int *param_1) { int iVar1; uint uVar2; int *piVar3; undefined4 *puVar4; int iVar5; undefined4 *puVar6; undefined4 *puVar7; int *local_8; piVar3 = param_1; FUN_00ab4850(); if ((*(char *)(param_1[100] + 9) == '\0') && (param_1 = (int *)0x0, 0 < piVar3[0x4a])) { local_8 = piVar3 + 0x4b; do { iVar1 = *local_8; if (*(int *)(iVar1 + 0x50) == 0) { uVar2 = *(uint *)(iVar1 + 0x10); if ((3 < uVar2) || (piVar3[uVar2 + 0x24] == 0)) { *(undefined4 *)(*piVar3 + 0x14) = 0x36; *(uint *)(*piVar3 + 0x18) = uVar2; (**(code **)*piVar3)(piVar3); } puVar4 = (undefined4 *)(**(code **)piVar3[1])(piVar3,1,0x82); puVar6 = (undefined4 *)piVar3[uVar2 + 0x24]; puVar7 = puVar4; for (iVar5 = 0x20; iVar5 != 0; iVar5 = iVar5 + -1) { *puVar7 = *puVar6; puVar6 = puVar6 + 1; puVar7 = puVar7 + 1; } *(undefined2 *)puVar7 = *(undefined2 *)puVar6; *(undefined4 **)(iVar1 + 0x50) = puVar4; } param_1 = (int *)((int)param_1 + 1); local_8 = local_8 + 1; } while ((int)param_1 < piVar3[0x4a]); } (**(code **)piVar3[0x6a])(piVar3); (**(code **)piVar3[0x66])(piVar3); *(undefined4 *)piVar3[0x68] = *(undefined4 *)(piVar3[0x66] + 4); return; } //@@ 00ab4af0 FUN_00ab4af0 void FUN_00ab4af0(int param_1) { **(undefined4 **)(param_1 + 0x1a0) = FUN_00ab4b10; return; } //@@ 00ab4b10 FUN_00ab4b10 int FUN_00ab4b10(int *param_1) { int iVar1; int iVar2; iVar1 = param_1[0x68]; if (*(char *)(iVar1 + 0x11) != '\0') { return 2; } iVar2 = (**(code **)(param_1[0x69] + 4))(param_1); if (iVar2 == 1) { if (*(char *)(iVar1 + 0x14) != '\0') { initial_setup(); *(undefined1 *)(iVar1 + 0x14) = 0; return 1; } if (*(char *)(iVar1 + 0x10) == '\0') { *(undefined4 *)(*param_1 + 0x14) = 0x24; (**(code **)*param_1)(param_1); } FUN_00ab4a00(param_1); } else if (iVar2 == 2) { *(undefined1 *)(iVar1 + 0x11) = 1; if (*(char *)(iVar1 + 0x14) == '\0') { if (param_1[0x1f] < param_1[0x21]) { param_1[0x21] = param_1[0x1f]; return 2; } } else if (*(char *)(param_1[0x69] + 0xd) != '\0') { *(undefined4 *)(*param_1 + 0x14) = 0x3d; (**(code **)*param_1)(param_1); return 2; } } return iVar2; } //@@ 00ab4be0 FUN_00ab4be0 void FUN_00ab4be0(int *param_1) { undefined4 *puVar1; puVar1 = (undefined4 *)param_1[0x68]; *puVar1 = FUN_00ab4b10; *(undefined2 *)(puVar1 + 4) = 0; *(undefined1 *)(puVar1 + 5) = 1; (**(code **)(*param_1 + 0x10))(param_1); (**(code **)param_1[0x69])(param_1); param_1[0x23] = 0; return; } //@@ 00ab4c20 FUN_00ab4c20 void FUN_00ab4c20(int param_1) { int iVar1; iVar1 = *(int *)(param_1 + 0x1b0); *(undefined4 *)(iVar1 + 100) = *(undefined4 *)(param_1 + 0x114); *(undefined4 *)(iVar1 + 0x68) = *(undefined4 *)(param_1 + 0x60); return; } //@@ 00ab4c40 FUN_00ab4c40 void FUN_00ab4c40(int param_1,int param_2,int *param_3,undefined4 param_4,int param_5,int *param_6, int param_7) { int iVar1; uint uVar2; uint uVar3; int *piVar4; int iVar5; int local_8; iVar1 = *(int *)(param_1 + 0x1b0); local_8 = *(int *)(iVar1 + 100); if (*(int *)(param_1 + 0x114) <= local_8) { local_8 = *(int *)(param_1 + 0xc4); iVar5 = 0; if (0 < *(int *)(param_1 + 0x24)) { piVar4 = (int *)(iVar1 + 0x6c); do { (*(code *)piVar4[-0xc]) (param_1,local_8,*(int *)(param_2 + iVar5 * 4) + *piVar4 * *param_3 * 4, piVar4 + -0x16); piVar4 = piVar4 + 1; iVar5 = iVar5 + 1; local_8 = local_8 + 0x58; } while (iVar5 < *(int *)(param_1 + 0x24)); } *(undefined4 *)(iVar1 + 100) = 0; local_8 = 0; } uVar2 = *(int *)(param_1 + 0x114) - local_8; uVar3 = *(uint *)(iVar1 + 0x68); if (uVar2 <= *(uint *)(iVar1 + 0x68)) { uVar3 = uVar2; } uVar2 = param_7 - *param_6; if (uVar3 <= uVar2) { uVar2 = uVar3; } (**(code **)(*(int *)(param_1 + 0x1b4) + 4)) (param_1,iVar1 + 0x14,local_8,param_5 + *param_6 * 4,uVar2); *param_6 = *param_6 + uVar2; *(int *)(iVar1 + 0x68) = *(int *)(iVar1 + 0x68) - uVar2; *(int *)(iVar1 + 100) = *(int *)(iVar1 + 100) + uVar2; if (*(int *)(param_1 + 0x114) <= *(int *)(iVar1 + 100)) { *param_3 = *param_3 + 1; } return; } //@@ 00ab4d20 FUN_00ab4d20 void FUN_00ab4d20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 *param_4) { *param_4 = param_3; return; } //@@ 00ab4d30 FUN_00ab4d30 void FUN_00ab4d30(void) { undefined4 *in_stack_00000010; *in_stack_00000010 = 0; return; } //@@ 00ab4d40 FUN_00ab4d40 void FUN_00ab4d40(int param_1,int param_2,undefined4 *param_3,undefined4 *param_4) { undefined1 uVar1; undefined1 *puVar2; size_t _Size; uint uVar3; uint uVar4; void *pvVar5; uint _Size_00; void *_Dst; int *piVar6; int iVar7; int local_c; int *local_8; local_8 = (int *)*param_4; param_4 = (undefined4 *)0x0; _Size_00 = (uint)*(byte *)(*(int *)(param_2 + 4) + 0x94 + *(int *)(param_1 + 0x1b0)); uVar4 = (uint)*(byte *)(*(int *)(param_2 + 4) + 0x9e + *(int *)(param_1 + 0x1b0)); if (0 < *(int *)(param_1 + 0x114)) { do { puVar2 = (undefined1 *)*param_3; _Dst = (void *)*local_8; pvVar5 = (void *)(*(int *)(param_1 + 0x5c) + (int)_Dst); while (_Dst < pvVar5) { uVar1 = *puVar2; puVar2 = puVar2 + 1; uVar3 = (uint)local_c >> 8; local_c = CONCAT31((int3)uVar3,uVar1); if (_Size_00 != 0) { memset(_Dst,local_c,_Size_00); _Dst = (void *)((int)_Dst + _Size_00); } } if (1 < uVar4) { iVar7 = uVar4 - 1; _Size = *(size_t *)(param_1 + 0x5c); if (0 < iVar7) { piVar6 = local_8 + 1; do { memcpy((void *)*piVar6,*(void **)(((int)local_8 - (int)(local_8 + 1)) + (int)piVar6), _Size); iVar7 = iVar7 + -1; piVar6 = piVar6 + 1; } while (0 < iVar7); } } param_4 = (undefined4 *)((int)param_4 + uVar4); param_3 = param_3 + 1; local_8 = local_8 + uVar4; } while ((int)param_4 < *(int *)(param_1 + 0x114)); } return; } //@@ 00ab4e50 FUN_00ab4e50 void FUN_00ab4e50(int param_1,undefined4 param_2,int param_3,undefined4 *param_4) { undefined1 uVar1; undefined1 *puVar2; undefined1 *puVar3; int iVar4; undefined1 *puVar5; iVar4 = 0; param_4 = (undefined4 *)*param_4; if (0 < *(int *)(param_1 + 0x114)) { param_3 = param_3 - (int)param_4; do { puVar2 = *(undefined1 **)(param_3 + (int)param_4); puVar3 = (undefined1 *)*param_4; puVar5 = puVar3 + *(int *)(param_1 + 0x5c); for (; puVar3 < puVar5; puVar3 = puVar3 + 2) { uVar1 = *puVar2; puVar2 = puVar2 + 1; *puVar3 = uVar1; puVar3[1] = uVar1; } iVar4 = iVar4 + 1; param_4 = param_4 + 1; } while (iVar4 < *(int *)(param_1 + 0x114)); } return; } //@@ 00ab4eb0 FUN_00ab4eb0 void FUN_00ab4eb0(int param_1,undefined4 param_2,undefined4 *param_3,undefined4 *param_4) { undefined1 *puVar1; undefined1 uVar2; undefined1 *puVar3; size_t _Size; undefined1 *puVar4; undefined4 *puVar5; puVar5 = (undefined4 *)*param_4; param_4 = (undefined4 *)0x0; if (0 < *(int *)(param_1 + 0x114)) { do { puVar4 = (undefined1 *)*param_3; puVar3 = (undefined1 *)*puVar5; _Size = *(size_t *)(param_1 + 0x5c); puVar1 = puVar3 + _Size; if (puVar3 < puVar1) { do { uVar2 = *puVar4; puVar4 = puVar4 + 1; *puVar3 = uVar2; puVar3[1] = uVar2; puVar3 = puVar3 + 2; } while (puVar3 < puVar1); _Size = *(size_t *)(param_1 + 0x5c); } memcpy((void *)puVar5[1],(void *)*puVar5,_Size); param_4 = (undefined4 *)((int)param_4 + 2); param_3 = param_3 + 1; puVar5 = puVar5 + 2; } while ((int)param_4 < *(int *)(param_1 + 0x114)); } return; } //@@ 00ab4f30 FUN_00ab4f30 void FUN_00ab4f30(int param_1,int param_2,int param_3,undefined4 *param_4) { byte bVar1; byte *pbVar2; int iVar3; byte *pbVar4; undefined4 *local_8; local_8 = (undefined4 *)*param_4; param_4 = (undefined4 *)0x0; if (0 < *(int *)(param_1 + 0x114)) { param_3 = param_3 - (int)local_8; do { pbVar4 = *(byte **)(param_3 + (int)local_8); pbVar2 = (byte *)*local_8; bVar1 = *pbVar4; pbVar4 = pbVar4 + 1; *pbVar2 = bVar1; pbVar2[1] = (byte)(*pbVar4 + 2 + (uint)bVar1 * 3 >> 2); for (iVar3 = *(int *)(param_2 + 0x2c) + -2; pbVar2 = pbVar2 + 2, iVar3 != 0; iVar3 = iVar3 + -1) { bVar1 = *pbVar4; *pbVar2 = (byte)(pbVar4[-1] + 1 + (uint)bVar1 * 3 >> 2); pbVar2[1] = (byte)(pbVar4[1] + 2 + (uint)bVar1 * 3 >> 2); pbVar4 = pbVar4 + 1; } bVar1 = *pbVar4; param_4 = (undefined4 *)((int)param_4 + 1); *pbVar2 = (byte)(pbVar4[-1] + 1 + (uint)bVar1 * 3 >> 2); pbVar2[1] = bVar1; local_8 = local_8 + 1; } while ((int)param_4 < *(int *)(param_1 + 0x114)); } return; } //@@ 00ab5000 FUN_00ab5000 void FUN_00ab5000(int param_1,int param_2,undefined4 *param_3,int *param_4) { int iVar1; byte bVar2; int iVar3; int *piVar4; byte *pbVar5; uint uVar6; undefined1 *puVar7; byte *pbVar8; uint local_c; int local_8; piVar4 = param_4; param_4 = (int *)0x0; iVar3 = *piVar4; if (0 < *(int *)(param_1 + 0x114)) { uVar6 = *(uint *)(param_2 + 0x2c); do { local_8 = 0; do { pbVar8 = (byte *)*param_3; if (local_8 == 0) { pbVar5 = (byte *)param_3[-1]; } else { pbVar5 = (byte *)param_3[1]; } local_c = 0; iVar1 = (int)param_4 * 4; param_4 = (int *)((int)param_4 + 1); if (uVar6 != 0) { puVar7 = *(undefined1 **)(iVar3 + iVar1); do { bVar2 = *pbVar8; pbVar8 = pbVar8 + 1; *puVar7 = (char)((local_8 != 0) + 1 + (uint)*pbVar5 + (uint)bVar2 * 3 >> 2); uVar6 = *(uint *)(param_2 + 0x2c); local_c = local_c + 1; pbVar5 = pbVar5 + 1; puVar7 = puVar7 + 1; } while (local_c < uVar6); } local_8 = local_8 + 1; } while (local_8 < 2); param_3 = param_3 + 1; } while ((int)param_4 < *(int *)(param_1 + 0x114)); } return; } //@@ 00ab50d0 FUN_00ab50d0 void FUN_00ab50d0(int param_1,int param_2,undefined4 *param_3,int *param_4) { byte bVar1; int iVar2; undefined1 *puVar3; int iVar4; byte *pbVar5; int iVar6; byte *pbVar7; byte *pbVar8; int local_10; int local_c; int local_8; iVar4 = 0; iVar2 = *param_4; if (0 < *(int *)(param_1 + 0x114)) { do { local_10 = 0; do { pbVar8 = (byte *)*param_3; if (local_10 == 0) { pbVar7 = (byte *)param_3[-1]; } else { pbVar7 = (byte *)param_3[1]; } puVar3 = *(undefined1 **)(iVar2 + iVar4 * 4); iVar4 = iVar4 + 1; local_8 = (uint)*pbVar8 * 3 + (uint)*pbVar7; pbVar5 = pbVar8 + 2; iVar6 = (uint)pbVar8[1] * 3 + (uint)pbVar7[1]; *puVar3 = (char)(local_8 * 4 + 8U >> 4); puVar3[1] = (char)(iVar6 + local_8 * 3 + 7U >> 4); puVar3 = puVar3 + 2; local_c = *(int *)(param_2 + 0x2c) + -2; pbVar8 = pbVar7 + 2; param_4 = (int *)local_8; if (local_c != 0) { do { local_8 = iVar6; bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; iVar6 = (uint)bVar1 * 3 + (uint)*pbVar8; *puVar3 = (char)((uint)((int)param_4 + 8 + local_8 * 3) >> 4); puVar3[1] = (char)((uint)(local_8 * 3 + 7 + iVar6) >> 4); puVar3 = puVar3 + 2; local_c = local_c + -1; param_4 = (int *)local_8; pbVar8 = pbVar8 + 1; } while (local_c != 0); } *puVar3 = (char)(local_8 + iVar6 * 3 + 8U >> 4); puVar3[1] = (char)(iVar6 * 4 + 7U >> 4); local_10 = local_10 + 1; } while (local_10 < 2); param_3 = param_3 + 1; } while (iVar4 < *(int *)(param_1 + 0x114)); } return; } //@@ 00ab5200 jinit_upsampler /* DB: libjpeg(-turbo) jdsample.c: precision check, allocates the upsampler into cinfo[0x6c] unless master->jinit_upsampler_no_alloc (+100), start_pass/upsample methods, JERR_CCIR601_NOTIMPL 0x1a when CCIR601_sampling, do_fancy = do_fancy_upsampling && min_DCT_scaled_size > 1, per component h/v_in_group = samp_factor*DCT_scaled_size/min_DCT_scaled_size picking the upsample method; called from libjpeg_jinit_master_decompress */ void jinit_upsampler(void) { int iVar1; int iVar2; bool bVar3; int iVar4; int iVar5; code *pcVar6; undefined4 uVar7; int *in_ECX; undefined1 *local_1c; undefined4 *local_18; undefined4 *local_14; int *local_c; iVar1 = in_ECX[0x30]; if (*(char *)(in_ECX[100] + 9) == '\0') { if (iVar1 == 8) goto LAB_00ab524b; } else if ((iVar1 < 9) && (1 < iVar1)) goto LAB_00ab524b; *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); LAB_00ab524b: if (*(char *)(in_ECX[100] + 100) == '\0') { local_18 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6c] = (int)local_18; *local_18 = FUN_00ab4c20; local_18[1] = FUN_00ab4c40; *(undefined1 *)(local_18 + 4) = 0; } else { local_18 = (undefined4 *)in_ECX[0x6c]; } if (*(char *)((int)in_ECX + 0x10a) != '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x1a; (**(code **)*in_ECX)(); } if (((char)in_ECX[0x12] == '\0') || (bVar3 = true, in_ECX[0x46] < 2)) { bVar3 = false; } if (0 < in_ECX[9]) { local_1c = (undefined1 *)((int)local_18 + 0x9e); local_c = (int *)(in_ECX[0x31] + 8); local_14 = local_18 + 0xf; do { iVar4 = (*local_c * local_c[7]) / in_ECX[0x46]; iVar5 = (local_c[1] * local_c[7]) / in_ECX[0x46]; iVar1 = in_ECX[0x44]; iVar2 = in_ECX[0x45]; local_14[0xc] = iVar5; if ((char)local_c[0xb] == '\0') { *local_14 = FUN_00ab4d30; } else if ((iVar4 == iVar1) && (iVar5 == iVar2)) { *local_14 = FUN_00ab4d20; } else { if ((iVar4 * 2 == iVar1) && (iVar5 == iVar2)) { if ((!bVar3) || (pcVar6 = FUN_00ab4f30, (uint)local_c[9] < 3)) { pcVar6 = FUN_00ab4e50; } *local_14 = pcVar6; } else if (((iVar4 == iVar1) && (iVar5 * 2 == iVar2)) && (bVar3)) { *local_14 = FUN_00ab5000; *(undefined1 *)(local_18 + 4) = 1; } else if ((iVar4 * 2 == iVar1) && (iVar5 * 2 == iVar2)) { if ((bVar3) && (2 < (uint)local_c[9])) { *local_14 = FUN_00ab50d0; *(undefined1 *)(local_18 + 4) = 1; } else { *local_14 = FUN_00ab4eb0; } } else if ((iVar1 % iVar4 == 0) && (iVar2 % iVar5 == 0)) { *local_14 = FUN_00ab4d40; local_1c[-10] = (char)(iVar1 / iVar4); *local_1c = (char)(iVar2 / iVar5); } else { *(undefined4 *)(*in_ECX + 0x14) = 0x27; (**(code **)*in_ECX)(); } if (*(char *)(in_ECX[100] + 100) == '\0') { uVar7 = (**(code **)(in_ECX[1] + 8))(); local_14[-10] = uVar7; } } local_14 = local_14 + 1; local_1c = local_1c + 1; local_c = local_c + 0x16; } while ((int)(local_1c + (-0x9e - (int)local_18)) < in_ECX[9]); } return; } //@@ 00ab5480 use_merged_upsample /* DB: libjpeg(-turbo) jdmaster.c: false if master lossless (+9), do_fancy_upsampling (+0x48), CCIR601_sampling (+0x10a), or jpeg_color_space/num_components != YCbCr/3; checks out_color_space RGB variants vs rgb_pixelsize table DAT_00b4f288 (RGB565 needs 3 comps), 2h1v/2h2v sampling of comp0 and 1x1 chroma with equal DCT_scaled_size; callers jpeg_calc_output_dimensions and jinit_master_decompress */ uint use_merged_upsample(void) { int iVar1; uint uVar2; int in_ECX; bool bVar3; uVar2 = *(uint *)(in_ECX + 400); if ((((*(char *)(uVar2 + 9) != '\0') || (*(char *)(in_ECX + 0x48) != '\0')) || (*(char *)(in_ECX + 0x10a) != '\0')) || ((*(int *)(in_ECX + 0x28) != 3 || (*(int *)(in_ECX + 0x24) != 3)))) goto LAB_00ab555d; iVar1 = *(int *)(in_ECX + 0x2c); if (iVar1 == 2) { LAB_00ab5500: uVar2 = *(uint *)(in_ECX + 100); bVar3 = uVar2 == *(uint *)(&DAT_00b4f288 + iVar1 * 4); } else { if (iVar1 != 0x10) { if (((((iVar1 != 6) && (iVar1 != 7)) && ((iVar1 != 8 && ((((iVar1 != 9 && (iVar1 != 10)) && (iVar1 != 0xb)) && ((iVar1 != 0xc && (iVar1 != 0xd)))))))) && (iVar1 != 0xe)) && (iVar1 != 0xf)) goto LAB_00ab555d; goto LAB_00ab5500; } bVar3 = *(int *)(in_ECX + 100) == 3; } if ((((bVar3) && (uVar2 = *(uint *)(in_ECX + 0xc4), *(int *)(uVar2 + 8) == 2)) && ((*(int *)(uVar2 + 0x60) == 1 && (((*(int *)(uVar2 + 0xb8) == 1 && (*(int *)(uVar2 + 0xc) < 3)) && (*(int *)(uVar2 + 100) == 1)))))) && ((((*(int *)(uVar2 + 0xbc) == 1 && (iVar1 = *(int *)(in_ECX + 0x118), *(int *)(uVar2 + 0x24) == iVar1)) && (*(int *)(uVar2 + 0x7c) == iVar1)) && (*(int *)(uVar2 + 0xd4) == iVar1)))) { return CONCAT31((int3)(uVar2 >> 8),1); } LAB_00ab555d: return uVar2 & 0xffffff00; } //@@ 00ab5560 jpeg_core_output_dimensions /* DB: libjpeg jdmaster.c: raw/no-scale shortcut copies image_width/height to output (+0x1c/+0x20 -> +0x5c/+0x60), else scale_num/denom ratio tests; the DB note on libjpeg_jpeg_calc_output_dimensions names FUN_00ab5560 as this */ void jpeg_core_output_dimensions(void) { uint uVar1; int iVar2; int iVar3; int in_ECX; undefined4 *puVar4; uint uVar5; int iVar6; if (*(char *)(*(int *)(in_ECX + 400) + 9) != '\0') { *(undefined4 *)(in_ECX + 0x5c) = *(undefined4 *)(in_ECX + 0x1c); *(undefined4 *)(in_ECX + 0x60) = *(undefined4 *)(in_ECX + 0x20); return; } uVar1 = *(uint *)(in_ECX + 0x34); iVar3 = *(int *)(in_ECX + 0x1c); uVar5 = *(int *)(in_ECX + 0x30) * 8; iVar2 = *(int *)(in_ECX + 0x20); if (uVar1 < uVar5) { if (uVar5 <= uVar1 * 2) { iVar2 = iVar2 * 2 + 7; *(undefined4 *)(in_ECX + 0x118) = 2; *(undefined4 *)(in_ECX + 0x11c) = 2; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 2 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 3) { iVar2 = iVar2 * 3 + 7; *(undefined4 *)(in_ECX + 0x118) = 3; *(undefined4 *)(in_ECX + 0x11c) = 3; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 3 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 4) { iVar2 = iVar2 * 4 + 7; *(undefined4 *)(in_ECX + 0x118) = 4; *(undefined4 *)(in_ECX + 0x11c) = 4; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 4 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 5) { iVar2 = iVar2 * 5 + 7; *(undefined4 *)(in_ECX + 0x118) = 5; *(undefined4 *)(in_ECX + 0x11c) = 5; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 5 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 6) { *(undefined4 *)(in_ECX + 0x118) = 6; iVar2 = iVar2 * 6 + 7; *(undefined4 *)(in_ECX + 0x11c) = 6; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 6 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 7) { *(undefined4 *)(in_ECX + 0x118) = 7; *(undefined4 *)(in_ECX + 0x11c) = 7; iVar2 = (iVar2 + 1) * 7; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = (iVar3 + 1) * 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 8) { iVar2 = iVar2 * 8 + 7; *(undefined4 *)(in_ECX + 0x118) = 8; *(undefined4 *)(in_ECX + 0x11c) = 8; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 8 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 9) { iVar2 = iVar2 * 9 + 7; *(undefined4 *)(in_ECX + 0x118) = 9; *(undefined4 *)(in_ECX + 0x11c) = 9; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 9 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 10) { *(undefined4 *)(in_ECX + 0x118) = 10; iVar2 = iVar2 * 10 + 7; *(undefined4 *)(in_ECX + 0x11c) = 10; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 10 + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 0xb) { *(undefined4 *)(in_ECX + 0x118) = 0xb; *(undefined4 *)(in_ECX + 0x11c) = 0xb; iVar2 = iVar2 * 0xb + 7; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 0xb + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 0xc) { *(undefined4 *)(in_ECX + 0x118) = 0xc; iVar2 = iVar2 * 0xc + 7; *(undefined4 *)(in_ECX + 0x11c) = 0xc; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 0xc + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 0xd) { *(undefined4 *)(in_ECX + 0x118) = 0xd; *(undefined4 *)(in_ECX + 0x11c) = 0xd; iVar2 = iVar2 * 0xd + 7; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 0xd + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 0xe) { *(undefined4 *)(in_ECX + 0x118) = 0xe; *(undefined4 *)(in_ECX + 0x11c) = 0xe; iVar2 = iVar2 * 0xe + 7; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 0xe + 7; goto LAB_00ab5905; } if (uVar5 <= uVar1 * 0xf) { *(undefined4 *)(in_ECX + 0x118) = 0xf; *(undefined4 *)(in_ECX + 0x11c) = 0xf; iVar2 = iVar2 * 0xf + 7; iVar2 = (iVar2 >> 0x1f & 7U) + iVar2; iVar3 = iVar3 * 0xf + 7; goto LAB_00ab5905; } iVar2 = iVar2 << 4; *(undefined4 *)(in_ECX + 0x118) = 0x10; *(undefined4 *)(in_ECX + 0x11c) = 0x10; iVar3 = iVar3 << 4; } else { *(undefined4 *)(in_ECX + 0x118) = 1; *(undefined4 *)(in_ECX + 0x11c) = 1; } iVar2 = (iVar2 + 7 >> 0x1f & 7U) + iVar2 + 7; iVar3 = iVar3 + 7; LAB_00ab5905: iVar6 = 0; *(int *)(in_ECX + 0x5c) = (int)(iVar3 + (iVar3 >> 0x1f & 7U)) >> 3; *(int *)(in_ECX + 0x60) = iVar2 >> 3; if (*(int *)(in_ECX + 0x24) < 1) { return; } puVar4 = (undefined4 *)(*(int *)(in_ECX + 0xc4) + 0x28); do { puVar4[-1] = *(undefined4 *)(in_ECX + 0x118); iVar6 = iVar6 + 1; *puVar4 = *(undefined4 *)(in_ECX + 0x11c); puVar4 = puVar4 + 0x16; } while (iVar6 < *(int *)(in_ECX + 0x24)); return; } //@@ 00ab5960 libjpeg_jpeg_calc_output_dimensions /* DB: libjpeg jdmaster.c: checks global_state == DSTATE_READY (0xca, error 0x15 JERR_BAD_STATE), calls jpeg_core_output_dimensions (FUN_00ab5560), then per-component DCT scaling when not raw; only caller libjpeg_jinit_master_decompress */ void libjpeg_jpeg_calc_output_dimensions(void) { char cVar1; int iVar2; int *in_ECX; int iVar3; int *piVar4; int local_8; if (in_ECX[5] != 0xca) { *(undefined4 *)(*in_ECX + 0x14) = 0x15; *(int *)(*in_ECX + 0x18) = in_ECX[5]; (**(code **)*in_ECX)(); } jpeg_core_output_dimensions(); if (*(char *)(in_ECX[100] + 9) == '\0') { iVar2 = in_ECX[9]; iVar3 = in_ECX[0x31]; local_8 = 0; if (0 < iVar2) { piVar4 = (int *)(iVar3 + 0xc); do { iVar2 = in_ECX[0x46]; iVar3 = iVar2; if (iVar2 < 8) { do { if (((in_ECX[0x44] * iVar2) % (piVar4[-1] * iVar3 * 2) != 0) || ((in_ECX[0x45] * iVar2) % (*piVar4 * iVar3 * 2) != 0)) break; iVar3 = iVar3 * 2; } while (iVar3 < 8); } piVar4[7] = iVar3; local_8 = local_8 + 1; piVar4[6] = iVar3; piVar4 = piVar4 + 0x16; iVar2 = in_ECX[9]; } while (local_8 < iVar2); iVar3 = in_ECX[0x31]; } local_8 = 0; if (0 < iVar2) { piVar4 = (int *)(iVar3 + 8); do { piVar4[9] = (*piVar4 * piVar4[7] * in_ECX[7] + -1 + in_ECX[0x44] * 8) / (in_ECX[0x44] * 8); piVar4[10] = (piVar4[1] * piVar4[7] * in_ECX[8] + -1 + in_ECX[0x45] * 8) / (in_ECX[0x45] * 8); local_8 = local_8 + 1; piVar4 = piVar4 + 0x16; } while (local_8 < in_ECX[9]); } } else { in_ECX[0x17] = in_ECX[7]; in_ECX[0x18] = in_ECX[8]; } switch(in_ECX[0xb]) { case 1: iVar2 = 1; break; case 2: case 6: case 7: case 8: case 9: case 10: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: iVar2 = *(int *)(&DAT_00b4f288 + in_ECX[0xb] * 4); break; case 3: case 0x10: iVar2 = 3; break; case 4: case 5: iVar2 = 4; break; default: iVar2 = in_ECX[9]; } in_ECX[0x19] = iVar2; if (*(char *)((int)in_ECX + 0x4a) != '\0') { iVar2 = 1; } in_ECX[0x1a] = iVar2; cVar1 = use_merged_upsample(); if (cVar1 == '\0') { in_ECX[0x1b] = 1; return; } in_ECX[0x1b] = in_ECX[0x45]; return; } //@@ 00ab5b30 prepare_range_limit_table /* DB: libjpeg(-turbo) jdmaster.c: ECX cinfo: by data_precision (cinfo+0xc0 < 9 / < 13 / 16) allocates the range table, sets sample_range_limit (+0x124) = table+MAXJSAMPLE+1, fills 0 pad, identity 0..MAXJSAMPLE, saturated MAXJSAMPLE run, zero tail and the wraparound copy; called from libjpeg_jinit_master_decompress */ void prepare_range_limit_table(void) { code *pcVar1; void *pvVar2; int iVar3; int in_ECX; undefined4 *puVar4; undefined4 *puVar5; if (*(int *)(in_ECX + 0xc0) < 9) { pvVar2 = (void *)(*(code *)**(undefined4 **)(in_ECX + 4))(); *(int *)(in_ECX + 0x124) = (int)pvVar2 + 0x100; memset(pvVar2,0,0x100); iVar3 = 0; do { *(char *)(iVar3 + (int)pvVar2 + 0x100) = (char)iVar3; iVar3 = iVar3 + 1; } while (iVar3 < 0x100); memset((void *)((int)pvVar2 + 0x200),0xff,0x180); memset((void *)((int)pvVar2 + 0x380),0,0x180); puVar4 = *(undefined4 **)(in_ECX + 0x124); puVar5 = (undefined4 *)((int)pvVar2 + 0x500); for (iVar3 = 0x20; iVar3 != 0; iVar3 = iVar3 + -1) { *puVar5 = *puVar4; puVar4 = puVar4 + 1; puVar5 = puVar5 + 1; } return; } pcVar1 = (code *)**(undefined4 **)(in_ECX + 4); if (*(int *)(in_ECX + 0xc0) < 0xd) { pvVar2 = (void *)(*pcVar1)(); *(int *)(in_ECX + 0x124) = (int)pvVar2 + 0x2000; memset(pvVar2,0,0x2000); iVar3 = 0; do { *(short *)((int)pvVar2 + 0x2000 + iVar3 * 2) = (short)iVar3; iVar3 = iVar3 + 1; } while (iVar3 < 0x1000); puVar4 = (undefined4 *)((int)pvVar2 + 0x4000); for (iVar3 = 0xc00; iVar3 != 0; iVar3 = iVar3 + -1) { *puVar4 = 0xfff0fff; puVar4 = puVar4 + 1; } memset((void *)((int)pvVar2 + 0x7000),0,0x3000); memcpy((void *)((int)pvVar2 + 0xa000),*(void **)(in_ECX + 0x124),0x1000); return; } pvVar2 = (void *)(*pcVar1)(); *(int *)(in_ECX + 0x124) = (int)pvVar2 + 0x20000; memset(pvVar2,0,0x20000); iVar3 = 0; do { *(short *)((int)pvVar2 + 0x20000 + iVar3 * 2) = (short)iVar3; iVar3 = iVar3 + 1; } while (iVar3 < 0x10000); puVar4 = (undefined4 *)((int)pvVar2 + 0x40000); for (iVar3 = 0xc000; iVar3 != 0; iVar3 = iVar3 + -1) { *puVar4 = 0xffffffff; puVar4 = puVar4 + 1; } memset((void *)((int)pvVar2 + 0x70000),0,0x30000); memcpy((void *)((int)pvVar2 + 0xa0000),*(void **)(in_ECX + 0x124),0x10000); return; } //@@ 00ab5cc0 libjpeg_jinit_master_decompress /* DB: ? libjpeg internal called by image_load_jpeg: cinfo->err->msg_code = 0x30 then error_exit, memset, three jinit-style callees */ void libjpeg_jinit_master_decompress(void) { char cVar1; int iVar2; undefined1 uVar3; undefined4 *puVar4; undefined4 uVar5; void *_Dst; int iVar6; int *in_ECX; int iVar7; undefined4 *puVar8; int local_c; iVar2 = in_ECX[100]; if (*(char *)(iVar2 + 9) != '\0') { *(undefined1 *)((int)in_ECX + 0x41) = 0; in_ECX[0xd] = 1; in_ECX[0xc] = 1; } libjpeg_jpeg_calc_output_dimensions(); prepare_range_limit_table(); *(undefined4 *)(iVar2 + 0x70) = 0; uVar3 = use_merged_upsample(); *(undefined1 *)(iVar2 + 0x74) = uVar3; *(undefined4 *)(iVar2 + 0x78) = 0; *(undefined4 *)(iVar2 + 0x7c) = 0; if ((*(char *)((int)in_ECX + 0x4a) == '\0') || ((char)in_ECX[0x10] == '\0')) { *(undefined2 *)(in_ECX + 0x16) = 0; *(undefined1 *)((int)in_ECX + 0x5a) = 0; if (*(char *)((int)in_ECX + 0x4a) != '\0') goto LAB_00ab5d35; } else { LAB_00ab5d35: if (*(char *)((int)in_ECX + 0x41) != '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x30; (**(code **)*in_ECX)(); } if ((in_ECX[0x19] == 3) && (in_ECX[0xb] != 0x10)) { if (in_ECX[0x1d] == 0) { if ((char)in_ECX[0x14] == '\0') { *(undefined1 *)(in_ECX + 0x16) = 1; } else { *(undefined1 *)((int)in_ECX + 0x5a) = 1; } } else { *(undefined1 *)((int)in_ECX + 0x59) = 1; } } else { *(undefined2 *)(in_ECX + 0x16) = 1; *(undefined1 *)((int)in_ECX + 0x5a) = 0; in_ECX[0x1d] = 0; } if ((char)in_ECX[0x16] != '\0') { if (in_ECX[0x30] == 8) { if (*(char *)(in_ECX[100] + 9) != '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x30; (**(code **)*in_ECX)(); } puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6e] = (int)puVar4; *puVar4 = FUN_00abedc0; puVar4[3] = guard_check_icall; puVar4[4] = FUN_00abef70; puVar4[0x12] = 0; puVar4[0xe] = 0; if (4 < in_ECX[0x19]) { *(undefined4 *)(*in_ECX + 0x14) = 0x39; *(undefined4 *)(*in_ECX + 0x18) = 4; (**(code **)*in_ECX)(); } if (0x100 < in_ECX[0x15]) { *(undefined4 *)(*in_ECX + 0x14) = 0x3b; *(undefined4 *)(*in_ECX + 0x18) = 0x100; (**(code **)*in_ECX)(); } create_colormap(); create_colorindex(); if (in_ECX[0x13] == 2) { FUN_00abed70(); } } else { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } *(int *)(iVar2 + 0x78) = in_ECX[0x6e]; } if ((*(char *)((int)in_ECX + 0x5a) != '\0') || (*(char *)((int)in_ECX + 0x59) != '\0')) { if (in_ECX[0x30] == 8) { jinit_2pass_quantizer(); } else { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } *(int *)(iVar2 + 0x7c) = in_ECX[0x6e]; } } if (*(char *)((int)in_ECX + 0x41) != '\0') goto LAB_00ab6010; if (*(char *)(iVar2 + 0x74) == '\0') { if (8 < in_ECX[0x30]) goto LAB_00ab5f00; jinit_color_deconverter(); jinit_upsampler(); } else if (in_ECX[0x30] == 8) { jinit_merged_upsampler(); } else { LAB_00ab5f00: *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } iVar6 = in_ECX[0x30]; if (8 < iVar6) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); goto LAB_00ab6010; } cVar1 = *(char *)((int)in_ECX + 0x5a); if (*(char *)(in_ECX[100] + 9) == '\0') { if (iVar6 != 8) goto LAB_00ab5f4b; } else if (iVar6 < 2) { LAB_00ab5f4b: *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x67] = (int)puVar4; *puVar4 = FUN_00acb400; puVar4[4] = 0; puVar4[5] = 0; if (*(char *)((int)in_ECX + 0x4a) != '\0') { puVar4[6] = in_ECX[0x45]; if (cVar1 == '\0') { uVar5 = (**(code **)(in_ECX[1] + 8))(); puVar4[5] = uVar5; } else { uVar5 = (**(code **)(in_ECX[1] + 0x10))(); puVar4[4] = uVar5; } } LAB_00ab6010: iVar6 = in_ECX[0x30]; if (*(char *)(in_ECX[100] + 9) == '\0') { if (iVar6 == 8) { puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6b] = (int)puVar4; local_c = 0; *puVar4 = jddctmgr_start_pass; if (0 < in_ECX[9]) { puVar8 = (undefined4 *)(in_ECX[0x31] + 0x54); puVar4 = puVar4 + 0x15; do { _Dst = (void *)(**(code **)in_ECX[1])(); *puVar8 = _Dst; memset(_Dst,0,0x100); local_c = local_c + 1; *puVar4 = 0xffffffff; puVar8 = puVar8 + 0x16; puVar4 = puVar4 + 1; } while (local_c < in_ECX[9]); } } else { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } if (*(char *)((int)in_ECX + 0xca) == '\0') { if (*(char *)((int)in_ECX + 0xc9) == '\0') { add_huff_table(&DAT_00b5e190,&DAT_00b5ddac); add_huff_table(&DAT_00b5e130,&DAT_00b5e088); add_huff_table(&DAT_00b5e070,&DAT_00b5df44); add_huff_table(&DAT_00b5dfb0,&DAT_00b5dfc8); puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6a] = (int)puVar4; *puVar4 = FUN_00ac22c0; puVar4[1] = FUN_00ac3450; puVar4[0x10] = 0; puVar4[0xc] = 0; puVar4[0x11] = 0; puVar4[0xd] = 0; puVar4[0x12] = 0; puVar4[0xe] = 0; puVar4[0x13] = 0; puVar4[0xf] = 0; } else { puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6a] = (int)puVar4; *puVar4 = start_pass_phuff_decoder; puVar4[0xd] = 0; puVar4[0xe] = 0; puVar4[0xf] = 0; puVar4[0x10] = 0; puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); iVar6 = 0; in_ECX[0x23] = (int)puVar4; if (0 < in_ECX[9]) { do { iVar6 = iVar6 + 1; puVar8 = puVar4; for (iVar7 = 0x40; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar8 = 0xffffffff; puVar8 = puVar8 + 1; } puVar4 = puVar4 + 0x40; } while (iVar6 < in_ECX[9]); } } } else { puVar8 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6a] = (int)puVar8; iVar6 = 0x10; *puVar8 = start_pass_huff_decoder; puVar4 = puVar8 + 0x21; do { puVar4[-0x10] = 0; *puVar4 = 0; iVar6 = iVar6 + -1; puVar4 = puVar4 + 1; } while (iVar6 != 0); *(undefined1 *)(puVar8 + 0x31) = 0x71; if (*(char *)((int)in_ECX + 0xc9) != '\0') { puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); iVar6 = 0; in_ECX[0x23] = (int)puVar4; if (0 < in_ECX[9]) { do { iVar6 = iVar6 + 1; puVar8 = puVar4; for (iVar7 = 0x40; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar8 = 0xffffffff; puVar8 = puVar8 + 1; } puVar4 = puVar4 + 0x40; } while (iVar6 < in_ECX[9]); } } } libjpeg_jinit_d_coef_controller(); } else { if (iVar6 < 9) { if (iVar6 < 2) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6b] = (int)puVar4; *puVar4 = FUN_00acba80; } if (*(char *)((int)in_ECX + 0xca) == '\0') { puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6a] = (int)puVar4; *puVar4 = FUN_00ac7390; puVar4[2] = decode_mcus; puVar4[3] = FUN_00ac74f0; puVar4[7] = 0; puVar4[8] = 0; puVar4[9] = 0; puVar4[10] = 0; } else { *(undefined4 *)(*in_ECX + 0x14) = 0x31; (**(code **)*in_ECX)(); } if (in_ECX[0x30] < 9) { jinit_d_diff_controller(); } } if (*(char *)((int)in_ECX + 0x41) == '\0') { if (in_ECX[0x30] < 9) { libjpeg_jinit_d_main_controller(); } else { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } } (**(code **)(in_ECX[1] + 0x18))(); (**(code **)(in_ECX[0x68] + 8))(); *(undefined4 *)(in_ECX[100] + 0xc) = 0; *(int *)(in_ECX[100] + 0x10) = in_ECX[0x4f] + -1; *(undefined4 *)(in_ECX[100] + 0x68) = 0; if (((in_ECX[2] != 0) && ((char)in_ECX[0x10] == '\0')) && (*(char *)(in_ECX[0x68] + 0x10) != '\0') ) { iVar6 = in_ECX[9]; if (*(char *)((int)in_ECX + 0xc9) != '\0') { iVar6 = iVar6 * 3 + 2; } *(undefined4 *)(in_ECX[2] + 4) = 0; *(int *)(in_ECX[2] + 8) = in_ECX[0x48] * iVar6; *(undefined4 *)(in_ECX[2] + 0xc) = 0; *(uint *)(in_ECX[2] + 0x10) = (*(char *)((int)in_ECX + 0x5a) != '\0') + 2; *(int *)(iVar2 + 0x70) = *(int *)(iVar2 + 0x70) + 1; } return; } //@@ 00ab64a0 FUN_00ab64a0 void FUN_00ab64a0(int *param_1) { int iVar1; undefined4 uVar2; iVar1 = param_1[100]; if (*(char *)(iVar1 + 8) == '\0') { if ((*(char *)((int)param_1 + 0x4a) != '\0') && (param_1[0x1d] == 0)) { if (((char)param_1[0x14] == '\0') || (*(char *)((int)param_1 + 0x5a) == '\0')) { if ((char)param_1[0x16] == '\0') { *(undefined4 *)(*param_1 + 0x14) = 0x2f; (**(code **)*param_1)(param_1); } else { param_1[0x6e] = *(int *)(iVar1 + 0x78); } } else { param_1[0x6e] = *(int *)(iVar1 + 0x7c); *(undefined1 *)(iVar1 + 8) = 1; } } (**(code **)param_1[0x6b])(param_1); (**(code **)(param_1[0x66] + 8))(param_1); if (*(char *)((int)param_1 + 0x41) == '\0') { if (*(char *)(iVar1 + 0x74) == '\0') { (**(code **)param_1[0x6d])(param_1); } (**(code **)param_1[0x6c])(param_1); if (*(char *)((int)param_1 + 0x4a) != '\0') { (**(code **)param_1[0x6e])(param_1,*(undefined1 *)(iVar1 + 8)); } uVar2 = 0; if (*(char *)(iVar1 + 8) != '\0') { uVar2 = 3; } (**(code **)param_1[0x67])(param_1,uVar2); (**(code **)param_1[0x65])(param_1,0); } } else { *(undefined1 *)(iVar1 + 8) = 0; (**(code **)param_1[0x6e])(param_1,0); (**(code **)param_1[0x67])(param_1,2); (**(code **)param_1[0x65])(param_1,2); } if (param_1[2] != 0) { *(undefined4 *)(param_1[2] + 0xc) = *(undefined4 *)(iVar1 + 0x70); *(uint *)(param_1[2] + 0x10) = (*(char *)(iVar1 + 8) != '\0') + 1 + *(int *)(iVar1 + 0x70); if (((char)param_1[0x10] != '\0') && (*(char *)(param_1[0x68] + 0x11) == '\0')) { *(int *)(param_1[2] + 0x10) = *(int *)(param_1[2] + 0x10) + (*(char *)((int)param_1 + 0x5a) != '\0') + 1; } } return; } //@@ 00ab6600 FUN_00ab6600 void FUN_00ab6600(int param_1) { int *piVar1; int iVar2; iVar2 = *(int *)(param_1 + 400); if (*(char *)(param_1 + 0x4a) != '\0') { (**(code **)(*(int *)(param_1 + 0x1b8) + 0xc))(param_1); } piVar1 = (int *)(iVar2 + 0x70); *piVar1 = *piVar1 + 1; return; } //@@ 00ab6a80 I420ToRGBAMatrix /* DB: libyuv (round 7 agent) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl I420ToRGBAMatrix(byte *srcY,int srcStrideY,byte *srcU,int srcStrideU,byte *srcV,int srcStrideV, byte *dstRgba,int dstStrideRgba,void *yuvConstants,int width,int height) { byte *pbVar1; byte *pbVar2; uint uVar3; uint uVar4; int local_10; byte *local_c; code *local_8; local_8 = I422ToRGBARow_C; if (((((srcY == (byte *)0x0) || (srcU == (byte *)0x0)) || (srcV == (byte *)0x0)) || ((dstRgba == (byte *)0x0 || (width < 1)))) || (height == 0)) { return -1; } if (height < 0) { height = -height; dstRgba = dstRgba + (height + -1) * dstStrideRgba; local_10 = -dstStrideRgba; } else { local_10 = dstStrideRgba; } if (DAT_00c78da0 == 0) { DAT_00c78da0 = InitCpuFlags(); } if (((DAT_00c78da0 & 0x40) != 0) && (local_8 = FUN_00acd400, (width & 7U) == 0)) { local_8 = FUN_00acde90; } if (DAT_00c78da0 == 0) { DAT_00c78da0 = InitCpuFlags(); } if (((DAT_00c78da0 & 0x400) != 0) && (local_8 = FUN_00acd900, (width & 0xfU) == 0)) { local_8 = FUN_00acdbc0; } if (0 < height) { uVar3 = 0; local_c = srcY; do { (*local_8)(local_c,srcU,srcV,dstRgba,yuvConstants,width); local_c = local_c + srcStrideY; dstRgba = dstRgba + local_10; uVar4 = uVar3 + 1; pbVar1 = srcV + srcStrideV; if ((uVar3 & 1) == 0) { pbVar1 = srcV; } pbVar2 = srcU + srcStrideU; if ((uVar3 & 1) == 0) { pbVar2 = srcU; } uVar3 = uVar4; srcU = pbVar2; srcV = pbVar1; } while ((int)uVar4 < height); } return 0; } //@@ 00ab6bc0 FUN_00ab6bc0 undefined4 FUN_00ab6bc0(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6, undefined4 param_7,uint param_8,int param_9) { int iVar1; int iVar2; int in_ECX; int in_EDX; uint uVar3; uint uVar4; int local_10; int local_c; code *local_8; local_8 = I422ToRGB24Row_C; if (((((in_ECX == 0) || (param_1 == 0)) || (param_3 == 0)) || ((param_5 == 0 || ((int)param_8 < 1)))) || (param_9 == 0)) { return 0xffffffff; } if (param_9 < 0) { param_9 = -param_9; param_5 = param_5 + (param_9 + -1) * param_6; local_10 = -param_6; } else { local_10 = param_6; } if (DAT_00c78da0 == 0) { DAT_00c78da0 = InitCpuFlags(); } if (((DAT_00c78da0 & 0x40) != 0) && (local_8 = FUN_00acd540, (param_8 & 7) == 0)) { local_8 = FUN_00acdcb0; } if (DAT_00c78da0 == 0) { DAT_00c78da0 = InitCpuFlags(); } if (((DAT_00c78da0 & 0x400) != 0) && (local_8 = FUN_00acd680, (param_8 & 0xf) == 0)) { local_8 = FUN_00acd240; } if (0 < param_9) { uVar3 = 0; local_c = in_ECX; do { (*local_8)(local_c,param_1,param_3,param_5,param_7,param_8); local_c = local_c + in_EDX; param_5 = param_5 + local_10; uVar4 = uVar3 + 1; iVar1 = param_4 + param_3; if ((uVar3 & 1) == 0) { iVar1 = param_3; } iVar2 = param_2 + param_1; if ((uVar3 & 1) == 0) { iVar2 = param_1; } uVar3 = uVar4; param_1 = iVar2; param_3 = iVar1; } while ((int)uVar4 < param_9); } return 0; } //@@ 00ab6d00 FUN_00ab6d00 undefined4 FUN_00ab6d00(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6, undefined4 param_7,uint param_8,int param_9) { int iVar1; int iVar2; int in_ECX; int in_EDX; uint uVar3; uint uVar4; int local_10; int local_c; code *local_8; local_8 = I422ToARGBRow_C; if (((((in_ECX == 0) || (param_1 == 0)) || (param_3 == 0)) || ((param_5 == 0 || ((int)param_8 < 1)))) || (param_9 == 0)) { return 0xffffffff; } if (param_9 < 0) { param_9 = -param_9; param_5 = param_5 + (param_9 + -1) * param_6; local_10 = -param_6; } else { local_10 = param_6; } if (DAT_00c78da0 == 0) { DAT_00c78da0 = InitCpuFlags(); } if (((DAT_00c78da0 & 0x40) != 0) && (local_8 = FUN_00acd2c0, (param_8 & 7) == 0)) { local_8 = FUN_00acddb0; } if (DAT_00c78da0 == 0) { DAT_00c78da0 = InitCpuFlags(); } if (((DAT_00c78da0 & 0x400) != 0) && (local_8 = FUN_00acd7c0, (param_8 & 0xf) == 0)) { local_8 = FUN_00acdad0; } if (0 < param_9) { uVar3 = 0; local_c = in_ECX; do { (*local_8)(local_c,param_1,param_3,param_5,param_7,param_8); local_c = local_c + in_EDX; param_5 = param_5 + local_10; uVar4 = uVar3 + 1; iVar1 = param_4 + param_3; if ((uVar3 & 1) == 0) { iVar1 = param_3; } iVar2 = param_2 + param_1; if ((uVar3 & 1) == 0) { iVar2 = param_1; } uVar3 = uVar4; param_1 = iVar2; param_3 = iVar1; } while ((int)uVar4 < param_9); } return 0; } //@@ 00ab6e40 FUN_00ab6e40 void FUN_00ab6e40(void) { byte *pbVar1; undefined1 uVar2; uint uVar3; int in_ECX; int in_EDX; byte *pbVar4; undefined1 *puVar5; uint local_c; int local_8; local_c = 0; if (*(int *)(in_ECX + 0x18) != 0) { local_8 = 0; do { puVar5 = (undefined1 *)(*(int *)(in_ECX + 0x10) + local_8); pbVar4 = (byte *)(*(int *)(in_ECX + 0x20) * local_c + *(int *)(in_ECX + 0x14) + *(int *)(in_ECX + 4)); pbVar1 = pbVar4 + *(int *)(in_ECX + 0x14); for (; pbVar4 != pbVar1; pbVar4 = pbVar4 + 1) { uVar3 = (uint)*pbVar4; if (uVar3 < 0x11) { uVar2 = 0; } else if (uVar3 < 0xeb) { uVar2 = (undefined1)((int)((uVar3 - 0x10) * 0xff) / 0xdb); } else { uVar2 = 0xff; } *puVar5 = uVar2; puVar5 = puVar5 + 4; } local_c = local_c + 1; local_8 = local_8 + in_EDX; } while (local_c < *(uint *)(in_ECX + 0x18)); } return; } //@@ 00ab6ee0 oggpack_write /* DB: libogg bitpacker (b, value, bits): bits > 32 or realloc failure clears the buffer, grows by 0x100 (BUFFER_INCREMENT), masks with the mask table DAT_00b4f838 and ORs bytes in; theora encoder/decoder helpers (mapping0_inverse callers) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl oggpack_write(void *buffer,uint value,int bits) { void *pvVar1; int iVar2; uint uVar3; uint uVar4; if (0x20 < (uint)bits) { LAB_00ab6fe3: if (*(void **)((int)buffer + 8) != (void *)0x0) { free(*(void **)((int)buffer + 8)); } *(undefined4 *)buffer = 0; *(undefined4 *)((int)buffer + 4) = 0; *(undefined4 *)((int)buffer + 8) = 0; *(undefined4 *)((int)buffer + 0xc) = 0; *(undefined4 *)((int)buffer + 0x10) = 0; return; } uVar3 = *(uint *)((int)buffer + 0x10); if ((int)(uVar3 - 4) <= *(int *)buffer) { if (*(int *)((int)buffer + 0xc) == 0) { return; } if ((0x7ffffeff < (int)uVar3) || (pvVar1 = realloc(*(void **)((int)buffer + 8),-(uint)(0xfffffeff < uVar3) | uVar3 + 0x100), pvVar1 == (void *)0x0)) goto LAB_00ab6fe3; *(int *)((int)buffer + 0x10) = *(int *)((int)buffer + 0x10) + 0x100; *(void **)((int)buffer + 8) = pvVar1; *(int *)((int)buffer + 0xc) = *(int *)buffer + (int)pvVar1; } uVar3 = value & *(uint *)(&DAT_00b4f838 + bits * 4); uVar4 = bits + *(int *)((int)buffer + 4); **(byte **)((int)buffer + 0xc) = **(byte **)((int)buffer + 0xc) | (char)uVar3 << ((byte)*(int *)((int)buffer + 4) & 0x1f); if ((((7 < (int)uVar4) && (*(char *)(*(int *)((int)buffer + 0xc) + 1) = (char)(uVar3 >> (8U - (char)*(undefined4 *)((int)buffer + 4) & 0x1f)), 0xf < (int)uVar4 )) && (*(char *)(*(int *)((int)buffer + 0xc) + 2) = (char)(uVar3 >> (0x10U - (char)*(undefined4 *)((int)buffer + 4) & 0x1f)), 0x17 < (int)uVar4)) && (*(char *)(*(int *)((int)buffer + 0xc) + 3) = (char)(uVar3 >> (0x18U - (char)*(undefined4 *)((int)buffer + 4) & 0x1f)), 0x1f < (int)uVar4)) { if (*(int *)((int)buffer + 4) == 0) { *(undefined1 *)(*(int *)((int)buffer + 0xc) + 4) = 0; } else { *(char *)(*(int *)((int)buffer + 0xc) + 4) = (char)(uVar3 >> (0x20U - (char)*(int *)((int)buffer + 4) & 0x1f)); } } iVar2 = (int)(uVar4 + ((int)uVar4 >> 0x1f & 7U)) >> 3; *(int *)buffer = *(int *)buffer + iVar2; *(int *)((int)buffer + 0xc) = *(int *)((int)buffer + 0xc) + iVar2; *(uint *)((int)buffer + 4) = uVar4 & 7; return; } //@@ 00ab7010 FUN_00ab7010 uint FUN_00ab7010(void) { int iVar1; byte *pbVar2; byte bVar3; int *in_ECX; uint in_EDX; int iVar4; uint uVar5; if (0x20 < in_EDX) { return 0xffffffff; } iVar1 = in_ECX[1]; iVar4 = in_EDX + iVar1; if (in_ECX[4] + -4 <= *in_ECX) { if (in_ECX[4] - (iVar4 + 7 >> 3) < *in_ECX) { return 0xffffffff; } if (iVar4 == 0) { return 0; } } pbVar2 = (byte *)in_ECX[3]; bVar3 = (byte)iVar1; uVar5 = (uint)(*pbVar2 >> (bVar3 & 0x1f)); if ((((8 < iVar4) && (uVar5 = uVar5 | (uint)pbVar2[1] << (8 - bVar3 & 0x1f), 0x10 < iVar4)) && (uVar5 = uVar5 | (uint)pbVar2[2] << (0x10 - bVar3 & 0x1f), 0x18 < iVar4)) && ((uVar5 = uVar5 | (uint)pbVar2[3] << (0x18 - bVar3 & 0x1f), 0x20 < iVar4 && (iVar1 != 0)))) { uVar5 = uVar5 | (uint)pbVar2[4] << (0x20 - bVar3 & 0x1f); } return uVar5 & *(uint *)(&DAT_00b4f838 + in_EDX * 4); } //@@ 00ab70d0 FUN_00ab70d0 void FUN_00ab70d0(void) { int iVar1; int *in_ECX; int in_EDX; uint uVar2; uVar2 = in_EDX + in_ECX[1]; if (in_ECX[4] - ((int)(uVar2 + 7) >> 3) < *in_ECX) { in_ECX[3] = 0; *in_ECX = in_ECX[4]; in_ECX[1] = 1; return; } iVar1 = (int)(uVar2 + ((int)uVar2 >> 0x1f & 7U)) >> 3; in_ECX[3] = in_ECX[3] + iVar1; *in_ECX = iVar1 + *in_ECX; in_ECX[1] = uVar2 & 7; return; } //@@ 00ab7120 FUN_00ab7120 uint FUN_00ab7120(void) { uint uVar1; int iVar2; byte bVar3; int *in_ECX; uint in_EDX; uint uVar4; uint uVar5; if (0x20 < in_EDX) { LAB_00ab71f5: *in_ECX = in_ECX[4]; in_ECX[3] = 0; in_ECX[1] = 1; return 0xffffffff; } uVar1 = *(uint *)(&DAT_00b4f838 + in_EDX * 4); iVar2 = in_ECX[1]; uVar5 = in_EDX + iVar2; if (in_ECX[4] + -4 <= *in_ECX) { if (in_ECX[4] - ((int)(uVar5 + 7) >> 3) < *in_ECX) goto LAB_00ab71f5; if (uVar5 == 0) { return 0; } } bVar3 = (byte)iVar2; uVar4 = (uint)(*(byte *)in_ECX[3] >> (bVar3 & 0x1f)); if ((((8 < (int)uVar5) && (uVar4 = uVar4 | (uint)((byte *)in_ECX[3])[1] << (8 - bVar3 & 0x1f), 0x10 < (int)uVar5)) && (uVar4 = uVar4 | (uint)*(byte *)(in_ECX[3] + 2) << (0x10 - bVar3 & 0x1f), 0x18 < (int)uVar5)) && ((uVar4 = uVar4 | (uint)*(byte *)(in_ECX[3] + 3) << (0x18 - bVar3 & 0x1f), 0x20 < (int)uVar5 && (iVar2 != 0)))) { uVar4 = uVar4 | (uint)*(byte *)(in_ECX[3] + 4) << (0x20 - bVar3 & 0x1f); } in_ECX[1] = uVar5 & 7; iVar2 = (int)(uVar5 + ((int)uVar5 >> 0x1f & 7U)) >> 3; in_ECX[3] = in_ECX[3] + iVar2; *in_ECX = *in_ECX + iVar2; return uVar4 & uVar1; } //@@ 00ab7220 vorbis_staticbook_unpack /* DB: libvorbis codebook.c: checks sync 0x564342 ("BCV"), dim/entries ilog sum < 24, ordered/sparse length lists, maptype 1/2 quantvals (_book_maptype1_quantvals 00ab8230); caller _vorbis_unpack_books */ uint * vorbis_staticbook_unpack(void) { char cVar1; uint *_Memory; int iVar2; uint uVar3; size_t _Size; void *pvVar4; int iVar5; uint uVar6; undefined4 uVar7; int *in_ECX; uint uVar8; int iVar9; code *local_18; int local_14; int local_c; _Memory = calloc(1,0x28); _Memory[9] = 1; iVar2 = FUN_00ab7120(); if (iVar2 == 0x564342) { uVar3 = FUN_00ab7120(); *_Memory = uVar3; _Size = FUN_00ab7120(); _Memory[1] = _Size; if (_Size != 0xffffffff) { iVar2 = 0; for (uVar8 = uVar3; uVar8 != 0; uVar8 = uVar8 >> 1) { iVar2 = iVar2 + 1; } iVar9 = 0; for (uVar8 = _Size; uVar8 != 0; uVar8 = uVar8 >> 1) { iVar9 = iVar9 + 1; } if (iVar9 + iVar2 < 0x19) { iVar2 = FUN_00ab7120(); if (iVar2 == 0) { iVar2 = FUN_00ab7120(); if ((in_ECX[4] - ((int)(in_ECX[1] + 7 + (in_ECX[1] + 7 >> 0x1f & 7U)) >> 3)) - *in_ECX < (int)(((uint)(iVar2 == 0) * 4 + 1) * _Size + 7) >> 3) goto LAB_00ab7585; local_18 = malloc_exref; pvVar4 = malloc(_Size); _Memory[2] = (uint)pvVar4; if (iVar2 == 0) { iVar2 = 0; if (0 < (int)_Size) { do { iVar9 = FUN_00ab7120(); if (iVar9 == -1) goto LAB_00ab7585; *(char *)(iVar2 + _Memory[2]) = (char)iVar9 + '\x01'; iVar2 = iVar2 + 1; } while (iVar2 < (int)_Size); } } else { local_14 = 0; if (0 < (int)_Size) { do { iVar2 = FUN_00ab7120(); if (iVar2 == 0) { cVar1 = '\0'; } else { iVar2 = FUN_00ab7120(); if (iVar2 == -1) goto LAB_00ab7585; cVar1 = (char)iVar2 + '\x01'; } *(char *)(local_14 + (int)pvVar4) = cVar1; local_14 = local_14 + 1; } while (local_14 < (int)_Size); } } } else { if (iVar2 != 1) goto LAB_00ab7585; local_14 = FUN_00ab7120(); iVar2 = local_14 + 1; if (iVar2 == 0) goto LAB_00ab7585; local_18 = malloc_exref; pvVar4 = malloc(_Size); _Memory[2] = (uint)pvVar4; iVar9 = 0; if (0 < (int)_Size) { do { for (uVar8 = _Size - iVar9; uVar8 != 0; uVar8 = uVar8 >> 1) { } iVar5 = FUN_00ab7120(); if (((iVar5 == -1) || (0x1f < local_14)) || ((int)(_Size - iVar9) < iVar5)) goto LAB_00ab7585; if (0 < iVar5) { if (1 < iVar5 + -1 >> ((byte)local_14 & 0x1f)) goto LAB_00ab7585; do { *(char *)((int)pvVar4 + iVar9) = (char)iVar2; iVar9 = iVar9 + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); } local_14 = local_14 + 1; iVar2 = iVar2 + 1; } while (iVar9 < (int)_Size); } } uVar8 = FUN_00ab7120(); _Memory[3] = uVar8; if (uVar8 == 0) { return _Memory; } if ((uVar8 == 1) || (uVar8 == 2)) { uVar6 = FUN_00ab7120(); _Memory[4] = uVar6; uVar6 = FUN_00ab7120(); _Memory[5] = uVar6; iVar2 = FUN_00ab7120(); _Memory[6] = iVar2 + 1U; uVar6 = FUN_00ab7120(); _Memory[7] = uVar6; if (uVar6 != 0xffffffff) { local_c = 0; if (uVar8 == 1) { if (uVar3 == 0) { local_c = 0; } else { local_c = FUN_00ab8230(); } } else if (uVar8 == 2) { local_c = _Size * uVar3; } if ((int)((iVar2 + 1U) * local_c + 7) >> 3 <= (in_ECX[4] - ((int)(in_ECX[1] + 7 + (in_ECX[1] + 7 >> 0x1f & 7U)) >> 3)) - *in_ECX) { uVar3 = (*local_18)(local_c * 4); _Memory[8] = uVar3; iVar2 = 0; if (local_c < 1) { if (local_c == 0) { return _Memory; } } else { do { uVar7 = FUN_00ab7120(); *(undefined4 *)(_Memory[8] + iVar2 * 4) = uVar7; iVar2 = iVar2 + 1; } while (iVar2 < local_c); } if (*(int *)((_Memory[8] - 4) + local_c * 4) != -1) { return _Memory; } } } } } } } LAB_00ab7585: if (_Memory[9] != 0) { if ((void *)_Memory[8] != (void *)0x0) { free((void *)_Memory[8]); } if ((void *)_Memory[2] != (void *)0x0) { free((void *)_Memory[2]); } *_Memory = 0; _Memory[1] = 0; _Memory[2] = 0; _Memory[3] = 0; _Memory[4] = 0; _Memory[5] = 0; _Memory[6] = 0; _Memory[7] = 0; _Memory[8] = 0; _Memory[9] = 0; free(_Memory); } return (uint *)0x0; } //@@ 00ab75d0 FUN_00ab75d0 uint FUN_00ab75d0(void) { uint uVar1; int iVar2; uint uVar3; int in_ECX; uint uVar4; uint uVar5; int iVar6; uint uVar7; iVar6 = *(int *)(in_ECX + 0x28); iVar2 = FUN_00ab7010(); if (iVar2 < 0) { uVar7 = 0; iVar2 = *(int *)(in_ECX + 8); } else { uVar3 = *(uint *)(*(int *)(in_ECX + 0x20) + iVar2 * 4); if (-1 < (int)uVar3) { FUN_00ab70d0(); return uVar3 - 1; } uVar7 = (int)uVar3 >> 0xf & 0x7fff; iVar2 = *(int *)(in_ECX + 8) - (uVar3 & 0x7fff); } uVar3 = FUN_00ab7010(); while ((int)uVar3 < 0) { if (iVar6 < 2) { return 0xffffffff; } iVar6 = iVar6 + -1; uVar3 = FUN_00ab7010(); } uVar3 = uVar3 << 0x10 | uVar3 >> 0x10; uVar3 = (uVar3 >> 8 ^ uVar3 << 8) & 0xff00ff ^ uVar3 << 8; uVar3 = (uVar3 >> 4 ^ uVar3 << 4) & 0xf0f0f0f ^ uVar3 << 4; uVar3 = (uVar3 >> 2 ^ uVar3 * 4) & 0x33333333 ^ uVar3 * 4; uVar5 = (uVar3 >> 1 ^ uVar3 * 2) & 0x55555555 ^ uVar3 * 2; uVar3 = iVar2 - uVar7; if (1 < (int)uVar3) { do { uVar3 = uVar3 >> 1; uVar1 = *(uint *)(*(int *)(in_ECX + 0x14) + (uVar3 + uVar7) * 4); uVar4 = uVar3; if (uVar5 < uVar1) { uVar4 = 0; } uVar7 = uVar7 + uVar4; iVar2 = iVar2 - (-(uint)(uVar5 < uVar1) & uVar3); uVar3 = iVar2 - uVar7; } while (1 < (int)uVar3); } if (iVar6 < *(char *)(*(int *)(in_ECX + 0x1c) + uVar7)) { FUN_00ab70d0(); return 0xffffffff; } FUN_00ab70d0(); return uVar7; } //@@ 00ab7750 vorbis_book_decodevs_add /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis codebook.c: passed as the decode callback to _01inverse FUN_00ad0790 by res0_inverse FUN_00ad0a20 (slot 7 of residue0_exportbundle 00b5f220); step = n/book->dim, alloca'd entry/t arrays, decode_packed_entry_number inlined (bit-reverse swap, FUN_00ab7010 oggpack_look) */ undefined4 vorbis_book_decodevs_add(int *param_1,int param_2,undefined4 param_3,int param_4) { uint uVar1; int iVar2; int iVar3; int *piVar4; int iVar5; uint uVar6; uint uVar7; float *pfVar8; uint uVar9; uint uVar10; int iVar11; int iVar12; int *piVar13; uint auStack_230 [128]; int local_20 [5]; int local_c; float *local_8; if (0 < param_1[2]) { param_4 = param_4 / *param_1; local_20[-5 - param_4] = 0xab778b; piVar4 = local_20 + param_4 * -2 + -4; local_20[2] = 0; if (0 < param_4) { iVar11 = (int)local_20 + (param_4 * -4 - (int)piVar4) + -0x10; local_8 = (float *)piVar4; do { iVar12 = param_1[10]; local_20[param_4 * -2 + -5] = 0xab77b5; iVar5 = FUN_00ab7010(); if (iVar5 < 0) { iVar5 = param_1[2]; uVar10 = 0; LAB_00ab77f0: local_20[param_4 * -2 + -5] = 0xab77fa; uVar6 = FUN_00ab7010(); while ((int)uVar6 < 0) { if (iVar12 < 2) goto LAB_00ab7a21; iVar12 = iVar12 + -1; local_20[param_4 * -2 + -5] = 0xab7817; uVar6 = FUN_00ab7010(); } uVar6 = uVar6 << 0x10 | uVar6 >> 0x10; uVar6 = (uVar6 >> 8 ^ uVar6 << 8) & 0xff00ff ^ uVar6 << 8; uVar6 = (uVar6 >> 4 ^ uVar6 << 4) & 0xf0f0f0f ^ uVar6 << 4; uVar6 = (uVar6 >> 2 ^ uVar6 * 4) & 0x33333333 ^ uVar6 * 4; uVar6 = (uVar6 >> 1 ^ uVar6 * 2) & 0x55555555 ^ uVar6 * 2; uVar9 = iVar5 - uVar10; if (1 < (int)uVar9) { do { uVar9 = uVar9 >> 1; uVar1 = *(uint *)(param_1[5] + (uVar9 + uVar10) * 4); uVar7 = uVar9; if (uVar6 < uVar1) { uVar7 = 0; } uVar10 = uVar10 + uVar7; iVar5 = iVar5 - (-(uint)(uVar6 < uVar1) & uVar9); uVar9 = iVar5 - uVar10; } while (1 < (int)uVar9); } if (iVar12 < *(char *)(param_1[7] + uVar10)) { local_20[param_4 * -2 + -5] = 0xab7a21; FUN_00ab70d0(); LAB_00ab7a21: *(undefined4 *)(iVar11 + (int)local_8) = 0xffffffff; return 0xffffffff; } } else { uVar6 = *(uint *)(param_1[8] + iVar5 * 4); if ((int)uVar6 < 0) { uVar10 = (int)uVar6 >> 0xf & 0x7fff; iVar5 = param_1[2] - (uVar6 & 0x7fff); goto LAB_00ab77f0; } uVar10 = uVar6 - 1; } local_20[param_4 * -2 + -5] = 0xab78ea; FUN_00ab70d0(); *(uint *)(iVar11 + (int)local_8) = uVar10; if (uVar10 == 0xffffffff) { return 0xffffffff; } local_20[2] = local_20[2] + 1; *local_8 = (float)(param_1[4] + *param_1 * uVar10 * 4); local_8 = local_8 + 1; } while (local_20[2] < param_4); } iVar11 = 0; local_c = 0; if (0 < *param_1) { local_8 = (float *)(param_2 + 8); do { iVar12 = 0; if (3 < param_4) { piVar13 = local_20 + param_4 * -2 + -2; iVar5 = (param_4 - 4U >> 2) + 1; iVar12 = iVar5 * 4; pfVar8 = local_8; do { iVar2 = piVar13[-1]; pfVar8[-2] = *(float *)(piVar13[-2] + iVar11 * 4) + pfVar8[-2]; iVar3 = *piVar13; pfVar8[-1] = *(float *)(iVar2 + iVar11 * 4) + pfVar8[-1]; iVar2 = piVar13[1]; piVar13 = piVar13 + 4; *pfVar8 = *(float *)(iVar3 + iVar11 * 4) + *pfVar8; pfVar8[1] = *(float *)(iVar2 + iVar11 * 4) + pfVar8[1]; pfVar8 = pfVar8 + 4; iVar5 = iVar5 + -1; } while (iVar5 != 0); } if (iVar12 < param_4) { pfVar8 = (float *)(param_2 + (local_c + iVar12) * 4); do { piVar13 = piVar4 + iVar12; iVar12 = iVar12 + 1; *pfVar8 = *(float *)(*piVar13 + iVar11 * 4) + *pfVar8; pfVar8 = pfVar8 + 1; } while (iVar12 < param_4); } iVar11 = iVar11 + 1; local_c = local_c + param_4; local_8 = local_8 + param_4; } while (iVar11 < *param_1); } } return 0; } //@@ 00ab7a40 FUN_00ab7a40 undefined4 FUN_00ab7a40(int *param_1,int param_2,undefined4 param_3,int param_4) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; if (0 < param_1[2]) { iVar6 = 0; if (*param_1 < 9) { if (0 < param_4) { do { iVar2 = FUN_00ab75d0(); if (iVar2 == -1) { return 0xffffffff; } iVar2 = *param_1 * iVar2; iVar5 = 0; switch(*param_1) { case 1: iVar4 = param_1[4]; goto LAB_00ab7bb1; case 2: iVar4 = param_1[4]; goto LAB_00ab7b96; case 3: iVar4 = param_1[4]; goto LAB_00ab7b7b; case 4: iVar4 = param_1[4]; goto LAB_00ab7b60; case 5: iVar4 = param_1[4]; goto LAB_00ab7b45; case 6: iVar4 = param_1[4]; goto LAB_00ab7b2a; case 7: iVar4 = param_1[4]; break; case 8: iVar4 = param_1[4]; iVar5 = 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar2 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; break; default: goto LAB_00ab7bc3; } iVar3 = iVar2 + iVar5; iVar5 = iVar5 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar3 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7b2a: iVar3 = iVar2 + iVar5; iVar5 = iVar5 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar3 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7b45: iVar3 = iVar2 + iVar5; iVar5 = iVar5 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar3 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7b60: iVar3 = iVar2 + iVar5; iVar5 = iVar5 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar3 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7b7b: iVar3 = iVar2 + iVar5; iVar5 = iVar5 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar3 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7b96: iVar3 = iVar2 + iVar5; iVar5 = iVar5 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar3 * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7bb1: *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + (iVar2 + iVar5) * 4) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; LAB_00ab7bc3: if (param_4 <= iVar6) { return 0; } } while( true ); } } else if (0 < param_4) { do { iVar2 = FUN_00ab75d0(); if (iVar2 == -1) { return 0xffffffff; } iVar5 = *param_1; iVar4 = param_1[4]; iVar3 = 0; if (0 < iVar5) { do { iVar1 = iVar3 * 4; iVar3 = iVar3 + 1; *(float *)(param_2 + iVar6 * 4) = *(float *)(iVar4 + iVar5 * iVar2 * 4 + iVar1) + *(float *)(param_2 + iVar6 * 4); iVar6 = iVar6 + 1; } while (iVar3 < *param_1); } } while (iVar6 < param_4); } } return 0; } //@@ 00ab7c00 vorbis_book_decodev_set /* DB: libvorbis codebook.c: zero-fills n floats when book->used_entries (ECX[2]) < 1, else decode_packed_entry_number (0xab7010) and copies valuelist[entry*dim]; only caller FUN_00ace450 (floor0_inverse1) */ undefined4 vorbis_book_decodev_set(undefined4 param_1,int param_2) { uint uVar1; int iVar2; uint uVar3; int iVar4; uint uVar5; int *in_ECX; int iVar6; undefined4 *in_EDX; uint uVar7; undefined4 *puVar8; uint uVar9; int iVar10; int local_c; int local_8; if (in_ECX[2] < 1) { if (0 < param_2) { for (; param_2 != 0; param_2 = param_2 + -1) { *in_EDX = 0; in_EDX = in_EDX + 1; } } } else { iVar10 = 0; local_8 = 0; if (0 < param_2) { LAB_00ab7c30: do { iVar4 = in_ECX[10]; iVar2 = FUN_00ab7010(); if (iVar2 < 0) { iVar2 = in_ECX[2]; uVar9 = 0; LAB_00ab7c7c: uVar3 = FUN_00ab7010(); while ((int)uVar3 < 0) { if (iVar4 < 2) { return 0xffffffff; } iVar4 = iVar4 + -1; uVar3 = FUN_00ab7010(); } uVar3 = uVar3 << 0x10 | uVar3 >> 0x10; uVar3 = (uVar3 >> 8 ^ uVar3 << 8) & 0xff00ff ^ uVar3 << 8; uVar3 = (uVar3 >> 4 ^ uVar3 << 4) & 0xf0f0f0f ^ uVar3 << 4; uVar3 = (uVar3 >> 2 ^ uVar3 * 4) & 0x33333333 ^ uVar3 * 4; uVar3 = (uVar3 >> 1 ^ uVar3 * 2) & 0x55555555 ^ uVar3 * 2; uVar7 = iVar2 - uVar9; if (1 < (int)uVar7) { do { uVar7 = uVar7 >> 1; uVar1 = *(uint *)(in_ECX[5] + (uVar9 + uVar7) * 4); uVar5 = uVar7; if (uVar3 < uVar1) { uVar5 = 0; } uVar9 = uVar9 + uVar5; iVar2 = iVar2 - (-(uint)(uVar3 < uVar1) & uVar7); uVar7 = iVar2 - uVar9; } while (1 < (int)uVar7); iVar10 = local_8; } if (iVar4 < *(char *)(in_ECX[7] + uVar9)) { FUN_00ab70d0(); return 0xffffffff; } } else { uVar3 = *(uint *)(in_ECX[8] + iVar2 * 4); if ((int)uVar3 < 0) { uVar9 = (int)uVar3 >> 0xf & 0x7fff; iVar2 = in_ECX[2] - (uVar3 & 0x7fff); goto LAB_00ab7c7c; } uVar9 = uVar3 - 1; } FUN_00ab70d0(); if (uVar9 == 0xffffffff) { return 0xffffffff; } iVar4 = in_ECX[4] + *in_ECX * uVar9 * 4; iVar2 = 0; if (3 < param_2 - iVar10) { local_c = iVar10 + 3; puVar8 = in_EDX + iVar10 + 2; do { if (*in_ECX <= iVar2) { LAB_00ab7e31: if (param_2 <= iVar10) { return 0; } goto LAB_00ab7c30; } puVar8[-2] = *(undefined4 *)(iVar4 + iVar2 * 4); if (*in_ECX <= iVar2 + 1) { local_c = iVar10 + 1; LAB_00ab7e2e: iVar10 = local_c; local_8 = local_c; goto LAB_00ab7e31; } puVar8[-1] = *(undefined4 *)(iVar4 + (iVar2 + 1) * 4); if (*in_ECX <= iVar2 + 2) { local_c = local_c + -1; goto LAB_00ab7e2e; } iVar6 = iVar2 + 3; *puVar8 = *(undefined4 *)(iVar4 + (iVar2 + 2) * 4); if (*in_ECX <= iVar6) goto LAB_00ab7e2e; iVar10 = iVar10 + 4; local_c = local_c + 4; iVar2 = iVar2 + 4; puVar8[1] = *(undefined4 *)(iVar4 + iVar6 * 4); puVar8 = puVar8 + 4; local_8 = iVar10; } while (iVar10 < param_2 + -3); } if (param_2 <= iVar10) { return 0; } puVar8 = (undefined4 *)(iVar4 + iVar2 * 4); while (iVar2 < *in_ECX) { iVar2 = iVar2 + 1; in_EDX[iVar10] = *puVar8; puVar8 = puVar8 + 1; iVar10 = iVar10 + 1; local_8 = iVar10; if (param_2 <= iVar10) { return 0; } } } while( true ); } } return 0; } //@@ 00ab7e70 vorbis_book_decodevv_add /* DB: libvorbis codebook.c: (book, a**, offset, ch, opb, n) loop i=offset/ch .. (offset+n)/ch, decode_packed_entry_number (0xab7010), skips when used_entries (ECX[2]) <= 0; only caller 0xad11e0 = res2_inverse (slot 7 of residue2_exportbundle 0xb5f25c) */ undefined4 vorbis_book_decodevv_add(int param_1,int param_2,undefined4 param_3,int param_4) { int iVar1; uint uVar2; int iVar3; int iVar4; uint uVar5; uint uVar6; int *in_ECX; int in_EDX; uint uVar7; int iVar8; uint uVar9; int iVar10; int iVar11; int local_14; local_14 = 0; if (0 < in_ECX[2]) { iVar3 = param_1 / param_2; iVar8 = iVar3; while (iVar3 < (param_1 + param_4) / param_2) { iVar11 = in_ECX[10]; iVar4 = FUN_00ab7010(); if (iVar4 < 0) { iVar4 = in_ECX[2]; uVar9 = 0; LAB_00ab7f0b: uVar5 = FUN_00ab7010(); while ((int)uVar5 < 0) { if (iVar11 < 2) { return 0xffffffff; } iVar11 = iVar11 + -1; uVar5 = FUN_00ab7010(); } uVar5 = uVar5 << 0x10 | uVar5 >> 0x10; uVar5 = (uVar5 >> 8 ^ uVar5 << 8) & 0xff00ff ^ uVar5 << 8; uVar5 = (uVar5 >> 4 ^ uVar5 << 4) & 0xf0f0f0f ^ uVar5 << 4; uVar5 = (uVar5 >> 2 ^ uVar5 * 4) & 0x33333333 ^ uVar5 * 4; uVar5 = (uVar5 >> 1 ^ uVar5 * 2) & 0x55555555 ^ uVar5 * 2; uVar7 = iVar4 - uVar9; if (1 < (int)uVar7) { do { uVar7 = uVar7 >> 1; uVar2 = *(uint *)(in_ECX[5] + (uVar7 + uVar9) * 4); uVar6 = uVar7; if (uVar5 < uVar2) { uVar6 = 0; } uVar9 = uVar9 + uVar6; iVar4 = iVar4 - (-(uint)(uVar5 < uVar2) & uVar7); uVar7 = iVar4 - uVar9; } while (1 < (int)uVar7); iVar3 = iVar8; } if (iVar11 < *(char *)(in_ECX[7] + uVar9)) { FUN_00ab70d0(); return 0xffffffff; } } else { uVar5 = *(uint *)(in_ECX[8] + iVar4 * 4); if ((int)uVar5 < 0) { uVar9 = (int)uVar5 >> 0xf & 0x7fff; iVar4 = in_ECX[2] - (uVar5 & 0x7fff); goto LAB_00ab7f0b; } uVar9 = uVar5 - 1; } FUN_00ab70d0(); if (uVar9 == 0xffffffff) { return 0xffffffff; } iVar11 = *in_ECX; iVar4 = in_ECX[4]; iVar10 = 0; if (0 < iVar11) { iVar8 = iVar3; do { iVar1 = local_14 + 1; iVar3 = *(int *)(in_EDX + local_14 * 4); *(float *)(iVar3 + iVar8 * 4) = *(float *)(iVar4 + iVar11 * uVar9 * 4 + iVar10 * 4) + *(float *)(iVar3 + iVar8 * 4); iVar3 = iVar8 + 1; if (iVar1 != param_2) { iVar3 = iVar8; } local_14 = 0; if (iVar1 != param_2) { local_14 = iVar1; } iVar10 = iVar10 + 1; iVar8 = iVar3; } while (iVar10 < *in_ECX); } } } return 0; } //@@ 00ab8090 FUN_00ab8090 uint * FUN_00ab8090(int param_1) { char cVar1; uint uVar2; uint *puVar3; int iVar4; uint uVar5; byte bVar6; int in_EDX; int iVar7; int iVar8; uint local_98 [33]; uint *local_14; int local_10; int local_c; iVar8 = in_EDX; if (param_1 != 0) { iVar8 = param_1; } local_c = in_EDX; puVar3 = malloc(iVar8 << 2); local_14 = puVar3; memset(local_98,0,0x84); iVar8 = 0; if (0 < in_EDX) { iVar4 = local_10; in_EDX = local_c; do { iVar7 = (int)(char)*(byte *)(iVar8 + iVar4); if (iVar7 < 1) { if (param_1 == 0) { puVar3 = puVar3 + 1; } } else { uVar5 = local_98[iVar7]; if ((iVar7 < 0x20) && (uVar5 >> (*(byte *)(iVar8 + iVar4) & 0x1f) != 0)) goto LAB_00ab821a; *puVar3 = uVar5; puVar3 = puVar3 + 1; iVar4 = iVar7; do { if ((local_98[iVar4] & 1) != 0) { if (iVar4 == 1) { local_98[1] = local_98[1] + 1; } else { local_98[iVar4] = local_98[iVar4 + -1] * 2; } break; } local_98[iVar4] = local_98[iVar4] + 1; iVar4 = iVar4 + -1; } while (0 < iVar4); while ((iVar4 = iVar7 + 1, iVar4 < 0x21 && (uVar2 = local_98[iVar4], uVar2 >> 1 == uVar5))) { local_98[iVar4] = local_98[iVar7] * 2; iVar7 = iVar4; uVar5 = uVar2; } iVar4 = local_10; in_EDX = local_c; } iVar8 = iVar8 + 1; } while (iVar8 < in_EDX); } if (param_1 != 1) { iVar8 = 1; do { if ((local_98[iVar8] & 0xffffffffU >> (0x20U - (char)iVar8 & 0x1f)) != 0) { LAB_00ab821a: free(local_14); return (uint *)0x0; } iVar8 = iVar8 + 1; } while (iVar8 < 0x21); } iVar8 = 0; if (0 < in_EDX) { puVar3 = local_14; do { uVar5 = 0; cVar1 = *(char *)(iVar8 + local_10); iVar4 = 0; if ('\0' < cVar1) { do { bVar6 = (byte)iVar4; iVar4 = iVar4 + 1; uVar5 = uVar5 * 2 | *puVar3 >> (bVar6 & 0x1f) & 1; } while (iVar4 < cVar1); } if ((param_1 == 0) || (cVar1 != '\0')) { *puVar3 = uVar5; puVar3 = puVar3 + 1; } iVar8 = iVar8 + 1; } while (iVar8 < local_c); } return local_14; } //@@ 00ab8230 FUN_00ab8230 int FUN_00ab8230(void) { int iVar1; int iVar2; int *in_ECX; int iVar3; int iVar4; int iVar5; int iVar6; double dVar7; iVar1 = *in_ECX; iVar2 = in_ECX[1]; dVar7 = (double)iVar2; libm_sse2_pow_precise(); dVar7 = floor(dVar7); iVar4 = (int)dVar7; while( true ) { iVar3 = 1; iVar5 = 1; if (0 < iVar1) { iVar6 = iVar1; do { iVar3 = iVar3 * iVar4; iVar5 = iVar5 * (iVar4 + 1); iVar6 = iVar6 + -1; } while (iVar6 != 0); } if ((iVar3 <= iVar2) && (iVar2 < iVar5)) break; iVar4 = (uint)(iVar3 <= iVar2) * 2 + -1 + iVar4; } return iVar4; } //@@ 00ab82e0 _book_unquantize /* DB: libvorbis sharedbook.c: _float32_unpack of q_min/q_delta (ldexp(mant, exp-788)), maptype 1 via _book_maptype1_quantvals 00ab8230, maptype 2 list, optional sparsemap; caller vorbis_book_init_decode */ void * _book_unquantize(int param_1) { uint uVar1; float fVar2; void *pvVar3; int iVar4; int *in_ECX; int in_EDX; int iVar5; int iVar6; double dVar7; float fVar8; double dVar9; int local_20; int local_1c; int local_14; local_14 = 0; if ((in_ECX[3] != 1) && (in_ECX[3] != 2)) { return (void *)0x0; } uVar1 = in_ECX[4]; dVar7 = (double)(uVar1 & 0x1fffff); if ((int)uVar1 < 0) { dVar7 = -dVar7; } dVar9 = ldexp(dVar7,((int)uVar1 >> 0x15 & 0x3ffU) - 0x314); uVar1 = in_ECX[5]; dVar7 = (double)(uVar1 & 0x1fffff); if ((int)uVar1 < 0) { dVar7 = -dVar7; } dVar7 = ldexp(dVar7,((int)uVar1 >> 0x15 & 0x3ffU) - 0x314); pvVar3 = calloc(*in_ECX * in_EDX,4); if (in_ECX[3] == 1) { iVar4 = FUN_00ab8230(); local_1c = 0; if (0 < in_ECX[1]) { do { if ((param_1 == 0) || (*(char *)(local_1c + in_ECX[2]) != '\0')) { iVar5 = *in_ECX; iVar6 = 0; local_20 = 1; fVar8 = 0.0; if (0 < iVar5) { do { fVar2 = ABS((float)*(int *)(in_ECX[8] + ((local_1c / local_20) % iVar4) * 4)) * (float)dVar7 + (float)dVar9 + fVar8; if (in_ECX[7] != 0) { fVar8 = fVar2; } if (param_1 == 0) { *(float *)((int)pvVar3 + (iVar5 * local_14 + iVar6) * 4) = fVar2; } else { *(float *)((int)pvVar3 + (*(int *)(param_1 + local_14 * 4) * iVar5 + iVar6) * 4) = fVar2; } iVar6 = iVar6 + 1; local_20 = local_20 * iVar4; iVar5 = *in_ECX; } while (iVar6 < iVar5); } local_14 = local_14 + 1; } local_1c = local_1c + 1; } while (local_1c < in_ECX[1]); } } else if ((in_ECX[3] == 2) && (0 < in_ECX[1])) { local_1c = 0; do { if ((param_1 == 0) || (*(char *)(local_1c + in_ECX[2]) != '\0')) { iVar4 = *in_ECX; iVar5 = 0; fVar8 = 0.0; if (0 < iVar4) { do { fVar2 = ABS((float)*(int *)(in_ECX[8] + (iVar4 * local_1c + iVar5) * 4)) * (float)dVar7 + (float)dVar9 + fVar8; if (in_ECX[7] != 0) { fVar8 = fVar2; } if (param_1 == 0) { *(float *)((int)pvVar3 + (iVar4 * local_14 + iVar5) * 4) = fVar2; } else { *(float *)((int)pvVar3 + (*(int *)(param_1 + local_14 * 4) * iVar4 + iVar5) * 4) = fVar2; } iVar4 = *in_ECX; iVar5 = iVar5 + 1; } while (iVar5 < iVar4); } local_14 = local_14 + 1; } local_1c = local_1c + 1; } while (local_1c < in_ECX[1]); return pvVar3; } return pvVar3; } //@@ 00ab85c0 FUN_00ab85c0 void FUN_00ab85c0(void) { void *in_ECX; if (*(void **)((int)in_ECX + 0x10) != (void *)0x0) { free(*(void **)((int)in_ECX + 0x10)); } if (*(void **)((int)in_ECX + 0x14) != (void *)0x0) { free(*(void **)((int)in_ECX + 0x14)); } if (*(void **)((int)in_ECX + 0x18) != (void *)0x0) { free(*(void **)((int)in_ECX + 0x18)); } if (*(void **)((int)in_ECX + 0x1c) != (void *)0x0) { free(*(void **)((int)in_ECX + 0x1c)); } if (*(void **)((int)in_ECX + 0x20) != (void *)0x0) { free(*(void **)((int)in_ECX + 0x20)); } memset(in_ECX,0,0x38); return; } //@@ 00ab8620 FUN_00ab8620 int FUN_00ab8620(undefined4 *param_1,undefined4 *param_2) { return (uint)(*(uint *)*param_2 < *(uint *)*param_1) - (uint)(*(uint *)*param_1 < *(uint *)*param_2); } //@@ 00ab8650 vorbis_book_init_decode /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis sharedbook.c: memset(c,0,0x38) then counts entries with length>0, malloc/qsort codeword tables; only caller _vds_shared_init book loop ("if book==NULL || init_decode()!=0 abort") */ undefined4 vorbis_book_init_decode(void) { uint *puVar1; void *pvVar2; undefined4 uVar3; undefined4 *in_ECX; int iVar4; uint uVar5; int iVar6; int iVar7; uint uVar8; int iVar9; uint uVar10; char cVar11; undefined4 *in_EDX; int iVar12; uint *puVar13; int *piVar14; int iVar15; undefined4 uStackY_50; undefined4 uStackY_4c; undefined1 auStack_2e [2]; int local_2c [4]; int local_1c; int local_18; int local_14; int local_c; local_14 = 0; uStackY_4c = 0xab8671; memset(in_ECX,0,0x38); iVar7 = in_EDX[1]; iVar4 = 0; if (0 < iVar7) { iVar15 = 0; do { local_14 = iVar15 + 1; if (*(char *)(in_EDX[2] + iVar4) < '\x01') { local_14 = iVar15; } iVar4 = iVar4 + 1; iVar15 = local_14; } while (iVar4 < iVar7); } in_ECX[1] = iVar7; in_ECX[2] = local_14; *in_ECX = *in_EDX; if (0 < local_14) { puVar1 = (uint *)FUN_00ab8090(); iVar7 = local_14 * 4; iVar4 = local_14 * -4; if (puVar1 == (uint *)0x0) { *(undefined4 *)(auStack_2e + iVar4 + -0x12) = 0xab86dc; FUN_00ab85c0(); return 0xffffffff; } puVar13 = puVar1; iVar15 = local_14; do { uVar5 = *puVar13 << 0x10 | *puVar13 >> 0x10; uVar5 = (uVar5 >> 8 ^ uVar5 << 8) & 0xff00ff ^ uVar5 << 8; uVar5 = (uVar5 >> 4 ^ uVar5 << 4) & 0xf0f0f0f ^ uVar5 << 4; uVar5 = (uVar5 >> 2 ^ uVar5 * 4) & 0x33333333 ^ uVar5 * 4; *puVar13 = (uVar5 >> 1 ^ uVar5 * 2) & 0x55555555 ^ uVar5 * 2; *(uint **)(auStack_2e + (iVar4 - (int)puVar1) + -0xe + (int)puVar13) = puVar13; puVar13 = puVar13 + 1; iVar15 = iVar15 + -1; } while (iVar15 != 0); *(code **)(auStack_2e + iVar4 + -0x12) = FUN_00ab8620; *(undefined4 *)(auStack_2e + iVar4 + -0x16) = 4; *(int *)(auStack_2e + iVar4 + -0x1a) = local_14; *(undefined1 **)(auStack_2e + iVar4 + -0x1e) = auStack_2e + iVar4 + -0xe; (&uStackY_50)[-local_14] = 0xab8779; qsort(*(void **)(auStack_2e + iVar4 + -0x1e),*(size_t *)(auStack_2e + iVar4 + -0x1a), *(size_t *)(auStack_2e + iVar4 + -0x16),*(_PtFuncCompare **)(auStack_2e + iVar4 + -0x12)); *(undefined4 *)(auStack_2e + iVar4 + -0x12) = 0xab878a; iVar9 = iVar4 + -0x3c; iVar15 = local_14 * -4; piVar14 = (int *)(auStack_2e + iVar15 + iVar9 + 0x2e); *(int *)(auStack_2e + iVar15 + iVar9 + 0x2a) = local_14 * 4; *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x26) = 0xab8796; pvVar2 = malloc(*(size_t *)(auStack_2e + iVar15 + iVar9 + 0x2a)); iVar6 = 0; in_ECX[5] = pvVar2; do { *(int *)(auStack_2e + (*(int *)(auStack_2e + iVar6 * 4 + iVar4 + -0xe) - (int)puVar1 >> 2) * 4 + iVar15 + iVar9 + 0x2e) = iVar6; iVar6 = iVar6 + 1; } while (iVar6 < local_14); do { iVar4 = *piVar14; piVar14 = piVar14 + 1; *(undefined4 *)(in_ECX[5] + iVar4 * 4) = *(undefined4 *) ((int)puVar1 + (-4 - (int)(auStack_2e + iVar15 + iVar9 + 0x2e)) + (int)piVar14); local_14 = local_14 + -1; } while (local_14 != 0); *(uint **)(auStack_2e + iVar15 + iVar9 + 0x2a) = puVar1; *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x26) = 0xab87e5; free(*(void **)(auStack_2e + iVar15 + iVar9 + 0x2a)); *(undefined1 **)(auStack_2e + iVar15 + iVar9 + 0x2a) = auStack_2e + iVar15 + iVar9 + 0x2e; *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x26) = 0xab87f9; uVar3 = _book_unquantize(); in_ECX[4] = uVar3; *(int *)(auStack_2e + iVar15 + iVar9 + 0x2a) = iVar7; *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x26) = 0xab8808; pvVar2 = malloc(*(size_t *)(auStack_2e + iVar15 + iVar9 + 0x2a)); iVar7 = 0; in_ECX[6] = pvVar2; local_1c = 0; iVar4 = 0; if (0 < (int)in_EDX[1]) { do { if ('\0' < *(char *)(iVar4 + in_EDX[2])) { *(int *)(in_ECX[6] + *(int *)(auStack_2e + iVar7 * 4 + iVar15 + iVar9 + 0x2e) * 4) = iVar4 ; iVar7 = local_1c + 1; local_1c = iVar7; } iVar4 = iVar4 + 1; } while (iVar4 < (int)in_EDX[1]); } *(int *)(auStack_2e + iVar15 + iVar9 + 0x2a) = iVar7; *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x26) = 0xab8846; pvVar2 = malloc(*(size_t *)(auStack_2e + iVar15 + iVar9 + 0x2a)); iVar7 = 0; in_ECX[7] = pvVar2; iVar4 = 0; local_14 = 0; if (0 < (int)in_EDX[1]) { do { if ('\0' < *(char *)(iVar4 + in_EDX[2])) { *(char *)(*(int *)(auStack_2e + iVar7 * 4 + iVar15 + iVar9 + 0x2e) + in_ECX[7]) = *(char *)(iVar4 + in_EDX[2]); iVar7 = local_14 + 1; local_14 = iVar7; } iVar4 = iVar4 + 1; } while (iVar4 < (int)in_EDX[1]); } iVar4 = 0; for (uVar5 = in_ECX[2]; uVar5 != 0; uVar5 = uVar5 >> 1) { iVar4 = iVar4 + 1; } iVar4 = iVar4 + -4; in_ECX[9] = iVar4; if (iVar4 < 5) { in_ECX[9] = 5; iVar4 = 5; } else if (8 < iVar4) { in_ECX[9] = 8; iVar4 = 8; } iVar4 = 1 << ((byte)iVar4 & 0x1f); *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x2a) = 4; *(int *)(auStack_2e + iVar15 + iVar9 + 0x26) = iVar4; *(undefined4 *)(auStack_2e + iVar15 + iVar9 + 0x22) = 0xab88d4; pvVar2 = calloc(*(size_t *)(auStack_2e + iVar15 + iVar9 + 0x26), *(size_t *)(auStack_2e + iVar15 + iVar9 + 0x2a)); in_ECX[8] = pvVar2; in_ECX[10] = 0; local_1c = 0; if (iVar7 < 1) { cVar11 = (char)in_ECX[9]; } else { local_c = in_ECX[7]; do { if ((int)in_ECX[10] < (int)*(char *)(local_c + local_1c)) { in_ECX[10] = (int)*(char *)(local_c + local_1c); } iVar12 = in_ECX[9]; if (*(char *)(local_c + local_1c) <= iVar12) { uVar5 = *(uint *)(in_ECX[5] + local_1c * 4); uVar5 = uVar5 << 0x10 | uVar5 >> 0x10; uVar5 = (uVar5 >> 8 ^ uVar5 << 8) & 0xff00ff ^ uVar5 << 8; uVar5 = (uVar5 >> 4 ^ uVar5 << 4) & 0xf0f0f0f ^ uVar5 << 4; uVar5 = (uVar5 >> 2 ^ uVar5 * 4) & 0x33333333 ^ uVar5 * 4; local_2c[2] = 0; iVar12 = in_ECX[9]; if (0 < 1 << ((char)iVar12 - *(char *)(local_c + local_1c) & 0x1fU)) { do { *(int *)(in_ECX[8] + (local_2c[2] << (*(byte *)(local_1c + in_ECX[7]) & 0x1f) | (uVar5 >> 1 ^ uVar5 * 2) & 0x55555555 ^ uVar5 * 2) * 4) = local_1c + 1; local_c = in_ECX[7]; iVar12 = in_ECX[9]; local_2c[2] = local_2c[2] + 1; } while (local_2c[2] < 1 << ((char)iVar12 - *(char *)(local_c + local_1c) & 0x1fU)); iVar7 = local_14; } } cVar11 = (char)iVar12; local_1c = local_1c + 1; } while (local_1c < iVar7); } local_2c[2] = 0; iVar15 = 0; local_1c = 0; if (0 < iVar4) { do { uVar5 = local_1c << (0x20U - (char)in_ECX[9] & 0x1f); uVar8 = uVar5 << 0x10 | uVar5 >> 0x10; uVar8 = (uVar8 >> 8 ^ uVar8 << 8) & 0xff00ff ^ uVar8 << 8; uVar8 = (uVar8 >> 4 ^ uVar8 << 4) & 0xf0f0f0f ^ uVar8 << 4; uVar8 = (uVar8 >> 2 ^ uVar8 * 4) & 0x33333333 ^ uVar8 * 4; uVar8 = (uVar8 >> 1 ^ uVar8 * 2) & 0x55555555 ^ uVar8 * 2; if (*(int *)(in_ECX[8] + uVar8 * 4) == 0) { iVar9 = local_2c[2] + 1; if (iVar9 < iVar7) { puVar1 = (uint *)(in_ECX[5] + local_2c[2] * 4); do { puVar1 = puVar1 + 1; if (uVar5 < *puVar1) break; iVar9 = iVar9 + 1; local_2c[2] = local_2c[2] + 1; } while (iVar9 < iVar7); } if (iVar15 < iVar7) { puVar1 = (uint *)(in_ECX[5] + iVar15 * 4); do { if (uVar5 < (*puVar1 & -2 << (0x1fU - cVar11 & 0x1f))) break; iVar15 = iVar15 + 1; puVar1 = puVar1 + 1; } while (iVar15 < iVar7); } uVar10 = iVar7 - iVar15; uVar5 = local_2c[2]; if (0x7fff < (uint)local_2c[2]) { uVar5 = 0x7fff; } if (0x7fff < uVar10) { uVar10 = 0x7fff; } *(uint *)(in_ECX[8] + uVar8 * 4) = (uVar5 | 0xffff0000) << 0xf | uVar10; } local_1c = local_1c + 1; } while (local_1c < iVar4); } } return 0; } //@@ 00ab8b30 seed_chase /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis psy.c seed_chase(seeds ECX, linesper EDX, n): alloca posstack/ampstack peak-chasing; caller _vp_tonemask (max_seeds inlined) */ void seed_chase(float param_1) { int iVar1; float fVar2; int iVar3; int iVar4; int in_ECX; int iVar5; int in_EDX; float *pfVar6; float fVar7; int iVar8; float afStack_34 [2]; int local_18; float *local_8; afStack_34[1] = 1.5753846e-38; afStack_34[1 - (int)param_1] = 1.5753863e-38; iVar3 = (int)param_1 * -8 + -0x2c; iVar5 = 0; fVar7 = 0.0; local_18 = 0; if (0 < (int)param_1) { do { local_8 = afStack_34 + (2 - (int)param_1); if ((1 < iVar5) && (fVar2 = *(float *)(in_ECX + (int)fVar7 * 4), afStack_34[(int)param_1 * -2 + iVar5 + 1] <= fVar2)) { pfVar6 = afStack_34 + (iVar5 - (int)param_1); do { if (((((int)afStack_34[(iVar5 + 1) - (int)param_1] + in_EDX <= (int)fVar7) || (iVar5 < 2)) || (*(float *)((int)afStack_34 + (iVar3 - (int)local_8) + 0x34 + (int)pfVar6) < afStack_34[(int)param_1 * -2 + iVar5 + 1])) || ((int)*pfVar6 + in_EDX <= (int)fVar7)) break; iVar8 = (int)param_1 * -2 + iVar5; iVar5 = iVar5 + -1; pfVar6 = pfVar6 + -1; } while (afStack_34[iVar8] <= fVar2); } afStack_34[(iVar5 + 2) - (int)param_1] = fVar7; iVar8 = (int)fVar7 * 4; fVar7 = (float)((int)fVar7 + 1); afStack_34[(int)param_1 * -2 + iVar5 + 2] = *(float *)(in_ECX + iVar8); iVar5 = iVar5 + 1; } while ((int)fVar7 < (int)param_1); local_18 = iVar5; } iVar5 = 0; iVar8 = 0; if (0 < local_18) { local_8 = afStack_34 + (3 - (int)param_1); do { if ((local_18 + -1 <= iVar8) || (fVar7 = *(float *)((int)local_8 + (int)afStack_34 + (iVar3 - (int)(afStack_34 + (2 - (int)param_1))) + 0x34), fVar7 < afStack_34[(int)param_1 * -2 + iVar8 + 2] || fVar7 == afStack_34[(int)param_1 * -2 + iVar8 + 2])) { fVar7 = (float)(in_EDX + 1 + (int)local_8[-1]); } else { fVar7 = *local_8; } if ((int)param_1 < (int)fVar7) { fVar7 = param_1; } if (iVar5 < (int)fVar7) { if (3 < (int)fVar7 - iVar5) { iVar4 = (((int)fVar7 - iVar5) - 4U >> 2) + 1; iVar1 = iVar5 * 4; iVar5 = iVar5 + iVar4 * 4; pfVar6 = (float *)(in_ECX + 8 + iVar1); do { pfVar6[-2] = afStack_34[(int)param_1 * -2 + iVar8 + 2]; pfVar6[-1] = afStack_34[(int)param_1 * -2 + iVar8 + 2]; *pfVar6 = afStack_34[(int)param_1 * -2 + iVar8 + 2]; pfVar6[1] = afStack_34[(int)param_1 * -2 + iVar8 + 2]; iVar4 = iVar4 + -1; pfVar6 = pfVar6 + 4; } while (iVar4 != 0); if ((int)fVar7 <= iVar5) goto LAB_00ab8ca1; } do { *(float *)(in_ECX + iVar5 * 4) = afStack_34[(int)param_1 * -2 + iVar8 + 2]; iVar5 = iVar5 + 1; } while (iVar5 < (int)fVar7); } LAB_00ab8ca1: iVar8 = iVar8 + 1; local_8 = local_8 + 1; } while (iVar8 < local_18); } return; } //@@ 00ab8cc0 bark_noise_hybridmp /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis psy.c: only caller _vp_noisemask; alloca'd work arrays, (n, b, f, noise, offset, fixed) running sums */ void bark_noise_hybridmp(float *param_1,int param_2,float param_3,uint param_4) { float *pfVar1; undefined4 *puVar2; float *pfVar3; undefined4 *puVar4; int iVar5; uint uVar6; float *pfVar7; uint uVar8; int iVar9; int in_ECX; int iVar10; uint *in_EDX; int iVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; float fVar19; undefined4 uStack_60; float local_34; int local_30; float local_2c; float local_24; iVar5 = in_ECX * -4; (&uStack_60)[-in_ECX] = 0xab8ceb; pfVar1 = (float *)((int)register0x00000010 + in_ECX * -8 + -0x5c); (&uStack_60)[in_ECX * -2] = 0xab8cf5; puVar2 = (undefined4 *)((int)register0x00000010 + in_ECX * -0xc + -0x5c); (&uStack_60)[in_ECX * -3] = 0xab8cff; pfVar3 = (float *)((int)register0x00000010 + in_ECX * -0x10 + -0x5c); (&uStack_60)[in_ECX * -4] = 0xab8d09; puVar4 = (undefined4 *)((int)register0x00000010 + in_ECX * -0x14 + -0x5c); local_34 = 0.0; local_2c = 0.0; local_24 = 0.0; fVar12 = 1.0; if (1.0 <= param_3 + *param_1) { fVar12 = param_3 + *param_1; } fVar17 = fVar12 * fVar12 * 0.5; fVar18 = fVar17 + 0.0; fVar12 = fVar17 * fVar12 + 0.0; *(float *)((int)register0x00000010 + iVar5 + -0x5c) = fVar18; *pfVar1 = fVar18; *puVar2 = 0; *pfVar3 = fVar12; *puVar4 = 0; if (1 < in_ECX) { local_30 = in_ECX + -1; fVar19 = 1.0; pfVar7 = (float *)((int)register0x00000010 + iVar5 + -0x58); fVar17 = fVar18; do { fVar14 = param_3 + *(float *)(((int)param_1 - ((int)register0x00000010 + iVar5 + -0x5c)) + (int)pfVar7); fVar16 = 1.0; if (1.0 <= fVar14) { fVar16 = fVar14; } fVar15 = fVar16 * fVar16; fVar13 = fVar19 * fVar15; fVar17 = fVar17 + fVar15; fVar18 = fVar18 + fVar13; fVar14 = fVar13 * fVar19; fVar12 = fVar12 + fVar15 * fVar16; local_2c = fVar13 * fVar16 + local_2c; fVar19 = fVar19 + 1.0; local_24 = fVar14 + local_24; *pfVar7 = fVar17; *(float *)((int)pfVar7 + ((int)pfVar1 - ((int)register0x00000010 + iVar5 + -0x5c))) = fVar18; *(float *)((int)pfVar7 + ((int)puVar2 - ((int)register0x00000010 + iVar5 + -0x5c))) = local_24 ; *(float *)((int)pfVar7 + ((int)pfVar3 - ((int)register0x00000010 + iVar5 + -0x5c))) = fVar12; *(float *)((int)pfVar7 + ((int)puVar4 - ((int)register0x00000010 + iVar5 + -0x5c))) = local_2c ; pfVar7 = pfVar7 + 1; local_30 = local_30 + -1; } while (local_30 != 0); } fVar12 = 0.0; iVar5 = iVar5 + -0x5c; fVar17 = 1.0; fVar19 = 0.0; iVar10 = 0; param_1 = (float *)0x0; uVar8 = *in_EDX; iVar11 = (int)uVar8 >> 0x10; fVar18 = local_34; if (iVar11 < 0) { local_34 = 0.0; do { uVar8 = uVar8 & 0xffff; iVar10 = iVar10 + 1; fVar17 = *(float *)((int)register0x00000010 + uVar8 * 4 + iVar5) + *(float *)((int)register0x00000010 + iVar11 * -4 + iVar5); fVar16 = pfVar1[uVar8] - pfVar1[-iVar11]; fVar12 = ((float)puVar4[uVar8] - (float)puVar4[-iVar11]) * fVar17 - (pfVar3[uVar8] + pfVar3[-iVar11]) * fVar16; fVar18 = (pfVar3[uVar8] + pfVar3[-iVar11]) * ((float)puVar2[uVar8] + (float)puVar2[-iVar11]) - ((float)puVar4[uVar8] - (float)puVar4[-iVar11]) * fVar16; fVar17 = ((float)puVar2[uVar8] + (float)puVar2[-iVar11]) * fVar17 - fVar16 * fVar16; fVar16 = (float)param_1 * fVar12; param_1 = (float *)((float)param_1 + 1.0); fVar14 = (fVar16 + fVar18) / fVar17; fVar16 = 0.0; if (0.0 <= fVar14) { fVar16 = fVar14; } *(float *)((int)local_34 + param_2) = fVar16 - param_3; local_34 = (float)(iVar10 * 4); uVar8 = in_EDX[iVar10]; iVar11 = (int)uVar8 >> 0x10; } while (iVar11 < 0); } uVar8 = in_EDX[iVar10]; while (uVar6 = uVar8 & 0xffff, (int)uVar6 < in_ECX) { iVar11 = (int)uVar8 >> 0x10; fVar17 = *(float *)((int)register0x00000010 + uVar6 * 4 + iVar5) - *(float *)((int)register0x00000010 + iVar11 * 4 + iVar5); fVar16 = pfVar1[uVar6] - pfVar1[iVar11]; fVar12 = ((float)puVar4[uVar6] - (float)puVar4[iVar11]) * fVar17 - (pfVar3[uVar6] - pfVar3[iVar11]) * fVar16; fVar18 = (pfVar3[uVar6] - pfVar3[iVar11]) * ((float)puVar2[uVar6] - (float)puVar2[iVar11]) - ((float)puVar4[uVar6] - (float)puVar4[iVar11]) * fVar16; fVar17 = ((float)puVar2[uVar6] - (float)puVar2[iVar11]) * fVar17 - fVar16 * fVar16; fVar16 = (float)param_1 * fVar12; param_1 = (float *)((float)param_1 + 1.0); fVar14 = (fVar16 + fVar18) / fVar17; fVar16 = 0.0; if (0.0 <= fVar14) { fVar16 = fVar14; } *(float *)(param_2 + iVar10 * 4) = fVar16 - param_3; iVar10 = iVar10 + 1; uVar8 = in_EDX[iVar10]; } for (; iVar10 < in_ECX; iVar10 = iVar10 + 1) { fVar16 = (float)param_1 * fVar12; param_1 = (float *)((float)param_1 + 1.0); fVar14 = (fVar16 + fVar18) / fVar17; fVar16 = 0.0; if (0.0 <= fVar14) { fVar16 = fVar14; } *(float *)(param_2 + iVar10 * 4) = fVar16 - param_3; } if (0 < (int)param_4) { iVar10 = 0; uVar8 = param_4 >> 1; local_34 = (float)(uVar8 - param_4); if ((int)local_34 < 0) { param_1 = (float *)(uVar8 << 2); iVar9 = (int)local_34 * -4; iVar11 = (param_4 - uVar8) * 4; do { fVar16 = *(float *)((int)register0x00000010 + iVar9 + iVar5) + *(float *)((int)register0x00000010 + (int)param_1 + iVar5); fVar14 = *(float *)((int)param_1 + (int)pfVar1) - *(float *)(iVar9 + (int)pfVar1); fVar13 = *(float *)(iVar9 + (int)puVar2) + *(float *)((int)param_1 + (int)puVar2); fVar17 = *(float *)(iVar9 + (int)pfVar3) + *(float *)((int)param_1 + (int)pfVar3); fVar18 = *(float *)((int)param_1 + (int)puVar4) - *(float *)(iVar9 + (int)puVar4); fVar12 = fVar18 * fVar16 - fVar17 * fVar14; fVar18 = fVar17 * fVar13 - fVar18 * fVar14; fVar17 = fVar13 * fVar16 - fVar14 * fVar14; fVar16 = (fVar19 * fVar12 + fVar18) / fVar17 - param_3; if (fVar16 < *(float *)(param_2 + iVar10 * 4)) { *(float *)(param_2 + iVar10 * 4) = fVar16; } iVar9 = iVar11 + -4; param_1 = (float *)((int)param_1 + 4); iVar10 = iVar10 + 1; local_34 = (float)((int)local_34 + 1); fVar19 = fVar19 + 1.0; iVar11 = iVar9; } while ((int)local_34 < 0); } iVar11 = uVar8 + iVar10; if (iVar11 < in_ECX) { do { iVar9 = iVar11 - param_4; fVar17 = *(float *)((int)register0x00000010 + iVar11 * 4 + iVar5) - *(float *)((int)register0x00000010 + iVar9 * 4 + iVar5); fVar16 = pfVar1[iVar11] - pfVar1[iVar9]; fVar12 = ((float)puVar4[iVar11] - (float)puVar4[iVar9]) * fVar17 - (pfVar3[iVar11] - pfVar3[iVar9]) * fVar16; fVar18 = (pfVar3[iVar11] - pfVar3[iVar9]) * ((float)puVar2[iVar11] - (float)puVar2[iVar9]) - ((float)puVar4[iVar11] - (float)puVar4[iVar9]) * fVar16; fVar17 = ((float)puVar2[iVar11] - (float)puVar2[iVar9]) * fVar17 - fVar16 * fVar16; fVar16 = (fVar19 * fVar12 + fVar18) / fVar17 - param_3; if (fVar16 < *(float *)(param_2 + iVar10 * 4)) { *(float *)(param_2 + iVar10 * 4) = fVar16; } iVar11 = iVar11 + 1; iVar10 = iVar10 + 1; fVar19 = fVar19 + 1.0; } while (iVar11 < in_ECX); } for (; iVar10 < in_ECX; iVar10 = iVar10 + 1) { fVar16 = (fVar19 * fVar12 + fVar18) / fVar17 - param_3; if (fVar16 < *(float *)(param_2 + iVar10 * 4)) { *(float *)(param_2 + iVar10 * 4) = fVar16; } fVar19 = fVar19 + 1.0; } } return; } //@@ 00ab9270 _vp_noisemask /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis psy.c: alloca n-float work, bark_noise_hybridmp(n, p->bark, logmdct, logmask, 140., -1) (FUN_00ab8cc0 with 140.0 and -1 pushed), subtracts, second hybridmp pass and noise offset/compand table lookup; called by the encoder mapping (named mapping0_inverse) */ void _vp_noisemask(float *param_1) { float *pfVar1; float *pfVar2; float fVar3; int iVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; uint uVar15; float *pfVar16; float *pfVar17; uint *in_ECX; int iVar18; int iVar19; float *in_EDX; uint uVar20; float afStack_40 [4]; float local_24 [5]; float local_10 [3]; uVar20 = *in_ECX; afStack_40[3] = 1.5756448e-38; iVar4 = uVar20 * -4; afStack_40[3 - uVar20] = -NAN; afStack_40[2 - uVar20] = (float)in_ECX; afStack_40[2 - uVar20] = 140.0; afStack_40[1 - uVar20] = (float)param_1; afStack_40[-uVar20] = (float)in_EDX; afStack_40[-1 - uVar20] = 1.5756491e-38; bark_noise_hybridmp(); iVar18 = 0; if (0 < (int)uVar20) { if (((0xf < uVar20) && ((param_1 + (uVar20 - 1) < afStack_40 + (4 - uVar20) || (afStack_40 + 3 < param_1)))) && ((in_EDX + (uVar20 - 1) < afStack_40 + (4 - uVar20) || (afStack_40 + 3 < in_EDX)))) { uVar15 = uVar20 & 0x8000000f; if ((int)uVar15 < 0) { uVar15 = (uVar15 - 1 | 0xfffffff0) + 1; } pfVar16 = param_1 + 4; pfVar17 = local_10 + -uVar20; do { fVar3 = pfVar16[-3]; fVar5 = pfVar16[-2]; fVar6 = pfVar16[-1]; pfVar1 = in_EDX + iVar18; fVar7 = pfVar1[1]; fVar8 = pfVar1[2]; fVar9 = pfVar1[3]; fVar10 = *pfVar16; fVar11 = pfVar16[1]; fVar12 = pfVar16[2]; fVar13 = pfVar16[3]; pfVar17[-8] = *pfVar1 - pfVar16[-4]; pfVar17[-7] = fVar7 - fVar3; pfVar17[-6] = fVar8 - fVar5; pfVar17[-5] = fVar9 - fVar6; pfVar1 = (float *)(((int)in_EDX - (int)param_1) + (int)pfVar16); fVar3 = pfVar1[1]; fVar5 = pfVar1[2]; fVar6 = pfVar1[3]; fVar7 = pfVar16[4]; fVar8 = pfVar16[5]; fVar9 = pfVar16[6]; fVar14 = pfVar16[7]; pfVar2 = (float *)((int)afStack_40 + (iVar4 - (int)param_1) + 0x10 + (int)pfVar16); *pfVar2 = *pfVar1 - fVar10; pfVar2[1] = fVar3 - fVar11; pfVar2[2] = fVar5 - fVar12; pfVar2[3] = fVar6 - fVar13; pfVar1 = (float *)(((int)in_EDX - (int)(afStack_40 + (4 - uVar20))) + (int)pfVar17); fVar3 = pfVar1[1]; fVar5 = pfVar1[2]; fVar6 = pfVar1[3]; fVar10 = pfVar16[8]; fVar11 = pfVar16[9]; fVar12 = pfVar16[10]; fVar13 = pfVar16[0xb]; pfVar16 = pfVar16 + 0x10; *pfVar17 = *pfVar1 - fVar7; pfVar17[1] = fVar3 - fVar8; pfVar17[2] = fVar5 - fVar9; pfVar17[3] = fVar6 - fVar14; pfVar1 = in_EDX + iVar18 + 0xc; fVar3 = pfVar1[1]; fVar5 = pfVar1[2]; fVar6 = pfVar1[3]; iVar18 = iVar18 + 0x10; pfVar17[4] = *pfVar1 - fVar10; pfVar17[5] = fVar3 - fVar11; pfVar17[6] = fVar5 - fVar12; pfVar17[7] = fVar6 - fVar13; pfVar17 = pfVar17 + 0x10; } while (iVar18 < (int)(uVar20 - uVar15)); if ((int)uVar20 <= iVar18) goto LAB_00ab947c; } if (3 < (int)(uVar20 - iVar18)) { pfVar16 = local_24 + ((iVar18 + -1) - uVar20); pfVar17 = param_1 + iVar18 + 1; do { pfVar16[-2] = in_EDX[iVar18] - pfVar17[-1]; *(float *)((int)pfVar17 + (int)afStack_40 + (iVar4 - (int)param_1) + 0x10) = *(float *)((int)pfVar17 + ((int)in_EDX - (int)param_1)) - *pfVar17; *pfVar16 = *(float *)((int)pfVar16 + ((int)in_EDX - (int)(afStack_40 + (4 - uVar20)))) - pfVar17[1]; iVar19 = iVar18 + 3; iVar18 = iVar18 + 4; pfVar1 = pfVar17 + 2; pfVar17 = pfVar17 + 4; pfVar16[1] = in_EDX[iVar19] - *pfVar1; pfVar16 = pfVar16 + 4; } while (iVar18 < (int)(uVar20 - 3)); if ((int)uVar20 <= iVar18) goto LAB_00ab947c; } pfVar16 = param_1 + iVar18; iVar18 = uVar20 - iVar18; do { *(float *)((int)pfVar16 + (int)afStack_40 + (iVar4 - (int)param_1) + 0x10) = *(float *)((int)pfVar16 + ((int)in_EDX - (int)param_1)) - *pfVar16; pfVar16 = pfVar16 + 1; iVar18 = iVar18 + -1; } while (iVar18 != 0); } LAB_00ab947c: afStack_40[3 - uVar20] = (float)*(undefined4 *)(in_ECX[1] + 0x80); afStack_40[2 - uVar20] = (float)in_ECX; afStack_40[2 - uVar20] = 0.0; afStack_40[1 - uVar20] = (float)param_1; afStack_40[-uVar20] = (float)(afStack_40 + (4 - uVar20)); afStack_40[-1 - uVar20] = 1.5757181e-38; bark_noise_hybridmp(); iVar18 = 0; if ((int)uVar20 < 1) { return; } if ((0xf < uVar20) && ((in_EDX + (uVar20 - 1) < afStack_40 + (4 - uVar20) || (afStack_40 + 3 < in_EDX)))) { uVar15 = uVar20 & 0x8000000f; if ((int)uVar15 < 0) { uVar15 = (uVar15 - 1 | 0xfffffff0) + 1; } pfVar16 = local_24 + (1 - uVar20); pfVar17 = in_EDX + 0xc; do { iVar18 = iVar18 + 0x10; fVar3 = pfVar17[-0xb]; fVar5 = pfVar17[-10]; fVar6 = pfVar17[-9]; pfVar16[-4] = pfVar17[-0xc] - pfVar16[-4]; pfVar16[-3] = fVar3 - pfVar16[-3]; pfVar16[-2] = fVar5 - pfVar16[-2]; pfVar16[-1] = fVar6 - pfVar16[-1]; pfVar1 = (float *)((int)pfVar16 + ((int)in_EDX - (int)(afStack_40 + (4 - uVar20)))); fVar3 = pfVar1[1]; fVar5 = pfVar1[2]; fVar6 = pfVar1[3]; *pfVar16 = *pfVar1 - *pfVar16; pfVar16[1] = fVar3 - pfVar16[1]; pfVar16[2] = fVar5 - pfVar16[2]; pfVar16[3] = fVar6 - pfVar16[3]; fVar3 = pfVar17[-3]; fVar5 = pfVar17[-2]; fVar6 = pfVar17[-1]; pfVar16[4] = pfVar17[-4] - pfVar16[4]; pfVar16[5] = fVar3 - pfVar16[5]; pfVar16[6] = fVar5 - pfVar16[6]; pfVar16[7] = fVar6 - pfVar16[7]; fVar3 = *pfVar17; fVar5 = pfVar17[1]; fVar6 = pfVar17[2]; fVar7 = pfVar17[3]; pfVar17 = pfVar17 + 0x10; pfVar16[8] = fVar3 - pfVar16[8]; pfVar16[9] = fVar5 - pfVar16[9]; pfVar16[10] = fVar6 - pfVar16[10]; pfVar16[0xb] = fVar7 - pfVar16[0xb]; pfVar16 = pfVar16 + 0x10; } while (iVar18 < (int)(uVar20 - uVar15)); if ((int)uVar20 <= iVar18) goto LAB_00ab9605; } if (3 < (int)(uVar20 - iVar18)) { pfVar16 = in_EDX + iVar18 + 3; pfVar17 = afStack_40 + ((iVar18 + 5) - uVar20); local_10[0] = (float)(((uVar20 - iVar18) - 4 >> 2) + 1); iVar18 = iVar18 + (int)local_10[0] * 4; do { pfVar17[-1] = pfVar16[-3] - pfVar17[-1]; *pfVar17 = *(float *)((int)pfVar17 + ((int)in_EDX - (int)(afStack_40 + (4 - uVar20)))) - *pfVar17; pfVar17[1] = pfVar16[-1] - pfVar17[1]; fVar3 = *pfVar16; pfVar16 = pfVar16 + 4; pfVar17[2] = fVar3 - pfVar17[2]; pfVar17 = pfVar17 + 4; local_10[0] = (float)((int)local_10[0] + -1); } while (local_10[0] != 0.0); if ((int)uVar20 <= iVar18) goto LAB_00ab9605; } pfVar16 = afStack_40 + ((iVar18 + 4) - uVar20); iVar18 = uVar20 - iVar18; do { *pfVar16 = *(float *)((int)pfVar16 + ((int)in_EDX - (int)(afStack_40 + (4 - uVar20)))) - *pfVar16; pfVar16 = pfVar16 + 1; iVar18 = iVar18 + -1; } while (iVar18 != 0); LAB_00ab9605: iVar4 = iVar4 - (int)param_1; do { iVar18 = (int)(*param_1 + 0.5); if (0x27 < iVar18) { iVar18 = 0x27; } iVar19 = 0; if (-1 < iVar18) { iVar19 = iVar18; } *param_1 = *(float *)(in_ECX[1] + 0x150 + iVar19 * 4) + *(float *)((int)afStack_40 + iVar4 + 0x10 + (int)param_1); param_1 = param_1 + 1; uVar20 = uVar20 - 1; } while (uVar20 != 0); return; } //@@ 00ab9660 _vp_tonemask /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis psy.c: seeds total_octave_lines (in_ECX[10]) entries with -9999 (NEGINF), att = local_specmax + vi->ath_adjatt (+4) clamped to ath_maxatt (+8), applies ATH and seed_loop/max_seeds over the n (in_ECX[0]) lines; called by the encoder mapping (named mapping0_inverse) */ void _vp_tonemask(uint *param_1,float param_2) { float *pfVar1; float fVar2; uint uVar3; uint *puVar4; uint uVar5; uint uVar6; uint uVar7; int iVar8; int iVar9; uint *in_ECX; int iVar10; float *pfVar11; uint uVar12; int in_EDX; int iVar13; float fVar14; float fVar15; float in_XMM3_Da; float fVar16; float afStack_3c [2]; int local_10; uVar3 = in_ECX[10]; uVar12 = *in_ECX; afStack_3c[1] = 1.5757873e-38; uVar7 = in_ECX[1]; iVar10 = 0; param_2 = param_2 + *(float *)(uVar7 + 4); if (0 < (int)uVar3) { do { afStack_3c[(iVar10 + 2) - uVar3] = -9999.0; iVar10 = iVar10 + 1; } while (iVar10 < (int)in_ECX[10]); uVar7 = in_ECX[1]; } iVar10 = 0; fVar15 = *(float *)(uVar7 + 8); if (*(float *)(uVar7 + 8) <= param_2) { fVar15 = param_2; } if (0 < (int)uVar12) { if (0xf < uVar12) { puVar4 = (uint *)in_ECX[4]; if (((puVar4 + (uVar12 - 1) < param_1) || (param_1 + (uVar12 - 1) < puVar4)) && ((in_ECX + 4 < param_1 || (param_1 + (uVar12 - 1) < in_ECX + 4)))) { uVar7 = uVar12 & 0x8000000f; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffff0) + 1; } iVar13 = 0x20; pfVar11 = (float *)(param_1 + 8); do { iVar10 = iVar10 + 0x10; pfVar1 = (float *)((-0x20 - (int)param_1) + (int)pfVar11 + (int)puVar4); fVar16 = pfVar1[1]; fVar2 = pfVar1[2]; fVar14 = pfVar1[3]; pfVar11[-8] = *pfVar1 + fVar15; pfVar11[-7] = fVar16 + fVar15; pfVar11[-6] = fVar2 + fVar15; pfVar11[-5] = fVar14 + fVar15; pfVar1 = (float *)((-0x10 - (int)param_1) + (int)pfVar11 + (int)puVar4); fVar16 = pfVar1[1]; fVar2 = pfVar1[2]; fVar14 = pfVar1[3]; pfVar11[-4] = *pfVar1 + fVar15; pfVar11[-3] = fVar16 + fVar15; pfVar11[-2] = fVar2 + fVar15; pfVar11[-1] = fVar14 + fVar15; pfVar1 = (float *)(iVar13 + (int)puVar4); fVar16 = pfVar1[1]; fVar2 = pfVar1[2]; fVar14 = pfVar1[3]; iVar13 = iVar13 + 0x40; *pfVar11 = *pfVar1 + fVar15; pfVar11[1] = fVar16 + fVar15; pfVar11[2] = fVar2 + fVar15; pfVar11[3] = fVar14 + fVar15; pfVar1 = (float *)((0x10 - (int)param_1) + (int)pfVar11 + (int)puVar4); fVar16 = pfVar1[1]; fVar2 = pfVar1[2]; fVar14 = pfVar1[3]; pfVar11[4] = *pfVar1 + fVar15; pfVar11[5] = fVar16 + fVar15; pfVar11[6] = fVar2 + fVar15; pfVar11[7] = fVar14 + fVar15; pfVar11 = pfVar11 + 0x10; } while (iVar10 < (int)(uVar12 - uVar7)); } } if (iVar10 < (int)uVar12) { if (3 < (int)(uVar12 - iVar10)) { iVar13 = iVar10 * 4 + 8; pfVar11 = (float *)(param_1 + iVar10 + 2); iVar8 = ((uVar12 - iVar10) - 4 >> 2) + 1; iVar10 = iVar10 + iVar8 * 4; do { pfVar11[-2] = fVar15 + *(float *)((int)pfVar11 + in_ECX[4] + -(int)param_1 + -8); pfVar11[-1] = fVar15 + *(float *)((int)pfVar11 + in_ECX[4] + -(int)param_1 + -4); pfVar1 = (float *)(iVar13 + in_ECX[4]); iVar13 = iVar13 + 0x10; *pfVar11 = fVar15 + *pfVar1; pfVar11[1] = fVar15 + *(float *)((int)pfVar11 + in_ECX[4] + (4 - (int)param_1)); pfVar11 = pfVar11 + 4; iVar8 = iVar8 + -1; } while (iVar8 != 0); if ((int)uVar12 <= iVar10) goto LAB_00ab9867; } do { param_1[iVar10] = (uint)(fVar15 + *(float *)(in_ECX[4] + iVar10 * 4)); iVar10 = iVar10 + 1; } while (iVar10 < (int)uVar12); } } LAB_00ab9867: uVar12 = in_ECX[2]; iVar10 = 0; uVar7 = *in_ECX; fVar15 = *(float *)(in_ECX[1] + 0x1f0); if (0 < (int)uVar7) { do { fVar16 = *(float *)(in_EDX + iVar10 * 4); iVar13 = *(int *)(in_ECX[5] + iVar10 * 4); iVar8 = iVar10 + 1; if (iVar10 + 1 < (int)uVar7) { do { iVar9 = iVar8; if (*(int *)(in_ECX[5] + 4 + iVar10 * 4) != iVar13) break; fVar2 = *(float *)(in_EDX + iVar9 * 4); if (fVar2 <= fVar16) { fVar2 = fVar16; } fVar16 = fVar2; iVar8 = iVar9 + 1; iVar10 = iVar9; } while (iVar9 + 1 < (int)uVar7); } if ((float)param_1[iVar10] <= fVar16 + 6.0 && fVar16 + 6.0 != (float)param_1[iVar10]) { iVar13 = iVar13 >> ((byte)in_ECX[8] & 0x1f); if (0x10 < iVar13) { iVar13 = 0x10; } uVar5 = in_ECX[10]; uVar6 = in_ECX[9]; iVar9 = (int)(((fVar16 + (fVar15 - in_XMM3_Da)) - 30.0) * 0.1); iVar8 = 0; if (0 < iVar9) { iVar8 = iVar9; } iVar9 = 0; if (-1 < iVar13) { iVar9 = iVar13; } iVar13 = 7; if (iVar8 < 7) { iVar13 = iVar8; } pfVar11 = *(float **)(*(int *)(uVar12 + iVar9 * 4) + iVar13 * 4); fVar2 = pfVar11[1]; iVar8 = (int)(((float)(int)(*(int *)(in_ECX[5] + iVar10 * 4) - in_ECX[7]) + (*pfVar11 - 16.0) * (float)(int)uVar6) - (float)((int)uVar6 >> 1)); for (iVar13 = (int)*pfVar11; iVar13 < (int)fVar2; iVar13 = iVar13 + 1) { if ((0 < iVar8) && (fVar14 = fVar16 + pfVar11[iVar13 + 2], afStack_3c[(iVar8 + 2) - uVar3] <= fVar14 && fVar14 != afStack_3c[(iVar8 + 2) - uVar3]) ) { afStack_3c[(iVar8 + 2) - uVar3] = fVar14; } iVar8 = iVar8 + uVar6; if ((int)uVar5 <= iVar8) break; } } iVar10 = iVar10 + 1; } while (iVar10 < (int)uVar7); } uVar12 = in_ECX[9]; iVar10 = 0; afStack_3c[1 - uVar3] = (float)in_ECX[10]; afStack_3c[-uVar3] = 1.575909e-38; seed_chase(); uVar7 = *in_ECX; local_10 = (*(int *)in_ECX[5] - ((int)uVar12 >> 1)) - in_ECX[7]; if (1 < (int)uVar7) { uVar12 = uVar7; do { iVar13 = (*(int *)(in_ECX[5] + 4 + iVar10 * 4) + *(int *)(in_ECX[5] + iVar10 * 4) >> 1) - in_ECX[7]; fVar15 = *(float *)(in_ECX[1] + 0x20); if (afStack_3c[(local_10 + 2) - uVar3] <= *(float *)(in_ECX[1] + 0x20)) { fVar15 = afStack_3c[(local_10 + 2) - uVar3]; } if (local_10 < iVar13) { iVar8 = local_10 + 1; do { fVar16 = afStack_3c[(local_10 + 3) - uVar3]; local_10 = local_10 + 1; iVar8 = iVar8 + 1; if (((-9999.0 < fVar16) && (fVar16 < fVar15)) || (fVar15 == -9999.0)) { fVar15 = fVar16; } } while (iVar8 <= iVar13); uVar7 = uVar12; } uVar5 = in_ECX[7]; if (iVar10 < (int)uVar7) { do { if ((int)(uVar5 + local_10) < *(int *)(in_ECX[5] + iVar10 * 4)) break; if ((float)param_1[iVar10] <= fVar15 && fVar15 != (float)param_1[iVar10]) { param_1[iVar10] = (uint)fVar15; } uVar7 = *in_ECX; iVar10 = iVar10 + 1; uVar12 = uVar7; } while (iVar10 < (int)uVar7); } } while (iVar10 + 1 < (int)uVar7); } fVar15 = afStack_3c[(in_ECX[10] + 1) - uVar3]; if (iVar10 < (int)uVar7) { do { if ((float)param_1[iVar10] <= fVar15 && fVar15 != (float)param_1[iVar10]) { param_1[iVar10] = (uint)fVar15; } iVar10 = iVar10 + 1; } while (iVar10 < (int)*in_ECX); } return; } //@@ 00ab9af0 _vp_offset_and_mix /* DB: libvorbis psy.c: for i < n: val = noise[i] + p->noiseoffset[offset_select][i] clamped to vi->noisemaxsupp (+0x6c), logmask = max(val, tone[i]+toneatt); when offset_select == 1 applies the -17.2 de-emphasis (0.005 / 0.0003 * cx, floor 0.0001) to mdct[i]; called by the encoder mapping (named mapping0_inverse) */ void _vp_offset_and_mix(float *param_1,int param_2,int param_3,int param_4,int param_5) { float fVar1; float fVar2; int iVar3; int *in_ECX; int in_EDX; int iVar4; int iVar5; float fVar6; float fVar7; float fVar8; iVar5 = 0; iVar3 = *in_ECX; fVar1 = (float)in_ECX[0xc]; fVar2 = *(float *)(in_ECX[1] + 0xc + param_2 * 4); if (0 < iVar3) { iVar4 = in_EDX - (int)param_1; param_3 = param_3 - (int)param_1; param_5 = param_5 - (int)param_1; param_4 = param_4 - (int)param_1; do { fVar7 = fVar2 + *param_1; fVar6 = *(float *)(*(int *)(in_ECX[3] + param_2 * 4) + iVar5 * 4) + *(float *)(iVar4 + (int)param_1); fVar8 = *(float *)(in_ECX[1] + 0x6c); if (fVar6 <= *(float *)(in_ECX[1] + 0x6c)) { fVar8 = fVar6; } fVar6 = fVar8; if (fVar8 <= fVar7) { fVar6 = fVar7; } *(float *)(param_3 + (int)param_1) = fVar6; if (param_2 == 1) { fVar8 = fVar8 - *(float *)(param_5 + (int)param_1); fVar6 = fVar8 - -17.2; if (fVar8 <= -17.2) { fVar8 = 1.0 - fVar6 * 0.0003 * fVar1; } else { fVar8 = 1.0 - fVar6 * 0.005 * fVar1; if (fVar8 < 0.0) { fVar8 = 0.0001; } } *(float *)(param_4 + (int)param_1) = fVar8 * *(float *)(param_4 + (int)param_1); } iVar5 = iVar5 + 1; param_1 = param_1 + 1; } while (iVar5 < iVar3); } return; } //@@ 00ab9c10 FUN_00ab9c10 int FUN_00ab9c10(undefined4 *param_1,undefined4 *param_2) { return (uint)(*(float *)*param_1 < *(float *)*param_2) - (uint)(*(float *)*param_2 < *(float *)*param_1); } //@@ 00ab9c40 flag_lossless /* DB: libvorbis psy.c: flag[j] = fabs(mdct[j])/floor[j] >= (j < limit-i ? prepoint : postpoint) for j < n (thresholds in XMM1/XMM2); called from the coupling quantizer 00aba020 theora_oc_dec_frags_recon_mcu_plane void flag_lossless(float *param_1,int param_2,int param_3,int param_4) { int in_ECX; int in_EDX; int iVar1; int iVar2; float in_XMM1_Da; float in_XMM2_Da; float fVar3; iVar1 = 0; if (0 < param_4) { iVar2 = in_EDX - (int)param_1; param_2 = param_2 - (int)param_1; do { if (iVar1 < in_ECX - param_3) { fVar3 = in_XMM1_Da; } else { fVar3 = in_XMM2_Da; } iVar1 = iVar1 + 1; *(uint *)(param_2 + (int)param_1) = (uint)(fVar3 <= ABS(*(float *)(iVar2 + (int)param_1)) / *param_1); param_1 = param_1 + 1; } while (iVar1 < param_4); } return; } //@@ 00ab9cd0 noise_normalize /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis psy.c: uses vi->normal_p (+500) and normal_start (+0x1f8) to limit the start, sqrt(r[j]/f[j]) (libm_sse2_sqrt_precise), rounds and accumulates energy for the normalization partitions, skipping flagged lines (arg4); called from the coupling quantizer named theora_oc_dec_frags_recon_mcu_plane 00aba020 theora_oc_dec_frags_recon_mcu_plane _vp_couple_quantize_normalize) */ void noise_normalize(float *param_1,int param_2,int param_3,int param_4,undefined4 param_5, int param_6,int param_7,int param_8) { int iVar1; int iVar2; int in_ECX; float *pfVar3; int in_EDX; float *pfVar4; int iVar5; int iVar6; undefined4 uVar7; double dVar8; undefined1 auVar9 [16]; float fVar10; double dStack_70; undefined4 uStack_64; int local_2c; float local_18; int local_14; iVar1 = *(int *)(in_ECX + 4); uStack_64 = 0xab9d03; local_14 = 0; if ((*(int *)(iVar1 + 500) == 0) || (iVar5 = *(int *)(iVar1 + 0x1f8) - param_6, param_7 < iVar5)) { iVar5 = param_7; } auVar9 = ZEXT816(0); local_2c = 0; local_18 = 0.0; if (0 < iVar5) { pfVar4 = param_1; iVar6 = iVar5; do { if ((param_4 == 0) || (*(int *)((param_4 - (int)param_1) + (int)pfVar4) == 0)) { dVar8 = (double)(*(float *)((param_2 - (int)param_1) + (int)pfVar4) / *(float *)((param_3 - (int)param_1) + (int)pfVar4)); if (dVar8 < 0.0) { *(undefined4 *)((int)&dStack_70 + (3 - param_7) * 4) = 0xab9db2; libm_sse2_sqrt_precise(); } else { dVar8 = SQRT(dVar8); } if (0.0 < *pfVar4 || *pfVar4 == 0.0) { *(double *)((int)&dStack_70 + (2 - param_7) * 4) = dVar8 + 0.5; *(undefined4 *)((int)&dStack_70 + (1 - param_7) * 4) = 0xab9df7; floor(*(double *)((int)&dStack_70 + (2 - param_7) * 4)); *(undefined4 *)((int)&dStack_70 + (3 - param_7) * 4) = 0xab9dff; iVar2 = thunk_FUN_00af0780(); } else { *(double *)((int)&dStack_70 + (2 - param_7) * 4) = dVar8 + 0.5; *(undefined4 *)((int)&dStack_70 + (1 - param_7) * 4) = 0xab9dd2; dVar8 = floor(*(double *)((int)&dStack_70 + (2 - param_7) * 4)); iVar2 = (int)-dVar8; } *(int *)((param_8 - (int)param_1) + (int)pfVar4) = iVar2; } pfVar4 = pfVar4 + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); auVar9 = ZEXT416(0); local_2c = iVar5; } if (local_2c < param_7) { pfVar4 = param_1 + local_2c; do { if ((param_4 == 0) || (*(int *)((int)pfVar4 + (param_4 - (int)param_1)) == 0)) { pfVar3 = (float *)((param_2 - (int)param_1) + (int)pfVar4); fVar10 = *pfVar3 / *(float *)((int)pfVar4 + (param_3 - (int)param_1)); if ((0.25 <= fVar10) || ((param_4 != 0 && (local_2c < in_EDX - param_6)))) { dVar8 = (double)fVar10; if (dVar8 < 0.0) { *(undefined4 *)((int)&dStack_70 + (3 - param_7) * 4) = 0xab9eca; libm_sse2_sqrt_precise(); } else { dVar8 = SQRT(dVar8); } if (0.0 < *pfVar4 || *pfVar4 == 0.0) { *(double *)((int)&dStack_70 + (2 - param_7) * 4) = dVar8 + 0.5; *(undefined4 *)((int)&dStack_70 + (1 - param_7) * 4) = 0xab9f08; dVar8 = floor(*(double *)((int)&dStack_70 + (2 - param_7) * 4)); } else { *(double *)((int)&dStack_70 + (2 - param_7) * 4) = dVar8 + 0.5; *(undefined4 *)((int)&dStack_70 + (1 - param_7) * 4) = 0xab9eea; dVar8 = floor(*(double *)((int)&dStack_70 + (2 - param_7) * 4)); dVar8 = -dVar8; } iVar5 = (int)dVar8; *(int *)((int)pfVar4 + (param_8 - (int)param_1)) = iVar5; *(float *)((int)pfVar4 + (param_2 - (int)param_1)) = (float)(iVar5 * iVar5) * *(float *)((int)pfVar4 + (param_3 - (int)param_1)); auVar9 = ZEXT416((uint)local_18); } else { auVar9._0_4_ = auVar9._0_4_ + fVar10; *(float **)((int)&dStack_70 + ((local_14 + 4) - param_7) * 4) = pfVar3; local_14 = local_14 + 1; local_18 = auVar9._0_4_; } } local_2c = local_2c + 1; pfVar4 = pfVar4 + 1; } while (local_2c < param_7); if (local_14 != 0) { *(code **)((int)&dStack_70 + (3 - param_7) * 4) = FUN_00ab9c10; *(undefined4 *)((int)&dStack_70 + (2 - param_7) * 4) = 4; *(int *)((int)&dStack_70 + (1 - param_7) * 4) = local_14; *(int *)((int)&dStack_70 + param_7 * -4) = (int)&dStack_70 + (4 - param_7) * 4; *(undefined4 *)((int)&dStack_70 + (-1 - param_7) * 4) = 0xab9f70; qsort(*(void **)((int)&dStack_70 + param_7 * -4), *(size_t *)((int)&dStack_70 + (1 - param_7) * 4), *(size_t *)((int)&dStack_70 + (2 - param_7) * 4), *(_PtFuncCompare **)((int)&dStack_70 + (3 - param_7) * 4)); iVar5 = 0; if (0 < local_14) { do { iVar6 = *(int *)((int)&dStack_70 + ((iVar5 + 4) - param_7) * 4) - param_2 >> 2; if ((double)local_18 < *(double *)(iVar1 + 0x200)) { uVar7 = 0; *(undefined4 *)(param_8 + iVar6 * 4) = 0; } else { local_18 = local_18 - 1.0; *(int *)(param_8 + iVar6 * 4) = (int)(float)((uint)param_1[iVar6] & 0xbf800000 | 0x3f800000); uVar7 = *(undefined4 *)(param_3 + iVar6 * 4); } iVar5 = iVar5 + 1; *(undefined4 *)(param_2 + iVar6 * 4) = uVar7; } while (iVar5 < local_14); return; } } } return; } //@@ 00aba020 theora_oc_dec_frags_recon_mcu_plane /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: ? libtheora decoder internal (region has "Xiph.Org libtheora 1.2.0alpha"); last per-plane call in the frame decoder 0xacebf0, 7 args, per-channel row pointer tables with memcpy, block size 16 default */ void theora_oc_dec_frags_recon_mcu_plane (int *param_1,int param_2,int param_3,int param_4,int param_5,int param_6,int param_7 ) { size_t *psVar1; int iVar2; size_t sVar3; size_t sVar4; size_t sVar5; size_t sVar6; size_t sVar7; size_t sVar8; uint uVar9; size_t *psVar10; size_t *psVar11; int iVar12; int iVar13; int iVar14; int iVar15; int *piVar16; float *pfVar17; int iVar18; uint uVar19; int in_ECX; size_t *psVar20; undefined4 *puVar21; float *extraout_ECX; float *pfVar22; int iVar23; int in_EDX; int iVar24; int iVar25; int iVar26; int iVar27; int iVar28; int iVar29; int iVar30; int iVar31; int iVar32; int iVar33; float fVar34; undefined4 uVar35; float fVar36; size_t sVar37; size_t asStack_f4 [6]; size_t asStack_dc [3]; int local_6c; int local_64; size_t *local_60; int local_58; int local_4c; int *local_44; int local_24; int local_1c; int local_18; iVar27 = *param_1; piVar16 = (int *)param_1[1]; if (piVar16[0x7d] == 0) { local_58 = 0x10; } else { local_58 = piVar16[0x7f]; } iVar2 = *(int *)(in_EDX + 0x84 + (*piVar16 * 0xf + in_ECX) * 4); asStack_dc[2] = 0xaba0c4; asStack_dc[2 - param_7] = 0xaba0ce; psVar10 = asStack_dc + param_7 * -2 + 3; asStack_dc[param_7 * -2 + 2] = 0xaba0d8; psVar11 = asStack_dc + param_7 * -3 + 3; asStack_dc[param_7 * -3 + 2] = 0xaba0e5; iVar12 = param_7 * -0xc + -0xd0; asStack_dc[param_7 * -4 + 2] = 0xaba0f0; iVar13 = *(int *)(param_2 + 0x484) + param_7; asStack_dc[param_7 * -5 + 2] = 0xaba107; iVar28 = local_58 * param_7; asStack_dc[param_7 * -5 + (2 - iVar13)] = 0xaba139; asStack_dc[3 - param_7] = (size_t)(asStack_dc + param_7 * -5 + ((3 - iVar28) - iVar13)); asStack_dc[param_7 * -5 + ((2 - iVar28) - iVar13)] = 0xaba147; *psVar10 = (size_t)(asStack_dc + param_7 * -5 + ((iVar28 * -2 + 3) - iVar13)); asStack_dc[param_7 * -5 + ((iVar28 * -2 + 2) - iVar13)] = 0xaba155; *psVar11 = (size_t)(asStack_dc + param_7 * -5 + ((iVar28 * -3 + 3) - iVar13)); asStack_dc[param_7 * -5 + ((iVar28 * -3 + 2) - iVar13)] = 0xaba160; asStack_dc[param_7 * -4 + 3] = (size_t)(asStack_dc + param_7 * -5 + ((iVar28 * -4 + 3) - iVar13)); if (1 < param_7) { iVar24 = local_58 << 2; iVar29 = param_7 + -1; psVar20 = asStack_dc + param_7 * -2 + 4; do { psVar1 = psVar20 + 1; *(size_t *)((int)asStack_dc + (param_7 * -4 - (int)psVar10) + 8 + (int)psVar1) = asStack_dc[3 - param_7] + iVar24; *psVar20 = *psVar10 + iVar24; *(size_t *)((int)psVar11 + (-4 - (int)psVar10) + (int)psVar1) = *psVar11 + iVar24; *(size_t *)((int)psVar20 + (int)asStack_dc + ((param_7 * -4 + iVar12) - (int)psVar10) + 0xdc) = asStack_dc[param_7 * -4 + 3] + iVar24; iVar24 = iVar24 + local_58 * 4; iVar29 = iVar29 + -1; psVar20 = psVar1; } while (iVar29 != 0); } iVar29 = 0; iVar24 = *(int *)(param_2 + 0x484); if (0 < iVar24 + param_7) { do { asStack_dc[param_7 * -5 + ((iVar29 + 3) - iVar13)] = 0; iVar29 = iVar29 + 1; iVar24 = *(int *)(param_2 + 0x484); } while (iVar29 < iVar24 + param_7); } local_4c = 0; if (0 < iVar27) { local_6c = iVar27; do { asStack_dc[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = param_7 * 4; asStack_dc[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)] = param_5; iVar29 = local_6c; if (local_58 <= local_6c) { iVar29 = local_58; } asStack_dc[param_7 * -5 + (iVar28 * -4 - iVar13)] = (size_t)(asStack_dc + param_7 * -5 + 3); asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = 0xaba26a; memcpy((void *)asStack_dc[param_7 * -5 + (iVar28 * -4 - iVar13)], (void *)asStack_dc[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)], asStack_dc[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)]); asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = iVar28 * 4; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 4) - iVar13)] = 0; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 3) - iVar13)] = asStack_dc[param_7 * -4 + 3]; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = 0xaba278; memset((void *)asStack_f4[param_7 * -5 + ((iVar28 * -4 + 3) - iVar13)], asStack_f4[param_7 * -5 + ((iVar28 * -4 + 4) - iVar13)], asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)]); iVar14 = 0; if (0 < param_7) { iVar24 = (int)asStack_dc + (param_7 * -4 - (int)psVar11) + 0xc; iVar14 = (int)psVar10 - (int)psVar11; iVar23 = (int)asStack_dc + ((param_7 * -4 + iVar12) - (int)psVar11) + 0xdc; iVar15 = (int)asStack_dc + ((iVar13 * -4 + param_7 * -8 + iVar12) - (int)psVar11) + 0xdc; local_24 = param_7; psVar20 = psVar11; do { piVar16 = (int *)((int)psVar20 + (int)asStack_dc + (param_3 - (int)psVar11) + ((param_7 * -8 + iVar12) - param_3) + 0xdc); iVar25 = *(int *)((int)piVar16 + (param_4 - (int)(asStack_dc + param_7 * -5 + 3))) + local_4c * 4; if (*piVar16 == 0) { iVar30 = 0; if (0 < iVar29) { do { *(undefined4 *)(*psVar20 + iVar30 * 4) = 0x2edbe6ff; *(undefined4 *)(*(int *)(iVar24 + (int)psVar20) + iVar30 * 4) = 0; *(undefined4 *)(*(int *)(iVar14 + (int)psVar20) + iVar30 * 4) = 0; *(undefined4 *)(*(int *)(iVar23 + (int)psVar20) + iVar30 * 4) = 0; *(undefined4 *)(iVar25 + iVar30 * 4) = 0; iVar30 = iVar30 + 1; } while (iVar30 < iVar29); } uVar35 = 0; } else { local_18 = 0; if (iVar29 < 4) { if (0 < iVar29) goto LAB_00aba380; } else { sVar37 = *psVar20; iVar30 = (iVar29 - 4U >> 2) + 1; local_18 = iVar30 * 4; puVar21 = (undefined4 *)(sVar37 + 4); piVar16 = (int *)(iVar25 + 0xc); do { puVar21[-1] = *(undefined4 *)(&DAT_00b4ffb0 + piVar16[-3] * 4); *puVar21 = *(undefined4 *) (&DAT_00b4ffb0 + *(int *)((iVar25 - sVar37) + -0x10 + (int)(puVar21 + 4)) * 4); puVar21[1] = *(undefined4 *)(&DAT_00b4ffb0 + piVar16[-1] * 4); puVar21[2] = *(undefined4 *)(&DAT_00b4ffb0 + *piVar16 * 4); iVar30 = iVar30 + -1; puVar21 = puVar21 + 4; piVar16 = piVar16 + 4; } while (iVar30 != 0); if (local_18 < iVar29) { LAB_00aba380: sVar37 = *psVar20; iVar30 = iVar29 - local_18; puVar21 = (undefined4 *)(sVar37 + local_18 * 4); do { *puVar21 = *(undefined4 *) (&DAT_00b4ffb0 + *(int *)((iVar25 - sVar37) + (int)puVar21) * 4); iVar30 = iVar30 + -1; puVar21 = puVar21 + 1; } while (iVar30 != 0); } } asStack_dc[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = iVar29; asStack_dc[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)] = local_4c; asStack_dc[param_7 * -5 + (iVar28 * -4 - iVar13)] = *(undefined4 *)(iVar23 + (int)psVar20); asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = *psVar20; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 4) - iVar13)] = 0xaba3d4; flag_lossless(); pfVar22 = extraout_ECX; if (0 < iVar29) { pfVar22 = *(float **)(iVar24 + (int)psVar20); pfVar17 = (float *)(*(int *)((param_3 - (int)psVar11) + (int)psVar20) + local_4c * 4); iVar31 = *(int *)(iVar14 + (int)psVar20) - (int)pfVar22; iVar26 = *psVar20 - (int)pfVar22; iVar30 = iVar29; do { fVar34 = *pfVar17 * *pfVar17; *pfVar22 = fVar34; *(float *)(iVar31 + (int)pfVar22) = fVar34; if (*pfVar17 <= 0.0 && *pfVar17 != 0.0) { *pfVar22 = *pfVar22 * -1.0; } fVar34 = *(float *)(iVar26 + (int)pfVar22); pfVar17 = pfVar17 + 1; *(float *)(iVar26 + (int)pfVar22) = fVar34 * fVar34; pfVar22 = pfVar22 + 1; iVar30 = iVar30 + -1; } while (iVar30 != 0); } asStack_dc[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = iVar25; asStack_dc[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)] = iVar29; asStack_dc[param_7 * -5 + (iVar28 * -4 - iVar13)] = local_4c; uVar35 = *(undefined4 *)(iVar15 + (int)psVar20); asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = (size_t)pfVar22; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = uVar35; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 4) - iVar13)] = 0; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 3) - iVar13)] = *psVar20; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = *(undefined4 *)(iVar14 + (int)psVar20); asStack_f4[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)] = *(undefined4 *)(iVar24 + (int)psVar20); asStack_f4[param_7 * -5 + (iVar28 * -4 - iVar13)] = 0xaba478; noise_normalize(); } *(undefined4 *)(iVar15 + (int)psVar20) = uVar35; psVar20 = psVar20 + 1; local_24 = local_24 + -1; } while (local_24 != 0); iVar14 = param_7; } local_64 = 0; iVar24 = *(int *)(param_2 + 0x484); if (0 < iVar24) { local_60 = asStack_dc + param_7 * -5 + ((iVar14 + 3) - iVar13); local_44 = (int *)(param_2 + 0x888); do { iVar24 = local_44[-0x100]; iVar14 = *local_44; iVar23 = *(int *)(param_4 + iVar24 * 4) + local_4c * 4; local_1c = *(int *)(param_4 + iVar14 * 4) + local_4c * 4; pfVar22 = (float *)asStack_dc[(iVar24 + 3) - param_7]; sVar37 = asStack_dc[(iVar14 + 3) - param_7]; sVar3 = psVar10[iVar24]; sVar4 = psVar10[iVar14]; sVar5 = psVar11[iVar24]; sVar6 = psVar11[iVar14]; sVar7 = asStack_dc[param_7 * -4 + iVar24 + 3]; sVar8 = asStack_dc[param_7 * -4 + iVar14 + 3]; if ((asStack_dc[param_7 * -5 + iVar24 + 3] != 0) || (asStack_dc[param_7 * -5 + iVar14 + 3] != 0)) { asStack_dc[param_7 * -5 + iVar14 + 3] = 1; asStack_dc[param_7 * -5 + iVar24 + 3] = 1; local_18 = 0; if (0 < iVar29) { iVar18 = sVar3 - (int)pfVar22; local_1c = local_1c - (int)pfVar22; iVar14 = sVar37 - (int)pfVar22; iVar15 = sVar4 - (int)pfVar22; iVar25 = sVar8 - (int)pfVar22; iVar30 = sVar7 - (int)pfVar22; iVar26 = sVar6 - (int)pfVar22; iVar32 = iVar23 - (int)pfVar22; iVar31 = sVar5 - (int)pfVar22; do { if (local_18 < local_6c + (param_6 - iVar27)) { if ((*(int *)((int)pfVar22 + iVar30) == 0) && (*(int *)((int)pfVar22 + iVar25) == 0)) { fVar34 = *pfVar22 + *(float *)((int)pfVar22 + iVar14); if (local_18 < local_6c + (iVar2 - iVar27)) { *pfVar22 = fVar34; *(float *)(iVar18 + (int)pfVar22) = ABS(fVar34); } else { fVar36 = ABS(*pfVar22) + ABS(*(float *)((int)pfVar22 + iVar14)); *(float *)(iVar18 + (int)pfVar22) = fVar36; if (fVar34 < 0.0) { fVar36 = -fVar36; } *pfVar22 = fVar36; } *(undefined4 *)((int)pfVar22 + iVar15) = 0; *(undefined4 *)((int)pfVar22 + iVar14) = 0; *(undefined4 *)((int)pfVar22 + iVar25) = 1; *(undefined4 *)((int)pfVar22 + local_1c) = 0; } else { *pfVar22 = ABS(*(float *)((int)pfVar22 + iVar14)) + ABS(*pfVar22); *(float *)((int)pfVar22 + iVar18) = *(float *)((int)pfVar22 + iVar15) + *(float *)((int)pfVar22 + iVar18); *(undefined4 *)((int)pfVar22 + iVar25) = 1; *(undefined4 *)((int)pfVar22 + iVar30) = 1; uVar19 = *(uint *)((int)pfVar22 + local_1c); uVar9 = *(uint *)((int)pfVar22 + iVar32); if ((int)((uVar19 ^ (int)uVar19 >> 0x1f) - ((int)uVar19 >> 0x1f)) < (int)((uVar9 ^ (int)uVar9 >> 0x1f) - ((int)uVar9 >> 0x1f))) { iVar33 = uVar9 - uVar19; if ((int)uVar9 < 1) { iVar33 = uVar19 - uVar9; } *(int *)((int)pfVar22 + local_1c) = iVar33; uVar19 = *(uint *)((int)pfVar22 + iVar32); } else { iVar33 = uVar9 - uVar19; if ((int)uVar19 < 1) { iVar33 = uVar19 - uVar9; } *(int *)((int)pfVar22 + local_1c) = iVar33; *(uint *)((int)pfVar22 + iVar32) = uVar19; iVar33 = *(int *)((int)pfVar22 + local_1c); } if ((int)(((uVar19 ^ (int)uVar19 >> 0x1f) - ((int)uVar19 >> 0x1f)) * 2) <= iVar33) { *(int *)((int)pfVar22 + local_1c) = -iVar33; *(int *)((int)pfVar22 + iVar32) = -*(int *)((int)pfVar22 + iVar32); } } } local_18 = local_18 + 1; fVar34 = *(float *)((int)pfVar22 + iVar26) + *(float *)((int)pfVar22 + iVar31); *(float *)((int)pfVar22 + iVar26) = fVar34; *(float *)((int)pfVar22 + iVar31) = fVar34; pfVar22 = pfVar22 + 1; } while (local_18 < iVar29); } asStack_dc[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = iVar23; asStack_dc[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)] = iVar29; asStack_dc[param_7 * -5 + (iVar28 * -4 - iVar13)] = local_4c; sVar37 = *local_60; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = local_1c; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 5) - iVar13)] = sVar37; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 4) - iVar13)] = asStack_dc[param_7 * -4 + iVar24 + 3]; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 3) - iVar13)] = psVar11[iVar24]; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 2) - iVar13)] = psVar10[iVar24]; asStack_f4[param_7 * -5 + ((iVar28 * -4 + 1) - iVar13)] = asStack_dc[(iVar24 + 3) - param_7]; asStack_f4[param_7 * -5 + (iVar28 * -4 - iVar13)] = 0xaba7fd; noise_normalize(); *local_60 = sVar37; local_60 = local_60 + 1; } local_64 = local_64 + 1; local_44 = local_44 + 1; iVar24 = *(int *)(param_2 + 0x484); } while (local_64 < iVar24); } local_4c = local_4c + local_58; local_6c = local_6c - local_58; } while (local_4c < iVar27); } iVar27 = 0; if (0 < iVar24) { piVar16 = (int *)(param_2 + 0x888); do { if ((*(int *)(param_5 + piVar16[-0x100] * 4) != 0) || (*(int *)(param_5 + *piVar16 * 4) != 0)) { *(undefined4 *)(param_5 + piVar16[-0x100] * 4) = 1; *(undefined4 *)(param_5 + *piVar16 * 4) = 1; } iVar27 = iVar27 + 1; piVar16 = piVar16 + 1; } while (iVar27 < *(int *)(param_2 + 0x484)); } return; } //@@ 00aba8b0 FUN_00aba8b0 void FUN_00aba8b0(int param_1) { int iVar1; void *_Dst; undefined4 *in_ECX; uint size; uint uStack_88; int local_74 [23]; uint local_18; undefined1 *local_14; void *local_10; undefined1 *puStack_c; int local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b15120; local_10 = ExceptionList; uStack_88 = __security_cookie ^ (uint)(local_74 + 0x1c); local_18 = uStack_88; ExceptionList = &local_10; local_14 = (undefined1 *)&uStack_88; local_74[0] = 0; local_74[1] = 3; local_74[2] = 4; local_74[3] = 4; in_ECX[4] = 0; local_74[4] = 4; local_74[5] = 4; local_74[6] = 3; local_74[7] = 4; in_ECX[5] = param_1; local_74[8] = 4; local_74[9] = 4; local_74[10] = 4; local_74[0xb] = 1; *in_ECX = theoraplayer::VideoFrame::vftable; in_ECX[1] = 0; *(undefined2 *)(in_ECX + 2) = 0; in_ECX[3] = 0; in_ECX[6] = 0; in_ECX[7] = 0; local_74[0xc] = 3; local_74[0xd] = 4; local_74[0xe] = 4; local_74[0xf] = 4; local_74[0x14] = 4; local_74[0x10] = 4; local_74[0x11] = 3; local_74[0x12] = 4; local_74[0x13] = 4; local_74[0x15] = 4; iVar1 = local_74[*(int *)(param_1 + 0x50)]; in_ECX[4] = iVar1; local_8 = 0; size = *(int *)(param_1 + 0x68) * *(int *)(param_1 + 100) * iVar1; _Dst = operator_new_tracked(size); in_ECX[6] = _Dst; memset(_Dst,0,size); FUN_00aba9a3(); return; } //@@ 00aba990 Catch@00aba990 undefined * Catch_00aba990(void) { int unaff_EBP; *(undefined4 *)(*(int *)(unaff_EBP + -0x74) + 0x18) = 0; return &DAT_00aba9a0; } //@@ 00aba9a3 FUN_00aba9a3 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00aba9a3(void) { int unaff_EBP; ExceptionList = *(void **)(unaff_EBP + -0xc); return; } //@@ 00aba9d0 FUN_00aba9d0 void FUN_00aba9d0(byte param_1) { undefined4 *in_ECX; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af12a0; local_10 = ExceptionList; ExceptionList = &local_10; *in_ECX = theoraplayer::VideoFrame::vftable; if ((void *)in_ECX[6] != (void *)0x0) { local_8 = 0; tracked_alloc(1,(void *)in_ECX[6],0); } if ((param_1 & 1) != 0) { operator_delete(in_ECX,0x20); } ExceptionList = local_10; return; } //@@ 00abaa50 FUN_00abaa50 void FUN_00abaa50(undefined4 *param_1) { uint uVar1; size_t _Size; int iVar2; int in_ECX; int iVar3; void *_Src; void *_Dst; int local_8; _Src = (void *)*param_1; if (_Src == (void *)0x0) { param_1[4] = *(undefined4 *)(in_ECX + 0x18); iVar3 = *(int *)(in_ECX + 0x14); iVar2 = *(int *)(iVar3 + 0x60) / 2; if (*(char *)(iVar3 + 0x40) == '\0') { iVar2 = *(int *)(iVar3 + 0x60); } param_1[5] = iVar2; uVar1 = *(uint *)(*(int *)(in_ECX + 0x14) + 0x68); param_1[7] = uVar1; iVar3 = *(int *)(in_ECX + 0x14); if (*(char *)(iVar3 + 0x40) != '\0') { param_1[7] = uVar1 >> 1; iVar3 = *(int *)(in_ECX + 0x14); } param_1[6] = *(undefined4 *)(iVar3 + 100); (**(code **)(&DAT_00b55d38 + *(int *)(*(int *)(in_ECX + 0x14) + 0x50) * 4))(param_1); } else { iVar3 = *(int *)(*(int *)(in_ECX + 0x14) + 0x60); iVar2 = iVar3 / 2; if (*(char *)(*(int *)(in_ECX + 0x14) + 0x40) == '\0') { iVar2 = iVar3; } _Size = iVar2 * *(int *)(in_ECX + 0x10); local_8 = *(int *)(*(int *)(in_ECX + 0x14) + 100); if (_Size == param_1[7]) { memcpy(*(void **)(in_ECX + 0x18),_Src,local_8 * param_1[7]); *(undefined1 *)(in_ECX + 8) = 1; return; } _Dst = *(void **)(in_ECX + 0x18); if (0 < local_8) { do { memcpy(_Dst,_Src,_Size); _Dst = (void *)((int)_Dst + _Size); _Src = (void *)((int)_Src + param_1[7]); local_8 = local_8 + -1; } while (local_8 != 0); *(undefined1 *)(in_ECX + 8) = 1; return; } } *(undefined1 *)(in_ECX + 8) = 1; return; } //@@ 00abab50 FUN_00abab50 undefined4 FUN_00abab50(void) { int *piVar1; int in_ECX; piVar1 = (int *)(*(int *)(*(int *)(in_ECX + 0x40) + 0x68) + 0x50); if ((piVar1 == (int *)0x0) || (*piVar1 == 0)) { return 0; } return 1; } //@@ 00abab70 mdct_init /* DB: libvorbis mdct.c: (lookup in ECX, n in EDX): malloc n/4 bitrev and n+n/4 trig tables, log2n = rint(log(n)/log(2)), sin/cos tables; _vds_shared_init calls it twice (both block sizes) */ void mdct_init(void) { int iVar1; void *pvVar2; void *pvVar3; int iVar4; uint uVar5; uint uVar6; int *in_ECX; int in_EDX; uint uVar7; int iVar8; float *pfVar9; float fVar10; double dVar11; double dVar12; uint local_28; uint local_20; int local_1c; iVar1 = (int)(in_EDX + (in_EDX >> 0x1f & 3U)) >> 2; pvVar2 = malloc(iVar1 * 4); pvVar3 = malloc((iVar1 + in_EDX) * 4); fVar10 = (float)in_EDX; dVar11 = (double)in_EDX; libm_sse2_log_precise(); dVar12 = 2.0; libm_sse2_log_precise(); floor(dVar11 / dVar12 + 0.5); iVar4 = thunk_FUN_00af0780(); *in_ECX = in_EDX; iVar8 = 0; in_ECX[1] = iVar4; in_ECX[2] = (int)pvVar3; in_ECX[3] = (int)pvVar2; if (0 < iVar1) { local_1c = 1; local_28 = 0; pfVar9 = (float *)((int)pvVar3 + (in_EDX >> 1) * 4); do { dVar12 = (double)((float)(int)local_28 * (3.1415927 / fVar10)); dVar11 = dVar12; libm_sse2_cos_precise(); *(float *)((int)pvVar3 + iVar8 * 8) = (float)dVar11; libm_sse2_sin_precise(); *(float *)((int)pvVar3 + iVar8 * 8 + 4) = (float)-dVar12; dVar12 = (double)((float)local_1c * (3.1415927 / (float)(in_EDX * 2))); dVar11 = dVar12; libm_sse2_cos_precise(); *pfVar9 = (float)dVar11; libm_sse2_sin_precise(); local_1c = local_1c + 2; iVar8 = iVar8 + 1; local_28 = local_28 + 4; pfVar9[1] = (float)dVar12; pfVar9 = pfVar9 + 2; } while (iVar8 < iVar1); } iVar1 = (int)(in_EDX + (in_EDX >> 0x1f & 7U)) >> 3; if (0 < iVar1) { iVar8 = 2; pfVar9 = (float *)((int)pvVar3 + in_EDX * 4); local_28 = iVar1; do { dVar12 = (double)((float)iVar8 * (3.1415927 / fVar10)); dVar11 = dVar12; libm_sse2_cos_precise(); *pfVar9 = (float)(dVar11 * 0.5); libm_sse2_sin_precise(); iVar8 = iVar8 + 4; local_28 = local_28 + -1; pfVar9[1] = (float)(-dVar12 * 0.5); pfVar9 = pfVar9 + 2; } while (local_28 != 0); local_20 = 0; uVar5 = 1 << ((char)iVar4 - 2U & 0x1f); do { uVar7 = 0; local_28 = 0; if (uVar5 != 0) { uVar6 = uVar5; do { if ((local_20 & uVar6) != 0) { uVar7 = uVar7 | 1 << (local_28 & 0x1f); } local_28 = local_28 + 1; uVar6 = (int)uVar5 >> ((byte)local_28 & 0x1f); } while (uVar6 != 0); } *(uint *)((int)pvVar2 + local_20 * 8) = (~uVar7 & (1 << ((char)iVar4 - 1U & 0x1f)) - 1U) - 1; *(uint *)((int)pvVar2 + local_20 * 8 + 4) = uVar7; local_20 = local_20 + 1; } while ((int)local_20 < iVar1); } in_ECX[4] = (int)(4.0 / fVar10); return; } //@@ 00abae50 mdct_butterfly_32 /* DB: libvorbis mdct.c: 32-point butterfly with cPI2_8 0.70710677 constants, called twice back to back at the end of mdct_butterflies (DB note on mdct_butterflies already calls it butterfly_32) */ void mdct_butterfly_32(void) { float *in_ECX; float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; fVar3 = *in_ECX - in_ECX[8]; fVar8 = in_ECX[8] + *in_ECX; fVar4 = in_ECX[1] - in_ECX[9]; fVar11 = in_ECX[3] - in_ECX[0xb]; in_ECX[0xb] = in_ECX[0xb] + in_ECX[3]; fVar1 = (fVar3 + fVar4) * 0.70710677; fVar5 = (fVar4 - fVar3) * 0.70710677; fVar6 = in_ECX[10] - in_ECX[2]; in_ECX[9] = in_ECX[9] + in_ECX[1]; in_ECX[10] = in_ECX[2] + in_ECX[10]; fVar3 = in_ECX[0xc] - in_ECX[4]; fVar4 = in_ECX[0xd] - in_ECX[5]; in_ECX[0xc] = in_ECX[4] + in_ECX[0xc]; in_ECX[0xd] = in_ECX[5] + in_ECX[0xd]; fVar10 = (fVar3 - fVar4) * 0.70710677; fVar3 = (fVar4 + fVar3) * 0.70710677; fVar4 = fVar10 + fVar1; fVar9 = in_ECX[0xe] - in_ECX[6]; fVar7 = in_ECX[0xf] - in_ECX[7]; fVar10 = fVar10 - fVar1; in_ECX[0xe] = in_ECX[6] + in_ECX[0xe]; fVar2 = fVar11 + fVar9; fVar9 = fVar9 - fVar11; in_ECX[0xf] = in_ECX[7] + in_ECX[0xf]; fVar1 = fVar3 - fVar5; fVar3 = fVar3 + fVar5; in_ECX[6] = fVar4 + fVar2; in_ECX[4] = fVar2 - fVar4; fVar4 = fVar7 - fVar6; fVar6 = fVar6 + fVar7; *in_ECX = fVar9 + fVar1; in_ECX[2] = fVar9 - fVar1; in_ECX[3] = fVar10 + fVar4; in_ECX[1] = fVar4 - fVar10; fVar2 = in_ECX[0xf] - in_ECX[0xb]; fVar5 = in_ECX[0xb] + in_ECX[0xf]; in_ECX[7] = fVar6 + fVar3; fVar1 = fVar8 + in_ECX[0xc]; in_ECX[5] = fVar6 - fVar3; fVar8 = in_ECX[0xc] - fVar8; fVar4 = in_ECX[10] + in_ECX[0xe]; fVar7 = in_ECX[0xe] - in_ECX[10]; fVar3 = in_ECX[0xd] - in_ECX[9]; fVar6 = in_ECX[9] + in_ECX[0xd]; in_ECX[0xe] = fVar1 + fVar4; in_ECX[0xc] = fVar4 - fVar1; in_ECX[8] = fVar7 + fVar3; in_ECX[10] = fVar7 - fVar3; in_ECX[0xb] = fVar8 + fVar2; in_ECX[9] = fVar2 - fVar8; in_ECX[0xf] = fVar5 + fVar6; in_ECX[0xd] = fVar5 - fVar6; return; } //@@ 00abb0a0 FUN_00abb0a0 void FUN_00abb0a0(int param_1) { int iVar1; float *pfVar2; int in_ECX; float *pfVar3; float *in_EDX; float *pfVar4; float fVar5; float fVar6; pfVar3 = (float *)(in_ECX + 0x10); iVar1 = (param_1 >> 1) + -8; pfVar4 = in_EDX + iVar1; pfVar2 = in_EDX + (iVar1 - (param_1 >> 1)) + param_1 + 7; do { fVar6 = pfVar2[-1] - pfVar4[6]; fVar5 = *pfVar2 - pfVar4[7]; pfVar2[-1] = pfVar2[-1] + pfVar4[6]; *pfVar2 = *pfVar2 + pfVar4[7]; pfVar4[6] = fVar5 * pfVar3[-3] + fVar6 * pfVar3[-4]; pfVar4[7] = fVar5 * pfVar3[-4] - fVar6 * pfVar3[-3]; fVar6 = pfVar2[-3] - pfVar4[4]; fVar5 = pfVar2[-2] - pfVar4[5]; pfVar2[-3] = pfVar2[-3] + pfVar4[4]; pfVar2[-2] = pfVar2[-2] + pfVar4[5]; pfVar4[4] = fVar6 * *pfVar3 + fVar5 * pfVar3[1]; pfVar4[5] = fVar5 * *pfVar3 - fVar6 * pfVar3[1]; fVar6 = pfVar2[-5] - pfVar4[2]; fVar5 = pfVar2[-4] - pfVar4[3]; pfVar2[-5] = pfVar4[2] + pfVar2[-5]; pfVar2[-4] = pfVar2[-4] + pfVar4[3]; pfVar4[2] = fVar5 * pfVar3[5] + fVar6 * pfVar3[4]; pfVar4[3] = fVar5 * pfVar3[4] - fVar6 * pfVar3[5]; fVar6 = pfVar2[-7] - *pfVar4; fVar5 = pfVar2[-6] - pfVar4[1]; pfVar2[-7] = *pfVar4 + pfVar2[-7]; pfVar2[-6] = pfVar2[-6] + pfVar4[1]; *pfVar4 = fVar5 * pfVar3[9] + fVar6 * pfVar3[8]; pfVar4[1] = fVar5 * pfVar3[8] - fVar6 * pfVar3[9]; pfVar4 = pfVar4 + -8; pfVar2 = pfVar2 + -8; pfVar3 = pfVar3 + 0x10; } while (in_EDX <= pfVar4); return; } //@@ 00abb240 mdct_butterflies /* DB: libvorbis mdct.c: stages=log2n(+4)-5, mdct_butterfly_first FUN_00abb0a0 when stages>0, generic butterflies with 4<> (bVar3 & 0x1f); iVar9 = 4 << (bVar3 & 0x1f); iVar10 = (iVar1 >> 1) + -8; uVar8 = local_10; pfVar11 = in_EDX; do { pfVar6 = pfVar11 + iVar10; pfVar2 = pfVar11 + (iVar10 - (iVar1 >> 1)) + 7 + iVar1; pfVar4 = pfVar7; do { fVar13 = pfVar2[-1] - pfVar6[6]; fVar12 = *pfVar2 - pfVar6[7]; pfVar2[-1] = pfVar6[6] + pfVar2[-1]; *pfVar2 = *pfVar2 + pfVar6[7]; pfVar6[6] = fVar12 * pfVar4[1] + fVar13 * *pfVar4; pfVar5 = pfVar4 + iVar9; pfVar6[7] = fVar12 * *pfVar4 - fVar13 * pfVar4[1]; fVar13 = pfVar2[-3] - pfVar6[4]; fVar12 = pfVar2[-2] - pfVar6[5]; pfVar2[-3] = pfVar6[4] + pfVar2[-3]; pfVar2[-2] = pfVar2[-2] + pfVar6[5]; pfVar6[4] = fVar12 * pfVar5[1] + fVar13 * *pfVar5; pfVar4 = pfVar5 + iVar9; pfVar6[5] = fVar12 * *pfVar5 - fVar13 * pfVar5[1]; fVar13 = pfVar2[-5] - pfVar6[2]; fVar12 = pfVar2[-4] - pfVar6[3]; pfVar2[-5] = pfVar6[2] + pfVar2[-5]; pfVar2[-4] = pfVar2[-4] + pfVar6[3]; pfVar6[2] = fVar12 * pfVar4[1] + fVar13 * *pfVar4; pfVar5 = pfVar4 + iVar9; pfVar6[3] = fVar12 * *pfVar4 - fVar13 * pfVar4[1]; fVar13 = pfVar2[-7] - *pfVar6; fVar12 = pfVar2[-6] - pfVar6[1]; pfVar2[-7] = pfVar2[-7] + *pfVar6; pfVar2[-6] = pfVar2[-6] + pfVar6[1]; *pfVar6 = fVar12 * pfVar5[1] + fVar13 * *pfVar5; pfVar4 = pfVar5 + iVar9; pfVar2 = pfVar2 + -8; pfVar6[1] = fVar12 * *pfVar5 - fVar13 * pfVar5[1]; pfVar6 = pfVar6 + -8; } while (pfVar11 <= pfVar6); pfVar11 = pfVar11 + iVar1; uVar8 = uVar8 - 1; } while (uVar8 != 0); } local_14 = local_14 + -1; bVar3 = bVar3 + 1; local_10 = local_10 << 1 | (uint)((int)local_10 < 0); } while (0 < local_14); } if (0 < param_1) { pfVar7 = in_EDX + 0x1f; iVar10 = (param_1 - 1U >> 5) + 1; do { fVar12 = pfVar7[-1]; fVar13 = *pfVar7; fVar14 = pfVar7[-3] - pfVar7[-0x13]; pfVar7[-1] = pfVar7[-0x11] + fVar12; pfVar7[-0x11] = fVar12 - pfVar7[-0x11]; *pfVar7 = pfVar7[-0x10] + fVar13; fVar12 = pfVar7[-2] - pfVar7[-0x12]; pfVar7[-3] = pfVar7[-0x13] + pfVar7[-3]; pfVar7[-0x10] = fVar13 - pfVar7[-0x10]; pfVar7[-2] = pfVar7[-0x12] + pfVar7[-2]; fVar13 = pfVar7[-4] - pfVar7[-0x14]; fVar15 = pfVar7[-5] - pfVar7[-0x15]; pfVar7[-0x13] = fVar14 * 0.9238795 - fVar12 * 0.38268343; pfVar7[-4] = pfVar7[-0x14] + pfVar7[-4]; pfVar7[-0x12] = fVar12 * 0.9238795 + fVar14 * 0.38268343; pfVar7[-5] = pfVar7[-0x15] + pfVar7[-5]; fVar12 = pfVar7[-0x19]; pfVar7[-0x15] = (fVar15 - fVar13) * 0.70710677; fVar14 = pfVar7[-6] - pfVar7[-0x16]; pfVar7[-0x14] = (fVar13 + fVar15) * 0.70710677; fVar15 = pfVar7[-7] - pfVar7[-0x17]; pfVar7[-6] = pfVar7[-0x16] + pfVar7[-6]; pfVar7[-7] = pfVar7[-0x17] + pfVar7[-7]; pfVar7[-0x16] = fVar14 * 0.38268343 + fVar15 * 0.9238795; fVar13 = pfVar7[-9]; pfVar7[-0x17] = fVar15 * 0.38268343 - fVar14 * 0.9238795; fVar14 = pfVar7[-8]; pfVar7[-9] = fVar12 + fVar13; pfVar7[-8] = pfVar7[-0x18] + fVar14; pfVar7[-0x19] = pfVar7[-0x18] - fVar14; fVar14 = pfVar7[-0x1b] - pfVar7[-0xb]; pfVar7[-0x18] = fVar13 - fVar12; fVar12 = pfVar7[-0x1a] - pfVar7[-10]; pfVar7[-10] = pfVar7[-0x1a] + pfVar7[-10]; pfVar7[-0xb] = pfVar7[-0x1b] + pfVar7[-0xb]; pfVar7[-0x1b] = fVar12 * 0.9238795 + fVar14 * 0.38268343; pfVar7[-0x1a] = fVar12 * 0.38268343 - fVar14 * 0.9238795; fVar13 = pfVar7[-0x1c] - pfVar7[-0xc]; fVar15 = pfVar7[-0x1d] - pfVar7[-0xd]; pfVar7[-0xc] = pfVar7[-0x1c] + pfVar7[-0xc]; pfVar7[-0xd] = pfVar7[-0x1d] + pfVar7[-0xd]; fVar14 = pfVar7[-0x1e] - pfVar7[-0xe]; pfVar7[-0x1c] = (fVar13 - fVar15) * 0.70710677; fVar12 = pfVar7[-0x1f]; pfVar7[-0xe] = pfVar7[-0x1e] + pfVar7[-0xe]; fVar16 = fVar12 - pfVar7[-0xf]; pfVar7[-0x1d] = (fVar13 + fVar15) * 0.70710677; pfVar7[-0xf] = fVar12 + pfVar7[-0xf]; pfVar7[-0x1f] = fVar14 * 0.38268343 + fVar16 * 0.9238795; pfVar7[-0x1e] = fVar14 * 0.9238795 - fVar16 * 0.38268343; mdct_butterfly_32(); mdct_butterfly_32(); pfVar7 = (float *)(extraout_EDX + 0x80); iVar10 = iVar10 + -1; } while (iVar10 != 0); } return; } //@@ 00abb750 mdct_bitreverse /* DB: libvorbis mdct.c: walks bitrev (+0xc) and trig (+8 + n*4) in groups of 4 with the 0.5 butterflies; callers mdct_forward and 00abb900 mdct_backward */ void mdct_bitreverse(void) { int *piVar1; float *pfVar2; float *pfVar3; int iVar4; int iVar5; int *in_ECX; int in_EDX; int iVar6; float *pfVar7; int *piVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; float *local_c; float *local_8; piVar8 = (int *)in_ECX[3]; iVar4 = in_EDX + (*in_ECX >> 1) * 4; local_8 = (float *)(in_ECX[2] + *in_ECX * 4); local_c = (float *)(in_EDX + 8); iVar6 = in_EDX - (int)piVar8; pfVar7 = (float *)(iVar4 + 0xc); do { iVar5 = *piVar8; fVar9 = *(float *)(iVar4 + iVar5 * 4); fVar11 = *(float *)(iVar4 + 4 + piVar8[1] * 4); fVar14 = *(float *)(iVar4 + piVar8[1] * 4); fVar12 = *(float *)(iVar4 + 4 + iVar5 * 4) - fVar11; fVar10 = fVar9 + fVar14; fVar11 = (fVar11 + *(float *)(iVar4 + 4 + iVar5 * 4)) * 0.5; fVar13 = *local_8 * fVar10 + local_8[1] * fVar12; fVar10 = local_8[1] * fVar10 - *local_8 * fVar12; fVar9 = (fVar9 - fVar14) * 0.5; *(float *)(iVar6 + (int)piVar8) = fVar13 + fVar11; pfVar7[-5] = fVar11 - fVar13; local_c[-1] = fVar10 + fVar9; pfVar7[-4] = fVar10 - fVar9; iVar5 = piVar8[2]; piVar1 = piVar8 + 3; piVar8 = piVar8 + 4; fVar9 = *(float *)(iVar4 + iVar5 * 4); fVar11 = *(float *)(iVar4 + 4 + *piVar1 * 4); fVar14 = *(float *)(iVar4 + *piVar1 * 4); fVar12 = *(float *)(iVar4 + 4 + iVar5 * 4) - fVar11; fVar10 = fVar9 + fVar14; pfVar2 = local_8 + 2; pfVar3 = local_8 + 3; local_8 = local_8 + 4; fVar13 = *pfVar3 * fVar10 - *pfVar2 * fVar12; fVar9 = (fVar9 - fVar14) * 0.5; fVar11 = (fVar11 + *(float *)(iVar4 + 4 + iVar5 * 4)) * 0.5; fVar14 = *pfVar3 * fVar12 + *pfVar2 * fVar10; *local_c = fVar14 + fVar11; pfVar7[-7] = fVar11 - fVar14; local_c[1] = fVar13 + fVar9; local_c = local_c + 4; pfVar7[-6] = fVar13 - fVar9; pfVar2 = pfVar7 + -7; pfVar7 = pfVar7 + -4; } while ((float *)(iVar6 + (int)piVar8) < pfVar2); return; } //@@ 00abb900 mdct_backward /* DB: libvorbis mdct.c: only caller mapping0_inverse (the real one, FUN_00acf890, slot 4 of the mapping0 export bundle 00b5e294); calls mdct_butterflies and mdct_bitreverse like mdct_forward 00abbc60 mdct_forward void mdct_backward(int param_1) { float *pfVar1; float *pfVar2; float fVar3; int iVar4; int iVar5; float *pfVar6; float *pfVar7; int *in_ECX; float *pfVar8; float *pfVar9; float *pfVar10; float *in_EDX; int iVar11; float *local_10; iVar4 = *in_ECX >> 1; iVar11 = *in_ECX >> 2; pfVar7 = in_EDX + iVar4 + -7; pfVar10 = (float *)(param_1 + (iVar4 + iVar11) * 4); iVar5 = iVar11 * 4; pfVar6 = (float *)(in_ECX[2] + iVar5); pfVar8 = pfVar10; do { pfVar8[-4] = -pfVar7[2] * pfVar6[3] - *pfVar7 * pfVar6[2]; pfVar8[-3] = *pfVar7 * pfVar6[3] - pfVar6[2] * pfVar7[2]; pfVar8[-2] = -pfVar7[6] * pfVar6[1] - pfVar7[4] * *pfVar6; pfVar1 = pfVar6 + 1; pfVar9 = pfVar7 + 6; pfVar2 = pfVar7 + 4; pfVar7 = pfVar7 + -8; fVar3 = *pfVar6; pfVar6 = pfVar6 + 4; pfVar8[-1] = *pfVar1 * *pfVar2 - *pfVar9 * fVar3; pfVar8 = pfVar8 + -4; } while (in_EDX <= pfVar7); pfVar7 = in_EDX + iVar4 + -8; pfVar8 = (float *)(in_ECX[2] + iVar5); pfVar6 = pfVar10; do { pfVar9 = pfVar8 + -4; *pfVar6 = pfVar7[6] * pfVar8[-2] + pfVar7[4] * pfVar8[-1]; pfVar6[1] = pfVar7[4] * pfVar8[-2] - pfVar7[6] * pfVar8[-1]; pfVar6[2] = *pfVar7 * pfVar8[-3] + *pfVar9 * pfVar7[2]; fVar3 = *pfVar7; pfVar1 = pfVar7 + 2; pfVar7 = pfVar7 + -8; pfVar6[3] = fVar3 * *pfVar9 - pfVar8[-3] * *pfVar1; pfVar6 = pfVar6 + 4; pfVar8 = pfVar9; } while (in_EDX <= pfVar7); mdct_butterflies(iVar4); mdct_bitreverse(); pfVar6 = (float *)(in_ECX[2] + iVar4 * 4); pfVar7 = (float *)(param_1 + 0xc); pfVar8 = pfVar10; local_10 = pfVar10; do { pfVar9 = pfVar8 + -4; pfVar8[-1] = pfVar6[1] * pfVar7[-3] - pfVar7[-2] * *pfVar6; *local_10 = -(pfVar7[-2] * pfVar6[1] + *pfVar6 * pfVar7[-3]); pfVar8[-2] = pfVar7[-1] * pfVar6[3] - *pfVar7 * pfVar6[2]; local_10[1] = -(pfVar7[-1] * pfVar6[2] + *pfVar7 * pfVar6[3]); pfVar8[-3] = pfVar7[1] * pfVar6[5] - pfVar7[2] * pfVar6[4]; local_10[2] = -(pfVar7[2] * pfVar6[5] + pfVar7[1] * pfVar6[4]); *pfVar9 = pfVar7[3] * pfVar6[7] - pfVar6[6] * pfVar7[4]; pfVar8 = pfVar6 + 6; pfVar1 = pfVar6 + 7; pfVar6 = pfVar6 + 8; local_10[3] = -(*pfVar8 * pfVar7[3] + pfVar7[4] * *pfVar1); local_10 = local_10 + 4; pfVar1 = pfVar7 + 5; pfVar7 = pfVar7 + 8; pfVar8 = pfVar9; } while (pfVar1 < pfVar9); pfVar7 = pfVar10; pfVar8 = (float *)(iVar5 + 8 + param_1); pfVar6 = (float *)(param_1 + (iVar11 + 2) * 4); do { fVar3 = pfVar7[-1]; pfVar9 = pfVar7 + -4; pfVar6[-3] = fVar3; pfVar8[-2] = -fVar3; pfVar1 = pfVar8 + 2; fVar3 = pfVar7[-2]; pfVar6[-4] = fVar3; pfVar8[-1] = -fVar3; fVar3 = pfVar7[-3]; pfVar6[-5] = fVar3; *pfVar8 = -fVar3; fVar3 = *pfVar9; pfVar6[-6] = fVar3; pfVar8[1] = -fVar3; pfVar7 = pfVar9; pfVar8 = pfVar8 + 4; pfVar6 = pfVar6 + -4; } while (pfVar1 < pfVar9); pfVar7 = pfVar10; do { pfVar8 = pfVar10 + -4; *pfVar8 = pfVar7[3]; pfVar10[-3] = pfVar7[2]; pfVar10[-2] = pfVar7[1]; pfVar10[-1] = *pfVar7; pfVar10 = pfVar8; pfVar7 = pfVar7 + 4; } while ((float *)(param_1 + iVar4 * 4) < pfVar8); return; } //@@ 00abbc60 mdct_forward /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis mdct.c: ECX mdct_lookup (n at [0], trig at [2]), EDX in: n2=n>>1, n4=n>>2, n8=n>>3, alloca work buffer, butterfly rotate of the input halves with trig, then mdct_butterflies/bitreverse and output scaling; called by the encoder mapping (named mapping0_inverse) per channel */ void mdct_forward(int param_1) { int iVar1; float fVar2; float fVar3; float fVar4; float fVar5; float *pfVar6; float *pfVar7; int *in_ECX; int iVar8; int iVar9; int iVar10; int iVar11; int in_EDX; float *pfVar12; float *pfVar13; float *pfVar14; int iVar15; float *pfVar16; float afStack_3c [2]; iVar11 = *in_ECX; iVar8 = iVar11 >> 2; iVar9 = iVar11 >> 3; iVar15 = iVar11 >> 1; afStack_3c[1] = 1.5771519e-38; pfVar14 = afStack_3c + (2 - iVar11); iVar1 = iVar15 * 4; pfVar13 = (float *)(in_EDX + (iVar15 + iVar8) * 4); iVar10 = 0; pfVar16 = pfVar13 + 1; pfVar6 = (float *)(in_ECX[2] + iVar1); if (0 < iVar9) { pfVar7 = pfVar6; pfVar12 = pfVar13; do { fVar2 = pfVar16[2]; pfVar13 = pfVar12 + -4; pfVar6 = pfVar7 + -2; fVar3 = pfVar12[-2]; fVar4 = *pfVar16; fVar5 = *pfVar13; pfVar16 = pfVar16 + 4; afStack_3c[(iVar15 + iVar10 + 2) - iVar11] = (fVar2 + fVar5) * pfVar7[-1] + (fVar3 + fVar4) * *pfVar6; afStack_3c[(iVar15 + iVar10 + 3) - iVar11] = (fVar2 + fVar5) * *pfVar6 - (fVar3 + fVar4) * pfVar7[-1]; iVar10 = iVar10 + 2; pfVar7 = pfVar6; pfVar12 = pfVar13; } while (iVar10 < iVar9); } pfVar16 = (float *)(in_EDX + 4); for (; iVar10 < iVar15 - iVar9; iVar10 = iVar10 + 2) { fVar2 = pfVar13[-2]; pfVar13 = pfVar13 + -4; fVar3 = *pfVar16; pfVar7 = pfVar6 + -2; fVar4 = *pfVar13; fVar5 = pfVar16[2]; pfVar16 = pfVar16 + 4; afStack_3c[(iVar15 + iVar10 + 2) - iVar11] = (fVar4 - fVar5) * pfVar6[-1] + (fVar2 - fVar3) * *pfVar7; afStack_3c[(iVar15 + iVar10 + 3) - iVar11] = (fVar4 - fVar5) * *pfVar7 - (fVar2 - fVar3) * pfVar6[-1]; pfVar6 = pfVar7; } pfVar13 = (float *)(in_EDX + iVar11 * 4); if (iVar10 < iVar15) { do { fVar2 = pfVar13[-2]; pfVar13 = pfVar13 + -4; pfVar7 = pfVar6 + -2; fVar3 = *pfVar16; fVar4 = *pfVar13; fVar5 = pfVar16[2]; pfVar16 = pfVar16 + 4; afStack_3c[(iVar15 + iVar10 + 2) - iVar11] = (-fVar4 - fVar5) * pfVar6[-1] + (-fVar2 - fVar3) * *pfVar7; afStack_3c[(iVar15 + iVar10 + 3) - iVar11] = (-fVar4 - fVar5) * *pfVar7 - (-fVar2 - fVar3) * pfVar6[-1]; iVar10 = iVar10 + 2; pfVar6 = pfVar7; } while (iVar10 < iVar15); } afStack_3c[1 - iVar11] = (float)iVar15; afStack_3c[-iVar11] = 1.5772056e-38; mdct_butterflies(); afStack_3c[1 - iVar11] = 1.5772072e-38; mdct_bitreverse(); iVar11 = 0; pfVar16 = (float *)(in_ECX[2] + iVar1); pfVar13 = (float *)(iVar1 + param_1); if (0 < iVar8) { do { pfVar13 = pfVar13 + -1; *(float *)(param_1 + iVar11 * 4) = (*pfVar16 * *pfVar14 + pfVar16[1] * pfVar14[1]) * (float)in_ECX[4]; iVar11 = iVar11 + 1; pfVar6 = pfVar16 + 1; fVar2 = *pfVar16; pfVar16 = pfVar16 + 2; fVar3 = *pfVar14; pfVar7 = pfVar14 + 1; pfVar14 = pfVar14 + 2; *pfVar13 = (*pfVar6 * fVar3 - fVar2 * *pfVar7) * (float)in_ECX[4]; } while (iVar11 < iVar8); } return; } //@@ 00abbe90 dradf2 /* DB: libvorbis smallft.c radix-2 forward butterfly (ido=ECX, l1=EDX, cc, ch, wa1); drftf1 calls it for factor 2 (DB note on drftf1) */ void dradf2(float *param_1,float *param_2,int param_3) { float *pfVar1; float *pfVar2; float fVar3; float *pfVar4; uint in_ECX; int iVar5; float *pfVar6; float *pfVar7; int in_EDX; float *pfVar8; float *pfVar9; float *pfVar10; float *pfVar11; float fVar12; float fVar13; int local_30; int local_20; float *local_1c; float *local_18; int local_10; float *local_c; iVar5 = in_ECX * in_EDX; if (0 < in_EDX) { pfVar6 = param_1 + iVar5; pfVar9 = param_2 + -1; pfVar4 = param_1; pfVar8 = param_2; local_10 = in_EDX; do { pfVar9 = pfVar9 + in_ECX * 2; *pfVar8 = *pfVar6 + *pfVar4; fVar12 = *pfVar4; fVar3 = *pfVar6; pfVar8 = pfVar8 + in_ECX * 2; pfVar4 = pfVar4 + in_ECX; pfVar6 = pfVar6 + in_ECX; *pfVar9 = fVar12 - fVar3; local_10 = local_10 + -1; } while (local_10 != 0); } if (1 < (int)in_ECX) { if (in_ECX != 2) { if (0 < in_EDX) { local_18 = param_1 + iVar5; local_c = param_2 + in_ECX * 2; pfVar6 = param_2; pfVar9 = param_1; local_30 = in_EDX; do { if (2 < (int)in_ECX) { local_1c = (float *)(param_3 + 4); local_20 = (in_ECX - 3 >> 1) + 1; pfVar4 = pfVar9; pfVar8 = local_18; pfVar10 = local_c; pfVar11 = pfVar6; do { pfVar7 = pfVar4 + 2; fVar12 = pfVar8[2]; fVar3 = *local_1c; pfVar1 = local_1c + -1; pfVar2 = local_1c + -1; local_1c = local_1c + 2; local_20 = local_20 + -1; fVar13 = pfVar8[1] * *pfVar2 + fVar12 * fVar3; fVar12 = fVar12 * *pfVar1 - fVar3 * pfVar8[1]; pfVar11[2] = fVar12 + *pfVar7; pfVar10[-2] = fVar12 - *pfVar7; pfVar11[1] = fVar13 + pfVar4[1]; pfVar10[-3] = pfVar4[1] - fVar13; pfVar4 = pfVar7; pfVar8 = pfVar8 + 2; pfVar10 = pfVar10 + -2; pfVar11 = pfVar11 + 2; } while (local_20 != 0); } local_c = local_c + in_ECX * 2; pfVar9 = pfVar9 + in_ECX; pfVar6 = pfVar6 + in_ECX * 2; local_18 = local_18 + in_ECX; local_30 = local_30 + -1; } while (local_30 != 0); } if ((in_ECX & 1) != 0) { return; } } if (0 < in_EDX) { param_2 = param_2 + in_ECX; pfVar6 = param_1 + (in_ECX - 1); param_1 = param_1 + (in_ECX - 1) + iVar5; do { fVar12 = *param_1; param_1 = param_1 + in_ECX; *param_2 = -fVar12; fVar12 = *pfVar6; pfVar6 = pfVar6 + in_ECX; param_2[-1] = fVar12; param_2 = param_2 + in_ECX * 2; in_EDX = in_EDX + -1; } while (in_EDX != 0); } } return; } //@@ 00abc0b0 dradf4 /* DB: libvorbis smallft.c radix-4 forward pass; the DB note on drftf1 names FUN_00abc0b0 as dradf4 (factor 4 branch) */ void dradf4(int param_1,int param_2,int param_3,int param_4,float *param_5) { int iVar1; int iVar2; float *pfVar3; uint in_ECX; int iVar4; int in_EDX; float *pfVar5; int iVar6; float *pfVar7; float *pfVar8; float *pfVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; float fVar17; float fVar18; int local_54; int local_50; int local_44; float *local_3c; float *local_38; float *local_34; float *local_30; float *local_28; float *local_24; float *local_20; float *local_1c; float *local_18; float *local_14; int local_10; float *local_c; iVar4 = in_ECX * in_EDX; iVar6 = 0; if (0 < in_EDX) { local_18 = (float *)(param_1 + iVar4 * 4); local_14 = (float *)(param_1 + iVar4 * 0xc); local_c = (float *)(param_1 + iVar4 * 8); local_3c = (float *)in_EDX; do { fVar11 = *local_14; fVar16 = *local_18; fVar10 = *(float *)(param_1 + iVar6 * 4) + *local_c; *(float *)(param_2 + iVar6 * 0x10) = fVar10 + fVar11 + fVar16; iVar2 = iVar6 * 4 + in_ECX * 2; *(float *)(param_2 + -4 + (in_ECX * 4 + iVar6 * 4) * 4) = fVar10 - (fVar11 + fVar16); iVar1 = iVar6 * 4; iVar6 = iVar6 + in_ECX; *(float *)(param_2 + -4 + iVar2 * 4) = *(float *)(param_1 + iVar1) - *local_c; fVar11 = *local_14; local_c = local_c + in_ECX; local_14 = local_14 + in_ECX; *(float *)(param_2 + iVar2 * 4) = fVar11 - *local_18; local_18 = local_18 + in_ECX; local_3c = (float *)((int)local_3c + -1); } while (local_3c != (float *)0x0); } if (1 < (int)in_ECX) { if (in_ECX != 2) { local_50 = 0; if (0 < in_EDX) { local_18 = (float *)0x0; local_3c = (float *)(iVar4 * 3); local_54 = in_EDX; do { iVar6 = local_50 * 4; if (2 < (int)in_ECX) { pfVar7 = (float *)(param_2 + (in_ECX * 2 + iVar6) * 4); local_38 = param_5; pfVar8 = (float *)(param_3 + 4); local_44 = (in_ECX - 3 >> 1) + 1; local_34 = (float *)(param_2 + (iVar6 + in_ECX * 4) * 4); local_30 = pfVar7; local_28 = (float *)(param_2 + local_50 * 0x10); local_24 = (float *)(param_1 + (iVar6 - (int)local_18) * 4); local_20 = (float *)(param_1 + ((int)local_3c + iVar6) * 4); local_1c = (float *)(param_1 + ((iVar6 - (int)local_18) + iVar4) * 4); local_14 = (float *)(param_1 + ((iVar4 * 2 - (int)local_18) + iVar6) * 4); do { pfVar5 = local_1c + 2; fVar11 = *(float *)((param_4 - param_3) + (int)pfVar8); fVar15 = *pfVar5 * *pfVar8 + pfVar8[-1] * local_1c[1]; fVar12 = pfVar8[-1] * *pfVar5 - local_1c[1] * *pfVar8; fVar16 = *(float *)((param_4 - (int)param_5) + (int)local_38); fVar10 = local_14[2]; fVar13 = fVar11 * fVar10 + local_14[1] * fVar16; fVar18 = fVar10 * fVar16 - fVar11 * local_14[1]; fVar11 = local_20[2]; fVar14 = fVar11 * *local_38 - local_20[1] * *(float *)(((int)param_5 - param_3) + (int)pfVar8); fVar16 = fVar11 * *(float *)(((int)param_5 - param_3) + (int)pfVar8) + local_20[1] * *local_38; fVar11 = local_24[2]; fVar10 = local_24[1] + fVar13; fVar13 = local_24[1] - fVar13; fVar17 = fVar16 + fVar15; fVar16 = fVar16 - fVar15; fVar15 = fVar14 + fVar12; fVar12 = fVar12 - fVar14; fVar14 = fVar11 + fVar18; fVar11 = fVar11 - fVar18; local_28[1] = fVar10 + fVar17; local_28[2] = fVar14 + fVar15; pfVar7[-3] = fVar13 - fVar12; pfVar7[-2] = fVar16 - fVar11; local_38 = local_38 + 2; local_30[1] = fVar13 + fVar12; pfVar8 = pfVar8 + 2; local_44 = local_44 + -1; local_30[2] = fVar11 + fVar16; local_34[-3] = fVar10 - fVar17; local_34[-2] = fVar15 - fVar14; pfVar7 = pfVar7 + -2; local_34 = local_34 + -2; local_30 = local_30 + 2; local_28 = local_28 + 2; local_24 = local_24 + 2; local_20 = local_20 + 2; local_1c = pfVar5; local_14 = local_14 + 2; } while (local_44 != 0); } local_50 = local_50 + in_ECX; local_18 = (float *)((int)local_18 + in_ECX * 3); local_3c = (float *)((int)local_3c + in_ECX * -3); local_54 = local_54 + -1; } while (local_54 != 0); } if ((in_ECX & 1) != 0) { return; } } iVar6 = iVar4 + -1 + in_ECX; if (0 < in_EDX) { pfVar7 = (float *)(in_ECX * 4 + param_2); pfVar8 = (float *)(param_1 + iVar6 * 4); local_3c = (float *)(param_1 + (iVar6 + iVar4 * 2) * 4); pfVar5 = (float *)(param_2 + in_ECX * 0xc); pfVar3 = (float *)(param_1 + (iVar6 + iVar4) * 4); pfVar9 = (float *)(param_1 + (iVar6 - iVar4) * 4); local_10 = in_EDX; do { fVar11 = *pfVar8; fVar16 = *local_3c; fVar10 = *local_3c; pfVar8 = pfVar8 + in_ECX; local_3c = local_3c + in_ECX; fVar16 = (fVar11 - fVar16) * 0.70710677; fVar10 = (fVar11 + fVar10) * -0.70710677; pfVar7[-1] = fVar16 + *pfVar9; fVar11 = *pfVar9; pfVar9 = pfVar9 + in_ECX; pfVar5[-1] = fVar11 - fVar16; *pfVar7 = fVar10 - *pfVar3; fVar11 = *pfVar3; pfVar7 = pfVar7 + in_ECX * 4; pfVar3 = pfVar3 + in_ECX; *pfVar5 = fVar10 + fVar11; pfVar5 = pfVar5 + in_ECX * 4; local_10 = local_10 + -1; } while (local_10 != 0); } } return; } //@@ 00abc500 dsp_init_sincos_table /* DB: ? (this, int n): 2*pi/n (DAT_00baa7a8 = 6.2831855) then libm cos/sin per element, 3855 bytes of pure arithmetic with no game calls; once from FUN_00abd410 <- FUN_00acebf0 (memset/alloca, no strings) in the audio/image library block before jpeg_idct_islow */ void dsp_init_sincos_table (int param_1,float *param_2,undefined4 *param_3,float *param_4,int param_5, undefined4 *param_6,float *param_7,int param_8) { undefined4 uVar1; int iVar2; int iVar3; int iVar4; int iVar5; float *pfVar6; float *pfVar7; float *pfVar8; float *pfVar9; float *pfVar10; int in_ECX; int iVar11; undefined4 *puVar12; float *pfVar13; undefined4 *puVar14; undefined4 *puVar15; int in_EDX; int iVar16; int iVar17; float *pfVar18; undefined4 *puVar19; undefined4 *puVar20; float *pfVar21; float *pfVar22; int iVar23; undefined4 *puVar24; float *pfVar25; double dVar26; undefined1 auVar27 [16]; float fVar28; float fVar29; float fVar30; float fVar31; float fVar32; float *local_44; float *local_40; float *local_3c; float *local_38; int local_34; int local_30; float *local_28; float *local_24; undefined4 *local_20; float *local_1c; float *local_14; int local_10; auVar27._0_8_ = (double)(6.2831855 / (float)in_EDX); dVar26 = auVar27._0_8_; libm_sse2_cos_precise(); auVar27._8_8_ = 0; libm_sse2_sin_precise(); iVar16 = in_ECX * param_1; iVar2 = in_EDX + 1 >> 1; iVar3 = in_ECX + -1 >> 1; iVar4 = in_ECX * in_EDX; if (in_ECX != 1) { iVar5 = 0; if (3 < (int)param_2) { iVar23 = ((int)param_2 - 4U >> 2) + 1; iVar5 = iVar23 * 4; pfVar6 = param_7 + 1; pfVar18 = (float *)(param_5 + 0xc); do { pfVar6[-1] = pfVar18[-3]; *pfVar6 = *(float *)((param_5 - (int)param_7) + -0x10 + (int)(pfVar6 + 4)); pfVar6[1] = pfVar18[-1]; pfVar6[2] = *pfVar18; iVar23 = iVar23 + -1; pfVar6 = pfVar6 + 4; pfVar18 = pfVar18 + 4; } while (iVar23 != 0); } if (iVar5 < (int)param_2) { iVar23 = (int)param_2 - iVar5; pfVar6 = param_7 + iVar5; do { *pfVar6 = *(float *)((int)pfVar6 + (param_5 - (int)param_7)); iVar23 = iVar23 + -1; pfVar6 = pfVar6 + 1; } while (iVar23 != 0); } iVar5 = 0; if (1 < in_EDX) { local_1c = (float *)(in_EDX + -1); do { iVar5 = iVar5 + iVar16; iVar23 = 0; iVar11 = iVar5; if (3 < param_1) { iVar17 = (param_1 - 4U >> 2) + 1; iVar23 = iVar17 * 4; do { param_6[iVar11] = param_4[iVar11]; iVar11 = iVar11 + in_ECX; param_6[iVar11] = param_4[iVar11]; iVar11 = iVar11 + in_ECX; param_6[iVar11] = param_4[iVar11]; iVar11 = iVar11 + in_ECX; param_6[iVar11] = param_4[iVar11]; iVar11 = iVar11 + in_ECX; iVar17 = iVar17 + -1; } while (iVar17 != 0); } if (iVar23 < param_1) { puVar12 = param_6 + iVar11; iVar23 = param_1 - iVar23; do { *puVar12 = *(undefined4 *)(((int)param_4 - (int)param_6) + (int)puVar12); puVar12 = puVar12 + in_ECX; iVar23 = iVar23 + -1; } while (iVar23 != 0); } local_1c = (float *)((int)local_1c + -1); } while (local_1c != (float *)0x0); } iVar5 = 0; local_20 = (undefined4 *)-in_ECX; if (param_1 < iVar3) { if (1 < in_EDX) { pfVar9 = (float *)(param_6 + -in_ECX); pfVar6 = (float *)(param_8 + in_ECX * -4 + -4); pfVar18 = param_4 + (-1 - in_ECX); local_20 = (undefined4 *)(in_EDX + -1); do { pfVar9 = pfVar9 + iVar16; pfVar18 = pfVar18 + iVar16; pfVar6 = pfVar6 + in_ECX; if (0 < param_1) { pfVar7 = pfVar9; pfVar8 = pfVar18; iVar5 = param_1; do { pfVar7 = pfVar7 + in_ECX; pfVar8 = pfVar8 + in_ECX; if (2 < in_ECX) { iVar23 = (in_ECX - 3U >> 1) + 1; pfVar22 = pfVar8; pfVar10 = pfVar6; pfVar21 = pfVar7; do { pfVar25 = pfVar22 + 2; pfVar13 = pfVar10 + 2; pfVar21 = pfVar21 + 2; *(float *)(((int)param_6 - (int)param_4) + (int)pfVar25) = pfVar22[2] * pfVar10[1] + pfVar22[3] * *pfVar13; *pfVar21 = pfVar10[1] * pfVar22[3] - *pfVar25 * *pfVar13; iVar23 = iVar23 + -1; pfVar22 = pfVar25; pfVar10 = pfVar13; } while (iVar23 != 0); } iVar5 = iVar5 + -1; } while (iVar5 != 0); } local_20 = (undefined4 *)((int)local_20 + -1); } while (local_20 != (undefined4 *)0x0); } } else { if (1 < in_EDX) { iVar23 = (int)local_20 + -1; pfVar6 = (float *)(param_8 + in_ECX * -4 + -4); local_1c = (float *)(in_EDX + -1); iVar11 = (int)local_20; do { iVar5 = iVar5 + iVar16; iVar11 = iVar11 + in_ECX; iVar23 = iVar23 + in_ECX; pfVar6 = pfVar6 + in_ECX; if (2 < in_ECX) { iVar17 = (iVar23 - iVar11) + iVar5; pfVar7 = (float *)(param_6 + iVar17 + 1); pfVar9 = param_4 + iVar17; local_24 = (float *)((in_ECX - 3U >> 1) + 1); pfVar18 = pfVar6; do { pfVar8 = pfVar18 + 2; pfVar7 = pfVar7 + 2; pfVar9 = pfVar9 + 2; if (0 < param_1) { pfVar22 = pfVar9; pfVar10 = pfVar7; iVar17 = param_1; do { *(float *)((int)pfVar22 + ((int)param_6 - (int)param_4)) = *pfVar22 * pfVar18[1] + pfVar22[1] * *pfVar8; fVar31 = *pfVar22; pfVar21 = pfVar22 + 1; pfVar22 = pfVar22 + in_ECX; *pfVar10 = pfVar18[1] * *pfVar21 - fVar31 * *pfVar8; pfVar10 = pfVar10 + in_ECX; iVar17 = iVar17 + -1; } while (iVar17 != 0); } local_24 = (float *)((int)local_24 + -1); pfVar18 = pfVar8; } while (local_24 != (float *)0x0); } local_1c = (float *)((int)local_1c + -1); } while (local_1c != (float *)0x0); } iVar5 = 0; iVar23 = iVar16 * in_EDX; if (iVar3 < param_1) { if (1 < iVar2) { pfVar6 = param_4 + -in_ECX; pfVar18 = (float *)(param_6 + (-1 - in_ECX)); local_40 = (float *)(iVar2 + -1); do { pfVar6 = pfVar6 + iVar16; iVar5 = iVar5 + iVar16; pfVar18 = pfVar18 + iVar16; iVar23 = iVar23 - iVar16; local_20 = (undefined4 *)((int)local_20 + iVar16); if (2 < in_ECX) { local_38 = (float *)((in_ECX - 3U >> 1) + 1); pfVar9 = pfVar6; pfVar7 = pfVar18; iVar11 = (int)local_20; do { iVar11 = iVar11 + 2; pfVar9 = pfVar9 + 2; pfVar7 = pfVar7 + 2; if (0 < param_1) { iVar17 = iVar11 + (iVar23 - iVar5); pfVar21 = param_4 + iVar17; local_30 = param_1; pfVar10 = (float *)(param_6 + iVar17 + -1); pfVar8 = pfVar7; pfVar22 = pfVar9; do { pfVar10 = pfVar10 + in_ECX; pfVar8 = pfVar8 + in_ECX; pfVar22 = pfVar22 + in_ECX; pfVar21 = pfVar21 + in_ECX; local_30 = local_30 + -1; *(float *)((int)pfVar8 + ((int)param_4 - (int)param_6)) = *pfVar10 + *pfVar8; *(float *)((int)pfVar10 + ((int)param_4 - (int)param_6)) = pfVar8[1] - pfVar10[1]; *pfVar22 = pfVar8[1] + pfVar10[1]; *pfVar21 = *pfVar10 - *pfVar8; } while (local_30 != 0); } local_38 = (float *)((int)local_38 + -1); } while (local_38 != (float *)0x0); } local_40 = (float *)((int)local_40 + -1); } while (local_40 != (float *)0x0); } goto LAB_00abc902; } } if (1 < iVar2) { pfVar6 = param_4 + iVar16 * in_EDX; pfVar18 = (float *)(param_6 + iVar16 * in_EDX + -1); pfVar7 = (float *)(param_6 + -1); local_30 = iVar2 + -1; pfVar9 = param_4; do { pfVar9 = pfVar9 + iVar16; pfVar7 = pfVar7 + iVar16; pfVar6 = pfVar6 + -iVar16; pfVar18 = pfVar18 + -iVar16; if (0 < param_1) { local_38 = (float *)param_1; local_44 = pfVar9; local_40 = pfVar7; local_3c = pfVar6; local_24 = pfVar18; do { if (2 < in_ECX) { iVar5 = (in_ECX - 3U >> 1) + 1; pfVar8 = local_40; pfVar22 = local_24; pfVar10 = local_3c; pfVar21 = local_44; do { pfVar13 = pfVar22 + 2; pfVar25 = pfVar8 + 2; pfVar21 = pfVar21 + 2; pfVar10 = pfVar10 + 2; *(float *)((int)pfVar25 + ((int)param_4 - (int)param_6)) = pfVar22[2] + pfVar8[2]; *(float *)(((int)param_4 - (int)param_6) + (int)pfVar13) = pfVar8[3] - pfVar22[3]; *pfVar21 = pfVar22[3] + pfVar8[3]; *pfVar10 = *pfVar13 - *pfVar25; iVar5 = iVar5 + -1; pfVar8 = pfVar25; pfVar22 = pfVar13; } while (iVar5 != 0); } local_44 = local_44 + in_ECX; local_40 = local_40 + in_ECX; local_3c = local_3c + in_ECX; local_24 = local_24 + in_ECX; local_38 = (float *)((int)local_38 + -1); } while (local_38 != (float *)0x0); } local_30 = local_30 + -1; } while (local_30 != 0); } } LAB_00abc902: iVar5 = 0; if (3 < (int)param_2) { iVar23 = ((int)param_2 - 4U >> 2) + 1; iVar5 = iVar23 * 4; puVar12 = (undefined4 *)(param_5 + 4); pfVar6 = param_7 + 3; do { puVar12[-1] = pfVar6[-3]; *puVar12 = *(undefined4 *)((int)param_7 + (-0x10 - param_5) + (int)(puVar12 + 4)); puVar12[1] = pfVar6[-1]; puVar12[2] = *pfVar6; iVar23 = iVar23 + -1; puVar12 = puVar12 + 4; pfVar6 = pfVar6 + 4; } while (iVar23 != 0); } if (iVar5 < (int)param_2) { iVar23 = (int)param_2 - iVar5; puVar12 = (undefined4 *)(param_5 + iVar5 * 4); do { *puVar12 = *(undefined4 *)(((int)param_7 - param_5) + (int)puVar12); iVar23 = iVar23 + -1; puVar12 = puVar12 + 1; } while (iVar23 != 0); } iVar5 = 0; if (1 < iVar2) { iVar11 = -in_ECX; pfVar6 = (float *)(param_6 + -in_ECX); local_24 = (float *)(iVar2 + -1); iVar23 = in_EDX * (int)param_2; do { iVar5 = iVar5 + iVar16; pfVar6 = pfVar6 + iVar16; iVar23 = iVar23 - iVar16; iVar11 = iVar11 + iVar16; if (0 < param_1) { pfVar18 = (float *)(param_6 + (iVar11 - iVar5) + iVar23); pfVar9 = pfVar6; iVar17 = param_1; do { pfVar7 = pfVar18 + in_ECX; pfVar18 = pfVar18 + in_ECX; pfVar8 = pfVar9 + in_ECX; pfVar9 = pfVar9 + in_ECX; *(float *)(((int)param_4 - (int)param_6) + (int)pfVar9) = *pfVar7 + *pfVar8; *(float *)(((int)param_4 - (int)param_6) + (int)pfVar18) = *pfVar18 - *pfVar9; iVar17 = iVar17 + -1; } while (iVar17 != 0); } local_24 = (float *)((int)local_24 + -1); } while (local_24 != (float *)0x0); fVar29 = 0.0; fVar31 = 1.0; iVar5 = (in_EDX + -1) * (int)param_2; pfVar6 = param_7 + in_EDX * (int)param_2; local_24 = (float *)(iVar2 + -1); pfVar18 = param_7; do { pfVar18 = pfVar18 + (int)param_2; pfVar6 = pfVar6 + -(int)param_2; iVar23 = 0; fVar32 = fVar31 * (float)auVar27._0_8_; fVar31 = fVar31 * (float)dVar26 - fVar29 * (float)auVar27._0_8_; fVar29 = fVar29 * (float)dVar26 + fVar32; if (0 < (int)param_2) { pfVar22 = (float *)((int)param_2 * 4 + param_5); pfVar9 = (float *)(param_5 + iVar5 * 4); pfVar7 = pfVar6; pfVar8 = pfVar18; do { fVar32 = *pfVar22; pfVar22 = pfVar22 + 1; iVar11 = iVar23 * 4; iVar23 = iVar23 + 1; *pfVar8 = fVar31 * fVar32 + *(float *)(param_5 + iVar11); fVar32 = *pfVar9; pfVar8 = pfVar8 + 1; pfVar9 = pfVar9 + 1; *pfVar7 = fVar29 * fVar32; pfVar7 = pfVar7 + 1; } while (iVar23 < (int)param_2); } if (2 < iVar2) { pfVar9 = (float *)((int)param_2 * 4 + param_5); pfVar7 = (float *)(param_5 + iVar5 * 4); local_3c = (float *)(iVar2 + -2); fVar32 = fVar29; fVar28 = fVar31; do { pfVar7 = pfVar7 + -(int)param_2; pfVar9 = pfVar9 + (int)param_2; fVar30 = fVar28 * fVar29; fVar28 = fVar28 * fVar31 - fVar32 * fVar29; fVar32 = fVar32 * fVar31 + fVar30; if (0 < (int)param_2) { pfVar8 = pfVar6; pfVar22 = pfVar18; pfVar10 = pfVar7; iVar23 = (int)param_2; pfVar21 = pfVar9; do { fVar30 = *pfVar21; pfVar21 = pfVar21 + 1; *pfVar22 = fVar28 * fVar30 + *pfVar22; fVar30 = *pfVar10; pfVar22 = pfVar22 + 1; pfVar10 = pfVar10 + 1; *pfVar8 = fVar32 * fVar30 + *pfVar8; pfVar8 = pfVar8 + 1; iVar23 = iVar23 + -1; } while (iVar23 != 0); } local_3c = (float *)((int)local_3c + -1); } while (local_3c != (float *)0x0); } local_24 = (float *)((int)local_24 + -1); } while (local_24 != (float *)0x0); local_24 = (float *)(iVar2 + -1); pfVar6 = (float *)(param_5 + 8); iVar5 = 0; do { pfVar6 = pfVar6 + (int)param_2; iVar5 = iVar5 + (int)param_2; iVar11 = 0; iVar23 = iVar5; if (3 < (int)param_2) { pfVar9 = param_7 + 2; iVar17 = ((int)param_2 - 4U >> 2) + 1; iVar11 = iVar17 * 4; iVar23 = iVar11 + iVar5; pfVar18 = pfVar6; do { pfVar9[-2] = pfVar18[-2] + pfVar9[-2]; pfVar9[-1] = pfVar18[-1] + pfVar9[-1]; *pfVar9 = *pfVar18 + *pfVar9; pfVar7 = pfVar18 + 1; pfVar18 = pfVar18 + 4; pfVar9[1] = *pfVar7 + pfVar9[1]; pfVar9 = pfVar9 + 4; iVar17 = iVar17 + -1; } while (iVar17 != 0); } if (iVar11 < (int)param_2) { pfVar18 = (float *)(param_5 + iVar23 * 4); do { fVar31 = *pfVar18; pfVar18 = pfVar18 + 1; param_7[iVar11] = fVar31 + param_7[iVar11]; iVar11 = iVar11 + 1; } while (iVar11 < (int)param_2); } local_24 = (float *)((int)local_24 + -1); } while (local_24 != (float *)0x0); } local_24 = (float *)0x0; if (in_ECX < param_1) { if (0 < in_ECX) { do { param_2 = (float *)0x0; pfVar6 = local_24; pfVar18 = local_24; if (3 < param_1) { iVar5 = (param_1 - 4U >> 2) + 1; param_2 = (float *)(iVar5 * 4); do { param_3[(int)pfVar18] = param_6[(int)pfVar6]; iVar23 = (int)pfVar6 + in_ECX + in_ECX; param_3[(int)pfVar18 + iVar4] = param_6[(int)pfVar6 + in_ECX]; iVar17 = (int)pfVar18 + iVar4 + iVar4; iVar11 = iVar23 + in_ECX; param_3[iVar17] = param_6[iVar23]; iVar17 = iVar17 + iVar4; pfVar6 = (float *)(iVar11 + in_ECX); param_3[iVar17] = param_6[iVar11]; pfVar18 = (float *)(iVar17 + iVar4); iVar5 = iVar5 + -1; } while (iVar5 != 0); } if ((int)param_2 < param_1) { puVar12 = param_3 + (int)pfVar18; iVar5 = param_1 - (int)param_2; puVar15 = param_6 + (int)pfVar6; do { uVar1 = *puVar15; puVar15 = puVar15 + in_ECX; *puVar12 = uVar1; puVar12 = puVar12 + iVar4; iVar5 = iVar5 + -1; } while (iVar5 != 0); } local_24 = (float *)((int)local_24 + 1); } while ((int)local_24 < in_ECX); } } else { param_2 = (float *)0x0; if (0 < param_1) { local_20 = param_6 + 2; local_44 = (float *)param_1; local_1c = (float *)(param_3 + 2); do { iVar5 = 0; pfVar6 = local_24; iVar23 = (int)param_2; if (3 < in_ECX) { iVar11 = (in_ECX - 4U >> 2) + 1; iVar5 = iVar11 * 4; pfVar6 = (float *)((int)local_24 + iVar5); iVar23 = iVar5 + (int)param_2; pfVar18 = local_1c; puVar12 = local_20; do { pfVar18[-2] = (float)puVar12[-2]; pfVar18[-1] = (float)puVar12[-1]; *pfVar18 = (float)*puVar12; pfVar18[1] = (float)puVar12[1]; iVar11 = iVar11 + -1; pfVar18 = pfVar18 + 4; puVar12 = puVar12 + 4; } while (iVar11 != 0); } if (iVar5 < in_ECX) { puVar15 = param_3 + iVar23; puVar12 = param_6 + (int)pfVar6; iVar5 = in_ECX - iVar5; do { uVar1 = *puVar12; puVar12 = puVar12 + 1; *puVar15 = uVar1; puVar15 = puVar15 + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); } local_20 = local_20 + in_ECX; param_2 = (float *)((int)param_2 + iVar4); local_24 = (float *)((int)local_24 + in_ECX); local_1c = local_1c + iVar4; local_44 = (float *)((int)local_44 + -1); } while (local_44 != (float *)0x0); } } iVar5 = iVar16 * in_EDX; if (1 < iVar2) { puVar12 = param_6 + iVar5; param_2 = (float *)(iVar2 + -1); puVar15 = param_3; puVar19 = param_6; do { puVar15 = puVar15 + in_ECX * 2; puVar19 = puVar19 + iVar16; puVar12 = puVar12 + -iVar16; if (0 < param_1) { puVar14 = puVar15; puVar20 = puVar19; puVar24 = puVar12; iVar23 = param_1; do { uVar1 = *puVar20; puVar20 = puVar20 + in_ECX; puVar14[-1] = uVar1; uVar1 = *puVar24; puVar24 = puVar24 + in_ECX; *puVar14 = uVar1; puVar14 = puVar14 + iVar4; iVar23 = iVar23 + -1; } while (iVar23 != 0); } param_2 = (float *)((int)param_2 + -1); } while (param_2 != (float *)0x0); } if (in_ECX != 1) { if (iVar3 < param_1) { iVar3 = 0; if (1 < iVar2) { local_28 = (float *)(param_3 + -2); pfVar6 = (float *)(param_6 + iVar5 + 2); pfVar18 = (float *)(param_6 + 2); local_30 = iVar2 + -1; iVar5 = -2; iVar2 = 4; do { local_28 = local_28 + in_ECX * 2; iVar5 = iVar5 + in_ECX * 2; iVar2 = iVar2 + in_ECX * -2; iVar3 = iVar3 + in_ECX * 2; pfVar18 = pfVar18 + iVar16; pfVar6 = pfVar6 + -iVar16; if (2 < in_ECX) { local_3c = (float *)((in_ECX - 3U >> 1) + 1); param_2 = local_28; local_20 = (undefined4 *)iVar5; local_1c = pfVar18; local_14 = pfVar6; local_10 = iVar2; do { if (0 < param_1) { pfVar9 = (float *)(param_3 + local_10 + (int)local_20 + iVar3); local_40 = (float *)param_1; pfVar7 = local_1c; pfVar8 = local_14; pfVar22 = param_2; do { pfVar9[-1] = pfVar8[-1] + pfVar7[-1]; pfVar22[-1] = pfVar7[-1] - pfVar8[-1]; *pfVar9 = *pfVar8 + *pfVar7; pfVar9 = pfVar9 + iVar4; fVar31 = *pfVar8; pfVar8 = pfVar8 + in_ECX; fVar29 = *pfVar7; pfVar7 = pfVar7 + in_ECX; *pfVar22 = fVar31 - fVar29; pfVar22 = pfVar22 + iVar4; local_40 = (float *)((int)local_40 + -1); } while (local_40 != (float *)0x0); } local_20 = (undefined4 *)((int)local_20 + -2); param_2 = param_2 + -2; local_1c = local_1c + 2; local_14 = local_14 + 2; local_10 = local_10 + 4; local_3c = (float *)((int)local_3c + -1); } while (local_3c != (float *)0x0); } local_30 = local_30 + -1; } while (local_30 != 0); return; } } else if (1 < iVar2) { pfVar6 = (float *)(param_3 + 2); pfVar9 = (float *)(param_6 + iVar5 + 2); pfVar7 = (float *)(param_6 + 2); pfVar18 = (float *)(param_3 + -2); local_24 = (float *)(iVar2 + -1); do { pfVar18 = pfVar18 + in_ECX * 2; pfVar7 = pfVar7 + iVar16; pfVar6 = pfVar6 + in_ECX * 2; pfVar9 = pfVar9 + -iVar16; if (0 < param_1) { local_34 = param_1; pfVar8 = pfVar7; local_44 = pfVar6; local_3c = pfVar18; local_38 = pfVar9; do { if (2 < in_ECX) { iVar2 = (in_ECX - 3U >> 1) + 1; pfVar22 = pfVar8; pfVar10 = local_38; pfVar21 = local_44; pfVar25 = local_3c; do { pfVar21[-1] = pfVar22[-1] + pfVar10[-1]; pfVar25[-1] = pfVar22[-1] - pfVar10[-1]; *pfVar21 = *pfVar10 + *pfVar22; pfVar21 = pfVar21 + 2; fVar31 = *pfVar10; pfVar10 = pfVar10 + 2; fVar29 = *pfVar22; pfVar22 = pfVar22 + 2; *pfVar25 = fVar31 - fVar29; pfVar25 = pfVar25 + -2; iVar2 = iVar2 + -1; } while (iVar2 != 0); } local_44 = local_44 + iVar4; local_38 = local_38 + in_ECX; local_3c = local_3c + iVar4; pfVar8 = pfVar8 + in_ECX; local_34 = local_34 + -1; } while (local_34 != 0); } local_24 = (float *)((int)local_24 + -1); } while (local_24 != (float *)0x0); } } return; } //@@ 00abd410 drftf1 /* DB: libvorbis smallft.c: (n in ECX, c, ch, wa, ifac): walks the factor list (ifac[1] count, factors from the end) calling dradf4 FUN_00abc0b0 for 4, dradf2 FUN_00abbe90 for 2 and dradfg (named dsp_init_sincos_table 00abc500) otherwise, swapping c/ch with the na flag; reached from the encoder mapping (named mapping0_inverse) via drft_forward */ void drftf1(int param_1,undefined4 param_2,int param_3) { int iVar1; int iVar2; int iVar3; int in_ECX; undefined4 *puVar4; int in_EDX; undefined4 *puVar5; int local_28; int *local_20; int local_10; int local_c; local_c = *(int *)(param_3 + 4); local_28 = 1; if (0 < local_c) { local_20 = (int *)(param_3 + (local_c + 1) * 4); local_10 = in_ECX; do { iVar1 = local_10 / *local_20; iVar2 = (in_ECX / local_10) * iVar1; iVar3 = 1 - local_28; if (*local_20 == 4) { dradf4(); local_28 = iVar3; } else if (*local_20 == 2) { if (iVar3 == 0) { dradf2(); local_28 = iVar3; } else { dradf2(param_1); local_28 = iVar3; } } else { if (in_ECX / local_10 != 1) { local_28 = iVar3; } if (local_28 == 0) { dsp_init_sincos_table(iVar1,iVar2); local_28 = 1; } else { dsp_init_sincos_table(iVar1,iVar2,param_1,param_1,param_1); local_28 = 0; } } local_20 = local_20 + -1; local_c = local_c + -1; local_10 = iVar1; } while (local_c != 0); if (local_28 != 1) { iVar1 = 0; if (3 < in_ECX) { iVar2 = (in_ECX - 4U >> 2) + 1; iVar1 = iVar2 * 4; puVar4 = (undefined4 *)(in_EDX + 4); puVar5 = (undefined4 *)(param_1 + 0xc); do { puVar4[-1] = puVar5[-3]; *puVar4 = *(undefined4 *)((param_1 - in_EDX) + -0x10 + (int)(puVar4 + 4)); puVar4[1] = puVar5[-1]; puVar4[2] = *puVar5; iVar2 = iVar2 + -1; puVar4 = puVar4 + 4; puVar5 = puVar5 + 4; } while (iVar2 != 0); } if (iVar1 < in_ECX) { iVar2 = in_ECX - iVar1; puVar4 = (undefined4 *)(in_EDX + iVar1 * 4); do { *puVar4 = *(undefined4 *)((param_1 - in_EDX) + (int)puVar4); iVar2 = iVar2 + -1; puVar4 = puVar4 + 1; } while (iVar2 != 0); } } } return; } //@@ 00abd630 _vorbis_apply_window /* DB: libvorbis: (pcm, blocksizes, lW, W, nW) picks the vwin tables PTR_DAT_00b5dd40[] for the previous/next block sizes, zeroes [0,leftbegin), multiplies the overlap regions by the window and zeroes the tail; only caller mapping0_inverse */ void _vorbis_apply_window(int param_1,int param_2,int param_3,int param_4) { float fVar1; undefined *puVar2; undefined *puVar3; int iVar4; int iVar5; float *pfVar6; int iVar7; undefined4 *in_ECX; int iVar8; int iVar9; float *pfVar10; int in_EDX; int iVar11; int iVar12; int iVar13; undefined4 *puVar14; iVar8 = 0; if (param_3 != 0) { iVar8 = param_2; } iVar12 = 0; if (param_3 != 0) { iVar12 = param_4; } puVar2 = (&PTR_DAT_00b5dd40)[*(int *)(in_EDX + iVar8 * 4)]; puVar3 = (&PTR_DAT_00b5dd40)[*(int *)(in_EDX + iVar12 * 4)]; iVar7 = *(int *)(param_1 + param_3 * 4); iVar12 = *(int *)(param_1 + iVar12 * 4); iVar8 = *(int *)(param_1 + iVar8 * 4); iVar13 = (int)((iVar7 >> 0x1f & 3U) + iVar7) >> 2; iVar11 = iVar13 - ((int)(iVar8 + (iVar8 >> 0x1f & 3U)) >> 2); iVar4 = iVar8 / 2 + iVar11; iVar5 = iVar12 / 2; iVar13 = (iVar7 / 2 - ((int)((iVar12 >> 0x1f & 3U) + iVar12) >> 2)) + iVar13; iVar8 = iVar5 + iVar13; iVar12 = 0; if (0 < iVar11) { puVar14 = in_ECX; for (iVar9 = iVar11; iVar12 = iVar11, iVar9 != 0; iVar9 = iVar9 + -1) { *puVar14 = 0; puVar14 = puVar14 + 1; } } param_3 = 0; if (iVar12 < iVar4) { if (3 < iVar4 - iVar12) { iVar11 = iVar12 + 2; iVar9 = ((iVar4 - iVar12) - 4U >> 2) + 1; param_3 = iVar9 * 4; iVar12 = iVar12 + param_3; pfVar6 = (float *)(in_ECX + iVar11); pfVar10 = (float *)(puVar2 + 8); do { pfVar6[-2] = pfVar10[-2] * pfVar6[-2]; pfVar6[-1] = pfVar10[-1] * pfVar6[-1]; *pfVar6 = *pfVar10 * *pfVar6; pfVar6[1] = pfVar10[1] * pfVar6[1]; iVar9 = iVar9 + -1; pfVar6 = pfVar6 + 4; pfVar10 = pfVar10 + 4; } while (iVar9 != 0); if (iVar4 <= iVar12) goto LAB_00abd796; } pfVar6 = (float *)(puVar2 + param_3 * 4); do { fVar1 = *pfVar6; pfVar6 = pfVar6 + 1; in_ECX[iVar12] = fVar1 * (float)in_ECX[iVar12]; iVar12 = iVar12 + 1; } while (iVar12 < iVar4); } LAB_00abd796: iVar12 = iVar5 + -1; if (iVar13 < iVar8) { if (3 < iVar5) { iVar4 = iVar13 + 2; iVar11 = ((iVar8 - iVar13) - 4U >> 2) + 1; iVar5 = iVar12 * 4; iVar13 = iVar13 + iVar11 * 4; iVar12 = iVar12 + iVar11 * -4; pfVar6 = (float *)(in_ECX + iVar4); pfVar10 = (float *)(puVar3 + iVar5 + -8); do { pfVar6[-2] = pfVar10[2] * pfVar6[-2]; pfVar6[-1] = pfVar10[1] * pfVar6[-1]; *pfVar6 = *pfVar6 * *pfVar10; pfVar6[1] = pfVar10[-1] * pfVar6[1]; iVar11 = iVar11 + -1; pfVar6 = pfVar6 + 4; pfVar10 = pfVar10 + -4; } while (iVar11 != 0); if (iVar8 <= iVar13) goto LAB_00abd857; } pfVar6 = (float *)(puVar3 + iVar12 * 4); do { in_ECX[iVar13] = (float)in_ECX[iVar13] * *pfVar6; iVar13 = iVar13 + 1; pfVar6 = pfVar6 + -1; } while (iVar13 < iVar8); } LAB_00abd857: if (iVar13 < iVar7) { puVar14 = in_ECX + iVar13; for (iVar7 = iVar7 - iVar13; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar14 = 0; puVar14 = puVar14 + 1; } } return; } //@@ 00abd870 FUN_00abd870 void FUN_00abd870(int *param_1) { int iVar1; int *in_ECX; int in_EDX; if (param_1 != (int *)0x0) { *param_1 = in_ECX[0xf]; } iVar1 = *in_ECX; if ((iVar1 == 4) || (iVar1 == 5)) { (**(code **)(in_EDX + 0x24))(*(undefined4 *)(in_EDX + 0x28),in_ECX[3]); iVar1 = *in_ECX; } if (iVar1 == 6) { (**(code **)(in_EDX + 0x24))(*(undefined4 *)(in_EDX + 0x28),in_ECX[1]); } in_ECX[0xd] = in_ECX[10]; in_ECX[0xc] = in_ECX[10]; *in_ECX = 0; in_ECX[7] = 0; in_ECX[8] = 0; if ((code *)in_ECX[0xe] != (code *)0x0) { iVar1 = (*(code *)in_ECX[0xe])(0,0,0); in_ECX[0xf] = iVar1; *(int *)(in_EDX + 0x30) = iVar1; } return; } //@@ 00abd900 inflate_blocks /* DB: zlib (round 7 agent) */ void inflate_blocks(uint param_1) { byte bVar1; void *pvVar2; undefined4 *puVar3; int iVar4; int *piVar5; byte bVar6; uint *in_ECX; uint *puVar7; uint *puVar8; int *in_EDX; uint uVar9; uint uVar10; uint uVar11; uint uVar12; byte *pbVar13; uint uStack_44; undefined4 uStack_40; uint uStack_3c; uint uStack_38; uint uStack_34; uint uStack_30; uint *puStack_2c; uint uStack_28; int iStack_24; uint local_20; uint local_1c; uint local_18; byte *local_14; void *local_10; uint *local_c; int *local_8; local_18 = in_ECX[8]; local_10 = (void *)in_ECX[0xd]; uVar12 = in_ECX[7]; local_14 = (byte *)*in_EDX; if (local_10 < (void *)in_ECX[0xc]) { local_20 = (int)in_ECX[0xc] + (-1 - (int)local_10); } else { local_20 = in_ECX[0xb] - (int)local_10; } uVar9 = *in_ECX; uVar11 = in_EDX[1]; local_8 = in_EDX; puVar7 = in_ECX; while( true ) { local_c = puVar7; local_1c = uVar11; if (9 < uVar9) break; puVar8 = local_c; puVar7 = in_ECX; uVar9 = local_18; switch((&PTR_LAB_00abe4b8)[*local_c]) { case (undefined *)0xabd95a: pbVar13 = local_14; while( true ) { local_1c = uVar11; local_18 = uVar9; local_14 = pbVar13; if (2 < uVar12) break; local_c = in_ECX; if (uVar11 == 0) goto LAB_00abe260; bVar1 = *pbVar13; uVar11 = uVar11 - 1; pbVar13 = pbVar13 + 1; param_1 = 0; uVar9 = uVar9 | (uint)bVar1 << ((byte)uVar12 & 0x1f); uVar12 = uVar12 + 8; } uStack_3c = uVar9 & 7; in_ECX[6] = uVar9 & 1; switch(uStack_3c >> 1) { case 0: uVar11 = uVar12 - 3 & 7; local_18 = (uVar9 >> 3) >> (sbyte)uVar11; uVar12 = (uVar12 - 3) - uVar11; *in_ECX = 1; local_c = in_ECX; break; case 1: local_c = in_ECX; puVar3 = (undefined4 *)(*(code *)local_8[8])(local_8[10],1,0x1c); if (puVar3 == (undefined4 *)0x0) { local_c[1] = 0; LAB_00abe27b: local_c[8] = local_18; local_c[7] = uVar12; local_8[1] = uVar11; param_1 = 0xfffffffc; in_ECX = local_c; goto LAB_00abe242; } local_18 = local_18 >> 3; uVar12 = uVar12 - 3; *puVar3 = 0; *(undefined2 *)(puVar3 + 4) = 0x509; puVar3[5] = &DAT_00c5b058; puVar3[6] = &DAT_00c5c058; local_c[1] = (uint)puVar3; *local_c = 6; puVar7 = local_c; break; case 2: local_18 = uVar9 >> 3; uVar12 = uVar12 - 3; *in_ECX = 3; local_c = in_ECX; break; case 3: param_1 = 0xfffffffd; *in_ECX = 9; local_8[6] = (int)"invalid block type"; in_ECX[8] = uVar9 >> 3; in_ECX[7] = uVar12 - 3; local_8[1] = uVar11; goto LAB_00abe242; } break; case (undefined *)0xabda34: puVar7 = local_c; if (uVar12 < 0x20) { do { pbVar13 = local_14; local_c = in_ECX; if (local_1c == 0) goto LAB_00abe260; bVar1 = *local_14; bVar6 = (byte)uVar12; local_1c = local_1c - 1; local_14 = local_14 + 1; param_1 = 0; uVar12 = uVar12 + 8; uVar9 = uVar9 | (uint)bVar1 << (bVar6 & 0x1f); } while (uVar12 < 0x20); puVar7 = in_ECX; } uStack_30 = uVar9 & 0xffff; if (~uVar9 >> 0x10 != uStack_30) { *puVar7 = 9; param_1 = 0xfffffffd; local_8[6] = (int)"invalid stored block lengths"; puVar7[8] = uVar9; puVar7[7] = uVar12; local_8[1] = local_1c; in_ECX = puVar7; pbVar13 = local_14; goto LAB_00abe242; } uVar12 = 0; puVar7[1] = uStack_30; local_18 = 0; local_c = in_ECX; if (uStack_30 == 0) goto LAB_00abdba4; *puVar7 = 2; break; case (undefined *)0xabdaa2: if (uVar11 == 0) { local_c[8] = local_18; local_c[7] = uVar12; in_EDX[1] = 0; goto LAB_00abe23f; } puVar7 = local_c; if (local_20 == 0) { local_20 = 0; if ((local_10 == (void *)local_c[0xb]) && (pvVar2 = (void *)local_c[0xc], pvVar2 != (void *)local_c[10])) { local_10 = (void *)local_c[10]; if (local_10 < pvVar2) { local_20 = (int)pvVar2 + (-1 - (int)local_10); } else { local_20 = local_c[0xb] - (int)local_10; } if (local_20 != 0) goto LAB_00abdb60; } local_c[0xd] = (uint)local_10; local_c = in_ECX; param_1 = FUN_00ad41d0(param_1); local_10 = (void *)local_c[0xd]; pvVar2 = (void *)local_c[0xc]; if (local_10 < pvVar2) { local_20 = (int)pvVar2 + (-1 - (int)local_10); } else { local_20 = local_c[0xb] - (int)local_10; uVar11 = local_1c; } if ((local_10 == (void *)local_c[0xb]) && (pvVar2 != (void *)local_c[10])) { local_10 = (void *)local_c[10]; if (local_10 < pvVar2) { local_20 = (int)pvVar2 + (-1 - (int)local_10); uVar11 = local_1c; } else { local_20 = (int)local_c[0xb] - (int)local_10; uVar11 = local_1c; } } puVar7 = local_c; uStack_3c = param_1; in_ECX = local_c; if (local_20 == 0) { local_c[8] = local_18; local_c[7] = uVar12; local_8[1] = uVar11; pbVar13 = local_14; goto LAB_00abe242; } } LAB_00abdb60: local_c = in_ECX; param_1 = 0; uVar9 = uVar11; if (puVar7[1] <= uVar11) { uVar9 = puVar7[1]; } uVar10 = local_20; if (uVar9 <= local_20) { uVar10 = uVar9; } memcpy(local_10,local_14,uVar10); local_1c = uVar11 - uVar10; local_14 = local_14 + uVar10; local_10 = (void *)((int)local_10 + uVar10); local_20 = local_20 - uVar10; puVar8 = local_c + 1; *puVar8 = *puVar8 - uVar10; puVar7 = local_c; if (*puVar8 == 0) { LAB_00abdba4: *puVar7 = -(uint)(puVar7[6] != 0) & 7; } break; case (undefined *)0xabdbb5: if (uVar12 < 0xe) { do { uVar9 = local_18; pbVar13 = local_14; local_c = in_ECX; if (local_1c == 0) goto LAB_00abe260; bVar1 = *local_14; local_1c = local_1c - 1; local_14 = local_14 + 1; param_1 = 0; local_18 = local_18 | (uint)bVar1 << ((byte)uVar12 & 0x1f); uVar12 = uVar12 + 8; } while (uVar12 < 0xe); in_EDX = local_8; } pbVar13 = local_14; uVar11 = local_1c; local_20 = local_18 & 0x3fff; local_c[1] = local_20; uStack_3c = local_18 & 0x1f; if ((uStack_3c < 0x1e) && (local_20 = local_20 >> 5 & 0x1f, local_20 < 0x1e)) { local_c = in_ECX; uVar9 = (*(code *)in_EDX[8])(local_8[10],local_20 + uStack_3c + 0x102,4); local_c[3] = uVar9; if (uVar9 == 0) goto LAB_00abe27b; local_18 = local_18 >> 0xe; uVar12 = uVar12 - 0xe; local_c[2] = 0; *local_c = 4; puVar8 = local_c; in_ECX = local_c; goto LAB_00abdc69; } *local_c = 9; in_EDX[6] = (int)"too many length or distance symbols"; param_1 = 0xfffffffd; goto LAB_00abe236; case (undefined *)0xabdc69: LAB_00abdc69: local_c = in_ECX; pbVar13 = local_14; if (puVar8[2] < (puVar8[1] >> 10) + 4) { do { if (uVar12 < 3) { do { uVar9 = local_18; if (uVar11 == 0) goto LAB_00abe260; bVar1 = *pbVar13; uVar11 = uVar11 - 1; pbVar13 = pbVar13 + 1; param_1 = 0; local_18 = local_18 | (uint)bVar1 << ((byte)uVar12 & 0x1f); uVar12 = uVar12 + 8; local_1c = uVar11; local_14 = pbVar13; } while (uVar12 < 3); puVar8 = local_c; } uVar12 = uVar12 - 3; *(uint *)(local_c[3] + *(int *)(&DAT_00b5dd60 + puVar8[2] * 4) * 4) = local_18 & 7; local_18 = local_18 >> 3; local_c[2] = local_c[2] + 1; puVar8 = local_c; } while (local_c[2] < (local_c[1] >> 10) + 4); } uVar9 = puVar8[2]; while (uVar9 < 0x13) { *(undefined4 *)(local_c[3] + *(int *)(&DAT_00b5dd60 + puVar8[2] * 4) * 4) = 0; local_c[2] = local_c[2] + 1; puVar8 = local_c; uVar9 = local_c[2]; } puStack_2c = puVar8 + 4; uStack_3c = 0; *puStack_2c = 7; uStack_38 = puVar8[9]; uStack_34 = puVar8[3]; uStack_30 = (*(code *)local_8[8])(local_8[10],0x13,4); if (uStack_30 == 0) { local_20 = 0xfffffffc; LAB_00abe37d: local_c[8] = local_18; local_c[7] = uVar12; local_8[1] = uVar11; in_ECX = local_c; param_1 = local_20; goto LAB_00abe242; } local_20 = huft_build(0x13,0,0,local_c + 5,puStack_2c,uStack_38,&uStack_3c,uStack_30); if (local_20 == 0xfffffffd) { local_8[6] = (int)"oversubscribed dynamic bit lengths tree"; (*(code *)local_8[9])(local_8[10],uStack_30); LAB_00abe351: (*(code *)local_8[9])(local_8[10],local_c[3]); *local_c = 9; goto LAB_00abe37d; } if ((local_20 == 0xfffffffb) || (*puStack_2c == 0)) { local_8[6] = (int)"incomplete dynamic bit lengths tree"; (*(code *)local_8[9])(local_8[10],uStack_30); local_20 = 0xfffffffd; goto LAB_00abe351; } (*(code *)local_8[9])(local_8[10],uStack_30); if (local_20 != 0) goto LAB_00abe37d; local_c[2] = 0; *local_c = 5; puVar8 = local_c; in_ECX = local_c; LAB_00abddc6: local_c = in_ECX; uStack_28 = puVar8[1]; if (local_c[2] < (uStack_28 & 0x1f) + (uStack_28 >> 5 & 0x1f) + 0x102) { do { uStack_3c = local_c[4]; uVar9 = local_18; for (; uVar12 < uStack_3c; uVar12 = uVar12 + 8) { pbVar13 = local_14; if (uVar11 == 0) goto LAB_00abe260; uVar11 = uVar11 - 1; uVar9 = uVar9 | (uint)*local_14 << ((byte)uVar12 & 0x1f); param_1 = 0; local_14 = local_14 + 1; local_1c = uVar11; } bVar1 = *(byte *)(local_c[5] + 1 + (*(uint *)(&DAT_00b5f660 + uStack_3c * 4) & uVar9) * 8) ; local_20 = (uint)bVar1; uStack_30 = *(uint *)(local_c[5] + 4 + (*(uint *)(&DAT_00b5f660 + uStack_3c * 4) & uVar9) * 8); if (uStack_30 < 0x10) { uVar12 = uVar12 - local_20; *(uint *)(local_c[3] + local_c[2] * 4) = uStack_30; local_c[2] = local_c[2] + 1; local_20 = local_c[2]; local_18 = uVar9 >> (bVar1 & 0x1f); } else { if (uStack_30 == 0x12) { local_18 = 7; } else { local_18 = uStack_30 - 0xe; } iStack_24 = (uint)(uStack_30 == 0x12) * 8 + 3; if (uVar12 < local_18 + local_20) { do { pbVar13 = local_14; if (local_1c == 0) goto LAB_00abe260; local_1c = local_1c - 1; uVar9 = uVar9 | (uint)*local_14 << ((byte)uVar12 & 0x1f); param_1 = 0; local_14 = local_14 + 1; uVar12 = uVar12 + 8; } while (uVar12 < local_18 + local_20); } pbVar13 = local_14; uVar11 = local_1c; uVar9 = uVar9 >> (bVar1 & 0x1f); uVar10 = uVar9 >> ((byte)local_18 & 0x1f); iStack_24 = iStack_24 + (*(uint *)(&DAT_00b5f660 + local_18 * 4) & uVar9); uVar12 = uVar12 - (local_18 + local_20); local_20 = local_c[2]; local_18 = uVar10; if ((local_c[1] & 0x1f) + 0x102 + (local_c[1] >> 5 & 0x1f) < local_20 + iStack_24) { LAB_00abe394: (*(code *)local_8[9])(local_8[10],local_c[3]); *local_c = 9; local_8[6] = (int)"invalid bit length repeat"; local_c[8] = local_18; local_c[7] = uVar12; local_8[2] = (int)(pbVar13 + (local_8[2] - *local_8)); local_8[1] = uVar11; *local_8 = (int)pbVar13; local_c[0xd] = (uint)local_10; FUN_00ad41d0(0xfffffffd); return; } if (uStack_30 == 0x10) { if (local_20 == 0) goto LAB_00abe394; uStack_30 = *(uint *)((local_c[3] - 4) + local_20 * 4); } else { uStack_30 = 0; } iVar4 = iStack_24; do { *(uint *)(local_c[3] + local_20 * 4) = uStack_30; local_20 = local_20 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); local_c[2] = local_20; } uStack_28 = local_c[1]; uVar11 = local_1c; } while (local_20 < (uStack_28 & 0x1f) + (uStack_28 >> 5 & 0x1f) + 0x102); } pbVar13 = local_14; uStack_38 = local_c[9]; uStack_3c = local_c[3]; local_c[5] = 0; local_1c = (uStack_28 & 0x1f) + 0x101; puStack_2c = (uint *)&DAT_00000009; uStack_30 = 6; uStack_34 = 0; iStack_24 = (*(code *)local_8[8])(local_8[10],0x120,4); if (iStack_24 == 0) { uStack_28 = 0xfffffffc; LAB_00abe42b: local_c[8] = local_18; local_c[7] = uVar12; local_8[1] = uVar11; in_ECX = local_c; param_1 = uStack_28; goto LAB_00abe242; } local_20 = huft_build(0x101,&DAT_00b5f728,&DAT_00b5f6a8,&uStack_40,&puStack_2c,uStack_38, &uStack_34,iStack_24); if (local_20 == 0) { if (puStack_2c == (uint *)0x0) { LAB_00abe0f6: local_20 = 0xfffffffd; local_8[6] = (int)"incomplete literal/length tree"; goto LAB_00abe10c; } local_20 = huft_build(0,&DAT_00b5e3a8,&DAT_00b5f7a8,&uStack_44,&uStack_30,uStack_38, &uStack_34,iStack_24); if (local_20 != 0) { if (local_20 == 0xfffffffd) { local_8[6] = (int)"oversubscribed distance tree"; } else if (local_20 == 0xfffffffb) { local_20 = 0xfffffffd; local_8[6] = (int)"incomplete distance tree"; } else if (local_20 != 0xfffffffc) goto LAB_00abe0cd; goto LAB_00abe10c; } if ((uStack_30 == 0) && (0x101 < local_1c)) { LAB_00abe0cd: local_20 = 0xfffffffd; local_8[6] = (int)"empty distance tree with lengths"; goto LAB_00abe10c; } (*(code *)local_8[9])(local_8[10],iStack_24); } else { if (local_20 == 0xfffffffd) { local_8[6] = (int)"oversubscribed literal/length tree"; } else if (local_20 != 0xfffffffc) goto LAB_00abe0f6; LAB_00abe10c: (*(code *)local_8[9])(local_8[10],iStack_24); uStack_28 = local_20; if (local_20 != 0) { if (local_20 == 0xfffffffd) { (*(code *)local_8[9])(local_8[10],local_c[3]); *local_c = 9; } goto LAB_00abe42b; } } puVar3 = (undefined4 *)(*(code *)local_8[8])(local_8[10],1,0x1c); if (puVar3 == (undefined4 *)0x0) { local_c[8] = local_18; local_c[7] = uVar12; local_8[1] = uVar11; in_ECX = local_c; param_1 = 0xfffffffc; goto LAB_00abe242; } *(char *)(puVar3 + 4) = (char)puStack_2c; *(char *)((int)puVar3 + 0x11) = (char)uStack_30; puVar3[5] = uStack_40; *puVar3 = 0; puVar3[6] = uStack_44; local_c[1] = (uint)puVar3; (*(code *)local_8[9])(local_8[10],local_c[3]); *local_c = 6; in_EDX = local_8; puVar8 = local_c; in_ECX = local_c; LAB_00abe188: local_c = in_ECX; piVar5 = local_8; puVar8[8] = local_18; puVar8[7] = uVar12; in_EDX[1] = uVar11; local_8[2] = (int)(local_14 + (local_8[2] - *local_8)); *local_8 = (int)local_14; puVar8[0xd] = (uint)local_10; iVar4 = FUN_00ad3b30(param_1); if (iVar4 != 1) { FUN_00ad41d0(iVar4); return; } param_1 = 0; (*(code *)piVar5[9])(piVar5[10],local_c[1]); local_14 = (byte *)*piVar5; local_1c = piVar5[1]; local_18 = local_c[8]; uVar12 = local_c[7]; local_10 = (void *)local_c[0xd]; if (local_10 < (void *)local_c[0xc]) { local_20 = (int)local_c[0xc] + (-1 - (int)local_10); } else { local_20 = local_c[0xb] - (int)local_10; piVar5 = local_8; } if (local_c[6] == 0) { *local_c = 0; in_EDX = piVar5; puVar7 = local_c; goto LAB_00abe225; } *local_c = 7; puVar8 = local_c; in_ECX = local_c; LAB_00abe448: local_c = in_ECX; uVar11 = local_1c; puVar8[0xd] = (uint)local_10; uStack_44 = FUN_00ad41d0(param_1); local_10 = (void *)local_c[0xd]; if ((void *)local_c[0xc] != local_10) { local_c[8] = local_18; local_c[7] = uVar12; local_8[1] = uVar11; in_ECX = local_c; pbVar13 = local_14; param_1 = uStack_44; goto LAB_00abe242; } *local_c = 8; in_EDX = local_8; LAB_00abe4a7: param_1 = 1; goto LAB_00abe236; case (undefined *)0xabddc6: goto LAB_00abddc6; case (undefined *)0xabe188: goto LAB_00abe188; case (undefined *)0xabe448: goto LAB_00abe448; case (undefined *)0xabe4a7: goto LAB_00abe4a7; case (undefined *)0xabe4ae: param_1 = 0xfffffffd; goto LAB_00abe236; } in_EDX = local_8; LAB_00abe225: uVar9 = *puVar7; uVar11 = local_1c; in_ECX = local_c; } param_1 = 0xfffffffe; LAB_00abe236: local_c[8] = local_18; local_c[7] = uVar12; in_EDX[1] = uVar11; LAB_00abe23f: in_ECX = local_c; pbVar13 = local_14; LAB_00abe242: local_8[2] = (int)(pbVar13 + (local_8[2] - *local_8)); *local_8 = (int)pbVar13; in_ECX[0xd] = (uint)local_10; FUN_00ad41d0(param_1); return; LAB_00abe260: local_c[8] = uVar9; local_c[7] = uVar12; local_8[1] = 0; in_ECX = local_c; goto LAB_00abe242; } //@@ 00abe4f0 create_colormap /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jquant1.c: ECX cinfo: select_ncolors inlined (RGB order tables DAT_00b5ddb8/df00/df50, iroot search over desired_number_of_colors, JERR_QUANT_FEW_COLORS 0x3a), trace message, alloc_sarray colormap for out_color_components and fills output_value steps into cquantize (cinfo+0x1b8 / [0x6e]) +0x24 Ncolors; called from libjpeg_jinit_master_decompress */ void create_colormap(void) { int iVar1; bool bVar2; int iVar3; int iVar4; int iVar5; int *in_ECX; int iVar6; int iVar7; int iVar8; int iVar9; int *piVar10; int iVar11; int local_38; int local_34; int local_28; int *local_20; int local_1c; int local_14 [4]; local_14[3] = __security_cookie ^ (uint)(local_14 + 4); iVar9 = in_ECX[0xb]; iVar1 = in_ECX[0x6e]; iVar4 = in_ECX[0x19]; iVar11 = in_ECX[0x15]; local_20 = (int *)(iVar1 + 0x24); local_14[0] = *(int *)(&DAT_00b5ddb8 + iVar9 * 4); local_14[1] = *(undefined4 *)(&DAT_00b5df00 + iVar9 * 4); local_14[2] = *(undefined4 *)(&DAT_00b5df50 + iVar9 * 4); iVar9 = 1; do { iVar8 = iVar9; iVar9 = iVar8 + 1; iVar6 = iVar9; if (1 < iVar4) { iVar3 = iVar4 + -1; do { iVar6 = iVar6 * iVar9; iVar3 = iVar3 + -1; } while (iVar3 != 0); } } while (iVar6 <= iVar11); if (iVar8 < 2) { *(undefined4 *)(*in_ECX + 0x14) = 0x3a; *(int *)(*in_ECX + 0x18) = iVar6; (**(code **)*in_ECX)(); } iVar9 = 1; local_1c = 1; if (0 < iVar4) { piVar10 = local_20; for (iVar6 = iVar4; iVar3 = iVar4, iVar6 != 0; iVar6 = iVar6 + -1) { *piVar10 = iVar8; piVar10 = piVar10 + 1; } do { iVar9 = iVar9 * iVar8; iVar3 = iVar3 + -1; } while (iVar3 != 0); local_1c = iVar9; } do { iVar9 = 0; bVar2 = false; if (iVar4 < 1) { LAB_00abe60e: iVar9 = *in_ECX; if (in_ECX[0x19] == 3) { *(int *)(iVar9 + 0x18) = local_1c; *(int *)(iVar9 + 0x1c) = *local_20; *(undefined4 *)(iVar9 + 0x20) = *(undefined4 *)(iVar1 + 0x28); *(undefined4 *)(iVar9 + 0x24) = *(undefined4 *)(iVar1 + 0x2c); *(undefined4 *)(*in_ECX + 0x14) = 0x60; } else { *(undefined4 *)(iVar9 + 0x14) = 0x61; *(int *)(*in_ECX + 0x18) = local_1c; } (**(code **)(*in_ECX + 4))(in_ECX,1); iVar4 = (**(code **)(in_ECX[1] + 8))(in_ECX,1,local_1c,in_ECX[0x19]); iVar11 = 0; iVar9 = local_1c; if (in_ECX[0x19] < 1) { *(int *)(iVar1 + 0x14) = iVar4; *(int *)(iVar1 + 0x18) = local_1c; return; } do { local_38 = *local_20; iVar6 = iVar9 / local_38; if (0 < local_38) { iVar8 = local_38 + -1; local_34 = 0; local_28 = 0; do { for (iVar3 = local_34; iVar3 < local_1c; iVar3 = iVar3 + iVar9) { iVar7 = 0; if (0 < iVar6) { do { iVar5 = *(int *)(iVar4 + iVar11 * 4) + iVar7; iVar7 = iVar7 + 1; *(char *)(iVar5 + iVar3) = (char)((local_28 + iVar8 / 2) / iVar8); } while (iVar7 < iVar6); } } local_34 = local_34 + iVar6; local_28 = local_28 + 0xff; local_38 = local_38 + -1; } while (local_38 != 0); } iVar11 = iVar11 + 1; local_20 = local_20 + 1; iVar9 = iVar6; } while (iVar11 < in_ECX[0x19]); *(int *)(iVar1 + 0x14) = iVar4; *(int *)(iVar1 + 0x18) = local_1c; return; } do { if (in_ECX[0xb] == 2) { iVar6 = local_14[iVar9]; } else { iVar6 = iVar9; } iVar3 = local_20[iVar6]; iVar8 = iVar3 + 1; iVar3 = (local_1c / iVar3) * iVar8; if (iVar11 < iVar3) { if (!bVar2) goto LAB_00abe60e; break; } local_20[iVar6] = iVar8; iVar9 = iVar9 + 1; bVar2 = true; local_1c = iVar3; } while (iVar9 < iVar4); } while( true ); } //@@ 00abe750 create_colorindex /* DB: libjpeg jquant1.c: ECX cinfo, cquantize at cinfo+0x1b8: is_padded = (dither_mode == JDITHER_ORDERED, cinfo+0x4c == 1), allocates colorindex (+0x1c) via alloc_sarray (+0xff padding per row when padded), fills per component with largest_input_value steps (nci*2-2, 0x1fe increments); callers libjpeg_jinit_master_decompress (inlined jinit_1pass_quantizer) and FUN_00abedc0 */ void create_colorindex(void) { int *piVar1; int iVar2; int iVar3; int iVar4; undefined1 *puVar5; undefined4 uVar6; int iVar7; int iVar8; int in_ECX; int iVar9; int iVar10; undefined1 *puVar11; int iVar12; int iVar13; int local_c; iVar3 = *(int *)(in_ECX + 0x4c); iVar4 = *(int *)(in_ECX + 0x1b8); *(bool *)(iVar4 + 0x20) = iVar3 == 1; uVar6 = (**(code **)(*(int *)(in_ECX + 4) + 8))(); *(undefined4 *)(iVar4 + 0x1c) = uVar6; iVar7 = *(int *)(iVar4 + 0x18); local_c = 0; if (0 < *(int *)(in_ECX + 100)) { do { iVar10 = *(int *)(iVar4 + 0x24 + local_c * 4); iVar7 = iVar7 / iVar10; if (iVar3 == 1) { piVar1 = (int *)(*(int *)(iVar4 + 0x1c) + local_c * 4); *piVar1 = *piVar1 + 0xff; } iVar2 = iVar10 * 2 + -2; puVar5 = *(undefined1 **)(*(int *)(iVar4 + 0x1c) + local_c * 4); iVar12 = 0; iVar8 = (iVar10 + 0xfe) / iVar2; iVar13 = 0; do { if (iVar8 < iVar13) { iVar9 = iVar10 + 0xfe + iVar12 * 0x1fe; do { iVar9 = iVar9 + 0x1fe; iVar12 = iVar12 + 1; iVar8 = iVar9 / iVar2; } while (iVar8 < iVar13); } puVar5[iVar13] = (char)iVar7 * (char)iVar12; iVar13 = iVar13 + 1; } while (iVar13 < 0x100); if (iVar3 == 1) { iVar10 = 1; puVar11 = puVar5; do { puVar11 = puVar11 + -1; *puVar11 = *puVar5; puVar5[iVar10 + 0xff] = puVar5[0xff]; iVar10 = iVar10 + 1; } while (iVar10 < 0x100); } local_c = local_c + 1; } while (local_c < *(int *)(in_ECX + 100)); } return; } //@@ 00abe890 FUN_00abe890 void FUN_00abe890(int param_1,int param_2,int *param_3,int param_4) { int iVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; char *pcVar7; int iVar8; char cVar9; byte *pbVar10; iVar3 = *(int *)(param_1 + 0x5c); iVar4 = *(int *)(param_1 + 100); iVar5 = *(int *)(*(int *)(param_1 + 0x1b8) + 0x1c); if (0 < param_4) { param_2 = param_2 - (int)param_3; do { pbVar10 = *(byte **)(param_2 + (int)param_3); pcVar7 = (char *)*param_3; for (iVar8 = iVar3; iVar8 != 0; iVar8 = iVar8 + -1) { cVar9 = '\0'; iVar6 = 0; if (0 < iVar4) { do { bVar2 = *pbVar10; pbVar10 = pbVar10 + 1; iVar1 = iVar6 * 4; iVar6 = iVar6 + 1; cVar9 = cVar9 + *(char *)(*(int *)(iVar5 + iVar1) + (uint)bVar2); } while (iVar6 < iVar4); } *pcVar7 = cVar9; pcVar7 = pcVar7 + 1; } param_3 = param_3 + 1; param_4 = param_4 + -1; } while (param_4 != 0); } return; } //@@ 00abe930 FUN_00abe930 void FUN_00abe930(int param_1,int param_2,int *param_3,int param_4) { int iVar1; int iVar2; int *piVar3; int iVar4; int iVar5; int iVar6; byte *pbVar7; char *pcVar8; iVar2 = *(int *)(param_1 + 0x5c); piVar3 = *(int **)(*(int *)(param_1 + 0x1b8) + 0x1c); iVar4 = *piVar3; iVar5 = piVar3[1]; iVar6 = piVar3[2]; if (0 < param_4) { param_2 = param_2 - (int)param_3; do { pbVar7 = *(byte **)(param_2 + (int)param_3); pcVar8 = (char *)*param_3; for (iVar1 = iVar2; iVar1 != 0; iVar1 = iVar1 + -1) { *pcVar8 = *(char *)((uint)*pbVar7 + iVar4) + *(char *)((uint)pbVar7[1] + iVar5) + *(char *)((uint)pbVar7[2] + iVar6); pbVar7 = pbVar7 + 3; pcVar8 = pcVar8 + 1; } param_3 = param_3 + 1; param_4 = param_4 + -1; } while (param_4 != 0); } return; } //@@ 00abe9d0 FUN_00abe9d0 void FUN_00abe9d0(int param_1,int param_2,undefined4 *param_3,int param_4) { int iVar1; byte bVar2; int iVar3; int iVar4; size_t _Size; int iVar5; int iVar6; int iVar7; uint uVar8; size_t sVar9; char *pcVar10; byte *pbVar11; int local_c; iVar3 = *(int *)(param_1 + 0x1b8); iVar4 = *(int *)(param_1 + 100); _Size = *(size_t *)(param_1 + 0x5c); if (0 < param_4) { param_2 = param_2 - (int)param_3; do { memset((void *)*param_3,0,_Size); local_c = 0; iVar5 = *(int *)(iVar3 + 0x34); if (0 < iVar4) { do { pbVar11 = (byte *)(*(int *)(param_2 + (int)param_3) + local_c); iVar6 = *(int *)(iVar3 + 0x38 + local_c * 4); iVar7 = *(int *)(*(int *)(iVar3 + 0x1c) + local_c * 4); uVar8 = 0; if (_Size != 0) { sVar9 = _Size; pcVar10 = (char *)*param_3; do { iVar1 = uVar8 * 4; bVar2 = *pbVar11; pbVar11 = pbVar11 + iVar4; uVar8 = uVar8 + 1 & 0xf; *pcVar10 = *pcVar10 + *(char *)(*(int *)(iVar6 + iVar5 * 0x40 + iVar1) + (uint)bVar2 + iVar7); sVar9 = sVar9 - 1; pcVar10 = pcVar10 + 1; } while (sVar9 != 0); } local_c = local_c + 1; } while (local_c < iVar4); } param_3 = param_3 + 1; param_4 = param_4 + -1; *(uint *)(iVar3 + 0x34) = iVar5 + 1U & 0xf; } while (param_4 != 0); } return; } //@@ 00abeac0 FUN_00abeac0 void FUN_00abeac0(char *param_1,int param_2,undefined4 *param_3,int param_4) { int iVar1; int iVar2; int iVar3; int iVar4; int *piVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; byte *pbVar13; int iVar14; uint uVar15; uint local_c; int local_8; iVar4 = *(int *)((int)param_1 + 0x1b8); piVar5 = *(int **)(iVar4 + 0x1c); iVar6 = *piVar5; iVar7 = piVar5[1]; iVar8 = piVar5[2]; iVar9 = *(int *)((int)param_1 + 0x5c); if (0 < param_4) { param_2 = param_2 - (int)param_3; local_c = *(uint *)(iVar4 + 0x34); do { param_1 = (char *)*param_3; iVar10 = *(int *)(iVar4 + 0x38); iVar11 = *(int *)(iVar4 + 0x3c); iVar14 = local_c * 0x40; iVar12 = *(int *)(iVar4 + 0x40); if (iVar9 != 0) { uVar15 = 0; pbVar13 = *(byte **)(param_2 + (int)param_3); local_8 = iVar9; do { iVar1 = uVar15 * 4; iVar2 = uVar15 * 4; iVar3 = uVar15 * 4; uVar15 = uVar15 + 1 & 0xf; *param_1 = *(char *)(*(int *)(iVar11 + iVar14 + iVar1) + (uint)pbVar13[1] + iVar7) + *(char *)(*(int *)(iVar12 + iVar14 + iVar2) + (uint)pbVar13[2] + iVar8) + *(char *)(*(int *)(iVar10 + iVar14 + iVar3) + (uint)*pbVar13 + iVar6); param_1 = param_1 + 1; local_8 = local_8 + -1; pbVar13 = pbVar13 + 3; } while (local_8 != 0); } local_c = local_c + 1 & 0xf; param_3 = param_3 + 1; param_4 = param_4 + -1; *(uint *)(iVar4 + 0x34) = local_c; } while (param_4 != 0); } return; } //@@ 00abebd0 FUN_00abebd0 void FUN_00abebd0(short *param_1,int param_2,undefined4 *param_3,int param_4) { short *psVar1; int iVar2; byte bVar3; int iVar4; int iVar5; size_t _Size; int iVar6; int iVar7; byte *pbVar8; int iVar9; char *pcVar10; uint uVar11; int iVar12; int local_24; size_t local_20; int local_1c; int local_14; int local_10; int local_c; iVar4 = *(int *)((int)param_1 + 0x1b8); iVar5 = *(int *)((int)param_1 + 100); _Size = *(size_t *)((int)param_1 + 0x5c); iVar6 = *(int *)((int)param_1 + 0x124); if (0 < param_4) { param_2 = param_2 - (int)param_3; do { memset((void *)*param_3,0,_Size); local_24 = 0; if (0 < iVar5) { do { pcVar10 = (char *)*param_3; iVar2 = local_24 * 4; pbVar8 = (byte *)(*(int *)(param_2 + (int)param_3) + local_24); if (*(char *)(iVar4 + 0x58) == '\0') { param_1 = *(short **)(iVar4 + 0x48 + iVar2); local_c = 1; local_1c = iVar5; } else { local_c = -1; pcVar10 = pcVar10 + (_Size - 1); pbVar8 = pbVar8 + (_Size - 1) * iVar5; param_1 = (short *)(*(int *)(iVar4 + 0x48 + iVar2) + 2 + _Size * 2); local_1c = -iVar5; } iVar7 = *(int *)(iVar2 + *(int *)(iVar4 + 0x1c)); iVar2 = *(int *)(iVar2 + *(int *)(iVar4 + 0x14)); iVar9 = 0; local_10 = 0; local_10._0_2_ = 0; local_14 = 0; if (_Size != 0) { local_20 = _Size; do { psVar1 = param_1 + local_c; bVar3 = *pbVar8; pbVar8 = pbVar8 + local_1c; uVar11 = (uint)*(byte *)((uint)bVar3 + (iVar9 + *psVar1 + 8 >> 4) + iVar6); bVar3 = *(byte *)(uVar11 + iVar7); *pcVar10 = *pcVar10 + bVar3; pcVar10 = pcVar10 + local_c; iVar12 = uVar11 - *(byte *)((uint)bVar3 + iVar2); *param_1 = (short)iVar12 * 3 + (short)local_10; iVar9 = iVar12 * 7; local_10 = local_14 + iVar12 * 5; local_20 = local_20 - 1; param_1 = psVar1; local_14 = iVar12; } while (local_20 != 0); } *param_1 = (short)local_10; local_24 = local_24 + 1; } while (local_24 < iVar5); } *(bool *)(iVar4 + 0x58) = *(char *)(iVar4 + 0x58) == '\0'; param_3 = param_3 + 1; param_4 = param_4 + -1; } while (param_4 != 0); } return; } //@@ 00abed70 FUN_00abed70 void FUN_00abed70(void) { undefined4 uVar1; int in_ECX; int iVar2; undefined4 *puVar3; iVar2 = 0; if (0 < *(int *)(in_ECX + 100)) { puVar3 = (undefined4 *)(*(int *)(in_ECX + 0x1b8) + 0x48); do { uVar1 = (**(code **)(*(int *)(in_ECX + 4) + 4))(); *puVar3 = uVar1; iVar2 = iVar2 + 1; puVar3 = puVar3 + 1; } while (iVar2 < *(int *)(in_ECX + 100)); } return; } //@@ 00abedc0 FUN_00abedc0 void FUN_00abedc0(int *param_1) { byte bVar1; int iVar2; code *pcVar3; int iVar4; byte *pbVar5; int *piVar6; int *piVar7; int iVar8; int *local_c; int local_8; iVar2 = param_1[0x6e]; param_1[0x1d] = *(int *)(iVar2 + 0x14); param_1[0x1c] = *(int *)(iVar2 + 0x18); iVar8 = param_1[0x13]; if (iVar8 == 0) { pcVar3 = FUN_00abe890; if (param_1[0x19] == 3) { pcVar3 = FUN_00abe930; } *(code **)(iVar2 + 4) = pcVar3; return; } if (iVar8 == 1) { pcVar3 = FUN_00abeac0; if (param_1[0x19] != 3) { pcVar3 = FUN_00abe9d0; } *(code **)(iVar2 + 4) = pcVar3; *(undefined4 *)(iVar2 + 0x34) = 0; if (*(char *)(iVar2 + 0x20) == '\0') { create_colorindex(); } if (*(int *)(iVar2 + 0x38) == 0) { iVar2 = param_1[0x6e]; local_8 = 0; if (0 < param_1[0x19]) { local_c = (int *)(iVar2 + 0x38); do { iVar8 = local_c[-5]; iVar4 = 0; if (0 < local_8) { piVar6 = (int *)(iVar2 + 0x24); do { if (iVar8 == *piVar6) { piVar6 = *(int **)(iVar2 + 0x38 + iVar4 * 4); if (piVar6 != (int *)0x0) goto LAB_00abef37; break; } iVar4 = iVar4 + 1; piVar6 = piVar6 + 1; } while (iVar4 < local_8); } piVar6 = (int *)(**(code **)param_1[1])(param_1,1,0x400); pbVar5 = &DAT_00b5de00; piVar7 = piVar6; do { iVar4 = 0x10; do { bVar1 = *pbVar5; pbVar5 = pbVar5 + 1; *piVar7 = (int)((uint)bVar1 * -0x1fe + 0xfe01) / (iVar8 * 0x200 + -0x200); piVar7 = piVar7 + 1; iVar4 = iVar4 + -1; } while (iVar4 != 0); } while ((int)pbVar5 < 0xb5df00); LAB_00abef37: local_8 = local_8 + 1; *local_c = (int)piVar6; local_c = local_c + 1; if (param_1[0x19] <= local_8) { return; } } while( true ); } } } else if (iVar8 == 2) { *(code **)(iVar2 + 4) = FUN_00abebd0; *(undefined1 *)(iVar2 + 0x58) = 0; piVar6 = (int *)(iVar2 + 0x48); if (*piVar6 == 0) { FUN_00abed70(); } iVar2 = param_1[0x17]; iVar8 = 0; if (0 < param_1[0x19]) { do { memset((void *)*piVar6,0,iVar2 * 2 + 4); piVar6 = piVar6 + 1; iVar8 = iVar8 + 1; } while (iVar8 < param_1[0x19]); return; } } else { *(undefined4 *)(*param_1 + 0x14) = 0x31; (**(code **)*param_1)(param_1); } return; } //@@ 00abef70 FUN_00abef70 void FUN_00abef70(int *param_1) { *(undefined4 *)(*param_1 + 0x14) = 0x2f; /* WARNING: Could not recover jumptable at 0x00abef87. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)*param_1)(); return; } //@@ 00abef90 extrgb_h2v2_merged_upsample_internal /* DB: libjpeg-turbo jdmrgext.c (RGB_RED=0, pixel size 3): two Y rows to two output rows, writes [0..2],[3..5] per pixel pair; called from two cases of the h2v2_merged_upsample dispatcher (JCS_EXT_RGB and default JCS_RGB, ICF) */ void extrgb_h2v2_merged_upsample_internal(undefined1 *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int in_ECX; int *in_EDX; uint uVar9; int iVar10; int iVar11; byte *pbVar12; byte *pbVar13; uint local_18; byte *local_c; byte *local_8; iVar3 = *(int *)(in_ECX + 0x1b0); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x18); iVar6 = *(int *)(iVar3 + 0x1c); iVar11 = *(int *)(iVar3 + 0x20); iVar3 = *(int *)(iVar3 + 0x24); local_8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar12 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); param_1 = (undefined1 *)*param_2; param_2 = (undefined4 *)param_2[1]; uVar9 = *(uint *)(in_ECX + 0x5c); local_18 = uVar9 >> 1; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; iVar7 = *(int *)(iVar5 + (uint)bVar1 * 4); iVar10 = *(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar11 + (uint)bVar1 * 4) >> 0x10; iVar8 = *(int *)(iVar6 + (uint)bVar2 * 4); uVar9 = (uint)*local_8; *param_1 = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar8 + iVar4); uVar9 = (uint)local_8[1]; local_8 = local_8 + 2; param_1[3] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[4] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[5] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1 = param_1 + 6; uVar9 = (uint)*local_c; *(undefined1 *)param_2 = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar8 + iVar4); uVar9 = (uint)local_c[1]; local_c = local_c + 2; *(undefined1 *)((int)param_2 + 3) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 4) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 5) = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_2 = (undefined4 *)((int)param_2 + 6); local_18 = local_18 - 1; } while (local_18 != 0); uVar9 = *(uint *)(in_ECX + 0x5c); } if ((uVar9 & 1) != 0) { iVar5 = *(int *)(iVar5 + (uint)*pbVar13 * 4); iVar11 = *(int *)(iVar3 + (uint)*pbVar12 * 4) + *(int *)(iVar11 + (uint)*pbVar13 * 4) >> 0x10; iVar3 = *(int *)(iVar6 + (uint)*pbVar12 * 4); uVar9 = (uint)*local_8; *param_1 = *(undefined1 *)(uVar9 + iVar5 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar11 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar3 + iVar4); uVar9 = (uint)*local_c; *(undefined1 *)param_2 = *(undefined1 *)(iVar5 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar11 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar3 + iVar4); } return; } //@@ 00abf1a0 extrgbx_h2v2_merged_upsample_internal /* DB: libjpeg-turbo jdmrgext.c instance writing 4-byte R,G,B,0xff pixels: ECX=cinfo (upsample +0x1b0 Cr_r/Cb_b/Cr_g/Cb_g tables +0x18..+0x24, range_limit +0x124, output_width +0x5c), EDX=input_buf (two Y rows per call = h2v2); called from the out_color_space dispatcher at ac0754 */ void extrgbx_h2v2_merged_upsample_internal(undefined1 *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int in_ECX; int *in_EDX; uint uVar9; int iVar10; int iVar11; byte *pbVar12; byte *pbVar13; uint local_18; byte *local_c; byte *local_8; iVar3 = *(int *)(in_ECX + 0x1b0); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x18); iVar6 = *(int *)(iVar3 + 0x1c); iVar11 = *(int *)(iVar3 + 0x20); iVar3 = *(int *)(iVar3 + 0x24); local_8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar12 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); param_1 = (undefined1 *)*param_2; param_2 = (undefined4 *)param_2[1]; uVar9 = *(uint *)(in_ECX + 0x5c); local_18 = uVar9 >> 1; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; iVar7 = *(int *)(iVar5 + (uint)bVar1 * 4); iVar10 = *(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar11 + (uint)bVar1 * 4) >> 0x10; iVar8 = *(int *)(iVar6 + (uint)bVar2 * 4); uVar9 = (uint)*local_8; *param_1 = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1[3] = 0xff; uVar9 = (uint)local_8[1]; local_8 = local_8 + 2; param_1[4] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[5] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[6] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1[7] = 0xff; param_1 = param_1 + 8; uVar9 = (uint)*local_c; *(undefined1 *)param_2 = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)((int)param_2 + 3) = 0xff; uVar9 = (uint)local_c[1]; local_c = local_c + 2; *(undefined1 *)((int)param_2 + 4) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 5) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 6) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)((int)param_2 + 7) = 0xff; param_2 = (undefined4 *)((int)param_2 + 8); local_18 = local_18 - 1; } while (local_18 != 0); uVar9 = *(uint *)(in_ECX + 0x5c); } if ((uVar9 & 1) != 0) { iVar5 = *(int *)(iVar5 + (uint)*pbVar13 * 4); iVar11 = *(int *)(iVar3 + (uint)*pbVar12 * 4) + *(int *)(iVar11 + (uint)*pbVar13 * 4) >> 0x10; iVar3 = *(int *)(iVar6 + (uint)*pbVar12 * 4); uVar9 = (uint)*local_8; *param_1 = *(undefined1 *)(uVar9 + iVar5 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar11 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar3 + iVar4); param_1[3] = 0xff; uVar9 = (uint)*local_c; *(undefined1 *)param_2 = *(undefined1 *)(iVar5 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar11 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar3 + iVar4); *(undefined1 *)((int)param_2 + 3) = 0xff; } return; } //@@ 00abf3c0 h2v2_merged_upsample /* DB: libjpeg jdmerge.c: cinfo->upsample (+0x1b0) Cr_r/Cb_b/Cr_g/Cb_g tables at +0x18..+0x24, sample_range_limit (+0x124), two Y rows -> two output rows, output_width (+0x5c)/2 pairs; only caller FUN_00abfd50 (merged_2v_upsample) */ void h2v2_merged_upsample(undefined1 *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int in_ECX; int *in_EDX; uint uVar9; int iVar10; int iVar11; byte *pbVar12; byte *pbVar13; uint local_18; byte *local_c; byte *local_8; iVar3 = *(int *)(in_ECX + 0x1b0); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x18); iVar6 = *(int *)(iVar3 + 0x1c); iVar11 = *(int *)(iVar3 + 0x20); iVar3 = *(int *)(iVar3 + 0x24); local_8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar12 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); param_1 = (undefined1 *)*param_2; param_2 = (undefined4 *)param_2[1]; uVar9 = *(uint *)(in_ECX + 0x5c); local_18 = uVar9 >> 1; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; iVar7 = *(int *)(iVar5 + (uint)bVar1 * 4); iVar10 = *(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar11 + (uint)bVar1 * 4) >> 0x10; iVar8 = *(int *)(iVar6 + (uint)bVar2 * 4); uVar9 = (uint)*local_8; param_1[2] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar10 + iVar4); *param_1 = *(undefined1 *)(uVar9 + iVar8 + iVar4); uVar9 = (uint)local_8[1]; local_8 = local_8 + 2; param_1[5] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[4] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[3] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1 = param_1 + 6; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)param_2 = *(undefined1 *)(uVar9 + iVar8 + iVar4); uVar9 = (uint)local_c[1]; local_c = local_c + 2; *(undefined1 *)((int)param_2 + 5) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 4) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 3) = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_2 = (undefined4 *)((int)param_2 + 6); local_18 = local_18 - 1; } while (local_18 != 0); uVar9 = *(uint *)(in_ECX + 0x5c); } if ((uVar9 & 1) != 0) { iVar5 = *(int *)(iVar5 + (uint)*pbVar13 * 4); iVar11 = *(int *)(iVar3 + (uint)*pbVar12 * 4) + *(int *)(iVar11 + (uint)*pbVar13 * 4) >> 0x10; iVar3 = *(int *)(iVar6 + (uint)*pbVar12 * 4); uVar9 = (uint)*local_8; param_1[2] = *(undefined1 *)(uVar9 + iVar5 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar11 + iVar4); *param_1 = *(undefined1 *)(uVar9 + iVar3 + iVar4); uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(iVar5 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar11 + iVar4); *(undefined1 *)param_2 = *(undefined1 *)(uVar9 + iVar3 + iVar4); } return; } //@@ 00abf5d0 libjpeg_h2v2_merged_upsample /* DB: libjpeg jdmerge.c h2v2_merged_upsample: upsample tables Cr_r/Cb_b/Cr_g/Cb_g at upsample+0x18..0x24, two luma rows input_buf[0][2*ctr], [2*ctr+1], chroma rows [1]/[2][ctr], output_width>>1 pixel pairs into output_buf[0]/[1] through range_limit */ void libjpeg_h2v2_merged_upsample(undefined1 *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int in_ECX; int *in_EDX; uint uVar9; int iVar10; int iVar11; byte *pbVar12; byte *pbVar13; uint local_18; byte *local_c; byte *local_8; iVar3 = *(int *)(in_ECX + 0x1b0); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x18); iVar6 = *(int *)(iVar3 + 0x1c); iVar11 = *(int *)(iVar3 + 0x20); iVar3 = *(int *)(iVar3 + 0x24); local_8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar12 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); param_1 = (undefined1 *)*param_2; param_2 = (undefined4 *)param_2[1]; uVar9 = *(uint *)(in_ECX + 0x5c); local_18 = uVar9 >> 1; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; iVar7 = *(int *)(iVar5 + (uint)bVar1 * 4); iVar10 = *(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar11 + (uint)bVar1 * 4) >> 0x10; iVar8 = *(int *)(iVar6 + (uint)bVar2 * 4); uVar9 = (uint)*local_8; param_1[2] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar10 + iVar4); *param_1 = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1[3] = 0xff; uVar9 = (uint)local_8[1]; local_8 = local_8 + 2; param_1[6] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[5] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[4] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1[7] = 0xff; param_1 = param_1 + 8; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)param_2 = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)((int)param_2 + 3) = 0xff; uVar9 = (uint)local_c[1]; local_c = local_c + 2; *(undefined1 *)((int)param_2 + 6) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 5) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 4) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)((int)param_2 + 7) = 0xff; param_2 = (undefined4 *)((int)param_2 + 8); local_18 = local_18 - 1; } while (local_18 != 0); uVar9 = *(uint *)(in_ECX + 0x5c); } if ((uVar9 & 1) != 0) { iVar5 = *(int *)(iVar5 + (uint)*pbVar13 * 4); iVar11 = *(int *)(iVar3 + (uint)*pbVar12 * 4) + *(int *)(iVar11 + (uint)*pbVar13 * 4) >> 0x10; iVar3 = *(int *)(iVar6 + (uint)*pbVar12 * 4); uVar9 = (uint)*local_8; param_1[2] = *(undefined1 *)(uVar9 + iVar5 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar11 + iVar4); *param_1 = *(undefined1 *)(uVar9 + iVar3 + iVar4); param_1[3] = 0xff; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(iVar5 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar11 + iVar4); *(undefined1 *)param_2 = *(undefined1 *)(uVar9 + iVar3 + iVar4); *(undefined1 *)((int)param_2 + 3) = 0xff; } return; } //@@ 00abf7f0 extxbgr_h2v2_merged_upsample_internal /* DB: libjpeg-turbo jdmrgext.c: called only from the h2v2_merged_upsample color-space switch at LAB_00ac0720 (set by jinit_merged_upsampler 00ac1280 jinit_merged_upsampler max_v_samp_factor 2); two luma rows, writes 0xff then B,G,R... (byte 3 = y + Cr_r), i.e. XBGR/ABGR */ void extxbgr_h2v2_merged_upsample_internal(undefined1 *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int in_ECX; int *in_EDX; uint uVar9; int iVar10; int iVar11; byte *pbVar12; byte *pbVar13; uint local_18; byte *local_c; byte *local_8; iVar3 = *(int *)(in_ECX + 0x1b0); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x18); iVar6 = *(int *)(iVar3 + 0x1c); iVar11 = *(int *)(iVar3 + 0x20); iVar3 = *(int *)(iVar3 + 0x24); local_8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar12 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); param_1 = (undefined1 *)*param_2; param_2 = (undefined4 *)param_2[1]; uVar9 = *(uint *)(in_ECX + 0x5c); local_18 = uVar9 >> 1; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; iVar7 = *(int *)(iVar5 + (uint)bVar1 * 4); iVar10 = *(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar11 + (uint)bVar1 * 4) >> 0x10; iVar8 = *(int *)(iVar6 + (uint)bVar2 * 4); uVar9 = (uint)*local_8; param_1[3] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar8 + iVar4); *param_1 = 0xff; uVar9 = (uint)local_8[1]; local_8 = local_8 + 2; param_1[7] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[6] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[5] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1[4] = 0xff; param_1 = param_1 + 8; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 3) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)param_2 = 0xff; uVar9 = (uint)local_c[1]; local_c = local_c + 2; *(undefined1 *)((int)param_2 + 7) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 6) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 5) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)((int)param_2 + 4) = 0xff; param_2 = (undefined4 *)((int)param_2 + 8); local_18 = local_18 - 1; } while (local_18 != 0); uVar9 = *(uint *)(in_ECX + 0x5c); } if ((uVar9 & 1) != 0) { iVar5 = *(int *)(iVar5 + (uint)*pbVar13 * 4); iVar11 = *(int *)(iVar3 + (uint)*pbVar12 * 4) + *(int *)(iVar11 + (uint)*pbVar13 * 4) >> 0x10; iVar3 = *(int *)(iVar6 + (uint)*pbVar12 * 4); uVar9 = (uint)*local_8; param_1[3] = *(undefined1 *)(uVar9 + iVar5 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar11 + iVar4); param_1[1] = *(undefined1 *)(uVar9 + iVar3 + iVar4); *param_1 = 0xff; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 3) = *(undefined1 *)(iVar5 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar11 + iVar4); *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(uVar9 + iVar3 + iVar4); *(undefined1 *)param_2 = 0xff; } return; } //@@ 00abfa10 extxrgb_h2v2_merged_upsample_internal /* DB: libjpeg-turbo jdmrgext.c (alpha 0xff at [0], RGB at [1..3], pixel size 4): XRGB/ARGB case of the h2v2_merged_upsample dispatcher (00ac07a0) */ void extxrgb_h2v2_merged_upsample_internal(undefined1 *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int in_ECX; int *in_EDX; uint uVar9; int iVar10; int iVar11; byte *pbVar12; byte *pbVar13; uint local_18; byte *local_c; byte *local_8; iVar3 = *(int *)(in_ECX + 0x1b0); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x18); iVar6 = *(int *)(iVar3 + 0x1c); iVar11 = *(int *)(iVar3 + 0x20); iVar3 = *(int *)(iVar3 + 0x24); local_8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar12 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); param_1 = (undefined1 *)*param_2; param_2 = (undefined4 *)param_2[1]; uVar9 = *(uint *)(in_ECX + 0x5c); local_18 = uVar9 >> 1; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar12; pbVar12 = pbVar12 + 1; iVar7 = *(int *)(iVar5 + (uint)bVar1 * 4); iVar10 = *(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar11 + (uint)bVar1 * 4) >> 0x10; iVar8 = *(int *)(iVar6 + (uint)bVar2 * 4); uVar9 = (uint)*local_8; param_1[1] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[3] = *(undefined1 *)(uVar9 + iVar8 + iVar4); *param_1 = 0xff; uVar9 = (uint)local_8[1]; local_8 = local_8 + 2; param_1[5] = *(undefined1 *)(uVar9 + iVar7 + iVar4); param_1[6] = *(undefined1 *)(uVar9 + iVar10 + iVar4); param_1[7] = *(undefined1 *)(uVar9 + iVar8 + iVar4); param_1[4] = 0xff; param_1 = param_1 + 8; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 3) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)param_2 = 0xff; uVar9 = (uint)local_c[1]; local_c = local_c + 2; *(undefined1 *)((int)param_2 + 5) = *(undefined1 *)(iVar7 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 6) = *(undefined1 *)(uVar9 + iVar10 + iVar4); *(undefined1 *)((int)param_2 + 7) = *(undefined1 *)(uVar9 + iVar8 + iVar4); *(undefined1 *)((int)param_2 + 4) = 0xff; param_2 = (undefined4 *)((int)param_2 + 8); local_18 = local_18 - 1; } while (local_18 != 0); uVar9 = *(uint *)(in_ECX + 0x5c); } if ((uVar9 & 1) != 0) { iVar5 = *(int *)(iVar5 + (uint)*pbVar13 * 4); iVar11 = *(int *)(iVar3 + (uint)*pbVar12 * 4) + *(int *)(iVar11 + (uint)*pbVar13 * 4) >> 0x10; iVar3 = *(int *)(iVar6 + (uint)*pbVar12 * 4); uVar9 = (uint)*local_8; param_1[1] = *(undefined1 *)(uVar9 + iVar5 + iVar4); param_1[2] = *(undefined1 *)(uVar9 + iVar11 + iVar4); param_1[3] = *(undefined1 *)(uVar9 + iVar3 + iVar4); *param_1 = 0xff; uVar9 = (uint)*local_c; *(undefined1 *)((int)param_2 + 1) = *(undefined1 *)(iVar5 + uVar9 + iVar4); *(undefined1 *)((int)param_2 + 2) = *(undefined1 *)(uVar9 + iVar11 + iVar4); *(undefined1 *)((int)param_2 + 3) = *(undefined1 *)(uVar9 + iVar3 + iVar4); *(undefined1 *)param_2 = 0xff; } return; } //@@ 00abfc30 FUN_00abfc30 void FUN_00abfc30(int param_1) { int iVar1; iVar1 = *(int *)(param_1 + 0x1b0); *(undefined1 *)(iVar1 + 0x2c) = 0; *(undefined4 *)(iVar1 + 0x34) = *(undefined4 *)(param_1 + 0x60); return; } //@@ 00abfc50 FUN_00abfc50 void FUN_00abfc50(int param_1,undefined4 param_2,int *param_3,undefined4 param_4,int param_5, int *param_6,int param_7) { undefined4 *puVar1; int iVar2; size_t _Size; uint uVar3; uint uVar4; undefined4 local_c; undefined4 local_8; iVar2 = *(int *)(param_1 + 0x1b0); if (*(char *)(iVar2 + 0x2c) == '\0') { uVar3 = 2; if (*(uint *)(iVar2 + 0x34) < 2) { uVar3 = *(uint *)(iVar2 + 0x34); } uVar4 = param_7 - *param_6; if (uVar3 <= uVar4) { uVar4 = uVar3; } puVar1 = (undefined4 *)(param_5 + *param_6 * 4); local_c = *puVar1; if (uVar4 < 2) { local_8 = *(undefined4 *)(iVar2 + 0x28); *(undefined1 *)(iVar2 + 0x2c) = 1; } else { local_8 = puVar1[1]; } (**(code **)(iVar2 + 0x14))(param_1,param_2,*param_3,&local_c); } else { _Size = *(size_t *)(iVar2 + 0x30); if (*(int *)(param_1 + 0x2c) == 0x10) { _Size = *(int *)(param_1 + 0x5c) * 2; } memcpy(*(void **)(param_5 + *param_6 * 4),*(void **)(iVar2 + 0x28),_Size); *(undefined1 *)(iVar2 + 0x2c) = 0; uVar4 = 1; } *param_6 = *param_6 + uVar4; *(int *)(iVar2 + 0x34) = *(int *)(iVar2 + 0x34) - uVar4; if (*(char *)(iVar2 + 0x2c) == '\0') { *param_3 = *param_3 + 1; } return; } //@@ 00abfd10 FUN_00abfd10 void FUN_00abfd10(int param_1,undefined4 param_2,int *param_3,undefined4 param_4,int param_5, int *param_6) { (**(code **)(*(int *)(param_1 + 0x1b0) + 0x14))(param_1,param_2,*param_3,param_5 + *param_6 * 4); *param_6 = *param_6 + 1; *param_3 = *param_3 + 1; return; } //@@ 00abfd50 FUN_00abfd50 void FUN_00abfd50(int param_1,int *param_2,int param_3,undefined4 *param_4) { undefined1 uVar1; byte bVar2; byte bVar3; int iVar4; int iVar5; int iVar6; int iVar7; uint uVar8; byte *pbVar9; uint uVar10; byte *pbVar11; int iVar12; int iVar13; int iVar14; int iVar15; uint local_2c; uint local_14; undefined1 *local_10; int local_c; byte *local_8; switch(*(undefined4 *)(param_1 + 0x2c)) { case 6: iVar15 = *(int *)(param_1 + 0x1b0); local_c = *(int *)(param_1 + 0x124); iVar12 = *(int *)(iVar15 + 0x1c); iVar7 = *(int *)(iVar15 + 0x18); iVar4 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_14 = uVar8 >> 1; if (local_14 != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar5 = *(int *)(iVar7 + (uint)bVar2 * 4); iVar14 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar4 + (uint)bVar2 * 4) >> 0x10; iVar6 = *(int *)(iVar12 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; *local_10 = *(undefined1 *)(uVar8 + iVar5 + local_c); local_10[1] = *(undefined1 *)(uVar8 + iVar14 + local_c); local_10[2] = *(undefined1 *)(uVar8 + iVar6 + local_c); uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[3] = *(undefined1 *)(iVar5 + uVar8 + local_c); local_10[4] = *(undefined1 *)(uVar8 + iVar14 + local_c); local_10[5] = *(undefined1 *)(uVar8 + iVar6 + local_c); local_10 = local_10 + 6; local_14 = local_14 - 1; } while (local_14 != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) == 0) { return; } uVar8 = (uint)*pbVar9; iVar12 = *(int *)(iVar12 + (uint)*pbVar11 * 4); iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4) + *(int *)(iVar4 + uVar8 * 4); bVar2 = *local_8; goto LAB_00ac06c8; case 7: case 0xc: iVar15 = *(int *)(param_1 + 0x1b0); iVar12 = *(int *)(param_1 + 0x124); iVar7 = *(int *)(iVar15 + 0x1c); iVar4 = *(int *)(iVar15 + 0x18); iVar5 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_2c = uVar8 >> 1; if (local_2c != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar6 = *(int *)(iVar4 + (uint)bVar2 * 4); iVar13 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar5 + (uint)bVar2 * 4) >> 0x10; iVar14 = *(int *)(iVar7 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; *local_10 = *(undefined1 *)(uVar8 + iVar6 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[2] = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10[3] = 0xff; uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[4] = *(undefined1 *)(iVar6 + uVar8 + iVar12); local_10[5] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[6] = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10[7] = 0xff; local_10 = local_10 + 8; local_2c = local_2c - 1; } while (local_2c != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) != 0) { iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4); iVar7 = *(int *)(iVar7 + (uint)*pbVar11 * 4); iVar5 = *(int *)(iVar5 + (uint)*pbVar9 * 4); uVar8 = (uint)*local_8; *local_10 = *(undefined1 *)(*(int *)(iVar4 + (uint)*pbVar9 * 4) + uVar8 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + (iVar15 + iVar5 >> 0x10) + iVar12); uVar1 = *(undefined1 *)(uVar8 + iVar7 + iVar12); local_10[3] = 0xff; local_10[2] = uVar1; return; } break; case 8: iVar15 = *(int *)(param_1 + 0x1b0); iVar12 = *(int *)(param_1 + 0x124); iVar7 = *(int *)(iVar15 + 0x1c); iVar4 = *(int *)(iVar15 + 0x18); iVar5 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_2c = uVar8 >> 1; if (local_2c != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar6 = *(int *)(iVar4 + (uint)bVar2 * 4); iVar13 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar5 + (uint)bVar2 * 4) >> 0x10; iVar14 = *(int *)(iVar7 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; local_10[2] = *(undefined1 *)(uVar8 + iVar6 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + iVar13 + iVar12); *local_10 = *(undefined1 *)(uVar8 + iVar14 + iVar12); uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[5] = *(undefined1 *)(iVar6 + uVar8 + iVar12); local_10[4] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[3] = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10 = local_10 + 6; local_2c = local_2c - 1; } while (local_2c != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) != 0) { iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4); iVar7 = *(int *)(iVar7 + (uint)*pbVar11 * 4); iVar5 = *(int *)(iVar5 + (uint)*pbVar9 * 4); uVar8 = (uint)*local_8; local_10[2] = *(undefined1 *)(*(int *)(iVar4 + (uint)*pbVar9 * 4) + uVar8 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + (iVar15 + iVar5 >> 0x10) + iVar12); *local_10 = *(undefined1 *)(uVar8 + iVar7 + iVar12); return; } break; case 9: case 0xd: iVar15 = *(int *)(param_1 + 0x1b0); iVar12 = *(int *)(param_1 + 0x124); iVar7 = *(int *)(iVar15 + 0x1c); iVar4 = *(int *)(iVar15 + 0x18); iVar5 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_2c = uVar8 >> 1; if (local_2c != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar6 = *(int *)(iVar4 + (uint)bVar2 * 4); iVar13 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar5 + (uint)bVar2 * 4) >> 0x10; iVar14 = *(int *)(iVar7 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; local_10[2] = *(undefined1 *)(uVar8 + iVar6 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + iVar13 + iVar12); *local_10 = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10[3] = 0xff; uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[6] = *(undefined1 *)(iVar6 + uVar8 + iVar12); local_10[5] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[4] = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10[7] = 0xff; local_10 = local_10 + 8; local_2c = local_2c - 1; } while (local_2c != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) != 0) { iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4); iVar7 = *(int *)(iVar7 + (uint)*pbVar11 * 4); iVar5 = *(int *)(iVar5 + (uint)*pbVar9 * 4); uVar8 = (uint)*local_8; local_10[2] = *(undefined1 *)(*(int *)(iVar4 + (uint)*pbVar9 * 4) + uVar8 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + (iVar15 + iVar5 >> 0x10) + iVar12); *local_10 = *(undefined1 *)(uVar8 + iVar7 + iVar12); local_10[3] = 0xff; return; } break; case 10: case 0xe: iVar15 = *(int *)(param_1 + 0x1b0); iVar12 = *(int *)(param_1 + 0x124); iVar7 = *(int *)(iVar15 + 0x1c); iVar4 = *(int *)(iVar15 + 0x18); iVar5 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_2c = uVar8 >> 1; if (local_2c != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar6 = *(int *)(iVar4 + (uint)bVar2 * 4); iVar13 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar5 + (uint)bVar2 * 4) >> 0x10; iVar14 = *(int *)(iVar7 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; local_10[3] = *(undefined1 *)(uVar8 + iVar6 + iVar12); local_10[2] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[1] = *(undefined1 *)(uVar8 + iVar14 + iVar12); *local_10 = 0xff; uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[7] = *(undefined1 *)(iVar6 + uVar8 + iVar12); local_10[6] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[5] = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10[4] = 0xff; local_10 = local_10 + 8; local_2c = local_2c - 1; } while (local_2c != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) != 0) { iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4); iVar7 = *(int *)(iVar7 + (uint)*pbVar11 * 4); iVar5 = *(int *)(iVar5 + (uint)*pbVar9 * 4); uVar8 = (uint)*local_8; local_10[3] = *(undefined1 *)(*(int *)(iVar4 + (uint)*pbVar9 * 4) + uVar8 + iVar12); local_10[2] = *(undefined1 *)(uVar8 + (iVar15 + iVar5 >> 0x10) + iVar12); local_10[1] = *(undefined1 *)(uVar8 + iVar7 + iVar12); *local_10 = 0xff; return; } break; case 0xb: case 0xf: iVar15 = *(int *)(param_1 + 0x1b0); iVar12 = *(int *)(param_1 + 0x124); iVar7 = *(int *)(iVar15 + 0x1c); iVar4 = *(int *)(iVar15 + 0x18); iVar5 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_2c = uVar8 >> 1; if (local_2c != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar6 = *(int *)(iVar4 + (uint)bVar2 * 4); iVar13 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar5 + (uint)bVar2 * 4) >> 0x10; iVar14 = *(int *)(iVar7 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; local_10[1] = *(undefined1 *)(uVar8 + iVar6 + iVar12); local_10[2] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[3] = *(undefined1 *)(uVar8 + iVar14 + iVar12); *local_10 = 0xff; uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[5] = *(undefined1 *)(iVar6 + uVar8 + iVar12); local_10[6] = *(undefined1 *)(uVar8 + iVar13 + iVar12); local_10[7] = *(undefined1 *)(uVar8 + iVar14 + iVar12); local_10[4] = 0xff; local_10 = local_10 + 8; local_2c = local_2c - 1; } while (local_2c != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) != 0) { iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4); iVar7 = *(int *)(iVar7 + (uint)*pbVar11 * 4); iVar5 = *(int *)(iVar5 + (uint)*pbVar9 * 4); uVar8 = (uint)*local_8; local_10[1] = *(undefined1 *)(*(int *)(iVar4 + (uint)*pbVar9 * 4) + uVar8 + iVar12); local_10[2] = *(undefined1 *)(uVar8 + (iVar15 + iVar5 >> 0x10) + iVar12); local_10[3] = *(undefined1 *)(uVar8 + iVar7 + iVar12); *local_10 = 0xff; return; } break; default: iVar15 = *(int *)(param_1 + 0x1b0); local_c = *(int *)(param_1 + 0x124); iVar12 = *(int *)(iVar15 + 0x1c); iVar7 = *(int *)(iVar15 + 0x18); iVar4 = *(int *)(iVar15 + 0x20); iVar15 = *(int *)(iVar15 + 0x24); param_3 = param_3 * 4; local_8 = *(byte **)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); pbVar9 = *(byte **)(param_3 + param_2[2]); local_10 = (undefined1 *)*param_4; uVar8 = *(uint *)(param_1 + 0x5c); local_2c = uVar8 >> 1; if (local_2c != 0) { do { bVar2 = *pbVar9; pbVar9 = pbVar9 + 1; bVar3 = *pbVar11; pbVar11 = pbVar11 + 1; iVar5 = *(int *)(iVar7 + (uint)bVar2 * 4); iVar14 = *(int *)(iVar15 + (uint)bVar3 * 4) + *(int *)(iVar4 + (uint)bVar2 * 4) >> 0x10; iVar6 = *(int *)(iVar12 + (uint)bVar3 * 4); uVar8 = (uint)*local_8; *local_10 = *(undefined1 *)(uVar8 + iVar5 + local_c); local_10[1] = *(undefined1 *)(uVar8 + iVar14 + local_c); local_10[2] = *(undefined1 *)(uVar8 + iVar6 + local_c); uVar8 = (uint)local_8[1]; local_8 = local_8 + 2; local_10[3] = *(undefined1 *)(iVar5 + uVar8 + local_c); local_10[4] = *(undefined1 *)(uVar8 + iVar14 + local_c); local_10[5] = *(undefined1 *)(uVar8 + iVar6 + local_c); local_10 = local_10 + 6; local_2c = local_2c - 1; } while (local_2c != 0); uVar8 = *(uint *)(param_1 + 0x5c); } if ((uVar8 & 1) == 0) { return; } uVar8 = (uint)*pbVar9; iVar12 = *(int *)(iVar12 + (uint)*pbVar11 * 4); iVar15 = *(int *)(iVar15 + (uint)*pbVar11 * 4) + *(int *)(iVar4 + uVar8 * 4); bVar2 = *local_8; LAB_00ac06c8: uVar10 = (uint)bVar2; *local_10 = *(undefined1 *)(*(int *)(iVar7 + uVar8 * 4) + uVar10 + local_c); local_10[1] = *(undefined1 *)(uVar10 + (iVar15 >> 0x10) + local_c); local_10[2] = *(undefined1 *)(uVar10 + iVar12 + local_c); } return; } //@@ 00ac07f0 FUN_00ac07f0 void FUN_00ac07f0(byte *param_1,ushort *param_2) { byte bVar1; byte bVar2; byte bVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int in_ECX; uint uVar11; uint uVar12; int *in_EDX; byte *pbVar13; int iVar14; uint local_10; byte *local_c; iVar4 = *(int *)(in_ECX + 0x1b0); iVar5 = *(int *)(in_ECX + 0x124); iVar6 = *(int *)(iVar4 + 0x18); iVar7 = *(int *)(iVar4 + 0x1c); iVar8 = *(int *)(iVar4 + 0x20); iVar9 = *(int *)(iVar4 + 0x24); iVar4 = (int)param_1 * 4; param_1 = *(byte **)(iVar4 + *in_EDX); local_c = *(byte **)(iVar4 + in_EDX[1]); pbVar13 = *(byte **)(iVar4 + in_EDX[2]); param_2 = *(ushort **)param_2; uVar11 = *(uint *)(in_ECX + 0x5c); local_10 = uVar11 >> 1; if (local_10 != 0) { do { bVar1 = *local_c; local_c = local_c + 1; bVar2 = *pbVar13; pbVar13 = pbVar13 + 1; iVar4 = *(int *)(iVar6 + (uint)bVar2 * 4); iVar14 = *(int *)(iVar9 + (uint)bVar1 * 4) + *(int *)(iVar8 + (uint)bVar2 * 4) >> 0x10; iVar10 = *(int *)(iVar7 + (uint)bVar1 * 4); uVar11 = (uint)*param_1; uVar12 = (uint)param_1[1]; param_1 = param_1 + 2; bVar1 = *(byte *)(uVar12 + iVar14 + iVar5); bVar2 = *(byte *)(iVar4 + uVar12 + iVar5); bVar3 = *(byte *)(uVar12 + iVar10 + iVar5); *param_2 = ((*(byte *)(uVar11 + iVar4 + iVar5) & 0xf8) << 5 | *(byte *)(uVar11 + iVar14 + iVar5) & 0xfc) << 3 | (ushort)(*(byte *)(uVar11 + iVar10 + iVar5) >> 3); param_2[1] = (bVar1 & 0xfc | (bVar2 & 0xfff8) << 5) << 3 | (ushort)(bVar3 >> 3); param_2 = param_2 + 2; local_10 = local_10 - 1; } while (local_10 != 0); uVar11 = *(uint *)(in_ECX + 0x5c); } if ((uVar11 & 1) != 0) { uVar11 = (uint)*param_1; *param_2 = ((ushort)(*(byte *)((*(int *)((uint)*local_c * 4 + iVar9) + *(int *)(iVar8 + (uint)*pbVar13 * 4) >> 0x10) + uVar11 + iVar5) & 0xfc) | (*(byte *)(*(int *)(iVar6 + (uint)*pbVar13 * 4) + uVar11 + iVar5) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(*(int *)((uint)*local_c * 4 + iVar7) + uVar11 + iVar5) >> 3); } return; } //@@ 00ac09b0 h2v1_merged_upsample_565D_le /* DB: libjpeg-turbo jdmrg565.c: single Y row (h2v1), RGB565 packing with dither_matrix (DAT_00b5df94 indexed by output_scanline&3); only caller the h2v1_merged_upsample_565D wrapper 00ac1220 */ void h2v1_merged_upsample_565D_le(byte *param_1,ushort *param_2) { byte bVar1; byte bVar2; byte bVar3; byte bVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; uint uVar13; int in_ECX; byte *pbVar14; uint uVar15; int *in_EDX; int iVar16; int iVar17; uint uVar18; uint uVar19; byte *pbVar20; uint local_18; byte *local_c; iVar5 = *(int *)(in_ECX + 0x1b0); iVar6 = *(int *)(in_ECX + 0x124); iVar7 = *(int *)(iVar5 + 0x18); iVar8 = *(int *)(iVar5 + 0x1c); iVar9 = *(int *)(iVar5 + 0x20); iVar10 = *(int *)(iVar5 + 0x24); iVar5 = (int)param_1 * 4; uVar13 = *(uint *)(&DAT_00b5df94 + (*(uint *)(in_ECX + 0x78) & 3) * 4); param_1 = *(byte **)(iVar5 + *in_EDX); local_c = *(byte **)(iVar5 + in_EDX[1]); pbVar20 = *(byte **)(iVar5 + in_EDX[2]); param_2 = *(ushort **)param_2; uVar15 = *(uint *)(in_ECX + 0x5c); local_18 = uVar15 >> 1; if (local_18 != 0) { do { bVar1 = *local_c; local_c = local_c + 1; bVar2 = *pbVar20; pbVar20 = pbVar20 + 1; iVar11 = *(int *)(iVar7 + (uint)bVar2 * 4); iVar17 = *(int *)(iVar10 + (uint)bVar1 * 4) + *(int *)(iVar9 + (uint)bVar2 * 4) >> 0x10; iVar12 = *(int *)(iVar8 + (uint)bVar1 * 4); bVar1 = *param_1; pbVar14 = param_1 + 1; uVar15 = (int)uVar13 >> 1; uVar18 = (int)uVar13 >> 8; uVar19 = uVar18 & 0xffffff | uVar13 << 0x18; iVar5 = (uVar13 & 0xff) + (uint)bVar1; param_1 = param_1 + 2; iVar16 = (uint)*pbVar14 + (uVar18 & 0xff); bVar2 = *(byte *)(((int)uVar19 >> 1 & 0x7fU) + (uint)*pbVar14 + iVar17 + iVar6); bVar3 = *(byte *)(iVar11 + iVar16 + iVar6); uVar13 = (int)uVar19 >> 8 & 0xffffffU | uVar18 << 0x18; bVar4 = *(byte *)(iVar12 + iVar16 + iVar6); *param_2 = ((*(byte *)(iVar11 + iVar5 + iVar6) & 0xf8) << 5 | *(byte *)((uVar15 & 0x7f) + (uint)bVar1 + iVar17 + iVar6) & 0xfc) << 3 | (ushort)(*(byte *)(iVar12 + iVar5 + iVar6) >> 3); param_2[1] = ((bVar3 & 0xfff8) << 5 | bVar2 & 0xfc) << 3 | (ushort)(bVar4 >> 3); param_2 = param_2 + 2; local_18 = local_18 - 1; } while (local_18 != 0); uVar15 = *(uint *)(in_ECX + 0x5c); } if ((uVar15 & 1) != 0) { uVar15 = (uint)*param_1; *param_2 = ((ushort)(*(byte *)(((int)uVar13 >> 1 & 0x7fU) + (*(int *)((uint)*local_c * 4 + iVar10) + *(int *)(iVar9 + (uint)*pbVar20 * 4) >> 0x10) + uVar15 + iVar6) & 0xfc) | (*(byte *)(*(int *)(iVar7 + (uint)*pbVar20 * 4) + (uVar13 & 0xff) + uVar15 + iVar6) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(*(int *)((uint)*local_c * 4 + iVar8) + (uVar13 & 0xff) + uVar15 + iVar6) >> 3); } return; } //@@ 00ac0bf0 h2v2_merged_upsample_565_le /* DB: libjpeg-turbo jdmrg565.c: two Y rows / two output rows (h2v2), RGB565 packing without dither; only caller the h2v2_merged_upsample_565 wrapper 00ac1240 */ void h2v2_merged_upsample_565_le(byte *param_1,int *param_2) { byte bVar1; byte bVar2; byte bVar3; int iVar4; int iVar5; int iVar6; int iVar7; byte *pbVar8; int iVar9; int iVar10; int in_ECX; uint uVar11; uint uVar12; int *in_EDX; byte *pbVar13; byte *pbVar14; int iVar15; int iVar16; uint local_18; ushort *local_14; ushort *local_10; byte *local_c; iVar4 = *(int *)(in_ECX + 0x1b0); iVar5 = *(int *)(in_ECX + 0x124); iVar6 = *(int *)(iVar4 + 0x18); iVar7 = *(int *)(iVar4 + 0x1c); iVar16 = *(int *)(iVar4 + 0x20); iVar4 = *(int *)(iVar4 + 0x24); pbVar8 = *(byte **)(*in_EDX + (int)param_1 * 8); local_c = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); pbVar14 = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar13 = *(byte **)(in_EDX[2] + (int)param_1 * 4); local_10 = (ushort *)*param_2; local_14 = (ushort *)param_2[1]; uVar11 = *(uint *)(in_ECX + 0x5c); local_18 = uVar11 >> 1; param_1 = pbVar8; if (local_18 != 0) { do { bVar1 = *pbVar13; pbVar13 = pbVar13 + 1; bVar2 = *pbVar14; pbVar14 = pbVar14 + 1; iVar9 = *(int *)(iVar6 + (uint)bVar1 * 4); iVar15 = *(int *)(iVar4 + (uint)bVar2 * 4) + *(int *)(iVar16 + (uint)bVar1 * 4) >> 0x10; iVar10 = *(int *)(iVar7 + (uint)bVar2 * 4); uVar11 = (uint)*param_1; uVar12 = (uint)param_1[1]; param_1 = param_1 + 2; bVar1 = *(byte *)(uVar12 + iVar15 + iVar5); bVar2 = *(byte *)(iVar9 + uVar12 + iVar5); bVar3 = *(byte *)(uVar12 + iVar10 + iVar5); *local_10 = ((*(byte *)(uVar11 + iVar9 + iVar5) & 0xf8) << 5 | *(byte *)(uVar11 + iVar15 + iVar5) & 0xfc) << 3 | (ushort)(*(byte *)(uVar11 + iVar10 + iVar5) >> 3); local_10[1] = (bVar1 & 0xfc | (bVar2 & 0xfff8) << 5) << 3 | (ushort)(bVar3 >> 3); local_10 = local_10 + 2; uVar11 = (uint)*local_c; uVar12 = (uint)local_c[1]; local_c = local_c + 2; bVar1 = *(byte *)(uVar12 + iVar15 + iVar5); bVar2 = *(byte *)(iVar9 + uVar12 + iVar5); bVar3 = *(byte *)(uVar12 + iVar10 + iVar5); *local_14 = ((*(byte *)(iVar9 + uVar11 + iVar5) & 0xf8) << 5 | *(byte *)(uVar11 + iVar15 + iVar5) & 0xfc) << 3 | (ushort)(*(byte *)(uVar11 + iVar10 + iVar5) >> 3); local_14[1] = (bVar1 & 0xfc | (bVar2 & 0xfff8) << 5) << 3 | (ushort)(bVar3 >> 3); local_14 = local_14 + 2; local_18 = local_18 - 1; } while (local_18 != 0); uVar11 = *(uint *)(in_ECX + 0x5c); } if ((uVar11 & 1) != 0) { iVar6 = *(int *)(iVar6 + (uint)*pbVar13 * 4); iVar16 = *(int *)(iVar4 + (uint)*pbVar14 * 4) + *(int *)(iVar16 + (uint)*pbVar13 * 4) >> 0x10; iVar4 = *(int *)(iVar7 + (uint)*pbVar14 * 4); uVar11 = (uint)*param_1; *local_10 = ((*(byte *)(uVar11 + iVar6 + iVar5) & 0xfff8) << 5 | (ushort)(*(byte *)(uVar11 + iVar16 + iVar5) & 0xfc)) << 3 | (ushort)(*(byte *)(uVar11 + iVar4 + iVar5) >> 3); uVar11 = (uint)*local_c; *local_14 = ((*(byte *)(iVar6 + uVar11 + iVar5) & 0xfff8) << 5 | (ushort)(*(byte *)(uVar11 + iVar16 + iVar5) & 0xfc)) << 3 | (ushort)(*(byte *)(uVar11 + iVar4 + iVar5) >> 3); } return; } //@@ 00ac0e80 h2v2_merged_upsample_565D_le /* DB: ? libjpeg-turbo jdmrg565.c: ECX=cinfo (upsample +0x1b0 Cr_r/Cb_b/Cr_g/Cb_g tabs +0x18..+0x24, range_limit +0x124, output_width +0x5c), EDX=input_buf; two output rows of ushort (RGB565) from 2 Y rows and 1 Cb/Cr row, dither_matrix DAT_00b5df94[output_scanline (+0x78) & 3]; called from 00ac1260 (h2v2 merged upsample wrapper) */ void h2v2_merged_upsample_565D_le(byte *param_1,undefined4 *param_2) { byte bVar1; byte bVar2; byte bVar3; byte bVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int in_ECX; uint uVar10; byte *pbVar11; int *in_EDX; int iVar12; int iVar13; int iVar14; uint uVar15; uint uVar16; uint uVar17; byte *pbVar18; int iVar19; byte *pbVar20; int iVar21; uint local_28; ushort *local_24; ushort *local_20; byte *local_1c; uint local_c; iVar5 = *(int *)(in_ECX + 0x1b0); iVar6 = *(int *)(in_ECX + 0x124); iVar7 = *(int *)(iVar5 + 0x18); iVar19 = *(int *)(iVar5 + 0x1c); iVar21 = *(int *)(iVar5 + 0x20); iVar5 = *(int *)(iVar5 + 0x24); local_c = *(uint *)(&DAT_00b5df94 + (*(uint *)(in_ECX + 0x78) & 3) * 4); pbVar11 = *(byte **)(*in_EDX + (int)param_1 * 8); pbVar18 = *(byte **)(*in_EDX + 4 + (int)param_1 * 8); uVar17 = *(uint *)(&DAT_00b5df94 + (*(uint *)(in_ECX + 0x78) + 1 & 3) * 4); local_1c = *(byte **)(in_EDX[1] + (int)param_1 * 4); pbVar20 = *(byte **)(in_EDX[2] + (int)param_1 * 4); local_20 = (ushort *)*param_2; local_24 = (ushort *)param_2[1]; uVar10 = *(uint *)(in_ECX + 0x5c); local_28 = uVar10 >> 1; param_1 = pbVar18; if (local_28 != 0) { do { bVar1 = *local_1c; local_1c = local_1c + 1; bVar2 = *pbVar20; pbVar20 = pbVar20 + 1; iVar8 = *(int *)(iVar7 + (uint)bVar2 * 4); bVar3 = *pbVar11; pbVar18 = pbVar11 + 1; iVar14 = *(int *)(iVar5 + (uint)bVar1 * 4) + *(int *)(iVar21 + (uint)bVar2 * 4) >> 0x10; iVar9 = *(int *)(iVar19 + (uint)bVar1 * 4); uVar10 = (int)local_c >> 1; iVar12 = (local_c & 0xff) + (uint)bVar3; uVar15 = (int)local_c >> 8; uVar16 = uVar15 & 0xffffff | local_c << 0x18; pbVar11 = pbVar11 + 2; iVar13 = (uVar15 & 0xff) + (uint)*pbVar18; bVar1 = *(byte *)(((int)uVar16 >> 1 & 0x7fU) + (uint)*pbVar18 + iVar14 + iVar6); local_c = (int)uVar16 >> 8 & 0xffffffU | uVar15 << 0x18; bVar2 = *(byte *)(iVar8 + iVar13 + iVar6); bVar4 = *(byte *)(iVar9 + iVar13 + iVar6); *local_20 = ((*(byte *)(iVar8 + iVar12 + iVar6) & 0xf8) << 5 | *(byte *)((uVar10 & 0x7f) + (uint)bVar3 + iVar14 + iVar6) & 0xfc) << 3 | (ushort)(*(byte *)(iVar9 + iVar12 + iVar6) >> 3); local_20[1] = ((bVar2 & 0xfff8) << 5 | bVar1 & 0xfc) << 3 | (ushort)(bVar4 >> 3); local_20 = local_20 + 2; bVar1 = *param_1; pbVar18 = param_1 + 1; uVar10 = (int)uVar17 >> 1; iVar12 = (uVar17 & 0xff) + (uint)bVar1; uVar15 = (int)uVar17 >> 8; uVar17 = uVar15 & 0xffffff | uVar17 << 0x18; param_1 = param_1 + 2; iVar13 = (uint)*pbVar18 + (uVar15 & 0xff); bVar2 = *(byte *)(((int)uVar17 >> 1 & 0x7fU) + (uint)*pbVar18 + iVar14 + iVar6); bVar3 = *(byte *)(iVar8 + iVar13 + iVar6); uVar17 = (int)uVar17 >> 8 & 0xffffffU | uVar15 << 0x18; bVar4 = *(byte *)(iVar9 + iVar13 + iVar6); *local_24 = ((*(byte *)(iVar8 + iVar12 + iVar6) & 0xf8) << 5 | *(byte *)((uVar10 & 0x7f) + (uint)bVar1 + iVar14 + iVar6) & 0xfc) << 3 | (ushort)(*(byte *)(iVar9 + iVar12 + iVar6) >> 3); local_24[1] = ((bVar3 & 0xfff8) << 5 | bVar2 & 0xfc) << 3 | (ushort)(bVar4 >> 3); local_24 = local_24 + 2; local_28 = local_28 - 1; } while (local_28 != 0); uVar10 = *(uint *)(in_ECX + 0x5c); } if ((uVar10 & 1) != 0) { iVar7 = *(int *)(iVar7 + (uint)*pbVar20 * 4); iVar21 = *(int *)(iVar5 + (uint)*local_1c * 4) + *(int *)(iVar21 + (uint)*pbVar20 * 4) >> 0x10; iVar5 = *(int *)(iVar19 + (uint)*local_1c * 4); iVar19 = (local_c & 0xff) + (uint)*pbVar11; *local_20 = ((ushort)(*(byte *)(((int)local_c >> 1 & 0x7fU) + (uint)*pbVar11 + iVar21 + iVar6) & 0xfc) | (*(byte *)(iVar7 + iVar19 + iVar6) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(iVar19 + iVar5 + iVar6) >> 3); iVar19 = (uVar17 & 0xff) + (uint)*param_1; *local_24 = ((ushort)(*(byte *)(((int)uVar17 >> 1 & 0x7fU) + (uint)*param_1 + iVar21 + iVar6) & 0xfc) | (*(byte *)(iVar7 + iVar19 + iVar6) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(iVar19 + iVar5 + iVar6) >> 3); } return; } //@@ 00ac1200 FUN_00ac1200 void FUN_00ac1200(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { FUN_00ac07f0(param_3,param_4); return; } //@@ 00ac1220 FUN_00ac1220 void FUN_00ac1220(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { h2v1_merged_upsample_565D_le(param_3,param_4); return; } //@@ 00ac1240 FUN_00ac1240 void FUN_00ac1240(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { h2v2_merged_upsample_565_le(param_3,param_4); return; } //@@ 00ac1260 FUN_00ac1260 void FUN_00ac1260(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { h2v2_merged_upsample_565D_le(param_3,param_4); return; } //@@ 00ac1280 jinit_merged_upsampler /* DB: libjpeg: sets h2v1/h2v2_merged_upsample; the real jinit_upsampler is 00ab5200 jinit_upsampler libjpeg_jinit_upsampler) */ void jinit_merged_upsampler(void) { int iVar1; undefined4 *puVar2; code *pcVar3; undefined4 uVar4; int *in_ECX; int iVar5; undefined1 *puVar6; int iVar7; int iVar8; int local_c; int local_8; if (in_ECX[0x30] != 8) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } puVar2 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6c] = (int)puVar2; *puVar2 = FUN_00abfc30; *(undefined1 *)(puVar2 + 4) = 0; puVar2[0xc] = in_ECX[0x19] * in_ECX[0x17]; if (in_ECX[0x45] == 2) { puVar2[1] = FUN_00abfc50; puVar2[5] = &LAB_00ac0720; if (in_ECX[0xb] == 0x10) { pcVar3 = FUN_00ac1240; if (in_ECX[0x13] != 0) { pcVar3 = FUN_00ac1260; } puVar2[5] = pcVar3; } uVar4 = (**(code **)(in_ECX[1] + 4))(); } else { puVar2[1] = FUN_00abfd10; puVar2[5] = FUN_00abfd50; if (in_ECX[0xb] == 0x10) { pcVar3 = FUN_00ac1200; if (in_ECX[0x13] != 0) { pcVar3 = FUN_00ac1220; } puVar2[5] = pcVar3; } uVar4 = 0; } puVar2[10] = uVar4; iVar1 = in_ECX[0x6c]; uVar4 = (**(code **)in_ECX[1])(); *(undefined4 *)(iVar1 + 0x18) = uVar4; uVar4 = (**(code **)in_ECX[1])(); *(undefined4 *)(iVar1 + 0x1c) = uVar4; uVar4 = (**(code **)in_ECX[1])(); *(undefined4 *)(iVar1 + 0x20) = uVar4; uVar4 = (**(code **)in_ECX[1])(); *(undefined4 *)(iVar1 + 0x24) = uVar4; local_c = 0x2c8d00; puVar6 = &LAB_005b6900; local_8 = -0xe25100; iVar5 = 0; iVar7 = -0xb2f480; do { iVar8 = iVar7 + 0x166e9; *(int *)(iVar5 + *(int *)(iVar1 + 0x18)) = iVar7 >> 0x10; *(int *)(iVar5 + *(int *)(iVar1 + 0x1c)) = local_8 >> 0x10; *(undefined1 **)(iVar5 + *(int *)(iVar1 + 0x20)) = puVar6; puVar6 = puVar6 + -0xb6d2; *(int *)(iVar5 + *(int *)(iVar1 + 0x24)) = local_c; local_c = local_c + -0x581a; iVar5 = iVar5 + 4; iVar7 = iVar8; local_8 = local_8 + 0x1c5a2; } while (iVar8 < 0xb28d98); return; } //@@ 00ac1410 start_pass_phuff_decoder /* DB: libjpeg-turbo jdphuff.c: stored as entropy->pub.start_pass ([eax] at ab625c); progressive validation of Ss/Se/Ah/Al (+0x170..+0x17c: Se63, comps_in_scan!=1, Al>13) -> JERR_BAD_PROGRESSION (0x11), then jpeg_make_d_derived_tbl (00ac2430) per component */ void start_pass_phuff_decoder(int *param_1) { int iVar1; int iVar2; int iVar3; int iVar4; bool bVar5; int iVar6; code *pcVar7; int iVar8; int *piVar9; int iVar10; int *local_10; undefined4 *local_c; bVar5 = false; iVar1 = param_1[0x6a]; iVar2 = param_1[0x5c]; iVar3 = param_1[0x5d]; if (iVar2 == 0) { bVar5 = iVar3 != 0; } else { if ((iVar3 < iVar2) || (0x3f < iVar3)) { bVar5 = true; } if (param_1[0x4a] != 1) { bVar5 = true; } } if ((param_1[0x5e] != 0) && (param_1[0x5f] != param_1[0x5e] + -1)) { bVar5 = true; } if ((0xd < param_1[0x5f]) || (bVar5)) { *(undefined4 *)(*param_1 + 0x14) = 0x11; *(int *)(*param_1 + 0x18) = param_1[0x5c]; *(int *)(*param_1 + 0x1c) = param_1[0x5d]; *(int *)(*param_1 + 0x20) = param_1[0x5e]; *(int *)(*param_1 + 0x24) = param_1[0x5f]; (**(code **)*param_1)(param_1); } local_c = (undefined4 *)0x0; if (0 < param_1[0x4a]) { local_10 = param_1 + 0x4b; do { iVar3 = *(int *)(*local_10 + 4); piVar9 = (int *)(iVar3 * 0x100 + param_1[0x23]); iVar10 = (param_1[9] + iVar3) * 0x100 + param_1[0x23]; if ((iVar2 != 0) && (*piVar9 < 0)) { *(undefined4 *)(*param_1 + 0x14) = 0x76; *(int *)(*param_1 + 0x18) = iVar3; *(undefined4 *)(*param_1 + 0x1c) = 0; (**(code **)(*param_1 + 4))(param_1,0xffffffff); } iVar8 = 1; if (param_1[0x5c] < 1) { iVar8 = param_1[0x5c]; } while( true ) { iVar4 = param_1[0x5d]; iVar6 = 9; if (9 < iVar4) { iVar6 = iVar4; } if (iVar6 < iVar8) break; if (param_1[0x1f] < 2) { *(undefined4 *)(iVar10 + iVar8 * 4) = 0; iVar8 = iVar8 + 1; } else { *(int *)(iVar10 + iVar8 * 4) = piVar9[iVar8]; iVar8 = iVar8 + 1; } } iVar10 = param_1[0x5c]; if (iVar10 <= iVar4) { do { iVar8 = 0; if (-1 < piVar9[iVar10]) { iVar8 = piVar9[iVar10]; } if (param_1[0x5e] != iVar8) { *(undefined4 *)(*param_1 + 0x14) = 0x76; *(int *)(*param_1 + 0x18) = iVar3; *(int *)(*param_1 + 0x1c) = iVar10; (**(code **)(*param_1 + 4))(param_1,0xffffffff); } piVar9[iVar10] = param_1[0x5f]; iVar10 = iVar10 + 1; } while (iVar10 <= param_1[0x5d]); } local_c = (undefined4 *)((int)local_c + 1); local_10 = local_10 + 1; } while ((int)local_c < param_1[0x4a]); } if (param_1[0x5e] == 0) { pcVar7 = decode_mcu_DC_first; if (iVar2 != 0) { pcVar7 = decode_mcu_AC_first; } } else { pcVar7 = decode_mcu_AC_refine; if (iVar2 == 0) { pcVar7 = FUN_00ac1c00; } } local_10 = (int *)0x0; *(code **)(iVar1 + 4) = pcVar7; if (0 < param_1[0x4a]) { local_c = (undefined4 *)(iVar1 + 0x20); piVar9 = param_1 + 0x4b; do { if (iVar2 == 0) { if (param_1[0x5e] == 0) { iVar3 = *(int *)(*piVar9 + 0x14); jpeg_make_d_derived_tbl(param_1,1,iVar3,(void *)(iVar1 + (iVar3 + 0xd) * 4)); } } else { iVar3 = *(int *)(*piVar9 + 0x18); jpeg_make_d_derived_tbl(param_1,0,iVar3,(void *)(iVar1 + (iVar3 + 0xd) * 4)); *(undefined4 *)(iVar1 + 0x44) = *(undefined4 *)(iVar1 + 0x34 + iVar3 * 4); } *local_c = 0; local_10 = (int *)((int)local_10 + 1); local_c = local_c + 1; piVar9 = piVar9 + 1; } while ((int)local_10 < param_1[0x4a]); } *(undefined4 *)(iVar1 + 0x18) = 0; *(undefined4 *)(iVar1 + 0x14) = 0; *(undefined1 *)(iVar1 + 0x10) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0; *(int *)(iVar1 + 0x30) = param_1[0x3f]; return; } //@@ 00ac16c0 FUN_00ac16c0 undefined4 FUN_00ac16c0(void) { int *piVar1; int iVar2; undefined4 uVar3; int iVar4; int in_ECX; undefined4 *puVar5; iVar2 = *(int *)(in_ECX + 0x1a8); piVar1 = (int *)(*(int *)(in_ECX + 0x1a4) + 0x14); *piVar1 = *piVar1 + ((int)(*(int *)(iVar2 + 0x18) + (*(int *)(iVar2 + 0x18) >> 0x1f & 7U)) >> 3); *(undefined4 *)(iVar2 + 0x18) = 0; uVar3 = (**(code **)(*(int *)(in_ECX + 0x1a4) + 8))(); if ((char)uVar3 == '\0') { return uVar3; } iVar4 = 0; if (0 < *(int *)(in_ECX + 0x128)) { puVar5 = (undefined4 *)(iVar2 + 0x20); do { *puVar5 = 0; puVar5 = puVar5 + 1; iVar4 = iVar4 + 1; } while (iVar4 < *(int *)(in_ECX + 0x128)); } *(undefined4 *)(iVar2 + 0x1c) = 0; uVar3 = *(undefined4 *)(in_ECX + 0xfc); *(undefined4 *)(iVar2 + 0x30) = uVar3; if (*(int *)(in_ECX + 0x18c) == 0) { *(undefined1 *)(iVar2 + 0x10) = 0; } return CONCAT31((int3)((uint)uVar3 >> 8),1); } //@@ 00ac1750 decode_mcu_DC_first /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jdphuff.c: start_pass_phuff_decoder FUN_00ac1410 picks it (mov eax,0xac1750) for Ah == 0 and DC band (alternatives ac19c0/ac1c00/ac1cf0); process_restart FUN_00ac16c0 when restarts_to_go hits 0, per block DC huffman decode with jpeg_fill_bit_buffer FUN_00ac2780 / jpeg_huff_decode FUN_00ac28a0 */ undefined4 decode_mcu_DC_first(int *param_1,int param_2) { int iVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; short *psVar5; int iVar6; undefined4 uVar7; char cVar8; int iVar9; uint uVar10; int iVar11; undefined4 *puVar12; uint uVar13; int iVar14; uint local_40; int local_3c; int local_34; int *local_28; undefined4 local_24; uint local_20; int aiStack_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(aiStack_18 + 5); iVar1 = param_1[0x6a]; iVar2 = param_1[0x5f]; if (((param_1[0x3f] != 0) && (*(int *)(iVar1 + 0x30) == 0)) && (cVar8 = FUN_00ac16c0(), cVar8 == '\0')) { return 0; } if (*(char *)(iVar1 + 0x10) == '\0') { puVar12 = (undefined4 *)param_1[6]; uVar7 = *(undefined4 *)(iVar1 + 0x1c); aiStack_18[0] = *(int *)(iVar1 + 0x20); aiStack_18[1] = *(undefined4 *)(iVar1 + 0x24); aiStack_18[2] = *(undefined4 *)(iVar1 + 0x28); iVar14 = *(int *)(iVar1 + 0x18); uVar3 = puVar12[1]; uVar4 = *puVar12; local_20 = *(uint *)(iVar1 + 0x14); local_24 = *(undefined4 *)(iVar1 + 0x2c); aiStack_18[3] = local_24; local_34 = 0; if (0 < param_1[0x51]) { local_28 = param_1 + 0x52; do { psVar5 = *(short **)(param_2 + local_34 * 4); iVar6 = *local_28; iVar11 = *(int *)(iVar1 + 0x34 + *(int *)(param_1[iVar6 + 0x4b] + 0x14) * 4); if (iVar14 < 8) { cVar8 = FUN_00ac2780(iVar14,0); if (cVar8 == '\0') { return 0; } local_20 = local_40; iVar14 = local_3c; if (7 < local_3c) goto LAB_00ac18d6; iVar9 = 1; LAB_00ac184b: uVar10 = FUN_00ac28a0(iVar14,iVar11,iVar9); if ((int)uVar10 < 0) { return 0; } local_20 = local_40; iVar14 = local_3c; } else { LAB_00ac18d6: uVar10 = *(uint *)(iVar11 + 0x94 + (local_20 >> ((char)iVar14 - 8U & 0x1f) & 0xff) * 4); iVar9 = (int)uVar10 >> 8; if (8 < iVar9) goto LAB_00ac184b; iVar14 = iVar14 - iVar9; uVar10 = uVar10 & 0xff; } uVar13 = 0; if (uVar10 != 0) { if (iVar14 < (int)uVar10) { cVar8 = FUN_00ac2780(iVar14,uVar10); if (cVar8 == '\0') { return 0; } local_20 = local_40; iVar14 = local_3c; } iVar14 = iVar14 - uVar10; iVar11 = 1 << ((byte)uVar10 & 0x1f); uVar13 = local_20 >> ((byte)iVar14 & 0x1f) & iVar11 - 1U; if ((int)uVar13 < 1 << ((byte)uVar10 - 1 & 0x1f)) { uVar13 = (uVar13 - iVar11) + 1; } } iVar11 = aiStack_18[iVar6]; if (iVar11 < 0) { if ((int)uVar13 < -0x80000000 - iVar11) goto LAB_00ac190a; } else if (0x7fffffff - iVar11 < (int)uVar13) { LAB_00ac190a: *(undefined4 *)(*param_1 + 0x14) = 6; (**(code **)*param_1)(param_1); } aiStack_18[iVar6] = uVar13 + iVar11; local_28 = local_28 + 1; *psVar5 = (short)(uVar13 + iVar11) << ((byte)iVar2 & 0x1f); local_34 = local_34 + 1; } while (local_34 < param_1[0x51]); puVar12 = (undefined4 *)param_1[6]; local_24 = aiStack_18[3]; } *puVar12 = uVar4; *(undefined4 *)(param_1[6] + 4) = uVar3; *(undefined4 *)(iVar1 + 0x1c) = uVar7; *(int *)(iVar1 + 0x20) = aiStack_18[0]; *(int *)(iVar1 + 0x24) = aiStack_18[1]; *(int *)(iVar1 + 0x28) = aiStack_18[2]; *(uint *)(iVar1 + 0x14) = local_20; *(int *)(iVar1 + 0x18) = iVar14; *(undefined4 *)(iVar1 + 0x2c) = local_24; } if (param_1[0x3f] != 0) { *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + -1; } return 1; } //@@ 00ac19c0 decode_mcu_AC_first /* DB: libjpeg progressive Huffman start_pass (00ac15e8): Ah==0 && AC band -> 0x00ac19c0 (Ah==0 && DC -> 00ac1750 decode_mcu_DC_first */ undefined4 decode_mcu_AC_first(int param_1,int *param_2) { int iVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; int iVar7; char cVar8; uint uVar9; int iVar10; int iVar11; int iVar12; int iVar13; uint uVar14; int iVar15; uint local_30; int local_2c; uint local_8; iVar1 = *(int *)(param_1 + 0x1a8); iVar2 = *(int *)(param_1 + 0x174); uVar3 = *(undefined4 *)(param_1 + 0x17c); if (((*(int *)(param_1 + 0xfc) != 0) && (*(int *)(iVar1 + 0x30) == 0)) && (cVar8 = FUN_00ac16c0(), cVar8 == '\0')) { return 0; } if (*(char *)(iVar1 + 0x10) == '\0') { if (*(int *)(iVar1 + 0x1c) == 0) { local_8 = *(uint *)(iVar1 + 0x14); uVar4 = **(undefined4 **)(param_1 + 0x18); uVar5 = (*(undefined4 **)(param_1 + 0x18))[1]; iVar10 = *(int *)(iVar1 + 0x18); iVar6 = *param_2; iVar7 = *(int *)(iVar1 + 0x44); iVar12 = *(int *)(param_1 + 0x170); iVar15 = 0; if (iVar12 <= iVar2) { do { if (iVar10 < 8) { cVar8 = FUN_00ac2780(iVar10,0); if (cVar8 == '\0') { return 0; } local_8 = local_30; iVar10 = local_2c; if (7 < local_2c) goto LAB_00ac1b31; iVar11 = 1; LAB_00ac1a98: uVar9 = FUN_00ac28a0(iVar10,iVar7,iVar11); if ((int)uVar9 < 0) { return 0; } local_8 = local_30; iVar10 = local_2c; } else { LAB_00ac1b31: uVar9 = *(uint *)(iVar7 + 0x94 + (local_8 >> ((char)iVar10 - 8U & 0x1f) & 0xff) * 4); iVar11 = (int)uVar9 >> 8; if (8 < iVar11) goto LAB_00ac1a98; uVar9 = uVar9 & 0xff; iVar10 = iVar10 - iVar11; } iVar11 = (int)uVar9 >> 4; uVar9 = uVar9 & 0xf; if (uVar9 == 0) { if (iVar11 != 0xf) { iVar15 = 1 << ((byte)iVar11 & 0x1f); if (iVar11 != 0) { if (iVar10 < iVar11) { cVar8 = FUN_00ac2780(iVar10,iVar11); if (cVar8 == '\0') { return 0; } local_8 = local_30; iVar10 = local_2c; } iVar10 = iVar10 - iVar11; iVar15 = iVar15 + (local_8 >> ((byte)iVar10 & 0x1f) & iVar15 - 1U); } iVar15 = iVar15 + -1; break; } } else { if (iVar10 < (int)uVar9) { cVar8 = FUN_00ac2780(iVar10,uVar9); if (cVar8 == '\0') { return 0; } local_8 = local_30; iVar10 = local_2c; } iVar13 = 1 << (sbyte)uVar9; iVar10 = iVar10 - uVar9; uVar14 = local_8 >> ((byte)iVar10 & 0x1f) & iVar13 - 1U; if ((int)uVar14 < 1 << ((sbyte)uVar9 - 1U & 0x1f)) { uVar14 = (uVar14 - iVar13) + 1; } *(short *)(iVar6 + (&DAT_00b4fd00)[iVar12 + iVar11] * 2) = (short)uVar14 << ((byte)uVar3 & 0x1f); } iVar12 = iVar12 + iVar11 + 1; } while (iVar12 <= iVar2); } **(undefined4 **)(param_1 + 0x18) = uVar4; *(undefined4 *)(*(int *)(param_1 + 0x18) + 4) = uVar5; *(uint *)(iVar1 + 0x14) = local_8; *(int *)(iVar1 + 0x18) = iVar10; } else { iVar15 = *(int *)(iVar1 + 0x1c) + -1; } *(int *)(iVar1 + 0x1c) = iVar15; } if (*(int *)(param_1 + 0xfc) != 0) { *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + -1; } return 1; } //@@ 00ac1c00 FUN_00ac1c00 uint FUN_00ac1c00(int param_1,int param_2) { undefined4 uVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; ushort *puVar5; uint uVar6; undefined4 *puVar7; int iVar8; int iVar9; uint local_1c; int local_18; uVar1 = *(undefined4 *)(param_1 + 0x17c); iVar2 = *(int *)(param_1 + 0x1a8); if (((*(int *)(param_1 + 0xfc) != 0) && (*(int *)(iVar2 + 0x30) == 0)) && (uVar6 = FUN_00ac16c0(), (char)uVar6 == '\0')) { LAB_00ac1cb2: return uVar6 & 0xffffff00; } puVar7 = *(undefined4 **)(param_1 + 0x18); iVar9 = 0; uVar6 = *(uint *)(iVar2 + 0x14); uVar3 = *puVar7; uVar4 = puVar7[1]; iVar8 = *(int *)(iVar2 + 0x18); if (0 < *(int *)(param_1 + 0x144)) { do { puVar5 = *(ushort **)(param_2 + iVar9 * 4); if (iVar8 < 1) { uVar6 = FUN_00ac2780(iVar8,1); if ((char)uVar6 == '\0') goto LAB_00ac1cb2; iVar8 = local_18; uVar6 = local_1c; } iVar8 = iVar8 + -1; if ((uVar6 >> ((byte)iVar8 & 0x1f) & 1) != 0) { *puVar5 = *puVar5 | (ushort)(1 << ((byte)uVar1 & 0x1f)); } iVar9 = iVar9 + 1; } while (iVar9 < *(int *)(param_1 + 0x144)); puVar7 = *(undefined4 **)(param_1 + 0x18); } *puVar7 = uVar3; iVar9 = *(int *)(param_1 + 0x18); *(undefined4 *)(iVar9 + 4) = uVar4; *(uint *)(iVar2 + 0x14) = uVar6; *(int *)(iVar2 + 0x18) = iVar8; if (*(int *)(param_1 + 0xfc) != 0) { *(int *)(iVar2 + 0x30) = *(int *)(iVar2 + 0x30) + -1; } return CONCAT31((int3)((uint)iVar9 >> 8),1); } //@@ 00ac1cf0 decode_mcu_AC_refine /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg progressive Huffman start_pass (00ac15db): Ah!=0 && AC band -> 0x00ac1cf0 stored to entropy->pub.decode_mcu (Ah!=0 && DC -> 00ac1c00 DC_refine); largest of the four (1221 bytes) */ undefined4 decode_mcu_AC_refine(int *param_1,int *param_2) { short *psVar1; short sVar2; int iVar3; int iVar4; undefined4 uVar5; undefined4 uVar6; int iVar7; int iVar8; char cVar9; short sVar10; short sVar11; uint uVar12; uint uVar13; int iVar14; uint uVar15; uint uVar16; int iVar17; int iVar18; uint local_14c; uint local_130; int local_12c; int local_124; int local_118; int local_114; uint local_10c [65]; uint local_8; local_8 = __security_cookie ^ (uint)(local_10c + 0x42); iVar3 = param_1[0x5d]; iVar4 = param_1[0x6a]; uVar12 = 1 << ((byte)param_1[0x5f] & 0x1f); uVar13 = -1 << ((byte)param_1[0x5f] & 0x1f); if (((param_1[0x3f] != 0) && (*(int *)(iVar4 + 0x30) == 0)) && (cVar9 = FUN_00ac16c0(), cVar9 == '\0')) { return 0; } if (*(char *)(iVar4 + 0x10) == '\0') { local_10c[0] = *(uint *)(iVar4 + 0x14); iVar17 = *(int *)(iVar4 + 0x18); uVar5 = *(undefined4 *)param_1[6]; uVar6 = ((undefined4 *)param_1[6])[1]; local_124 = 0; local_114 = *(int *)(iVar4 + 0x1c); iVar7 = *(int *)(iVar4 + 0x44); iVar8 = *param_2; iVar18 = param_1[0x5c]; sVar10 = (short)uVar13; if (local_114 == 0) { local_114 = 0; uVar16 = local_10c[0]; uVar15 = local_10c[0]; for (; local_10c[0] = uVar16, iVar18 <= iVar3; iVar18 = iVar18 + 1) { uVar16 = local_10c[0]; local_10c[0] = uVar15; if (iVar17 < 8) { cVar9 = FUN_00ac2780(iVar17,0); if (cVar9 == '\0') goto joined_r0x00ac2187; local_10c[0] = local_130; uVar16 = local_130; iVar17 = local_12c; if (7 < local_12c) goto LAB_00ac1eeb; iVar14 = 1; LAB_00ac1e26: uVar15 = FUN_00ac28a0(iVar17,iVar7,iVar14); if ((int)uVar15 < 0) goto joined_r0x00ac2187; local_10c[0] = local_130; uVar16 = local_130; iVar17 = local_12c; } else { LAB_00ac1eeb: uVar15 = *(uint *)(iVar7 + 0x94 + (uVar16 >> ((char)iVar17 - 8U & 0x1f) & 0xff) * 4); iVar14 = (int)uVar15 >> 8; if (8 < iVar14) goto LAB_00ac1e26; iVar17 = iVar17 - iVar14; uVar15 = uVar15 & 0xff; } local_118 = (int)uVar15 >> 4; if ((uVar15 & 0xf) == 0) { local_14c = 0; if (local_118 != 0xf) { local_114 = 1 << ((byte)local_118 & 0x1f); if (local_118 != 0) { if (iVar17 < local_118) { cVar9 = FUN_00ac2780(iVar17,local_118); if (cVar9 == '\0') goto joined_r0x00ac2187; local_10c[0] = local_130; uVar16 = local_130; iVar17 = local_12c; } iVar17 = iVar17 - local_118; local_114 = local_114 + (uVar16 >> ((byte)iVar17 & 0x1f) & local_114 - 1U); } if (local_114 != 0) goto LAB_00ac207e; break; } } else { if ((uVar15 & 0xf) != 1) { *(undefined4 *)(*param_1 + 0x14) = 0x79; (**(code **)(*param_1 + 4))(param_1,0xffffffff); } if (iVar17 < 1) { cVar9 = FUN_00ac2780(iVar17,1); if (cVar9 == '\0') goto joined_r0x00ac2187; local_10c[0] = local_130; iVar17 = local_12c; } iVar17 = iVar17 + -1; local_14c = uVar12; if ((local_10c[0] >> ((byte)iVar17 & 0x1f) & 1) == 0) { local_14c = uVar13; } uVar16 = local_10c[0]; } do { psVar1 = (short *)(iVar8 + (&DAT_00b4fd00)[iVar18] * 2); if (*(short *)(iVar8 + (&DAT_00b4fd00)[iVar18] * 2) == 0) { local_118 = local_118 + -1; if (local_118 < 0) break; } else { if (iVar17 < 1) { cVar9 = FUN_00ac2780(iVar17,1); if (cVar9 == '\0') goto joined_r0x00ac2187; local_10c[0] = local_130; uVar16 = local_130; iVar17 = local_12c; } iVar17 = iVar17 + -1; if ((uVar16 >> ((byte)iVar17 & 0x1f) & 1) != 0) { sVar2 = *psVar1; uVar16 = local_10c[0]; if ((uVar12 & (int)sVar2) == 0) { sVar11 = sVar10; if (-1 < sVar2) { sVar11 = (short)uVar12; } *psVar1 = sVar11 + sVar2; } } } iVar18 = iVar18 + 1; } while (iVar18 <= iVar3); if (local_14c != 0) { uVar15 = (&DAT_00b4fd00)[iVar18]; *(short *)(iVar8 + uVar15 * 2) = (short)local_14c; local_10c[local_124 + 1] = uVar15; local_124 = local_124 + 1; } uVar15 = local_10c[0]; } } else { LAB_00ac207e: if (iVar18 <= iVar3) { uVar13 = local_10c[0]; do { psVar1 = (short *)(iVar8 + (&DAT_00b4fd00)[iVar18] * 2); if (*(short *)(iVar8 + (&DAT_00b4fd00)[iVar18] * 2) != 0) { if (iVar17 < 1) { cVar9 = FUN_00ac2780(iVar17,1); if (cVar9 == '\0') { joined_r0x00ac2187: for (; 0 < local_124; local_124 = local_124 + -1) { *(undefined2 *)(iVar8 + local_10c[local_124] * 2) = 0; } return 0; } local_10c[0] = local_130; uVar13 = local_130; iVar17 = local_12c; } iVar17 = iVar17 + -1; if ((uVar13 >> ((byte)iVar17 & 0x1f) & 1) != 0) { sVar2 = *psVar1; uVar13 = local_10c[0]; if ((uVar12 & (int)sVar2) == 0) { sVar11 = (short)uVar12; if (sVar2 < 0) { sVar11 = sVar10; } *psVar1 = sVar11 + sVar2; } } } iVar18 = iVar18 + 1; } while (iVar18 <= iVar3); } local_114 = local_114 + -1; } *(undefined4 *)param_1[6] = uVar5; *(undefined4 *)(param_1[6] + 4) = uVar6; *(int *)(iVar4 + 0x18) = iVar17; *(uint *)(iVar4 + 0x14) = local_10c[0]; *(int *)(iVar4 + 0x1c) = local_114; } if (param_1[0x3f] != 0) { *(int *)(iVar4 + 0x30) = *(int *)(iVar4 + 0x30) + -1; } return 1; } //@@ 00ac21c0 add_huff_table /* DB: libjpeg(-turbo) jstdhuff.c: ECX cinfo, EDX htblptr: allocates the table when *htblptr is NULL (sent_table +0x111 = FALSE) else returns for decompressors (cinfo+0x10 is_decompressor), copies bits[17], sums the symbol count (SIMD) and copies huffval, zero-filling the rest; used via std_huff_tables from libjpeg_jinit_master_decompress */ void add_huff_table(undefined4 *param_1,void *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; unkuint10 Var4; undefined1 auVar5 [13]; undefined1 auVar6 [11]; undefined1 auVar7 [13]; undefined1 auVar8 [11]; undefined1 auVar9 [14]; undefined1 auVar10 [14]; uint6 uVar11; undefined4 *puVar12; int iVar13; int *in_ECX; int *in_EDX; ushort uVar22; undefined1 auVar16 [16]; undefined1 auVar15 [16]; undefined1 auVar14 [16]; undefined1 auVar17 [16]; undefined1 auVar20 [16]; undefined1 auVar19 [16]; undefined1 auVar18 [16]; undefined1 auVar21 [16]; int iVar23; size_t _Size; int iVar24; int iVar25; int iVar26; int iVar27; int iVar28; int iVar29; int iVar30; puVar12 = (undefined4 *)*in_EDX; if (puVar12 == (undefined4 *)0x0) { puVar12 = (undefined4 *)(**(code **)in_ECX[1])(); *(undefined1 *)((int)puVar12 + 0x111) = 0; *in_EDX = (int)puVar12; } else if ((char)in_ECX[4] != '\0') { return; } iVar27 = 0; iVar28 = 0; iVar29 = 0; iVar30 = 0; iVar23 = 0; iVar24 = 0; iVar25 = 0; iVar26 = 0; uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *puVar12 = *param_1; puVar12[1] = uVar1; puVar12[2] = uVar2; puVar12[3] = uVar3; *(undefined1 *)(puVar12 + 4) = *(undefined1 *)(param_1 + 4); iVar13 = 1; do { uVar1 = *(undefined4 *)(iVar13 + (int)param_1); Var4 = CONCAT91((unkuint9)0,(char)((uint)uVar1 >> 0x18)); auVar6[10] = 0; auVar6._0_10_ = Var4; auVar16[4] = (char)((uint)uVar1 >> 0x10); auVar16._0_4_ = uVar1; auVar16._5_11_ = auVar6 << 8; auVar5[0xc] = 0; auVar5._0_12_ = auVar16._4_12_; auVar15._0_2_ = (ushort)uVar1; auVar15[2] = (char)((uint)uVar1 >> 8); auVar15._3_13_ = auVar5 << 8; auVar14._2_14_ = auVar15._2_14_; auVar14._0_2_ = auVar15._0_2_ & 0xff; uVar22 = (ushort)Var4; auVar9._10_2_ = 0; auVar9._0_10_ = auVar14._0_10_; auVar9._12_2_ = uVar22; uVar11 = CONCAT42(auVar9._10_4_,auVar16._4_2_); auVar17._0_4_ = auVar14._0_4_; auVar17._4_2_ = auVar15._2_2_; auVar17._6_10_ = (unkuint10)uVar11 << 0x10; iVar27 = iVar27 + (auVar17._0_4_ & 0xffff); iVar28 = iVar28 + auVar17._4_4_; iVar29 = iVar29 + (int)uVar11; iVar30 = iVar30 + (uint)uVar22; uVar1 = *(undefined4 *)(iVar13 + 4 + (int)param_1); Var4 = CONCAT91((unkuint9)0,(char)((uint)uVar1 >> 0x18)); auVar8[10] = 0; auVar8._0_10_ = Var4; auVar20[4] = (char)((uint)uVar1 >> 0x10); auVar20._0_4_ = uVar1; auVar20._5_11_ = auVar8 << 8; auVar7[0xc] = 0; auVar7._0_12_ = auVar20._4_12_; auVar19._0_2_ = (ushort)uVar1; auVar19[2] = (char)((uint)uVar1 >> 8); auVar19._3_13_ = auVar7 << 8; auVar18._2_14_ = auVar19._2_14_; auVar18._0_2_ = auVar19._0_2_ & 0xff; iVar13 = iVar13 + 8; uVar22 = (ushort)Var4; auVar10._10_2_ = 0; auVar10._0_10_ = auVar18._0_10_; auVar10._12_2_ = uVar22; uVar11 = CONCAT42(auVar10._10_4_,auVar20._4_2_); auVar21._0_4_ = auVar18._0_4_; auVar21._4_2_ = auVar19._2_2_; auVar21._6_10_ = (unkuint10)uVar11 << 0x10; iVar23 = iVar23 + (auVar21._0_4_ & 0xffff); iVar24 = iVar24 + auVar21._4_4_; iVar25 = iVar25 + (int)uVar11; iVar26 = iVar26 + (uint)uVar22; } while (iVar13 < 0x11); _Size = iVar23 + iVar27 + iVar25 + iVar29 + iVar24 + iVar28 + iVar26 + iVar30; if (((int)_Size < 1) || (0x100 < (int)_Size)) { *(undefined4 *)(*in_ECX + 0x14) = 9; (**(code **)*in_ECX)(); } memcpy((void *)(*in_EDX + 0x11),param_2,_Size); memset((void *)(*in_EDX + 0x11 + _Size),0,0x100 - _Size); *(undefined1 *)(*in_EDX + 0x111) = 0; return; } //@@ 00ac22c0 FUN_00ac22c0 void FUN_00ac22c0(int *param_1) { int *piVar1; int iVar2; int iVar3; int tableNo; int *cinfo; bool bVar4; undefined1 *puVar5; undefined4 *puVar6; undefined4 *local_c; int *local_8; cinfo = param_1; iVar2 = param_1[0x6a]; if ((((param_1[0x5c] != 0) || (param_1[0x5d] != 0x3f)) || (param_1[0x5e] != 0)) || (param_1[0x5f] != 0)) { *(undefined4 *)(*param_1 + 0x14) = 0x7d; (**(code **)(*param_1 + 4))(param_1,0xffffffff); } piVar1 = param_1 + 0x4a; param_1 = (int *)0x0; if (0 < *piVar1) { local_c = (undefined4 *)(iVar2 + 0x1c); local_8 = cinfo + 0x4b; do { iVar3 = *(int *)(*local_8 + 0x14); tableNo = *(int *)(*local_8 + 0x18); jpeg_make_d_derived_tbl(cinfo,1,iVar3,(void *)(iVar2 + 0x30 + iVar3 * 4)); jpeg_make_d_derived_tbl(cinfo,0,tableNo,(void *)(iVar2 + 0x40 + tableNo * 4)); param_1 = (int *)((int)param_1 + 1); local_8 = local_8 + 1; *local_c = 0; local_c = local_c + 1; } while ((int)param_1 < cinfo[0x4a]); } if (0 < cinfo[0x51]) { param_1 = cinfo + 0x52; puVar5 = (undefined1 *)(iVar2 + 0xa0); puVar6 = (undefined4 *)(iVar2 + 0x78); do { iVar3 = cinfo[*param_1 + 0x4b]; puVar6[-10] = *(undefined4 *)(iVar2 + 0x30 + *(int *)(iVar3 + 0x14) * 4); *puVar6 = *(undefined4 *)(iVar2 + 0x40 + *(int *)(iVar3 + 0x18) * 4); if (*(char *)(iVar3 + 0x34) == '\0') { *puVar5 = 0; bVar4 = false; } else { *puVar5 = 1; bVar4 = 1 < *(int *)(iVar3 + 0x24); } puVar6 = puVar6 + 1; puVar5[10] = bVar4; param_1 = param_1 + 1; puVar5 = puVar5 + 1; } while ((int)(puVar5 + (-0xa0 - iVar2)) < cinfo[0x51]); } *(undefined4 *)(iVar2 + 0x18) = 0; *(undefined4 *)(iVar2 + 0x14) = 0; *(undefined1 *)(iVar2 + 0x10) = 0; *(int *)(iVar2 + 0x2c) = cinfo[0x3f]; return; } //@@ 00ac2430 jpeg_make_d_derived_tbl /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jdhuff.c: (cinfo ECX, isDC DL, tblno, pdtbl): tblno outside 0..3 or missing dc/ac_huff_tbl_ptrs (cinfo+0xa0/+0xb0) -> JERR_NO_HUFF_TABLE (0x34); builds huffsize[257]/huffcode[257] and lookup tables (memset); 5 call sites from the huffman decoder start_pass functions prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl jpeg_make_d_derived_tbl(void *cinfo,byte isDc,int tableNo,void *outTable) { uint uVar1; byte bVar2; code *pcVar3; int iVar4; int iVar5; uint uVar6; uint *puVar7; int iVar8; int iVar9; int iVar10; uint _Size; undefined4 *puVar11; byte *pbVar12; int local_52c; int local_528; int local_524; uint local_520; uint local_51c; int aiStack_510 [257]; byte local_10c [260]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_10c + 0x108); if ((tableNo < 0) || (3 < tableNo)) { *(undefined4 *)(*(int *)cinfo + 0x14) = 0x34; *(int *)(*(int *)cinfo + 0x18) = tableNo; (*(code *)**(undefined4 **)cinfo)(cinfo); } if (isDc == 0) { iVar4 = *(int *)((int)cinfo + tableNo * 4 + 0xb0); } else { iVar4 = *(int *)((int)cinfo + tableNo * 4 + 0xa0); } if (iVar4 == 0) { *(undefined4 *)(*(int *)cinfo + 0x14) = 0x34; *(int *)(*(int *)cinfo + 0x18) = tableNo; (*(code *)**(undefined4 **)cinfo)(cinfo); } local_528 = *(int *)outTable; if (local_528 == 0) { local_528 = (*(code *)**(undefined4 **)((int)cinfo + 4))(cinfo,1,0x494); *(int *)outTable = local_528; } uVar6 = 0; *(int *)(local_528 + 0x90) = iVar4; iVar9 = 1; local_520 = 0; do { _Size = (uint)*(byte *)(iVar9 + iVar4); uVar1 = _Size + uVar6; if (0x100 < (int)uVar1) { *(undefined4 *)(*(int *)cinfo + 0x14) = 9; (*(code *)**(undefined4 **)cinfo)(cinfo); uVar6 = local_520; } if (_Size != 0) { memset(local_10c + uVar6,iVar9,_Size); uVar6 = uVar1; local_520 = uVar1; } iVar9 = iVar9 + 1; } while (iVar9 < 0x11); if (0x100 < uVar6) { FUN_00aef86f(); pcVar3 = (code *)swi(3); (*pcVar3)(); return; } local_10c[uVar6] = 0; iVar9 = 0; iVar10 = 0; iVar8 = (int)(char)local_10c[0]; if (local_10c[0] != 0) { local_51c = 1 << (local_10c[0] & 0x1f) | 1U >> 0x20 - (local_10c[0] & 0x1f); do { while ((char)local_10c[0] == iVar8) { bVar2 = local_10c[iVar10 + 1]; aiStack_510[iVar10] = iVar9; iVar10 = iVar10 + 1; iVar9 = iVar9 + 1; local_10c[0] = bVar2; } if ((int)local_51c <= iVar9) { *(undefined4 *)(*(int *)cinfo + 0x14) = 9; (*(code *)**(undefined4 **)cinfo)(cinfo); } local_10c[0] = local_10c[iVar10]; iVar9 = iVar9 * 2; local_51c = local_51c << 1 | (uint)((int)local_51c < 0); iVar8 = iVar8 + 1; } while (local_10c[0] != 0); } iVar10 = 0; iVar9 = 1; do { if (*(char *)(iVar9 + iVar4) == '\0') { iVar8 = -1; } else { *(int *)(local_528 + 0x48 + iVar9 * 4) = iVar10 - aiStack_510[iVar10]; iVar10 = iVar10 + (uint)*(byte *)(iVar9 + iVar4); iVar8 = aiStack_510[iVar10 + -1]; } *(int *)(local_528 + iVar9 * 4) = iVar8; iVar9 = iVar9 + 1; } while (iVar9 < 0x11); *(undefined4 *)(local_528 + 0x8c) = 0; *(undefined4 *)(local_528 + 0x44) = 0xfffff; iVar10 = 0; puVar11 = (undefined4 *)(local_528 + 0x94); for (iVar9 = 0x100; iVar9 != 0; iVar9 = iVar9 + -1) { *puVar11 = 0x900; puVar11 = puVar11 + 1; } local_51c = 0; local_52c = 1; local_524 = 7; do { if (*(char *)(local_52c + iVar4) != '\0') { iVar9 = 1 << ((byte)local_524 & 0x1f); iVar8 = 1; pbVar12 = (byte *)(iVar4 + 0x11 + iVar10); do { if (0 < iVar9) { iVar5 = iVar9; puVar7 = (uint *)(local_528 + 0x94 + (aiStack_510[iVar10] << ((byte)local_524 & 0x1f)) * 4 ); do { iVar5 = iVar5 + -1; *puVar7 = (uint)*pbVar12 | local_52c << 8; puVar7 = puVar7 + 1; } while (0 < iVar5); } iVar8 = iVar8 + 1; pbVar12 = pbVar12 + 1; iVar10 = local_51c + 1; local_51c = iVar10; } while (iVar8 <= (int)(uint)*(byte *)(local_52c + iVar4)); } local_52c = local_52c + 1; local_524 = local_524 + -1; } while (-1 < local_524); if ((isDc != 0) && (iVar9 = 0, 0 < (int)local_520)) { do { if ((byte)((*(char *)(*(int *)((int)cinfo + 400) + 9) != '\0') + 0xfU) < *(byte *)(iVar4 + 0x11 + iVar9)) { *(undefined4 *)(*(int *)cinfo + 0x14) = 9; (*(code *)**(undefined4 **)cinfo)(cinfo); } iVar9 = iVar9 + 1; } while (iVar9 < (int)local_520); } return; } //@@ 00ac2780 FUN_00ac2780 undefined4 FUN_00ac2780(int param_1,int param_2) { int *piVar1; char cVar2; uint uVar3; int iVar4; undefined4 *in_ECX; uint in_EDX; int iVar5; byte *pbVar6; int local_c; uint local_8; piVar1 = (int *)in_ECX[4]; pbVar6 = (byte *)*in_ECX; iVar5 = in_ECX[1]; local_c = param_1; local_8 = in_EDX; if (piVar1[99] == 0) { for (; iVar4 = local_c, local_c < 0x19; local_c = local_c + 8) { if (iVar5 == 0) { cVar2 = (**(code **)(piVar1[6] + 0xc))(piVar1); if (cVar2 == '\0') { return 0; } pbVar6 = *(byte **)piVar1[6]; iVar5 = ((undefined4 *)piVar1[6])[1]; } uVar3 = (uint)*pbVar6; iVar5 = iVar5 + -1; pbVar6 = pbVar6 + 1; if (uVar3 == 0xff) { do { if (iVar5 == 0) { cVar2 = (**(code **)(piVar1[6] + 0xc))(piVar1); if (cVar2 == '\0') { return 0; } pbVar6 = *(byte **)piVar1[6]; iVar5 = ((undefined4 *)piVar1[6])[1]; } uVar3 = (uint)*pbVar6; iVar5 = iVar5 + -1; pbVar6 = pbVar6 + 1; } while (uVar3 == 0xff); if (uVar3 != 0) { piVar1[99] = uVar3; goto LAB_00ac283e; } uVar3 = 0xff; } local_8 = local_8 << 8 | uVar3; } } else { LAB_00ac283e: iVar4 = local_c; if (local_c < param_2) { if (*(char *)(piVar1[0x6a] + 0x10) == '\0') { *(undefined4 *)(*piVar1 + 0x14) = 0x78; (**(code **)(*piVar1 + 4))(piVar1,0xffffffff); *(undefined1 *)(piVar1[0x6a] + 0x10) = 1; } iVar4 = 0x19; local_8 = local_8 << (0x19U - (char)local_c & 0x1f); } } *in_ECX = pbVar6; in_ECX[1] = iVar5; in_ECX[3] = iVar4; in_ECX[2] = local_8; return 1; } //@@ 00ac28a0 FUN_00ac28a0 uint FUN_00ac28a0(int param_1,int param_2,int param_3) { int *piVar1; char cVar2; int in_ECX; uint in_EDX; uint uVar3; uint local_8; local_8 = in_EDX; if (param_1 < param_3) { cVar2 = FUN_00ac2780(param_1,param_3); if (cVar2 == '\0') { return 0xffffffff; } local_8 = *(uint *)(in_ECX + 8); param_1 = *(int *)(in_ECX + 0xc); } param_1 = param_1 - param_3; uVar3 = local_8 >> ((byte)param_1 & 0x1f) & (1 << ((byte)param_3 & 0x1f)) - 1U; if (*(int *)(param_2 + param_3 * 4) < (int)uVar3) { do { if (param_1 < 1) { cVar2 = FUN_00ac2780(param_1,1); if (cVar2 == '\0') { return 0xffffffff; } local_8 = *(uint *)(in_ECX + 8); param_1 = *(int *)(in_ECX + 0xc); } param_1 = param_1 + -1; param_3 = param_3 + 1; uVar3 = uVar3 * 2 | local_8 >> ((byte)param_1 & 0x1f) & 1; } while (*(int *)(param_2 + param_3 * 4) < (int)uVar3); } *(uint *)(in_ECX + 8) = local_8; *(int *)(in_ECX + 0xc) = param_1; if (param_3 < 0x11) { return (uint)*(byte *)(*(int *)(param_2 + 0x48 + param_3 * 4) + *(int *)(param_2 + 0x90) + 0x11 + uVar3); } piVar1 = *(int **)(in_ECX + 0x10); *(undefined4 *)(*piVar1 + 0x14) = 0x79; (**(code **)(*piVar1 + 4))(piVar1,0xffffffff); return 0; } //@@ 00ac2980 decode_mcu_fast /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg-turbo jdhuff.c: only caller decode_mcu 00ac3450 (installed at ab6353 as pub.decode_mcu) whose slow path is decode_mcu_slow 00ac2da0; fastcall cinfo/MCU_data, bit buffer from entropy +0x14/+0x18 */ undefined4 decode_mcu_fast(void) { int iVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; char cVar5; int iVar6; sbyte sVar7; int in_ECX; int iVar8; int in_EDX; undefined4 *puVar9; uint uVar10; uint uVar11; uint uVar12; int iVar13; int *local_4c; int local_48; char *local_44; int *local_40; uint local_2c; int local_28; uint local_20; undefined2 *local_1c; int local_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(local_18 + 5); iVar1 = *(int *)(in_ECX + 0x1a8); puVar9 = *(undefined4 **)(in_ECX + 0x18); local_18[0] = *(int *)(iVar1 + 0x1c); local_18[1] = *(undefined4 *)(iVar1 + 0x20); local_18[2] = *(undefined4 *)(iVar1 + 0x24); local_18[3] = *(undefined4 *)(iVar1 + 0x28); uVar10 = *(uint *)(iVar1 + 0x14); uVar2 = *puVar9; uVar3 = puVar9[1]; iVar6 = *(int *)(iVar1 + 0x18); local_48 = 0; if (0 < *(int *)(in_ECX + 0x144)) { local_44 = (char *)(iVar1 + 0xaa); local_40 = (int *)(in_ECX + 0x148); local_4c = (int *)(iVar1 + 0x78); do { if (in_EDX == 0) { local_1c = (undefined2 *)0x0; } else { local_1c = *(undefined2 **)(in_EDX + local_48 * 4); } iVar4 = *local_4c; iVar13 = local_4c[-10]; if (iVar6 < 8) { cVar5 = FUN_00ac2780(iVar6,0); if (cVar5 == '\0') { return 0; } iVar6 = local_28; uVar10 = local_2c; if (7 < local_28) goto LAB_00ac2afa; iVar8 = 1; LAB_00ac2a53: local_20 = FUN_00ac28a0(iVar6,iVar13,iVar8); if ((int)local_20 < 0) { return 0; } iVar6 = local_28; uVar10 = local_2c; } else { LAB_00ac2afa: local_20 = *(uint *)(iVar13 + 0x94 + (uVar10 >> ((char)iVar6 - 8U & 0x1f) & 0xff) * 4); iVar8 = (int)local_20 >> 8; if (8 < iVar8) goto LAB_00ac2a53; local_20 = local_20 & 0xff; iVar6 = iVar6 - iVar8; } iVar13 = 0; if (local_20 != 0) { if (iVar6 < (int)local_20) { cVar5 = FUN_00ac2780(iVar6,local_20); if (cVar5 == '\0') { return 0; } iVar6 = local_28; uVar10 = local_2c; } iVar6 = iVar6 - local_20; iVar13 = 1 << ((byte)local_20 & 0x1f); uVar11 = uVar10 >> ((byte)iVar6 & 0x1f) & iVar13 - 1U; iVar13 = ((int)(uVar11 - (1 << ((byte)local_20 - 1 & 0x1f))) >> 0x1f & 1U - iVar13) + uVar11 ; } if (local_44[-10] != '\0') { iVar8 = *local_40; local_18[iVar8] = local_18[iVar8] + iVar13; if (local_1c != (undefined2 *)0x0) { *local_1c = (short)local_18[iVar8]; } } if ((*local_44 == '\0') || (local_1c == (undefined2 *)0x0)) { local_1c = (undefined2 *)0x1; do { if (iVar6 < 8) { cVar5 = FUN_00ac2780(iVar6,0); if (cVar5 == '\0') { return 0; } iVar6 = local_28; uVar10 = local_2c; if (7 < local_28) goto LAB_00ac2cec; iVar13 = 1; LAB_00ac2c9d: uVar11 = FUN_00ac28a0(iVar6,iVar4,iVar13); if ((int)uVar11 < 0) { return 0; } iVar6 = local_28; uVar10 = local_2c; } else { LAB_00ac2cec: uVar11 = *(uint *)(iVar4 + 0x94 + (uVar10 >> ((char)iVar6 - 8U & 0x1f) & 0xff) * 4); iVar13 = (int)uVar11 >> 8; if (8 < iVar13) goto LAB_00ac2c9d; iVar6 = iVar6 - iVar13; uVar11 = uVar11 & 0xff; } uVar12 = uVar11 & 0xf; if (uVar12 == 0) { if ((int)uVar11 >> 4 != 0xf) break; } else { if (iVar6 < (int)uVar12) { cVar5 = FUN_00ac2780(iVar6,uVar12); if (cVar5 == '\0') { return 0; } iVar6 = local_28; uVar10 = local_2c; } iVar6 = iVar6 - uVar12; } local_1c = (undefined2 *)((int)local_1c + 1 + ((int)uVar11 >> 4)); } while ((int)local_1c < 0x40); } else { iVar13 = 1; do { if (iVar6 < 8) { cVar5 = FUN_00ac2780(iVar6,0); if (cVar5 == '\0') { return 0; } iVar6 = local_28; uVar10 = local_2c; if (7 < local_28) goto LAB_00ac2c1f; iVar8 = 1; LAB_00ac2b75: uVar11 = FUN_00ac28a0(iVar6,iVar4,iVar8); if ((int)uVar11 < 0) { return 0; } iVar6 = local_28; uVar10 = local_2c; } else { LAB_00ac2c1f: uVar11 = *(uint *)(iVar4 + 0x94 + (uVar10 >> ((char)iVar6 - 8U & 0x1f) & 0xff) * 4); iVar8 = (int)uVar11 >> 8; if (8 < iVar8) goto LAB_00ac2b75; iVar6 = iVar6 - iVar8; uVar11 = uVar11 & 0xff; } uVar12 = uVar11 & 0xf; if (uVar12 == 0) { if ((int)uVar11 >> 4 != 0xf) break; iVar13 = iVar13 + 0xf; } else { iVar13 = iVar13 + ((int)uVar11 >> 4); if (iVar6 < (int)uVar12) { cVar5 = FUN_00ac2780(iVar6,uVar12); if (cVar5 == '\0') { return 0; } iVar6 = local_28; uVar10 = local_2c; } iVar6 = iVar6 - uVar12; sVar7 = (sbyte)uVar12; uVar11 = uVar10 >> ((byte)iVar6 & 0x1f) & (1 << sVar7) - 1U; local_1c[(&DAT_00b4fd00)[iVar13]] = ((ushort)((int)(uVar11 - (1 << (sVar7 - 1U & 0x1f))) >> 0x1f) & 1U - (1 << sVar7)) + (short)uVar11; } iVar13 = iVar13 + 1; } while (iVar13 < 0x40); } local_48 = local_48 + 1; local_40 = local_40 + 1; local_4c = local_4c + 1; local_44 = local_44 + 1; } while (local_48 < *(int *)(in_ECX + 0x144)); puVar9 = *(undefined4 **)(in_ECX + 0x18); } *puVar9 = uVar2; *(undefined4 *)(*(int *)(in_ECX + 0x18) + 4) = uVar3; *(int *)(iVar1 + 0x18) = iVar6; *(uint *)(iVar1 + 0x14) = uVar10; *(int *)(iVar1 + 0x1c) = local_18[0]; *(int *)(iVar1 + 0x20) = local_18[1]; *(int *)(iVar1 + 0x24) = local_18[2]; *(int *)(iVar1 + 0x28) = local_18[3]; return 1; } //@@ 00ac2da0 decode_mcu_slow /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: ? libjpeg jdhuff.c entropy decoder: 0xFF byte-stuffing/marker handling into cinfo+0x18c, HUFF_LOOKAHEAD lookup table (nbits<<8|symbol, nbits<9 fast path), loops cinfo->blocks_in_MCU (+0x144) with MCU_membership (+0x148); caller 00ac3450 is the decode_mcu dispatcher */ int decode_mcu_slow(void) { int iVar1; byte *pbVar2; int iVar3; int iVar4; uint uVar5; uint uVar6; uint3 uVar7; sbyte sVar8; int in_ECX; undefined2 *puVar9; undefined4 *in_EDX; uint uVar10; int iVar11; byte *pbVar12; byte *pbVar13; byte *pbVar14; int iVar15; int iVar16; uint uVar17; undefined4 *local_4c; char *local_44; int *local_40; int *local_3c; uint local_28; int local_24; byte *local_20; uint local_1c; int local_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(local_18 + 5); iVar1 = *(int *)(in_ECX + 0x1a8); local_18[0] = *(int *)(iVar1 + 0x1c); local_18[1] = *(undefined4 *)(iVar1 + 0x20); local_18[2] = *(undefined4 *)(iVar1 + 0x24); local_18[3] = *(undefined4 *)(iVar1 + 0x28); pbVar2 = (byte *)**(undefined4 **)(in_ECX + 0x18); iVar3 = (*(undefined4 **)(in_ECX + 0x18))[1]; iVar15 = *(int *)(iVar1 + 0x18); uVar6 = *(uint *)(iVar1 + 0x14); pbVar14 = pbVar2; if (0 < *(int *)(in_ECX + 0x144)) { local_40 = (int *)(in_ECX + 0x148); local_44 = (char *)(iVar1 + 0xaa); local_3c = (int *)(iVar1 + 0x78); local_4c = in_EDX; local_20 = pbVar2; do { if (in_EDX == (undefined4 *)0x0) { puVar9 = (undefined2 *)0x0; } else { puVar9 = (undefined2 *)*local_4c; } iVar11 = local_3c[-10]; iVar4 = *local_3c; pbVar12 = pbVar14; if (iVar15 < 0x11) { uVar5 = uVar6 << 8 | (uint)*pbVar14; uVar10 = (uint)pbVar14[1]; pbVar13 = pbVar14 + 1; if (*pbVar14 == 0xff) { pbVar13 = pbVar14 + 2; if (uVar10 != 0) { *(uint *)(in_ECX + 0x18c) = uVar10; uVar5 = uVar6 << 8; pbVar13 = pbVar14; } } iVar15 = iVar15 + 0x10; uVar6 = uVar5 << 8 | (uint)*pbVar13; pbVar12 = pbVar13 + 1; local_20 = pbVar13 + 1; if (*pbVar13 == 0xff) { pbVar12 = pbVar13 + 2; local_20 = pbVar13 + 2; if (pbVar13[1] != 0) { *(uint *)(in_ECX + 0x18c) = (uint)pbVar13[1]; uVar6 = uVar5 << 8; pbVar12 = pbVar13; local_20 = pbVar13; } } } uVar5 = *(uint *)(iVar11 + 0x94 + (uVar6 >> ((char)iVar15 - 8U & 0x1f) & 0xff) * 4); iVar16 = (int)uVar5 >> 8; iVar15 = iVar15 - iVar16; uVar10 = uVar5 & 0xff; pbVar14 = pbVar12; if (iVar16 < 9) { LAB_00ac2f37: iVar11 = 0; if (uVar10 != 0) { if (iVar15 < 0x11) { uVar5 = uVar6 << 8 | (uint)*pbVar14; uVar17 = (uint)pbVar14[1]; pbVar13 = pbVar14 + 1; if (*pbVar14 == 0xff) { pbVar13 = pbVar14 + 2; if (uVar17 != 0) { *(uint *)(in_ECX + 0x18c) = uVar17; uVar5 = uVar6 << 8; pbVar13 = pbVar12; } } iVar15 = iVar15 + 0x10; uVar6 = uVar5 << 8 | (uint)*pbVar13; pbVar14 = pbVar13 + 1; local_20 = pbVar13 + 1; if (*pbVar13 == 0xff) { pbVar14 = pbVar13 + 2; local_20 = pbVar13 + 2; if (pbVar13[1] != 0) { *(uint *)(in_ECX + 0x18c) = (uint)pbVar13[1]; uVar6 = uVar5 << 8; pbVar14 = pbVar13; local_20 = pbVar13; } } } iVar15 = iVar15 - uVar10; iVar11 = 1 << ((byte)uVar10 & 0x1f); uVar5 = uVar6 >> ((byte)iVar15 & 0x1f) & iVar11 - 1U; iVar11 = ((int)(uVar5 - (1 << ((byte)uVar10 - 1 & 0x1f))) >> 0x1f & 1U - iVar11) + uVar5; } } else { local_28 = uVar6 >> ((byte)iVar15 & 0x1f) & (1 << ((byte)(uVar5 >> 8) & 0x1f)) - 1U; if (*(int *)(iVar11 + iVar16 * 4) < (int)local_28) { do { iVar15 = iVar15 + -1; iVar16 = iVar16 + 1; local_28 = local_28 * 2 | uVar6 >> ((byte)iVar15 & 0x1f) & 1; } while (*(int *)(iVar11 + iVar16 * 4) < (int)local_28); pbVar14 = local_20; } if (iVar16 < 0x11) { uVar10 = (uint)*(byte *)((*(int *)(iVar11 + 0x48 + iVar16 * 4) + local_28 & 0xff) + 0x11 + *(int *)(iVar11 + 0x90)); goto LAB_00ac2f37; } iVar11 = 0; } if (local_44[-10] != '\0') { iVar16 = *local_40; local_18[iVar16] = local_18[iVar16] + iVar11; if (puVar9 != (undefined2 *)0x0) { *puVar9 = (short)local_18[iVar16]; } } if ((*local_44 == '\0') || (puVar9 == (undefined2 *)0x0)) { local_24 = 1; do { pbVar12 = pbVar14; if (iVar15 < 0x11) { uVar5 = uVar6 << 8 | (uint)*pbVar14; uVar10 = (uint)pbVar14[1]; pbVar13 = pbVar14 + 1; if (*pbVar14 == 0xff) { pbVar13 = pbVar14 + 2; if (uVar10 != 0) { *(uint *)(in_ECX + 0x18c) = uVar10; uVar5 = uVar6 << 8; pbVar13 = pbVar14; } } iVar15 = iVar15 + 0x10; uVar6 = uVar5 << 8 | (uint)*pbVar13; pbVar12 = pbVar13 + 1; local_20 = pbVar13 + 1; if (*pbVar13 == 0xff) { pbVar12 = pbVar13 + 2; local_20 = pbVar13 + 2; if (pbVar13[1] != 0) { *(uint *)(in_ECX + 0x18c) = (uint)pbVar13[1]; uVar6 = uVar5 << 8; pbVar12 = pbVar13; local_20 = pbVar13; } } } uVar5 = *(uint *)(iVar4 + 0x94 + (uVar6 >> ((char)iVar15 - 8U & 0x1f) & 0xff) * 4); iVar11 = (int)uVar5 >> 8; iVar15 = iVar15 - iVar11; uVar10 = uVar5 & 0xff; pbVar14 = pbVar12; if (8 < iVar11) { local_1c = uVar6 >> ((byte)iVar15 & 0x1f) & (1 << ((byte)(uVar5 >> 8) & 0x1f)) - 1U; if (*(int *)(iVar4 + iVar11 * 4) < (int)local_1c) { do { iVar15 = iVar15 + -1; iVar11 = iVar11 + 1; local_1c = local_1c * 2 | uVar6 >> ((byte)iVar15 & 0x1f) & 1; } while (*(int *)(iVar4 + iVar11 * 4) < (int)local_1c); pbVar14 = local_20; } if (0x10 < iVar11) break; uVar10 = (uint)*(byte *)((*(int *)(iVar4 + 0x48 + iVar11 * 4) + local_1c & 0xff) + 0x11 + *(int *)(iVar4 + 0x90)); } if ((uVar10 & 0xf) == 0) { if (uVar10 >> 4 != 0xf) break; } else { if (iVar15 < 0x11) { uVar5 = uVar6 << 8 | (uint)*pbVar14; uVar17 = (uint)pbVar14[1]; pbVar13 = pbVar14 + 1; if (*pbVar14 == 0xff) { pbVar13 = pbVar14 + 2; if (uVar17 != 0) { *(uint *)(in_ECX + 0x18c) = uVar17; uVar5 = uVar6 << 8; pbVar13 = pbVar12; } } iVar15 = iVar15 + 0x10; uVar6 = uVar5 << 8 | (uint)*pbVar13; pbVar14 = pbVar13 + 1; local_20 = pbVar13 + 1; if (*pbVar13 == 0xff) { pbVar14 = pbVar13 + 2; local_20 = pbVar13 + 2; if (pbVar13[1] != 0) { *(uint *)(in_ECX + 0x18c) = (uint)pbVar13[1]; uVar6 = uVar5 << 8; pbVar14 = pbVar13; local_20 = pbVar13; } } } iVar15 = iVar15 - (uVar10 & 0xf); } local_24 = local_24 + 1 + (uVar10 >> 4); } while (local_24 < 0x40); } else { local_28 = 1; do { pbVar12 = pbVar14; if (iVar15 < 0x11) { uVar5 = uVar6 << 8 | (uint)*pbVar14; uVar10 = (uint)pbVar14[1]; pbVar13 = pbVar14 + 1; if (*pbVar14 == 0xff) { pbVar13 = pbVar14 + 2; if (uVar10 != 0) { *(uint *)(in_ECX + 0x18c) = uVar10; uVar5 = uVar6 << 8; pbVar13 = pbVar14; } } iVar15 = iVar15 + 0x10; uVar6 = uVar5 << 8 | (uint)*pbVar13; pbVar12 = pbVar13 + 1; local_20 = pbVar13 + 1; if (*pbVar13 == 0xff) { pbVar12 = pbVar13 + 2; local_20 = pbVar13 + 2; if (pbVar13[1] != 0) { *(uint *)(in_ECX + 0x18c) = (uint)pbVar13[1]; uVar6 = uVar5 << 8; pbVar12 = pbVar13; local_20 = pbVar13; } } } uVar5 = *(uint *)(iVar4 + 0x94 + (uVar6 >> ((char)iVar15 - 8U & 0x1f) & 0xff) * 4); iVar11 = (int)uVar5 >> 8; iVar15 = iVar15 - iVar11; uVar10 = uVar5 & 0xff; pbVar14 = pbVar12; if (8 < iVar11) { local_1c = uVar6 >> ((byte)iVar15 & 0x1f) & (1 << ((byte)(uVar5 >> 8) & 0x1f)) - 1U; if (*(int *)(iVar4 + iVar11 * 4) < (int)local_1c) { do { iVar15 = iVar15 + -1; iVar11 = iVar11 + 1; local_1c = local_1c * 2 | uVar6 >> ((byte)iVar15 & 0x1f) & 1; } while (*(int *)(iVar4 + iVar11 * 4) < (int)local_1c); pbVar14 = local_20; } if (0x10 < iVar11) break; uVar10 = (uint)*(byte *)((*(int *)(iVar4 + 0x48 + iVar11 * 4) + local_1c & 0xff) + 0x11 + *(int *)(iVar4 + 0x90)); } uVar5 = uVar10 & 0xf; if (uVar5 == 0) { if (uVar10 >> 4 != 0xf) break; iVar11 = local_28 + 0xf; } else { iVar11 = local_28 + (uVar10 >> 4); if (iVar15 < 0x11) { uVar10 = uVar6 << 8 | (uint)*pbVar14; uVar17 = (uint)pbVar14[1]; pbVar13 = pbVar14 + 1; if (*pbVar14 == 0xff) { pbVar13 = pbVar14 + 2; if (uVar17 != 0) { *(uint *)(in_ECX + 0x18c) = uVar17; uVar10 = uVar6 << 8; pbVar13 = pbVar12; } } iVar15 = iVar15 + 0x10; uVar6 = uVar10 << 8 | (uint)*pbVar13; pbVar14 = pbVar13 + 1; local_20 = pbVar13 + 1; if (*pbVar13 == 0xff) { pbVar14 = pbVar13 + 2; local_20 = pbVar13 + 2; if (pbVar13[1] != 0) { *(uint *)(in_ECX + 0x18c) = (uint)pbVar13[1]; uVar6 = uVar10 << 8; pbVar14 = pbVar13; local_20 = pbVar13; } } } iVar15 = iVar15 - uVar5; sVar8 = (sbyte)uVar5; uVar5 = uVar6 >> ((byte)iVar15 & 0x1f) & (1 << sVar8) - 1U; puVar9[(&DAT_00b4fd00)[iVar11]] = ((ushort)((int)(uVar5 - (1 << (sVar8 - 1U & 0x1f))) >> 0x1f) & 1U - (1 << sVar8)) + (short)uVar5; } local_28 = iVar11 + 1; } while ((int)local_28 < 0x40); } local_44 = local_44 + 1; local_4c = local_4c + 1; local_3c = local_3c + 1; local_40 = local_40 + 1; } while ((int)(local_44 + (-0xaa - iVar1)) < *(int *)(in_ECX + 0x144)); } uVar7 = (uint3)(uVar6 >> 8); if (*(int *)(in_ECX + 0x18c) == 0) { **(undefined4 **)(in_ECX + 0x18) = pbVar14; *(byte **)(*(int *)(in_ECX + 0x18) + 4) = pbVar2 + (iVar3 - (int)pbVar14); *(uint *)(iVar1 + 0x14) = uVar6; *(int *)(iVar1 + 0x18) = iVar15; *(int *)(iVar1 + 0x1c) = local_18[0]; *(int *)(iVar1 + 0x20) = local_18[1]; *(int *)(iVar1 + 0x24) = local_18[2]; *(int *)(iVar1 + 0x28) = local_18[3]; return CONCAT31(uVar7,1); } *(undefined4 *)(in_ECX + 0x18c) = 0; return (uint)uVar7 << 8; } //@@ 00ac3450 FUN_00ac3450 undefined4 FUN_00ac3450(int param_1) { int *piVar1; int iVar2; bool bVar3; char cVar4; int iVar5; undefined4 *puVar6; bVar3 = true; iVar2 = *(int *)(param_1 + 0x1a8); if (*(int *)(param_1 + 0xfc) != 0) { if (*(int *)(iVar2 + 0x2c) == 0) { piVar1 = (int *)(*(int *)(param_1 + 0x1a4) + 0x14); *piVar1 = *piVar1 + ((int)(*(int *)(iVar2 + 0x18) + (*(int *)(iVar2 + 0x18) >> 0x1f & 7U)) >> 3); *(undefined4 *)(iVar2 + 0x18) = 0; cVar4 = (**(code **)(*(int *)(param_1 + 0x1a4) + 8))(param_1); if (cVar4 == '\0') { return 0; } iVar5 = 0; if (0 < *(int *)(param_1 + 0x128)) { puVar6 = (undefined4 *)(iVar2 + 0x1c); do { *puVar6 = 0; puVar6 = puVar6 + 1; iVar5 = iVar5 + 1; } while (iVar5 < *(int *)(param_1 + 0x128)); } *(undefined4 *)(iVar2 + 0x2c) = *(undefined4 *)(param_1 + 0xfc); if (*(int *)(param_1 + 0x18c) == 0) { *(undefined1 *)(iVar2 + 0x10) = 0; } } bVar3 = false; } if ((*(uint *)(*(int *)(param_1 + 0x18) + 4) < (uint)(*(int *)(param_1 + 0x144) << 9)) || (*(int *)(param_1 + 0x18c) != 0)) { bVar3 = false; } if ((*(char *)(iVar2 + 0x10) == '\0') && (((!bVar3 || (cVar4 = decode_mcu_slow(), cVar4 == '\0')) && (cVar4 = decode_mcu_fast(), cVar4 == '\0')))) { return 0; } if (*(int *)(param_1 + 0xfc) != 0) { *(int *)(iVar2 + 0x2c) = *(int *)(iVar2 + 0x2c) + -1; } return 1; } //@@ 00ac3540 FUN_00ac3540 void FUN_00ac3540(int param_1,int param_2,undefined4 param_3,int param_4) { short *psVar1; int iVar2; short sVar3; int iVar4; int iVar5; byte *pbVar6; short sVar7; int local_c; iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(*(int *)(param_1 + 0x1b8) + 0x1c); local_c = 0; if (0 < param_4) { do { pbVar6 = *(byte **)(param_2 + local_c * 4); for (iVar2 = iVar4; iVar2 != 0; iVar2 = iVar2 + -1) { psVar1 = (short *)(*(int *)(iVar5 + (uint)(*pbVar6 >> 3) * 4) + ((uint)(pbVar6[1] >> 2) * 0x20 + (uint)(pbVar6[2] >> 3)) * 2); sVar3 = *psVar1; *psVar1 = sVar3 + 1; sVar7 = sVar3 + 1; if ((short)(sVar3 + 1) == 0) { sVar7 = sVar3; } *psVar1 = sVar7; pbVar6 = pbVar6 + 3; } local_c = local_c + 1; } while (local_c < param_4); } return; } //@@ 00ac35e0 libjpeg_update_box /* DB: libjpeg jquant2.c update_box: shrinks c0/c1/c2 min/max of a box by scanning histogram (cquantize+0x1c, 32 c2 cells x UINT16) for non-zero cells; 3 calls from median_cut (FUN_00ac39d0, b1+b2) and select_colors (FUN_00ac3bb0) */ void libjpeg_update_box(void) { short sVar1; int iVar2; int in_ECX; short *psVar3; int iVar4; int *in_EDX; int iVar5; int iVar6; int iVar7; int iVar8; int local_30; short *local_2c; short *local_28; int local_24; int local_20; int local_14; int local_10; int local_c; int local_8; iVar2 = *(int *)(*(int *)(in_ECX + 0x1b8) + 0x1c); local_14 = *in_EDX; local_10 = in_EDX[1]; local_c = in_EDX[2]; local_20 = in_EDX[3]; local_8 = in_EDX[4]; iVar8 = in_EDX[5]; if (local_14 < local_10) { local_24 = local_14; do { if (local_c <= local_20) { psVar3 = (short *)(*(int *)(iVar2 + local_24 * 4) + (local_c * 0x20 + local_8) * 2); iVar5 = local_8; local_28 = psVar3; iVar6 = local_c; do { for (; iVar5 <= iVar8; iVar5 = iVar5 + 1) { sVar1 = *psVar3; psVar3 = psVar3 + 1; if (sVar1 != 0) { local_14 = local_24; *in_EDX = local_24; if (local_24 < local_10) goto LAB_00ac3698; goto LAB_00ac370e; } } iVar6 = iVar6 + 1; psVar3 = local_28 + 0x20; iVar5 = local_8; local_28 = psVar3; } while (iVar6 <= local_20); } local_24 = local_24 + 1; } while (local_24 <= local_10); LAB_00ac3698: local_24 = local_10; do { if (local_c <= local_20) { psVar3 = (short *)(*(int *)(iVar2 + local_24 * 4) + (local_c * 0x20 + local_8) * 2); iVar5 = local_8; local_28 = psVar3; iVar6 = local_c; do { for (; iVar5 <= iVar8; iVar5 = iVar5 + 1) { sVar1 = *psVar3; psVar3 = psVar3 + 1; if (sVar1 != 0) { local_10 = local_24; in_EDX[1] = local_24; goto LAB_00ac370e; } } iVar6 = iVar6 + 1; psVar3 = local_28 + 0x20; iVar5 = local_8; local_28 = psVar3; } while (iVar6 <= local_20); } local_24 = local_24 + -1; } while (local_14 <= local_24); } LAB_00ac370e: if (local_c < local_20) { local_28 = (short *)((local_c * 0x20 + local_8) * 2); iVar5 = local_14; local_24 = local_c; do { for (; iVar5 <= local_10; iVar5 = iVar5 + 1) { psVar3 = (short *)(*(int *)(iVar2 + iVar5 * 4) + (int)local_28); for (iVar6 = local_8; iVar6 <= iVar8; iVar6 = iVar6 + 1) { sVar1 = *psVar3; psVar3 = psVar3 + 1; if (sVar1 != 0) { local_c = local_24; in_EDX[2] = local_24; if (local_24 < local_20) goto LAB_00ac3784; goto LAB_00ac37f3; } } } local_24 = local_24 + 1; local_28 = (short *)((int)local_28 + 0x40); iVar5 = local_14; } while (local_24 <= local_20); LAB_00ac3784: local_28 = (short *)((local_20 * 0x20 + local_8) * 2); iVar5 = local_14; local_24 = local_20; do { for (; iVar5 <= local_10; iVar5 = iVar5 + 1) { psVar3 = (short *)(*(int *)(iVar2 + iVar5 * 4) + (int)local_28); for (iVar6 = local_8; iVar6 <= iVar8; iVar6 = iVar6 + 1) { sVar1 = *psVar3; psVar3 = psVar3 + 1; if (sVar1 != 0) { local_20 = local_24; in_EDX[3] = local_24; goto LAB_00ac37f3; } } } local_24 = local_24 + -1; local_28 = (short *)((int)local_28 + -0x40); iVar5 = local_14; } while (local_c <= local_24); } LAB_00ac37f3: if (local_8 < iVar8) { local_24 = local_8; do { if (local_14 <= local_10) { iVar5 = local_14; do { psVar3 = (short *)(*(int *)(iVar2 + iVar5 * 4) + (local_c * 0x20 + local_24) * 2); for (iVar6 = local_c; iVar6 <= local_20; iVar6 = iVar6 + 1) { if (*psVar3 != 0) { local_8 = local_24; in_EDX[4] = local_24; if (local_24 < iVar8) goto LAB_00ac3864; goto LAB_00ac38c7; } psVar3 = psVar3 + 0x20; } iVar5 = iVar5 + 1; } while (iVar5 <= local_10); } local_24 = local_24 + 1; } while (local_24 <= iVar8); LAB_00ac3864: local_24 = iVar8; do { if (local_14 <= local_10) { iVar5 = local_14; do { psVar3 = (short *)(*(int *)(iVar2 + iVar5 * 4) + (local_c * 0x20 + local_24) * 2); for (iVar6 = local_c; iVar6 <= local_20; iVar6 = iVar6 + 1) { if (*psVar3 != 0) { in_EDX[5] = local_24; iVar8 = local_24; goto LAB_00ac38c7; } psVar3 = psVar3 + 0x20; } iVar5 = iVar5 + 1; } while (iVar5 <= local_10); } local_24 = local_24 + -1; } while (local_8 <= local_24); } LAB_00ac38c7: iVar5 = *(int *)(in_ECX + 0x2c); iVar7 = (local_10 - local_14) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e250 + iVar5 * 4) * 4) * 8; iVar6 = 0; iVar4 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e2f0 + iVar5 * 4) * 4) * (local_20 - local_c) * 4; iVar5 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e1f0 + iVar5 * 4) * 4) * (iVar8 - local_8) * 8; in_EDX[6] = iVar5 * iVar5 + iVar4 * iVar4 + iVar7 * iVar7; if (local_10 < local_14) { in_EDX[7] = 0; return; } do { if (local_c <= local_20) { local_30 = (local_20 - local_c) + 1; local_2c = (short *)(*(int *)(iVar2 + local_14 * 4) + (local_c * 0x20 + local_8) * 2); do { if (local_8 <= iVar8) { iVar5 = (iVar8 - local_8) + 1; psVar3 = local_2c; iVar4 = iVar6; do { sVar1 = *psVar3; psVar3 = psVar3 + 1; iVar6 = iVar4 + 1; if (sVar1 == 0) { iVar6 = iVar4; } iVar5 = iVar5 + -1; iVar4 = iVar6; } while (iVar5 != 0); } local_2c = local_2c + 0x20; local_30 = local_30 + -1; } while (local_30 != 0); } local_14 = local_14 + 1; } while (local_14 <= local_10); in_EDX[7] = iVar6; return; } //@@ 00ac39d0 FUN_00ac39d0 int FUN_00ac39d0(undefined4 param_1,int param_2) { char cVar1; int *piVar2; int in_ECX; int *piVar3; int *in_EDX; int iVar4; int iVar5; int iVar6; int iVar7; int local_1c; int local_14; int *local_8; local_14 = 1; if (param_2 < 2) { return 1; } local_8 = in_EDX + 0xb; local_1c = 2; do { if (param_2 < local_1c) { iVar5 = 0; piVar3 = (int *)0x0; iVar6 = local_14; piVar2 = in_EDX; if (0 < local_14) { do { if (iVar5 < piVar2[6]) { iVar5 = piVar2[6]; piVar3 = piVar2; } piVar2 = piVar2 + 8; iVar6 = iVar6 + -1; } while (iVar6 != 0); } } else { iVar6 = 0; piVar3 = (int *)0x0; if (0 < local_14) { piVar2 = in_EDX + 6; iVar5 = local_14; do { if ((iVar6 < piVar2[1]) && (0 < *piVar2)) { piVar3 = piVar2 + -6; iVar6 = piVar2[1]; } piVar2 = piVar2 + 8; iVar5 = iVar5 + -1; } while (iVar5 != 0); } } if (piVar3 == (int *)0x0) { return local_14; } local_8[-2] = piVar3[1]; *local_8 = piVar3[3]; local_8[2] = piVar3[5]; local_8[-3] = *piVar3; local_8[-1] = piVar3[2]; local_8[1] = piVar3[4]; iVar6 = *(int *)(in_ECX + 0x2c); iVar5 = (piVar3[3] - piVar3[2]) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e2f0 + iVar6 * 4) * 4) * 4; iVar7 = (piVar3[1] - *piVar3) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e250 + iVar6 * 4) * 4) * 8; iVar4 = (piVar3[5] - piVar3[4]) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e1f0 + iVar6 * 4) * 4) * 8; if (*(int *)(&DAT_00b5e250 + iVar6 * 4) == 0) { iVar6 = iVar7; if (iVar7 <= iVar5) { iVar6 = iVar5; } cVar1 = iVar7 <= iVar5; if (iVar6 < iVar4) { cVar1 = '\x02'; } LAB_00ac3b0a: if (cVar1 == '\0') goto LAB_00ac3b4a; if (cVar1 == '\x01') { iVar6 = (piVar3[3] + piVar3[2]) / 2; piVar3[3] = iVar6; local_8[-1] = iVar6 + 1; } else if (cVar1 == '\x02') { iVar6 = (piVar3[5] + piVar3[4]) / 2; piVar3[5] = iVar6; local_8[1] = iVar6 + 1; } } else { cVar1 = (iVar5 < iVar4) + '\x01'; if (iVar4 <= iVar5) { iVar4 = iVar5; } if (iVar7 <= iVar4) goto LAB_00ac3b0a; LAB_00ac3b4a: iVar6 = (piVar3[1] + *piVar3) / 2; piVar3[1] = iVar6; local_8[-3] = iVar6 + 1; } libjpeg_update_box(); libjpeg_update_box(); local_14 = local_14 + 1; local_1c = local_1c + 2; local_8 = local_8 + 8; if (param_2 <= local_14) { return local_14; } } while( true ); } //@@ 00ac3bb0 select_colors /* DB: libjpeg(-turbo) jquant2.c: alloc_small boxlist, box[0] = c0 0..31, c1 0..63, c2 0..31, update_box (FUN_00ac35e0), median_cut (FUN_00ac39d0), compute_color per box; from finish_pass1 FUN_00ac4950 */ void select_colors(void) { int iVar1; undefined4 *puVar2; int iVar3; uint uVar4; int *in_ECX; undefined4 extraout_ECX; int iVar5; int iVar6; int iVar7; int iVar8; ushort *puVar9; int local_2c; ushort *local_28; int local_24; int local_20; int local_1c; int local_18; int local_14; int local_10; int local_c; int *local_8; puVar2 = (undefined4 *)(**(code **)in_ECX[1])(); local_8 = puVar2 + 2; *local_8 = 0; *puVar2 = 0; puVar2[1] = 0x1f; puVar2[3] = 0x3f; puVar2[4] = 0; puVar2[5] = 0x1f; libjpeg_update_box(); iVar3 = FUN_00ac39d0(extraout_ECX); local_c = 0; if (0 < iVar3) { do { iVar8 = *local_8; iVar1 = local_8[2]; local_10 = local_8[-2]; local_18 = 0; local_1c = 0; local_20 = 0; local_24 = 0; iVar6 = 0; iVar5 = 0; iVar7 = 0; if (local_10 <= local_8[-1]) { local_14 = local_10 * 8 + 4; do { if (iVar8 <= local_8[1]) { iVar6 = iVar8 * 4 + 2; local_28 = (ushort *) (*(int *)(*(int *)(in_ECX[0x6e] + 0x1c) + local_10 * 4) + (iVar8 * 0x20 + iVar1) * 2); local_2c = (local_8[1] - iVar8) + 1; do { if (iVar1 <= local_8[3]) { iVar5 = iVar1 * 8 + 4; iVar7 = (local_8[3] - local_8[2]) + 1; puVar9 = local_28; do { uVar4 = (uint)*puVar9; puVar9 = puVar9 + 1; if (uVar4 != 0) { local_18 = local_18 + uVar4; local_1c = local_1c + local_14 * uVar4; local_20 = local_20 + iVar6 * uVar4; local_24 = local_24 + iVar5 * uVar4; } iVar5 = iVar5 + 8; iVar7 = iVar7 + -1; } while (iVar7 != 0); } local_28 = local_28 + 0x20; iVar6 = iVar6 + 4; local_2c = local_2c + -1; } while (local_2c != 0); } local_10 = local_10 + 1; local_14 = local_14 + 8; } while (local_10 <= local_8[-1]); iVar6 = local_1c; iVar5 = local_20; iVar7 = local_18; } iVar8 = iVar7 >> 1; *(char *)(local_c + *(int *)in_ECX[0x1d]) = (char)((iVar6 + iVar8) / iVar7); *(char *)(local_c + *(int *)(in_ECX[0x1d] + 4)) = (char)((iVar8 + iVar5) / iVar7); local_8 = local_8 + 8; *(char *)(local_c + *(int *)(in_ECX[0x1d] + 8)) = (char)((local_24 + iVar8) / iVar7); local_c = local_c + 1; } while (local_c < iVar3); } in_ECX[0x1c] = iVar3; *(undefined4 *)(*in_ECX + 0x14) = 0x62; *(int *)(*in_ECX + 0x18) = iVar3; (**(code **)(*in_ECX + 4))(in_ECX,1); return; } //@@ 00ac3dc0 find_nearby_colors /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jquant2.c: ECX=cinfo (actual_number_of_colors +0x70, colormap +0x74), (minc0 EDX, minc1, minc2, colorlist): per colormap entry computes min/max distance with the c0/c1/c2 scale tables (DAT_00b5dfa4 indexed by rgb_red/green/blue[out_color_space]), mindist[256] local, keeps colors within minmaxdist, returns ncolors; callers are the two fill_inverse_cmap users 00ac42c0/00ac43f0 pass2_no_dither int find_nearby_colors(int param_1,int param_2,int param_3) { int iVar1; int *piVar2; int iVar3; int iVar4; int iVar5; int iVar6; uint uVar7; int iVar8; int iVar9; int iVar10; int in_ECX; int iVar11; int iVar12; int iVar13; int in_EDX; int iVar14; int iVar15; byte *pbVar16; int local_424; int local_420; int aiStack_408 [256]; uint local_8; local_8 = __security_cookie ^ (uint)(aiStack_408 + 0x101); local_420 = 0x7fffffff; iVar1 = *(int *)(in_ECX + 0x70); local_424 = 0; iVar10 = param_1 + 0x1c; iVar13 = param_2 + 0x18; if (iVar1 < 1) { return 0; } piVar2 = *(int **)(in_ECX + 0x74); iVar3 = *(int *)(in_ECX + 0x2c); pbVar16 = (byte *)piVar2[1]; iVar4 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e250 + iVar3 * 4) * 4); iVar5 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e2f0 + iVar3 * 4) * 4); iVar3 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e1f0 + iVar3 * 4) * 4); iVar6 = *piVar2 - (int)pbVar16; iVar11 = piVar2[2] - (int)pbVar16; do { uVar7 = (uint)pbVar16[iVar6]; if ((int)uVar7 < in_EDX) { iVar15 = (uVar7 - in_EDX) * iVar4; iVar15 = iVar15 * iVar15; iVar8 = uVar7 - (in_EDX + 0x18); } else { iVar8 = in_EDX + 0x18; if (iVar8 < (int)uVar7) { iVar15 = (uVar7 - iVar8) * iVar4; iVar15 = iVar15 * iVar15; } else { iVar15 = 0; if ((int)uVar7 <= in_EDX * 2 + 0x18 >> 1) { iVar8 = uVar7 - iVar8; goto LAB_00ac3ed4; } } iVar8 = uVar7 - in_EDX; } LAB_00ac3ed4: uVar7 = (uint)*pbVar16; if ((int)uVar7 < param_1) { iVar12 = (uVar7 - param_1) * iVar5; iVar14 = (uVar7 - iVar10) * iVar5; iVar15 = iVar15 + iVar12 * iVar12; iVar14 = iVar14 * iVar14; } else { if (iVar10 < (int)uVar7) { iVar14 = (uVar7 - iVar10) * iVar5; iVar15 = iVar15 + iVar14 * iVar14; iVar14 = uVar7 - param_1; } else if (param_1 + iVar10 >> 1 < (int)uVar7) { iVar14 = uVar7 - param_1; } else { iVar14 = uVar7 - iVar10; } iVar14 = iVar14 * iVar5 * iVar14 * iVar5; } uVar7 = (uint)pbVar16[iVar11]; if ((int)uVar7 < param_2) { iVar9 = (uVar7 - param_2) * iVar3; iVar12 = (uVar7 - iVar13) * iVar3; iVar15 = iVar15 + iVar9 * iVar9; iVar12 = iVar12 * iVar12; } else { if (iVar13 < (int)uVar7) { iVar12 = (uVar7 - iVar13) * iVar3; iVar15 = iVar15 + iVar12 * iVar12; LAB_00ac3fae: iVar12 = param_2; } else { iVar12 = iVar13; if (iVar13 + param_2 >> 1 < (int)uVar7) goto LAB_00ac3fae; } iVar12 = (uVar7 - iVar12) * iVar3; iVar12 = iVar12 * iVar12; } iVar12 = iVar12 + iVar14 + iVar8 * iVar4 * iVar8 * iVar4; if (local_420 <= iVar12) { iVar12 = local_420; } pbVar16 = pbVar16 + 1; aiStack_408[local_424] = iVar15; local_424 = local_424 + 1; local_420 = iVar12; if (iVar1 <= local_424) { iVar10 = 0; iVar13 = 0; do { if (aiStack_408[iVar13] <= iVar12) { *(char *)(param_3 + iVar10) = (char)iVar13; iVar10 = iVar10 + 1; } iVar13 = iVar13 + 1; } while (iVar13 < iVar1); return iVar10; } } while( true ); } //@@ 00ac4060 find_best_colors /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jquant2.c: (minc0, minc1, minc2, numcolors, colorlist, bestcolor) via ECX cinfo: inits 128 bestdist to 0x7fffffff, per candidate color incremental distance over the 4x8x4 box with c0/c1/c2 scale tables; called by fill_inverse_cmap FUN_00ac42c0 after find_nearby_colors FUN_00ac3dc0 */ void find_best_colors(int param_1,int param_2,int param_3,int param_4,byte *param_5) { byte bVar1; int iVar2; int iVar3; int in_ECX; int iVar4; int iVar5; int iVar6; int in_EDX; int iVar7; int iVar8; int *piVar9; byte *pbVar10; int iVar11; uint uVar12; int local_230; int local_22c; int local_228; int local_220; int local_21c; int local_218; int local_210; int local_208 [128]; uint local_8; local_8 = __security_cookie ^ (uint)(local_208 + 0x81); piVar9 = local_208; for (iVar4 = 0x80; iVar4 != 0; iVar4 = iVar4 + -1) { *piVar9 = 0x7fffffff; piVar9 = piVar9 + 1; } local_230 = 0; if (0 < param_3) { iVar4 = *(int *)(in_ECX + 0x2c); do { bVar1 = *(byte *)(local_230 + param_4); piVar9 = *(int **)(in_ECX + 0x74); uVar12 = (uint)bVar1; iVar6 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e250 + iVar4 * 4) * 4); iVar7 = (in_EDX - (uint)*(byte *)(uVar12 + *piVar9)) * iVar6; iVar2 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e2f0 + iVar4 * 4) * 4); iVar8 = (param_1 - (uint)*(byte *)(piVar9[1] + uVar12)) * iVar2; iVar3 = *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e1f0 + iVar4 * 4) * 4); iVar5 = (param_2 - (uint)*(byte *)(piVar9[2] + uVar12)) * iVar3; local_21c = 3; local_210 = iVar5 * iVar5 + iVar8 * iVar8 + iVar7 * iVar7; piVar9 = local_208; local_218 = (iVar7 + iVar6 * 4) * iVar6 * 0x10; pbVar10 = param_5; do { local_22c = 7; iVar6 = local_210; local_228 = (iVar8 + iVar2 * 2) * iVar2 * 8; do { local_220 = 3; iVar7 = iVar6; iVar11 = (iVar5 + iVar3 * 4) * iVar3 * 0x10; do { if (iVar7 < *piVar9) { *piVar9 = iVar7; *pbVar10 = bVar1; } iVar7 = iVar7 + iVar11; piVar9 = piVar9 + 1; pbVar10 = pbVar10 + 1; iVar4 = *(int *)(in_ECX + 0x2c); iVar11 = iVar11 + *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e1f0 + iVar4 * 4) * 4) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e1f0 + iVar4 * 4) * 4) * 0x80; local_220 = local_220 + -1; } while (-1 < local_220); iVar6 = iVar6 + local_228; local_228 = local_228 + *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e2f0 + iVar4 * 4) * 4) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e2f0 + iVar4 * 4) * 4) * 0x20; local_22c = local_22c + -1; } while (-1 < local_22c); local_210 = local_210 + local_218; local_218 = local_218 + *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e250 + iVar4 * 4) * 4) * *(int *)(&DAT_00b5dfa4 + *(int *)(&DAT_00b5e250 + iVar4 * 4) * 4) * 0x80; local_21c = local_21c + -1; } while (-1 < local_21c); local_230 = local_230 + 1; } while (local_230 < param_3); } return; } //@@ 00ac42c0 FUN_00ac42c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00ac42c0(int param_1,int param_2) { byte *pbVar1; undefined4 uVar2; byte *pbVar3; int in_ECX; int in_EDX; short *psVar4; int *piVar5; int iVar6; int iVar7; int iVar8; int local_18c; undefined1 local_188 [256]; byte local_88 [128]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_88 + 0x84); iVar7 = *(int *)(*(int *)(in_ECX + 0x1b8) + 0x1c); iVar6 = (param_2 >> 2) * 0x20 + 4; iVar8 = (param_1 >> 3) * 0x20 + 2; uVar2 = find_nearby_colors(iVar8,iVar6,local_188); find_best_colors(iVar8,iVar6,uVar2,local_188,local_88); pbVar3 = local_88; piVar5 = (int *)((in_EDX >> 2) * 0x10 + iVar7); local_18c = 4; do { iVar6 = 8; iVar7 = ((param_1 >> 3) * 0x40 + (param_2 >> 2)) * 8; do { psVar4 = (short *)(*piVar5 + iVar7); iVar7 = iVar7 + 0x40; *psVar4 = *pbVar3 + 1; psVar4[1] = pbVar3[1] + 1; psVar4[2] = pbVar3[2] + 1; pbVar1 = pbVar3 + 3; pbVar3 = pbVar3 + 4; psVar4[3] = *pbVar1 + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); piVar5 = piVar5 + 1; local_18c = local_18c + -1; } while (local_18c != 0); return; } //@@ 00ac43f0 pass2_no_dither /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jquant2.c: start_pass_2_quant (00ac49c2) installs 0xac4600 when dither_mode==JDITHER_FS else 0xac43f0; 5/6/5-bit histogram lookup, fill_inverse_cmap via find_nearby_colors/find_best_colors (00ac3dc0/00ac4060) on empty cells */ void pass2_no_dither(int param_1,int param_2,int *param_3,int param_4) { byte *pbVar1; ushort *puVar2; int iVar3; byte bVar4; int iVar5; int iVar6; ushort uVar7; byte *pbVar8; undefined4 uVar9; byte *pbVar10; int iVar11; short *psVar12; int *piVar13; int iVar14; int iVar15; char *pcVar16; int iVar17; int iVar18; int local_18c; undefined1 local_188 [256]; byte local_88 [128]; undefined4 local_8; local_8 = __security_cookie ^ (uint)(local_88 + 0x84); iVar5 = *(int *)(param_1 + 0x5c); iVar6 = *(int *)(*(int *)(param_1 + 0x1b8) + 0x1c); if (0 < param_4) { param_2 = param_2 - (int)param_3; do { pcVar16 = (char *)*param_3; pbVar8 = *(byte **)(param_2 + (int)param_3); for (iVar3 = iVar5; iVar3 != 0; iVar3 = iVar3 + -1) { bVar4 = *pbVar8; pbVar10 = pbVar8 + 1; pbVar1 = pbVar8 + 2; pbVar8 = pbVar8 + 3; puVar2 = (ushort *) (*(int *)(iVar6 + (uint)(bVar4 >> 3) * 4) + ((uint)(*pbVar10 >> 2) * 0x20 + (uint)(*pbVar1 >> 3)) * 2); uVar7 = *puVar2; if (uVar7 == 0) { iVar11 = (int)(uint)(*pbVar1 >> 3) >> 2; iVar17 = (int)(uint)(*pbVar10 >> 2) >> 3; iVar15 = *(int *)(*(int *)(param_1 + 0x1b8) + 0x1c); iVar14 = iVar11 * 0x20 + 4; iVar18 = iVar17 * 0x20 + 2; uVar9 = find_nearby_colors(iVar18,iVar14,local_188); find_best_colors(iVar18,iVar14,uVar9,local_188,local_88); pbVar10 = local_88; piVar13 = (int *)(((int)(uint)(bVar4 >> 3) >> 2) * 0x10 + iVar15); local_18c = 4; do { iVar14 = 8; iVar15 = (iVar17 * 0x40 + iVar11) * 8; do { psVar12 = (short *)(*piVar13 + iVar15); iVar15 = iVar15 + 0x40; *psVar12 = *pbVar10 + 1; psVar12[1] = pbVar10[1] + 1; psVar12[2] = pbVar10[2] + 1; pbVar1 = pbVar10 + 3; pbVar10 = pbVar10 + 4; psVar12[3] = *pbVar1 + 1; iVar14 = iVar14 + -1; } while (iVar14 != 0); piVar13 = piVar13 + 1; local_18c = local_18c + -1; } while (local_18c != 0); uVar7 = (ushort)(byte)*puVar2; } *pcVar16 = (char)uVar7 + -1; pcVar16 = pcVar16 + 1; } param_3 = param_3 + 1; param_4 = param_4 + -1; } while (param_4 != 0); } return; } //@@ 00ac4600 pass2_fs_dither /* DB: libjpeg jquant2.c: start_pass_2_quant FUN_00ac4980 sets color_quantize = this when dither_mode (cinfo +0x4c) != 0 else pass2_no_dither FUN_00ac43f0; serpentine rows (dir +-1), fserrors at cquantize +0x24, error_limiter +0x2c, histogram +0x1c, fill_inverse_cmap FUN_00ac42c0 on empty cells */ void pass2_fs_dither(int param_1,int param_2,int *param_3,int param_4) { ushort *puVar1; byte bVar2; byte bVar3; byte bVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int *piVar10; int iVar11; int iVar12; int iVar13; ushort uVar14; int iVar15; uint uVar16; int iVar17; int iVar18; int iVar19; short *psVar20; short *psVar21; int iVar22; uint uVar23; bool bVar24; int local_40; int local_3c; int local_34; int local_30; int local_2c; int local_28; int local_24; int local_20; int local_1c; int local_18; undefined1 *local_14; byte *local_8; iVar5 = *(int *)(param_1 + 0x1b8); iVar6 = *(int *)(param_1 + 0x124); iVar7 = *(int *)(iVar5 + 0x1c); iVar8 = *(int *)(iVar5 + 0x2c); iVar9 = *(int *)(param_1 + 0x5c); piVar10 = *(int **)(param_1 + 0x74); iVar11 = *piVar10; iVar12 = piVar10[1]; iVar13 = piVar10[2]; if (0 < param_4) { param_2 = param_2 - (int)param_3; do { bVar24 = *(char *)(iVar5 + 0x28) == '\0'; local_8 = *(byte **)(param_2 + (int)param_3); local_14 = (undefined1 *)*param_3; psVar21 = *(short **)(iVar5 + 0x24); if (bVar24) { local_3c = 1; iVar22 = 3; } else { local_3c = -1; local_8 = local_8 + iVar9 * 3 + -3; local_14 = local_14 + iVar9 + -1; psVar21 = psVar21 + (iVar9 + 1) * 3; iVar22 = -3; } local_34 = 0; local_2c = 0; *(bool *)(iVar5 + 0x28) = bVar24; iVar18 = 0; local_30 = 0; local_28 = 0; local_24 = 0; local_20 = 0; local_20._0_2_ = 0; local_1c = 0; local_1c._0_2_ = 0; local_18 = 0; local_18._0_2_ = 0; if (iVar9 != 0) { psVar20 = psVar21; local_40 = iVar9; do { psVar21 = psVar20 + iVar22; bVar2 = *(byte *)(*(int *)(iVar8 + (iVar18 + 8 + (int)*psVar21 >> 4) * 4) + (uint)*local_8 + iVar6); bVar3 = *(byte *)(*(int *)(iVar8 + (local_2c + 8 + (int)psVar21[1] >> 4) * 4) + (uint)local_8[1] + iVar6); uVar23 = (uint)(bVar3 >> 2); bVar4 = *(byte *)(*(int *)(iVar8 + (local_34 + 8 + (int)psVar20[iVar22 + 2] >> 4) * 4) + (uint)local_8[2] + iVar6); uVar16 = (uint)(bVar4 >> 3); puVar1 = (ushort *) (*(int *)(iVar7 + (uint)(bVar2 >> 3) * 4) + (uVar23 * 0x20 + uVar16) * 2); uVar14 = *puVar1; if (uVar14 == 0) { FUN_00ac42c0(uVar23,uVar16); uVar14 = *puVar1; } iVar18 = uVar14 - 1; *local_14 = (char)iVar18; local_14 = local_14 + local_3c; iVar17 = (uint)bVar2 - (uint)*(byte *)(iVar18 + iVar11); iVar19 = (uint)bVar3 - (uint)*(byte *)(iVar18 + iVar12); iVar15 = (uint)bVar4 - (uint)*(byte *)(iVar18 + iVar13); *psVar20 = (short)local_18 + (short)iVar17 * 3; local_18 = local_24 + iVar17 * 5; iVar18 = iVar17 * 7; psVar20[1] = (short)local_1c + (short)iVar19 * 3; local_1c = local_28 + iVar19 * 5; local_2c = iVar19 * 7; local_8 = local_8 + iVar22; psVar20[2] = (short)local_20 + (short)iVar15 * 3; local_20 = local_30 + iVar15 * 5; local_34 = iVar15 * 7; local_40 = local_40 + -1; psVar20 = psVar21; local_30 = iVar15; local_28 = iVar19; local_24 = iVar17; } while (local_40 != 0); } param_3 = param_3 + 1; param_4 = param_4 + -1; *psVar21 = (short)local_18; psVar21[1] = (short)local_1c; psVar21[2] = (short)local_20; } while (param_4 != 0); } return; } //@@ 00ac48b0 FUN_00ac48b0 void FUN_00ac48b0(void) { int *piVar1; int iVar2; int iVar3; int in_ECX; uint uVar4; int iVar5; int *piVar6; iVar2 = *(int *)(in_ECX + 0x1b8); iVar3 = (*(code *)**(undefined4 **)(in_ECX + 4))(); iVar5 = 0; uVar4 = 0; piVar1 = (int *)(iVar3 + 0x3fc); iVar3 = 0; *(int **)(iVar2 + 0x2c) = piVar1; piVar6 = piVar1; do { piVar1[uVar4] = iVar5; *piVar6 = iVar3; uVar4 = uVar4 + 1; iVar5 = iVar5 + 1; iVar3 = iVar3 + -1; piVar6 = piVar6 + -1; } while ((int)uVar4 < 0x10); piVar6 = piVar1 + -uVar4; do { piVar1[uVar4] = iVar5; *piVar6 = -iVar5; uVar4 = uVar4 + 1; iVar5 = iVar5 + (~uVar4 & 1); piVar6 = piVar6 + -1; } while ((int)uVar4 < 0x30); if (uVar4 < 0x100) { piVar6 = piVar1 + -uVar4; do { piVar1[uVar4] = iVar5; uVar4 = uVar4 + 1; *piVar6 = -iVar5; piVar6 = piVar6 + -1; } while ((int)uVar4 < 0x100); } return; } //@@ 00ac4950 FUN_00ac4950 void FUN_00ac4950(int param_1) { int iVar1; iVar1 = *(int *)(param_1 + 0x1b8); *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(iVar1 + 0x14); select_colors(); *(undefined1 *)(iVar1 + 0x20) = 1; return; } //@@ 00ac4980 FUN_00ac4980 void FUN_00ac4980(int *param_1,char param_2) { int iVar1; int iVar2; size_t _Size; code *pcVar3; void *_Dst; int iVar4; iVar1 = param_1[0x6e]; iVar4 = param_1[0x13]; iVar2 = *(int *)(iVar1 + 0x1c); if (iVar4 != 0) { param_1[0x13] = 2; } if (param_2 != '\0') { *(code **)(iVar1 + 4) = FUN_00ac3540; *(code **)(iVar1 + 0xc) = FUN_00ac4950; *(undefined1 *)(iVar1 + 0x20) = 1; goto LAB_00ac4a68; } pcVar3 = pass2_fs_dither; if (iVar4 == 0) { pcVar3 = pass2_no_dither; } *(code **)(iVar1 + 4) = pcVar3; *(code **)(iVar1 + 0xc) = guard_check_icall; if (param_1[0x1c] < 1) { *(undefined4 *)(*param_1 + 0x14) = 0x3a; *(undefined4 *)(*param_1 + 0x18) = 1; LAB_00ac4a11: (**(code **)*param_1)(param_1); } else if (0x100 < param_1[0x1c]) { *(undefined4 *)(*param_1 + 0x14) = 0x3b; *(undefined4 *)(*param_1 + 0x18) = 0x100; goto LAB_00ac4a11; } if (param_1[0x13] == 2) { _Dst = *(void **)(iVar1 + 0x24); _Size = (param_1[0x17] + 2) * 6; if (_Dst == (void *)0x0) { _Dst = (void *)(**(code **)(param_1[1] + 4))(param_1,1,_Size); *(void **)(iVar1 + 0x24) = _Dst; } memset(_Dst,0,_Size); if (*(int *)(iVar1 + 0x2c) == 0) { FUN_00ac48b0(); } *(undefined1 *)(iVar1 + 0x28) = 0; } LAB_00ac4a68: if (*(char *)(iVar1 + 0x20) != '\0') { iVar4 = 0; do { memset(*(void **)(iVar2 + iVar4 * 4),0,0x1000); iVar4 = iVar4 + 1; } while (iVar4 < 0x20); *(undefined1 *)(iVar1 + 0x20) = 0; } return; } //@@ 00ac4aa0 FUN_00ac4aa0 void FUN_00ac4aa0(int param_1) { *(undefined1 *)(*(int *)(param_1 + 0x1b8) + 0x20) = 1; return; } //@@ 00ac4ac0 jinit_2pass_quantizer /* DB: libjpeg(-turbo): ECX cinfo: requires 8-bit precision, allocates cquantizer into cinfo[0x6e], start_pass/new_color_map methods, errors JERR_NOTIMPL 0x30 unless out_color_components == 3 and not RGB565, allocates the 32-row histogram, validates desired_number_of_colors 8..256 (0x3a/0x3b) and allocates the colormap, dithering setup; called from libjpeg_jinit_master_decompress */ void jinit_2pass_quantizer(void) { undefined4 *puVar1; undefined4 uVar2; int *in_ECX; int iVar3; if (in_ECX[0x30] != 8) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } puVar1 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6e] = (int)puVar1; *puVar1 = FUN_00ac4980; puVar1[4] = FUN_00ac4aa0; puVar1[9] = 0; puVar1[0xb] = 0; if (((in_ECX[0x19] != 3) || (in_ECX[0xb] == 0x10)) || (*(char *)(in_ECX[100] + 9) != '\0')) { *(undefined4 *)(*in_ECX + 0x14) = 0x30; (**(code **)*in_ECX)(); } uVar2 = (**(code **)in_ECX[1])(); puVar1[7] = uVar2; iVar3 = 0; do { uVar2 = (**(code **)(in_ECX[1] + 4))(); *(undefined4 *)(iVar3 + puVar1[7]) = uVar2; iVar3 = iVar3 + 4; } while (iVar3 < 0x80); *(undefined1 *)(puVar1 + 8) = 1; if (*(char *)((int)in_ECX + 0x5a) == '\0') { uVar2 = 0; goto LAB_00ac4be6; } iVar3 = in_ECX[0x15]; if (iVar3 < 8) { *(undefined4 *)(*in_ECX + 0x14) = 0x3a; *(undefined4 *)(*in_ECX + 0x18) = 8; LAB_00ac4bc4: (**(code **)*in_ECX)(); } else if (0x100 < iVar3) { *(undefined4 *)(*in_ECX + 0x14) = 0x3b; *(undefined4 *)(*in_ECX + 0x18) = 0x100; goto LAB_00ac4bc4; } uVar2 = (**(code **)(in_ECX[1] + 8))(); puVar1[6] = iVar3; LAB_00ac4be6: puVar1[5] = uVar2; if (in_ECX[0x13] == 0) { return; } in_ECX[0x13] = 2; uVar2 = (**(code **)(in_ECX[1] + 4))(); puVar1[9] = uVar2; FUN_00ac48b0(); return; } //@@ 00ac4c20 FUN_00ac4c20 uint FUN_00ac4c20(void) { int *piVar1; byte bVar2; int iVar3; undefined4 *puVar4; int iVar5; char cVar6; int iVar7; byte bVar8; int *in_ECX; uint uVar9; int iVar10; byte bVar11; byte *in_EDX; uint uVar12; int iVar13; iVar3 = in_ECX[0x6a]; iVar10 = *(int *)(iVar3 + 0x18); if (iVar10 < 0x8000) { do { piVar1 = (int *)(iVar3 + 0x1c); *piVar1 = *piVar1 + -1; iVar10 = *(int *)(iVar3 + 0x1c); if (*piVar1 < 0) { if (in_ECX[99] == 0) { puVar4 = (undefined4 *)in_ECX[6]; if ((puVar4[1] == 0) && (cVar6 = (*(code *)puVar4[3])(), cVar6 == '\0')) { *(undefined4 *)(*in_ECX + 0x14) = 0x19; (**(code **)*in_ECX)(); } puVar4[1] = puVar4[1] + -1; uVar9 = (uint)*(byte *)*puVar4; *puVar4 = (byte *)*puVar4 + 1; if (uVar9 == 0xff) { do { puVar4 = (undefined4 *)in_ECX[6]; if ((puVar4[1] == 0) && (cVar6 = (*(code *)puVar4[3])(), cVar6 == '\0')) { *(undefined4 *)(*in_ECX + 0x14) = 0x19; (**(code **)*in_ECX)(); } puVar4[1] = puVar4[1] + -1; bVar8 = *(byte *)*puVar4; *puVar4 = (byte *)*puVar4 + 1; } while (bVar8 == 0xff); if (bVar8 != 0) { in_ECX[99] = (uint)bVar8; goto LAB_00ac4cfe; } uVar9 = 0xff; } } else { LAB_00ac4cfe: uVar9 = 0; } iVar5 = *(int *)(iVar3 + 0x1c); iVar10 = iVar5 + 8; *(uint *)(iVar3 + 0x14) = *(int *)(iVar3 + 0x14) << 8 | uVar9; *(int *)(iVar3 + 0x1c) = iVar10; if (iVar10 < 0) { iVar10 = iVar5 + 9; *(int *)(iVar3 + 0x1c) = iVar10; if (iVar10 == 0) { *(undefined4 *)(iVar3 + 0x18) = 0x8000; iVar10 = 0; } } } bVar8 = (byte)iVar10; iVar10 = *(int *)(iVar3 + 0x18) * 2; *(int *)(iVar3 + 0x18) = iVar10; } while (iVar10 < 0x8000); } else { bVar8 = (byte)*(undefined4 *)(iVar3 + 0x1c); } bVar2 = *in_EDX; uVar9 = (uint)bVar2; iVar5 = *(int *)(&DAT_00b5f820 + (uVar9 & 0x7f) * 4); iVar7 = iVar5 >> 0x10; iVar10 = iVar10 - iVar7; *(int *)(iVar3 + 0x18) = iVar10; iVar13 = iVar10 << (bVar8 & 0x1f); bVar8 = (byte)((uint)iVar5 >> 8); if (iVar13 <= *(int *)(iVar3 + 0x14)) { *(int *)(iVar3 + 0x14) = *(int *)(iVar3 + 0x14) - iVar13; *(int *)(iVar3 + 0x18) = iVar7; if (iVar7 <= iVar10) { bVar8 = (byte)iVar5; uVar9 = uVar9 ^ 0x80; } *in_EDX = bVar8 ^ bVar2 & 0x80; return uVar9 >> 7; } if (iVar10 < 0x8000) { uVar12 = CONCAT11((byte)iVar5,bVar2) & 0xffffff80; bVar11 = (byte)uVar12; if (iVar10 < iVar7) { *in_EDX = bVar11 ^ (byte)(uVar12 >> 8); return (uVar9 ^ 0x80) >> 7; } *in_EDX = bVar11 ^ bVar8; } return (uint)(bVar2 >> 7); } //@@ 00ac4e00 FUN_00ac4e00 void FUN_00ac4e00(void) { int iVar1; int iVar2; char cVar3; int *in_ECX; int iVar4; undefined4 *puVar5; int *local_c; iVar1 = in_ECX[0x6a]; cVar3 = (**(code **)(in_ECX[0x69] + 8))(); if (cVar3 == '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x19; (**(code **)*in_ECX)(); } iVar4 = 0; if (0 < in_ECX[0x4a]) { local_c = in_ECX + 0x4b; puVar5 = (undefined4 *)(iVar1 + 0x30); do { iVar2 = *local_c; if (*(char *)((int)in_ECX + 0xc9) == '\0') { LAB_00ac4e74: memset(*(void **)(iVar1 + 0x44 + *(int *)(iVar2 + 0x14) * 4),0,0x40); puVar5[-4] = 0; *puVar5 = 0; if (*(char *)((int)in_ECX + 0xc9) == '\0') goto LAB_00ac4ea9; LAB_00ac4ea0: if (in_ECX[0x5c] != 0) goto LAB_00ac4ea9; } else { if (in_ECX[0x5c] == 0) { if (in_ECX[0x5e] == 0) goto LAB_00ac4e74; goto LAB_00ac4ea0; } LAB_00ac4ea9: memset(*(void **)(iVar1 + 0x84 + *(int *)(iVar2 + 0x18) * 4),0,0x100); } iVar4 = iVar4 + 1; local_c = local_c + 1; puVar5 = puVar5 + 1; } while (iVar4 < in_ECX[0x4a]); } *(undefined4 *)(iVar1 + 0x14) = 0; *(undefined4 *)(iVar1 + 0x18) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0xfffffff0; *(int *)(iVar1 + 0x40) = in_ECX[0x3f]; return; } //@@ 00ac4f10 FUN_00ac4f10 undefined4 FUN_00ac4f10(int *param_1,int param_2) { int *piVar1; int iVar2; short *psVar3; uint uVar4; int iVar5; int iVar6; uint uVar7; int iVar8; int iVar9; int *local_18; int local_14; iVar2 = param_1[0x6a]; if (param_1[0x3f] != 0) { iVar5 = *(int *)(iVar2 + 0x40); if (iVar5 == 0) { FUN_00ac4e00(); iVar5 = *(int *)(iVar2 + 0x40); } *(int *)(iVar2 + 0x40) = iVar5 + -1; } if ((*(int *)(iVar2 + 0x1c) != -1) && (local_14 = 0, 0 < param_1[0x51])) { local_18 = param_1 + 0x52; do { iVar5 = *local_18; psVar3 = *(short **)(param_2 + local_14 * 4); iVar9 = *(int *)(param_1[iVar5 + 0x4b] + 0x14); piVar1 = (int *)(iVar2 + (iVar5 + 0xc) * 4); iVar6 = FUN_00ac4c20(); if (iVar6 == 0) { *piVar1 = 0; } else { iVar6 = FUN_00ac4c20(); uVar7 = FUN_00ac4c20(); if (uVar7 != 0) { iVar8 = FUN_00ac4c20(); while (iVar8 != 0) { uVar7 = uVar7 * 2; if (uVar7 == 0x8000) { *(undefined4 *)(*param_1 + 0x14) = 0x75; (**(code **)(*param_1 + 4))(param_1,0xffffffff); *(undefined4 *)(iVar2 + 0x1c) = 0xffffffff; return 1; } iVar8 = FUN_00ac4c20(); } } if ((int)uVar7 < (1 << (*(byte *)(iVar9 + 0xcb + (int)param_1) & 0x1f)) >> 1) { iVar9 = 0; } else if ((1 << (*(byte *)(iVar9 + 0xdb + (int)param_1) & 0x1f)) >> 1 < (int)uVar7) { iVar9 = iVar6 * 4 + 0xc; } else { iVar9 = iVar6 * 4 + 4; } *piVar1 = iVar9; uVar4 = uVar7; while (uVar4 = (int)uVar4 >> 1, uVar4 != 0) { iVar9 = FUN_00ac4c20(); if (iVar9 != 0) { uVar7 = uVar7 | uVar4; } } iVar9 = uVar7 + 1; if (iVar6 != 0) { iVar9 = -iVar9; } *(uint *)(iVar2 + 0x20 + iVar5 * 4) = *(int *)(iVar2 + 0x20 + iVar5 * 4) + iVar9 & 0xffff; } *psVar3 = *(short *)(iVar2 + 0x20 + iVar5 * 4) << ((byte)param_1[0x5f] & 0x1f); local_14 = local_14 + 1; local_18 = local_18 + 1; } while (local_14 < param_1[0x51]); } return 1; } //@@ 00ac5100 FUN_00ac5100 undefined4 FUN_00ac5100(int *param_1,int *param_2) { int *piVar1; int *piVar2; int iVar3; uint uVar4; int *piVar5; int iVar6; int iVar7; uint uVar8; int iVar9; short sVar10; piVar5 = param_1; iVar3 = param_1[0x6a]; if (param_1[0x3f] != 0) { iVar6 = *(int *)(iVar3 + 0x40); if (iVar6 == 0) { FUN_00ac4e00(); iVar6 = *(int *)(iVar3 + 0x40); } *(int *)(iVar3 + 0x40) = iVar6 + -1; } if (*(int *)(iVar3 + 0x1c) != -1) { piVar1 = param_1 + 0x5c; iVar6 = *param_2; piVar2 = param_1 + 0x5d; param_1 = (int *)*piVar1; if (*piVar1 <= *piVar2) { do { iVar7 = FUN_00ac4c20(); if (iVar7 != 0) { return 1; } iVar7 = FUN_00ac4c20(); while (iVar7 == 0) { param_1 = (int *)((int)param_1 + 1); if (piVar5[0x5d] < (int)param_1) goto LAB_00ac5296; iVar7 = FUN_00ac4c20(); } iVar7 = FUN_00ac4c20(); uVar8 = FUN_00ac4c20(); uVar4 = uVar8; if ((uVar8 != 0) && (iVar9 = FUN_00ac4c20(), iVar9 != 0)) { uVar8 = uVar8 * 2; iVar9 = FUN_00ac4c20(); while (uVar4 = uVar8, iVar9 != 0) { uVar8 = uVar8 * 2; if (uVar8 == 0x8000) { LAB_00ac5296: *(undefined4 *)(*piVar5 + 0x14) = 0x75; (**(code **)(*piVar5 + 4))(piVar5,0xffffffff); *(undefined4 *)(iVar3 + 0x1c) = 0xffffffff; return 1; } iVar9 = FUN_00ac4c20(); } } while (uVar4 = (int)uVar4 >> 1, uVar4 != 0) { iVar9 = FUN_00ac4c20(); if (iVar9 != 0) { uVar8 = uVar8 | uVar4; } } sVar10 = (short)uVar8 + 1; if (iVar7 != 0) { sVar10 = -sVar10; } piVar1 = &DAT_00b4fd00 + (int)param_1; param_1 = (int *)((int)param_1 + 1); *(short *)(iVar6 + *piVar1 * 2) = sVar10 << ((byte)piVar5[0x5f] & 0x1f); } while ((int)param_1 <= piVar5[0x5d]); } } return 1; } //@@ 00ac52c0 FUN_00ac52c0 undefined4 FUN_00ac52c0(int param_1,int param_2) { int iVar1; undefined4 uVar2; ushort *puVar3; int iVar4; int iVar5; iVar1 = *(int *)(param_1 + 0x1a8); if (*(int *)(param_1 + 0xfc) != 0) { iVar5 = *(int *)(iVar1 + 0x40); if (iVar5 == 0) { FUN_00ac4e00(); iVar5 = *(int *)(iVar1 + 0x40); } *(int *)(iVar1 + 0x40) = iVar5 + -1; } uVar2 = *(undefined4 *)(param_1 + 0x17c); iVar5 = 0; if (0 < *(int *)(param_1 + 0x144)) { do { iVar4 = FUN_00ac4c20(); if (iVar4 != 0) { puVar3 = *(ushort **)(param_2 + iVar5 * 4); *puVar3 = *puVar3 | (ushort)(1 << ((byte)uVar2 & 0x1f)); } iVar5 = iVar5 + 1; } while (iVar5 < *(int *)(param_1 + 0x144)); } return CONCAT31((int3)((uint)(iVar1 + 0xc4) >> 8),1); } //@@ 00ac5340 FUN_00ac5340 undefined4 FUN_00ac5340(int *param_1,int *param_2) { int iVar1; int iVar2; short *psVar3; int iVar4; short sVar5; short sVar6; short sVar7; int iVar8; int local_10; iVar1 = param_1[0x6a]; if (param_1[0x3f] != 0) { iVar4 = *(int *)(iVar1 + 0x40); if (iVar4 == 0) { FUN_00ac4e00(); iVar4 = *(int *)(iVar1 + 0x40); } *(int *)(iVar1 + 0x40) = iVar4 + -1; } if (*(int *)(iVar1 + 0x1c) != -1) { iVar4 = param_1[0x5d]; sVar6 = (short)(1 << ((byte)param_1[0x5f] & 0x1f)); iVar2 = *param_2; sVar7 = (short)(-1 << ((byte)param_1[0x5f] & 0x1f)); local_10 = iVar4; if (0 < iVar4) { do { if (*(short *)(iVar2 + (&DAT_00b4fd00)[local_10] * 2) != 0) break; local_10 = local_10 + -1; } while (0 < local_10); } iVar8 = param_1[0x5c]; if (iVar8 <= iVar4) { do { if ((local_10 < iVar8) && (iVar4 = FUN_00ac4c20(), iVar4 != 0)) { return 1; } iVar4 = (&DAT_00b4fd00)[iVar8]; sVar5 = *(short *)(iVar2 + iVar4 * 2); while (psVar3 = (short *)(iVar2 + iVar4 * 2), sVar5 == 0) { iVar4 = FUN_00ac4c20(); if (iVar4 != 0) { iVar4 = FUN_00ac4c20(); sVar5 = sVar6; if (iVar4 != 0) { sVar5 = sVar7; } *psVar3 = sVar5; goto LAB_00ac54ae; } iVar8 = iVar8 + 1; if (param_1[0x5d] < iVar8) { *(undefined4 *)(*param_1 + 0x14) = 0x75; (**(code **)(*param_1 + 4))(param_1,0xffffffff); *(undefined4 *)(iVar1 + 0x1c) = 0xffffffff; return 1; } iVar4 = (&DAT_00b4fd00)[iVar8]; sVar5 = *(short *)(iVar2 + iVar4 * 2); } iVar4 = FUN_00ac4c20(); if (iVar4 != 0) { sVar5 = sVar6; if (*psVar3 < 0) { sVar5 = sVar7; } *psVar3 = *psVar3 + sVar5; } LAB_00ac54ae: iVar8 = iVar8 + 1; } while (iVar8 <= param_1[0x5d]); } } return 1; } //@@ 00ac54f0 libjpeg_arith_decode_mcu /* DB: libjpeg jdarith.c decode_mcu (sequential): restart handling (FUN_00ac4e00 process_restart), DC diff via arith_decode (FUN_00ac4c20) with dc_stats/last_dc_val, AC loop; installed by start_pass (FUN_00ac5840, mov eax,0xac54f0) in the non-progressive branch */ undefined4 libjpeg_arith_decode_mcu(int *param_1,int param_2) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; short sVar6; uint uVar7; int *local_20; int local_1c; undefined2 *local_14; uint local_10; uint local_c; iVar1 = param_1[0x6a]; if (param_1[0x3f] != 0) { iVar4 = *(int *)(iVar1 + 0x40); if (iVar4 == 0) { FUN_00ac4e00(); iVar4 = *(int *)(iVar1 + 0x40); } *(int *)(iVar1 + 0x40) = iVar4 + -1; } if ((*(int *)(iVar1 + 0x1c) != -1) && (local_1c = 0, 0 < param_1[0x51])) { local_20 = param_1 + 0x52; do { if (param_2 == 0) { local_14 = (undefined2 *)0x0; } else { local_14 = *(undefined2 **)(param_2 + local_1c * 4); } iVar4 = *local_20; iVar5 = *(int *)(param_1[iVar4 + 0x4b] + 0x14); iVar2 = FUN_00ac4c20(); if (iVar2 == 0) { *(undefined4 *)(iVar1 + 0x30 + iVar4 * 4) = 0; } else { iVar2 = FUN_00ac4c20(); local_c = FUN_00ac4c20(); if (local_c != 0) { iVar3 = FUN_00ac4c20(); while (iVar3 != 0) { local_c = local_c * 2; if (local_c == 0x8000) { LAB_00ac57fd: *(undefined4 *)(*param_1 + 0x14) = 0x75; iVar4 = *param_1; LAB_00ac581b: (**(code **)(iVar4 + 4))(param_1,0xffffffff); *(undefined4 *)(iVar1 + 0x1c) = 0xffffffff; return 1; } iVar3 = FUN_00ac4c20(); } } if ((int)local_c < (1 << (*(byte *)(iVar5 + 0xcb + (int)param_1) & 0x1f)) >> 1) { iVar5 = 0; } else if ((1 << (*(byte *)(iVar5 + 0xdb + (int)param_1) & 0x1f)) >> 1 < (int)local_c) { iVar5 = iVar2 * 4 + 0xc; } else { iVar5 = iVar2 * 4 + 4; } *(int *)(iVar1 + 0x30 + iVar4 * 4) = iVar5; uVar7 = (int)local_c >> 1; if (uVar7 != 0) { do { iVar5 = FUN_00ac4c20(); if (iVar5 != 0) { local_c = local_c | uVar7; } uVar7 = (int)uVar7 >> 1; } while (uVar7 != 0); } iVar5 = local_c + 1; if (iVar2 != 0) { iVar5 = -iVar5; } *(uint *)(iVar1 + 0x20 + iVar4 * 4) = *(int *)(iVar1 + 0x20 + iVar4 * 4) + iVar5 & 0xffff; } if (local_14 != (undefined2 *)0x0) { *local_14 = *(undefined2 *)(iVar1 + 0x20 + iVar4 * 4); } local_c = 1; do { iVar4 = FUN_00ac4c20(); if (iVar4 != 0) break; iVar4 = FUN_00ac4c20(); while (iVar4 == 0) { local_c = local_c + 1; if (0x3f < (int)local_c) goto LAB_00ac57fd; iVar4 = FUN_00ac4c20(); } iVar4 = FUN_00ac4c20(); local_10 = FUN_00ac4c20(); if ((local_10 != 0) && (iVar5 = FUN_00ac4c20(), iVar5 != 0)) { local_10 = local_10 * 2; iVar5 = FUN_00ac4c20(); while (iVar5 != 0) { local_10 = local_10 * 2; if (local_10 == 0x8000) { *(undefined4 *)(*param_1 + 0x14) = 0x75; iVar4 = *param_1; goto LAB_00ac581b; } iVar5 = FUN_00ac4c20(); } } uVar7 = (int)local_10 >> 1; if (uVar7 != 0) { do { iVar5 = FUN_00ac4c20(); if (iVar5 != 0) { local_10 = local_10 | uVar7; } uVar7 = (int)uVar7 >> 1; } while (uVar7 != 0); } sVar6 = (short)local_10 + 1; if (iVar4 != 0) { sVar6 = -sVar6; } if (local_14 != (undefined2 *)0x0) { local_14[(&DAT_00b4fd00)[local_c]] = sVar6; } local_c = local_c + 1; } while ((int)local_c < 0x40); local_1c = local_1c + 1; local_20 = local_20 + 1; } while (local_1c < param_1[0x51]); } return 1; } //@@ 00ac5840 start_pass_huff_decoder /* DB: libjpeg jdhuff.c (progressive+sequential merged): stored as entropy->pub.start_pass (mov [eax],0xac5840 at 0xab61c4); checks Ss/Se(0x3f)/Ah/Al (Al>13 -> JERR_BAD_PROGRESSION 0x11), WARNMS JWRN_NOT_SEQUENTIAL when !progressive_mode(+0xc9), picks decode_mcu */ void start_pass_huff_decoder(int *param_1) { int iVar1; int iVar2; int iVar3; int iVar4; code *pcVar5; void *pvVar6; int iVar7; int *piVar8; undefined4 *puVar9; int iVar10; bool bVar11; int *local_c; int local_8; iVar1 = param_1[0x6a]; iVar2 = param_1[0x5c]; if (*(char *)((int)param_1 + 0xc9) == '\0') { if ((((iVar2 != 0) || (param_1[0x5d] != 0x3f)) || (param_1[0x5e] != 0)) || (param_1[0x5f] != 0)) { *(undefined4 *)(*param_1 + 0x14) = 0x7d; (**(code **)(*param_1 + 4))(param_1,0xffffffff); } pcVar5 = libjpeg_arith_decode_mcu; goto LAB_00ac5a66; } iVar4 = param_1[0x5d]; if (iVar2 == 0) { bVar11 = iVar4 == 0; LAB_00ac5886: if (((!bVar11) || ((param_1[0x5e] != 0 && (param_1[0x5e] + -1 != param_1[0x5f])))) || (0xd < param_1[0x5f])) goto LAB_00ac58a4; } else { if ((iVar2 <= iVar4) && (iVar4 < 0x40)) { bVar11 = param_1[0x4a] == 1; goto LAB_00ac5886; } LAB_00ac58a4: *(undefined4 *)(*param_1 + 0x14) = 0x11; *(int *)(*param_1 + 0x18) = param_1[0x5c]; *(int *)(*param_1 + 0x1c) = param_1[0x5d]; *(int *)(*param_1 + 0x20) = param_1[0x5e]; *(int *)(*param_1 + 0x24) = param_1[0x5f]; (**(code **)*param_1)(param_1); } local_8 = 0; if (0 < param_1[0x4a]) { local_c = param_1 + 0x4b; do { iVar2 = *(int *)(*local_c + 4); piVar8 = (int *)(iVar2 * 0x100 + param_1[0x23]); iVar10 = (param_1[9] + iVar2) * 0x100 + param_1[0x23]; iVar4 = param_1[0x5c]; if ((iVar4 != 0) && (*piVar8 < 0)) { *(undefined4 *)(*param_1 + 0x14) = 0x76; *(int *)(*param_1 + 0x18) = iVar2; *(undefined4 *)(*param_1 + 0x1c) = 0; (**(code **)(*param_1 + 4))(param_1,0xffffffff); iVar4 = param_1[0x5c]; } iVar7 = 1; if (iVar4 < 1) { iVar7 = iVar4; } while( true ) { iVar4 = param_1[0x5d]; iVar3 = 9; if (9 < iVar4) { iVar3 = iVar4; } if (iVar3 < iVar7) break; if (param_1[0x1f] < 2) { *(undefined4 *)(iVar10 + iVar7 * 4) = 0; iVar7 = iVar7 + 1; } else { *(int *)(iVar10 + iVar7 * 4) = piVar8[iVar7]; iVar7 = iVar7 + 1; } } iVar10 = param_1[0x5c]; if (iVar10 <= iVar4) { do { iVar4 = 0; if (-1 < piVar8[iVar10]) { iVar4 = piVar8[iVar10]; } if (param_1[0x5e] != iVar4) { *(undefined4 *)(*param_1 + 0x14) = 0x76; *(int *)(*param_1 + 0x18) = iVar2; *(int *)(*param_1 + 0x1c) = iVar10; (**(code **)(*param_1 + 4))(param_1,0xffffffff); } piVar8[iVar10] = param_1[0x5f]; iVar10 = iVar10 + 1; } while (iVar10 <= param_1[0x5d]); } local_8 = local_8 + 1; local_c = local_c + 1; } while (local_8 < param_1[0x4a]); } if (param_1[0x5e] == 0) { pcVar5 = FUN_00ac4f10; if (param_1[0x5c] != 0) { pcVar5 = FUN_00ac5100; } } else { pcVar5 = FUN_00ac5340; if (param_1[0x5c] == 0) { pcVar5 = FUN_00ac52c0; } } LAB_00ac5a66: *(code **)(iVar1 + 4) = pcVar5; local_8 = 0; if (0 < param_1[0x4a]) { local_c = param_1 + 0x4b; puVar9 = (undefined4 *)(iVar1 + 0x30); do { iVar2 = *local_c; if ((*(char *)((int)param_1 + 0xc9) == '\0') || ((param_1[0x5c] == 0 && (param_1[0x5e] == 0))) ) { iVar4 = *(int *)(iVar2 + 0x14); if ((iVar4 < 0) || (0xf < iVar4)) { *(undefined4 *)(*param_1 + 0x14) = 0x32; *(int *)(*param_1 + 0x18) = iVar4; (**(code **)*param_1)(param_1); } pvVar6 = *(void **)(iVar1 + 0x44 + iVar4 * 4); if (pvVar6 == (void *)0x0) { pvVar6 = (void *)(**(code **)param_1[1])(param_1,1,0x40); *(void **)(iVar1 + 0x44 + iVar4 * 4) = pvVar6; } memset(pvVar6,0,0x40); puVar9[-4] = 0; *puVar9 = 0; } if ((*(char *)((int)param_1 + 0xc9) == '\0') || (param_1[0x5c] != 0)) { iVar2 = *(int *)(iVar2 + 0x18); if ((iVar2 < 0) || (0xf < iVar2)) { *(undefined4 *)(*param_1 + 0x14) = 0x32; *(int *)(*param_1 + 0x18) = iVar2; (**(code **)*param_1)(param_1); } pvVar6 = *(void **)(iVar1 + 0x84 + iVar2 * 4); if (pvVar6 == (void *)0x0) { pvVar6 = (void *)(**(code **)param_1[1])(param_1,1,0x100); *(void **)(iVar1 + 0x84 + iVar2 * 4) = pvVar6; } memset(pvVar6,0,0x100); } local_8 = local_8 + 1; local_c = local_c + 1; puVar9 = puVar9 + 1; } while (local_8 < param_1[0x4a]); } *(undefined4 *)(iVar1 + 0x14) = 0; *(undefined4 *)(iVar1 + 0x18) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0xfffffff0; *(undefined1 *)(iVar1 + 0x10) = 0; *(int *)(iVar1 + 0x40) = param_1[0x3f]; return; } //@@ 00ac5bd0 FUN_00ac5bd0 void FUN_00ac5bd0(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x198); if (1 < *(int *)(in_ECX + 0x128)) { *(undefined4 *)(iVar1 + 0x30) = 1; *(undefined4 *)(iVar1 + 0x28) = 0; *(undefined4 *)(iVar1 + 0x2c) = 0; return; } if (*(uint *)(in_ECX + 0x80) < *(int *)(in_ECX + 0x120) - 1U) { *(undefined4 *)(iVar1 + 0x30) = *(undefined4 *)(*(int *)(in_ECX + 300) + 0xc); *(undefined4 *)(iVar1 + 0x28) = 0; *(undefined4 *)(iVar1 + 0x2c) = 0; return; } *(undefined4 *)(iVar1 + 0x30) = *(undefined4 *)(*(int *)(in_ECX + 300) + 0x4c); *(undefined4 *)(iVar1 + 0x28) = 0; *(undefined4 *)(iVar1 + 0x2c) = 0; return; } //@@ 00ac5c40 FUN_00ac5c40 void FUN_00ac5c40(int param_1) { *(undefined4 *)(param_1 + 0x80) = 0; FUN_00ac5bd0(); return; } //@@ 00ac5c60 FUN_00ac5c60 void FUN_00ac5c60(int param_1) { int iVar1; char cVar2; iVar1 = *(int *)(param_1 + 0x198); if (*(int *)(iVar1 + 0x24) != 0) { if (*(char *)(param_1 + 0x49) != '\0') { cVar2 = FUN_00ac6300(); if (cVar2 != '\0') { *(code **)(iVar1 + 0xc) = decompress_smooth_data; *(undefined4 *)(param_1 + 0x88) = 0; return; } } *(code **)(iVar1 + 0xc) = FUN_00ac6150; } *(undefined4 *)(param_1 + 0x88) = 0; return; } //@@ 00ac5cb0 decompress_onepass /* DB: libjpeg(-turbo) jdcoefct.c: coef = cinfo+0x198, memsets MCU_buffer (blocks_in_MCU*128), entropy->decode_mcu (+0x1a8 vfunc +4) with insufficient_data (+0x10) check, suspends with MCU_vert_offset/MCU_ctr (+0x2c/+0x28); stored by start_input_pass (00ac7353) */ undefined4 decompress_onepass(int param_1,int param_2) { int iVar1; code *pcVar2; int iVar3; int iVar4; char cVar5; uint uVar6; int iVar7; uint uVar8; int iVar9; int iVar10; undefined4 *puVar11; int *local_30; int local_2c; int local_20; int local_1c; int local_18; int local_14; uint local_10; int local_c; int local_8; iVar1 = *(int *)(param_1 + 0x198); uVar6 = *(int *)(param_1 + 0x13c) - 1; uVar8 = *(uint *)(param_1 + 0x120); local_14 = *(int *)(iVar1 + 0x2c); if (local_14 < *(int *)(iVar1 + 0x30)) { local_10 = *(uint *)(iVar1 + 0x28); do { if (local_10 <= uVar6) { do { memset(*(void **)(iVar1 + 0x34),0,*(int *)(param_1 + 0x144) << 7); iVar7 = *(int *)(param_1 + 0x1a8); if (*(char *)(iVar7 + 0x10) == '\0') { *(undefined4 *)(*(int *)(param_1 + 400) + 0x68) = *(undefined4 *)(param_1 + 0x80); iVar7 = *(int *)(param_1 + 0x1a8); } cVar5 = (**(code **)(iVar7 + 4))(param_1,(undefined4 *)(iVar1 + 0x34)); if (cVar5 == '\0') { *(int *)(iVar1 + 0x2c) = local_14; *(uint *)(iVar1 + 0x28) = local_10; return 0; } if ((*(uint *)(*(int *)(param_1 + 400) + 0xc) <= local_10) && (local_10 <= *(uint *)(*(int *)(param_1 + 400) + 0x10))) { local_8 = 0; local_20 = 0; if (0 < *(int *)(param_1 + 0x128)) { local_30 = (int *)(param_1 + 300); do { iVar7 = *local_30; if (*(char *)(iVar7 + 0x34) == '\0') { local_8 = local_8 + *(int *)(iVar7 + 0x40); } else { pcVar2 = *(code **)(*(int *)(param_1 + 0x1ac) + 4 + *(int *)(iVar7 + 4) * 4); if (local_10 < uVar6) { local_1c = *(int *)(iVar7 + 0x38); } else { local_1c = *(int *)(iVar7 + 0x48); } iVar9 = *(int *)(iVar7 + 0x24); local_c = *(int *)(param_2 + *(int *)(iVar7 + 4) * 4) + iVar9 * local_14 * 4; iVar3 = *(int *)(*(int *)(param_1 + 400) + 0xc); iVar4 = *(int *)(iVar7 + 0x44); local_18 = 0; if (0 < *(int *)(iVar7 + 0x3c)) { do { if (((*(uint *)(param_1 + 0x80) < uVar8 - 1) || (local_18 + local_14 < *(int *)(iVar7 + 0x4c))) && (0 < local_1c)) { puVar11 = (undefined4 *)(iVar1 + (local_8 + 0xd) * 4); local_2c = local_1c; iVar10 = (local_10 - iVar3) * iVar4; do { (*pcVar2)(param_1,iVar7,*puVar11,local_c,iVar10); iVar9 = *(int *)(iVar7 + 0x24); puVar11 = puVar11 + 1; iVar10 = iVar10 + iVar9; local_2c = local_2c + -1; } while (local_2c != 0); } local_8 = local_8 + *(int *)(iVar7 + 0x38); local_c = local_c + iVar9 * 4; local_18 = local_18 + 1; } while (local_18 < *(int *)(iVar7 + 0x3c)); } } local_20 = local_20 + 1; local_30 = local_30 + 1; } while (local_20 < *(int *)(param_1 + 0x128)); } } local_10 = local_10 + 1; } while (local_10 <= uVar6); } local_14 = local_14 + 1; *(undefined4 *)(iVar1 + 0x28) = 0; local_10 = 0; } while (local_14 < *(int *)(iVar1 + 0x30)); uVar8 = *(uint *)(param_1 + 0x120); } *(int *)(param_1 + 0x88) = *(int *)(param_1 + 0x88) + 1; *(int *)(param_1 + 0x80) = *(int *)(param_1 + 0x80) + 1; if (*(uint *)(param_1 + 0x80) < uVar8) { FUN_00ac5bd0(); return 3; } (**(code **)(*(int *)(param_1 + 0x1a0) + 0xc))(param_1); return 4; } //@@ 00ac5f20 consume_data /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jdcoefct.c: set as coef->pub.consume_data (_Dst[1]) by libjpeg_jinit_d_coef_controller when need_full_buffer (decompress_data FUN_00ac6150 in [3]); else the dummy consume (ICF'd Weapon::GetFocusEntity) */ undefined4 consume_data(int param_1) { int iVar1; char cVar2; int iVar3; int iVar4; int *piVar5; int iVar6; int iVar7; int iVar8; int iVar9; int *local_38; int local_34; int *local_30; int local_2c; int local_28; uint local_20; int aiStack_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(aiStack_18 + 5); iVar9 = 0; iVar1 = *(int *)(param_1 + 0x198); if (0 < *(int *)(param_1 + 0x128)) { piVar5 = (int *)(param_1 + 300); do { iVar3 = *(int *)(*piVar5 + 0xc); iVar3 = (**(code **)(*(int *)(param_1 + 4) + 0x20)) (param_1,*(undefined4 *)(iVar1 + 0x60 + *(int *)(*piVar5 + 4) * 4), *(int *)(param_1 + 0x80) * iVar3,iVar3,1); piVar5 = piVar5 + 1; aiStack_18[iVar9] = iVar3; iVar9 = iVar9 + 1; } while (iVar9 < *(int *)(param_1 + 0x128)); } local_28 = *(int *)(iVar1 + 0x2c); if (local_28 < *(int *)(iVar1 + 0x30)) { local_20 = *(uint *)(iVar1 + 0x28); do { if (local_20 < *(uint *)(param_1 + 0x13c)) { do { iVar9 = 0; local_34 = 0; if (0 < *(int *)(param_1 + 0x128)) { local_38 = (int *)(param_1 + 300); do { iVar3 = *local_38; local_2c = 0; iVar8 = *(int *)(iVar3 + 0x38); iVar6 = iVar8 * local_20; if (0 < *(int *)(iVar3 + 0x3c)) { local_30 = (int *)(aiStack_18[local_34] + local_28 * 4); do { iVar4 = *local_30 + iVar6 * 0x80; iVar7 = 0; if (0 < iVar8) { piVar5 = (int *)(iVar1 + iVar9 * 4 + 0x34); do { *piVar5 = iVar4; piVar5 = piVar5 + 1; iVar8 = *(int *)(iVar3 + 0x38); iVar7 = iVar7 + 1; iVar9 = iVar9 + 1; iVar4 = iVar4 + 0x80; } while (iVar7 < iVar8); } local_2c = local_2c + 1; local_30 = local_30 + 1; } while (local_2c < *(int *)(iVar3 + 0x3c)); } local_34 = local_34 + 1; local_38 = local_38 + 1; } while (local_34 < *(int *)(param_1 + 0x128)); } iVar9 = *(int *)(param_1 + 0x1a8); if (*(char *)(iVar9 + 0x10) == '\0') { *(undefined4 *)(*(int *)(param_1 + 400) + 0x68) = *(undefined4 *)(param_1 + 0x80); iVar9 = *(int *)(param_1 + 0x1a8); } cVar2 = (**(code **)(iVar9 + 4))(param_1,iVar1 + 0x34); if (cVar2 == '\0') { *(int *)(iVar1 + 0x2c) = local_28; *(uint *)(iVar1 + 0x28) = local_20; return 0; } local_20 = local_20 + 1; } while (local_20 < *(uint *)(param_1 + 0x13c)); } local_28 = local_28 + 1; *(undefined4 *)(iVar1 + 0x28) = 0; local_20 = 0; } while (local_28 < *(int *)(iVar1 + 0x30)); } *(int *)(param_1 + 0x80) = *(int *)(param_1 + 0x80) + 1; if (*(uint *)(param_1 + 0x80) < *(uint *)(param_1 + 0x120)) { FUN_00ac5bd0(); return 3; } (**(code **)(*(int *)(param_1 + 0x1a0) + 0xc))(param_1); return 4; } //@@ 00ac6150 FUN_00ac6150 int FUN_00ac6150(int param_1,int param_2) { int iVar1; int iVar2; code *pcVar3; int iVar4; uint uVar5; int iVar6; uint uVar7; int iVar8; int local_1c; int local_18; int local_14; int local_10; int local_c; int local_8; iVar1 = *(int *)(param_1 + 0x120); iVar2 = *(int *)(param_1 + 0x198); while ((*(int *)(param_1 + 0x7c) < *(int *)(param_1 + 0x84) || ((*(int *)(param_1 + 0x7c) == *(int *)(param_1 + 0x84) && (*(uint *)(param_1 + 0x80) <= *(uint *)(param_1 + 0x88)))))) { iVar4 = (*(code *)**(undefined4 **)(param_1 + 0x1a0))(param_1); if (iVar4 == 0) { return 0; } } local_c = *(int *)(param_1 + 0xc4); local_14 = 0; if (0 < *(int *)(param_1 + 0x24)) { local_8 = 0x14; do { if (*(char *)(local_c + 0x34) != '\0') { iVar4 = (**(code **)(*(int *)(param_1 + 4) + 0x20)) (param_1,*(undefined4 *)(iVar2 + 0x4c + local_8), *(int *)(param_1 + 0x88) * *(int *)(local_c + 0xc), *(int *)(local_c + 0xc),0); if (*(uint *)(param_1 + 0x88) < iVar1 - 1U) { uVar5 = *(uint *)(local_c + 0xc); } else { uVar5 = *(uint *)(local_c + 0x20) % *(uint *)(local_c + 0xc); if (uVar5 == 0) { uVar5 = *(uint *)(local_c + 0xc); } } local_1c = 0; pcVar3 = *(code **)(*(int *)(param_1 + 0x1ac) + -0x10 + local_8); local_10 = *(int *)(param_2 + -0x14 + local_8); if (0 < (int)uVar5) { iVar6 = *(int *)(local_c + 0x24); do { uVar7 = *(uint *)(local_8 + *(int *)(param_1 + 400)); iVar8 = uVar7 * 0x80 + *(int *)(iVar4 + local_1c * 4); local_18 = 0; if (uVar7 <= *(uint *)(local_8 + 0x28 + *(int *)(param_1 + 400))) { do { (*pcVar3)(param_1,local_c,iVar8,local_10,local_18); uVar7 = uVar7 + 1; iVar8 = iVar8 + 0x80; iVar6 = *(int *)(local_c + 0x24); local_18 = local_18 + iVar6; } while (uVar7 <= *(uint *)(local_8 + 0x28 + *(int *)(param_1 + 400))); } local_1c = local_1c + 1; local_10 = local_10 + iVar6 * 4; } while (local_1c < (int)uVar5); } } local_14 = local_14 + 1; local_8 = local_8 + 4; local_c = local_c + 0x58; } while (local_14 < *(int *)(param_1 + 0x24)); } *(int *)(param_1 + 0x88) = *(int *)(param_1 + 0x88) + 1; return 4 - (uint)(*(uint *)(param_1 + 0x88) < *(uint *)(param_1 + 0x120)); } //@@ 00ac6300 FUN_00ac6300 uint FUN_00ac6300(void) { int iVar1; short *in_EAX; undefined4 uVar2; int in_ECX; int iVar3; undefined1 uVar4; undefined4 *puVar5; int iVar6; undefined4 *local_1c; int local_18; int local_14; int local_10; undefined4 *local_c; undefined4 *local_8; uVar4 = 0; iVar3 = *(int *)(in_ECX + 0x198); if ((*(char *)(in_ECX + 0xc9) == '\0') || (*(int *)(in_ECX + 0x8c) == 0)) { LAB_00ac64a8: return (uint)in_EAX & 0xffffff00; } local_8 = *(undefined4 **)(iVar3 + 0x88); if (local_8 == (undefined4 *)0x0) { local_8 = (undefined4 *)(*(code *)**(undefined4 **)(in_ECX + 4))(); *(undefined4 **)(iVar3 + 0x88) = local_8; } iVar3 = *(int *)(in_ECX + 0x24); local_c = local_8 + iVar3 * 10; local_1c = *(undefined4 **)(in_ECX + 0xc4); local_14 = 0; if (0 < iVar3) { local_1c = local_1c + 0x14; local_18 = 0; uVar4 = 0; do { in_EAX = (short *)*local_1c; if ((((((in_EAX == (short *)0x0) || (*in_EAX == 0)) || (in_EAX[1] == 0)) || ((in_EAX[8] == 0 || (in_EAX[0x10] == 0)))) || ((in_EAX[9] == 0 || ((in_EAX[2] == 0 || (in_EAX[3] == 0)))))) || ((in_EAX[10] == 0 || ((in_EAX[0x11] == 0 || (in_EAX[0x18] == 0)))))) goto LAB_00ac64a8; iVar1 = *(int *)(in_ECX + 0x8c); puVar5 = (undefined4 *)(local_18 + iVar1); in_EAX = (short *)*puVar5; if ((int)in_EAX < 0) goto LAB_00ac64a8; local_10 = 9; *local_8 = in_EAX; iVar6 = (int)puVar5 - (int)local_c; puVar5 = local_c; do { puVar5 = puVar5 + 1; if (*(int *)(in_ECX + 0x7c) < 2) { uVar2 = 0xffffffff; } else { uVar2 = *(undefined4 *) ((((local_14 + iVar3) * 0x100 + iVar1) - (int)local_c) + (int)puVar5); } *puVar5 = uVar2; *(undefined4 *)(((int)local_8 - (int)local_c) + (int)puVar5) = *(undefined4 *)(iVar6 + (int)puVar5); if (*(int *)(iVar6 + (int)puVar5) != 0) { uVar4 = 1; } local_10 = local_10 + -1; } while (local_10 != 0); local_14 = local_14 + 1; local_18 = local_18 + 0x100; local_8 = local_8 + 10; local_1c = local_1c + 0x16; local_c = local_c + 10; iVar3 = *(int *)(in_ECX + 0x24); } while (local_14 < iVar3); } return CONCAT31((int3)((uint)local_1c >> 8),uVar4); } //@@ 00ac64c0 decompress_smooth_data /* DB: libjpeg jdcoefct.c: stored as coef->pub.decompress_data ([edi+0xc]) in jinit_d_coef_controller region (ac5c85), block-smoothing using coef_bits_latch -1 tests and 5x5 neighbour DC; neighbours libjpeg functions */ int decompress_smooth_data(int param_1,int param_2) { int iVar1; ushort uVar2; ushort uVar3; ushort uVar4; ushort uVar5; ushort uVar6; int iVar7; short *psVar8; ushort *puVar9; code *pcVar10; short sVar11; int iVar12; int iVar13; uint uVar14; int iVar15; int iVar16; uint uVar17; int iVar18; int iVar19; int iVar20; bool bVar21; uint uVar22; uint uVar23; short *psVar24; int iVar25; short *psVar26; uint local_c4; uint local_c0; uint local_bc; uint local_b8; int local_b0; int local_ac; uint local_a8; uint local_a4; int local_a0; int local_9c; int local_98; int local_94; int local_8c; short *local_88; short *local_84; short *local_80; int local_7c; int local_78; int local_74; short *local_6c; short *local_68; int local_60; int local_5c; int local_58; int local_50; int local_4c; int local_48; int local_44; int local_40; int local_3c; int local_38; int local_34; int local_30; int local_2c; int local_28; int local_20; int local_18; int local_14; int local_10; int local_c; local_b8 = 0; local_bc = 0; local_c0 = 0; iVar7 = *(int *)(param_1 + 0x198); iVar16 = *(int *)(param_1 + 0x84); uVar23 = *(int *)(param_1 + 0x120) - 1; local_c4 = 0; iVar12 = *(int *)(param_1 + 0x7c); psVar8 = *(short **)(iVar7 + 0x5c); if (iVar12 <= iVar16) { do { if (*(char *)((int)*(undefined4 **)(param_1 + 0x1a0) + 0x11) != '\0') break; if (iVar12 == iVar16) { iVar12 = 0; if (*(int *)(param_1 + 0x170) == 0) { iVar12 = 2; } if ((uint)(iVar12 + *(int *)(param_1 + 0x88)) < *(uint *)(param_1 + 0x80)) break; } iVar12 = (*(code *)**(undefined4 **)(param_1 + 0x1a0))(param_1); if (iVar12 == 0) { return 0; } iVar12 = *(int *)(param_1 + 0x7c); iVar16 = *(int *)(param_1 + 0x84); } while (iVar12 <= iVar16); } local_38 = *(int *)(param_1 + 0xc4); local_20 = 0; if (0 < *(int *)(param_1 + 0x24)) { do { if (*(char *)(local_38 + 0x34) != '\0') { uVar17 = *(uint *)(param_1 + 0x88); if (uVar17 + 1 < uVar23) { local_a8 = *(uint *)(local_38 + 0xc); uVar22 = local_a8 * 3; uVar14 = local_a8; LAB_00ac65cc: } else { uVar14 = *(uint *)(local_38 + 0xc); if (uVar23 <= uVar17) { local_a8 = *(uint *)(local_38 + 0x20) % uVar14; if (local_a8 == 0) { local_a8 = uVar14; } uVar22 = local_a8; goto LAB_00ac65cc; } uVar22 = uVar14 * 2; local_a8 = uVar14; } if (uVar17 < 2) { if (uVar17 == 0) { local_48 = (**(code **)(*(int *)(param_1 + 4) + 0x20)) (param_1,*(undefined4 *)(iVar7 + 0x60 + local_20 * 4),0,uVar22,0); } else { local_48 = (**(code **)(*(int *)(param_1 + 4) + 0x20)) (param_1,*(undefined4 *)(iVar7 + 0x60 + local_20 * 4), (uVar17 - 1) * uVar14,uVar14 + uVar22); local_48 = local_48 + *(int *)(local_38 + 0xc) * 4; } } else { local_48 = (**(code **)(*(int *)(param_1 + 4) + 0x20)) (param_1,*(undefined4 *)(iVar7 + 0x60 + local_20 * 4), (uVar17 - 2) * uVar14,uVar22 + uVar14 * 2); local_48 = local_48 + *(int *)(local_38 + 0xc) * 8; } iVar12 = local_20; if (*(uint *)(*(int *)(param_1 + 400) + 0x68) < *(uint *)(param_1 + 0x88)) { iVar12 = *(int *)(param_1 + 0x24) + local_20; } iVar16 = *(int *)(iVar7 + 0x88) + iVar12 * 0x28; if ((((((*(int *)(*(int *)(iVar7 + 0x88) + 4 + iVar12 * 0x28) == -1) && (*(int *)(iVar16 + 8) == -1)) && (*(int *)(iVar16 + 0xc) == -1)) && ((*(int *)(iVar16 + 0x10) == -1 && (*(int *)(iVar16 + 0x14) == -1)))) && ((*(int *)(iVar16 + 0x18) == -1 && ((*(int *)(iVar16 + 0x1c) == -1 && (*(int *)(iVar16 + 0x20) == -1)))))) && (*(int *)(iVar16 + 0x24) == -1)) { bVar21 = true; } else { bVar21 = false; } puVar9 = *(ushort **)(local_38 + 0x50); uVar17 = (uint)*puVar9; uVar2 = puVar9[1]; uVar3 = puVar9[8]; uVar4 = puVar9[0x10]; uVar5 = puVar9[9]; uVar6 = puVar9[2]; if (bVar21) { local_b8 = (uint)puVar9[3]; local_bc = (uint)puVar9[10]; local_c0 = (uint)puVar9[0x11]; local_c4 = (uint)puVar9[0x18]; } local_8c = 0; pcVar10 = *(code **)(*(int *)(param_1 + 0x1ac) + 4 + local_20 * 4); local_b0 = *(int *)(param_2 + local_20 * 4); iVar12 = *(int *)(param_1 + 0x120) * local_a8; if (0 < (int)local_a8) { iVar19 = *(int *)(param_1 + 400); iVar1 = local_20 * 4 + 0x3c; do { local_a4 = *(uint *)(iVar19 + 0x14 + local_20 * 4); iVar13 = *(int *)(param_1 + 0x88) * local_a8 + local_8c; iVar18 = local_a4 * 0x80; local_80 = (short *)(*(int *)(local_48 + local_8c * 4) + iVar18); if (iVar13 < 1) { local_68 = local_80; LAB_00ac6826: local_84 = local_68; } else { local_68 = (short *)(*(int *)(local_48 + -4 + local_8c * 4) + iVar18); if (iVar13 < 2) goto LAB_00ac6826; local_84 = (short *)(*(int *)(local_48 + -8 + local_8c * 4) + iVar18); } if (iVar13 < iVar12 + -1) { local_6c = (short *)(*(int *)(local_48 + 4 + local_8c * 4) + iVar18); } else { local_6c = local_80; } if (iVar13 < iVar12 + -2) { local_88 = (short *)(*(int *)(local_48 + 8 + local_8c * 4) + iVar18); } else { local_88 = local_6c; } local_ac = 0; local_94 = (int)*local_84; local_98 = (int)*local_68; local_78 = (int)*local_80; local_9c = (int)*local_6c; local_a0 = (int)*local_88; uVar14 = *(int *)(local_38 + 0x1c) - 1; local_7c = local_a0; local_74 = local_94; local_60 = local_a0; local_5c = local_a0; local_58 = local_78; local_50 = local_94; local_4c = local_94; local_34 = local_9c; local_30 = local_78; local_2c = local_78; local_28 = local_98; local_18 = local_9c; local_14 = local_9c; local_10 = local_98; local_c = local_98; if (*(uint *)(iVar1 + iVar19) < local_a4) { iVar13 = *(int *)(local_38 + 0x24); } else { do { psVar24 = local_80; psVar26 = psVar8; for (iVar19 = 0x20; iVar19 != 0; iVar19 = iVar19 + -1) { *(undefined4 *)psVar26 = *(undefined4 *)psVar24; psVar24 = psVar24 + 2; psVar26 = psVar26 + 2; } if ((local_a4 == *(uint *)(*(int *)(param_1 + 400) + 0x14 + local_20 * 4)) && (local_a4 < uVar14)) { local_30 = (int)local_80[0x40]; local_50 = (int)local_84[0x40]; local_c = (int)local_68[0x40]; local_18 = (int)local_6c[0x40]; local_60 = (int)local_88[0x40]; } iVar19 = local_50; iVar13 = local_60; local_a4 = local_a4 + 1; local_44 = local_18; local_40 = local_30; local_3c = local_c; if (local_a4 < uVar14) { local_50 = (int)local_84[0x80]; local_44 = (int)local_6c[0x80]; local_3c = (int)local_68[0x80]; local_40 = (int)local_80[0x80]; local_60 = (int)local_88[0x80]; } iVar18 = *(int *)(iVar16 + 4); if ((iVar18 != 0) && (psVar8[1] == 0)) { if (bVar21) { iVar20 = (((((((((local_44 - local_9c) - local_78) - local_98) + local_40 + local_3c) * 3 + (((local_14 - local_18) - local_c) + local_10) * 0xd + (local_2c - local_30) * 0x26) - local_7c) - local_a0) - local_74) - local_94) + local_60 + iVar13 + local_50 + iVar19; } else { iVar20 = (local_40 - local_78) * 7 + (local_2c - local_30) * 0x32; } iVar20 = iVar20 * uVar17; iVar15 = (uint)uVar2 * 0x80; iVar25 = (uint)uVar2 << 8; if (iVar20 < 0) { iVar25 = (iVar15 - iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } iVar25 = -iVar25; } else { iVar25 = (iVar15 + iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } } psVar8[1] = (short)iVar25; } iVar18 = *(int *)(iVar16 + 8); if ((iVar18 != 0) && (psVar8[8] == 0)) { if (bVar21) { iVar20 = (((((((((iVar13 - iVar19) - local_4c) - local_74) + local_5c + local_7c ) * 3 + (((local_c - local_18) - local_14) + local_10) * 0xd + (local_28 - local_34) * 0x26) - local_3c) - local_98) - local_50) - local_94) + local_60 + local_a0 + local_44 + local_9c; } else { iVar20 = (local_5c - local_4c) * 7 + (local_28 - local_34) * 0x32; } iVar20 = iVar20 * uVar17; iVar15 = (uint)uVar3 * 0x80; iVar25 = (uint)uVar3 << 8; if (iVar20 < 0) { iVar25 = (iVar15 - iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } iVar25 = -iVar25; } else { iVar25 = (iVar15 + iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } } psVar8[8] = (short)iVar25; } iVar18 = *(int *)(iVar16 + 0xc); if ((iVar18 != 0) && (psVar8[0x10] == 0)) { if (bVar21) { iVar20 = (local_34 + local_58 * -2 + local_28) * 7 + (local_18 + local_14 + local_c + local_10) * 2 + (local_30 + local_2c) * -5 + local_5c + local_4c; } else { iVar20 = (((local_28 + local_34) * 0xd + local_58 * -0x18) - local_5c) - local_4c; } iVar20 = iVar20 * uVar17; iVar15 = (uint)uVar4 * 0x80; iVar25 = (uint)uVar4 << 8; if (iVar20 < 0) { iVar25 = (iVar15 - iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } iVar25 = -iVar25; } else { iVar25 = (iVar15 + iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } } psVar8[0x10] = (short)iVar25; } iVar18 = *(int *)(iVar16 + 0x10); if ((iVar18 != 0) && (psVar8[9] == 0)) { iVar20 = ((local_18 - local_c) - local_14) + local_10; if (bVar21) { iVar20 = ((iVar20 * 9 - local_60) - local_94) + local_a0 + local_50; } else { iVar20 = ((((iVar20 * 10 - iVar13) - local_44) - local_98) - local_74) + local_7c + local_9c + local_3c + iVar19; } iVar20 = iVar20 * uVar17; iVar15 = (uint)uVar5 * 0x80; iVar25 = (uint)uVar5 << 8; if (iVar20 < 0) { iVar25 = (iVar15 - iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } iVar25 = -iVar25; } else { iVar25 = (iVar20 + iVar15) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } } psVar8[9] = (short)iVar25; } iVar18 = *(int *)(iVar16 + 0x14); if ((iVar18 != 0) && (psVar8[2] == 0)) { if (bVar21) { iVar20 = (local_30 + local_58 * -2 + local_2c) * 7 + (local_18 + local_14 + local_c + local_10) * 2 + (local_28 + local_34) * -5 + local_40 + local_78; } else { iVar20 = (((local_30 + local_2c) * 0xd + local_58 * -0x18) - local_40) - local_78; } iVar20 = iVar20 * uVar17; iVar15 = (uint)uVar6 * 0x80; iVar25 = (uint)uVar6 << 8; if (iVar20 < 0) { iVar25 = (iVar15 - iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { iVar25 = iVar18 + -1; } iVar25 = -iVar25; } else { iVar25 = (iVar15 + iVar20) / iVar25; if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar25)) { psVar8[2] = (short)iVar18 + -1; goto LAB_00ac6e10; } } psVar8[2] = (short)iVar25; } LAB_00ac6e10: if (bVar21) { iVar18 = *(int *)(iVar16 + 0x18); if ((iVar18 != 0) && (psVar8[3] == 0)) { iVar20 = ((((local_2c - local_30) * 2 - local_18) - local_c) + local_14 + local_10) * uVar17; if (iVar20 < 0) { iVar20 = (int)(local_b8 * 0x80 - iVar20) / (int)(local_b8 << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } iVar20 = -iVar20; } else { iVar20 = (int)(iVar20 + local_b8 * 0x80) / (int)(local_b8 << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } } psVar8[3] = (short)iVar20; } iVar18 = *(int *)(iVar16 + 0x1c); if ((iVar18 != 0) && (psVar8[10] == 0)) { iVar20 = ((((local_34 - local_28) * 3 - local_18) - local_14) + local_c + local_10) * uVar17; if (iVar20 < 0) { iVar20 = (int)(local_bc * 0x80 - iVar20) / (int)(local_bc << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } iVar20 = -iVar20; } else { iVar20 = (int)(iVar20 + local_bc * 0x80) / (int)(local_bc << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } } psVar8[10] = (short)iVar20; } iVar18 = *(int *)(iVar16 + 0x20); if ((iVar18 != 0) && (psVar8[0x11] == 0)) { iVar20 = ((((local_30 - local_2c) * 3 - local_18) - local_c) + local_14 + local_10) * uVar17; if (iVar20 < 0) { iVar20 = (int)(local_c0 * 0x80 - iVar20) / (int)(local_c0 << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } iVar20 = -iVar20; } else { iVar20 = (int)(iVar20 + local_c0 * 0x80) / (int)(local_c0 << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } } psVar8[0x11] = (short)iVar20; } iVar18 = *(int *)(iVar16 + 0x24); if ((iVar18 != 0) && (psVar8[0x18] == 0)) { iVar20 = ((((local_28 - local_34) * 2 - local_18) - local_14) + local_c + local_10) * uVar17; if (iVar20 < 0) { iVar20 = (int)(local_c4 * 0x80 - iVar20) / (int)(local_c4 << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } iVar20 = -iVar20; } else { iVar20 = (int)(iVar20 + local_c4 * 0x80) / (int)(local_c4 << 8); if ((0 < iVar18) && (iVar18 = 1 << ((byte)iVar18 & 0x1f), iVar18 <= iVar20)) { iVar20 = iVar18 + -1; } } psVar8[0x18] = (short)iVar20; } iVar20 = (((((((((((((((local_30 + local_34 + local_2c + local_28) * 7 - iVar13) - local_7c) - local_44) - local_9c) - local_3c) - local_98) - iVar19) - local_74) + local_18 + local_14 + local_c + local_10) * 3 + ((((local_58 * 0x13 - local_5c) - local_40) - local_78) - local_4c) * 4) - local_60) - local_a0) - local_50) - local_94) * uVar17; iVar18 = iVar20 * 2; if (iVar18 < 0) { sVar11 = -(short)((int)(uVar17 * 0x80 + iVar20 * -2) / (int)(uVar17 << 8)); } else { sVar11 = (short)((int)(iVar18 + uVar17 * 0x80) / (int)(uVar17 << 8)); } *psVar8 = sVar11; } (*pcVar10)(param_1,local_38,psVar8,local_b0,local_ac); local_94 = local_74; local_74 = local_4c; local_4c = iVar19; local_98 = local_10; local_10 = local_28; local_28 = local_c; local_c = local_3c; local_78 = local_2c; local_2c = local_58; iVar19 = *(int *)(param_1 + 400); local_58 = local_30; local_30 = local_40; local_80 = local_80 + 0x40; local_68 = local_68 + 0x40; local_6c = local_6c + 0x40; local_84 = local_84 + 0x40; local_88 = local_88 + 0x40; local_9c = local_14; local_14 = local_34; local_34 = local_18; local_18 = local_44; local_a0 = local_7c; local_7c = local_5c; local_5c = iVar13; iVar13 = *(int *)(local_38 + 0x24); local_ac = local_ac + iVar13; } while (local_a4 <= *(uint *)(iVar1 + iVar19)); } local_8c = local_8c + 1; local_b0 = local_b0 + iVar13 * 4; } while (local_8c < (int)local_a8); } } local_20 = local_20 + 1; local_38 = local_38 + 0x58; } while (local_20 < *(int *)(param_1 + 0x24)); } *(int *)(param_1 + 0x88) = *(int *)(param_1 + 0x88) + 1; return 4 - (uint)(*(uint *)(param_1 + 0x88) < *(uint *)(param_1 + 0x120)); } //@@ 00ac71d0 libjpeg_jinit_d_coef_controller /* DB: libjpeg jdcoefct.c: allocates the 0x8c-byte coef controller (cinfo->coef = this[0x66]); need_full_buffer (DL) builds whole-image virtual arrays, else one MCU of 10 blocks (0x80 bytes each) with decompress_onepass; data_precision must be 8; only caller libjpeg_jinit_master_decompress */ void libjpeg_jinit_d_coef_controller(void) { undefined4 *_Dst; undefined4 uVar1; int iVar2; undefined4 *puVar3; int *in_ECX; code *pcVar4; char in_DL; code *pcVar5; undefined4 *local_14; int local_10; if (in_ECX[0x30] != 8) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } _Dst = (undefined4 *)(**(code **)in_ECX[1])(); memset(_Dst,0,0x8c); in_ECX[0x66] = (int)_Dst; *_Dst = FUN_00ac5c40; _Dst[2] = FUN_00ac5c60; _Dst[0x22] = 0; if (in_DL == '\0') { iVar2 = (**(code **)(in_ECX[1] + 4))(); _Dst[0xd] = iVar2; _Dst[0x12] = iVar2 + 0x280; _Dst[0xe] = iVar2 + 0x80; _Dst[0x13] = iVar2 + 0x300; _Dst[0xf] = iVar2 + 0x100; _Dst[0x14] = iVar2 + 0x380; _Dst[0x10] = iVar2 + 0x180; _Dst[0x15] = iVar2 + 0x400; _Dst[0x11] = iVar2 + 0x200; _Dst[0x16] = iVar2 + 0x480; pcVar4 = decompress_onepass; puVar3 = (undefined4 *)0x0; pcVar5 = Weapon::GetFocusEntity; } else { local_10 = 0; if (0 < in_ECX[9]) { local_14 = _Dst + 0x18; do { uVar1 = (**(code **)(in_ECX[1] + 0x14))(); *local_14 = uVar1; local_14 = local_14 + 1; local_10 = local_10 + 1; } while (local_10 < in_ECX[9]); } puVar3 = _Dst + 0x18; pcVar4 = FUN_00ac6150; pcVar5 = consume_data; } _Dst[1] = pcVar5; _Dst[3] = pcVar4; _Dst[9] = puVar3; uVar1 = (**(code **)in_ECX[1])(); _Dst[0x17] = uVar1; return; } //@@ 00ac7390 FUN_00ac7390 void FUN_00ac7390(int *param_1) { int iVar1; uint tableNo; int iVar2; int iVar3; undefined4 *puVar4; int *piVar5; int iVar6; int iVar7; int iVar8; int *local_10; int local_c; iVar1 = param_1[0x6a]; local_c = 0; if (0 < param_1[0x4a]) { piVar5 = param_1 + 0x4b; do { tableNo = *(uint *)(*piVar5 + 0x14); if ((3 < tableNo) || (param_1[tableNo + 0x28] == 0)) { *(undefined4 *)(*param_1 + 0x14) = 0x34; *(uint *)(*param_1 + 0x18) = tableNo; (**(code **)*param_1)(param_1); } jpeg_make_d_derived_tbl(param_1,1,tableNo,(void *)(iVar1 + 0x1c + tableNo * 4)); local_c = local_c + 1; piVar5 = piVar5 + 1; } while (local_c < param_1[0x4a]); } iVar6 = 0; iVar8 = 0; if (0 < param_1[0x51]) { do { local_c = 0; iVar2 = param_1[param_1[iVar8 + 0x52] + 0x4b]; iVar3 = *(int *)(iVar2 + 4); if (0 < *(int *)(iVar2 + 0x3c)) { local_10 = (int *)(iVar1 + (iVar6 + 0xb) * 0xc); do { *local_10 = local_c; iVar7 = 0; local_10[-1] = iVar3; local_10[1] = *(int *)(iVar2 + 0x38); if (0 < *(int *)(iVar2 + 0x38)) { puVar4 = (undefined4 *)(iVar1 + iVar8 * 4 + 0x2c); do { puVar4[0x33] = iVar6; iVar7 = iVar7 + 1; iVar8 = iVar8 + 1; *puVar4 = *(undefined4 *)(iVar1 + 0x1c + *(int *)(iVar2 + 0x14) * 4); puVar4 = puVar4 + 1; } while (iVar7 < *(int *)(iVar2 + 0x38)); } local_10 = local_10 + 3; local_c = local_c + 1; iVar6 = iVar6 + 1; } while (local_c < *(int *)(iVar2 + 0x3c)); } } while (iVar8 < param_1[0x51]); } *(int *)(iVar1 + 0x7c) = iVar6; *(undefined4 *)(iVar1 + 0x18) = 0; *(undefined4 *)(iVar1 + 0x14) = 0; *(undefined1 *)(iVar1 + 0x10) = 0; return; } //@@ 00ac74f0 FUN_00ac74f0 undefined1 FUN_00ac74f0(int param_1) { int *piVar1; int iVar2; char cVar3; iVar2 = *(int *)(param_1 + 0x1a8); piVar1 = (int *)(*(int *)(param_1 + 0x1a4) + 0x14); *piVar1 = *piVar1 + ((int)(*(int *)(iVar2 + 0x18) + (*(int *)(iVar2 + 0x18) >> 0x1f & 7U)) >> 3); *(undefined4 *)(iVar2 + 0x18) = 0; cVar3 = (**(code **)(*(int *)(param_1 + 0x1a4) + 8))(param_1); if (cVar3 == '\0') { return 0; } if (*(int *)(param_1 + 0x18c) == 0) { *(undefined1 *)(iVar2 + 0x10) = 0; } return 1; } //@@ 00ac7550 decode_mcus /* DB: libjpeg-turbo jdlhuff.c (lossless): stored as entropy->decode_mcus (puVar[2]) next to start_pass/process_restart in the inlined jinit_lhuff_decoder of libjpeg_jinit_master_decompress (lossless branch, arith -> JERR 0x31); (cinfo, diff_buf, MCU_row_num, MCU_col_num, nMCU) huffman difference decoding, 0x10 -> 32768 */ uint decode_mcus(int param_1,int param_2,int param_3,int param_4,uint param_5) { int iVar1; undefined4 uVar2; undefined4 uVar3; char cVar4; uint uVar5; int iVar6; int iVar7; int iVar8; undefined4 *puVar9; int *piVar10; uint uVar11; uint local_24; int local_20; int *local_14; int local_10; int *local_c; uint local_8; iVar1 = *(int *)(param_1 + 0x1a8); iVar8 = 0; iVar6 = *(int *)(iVar1 + 0x7c); if (0 < iVar6) { local_c = (int *)(iVar1 + 0x54); piVar10 = (int *)(iVar1 + 0x80); do { iVar8 = iVar8 + 1; *local_c = *(int *)(*(int *)(param_2 + *piVar10 * 4) + (piVar10[1] + param_3) * 4) + piVar10[2] * param_4 * 4; local_c = local_c + 1; iVar6 = *(int *)(iVar1 + 0x7c); piVar10 = piVar10 + 3; } while (iVar8 < iVar6); } if (*(char *)(iVar1 + 0x10) == '\0') { uVar11 = *(uint *)(iVar1 + 0x14); uVar2 = **(undefined4 **)(param_1 + 0x18); uVar3 = (*(undefined4 **)(param_1 + 0x18))[1]; iVar6 = *(int *)(iVar1 + 0x18); local_c = (int *)0x0; local_8 = uVar11; if (param_5 != 0) { do { local_10 = 0; if (0 < *(int *)(param_1 + 0x144)) { local_14 = (int *)(iVar1 + 0xf8); do { iVar8 = local_14[-0x33]; if (iVar6 < 8) { cVar4 = FUN_00ac2780(iVar6,0); if (cVar4 == '\0') { return (uint)local_c; } local_8 = local_24; iVar6 = local_20; uVar11 = local_24; if (7 < local_20) goto LAB_00ac76cd; iVar7 = 1; LAB_00ac7696: uVar5 = FUN_00ac28a0(iVar6,iVar8,iVar7); if ((int)uVar5 < 0) { return (uint)local_c; } local_8 = local_24; iVar6 = local_20; uVar11 = local_24; } else { LAB_00ac76cd: uVar5 = *(uint *)(iVar8 + 0x94 + (uVar11 >> ((char)iVar6 - 8U & 0x1f) & 0xff) * 4); iVar7 = (int)uVar5 >> 8; if (8 < iVar7) goto LAB_00ac7696; iVar6 = iVar6 - iVar7; uVar5 = uVar5 & 0xff; } iVar8 = 0; if (uVar5 != 0) { if (uVar5 == 0x10) { iVar8 = 0x8000; } else { if (iVar6 < (int)uVar5) { cVar4 = FUN_00ac2780(iVar6,uVar5); if (cVar4 == '\0') { return (uint)local_c; } local_8 = local_24; iVar6 = local_20; uVar11 = local_24; } iVar6 = iVar6 - uVar5; iVar8 = 1 << ((byte)uVar5 & 0x1f); uVar11 = uVar11 >> ((byte)iVar6 & 0x1f) & iVar8 - 1U; iVar8 = ((int)(uVar11 - (1 << ((byte)uVar5 - 1 & 0x1f))) >> 0x1f & 1U - iVar8) + uVar11; } } **(int **)(iVar1 + 0x54 + *local_14 * 4) = iVar8; iVar8 = *local_14; local_14 = local_14 + 1; piVar10 = (int *)(iVar1 + 0x54 + iVar8 * 4); *piVar10 = *piVar10 + 4; local_10 = local_10 + 1; uVar11 = local_8; } while (local_10 < *(int *)(param_1 + 0x144)); } **(undefined4 **)(param_1 + 0x18) = uVar2; *(undefined4 *)(*(int *)(param_1 + 0x18) + 4) = uVar3; local_c = (int *)((int)local_c + 1); *(uint *)(iVar1 + 0x14) = uVar11; *(int *)(iVar1 + 0x18) = iVar6; } while (local_c < param_5); } } else { iVar8 = 0; if (0 < iVar6) { local_c = (int *)(iVar1 + 0x88); puVar9 = (undefined4 *)(iVar1 + 0x54); do { memset((void *)*puVar9,0,*local_c * param_5 * 4); puVar9 = puVar9 + 1; iVar8 = iVar8 + 1; local_c = local_c + 3; } while (iVar8 < *(int *)(iVar1 + 0x7c)); } (*(code *)**(undefined4 **)(param_1 + 0x1ac))(param_1); } return param_5; } //@@ 00ac77c0 FUN_00ac77c0 void FUN_00ac77c0(void) { int iVar1; undefined4 uVar2; int iVar3; int in_ECX; undefined1 *puVar4; int iVar5; int iVar6; int local_c; int local_8; iVar1 = *(int *)(in_ECX + 0x1b4); uVar2 = (*(code *)**(undefined4 **)(in_ECX + 4))(); *(undefined4 *)(iVar1 + 0x10) = uVar2; uVar2 = (*(code *)**(undefined4 **)(in_ECX + 4))(); *(undefined4 *)(iVar1 + 0x14) = uVar2; uVar2 = (*(code *)**(undefined4 **)(in_ECX + 4))(); *(undefined4 *)(iVar1 + 0x18) = uVar2; uVar2 = (*(code *)**(undefined4 **)(in_ECX + 4))(); *(undefined4 *)(iVar1 + 0x1c) = uVar2; local_c = 0x2c8d00; puVar4 = &LAB_005b6900; local_8 = -0xe25100; iVar3 = 0; iVar5 = -0xb2f480; do { iVar6 = iVar5 + 0x166e9; *(int *)(iVar3 + *(int *)(iVar1 + 0x10)) = iVar5 >> 0x10; *(int *)(iVar3 + *(int *)(iVar1 + 0x14)) = local_8 >> 0x10; *(undefined1 **)(iVar3 + *(int *)(iVar1 + 0x18)) = puVar4; puVar4 = puVar4 + -0xb6d2; *(int *)(iVar3 + *(int *)(iVar1 + 0x1c)) = local_c; local_c = local_c + -0x581a; iVar3 = iVar3 + 4; iVar5 = iVar6; local_8 = local_8 + 0x1c5a2; } while (iVar6 < 0xb28d98); return; } //@@ 00ac7890 FUN_00ac7890 void FUN_00ac7890(int param_1,int *param_2,int param_3,int *param_4,int param_5) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; byte *pbVar11; int iVar12; undefined1 *puVar13; uint uVar14; byte *pbVar15; int local_14; int local_8; switch(*(undefined4 *)(param_1 + 0x2c)) { case 6: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 2); pbVar15 = pbVar11; local_14 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[-2] = *(undefined1 *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar14 + iVar5); puVar13[-1] = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)((uint)bVar1 * 4 + iVar8) >> 0x10) + uVar14 + iVar5); local_14 = local_14 + -1; *puVar13 = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13 = puVar13 + 3; pbVar15 = pbVar15 + 1; } while (local_14 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 7: case 0xc: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 2); pbVar15 = pbVar11; local_8 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[-2] = *(undefined1 *)(*(int *)(iVar6 + (uint)bVar1 * 4) + uVar14 + iVar5); puVar13[-1] = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)(iVar8 + (uint)bVar1 * 4) >> 0x10) + uVar14 + iVar5); local_8 = local_8 + -1; *puVar13 = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13[1] = 0xff; puVar13 = puVar13 + 4; pbVar15 = pbVar15 + 1; } while (local_8 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 8: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 1); pbVar15 = pbVar11; local_8 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[1] = *(undefined1 *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar14 + iVar5); *puVar13 = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)((uint)bVar1 * 4 + iVar8) >> 0x10) + uVar14 + iVar5); local_8 = local_8 + -1; puVar13[-1] = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13 = puVar13 + 3; pbVar15 = pbVar15 + 1; } while (local_8 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 9: case 0xd: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 1); pbVar15 = pbVar11; local_8 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[1] = *(undefined1 *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar14 + iVar5); *puVar13 = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)((uint)bVar1 * 4 + iVar8) >> 0x10) + uVar14 + iVar5); local_8 = local_8 + -1; puVar13[-1] = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13[2] = 0xff; puVar13 = puVar13 + 4; pbVar15 = pbVar15 + 1; } while (local_8 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 10: case 0xe: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 2); pbVar15 = pbVar11; local_8 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[1] = *(undefined1 *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar14 + iVar5); *puVar13 = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)((uint)bVar1 * 4 + iVar8) >> 0x10) + uVar14 + iVar5); local_8 = local_8 + -1; puVar13[-1] = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13[-2] = 0xff; puVar13 = puVar13 + 4; pbVar15 = pbVar15 + 1; } while (local_8 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 0xb: case 0xf: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 2); pbVar15 = pbVar11; local_8 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[-1] = *(undefined1 *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar14 + iVar5); *puVar13 = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)((uint)bVar1 * 4 + iVar8) >> 0x10) + uVar14 + iVar5); local_8 = local_8 + -1; puVar13[1] = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13[-2] = 0xff; puVar13 = puVar13 + 4; pbVar15 = pbVar15 + 1; } while (local_8 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; default: iVar3 = *(int *)(param_1 + 0x1b4); iVar4 = *(int *)(param_1 + 0x5c); iVar5 = *(int *)(param_1 + 0x124); param_1 = param_5 + -1; iVar6 = *(int *)(iVar3 + 0x10); iVar7 = *(int *)(iVar3 + 0x14); iVar8 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); if (-1 < param_1) { param_3 = param_3 * 4; do { iVar9 = *param_4; param_4 = param_4 + 1; iVar10 = *(int *)(param_3 + *param_2); pbVar11 = *(byte **)(param_3 + param_2[1]); iVar12 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (iVar4 != 0) { puVar13 = (undefined1 *)(iVar9 + 2); pbVar15 = pbVar11; local_8 = iVar4; do { bVar1 = pbVar15[iVar12 - (int)pbVar11]; uVar14 = (uint)pbVar15[iVar10 - (int)pbVar11]; bVar2 = *pbVar15; puVar13[-2] = *(undefined1 *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar14 + iVar5); puVar13[-1] = *(undefined1 *) ((*(int *)(iVar3 + (uint)bVar2 * 4) + *(int *)((uint)bVar1 * 4 + iVar8) >> 0x10) + uVar14 + iVar5); local_8 = local_8 + -1; *puVar13 = *(undefined1 *)(*(int *)(iVar7 + (uint)bVar2 * 4) + uVar14 + iVar5); puVar13 = puVar13 + 3; pbVar15 = pbVar15 + 1; } while (local_8 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); } } return; } //@@ 00ac8180 FUN_00ac8180 void FUN_00ac8180(int param_1,int *param_2,int param_3,int *param_4,int param_5) { uint uVar1; int iVar2; int iVar3; int iVar4; undefined1 *puVar5; undefined1 *puVar6; undefined1 *puVar7; uint uVar8; int local_14; int *local_c; uVar1 = *(uint *)(param_1 + 0x5c); param_5 = param_5 + -1; iVar2 = *(int *)(param_1 + 0x24); param_1 = param_5; if (iVar2 == 3) { if (-1 < param_5) { param_3 = param_3 * 4; local_c = param_4; do { iVar2 = *(int *)(param_3 + *param_2); puVar6 = *(undefined1 **)(param_3 + param_2[1]); iVar3 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; if (uVar1 != 0) { puVar5 = (undefined1 *)*local_c; puVar7 = puVar6; uVar8 = uVar1; do { *puVar5 = puVar7[iVar2 - (int)puVar6]; puVar5[1] = *puVar7; puVar5[2] = (puVar7 + 1)[(iVar3 - (int)puVar6) + -1]; uVar8 = uVar8 - 1; puVar5 = puVar5 + 3; puVar7 = puVar7 + 1; } while (uVar8 != 0); } param_1 = param_1 + -1; local_c = local_c + 1; } while (-1 < param_1); return; } } else if (iVar2 == 4) { if (-1 < param_5) { param_3 = param_3 * 4; local_c = param_4; do { iVar2 = *(int *)(param_3 + *param_2); puVar6 = *(undefined1 **)(param_3 + param_2[1]); iVar3 = *(int *)(param_3 + param_2[2]); iVar4 = *(int *)(param_3 + param_2[3]); param_3 = param_3 + 4; if (uVar1 != 0) { puVar5 = (undefined1 *)*local_c; puVar7 = puVar6; uVar8 = uVar1; do { *puVar5 = puVar7[iVar2 - (int)puVar6]; puVar5[1] = *puVar7; puVar5[2] = puVar7[iVar3 - (int)puVar6]; puVar5[3] = (puVar7 + 1)[(iVar4 - (int)puVar6) + -1]; uVar8 = uVar8 - 1; puVar5 = puVar5 + 4; puVar7 = puVar7 + 1; } while (uVar8 != 0); } param_1 = param_1 + -1; local_c = local_c + 1; } while (-1 < param_1); return; } } else if (-1 < param_5) { local_c = (int *)(param_3 * 4); do { local_14 = 0; if (0 < iVar2) { do { iVar3 = *(int *)((int)local_c + param_2[local_14]); uVar8 = 0; if (uVar1 != 0) { puVar6 = (undefined1 *)(local_14 + *param_4); do { puVar5 = (undefined1 *)(iVar3 + uVar8); uVar8 = uVar8 + 1; *puVar6 = *puVar5; puVar6 = puVar6 + iVar2; } while (uVar8 < uVar1); } local_14 = local_14 + 1; } while (local_14 < iVar2); } param_4 = param_4 + 1; local_c = (int *)((int)local_c + 4); param_1 = param_1 + -1; } while (-1 < param_1); } return; } //@@ 00ac8360 FUN_00ac8360 void FUN_00ac8360(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { FUN_00ab3640(param_4,0,param_5,*(undefined4 *)(param_1 + 0x5c)); return; } //@@ 00ac8390 FUN_00ac8390 void FUN_00ac8390(int param_1,int *param_2,int param_3,int *param_4,int param_5) { undefined1 uVar1; uint uVar2; int iVar3; int iVar4; undefined1 *puVar5; uint uVar6; switch(*(undefined4 *)(param_1 + 0x2c)) { case 6: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 1); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[1] = uVar1; *puVar5 = uVar1; puVar5[-1] = uVar1; puVar5 = puVar5 + 3; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); return; } break; case 7: case 0xc: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 1); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[1] = uVar1; *puVar5 = uVar1; puVar5[-1] = uVar1; puVar5[2] = 0xff; puVar5 = puVar5 + 4; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); return; } break; case 8: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 2); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[-2] = uVar1; puVar5[-1] = uVar1; *puVar5 = uVar1; puVar5 = puVar5 + 3; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); return; } break; case 9: case 0xd: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 2); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[-2] = uVar1; puVar5[-1] = uVar1; *puVar5 = uVar1; puVar5[1] = 0xff; puVar5 = puVar5 + 4; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); return; } break; case 10: case 0xe: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 2); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[-1] = uVar1; *puVar5 = uVar1; puVar5[1] = uVar1; puVar5[-2] = 0xff; puVar5 = puVar5 + 4; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); return; } break; case 0xb: case 0xf: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 2); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[1] = uVar1; *puVar5 = uVar1; puVar5[-1] = uVar1; puVar5[-2] = 0xff; puVar5 = puVar5 + 4; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); return; } break; default: param_5 = param_5 + -1; uVar2 = *(uint *)(param_1 + 0x5c); if (-1 < param_5) { param_3 = param_3 * 4; do { iVar3 = *(int *)(param_3 + *param_2); param_3 = param_3 + 4; iVar4 = *param_4; param_4 = param_4 + 1; uVar6 = 0; if (uVar2 != 0) { puVar5 = (undefined1 *)(iVar4 + 1); do { uVar1 = *(undefined1 *)(uVar6 + iVar3); uVar6 = uVar6 + 1; puVar5[1] = uVar1; *puVar5 = uVar1; puVar5[-1] = uVar1; puVar5 = puVar5 + 3; } while (uVar6 < uVar2); } param_5 = param_5 + -1; } while (-1 < param_5); } } return; } //@@ 00ac86a0 FUN_00ac86a0 void FUN_00ac86a0(int param_1,int *param_2,int param_3,int *param_4,int param_5) { int iVar1; int iVar2; undefined1 *puVar3; int iVar4; undefined1 *puVar5; undefined1 *puVar6; int iVar7; int *local_c; int *local_8; switch(*(undefined4 *)(param_1 + 0x2c)) { case 6: local_8 = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_8; local_8 = local_8 + 1; if (iVar1 != 0) { puVar5 = puVar3; puVar6 = (undefined1 *)(iVar7 + 2); iVar7 = iVar1; do { puVar6[-2] = puVar5[iVar2 - (int)puVar3]; puVar6[-1] = *puVar5; *puVar6 = puVar5[iVar4 - (int)puVar3]; iVar7 = iVar7 + -1; puVar5 = puVar5 + 1; puVar6 = puVar6 + 3; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 7: case 0xc: local_c = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_c; local_c = local_c + 1; if (iVar1 != 0) { puVar5 = (undefined1 *)(iVar7 + 2); puVar6 = puVar3; iVar7 = iVar1; do { puVar5[-2] = puVar6[iVar2 - (int)puVar3]; puVar5[-1] = *puVar6; *puVar5 = (puVar6 + 1)[(iVar4 - (int)puVar3) + -1]; puVar5[1] = 0xff; iVar7 = iVar7 + -1; puVar5 = puVar5 + 4; puVar6 = puVar6 + 1; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 8: local_c = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_c; local_c = local_c + 1; if (iVar1 != 0) { puVar5 = puVar3; puVar6 = (undefined1 *)(iVar7 + 1); iVar7 = iVar1; do { puVar6[1] = puVar5[iVar2 - (int)puVar3]; *puVar6 = *puVar5; puVar6[-1] = (puVar5 + 1)[(iVar4 - (int)puVar3) + -1]; iVar7 = iVar7 + -1; puVar5 = puVar5 + 1; puVar6 = puVar6 + 3; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 9: case 0xd: local_c = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_c; local_c = local_c + 1; if (iVar1 != 0) { puVar5 = (undefined1 *)(iVar7 + 1); puVar6 = puVar3; iVar7 = iVar1; do { puVar5[1] = puVar6[iVar2 - (int)puVar3]; *puVar5 = *puVar6; puVar5[-1] = (puVar6 + 1)[(iVar4 - (int)puVar3) + -1]; puVar5[2] = 0xff; iVar7 = iVar7 + -1; puVar5 = puVar5 + 4; puVar6 = puVar6 + 1; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 10: case 0xe: local_c = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_c; local_c = local_c + 1; if (iVar1 != 0) { puVar5 = (undefined1 *)(iVar7 + 2); puVar6 = puVar3; iVar7 = iVar1; do { puVar5[1] = puVar6[iVar2 - (int)puVar3]; *puVar5 = *puVar6; puVar5[-1] = (puVar6 + 1)[(iVar4 - (int)puVar3) + -1]; puVar5[-2] = 0xff; iVar7 = iVar7 + -1; puVar5 = puVar5 + 4; puVar6 = puVar6 + 1; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; case 0xb: case 0xf: local_c = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_c; local_c = local_c + 1; if (iVar1 != 0) { puVar5 = (undefined1 *)(iVar7 + 2); puVar6 = puVar3; iVar7 = iVar1; do { puVar5[-1] = puVar6[iVar2 - (int)puVar3]; *puVar5 = *puVar6; puVar5[1] = (puVar6 + 1)[(iVar4 - (int)puVar3) + -1]; puVar5[-2] = 0xff; iVar7 = iVar7 + -1; puVar5 = puVar5 + 4; puVar6 = puVar6 + 1; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); return; } break; default: local_c = param_4; iVar1 = *(int *)(param_1 + 0x5c); if (-1 < param_5 + -1) { param_3 = param_3 * 4; param_1 = param_5 + -1; do { iVar2 = *(int *)(param_3 + *param_2); puVar3 = *(undefined1 **)(param_3 + param_2[1]); iVar4 = *(int *)(param_3 + param_2[2]); param_3 = param_3 + 4; iVar7 = *local_c; local_c = local_c + 1; if (iVar1 != 0) { puVar5 = puVar3; puVar6 = (undefined1 *)(iVar7 + 2); iVar7 = iVar1; do { puVar6[-2] = puVar5[iVar2 - (int)puVar3]; puVar6[-1] = *puVar5; *puVar6 = (puVar5 + 1)[(iVar4 - (int)puVar3) + -1]; iVar7 = iVar7 + -1; puVar5 = puVar5 + 1; puVar6 = puVar6 + 3; } while (iVar7 != 0); } param_1 = param_1 + -1; } while (-1 < param_1); } } return; } //@@ 00ac8ca0 ycc_rgb565_convert_le /* DB: libjpeg-turbo jdcol565.c ycc_rgb565_convert_internal little-endian: only caller FUN_00ac9830 (ycc_rgb565_convert wrapper); deconverter +0x10..+0x1c Cr_r/Cb_b/Cr_g/Cb_g tables, packs (R&0xf8)<<8|(G&0xfc)<<3|B>>3 two pixels per dword, alignment pixel first */ void ycc_rgb565_convert_le(int param_1,uint *param_2,int param_3) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int in_ECX; int *in_EDX; uint uVar8; byte *pbVar9; byte *pbVar10; uint uVar11; uint local_2c; uint local_18; uint *local_14; byte *local_10; byte *local_c; byte *local_8; param_3 = param_3 + -1; iVar3 = *(int *)(in_ECX + 0x124); iVar4 = *(int *)(in_ECX + 0x1b4); local_18 = *(uint *)(in_ECX + 0x5c); iVar5 = *(int *)(iVar4 + 0x10); iVar6 = *(int *)(iVar4 + 0x14); iVar7 = *(int *)(iVar4 + 0x18); iVar4 = *(int *)(iVar4 + 0x1c); if (-1 < param_3) { param_1 = param_1 * 4; do { local_c = *(byte **)(param_1 + *in_EDX); local_10 = *(byte **)(param_1 + in_EDX[1]); local_8 = *(byte **)(param_1 + in_EDX[2]); param_1 = param_1 + 4; local_14 = (uint *)*param_2; param_2 = param_2 + 1; if (((uint)local_14 & 3) != 0) { uVar8 = (uint)*local_c; local_c = local_c + 1; bVar1 = *local_10; local_10 = local_10 + 1; bVar2 = *local_8; local_8 = local_8 + 1; *(ushort *)local_14 = ((ushort)(*(byte *)((*(int *)((uint)bVar2 * 4 + iVar7) + *(int *)((uint)bVar1 * 4 + iVar4) >> 0x10) + uVar8 + iVar3) & 0xfc ) | (*(byte *)(*(int *)((uint)bVar2 * 4 + iVar5) + uVar8 + iVar3) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(*(int *)((uint)bVar1 * 4 + iVar6) + uVar8 + iVar3) >> 3); local_14 = (uint *)((int)local_14 + 2); local_18 = local_18 - 1; } local_2c = local_18 >> 1; if (local_2c != 0) { do { uVar11 = (uint)*local_c; bVar1 = *local_8; pbVar9 = local_8 + 1; bVar2 = *local_10; pbVar10 = local_10 + 1; uVar8 = (uint)local_c[1]; local_c = local_c + 2; local_10 = local_10 + 2; local_8 = local_8 + 2; *local_14 = ((*(byte *)((*(int *)((uint)*pbVar9 * 4 + iVar7) + *(int *)((uint)*pbVar10 * 4 + iVar4) >> 0x10) + uVar8 + iVar3) & 0xfc | (*(byte *)(*(int *)((uint)*pbVar9 * 4 + iVar5) + uVar8 + iVar3) & 0xfffffff8) << 5) << 3 | (uint)(*(byte *)(*(int *)((uint)*pbVar10 * 4 + iVar6) + uVar8 + iVar3) >> 3)) << 0x10 | (*(byte *)((*(int *)((uint)bVar1 * 4 + iVar7) + *(int *)((uint)bVar2 * 4 + iVar4) >> 0x10) + uVar11 + iVar3) & 0xfc | (*(byte *)(*(int *)((uint)bVar1 * 4 + iVar5) + uVar11 + iVar3) & 0xf8) << 5) << 3 | (uint)(*(byte *)(*(int *)((uint)bVar2 * 4 + iVar6) + uVar11 + iVar3) >> 3); local_14 = local_14 + 1; local_2c = local_2c - 1; } while (local_2c != 0); } if ((local_18 & 1) != 0) { uVar8 = (uint)*local_c; *(ushort *)local_14 = ((ushort)(*(byte *)((*(int *)(iVar7 + (uint)*local_8 * 4) + *(int *)((uint)*local_10 * 4 + iVar4) >> 0x10) + uVar8 + iVar3) & 0xfc) | (*(byte *)(*(int *)(iVar5 + (uint)*local_8 * 4) + uVar8 + iVar3) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(*(int *)((uint)*local_10 * 4 + iVar6) + uVar8 + iVar3) >> 3); } param_3 = param_3 + -1; } while (-1 < param_3); } return; } //@@ 00ac8f50 ycc_rgb565D_convert /* DB: libjpeg-turbo jdcol565.c: color_convert(cinfo, input_buf, input_row, output_buf, num_rows) with Cr_r/Cb_b/Cr_g/Cb_g tables at cconvert(+0x1b4)+0x10..+0x1c (turbo 3.x pub has 12/16-bit hooks), range_limit +0x124, dither_matrix[output_scanline(+0x78) & 3] (DAT_00b5e394), 4-byte alignment packing */ void ycc_rgb565D_convert(int param_1,uint *param_2,int param_3) { byte bVar1; byte bVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; uint uVar8; int in_ECX; uint uVar9; uint uVar10; int *in_EDX; uint uVar11; uint uVar12; byte *pbVar13; uint uVar14; byte *pbVar15; uint uVar16; uint local_38; uint local_1c; uint *local_18; byte *local_14; byte *local_10; byte *local_c; iVar3 = *(int *)(in_ECX + 0x1b4); local_1c = *(uint *)(in_ECX + 0x5c); iVar4 = *(int *)(in_ECX + 0x124); iVar5 = *(int *)(iVar3 + 0x10); iVar6 = *(int *)(iVar3 + 0x14); iVar7 = *(int *)(iVar3 + 0x18); iVar3 = *(int *)(iVar3 + 0x1c); param_3 = param_3 + -1; uVar8 = *(uint *)(&DAT_00b5e394 + (*(uint *)(in_ECX + 0x78) & 3) * 4); if (-1 < param_3) { param_1 = param_1 * 4; do { local_c = *(byte **)(param_1 + *in_EDX); local_10 = *(byte **)(param_1 + in_EDX[1]); local_14 = *(byte **)(param_1 + in_EDX[2]); param_1 = param_1 + 4; local_18 = (uint *)*param_2; param_2 = param_2 + 1; if (((uint)local_18 & 3) != 0) { uVar9 = (uint)*local_c; local_c = local_c + 1; bVar1 = *local_14; local_14 = local_14 + 1; bVar2 = *local_10; local_10 = local_10 + 1; *(ushort *)local_18 = ((ushort)(*(byte *)(((int)uVar8 >> 1 & 0x7fU) + (*(int *)((uint)bVar1 * 4 + iVar7) + *(int *)((uint)bVar2 * 4 + iVar3) >> 0x10) + uVar9 + iVar4) & 0xfc ) | (*(byte *)(*(int *)((uint)bVar1 * 4 + iVar5) + (uVar8 & 0xff) + uVar9 + iVar4) & 0xfff8 ) << 5) << 3 | (ushort)(*(byte *)(*(int *)((uint)bVar2 * 4 + iVar6) + (uVar8 & 0xff) + uVar9 + iVar4) >> 3); local_18 = (uint *)((int)local_18 + 2); local_1c = local_1c - 1; } local_38 = local_1c >> 1; if (local_38 != 0) { do { uVar9 = (uint)*local_c; bVar1 = *local_14; pbVar15 = local_14 + 1; bVar2 = *local_10; pbVar13 = local_10 + 1; uVar14 = uVar8 & 0xff; uVar10 = (int)uVar8 >> 1; uVar11 = (int)uVar8 >> 8; uVar12 = uVar11 & 0xffffff | uVar8 << 0x18; uVar16 = (uint)local_c[1]; local_c = local_c + 2; local_10 = local_10 + 2; local_14 = local_14 + 2; uVar8 = (int)uVar12 >> 8 & 0xffffffU | uVar11 << 0x18; *local_18 = (((*(byte *)(*(int *)((uint)*pbVar15 * 4 + iVar5) + (uVar11 & 0xff) + uVar16 + iVar4) & 0xfffffff8) << 5 | *(byte *)(((int)uVar12 >> 1 & 0x7fU) + (*(int *)((uint)*pbVar15 * 4 + iVar7) + *(int *)((uint)*pbVar13 * 4 + iVar3) >> 0x10) + uVar16 + iVar4) & 0xfc) << 3 | (uint)(*(byte *)(*(int *)((uint)*pbVar13 * 4 + iVar6) + (uVar11 & 0xff) + uVar16 + iVar4) >> 3)) << 0x10 | ((*(byte *)(*(int *)((uint)bVar1 * 4 + iVar5) + uVar14 + uVar9 + iVar4) & 0xf8 ) << 5 | *(byte *)((uVar10 & 0x7f) + (*(int *)((uint)bVar1 * 4 + iVar7) + *(int *)((uint)bVar2 * 4 + iVar3) >> 0x10) + uVar9 + iVar4) & 0xfc) << 3 | (uint)(*(byte *)(*(int *)((uint)bVar2 * 4 + iVar6) + uVar14 + uVar9 + iVar4) >> 3); local_18 = local_18 + 1; local_38 = local_38 - 1; } while (local_38 != 0); } if ((local_1c & 1) != 0) { uVar9 = (uint)*local_c; *(ushort *)local_18 = ((ushort)(*(byte *)(((int)uVar8 >> 1 & 0x7fU) + (*(int *)((uint)*local_14 * 4 + iVar7) + *(int *)((uint)*local_10 * 4 + iVar3) >> 0x10) + uVar9 + iVar4) & 0xfc) | (*(byte *)(*(int *)((uint)*local_14 * 4 + iVar5) + (uVar8 & 0xff) + uVar9 + iVar4) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)(*(int *)((uint)*local_10 * 4 + iVar6) + (uVar8 & 0xff) + uVar9 + iVar4) >> 3); } param_3 = param_3 + -1; } while (-1 < param_3); } return; } //@@ 00ac92c0 FUN_00ac92c0 void FUN_00ac92c0(int param_1,uint *param_2,int param_3) { byte *pbVar1; byte *pbVar2; byte bVar3; byte bVar4; byte bVar5; byte *pbVar6; int in_ECX; int *in_EDX; uint uVar7; byte *pbVar8; byte *pbVar9; uint local_14; uint local_10; uint *local_c; byte *local_8; uVar7 = *(uint *)(in_ECX + 0x5c); param_3 = param_3 + -1; if (-1 < param_3) { param_1 = param_1 * 4; local_10 = uVar7; do { pbVar8 = *(byte **)(param_1 + *in_EDX); local_8 = *(byte **)(param_1 + in_EDX[1]); pbVar6 = *(byte **)(param_1 + in_EDX[2]); param_1 = param_1 + 4; local_c = (uint *)*param_2; if (((uint)local_c & 3) != 0) { bVar3 = *local_8; local_8 = local_8 + 1; bVar4 = *pbVar8; pbVar8 = pbVar8 + 1; bVar5 = *pbVar6; pbVar6 = pbVar6 + 1; *(ushort *)local_c = ((bVar4 & 0xfff8) << 5 | (ushort)(bVar3 & 0xfc)) << 3 | (ushort)(bVar5 >> 3); local_c = (uint *)((int)local_c + 2); uVar7 = local_10 - 1; local_10 = uVar7; } local_14 = uVar7 >> 1; if (local_14 != 0) { do { bVar3 = *local_8; pbVar9 = local_8 + 1; bVar4 = *pbVar8; bVar5 = *pbVar6; pbVar1 = pbVar8 + 1; pbVar8 = pbVar8 + 2; local_8 = local_8 + 2; pbVar2 = pbVar6 + 1; pbVar6 = pbVar6 + 2; *local_c = (((*pbVar1 & 0xfffffff8) << 5 | *pbVar9 & 0xfc) << 3 | (uint)(*pbVar2 >> 3)) << 0x10 | ((bVar4 & 0xf8) << 5 | bVar3 & 0xfc) << 3 | (uint)(bVar5 >> 3); local_c = local_c + 1; local_14 = local_14 - 1; } while (local_14 != 0); uVar7 = local_10; } if ((uVar7 & 1) != 0) { *(ushort *)local_c = ((*pbVar8 & 0xfff8) << 5 | (ushort)(*local_8 & 0xfc)) << 3 | (ushort)(*pbVar6 >> 3); uVar7 = local_10; } param_3 = param_3 + -1; param_2 = param_2 + 1; } while (-1 < param_3); } return; } //@@ 00ac9440 rgb_rgb565D_convert_le /* DB: libjpeg-turbo jdcol565.c: ECX=cinfo (range_limit +0x124, output_width +0x5c), EDX=input_buf (3 planes R/G/B), dither_matrix DAT_00b5e394[output_scanline (+0x78) & 3], packs RGB565 pixels two at a time with an unaligned first pixel; only caller 00ac9890 (rgb_rgb565D_convert endian dispatch) */ void rgb_rgb565D_convert_le(int param_1,uint *param_2,int param_3) { byte *pbVar1; byte *pbVar2; byte bVar3; byte bVar4; byte bVar5; int iVar6; uint uVar7; int in_ECX; int *in_EDX; byte *pbVar8; uint uVar9; uint uVar10; uint uVar11; uint uVar12; uint local_20; uint local_1c; uint *local_18; byte *local_10; byte *local_c; byte *local_8; iVar6 = *(int *)(in_ECX + 0x124); param_3 = param_3 + -1; local_1c = *(uint *)(in_ECX + 0x5c); uVar7 = *(uint *)(&DAT_00b5e394 + (*(uint *)(in_ECX + 0x78) & 3) * 4); if (-1 < param_3) { param_1 = param_1 * 4; do { local_10 = *(byte **)(param_1 + *in_EDX); local_c = *(byte **)(param_1 + in_EDX[1]); local_8 = *(byte **)(param_1 + in_EDX[2]); param_1 = param_1 + 4; local_18 = (uint *)*param_2; param_2 = param_2 + 1; if (((uint)local_18 & 3) != 0) { bVar3 = *local_10; local_10 = local_10 + 1; bVar4 = *local_c; local_c = local_c + 1; bVar5 = *local_8; local_8 = local_8 + 1; *(ushort *)local_18 = ((ushort)(*(byte *)((uint)bVar4 + ((int)uVar7 >> 1 & 0x7fU) + iVar6) & 0xfc) | (*(byte *)((CONCAT11(bVar5,bVar3) & 0xff) + (uVar7 & 0xff) + iVar6) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)((uint)bVar5 + (uVar7 & 0xff) + iVar6) >> 3); local_18 = (uint *)((int)local_18 + 2); local_1c = local_1c - 1; } local_20 = local_1c >> 1; if (local_20 != 0) { do { bVar3 = *local_10; pbVar8 = local_10 + 1; uVar12 = uVar7 & 0xff; uVar9 = (int)uVar7 >> 1; pbVar1 = local_c + 1; bVar4 = *local_c; pbVar2 = local_8 + 1; bVar5 = *local_8; uVar10 = (int)uVar7 >> 8; uVar11 = uVar10 & 0xffffff | uVar7 << 0x18; local_10 = local_10 + 2; local_c = local_c + 2; local_8 = local_8 + 2; uVar7 = (int)uVar11 >> 8 & 0xffffffU | uVar10 << 0x18; *local_18 = (((*(byte *)((uint)*pbVar8 + (uVar10 & 0xff) + iVar6) & 0xfffffff8) << 5 | *(byte *)((uint)*pbVar1 + ((int)uVar11 >> 1 & 0x7fU) + iVar6) & 0xfc) << 3 | (uint)(*(byte *)((uint)*pbVar2 + (uVar10 & 0xff) + iVar6) >> 3)) << 0x10 | ((*(byte *)(bVar3 + uVar12 + iVar6) & 0xf8) << 5 | *(byte *)((uint)bVar4 + (uVar9 & 0x7f) + iVar6) & 0xfc) << 3 | (uint)(*(byte *)(bVar5 + uVar12 + iVar6) >> 3); local_18 = local_18 + 1; local_20 = local_20 - 1; } while (local_20 != 0); } if ((local_1c & 1) != 0) { *(ushort *)local_18 = ((ushort)(*(byte *)((uint)*local_c + ((int)uVar7 >> 1 & 0x7fU) + iVar6) & 0xfc) | (*(byte *)((uint)*local_10 + (uVar7 & 0xff) + iVar6) & 0xfff8) << 5) << 3 | (ushort)(*(byte *)((uint)*local_8 + (uVar7 & 0xff) + iVar6) >> 3); } param_3 = param_3 + -1; } while (-1 < param_3); } return; } //@@ 00ac96a0 FUN_00ac96a0 void FUN_00ac96a0(int param_1,uint *param_2,int param_3) { byte *pbVar1; byte bVar2; byte bVar3; int iVar4; uint uVar5; int in_ECX; int *in_EDX; uint uVar6; byte *pbVar7; uint local_14; uint local_c; uint *local_8; param_3 = param_3 + -1; uVar6 = *(uint *)(in_ECX + 0x5c); iVar4 = *(int *)(in_ECX + 0x124); uVar5 = *(uint *)(&DAT_00b5e394 + (*(uint *)(in_ECX + 0x78) & 3) * 4); if (-1 < param_3) { param_1 = param_1 * 4; local_c = uVar6; do { pbVar7 = *(byte **)(param_1 + *in_EDX); param_1 = param_1 + 4; local_8 = (uint *)*param_2; if (((uint)local_8 & 3) != 0) { bVar2 = *pbVar7; pbVar7 = pbVar7 + 1; bVar2 = *(byte *)((uVar5 & 0xff) + (uint)bVar2 + iVar4); *(ushort *)local_8 = ((bVar2 & 0xfff8) << 5 | bVar2 & 0xfc) << 3 | (ushort)(bVar2 >> 3); local_8 = (uint *)((int)local_8 + 2); uVar6 = local_c - 1; local_c = uVar6; } local_14 = uVar6 >> 1; if (local_14 != 0) { do { bVar2 = *(byte *)((uVar5 & 0xff) + (uint)*pbVar7 + iVar4); pbVar1 = pbVar7 + 1; pbVar7 = pbVar7 + 2; uVar6 = (int)uVar5 >> 8; bVar3 = *(byte *)((uVar6 & 0xff) + (uint)*pbVar1 + iVar4); uVar5 = (int)(uVar6 & 0xffffff | uVar5 << 0x18) >> 8 & 0xffffffU | uVar6 << 0x18; *local_8 = (((bVar3 & 0xfffffff8) << 5 | bVar3 & 0xfc) << 3 | (uint)(bVar3 >> 3)) << 0x10 | ((bVar2 & 0xf8) << 5 | bVar2 & 0xfc) << 3 | (uint)(bVar2 >> 3); local_8 = local_8 + 1; local_14 = local_14 - 1; } while (local_14 != 0); uVar6 = local_c; } if ((uVar6 & 1) != 0) { bVar2 = *(byte *)((uint)*pbVar7 + (uVar5 & 0xff) + iVar4); *(ushort *)local_8 = ((bVar2 & 0xfff8) << 5 | bVar2 & 0xfc) << 3 | (ushort)(bVar2 >> 3); uVar6 = local_c; } param_3 = param_3 + -1; param_2 = param_2 + 1; } while (-1 < param_3); } return; } //@@ 00ac9830 FUN_00ac9830 void FUN_00ac9830(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { ycc_rgb565_convert_le(param_3,param_4,param_5); return; } //@@ 00ac9850 FUN_00ac9850 void FUN_00ac9850(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { ycc_rgb565D_convert(param_3,param_4,param_5); return; } //@@ 00ac9870 FUN_00ac9870 void FUN_00ac9870(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { FUN_00ac92c0(param_3,param_4,param_5); return; } //@@ 00ac9890 FUN_00ac9890 void FUN_00ac9890(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { rgb_rgb565D_convert_le(param_3,param_4,param_5); return; } //@@ 00ac98b0 FUN_00ac98b0 void FUN_00ac98b0(int param_1,int *param_2,int param_3,uint *param_4,int param_5) { byte bVar1; byte bVar2; byte *pbVar3; uint uVar4; uint *puVar5; int local_10; uint local_8; local_10 = param_5 + -1; local_8 = *(uint *)(param_1 + 0x5c); if (-1 < local_10) { param_3 = param_3 * 4; do { pbVar3 = *(byte **)(param_3 + *param_2); param_3 = param_3 + 4; puVar5 = (uint *)*param_4; param_4 = param_4 + 1; if (((uint)puVar5 & 3) != 0) { bVar1 = *pbVar3; pbVar3 = pbVar3 + 1; *(ushort *)puVar5 = ((bVar1 & 0xfff8) << 5 | bVar1 & 0xfc) << 3 | (ushort)(bVar1 >> 3); puVar5 = (uint *)((int)puVar5 + 2); local_8 = local_8 - 1; } for (uVar4 = local_8 >> 1; uVar4 != 0; uVar4 = uVar4 - 1) { bVar1 = *pbVar3; bVar2 = pbVar3[1]; pbVar3 = pbVar3 + 2; *puVar5 = (((bVar2 & 0xfffffff8) << 5 | bVar2 & 0xfc) << 3 | (uint)(bVar2 >> 3)) << 0x10 | ((bVar1 & 0xf8) << 5 | bVar1 & 0xfc) << 3 | (uint)(bVar1 >> 3); puVar5 = puVar5 + 1; } if ((local_8 & 1) != 0) { bVar1 = *pbVar3; *(ushort *)puVar5 = ((bVar1 & 0xfff8) << 5 | bVar1 & 0xfc) << 3 | (ushort)(bVar1 >> 3); } local_10 = local_10 + -1; } while (-1 < local_10); } return; } //@@ 00ac99d0 FUN_00ac99d0 void FUN_00ac99d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { FUN_00ac96a0(param_3,param_4,param_5); return; } //@@ 00ac99f0 jinit_color_deconverter /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: libjpeg(-turbo): ECX cinfo: precision check, allocates the deconverter into cinfo[0x6d] (start_pass = no-op guard_check_icall ICF), switch on jpeg_color_space (cinfo[10]) validating num_components (1 / 3 / 4, JERR_BAD_J_COLORSPACE 0xb), builds the YCC tables (SIMD); called from libjpeg_jinit_master_decompress */ void jinit_color_deconverter(void) { undefined1 auVar1 [16]; undefined1 auVar2 [16]; undefined1 auVar3 [16]; undefined4 *puVar4; int iVar5; code *pcVar6; int *in_ECX; int *piVar7; int iVar8; int iVar9; undefined1 auVar10 [16]; undefined1 auVar11 [16]; undefined1 auVar12 [16]; undefined1 auVar13 [12]; undefined1 auVar14 [12]; undefined1 auVar15 [16]; undefined1 auVar16 [16]; undefined1 auVar17 [16]; iVar8 = in_ECX[0x30]; if (*(char *)(in_ECX[100] + 9) == '\0') { if (iVar8 != 8) goto LAB_00ac9a16; } else if ((8 < iVar8) || (iVar8 < 2)) { LAB_00ac9a16: *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } puVar4 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x6d] = (int)puVar4; *puVar4 = guard_check_icall; switch(in_ECX[10]) { case 1: if (in_ECX[9] != 1) { LAB_00ac9a80: *(undefined4 *)(*in_ECX + 0x14) = 0xb; (**(code **)*in_ECX)(); } break; case 2: case 3: if (in_ECX[9] != 3) goto LAB_00ac9a80; break; case 4: case 5: if (in_ECX[9] != 4) goto LAB_00ac9a80; break; default: if (in_ECX[9] < 1) goto LAB_00ac9a80; } iVar8 = in_ECX[0xb]; switch(iVar8) { case 1: if ((*(char *)(in_ECX[100] + 9) != '\0') && (in_ECX[10] != iVar8)) { *(undefined4 *)(*in_ECX + 0x14) = 0x1c; (**(code **)*in_ECX)(); } iVar8 = in_ECX[10]; in_ECX[0x19] = 1; if ((iVar8 == 1) || (iVar8 == 3)) { iVar8 = 1; puVar4[1] = FUN_00ac8360; if (1 < in_ECX[9]) { iVar5 = 0x58; do { iVar8 = iVar8 + 1; *(undefined1 *)(iVar5 + 0x34 + in_ECX[0x31]) = 0; iVar5 = iVar5 + 0x58; } while (iVar8 < in_ECX[9]); } goto LAB_00ac9ddd; } if (iVar8 == 2) { puVar4[1] = &LAB_00ac80c0; iVar8 = in_ECX[0x6d]; iVar5 = (**(code **)in_ECX[1])(); *(int *)(iVar8 + 0x20) = iVar5; auVar3 = _DAT_00baba00; auVar2 = _DAT_00bab9d0; auVar1 = _DAT_00bab970; iVar8 = 0; piVar7 = (int *)(iVar5 + 0x800); if (__isa_available < 2) { iVar9 = 0; iVar5 = 0x8000; do { *piVar7 = iVar5; piVar7[-0x200] = iVar9; iVar5 = iVar5 + 0x1d2f; piVar7[-0x100] = iVar8; iVar9 = iVar9 + 0x4c8b; iVar8 = iVar8 + 0x9646; piVar7 = piVar7 + 1; } while (iVar5 < 0x1d91d2); } else { do { auVar13._0_8_ = CONCAT44(iVar8 + 1,iVar8); auVar13._8_4_ = iVar8 + 2; auVar15._12_4_ = iVar8 + 3; auVar15._0_12_ = auVar13; iVar5 = iVar8 + 8; auVar10._8_4_ = auVar13._8_4_; auVar10._0_8_ = auVar13._0_8_; auVar10._12_4_ = auVar15._12_4_; auVar10 = pmulld(auVar10,auVar2); *(undefined1 (*) [16])(piVar7 + -0x200) = auVar10; auVar17._12_4_ = auVar15._12_4_; auVar17._0_12_ = auVar13; auVar10 = pmulld(auVar17,auVar3); *(undefined1 (*) [16])(piVar7 + -0x100) = auVar10; auVar10 = pmulld(auVar15,auVar1); *piVar7 = auVar10._0_4_ + 0x8000; piVar7[1] = auVar10._4_4_ + 0x8000; piVar7[2] = auVar10._8_4_ + 0x8000; piVar7[3] = auVar10._12_4_ + 0x8000; auVar14._0_8_ = CONCAT44(iVar8 + 5,iVar8 + 4); auVar14._8_4_ = iVar8 + 6; auVar16._12_4_ = iVar8 + 7; auVar16._0_12_ = auVar14; auVar11._8_4_ = auVar14._8_4_; auVar11._0_8_ = auVar14._0_8_; auVar11._12_4_ = auVar16._12_4_; auVar10 = pmulld(auVar11,auVar2); *(undefined1 (*) [16])(piVar7 + -0x1fc) = auVar10; auVar12._12_4_ = auVar16._12_4_; auVar12._0_12_ = auVar14; auVar17 = pmulld(auVar16,auVar1); auVar10 = pmulld(auVar12,auVar3); *(undefined1 (*) [16])(piVar7 + -0xfc) = auVar10; piVar7[4] = auVar17._0_4_ + 0x8000; piVar7[5] = auVar17._4_4_ + 0x8000; piVar7[6] = auVar17._8_4_ + 0x8000; piVar7[7] = auVar17._12_4_ + 0x8000; piVar7 = piVar7 + 8; iVar8 = iVar5; } while (iVar5 < 0x100); } goto LAB_00ac9ddd; } break; case 2: case 6: case 7: case 8: case 9: case 10: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: if ((*(char *)(in_ECX[100] + 9) != '\0') && (in_ECX[10] != 2)) { *(undefined4 *)(*in_ECX + 0x14) = 0x1c; (**(code **)*in_ECX)(); } iVar8 = in_ECX[0xb]; iVar5 = in_ECX[10]; iVar9 = *(int *)(&DAT_00b5e2a8 + iVar8 * 4); in_ECX[0x19] = iVar9; if (iVar5 == 3) { puVar4[1] = FUN_00ac7890; FUN_00ac77c0(); goto LAB_00ac9ddd; } if (iVar5 == 1) { puVar4[1] = FUN_00ac8390; goto LAB_00ac9ddd; } if (iVar5 == 2) { if ((((*(int *)(&DAT_00b5e148 + iVar8 * 4) != 0) || (*(int *)(&DAT_00b5e350 + iVar8 * 4) != 1) ) || (*(int *)(&DAT_00b5e1a8 + iVar8 * 4) != 2)) || (pcVar6 = FUN_00ac8180, iVar9 != 3)) { pcVar6 = FUN_00ac86a0; } puVar4[1] = pcVar6; goto LAB_00ac9ddd; } break; default: if (iVar8 == in_ECX[10]) { in_ECX[0x19] = in_ECX[9]; LAB_00ac9df8: puVar4[1] = FUN_00ac8180; goto LAB_00ac9ddd; } break; case 4: if ((*(char *)(in_ECX[100] + 9) != '\0') && (in_ECX[10] != iVar8)) { *(undefined4 *)(*in_ECX + 0x14) = 0x1c; (**(code **)*in_ECX)(); } in_ECX[0x19] = 4; if (in_ECX[10] == 5) { puVar4[1] = &LAB_00ac8b40; FUN_00ac77c0(); goto LAB_00ac9ddd; } if (in_ECX[10] == 4) goto LAB_00ac9df8; break; case 0x10: if (*(char *)(in_ECX[100] + 9) != '\0') { *(undefined4 *)(*in_ECX + 0x14) = 0x1c; (**(code **)*in_ECX)(); } iVar8 = in_ECX[10]; in_ECX[0x19] = 3; if (in_ECX[0x13] == 0) { if (iVar8 == 3) { puVar4[1] = FUN_00ac9830; FUN_00ac77c0(); goto LAB_00ac9ddd; } if (iVar8 == 1) { puVar4[1] = FUN_00ac98b0; goto LAB_00ac9ddd; } if (iVar8 == 2) { puVar4[1] = FUN_00ac9870; goto LAB_00ac9ddd; } } else { if (iVar8 == 3) { puVar4[1] = FUN_00ac9850; FUN_00ac77c0(); goto LAB_00ac9ddd; } if (iVar8 == 1) { puVar4[1] = FUN_00ac99d0; goto LAB_00ac9ddd; } if (iVar8 == 2) { puVar4[1] = FUN_00ac9890; goto LAB_00ac9ddd; } } } *(undefined4 *)(*in_ECX + 0x14) = 0x1c; (**(code **)*in_ECX)(); LAB_00ac9ddd: if (*(char *)((int)in_ECX + 0x4a) == '\0') { in_ECX[0x1a] = in_ECX[0x19]; return; } in_ECX[0x1a] = 1; return; } //@@ 00ac9e50 FUN_00ac9e50 void FUN_00ac9e50(void) { int iVar1; int in_ECX; iVar1 = *(int *)(in_ECX + 0x198); if (1 < *(int *)(in_ECX + 0x128)) { *(undefined4 *)(iVar1 + 0x34) = 1; *(undefined4 *)(iVar1 + 0x28) = 0; *(undefined4 *)(iVar1 + 0x30) = 0; return; } if (*(uint *)(in_ECX + 0x80) < *(int *)(in_ECX + 0x120) - 1U) { *(undefined4 *)(iVar1 + 0x34) = *(undefined4 *)(*(int *)(in_ECX + 300) + 0xc); *(undefined4 *)(iVar1 + 0x28) = 0; *(undefined4 *)(iVar1 + 0x30) = 0; return; } *(undefined4 *)(iVar1 + 0x34) = *(undefined4 *)(*(int *)(in_ECX + 300) + 0x4c); *(undefined4 *)(iVar1 + 0x28) = 0; *(undefined4 *)(iVar1 + 0x30) = 0; return; } //@@ 00ac9ec0 FUN_00ac9ec0 void FUN_00ac9ec0(int *param_1) { int iVar1; uint uVar2; uint uVar3; iVar1 = param_1[0x66]; (**(code **)param_1[0x6b])(param_1); uVar2 = param_1[0x3f]; uVar3 = param_1[0x4f]; if (uVar2 % uVar3 != 0) { *(undefined4 *)(*param_1 + 0x14) = 0x80; *(int *)(*param_1 + 0x18) = param_1[0x3f]; *(int *)(*param_1 + 0x1c) = param_1[0x4f]; (**(code **)*param_1)(param_1); uVar2 = param_1[0x3f]; uVar3 = param_1[0x4f]; } *(uint *)(iVar1 + 0x2c) = uVar2 / uVar3; param_1[0x20] = 0; FUN_00ac9e50(); return; } //@@ 00ac9f50 FUN_00ac9f50 void FUN_00ac9f50(int param_1) { *(undefined4 *)(param_1 + 0x88) = 0; return; } //@@ 00ac9f70 FUN_00ac9f70 undefined4 FUN_00ac9f70(int param_1,int param_2) { int iVar1; int iVar2; int iVar3; int iVar4; char cVar5; int iVar6; int iVar7; uint uVar8; int iVar9; int iVar10; int *local_20; int local_1c; int local_14; iVar1 = *(int *)(param_1 + 0x198); iVar2 = *(int *)(param_1 + 0x1ac); iVar3 = *(int *)(param_1 + 0x120); uVar8 = *(uint *)(iVar1 + 0x30); if (uVar8 < *(uint *)(iVar1 + 0x34)) { do { if ((*(int *)(param_1 + 0xfc) != 0) && (*(int *)(iVar1 + 0x2c) == 0)) { iVar7 = *(int *)(param_1 + 0x198); cVar5 = (**(code **)(*(int *)(param_1 + 0x1a8) + 0xc))(param_1); if (cVar5 == '\0') { return 0; } (*(code *)**(undefined4 **)(param_1 + 0x1ac))(param_1); *(uint *)(iVar7 + 0x2c) = *(uint *)(param_1 + 0xfc) / *(uint *)(param_1 + 0x13c); } iVar7 = *(int *)(iVar1 + 0x28); iVar6 = (**(code **)(*(int *)(param_1 + 0x1a8) + 8)) (param_1,iVar1 + 0x38,uVar8,iVar7,*(int *)(param_1 + 0x13c) - iVar7); if (iVar6 != *(int *)(param_1 + 0x13c) - iVar7) { *(int *)(iVar1 + 0x28) = *(int *)(iVar1 + 0x28) + iVar6; *(uint *)(iVar1 + 0x30) = uVar8; return 0; } if (*(int *)(param_1 + 0xfc) != 0) { *(int *)(iVar1 + 0x2c) = *(int *)(iVar1 + 0x2c) + -1; } uVar8 = uVar8 + 1; *(undefined4 *)(iVar1 + 0x28) = 0; } while (uVar8 < *(uint *)(iVar1 + 0x34)); } local_1c = 0; if (*(int *)(param_1 + 0x128) < 1) { iVar7 = *(int *)(param_1 + 0x80); } else { local_20 = (int *)(param_1 + 300); do { iVar6 = *local_20; iVar9 = 0; iVar4 = *(int *)(iVar6 + 4); local_14 = *(int *)(iVar6 + 0xc) * 4 + -4; while( true ) { iVar7 = *(int *)(param_1 + 0x80); if (iVar7 == iVar3 + -1) { iVar10 = *(int *)(iVar6 + 0x4c); } else { iVar10 = *(int *)(iVar6 + 0xc); } if (iVar10 <= iVar9) break; iVar10 = iVar9 * 4; iVar7 = *(int *)(iVar1 + 0x60 + iVar4 * 4); (**(code **)(iVar2 + 0x54 + iVar4 * 4)) (param_1,iVar4,*(undefined4 *)(*(int *)(iVar1 + 0x38 + iVar4 * 4) + iVar10), *(undefined4 *)(local_14 + iVar7),*(undefined4 *)(iVar7 + iVar10), *(undefined4 *)(iVar6 + 0x1c)); (**(code **)(iVar2 + 0x7c)) (param_1,*(undefined4 *)(iVar10 + *(int *)(iVar1 + 0x60 + iVar4 * 4)), *(undefined4 *)(*(int *)(param_2 + iVar4 * 4) + iVar10), *(undefined4 *)(iVar6 + 0x1c)); iVar9 = iVar9 + 1; local_14 = iVar10; } local_1c = local_1c + 1; local_20 = local_20 + 1; } while (local_1c < *(int *)(param_1 + 0x128)); } *(uint *)(param_1 + 0x80) = iVar7 + 1U; if (iVar7 + 1U < *(uint *)(param_1 + 0x120)) { FUN_00ac9e50(); return 3; } (**(code **)(*(int *)(param_1 + 0x1a0) + 0xc))(param_1); return 4; } //@@ 00aca170 consume_data /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jdcoefct.c: stored as coef->pub.consume_data (mov edx,0xaca170 at aca6eb in jinit_d_coef_controller); access_virt_barray (mem vtable +0x1c) for each cur_comp_info (+300, comps_in_scan +0x128), then decode_mcu loop over MCU rows/cols */ undefined4 consume_data(int param_1) { int iVar1; int iVar2; char cVar3; int iVar4; int iVar5; undefined4 uVar6; uint uVar7; int iVar8; int iVar9; int iVar10; int *local_34; int local_30; int local_28; int *local_24; int local_20; int local_1c; int local_18 [4]; uint local_8; local_8 = __security_cookie ^ (uint)(local_18 + 5); local_20 = 0; iVar10 = *(int *)(param_1 + 0x128); local_1c = *(int *)(param_1 + 0x198); if (0 < iVar10) { local_24 = (int *)(param_1 + 300); do { iVar10 = *(int *)(*local_24 + 4); iVar4 = *(int *)(*local_24 + 0xc); iVar4 = (**(code **)(*(int *)(param_1 + 4) + 0x1c)) (param_1,*(undefined4 *)(local_1c + 0x88 + iVar10 * 4), *(int *)(param_1 + 0x80) * iVar4,iVar4,1); local_20 = local_20 + 1; local_18[iVar10] = iVar4; local_24 = local_24 + 1; iVar10 = *(int *)(param_1 + 0x128); } while (local_20 < iVar10); local_1c = *(int *)(param_1 + 0x198); } iVar4 = *(int *)(param_1 + 0x1ac); uVar7 = *(uint *)(local_1c + 0x30); iVar1 = *(int *)(param_1 + 0x120); if (uVar7 < *(uint *)(local_1c + 0x34)) { do { if ((*(int *)(param_1 + 0xfc) != 0) && (*(int *)(local_1c + 0x2c) == 0)) { iVar10 = *(int *)(param_1 + 0x198); cVar3 = (**(code **)(*(int *)(param_1 + 0x1a8) + 0xc))(param_1); if (cVar3 == '\0') { return 0; } (*(code *)**(undefined4 **)(param_1 + 0x1ac))(param_1); *(uint *)(iVar10 + 0x2c) = *(uint *)(param_1 + 0xfc) / *(uint *)(param_1 + 0x13c); } iVar10 = *(int *)(local_1c + 0x28); iVar5 = (**(code **)(*(int *)(param_1 + 0x1a8) + 8)) (param_1,local_1c + 0x38,uVar7,iVar10,*(int *)(param_1 + 0x13c) - iVar10); if (iVar5 != *(int *)(param_1 + 0x13c) - iVar10) { *(int *)(local_1c + 0x28) = *(int *)(local_1c + 0x28) + iVar5; *(uint *)(local_1c + 0x30) = uVar7; return 0; } if (*(int *)(param_1 + 0xfc) != 0) { *(int *)(local_1c + 0x2c) = *(int *)(local_1c + 0x2c) + -1; } uVar7 = uVar7 + 1; *(undefined4 *)(local_1c + 0x28) = 0; } while (uVar7 < *(uint *)(local_1c + 0x34)); iVar10 = *(int *)(param_1 + 0x128); } local_30 = 0; if (iVar10 < 1) { iVar5 = *(int *)(param_1 + 0x80); } else { local_34 = (int *)(param_1 + 300); do { iVar10 = *local_34; iVar8 = 0; iVar2 = *(int *)(iVar10 + 4); local_28 = *(int *)(iVar10 + 0xc) * 4 + -4; while( true ) { iVar5 = *(int *)(param_1 + 0x80); if (iVar5 == iVar1 + -1) { iVar9 = *(int *)(iVar10 + 0x4c); } else { iVar9 = *(int *)(iVar10 + 0xc); } if (iVar9 <= iVar8) break; iVar9 = iVar8 * 4; iVar5 = *(int *)(local_1c + 0x60 + iVar2 * 4); (**(code **)(iVar4 + 0x54 + iVar2 * 4)) (param_1,iVar2,*(undefined4 *)(*(int *)(local_1c + 0x38 + iVar2 * 4) + iVar9), *(undefined4 *)(local_28 + iVar5),*(undefined4 *)(iVar5 + iVar9), *(undefined4 *)(iVar10 + 0x1c)); (**(code **)(iVar4 + 0x7c)) (param_1,*(undefined4 *)(*(int *)(local_1c + 0x60 + iVar2 * 4) + iVar9), *(undefined4 *)(iVar9 + local_18[iVar2]),*(undefined4 *)(iVar10 + 0x1c)); iVar8 = iVar8 + 1; local_28 = iVar9; } local_30 = local_30 + 1; iVar10 = *(int *)(param_1 + 0x128); local_34 = local_34 + 1; } while (local_30 < iVar10); } uVar7 = iVar5 + 1; *(uint *)(param_1 + 0x80) = uVar7; if (*(uint *)(param_1 + 0x120) <= uVar7) { (**(code **)(*(int *)(param_1 + 0x1a0) + 0xc))(param_1); return 4; } iVar4 = *(int *)(param_1 + 0x198); if (iVar10 < 2) { if (uVar7 < *(uint *)(param_1 + 0x120) - 1) { uVar6 = *(undefined4 *)(*(int *)(param_1 + 300) + 0xc); } else { uVar6 = *(undefined4 *)(*(int *)(param_1 + 300) + 0x4c); } } else { uVar6 = 1; } *(undefined4 *)(iVar4 + 0x34) = uVar6; *(undefined4 *)(iVar4 + 0x28) = 0; *(undefined4 *)(iVar4 + 0x30) = 0; return 3; } //@@ 00aca440 FUN_00aca440 int FUN_00aca440(int param_1,int param_2) { int iVar1; int iVar2; int iVar3; uint uVar4; uint *puVar5; undefined4 *local_c; int local_8; iVar1 = *(int *)(param_1 + 0x120); iVar3 = *(int *)(param_1 + 0x198); while ((*(int *)(param_1 + 0x7c) < *(int *)(param_1 + 0x84) || ((*(int *)(param_1 + 0x7c) == *(int *)(param_1 + 0x84) && (*(uint *)(param_1 + 0x80) <= *(uint *)(param_1 + 0x88)))))) { iVar2 = (*(code *)**(undefined4 **)(param_1 + 0x1a0))(param_1); if (iVar2 == 0) { return 0; } } local_8 = 0; if (0 < *(int *)(param_1 + 0x24)) { puVar5 = (uint *)(*(int *)(param_1 + 0xc4) + 0xc); local_c = (undefined4 *)(iVar3 + 0x88); do { iVar3 = (**(code **)(*(int *)(param_1 + 4) + 0x1c)) (param_1,*local_c,*(int *)(param_1 + 0x88) * *puVar5,*puVar5,0); if (*(uint *)(param_1 + 0x88) < iVar1 - 1U) { uVar4 = *puVar5; } else { uVar4 = puVar5[5] % *puVar5; if (puVar5[5] % *puVar5 == 0) { uVar4 = *puVar5; } } iVar2 = 0; if (0 < (int)uVar4) { do { memcpy(*(void **)(*(int *)(param_2 + local_8 * 4) + iVar2 * 4), *(void **)(iVar3 + iVar2 * 4),puVar5[4]); iVar2 = iVar2 + 1; } while (iVar2 < (int)uVar4); } puVar5 = puVar5 + 0x16; local_c = local_c + 1; local_8 = local_8 + 1; } while (local_8 < *(int *)(param_1 + 0x24)); } *(int *)(param_1 + 0x88) = *(int *)(param_1 + 0x88) + 1; return 4 - (uint)(*(uint *)(param_1 + 0x88) < *(uint *)(param_1 + 0x120)); } //@@ 00aca570 jinit_d_diff_controller /* DB: libjpeg: the lossless branch of jinit_master_decompress, precision 2..8; the real coef controller is 00ac71d0 libjpeg_jinit_d_coef_controller jinit_d_coef_controller) */ void jinit_d_diff_controller(void) { undefined4 *puVar1; undefined4 uVar2; int *in_ECX; int iVar3; char in_DL; int local_14; undefined4 *local_10; undefined4 *local_c; if ((8 < in_ECX[0x30]) || (in_ECX[0x30] < 2)) { *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); } puVar1 = (undefined4 *)(**(code **)in_ECX[1])(); in_ECX[0x66] = (int)puVar1; local_14 = 0; *puVar1 = FUN_00ac9ec0; puVar1[2] = FUN_00ac9f50; iVar3 = in_ECX[9]; if (0 < iVar3) { local_c = puVar1 + 0x18; do { uVar2 = (**(code **)(in_ECX[1] + 8))(); local_c[-10] = uVar2; uVar2 = (**(code **)(in_ECX[1] + 8))(); *local_c = uVar2; local_c = local_c + 1; local_14 = local_14 + 1; iVar3 = in_ECX[9]; } while (local_14 < iVar3); } if (in_DL == '\0') { puVar1[0x22] = 0; puVar1[1] = Weapon::GetFocusEntity; puVar1[3] = FUN_00ac9f70; return; } local_14 = 0; if (0 < iVar3) { local_10 = puVar1 + 0x22; do { uVar2 = (**(code **)(in_ECX[1] + 0x10))(); *local_10 = uVar2; local_10 = local_10 + 1; local_14 = local_14 + 1; } while (local_14 < in_ECX[9]); } puVar1[1] = consume_data; puVar1[3] = FUN_00aca440; return; } //@@ 00aca730 FUN_00aca730 void FUN_00aca730(int *param_1,int param_2) { int iVar1; int iVar2; int iVar3; undefined4 *puVar4; int iVar5; undefined4 uVar6; int iVar7; undefined4 *puVar8; undefined4 *puVar9; int iVar10; undefined4 *puVar11; int *local_c; int local_8; iVar1 = param_1[0x65]; if (param_2 == 0) { if (*(char *)(param_1[0x6c] + 0x10) == '\0') { *(code **)(iVar1 + 4) = FUN_00aca8e0; *(undefined1 *)(iVar1 + 0x38) = 0; *(undefined4 *)(iVar1 + 0x3c) = 0; return; } *(code **)(iVar1 + 4) = process_data_context_main; iVar2 = param_1[0x65]; iVar3 = param_1[0x46]; local_8 = 0; if (0 < param_1[9]) { local_c = (int *)(param_1[0x31] + 0xc); do { iVar7 = (local_c[6] * *local_c) / param_1[0x46]; iVar10 = (iVar3 + 2) * iVar7; puVar4 = *(undefined4 **)(*(int *)(iVar2 + 0x40) + local_8 * 4); puVar8 = *(undefined4 **)(*(int *)(iVar2 + 0x44) + local_8 * 4); iVar5 = *(int *)(iVar2 + 0x10 + local_8 * 4); if (0 < iVar10) { puVar9 = puVar8; do { uVar6 = *(undefined4 *)((iVar5 - (int)puVar8) + (int)puVar9); *puVar9 = uVar6; *(undefined4 *)((int)puVar4 + (-4 - (int)puVar8) + (int)(puVar9 + 1)) = uVar6; iVar10 = iVar10 + -1; puVar9 = puVar9 + 1; } while (iVar10 != 0); } iVar10 = iVar7 * 2; if (0 < iVar10) { puVar9 = puVar8 + iVar7 * iVar3; puVar11 = (undefined4 *)(iVar5 + (iVar3 + -2) * iVar7 * 4); do { *(undefined4 *)((int)puVar8 + (-4 - iVar5) + (int)(puVar11 + 1)) = *(undefined4 *)((int)puVar9 + (iVar5 - (int)puVar8)); *puVar9 = *puVar11; iVar10 = iVar10 + -1; puVar9 = puVar9 + 1; puVar11 = puVar11 + 1; } while (iVar10 != 0); } if (0 < iVar7) { puVar8 = puVar4 + -iVar7; do { *puVar8 = *puVar4; iVar7 = iVar7 + -1; puVar8 = puVar8 + 1; } while (iVar7 != 0); } local_8 = local_8 + 1; local_c = local_c + 0x16; } while (local_8 < param_1[9]); } *(undefined4 *)(iVar1 + 0x48) = 0; *(undefined4 *)(iVar1 + 0x4c) = 0; *(undefined4 *)(iVar1 + 0x54) = 0; *(undefined1 *)(iVar1 + 0x38) = 0; *(undefined4 *)(iVar1 + 0x3c) = 0; return; } if (param_2 == 2) { *(code **)(iVar1 + 4) = FUN_00acabf0; return; } *(undefined4 *)(*param_1 + 0x14) = 3; (**(code **)*param_1)(param_1); return; } //@@ 00aca8e0 FUN_00aca8e0 void FUN_00aca8e0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { int iVar1; uint uVar2; int iVar3; iVar1 = *(int *)(param_1 + 0x194); if (*(char *)(iVar1 + 0x38) == '\0') { iVar3 = (**(code **)(*(int *)(param_1 + 0x198) + 0xc))(param_1,iVar1 + 0x10); if (iVar3 == 0) { return; } *(undefined1 *)(iVar1 + 0x38) = 1; } uVar2 = *(uint *)(param_1 + 0x118); (**(code **)(*(int *)(param_1 + 0x19c) + 4)) (param_1,iVar1 + 0x10,iVar1 + 0x3c,uVar2,param_2,param_3,param_4); if (uVar2 <= *(uint *)(iVar1 + 0x3c)) { *(undefined1 *)(iVar1 + 0x38) = 0; *(undefined4 *)(iVar1 + 0x3c) = 0; } return; } //@@ 00aca950 process_data_context_main /* DB: libjpeg(-turbo) jdmainct.c: main = cinfo+0x194, coef->decompress_data (+0x198 vfunc +0xc), post->post_process_data (+0x19c vfunc +4), context_state +0x4c (0/1/2), rowgroup_ctr +0x3c, rowgroups_avail +0x50, iMCU_row_ctr +0x54; stored by start_pass_main (00aca783) */ void process_data_context_main(int param_1,undefined4 param_2,uint *param_3,uint param_4) { uint *puVar1; int iVar2; int iVar3; int iVar4; uint uVar5; undefined4 *puVar6; uint uVar7; undefined4 *puVar8; int iVar9; undefined4 *puVar10; int *piVar11; undefined4 *puVar12; int *local_14; int local_10; int local_c; int local_8; iVar2 = *(int *)(param_1 + 0x194); if (*(char *)(iVar2 + 0x38) == '\0') { iVar3 = (**(code **)(*(int *)(param_1 + 0x198) + 0xc)) (param_1,*(undefined4 *)(iVar2 + 0x40 + *(int *)(iVar2 + 0x48) * 4)); if (iVar3 == 0) { return; } *(int *)(iVar2 + 0x54) = *(int *)(iVar2 + 0x54) + 1; *(undefined1 *)(iVar2 + 0x38) = 1; } iVar3 = *(int *)(iVar2 + 0x4c); if (iVar3 != 0) { if (iVar3 == 1) goto LAB_00acaab9; if (iVar3 != 2) { return; } (**(code **)(*(int *)(param_1 + 0x19c) + 4)) (param_1,*(undefined4 *)(iVar2 + 0x40 + *(int *)(iVar2 + 0x48) * 4), (uint *)(iVar2 + 0x3c),*(undefined4 *)(iVar2 + 0x50),param_2,param_3,param_4); if (*(uint *)(iVar2 + 0x3c) < *(uint *)(iVar2 + 0x50)) { return; } *(undefined4 *)(iVar2 + 0x4c) = 0; if (param_4 <= *param_3) { return; } } *(undefined4 *)(iVar2 + 0x3c) = 0; *(int *)(iVar2 + 0x50) = *(int *)(param_1 + 0x118) + -1; if (*(int *)(iVar2 + 0x54) == *(int *)(param_1 + 0x120)) { iVar3 = *(int *)(param_1 + 0x194); local_10 = 0; if (0 < *(int *)(param_1 + 0x24)) { piVar11 = (int *)(*(int *)(param_1 + 0xc4) + 0xc); do { uVar7 = piVar11[6] * *piVar11; iVar4 = (int)uVar7 / *(int *)(param_1 + 0x118); uVar5 = (uint)piVar11[9] % uVar7; if ((uint)piVar11[9] % uVar7 == 0) { uVar5 = uVar7; } if (local_10 == 0) { *(int *)(iVar3 + 0x50) = (int)(uVar5 - 1) / iVar4 + 1; } iVar4 = iVar4 * 2; if (0 < iVar4) { puVar8 = (undefined4 *) (*(int *)(*(int *)(iVar3 + 0x40 + *(int *)(iVar3 + 0x48) * 4) + local_10 * 4) + uVar5 * 4); puVar6 = puVar8; do { *puVar6 = puVar8[-1]; iVar4 = iVar4 + -1; puVar6 = puVar6 + 1; } while (iVar4 != 0); } local_10 = local_10 + 1; piVar11 = piVar11 + 0x16; } while (local_10 < *(int *)(param_1 + 0x24)); } } *(undefined4 *)(iVar2 + 0x4c) = 1; LAB_00acaab9: puVar1 = (uint *)(iVar2 + 0x3c); (**(code **)(*(int *)(param_1 + 0x19c) + 4)) (param_1,*(undefined4 *)(iVar2 + 0x40 + *(int *)(iVar2 + 0x48) * 4),puVar1, *(undefined4 *)(iVar2 + 0x50),param_2,param_3,param_4); if (*(uint *)(iVar2 + 0x50) <= *puVar1) { if (*(int *)(iVar2 + 0x54) == 1) { iVar3 = *(int *)(param_1 + 0x194); iVar4 = *(int *)(param_1 + 0x118); local_c = 0; if (0 < *(int *)(param_1 + 0x24)) { local_14 = (int *)(*(int *)(param_1 + 0xc4) + 0xc); do { local_8 = (local_14[6] * *local_14) / *(int *)(param_1 + 0x118); puVar8 = *(undefined4 **)(*(int *)(iVar3 + 0x44) + local_c * 4); if (0 < local_8) { iVar9 = *(int *)(*(int *)(iVar3 + 0x40) + local_c * 4) - (int)puVar8; puVar6 = puVar8 + (iVar4 + 1) * local_8; puVar10 = puVar8 + -local_8; puVar12 = puVar8 + (iVar4 + 2) * local_8; do { local_8 = local_8 + -1; *(undefined4 *)(iVar9 + -4 + (int)(puVar10 + 1)) = *(undefined4 *)(iVar9 + -4 + (int)(puVar6 + 1)); *puVar10 = *puVar6; *(undefined4 *)(iVar9 + -4 + (int)(puVar12 + 1)) = *(undefined4 *)(iVar9 + -4 + (int)(puVar8 + 1)); *puVar12 = *puVar8; puVar8 = puVar8 + 1; puVar6 = puVar6 + 1; puVar10 = puVar10 + 1; puVar12 = puVar12 + 1; } while (local_8 != 0); } local_c = local_c + 1; local_14 = local_14 + 0x16; } while (local_c < *(int *)(param_1 + 0x24)); } } *(uint *)(iVar2 + 0x48) = *(uint *)(iVar2 + 0x48) ^ 1; *(undefined1 *)(iVar2 + 0x38) = 0; *puVar1 = *(int *)(param_1 + 0x118) + 1; iVar3 = *(int *)(param_1 + 0x118); *(undefined4 *)(iVar2 + 0x4c) = 2; *(int *)(iVar2 + 0x50) = iVar3 + 2; } return; } //@@ 00acabf0 FUN_00acabf0 void FUN_00acabf0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { (**(code **)(*(int *)(param_1 + 0x19c) + 4))(param_1,0,0,0,param_2,param_3,param_4); return; } //@@ 00acac20 libjpeg_jinit_d_main_controller /* DB: libjpeg jdmainct.c: allocates the 0x58-byte main controller (cinfo->main = this[0x65], start_pass FUN_00aca730); with upsample->need_context_rows checks min_DCT_v_scaled_size >= 2 (error 0x30) and allocates the funny xbuffer pointer lists (+0x40/+0x44); only caller libjpeg_jinit_master_decompress */ void libjpeg_jinit_d_main_controller(void) { int iVar1; int iVar2; int iVar3; undefined4 uVar4; int *in_ECX; int iVar5; int *piVar6; undefined4 *local_10; int local_c; int local_8; iVar5 = in_ECX[0x30]; if (*(char *)(in_ECX[100] + 9) == '\0') { if (iVar5 == 8) goto LAB_00acac6c; } else if ((iVar5 < 9) && (1 < iVar5)) goto LAB_00acac6c; *(undefined4 *)(*in_ECX + 0x14) = 0x10; *(int *)(*in_ECX + 0x18) = in_ECX[0x30]; (**(code **)*in_ECX)(); LAB_00acac6c: local_10 = (undefined4 *)(**(code **)in_ECX[1])(); memset(local_10 + 1,0,0x54); in_ECX[0x65] = (int)local_10; *local_10 = FUN_00aca730; iVar5 = in_ECX[0x46]; if (*(char *)(in_ECX[0x6c] + 0x10) == '\0') { iVar2 = in_ECX[9]; } else { if (iVar5 < 2) { *(undefined4 *)(*in_ECX + 0x14) = 0x30; (**(code **)*in_ECX)(); iVar5 = in_ECX[0x46]; } iVar1 = in_ECX[0x65]; iVar2 = (**(code **)in_ECX[1])(); local_c = 0; *(int *)(iVar1 + 0x40) = iVar2; *(int *)(iVar1 + 0x44) = iVar2 + in_ECX[9] * 4; iVar2 = in_ECX[9]; if (0 < iVar2) { piVar6 = (int *)(in_ECX[0x31] + 0xc); do { iVar3 = (piVar6[6] * *piVar6) / in_ECX[0x46]; iVar2 = (**(code **)in_ECX[1])(); piVar6 = piVar6 + 0x16; iVar2 = iVar2 + iVar3 * 4; *(int *)(*(int *)(iVar1 + 0x40) + local_c * 4) = iVar2; *(int *)(*(int *)(iVar1 + 0x44) + local_c * 4) = (iVar5 * 4 + 0x10) * iVar3 + iVar2; local_c = local_c + 1; iVar2 = in_ECX[9]; } while (local_c < iVar2); } } local_8 = 0; if (0 < iVar2) { local_10 = local_10 + 4; do { uVar4 = (**(code **)(in_ECX[1] + 8))(); *local_10 = uVar4; local_10 = local_10 + 1; local_8 = local_8 + 1; } while (local_8 < in_ECX[9]); } return; } //@@ 00acae00 jddctmgr_start_pass /* DB: libjpeg-turbo jddctmgr.c start_pass: stored as idct->pub.start_pass (mov [eax],0xacae00 at 0xab6124), switch on DCT_scaled_size 1..16 picking jpeg_idct_NxN, dct_method switch for 8 (islow/ifast/float), float AAN scale doubles */ void jddctmgr_start_pass(int *param_1) { ulonglong *puVar1; double dVar2; ulonglong uVar3; short sVar4; int *piVar5; undefined *puVar6; undefined1 auVar7 [14]; undefined1 auVar8 [14]; undefined1 auVar9 [14]; undefined1 auVar10 [14]; undefined1 auVar11 [14]; undefined1 auVar12 [14]; undefined1 auVar13 [14]; undefined1 auVar14 [14]; int *piVar15; ulonglong *puVar16; undefined1 (*pauVar17) [16]; float *pfVar18; ulonglong *puVar19; int iVar20; double *pdVar21; short *psVar22; ushort *puVar23; int *piVar24; undefined1 auVar25 [16]; undefined1 auVar26 [16]; undefined1 auVar27 [16]; undefined1 auVar28 [16]; undefined1 auVar29 [16]; undefined1 auVar30 [16]; undefined1 auVar31 [16]; undefined1 auVar32 [16]; undefined1 auVar33 [16]; undefined1 auVar34 [16]; undefined1 in_XMM1 [16]; undefined1 auVar35 [16]; undefined1 auVar37 [16]; undefined1 auVar36 [16]; undefined1 auVar39 [16]; undefined1 auVar38 [16]; undefined1 auVar40 [16]; int local_18; undefined4 *local_14; int *local_c; code *local_8; piVar15 = param_1; param_1 = (int *)0x0; local_8 = (code *)0x0; local_18 = 0; if (0 < piVar15[9]) { local_14 = (undefined4 *)(piVar15[0x31] + 0x24); local_c = (int *)(piVar15[0x6b] + 0x54); do { switch(*local_14) { case 1: local_8 = FUN_00adade0; param_1 = (int *)0x0; break; case 2: local_8 = jpeg_idct_2x2; param_1 = (int *)0x0; break; case 3: local_8 = jpeg_idct_3x3; param_1 = (int *)0x0; break; case 4: local_8 = jpeg_idct_4x4; param_1 = (int *)0x0; break; case 5: local_8 = jpeg_idct_5x5; param_1 = (int *)0x0; break; case 6: local_8 = jpeg_idct_6x6; param_1 = (int *)0x0; break; case 7: local_8 = jpeg_idct_7x7; param_1 = (int *)0x0; break; case 8: iVar20 = piVar15[0x11]; if (iVar20 == 0) { local_8 = jpeg_idct_islow; param_1 = (int *)0x0; } else if (iVar20 == 1) { local_8 = jpeg_idct_ifast; param_1 = (int *)0x1; } else { if (iVar20 != 2) { *(undefined4 *)(*piVar15 + 0x14) = 0x31; goto LAB_00acafef; } local_8 = jpeg_idct_float; param_1 = (int *)0x2; } break; case 9: local_8 = jpeg_idct_9x9; param_1 = (int *)0x0; break; case 10: local_8 = jpeg_idct_10x10; param_1 = (int *)0x0; break; case 0xb: local_8 = jpeg_idct_11x11; param_1 = (int *)0x0; break; case 0xc: local_8 = jpeg_idct_12x12; param_1 = (int *)0x0; break; case 0xd: local_8 = jpeg_idct_13x13; param_1 = (int *)0x0; break; case 0xe: local_8 = jpeg_idct_14x14; param_1 = (int *)0x0; break; case 0xf: local_8 = jpeg_idct_15x15; param_1 = (int *)0x0; break; case 0x10: local_8 = jpeg_idct_16x16; param_1 = (int *)0x0; break; default: *(undefined4 *)(*piVar15 + 0x14) = 7; *(undefined4 *)(*piVar15 + 0x18) = *local_14; LAB_00acafef: (**(code **)*piVar15)(piVar15); } iVar20 = __isa_available; local_c[-0x14] = (int)local_8; if (((*(char *)(local_14 + 4) != '\0') && ((int *)*local_c != param_1)) && (piVar5 = (int *)local_14[0xb], piVar5 != (int *)0x0)) { *local_c = (int)param_1; if (param_1 == (int *)0x0) { puVar6 = (undefined *)local_14[0xc]; iVar20 = 0; if (((undefined *)((int)piVar5 + 0x7e) < puVar6) || (puVar6 + 0xfc < piVar5)) { iVar20 = 4; pauVar17 = (undefined1 (*) [16])(puVar6 + 0x20); puVar16 = (ulonglong *)(piVar5 + 4); do { uVar3 = puVar16[-2]; auVar7._8_4_ = 0; auVar7._0_8_ = uVar3; auVar7._12_2_ = (short)(uVar3 >> 0x30); auVar11._8_2_ = (short)(uVar3 >> 0x20); auVar11._0_8_ = uVar3; auVar11._10_4_ = auVar7._10_4_; auVar27._0_4_ = (uint)uVar3; auVar27._4_2_ = (short)(uVar3 >> 0x10); auVar27._6_10_ = (unkuint10)auVar11._8_6_ << 0x10; auVar35._4_12_ = auVar27._4_12_; auVar35._0_4_ = auVar27._0_4_ & 0xffff; pauVar17[-2] = auVar35; uVar3 = puVar16[-1]; auVar8._8_4_ = 0; auVar8._0_8_ = uVar3; auVar8._12_2_ = (short)(uVar3 >> 0x30); auVar12._8_2_ = (short)(uVar3 >> 0x20); auVar12._0_8_ = uVar3; auVar12._10_4_ = auVar8._10_4_; auVar37._0_4_ = (uint)uVar3; auVar37._4_2_ = (short)(uVar3 >> 0x10); auVar37._6_10_ = (unkuint10)auVar12._8_6_ << 0x10; auVar36._4_12_ = auVar37._4_12_; auVar36._0_4_ = auVar37._0_4_ & 0xffff; pauVar17[-1] = auVar36; uVar3 = *puVar16; auVar9._8_4_ = 0; auVar9._0_8_ = uVar3; auVar9._12_2_ = (short)(uVar3 >> 0x30); auVar13._8_2_ = (short)(uVar3 >> 0x20); auVar13._0_8_ = uVar3; auVar13._10_4_ = auVar9._10_4_; auVar39._0_4_ = (uint)uVar3; auVar39._4_2_ = (short)(uVar3 >> 0x10); auVar39._6_10_ = (unkuint10)auVar13._8_6_ << 0x10; auVar38._4_12_ = auVar39._4_12_; auVar38._0_4_ = auVar39._0_4_ & 0xffff; *pauVar17 = auVar38; uVar3 = puVar16[1]; auVar10._8_4_ = 0; auVar10._0_8_ = uVar3; auVar10._12_2_ = (short)(uVar3 >> 0x30); auVar14._8_2_ = (short)(uVar3 >> 0x20); auVar14._0_8_ = uVar3; auVar14._10_4_ = auVar10._10_4_; auVar40._0_4_ = (uint)uVar3; auVar40._4_2_ = (short)(uVar3 >> 0x10); auVar40._6_10_ = (unkuint10)auVar14._8_6_ << 0x10; in_XMM1._4_12_ = auVar40._4_12_; in_XMM1._0_4_ = auVar40._0_4_ & 0xffff; pauVar17[1] = in_XMM1; iVar20 = iVar20 + -1; pauVar17 = pauVar17 + 4; puVar16 = puVar16 + 4; } while (iVar20 != 0); } else { do { *(uint *)(puVar6 + iVar20 * 4) = (uint)*(ushort *)((int)piVar5 + iVar20 * 2); iVar20 = iVar20 + 1; } while (iVar20 < 0x40); } } else if (param_1 == (int *)0x1) { piVar24 = (int *)local_14[0xc]; if (((iVar20 < 2) || ((piVar24 < &UNK_00b5e4df && (&UNK_00b5e45f < piVar24 + 0x3f)))) || ((piVar24 <= (int *)((int)piVar5 + 0x7e) && (piVar5 <= piVar24 + 0x3f)))) { psVar22 = &DAT_00b5e460; do { puVar23 = (ushort *)((int)(piVar5 + -0x2d7918) + (int)psVar22); sVar4 = *psVar22; psVar22 = psVar22 + 1; *piVar24 = (int)((uint)*puVar23 * (int)sVar4 + 0x800) >> 0xc; piVar24 = piVar24 + 1; } while ((int)psVar22 < 0xb5e4e0); } else { puVar19 = &DAT_00b5e468; puVar16 = (ulonglong *)(piVar5 + 4); piVar24 = piVar24 + 8; do { auVar25._8_8_ = 0; auVar25._0_8_ = puVar19[-1]; auVar35 = pmovsxwd(in_XMM1,auVar25); auVar26._8_8_ = 0; auVar26._0_8_ = puVar16[-2]; puVar1 = puVar16 + 4; auVar27 = pmovzxwd(auVar26,auVar26); auVar27 = pmulld(auVar27,auVar35); piVar24[-8] = auVar27._0_4_ + 0x800 >> 0xc; piVar24[-7] = auVar27._4_4_ + 0x800 >> 0xc; piVar24[-6] = auVar27._8_4_ + 0x800 >> 0xc; piVar24[-5] = auVar27._12_4_ + 0x800 >> 0xc; auVar28._8_8_ = 0; auVar28._0_8_ = *puVar19; puVar19 = puVar19 + 4; auVar35 = pmovsxwd(auVar35,auVar28); auVar29._8_8_ = 0; auVar29._0_8_ = puVar16[-1]; auVar27 = pmovzxwd(auVar29,auVar29); auVar27 = pmulld(auVar27,auVar35); piVar24[-4] = auVar27._0_4_ + 0x800 >> 0xc; piVar24[-3] = auVar27._4_4_ + 0x800 >> 0xc; piVar24[-2] = auVar27._8_4_ + 0x800 >> 0xc; piVar24[-1] = auVar27._12_4_ + 0x800 >> 0xc; auVar30._8_8_ = 0; auVar30._0_8_ = *(ulonglong *)(((int)&UNK_00b5e440 - (int)piVar5) + (int)puVar1); auVar35 = pmovsxwd(auVar35,auVar30); auVar31._8_8_ = 0; auVar31._0_8_ = *puVar16; auVar27 = pmovzxwd(auVar31,auVar31); auVar27 = pmulld(auVar27,auVar35); *piVar24 = auVar27._0_4_ + 0x800 >> 0xc; piVar24[1] = auVar27._4_4_ + 0x800 >> 0xc; piVar24[2] = auVar27._8_4_ + 0x800 >> 0xc; piVar24[3] = auVar27._12_4_ + 0x800 >> 0xc; auVar32._8_8_ = 0; auVar32._0_8_ = *(ulonglong *)(((int)&UNK_00b5e448 - (int)piVar5) + (int)puVar1); in_XMM1 = pmovsxwd(auVar35,auVar32); auVar33._8_8_ = 0; auVar33._0_8_ = puVar16[1]; auVar27 = pmovzxwd(auVar33,auVar33); auVar27 = pmulld(auVar27,in_XMM1); auVar34._0_4_ = auVar27._0_4_ + 0x800 >> 0xc; auVar34._4_4_ = auVar27._4_4_ + 0x800 >> 0xc; auVar34._8_4_ = auVar27._8_4_ + 0x800 >> 0xc; auVar34._12_4_ = auVar27._12_4_ + 0x800 >> 0xc; *(undefined1 (*) [16])(piVar24 + 4) = auVar34; puVar16 = puVar1; piVar24 = piVar24 + 0x10; } while ((int)puVar19 < 0xb5e4e8); } } else if (param_1 == (int *)0x2) { pdVar21 = (double *)&DAT_00b5e420; pfVar18 = (float *)(local_14[0xc] + 8); puVar23 = (ushort *)(piVar5 + 1); do { dVar2 = *pdVar21; in_XMM1._8_8_ = 0; in_XMM1._0_8_ = dVar2; pdVar21 = pdVar21 + 1; pfVar18[-2] = (float)((double)puVar23[-2] * dVar2); pfVar18[-1] = (float)((double)puVar23[-1] * dVar2 * 1.387039845); *pfVar18 = (float)((double)*puVar23 * dVar2 * 1.306562965); pfVar18[1] = (float)((double)puVar23[1] * dVar2 * 1.175875602); pfVar18[2] = (float)((double)puVar23[2] * dVar2); pfVar18[3] = (float)((double)puVar23[3] * dVar2 * 0.785694958); pfVar18[4] = (float)((double)puVar23[4] * dVar2 * 0.5411961); pfVar18[5] = (float)((double)puVar23[5] * dVar2 * 0.275899379); pfVar18 = pfVar18 + 8; puVar23 = puVar23 + 8; } while ((int)pdVar21 < 0xb5e460); } else { *(undefined4 *)(*piVar15 + 0x14) = 0x31; (**(code **)*piVar15)(piVar15); } } local_14 = local_14 + 0x16; local_c = local_c + 1; local_18 = local_18 + 1; } while (local_18 < piVar15[9]); } return; } //@@ 00acb400 FUN_00acb400 void FUN_00acb400(int *param_1,int param_2) { int iVar1; undefined4 uVar2; iVar1 = param_1[0x67]; if (param_2 == 0) { if (*(char *)((int)param_1 + 0x4a) == '\0') { *(undefined4 *)(iVar1 + 4) = *(undefined4 *)(param_1[0x6c] + 4); } else { *(code **)(iVar1 + 4) = FUN_00acb510; if (*(int *)(iVar1 + 0x14) == 0) { uVar2 = (**(code **)(param_1[1] + 0x1c)) (param_1,*(undefined4 *)(iVar1 + 0x10),0,*(undefined4 *)(iVar1 + 0x18),1); *(undefined4 *)(iVar1 + 0x14) = uVar2; *(undefined4 *)(iVar1 + 0x20) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0; return; } } *(undefined4 *)(iVar1 + 0x20) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0; return; } if (param_2 == 2) { if (*(int *)(iVar1 + 0x10) == 0) { *(undefined4 *)(*param_1 + 0x14) = 3; (**(code **)*param_1)(param_1); } *(code **)(iVar1 + 4) = FUN_00acb620; *(undefined4 *)(iVar1 + 0x20) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0; return; } if (param_2 != 3) { *(undefined4 *)(*param_1 + 0x14) = 3; (**(code **)*param_1)(param_1); *(undefined4 *)(iVar1 + 0x20) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0; return; } if (*(int *)(iVar1 + 0x10) == 0) { *(undefined4 *)(*param_1 + 0x14) = 3; (**(code **)*param_1)(param_1); } *(code **)(iVar1 + 4) = FUN_00acb580; *(undefined4 *)(iVar1 + 0x20) = 0; *(undefined4 *)(iVar1 + 0x1c) = 0; return; } //@@ 00acb510 FUN_00acb510 void FUN_00acb510(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,int param_5, int *param_6,int param_7) { int *piVar1; int iVar2; int iVar3; int *piVar4; uint uVar5; piVar4 = param_6; iVar3 = param_1; iVar2 = *(int *)(param_1 + 0x19c); piVar1 = (int *)(param_1 + 0x1b0); param_1 = 0; uVar5 = *(uint *)(iVar2 + 0x18); if ((uint)(param_7 - *param_6) <= *(uint *)(iVar2 + 0x18)) { uVar5 = param_7 - *param_6; } (**(code **)(*piVar1 + 4)) (iVar3,param_2,param_3,param_4,*(undefined4 *)(iVar2 + 0x14),¶m_1,uVar5); (**(code **)(*(int *)(iVar3 + 0x1b8) + 4)) (iVar3,*(undefined4 *)(iVar2 + 0x14),param_5 + *piVar4 * 4,param_1); *piVar4 = *piVar4 + param_1; return; } //@@ 00acb580 FUN_00acb580 void FUN_00acb580(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,int *param_6) { int iVar1; undefined4 uVar2; uint uVar3; uint uVar4; iVar1 = *(int *)(param_1 + 0x19c); uVar4 = *(uint *)(iVar1 + 0x20); if (uVar4 == 0) { uVar2 = (**(code **)(*(int *)(param_1 + 4) + 0x1c)) (param_1,*(undefined4 *)(iVar1 + 0x10),*(undefined4 *)(iVar1 + 0x1c), *(undefined4 *)(iVar1 + 0x18),1); uVar4 = *(uint *)(iVar1 + 0x20); *(undefined4 *)(iVar1 + 0x14) = uVar2; } (**(code **)(*(int *)(param_1 + 0x1b0) + 4)) (param_1,param_2,param_3,param_4,*(undefined4 *)(iVar1 + 0x14),iVar1 + 0x20, *(undefined4 *)(iVar1 + 0x18)); uVar3 = *(uint *)(iVar1 + 0x20); if (uVar4 < uVar3) { (**(code **)(*(int *)(param_1 + 0x1b8) + 4)) (param_1,*(int *)(iVar1 + 0x14) + uVar4 * 4,0,uVar3 - uVar4); *param_6 = *param_6 + (uVar3 - uVar4); uVar3 = *(uint *)(iVar1 + 0x20); } if (*(uint *)(iVar1 + 0x18) <= uVar3) { *(int *)(iVar1 + 0x1c) = *(int *)(iVar1 + 0x1c) + *(uint *)(iVar1 + 0x18); *(undefined4 *)(iVar1 + 0x20) = 0; } return; } //@@ 00acb620 FUN_00acb620 void FUN_00acb620(int param_1) { int iVar1; undefined4 uVar2; uint uVar3; int iVar4; uint uVar5; int in_stack_00000014; int *in_stack_00000018; int in_stack_0000001c; iVar1 = *(int *)(param_1 + 0x19c); iVar4 = *(int *)(iVar1 + 0x20); if (iVar4 == 0) { uVar2 = (**(code **)(*(int *)(param_1 + 4) + 0x1c)) (param_1,*(undefined4 *)(iVar1 + 0x10),*(undefined4 *)(iVar1 + 0x1c), *(undefined4 *)(iVar1 + 0x18),0); iVar4 = *(int *)(iVar1 + 0x20); *(undefined4 *)(iVar1 + 0x14) = uVar2; } uVar3 = *(int *)(iVar1 + 0x18) - iVar4; uVar5 = in_stack_0000001c - *in_stack_00000018; if (uVar3 <= uVar5) { uVar5 = uVar3; } uVar3 = *(int *)(param_1 + 0x60) - *(int *)(iVar1 + 0x1c); if (uVar5 <= uVar3) { uVar3 = uVar5; } (**(code **)(*(int *)(param_1 + 0x1b8) + 4)) (param_1,*(int *)(iVar1 + 0x14) + *(int *)(iVar1 + 0x20) * 4, in_stack_00000014 + *in_stack_00000018 * 4,uVar3); *in_stack_00000018 = *in_stack_00000018 + uVar3; *(int *)(iVar1 + 0x20) = *(int *)(iVar1 + 0x20) + uVar3; if (*(uint *)(iVar1 + 0x18) <= *(uint *)(iVar1 + 0x20)) { *(int *)(iVar1 + 0x1c) = *(int *)(iVar1 + 0x1c) + *(uint *)(iVar1 + 0x18); *(undefined4 *)(iVar1 + 0x20) = 0; } return; } //@@ 00acb6c0 FUN_00acb6c0 void FUN_00acb6c0(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { uint uVar1; uVar1 = *param_3 + *param_4 & 0xffff; *param_5 = uVar1; while (param_6 = param_6 + -1, param_6 != 0) { param_3 = param_3 + 1; param_5 = param_5 + 1; uVar1 = *param_3 + uVar1 & 0xffff; *param_5 = uVar1; } return; } //@@ 00acb700 FUN_00acb700 void FUN_00acb700(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { *param_5 = *param_3 + *param_4 & 0xffff; while (param_6 = param_6 + -1, param_6 != 0) { param_5 = param_5 + 1; param_3 = param_3 + 1; param_4 = param_4 + 1; *param_5 = *param_3 + *param_4 & 0xffff; } return; } //@@ 00acb750 FUN_00acb750 void FUN_00acb750(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { int iVar1; int iVar2; iVar1 = *param_4; *param_5 = *param_3 + iVar1 & 0xffff; while (param_6 = param_6 + -1, param_6 != 0) { param_5 = param_5 + 1; param_3 = param_3 + 1; param_4 = param_4 + 1; iVar2 = *param_4; *param_5 = *param_3 + iVar1 & 0xffff; iVar1 = iVar2; } return; } //@@ 00acb7b0 FUN_00acb7b0 void FUN_00acb7b0(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { int iVar1; int iVar2; uint uVar3; iVar1 = *param_4; uVar3 = *param_3 + iVar1 & 0xffff; *param_5 = uVar3; while (param_6 = param_6 + -1, param_6 != 0) { param_5 = param_5 + 1; param_3 = param_3 + 1; param_4 = param_4 + 1; iVar2 = *param_4; uVar3 = (*param_3 - iVar1) + uVar3 + iVar2 & 0xffff; *param_5 = uVar3; iVar1 = iVar2; } return; } //@@ 00acb810 FUN_00acb810 void FUN_00acb810(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { int iVar1; int iVar2; uint uVar3; iVar1 = *param_4; uVar3 = *param_3 + iVar1 & 0xffff; *param_5 = uVar3; while (param_6 = param_6 + -1, param_6 != 0) { param_5 = param_5 + 1; param_3 = param_3 + 1; param_4 = param_4 + 1; iVar2 = *param_4; uVar3 = (iVar2 - iVar1 >> 1) + *param_3 + uVar3 & 0xffff; *param_5 = uVar3; iVar1 = iVar2; } return; } //@@ 00acb870 FUN_00acb870 void FUN_00acb870(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { int iVar1; uint uVar2; int iVar3; iVar1 = *param_4; uVar2 = *param_3 + iVar1 & 0xffff; *param_5 = uVar2; while (param_6 = param_6 + -1, param_6 != 0) { param_5 = param_5 + 1; param_3 = param_3 + 1; param_4 = param_4 + 1; iVar3 = uVar2 - iVar1; iVar1 = *param_4; uVar2 = (iVar3 >> 1) + *param_3 + iVar1 & 0xffff; *param_5 = uVar2; } return; } //@@ 00acb8d0 FUN_00acb8d0 void FUN_00acb8d0(undefined4 param_1,undefined4 param_2,int *param_3,int *param_4,uint *param_5, int param_6) { uint uVar1; uVar1 = *param_3 + *param_4 & 0xffff; *param_5 = uVar1; while (param_6 = param_6 + -1, param_6 != 0) { param_3 = param_3 + 1; param_4 = param_4 + 1; param_5 = param_5 + 1; uVar1 = ((int)(*param_4 + uVar1) >> 1) + *param_3 & 0xffff; *param_5 = uVar1; } return; } //@@ 00acb930 FUN_00acb930 void FUN_00acb930(int param_1,int param_2,int *param_3,undefined4 param_4,uint *param_5,int param_6) { int iVar1; uint uVar2; iVar1 = *(int *)(param_1 + 0x1ac); uVar2 = (1 << (((char)*(undefined4 *)(param_1 + 0xc0) - (char)*(undefined4 *)(param_1 + 0x17c)) - 1U & 0x1f)) + *param_3 & 0xffff; *param_5 = uVar2; while (param_6 = param_6 + -1, param_6 != 0) { param_5 = param_5 + 1; param_3 = param_3 + 1; uVar2 = *param_3 + uVar2 & 0xffff; *param_5 = uVar2; } switch(*(undefined4 *)(param_1 + 0x170)) { case 1: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb6c0; return; case 2: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb700; return; case 3: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb750; return; case 4: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb7b0; return; case 5: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb810; return; case 6: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb870; return; case 7: *(code **)(iVar1 + 0x54 + param_2 * 4) = FUN_00acb8d0; } return; } //@@ 00acba20 FUN_00acba20 void FUN_00acba20(int param_1,char *param_2,char *param_3,int param_4) { char cVar1; do { cVar1 = *param_2; param_2 = param_2 + 4; *param_3 = cVar1 << ((byte)*(undefined4 *)(param_1 + 0x17c) & 0x1f); param_4 = param_4 + -1; param_3 = param_3 + 1; } while (param_4 != 0); return; } //@@ 00acba50 FUN_00acba50 void FUN_00acba50(undefined4 param_1,undefined1 *param_2,undefined1 *param_3,int param_4) { do { *param_3 = *param_2; param_2 = param_2 + 4; param_4 = param_4 + -1; param_3 = param_3 + 1; } while (param_4 != 0); return; } //@@ 00acba80 FUN_00acba80 void FUN_00acba80(int *param_1) { int iVar1; int iVar2; code *pcVar3; undefined4 *puVar4; iVar1 = param_1[0x6b]; if ((((6 < param_1[0x5c] - 1U) || (param_1[0x5d] != 0)) || (param_1[0x5e] != 0)) || ((param_1[0x5f] < 0 || (param_1[0x30] <= param_1[0x5f])))) { *(undefined4 *)(*param_1 + 0x14) = 0x11; *(int *)(*param_1 + 0x18) = param_1[0x5c]; *(int *)(*param_1 + 0x1c) = param_1[0x5d]; *(int *)(*param_1 + 0x20) = param_1[0x5e]; *(int *)(*param_1 + 0x24) = param_1[0x5f]; (**(code **)*param_1)(param_1); } iVar2 = 0; if (0 < param_1[9]) { puVar4 = (undefined4 *)(iVar1 + 0x54); do { *puVar4 = FUN_00acb930; puVar4 = puVar4 + 1; iVar2 = iVar2 + 1; } while (iVar2 < param_1[9]); } pcVar3 = FUN_00acba20; if (param_1[0x5f] == 0) { pcVar3 = FUN_00acba50; } *(code **)(iVar1 + 0x7c) = pcVar3; return; } //@@ 00acbb40 FUN_00acbb40 void FUN_00acbb40(int *param_1) { int in_ECX; int iVar1; int *in_EDX; if ((*(int *)(in_ECX + 0x5c) != -1) && (*(int *)(in_ECX + 0x60) != -1)) { *param_1 = (int)((float)*in_EDX / ((float)*(int *)(in_ECX + 0x5c) / (float)*(int *)(in_ECX + 0x60))); } iVar1 = *(int *)(in_ECX + 0x4c); if (iVar1 == -1) { iVar1 = *(int *)(in_ECX + 0x54); if (iVar1 == -1) goto LAB_00acbb9b; if (*in_EDX < iVar1) { iVar1 = *in_EDX; } } else if (iVar1 < *in_EDX) { iVar1 = *in_EDX; } *in_EDX = iVar1; LAB_00acbb9b: iVar1 = *(int *)(in_ECX + 0x50); if (iVar1 != -1) { if (*param_1 < iVar1) { iVar1 = *param_1; } *param_1 = iVar1; return; } iVar1 = *(int *)(in_ECX + 0x58); if (iVar1 != -1) { if (iVar1 < *param_1) { iVar1 = *param_1; } *param_1 = iVar1; } return; } //@@ 00acbbd0 FUN_00acbbd0 void FUN_00acbbd0(void) { int in_ECX; if ((undefined4 *)(in_ECX + 0x2f4) != (undefined4 *)0x0) { *(undefined4 *)(in_ECX + 0x2f4) = 0; } if ((undefined4 *)(in_ECX + 0x2f8) != (undefined4 *)0x0) { *(undefined4 *)(in_ECX + 0x2f8) = 0; } *(undefined4 *)(in_ECX + 0x300) = 0x438; *(undefined4 *)(in_ECX + 0x2fc) = 0x780; return; } //@@ 00acbc10 FUN_00acbc10 undefined4 FUN_00acbc10(int param_1,int *param_2,int *param_3,int param_4) { int iVar1; if (*(int *)(param_1 + 0x40) == 0) { if ((*param_2 == -0x80000000) && (param_2[1] == -0x80000000)) { *(undefined4 *)(param_1 + 0x2f4) = 0x11; iVar1 = 0x11; } else { *(int *)(param_1 + 0x2f4) = *param_2; iVar1 = param_2[1]; } *(int *)(param_1 + 0x2f8) = iVar1; *(int *)(param_1 + 0x2fc) = param_2[2]; iVar1 = param_2[3]; } else { if ((undefined4 *)(param_1 + 0x2f4) != (undefined4 *)0x0) { *(undefined4 *)(param_1 + 0x2f4) = 0; } if ((undefined4 *)(param_1 + 0x2f8) != (undefined4 *)0x0) { *(undefined4 *)(param_1 + 0x2f8) = 0; } *(undefined4 *)(param_1 + 0x2fc) = 0x780; iVar1 = 0x438; } *(int *)(param_1 + 0x300) = iVar1; *(int *)(param_1 + 0x304) = param_2[6]; *(int *)(param_1 + 0x314) = param_2[7]; *(int *)(param_1 + 0x30c) = param_2[0xb]; *(int *)(param_1 + 0x318) = param_2[10]; *(undefined4 *)(param_1 + 0x31c) = *(undefined4 *)(param_4 + 0x3c); *(undefined4 *)(param_1 + 800) = 0x3f800000; if (*param_3 != 0) { iVar1 = param_3[1]; if ((iVar1 == 0x36001) || (iVar1 == 0x36003)) { iVar1 = FUN_00a83b90(); if (iVar1 == 0) { return 0; } iVar1 = _glfwCreateContextOSMesa(param_4); if (iVar1 == 0) { return 0; } } else if (iVar1 == 0x36002) { iVar1 = _glfwInitEGL(); if (iVar1 == 0) { return 0; } iVar1 = _glfwCreateContextEGL(param_4); if (iVar1 == 0) { return 0; } } iVar1 = _glfwRefreshContextAttribs(); if (iVar1 == 0) { return 0; } } if (*(int *)(param_1 + 0x40) == 0) { if ((param_2[6] != 0) && (*(undefined4 *)(param_1 + 0x304) = 1, param_2[8] != 0)) { FUN_00acc370(param_1); } } else { *(undefined4 *)(param_1 + 0x304) = 1; FUN_00acc370(param_1); iVar1 = *(int *)(param_1 + 0x40); if (iVar1 == 0) { _wassert(L"monitor != NULL", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" ,0xa0); } *(int *)(iVar1 + 0x8c) = param_1; if (param_2[0xc] != 0) { FUN_00a263e0(); return 1; } } return 1; } //@@ 00acbdc0 FUN_00acbdc0 void FUN_00acbdc0(int param_1) { int iVar1; iVar1 = *(int *)(param_1 + 0x40); if ((iVar1 != 0) && (*(int *)(iVar1 + 0x8c) == param_1)) { *(undefined4 *)(iVar1 + 0x8c) = 0; } if (DAT_00c75aec == param_1) { DAT_00c75aec = 0; } if (*(code **)(param_1 + 0x240) == (code *)0x0) { return; } /* WARNING: Could not recover jumptable at 0x00acbdfe. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(param_1 + 0x240))(); return; } //@@ 00acbe10 FUN_00acbe10 void FUN_00acbe10(int param_1,int param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5, undefined4 param_6) { int iVar1; iVar1 = *(int *)(param_1 + 0x40); if (iVar1 == param_2) { if (param_2 != 0) { return; } } else { if ((iVar1 != 0) && (*(int *)(iVar1 + 0x8c) == param_1)) { *(undefined4 *)(iVar1 + 0x8c) = 0; } *(int *)(param_1 + 0x40) = param_2; if (param_2 != 0) { *(undefined4 *)(param_1 + 0x304) = 1; *(int *)(param_2 + 0x8c) = param_1; FUN_00acbbd0(); return; } } FUN_00acbeb0(param_1,param_3,param_4); FUN_00acbf30(param_1,param_5,param_6); return; } //@@ 00acbe80 FUN_00acbe80 void FUN_00acbe80(int param_1,undefined4 *param_2,undefined4 *param_3) { if (param_2 != (undefined4 *)0x0) { *param_2 = *(undefined4 *)(param_1 + 0x2f4); } if (param_3 != (undefined4 *)0x0) { *param_3 = *(undefined4 *)(param_1 + 0x2f8); } return; } //@@ 00acbeb0 FUN_00acbeb0 void FUN_00acbeb0(int param_1,int param_2,int param_3) { if ((*(int *)(param_1 + 0x40) == 0) && ((*(int *)(param_1 + 0x2f4) != param_2 || (*(int *)(param_1 + 0x2f8) != param_3)))) { *(int *)(param_1 + 0x2f4) = param_2; *(int *)(param_1 + 0x2f8) = param_3; if (*(code **)(param_1 + 0x270) != (code *)0x0) { (**(code **)(param_1 + 0x270))(param_1,param_2,param_3); } } return; } //@@ 00acbf00 FUN_00acbf00 void FUN_00acbf00(int param_1,undefined4 *param_2,undefined4 *param_3) { if (param_2 != (undefined4 *)0x0) { *param_2 = *(undefined4 *)(param_1 + 0x2fc); } if (param_3 != (undefined4 *)0x0) { *param_3 = *(undefined4 *)(param_1 + 0x300); } return; } //@@ 00acbf30 FUN_00acbf30 void FUN_00acbf30(int param_1,int param_2,int param_3) { code *pcVar1; pcVar1 = _wassert_exref; if ((*(int *)(param_1 + 0x40) == 0) && ((*(int *)(param_1 + 0x2fc) != param_2 || (*(int *)(param_1 + 0x300) != param_3)))) { *(int *)(param_1 + 0x2fc) = param_2; *(int *)(param_1 + 0x300) = param_3; if (param_2 < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x7c); pcVar1 = _wassert_exref; } if (param_3 < 0) { (*pcVar1)(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x7d); } if (*(code **)(param_1 + 0x28c) != (code *)0x0) { (**(code **)(param_1 + 0x28c))(param_1,param_2,param_3); } if (*(code **)(param_1 + 0x27c) != (code *)0x0) { (**(code **)(param_1 + 0x27c))(param_1); } if (param_2 < 0) { _wassert(L"width >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x59); } if (param_3 < 0) { _wassert(L"height >= 0", L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" ,0x5a); } if (*(code **)(param_1 + 0x274) != (code *)0x0) { (**(code **)(param_1 + 0x274))(param_1,param_2,param_3); } } return; } //@@ 00acc010 FUN_00acc010 void FUN_00acc010(int param_1) { undefined4 uVar1; int iVar2; iVar2 = param_1; uVar1 = *(undefined4 *)(param_1 + 0x2fc); param_1 = *(undefined4 *)(param_1 + 0x300); FUN_00acbb40(¶m_1); FUN_00acbf30(iVar2,uVar1,param_1); return; } //@@ 00acc050 FUN_00acc050 void FUN_00acc050(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4, undefined4 *param_5) { if ((*(int *)(param_1 + 0x314) == 0) || (*(int *)(param_1 + 0x40) != 0)) { if (param_2 != (undefined4 *)0x0) { *param_2 = 0; } if (param_3 != (undefined4 *)0x0) { *param_3 = 0; } if (param_4 != (undefined4 *)0x0) { *param_4 = 0; } if (param_5 != (undefined4 *)0x0) { *param_5 = 0; } } else { if (param_2 != (undefined4 *)0x0) { *param_2 = 1; } if (param_3 != (undefined4 *)0x0) { *param_3 = 10; } if (param_4 != (undefined4 *)0x0) { *param_4 = 1; } if (param_5 != (undefined4 *)0x0) { *param_5 = 1; return; } } return; } //@@ 00acc0e0 FUN_00acc0e0 void FUN_00acc0e0(undefined4 param_1,undefined4 *param_2,undefined4 *param_3) { if (param_2 != (undefined4 *)0x0) { *param_2 = 0x3f800000; } if (param_3 != (undefined4 *)0x0) { *param_3 = 0x3f800000; } return; } //@@ 00acc100 FUN_00acc100 void FUN_00acc100(int param_1) { int iVar1; if (DAT_00c75aec == param_1) { DAT_00c75aec = 0; FUN_00a6a710(); } if (*(int *)(param_1 + 0x308) == 0) { *(undefined4 *)(param_1 + 0x308) = 1; if (*(code **)(param_1 + 0x284) != (code *)0x0) { (**(code **)(param_1 + 0x284))(param_1,1); } iVar1 = *(int *)(param_1 + 0x40); if ((iVar1 != 0) && (*(int *)(iVar1 + 0x8c) == param_1)) { *(undefined4 *)(iVar1 + 0x8c) = 0; } } return; } //@@ 00acc170 FUN_00acc170 void FUN_00acc170(int param_1) { if (*(int *)(param_1 + 0x308) == 0) { if (*(int *)(param_1 + 0x30c) != 0) { *(undefined4 *)(param_1 + 0x30c) = 0; if (*(code **)(param_1 + 0x288) != (code *)0x0) { (**(code **)(param_1 + 0x288))(param_1,0); } } } else { *(undefined4 *)(param_1 + 0x308) = 0; if (*(code **)(param_1 + 0x284) != (code *)0x0) { (**(code **)(param_1 + 0x284))(param_1,0); } if (*(int *)(param_1 + 0x40) != 0) { *(int *)(*(int *)(param_1 + 0x40) + 0x8c) = param_1; return; } } return; } //@@ 00acc1e0 FUN_00acc1e0 void FUN_00acc1e0(int param_1) { if (*(int *)(param_1 + 0x30c) == 0) { *(undefined4 *)(param_1 + 0x30c) = 1; if (*(code **)(param_1 + 0x288) != (code *)0x0) { (**(code **)(param_1 + 0x288))(param_1,1); } } return; } //@@ 00acc210 FUN_00acc210 undefined4 FUN_00acc210(int param_1) { return *(undefined4 *)(param_1 + 0x30c); } //@@ 00acc220 FUN_00acc220 undefined4 FUN_00acc220(int param_1) { if ((((DAT_00c75ae0 < *(int *)(param_1 + 0x2f4)) || (DAT_00c75ae4 < *(int *)(param_1 + 0x2f8))) || (*(int *)(param_1 + 0x2fc) + -1 + *(int *)(param_1 + 0x2f4) < DAT_00c75ae0)) || (*(int *)(param_1 + 0x300) + -1 + *(int *)(param_1 + 0x2f8) < DAT_00c75ae4)) { return 0; } return 1; } //@@ 00acc280 FUN_00acc280 undefined4 FUN_00acc280(int param_1) { return *(undefined4 *)(param_1 + 0x31c); } //@@ 00acc290 FUN_00acc290 void FUN_00acc290(int param_1,undefined4 param_2) { *(undefined4 *)(param_1 + 0x310) = param_2; return; } //@@ 00acc2b0 FUN_00acc2b0 void FUN_00acc2b0(int param_1,undefined4 param_2) { *(undefined4 *)(param_1 + 0x314) = param_2; return; } //@@ 00acc2d0 FUN_00acc2d0 void FUN_00acc2d0(int param_1,undefined4 param_2) { *(undefined4 *)(param_1 + 0x318) = param_2; return; } //@@ 00acc2f0 FUN_00acc2f0 float10 FUN_00acc2f0(int param_1) { return (float10)*(float *)(param_1 + 800); } //@@ 00acc300 FUN_00acc300 void FUN_00acc300(int param_1,undefined4 param_2) { *(undefined4 *)(param_1 + 800) = param_2; return; } //@@ 00acc320 FUN_00acc320 void FUN_00acc320(int param_1) { *(undefined4 *)(param_1 + 0x304) = 1; return; } //@@ 00acc340 FUN_00acc340 void FUN_00acc340(int param_1) { if (DAT_00c75aec == param_1) { DAT_00c75aec = 0; FUN_00a6a710(); } *(undefined4 *)(param_1 + 0x304) = 0; return; } //@@ 00acc370 FUN_00acc370 void FUN_00acc370(int param_1) { int iVar1; iVar1 = DAT_00c75aec; if ((DAT_00c75aec != param_1) && (*(int *)(param_1 + 0x304) != 0)) { DAT_00c75aec = param_1; if (iVar1 != 0) { FUN_00a6a710(); if ((*(int *)(iVar1 + 0x40) != 0) && (*(int *)(iVar1 + 0xc) != 0)) { FUN_00acc100(iVar1); } } if (*(code **)(param_1 + 0x280) != (code *)0x0) { (**(code **)(param_1 + 0x280))(param_1,1); } } return; } //@@ 00acc3d0 FUN_00acc3d0 bool FUN_00acc3d0(int param_1) { return DAT_00c75aec == param_1; } //@@ 00acc3f0 FUN_00acc3f0 undefined4 FUN_00acc3f0(int param_1) { return *(undefined4 *)(param_1 + 0x308); } //@@ 00acc400 FUN_00acc400 undefined4 FUN_00acc400(int param_1) { return *(undefined4 *)(param_1 + 0x304); } //@@ 00acc410 FUN_00acc410 void FUN_00acc410(int param_1,double *param_2,double *param_3) { if (param_2 != (double *)0x0) { *param_2 = (double)(DAT_00c75ae0 - *(int *)(param_1 + 0x2f4)); } if (param_3 != (double *)0x0) { *param_3 = (double)(DAT_00c75ae4 - *(int *)(param_1 + 0x2f8)); } return; } //@@ 00acc460 FUN_00acc460 void FUN_00acc460(int param_1,double param_2,double param_3) { DAT_00c75ae0 = (int)param_2 + *(int *)(param_1 + 0x2f4); DAT_00c75ae4 = (int)param_3 + *(int *)(param_1 + 0x2f8); return; } //@@ 00acc490 FUN_00acc490 void FUN_00acc490(void) { undefined4 uVar1; uVar1 = FUN_00a69e80(); if (DAT_00c75ae8 != 0) { (*g_glfwDeallocate)(DAT_00c75ae8,g_glfwAllocatorUser); } DAT_00c75ae8 = uVar1; return; } //@@ 00acc4d0 FUN_00acc4d0 undefined2 * FUN_00acc4d0(int param_1) { if (param_1 - 1U < 0x78) { switch(param_1) { case 2: return (undefined2 *)&DAT_00b6ea34; case 3: return (undefined2 *)&DAT_00b66304; case 4: case 0x6c: return (undefined2 *)&DAT_00b6d4f8; case 5: case 0x69: return (undefined2 *)&DAT_00b1cebc; case 6: case 0x6a: return &DAT_00b6db28; case 7: case 0x5f: return (undefined2 *)&DAT_00b670e4; case 8: case 0x60: return (undefined2 *)&DAT_00b63104; case 9: case 0x61: return (undefined2 *)&DAT_00b63154; case 10: case 0x62: return (undefined2 *)&DAT_00b63158; case 0xb: case 99: return (undefined2 *)&DAT_00b6315c; case 0xc: case 100: return (undefined2 *)&DAT_00b63160; case 0xd: case 0x65: return (undefined2 *)&DAT_00b6312c; case 0xe: case 0x66: return (undefined2 *)&DAT_00ba9d68; case 0xf: case 0x67: return (undefined2 *)&DAT_00b75e80; case 0x10: case 0x68: return (undefined2 *)&DAT_00b80bcc; case 0x11: return (undefined2 *)&DAT_00b6ebc8; case 0x12: case 0x6f: return (undefined2 *)&DAT_00ba8f20; case 0x13: return (undefined2 *)&DAT_00b6d4d0; case 0x14: case 0x17: case 0x18: return (undefined2 *)&DAT_00b76eac; case 0x15: return (undefined2 *)&DAT_00b6d4d4; case 0x2c: return (undefined2 *)&DAT_00b656e8; case 0x2d: return (undefined2 *)&DAT_00b69bc4; case 0x2e: return (undefined2 *)&DAT_00ba9d74; case 0x2f: return (undefined2 *)&DAT_00b66140; case 0x30: return (undefined2 *)&DAT_00ba9d78; case 0x31: return (undefined2 *)&DAT_00ba9d6c; case 0x32: return (undefined2 *)&DAT_00b66178; case 0x33: return (undefined2 *)&DAT_00b70910; case 0x34: return (undefined2 *)&DAT_00ba9d70; case 0x35: return (undefined2 *)&DAT_00ba9d4c; case 0x36: return (undefined2 *)&DAT_00ba9d50; case 0x37: return (undefined2 *)&DAT_00b669b4; case 0x38: return (undefined2 *)&DAT_00b664a4; case 0x39: return (undefined2 *)&DAT_00b9fbf4; case 0x3a: return (undefined2 *)&DAT_00ba9d44; case 0x3b: return (undefined2 *)&DAT_00ba9d48; case 0x3c: return (undefined2 *)&DAT_00ba9d5c; case 0x3d: return (undefined2 *)&DAT_00b6617c; case 0x3e: return (undefined2 *)&DAT_00b6614c; case 0x3f: return (undefined2 *)&DAT_00ba9d60; case 0x40: return (undefined2 *)&DAT_00ba9d54; case 0x41: return (undefined2 *)&DAT_00b6b080; case 0x42: return (undefined2 *)&DAT_00b75e7c; case 0x43: return (undefined2 *)&DAT_00b66150; case 0x44: return (undefined2 *)&DAT_00b6cb44; case 0x45: return (undefined2 *)&DAT_00ba9d58; case 0x6b: return (undefined2 *)&DAT_00ba9d64; case 0x6d: return (undefined2 *)&DAT_00b6d15c; } } else { _glfwInputError(0x10004,"Invalid scancode %i",param_1); } return (undefined2 *)0x0; } //@@ 00acc7a0 FUN_00acc7a0 undefined1 FUN_00acc7a0(int param_1) { return (&DAT_00c75be2)[param_1]; } //@@ 00acc7c0 FUN_00acc7c0 void FUN_00acc7c0(void) { FUN_00a6c340(); return; } //@@ 00acc7e0 FUN_00acc7e0 void FUN_00acc7e0(undefined4 param_1,undefined4 *param_2,undefined4 *param_3) { if (param_2 != (undefined4 *)0x0) { *param_2 = 0; } if (param_3 != (undefined4 *)0x0) { *param_3 = 0; } return; } //@@ 00acc800 FUN_00acc800 void FUN_00acc800(undefined4 param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4, undefined4 *param_5) { if (param_2 != (undefined4 *)0x0) { *param_2 = 0; } if (param_3 != (undefined4 *)0x0) { *param_3 = 10; } if (param_4 != (undefined4 *)0x0) { *param_4 = 0x780; } if (param_5 != (undefined4 *)0x0) { *param_5 = 0x42e; } return; } //@@ 00acc840 FUN_00acc840 void FUN_00acc840(undefined4 param_1,undefined4 *param_2) { undefined4 *puVar1; puVar1 = (undefined4 *)(*g_glfwAllocate)(0x18,g_glfwAllocatorUser); if (puVar1 == (undefined4 *)0x0) { _glfwInputError(0x10005,0); puVar1 = (undefined4 *)0x0; } else { *puVar1 = 0; puVar1[1] = 0; puVar1[2] = 0; puVar1[3] = 0; *(undefined8 *)(puVar1 + 4) = 0; } *puVar1 = 0x780; puVar1[1] = 0x438; puVar1[2] = 8; puVar1[3] = 8; puVar1[4] = 8; puVar1[5] = 0x3c; *param_2 = 1; return; } //@@ 00acc8b0 FUN_00acc8b0 undefined4 FUN_00acc8b0(undefined4 param_1,undefined4 *param_2) { *param_2 = 0x780; param_2[1] = 0x438; param_2[2] = 8; param_2[3] = 8; param_2[4] = 8; param_2[5] = 0x3c; return 1; } //@@ 00acc8f0 FUN_00acc8f0 undefined4 FUN_00acc8f0(int param_1,undefined4 *param_2) { undefined2 uVar1; uint uVar2; uint uVar3; double dVar4; if (*(int *)(param_1 + 0x1a8) == 0) { FUN_00a6c200(); uVar2 = *(uint *)(param_1 + 0x1a8); uVar3 = 0; if (uVar2 != 0) { do { dVar4 = (double)((float)((double)(int)uVar3 + __uint_to_double_fixup[-((int)uVar3 >> 0x1f)]) / (float)((double)(int)(uVar2 - 1) + __uint_to_double_fixup[-((int)(uVar2 - 1) >> 0x1f)])); libm_sse2_pow_precise(); fminf((float)dVar4 * 65535.0 + 0.5,0x477fff00); uVar1 = FUN_00af0800(); *(undefined2 *)(*(int *)(param_1 + 0x19c) + uVar3 * 2) = uVar1; *(undefined2 *)(*(int *)(param_1 + 0x1a0) + uVar3 * 2) = uVar1; *(undefined2 *)(*(int *)(param_1 + 0x1a4) + uVar3 * 2) = uVar1; uVar3 = uVar3 + 1; uVar2 = *(uint *)(param_1 + 0x1a8); } while (uVar3 < uVar2); } } FUN_00a6c200(); memcpy((void *)*param_2,*(void **)(param_1 + 0x19c),param_2[3] * 2); memcpy((void *)param_2[1],*(void **)(param_1 + 0x1a0),param_2[3] * 2); memcpy((void *)param_2[2],*(void **)(param_1 + 0x1a4),param_2[3] * 2); return 1; } //@@ 00acca40 FUN_00acca40 void FUN_00acca40(int param_1,undefined4 *param_2) { if (*(int *)(param_1 + 0x1a8) == param_2[3]) { memcpy(*(void **)(param_1 + 0x19c),(void *)*param_2,param_2[3] * 2); memcpy(*(void **)(param_1 + 0x1a0),(void *)param_2[1],param_2[3] * 2); memcpy(*(void **)(param_1 + 0x1a4),(void *)param_2[2],param_2[3] * 2); return; } _glfwInputError(); return; } //@@ 00accab0 FUN_00accab0 void FUN_00accab0(byte param_1,byte *param_2,byte *param_3,byte *param_4,char *param_5) { char cVar1; char cVar2; char cVar3; short sVar4; short sVar5; uint uVar6; byte in_CL; uint uVar7; uint in_EDX; cVar1 = param_5[0x20]; cVar2 = param_5[0x41]; sVar4 = *(short *)(param_5 + 0x80); sVar5 = *(short *)(param_5 + 0xa0); cVar3 = param_5[0x21]; uVar6 = (int)*(short *)(param_5 + 0xc0) * (uint)in_CL * 0x101 >> 0x10; uVar7 = (int)(((int)*(short *)(param_5 + 0x60) - (int)*param_5 * (in_EDX & 0xff)) + uVar6) >> 6; uVar7 = (int)-uVar7 >> 0x1f & uVar7; *param_2 = (byte)((int)(0xff - uVar7) >> 0x1f) | (byte)uVar7; uVar7 = (int)(((uVar6 - (uint)param_1 * (int)cVar3) - (in_EDX & 0xff) * (int)cVar1) + (int)sVar4) >> 6; uVar6 = (int)((uVar6 - (uint)param_1 * (int)cVar2) + (int)sVar5) >> 6; uVar7 = (int)-uVar7 >> 0x1f & uVar7; *param_3 = (byte)((int)(0xff - uVar7) >> 0x1f) | (byte)uVar7; uVar6 = (int)-uVar6 >> 0x1f & uVar6; *param_4 = (byte)((int)(0xff - uVar6) >> 0x1f) | (byte)uVar6; return; } //@@ 00accb90 I422ToARGBRow_C /* DB: libyuv row_common.cc: (src_y, src_u, src_v, dst_argb, yuvconstants, width): two pixels per U/V sample using the YuvConstants table (kUVToB/kUVToG/kUVToR/kUVBias/kYToRgb at +0/+0x20/+0x40/+0x60../+0xc0), clamps to 0..255, alpha 0xff, odd tail via YuvPixel (00accab0); default row function loaded with mov ecx,0xaccb90 in libyuv converter 00ab6d00 */ void I422ToARGBRow_C(byte *param_1,byte *param_2,byte *param_3,byte *param_4,char *param_5, uint param_6) { byte bVar1; byte bVar2; char cVar3; char cVar4; char cVar5; byte bVar6; char cVar7; short sVar8; short sVar9; short sVar10; short sVar11; uint uVar12; uint uVar13; int local_1c; if (0 < (int)(param_6 - 1)) { local_1c = (param_6 - 2 >> 1) + 1; do { bVar1 = *param_3; bVar2 = *param_2; cVar3 = param_5[0x20]; cVar4 = param_5[0x21]; cVar5 = param_5[0x41]; sVar8 = *(short *)(param_5 + 0x80); sVar9 = *(short *)(param_5 + 0xa0); uVar12 = (uint)*param_1 * (int)*(short *)(param_5 + 0xc0) * 0x101 >> 0x10; uVar13 = (int)(((int)*(short *)(param_5 + 0x60) - (int)*param_5 * (uint)bVar2) + uVar12) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; *param_4 = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; param_4[3] = 0xff; uVar13 = (int)(((uVar12 - (uint)bVar1 * (int)cVar4) - (uint)bVar2 * (int)cVar3) + (int)sVar8) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[1] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; uVar12 = (int)((uVar12 - (uint)bVar1 * (int)cVar5) + (int)sVar9) >> 6; uVar12 = (int)-uVar12 >> 0x1f & uVar12; param_4[2] = (byte)((int)(0xff - uVar12) >> 0x1f) | (byte)uVar12; bVar1 = *param_3; cVar3 = param_5[0x20]; cVar4 = param_5[0x21]; cVar5 = param_5[0x41]; sVar8 = *(short *)(param_5 + 0x80); sVar9 = *(short *)(param_5 + 0xa0); bVar2 = param_1[1]; sVar10 = *(short *)(param_5 + 0xc0); bVar6 = *param_2; cVar7 = *param_5; sVar11 = *(short *)(param_5 + 0x60); param_4[7] = 0xff; uVar12 = (uint)bVar2 * (int)sVar10 * 0x101 >> 0x10; uVar13 = (int)(((int)sVar11 - (int)cVar7 * (uint)bVar6) + uVar12) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[4] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; param_2 = param_2 + 1; uVar13 = (int)(((uVar12 - (uint)bVar1 * (int)cVar4) - (uint)bVar6 * (int)cVar3) + (int)sVar8) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[5] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; param_1 = param_1 + 2; uVar12 = (int)((uVar12 - (uint)bVar1 * (int)cVar5) + (int)sVar9) >> 6; uVar12 = (int)-uVar12 >> 0x1f & uVar12; param_4[6] = (byte)((int)(0xff - uVar12) >> 0x1f) | (byte)uVar12; param_3 = param_3 + 1; param_4 = param_4 + 8; local_1c = local_1c + -1; } while (local_1c != 0); } if ((param_6 & 1) != 0) { FUN_00accab0(*param_3,param_4,param_4 + 1,param_4 + 2,param_5); param_4[3] = 0xff; } return; } //@@ 00accdd0 I422ToRGB24Row_C /* DB: libyuv row_common.cc: same YuvPixel (0xaccab0)/yuvconstants pattern as I422ToRGBARow_C but writes 3 bytes per pixel (param_4[0..5] per pair); row fn pointer of the matrix converter at 0xab6bcf/0xab6c45 */ void I422ToRGB24Row_C(byte *param_1,byte *param_2,byte *param_3,byte *param_4,char *param_5, uint param_6) { byte bVar1; byte bVar2; char cVar3; char cVar4; char cVar5; short sVar6; short sVar7; uint uVar8; uint uVar9; int local_1c; if (0 < (int)(param_6 - 1)) { local_1c = (param_6 - 2 >> 1) + 1; do { bVar1 = *param_3; bVar2 = *param_2; cVar3 = param_5[0x20]; cVar4 = param_5[0x21]; cVar5 = param_5[0x41]; sVar6 = *(short *)(param_5 + 0x80); sVar7 = *(short *)(param_5 + 0xa0); uVar8 = (uint)*param_1 * (int)*(short *)(param_5 + 0xc0) * 0x101 >> 0x10; uVar9 = (int)(((int)*(short *)(param_5 + 0x60) - (int)*param_5 * (uint)bVar2) + uVar8) >> 6; uVar9 = (int)-uVar9 >> 0x1f & uVar9; *param_4 = (byte)((int)(0xff - uVar9) >> 0x1f) | (byte)uVar9; uVar9 = (int)(((uVar8 - (uint)bVar1 * (int)cVar4) - (uint)bVar2 * (int)cVar3) + (int)sVar6) >> 6; uVar9 = (int)-uVar9 >> 0x1f & uVar9; param_4[1] = (byte)((int)(0xff - uVar9) >> 0x1f) | (byte)uVar9; uVar8 = (int)((uVar8 - (uint)bVar1 * (int)cVar5) + (int)sVar7) >> 6; uVar8 = (int)-uVar8 >> 0x1f & uVar8; param_4[2] = (byte)((int)(0xff - uVar8) >> 0x1f) | (byte)uVar8; bVar1 = *param_3; cVar3 = param_5[0x20]; cVar4 = param_5[0x21]; cVar5 = param_5[0x41]; sVar6 = *(short *)(param_5 + 0x80); sVar7 = *(short *)(param_5 + 0xa0); bVar2 = *param_2; uVar8 = (uint)param_1[1] * (int)*(short *)(param_5 + 0xc0) * 0x101 >> 0x10; uVar9 = (int)(((int)*(short *)(param_5 + 0x60) - (int)*param_5 * (uint)bVar2) + uVar8) >> 6; uVar9 = (int)-uVar9 >> 0x1f & uVar9; param_4[3] = (byte)((int)(0xff - uVar9) >> 0x1f) | (byte)uVar9; param_2 = param_2 + 1; uVar9 = (int)(((uVar8 - (uint)bVar1 * (int)cVar4) - (uint)bVar2 * (int)cVar3) + (int)sVar6) >> 6; uVar9 = (int)-uVar9 >> 0x1f & uVar9; param_4[4] = (byte)((int)(0xff - uVar9) >> 0x1f) | (byte)uVar9; param_1 = param_1 + 2; uVar8 = (int)((uVar8 - (uint)bVar1 * (int)cVar5) + (int)sVar7) >> 6; uVar8 = (int)-uVar8 >> 0x1f & uVar8; param_4[5] = (byte)((int)(0xff - uVar8) >> 0x1f) | (byte)uVar8; param_4 = param_4 + 6; param_3 = param_3 + 1; local_1c = local_1c + -1; } while (local_1c != 0); } if ((param_6 & 1) != 0) { FUN_00accab0(*param_3,param_4,param_4 + 1,param_4 + 2,param_5); } return; } //@@ 00acd000 I422ToRGBARow_C /* DB: libyuv row_common.cc: default row fn of I420ToRGBAMatrix (0xab6a80, overridden by SSSE3 0x40 / AVX2 0x400 CPU-flag variants); per 2 pixels writes A=0xff at [0] then B,G,R via YuvPixel (0xaccab0) with yuvconstants offsets 0x20/0x21/0x41/0x80/0xa0/0xc0 */ void I422ToRGBARow_C(byte *param_1,byte *param_2,byte *param_3,undefined1 *param_4,char *param_5, uint param_6) { byte bVar1; byte bVar2; byte bVar3; char cVar4; char cVar5; char cVar6; char cVar7; short sVar8; short sVar9; short sVar10; short sVar11; uint uVar12; uint uVar13; int local_1c; if (0 < (int)(param_6 - 1)) { local_1c = (param_6 - 2 >> 1) + 1; do { bVar1 = *param_3; bVar2 = *param_1; bVar3 = *param_2; cVar4 = param_5[0x20]; cVar5 = param_5[0x21]; cVar6 = param_5[0x41]; sVar8 = *(short *)(param_5 + 0x80); sVar9 = *(short *)(param_5 + 0xa0); sVar10 = *(short *)(param_5 + 0xc0); cVar7 = *param_5; sVar11 = *(short *)(param_5 + 0x60); *param_4 = 0xff; uVar12 = (uint)bVar2 * (int)sVar10 * 0x101 >> 0x10; uVar13 = (int)(((int)sVar11 - (int)cVar7 * (uint)bVar3) + uVar12) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[1] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; uVar13 = (int)(((uVar12 - (uint)bVar1 * (int)cVar5) - (uint)bVar3 * (int)cVar4) + (int)sVar8) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[2] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; uVar12 = (int)((uVar12 - (uint)bVar1 * (int)cVar6) + (int)sVar9) >> 6; uVar12 = (int)-uVar12 >> 0x1f & uVar12; param_4[3] = (byte)((int)(0xff - uVar12) >> 0x1f) | (byte)uVar12; bVar1 = *param_3; cVar4 = param_5[0x20]; cVar5 = param_5[0x21]; cVar6 = param_5[0x41]; sVar8 = *(short *)(param_5 + 0x80); sVar9 = *(short *)(param_5 + 0xa0); bVar2 = param_1[1]; sVar10 = *(short *)(param_5 + 0xc0); bVar3 = *param_2; cVar7 = *param_5; sVar11 = *(short *)(param_5 + 0x60); param_4[4] = 0xff; uVar12 = (uint)bVar2 * (int)sVar10 * 0x101 >> 0x10; uVar13 = (int)(((int)sVar11 - (int)cVar7 * (uint)bVar3) + uVar12) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[5] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; param_2 = param_2 + 1; uVar13 = (int)(((uVar12 - (uint)bVar1 * (int)cVar5) - (uint)bVar3 * (int)cVar4) + (int)sVar8) >> 6; uVar13 = (int)-uVar13 >> 0x1f & uVar13; param_4[6] = (byte)((int)(0xff - uVar13) >> 0x1f) | (byte)uVar13; param_1 = param_1 + 2; uVar12 = (int)((uVar12 - (uint)bVar1 * (int)cVar6) + (int)sVar9) >> 6; uVar12 = (int)-uVar12 >> 0x1f & uVar12; param_4[7] = (byte)((int)(0xff - uVar12) >> 0x1f) | (byte)uVar12; param_3 = param_3 + 1; param_4 = param_4 + 8; local_1c = local_1c + -1; } while (local_1c != 0); } if ((param_6 & 1) != 0) { FUN_00accab0(*param_3,param_4 + 1,param_4 + 2,param_4 + 3,param_5); *param_4 = 0xff; } return; } //@@ 00acd240 FUN_00acd240 /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ void FUN_00acd240(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; undefined1 local_2020 [8188]; undefined4 uStack_24; uStack_24 = 0xacd250; if (0 < (int)param_6) { do { uVar1 = param_6; if (0x800 < param_6) { uVar1 = 0x800; } FUN_00acdad0(param_1,param_2,param_3,local_2020,param_5,uVar1); FUN_00acda40(local_2020,param_4,uVar1); param_1 = param_1 + uVar1; param_6 = param_6 - uVar1; param_2 = param_2 + (uVar1 >> 1); param_3 = param_3 + (uVar1 >> 1); param_4 = param_4 + uVar1 * 3; } while (0 < (int)param_6); } return; } //@@ 00acd2c0 FUN_00acd2c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00acd2c0(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; uint uVar2; int local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; undefined1 local_140 [63]; undefined1 auStack_101 [64]; undefined1 auStack_c1 [65]; undefined1 local_80 [92]; uint local_24; local_24 = __security_cookie ^ (uint)&local_158; local_158 = param_1; local_154 = param_2; local_150 = param_3; local_14c = param_4; memset(local_140,0,0xc0); uVar2 = param_6 & 7; uVar1 = param_6 & 0xfffffff8; local_148 = uVar2; local_144 = uVar1; if (0 < (int)uVar1) { FUN_00acddb0(local_158,local_154,local_150,local_14c,param_5,uVar1); } memcpy(local_140,(void *)(local_158 + uVar1),uVar2); uVar2 = uVar2 + 1 >> 1; memcpy(auStack_101 + 1,(void *)(local_154 + ((int)uVar1 >> 1)),uVar2); memcpy(auStack_c1 + 1,(void *)(local_150 + ((int)uVar1 >> 1)),uVar2); if ((param_6 & 1) != 0) { auStack_101[uVar2 + 1] = auStack_101[uVar2]; auStack_c1[uVar2 + 1] = auStack_c1[uVar2]; } FUN_00acddb0(local_140,auStack_101 + 1,auStack_c1 + 1,local_80,param_5,8); memcpy((void *)(local_14c + local_144 * 4),local_80,local_148 << 2); return; } //@@ 00acd400 FUN_00acd400 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00acd400(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; uint uVar2; int local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; undefined1 local_140 [63]; undefined1 auStack_101 [64]; undefined1 auStack_c1 [65]; undefined1 local_80 [92]; uint local_24; local_24 = __security_cookie ^ (uint)&local_158; local_158 = param_1; local_154 = param_2; local_150 = param_3; local_14c = param_4; memset(local_140,0,0xc0); uVar2 = param_6 & 7; uVar1 = param_6 & 0xfffffff8; local_148 = uVar2; local_144 = uVar1; if (0 < (int)uVar1) { FUN_00acde90(local_158,local_154,local_150,local_14c,param_5,uVar1); } memcpy(local_140,(void *)(local_158 + uVar1),uVar2); uVar2 = uVar2 + 1 >> 1; memcpy(auStack_101 + 1,(void *)(local_154 + ((int)uVar1 >> 1)),uVar2); memcpy(auStack_c1 + 1,(void *)(local_150 + ((int)uVar1 >> 1)),uVar2); if ((param_6 & 1) != 0) { auStack_101[uVar2 + 1] = auStack_101[uVar2]; auStack_c1[uVar2 + 1] = auStack_c1[uVar2]; } FUN_00acde90(local_140,auStack_101 + 1,auStack_c1 + 1,local_80,param_5,8); memcpy((void *)(local_14c + local_144 * 4),local_80,local_148 << 2); return; } //@@ 00acd540 FUN_00acd540 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00acd540(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; uint uVar2; int local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; undefined1 local_140 [63]; undefined1 auStack_101 [64]; undefined1 auStack_c1 [65]; undefined1 local_80 [92]; uint local_24; local_24 = __security_cookie ^ (uint)&local_158; local_158 = param_1; local_154 = param_2; local_150 = param_3; local_14c = param_4; memset(local_140,0,0xc0); uVar2 = param_6 & 7; uVar1 = param_6 & 0xfffffff8; local_148 = uVar2; local_144 = uVar1; if (0 < (int)uVar1) { FUN_00acdcb0(local_158,local_154,local_150,local_14c,param_5,uVar1); } memcpy(local_140,(void *)(local_158 + uVar1),uVar2); uVar2 = uVar2 + 1 >> 1; memcpy(auStack_101 + 1,(void *)(local_154 + ((int)uVar1 >> 1)),uVar2); memcpy(auStack_c1 + 1,(void *)(local_150 + ((int)uVar1 >> 1)),uVar2); if ((param_6 & 1) != 0) { auStack_101[uVar2 + 1] = auStack_101[uVar2]; auStack_c1[uVar2 + 1] = auStack_c1[uVar2]; } FUN_00acdcb0(local_140,auStack_101 + 1,auStack_c1 + 1,local_80,param_5,8); memcpy((void *)(local_14c + local_144 * 3),local_80,local_148 * 3); return; } //@@ 00acd680 FUN_00acd680 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00acd680(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; uint uVar2; int local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; undefined1 local_140 [63]; undefined1 auStack_101 [64]; undefined1 auStack_c1 [65]; undefined1 local_80 [92]; uint local_24; local_24 = __security_cookie ^ (uint)&local_158; local_158 = param_1; local_154 = param_2; local_150 = param_3; local_14c = param_4; memset(local_140,0,0xc0); uVar2 = param_6 & 0xf; uVar1 = param_6 & 0xfffffff0; local_148 = uVar2; local_144 = uVar1; if (0 < (int)uVar1) { FUN_00acd240(local_158,local_154,local_150,local_14c,param_5,uVar1); } memcpy(local_140,(void *)(local_158 + uVar1),uVar2); uVar2 = uVar2 + 1 >> 1; memcpy(auStack_101 + 1,(void *)(local_154 + ((int)uVar1 >> 1)),uVar2); memcpy(auStack_c1 + 1,(void *)(local_150 + ((int)uVar1 >> 1)),uVar2); if ((param_6 & 1) != 0) { auStack_101[uVar2 + 1] = auStack_101[uVar2]; auStack_c1[uVar2 + 1] = auStack_c1[uVar2]; } FUN_00acd240(local_140,auStack_101 + 1,auStack_c1 + 1,local_80,param_5,0x10); memcpy((void *)(local_14c + local_144 * 3),local_80,local_148 * 3); return; } //@@ 00acd7c0 FUN_00acd7c0 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00acd7c0(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; uint uVar2; int local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; undefined1 local_140 [63]; undefined1 auStack_101 [64]; undefined1 auStack_c1 [65]; undefined1 local_80 [92]; uint local_24; local_24 = __security_cookie ^ (uint)&local_158; local_158 = param_1; local_154 = param_2; local_150 = param_3; local_14c = param_4; memset(local_140,0,0xc0); uVar2 = param_6 & 0xf; uVar1 = param_6 & 0xfffffff0; local_148 = uVar2; local_144 = uVar1; if (0 < (int)uVar1) { FUN_00acdad0(local_158,local_154,local_150,local_14c,param_5,uVar1); } memcpy(local_140,(void *)(local_158 + uVar1),uVar2); uVar2 = uVar2 + 1 >> 1; memcpy(auStack_101 + 1,(void *)(local_154 + ((int)uVar1 >> 1)),uVar2); memcpy(auStack_c1 + 1,(void *)(local_150 + ((int)uVar1 >> 1)),uVar2); if ((param_6 & 1) != 0) { auStack_101[uVar2 + 1] = auStack_101[uVar2]; auStack_c1[uVar2 + 1] = auStack_c1[uVar2]; } FUN_00acdad0(local_140,auStack_101 + 1,auStack_c1 + 1,local_80,param_5,0x10); memcpy((void *)(local_14c + local_144 * 4),local_80,local_148 << 2); return; } //@@ 00acd900 FUN_00acd900 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ void FUN_00acd900(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,uint param_6) { uint uVar1; uint uVar2; int local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; undefined1 local_140 [63]; undefined1 auStack_101 [64]; undefined1 auStack_c1 [65]; undefined1 local_80 [92]; uint local_24; local_24 = __security_cookie ^ (uint)&local_158; local_158 = param_1; local_154 = param_2; local_150 = param_3; local_14c = param_4; memset(local_140,0,0xc0); uVar2 = param_6 & 0xf; uVar1 = param_6 & 0xfffffff0; local_148 = uVar2; local_144 = uVar1; if (0 < (int)uVar1) { FUN_00acdbc0(local_158,local_154,local_150,local_14c,param_5,uVar1); } memcpy(local_140,(void *)(local_158 + uVar1),uVar2); uVar2 = uVar2 + 1 >> 1; memcpy(auStack_101 + 1,(void *)(local_154 + ((int)uVar1 >> 1)),uVar2); memcpy(auStack_c1 + 1,(void *)(local_150 + ((int)uVar1 >> 1)),uVar2); if ((param_6 & 1) != 0) { auStack_101[uVar2 + 1] = auStack_101[uVar2]; auStack_c1[uVar2 + 1] = auStack_c1[uVar2]; } FUN_00acdbc0(local_140,auStack_101 + 1,auStack_c1 + 1,local_80,param_5,0x10); memcpy((void *)(local_14c + local_144 * 4),local_80,local_148 << 2); return; } //@@ 00acda40 FUN_00acda40 /* WARNING: Removing unreachable block (ram,0x00acdaa6) */ /* WARNING: Removing unreachable block (ram,0x00acda87) */ /* WARNING: Removing unreachable block (ram,0x00acda94) */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00acda40(undefined1 (*param_1) [16],undefined1 (*param_2) [16],int param_3) { undefined1 (*pauVar1) [16]; undefined1 (*pauVar2) [16]; undefined1 (*pauVar3) [16]; undefined1 auVar4 [16]; bool bVar5; undefined1 auVar6 [16]; undefined1 auVar7 [16]; int iVar8; undefined1 auVar9 [16]; undefined1 auVar10 [16]; undefined1 auVar11 [16]; undefined1 auVar12 [16]; auVar7 = _DAT_00b5eef0; do { auVar4 = *param_1; pauVar1 = param_1 + 1; pauVar2 = param_1 + 2; pauVar3 = param_1 + 3; param_1 = param_1 + 4; auVar9 = pshufb(auVar4,auVar7); auVar10 = pshufb(*pauVar1,auVar7); auVar11 = pshufb(*pauVar2,auVar7); auVar12 = pshufb(*pauVar3,auVar7); auVar4._8_8_ = 0; auVar4._0_8_ = auVar10._0_8_ << 0x20; auVar6._8_8_ = 0; auVar6._0_8_ = auVar11._0_8_; *param_2 = auVar9 | auVar4 << 0x40; auVar9._0_8_ = auVar12._0_8_ << 0x20; auVar9._8_8_ = auVar12._8_8_ << 0x20 | auVar12._0_8_ >> 0x20; param_2[1] = auVar10 >> 0x20 | auVar6 << 0x40; param_2[2] = auVar11 >> 0x40 | auVar9; param_2 = param_2 + 3; iVar8 = param_3 + -0x10; bVar5 = 0xf < param_3; param_3 = iVar8; } while (iVar8 != 0 && bVar5); return; } //@@ 00acdad0 FUN_00acdad0 void FUN_00acdad0(undefined1 (*param_1) [16],ulonglong *param_2,int param_3, undefined1 (*param_4) [32],undefined1 (*param_5) [32],int param_6) { ulonglong *puVar1; ulonglong uVar2; bool bVar3; undefined1 auVar4 [32]; undefined1 auVar5 [32]; undefined1 auVar6 [32]; int iVar7; undefined1 auVar8 [32]; undefined1 auVar9 [32]; undefined1 auVar10 [32]; undefined1 in_ZMM5 [64]; param_3 = param_3 - (int)param_2; auVar4 = vpcmpeqb_avx2(in_ZMM5._0_32_,in_ZMM5._0_32_); do { uVar2 = *param_2; puVar1 = (ulonglong *)((int)param_2 + param_3); param_2 = param_2 + 1; auVar8 = vpunpcklbw_avx2(ZEXT832(uVar2),ZEXT832(*puVar1)); auVar8 = vpermq_avx2(auVar8,0xd8); auVar10 = vpunpcklwd_avx2(auVar8,auVar8); auVar8 = vpermq_avx2(ZEXT1632(*param_1),0xd8); auVar6 = vpunpcklbw_avx2(auVar8,auVar8); param_1 = param_1 + 1; auVar8 = vpmaddubsw_avx2(auVar10,param_5[2]); auVar9 = vpmaddubsw_avx2(auVar10,param_5[1]); auVar10 = vpmaddubsw_avx2(auVar10,*param_5); auVar5 = vpsubw_avx2(param_5[5],auVar8); auVar9 = vpsubw_avx2(param_5[4],auVar9); auVar8 = vpsubw_avx2(param_5[3],auVar10); auVar10 = vpmulhuw_avx2(auVar6,param_5[6]); auVar8 = vpaddsw_avx2(auVar8,auVar10); auVar9 = vpaddsw_avx2(auVar9,auVar10); auVar10 = vpaddsw_avx2(auVar5,auVar10); auVar8 = vpsraw_avx2(auVar8,6); auVar9 = vpsraw_avx2(auVar9,6); auVar10 = vpsraw_avx2(auVar10,6); auVar8 = vpackuswb_avx2(auVar8,auVar8); auVar9 = vpackuswb_avx2(auVar9,auVar9); auVar10 = vpackuswb_avx2(auVar10,auVar10); auVar8 = vpunpcklbw_avx2(auVar8,auVar9); auVar5 = vpermq_avx2(auVar8,0xd8); auVar8 = vpunpcklbw_avx2(auVar10,auVar4); auVar8 = vpermq_avx2(auVar8,0xd8); auVar9 = vpunpcklwd_avx2(auVar5,auVar8); auVar8 = vpunpckhwd_avx2(auVar5,auVar8); *param_4 = auVar9; param_4[1] = auVar8; param_4 = param_4 + 2; iVar7 = param_6 + -0x10; bVar3 = 0xf < param_6; param_6 = iVar7; } while (iVar7 != 0 && bVar3); return; } //@@ 00acdbc0 FUN_00acdbc0 void FUN_00acdbc0(undefined1 (*param_1) [16],ulonglong *param_2,int param_3, undefined1 (*param_4) [32],undefined1 (*param_5) [32],int param_6) { ulonglong *puVar1; ulonglong uVar2; bool bVar3; undefined1 auVar4 [32]; undefined1 auVar5 [32]; undefined1 auVar6 [32]; int iVar7; undefined1 auVar8 [32]; undefined1 auVar9 [32]; undefined1 auVar10 [32]; undefined1 in_ZMM5 [64]; param_3 = param_3 - (int)param_2; auVar4 = vpcmpeqb_avx2(in_ZMM5._0_32_,in_ZMM5._0_32_); do { uVar2 = *param_2; puVar1 = (ulonglong *)((int)param_2 + param_3); param_2 = param_2 + 1; auVar8 = vpunpcklbw_avx2(ZEXT832(uVar2),ZEXT832(*puVar1)); auVar8 = vpermq_avx2(auVar8,0xd8); auVar10 = vpunpcklwd_avx2(auVar8,auVar8); auVar8 = vpermq_avx2(ZEXT1632(*param_1),0xd8); auVar6 = vpunpcklbw_avx2(auVar8,auVar8); param_1 = param_1 + 1; auVar8 = vpmaddubsw_avx2(auVar10,param_5[2]); auVar9 = vpmaddubsw_avx2(auVar10,param_5[1]); auVar10 = vpmaddubsw_avx2(auVar10,*param_5); auVar5 = vpsubw_avx2(param_5[5],auVar8); auVar9 = vpsubw_avx2(param_5[4],auVar9); auVar8 = vpsubw_avx2(param_5[3],auVar10); auVar10 = vpmulhuw_avx2(auVar6,param_5[6]); auVar8 = vpaddsw_avx2(auVar8,auVar10); auVar9 = vpaddsw_avx2(auVar9,auVar10); auVar10 = vpaddsw_avx2(auVar5,auVar10); auVar8 = vpsraw_avx2(auVar8,6); auVar9 = vpsraw_avx2(auVar9,6); auVar10 = vpsraw_avx2(auVar10,6); auVar8 = vpackuswb_avx2(auVar8,auVar8); auVar9 = vpackuswb_avx2(auVar9,auVar9); auVar10 = vpackuswb_avx2(auVar10,auVar10); auVar9 = vpunpcklbw_avx2(auVar9,auVar10); auVar10 = vpermq_avx2(auVar9,0xd8); auVar8 = vpunpcklbw_avx2(auVar4,auVar8); auVar8 = vpermq_avx2(auVar8,0xd8); auVar9 = vpunpcklwd_avx2(auVar8,auVar10); auVar8 = vpunpckhwd_avx2(auVar8,auVar10); *param_4 = auVar9; param_4[1] = auVar8; param_4 = param_4 + 2; iVar7 = param_6 + -0x10; bVar3 = 0xf < param_6; param_6 = iVar7; } while (iVar7 != 0 && bVar3); return; } //@@ 00acdcb0 FUN_00acdcb0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00acdcb0(ulonglong *param_1,undefined4 *param_2,int param_3,undefined8 *param_4, undefined1 (*param_5) [16],int param_6) { ulonglong uVar1; undefined4 uVar2; undefined4 uVar3; bool bVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; short sVar11; short sVar12; short sVar13; short sVar14; short sVar15; short sVar16; short sVar17; short sVar18; short sVar19; short sVar20; char cVar21; char cVar29; char cVar28; char cVar27; char cVar26; char cVar25; char cVar24; char cVar23; char cVar22; undefined1 auVar30 [32]; undefined8 uVar31; undefined6 uVar32; undefined1 auVar33 [14]; undefined1 auVar34 [12]; unkbyte10 Var35; undefined1 auVar36 [14]; undefined1 auVar37 [12]; unkbyte10 Var38; unkbyte9 Var39; unkbyte9 Var40; undefined6 uVar41; undefined1 auVar42 [16]; undefined1 auVar43 [16]; int iVar44; undefined2 uVar52; undefined1 auVar45 [16]; undefined1 auVar46 [16]; undefined1 auVar47 [16]; undefined1 auVar51 [16]; undefined1 auVar50 [16]; undefined1 auVar49 [16]; undefined1 auVar48 [16]; undefined1 auVar53 [16]; undefined1 auVar54 [16]; undefined1 auVar55 [16]; undefined1 auVar56 [16]; undefined1 auVar57 [16]; undefined1 uVar67; undefined1 auVar65 [16]; undefined1 auVar64 [16]; undefined1 auVar63 [16]; undefined1 auVar62 [16]; undefined1 auVar61 [16]; undefined1 auVar60 [16]; undefined1 auVar59 [16]; undefined1 auVar58 [16]; undefined1 auVar66 [16]; auVar43 = _DAT_00b5ef60; auVar42 = _DAT_00b5eef0; param_3 = param_3 - (int)param_2; do { uVar2 = *param_2; uVar3 = *(undefined4 *)((int)param_2 + param_3); param_2 = param_2 + 1; uVar52 = CONCAT11((char)((uint)uVar3 >> 0x18),(char)((uint)uVar2 >> 0x18)); uVar31 = CONCAT35(CONCAT21(uVar52,(char)((uint)uVar3 >> 0x10)), CONCAT14((char)((uint)uVar2 >> 0x10),uVar2)); uVar32 = CONCAT51(CONCAT41((int)((ulonglong)uVar31 >> 0x20),(char)((uint)uVar3 >> 8)), (char)((uint)uVar2 >> 8)); auVar57._0_2_ = CONCAT11((char)uVar3,(char)uVar2); uVar1 = CONCAT62(uVar32,auVar57._0_2_); auVar45._8_4_ = 0; auVar45._0_8_ = uVar1; auVar45._12_2_ = uVar52; auVar45._14_2_ = uVar52; uVar52 = (undefined2)((ulonglong)uVar31 >> 0x20); auVar66._12_4_ = auVar45._12_4_; auVar66._8_2_ = 0; auVar66._0_8_ = uVar1; auVar66._10_2_ = uVar52; auVar53._10_6_ = auVar66._10_6_; auVar53._8_2_ = uVar52; auVar53._0_8_ = uVar1; uVar52 = (undefined2)uVar32; auVar57._8_8_ = auVar53._8_8_; auVar57._6_2_ = uVar52; auVar57._4_2_ = uVar52; auVar57._2_2_ = auVar57._0_2_; uVar1 = *param_1; uVar67 = (undefined1)(uVar1 >> 0x38); auVar65._8_6_ = 0; auVar65._0_8_ = uVar1; auVar65[0xe] = uVar67; auVar65[0xf] = uVar67; uVar67 = (undefined1)(uVar1 >> 0x30); auVar64._14_2_ = auVar65._14_2_; auVar64._8_5_ = 0; auVar64._0_8_ = uVar1; auVar64[0xd] = uVar67; auVar63._13_3_ = auVar64._13_3_; auVar63._8_4_ = 0; auVar63._0_8_ = uVar1; auVar63[0xc] = uVar67; uVar67 = (undefined1)(uVar1 >> 0x28); auVar62._12_4_ = auVar63._12_4_; auVar62._8_3_ = 0; auVar62._0_8_ = uVar1; auVar62[0xb] = uVar67; auVar61._11_5_ = auVar62._11_5_; auVar61._8_2_ = 0; auVar61._0_8_ = uVar1; auVar61[10] = uVar67; uVar67 = (undefined1)(uVar1 >> 0x20); auVar60._10_6_ = auVar61._10_6_; auVar60[8] = 0; auVar60._0_8_ = uVar1; auVar60[9] = uVar67; auVar59._9_7_ = auVar60._9_7_; auVar59[8] = uVar67; auVar59._0_8_ = uVar1; uVar67 = (undefined1)(uVar1 >> 0x18); auVar58._8_8_ = auVar59._8_8_; auVar58[7] = uVar67; auVar58[6] = uVar67; uVar67 = (undefined1)(uVar1 >> 0x10); auVar58[5] = uVar67; auVar58[4] = uVar67; uVar67 = (undefined1)(uVar1 >> 8); auVar58[3] = uVar67; auVar58[2] = uVar67; auVar58[0] = (undefined1)uVar1; auVar58[1] = auVar58[0]; param_1 = param_1 + 1; auVar53 = pmaddubsw(auVar57,*param_5); auVar46._0_2_ = *(short *)param_5[6] - auVar53._0_2_; auVar46._2_2_ = *(short *)(param_5[6] + 2) - auVar53._2_2_; auVar46._4_2_ = *(short *)(param_5[6] + 4) - auVar53._4_2_; auVar46._6_2_ = *(short *)(param_5[6] + 6) - auVar53._6_2_; auVar46._8_2_ = *(short *)(param_5[6] + 8) - auVar53._8_2_; auVar46._10_2_ = *(short *)(param_5[6] + 10) - auVar53._10_2_; auVar46._12_2_ = *(short *)(param_5[6] + 0xc) - auVar53._12_2_; auVar46._14_2_ = *(short *)(param_5[6] + 0xe) - auVar53._14_2_; auVar53 = pmaddubsw(auVar57,param_5[2]); auVar54._0_2_ = *(short *)param_5[8] - auVar53._0_2_; auVar54._2_2_ = *(short *)(param_5[8] + 2) - auVar53._2_2_; auVar54._4_2_ = *(short *)(param_5[8] + 4) - auVar53._4_2_; auVar54._6_2_ = *(short *)(param_5[8] + 6) - auVar53._6_2_; auVar54._8_2_ = *(short *)(param_5[8] + 8) - auVar53._8_2_; auVar54._10_2_ = *(short *)(param_5[8] + 10) - auVar53._10_2_; auVar54._12_2_ = *(short *)(param_5[8] + 0xc) - auVar53._12_2_; auVar54._14_2_ = *(short *)(param_5[8] + 0xe) - auVar53._14_2_; auVar57 = pmaddubsw(auVar57,param_5[4]); auVar56._0_2_ = *(short *)param_5[10] - auVar57._0_2_; auVar56._2_2_ = *(short *)(param_5[10] + 2) - auVar57._2_2_; auVar56._4_2_ = *(short *)(param_5[10] + 4) - auVar57._4_2_; auVar56._6_2_ = *(short *)(param_5[10] + 6) - auVar57._6_2_; auVar56._8_2_ = *(short *)(param_5[10] + 8) - auVar57._8_2_; auVar56._10_2_ = *(short *)(param_5[10] + 10) - auVar57._10_2_; auVar56._12_2_ = *(short *)(param_5[10] + 0xc) - auVar57._12_2_; auVar56._14_2_ = *(short *)(param_5[10] + 0xe) - auVar57._14_2_; auVar66 = pmulhuw(auVar58,param_5[0xc]); auVar57 = paddsw(auVar46,auVar66); auVar53 = paddsw(auVar54,auVar66); auVar66 = paddsw(auVar56,auVar66); auVar57 = psraw(auVar57,6); auVar53 = psraw(auVar53,6); auVar66 = psraw(auVar66,6); sVar5 = auVar57._0_2_; sVar8 = auVar57._2_2_; sVar10 = auVar57._4_2_; sVar12 = auVar57._6_2_; sVar14 = auVar57._8_2_; sVar16 = auVar57._10_2_; sVar18 = auVar57._12_2_; sVar6 = auVar57._14_2_; cVar21 = (0 < sVar6) * (sVar6 < 0x100) * auVar57[0xe] - (0xff < sVar6); sVar6 = auVar53._0_2_; sVar9 = auVar53._2_2_; sVar11 = auVar53._4_2_; sVar13 = auVar53._6_2_; sVar15 = auVar53._8_2_; sVar17 = auVar53._10_2_; sVar19 = auVar53._12_2_; sVar20 = auVar53._14_2_; sVar7 = auVar66._0_2_; cVar22 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[0] - (0xff < sVar7); sVar7 = auVar66._2_2_; cVar23 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[2] - (0xff < sVar7); sVar7 = auVar66._4_2_; cVar24 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[4] - (0xff < sVar7); sVar7 = auVar66._6_2_; cVar25 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[6] - (0xff < sVar7); sVar7 = auVar66._8_2_; cVar26 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[8] - (0xff < sVar7); sVar7 = auVar66._10_2_; cVar27 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[10] - (0xff < sVar7); sVar7 = auVar66._12_2_; cVar28 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[0xc] - (0xff < sVar7); sVar7 = auVar66._14_2_; cVar29 = (0 < sVar7) * (sVar7 < 0x100) * auVar66[0xe] - (0xff < sVar7); uVar52 = CONCAT11((0 < sVar20) * (sVar20 < 0x100) * auVar53[0xe] - (0xff < sVar20),cVar21); uVar2 = CONCAT31(CONCAT21(uVar52,(0 < sVar19) * (sVar19 < 0x100) * auVar53[0xc] - (0xff < sVar19)), (0 < sVar18) * (sVar18 < 0x100) * auVar57[0xc] - (0xff < sVar18)); uVar32 = CONCAT51(CONCAT41(uVar2,(0 < sVar17) * (sVar17 < 0x100) * auVar53[10] - (0xff < sVar17) ),(0 < sVar16) * (sVar16 < 0x100) * auVar57[10] - (0xff < sVar16)); Var39 = CONCAT72(CONCAT61(uVar32,(0 < sVar15) * (sVar15 < 0x100) * auVar53[8] - (0xff < sVar15)) ,CONCAT11((0 < sVar14) * (sVar14 < 0x100) * auVar57[8] - (0xff < sVar14),cVar21 )); Var35 = CONCAT91(CONCAT81((longlong)((unkuint9)Var39 >> 8), (0 < sVar13) * (sVar13 < 0x100) * auVar53[6] - (0xff < sVar13)), (0 < sVar12) * (sVar12 < 0x100) * auVar57[6] - (0xff < sVar12)); auVar34._2_10_ = Var35; auVar34[1] = (0 < sVar11) * (sVar11 < 0x100) * auVar53[4] - (0xff < sVar11); auVar34[0] = (0 < sVar10) * (sVar10 < 0x100) * auVar57[4] - (0xff < sVar10); auVar33._2_12_ = auVar34; auVar33[1] = (0 < sVar9) * (sVar9 < 0x100) * auVar53[2] - (0xff < sVar9); auVar33[0] = (0 < sVar8) * (sVar8 < 0x100) * auVar57[2] - (0xff < sVar8); auVar47._0_2_ = CONCAT11((0 < sVar6) * (sVar6 < 0x100) * auVar53[0] - (0xff < sVar6), (0 < sVar5) * (sVar5 < 0x100) * auVar57[0] - (0xff < sVar5)); auVar47._2_14_ = auVar33; uVar3 = CONCAT31(CONCAT21(CONCAT11(cVar29,cVar29),cVar28),cVar28); uVar41 = CONCAT51(CONCAT41(uVar3,cVar27),cVar27); Var40 = CONCAT72(CONCAT61(uVar41,cVar26),CONCAT11(cVar26,cVar29)); Var38 = CONCAT91(CONCAT81((longlong)((unkuint9)Var40 >> 8),cVar25),cVar25); auVar37._2_10_ = Var38; auVar37[1] = cVar24; auVar37[0] = cVar24; auVar36._2_12_ = auVar37; auVar36[1] = cVar23; auVar36[0] = cVar23; auVar48[3] = cVar22; auVar48[2] = cVar22; auVar51._0_12_ = auVar47._0_12_; auVar51._12_2_ = (short)Var35; auVar51._14_2_ = (short)Var38; auVar50._12_4_ = auVar51._12_4_; auVar50._0_10_ = auVar47._0_10_; auVar50._10_2_ = auVar37._0_2_; auVar49._10_6_ = auVar50._10_6_; auVar49._0_8_ = auVar47._0_8_; auVar49._8_2_ = auVar34._0_2_; auVar48._8_8_ = auVar49._8_8_; auVar48._6_2_ = auVar36._0_2_; auVar48._4_2_ = auVar33._0_2_; auVar48._0_2_ = auVar47._0_2_; auVar55._2_2_ = (short)((unkuint9)Var40 >> 8); auVar55._0_2_ = (short)((unkuint9)Var39 >> 8); auVar55._4_2_ = (short)uVar32; auVar55._6_2_ = (short)uVar41; auVar55._8_2_ = (short)uVar2; auVar55._10_2_ = (short)uVar3; auVar55._12_2_ = uVar52; auVar55._14_2_ = CONCAT11(cVar29,cVar29); auVar57 = pshufb(auVar48,auVar43); auVar53 = pshufb(auVar55,auVar42); auVar30._16_16_ = auVar53; auVar30._0_16_ = auVar57; *param_4 = auVar57._0_8_; *(undefined1 (*) [16])(param_4 + 1) = auVar30._12_16_; param_4 = param_4 + 3; iVar44 = param_6 + -8; bVar4 = 7 < param_6; param_6 = iVar44; } while (iVar44 != 0 && bVar4); return; } //@@ 00acddb0 FUN_00acddb0 void FUN_00acddb0(ulonglong *param_1,undefined4 *param_2,int param_3,undefined1 (*param_4) [16], undefined1 (*param_5) [16],int param_6) { ulonglong uVar1; undefined4 uVar2; undefined4 uVar3; bool bVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; short sVar11; short sVar12; short sVar13; short sVar14; short sVar15; short sVar16; short sVar17; short sVar18; short sVar19; short sVar20; short sVar21; short sVar22; short sVar23; short sVar24; short sVar25; short sVar26; short sVar27; char cVar28; char cVar29; undefined8 uVar30; undefined6 uVar31; ushort uVar32; undefined1 auVar33 [14]; undefined1 auVar34 [12]; unkbyte10 Var35; undefined1 auVar36 [14]; undefined1 auVar37 [12]; unkbyte10 Var38; undefined3 uVar39; unkbyte9 Var40; unkbyte9 Var41; uint uVar42; undefined1 auVar43 [11]; undefined5 uVar44; unkbyte9 Var45; uint6 uVar46; undefined1 auVar47 [13]; unkbyte9 Var48; undefined1 auVar49 [15]; int iVar50; undefined2 uVar58; undefined1 auVar51 [16]; undefined1 auVar52 [16]; undefined1 auVar53 [16]; undefined1 auVar57 [16]; undefined1 auVar56 [16]; undefined1 auVar55 [16]; undefined1 auVar54 [16]; undefined1 auVar59 [16]; undefined1 auVar60 [16]; undefined1 auVar61 [16]; undefined1 auVar62 [16]; undefined1 auVar69 [16]; undefined1 auVar68 [16]; undefined1 auVar67 [16]; undefined1 auVar66 [16]; undefined1 auVar65 [16]; undefined1 auVar64 [16]; undefined1 auVar63 [16]; undefined1 uVar79; undefined1 auVar77 [16]; undefined1 auVar76 [16]; undefined1 auVar75 [16]; undefined1 auVar74 [16]; undefined1 auVar73 [16]; undefined1 auVar72 [16]; undefined1 auVar71 [16]; undefined1 auVar70 [16]; undefined1 auVar78 [16]; param_3 = param_3 - (int)param_2; do { uVar2 = *param_2; uVar3 = *(undefined4 *)((int)param_2 + param_3); param_2 = param_2 + 1; uVar58 = CONCAT11((char)((uint)uVar3 >> 0x18),(char)((uint)uVar2 >> 0x18)); uVar30 = CONCAT35(CONCAT21(uVar58,(char)((uint)uVar3 >> 0x10)), CONCAT14((char)((uint)uVar2 >> 0x10),uVar2)); uVar31 = CONCAT51(CONCAT41((int)((ulonglong)uVar30 >> 0x20),(char)((uint)uVar3 >> 8)), (char)((uint)uVar2 >> 8)); auVar61._0_2_ = CONCAT11((char)uVar3,(char)uVar2); uVar1 = CONCAT62(uVar31,auVar61._0_2_); auVar78._8_4_ = 0; auVar78._0_8_ = uVar1; auVar78._12_2_ = uVar58; auVar78._14_2_ = uVar58; uVar58 = (undefined2)((ulonglong)uVar30 >> 0x20); auVar51._12_4_ = auVar78._12_4_; auVar51._8_2_ = 0; auVar51._0_8_ = uVar1; auVar51._10_2_ = uVar58; auVar59._10_6_ = auVar51._10_6_; auVar59._8_2_ = uVar58; auVar59._0_8_ = uVar1; uVar58 = (undefined2)uVar31; auVar61._8_8_ = auVar59._8_8_; auVar61._6_2_ = uVar58; auVar61._4_2_ = uVar58; auVar61._2_2_ = auVar61._0_2_; uVar1 = *param_1; uVar79 = (undefined1)(uVar1 >> 0x38); auVar77._8_6_ = 0; auVar77._0_8_ = uVar1; auVar77[0xe] = uVar79; auVar77[0xf] = uVar79; uVar79 = (undefined1)(uVar1 >> 0x30); auVar76._14_2_ = auVar77._14_2_; auVar76._8_5_ = 0; auVar76._0_8_ = uVar1; auVar76[0xd] = uVar79; auVar75._13_3_ = auVar76._13_3_; auVar75._8_4_ = 0; auVar75._0_8_ = uVar1; auVar75[0xc] = uVar79; uVar79 = (undefined1)(uVar1 >> 0x28); auVar74._12_4_ = auVar75._12_4_; auVar74._8_3_ = 0; auVar74._0_8_ = uVar1; auVar74[0xb] = uVar79; auVar73._11_5_ = auVar74._11_5_; auVar73._8_2_ = 0; auVar73._0_8_ = uVar1; auVar73[10] = uVar79; uVar79 = (undefined1)(uVar1 >> 0x20); auVar72._10_6_ = auVar73._10_6_; auVar72[8] = 0; auVar72._0_8_ = uVar1; auVar72[9] = uVar79; auVar71._9_7_ = auVar72._9_7_; auVar71[8] = uVar79; auVar71._0_8_ = uVar1; uVar79 = (undefined1)(uVar1 >> 0x18); auVar70._8_8_ = auVar71._8_8_; auVar70[7] = uVar79; auVar70[6] = uVar79; uVar79 = (undefined1)(uVar1 >> 0x10); auVar70[5] = uVar79; auVar70[4] = uVar79; uVar79 = (undefined1)(uVar1 >> 8); auVar70[3] = uVar79; auVar70[2] = uVar79; auVar70[0] = (undefined1)uVar1; auVar70[1] = auVar70[0]; param_1 = param_1 + 1; auVar59 = pmaddubsw(auVar61,*param_5); auVar52._0_2_ = *(short *)param_5[6] - auVar59._0_2_; auVar52._2_2_ = *(short *)(param_5[6] + 2) - auVar59._2_2_; auVar52._4_2_ = *(short *)(param_5[6] + 4) - auVar59._4_2_; auVar52._6_2_ = *(short *)(param_5[6] + 6) - auVar59._6_2_; auVar52._8_2_ = *(short *)(param_5[6] + 8) - auVar59._8_2_; auVar52._10_2_ = *(short *)(param_5[6] + 10) - auVar59._10_2_; auVar52._12_2_ = *(short *)(param_5[6] + 0xc) - auVar59._12_2_; auVar52._14_2_ = *(short *)(param_5[6] + 0xe) - auVar59._14_2_; auVar59 = pmaddubsw(auVar61,param_5[2]); auVar60._0_2_ = *(short *)param_5[8] - auVar59._0_2_; auVar60._2_2_ = *(short *)(param_5[8] + 2) - auVar59._2_2_; auVar60._4_2_ = *(short *)(param_5[8] + 4) - auVar59._4_2_; auVar60._6_2_ = *(short *)(param_5[8] + 6) - auVar59._6_2_; auVar60._8_2_ = *(short *)(param_5[8] + 8) - auVar59._8_2_; auVar60._10_2_ = *(short *)(param_5[8] + 10) - auVar59._10_2_; auVar60._12_2_ = *(short *)(param_5[8] + 0xc) - auVar59._12_2_; auVar60._14_2_ = *(short *)(param_5[8] + 0xe) - auVar59._14_2_; auVar59 = pmaddubsw(auVar61,param_5[4]); auVar62._0_2_ = *(short *)param_5[10] - auVar59._0_2_; auVar62._2_2_ = *(short *)(param_5[10] + 2) - auVar59._2_2_; auVar62._4_2_ = *(short *)(param_5[10] + 4) - auVar59._4_2_; auVar62._6_2_ = *(short *)(param_5[10] + 6) - auVar59._6_2_; auVar62._8_2_ = *(short *)(param_5[10] + 8) - auVar59._8_2_; auVar62._10_2_ = *(short *)(param_5[10] + 10) - auVar59._10_2_; auVar62._12_2_ = *(short *)(param_5[10] + 0xc) - auVar59._12_2_; auVar62._14_2_ = *(short *)(param_5[10] + 0xe) - auVar59._14_2_; auVar78 = pmulhuw(auVar70,param_5[0xc]); auVar59 = paddsw(auVar52,auVar78); auVar61 = paddsw(auVar60,auVar78); auVar78 = paddsw(auVar62,auVar78); auVar59 = psraw(auVar59,6); auVar61 = psraw(auVar61,6); auVar78 = psraw(auVar78,6); sVar5 = auVar59._0_2_; sVar8 = auVar59._2_2_; sVar11 = auVar59._4_2_; sVar14 = auVar59._6_2_; sVar17 = auVar59._8_2_; sVar20 = auVar59._10_2_; sVar23 = auVar59._12_2_; sVar6 = auVar59._14_2_; cVar28 = (0 < sVar6) * (sVar6 < 0x100) * auVar59[0xe] - (0xff < sVar6); sVar6 = auVar61._0_2_; sVar9 = auVar61._2_2_; sVar12 = auVar61._4_2_; sVar15 = auVar61._6_2_; sVar18 = auVar61._8_2_; sVar21 = auVar61._10_2_; sVar24 = auVar61._12_2_; sVar26 = auVar61._14_2_; sVar7 = auVar78._0_2_; sVar10 = auVar78._2_2_; sVar13 = auVar78._4_2_; sVar16 = auVar78._6_2_; sVar19 = auVar78._8_2_; sVar22 = auVar78._10_2_; sVar25 = auVar78._12_2_; sVar27 = auVar78._14_2_; cVar29 = (0 < sVar27) * (sVar27 < 0x100) * auVar78[0xe] - (0xff < sVar27); uVar32 = CONCAT11((0 < sVar7) * (sVar7 < 0x100) * auVar78[0] - (0xff < sVar7),cVar29); auVar66._0_9_ = (unkuint9)uVar32 << 0x38; uVar39 = CONCAT12((0 < sVar10) * (sVar10 < 0x100) * auVar78[2] - (0xff < sVar10),uVar32); uVar42 = CONCAT13((0 < sVar13) * (sVar13 < 0x100) * auVar78[4] - (0xff < sVar13),uVar39); auVar43._4_7_ = 0; auVar43._0_4_ = uVar42; auVar67._0_11_ = auVar43 << 0x38; uVar44 = CONCAT14((0 < sVar16) * (sVar16 < 0x100) * auVar78[6] - (0xff < sVar16),uVar42); uVar46 = CONCAT15((0 < sVar19) * (sVar19 < 0x100) * auVar78[8] - (0xff < sVar19),uVar44); auVar47._6_7_ = 0; auVar47._0_6_ = uVar46; auVar68._0_13_ = auVar47 << 0x38; auVar49[6] = (0 < sVar22) * (sVar22 < 0x100) * auVar78[10] - (0xff < sVar22); auVar49._0_6_ = uVar46; uVar58 = CONCAT11((0 < sVar26) * (sVar26 < 0x100) * auVar61[0xe] - (0xff < sVar26),cVar28); uVar2 = CONCAT31(CONCAT21(uVar58,(0 < sVar24) * (sVar24 < 0x100) * auVar61[0xc] - (0xff < sVar24)), (0 < sVar23) * (sVar23 < 0x100) * auVar59[0xc] - (0xff < sVar23)); uVar31 = CONCAT51(CONCAT41(uVar2,(0 < sVar21) * (sVar21 < 0x100) * auVar61[10] - (0xff < sVar21) ),(0 < sVar20) * (sVar20 < 0x100) * auVar59[10] - (0xff < sVar20)); Var40 = CONCAT72(CONCAT61(uVar31,(0 < sVar18) * (sVar18 < 0x100) * auVar61[8] - (0xff < sVar18)) ,CONCAT11((0 < sVar17) * (sVar17 < 0x100) * auVar59[8] - (0xff < sVar17),cVar28 )); Var35 = CONCAT91(CONCAT81((longlong)((unkuint9)Var40 >> 8), (0 < sVar15) * (sVar15 < 0x100) * auVar61[6] - (0xff < sVar15)), (0 < sVar14) * (sVar14 < 0x100) * auVar59[6] - (0xff < sVar14)); auVar34._2_10_ = Var35; auVar34[1] = (0 < sVar12) * (sVar12 < 0x100) * auVar61[4] - (0xff < sVar12); auVar34[0] = (0 < sVar11) * (sVar11 < 0x100) * auVar59[4] - (0xff < sVar11); auVar33._2_12_ = auVar34; auVar33[1] = (0 < sVar9) * (sVar9 < 0x100) * auVar61[2] - (0xff < sVar9); auVar33[0] = (0 < sVar8) * (sVar8 < 0x100) * auVar59[2] - (0xff < sVar8); auVar53._0_2_ = CONCAT11((0 < sVar6) * (sVar6 < 0x100) * auVar61[0] - (0xff < sVar6), (0 < sVar5) * (sVar5 < 0x100) * auVar59[0] - (0xff < sVar5)); auVar53._2_14_ = auVar33; auVar49[7] = cVar29; auVar49._8_7_ = 0; auVar69._0_15_ = auVar49 << 0x38; auVar69[0xf] = 0xff; auVar68._14_2_ = auVar69._14_2_; auVar68[0xd] = 0xff; Var48 = CONCAT36(auVar68._13_3_, CONCAT15((0 < sVar25) * (sVar25 < 0x100) * auVar78[0xc] - (0xff < sVar25), uVar44)); auVar67._12_4_ = (undefined4)((unkuint9)Var48 >> 0x28); auVar67[0xb] = 0xff; Var45 = CONCAT54(auVar67._11_5_, CONCAT13((0 < sVar22) * (sVar22 < 0x100) * auVar78[10] - (0xff < sVar22),uVar39 )); auVar66._10_6_ = (undefined6)((unkuint9)Var45 >> 0x18); auVar66[9] = 0xff; Var41 = CONCAT72(auVar66._9_7_, CONCAT11((0 < sVar19) * (sVar19 < 0x100) * auVar78[8] - (0xff < sVar19),cVar29) ); auVar65._8_8_ = (undefined8)((unkuint9)Var41 >> 8); auVar65._0_8_ = 0xff00000000000000; Var38 = CONCAT91(auVar65._7_9_,(0 < sVar16) * (sVar16 < 0x100) * auVar78[6] - (0xff < sVar16)); auVar64._6_10_ = Var38; auVar64._0_6_ = 0xff0000000000; auVar37._1_11_ = auVar64._5_11_; auVar37[0] = (0 < sVar13) * (sVar13 < 0x100) * auVar78[4] - (0xff < sVar13); auVar63._4_12_ = auVar37; auVar63._0_4_ = 0xff000000; auVar36._1_13_ = auVar63._3_13_; auVar36[0] = (0 < sVar10) * (sVar10 < 0x100) * auVar78[2] - (0xff < sVar10); auVar54[3] = 0xff; auVar54[2] = (0 < sVar7) * (sVar7 < 0x100) * auVar78[0] - (0xff < sVar7); auVar57._0_12_ = auVar53._0_12_; auVar57._12_2_ = (short)Var35; auVar57._14_2_ = (short)Var38; auVar56._12_4_ = auVar57._12_4_; auVar56._0_10_ = auVar53._0_10_; auVar56._10_2_ = auVar37._0_2_; auVar55._10_6_ = auVar56._10_6_; auVar55._0_8_ = auVar53._0_8_; auVar55._8_2_ = auVar34._0_2_; auVar54._8_8_ = auVar55._8_8_; auVar54._6_2_ = auVar36._0_2_; auVar54._4_2_ = auVar33._0_2_; auVar54._0_2_ = auVar53._0_2_; *param_4 = auVar54; *(short *)param_4[1] = (short)((unkuint9)Var40 >> 8); *(short *)(param_4[1] + 2) = (short)((unkuint9)Var41 >> 8); *(short *)(param_4[1] + 4) = (short)uVar31; *(short *)(param_4[1] + 6) = (short)((unkuint9)Var45 >> 0x18); *(short *)(param_4[1] + 8) = (short)uVar2; *(short *)(param_4[1] + 10) = (short)((unkuint9)Var48 >> 0x28); *(undefined2 *)(param_4[1] + 0xc) = uVar58; *(undefined2 *)(param_4[1] + 0xe) = auVar68._14_2_; param_4 = param_4 + 2; iVar50 = param_6 + -8; bVar4 = 7 < param_6; param_6 = iVar50; } while (iVar50 != 0 && bVar4); return; } //@@ 00acde90 FUN_00acde90 void FUN_00acde90(ulonglong *param_1,undefined4 *param_2,int param_3,undefined1 *param_4, undefined1 (*param_5) [16],int param_6) { ulonglong uVar1; undefined4 uVar2; undefined4 uVar3; bool bVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; short sVar11; short sVar12; short sVar13; short sVar14; short sVar15; short sVar16; short sVar17; short sVar18; short sVar19; short sVar20; short sVar21; short sVar22; short sVar23; short sVar24; short sVar25; short sVar26; short sVar27; short sVar28; undefined8 uVar29; undefined6 uVar30; int iVar31; undefined2 uVar34; undefined1 auVar32 [16]; undefined1 auVar33 [16]; undefined1 auVar35 [16]; undefined1 auVar36 [16]; undefined1 auVar37 [16]; undefined1 auVar38 [16]; undefined1 uVar48; undefined1 auVar46 [16]; undefined1 auVar45 [16]; undefined1 auVar44 [16]; undefined1 auVar43 [16]; undefined1 auVar42 [16]; undefined1 auVar41 [16]; undefined1 auVar40 [16]; undefined1 auVar39 [16]; undefined1 auVar47 [16]; param_3 = param_3 - (int)param_2; do { uVar2 = *param_2; uVar3 = *(undefined4 *)((int)param_2 + param_3); param_2 = param_2 + 1; uVar34 = CONCAT11((char)((uint)uVar3 >> 0x18),(char)((uint)uVar2 >> 0x18)); uVar29 = CONCAT35(CONCAT21(uVar34,(char)((uint)uVar3 >> 0x10)), CONCAT14((char)((uint)uVar2 >> 0x10),uVar2)); uVar30 = CONCAT51(CONCAT41((int)((ulonglong)uVar29 >> 0x20),(char)((uint)uVar3 >> 8)), (char)((uint)uVar2 >> 8)); auVar32._0_2_ = CONCAT11((char)uVar3,(char)uVar2); uVar1 = CONCAT62(uVar30,auVar32._0_2_); auVar47._8_4_ = 0; auVar47._0_8_ = uVar1; auVar47._12_2_ = uVar34; auVar47._14_2_ = uVar34; uVar34 = (undefined2)((ulonglong)uVar29 >> 0x20); auVar37._12_4_ = auVar47._12_4_; auVar37._8_2_ = 0; auVar37._0_8_ = uVar1; auVar37._10_2_ = uVar34; auVar35._10_6_ = auVar37._10_6_; auVar35._8_2_ = uVar34; auVar35._0_8_ = uVar1; uVar34 = (undefined2)uVar30; auVar32._8_8_ = auVar35._8_8_; auVar32._6_2_ = uVar34; auVar32._4_2_ = uVar34; auVar32._2_2_ = auVar32._0_2_; uVar1 = *param_1; uVar48 = (undefined1)(uVar1 >> 0x38); auVar46._8_6_ = 0; auVar46._0_8_ = uVar1; auVar46[0xe] = uVar48; auVar46[0xf] = uVar48; uVar48 = (undefined1)(uVar1 >> 0x30); auVar45._14_2_ = auVar46._14_2_; auVar45._8_5_ = 0; auVar45._0_8_ = uVar1; auVar45[0xd] = uVar48; auVar44._13_3_ = auVar45._13_3_; auVar44._8_4_ = 0; auVar44._0_8_ = uVar1; auVar44[0xc] = uVar48; uVar48 = (undefined1)(uVar1 >> 0x28); auVar43._12_4_ = auVar44._12_4_; auVar43._8_3_ = 0; auVar43._0_8_ = uVar1; auVar43[0xb] = uVar48; auVar42._11_5_ = auVar43._11_5_; auVar42._8_2_ = 0; auVar42._0_8_ = uVar1; auVar42[10] = uVar48; uVar48 = (undefined1)(uVar1 >> 0x20); auVar41._10_6_ = auVar42._10_6_; auVar41[8] = 0; auVar41._0_8_ = uVar1; auVar41[9] = uVar48; auVar40._9_7_ = auVar41._9_7_; auVar40[8] = uVar48; auVar40._0_8_ = uVar1; uVar48 = (undefined1)(uVar1 >> 0x18); auVar39._8_8_ = auVar40._8_8_; auVar39[7] = uVar48; auVar39[6] = uVar48; uVar48 = (undefined1)(uVar1 >> 0x10); auVar39[5] = uVar48; auVar39[4] = uVar48; uVar48 = (undefined1)(uVar1 >> 8); auVar39[3] = uVar48; auVar39[2] = uVar48; auVar39[0] = (undefined1)uVar1; auVar39[1] = auVar39[0]; param_1 = param_1 + 1; auVar35 = pmaddubsw(auVar32,*param_5); auVar33._0_2_ = *(short *)param_5[6] - auVar35._0_2_; auVar33._2_2_ = *(short *)(param_5[6] + 2) - auVar35._2_2_; auVar33._4_2_ = *(short *)(param_5[6] + 4) - auVar35._4_2_; auVar33._6_2_ = *(short *)(param_5[6] + 6) - auVar35._6_2_; auVar33._8_2_ = *(short *)(param_5[6] + 8) - auVar35._8_2_; auVar33._10_2_ = *(short *)(param_5[6] + 10) - auVar35._10_2_; auVar33._12_2_ = *(short *)(param_5[6] + 0xc) - auVar35._12_2_; auVar33._14_2_ = *(short *)(param_5[6] + 0xe) - auVar35._14_2_; auVar35 = pmaddubsw(auVar32,param_5[2]); auVar36._0_2_ = *(short *)param_5[8] - auVar35._0_2_; auVar36._2_2_ = *(short *)(param_5[8] + 2) - auVar35._2_2_; auVar36._4_2_ = *(short *)(param_5[8] + 4) - auVar35._4_2_; auVar36._6_2_ = *(short *)(param_5[8] + 6) - auVar35._6_2_; auVar36._8_2_ = *(short *)(param_5[8] + 8) - auVar35._8_2_; auVar36._10_2_ = *(short *)(param_5[8] + 10) - auVar35._10_2_; auVar36._12_2_ = *(short *)(param_5[8] + 0xc) - auVar35._12_2_; auVar36._14_2_ = *(short *)(param_5[8] + 0xe) - auVar35._14_2_; auVar35 = pmaddubsw(auVar32,param_5[4]); auVar38._0_2_ = *(short *)param_5[10] - auVar35._0_2_; auVar38._2_2_ = *(short *)(param_5[10] + 2) - auVar35._2_2_; auVar38._4_2_ = *(short *)(param_5[10] + 4) - auVar35._4_2_; auVar38._6_2_ = *(short *)(param_5[10] + 6) - auVar35._6_2_; auVar38._8_2_ = *(short *)(param_5[10] + 8) - auVar35._8_2_; auVar38._10_2_ = *(short *)(param_5[10] + 10) - auVar35._10_2_; auVar38._12_2_ = *(short *)(param_5[10] + 0xc) - auVar35._12_2_; auVar38._14_2_ = *(short *)(param_5[10] + 0xe) - auVar35._14_2_; auVar47 = pmulhuw(auVar39,param_5[0xc]); auVar35 = paddsw(auVar33,auVar47); auVar37 = paddsw(auVar36,auVar47); auVar47 = paddsw(auVar38,auVar47); auVar35 = psraw(auVar35,6); auVar37 = psraw(auVar37,6); auVar47 = psraw(auVar47,6); sVar5 = auVar35._0_2_; sVar8 = auVar35._2_2_; sVar11 = auVar35._4_2_; sVar14 = auVar35._6_2_; sVar17 = auVar35._8_2_; sVar20 = auVar35._10_2_; sVar23 = auVar35._12_2_; sVar26 = auVar35._14_2_; sVar6 = auVar37._0_2_; sVar9 = auVar37._2_2_; sVar12 = auVar37._4_2_; sVar15 = auVar37._6_2_; sVar18 = auVar37._8_2_; sVar21 = auVar37._10_2_; sVar24 = auVar37._12_2_; sVar27 = auVar37._14_2_; sVar7 = auVar47._0_2_; sVar10 = auVar47._2_2_; sVar13 = auVar47._4_2_; sVar16 = auVar47._6_2_; sVar19 = auVar47._8_2_; sVar22 = auVar47._10_2_; sVar25 = auVar47._12_2_; sVar28 = auVar47._14_2_; *param_4 = 0xff; param_4[1] = (0 < sVar5) * (sVar5 < 0x100) * auVar35[0] - (0xff < sVar5); param_4[2] = (0 < sVar6) * (sVar6 < 0x100) * auVar37[0] - (0xff < sVar6); param_4[3] = (0 < sVar7) * (sVar7 < 0x100) * auVar47[0] - (0xff < sVar7); param_4[4] = 0xff; param_4[5] = (0 < sVar8) * (sVar8 < 0x100) * auVar35[2] - (0xff < sVar8); param_4[6] = (0 < sVar9) * (sVar9 < 0x100) * auVar37[2] - (0xff < sVar9); param_4[7] = (0 < sVar10) * (sVar10 < 0x100) * auVar47[2] - (0xff < sVar10); param_4[8] = 0xff; param_4[9] = (0 < sVar11) * (sVar11 < 0x100) * auVar35[4] - (0xff < sVar11); param_4[10] = (0 < sVar12) * (sVar12 < 0x100) * auVar37[4] - (0xff < sVar12); param_4[0xb] = (0 < sVar13) * (sVar13 < 0x100) * auVar47[4] - (0xff < sVar13); param_4[0xc] = 0xff; param_4[0xd] = (0 < sVar14) * (sVar14 < 0x100) * auVar35[6] - (0xff < sVar14); param_4[0xe] = (0 < sVar15) * (sVar15 < 0x100) * auVar37[6] - (0xff < sVar15); param_4[0xf] = (0 < sVar16) * (sVar16 < 0x100) * auVar47[6] - (0xff < sVar16); param_4[0x10] = 0xff; param_4[0x11] = (0 < sVar17) * (sVar17 < 0x100) * auVar35[8] - (0xff < sVar17); param_4[0x12] = (0 < sVar18) * (sVar18 < 0x100) * auVar37[8] - (0xff < sVar18); param_4[0x13] = (0 < sVar19) * (sVar19 < 0x100) * auVar47[8] - (0xff < sVar19); param_4[0x14] = 0xff; param_4[0x15] = (0 < sVar20) * (sVar20 < 0x100) * auVar35[10] - (0xff < sVar20); param_4[0x16] = (0 < sVar21) * (sVar21 < 0x100) * auVar37[10] - (0xff < sVar21); param_4[0x17] = (0 < sVar22) * (sVar22 < 0x100) * auVar47[10] - (0xff < sVar22); param_4[0x18] = 0xff; param_4[0x19] = (0 < sVar23) * (sVar23 < 0x100) * auVar35[0xc] - (0xff < sVar23); param_4[0x1a] = (0 < sVar24) * (sVar24 < 0x100) * auVar37[0xc] - (0xff < sVar24); param_4[0x1b] = (0 < sVar25) * (sVar25 < 0x100) * auVar47[0xc] - (0xff < sVar25); param_4[0x1c] = 0xff; param_4[0x1d] = (0 < sVar26) * (sVar26 < 0x100) * auVar35[0xe] - (0xff < sVar26); param_4[0x1e] = (0 < sVar27) * (sVar27 < 0x100) * auVar37[0xe] - (0xff < sVar27); param_4[0x1f] = (0 < sVar28) * (sVar28 < 0x100) * auVar47[0xe] - (0xff < sVar28); param_4 = param_4 + 0x20; iVar31 = param_6 + -8; bVar4 = 7 < param_6; param_6 = iVar31; } while (iVar31 != 0 && bVar4); return; } //@@ 00acdf70 InitCpuFlags /* WARNING: Removing unreachable block (ram,0x00acdfd9) */ /* WARNING: Removing unreachable block (ram,0x00acdfb4) */ /* WARNING: Removing unreachable block (ram,0x00acdf8c) */ /* WARNING: Removing unreachable block (ram,0x00ace25d) */ /* DB: libyuv (round 7 agent) prototype: db/protos.zhl */ uint __cdecl InitCpuFlags(void) { int *piVar1; int iVar2; int iVar3; undefined8 uVar4; byte bVar5; bool bVar6; char *pcVar7; uint uVar8; uint uVar9; uint uVar10; byte in_XCR0; piVar1 = (int *)cpuid_basic_info(0); uVar10 = 0; iVar2 = cpuid_Version_info(1); uVar8 = *(uint *)(iVar2 + 0xc); if (6 < *piVar1) { iVar3 = cpuid_Extended_Feature_Enumeration_info(7); uVar10 = *(uint *)(iVar3 + 4); } uVar9 = (((*(uint *)(iVar2 + 8) & 0x4000000 | 0x2000000) >> 9 | uVar8 & 0x180000) >> 9 | uVar8 & 0x200) >> 3 | (uVar10 & 0x200) << 2; if ((uVar8 & 0x1c000000) == 0x1c000000) { uVar4 = xinuse(0); bVar5 = in_XCR0 & (byte)uVar4; if (((bVar5 & 6) == 6) && (uVar9 = uVar9 | (uVar8 & 0x20000000 | 0x1000000) >> 0xf | (uVar10 & 0x20) << 5 | uVar8 & 0x1000, (bVar5 & 0xe0) == 0xe0)) { uVar9 = uVar9 | uVar10 >> 0x11 & 0x2000; } } pcVar7 = getenv("LIBYUV_DISABLE_X86"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar8 = uVar9 & 0xffffffef; if (!bVar6) { uVar8 = uVar9; } pcVar7 = getenv("LIBYUV_DISABLE_SSE2"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar10 = uVar8 & 0xffffffdf; if (!bVar6) { uVar10 = uVar8; } pcVar7 = getenv("LIBYUV_DISABLE_SSSE3"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar8 = uVar10 & 0xffffffbf; if (!bVar6) { uVar8 = uVar10; } pcVar7 = getenv("LIBYUV_DISABLE_SSE41"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar10 = uVar8 & 0xffffff7f; if (!bVar6) { uVar10 = uVar8; } pcVar7 = getenv("LIBYUV_DISABLE_SSE42"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar8 = uVar10 & 0xfffffeff; if (!bVar6) { uVar8 = uVar10; } pcVar7 = getenv("LIBYUV_DISABLE_AVX"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar10 = uVar8 & 0xfffffdff; if (!bVar6) { uVar10 = uVar8; } pcVar7 = getenv("LIBYUV_DISABLE_AVX2"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar8 = uVar10 & 0xfffffbff; if (!bVar6) { uVar8 = uVar10; } pcVar7 = getenv("LIBYUV_DISABLE_ERMS"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar10 = uVar8 & 0xfffff7ff; if (!bVar6) { uVar10 = uVar8; } pcVar7 = getenv("LIBYUV_DISABLE_FMA3"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar8 = uVar10 & 0xffffefff; if (!bVar6) { uVar8 = uVar10; } pcVar7 = getenv("LIBYUV_DISABLE_AVX3"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar10 = uVar8 & 0xffffdfff; if (!bVar6) { uVar10 = uVar8; } pcVar7 = getenv("LIBYUV_DISABLE_F16C"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { bVar6 = false; } else { bVar6 = true; } uVar8 = uVar10 & 0xffffbfff; if (!bVar6) { uVar8 = uVar10; } pcVar7 = getenv("LIBYUV_DISABLE_ASM"); if ((pcVar7 == (char *)0x0) || (*pcVar7 == '0')) { return uVar8 | 1; } return 1; } //@@ 00ace280 FUN_00ace280 void FUN_00ace280(void *param_1) { if (param_1 != (void *)0x0) { memset(param_1,0,0x60); free(param_1); } return; } //@@ 00ace2b0 FUN_00ace2b0 void FUN_00ace2b0(undefined4 *param_1) { undefined4 *_Memory; if (param_1 != (undefined4 *)0x0) { _Memory = (undefined4 *)param_1[2]; if (_Memory != (undefined4 *)0x0) { if ((void *)*_Memory != (void *)0x0) { free((void *)*_Memory); _Memory = (undefined4 *)param_1[2]; } if ((void *)_Memory[1] != (void *)0x0) { free((void *)_Memory[1]); _Memory = (undefined4 *)param_1[2]; } free(_Memory); } *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[5] = 0; param_1[6] = 0; param_1[7] = 0; free(param_1); } return; } //@@ 00ace310 FUN_00ace310 int * FUN_00ace310(int param_1) { int iVar1; int *piVar2; int *_Dst; int iVar3; int iVar4; int iVar5; int iVar6; int *piVar7; iVar1 = *(int *)(param_1 + 0x1c); _Dst = malloc(0x60); iVar3 = FUN_00ab7120(); *_Dst = iVar3; iVar4 = FUN_00ab7120(); _Dst[1] = iVar4; iVar5 = FUN_00ab7120(); _Dst[2] = iVar5; iVar6 = FUN_00ab7120(); _Dst[3] = iVar6; iVar6 = FUN_00ab7120(); _Dst[4] = iVar6; iVar6 = FUN_00ab7120(); _Dst[5] = iVar6 + 1; if ((((0 < iVar3) && (0 < iVar4)) && (0 < iVar5)) && (0 < iVar6 + 1)) { iVar3 = 0; piVar7 = _Dst + 6; while( true ) { iVar4 = FUN_00ab7120(); *piVar7 = iVar4; if (((iVar4 < 0) || (*(int *)(iVar1 + 0x18) <= iVar4)) || ((piVar2 = *(int **)(iVar1 + 0x720 + iVar4 * 4), piVar2[3] == 0 || (*piVar2 < 1)))) break; iVar3 = iVar3 + 1; piVar7 = piVar7 + 1; if (_Dst[5] <= iVar3) { return _Dst; } } } memset(_Dst,0,0x60); free(_Dst); return (int *)0x0; } //@@ 00ace410 FUN_00ace410 undefined4 * FUN_00ace410(undefined4 param_1,undefined4 *param_2) { undefined4 *puVar1; void *pvVar2; puVar1 = calloc(1,0x20); puVar1[1] = *param_2; *puVar1 = param_2[2]; puVar1[5] = param_2; pvVar2 = calloc(2,4); puVar1[2] = pvVar2; return puVar1; } //@@ 00ace450 floor0_inverse1 /* DB: libvorbis (round 7 agent) */ int floor0_inverse1(int param_1,float param_2) { int iVar1; undefined4 uVar2; int iVar3; int iVar4; int iVar5; uint uVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; iVar4 = (int)param_2; iVar1 = *(int *)((int)param_2 + 0x14); iVar5 = FUN_00ab7120(); if (0 < iVar5) { uVar2 = *(undefined4 *)(iVar1 + 0xc); iVar3 = *(int *)(iVar1 + 0x10); for (uVar6 = *(uint *)(iVar1 + 0x14); uVar6 != 0; uVar6 = uVar6 >> 1) { } iVar7 = FUN_00ab7120(); if ((iVar7 != -1) && (iVar7 < *(int *)(iVar1 + 0x14))) { iVar1 = *(int *)(iVar1 + 0x18 + iVar7 * 4); param_2 = 0.0; iVar7 = *(int *)(*(int *)(*(int *)(*(int *)(param_1 + 0x40) + 4) + 0x1c) + 0xb20); iVar8 = FUN_00aaca80(); iVar9 = vorbis_book_decodev_set(param_1 + 4,*(undefined4 *)(iVar4 + 4)); if (iVar9 != -1) { iVar9 = *(int *)(iVar4 + 4); iVar10 = 0; if (0 < iVar9) { do { iVar11 = 0; if (iVar10 < iVar9) { do { if (*(int *)(iVar7 + iVar1 * 0x38) <= iVar11) break; iVar11 = iVar11 + 1; *(float *)(iVar8 + iVar10 * 4) = param_2 + *(float *)(iVar8 + iVar10 * 4); iVar10 = iVar10 + 1; iVar9 = *(int *)(iVar4 + 4); } while (iVar10 < iVar9); } param_2 = *(float *)(iVar8 + -4 + iVar10 * 4); } while (iVar10 < iVar9); } *(float *)(iVar8 + iVar9 * 4) = ((float)iVar5 / (float)((1 << ((byte)uVar2 & 0x1f)) + -1)) * (float)iVar3; return iVar8; } } } return 0; } //@@ 00ace590 floor0_inverse2 /* DB: libvorbis floor0.c: last slot of floor0_exportbundle at 00b5e238 {NULL, unpack ace310, look ace410, free_info ace280, free_look ace2b0, inverse1 ace450, inverse2}; inlined floor0_map_lazy_init (toBARK 13.1*atan(.00074n)+2.24*atan(n*n*1.85e-8)+1e-4n, malloc linearmap), memset when memo NULL else vorbis_lsp_to_curve FUN_00adb7d0 */ undefined4 floor0_inverse2(int param_1,int *param_2,int param_3,void *param_4) { int iVar1; int iVar2; int iVar3; int iVar4; void *pvVar5; int iVar6; int iVar7; double dVar8; double dVar9; double dVar10; double dVar11; float fVar12; float fVar13; iVar1 = *(int *)(param_1 + 0x1c); iVar2 = param_2[5]; if (*(int *)(param_2[2] + iVar1 * 4) == 0) { fVar12 = (float)*(int *)(iVar2 + 4) * 0.5; iVar4 = *(int *)(*(int *)(*(int *)(*(int *)(param_1 + 0x40) + 4) + 0x1c) + iVar1 * 4) / 2; dVar8 = (double)(fVar12 * fVar12 * 1.85e-08); libm_sse2_atan_precise(); dVar9 = (double)(fVar12 * 0.00074); libm_sse2_atan_precise(); iVar3 = *param_2; pvVar5 = malloc(iVar4 * 4 + 4); *(void **)(param_2[2] + iVar1 * 4) = pvVar5; iVar6 = 0; if (0 < iVar4) { iVar6 = 0; do { fVar13 = (((float)*(int *)(iVar2 + 4) * 0.5) / (float)iVar4) * (float)iVar6; dVar10 = (double)(fVar13 * fVar13 * 1.85e-08); libm_sse2_atan_precise(); dVar11 = (double)(fVar13 * 0.00074); libm_sse2_atan_precise(); dVar10 = floor((dVar10 * 2.240000009536743 + dVar11 * 13.100000381469727 + (double)(fVar13 * 0.0001)) * (double)(float)((double)iVar3 / (dVar8 * 2.240000009536743 + dVar9 * 13.100000381469727 + (double)(fVar12 * 0.0001)))); iVar7 = *param_2 + -1; if ((int)dVar10 < *param_2) { iVar7 = (int)dVar10; } *(int *)(*(int *)(param_2[2] + iVar1 * 4) + iVar6 * 4) = iVar7; iVar6 = iVar6 + 1; } while (iVar6 < iVar4); } *(undefined4 *)(*(int *)(param_2[2] + iVar1 * 4) + iVar6 * 4) = 0xffffffff; param_2[iVar1 + 3] = iVar4; } if (param_3 == 0) { memset(param_4,0,param_2[*(int *)(param_1 + 0x1c) + 3] << 2); return 0; } FUN_00adb7d0(param_2[*(int *)(param_1 + 0x1c) + 3],*param_2,param_3,param_2[1], *(undefined4 *)(param_3 + param_2[1] * 4),(float)*(int *)(iVar2 + 0x10)); return 1; } //@@ 00ace810 FUN_00ace810 void FUN_00ace810(void *param_1) { if (param_1 != (void *)0x0) { memset(param_1,0,0xc88); free(param_1); } return; } //@@ 00ace840 FUN_00ace840 void FUN_00ace840(int param_1,uint *param_2,void *param_3) { uint uVar1; int iVar2; uint *puVar3; int local_8; if ((int)*param_2 < 2) { uVar1 = 0; iVar2 = 1; } else { oggpack_write(param_3,1,1); uVar1 = *param_2 - 1; iVar2 = 4; } oggpack_write(param_3,uVar1,iVar2); if ((int)param_2[0x121] < 1) { oggpack_write(param_3,0,1); } else { oggpack_write(param_3,1,1); oggpack_write(param_3,param_2[0x121] - 1,8); local_8 = 0; if (0 < (int)param_2[0x121]) { puVar3 = param_2 + 0x222; do { iVar2 = 0; uVar1 = *(int *)(param_1 + 4) - 1; if (*(int *)(param_1 + 4) == 0) { uVar1 = 0; } for (; uVar1 != 0; uVar1 = uVar1 >> 1) { iVar2 = iVar2 + 1; } oggpack_write(param_3,puVar3[-0x100],iVar2); iVar2 = 0; uVar1 = *(int *)(param_1 + 4) - 1; if (*(int *)(param_1 + 4) == 0) { uVar1 = 0; } for (; uVar1 != 0; uVar1 = uVar1 >> 1) { iVar2 = iVar2 + 1; } oggpack_write(param_3,*puVar3,iVar2); local_8 = local_8 + 1; puVar3 = puVar3 + 1; } while (local_8 < (int)param_2[0x121]); } } oggpack_write(param_3,0,2); uVar1 = *param_2; if ((1 < (int)uVar1) && (iVar2 = 0, puVar3 = param_2, 0 < *(int *)(param_1 + 4))) { do { oggpack_write(param_3,puVar3[1],4); iVar2 = iVar2 + 1; puVar3 = puVar3 + 1; } while (iVar2 < *(int *)(param_1 + 4)); uVar1 = *param_2; } iVar2 = 0; if (0 < (int)uVar1) { puVar3 = param_2 + 0x111; do { oggpack_write(param_3,0,8); oggpack_write(param_3,puVar3[-0x10],8); oggpack_write(param_3,*puVar3,8); puVar3 = puVar3 + 1; iVar2 = iVar2 + 1; } while (iVar2 < (int)*param_2); } return; } //@@ 00ace9c0 mapping0_unpack /* DB: libvorbis mapping0.c: slot 1 of mapping0_exportbundle 00b5e294 {pack ace840, unpack, free_info ace810, forward acebf0, inverse acf890}; calloc(1,0xc88), oggpack_read (FUN_00ab7120) submaps, coupling steps with ilog(channels) bits and mag != ang checks */ int * mapping0_unpack(int param_1) { int iVar1; int *_Dst; int iVar2; uint uVar3; int iVar4; int iVar5; int *piVar6; int *local_c; int local_8; _Dst = calloc(1,0xc88); iVar1 = *(int *)(param_1 + 0x1c); memset(_Dst,0,0xc88); iVar2 = FUN_00ab7120(); if (-1 < iVar2) { if (iVar2 == 0) { *_Dst = 1; } else { iVar2 = FUN_00ab7120(); *_Dst = iVar2 + 1; if (iVar2 + 1 < 1) goto LAB_00acea19; } iVar2 = FUN_00ab7120(); if (-1 < iVar2) { if (iVar2 != 0) { iVar2 = FUN_00ab7120(); _Dst[0x121] = iVar2 + 1; if (iVar2 + 1 < 1) goto LAB_00acea19; iVar2 = *(int *)(param_1 + 4); local_c = _Dst + 0x222; local_8 = 0; do { uVar3 = iVar2 - 1; if (iVar2 == 0) { uVar3 = 0; } for (; uVar3 != 0; uVar3 = uVar3 >> 1) { } iVar4 = FUN_00ab7120(); local_c[-0x100] = iVar4; uVar3 = *(int *)(param_1 + 4) - 1; if (*(int *)(param_1 + 4) == 0) { uVar3 = 0; } for (; uVar3 != 0; uVar3 = uVar3 >> 1) { } iVar5 = FUN_00ab7120(); *local_c = iVar5; if ((((iVar4 < 0) || (iVar5 < 0)) || (iVar4 == iVar5)) || ((iVar2 = *(int *)(param_1 + 4), iVar2 <= iVar4 || (iVar2 <= iVar5)))) goto LAB_00acea19; local_c = local_c + 1; local_8 = local_8 + 1; } while (local_8 < _Dst[0x121]); } iVar2 = FUN_00ab7120(); if (iVar2 == 0) { iVar2 = *_Dst; if ((1 < iVar2) && (iVar4 = 0, piVar6 = _Dst, 0 < *(int *)(param_1 + 4))) { do { iVar5 = FUN_00ab7120(); piVar6[1] = iVar5; iVar2 = *_Dst; if ((iVar2 <= iVar5) || (iVar5 < 0)) goto LAB_00acea19; iVar4 = iVar4 + 1; piVar6 = piVar6 + 1; } while (iVar4 < *(int *)(param_1 + 4)); } iVar4 = 0; if (0 < iVar2) { piVar6 = _Dst + 0x111; do { FUN_00ab7120(); iVar2 = FUN_00ab7120(); piVar6[-0x10] = iVar2; if ((*(int *)(iVar1 + 0x10) <= iVar2) || (iVar2 < 0)) goto LAB_00acea19; iVar2 = FUN_00ab7120(); *piVar6 = iVar2; if ((*(int *)(iVar1 + 0x14) <= iVar2) || (iVar2 < 0)) goto LAB_00acea19; iVar4 = iVar4 + 1; piVar6 = piVar6 + 1; } while (iVar4 < *_Dst); } return _Dst; } } } LAB_00acea19: if (_Dst != (int *)0x0) { memset(_Dst,0,0xc88); free(_Dst); } return (int *)0x0; } //@@ 00acebf0 mapping0_forward /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis: the forward slot of the mapping0 table; calls mdct_forward, _vp_noisemask, floor1_fit, oggpack_write; the real mapping0_inverse is 00acf890 mapping0_inverse mapping0_inverse) */ undefined4 mapping0_forward(int *param_1) { float fVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int *piVar9; int iVar10; undefined *puVar11; code *pcVar12; int iVar13; bool bVar14; int iVar15; undefined4 *puVar16; int *piVar17; int *piVar18; int *piVar19; void *pvVar20; int iVar21; float *pfVar22; undefined4 uVar23; int iVar24; undefined4 uVar25; int iVar26; int iVar27; int iVar28; float *pfVar29; uint uVar30; undefined4 *puVar31; undefined1 *puVar32; undefined1 *puVar33; undefined1 *puVar34; int iVar35; int iVar36; uint *puVar37; int iVar38; float fVar39; float fVar40; undefined8 uVar41; float afStack_98 [7]; int iStack_7c; int local_5c; int *local_50; float local_44; int local_3c; int *local_38; int local_30; int *local_24; iVar2 = *(int *)(param_1[0x10] + 4); iVar3 = *(int *)(param_1[0x10] + 0x68); iVar4 = param_1[0x1a]; iVar5 = *(int *)(iVar2 + 4); iVar6 = *(int *)(iVar2 + 0x1c); iVar21 = param_1[9]; iStack_7c = 0xacec2a; iVar13 = iVar5 * -4; afStack_98[7 - iVar5] = 1.5880442e-38; iVar15 = FUN_00aaca80(); afStack_98[7 - iVar5] = 1.5880464e-38; puVar16 = (undefined4 *)FUN_00aaca80(); afStack_98[7 - iVar5] = 1.588049e-38; piVar17 = (int *)FUN_00aaca80(); local_44 = *(float *)(iVar4 + 4); iVar7 = *(int *)(iVar2 + 4); afStack_98[7 - iVar5] = 1.5880527e-38; pfVar22 = afStack_98 + ((8 - iVar7) - iVar5); iVar8 = param_1[7]; piVar9 = *(int **)(iVar6 + 0x220 + iVar8 * 4); local_3c = 0; piVar18 = (int *)(((-(uint)(iVar8 != 0) & 2) + *(int *)(iVar4 + 8)) * 0x34 + *(int *)(iVar3 + 0x38)); param_1[10] = iVar8; if (0 < *(int *)(iVar2 + 4)) { uVar30 = (iVar21 / 2) * 4 + 7U & 0xfffffff8; iVar35 = iVar15 - (int)(afStack_98 + ((8 - iVar7) - iVar5)); do { pfVar29 = *(float **)(*param_1 + local_3c * 4); iVar26 = param_1[0x12]; if (param_1[0x13] < (int)(iVar26 + uVar30)) { if (param_1[0x11] != 0) { afStack_98[(7 - iVar7) - iVar5] = 1.12104e-44; afStack_98[(6 - iVar7) - iVar5] = 1.588078e-38; piVar19 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x14] = param_1[0x14] + param_1[0x12]; piVar19[1] = param_1[0x15]; *piVar19 = param_1[0x11]; param_1[0x15] = (int)piVar19; } afStack_98[(7 - iVar7) - iVar5] = (float)uVar30; param_1[0x13] = uVar30; afStack_98[(6 - iVar7) - iVar5] = 1.5880833e-38; pvVar20 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x11] = (int)pvVar20; iVar26 = 0; } param_1[0x12] = iVar26 + uVar30; *(int *)((int)puVar16 + (int)pfVar22 + (iVar35 - iVar15)) = param_1[0x11] + iVar26; iVar26 = param_1[0x12]; if (param_1[0x13] < (int)(iVar26 + uVar30)) { if (param_1[0x11] != 0) { afStack_98[(7 - iVar7) - iVar5] = 1.12104e-44; afStack_98[(6 - iVar7) - iVar5] = 1.5880923e-38; piVar19 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x14] = param_1[0x14] + param_1[0x12]; piVar19[1] = param_1[0x15]; *piVar19 = param_1[0x11]; param_1[0x15] = (int)piVar19; } afStack_98[(7 - iVar7) - iVar5] = (float)uVar30; param_1[0x13] = uVar30; afStack_98[(6 - iVar7) - iVar5] = 1.5880976e-38; pvVar20 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x11] = (int)pvVar20; iVar26 = 0; } param_1[0x12] = iVar26 + uVar30; *(int *)(iVar35 + (int)pfVar22) = param_1[0x11] + iVar26; afStack_98[(7 - iVar7) - iVar5] = (float)param_1[8]; afStack_98[(6 - iVar7) - iVar5] = (float)param_1[7]; afStack_98[(5 - iVar7) - iVar5] = (float)param_1[6]; afStack_98[(4 - iVar7) - iVar5] = (float)iVar6; fVar1 = (((float)(int)ABS(4.0 / (float)iVar21) + 0.0) * 7.1771143e-07 - 764.6162) + 0.345; afStack_98[(3 - iVar7) - iVar5] = 1.5881157e-38; _vorbis_apply_window(); afStack_98[(3 - iVar7) - iVar5] = (float)*(undefined4 *)(iVar35 + (int)pfVar22); afStack_98[(2 - iVar7) - iVar5] = 1.5881193e-38; mdct_forward(); iVar26 = param_1[7]; if (*(int *)(iVar3 + 0x14 + iVar26 * 0xc) != 1) { iVar36 = *(int *)(iVar3 + 0x18 + iVar26 * 0xc); afStack_98[(7 - iVar7) - iVar5] = (float)*(undefined4 *)(iVar3 + 0x1c + iVar26 * 0xc); afStack_98[(6 - iVar7) - iVar5] = (float)(iVar36 + *(int *)(iVar3 + 0x14 + iVar26 * 0xc) * 4); afStack_98[(5 - iVar7) - iVar5] = (float)iVar36; afStack_98[(4 - iVar7) - iVar5] = 1.5881255e-38; drftf1(); } iVar26 = 1; fVar40 = (((float)(int)ABS(*pfVar29) + 0.0) * 7.1771143e-07 - 764.6162) + fVar1 + 0.345; *pfVar29 = fVar40; *pfVar22 = fVar40; if (1 < iVar21 + -1) { do { fVar39 = (((float)(int)ABS(pfVar29[iVar26 + 1] * pfVar29[iVar26 + 1] + pfVar29[iVar26] * pfVar29[iVar26]) + 0.0) * 7.1771143e-07 - 764.6162) * 0.5 + fVar1 + 0.345; pfVar29[iVar26 + 1 >> 1] = fVar39; fVar40 = *pfVar22; if (*pfVar22 < fVar39) { *pfVar22 = fVar39; fVar40 = fVar39; } iVar26 = iVar26 + 2; } while (iVar26 < iVar21 + -1); } if (0.0 < fVar40) { fVar40 = 0.0; *pfVar22 = 0.0; } if (fVar40 <= local_44) { fVar40 = local_44; } pfVar22 = pfVar22 + 1; local_3c = local_3c + 1; local_44 = fVar40; } while (local_3c < *(int *)(iVar2 + 4)); } iVar35 = param_1[0x12]; iVar21 = iVar21 / 2; uVar30 = iVar21 * 4 + 7U & 0xfffffff8; if (param_1[0x13] < (int)(iVar35 + uVar30)) { if (param_1[0x11] != 0) { afStack_98[(7 - iVar7) - iVar5] = 1.12104e-44; afStack_98[(6 - iVar7) - iVar5] = 1.5881752e-38; piVar19 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x14] = param_1[0x14] + param_1[0x12]; piVar19[1] = param_1[0x15]; *piVar19 = param_1[0x11]; param_1[0x15] = (int)piVar19; } afStack_98[(7 - iVar7) - iVar5] = (float)uVar30; param_1[0x13] = uVar30; afStack_98[(6 - iVar7) - iVar5] = 1.5881798e-38; pvVar20 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x11] = (int)pvVar20; iVar35 = 0; } iVar26 = iVar35 + uVar30; iVar35 = param_1[0x11] + iVar35; param_1[0x12] = iVar26; if (param_1[0x13] < (int)(iVar26 + uVar30)) { if (param_1[0x11] != 0) { afStack_98[(7 - iVar7) - iVar5] = 1.12104e-44; afStack_98[(6 - iVar7) - iVar5] = 1.588186e-38; piVar19 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x14] = param_1[0x14] + param_1[0x12]; piVar19[1] = param_1[0x15]; *piVar19 = param_1[0x11]; param_1[0x15] = (int)piVar19; } afStack_98[(7 - iVar7) - iVar5] = (float)uVar30; param_1[0x13] = uVar30; afStack_98[(6 - iVar7) - iVar5] = 1.5881906e-38; pvVar20 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x11] = (int)pvVar20; iVar26 = 0; } param_1[0x12] = iVar26 + uVar30; pfVar22 = (float *)(param_1[0x11] + iVar26); local_5c = 0; if (0 < *(int *)(iVar2 + 4)) { iVar26 = (int)afStack_98 + ((iVar7 * -4 + iVar13) - (int)piVar17) + 0x20; local_24 = piVar17; do { iVar24 = piVar9[local_5c + 1]; iVar38 = *(int *)((int)local_24 + (iVar15 - (int)(afStack_98 + ((8 - iVar7) - iVar5))) + iVar26); iVar10 = *(int *)(*param_1 + local_5c * 4); iVar36 = iVar10 + iVar21 * 4; iVar27 = param_1[0x12]; param_1[10] = iVar8; if (param_1[0x13] < iVar27 + 0x40) { if (param_1[0x11] != 0) { afStack_98[(7 - iVar7) - iVar5] = 1.12104e-44; afStack_98[(6 - iVar7) - iVar5] = 1.5882088e-38; piVar19 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x14] = param_1[0x14] + param_1[0x12]; piVar19[1] = param_1[0x15]; *piVar19 = param_1[0x11]; param_1[0x15] = (int)piVar19; } afStack_98[(7 - iVar7) - iVar5] = 8.96831e-44; param_1[0x13] = 0x40; afStack_98[(6 - iVar7) - iVar5] = 1.5882142e-38; pvVar20 = malloc((size_t)afStack_98[(7 - iVar7) - iVar5]); param_1[0x11] = (int)pvVar20; iVar27 = 0; } param_1[0x12] = iVar27 + 0x40; iVar28 = param_1[0x11]; afStack_98[(7 - iVar7) - iVar5] = 8.40779e-44; afStack_98[(6 - iVar7) - iVar5] = 0.0; afStack_98[(5 - iVar7) - iVar5] = (float)(iVar28 + iVar27); *local_24 = iVar28 + iVar27; afStack_98[(4 - iVar7) - iVar5] = 1.5882185e-38; memset((void *)afStack_98[(5 - iVar7) - iVar5],(int)afStack_98[(6 - iVar7) - iVar5], (size_t)afStack_98[(7 - iVar7) - iVar5]); iVar27 = 0; if (3 < iVar21) { pfVar29 = (float *)(iVar36 + 4); puVar37 = (uint *)(iVar38 + 0xc); iVar28 = (iVar21 - 4U >> 2) + 1; iVar27 = iVar28 * 4; do { pfVar29[-1] = (((float)(puVar37[-3] & 0x7fffffff) + 0.0) * 7.1771143e-07 - 764.6162) + 0.345; *pfVar29 = (((float)(*(uint *)((iVar38 - iVar36) + (int)pfVar29) & 0x7fffffff) + 0.0) * 7.1771143e-07 - 764.6162) + 0.345; pfVar29[1] = (((float)(puVar37[-1] & 0x7fffffff) + 0.0) * 7.1771143e-07 - 764.6162) + 0.345; uVar30 = *puVar37; puVar37 = puVar37 + 4; pfVar29[2] = (((float)(uVar30 & 0x7fffffff) + 0.0) * 7.1771143e-07 - 764.6162) + 0.345; pfVar29 = pfVar29 + 4; iVar28 = iVar28 + -1; } while (iVar28 != 0); } if (iVar27 < iVar21) { pfVar29 = (float *)(iVar36 + iVar27 * 4); iVar27 = iVar21 - iVar27; do { *pfVar29 = (((float)(*(uint *)((int)pfVar29 + (iVar38 - iVar36)) & 0x7fffffff) + 0.0) * 7.1771143e-07 - 764.6162) + 0.345; pfVar29 = pfVar29 + 1; iVar27 = iVar27 + -1; } while (iVar27 != 0); } afStack_98[(7 - iVar7) - iVar5] = (float)iVar35; afStack_98[(6 - iVar7) - iVar5] = 1.5882848e-38; _vp_noisemask(); afStack_98[(7 - iVar7) - iVar5] = (float)*(undefined4 *)(iVar26 + (int)local_24); afStack_98[(6 - iVar7) - iVar5] = (float)pfVar22; afStack_98[(5 - iVar7) - iVar5] = 1.5882893e-38; _vp_tonemask(); afStack_98[(5 - iVar7) - iVar5] = (float)iVar36; afStack_98[(4 - iVar7) - iVar5] = (float)iVar38; afStack_98[(3 - iVar7) - iVar5] = (float)iVar10; afStack_98[(2 - iVar7) - iVar5] = 1.4013e-45; afStack_98[(1 - iVar7) - iVar5] = (float)pfVar22; afStack_98[-iVar5 - iVar7] = 1.5882928e-38; _vp_offset_and_mix(); if (*(int *)(iVar6 + 800 + piVar9[iVar24 + 0x101] * 4) != 1) { return 0xffffffff; } afStack_98[(7 - iVar7) - iVar5] = (float)iVar10; afStack_98[(6 - iVar7) - iVar5] = (float)iVar36; afStack_98[(5 - iVar7) - iVar5] = 1.5883005e-38; uVar23 = floor1_fit(); *(undefined4 *)(*local_24 + 0x1c) = uVar23; afStack_98[(7 - iVar7) - iVar5] = 1.5883026e-38; iVar24 = FUN_00abab50(); if ((iVar24 != 0) && (*(int *)(*local_24 + 0x1c) != 0)) { iVar24 = *piVar18; fVar1 = *(float *)(piVar18[1] + 0x14); if (0 < iVar24) { iVar38 = 0; pfVar29 = pfVar22; do { iVar27 = iVar38 * 4; iVar38 = iVar38 + 1; fVar39 = *(float *)(*(int *)(piVar18[3] + 8) + iVar27) + *(float *)((iVar35 - (int)pfVar22) + (int)pfVar29); fVar40 = *(float *)(piVar18[1] + 0x6c); if (fVar39 <= *(float *)(piVar18[1] + 0x6c)) { fVar40 = fVar39; } fVar39 = fVar1 + *pfVar29; if (fVar40 <= fVar39) { fVar40 = fVar39; } *(float *)((iVar10 - (int)pfVar22) + (int)pfVar29) = fVar40; pfVar29 = pfVar29 + 1; } while (iVar38 < iVar24); } afStack_98[(7 - iVar7) - iVar5] = (float)iVar10; afStack_98[(6 - iVar7) - iVar5] = (float)iVar36; afStack_98[(5 - iVar7) - iVar5] = 1.5883268e-38; uVar23 = floor1_fit(); iVar38 = 0; *(undefined4 *)(*local_24 + 0x38) = uVar23; iVar24 = *piVar18; fVar1 = *(float *)(piVar18[1] + 0xc); if (0 < iVar24) { pfVar29 = pfVar22; do { iVar27 = iVar38 * 4; iVar38 = iVar38 + 1; fVar39 = *(float *)(*(int *)piVar18[3] + iVar27) + *(float *)((int)pfVar29 + (iVar35 - (int)pfVar22)); fVar40 = *(float *)(piVar18[1] + 0x6c); if (fVar39 <= *(float *)(piVar18[1] + 0x6c)) { fVar40 = fVar39; } fVar39 = fVar1 + *pfVar29; if (fVar40 <= fVar39) { fVar40 = fVar39; } *(float *)((int)pfVar29 + (iVar10 - (int)pfVar22)) = fVar40; pfVar29 = pfVar29 + 1; } while (iVar38 < iVar24); } afStack_98[(7 - iVar7) - iVar5] = (float)iVar10; afStack_98[(6 - iVar7) - iVar5] = (float)iVar36; afStack_98[(5 - iVar7) - iVar5] = 1.5883478e-38; uVar23 = floor1_fit(); local_50 = (int *)0x4; iVar36 = 0x10000; *(undefined4 *)*local_24 = uVar23; do { puVar31 = (undefined4 *)*local_24; afStack_98[(7 - iVar7) - iVar5] = (float)(iVar36 / 7); afStack_98[(6 - iVar7) - iVar5] = (float)puVar31[7]; afStack_98[(5 - iVar7) - iVar5] = (float)*puVar31; afStack_98[(4 - iVar7) - iVar5] = 1.5883588e-38; uVar23 = floor1_interpolate_fit(); iVar36 = iVar36 + 0x10000; *(undefined4 *)((int)local_50 + *local_24) = uVar23; local_50 = (int *)((int)local_50 + 4); } while (iVar36 < 0x70000); iVar36 = 0x10000; local_50 = (int *)0x20; do { iVar24 = *local_24; afStack_98[(7 - iVar7) - iVar5] = (float)(iVar36 / 7); afStack_98[(6 - iVar7) - iVar5] = (float)*(undefined4 *)(iVar24 + 0x38); afStack_98[(5 - iVar7) - iVar5] = (float)*(undefined4 *)(iVar24 + 0x1c); afStack_98[(4 - iVar7) - iVar5] = 1.5883746e-38; uVar23 = floor1_interpolate_fit(); iVar36 = iVar36 + 0x10000; *(undefined4 *)((int)local_50 + *local_24) = uVar23; local_50 = (int *)((int)local_50 + 4); } while (iVar36 < 0x70000); } local_24 = local_24 + 1; local_5c = local_5c + 1; } while (local_5c < *(int *)(iVar2 + 4)); } *(float *)(iVar4 + 4) = local_44; iVar21 = *(int *)(iVar2 + 4); afStack_98[(7 - iVar7) - iVar5] = 1.588387e-38; afStack_98[((7 - iVar21) - iVar7) - iVar5] = 1.5883883e-38; piVar19 = (int *)(*(int *)(param_1[0x10] + 0x68) + 0x50); if ((piVar19 == (int *)0x0) || (*piVar19 == 0)) { bVar14 = false; } else { bVar14 = true; } iVar35 = 7; if (bVar14) { iVar35 = 0; } pfVar22 = afStack_98 + (((iVar21 * -2 + 8) - iVar7) - iVar5); local_3c = iVar35; do { *(undefined4 *)((int)pfVar22 + -4) = 1; *(undefined4 *)((int)pfVar22 + -8) = 0; uVar23 = *(undefined4 *)(iVar4 + 0xc + iVar35 * 4); *(undefined4 *)((int)pfVar22 + -0xc) = uVar23; *(undefined4 *)((int)pfVar22 + -0x10) = 0xacf61a; oggpack_write(*(void **)((int)pfVar22 + -0xc),*(uint *)((int)pfVar22 + -8), *(int *)((int)pfVar22 + -4)); *(undefined4 *)((int)pfVar22 + -0x10) = *(undefined4 *)(iVar3 + 0x2c); *(int *)((int)pfVar22 + -0x14) = iVar8; *(undefined4 *)((int)pfVar22 + -0x18) = uVar23; *(undefined4 *)((int)pfVar22 + -0x1c) = 0xacf629; oggpack_write(*(void **)((int)pfVar22 + -0x18),*(uint *)((int)pfVar22 + -0x14), *(int *)((int)pfVar22 + -0x10)); if (param_1[7] != 0) { *(undefined4 *)((int)pfVar22 + -4) = 1; *(int *)((int)pfVar22 + -8) = param_1[6]; *(undefined4 *)((int)pfVar22 + -0xc) = uVar23; *(undefined4 *)((int)pfVar22 + -0x10) = 0xacf63d; oggpack_write(*(void **)((int)pfVar22 + -0xc),*(uint *)((int)pfVar22 + -8), *(int *)((int)pfVar22 + -4)); *(undefined4 *)((int)pfVar22 + -0x10) = 1; *(int *)((int)pfVar22 + -0x14) = param_1[8]; *(undefined4 *)((int)pfVar22 + -0x18) = uVar23; *(undefined4 *)((int)pfVar22 + -0x1c) = 0xacf648; oggpack_write(*(void **)((int)pfVar22 + -0x18),*(uint *)((int)pfVar22 + -0x14), *(int *)((int)pfVar22 + -0x10)); } iVar35 = *(int *)(iVar2 + 4); local_5c = 0; if (0 < iVar35) { piVar19 = piVar17; local_38 = piVar9; do { local_38 = local_38 + 1; *(undefined4 *)((int)pfVar22 + -4) = *(undefined4 *)(((int)puVar16 - (int)piVar17) + (int)piVar19); iVar35 = *local_38; *(undefined4 *)((int)pfVar22 + -8) = *(undefined4 *)(*piVar19 + local_3c * 4); *(undefined4 *)((int)pfVar22 + -0xc) = *(undefined4 *)(*(int *)(iVar3 + 0x30) + piVar9[iVar35 + 0x101] * 4); *(undefined4 *)((int)pfVar22 + -0x10) = 0xacf6a7; uVar25 = theora_oc_dec_dc_unpredict_mcu_plane(); piVar19 = piVar19 + 1; *(undefined4 *)((int)afStack_98 + (iVar13 - (int)piVar17) + 0x1c + (int)piVar19) = uVar25; local_5c = local_5c + 1; } while (local_5c < *(int *)(iVar2 + 4)); iVar35 = *(int *)(iVar2 + 4); } iVar26 = param_1[7]; *(int *)((int)pfVar22 + -4) = iVar35; *(undefined4 *)((int)pfVar22 + -8) = *(undefined4 *)(iVar6 + ((iVar26 + 0x36) * 0xf + local_3c) * 4); *(float **)((int)pfVar22 + -0xc) = afStack_98 + (8 - iVar5); *(undefined4 **)((int)pfVar22 + -0x10) = puVar16; *(int *)((int)pfVar22 + -0x14) = iVar15; *(int **)((int)pfVar22 + -0x18) = piVar9; *(int **)((int)pfVar22 + -0x1c) = piVar18; *(undefined4 *)((int)pfVar22 + -0x20) = 0xacf70d; theora_oc_dec_frags_recon_mcu_plane(); local_24 = (int *)0x0; puVar34 = (undefined1 *)pfVar22; if (0 < *piVar9) { local_50 = piVar9 + 0x111; do { iVar35 = *local_50; iVar26 = 0; local_30 = 0; if (0 < *(int *)(iVar2 + 4)) { pfVar29 = afStack_98 + (((iVar21 * -2 + 8) - iVar7) - iVar5); puVar31 = puVar16; piVar19 = piVar9; do { piVar19 = piVar19 + 1; if ((int *)*piVar19 == local_24) { *pfVar29 = 0.0; uVar25 = *pfVar29; if (*(int *)((int)afStack_98 + (iVar13 - (int)puVar16) + 0x20 + (int)puVar31) != 0) { uVar25 = 1; } local_30 = local_30 + 1; *pfVar29 = (float)uVar25; pfVar29[iVar21] = (float)*puVar31; pfVar29 = pfVar29 + 1; } iVar26 = iVar26 + 1; puVar31 = puVar31 + 1; } while (iVar26 < *(int *)(iVar2 + 4)); } *(int *)((int)pfVar22 + -4) = local_30; *(float **)((int)pfVar22 + -8) = afStack_98 + (((iVar21 * -2 + 8) - iVar7) - iVar5); iVar26 = *(int *)(iVar6 + 0x520 + iVar35 * 4); *(float **)((int)pfVar22 + -0xc) = afStack_98 + (((8 - iVar21) - iVar7) - iVar5); puVar11 = (&PTR_DAT_00b4f7b4)[iVar26]; *(undefined4 *)((int)pfVar22 + -0x10) = *(undefined4 *)(*(int *)(iVar3 + 0x34) + iVar35 * 4) ; pcVar12 = *(code **)(puVar11 + 0x14); *(int **)((int)pfVar22 + -0x14) = param_1; puVar32 = (undefined1 *)((int)pfVar22 + -0x18); *(undefined4 *)((int)pfVar22 + -0x18) = 0xacf7cd; uVar25 = (*pcVar12)(); iVar26 = 0; iVar36 = 0; if (0 < *(int *)(iVar2 + 4)) { piVar19 = piVar9; do { piVar19 = piVar19 + 1; if ((int *)*piVar19 == local_24) { afStack_98[(((iVar36 + 8) - iVar21) - iVar7) - iVar5] = (float)puVar16[iVar26]; iVar36 = iVar36 + 1; } iVar26 = iVar26 + 1; } while (iVar26 < *(int *)(iVar2 + 4)); } *(int **)(puVar32 + 0x10) = local_24; *(undefined4 *)(puVar32 + 0xc) = uVar25; iVar26 = *(int *)(iVar6 + 0x520 + iVar35 * 4); *(int *)(puVar32 + 8) = iVar36; *(float **)(puVar32 + 4) = afStack_98 + (((iVar21 * -2 + 8) - iVar7) - iVar5); puVar11 = (&PTR_DAT_00b4f7b4)[iVar26]; *(float **)puVar32 = afStack_98 + (((8 - iVar21) - iVar7) - iVar5); *(undefined4 *)(puVar32 + -4) = *(undefined4 *)(*(int *)(iVar3 + 0x34) + iVar35 * 4); pcVar12 = *(code **)(puVar11 + 0x18); *(int **)(puVar32 + -8) = param_1; *(undefined4 *)(puVar32 + -0xc) = uVar23; puVar33 = puVar32 + -0x10; *(undefined4 *)(puVar32 + -0x10) = 0xacf83e; (*pcVar12)(); pfVar22 = (float *)(puVar33 + 0x20); puVar34 = puVar33 + 0x20; local_24 = (int *)((int)local_24 + 1); local_50 = local_50 + 1; } while ((int)local_24 < *piVar9); } local_3c = local_3c + 1; *(undefined4 *)(puVar34 + -4) = 0xacf86d; uVar41 = FUN_00abab50(); iVar35 = (int)((ulonglong)uVar41 >> 0x20); pfVar22 = (float *)puVar34; } while (iVar35 <= (int)((-(uint)((int)uVar41 != 0) & 7) + 7)); return 0; } //@@ 00acf890 mapping0_inverse /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis mapping0.c decoder (vb, info): vb->vd +0x40, vd->vi +4, ci->blocksizes[vb->W], alloca per-channel bundles, per channel _floor_P[ci->floor_type[info->floorsubmap[info->chmuxlist[i]]]] (table 0xb4f938) ->inverse1 (+0x14), then residue/coupling/inverse mdct; no direct callers (mapping_P table). The function named mapping0_inverse (00acebf0) is the encoder mapping0_forward */ undefined4 mapping0_inverse(int *param_1,int *param_2) { float fVar1; float fVar2; int iVar3; int iVar4; uint uVar5; undefined *puVar6; code *pcVar7; uint *puVar8; uint *puVar9; int iVar10; int *piVar11; float *pfVar12; uint *puVar13; int iVar14; uint *puVar15; uint *puVar16; undefined1 *puVar17; undefined1 *puVar18; undefined1 *puVar19; int iVar20; int iVar21; int aiStack_e0 [28]; uint auStack_70 [13]; undefined4 uStack_3c; int *local_18; int local_14; iVar3 = *(int *)(param_1[0x10] + 4); iVar21 = *(int *)(param_1[0x10] + 0x68); iVar4 = *(int *)(iVar3 + 0x1c); uVar5 = *(uint *)(iVar4 + param_1[7] * 4); param_1[9] = uVar5; iVar14 = *(int *)(iVar3 + 4); uStack_3c = 0xacf8ce; auStack_70[0xd - iVar14] = 0xacf8d8; auStack_70[iVar14 * -2 + 0xd] = 0xacf8e2; puVar8 = auStack_70 + iVar14 * -3 + 0xe; auStack_70[iVar14 * -3 + 0xd] = 0xacf8ee; puVar9 = auStack_70 + iVar14 * -4 + 0xe; iVar20 = 0; puVar16 = puVar9; if (0 < iVar14) { puVar13 = puVar9; do { puVar6 = (&PTR_DAT_00b4f938)[*(int *)(iVar4 + 800 + param_2[param_2[iVar20 + 1] + 0x101] * 4)] ; puVar13[-1] = *(undefined4 *) (*(int *)(iVar21 + 0x30) + param_2[param_2[iVar20 + 1] + 0x101] * 4); pcVar7 = *(code **)(puVar6 + 0x14); puVar13[-2] = (uint)param_1; puVar15 = puVar13 + -3; puVar13[-3] = 0xacf93c; iVar10 = (*pcVar7)(); *(uint *)((int)puVar15 + -4) = (uVar5 & 0x3fffffff) << 1; *(undefined4 *)((int)puVar15 + -8) = 0; *(int *)(((int)puVar9 - (int)puVar8) + (int)(puVar8 + iVar20)) = iVar10; puVar8[iVar20] = (uint)(iVar10 != 0); *(undefined4 *)((int)puVar15 + -0xc) = *(undefined4 *)(*param_1 + iVar20 * 4); *(undefined4 *)((int)puVar15 + -0x10) = 0xacf95d; memset(*(void **)((int)puVar15 + -0xc),*(int *)((int)puVar15 + -8), *(size_t *)((int)puVar15 + -4)); iVar20 = iVar20 + 1; puVar16 = (uint *)((int)puVar15 + 8); puVar13 = (uint *)((int)puVar15 + 8); } while (iVar20 < *(int *)(iVar3 + 4)); } iVar20 = param_2[0x121]; iVar10 = 0; if (0 < iVar20) { piVar11 = param_2 + 0x222; do { if ((puVar8[piVar11[-0x100]] != 0) || (puVar8[*piVar11] != 0)) { puVar8[piVar11[-0x100]] = 1; puVar8[*piVar11] = 1; } iVar10 = iVar10 + 1; piVar11 = piVar11 + 1; iVar20 = param_2[0x121]; } while (iVar10 < iVar20); } local_14 = 0; puVar13 = puVar16; if (0 < *param_2) { local_18 = param_2 + 0x111; do { iVar20 = 0; iVar10 = 0; if (0 < *(int *)(iVar3 + 4)) { puVar13 = auStack_70 + (0xe - iVar14); do { if (param_2[iVar20 + 1] == local_14) { iVar10 = iVar10 + 1; *(uint *)(((int)(auStack_70 + iVar14 * -2 + 0xe) - (int)(auStack_70 + (0xe - iVar14))) + (int)puVar13) = (uint)(puVar8[iVar20] != 0); *puVar13 = *(undefined4 *)(*param_1 + iVar20 * 4); puVar13 = puVar13 + 1; } iVar20 = iVar20 + 1; } while (iVar20 < *(int *)(iVar3 + 4)); } *(int *)((int)puVar16 + -4) = iVar10; *(uint **)((int)puVar16 + -8) = auStack_70 + iVar14 * -2 + 0xe; iVar20 = *local_18; *(uint **)((int)puVar16 + -0xc) = auStack_70 + (0xe - iVar14); puVar6 = (&PTR_DAT_00b4f7b4)[*(int *)(iVar4 + 0x520 + iVar20 * 4)]; *(undefined4 *)((int)puVar16 + -0x10) = *(undefined4 *)(*(int *)(iVar21 + 0x34) + iVar20 * 4); pcVar7 = *(code **)(puVar6 + 0x1c); *(int **)((int)puVar16 + -0x14) = param_1; puVar17 = (undefined1 *)((int)puVar16 + -0x18); *(undefined4 *)((int)puVar16 + -0x18) = 0xacfa44; (*pcVar7)(); puVar16 = (uint *)(puVar17 + 0x14); puVar13 = (uint *)(puVar17 + 0x14); local_14 = local_14 + 1; local_18 = local_18 + 1; } while (local_14 < *param_2); iVar20 = param_2[0x121]; } iVar14 = iVar20 + -1; if (-1 < iVar14) { piVar11 = param_2 + iVar20 + 0x221; do { pfVar12 = *(float **)(*param_1 + piVar11[-0x100] * 4); if (0 < (int)uVar5 / 2) { iVar10 = *(int *)(*param_1 + *piVar11 * 4) - (int)pfVar12; iVar20 = (int)uVar5 / 2; do { fVar1 = *pfVar12; fVar2 = *(float *)(iVar10 + (int)pfVar12); if (fVar1 <= 0.0) { if (fVar2 <= 0.0) { *(float *)(iVar10 + (int)pfVar12) = fVar1; *pfVar12 = fVar1 - fVar2; } else { *(float *)(iVar10 + (int)pfVar12) = fVar2 + fVar1; } } else if (fVar2 <= 0.0) { *(float *)(iVar10 + (int)pfVar12) = fVar1; *pfVar12 = fVar2 + fVar1; } else { *(float *)(iVar10 + (int)pfVar12) = fVar1 - fVar2; } pfVar12 = pfVar12 + 1; iVar20 = iVar20 + -1; } while (iVar20 != 0); } piVar11 = piVar11 + -1; iVar14 = iVar14 + -1; } while (-1 < iVar14); } iVar20 = 0; iVar14 = *(int *)(iVar3 + 4); puVar18 = (undefined1 *)puVar13; if (0 < iVar14) { do { iVar14 = param_2[param_2[iVar20 + 1] + 0x101]; puVar6 = (&PTR_DAT_00b4f938)[*(int *)(iVar4 + 800 + iVar14 * 4)]; *(undefined4 *)(puVar18 + -4) = *(undefined4 *)(*param_1 + iVar20 * 4); *(uint *)(puVar18 + -8) = puVar9[iVar20]; *(undefined4 *)(puVar18 + -0xc) = *(undefined4 *)(*(int *)(iVar21 + 0x30) + iVar14 * 4); pcVar7 = *(code **)(puVar6 + 0x18); *(int **)(puVar18 + -0x10) = param_1; puVar19 = puVar18 + -0x14; *(undefined4 *)(puVar18 + -0x14) = 0xacfb49; (*pcVar7)(); iVar14 = *(int *)(iVar3 + 4); iVar20 = iVar20 + 1; puVar13 = (uint *)(puVar19 + 0x10); puVar18 = puVar19 + 0x10; } while (iVar20 < iVar14); } iVar21 = 0; if (0 < iVar14) { do { *(undefined4 *)((int)puVar13 + -4) = *(undefined4 *)(*param_1 + iVar21 * 4); *(undefined4 *)((int)puVar13 + -8) = 0xacfb77; mdct_backward(); iVar21 = iVar21 + 1; } while (iVar21 < *(int *)(iVar3 + 4)); } return 0; } //@@ 00acfb90 FUN_00acfb90 void FUN_00acfb90(void *param_1) { if (param_1 != (void *)0x0) { memset(param_1,0,0xb18); free(param_1); } return; } //@@ 00acfbc0 FUN_00acfbc0 void FUN_00acfbc0(void *param_1) { void *_Memory; int iVar1; if (param_1 != (void *)0x0) { iVar1 = 0; if (0 < *(int *)((int)param_1 + 4)) { do { _Memory = *(void **)(*(int *)((int)param_1 + 0x14) + iVar1 * 4); if (_Memory != (void *)0x0) { free(_Memory); } iVar1 = iVar1 + 1; } while (iVar1 < *(int *)((int)param_1 + 4)); } free(*(void **)((int)param_1 + 0x14)); iVar1 = 0; if (0 < *(int *)((int)param_1 + 0x18)) { do { free(*(void **)(*(int *)((int)param_1 + 0x1c) + iVar1 * 4)); iVar1 = iVar1 + 1; } while (iVar1 < *(int *)((int)param_1 + 0x18)); } free(*(void **)((int)param_1 + 0x1c)); memset(param_1,0,0x2c); free(param_1); } return; } //@@ 00acfc30 FUN_00acfc30 void FUN_00acfc30(uint *param_1,void *param_2) { uint uVar1; int iVar2; uint uVar3; uint *puVar4; int iVar5; int local_8; iVar5 = 0; oggpack_write(param_2,*param_1,0x18); oggpack_write(param_2,param_1[1],0x18); oggpack_write(param_2,param_1[2] - 1,0x18); oggpack_write(param_2,param_1[3] - 1,6); oggpack_write(param_2,param_1[5],8); local_8 = 0; if (0 < (int)param_1[3]) { puVar4 = param_1 + 6; do { uVar3 = *puVar4; iVar2 = 0; uVar1 = uVar3; if (uVar3 == 0) { LAB_00acfccc: iVar2 = 4; } else { do { iVar2 = iVar2 + 1; uVar1 = uVar1 >> 1; } while (uVar1 != 0); if (iVar2 < 4) goto LAB_00acfccc; oggpack_write(param_2,uVar3,3); oggpack_write(param_2,1,1); uVar3 = (int)*puVar4 >> 3; iVar2 = 5; } oggpack_write(param_2,uVar3,iVar2); iVar2 = 0; for (uVar3 = *puVar4; uVar3 != 0; uVar3 = uVar3 >> 1) { iVar2 = iVar2 + (uVar3 & 1); } iVar5 = iVar5 + iVar2; local_8 = local_8 + 1; puVar4 = puVar4 + 1; } while (local_8 < (int)param_1[3]); if (0 < iVar5) { param_1 = param_1 + 0x46; do { oggpack_write(param_2,*param_1,8); param_1 = param_1 + 1; iVar5 = iVar5 + -1; } while (iVar5 != 0); } } return; } //@@ 00acfd30 FUN_00acfd30 undefined4 * FUN_00acfd30(int param_1) { undefined4 *_Dst; undefined4 uVar1; int iVar2; int iVar3; uint uVar4; int iVar5; int *piVar6; int iVar7; uint *local_10; int local_c; iVar7 = 0; _Dst = calloc(1,0xb18); iVar5 = *(int *)(param_1 + 0x1c); uVar1 = FUN_00ab7120(); *_Dst = uVar1; uVar1 = FUN_00ab7120(); _Dst[1] = uVar1; iVar2 = FUN_00ab7120(); _Dst[2] = iVar2 + 1; iVar2 = FUN_00ab7120(); _Dst[3] = iVar2 + 1; iVar3 = FUN_00ab7120(); _Dst[5] = iVar3; if (-1 < iVar3) { local_c = 0; if (0 < iVar2 + 1) { local_10 = _Dst + 6; do { uVar4 = FUN_00ab7120(); iVar2 = FUN_00ab7120(); if (iVar2 < 0) goto LAB_00acfed1; if (iVar2 != 0) { iVar2 = FUN_00ab7120(); if (iVar2 < 0) goto LAB_00acfed1; uVar4 = uVar4 | iVar2 << 3; } iVar2 = 0; *local_10 = uVar4; for (; uVar4 != 0; uVar4 = uVar4 >> 1) { iVar2 = iVar2 + (uVar4 & 1); } local_10 = local_10 + 1; local_c = local_c + 1; iVar7 = iVar7 + iVar2; } while (local_c < (int)_Dst[3]); } iVar2 = 0; if (0 < iVar7) { piVar6 = _Dst + 0x46; do { iVar3 = FUN_00ab7120(); if (iVar3 < 0) goto LAB_00acfed1; *piVar6 = iVar3; iVar2 = iVar2 + 1; piVar6 = piVar6 + 1; } while (iVar2 < iVar7); } iVar2 = _Dst[5]; if (iVar2 < *(int *)(iVar5 + 0x18)) { iVar3 = 0; if (0 < iVar7) { piVar6 = _Dst + 0x46; do { if ((*(int *)(iVar5 + 0x18) <= *piVar6) || (*(int *)(*(int *)(iVar5 + 0x720 + *piVar6 * 4) + 0xc) == 0)) goto LAB_00acfed1; iVar3 = iVar3 + 1; piVar6 = piVar6 + 1; } while (iVar3 < iVar7); iVar2 = _Dst[5]; } iVar3 = 1; piVar6 = *(int **)(iVar5 + 0x720 + iVar2 * 4); iVar5 = *piVar6; if (0 < iVar5) { while (iVar3 = iVar3 * _Dst[3], iVar3 <= piVar6[1]) { iVar5 = iVar5 + -1; if (iVar5 < 1) { _Dst[4] = iVar3; return _Dst; } } } } } LAB_00acfed1: memset(_Dst,0,0xb18); free(_Dst); return (undefined4 *)0x0; } //@@ 00acff00 res0_look /* DB: libvorbis res0.c: info=param_2, parts=info->partitions (+0xc), fullbooks = codec_setup +0xb20, phrasebook = fullbooks + groupbook*0x38, calloc partbooks, ov_ilog(secondstages[j]) loops; pointer in the residue function tables 00b5f208/228/248 (residue0/1/2) */ int * res0_look(int param_1,int param_2) { size_t _Count; int iVar1; int *piVar2; void *pvVar3; uint uVar4; void *pvVar5; int iVar6; int *piVar7; size_t _Count_00; int iVar8; size_t sVar9; size_t sVar10; int iVar11; int local_20; int local_1c; int local_10; int local_c; piVar2 = calloc(1,0x2c); iVar6 = 0; local_10 = 0; sVar9 = 0; iVar8 = *(int *)(*(int *)(param_1 + 4) + 0x1c); *piVar2 = param_2; _Count = *(size_t *)(param_2 + 0xc); piVar2[1] = _Count; iVar1 = *(int *)(iVar8 + 0xb20); piVar2[3] = iVar1; piVar7 = (int *)(iVar1 + *(int *)(param_2 + 0x14) * 0x38); piVar2[4] = (int)piVar7; iVar1 = *piVar7; pvVar3 = calloc(_Count,4); local_c = 0; piVar2[5] = (int)pvVar3; if (0 < (int)_Count) { sVar10 = sVar9; do { uVar4 = *(uint *)(param_2 + 0x18 + local_c * 4); _Count_00 = 0; sVar9 = sVar10; if (uVar4 != 0) { do { _Count_00 = _Count_00 + 1; uVar4 = uVar4 >> 1; } while (uVar4 != 0); if (_Count_00 != 0) { sVar9 = _Count_00; if ((int)_Count_00 <= (int)sVar10) { sVar9 = sVar10; } pvVar5 = calloc(_Count_00,4); iVar11 = 0; *(void **)((int)pvVar3 + local_c * 4) = pvVar5; if (0 < (int)_Count_00) { uVar4 = 1; piVar7 = (int *)(param_2 + 0x118 + iVar6 * 4); do { if ((*(uint *)(param_2 + 0x18 + local_c * 4) & uVar4) != 0) { iVar6 = *piVar7; local_10 = local_10 + 1; piVar7 = piVar7 + 1; *(int *)(*(int *)((int)pvVar3 + local_c * 4) + iVar11 * 4) = *(int *)(iVar8 + 0xb20) + iVar6 * 0x38; } iVar11 = iVar11 + 1; uVar4 = uVar4 << 1 | (uint)((int)uVar4 < 0); } while (iVar11 < (int)_Count_00); iVar6 = local_10; } } } local_c = local_c + 1; sVar10 = sVar9; } while (local_c < (int)_Count); } iVar8 = 1; piVar2[6] = 1; local_1c = 1; if (0 < iVar1) { iVar6 = iVar1; do { iVar8 = iVar8 * _Count; iVar6 = iVar6 + -1; } while (iVar6 != 0); piVar2[6] = iVar8; local_1c = iVar8; } piVar2[2] = sVar9; pvVar3 = malloc(local_1c * 4); local_20 = 0; piVar2[7] = (int)pvVar3; if (0 < local_1c) { do { piVar7 = (int *)((int)pvVar3 + local_20 * 4); pvVar5 = malloc(iVar1 * 4); *piVar7 = (int)pvVar5; iVar8 = 0; if (0 < iVar1) { param_2 = local_20; iVar6 = local_1c; do { iVar6 = iVar6 / (int)_Count; iVar11 = param_2 / iVar6; param_2 = param_2 - iVar11 * iVar6; *(int *)(*piVar7 + iVar8 * 4) = iVar11; iVar8 = iVar8 + 1; } while (iVar8 < iVar1); } local_20 = local_20 + 1; } while (local_20 < local_1c); } return piVar2; } //@@ 00ad0120 local_book_besterror /* DB: libvorbis res0.c: book fields dim/minval/delta/quantvals, ze=qv>>1; only caller _encodepart (0xad0520) which then oggpack_write(codelist[entry], lengthlist[entry]) */ uint local_book_besterror(void) { int *piVar1; uint uVar2; uint uVar3; uint uVar4; int *piVar5; int iVar6; int iVar7; uint uVar8; uint *in_ECX; int *piVar9; int *in_EDX; int *piVar10; uint uVar11; uint uVar12; undefined1 auVar13 [16]; undefined1 auVar14 [16]; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int local_74; int aiStack_70 [3]; int local_64 [13]; int local_30; int local_2c; int *local_28; uint local_24; int *local_20; uint local_1c [2]; int *local_14; uint local_10; uint *local_c; uint local_8; local_10 = in_ECX[0xd]; uVar11 = 0; local_24 = in_ECX[0xc]; uVar12 = *in_ECX; uVar8 = in_ECX[0xb]; piVar5 = (int *)((int)uVar8 >> 1); local_8 = uVar12; local_1c[0] = uVar8; local_20 = piVar5; local_64[4] = 0; local_64[5] = 0; local_64[6] = 0; local_64[7] = 0; local_64[8] = 0; local_64[9] = 0; local_64[10] = 0; local_64[0xb] = 0; local_14 = in_EDX; local_c = in_ECX; if (0 < (int)uVar12) { if (local_10 == 1) { piVar10 = local_64 + uVar12 + 4; local_2c = (int)in_EDX - (int)(local_64 + 4); do { uVar8 = local_1c[0]; piVar9 = local_20; piVar10 = piVar10 + -1; local_28 = piVar10; iVar6 = *(int *)((int)piVar10 + local_2c) - local_c[0xc]; if (iVar6 < (int)piVar5) { iVar6 = ((int)piVar5 - iVar6) * 2 + -1; } else { iVar6 = (iVar6 - (int)piVar5) * 2; } if (iVar6 < 0) { iVar6 = 0; } else if ((int)local_1c[0] <= iVar6) { iVar6 = local_1c[0] - 1; } uVar11 = uVar11 * local_1c[0] + iVar6; *piVar10 = *(int *)((int)piVar10 + local_2c); uVar12 = uVar12 - 1; piVar5 = piVar9; } while (uVar12 != 0); } else { piVar10 = local_64 + uVar12 + 4; local_2c = (int)local_10 >> 1; local_1c[1] = (int)in_EDX - (int)(local_64 + 4); local_28 = (int *)uVar12; iVar6 = (int)local_10 >> 1; do { iVar15 = local_2c; piVar10 = piVar10 + -1; local_20 = piVar10; iVar6 = (int)((*(int *)(local_1c[1] + (int)piVar10) - local_24) + iVar6) / (int)local_10; if (iVar6 < (int)piVar5) { iVar7 = ((int)piVar5 - iVar6) * 2 + -1; } else { iVar7 = (iVar6 - (int)piVar5) * 2; } if (iVar7 < 0) { iVar7 = 0; } else if ((int)local_1c[0] <= iVar7) { iVar7 = local_1c[0] - 1; } uVar11 = uVar11 * local_1c[0] + iVar7; uVar12 = (int)local_28 - 1; local_28 = (int *)uVar12; *piVar10 = iVar6 * local_10 + local_c[0xc]; iVar6 = iVar15; } while (uVar12 != 0); uVar8 = local_1c[0]; } } local_1c[1] = *(int *)(local_c[3] + 8); piVar5 = local_14; uVar12 = local_8; if (*(char *)(*(int *)(local_c[3] + 8) + uVar11) < '\x01') { local_2c = -1; local_74 = 0; aiStack_70[0] = 0; aiStack_70[1] = 0; aiStack_70[2] = 0; piVar10 = (int *)((uVar8 - 1) * local_10 + local_24); local_28 = piVar10; local_64[0xc] = local_c[1]; local_1c[0] = 0; local_64[0] = 0; local_64[1] = 0; local_64[2] = 0; local_64[3] = 0; if (0 < (int)local_c[1]) { do { if ('\0' < *(char *)(local_1c[1] + local_1c[0])) { iVar6 = 0; local_20 = (int *)0x0; if (((0 < (int)uVar12) && (7 < uVar12)) && (1 < __isa_available)) { uVar8 = uVar12 & 0x80000007; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffff8) + 1; } local_24 = uVar12 - uVar8; iVar18 = 0; iVar19 = 0; iVar20 = 0; iVar21 = 0; local_20 = (int *)((int)local_64 + -(int)piVar5); iVar15 = 0; iVar7 = 0; iVar16 = 0; iVar17 = 0; piVar10 = piVar5; do { iVar6 = iVar6 + 8; piVar9 = piVar10 + 8; piVar1 = (int *)((int)aiStack_70 + (-0x24 - (int)piVar5) + (int)piVar9); auVar13._0_4_ = *piVar1 - *piVar10; auVar13._4_4_ = piVar1[1] - piVar10[1]; auVar13._8_4_ = piVar1[2] - piVar10[2]; auVar13._12_4_ = piVar1[3] - piVar10[3]; auVar13 = pmulld(auVar13,auVar13); iVar18 = iVar18 + auVar13._0_4_; iVar19 = iVar19 + auVar13._4_4_; iVar20 = iVar20 + auVar13._8_4_; iVar21 = iVar21 + auVar13._12_4_; piVar1 = (int *)((int)aiStack_70 + -(int)piVar5 + -0x14 + (int)piVar9); auVar14._0_4_ = *piVar1 - piVar10[4]; auVar14._4_4_ = piVar1[1] - piVar10[5]; auVar14._8_4_ = piVar1[2] - piVar10[6]; auVar14._12_4_ = piVar1[3] - piVar10[7]; auVar13 = pmulld(auVar14,auVar14); iVar15 = iVar15 + auVar13._0_4_; iVar7 = iVar7 + auVar13._4_4_; iVar16 = iVar16 + auVar13._8_4_; iVar17 = iVar17 + auVar13._12_4_; piVar10 = piVar9; } while (iVar6 < (int)(uVar12 - uVar8)); local_20 = (int *)(iVar15 + iVar18 + iVar16 + iVar20 + iVar7 + iVar19 + iVar17 + iVar21) ; piVar5 = local_14; } iVar15 = 0; local_24 = 0; local_c = (uint *)0x0; if (iVar6 < (int)local_8) { if ((int)(local_8 - iVar6) < 2) { LAB_00ad03e6: local_20 = (int *)((int)local_20 + (aiStack_70[iVar6 + -1] - piVar5[iVar6]) * (aiStack_70[iVar6 + -1] - piVar5[iVar6])); } else { piVar10 = piVar5 + iVar6; iVar7 = -(int)piVar5; iVar16 = ((local_8 - iVar6) - 2 >> 1) + 1; local_30 = (int)aiStack_70 + iVar7; iVar6 = iVar6 + iVar16 * 2; do { iVar15 = *(int *)((int)aiStack_70 + iVar7 + -4 + (int)piVar10) - *piVar10; iVar15 = local_24 + iVar15 * iVar15; local_24 = iVar15; iVar17 = *(int *)((int)aiStack_70 + iVar7 + -8 + (int)(piVar10 + 2)) - piVar10[1]; local_c = (uint *)((int)local_c + iVar17 * iVar17); iVar16 = iVar16 + -1; piVar10 = piVar10 + 2; } while (iVar16 != 0); piVar5 = local_14; if (iVar6 < (int)local_8) goto LAB_00ad03e6; } local_20 = (int *)((int)local_20 + (int)local_c + iVar15); } if ((local_2c == -1) || ((int)local_20 < local_2c)) { local_64[4] = local_74; local_64[5] = aiStack_70[0]; local_64[6] = aiStack_70[1]; local_64[7] = aiStack_70[2]; local_2c = (int)local_20; local_64[8] = local_64[0]; local_64[9] = local_64[1]; local_64[10] = local_64[2]; local_64[0xb] = local_64[3]; uVar11 = local_1c[0]; } piVar10 = local_28; uVar12 = local_8; } iVar6 = 0; if ((int)piVar10 <= local_74) { piVar9 = &local_74; iVar15 = iVar6; do { iVar6 = iVar15 + 1; *piVar9 = 0; piVar1 = aiStack_70 + iVar15; piVar9 = aiStack_70 + iVar15; iVar15 = iVar6; } while ((int)piVar10 <= *piVar1); } iVar15 = aiStack_70[iVar6 + -1]; if (-1 < iVar15) { iVar15 = iVar15 + local_10; piVar5 = local_14; } aiStack_70[iVar6 + -1] = -iVar15; local_1c[0] = local_1c[0] + 1; } while ((int)local_1c[0] < local_64[0xc]); } } if ((-1 < (int)uVar11) && (iVar6 = 0, 0 < (int)uVar12)) { if ((0xf < uVar12) && ((local_64 + uVar12 + 3 < piVar5 || (piVar5 + (uVar12 - 1) < local_64 + 4)))) { uVar8 = uVar12 & 0x8000000f; if ((int)uVar8 < 0) { uVar8 = (uVar8 - 1 | 0xfffffff0) + 1; } do { iVar15 = local_64[iVar6 + 5]; iVar7 = local_64[iVar6 + 6]; iVar16 = local_64[iVar6 + 7]; iVar17 = local_64[iVar6 + 8]; iVar18 = local_64[iVar6 + 9]; iVar19 = local_64[iVar6 + 10]; iVar20 = local_64[iVar6 + 0xb]; *piVar5 = *piVar5 - local_64[iVar6 + 4]; piVar5[1] = piVar5[1] - iVar15; piVar5[2] = piVar5[2] - iVar7; piVar5[3] = piVar5[3] - iVar16; iVar15 = local_64[iVar6 + 0xc]; iVar7 = local_64[iVar6 + 0xd]; iVar16 = local_64[iVar6 + 0xe]; iVar21 = local_64[iVar6 + 0xf]; piVar5[4] = piVar5[4] - iVar17; piVar5[5] = piVar5[5] - iVar18; piVar5[6] = piVar5[6] - iVar19; piVar5[7] = piVar5[7] - iVar20; iVar17 = local_64[iVar6 + 0x10]; uVar2 = local_1c[iVar6 + -1]; uVar3 = local_1c[iVar6]; uVar4 = local_1c[iVar6 + 1]; iVar6 = iVar6 + 0x10; piVar5[8] = piVar5[8] - iVar15; piVar5[9] = piVar5[9] - iVar7; piVar5[10] = piVar5[10] - iVar16; piVar5[0xb] = piVar5[0xb] - iVar21; piVar5[0xc] = piVar5[0xc] - iVar17; piVar5[0xd] = piVar5[0xd] - uVar2; piVar5[0xe] = piVar5[0xe] - uVar3; piVar5[0xf] = piVar5[0xf] - uVar4; piVar5 = piVar5 + 0x10; } while (iVar6 < (int)(uVar12 - uVar8)); if ((int)uVar12 <= iVar6) { return uVar11; } } do { *piVar5 = *piVar5 - local_64[iVar6 + 4]; iVar6 = iVar6 + 1; piVar5 = piVar5 + 1; } while (iVar6 < (int)uVar12); } return uVar11; } //@@ 00ad0520 _encodepart /* DB: libvorbis (round 7 agent) */ longlong _encodepart(void *param_1,undefined4 param_2,int param_3,int *param_4) { int iVar1; int *piVar2; int iVar3; int local_8; piVar2 = param_4; local_8 = 0; iVar1 = *param_4; param_4 = (int *)(param_3 / iVar1); if ((int)param_4 < 1) { return (ulonglong)(uint)(param_3 % iVar1) << 0x20; } do { iVar3 = local_book_besterror(); if ((iVar3 < 0) || (*(int *)(piVar2[3] + 4) <= iVar3)) { iVar3 = 0; } else { oggpack_write(param_1,*(uint *)(piVar2[5] + iVar3 * 4), (int)*(char *)(*(int *)(piVar2[3] + 8) + iVar3)); iVar3 = (int)*(char *)(*(int *)(piVar2[3] + 8) + iVar3); } local_8 = local_8 + iVar3; param_4 = (int *)((int)param_4 + -1); } while (param_4 != (int *)0x0); return CONCAT44(iVar1,local_8); } //@@ 00ad05b0 FUN_00ad05b0 undefined4 FUN_00ad05b0(int param_1,int param_2,int *param_3) { int *piVar1; int iVar2; int iVar3; int iVar4; byte bVar5; int iVar6; int iVar7; void *in_ECX; int iVar8; int *in_EDX; int *piVar9; int iVar10; int iVar11; int local_2c; int local_28; int local_1c; int local_c; piVar1 = (int *)*in_EDX; iVar2 = piVar1[3]; iVar3 = piVar1[2]; iVar4 = *(int *)in_EDX[4]; iVar6 = (piVar1[1] - *piVar1) / iVar3; local_c = 0; if (0 < in_EDX[2]) { do { iVar10 = 0; if (0 < iVar6) { do { if ((local_c == 0) && (local_1c = 0, 0 < param_2)) { do { iVar8 = 1; iVar11 = *(int *)(param_3[local_1c] + iVar10 * 4); if (1 < iVar4) { piVar9 = (int *)(param_3[local_1c] + (iVar10 + 1) * 4); do { iVar11 = iVar11 * iVar2; if (iVar8 + iVar10 < iVar6) { iVar11 = iVar11 + *piVar9; } iVar8 = iVar8 + 1; piVar9 = piVar9 + 1; } while (iVar8 < iVar4); } iVar8 = in_EDX[4]; if (iVar11 < *(int *)(iVar8 + 4)) { if ((iVar11 < 0) || (*(int *)(*(int *)(iVar8 + 0xc) + 4) <= iVar11)) { in_EDX[9] = in_EDX[9]; } else { oggpack_write(in_ECX,*(uint *)(*(int *)(iVar8 + 0x14) + iVar11 * 4), (int)*(char *)(*(int *)(*(int *)(iVar8 + 0xc) + 8) + iVar11)); in_EDX[9] = in_EDX[9] + (int)*(char *)(*(int *)(*(int *)(iVar8 + 0xc) + 8) + iVar11); } } local_1c = local_1c + 1; } while (local_1c < param_2); } local_28 = 0; if (0 < iVar4) { local_2c = iVar10 * iVar3; do { if (iVar6 <= iVar10) goto LAB_00ad0770; iVar11 = *piVar1; if (0 < param_2) { bVar5 = (byte)local_c & 0x1f; piVar9 = param_3; iVar8 = param_2; do { iVar7 = *(int *)(*piVar9 + iVar10 * 4); if (((piVar1[iVar7 + 6] & (1 << bVar5 | 1U >> 0x20 - bVar5)) != 0) && (iVar7 = *(int *)(*(int *)(in_EDX[5] + iVar7 * 4) + local_c * 4), iVar7 != 0)) { iVar7 = _encodepart(in_ECX,*(int *)((int)piVar9 + (param_1 - (int)param_3)) + (iVar11 + local_2c) * 4,iVar3,iVar7); in_EDX[8] = in_EDX[8] + iVar7; } piVar9 = piVar9 + 1; iVar8 = iVar8 + -1; } while (iVar8 != 0); } local_2c = local_2c + iVar3; local_28 = local_28 + 1; iVar10 = iVar10 + 1; } while (local_28 < iVar4); } } while (iVar10 < iVar6); } LAB_00ad0770: local_c = local_c + 1; } while (local_c < in_EDX[2]); } return 0; } //@@ 00ad0790 _01inverse /* WARNING: Function: __alloca_probe_16 replaced with injection: alloca_probe */ /* WARNING: Unable to track spacebase fully for stack */ /* DB: libvorbis res0.c _01inverse(vb, vl, in, ch, decodepart): n = min(blocksize/2 (+0x24 >> 1), info->end) - begin, alloca partword arrays, decodepart callback param_3; callers res0_inverse 00ad0a20 and res1_inverse 00ad0e10 */ undefined4 _01inverse(int *param_1,int param_2,code *param_3) { int *piVar1; int iVar2; int iVar3; int iVar4; int iVar5; undefined4 *puVar6; undefined4 uVar7; int iVar8; int in_ECX; int iVar9; int *in_EDX; code *pcVar10; undefined1 *puVar11; int *piVar12; undefined1 *puVar13; undefined1 *puVar14; int iVar15; uint uVar16; int *piVar17; int aiStack_244 [128]; int local_2c; int local_28; int local_10; int local_c; piVar1 = (int *)*in_EDX; iVar15 = *(int *)(in_ECX + 0x24) >> 1; iVar2 = piVar1[2]; iVar3 = *(int *)in_EDX[4]; iVar5 = piVar1[1]; if (iVar15 <= piVar1[1]) { iVar5 = iVar15; } if (0 < iVar5 - *piVar1) { iVar5 = (iVar5 - *piVar1) / iVar2; piVar12 = aiStack_244 + (0x80 - param_2); iVar15 = 0; if (0 < param_2) { uVar16 = ((iVar5 + -1 + iVar3) / iVar3) * 4 + 7U & 0xfffffff8; pcVar10 = malloc_exref; piVar12 = aiStack_244 + (0x80 - param_2); do { iVar9 = *(int *)(in_ECX + 0x48); if (*(int *)(in_ECX + 0x4c) < (int)(iVar9 + uVar16)) { if (*(int *)(in_ECX + 0x44) != 0) { *(undefined4 *)((int)piVar12 + -4) = 8; puVar11 = (undefined1 *)((int)piVar12 + -8); *(undefined4 *)((int)piVar12 + -8) = 0xad0824; puVar6 = (undefined4 *)(*pcVar10)(); piVar12 = (int *)(puVar11 + 4); *(int *)(in_ECX + 0x50) = *(int *)(in_ECX + 0x50) + *(int *)(in_ECX + 0x48); puVar6[1] = *(undefined4 *)(in_ECX + 0x54); *puVar6 = *(undefined4 *)(in_ECX + 0x44); *(undefined4 **)(in_ECX + 0x54) = puVar6; pcVar10 = malloc_exref; } *(uint *)((int)piVar12 + -4) = uVar16; *(uint *)(in_ECX + 0x4c) = uVar16; puVar13 = (undefined1 *)((int)piVar12 + -8); *(undefined4 *)((int)piVar12 + -8) = 0xad084b; uVar7 = (*pcVar10)(); pcVar10 = malloc_exref; piVar12 = (int *)(puVar13 + 4); *(undefined4 *)(in_ECX + 0x44) = uVar7; iVar9 = 0; } *(uint *)(in_ECX + 0x48) = iVar9 + uVar16; aiStack_244[(iVar15 + 0x80) - param_2] = *(int *)(in_ECX + 0x44) + iVar9; iVar15 = iVar15 + 1; } while (iVar15 < param_2); } local_c = 0; if (0 < in_EDX[2]) { do { iVar15 = 0; local_28 = 0; if (0 < iVar5) { local_10 = 0; do { if ((local_c == 0) && (0 < param_2)) { iVar9 = 0; do { iVar15 = in_EDX[4]; if (*(int *)(iVar15 + 8) < 1) { return 0; } *(undefined4 *)((int)piVar12 + -4) = 0xad08cd; iVar8 = FUN_00ab75d0(); if (iVar8 < 0) { return 0; } iVar15 = *(int *)(*(int *)(iVar15 + 0x18) + iVar8 * 4); if (iVar15 == -1) { return 0; } if (piVar1[4] <= iVar15) { return 0; } *(undefined4 *)(local_10 + aiStack_244[(iVar9 + 0x80) - param_2]) = *(undefined4 *)(in_EDX[7] + iVar15 * 4); if (*(int *)(local_10 + aiStack_244[(iVar9 + 0x80) - param_2]) == 0) { return 0; } iVar9 = iVar9 + 1; iVar15 = local_28; } while (iVar9 < param_2); } iVar9 = 0; if (0 < iVar3) { local_2c = iVar15 * iVar2; do { if (iVar5 <= iVar15) break; iVar15 = 0; if (0 < param_2) { piVar17 = param_1; do { iVar8 = *(int *)(*(int *)(*(int *)((int)aiStack_244 + (param_2 * -4 - (int)param_1) + 0x200 + (int)piVar17) + local_10) + iVar9 * 4); if (((piVar1[iVar8 + 6] & 1 << ((byte)local_c & 0x1f)) != 0) && (iVar8 = *(int *)(*(int *)(in_EDX[5] + iVar8 * 4) + local_c * 4), iVar8 != 0) ) { *(int *)((int)piVar12 + -4) = iVar2; iVar4 = *piVar1; *(int *)((int)piVar12 + -8) = in_ECX + 4; *(int *)((int)piVar12 + -0xc) = *piVar17 + (iVar4 + local_2c) * 4; *(int *)((int)piVar12 + -0x10) = iVar8; puVar14 = (undefined1 *)((int)piVar12 + -0x14); *(undefined4 *)((int)piVar12 + -0x14) = 0xad09a4; iVar8 = (*param_3)(); piVar12 = (int *)(puVar14 + 0x10); if (iVar8 == -1) { return 0; } } iVar15 = iVar15 + 1; piVar17 = piVar17 + 1; } while (iVar15 < param_2); } iVar9 = iVar9 + 1; iVar15 = local_28 + 1; local_2c = local_2c + iVar2; local_28 = iVar15; } while (iVar9 < iVar3); } local_10 = local_10 + 4; } while (iVar15 < iVar5); } local_c = local_c + 1; } while (local_c < in_EDX[2]); } } return 0; } //@@ 00ad0a20 FUN_00ad0a20 undefined4 FUN_00ad0a20(undefined4 param_1,undefined4 param_2,undefined4 *param_3,int param_4,int param_5) { undefined4 uVar1; undefined4 *puVar2; int iVar3; iVar3 = 0; if (0 < param_5) { puVar2 = param_3; do { if (*(int *)((param_4 - (int)param_3) + (int)puVar2) != 0) { param_3[iVar3] = *puVar2; iVar3 = iVar3 + 1; } puVar2 = puVar2 + 1; param_5 = param_5 + -1; } while (param_5 != 0); if (iVar3 != 0) { uVar1 = _01inverse(param_3,iVar3,vorbis_book_decodevs_add); return uVar1; } } return 0; } //@@ 00ad0a80 FUN_00ad0a80 undefined4 FUN_00ad0a80(void) { undefined4 uVar1; undefined4 *puVar2; int iVar3; undefined4 *in_stack_00000010; int in_stack_00000014; int in_stack_00000018; undefined4 in_stack_0000001c; iVar3 = 0; if (0 < in_stack_00000018) { puVar2 = in_stack_00000010; do { if (*(int *)((in_stack_00000014 - (int)in_stack_00000010) + (int)puVar2) != 0) { in_stack_00000010[iVar3] = *puVar2; iVar3 = iVar3 + 1; } puVar2 = puVar2 + 1; in_stack_00000018 = in_stack_00000018 + -1; } while (in_stack_00000018 != 0); if (iVar3 != 0) { uVar1 = FUN_00ad05b0(in_stack_00000010,iVar3,in_stack_0000001c,puVar2); return uVar1; } } return 0; } //@@ 00ad0ae0 res1_class /* DB: libvorbis res0.c: slot 5 (class) of residue1_exportbundle at 00b5f200 {res0_pack acfc30, res0_unpack acfd30, res0_look acff00, res0_free_info, res0_free_look, res1_class, res1_forward ad0a80, res1_inverse ad0e10}; compacts nonzero channels then inlined _01class with _vorbis_block_alloc (vb +0x44..+0x54) */ int res1_class(int param_1,int *param_2,int *param_3,int param_4,int param_5) { int iVar1; uint uVar2; int iVar3; undefined4 *puVar4; undefined4 uVar5; void *pvVar6; undefined1 (*pauVar7) [16]; int *piVar8; int *piVar9; int iVar10; uint *puVar11; code *pcVar12; int iVar13; int iVar14; int iVar15; int iVar16; uint uVar17; int *piVar18; int iVar19; int iVar21; int iVar22; undefined1 auVar20 [16]; int iVar23; uint uVar24; uint uVar25; uint uVar26; uint uVar27; int iVar28; int iVar29; int iVar30; uint uVar31; uint uVar32; uint uVar33; uint uVar34; int iVar35; int iVar36; int iVar37; int iVar38; int local_28; int local_24; int local_20; iVar13 = 0; if (0 < param_5) { piVar9 = param_3; do { if (*(int *)((param_4 - (int)param_3) + (int)piVar9) != 0) { param_3[iVar13] = *piVar9; iVar13 = iVar13 + 1; } piVar9 = piVar9 + 1; param_5 = param_5 + -1; } while (param_5 != 0); if (iVar13 != 0) { uVar17 = iVar13 * 4 + 7U & 0xfffffff8; piVar9 = (int *)*param_2; iVar14 = *(int *)(param_1 + 0x48); iVar1 = piVar9[3]; uVar2 = piVar9[2]; iVar3 = (piVar9[1] - *piVar9) / (int)uVar2; pcVar12 = malloc_exref; if (*(int *)(param_1 + 0x4c) < (int)(iVar14 + uVar17)) { if (*(int *)(param_1 + 0x44) != 0) { puVar4 = malloc(8); *(int *)(param_1 + 0x50) = *(int *)(param_1 + 0x50) + *(int *)(param_1 + 0x48); pcVar12 = malloc_exref; puVar4[1] = *(undefined4 *)(param_1 + 0x54); *puVar4 = *(undefined4 *)(param_1 + 0x44); *(undefined4 **)(param_1 + 0x54) = puVar4; } *(uint *)(param_1 + 0x4c) = uVar17; uVar5 = (*pcVar12)(uVar17); pcVar12 = malloc_exref; iVar14 = 0; *(undefined4 *)(param_1 + 0x44) = uVar5; } *(uint *)(param_1 + 0x48) = iVar14 + uVar17; iVar14 = *(int *)(param_1 + 0x44) + iVar14; iVar15 = 0; if (0 < iVar13) { uVar17 = iVar3 * 4 + 7U & 0xfffffff8; do { iVar10 = *(int *)(param_1 + 0x48); if (*(int *)(param_1 + 0x4c) < (int)(iVar10 + uVar17)) { if (*(int *)(param_1 + 0x44) != 0) { puVar4 = (undefined4 *)(*pcVar12)(8); *(int *)(param_1 + 0x50) = *(int *)(param_1 + 0x50) + *(int *)(param_1 + 0x48); puVar4[1] = *(undefined4 *)(param_1 + 0x54); *puVar4 = *(undefined4 *)(param_1 + 0x44); *(undefined4 **)(param_1 + 0x54) = puVar4; } *(uint *)(param_1 + 0x4c) = uVar17; pvVar6 = malloc(uVar17); *(void **)(param_1 + 0x44) = pvVar6; iVar10 = 0; } *(uint *)(param_1 + 0x48) = iVar10 + uVar17; pvVar6 = (void *)(*(int *)(param_1 + 0x44) + iVar10); *(void **)(iVar14 + iVar15 * 4) = pvVar6; memset(pvVar6,0,iVar3 * 4); iVar15 = iVar15 + 1; pcVar12 = malloc_exref; } while (iVar15 < iVar13); } local_24 = 0; if (0 < iVar3) { local_28 = 0; do { iVar15 = *piVar9; if (0 < iVar13) { piVar18 = param_3; local_20 = iVar13; do { uVar17 = 0; iVar16 = 0; iVar10 = 0; if (0 < (int)uVar2) { if ((7 < uVar2) && (1 < __isa_available)) { uVar17 = uVar2 & 0x80000007; if ((int)uVar17 < 0) { uVar17 = (uVar17 - 1 | 0xfffffff8) + 1; } uVar24 = 0; uVar25 = 0; uVar26 = 0; uVar27 = 0; uVar31 = 0; uVar32 = 0; uVar33 = 0; uVar34 = 0; iVar16 = 0; iVar28 = 0; iVar29 = 0; iVar30 = 0; iVar35 = 0; iVar36 = 0; iVar37 = 0; iVar38 = 0; pauVar7 = (undefined1 (*) [16])(*piVar18 + (iVar15 + local_28) * 4); do { iVar10 = iVar10 + 8; auVar20 = pabsd(*pauVar7,*pauVar7); iVar19 = auVar20._0_4_; iVar35 = iVar35 + iVar19; iVar21 = auVar20._4_4_; iVar36 = iVar36 + iVar21; iVar22 = auVar20._8_4_; iVar37 = iVar37 + iVar22; iVar23 = auVar20._12_4_; iVar38 = iVar38 + iVar23; uVar24 = (uint)((int)uVar24 < iVar19) * iVar19 | ((int)uVar24 >= iVar19) * uVar24; uVar25 = (uint)((int)uVar25 < iVar21) * iVar21 | ((int)uVar25 >= iVar21) * uVar25; uVar26 = (uint)((int)uVar26 < iVar22) * iVar22 | ((int)uVar26 >= iVar22) * uVar26; uVar27 = (uint)((int)uVar27 < iVar23) * iVar23 | ((int)uVar27 >= iVar23) * uVar27; auVar20 = pabsd(pauVar7[1],pauVar7[1]); iVar19 = auVar20._0_4_; iVar16 = iVar16 + iVar19; iVar21 = auVar20._4_4_; iVar28 = iVar28 + iVar21; iVar22 = auVar20._8_4_; iVar29 = iVar29 + iVar22; iVar23 = auVar20._12_4_; iVar30 = iVar30 + iVar23; uVar31 = (uint)((int)uVar31 < iVar19) * iVar19 | ((int)uVar31 >= iVar19) * uVar31; uVar32 = (uint)((int)uVar32 < iVar21) * iVar21 | ((int)uVar32 >= iVar21) * uVar32; uVar33 = (uint)((int)uVar33 < iVar22) * iVar22 | ((int)uVar33 >= iVar22) * uVar33; uVar34 = (uint)((int)uVar34 < iVar23) * iVar23 | ((int)uVar34 >= iVar23) * uVar34; pauVar7 = pauVar7 + 2; } while (iVar10 < (int)(uVar2 - uVar17)); uVar17 = ((int)uVar24 < (int)uVar31) * uVar31 | ((int)uVar24 >= (int)uVar31) * uVar24; uVar24 = ((int)uVar25 < (int)uVar32) * uVar32 | ((int)uVar25 >= (int)uVar32) * uVar25; uVar25 = ((int)uVar26 < (int)uVar33) * uVar33 | ((int)uVar26 >= (int)uVar33) * uVar26; uVar26 = ((int)uVar27 < (int)uVar34) * uVar34 | ((int)uVar27 >= (int)uVar34) * uVar27; uVar17 = ((int)uVar17 < (int)uVar25) * uVar25 | ((int)uVar17 >= (int)uVar25) * uVar17; uVar24 = ((int)uVar24 < (int)uVar26) * uVar26 | ((int)uVar24 >= (int)uVar26) * uVar24; uVar17 = ((int)uVar17 < (int)uVar24) * uVar24 | ((int)uVar17 >= (int)uVar24) * uVar17; iVar16 = iVar16 + iVar35 + iVar29 + iVar37 + iVar28 + iVar36 + iVar30 + iVar38; if ((int)uVar2 <= iVar10) goto LAB_00ad0d7a; } iVar28 = uVar2 - iVar10; puVar11 = (uint *)(*piVar18 + (iVar15 + local_28 + iVar10) * 4); do { uVar24 = *puVar11; puVar11 = puVar11 + 1; uVar25 = (int)uVar24 >> 0x1f; uVar25 = (uVar24 ^ uVar25) - uVar25; if ((int)uVar17 < (int)uVar25) { uVar17 = uVar25; } iVar16 = iVar16 + uVar25; iVar28 = iVar28 + -1; } while (iVar28 != 0); } LAB_00ad0d7a: iVar10 = 0; if (0 < iVar1 + -1) { piVar8 = piVar9 + 0x286; do { if (((int)uVar17 <= piVar8[-0x40]) && ((*piVar8 < 0 || ((int)((float)iVar16 * (100.0 / (float)(int)uVar2)) < *piVar8) ))) break; iVar10 = iVar10 + 1; piVar8 = piVar8 + 1; } while (iVar10 < iVar1 + -1); } piVar8 = (int *)((iVar14 - (int)param_3) + (int)piVar18); piVar18 = piVar18 + 1; local_20 = local_20 + -1; *(int *)(*piVar8 + local_24 * 4) = iVar10; } while (local_20 != 0); } local_24 = local_24 + 1; local_28 = local_28 + uVar2; } while (local_24 < iVar3); } param_2[10] = param_2[10] + 1; return iVar14; } } return 0; } //@@ 00ad0e10 FUN_00ad0e10 undefined4 FUN_00ad0e10(undefined4 param_1,undefined4 param_2,undefined4 *param_3,int param_4,int param_5) { undefined4 uVar1; undefined4 *puVar2; int iVar3; iVar3 = 0; if (0 < param_5) { puVar2 = param_3; do { if (*(int *)((param_4 - (int)param_3) + (int)puVar2) != 0) { param_3[iVar3] = *puVar2; iVar3 = iVar3 + 1; } puVar2 = puVar2 + 1; param_5 = param_5 + -1; } while (param_5 != 0); if (iVar3 != 0) { uVar1 = _01inverse(param_3,iVar3,FUN_00ab7a40); return uVar1; } } return 0; } //@@ 00ad0e70 res2_class /* DB: libvorbis res0.c: slot 5 (class) of residue2_exportbundle 0xb5f240 (_residue_P[2] at 0xb4f7bc; res0 bundle 0xb5f220 has NULL there), 5 args (vb,vl,in,nonzero,ch), vectorised nonzero count then _2class inlined */ int * res2_class(int param_1,int *param_2,int *param_3,int param_4,uint param_5) { int *piVar1; uint uVar2; int iVar3; undefined4 *puVar4; undefined4 uVar5; void *pvVar6; int iVar7; int iVar8; int iVar9; int *piVar10; int iVar11; code *pcVar12; int iVar13; int iVar14; int *piVar15; uint uVar16; uint uVar17; uint uVar18; uint uVar19; uint uVar20; uint uVar21; uint uVar22; uint uVar23; int local_20; int local_10; uVar2 = param_5; iVar13 = 0; iVar11 = 0; if (0 < (int)param_5) { if (param_5 < 8) goto LAB_00ad0f20; uVar20 = 0; uVar21 = 0; uVar22 = 0; uVar23 = 0; uVar16 = 0; uVar17 = 0; uVar18 = 0; uVar19 = 0; do { piVar1 = (int *)(param_4 + iVar11 * 4); uVar20 = uVar20 + 1 & ~-(uint)(*piVar1 == 0) | -(uint)(*piVar1 == 0) & uVar20; uVar21 = uVar21 + 1 & ~-(uint)(piVar1[1] == 0) | -(uint)(piVar1[1] == 0) & uVar21; uVar22 = uVar22 + 1 & ~-(uint)(piVar1[2] == 0) | -(uint)(piVar1[2] == 0) & uVar22; uVar23 = uVar23 + 1 & ~-(uint)(piVar1[3] == 0) | -(uint)(piVar1[3] == 0) & uVar23; piVar1 = (int *)(param_4 + 0x10 + iVar11 * 4); iVar11 = iVar11 + 8; uVar16 = uVar16 + 1 & ~-(uint)(*piVar1 == 0) | -(uint)(*piVar1 == 0) & uVar16; uVar17 = uVar17 + 1 & ~-(uint)(piVar1[1] == 0) | -(uint)(piVar1[1] == 0) & uVar17; uVar18 = uVar18 + 1 & ~-(uint)(piVar1[2] == 0) | -(uint)(piVar1[2] == 0) & uVar18; uVar19 = uVar19 + 1 & ~-(uint)(piVar1[3] == 0) | -(uint)(piVar1[3] == 0) & uVar19; } while (iVar11 < (int)(param_5 & 0xfffffff8)); iVar13 = uVar16 + uVar20 + uVar18 + uVar22 + uVar17 + uVar21 + uVar19 + uVar23; for (; iVar11 < (int)param_5; iVar11 = iVar11 + 1) { LAB_00ad0f20: iVar14 = iVar13 + 1; if (*(int *)(param_4 + iVar11 * 4) == 0) { iVar14 = iVar13; } iVar13 = iVar14; } if (iVar13 != 0) { piVar1 = (int *)*param_2; iVar11 = piVar1[3]; iVar13 = piVar1[2]; iVar3 = (piVar1[1] - *piVar1) / iVar13; iVar14 = *(int *)(param_1 + 0x48); pcVar12 = malloc_exref; if (*(int *)(param_1 + 0x4c) < iVar14 + 8) { if (*(int *)(param_1 + 0x44) != 0) { puVar4 = malloc(8); *(int *)(param_1 + 0x50) = *(int *)(param_1 + 0x50) + *(int *)(param_1 + 0x48); puVar4[1] = *(undefined4 *)(param_1 + 0x54); *puVar4 = *(undefined4 *)(param_1 + 0x44); pcVar12 = malloc_exref; *(undefined4 **)(param_1 + 0x54) = puVar4; } *(undefined4 *)(param_1 + 0x4c) = 8; uVar5 = (*pcVar12)(8); pcVar12 = malloc_exref; *(undefined4 *)(param_1 + 0x44) = uVar5; iVar14 = 0; } iVar7 = iVar14 + 8; piVar15 = (int *)(iVar14 + *(int *)(param_1 + 0x44)); *(int *)(param_1 + 0x48) = iVar7; uVar20 = iVar3 * 4 + 7U & 0xfffffff8; if (*(int *)(param_1 + 0x4c) < (int)(iVar7 + uVar20)) { if (*(int *)(param_1 + 0x44) != 0) { puVar4 = (undefined4 *)(*pcVar12)(8); *(int *)(param_1 + 0x50) = *(int *)(param_1 + 0x50) + *(int *)(param_1 + 0x48); puVar4[1] = *(undefined4 *)(param_1 + 0x54); *puVar4 = *(undefined4 *)(param_1 + 0x44); *(undefined4 **)(param_1 + 0x54) = puVar4; } *(uint *)(param_1 + 0x4c) = uVar20; pvVar6 = malloc(uVar20); *(void **)(param_1 + 0x44) = pvVar6; iVar7 = 0; } pvVar6 = (void *)(*(int *)(param_1 + 0x44) + iVar7); *(uint *)(param_1 + 0x48) = iVar7 + uVar20; *piVar15 = (int)pvVar6; memset(pvVar6,0,iVar3 * 4); local_20 = 0; param_5 = *piVar1 / (int)param_5; if (0 < iVar3) { do { iVar14 = 0; iVar7 = 0; local_10 = 0; if (0 < iVar13) { do { uVar20 = *(uint *)(*param_3 + param_5 * 4); uVar16 = (int)uVar20 >> 0x1f; iVar8 = (uVar20 ^ uVar16) - uVar16; if (iVar7 < iVar8) { iVar7 = iVar8; } iVar8 = 1; if (1 < (int)uVar2) { do { uVar20 = *(uint *)(param_3[iVar8] + param_5 * 4); uVar16 = (int)uVar20 >> 0x1f; iVar9 = (uVar20 ^ uVar16) - uVar16; if (iVar14 < iVar9) { iVar14 = iVar9; } iVar8 = iVar8 + 1; } while (iVar8 < (int)uVar2); } local_10 = local_10 + uVar2; param_5 = param_5 + 1; } while (local_10 < iVar13); } iVar8 = 0; if (0 < iVar11 + -1) { piVar10 = piVar1 + 0x286; do { if ((iVar7 <= piVar10[-0x40]) && (iVar14 <= *piVar10)) break; iVar8 = iVar8 + 1; piVar10 = piVar10 + 1; } while (iVar8 < iVar11 + -1); } *(int *)(*piVar15 + local_20 * 4) = iVar8; local_20 = local_20 + 1; } while (local_20 < iVar3); } param_2[10] = param_2[10] + 1; return piVar15; } } return (int *)0x0; } //@@ 00ad1110 FUN_00ad1110 undefined4 FUN_00ad1110(undefined4 param_1,int param_2,undefined4 param_3,int param_4,int *param_5,int param_6, undefined4 param_7) { int iVar1; int iVar2; int iVar3; undefined4 uVar4; undefined4 *puVar5; int iVar6; int iVar7; int local_14; int local_10; int local_8; iVar7 = *(int *)(param_2 + 0x24) / 2; local_14 = FUN_00aaca80(); if (0 < param_6) { param_4 = param_4 - (int)param_5; local_8 = local_14 - (int)param_5; iVar3 = 0; iVar6 = param_6; do { iVar2 = *(int *)(param_4 + (int)param_5); local_10 = iVar3 + 1; if (*param_5 == 0) { local_10 = iVar3; } iVar3 = 0; if (0 < iVar7) { puVar5 = (undefined4 *)(local_8 + (int)param_5); do { iVar1 = iVar3 * 4; iVar3 = iVar3 + 1; *puVar5 = *(undefined4 *)(iVar2 + iVar1); puVar5 = puVar5 + param_6; } while (iVar3 < iVar7); } param_5 = param_5 + 1; iVar6 = iVar6 + -1; iVar3 = local_10; } while (iVar6 != 0); if (local_10 != 0) { uVar4 = FUN_00ad05b0(&local_14,1,param_7,local_10); return uVar4; } } return 0; } //@@ 00ad11e0 res2_inverse /* DB: libvorbis (round 7 agent) */ undefined4 res2_inverse(int param_1,int *param_2,undefined4 param_3,int param_4,int param_5) { int *piVar1; int iVar2; int iVar3; int iVar4; int *piVar5; int iVar6; int iVar7; int iVar8; int iVar9; int *local_c; int local_8; piVar1 = (int *)*param_2; iVar2 = *(int *)param_2[4]; iVar3 = piVar1[2]; iVar8 = *(int *)(param_1 + 0x24) * param_5 >> 1; iVar4 = piVar1[1]; if (iVar8 <= piVar1[1]) { iVar4 = iVar8; } if (0 < iVar4 - *piVar1) { iVar4 = (iVar4 - *piVar1) / iVar3; piVar5 = (int *)FUN_00aaca80(); iVar8 = 0; if (0 < param_5) { do { if (*(int *)(param_4 + iVar8 * 4) != 0) break; iVar8 = iVar8 + 1; } while (iVar8 < param_5); } if ((iVar8 != param_5) && (local_8 = 0, 0 < param_2[2])) { do { iVar8 = 0; if (0 < iVar4) { local_c = piVar5; do { if (local_8 == 0) { iVar9 = param_2[4]; if (*(int *)(iVar9 + 8) < 1) { return 0; } iVar6 = FUN_00ab75d0(); if (iVar6 < 0) { return 0; } iVar9 = *(int *)(*(int *)(iVar9 + 0x18) + iVar6 * 4); if (iVar9 == -1) { return 0; } if (piVar1[4] <= iVar9) { return 0; } iVar9 = *(int *)(param_2[7] + iVar9 * 4); *local_c = iVar9; if (iVar9 == 0) { return 0; } } iVar9 = 0; if (0 < iVar2) { iVar6 = iVar8 * iVar3; do { if (iVar4 <= iVar8) break; iVar7 = *(int *)(*local_c + iVar9 * 4); if ((((piVar1[iVar7 + 6] & 1 << ((byte)local_8 & 0x1f)) != 0) && (*(int *)(*(int *)(param_2[5] + iVar7 * 4) + local_8 * 4) != 0)) && (iVar7 = vorbis_book_decodevv_add(*piVar1 + iVar6,param_5,param_1 + 4,iVar3), iVar7 == -1)) { return 0; } iVar6 = iVar6 + iVar3; iVar9 = iVar9 + 1; iVar8 = iVar8 + 1; } while (iVar9 < iVar2); } local_c = local_c + 1; } while (iVar8 < iVar4); } local_8 = local_8 + 1; } while (local_8 < param_2[2]); } } return 0; } //@@ 00ad1380 FUN_00ad1380 void FUN_00ad1380(void *param_1) { if (param_1 != (void *)0x0) { memset(param_1,0,0x460); free(param_1); } return; } //@@ 00ad13b0 FUN_00ad13b0 void FUN_00ad13b0(void *param_1) { if (param_1 != (void *)0x0) { memset(param_1,0,0x520); free(param_1); } return; } //@@ 00ad13e0 FUN_00ad13e0 void FUN_00ad13e0(uint *param_1,void *param_2) { uint uVar1; uint uVar2; byte bVar3; uint uVar4; uint *puVar5; int iVar6; int iVar7; int local_14; int local_10; uint *local_c; uint *local_8; local_10 = 0; uVar2 = param_1[0xd2]; oggpack_write(param_2,*param_1,5); local_c = (uint *)0x0; uVar1 = 0xffffffff; if (0 < (int)*param_1) { uVar4 = uVar1; local_8 = param_1; do { local_8 = local_8 + 1; oggpack_write(param_2,*local_8,4); uVar1 = *local_8; if ((int)*local_8 <= (int)uVar4) { uVar1 = uVar4; } local_c = (uint *)((int)local_c + 1); uVar4 = uVar1; } while ((int)local_c < (int)*param_1); } local_14 = uVar1 + 1; if (0 < local_14) { local_c = param_1 + 0x50; local_8 = param_1 + 0x30; do { oggpack_write(param_2,local_8[-0x10] - 1,3); oggpack_write(param_2,*local_8,2); bVar3 = 0; if (*local_8 != 0) { oggpack_write(param_2,local_8[0x10],8); bVar3 = (byte)*local_8; } iVar6 = 0; if (0 < 1 << (bVar3 & 0x1f)) { puVar5 = local_c; do { oggpack_write(param_2,*puVar5 + 1,8); puVar5 = puVar5 + 1; iVar6 = iVar6 + 1; } while (iVar6 < 1 << ((byte)*local_8 & 0x1f)); } local_c = local_c + 8; local_8 = local_8 + 1; local_14 = local_14 + -1; } while (local_14 != 0); } oggpack_write(param_2,param_1[0xd0] - 1,2); uVar1 = 0; if ((uVar2 == 0) || (uVar4 = uVar2 - 1, uVar4 == 0)) { oggpack_write(param_2,0,4); local_8 = (uint *)0x0; if ((uVar2 == 0) || (local_8 = (uint *)0x0, uVar2 == 1)) goto LAB_00ad1550; } else { do { uVar1 = uVar1 + 1; uVar4 = uVar4 >> 1; } while (uVar4 != 0); oggpack_write(param_2,uVar1,4); } uVar2 = uVar2 - 1; local_8 = (uint *)0x0; do { local_8 = (uint *)((int)local_8 + 1); uVar2 = uVar2 >> 1; } while (uVar2 != 0); LAB_00ad1550: iVar6 = 0; local_14 = 0; if (0 < (int)*param_1) { local_c = param_1; do { local_c = local_c + 1; local_10 = local_10 + param_1[*local_c + 0x20]; if (iVar6 < local_10) { iVar7 = local_10 - iVar6; puVar5 = param_1 + iVar6 + 0xd3; iVar6 = iVar6 + iVar7; do { oggpack_write(param_2,*puVar5,(int)local_8); puVar5 = puVar5 + 1; iVar7 = iVar7 + -1; } while (iVar7 != 0); } local_14 = local_14 + 1; } while (local_14 < (int)*param_1); } return; } //@@ 00ad15d0 FUN_00ad15d0 int FUN_00ad15d0(undefined4 *param_1,undefined4 *param_2) { return *(int *)*param_1 - *(int *)*param_2; } //@@ 00ad15f0 floor1_unpack /* DB: libvorbis floor1.c: calloc(1,0x460) vorbis_info_floor1, oggpack_read (FUN_00ab7120) partitions/partitionclass, class_dim+1, class_subs, class_book, class_subbook-1, bounds-checked against ci->books (+0x18); no direct caller (in the _floor_P function table) */ int * floor1_unpack(int param_1) { int *_Dst; int iVar1; int *piVar2; int iVar3; uint uVar4; int *piVar5; int iVar6; longlong lVar7; int *piVar8; int *piVar9; int *piVar10; int local_120 [65]; int local_1c; uint local_18; int local_14; int *local_10; int *local_c; int *local_8; local_14 = *(int *)(param_1 + 0x1c); local_8 = (int *)0xffffffff; _Dst = calloc(1,0x460); piVar5 = _Dst; piVar8 = _Dst; piVar9 = _Dst; piVar10 = _Dst; iVar1 = FUN_00ab7120(); *_Dst = iVar1; local_10 = (int *)0x0; if (0 < iVar1) { local_c = _Dst; do { local_c = local_c + 1; piVar2 = (int *)FUN_00ab7120(); *local_c = (int)piVar2; if ((int)piVar2 < 0) goto LAB_00ad19a6; if ((int)piVar2 <= (int)local_8) { piVar2 = local_8; } local_10 = (int *)((int)local_10 + 1); local_8 = piVar2; } while ((int)local_10 < *_Dst); local_1c = (int)piVar2 + 1; local_c = (int *)0x0; if (0 < local_1c) { local_8 = _Dst + 0x50; local_10 = _Dst + 0x40; do { piVar2 = local_10; iVar1 = FUN_00ab7120(); piVar2[-0x20] = iVar1 + 1; local_18 = FUN_00ab7120(); piVar2[-0x10] = local_18; if ((int)local_18 < 0) goto LAB_00ad19a6; if (local_18 != 0) { iVar1 = FUN_00ab7120(); *piVar2 = iVar1; } if ((*piVar2 < 0) || (*(int *)(local_14 + 0x18) <= *piVar2)) goto LAB_00ad19a6; iVar1 = 0; if (0 < 1 << ((byte)local_18 & 0x1f)) { piVar2 = local_8; do { iVar3 = FUN_00ab7120(); iVar3 = iVar3 + -1; *piVar2 = iVar3; if ((iVar3 < -1) || (*(int *)(local_14 + 0x18) <= iVar3)) goto LAB_00ad19a6; iVar1 = iVar1 + 1; piVar2 = piVar2 + 1; } while (iVar1 < 1 << ((byte)local_10[-0x10] & 0x1f)); piVar2 = local_10; } local_10 = piVar2 + 1; local_8 = local_8 + 8; local_c = (int *)((int)local_c + 1); } while ((int)local_c < local_1c); } } iVar1 = FUN_00ab7120(); _Dst[0xd0] = iVar1 + 1; iVar1 = FUN_00ab7120(); if (iVar1 < 0) { LAB_00ad19a6: memset(_Dst,0,0x460); free(_Dst); return (int *)0x0; } iVar6 = 0; local_c = (int *)0x0; iVar3 = 0; if (0 < *_Dst) { local_8 = _Dst + 1; local_14 = 0; do { local_14 = local_14 + _Dst[*local_8 + 0x20]; if (0x3f < local_14) goto LAB_00ad19a6; if (iVar6 < local_14) { piVar2 = _Dst + iVar6 + 0xd3; do { iVar3 = FUN_00ab7120(); *piVar2 = iVar3; if ((iVar3 < 0) || (1 << ((byte)iVar1 & 0x1f) <= iVar3)) goto LAB_00ad19a6; iVar6 = iVar6 + 1; piVar2 = piVar2 + 1; } while (iVar6 < local_14); } local_c = (int *)((int)local_c + 1); local_8 = local_8 + 1; iVar3 = local_14; } while ((int)local_c < *_Dst); } _Dst[0xd1] = 0; local_18 = iVar3 + 2; iVar3 = 0; _Dst[0xd2] = 1 << ((byte)iVar1 & 0x1f); uVar4 = local_18; if (0 < (int)local_18) { if (0xf < local_18) { uVar4 = local_18 & 0x8000000f; if ((int)uVar4 < 0) { uVar4 = (uVar4 - 1 | 0xfffffff0) + 1; } iVar6 = local_18 - uVar4; iVar1 = 0xe0; local_1c = iVar6; do { lVar7 = SUB168(ZEXT416(2),0); local_120[iVar3] = (iVar3 + 0xd1 << lVar7) + (int)piVar5; local_120[iVar3 + 1] = (iVar3 + 0xd2 << lVar7) + (int)piVar8; local_120[iVar3 + 2] = (iVar3 + 0xd3 << lVar7) + (int)piVar9; local_120[iVar3 + 3] = (iVar3 + 0xd4 << lVar7) + (int)piVar10; local_120[iVar3 + 4] = (iVar1 + -0xb << lVar7) + (int)piVar5; local_120[iVar3 + 5] = (iVar1 + -10 << lVar7) + (int)piVar8; local_120[iVar3 + 6] = (iVar1 + -9 << lVar7) + (int)piVar9; local_120[iVar3 + 7] = (iVar1 + -8 << lVar7) + (int)piVar10; local_120[iVar3 + 8] = (iVar1 + -7 << lVar7) + (int)piVar5; local_120[iVar3 + 9] = (iVar1 + -6 << lVar7) + (int)piVar8; local_120[iVar3 + 10] = (iVar1 + -5 << lVar7) + (int)piVar9; local_120[iVar3 + 0xb] = (iVar1 + -4 << lVar7) + (int)piVar10; local_120[iVar3 + 0xc] = (iVar1 + -3 << lVar7) + (int)piVar5; local_120[iVar3 + 0xd] = (iVar1 + -2 << lVar7) + (int)piVar8; local_120[iVar3 + 0xe] = (iVar1 + -1 << lVar7) + (int)piVar9; local_120[iVar3 + 0xf] = (iVar1 << lVar7) + (int)piVar10; iVar3 = iVar3 + 0x10; iVar1 = iVar1 + 0x10; } while (iVar3 < iVar6); uVar4 = local_18; if ((int)local_18 <= iVar3) goto LAB_00ad1952; } uVar4 = local_18; piVar5 = _Dst + iVar3 + 0xd1; do { local_120[iVar3] = (int)piVar5; iVar3 = iVar3 + 1; piVar5 = piVar5 + 1; } while (iVar3 < (int)uVar4); } LAB_00ad1952: qsort(local_120,uVar4,4,FUN_00ad15d0); iVar1 = 1; if (1 < (int)uVar4) { do { if (*(int *)local_120[iVar1 + -1] == *(int *)local_120[iVar1]) goto LAB_00ad19a6; iVar1 = iVar1 + 1; } while (iVar1 < (int)uVar4); } return _Dst; } //@@ 00ad1d70 accumulate_fit /* DB: libvorbis floor1.c accumulate_fit(flr ECX, mdct EDX, x0, x1, fits, n, info): zeroes the lsfit_acc, quantizes with vorbis_dBquant (x*7.3142857+1023.5) and sums xa/ya/x2a/y2a/xya; caller floor1_fit */ int accumulate_fit(int param_1,int param_2,int *param_3,int param_4,int param_5) { float fVar1; int iVar2; int in_ECX; int in_EDX; float *pfVar3; int local_38; int local_34; int local_30; int local_2c; int local_28; int local_24; int local_20; int local_1c; int local_18; int local_14; int local_10; int local_8; local_10 = 0; param_3[2] = 0; param_3[3] = 0; param_3[4] = 0; param_3[5] = 0; param_3[6] = 0; param_3[7] = 0; param_3[8] = 0; param_3[9] = 0; param_3[10] = 0; param_3[0xb] = 0; param_3[0xc] = 0; param_3[0xd] = 0; local_14 = 0; local_18 = 0; local_1c = 0; local_20 = 0; local_8 = 0; local_24 = 0; local_28 = 0; local_2c = 0; local_30 = 0; local_34 = 0; local_38 = 0; *param_3 = param_1; param_3[1] = param_2; if (param_4 <= param_2) { param_2 = param_4 + -1; } iVar2 = 0; if (param_1 <= param_2) { pfVar3 = (float *)(in_EDX + param_1 * 4); do { fVar1 = *(float *)((in_ECX - in_EDX) + (int)pfVar3); iVar2 = (int)(fVar1 * 7.3142858 + 1023.5); if (iVar2 < 0x400) { if ((-1 < iVar2) && (iVar2 != 0)) goto LAB_00ad1e48; } else { iVar2 = 0x3ff; LAB_00ad1e48: if (*pfVar3 + *(float *)(param_5 + 0x458) < fVar1) { local_24 = local_24 + param_1; local_28 = local_28 + iVar2; local_2c = local_2c + param_1 * param_1; local_30 = local_30 + iVar2 * iVar2; local_34 = local_34 + iVar2 * param_1; local_38 = local_38 + 1; } else { local_20 = local_20 + iVar2 * param_1; local_10 = local_10 + param_1; local_14 = local_14 + iVar2; local_18 = local_18 + param_1 * param_1; local_1c = local_1c + iVar2 * iVar2; local_8 = local_8 + 1; } } param_1 = param_1 + 1; pfVar3 = pfVar3 + 1; iVar2 = local_8; } while (param_1 <= param_2); } param_3[2] = local_10; param_3[3] = local_14; param_3[4] = local_18; param_3[5] = local_1c; param_3[6] = local_20; param_3[8] = local_24; param_3[9] = local_28; param_3[10] = local_2c; param_3[0xb] = local_30; param_3[0xc] = local_34; param_3[7] = iVar2; param_3[0xd] = local_38; return iVar2; } //@@ 00ad1f00 fit_line /* DB: libvorbis floor1.c: (lsfit_acc a in ECX, fits in EDX, y0*, y1*, info) least-squares fit, *y0/*y1 preset to -200 (0xffffff38) by the caller floor1_fit */ undefined4 fit_line(int *param_1,int *param_2,int param_3) { int *piVar1; int *piVar2; int *piVar3; int iVar4; int iVar5; int iVar6; int *in_ECX; int in_EDX; int *piVar7; double dVar8; double dVar9; double dVar10; double dVar11; double dVar12; double dVar13; dVar12 = 0.0; iVar4 = *in_ECX; dVar10 = 0.0; dVar13 = 0.0; dVar11 = 0.0; dVar9 = 0.0; iVar5 = in_ECX[in_EDX * 0xe + -0xd]; if (0 < in_EDX) { piVar7 = in_ECX + 7; dVar12 = 0.0; do { iVar6 = *piVar7; piVar1 = piVar7 + 6; dVar8 = (double)(((float)(iVar6 + *piVar1) * *(float *)(param_3 + 0x454)) / (float)(iVar6 + 1) ) + 1.0; dVar10 = dVar10 + (double)piVar7[-5] * dVar8 + (double)piVar7[1]; dVar13 = dVar13 + (double)piVar7[-4] * dVar8 + (double)piVar7[2]; piVar2 = piVar7 + 5; dVar11 = dVar11 + (double)piVar7[-3] * dVar8 + (double)piVar7[3]; piVar3 = piVar7 + -1; piVar7 = piVar7 + 0xe; dVar12 = dVar12 + (double)*piVar3 * dVar8 + (double)*piVar2; dVar9 = dVar9 + (double)iVar6 * dVar8 + (double)*piVar1; in_EDX = in_EDX + -1; } while (in_EDX != 0); } iVar6 = *param_1; if (-1 < iVar6) { dVar9 = dVar9 + 1.0; dVar10 = dVar10 + (double)iVar4; dVar13 = dVar13 + (double)iVar6; dVar11 = dVar11 + (double)(iVar4 * iVar4); dVar12 = dVar12 + (double)(iVar6 * iVar4); } iVar6 = *param_2; if (-1 < iVar6) { dVar10 = dVar10 + (double)iVar5; dVar9 = dVar9 + 1.0; dVar13 = dVar13 + (double)iVar6; dVar11 = dVar11 + (double)(iVar5 * iVar5); dVar12 = dVar12 + (double)(iVar6 * iVar5); } dVar8 = dVar9 * dVar11 - dVar10 * dVar10; if (dVar8 <= 0.0) { *param_2 = 0; *param_1 = 0; return 1; } dVar9 = (dVar9 * dVar12 - dVar13 * dVar10) / dVar8; dVar8 = (dVar11 * dVar13 - dVar12 * dVar10) / dVar8; floor((double)iVar4 * dVar9 + dVar8 + 0.5); iVar4 = thunk_FUN_00af0780(); *param_1 = iVar4; floor((double)iVar5 * dVar9 + dVar8 + 0.5); iVar5 = thunk_FUN_00af0780(); *param_2 = iVar5; if (0x3ff < iVar4) { *param_1 = 0x3ff; iVar4 = 0x3ff; } if (0x3ff < iVar5) { *param_2 = 0x3ff; iVar5 = 0x3ff; } iVar6 = *param_1; if (iVar4 < 0) { iVar6 = 0; } *param_1 = iVar6; iVar4 = *param_2; if (iVar5 < 0) { iVar4 = 0; } *param_2 = iVar4; return 0; } //@@ 00ad21d0 inspect_error /* DB: libvorbis floor1.c inspect_error(x0=ECX, x1=EDX, y0, y1, mask, mdct, info): vorbis_dBquant (x*7.3142858+1023.5 clamped 0..1023), info->twofitatten/maxover/maxunder (+0x458/+0x448/+0x44c); from floor1_fit */ undefined4 inspect_error(int param_1,int param_2,int param_3,int param_4,int param_5) { float fVar1; int iVar2; int in_ECX; int iVar3; int in_EDX; uint uVar4; uint uVar5; float *pfVar6; int iVar7; uint uVar8; int iVar9; int iVar10; int local_c; iVar7 = in_EDX - in_ECX; uVar8 = param_2 - param_1; uVar4 = (int)uVar8 >> 0x1f; iVar2 = (int)uVar8 / iVar7; iVar9 = 0; fVar1 = *(float *)(param_3 + in_ECX * 4); iVar10 = (int)(fVar1 * 7.3142858 + 1023.5); if (iVar10 < 0x400) { if (iVar10 < 0) { iVar10 = 0; } } else { iVar10 = 0x3ff; } local_c = 1; uVar5 = iVar2 * iVar7 >> 0x1f; param_2 = (param_1 - iVar10) * (param_1 - iVar10); if (fVar1 <= *(float *)(param_5 + 0x458) + *(float *)(param_4 + in_ECX * 4)) { if ((float)param_1 + *(float *)(param_5 + 0x448) < (float)iVar10) { return 1; } if ((float)iVar10 < (float)param_1 - *(float *)(param_5 + 0x44c)) { return 1; } } iVar10 = in_ECX + 1; if (iVar10 < in_EDX) { pfVar6 = (float *)(param_4 + iVar10 * 4); do { iVar9 = iVar9 + (((uVar8 ^ uVar4) - uVar4) - ((iVar2 * iVar7 ^ uVar5) - uVar5)); if (iVar9 < iVar7) { iVar3 = iVar2; } else { iVar9 = iVar9 - iVar7; iVar3 = (uVar4 & 0xfffffffe) + 1 + iVar2; } param_1 = param_1 + iVar3; fVar1 = *(float *)((param_3 - param_4) + (int)pfVar6); iVar3 = (int)(fVar1 * 7.3142858 + 1023.5); if (iVar3 < 0x400) { if (iVar3 < 0) { iVar3 = 0; } } else { iVar3 = 0x3ff; } local_c = local_c + 1; param_2 = param_2 + (param_1 - iVar3) * (param_1 - iVar3); if ((fVar1 <= *(float *)(param_5 + 0x458) + *pfVar6) && (iVar3 != 0)) { if ((float)param_1 + *(float *)(param_5 + 0x448) < (float)iVar3) { return 1; } if ((float)iVar3 < (float)param_1 - *(float *)(param_5 + 0x44c)) { return 1; } } iVar10 = iVar10 + 1; pfVar6 = pfVar6 + 1; } while (iVar10 < in_EDX); } fVar1 = *(float *)(param_5 + 0x450); if ((((*(float *)(param_5 + 0x448) * *(float *)(param_5 + 0x448)) / (float)local_c <= fVar1) && ((*(float *)(param_5 + 0x44c) * *(float *)(param_5 + 0x44c)) / (float)local_c <= fVar1)) && (fVar1 < (float)(param_2 / local_c))) { return 1; } return 0; } //@@ 00ad23f0 floor1_fit /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* DB: libvorbis encoder: look in EDX (posts +0x504, sorted index +0x508, n +0x510), large local arrays of 66 ints (VIF_POSIT+2) for fit lines/neighbours; result stored into floor_posts[i][0] (+0), [PACKETBLOBS-1] (+0x38) and [PACKETBLOBS/2] (+0x1c) in the caller, then floor1_interpolate_fit fills the rest (mapping0_forward pattern) */ undefined4 * floor1_fit(undefined4 param_1,undefined4 param_2) { int *piVar1; int iVar2; undefined4 *puVar3; void *pvVar4; uint uVar5; int in_EDX; uint uVar6; int iVar7; uint uVar8; int iVar9; int *piVar10; int **ppiVar11; undefined1 *puVar12; int *piVar13; int *local_1374; uint local_1370; int *local_136c; int local_1368; int local_1364; int local_1360; uint local_135c; int *local_1358; int *local_1354; int local_1350; int local_134c; int *local_1348; undefined4 local_1344; undefined4 local_1340; uint *local_133c; int local_1338; uint *local_1334; int *local_1330 [2]; uint auStack_1328 [64]; int *local_1228 [2]; uint auStack_1220 [64]; int local_1120 [66]; int local_1018 [66]; int local_f10 [66]; undefined1 local_e08 [3580]; undefined4 uStack_c; uStack_c = 0xad2400; uVar8 = *(uint *)(in_EDX + 0x504); local_1374 = *(int **)(in_EDX + 0x508); local_134c = uVar8 * 4; iVar9 = *(int *)(in_EDX + 0x510); local_1368 = iVar9; local_1360 = in_EDX; local_135c = uVar8; if ((int)uVar8 < 1) { if (uVar8 == 0) { iVar7 = accumulate_fit(0,local_1374,local_e08,local_1374,iVar9); goto LAB_00ad24ef; } } else { ppiVar11 = local_1330; for (uVar5 = uVar8 & 0x3fffffff; uVar5 != 0; uVar5 = uVar5 - 1) { *ppiVar11 = (int *)0xffffff38; ppiVar11 = ppiVar11 + 1; } ppiVar11 = local_1228; for (uVar5 = uVar8 & 0x3fffffff; uVar5 != 0; uVar5 = uVar5 - 1) { *ppiVar11 = (int *)0xffffff38; ppiVar11 = ppiVar11 + 1; } piVar13 = local_1018; for (uVar5 = uVar8 & 0x3fffffff; uVar5 != 0; uVar5 = uVar5 - 1) { *piVar13 = 0; piVar13 = piVar13 + 1; } piVar13 = local_1120; for (uVar5 = uVar8 & 0x3fffffff; uVar5 != 0; uVar5 = uVar5 - 1) { *piVar13 = 1; piVar13 = piVar13 + 1; } piVar13 = local_f10; for (uVar5 = uVar8 & 0x3fffffff; uVar5 != 0; uVar5 = uVar5 - 1) { *piVar13 = -1; piVar13 = piVar13 + 1; } } local_1370 = uVar8 - 1; iVar9 = 0; if ((int)local_1370 < 1) { return (undefined4 *)0x0; } puVar12 = local_e08; iVar7 = 0; do { iVar2 = accumulate_fit(*(undefined4 *)(local_1360 + iVar9 * 4), *(undefined4 *)(local_1360 + 4 + iVar9 * 4),puVar12,local_1374,local_1368 ); iVar9 = iVar9 + 1; iVar7 = iVar7 + iVar2; puVar12 = puVar12 + 0x38; } while (iVar9 < (int)local_1370); uVar8 = local_135c; iVar9 = local_1368; local_1370 = iVar7; LAB_00ad24ef: if (iVar7 == 0) { return (undefined4 *)0x0; } local_136c = (int *)0xffffff38; local_1374 = (int *)0xffffff38; fit_line(&local_136c,&local_1374,iVar9); iVar9 = 2; local_1330[0] = local_136c; local_1228[0] = local_136c; local_1228[1] = local_1374; local_1330[1] = local_1374; if (2 < (int)uVar8) { local_136c = (int *)(local_1360 + 0x210); iVar7 = local_1360; do { local_1338 = local_1018[*local_136c]; local_1350 = local_1120[*local_136c]; if (local_f10[local_1338] != local_1350) { local_1344 = *(undefined4 *)(iVar7 + 0x208 + local_1338 * 4); local_1340 = *(undefined4 *)(iVar7 + 0x208 + local_1350 * 4); local_f10[local_1338] = local_1350; local_1358 = *(int **)(local_1368 + 0x344 + local_1338 * 4); local_1370 = *(undefined4 *)(local_1368 + 0x344 + local_1350 * 4); piVar13 = (int *)auStack_1328[local_1338 + -2]; local_133c = auStack_1328 + local_1338 + 0x40; piVar10 = (int *)*local_133c; if (-1 < (int)piVar13) { if ((int)piVar10 < 0) { piVar10 = piVar13; } else { piVar10 = (int *)((int)piVar10 + (int)piVar13 >> 1); } } piVar13 = (int *)auStack_1328[local_1350 + 0x40]; local_1334 = auStack_1328 + local_1350 + -2; piVar1 = (int *)*local_1334; if (-1 < (int)piVar1) { if ((int)piVar13 < 0) { piVar13 = piVar1; } else { piVar13 = (int *)((int)piVar13 + (int)piVar1 >> 1); } } if ((piVar10 == (int *)0xffffffff) || (piVar13 == (int *)0xffffffff)) { /* WARNING: Subroutine does not return */ exit(1); } iVar7 = inspect_error(piVar10,piVar13,param_2,param_1,local_1368); if (iVar7 == 0) { LAB_00ad27c7: auStack_1328[iVar9 + 0x40] = 0xffffff38; auStack_1328[iVar9 + -2] = 0xffffff38; } else { local_1348 = (int *)0xffffff38; local_1354 = (int *)0xffffff38; local_1374 = (int *)0xffffff38; local_1358 = (int *)0xffffff38; local_1370 = fit_line(&local_1348,&local_1354,local_1368); iVar7 = fit_line(&local_1374,&local_1358,local_1368); if (local_1370 == 0) { piVar10 = local_1348; } else { local_1354 = local_1374; } if (iVar7 == 0) { piVar13 = local_1358; } else { local_1374 = local_1354; } if ((local_1370 != 0) && (iVar7 != 0)) goto LAB_00ad27c7; *local_133c = (uint)piVar10; if (local_1338 == 0) { local_1330[0] = piVar10; } auStack_1328[iVar9 + -2] = (uint)local_1354; auStack_1328[iVar9 + 0x40] = (uint)local_1374; *local_1334 = (uint)piVar13; if (local_1350 == 1) { local_1228[1] = piVar13; } if ((-1 < (int)local_1354) || (-1 < (int)local_1374)) { iVar7 = *local_136c; iVar2 = iVar7; while ((iVar2 = iVar2 + -1, -1 < iVar2 && (local_1120[iVar2] == local_1350))) { local_1120[iVar2] = iVar9; } while ((iVar7 = iVar7 + 1, iVar7 < (int)local_135c && (local_1018[iVar7] == local_1338)) ) { local_1018[iVar7] = iVar9; } } } iVar7 = local_1360; uVar8 = local_135c; } iVar9 = iVar9 + 1; local_136c = local_136c + 1; } while (iVar9 < (int)uVar8); } piVar10 = local_1228[0]; piVar13 = local_1330[1]; uVar8 = local_135c; local_1370 = local_134c + 7U & 0xfffffff8; iVar9 = *(int *)(local_1364 + 0x48); if (*(int *)(local_1364 + 0x4c) < (int)(iVar9 + local_1370)) { if (*(int *)(local_1364 + 0x44) != 0) { puVar3 = malloc(8); *(int *)(local_1364 + 0x50) = *(int *)(local_1364 + 0x50) + *(int *)(local_1364 + 0x48); puVar3[1] = *(undefined4 *)(local_1364 + 0x54); *puVar3 = *(undefined4 *)(local_1364 + 0x44); *(undefined4 **)(local_1364 + 0x54) = puVar3; } *(uint *)(local_1364 + 0x4c) = local_1370; pvVar4 = malloc(local_1370); iVar9 = 0; *(void **)(local_1364 + 0x44) = pvVar4; } puVar3 = (undefined4 *)(*(int *)(local_1364 + 0x44) + iVar9); *(uint *)(local_1364 + 0x48) = local_1370 + iVar9; if (-1 < (int)local_1330[0]) { if ((int)piVar10 < 0) { piVar10 = local_1330[0]; } else { piVar10 = (int *)((int)piVar10 + (int)local_1330[0] >> 1); } } *puVar3 = piVar10; if ((int)piVar13 < 0) { piVar13 = local_1228[1]; } else if (-1 < (int)local_1228[1]) { piVar13 = (int *)((int)piVar13 + (int)local_1228[1] >> 1); } puVar3[1] = piVar13; local_1370 = 2; if ((int)uVar8 < 3) { return puVar3; } local_136c = (int *)(local_1368 + 0x34c); local_1358 = (int *)(local_1360 + 0x30c); do { iVar9 = *(int *)(local_1368 + 0x344 + local_1358[0x3f] * 4); uVar8 = (puVar3[*local_1358] & 0x7fff) - (puVar3[local_1358[0x3f]] & 0x7fff); iVar7 = (int)(((uVar8 ^ (int)uVar8 >> 0x1f) - ((int)uVar8 >> 0x1f)) * (*local_136c - iVar9)) / (*(int *)(local_1368 + 0x344 + *local_1358 * 4) - iVar9); iVar9 = -iVar7; if (-1 < (int)uVar8) { iVar9 = iVar7; } uVar6 = (puVar3[local_1358[0x3f]] & 0x7fff) + iVar9; uVar8 = auStack_1328[local_1370 + -2]; uVar5 = auStack_1328[local_1370 + 0x40]; if ((int)uVar8 < 0) { LAB_00ad2985: if (-1 < (int)uVar5) goto LAB_00ad2989; LAB_00ad298d: uVar5 = uVar6 | 0x8000; } else { if (-1 < (int)uVar5) { uVar5 = (int)(uVar5 + uVar8) >> 1; goto LAB_00ad2985; } uVar5 = uVar8; LAB_00ad2989: if (uVar6 == uVar5) goto LAB_00ad298d; } local_1370 = local_1370 + 1; iVar9 = (-0x304 - local_1360) + (int)local_1358; local_1358 = local_1358 + 1; *(uint *)(iVar9 + (int)puVar3) = uVar5; local_136c = local_136c + 1; if ((int)local_135c <= (int)local_1370) { return puVar3; } } while( true ); } //@@ 00ad29e0 floor1_interpolate_fit /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: libvorbis encoder: (A, B, del) with look in EDX: returns NULL unless both post arrays are set, allocates look->posts (+0x504) ints via _vorbis_block_alloc and blends ((65536-del)*(A&0x7fff)+del*(B&0x7fff)+32768)>>16 keeping 0x8000 when both set (SIMD path); the caller (named mapping0_inverse) calls it with del stepping by 0x10000 between the posts from floor1_fit, exactly mapping0_forward's PACKETBLOBS loop */ undefined1 * floor1_interpolate_fit(undefined1 *param_1,undefined1 (*param_2) [16],int param_3) { int iVar1; int iVar2; int iVar3; int iVar4; undefined1 auVar5 [16]; undefined1 auVar6 [16]; undefined1 *puVar7; int iVar8; uint uVar9; uint uVar10; int in_EDX; uint *puVar11; undefined1 (*pauVar12) [16]; undefined1 auVar13 [16]; undefined1 auVar14 [16]; undefined1 auVar15 [16]; undefined1 auVar16 [16]; undefined1 auVar17 [16]; undefined1 auVar18 [16]; uVar10 = *(uint *)(in_EDX + 0x504); if ((param_1 == (undefined1 *)0x0) || (param_2 == (undefined1 (*) [16])0x0)) { return (undefined1 *)0x0; } puVar7 = (undefined1 *)FUN_00aaca80(); auVar6 = _DAT_00bab9f0; auVar5 = _DAT_00bab9e0; iVar8 = 0; if ((int)uVar10 < 1) { /* WARNING: Read-only address (ram,0x00bab9e0) is written */ /* WARNING: Read-only address (ram,0x00bab9f0) is written */ /* WARNING: Read-only address (ram,0x00baccb0) is written */ return puVar7; } if ((3 < uVar10) && (1 < __isa_available)) { if (((param_2[-1] + uVar10 * 4 + 0xc < puVar7) || ((undefined1 (*) [16])(puVar7 + (uVar10 - 1) * 4) < param_2)) && ((param_1 + uVar10 * 4 + -4 < puVar7 || (puVar7 + (uVar10 - 1) * 4 < param_1)))) { uVar9 = uVar10 & 0x80000003; if ((int)uVar9 < 0) { uVar9 = (uVar9 - 1 | 0xfffffffc) + 1; } iVar1 = (int)DAT_00bab9f0; iVar2 = DAT_00bab9f0._4_4_; iVar3 = DAT_00bab9f0._8_4_; iVar4 = DAT_00bab9f0._12_4_; iVar8 = 0; pauVar12 = param_2; do { auVar13 = *(undefined1 (*) [16])(((int)param_1 - (int)param_2) + (int)pauVar12); iVar8 = iVar8 + 4; auVar16 = auVar13 & auVar6; auVar17._0_4_ = -(uint)(auVar16._0_4_ == 0); auVar17._4_4_ = -(uint)(auVar16._4_4_ == 0); auVar17._8_4_ = -(uint)(auVar16._8_4_ == 0); auVar17._12_4_ = -(uint)(auVar16._12_4_ == 0); auVar16 = *pauVar12 & auVar6; auVar18._0_4_ = -(uint)(auVar16._0_4_ == 0); auVar18._4_4_ = -(uint)(auVar16._4_4_ == 0); auVar18._8_4_ = -(uint)(auVar16._8_4_ == 0); auVar18._12_4_ = -(uint)(auVar16._12_4_ == 0); auVar14._4_4_ = param_3; auVar14._0_4_ = param_3; auVar14._8_4_ = param_3; auVar14._12_4_ = param_3; auVar14 = pmulld(*pauVar12 & auVar5,auVar14); auVar18 = ~auVar17 & _DAT_00baccb0 & ~auVar18 & _DAT_00baccb0; auVar16._4_4_ = 0x10000 - param_3; auVar16._0_4_ = 0x10000 - param_3; auVar16._8_4_ = 0x10000 - param_3; auVar16._12_4_ = 0x10000 - param_3; auVar13 = pmulld(auVar13 & auVar5,auVar16); auVar15._0_8_ = CONCAT44(auVar14._4_4_ + auVar13._4_4_ + iVar2 >> 0x10, auVar14._0_4_ + auVar13._0_4_ + iVar1 >> 0x10); auVar15._8_4_ = auVar14._8_4_ + auVar13._8_4_ + iVar3 >> 0x10; auVar15._12_4_ = auVar14._12_4_ + auVar13._12_4_ + iVar4 >> 0x10; auVar13._8_4_ = auVar15._8_4_; auVar13._0_8_ = auVar15._0_8_; auVar13._12_4_ = auVar15._12_4_; *(undefined1 (*) [16])(puVar7 + (-0x10 - (int)param_2) + (int)(pauVar12 + 1)) = (auVar13 | auVar6) & auVar18 | ~auVar18 & auVar15; pauVar12 = pauVar12 + 1; } while (iVar8 < (int)(uVar10 - uVar9)); if ((int)uVar10 <= iVar8) { return puVar7; } } else { iVar8 = 0; } } puVar11 = (uint *)(*param_2 + iVar8 * 4); iVar8 = uVar10 - iVar8; do { uVar10 = (int)((*puVar11 & 0x7fff) * param_3 + (*(uint *)((int)puVar11 + ((int)param_1 - (int)param_2)) & 0x7fff) * (0x10000 - param_3) + 0x8000) >> 0x10; *(uint *)((int)puVar11 + ((int)puVar7 - (int)param_2)) = uVar10; if (((*(uint *)((int)puVar11 + ((int)param_1 - (int)param_2)) & 0x8000) != 0) && ((*puVar11 & 0x8000) != 0)) { *(uint *)((int)puVar11 + ((int)puVar7 - (int)param_2)) = uVar10 | 0x8000; } puVar11 = puVar11 + 1; iVar8 = iVar8 + -1; } while (iVar8 != 0); return puVar7; } //@@ 00ad2c00 theora_oc_dec_dc_unpredict_mcu_plane /* DB: ? libtheora decoder internal called from the frame decoder 0xacebf0 right before 0xaba020; memsets a plane-sized buffer ((+0x24)/2*4) */ undefined4 theora_oc_dec_dc_unpredict_mcu_plane(int param_1,uint *param_2,void *param_3) { uint *puVar1; void *buffer; uint uVar2; uint uVar3; int iVar4; int iVar5; int iVar6; int iVar7; void *in_ECX; int iVar8; uint uVar9; int *piVar10; int in_EDX; uint uVar11; uint uVar12; int iVar13; uint uVar14; int iVar15; uint uVar16; int iVar17; uint *puVar18; int iVar19; uint local_17c [65]; int aiStack_78 [8]; int local_58 [9]; uint *local_34; int local_30; int local_2c; void *local_28; int *local_24; uint *local_20; uint local_1c; uint *local_18; int local_14; int *local_10; int *local_c; uint *local_8; local_10 = *(int **)(param_1 + 0x510); iVar8 = *(int *)(param_1 + 0x504); local_30 = *(int *)(*(int *)(*(int *)(in_EDX + 0x40) + 4) + 0x1c); local_2c = *(int *)(local_30 + 0xb20); if (param_2 == (uint *)0x0) { oggpack_write(in_ECX,0,1); memset(param_3,0,*(int *)(in_EDX + 0x24) / 2 << 2); return 0; } iVar15 = 0; if (0 < iVar8) { do { uVar11 = param_2[iVar15] & 0x7fff; switch(local_10[0xd0]) { case 1: uVar11 = uVar11 >> 2; break; case 3: uVar11 = (uint)((ulonglong)uVar11 * 0xaaaaaaab >> 0x20); case 2: uVar11 = uVar11 >> 3; break; case 4: uVar11 = uVar11 >> 4; } param_2[iVar15] = param_2[iVar15] & 0x8000 | uVar11; iVar15 = iVar15 + 1; } while (iVar15 < iVar8); } uVar11 = *param_2; uVar12 = param_2[1]; local_1c = uVar12; if (2 < iVar8) { local_8 = (uint *)(param_1 + 0x30c); local_18 = param_2 + 2; local_14 = iVar8 + -2; local_c = local_10 + 0xd3; do { iVar8 = *local_8; puVar18 = param_2 + local_8[0x3f]; puVar1 = param_2 + iVar8; uVar2 = *puVar18 & 0x7fff; uVar14 = (param_2[iVar8] & 0x7fff) - uVar2; iVar15 = (int)(((uVar14 ^ (int)uVar14 >> 0x1f) - ((int)uVar14 >> 0x1f)) * (*local_c - local_10[local_8[0x3f] + 0xd1])) / (local_10[iVar8 + 0xd1] - local_10[local_8[0x3f] + 0xd1]); iVar8 = -iVar15; if (-1 < (int)uVar14) { iVar8 = iVar15; } uVar16 = uVar2 + iVar8; uVar14 = *local_18; if (((uVar14 & 0x8000) == 0) && (uVar16 != uVar14)) { uVar3 = *(int *)(param_1 + 0x50c) - uVar16; uVar9 = uVar16; if ((int)uVar3 < (int)uVar16) { uVar9 = uVar3; } iVar8 = uVar14 - uVar16; if (iVar8 < 0) { if (iVar8 < (int)-uVar9) { *puVar18 = uVar2; uVar9 = (uVar9 - iVar8) - 1; *puVar1 = *puVar1 & 0x7fff; } else { uVar9 = ~(iVar8 * 2); *puVar18 = uVar2; *puVar1 = *puVar1 & 0x7fff; } } else if (iVar8 < (int)uVar9) { uVar9 = iVar8 * 2; *puVar18 = uVar2; *puVar1 = *puVar1 & 0x7fff; } else { uVar9 = iVar8 + uVar9; *puVar18 = uVar2; *puVar1 = *puVar1 & 0x7fff; } } else { uVar9 = 0; *local_18 = uVar16 | 0x8000; } piVar10 = local_c + 1; *(uint *)(((int)local_17c - (int)param_2) + (int)local_18) = uVar9; local_18 = local_18 + 1; local_8 = local_8 + 1; local_14 = local_14 + -1; local_c = piVar10; } while (local_14 != 0); local_14 = 0; local_34 = puVar1; local_24 = (int *)uVar2; local_20 = puVar18; local_1c = (int)local_17c - (int)param_2; } local_17c[0] = uVar11; local_17c[1] = uVar12; local_58[8] = in_EDX; local_28 = in_ECX; oggpack_write(in_ECX,1,1); buffer = local_28; *(int *)(param_1 + 0x51c) = *(int *)(param_1 + 0x51c) + 1; iVar8 = 0; uVar14 = *(int *)(param_1 + 0x50c) - 1; uVar2 = uVar14; if (uVar14 == 0) { iVar8 = 0; } else { do { uVar2 = uVar2 >> 1; iVar8 = iVar8 + 1; } while (uVar2 != 0); *(int *)(param_1 + 0x518) = *(int *)(param_1 + 0x518) + iVar8 * 2; iVar8 = 0; do { iVar8 = iVar8 + 1; uVar14 = uVar14 >> 1; } while (uVar14 != 0); } oggpack_write(local_28,uVar11,iVar8); iVar8 = 0; for (uVar11 = *(int *)(param_1 + 0x50c) - 1; uVar11 != 0; uVar11 = uVar11 >> 1) { iVar8 = iVar8 + 1; } oggpack_write(buffer,uVar12,iVar8); local_20 = (uint *)0x0; local_c = (int *)0x2; if (0 < *local_10) { local_24 = local_10 + 1; do { iVar8 = local_30; local_8 = (uint *)*local_24; uVar11 = 0; local_58[0] = 0; local_58[1] = 0; local_58[2] = 0; local_58[3] = 0; local_1c = local_10[(int)local_8 + 0x30]; local_18 = (uint *)local_10[(int)local_8 + 0x20]; iVar15 = 1 << ((byte)local_1c & 0x1f); local_14 = 0; local_58[4] = 0; local_58[5] = 0; local_58[6] = 0; local_58[7] = 0; if (local_1c != 0) { iVar17 = 0; if (0 < iVar15) { piVar10 = local_10 + ((int)local_8 + 10) * 8; do { if (*piVar10 < 0) { iVar4 = 1; } else { iVar4 = *(int *)(*(int *)(iVar8 + 0x720 + *piVar10 * 4) + 4); } aiStack_78[iVar17] = iVar4; piVar10 = piVar10 + 1; iVar17 = iVar17 + 1; } while (iVar17 < iVar15); } iVar8 = 0; iVar17 = 0; if ((int)local_18 < 1) { LAB_00ad2f6a: iVar8 = local_2c + local_10[(int)local_8 + 0x40] * 0x38; if (*(int *)(*(int *)(iVar8 + 0xc) + 4) <= (int)uVar11) goto LAB_00ad2fb3; oggpack_write(local_28,*(uint *)(*(int *)(iVar8 + 0x14) + uVar11 * 4), (int)*(char *)(*(int *)(*(int *)(iVar8 + 0xc) + 8) + uVar11)); iVar8 = (int)*(char *)(*(int *)(*(int *)(iVar8 + 0xc) + 8) + uVar11); } else { puVar18 = local_17c + (int)local_c; do { iVar5 = 0; iVar4 = iVar8; if (0 < iVar15) { do { if ((int)*puVar18 < aiStack_78[iVar5]) { local_58[iVar17] = iVar5; break; } iVar5 = iVar5 + 1; } while (iVar5 < iVar15); iVar4 = local_14; } piVar10 = local_58 + iVar17; puVar18 = puVar18 + 1; iVar17 = iVar17 + 1; iVar8 = iVar4 + local_1c; uVar11 = uVar11 | *piVar10 << ((byte)iVar4 & 0x1f); local_14 = iVar8; } while (iVar17 < (int)local_18); if (-1 < (int)uVar11) goto LAB_00ad2f6a; LAB_00ad2fb3: iVar8 = 0; } *(int *)(param_1 + 0x514) = *(int *)(param_1 + 0x514) + iVar8; } iVar8 = 0; if (0 < (int)local_18) { local_1c = (int)local_8 * 8 + 0x50; local_8 = local_17c + (int)local_c; do { iVar15 = local_10[local_58[iVar8] + local_1c]; if (-1 < iVar15) { uVar11 = *local_8; iVar17 = local_2c + iVar15 * 0x38; if ((int)uVar11 < *(int *)(local_2c + 4 + iVar15 * 0x38)) { if (((int)uVar11 < 0) || (*(int *)(*(int *)(iVar17 + 0xc) + 4) <= (int)uVar11)) { *(undefined4 *)(param_1 + 0x518) = *(undefined4 *)(param_1 + 0x518); } else { oggpack_write(local_28,*(uint *)(*(int *)(iVar17 + 0x14) + uVar11 * 4), (int)*(char *)(*(int *)(*(int *)(iVar17 + 0xc) + 8) + uVar11)); *(int *)(param_1 + 0x518) = *(int *)(param_1 + 0x518) + (int)*(char *)(*(int *)(*(int *)(iVar17 + 0xc) + 8) + uVar11); } } } iVar8 = iVar8 + 1; local_8 = local_8 + 1; } while (iVar8 < (int)local_18); } local_c = (int *)((int)local_c + (int)local_18); local_20 = (uint *)((int)local_20 + 1); local_24 = local_24 + 1; } while ((int)local_20 < *local_10); } iVar17 = 0; iVar8 = 0; local_2c = 0; local_8 = (uint *)0x1; iVar15 = local_10[0xd0] * *param_2; iVar4 = *(int *)(local_30 + *(int *)(local_58[8] + 0x1c) * 4) / 2; if (1 < *(int *)(param_1 + 0x504)) { local_c = (int *)(param_1 + 0x108); iVar5 = iVar15; do { uVar11 = param_2[*local_c] & 0x7fff; iVar15 = iVar5; if (uVar11 == param_2[*local_c]) { iVar15 = local_10[0xd0] * uVar11; iVar8 = local_10[*local_c + 0xd1]; iVar17 = iVar8 - iVar17; iVar19 = 0; uVar2 = iVar15 - iVar5; uVar11 = (int)uVar2 >> 0x1f; iVar6 = (int)uVar2 / iVar17; uVar12 = iVar6 * iVar17 >> 0x1f; iVar13 = iVar8; if (iVar4 <= iVar8) { iVar13 = iVar4; } if (local_2c < iVar13) { *(int *)((int)param_3 + local_2c * 4) = iVar5; } while (local_2c = local_2c + 1, local_2c < iVar13) { iVar19 = iVar19 + (((uVar2 ^ uVar11) - uVar11) - ((iVar6 * iVar17 ^ uVar12) - uVar12)); if (iVar19 < iVar17) { iVar7 = iVar6; } else { iVar19 = iVar19 - iVar17; iVar7 = (uVar11 & 0xfffffffe) + 1 + iVar6; } iVar5 = iVar5 + iVar7; *(int *)((int)param_3 + local_2c * 4) = iVar5; } iVar17 = iVar8; local_2c = iVar8; } local_8 = (uint *)((int)local_8 + 1); local_c = local_c + 1; iVar5 = iVar15; } while ((int)local_8 < *(int *)(param_1 + 0x504)); } if (iVar8 < *(int *)(local_58[8] + 0x24) / 2) { do { *(int *)((int)param_3 + iVar8 * 4) = iVar15; iVar8 = iVar8 + 1; } while (iVar8 < *(int *)(local_58[8] + 0x24) / 2); } return 1; } //@@ 00ad3220 floor1_inverse1 /* DB: libvorbis floor1.c: in vorbis_func_floor table (.rdata 0xb5e348, next to 0xad3530 inverse2); oggpack_read(1), _vorbis_block_alloc(posts), fit_value[0..1]=oggpack_read(ilog(look->quant_q-1)) with quant_q at look+0x50c */ undefined4 * floor1_inverse1(int param_1,int param_2) { int *piVar1; int iVar2; int iVar3; undefined4 *puVar4; undefined4 uVar5; int iVar6; uint uVar7; int iVar8; int iVar9; byte bVar10; uint uVar11; uint uVar12; uint uVar13; int iVar14; int *piVar15; int *local_24; int local_20; int *local_10; int *local_c; piVar1 = *(int **)(param_2 + 0x510); iVar9 = *(int *)(*(int *)(*(int *)(*(int *)(param_1 + 0x40) + 4) + 0x1c) + 0xb20); iVar3 = FUN_00ab7120(); if (iVar3 != 1) { return (undefined4 *)0x0; } puVar4 = (undefined4 *)FUN_00aaca80(); for (uVar11 = *(int *)(param_2 + 0x50c) - 1; uVar11 != 0; uVar11 = uVar11 >> 1) { } uVar5 = FUN_00ab7120(); *puVar4 = uVar5; for (uVar11 = *(int *)(param_2 + 0x50c) - 1; uVar11 != 0; uVar11 = uVar11 >> 1) { } uVar5 = FUN_00ab7120(); puVar4[1] = uVar5; local_20 = 0; local_10 = (int *)0x2; if (0 < *piVar1) { local_24 = piVar1; do { local_24 = local_24 + 1; iVar3 = *local_24; uVar11 = 0; iVar2 = piVar1[iVar3 + 0x20]; bVar10 = (byte)piVar1[iVar3 + 0x30]; if (piVar1[iVar3 + 0x30] != 0) { iVar14 = piVar1[iVar3 + 0x40]; if (*(int *)(iVar9 + 8 + iVar14 * 0x38) < 1) { return (undefined4 *)0x0; } iVar6 = FUN_00ab75d0(); if (iVar6 < 0) { return (undefined4 *)0x0; } uVar11 = *(uint *)(*(int *)(iVar9 + iVar14 * 0x38 + 0x18) + iVar6 * 4); if (uVar11 == 0xffffffff) { return (undefined4 *)0x0; } } iVar14 = 0; if (0 < iVar2) { piVar15 = puVar4 + (int)local_10; do { uVar7 = (1 << (bVar10 & 0x1f)) - 1U & uVar11; uVar11 = (int)uVar11 >> (bVar10 & 0x1f); iVar6 = piVar1[uVar7 + iVar3 * 8 + 0x50]; if (iVar6 < 0) { *piVar15 = 0; } else { if ((*(int *)(iVar9 + 8 + iVar6 * 0x38) < 1) || (iVar8 = FUN_00ab75d0(), iVar8 < 0)) { *piVar15 = -1; return (undefined4 *)0x0; } iVar6 = *(int *)(*(int *)(iVar9 + iVar6 * 0x38 + 0x18) + iVar8 * 4); *piVar15 = iVar6; if (iVar6 == -1) { return (undefined4 *)0x0; } } iVar14 = iVar14 + 1; piVar15 = piVar15 + 1; } while (iVar14 < iVar2); } local_10 = (int *)((int)local_10 + iVar2); local_20 = local_20 + 1; } while (local_20 < *piVar1); } local_24 = (int *)0x2; if (2 < *(int *)(param_2 + 0x504)) { local_c = (int *)(param_2 + 0x30c); local_10 = piVar1 + 0xd3; do { uVar11 = (puVar4[*local_c] & 0x7fff) - (puVar4[local_c[0x3f]] & 0x7fff); iVar3 = (int)(((uVar11 ^ (int)uVar11 >> 0x1f) - ((int)uVar11 >> 0x1f)) * (*local_10 - piVar1[local_c[0x3f] + 0xd1])) / (piVar1[*local_c + 0xd1] - piVar1[local_c[0x3f] + 0xd1]); iVar9 = -iVar3; if (-1 < (int)uVar11) { iVar9 = iVar3; } uVar7 = (puVar4[local_c[0x3f]] & 0x7fff) + iVar9; uVar11 = puVar4[(int)local_24]; if (uVar11 == 0) { puVar4[(int)local_24] = uVar7 | 0x8000; } else { uVar13 = *(int *)(param_2 + 0x50c) - uVar7; uVar12 = uVar7; if ((int)uVar13 < (int)uVar7) { uVar12 = uVar13; } if ((int)uVar11 < (int)(uVar12 * 2)) { if ((uVar11 & 1) == 0) { iVar9 = (int)uVar11 >> 1; } else { iVar9 = -((int)(uVar11 + 1) >> 1); } } else if ((int)uVar7 < (int)uVar13) { iVar9 = uVar11 - uVar7; } else { iVar9 = (uVar13 - uVar11) + -1; } puVar4[(int)local_24] = iVar9 + uVar7 & 0x7fff; puVar4[local_c[0x3f]] = puVar4[local_c[0x3f]] & 0x7fff; puVar4[*local_c] = puVar4[*local_c] & 0x7fff; } local_24 = (int *)((int)local_24 + 1); local_10 = local_10 + 1; local_c = local_c + 1; } while ((int)local_24 < *(int *)(param_2 + 0x504)); } return puVar4; } //@@ 00ad3530 floor1_inverse2 /* DB: libvorbis floor1.c: n = blocksizes[W]/2, memset(out) when no memo, ly = post[0]*info->mult (look->vi +0x510, mult +0x340, postlist +0x344) clamped 0..255, hy = post[i] & 0x7fff render_line; no direct caller (_floor_P table) */ undefined4 floor1_inverse2(int param_1,int param_2,int *param_3,void *param_4) { float fVar1; int iVar2; int iVar3; int iVar4; float *pfVar5; int iVar6; uint uVar7; uint uVar8; int iVar9; int iVar10; uint uVar11; int iVar12; int iVar13; int iVar14; int *local_1c; int local_18; int local_10; iVar2 = *(int *)(param_2 + 0x510); iVar10 = *(int *)(*(int *)(*(int *)(*(int *)(param_1 + 0x40) + 4) + 0x1c) + *(int *)(param_1 + 0x1c) * 4) / 2; if (param_3 == (int *)0x0) { memset(param_4,0,iVar10 * 4); return 0; } iVar13 = 0; iVar9 = 0; iVar6 = *(int *)(iVar2 + 0x340) * *param_3; local_10 = 0; if (iVar6 < 0) { iVar6 = 0; } else if (0xff < iVar6) { iVar6 = 0xff; } local_18 = 1; if (1 < *(int *)(param_2 + 0x504)) { local_1c = (int *)(param_2 + 0x108); iVar14 = iVar6; param_1 = iVar6; do { uVar7 = param_3[*local_1c] & 0x7fff; iVar6 = iVar14; if (uVar7 == param_3[*local_1c]) { iVar9 = *(int *)(iVar2 + 0x344 + *local_1c * 4); iVar6 = *(int *)(iVar2 + 0x340) * uVar7; if (iVar6 < 0) { iVar6 = 0; } else if (0xff < iVar6) { iVar6 = 0xff; } uVar11 = iVar6 - iVar14; iVar13 = iVar9 - iVar13; uVar7 = (int)uVar11 >> 0x1f; iVar14 = 0; iVar3 = (int)uVar11 / iVar13; uVar8 = iVar3 * iVar13 >> 0x1f; iVar12 = iVar9; if (iVar10 <= iVar9) { iVar12 = iVar10; } if (local_10 < iVar12) { *(float *)((int)param_4 + local_10 * 4) = (float)(&DAT_00b5f260)[param_1] * *(float *)((int)param_4 + local_10 * 4); } while (local_10 = local_10 + 1, local_10 < iVar12) { iVar14 = iVar14 + (((uVar11 ^ uVar7) - uVar7) - ((iVar3 * iVar13 ^ uVar8) - uVar8)); if (iVar14 < iVar13) { iVar4 = iVar3; } else { iVar14 = iVar14 - iVar13; iVar4 = (uVar7 & 0xfffffffe) + 1 + iVar3; } param_1 = param_1 + iVar4; *(float *)((int)param_4 + local_10 * 4) = (float)(&DAT_00b5f260)[param_1] * *(float *)((int)param_4 + local_10 * 4); } iVar13 = iVar9; param_1 = iVar6; local_10 = iVar9; } local_18 = local_18 + 1; local_1c = local_1c + 1; iVar14 = iVar6; } while (local_18 < *(int *)(param_2 + 0x504)); } if (iVar9 < iVar10) { if (0xf < (uint)(iVar10 - iVar9)) { fVar1 = (float)(&DAT_00b5f260)[iVar6]; uVar7 = iVar10 - iVar9 & 0x8000000f; if ((int)uVar7 < 0) { uVar7 = (uVar7 - 1 | 0xfffffff0) + 1; } pfVar5 = (float *)((int)param_4 + iVar9 * 4 + 0x20); do { iVar9 = iVar9 + 0x10; pfVar5[-8] = fVar1 * pfVar5[-8]; pfVar5[-7] = fVar1 * pfVar5[-7]; pfVar5[-6] = fVar1 * pfVar5[-6]; pfVar5[-5] = fVar1 * pfVar5[-5]; pfVar5[-4] = pfVar5[-4] * fVar1; pfVar5[-3] = pfVar5[-3] * fVar1; pfVar5[-2] = pfVar5[-2] * fVar1; pfVar5[-1] = pfVar5[-1] * fVar1; *pfVar5 = fVar1 * *pfVar5; pfVar5[1] = fVar1 * pfVar5[1]; pfVar5[2] = fVar1 * pfVar5[2]; pfVar5[3] = fVar1 * pfVar5[3]; pfVar5[4] = pfVar5[4] * fVar1; pfVar5[5] = pfVar5[5] * fVar1; pfVar5[6] = pfVar5[6] * fVar1; pfVar5[7] = pfVar5[7] * fVar1; pfVar5 = pfVar5 + 0x10; } while (iVar9 < (int)(iVar10 - uVar7)); if (iVar10 <= iVar9) { return 1; } } fVar1 = (float)(&DAT_00b5f260)[iVar6]; if (3 < iVar10 - iVar9) { iVar2 = iVar9 + 2; iVar6 = ((iVar10 - iVar9) - 4U >> 2) + 1; iVar9 = iVar9 + iVar6 * 4; pfVar5 = (float *)((int)param_4 + iVar2 * 4); do { pfVar5[-2] = pfVar5[-2] * fVar1; pfVar5[-1] = pfVar5[-1] * fVar1; *pfVar5 = *pfVar5 * fVar1; pfVar5[1] = pfVar5[1] * fVar1; iVar6 = iVar6 + -1; pfVar5 = pfVar5 + 4; } while (iVar6 != 0); if (iVar10 <= iVar9) { return 1; } } do { *(float *)((int)param_4 + iVar9 * 4) = fVar1 * *(float *)((int)param_4 + iVar9 * 4); iVar9 = iVar9 + 1; } while (iVar9 < iVar10); } return 1; } //@@ 00ad37e0 FUN_00ad37e0 void FUN_00ad37e0(int param_1) { undefined1 uVar1; undefined1 uVar2; undefined1 uVar3; undefined1 uVar4; undefined1 uVar5; int iVar6; undefined1 *puVar7; int in_ECX; undefined1 *puVar8; int in_EDX; undefined1 *puVar9; undefined1 *puVar10; undefined1 *puVar11; undefined1 *puVar12; undefined1 *puVar13; uint local_18; int local_c; local_18 = 0; iVar6 = *(int *)(in_ECX + 0x14); if (*(int *)(in_ECX + 0x18) != 0) { local_c = 0; do { puVar9 = (undefined1 *)((local_18 + 1) * *(int *)(in_ECX + 0x20) + *(int *)(in_ECX + 4)); puVar13 = (undefined1 *)(*(int *)(in_ECX + 0x20) * local_18 + *(int *)(in_ECX + 4)); puVar8 = (undefined1 *)((*(int *)(in_ECX + 0x24) * local_18 >> 1) + *(int *)(in_ECX + 8)); puVar10 = (undefined1 *)((*(int *)(in_ECX + 0x28) * local_18 >> 1) + *(int *)(in_ECX + 0xc)); puVar12 = (undefined1 *)(local_c + *(int *)(in_ECX + 0x10)); puVar7 = (undefined1 *)(*(int *)(in_ECX + 0x10) + local_c + in_EDX); puVar11 = puVar13 + iVar6; for (; puVar13 != puVar11; puVar13 = puVar13 + 2) { uVar1 = *puVar8; puVar8 = puVar8 + 1; uVar2 = *puVar10; uVar3 = puVar13[1]; puVar10 = puVar10 + 1; uVar4 = *puVar9; uVar5 = puVar9[1]; puVar9 = puVar9 + 2; *puVar12 = *puVar13; puVar12[2] = uVar2; puVar12[1] = uVar1; puVar12 = puVar12 + param_1; *puVar7 = uVar4; puVar7[2] = uVar2; puVar7[1] = uVar1; puVar7 = puVar7 + param_1; puVar12[2] = uVar2; *puVar12 = uVar3; puVar12[1] = uVar1; puVar12 = puVar12 + param_1; *puVar7 = uVar5; puVar7[2] = uVar2; puVar7[1] = uVar1; puVar7 = puVar7 + param_1; } local_18 = local_18 + 2; local_c = local_c + in_EDX * 2; } while (local_18 < *(uint *)(in_ECX + 0x18)); } return; } //@@ 00ad38f0 FUN_00ad38f0 void FUN_00ad38f0(void) { FUN_00ad37e0(3); return; } //@@ 00ad3910 FUN_00ad3910 void FUN_00ad3910(int param_1) { FUN_00ad37e0(4); *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 3; FUN_00ab6e40(); return; } //@@ 00ad3940 FUN_00ad3940 void FUN_00ad3940(void) { FUN_00ad37e0(4); return; } //@@ 00ad3960 FUN_00ad3960 void FUN_00ad3960(int param_1) { *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1; FUN_00ad37e0(4); FUN_00ab6e40(); return; } //@@ 00ad3990 FUN_00ad3990 void FUN_00ad3990(int param_1) { *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1; FUN_00ad37e0(4,param_1); return; } //@@ 00ad39b0 FUN_00ad39b0 void FUN_00ad39b0(int param_1) { undefined1 *puVar1; undefined1 uVar2; undefined1 *puVar3; int in_ECX; int in_EDX; undefined1 *puVar4; int iVar5; uint local_8; puVar3 = *(undefined1 **)(in_ECX + 0x10); puVar4 = *(undefined1 **)(in_ECX + 4); local_8 = 0; if (*(int *)(in_ECX + 0x18) != 0) { iVar5 = *(int *)(in_ECX + 0x14); do { puVar1 = puVar4 + iVar5; if (puVar4 != puVar1) { do { uVar2 = *puVar4; puVar4 = puVar4 + 1; puVar3[2] = uVar2; puVar3[1] = uVar2; *puVar3 = uVar2; puVar3 = puVar3 + param_1; } while (puVar4 != puVar1); iVar5 = *(int *)(in_ECX + 0x14); } local_8 = local_8 + 1; puVar4 = puVar4 + (*(int *)(in_ECX + 0x20) - iVar5); puVar3 = puVar3 + (in_EDX - iVar5 * param_1); } while (local_8 < *(uint *)(in_ECX + 0x18)); } return; } //@@ 00ad3a20 FUN_00ad3a20 void FUN_00ad3a20(uint param_1) { undefined1 *puVar1; undefined1 uVar2; int iVar3; undefined1 *puVar4; undefined1 *puVar5; int iVar6; iVar3 = param_1; param_1 = 0; puVar4 = *(undefined1 **)(iVar3 + 4); puVar5 = *(undefined1 **)(iVar3 + 0x10); if (*(int *)(iVar3 + 0x18) != 0) { iVar6 = *(int *)(iVar3 + 0x14); do { puVar1 = puVar4 + iVar6; if (puVar4 != puVar1) { do { uVar2 = *puVar4; puVar4 = puVar4 + 1; *puVar5 = uVar2; puVar5 = puVar5 + 1; } while (puVar4 != puVar1); iVar6 = *(int *)(iVar3 + 0x14); } param_1 = param_1 + 1; puVar4 = puVar4 + (*(int *)(iVar3 + 0x20) - iVar6); } while (param_1 < *(uint *)(iVar3 + 0x18)); } return; } //@@ 00ad3a70 FUN_00ad3a70 void FUN_00ad3a70(void) { FUN_00ad39b0(3); return; } //@@ 00ad3a90 FUN_00ad3a90 void FUN_00ad3a90(int param_1) { FUN_00ad39b0(4); *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 3; FUN_00ab6e40(); return; } //@@ 00ad3ac0 FUN_00ad3ac0 void FUN_00ad3ac0(void) { FUN_00ad39b0(4); return; } //@@ 00ad3ae0 FUN_00ad3ae0 void FUN_00ad3ae0(int param_1) { *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1; FUN_00ad39b0(4); FUN_00ab6e40(); return; } //@@ 00ad3b10 FUN_00ad3b10 void FUN_00ad3b10(int param_1) { *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1; FUN_00ad39b0(); return; } //@@ 00ad3b30 FUN_00ad3b30 void FUN_00ad3b30(int param_1) { uint *puVar1; byte bVar2; undefined1 uVar3; uint *puVar4; undefined1 *puVar5; undefined1 *puVar6; byte bVar7; int in_ECX; uint uVar8; int *in_EDX; undefined1 *puVar9; undefined1 *puVar10; uint uVar11; undefined4 uVar12; undefined4 uStack_24; byte *pbStack_20; uint local_14; byte *local_10; uint local_c; puVar4 = *(uint **)(in_ECX + 4); local_14 = in_EDX[1]; puVar10 = *(undefined1 **)(in_ECX + 0x34); uVar11 = *(uint *)(in_ECX + 0x1c); local_10 = (byte *)*in_EDX; local_c = *(uint *)(in_ECX + 0x20); if (puVar10 < *(undefined1 **)(in_ECX + 0x30)) { puVar6 = *(undefined1 **)(in_ECX + 0x30) + (-1 - (int)puVar10); } else { puVar6 = (undefined1 *)(*(int *)(in_ECX + 0x2c) - (int)puVar10); } uVar8 = *puVar4; while (puVar9 = puVar10, uVar8 < 10) { switch((&PTR_LAB_00ad41a4)[*puVar4]) { case (undefined *)0xad3b8c: if ((puVar6 < (undefined1 *)0x102) || (local_14 < 10)) { LAB_00ad3c29: puVar4[3] = (uint)(byte)puVar4[4]; puVar4[2] = puVar4[5]; *puVar4 = 1; goto LAB_00ad3c46; } *(uint *)(in_ECX + 0x1c) = uVar11; *(uint *)(in_ECX + 0x20) = local_c; in_EDX[2] = (int)(local_10 + (in_EDX[2] - *in_EDX)); in_EDX[1] = local_14; *in_EDX = (int)local_10; *(undefined1 **)(in_ECX + 0x34) = puVar10; param_1 = inflate_fast(puVar4[5],puVar4[6],in_ECX,in_EDX); local_10 = (byte *)*in_EDX; local_14 = in_EDX[1]; puVar10 = *(undefined1 **)(in_ECX + 0x34); uVar11 = *(uint *)(in_ECX + 0x1c); local_c = *(uint *)(in_ECX + 0x20); if (puVar10 < *(undefined1 **)(in_ECX + 0x30)) { puVar6 = *(undefined1 **)(in_ECX + 0x30) + (-1 - (int)puVar10); } else { puVar6 = (undefined1 *)(*(int *)(in_ECX + 0x2c) - (int)puVar10); } if (param_1 == 0) goto LAB_00ad3c29; *puVar4 = (uint)(param_1 != 1) * 2 + 7; goto LAB_00ad4073; case (undefined *)0xad3c46: LAB_00ad3c46: if (uVar11 < puVar4[3]) { do { if (local_14 == 0) { LAB_00ad40b2: *(uint *)(in_ECX + 0x20) = local_c; *(uint *)(in_ECX + 0x1c) = uVar11; in_EDX[2] = (int)(local_10 + (in_EDX[2] - *in_EDX)); *in_EDX = (int)local_10; in_EDX[1] = 0; *(undefined1 **)(in_ECX + 0x34) = puVar10; FUN_00ad41d0(param_1); return; } local_14 = local_14 - 1; param_1 = 0; bVar2 = *local_10; local_10 = local_10 + 1; bVar7 = (byte)uVar11; uVar11 = uVar11 + 8; local_c = local_c | (uint)bVar2 << (bVar7 & 0x1f); } while (uVar11 < puVar4[3]); } pbStack_20 = (byte *)(puVar4[2] + (*(uint *)(&DAT_00b5f660 + puVar4[3] * 4) & local_c) * 8); local_c = local_c >> (pbStack_20[1] & 0x1f); uVar11 = uVar11 - pbStack_20[1]; bVar2 = *pbStack_20; uVar8 = (uint)bVar2; if (uVar8 == 0) { puVar4[2] = *(uint *)(pbStack_20 + 4); *puVar4 = 6; goto LAB_00ad4073; } if ((bVar2 & 0x10) != 0) { puVar4[2] = uVar8 & 0xf; puVar4[1] = *(uint *)(pbStack_20 + 4); *puVar4 = 2; goto LAB_00ad4073; } if ((bVar2 & 0x40) != 0) { if ((bVar2 & 0x20) == 0) { *puVar4 = 9; in_EDX[6] = (int)"invalid literal/length code"; *(uint *)(in_ECX + 0x20) = local_c; *(uint *)(in_ECX + 0x1c) = uVar11; in_EDX[1] = local_14; in_EDX[2] = (int)(local_10 + (in_EDX[2] - *in_EDX)); *in_EDX = (int)local_10; *(undefined1 **)(in_ECX + 0x34) = puVar10; FUN_00ad41d0(0xfffffffd); return; } *puVar4 = 7; goto LAB_00ad4073; } goto LAB_00ad3cff; case (undefined *)0xad3d32: if (uVar11 < puVar4[2]) { do { if (local_14 == 0) goto LAB_00ad40b2; local_14 = local_14 - 1; param_1 = 0; bVar2 = *local_10; local_10 = local_10 + 1; bVar7 = (byte)uVar11; uVar11 = uVar11 + 8; local_c = local_c | (uint)bVar2 << (bVar7 & 0x1f); } while (uVar11 < puVar4[2]); } puVar4[1] = puVar4[1] + (*(uint *)(&DAT_00b5f660 + puVar4[2] * 4) & local_c); local_c = local_c >> ((byte)puVar4[2] & 0x1f); uVar11 = uVar11 - puVar4[2]; puVar4[3] = (uint)*(byte *)((int)puVar4 + 0x11); puVar4[2] = puVar4[6]; *puVar4 = 3; case (undefined *)0xad3da8: if (uVar11 < puVar4[3]) { do { if (local_14 == 0) goto LAB_00ad40b2; local_14 = local_14 - 1; param_1 = 0; bVar2 = *local_10; local_10 = local_10 + 1; bVar7 = (byte)uVar11; uVar11 = uVar11 + 8; local_c = local_c | (uint)bVar2 << (bVar7 & 0x1f); } while (uVar11 < puVar4[3]); } pbStack_20 = (byte *)(puVar4[2] + (*(uint *)(&DAT_00b5f660 + puVar4[3] * 4) & local_c) * 8); local_c = local_c >> (pbStack_20[1] & 0x1f); uVar11 = uVar11 - pbStack_20[1]; bVar2 = *pbStack_20; uVar8 = (uint)bVar2; if ((bVar2 & 0x10) == 0) { if ((bVar2 & 0x40) != 0) { *puVar4 = 9; in_EDX[6] = (int)"invalid distance code"; *(uint *)(in_ECX + 0x20) = local_c; *(uint *)(in_ECX + 0x1c) = uVar11; in_EDX[1] = local_14; in_EDX[2] = (int)(local_10 + (in_EDX[2] - *in_EDX)); *in_EDX = (int)local_10; *(undefined1 **)(in_ECX + 0x34) = puVar10; FUN_00ad41d0(0xfffffffd); return; } LAB_00ad3cff: puVar4[3] = uVar8; puVar4[2] = (uint)(pbStack_20 + *(int *)(pbStack_20 + 4) * 8); } else { puVar4[2] = uVar8 & 0xf; puVar4[3] = *(uint *)(pbStack_20 + 4); *puVar4 = 4; } LAB_00ad4073: uVar8 = *puVar4; break; case (undefined *)0xad3e93: if (uVar11 < puVar4[2]) { do { if (local_14 == 0) goto LAB_00ad40b2; local_14 = local_14 - 1; param_1 = 0; bVar2 = *local_10; local_10 = local_10 + 1; bVar7 = (byte)uVar11; uVar11 = uVar11 + 8; local_c = local_c | (uint)bVar2 << (bVar7 & 0x1f); } while (uVar11 < puVar4[2]); } puVar4[3] = puVar4[3] + (*(uint *)(&DAT_00b5f660 + puVar4[2] * 4) & local_c); local_c = local_c >> ((byte)puVar4[2] & 0x1f); uVar11 = uVar11 - puVar4[2]; *puVar4 = 5; case (undefined *)0xad3f02: pbStack_20 = puVar10 + -puVar4[3]; puVar9 = *(undefined1 **)(in_ECX + 0x28); if (pbStack_20 < puVar9) { do { pbStack_20 = pbStack_20 + (*(int *)(in_ECX + 0x2c) - (int)puVar9); } while (pbStack_20 < puVar9); } uVar8 = puVar4[1]; while (uVar8 != 0) { puVar9 = puVar10; if (puVar6 == (undefined1 *)0x0) { if (puVar10 == *(undefined1 **)(in_ECX + 0x2c)) { puVar6 = *(undefined1 **)(in_ECX + 0x30); puVar9 = *(undefined1 **)(in_ECX + 0x28); if (puVar6 != puVar9) { if (puVar9 < puVar6) { puVar6 = puVar6 + (-1 - (int)puVar9); } else { puVar6 = (undefined1 *)(*(int *)(in_ECX + 0x2c) - (int)puVar9); } puVar10 = puVar9; if (puVar6 != (undefined1 *)0x0) goto LAB_00ad3fb2; } } *(undefined1 **)(in_ECX + 0x34) = puVar10; uStack_24 = FUN_00ad41d0(param_1); puVar9 = *(undefined1 **)(in_ECX + 0x34); puVar10 = *(undefined1 **)(in_ECX + 0x30); puVar5 = *(undefined1 **)(in_ECX + 0x2c); if (puVar9 < puVar10) { puVar6 = puVar10 + (-1 - (int)puVar9); } else { puVar6 = puVar5 + -(int)puVar9; } if ((puVar9 == puVar5) && (puVar10 != *(undefined1 **)(in_ECX + 0x28))) { puVar9 = *(undefined1 **)(in_ECX + 0x28); if (puVar9 < puVar10) { puVar6 = puVar10 + (-1 - (int)puVar9); } else { puVar6 = puVar5 + -(int)puVar9; } } if (puVar6 == (undefined1 *)0x0) goto LAB_00ad4129; } LAB_00ad3fb2: uVar3 = *pbStack_20; puVar6 = puVar6 + -1; pbStack_20 = pbStack_20 + 1; *puVar9 = uVar3; puVar10 = puVar9 + 1; param_1 = 0; if (pbStack_20 == *(undefined1 **)(in_ECX + 0x2c)) { pbStack_20 = *(byte **)(in_ECX + 0x28); } puVar1 = puVar4 + 1; *puVar1 = *puVar1 - 1; uVar8 = *puVar1; } LAB_00ad406d: *puVar4 = 0; goto LAB_00ad4073; case (undefined *)0xad3fe0: if (puVar6 == (undefined1 *)0x0) { if (puVar10 == *(undefined1 **)(in_ECX + 0x2c)) { puVar6 = *(undefined1 **)(in_ECX + 0x30); puVar9 = *(undefined1 **)(in_ECX + 0x28); if (puVar6 != puVar9) { if (puVar9 < puVar6) { puVar6 = puVar6 + (-1 - (int)puVar9); } else { puVar6 = *(undefined1 **)(in_ECX + 0x2c) + -(int)puVar9; } puVar10 = puVar9; if (puVar6 != (undefined1 *)0x0) goto LAB_00ad4059; } } *(undefined1 **)(in_ECX + 0x34) = puVar10; uStack_24 = FUN_00ad41d0(param_1); puVar9 = *(undefined1 **)(in_ECX + 0x34); puVar10 = *(undefined1 **)(in_ECX + 0x30); puVar5 = *(undefined1 **)(in_ECX + 0x2c); if (puVar9 < puVar10) { puVar6 = puVar10 + (-1 - (int)puVar9); } else { puVar6 = puVar5 + -(int)puVar9; } if ((puVar9 == puVar5) && (puVar10 != *(undefined1 **)(in_ECX + 0x28))) { puVar9 = *(undefined1 **)(in_ECX + 0x28); if (puVar9 < puVar10) { puVar6 = puVar10 + (-1 - (int)puVar9); } else { puVar6 = puVar5 + -(int)puVar9; } } if (puVar6 == (undefined1 *)0x0) { LAB_00ad4129: *(uint *)(in_ECX + 0x20) = local_c; *(uint *)(in_ECX + 0x1c) = uVar11; in_EDX[1] = local_14; in_EDX[2] = (int)(local_10 + (in_EDX[2] - *in_EDX)); *in_EDX = (int)local_10; *(undefined1 **)(in_ECX + 0x34) = puVar9; FUN_00ad41d0(uStack_24); return; } } LAB_00ad4059: param_1 = 0; *puVar9 = (char)puVar4[2]; puVar10 = puVar9 + 1; puVar6 = puVar6 + -1; goto LAB_00ad406d; case (undefined *)0xad415e: if (7 < uVar11) { local_14 = local_14 + 1; uVar11 = uVar11 - 8; local_10 = local_10 + -1; } *(undefined1 **)(in_ECX + 0x34) = puVar10; uStack_24 = FUN_00ad41d0(param_1); puVar9 = *(undefined1 **)(in_ECX + 0x34); if (*(undefined1 **)(in_ECX + 0x30) != puVar9) goto LAB_00ad4129; *puVar4 = 8; case (undefined *)0xad4193: uVar12 = 1; goto LAB_00ad407e; case (undefined *)0xad419a: uVar12 = 0xfffffffd; goto LAB_00ad407e; } } uVar12 = 0xfffffffe; LAB_00ad407e: *(uint *)(in_ECX + 0x1c) = uVar11; *(uint *)(in_ECX + 0x20) = local_c; in_EDX[2] = (int)(local_10 + (in_EDX[2] - *in_EDX)); in_EDX[1] = local_14; *in_EDX = (int)local_10; *(undefined1 **)(in_ECX + 0x34) = puVar9; FUN_00ad41d0(uVar12); return; } //@@ 00ad41d0 FUN_00ad41d0 int FUN_00ad41d0(int param_1) { uint uVar1; undefined4 uVar2; void *pvVar3; void *pvVar4; int in_ECX; uint uVar5; int in_EDX; void *pvVar6; pvVar6 = *(void **)(in_ECX + 0x30); pvVar4 = *(void **)(in_ECX + 0x34); pvVar3 = *(void **)(in_EDX + 0xc); if (pvVar4 < pvVar6) { pvVar4 = *(void **)(in_ECX + 0x2c); } uVar1 = *(uint *)(in_EDX + 0x10); uVar5 = uVar1; if ((uint)((int)pvVar4 - (int)pvVar6) <= uVar1) { uVar5 = (int)pvVar4 - (int)pvVar6; } if (uVar5 != 0) { if (param_1 == -5) { param_1 = 0; } } *(int *)(in_EDX + 0x14) = *(int *)(in_EDX + 0x14) + uVar5; *(uint *)(in_EDX + 0x10) = uVar1 - uVar5; if (*(code **)(in_ECX + 0x38) != (code *)0x0) { uVar2 = (**(code **)(in_ECX + 0x38))(*(undefined4 *)(in_ECX + 0x3c),pvVar6,uVar5); *(undefined4 *)(in_ECX + 0x3c) = uVar2; *(undefined4 *)(in_EDX + 0x30) = uVar2; } memcpy(pvVar3,pvVar6,uVar5); pvVar3 = (void *)((int)pvVar3 + uVar5); pvVar6 = (void *)((int)pvVar6 + uVar5); if (pvVar6 == *(void **)(in_ECX + 0x2c)) { pvVar6 = *(void **)(in_ECX + 0x28); pvVar4 = *(void **)(in_ECX + 0x34); if (*(void **)(in_ECX + 0x34) == *(void **)(in_ECX + 0x2c)) { *(void **)(in_ECX + 0x34) = pvVar6; pvVar4 = pvVar6; } uVar1 = *(uint *)(in_EDX + 0x10); uVar5 = uVar1; if ((uint)((int)pvVar4 - (int)pvVar6) <= uVar1) { uVar5 = (int)pvVar4 - (int)pvVar6; } if ((uVar5 != 0) && (param_1 == -5)) { param_1 = 0; } *(int *)(in_EDX + 0x14) = *(int *)(in_EDX + 0x14) + uVar5; *(uint *)(in_EDX + 0x10) = uVar1 - uVar5; if (*(code **)(in_ECX + 0x38) != (code *)0x0) { uVar2 = (**(code **)(in_ECX + 0x38))(*(undefined4 *)(in_ECX + 0x3c),pvVar6,uVar5); *(undefined4 *)(in_ECX + 0x3c) = uVar2; *(undefined4 *)(in_EDX + 0x30) = uVar2; } memcpy(pvVar3,pvVar6,uVar5); pvVar3 = (void *)((int)pvVar3 + uVar5); pvVar6 = (void *)((int)pvVar6 + uVar5); } *(void **)(in_EDX + 0xc) = pvVar3; *(void **)(in_ECX + 0x30) = pvVar6; return param_1; } //@@ 00ad42e0 huft_build /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: zlib 1.1.x inftrees.c: counts code lengths into 16 bins, returns Z_DATA_ERROR(-3) on oversubscribed/incomplete, MANY=1440 (0x5a0) hufts limit; called 3x from FUN_00abd900 (inflate_trees_bits/dynamic strings 'oversubscribed literal/length tree') */ undefined4 huft_build(uint param_1,int param_2,int param_3,int *param_4,uint *param_5,int param_6,uint *param_7 ,uint *param_8) { char cVar1; undefined3 uVar2; uint *puVar3; int iVar4; uint *puVar5; uint uVar6; uint uVar7; uint uVar8; int *in_ECX; int *piVar9; int iVar10; uint in_EDX; uint uVar11; uint uVar12; uint uVar13; byte bVar14; int iVar15; uint uVar16; int iVar17; int iVar18; uint uVar19; undefined4 local_f8; uint local_f4; uint local_e8; int local_e4; uint local_e0; uint *local_dc; uint *local_d8; uint local_d0; int local_cc [16]; uint local_8c [16]; uint local_4c [17]; uint local_8; local_8 = __security_cookie ^ (uint)(local_4c + 0x12); local_4c[0] = 0; local_4c[1] = 0; local_4c[2] = 0; local_4c[3] = 0; local_4c[0xe] = 0; local_4c[4] = 0; local_4c[5] = 0; local_4c[6] = 0; local_4c[7] = 0; local_4c[0xf] = 0; local_4c[8] = 0; local_4c[9] = 0; local_4c[10] = 0; local_4c[0xb] = 0; local_4c[0xc] = 0; local_4c[0xd] = 0; piVar9 = in_ECX; uVar11 = in_EDX; do { iVar17 = *piVar9; piVar9 = piVar9 + 1; local_4c[iVar17] = local_4c[iVar17] + 1; uVar11 = uVar11 - 1; } while (uVar11 != 0); if (local_4c[0] == in_EDX) { *param_4 = 0; *param_5 = 0; } else { local_d0 = 1; do { if (local_4c[local_d0] != 0) break; local_d0 = local_d0 + 1; } while (local_d0 < 0x10); uVar11 = local_d0; if (local_d0 <= *param_5) { uVar11 = *param_5; } uVar12 = 0xf; do { if (local_4c[uVar12] != 0) break; uVar12 = uVar12 - 1; } while (uVar12 != 0); uVar16 = uVar12; if (uVar11 <= uVar12) { uVar16 = uVar11; } *param_5 = uVar16; iVar17 = 1 << ((byte)local_d0 & 0x1f); for (uVar11 = local_d0; uVar11 < uVar12; uVar11 = uVar11 + 1) { if ((int)(iVar17 - local_4c[uVar11]) < 0) { return 0xfffffffd; } iVar17 = (iVar17 - local_4c[uVar11]) * 2; } iVar17 = iVar17 - local_4c[uVar12]; if (iVar17 < 0) { return 0xfffffffd; } local_4c[uVar12] = local_4c[uVar12] + iVar17; puVar5 = local_4c; uVar11 = 0; local_8c[1] = 0; puVar3 = local_8c + 2; uVar19 = uVar12; while( true ) { puVar5 = puVar5 + 1; uVar19 = uVar19 - 1; if (uVar19 == 0) break; uVar11 = uVar11 + *puVar5; *puVar3 = uVar11; puVar3 = puVar3 + 1; } uVar11 = 0; do { iVar18 = *in_ECX; in_ECX = in_ECX + 1; if (iVar18 != 0) { uVar19 = local_8c[iVar18]; param_8[uVar19] = uVar11; local_8c[iVar18] = uVar19 + 1; } uVar11 = uVar11 + 1; } while (uVar11 < in_EDX); iVar18 = 0; local_dc = param_8; iVar15 = -uVar16; local_e8 = 0; uVar11 = local_8c[uVar12]; uVar19 = 0; local_8c[0] = 0; local_cc[0] = -1; local_cc[1] = 0; if ((int)local_d0 <= (int)uVar12) { local_d8 = local_4c + local_d0; local_e0 = local_f4; local_e4 = iVar15; do { if (*local_d8 != 0) { uVar8 = *local_d8; do { uVar6 = uVar8 - 1; while (iVar4 = uVar16 + iVar15, iVar4 < (int)local_d0) { iVar10 = local_cc[0] + 1; uVar19 = uVar12 - iVar4; if (uVar16 < uVar12 - iVar4) { uVar19 = uVar16; } uVar13 = local_d0 - iVar4; uVar7 = 1 << ((byte)uVar13 & 0x1f); if ((uVar8 < uVar7) && (iVar18 = uVar7 + (-1 - uVar6), puVar3 = local_d8, uVar13 < uVar19)) { while (uVar13 = uVar13 + 1, uVar13 < uVar19) { if ((uint)(iVar18 * 2) <= puVar3[1]) break; iVar18 = iVar18 * 2 - puVar3[1]; puVar3 = puVar3 + 1; } } uVar19 = 1 << ((byte)uVar13 & 0x1f); uVar7 = *param_7 + uVar19; if (0x5a0 < uVar7) { return 0xfffffffd; } iVar18 = param_6 + *param_7 * 8; local_cc[local_cc[0] + 2] = iVar18; *param_7 = uVar7; if (iVar10 == 0) { *param_4 = iVar18; } else { local_8c[iVar10] = local_e8; local_f8._2_2_ = (undefined2)((uint)local_f8 >> 0x10); local_f8 = CONCAT31(CONCAT21(local_f8._2_2_,(char)uVar16),(byte)uVar13); uVar13 = local_e8 >> ((char)iVar4 - (char)uVar16 & 0x1fU); iVar15 = local_cc[iVar10]; local_e0 = (iVar18 - iVar15 >> 3) - uVar13; *(undefined4 *)(iVar15 + uVar13 * 8) = local_f8; *(uint *)(iVar15 + 4 + uVar13 * 8) = local_e0; } iVar15 = iVar4; local_e4 = iVar4; local_cc[0] = iVar10; } cVar1 = (char)local_d0; bVar14 = (byte)iVar15; uVar2 = CONCAT21(local_f8._2_2_,cVar1 - bVar14); if (local_dc < param_8 + uVar11) { local_e0 = *local_dc; local_dc = local_dc + 1; if (local_e0 < param_1) { local_f8 = CONCAT31(uVar2,(-(local_e0 < 0x100) & 0xa0U) + 0x60); } else { local_f8 = CONCAT31(uVar2,*(char *)(param_3 + (local_e0 - param_1) * 4) + 'P'); local_e0 = *(uint *)(param_2 + (local_e0 - param_1) * 4); } } else { local_f8 = CONCAT31(uVar2,0xc0); } uVar8 = local_e8 >> (bVar14 & 0x1f); if (uVar8 < uVar19) { do { *(undefined4 *)(iVar18 + uVar8 * 8) = local_f8; *(uint *)(iVar18 + 4 + uVar8 * 8) = local_e0; uVar8 = uVar8 + (1 << (cVar1 - bVar14 & 0x1f)); } while (uVar8 < uVar19); iVar15 = local_e4; } uVar13 = 1 << (cVar1 - 1U & 0x1f); uVar8 = local_e8 & uVar13; while (uVar8 != 0) { local_e8 = local_e8 ^ uVar13; uVar13 = uVar13 >> 1; uVar8 = local_e8 & uVar13; } local_e8 = local_e8 ^ uVar13; if (((1 << ((byte)iVar15 & 0x1f)) - 1U & local_e8) != local_8c[local_cc[0]]) { do { iVar15 = iVar15 - uVar16; local_cc[0] = local_cc[0] + -1; } while (((1 << ((byte)iVar15 & 0x1f)) - 1U & local_e8) != local_8c[local_cc[0]]); local_e4 = iVar15; } uVar8 = uVar6; } while (uVar6 != 0); } local_d8 = local_d8 + 1; local_d0 = local_d0 + 1; } while ((int)local_d0 <= (int)uVar12); } if ((iVar17 != 0) && (uVar12 != 1)) { return 0xfffffffb; } } return 0; } //@@ 00ad4820 jpeg_idct_islow /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg: case 8 with dct_method 0 of the start_pass 00acae00 jddctmgr_start_pass */ void jpeg_idct_islow(int param_1,int param_2,short *param_3,int param_4,int param_5) { undefined1 uVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; undefined1 *puVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int *local_118; int local_114; int *local_10c; int local_108 [24]; int local_a8 [8]; int local_88 [32]; uint local_8; local_8 = __security_cookie ^ (uint)(local_88 + 0x21); local_118 = local_108; iVar2 = *(int *)(param_1 + 0x124) + 0x80; local_114 = 8; local_10c = *(int **)(param_2 + 0x54); do { if ((((param_3[8] == 0) && (param_3[0x10] == 0)) && (param_3[0x18] == 0)) && (((param_3[0x20] == 0 && (param_3[0x28] == 0)) && ((param_3[0x30] == 0 && (param_3[0x38] == 0)))))) { iVar3 = (int)*param_3 * *local_10c * 4; *local_118 = iVar3; local_118[8] = iVar3; local_118[0x10] = iVar3; local_118[0x28] = iVar3; local_118[0x30] = iVar3; local_118[0x38] = iVar3; iVar13 = iVar3; } else { iVar3 = ((int)param_3[0x30] * local_10c[0x30] + (int)param_3[0x10] * local_10c[0x10]) * 0x1151 ; iVar6 = iVar3 + (int)param_3[0x30] * local_10c[0x30] * -0x3b21; iVar3 = (int)param_3[0x10] * local_10c[0x10] * 0x187e + iVar3; iVar8 = ((int)param_3[0x20] * local_10c[0x20] + (int)*param_3 * *local_10c) * 0x2000; iVar7 = ((int)*param_3 * *local_10c - (int)param_3[0x20] * local_10c[0x20]) * 0x2000; iVar13 = iVar8 + iVar3; iVar8 = iVar8 - iVar3; iVar3 = iVar7 + iVar6; iVar7 = iVar7 - iVar6; iVar6 = (int)param_3[0x28] * local_10c[0x28]; iVar4 = (int)param_3[0x18] * local_10c[0x18]; iVar11 = (int)param_3[0x38] * local_10c[0x38]; iVar15 = (int)param_3[8] * local_10c[8]; iVar12 = (iVar6 + iVar15 + iVar4 + iVar11) * 0x25a1; iVar5 = (iVar11 + iVar15) * -0x1ccd; iVar9 = (iVar6 + iVar4) * -0x5203; iVar14 = iVar12 + (iVar4 + iVar11) * -0x3ec5; iVar12 = iVar12 + (iVar6 + iVar15) * -0xc7c; iVar4 = iVar4 * 0x6254 + iVar14 + iVar9; iVar14 = iVar11 * 0x98e + iVar5 + iVar14; iVar5 = iVar15 * 0x300b + iVar12 + iVar5; iVar9 = iVar6 * 0x41b3 + iVar12 + iVar9; *local_118 = iVar13 + 0x400 + iVar5 >> 0xb; local_118[0x38] = (iVar13 - iVar5) + 0x400 >> 0xb; local_118[8] = iVar3 + 0x400 + iVar4 >> 0xb; local_118[0x30] = (iVar3 - iVar4) + 0x400 >> 0xb; local_118[0x10] = iVar9 + 0x400 + iVar7 >> 0xb; local_118[0x28] = (iVar7 - iVar9) + 0x400 >> 0xb; iVar3 = (iVar8 - iVar14) + 0x400 >> 0xb; iVar13 = iVar8 + 0x400 + iVar14 >> 0xb; } local_118[0x18] = iVar13; local_10c = local_10c + 1; local_118[0x20] = iVar3; param_3 = param_3 + 1; local_118 = local_118 + 1; local_114 = local_114 + -1; } while (0 < local_114); local_10c = local_108; local_114 = 0; do { puVar10 = (undefined1 *)(*(int *)(param_4 + local_114 * 4) + param_5); iVar13 = local_10c[1]; if ((((iVar13 == 0) && (local_10c[2] == 0)) && ((local_10c[3] == 0 && (((local_10c[4] == 0 && (local_10c[5] == 0)) && (local_10c[6] == 0))) ))) && (local_10c[7] == 0)) { uVar1 = *(undefined1 *)((*local_10c + 0x10 >> 5 & 0x3ffU) + iVar2); *puVar10 = uVar1; puVar10[1] = uVar1; puVar10[2] = uVar1; puVar10[3] = uVar1; puVar10[5] = uVar1; puVar10[6] = uVar1; puVar10[7] = uVar1; } else { iVar6 = (local_10c[6] + local_10c[2]) * 0x1151; iVar14 = iVar6 + local_10c[6] * -0x3b21; iVar6 = local_10c[2] * 0x187e + iVar6; iVar11 = (*local_10c + local_10c[4]) * 0x2000; iVar7 = (*local_10c - local_10c[4]) * 0x2000; iVar3 = iVar11 + iVar6; iVar11 = iVar11 - iVar6; iVar6 = iVar7 + iVar14; iVar7 = iVar7 - iVar14; iVar9 = local_10c[7]; iVar14 = local_10c[5] + iVar13; iVar4 = (iVar14 + local_10c[3] + iVar9) * 0x25a1; iVar8 = (iVar9 + iVar13) * -0x1ccd; iVar12 = (local_10c[3] + local_10c[5]) * -0x5203; iVar5 = iVar4 + (local_10c[3] + iVar9) * -0x3ec5; iVar4 = iVar4 + iVar14 * -0xc7c; iVar15 = local_10c[5] * 0x41b3 + iVar4 + iVar12; iVar14 = iVar9 * 0x98e + iVar8 + iVar5; iVar12 = local_10c[3] * 0x6254 + iVar5 + iVar12; iVar8 = iVar13 * 0x300b + iVar4 + iVar8; *puVar10 = *(undefined1 *)((iVar3 + 0x20000 + iVar8 >> 0x12 & 0x3ffU) + iVar2); puVar10[7] = *(undefined1 *)(((iVar3 - iVar8) + 0x20000 >> 0x12 & 0x3ffU) + iVar2); puVar10[1] = *(undefined1 *)((iVar6 + 0x20000 + iVar12 >> 0x12 & 0x3ffU) + iVar2); puVar10[6] = *(undefined1 *)(((iVar6 - iVar12) + 0x20000 >> 0x12 & 0x3ffU) + iVar2); puVar10[2] = *(undefined1 *)((iVar7 + 0x20000 + iVar15 >> 0x12 & 0x3ffU) + iVar2); puVar10[5] = *(undefined1 *)(((iVar7 - iVar15) + 0x20000 >> 0x12 & 0x3ffU) + iVar2); puVar10[3] = *(undefined1 *)((iVar14 + 0x20000 + iVar11 >> 0x12 & 0x3ffU) + iVar2); uVar1 = *(undefined1 *)(((iVar11 - iVar14) + 0x20000 >> 0x12 & 0x3ffU) + iVar2); } puVar10[4] = uVar1; local_10c = local_10c + 8; local_114 = local_114 + 1; } while (local_114 < 8); return; } //@@ 00ad4dc0 jpeg_idct_7x7 /* DB: libjpeg jidctint.c: (cinfo, compptr, short* coef_block, output_buf, output_col), constants 0x28c6=FIX_1_274162392 0x1c37=FIX_0_881747734 0x13a3=FIX_0_613604268 0xa12=FIX_0_314692123 0x2c1f=FIX_1_378756276 0x1def=FIX_0_935414347 0x573=FIX_0_170262339 0x2d41=FIX_1_414213562, quant table at compptr+0x54 */ void jpeg_idct_7x7(int param_1,int param_2,short *param_3,int *param_4,int param_5) { int *piVar1; int iVar2; int iVar3; int iVar4; int iVar5; undefined1 *puVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int iVar23; int iVar24; int iVar25; int iVar26; int iVar27; int iVar28; int iVar29; int iVar30; int iVar31; int iVar32; int iVar33; int iVar34; int iVar35; int iVar36; int iVar37; int iVar38; int iVar39; int iVar40; int iVar41; int iVar42; int iVar43; int iVar44; int iVar45; int iVar46; int iVar47; int iVar48; int iVar49; int iVar50; int iVar51; int iVar52; int iVar53; int iVar54; int iVar55; int iVar56; int iVar57; int iVar58; int iVar59; int iVar60; int iVar61; int iVar62; int iVar63; iVar2 = *(int *)(param_1 + 0x124) + 0x80; piVar1 = *(int **)(param_2 + 0x54); iVar51 = (int)param_3[0x20] * piVar1[0x20]; iVar7 = (int)param_3[0x30] * piVar1[0x30]; iVar40 = (int)param_3[0x10] * piVar1[0x10]; iVar20 = (int)*param_3 * *piVar1 * 0x2000 + 0x400; iVar3 = (iVar51 - iVar7) * 0x1c37; iVar4 = (iVar40 - iVar51) * 0xa12; iVar5 = iVar4 + iVar51 * -0x3aeb + iVar3 + iVar20; iVar21 = (iVar7 + iVar40) * 0x28c6 + iVar20; iVar3 = iVar3 + iVar21 + iVar7 * -0x27d; iVar4 = iVar4 + iVar21 + iVar40 * -0x4f0f; iVar8 = (int)param_3[0x18] * piVar1[0x18]; iVar52 = (int)param_3[8] * piVar1[8]; iVar41 = (int)param_3[0x28] * piVar1[0x28]; iVar30 = (iVar8 + iVar52) * 0x1def; iVar31 = (iVar41 + iVar8) * -0x2c1f; iVar9 = (iVar41 + iVar52) * 0x13a3; iVar21 = iVar30 + (iVar52 - iVar8) * 0x573 + iVar31; iVar22 = iVar30 + (iVar52 - iVar8) * -0x573 + iVar9; iVar31 = iVar31 + iVar41 * 0x3bde + iVar9; iVar53 = (int)param_3[0x21] * piVar1[0x21]; iVar42 = (int)param_3[0x11] * piVar1[0x11]; iVar9 = (int)param_3[0x31] * piVar1[0x31]; iVar41 = (int)param_3[1] * piVar1[1] * 0x2000 + 0x400; iVar30 = (iVar53 - iVar9) * 0x1c37; iVar8 = (iVar42 - iVar53) * 0xa12; iVar52 = iVar8 + iVar53 * -0x3aeb + iVar30 + iVar41; iVar23 = (iVar9 + iVar42) * 0x28c6 + iVar41; iVar30 = iVar30 + iVar23 + iVar9 * -0x27d; iVar8 = iVar8 + iVar23 + iVar42 * -0x4f0f; iVar54 = (int)param_3[9] * piVar1[9]; iVar23 = (int)param_3[0x19] * piVar1[0x19]; iVar43 = (int)param_3[0x29] * piVar1[0x29]; iVar32 = (iVar23 + iVar54) * 0x1def; iVar41 = iVar41 + (iVar53 - (iVar9 + iVar42)) * 0x2d41 >> 0xb; iVar53 = (iVar43 + iVar23) * -0x2c1f; iVar42 = (iVar43 + iVar54) * 0x13a3; iVar9 = iVar32 + (iVar54 - iVar23) * 0x573 + iVar53; iVar23 = iVar32 + (iVar54 - iVar23) * -0x573 + iVar42; iVar53 = iVar53 + iVar43 * 0x3bde + iVar42; iVar32 = iVar23 + iVar30 >> 0xb; iVar10 = iVar30 - iVar23 >> 0xb; iVar11 = iVar9 + iVar52 >> 0xb; iVar24 = iVar52 - iVar9 >> 0xb; iVar43 = iVar53 + iVar8 >> 0xb; iVar55 = (int)param_3[0x22] * piVar1[0x22]; iVar54 = (int)param_3[0x12] * piVar1[0x12]; iVar12 = iVar8 - iVar53 >> 0xb; iVar9 = (int)param_3[0x32] * piVar1[0x32]; iVar52 = (int)param_3[2] * piVar1[2] * 0x2000 + 0x400; iVar30 = (iVar55 - iVar9) * 0x1c37; iVar8 = (iVar54 - iVar55) * 0xa12; iVar23 = iVar8 + iVar55 * -0x3aeb + iVar30 + iVar52; iVar42 = (iVar9 + iVar54) * 0x28c6 + iVar52; iVar30 = iVar30 + iVar42 + iVar9 * -0x27d; iVar8 = iVar8 + iVar42 + iVar54 * -0x4f0f; iVar56 = (int)param_3[10] * piVar1[10]; iVar42 = (int)param_3[0x1a] * piVar1[0x1a]; iVar44 = (int)param_3[0x2a] * piVar1[0x2a]; iVar52 = iVar52 + (iVar55 - (iVar9 + iVar54)) * 0x2d41 >> 0xb; iVar54 = (iVar42 + iVar56) * 0x1def; iVar55 = (iVar44 + iVar42) * -0x2c1f; iVar53 = (iVar44 + iVar56) * 0x13a3; iVar9 = iVar54 + (iVar56 - iVar42) * 0x573 + iVar55; iVar42 = iVar54 + (iVar56 - iVar42) * -0x573 + iVar53; iVar55 = iVar55 + iVar44 * 0x3bde + iVar53; iVar53 = iVar42 + iVar30 >> 0xb; iVar13 = iVar30 - iVar42 >> 0xb; iVar14 = iVar9 + iVar23 >> 0xb; iVar25 = iVar23 - iVar9 >> 0xb; iVar54 = iVar55 + iVar8 >> 0xb; iVar56 = (int)param_3[0x23] * piVar1[0x23]; iVar44 = (int)param_3[0x13] * piVar1[0x13]; iVar15 = iVar8 - iVar55 >> 0xb; iVar9 = (int)param_3[0x33] * piVar1[0x33]; iVar23 = (int)param_3[3] * piVar1[3] * 0x2000 + 0x400; iVar30 = (iVar56 - iVar9) * 0x1c37; iVar8 = (iVar44 - iVar56) * 0xa12; iVar42 = iVar8 + iVar56 * -0x3aeb + iVar30 + iVar23; iVar55 = (iVar9 + iVar44) * 0x28c6 + iVar23; iVar30 = iVar30 + iVar55 + iVar9 * -0x27d; iVar8 = iVar8 + iVar55 + iVar44 * -0x4f0f; iVar23 = iVar23 + (iVar56 - (iVar9 + iVar44)) * 0x2d41 >> 0xb; iVar55 = (int)param_3[0x1b] * piVar1[0x1b]; iVar57 = (int)param_3[0xb] * piVar1[0xb]; iVar45 = (int)param_3[0x2b] * piVar1[0x2b]; iVar56 = (iVar55 + iVar57) * 0x1def; iVar33 = (iVar45 + iVar55) * -0x2c1f; iVar44 = (iVar45 + iVar57) * 0x13a3; iVar9 = iVar56 + (iVar57 - iVar55) * 0x573 + iVar33; iVar56 = iVar56 + (iVar57 - iVar55) * -0x573 + iVar44; iVar33 = iVar33 + iVar45 * 0x3bde + iVar44; iVar55 = iVar56 + iVar30 >> 0xb; iVar16 = iVar30 - iVar56 >> 0xb; iVar17 = iVar9 + iVar42 >> 0xb; iVar26 = iVar42 - iVar9 >> 0xb; iVar44 = iVar33 + iVar8 >> 0xb; iVar18 = iVar8 - iVar33 >> 0xb; iVar58 = (int)param_3[0x24] * piVar1[0x24]; iVar42 = (int)param_3[0x34] * piVar1[0x34]; iVar46 = (int)param_3[0x14] * piVar1[0x14]; iVar8 = (iVar58 - iVar42) * 0x1c37; iVar34 = (int)param_3[4] * piVar1[4] * 0x2000 + 0x400; iVar9 = (iVar46 - iVar58) * 0xa12; iVar45 = iVar9 + iVar58 * -0x3aeb + iVar8 + iVar34; iVar30 = (iVar42 + iVar46) * 0x28c6 + iVar34; iVar8 = iVar8 + iVar30 + iVar42 * -0x27d; iVar9 = iVar9 + iVar30 + iVar46 * -0x4f0f; iVar56 = (int)param_3[0x1c] * piVar1[0x1c]; iVar59 = (int)param_3[0xc] * piVar1[0xc]; iVar47 = (int)param_3[0x2c] * piVar1[0x2c]; iVar57 = (iVar56 + iVar59) * 0x1def; iVar35 = (iVar47 + iVar56) * -0x2c1f; iVar33 = (iVar47 + iVar59) * 0x13a3; iVar30 = iVar57 + (iVar59 - iVar56) * 0x573 + iVar35; iVar57 = iVar57 + (iVar59 - iVar56) * -0x573 + iVar33; iVar35 = iVar35 + iVar47 * 0x3bde + iVar33; iVar56 = iVar57 + iVar8 >> 0xb; iVar47 = iVar8 - iVar57 >> 0xb; iVar59 = iVar30 + iVar45 >> 0xb; iVar27 = iVar45 - iVar30 >> 0xb; iVar33 = iVar35 + iVar9 >> 0xb; iVar45 = iVar34 + (iVar58 - (iVar42 + iVar46)) * 0x2d41 >> 0xb; iVar46 = iVar9 - iVar35 >> 0xb; iVar58 = (int)param_3[0x25] * piVar1[0x25]; iVar30 = (int)param_3[0x35] * piVar1[0x35]; iVar34 = (int)param_3[0x15] * piVar1[0x15]; iVar57 = (int)param_3[5] * piVar1[5] * 0x2000 + 0x400; iVar8 = (iVar58 - iVar30) * 0x1c37; iVar9 = (iVar34 - iVar58) * 0xa12; iVar35 = iVar9 + iVar58 * -0x3aeb + iVar8 + iVar57; iVar42 = (iVar30 + iVar34) * 0x28c6 + iVar57; iVar8 = iVar8 + iVar42 + iVar30 * -0x27d; iVar9 = iVar9 + iVar42 + iVar34 * -0x4f0f; iVar42 = iVar57 + (iVar58 - (iVar30 + iVar34)) * 0x2d41 >> 0xb; iVar57 = (int)param_3[0x1d] * piVar1[0x1d]; iVar60 = (int)param_3[0xd] * piVar1[0xd]; iVar48 = (int)param_3[0x2d] * piVar1[0x2d]; iVar58 = (iVar57 + iVar60) * 0x1def; iVar36 = (iVar48 + iVar57) * -0x2c1f; iVar34 = (iVar48 + iVar60) * 0x13a3; iVar30 = iVar58 + (iVar60 - iVar57) * 0x573 + iVar36; iVar58 = iVar58 + (iVar60 - iVar57) * -0x573 + iVar34; iVar36 = iVar36 + iVar48 * 0x3bde + iVar34; iVar57 = iVar58 + iVar8 >> 0xb; iVar58 = iVar8 - iVar58 >> 0xb; iVar48 = iVar30 + iVar35 >> 0xb; iVar28 = iVar35 - iVar30 >> 0xb; iVar34 = iVar36 + iVar9 >> 0xb; iVar36 = iVar9 - iVar36 >> 0xb; iVar37 = (int)param_3[6] * piVar1[6] * 0x2000 + 0x400; iVar49 = (int)param_3[0x16] * piVar1[0x16]; iVar60 = (int)param_3[0x36] * piVar1[0x36]; iVar61 = (int)param_3[0x26] * piVar1[0x26]; iVar8 = (iVar61 - iVar60) * 0x1c37; iVar9 = (iVar49 - iVar61) * 0xa12; iVar29 = iVar9 + iVar61 * -0x3aeb + iVar8 + iVar37; iVar30 = (iVar60 + iVar49) * 0x28c6 + iVar37; iVar8 = iVar8 + iVar30 + iVar60 * -0x27d; iVar9 = iVar9 + iVar30 + iVar49 * -0x4f0f; iVar35 = (int)param_3[0x1e] * piVar1[0x1e]; iVar62 = (int)param_3[0xe] * piVar1[0xe]; iVar50 = (int)param_3[0x2e] * piVar1[0x2e]; iVar38 = (iVar35 + iVar62) * 0x1def; iVar39 = (iVar50 + iVar35) * -0x2c1f; iVar19 = (iVar50 + iVar62) * 0x13a3; iVar30 = iVar38 + (iVar62 - iVar35) * 0x573 + iVar39; iVar38 = iVar38 + (iVar62 - iVar35) * -0x573 + iVar19; iVar39 = iVar39 + iVar50 * 0x3bde + iVar19; iVar35 = iVar8 - iVar38 >> 0xb; iVar19 = iVar38 + iVar8 >> 0xb; iVar38 = iVar30 + iVar29 >> 0xb; iVar50 = iVar29 - iVar30 >> 0xb; iVar30 = iVar39 + iVar9 >> 0xb; iVar29 = iVar9 - iVar39 >> 0xb; iVar8 = iVar37 + (iVar61 - (iVar60 + iVar49)) * 0x2d41 >> 0xb; puVar6 = (undefined1 *)(*param_4 + param_5); iVar37 = (iVar56 - iVar19) * 0x1c37; iVar62 = ((iVar22 + iVar3 >> 0xb) + 0x10) * 0x2000; iVar39 = (iVar53 - iVar56) * 0xa12; iVar60 = iVar39 + iVar56 * -0x3aeb + iVar37 + iVar62; iVar9 = (iVar53 + iVar19) * 0x28c6 + iVar62; iVar37 = iVar37 + iVar9 + iVar19 * -0x27d; iVar39 = iVar39 + iVar9 + iVar53 * -0x4f0f; iVar49 = (iVar55 + iVar32) * 0x1def; iVar63 = (iVar57 + iVar55) * -0x2c1f; iVar9 = (iVar32 + iVar57) * 0x13a3; iVar61 = iVar49 + (iVar32 - iVar55) * 0x573 + iVar63; iVar32 = iVar49 + (iVar32 - iVar55) * -0x573 + iVar9; iVar63 = iVar63 + iVar57 * 0x3bde + iVar9; *puVar6 = *(undefined1 *)((iVar32 + iVar37 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar37 - iVar32 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar61 + iVar60 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar60 - iVar61 >> 0x12 & 0x3ffU) + iVar2); iVar60 = ((iVar21 + iVar5 >> 0xb) + 0x10) * 0x2000; puVar6[2] = *(undefined1 *)((iVar63 + iVar39 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar39 - iVar63 >> 0x12 & 0x3ffU) + iVar2); puVar6[3] = *(undefined1 *) ((iVar62 + (iVar56 - (iVar53 + iVar19)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); puVar6 = (undefined1 *)(param_4[1] + param_5); iVar55 = (iVar59 - iVar38) * 0x1c37; iVar56 = (iVar14 - iVar59) * 0xa12; iVar9 = iVar56 + iVar59 * -0x3aeb + iVar55 + iVar60; iVar32 = (iVar14 + iVar38) * 0x28c6 + iVar60; iVar55 = iVar55 + iVar32 + iVar38 * -0x27d; iVar56 = iVar56 + iVar32 + iVar14 * -0x4f0f; iVar53 = (iVar17 + iVar11) * 0x1def; iVar19 = (iVar48 + iVar17) * -0x2c1f; iVar32 = (iVar11 + iVar48) * 0x13a3; iVar57 = iVar53 + (iVar11 - iVar17) * 0x573 + iVar19; iVar53 = iVar53 + (iVar11 - iVar17) * -0x573 + iVar32; iVar19 = iVar19 + iVar48 * 0x3bde + iVar32; *puVar6 = *(undefined1 *)((iVar53 + iVar55 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar55 - iVar53 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar57 + iVar9 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar9 - iVar57 >> 0x12 & 0x3ffU) + iVar2); iVar11 = ((iVar31 + iVar4 >> 0xb) + 0x10) * 0x2000; puVar6[2] = *(undefined1 *)((iVar19 + iVar56 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar56 - iVar19 >> 0x12 & 0x3ffU) + iVar2); puVar6[3] = *(undefined1 *) ((iVar60 + (iVar59 - (iVar14 + iVar38)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); puVar6 = (undefined1 *)(param_4[2] + param_5); iVar53 = (iVar33 - iVar30) * 0x1c37; iVar55 = (iVar54 - iVar33) * 0xa12; iVar9 = iVar55 + iVar33 * -0x3aeb + iVar53 + iVar11; iVar32 = (iVar54 + iVar30) * 0x28c6 + iVar11; iVar53 = iVar53 + iVar32 + iVar30 * -0x27d; iVar55 = iVar55 + iVar32 + iVar54 * -0x4f0f; iVar56 = (iVar44 + iVar43) * 0x1def; iVar14 = (iVar34 + iVar44) * -0x2c1f; iVar32 = (iVar43 + iVar34) * 0x13a3; iVar57 = iVar56 + (iVar43 - iVar44) * 0x573 + iVar14; iVar43 = iVar56 + (iVar43 - iVar44) * -0x573 + iVar32; iVar14 = iVar14 + iVar34 * 0x3bde + iVar32; *puVar6 = *(undefined1 *)((iVar43 + iVar53 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar53 - iVar43 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar57 + iVar9 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar9 - iVar57 >> 0x12 & 0x3ffU) + iVar2); puVar6[2] = *(undefined1 *)((iVar14 + iVar55 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar55 - iVar14 >> 0x12 & 0x3ffU) + iVar2); iVar55 = ((iVar20 + (iVar51 - (iVar7 + iVar40)) * 0x2d41 >> 0xb) + 0x10) * 0x2000; puVar6[3] = *(undefined1 *) ((iVar11 + (iVar33 - (iVar54 + iVar30)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); puVar6 = (undefined1 *)(param_4[3] + param_5); iVar32 = (iVar45 - iVar8) * 0x1c37; iVar43 = (iVar52 - iVar45) * 0xa12; iVar9 = iVar43 + iVar45 * -0x3aeb + iVar32 + iVar55; iVar30 = (iVar52 + iVar8) * 0x28c6 + iVar55; iVar32 = iVar32 + iVar30 + iVar8 * -0x27d; iVar43 = iVar43 + iVar30 + iVar52 * -0x4f0f; iVar53 = (iVar23 + iVar41) * 0x1def; iVar44 = (iVar42 + iVar23) * -0x2c1f; iVar30 = (iVar41 + iVar42) * 0x13a3; iVar54 = iVar53 + (iVar41 - iVar23) * 0x573 + iVar44; iVar41 = iVar53 + (iVar41 - iVar23) * -0x573 + iVar30; iVar44 = iVar44 + iVar42 * 0x3bde + iVar30; *puVar6 = *(undefined1 *)((iVar41 + iVar32 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar32 - iVar41 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar54 + iVar9 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar9 - iVar54 >> 0x12 & 0x3ffU) + iVar2); puVar6[2] = *(undefined1 *)((iVar44 + iVar43 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar43 - iVar44 >> 0x12 & 0x3ffU) + iVar2); iVar23 = ((iVar4 - iVar31 >> 0xb) + 0x10) * 0x2000; puVar6[3] = *(undefined1 *) ((iVar55 + (iVar45 - (iVar52 + iVar8)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); puVar6 = (undefined1 *)(param_4[4] + param_5); iVar30 = (iVar46 - iVar29) * 0x1c37; iVar41 = (iVar15 - iVar46) * 0xa12; iVar4 = iVar41 + iVar46 * -0x3aeb + iVar30 + iVar23; iVar8 = (iVar15 + iVar29) * 0x28c6 + iVar23; iVar30 = iVar30 + iVar8 + iVar29 * -0x27d; iVar41 = iVar41 + iVar8 + iVar15 * -0x4f0f; iVar9 = (iVar18 + iVar12) * 0x1def; iVar42 = (iVar36 + iVar18) * -0x2c1f; iVar8 = (iVar12 + iVar36) * 0x13a3; iVar52 = iVar9 + (iVar12 - iVar18) * 0x573 + iVar42; iVar9 = iVar9 + (iVar12 - iVar18) * -0x573 + iVar8; iVar42 = iVar42 + iVar36 * 0x3bde + iVar8; *puVar6 = *(undefined1 *)((iVar9 + iVar30 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar30 - iVar9 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar52 + iVar4 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar4 - iVar52 >> 0x12 & 0x3ffU) + iVar2); puVar6[2] = *(undefined1 *)((iVar42 + iVar41 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar41 - iVar42 >> 0x12 & 0x3ffU) + iVar2); puVar6[3] = *(undefined1 *) ((iVar23 + (iVar46 - (iVar15 + iVar29)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); iVar52 = ((iVar5 - iVar21 >> 0xb) + 0x10) * 0x2000; puVar6 = (undefined1 *)(param_4[5] + param_5); iVar9 = (iVar27 - iVar50) * 0x1c37; iVar30 = (iVar25 - iVar27) * 0xa12; iVar4 = iVar30 + iVar27 * -0x3aeb + iVar9 + iVar52; iVar21 = (iVar25 + iVar50) * 0x28c6 + iVar52; iVar9 = iVar9 + iVar21 + iVar50 * -0x27d; iVar30 = iVar30 + iVar21 + iVar25 * -0x4f0f; iVar8 = (iVar26 + iVar24) * 0x1def; iVar23 = (iVar28 + iVar26) * -0x2c1f; iVar21 = (iVar24 + iVar28) * 0x13a3; iVar41 = iVar8 + (iVar24 - iVar26) * 0x573 + iVar23; iVar8 = iVar8 + (iVar24 - iVar26) * -0x573 + iVar21; iVar23 = iVar23 + iVar28 * 0x3bde + iVar21; *puVar6 = *(undefined1 *)((iVar8 + iVar9 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar9 - iVar8 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar41 + iVar4 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar4 - iVar41 >> 0x12 & 0x3ffU) + iVar2); puVar6[2] = *(undefined1 *)((iVar23 + iVar30 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar30 - iVar23 >> 0x12 & 0x3ffU) + iVar2); iVar23 = ((iVar3 - iVar22 >> 0xb) + 0x10) * 0x2000; puVar6[3] = *(undefined1 *) ((iVar52 + (iVar27 - (iVar25 + iVar50)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); puVar6 = (undefined1 *)(param_4[6] + param_5); iVar9 = (iVar47 - iVar35) * 0x1c37; iVar30 = (iVar13 - iVar47) * 0xa12; iVar4 = iVar30 + iVar47 * -0x3aeb + iVar9 + iVar23; iVar21 = (iVar13 + iVar35) * 0x28c6 + iVar23; iVar9 = iVar9 + iVar21 + iVar35 * -0x27d; iVar30 = iVar30 + iVar21 + iVar13 * -0x4f0f; iVar8 = (iVar16 + iVar10) * 0x1def; iVar52 = (iVar58 + iVar16) * -0x2c1f; iVar21 = (iVar10 + iVar58) * 0x13a3; iVar41 = iVar8 + (iVar10 - iVar16) * 0x573 + iVar52; iVar8 = iVar8 + (iVar10 - iVar16) * -0x573 + iVar21; iVar52 = iVar52 + iVar58 * 0x3bde + iVar21; *puVar6 = *(undefined1 *)((iVar8 + iVar9 >> 0x12 & 0x3ffU) + iVar2); puVar6[6] = *(undefined1 *)((iVar9 - iVar8 >> 0x12 & 0x3ffU) + iVar2); puVar6[1] = *(undefined1 *)((iVar41 + iVar4 >> 0x12 & 0x3ffU) + iVar2); puVar6[5] = *(undefined1 *)((iVar4 - iVar41 >> 0x12 & 0x3ffU) + iVar2); puVar6[2] = *(undefined1 *)((iVar52 + iVar30 >> 0x12 & 0x3ffU) + iVar2); puVar6[4] = *(undefined1 *)((iVar30 - iVar52 >> 0x12 & 0x3ffU) + iVar2); puVar6[3] = *(undefined1 *) ((iVar23 + (iVar47 - (iVar13 + iVar35)) * 0x2d41 >> 0x12 & 0x3ffU) + iVar2); return; } //@@ 00ad60a0 jpeg_idct_6x6 /* DB: libjpeg: case 6 of the start_pass 00acae00 jddctmgr_start_pass switch, between 5x5 and 7x7 (was theora_oc_state_frag_recon) */ void jpeg_idct_6x6(int param_1,int param_2,short *param_3,int *param_4,int param_5) { int *piVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; undefined1 *puVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int iVar23; int iVar24; int iVar25; int iVar26; int iVar27; int iVar28; int iVar29; int iVar30; int iVar31; int iVar32; int iVar33; int iVar34; int iVar35; int iVar36; int iVar37; int iVar38; int iVar39; int iVar40; int iVar41; int iVar42; int iVar43; iVar2 = *(int *)(param_1 + 0x124) + 0x80; piVar1 = *(int **)(param_2 + 0x54); iVar22 = (int)*param_3 * *piVar1 * 0x2000 + 0x400; iVar10 = (int)param_3[0x20] * piVar1[0x20] * 0x16a1 + iVar22; iVar23 = iVar22 + (int)param_3[0x20] * piVar1[0x20] * -0x2d42 >> 0xb; iVar24 = (int)param_3[8] * piVar1[8]; iVar22 = iVar10 + (int)param_3[0x10] * piVar1[0x10] * 0x2731; iVar10 = iVar10 + (int)param_3[0x10] * piVar1[0x10] * -0x2731; iVar11 = (int)param_3[0x28] * piVar1[0x28]; iVar34 = (int)param_3[0x18] * piVar1[0x18]; iVar3 = (iVar11 + iVar24) * 0xbb6; iVar25 = (iVar24 - iVar11) - iVar34; iVar21 = (iVar34 + iVar24) * 0x2000 + iVar3; iVar3 = (iVar11 - iVar34) * 0x2000 + iVar3; iVar24 = (int)param_3[1] * piVar1[1] * 0x2000 + 0x400; iVar11 = (int)param_3[0x21] * piVar1[0x21] * 0x16a1 + iVar24; iVar26 = iVar24 + (int)param_3[0x21] * piVar1[0x21] * -0x2d42 >> 0xb; iVar27 = (int)param_3[9] * piVar1[9]; iVar24 = iVar11 + (int)param_3[0x11] * piVar1[0x11] * 0x2731; iVar11 = iVar11 + (int)param_3[0x11] * piVar1[0x11] * -0x2731; iVar12 = (int)param_3[0x29] * piVar1[0x29]; iVar35 = (int)param_3[0x19] * piVar1[0x19]; iVar34 = (iVar12 + iVar27) * 0xbb6; iVar28 = (iVar27 - iVar12) - iVar35; iVar27 = (iVar35 + iVar27) * 0x2000 + iVar34; iVar34 = (iVar12 - iVar35) * 0x2000 + iVar34; iVar13 = iVar24 - iVar27 >> 0xb; iVar4 = iVar24 + iVar27 >> 0xb; iVar24 = iVar26 + iVar28 * 4; iVar26 = iVar26 + iVar28 * -4; iVar5 = iVar11 + iVar34 >> 0xb; iVar14 = iVar11 - iVar34 >> 0xb; iVar34 = (int)param_3[2] * piVar1[2] * 0x2000 + 0x400; iVar11 = (int)param_3[0x22] * piVar1[0x22] * 0x16a1 + iVar34; iVar29 = iVar34 + (int)param_3[0x22] * piVar1[0x22] * -0x2d42 >> 0xb; iVar34 = iVar11 + (int)param_3[0x12] * piVar1[0x12] * 0x2731; iVar11 = iVar11 + (int)param_3[0x12] * piVar1[0x12] * -0x2731; iVar35 = (int)param_3[10] * piVar1[10]; iVar27 = (int)param_3[0x2a] * piVar1[0x2a]; iVar36 = (int)param_3[0x1a] * piVar1[0x1a]; iVar12 = (iVar27 + iVar35) * 0xbb6; iVar28 = (iVar36 + iVar35) * 0x2000 + iVar12; iVar35 = (iVar35 - iVar27) - iVar36; iVar12 = (iVar27 - iVar36) * 0x2000 + iVar12; iVar15 = iVar34 - iVar28 >> 0xb; iVar36 = iVar34 + iVar28 >> 0xb; iVar34 = iVar29 + iVar35 * 4; iVar29 = iVar29 + iVar35 * -4; iVar6 = iVar11 + iVar12 >> 0xb; iVar16 = iVar11 - iVar12 >> 0xb; iVar12 = (int)param_3[3] * piVar1[3] * 0x2000 + 0x400; iVar11 = (int)param_3[0x23] * piVar1[0x23] * 0x16a1 + iVar12; iVar37 = iVar12 + (int)param_3[0x23] * piVar1[0x23] * -0x2d42 >> 0xb; iVar12 = iVar11 + (int)param_3[0x13] * piVar1[0x13] * 0x2731; iVar11 = iVar11 + (int)param_3[0x13] * piVar1[0x13] * -0x2731; iVar35 = (int)param_3[0xb] * piVar1[0xb]; iVar28 = (int)param_3[0x2b] * piVar1[0x2b]; iVar38 = (int)param_3[0x1b] * piVar1[0x1b]; iVar27 = (iVar28 + iVar35) * 0xbb6; iVar30 = (iVar35 - iVar28) - iVar38; iVar35 = (iVar38 + iVar35) * 0x2000 + iVar27; iVar27 = (iVar28 - iVar38) * 0x2000 + iVar27; iVar17 = iVar12 - iVar35 >> 0xb; iVar7 = iVar12 + iVar35 >> 0xb; iVar12 = iVar37 + iVar30 * 4; iVar37 = iVar37 + iVar30 * -4; iVar8 = iVar11 + iVar27 >> 0xb; iVar18 = iVar11 - iVar27 >> 0xb; iVar27 = (int)param_3[4] * piVar1[4] * 0x2000 + 0x400; iVar11 = (int)param_3[0x24] * piVar1[0x24] * 0x16a1 + iVar27; iVar31 = iVar27 + (int)param_3[0x24] * piVar1[0x24] * -0x2d42 >> 0xb; iVar30 = (int)param_3[0xc] * piVar1[0xc]; iVar27 = iVar11 + (int)param_3[0x14] * piVar1[0x14] * 0x2731; iVar11 = iVar11 + (int)param_3[0x14] * piVar1[0x14] * -0x2731; iVar35 = (int)param_3[0x2c] * piVar1[0x2c]; iVar39 = (int)param_3[0x1c] * piVar1[0x1c]; iVar28 = (iVar35 + iVar30) * 0xbb6; iVar38 = (iVar30 - iVar35) - iVar39; iVar30 = (iVar39 + iVar30) * 0x2000 + iVar28; iVar28 = (iVar35 - iVar39) * 0x2000 + iVar28; iVar19 = iVar27 - iVar30 >> 0xb; iVar30 = iVar27 + iVar30 >> 0xb; iVar27 = iVar31 + iVar38 * 4; iVar31 = iVar31 + iVar38 * -4; iVar38 = iVar11 + iVar28 >> 0xb; iVar20 = iVar11 - iVar28 >> 0xb; iVar28 = (int)param_3[5] * piVar1[5] * 0x2000 + 0x400; iVar11 = (int)param_3[0x25] * piVar1[0x25] * 0x16a1 + iVar28; iVar40 = iVar28 + (int)param_3[0x25] * piVar1[0x25] * -0x2d42 >> 0xb; iVar28 = iVar11 + (int)param_3[0x15] * piVar1[0x15] * 0x2731; iVar11 = iVar11 + (int)param_3[0x15] * piVar1[0x15] * -0x2731; iVar32 = (int)param_3[0xd] * piVar1[0xd]; iVar35 = (int)param_3[0x2d] * piVar1[0x2d]; iVar41 = (int)param_3[0x1d] * piVar1[0x1d]; iVar39 = (iVar35 + iVar32) * 0xbb6; iVar33 = (iVar32 - iVar35) - iVar41; iVar42 = (iVar35 - iVar41) * 0x2000 + iVar39; iVar39 = (iVar41 + iVar32) * 0x2000 + iVar39; iVar32 = iVar28 - iVar39 >> 0xb; iVar35 = iVar40 + iVar33 * 4; iVar40 = iVar40 + iVar33 * -4; iVar41 = iVar28 + iVar39 >> 0xb; iVar39 = iVar11 + iVar42 >> 0xb; iVar43 = ((iVar22 + iVar21 >> 0xb) + 0x10) * 0x2000; iVar33 = iVar11 - iVar42 >> 0xb; puVar9 = (undefined1 *)(*param_4 + param_5); iVar11 = iVar30 * 0x16a1 + iVar43; iVar43 = iVar43 + iVar30 * -0x2d42; iVar28 = iVar11 + iVar36 * 0x2731; iVar11 = iVar11 + iVar36 * -0x2731; iVar36 = (iVar41 + iVar4) * 0xbb6; iVar30 = (iVar4 + iVar7) * 0x2000 + iVar36; iVar36 = (iVar41 - iVar7) * 0x2000 + iVar36; iVar7 = (iVar4 - iVar41) - iVar7; *puVar9 = *(undefined1 *)((iVar28 + iVar30 >> 0x12 & 0x3ffU) + iVar2); puVar9[5] = *(undefined1 *)((iVar28 - iVar30 >> 0x12 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)((iVar43 + iVar7 * 0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[4] = *(undefined1 *)((iVar43 + iVar7 * -0x2000 >> 0x12 & 0x3ffU) + iVar2); iVar4 = (iVar23 + iVar25 * 4 + 0x10) * 0x2000; puVar9[2] = *(undefined1 *)((iVar11 + iVar36 >> 0x12 & 0x3ffU) + iVar2); puVar9[3] = *(undefined1 *)((iVar11 - iVar36 >> 0x12 & 0x3ffU) + iVar2); puVar9 = (undefined1 *)(param_4[1] + param_5); iVar11 = iVar27 * 0x16a1 + iVar4; iVar4 = iVar4 + iVar27 * -0x2d42; iVar27 = iVar11 + iVar34 * 0x2731; iVar11 = iVar11 + iVar34 * -0x2731; iVar34 = (iVar35 + iVar24) * 0xbb6; iVar28 = (iVar12 + iVar24) * 0x2000 + iVar34; iVar34 = (iVar35 - iVar12) * 0x2000 + iVar34; iVar12 = (iVar24 - iVar35) - iVar12; *puVar9 = *(undefined1 *)((iVar27 + iVar28 >> 0x12 & 0x3ffU) + iVar2); puVar9[5] = *(undefined1 *)((iVar27 - iVar28 >> 0x12 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)((iVar4 + iVar12 * 0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[4] = *(undefined1 *)((iVar4 + iVar12 * -0x2000 >> 0x12 & 0x3ffU) + iVar2); iVar27 = ((iVar10 + iVar3 >> 0xb) + 0x10) * 0x2000; puVar9[2] = *(undefined1 *)((iVar11 + iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9[3] = *(undefined1 *)((iVar11 - iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9 = (undefined1 *)(param_4[2] + param_5); iVar11 = iVar38 * 0x16a1 + iVar27; iVar27 = iVar27 + iVar38 * -0x2d42; iVar24 = iVar11 + iVar6 * 0x2731; iVar11 = iVar11 + iVar6 * -0x2731; iVar34 = (iVar39 + iVar5) * 0xbb6; iVar12 = (iVar8 + iVar5) * 0x2000 + iVar34; iVar34 = (iVar39 - iVar8) * 0x2000 + iVar34; iVar8 = (iVar5 - iVar39) - iVar8; *puVar9 = *(undefined1 *)((iVar24 + iVar12 >> 0x12 & 0x3ffU) + iVar2); puVar9[5] = *(undefined1 *)((iVar24 - iVar12 >> 0x12 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)((iVar27 + iVar8 * 0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[4] = *(undefined1 *)((iVar27 + iVar8 * -0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[2] = *(undefined1 *)((iVar11 + iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9[3] = *(undefined1 *)((iVar11 - iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9 = (undefined1 *)(param_4[3] + param_5); iVar12 = ((iVar10 - iVar3 >> 0xb) + 0x10) * 0x2000; iVar10 = iVar20 * 0x16a1 + iVar12; iVar12 = iVar12 + iVar20 * -0x2d42; iVar11 = iVar10 + iVar16 * 0x2731; iVar10 = iVar10 + iVar16 * -0x2731; iVar24 = (iVar33 + iVar14) * 0xbb6; iVar34 = (iVar18 + iVar14) * 0x2000 + iVar24; iVar24 = (iVar33 - iVar18) * 0x2000 + iVar24; iVar18 = (iVar14 - iVar33) - iVar18; *puVar9 = *(undefined1 *)((iVar11 + iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9[5] = *(undefined1 *)((iVar11 - iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)((iVar12 + iVar18 * 0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[4] = *(undefined1 *)((iVar12 + iVar18 * -0x2000 >> 0x12 & 0x3ffU) + iVar2); iVar12 = (iVar23 + iVar25 * -4 + 0x10) * 0x2000; puVar9[2] = *(undefined1 *)((iVar10 + iVar24 >> 0x12 & 0x3ffU) + iVar2); puVar9[3] = *(undefined1 *)((iVar10 - iVar24 >> 0x12 & 0x3ffU) + iVar2); puVar9 = (undefined1 *)(param_4[4] + param_5); iVar10 = iVar31 * 0x16a1 + iVar12; iVar12 = iVar12 + iVar31 * -0x2d42; iVar11 = iVar10 + iVar29 * 0x2731; iVar10 = iVar10 + iVar29 * -0x2731; iVar24 = (iVar40 + iVar26) * 0xbb6; iVar34 = (iVar37 + iVar26) * 0x2000 + iVar24; iVar24 = (iVar40 - iVar37) * 0x2000 + iVar24; iVar37 = (iVar26 - iVar40) - iVar37; *puVar9 = *(undefined1 *)((iVar11 + iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9[5] = *(undefined1 *)((iVar11 - iVar34 >> 0x12 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)((iVar12 + iVar37 * 0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[4] = *(undefined1 *)((iVar12 + iVar37 * -0x2000 >> 0x12 & 0x3ffU) + iVar2); iVar34 = ((iVar22 - iVar21 >> 0xb) + 0x10) * 0x2000; puVar9[2] = *(undefined1 *)((iVar10 + iVar24 >> 0x12 & 0x3ffU) + iVar2); puVar9[3] = *(undefined1 *)((iVar10 - iVar24 >> 0x12 & 0x3ffU) + iVar2); puVar9 = (undefined1 *)(param_4[5] + param_5); iVar10 = iVar19 * 0x16a1 + iVar34; iVar34 = iVar34 + iVar19 * -0x2d42; iVar22 = iVar10 + iVar15 * 0x2731; iVar10 = iVar10 + iVar15 * -0x2731; iVar11 = (iVar32 + iVar13) * 0xbb6; iVar24 = (iVar17 + iVar13) * 0x2000 + iVar11; iVar11 = (iVar32 - iVar17) * 0x2000 + iVar11; iVar17 = (iVar13 - iVar32) - iVar17; *puVar9 = *(undefined1 *)((iVar22 + iVar24 >> 0x12 & 0x3ffU) + iVar2); puVar9[5] = *(undefined1 *)((iVar22 - iVar24 >> 0x12 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)((iVar34 + iVar17 * 0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[4] = *(undefined1 *)((iVar34 + iVar17 * -0x2000 >> 0x12 & 0x3ffU) + iVar2); puVar9[2] = *(undefined1 *)((iVar10 + iVar11 >> 0x12 & 0x3ffU) + iVar2); puVar9[3] = *(undefined1 *)((iVar10 - iVar11 >> 0x12 & 0x3ffU) + iVar2); return; } //@@ 00ad6ad0 jpeg_idct_5x5 /* DB: libjpeg: case 5 of the DCT_scaled_size switch in start_pass 00acae00 jddctmgr_start_pass jpeg_idct_islow) */ void jpeg_idct_5x5(int param_1,int param_2,short *param_3,int *param_4,int param_5) { int iVar1; int *piVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; undefined1 *puVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int iVar23; int iVar24; int iVar25; int iVar26; int iVar27; int iVar28; int iVar29; int iVar30; int iVar31; int iVar32; int iVar33; iVar3 = *(int *)(param_1 + 0x124) + 0x80; piVar2 = *(int **)(param_2 + 0x54); iVar4 = (int)*param_3 * *piVar2 * 0x2000 + 0x400; iVar11 = (int)param_3[0x20] * piVar2[0x20] + (int)param_3[0x10] * piVar2[0x10]; iVar15 = (int)param_3[0x10] * piVar2[0x10] - (int)param_3[0x20] * piVar2[0x20]; iVar16 = iVar15 * 0xb50 + iVar4; iVar1 = iVar16 + iVar11 * 0x194c; iVar16 = iVar16 + iVar11 * -0x194c; iVar29 = ((int)param_3[0x18] * piVar2[0x18] + (int)param_3[8] * piVar2[8]) * 0x1a9a; iVar10 = (int)param_3[8] * piVar2[8] * 0x1071 + iVar29; iVar29 = iVar29 + (int)param_3[0x18] * piVar2[0x18] * -0x45a4; iVar5 = (int)param_3[1] * piVar2[1] * 0x2000 + 0x400; iVar11 = (int)param_3[0x21] * piVar2[0x21] + (int)param_3[0x11] * piVar2[0x11]; iVar17 = (int)param_3[0x11] * piVar2[0x11] - (int)param_3[0x21] * piVar2[0x21]; iVar18 = iVar17 * 0xb50 + iVar5; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar5 = iVar5 + iVar17 * -0x2d40 >> 0xb; iVar17 = ((int)param_3[0x19] * piVar2[0x19] + (int)param_3[9] * piVar2[9]) * 0x1a9a; iVar11 = (int)param_3[9] * piVar2[9] * 0x1071 + iVar17; iVar17 = iVar17 + (int)param_3[0x19] * piVar2[0x19] * -0x45a4; iVar6 = iVar28 + iVar11 >> 0xb; iVar19 = iVar28 - iVar11 >> 0xb; iVar7 = iVar18 + iVar17 >> 0xb; iVar12 = iVar18 - iVar17 >> 0xb; iVar17 = (int)param_3[2] * piVar2[2] * 0x2000 + 0x400; iVar11 = (int)param_3[0x22] * piVar2[0x22] + (int)param_3[0x12] * piVar2[0x12]; iVar20 = (int)param_3[0x12] * piVar2[0x12] - (int)param_3[0x22] * piVar2[0x22]; iVar18 = iVar20 * 0xb50 + iVar17; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar17 = iVar17 + iVar20 * -0x2d40 >> 0xb; iVar30 = ((int)param_3[0x1a] * piVar2[0x1a] + (int)param_3[10] * piVar2[10]) * 0x1a9a; iVar11 = (int)param_3[10] * piVar2[10] * 0x1071 + iVar30; iVar30 = iVar30 + (int)param_3[0x1a] * piVar2[0x1a] * -0x45a4; iVar20 = iVar28 - iVar11 >> 0xb; iVar33 = iVar28 + iVar11 >> 0xb; iVar8 = iVar18 + iVar30 >> 0xb; iVar13 = iVar18 - iVar30 >> 0xb; iVar23 = (int)param_3[3] * piVar2[3] * 0x2000 + 0x400; iVar11 = (int)param_3[0x23] * piVar2[0x23] + (int)param_3[0x13] * piVar2[0x13]; iVar30 = (int)param_3[0x13] * piVar2[0x13] - (int)param_3[0x23] * piVar2[0x23]; iVar18 = iVar30 * 0xb50 + iVar23; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar24 = iVar23 + iVar30 * -0x2d40 >> 0xb; iVar31 = ((int)param_3[0x1b] * piVar2[0x1b] + (int)param_3[0xb] * piVar2[0xb]) * 0x1a9a; iVar11 = (int)param_3[0xb] * piVar2[0xb] * 0x1071 + iVar31; iVar31 = iVar31 + (int)param_3[0x1b] * piVar2[0x1b] * -0x45a4; iVar30 = iVar28 + iVar11 >> 0xb; iVar21 = iVar28 - iVar11 >> 0xb; iVar23 = iVar18 + iVar31 >> 0xb; iVar14 = iVar18 - iVar31 >> 0xb; iVar11 = (int)param_3[0x24] * piVar2[0x24] + (int)param_3[0x14] * piVar2[0x14]; iVar25 = (int)param_3[4] * piVar2[4] * 0x2000 + 0x400; iVar31 = (int)param_3[0x14] * piVar2[0x14] - (int)param_3[0x24] * piVar2[0x24]; iVar18 = iVar31 * 0xb50 + iVar25; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar32 = ((int)param_3[0x1c] * piVar2[0x1c] + (int)param_3[0xc] * piVar2[0xc]) * 0x1a9a; iVar11 = (int)param_3[0xc] * piVar2[0xc] * 0x1071 + iVar32; iVar32 = iVar32 + (int)param_3[0x1c] * piVar2[0x1c] * -0x45a4; iVar22 = iVar28 + iVar11 >> 0xb; iVar26 = iVar25 + iVar31 * -0x2d40 >> 0xb; iVar31 = iVar28 - iVar11 >> 0xb; iVar25 = iVar18 + iVar32 >> 0xb; iVar32 = iVar18 - iVar32 >> 0xb; iVar27 = ((iVar1 + iVar10 >> 0xb) + 0x10) * 0x2000; puVar9 = (undefined1 *)(*param_4 + param_5); iVar11 = iVar22 + iVar33; iVar33 = iVar33 - iVar22; iVar18 = iVar33 * 0xb50 + iVar27; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar22 = (iVar30 + iVar6) * 0x1a9a; iVar11 = iVar6 * 0x1071 + iVar22; iVar22 = iVar22 + iVar30 * -0x45a4; *puVar9 = *(undefined1 *)((iVar28 + iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[4] = *(undefined1 *)((iVar28 - iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[1] = *(undefined1 *)((iVar18 + iVar22 >> 0x12 & 0x3ffU) + iVar3); puVar9[3] = *(undefined1 *)((iVar18 - iVar22 >> 0x12 & 0x3ffU) + iVar3); puVar9[2] = *(undefined1 *)((iVar27 + iVar33 * -0x2d40 >> 0x12 & 0x3ffU) + iVar3); iVar6 = ((iVar16 + iVar29 >> 0xb) + 0x10) * 0x2000; puVar9 = (undefined1 *)(param_4[1] + param_5); iVar11 = iVar25 + iVar8; iVar8 = iVar8 - iVar25; iVar18 = iVar8 * 0xb50 + iVar6; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar30 = (iVar23 + iVar7) * 0x1a9a; iVar11 = iVar7 * 0x1071 + iVar30; iVar30 = iVar30 + iVar23 * -0x45a4; *puVar9 = *(undefined1 *)((iVar28 + iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[4] = *(undefined1 *)((iVar28 - iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[1] = *(undefined1 *)((iVar18 + iVar30 >> 0x12 & 0x3ffU) + iVar3); puVar9[3] = *(undefined1 *)((iVar18 - iVar30 >> 0x12 & 0x3ffU) + iVar3); puVar9[2] = *(undefined1 *)((iVar6 + iVar8 * -0x2d40 >> 0x12 & 0x3ffU) + iVar3); iVar4 = ((iVar4 + iVar15 * -0x2d40 >> 0xb) + 0x10) * 0x2000; puVar9 = (undefined1 *)(param_4[2] + param_5); iVar11 = iVar26 + iVar17; iVar17 = iVar17 - iVar26; iVar18 = iVar17 * 0xb50 + iVar4; iVar28 = iVar18 + iVar11 * 0x194c; iVar18 = iVar18 + iVar11 * -0x194c; iVar6 = (iVar24 + iVar5) * 0x1a9a; iVar11 = iVar5 * 0x1071 + iVar6; iVar6 = iVar6 + iVar24 * -0x45a4; *puVar9 = *(undefined1 *)((iVar28 + iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[4] = *(undefined1 *)((iVar28 - iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[1] = *(undefined1 *)((iVar18 + iVar6 >> 0x12 & 0x3ffU) + iVar3); puVar9[3] = *(undefined1 *)((iVar18 - iVar6 >> 0x12 & 0x3ffU) + iVar3); puVar9[2] = *(undefined1 *)((iVar4 + iVar17 * -0x2d40 >> 0x12 & 0x3ffU) + iVar3); puVar9 = (undefined1 *)(param_4[3] + param_5); iVar11 = iVar32 + iVar13; iVar28 = ((iVar16 - iVar29 >> 0xb) + 0x10) * 0x2000; iVar13 = iVar13 - iVar32; iVar16 = iVar13 * 0xb50 + iVar28; iVar18 = iVar16 + iVar11 * 0x194c; iVar16 = iVar16 + iVar11 * -0x194c; iVar5 = (iVar14 + iVar12) * 0x1a9a; iVar11 = iVar12 * 0x1071 + iVar5; iVar5 = iVar5 + iVar14 * -0x45a4; *puVar9 = *(undefined1 *)((iVar18 + iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[4] = *(undefined1 *)((iVar18 - iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[1] = *(undefined1 *)((iVar16 + iVar5 >> 0x12 & 0x3ffU) + iVar3); puVar9[3] = *(undefined1 *)((iVar16 - iVar5 >> 0x12 & 0x3ffU) + iVar3); puVar9[2] = *(undefined1 *)((iVar28 + iVar13 * -0x2d40 >> 0x12 & 0x3ffU) + iVar3); puVar9 = (undefined1 *)(param_4[4] + param_5); iVar18 = ((iVar1 - iVar10 >> 0xb) + 0x10) * 0x2000; iVar11 = iVar31 + iVar20; iVar20 = iVar20 - iVar31; iVar16 = iVar20 * 0xb50 + iVar18; iVar1 = iVar16 + iVar11 * 0x194c; iVar16 = iVar16 + iVar11 * -0x194c; iVar28 = (iVar21 + iVar19) * 0x1a9a; iVar11 = iVar19 * 0x1071 + iVar28; iVar28 = iVar28 + iVar21 * -0x45a4; *puVar9 = *(undefined1 *)((iVar1 + iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[4] = *(undefined1 *)((iVar1 - iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar9[1] = *(undefined1 *)((iVar16 + iVar28 >> 0x12 & 0x3ffU) + iVar3); puVar9[3] = *(undefined1 *)((iVar16 - iVar28 >> 0x12 & 0x3ffU) + iVar3); puVar9[2] = *(undefined1 *)((iVar18 + iVar20 * -0x2d40 >> 0x12 & 0x3ffU) + iVar3); return; } //@@ 00ad7220 jpeg_idct_3x3 /* DB: libjpeg-turbo: case 3 of jddctmgr start_pass DCT_scaled_size switch (jump table 0xacb3bc entry 3 -> acaeb5 mov [ebp-4],0xad7220) */ void jpeg_idct_3x3(int param_1,int param_2,short *param_3,int *param_4,int param_5) { int iVar1; short sVar2; short sVar3; int *piVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; undefined1 *puVar17; iVar6 = *(int *)(param_1 + 0x124) + 0x80; piVar4 = *(int **)(param_2 + 0x54); sVar2 = param_3[0x10]; iVar14 = piVar4[0x10]; iVar7 = (int)*param_3 * *piVar4 * 0x2000 + 0x400; iVar1 = sVar2 * iVar14 * 0x16a1 + iVar7; sVar3 = param_3[8]; iVar5 = piVar4[8]; iVar8 = (int)param_3[1] * piVar4[1] * 0x2000 + 0x400; iVar15 = (int)param_3[0x11] * piVar4[0x11] * 0x16a1 + iVar8; iVar9 = iVar8 + (int)param_3[0x11] * piVar4[0x11] * -0x2d42 >> 0xb; iVar10 = (int)param_3[2] * piVar4[2] * 0x2000 + 0x400; iVar8 = iVar15 + (int)param_3[9] * piVar4[9] * -0x2731 >> 0xb; iVar12 = iVar15 + (int)param_3[9] * piVar4[9] * 0x2731 >> 0xb; iVar15 = (int)param_3[0x12] * piVar4[0x12] * 0x16a1 + iVar10; iVar11 = iVar10 + (int)param_3[0x12] * piVar4[0x12] * -0x2d42 >> 0xb; iVar16 = iVar15 + (int)param_3[10] * piVar4[10] * -0x2731 >> 0xb; iVar10 = iVar15 + (int)param_3[10] * piVar4[10] * 0x2731 >> 0xb; puVar17 = (undefined1 *)(*param_4 + param_5); iVar13 = ((iVar1 + sVar3 * iVar5 * 0x2731 >> 0xb) + 0x10) * 0x2000; iVar15 = iVar10 * 0x16a1 + iVar13; *puVar17 = *(undefined1 *)((iVar15 + iVar12 * 0x2731 >> 0x12 & 0x3ffU) + iVar6); puVar17[2] = *(undefined1 *)((iVar15 + iVar12 * -0x2731 >> 0x12 & 0x3ffU) + iVar6); puVar17[1] = *(undefined1 *)((iVar13 + iVar10 * -0x2d42 >> 0x12 & 0x3ffU) + iVar6); iVar14 = ((iVar7 + sVar2 * iVar14 * -0x2d42 >> 0xb) + 0x10) * 0x2000; puVar17 = (undefined1 *)(param_4[1] + param_5); iVar15 = iVar11 * 0x16a1 + iVar14; *puVar17 = *(undefined1 *)((iVar15 + iVar9 * 0x2731 >> 0x12 & 0x3ffU) + iVar6); puVar17[2] = *(undefined1 *)((iVar15 + iVar9 * -0x2731 >> 0x12 & 0x3ffU) + iVar6); puVar17[1] = *(undefined1 *)((iVar14 + iVar11 * -0x2d42 >> 0x12 & 0x3ffU) + iVar6); iVar15 = ((iVar1 + sVar3 * iVar5 * -0x2731 >> 0xb) + 0x10) * 0x2000; puVar17 = (undefined1 *)(param_4[2] + param_5); iVar1 = iVar16 * 0x16a1 + iVar15; *puVar17 = *(undefined1 *)((iVar1 + iVar8 * 0x2731 >> 0x12 & 0x3ffU) + iVar6); puVar17[2] = *(undefined1 *)((iVar1 + iVar8 * -0x2731 >> 0x12 & 0x3ffU) + iVar6); puVar17[1] = *(undefined1 *)((iVar15 + iVar16 * -0x2d42 >> 0x12 & 0x3ffU) + iVar6); return; } //@@ 00ad7450 jpeg_idct_9x9 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jidctint.c: start_pass switch case 9 (acaf65 stores 0xad7450, entry after the case-8 method sub-switch; case 7 = jpeg_idct_7x7 0xad4dc0, case 15/16 = jpeg_idct_15x15/16x16) */ void jpeg_idct_9x9(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; undefined1 *puVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int *local_154; int local_138; int *local_134; short *local_130; int *local_12c; int local_128 [16]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_130 = (short *)(param_3 + 0x40); iVar2 = *(int *)(param_1 + 0x124) + 0x80; local_154 = local_128 + 8; local_138 = 8; local_134 = (int *)(*(int *)(param_2 + 0x54) + 0x80); do { iVar7 = (int)local_130[-0x10] * local_134[-0x10]; iVar5 = (int)*local_130 * *local_134; iVar15 = (int)local_130[-0x20] * local_134[-0x20] * 0x2000 + 0x400; iVar13 = (int)local_130[0x10] * local_134[0x10] * 0x16a1 + iVar15; iVar15 = iVar15 + (int)local_130[0x10] * local_134[0x10] * -0x2d42; iVar1 = iVar15 + (iVar7 - iVar5) * 0x16a1; iVar11 = iVar13 + iVar5 * -0x7dc + (iVar5 + iVar7) * 0x2a87; iVar12 = iVar7 * 0x22ab + (iVar5 + iVar7) * -0x2a87 + iVar13; iVar9 = iVar13 + iVar7 * -0x22ab + iVar5 * 0x7dc; iVar10 = (int)local_130[8] * local_134[8]; iVar6 = (int)local_130[-0x18] * local_134[-0x18]; iVar16 = (int)local_130[0x18] * local_134[0x18]; iVar8 = (int)local_130[-8] * local_134[-8] * -0x2731; iVar13 = (iVar10 + iVar6) * 0x1d17; iVar3 = (iVar16 + iVar6) * 0xf7a; iVar14 = iVar13 + (int)local_130[-8] * local_134[-8] * 0x2731 + iVar3; iVar13 = iVar13 + iVar8 + (iVar10 - iVar16) * -0x2c91; iVar3 = iVar3 + (iVar10 - iVar16) * 0x2c91 + iVar8; iVar10 = (iVar6 - iVar16) - iVar10; local_154[0x38] = iVar11 - iVar14 >> 0xb; local_154[-8] = iVar11 + iVar14 >> 0xb; local_130 = local_130 + 1; local_154[0x30] = iVar1 + iVar10 * -0x2731 >> 0xb; *local_154 = iVar1 + iVar10 * 0x2731 >> 0xb; local_154[8] = iVar12 + iVar13 >> 0xb; local_154[0x28] = iVar12 - iVar13 >> 0xb; local_134 = local_134 + 1; local_154[0x10] = iVar9 + iVar3 >> 0xb; local_154[0x20] = iVar9 - iVar3 >> 0xb; local_154[0x18] = iVar15 + (iVar7 - iVar5) * -0x2d42 >> 0xb; local_154 = local_154 + 1; local_138 = local_138 + -1; } while (local_138 != 0); local_12c = local_128 + 4; local_138 = 0; do { iVar10 = *local_12c; iVar9 = (local_12c[-4] + 0x10) * 0x2000; puVar4 = (undefined1 *)(*(int *)(param_4 + local_138 * 4) + param_5); iVar5 = local_12c[-2]; iVar13 = local_12c[2] * 0x16a1 + iVar9; iVar9 = iVar9 + local_12c[2] * -0x2d42; iVar1 = iVar9 + (iVar5 - iVar10) * 0x16a1; iVar11 = iVar13 + iVar10 * -0x7dc + (iVar10 + iVar5) * 0x2a87; iVar12 = iVar5 * 0x22ab + (iVar10 + iVar5) * -0x2a87 + iVar13; iVar14 = iVar13 + iVar5 * -0x22ab + iVar10 * 0x7dc; iVar6 = local_12c[1]; iVar7 = local_12c[3]; iVar8 = local_12c[-1] * -0x2731; iVar13 = (iVar6 + local_12c[-3]) * 0x1d17; iVar3 = (iVar7 + local_12c[-3]) * 0xf7a; iVar15 = iVar13 + local_12c[-1] * 0x2731 + iVar3; iVar13 = iVar13 + iVar8 + (iVar6 - iVar7) * -0x2c91; iVar3 = iVar3 + (iVar6 - iVar7) * 0x2c91 + iVar8; iVar6 = (local_12c[-3] - iVar7) - iVar6; *puVar4 = *(undefined1 *)((iVar11 + iVar15 >> 0x12 & 0x3ffU) + iVar2); puVar4[8] = *(undefined1 *)((iVar11 - iVar15 >> 0x12 & 0x3ffU) + iVar2); puVar4[1] = *(undefined1 *)((iVar1 + iVar6 * 0x2731 >> 0x12 & 0x3ffU) + iVar2); puVar4[7] = *(undefined1 *)((iVar1 + iVar6 * -0x2731 >> 0x12 & 0x3ffU) + iVar2); puVar4[2] = *(undefined1 *)((iVar12 + iVar13 >> 0x12 & 0x3ffU) + iVar2); puVar4[6] = *(undefined1 *)((iVar12 - iVar13 >> 0x12 & 0x3ffU) + iVar2); puVar4[3] = *(undefined1 *)((iVar14 + iVar3 >> 0x12 & 0x3ffU) + iVar2); puVar4[5] = *(undefined1 *)((iVar14 - iVar3 >> 0x12 & 0x3ffU) + iVar2); local_12c = local_12c + 8; puVar4[4] = *(undefined1 *)((iVar9 + (iVar5 - iVar10) * -0x2d42 >> 0x12 & 0x3ffU) + iVar2); local_138 = local_138 + 1; } while (local_138 < 9); return; } //@@ 00ad78a0 jpeg_idct_10x10 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg(-turbo) start_pass FUN_00acae00: DCT_scaled_size case 10 stores 0xad78a0 */ void jpeg_idct_10x10(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; undefined1 *puVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int *local_170; int local_160; int *local_15c; int *local_14c; int local_148 [16]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_14c = (int *)(param_3 + 0x20); iVar1 = *(int *)(param_1 + 0x124) + 0x80; local_15c = local_148 + 8; local_160 = 8; local_170 = (int *)(*(int *)(param_2 + 0x54) + 0x40); do { iVar2 = (int)*(short *)((int)local_14c + 0x20) * local_170[0x10]; iVar5 = (int)*(short *)((int)local_14c + -0x20) * local_170[-0x10] * 0x2000 + 0x400; iVar11 = iVar5 + iVar2 * -0xdfc; iVar6 = iVar2 * 0x249d + iVar5; iVar7 = iVar2 * -0x2d42 + iVar5 >> 0xb; iVar2 = (int)(short)*local_14c * *local_170; iVar10 = (iVar2 + (int)*(short *)((int)local_14c + 0x40) * local_170[0x20]) * 0x1a9a; iVar5 = iVar2 * 0x1071 + iVar10; iVar10 = iVar10 + (int)*(short *)((int)local_14c + 0x40) * local_170[0x20] * -0x45a4; iVar2 = iVar5 + iVar6; iVar6 = iVar6 - iVar5; iVar5 = iVar10 + iVar11; iVar11 = iVar11 - iVar10; iVar3 = (int)*(short *)((int)local_14c + -0x10) * local_170[-8]; iVar12 = (int)*(short *)((int)local_14c + 0x30) * local_170[0x18] * 0x2000; iVar10 = (int)*(short *)((int)local_14c + 0x10) * local_170[8] + (int)*(short *)((int)local_14c + 0x50) * local_170[0x28]; iVar8 = (int)*(short *)((int)local_14c + 0x10) * local_170[8] - (int)*(short *)((int)local_14c + 0x50) * local_170[0x28]; iVar9 = iVar3 * 0x2cb3 + iVar10 * 0x1e6f + iVar12 + iVar8 * 0x9e3; iVar14 = iVar3 * 0x714 + iVar10 * -0x1e6f + iVar12 + iVar8 * 0x9e3; iVar12 = iVar12 + iVar8 * -0x19e3; iVar13 = (iVar3 - iVar8) - (int)*(short *)((int)local_14c + 0x30) * local_170[0x18]; iVar8 = (iVar3 * 0x2853 + iVar10 * -0x12cf) - iVar12; iVar12 = iVar3 * 0x148c + iVar10 * -0x12cf + iVar12; local_15c[-8] = iVar2 + iVar9 >> 0xb; local_15c[0x40] = iVar2 - iVar9 >> 0xb; local_15c[0x38] = iVar5 - iVar8 >> 0xb; *local_15c = iVar5 + iVar8 >> 0xb; local_15c[0x30] = iVar7 + iVar13 * -4; local_15c[8] = iVar13 * 4 + iVar7; local_14c = (int *)((int)local_14c + 2); local_15c[0x28] = iVar11 - iVar12 >> 0xb; local_15c[0x10] = iVar11 + iVar12 >> 0xb; local_170 = local_170 + 1; local_15c[0x18] = iVar14 + iVar6 >> 0xb; local_15c[0x20] = iVar6 - iVar14 >> 0xb; local_15c = local_15c + 1; local_160 = local_160 + -1; } while (local_160 != 0); local_14c = local_148 + 2; local_160 = 0; do { puVar4 = (undefined1 *)(*(int *)(param_4 + local_160 * 4) + param_5); iVar2 = local_14c[2]; iVar7 = (local_14c[-2] + 0x10) * 0x2000; iVar12 = iVar7 + iVar2 * -0xdfc; iVar6 = iVar2 * 0x249d + iVar7; iVar7 = iVar2 * -0x2d42 + iVar7; iVar10 = (*local_14c + local_14c[4]) * 0x1a9a; iVar5 = *local_14c * 0x1071 + iVar10; iVar10 = iVar10 + local_14c[4] * -0x45a4; iVar2 = iVar5 + iVar6; iVar6 = iVar6 - iVar5; iVar5 = iVar10 + iVar12; iVar12 = iVar12 - iVar10; iVar8 = local_14c[3] * 0x2000; iVar10 = local_14c[1] + local_14c[5]; iVar3 = local_14c[1] - local_14c[5]; iVar14 = iVar3 * 0x9e3 + iVar8; iVar11 = local_14c[-1] * 0x2cb3 + iVar10 * 0x1e6f + iVar14; iVar14 = local_14c[-1] * 0x714 + iVar10 * -0x1e6f + iVar14; iVar8 = iVar8 + iVar3 * -0x19e3; iVar3 = (local_14c[-1] - iVar3) * 0x2000 + local_14c[3] * -0x2000; iVar9 = (local_14c[-1] * 0x2853 + iVar10 * -0x12cf) - iVar8; iVar8 = local_14c[-1] * 0x148c + iVar10 * -0x12cf + iVar8; *puVar4 = *(undefined1 *)((iVar2 + iVar11 >> 0x12 & 0x3ffU) + iVar1); puVar4[9] = *(undefined1 *)((iVar2 - iVar11 >> 0x12 & 0x3ffU) + iVar1); puVar4[1] = *(undefined1 *)((iVar5 + iVar9 >> 0x12 & 0x3ffU) + iVar1); puVar4[8] = *(undefined1 *)((iVar5 - iVar9 >> 0x12 & 0x3ffU) + iVar1); puVar4[2] = *(undefined1 *)((iVar3 + iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar4[7] = *(undefined1 *)((iVar7 - iVar3 >> 0x12 & 0x3ffU) + iVar1); puVar4[3] = *(undefined1 *)((iVar12 + iVar8 >> 0x12 & 0x3ffU) + iVar1); puVar4[6] = *(undefined1 *)((iVar12 - iVar8 >> 0x12 & 0x3ffU) + iVar1); local_14c = local_14c + 8; puVar4[4] = *(undefined1 *)((iVar14 + iVar6 >> 0x12 & 0x3ffU) + iVar1); puVar4[5] = *(undefined1 *)((iVar6 - iVar14 >> 0x12 & 0x3ffU) + iVar1); local_160 = local_160 + 1; } while (local_160 < 10); return; } //@@ 00ad7dc0 jpeg_idct_11x11 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jidctint.c: case 0xb of the IDCT method switch in jddctmgr start_pass FUN_00acae00 (case 7 jpeg_idct_7x7, 0xf jpeg_idct_15x15, 0x10 jpeg_idct_16x16); fixed-point IDCT constants, 5 args (cinfo, compptr, coef_block, output_buf, output_col) */ void jpeg_idct_11x11(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; undefined1 *puVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; short *local_19c; int *local_198; int local_194; int *local_190; int *local_170; int local_168 [16]; int local_128 [8]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); iVar1 = *(int *)(param_1 + 0x124) + 0x80; local_19c = (short *)(param_3 + 0x40); local_198 = local_168 + 8; local_194 = 8; local_190 = (int *)(*(int *)(param_2 + 0x54) + 0x80); do { iVar14 = (int)*local_19c * *local_190; iVar8 = (int)local_19c[-0x10] * local_190[-0x10]; iVar18 = (int)local_19c[0x10] * local_190[0x10]; iVar2 = (int)local_19c[-0x20] * local_190[-0x20] * 0x2000 + 0x400; iVar3 = (iVar14 - iVar18) * 0x517e; iVar4 = (iVar14 - iVar8) * 0xdc9; iVar16 = (iVar18 + iVar8) - iVar14; iVar11 = iVar16 * 0x2b6c + iVar2; iVar5 = iVar11 + iVar14 * -0x3a4c + iVar4 + iVar3; iVar3 = iVar3 + iVar18 * 0x43b5 + iVar11; iVar4 = iVar4 + iVar11 + iVar8 * -0x306f; iVar11 = (iVar18 + iVar8) * -0x24fb + iVar11; iVar9 = iVar11 + iVar18 * -0x193d; iVar11 = iVar11 + iVar14 * 0x3e39 + iVar8 * -0x2c83; iVar12 = (int)local_19c[-0x18] * local_190[-0x18]; iVar6 = (int)local_19c[-8] * local_190[-8]; iVar19 = (int)local_19c[0x18] * local_190[0x18]; iVar15 = (int)local_19c[8] * local_190[8]; iVar14 = (iVar6 + iVar12) * 0x1c6a; iVar17 = (iVar6 + iVar12 + iVar19 + iVar15) * 0xcc0; iVar8 = (iVar15 + iVar12) * 0x1574; iVar18 = (iVar19 + iVar12) * 3000 + iVar17; iVar13 = iVar18 + iVar12 * -0x1d8a + iVar8 + iVar14; iVar12 = iVar17 + (iVar6 + iVar15) * -0x2537; iVar8 = iVar8 + iVar12 + iVar15 * -0x2626; iVar10 = (iVar6 + iVar19) * -0x398b; iVar14 = iVar14 + iVar6 * 0x4258 + iVar12 + iVar10; iVar18 = iVar18 + iVar19 * 0x4347 + iVar10; local_19c = local_19c + 1; iVar6 = iVar6 * -0x2ef3 + iVar19 * -0x35ea + iVar15 * 0x200b + iVar17; local_198[0x48] = iVar3 - iVar13 >> 0xb; local_198[-8] = iVar3 + iVar13 >> 0xb; local_198[0x40] = iVar5 - iVar14 >> 0xb; *local_198 = iVar14 + iVar5 >> 0xb; local_198[0x38] = iVar9 - iVar8 >> 0xb; local_198[8] = iVar8 + iVar9 >> 0xb; local_198[0x10] = iVar18 + iVar4 >> 0xb; local_198[0x30] = iVar4 - iVar18 >> 0xb; local_198[0x18] = iVar6 + iVar11 >> 0xb; local_198[0x28] = iVar11 - iVar6 >> 0xb; local_190 = local_190 + 1; local_198[0x20] = iVar2 + iVar16 * -0x2d41 >> 0xb; local_198 = local_198 + 1; local_194 = local_194 + -1; } while (local_194 != 0); local_170 = local_168 + 4; local_194 = 0; do { iVar8 = *local_170; iVar14 = local_170[2]; puVar7 = (undefined1 *)(*(int *)(param_4 + local_194 * 4) + param_5); iVar18 = local_170[-2]; iVar6 = (local_170[-4] + 0x10) * 0x2000; iVar3 = (iVar8 - iVar14) * 0x517e; iVar4 = (iVar8 - iVar18) * 0xdc9; iVar16 = (iVar14 + iVar18) - iVar8; iVar11 = iVar16 * 0x2b6c + iVar6; iVar9 = iVar11 + iVar8 * -0x3a4c + iVar4 + iVar3; iVar3 = iVar3 + iVar14 * 0x43b5 + iVar11; iVar4 = iVar4 + iVar11 + iVar18 * -0x306f; iVar11 = (iVar14 + iVar18) * -0x24fb + iVar11; iVar10 = iVar11 + iVar14 * -0x193d; iVar14 = local_170[-3]; iVar2 = local_170[-1]; iVar11 = iVar11 + iVar8 * 0x3e39 + local_170[-2] * -0x2c83; iVar5 = local_170[3]; iVar17 = (iVar2 + iVar14 + iVar5 + local_170[1]) * 0xcc0; iVar12 = (iVar2 + iVar14) * 0x1c6a; iVar8 = (local_170[1] + iVar14) * 0x1574; iVar18 = (iVar5 + iVar14) * 3000 + iVar17; iVar15 = iVar18 + iVar14 * -0x1d8a + iVar8 + iVar12; iVar14 = iVar17 + (local_170[1] + iVar2) * -0x2537; iVar8 = iVar8 + iVar14 + local_170[1] * -0x2626; iVar13 = (iVar5 + iVar2) * -0x398b; iVar14 = iVar12 + iVar2 * 0x4258 + iVar14 + iVar13; iVar18 = iVar18 + iVar5 * 0x4347 + iVar13; iVar2 = iVar2 * -0x2ef3 + iVar5 * -0x35ea + local_170[1] * 0x200b + iVar17; *puVar7 = *(undefined1 *)((iVar3 + iVar15 >> 0x12 & 0x3ffU) + iVar1); puVar7[10] = *(undefined1 *)((iVar3 - iVar15 >> 0x12 & 0x3ffU) + iVar1); puVar7[1] = *(undefined1 *)((iVar14 + iVar9 >> 0x12 & 0x3ffU) + iVar1); puVar7[9] = *(undefined1 *)((iVar9 - iVar14 >> 0x12 & 0x3ffU) + iVar1); puVar7[2] = *(undefined1 *)((iVar8 + iVar10 >> 0x12 & 0x3ffU) + iVar1); puVar7[8] = *(undefined1 *)((iVar10 - iVar8 >> 0x12 & 0x3ffU) + iVar1); puVar7[3] = *(undefined1 *)((iVar18 + iVar4 >> 0x12 & 0x3ffU) + iVar1); puVar7[7] = *(undefined1 *)((iVar4 - iVar18 >> 0x12 & 0x3ffU) + iVar1); puVar7[4] = *(undefined1 *)((iVar2 + iVar11 >> 0x12 & 0x3ffU) + iVar1); puVar7[6] = *(undefined1 *)((iVar11 - iVar2 >> 0x12 & 0x3ffU) + iVar1); local_170 = local_170 + 8; puVar7[5] = *(undefined1 *)((iVar6 + iVar16 * -0x2d41 >> 0x12 & 0x3ffU) + iVar1); local_194 = local_194 + 1; } while (local_194 < 0xb); return; } //@@ 00ad8420 jpeg_idct_12x12 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg(-turbo) jdddctmgr start_pass FUN_00acae00: switch on compptr->DCT_scaled_size case 12 stores 0xad8420 (cases 7/15/16 are the already named jpeg_idct_7x7/15x15/16x16) */ void jpeg_idct_12x12(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; undefined1 *puVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int *local_1ac; int local_1a4; int *local_198; short *local_194; int *local_18c; int local_188 [16]; int local_148 [8]; int local_128 [8]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_194 = (short *)(param_3 + 0x20); iVar3 = *(int *)(param_1 + 0x124) + 0x80; local_1ac = local_188 + 8; local_1a4 = 8; local_198 = (int *)(*(int *)(param_2 + 0x54) + 0x40); do { iVar10 = (int)*local_194 * *local_198; iVar15 = (int)local_194[-0x10] * local_198[-0x10] * 0x2000 + 0x400; iVar12 = iVar15 + (int)local_194[0x10] * local_198[0x10] * -0x2731; iVar16 = (int)local_194[0x10] * local_198[0x10] * 0x2731 + iVar15; iVar8 = (int)local_194[0x20] * local_198[0x20]; iVar4 = iVar10 * 0x2000 + iVar8 * -0x2000; iVar1 = iVar15 - iVar4; iVar15 = iVar15 + iVar4; iVar4 = iVar8 * 0x2000 + iVar10 * 0x2bb6; iVar2 = iVar16 - iVar4; iVar8 = iVar10 * 0xbb6 + iVar8 * -0x2000; iVar16 = iVar16 + iVar4; iVar4 = iVar8 + iVar12; iVar12 = iVar12 - iVar8; iVar13 = (int)local_194[-8] * local_198[-8]; iVar5 = (int)local_194[0x18] * local_198[0x18]; iVar9 = (int)local_194[8] * local_198[8]; iVar17 = (int)local_194[0x28] * local_198[0x28]; iVar6 = (iVar13 + iVar5 + iVar17) * 0x1b8d; iVar8 = (iVar13 + iVar5) * 0x85b + iVar6; iVar14 = iVar13 * 0x8f7 + iVar8 + iVar9 * 0x29cf; iVar10 = (iVar17 + iVar5) * -0x2175; iVar8 = iVar8 + iVar10 + iVar5 * -0x2f50 + iVar9 * -0x1151; iVar10 = iVar10 + iVar17 * 0x32c6 + iVar9 * -0x29cf + iVar6; iVar6 = iVar6 + iVar13 * -0x15a4 + iVar17 * -0x3f74 + iVar9 * -0x1151; iVar11 = ((iVar9 - iVar5) + (iVar13 - iVar17)) * 0x1151; iVar13 = (iVar13 - iVar17) * 0x187e + iVar11; iVar11 = iVar11 + (iVar9 - iVar5) * -0x3b21; local_1ac[-8] = iVar16 + iVar14 >> 0xb; local_1ac[0x50] = iVar16 - iVar14 >> 0xb; *local_1ac = iVar15 + iVar13 >> 0xb; local_1ac[0x48] = iVar15 - iVar13 >> 0xb; local_1ac[8] = iVar4 + iVar8 >> 0xb; local_1ac[0x40] = iVar4 - iVar8 >> 0xb; local_1ac[0x10] = iVar10 + iVar12 >> 0xb; local_1ac[0x38] = iVar12 - iVar10 >> 0xb; local_198 = local_198 + 1; local_1ac[0x30] = iVar1 - iVar11 >> 0xb; local_1ac[0x18] = iVar11 + iVar1 >> 0xb; local_1ac[0x28] = iVar2 - iVar6 >> 0xb; local_194 = local_194 + 1; local_1ac[0x20] = iVar6 + iVar2 >> 0xb; local_1ac = local_1ac + 1; local_1a4 = local_1a4 + -1; } while (local_1a4 != 0); local_18c = local_188 + 2; local_1a4 = 0; do { iVar15 = (local_18c[-2] + 0x10) * 0x2000; puVar7 = (undefined1 *)(*(int *)(param_4 + local_1a4 * 4) + param_5); iVar8 = *local_18c; iVar14 = iVar15 + local_18c[2] * -0x2731; iVar16 = local_18c[2] * 0x2731 + iVar15; iVar10 = local_18c[4]; iVar4 = iVar8 * 0x2000 + iVar10 * -0x2000; iVar1 = iVar15 - iVar4; iVar15 = iVar15 + iVar4; iVar4 = iVar10 * 0x2000 + iVar8 * 0x2bb6; iVar2 = iVar16 - iVar4; iVar8 = iVar8 * 0xbb6 + iVar10 * -0x2000; iVar16 = iVar16 + iVar4; iVar4 = iVar8 + iVar14; iVar14 = iVar14 - iVar8; iVar6 = local_18c[5]; iVar9 = local_18c[1]; iVar13 = local_18c[3]; iVar5 = (local_18c[-1] + iVar13 + iVar6) * 0x1b8d; iVar8 = (local_18c[-1] + iVar13) * 0x85b + iVar5; iVar11 = local_18c[-1] * 0x8f7 + iVar8 + iVar9 * 0x29cf; iVar10 = (iVar6 + iVar13) * -0x2175; iVar8 = iVar8 + iVar10 + iVar13 * -0x2f50 + iVar9 * -0x1151; iVar10 = iVar10 + iVar6 * 0x32c6 + iVar9 * -0x29cf + iVar5; iVar12 = local_18c[-1] - iVar6; iVar5 = iVar5 + local_18c[-1] * -0x15a4 + iVar6 * -0x3f74 + iVar9 * -0x1151; iVar9 = ((local_18c[1] - iVar13) + iVar12) * 0x1151; iVar6 = iVar12 * 0x187e + iVar9; iVar9 = iVar9 + (local_18c[1] - iVar13) * -0x3b21; *puVar7 = *(undefined1 *)((iVar16 + iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar7[0xb] = *(undefined1 *)((iVar16 - iVar11 >> 0x12 & 0x3ffU) + iVar3); puVar7[1] = *(undefined1 *)((iVar15 + iVar6 >> 0x12 & 0x3ffU) + iVar3); puVar7[10] = *(undefined1 *)((iVar15 - iVar6 >> 0x12 & 0x3ffU) + iVar3); puVar7[2] = *(undefined1 *)((iVar4 + iVar8 >> 0x12 & 0x3ffU) + iVar3); puVar7[9] = *(undefined1 *)((iVar4 - iVar8 >> 0x12 & 0x3ffU) + iVar3); puVar7[3] = *(undefined1 *)((iVar10 + iVar14 >> 0x12 & 0x3ffU) + iVar3); puVar7[8] = *(undefined1 *)((iVar14 - iVar10 >> 0x12 & 0x3ffU) + iVar3); puVar7[4] = *(undefined1 *)((iVar9 + iVar1 >> 0x12 & 0x3ffU) + iVar3); puVar7[7] = *(undefined1 *)((iVar1 - iVar9 >> 0x12 & 0x3ffU) + iVar3); puVar7[5] = *(undefined1 *)((iVar5 + iVar2 >> 0x12 & 0x3ffU) + iVar3); puVar7[6] = *(undefined1 *)((iVar2 - iVar5 >> 0x12 & 0x3ffU) + iVar3); local_18c = local_18c + 8; local_1a4 = local_1a4 + 1; } while (local_1a4 < 0xc); return; } //@@ 00ad89f0 jpeg_idct_13x13 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg-turbo jidctint.c: slot 13 of jddctmgr start_pass switch on DCT_scaled_size (jump table at 0xacb3bc, mov [ebp-4],0xad89f0); 8x13 int workspace, FIX(1.155388986)=0x24f9 */ void jpeg_idct_13x13(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; undefined1 *puVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int iVar23; short *local_1dc; int local_1d4; int *local_1cc; int *local_1bc; int *local_1ac; int local_1a8 [16]; int local_168 [8]; int local_148 [8]; int local_128 [8]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_1dc = (short *)(param_3 + 0x40); local_1bc = local_1a8 + 8; iVar1 = *(int *)(param_1 + 0x124) + 0x80; local_1d4 = 8; local_1cc = (int *)(*(int *)(param_2 + 0x54) + 0x80); do { iVar17 = (int)local_1dc[-0x10] * local_1cc[-0x10]; iVar2 = (int)local_1dc[-0x20] * local_1cc[-0x20] * 0x2000; iVar10 = iVar2 + 0x400; iVar6 = (int)local_1dc[0x10] * local_1cc[0x10] + (int)*local_1dc * *local_1cc; iVar21 = (int)*local_1dc * *local_1cc - (int)local_1dc[0x10] * local_1cc[0x10]; iVar3 = iVar21 * 0x319 + iVar10; iVar19 = iVar17 * 0x2bf1 + iVar3 + iVar6 * 0x24f9; iVar3 = iVar17 * 0x100c + iVar6 * -0x24f9 + iVar3; iVar4 = iVar21 * 0xf95 + iVar10; iVar5 = iVar17 * 0x21e0 + iVar6 * -0xa20 + iVar4; iVar4 = iVar4 + iVar17 * -0x2812 + iVar6 * 0xa20; iVar10 = iVar21 * 0x1dfe - iVar10; iVar14 = (iVar17 * -0x574 - iVar10) + iVar6 * -0xdf2; iVar10 = (iVar6 * 0xdf2 + iVar17 * -0x19b5) - iVar10; iVar20 = (int)local_1dc[-0x18] * local_1cc[-0x18]; iVar11 = (int)local_1dc[-8] * local_1cc[-8]; iVar15 = (int)local_1dc[8] * local_1cc[8]; iVar18 = (int)local_1dc[0x18] * local_1cc[0x18]; iVar6 = (iVar11 + iVar20) * 0x2a50; iVar7 = (iVar15 + iVar20) * 0x253e; iVar22 = (iVar18 + iVar20) * 0x1e02; iVar23 = iVar22 + iVar20 * -0x40a5 + iVar7 + iVar6; iVar12 = (iVar15 + iVar11) * -0xad5; iVar16 = (iVar18 + iVar20) * 0xad5; iVar13 = (iVar11 + iVar18) * -0x253e; iVar6 = iVar6 + iVar11 * 0x1acb + iVar12 + iVar13; iVar8 = (iVar15 + iVar18) * -0x1508; iVar7 = iVar7 + iVar12 + iVar15 * -0x324f + iVar8; iVar8 = iVar22 + iVar18 * 0x4694 + iVar13 + iVar8; iVar12 = (iVar15 - iVar11) * 0x1e02; iVar11 = iVar20 * 0xa33 + iVar11 * -0xeea + iVar16 + iVar12; iVar16 = iVar16 + iVar15 * 0xc4e + iVar18 * -0x37c1 + iVar12; local_1bc[0x58] = iVar19 - iVar23 >> 0xb; local_1bc[-8] = iVar19 + iVar23 >> 0xb; *local_1bc = iVar5 + iVar6 >> 0xb; local_1bc[0x50] = iVar5 - iVar6 >> 0xb; local_1bc[8] = iVar3 + iVar7 >> 0xb; local_1bc[0x48] = iVar3 - iVar7 >> 0xb; local_1bc[0x40] = iVar14 - iVar8 >> 0xb; local_1bc[0x10] = iVar14 + iVar8 >> 0xb; local_1bc[0x18] = iVar11 + iVar10 >> 0xb; local_1bc[0x38] = iVar10 - iVar11 >> 0xb; local_1dc = local_1dc + 1; local_1bc[0x20] = iVar16 + iVar4 >> 0xb; local_1bc[0x30] = iVar4 - iVar16 >> 0xb; local_1cc = local_1cc + 1; local_1bc[0x28] = (iVar21 - iVar17) * 0x2d41 + iVar2 + 0x400 >> 0xb; local_1bc = local_1bc + 1; local_1d4 = local_1d4 + -1; } while (local_1d4 != 0); local_1ac = local_1a8 + 4; local_1cc = (int *)0x0; do { iVar3 = local_1ac[-2]; puVar9 = (undefined1 *)(*(int *)(param_4 + (int)local_1cc * 4) + param_5); iVar18 = (local_1ac[-4] + 0x10) * 0x2000; iVar10 = local_1ac[2] + *local_1ac; iVar21 = *local_1ac - local_1ac[2]; iVar12 = iVar21 * 0x319 + iVar18; iVar19 = iVar3 * 0x2bf1 + iVar12 + iVar10 * 0x24f9; iVar12 = iVar3 * 0x100c + iVar10 * -0x24f9 + iVar12; iVar6 = iVar21 * 0xf95 + iVar18; iVar13 = iVar3 * 0x21e0 + iVar10 * -0xa20 + iVar6; iVar6 = iVar6 + iVar3 * -0x2812 + iVar10 * 0xa20; iVar14 = iVar21 * 0x1dfe + (local_1ac[-4] + 0x10) * -0x2000; iVar17 = (iVar3 * -0x574 - iVar14) + iVar10 * -0xdf2; iVar14 = (iVar10 * 0xdf2 + iVar3 * -0x19b5) - iVar14; iVar5 = local_1ac[-3]; iVar8 = local_1ac[-1]; iVar10 = (iVar8 + iVar5) * 0x2a50; iVar4 = (local_1ac[1] + iVar5) * 0x253e; iVar2 = (local_1ac[3] + iVar5) * 0x1e02; iVar20 = iVar2 + iVar5 * -0x40a5 + iVar4 + iVar10; iVar15 = (local_1ac[1] + iVar8) * -0xad5; iVar16 = (local_1ac[3] + iVar8) * -0x253e; iVar10 = iVar10 + iVar8 * 0x1acb + iVar15 + iVar16; iVar11 = local_1ac[3]; iVar7 = (local_1ac[1] + iVar11) * -0x1508; iVar4 = iVar4 + iVar15 + local_1ac[1] * -0x324f + iVar7; iVar7 = iVar2 + local_1ac[3] * 0x4694 + iVar16 + iVar7; iVar2 = (iVar11 + iVar5) * 0xad5; iVar15 = (local_1ac[1] - iVar8) * 0x1e02; iVar5 = iVar5 * 0xa33 + iVar8 * -0xeea + iVar2 + iVar15; iVar2 = iVar2 + local_1ac[1] * 0xc4e + iVar11 * -0x37c1 + iVar15; *puVar9 = *(undefined1 *)((iVar19 + iVar20 >> 0x12 & 0x3ffU) + iVar1); puVar9[0xc] = *(undefined1 *)((iVar19 - iVar20 >> 0x12 & 0x3ffU) + iVar1); puVar9[1] = *(undefined1 *)((iVar13 + iVar10 >> 0x12 & 0x3ffU) + iVar1); puVar9[0xb] = *(undefined1 *)((iVar13 - iVar10 >> 0x12 & 0x3ffU) + iVar1); puVar9[2] = *(undefined1 *)((iVar12 + iVar4 >> 0x12 & 0x3ffU) + iVar1); puVar9[10] = *(undefined1 *)((iVar12 - iVar4 >> 0x12 & 0x3ffU) + iVar1); puVar9[3] = *(undefined1 *)((iVar17 + iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar9[9] = *(undefined1 *)((iVar17 - iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar9[4] = *(undefined1 *)((iVar5 + iVar14 >> 0x12 & 0x3ffU) + iVar1); puVar9[8] = *(undefined1 *)((iVar14 - iVar5 >> 0x12 & 0x3ffU) + iVar1); puVar9[5] = *(undefined1 *)((iVar2 + iVar6 >> 0x12 & 0x3ffU) + iVar1); puVar9[7] = *(undefined1 *)((iVar6 - iVar2 >> 0x12 & 0x3ffU) + iVar1); local_1ac = local_1ac + 8; puVar9[6] = *(undefined1 *)(((iVar21 - iVar3) * 0x2d41 + iVar18 >> 0x12 & 0x3ffU) + iVar1); local_1cc = (int *)((int)local_1cc + 1); } while ((int)local_1cc < 0xd); return; } //@@ 00ad9150 jpeg_idct_14x14 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg(-turbo) IDCT method table in jinit_inverse_dct/start_pass (switch at 00acae8c): stored at acafb7 between jpeg_idct_13x13 (00ad89f0) and jpeg_idct_15x15 (00ad9840); 5 args (cinfo, compptr, coef_block, output_buf, output_col), workspace int[8*14] */ void jpeg_idct_14x14(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; int iVar4; undefined1 *puVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int local_1f0; int local_1ec; int *local_1e4; int *local_1d4; int *local_1d0; int local_1c8 [16]; int local_188 [8]; int local_168 [8]; int local_148 [8]; int local_128 [8]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_1d0 = (int *)(param_3 + 0x20); iVar1 = *(int *)(param_1 + 0x124) + 0x80; local_1f0 = 8; local_1e4 = local_1c8 + 8; local_1d4 = (int *)(*(int *)(param_2 + 0x54) + 0x40); do { iVar2 = (int)*(short *)((int)local_1d0 + 0x20) * local_1d4[0x10]; iVar17 = (int)*(short *)((int)local_1d0 + -0x20) * local_1d4[-0x10] * 0x2000 + 0x400; iVar13 = iVar17 + iVar2 * -0x1c37; iVar16 = iVar2 * 0x28c6 + iVar17; iVar10 = iVar2 * 0xa12 + iVar17; iVar6 = iVar2 * -0x2d42 + iVar17 >> 0xb; iVar15 = (int)(short)*local_1d0 * *local_1d4; iVar2 = (int)*(short *)((int)local_1d0 + 0x40) * local_1d4[0x20]; iVar18 = (iVar2 + iVar15) * 0x2362; iVar17 = iVar15 * 0x8bd + iVar18; iVar18 = iVar18 + iVar2 * -0x3704; iVar7 = iVar15 * 0x13a3 + iVar2 * -0x2c1f; iVar2 = iVar17 + iVar16; iVar16 = iVar16 - iVar17; iVar17 = iVar18 + iVar10; iVar10 = iVar10 - iVar18; iVar15 = iVar7 + iVar13; iVar13 = iVar13 - iVar7; iVar19 = (int)*(short *)((int)local_1d0 + -0x10) * local_1d4[-8]; iVar3 = (int)*(short *)((int)local_1d0 + 0x30) * local_1d4[0x18]; iVar14 = (int)*(short *)((int)local_1d0 + 0x10) * local_1d4[8]; iVar11 = (int)*(short *)((int)local_1d0 + 0x50) * local_1d4[0x28]; iVar7 = (iVar14 + iVar19) * 0x2ab7; iVar18 = (iVar3 + iVar19) * 0x2652; iVar8 = (iVar3 + iVar19) * 0x1814; iVar20 = iVar11 * 0x2000 + iVar19 * -0x2410 + iVar18 + iVar7; iVar4 = (iVar19 - iVar14) * 0xef2 + iVar11 * -0x2000; iVar9 = iVar8 + iVar19 * -0x21f5 + iVar4; iVar12 = iVar11 * -0x2000 + (iVar3 + iVar14) * -0x511; iVar7 = iVar7 + iVar12 + iVar14 * -0xd92; iVar18 = iVar18 + iVar12 + iVar3 * -0x4bf7; iVar12 = (iVar3 - iVar14) * 0x2cf8; iVar8 = iVar8 + iVar11 * 0x2000 + iVar3 * -0x361a + iVar12; iVar3 = ((iVar19 - iVar14) + iVar11) - iVar3; iVar4 = iVar4 + iVar14 * 0x1599 + iVar12; local_1e4[-8] = iVar2 + iVar20 >> 0xb; local_1e4[0x60] = iVar2 - iVar20 >> 0xb; local_1e4[0x58] = iVar17 - iVar7 >> 0xb; *local_1e4 = iVar17 + iVar7 >> 0xb; local_1e4[8] = iVar15 + iVar18 >> 0xb; local_1e4[0x50] = iVar15 - iVar18 >> 0xb; local_1e4[0x48] = iVar6 + iVar3 * -4; local_1e4[0x10] = iVar3 * 4 + iVar6; local_1e4[0x18] = iVar13 + iVar8 >> 0xb; local_1e4[0x40] = iVar13 - iVar8 >> 0xb; local_1e4[0x20] = iVar10 + iVar4 >> 0xb; local_1e4[0x38] = iVar10 - iVar4 >> 0xb; local_1d4 = local_1d4 + 1; local_1e4[0x30] = iVar16 - iVar9 >> 0xb; local_1d0 = (int *)((int)local_1d0 + 2); local_1e4[0x28] = iVar9 + iVar16 >> 0xb; local_1e4 = local_1e4 + 1; local_1f0 = local_1f0 + -1; } while (local_1f0 != 0); local_1d0 = local_1c8 + 2; local_1ec = 0; do { iVar13 = (local_1d0[-2] + 0x10) * 0x2000; puVar5 = (undefined1 *)(*(int *)(param_4 + local_1ec * 4) + param_5); iVar2 = local_1d0[2]; iVar19 = iVar13 + iVar2 * -0x1c37; iVar16 = iVar2 * 0x28c6 + iVar13; iVar10 = iVar2 * 0xa12 + iVar13; iVar13 = iVar2 * -0x2d42 + iVar13; iVar2 = *local_1d0; iVar17 = local_1d0[4]; iVar18 = (iVar17 + iVar2) * 0x2362; iVar15 = iVar2 * 0x8bd + iVar18; iVar18 = iVar18 + iVar17 * -0x3704; iVar7 = iVar2 * 0x13a3 + iVar17 * -0x2c1f; iVar2 = iVar15 + iVar16; iVar16 = iVar16 - iVar15; iVar17 = iVar18 + iVar10; iVar10 = iVar10 - iVar18; iVar15 = iVar7 + iVar19; iVar19 = iVar19 - iVar7; iVar3 = local_1d0[-1]; iVar4 = local_1d0[3]; iVar6 = local_1d0[1]; iVar9 = local_1d0[5]; iVar11 = iVar9 * 0x2000; iVar18 = (iVar4 + iVar3) * 0x2652; iVar7 = (iVar3 + iVar6) * 0x2ab7; iVar8 = (iVar4 + iVar3) * 0x1814; iVar20 = iVar18 + iVar3 * -0x2410 + iVar7 + iVar11; iVar12 = (iVar3 - iVar6) * 0xef2 + iVar9 * -0x2000; iVar14 = iVar8 + iVar3 * -0x21f5 + iVar12; iVar9 = iVar9 * -0x2000 + (iVar4 + iVar6) * -0x511; iVar7 = iVar7 + iVar9 + iVar6 * -0xd92; iVar18 = iVar18 + iVar9 + iVar4 * -0x4bf7; iVar9 = (iVar4 - iVar6) * 0x2cf8; iVar8 = iVar8 + iVar9 + iVar4 * -0x361a + iVar11; iVar12 = iVar12 + iVar6 * 0x1599 + iVar9; iVar11 = ((iVar3 - iVar6) - iVar4) * 0x2000 + iVar11; *puVar5 = *(undefined1 *)((iVar2 + iVar20 >> 0x12 & 0x3ffU) + iVar1); puVar5[0xd] = *(undefined1 *)((iVar2 - iVar20 >> 0x12 & 0x3ffU) + iVar1); puVar5[1] = *(undefined1 *)((iVar17 + iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar5[0xc] = *(undefined1 *)((iVar17 - iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar5[2] = *(undefined1 *)((iVar15 + iVar18 >> 0x12 & 0x3ffU) + iVar1); puVar5[0xb] = *(undefined1 *)((iVar15 - iVar18 >> 0x12 & 0x3ffU) + iVar1); puVar5[3] = *(undefined1 *)((iVar11 + iVar13 >> 0x12 & 0x3ffU) + iVar1); puVar5[10] = *(undefined1 *)((iVar13 - iVar11 >> 0x12 & 0x3ffU) + iVar1); puVar5[4] = *(undefined1 *)((iVar19 + iVar8 >> 0x12 & 0x3ffU) + iVar1); puVar5[9] = *(undefined1 *)((iVar19 - iVar8 >> 0x12 & 0x3ffU) + iVar1); puVar5[5] = *(undefined1 *)((iVar10 + iVar12 >> 0x12 & 0x3ffU) + iVar1); puVar5[8] = *(undefined1 *)((iVar10 - iVar12 >> 0x12 & 0x3ffU) + iVar1); local_1d0 = local_1d0 + 8; puVar5[6] = *(undefined1 *)((iVar14 + iVar16 >> 0x12 & 0x3ffU) + iVar1); puVar5[7] = *(undefined1 *)((iVar16 - iVar14 >> 0x12 & 0x3ffU) + iVar1); local_1ec = local_1ec + 1; } while (local_1ec < 0xe); return; } //@@ 00ad9840 jpeg_idct_15x15 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jidctint.c: params (cinfo, compptr, coef_block, output_buf, output_col); constants 0x2731=FIX(1.224744871), 0x4ea3=FIX(2.457431844), 0x2ace=FIX(1.337628990), 0x1a9a=FIX(0.831253876) are the 15x15 set; workspace 8*15 ints; CONST_BITS 13 rounding 0x400 */ void jpeg_idct_15x15(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int *piVar3; undefined1 *puVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int local_21c; int *local_218; short *local_214; int local_20c; int *local_1f8; int local_1e8 [16]; int local_1a8 [8]; int local_188 [8]; int local_168 [8]; int local_148 [8]; int local_128 [8]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_214 = (short *)(param_3 + 0x40); iVar2 = *(int *)(param_1 + 0x124) + 0x80; local_218 = (int *)(*(int *)(param_2 + 0x54) + 0x80); local_20c = 8; piVar3 = local_1e8 + 8; do { iVar16 = (int)local_214[-0x10] * local_218[-0x10]; iVar5 = (int)local_214[0x10] * local_218[0x10]; iVar20 = (int)local_214[-0x20] * local_218[-0x20] * 0x2000 + 0x400; iVar12 = iVar20 + iVar5 * -0xdfc; iVar1 = iVar5 * 0x249d + iVar20; iVar20 = iVar20 + iVar5 * -0x2d42; iVar21 = iVar16 - (int)*local_214 * *local_218; iVar6 = (int)*local_214 * *local_218 + iVar16; iVar13 = iVar1 + iVar21 * 0x176 + iVar6 * 0x2ace; iVar10 = iVar12 + iVar6 * -0x2ace + iVar21 * 0x176 + iVar16 * 0x2e13; iVar5 = iVar1 + iVar21 * -0xcc7 + iVar6 * -0x1182; iVar7 = iVar12 + iVar21 * -0xcc7 + iVar16 * -0x2e13 + iVar6 * 0x1182; iVar17 = iVar12 + iVar21 * 0xb50 + iVar6 * 0x194c; iVar14 = iVar1 + iVar6 * -0x194c + iVar21 * 0xb50; iVar1 = iVar21 * 0x16a0 + iVar20; iVar8 = (int)local_214[8] * local_218[8]; iVar16 = (int)local_214[-0x18] * local_218[-0x18]; iVar18 = (int)local_214[-8] * local_218[-8]; iVar15 = (int)local_214[0x18] * local_218[0x18]; iVar6 = ((iVar18 - iVar15) + iVar16) * 0x1a9a; iVar9 = iVar16 * 0x1071 + iVar6; iVar6 = iVar6 + (iVar18 - iVar15) * -0x45a4; iVar12 = (iVar16 - iVar15) * 0x2d02 + iVar8 * 0x2731; iVar22 = iVar15 * 0x4ea3 + iVar18 * 0x2b0a + iVar12; iVar19 = (iVar16 - iVar15) * 0x2731 + iVar8 * -0x2731; iVar12 = iVar18 * -0x1a9a + iVar16 * -0x2399 + iVar12; iVar11 = (iVar16 + iVar15) * 0x1268; iVar16 = iVar18 * -0x1a9a + iVar16 * 0xf39 + iVar8 * -0x2731 + iVar11; iVar8 = iVar18 * -0x2b0a + iVar8 * 0x2731 + iVar15 * -0x1bd1 + iVar11; piVar3[0x68] = iVar13 - iVar22 >> 0xb; piVar3[-8] = iVar13 + iVar22 >> 0xb; *piVar3 = iVar17 + iVar9 >> 0xb; piVar3[0x60] = iVar17 - iVar9 >> 0xb; piVar3[0x58] = iVar1 - iVar19 >> 0xb; piVar3[8] = iVar1 + iVar19 >> 0xb; piVar3[0x50] = iVar10 - iVar16 >> 0xb; piVar3[0x10] = iVar10 + iVar16 >> 0xb; piVar3[0x18] = iVar6 + iVar14 >> 0xb; piVar3[0x48] = iVar14 - iVar6 >> 0xb; piVar3[0x40] = iVar5 - iVar8 >> 0xb; piVar3[0x20] = iVar8 + iVar5 >> 0xb; local_218 = local_218 + 1; piVar3[0x28] = iVar12 + iVar7 >> 0xb; piVar3[0x38] = iVar7 - iVar12 >> 0xb; local_214 = local_214 + 1; local_20c = local_20c + -1; piVar3[0x30] = iVar20 + iVar21 * -0x2d40 >> 0xb; piVar3 = piVar3 + 1; } while (local_20c != 0); local_1f8 = local_1e8 + 4; local_21c = 0; do { iVar19 = (local_1f8[-4] + 0x10) * 0x2000; puVar4 = (undefined1 *)(*(int *)(param_4 + local_21c * 4) + param_5); iVar6 = local_1f8[-2]; iVar5 = local_1f8[2]; iVar7 = iVar19 + iVar5 * -0xdfc; iVar1 = iVar5 * 0x249d + iVar19; iVar19 = iVar19 + iVar5 * -0x2d42; iVar20 = iVar6 - *local_1f8; iVar12 = *local_1f8 + iVar6; iVar22 = iVar1 + iVar20 * 0x176 + iVar12 * 0x2ace; iVar13 = iVar7 + iVar12 * -0x2ace + iVar20 * 0x176 + iVar6 * 0x2e13; iVar5 = iVar1 + iVar20 * -0xcc7 + iVar12 * -0x1182; iVar10 = iVar7 + iVar20 * -0xcc7 + iVar6 * -0x2e13 + iVar12 * 0x1182; iVar8 = local_1f8[1]; iVar16 = local_1f8[-3]; iVar15 = iVar7 + iVar20 * 0xb50 + iVar12 * 0x194c; iVar17 = iVar1 + iVar12 * -0x194c + iVar20 * 0xb50; iVar1 = iVar20 * 0x16a0 + iVar19; iVar7 = local_1f8[-1]; iVar9 = local_1f8[3]; iVar6 = ((iVar7 - iVar9) + iVar16) * 0x1a9a; iVar11 = iVar16 * 0x1071 + iVar6; iVar6 = iVar6 + (iVar7 - iVar9) * -0x45a4; iVar12 = (iVar16 - iVar9) * 0x2d02 + iVar8 * 0x2731; iVar18 = (iVar16 - iVar9) * 0x2731 + iVar8 * -0x2731; iVar21 = iVar9 * 0x4ea3 + iVar7 * 0x2b0a + iVar12; iVar12 = iVar7 * -0x1a9a + iVar16 * -0x2399 + iVar12; iVar14 = (iVar9 + iVar16) * 0x1268; iVar16 = iVar7 * -0x1a9a + iVar16 * 0xf39 + iVar8 * -0x2731 + iVar14; iVar8 = iVar7 * -0x2b0a + iVar8 * 0x2731 + iVar9 * -0x1bd1 + iVar14; *puVar4 = *(undefined1 *)((iVar22 + iVar21 >> 0x12 & 0x3ffU) + iVar2); puVar4[0xe] = *(undefined1 *)((iVar22 - iVar21 >> 0x12 & 0x3ffU) + iVar2); puVar4[1] = *(undefined1 *)((iVar15 + iVar11 >> 0x12 & 0x3ffU) + iVar2); puVar4[0xd] = *(undefined1 *)((iVar15 - iVar11 >> 0x12 & 0x3ffU) + iVar2); puVar4[2] = *(undefined1 *)((iVar1 + iVar18 >> 0x12 & 0x3ffU) + iVar2); puVar4[0xc] = *(undefined1 *)((iVar1 - iVar18 >> 0x12 & 0x3ffU) + iVar2); puVar4[3] = *(undefined1 *)((iVar13 + iVar16 >> 0x12 & 0x3ffU) + iVar2); puVar4[0xb] = *(undefined1 *)((iVar13 - iVar16 >> 0x12 & 0x3ffU) + iVar2); puVar4[4] = *(undefined1 *)((iVar6 + iVar17 >> 0x12 & 0x3ffU) + iVar2); puVar4[10] = *(undefined1 *)((iVar17 - iVar6 >> 0x12 & 0x3ffU) + iVar2); puVar4[5] = *(undefined1 *)((iVar8 + iVar5 >> 0x12 & 0x3ffU) + iVar2); puVar4[9] = *(undefined1 *)((iVar5 - iVar8 >> 0x12 & 0x3ffU) + iVar2); local_1f8 = local_1f8 + 8; puVar4[6] = *(undefined1 *)((iVar12 + iVar10 >> 0x12 & 0x3ffU) + iVar2); puVar4[8] = *(undefined1 *)((iVar10 - iVar12 >> 0x12 & 0x3ffU) + iVar2); puVar4[7] = *(undefined1 *)((iVar19 + iVar20 * -0x2d40 >> 0x12 & 0x3ffU) + iVar2); local_21c = local_21c + 1; } while (local_21c < 0xf); return; } //@@ 00ad9fc0 jpeg_idct_16x16 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jidctint.c (cinfo, compptr, coef_block, output_buf, output_col): 8-column pass into 8x16 workspace, constants 0x29cf FIX_1_306562965, 0x1151 FIX_0_541196100, 0x8d4 FIX_0_275899379, 0x2c63 FIX_1_387039845, 0x1ccd FIX_0_899976223, 0x5203 FIX_2_562915447, 0x133e FIX_0_601344887, 0x1050 FIX_0_509795579 */ void jpeg_idct_16x16(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int *piVar2; undefined1 *puVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; int iVar16; int iVar17; int iVar18; int iVar19; int iVar20; int iVar21; int iVar22; int iVar23; int iVar24; int iVar25; int iVar26; int iVar27; int local_244; int *local_23c; int local_224; int *local_220; int local_208 [16]; int local_1c8 [8]; int local_1a8 [8]; int local_188 [8]; int local_168 [8]; int local_148 [8]; int local_128 [8]; int local_108 [8]; int local_e8 [8]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [8]; int local_48 [8]; int local_28 [8]; uint local_8; local_8 = __security_cookie ^ (uint)(local_28 + 9); local_220 = (int *)(param_3 + 0x20); iVar1 = *(int *)(param_1 + 0x124) + 0x80; local_23c = (int *)(*(int *)(param_2 + 0x54) + 0x40); local_224 = 8; piVar2 = local_208 + 8; do { iVar4 = (int)*(short *)((int)local_220 + 0x20) * local_23c[0x10]; iVar18 = (int)*(short *)((int)local_220 + -0x20) * local_23c[-0x10] * 0x2000 + 0x400; iVar6 = iVar4 * 0x29cf + iVar18; iVar15 = iVar18 + iVar4 * -0x29cf; iVar13 = iVar4 * 0x1151 + iVar18; iVar18 = iVar18 + iVar4 * -0x1151; iVar19 = (int)(short)*local_220 * *local_23c; iVar16 = (int)*(short *)((int)local_220 + 0x40) * local_23c[0x20]; iVar12 = (iVar19 - iVar16) * 0x8d4; iVar5 = (iVar19 - iVar16) * 0x2c63; iVar24 = iVar19 * 0x1ccd + iVar12; iVar4 = iVar16 * 0x5203 + iVar5; iVar5 = iVar5 + iVar19 * -0x133e; iVar12 = iVar12 + iVar16 * -0x1050; iVar19 = iVar6 - iVar4; iVar6 = iVar6 + iVar4; iVar4 = iVar13 + iVar24; iVar13 = iVar13 - iVar24; iVar16 = iVar18 + iVar5; iVar18 = iVar18 - iVar5; iVar5 = iVar12 + iVar15; iVar15 = iVar15 - iVar12; iVar7 = (int)*(short *)((int)local_220 + 0x30) * local_23c[0x18]; iVar20 = (int)*(short *)((int)local_220 + -0x10) * local_23c[-8]; iVar17 = (int)*(short *)((int)local_220 + 0x10) * local_23c[8]; iVar25 = (int)*(short *)((int)local_220 + 0x50) * local_23c[0x28]; iVar24 = (iVar17 + iVar20) * 0x2b4e; iVar8 = (iVar7 + iVar20) * 0x27e9; iVar9 = (iVar25 + iVar20) * 0x22fc; iVar10 = (iVar20 - iVar25) * 0x1cb6; iVar11 = (iVar7 + iVar20) * 0x1555; iVar12 = (iVar20 - iVar17) * 0xd23; iVar26 = iVar9 + iVar20 * -0x492a + iVar8 + iVar24; iVar21 = iVar12 + iVar20 * -0x3abe + iVar11 + iVar10; iVar20 = (iVar7 + iVar17) * 0x470; iVar22 = (iVar7 - iVar17) * 0x2d09; iVar14 = (iVar17 + iVar25) * -0x27e9; iVar23 = (iVar17 + iVar25) * -0x1555; iVar12 = iVar12 + iVar17 * 0x3f1a + iVar22 + iVar14; iVar24 = iVar24 + iVar17 * 0x24d + iVar20 + iVar23; iVar17 = (iVar7 + iVar25) * -0x2b4e; iVar8 = iVar8 + iVar20 + iVar7 * -0x2406 + iVar17; iVar9 = iVar9 + iVar25 * 0x2218 + iVar17 + iVar23; iVar20 = (iVar25 - iVar7) * 0xd23; iVar7 = iVar11 + iVar22 + iVar7 * -0x1886 + iVar20; iVar20 = iVar10 + iVar25 * 0x6485 + iVar14 + iVar20; piVar2[0x70] = iVar6 - iVar26 >> 0xb; piVar2[-8] = iVar6 + iVar26 >> 0xb; piVar2[0x68] = iVar4 - iVar24 >> 0xb; *piVar2 = iVar4 + iVar24 >> 0xb; piVar2[8] = iVar16 + iVar8 >> 0xb; piVar2[0x60] = iVar16 - iVar8 >> 0xb; local_23c = local_23c + 1; piVar2[0x58] = iVar5 - iVar9 >> 0xb; piVar2[0x10] = iVar5 + iVar9 >> 0xb; piVar2[0x50] = iVar15 - iVar20 >> 0xb; piVar2[0x18] = iVar15 + iVar20 >> 0xb; piVar2[0x48] = iVar18 - iVar7 >> 0xb; piVar2[0x20] = iVar18 + iVar7 >> 0xb; piVar2[0x40] = iVar13 - iVar12 >> 0xb; piVar2[0x28] = iVar13 + iVar12 >> 0xb; local_220 = (int *)((int)local_220 + 2); local_224 = local_224 + -1; piVar2[0x30] = iVar19 + iVar21 >> 0xb; piVar2[0x38] = iVar19 - iVar21 >> 0xb; piVar2 = piVar2 + 1; } while (local_224 != 0); local_220 = local_208 + 2; local_244 = 0; do { iVar21 = (local_220[-2] + 0x10) * 0x2000; puVar3 = (undefined1 *)(*(int *)(param_4 + local_244 * 4) + param_5); iVar6 = local_220[2] * 0x29cf + iVar21; iVar22 = iVar21 + local_220[2] * -0x29cf; iVar13 = local_220[2] * 0x1151 + iVar21; iVar21 = iVar21 + local_220[2] * -0x1151; iVar4 = *local_220; iVar16 = local_220[4]; iVar12 = (iVar4 - iVar16) * 0x8d4; iVar19 = (iVar4 - iVar16) * 0x2c63; iVar24 = iVar4 * 0x1ccd + iVar12; iVar5 = iVar16 * 0x5203 + iVar19; iVar19 = iVar19 + iVar4 * -0x133e; iVar12 = iVar12 + iVar16 * -0x1050; iVar4 = iVar6 + iVar5; iVar6 = iVar6 - iVar5; iVar16 = iVar13 + iVar24; iVar13 = iVar13 - iVar24; iVar5 = iVar21 + iVar19; iVar21 = iVar21 - iVar19; iVar19 = iVar12 + iVar22; iVar22 = iVar22 - iVar12; iVar12 = local_220[-1]; iVar24 = local_220[1]; iVar10 = local_220[3]; iVar8 = (iVar24 + iVar12) * 0x2b4e; iVar9 = (iVar10 + iVar12) * 0x27e9; iVar11 = (local_220[5] + iVar12) * 0x22fc; iVar20 = (iVar12 - local_220[5]) * 0x1cb6; iVar18 = (iVar10 + iVar12) * 0x1555; iVar15 = (iVar12 - iVar24) * 0xd23; iVar27 = iVar11 + iVar12 * -0x492a + iVar9 + iVar8; iVar14 = (iVar10 + iVar24) * 0x470; iVar23 = iVar15 + iVar12 * -0x3abe + iVar18 + iVar20; iVar25 = (iVar10 - iVar24) * 0x2d09; iVar26 = (iVar24 + local_220[5]) * -0x1555; iVar17 = (iVar24 + local_220[5]) * -0x27e9; iVar7 = local_220[5]; iVar12 = iVar8 + iVar24 * 0x24d + iVar14 + iVar26; iVar24 = iVar15 + iVar24 * 0x3f1a + iVar25 + iVar17; iVar15 = (iVar7 + iVar10) * -0x2b4e; iVar8 = iVar9 + iVar14 + iVar10 * -0x2406 + iVar15; iVar11 = iVar11 + iVar7 * 0x2218 + iVar15 + iVar26; iVar9 = (iVar7 - iVar10) * 0xd23; iVar7 = iVar20 + iVar7 * 0x6485 + iVar17 + iVar9; iVar9 = iVar18 + iVar25 + iVar10 * -0x1886 + iVar9; *puVar3 = *(undefined1 *)((iVar4 + iVar27 >> 0x12 & 0x3ffU) + iVar1); puVar3[0xf] = *(undefined1 *)((iVar4 - iVar27 >> 0x12 & 0x3ffU) + iVar1); puVar3[1] = *(undefined1 *)((iVar16 + iVar12 >> 0x12 & 0x3ffU) + iVar1); puVar3[0xe] = *(undefined1 *)((iVar16 - iVar12 >> 0x12 & 0x3ffU) + iVar1); puVar3[2] = *(undefined1 *)((iVar5 + iVar8 >> 0x12 & 0x3ffU) + iVar1); puVar3[0xd] = *(undefined1 *)((iVar5 - iVar8 >> 0x12 & 0x3ffU) + iVar1); puVar3[3] = *(undefined1 *)((iVar19 + iVar11 >> 0x12 & 0x3ffU) + iVar1); puVar3[0xc] = *(undefined1 *)((iVar19 - iVar11 >> 0x12 & 0x3ffU) + iVar1); puVar3[4] = *(undefined1 *)((iVar22 + iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar3[0xb] = *(undefined1 *)((iVar22 - iVar7 >> 0x12 & 0x3ffU) + iVar1); puVar3[5] = *(undefined1 *)((iVar21 + iVar9 >> 0x12 & 0x3ffU) + iVar1); puVar3[10] = *(undefined1 *)((iVar21 - iVar9 >> 0x12 & 0x3ffU) + iVar1); puVar3[6] = *(undefined1 *)((iVar13 + iVar24 >> 0x12 & 0x3ffU) + iVar1); puVar3[9] = *(undefined1 *)((iVar13 - iVar24 >> 0x12 & 0x3ffU) + iVar1); puVar3[7] = *(undefined1 *)((iVar6 + iVar23 >> 0x12 & 0x3ffU) + iVar1); puVar3[8] = *(undefined1 *)((iVar6 - iVar23 >> 0x12 & 0x3ffU) + iVar1); local_220 = local_220 + 8; local_244 = local_244 + 1; } while (local_244 < 0x10); return; } //@@ 00ada820 jpeg_idct_4x4 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg jidctint.c: start_pass switch case 4 (acaec8 stores 0xada820; jump table entries in order 1..16) */ void jpeg_idct_4x4(int param_1,int param_2,int param_3,int param_4,int param_5) { int iVar1; int iVar2; int *piVar3; undefined1 uVar4; int iVar5; undefined1 *puVar6; int iVar7; int iVar8; int *local_98; int *local_94; short *local_90; int local_8c; int local_88 [32]; uint local_8; local_8 = __security_cookie ^ (uint)(local_88 + 0x21); local_94 = local_88 + 8; iVar1 = *(int *)(param_1 + 0x124) + 0x80; local_8c = 8; local_90 = (short *)(param_3 + 0x20); local_98 = *(int **)(param_2 + 0x54); do { if (local_8c != 4) { if ((((local_90[-8] == 0) && (*local_90 == 0)) && (local_90[8] == 0)) && (((local_90[0x18] == 0 && (local_90[0x20] == 0)) && (local_90[0x28] == 0)))) { iVar2 = (int)local_90[-0x10] * *local_98 * 4; local_94[-8] = iVar2; local_94[8] = iVar2; local_94[0x10] = iVar2; } else { iVar7 = (int)local_90[-0x10] * *local_98 * 0x4000; iVar5 = (int)*local_90 * local_98[0x10] * 0x3b21 + (int)local_90[0x20] * local_98[0x30] * -0x187e; iVar2 = iVar5 + iVar7; iVar7 = iVar7 - iVar5; iVar8 = (int)local_90[0x18] * local_98[0x28] * 0x2e75 + (int)local_90[8] * local_98[0x18] * -0x4587 + (int)local_90[-8] * local_98[8] * 0x21f9 + (int)local_90[0x28] * local_98[0x38] * -0x6c2; iVar5 = (int)local_90[-8] * local_98[8] * 0x5203 + (int)local_90[8] * local_98[0x18] * 0x1ccd + (int)local_90[0x18] * local_98[0x28] * -0x133e + (int)local_90[0x28] * local_98[0x38] * -0x1050; local_94[-8] = iVar2 + 0x800 + iVar5 >> 0xc; local_94[0x10] = (iVar2 - iVar5) + 0x800 >> 0xc; iVar2 = iVar7 + 0x800 + iVar8 >> 0xc; local_94[8] = (iVar7 - iVar8) + 0x800 >> 0xc; } *local_94 = iVar2; } local_8c = local_8c + -1; local_90 = local_90 + 1; local_98 = local_98 + 1; local_94 = local_94 + 1; } while (0 < local_8c); piVar3 = local_88; local_8c = 0; do { puVar6 = (undefined1 *)(*(int *)(param_4 + local_8c * 4) + param_5); if (((piVar3[1] == 0) && (piVar3[2] == 0)) && ((piVar3[3] == 0 && (((piVar3[5] == 0 && (piVar3[6] == 0)) && (piVar3[7] == 0)))))) { uVar4 = *(undefined1 *)((*piVar3 + 0x10 >> 5 & 0x3ffU) + iVar1); *puVar6 = uVar4; puVar6[1] = uVar4; puVar6[3] = uVar4; } else { iVar5 = piVar3[2] * 0x3b21 + piVar3[6] * -0x187e; iVar2 = iVar5 + *piVar3 * 0x4000; iVar5 = *piVar3 * 0x4000 - iVar5; iVar7 = piVar3[5] * 0x2e75 + piVar3[3] * -0x4587 + piVar3[1] * 0x21f9 + piVar3[7] * -0x6c2; iVar8 = piVar3[1] * 0x5203 + piVar3[3] * 0x1ccd + piVar3[5] * -0x133e + piVar3[7] * -0x1050; *puVar6 = *(undefined1 *)((iVar2 + 0x40000 + iVar8 >> 0x13 & 0x3ffU) + iVar1); puVar6[3] = *(undefined1 *)(((iVar2 - iVar8) + 0x40000 >> 0x13 & 0x3ffU) + iVar1); puVar6[1] = *(undefined1 *)((iVar7 + 0x40000 + iVar5 >> 0x13 & 0x3ffU) + iVar1); uVar4 = *(undefined1 *)(((iVar5 - iVar7) + 0x40000 >> 0x13 & 0x3ffU) + iVar1); } puVar6[2] = uVar4; piVar3 = piVar3 + 8; local_8c = local_8c + 1; } while (local_8c < 4); return; } //@@ 00adab90 jpeg_idct_2x2 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg(-turbo) jidctred.c: start_pass case 2; skips columns 2/4/6, odd-coefficient constants 0x73fc FIX_3_624509785, 0x28ba FIX_1_272758580, 0x1b37 FIX_0_850430095, 0x1712 FIX_0_720959822 */ void jpeg_idct_2x2(int param_1,int param_2,int param_3,int *param_4,int param_5) { undefined1 uVar1; int iVar2; short *psVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; undefined1 *puVar9; int *piVar10; int local_48 [5]; int local_34; int local_2c; int local_28 [5]; int local_14; int local_c; iVar7 = 8; iVar2 = *(int *)(param_1 + 0x124) + 0x80; piVar10 = *(int **)(param_2 + 0x54); psVar3 = (short *)(param_3 + 0x30); iVar5 = -(int)piVar10; do { if (((iVar7 != 6) && (iVar7 != 4)) && (iVar7 != 2)) { if (((psVar3[-0x10] == 0) && (*psVar3 == 0)) && ((psVar3[0x10] == 0 && (psVar3[0x20] == 0)))) { iVar4 = (int)psVar3[-0x18] * *piVar10 * 4; *(int *)((int)local_28 + iVar5 + (int)piVar10) = iVar4; } else { iVar8 = (int)psVar3[-0x18] * *piVar10 * 0x8000; iVar6 = (int)psVar3[0x10] * piVar10[0x28] * 0x1b37 + (int)psVar3[0x20] * piVar10[0x38] * -0x1712 + (int)psVar3[-0x10] * piVar10[8] * 0x73fc + (int)*psVar3 * piVar10[0x18] * -0x28ba; iVar4 = iVar6 + 0x1000 + iVar8 >> 0xd; *(int *)((int)local_28 + iVar5 + (int)piVar10) = (iVar8 - iVar6) + 0x1000 >> 0xd; } *(int *)((int)local_48 + iVar5 + (int)piVar10) = iVar4; } iVar7 = iVar7 + -1; psVar3 = psVar3 + 1; piVar10 = piVar10 + 1; } while (0 < iVar7); puVar9 = (undefined1 *)(param_5 + *param_4); if (((local_48[1] == 0) && (local_48[3] == 0)) && ((local_34 == 0 && (local_2c == 0)))) { uVar1 = *(undefined1 *)((local_48[0] + 0x10 >> 5 & 0x3ffU) + iVar2); *puVar9 = uVar1; } else { iVar5 = local_48[1] * 0x73fc + local_48[3] * -0x28ba + local_34 * 0x1b37 + local_2c * -0x1712; *puVar9 = *(undefined1 *)((local_48[0] * 0x8000 + 0x80000 + iVar5 >> 0x14 & 0x3ffU) + iVar2); uVar1 = *(undefined1 *)(((local_48[0] * 0x8000 - iVar5) + 0x80000 >> 0x14 & 0x3ffU) + iVar2); } puVar9[1] = uVar1; puVar9 = (undefined1 *)(param_4[1] + param_5); if ((((local_28[1] == 0) && (local_28[3] == 0)) && (local_14 == 0)) && (local_c == 0)) { uVar1 = *(undefined1 *)((local_28[0] + 0x10 >> 5 & 0x3ffU) + iVar2); *puVar9 = uVar1; puVar9[1] = uVar1; return; } iVar5 = local_28[1] * 0x73fc + local_28[3] * -0x28ba + local_14 * 0x1b37 + local_c * -0x1712; *puVar9 = *(undefined1 *)((local_28[0] * 0x8000 + 0x80000 + iVar5 >> 0x14 & 0x3ffU) + iVar2); puVar9[1] = *(undefined1 *)(((local_28[0] * 0x8000 - iVar5) + 0x80000 >> 0x14 & 0x3ffU) + iVar2); return; } //@@ 00adade0 FUN_00adade0 void FUN_00adade0(int param_1,int param_2,short *param_3,int *param_4,int param_5) { *(undefined1 *)(param_5 + *param_4) = *(undefined1 *) (((int)*param_3 * **(int **)(param_2 + 0x54) + 4 >> 3 & 0x3ffU) + 0x80 + *(int *)(param_1 + 0x124)); return; } //@@ 00adae20 jpeg_idct_ifast /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg-turbo: case 8 of start_pass, dct_method==JDCT_IFAST(1) -> 0xadae20 (islow=0xad4820, float=0xadb2c0) */ void jpeg_idct_ifast(int param_1,int param_2,short *param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; int iVar4; int *piVar5; undefined1 uVar6; int iVar7; int iVar8; int iVar9; int iVar10; int iVar11; undefined1 *puVar12; int iVar13; int iVar14; int local_124; int local_120; int local_11c; int local_118; int *local_110; int *local_10c; int local_108 [16]; int local_c8 [8]; int local_a8 [8]; int local_88 [8]; int local_68 [24]; uint local_8; local_8 = __security_cookie ^ (uint)(local_68 + 0x19); local_10c = local_108; iVar3 = *(int *)(param_1 + 0x124) + 0x80; local_124 = 8; local_110 = *(int **)(param_2 + 0x54); do { if ((((param_3[8] == 0) && (param_3[0x10] == 0)) && (param_3[0x18] == 0)) && (((param_3[0x20] == 0 && (param_3[0x28] == 0)) && ((param_3[0x30] == 0 && (param_3[0x38] == 0)))))) { iVar4 = (int)*param_3 * *local_110; local_10c[0x30] = iVar4; local_10c[0x38] = iVar4; iVar11 = iVar4; iVar10 = iVar4; local_120 = iVar4; local_11c = iVar4; local_118 = iVar4; } else { iVar4 = (int)param_3[0x20] * local_110[0x20] + (int)*param_3 * *local_110; iVar11 = (int)*param_3 * *local_110 - (int)param_3[0x20] * local_110[0x20]; iVar10 = (int)param_3[0x30] * local_110[0x30] + (int)param_3[0x10] * local_110[0x10]; iVar8 = iVar10 + iVar4; iVar4 = iVar4 - iVar10; iVar10 = (((int)param_3[0x10] * local_110[0x10] - (int)param_3[0x30] * local_110[0x30]) * 0x16a >> 8) - iVar10; iVar1 = iVar10 + iVar11; iVar11 = iVar11 - iVar10; iVar10 = (int)param_3[0x28] * local_110[0x28] + (int)param_3[0x18] * local_110[0x18]; iVar14 = (int)param_3[0x28] * local_110[0x28] - (int)param_3[0x18] * local_110[0x18]; iVar7 = (int)param_3[0x38] * local_110[0x38] + (int)param_3[8] * local_110[8]; iVar13 = (int)param_3[8] * local_110[8] - (int)param_3[0x38] * local_110[0x38]; iVar2 = iVar7 + iVar10; iVar9 = (iVar13 + iVar14) * 0x1d9 >> 8; iVar14 = ((iVar14 * -0x29d >> 8) - iVar2) + iVar9; iVar7 = ((iVar7 - iVar10) * 0x16a >> 8) - iVar14; local_11c = iVar8 + iVar2; iVar9 = ((iVar13 * 0x115 >> 8) - iVar9) + iVar7; local_10c[0x38] = iVar8 - iVar2; local_118 = iVar1 + iVar14; local_10c[0x30] = iVar1 - iVar14; local_120 = iVar4 - iVar9; iVar10 = iVar11 + iVar7; iVar11 = iVar11 - iVar7; iVar4 = iVar4 + iVar9; } local_10c[0x20] = iVar4; local_110 = local_110 + 1; param_3 = param_3 + 1; *local_10c = local_11c; local_10c[8] = local_118; local_10c[0x10] = iVar10; local_10c[0x28] = iVar11; local_10c[0x18] = local_120; local_10c = local_10c + 1; local_124 = local_124 + -1; } while (0 < local_124); piVar5 = local_108; local_120 = 0; do { puVar12 = (undefined1 *)(*(int *)(param_4 + local_120 * 4) + param_5); iVar4 = piVar5[1]; if ((((iVar4 == 0) && (piVar5[2] == 0)) && ((piVar5[3] == 0 && (((piVar5[4] == 0 && (piVar5[5] == 0)) && (piVar5[6] == 0)))))) && (piVar5[7] == 0)) { uVar6 = *(undefined1 *)((*piVar5 >> 5 & 0x3ffU) + iVar3); *puVar12 = uVar6; puVar12[1] = uVar6; puVar12[2] = uVar6; puVar12[4] = uVar6; puVar12[5] = uVar6; puVar12[6] = uVar6; puVar12[7] = uVar6; } else { iVar10 = *piVar5 + piVar5[4]; iVar14 = *piVar5 - piVar5[4]; iVar8 = piVar5[6] + piVar5[2]; iVar1 = iVar8 + iVar10; iVar10 = iVar10 - iVar8; iVar8 = ((piVar5[2] - piVar5[6]) * 0x16a >> 8) - iVar8; iVar7 = iVar8 + iVar14; iVar14 = iVar14 - iVar8; iVar8 = piVar5[5] + piVar5[3]; iVar13 = piVar5[5] - piVar5[3]; iVar2 = piVar5[7] + iVar4; iVar4 = iVar4 - piVar5[7]; iVar11 = iVar2 + iVar8; iVar9 = (iVar4 + iVar13) * 0x1d9 >> 8; iVar13 = ((iVar13 * -0x29d >> 8) - iVar11) + iVar9; iVar8 = ((iVar2 - iVar8) * 0x16a >> 8) - iVar13; iVar4 = ((iVar4 * 0x115 >> 8) - iVar9) + iVar8; *puVar12 = *(undefined1 *)((iVar1 + iVar11 >> 5 & 0x3ffU) + iVar3); puVar12[7] = *(undefined1 *)((iVar1 - iVar11 >> 5 & 0x3ffU) + iVar3); puVar12[1] = *(undefined1 *)((iVar13 + iVar7 >> 5 & 0x3ffU) + iVar3); puVar12[6] = *(undefined1 *)((iVar7 - iVar13 >> 5 & 0x3ffU) + iVar3); puVar12[2] = *(undefined1 *)((iVar8 + iVar14 >> 5 & 0x3ffU) + iVar3); puVar12[5] = *(undefined1 *)((iVar14 - iVar8 >> 5 & 0x3ffU) + iVar3); puVar12[4] = *(undefined1 *)((iVar4 + iVar10 >> 5 & 0x3ffU) + iVar3); uVar6 = *(undefined1 *)((iVar10 - iVar4 >> 5 & 0x3ffU) + iVar3); } puVar12[3] = uVar6; piVar5 = piVar5 + 8; local_120 = local_120 + 1; } while (local_120 < 8); return; } //@@ 00adb2c0 jpeg_idct_float /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* DB: libjpeg(-turbo) start_pass FUN_00acae00: case 8 switches on cinfo->dct_method (+0x44): 0 ISLOW -> 00ad4820, 1 IFAST -> 00adae20, 2 FLOAT -> 0xadb2c0, else JERR_NOT_COMPILED (0x31) */ void jpeg_idct_float(int param_1,int param_2,short *param_3,int param_4,int param_5) { int iVar1; undefined1 *puVar2; float *pfVar3; float *pfVar4; int iVar5; float fVar6; float fVar7; float fVar8; float fVar9; float fVar10; float fVar11; float fVar12; float fVar13; float fVar14; float fVar15; float fVar16; float local_108 [16]; float local_c8 [8]; float local_a8 [8]; float local_88 [8]; float local_68 [8]; float local_48 [8]; float local_28 [8]; float local_8; local_8 = (float)(__security_cookie ^ (uint)(local_28 + 9)); pfVar3 = local_108; iVar1 = *(int *)(param_1 + 0x124); iVar5 = 8; pfVar4 = *(float **)(param_2 + 0x54); do { if ((((param_3[8] == 0) && (param_3[0x10] == 0)) && (param_3[0x18] == 0)) && (((param_3[0x20] == 0 && (param_3[0x28] == 0)) && ((param_3[0x30] == 0 && (param_3[0x38] == 0)))))) { fVar6 = *pfVar4 * 0.125 * (float)(int)*param_3; pfVar3[0x30] = fVar6; pfVar3[0x38] = fVar6; fVar9 = fVar6; fVar8 = fVar6; fVar10 = fVar6; fVar11 = fVar6; fVar7 = fVar6; } else { fVar7 = *pfVar4 * 0.125 * (float)(int)*param_3; fVar10 = pfVar4[0x10] * 0.125 * (float)(int)param_3[0x10]; fVar9 = pfVar4[0x20] * 0.125 * (float)(int)param_3[0x20]; fVar8 = pfVar4[0x30] * 0.125 * (float)(int)param_3[0x30]; fVar15 = fVar9 + fVar7; fVar7 = fVar7 - fVar9; fVar9 = fVar8 + fVar10; fVar16 = fVar9 + fVar15; fVar15 = fVar15 - fVar9; fVar9 = (fVar10 - fVar8) * 1.4142135 - fVar9; fVar14 = fVar9 + fVar7; fVar7 = fVar7 - fVar9; fVar13 = pfVar4[8] * 0.125 * (float)(int)param_3[8]; fVar10 = pfVar4[0x18] * 0.125 * (float)(int)param_3[0x18]; fVar9 = pfVar4[0x28] * 0.125 * (float)(int)param_3[0x28]; fVar8 = pfVar4[0x38] * 0.125 * (float)(int)param_3[0x38]; fVar12 = fVar9 - fVar10; fVar9 = fVar9 + fVar10; fVar6 = fVar8 + fVar13; fVar13 = fVar13 - fVar8; fVar10 = fVar6 + fVar9; fVar11 = (fVar13 + fVar12) * 1.847759; fVar12 = (fVar11 - fVar12 * 2.613126) - fVar10; fVar6 = (fVar6 - fVar9) * 1.4142135 - fVar12; pfVar3[0x38] = fVar16 - fVar10; fVar8 = fVar12 + fVar14; fVar10 = fVar10 + fVar16; fVar9 = (fVar11 - fVar13 * 1.0823922) - fVar6; pfVar3[0x30] = fVar14 - fVar12; fVar11 = fVar6 + fVar7; fVar7 = fVar7 - fVar6; fVar6 = fVar15 - fVar9; fVar9 = fVar9 + fVar15; } pfVar3[0x28] = fVar7; iVar5 = iVar5 + -1; *pfVar3 = fVar10; pfVar4 = pfVar4 + 1; pfVar3[8] = fVar8; param_3 = param_3 + 1; pfVar3[0x10] = fVar11; pfVar3[0x18] = fVar9; pfVar3[0x20] = fVar6; pfVar3 = pfVar3 + 1; } while (0 < iVar5); pfVar3 = local_108 + 6; iVar5 = 0; do { fVar7 = pfVar3[-4] + *pfVar3; puVar2 = (undefined1 *)(*(int *)(param_4 + iVar5 * 4) + param_5); fVar12 = pfVar3[-2] + pfVar3[-6] + 128.5; fVar11 = (pfVar3[-6] + 128.5) - pfVar3[-2]; fVar9 = (pfVar3[-4] - *pfVar3) * 1.4142135 - fVar7; fVar16 = fVar7 + fVar12; fVar12 = fVar12 - fVar7; fVar8 = pfVar3[-5] - pfVar3[1]; fVar7 = fVar9 + fVar11; fVar14 = pfVar3[-5] + pfVar3[1]; fVar11 = fVar11 - fVar9; fVar10 = pfVar3[-3] + pfVar3[-1]; fVar6 = pfVar3[-1] - pfVar3[-3]; fVar13 = fVar14 + fVar10; fVar9 = (fVar8 + fVar6) * 1.847759; fVar6 = (fVar9 - fVar6 * 2.613126) - fVar13; fVar10 = (fVar14 - fVar10) * 1.4142135 - fVar6; fVar9 = (fVar9 - fVar8 * 1.0823922) - fVar10; *puVar2 = *(undefined1 *)(((int)(fVar13 + fVar16) & 0x3ffU) + iVar1); puVar2[7] = *(undefined1 *)(((int)(fVar16 - fVar13) & 0x3ffU) + iVar1); puVar2[1] = *(undefined1 *)(((int)(fVar6 + fVar7) & 0x3ffU) + iVar1); puVar2[6] = *(undefined1 *)(((int)(fVar7 - fVar6) & 0x3ffU) + iVar1); puVar2[2] = *(undefined1 *)(((int)(fVar10 + fVar11) & 0x3ffU) + iVar1); puVar2[5] = *(undefined1 *)(((int)(fVar11 - fVar10) & 0x3ffU) + iVar1); iVar5 = iVar5 + 1; pfVar3 = pfVar3 + 8; puVar2[3] = *(undefined1 *)(((int)(fVar9 + fVar12) & 0x3ffU) + iVar1); puVar2[4] = *(undefined1 *)(((int)(fVar12 - fVar9) & 0x3ffU) + iVar1); } while (iVar5 < 8); return; } //@@ 00adb7d0 FUN_00adb7d0 void FUN_00adb7d0(int param_1,int param_2,int param_3,int param_4,float param_5,float param_6) { int iVar1; int iVar2; int iVar3; int in_ECX; int *in_EDX; int iVar4; int iVar5; double dVar6; float fVar7; float fVar8; float fVar9; float fVar10; float local_1c; iVar4 = 0; if (0 < param_4) { do { dVar6 = (double)*(float *)(param_3 + iVar4 * 4); libm_sse2_cos_precise(); *(float *)(param_3 + iVar4 * 4) = (float)(dVar6 + dVar6); iVar4 = iVar4 + 1; } while (iVar4 < param_4); } iVar4 = 0; if (0 < param_1) { iVar5 = 0; iVar2 = *in_EDX; do { local_1c = 0.5; dVar6 = (double)((float)iVar2 * (3.1415927 / (float)param_2)); libm_sse2_cos_precise(); iVar3 = 1; fVar8 = (float)(dVar6 + dVar6); fVar10 = local_1c; if (1 < param_4) { do { local_1c = local_1c * (fVar8 - *(float *)(param_3 + -4 + iVar3 * 4)); iVar1 = iVar3 * 4; iVar3 = iVar3 + 2; fVar10 = fVar10 * (fVar8 - *(float *)(param_3 + iVar1)); } while (iVar3 < param_4); } if (iVar3 == param_4) { fVar7 = fVar8 - *(float *)(param_3 + -4 + iVar3 * 4); fVar8 = fVar8 * fVar8; fVar7 = fVar7 * local_1c; fVar9 = 4.0; fVar7 = fVar7 * fVar7; } else { fVar7 = (fVar8 + 2.0) * local_1c * local_1c; fVar9 = 2.0; } dVar6 = (double)((fVar9 - fVar8) * fVar10 * fVar10 + fVar7); if (dVar6 < 0.0) { libm_sse2_sqrt_precise(); } else { dVar6 = SQRT(dVar6); } dVar6 = ((double)param_5 / dVar6 - (double)param_6) * 0.1151292473077774; libm_sse2_exp_precise(); iVar4 = iVar4 + 1; *(float *)(iVar5 + in_ECX) = (float)dVar6 * *(float *)(iVar5 + in_ECX); iVar5 = iVar4 * 4; iVar3 = in_EDX[iVar4]; if (iVar3 == iVar2) { do { iVar4 = iVar4 + 1; *(float *)(iVar5 + in_ECX) = (float)dVar6 * *(float *)(iVar5 + in_ECX); iVar5 = iVar4 * 4; iVar3 = in_EDX[iVar4]; } while (iVar3 == iVar2); } iVar2 = iVar3; } while (iVar4 < param_1); } return; } //@@ 00adb9c0 inflate_fast /* DB: zlib 1.1.x inffast.c inflate_fast(bl,bd,tl,td,s,z): inflate_mask table 0xb5f660 indexed by bl(ECX)/bd(EDX), 'invalid distance code','invalid literal/length code' */ undefined4 inflate_fast(int param_1,int param_2,int param_3,int *param_4) { uint uVar1; uint uVar2; uint uVar3; byte *pbVar4; byte bVar5; byte bVar6; int in_ECX; uint uVar7; uint uVar8; int in_EDX; byte *pbVar9; int iVar10; uint uVar11; uint uVar12; byte *local_18; byte *local_14; byte *local_10; byte *local_c; uint local_8; pbVar9 = (byte *)*param_4; local_8 = param_4[1]; local_10 = *(byte **)(param_3 + 0x34); uVar11 = *(uint *)(param_3 + 0x20); uVar12 = *(uint *)(param_3 + 0x1c); if (local_10 < *(byte **)(param_3 + 0x30)) { local_c = *(byte **)(param_3 + 0x30) + (-1 - (int)local_10); } else { local_c = (byte *)(*(int *)(param_3 + 0x2c) - (int)local_10); } uVar7 = *(uint *)(&DAT_00b5f660 + in_ECX * 4); uVar8 = *(uint *)(&DAT_00b5f660 + in_EDX * 4); local_14 = pbVar9; while( true ) { if (uVar12 < 0x14) { do { bVar6 = *pbVar9; bVar5 = (byte)uVar12; uVar12 = uVar12 + 8; local_8 = local_8 - 1; pbVar9 = pbVar9 + 1; uVar11 = uVar11 | (uint)bVar6 << (bVar5 & 0x1f); } while (uVar12 < 0x14); local_14 = pbVar9; } local_18 = (byte *)(param_1 + (uVar7 & uVar11) * 8); bVar6 = *local_18; uVar1 = (uint)bVar6; uVar11 = uVar11 >> (local_18[1] & 0x1f); uVar12 = uVar12 - local_18[1]; if (uVar1 != 0) break; LAB_00adba59: *local_10 = local_18[4]; local_10 = local_10 + 1; local_c = local_c + -1; LAB_00adbc4a: if ((local_c < (byte *)0x102) || (local_8 < 10)) { uVar7 = uVar12 >> 3; if (param_4[1] - local_8 <= uVar12 >> 3) { uVar7 = param_4[1] - local_8; } *(uint *)(param_3 + 0x20) = uVar11; *(uint *)(param_3 + 0x1c) = uVar12 + uVar7 * -8; param_4[1] = local_8 + uVar7; param_4[2] = param_4[2] + (((int)pbVar9 - uVar7) - *param_4); *param_4 = (int)pbVar9 - uVar7; *(byte **)(param_3 + 0x34) = local_10; return 0; } } joined_r0x00adba70: if ((bVar6 & 0x10) == 0) goto LAB_00adba72; uVar1 = uVar1 & 0xf; uVar2 = (*(uint *)(&DAT_00b5f660 + uVar1 * 4) & uVar11) + *(int *)(local_18 + 4); uVar12 = uVar12 - uVar1; uVar11 = uVar11 >> (sbyte)uVar1; if (uVar12 < 0xf) { do { bVar6 = *pbVar9; bVar5 = (byte)uVar12; uVar12 = uVar12 + 8; local_8 = local_8 - 1; pbVar9 = pbVar9 + 1; uVar11 = uVar11 | (uint)bVar6 << (bVar5 & 0x1f); } while (uVar12 < 0xf); local_14 = pbVar9; } pbVar4 = (byte *)(param_2 + (uVar8 & uVar11) * 8); uVar1 = uVar11 >> (pbVar4[1] & 0x1f); uVar12 = uVar12 - pbVar4[1]; bVar6 = *pbVar4; while ((bVar6 & 0x10) == 0) { if ((bVar6 & 0x40) != 0) { param_4[6] = (int)"invalid distance code"; uVar11 = uVar12 >> 3; if (param_4[1] - local_8 <= uVar12 >> 3) { uVar11 = param_4[1] - local_8; } *(uint *)(param_3 + 0x20) = uVar1; *(uint *)(param_3 + 0x1c) = uVar12 + uVar11 * -8; param_4[1] = local_8 + uVar11; param_4[2] = param_4[2] + (((int)pbVar9 - uVar11) - *param_4); *param_4 = (int)pbVar9 - uVar11; *(byte **)(param_3 + 0x34) = local_10; return 0xfffffffd; } pbVar4 = pbVar4 + ((*(uint *)(&DAT_00b5f660 + (uint)bVar6 * 4) & uVar1) + *(int *)(pbVar4 + 4)) * 8; uVar1 = uVar1 >> (pbVar4[1] & 0x1f); uVar12 = uVar12 - pbVar4[1]; bVar6 = *pbVar4; } uVar3 = bVar6 & 0xf; if (uVar12 < uVar3) { do { bVar6 = (byte)uVar12; uVar12 = uVar12 + 8; uVar1 = uVar1 | (uint)*pbVar9 << (bVar6 & 0x1f); local_8 = local_8 - 1; pbVar9 = pbVar9 + 1; } while (uVar12 < uVar3); local_14 = pbVar9; } uVar12 = uVar12 - uVar3; local_c = local_c + -uVar2; uVar11 = uVar1 >> (sbyte)uVar3; pbVar9 = local_10 + -((*(uint *)(&DAT_00b5f660 + uVar3 * 4) & uVar1) + *(int *)(pbVar4 + 4)); if (pbVar9 < *(byte **)(param_3 + 0x28)) { do { pbVar9 = pbVar9 + (*(int *)(param_3 + 0x2c) - *(int *)(param_3 + 0x28)); } while (pbVar9 < *(byte **)(param_3 + 0x28)); uVar1 = *(int *)(param_3 + 0x2c) - (int)pbVar9; if (uVar1 < uVar2) { iVar10 = uVar2 - uVar1; do { bVar6 = *pbVar9; pbVar9 = pbVar9 + 1; *local_10 = bVar6; local_10 = local_10 + 1; uVar1 = uVar1 - 1; } while (uVar1 != 0); pbVar9 = *(byte **)(param_3 + 0x28); do { bVar6 = *pbVar9; pbVar9 = pbVar9 + 1; *local_10 = bVar6; local_10 = local_10 + 1; iVar10 = iVar10 + -1; } while (iVar10 != 0); } else { *local_10 = *pbVar9; pbVar4 = pbVar9 + 2; local_10[1] = pbVar9[1]; local_10 = local_10 + 2; iVar10 = uVar2 - 2; do { bVar6 = *pbVar4; pbVar4 = pbVar4 + 1; *local_10 = bVar6; local_10 = local_10 + 1; iVar10 = iVar10 + -1; } while (iVar10 != 0); } } else { *local_10 = *pbVar9; pbVar4 = pbVar9 + 2; local_10[1] = pbVar9[1]; local_10 = local_10 + 2; iVar10 = uVar2 - 2; do { bVar6 = *pbVar4; pbVar4 = pbVar4 + 1; *local_10 = bVar6; local_10 = local_10 + 1; iVar10 = iVar10 + -1; } while (iVar10 != 0); } pbVar9 = local_14; goto LAB_00adbc4a; LAB_00adba72: if ((uVar1 & 0x40) != 0) { uVar8 = uVar12 >> 3; uVar7 = param_4[1] - local_8; if ((uVar1 & 0x20) == 0) { param_4[6] = (int)"invalid literal/length code"; *(uint *)(param_3 + 0x20) = uVar11; if (uVar7 <= uVar8) { uVar8 = uVar7; } *(uint *)(param_3 + 0x1c) = uVar12 + uVar8 * -8; param_4[1] = uVar8 + local_8; param_4[2] = param_4[2] + (((int)local_14 - uVar8) - *param_4); *param_4 = (int)local_14 - uVar8; *(byte **)(param_3 + 0x34) = local_10; return 0xfffffffd; } *(uint *)(param_3 + 0x20) = uVar11; if (uVar7 <= uVar8) { uVar8 = uVar7; } *(uint *)(param_3 + 0x1c) = uVar12 + uVar8 * -8; param_4[1] = uVar8 + local_8; param_4[2] = param_4[2] + (((int)local_14 - uVar8) - *param_4); *param_4 = (int)local_14 - uVar8; *(byte **)(param_3 + 0x34) = local_10; return 1; } local_18 = local_18 + ((*(uint *)(&DAT_00b5f660 + uVar1 * 4) & uVar11) + *(int *)(local_18 + 4)) * 8; bVar6 = *local_18; uVar1 = (uint)bVar6; uVar11 = uVar11 >> (local_18[1] & 0x1f); uVar12 = uVar12 - local_18[1]; if (uVar1 == 0) goto LAB_00adba59; goto joined_r0x00adba70; } //@@ 00adbdb0 FUN_00adbdb0 void FUN_00adbdb0(int param_1) { if (param_1 == 0) { return; } /* WARNING: Could not recover jumptable at 0x00adbdc5. Too many branches */ /* WARNING: Treating indirect jump as call */ free((void *)((param_1 + -1) - (uint)*(byte *)(param_1 + -1))); return; } //@@ 00adbdd0 FUN_00adbdd0 undefined1 * FUN_00adbdd0(uint param_1,uint param_2) { void *pvVar1; undefined1 *puVar2; uint uVar3; if ((((param_2 - 1 < 0x100) && ((param_2 & param_2 - 1) == 0)) && (param_1 <= ~param_2)) && (pvVar1 = malloc(param_1 + param_2), pvVar1 != (void *)0x0)) { uVar3 = (int)pvVar1 - 1U & param_2 - 1; puVar2 = (undefined1 *)((int)pvVar1 + uVar3); *puVar2 = (char)uVar3; return puVar2 + 1; } return (undefined1 *)0x0; } //@@ 00adbe20 FUN_00adbe20 int FUN_00adbe20(uint param_1) { int iVar1; iVar1 = 0; for (; param_1 != 0; param_1 = param_1 >> 1) { iVar1 = iVar1 + 1; } return iVar1; } //@@ 00adbe40 oc_ycbcr_buffer_flip /* DB: libtheora: copies 3 th_img_plane entries (width,height,stride,data) negating the stride and pointing data at the last row (data + (1-height)*stride); callers th_decode_packetin and other decoder setup prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl oc_ycbcr_buffer_flip(void *dst,void *src) { int iVar1; int iVar2; *(undefined4 *)dst = *(undefined4 *)src; iVar1 = *(int *)((int)src + 4); *(int *)((int)dst + 4) = iVar1; iVar2 = *(int *)((int)src + 8); *(int *)((int)dst + 8) = -iVar2; *(int *)((int)dst + 0xc) = (1 - iVar1) * -iVar2 + *(int *)((int)src + 0xc); *(undefined4 *)((int)dst + 0x10) = *(undefined4 *)((int)src + 0x10); iVar1 = *(int *)((int)src + 0x14); *(int *)((int)dst + 0x14) = iVar1; iVar2 = *(int *)((int)src + 0x18); *(int *)((int)dst + 0x18) = -iVar2; *(int *)((int)dst + 0x1c) = (1 - iVar1) * -iVar2 + *(int *)((int)src + 0x1c); *(undefined4 *)((int)dst + 0x20) = *(undefined4 *)((int)src + 0x20); iVar1 = *(int *)((int)src + 0x24); *(int *)((int)dst + 0x24) = iVar1; iVar2 = *(int *)((int)src + 0x28); *(int *)((int)dst + 0x28) = -iVar2; *(int *)((int)dst + 0x2c) = (1 - iVar1) * -iVar2 + *(int *)((int)src + 0x2c); return; } //@@ 00adbec0 FUN_00adbec0 char * FUN_00adbec0(void) { return "Xiph.Org libtheora 1.2.0alpha 20100924 (Ptalarbvorm)"; } //@@ 00adbed0 oc_dec_ac_coeff_unpack /* DB: libtheora: (dec, zzi, huff_idxs, ntoks_left, eobs): for each zig-zag index from arg2 to 63 records token start/eob run (dec+0xcb38), decodes tokens with oc_huff_token_decode using the selected Huffman table (dec+0xc9f8), stores them in the token buffer (dec+0xd138) and handles EOB runs / extra bits; called from th_decode_packetin */ uint oc_dec_ac_coeff_unpack(int param_1,int param_2,int param_3,int param_4,uint param_5) { char cVar1; int iVar2; int iVar3; uint uVar4; char cVar5; int iVar6; int iVar7; int iVar8; int *piVar9; int iVar10; int local_12c [64]; int local_2c; int *local_28; int local_24; uint *local_20; int *local_1c; uint local_18; int local_14; void *local_10; int local_c; int local_8; local_24 = *(int *)(param_1 + 0xd138); local_2c = 0x40 - param_2; iVar10 = *(int *)(param_1 + 0xd140); local_1c = (int *)(param_1 + param_2 * 4 + 0xcb38); local_8 = 0; local_20 = (uint *)(param_4 + param_2 * 4); local_c = 0; do { local_1c[0xc0] = param_5; *local_1c = iVar10; uVar4 = *local_20; local_18 = uVar4; memset(local_12c,0,0x100); iVar6 = 0; iVar8 = 0; if (param_5 < uVar4) { local_28 = (int *)(param_3 + (local_8 + 1 >> 1) * 4); local_10 = (void *)(param_1 + 0xc9e4); local_14 = 0; iVar8 = iVar10; do { iVar6 = iVar6 + param_5; local_14 = local_14 + param_5; iVar2 = oc_huff_token_decode(local_10,*(short **)(param_1 + 0xc9f8 + *local_28 * 4)); iVar7 = local_24; *(char *)(iVar8 + local_24) = (char)iVar2; iVar10 = iVar8 + 1; if (iVar2 < 0xf) { iVar3 = FUN_00ae25e0(local_10,(&DAT_00b1904c)[iVar2]); *(char *)(iVar10 + iVar7) = (char)iVar3; iVar10 = iVar8 + 2; if (iVar2 == 0) { *(char *)(iVar10 + iVar7) = (char)((uint)iVar3 >> 8); iVar10 = iVar8 + 3; } cVar5 = '\0'; if (iVar2 < 0xc) { cVar5 = '\x15'; } cVar1 = '\0'; if (iVar2 < 2) { cVar1 = -0xd; } iVar3 = iVar3 << (cVar5 + cVar1 & 0x1fU); } else { iVar3 = 0; } uVar4 = *(int *)(&DAT_00b19060 + iVar2 * 4) + iVar3; param_5 = (int)uVar4 >> 8 & 0xfff; if (uVar4 == 0) { param_5 = 0x7fffffff; } else if (param_5 == 0) { local_12c[uVar4 & 0xff] = local_12c[uVar4 & 0xff] + 1; iVar6 = iVar6 + 1; } iVar8 = iVar10; } while (iVar6 + param_5 < local_18); iVar8 = local_14; uVar4 = local_18; } param_5 = param_5 + (iVar6 - uVar4); iVar7 = 0x3f; local_12c[0x3f] = local_12c[0x3f] + (iVar8 - iVar6) + uVar4; do { piVar9 = local_12c + iVar7; iVar7 = iVar7 + -1; local_12c[iVar7] = local_12c[iVar7] + *piVar9; } while (0 < iVar7); if (0 < local_2c) { piVar9 = (int *)(param_4 + local_c * 4 + 0x100); iVar8 = local_2c; do { piVar9 = piVar9 + -1; *piVar9 = *piVar9 - local_12c[iVar8 + -1]; iVar8 = iVar8 + -1; } while (0 < iVar8); } local_c = local_c + 0x40; local_1c = local_1c + 0x40; local_8 = local_8 + 1; local_20 = local_20 + 0x40; } while (local_c < 0xc0); *(int *)(param_1 + 0xd140) = iVar10; return param_5; } //@@ 00adc0e0 oc_dec_coded_flags_unpack /* DB: ? libtheora: reads the first bit (oc_pack_read1) then run lengths with the superblock run tree (oc_huff_token_decode 00ae2740 oc_huff_token_decode DAT_00b18e08, long runs extended via oc_pack_read FUN_00ae25e0) to set the partially-coded bit in sb_flags (+0xe4, nsbs +0xe8), then the coded superblock/block flags; called from th_decode_packetin */ void oc_dec_coded_flags_unpack(int param_1) { byte bVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; uint uVar8; int iVar9; int *piVar10; uint uVar11; int iVar12; uint uVar13; uint uVar14; int *piVar15; byte *pbVar16; int local_3c; int local_38; int local_30; uint local_28; int local_24; uint local_20; uint local_1c; uint local_18; uint local_14; byte *local_10; uint local_c; uint local_8; local_c = FUN_00ae25a0(param_1 + 0xc9e4); uVar13 = 0; local_8 = 0; uVar14 = *(uint *)(param_1 + 0xe8); local_10 = *(byte **)(param_1 + 0xe4); uVar11 = 0; if (uVar14 != 0) { do { local_28 = oc_huff_token_decode((void *)(param_1 + 0xc9e4),(short *)&DAT_00b18e08); if (0xf < (int)local_28) { iVar7 = FUN_00ae25e0(param_1 + 0xc9e4,(int)(local_28 - (local_28 & 0x1f)) >> 4); local_28 = iVar7 + 6 + (local_28 & 0x1f); } uVar11 = local_28; do { local_10[uVar13] = local_10[uVar13] & 0xfc | ((byte)local_c & 1) * '\x02'; uVar13 = uVar13 + 1; local_8 = local_8 + local_c; uVar11 = uVar11 - 1; if (uVar11 == 0) break; } while (uVar13 < uVar14); if ((local_28 < 0x1021) || (uVar14 <= uVar13)) { local_c = (uint)(local_c == 0); } else { local_c = FUN_00ae25a0(param_1 + 0xc9e4); } } while (uVar13 < uVar14); local_10 = *(byte **)(param_1 + 0xe4); uVar11 = *(uint *)(param_1 + 0xe8); } if (local_8 < uVar11) { uVar14 = 0; bVar1 = *local_10; while ((bVar1 & 2) != 0) { uVar14 = uVar14 + 1; bVar1 = local_10[uVar14]; } local_c = FUN_00ae25a0(param_1 + 0xc9e4); do { uVar13 = oc_huff_token_decode((void *)(param_1 + 0xc9e4),(short *)&DAT_00b18e08); local_28 = uVar13; if (0xf < (int)uVar13) { iVar7 = FUN_00ae25e0(param_1 + 0xc9e4,(int)(uVar13 - (uVar13 & 0x1f)) >> 4); uVar13 = iVar7 + 6 + (uVar13 & 0x1f); local_28 = uVar13; } for (; uVar14 < uVar11; uVar14 = uVar14 + 1) { bVar1 = local_10[uVar14]; uVar8 = uVar13; if ((bVar1 & 2) == 0) { uVar8 = uVar13 - 1; if (uVar13 == 0) break; local_10[uVar14] = (bVar1 ^ (byte)local_c) & 1 ^ bVar1; } uVar13 = uVar8; } if ((local_28 < 0x1021) || (uVar11 <= uVar14)) { local_c = (uint)(local_c == 0); } else { local_c = FUN_00ae25a0(param_1 + 0xc9e4); } } while (uVar14 < uVar11); } if (local_8 == 0) { local_8 = 0; } else { iVar7 = FUN_00ae25a0(param_1 + 0xc9e4); local_8 = (uint)(iVar7 == 0); } iVar7 = *(int *)(param_1 + 0xe0); iVar9 = 0; iVar2 = *(int *)(param_1 + 0x100); iVar3 = *(int *)(param_1 + 0xe4); iVar4 = *(int *)(param_1 + 0xf0); iVar5 = *(int *)(param_1 + 0xd0); iVar6 = *(int *)(param_1 + 0xdc); local_30 = 0; local_20 = 0; local_c = 0; local_10 = (byte *)0x0; local_24 = 0; local_3c = 0; local_28 = 0; do { local_20 = local_20 + *(int *)(local_28 * 0x20 + 0x8c + param_1); iVar12 = local_3c; pbVar16 = local_10; if (local_c < local_20) { do { local_18 = 0; local_1c = 1; do { if ((*(byte *)(local_c + iVar3) >> 2 & local_1c & 0xf) != 0) { local_14 = 0; piVar10 = (int *)(iVar2 + iVar6 * 4 + (int)pbVar16 * -4); piVar15 = (int *)((local_18 + local_c * 4) * 0x10 + iVar7); local_38 = 4; do { iVar12 = *piVar15; if (-1 < iVar12) { bVar1 = *(byte *)(local_c + iVar3); if ((bVar1 & 1) == 0) { if ((bVar1 & 2) == 0) { uVar14 = 0; } else { if (iVar9 < 1) { iVar9 = oc_huff_token_decode ((void *)(param_1 + 0xc9e4),(short *)&DAT_00b18e68); local_8 = (uint)(local_8 == 0); } iVar9 = iVar9 + -1; uVar14 = local_8; local_30 = iVar9; if (local_8 != 0) goto LAB_00adc4a8; } local_10 = (byte *)((int)local_10 + 1); piVar10 = piVar10 + -1; *piVar10 = iVar12; } else { uVar14 = 1; LAB_00adc4a8: *(int *)(iVar2 + local_24 * 4) = iVar12; local_24 = local_24 + 1; iVar9 = local_30; } local_14 = local_14 | uVar14; *(uint *)(iVar5 + iVar12 * 4) = *(uint *)(iVar5 + iVar12 * 4) & 0xfffffffe | uVar14 | 0xc0; } piVar15 = piVar15 + 1; local_38 = local_38 + -1; } while (local_38 != 0); pbVar16 = local_10; if (local_28 == 0) { *(char *)((local_c << 2 | local_18) + iVar4) = (char)local_14; } } local_18 = local_18 + 1; local_1c = local_1c << 1 | (uint)((int)local_1c < 0); } while ((int)local_18 < 4); local_c = local_c + 1; } while (local_c < local_20); iVar12 = local_24; } *(int *)(param_1 + 0x104 + local_28 * 4) = iVar12 - local_3c; local_28 = local_28 + 1; local_3c = iVar12; if (2 < (int)local_28) { *(int *)(param_1 + 0x110) = iVar12; return; } } while( true ); } //@@ 00adc4c0 oc_dec_residual_tokens_unpack /* DB: ? libtheora: per plane (+0x104 counts) clears the 64-entry token/eob table, zeroes uncoded fragment DC, and decodes tokens with the Huffman decoder FUN_00ae2740 (tables +0xc9f8); only caller th_decode_packetin */ int oc_dec_residual_tokens_unpack(int param_1,int param_2,int *param_3) { char cVar1; int iVar2; char cVar3; short sVar4; int iVar5; uint uVar6; int *piVar7; int iVar8; int iVar9; int iVar10; uint uVar11; int local_138 [64]; int *local_38; int *local_34; void *local_30; int local_2c; int *local_28; int *local_24; int local_20; int local_1c; int local_18; int local_14; int local_10; int local_c; int local_8; local_c = 0; local_2c = *(int *)(param_1 + 0xd138); iVar8 = 0; iVar10 = 0; local_18 = *(int *)(param_1 + 0xd0); iVar9 = 0; local_14 = *(int *)(param_1 + 0x100); local_8 = 0; local_24 = (int *)(param_1 + 0xcb38); local_34 = (int *)(param_1 + 0x104); local_20 = 0; do { local_28 = param_3 + 0x40; local_c = local_c + *local_34; memset(local_138,0,0x100); local_24[0xc0] = iVar10; *local_24 = iVar8; iVar5 = local_c - iVar9; if (iVar10 <= local_c - iVar9) { iVar5 = iVar10; } iVar10 = iVar10 - iVar5; local_1c = iVar5; local_10 = iVar10; if (0 < iVar5) { do { iVar8 = iVar9 * 4; iVar5 = iVar5 + -1; iVar9 = iVar9 + 1; *(undefined2 *)(local_18 + 2 + *(int *)(local_14 + iVar8) * 4) = 0; } while (0 < iVar5); iVar8 = local_8; } if (iVar9 < local_c) { local_38 = (int *)(param_2 + (local_20 + 1 >> 1) * 4); local_30 = (void *)(param_1 + 0xc9e4); do { iVar8 = oc_huff_token_decode(local_30,*(short **)(param_1 + 0xc9f8 + *local_38 * 4)); iVar10 = local_8; *(char *)(local_8 + local_2c) = (char)iVar8; iVar5 = local_8 + 1; local_8 = iVar5; if (iVar8 < 0xf) { iVar2 = FUN_00ae25e0(local_30,(&DAT_00b1904c)[iVar8]); *(char *)(iVar5 + local_2c) = (char)iVar2; local_8 = iVar10 + 2; if (iVar8 == 0) { *(char *)(local_8 + local_2c) = (char)((uint)iVar2 >> 8); local_8 = iVar10 + 3; } cVar3 = '\0'; if (iVar8 < 0xc) { cVar3 = '\x15'; } cVar1 = '\0'; if (iVar8 < 2) { cVar1 = -0xd; } iVar2 = iVar2 << (cVar3 + cVar1 & 0x1fU); } else { iVar2 = 0; } uVar6 = *(int *)(&DAT_00b19060 + iVar8 * 4) + iVar2; uVar11 = (int)uVar6 >> 8 & 0xfff; if (uVar6 == 0) { uVar11 = 0x7fffffff; LAB_00adc638: iVar8 = 0; if (local_c - iVar9 < (int)uVar11) { iVar8 = (local_c - uVar11) - iVar9; } iVar8 = iVar8 + uVar11; local_1c = local_1c + iVar8; iVar10 = uVar11 - iVar8; local_10 = iVar10; if (0 < iVar8) { do { iVar5 = iVar9 * 4; iVar8 = iVar8 + -1; iVar9 = iVar9 + 1; *(undefined2 *)(local_18 + 2 + *(int *)(local_14 + iVar5) * 4) = 0; } while (0 < iVar8); } } else { if (uVar11 != 0) goto LAB_00adc638; local_138[uVar6 & 0xff] = local_138[uVar6 & 0xff] + 1; sVar4 = 0; if ((uVar6 & 0xff) == 0) { sVar4 = (short)((ushort)(-(uVar6 & 0x100000) >> 0x10) ^ (ushort)(uVar6 >> 0x10)) >> 5; } iVar10 = iVar9 * 4; iVar9 = iVar9 + 1; *(short *)(local_18 + 2 + *(int *)(local_14 + iVar10) * 4) = sVar4; iVar10 = 0; } } while (iVar9 < local_c); iVar8 = local_8; } iVar5 = 0x3f; local_138[0x3f] = local_138[0x3f] + local_1c; do { piVar7 = local_138 + iVar5; iVar5 = iVar5 + -1; local_138[iVar5] = local_138[iVar5] + *piVar7; } while (0 < iVar5); iVar5 = 0x40; piVar7 = local_28; do { piVar7 = piVar7 + -1; *piVar7 = *piVar7 - local_138[iVar5 + -1]; iVar5 = iVar5 + -1; } while (0 < iVar5); local_20 = local_20 + 1; local_24 = local_24 + 0x40; local_34 = local_34 + 1; param_3 = local_28; if (2 < local_20) { *(int *)(param_1 + 0xd140) = iVar8; return iVar10; } } while( true ); } //@@ 00adc740 oc_dec_dc_unpredict_mcu_plane /* DB: libtheora: (dec, pipe, pli): walks fragment rows pipe->fragy0[pli] (+0xb78) .. fragy_end (+0xb84) undoing DC prediction from neighbours, then stores pipe->ncoded_fragis[pli] (+0xb18) and nuncoded_fragis (+0xb24); called from th_decode_packetin */ void oc_dec_dc_unpredict_mcu_plane(int param_1,int param_2,int param_3) { int *piVar1; short sVar2; short sVar3; int iVar4; int iVar5; int iVar6; int iVar7; uint uVar8; uint *puVar9; byte bVar10; byte bVar11; int iVar12; uint uVar13; int iVar14; byte bVar15; int iVar16; int iVar17; int iVar18; uint uVar19; int iVar20; int iVar21; uint uVar22; int iVar23; uint uVar24; uint local_30; uint local_28; uint local_24; int local_14; int *local_8; iVar4 = *(int *)(param_2 + 0xb78 + param_3 * 4); iVar5 = *(int *)(param_3 * 0x20 + 0x70 + param_1); iVar6 = *(int *)(param_2 + 0xb84 + param_3 * 4); iVar20 = 0; iVar16 = (param_3 + 0xb9) * 0x10 + param_2; iVar7 = *(int *)(param_1 + 0xd0); local_14 = 0; iVar21 = iVar5 * iVar4 + *(int *)(param_3 * 0x20 + 0x78 + param_1); iVar14 = iVar4; do { if (iVar6 <= iVar14) { *(int *)(param_2 + 0xb18 + param_3 * 4) = iVar20; *(int *)(param_2 + 0xb24 + param_3 * 4) = (iVar6 - iVar4) * iVar5 - iVar20; return; } if (iVar14 == 0) { iVar23 = iVar5; if (0 < iVar5) { do { uVar24 = *(uint *)(iVar7 + iVar21 * 4); if ((uVar24 & 1) != 0) { piVar1 = (int *)(iVar16 + (uVar24 >> 6 & 3) * 4); iVar12 = *piVar1 * 0x10000 + uVar24; *(int *)(iVar7 + iVar21 * 4) = iVar12; iVar20 = iVar20 + 1; *piVar1 = iVar12 >> 0x10; } iVar21 = iVar21 + 1; iVar23 = iVar23 + -1; local_14 = iVar20; } while (iVar23 != 0); } } else { local_24 = 0xffffffff; iVar17 = iVar7 + iVar5 * -4; local_30 = 0xffffffff; iVar23 = iVar21 * 4; iVar12 = iVar21 * 4; iVar18 = 0; if (0 < iVar5) { iVar20 = iVar21 * 4; iVar21 = iVar21 + iVar5; puVar9 = (uint *)(iVar17 + iVar12); local_28 = *(uint *)(iVar17 + iVar23) >> 6 & 3; local_8 = (int *)(iVar7 + iVar20 + -4); do { iVar18 = iVar18 + 1; if (iVar18 < iVar5) { uVar24 = puVar9[1] >> 6 & 3; } else { uVar24 = 0xffffffff; } uVar8 = local_8[1]; if ((uVar8 & 1) == 0) { local_24 = 0xffffffff; goto LAB_00adc9fa; } uVar22 = uVar8 >> 6 & 3; bVar15 = 0; if (uVar24 == uVar22) { bVar15 = 8; } bVar10 = 0; if (local_28 == uVar22) { bVar10 = 4; } bVar11 = 0; if (local_30 == uVar22) { bVar11 = 2; } switch(bVar15 | bVar10 | bVar11 | local_24 == uVar22) { case 1: case 3: iVar20 = (int)*(short *)((int)local_8 + 2); break; case 2: iVar20 = (int)*(short *)((int)puVar9 + -2); break; case 4: case 6: case 0xc: iVar20 = (int)*(short *)((int)puVar9 + 2); break; case 5: sVar3 = *(short *)((int)puVar9 + 2); sVar2 = *(short *)((int)local_8 + 2); goto LAB_00adc8eb; case 7: case 0xf: iVar23 = (int)*(short *)((int)local_8 + 2); iVar20 = (iVar23 + *(short *)((int)puVar9 + 2)) * 0x1d + *(short *)((int)puVar9 + -2) * -0x1a; iVar20 = (int)((iVar20 >> 0x1f & 0x1fU) + iVar20) >> 5; uVar13 = iVar20 - *(short *)((int)puVar9 + 2); uVar19 = (int)uVar13 >> 0x1f; if ((int)((uVar13 ^ uVar19) - uVar19) < 0x81) { uVar13 = iVar20 - iVar23 >> 0x1f; if ((int)((iVar20 - iVar23 ^ uVar13) - uVar13) < 0x81) { uVar13 = iVar20 - *(short *)((int)puVar9 + -2); uVar19 = (int)uVar13 >> 0x1f; if (0x80 < (int)((uVar13 ^ uVar19) - uVar19)) { iVar20 = (int)*(short *)((int)puVar9 + -2); } } else { iVar20 = iVar23; } } else { iVar20 = (int)*(short *)((int)puVar9 + 2); } break; case 8: iVar20 = (int)*(short *)((int)puVar9 + 6); break; case 9: case 0xb: case 0xd: iVar20 = *(short *)((int)puVar9 + 6) * 0x35 + *(short *)((int)local_8 + 2) * 0x4b; iVar20 = (int)((iVar20 >> 0x1f & 0x7fU) + iVar20) >> 7; break; case 10: sVar2 = *(short *)((int)puVar9 + -2); sVar3 = *(short *)((int)puVar9 + 6); LAB_00adc8eb: iVar20 = ((int)sVar2 + (int)sVar3) / 2; break; case 0xe: iVar20 = ((int)*(short *)((int)puVar9 + -2) + (int)*(short *)((int)puVar9 + 6)) * 3 + *(short *)((int)puVar9 + 2) * 10; iVar20 = (int)((iVar20 >> 0x1f & 0xfU) + iVar20) >> 4; break; default: iVar20 = *(int *)(iVar16 + uVar22 * 4); } iVar20 = iVar20 * 0x10000 + uVar8; local_8[1] = iVar20; local_14 = local_14 + 1; *(int *)(iVar16 + uVar22 * 4) = iVar20 >> 0x10; local_24 = uVar22; LAB_00adc9fa: local_30 = local_28; iVar20 = local_14; puVar9 = puVar9 + 1; local_28 = uVar24; local_8 = local_8 + 1; } while (iVar18 < iVar5); } } iVar14 = iVar14 + 1; } while( true ); } //@@ 00adcaa0 oc_dec_deblock_frag_rows /* DB: ? libtheora: 6 args (dec, dst, src, pli, fragy0, fragy_end): zeroes the per-fragment variance array (dec+0xd34c) for the row range, memcpy's the edge rows from src to dst buffers and runs the deblocking filter over 8-row strips; called from th_decode_packetin post-processing */ void oc_dec_deblock_frag_rows (int param_1,int param_2,byte *param_3,int param_4,int param_5,int param_6) { size_t *psVar1; uint uVar2; int iVar3; size_t sVar4; size_t _Size; int iVar5; int iVar6; uint uVar7; void *_Src; void *_Dst; int iVar8; int local_28; int local_24; int local_20; int local_14; void *local_8; psVar1 = (size_t *)(param_2 + param_4 * 0x10); iVar6 = param_4 * 0x20 + param_1; iVar8 = (int)param_3 + param_4 * 0x10; uVar2 = *(uint *)(iVar6 + 0x70); iVar5 = uVar2 * param_5 + *(int *)(iVar6 + 0x78); iVar3 = *(int *)(iVar6 + 0x74); param_4 = *(int *)(param_1 + 0xd34c) + iVar5 * 4; param_3 = (byte *)(*(int *)(param_1 + 0xd348) + iVar5); uVar7 = (uint)(0 < param_5); memset((void *)(param_4 + (-uVar7 & uVar2) * 4),0, ((((param_6 < iVar3) - uVar7) - param_5) + param_6) * uVar2 * 4); iVar6 = uVar7 + param_5 * 2; iVar5 = *(int *)(iVar8 + 8); local_14 = iVar6 * 4; sVar4 = psVar1[2]; _Src = (void *)(iVar5 * local_14 + *(int *)(iVar8 + 0xc)); _Dst = (void *)(sVar4 * local_14 + psVar1[3]); _Size = *psVar1; local_8 = _Src; if (local_14 < 4) { local_14 = 4; local_8 = (void *)(iVar6 * -4 + 4); do { memcpy(_Dst,_Src,_Size); _Dst = (void *)((int)_Dst + sVar4); _Src = (void *)((int)_Src + iVar5); local_8 = (void *)((int)local_8 + -1); } while (local_8 != (void *)0x0); local_8 = _Src; } iVar6 = (param_6 - (uint)(iVar3 <= param_6)) * 8; if (local_14 < iVar6) { local_28 = ((iVar6 - local_14) - 1U >> 3) + 1; local_14 = local_14 + local_28 * 8; do { iVar6 = *(int *)(param_1 + 0xd148 + (uint)*param_3 * 4); oc_filter_hedge(_Dst,sVar4,(int)local_8 - iVar5,iVar5,iVar6,iVar6 * 3 >> 2,param_4, param_4 + uVar2 * 4); param_4 = param_4 + 4; local_20 = 8; param_3 = param_3 + 1; if (8 < (int)_Size) { local_24 = (int)_Dst + sVar4 * -4 + 4; do { iVar6 = *(int *)(param_1 + 0xd148 + (uint)*param_3 * 4); iVar8 = iVar6 * 3 >> 2; oc_filter_hedge(local_20 + (int)_Dst,sVar4,((int)local_8 - iVar5) + local_20,iVar5,iVar6, iVar8,param_4,param_4 + uVar2 * 4); oc_filter_vedge(local_24,sVar4,iVar6,iVar8,param_4 + -4); local_24 = local_24 + 8; local_20 = local_20 + 8; param_4 = param_4 + 4; param_3 = param_3 + 1; } while (local_20 < (int)_Size); } _Dst = (void *)((int)_Dst + sVar4 * 8); local_8 = (void *)((int)local_8 + iVar5 * 8); local_28 = local_28 + -1; } while (local_28 != 0); } if (iVar3 <= param_6) { if (local_14 < (int)psVar1[1]) { param_2 = psVar1[1] - local_14; do { memcpy(_Dst,local_8,_Size); local_8 = (void *)((int)local_8 + iVar5); _Dst = (void *)((int)_Dst + sVar4); param_2 = param_2 + -1; } while (param_2 != 0); } if (8 < (int)_Size) { iVar6 = (int)_Dst + sVar4 * -8 + 4; param_2 = (_Size - 9 >> 3) + 1; do { param_3 = param_3 + 1; iVar3 = *(int *)(param_1 + 0xd148 + (uint)*param_3 * 4); oc_filter_vedge(iVar6,sVar4,iVar3,iVar3 * 3 >> 2,param_4); param_4 = param_4 + 4; iVar6 = iVar6 + 8; param_2 = param_2 + -1; } while (param_2 != 0); } } return; } //@@ 00adcd70 oc_dec_dering_frag_rows /* DB: libtheora: (dec, img, pli, fragy0, fragy_end) walks fragment rows using the pp variance buffer (+0xd34c) with thresholds 0x780/0xf00 (OC_DERING_THRESH3/THRESH4 for luma/chroma) and the pp level (+0xd144); only caller th_decode_packetin */ void oc_dec_dering_frag_rows(int param_1,int param_2,int param_3,uint *param_4,int param_5) { undefined4 *puVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; byte bVar8; int iVar9; int iVar10; int iVar11; undefined4 *puVar12; byte bVar13; int iVar14; uint uVar15; byte bVar16; byte bVar17; int *piVar18; int *piVar19; undefined4 uVar20; int local_24; int local_14; int local_10; int local_c; iVar2 = *(int *)(param_3 * 0x20 + 0x70 + param_1); piVar18 = (int *)(param_3 * 0x10 + param_2); iVar14 = (iVar2 * (int)param_4 + *(int *)(param_3 * 0x20 + 0x78 + param_1)) * 4; piVar19 = (int *)(*(int *)(param_1 + 0xd34c) + iVar14); iVar3 = piVar18[2]; iVar9 = 4; if (param_3 != 0) { iVar9 = 7; } iVar4 = *(int *)(param_1 + 0xd144); iVar10 = 0x780; if (param_3 != 0) { iVar10 = 0xf00; } local_24 = (int)param_4 * 8; local_c = iVar3 * local_24 + piVar18[3]; iVar11 = param_5 << 3; iVar5 = *piVar18; iVar6 = piVar18[1]; if (local_24 < iVar11) { local_10 = 8 - local_c; param_4 = (uint *)(*(int *)(param_1 + 0xd0) + iVar14); local_14 = local_24; do { local_14 = local_14 + 8; param_5 = 0; if (0 < iVar5) { bVar13 = 0; if (iVar6 <= local_14) { bVar13 = 8; } bVar8 = 0; if (local_24 < 1) { bVar8 = 4; } iVar14 = local_c; do { iVar7 = *piVar19; uVar15 = (uint)*(byte *)((*param_4 >> 2 & 0xf) + 0x393 + param_1); bVar16 = 0; if (iVar5 <= local_10 + iVar14) { bVar16 = 2; } bVar17 = bVar16 | param_5 < 1 | bVar13 | bVar8; if ((iVar4 < iVar9) || (iVar7 <= iVar10)) { if (iVar7 < 0x601) { if (iVar7 < 0x181) goto LAB_00adcfa3; uVar20 = 0; } else { uVar20 = 1; } oc_dering_block(iVar14,iVar3,bVar17,*(undefined4 *)(param_1 + 0xd148 + uVar15 * 4), *(undefined4 *)(param_1 + 0xd248 + uVar15 * 4),uVar20); } else { puVar1 = (undefined4 *)(param_1 + 0xd248 + uVar15 * 4); puVar12 = (undefined4 *)(param_1 + uVar15 * 4 + 0xd148); oc_dering_block(iVar14,iVar3,bVar17,*puVar12, *(undefined4 *)(param_1 + 0xd248 + uVar15 * 4),1); if ((((param_3 != 0) || ((param_5 >= 1 && (0xf00 < piVar19[-1])))) || ((bVar16 == 0 && (0xf00 < piVar19[1])))) || (((bVar8 == 0 && (0xf00 < piVar19[-iVar2])) || ((bVar13 == 0 && (0xf00 < piVar19[iVar2])))))) { oc_dering_block(iVar14,iVar3,bVar17,*puVar12,*puVar1,1); oc_dering_block(iVar14,iVar3,bVar17,*puVar12,*puVar1,1); } } LAB_00adcfa3: piVar19 = piVar19 + 1; param_4 = param_4 + 1; param_5 = param_5 + 8; iVar14 = iVar14 + 8; } while (param_5 < iVar5); } local_c = local_c + iVar3 * 8; local_24 = local_24 + 8; local_10 = local_10 + iVar3 * -8; } while (local_24 < iVar11); } return; } //@@ 00add000 oc_dec_frags_recon_mcu_plane /* DB: libtheora: for each coded fragment of plane arg3 in the pipeline (arg2: coded_fragis/ncoded_fragis, per-zzi eob_runs decremented, token indices into dec+0xd138), decodes tokens through the OC_DCT_TOKEN extra-bits table DAT_00b19060, dequantizes and reconstructs; called from th_decode_packetin */ void oc_dec_frags_recon_mcu_plane(int param_1,undefined2 *param_2,int param_3) { int *piVar1; uint *puVar2; byte *pbVar3; byte bVar4; int iVar5; int iVar6; int iVar7; int iVar8; uint uVar9; uint uVar10; int iVar11; int iVar12; int iVar13; int iVar14; int local_18; undefined2 local_14 [2]; uint local_10; int local_c; int local_8; iVar5 = *(int *)(param_1 + 0x68); iVar6 = *(int *)(param_1 + 0xd0); iVar12 = *(int *)(param_1 + 0xd138); piVar1 = (int *)(param_2 + (param_3 + 0x2c0) * 2); iVar11 = *piVar1; local_c = *(int *)(param_2 + param_3 * 2 + 0x58c); local_14[0] = **(undefined2 **)(param_2 + param_3 * 0xc + 0x598); local_18 = 0; local_14[1] = **(undefined2 **)(param_2 + param_3 * 0xc + 0x59a); local_8 = iVar12; if (0 < local_c) { do { iVar7 = *(int *)(iVar11 + local_18 * 4); puVar2 = (uint *)(iVar6 + iVar7 * 4); uVar10 = *puVar2; uVar9 = (uint)((uVar10 & 0x700) != 0x100); iVar8 = *(int *)(param_2 + (uVar9 + ((uVar10 >> 2 & 0xf) + param_3 * 3) * 2) * 2 + 0x598); iVar14 = 0; do { iVar13 = iVar14; uVar10 = *(uint *)(param_2 + (param_3 + 8) * 0x80 + iVar13 * 2); if (uVar10 != 0) { *(uint *)(param_2 + (param_3 + 8) * 0x80 + iVar13 * 2) = uVar10 - 1; break; } iVar14 = *(int *)(param_2 + (param_3 + 2) * 0x80 + iVar13 * 2); bVar4 = *(byte *)(iVar14 + iVar12); iVar12 = iVar14 + 1; local_10 = *(uint *)(&DAT_00b19060 + (uint)bVar4 * 4); if (bVar4 < 0xf) { local_10 = local_10 + ((uint)*(byte *)(iVar12 + local_8) << ((-(bVar4 < 0xc) & 0x15U) + (-(bVar4 < 2) & 0xf3U) & 0x1f)); iVar12 = iVar14 + 2; } uVar10 = (int)local_10 >> 8 & 0xfff; if (bVar4 == 0) { pbVar3 = (byte *)(iVar12 + local_8); iVar12 = iVar12 + 1; uVar10 = uVar10 + (uint)*pbVar3 * 0x100; if (uVar10 == 0) { uVar10 = 0x7fffffff; } } *(uint *)(param_2 + (param_3 + 8) * 0x80 + iVar13 * 2) = uVar10; *(int *)(param_2 + (param_3 + 2) * 0x80 + iVar13 * 2) = iVar12; iVar14 = iVar13 + (local_10 & 0xff); param_2[*(byte *)(iVar14 + iVar5)] = ((short)((ushort)(-(local_10 & 0x100000) >> 0x10) ^ (ushort)(local_10 >> 0x10)) >> 5) * *(short *)(iVar8 + iVar14 * 2); iVar14 = iVar14 + (uint)(uVar10 == 0); iVar12 = local_8; } while (iVar14 < 0x40); *param_2 = *(undefined2 *)((int)puVar2 + 2); (**(code **)(param_1 + 0x58))(param_1,iVar7,param_3,param_2,iVar13,local_14[uVar9]); local_18 = local_18 + 1; } while (local_18 < local_c); iVar11 = *piVar1; } *piVar1 = iVar11 + local_c * 4; iVar5 = *(int *)(param_2 + param_3 * 2 + 0x592); if (0 < iVar5) { *(int *)(param_2 + param_3 * 2 + 0x586) = *(int *)(param_2 + param_3 * 2 + 0x586) + iVar5 * -4; (**(code **)(param_1 + 0x44)) (*(undefined4 *)(param_1 + 0x254),*(undefined4 *)(param_1 + 0x250), *(undefined4 *)(param_1 + 0x268 + param_3 * 4), *(undefined4 *)(param_2 + param_3 * 2 + 0x586),iVar5,*(undefined4 *)(param_1 + 0xd4)) ; } return; } //@@ 00add260 oc_dec_init /* DB: libtheora decode.c: oc_state_init(dec,info,3) (0xae19b0), oc_huff_trees_copy(dec+0xc9f8, setup) and oc_state_clear (0xae1100) on failure; only caller FUN_00ade980 (th_decode_alloc) */ int oc_dec_init(int param_1,undefined4 param_2,int param_3) { int iVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; int iVar7; void *pvVar8; int *piVar9; int iVar10; int local_18; int *local_14; int *local_10; int local_c; int *local_8; iVar7 = FUN_00ae19b0(param_1,param_2,3); if (-1 < iVar7) { iVar7 = FUN_00ae2b00(param_1 + 0xc9f8,param_3); if (iVar7 < 0) { FUN_00ae1100(param_1); return iVar7; } pvVar8 = malloc(*(int *)(param_1 + 0xdc) * 0x81); *(void **)(param_1 + 0xd138) = pvVar8; if (pvVar8 == (void *)0x0) { FUN_00ae2ad0(param_1 + 0xc9f8); FUN_00ae1100(param_1); return -1; } iVar10 = 0x40; iVar7 = param_1 + 0xa20; piVar9 = (int *)(param_1 + 0x39c); do { *piVar9 = iVar7; piVar9[-1] = iVar7 + -0x80; piVar9[1] = iVar7 + 0x80; piVar9[2] = iVar7 + 0x100; piVar9[3] = iVar7 + 0x180; iVar1 = iVar7 + 0x200; iVar7 = iVar7 + 0x300; piVar9[4] = iVar1; iVar10 = iVar10 + -1; piVar9 = piVar9 + 6; } while (iVar10 != 0); oc_dequant_tables_init(param_1 + 0x398,param_1 + 0xd148,param_3 + 0x140); local_10 = (int *)(param_1 + 0xd248); local_18 = 0x40; local_14 = (int *)(param_1 + 0x3a0); do { iVar7 = 0; local_c = 2; local_8 = local_14; do { iVar10 = local_8[-2]; iVar1 = *local_8; iVar2 = local_8[2]; local_8 = local_8 + 1; iVar7 = iVar7 + (uint)*(ushort *)(iVar1 + 0x18) + (uint)*(ushort *)(iVar2 + 0x30) + ((uint)*(ushort *)(iVar10 + 0x30) + (uint)*(ushort *)(iVar10 + 0x24) + (uint)*(ushort *)(iVar10 + 0x22) + (uint)*(ushort *)(iVar10 + 0x18)) * 2 + (uint)*(ushort *)(iVar2 + 0x24) + (uint)*(ushort *)(iVar2 + 0x22) + (uint)*(ushort *)(iVar2 + 0x18) + (uint)*(ushort *)(iVar1 + 0x30) + (uint)*(ushort *)(iVar1 + 0x24) + (uint)*(ushort *)(iVar1 + 0x22); local_c = local_c + -1; } while (local_c != 0); local_14 = local_14 + 6; *local_10 = -(iVar7 >> 0xb); local_10 = local_10 + 1; local_18 = local_18 + -1; } while (local_18 != 0); uVar3 = *(undefined4 *)(param_3 + 0x244); uVar4 = *(undefined4 *)(param_3 + 0x248); uVar5 = *(undefined4 *)(param_3 + 0x24c); *(undefined4 *)(param_1 + 0xc9a0) = *(undefined4 *)(param_3 + 0x240); *(undefined4 *)(param_1 + 0xc9a4) = uVar3; *(undefined4 *)(param_1 + 0xc9a8) = uVar4; *(undefined4 *)(param_1 + 0xc9ac) = uVar5; uVar3 = *(undefined4 *)(param_3 + 0x254); uVar4 = *(undefined4 *)(param_3 + 600); uVar5 = *(undefined4 *)(param_3 + 0x25c); *(undefined4 *)(param_1 + 0xc9b0) = *(undefined4 *)(param_3 + 0x250); *(undefined4 *)(param_1 + 0xc9b4) = uVar3; *(undefined4 *)(param_1 + 0xc9b8) = uVar4; *(undefined4 *)(param_1 + 0xc9bc) = uVar5; uVar3 = *(undefined4 *)(param_3 + 0x264); uVar4 = *(undefined4 *)(param_3 + 0x268); uVar5 = *(undefined4 *)(param_3 + 0x26c); *(undefined4 *)(param_1 + 0xc9c0) = *(undefined4 *)(param_3 + 0x260); *(undefined4 *)(param_1 + 0xc9c4) = uVar3; *(undefined4 *)(param_1 + 0xc9c8) = uVar4; *(undefined4 *)(param_1 + 0xc9cc) = uVar5; uVar3 = *(undefined4 *)(param_3 + 0x270); uVar4 = *(undefined4 *)(param_3 + 0x274); uVar5 = *(undefined4 *)(param_3 + 0x278); uVar6 = *(undefined4 *)(param_3 + 0x27c); *(undefined4 *)(param_1 + 0xd144) = 0; *(undefined4 *)(param_1 + 0xd348) = 0; *(undefined4 *)(param_1 + 0xc9d0) = uVar3; *(undefined4 *)(param_1 + 0xc9d4) = uVar4; *(undefined4 *)(param_1 + 0xc9d8) = uVar5; *(undefined4 *)(param_1 + 0xc9dc) = uVar6; *(undefined4 *)(param_1 + 0xd34c) = 0; *(undefined4 *)(param_1 + 0xd350) = 0; *(undefined4 *)(param_1 + 0xd388) = 0; *(undefined4 *)(param_1 + 0xd38c) = 0; iVar7 = 0; } return iVar7; } //@@ 00add490 oc_dec_mv_unpack /* DB: libtheora: picks the chroma-MV setter from a per-pixel_fmt function table (PTR_FUN_00b191e0[pixel_fmt +0x30]), reads one bit (oc_pack_read1 FUN_00ae25a0) to choose the CLC vs VLC MV component tree (DAT_00b18fc8/DAT_00b18ef8), uses OC_MB_MAP_IDXS/NIDXS per pixel_fmt; called from th_decode_packetin */ void oc_dec_mv_unpack(int param_1) { uint *puVar1; char cVar2; int iVar3; int iVar4; int iVar5; int iVar6; uint uVar7; uint uVar8; uint uVar9; uint *puVar10; undefined2 local_54 [4]; undefined2 local_4c [4]; uint local_44; uint local_40; code *local_3c; int local_38; uint local_34; uint local_30; uint *local_2c; undefined *local_28; int local_24; uint *local_20; uint local_1c; int local_18; uint local_14; uint local_10; void *local_c; short *local_8; local_3c = (code *)(&PTR_FUN_00b191e0)[*(int *)(param_1 + 0x30)]; local_c = (void *)(param_1 + 0xc9e4); iVar4 = FUN_00ae25a0(local_c); local_38 = *(int *)(param_1 + 0xf0); iVar3 = *(int *)(param_1 + 0xd0); local_8 = (short *)&DAT_00b18fc8; if (iVar4 == 0) { local_8 = (short *)&DAT_00b18ef8; } uVar8 = 0; local_10 = 0; local_34 = 0; local_28 = &DAT_00b18d44 + *(int *)(param_1 + 0x30) * 0xc; local_30 = (uint)(byte)(&DAT_00b18d74)[*(int *)(param_1 + 0x30)]; uVar7 = 0; local_24 = *(int *)(param_1 + 0xd8); local_2c = *(uint **)(param_1 + 0xec); local_44 = *(uint *)(param_1 + 0xfc); local_14 = 0; if (local_44 != 0) { local_18 = 0; local_20 = local_2c; do { iVar4 = local_18; cVar2 = *(char *)(local_34 + local_38); uVar9 = (uint)cVar2; if (uVar9 != 0xffffffff) { if (uVar9 == 7) { local_14 = uVar8 & 0xffff; iVar4 = 0; puVar10 = local_20; do { local_1c = *puVar10; puVar1 = (uint *)(iVar3 + local_1c * 4); uVar7 = *puVar1; if ((uVar7 & 1) == 0) { uVar7 = 0; } else { *puVar1 = uVar7 & 0xffffff7f | 0x740; iVar5 = oc_huff_token_decode(local_c,local_8); iVar6 = oc_huff_token_decode(local_c,local_8); uVar7 = (iVar6 + -0x20) * 0x100 & 0xffffU | iVar5 - 0x20U & 0xff; *(short *)(local_24 + local_1c * 2) = (short)uVar7; local_10 = uVar7; } local_4c[iVar4] = (short)uVar7; puVar10 = puVar10 + 1; iVar4 = iVar4 + 1; } while (iVar4 < 4); (*local_3c)(local_54,local_4c); iVar4 = 4; if (4 < local_30) { do { uVar9 = (byte)local_28[iVar4] & 3; uVar7 = local_2c[uVar9 + ((uint)((byte)local_28[iVar4] >> 2) + local_18) * 4]; uVar8 = *(uint *)(iVar3 + uVar7 * 4); if ((uVar8 & 1) != 0) { *(uint *)(iVar3 + uVar7 * 4) = uVar8 & 0xffffff7f | 0x740; *(undefined2 *)(local_24 + uVar7 * 2) = local_54[uVar9]; } iVar4 = iVar4 + 1; } while (iVar4 < (int)local_30); } } else { switch(uVar9) { case 2: local_14 = uVar8 & 0xffff; iVar5 = oc_huff_token_decode(local_c,local_8); iVar6 = oc_huff_token_decode(local_c,local_8); local_1c = (iVar6 + -0x20) * 0x100 & 0xffffU | iVar5 - 0x20U & 0xff; local_10 = local_1c; break; case 3: local_1c = uVar8 & 0xffff; break; case 4: local_1c = uVar7 & 0xffff; local_14 = uVar8 & 0xffff; local_10 = local_1c; break; default: local_1c = 0; break; case 6: iVar5 = oc_huff_token_decode(local_c,local_8); iVar6 = oc_huff_token_decode(local_c,local_8); local_1c = (iVar6 + -0x20) * 0x100 & 0xffffU | iVar5 - 0x20U & 0xff; } local_40 = 0x10011121 >> (cVar2 * '\x04' & 0x1fU); iVar5 = 0; do { uVar7 = local_2c[((byte)local_28[iVar5] & 3) + ((uint)((byte)local_28[iVar5] >> 2) + iVar4) * 4]; uVar8 = *(uint *)(iVar3 + uVar7 * 4); if ((uVar8 & 1) != 0) { *(uint *)(iVar3 + uVar7 * 4) = ((uVar9 & 7) << 2 | local_40 & 3) << 6 | uVar8 & 0xfffff83f; *(short *)(local_24 + uVar7 * 2) = (short)local_1c; } iVar5 = iVar5 + 1; iVar4 = local_18; } while (iVar5 < (int)local_30); } uVar7 = local_14; uVar8 = local_10; } local_20 = local_20 + 0xc; local_34 = local_34 + 1; local_18 = local_18 + 3; } while (local_34 < local_44); } return; } //@@ 00add7a0 oc_dec_postprocess_init /* DB: ? libtheora decoder: calls the state hook (+100), and when pp_level (+0xd144) < 1 frees the post-processing buffer (+0xd348) and returns 1, else (re)allocates the pp frame / variance buffers; only caller th_decode_packetin */ undefined4 oc_dec_postprocess_init(int param_1) { int iVar1; undefined4 *puVar2; undefined1 uVar3; uint uVar4; uint uVar5; undefined4 uVar6; undefined4 uVar7; undefined4 uVar8; void *pvVar9; int iVar10; int iVar11; int iVar12; uint uVar13; uint uVar14; (**(code **)(param_1 + 100))(); pvVar9 = *(void **)(param_1 + 0xd348); if (*(int *)(param_1 + 0xd144) < 1) { if (pvVar9 == (void *)0x0) { return 1; } free(pvVar9); *(undefined4 *)(param_1 + 0xd348) = 0; free(*(void **)(param_1 + 0xd34c)); *(undefined4 *)(param_1 + 0xd34c) = 0; free(*(void **)(param_1 + 0xd350)); *(undefined4 *)(param_1 + 0xd350) = 0; return 1; } if (pvVar9 == (void *)0x0) { if (*(char *)(param_1 + 0x390) != '\0') { return 1; } pvVar9 = malloc(*(size_t *)(param_1 + 0xdc)); *(void **)(param_1 + 0xd348) = pvVar9; if (pvVar9 == (void *)0x0) { return 1; } memset(pvVar9,(uint)*(byte *)(param_1 + 0x393),*(size_t *)(param_1 + 0xdc)); } else { iVar12 = 0; iVar11 = *(int *)(param_1 + 0x10c) + *(int *)(param_1 + 0x108) + *(int *)(param_1 + 0x104); uVar3 = *(undefined1 *)(param_1 + 0x393); iVar10 = *(int *)(param_1 + 0x100); if (0 < iVar11) { do { iVar1 = iVar12 * 4; iVar12 = iVar12 + 1; *(undefined1 *)((int)pvVar9 + *(int *)(iVar10 + iVar1)) = uVar3; } while (iVar12 < iVar11); } } iVar10 = *(int *)(param_1 + 0xd144); pvVar9 = *(void **)(param_1 + 0xd34c); if (iVar10 < 2) { if (pvVar9 != (void *)0x0) { free(pvVar9); *(undefined4 *)(param_1 + 0xd34c) = 0; free(*(void **)(param_1 + 0xd350)); *(undefined4 *)(param_1 + 0xd350) = 0; } return 1; } if (pvVar9 == (void *)0x0) { pvVar9 = malloc(*(int *)(param_1 + 4) * *(int *)(param_1 + 8) + (*(uint *)(param_1 + 8) >> (~(byte)(*(uint *)(param_1 + 0x30) >> 1) & 1)) * (*(uint *)(param_1 + 4) >> (~(byte)*(uint *)(param_1 + 0x30) & 1)) * 2); *(void **)(param_1 + 0xd350) = pvVar9; pvVar9 = malloc(*(int *)(param_1 + 0xdc) << 2); *(void **)(param_1 + 0xd34c) = pvVar9; if ((pvVar9 == (void *)0x0) || (*(int *)(param_1 + 0xd350) == 0)) { free(*(void **)(param_1 + 0xd350)); *(undefined4 *)(param_1 + 0xd350) = 0; free(*(void **)(param_1 + 0xd34c)); *(undefined4 *)(param_1 + 0xd34c) = 0; return 1; } iVar10 = *(int *)(param_1 + 0xd144); *(undefined4 *)(param_1 + 0xd354) = 0; } if (*(int *)(param_1 + 0xd354) != (4 < iVar10) + 1) { if (iVar10 < 5) { *(int *)(param_1 + 0xd358) = *(int *)(param_1 + 4); iVar12 = -*(int *)(param_1 + 4); *(int *)(param_1 + 0xd35c) = *(int *)(param_1 + 8); *(int *)(param_1 + 0xd360) = iVar12; *(int *)(param_1 + 0xd364) = (1 - *(int *)(param_1 + 8)) * iVar12 + *(int *)(param_1 + 0xd350) ; } else { uVar4 = *(uint *)(param_1 + 4); *(uint *)(param_1 + 0xd358) = uVar4; *(uint *)(param_1 + 0xd360) = uVar4; uVar13 = uVar4 >> (~(byte)*(uint *)(param_1 + 0x30) & 1); uVar5 = *(uint *)(param_1 + 8); uVar14 = uVar5 >> (~(byte)(*(uint *)(param_1 + 0x30) >> 1) & 1); *(uint *)(param_1 + 0xd36c) = uVar14; *(uint *)(param_1 + 0xd37c) = uVar14; *(int *)(param_1 + 0xd364) = *(int *)(param_1 + 0xd350); *(uint *)(param_1 + 0xd35c) = uVar5; iVar10 = *(int *)(param_1 + 0xd350) + uVar4 * uVar5; *(uint *)(param_1 + 0xd368) = uVar13; *(int *)(param_1 + 0xd374) = iVar10; *(uint *)(param_1 + 0xd370) = uVar13; *(uint *)(param_1 + 0xd378) = uVar13; *(uint *)(param_1 + 0xd380) = uVar13; *(uint *)(param_1 + 0xd384) = uVar14 * uVar13 + iVar10; oc_ycbcr_buffer_flip((void *)(param_1 + 0xd358),(void *)(param_1 + 0xd358)); iVar10 = *(int *)(param_1 + 0xd144); } *(uint *)(param_1 + 0xd354) = (4 < iVar10) + 1; } if (iVar10 < 5) { puVar2 = (undefined4 *)(param_1 + 0x124 + *(int *)(param_1 + 0x23c) * 0x30); uVar6 = puVar2[1]; uVar7 = puVar2[2]; uVar8 = puVar2[3]; *(undefined4 *)(param_1 + 0xd368) = *puVar2; *(undefined4 *)(param_1 + 0xd36c) = uVar6; *(undefined4 *)(param_1 + 0xd370) = uVar7; *(undefined4 *)(param_1 + 0xd374) = uVar8; puVar2 = (undefined4 *)(param_1 + 0x134 + *(int *)(param_1 + 0x23c) * 0x30); uVar6 = puVar2[1]; uVar7 = puVar2[2]; uVar8 = puVar2[3]; *(undefined4 *)(param_1 + 0xd378) = *puVar2; *(undefined4 *)(param_1 + 0xd37c) = uVar6; *(undefined4 *)(param_1 + 0xd380) = uVar7; *(undefined4 *)(param_1 + 0xd384) = uVar8; } return 0; } //@@ 00addab0 oc_dering_block /* DB: libtheora pp.c: mod_hi=min(3*dc_scale, OC_MOD_MAX[]), mod=32+dc_scale-(abs(diff)< sharp_mod else clamp; caller oc_dering_frame 00adcd70 oc_dec_dering_frag_rows void oc_dering_block(byte *param_1,uint param_2,uint param_3,int *param_4,int param_5,byte *param_6) { byte bVar1; uint uVar2; uint uVar3; int iVar4; uint uVar5; int iVar6; uint uVar7; int iVar8; byte *pbVar9; byte *pbVar10; int local_260 [16]; int local_220 [8]; int local_200 [8]; int local_1e0 [8]; int local_1c0 [8]; int local_1a0 [8]; int local_180 [8]; int local_160 [8]; int local_140 [72]; uint local_20; uint local_1c; byte *local_18; byte *local_14; byte *local_10; byte *local_c; byte *local_8; local_18 = (byte *)0x0; local_1c = 1; uVar2 = (int)param_4 * 3; if ((int)(uint)(byte)(&DAT_00b1905c)[(int)param_6] < (int)param_4 * 3) { uVar2 = (uint)(byte)(&DAT_00b1905c)[(int)param_6]; } local_10 = param_1 + -(-(~(param_3 >> 2) & 1) & param_2); bVar1 = (&DAT_00b191d8)[(int)param_6]; local_14 = local_10; local_20 = ~(param_3 >> 3) & 1; local_8 = (byte *)(local_140 + 1); local_c = param_1; do { uVar3 = (int)((uint)*local_c - (uint)*local_10) >> 0x1f; iVar4 = ((int)param_4 - (((uint)*local_c - (uint)*local_10 ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + -4) = iVar8; uVar3 = (int)((uint)local_c[1] - (uint)local_10[1]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[1] - (uint)local_10[1] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)local_8 = iVar8; uVar3 = (int)((uint)local_c[2] - (uint)local_10[2]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[2] - (uint)local_10[2] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 4) = iVar8; uVar3 = (int)((uint)local_c[3] - (uint)local_10[3]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[3] - (uint)local_10[3] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 8) = iVar8; uVar3 = (int)((uint)local_c[4] - (uint)local_10[4]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[4] - (uint)local_10[4] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 0xc) = iVar8; uVar3 = (int)((uint)local_c[5] - (uint)local_10[5]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[5] - (uint)local_10[5] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 0x10) = iVar8; uVar3 = (int)((uint)local_c[6] - (uint)local_10[6]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[6] - (uint)local_10[6] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 0x14) = iVar8; uVar3 = (int)((uint)local_c[7] - (uint)local_10[7]) >> 0x1f; iVar4 = ((int)param_4 - (((uint)local_c[7] - (uint)local_10[7] ^ uVar3) - uVar3 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } uVar3 = local_20; if (local_18 < 7) { uVar3 = local_1c; } *(int *)((int)local_8 + 0x18) = iVar8; local_8 = (byte *)((int)local_8 + 0x20); local_10 = local_c; local_c = local_c + (-uVar3 & param_2); local_18 = (byte *)((int)local_18 + 1); } while ((int)local_18 < 9); local_10 = (byte *)(~param_3 & 1); pbVar10 = param_1 + -(~param_3 & 1); uVar3 = ~(param_3 >> 1) & 1; local_c = (byte *)0x0; local_8 = (byte *)(local_260 + 1); local_18 = param_1; do { uVar5 = (int)((uint)*local_18 - (uint)*pbVar10) >> 0x1f; iVar6 = ((int)param_4 - (((uint)*local_18 - (uint)*pbVar10 ^ uVar5) - uVar5 << (bVar1 & 0x1f))) + 0x20; iVar4 = param_5; if (-0x41 < iVar6) { iVar8 = 0; if ((int)uVar2 < iVar6) { iVar8 = uVar2 - iVar6; } iVar4 = 0; if (0 < iVar8 + iVar6) { iVar4 = iVar8 + iVar6; } } pbVar10 = pbVar10 + param_2; *(int *)((int)local_8 + -4) = iVar4; pbVar9 = local_18 + param_2; uVar5 = (int)((uint)*pbVar9 - (uint)*pbVar10) >> 0x1f; iVar4 = ((int)param_4 - (((uint)*pbVar9 - (uint)*pbVar10 ^ uVar5) - uVar5 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } pbVar10 = pbVar10 + param_2; pbVar9 = pbVar9 + param_2; *(int *)local_8 = iVar8; uVar5 = (int)((uint)*pbVar9 - (uint)*pbVar10) >> 0x1f; iVar4 = ((int)param_4 - (((uint)*pbVar9 - (uint)*pbVar10 ^ uVar5) - uVar5 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } pbVar10 = pbVar10 + param_2; pbVar9 = pbVar9 + param_2; *(int *)((int)local_8 + 4) = iVar8; uVar5 = (int)((uint)*pbVar9 - (uint)*pbVar10) >> 0x1f; iVar4 = ((int)param_4 - (((uint)*pbVar9 - (uint)*pbVar10 ^ uVar5) - uVar5 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } pbVar10 = pbVar10 + param_2; pbVar9 = pbVar9 + param_2; *(int *)((int)local_8 + 8) = iVar8; uVar5 = (int)((uint)*pbVar9 - (uint)*pbVar10) >> 0x1f; iVar4 = ((int)param_4 - (((uint)*pbVar9 - (uint)*pbVar10 ^ uVar5) - uVar5 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } pbVar10 = pbVar10 + param_2; pbVar9 = pbVar9 + param_2; *(int *)((int)local_8 + 0xc) = iVar8; uVar5 = (int)((uint)*pbVar9 - (uint)*pbVar10) >> 0x1f; iVar4 = ((int)param_4 - (((uint)*pbVar9 - (uint)*pbVar10 ^ uVar5) - uVar5 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 0x10) = iVar8; uVar5 = (uint)pbVar9[param_2] - (uint)pbVar10[param_2]; uVar7 = (int)uVar5 >> 0x1f; iVar4 = ((int)param_4 - ((uVar5 ^ uVar7) - uVar7 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } *(int *)((int)local_8 + 0x14) = iVar8; uVar5 = (uint)(pbVar9 + param_2)[param_2] - (uint)(pbVar10 + param_2)[param_2]; uVar7 = (int)uVar5 >> 0x1f; iVar4 = ((int)param_4 - ((uVar5 ^ uVar7) - uVar7 << (bVar1 & 0x1f))) + 0x20; if (iVar4 < -0x40) { iVar8 = param_5; } else { iVar6 = 0; if ((int)uVar2 < iVar4) { iVar6 = uVar2 - iVar4; } iVar8 = 0; if (0 < iVar6 + iVar4) { iVar8 = iVar6 + iVar4; } } uVar5 = uVar3; if (local_c < 7) { uVar5 = local_1c; } *(int *)((int)local_8 + 0x18) = iVar8; pbVar10 = local_18; local_8 = (byte *)((int)local_8 + 0x20); local_18 = local_18 + uVar5; local_c = (byte *)((int)local_c + 1); } while ((int)local_c < 9); local_c = (byte *)(local_140 + 8); param_6 = param_1 + param_2; local_1c = 0; local_8 = param_1 + 2; param_4 = local_220; do { iVar4 = param_4[-8]; iVar6 = (uint)*local_14 * *(int *)((int)local_c + -0x20) + (uint)param_1[1] * iVar4 + ((((0x80 - param_4[-0x10]) - *(int *)((int)local_c + -0x20)) - *(int *)local_c) - iVar4) * (uint)*param_1 + (uint)param_1[-(int)local_10] * param_4[-0x10] + (uint)*param_6 * *(int *)local_c + 0x40; iVar8 = iVar6 >> 7; bVar1 = (byte)iVar8; if (0xff < iVar8) { bVar1 = 0xff; } local_8[-2] = -(char)(iVar6 >> 0x1f) - 1U & bVar1; iVar6 = *param_4; iVar4 = (uint)param_6[1] * *(int *)((int)local_c + 4) + 0x40 + (uint)param_1[2] * iVar6 + ((((0x80 - iVar4) - *(int *)((int)local_c + -0x1c)) - *(int *)((int)local_c + 4)) - iVar6) * (uint)param_1[1] + (uint)*param_1 * iVar4 + (uint)local_14[1] * *(int *)((int)local_c + -0x1c); iVar8 = iVar4 >> 7; bVar1 = (byte)iVar8; if (0xff < iVar8) { bVar1 = 0xff; } local_8[-1] = -(char)(iVar4 >> 0x1f) - 1U & bVar1; iVar4 = param_4[8]; iVar6 = (uint)param_6[2] * *(int *)((int)local_c + 8) + 0x40 + (uint)param_1[3] * iVar4 + ((((0x80 - iVar6) - *(int *)((int)local_c + -0x18)) - *(int *)((int)local_c + 8)) - iVar4) * (uint)param_1[2] + (uint)param_1[1] * iVar6 + (uint)local_14[2] * *(int *)((int)local_c + -0x18); iVar8 = iVar6 >> 7; bVar1 = (byte)iVar8; if (0xff < iVar8) { bVar1 = 0xff; } *local_8 = -(char)(iVar6 >> 0x1f) - 1U & bVar1; iVar6 = param_4[0x10]; iVar4 = (uint)param_6[3] * *(int *)((int)local_c + 0xc) + 0x40 + (uint)param_1[4] * iVar6 + ((((0x80 - iVar4) - *(int *)((int)local_c + -0x14)) - *(int *)((int)local_c + 0xc)) - iVar6) * (uint)param_1[3] + (uint)param_1[2] * iVar4 + (uint)local_14[3] * *(int *)((int)local_c + -0x14); iVar8 = iVar4 >> 7; bVar1 = (byte)iVar8; if (0xff < iVar8) { bVar1 = 0xff; } local_8[1] = bVar1 & -(char)(iVar4 >> 0x1f) - 1U; iVar4 = param_4[0x18]; iVar6 = (uint)param_6[4] * *(int *)((int)local_c + 0x10) + 0x40 + (uint)param_1[5] * iVar4 + ((((0x80 - iVar6) - *(int *)((int)local_c + -0x10)) - *(int *)((int)local_c + 0x10)) - iVar4) * (uint)param_1[4] + (uint)param_1[3] * iVar6 + (uint)local_14[4] * *(int *)((int)local_c + -0x10); iVar8 = iVar6 >> 7; bVar1 = (byte)iVar8; if (0xff < iVar8) { bVar1 = 0xff; } local_8[2] = bVar1 & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = param_4[0x20]; iVar4 = (uint)param_6[5] * *(int *)((int)local_c + 0x14) + 0x40 + (uint)param_1[6] * iVar6 + ((((0x80 - iVar4) - *(int *)((int)local_c + -0xc)) - *(int *)((int)local_c + 0x14)) - iVar6) * (uint)param_1[5] + (uint)param_1[4] * iVar4 + (uint)local_14[5] * *(int *)((int)local_c + -0xc); iVar8 = iVar4 >> 7; bVar1 = (byte)iVar8; if (0xff < iVar8) { bVar1 = 0xff; } local_8[3] = bVar1 & -(char)(iVar4 >> 0x1f) - 1U; iVar4 = (uint)param_6[6] * *(int *)((int)local_c + 0x18) + 0x40 + (uint)param_1[7] * param_4[0x28] + ((((0x80 - iVar6) - *(int *)((int)local_c + -8)) - *(int *)((int)local_c + 0x18)) - param_4[0x28]) * (uint)param_1[6] + (uint)param_1[5] * iVar6 + (uint)local_14[6] * *(int *)((int)local_c + -8); iVar6 = iVar4 >> 7; bVar1 = (byte)iVar6; if (0xff < iVar6) { bVar1 = 0xff; } local_8[4] = bVar1 & -(char)(iVar4 >> 0x1f) - 1U; local_18 = (byte *)((uint)param_1[6] * param_4[0x28]); iVar4 = (uint)param_6[7] * *(int *)((int)local_c + 0x1c) + 0x40 + (uint)param_1[uVar3 + 7] * param_4[0x30] + ((((0x80 - param_4[0x28]) - *(int *)((int)local_c + -4)) - *(int *)((int)local_c + 0x1c) ) - param_4[0x30]) * (uint)param_1[7] + (int)local_18 + (uint)local_14[7] * *(int *)((int)local_c + -4); iVar6 = iVar4 >> 7; bVar1 = (byte)iVar6; if (0xff < iVar6) { bVar1 = 0xff; } local_14 = param_1; local_8[5] = -(char)(iVar4 >> 0x1f) - 1U & bVar1; local_8 = local_8 + param_2; param_1 = param_6; uVar2 = local_20; if (local_1c < 6) { uVar2 = 1; } local_1c = local_1c + 1; param_6 = param_6 + (-uVar2 & param_2); param_4 = param_4 + 1; local_c = (byte *)((int)local_c + 0x20); } while ((int)local_1c < 8); return; } //@@ 00ade460 oc_filter_hedge /* DB: libtheora decode.c: (dst, dst_ystride, src, src_ystride, qstep, flimit=qstep*3>>2, variance0, variance1=variance0+nhfrags), 8-column horizontal edge filter; first of the two filters (other FUN_00ade750 = oc_filter_vedge) called by oc_dec_deblock_frag_rows */ void oc_filter_hedge(byte *param_1,int param_2,int param_3,int param_4,int param_5,int param_6, int *param_7,int *param_8) { int iVar1; byte bVar2; byte bVar3; byte bVar4; byte bVar5; byte bVar6; byte bVar7; byte bVar8; byte bVar9; uint uVar10; uint uVar11; uint uVar12; uint uVar13; uint uVar14; uint uVar15; uint uVar16; uint uVar17; uint uVar18; uint uVar19; uint uVar20; uint uVar21; int iVar22; uint uVar23; uint uVar24; int iVar25; int local_48; byte *local_44; byte *local_3c; byte *local_38; byte *local_34; byte *local_30; byte *local_2c; byte *local_28; local_48 = 8; local_44 = (byte *)(param_3 + param_4 * 2); local_3c = (byte *)(param_3 + param_4 * 4); local_30 = param_1 + param_2 * 2; local_34 = param_1 + param_2 * 4; local_38 = param_1 + param_2 * 6; local_28 = (byte *)(param_3 + param_4 * 6); local_2c = (byte *)(param_3 + param_4 * 8); param_3 = param_3 - (int)param_1; do { uVar24 = (uint)param_1[param_3]; bVar2 = *local_3c; uVar23 = (uint)bVar2; bVar3 = (param_1 + param_3)[param_4]; uVar17 = (uint)bVar3; bVar4 = *local_44; uVar10 = (uint)bVar4; bVar5 = local_44[param_4]; uVar11 = (uint)bVar5; bVar6 = local_3c[param_4]; uVar16 = (uint)bVar6; bVar7 = *local_28; uVar12 = (uint)bVar7; bVar8 = local_28[param_4]; uVar13 = (uint)bVar8; bVar9 = *local_2c; uVar14 = (uint)bVar9; uVar15 = (uint)local_2c[param_4]; uVar18 = (int)(uVar17 - uVar24) >> 0x1f; uVar19 = (int)(uVar10 - uVar17) >> 0x1f; uVar20 = (int)(uVar11 - uVar10) >> 0x1f; uVar21 = (int)(uVar23 - uVar11) >> 0x1f; iVar25 = ((uVar17 - uVar24 ^ uVar18) - uVar18) + ((uVar10 - uVar17 ^ uVar19) - uVar19) + ((uVar11 - uVar10 ^ uVar20) - uVar20) + ((uVar23 - uVar11 ^ uVar21) - uVar21); uVar18 = (int)(uVar16 - uVar12) >> 0x1f; uVar19 = (int)(uVar14 - uVar15) >> 0x1f; uVar20 = (int)(uVar12 - uVar13) >> 0x1f; uVar21 = (int)(uVar13 - uVar14) >> 0x1f; iVar1 = ((uVar16 - uVar12 ^ uVar18) - uVar18) + ((uVar14 - uVar15 ^ uVar19) - uVar19) + ((uVar12 - uVar13 ^ uVar20) - uVar20) + ((uVar13 - uVar14 ^ uVar21) - uVar21); iVar22 = *param_7; if (iVar25 < 0xff) { iVar22 = *param_7 + -0xff + iVar25; } *param_7 = iVar22 + 0xff; iVar22 = *param_8; if (iVar1 < 0xff) { iVar22 = iVar1 + -0xff + *param_8; } *param_8 = iVar22 + 0xff; if ((((iVar25 < param_6) && (iVar1 < param_6)) && ((int)(uVar16 - uVar23) < param_5)) && ((int)(uVar23 - uVar16) < param_5)) { *param_1 = (byte)(uVar24 * 3 + uVar11 + uVar17 * 2 + 4 + uVar10 + uVar23 >> 3); param_1[param_2] = (byte)(uVar11 + (uVar10 + uVar24 + 2) * 2 + uVar23 + uVar17 + uVar16 >> 3); *local_30 = (byte)(uVar10 + uVar11 * 2 + 4 + uVar24 + uVar23 + uVar17 + uVar16 + uVar12 >> 3); local_30[param_2] = (byte)(uVar11 + 4 + uVar23 * 2 + uVar10 + uVar17 + uVar16 + uVar12 + uVar13 >> 3); *local_34 = (byte)(uVar11 + 4 + uVar16 * 2 + uVar10 + uVar23 + uVar12 + uVar14 + uVar13 >> 3); local_34[param_2] = (byte)(uVar11 + 4 + uVar12 * 2 + uVar23 + uVar16 + uVar15 + uVar14 + uVar13 >> 3); *local_38 = (byte)(uVar23 + (uVar13 + uVar15 + 2) * 2 + uVar16 + uVar12 + uVar14 >> 3); local_38[param_2] = (byte)(uVar15 * 3 + uVar16 + uVar14 * 2 + uVar12 + 4 + uVar13 >> 3); } else { *param_1 = bVar3; param_1[param_2] = bVar4; *local_30 = bVar5; local_30[param_2] = bVar2; *local_34 = bVar6; local_34[param_2] = bVar7; *local_38 = bVar8; local_38[param_2] = bVar9; } local_30 = local_30 + 1; local_3c = local_3c + 1; local_34 = local_34 + 1; local_28 = local_28 + 1; param_1 = param_1 + 1; local_2c = local_2c + 1; local_44 = local_44 + 1; local_38 = local_38 + 1; local_48 = local_48 + -1; } while (local_48 != 0); return; } //@@ 00ade750 oc_filter_vedge /* DB: libtheora decoder post-process deblocking: 8 rows of a vertical block edge, per-pixel variance sums written to *variance, filter by qstep/flimit; 5-arg call from oc_dec_deblock_frag_rows (the 8-arg sibling 00ade460 oc_filter_hedge oc_filter_hedge) */ void oc_filter_vedge(int param_1,int param_2,int param_3,int param_4,int *param_5) { int iVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; byte *pbVar8; uint uVar9; uint uVar10; uint uVar11; uint uVar12; uint uVar13; int iVar14; uint uVar15; uint uVar16; int iVar17; uint uVar18; int local_28; pbVar8 = (byte *)(param_1 + 3); local_28 = 8; do { uVar2 = (uint)pbVar8[-2]; uVar3 = (uint)pbVar8[-1]; uVar4 = (uint)pbVar8[2]; uVar5 = (uint)pbVar8[3]; uVar6 = (uint)pbVar8[4]; uVar9 = (uint)pbVar8[-3]; uVar7 = (uint)pbVar8[5]; uVar16 = (uint)pbVar8[-4]; uVar10 = (int)(uVar9 - uVar16) >> 0x1f; uVar18 = (uint)*pbVar8; uVar11 = (int)(uVar2 - uVar9) >> 0x1f; uVar15 = (uint)pbVar8[1]; uVar12 = (int)(uVar18 - uVar3) >> 0x1f; uVar13 = (int)(uVar3 - uVar2) >> 0x1f; iVar17 = ((uVar9 - uVar16 ^ uVar10) - uVar10) + ((uVar2 - uVar9 ^ uVar11) - uVar11) + ((uVar18 - uVar3 ^ uVar12) - uVar12) + ((uVar3 - uVar2 ^ uVar13) - uVar13); uVar10 = (int)(uVar6 - uVar7) >> 0x1f; uVar11 = (int)(uVar15 - uVar4) >> 0x1f; uVar12 = (int)(uVar4 - uVar5) >> 0x1f; uVar13 = (int)(uVar5 - uVar6) >> 0x1f; iVar1 = ((uVar6 - uVar7 ^ uVar10) - uVar10) + ((uVar15 - uVar4 ^ uVar11) - uVar11) + ((uVar4 - uVar5 ^ uVar12) - uVar12) + ((uVar5 - uVar6 ^ uVar13) - uVar13); iVar14 = *param_5; if (iVar17 < 0xff) { iVar14 = *param_5 + -0xff + iVar17; } *param_5 = iVar14 + 0xff; iVar14 = param_5[1]; if (iVar1 < 0xff) { iVar14 = iVar1 + -0xff + param_5[1]; } param_5[1] = iVar14 + 0xff; if ((((iVar17 < param_4) && (iVar1 < param_4)) && ((int)(uVar15 - uVar18) < param_3)) && ((int)(uVar18 - uVar15) < param_3)) { pbVar8[-3] = (byte)(uVar16 * 3 + uVar18 + uVar9 * 2 + 4 + uVar2 + uVar3 >> 3); pbVar8[-2] = (byte)(uVar15 + (uVar16 + uVar2 + 2) * 2 + uVar18 + uVar9 + uVar3 >> 3); pbVar8[-1] = (byte)(uVar15 + (uVar3 + 2) * 2 + uVar4 + uVar16 + uVar18 + uVar9 + uVar2 >> 3); *pbVar8 = (byte)(uVar15 + (uVar18 + 2) * 2 + uVar4 + uVar5 + uVar9 + uVar2 + uVar3 >> 3); pbVar8[1] = (byte)(uVar4 + 4 + uVar15 * 2 + uVar6 + uVar5 + uVar18 + uVar2 + uVar3 >> 3); pbVar8[2] = (byte)(uVar7 + uVar4 * 2 + 4 + uVar15 + uVar6 + uVar5 + uVar18 + uVar3 >> 3); pbVar8[3] = (byte)(uVar15 + (uVar7 + 2 + uVar5) * 2 + uVar4 + uVar6 + uVar18 >> 3); pbVar8[4] = (byte)(uVar7 * 3 + uVar15 + uVar6 * 2 + 4 + uVar4 + uVar5 >> 3); } pbVar8 = pbVar8 + param_2; local_28 = local_28 + -1; } while (local_28 != 0); return; } //@@ 00ade980 th_decode_alloc /* DB: libtheora (round 7 agent) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void * __cdecl th_decode_alloc(void *info,void *setup) { void *pvVar1; int iVar2; if ((info == (void *)0x0) || (setup == (void *)0x0)) { return (void *)0x0; } pvVar1 = (void *)FUN_00adbdd0(0xdf60,0x10); if (pvVar1 != (void *)0x0) { iVar2 = oc_dec_init(pvVar1,info,setup); if (-1 < iVar2) { *(undefined4 *)((int)pvVar1 + 0x380) = 0; *(undefined4 *)((int)pvVar1 + 900) = 0; return pvVar1; } } FUN_00adbdb0(pvVar1); return (void *)0x0; } //@@ 00ade9f0 th_decode_ctl /* DB: libtheora: switch on request: 1 GET_PPLEVEL_MAX writes 7, 3 SET_PPLEVEL (< 8 stored at +0xd144), 5 SET_GRANPOS (64-bit, shifted by keyframe granule shift +0x391), others return TH_EIMPL -23 / TH_EFAULT -1 with size checks 4/8; called from audio_stream_seek (the video seek path) and FUN_00a8e050 */ undefined4 th_decode_ctl(int param_1,undefined4 param_2,uint *param_3,int param_4) { uint uVar1; uint uVar2; uint uVar3; int iVar4; uint uVar5; undefined8 uVar6; switch(param_2) { case 1: if ((param_1 == 0) || (param_3 == (uint *)0x0)) { return 0xffffffff; } if (param_4 == 4) { *param_3 = 7; return 0; } break; default: return 0xffffffe9; case 3: if (param_1 == 0) { return 0xffffffff; } if (param_3 == (uint *)0x0) { return 0xffffffff; } if ((param_4 == 4) && (*param_3 < 8)) { *(uint *)(param_1 + 0xd144) = *param_3; return 0; } break; case 5: if (param_1 == 0) { return 0xffffffff; } if (param_3 == (uint *)0x0) { return 0xffffffff; } if (param_4 == 8) { uVar1 = param_3[1]; uVar3 = *param_3; if (-1 < (int)uVar1) { *(uint *)(param_1 + 0x388) = uVar3; *(uint *)(param_1 + 0x38c) = uVar1; uVar6 = __allshr(); uVar5 = (uint)uVar6 - (uint)*(byte *)(param_1 + 0x391); *(uint *)(param_1 + 0x378) = uVar5; iVar4 = (int)((ulonglong)uVar6 >> 0x20) - (uint)((uint)uVar6 < (uint)*(byte *)(param_1 + 0x391)); *(int *)(param_1 + 0x37c) = iVar4; uVar2 = (1 << ((byte)*(undefined4 *)(param_1 + 0x3c) & 0x1f)) - 1; uVar3 = uVar2 & uVar3; *(uint *)(param_1 + 0x380) = uVar3 + uVar5; *(uint *)(param_1 + 900) = ((int)uVar2 >> 0x1f & uVar1) + iVar4 + (uint)CARRY4(uVar3,uVar5); return 0; } } break; case 7: if (param_1 == 0) { return 0xffffffff; } if (param_3 == (uint *)0x0) { return 0xffffffff; } if (param_4 == 8) { *(uint *)(param_1 + 0xd388) = *param_3; *(uint *)(param_1 + 0xd38c) = param_3[1]; return 0; } } return 0xfffffff6; } //@@ 00adeb70 FUN_00adeb70 void FUN_00adeb70(int param_1) { if (param_1 != 0) { free(*(void **)(param_1 + 0xd350)); free(*(void **)(param_1 + 0xd34c)); free(*(void **)(param_1 + 0xd348)); free(*(void **)(param_1 + 0xd138)); FUN_00ae2ad0(param_1 + 0xc9f8); FUN_00ae1100(param_1); FUN_00adbdb0(param_1); } return; } //@@ 00adebd0 th_decode_packetin /* DB: libtheora decode.c: (dec, ogg_packet* op, granpos*); oc_pack_readinit on op->packet/bytes, 1-bit frame type, up to 3 6-bit qis; vendor string nearby */ undefined4 th_decode_packetin(int *param_1,undefined4 *param_2,longlong *param_3) { void *pvVar1; undefined1 *puVar2; byte bVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; longlong lVar7; int iVar8; char cVar9; undefined1 uVar10; uint *puVar11; int *piVar12; char *pcVar13; uint uVar14; char *pcVar15; char *pcVar16; int iVar17; byte *pbVar18; int iVar19; undefined4 *puVar20; uint uVar21; undefined4 *puVar22; int iVar23; int *piVar24; longlong lVar25; undefined4 local_36c [192]; undefined1 local_6c [48]; char local_3c [4]; int *piStack_38; int local_34; uint local_30; int local_2c; uint *local_28; int *local_24; char *local_20; int local_1c; int *local_18; uint local_14; char *local_10; void *local_c; uint *local_8; iVar8 = (int)param_1; if ((param_1 == (int *)0x0) || (param_2 == (undefined4 *)0x0)) { return 0xffffffff; } if (param_2[1] == 0) { local_28 = (uint *)((int)param_1 + 0x390); *(undefined4 *)((int)param_1 + 0x110) = 0; *(char *)local_28 = '\x01'; } else { iVar17 = (int)param_1 + 0xc9e4; FUN_00ae2630(iVar17,*param_2,param_2[1]); iVar19 = FUN_00ae25a0(iVar17); if (iVar19 != 0) { return 0xffffffe8; } puVar11 = (uint *)((int)param_1 + 0x390); local_28 = puVar11; cVar9 = FUN_00ae25a0(iVar17); *(char *)puVar11 = cVar9; uVar10 = FUN_00ae25e0(iVar17,6); *(undefined1 *)((int)param_1 + 0x393) = uVar10; iVar19 = FUN_00ae25a0(iVar17); if (iVar19 == 0) { *(undefined1 *)((int)param_1 + 0x392) = 1; } else { uVar10 = FUN_00ae25e0(iVar17,6); *(undefined1 *)((int)param_1 + 0x394) = uVar10; iVar19 = FUN_00ae25a0(iVar17); if (iVar19 == 0) { *(undefined1 *)((int)param_1 + 0x392) = 2; } else { uVar10 = FUN_00ae25e0(iVar17,6); *(undefined1 *)((int)param_1 + 0x395) = uVar10; *(undefined1 *)((int)param_1 + 0x392) = 3; } } if (*(char *)puVar11 == '\0') { iVar17 = FUN_00ae25e0(iVar17,3); if (iVar17 != 0) { return 0xffffffe9; } if (*(char *)puVar11 != '\0') goto LAB_00adee61; local_8 = *(uint **)((int)param_1 + 0xe4); local_24 = (int *)((int)param_1 + 0x104); local_18 = *(int **)((int)param_1 + 0x100); local_14 = *(uint *)((int)param_1 + 0xe0); local_c = *(void **)((int)param_1 + 0xd0); local_10 = (char *)0x0; pcVar13 = (char *)0x0; piVar12 = (int *)((int)param_1 + 0x8c); local_30 = 0; local_20 = (char *)0x0; _local_3c = CONCAT44(piVar12,local_3c); local_1c = 3; do { local_10 = local_10 + *piVar12; uVar14 = local_30; if (pcVar13 < local_10) { do { iVar17 = 0; uVar21 = 1; do { if (((byte)pcVar13[(int)local_8] >> 2 & uVar21 & 0xf) != 0) { local_2c = (iVar17 + (int)pcVar13 * 4) * 0x10; iVar19 = *(int *)(local_2c + local_14); if (-1 < iVar19) { *(uint *)((int)local_c + iVar19 * 4) = *(uint *)((int)local_c + iVar19 * 4) & 0xfffff9bf | 0x181; local_18[uVar14] = iVar19; uVar14 = uVar14 + 1; } iVar19 = *(int *)(local_2c + 4 + local_14); if (-1 < iVar19) { *(uint *)((int)local_c + iVar19 * 4) = *(uint *)((int)local_c + iVar19 * 4) & 0xfffff9bf | 0x181; local_18[uVar14] = iVar19; uVar14 = uVar14 + 1; } iVar19 = *(int *)(local_14 + 8 + local_2c); if (-1 < iVar19) { *(uint *)((int)local_c + iVar19 * 4) = *(uint *)((int)local_c + iVar19 * 4) & 0xfffff9bf | 0x181; local_18[uVar14] = iVar19; uVar14 = uVar14 + 1; } iVar19 = *(int *)(local_14 + 0xc + local_2c); if (-1 < iVar19) { *(uint *)((int)local_c + iVar19 * 4) = *(uint *)((int)local_c + iVar19 * 4) & 0xfffff9bf | 0x181; local_18[uVar14] = iVar19; uVar14 = uVar14 + 1; } pcVar13 = local_20; } iVar17 = iVar17 + 1; uVar21 = uVar21 << 1 | (uint)((int)uVar21 < 0); } while (iVar17 < 4); pcVar13 = pcVar13 + 1; local_20 = pcVar13; } while (pcVar13 < local_10); piVar12 = piStack_38; } piVar12 = piVar12 + 8; *local_24 = uVar14 - local_30; local_24 = local_24 + 1; local_1c = local_1c + -1; _local_3c = CONCAT44(piVar12,local_3c); local_30 = uVar14; } while (local_1c != 0); *(uint *)((int)param_1 + 0x110) = uVar14; local_1c = 0; } else { LAB_00adee61: oc_dec_coded_flags_unpack(param_1); } if (*(char *)((int)param_1 + 0x390) == '\0') goto LAB_00adef49; } if ((*(int *)((int)param_1 + 0x234) < 0) || (*(int *)((int)param_1 + 0x238) < 0)) { *(undefined4 *)((int)param_1 + 0x234) = 0; *(undefined4 *)((int)param_1 + 0x238) = 0; *(undefined4 *)((int)param_1 + 0x23c) = 0; local_8 = *(uint **)((int)param_1 + 0x120); *(uint **)((int)param_1 + 0x254) = local_8; *(uint **)((int)param_1 + 0x250) = local_8; *(uint **)((int)param_1 + 0x24c) = local_8; *(undefined4 *)((int)param_1 + 0xd358) = *(undefined4 *)((int)param_1 + 0x114); *(undefined4 *)((int)param_1 + 0xd35c) = *(undefined4 *)((int)param_1 + 0x118); *(undefined4 *)((int)param_1 + 0xd360) = *(undefined4 *)((int)param_1 + 0x11c); *(undefined4 *)((int)param_1 + 0xd364) = *(undefined4 *)((int)param_1 + 0x120); *(undefined4 *)((int)param_1 + 0xd368) = *(undefined4 *)((int)param_1 + 0x124); *(undefined4 *)((int)param_1 + 0xd36c) = *(undefined4 *)((int)param_1 + 0x128); *(undefined4 *)((int)param_1 + 0xd370) = *(undefined4 *)((int)param_1 + 300); *(undefined4 *)((int)param_1 + 0xd374) = *(undefined4 *)((int)param_1 + 0x130); *(undefined4 *)((int)param_1 + 0xd378) = *(undefined4 *)((int)param_1 + 0x134); *(undefined4 *)((int)param_1 + 0xd37c) = *(undefined4 *)((int)param_1 + 0x138); *(undefined4 *)((int)param_1 + 0xd380) = *(undefined4 *)((int)param_1 + 0x13c); *(undefined4 *)((int)param_1 + 0xd384) = *(undefined4 *)((int)param_1 + 0x140); iVar17 = *(int *)((int)param_1 + 8); uVar14 = (int)*(uint *)((int)param_1 + 0x268) >> 0x1f; iVar19 = (*(uint *)((int)param_1 + 0x268) ^ uVar14) - uVar14; uVar14 = (int)*(uint *)((int)param_1 + 0x26c) >> 0x1f; memset((char *)((int)local_8 + (-0x10 - (iVar17 + 0xf) * iVar19)),0x80, (iVar17 + 0x20) * iVar19 + ((*(uint *)((int)param_1 + 0x26c) ^ uVar14) - uVar14) * (iVar17 + 0x20 >> (~(byte)(*(uint *)((int)param_1 + 0x30) >> 1) & 1)) * 2 + 0x10); } LAB_00adef49: if (*(int *)((int)param_1 + 0x110) < 1) { lVar7 = *(longlong *)((int)param_1 + 0x378); uVar14 = *(uint *)((int)param_1 + 0x380); local_8 = *(uint **)((int)param_1 + 900); lVar25 = __allshl(); lVar7 = (lVar25 - lVar7) + CONCAT44(local_8,uVar14); *(uint *)((int)param_1 + 900) = (int)local_8 + (uint)(0xfffffffe < uVar14); *(longlong *)((int)param_1 + 0x388) = lVar7; *(uint *)((int)param_1 + 0x380) = uVar14 + 1; if (param_3 != (longlong *)0x0) { *param_3 = lVar7; } return 1; } for (local_2c = 0; (local_2c == *(int *)((int)param_1 + 0x234) || (local_2c == *(int *)((int)param_1 + 0x238))); local_2c = local_2c + 1) { } *(int *)((int)param_1 + 0x23c) = local_2c; *(undefined4 *)((int)param_1 + 0x254) = *(undefined4 *)((int)param_1 + (local_2c + 6) * 0x30); if (*(char *)((int)param_1 + 0x390) == '\0') { *(undefined4 *)((int)param_1 + 0x378) = *(undefined4 *)((int)param_1 + 0x380); *(undefined4 *)((int)param_1 + 0x37c) = *(undefined4 *)((int)param_1 + 900); } else { pvVar1 = (void *)((int)param_1 + 0xc9e4); local_8 = (uint *)FUN_00ae25e0(pvVar1,3); if (local_8 == (uint *)0x0) { iVar17 = 0; _local_3c = 0; do { iVar19 = FUN_00ae25e0(pvVar1,3); puVar2 = &DAT_00b18e00 + iVar17; iVar17 = iVar17 + 1; local_6c[iVar19 + 0x30] = *puVar2; } while (iVar17 < 8); local_10 = local_3c; } else { local_10 = "Xiph.Org libtheora 1.2.0alpha 20100924 (Ptalarbvorm)" + (int)local_8 * 8 + 0x30; } puVar11 = (uint *)&DAT_00b18ee4; if (local_8 != (uint *)0x7) { puVar11 = (uint *)&DAT_00b18e34; } iVar17 = *(int *)((int)param_1 + 0xf0); uVar21 = 0; uVar14 = *(uint *)((int)param_1 + 0xfc); local_30 = uVar14; local_1c = iVar17; local_8 = puVar11; if (uVar14 != 0) { do { if ('\0' < *(char *)(uVar21 + iVar17)) { iVar17 = oc_huff_token_decode(pvVar1,(short *)puVar11); *(char *)(uVar21 + local_1c) = local_10[iVar17]; uVar14 = local_30; iVar17 = local_1c; } uVar21 = uVar21 + 1; } while (uVar21 < uVar14); } oc_dec_mv_unpack(param_1); } iVar17 = *(int *)((int)param_1 + 0x110); local_1c = iVar17; if (0 < iVar17) { local_20 = *(char **)((int)param_1 + 0xd0); local_18 = *(int **)((int)param_1 + 0x100); if (*(char *)((int)param_1 + 0x392) == '\x01') { iVar19 = 0; do { piVar12 = local_18 + iVar19; iVar19 = iVar19 + 1; *(uint *)(local_20 + *piVar12 * 4) = *(uint *)(local_20 + *piVar12 * 4) & 0xffffffc3; } while (iVar19 < iVar17); } else { local_c = (void *)((int)param_1 + 0xc9e4); local_14 = FUN_00ae25a0(local_c); pcVar13 = local_20; local_24 = (int *)0x0; iVar19 = 0; do { local_10 = (char *)oc_huff_token_decode(local_c,(short *)&DAT_00b18e08); if (0xf < (int)local_10) { uVar14 = (uint)local_10 & 0x1f; iVar17 = FUN_00ae25e0(local_c,(int)((int)local_10 - uVar14) >> 4); local_10 = (char *)(iVar17 + 6 + uVar14); iVar17 = local_1c; } local_8 = (uint *)((local_14 & 0xf) << 2); pcVar15 = local_10; do { pcVar15 = pcVar15 + -1; piVar12 = local_18 + iVar19; iVar19 = iVar19 + 1; *(uint *)(pcVar13 + *piVar12 * 4) = *(uint *)(pcVar13 + *piVar12 * 4) & 0xffffffc3 | (uint)local_8; local_24 = (int *)((int)local_24 + local_14); if ((int)pcVar15 < 1) break; } while (iVar19 < iVar17); if (((int)local_10 < 0x1021) || (iVar17 <= iVar19)) { local_14 = (uint)(local_14 == 0); } else { local_14 = FUN_00ae25a0(local_c); } local_8 = local_28; } while (iVar19 < iVar17); if ((*(char *)((int)param_1 + 0x392) == '\x03') && (0 < (int)local_24)) { iVar19 = 0; bVar3 = local_20[*local_18 * 4]; while ((bVar3 & 0x3c) == 0) { iVar23 = iVar19 + 1; iVar19 = iVar19 + 1; bVar3 = local_20[local_18[iVar23] * 4]; } local_14 = FUN_00ae25a0(local_c); pcVar13 = local_20; do { local_10 = (char *)oc_huff_token_decode(local_c,(short *)&DAT_00b18e08); pcVar15 = local_10; if (0xf < (int)local_10) { uVar14 = (uint)local_10 & 0x1f; iVar17 = FUN_00ae25e0(local_c,(int)((int)local_10 - uVar14) >> 4); pcVar15 = (char *)(iVar17 + 6 + uVar14); local_10 = pcVar15; iVar17 = local_1c; } for (; iVar19 < iVar17; iVar19 = iVar19 + 1) { uVar14 = *(uint *)(pcVar13 + local_18[iVar19] * 4); local_8 = (uint *)(pcVar13 + local_18[iVar19] * 4); pcVar16 = pcVar15; if ((uVar14 & 0x3c) != 0) { pcVar16 = pcVar15 + -1; if ((int)pcVar15 < 1) break; *local_8 = (uVar14 + local_14 * 4 ^ uVar14) & 0x3c ^ uVar14; } pcVar15 = pcVar16; } if (((int)local_10 < 0x1021) || (iVar17 <= iVar19)) { local_14 = (uint)(local_14 == 0); } else { local_14 = FUN_00ae25a0(local_c); } } while (iVar19 < iVar17); } } } iVar17 = 0; puVar20 = local_36c; do { uVar4 = *(undefined4 *)((int)param_1 + 0x104 + iVar17 * 4); iVar17 = iVar17 + 1; puVar22 = puVar20; for (iVar19 = 0x40; iVar19 != 0; iVar19 = iVar19 + -1) { *puVar22 = uVar4; puVar22 = puVar22 + 1; } puVar20 = puVar20 + 0x40; } while (iVar17 < 3); iVar17 = (int)param_1 + 0xc9e4; local_34 = FUN_00ae25e0(iVar17,4); local_30 = FUN_00ae25e0(iVar17,4); *(undefined4 *)((int)param_1 + 0xce38) = 0; local_1c = oc_dec_residual_tokens_unpack(param_1,&local_34,local_36c); local_10 = (char *)FUN_00ae25e0(iVar17,4); local_8 = (uint *)FUN_00ae25e0(iVar17,4); iVar17 = 1; iVar19 = 1; do { local_8 = (uint *)((int)local_8 + 0x10); local_34 = (int)local_10 + 0x10; local_30 = (uint)local_8; local_10 = (char *)local_34; if (iVar17 < (int)(uint)(byte)(&UNK_00b191d0)[iVar19]) { do { local_1c = oc_dec_ac_coeff_unpack(param_1,iVar17,&local_34,local_36c,local_1c); iVar17 = iVar17 + 1; } while (iVar17 < (int)(uint)(byte)(&UNK_00b191d0)[iVar19]); } iVar19 = iVar19 + 1; } while (iVar19 < 5); lVar7 = *(longlong *)((int)param_1 + 0x378); uVar14 = *(uint *)((int)param_1 + 0x380); local_8 = *(uint **)((int)param_1 + 900); lVar25 = __allshl(); lVar7 = (lVar25 - lVar7) + CONCAT44(local_8,uVar14); local_10 = (char *)lVar7; *(uint *)((int)param_1 + 0x380) = uVar14 + 1; *(longlong *)((int)param_1 + 0x388) = lVar7; *(uint *)((int)param_1 + 900) = (int)local_8 + (uint)(0xfffffffe < uVar14); if (param_3 != (longlong *)0x0) { *param_3 = lVar7; } *(int *)((int)param_1 + 0xdf50) = 4 << (~(byte)(*(uint *)((int)param_1 + 0x30) >> 1) & 1); puVar20 = (undefined4 *)((int)param_1 + 0xcb38); puVar22 = (undefined4 *)((int)param_1 + 0xd590); for (iVar17 = 0xc0; iVar17 != 0; iVar17 = iVar17 + -1) { *puVar22 = *puVar20; puVar20 = puVar20 + 1; puVar22 = puVar22 + 1; } puVar20 = (undefined4 *)((int)param_1 + 0xce38); puVar22 = (undefined4 *)((int)param_1 + 0xdb90); for (iVar17 = 0xc0; iVar17 != 0; iVar17 = iVar17 + -1) { *puVar22 = *puVar20; puVar20 = puVar20 + 1; puVar22 = puVar22 + 1; } iVar17 = *(int *)((int)param_1 + 0x100); *(int *)((int)param_1 + 0xde90) = iVar17; iVar19 = iVar17 + *(int *)((int)param_1 + 0xdc) * 4; *(int *)((int)param_1 + 0xde9c) = iVar19; iVar17 = iVar17 + *(int *)((int)param_1 + 0x104) * 4; *(int *)((int)param_1 + 0xde94) = iVar17; iVar19 = iVar19 + (*(int *)((int)param_1 + 0x104) - *(int *)((int)param_1 + 0x7c)) * 4; *(int *)((int)param_1 + 0xdea0) = iVar19; iVar23 = 0; *(int *)((int)param_1 + 0xdea4) = iVar19 + (*(int *)((int)param_1 + 0x108) - *(int *)((int)param_1 + 0x9c)) * 4; *(int *)((int)param_1 + 0xde98) = iVar17 + *(int *)((int)param_1 + 0x108) * 4; param_1 = (int *)((int)param_1 + 0xdec4); local_8 = (uint *)(int)((ulonglong)lVar7 >> 0x20); do { if (*(char *)(iVar8 + 0x392) != '\0') { pbVar18 = (byte *)(iVar8 + 0x393); local_8 = (uint *)(-0x393 - iVar8); puVar20 = param_1; do { puVar20[-1] = *(undefined4 *)(iVar8 + 0x398 + (iVar23 + (uint)*pbVar18 * 3) * 8); bVar3 = *pbVar18; pbVar18 = pbVar18 + 1; *puVar20 = *(undefined4 *)(iVar8 + 0x39c + (iVar23 + (uint)bVar3 * 3) * 8); puVar20 = puVar20 + 2; } while ((int)(pbVar18 + (int)local_8) < (int)(uint)*(byte *)(iVar8 + 0x392)); } iVar23 = iVar23 + 1; param_1 = param_1 + 6; } while (iVar23 < 3); memset((void *)(iVar8 + 0xdf20),0,0x30); cVar9 = *(char *)(*(byte *)(iVar8 + 0x393) + 0xc9a0 + iVar8); *(uint *)(iVar8 + 0xdf54) = (uint)(cVar9 != '\0'); if (cVar9 != '\0') { (**(code **)(iVar8 + 0x5c))(iVar8 + 0xd490,cVar9); } iVar17 = oc_dec_postprocess_init(iVar8); if (iVar17 == 0) { *(undefined4 *)(iVar8 + 0xdf58) = *(undefined4 *)(iVar8 + 0xd144); } else { *(undefined4 *)(iVar8 + 0xdf58) = 0; iVar17 = *(int *)(iVar8 + 0x23c); puVar20 = (undefined4 *)(iVar8 + 0x114 + iVar17 * 0x30); uVar4 = puVar20[1]; uVar5 = puVar20[2]; uVar6 = puVar20[3]; *(undefined4 *)(iVar8 + 0xd358) = *puVar20; *(undefined4 *)(iVar8 + 0xd35c) = uVar4; *(undefined4 *)(iVar8 + 0xd360) = uVar5; *(undefined4 *)(iVar8 + 0xd364) = uVar6; puVar20 = (undefined4 *)(iVar8 + 0x124 + iVar17 * 0x30); uVar4 = puVar20[1]; uVar5 = puVar20[2]; uVar6 = puVar20[3]; *(undefined4 *)(iVar8 + 0xd368) = *puVar20; *(undefined4 *)(iVar8 + 0xd36c) = uVar4; *(undefined4 *)(iVar8 + 0xd370) = uVar5; *(undefined4 *)(iVar8 + 0xd374) = uVar6; puVar20 = (undefined4 *)(iVar8 + 0x134 + iVar17 * 0x30); uVar4 = puVar20[1]; uVar5 = puVar20[2]; uVar6 = puVar20[3]; *(undefined4 *)(iVar8 + 0xd378) = *puVar20; *(undefined4 *)(iVar8 + 0xd37c) = uVar4; *(undefined4 *)(iVar8 + 0xd380) = uVar5; *(undefined4 *)(iVar8 + 0xd384) = uVar6; } *(undefined4 *)(iVar8 + 0xd390) = 0; *(undefined4 *)(iVar8 + 0xd394) = 0; *(undefined4 *)(iVar8 + 0xd398) = 0; *(undefined4 *)(iVar8 + 0xd39c) = 0; *(undefined4 *)(iVar8 + 0xd3a0) = 0; *(undefined4 *)(iVar8 + 0xd3a4) = 0; *(undefined4 *)(iVar8 + 0xd3a8) = 0; *(undefined4 *)(iVar8 + 0xd3ac) = 0; *(undefined4 *)(iVar8 + 0xd3b0) = 0; *(undefined4 *)(iVar8 + 0xd3b4) = 0; *(undefined4 *)(iVar8 + 0xd3b8) = 0; *(undefined4 *)(iVar8 + 0xd3bc) = 0; *(undefined4 *)(iVar8 + 0xd3c0) = 0; *(undefined4 *)(iVar8 + 0xd3c4) = 0; *(undefined4 *)(iVar8 + 0xd3c8) = 0; *(undefined4 *)(iVar8 + 0xd3cc) = 0; *(undefined4 *)(iVar8 + 0xd3d0) = 0; *(undefined4 *)(iVar8 + 0xd3d4) = 0; *(undefined4 *)(iVar8 + 0xd3d8) = 0; *(undefined4 *)(iVar8 + 0xd3dc) = 0; *(undefined4 *)(iVar8 + 0xd3e0) = 0; *(undefined4 *)(iVar8 + 0xd3e4) = 0; *(undefined4 *)(iVar8 + 0xd3e8) = 0; *(undefined4 *)(iVar8 + 0xd3ec) = 0; *(undefined4 *)(iVar8 + 0xd3f0) = 0; *(undefined4 *)(iVar8 + 0xd3f4) = 0; *(undefined4 *)(iVar8 + 0xd3f8) = 0; *(undefined4 *)(iVar8 + 0xd3fc) = 0; *(undefined4 *)(iVar8 + 0xd400) = 0; *(undefined4 *)(iVar8 + 0xd404) = 0; *(undefined4 *)(iVar8 + 0xd408) = 0; *(undefined4 *)(iVar8 + 0xd40c) = 0; oc_ycbcr_buffer_flip(local_6c,(undefined4 *)(iVar8 + 0xd358)); iVar17 = *(int *)(iVar8 + 0xdf50); local_18 = (int *)0x0; local_30 = 0; do { param_1 = (int *)(iVar8 + 0xdf14); local_20 = *(char **)(iVar8 + 0x74); local_8 = (uint *)(local_30 + iVar17); _local_3c = CONCAT44(local_20,local_3c); local_14 = (uint)((int)local_8 < (int)local_20); local_24 = (int *)(iVar8 + 0x74); local_c = (void *)0x0; local_1c = (int)local_20; do { pvVar1 = local_c; if ((local_c == (void *)0x0) || ((*(byte *)(iVar8 + 0x30) & 2) != 0)) { local_10 = (char *)0x0; } else { local_10 = (char *)0x1; } iVar17 = (int)local_30 >> (sbyte)local_10; param_1[-3] = iVar17; iVar17 = (*(int *)(iVar8 + 0xdf50) >> (sbyte)local_10) + iVar17; iVar19 = *local_24; if (iVar17 < *local_24) { iVar19 = iVar17; } *param_1 = iVar19; oc_dec_dc_unpredict_mcu_plane(iVar8,iVar8 + 0xd390,local_c); oc_dec_frags_recon_mcu_plane(iVar8,iVar8 + 0xd390,pvVar1); uVar14 = local_14; piVar12 = local_18; uVar21 = 0; piVar24 = (int *)0; if (*(int *)(iVar8 + 0xdf54) != 0) { (**(code **)(iVar8 + 0x60)) (iVar8,iVar8 + 0xd490,2,local_c,param_1[-3] - (int)local_18,*param_1 - local_14); uVar21 = uVar14; piVar24 = piVar12; } oc_state_borders_fill_rows (iVar8,local_2c,local_c,param_1[-3] * 8 + (int)piVar24 * -10, *param_1 * 8 + uVar21 * -10); iVar17 = 2; if (local_c != (void *)0x0) { iVar17 = 5; } if (*(int *)(iVar8 + 0xdf58) < iVar17) { if (*(int *)(iVar8 + 0xdf54) != 0) { piVar24 = (int *)((int)piVar24 + (int)local_18); uVar21 = uVar21 + local_14; } } else { uVar21 = uVar21 + local_14; piVar24 = (int *)((int)piVar24 + (int)local_18); oc_dec_deblock_frag_rows (iVar8,iVar8 + 0xd358,local_2c * 0x30 + 0x114 + iVar8,local_c, param_1[-3] - (int)piVar24,*param_1 - uVar21); iVar17 = 3; if (local_c != (void *)0x0) { iVar17 = 6; } if (iVar17 <= *(int *)(iVar8 + 0xdf58)) { uVar21 = uVar21 + local_14; piVar24 = (int *)((int)piVar24 + (int)local_18); oc_dec_dering_frag_rows (iVar8,iVar8 + 0xd358,local_c,param_1[-3] - (int)piVar24,*param_1 - uVar21); } } iVar17 = param_1[-3] - (int)piVar24 << ((byte)local_10 & 0x1f); if (iVar17 < (int)local_20) { local_20 = (char *)iVar17; } iVar17 = *param_1 - uVar21 << ((byte)local_10 & 0x1f); piVar12 = piStack_38; if (iVar17 < (int)piStack_38) { piVar12 = (int *)iVar17; } local_24 = local_24 + 8; local_c = (void *)((int)local_c + 1); _local_3c = CONCAT44(piVar12,local_3c); param_1 = param_1 + 1; } while ((int)local_c < 3); if (*(int *)(iVar8 + 0xd38c) != 0) { (**(code **)(iVar8 + 100))(); (**(code **)(iVar8 + 0xd38c)) (*(undefined4 *)(iVar8 + 0xd388),local_6c,*(int *)(iVar8 + 0x74) - (int)piStack_38, *(int *)(iVar8 + 0x74) - (int)local_20); } iVar17 = *(int *)(iVar8 + 0xdf50); local_30 = local_30 + iVar17; local_18 = (int *)0x1; } while ((int)local_8 < local_1c); iVar17 = 0; do { oc_state_borders_fill_caps(iVar8,local_2c,iVar17); iVar17 = iVar17 + 1; } while (iVar17 < 3); if ((char)*local_28 == '\0') { *(undefined4 *)(iVar8 + 0x234) = *(undefined4 *)(iVar8 + 0x23c); *(undefined4 *)(iVar8 + 0x24c) = *(undefined4 *)(iVar8 + 0x254); } *(undefined4 *)(iVar8 + 0x238) = *(undefined4 *)(iVar8 + 0x23c); *(undefined4 *)(iVar8 + 0x250) = *(undefined4 *)(iVar8 + 0x254); (**(code **)(iVar8 + 100))(); return 0; } //@@ 00adf8c0 FUN_00adf8c0 undefined4 FUN_00adf8c0(int param_1,void *param_2) { if ((param_1 == 0) || (param_2 == (void *)0x0)) { return 0xffffffff; } oc_ycbcr_buffer_flip(param_2,(void *)(param_1 + 0xd358)); return 0; } //@@ 00adf8f0 FUN_00adf8f0 void FUN_00adf8f0(int *param_1) { int iVar1; if (param_1 != (int *)0x0) { iVar1 = 0; if (0 < param_1[2]) { do { free(*(void **)(*param_1 + iVar1 * 4)); iVar1 = iVar1 + 1; } while (iVar1 < param_1[2]); } free((void *)*param_1); free((void *)param_1[1]); free((void *)param_1[3]); *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; } return; } //@@ 00adf940 FUN_00adf940 void FUN_00adf940(undefined4 *param_1) { *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; return; } //@@ 00adf950 FUN_00adf950 void FUN_00adf950(void *param_1) { memset(param_1,0,0x40); return; } //@@ 00adf970 FUN_00adf970 void FUN_00adf970(undefined2 *param_1) { memset(param_1,0,0x40); *param_1 = 0x203; *(undefined1 *)(param_1 + 1) = 1; *(undefined4 *)(param_1 + 0x1e) = 6; return; } //@@ 00adf9a0 oc_comment_unpack /* DB: libtheora decinfo.c: 4x8-bit vendor length, malloc(len+1) vendor -> tc[3], ncomments with 0x1fffffff/remaining-bytes checks, mallocs user_comments/comment_lengths; caller oc_dec_headerin (FUN_00adfbc0) */ undefined4 oc_comment_unpack(undefined4 param_1,int *param_2) { undefined1 uVar1; uint uVar2; void *pvVar3; undefined4 uVar4; undefined1 *puVar5; int iVar6; uint local_24 [4]; uint local_14; int local_c; int local_8; iVar6 = 0; do { uVar2 = FUN_00ae25e0(param_1,8); local_24[iVar6] = uVar2; iVar6 = iVar6 + 1; } while (iVar6 < 4); uVar2 = ((local_24[3] << 8 | local_24[2]) << 8 | local_24[1]) << 8 | local_24[0]; if (((int)uVar2 < 0) || (iVar6 = FUN_00ae2580(param_1), iVar6 < (int)uVar2)) { return 0xffffffec; } pvVar3 = malloc(uVar2 + 1); param_2[3] = (int)pvVar3; if (pvVar3 == (void *)0x0) { return 0xffffffff; } FUN_00adff90(param_1,pvVar3,uVar2); *(undefined1 *)(uVar2 + param_2[3]) = 0; uVar2 = FUN_00adff50(param_1); param_2[2] = uVar2; if ((0x1fffffff < uVar2) || (iVar6 = FUN_00ae2580(param_1), iVar6 < (int)(uVar2 * 4))) { param_2[2] = 0; return 0xffffffec; } pvVar3 = malloc(param_2[2] << 2); param_2[1] = (int)pvVar3; pvVar3 = malloc(param_2[2] << 2); *param_2 = (int)pvVar3; if ((param_2[1] == 0) || (pvVar3 == (void *)0x0)) { param_2[2] = 0; return 0xffffffff; } local_8 = 0; if (0 < param_2[2]) { do { iVar6 = 0; do { uVar2 = FUN_00ae25e0(param_1,8); local_24[iVar6] = uVar2; iVar6 = iVar6 + 1; } while (iVar6 < 4); uVar2 = ((local_24[3] << 8 | local_24[2]) << 8 | local_24[1]) << 8 | local_24[0]; if ((int)uVar2 < 0) { LAB_00adfb7d: param_2[2] = local_8; return 0xffffffec; } local_14 = uVar2; iVar6 = FUN_00ae2580(param_1); if (iVar6 < (int)uVar2) goto LAB_00adfb7d; local_c = local_8 * 4; *(uint *)(local_c + param_2[1]) = uVar2; pvVar3 = malloc(uVar2 + 1); *(void **)(local_c + *param_2) = pvVar3; iVar6 = *param_2; puVar5 = *(undefined1 **)(local_c + iVar6); if (puVar5 == (undefined1 *)0x0) { param_2[2] = local_8; return 0xffffffff; } if (uVar2 != 0) { do { uVar1 = FUN_00ae25e0(param_1,8); *puVar5 = uVar1; puVar5 = puVar5 + 1; uVar2 = uVar2 - 1; } while (uVar2 != 0); iVar6 = *param_2; uVar2 = local_14; } *(undefined1 *)(uVar2 + *(int *)(local_c + iVar6)) = 0; local_8 = local_8 + 1; } while (local_8 < param_2[2]); } iVar6 = FUN_00ae2580(param_1); uVar4 = 0; if (iVar6 < 0) { uVar4 = 0xffffffec; } return uVar4; } //@@ 00adfbc0 oc_dec_headerin /* DB: libtheora decinfo.c: reads 6 header bytes "theora" (0x6f656874/0x6172), packet type 0x80 info (oc_info_unpack 00adfdd0), 0x81 comment, 0x82 setup, TH_EBADHEADER -0x14 on b_o_s mismatch; caller th_decode_headerin 00adff90 */ int oc_dec_headerin(undefined4 param_1,int param_2,int param_3,int *param_4,int param_5) { undefined1 uVar1; int iVar2; void *_Memory; int *piVar3; int iVar4; int local_c; short local_8; iVar2 = FUN_00ae25e0(param_1,8); if ((char)iVar2 < '\0') { piVar3 = &local_c; iVar4 = 6; do { uVar1 = FUN_00ae25e0(param_1,8); *(undefined1 *)piVar3 = uVar1; piVar3 = (int *)((int)piVar3 + 1); iVar4 = iVar4 + -1; } while (iVar4 != 0); if ((local_c == 0x6f656874) && (local_8 == 0x6172)) { if (iVar2 == 0x80) { if (*(int *)(param_5 + 8) == 0) { return -0x14; } if (*(int *)(param_2 + 4) != 0) { return -0x14; } iVar2 = FUN_00adfdd0(param_1,param_2); if (iVar2 < 0) { FUN_00adf950(param_2); return iVar2; } return 3; } if (iVar2 == 0x81) { if (param_3 == 0) { return -1; } if (*(int *)(param_2 + 4) == 0) { return -0x14; } if (*(int *)(param_3 + 0xc) != 0) { return -0x14; } iVar2 = oc_comment_unpack(param_1,param_3); if (iVar2 < 0) { FUN_00adf8f0(param_3); return iVar2; } return 2; } if (iVar2 != 0x82) { return -0x14; } if (param_3 == 0) { return -1; } if (param_4 == (int *)0x0) { return -1; } if (*(int *)(param_2 + 4) == 0) { return -0x14; } if (*(int *)(param_3 + 0xc) == 0) { return -0x14; } if (*param_4 != 0) { return -0x14; } _Memory = calloc(1,0x2c8); if (_Memory == (void *)0x0) { return -1; } iVar2 = oc_quant_params_unpack(param_1,(int)_Memory + 0x140); if ((iVar2 < 0) || (iVar2 = FUN_00ae2bf0(param_1,_Memory), iVar2 < 0)) { FUN_00ae2d60((int)_Memory + 0x140); FUN_00ae2ad0(_Memory); free(_Memory); return iVar2; } *param_4 = (int)_Memory; return 1; } } else if (*(int *)(param_2 + 4) != 0) { if (param_3 == 0) { return -1; } if (*(int *)(param_3 + 0xc) != 0) { if (param_4 == (int *)0x0) { return -1; } if (*param_4 != 0) { return 0; } } return -0x14; } return -0x15; } //@@ 00adfdd0 FUN_00adfdd0 undefined4 FUN_00adfdd0(undefined4 param_1,byte *param_2) { uint uVar1; byte bVar2; int iVar3; undefined4 uVar4; bVar2 = FUN_00ae25e0(param_1,8); *param_2 = bVar2; bVar2 = FUN_00ae25e0(param_1,8); param_2[1] = bVar2; bVar2 = FUN_00ae25e0(param_1,8); param_2[2] = bVar2; if ((3 < *param_2) || ((*param_2 == 3 && (2 < param_2[1])))) { return 0xffffffea; } iVar3 = FUN_00ae25e0(param_1,0x10); *(int *)(param_2 + 4) = iVar3 << 4; iVar3 = FUN_00ae25e0(param_1,0x10); *(int *)(param_2 + 8) = iVar3 << 4; uVar4 = FUN_00ae25e0(param_1,0x18); *(undefined4 *)(param_2 + 0xc) = uVar4; uVar4 = FUN_00ae25e0(param_1,0x18); *(undefined4 *)(param_2 + 0x10) = uVar4; uVar4 = FUN_00ae25e0(param_1,8); *(undefined4 *)(param_2 + 0x14) = uVar4; uVar4 = FUN_00ae25e0(param_1,8); *(undefined4 *)(param_2 + 0x18) = uVar4; uVar4 = FUN_00ae25e0(param_1,0x20); *(undefined4 *)(param_2 + 0x1c) = uVar4; iVar3 = FUN_00ae25e0(param_1,0x20); *(int *)(param_2 + 0x20) = iVar3; if (((*(uint *)(param_2 + 4) != 0) && (uVar1 = *(uint *)(param_2 + 8), uVar1 != 0)) && ((uint)(*(int *)(param_2 + 0x14) + *(int *)(param_2 + 0xc)) <= *(uint *)(param_2 + 4))) { if ((((uint)(*(int *)(param_2 + 0x10) + *(int *)(param_2 + 0x18)) <= uVar1) && (*(int *)(param_2 + 0x1c) != 0)) && (iVar3 != 0)) { *(uint *)(param_2 + 0x18) = (uVar1 - *(int *)(param_2 + 0x10)) - *(int *)(param_2 + 0x18); uVar4 = FUN_00ae25e0(param_1,0x18); *(undefined4 *)(param_2 + 0x24) = uVar4; uVar4 = FUN_00ae25e0(param_1,0x18); *(undefined4 *)(param_2 + 0x28) = uVar4; uVar4 = FUN_00ae25e0(param_1,8); *(undefined4 *)(param_2 + 0x2c) = uVar4; uVar4 = FUN_00ae25e0(param_1,0x18); *(undefined4 *)(param_2 + 0x34) = uVar4; uVar4 = FUN_00ae25e0(param_1,6); *(undefined4 *)(param_2 + 0x38) = uVar4; uVar4 = FUN_00ae25e0(param_1,5); *(undefined4 *)(param_2 + 0x3c) = uVar4; iVar3 = FUN_00ae25e0(param_1,2); *(int *)(param_2 + 0x30) = iVar3; if (iVar3 != 1) { iVar3 = FUN_00ae25e0(param_1,3); if (iVar3 == 0) { iVar3 = FUN_00ae2580(param_1); if (-1 < iVar3) { return 0; } } } } } return 0xffffffec; } //@@ 00adff50 FUN_00adff50 uint FUN_00adff50(undefined4 param_1) { uint uVar1; int iVar2; uint local_14 [4]; iVar2 = 0; do { uVar1 = FUN_00ae25e0(param_1,8); local_14[iVar2] = uVar1; iVar2 = iVar2 + 1; } while (iVar2 < 4); return ((local_14[3] << 8 | local_14[2]) << 8 | local_14[1]) << 8 | local_14[0]; } //@@ 00adff90 FUN_00adff90 void FUN_00adff90(undefined4 param_1,undefined1 *param_2,int param_3) { undefined1 uVar1; if (param_3 != 0) { do { uVar1 = FUN_00ae25e0(param_1,8); *param_2 = uVar1; param_2 = param_2 + 1; param_3 = param_3 + -1; } while (param_3 != 0); } return; } //@@ 00adffc0 FUN_00adffc0 undefined4 FUN_00adffc0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 *param_4) { undefined4 uVar1; undefined1 local_18 [20]; if (param_4 == (undefined4 *)0x0) { return 0xffffffec; } if (param_1 == 0) { return 0xffffffff; } FUN_00ae2630(local_18,*param_4,param_4[1]); uVar1 = oc_dec_headerin(local_18,param_1,param_2,param_3,param_4); return uVar1; } //@@ 00ae0010 FUN_00ae0010 void FUN_00ae0010(void *param_1) { if (param_1 != (void *)0x0) { FUN_00ae2d60((int)param_1 + 0x140); FUN_00ae2ad0(param_1); free(param_1); } return; } //@@ 00ae0040 FUN_00ae0040 void FUN_00ae0040(ushort *param_1,char *param_2) { short sVar1; short sVar2; int iVar3; int iVar4; iVar4 = (int)param_2[2] + (int)*param_2 + (int)param_2[6] + (int)param_2[4]; iVar3 = (int)param_2[3] + (int)param_2[5] + (int)param_2[7] + (int)param_2[1]; sVar2 = (short)(iVar3 >> 0x1f); sVar1 = (short)iVar3; *param_1 = ((ushort)(iVar4 + (iVar4 >> 0x1f) + 2 >> 2) ^ (sVar1 + sVar2 + 2) * 0x40) & 0xff ^ (sVar1 + sVar2 + 2) * 0x40; return; } //@@ 00ae00b0 FUN_00ae00b0 void FUN_00ae00b0(ushort *param_1,char *param_2) { short sVar1; short sVar2; sVar2 = (short)((int)param_2[5] + (int)param_2[1] >> 0x1f); sVar1 = (short)((int)param_2[5] + (int)param_2[1]); *param_1 = ((ushort)((int)*param_2 + (int)param_2[4] + ((int)*param_2 + (int)param_2[4] >> 0x1f) + 1 >> 1) ^ ((1 - sVar2) + sVar1) * -0x80) & 0xff ^ (sVar1 + sVar2 + 1) * 0x80; sVar2 = (short)((int)param_2[3] + (int)param_2[7] >> 0x1f); sVar1 = (short)((int)param_2[3] + (int)param_2[7]); param_1[1] = ((ushort)((int)param_2[6] + (int)param_2[2] + ((int)param_2[6] + (int)param_2[2] >> 0x1f) + 1 >> 1) ^ ((1 - sVar2) + sVar1) * -0x80) & 0xff ^ (sVar1 + sVar2 + 1) * 0x80; return; } //@@ 00ae0140 FUN_00ae0140 void FUN_00ae0140(ushort *param_1,char *param_2) { short sVar1; short sVar2; sVar2 = (short)((int)param_2[3] + (int)param_2[1] >> 0x1f); sVar1 = (short)((int)param_2[3] + (int)param_2[1]); *param_1 = ((ushort)((int)*param_2 + (int)param_2[2] + ((int)*param_2 + (int)param_2[2] >> 0x1f) + 1 >> 1) ^ ((1 - sVar2) + sVar1) * -0x80) & 0xff ^ (sVar1 + sVar2 + 1) * 0x80; sVar2 = (short)((int)param_2[5] + (int)param_2[7] >> 0x1f); sVar1 = (short)((int)param_2[5] + (int)param_2[7]); param_1[2] = ((ushort)((int)param_2[6] + (int)param_2[4] + ((int)param_2[6] + (int)param_2[4] >> 0x1f) + 1 >> 1) ^ ((1 - sVar2) + sVar1) * -0x80) & 0xff ^ (sVar1 + sVar2 + 1) * 0x80; return; } //@@ 00ae01d0 FUN_00ae01d0 void FUN_00ae01d0(undefined2 *param_1,undefined2 *param_2) { *param_1 = *param_2; param_1[1] = param_2[1]; param_1[2] = param_2[2]; param_1[3] = param_2[3]; return; } //@@ 00ae0200 loop_filter_h /* DB: libtheora state.c: 8 rows, f=_bv[(p[-2]-p[1]+3*(p[0]-p[-1])+4)>>3], clamp p[-1]+f / p[0]-f, step ystride; called twice from FUN_00ae1b60 (oc_state_loop_filter_frag_rows) */ void loop_filter_h(byte *param_1,int param_2,int param_3) { byte bVar1; char cVar2; byte bVar3; uint uVar4; int iVar5; byte *pbVar6; bVar1 = *param_1; uVar4 = CONCAT11(bVar1,param_1[-1]) & 0xff; cVar2 = *(char *)(((int)(param_1[-2] + 4 + ((bVar1 - uVar4) * 3 - (uint)param_1[1])) >> 3) + param_3); iVar5 = uVar4 + (int)cVar2; param_1[-1] = (cVar2 + param_1[-1] | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; *param_1 = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = param_1 + -2 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = pbVar6 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = pbVar6 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = pbVar6 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = pbVar6 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = pbVar6 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; pbVar6 = pbVar6 + param_2; bVar1 = pbVar6[2]; bVar3 = pbVar6[1]; cVar2 = *(char *)(((int)(*pbVar6 + 4 + (((uint)bVar1 - (uint)bVar3) * 3 - (uint)pbVar6[3])) >> 3) + param_3); iVar5 = (uint)bVar3 + (int)cVar2; pbVar6[1] = (cVar2 + bVar3 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; iVar5 = (uint)bVar1 - (int)cVar2; pbVar6[2] = (bVar1 - cVar2 | (iVar5 < 0x100) - 1U) & -(char)(iVar5 >> 0x1f) - 1U; return; } //@@ 00ae05b0 loop_filter_v /* DB: libtheora state.c static loop_filter_v: _pix-=2*ystride, for 8 columns f=bv[(p0-p3+3*(p2-p1)+4)>>3], clamp p1+f / p2-f; called with loop_filter_h (FUN_00ae0200) from oc_state_loop_filter_frag_rows (FUN_00ae1b60) */ void loop_filter_v(byte *param_1,int param_2,int param_3) { byte *pbVar1; byte bVar2; char cVar3; byte *pbVar4; byte *pbVar5; int iVar6; pbVar4 = param_1 + param_2 * -2; pbVar1 = pbVar4 + param_2 * 3; bVar2 = pbVar4[param_2]; cVar3 = *(char *)(((int)(*pbVar4 + 4 + (((uint)*param_1 - (uint)bVar2) * 3 - (uint)*pbVar1)) >> 3) + param_3); pbVar5 = pbVar4 + param_2; iVar6 = (uint)bVar2 + (int)cVar3; *pbVar5 = ((iVar6 < 0x100) - 1U | cVar3 + bVar2) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)*param_1 - (int)cVar3; *param_1 = ((iVar6 < 0x100) - 1U | *param_1 - cVar3) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[1]; cVar3 = *(char *)(((int)(pbVar4[1] + 4 + (((uint)param_1[1] - (uint)bVar2) * 3 - (uint)pbVar1[1])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[1] = (bVar2 + cVar3 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)param_1[1] - (int)cVar3; param_1[1] = ((iVar6 < 0x100) - 1U | param_1[1] - cVar3) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[2]; cVar3 = *(char *)(((int)(pbVar4[2] + 4 + (((uint)param_1[2] - (uint)bVar2) * 3 - (uint)pbVar1[2])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[2] = (bVar2 + cVar3 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)param_1[2] - (int)cVar3; param_1[2] = (param_1[2] - cVar3 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[3]; cVar3 = *(char *)(((int)(pbVar4[3] + 4 + (((uint)param_1[3] - (uint)bVar2) * 3 - (uint)pbVar1[3])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[3] = (bVar2 + cVar3 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)param_1[3] - (int)cVar3; param_1[3] = (param_1[3] - cVar3 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[4]; cVar3 = *(char *)(((int)(pbVar4[4] + 4 + (((uint)pbVar4[param_2 * 2 + 4] - (uint)bVar2) * 3 - (uint)pbVar1[4])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[4] = ((iVar6 < 0x100) - 1U | bVar2 + cVar3) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)pbVar4[param_2 * 2 + 4] - (int)cVar3; pbVar4[param_2 * 2 + 4] = ((iVar6 < 0x100) - 1U | pbVar4[param_2 * 2 + 4] - cVar3) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[5]; cVar3 = *(char *)(((int)(pbVar4[5] + 4 + (((uint)param_1[5] - (uint)bVar2) * 3 - (uint)pbVar1[5])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[5] = ((iVar6 < 0x100) - 1U | bVar2 + cVar3) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)param_1[5] - (int)cVar3; param_1[5] = ((iVar6 < 0x100) - 1U | param_1[5] - cVar3) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[6]; cVar3 = *(char *)(((int)(pbVar4[6] + 4 + (((uint)pbVar4[param_2 * 2 + 6] - (uint)bVar2) * 3 - (uint)pbVar4[param_2 * 3 + 6])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[6] = (cVar3 + bVar2 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)pbVar4[param_2 * 2 + 6] - (int)cVar3; pbVar4[param_2 * 2 + 6] = ((iVar6 < 0x100) - 1U | pbVar4[param_2 * 2 + 6] - cVar3) & -(char)(iVar6 >> 0x1f) - 1U; bVar2 = pbVar5[7]; cVar3 = *(char *)(((int)(pbVar4[7] + 4 + (((uint)param_1[7] - (uint)bVar2) * 3 - (uint)pbVar1[7])) >> 3) + param_3); iVar6 = (uint)bVar2 + (int)cVar3; pbVar5[7] = (cVar3 + bVar2 | (iVar6 < 0x100) - 1U) & -(char)(iVar6 >> 0x1f) - 1U; iVar6 = (uint)param_1[7] - (int)cVar3; param_1[7] = ((iVar6 < 0x100) - 1U | param_1[7] - cVar3) & -(char)(iVar6 >> 0x1f) - 1U; return; } //@@ 00ae09a0 FUN_00ae09a0 void FUN_00ae09a0(void *param_1,int param_2) { int iVar1; int iVar2; char cVar3; char *pcVar4; memset(param_1,0,0x100); iVar1 = 0; if (0 < param_2) { iVar2 = 0x7f - param_2; do { cVar3 = (char)iVar1; if (-1 < iVar2) { *(char *)(iVar2 + (int)param_1) = cVar3 - (char)param_2; } *(char *)((int)param_1 + iVar2 + param_2) = -cVar3; pcVar4 = (char *)((int)param_1 + iVar1 + 0x7f); *pcVar4 = cVar3; if ((int)(pcVar4 + (param_2 - (int)param_1)) < 0x100) { pcVar4[param_2] = (char)param_2 - cVar3; } iVar1 = iVar1 + 1; iVar2 = iVar2 + -1; } while (iVar1 < param_2); } return; } //@@ 00ae0a20 FUN_00ae0a20 void FUN_00ae0a20(int param_1,int param_2,int param_3,int param_4) { int iVar1; iVar1 = (param_4 >> 1) * *(int *)(param_2 + 0x20) + (param_3 >> 1); *(int *)(param_1 + 0x10) = *(int *)(param_2 + 0x28) + iVar1; *(int *)(param_1 + 0x20) = *(int *)(param_2 + 0x48) + iVar1; return; } //@@ 00ae0a50 FUN_00ae0a50 void FUN_00ae0a50(int param_1,int param_2,int param_3,int param_4) { param_3 = (param_4 >> 1) * *(int *)(param_2 + 0x20) + param_3; *(int *)(param_1 + 0x10) = *(int *)(param_2 + 0x28) + param_3; *(int *)(param_1 + 0x20) = *(int *)(param_2 + 0x48) + param_3; *(int *)(param_1 + 0x14) = *(int *)(param_2 + 0x28) + 1 + param_3; *(int *)(param_1 + 0x24) = *(int *)(param_2 + 0x48) + 1 + param_3; return; } //@@ 00ae0a90 FUN_00ae0a90 void FUN_00ae0a90(int param_1,int param_2,int param_3,int param_4) { int iVar1; iVar1 = *(int *)(param_2 + 0x20) * param_4 + (param_3 >> 1); *(int *)(param_1 + 0x10) = *(int *)(param_2 + 0x28) + iVar1; *(int *)(param_1 + 0x20) = *(int *)(param_2 + 0x48) + iVar1; iVar1 = iVar1 + *(int *)(param_2 + 0x20); *(int *)(param_1 + 0x18) = *(int *)(param_2 + 0x28) + iVar1; *(int *)(param_1 + 0x28) = *(int *)(param_2 + 0x48) + iVar1; return; } //@@ 00ae0ad0 FUN_00ae0ad0 void FUN_00ae0ad0(int *param_1,int param_2) { param_1[4] = *(int *)(param_2 + 0x28) + *param_1; param_1[8] = *(int *)(param_2 + 0x48) + *param_1; param_1[5] = *(int *)(param_2 + 0x28) + param_1[1]; param_1[9] = *(int *)(param_2 + 0x48) + param_1[1]; param_1[6] = *(int *)(param_2 + 0x28) + param_1[2]; param_1[10] = *(int *)(param_2 + 0x48) + param_1[2]; param_1[7] = *(int *)(param_2 + 0x28) + param_1[3]; param_1[0xb] = *(int *)(param_2 + 0x48) + param_1[3]; return; } //@@ 00ae0b30 FUN_00ae0b30 void FUN_00ae0b30(int param_1) { *(undefined4 *)(param_1 + 0x6c) = 0; *(code **)(param_1 + 0x40) = FUN_00ae31c0; *(code **)(param_1 + 0x44) = FUN_00ae3240; *(code **)(param_1 + 0x48) = FUN_00ae36c0; *(code **)(param_1 + 0x4c) = FUN_00ae34f0; *(code **)(param_1 + 0x50) = FUN_00ae32f0; *(code **)(param_1 + 0x54) = oc_idct8x8_c; *(code **)(param_1 + 0x58) = FUN_00ae1160; *(code **)(param_1 + 0x5c) = FUN_00ae09a0; *(code **)(param_1 + 0x60) = oc_state_loop_filter_frag_rows; *(code **)(param_1 + 100) = guard_check_icall; *(undefined **)(param_1 + 0x68) = &DAT_00b18c80; return; } //@@ 00ae0b90 oc_state_border_init /* DB: libtheora state.c: called at the end of oc_state_frarray_init (00ae1330); zeroes nborders (+0x274), walks the 3 fplanes (+0x70, stride 0x20) over frags (+0xd0) with picture crop pic_x/pic_y/pic_width/pic_height (+0x14/+0x18/+0xc/+0x10) halved for chroma by pixel_fmt (+0x30) and marks border/invalid fragments */ void oc_state_border_init(int param_1) { int iVar1; uint *puVar2; int iVar3; uint *puVar4; uint uVar5; uint uVar6; uint uVar7; int local_40; int local_38; int *local_34; uint *local_30; int local_2c; int local_28; int local_24; uint *local_20; int local_1c; int local_18; uint local_14; uint uStack_10; int local_c; int local_8; local_30 = *(uint **)(param_1 + 0xd0); local_34 = (int *)(param_1 + 0x70); *(undefined4 *)(param_1 + 0x274) = 0; local_38 = 0; local_20 = local_30; do { local_1c = *(int *)(param_1 + 0x14); local_18 = *(int *)(param_1 + 0x18); local_24 = *(int *)(param_1 + 0xc) + local_1c; local_8 = *(int *)(param_1 + 0x10) + local_18; if (local_38 != 0) { if ((*(uint *)(param_1 + 0x30) & 1) == 0) { local_1c = local_1c >> 1; local_24 = local_24 + 1 >> 1; } if ((*(uint *)(param_1 + 0x30) & 2) == 0) { local_18 = local_18 >> 1; local_8 = local_8 + 1 >> 1; } } local_2c = 0; local_30 = local_30 + local_34[3]; while (local_20 < local_30) { puVar2 = local_20 + *local_34; if (local_20 < puVar2) { local_28 = 8; do { if (((((local_1c < local_28) && (iVar1 = local_28 + -8, iVar1 < local_24)) && (local_18 < local_2c + 8)) && ((local_2c < local_8 && (local_1c < local_24)))) && (local_18 < local_8)) { if (((iVar1 < local_1c) || (local_24 < local_28)) || ((local_2c < local_18 || (local_8 < local_2c + 8)))) { local_c = 0; uStack_10 = 0; local_14 = 0; local_40 = 0; uVar5 = 0; iVar3 = local_2c; do { uVar7 = local_40 << 3; if (((local_1c <= iVar1) && (local_18 <= iVar3)) && (iVar3 < local_8)) { local_14 = 1 << (uVar7 & 0x1f); uVar6 = 0; if (0x1f < uVar7) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < uVar7) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if (((local_1c <= local_28 + -7) && (local_28 + -7 < local_24)) && ((local_18 <= iVar3 && (iVar3 < local_8)))) { local_14 = 1 << (uVar7 & 0x1f | 1); uVar6 = 0; if (0x1f < (uVar7 | 1)) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < (uVar7 | 1)) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if (((local_1c <= local_28 + -6) && (local_28 + -6 < local_24)) && ((local_18 <= iVar3 && (iVar3 < local_8)))) { local_14 = 1 << (uVar7 & 0x1f | 2); uVar6 = 0; if (0x1f < (uVar7 | 2)) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < (uVar7 | 2)) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if ((((local_1c <= local_28 + -5) && (local_28 + -5 < local_24)) && (local_18 <= iVar3)) && (iVar3 < local_8)) { local_14 = 1 << (uVar7 & 0x1f | 3); uVar6 = 0; if (0x1f < (uVar7 | 3)) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < (uVar7 | 3)) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if (((local_1c <= local_28 + -4) && (local_28 + -4 < local_24)) && ((local_18 <= iVar3 && (iVar3 < local_8)))) { local_14 = 1 << (uVar7 & 0x1f | 4); uVar6 = 0; if (0x1f < (uVar7 | 4)) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < (uVar7 | 4)) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if (((local_1c <= local_28 + -3) && (local_28 + -3 < local_24)) && ((local_18 <= iVar3 && (iVar3 < local_8)))) { local_14 = 1 << (uVar7 & 0x1f | 5); uVar6 = 0; if (0x1f < (uVar7 | 5)) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < (uVar7 | 5)) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if ((((local_1c <= local_28 + -2) && (local_28 + -2 < local_24)) && (local_18 <= iVar3)) && (iVar3 < local_8)) { local_14 = 1 << (uVar7 & 0x1f | 6); uVar6 = 0; if (0x1f < (uVar7 | 6)) { uVar6 = local_14; } local_14 = local_14 ^ uVar6; if (0x3f < (uVar7 | 6)) { uVar6 = local_14; } local_14 = uVar5 | local_14; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } if (((local_1c <= local_28 + -1) && (local_28 + -1 < local_24)) && ((local_18 <= iVar3 && (iVar3 < local_8)))) { uVar5 = 1 << (uVar7 & 0x1f | 7); uVar6 = 0; if (0x1f < (uVar7 | 7)) { uVar6 = uVar5; } uVar5 = uVar5 ^ uVar6; if (0x3f < (uVar7 | 7)) { uVar6 = uVar5; } local_14 = local_14 | uVar5; uStack_10 = uStack_10 | uVar6; local_c = local_c + 1; uVar5 = local_14; } iVar3 = iVar3 + 1; local_40 = local_40 + 1; } while (local_40 < 8); iVar3 = 0; iVar1 = *(int *)(param_1 + 0x274); if (0 < iVar1) { puVar4 = (uint *)(param_1 + 0x278); do { if ((*puVar4 == local_14) && (puVar4[1] == uStack_10)) goto LAB_00ae0f2e; iVar3 = iVar3 + 1; puVar4 = puVar4 + 4; } while (iVar3 < iVar1); } *(int *)(param_1 + 0x274) = iVar1 + 1; *(uint *)(param_1 + 0x278 + iVar3 * 0x10) = local_14; *(uint *)(param_1 + 0x27c + iVar3 * 0x10) = uStack_10; *(int *)(param_1 + (iVar3 + 0x28) * 0x10) = local_c; LAB_00ae0f2e: *local_20 = *local_20 ^ (iVar3 << 0xb ^ *local_20) & 0xf800; } else { *local_20 = *local_20 | 0xf800; } } else { *local_20 = *local_20 | 2; } local_20 = local_20 + 1; local_28 = local_28 + 8; } while (local_20 < puVar2); } local_2c = local_2c + 8; } local_34 = local_34 + 8; local_38 = local_38 + 1; if (2 < local_38) { return; } } while( true ); } //@@ 00ae0fa0 oc_state_borders_fill_caps /* DB: libtheora: for frame buffer [refi=arg2][pli=arg3] (state + 0x114 + (pli+refi*3)*0x10) copies the first and last row outward into the top/bottom padding (16 rows luma, 8 or 16 chroma by pixel_fmt bits at +0x30); th_decode_packetin calls it for the 3 planes */ void oc_state_borders_fill_caps(int param_1,int param_2,int param_3) { size_t _Size; int iVar1; void *_Src; void *_Src_00; void *pvVar2; int iVar3; iVar1 = param_3; if ((param_3 == 0) || ((*(byte *)(param_1 + 0x30) & 1) != 0)) { iVar3 = 0x10; if (param_3 != 0) goto LAB_00ae0fc6; } else { iVar3 = 8; LAB_00ae0fc6: param_3 = 8; if ((*(byte *)(param_1 + 0x30) & 2) == 0) goto LAB_00ae0fda; } param_3 = 0x10; LAB_00ae0fda: param_1 = param_1 + (iVar1 + param_2 * 3) * 0x10; iVar1 = *(int *)(param_1 + 0x11c); _Size = *(int *)(param_1 + 0x114) + iVar3 * 2; pvVar2 = (void *)(*(int *)(param_1 + 0x120) - iVar3); _Src = (void *)(((*(int *)(param_1 + 0x118) + -1) * iVar1 - iVar3) + *(int *)(param_1 + 0x120)); _Src_00 = pvVar2; while (_Src_00 != (void *)((int)pvVar2 - param_3 * iVar1)) { memcpy((void *)((int)_Src_00 - iVar1),_Src_00,_Size); memcpy((void *)(iVar1 + (int)_Src),_Src,_Size); _Src = (void *)(iVar1 + (int)_Src); _Src_00 = (void *)((int)_Src_00 - iVar1); } return; } //@@ 00ae1060 oc_state_borders_fill_rows /* DB: libtheora: for plane pli (param_2) and rows [param_4,param_5) of frame buffer param_3, memsets the left/right padding (16 px, 8 for subsampled chroma when pixel_fmt&1) from the edge pixels; only caller th_decode_packetin */ void oc_state_borders_fill_rows(int param_1,int param_2,size_t param_3,int param_4,int param_5) { int iVar1; int iVar2; int iVar3; byte *pbVar4; byte *_Dst; byte *pbVar5; byte *pbVar6; iVar1 = param_3; if ((param_3 == 0) || (param_3 = 8, (*(byte *)(param_1 + 0x30) & 1) != 0)) { param_3 = 0x10; } iVar1 = iVar1 + param_2 * 3; iVar2 = *(int *)(param_1 + 0x11c + iVar1 * 0x10); iVar3 = *(int *)(param_1 + 0x120 + iVar1 * 0x10); pbVar5 = (byte *)(iVar2 * param_4 + iVar3); pbVar4 = (byte *)(iVar2 * param_5 + iVar3); pbVar6 = pbVar5 + *(int *)(param_1 + 0x114 + iVar1 * 0x10) + -1; if (pbVar5 != pbVar4) { _Dst = pbVar5 + -param_3; do { memset(_Dst,(uint)*pbVar5,param_3); memset(pbVar6 + 1,(uint)*pbVar6,param_3); pbVar5 = pbVar5 + iVar2; _Dst = _Dst + iVar2; pbVar6 = pbVar6 + iVar2; } while (pbVar5 != pbVar4); } return; } //@@ 00ae1100 FUN_00ae1100 void FUN_00ae1100(int param_1) { free(*(void **)(param_1 + 0xd4)); FUN_00adbdb0(*(undefined4 *)(param_1 + 0x264)); free(*(void **)(param_1 + 0x100)); free(*(void **)(param_1 + 0xf0)); free(*(void **)(param_1 + 0xec)); free(*(void **)(param_1 + 0xe4)); free(*(void **)(param_1 + 0xe0)); free(*(void **)(param_1 + 0xd8)); free(*(void **)(param_1 + 0xd0)); return; } //@@ 00ae1160 FUN_00ae1160 void FUN_00ae1160(int param_1,undefined *param_2,undefined *param_3,short *param_4,int param_5, ushort param_6) { uint *puVar1; short sVar2; int iVar3; char cVar4; int iVar5; uint uVar6; int iVar7; undefined *puVar8; undefined *puVar9; int iVar10; uint *puVar11; int iVar12; puVar1 = (uint *)(param_4 + 0x40); if (param_5 < 2) { uVar6 = (int)((int)*param_4 * (uint)param_6 + 0xf) >> 5; puVar11 = puVar1; for (iVar7 = 0x20; iVar7 != 0; iVar7 = iVar7 + -1) { *puVar11 = uVar6 & 0xffff | uVar6 << 0x10; puVar11 = puVar11 + 1; } } else { *param_4 = *param_4 * param_6; (**(code **)(param_1 + 0x54))(puVar1,param_4,param_5); } iVar7 = *(int *)(*(int *)(param_1 + 0xd4) + (int)param_2 * 4); iVar12 = *(int *)(param_1 + 0x254) + iVar7; iVar3 = *(int *)(param_1 + 0x268 + (int)param_3 * 4); uVar6 = *(uint *)(*(int *)(param_1 + 0xd0) + (int)param_2 * 4) >> 6 & 3; if (uVar6 == 2) { (**(code **)(param_1 + 0x48))(iVar12,iVar3,puVar1); return; } iVar7 = iVar7 + *(int *)(param_1 + 0x24c + uVar6 * 4); sVar2 = *(short *)(*(int *)(param_1 + 0xd8) + (int)param_2 * 2); if ((param_3 == (undefined *)0x0) || ((*(byte *)(param_1 + 0x30) & 2) != 0)) { puVar8 = &DAT_00b1929f; param_2 = &DAT_00b1931f; } else { puVar8 = &DAT_00b192df; param_2 = &DAT_00b1935f; } cVar4 = (char)sVar2; iVar5 = (int)sVar2 >> 8; if ((param_3 == (undefined *)0x0) || ((*(byte *)(param_1 + 0x30) & 1) != 0)) { puVar9 = &DAT_00b1931f; param_3 = &DAT_00b1929f; } else { puVar9 = &DAT_00b1935f; param_3 = &DAT_00b192df; } iVar10 = (int)(char)param_3[cVar4] + (char)puVar8[iVar5] * iVar3; if (((char)puVar9[cVar4] == 0) && ((char)param_2[iVar5] == 0)) { (**(code **)(param_1 + 0x4c))(iVar12,iVar7 + iVar10,iVar3,puVar1); return; } (**(code **)(param_1 + 0x50)) (iVar12,iVar10 + iVar7, (char)param_2[iVar5] * iVar3 + iVar10 + (int)(char)puVar9[cVar4] + iVar7,iVar3,puVar1); return; } //@@ 00ae12e0 FUN_00ae12e0 void FUN_00ae12e0(int param_1) { free(*(void **)(param_1 + 0x100)); free(*(void **)(param_1 + 0xf0)); free(*(void **)(param_1 + 0xec)); free(*(void **)(param_1 + 0xe4)); free(*(void **)(param_1 + 0xe0)); free(*(void **)(param_1 + 0xd8)); free(*(void **)(param_1 + 0xd0)); return; } //@@ 00ae1330 oc_state_frarray_init /* DB: libtheora state.c: computes fragment/superblock/macroblock counts from frame width/height>>3 and pixel_fmt chroma decimation, calloc frags(4)/malloc frag_mvs(2)/sb_maps(0x40)/sb_flags/mb_maps(0x30)/mb_modes/coded_fragis; called by FUN_00ae19b0 (oc_state_init); ends with oc_state_border_init (00ae0b90) */ undefined4 oc_state_frarray_init(int param_1) { int iVar1; size_t _Count; code *pcVar2; uint uVar3; int *piVar4; void *pvVar5; uint uVar6; uint uVar7; uint uVar8; byte bVar9; uint uVar10; int iVar11; int iVar12; int iVar13; int iVar14; int iVar15; size_t _Count_00; int iVar16; uint uVar17; uint uVar18; int iVar19; int *piVar20; int local_44; byte *local_40; int local_3c; int local_34; int local_2c; int local_28; int *local_24; int *local_1c; int local_18; int local_14; int local_10; int local_c; uint local_8; uVar10 = *(uint *)(param_1 + 4) >> 3; uVar6 = ~*(uint *)(param_1 + 0x30) & 1; uVar17 = *(uint *)(param_1 + 8) >> 3; uVar3 = ~(*(uint *)(param_1 + 0x30) >> 1) & 1; iVar16 = uVar17 * uVar10; iVar13 = (int)(uVar6 + uVar10) >> (sbyte)uVar6; iVar14 = (int)(uVar3 + uVar17) >> (sbyte)uVar3; iVar15 = iVar14 * iVar13; uVar7 = uVar17 + 3 >> 2; uVar3 = uVar10 + 3 >> 2; iVar11 = iVar13 + 3 >> 2; uVar8 = uVar7 * uVar3; iVar12 = iVar14 + 3 >> 2; uVar18 = iVar12 * iVar11; uVar6 = uVar18 * 2 + uVar8; _Count = uVar8 * 4; if ((((iVar16 / (int)uVar10 != uVar17) || (iVar15 * 2 < iVar15)) || (iVar15 * 2 + iVar16 < iVar16) ) || (((uVar8 / uVar3 != uVar7 || (uVar18 * 2 < uVar18)) || ((uVar6 < uVar8 || ((uVar8 & 0x3fffffff) != uVar8)))))) { return 0xffffffe9; } piVar4 = (int *)(param_1 + 0x70); *(uint *)(param_1 + 0x70) = uVar10; *(uint *)(param_1 + 0x74) = uVar17; *(undefined4 *)(param_1 + 0x78) = 0; *(int *)(param_1 + 0x7c) = iVar16; *(uint *)(param_1 + 0x80) = uVar3; *(uint *)(param_1 + 0x84) = uVar7; *(undefined4 *)(param_1 + 0x88) = 0; local_1c = (int *)(param_1 + 0x88); *(int *)(param_1 + 0xb0) = iVar13; *(int *)(param_1 + 0x90) = iVar13; *(int *)(param_1 + 0xb4) = iVar14; *(int *)(param_1 + 0x94) = iVar14; *(int *)(param_1 + 0xb8) = iVar15 + iVar16; *(int *)(param_1 + 0xbc) = iVar15; *(int *)(param_1 + 0x9c) = iVar15; *(int *)(param_1 + 0xc0) = iVar11; _Count_00 = iVar15 * 2 + iVar16; *(int *)(param_1 + 0xa0) = iVar11; *(int *)(param_1 + 0xc4) = iVar12; *(int *)(param_1 + 0xa4) = iVar12; *(uint *)(param_1 + 0xcc) = uVar18; *(uint *)(param_1 + 0xac) = uVar18; *(uint *)(param_1 + 0x8c) = uVar8; *(int *)(param_1 + 0x98) = iVar16; *(uint *)(param_1 + 0xa8) = uVar8; *(uint *)(param_1 + 200) = uVar18 + uVar8; *(size_t *)(param_1 + 0xdc) = _Count_00; pvVar5 = calloc(_Count_00,4); *(void **)(param_1 + 0xd0) = pvVar5; pvVar5 = malloc(_Count_00 * 2); *(void **)(param_1 + 0xd8) = pvVar5; *(uint *)(param_1 + 0xe8) = uVar6; pvVar5 = malloc(uVar6 * 0x40); *(void **)(param_1 + 0xe0) = pvVar5; pvVar5 = calloc(uVar6,1); *(void **)(param_1 + 0xe4) = pvVar5; *(uint *)(param_1 + 0xf4) = uVar3 * 2; *(uint *)(param_1 + 0xf8) = uVar7 * 2; *(size_t *)(param_1 + 0xfc) = _Count; pvVar5 = calloc(_Count,0x30); *(void **)(param_1 + 0xec) = pvVar5; pvVar5 = calloc(_Count,1); *(void **)(param_1 + 0xf0) = pvVar5; pvVar5 = malloc(_Count_00 * 4); *(void **)(param_1 + 0x100) = pvVar5; if (((*(int *)(param_1 + 0xd0) == 0) || (*(int *)(param_1 + 0xd8) == 0)) || ((*(int *)(param_1 + 0xe0) == 0 || ((((*(int *)(param_1 + 0xe4) == 0 || (*(int *)(param_1 + 0xec) == 0)) || (*(int *)(param_1 + 0xf0) == 0)) || (pvVar5 == (void *)0x0)))))) { return 0xffffffff; } local_44 = 3; LAB_00ae1600: local_18 = local_1c[-5]; iVar12 = local_1c[-6]; iVar14 = *(int *)(param_1 + 0xe4) + *local_1c; iVar15 = *(int *)(param_1 + 0xe0) + *local_1c * 0x40; iVar13 = 0; local_10 = 0; iVar11 = local_1c[-4]; LAB_00ae1635: if (local_18 < 5) { local_2c = local_18; if (local_18 < 1) goto LAB_00ae1784; } else { local_2c = 4; } local_c = iVar13 << 6; local_3c = iVar12; local_14 = iVar11; do { if (local_3c < 5) { local_28 = local_3c; if (local_3c < 1) goto LAB_00ae176d; } else { local_28 = 4; } memset((undefined4 *)(local_c + iVar15),0xff,0x40); if (local_2c != 0) { local_24 = &DAT_00b191f4; iVar13 = local_2c; iVar16 = local_14; do { iVar19 = 0; piVar20 = local_24; if (local_28 != 0) { do { iVar1 = iVar19 + iVar16; iVar19 = iVar19 + 1; *(int *)(iVar15 + (*piVar20 + (piVar20[-1] + local_10 * 4) * 4) * 4) = iVar1; piVar20 = piVar20 + 2; } while (iVar19 < local_28); } local_24 = local_24 + 8; iVar16 = iVar16 + iVar12; iVar13 = iVar13 + -1; } while (iVar13 != 0); iVar13 = local_10; } local_14 = local_14 + 4; *(byte *)(iVar13 + iVar14) = *(byte *)(iVar13 + iVar14) | ((byte)((uint)*(undefined4 *)(local_c + iVar15) >> 0x1f) ^ 1) << 2; bVar9 = ((byte)((uint)*(undefined4 *)(iVar15 + 0x10 + local_c) >> 0x1f) ^ 1) << 3 | *(byte *)(iVar13 + iVar14); *(byte *)(iVar13 + iVar14) = bVar9; bVar9 = ((byte)((uint)*(undefined4 *)(iVar15 + 0x20 + local_c) >> 0x1f) ^ 1) << 4 | bVar9; *(byte *)(iVar13 + iVar14) = bVar9; *(byte *)(iVar13 + iVar14) = ((byte)((uint)*(undefined4 *)(iVar15 + 0x38 + local_c) >> 0x1f) << 5 ^ 0xe3) & 0x3c | bVar9 ; iVar13 = iVar13 + 1; local_3c = local_3c + -4; local_c = local_c + 0x40; local_10 = iVar13; } while( true ); LAB_00ae1784: local_1c = local_1c + 8; local_44 = local_44 + -1; if (local_44 == 0) { iVar11 = *(int *)(param_1 + 0xf0); iVar13 = 0; iVar12 = *(int *)(param_1 + 0xec); local_34 = 0; pcVar2 = (code *)(&PTR_FUN_00b19270)[*(int *)(param_1 + 0x30)]; local_1c = (int *)0x0; if (0 < *(int *)(param_1 + 0x74)) { do { local_8 = 0; if (0 < *piVar4) { do { local_3c = 0; local_40 = &DAT_00b18d40; do { local_44 = 0; uVar3 = local_3c * 2 | (uint)local_1c; do { uVar6 = (uint)*local_40 | iVar13 * 4; uVar7 = local_44 * 2 | local_8; piVar20 = (int *)(uVar6 * 0x30 + iVar12); memset(piVar20,0xff,0x30); if (((int)uVar7 < *(int *)(param_1 + 0x70)) && ((int)uVar3 < *(int *)(param_1 + 0x74))) { *piVar20 = uVar3 * *(int *)(param_1 + 0x70) + uVar7; piVar20[1] = *piVar4 * uVar3 + 1 + uVar7; piVar20[2] = *piVar4 * (uVar3 + 1) + uVar7; piVar20[3] = *piVar4 * (uVar3 + 1) + 1 + uVar7; (*pcVar2)(piVar20,piVar4,uVar7,uVar3); } else { *(undefined1 *)(iVar11 + uVar6) = 0xff; } local_44 = local_44 + 1; local_40 = local_40 + 1; } while (local_44 < 2); local_3c = local_3c + 1; } while ((int)local_40 < 0xb18d44); local_8 = local_8 + 4; iVar13 = local_34 + 1; local_34 = iVar13; } while ((int)local_8 < *piVar4); } local_1c = (int *)((int)local_1c + 4); } while ((int)local_1c < *(int *)(param_1 + 0x74)); } oc_state_border_init(param_1); return 0; } goto LAB_00ae1600; LAB_00ae176d: local_18 = local_18 + -4; iVar11 = iVar11 + iVar12 * 4; goto LAB_00ae1635; } //@@ 00ae1900 FUN_00ae1900 undefined4 FUN_00ae1900(int param_1,int *param_2,int param_3,short param_4) { int iVar1; undefined *puVar2; undefined *puVar3; undefined *puVar4; int iVar5; undefined *puVar6; iVar1 = *(int *)(param_1 + 0x268 + param_3 * 4); if ((param_3 == 0) || ((*(byte *)(param_1 + 0x30) & 2) != 0)) { puVar3 = &DAT_00b1929f; puVar6 = &DAT_00b1931f; } else { puVar3 = &DAT_00b192df; puVar6 = &DAT_00b1935f; } if ((param_3 == 0) || ((*(byte *)(param_1 + 0x30) & 1) != 0)) { puVar2 = &DAT_00b1931f; puVar4 = &DAT_00b1929f; } else { puVar2 = &DAT_00b1935f; puVar4 = &DAT_00b192df; } iVar5 = (int)(char)puVar4[(char)param_4] + (char)puVar3[(int)param_4 >> 8] * iVar1; if (((char)puVar2[(char)param_4] == 0) && ((char)puVar6[(int)param_4 >> 8] == 0)) { *param_2 = iVar5; return 1; } param_2[1] = (char)puVar6[(int)param_4 >> 8] * iVar1 + iVar5 + (int)(char)puVar2[(char)param_4]; *param_2 = iVar5; return 2; } //@@ 00ae19b0 FUN_00ae19b0 int FUN_00ae19b0(undefined4 *param_1,byte *param_2,undefined4 param_3) { uint uVar1; uint uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; int iVar6; if (param_2 == (byte *)0x0) { return -1; } uVar1 = *(uint *)(param_2 + 4); if ((((((uVar1 & 0xf) == 0) && (uVar2 = *(uint *)(param_2 + 8), (uVar2 & 0xf) == 0)) && (uVar1 != 0)) && ((uVar1 < 0x100000 && (uVar2 != 0)))) && ((uVar2 < 0x100000 && (*(int *)(param_2 + 0xc) + *(uint *)(param_2 + 0x14) <= uVar1)))) { if ((((((uint)(*(int *)(param_2 + 0x10) + *(int *)(param_2 + 0x18)) <= uVar2) && (*(uint *)(param_2 + 0x14) < 0x100)) && ((uVar2 - *(int *)(param_2 + 0x10)) - *(int *)(param_2 + 0x18) < 0x100)) && (((*(uint *)(param_2 + 0x2c) < 3 && (*(uint *)(param_2 + 0x30) < 4)) && (*(int *)(param_2 + 0x1c) != 0)))) && (*(int *)(param_2 + 0x20) != 0)) { memset(param_1,0,0xc9e0); uVar3 = *(undefined4 *)(param_2 + 4); uVar4 = *(undefined4 *)(param_2 + 8); uVar5 = *(undefined4 *)(param_2 + 0xc); *param_1 = *(undefined4 *)param_2; param_1[1] = uVar3; param_1[2] = uVar4; param_1[3] = uVar5; uVar3 = *(undefined4 *)(param_2 + 0x14); uVar4 = *(undefined4 *)(param_2 + 0x18); uVar5 = *(undefined4 *)(param_2 + 0x1c); param_1[4] = *(undefined4 *)(param_2 + 0x10); param_1[5] = uVar3; param_1[6] = uVar4; param_1[7] = uVar5; uVar3 = *(undefined4 *)(param_2 + 0x24); uVar4 = *(undefined4 *)(param_2 + 0x28); uVar5 = *(undefined4 *)(param_2 + 0x2c); param_1[8] = *(undefined4 *)(param_2 + 0x20); param_1[9] = uVar3; param_1[10] = uVar4; param_1[0xb] = uVar5; uVar3 = *(undefined4 *)(param_2 + 0x34); uVar4 = *(undefined4 *)(param_2 + 0x38); uVar5 = *(undefined4 *)(param_2 + 0x3c); param_1[0xc] = *(undefined4 *)(param_2 + 0x30); param_1[0xd] = uVar3; param_1[0xe] = uVar4; param_1[0xf] = uVar5; param_1[6] = (*(int *)(param_2 + 8) - *(int *)(param_2 + 0x18)) - *(int *)(param_2 + 0x10); *(undefined1 *)(param_1 + 0xe4) = 0xff; FUN_00ae3150(param_1); iVar6 = oc_state_frarray_init(param_1); if (-1 < iVar6) { iVar6 = oc_state_ref_bufs_init(param_1,param_3); if (-1 < iVar6) { if ((*(int *)(param_2 + 0x3c) < 0) || (0x1f < *(int *)(param_2 + 0x3c))) { param_1[0xf] = 0x1f; } param_1[0xde] = 0; param_1[0xdf] = 0; param_1[0xe0] = 0xffffffff; param_1[0xe1] = 0xffffffff; if ((*param_2 < 4) && ((*param_2 != 3 || ((param_2[1] < 3 && ((param_2[1] != 2 || (param_2[2] == 0)))))))) { *(undefined1 *)((int)param_1 + 0x391) = 0; return 0; } *(undefined1 *)((int)param_1 + 0x391) = 1; return 0; } } FUN_00ae12e0(param_1); return iVar6; } } return -10; } //@@ 00ae1b60 oc_state_loop_filter_frag_rows /* DB: libtheora (round 7 agent) */ void oc_state_loop_filter_frag_rows (int param_1,int param_2,int param_3,int param_4,int param_5,int param_6) { int iVar1; int iVar2; int iVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; byte *pbVar9; int iVar10; int iVar11; int iVar12; byte *pbVar13; byte *local_14; byte *local_10; iVar8 = param_4 * 0x20; param_2 = param_2 + 0x7f; iVar2 = *(int *)(param_1 + 0x268 + param_4 * 4); iVar3 = *(int *)(iVar8 + 0x78 + param_1); iVar4 = *(int *)(iVar8 + 0x70 + param_1); iVar8 = *(int *)(iVar8 + 0x7c + param_1); param_5 = iVar4 * param_5 + iVar3; iVar5 = *(int *)(param_1 + 0xd4); iVar12 = iVar4 * param_6 + iVar3; iVar6 = *(int *)(param_1 + 0xd0); iVar7 = *(int *)(param_1 + 0x24c + param_3 * 4); if (param_5 < iVar12) { local_14 = (byte *)(iVar6 + param_5 * 4); local_10 = (byte *)(iVar6 + (param_5 + iVar4) * 4); do { iVar1 = param_5 + iVar4; if (param_5 < iVar1) { pbVar9 = local_10; iVar10 = param_5; pbVar13 = local_14; do { if ((*pbVar13 & 1) != 0) { iVar11 = *(int *)(pbVar13 + (iVar5 - iVar6)) + iVar7; if (param_5 < iVar10) { loop_filter_h(iVar11,iVar2,param_2); } if (iVar3 < param_5) { loop_filter_v(iVar11,iVar2,param_2); } if ((iVar10 + 1 < iVar1) && ((pbVar13[4] & 1) == 0)) { loop_filter_h(iVar11 + 8,iVar2,param_2); } if ((iVar4 + iVar10 < iVar8 + iVar3) && ((*pbVar9 & 1) == 0)) { loop_filter_v(iVar11 + iVar2 * 8,iVar2,param_2); } } iVar10 = iVar10 + 1; pbVar9 = pbVar9 + 4; pbVar13 = pbVar13 + 4; } while (iVar10 < iVar1); } local_10 = local_10 + iVar4 * 4; local_14 = local_14 + iVar4 * 4; param_5 = iVar1; } while (iVar1 < iVar12); } return; } //@@ 00ae1cf0 oc_state_ref_bufs_init /* DB: libtheora state.c: rejects _nrefs outside 3..6, computes padded frame sizes (+32 border, chroma decimation from pixel_fmt), overflow checks, aligned alloc of nrefs frame buffers + frag_buf_offs (malloc nfrags*4), fills ref_frame_bufs planes; caller oc_state_init (FUN_00ae19b0) */ undefined4 oc_state_ref_bufs_init(int param_1,int *param_2) { int iVar1; int iVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; uint uVar6; uint uVar7; int iVar8; void *_Memory; uint uVar9; undefined4 *puVar10; byte bVar11; byte bVar12; uint uVar13; int iVar14; int iVar15; int iVar16; uint uVar17; uint uVar18; int iVar19; int *piVar20; uint uVar21; int local_2c; uint *local_10; if (3 < (int)param_2 - 3U) { return 0xfffffff6; } iVar1 = *(int *)(param_1 + 4); bVar11 = ~(byte)*(uint *)(param_1 + 0x30) & 1; bVar12 = ~(byte)(*(uint *)(param_1 + 0x30) >> 1) & 1; uVar17 = iVar1 + 0x20; uVar21 = *(int *)(param_1 + 8) + 0x20; uVar6 = ((int)uVar17 >> bVar11) + 0xfU & 0xfffffff0; uVar13 = uVar21 * uVar17; uVar18 = ((int)uVar21 >> bVar12) * uVar6; iVar14 = (0x10 >> bVar12) * uVar6 + (0x10 >> bVar11); uVar9 = uVar18 * 2 + 0x10; uVar7 = (uVar9 + uVar13) * (int)param_2; if ((((uVar13 / uVar17 != uVar21) || (uVar9 < uVar18)) || (uVar9 + uVar13 < uVar13)) || (uVar7 / (uint)param_2 != uVar9 + uVar13)) { return 0xffffffe9; } iVar8 = FUN_00adbdd0(uVar7,0x10); _Memory = malloc(*(int *)(param_1 + 0xdc) << 2); *(void **)(param_1 + 0xd4) = _Memory; if ((iVar8 == 0) || (_Memory == (void *)0x0)) { free(_Memory); FUN_00adbdb0(iVar8); return 0xffffffff; } local_10 = (uint *)(param_1 + 0x11c); *(uint *)(param_1 + 0x114) = *(uint *)(param_1 + 4); *local_10 = uVar17; uVar9 = *(uint *)(param_1 + 4) >> bVar11; *(uint *)(param_1 + 0x118) = *(uint *)(param_1 + 8); uVar7 = *(uint *)(param_1 + 8) >> bVar12; *(uint *)(param_1 + 0x134) = uVar9; *(uint *)(param_1 + 0x124) = uVar9; *(uint *)(param_1 + 0x138) = uVar7; *(uint *)(param_1 + 0x128) = uVar7; *(uint *)(param_1 + 0x13c) = uVar6; *(uint *)(param_1 + 300) = uVar6; if ((int)param_2 < 2) { *(int *)(param_1 + 0x264) = iVar8; if ((int)param_2 < 1) goto LAB_00ae1eff; } else { iVar15 = (int)param_2 - 1; puVar10 = (undefined4 *)(param_1 + 0x144); do { uVar3 = *(undefined4 *)(param_1 + 0x118); uVar4 = *(undefined4 *)(param_1 + 0x11c); uVar5 = *(undefined4 *)(param_1 + 0x120); *puVar10 = *(undefined4 *)(param_1 + 0x114); puVar10[1] = uVar3; puVar10[2] = uVar4; puVar10[3] = uVar5; uVar3 = *(undefined4 *)(param_1 + 0x128); uVar4 = *(undefined4 *)(param_1 + 300); uVar5 = *(undefined4 *)(param_1 + 0x130); puVar10[4] = *(undefined4 *)(param_1 + 0x124); puVar10[5] = uVar3; puVar10[6] = uVar4; puVar10[7] = uVar5; uVar3 = *(undefined4 *)(param_1 + 0x138); uVar4 = *(undefined4 *)(param_1 + 0x13c); uVar5 = *(undefined4 *)(param_1 + 0x140); puVar10[8] = *(undefined4 *)(param_1 + 0x134); puVar10[9] = uVar3; puVar10[10] = uVar4; puVar10[0xb] = uVar5; iVar15 = iVar15 + -1; puVar10 = puVar10 + 0xc; } while (iVar15 != 0); *(int *)(param_1 + 0x264) = iVar8; } piVar20 = (int *)(param_1 + 0x130); do { piVar20[-4] = (iVar1 + 0x21) * 0x10 + iVar8; iVar8 = iVar8 + (-iVar14 & 0xfU) + uVar13; iVar15 = iVar8 + uVar18; *piVar20 = iVar8 + iVar14; iVar8 = iVar15 + (uVar18 - (-iVar14 & 0xfU)) + 0x10; piVar20[4] = iVar15 + iVar14; oc_ycbcr_buffer_flip(piVar20 + -7,piVar20 + -7); piVar20 = piVar20 + 0xc; param_2 = (int *)((int)param_2 - 1); } while (param_2 != (int *)0x0); LAB_00ae1eff: param_2 = (int *)(param_1 + 0x78); *(uint *)(param_1 + 0x270) = -uVar6; *(uint *)(param_1 + 0x26c) = -uVar6; iVar1 = *(int *)(param_1 + 0x120); *(uint *)(param_1 + 0x268) = -uVar17; iVar14 = 0; local_2c = 3; do { iVar8 = param_2[-2]; uVar9 = local_10[1]; iVar15 = param_2[1]; iVar2 = *param_2; uVar6 = *local_10; if (iVar14 < iVar15 + iVar2) { do { iVar19 = iVar8 + iVar14; if (iVar14 < iVar19) { iVar16 = uVar9 - iVar1; do { *(int *)((int)_Memory + iVar14 * 4) = iVar16; iVar14 = iVar14 + 1; iVar16 = iVar16 + 8; } while (iVar14 < iVar19); } uVar9 = uVar9 + uVar6 * 8; } while (iVar14 < iVar15 + iVar2); } param_2 = param_2 + 8; local_10 = local_10 + 4; local_2c = local_2c + -1; } while (local_2c != 0); *(undefined4 *)(param_1 + 0x240) = 0xffffffff; *(undefined4 *)(param_1 + 0x23c) = 0xffffffff; *(undefined4 *)(param_1 + 0x248) = 0xffffffff; *(undefined4 *)(param_1 + 0x244) = 0xffffffff; *(undefined4 *)(param_1 + 0x238) = 0xffffffff; *(undefined4 *)(param_1 + 0x234) = 0xffffffff; *(undefined4 *)(param_1 + 600) = 0; *(undefined4 *)(param_1 + 0x254) = 0; *(undefined4 *)(param_1 + 0x260) = 0; *(undefined4 *)(param_1 + 0x25c) = 0; *(undefined4 *)(param_1 + 0x250) = 0; *(undefined4 *)(param_1 + 0x24c) = 0; return 0; } //@@ 00ae2060 th_granule_frame /* DB: libtheora: iframe = granpos >> shift, pframe = granpos - (iframe << shift), minus 1 when info version >= 3.2.1; negative granpos -> -1; used after th_decode_packetin in the video player (KAGE_Audio::open_sound_file/audio_stream_seek), next to th_granule_time (00ae2110) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ longlong __cdecl th_granule_frame(void *decoder,longlong granulePosition) { longlong lVar1; longlong lVar2; if (granulePosition < 0) { return -1; } lVar2 = __allshr(); lVar1 = __allshl(); lVar1 = granulePosition - lVar1; if ((*(byte *)decoder < 4) && ((*(byte *)decoder != 3 || ((*(byte *)((int)decoder + 1) < 3 && ((*(byte *)((int)decoder + 1) != 2 || (*(char *)((int)decoder + 2) == '\0')))))))) { return lVar1 + lVar2; } return lVar2 + CONCAT44((int)((ulonglong)lVar1 >> 0x20) - (uint)((int)lVar1 == 0),(int)lVar1 + -1) ; } //@@ 00ae2110 FUN_00ae2110 float10 FUN_00ae2110(int param_1,longlong param_2) { double dVar1; double dVar2; if (param_2 < 0) { return (float10)-1.0; } __allshr(); __allshl(); dVar1 = (double)*(int *)(param_1 + 0x1c) + __uint_to_double_fixup[-(*(int *)(param_1 + 0x1c) >> 0x1f)]; dVar2 = ((double)*(int *)(param_1 + 0x20) + __uint_to_double_fixup[-(*(int *)(param_1 + 0x20) >> 0x1f)]) / dVar1; FUN_00aefe80(); return (float10)(dVar2 * dVar1); } //@@ 00ae2200 oc_dequant_tables_init /* DB: libtheora dequant.c: per qti/pli/qi builds dequant tables from th_quant_info (base matrices +0x140.., dc/ac scales), value*scale/100*4 clamped to 4096, pp_dc_scale = qi/160 written to param_2; from the decoder init FUN_00add260 (<- th_decode_alloc area 00ade980) */ void oc_dequant_tables_init(int param_1,int param_2,int param_3) { uint *puVar1; uint uVar2; int iVar3; uint uVar4; int iVar5; int iVar6; int *piVar7; int *piVar8; bool bVar9; uint local_90; uint uStack_8c; uint uStack_88; uint uStack_84; uint local_80; uint uStack_7c; uint uStack_78; uint uStack_74; uint local_70; uint uStack_6c; uint uStack_68; uint uStack_64; uint local_60; uint uStack_5c; uint uStack_58; uint uStack_54; int local_50; int local_4c; int local_48; uint local_44; int local_40; int local_3c; int local_38; int local_34; int local_30; undefined4 *local_2c; int local_28; int local_24; uint local_20; int local_1c; int local_18; int local_14; int *local_10; int local_c; int local_8; local_8 = 0; local_1c = 0; local_c = 0; local_40 = param_3 + 0x140; do { local_18 = 0; do { local_24 = 0; local_14 = 0; iVar3 = *(int *)(param_3 + 0x140 + (local_1c + local_18) * 0xc); local_48 = param_3 + (local_1c + local_18) * 0xc; if (-1 < iVar3) { local_28 = 0; local_50 = local_40 + local_18 * 0xc; local_44 = *(uint *)(&DAT_00b19380 + local_c); LAB_00ae2273: puVar1 = (uint *)(*(int *)(local_48 + 0x148) + local_28); local_90 = *puVar1; uStack_8c = puVar1[1]; uStack_88 = puVar1[2]; uStack_84 = puVar1[3]; local_80 = puVar1[4]; uStack_7c = puVar1[5]; uStack_78 = puVar1[6]; uStack_74 = puVar1[7]; local_70 = puVar1[8]; uStack_6c = puVar1[9]; uStack_68 = puVar1[10]; uStack_64 = puVar1[0xb]; local_60 = puVar1[0xc]; uStack_5c = puVar1[0xd]; uStack_58 = puVar1[0xe]; uStack_54 = puVar1[0xf]; if (local_14 == iVar3) { local_4c = 1; } else { local_4c = *(int *)(*(int *)(param_3 + (local_1c + 0x1b + local_18) * 0xc) + local_14 * 4) ; } local_4c = local_4c + local_24; local_3c = 0; local_34 = local_24 * 6; local_38 = local_24 * 3; local_30 = local_18 * 8 + local_24 * 0x18 + param_1; local_10 = (int *)(param_1 + (local_8 + (local_24 * 3 + local_18) * 2) * 4); do { uVar2 = (uint)*(ushort *)(param_3 + local_24 * 2) * (local_90 & 0xff); if (param_2 != 0) { *(uint *)(param_2 + local_24 * 4) = uVar2 / 0xa0; } uVar4 = (uVar2 / 100) * 4; uVar2 = uVar4; if (0x1000 < uVar4) { uVar2 = 0x1000; } local_20 = 1; *(ushort *)*local_10 = (short)local_44 - (-(ushort)(local_44 < uVar2) & ((short)local_44 - (-(ushort)(0x1000 < uVar4) & 0x1000U - (short)uVar4)) - (short)uVar4); do { uVar4 = (((uint)*(byte *)((int)&local_90 + (uint)(byte)(&DAT_00b18c80)[local_20]) * (uint)*(ushort *)(param_3 + 0x80 + local_24 * 2)) / 100) * 4; uVar2 = uVar4; if (0x1000 < uVar4) { uVar2 = 0x1000; } *(ushort *)(*local_10 + local_20 * 2) = (short)*(undefined4 *)(&DAT_00b19388 + local_c) - (-(ushort)(*(uint *)(&DAT_00b19388 + local_c) < uVar2) & ((short)*(undefined4 *)(&DAT_00b19388 + local_c) - (-(ushort)(0x1000 < uVar4) & 0x1000U - (short)uVar4)) - (short)uVar4); local_20 = local_20 + 1; } while ((int)local_20 < 0x40); iVar3 = 0; if (-1 < local_c) { do { iVar6 = 0; iVar5 = local_18; if (iVar3 < local_8) { iVar5 = 3; } if (iVar5 != 0) { local_2c = (undefined4 *)(param_1 + (local_34 + iVar3) * 4); do { local_20 = 0x7c; piVar7 = *(int **)(local_c + local_30); piVar8 = (int *)*local_2c; while (*piVar7 == *piVar8) { piVar7 = piVar7 + 1; piVar8 = piVar8 + 1; bVar9 = local_20 < 4; local_20 = local_20 - 4; if (bVar9) { *local_10 = *(int *)(param_1 + (iVar3 + (local_38 + iVar6) * 2) * 4); goto LAB_00ae247c; } } iVar6 = iVar6 + 1; local_2c = local_2c + 2; } while (iVar6 < iVar5); } iVar3 = iVar3 + 1; } while (iVar3 <= local_8); } LAB_00ae247c: local_30 = local_30 + 0x18; local_24 = local_24 + 1; local_34 = local_34 + 6; local_38 = local_38 + 3; local_10 = local_10 + 6; local_3c = local_3c + 1; if (local_4c <= local_24) goto LAB_00ae251c; iVar5 = 0; iVar6 = local_28 + *(int *)(local_50 + 8); iVar3 = *(int *)(*(int *)(local_50 + 4) + local_14 * 4); local_2c = (undefined4 *)(iVar3 * 2); do { *(char *)((int)&local_90 + iVar5) = (char)((int)(iVar3 + ((uint)*(byte *)(iVar6 + iVar5) * (local_4c - local_24) + (uint)*(byte *)(iVar6 + 0x40 + iVar5) * local_3c) * 2) / (int)local_2c); iVar5 = iVar5 + 1; } while (iVar5 < 0x40); } while( true ); } LAB_00ae253e: local_18 = local_18 + 1; } while (local_18 < 3); local_1c = local_1c + 3; local_c = local_c + 4; local_40 = local_40 + 0x24; local_8 = local_8 + 1; if (7 < local_c) { return; } } while( true ); LAB_00ae251c: local_28 = local_28 + 0x40; local_14 = local_14 + 1; iVar3 = *(int *)(local_48 + 0x140); if (iVar3 < local_14) goto LAB_00ae253e; goto LAB_00ae2273; } //@@ 00ae2580 FUN_00ae2580 int FUN_00ae2580(int *param_1) { if (param_1[4] == 0) { return ((param_1[3] >> 3) - param_1[1]) + *param_1; } return -1; } //@@ 00ae25a0 FUN_00ae25a0 uint FUN_00ae25a0(int param_1) { uint uVar1; int iVar2; iVar2 = *(int *)(param_1 + 0xc); uVar1 = *(uint *)(param_1 + 8); if (iVar2 < 1) { uVar1 = FUN_00ae2660(param_1,1); iVar2 = *(int *)(param_1 + 0xc); } *(uint *)(param_1 + 8) = uVar1 * 2; *(int *)(param_1 + 0xc) = iVar2 + -1; return uVar1 >> 0x1f; } //@@ 00ae25e0 FUN_00ae25e0 uint FUN_00ae25e0(int param_1,int param_2) { uint uVar1; int iVar2; uVar1 = *(uint *)(param_1 + 8); iVar2 = *(int *)(param_1 + 0xc); if (param_2 == 0) { return 0; } if (iVar2 < param_2) { uVar1 = FUN_00ae2660(param_1,param_2); iVar2 = *(int *)(param_1 + 0xc); } *(int *)(param_1 + 0xc) = iVar2 - param_2; *(uint *)(param_1 + 8) = uVar1 * 2 << ((char)param_2 - 1U & 0x1f); return uVar1 >> (0x20U - (char)param_2 & 0x1f); } //@@ 00ae2630 FUN_00ae2630 void FUN_00ae2630(int *param_1,int param_2,int param_3) { param_1[2] = 0; param_1[3] = 0; param_1[4] = 0; param_1[1] = param_2; *param_1 = param_3 + param_2; return; } //@@ 00ae2660 FUN_00ae2660 uint FUN_00ae2660(undefined4 *param_1,int param_2) { byte bVar1; byte *pbVar2; uint uVar3; byte *pbVar4; int iVar5; uint uVar6; uVar3 = 0x20 - param_1[3]; pbVar2 = (byte *)*param_1; uVar6 = param_1[2]; for (pbVar4 = (byte *)param_1[1]; (7 < uVar3 && (pbVar4 < pbVar2)); pbVar4 = pbVar4 + 1) { uVar3 = uVar3 - 8; uVar6 = uVar6 | (uint)*pbVar4 << ((byte)uVar3 & 0x1f); pbVar2 = (byte *)*param_1; } iVar5 = 0x20 - uVar3; param_1[1] = pbVar4; if (param_2 <= iVar5) { param_1[3] = iVar5; return uVar6; } if (pbVar4 < pbVar2) { bVar1 = *pbVar4; param_1[3] = iVar5; return bVar1 >> ((byte)iVar5 & 7) | uVar6; } param_1[4] = 1; param_1[3] = 0x40000000; return uVar6; } //@@ 00ae26e0 FUN_00ae26e0 int FUN_00ae26e0(int param_1,int param_2) { uint uVar1; int iVar2; int iVar3; uint uVar4; uVar4 = 0; iVar3 = 0; do { iVar2 = (uint)*(byte *)(param_1 + 1 + iVar3 * 2) - param_2; if (iVar2 < 0x20) { iVar3 = iVar3 + 1; uVar1 = 0x80000000 >> ((byte)iVar2 & 0x1f); } else { iVar2 = FUN_00ae26e0(param_1 + iVar3 * 2,param_2 + 0x1f); iVar3 = iVar3 + iVar2; uVar1 = 1; } uVar4 = uVar4 + uVar1; } while (uVar4 < 0x80000000); return iVar3; } //@@ 00ae2740 oc_huff_token_decode /* DB: libtheora Huffman decoder: refills the 32-bit window from the packed buffer (ptr/stop/window/available in arg1), walks the short-encoded tree (arg2) until a leaf (<= 0) and returns token & 0xff, consuming leaf>>8 bits; callers oc_dec_residual_tokens_unpack, th_decode_packetin and other token unpackers prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ int __cdecl oc_huff_token_decode(void *packBuf,short *tree) { byte bVar1; short sVar2; uint uVar3; byte *pbVar4; uint uVar5; int iVar6; int local_8; pbVar4 = *(byte **)((int)packBuf + 4); uVar5 = *(uint *)((int)packBuf + 8); iVar6 = *(int *)((int)packBuf + 0xc); local_8 = 0; do { sVar2 = tree[local_8]; if (iVar6 < sVar2) { uVar3 = 0x20 - iVar6; do { if (*(byte **)packBuf <= pbVar4) { uVar3 = 0xc0000000; break; } bVar1 = *pbVar4; uVar3 = uVar3 - 8; pbVar4 = pbVar4 + 1; uVar5 = uVar5 | (uint)bVar1 << ((byte)uVar3 & 0x1f); } while (7 < uVar3); iVar6 = 0x20 - uVar3; } local_8 = (int)tree[(uVar5 >> (0x20 - (byte)sVar2 & 0x1f)) + local_8 + 1]; if (local_8 < 1) { uVar3 = -local_8; *(int *)((int)packBuf + 0xc) = iVar6 - ((int)uVar3 >> 8); *(uint *)((int)packBuf + 8) = uVar5 << ((byte)(uVar3 >> 8) & 0x1f); *(byte **)((int)packBuf + 4) = pbVar4; return uVar3 & 0xff; } uVar5 = uVar5 << ((byte)sVar2 & 0x1f); iVar6 = iVar6 - sVar2; } while( true ); } //@@ 00ae27f0 oc_huff_tree_collapse /* DB: libtheora huffdec.c: (tree or NULL, tokens[][2], ntokens): called twice from oc_huff_trees_unpack (00ae2bf0) - first to size the tree, then to fill it; local depth/node stacks (short[34], byte[35]), uses oc_huff_subtree_tokens (00ae26e0) */ int oc_huff_tree_collapse(int param_1,int param_2,char param_3) { byte bVar1; byte bVar2; byte bVar3; bool bVar4; short *psVar5; char cVar6; short sVar7; uint uVar8; int iVar9; int iVar10; int iVar11; int iVar12; uint uVar13; short *psVar14; short local_b8 [34]; byte local_74 [35]; byte abStack_51 [37]; int local_2c; int local_28; uint local_24; uint local_20; uint local_1c; int local_18; int local_14; int local_10; int local_c; short *local_8; abStack_51[1] = 0; local_74[0] = param_3 - 1; iVar12 = 0; local_14 = 0; iVar10 = 0; local_28 = 0; local_10 = 0; do { local_8 = (short *)0x1; bVar4 = true; local_1c = (uint)abStack_51[iVar10 + 1]; local_2c = param_2 + iVar12 * 2; local_20 = 2; local_24 = (-(uint)(abStack_51[iVar10 + 1] != 0) & 0xfffffffb) + 7; iVar12 = ((uint)local_74[iVar10] - iVar12) + 1; local_c = iVar12; do { iVar10 = (int)local_8; if (!bVar4) { iVar10 = local_18; } local_8 = (short *)((int)local_8 + 1); local_18 = iVar10; bVar4 = false; _param_3 = 0; iVar10 = 0; if (0 < iVar12) { uVar13 = (int)local_8 + local_1c; do { iVar12 = local_2c + iVar10 * 2; uVar8 = (uint)*(byte *)(iVar12 + 1); if ((int)uVar8 < (int)uVar13) { iVar10 = iVar10 + 1; } else if (uVar8 == uVar13) { bVar4 = true; iVar10 = iVar10 + 1; } else { iVar12 = FUN_00ae26e0(iVar12,uVar13); iVar10 = iVar10 + iVar12; } _param_3 = _param_3 + 1; } while (iVar10 < local_c); iVar12 = local_c; } iVar10 = local_10; iVar11 = local_18; } while (((int)local_20 < _param_3) && (local_20 = _param_3, 1 << ((byte)local_8 & 0x1f) <= (int)(_param_3 * local_24))); psVar14 = local_b8 + local_10; sVar7 = (short)local_14; *psVar14 = sVar7; local_c = iVar11; local_8 = psVar14; local_14 = local_14 + 1 + (1 << ((byte)iVar11 & 0x1f)); if (param_1 != 0) { *(short *)(param_1 + sVar7 * 2) = (short)iVar11; *psVar14 = sVar7 + 1; } iVar12 = local_28; do { local_20 = (uint)local_74[iVar10]; iVar9 = iVar10; if (iVar12 <= (int)(uint)local_74[iVar10]) { bVar1 = abStack_51[iVar10 + 1]; local_24 = (uint)bVar1; uVar13 = iVar11 + local_24; local_1c = uVar13; iVar10 = local_24 << 8; do { psVar5 = local_8; iVar11 = local_14; bVar2 = *(byte *)(param_2 + 1 + iVar12 * 2); iVar9 = CONCAT31((int3)((uint)iVar10 >> 8),bVar2); if ((int)uVar13 < (int)(uint)bVar2) { abStack_51[local_10 + 2] = (char)local_c + bVar1; if (param_1 != 0) { sVar7 = local_b8[local_10]; *(short *)(param_1 + sVar7 * 2) = (short)iVar11; local_b8[local_10] = sVar7 + 1; } iVar10 = local_10 + 2; local_10 = local_10 + 1; cVar6 = FUN_00ae26e0(param_2 + iVar12 * 2,abStack_51[iVar10]); iVar10 = local_10; local_74[local_10] = cVar6 + (char)iVar12 + -1; goto LAB_00ae29ed; } if (param_1 != 0) { bVar3 = *(byte *)(param_2 + iVar12 * 2); iVar11 = 1 << (((char)local_24 - bVar2) + (char)local_c & 0x1f); if (0 < iVar11) { sVar7 = *local_8; do { iVar9 = (int)sVar7; iVar11 = iVar11 + -1; sVar7 = sVar7 + 1; *(ushort *)(param_1 + iVar9 * 2) = -(((ushort)bVar2 - (short)((uint)iVar10 >> 8)) * 0x100 | (ushort)bVar3); } while (0 < iVar11); *local_8 = sVar7; } iVar9 = (uint)bVar1 << 8; uVar13 = local_1c; psVar14 = psVar5; } iVar12 = iVar12 + 1; local_28 = iVar12; iVar10 = iVar9; } while (iVar12 <= (int)local_20); iVar11 = local_c; iVar9 = local_10; } psVar14 = psVar14 + -1; iVar10 = iVar9 + -1; local_8 = psVar14; local_10 = iVar10; if (0 < iVar9) { iVar11 = (uint)abStack_51[iVar9 + 1] - (uint)abStack_51[iVar9]; local_c = iVar11; } } while (-1 < iVar10); iVar11 = local_14; LAB_00ae29ed: if (iVar10 < 0) { return iVar11; } } while( true ); } //@@ 00ae2a60 FUN_00ae2a60 int FUN_00ae2a60(int param_1,int param_2) { undefined2 uVar1; int iVar2; int iVar3; int iVar4; int iVar5; uVar1 = *(undefined2 *)(param_1 + param_2 * 2); iVar2 = 1 << ((byte)uVar1 & 0x1f); iVar4 = 0; iVar5 = iVar2 + 1; do { iVar3 = (int)*(short *)(param_1 + 2 + (iVar4 + param_2) * 2); if (iVar3 < 1) { iVar3 = 1 << ((char)uVar1 - (char)((uint)-iVar3 >> 8) & 0x1fU); } else { iVar3 = FUN_00ae2a60(param_1,iVar3); iVar5 = iVar5 + iVar3; iVar3 = 1; } uVar1 = *(undefined2 *)(param_1 + param_2 * 2); iVar4 = iVar4 + iVar3; } while (iVar4 < iVar2); return iVar5; } //@@ 00ae2ad0 FUN_00ae2ad0 void FUN_00ae2ad0(int param_1) { int iVar1; iVar1 = 0; do { free(*(void **)(param_1 + iVar1 * 4)); iVar1 = iVar1 + 1; } while (iVar1 < 0x50); return; } //@@ 00ae2b00 FUN_00ae2b00 undefined4 FUN_00ae2b00(int param_1,undefined4 *param_2) { undefined2 uVar1; undefined2 *puVar2; int iVar3; int iVar4; int iVar5; void *_Dst; int iVar6; int local_c; int local_8; iVar3 = param_1 - (int)param_2; local_c = 0; while( true ) { puVar2 = (undefined2 *)*param_2; uVar1 = *puVar2; iVar4 = 1 << ((byte)uVar1 & 0x1f); local_8 = iVar4 + 1; iVar6 = 0; while( true ) { iVar5 = (int)(short)puVar2[iVar6 + 1]; if (iVar5 < 1) { iVar5 = 1 << ((char)uVar1 - (char)((uint)-iVar5 >> 8) & 0x1fU); } else { iVar5 = FUN_00ae2a60(puVar2,iVar5); local_8 = local_8 + iVar5; iVar5 = 1; } iVar6 = iVar6 + iVar5; if (iVar4 <= iVar6) break; uVar1 = *puVar2; } _Dst = malloc(local_8 * 2); *(void **)(iVar3 + (int)param_2) = _Dst; if (_Dst == (void *)0x0) break; memcpy(_Dst,(void *)*param_2,local_8 * 2); local_c = local_c + 1; param_2 = param_2 + 1; if (0x4f < local_c) { return 0; } } if (local_c != 0) { do { local_c = local_c + -1; free(*(void **)(param_1 + local_c * 4)); } while (0 < local_c); } return 0xffffffff; } //@@ 00ae2bf0 FUN_00ae2bf0 int FUN_00ae2bf0(undefined4 param_1,int param_2) { byte bVar1; char cVar2; int iVar3; uint uVar4; void *pvVar5; int iVar6; int iVar7; uint uVar8; int iVar9; char local_210 [512]; int local_10; int local_c; int local_8; local_10 = 0; LAB_00ae2c03: uVar8 = 0; iVar9 = 0; local_8 = 0; iVar7 = 0; local_c = FUN_00ae25a0(param_1); iVar3 = FUN_00ae2580(param_1); if (iVar3 < 0) { return -0x14; } do { if (local_c == 0) { iVar7 = iVar7 + 1; if (0x20 < iVar7) { return -0x14; } } else { local_8 = local_8 + 1; if (0x20 < local_8) { return -0x14; } iVar3 = FUN_00ae25e0(param_1,5); bVar1 = (&DAT_00b193b0)[iVar3]; iVar6 = 1 << (bVar1 & 0x1f); if (0 < iVar6) { cVar2 = (&DAT_00b19390)[iVar3]; do { local_210[iVar9 * 2] = cVar2; iVar6 = iVar6 + -1; local_210[iVar9 * 2 + 1] = bVar1 + (char)iVar7; cVar2 = cVar2 + '\x01'; iVar9 = iVar9 + 1; } while (0 < iVar6); } uVar4 = 0x80000000 >> ((char)iVar7 - 1U & 0x1f); while( true ) { if (iVar7 < 1) goto LAB_00ae2cb0; if ((uVar8 & uVar4) == 0) break; uVar8 = uVar8 ^ uVar4; iVar7 = iVar7 + -1; uVar4 = uVar4 * 2; } if (iVar7 < 1) break; uVar8 = uVar8 | uVar4; } local_c = FUN_00ae25a0(param_1); iVar3 = FUN_00ae2580(param_1); if (iVar3 < 0) { return -0x14; } } while( true ); LAB_00ae2cb0: if (iVar9 < 0) { return iVar9; } uVar8 = oc_huff_tree_collapse(0,local_210,iVar9); if (0x7fff < uVar8) { return -0x17; } pvVar5 = malloc(uVar8 * 2); if (pvVar5 == (void *)0x0) { return -1; } oc_huff_tree_collapse(pvVar5,local_210,iVar9); *(void **)(param_2 + local_10 * 4) = pvVar5; local_10 = local_10 + 1; if (0x4f < local_10) { return 0; } goto LAB_00ae2c03; } //@@ 00ae2d60 FUN_00ae2d60 void FUN_00ae2d60(int param_1) { int *piVar1; int iVar2; int *piVar3; int iVar4; int iVar5; int iVar6; int iVar7; int iVar8; piVar3 = (int *)(param_1 + 400); iVar7 = 6; do { piVar3 = piVar3 + -3; iVar8 = iVar7 + -1; iVar2 = iVar8 / 3; iVar6 = iVar8 % 3; if (0 < iVar8) { iVar4 = (iVar7 + -2) / 3; iVar5 = (iVar7 + -2) % 3; iVar7 = iVar6 + (iVar2 + 9) * 3; if (*(int *)(param_1 + iVar7 * 0xc) == *(int *)(param_1 + (iVar5 + (iVar4 + 9) * 3) * 0xc)) { *(undefined4 *)(param_1 + iVar7 * 0xc) = 0; } if (*piVar3 == *(int *)(param_1 + 0x148 + (iVar5 + iVar4 * 3) * 0xc)) { *piVar3 = 0; } } if (0 < iVar2) { piVar1 = (int *)(param_1 + (iVar6 + 0x1e) * 0xc); if (*piVar1 == *(int *)(param_1 + 0x144 + iVar6 * 0xc)) { *piVar1 = 0; } iVar7 = param_1 + iVar6 * 0xc; if (*(int *)(iVar7 + 0x16c) == *(int *)(iVar7 + 0x148)) { *(undefined4 *)(iVar7 + 0x16c) = 0; } } free(*(void **)(param_1 + (iVar6 + (iVar2 + 9) * 3) * 0xc)); free((void *)*piVar3); iVar7 = iVar8; } while (0 < iVar8); return; } //@@ 00ae2e70 oc_quant_params_unpack /* DB: libtheora dequant.c: called from the theora setup header decoder FUN_00adfbc0 on calloc(1,0x2c8)+0x140; reads with oc_pack_read (FUN_00ae25e0): 3-bit nbits then 64 loop filter limits, 4-bit AC scale bits x64, DC scale x64, 9-bit base matrix count, 64-byte base matrices, oc_ilog, per qi/pli range reading with oc_pack_read1 */ undefined4 oc_quant_params_unpack(undefined4 param_1,int param_2) { int *piVar1; bool bVar2; undefined4 uVar3; undefined4 uVar4; uint uVar5; undefined1 uVar6; undefined2 uVar7; undefined4 uVar8; undefined1 *puVar9; int iVar10; void *pvVar11; undefined4 *puVar12; undefined4 *puVar13; int iVar14; undefined2 *puVar15; int iVar16; uint uVar17; int local_21c [64]; int local_11c [64]; int local_1c; undefined4 local_18; int local_14; uint local_10; undefined1 *local_c; int *local_8; uVar8 = FUN_00ae25e0(param_1,3); iVar14 = 0; do { uVar6 = FUN_00ae25e0(param_1,uVar8); *(undefined1 *)(param_2 + 0x100 + iVar14) = uVar6; iVar14 = iVar14 + 1; } while (iVar14 < 0x40); iVar14 = FUN_00ae25e0(param_1,4); local_10 = iVar14 + 1; puVar15 = (undefined2 *)(param_2 + 0x80); iVar14 = 0x40; do { uVar7 = FUN_00ae25e0(param_1,local_10); *puVar15 = uVar7; puVar15 = puVar15 + 1; iVar14 = iVar14 + -1; } while (iVar14 != 0); iVar14 = FUN_00ae25e0(param_1,4); iVar16 = 0; do { uVar7 = FUN_00ae25e0(param_1,iVar14 + 1); *(undefined2 *)(param_2 + iVar16 * 2) = uVar7; iVar16 = iVar16 + 1; } while (iVar16 < 0x40); iVar14 = FUN_00ae25e0(param_1,9); iVar14 = iVar14 + 1; local_1c = iVar14; puVar9 = malloc(iVar14 * 0x40); if (puVar9 != (undefined1 *)0x0) { local_c = puVar9; if (0 < iVar14) { local_8 = (int *)iVar14; do { iVar14 = 0x40; do { uVar6 = FUN_00ae25e0(param_1,8); *puVar9 = uVar6; puVar9 = puVar9 + 1; iVar14 = iVar14 + -1; } while (iVar14 != 0); local_8 = (int *)((int)local_8 + -1); } while (local_8 != (int *)0x0); local_8 = (int *)0x0; iVar14 = local_1c; } local_18 = FUN_00adbe20(iVar14 + -1); local_8 = (int *)(param_2 + 0x140); local_10 = 0; while( true ) { uVar5 = local_10; uVar17 = local_10 / 3; if ((local_10 == 0) || (iVar14 = FUN_00ae25a0(param_1), iVar14 != 0)) break; if ((uVar17 == 0) || (iVar14 = FUN_00ae25a0(param_1), iVar14 == 0)) { iVar14 = (int)(uVar5 - 1) / 3; uVar17 = (int)(uVar5 - 1) % 3; } else { iVar14 = uVar17 - 1; uVar17 = uVar5 % 3; } iVar14 = uVar17 + iVar14 * 3; piVar1 = (int *)(param_2 + 0x140 + iVar14 * 0xc); iVar16 = piVar1[1]; *local_8 = *piVar1; local_8[1] = iVar16; local_8[2] = *(int *)(param_2 + 0x148 + iVar14 * 0xc); local_10 = uVar5; LAB_00ae30f2: local_10 = local_10 + 1; local_8 = local_8 + 3; if (5 < (int)local_10) { free(local_c); return 0; } } local_11c[0] = FUN_00ae25e0(param_1,local_18); iVar14 = 0; iVar16 = 0; local_14 = 0; do { uVar8 = FUN_00adbe20(0x3e - iVar16); iVar10 = FUN_00ae25e0(param_1,uVar8); uVar8 = local_18; iVar14 = iVar14 + 1; iVar16 = iVar16 + iVar10 + 1; *(int *)((int)local_21c + local_14) = iVar10 + 1; local_14 = iVar14 * 4; iVar10 = FUN_00ae25e0(param_1,uVar8); local_11c[iVar14] = iVar10; } while (iVar16 < 0x3f); if (0x3f < iVar16) { LAB_00ae3130: free(local_c); return 0xffffffec; } *local_8 = iVar14; pvVar11 = malloc(iVar14 * 4); local_8[1] = (int)pvVar11; if (pvVar11 != (void *)0x0) { memcpy(pvVar11,local_21c,iVar14 * 4); pvVar11 = malloc(iVar14 * 0x40 + 0x40); if (pvVar11 != (void *)0x0) { local_8[2] = (int)pvVar11; puVar13 = (undefined4 *)(iVar14 * 0x40 + (int)pvVar11); do { if (local_1c <= local_11c[iVar14]) goto LAB_00ae3130; puVar12 = (undefined4 *)(local_c + local_11c[iVar14] * 0x40); uVar8 = puVar12[1]; uVar3 = puVar12[2]; uVar4 = puVar12[3]; *puVar13 = *puVar12; puVar13[1] = uVar8; puVar13[2] = uVar3; puVar13[3] = uVar4; uVar8 = puVar12[5]; uVar3 = puVar12[6]; uVar4 = puVar12[7]; puVar13[4] = puVar12[4]; puVar13[5] = uVar8; puVar13[6] = uVar3; puVar13[7] = uVar4; uVar8 = puVar12[9]; uVar3 = puVar12[10]; uVar4 = puVar12[0xb]; puVar13[8] = puVar12[8]; puVar13[9] = uVar8; puVar13[10] = uVar3; puVar13[0xb] = uVar4; uVar8 = puVar12[0xd]; uVar3 = puVar12[0xe]; uVar4 = puVar12[0xf]; puVar13[0xc] = puVar12[0xc]; puVar13[0xd] = uVar8; puVar13[0xe] = uVar3; puVar13[0xf] = uVar4; puVar13 = puVar13 + -0x10; bVar2 = 0 < iVar14; iVar14 = iVar14 + -1; } while (bVar2); goto LAB_00ae30f2; } } free(local_c); } return 0xffffffff; } //@@ 00ae3150 FUN_00ae3150 void FUN_00ae3150(int param_1) { uint uVar1; uVar1 = oc_cpu_flags_get(); *(uint *)(param_1 + 0x6c) = uVar1; if ((uVar1 & 1) == 0) { FUN_00ae0b30(); return; } *(code **)(param_1 + 0x40) = FUN_00ae45c0; *(code **)(param_1 + 0x44) = FUN_00ae4530; *(code **)(param_1 + 0x48) = FUN_00ae4750; *(code **)(param_1 + 0x4c) = FUN_00ae46e0; *(code **)(param_1 + 0x50) = FUN_00ae4630; *(code **)(param_1 + 0x54) = oc_idct8x8_mmx; *(code **)(param_1 + 0x58) = FUN_00ae5260; *(code **)(param_1 + 0x5c) = FUN_00ae5240; *(code **)(param_1 + 0x60) = oc_state_loop_filter_frag_rows_mmx; *(undefined1 **)(param_1 + 100) = &LAB_00ae4820; *(undefined **)(param_1 + 0x68) = &DAT_00b193d0; return; } //@@ 00ae31c0 FUN_00ae31c0 void FUN_00ae31c0(undefined4 *param_1,undefined4 *param_2,int param_3) { undefined4 uVar1; undefined4 *puVar2; undefined4 *puVar3; uVar1 = param_2[1]; puVar2 = (undefined4 *)((int)param_2 + param_3); *param_1 = *param_2; param_1[1] = uVar1; param_1 = (undefined4 *)((int)param_1 + param_3); uVar1 = puVar2[1]; puVar3 = (undefined4 *)((int)puVar2 + param_3); *param_1 = *puVar2; param_1[1] = uVar1; param_1 = (undefined4 *)((int)param_1 + param_3); uVar1 = puVar3[1]; puVar2 = (undefined4 *)((int)puVar3 + param_3); *param_1 = *puVar3; param_1[1] = uVar1; param_1 = (undefined4 *)((int)param_1 + param_3); uVar1 = puVar2[1]; puVar3 = (undefined4 *)((int)puVar2 + param_3); *param_1 = *puVar2; param_1[1] = uVar1; param_1 = (undefined4 *)((int)param_1 + param_3); uVar1 = puVar3[1]; puVar2 = (undefined4 *)((int)puVar3 + param_3); *param_1 = *puVar3; param_1[1] = uVar1; param_1 = (undefined4 *)((int)param_1 + param_3); uVar1 = puVar2[1]; *param_1 = *puVar2; param_1[1] = uVar1; param_1 = (undefined4 *)((int)param_1 + param_3); uVar1 = *(undefined4 *)((int)puVar2 + param_3 + 4); *param_1 = *(undefined4 *)((int)puVar2 + param_3); param_1[1] = uVar1; uVar1 = *(undefined4 *)((int)puVar2 + param_3 * 2 + 4); *(undefined4 *)((int)param_1 + param_3) = *(undefined4 *)((int)puVar2 + param_3 * 2); *(undefined4 *)((int)param_1 + param_3 + 4) = uVar1; return; } //@@ 00ae3240 FUN_00ae3240 void FUN_00ae3240(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6) { int iVar1; undefined4 uVar2; int iVar3; undefined4 *puVar4; undefined4 *puVar5; undefined4 *puVar6; iVar3 = 0; if (0 < param_5) { do { iVar1 = iVar3 * 4; iVar3 = iVar3 + 1; iVar1 = *(int *)(param_6 + *(int *)(param_4 + iVar1) * 4); puVar4 = (undefined4 *)(param_2 + iVar1); puVar6 = (undefined4 *)(param_1 + iVar1); uVar2 = puVar4[1]; puVar5 = (undefined4 *)((int)puVar4 + param_3); *puVar6 = *puVar4; puVar6[1] = uVar2; puVar6 = (undefined4 *)((int)puVar6 + param_3); uVar2 = puVar5[1]; puVar4 = (undefined4 *)((int)puVar5 + param_3); *puVar6 = *puVar5; puVar6[1] = uVar2; puVar6 = (undefined4 *)((int)puVar6 + param_3); uVar2 = puVar4[1]; puVar5 = (undefined4 *)((int)puVar4 + param_3); *puVar6 = *puVar4; puVar6[1] = uVar2; puVar6 = (undefined4 *)((int)puVar6 + param_3); uVar2 = puVar5[1]; puVar4 = (undefined4 *)((int)puVar5 + param_3); *puVar6 = *puVar5; puVar6[1] = uVar2; puVar6 = (undefined4 *)((int)puVar6 + param_3); uVar2 = puVar4[1]; puVar5 = (undefined4 *)((int)puVar4 + param_3); *puVar6 = *puVar4; puVar6[1] = uVar2; puVar6 = (undefined4 *)((int)puVar6 + param_3); uVar2 = puVar5[1]; puVar4 = (undefined4 *)((int)puVar5 + param_3); *puVar6 = *puVar5; puVar6[1] = uVar2; puVar6 = (undefined4 *)((int)puVar6 + param_3); uVar2 = puVar4[1]; *puVar6 = *puVar4; puVar6[1] = uVar2; uVar2 = *(undefined4 *)((int)puVar4 + param_3 + 4); *(undefined4 *)((int)puVar6 + param_3) = *(undefined4 *)((int)puVar4 + param_3); *(undefined4 *)((int)puVar6 + param_3 + 4) = uVar2; } while (iVar3 < param_5); } return; } //@@ 00ae32f0 FUN_00ae32f0 void FUN_00ae32f0(int param_1,int param_2,int param_3,int param_4,int param_5) { byte bVar1; uint uVar2; int iVar3; short *psVar4; byte *pbVar5; byte *pbVar6; int local_c; byte *local_8; local_8 = (byte *)(param_2 + 2); pbVar6 = (byte *)(param_1 + 2); local_c = 8; pbVar5 = (byte *)(param_3 + 2); psVar4 = (short *)(param_5 + 4); do { uVar2 = (uint)pbVar5[(param_2 - param_3) + -2] + (uint)pbVar5[-2] >> 1; iVar3 = (int)psVar4[-2] + uVar2; bVar1 = (char)psVar4[-2] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[-2] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)local_8[-1] + (uint)pbVar5[-1] >> 1; iVar3 = (int)psVar4[-1] + uVar2; bVar1 = (char)psVar4[-1] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[-1] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)*local_8 + (uint)*pbVar5 >> 1; iVar3 = (int)*psVar4 + uVar2; bVar1 = (char)*psVar4 + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } *pbVar6 = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)local_8[1] + (uint)pbVar5[1] >> 1; iVar3 = (int)psVar4[1] + uVar2; bVar1 = (char)psVar4[1] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[1] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)local_8[2] + (uint)pbVar5[2] >> 1; iVar3 = (int)psVar4[2] + uVar2; bVar1 = (char)psVar4[2] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[2] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)local_8[3] + (uint)pbVar5[3] >> 1; iVar3 = (int)psVar4[3] + uVar2; bVar1 = (char)psVar4[3] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[3] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)local_8[4] + (uint)pbVar5[4] >> 1; iVar3 = (int)psVar4[4] + uVar2; bVar1 = (char)psVar4[4] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[4] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; uVar2 = (uint)local_8[5] + (uint)pbVar5[5] >> 1; iVar3 = (int)psVar4[5] + uVar2; bVar1 = (char)psVar4[5] + (char)uVar2; if (0xff < iVar3) { bVar1 = 0xff; } pbVar6[5] = bVar1 & -(char)(iVar3 >> 0x1f) - 1U; pbVar5 = pbVar5 + param_4; local_8 = local_8 + param_4; pbVar6 = pbVar6 + param_4; local_c = local_c + -1; psVar4 = psVar4 + 8; } while (local_c != 0); return; } //@@ 00ae34f0 FUN_00ae34f0 void FUN_00ae34f0(int param_1,int param_2,int param_3,int param_4) { byte bVar1; int iVar2; byte *pbVar3; short *psVar4; int local_c; byte *local_8; local_8 = (byte *)(param_2 + 2); local_c = 8; pbVar3 = (byte *)(param_1 + 2); psVar4 = (short *)(param_4 + 4); do { iVar2 = (int)psVar4[-2] + (uint)pbVar3[(param_2 - param_1) + -2]; bVar1 = (char)psVar4[-2] + pbVar3[(param_2 - param_1) + -2]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[-2] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (uint)local_8[-1] + (int)psVar4[-1]; bVar1 = local_8[-1] + (char)psVar4[-1]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[-1] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (int)*psVar4 + (uint)*local_8; bVar1 = (char)*psVar4 + *local_8; if (0xff < iVar2) { bVar1 = 0xff; } *pbVar3 = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (uint)local_8[1] + (int)psVar4[1]; bVar1 = local_8[1] + (char)psVar4[1]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[1] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (uint)local_8[2] + (int)psVar4[2]; bVar1 = local_8[2] + (char)psVar4[2]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[2] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (uint)local_8[3] + (int)psVar4[3]; bVar1 = local_8[3] + (char)psVar4[3]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[3] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (uint)local_8[4] + (int)psVar4[4]; bVar1 = local_8[4] + (char)psVar4[4]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[4] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; iVar2 = (uint)local_8[5] + (int)psVar4[5]; bVar1 = local_8[5] + (char)psVar4[5]; if (0xff < iVar2) { bVar1 = 0xff; } pbVar3[5] = bVar1 & -(char)(iVar2 >> 0x1f) - 1U; pbVar3 = pbVar3 + param_3; local_8 = local_8 + param_3; local_c = local_c + -1; psVar4 = psVar4 + 8; } while (local_c != 0); return; } //@@ 00ae36c0 FUN_00ae36c0 void FUN_00ae36c0(int param_1,int param_2,int param_3) { short sVar1; byte bVar2; int iVar3; byte *pbVar4; short *psVar5; iVar3 = 8; pbVar4 = (byte *)(param_1 + 2); psVar5 = (short *)(param_3 + 4); do { sVar1 = psVar5[-2]; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[-2] = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = psVar5[-1]; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[-1] = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = *psVar5; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } *pbVar4 = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = psVar5[1]; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[1] = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = psVar5[2]; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[2] = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = psVar5[3]; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[3] = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = psVar5[4]; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[4] = bVar2 & (sVar1 < -0x80) - 1U; sVar1 = psVar5[5]; psVar5 = psVar5 + 8; bVar2 = (char)sVar1 + 0x80; if (0x7f < sVar1) { bVar2 = 0xff; } pbVar4[5] = bVar2 & (sVar1 < -0x80) - 1U; pbVar4 = pbVar4 + param_2; iVar3 = iVar3 + -1; } while (iVar3 != 0); return; } //@@ 00ae3830 FUN_00ae3830 void FUN_00ae3830(short *param_1,short *param_2) { short sVar1; short sVar2; short sVar3; short sVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; short sVar11; sVar9 = (short)((uint)(param_2[2] * 0x61f8) >> 0x10) - (short)((uint)(param_2[6] * 0xec83) >> 0x10); sVar11 = (short)((uint)(param_2[6] * 0x61f8) >> 0x10) + (short)((uint)(param_2[2] * 0xec83) >> 0x10); sVar1 = (short)((uint)(param_2[1] * 0x31f1) >> 0x10) - (short)((uint)(param_2[7] * 0xfb15) >> 0x10); sVar2 = (short)((uint)(param_2[5] * 0xd4db) >> 0x10) - (short)((uint)(param_2[3] * 0x8e3a) >> 0x10); sVar4 = (short)((uint)(param_2[5] * 0x8e3a) >> 0x10) + (short)((uint)(param_2[3] * 0xd4db) >> 0x10); sVar3 = (short)((uint)(param_2[7] * 0x31f1) >> 0x10) + (short)((uint)(param_2[1] * 0xfb15) >> 0x10); sVar7 = sVar2 + sVar1; sVar5 = sVar4 + sVar3; sVar10 = (short)((uint)((short)(*param_2 + param_2[4]) * 0xb505) >> 0x10); sVar6 = (short)((uint)((short)(*param_2 - param_2[4]) * 0xb505) >> 0x10); sVar8 = sVar6 - sVar9; sVar6 = sVar6 + sVar9; sVar9 = (short)((uint)((short)(sVar1 - sVar2) * 0xb505) >> 0x10); sVar1 = (short)((uint)((short)(sVar3 - sVar4) * 0xb505) >> 0x10); sVar2 = sVar1 - sVar9; sVar1 = sVar1 + sVar9; *param_1 = sVar10 + sVar11 + sVar5; param_1[8] = sVar6 + sVar1; param_1[0x10] = sVar2 + sVar8; param_1[0x28] = sVar8 - sVar2; param_1[0x18] = sVar7 + (sVar10 - sVar11); param_1[0x20] = (sVar10 - sVar11) - sVar7; param_1[0x30] = sVar6 - sVar1; param_1[0x38] = (sVar10 + sVar11) - sVar5; return; } //@@ 00ae39c0 idct8_2 /* DB: libtheora (round 7 agent) */ void idct8_2(short *param_1,short *param_2) { short sVar1; short sVar2; short sVar3; short sVar4; short sVar5; int iVar6; int iVar7; iVar7 = param_2[1] * 0x31f1; iVar6 = param_2[1] * 0xfb15; sVar5 = (short)((uint)iVar7 >> 0x10); sVar1 = (short)((uint)((iVar7 >> 0x10) * 0xb505) >> 0x10); sVar3 = (short)((uint)((iVar6 >> 0x10) * 0xb505) >> 0x10); sVar4 = sVar3 - sVar1; sVar3 = sVar3 + sVar1; sVar1 = (short)((uint)iVar6 >> 0x10); sVar2 = (short)((uint)(*param_2 * 0xb505) >> 0x10); *param_1 = sVar1 + sVar2; param_1[8] = sVar3 + sVar2; param_1[0x10] = sVar4 + sVar2; param_1[0x18] = sVar5 + sVar2; param_1[0x20] = sVar2 - sVar5; param_1[0x28] = sVar2 - sVar4; param_1[0x38] = sVar2 - sVar1; param_1[0x30] = sVar2 - sVar3; return; } //@@ 00ae3a70 FUN_00ae3a70 void FUN_00ae3a70(short *param_1,short *param_2) { short sVar1; short sVar2; short sVar3; short sVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; sVar8 = (short)((uint)(param_2[3] * 0x8e3a) >> 0x10); sVar5 = (short)((uint)(param_2[1] * 0x31f1) >> 0x10); sVar4 = sVar5 - sVar8; sVar1 = (short)((uint)(param_2[3] * 0xd4db) >> 0x10); sVar7 = (short)((uint)(param_2[1] * 0xfb15) >> 0x10); sVar2 = sVar1 + sVar7; sVar6 = (short)((uint)(param_2[2] * 0x61f8) >> 0x10); sVar10 = (short)((uint)(*param_2 * 0xb505) >> 0x10); sVar3 = sVar6 + sVar10; sVar9 = (short)((uint)(param_2[2] * 0xec83) >> 0x10); sVar6 = sVar10 - sVar6; sVar8 = (short)((uint)((short)(sVar5 + sVar8) * 0xb505) >> 0x10); sVar5 = (short)((uint)((short)(sVar7 - sVar1) * 0xb505) >> 0x10); sVar7 = sVar5 - sVar8; sVar5 = sVar5 + sVar8; *param_1 = sVar10 + sVar9 + sVar2; param_1[8] = sVar3 + sVar5; param_1[0x10] = sVar7 + sVar6; param_1[0x28] = sVar6 - sVar7; param_1[0x18] = sVar4 + (sVar10 - sVar9); param_1[0x20] = (sVar10 - sVar9) - sVar4; param_1[0x30] = sVar3 - sVar5; param_1[0x38] = (sVar10 + sVar9) - sVar2; return; } //@@ 00ae3b90 oc_idct8x8_10 /* DB: libtheora idct.c (C path): called from oc_idct8x8_c (00ae3dc0) when 4 <= last_zzi < 11 (last_zzi < 4 runs the inlined oc_idct8x8_3 using idct8_2 00ae39c0) */ void oc_idct8x8_10(int param_1,undefined4 *param_2) { ulonglong uVar1; short sVar2; short sVar3; undefined1 auVar4 [12]; undefined1 auVar5 [12]; undefined1 auVar6 [12]; undefined1 auVar7 [12]; int iVar8; uint uVar9; ulonglong *puVar10; int iVar11; uint uVar12; int iVar13; undefined1 *puVar14; undefined2 uVar31; undefined1 auVar16 [16]; undefined1 auVar15 [16]; undefined1 auVar17 [16]; undefined1 auVar18 [16]; undefined1 auVar21 [16]; undefined1 auVar20 [16]; undefined1 auVar19 [16]; undefined1 auVar22 [16]; undefined1 auVar25 [16]; undefined1 auVar24 [16]; undefined1 auVar23 [16]; undefined1 auVar26 [16]; undefined1 auVar29 [16]; undefined1 auVar28 [16]; undefined1 auVar27 [16]; undefined1 auVar30 [16]; undefined1 local_94 [2]; short local_92; undefined1 local_90 [2]; undefined2 local_8e; short local_82; undefined2 local_7e; short local_72; undefined2 local_6e; short local_62; undefined2 local_5e; short local_52; undefined2 local_4e; short local_42; undefined2 local_3e; short local_32; undefined2 local_2e; short local_22; undefined2 local_1e; int local_14; uint local_10; int local_c; uint local_8; FUN_00ae3a70(local_94,param_2); iVar13 = *(short *)(param_2 + 5) * 0x61f8; iVar11 = *(short *)((int)param_2 + 0x12) * 0x31f1; iVar8 = *(short *)((int)param_2 + 0x12) * 0xfb15; local_14 = *(short *)(param_2 + 4) * 0xb505 >> 0x10; uVar12 = iVar11 >> 0x10; uVar9 = iVar8 >> 0x10; local_8 = uVar12 & 0xffff; local_10 = uVar9 & 0xffff; local_c = (iVar13 >> 0x10) + local_14; sVar2 = (short)((uint)(*(short *)(param_2 + 4) * 0xb505) >> 0x10); local_42 = sVar2 - (short)((uint)iVar13 >> 0x10); local_22 = (short)((uint)(*(short *)(param_2 + 5) * 0xec83) >> 0x10); local_52 = sVar2 - local_22; local_22 = local_22 + sVar2; local_32 = (short)(uVar12 * 0xb505 >> 0x10); sVar2 = (short)(uVar9 * 0xb505 >> 0x10); sVar3 = sVar2 - local_32; local_32 = local_32 + sVar2; sVar2 = (short)((uint)iVar8 >> 0x10); local_92 = sVar2 + local_22; local_22 = local_22 - sVar2; local_82 = (short)local_c + local_32; local_72 = sVar3 + local_42; local_42 = local_42 - sVar3; sVar2 = (short)((uint)iVar11 >> 0x10); local_62 = sVar2 + local_52; local_52 = local_52 - sVar2; local_32 = (short)local_c - local_32; idct8_2(local_90,param_2 + 8); puVar14 = local_94; local_8e = (undefined2)((uint)(*(short *)(param_2 + 0xc) * 0xb505) >> 0x10); iVar8 = 8; iVar11 = param_1; local_7e = local_8e; local_6e = local_8e; local_5e = local_8e; local_4e = local_8e; local_3e = local_8e; local_2e = local_8e; local_1e = local_8e; do { iVar13 = iVar8; FUN_00ae3a70(iVar11,puVar14); puVar14 = puVar14 + 0x10; iVar11 = iVar11 + 2; iVar8 = iVar13 + -1; } while (iVar8 != 0); iVar13 = iVar13 + 3; puVar10 = (ulonglong *)(param_1 + 0x10); do { uVar1 = puVar10[-2]; uVar31 = (undefined2)(uVar1 >> 0x30); auVar16._8_4_ = 0; auVar16._0_8_ = uVar1; auVar16._12_2_ = uVar31; auVar16._14_2_ = uVar31; uVar31 = (undefined2)(uVar1 >> 0x20); auVar18._12_4_ = auVar16._12_4_; auVar18._8_2_ = 0; auVar18._0_8_ = uVar1; auVar18._10_2_ = uVar31; auVar15._10_6_ = auVar18._10_6_; auVar15._8_2_ = uVar31; auVar15._0_8_ = uVar1; uVar31 = (undefined2)(uVar1 >> 0x10); auVar4._4_8_ = auVar15._8_8_; auVar4._2_2_ = uVar31; auVar4._0_2_ = uVar31; auVar17._0_4_ = (short)uVar1 + 8 >> 4; auVar17._4_4_ = (auVar4._0_4_ >> 0x10) + 8 >> 4; auVar17._8_4_ = (auVar15._8_4_ >> 0x10) + 8 >> 4; auVar17._12_4_ = (auVar18._12_4_ >> 0x10) + 8 >> 4; auVar18 = pshuflw(auVar17,auVar17,0xd8); auVar18 = pshufhw(auVar18,auVar18,0xd8); puVar10[-2] = CONCAT44(auVar18._8_4_,auVar18._0_4_); uVar1 = puVar10[-1]; uVar31 = (undefined2)(uVar1 >> 0x30); auVar21._8_4_ = 0; auVar21._0_8_ = uVar1; auVar21._12_2_ = uVar31; auVar21._14_2_ = uVar31; uVar31 = (undefined2)(uVar1 >> 0x20); auVar20._12_4_ = auVar21._12_4_; auVar20._8_2_ = 0; auVar20._0_8_ = uVar1; auVar20._10_2_ = uVar31; auVar19._10_6_ = auVar20._10_6_; auVar19._8_2_ = uVar31; auVar19._0_8_ = uVar1; uVar31 = (undefined2)(uVar1 >> 0x10); auVar5._4_8_ = auVar19._8_8_; auVar5._2_2_ = uVar31; auVar5._0_2_ = uVar31; auVar22._0_4_ = (short)uVar1 + 8 >> 4; auVar22._4_4_ = (auVar5._0_4_ >> 0x10) + 8 >> 4; auVar22._8_4_ = (auVar19._8_4_ >> 0x10) + 8 >> 4; auVar22._12_4_ = (auVar20._12_4_ >> 0x10) + 8 >> 4; auVar18 = pshuflw(auVar22,auVar22,0xd8); auVar18 = pshufhw(auVar18,auVar18,0xd8); puVar10[-1] = CONCAT44(auVar18._8_4_,auVar18._0_4_); uVar1 = *puVar10; uVar31 = (undefined2)(uVar1 >> 0x30); auVar25._8_4_ = 0; auVar25._0_8_ = uVar1; auVar25._12_2_ = uVar31; auVar25._14_2_ = uVar31; uVar31 = (undefined2)(uVar1 >> 0x20); auVar24._12_4_ = auVar25._12_4_; auVar24._8_2_ = 0; auVar24._0_8_ = uVar1; auVar24._10_2_ = uVar31; auVar23._10_6_ = auVar24._10_6_; auVar23._8_2_ = uVar31; auVar23._0_8_ = uVar1; uVar31 = (undefined2)(uVar1 >> 0x10); auVar6._4_8_ = auVar23._8_8_; auVar6._2_2_ = uVar31; auVar6._0_2_ = uVar31; auVar26._0_4_ = (short)uVar1 + 8 >> 4; auVar26._4_4_ = (auVar6._0_4_ >> 0x10) + 8 >> 4; auVar26._8_4_ = (auVar23._8_4_ >> 0x10) + 8 >> 4; auVar26._12_4_ = (auVar24._12_4_ >> 0x10) + 8 >> 4; auVar18 = pshuflw(auVar26,auVar26,0xd8); auVar18 = pshufhw(auVar18,auVar18,0xd8); *puVar10 = CONCAT44(auVar18._8_4_,auVar18._0_4_); uVar1 = puVar10[1]; uVar31 = (undefined2)(uVar1 >> 0x30); auVar29._8_4_ = 0; auVar29._0_8_ = uVar1; auVar29._12_2_ = uVar31; auVar29._14_2_ = uVar31; uVar31 = (undefined2)(uVar1 >> 0x20); auVar28._12_4_ = auVar29._12_4_; auVar28._8_2_ = 0; auVar28._0_8_ = uVar1; auVar28._10_2_ = uVar31; auVar27._10_6_ = auVar28._10_6_; auVar27._8_2_ = uVar31; auVar27._0_8_ = uVar1; uVar31 = (undefined2)(uVar1 >> 0x10); auVar7._4_8_ = auVar27._8_8_; auVar7._2_2_ = uVar31; auVar7._0_2_ = uVar31; auVar30._0_4_ = (short)uVar1 + 8 >> 4; auVar30._4_4_ = (auVar7._0_4_ >> 0x10) + 8 >> 4; auVar30._8_4_ = (auVar27._8_4_ >> 0x10) + 8 >> 4; auVar30._12_4_ = (auVar28._12_4_ >> 0x10) + 8 >> 4; auVar18 = pshuflw(auVar30,auVar30,0xd8); auVar18 = pshufhw(auVar18,auVar18,0xd8); puVar10[1] = CONCAT44(auVar18._8_4_,auVar18._0_4_); iVar13 = iVar13 + -1; puVar10 = puVar10 + 4; } while (iVar13 != 0); *(undefined2 *)(param_2 + 0xc) = 0; param_2[8] = 0; *(undefined4 *)((int)param_2 + 0x12) = 0; *(undefined2 *)(param_2 + 4) = 0; param_2[1] = 0; *param_2 = 0; return; } //@@ 00ae3dc0 oc_idct8x8_c /* DB: libtheora (round 7 agent) */ void oc_idct8x8_c(int param_1,undefined4 *param_2,int param_3) { ulonglong uVar1; undefined1 auVar2 [12]; undefined1 auVar3 [12]; undefined1 auVar4 [12]; undefined1 auVar5 [12]; ulonglong *puVar6; int iVar7; int iVar8; undefined1 *puVar9; int iVar10; undefined2 uVar27; undefined1 auVar12 [16]; undefined1 auVar11 [16]; undefined1 auVar13 [16]; undefined1 auVar14 [16]; undefined1 auVar17 [16]; undefined1 auVar16 [16]; undefined1 auVar15 [16]; undefined1 auVar18 [16]; undefined1 auVar21 [16]; undefined1 auVar20 [16]; undefined1 auVar19 [16]; undefined1 auVar22 [16]; undefined1 auVar25 [16]; undefined1 auVar24 [16]; undefined1 auVar23 [16]; undefined1 auVar26 [16]; undefined1 local_84 [2]; undefined2 local_82; undefined2 local_72; undefined2 local_62; undefined2 local_52; undefined2 local_42; undefined2 local_32; undefined2 local_22; undefined2 local_12; if (param_3 < 4) { idct8_2(local_84,param_2); puVar9 = local_84; local_82 = (undefined2)((uint)(*(short *)(param_2 + 4) * 0xb505) >> 0x10); iVar8 = 8; iVar10 = param_1; local_72 = local_82; local_62 = local_82; local_52 = local_82; local_42 = local_82; local_32 = local_82; local_22 = local_82; local_12 = local_82; do { iVar7 = iVar8; idct8_2(iVar10,puVar9); puVar9 = puVar9 + 0x10; iVar10 = iVar10 + 2; iVar8 = iVar7 + -1; } while (iVar8 != 0); iVar7 = iVar7 + 3; puVar6 = (ulonglong *)(param_1 + 0x10); do { uVar1 = puVar6[-2]; uVar27 = (undefined2)(uVar1 >> 0x30); auVar12._8_4_ = 0; auVar12._0_8_ = uVar1; auVar12._12_2_ = uVar27; auVar12._14_2_ = uVar27; uVar27 = (undefined2)(uVar1 >> 0x20); auVar14._12_4_ = auVar12._12_4_; auVar14._8_2_ = 0; auVar14._0_8_ = uVar1; auVar14._10_2_ = uVar27; auVar11._10_6_ = auVar14._10_6_; auVar11._8_2_ = uVar27; auVar11._0_8_ = uVar1; uVar27 = (undefined2)(uVar1 >> 0x10); auVar2._4_8_ = auVar11._8_8_; auVar2._2_2_ = uVar27; auVar2._0_2_ = uVar27; auVar13._0_4_ = (short)uVar1 + 8 >> 4; auVar13._4_4_ = (auVar2._0_4_ >> 0x10) + 8 >> 4; auVar13._8_4_ = (auVar11._8_4_ >> 0x10) + 8 >> 4; auVar13._12_4_ = (auVar14._12_4_ >> 0x10) + 8 >> 4; auVar14 = pshuflw(auVar13,auVar13,0xd8); auVar14 = pshufhw(auVar14,auVar14,0xd8); puVar6[-2] = CONCAT44(auVar14._8_4_,auVar14._0_4_); uVar1 = puVar6[-1]; uVar27 = (undefined2)(uVar1 >> 0x30); auVar17._8_4_ = 0; auVar17._0_8_ = uVar1; auVar17._12_2_ = uVar27; auVar17._14_2_ = uVar27; uVar27 = (undefined2)(uVar1 >> 0x20); auVar16._12_4_ = auVar17._12_4_; auVar16._8_2_ = 0; auVar16._0_8_ = uVar1; auVar16._10_2_ = uVar27; auVar15._10_6_ = auVar16._10_6_; auVar15._8_2_ = uVar27; auVar15._0_8_ = uVar1; uVar27 = (undefined2)(uVar1 >> 0x10); auVar3._4_8_ = auVar15._8_8_; auVar3._2_2_ = uVar27; auVar3._0_2_ = uVar27; auVar18._0_4_ = (short)uVar1 + 8 >> 4; auVar18._4_4_ = (auVar3._0_4_ >> 0x10) + 8 >> 4; auVar18._8_4_ = (auVar15._8_4_ >> 0x10) + 8 >> 4; auVar18._12_4_ = (auVar16._12_4_ >> 0x10) + 8 >> 4; auVar14 = pshuflw(auVar18,auVar18,0xd8); auVar14 = pshufhw(auVar14,auVar14,0xd8); puVar6[-1] = CONCAT44(auVar14._8_4_,auVar14._0_4_); uVar1 = *puVar6; uVar27 = (undefined2)(uVar1 >> 0x30); auVar21._8_4_ = 0; auVar21._0_8_ = uVar1; auVar21._12_2_ = uVar27; auVar21._14_2_ = uVar27; uVar27 = (undefined2)(uVar1 >> 0x20); auVar20._12_4_ = auVar21._12_4_; auVar20._8_2_ = 0; auVar20._0_8_ = uVar1; auVar20._10_2_ = uVar27; auVar19._10_6_ = auVar20._10_6_; auVar19._8_2_ = uVar27; auVar19._0_8_ = uVar1; uVar27 = (undefined2)(uVar1 >> 0x10); auVar4._4_8_ = auVar19._8_8_; auVar4._2_2_ = uVar27; auVar4._0_2_ = uVar27; auVar22._0_4_ = (short)uVar1 + 8 >> 4; auVar22._4_4_ = (auVar4._0_4_ >> 0x10) + 8 >> 4; auVar22._8_4_ = (auVar19._8_4_ >> 0x10) + 8 >> 4; auVar22._12_4_ = (auVar20._12_4_ >> 0x10) + 8 >> 4; auVar14 = pshuflw(auVar22,auVar22,0xd8); auVar14 = pshufhw(auVar14,auVar14,0xd8); *puVar6 = CONCAT44(auVar14._8_4_,auVar14._0_4_); uVar1 = puVar6[1]; uVar27 = (undefined2)(uVar1 >> 0x30); auVar25._8_4_ = 0; auVar25._0_8_ = uVar1; auVar25._12_2_ = uVar27; auVar25._14_2_ = uVar27; uVar27 = (undefined2)(uVar1 >> 0x20); auVar24._12_4_ = auVar25._12_4_; auVar24._8_2_ = 0; auVar24._0_8_ = uVar1; auVar24._10_2_ = uVar27; auVar23._10_6_ = auVar24._10_6_; auVar23._8_2_ = uVar27; auVar23._0_8_ = uVar1; uVar27 = (undefined2)(uVar1 >> 0x10); auVar5._4_8_ = auVar23._8_8_; auVar5._2_2_ = uVar27; auVar5._0_2_ = uVar27; auVar26._0_4_ = (short)uVar1 + 8 >> 4; auVar26._4_4_ = (auVar5._0_4_ >> 0x10) + 8 >> 4; auVar26._8_4_ = (auVar23._8_4_ >> 0x10) + 8 >> 4; auVar26._12_4_ = (auVar24._12_4_ >> 0x10) + 8 >> 4; auVar14 = pshuflw(auVar26,auVar26,0xd8); auVar14 = pshufhw(auVar14,auVar14,0xd8); puVar6[1] = CONCAT44(auVar14._8_4_,auVar14._0_4_); iVar7 = iVar7 + -1; puVar6 = puVar6 + 4; } while (iVar7 != 0); *(undefined2 *)(param_2 + 4) = 0; *param_2 = 0; return; } if (param_3 < 0xb) { oc_idct8x8_10(); return; } oc_idct8x8_slow(param_1,param_2); return; } //@@ 00ae3f40 oc_idct8x8_slow /* DB: libtheora idct.c (C path): (y, x) two-pass 8x8 IDCT through idct8 (00ae3830); reached from oc_idct8x8_c (00ae3dc0, stored at [eax+0x54] by oc_state_accel_init_c at ae0b60) when last_zzi >= 11 */ void oc_idct8x8_slow(int param_1,undefined4 *param_2) { ulonglong uVar1; short sVar2; short sVar3; short sVar4; short sVar5; short sVar6; short sVar7; short sVar8; undefined1 auVar9 [12]; undefined1 auVar10 [12]; undefined1 auVar11 [12]; undefined1 auVar12 [12]; int iVar13; int iVar14; ulonglong *puVar15; int iVar16; int iVar17; int iVar18; int iVar19; short *psVar20; undefined2 uVar37; undefined1 auVar22 [16]; undefined1 auVar21 [16]; undefined1 auVar23 [16]; undefined1 auVar24 [16]; undefined1 auVar27 [16]; undefined1 auVar26 [16]; undefined1 auVar25 [16]; undefined1 auVar28 [16]; undefined1 auVar31 [16]; undefined1 auVar30 [16]; undefined1 auVar29 [16]; undefined1 auVar32 [16]; undefined1 auVar35 [16]; undefined1 auVar34 [16]; undefined1 auVar33 [16]; undefined1 auVar36 [16]; short local_b0 [8]; short local_a0 [8]; short local_90 [8]; short local_80 [8]; short local_70 [8]; short local_60 [8]; short local_50 [8]; short local_40 [8]; int local_30; int local_2c; short *local_28; int local_24; int local_20; int local_1c; int local_18; int local_14; int local_10; int local_c; short *local_8; local_8 = local_90; local_28 = (short *)(param_2 + 3); local_2c = 8; do { psVar20 = local_8; iVar13 = (short)(local_28[-6] + local_28[-2]) * 0xb505; local_14 = iVar13 >> 0x10; iVar14 = (short)(local_28[-6] - local_28[-2]) * 0xb505; local_1c = iVar14 >> 0x10; local_18 = (local_28[-4] * 0x61f8 >> 0x10) - (*local_28 * 0xec83 >> 0x10); local_10 = (*local_28 * 0x61f8 >> 0x10) + (local_28[-4] * 0xec83 >> 0x10); iVar16 = (local_28[-5] * 0x31f1 >> 0x10) - (local_28[1] * 0xfb15 >> 0x10); iVar19 = (local_28[-1] * 0xd4db >> 0x10) - (local_28[-3] * 0x8e3a >> 0x10); iVar18 = (local_28[-1] * 0x8e3a >> 0x10) + (local_28[-3] * 0xd4db >> 0x10); iVar17 = (local_28[-5] * 0xfb15 >> 0x10) + (local_28[1] * 0x31f1 >> 0x10); local_20 = iVar16 + iVar19; sVar2 = (short)((uint)iVar13 >> 0x10); sVar5 = sVar2 - (short)local_10; sVar8 = (short)((uint)iVar14 >> 0x10) - (short)local_18; iVar14 = (short)((short)iVar16 - (short)iVar19) * 0xb505 >> 0x10; local_c = iVar17 + iVar18; iVar13 = (short)((short)iVar17 - (short)iVar18) * 0xb505 >> 0x10; local_30 = iVar13 - iVar14; iVar13 = iVar13 + iVar14; local_8[-0x10] = sVar2 + (short)local_10 + (short)local_c; sVar3 = (short)local_1c + (short)local_18; sVar2 = (short)iVar13; local_24 = iVar13; psVar20[-8] = sVar2 + sVar3; sVar7 = (short)local_30; *local_8 = sVar7 + sVar8; sVar4 = (short)local_20; local_8[8] = sVar4 + sVar5; local_8[0x10] = sVar5 - sVar4; sVar4 = (short)local_14; sVar5 = (short)local_10; sVar6 = (short)local_c; local_8[0x18] = sVar8 - sVar7; local_8[0x20] = sVar3 - sVar2; local_8[0x28] = (sVar4 + sVar5) - sVar6; local_8 = local_8 + 1; local_28 = local_28 + 8; local_2c = local_2c + -1; } while (local_2c != 0); psVar20 = local_b0; local_2c = 0; iVar13 = 8; iVar14 = param_1; do { iVar16 = iVar13; FUN_00ae3830(iVar14,psVar20); psVar20 = psVar20 + 8; iVar14 = iVar14 + 2; iVar13 = iVar16 + -1; } while (iVar13 != 0); iVar16 = iVar16 + 3; puVar15 = (ulonglong *)(param_1 + 0x10); do { uVar1 = puVar15[-2]; uVar37 = (undefined2)(uVar1 >> 0x30); auVar22._8_4_ = 0; auVar22._0_8_ = uVar1; auVar22._12_2_ = uVar37; auVar22._14_2_ = uVar37; uVar37 = (undefined2)(uVar1 >> 0x20); auVar24._12_4_ = auVar22._12_4_; auVar24._8_2_ = 0; auVar24._0_8_ = uVar1; auVar24._10_2_ = uVar37; auVar21._10_6_ = auVar24._10_6_; auVar21._8_2_ = uVar37; auVar21._0_8_ = uVar1; uVar37 = (undefined2)(uVar1 >> 0x10); auVar9._4_8_ = auVar21._8_8_; auVar9._2_2_ = uVar37; auVar9._0_2_ = uVar37; auVar23._0_4_ = (short)uVar1 + 8 >> 4; auVar23._4_4_ = (auVar9._0_4_ >> 0x10) + 8 >> 4; auVar23._8_4_ = (auVar21._8_4_ >> 0x10) + 8 >> 4; auVar23._12_4_ = (auVar24._12_4_ >> 0x10) + 8 >> 4; auVar24 = pshuflw(auVar23,auVar23,0xd8); auVar24 = pshufhw(auVar24,auVar24,0xd8); puVar15[-2] = CONCAT44(auVar24._8_4_,auVar24._0_4_); uVar1 = puVar15[-1]; uVar37 = (undefined2)(uVar1 >> 0x30); auVar27._8_4_ = 0; auVar27._0_8_ = uVar1; auVar27._12_2_ = uVar37; auVar27._14_2_ = uVar37; uVar37 = (undefined2)(uVar1 >> 0x20); auVar26._12_4_ = auVar27._12_4_; auVar26._8_2_ = 0; auVar26._0_8_ = uVar1; auVar26._10_2_ = uVar37; auVar25._10_6_ = auVar26._10_6_; auVar25._8_2_ = uVar37; auVar25._0_8_ = uVar1; uVar37 = (undefined2)(uVar1 >> 0x10); auVar10._4_8_ = auVar25._8_8_; auVar10._2_2_ = uVar37; auVar10._0_2_ = uVar37; auVar28._0_4_ = (short)uVar1 + 8 >> 4; auVar28._4_4_ = (auVar10._0_4_ >> 0x10) + 8 >> 4; auVar28._8_4_ = (auVar25._8_4_ >> 0x10) + 8 >> 4; auVar28._12_4_ = (auVar26._12_4_ >> 0x10) + 8 >> 4; auVar24 = pshuflw(auVar28,auVar28,0xd8); auVar24 = pshufhw(auVar24,auVar24,0xd8); puVar15[-1] = CONCAT44(auVar24._8_4_,auVar24._0_4_); uVar1 = *puVar15; uVar37 = (undefined2)(uVar1 >> 0x30); auVar31._8_4_ = 0; auVar31._0_8_ = uVar1; auVar31._12_2_ = uVar37; auVar31._14_2_ = uVar37; uVar37 = (undefined2)(uVar1 >> 0x20); auVar30._12_4_ = auVar31._12_4_; auVar30._8_2_ = 0; auVar30._0_8_ = uVar1; auVar30._10_2_ = uVar37; auVar29._10_6_ = auVar30._10_6_; auVar29._8_2_ = uVar37; auVar29._0_8_ = uVar1; uVar37 = (undefined2)(uVar1 >> 0x10); auVar11._4_8_ = auVar29._8_8_; auVar11._2_2_ = uVar37; auVar11._0_2_ = uVar37; auVar32._0_4_ = (short)uVar1 + 8 >> 4; auVar32._4_4_ = (auVar11._0_4_ >> 0x10) + 8 >> 4; auVar32._8_4_ = (auVar29._8_4_ >> 0x10) + 8 >> 4; auVar32._12_4_ = (auVar30._12_4_ >> 0x10) + 8 >> 4; auVar24 = pshuflw(auVar32,auVar32,0xd8); auVar24 = pshufhw(auVar24,auVar24,0xd8); *puVar15 = CONCAT44(auVar24._8_4_,auVar24._0_4_); uVar1 = puVar15[1]; uVar37 = (undefined2)(uVar1 >> 0x30); auVar35._8_4_ = 0; auVar35._0_8_ = uVar1; auVar35._12_2_ = uVar37; auVar35._14_2_ = uVar37; uVar37 = (undefined2)(uVar1 >> 0x20); auVar34._12_4_ = auVar35._12_4_; auVar34._8_2_ = 0; auVar34._0_8_ = uVar1; auVar34._10_2_ = uVar37; auVar33._10_6_ = auVar34._10_6_; auVar33._8_2_ = uVar37; auVar33._0_8_ = uVar1; uVar37 = (undefined2)(uVar1 >> 0x10); auVar12._4_8_ = auVar33._8_8_; auVar12._2_2_ = uVar37; auVar12._0_2_ = uVar37; auVar36._0_4_ = (short)uVar1 + 8 >> 4; auVar36._4_4_ = (auVar12._0_4_ >> 0x10) + 8 >> 4; auVar36._8_4_ = (auVar33._8_4_ >> 0x10) + 8 >> 4; auVar36._12_4_ = (auVar34._12_4_ >> 0x10) + 8 >> 4; auVar24 = pshuflw(auVar36,auVar36,0xd8); auVar24 = pshufhw(auVar24,auVar24,0xd8); puVar15[1] = CONCAT44(auVar24._8_4_,auVar24._0_4_); iVar16 = iVar16 + -1; puVar15 = puVar15 + 4; } while (iVar16 != 0); *param_2 = 0; param_2[1] = 0; param_2[2] = 0; param_2[3] = 0; param_2[4] = 0; param_2[5] = 0; param_2[6] = 0; param_2[7] = 0; param_2[8] = 0; param_2[9] = 0; param_2[10] = 0; param_2[0xb] = 0; param_2[0xc] = 0; param_2[0xd] = 0; param_2[0xe] = 0; param_2[0xf] = 0; param_2[0x10] = 0; param_2[0x11] = 0; param_2[0x12] = 0; param_2[0x13] = 0; param_2[0x14] = 0; param_2[0x15] = 0; param_2[0x16] = 0; param_2[0x17] = 0; param_2[0x18] = 0; param_2[0x19] = 0; param_2[0x1a] = 0; param_2[0x1b] = 0; param_2[0x1c] = 0; param_2[0x1d] = 0; param_2[0x1e] = 0; param_2[0x1f] = 0; return; } //@@ 00ae4210 oc_cpu_flags_get /* DB: libtheora x86/x86state.c: cpuid vendor checks "GenuineIntel" (0x756e6547/0x49656e69/0x6c65746e), "AuthenticAMD", "CentaurHauls", " UMC"/"NexGenDriven"/"Cyrix", extended leaf 0x80000001; result used by oc_state_accel_init_x86 (call at ae3153) */ uint oc_cpu_flags_get(void) { uint uVar1; uint uVar2; uint local_1c; uint local_18; int local_14; int local_10; uint local_c; uint local_8; FUN_00ae4430(&local_8,&local_c); if (local_8 == local_c) { return 0; } FUN_00ae4410(&local_1c,0); local_8 = local_1c; local_c = local_18; if (local_14 == 0x6c65746e) { if (local_10 != 0x49656e69) { return 0; } } else { if (local_14 != 0x3638784d) { if (local_14 == 0x444d4163) { if (local_10 != 0x69746e65) { return 0; } if (local_18 != 0x68747541) { return 0; } } else { if (local_14 != 0x43534e20) { if (local_14 != 0x736c7561) { return 0; } if (local_10 != 0x48727561) { return 0; } if (local_18 != 0x746e6543) { return 0; } FUN_00ae4410(&local_1c,1); local_8 = local_1c; local_c = local_18; uVar1 = FUN_00ae44b0(local_10,local_14); if (local_1c < 0x80000001) { return uVar1; } FUN_00ae4410(&local_1c,0x80000001); uVar2 = FUN_00ae4450(local_10,local_14); return uVar1 | uVar2; } if (local_10 != 0x79622065) { return 0; } if (local_18 != 0x646f6547) { return 0; } } FUN_00ae4410(&local_1c,0x80000000); local_8 = local_1c; local_c = local_18; if (local_1c < 0x80000001) { uVar1 = 0; } else { FUN_00ae4410(&local_1c,0x80000001); local_8 = local_1c; local_c = local_18; uVar1 = FUN_00ae4450(local_10,local_14); } FUN_00ae4410(&local_1c,1); uVar2 = FUN_00ae44b0(local_10,local_14); return uVar1 | uVar2; } if (local_10 != 0x54656e69) { return 0; } } if (local_18 != 0x756e6547) { return 0; } FUN_00ae4410(&local_1c,1); uVar1 = FUN_00ae44b0(local_10,local_14); uVar2 = local_1c >> 4 & 0xf; if ((local_1c & 0xf00) != 0x600) { return uVar1; } if (((uVar2 == 9) || (uVar2 == 0xd)) || (uVar2 == 0xe)) { return uVar1 & 0xffffff9f; } return uVar1; } //@@ 00ae4410 FUN_00ae4410 void FUN_00ae4410(undefined4 *param_1,int param_2) { undefined4 *puVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; if (param_2 == 0) { puVar1 = (undefined4 *)cpuid_basic_info(0); } else if (param_2 == 1) { puVar1 = (undefined4 *)cpuid_Version_info(1); } else if (param_2 == 2) { puVar1 = (undefined4 *)cpuid_cache_tlb_info(2); } else if (param_2 == 3) { puVar1 = (undefined4 *)cpuid_serial_info(3); } else if (param_2 == 4) { puVar1 = (undefined4 *)cpuid_Deterministic_Cache_Parameters_info(4); } else if (param_2 == 5) { puVar1 = (undefined4 *)cpuid_MONITOR_MWAIT_Features_info(5); } else if (param_2 == 6) { puVar1 = (undefined4 *)cpuid_Thermal_Power_Management_info(6); } else if (param_2 == 7) { puVar1 = (undefined4 *)cpuid_Extended_Feature_Enumeration_info(7); } else if (param_2 == 9) { puVar1 = (undefined4 *)cpuid_Direct_Cache_Access_info(9); } else if (param_2 == 10) { puVar1 = (undefined4 *)cpuid_Architectural_Performance_Monitoring_info(10); } else if (param_2 == 0xb) { puVar1 = (undefined4 *)cpuid_Extended_Topology_info(0xb); } else if (param_2 == 0xd) { puVar1 = (undefined4 *)cpuid_Processor_Extended_States_info(0xd); } else if (param_2 == 0xf) { puVar1 = (undefined4 *)cpuid_Quality_of_Service_info(0xf); } else if (param_2 == -0x7ffffffe) { puVar1 = (undefined4 *)cpuid_brand_part1_info(0x80000002); } else if (param_2 == -0x7ffffffd) { puVar1 = (undefined4 *)cpuid_brand_part2_info(0x80000003); } else if (param_2 == -0x7ffffffc) { puVar1 = (undefined4 *)cpuid_brand_part3_info(0x80000004); } else { puVar1 = (undefined4 *)cpuid(param_2); } uVar4 = puVar1[1]; uVar3 = puVar1[2]; uVar2 = puVar1[3]; *param_1 = *puVar1; param_1[1] = uVar4; param_1[2] = uVar2; param_1[3] = uVar3; return; } //@@ 00ae4430 FUN_00ae4430 void FUN_00ae4430(uint *param_1,uint *param_2) { uint uVar1; byte in_CF; byte in_PF; byte in_AF; byte in_ZF; byte in_SF; byte in_TF; byte in_IF; byte in_OF; byte in_NT; byte in_AC; byte in_VIF; byte in_VIP; byte in_ID; uint uVar2; uVar2 = (uint)(in_NT & 1) * 0x4000 | (uint)(in_OF & 1) * 0x800 | (uint)(in_IF & 1) * 0x200 | (uint)(in_TF & 1) * 0x100 | (uint)(in_SF & 1) * 0x80 | (uint)(in_ZF & 1) * 0x40 | (uint)(in_AF & 1) * 0x10 | (uint)(in_PF & 1) * 4 | (uint)(in_CF & 1) | (uint)(in_ID & 1) * 0x200000 | (uint)(in_VIP & 1) * 0x100000 | (uint)(in_VIF & 1) * 0x80000 | (uint)(in_AC & 1) * 0x40000; uVar1 = uVar2 ^ 0x200000; *param_1 = (uint)((uVar1 & 0x4000) != 0) * 0x4000 | (uint)((uVar1 & 0x800) != 0) * 0x800 | (uint)((uVar1 & 0x200) != 0) * 0x200 | (uint)((uVar1 & 0x100) != 0) * 0x100 | (uint)((uVar1 & 0x80) != 0) * 0x80 | (uint)((uVar1 & 0x40) != 0) * 0x40 | (uint)((uVar1 & 0x10) != 0) * 0x10 | (uint)((uVar1 & 4) != 0) * 4 | (uint)((uVar1 & 1) != 0) | (uint)((uVar1 & 0x200000) != 0) * 0x200000 | (uint)((uVar1 & 0x40000) != 0) * 0x40000; *param_2 = uVar2; return; } //@@ 00ae4450 FUN_00ae4450 uint FUN_00ae4450(uint param_1,uint param_2) { uint uVar1; uint uVar2; if ((param_1 & 0x800000) == 0) { return 0; } uVar1 = (param_1 & 0x400000 | 0x80000) >> 0x13; uVar2 = uVar1 | 2; if (-1 < (int)param_1) { uVar2 = uVar1; } uVar1 = uVar2 | 4; if ((param_1 & 0x40000000) == 0) { uVar1 = uVar2; } uVar2 = uVar1 | 0x400; if ((param_2 & 0x40) == 0) { uVar2 = uVar1; } uVar1 = uVar2 | 0x800; if ((param_2 & 0x800) == 0) { uVar1 = uVar2; } return uVar1; } //@@ 00ae44b0 FUN_00ae44b0 uint FUN_00ae44b0(uint param_1,uint param_2) { uint uVar1; uint uVar2; if ((param_1 & 0x800000) == 0) { return 0; } uVar1 = (-(uint)((param_1 & 0x2000000) != 0) & 0x18) + 1; uVar2 = uVar1 | 0x20; if ((param_1 & 0x4000000) == 0) { uVar2 = uVar1; } uVar1 = uVar2 | 0x40; if ((param_2 & 1) == 0) { uVar1 = uVar2; } uVar2 = uVar1 | 0x80; if ((param_2 & 0x100) == 0) { uVar2 = uVar1; } uVar1 = uVar2 | 0x100; if ((param_2 & 0x80000) == 0) { uVar1 = uVar2; } uVar2 = uVar1 | 0x200; if ((param_2 & 0x100000) == 0) { uVar2 = uVar1; } return uVar2; } //@@ 00ae4530 FUN_00ae4530 void FUN_00ae4530(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6) { undefined8 uVar1; undefined8 uVar2; undefined8 uVar3; int iVar4; undefined8 *puVar5; undefined8 *puVar6; int iVar7; iVar7 = 0; if (0 < param_5) { do { iVar4 = *(int *)(param_6 + *(int *)(param_4 + iVar7 * 4) * 4); puVar5 = (undefined8 *)(param_2 + iVar4); puVar6 = (undefined8 *)(param_1 + iVar4); uVar1 = *(undefined8 *)((int)puVar5 + param_3); iVar4 = param_3 * 3; uVar2 = *(undefined8 *)((int)puVar5 + param_3 * 2); uVar3 = *(undefined8 *)((int)puVar5 + iVar4); *puVar6 = *puVar5; *(undefined8 *)((int)puVar6 + param_3) = uVar1; puVar5 = (undefined8 *)((int)puVar5 + param_3 * 4); *(undefined8 *)((int)puVar6 + param_3 * 2) = uVar2; *(undefined8 *)((int)puVar6 + iVar4) = uVar3; puVar6 = (undefined8 *)((int)puVar6 + param_3 * 4); uVar1 = *(undefined8 *)((int)puVar5 + param_3); uVar2 = *(undefined8 *)((int)puVar5 + param_3 * 2); uVar3 = *(undefined8 *)((int)puVar5 + iVar4); *puVar6 = *puVar5; *(undefined8 *)((int)puVar6 + param_3) = uVar1; *(undefined8 *)((int)puVar6 + param_3 * 2) = uVar2; *(undefined8 *)((int)puVar6 + iVar4) = uVar3; iVar7 = iVar7 + 1; } while (iVar7 < param_5); } return; } //@@ 00ae45c0 FUN_00ae45c0 void FUN_00ae45c0(undefined8 *param_1,undefined8 *param_2,int param_3) { undefined8 uVar1; undefined8 uVar2; undefined8 uVar3; int iVar4; uVar1 = *(undefined8 *)((int)param_2 + param_3); iVar4 = param_3 * 3; uVar2 = *(undefined8 *)((int)param_2 + param_3 * 2); uVar3 = *(undefined8 *)((int)param_2 + iVar4); *param_1 = *param_2; *(undefined8 *)((int)param_1 + param_3) = uVar1; param_2 = (undefined8 *)((int)param_2 + param_3 * 4); *(undefined8 *)((int)param_1 + param_3 * 2) = uVar2; *(undefined8 *)((int)param_1 + iVar4) = uVar3; param_1 = (undefined8 *)((int)param_1 + param_3 * 4); uVar1 = *(undefined8 *)((int)param_2 + param_3); uVar2 = *(undefined8 *)((int)param_2 + param_3 * 2); uVar3 = *(undefined8 *)((int)param_2 + iVar4); *param_1 = *param_2; *(undefined8 *)((int)param_1 + param_3) = uVar1; *(undefined8 *)((int)param_1 + param_3 * 2) = uVar2; *(undefined8 *)((int)param_1 + iVar4) = uVar3; return; } //@@ 00ae4630 FUN_00ae4630 void FUN_00ae4630(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3,int param_4, undefined8 *param_5) { undefined8 uVar1; short sVar2; short sVar3; short sVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; int iVar10; undefined8 uVar11; undefined8 uVar12; undefined8 uVar13; undefined8 uVar14; iVar10 = 4; do { iVar10 = iVar10 + -1; uVar12 = *param_2; uVar13 = *param_3; uVar14 = *(undefined8 *)((int)param_2 + param_4); uVar1 = *(undefined8 *)((int)param_3 + param_4); param_2 = (undefined8 *)((int)param_2 + param_4 * 2); param_3 = (undefined8 *)((int)param_3 + param_4 * 2); uVar11 = paddsw((ulonglong) CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)(( ulonglong)uVar12 >> 0x18) << 0x30) >> 0x28), (char)((ulonglong)uVar12 >> 0x10)) << 0x20) >> 0x18), CONCAT12((char)((ulonglong)uVar12 >> 8),(short)uVar12)) >> 0x10),(short)uVar12) & 0xffff00ff00ff00ff, (ulonglong) CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)(( ulonglong)uVar13 >> 0x18) << 0x30) >> 0x28), (char)((ulonglong)uVar13 >> 0x10)) << 0x20) >> 0x18), CONCAT12((char)((ulonglong)uVar13 >> 8),(short)uVar13)) >> 0x10),(short)uVar13) & 0xffff00ff00ff00ff); uVar13 = paddsw((ulonglong) CONCAT16((char)((ulonglong)uVar12 >> 0x38), (uint6)CONCAT14((char)((ulonglong)uVar12 >> 0x30), (uint)CONCAT12((char)((ulonglong)uVar12 >> 0x28), (ushort)(byte)((ulonglong)uVar12 >> 0x20 )))), (ulonglong) CONCAT16((char)((ulonglong)uVar13 >> 0x38), (uint6)CONCAT14((char)((ulonglong)uVar13 >> 0x30), (uint)CONCAT12((char)((ulonglong)uVar13 >> 0x28), (ushort)(byte)((ulonglong)uVar13 >> 0x20 ))))); uVar12 = psraw(uVar11,1); uVar13 = psraw(uVar13,1); uVar12 = paddsw(uVar12,*param_5); uVar13 = paddsw(uVar13,param_5[1]); uVar11 = paddsw((ulonglong) CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)(( ulonglong)uVar1 >> 0x18) << 0x30) >> 0x28), (char)((ulonglong)uVar1 >> 0x10)) << 0x20) >> 0x18 ),CONCAT12((char)((ulonglong)uVar1 >> 8), (short)uVar1)) >> 0x10),(short)uVar1) & 0xffff00ff00ff00ff, (ulonglong) CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)(( ulonglong)uVar14 >> 0x18) << 0x30) >> 0x28), (char)((ulonglong)uVar14 >> 0x10)) << 0x20) >> 0x18), CONCAT12((char)((ulonglong)uVar14 >> 8),(short)uVar14)) >> 0x10),(short)uVar14) & 0xffff00ff00ff00ff); sVar2 = (short)uVar12; sVar3 = (short)((ulonglong)uVar12 >> 0x10); sVar4 = (short)((ulonglong)uVar12 >> 0x20); sVar5 = (short)((ulonglong)uVar12 >> 0x30); sVar6 = (short)uVar13; sVar7 = (short)((ulonglong)uVar13 >> 0x10); sVar8 = (short)((ulonglong)uVar13 >> 0x20); sVar9 = (short)((ulonglong)uVar13 >> 0x30); uVar14 = paddsw((ulonglong) CONCAT16((char)((ulonglong)uVar1 >> 0x38), (uint6)CONCAT14((char)((ulonglong)uVar1 >> 0x30), (uint)CONCAT12((char)((ulonglong)uVar1 >> 0x28), (ushort)(byte)((ulonglong)uVar1 >> 0x20) ))), (ulonglong) CONCAT16((char)((ulonglong)uVar14 >> 0x38), (uint6)CONCAT14((char)((ulonglong)uVar14 >> 0x30), (uint)CONCAT12((char)((ulonglong)uVar14 >> 0x28), (ushort)(byte)((ulonglong)uVar14 >> 0x20 ))))); *param_1 = CONCAT17((0 < sVar9) * (sVar9 < 0x100) * (char)((ulonglong)uVar13 >> 0x30) - (0xff < sVar9), CONCAT16((0 < sVar8) * (sVar8 < 0x100) * (char)((ulonglong)uVar13 >> 0x20) - (0xff < sVar8), CONCAT15((0 < sVar7) * (sVar7 < 0x100) * (char)((ulonglong)uVar13 >> 0x10) - (0xff < sVar7), CONCAT14((0 < sVar6) * (sVar6 < 0x100) * (char)uVar13 - (0xff < sVar6), CONCAT13((0 < sVar5) * (sVar5 < 0x100) * (char)((ulonglong)uVar12 >> 0x30) - (0xff < sVar5), CONCAT12((0 < sVar4) * (sVar4 < 0x100) * (char)((ulonglong)uVar12 >> 0x20) - (0xff < sVar4), CONCAT11((0 < sVar3) * (sVar3 < 0x100) * (char)((ulonglong) uVar12 >> 0x10) - (0xff < sVar3), (0 < sVar2) * (sVar2 < 0x100) * (char)uVar12 - (0xff < sVar2)))))))); uVar13 = psraw(uVar11,1); uVar12 = psraw(uVar14,1); uVar13 = paddsw(uVar13,param_5[2]); uVar12 = paddsw(uVar12,param_5[3]); sVar2 = (short)uVar13; sVar3 = (short)((ulonglong)uVar13 >> 0x10); sVar4 = (short)((ulonglong)uVar13 >> 0x20); sVar5 = (short)((ulonglong)uVar13 >> 0x30); sVar6 = (short)uVar12; sVar7 = (short)((ulonglong)uVar12 >> 0x10); sVar8 = (short)((ulonglong)uVar12 >> 0x20); sVar9 = (short)((ulonglong)uVar12 >> 0x30); *(ulonglong *)((int)param_1 + param_4) = CONCAT17((0 < sVar9) * (sVar9 < 0x100) * (char)((ulonglong)uVar12 >> 0x30) - (0xff < sVar9) ,CONCAT16((0 < sVar8) * (sVar8 < 0x100) * (char)((ulonglong)uVar12 >> 0x20) - (0xff < sVar8), CONCAT15((0 < sVar7) * (sVar7 < 0x100) * (char)((ulonglong)uVar12 >> 0x10) - (0xff < sVar7), CONCAT14((0 < sVar6) * (sVar6 < 0x100) * (char)uVar12 - (0xff < sVar6), CONCAT13((0 < sVar5) * (sVar5 < 0x100) * (char)((ulonglong)uVar13 >> 0x30) - (0xff < sVar5), CONCAT12((0 < sVar4) * (sVar4 < 0x100) * (char)((ulonglong)uVar13 >> 0x20) - (0xff < sVar4), CONCAT11((0 < sVar3) * (sVar3 < 0x100) * (char)((ulonglong)uVar13 >> 0x10) - (0xff < sVar3), (0 < sVar2) * (sVar2 < 0x100) * (char)uVar13 - (0xff < sVar2)))))))); param_5 = param_5 + 4; param_1 = (undefined8 *)((int)param_1 + param_4 * 2); } while (0 < iVar10); return; } //@@ 00ae46e0 FUN_00ae46e0 void FUN_00ae46e0(undefined8 *param_1,undefined8 *param_2,int param_3,undefined8 *param_4) { undefined8 uVar1; short sVar2; short sVar3; short sVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; short sVar11; short sVar12; short sVar13; short sVar14; short sVar15; short sVar16; short sVar17; int iVar18; undefined8 uVar19; undefined8 uVar20; undefined8 uVar21; undefined8 uVar22; iVar18 = 4; do { iVar18 = iVar18 + -1; uVar19 = *param_2; uVar1 = *(undefined8 *)((int)param_2 + param_3); uVar21 = paddsw((ulonglong) CONCAT16((char)((ulonglong)uVar19 >> 0x38), (uint6)CONCAT14((char)((ulonglong)uVar19 >> 0x30), (uint)CONCAT12((char)((ulonglong)uVar19 >> 0x28), (ushort)(byte)((ulonglong)uVar19 >> 0x20 )))),param_4[1]); uVar20 = paddsw((ulonglong) CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)(( ulonglong)uVar19 >> 0x18) << 0x30) >> 0x28), (char)((ulonglong)uVar19 >> 0x10)) << 0x20) >> 0x18), CONCAT12((char)((ulonglong)uVar19 >> 8),(short)uVar19)) >> 0x10),(short)uVar19) & 0xffff00ff00ff00ff,*param_4); sVar2 = (short)uVar20; sVar4 = (short)((ulonglong)uVar20 >> 0x10); sVar6 = (short)((ulonglong)uVar20 >> 0x20); sVar8 = (short)((ulonglong)uVar20 >> 0x30); sVar10 = (short)uVar21; sVar12 = (short)((ulonglong)uVar21 >> 0x10); sVar14 = (short)((ulonglong)uVar21 >> 0x20); sVar16 = (short)((ulonglong)uVar21 >> 0x30); uVar22 = paddsw((ulonglong) CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)(( ulonglong)uVar1 >> 0x18) << 0x30) >> 0x28), (char)((ulonglong)uVar1 >> 0x10)) << 0x20) >> 0x18 ),CONCAT12((char)((ulonglong)uVar1 >> 8), (short)uVar1)) >> 0x10),(short)uVar1) & 0xffff00ff00ff00ff,param_4[2]); uVar19 = paddsw((ulonglong) CONCAT16((char)((ulonglong)uVar1 >> 0x38), (uint6)CONCAT14((char)((ulonglong)uVar1 >> 0x30), (uint)CONCAT12((char)((ulonglong)uVar1 >> 0x28), (ushort)(byte)((ulonglong)uVar1 >> 0x20) ))),param_4[3]); param_4 = param_4 + 4; sVar3 = (short)uVar22; sVar5 = (short)((ulonglong)uVar22 >> 0x10); sVar7 = (short)((ulonglong)uVar22 >> 0x20); sVar9 = (short)((ulonglong)uVar22 >> 0x30); sVar11 = (short)uVar19; sVar13 = (short)((ulonglong)uVar19 >> 0x10); sVar15 = (short)((ulonglong)uVar19 >> 0x20); sVar17 = (short)((ulonglong)uVar19 >> 0x30); param_2 = (undefined8 *)((int)param_2 + param_3 * 2); *param_1 = CONCAT17((0 < sVar16) * (sVar16 < 0x100) * (char)((ulonglong)uVar21 >> 0x30) - (0xff < sVar16), CONCAT16((0 < sVar14) * (sVar14 < 0x100) * (char)((ulonglong)uVar21 >> 0x20) - (0xff < sVar14), CONCAT15((0 < sVar12) * (sVar12 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar12), CONCAT14((0 < sVar10) * (sVar10 < 0x100) * (char)uVar21 - (0xff < sVar10), CONCAT13((0 < sVar8) * (sVar8 < 0x100) * (char)((ulonglong)uVar20 >> 0x30) - (0xff < sVar8), CONCAT12((0 < sVar6) * (sVar6 < 0x100) * (char)((ulonglong)uVar20 >> 0x20) - (0xff < sVar6), CONCAT11((0 < sVar4) * (sVar4 < 0x100) * (char)((ulonglong) uVar20 >> 0x10) - (0xff < sVar4), (0 < sVar2) * (sVar2 < 0x100) * (char)uVar20 - (0xff < sVar2)))))))); *(ulonglong *)((int)param_1 + param_3) = CONCAT17((0 < sVar17) * (sVar17 < 0x100) * (char)((ulonglong)uVar19 >> 0x30) - (0xff < sVar17), CONCAT16((0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar19 >> 0x20) - (0xff < sVar15), CONCAT15((0 < sVar13) * (sVar13 < 0x100) * (char)((ulonglong)uVar19 >> 0x10) - (0xff < sVar13), CONCAT14((0 < sVar11) * (sVar11 < 0x100) * (char)uVar19 - (0xff < sVar11), CONCAT13((0 < sVar9) * (sVar9 < 0x100) * (char)((ulonglong)uVar22 >> 0x30) - (0xff < sVar9), CONCAT12((0 < sVar7) * (sVar7 < 0x100) * (char)((ulonglong)uVar22 >> 0x20) - (0xff < sVar7), CONCAT11((0 < sVar5) * (sVar5 < 0x100) * (char)((ulonglong)uVar22 >> 0x10) - (0xff < sVar5) ,(0 < sVar3) * (sVar3 < 0x100) * (char)uVar22 - (0xff < sVar3)))))))); param_1 = (undefined8 *)((int)param_1 + param_3 * 2); } while (0 < iVar18); return; } //@@ 00ae4750 FUN_00ae4750 void FUN_00ae4750(undefined8 *param_1,int param_2,undefined8 *param_3) { undefined8 *puVar1; short sVar2; short sVar3; short sVar4; short sVar5; short sVar6; short sVar7; short sVar8; short sVar9; short sVar10; short sVar11; short sVar12; short sVar13; short sVar14; short sVar15; short sVar16; short sVar17; short sVar18; short sVar19; short sVar20; short sVar21; short sVar22; short sVar23; short sVar24; short sVar25; undefined8 uVar26; undefined8 uVar27; undefined8 uVar28; undefined8 uVar29; undefined8 uVar30; undefined8 uVar31; undefined8 uVar32; puVar1 = (undefined8 *)((int)param_1 + param_2 * 4); uVar26 = psllw(0xffffffffffffffff,0xf); uVar26 = CONCAT26((ushort)((ulonglong)uVar26 >> 0x38), CONCAT24((ushort)((ulonglong)uVar26 >> 0x20) >> 8, CONCAT22((ushort)((ulonglong)uVar26 >> 0x10) >> 8,(ushort)uVar26 >> 8)) ); uVar27 = paddsw(*param_3,uVar26); uVar28 = paddsw(param_3[1],uVar26); sVar2 = (short)uVar27; sVar5 = (short)((ulonglong)uVar27 >> 0x10); sVar8 = (short)((ulonglong)uVar27 >> 0x20); sVar11 = (short)((ulonglong)uVar27 >> 0x30); sVar14 = (short)uVar28; sVar17 = (short)((ulonglong)uVar28 >> 0x10); sVar20 = (short)((ulonglong)uVar28 >> 0x20); sVar23 = (short)((ulonglong)uVar28 >> 0x30); uVar29 = paddsw(param_3[2],uVar26); uVar30 = paddsw(param_3[3],uVar26); sVar3 = (short)uVar29; sVar6 = (short)((ulonglong)uVar29 >> 0x10); sVar9 = (short)((ulonglong)uVar29 >> 0x20); sVar12 = (short)((ulonglong)uVar29 >> 0x30); sVar15 = (short)uVar30; sVar18 = (short)((ulonglong)uVar30 >> 0x10); sVar21 = (short)((ulonglong)uVar30 >> 0x20); sVar24 = (short)((ulonglong)uVar30 >> 0x30); uVar31 = paddsw(param_3[4],uVar26); uVar32 = paddsw(param_3[5],uVar26); sVar4 = (short)uVar31; sVar7 = (short)((ulonglong)uVar31 >> 0x10); sVar10 = (short)((ulonglong)uVar31 >> 0x20); sVar13 = (short)((ulonglong)uVar31 >> 0x30); sVar16 = (short)uVar32; sVar19 = (short)((ulonglong)uVar32 >> 0x10); sVar22 = (short)((ulonglong)uVar32 >> 0x20); sVar25 = (short)((ulonglong)uVar32 >> 0x30); *param_1 = CONCAT17((0 < sVar23) * (sVar23 < 0x100) * (char)((ulonglong)uVar28 >> 0x30) - (0xff < sVar23), CONCAT16((0 < sVar20) * (sVar20 < 0x100) * (char)((ulonglong)uVar28 >> 0x20) - (0xff < sVar20), CONCAT15((0 < sVar17) * (sVar17 < 0x100) * (char)((ulonglong)uVar28 >> 0x10) - (0xff < sVar17), CONCAT14((0 < sVar14) * (sVar14 < 0x100) * (char)uVar28 - (0xff < sVar14), CONCAT13((0 < sVar11) * (sVar11 < 0x100) * (char)((ulonglong)uVar27 >> 0x30) - (0xff < sVar11), CONCAT12((0 < sVar8) * (sVar8 < 0x100) * (char)((ulonglong)uVar27 >> 0x20) - (0xff < sVar8), CONCAT11((0 < sVar5) * (sVar5 < 0x100) * (char)((ulonglong)uVar27 >> 0x10) - (0xff < sVar5), (0 < sVar2) * (sVar2 < 0x100) * (char)uVar27 - (0xff < sVar2)))))))); *(ulonglong *)((int)param_1 + param_2) = CONCAT17((0 < sVar24) * (sVar24 < 0x100) * (char)((ulonglong)uVar30 >> 0x30) - (0xff < sVar24), CONCAT16((0 < sVar21) * (sVar21 < 0x100) * (char)((ulonglong)uVar30 >> 0x20) - (0xff < sVar21), CONCAT15((0 < sVar18) * (sVar18 < 0x100) * (char)((ulonglong)uVar30 >> 0x10) - (0xff < sVar18), CONCAT14((0 < sVar15) * (sVar15 < 0x100) * (char)uVar30 - (0xff < sVar15), CONCAT13((0 < sVar12) * (sVar12 < 0x100) * (char)((ulonglong)uVar29 >> 0x30) - (0xff < sVar12), CONCAT12((0 < sVar9) * (sVar9 < 0x100) * (char)((ulonglong)uVar29 >> 0x20) - (0xff < sVar9), CONCAT11((0 < sVar6) * (sVar6 < 0x100) * (char)((ulonglong)uVar29 >> 0x10) - (0xff < sVar6) ,(0 < sVar3) * (sVar3 < 0x100) * (char)uVar29 - (0xff < sVar3)))))))); *(ulonglong *)((int)param_1 + param_2 * 2) = CONCAT17((0 < sVar25) * (sVar25 < 0x100) * (char)((ulonglong)uVar32 >> 0x30) - (0xff < sVar25), CONCAT16((0 < sVar22) * (sVar22 < 0x100) * (char)((ulonglong)uVar32 >> 0x20) - (0xff < sVar22), CONCAT15((0 < sVar19) * (sVar19 < 0x100) * (char)((ulonglong)uVar32 >> 0x10) - (0xff < sVar19), CONCAT14((0 < sVar16) * (sVar16 < 0x100) * (char)uVar32 - (0xff < sVar16), CONCAT13((0 < sVar13) * (sVar13 < 0x100) * (char)((ulonglong)uVar31 >> 0x30) - (0xff < sVar13), CONCAT12((0 < sVar10) * (sVar10 < 0x100) * (char)((ulonglong)uVar31 >> 0x20) - (0xff < sVar10), CONCAT11((0 < sVar7) * (sVar7 < 0x100) * (char)((ulonglong)uVar31 >> 0x10) - (0xff < sVar7) ,(0 < sVar4) * (sVar4 < 0x100) * (char)uVar31 - (0xff < sVar4)))))))); uVar27 = paddsw(param_3[6],uVar26); uVar28 = paddsw(param_3[7],uVar26); sVar2 = (short)uVar27; sVar5 = (short)((ulonglong)uVar27 >> 0x10); sVar8 = (short)((ulonglong)uVar27 >> 0x20); sVar11 = (short)((ulonglong)uVar27 >> 0x30); sVar14 = (short)uVar28; sVar17 = (short)((ulonglong)uVar28 >> 0x10); sVar20 = (short)((ulonglong)uVar28 >> 0x20); sVar23 = (short)((ulonglong)uVar28 >> 0x30); uVar29 = paddsw(param_3[8],uVar26); uVar30 = paddsw(param_3[9],uVar26); sVar3 = (short)uVar29; sVar6 = (short)((ulonglong)uVar29 >> 0x10); sVar9 = (short)((ulonglong)uVar29 >> 0x20); sVar12 = (short)((ulonglong)uVar29 >> 0x30); sVar15 = (short)uVar30; sVar18 = (short)((ulonglong)uVar30 >> 0x10); sVar21 = (short)((ulonglong)uVar30 >> 0x20); sVar24 = (short)((ulonglong)uVar30 >> 0x30); uVar31 = paddsw(param_3[10],uVar26); uVar32 = paddsw(param_3[0xb],uVar26); sVar4 = (short)uVar31; sVar7 = (short)((ulonglong)uVar31 >> 0x10); sVar10 = (short)((ulonglong)uVar31 >> 0x20); sVar13 = (short)((ulonglong)uVar31 >> 0x30); sVar16 = (short)uVar32; sVar19 = (short)((ulonglong)uVar32 >> 0x10); sVar22 = (short)((ulonglong)uVar32 >> 0x20); sVar25 = (short)((ulonglong)uVar32 >> 0x30); *(ulonglong *)((int)param_1 + param_2 * 3) = CONCAT17((0 < sVar23) * (sVar23 < 0x100) * (char)((ulonglong)uVar28 >> 0x30) - (0xff < sVar23), CONCAT16((0 < sVar20) * (sVar20 < 0x100) * (char)((ulonglong)uVar28 >> 0x20) - (0xff < sVar20), CONCAT15((0 < sVar17) * (sVar17 < 0x100) * (char)((ulonglong)uVar28 >> 0x10) - (0xff < sVar17), CONCAT14((0 < sVar14) * (sVar14 < 0x100) * (char)uVar28 - (0xff < sVar14), CONCAT13((0 < sVar11) * (sVar11 < 0x100) * (char)((ulonglong)uVar27 >> 0x30) - (0xff < sVar11), CONCAT12((0 < sVar8) * (sVar8 < 0x100) * (char)((ulonglong)uVar27 >> 0x20) - (0xff < sVar8), CONCAT11((0 < sVar5) * (sVar5 < 0x100) * (char)((ulonglong)uVar27 >> 0x10) - (0xff < sVar5) ,(0 < sVar2) * (sVar2 < 0x100) * (char)uVar27 - (0xff < sVar2)))))))); *puVar1 = CONCAT17((0 < sVar24) * (sVar24 < 0x100) * (char)((ulonglong)uVar30 >> 0x30) - (0xff < sVar24), CONCAT16((0 < sVar21) * (sVar21 < 0x100) * (char)((ulonglong)uVar30 >> 0x20) - (0xff < sVar21), CONCAT15((0 < sVar18) * (sVar18 < 0x100) * (char)((ulonglong)uVar30 >> 0x10) - (0xff < sVar18), CONCAT14((0 < sVar15) * (sVar15 < 0x100) * (char)uVar30 - (0xff < sVar15), CONCAT13((0 < sVar12) * (sVar12 < 0x100) * (char)((ulonglong)uVar29 >> 0x30) - (0xff < sVar12), CONCAT12((0 < sVar9) * (sVar9 < 0x100) * (char)((ulonglong)uVar29 >> 0x20) - (0xff < sVar9), CONCAT11((0 < sVar6) * (sVar6 < 0x100) * (char)((ulonglong)uVar29 >> 0x10) - (0xff < sVar6), (0 < sVar3) * (sVar3 < 0x100) * (char)uVar29 - (0xff < sVar3)))))))); *(ulonglong *)((int)puVar1 + param_2) = CONCAT17((0 < sVar25) * (sVar25 < 0x100) * (char)((ulonglong)uVar32 >> 0x30) - (0xff < sVar25), CONCAT16((0 < sVar22) * (sVar22 < 0x100) * (char)((ulonglong)uVar32 >> 0x20) - (0xff < sVar22), CONCAT15((0 < sVar19) * (sVar19 < 0x100) * (char)((ulonglong)uVar32 >> 0x10) - (0xff < sVar19), CONCAT14((0 < sVar16) * (sVar16 < 0x100) * (char)uVar32 - (0xff < sVar16), CONCAT13((0 < sVar13) * (sVar13 < 0x100) * (char)((ulonglong)uVar31 >> 0x30) - (0xff < sVar13), CONCAT12((0 < sVar10) * (sVar10 < 0x100) * (char)((ulonglong)uVar31 >> 0x20) - (0xff < sVar10), CONCAT11((0 < sVar7) * (sVar7 < 0x100) * (char)((ulonglong)uVar31 >> 0x10) - (0xff < sVar7) ,(0 < sVar4) * (sVar4 < 0x100) * (char)uVar31 - (0xff < sVar4)))))))); uVar27 = paddsw(param_3[0xc],uVar26); uVar28 = paddsw(param_3[0xd],uVar26); sVar2 = (short)uVar27; sVar4 = (short)((ulonglong)uVar27 >> 0x10); sVar6 = (short)((ulonglong)uVar27 >> 0x20); sVar8 = (short)((ulonglong)uVar27 >> 0x30); sVar10 = (short)uVar28; sVar12 = (short)((ulonglong)uVar28 >> 0x10); sVar14 = (short)((ulonglong)uVar28 >> 0x20); sVar16 = (short)((ulonglong)uVar28 >> 0x30); uVar29 = paddsw(param_3[0xe],uVar26); uVar26 = paddsw(param_3[0xf],uVar26); sVar3 = (short)uVar29; sVar5 = (short)((ulonglong)uVar29 >> 0x10); sVar7 = (short)((ulonglong)uVar29 >> 0x20); sVar9 = (short)((ulonglong)uVar29 >> 0x30); sVar11 = (short)uVar26; sVar13 = (short)((ulonglong)uVar26 >> 0x10); sVar15 = (short)((ulonglong)uVar26 >> 0x20); sVar17 = (short)((ulonglong)uVar26 >> 0x30); *(ulonglong *)((int)puVar1 + param_2 * 2) = CONCAT17((0 < sVar16) * (sVar16 < 0x100) * (char)((ulonglong)uVar28 >> 0x30) - (0xff < sVar16), CONCAT16((0 < sVar14) * (sVar14 < 0x100) * (char)((ulonglong)uVar28 >> 0x20) - (0xff < sVar14), CONCAT15((0 < sVar12) * (sVar12 < 0x100) * (char)((ulonglong)uVar28 >> 0x10) - (0xff < sVar12), CONCAT14((0 < sVar10) * (sVar10 < 0x100) * (char)uVar28 - (0xff < sVar10), CONCAT13((0 < sVar8) * (sVar8 < 0x100) * (char)((ulonglong)uVar27 >> 0x30) - (0xff < sVar8), CONCAT12((0 < sVar6) * (sVar6 < 0x100) * (char)((ulonglong)uVar27 >> 0x20) - (0xff < sVar6), CONCAT11((0 < sVar4) * (sVar4 < 0x100) * (char)((ulonglong)uVar27 >> 0x10) - (0xff < sVar4) ,(0 < sVar2) * (sVar2 < 0x100) * (char)uVar27 - (0xff < sVar2)))))))); *(ulonglong *)((int)puVar1 + param_2 * 3) = CONCAT17((0 < sVar17) * (sVar17 < 0x100) * (char)((ulonglong)uVar26 >> 0x30) - (0xff < sVar17), CONCAT16((0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar26 >> 0x20) - (0xff < sVar15), CONCAT15((0 < sVar13) * (sVar13 < 0x100) * (char)((ulonglong)uVar26 >> 0x10) - (0xff < sVar13), CONCAT14((0 < sVar11) * (sVar11 < 0x100) * (char)uVar26 - (0xff < sVar11), CONCAT13((0 < sVar9) * (sVar9 < 0x100) * (char)((ulonglong)uVar29 >> 0x30) - (0xff < sVar9), CONCAT12((0 < sVar7) * (sVar7 < 0x100) * (char)((ulonglong)uVar29 >> 0x20) - (0xff < sVar7), CONCAT11((0 < sVar5) * (sVar5 < 0x100) * (char)((ulonglong)uVar29 >> 0x10) - (0xff < sVar5) ,(0 < sVar3) * (sVar3 < 0x100) * (char)uVar29 - (0xff < sVar3)))))))); return; } //@@ 00ae4830 oc_idct8x8_mmx /* DB: libtheora x86/mmxidct.c: stored in the state accel vtable ([ecx+0x54] in oc_state_accel_init_x86 at ae3185), (y,x,last_zzi): last_zzi < 11 runs the inlined oc_idct8x8_10_mmx path (pmulhw OC_C3S5 0xd4db, OC_C5S3 0x8e3a, OC_C1S7 0xfb15, OC_C7S1 0x31f1, OC_C2S6 0xec83), else calls 00ae4bf0 oc_idct8x8_mmx oc_idct8x8_slow_mmx, currently misnamed oc_idct8x8_mmx); also called by FUN_00ae5260 */ void oc_idct8x8_mmx(undefined8 *param_1,undefined8 *param_2,int param_3) { short sVar1; short sVar4; undefined4 uVar2; short sVar5; undefined8 uVar3; short sVar6; undefined4 uVar7; undefined8 uVar8; undefined8 uVar9; short sVar10; short sVar11; short sVar12; short sVar13; short sVar14; short sVar15; short sVar16; short sVar17; short sVar18; short sVar20; short sVar21; short sVar22; short sVar23; undefined8 uVar19; short sVar24; short sVar25; short sVar26; short sVar27; short sVar28; short sVar29; short sVar30; short sVar31; short sVar32; short sVar33; short sVar34; short sVar35; short sVar36; short sVar37; short sVar38; short sVar39; short sVar40; if (param_3 < 0xb) { uVar3 = param_2[6]; uVar19 = pmulhw(uVar3,0xd4dbd4dbd4dbd4db); uVar9 = param_2[2]; uVar8 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar3); sVar18 = (short)uVar19 + (short)uVar3; sVar11 = (short)((ulonglong)uVar3 >> 0x10); sVar20 = (short)((ulonglong)uVar19 >> 0x10) + sVar11; sVar12 = (short)((ulonglong)uVar3 >> 0x20); sVar22 = (short)((ulonglong)uVar19 >> 0x20) + sVar12; sVar13 = (short)((ulonglong)uVar3 >> 0x30); sVar24 = (short)((ulonglong)uVar19 >> 0x30) + sVar13; sVar10 = (short)uVar3 + (short)uVar8; sVar11 = sVar11 + (short)((ulonglong)uVar8 >> 0x10); sVar12 = sVar12 + (short)((ulonglong)uVar8 >> 0x20); sVar13 = sVar13 + (short)((ulonglong)uVar8 >> 0x30); uVar3 = pmulhw(0xfb15fb15fb15fb15,uVar9); uVar8 = pmulhw(uVar9,0x31f131f131f131f1); uVar19 = pmulhw(param_2[4],0xec83ec83ec83ec83); sVar1 = ((short)uVar3 + (short)uVar9) - sVar18; sVar4 = ((short)((ulonglong)uVar3 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10)) - sVar20; sVar5 = ((short)((ulonglong)uVar3 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20)) - sVar22; sVar6 = ((short)((ulonglong)uVar3 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30)) - sVar24; uVar3 = param_2[4]; sVar37 = (short)uVar3 + (short)uVar19; sVar38 = (short)((ulonglong)uVar3 >> 0x10) + (short)((ulonglong)uVar19 >> 0x10); sVar39 = (short)((ulonglong)uVar3 >> 0x20) + (short)((ulonglong)uVar19 >> 0x20); sVar40 = (short)((ulonglong)uVar3 >> 0x30) + (short)((ulonglong)uVar19 >> 0x30); uVar9 = pmulhw(param_2[4],0x61f861f861f861f8); sVar14 = (short)uVar8 + sVar10; sVar15 = (short)((ulonglong)uVar8 >> 0x10) + sVar11; sVar16 = (short)((ulonglong)uVar8 >> 0x20) + sVar12; sVar17 = (short)((ulonglong)uVar8 >> 0x30) + sVar13; param_1[2] = CONCAT26(sVar24 * 2 + sVar6, CONCAT24(sVar22 * 2 + sVar5, CONCAT22(sVar20 * 2 + sVar4,sVar18 * 2 + sVar1))); uVar8 = pmulhw(CONCAT26(sVar17,CONCAT24(sVar16,CONCAT22(sVar15,sVar14))),0xb505b505b505b505); param_1[4] = CONCAT26(sVar13 * -2 + sVar17, CONCAT24(sVar12 * -2 + sVar16, CONCAT22(sVar11 * -2 + sVar15,sVar10 * -2 + sVar14))); uVar3 = pmulhw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),0xb505b505b505b505); sVar1 = sVar1 + (short)uVar3; sVar4 = sVar4 + (short)((ulonglong)uVar3 >> 0x10); sVar5 = sVar5 + (short)((ulonglong)uVar3 >> 0x20); sVar6 = sVar6 + (short)((ulonglong)uVar3 >> 0x30); sVar26 = (sVar14 + (short)uVar8) - (short)uVar9; sVar11 = (short)((ulonglong)uVar9 >> 0x10); sVar27 = (sVar15 + (short)((ulonglong)uVar8 >> 0x10)) - sVar11; sVar12 = (short)((ulonglong)uVar9 >> 0x20); sVar28 = (sVar16 + (short)((ulonglong)uVar8 >> 0x20)) - sVar12; sVar13 = (short)((ulonglong)uVar9 >> 0x30); sVar29 = (sVar17 + (short)((ulonglong)uVar8 >> 0x30)) - sVar13; uVar8 = pmulhw(*param_2,0xb505b505b505b505); uVar3 = *param_2; sVar22 = (short)uVar8 + (short)uVar3; sVar31 = (short)((ulonglong)uVar8 >> 0x10) + (short)((ulonglong)uVar3 >> 0x10); sVar33 = (short)((ulonglong)uVar8 >> 0x20) + (short)((ulonglong)uVar3 >> 0x20); sVar35 = (short)((ulonglong)uVar8 >> 0x30) + (short)((ulonglong)uVar3 >> 0x30); sVar10 = (short)uVar9 * 2 + sVar26; sVar11 = sVar11 * 2 + sVar27; sVar12 = sVar12 * 2 + sVar28; sVar13 = sVar13 * 2 + sVar29; sVar30 = sVar22 - sVar1; sVar32 = sVar31 - sVar4; sVar34 = sVar33 - sVar5; sVar36 = sVar35 - sVar6; uVar3 = param_1[2]; sVar14 = (sVar1 * 2 + sVar30) - sVar10; sVar15 = (sVar4 * 2 + sVar32) - sVar11; sVar16 = (sVar5 * 2 + sVar34) - sVar12; sVar6 = (sVar6 * 2 + sVar36) - sVar13; uVar9 = param_1[4]; sVar22 = sVar22 - sVar37; sVar31 = sVar31 - sVar38; sVar33 = sVar33 - sVar39; sVar35 = sVar35 - sVar40; sVar24 = sVar22 - (short)uVar9; sVar17 = (short)((ulonglong)uVar9 >> 0x10); sVar21 = sVar31 - sVar17; sVar18 = (short)((ulonglong)uVar9 >> 0x20); sVar23 = sVar33 - sVar18; sVar20 = (short)((ulonglong)uVar9 >> 0x30); sVar25 = sVar35 - sVar20; sVar30 = sVar30 - sVar26; sVar32 = sVar32 - sVar27; sVar34 = sVar34 - sVar28; sVar36 = sVar36 - sVar29; sVar22 = (sVar37 * 2 + sVar22) - (short)uVar3; sVar1 = (short)((ulonglong)uVar3 >> 0x10); sVar31 = (sVar38 * 2 + sVar31) - sVar1; sVar4 = (short)((ulonglong)uVar3 >> 0x20); sVar33 = (sVar39 * 2 + sVar33) - sVar4; sVar5 = (short)((ulonglong)uVar3 >> 0x30); sVar35 = (sVar40 * 2 + sVar35) - sVar5; param_1[2] = CONCAT26(sVar13 * 2 + sVar6, CONCAT24(sVar12 * 2 + sVar16, CONCAT22(sVar11 * 2 + sVar15,sVar10 * 2 + sVar14))); *param_1 = CONCAT26(sVar5 * 2 + sVar35, CONCAT24(sVar4 * 2 + sVar33, CONCAT22(sVar1 * 2 + sVar31,(short)uVar3 * 2 + sVar22))); uVar7 = CONCAT22(sVar28 * 2 + sVar34,sVar23); param_1[1] = CONCAT44(CONCAT22(sVar22,sVar30),CONCAT22(sVar26 * 2 + sVar30,sVar24)); uVar2 = CONCAT22(sVar33,sVar34); param_1[3] = CONCAT44(CONCAT22(sVar31,sVar32),CONCAT22(sVar27 * 2 + sVar32,sVar21)); uVar3 = *param_1; uVar8 = param_1[2]; param_1[7] = CONCAT44((int)(CONCAT26(sVar35,CONCAT24(sVar36,uVar2)) >> 0x20), (int)(CONCAT26(sVar29 * 2 + sVar36,CONCAT24(sVar25,uVar7)) >> 0x20)); param_1[5] = CONCAT44(uVar2,uVar7); uVar2 = CONCAT22((short)((ulonglong)uVar8 >> 0x20),(short)((ulonglong)uVar3 >> 0x20)); *param_1 = CONCAT44(CONCAT22((short)uVar9 * 2 + sVar24,sVar14), CONCAT22((short)uVar8,(short)uVar3)); uVar7 = CONCAT22(sVar18 * 2 + sVar23,sVar16); param_1[2] = CONCAT44(CONCAT22(sVar17 * 2 + sVar21,sVar15), CONCAT22((short)((ulonglong)uVar8 >> 0x10), (short)((ulonglong)uVar3 >> 0x10))); param_1[6] = CONCAT44((int)(CONCAT26(sVar20 * 2 + sVar25,CONCAT24(sVar6,uVar7)) >> 0x20), (int)(CONCAT26((short)((ulonglong)uVar8 >> 0x30), CONCAT24((short)((ulonglong)uVar3 >> 0x30),uVar2)) >> 0x20) ); param_1[4] = CONCAT44(uVar7,uVar2); uVar3 = param_1[6]; uVar19 = pmulhw(uVar3,0xd4dbd4dbd4dbd4db); uVar9 = param_1[2]; uVar8 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar3); sVar18 = (short)uVar19 + (short)uVar3; sVar11 = (short)((ulonglong)uVar3 >> 0x10); sVar20 = (short)((ulonglong)uVar19 >> 0x10) + sVar11; sVar12 = (short)((ulonglong)uVar3 >> 0x20); sVar22 = (short)((ulonglong)uVar19 >> 0x20) + sVar12; sVar13 = (short)((ulonglong)uVar3 >> 0x30); sVar24 = (short)((ulonglong)uVar19 >> 0x30) + sVar13; sVar10 = (short)uVar3 + (short)uVar8; sVar11 = sVar11 + (short)((ulonglong)uVar8 >> 0x10); sVar12 = sVar12 + (short)((ulonglong)uVar8 >> 0x20); sVar13 = sVar13 + (short)((ulonglong)uVar8 >> 0x30); uVar3 = pmulhw(0xfb15fb15fb15fb15,uVar9); uVar8 = pmulhw(uVar9,0x31f131f131f131f1); uVar19 = pmulhw(param_1[4],0xec83ec83ec83ec83); sVar1 = ((short)uVar3 + (short)uVar9) - sVar18; sVar4 = ((short)((ulonglong)uVar3 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10)) - sVar20; sVar5 = ((short)((ulonglong)uVar3 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20)) - sVar22; sVar6 = ((short)((ulonglong)uVar3 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30)) - sVar24; uVar3 = param_1[4]; sVar35 = (short)uVar3 + (short)uVar19; sVar25 = (short)((ulonglong)uVar3 >> 0x10) + (short)((ulonglong)uVar19 >> 0x10); sVar26 = (short)((ulonglong)uVar3 >> 0x20) + (short)((ulonglong)uVar19 >> 0x20); sVar27 = (short)((ulonglong)uVar3 >> 0x30) + (short)((ulonglong)uVar19 >> 0x30); uVar9 = pmulhw(param_1[4],0x61f861f861f861f8); sVar14 = (short)uVar8 + sVar10; sVar15 = (short)((ulonglong)uVar8 >> 0x10) + sVar11; sVar16 = (short)((ulonglong)uVar8 >> 0x20) + sVar12; sVar17 = (short)((ulonglong)uVar8 >> 0x30) + sVar13; param_1[2] = CONCAT26(sVar24 * 2 + sVar6, CONCAT24(sVar22 * 2 + sVar5, CONCAT22(sVar20 * 2 + sVar4,sVar18 * 2 + sVar1))); uVar8 = pmulhw(CONCAT26(sVar17,CONCAT24(sVar16,CONCAT22(sVar15,sVar14))),0xb505b505b505b505); param_1[4] = CONCAT26(sVar13 * -2 + sVar17, CONCAT24(sVar12 * -2 + sVar16, CONCAT22(sVar11 * -2 + sVar15,sVar10 * -2 + sVar14))); uVar3 = pmulhw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),0xb505b505b505b505); sVar1 = sVar1 + (short)uVar3; sVar4 = sVar4 + (short)((ulonglong)uVar3 >> 0x10); sVar5 = sVar5 + (short)((ulonglong)uVar3 >> 0x20); sVar6 = sVar6 + (short)((ulonglong)uVar3 >> 0x30); sVar18 = (sVar14 + (short)uVar8) - (short)uVar9; sVar11 = (short)((ulonglong)uVar9 >> 0x10); sVar20 = (sVar15 + (short)((ulonglong)uVar8 >> 0x10)) - sVar11; sVar12 = (short)((ulonglong)uVar9 >> 0x20); sVar22 = (sVar16 + (short)((ulonglong)uVar8 >> 0x20)) - sVar12; sVar13 = (short)((ulonglong)uVar9 >> 0x30); sVar24 = (sVar17 + (short)((ulonglong)uVar8 >> 0x30)) - sVar13; uVar8 = pmulhw(*param_1,0xb505b505b505b505); uVar3 = *param_1; sVar14 = (short)uVar8 + (short)uVar3; sVar15 = (short)((ulonglong)uVar8 >> 0x10) + (short)((ulonglong)uVar3 >> 0x10); sVar16 = (short)((ulonglong)uVar8 >> 0x20) + (short)((ulonglong)uVar3 >> 0x20); sVar17 = (short)((ulonglong)uVar8 >> 0x30) + (short)((ulonglong)uVar3 >> 0x30); sVar10 = (short)uVar9 * 2 + sVar18; sVar11 = sVar11 * 2 + sVar20; sVar12 = sVar12 * 2 + sVar22; sVar13 = sVar13 * 2 + sVar24; sVar31 = sVar14 - sVar1; sVar21 = sVar15 - sVar4; sVar33 = sVar16 - sVar5; sVar23 = sVar17 - sVar6; uVar3 = param_1[2]; sVar1 = ((sVar1 * 2 + sVar31) - sVar10) + 8; sVar4 = ((sVar4 * 2 + sVar21) - sVar11) + 8; sVar5 = ((sVar5 * 2 + sVar33) - sVar12) + 8; sVar6 = ((sVar6 * 2 + sVar23) - sVar13) + 8; uVar19 = psraw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),4); sVar14 = sVar14 - sVar35; sVar15 = sVar15 - sVar25; sVar16 = sVar16 - sVar26; sVar17 = sVar17 - sVar27; uVar8 = psraw(CONCAT26(sVar13 * 2 + sVar6, CONCAT24(sVar12 * 2 + sVar5, CONCAT22(sVar11 * 2 + sVar4,sVar10 * 2 + sVar1))),4); uVar9 = param_1[4]; param_1[4] = uVar19; param_1[2] = uVar8; sVar1 = (short)((ulonglong)uVar9 >> 0x10); sVar4 = (short)((ulonglong)uVar9 >> 0x20); sVar5 = (short)((ulonglong)uVar9 >> 0x30); sVar6 = (sVar14 - (short)uVar9) + 8; sVar10 = (sVar15 - sVar1) + 8; sVar11 = (sVar16 - sVar4) + 8; sVar12 = (sVar17 - sVar5) + 8; uVar8 = psraw(CONCAT26(sVar12,CONCAT24(sVar11,CONCAT22(sVar10,sVar6))),4); uVar9 = psraw(CONCAT26(sVar5 * 2 + sVar12, CONCAT24(sVar4 * 2 + sVar11, CONCAT22(sVar1 * 2 + sVar10,(short)uVar9 * 2 + sVar6))),4); sVar1 = (sVar31 - sVar18) + 8; sVar4 = (sVar21 - sVar20) + 8; sVar5 = (sVar33 - sVar22) + 8; sVar6 = (sVar23 - sVar24) + 8; uVar19 = psraw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),4); param_1[8] = uVar8; uVar8 = psraw(CONCAT26(sVar24 * 2 + sVar6, CONCAT24(sVar22 * 2 + sVar5, CONCAT22(sVar20 * 2 + sVar4,sVar18 * 2 + sVar1))),4); param_1[6] = uVar9; sVar1 = (short)((ulonglong)uVar3 >> 0x10); sVar4 = (short)((ulonglong)uVar3 >> 0x20); sVar5 = (short)((ulonglong)uVar3 >> 0x30); sVar6 = ((sVar35 * 2 + sVar14) - (short)uVar3) + 8; sVar10 = ((sVar25 * 2 + sVar15) - sVar1) + 8; sVar11 = ((sVar26 * 2 + sVar16) - sVar4) + 8; sVar12 = ((sVar27 * 2 + sVar17) - sVar5) + 8; uVar9 = psraw(CONCAT26(sVar12,CONCAT24(sVar11,CONCAT22(sVar10,sVar6))),4); param_1[0xc] = uVar19; uVar3 = psraw(CONCAT26(sVar5 * 2 + sVar12, CONCAT24(sVar4 * 2 + sVar11, CONCAT22(sVar1 * 2 + sVar10,(short)uVar3 * 2 + sVar6))),4); param_1[10] = uVar8; param_1[0xe] = uVar9; *param_1 = uVar3; uVar3 = param_1[7]; uVar19 = pmulhw(uVar3,0xd4dbd4dbd4dbd4db); uVar9 = param_1[3]; uVar8 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar3); sVar18 = (short)uVar19 + (short)uVar3; sVar11 = (short)((ulonglong)uVar3 >> 0x10); sVar20 = (short)((ulonglong)uVar19 >> 0x10) + sVar11; sVar12 = (short)((ulonglong)uVar3 >> 0x20); sVar22 = (short)((ulonglong)uVar19 >> 0x20) + sVar12; sVar13 = (short)((ulonglong)uVar3 >> 0x30); sVar24 = (short)((ulonglong)uVar19 >> 0x30) + sVar13; sVar10 = (short)uVar3 + (short)uVar8; sVar11 = sVar11 + (short)((ulonglong)uVar8 >> 0x10); sVar12 = sVar12 + (short)((ulonglong)uVar8 >> 0x20); sVar13 = sVar13 + (short)((ulonglong)uVar8 >> 0x30); uVar3 = pmulhw(0xfb15fb15fb15fb15,uVar9); uVar8 = pmulhw(uVar9,0x31f131f131f131f1); uVar19 = pmulhw(param_1[5],0xec83ec83ec83ec83); sVar1 = ((short)uVar3 + (short)uVar9) - sVar18; sVar4 = ((short)((ulonglong)uVar3 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10)) - sVar20; sVar5 = ((short)((ulonglong)uVar3 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20)) - sVar22; sVar6 = ((short)((ulonglong)uVar3 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30)) - sVar24; uVar3 = param_1[5]; sVar35 = (short)uVar3 + (short)uVar19; sVar25 = (short)((ulonglong)uVar3 >> 0x10) + (short)((ulonglong)uVar19 >> 0x10); sVar26 = (short)((ulonglong)uVar3 >> 0x20) + (short)((ulonglong)uVar19 >> 0x20); sVar27 = (short)((ulonglong)uVar3 >> 0x30) + (short)((ulonglong)uVar19 >> 0x30); uVar9 = pmulhw(param_1[5],0x61f861f861f861f8); sVar14 = (short)uVar8 + sVar10; sVar15 = (short)((ulonglong)uVar8 >> 0x10) + sVar11; sVar16 = (short)((ulonglong)uVar8 >> 0x20) + sVar12; sVar17 = (short)((ulonglong)uVar8 >> 0x30) + sVar13; param_1[3] = CONCAT26(sVar24 * 2 + sVar6, CONCAT24(sVar22 * 2 + sVar5, CONCAT22(sVar20 * 2 + sVar4,sVar18 * 2 + sVar1))); uVar8 = pmulhw(CONCAT26(sVar17,CONCAT24(sVar16,CONCAT22(sVar15,sVar14))),0xb505b505b505b505); param_1[5] = CONCAT26(sVar13 * -2 + sVar17, CONCAT24(sVar12 * -2 + sVar16, CONCAT22(sVar11 * -2 + sVar15,sVar10 * -2 + sVar14))); uVar3 = pmulhw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),0xb505b505b505b505); sVar1 = sVar1 + (short)uVar3; sVar4 = sVar4 + (short)((ulonglong)uVar3 >> 0x10); sVar5 = sVar5 + (short)((ulonglong)uVar3 >> 0x20); sVar6 = sVar6 + (short)((ulonglong)uVar3 >> 0x30); sVar18 = (sVar14 + (short)uVar8) - (short)uVar9; sVar11 = (short)((ulonglong)uVar9 >> 0x10); sVar20 = (sVar15 + (short)((ulonglong)uVar8 >> 0x10)) - sVar11; sVar12 = (short)((ulonglong)uVar9 >> 0x20); sVar22 = (sVar16 + (short)((ulonglong)uVar8 >> 0x20)) - sVar12; sVar13 = (short)((ulonglong)uVar9 >> 0x30); sVar24 = (sVar17 + (short)((ulonglong)uVar8 >> 0x30)) - sVar13; uVar8 = pmulhw(param_1[1],0xb505b505b505b505); uVar3 = param_1[1]; sVar14 = (short)uVar8 + (short)uVar3; sVar15 = (short)((ulonglong)uVar8 >> 0x10) + (short)((ulonglong)uVar3 >> 0x10); sVar16 = (short)((ulonglong)uVar8 >> 0x20) + (short)((ulonglong)uVar3 >> 0x20); sVar17 = (short)((ulonglong)uVar8 >> 0x30) + (short)((ulonglong)uVar3 >> 0x30); sVar10 = (short)uVar9 * 2 + sVar18; sVar11 = sVar11 * 2 + sVar20; sVar12 = sVar12 * 2 + sVar22; sVar13 = sVar13 * 2 + sVar24; sVar31 = sVar14 - sVar1; sVar21 = sVar15 - sVar4; sVar33 = sVar16 - sVar5; sVar23 = sVar17 - sVar6; uVar3 = param_1[3]; sVar1 = ((sVar1 * 2 + sVar31) - sVar10) + 8; sVar4 = ((sVar4 * 2 + sVar21) - sVar11) + 8; sVar5 = ((sVar5 * 2 + sVar33) - sVar12) + 8; sVar6 = ((sVar6 * 2 + sVar23) - sVar13) + 8; uVar19 = psraw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),4); sVar14 = sVar14 - sVar35; sVar15 = sVar15 - sVar25; sVar16 = sVar16 - sVar26; sVar17 = sVar17 - sVar27; uVar8 = psraw(CONCAT26(sVar13 * 2 + sVar6, CONCAT24(sVar12 * 2 + sVar5, CONCAT22(sVar11 * 2 + sVar4,sVar10 * 2 + sVar1))),4); uVar9 = param_1[5]; param_1[5] = uVar19; param_1[3] = uVar8; sVar1 = (short)((ulonglong)uVar9 >> 0x10); sVar4 = (short)((ulonglong)uVar9 >> 0x20); sVar5 = (short)((ulonglong)uVar9 >> 0x30); sVar6 = (sVar14 - (short)uVar9) + 8; sVar10 = (sVar15 - sVar1) + 8; sVar11 = (sVar16 - sVar4) + 8; sVar12 = (sVar17 - sVar5) + 8; uVar8 = psraw(CONCAT26(sVar12,CONCAT24(sVar11,CONCAT22(sVar10,sVar6))),4); uVar9 = psraw(CONCAT26(sVar5 * 2 + sVar12, CONCAT24(sVar4 * 2 + sVar11, CONCAT22(sVar1 * 2 + sVar10,(short)uVar9 * 2 + sVar6))),4); sVar1 = (sVar31 - sVar18) + 8; sVar4 = (sVar21 - sVar20) + 8; sVar5 = (sVar33 - sVar22) + 8; sVar6 = (sVar23 - sVar24) + 8; uVar19 = psraw(CONCAT26(sVar6,CONCAT24(sVar5,CONCAT22(sVar4,sVar1))),4); param_1[9] = uVar8; uVar8 = psraw(CONCAT26(sVar24 * 2 + sVar6, CONCAT24(sVar22 * 2 + sVar5, CONCAT22(sVar20 * 2 + sVar4,sVar18 * 2 + sVar1))),4); param_1[7] = uVar9; sVar1 = (short)((ulonglong)uVar3 >> 0x10); sVar4 = (short)((ulonglong)uVar3 >> 0x20); sVar5 = (short)((ulonglong)uVar3 >> 0x30); sVar6 = ((sVar35 * 2 + sVar14) - (short)uVar3) + 8; sVar10 = ((sVar25 * 2 + sVar15) - sVar1) + 8; sVar11 = ((sVar26 * 2 + sVar16) - sVar4) + 8; sVar12 = ((sVar27 * 2 + sVar17) - sVar5) + 8; uVar9 = psraw(CONCAT26(sVar12,CONCAT24(sVar11,CONCAT22(sVar10,sVar6))),4); param_1[0xd] = uVar19; uVar3 = psraw(CONCAT26(sVar5 * 2 + sVar12, CONCAT24(sVar4 * 2 + sVar11, CONCAT22(sVar1 * 2 + sVar10,(short)uVar3 * 2 + sVar6))),4); param_1[0xb] = uVar8; param_1[0xf] = uVar9; param_1[1] = uVar3; *param_2 = 0; param_2[2] = 0; param_2[4] = 0; param_2[6] = 0; return; } oc_idct8x8_mmx(param_1,param_2); return; } //@@ 00ae4bf0 oc_idct8x8_mmx /* DB: ? libtheora MMX idct: pmulhw with OC_C1S7 0xfb15, OC_C2S6 0xec83, OC_C3S5 0xd4db, OC_C5S3 0x8e3a, OC_C7S1 0x31f1; (y, x) int16x8 rows */ void oc_idct8x8_mmx(undefined8 *param_1,undefined8 *param_2) { int iVar1; short sVar2; short sVar5; undefined4 uVar3; short sVar6; undefined8 uVar4; short sVar7; undefined4 uVar8; undefined8 uVar9; undefined8 uVar10; short sVar11; short sVar13; short sVar14; short sVar15; undefined8 uVar12; short sVar16; short sVar19; short sVar20; undefined8 uVar17; short sVar21; undefined8 uVar18; short sVar22; short sVar24; short sVar25; undefined8 uVar23; short sVar26; short sVar27; short sVar28; short sVar31; short sVar33; short sVar34; short sVar36; undefined8 uVar29; short sVar32; short sVar35; short sVar37; short sVar38; undefined8 uVar30; short sVar39; short sVar40; short sVar41; short sVar42; short sVar43; uVar30 = param_2[6]; uVar18 = param_2[3]; uVar17 = pmulhw(uVar30,0xd4dbd4dbd4dbd4db); uVar29 = pmulhw(0xd4dbd4dbd4dbd4db,uVar18); uVar9 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar30); uVar10 = param_2[2]; uVar23 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar18); sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar7 = (short)((ulonglong)uVar18 >> 0x10); sVar11 = (short)((ulonglong)uVar18 >> 0x20); sVar13 = (short)((ulonglong)uVar18 >> 0x30); uVar12 = param_2[7]; uVar4 = pmulhw(0xfb15fb15fb15fb15,uVar10); sVar16 = (short)uVar17 + (short)uVar30 + (short)uVar18 + (short)uVar23; sVar19 = (short)((ulonglong)uVar17 >> 0x10) + sVar2 + sVar7 + (short)((ulonglong)uVar23 >> 0x10); sVar20 = (short)((ulonglong)uVar17 >> 0x20) + sVar5 + sVar11 + (short)((ulonglong)uVar23 >> 0x20); sVar21 = (short)((ulonglong)uVar17 >> 0x30) + sVar6 + sVar13 + (short)((ulonglong)uVar23 >> 0x30); uVar23 = pmulhw(0xfb15fb15fb15fb15,uVar12); sVar27 = ((short)uVar29 + (short)uVar18) - ((short)uVar30 + (short)uVar9); sVar31 = ((short)((ulonglong)uVar29 >> 0x10) + sVar7) - (sVar2 + (short)((ulonglong)uVar9 >> 0x10)); sVar34 = ((short)((ulonglong)uVar29 >> 0x20) + sVar11) - (sVar5 + (short)((ulonglong)uVar9 >> 0x20)); sVar37 = ((short)((ulonglong)uVar29 >> 0x30) + sVar13) - (sVar6 + (short)((ulonglong)uVar9 >> 0x30)); uVar17 = pmulhw(uVar10,0x31f131f131f131f1); uVar30 = param_2[4]; uVar29 = pmulhw(0x31f131f131f131f1,uVar12); uVar9 = pmulhw(uVar30,0xec83ec83ec83ec83); uVar18 = param_2[5]; sVar2 = ((short)uVar4 + (short)uVar10 + (short)uVar29) - sVar16; sVar5 = ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar10 >> 0x10) + (short)((ulonglong)uVar29 >> 0x10)) - sVar19; sVar6 = ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar10 >> 0x20) + (short)((ulonglong)uVar29 >> 0x20)) - sVar20; sVar7 = ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar10 >> 0x30) + (short)((ulonglong)uVar29 >> 0x30)) - sVar21; uVar4 = pmulhw(uVar18,0xec83ec83ec83ec83); uVar10 = pmulhw(uVar30,0x61f861f861f861f8); sVar11 = ((short)uVar17 - ((short)uVar23 + (short)uVar12)) - sVar27; sVar13 = ((short)((ulonglong)uVar17 >> 0x10) - ((short)((ulonglong)uVar23 >> 0x10) + (short)((ulonglong)uVar12 >> 0x10))) - sVar31; sVar14 = ((short)((ulonglong)uVar17 >> 0x20) - ((short)((ulonglong)uVar23 >> 0x20) + (short)((ulonglong)uVar12 >> 0x20))) - sVar34; sVar15 = ((short)((ulonglong)uVar17 >> 0x30) - ((short)((ulonglong)uVar23 >> 0x30) + (short)((ulonglong)uVar12 >> 0x30))) - sVar37; uVar17 = pmulhw(uVar18,0x61f861f861f861f8); param_1[2] = CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar6,CONCAT22(sVar19 * 2 + sVar5,sVar16 * 2 + sVar2)) ); sVar16 = (short)uVar10 - ((short)uVar4 + (short)uVar18); sVar19 = (short)((ulonglong)uVar10 >> 0x10) - ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar18 >> 0x10)); sVar20 = (short)((ulonglong)uVar10 >> 0x20) - ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar18 >> 0x20)); sVar21 = (short)((ulonglong)uVar10 >> 0x30) - ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar18 >> 0x30)); uVar12 = pmulhw(CONCAT26(sVar15,CONCAT24(sVar14,CONCAT22(sVar13,sVar11))),0xb505b505b505b505); sVar40 = (short)uVar17 + (short)uVar9 + (short)uVar30; sVar41 = (short)((ulonglong)uVar17 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10) + (short)((ulonglong)uVar30 >> 0x10); sVar42 = (short)((ulonglong)uVar17 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20) + (short)((ulonglong)uVar30 >> 0x20); sVar43 = (short)((ulonglong)uVar17 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30) + (short)((ulonglong)uVar30 >> 0x30); param_1[4] = CONCAT26(sVar37 * 2 + sVar15, CONCAT24(sVar34 * 2 + sVar14, CONCAT22(sVar31 * 2 + sVar13,sVar27 * 2 + sVar11))); uVar30 = *param_2; uVar10 = pmulhw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),0xb505b505b505b505); uVar18 = param_2[1]; sVar22 = (sVar11 + (short)uVar12) - sVar16; sVar24 = (sVar13 + (short)((ulonglong)uVar12 >> 0x10)) - sVar19; sVar25 = (sVar14 + (short)((ulonglong)uVar12 >> 0x20)) - sVar20; sVar26 = (sVar15 + (short)((ulonglong)uVar12 >> 0x30)) - sVar21; sVar2 = sVar2 + (short)uVar10; sVar5 = sVar5 + (short)((ulonglong)uVar10 >> 0x10); sVar6 = sVar6 + (short)((ulonglong)uVar10 >> 0x20); sVar7 = sVar7 + (short)((ulonglong)uVar10 >> 0x30); sVar37 = (short)uVar30 - (short)uVar18; sVar11 = (short)((ulonglong)uVar18 >> 0x10); sVar32 = (short)((ulonglong)uVar30 >> 0x10) - sVar11; sVar13 = (short)((ulonglong)uVar18 >> 0x20); sVar35 = (short)((ulonglong)uVar30 >> 0x20) - sVar13; sVar14 = (short)((ulonglong)uVar18 >> 0x30); sVar38 = (short)((ulonglong)uVar30 >> 0x30) - sVar14; uVar30 = pmulhw(CONCAT26(sVar38,CONCAT24(sVar35,CONCAT22(sVar32,sVar37))),0xb505b505b505b505); sVar15 = (short)uVar18 * 2 + sVar37; sVar27 = sVar11 * 2 + sVar32; sVar31 = sVar13 * 2 + sVar35; sVar34 = sVar14 * 2 + sVar38; sVar16 = sVar16 * 2 + sVar22; sVar19 = sVar19 * 2 + sVar24; sVar20 = sVar20 * 2 + sVar25; sVar21 = sVar21 * 2 + sVar26; uVar10 = pmulhw(0xb505b505b505b505,CONCAT26(sVar34,CONCAT24(sVar31,CONCAT22(sVar27,sVar15)))); sVar28 = ((short)uVar30 + sVar37) - sVar2; sVar33 = ((short)((ulonglong)uVar30 >> 0x10) + sVar32) - sVar5; sVar36 = ((short)((ulonglong)uVar30 >> 0x20) + sVar35) - sVar6; sVar39 = ((short)((ulonglong)uVar30 >> 0x30) + sVar38) - sVar7; uVar30 = param_1[2]; sVar11 = (sVar2 * 2 + sVar28) - sVar16; sVar13 = (sVar5 * 2 + sVar33) - sVar19; sVar14 = (sVar6 * 2 + sVar36) - sVar20; sVar7 = (sVar7 * 2 + sVar39) - sVar21; uVar18 = param_1[4]; sVar2 = ((short)uVar10 + sVar15) - sVar40; sVar5 = ((short)((ulonglong)uVar10 >> 0x10) + sVar27) - sVar41; sVar6 = ((short)((ulonglong)uVar10 >> 0x20) + sVar31) - sVar42; sVar35 = ((short)((ulonglong)uVar10 >> 0x30) + sVar34) - sVar43; sVar34 = sVar2 - (short)uVar18; sVar15 = (short)((ulonglong)uVar18 >> 0x10); sVar37 = sVar5 - sVar15; sVar27 = (short)((ulonglong)uVar18 >> 0x20); sVar32 = sVar6 - sVar27; sVar31 = (short)((ulonglong)uVar18 >> 0x30); sVar38 = sVar35 - sVar31; sVar28 = sVar28 - sVar22; sVar33 = sVar33 - sVar24; sVar36 = sVar36 - sVar25; sVar39 = sVar39 - sVar26; sVar40 = (sVar40 * 2 + sVar2) - (short)uVar30; sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar41 = (sVar41 * 2 + sVar5) - sVar2; sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar42 = (sVar42 * 2 + sVar6) - sVar5; sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar35 = (sVar43 * 2 + sVar35) - sVar6; param_1[2] = CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar14, CONCAT22(sVar19 * 2 + sVar13,sVar16 * 2 + sVar11))); *param_1 = CONCAT26(sVar6 * 2 + sVar35, CONCAT24(sVar5 * 2 + sVar42, CONCAT22(sVar2 * 2 + sVar41,(short)uVar30 * 2 + sVar40))); uVar8 = CONCAT22(sVar25 * 2 + sVar36,sVar32); param_1[1] = CONCAT44(CONCAT22(sVar40,sVar28),CONCAT22(sVar22 * 2 + sVar28,sVar34)); uVar3 = CONCAT22(sVar42,sVar36); param_1[3] = CONCAT44(CONCAT22(sVar41,sVar33),CONCAT22(sVar24 * 2 + sVar33,sVar37)); uVar30 = *param_1; uVar10 = param_1[2]; param_1[7] = CONCAT44((int)(CONCAT26(sVar35,CONCAT24(sVar39,uVar3)) >> 0x20), (int)(CONCAT26(sVar26 * 2 + sVar39,CONCAT24(sVar38,uVar8)) >> 0x20)); param_1[5] = CONCAT44(uVar3,uVar8); uVar3 = CONCAT22((short)((ulonglong)uVar10 >> 0x20),(short)((ulonglong)uVar30 >> 0x20)); *param_1 = CONCAT44(CONCAT22((short)uVar18 * 2 + sVar34,sVar11), CONCAT22((short)uVar10,(short)uVar30)); uVar8 = CONCAT22(sVar27 * 2 + sVar32,sVar14); param_1[2] = CONCAT44(CONCAT22(sVar15 * 2 + sVar37,sVar13), CONCAT22((short)((ulonglong)uVar10 >> 0x10), (short)((ulonglong)uVar30 >> 0x10))); param_1[6] = CONCAT44((int)(CONCAT26(sVar31 * 2 + sVar38,CONCAT24(sVar7,uVar8)) >> 0x20), (int)(CONCAT26((short)((ulonglong)uVar10 >> 0x30), CONCAT24((short)((ulonglong)uVar30 >> 0x30),uVar3)) >> 0x20)) ; param_1[4] = CONCAT44(uVar8,uVar3); uVar30 = param_2[0xe]; uVar18 = param_2[0xb]; uVar17 = pmulhw(uVar30,0xd4dbd4dbd4dbd4db); uVar29 = pmulhw(0xd4dbd4dbd4dbd4db,uVar18); uVar9 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar30); uVar10 = param_2[10]; uVar23 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar18); sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar7 = (short)((ulonglong)uVar18 >> 0x10); sVar11 = (short)((ulonglong)uVar18 >> 0x20); sVar13 = (short)((ulonglong)uVar18 >> 0x30); uVar12 = param_2[0xf]; uVar4 = pmulhw(0xfb15fb15fb15fb15,uVar10); sVar16 = (short)uVar17 + (short)uVar30 + (short)uVar18 + (short)uVar23; sVar19 = (short)((ulonglong)uVar17 >> 0x10) + sVar2 + sVar7 + (short)((ulonglong)uVar23 >> 0x10); sVar20 = (short)((ulonglong)uVar17 >> 0x20) + sVar5 + sVar11 + (short)((ulonglong)uVar23 >> 0x20); sVar21 = (short)((ulonglong)uVar17 >> 0x30) + sVar6 + sVar13 + (short)((ulonglong)uVar23 >> 0x30); uVar23 = pmulhw(0xfb15fb15fb15fb15,uVar12); sVar27 = ((short)uVar29 + (short)uVar18) - ((short)uVar30 + (short)uVar9); sVar31 = ((short)((ulonglong)uVar29 >> 0x10) + sVar7) - (sVar2 + (short)((ulonglong)uVar9 >> 0x10)); sVar34 = ((short)((ulonglong)uVar29 >> 0x20) + sVar11) - (sVar5 + (short)((ulonglong)uVar9 >> 0x20)); sVar37 = ((short)((ulonglong)uVar29 >> 0x30) + sVar13) - (sVar6 + (short)((ulonglong)uVar9 >> 0x30)); uVar17 = pmulhw(uVar10,0x31f131f131f131f1); uVar30 = param_2[0xc]; uVar29 = pmulhw(0x31f131f131f131f1,uVar12); uVar9 = pmulhw(uVar30,0xec83ec83ec83ec83); uVar18 = param_2[0xd]; sVar2 = ((short)uVar4 + (short)uVar10 + (short)uVar29) - sVar16; sVar5 = ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar10 >> 0x10) + (short)((ulonglong)uVar29 >> 0x10)) - sVar19; sVar6 = ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar10 >> 0x20) + (short)((ulonglong)uVar29 >> 0x20)) - sVar20; sVar7 = ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar10 >> 0x30) + (short)((ulonglong)uVar29 >> 0x30)) - sVar21; uVar4 = pmulhw(uVar18,0xec83ec83ec83ec83); uVar10 = pmulhw(uVar30,0x61f861f861f861f8); sVar11 = ((short)uVar17 - ((short)uVar23 + (short)uVar12)) - sVar27; sVar13 = ((short)((ulonglong)uVar17 >> 0x10) - ((short)((ulonglong)uVar23 >> 0x10) + (short)((ulonglong)uVar12 >> 0x10))) - sVar31; sVar14 = ((short)((ulonglong)uVar17 >> 0x20) - ((short)((ulonglong)uVar23 >> 0x20) + (short)((ulonglong)uVar12 >> 0x20))) - sVar34; sVar15 = ((short)((ulonglong)uVar17 >> 0x30) - ((short)((ulonglong)uVar23 >> 0x30) + (short)((ulonglong)uVar12 >> 0x30))) - sVar37; uVar17 = pmulhw(uVar18,0x61f861f861f861f8); param_1[10] = CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar6,CONCAT22(sVar19 * 2 + sVar5,sVar16 * 2 + sVar2) )); sVar16 = (short)uVar10 - ((short)uVar4 + (short)uVar18); sVar19 = (short)((ulonglong)uVar10 >> 0x10) - ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar18 >> 0x10)); sVar20 = (short)((ulonglong)uVar10 >> 0x20) - ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar18 >> 0x20)); sVar21 = (short)((ulonglong)uVar10 >> 0x30) - ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar18 >> 0x30)); uVar12 = pmulhw(CONCAT26(sVar15,CONCAT24(sVar14,CONCAT22(sVar13,sVar11))),0xb505b505b505b505); sVar40 = (short)uVar17 + (short)uVar9 + (short)uVar30; sVar41 = (short)((ulonglong)uVar17 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10) + (short)((ulonglong)uVar30 >> 0x10); sVar42 = (short)((ulonglong)uVar17 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20) + (short)((ulonglong)uVar30 >> 0x20); sVar43 = (short)((ulonglong)uVar17 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30) + (short)((ulonglong)uVar30 >> 0x30); param_1[0xc] = CONCAT26(sVar37 * 2 + sVar15, CONCAT24(sVar34 * 2 + sVar14, CONCAT22(sVar31 * 2 + sVar13,sVar27 * 2 + sVar11))); uVar30 = param_2[8]; uVar10 = pmulhw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),0xb505b505b505b505); uVar18 = param_2[9]; sVar22 = (sVar11 + (short)uVar12) - sVar16; sVar24 = (sVar13 + (short)((ulonglong)uVar12 >> 0x10)) - sVar19; sVar25 = (sVar14 + (short)((ulonglong)uVar12 >> 0x20)) - sVar20; sVar26 = (sVar15 + (short)((ulonglong)uVar12 >> 0x30)) - sVar21; sVar2 = sVar2 + (short)uVar10; sVar5 = sVar5 + (short)((ulonglong)uVar10 >> 0x10); sVar6 = sVar6 + (short)((ulonglong)uVar10 >> 0x20); sVar7 = sVar7 + (short)((ulonglong)uVar10 >> 0x30); sVar37 = (short)uVar30 - (short)uVar18; sVar11 = (short)((ulonglong)uVar18 >> 0x10); sVar32 = (short)((ulonglong)uVar30 >> 0x10) - sVar11; sVar13 = (short)((ulonglong)uVar18 >> 0x20); sVar35 = (short)((ulonglong)uVar30 >> 0x20) - sVar13; sVar14 = (short)((ulonglong)uVar18 >> 0x30); sVar38 = (short)((ulonglong)uVar30 >> 0x30) - sVar14; uVar30 = pmulhw(CONCAT26(sVar38,CONCAT24(sVar35,CONCAT22(sVar32,sVar37))),0xb505b505b505b505); sVar15 = (short)uVar18 * 2 + sVar37; sVar27 = sVar11 * 2 + sVar32; sVar31 = sVar13 * 2 + sVar35; sVar34 = sVar14 * 2 + sVar38; sVar16 = sVar16 * 2 + sVar22; sVar19 = sVar19 * 2 + sVar24; sVar20 = sVar20 * 2 + sVar25; sVar21 = sVar21 * 2 + sVar26; uVar10 = pmulhw(0xb505b505b505b505,CONCAT26(sVar34,CONCAT24(sVar31,CONCAT22(sVar27,sVar15)))); sVar28 = ((short)uVar30 + sVar37) - sVar2; sVar33 = ((short)((ulonglong)uVar30 >> 0x10) + sVar32) - sVar5; sVar36 = ((short)((ulonglong)uVar30 >> 0x20) + sVar35) - sVar6; sVar39 = ((short)((ulonglong)uVar30 >> 0x30) + sVar38) - sVar7; uVar30 = param_1[10]; sVar11 = (sVar2 * 2 + sVar28) - sVar16; sVar13 = (sVar5 * 2 + sVar33) - sVar19; sVar14 = (sVar6 * 2 + sVar36) - sVar20; sVar7 = (sVar7 * 2 + sVar39) - sVar21; uVar18 = param_1[0xc]; sVar2 = ((short)uVar10 + sVar15) - sVar40; sVar5 = ((short)((ulonglong)uVar10 >> 0x10) + sVar27) - sVar41; sVar6 = ((short)((ulonglong)uVar10 >> 0x20) + sVar31) - sVar42; sVar35 = ((short)((ulonglong)uVar10 >> 0x30) + sVar34) - sVar43; sVar34 = sVar2 - (short)uVar18; sVar15 = (short)((ulonglong)uVar18 >> 0x10); sVar37 = sVar5 - sVar15; sVar27 = (short)((ulonglong)uVar18 >> 0x20); sVar32 = sVar6 - sVar27; sVar31 = (short)((ulonglong)uVar18 >> 0x30); sVar38 = sVar35 - sVar31; sVar28 = sVar28 - sVar22; sVar33 = sVar33 - sVar24; sVar36 = sVar36 - sVar25; sVar39 = sVar39 - sVar26; sVar40 = (sVar40 * 2 + sVar2) - (short)uVar30; sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar41 = (sVar41 * 2 + sVar5) - sVar2; sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar42 = (sVar42 * 2 + sVar6) - sVar5; sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar35 = (sVar43 * 2 + sVar35) - sVar6; param_1[10] = CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar14, CONCAT22(sVar19 * 2 + sVar13,sVar16 * 2 + sVar11))); param_1[8] = CONCAT26(sVar6 * 2 + sVar35, CONCAT24(sVar5 * 2 + sVar42, CONCAT22(sVar2 * 2 + sVar41,(short)uVar30 * 2 + sVar40))); uVar8 = CONCAT22(sVar25 * 2 + sVar36,sVar32); param_1[9] = CONCAT44(CONCAT22(sVar40,sVar28),CONCAT22(sVar22 * 2 + sVar28,sVar34)); uVar3 = CONCAT22(sVar42,sVar36); param_1[0xb] = CONCAT44(CONCAT22(sVar41,sVar33),CONCAT22(sVar24 * 2 + sVar33,sVar37)); uVar30 = param_1[8]; uVar10 = param_1[10]; param_1[0xf] = CONCAT44((int)(CONCAT26(sVar35,CONCAT24(sVar39,uVar3)) >> 0x20), (int)(CONCAT26(sVar26 * 2 + sVar39,CONCAT24(sVar38,uVar8)) >> 0x20)); param_1[0xd] = CONCAT44(uVar3,uVar8); uVar3 = CONCAT22((short)((ulonglong)uVar10 >> 0x20),(short)((ulonglong)uVar30 >> 0x20)); param_1[8] = CONCAT44(CONCAT22((short)uVar18 * 2 + sVar34,sVar11), CONCAT22((short)uVar10,(short)uVar30)); uVar8 = CONCAT22(sVar27 * 2 + sVar32,sVar14); param_1[10] = CONCAT44(CONCAT22(sVar15 * 2 + sVar37,sVar13), CONCAT22((short)((ulonglong)uVar10 >> 0x10), (short)((ulonglong)uVar30 >> 0x10))); param_1[0xe] = CONCAT44((int)(CONCAT26(sVar31 * 2 + sVar38,CONCAT24(sVar7,uVar8)) >> 0x20), (int)(CONCAT26((short)((ulonglong)uVar10 >> 0x30), CONCAT24((short)((ulonglong)uVar30 >> 0x30),uVar3)) >> 0x20 )); param_1[0xc] = CONCAT44(uVar8,uVar3); uVar30 = param_1[6]; uVar18 = param_1[10]; uVar17 = pmulhw(uVar30,0xd4dbd4dbd4dbd4db); uVar29 = pmulhw(0xd4dbd4dbd4dbd4db,uVar18); uVar9 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar30); uVar10 = param_1[2]; uVar23 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar18); sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar7 = (short)((ulonglong)uVar18 >> 0x10); sVar11 = (short)((ulonglong)uVar18 >> 0x20); sVar13 = (short)((ulonglong)uVar18 >> 0x30); uVar12 = param_1[0xe]; uVar4 = pmulhw(0xfb15fb15fb15fb15,uVar10); sVar16 = (short)uVar17 + (short)uVar30 + (short)uVar18 + (short)uVar23; sVar19 = (short)((ulonglong)uVar17 >> 0x10) + sVar2 + sVar7 + (short)((ulonglong)uVar23 >> 0x10); sVar20 = (short)((ulonglong)uVar17 >> 0x20) + sVar5 + sVar11 + (short)((ulonglong)uVar23 >> 0x20); sVar21 = (short)((ulonglong)uVar17 >> 0x30) + sVar6 + sVar13 + (short)((ulonglong)uVar23 >> 0x30); uVar23 = pmulhw(0xfb15fb15fb15fb15,uVar12); sVar27 = ((short)uVar29 + (short)uVar18) - ((short)uVar30 + (short)uVar9); sVar31 = ((short)((ulonglong)uVar29 >> 0x10) + sVar7) - (sVar2 + (short)((ulonglong)uVar9 >> 0x10)); sVar34 = ((short)((ulonglong)uVar29 >> 0x20) + sVar11) - (sVar5 + (short)((ulonglong)uVar9 >> 0x20)); sVar37 = ((short)((ulonglong)uVar29 >> 0x30) + sVar13) - (sVar6 + (short)((ulonglong)uVar9 >> 0x30)); uVar17 = pmulhw(uVar10,0x31f131f131f131f1); uVar30 = param_1[4]; uVar29 = pmulhw(0x31f131f131f131f1,uVar12); uVar9 = pmulhw(uVar30,0xec83ec83ec83ec83); uVar18 = param_1[0xc]; sVar2 = ((short)uVar4 + (short)uVar10 + (short)uVar29) - sVar16; sVar5 = ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar10 >> 0x10) + (short)((ulonglong)uVar29 >> 0x10)) - sVar19; sVar6 = ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar10 >> 0x20) + (short)((ulonglong)uVar29 >> 0x20)) - sVar20; sVar7 = ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar10 >> 0x30) + (short)((ulonglong)uVar29 >> 0x30)) - sVar21; uVar4 = pmulhw(uVar18,0xec83ec83ec83ec83); uVar10 = pmulhw(uVar30,0x61f861f861f861f8); sVar11 = ((short)uVar17 - ((short)uVar23 + (short)uVar12)) - sVar27; sVar13 = ((short)((ulonglong)uVar17 >> 0x10) - ((short)((ulonglong)uVar23 >> 0x10) + (short)((ulonglong)uVar12 >> 0x10))) - sVar31; sVar14 = ((short)((ulonglong)uVar17 >> 0x20) - ((short)((ulonglong)uVar23 >> 0x20) + (short)((ulonglong)uVar12 >> 0x20))) - sVar34; sVar15 = ((short)((ulonglong)uVar17 >> 0x30) - ((short)((ulonglong)uVar23 >> 0x30) + (short)((ulonglong)uVar12 >> 0x30))) - sVar37; uVar17 = pmulhw(uVar18,0x61f861f861f861f8); param_1[2] = CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar6,CONCAT22(sVar19 * 2 + sVar5,sVar16 * 2 + sVar2)) ); sVar16 = (short)uVar10 - ((short)uVar4 + (short)uVar18); sVar19 = (short)((ulonglong)uVar10 >> 0x10) - ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar18 >> 0x10)); sVar20 = (short)((ulonglong)uVar10 >> 0x20) - ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar18 >> 0x20)); sVar21 = (short)((ulonglong)uVar10 >> 0x30) - ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar18 >> 0x30)); uVar12 = pmulhw(CONCAT26(sVar15,CONCAT24(sVar14,CONCAT22(sVar13,sVar11))),0xb505b505b505b505); sVar24 = (short)uVar17 + (short)uVar9 + (short)uVar30; sVar25 = (short)((ulonglong)uVar17 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10) + (short)((ulonglong)uVar30 >> 0x10); sVar26 = (short)((ulonglong)uVar17 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20) + (short)((ulonglong)uVar30 >> 0x20); sVar28 = (short)((ulonglong)uVar17 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30) + (short)((ulonglong)uVar30 >> 0x30); param_1[4] = CONCAT26(sVar37 * 2 + sVar15, CONCAT24(sVar34 * 2 + sVar14, CONCAT22(sVar31 * 2 + sVar13,sVar27 * 2 + sVar11))); uVar30 = *param_1; uVar10 = pmulhw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),0xb505b505b505b505); uVar18 = param_1[8]; sVar27 = (sVar11 + (short)uVar12) - sVar16; sVar31 = (sVar13 + (short)((ulonglong)uVar12 >> 0x10)) - sVar19; sVar34 = (sVar14 + (short)((ulonglong)uVar12 >> 0x20)) - sVar20; sVar37 = (sVar15 + (short)((ulonglong)uVar12 >> 0x30)) - sVar21; sVar2 = sVar2 + (short)uVar10; sVar5 = sVar5 + (short)((ulonglong)uVar10 >> 0x10); sVar6 = sVar6 + (short)((ulonglong)uVar10 >> 0x20); sVar7 = sVar7 + (short)((ulonglong)uVar10 >> 0x30); sVar32 = (short)uVar30 - (short)uVar18; sVar13 = (short)((ulonglong)uVar18 >> 0x10); sVar35 = (short)((ulonglong)uVar30 >> 0x10) - sVar13; sVar14 = (short)((ulonglong)uVar18 >> 0x20); sVar38 = (short)((ulonglong)uVar30 >> 0x20) - sVar14; sVar15 = (short)((ulonglong)uVar18 >> 0x30); sVar22 = (short)((ulonglong)uVar30 >> 0x30) - sVar15; uVar30 = pmulhw(CONCAT26(sVar22,CONCAT24(sVar38,CONCAT22(sVar35,sVar32))),0xb505b505b505b505); sVar11 = (short)uVar18 * 2 + sVar32; sVar13 = sVar13 * 2 + sVar35; sVar14 = sVar14 * 2 + sVar38; sVar15 = sVar15 * 2 + sVar22; sVar16 = sVar16 * 2 + sVar27; sVar19 = sVar19 * 2 + sVar31; sVar20 = sVar20 * 2 + sVar34; sVar21 = sVar21 * 2 + sVar37; uVar18 = pmulhw(0xb505b505b505b505,CONCAT26(sVar15,CONCAT24(sVar14,CONCAT22(sVar13,sVar11)))); sVar32 = ((short)uVar30 + sVar32) - sVar2; sVar35 = ((short)((ulonglong)uVar30 >> 0x10) + sVar35) - sVar5; sVar38 = ((short)((ulonglong)uVar30 >> 0x20) + sVar38) - sVar6; sVar22 = ((short)((ulonglong)uVar30 >> 0x30) + sVar22) - sVar7; uVar30 = param_1[2]; sVar2 = ((sVar2 * 2 + sVar32) - sVar16) + 8; sVar5 = ((sVar5 * 2 + sVar35) - sVar19) + 8; sVar6 = ((sVar6 * 2 + sVar38) - sVar20) + 8; sVar7 = ((sVar7 * 2 + sVar22) - sVar21) + 8; uVar12 = psraw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),4); sVar11 = ((short)uVar18 + sVar11) - sVar24; sVar13 = ((short)((ulonglong)uVar18 >> 0x10) + sVar13) - sVar25; sVar14 = ((short)((ulonglong)uVar18 >> 0x20) + sVar14) - sVar26; sVar15 = ((short)((ulonglong)uVar18 >> 0x30) + sVar15) - sVar28; uVar10 = psraw(CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar6, CONCAT22(sVar19 * 2 + sVar5,sVar16 * 2 + sVar2))),4); uVar18 = param_1[4]; param_1[4] = uVar12; param_1[2] = uVar10; sVar2 = (short)((ulonglong)uVar18 >> 0x10); sVar5 = (short)((ulonglong)uVar18 >> 0x20); sVar6 = (short)((ulonglong)uVar18 >> 0x30); sVar7 = (sVar11 - (short)uVar18) + 8; sVar16 = (sVar13 - sVar2) + 8; sVar19 = (sVar14 - sVar5) + 8; sVar20 = (sVar15 - sVar6) + 8; uVar10 = psraw(CONCAT26(sVar20,CONCAT24(sVar19,CONCAT22(sVar16,sVar7))),4); uVar18 = psraw(CONCAT26(sVar6 * 2 + sVar20, CONCAT24(sVar5 * 2 + sVar19, CONCAT22(sVar2 * 2 + sVar16,(short)uVar18 * 2 + sVar7))),4); sVar2 = (sVar32 - sVar27) + 8; sVar5 = (sVar35 - sVar31) + 8; sVar6 = (sVar38 - sVar34) + 8; sVar7 = (sVar22 - sVar37) + 8; uVar12 = psraw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),4); param_1[8] = uVar10; uVar10 = psraw(CONCAT26(sVar37 * 2 + sVar7, CONCAT24(sVar34 * 2 + sVar6, CONCAT22(sVar31 * 2 + sVar5,sVar27 * 2 + sVar2))),4); param_1[6] = uVar18; sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar7 = ((sVar24 * 2 + sVar11) - (short)uVar30) + 8; sVar16 = ((sVar25 * 2 + sVar13) - sVar2) + 8; sVar19 = ((sVar26 * 2 + sVar14) - sVar5) + 8; sVar20 = ((sVar28 * 2 + sVar15) - sVar6) + 8; uVar18 = psraw(CONCAT26(sVar20,CONCAT24(sVar19,CONCAT22(sVar16,sVar7))),4); param_1[0xc] = uVar12; uVar30 = psraw(CONCAT26(sVar6 * 2 + sVar20, CONCAT24(sVar5 * 2 + sVar19, CONCAT22(sVar2 * 2 + sVar16,(short)uVar30 * 2 + sVar7))),4); param_1[10] = uVar10; param_1[0xe] = uVar18; *param_1 = uVar30; uVar30 = param_1[7]; uVar18 = param_1[0xb]; uVar17 = pmulhw(uVar30,0xd4dbd4dbd4dbd4db); uVar29 = pmulhw(0xd4dbd4dbd4dbd4db,uVar18); uVar9 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar30); uVar10 = param_1[3]; uVar23 = pmulhw(0x8e3a8e3a8e3a8e3a,uVar18); sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar7 = (short)((ulonglong)uVar18 >> 0x10); sVar11 = (short)((ulonglong)uVar18 >> 0x20); sVar13 = (short)((ulonglong)uVar18 >> 0x30); uVar12 = param_1[0xf]; uVar4 = pmulhw(0xfb15fb15fb15fb15,uVar10); sVar16 = (short)uVar17 + (short)uVar30 + (short)uVar18 + (short)uVar23; sVar19 = (short)((ulonglong)uVar17 >> 0x10) + sVar2 + sVar7 + (short)((ulonglong)uVar23 >> 0x10); sVar20 = (short)((ulonglong)uVar17 >> 0x20) + sVar5 + sVar11 + (short)((ulonglong)uVar23 >> 0x20); sVar21 = (short)((ulonglong)uVar17 >> 0x30) + sVar6 + sVar13 + (short)((ulonglong)uVar23 >> 0x30); uVar23 = pmulhw(0xfb15fb15fb15fb15,uVar12); sVar27 = ((short)uVar29 + (short)uVar18) - ((short)uVar30 + (short)uVar9); sVar31 = ((short)((ulonglong)uVar29 >> 0x10) + sVar7) - (sVar2 + (short)((ulonglong)uVar9 >> 0x10)); sVar34 = ((short)((ulonglong)uVar29 >> 0x20) + sVar11) - (sVar5 + (short)((ulonglong)uVar9 >> 0x20)); sVar37 = ((short)((ulonglong)uVar29 >> 0x30) + sVar13) - (sVar6 + (short)((ulonglong)uVar9 >> 0x30)); uVar17 = pmulhw(uVar10,0x31f131f131f131f1); uVar30 = param_1[5]; uVar29 = pmulhw(0x31f131f131f131f1,uVar12); uVar9 = pmulhw(uVar30,0xec83ec83ec83ec83); uVar18 = param_1[0xd]; sVar2 = ((short)uVar4 + (short)uVar10 + (short)uVar29) - sVar16; sVar5 = ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar10 >> 0x10) + (short)((ulonglong)uVar29 >> 0x10)) - sVar19; sVar6 = ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar10 >> 0x20) + (short)((ulonglong)uVar29 >> 0x20)) - sVar20; sVar7 = ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar10 >> 0x30) + (short)((ulonglong)uVar29 >> 0x30)) - sVar21; uVar4 = pmulhw(uVar18,0xec83ec83ec83ec83); uVar10 = pmulhw(uVar30,0x61f861f861f861f8); sVar11 = ((short)uVar17 - ((short)uVar23 + (short)uVar12)) - sVar27; sVar13 = ((short)((ulonglong)uVar17 >> 0x10) - ((short)((ulonglong)uVar23 >> 0x10) + (short)((ulonglong)uVar12 >> 0x10))) - sVar31; sVar14 = ((short)((ulonglong)uVar17 >> 0x20) - ((short)((ulonglong)uVar23 >> 0x20) + (short)((ulonglong)uVar12 >> 0x20))) - sVar34; sVar15 = ((short)((ulonglong)uVar17 >> 0x30) - ((short)((ulonglong)uVar23 >> 0x30) + (short)((ulonglong)uVar12 >> 0x30))) - sVar37; uVar17 = pmulhw(uVar18,0x61f861f861f861f8); param_1[3] = CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar6,CONCAT22(sVar19 * 2 + sVar5,sVar16 * 2 + sVar2)) ); sVar16 = (short)uVar10 - ((short)uVar4 + (short)uVar18); sVar19 = (short)((ulonglong)uVar10 >> 0x10) - ((short)((ulonglong)uVar4 >> 0x10) + (short)((ulonglong)uVar18 >> 0x10)); sVar20 = (short)((ulonglong)uVar10 >> 0x20) - ((short)((ulonglong)uVar4 >> 0x20) + (short)((ulonglong)uVar18 >> 0x20)); sVar21 = (short)((ulonglong)uVar10 >> 0x30) - ((short)((ulonglong)uVar4 >> 0x30) + (short)((ulonglong)uVar18 >> 0x30)); uVar12 = pmulhw(CONCAT26(sVar15,CONCAT24(sVar14,CONCAT22(sVar13,sVar11))),0xb505b505b505b505); sVar24 = (short)uVar17 + (short)uVar9 + (short)uVar30; sVar25 = (short)((ulonglong)uVar17 >> 0x10) + (short)((ulonglong)uVar9 >> 0x10) + (short)((ulonglong)uVar30 >> 0x10); sVar26 = (short)((ulonglong)uVar17 >> 0x20) + (short)((ulonglong)uVar9 >> 0x20) + (short)((ulonglong)uVar30 >> 0x20); sVar28 = (short)((ulonglong)uVar17 >> 0x30) + (short)((ulonglong)uVar9 >> 0x30) + (short)((ulonglong)uVar30 >> 0x30); param_1[5] = CONCAT26(sVar37 * 2 + sVar15, CONCAT24(sVar34 * 2 + sVar14, CONCAT22(sVar31 * 2 + sVar13,sVar27 * 2 + sVar11))); uVar30 = param_1[1]; uVar10 = pmulhw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),0xb505b505b505b505); uVar18 = param_1[9]; sVar27 = (sVar11 + (short)uVar12) - sVar16; sVar31 = (sVar13 + (short)((ulonglong)uVar12 >> 0x10)) - sVar19; sVar34 = (sVar14 + (short)((ulonglong)uVar12 >> 0x20)) - sVar20; sVar37 = (sVar15 + (short)((ulonglong)uVar12 >> 0x30)) - sVar21; sVar2 = sVar2 + (short)uVar10; sVar5 = sVar5 + (short)((ulonglong)uVar10 >> 0x10); sVar6 = sVar6 + (short)((ulonglong)uVar10 >> 0x20); sVar7 = sVar7 + (short)((ulonglong)uVar10 >> 0x30); sVar32 = (short)uVar30 - (short)uVar18; sVar13 = (short)((ulonglong)uVar18 >> 0x10); sVar35 = (short)((ulonglong)uVar30 >> 0x10) - sVar13; sVar14 = (short)((ulonglong)uVar18 >> 0x20); sVar38 = (short)((ulonglong)uVar30 >> 0x20) - sVar14; sVar15 = (short)((ulonglong)uVar18 >> 0x30); sVar22 = (short)((ulonglong)uVar30 >> 0x30) - sVar15; uVar30 = pmulhw(CONCAT26(sVar22,CONCAT24(sVar38,CONCAT22(sVar35,sVar32))),0xb505b505b505b505); sVar11 = (short)uVar18 * 2 + sVar32; sVar13 = sVar13 * 2 + sVar35; sVar14 = sVar14 * 2 + sVar38; sVar15 = sVar15 * 2 + sVar22; sVar16 = sVar16 * 2 + sVar27; sVar19 = sVar19 * 2 + sVar31; sVar20 = sVar20 * 2 + sVar34; sVar21 = sVar21 * 2 + sVar37; uVar18 = pmulhw(0xb505b505b505b505,CONCAT26(sVar15,CONCAT24(sVar14,CONCAT22(sVar13,sVar11)))); sVar32 = ((short)uVar30 + sVar32) - sVar2; sVar35 = ((short)((ulonglong)uVar30 >> 0x10) + sVar35) - sVar5; sVar38 = ((short)((ulonglong)uVar30 >> 0x20) + sVar38) - sVar6; sVar22 = ((short)((ulonglong)uVar30 >> 0x30) + sVar22) - sVar7; uVar30 = param_1[3]; sVar2 = ((sVar2 * 2 + sVar32) - sVar16) + 8; sVar5 = ((sVar5 * 2 + sVar35) - sVar19) + 8; sVar6 = ((sVar6 * 2 + sVar38) - sVar20) + 8; sVar7 = ((sVar7 * 2 + sVar22) - sVar21) + 8; uVar12 = psraw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),4); sVar11 = ((short)uVar18 + sVar11) - sVar24; sVar13 = ((short)((ulonglong)uVar18 >> 0x10) + sVar13) - sVar25; sVar14 = ((short)((ulonglong)uVar18 >> 0x20) + sVar14) - sVar26; sVar15 = ((short)((ulonglong)uVar18 >> 0x30) + sVar15) - sVar28; uVar10 = psraw(CONCAT26(sVar21 * 2 + sVar7, CONCAT24(sVar20 * 2 + sVar6, CONCAT22(sVar19 * 2 + sVar5,sVar16 * 2 + sVar2))),4); uVar18 = param_1[5]; param_1[5] = uVar12; param_1[3] = uVar10; sVar2 = (short)((ulonglong)uVar18 >> 0x10); sVar5 = (short)((ulonglong)uVar18 >> 0x20); sVar6 = (short)((ulonglong)uVar18 >> 0x30); sVar7 = (sVar11 - (short)uVar18) + 8; sVar16 = (sVar13 - sVar2) + 8; sVar19 = (sVar14 - sVar5) + 8; sVar20 = (sVar15 - sVar6) + 8; uVar10 = psraw(CONCAT26(sVar20,CONCAT24(sVar19,CONCAT22(sVar16,sVar7))),4); uVar18 = psraw(CONCAT26(sVar6 * 2 + sVar20, CONCAT24(sVar5 * 2 + sVar19, CONCAT22(sVar2 * 2 + sVar16,(short)uVar18 * 2 + sVar7))),4); sVar2 = (sVar32 - sVar27) + 8; sVar5 = (sVar35 - sVar31) + 8; sVar6 = (sVar38 - sVar34) + 8; sVar7 = (sVar22 - sVar37) + 8; uVar12 = psraw(CONCAT26(sVar7,CONCAT24(sVar6,CONCAT22(sVar5,sVar2))),4); param_1[9] = uVar10; uVar10 = psraw(CONCAT26(sVar37 * 2 + sVar7, CONCAT24(sVar34 * 2 + sVar6, CONCAT22(sVar31 * 2 + sVar5,sVar27 * 2 + sVar2))),4); param_1[7] = uVar18; sVar2 = (short)((ulonglong)uVar30 >> 0x10); sVar5 = (short)((ulonglong)uVar30 >> 0x20); sVar6 = (short)((ulonglong)uVar30 >> 0x30); sVar7 = ((sVar24 * 2 + sVar11) - (short)uVar30) + 8; sVar16 = ((sVar25 * 2 + sVar13) - sVar2) + 8; sVar19 = ((sVar26 * 2 + sVar14) - sVar5) + 8; sVar20 = ((sVar28 * 2 + sVar15) - sVar6) + 8; uVar18 = psraw(CONCAT26(sVar20,CONCAT24(sVar19,CONCAT22(sVar16,sVar7))),4); param_1[0xd] = uVar12; uVar30 = psraw(CONCAT26(sVar6 * 2 + sVar20, CONCAT24(sVar5 * 2 + sVar19, CONCAT22(sVar2 * 2 + sVar16,(short)uVar30 * 2 + sVar7))),4); param_1[0xb] = uVar10; param_1[0xf] = uVar18; param_1[1] = uVar30; iVar1 = 4; do { *param_2 = 0; param_2[1] = 0; param_2[2] = 0; param_2[3] = 0; param_2 = param_2 + 4; iVar1 = iVar1 + -1; } while (iVar1 != 0); return; } //@@ 00ae5240 FUN_00ae5240 void FUN_00ae5240(int *param_1,int param_2) { int iVar1; iVar1 = (~(param_2 * 2) & 0xffU) * 0x1010101; *param_1 = iVar1; param_1[1] = iVar1; return; } //@@ 00ae5260 FUN_00ae5260 void FUN_00ae5260(int param_1,int param_2,int param_3,short *param_4,int param_5,ushort param_6) { short *psVar1; undefined4 uVar2; int iVar3; uint uVar4; int iVar5; int iVar6; undefined8 uVar7; int local_c; int local_8; psVar1 = param_4 + 0x40; if (param_5 < 2) { param_5._0_2_ = (undefined2)((int)((int)*param_4 * (uint)param_6 + 0xf) >> 5); uVar7 = CONCAT44(CONCAT22((undefined2)param_5,(undefined2)param_5), CONCAT22((undefined2)param_5,(undefined2)param_5)); *(undefined8 *)(param_4 + 0x40) = uVar7; *(undefined8 *)(param_4 + 0x44) = uVar7; *(undefined8 *)(param_4 + 0x48) = uVar7; *(undefined8 *)(param_4 + 0x4c) = uVar7; *(undefined8 *)(param_4 + 0x50) = uVar7; *(undefined8 *)(param_4 + 0x54) = uVar7; *(undefined8 *)(param_4 + 0x58) = uVar7; *(undefined8 *)(param_4 + 0x5c) = uVar7; *(undefined8 *)(param_4 + 0x60) = uVar7; *(undefined8 *)(param_4 + 100) = uVar7; *(undefined8 *)(param_4 + 0x68) = uVar7; *(undefined8 *)(param_4 + 0x6c) = uVar7; *(undefined8 *)(param_4 + 0x70) = uVar7; *(undefined8 *)(param_4 + 0x74) = uVar7; *(undefined8 *)(param_4 + 0x78) = uVar7; *(undefined8 *)(param_4 + 0x7c) = uVar7; } else { *param_4 = *param_4 * param_6; oc_idct8x8_mmx(psVar1,param_4,param_5); } iVar5 = *(int *)(*(int *)(param_1 + 0xd4) + param_2 * 4); iVar6 = *(int *)(param_1 + 0x254) + iVar5; uVar4 = *(uint *)(*(int *)(param_1 + 0xd0) + param_2 * 4) >> 6 & 3; uVar2 = *(undefined4 *)(param_1 + 0x268 + param_3 * 4); if (uVar4 == 2) { FUN_00ae4750(iVar6,uVar2,psVar1); return; } iVar5 = *(int *)(param_1 + 0x24c + uVar4 * 4) + iVar5; iVar3 = FUN_00ae1900(param_1,&local_c,param_3, *(undefined2 *)(*(int *)(param_1 + 0xd8) + param_2 * 2)); if (iVar3 < 2) { FUN_00ae46e0(iVar6,local_c + iVar5,uVar2,psVar1); return; } FUN_00ae4630(iVar6,local_c + iVar5,local_8 + iVar5); return; } //@@ 00ae53b0 oc_state_loop_filter_frag_rows_mmx /* DB: libtheora oc_state_accel_init_x86 (00ae3150): opt_vtable +0x60 after state_frag_recon(+0x58)/loop_filter_init(+0x5c), before restore_fpu(+0x64); 6 args (_state,_bv,_refi,_pli,_fragy0,_fragy_end), MMX code */ void oc_state_loop_filter_frag_rows_mmx (int param_1,undefined8 *param_2,byte *param_3,int param_4,byte *param_5,int param_6) { undefined4 *puVar1; int iVar2; undefined4 *puVar3; undefined8 uVar4; int iVar5; int iVar6; int iVar7; int iVar8; int iVar9; int iVar10; undefined4 uVar11; undefined4 uVar12; undefined4 uVar13; undefined4 uVar14; undefined4 uVar15; undefined4 uVar16; undefined4 uVar17; bool bVar18; bool bVar19; bool bVar20; bool bVar21; bool bVar22; bool bVar23; bool bVar24; int iVar25; ushort uVar26; ushort uVar27; ushort uVar28; ushort uVar29; uint uVar30; undefined2 uVar31; int iVar32; int iVar33; undefined8 *puVar34; byte *pbVar35; int iVar36; undefined2 uVar37; undefined4 uVar38; byte bVar40; ushort uVar41; undefined6 uVar39; byte bVar42; undefined1 uVar43; char cVar44; ushort uVar45; ushort uVar46; undefined1 uVar47; byte bVar49; byte bVar50; undefined4 uVar48; ushort uVar51; ushort uVar52; ushort uVar53; byte bVar54; byte bVar56; ushort uVar55; uint5 uVar63; undefined8 uVar57; ulonglong uVar58; ulonglong uVar59; undefined8 uVar60; undefined8 uVar61; ulonglong uVar62; undefined1 uVar66; uint3 uVar64; uint3 uVar65; undefined1 uVar67; byte bVar70; byte bVar71; uint3 uVar68; ulonglong uVar69; byte bVar74; byte bVar75; short sVar76; short sVar77; undefined8 uVar72; short sVar78; undefined8 uVar73; byte *local_14; int local_8; iVar32 = param_4 * 0x20; iVar5 = *(int *)(iVar32 + 0x70 + param_1); iVar6 = *(int *)(iVar32 + 0x78 + param_1); iVar32 = *(int *)(iVar32 + 0x7c + param_1); local_8 = iVar5 * (int)param_5 + iVar6; iVar33 = iVar5 * param_6 + iVar6; iVar7 = *(int *)(param_1 + 0x268 + param_4 * 4); iVar8 = *(int *)(param_1 + 0xd0); iVar9 = *(int *)(param_1 + 0xd4); iVar10 = *(int *)(param_1 + 0x24c + (int)param_3 * 4); if (local_8 < iVar33) { local_14 = (byte *)(iVar8 + local_8 * 4); param_3 = (byte *)(iVar8 + (local_8 + iVar5) * 4); do { iVar2 = local_8 + iVar5; if (local_8 < iVar2) { pbVar35 = param_3; param_4 = local_8; param_5 = local_14; do { if ((*param_5 & 1) != 0) { iVar36 = *(int *)(param_5 + (iVar9 - iVar8)) + iVar10; if (local_8 < param_4) { puVar1 = (undefined4 *)(iVar36 + -2); uVar38 = *puVar1; uVar11 = *(undefined4 *)((int)puVar1 + iVar7); iVar25 = iVar7 * 3; uVar12 = *(undefined4 *)((int)puVar1 + iVar7 * 2); puVar3 = puVar1 + iVar7; uVar13 = *(undefined4 *)((int)puVar1 + iVar25); uVar14 = *puVar3; uVar15 = *(undefined4 *)((int)puVar3 + iVar7); uVar16 = *(undefined4 *)((int)puVar3 + iVar7 * 2); uVar17 = *(undefined4 *)((int)puVar3 + iVar25); uVar43 = (undefined1)((uint)uVar11 >> 0x10); bVar42 = (byte)((uint)uVar11 >> 8); bVar40 = (byte)((uint)uVar38 >> 8); bVar50 = (byte)((uint)uVar13 >> 0x10); uVar47 = (undefined1)((uint)uVar12 >> 0x10); bVar49 = (byte)((uint)uVar13 >> 8); cVar44 = (char)((uint)uVar12 >> 8); uVar41 = (ushort)bVar40; uVar52 = (ushort)(CONCAT15(uVar43,CONCAT14((char)((uint)uVar38 >> 0x10),uVar38)) >> 0x20); uVar48 = CONCAT22((short)(CONCAT15(bVar50,CONCAT14(uVar47,uVar12)) >> 0x20),uVar52); uVar67 = (undefined1)((uint)uVar15 >> 0x18); uVar31 = CONCAT11(uVar67,(char)((uint)uVar14 >> 0x18)); uVar66 = (undefined1)((uint)uVar15 >> 0x10); bVar56 = (byte)((uint)uVar15 >> 8); bVar54 = (byte)((uint)uVar14 >> 8); bVar75 = (byte)((uint)uVar17 >> 0x10); bVar71 = (byte)((uint)uVar16 >> 0x10); bVar74 = (byte)((uint)uVar17 >> 8); bVar70 = (byte)((uint)uVar16 >> 8); uVar55 = (ushort)bVar70; uVar53 = (ushort)bVar54; uVar37 = (undefined2) (CONCAT35(CONCAT21(uVar31,uVar66), CONCAT14((char)((uint)uVar14 >> 0x10),uVar14)) >> 0x20); uVar26 = (ushort)(((uint7)(byte)uVar13 << 0x30) >> 0x28); uVar68 = CONCAT12((char)uVar15,CONCAT11((char)uVar15,(char)uVar14)) & 0xff00ff; uVar27 = (ushort)(((uint7)(byte)((uint)uVar13 >> 0x18) << 0x30) >> 0x28); uVar64 = CONCAT12(uVar67,uVar31) & 0xff00ff; uVar28 = (ushort)(((uint7)bVar49 << 0x30) >> 0x28); uVar29 = (ushort)bVar42; uVar30 = (uint)(CONCAT34((int3)(CONCAT25((short)(((uint7)bVar50 << 0x30) >> 0x28), CONCAT14(uVar47,uVar48)) >> 0x20),uVar48) >> 0x18); uVar63 = (uint5)uVar30 & 0xffff00ff00; uVar65 = CONCAT12(uVar66,uVar37) & 0xff00ff; uVar45 = (ushort)CONCAT21(uVar28,cVar44); uVar28 = uVar28 >> 8; uVar46 = (ushort)bVar56; uVar51 = (ushort)bVar74; uVar72 = psllw(0x1000100010001,2); uVar60 = *param_2; sVar76 = (short)((ulonglong)uVar72 >> 0x10); sVar77 = (short)((ulonglong)uVar72 >> 0x20); sVar78 = (short)((ulonglong)uVar72 >> 0x30); uVar57 = psraw(CONCAT26((((short)(uVar63 >> 0x18) - uVar28) * 3 + ((uVar26 >> 8) - (uVar27 >> 8))) - sVar78, CONCAT24((((short)(uVar63 >> 8) - uVar45) * 3 + ((short)CONCAT21(uVar26,(char)uVar12) - (short)CONCAT21(uVar27,(char)((uint)uVar12 >> 0x18))) ) - sVar77, CONCAT22(((((ushort)(CONCAT43(uVar30,CONCAT12(uVar43, uVar52)) >> 0x10) & 0xff) - uVar29) * 3 + ((ushort)(byte)uVar11 - (ushort)(byte)((uint)uVar11 >> 0x18))) - sVar76, (((uVar52 & 0xff) - uVar41) * 3 + ((ushort)(byte)uVar38 - (ushort)(byte)((uint)uVar38 >> 0x18))) - (short)uVar72))),3); uVar72 = psraw(CONCAT26(((bVar75 - uVar51) * 3 + ((ushort)(byte)uVar17 - (ushort)(byte)((uint)uVar17 >> 0x18))) - sVar78,CONCAT24(((bVar71 - uVar55) * 3 + ((ushort)(byte)uVar16 - (ushort)(byte)((uint)uVar16 >> 0x18))) - sVar77,CONCAT22((((byte)(uVar65 >> 0x10) - uVar46) * 3 + ((ushort)(byte)(uVar68 >> 0x10) - (ushort)(byte)(uVar64 >> 0x10))) - sVar76,(((short)uVar65 - uVar53) * 3 + ((short)uVar68 - (short)uVar64)) - (short)uVar72))),3); uVar58 = packsswb(uVar57,uVar72); uVar58 = uVar58 ^ 0xffffffffffffffff; bVar18 = (char)uVar58 < '\0'; bVar19 = (char)(uVar58 >> 8) < '\0'; bVar20 = (char)(uVar58 >> 0x10) < '\0'; bVar21 = (char)(uVar58 >> 0x18) < '\0'; bVar22 = (char)(uVar58 >> 0x20) < '\0'; bVar23 = (char)(uVar58 >> 0x28) < '\0'; bVar24 = (char)(uVar58 >> 0x30) < '\0'; uVar62 = CONCAT17(-((longlong)uVar58 < 0), CONCAT16(-bVar24,CONCAT15(-bVar23,CONCAT14(-bVar22,CONCAT13(-bVar21, CONCAT12(-bVar20,CONCAT11(-bVar19,-bVar18))))))); uVar59 = uVar58 ^ uVar62; uVar57 = CONCAT17((char)(uVar59 >> 0x38) + ((longlong)uVar58 < 0), CONCAT16((char)(uVar59 >> 0x30) + bVar24, CONCAT15((char)(uVar59 >> 0x28) + bVar23, CONCAT14((char)(uVar59 >> 0x20) + bVar22, CONCAT13((char)(uVar59 >> 0x18) + bVar21, CONCAT12((char)(uVar59 >> 0x10) + bVar20,CONCAT11((char )(uVar59 >> 8) + bVar19,(char)uVar59 + bVar18))))) )); uVar72 = paddusb(CONCAT17((char)((ulonglong)uVar60 >> 0x38) * -2 + -1, CONCAT16((char)((ulonglong)uVar60 >> 0x30) * -2 + -1, CONCAT15((char)((ulonglong)uVar60 >> 0x28) * -2 + -1,CONCAT14((char)((ulonglong)uVar60 >> 0x20) * -2 + -1, CONCAT13((char)((ulonglong) uVar60 >> 0x18 ) * -2 + -1, CONCAT12((char)(( ulonglong)uVar60 >> 0x10) * -2 + -1, CONCAT11((char)((ulonglong)uVar60 >> 8) * -2 + -1, (char)uVar60 * -2 + -1))))))),uVar57); uVar60 = paddusb(uVar57,uVar72); uVar58 = psubusb(uVar60,uVar72); uVar60 = paddusb(CONCAT17((uVar51 != 0) * (uVar51 < 0x100) * bVar74 - (0xff < uVar51), CONCAT16((bVar70 != 0) * (uVar55 < 0x100) * bVar70 - (0xff < uVar55), CONCAT15((uVar46 != 0) * (uVar46 < 0x100) * bVar56 - (0xff < uVar46), CONCAT14((uVar53 != 0) * (uVar53 < 0x100) * bVar54 - (0xff < uVar53), CONCAT13((uVar28 != 0) * (uVar28 < 0x100) * bVar49 - (0xff < uVar28) ,CONCAT12((uVar45 != 0) * (uVar45 < 0x100) * cVar44 - (0xff < uVar45), CONCAT11((uVar29 != 0) * (uVar29 < 0x100) * bVar42 - (0xff < uVar29), (uVar41 != 0) * (uVar41 < 0x100) * bVar40 - (0xff < uVar41)))))))),uVar58 & uVar62) ; uVar57 = psubusb(CONCAT44(CONCAT22((short)(CONCAT15(bVar75,CONCAT14(bVar71,uVar16)) >> 0x20),uVar37),uVar48),uVar58 & uVar62); uVar60 = psubusb(uVar60,~uVar62 & uVar58); uVar57 = paddusb(uVar57,~uVar62 & uVar58); uVar31 = CONCAT11((char)((ulonglong)uVar57 >> 0x18),(char)((ulonglong)uVar60 >> 0x18)) ; uVar37 = CONCAT11((char)((ulonglong)uVar57 >> 0x20),(char)((ulonglong)uVar60 >> 0x20)) ; uVar38 = CONCAT13((char)((ulonglong)uVar57 >> 0x28), CONCAT12((char)((ulonglong)uVar60 >> 0x28),uVar37)); uVar39 = CONCAT15((char)((ulonglong)uVar57 >> 0x30), CONCAT14((char)((ulonglong)uVar60 >> 0x30),uVar38)); *(ushort *)(iVar36 + -1) = CONCAT11((char)uVar57,(char)uVar60); *(short *)(iVar36 + -1 + iVar7) = (short)CONCAT51((int5)((ulonglong)uVar57 >> 8),(char)((ulonglong)uVar60 >> 8)); *(short *)(iVar36 + -1 + iVar7 * 2) = (short)CONCAT31(CONCAT21(uVar31,(char)((ulonglong)uVar57 >> 0x10)), (char)((ulonglong)uVar60 >> 0x10)); *(undefined2 *)(iVar36 + -1 + iVar25) = uVar31; *(undefined2 *)((int)puVar1 + iVar7 * 4 + 1) = uVar37; *(short *)((int)puVar1 + iVar7 * 5 + 1) = (short)((uint)uVar38 >> 0x10); *(short *)((int)puVar1 + iVar7 * 6 + 1) = (short)((uint6)uVar39 >> 0x20); *(short *)((int)puVar1 + iVar7 * 7 + 1) = (short)(CONCAT17((char)((ulonglong)uVar57 >> 0x38), CONCAT16((char)((ulonglong)uVar60 >> 0x38),uVar39)) >> 0x30); } if (iVar6 < local_8) { puVar34 = (undefined8 *)(iVar36 + iVar7 * -2); uVar60 = *puVar34; uVar57 = *(undefined8 *)((int)puVar34 + iVar7 * 3); uVar58 = *(ulonglong *)((int)puVar34 + iVar7); uVar72 = *(undefined8 *)((int)puVar34 + iVar7 * 2); uVar26 = (ushort)(((uint7)(byte)((ulonglong)uVar60 >> 0x18) << 0x30) >> 0x28); uVar27 = (ushort)(((uint7)(byte)((ulonglong)uVar57 >> 0x18) << 0x30) >> 0x28); bVar42 = (byte)(uVar58 >> 0x18); uVar28 = (ushort)(((uint7)bVar42 << 0x30) >> 0x28); cVar44 = (char)(uVar58 >> 0x10); bVar40 = (byte)(uVar58 >> 8); uVar41 = (ushort)bVar40; uVar45 = (ushort)uVar58 & 0xff; bVar49 = (byte)(uVar58 >> 0x20); uVar52 = (ushort)bVar49; bVar50 = (byte)(uVar58 >> 0x28); bVar54 = (byte)(uVar58 >> 0x30); bVar56 = (byte)(uVar58 >> 0x38); uVar29 = (ushort)(((uint7)(byte)((ulonglong)uVar72 >> 0x18) << 0x30) >> 0x28); uVar46 = (ushort)CONCAT21(uVar28,cVar44); uVar28 = uVar28 >> 8; uVar51 = (ushort)bVar50; uVar53 = (ushort)bVar54; uVar55 = (ushort)bVar56; uVar73 = psllw(0x1000100010001,2); uVar4 = *param_2; sVar76 = (short)((ulonglong)uVar73 >> 0x10); sVar77 = (short)((ulonglong)uVar73 >> 0x20); sVar78 = (short)((ulonglong)uVar73 >> 0x30); uVar61 = psraw(CONCAT26((((uVar29 >> 8) - uVar28) * 3 + ((uVar26 >> 8) - (uVar27 >> 8))) - sVar78, CONCAT24((((short)CONCAT21(uVar29,(char)((ulonglong)uVar72 >> 0x10)) - uVar46) * 3 + ((short)CONCAT21(uVar26,(char)((ulonglong)uVar60 >> 0x10)) - (short)CONCAT21(uVar27,(char)((ulonglong)uVar57 >> 0x10)))) - sVar77, CONCAT22((((byte)((ulonglong)uVar72 >> 8) - uVar41) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 8) - (ushort)(byte)((ulonglong)uVar57 >> 8 ))) - sVar76, ((((ushort)uVar72 & 0xff) - uVar45) * 3 + (((ushort)uVar60 & 0xff) - ((ushort)uVar57 & 0xff))) - (short)uVar73))) ,3); uVar60 = psraw(CONCAT26((((byte)((ulonglong)uVar72 >> 0x38) - uVar55) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x38) - (ushort)(byte)((ulonglong)uVar57 >> 0x38))) - sVar78, CONCAT24((((byte)((ulonglong)uVar72 >> 0x30) - uVar53) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x30) - (ushort)(byte)((ulonglong)uVar57 >> 0x30))) - sVar77, CONCAT22((((byte)((ulonglong)uVar72 >> 0x28) - uVar51 ) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x28) - (ushort)(byte)((ulonglong)uVar57 >> 0x28))) - sVar76, (((byte)((ulonglong)uVar72 >> 0x20) - uVar52 ) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x20) - (ushort)(byte)((ulonglong)uVar57 >> 0x20))) - (short)uVar73))),3); uVar59 = packsswb(uVar61,uVar60); uVar59 = uVar59 ^ 0xffffffffffffffff; bVar18 = (char)uVar59 < '\0'; bVar19 = (char)(uVar59 >> 8) < '\0'; bVar20 = (char)(uVar59 >> 0x10) < '\0'; bVar21 = (char)(uVar59 >> 0x18) < '\0'; bVar22 = (char)(uVar59 >> 0x20) < '\0'; bVar23 = (char)(uVar59 >> 0x28) < '\0'; bVar24 = (char)(uVar59 >> 0x30) < '\0'; uVar69 = CONCAT17(-((longlong)uVar59 < 0), CONCAT16(-bVar24,CONCAT15(-bVar23,CONCAT14(-bVar22,CONCAT13(-bVar21, CONCAT12(-bVar20,CONCAT11(-bVar19,-bVar18))))))); uVar62 = uVar59 ^ uVar69; uVar60 = CONCAT17((char)(uVar62 >> 0x38) + ((longlong)uVar59 < 0), CONCAT16((char)(uVar62 >> 0x30) + bVar24, CONCAT15((char)(uVar62 >> 0x28) + bVar23, CONCAT14((char)(uVar62 >> 0x20) + bVar22, CONCAT13((char)(uVar62 >> 0x18) + bVar21, CONCAT12((char)(uVar62 >> 0x10) + bVar20,CONCAT11((char )(uVar62 >> 8) + bVar19,(char)uVar62 + bVar18))))) )); uVar57 = paddusb(CONCAT17((char)((ulonglong)uVar4 >> 0x38) * -2 + -1, CONCAT16((char)((ulonglong)uVar4 >> 0x30) * -2 + -1, CONCAT15((char)((ulonglong)uVar4 >> 0x28) * -2 + -1 ,CONCAT14((char)((ulonglong)uVar4 >> 0x20) * -2 + -1, CONCAT13((char)((ulonglong)uVar4 >> 0x18) * -2 + -1,CONCAT12((char)(( ulonglong)uVar4 >> 0x10) * -2 + -1, CONCAT11((char)((ulonglong)uVar4 >> 8) * -2 + -1, (char)uVar4 * -2 + -1))))))),uVar60); uVar60 = paddusb(uVar60,uVar57); uVar59 = psubusb(uVar60,uVar57); uVar60 = paddusb(CONCAT17((bVar56 != 0) * (uVar55 < 0x100) * bVar56 - (0xff < uVar55), CONCAT16((bVar54 != 0) * (uVar53 < 0x100) * bVar54 - (0xff < uVar53), CONCAT15((bVar50 != 0) * (uVar51 < 0x100) * bVar50 - (0xff < uVar51), CONCAT14((bVar49 != 0) * (uVar52 < 0x100) * bVar49 - (0xff < uVar52), CONCAT13((uVar28 != 0) * (uVar28 < 0x100) * bVar42 - (0xff < uVar28) ,CONCAT12((uVar46 != 0) * (uVar46 < 0x100) * cVar44 - (0xff < uVar46), CONCAT11((uVar41 != 0) * (uVar41 < 0x100) * bVar40 - (0xff < uVar41), ((uVar58 & 0xff) != 0) * (uVar45 < 0x100) * (char)uVar58 - (0xff < uVar45)))))))), uVar59 & uVar69); uVar57 = psubusb(uVar72,uVar59 & uVar69); uVar60 = psubusb(uVar60,~uVar69 & uVar59); uVar57 = paddusb(uVar57,~uVar69 & uVar59); *(undefined8 *)((int)puVar34 + iVar7) = uVar60; *(undefined8 *)((int)puVar34 + iVar7 * 2) = uVar57; } if ((param_4 + 1 < iVar2) && ((param_5[4] & 1) == 0)) { puVar1 = (undefined4 *)(iVar36 + 6); uVar38 = *puVar1; uVar11 = *(undefined4 *)((int)puVar1 + iVar7); iVar25 = iVar7 * 3; uVar12 = *(undefined4 *)((int)puVar1 + iVar7 * 2); puVar3 = puVar1 + iVar7; uVar13 = *(undefined4 *)((int)puVar1 + iVar25); uVar14 = *puVar3; uVar15 = *(undefined4 *)((int)puVar3 + iVar7); uVar16 = *(undefined4 *)((int)puVar3 + iVar7 * 2); uVar17 = *(undefined4 *)((int)puVar3 + iVar25); uVar43 = (undefined1)((uint)uVar11 >> 0x10); bVar42 = (byte)((uint)uVar11 >> 8); bVar40 = (byte)((uint)uVar38 >> 8); bVar50 = (byte)((uint)uVar13 >> 0x10); uVar47 = (undefined1)((uint)uVar12 >> 0x10); bVar49 = (byte)((uint)uVar13 >> 8); cVar44 = (char)((uint)uVar12 >> 8); uVar41 = (ushort)bVar40; uVar52 = (ushort)(CONCAT15(uVar43,CONCAT14((char)((uint)uVar38 >> 0x10),uVar38)) >> 0x20); uVar48 = CONCAT22((short)(CONCAT15(bVar50,CONCAT14(uVar47,uVar12)) >> 0x20),uVar52); uVar67 = (undefined1)((uint)uVar15 >> 0x18); uVar31 = CONCAT11(uVar67,(char)((uint)uVar14 >> 0x18)); uVar66 = (undefined1)((uint)uVar15 >> 0x10); bVar56 = (byte)((uint)uVar15 >> 8); bVar54 = (byte)((uint)uVar14 >> 8); bVar75 = (byte)((uint)uVar17 >> 0x10); bVar71 = (byte)((uint)uVar16 >> 0x10); bVar74 = (byte)((uint)uVar17 >> 8); bVar70 = (byte)((uint)uVar16 >> 8); uVar55 = (ushort)bVar70; uVar53 = (ushort)bVar54; uVar37 = (undefined2) (CONCAT35(CONCAT21(uVar31,uVar66), CONCAT14((char)((uint)uVar14 >> 0x10),uVar14)) >> 0x20); uVar26 = (ushort)(((uint7)(byte)uVar13 << 0x30) >> 0x28); uVar68 = CONCAT12((char)uVar15,CONCAT11((char)uVar15,(char)uVar14)) & 0xff00ff; uVar27 = (ushort)(((uint7)(byte)((uint)uVar13 >> 0x18) << 0x30) >> 0x28); uVar64 = CONCAT12(uVar67,uVar31) & 0xff00ff; uVar28 = (ushort)(((uint7)bVar49 << 0x30) >> 0x28); uVar29 = (ushort)bVar42; uVar30 = (uint)(CONCAT34((int3)(CONCAT25((short)(((uint7)bVar50 << 0x30) >> 0x28), CONCAT14(uVar47,uVar48)) >> 0x20),uVar48) >> 0x18); uVar63 = (uint5)uVar30 & 0xffff00ff00; uVar65 = CONCAT12(uVar66,uVar37) & 0xff00ff; uVar45 = (ushort)CONCAT21(uVar28,cVar44); uVar28 = uVar28 >> 8; uVar46 = (ushort)bVar56; uVar51 = (ushort)bVar74; uVar72 = psllw(0x1000100010001,2); uVar60 = *param_2; sVar76 = (short)((ulonglong)uVar72 >> 0x10); sVar77 = (short)((ulonglong)uVar72 >> 0x20); sVar78 = (short)((ulonglong)uVar72 >> 0x30); uVar57 = psraw(CONCAT26((((short)(uVar63 >> 0x18) - uVar28) * 3 + ((uVar26 >> 8) - (uVar27 >> 8))) - sVar78, CONCAT24((((short)(uVar63 >> 8) - uVar45) * 3 + ((short)CONCAT21(uVar26,(char)uVar12) - (short)CONCAT21(uVar27,(char)((uint)uVar12 >> 0x18))) ) - sVar77, CONCAT22(((((ushort)(CONCAT43(uVar30,CONCAT12(uVar43, uVar52)) >> 0x10) & 0xff) - uVar29) * 3 + ((ushort)(byte)uVar11 - (ushort)(byte)((uint)uVar11 >> 0x18))) - sVar76, (((uVar52 & 0xff) - uVar41) * 3 + ((ushort)(byte)uVar38 - (ushort)(byte)((uint)uVar38 >> 0x18))) - (short)uVar72))),3); uVar72 = psraw(CONCAT26(((bVar75 - uVar51) * 3 + ((ushort)(byte)uVar17 - (ushort)(byte)((uint)uVar17 >> 0x18))) - sVar78,CONCAT24(((bVar71 - uVar55) * 3 + ((ushort)(byte)uVar16 - (ushort)(byte)((uint)uVar16 >> 0x18))) - sVar77,CONCAT22((((byte)(uVar65 >> 0x10) - uVar46) * 3 + ((ushort)(byte)(uVar68 >> 0x10) - (ushort)(byte)(uVar64 >> 0x10))) - sVar76,(((short)uVar65 - uVar53) * 3 + ((short)uVar68 - (short)uVar64)) - (short)uVar72))),3); uVar58 = packsswb(uVar57,uVar72); uVar58 = uVar58 ^ 0xffffffffffffffff; bVar18 = (char)uVar58 < '\0'; bVar19 = (char)(uVar58 >> 8) < '\0'; bVar20 = (char)(uVar58 >> 0x10) < '\0'; bVar21 = (char)(uVar58 >> 0x18) < '\0'; bVar22 = (char)(uVar58 >> 0x20) < '\0'; bVar23 = (char)(uVar58 >> 0x28) < '\0'; bVar24 = (char)(uVar58 >> 0x30) < '\0'; uVar62 = CONCAT17(-((longlong)uVar58 < 0), CONCAT16(-bVar24,CONCAT15(-bVar23,CONCAT14(-bVar22,CONCAT13(-bVar21, CONCAT12(-bVar20,CONCAT11(-bVar19,-bVar18))))))); uVar59 = uVar58 ^ uVar62; uVar57 = CONCAT17((char)(uVar59 >> 0x38) + ((longlong)uVar58 < 0), CONCAT16((char)(uVar59 >> 0x30) + bVar24, CONCAT15((char)(uVar59 >> 0x28) + bVar23, CONCAT14((char)(uVar59 >> 0x20) + bVar22, CONCAT13((char)(uVar59 >> 0x18) + bVar21, CONCAT12((char)(uVar59 >> 0x10) + bVar20,CONCAT11((char )(uVar59 >> 8) + bVar19,(char)uVar59 + bVar18))))) )); uVar72 = paddusb(CONCAT17((char)((ulonglong)uVar60 >> 0x38) * -2 + -1, CONCAT16((char)((ulonglong)uVar60 >> 0x30) * -2 + -1, CONCAT15((char)((ulonglong)uVar60 >> 0x28) * -2 + -1,CONCAT14((char)((ulonglong)uVar60 >> 0x20) * -2 + -1, CONCAT13((char)((ulonglong) uVar60 >> 0x18 ) * -2 + -1, CONCAT12((char)(( ulonglong)uVar60 >> 0x10) * -2 + -1, CONCAT11((char)((ulonglong)uVar60 >> 8) * -2 + -1, (char)uVar60 * -2 + -1))))))),uVar57); uVar60 = paddusb(uVar57,uVar72); uVar58 = psubusb(uVar60,uVar72); uVar60 = paddusb(CONCAT17((uVar51 != 0) * (uVar51 < 0x100) * bVar74 - (0xff < uVar51), CONCAT16((bVar70 != 0) * (uVar55 < 0x100) * bVar70 - (0xff < uVar55), CONCAT15((uVar46 != 0) * (uVar46 < 0x100) * bVar56 - (0xff < uVar46), CONCAT14((uVar53 != 0) * (uVar53 < 0x100) * bVar54 - (0xff < uVar53), CONCAT13((uVar28 != 0) * (uVar28 < 0x100) * bVar49 - (0xff < uVar28) ,CONCAT12((uVar45 != 0) * (uVar45 < 0x100) * cVar44 - (0xff < uVar45), CONCAT11((uVar29 != 0) * (uVar29 < 0x100) * bVar42 - (0xff < uVar29), (uVar41 != 0) * (uVar41 < 0x100) * bVar40 - (0xff < uVar41)))))))),uVar58 & uVar62) ; uVar57 = psubusb(CONCAT44(CONCAT22((short)(CONCAT15(bVar75,CONCAT14(bVar71,uVar16)) >> 0x20),uVar37),uVar48),uVar58 & uVar62); uVar60 = psubusb(uVar60,~uVar62 & uVar58); uVar57 = paddusb(uVar57,~uVar62 & uVar58); uVar31 = CONCAT11((char)((ulonglong)uVar57 >> 0x18),(char)((ulonglong)uVar60 >> 0x18)) ; uVar37 = CONCAT11((char)((ulonglong)uVar57 >> 0x20),(char)((ulonglong)uVar60 >> 0x20)) ; uVar38 = CONCAT13((char)((ulonglong)uVar57 >> 0x28), CONCAT12((char)((ulonglong)uVar60 >> 0x28),uVar37)); uVar39 = CONCAT15((char)((ulonglong)uVar57 >> 0x30), CONCAT14((char)((ulonglong)uVar60 >> 0x30),uVar38)); *(ushort *)(iVar36 + 7) = CONCAT11((char)uVar57,(char)uVar60); *(short *)(iVar36 + 7 + iVar7) = (short)CONCAT51((int5)((ulonglong)uVar57 >> 8),(char)((ulonglong)uVar60 >> 8)); *(short *)(iVar36 + 7 + iVar7 * 2) = (short)CONCAT31(CONCAT21(uVar31,(char)((ulonglong)uVar57 >> 0x10)), (char)((ulonglong)uVar60 >> 0x10)); *(undefined2 *)(iVar36 + 7 + iVar25) = uVar31; *(undefined2 *)((int)puVar1 + iVar7 * 4 + 1) = uVar37; *(short *)((int)puVar1 + iVar7 * 5 + 1) = (short)((uint)uVar38 >> 0x10); *(short *)((int)puVar1 + iVar7 * 6 + 1) = (short)((uint6)uVar39 >> 0x20); *(short *)((int)puVar1 + iVar7 * 7 + 1) = (short)(CONCAT17((char)((ulonglong)uVar57 >> 0x38), CONCAT16((char)((ulonglong)uVar60 >> 0x38),uVar39)) >> 0x30); } if ((param_4 + iVar5 < iVar32 + iVar6) && ((*pbVar35 & 1) == 0)) { puVar34 = (undefined8 *)(iVar36 + iVar7 * 6); uVar60 = *puVar34; uVar57 = *(undefined8 *)((int)puVar34 + iVar7 * 3); uVar58 = *(ulonglong *)((int)puVar34 + iVar7); uVar72 = *(undefined8 *)((int)puVar34 + iVar7 * 2); uVar26 = (ushort)(((uint7)(byte)((ulonglong)uVar60 >> 0x18) << 0x30) >> 0x28); uVar27 = (ushort)(((uint7)(byte)((ulonglong)uVar57 >> 0x18) << 0x30) >> 0x28); bVar42 = (byte)(uVar58 >> 0x18); uVar28 = (ushort)(((uint7)bVar42 << 0x30) >> 0x28); cVar44 = (char)(uVar58 >> 0x10); bVar40 = (byte)(uVar58 >> 8); uVar41 = (ushort)bVar40; uVar45 = (ushort)uVar58 & 0xff; bVar49 = (byte)(uVar58 >> 0x20); uVar52 = (ushort)bVar49; bVar50 = (byte)(uVar58 >> 0x28); bVar54 = (byte)(uVar58 >> 0x30); bVar56 = (byte)(uVar58 >> 0x38); uVar29 = (ushort)(((uint7)(byte)((ulonglong)uVar72 >> 0x18) << 0x30) >> 0x28); uVar46 = (ushort)CONCAT21(uVar28,cVar44); uVar28 = uVar28 >> 8; uVar51 = (ushort)bVar50; uVar53 = (ushort)bVar54; uVar55 = (ushort)bVar56; uVar73 = psllw(0x1000100010001,2); uVar4 = *param_2; sVar76 = (short)((ulonglong)uVar73 >> 0x10); sVar77 = (short)((ulonglong)uVar73 >> 0x20); sVar78 = (short)((ulonglong)uVar73 >> 0x30); uVar61 = psraw(CONCAT26((((uVar29 >> 8) - uVar28) * 3 + ((uVar26 >> 8) - (uVar27 >> 8))) - sVar78, CONCAT24((((short)CONCAT21(uVar29,(char)((ulonglong)uVar72 >> 0x10)) - uVar46) * 3 + ((short)CONCAT21(uVar26,(char)((ulonglong)uVar60 >> 0x10)) - (short)CONCAT21(uVar27,(char)((ulonglong)uVar57 >> 0x10)))) - sVar77, CONCAT22((((byte)((ulonglong)uVar72 >> 8) - uVar41) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 8) - (ushort)(byte)((ulonglong)uVar57 >> 8 ))) - sVar76, ((((ushort)uVar72 & 0xff) - uVar45) * 3 + (((ushort)uVar60 & 0xff) - ((ushort)uVar57 & 0xff))) - (short)uVar73))) ,3); uVar60 = psraw(CONCAT26((((byte)((ulonglong)uVar72 >> 0x38) - uVar55) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x38) - (ushort)(byte)((ulonglong)uVar57 >> 0x38))) - sVar78, CONCAT24((((byte)((ulonglong)uVar72 >> 0x30) - uVar53) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x30) - (ushort)(byte)((ulonglong)uVar57 >> 0x30))) - sVar77, CONCAT22((((byte)((ulonglong)uVar72 >> 0x28) - uVar51 ) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x28) - (ushort)(byte)((ulonglong)uVar57 >> 0x28))) - sVar76, (((byte)((ulonglong)uVar72 >> 0x20) - uVar52 ) * 3 + ((ushort)(byte)((ulonglong)uVar60 >> 0x20) - (ushort)(byte)((ulonglong)uVar57 >> 0x20))) - (short)uVar73))),3); uVar59 = packsswb(uVar61,uVar60); uVar59 = uVar59 ^ 0xffffffffffffffff; bVar18 = (char)uVar59 < '\0'; bVar19 = (char)(uVar59 >> 8) < '\0'; bVar20 = (char)(uVar59 >> 0x10) < '\0'; bVar21 = (char)(uVar59 >> 0x18) < '\0'; bVar22 = (char)(uVar59 >> 0x20) < '\0'; bVar23 = (char)(uVar59 >> 0x28) < '\0'; bVar24 = (char)(uVar59 >> 0x30) < '\0'; uVar69 = CONCAT17(-((longlong)uVar59 < 0), CONCAT16(-bVar24,CONCAT15(-bVar23,CONCAT14(-bVar22,CONCAT13(-bVar21, CONCAT12(-bVar20,CONCAT11(-bVar19,-bVar18))))))); uVar62 = uVar59 ^ uVar69; uVar60 = CONCAT17((char)(uVar62 >> 0x38) + ((longlong)uVar59 < 0), CONCAT16((char)(uVar62 >> 0x30) + bVar24, CONCAT15((char)(uVar62 >> 0x28) + bVar23, CONCAT14((char)(uVar62 >> 0x20) + bVar22, CONCAT13((char)(uVar62 >> 0x18) + bVar21, CONCAT12((char)(uVar62 >> 0x10) + bVar20,CONCAT11((char )(uVar62 >> 8) + bVar19,(char)uVar62 + bVar18))))) )); uVar57 = paddusb(CONCAT17((char)((ulonglong)uVar4 >> 0x38) * -2 + -1, CONCAT16((char)((ulonglong)uVar4 >> 0x30) * -2 + -1, CONCAT15((char)((ulonglong)uVar4 >> 0x28) * -2 + -1 ,CONCAT14((char)((ulonglong)uVar4 >> 0x20) * -2 + -1, CONCAT13((char)((ulonglong)uVar4 >> 0x18) * -2 + -1,CONCAT12((char)(( ulonglong)uVar4 >> 0x10) * -2 + -1, CONCAT11((char)((ulonglong)uVar4 >> 8) * -2 + -1, (char)uVar4 * -2 + -1))))))),uVar60); uVar60 = paddusb(uVar60,uVar57); uVar59 = psubusb(uVar60,uVar57); uVar60 = paddusb(CONCAT17((bVar56 != 0) * (uVar55 < 0x100) * bVar56 - (0xff < uVar55), CONCAT16((bVar54 != 0) * (uVar53 < 0x100) * bVar54 - (0xff < uVar53), CONCAT15((bVar50 != 0) * (uVar51 < 0x100) * bVar50 - (0xff < uVar51), CONCAT14((bVar49 != 0) * (uVar52 < 0x100) * bVar49 - (0xff < uVar52), CONCAT13((uVar28 != 0) * (uVar28 < 0x100) * bVar42 - (0xff < uVar28) ,CONCAT12((uVar46 != 0) * (uVar46 < 0x100) * cVar44 - (0xff < uVar46), CONCAT11((uVar41 != 0) * (uVar41 < 0x100) * bVar40 - (0xff < uVar41), ((uVar58 & 0xff) != 0) * (uVar45 < 0x100) * (char)uVar58 - (0xff < uVar45)))))))), uVar59 & uVar69); uVar57 = psubusb(uVar72,uVar59 & uVar69); uVar60 = psubusb(uVar60,~uVar69 & uVar59); uVar57 = paddusb(uVar57,~uVar69 & uVar59); *(undefined8 *)((int)puVar34 + iVar7) = uVar60; *(undefined8 *)((int)puVar34 + iVar7 * 2) = uVar57; } } param_4 = param_4 + 1; param_5 = param_5 + 4; pbVar35 = pbVar35 + 4; } while (param_4 < iVar2); } local_14 = local_14 + iVar5 * 4; param_3 = param_3 + iVar5 * 4; local_8 = iVar2; } while (iVar2 < iVar33); } return; } //@@ 00ae59b0 FUN_00ae59b0 int FUN_00ae59b0(uint param_1,uint param_2,int param_3,undefined1 *param_4,undefined1 *param_5, undefined1 *param_6,undefined1 *param_7,int param_8,undefined4 *param_9,int param_10 ) { undefined1 *puVar1; char cVar2; undefined4 uVar3; int iVar4; int iVar5; int *piVar6; undefined1 *puVar7; iVar5 = param_10; puVar1 = param_6; *param_9 = 0; puVar7 = (undefined1 *)((int)¶m_6 + 3); if (param_5 != (undefined1 *)0x0) { puVar7 = param_5; } *param_7 = 0; param_6 = (undefined1 *)((uint)param_6 & 0xffffff); *puVar1 = 0; if (DAT_00c69da8 == 1) { uVar3 = 0; } else { uVar3 = FUN_00ae88d0(param_10); } if ((((0x1fffff < param_1) && (param_2 < 0x400001)) && (param_3 == 0)) && (iVar4 = FUN_00ae5d10(uVar3,param_1,param_2,param_4,puVar7,puVar1,param_7,param_8,param_9,iVar5 ), iVar4 != 0)) { return iVar4; } cVar2 = FUN_00ae8090(0x11); if ((cVar2 == '\0') && (param_8 == 0)) { *param_7 = 1; *param_9 = 0; iVar5 = FUN_00ae81b0(param_1,param_2,param_3,*param_4,puVar7,*(undefined4 *)(iVar5 + 4)); if (iVar5 != 0) { *puVar1 = *puVar7; return iVar5; } } else { piVar6 = _errno(); *piVar6 = 0xc; } return 0; } //@@ 00ae5a90 FUN_00ae5a90 void FUN_00ae5a90(int param_1,int param_2,undefined4 param_3,undefined4 param_4,uint param_5, undefined4 param_6,undefined4 param_7) { char cVar1; uint uVar2; uint uVar3; int iVar4; if ((param_1 != 0) && (param_2 != 0)) { if (param_5 == 0) { FUN_00ae84f0(param_1,param_2,param_3,param_4,param_6,param_7); return; } iVar4 = 0x100; if ((param_5 & 0x7f) != 0) { iVar4 = (param_5 & 0x7f) * 4 + -4; } iVar4 = *(int *)((int)&DAT_00c61c80 + iVar4); uVar2 = param_2 + 0x3fffffU >> 0x16; if (iVar4 == 0) { FUN_00ae7510(0x16,"trying to free from non-existent arena: %p, size %zu, memid: 0x%zx\n", param_1,param_2,param_5); return; } uVar3 = *(uint *)(iVar4 + 0x10); if (uVar3 <= param_5 >> 0xd) { FUN_00ae7510(0x16,"trying to free from non-existent arena block: %p, size %zu, memid: 0x%zx\n" ,param_1,param_2,param_5); return; } if ((*(char *)(iVar4 + 0x19) != '\0') && (*(int *)(iVar4 + 0x24) != 0)) { FUN_00ae8400(param_1,uVar2 << 0x16,param_7); FUN_00ae95f0(*(undefined4 *)(iVar4 + 0x24),*(undefined4 *)(iVar4 + 0x10),uVar2,param_5 >> 8); uVar3 = *(uint *)(iVar4 + 0x10); } cVar1 = FUN_00ae95f0(iVar4 + 0x28,uVar3,uVar2,param_5 >> 8); if (cVar1 == '\0') { FUN_00ae7510(0xb,"trying to free an already freed block: %p, size %zu\n",param_1,param_2); } } return; } //@@ 00ae5ba0 FUN_00ae5ba0 undefined4 FUN_00ae5ba0(uint param_1,uint param_2) { if ((((param_1 >> 7 & 1) == 0) && (param_2 == 0)) || ((param_1 & 0x7f) == param_2)) { return 1; } return 0; } //@@ 00ae5bd0 FUN_00ae5bd0 int FUN_00ae5bd0(byte *param_1,undefined4 param_2,int param_3,char *param_4,byte *param_5, undefined1 *param_6,undefined1 *param_7,int param_8,uint *param_9,int param_10) { int iVar1; byte *pbVar2; int iVar3; char *pcVar4; char cVar5; undefined1 uVar6; uint uVar7; int iVar8; uint local_c; char local_5; iVar3 = param_3; pbVar2 = param_1; if (((param_1[4] == 0) && (param_8 == 0)) || (*(int *)param_1 == param_8)) { cVar5 = FUN_00ae9280(param_1 + 0x28,*(undefined4 *)(param_1 + 0x10),0,param_3,&local_c); if (cVar5 != '\0') { *(uint *)(pbVar2 + 0x1c) = local_c >> 5; iVar8 = local_c * 0x400000 + *(int *)(pbVar2 + 8); uVar7 = 0; if (pbVar2[4] != 0) { uVar7 = 0x80; } *param_9 = *pbVar2 & 0x7f | uVar7 | local_c << 8; uVar6 = FUN_00ae8fb0(*(undefined4 *)(pbVar2 + 0x20),*(undefined4 *)(pbVar2 + 0x10),iVar3, local_c,0); pcVar4 = param_4; *param_7 = uVar6; *param_5 = pbVar2[0x1a]; if ((pbVar2[0x1a] == 0) && (pbVar2[0x19] != 0)) { uVar6 = 0; } else { uVar6 = 1; } *param_6 = uVar6; iVar1 = *(int *)(pbVar2 + 0x24); if (iVar1 == 0) { *param_4 = '\x01'; return iVar8; } if (*param_4 == '\0') { cVar5 = FUN_00ae9090(iVar1,*(undefined4 *)(pbVar2 + 0x10),iVar3,local_c); *pcVar4 = cVar5; } else { FUN_00ae8fb0(iVar1,*(undefined4 *)(pbVar2 + 0x10),iVar3,local_c,(int)¶m_1 + 3); if (param_1._3_1_ != '\0') { FUN_00ae8330(iVar8,iVar3 << 0x16,&local_5,*(undefined4 *)(param_10 + 4)); if (local_5 != '\0') { *param_7 = 1; return iVar8; } } } return iVar8; } } return 0; } //@@ 00ae5d10 FUN_00ae5d10 int FUN_00ae5d10(int param_1,int param_2,undefined4 param_3,undefined4 param_4,char *param_5, undefined4 param_6,undefined4 param_7,int param_8,undefined4 param_9, undefined4 param_10) { uint uVar1; int iVar2; uint uVar3; uint uVar4; uVar1 = DAT_00c61d80; uVar3 = param_2 + 0x3fffffU >> 0x16; if (DAT_00c61d80 != 0) { if ((param_8 < 1) || (uVar4 = param_8 - 1, 0x3f < uVar4)) { uVar4 = 0; if (DAT_00c61d80 != 0) { do { iVar2 = (&DAT_00c61c80)[uVar4]; if (iVar2 == 0) break; if ((((*(int *)(iVar2 + 0x14) < 0) || (*(int *)(iVar2 + 0x14) == param_1)) && ((*param_5 != '\0' || (*(char *)(iVar2 + 0x1a) == '\0')))) && (iVar2 = FUN_00ae5bd0(iVar2,uVar4,uVar3,param_4,param_5,param_6,param_7,param_8,param_9 ,param_10), iVar2 != 0)) { return iVar2; } uVar4 = uVar4 + 1; } while (uVar4 < uVar1); uVar4 = 0; do { iVar2 = (&DAT_00c61c80)[uVar4]; if (iVar2 == 0) { return 0; } if (((-1 < *(int *)(iVar2 + 0x14)) && (*(int *)(iVar2 + 0x14) != param_1)) && (((*param_5 != '\0' || (*(char *)(iVar2 + 0x1a) == '\0')) && (iVar2 = FUN_00ae5bd0(iVar2,uVar4,uVar3,param_4,param_5,param_6,param_7,param_8, param_9,param_10), iVar2 != 0)))) { return iVar2; } uVar4 = uVar4 + 1; } while (uVar4 < uVar1); } } else { iVar2 = (&DAT_00c61c80)[uVar4]; if ((((iVar2 != 0) && ((*(int *)(iVar2 + 0x14) < 0 || (*(int *)(iVar2 + 0x14) == param_1)))) && ((*param_5 != '\0' || (*(char *)(iVar2 + 0x1a) == '\0')))) && (iVar2 = FUN_00ae5bd0(iVar2,uVar4,uVar3,param_4,param_5,param_6,param_7,param_8,param_9, param_10), iVar2 != 0)) { return iVar2; } } } return 0; } //@@ 00ae5e40 mi_manage_os_memory_ex /* DB: mimalloc arena.c (start, size, is_committed, is_large, is_zero, numa_node, exclusive, arena_id*): size >> 22 blocks (MI_ARENA_BLOCK_SIZE 4MiB), allocates the arena with bitmaps from _mi_stats_main, registers it; callers mi_reserve_os_memory_ex and 00ae6300 */ uint mi_manage_os_memory_ex (int param_1,uint param_2,byte param_3,char param_4,undefined1 param_5,int param_6, undefined1 param_7,int *param_8) { int *_Dst; undefined4 *puVar1; undefined1 uVar2; int *piVar3; void *pvVar4; int iVar5; uint uVar6; uint uVar7; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; pvVar4 = ExceptionList; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; if (param_8 != (int *)0x0) { ExceptionList = &local_10; *param_8 = 0; } if (0x3fffff < param_2) { uVar6 = 1; if (param_4 == '\0') { uVar6 = (uint)param_3; } param_2 = param_2 >> 0x16; uVar7 = param_2 + 0x1f >> 5; piVar3 = (int *)FUN_00ae8110(((uVar6 ^ 1) + 2) * uVar7 * 4 + 0x2c,&_mi_stats_main); pvVar4 = (void *)0x0; if (piVar3 != (int *)0x0) { *(undefined1 *)(piVar3 + 1) = param_7; piVar3[3] = param_2; *piVar3 = 0; piVar3[4] = uVar7; LOCK(); piVar3[2] = param_1; UNLOCK(); piVar3[5] = param_6; *(char *)((int)piVar3 + 0x1a) = param_4; *(undefined1 *)(piVar3 + 6) = param_5; if ((param_4 == '\0') && ((char)uVar6 == '\0')) { uVar2 = 1; } else { uVar2 = 0; } *(undefined1 *)((int)piVar3 + 0x19) = uVar2; LOCK(); piVar3[7] = 0; UNLOCK(); piVar3[8] = (int)(piVar3 + uVar7 + 10); if (*(char *)((int)piVar3 + 0x19) == '\0') { piVar3[9] = 0; } else { _Dst = piVar3 + (uVar7 + 5) * 2; piVar3[9] = (int)_Dst; if ((_Dst != (int *)0x0) && ((char)uVar6 != '\0')) { memset(_Dst,0xff,uVar7 * 4); } } iVar5 = uVar7 * 0x20 - param_2; if (0 < iVar5) { FUN_00ae8f50(piVar3 + 10,uVar7,iVar5,uVar7 * 0x20 - iVar5,0); } if (param_8 != (int *)0x0) { *param_8 = -1; } uVar6 = (uint)DAT_00c61d80; LOCK(); pvVar4 = (void *)((int)DAT_00c61d80 + 1); UNLOCK(); if (DAT_00c61d80 < 0x40) { puVar1 = &DAT_00c61c80 + (int)DAT_00c61d80; DAT_00c61d80 = pvVar4; *puVar1 = piVar3; iVar5 = uVar6 + 1; *piVar3 = iVar5; if (param_8 != (int *)0x0) { *param_8 = iVar5; } ExceptionList = local_10; return CONCAT31((int3)((uint)iVar5 >> 8),1); } LOCK(); UNLOCK(); } } ExceptionList = local_10; return (uint)pvVar4 & 0xffffff00; } //@@ 00ae5fd0 FUN_00ae5fd0 void FUN_00ae5fd0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { mi_reserve_huge_os_pages_at_ex(param_1,param_2,param_3,0,0); return; } //@@ 00ae5ff0 mi_reserve_huge_os_pages_at_ex /* DB: mimalloc arena.c: (pages, numa_node, timeout_msecs, exclusive, arena_id*), 'failed to reserve %%zu GiB huge pages', 'numa node %%i: reserved %%zu GiB huge pages (of the %%zu GiB requested)'; callers mi_reserve_huge_os_pages_at (0xae5fd0) and _interleave (0xae6230) */ undefined4 mi_reserve_huge_os_pages_at_ex (int param_1,uint param_2,undefined4 param_3,undefined1 param_4,int *param_5) { int *_Dst; undefined4 *puVar1; bool bVar2; void *pvVar3; int *piVar4; uint uVar5; int iVar6; int *piVar7; int iVar8; uint uVar9; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; piVar4 = param_5; iVar8 = param_1; pvVar3 = ExceptionList; local_8 = 0xffffffff; puStack_c = &LAB_00b15160; local_10 = ExceptionList; ExceptionList = &local_10; if (param_5 != (int *)0x0) { ExceptionList = &local_10; *param_5 = -1; } if (param_1 == 0) { ExceptionList = pvVar3; return 0; } local_14 = 0xffffffff; if (-2 < (int)param_2) { local_14 = param_2; } if (-1 < (int)local_14) { uVar5 = DAT_00c69da8; if (DAT_00c69da8 == 0) { uVar5 = FUN_00ae8820(); } local_14 = local_14 % uVar5; } param_5 = (int *)0x0; param_1 = 0; iVar6 = FUN_00ae8300(iVar8,local_14,param_3,0,¶m_1,¶m_5); if ((iVar6 == 0) || (param_1 == 0)) { FUN_00ae79e0("failed to reserve %zu GiB huge pages\n",iVar8); } else { FUN_00ae7930("numa node %i: reserved %zu GiB huge pages (of the %zu GiB requested)\n",local_14, param_1,iVar8); local_8 = 0; if (piVar4 != (int *)0x0) { *piVar4 = 0; } if (param_5 < 0x400000) { bVar2 = false; } else { uVar9 = (uint)param_5 >> 0x16; uVar5 = uVar9 + 0x1f >> 5; piVar7 = (int *)FUN_00ae8110(uVar5 * 8 + 0x2c,&_mi_stats_main); if (piVar7 == (int *)0x0) { bVar2 = false; } else { *(undefined1 *)(piVar7 + 1) = param_4; *piVar7 = 0; piVar7[3] = uVar9; piVar7[4] = uVar5; LOCK(); piVar7[2] = iVar6; UNLOCK(); piVar7[5] = local_14; *(undefined2 *)((int)piVar7 + 0x19) = 0x100; *(undefined1 *)(piVar7 + 6) = 1; LOCK(); piVar7[7] = 0; UNLOCK(); piVar7[8] = (int)(piVar7 + uVar5 + 10); if (*(char *)((int)piVar7 + 0x19) == '\0') { piVar7[9] = 0; } else { _Dst = piVar7 + (uVar5 + 5) * 2; piVar7[9] = (int)_Dst; if (_Dst != (int *)0x0) { memset(_Dst,0xff,uVar5 * 4); } } iVar8 = uVar5 * 0x20 - uVar9; if (0 < iVar8) { FUN_00ae8f50(piVar7 + 10,uVar5,iVar8,uVar5 * 0x20 - iVar8,0); } if (piVar4 != (int *)0x0) { *piVar4 = -1; } uVar5 = DAT_00c61d80; LOCK(); UNLOCK(); if (DAT_00c61d80 < 0x40) { puVar1 = &DAT_00c61c80 + DAT_00c61d80; DAT_00c61d80 = DAT_00c61d80 + 1; *puVar1 = piVar7; *piVar7 = uVar5 + 1; if (piVar4 != (int *)0x0) { *piVar4 = uVar5 + 1; } bVar2 = true; } else { LOCK(); UNLOCK(); bVar2 = false; } } } local_8 = 0xffffffff; if (bVar2) { ExceptionList = local_10; return 0; } FUN_00ae8580(iVar6,param_5,&_mi_stats_main); } ExceptionList = local_10; return 0xc; } //@@ 00ae6230 FUN_00ae6230 int FUN_00ae6230(uint param_1,uint param_2,uint param_3) { uint uVar1; int iVar2; uint uVar3; uint uVar4; uint uVar5; uint uVar6; bool bVar7; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uVar3 = param_1; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; if (param_1 != 0) { ExceptionList = &local_10; if (((param_2 == 0) && (param_2 = DAT_00c69da8, ExceptionList = &local_10, DAT_00c69da8 == 0)) && (ExceptionList = &local_10, param_2 = FUN_00ae8820(), param_2 == 0)) { param_2 = 1; } uVar1 = param_1 / param_2; uVar5 = param_1 % param_2; if (param_3 == 0) { local_14 = param_3; } else { local_14 = param_3 / param_2 + 0x32; if (param_2 == 0) { ExceptionList = local_10; return 0; } } param_1 = 0; do { if (uVar3 == 0) { ExceptionList = local_10; return 0; } uVar6 = uVar1 + 1; if (uVar5 <= param_1) { uVar6 = uVar1; } iVar2 = mi_reserve_huge_os_pages_at_ex(uVar6,param_1,local_14,0,0); if (iVar2 != 0) { ExceptionList = local_10; return iVar2; } uVar4 = uVar3 - uVar6; param_1 = param_1 + 1; bVar7 = uVar6 <= uVar3; uVar3 = 0; if (bVar7) { uVar3 = uVar4; } } while (param_1 < param_2); } ExceptionList = local_10; return 0; } //@@ 00ae6300 FUN_00ae6300 undefined4 FUN_00ae6300(int param_1,undefined4 param_2,undefined4 param_3) { char cVar1; int iVar2; undefined4 uVar3; char *pcVar4; uint uVar5; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00b15160; local_10 = ExceptionList; uVar5 = param_1 + 0x3fffffU & 0xffc00000; local_8 = 0; ExceptionList = &local_10; iVar2 = FUN_00ae8140(uVar5,0x400000,param_2,¶m_3,&_mi_stats_main); if (iVar2 != 0) { if (((char)param_3 == '\0') && ((char)param_2 == '\0')) { uVar3 = 0; } else { uVar3 = 1; } uVar6 = uVar5 + 0x3ff >> 10; cVar1 = mi_manage_os_memory_ex(iVar2,uVar5,uVar3,param_3,1,0xffffffff,0,0); if (cVar1 != '\0') { pcVar4 = " (in large os pages)"; if ((char)param_3 == '\0') { pcVar4 = (char *)&s_empty; } FUN_00ae7930("reserved %zu KiB memory%s\n",uVar6,pcVar4); ExceptionList = local_10; return 0; } FUN_00ae8550(iVar2,uVar5,param_2,&_mi_stats_main); FUN_00ae7930("failed to reserve %zu k memory\n",uVar6); } ExceptionList = local_10; return 0xc; } //@@ 00ae6400 mi_reserve_os_memory_ex /* DB: mimalloc: own strings "reserved %zu KiB memory%s" / "failed to reserve %zu k memory" / " (in large os pages)": rounds size to 4 MiB, _mi_os_alloc_aligned, registers an arena (FUN_00ae5e40), returns 0 or ENOMEM 12; called once at startup by FontKerningPair::IsaacStartup */ undefined4 mi_reserve_os_memory_ex (int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined4 *param_5) { undefined4 *puVar1; char cVar2; undefined4 uVar3; char *pcVar4; uint uVar5; uint uVar6; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; puVar1 = param_5; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; if (param_5 != (undefined4 *)0x0) { ExceptionList = &local_10; *param_5 = 0; } uVar6 = param_1 + 0x3fffffU & 0xffc00000; param_5 = (undefined4 *)FUN_00ae8140(uVar6,0x400000,param_2,¶m_3,&_mi_stats_main); if (param_5 != (undefined4 *)0x0) { if (((char)param_3 == '\0') && ((char)param_2 == '\0')) { uVar3 = 0; } else { uVar3 = 1; } uVar5 = uVar6 + 0x3ff >> 10; cVar2 = mi_manage_os_memory_ex(param_5,uVar6,uVar3,param_3,1,0xffffffff,param_4,puVar1); if (cVar2 != '\0') { pcVar4 = " (in large os pages)"; if ((char)param_3 == '\0') { pcVar4 = (char *)&s_empty; } FUN_00ae7930("reserved %zu KiB memory%s\n",uVar5,pcVar4); ExceptionList = local_10; return 0; } FUN_00ae8550(param_5,uVar6,param_2,&_mi_stats_main); FUN_00ae7930("failed to reserve %zu k memory\n",uVar5); } ExceptionList = local_10; return 0xc; } //@@ 00ae6510 FUN_00ae6510 void FUN_00ae6510(int *param_1) { char cVar1; int local_8; local_8 = 2; if ((param_1 != (int *)0x0) && (param_1 != &DAT_00bf8240)) { FUN_00aecdf0(param_1,1); if (local_8 == 1) { cVar1 = FUN_00ae9b10(); if (((cVar1 != '\0') && (*(int **)(*param_1 + 0xc) == param_1)) && ((char)param_1[399] == '\0')) { FUN_00aeb0f0(param_1,*param_1 + 0x14); } } if (local_8 == 2) { FUN_00ae6850(param_1,FUN_00ae6830,0,0); } FUN_00aecf20(param_1); FUN_00aece40(param_1,1); FUN_00ae6850(param_1,FUN_00ae67e0,&local_8,0); FUN_00aeb040(param_1,local_8 == 1,*param_1 + 0x14); guard_check_icall(*param_1 + 0x14); thunk_FUN_00aeae80(local_8 == 1,*param_1 + 0x1dc); FUN_00ae9b10(); } return; } //@@ 00ae65f0 FUN_00ae65f0 void FUN_00ae65f0(int param_1,undefined4 param_2) { FUN_00ae5ba0(param_2,*(undefined4 *)(param_1 + 0x594)); return; } //@@ 00ae6610 FUN_00ae6610 void FUN_00ae6610(void) { FUN_00aea1b0(); return; } //@@ 00ae6630 FUN_00ae6630 void FUN_00ae6630(int *param_1,int param_2) { bool bVar1; char cVar2; if ((param_1 != (int *)0x0) && (param_1 != &DAT_00bf8240)) { bVar1 = 0 < param_2; FUN_00aecdf0(param_1,bVar1); if (param_2 == 1) { cVar2 = FUN_00ae9b10(); if (((cVar2 != '\0') && (*(int **)(*param_1 + 0xc) == param_1)) && ((char)param_1[399] == '\0')) { FUN_00aeb0f0(param_1,*param_1 + 0x14); } } if (param_2 == 2) { FUN_00ae6850(param_1,FUN_00ae6830,0,0); } FUN_00aecf20(param_1); FUN_00aece40(param_1,bVar1); FUN_00ae6850(param_1,FUN_00ae67e0,¶m_2,0); FUN_00aeb040(param_1,param_2 == 1,*param_1 + 0x14); if (bVar1) { guard_check_icall(*param_1 + 0x14); thunk_FUN_00aeae80(param_2 == 1,*param_1 + 0x1dc); FUN_00ae9b10(); return; } thunk_FUN_00aeae80(param_2 == 1,*param_1 + 0x1dc); } return; } //@@ 00ae6730 FUN_00ae6730 void FUN_00ae6730(int *param_1) { int iVar1; int *piVar2; int *piVar3; int iVar4; if (((param_1 != (int *)0x0) && (param_1 != &DAT_00bf8240)) && (iVar4 = *param_1, *(int **)(iVar4 + 0xc) != param_1)) { iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar1 + 0x10) == '\0') { FUN_00aeff45(); iVar4 = *param_1; } if (param_1 == *(int **)(iVar1 + 8)) { FUN_00ae9ae0(*(undefined4 *)(iVar4 + 0xc)); iVar4 = *param_1; } piVar2 = *(int **)(iVar4 + 0x10); if (*(int **)(iVar4 + 0x10) == param_1) { *(int *)(iVar4 + 0x10) = param_1[0x18e]; } else { while (piVar3 = piVar2, piVar3 != (int *)0x0) { piVar2 = (int *)piVar3[0x18e]; if ((int *)piVar3[0x18e] == param_1) { piVar3[0x18e] = param_1[0x18e]; FUN_00ae7470(param_1); return; } } } FUN_00ae7470(param_1); } return; } //@@ 00ae67e0 FUN_00ae67e0 undefined4 FUN_00ae67e0(undefined4 param_1,undefined4 param_2,int param_3,int *param_4) { int iVar1; iVar1 = *param_4; FUN_00aed1f0(param_3,0 < iVar1); if (*(int *)(param_3 + 0x14) == 0) { FUN_00aed1b0(param_3,param_2,0 < iVar1); return 1; } if (iVar1 == 2) { FUN_00aed180(param_3,param_2); } return 1; } //@@ 00ae6830 FUN_00ae6830 undefined1 FUN_00ae6830(undefined4 param_1,undefined4 param_2,undefined4 param_3) { FUN_00aed5c0(param_3,3,0); return 1; } //@@ 00ae6850 FUN_00ae6850 uint FUN_00ae6850(uint param_1,code *param_2,undefined4 param_3,undefined4 param_4) { int iVar1; int iVar2; int iVar3; uint in_EAX; int *piVar4; iVar3 = param_1; if ((param_1 == 0) || (*(int *)(param_1 + 0x62c) == 0)) { LAB_00ae68a9: return in_EAX & 0xffffff00; } piVar4 = (int *)(param_1 + 0x208); param_1 = 0; do { iVar2 = *piVar4; while (iVar2 != 0) { iVar1 = *(int *)(iVar2 + 0x28); in_EAX = (*param_2)(iVar3,piVar4,iVar2,param_3,param_4); iVar2 = iVar1; if ((char)in_EAX == '\0') goto LAB_00ae68a9; } param_1 = param_1 + 1; piVar4 = piVar4 + 3; if (0x4a < param_1) { return 1; } } while( true ); } //@@ 00ae68b0 FUN_00ae68b0 void FUN_00ae68b0(undefined1 param_1) { int iVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b15160; local_10 = ExceptionList; iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); ExceptionList = &local_10; if (*(char *)(iVar1 + 0x10) == '\0') { ExceptionList = &local_10; FUN_00aeff45(); } local_8 = 0; FUN_00ae6630(*(undefined4 *)(iVar1 + 8),param_1); ExceptionList = local_10; return; } //@@ 00ae6920 FUN_00ae6920 void FUN_00ae6920(undefined4 param_1,undefined1 param_2) { void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00ae6630(param_1,param_2); ExceptionList = local_10; return; } //@@ 00ae6960 FUN_00ae6960 void FUN_00ae6960(int *param_1) { int iVar1; int iVar2; int *piVar3; undefined4 *puVar4; int *piVar5; int *piVar6; int local_8; piVar3 = param_1; if ((param_1 != (int *)0x0) && (param_1 != &DAT_00bf8240)) { piVar5 = *(int **)(*param_1 + 0xc); if (piVar5 == param_1) { FUN_00aecdf0(param_1,1); if (param_1[0x18b] != 0) { piVar3 = param_1 + 0x82; local_8 = 0x4b; do { iVar2 = *piVar3; while (iVar2 != 0) { iVar1 = *(int *)(iVar2 + 0x28); FUN_00aed5c0(iVar2,3,0); iVar2 = iVar1; } piVar3 = piVar3 + 3; local_8 = local_8 + -1; } while (local_8 != 0); } FUN_00aecf20(param_1); FUN_00aece40(param_1,1); if (param_1[0x18b] != 0) { piVar3 = param_1 + 0x82; local_8 = 0x4b; do { iVar2 = *piVar3; while (iVar2 != 0) { iVar1 = *(int *)(iVar2 + 0x28); FUN_00aed1f0(iVar2,1); if (*(int *)(iVar2 + 0x14) == 0) { FUN_00aed1b0(iVar2,piVar3,1); iVar2 = iVar1; } else { FUN_00aed180(iVar2,piVar3); iVar2 = iVar1; } } piVar3 = piVar3 + 3; local_8 = local_8 + -1; } while (local_8 != 0); } FUN_00aeb040(param_1,0,*param_1 + 0x14); guard_check_icall(*param_1 + 0x14); thunk_FUN_00aeae80(0,*param_1 + 0x1dc); FUN_00ae9b10(); } else if (param_1[0x18b] != 0) { FUN_00aecf90(param_1); param_1 = (int *)0x4b; piVar6 = piVar5 + 0x82; do { iVar2 = FUN_00aed2c0(piVar5,piVar6,((int)piVar3 - (int)piVar5) + (int)piVar6); piVar5[0x18b] = piVar5[0x18b] + iVar2; piVar3[0x18b] = piVar3[0x18b] - iVar2; piVar6 = piVar6 + 3; param_1 = (int *)((int)param_1 + -1); } while (param_1 != (int *)0x0); FUN_00aecf20(piVar3); memset(piVar3 + 1,0,0x204); if (DAT_00c6a080 == '\0') { piVar5 = &DAT_00bf8448; piVar6 = piVar3 + 0x82; for (iVar2 = 0xe1; iVar2 != 0; iVar2 = iVar2 + -1) { *piVar6 = *piVar5; piVar5 = piVar5 + 1; piVar6 = piVar6 + 1; } } else { puVar4 = &DAT_00bf8448; piVar5 = piVar3 + 0x82; for (iVar2 = 900; iVar2 != 0; iVar2 = iVar2 + -1) { *(undefined1 *)piVar5 = *(undefined1 *)puVar4; puVar4 = (undefined4 *)((int)puVar4 + 1); piVar5 = (int *)((int)piVar5 + 1); } } LOCK(); piVar3[0x163] = 0; UNLOCK(); piVar3[0x18b] = 0; FUN_00ae6730(piVar3); return; } FUN_00ae6730(param_1); } return; } //@@ 00ae6b50 FUN_00ae6b50 undefined4 FUN_00ae6b50(void) { int iVar1; mi_thread_init(); iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar1 + 0x10) == '\0') { FUN_00aeff45(); } return *(undefined4 *)(iVar1 + 8); } //@@ 00ae6b80 FUN_00ae6b80 int * FUN_00ae6b80(int param_1) { int *piVar1; int *piVar2; uint uVar3; int iVar4; int *piVar5; int *piVar6; mi_thread_init(); iVar4 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar4 + 0x10) == '\0') { FUN_00aeff45(); } piVar1 = *(int **)(**(int **)(iVar4 + 8) + 0xc); piVar2 = (int *)FUN_00ae6dc0(piVar1,0x640); if (piVar2 == (int *)0x0) { return (int *)0x0; } if (DAT_00c6a080 == '\0') { piVar5 = &DAT_00bf8240; piVar6 = piVar2; for (iVar4 = 400; iVar4 != 0; iVar4 = iVar4 + -1) { *piVar6 = *piVar5; piVar5 = piVar5 + 1; piVar6 = piVar6 + 1; } } else { piVar5 = &DAT_00bf8240; piVar6 = piVar2; for (iVar4 = 0x640; iVar4 != 0; iVar4 = iVar4 + -1) { *(char *)piVar6 = (char)*piVar5; piVar5 = (int *)((int)piVar5 + 1); piVar6 = (int *)((int)piVar6 + 1); } } piVar5 = piVar2 + 0x169; *piVar2 = *piVar1; piVar2[0x164] = (int)&ExceptionList; piVar2[0x165] = param_1; FUN_00aea220(piVar1 + 0x169,piVar5); uVar3 = FUN_00aea1b0(piVar5); piVar2[0x166] = uVar3 | 1; iVar4 = FUN_00aea1b0(piVar5); piVar2[0x167] = iVar4; iVar4 = FUN_00aea1b0(piVar5); piVar2[0x168] = iVar4; *(undefined1 *)(piVar2 + 399) = 1; piVar2[0x18e] = *(int *)(*piVar2 + 0x10); *(int **)(*piVar2 + 0x10) = piVar2; return piVar2; } //@@ 00ae6c70 FUN_00ae6c70 void FUN_00ae6c70(uint param_1) { int iVar1; int iVar2; iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar1 + 0x10) == '\0') { FUN_00aeff45(); } iVar1 = *(int *)(iVar1 + 8); if (param_1 < 0x201) { iVar2 = *(int *)(iVar1 + 4 + (param_1 + 3 & 0xfffffffc)); if (*(undefined4 **)(iVar2 + 0x10) != (undefined4 *)0x0) { *(int *)(iVar2 + 0x14) = *(int *)(iVar2 + 0x14) + 1; *(undefined4 *)(iVar2 + 0x10) = **(undefined4 **)(iVar2 + 0x10); return; } } FUN_00aed000(iVar1,param_1,0,0); return; } //@@ 00ae6cd0 FUN_00ae6cd0 undefined4 * FUN_00ae6cd0(int param_1) { int iVar1; int iVar2; undefined4 *puVar3; iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar1 + 0x10) == '\0') { FUN_00aeff45(); } iVar1 = *(int *)(iVar1 + 8); iVar2 = *(int *)(iVar1 + 4 + (param_1 + 3U & 0xfffffffc)); puVar3 = *(undefined4 **)(iVar2 + 0x10); if (puVar3 == (undefined4 *)0x0) { puVar3 = (undefined4 *)FUN_00aed000(iVar1,param_1,0,0); return puVar3; } *(int *)(iVar2 + 0x14) = *(int *)(iVar2 + 0x14) + 1; *(undefined4 *)(iVar2 + 0x10) = *puVar3; return puVar3; } //@@ 00ae6d30 FUN_00ae6d30 undefined4 * FUN_00ae6d30(int param_1) { int iVar1; int iVar2; undefined4 *puVar3; size_t _Size; undefined4 *puVar4; iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar1 + 0x10) == '\0') { FUN_00aeff45(); } iVar1 = *(int *)(iVar1 + 8); iVar2 = *(int *)(iVar1 + 4 + (param_1 + 3U & 0xfffffffc)); puVar3 = *(undefined4 **)(iVar2 + 0x10); if (puVar3 == (undefined4 *)0x0) { puVar3 = (undefined4 *)FUN_00aed000(iVar1,param_1,1,0); return puVar3; } *(int *)(iVar2 + 0x14) = *(int *)(iVar2 + 0x14) + 1; *(undefined4 *)(iVar2 + 0x10) = *puVar3; if ((*(byte *)(iVar2 + 0xf) & 1) == 0) { _Size = *(size_t *)(iVar2 + 0x18); } else { _Size = 4; } if (DAT_00c6a080 == '\0') { memset(puVar3,0,_Size); return puVar3; } puVar4 = puVar3; for (; _Size != 0; _Size = _Size - 1) { *(undefined1 *)puVar4 = 0; puVar4 = (undefined4 *)((int)puVar4 + 1); } return puVar3; } //@@ 00ae6dc0 FUN_00ae6dc0 void FUN_00ae6dc0(int param_1,uint param_2) { int iVar1; if (0x200 < param_2) { FUN_00aed000(param_1,param_2,0,0); return; } iVar1 = *(int *)(param_1 + 4 + (param_2 + 3 & 0xfffffffc)); if (*(undefined4 **)(iVar1 + 0x10) == (undefined4 *)0x0) { FUN_00aed000(param_1,param_2,0,0); return; } *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1; *(undefined4 *)(iVar1 + 0x10) = **(undefined4 **)(iVar1 + 0x10); return; } //@@ 00ae6e10 FUN_00ae6e10 undefined4 * FUN_00ae6e10(int param_1,uint param_2) { int iVar1; undefined4 *puVar2; size_t _Size; undefined4 *puVar3; if (0x200 < param_2) { puVar2 = (undefined4 *)FUN_00aed000(param_1,param_2,1,0); return puVar2; } iVar1 = *(int *)(param_1 + 4 + (param_2 + 3 & 0xfffffffc)); puVar2 = *(undefined4 **)(iVar1 + 0x10); if (puVar2 == (undefined4 *)0x0) { puVar2 = (undefined4 *)FUN_00aed000(param_1,param_2,1,0); return puVar2; } *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1; *(undefined4 *)(iVar1 + 0x10) = *puVar2; if ((*(byte *)(iVar1 + 0xf) & 1) == 0) { _Size = *(size_t *)(iVar1 + 0x18); } else { _Size = 4; } if (DAT_00c6a080 == '\0') { memset(puVar2,0,_Size); return puVar2; } puVar3 = puVar2; for (; _Size != 0; _Size = _Size - 1) { *(undefined1 *)puVar3 = 0; puVar3 = (undefined4 *)((int)puVar3 + 1); } return puVar2; } //@@ 00ae6ea0 FUN_00ae6ea0 undefined4 * FUN_00ae6ea0(int param_1,int param_2) { int iVar1; undefined4 *puVar2; iVar1 = *(int *)(param_1 + 4 + (param_2 + 3U & 0xfffffffc)); puVar2 = *(undefined4 **)(iVar1 + 0x10); if (puVar2 == (undefined4 *)0x0) { puVar2 = (undefined4 *)FUN_00aed000(param_1,param_2,0,0); return puVar2; } *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1; *(undefined4 *)(iVar1 + 0x10) = *puVar2; return puVar2; } //@@ 00ae6ee0 FUN_00ae6ee0 undefined4 * FUN_00ae6ee0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4) { undefined4 *puVar1; size_t _Size; undefined4 *puVar2; puVar1 = *(undefined4 **)(param_2 + 0x10); if (puVar1 == (undefined4 *)0x0) { puVar1 = (undefined4 *)FUN_00aed000(param_1,param_3,param_4,0); return puVar1; } *(int *)(param_2 + 0x14) = *(int *)(param_2 + 0x14) + 1; *(undefined4 *)(param_2 + 0x10) = *puVar1; if ((char)param_4 != '\0') { if ((*(byte *)(param_2 + 0xf) & 1) == 0) { _Size = *(size_t *)(param_2 + 0x18); } else { _Size = 4; } if (DAT_00c6a080 != '\0') { puVar2 = puVar1; for (; _Size != 0; _Size = _Size - 1) { *(undefined1 *)puVar2 = 0; puVar2 = (undefined4 *)((int)puVar2 + 1); } return puVar1; } memset(puVar1,0,_Size); } return puVar1; } //@@ 00ae6f50 FUN_00ae6f50 void FUN_00ae6f50(undefined4 param_1,uint param_2,undefined4 param_3) { if (param_2 < 0x201) { FUN_00ae7340(); return; } FUN_00aed000(param_1,param_2,param_3,0); return; } //@@ 00ae6f80 FUN_00ae6f80 void FUN_00ae6f80(undefined4 param_1,uint param_2,undefined4 param_3) { if (param_2 < 0x201) { FUN_00ae7340(param_1,param_2,param_3); return; } FUN_00aed000(); return; } //@@ 00ae6fb0 FUN_00ae6fb0 void FUN_00ae6fb0(int param_1,uint *param_2) { uint *puVar1; int iVar2; uint uVar3; uint uVar4; uint uVar5; uVar3 = param_1 - 1U & 0xffc00000; if (*(int *)(uVar3 + 0x60) == 1) { FUN_00aeb230(uVar3,param_1,param_2); return; } puVar1 = (uint *)(param_1 + 0x20); uVar3 = *(uint *)(param_1 + 0x20); while( true ) { uVar5 = uVar3 & 3; if (uVar5 == 0) { uVar4 = uVar3 & 0xfffffffd | 1; } else { uVar4 = uVar5 | (uint)param_2; *param_2 = uVar3 & 0xfffffffc; } LOCK(); if (uVar3 == *puVar1) { *puVar1 = uVar4; uVar4 = uVar3; } else { uVar4 = *puVar1; } UNLOCK(); if (uVar4 == uVar3) break; uVar3 = uVar4; } if (uVar5 == 0) { iVar2 = *(int *)(param_1 + 0x24); if (iVar2 != 0) { uVar3 = *(uint *)(iVar2 + 0x58c); while( true ) { *param_2 = uVar3; LOCK(); uVar5 = *(uint *)(iVar2 + 0x58c); if (uVar3 == uVar5) { *(uint *)(iVar2 + 0x58c) = (uint)param_2; uVar5 = uVar3; } else { } UNLOCK(); if (uVar5 == uVar3) break; uVar3 = uVar5; } } uVar3 = *puVar1; while( true ) { LOCK(); if (uVar3 == *puVar1) { *puVar1 = uVar3 & 0xfffffffe | 2; uVar5 = uVar3; } else { uVar5 = *puVar1; } UNLOCK(); if (uVar5 == uVar3) break; uVar3 = uVar5; } } return; } //@@ 00ae7060 FUN_00ae7060 undefined1 FUN_00ae7060(undefined4 *param_1) { int *piVar1; char cVar2; uint uVar3; int iVar4; uVar3 = (int)param_1 - 1U & 0xffc00000; iVar4 = uVar3 + 0x6c + ((int)param_1 - uVar3 >> 0xf) * 0x30; iVar4 = iVar4 - *(int *)(iVar4 + 4); cVar2 = FUN_00aed510(iVar4,0,0); if (cVar2 == '\0') { return 0; } FUN_00aed1f0(iVar4,0); *param_1 = *(undefined4 *)(iVar4 + 0x1c); piVar1 = (int *)(iVar4 + 0x14); *piVar1 = *piVar1 + -1; *(undefined4 **)(iVar4 + 0x1c) = param_1; if (*piVar1 == 0) { FUN_00aed410(iVar4); return 1; } if ((*(byte *)(iVar4 + 0xe) & 1) != 0) { FUN_00aed570(iVar4); } return 1; } //@@ 00ae70e0 FUN_00ae70e0 undefined4 * FUN_00ae70e0(int param_1,undefined4 *param_2,undefined4 *param_3,char param_4) { int iVar1; uint uVar2; uint _Size; undefined4 *puVar3; undefined4 *puVar4; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; _Size = (uint)param_3; puStack_c = &LAB_00b15160; local_10 = ExceptionList; local_8 = 0; if ((param_2 == (undefined4 *)0x0) || (uVar2 = (uint)((int)param_2 - 1U) & 0xffc00000, uVar2 == 0) ) { uVar2 = 0; ExceptionList = &local_10; } else { iVar1 = ((int)param_2 - uVar2 >> 0xf) * 0x30 + 0x6c + uVar2; iVar1 = iVar1 - *(int *)(iVar1 + 4); if ((*(byte *)(iVar1 + 0xe) & 2) == 0) { uVar2 = *(uint *)(iVar1 + 0x18); ExceptionList = &local_10; if (0x7fffffff < *(uint *)(iVar1 + 0x18)) { ExceptionList = &local_10; FUN_00aeb3f0(iVar1 - 1U & 0xffc00000,iVar1,&local_14); uVar2 = local_14; } } else { ExceptionList = &local_10; uVar2 = FUN_00ae73c0(uVar2,iVar1,param_2); } } if (((uVar2 < param_3) || (param_3 < uVar2 >> 1)) || (puVar4 = param_2, param_3 == (undefined4 *)0x0)) { if (param_3 < 0x201) { iVar1 = *(int *)(param_1 + 4 + ((int)param_3 + 3U & 0xfffffffc)); puVar4 = *(undefined4 **)(iVar1 + 0x10); if (puVar4 == (undefined4 *)0x0) { param_3 = (undefined4 *)FUN_00aed000(param_1,param_3,0,0); } else { *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1; *(undefined4 *)(iVar1 + 0x10) = *puVar4; param_3 = puVar4; } } else { param_3 = (undefined4 *)FUN_00aed000(param_1,param_3,0,0); } puVar4 = param_3; if (param_3 != (undefined4 *)0x0) { if ((param_4 != '\0') && (uVar2 < _Size)) { iVar1 = uVar2 - 4; if (uVar2 < 4) { iVar1 = 0; } memset((undefined1 *)(iVar1 + (int)param_3),0,_Size - iVar1); } if (param_2 != (undefined4 *)0x0) { if (((uint)param_2 & 3) == 0) { if (uVar2 < _Size) { _Size = uVar2; } if (DAT_00c6a080 == '\0') { memcpy(param_3,param_2,_Size); } else { puVar3 = param_2; for (; _Size != 0; _Size = _Size - 1) { *(undefined1 *)param_3 = *(undefined1 *)puVar3; puVar3 = (undefined4 *)((int)puVar3 + 1); param_3 = (undefined4 *)((int)param_3 + 1); } } } FUN_00ae7470(param_2); } } } ExceptionList = local_10; return puVar4; } //@@ 00ae7250 FUN_00ae7250 void FUN_00ae7250(int param_1,char param_2,undefined4 *param_3) { int *piVar1; int iVar2; undefined4 *puVar3; int iVar4; undefined4 *puVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; puVar5 = param_3; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; iVar4 = param_1 + 0x6c + ((uint)((int)param_3 - param_1) >> 0xf) * 0x30; iVar4 = iVar4 - *(int *)(iVar4 + 4); ExceptionList = &local_10; if ((*(byte *)(iVar4 + 0xe) & 2) != 0) { ExceptionList = &local_10; iVar2 = FUN_00aeb3f0(param_1,iVar4,0); puVar3 = *(undefined4 **)(iVar4 + 0x18); if ((undefined4 *)0x7fffffff < *(undefined4 **)(iVar4 + 0x18)) { FUN_00aeb3f0(iVar4 - 1U & 0xffc00000,iVar4,¶m_3); puVar3 = param_3; } puVar5 = (undefined4 *)((int)puVar5 - (uint)((int)puVar5 - iVar2) % (uint)puVar3); } if (param_2 == '\0') { FUN_00ae6fb0(iVar4,puVar5); } else { *puVar5 = *(undefined4 *)(iVar4 + 0x1c); piVar1 = (int *)(iVar4 + 0x14); *piVar1 = *piVar1 + -1; *(undefined4 **)(iVar4 + 0x1c) = puVar5; if (*piVar1 == 0) { FUN_00aed410(iVar4); ExceptionList = local_10; return; } if ((*(byte *)(iVar4 + 0xe) & 1) != 0) { FUN_00aed570(iVar4); ExceptionList = local_10; return; } } ExceptionList = local_10; return; } //@@ 00ae7340 FUN_00ae7340 undefined4 * FUN_00ae7340(int param_1,int param_2,undefined4 param_3) { int iVar1; undefined4 *puVar2; size_t _Size; undefined4 *puVar3; iVar1 = *(int *)(param_1 + 4 + (param_2 + 3U & 0xfffffffc)); puVar2 = *(undefined4 **)(iVar1 + 0x10); if (puVar2 == (undefined4 *)0x0) { puVar2 = (undefined4 *)FUN_00aed000(param_1,param_2,param_3,0); return puVar2; } *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1; *(undefined4 *)(iVar1 + 0x10) = *puVar2; if ((char)param_3 != '\0') { if ((*(byte *)(iVar1 + 0xf) & 1) == 0) { _Size = *(size_t *)(iVar1 + 0x18); } else { _Size = 4; } if (DAT_00c6a080 != '\0') { puVar3 = puVar2; for (; _Size != 0; _Size = _Size - 1) { *(undefined1 *)puVar3 = 0; puVar3 = (undefined4 *)((int)puVar3 + 1); } return puVar2; } memset(puVar2,0,_Size); } return puVar2; } //@@ 00ae73c0 FUN_00ae73c0 int FUN_00ae73c0(undefined4 param_1,int param_2,uint param_3) { uint uVar1; int iVar2; uint uVar3; uint uVar4; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uVar1 = param_3; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; iVar2 = FUN_00aeb3f0(param_1,param_2,0); uVar4 = *(uint *)(param_2 + 0x18); if (uVar4 < 0x80000000) { iVar2 = uVar1 - (uVar1 - iVar2) % uVar4; } else { uVar3 = param_2 - 1U & 0xffc00000; FUN_00aeb3f0(uVar3,param_2,¶m_3); iVar2 = uVar1 - (uVar1 - iVar2) % param_3; uVar4 = *(uint *)(param_2 + 0x18); if (0x7fffffff < *(uint *)(param_2 + 0x18)) { FUN_00aeb3f0(uVar3,param_2,&local_14); uVar4 = local_14; } } ExceptionList = local_10; return iVar2 + (uVar4 - uVar1); } //@@ 00ae7470 FUN_00ae7470 void FUN_00ae7470(undefined4 *param_1) { int *piVar1; int iVar2; uint uVar3; if ((param_1 != (undefined4 *)0x0) && (uVar3 = (int)param_1 - 1U & 0xffc00000, uVar3 != 0)) { iVar2 = uVar3 + 0x6c + ((int)param_1 - uVar3 >> 0xf) * 0x30; iVar2 = iVar2 - *(int *)(iVar2 + 4); if ((*(void ***)(uVar3 + 100) == &ExceptionList) && (*(char *)(iVar2 + 0xe) == '\0')) { *param_1 = *(undefined4 *)(iVar2 + 0x1c); piVar1 = (int *)(iVar2 + 0x14); *piVar1 = *piVar1 + -1; *(undefined4 **)(iVar2 + 0x1c) = param_1; if (*piVar1 == 0) { FUN_00aed410(); return; } } else { FUN_00ae7250(uVar3,*(void ***)(uVar3 + 100) == &ExceptionList,param_1); } } return; } //@@ 00ae74f0 FUN_00ae74f0 void FUN_00ae74f0(undefined4 param_1,undefined4 param_2,undefined4 param_3) { FUN_00ae70e0(param_1,param_2,param_3,0); return; } //@@ 00ae7510 FUN_00ae7510 void FUN_00ae7510(undefined4 param_1,int param_2,undefined1 param_3) { bool bVar1; int iVar2; undefined4 uVar3; char cVar4; uint *puVar5; code *pcVar6; char *pcVar7; undefined1 local_244 [512]; char local_44 [64]; if (DAT_00bf805c == 0) { mi_option_init(&DAT_00bf8058); } if (DAT_00bf8058 == 0) { if (DAT_00bf8034 == 0) { mi_option_init(&DAT_00bf8030); } if (DAT_00bf8030 == 0) goto LAB_00ae7695; if (-1 < DAT_00bf8028) { LOCK(); iVar2 = DAT_00c69d98 + 1; UNLOCK(); bVar1 = DAT_00bf8028 < DAT_00c69d98; DAT_00c69d98 = iVar2; if (bVar1) goto LAB_00ae7695; } } cVar4 = FUN_00ae9b10(); if (cVar4 == '\0') { FUN_00ae80d0(local_44,0x40,"%sthread 0x%zx: ","mimalloc: error: ",&ExceptionList); if ((param_2 == 0) || (cVar4 = FUN_00ae7fb0(), cVar4 == '\0')) goto LAB_00ae7695; puVar5 = (uint *)FUN_0041d4c0(local_244,0x1ff,param_2,0,¶m_3); __stdio_common_vsprintf(*puVar5 | 2,puVar5[1]); FUN_00ae7fe0(); cVar4 = FUN_00ae7fb0(); if (cVar4 == '\0') goto LAB_00ae7695; pcVar6 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar6 = FUN_00ae7e50; } pcVar7 = local_44; } else { if ((param_2 == 0) || (cVar4 = FUN_00ae7fb0(), cVar4 == '\0')) goto LAB_00ae7695; puVar5 = (uint *)FUN_0041d4c0(local_244,0x1ff,param_2,0,¶m_3); __stdio_common_vsprintf(*puVar5 | 2,puVar5[1]); FUN_00ae7fe0(); cVar4 = FUN_00ae7fb0(); if (cVar4 == '\0') goto LAB_00ae7695; pcVar6 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar6 = FUN_00ae7e50; } pcVar7 = "mimalloc: error: "; } uVar3 = DAT_00c69d94; (*pcVar6)(pcVar7,DAT_00c69d94); (*pcVar6)(local_244,uVar3); FUN_00ae7fe0(); LAB_00ae7695: if (DAT_00c69da0 != (code *)0x0) { (*DAT_00c69da0)(param_1,DAT_00c69da4); } return; } //@@ 00ae76c0 FUN_00ae76c0 void FUN_00ae76c0(code *param_1,undefined4 param_2,int param_3,undefined1 param_4) { char cVar1; uint *puVar2; code *pcVar3; undefined4 extraout_EDX; undefined1 local_204 [512]; if ((param_3 != 0) && (cVar1 = FUN_00ae7fb0(), cVar1 != '\0')) { puVar2 = (uint *)FUN_0041d4c0(local_204,0x1ff,extraout_EDX,0,¶m_4); __stdio_common_vsprintf(*puVar2 | 2,puVar2[1]); FUN_00ae7fe0(); if ((param_1 != (code *)0x0) && ((pcVar3 = (code *)__acrt_iob_func(1), param_1 != pcVar3 && (pcVar3 = (code *)__acrt_iob_func(2), param_1 != pcVar3)))) { (*param_1)(local_204,param_2); return; } cVar1 = FUN_00ae7fb0(); if (cVar1 != '\0') { pcVar3 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar3 = FUN_00ae7e50; } (*pcVar3)(local_204,DAT_00c69d94); FUN_00ae7fe0(); } } return; } //@@ 00ae7780 FUN_00ae7780 void FUN_00ae7780(code *param_1,undefined4 param_2,int param_3,undefined4 param_4) { undefined4 uVar1; char cVar2; code *pcVar3; if (((param_1 != (code *)0x0) && (pcVar3 = (code *)__acrt_iob_func(1), param_1 != pcVar3)) && (pcVar3 = (code *)__acrt_iob_func(2), param_1 != pcVar3)) { if (param_3 != 0) { (*param_1)(param_3,param_2); } (*param_1)(param_4,param_2); return; } cVar2 = FUN_00ae7fb0(); uVar1 = DAT_00c69d94; if (cVar2 == '\0') { return; } pcVar3 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar3 = FUN_00ae7e50; } if (param_3 != 0) { (*pcVar3)(param_3,DAT_00c69d94); } (*pcVar3)(param_4,uVar1); FUN_00ae7fe0(); return; } //@@ 00ae7810 FUN_00ae7810 void FUN_00ae7810(void) { char *pcVar1; char cVar2; char *pcVar3; uint uVar4; undefined4 *desc; DWORD local_8; LOCK(); UNLOCK(); uVar4 = g_mimallocOutLen; if (0x8000 < g_mimallocOutLen) { uVar4 = 0x8000; } g_mimallocOutLen = g_mimallocOutLen + 1; (&DAT_00c61d88)[uVar4] = 0; cVar2 = FUN_00ae9b30(); if (cVar2 == '\0') { if (DAT_00bf8224 == (HANDLE)0xffffffff) { DAT_00bf8224 = GetStdHandle(0xfffffff4); } pcVar1 = &DAT_00c61d88; do { pcVar3 = pcVar1; pcVar1 = pcVar3 + 1; } while (*pcVar3 != '\0'); if ((DAT_00bf8224 != (HANDLE)0xffffffff) && (pcVar3 + -0xc61d89 < (char *)0xfffffffe)) { local_8 = 0; WriteConsoleA(DAT_00bf8224,&DAT_00c61d88,(DWORD)(pcVar3 + -0xc61d88),&local_8,(LPVOID)0x0); } } (&DAT_00c61d88)[uVar4] = 10; uVar4 = 0; DAT_00c69d90 = FUN_00ae7ed0; desc = &DAT_00bf8030; do { if ((uVar4 < 0x19) && (desc[1] == 0)) { mi_option_init(desc); } if (uVar4 != 2) { FUN_00ae7930("option \'%s\': %ld\n",desc[3],*desc); } desc = desc + 5; uVar4 = uVar4 + 1; } while ((int)desc < 0xbf8224); if (DAT_00bf81b0 == 0) { mi_option_init(&DAT_00bf81ac); } DAT_00bf8028 = DAT_00bf81ac; if (DAT_00bf81c4 == 0) { mi_option_init(&DAT_00bf81c0); } DAT_00bf802c = DAT_00bf81c0; return; } //@@ 00ae7930 FUN_00ae7930 void FUN_00ae7930(int param_1,undefined1 param_2) { undefined4 uVar1; char cVar2; uint *puVar3; undefined4 extraout_EDX; code *pcVar4; undefined1 local_204 [512]; if (DAT_00bf805c == 0) { mi_option_init(&DAT_00bf8058); } if ((DAT_00bf8058 != 0) && (param_1 != 0)) { cVar2 = FUN_00ae7fb0(); if (cVar2 != '\0') { puVar3 = (uint *)FUN_0041d4c0(local_204,0x1ff,extraout_EDX,0,¶m_2); __stdio_common_vsprintf(*puVar3 | 2,puVar3[1]); FUN_00ae7fe0(); cVar2 = FUN_00ae7fb0(); uVar1 = DAT_00c69d94; if (cVar2 != '\0') { pcVar4 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar4 = FUN_00ae7e50; } (*pcVar4)("mimalloc: ",DAT_00c69d94); (*pcVar4)(local_204,uVar1); FUN_00ae7fe0(); } } } return; } //@@ 00ae79e0 FUN_00ae79e0 void FUN_00ae79e0(int param_1,undefined1 param_2) { bool bVar1; int iVar2; undefined4 uVar3; char cVar4; uint *puVar5; code *pcVar6; char *pcVar7; undefined1 local_244 [512]; char local_44 [64]; if (DAT_00bf805c == 0) { mi_option_init(&DAT_00bf8058); } if (DAT_00bf8058 == 0) { if (DAT_00bf8034 == 0) { mi_option_init(&DAT_00bf8030); } if (DAT_00bf8030 == 0) { return; } if (-1 < DAT_00bf802c) { LOCK(); iVar2 = DAT_00c69d9c + 1; UNLOCK(); bVar1 = DAT_00bf802c < DAT_00c69d9c; DAT_00c69d9c = iVar2; if (bVar1) { return; } } } cVar4 = FUN_00ae9b10(); if (cVar4 == '\0') { FUN_00ae80d0(local_44,0x40,"%sthread 0x%zx: ","mimalloc: warning: ",&ExceptionList); if (param_1 == 0) { return; } cVar4 = FUN_00ae7fb0(); if (cVar4 == '\0') { return; } puVar5 = (uint *)FUN_0041d4c0(local_244,0x1ff,param_1,0,¶m_2); __stdio_common_vsprintf(*puVar5 | 2,puVar5[1]); FUN_00ae7fe0(); cVar4 = FUN_00ae7fb0(); if (cVar4 == '\0') { return; } pcVar6 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar6 = FUN_00ae7e50; } pcVar7 = local_44; } else { if (param_1 == 0) { return; } cVar4 = FUN_00ae7fb0(); if (cVar4 == '\0') { return; } puVar5 = (uint *)FUN_0041d4c0(local_244,0x1ff,param_1,0,¶m_2); __stdio_common_vsprintf(*puVar5 | 2,puVar5[1]); FUN_00ae7fe0(); cVar4 = FUN_00ae7fb0(); if (cVar4 == '\0') { return; } pcVar6 = DAT_00c69d90; if (DAT_00c69d90 == (code *)0x0) { pcVar6 = FUN_00ae7e50; } pcVar7 = "mimalloc: warning: "; } uVar3 = DAT_00c69d94; (*pcVar6)(pcVar7,DAT_00c69d94); (*pcVar6)(local_244,uVar3); FUN_00ae7fe0(); return; } //@@ 00ae7b70 mi_option_init /* DB: mimalloc options.c: builds 'mimalloc_'+name, reads env var, parses '1;TRUE;YES;ON'/'0;FALSE;NO;OFF', warns 'environment option mimalloc_%%s has an invalid value' / 'is deprecated'; called by all mi_option_get variants prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl mi_option_init(void *desc) { void *pvVar1; char cVar2; DWORD DVar3; char *pcVar4; char *pcVar5; uint uVar6; int iVar7; int iVar8; uint uVar9; CHAR local_8c [68]; char local_48 [68]; pvVar1 = desc; pcVar4 = local_48; uVar6 = 0x41; iVar7 = (int)"mimalloc_" - (int)pcVar4; do { if (uVar6 < 2) break; uVar6 = uVar6 - 1; *pcVar4 = pcVar4[iVar7]; pcVar4 = pcVar4 + 1; } while (pcVar4[iVar7] != '\0'); uVar6 = 0x41; *pcVar4 = '\0'; pcVar4 = local_48; pcVar5 = *(char **)((int)desc + 0xc); cVar2 = local_48[0]; if (pcVar5 != (char *)0x0) { for (; (cVar2 != '\0' && (1 < uVar6)); uVar6 = uVar6 - 1) { pcVar4 = pcVar4 + 1; cVar2 = *pcVar4; } if ((pcVar4 != (char *)0x0) && (uVar6 != 0)) { if (*pcVar5 != '\0') { iVar8 = (int)pcVar5 - (int)pcVar4; do { if (uVar6 < 2) break; uVar6 = uVar6 - 1; *pcVar4 = pcVar4[iVar8]; pcVar4 = pcVar4 + 1; } while (pcVar4[iVar8] != '\0'); } *pcVar4 = '\0'; } } local_8c[0] = '\0'; DVar3 = GetEnvironmentVariableA(local_48,local_8c,0x41); if (0x3f < DVar3 - 1) { pcVar4 = *(char **)((int)pvVar1 + 0x10); if (pcVar4 == (char *)0x0) { LAB_00ae7cd6: cVar2 = FUN_00ae9b30(); if (cVar2 == '\0') { *(undefined4 *)((int)pvVar1 + 4) = 1; return; } return; } uVar6 = 0x41; pcVar5 = local_48; do { if (uVar6 < 2) break; uVar6 = uVar6 - 1; *pcVar5 = pcVar5[iVar7]; pcVar5 = pcVar5 + 1; } while (pcVar5[iVar7] != '\0'); *pcVar5 = '\0'; pcVar5 = local_48; cVar2 = local_48[0]; for (uVar6 = 0x41; (cVar2 != '\0' && (1 < uVar6)); uVar6 = uVar6 - 1) { pcVar5 = pcVar5 + 1; cVar2 = *pcVar5; } if ((pcVar5 != (char *)0x0) && (uVar6 != 0)) { if (*pcVar4 != '\0') { iVar7 = (int)pcVar4 - (int)pcVar5; do { if (uVar6 < 2) break; uVar6 = uVar6 - 1; *pcVar5 = pcVar5[iVar7]; pcVar5 = pcVar5 + 1; } while (pcVar5[iVar7] != '\0'); } *pcVar5 = '\0'; } local_8c[0] = '\0'; DVar3 = GetEnvironmentVariableA(local_48,local_8c,0x41); if (0x3f < DVar3 - 1) goto LAB_00ae7cd6; FUN_00ae79e0("environment option \"mimalloc_%s\" is deprecated -- use \"mimalloc_%s\" instead.\n" ,*(undefined4 *)((int)pvVar1 + 0x10),*(undefined4 *)((int)pvVar1 + 0xc)); } pcVar4 = local_8c; do { cVar2 = *pcVar4; pcVar4 = pcVar4 + 1; } while (cVar2 != '\0'); uVar6 = (int)pcVar4 - (int)(local_8c + 1); if (uVar6 < 0x41) { if (uVar6 == 0) goto LAB_00ae7d1b; } else { uVar6 = 0x40; } uVar9 = 0; do { iVar7 = toupper((int)local_8c[uVar9]); local_48[uVar9] = (char)iVar7; uVar9 = uVar9 + 1; } while (uVar9 < uVar6); LAB_00ae7d1b: local_48[uVar6] = '\0'; if ((local_48[0] == '\0') || (pcVar4 = strstr("1;TRUE;YES;ON",local_48), pcVar4 != (char *)0x0)) { *(undefined4 *)pvVar1 = 1; *(undefined4 *)((int)pvVar1 + 4) = 2; return; } pcVar4 = strstr("0;FALSE;NO;OFF",local_48); if (pcVar4 != (char *)0x0) { *(undefined4 *)pvVar1 = 0; *(undefined4 *)((int)pvVar1 + 4) = 2; return; } desc = local_48; uVar6 = strtol(local_48,&desc,10); if (*(int *)((int)pvVar1 + 8) == 9) { cVar2 = *(char *)desc; if (cVar2 == 'K') { desc = (void *)((int)desc + 1); } else if (cVar2 == 'M') { uVar6 = uVar6 << 10; desc = (void *)((int)desc + 1); } else if (cVar2 == 'G') { uVar6 = uVar6 << 0x14; desc = (void *)((int)desc + 1); } else { uVar6 = uVar6 + 0x3ff >> 10; } if (*(char *)desc == 'I') { if (*(char *)((int)desc + 1) == 'B') { desc = (void *)((int)desc + 2); } } else if (*(char *)desc == 'B') { desc = (void *)((int)desc + 1); } } if (*(char *)desc == '\0') { *(uint *)pvVar1 = uVar6; *(undefined4 *)((int)pvVar1 + 4) = 2; return; } *(undefined4 *)((int)pvVar1 + 4) = 1; if ((*(int *)((int)pvVar1 + 8) == 2) && (*(int *)pvVar1 == 0)) { *(undefined4 *)pvVar1 = 1; FUN_00ae79e0("environment option mimalloc_%s has an invalid value.\n", *(undefined4 *)((int)pvVar1 + 0xc)); *(undefined4 *)pvVar1 = 0; return; } FUN_00ae79e0("environment option mimalloc_%s has an invalid value.\n", *(undefined4 *)((int)pvVar1 + 0xc)); return; } //@@ 00ae7e50 FUN_00ae7e50 void FUN_00ae7e50(char *param_1) { char cVar1; uint uVar2; size_t _Size; char *pcVar3; size_t sVar4; uVar2 = g_mimallocOutLen; if ((param_1 != (char *)0x0) && (g_mimallocOutLen < 0x8000)) { pcVar3 = param_1; do { cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); sVar4 = (int)pcVar3 - (int)(param_1 + 1); if (sVar4 != 0) { LOCK(); uVar2 = g_mimallocOutLen + sVar4; UNLOCK(); if (g_mimallocOutLen < 0x8000) { pcVar3 = &DAT_00c61d88 + g_mimallocOutLen; _Size = 0x7fff - g_mimallocOutLen; if (g_mimallocOutLen + sVar4 < 0x8000) { _Size = sVar4; } g_mimallocOutLen = uVar2; if (DAT_00c6a080 != '\0') { for (; _Size != 0; _Size = _Size - 1) { *pcVar3 = *param_1; param_1 = param_1 + 1; pcVar3 = pcVar3 + 1; } return; } memcpy(pcVar3,param_1,_Size); uVar2 = g_mimallocOutLen; } } } g_mimallocOutLen = uVar2; return; } //@@ 00ae7ed0 FUN_00ae7ed0 void FUN_00ae7ed0(char *param_1) { uint uVar1; char cVar2; char *pcVar3; size_t _Size; size_t sVar4; char *lpBuffer; lpBuffer = param_1; uVar1 = g_mimallocOutLen; if (param_1 != (char *)0x0) { cVar2 = FUN_00ae9b30(); if (cVar2 == '\0') { if (DAT_00bf8224 == (HANDLE)0xffffffff) { DAT_00bf8224 = GetStdHandle(0xfffffff4); } pcVar3 = lpBuffer; do { cVar2 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar2 != '\0'); if ((DAT_00bf8224 != (HANDLE)0xffffffff) && (((int)pcVar3 - (int)(lpBuffer + 1)) - 1U < 0xfffffffe)) { param_1 = (char *)0x0; WriteConsoleA(DAT_00bf8224,lpBuffer,(int)pcVar3 - (int)(lpBuffer + 1),(LPDWORD)¶m_1, (LPVOID)0x0); } } uVar1 = g_mimallocOutLen; if (g_mimallocOutLen < 0x8000) { pcVar3 = lpBuffer; do { cVar2 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar2 != '\0'); sVar4 = (int)pcVar3 - (int)(lpBuffer + 1); if (sVar4 != 0) { LOCK(); uVar1 = g_mimallocOutLen + sVar4; UNLOCK(); if (g_mimallocOutLen < 0x8000) { pcVar3 = &DAT_00c61d88 + g_mimallocOutLen; _Size = 0x7fff - g_mimallocOutLen; if (g_mimallocOutLen + sVar4 < 0x8000) { _Size = sVar4; } g_mimallocOutLen = uVar1; if (DAT_00c6a080 != '\0') { for (; _Size != 0; _Size = _Size - 1) { *pcVar3 = *lpBuffer; lpBuffer = lpBuffer + 1; pcVar3 = pcVar3 + 1; } return; } memcpy(pcVar3,lpBuffer,_Size); uVar1 = g_mimallocOutLen; } } } } g_mimallocOutLen = uVar1; return; } //@@ 00ae7fb0 FUN_00ae7fb0 int FUN_00ae7fb0(void) { int iVar1; uint3 uVar2; iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); uVar2 = (uint3)((uint)iVar1 >> 8); if (*(char *)(iVar1 + 4) == '\0') { *(undefined1 *)(iVar1 + 4) = 1; return CONCAT31(uVar2,1); } return (uint)uVar2 << 8; } //@@ 00ae7fe0 FUN_00ae7fe0 void FUN_00ae7fe0(void) { *(undefined1 *)(*(int *)((int)ThreadLocalStoragePointer + _tls_index * 4) + 4) = 0; return; } //@@ 00ae8000 FUN_00ae8000 undefined4 FUN_00ae8000(uint param_1) { if (0x18 < param_1) { return 0; } if ((&DAT_00bf8034)[param_1 * 5] == 0) { mi_option_init(&DAT_00bf8030 + param_1 * 5); } return (&DAT_00bf8030)[param_1 * 5]; } //@@ 00ae8040 FUN_00ae8040 int FUN_00ae8040(uint param_1,int param_2,int param_3) { int iVar1; if (param_1 < 0x19) { if ((&DAT_00bf8034)[param_1 * 5] == 0) { mi_option_init(&DAT_00bf8030 + param_1 * 5); } iVar1 = (&DAT_00bf8030)[param_1 * 5]; } else { iVar1 = 0; } if (iVar1 < param_2) { return param_2; } if (param_3 < iVar1) { iVar1 = param_3; } return iVar1; } //@@ 00ae8090 FUN_00ae8090 undefined4 FUN_00ae8090(uint param_1) { int iVar1; if (0x18 < param_1) { return 0; } if ((&DAT_00bf8034)[param_1 * 5] == 0) { mi_option_init(&DAT_00bf8030 + param_1 * 5); } iVar1 = (&DAT_00bf8030)[param_1 * 5]; return CONCAT31((int3)((uint)iVar1 >> 8),iVar1 != 0); } //@@ 00ae80d0 FUN_00ae80d0 int FUN_00ae80d0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4) { uint *puVar1; int iVar2; puVar1 = (uint *)FUN_0041d4c0(param_1,param_2,param_3,0,¶m_4); iVar2 = __stdio_common_vsprintf(*puVar1 | 2,puVar1[1]); if (iVar2 < 0) { iVar2 = -1; } return iVar2; } //@@ 00ae8110 FUN_00ae8110 void FUN_00ae8110(int param_1) { undefined4 uVar1; if (param_1 == 0) { return; } uVar1 = FUN_00ae85d0(param_1); FUN_00ae8ad0(uVar1,0,1,0,(int)¶m_1 + 3,&_mi_stats_main); return; } //@@ 00ae8140 FUN_00ae8140 void FUN_00ae8140(uint param_1,int param_2,undefined4 param_3,undefined4 *param_4) { uint uVar1; undefined4 uVar2; undefined4 *puVar3; uint uVar4; if (param_1 == 0) { return; } uVar2 = FUN_00ae85d0(param_1); uVar4 = g_systemPageSize - 1; if ((uVar4 & g_systemPageSize) == 0) { uVar4 = ~uVar4 & param_2 + uVar4; } else { uVar4 = ((param_2 + uVar4) / g_systemPageSize) * g_systemPageSize; } uVar1 = param_1 >> 8; param_1 = param_1 & 0xffffff00; puVar3 = ¶m_1; if (param_4 != (undefined4 *)0x0) { param_1 = CONCAT31((int3)uVar1,*(undefined1 *)param_4); *(undefined1 *)param_4 = 0; puVar3 = param_4; } FUN_00ae8c00(uVar2,uVar4,param_3,param_1,puVar3,&_mi_stats_main); return; } //@@ 00ae81b0 FUN_00ae81b0 int FUN_00ae81b0(int param_1,uint param_2,uint param_3,undefined4 param_4,undefined4 *param_5, undefined4 param_6) { uint uVar1; undefined4 uVar2; int iVar3; undefined4 uVar4; undefined4 *puVar5; uint uVar6; uint uVar7; if (param_3 < 0x400001) { if (param_3 == 0) { if (param_1 != 0) { uVar2 = FUN_00ae85d0(param_1); uVar6 = g_systemPageSize - 1; if ((uVar6 & g_systemPageSize) == 0) { uVar6 = ~uVar6 & param_2 + uVar6; } else { uVar6 = ((param_2 + uVar6) / g_systemPageSize) * g_systemPageSize; } uVar7 = param_3 >> 8; param_3 = param_3 & 0xffffff00; puVar5 = ¶m_3; if (param_5 != (undefined4 *)0x0) { param_3 = CONCAT31((int3)uVar7,*(undefined1 *)param_5); *(undefined1 *)param_5 = 0; puVar5 = param_5; } iVar3 = FUN_00ae8c00(uVar2,uVar6,param_4,param_3,puVar5,&_mi_stats_main); return iVar3; } } else { uVar6 = param_2 - 1; uVar7 = uVar6 + param_3; if ((param_2 & uVar6) == 0) { uVar7 = ~uVar6 & uVar7; } else { uVar7 = uVar7 - uVar7 % param_2; } uVar7 = uVar7 - param_3; if (param_1 + uVar7 != 0) { uVar4 = FUN_00ae85d0(param_1 + uVar7); uVar2 = param_4; uVar6 = g_systemPageSize - 1; if ((uVar6 & g_systemPageSize) == 0) { uVar6 = ~uVar6 & uVar6 + param_2; } else { uVar6 = ((uVar6 + param_2) / g_systemPageSize) * g_systemPageSize; } uVar1 = param_3 >> 8; param_3 = param_3 & 0xffffff00; puVar5 = ¶m_3; if (param_5 != (undefined4 *)0x0) { param_3 = CONCAT31((int3)uVar1,*(undefined1 *)param_5); *(undefined1 *)param_5 = 0; puVar5 = param_5; } iVar3 = FUN_00ae8c00(uVar4,uVar6,param_4,param_3,puVar5,&_mi_stats_main); if (iVar3 != 0) { if (((char)uVar2 != '\0') && (g_systemPageSize < uVar7)) { FUN_00ae8400(iVar3,uVar7,param_6); } return iVar3 + uVar7; } } } } return 0; } //@@ 00ae8300 FUN_00ae8300 undefined4 FUN_00ae8300(void) { undefined4 *in_stack_00000014; undefined4 *in_stack_00000018; if (in_stack_00000018 != (undefined4 *)0x0) { *in_stack_00000018 = 0; } if (in_stack_00000014 != (undefined4 *)0x0) { *in_stack_00000014 = 0; } return 0; } //@@ 00ae8330 FUN_00ae8330 bool FUN_00ae8330(uint param_1,int param_2,undefined1 *param_3) { LPVOID pvVar1; DWORD DVar2; uint uVar3; SIZE_T dwSize; LPVOID lpAddress; if (param_3 != (undefined1 *)0x0) { *param_3 = 0; } if ((param_2 != 0) && (param_1 != 0)) { uVar3 = g_systemPageSize - 1; if ((uVar3 & g_systemPageSize) == 0) { lpAddress = (LPVOID)(~uVar3 & param_1); uVar3 = ~uVar3 & param_1 + param_2 + uVar3; } else { lpAddress = (LPVOID)((param_1 / g_systemPageSize) * g_systemPageSize); uVar3 = ((param_1 + param_2 + uVar3) / g_systemPageSize) * g_systemPageSize; } dwSize = uVar3 - (int)lpAddress; if (0 < (int)dwSize) { FUN_00aedf30(&DAT_00c69e60,param_2); FUN_00aedec0(&DAT_00c69fe0,1); pvVar1 = VirtualAlloc(lpAddress,dwSize,0x1000,4); if (pvVar1 == lpAddress) { return true; } DVar2 = GetLastError(); if (DVar2 != 0) { FUN_00ae79e0("%s error: start: %p, csize: 0x%zx, err: %i\n","commit",lpAddress,dwSize,DVar2) ; } return DVar2 == 0; } } return true; } //@@ 00ae8400 FUN_00ae8400 bool FUN_00ae8400(int param_1,int param_2) { BOOL BVar1; DWORD DVar2; uint uVar3; SIZE_T dwSize; LPVOID lpAddress; if ((param_2 != 0) && (param_1 != 0)) { uVar3 = g_systemPageSize - 1; if ((uVar3 & g_systemPageSize) == 0) { lpAddress = (LPVOID)(~uVar3 & uVar3 + param_1); uVar3 = ~uVar3 & param_1 + param_2; } else { lpAddress = (LPVOID)(((uVar3 + param_1) / g_systemPageSize) * g_systemPageSize); uVar3 = ((uint)(param_1 + param_2) / g_systemPageSize) * g_systemPageSize; } dwSize = uVar3 - (int)lpAddress; if (0 < (int)dwSize) { FUN_00aedf10(&DAT_00c69e60,param_2); BVar1 = VirtualFree(lpAddress,dwSize,0x4000); if (BVar1 != 0) { return true; } DVar2 = GetLastError(); if (DVar2 != 0) { FUN_00ae79e0("%s error: start: %p, csize: 0x%zx, err: %i\n","decommit",lpAddress,dwSize, DVar2); } return DVar2 == 0; } } return true; } //@@ 00ae84c0 FUN_00ae84c0 void FUN_00ae84c0(int param_1,int param_2) { undefined4 uVar1; if ((param_2 != 0) && (param_1 != 0)) { uVar1 = FUN_00ae85d0(param_2,1,&_mi_stats_main); FUN_00ae8da0(param_1,uVar1); } return; } //@@ 00ae84f0 FUN_00ae84f0 void FUN_00ae84f0(int param_1,int param_2,uint param_3,int param_4,undefined4 param_5) { uint uVar1; undefined4 uVar2; uint uVar3; uVar1 = param_3 - 1; uVar3 = uVar1 + param_4; if ((param_3 & uVar1) == 0) { uVar3 = ~uVar1 & uVar3; } else { uVar3 = uVar3 - uVar3 % param_3; } param_1 = param_1 - (uVar3 - param_4); param_2 = param_2 + (uVar3 - param_4); if ((param_2 != 0) && (param_1 != 0)) { uVar2 = FUN_00ae85d0(param_2,param_5,&_mi_stats_main); FUN_00ae8da0(param_1,uVar2); } return; } //@@ 00ae8550 FUN_00ae8550 void FUN_00ae8550(int param_1,int param_2,undefined4 param_3) { undefined4 uVar1; if ((param_2 != 0) && (param_1 != 0)) { uVar1 = FUN_00ae85d0(param_2,param_3,&_mi_stats_main); FUN_00ae8da0(param_1,uVar1); } return; } //@@ 00ae8580 FUN_00ae8580 void FUN_00ae8580(int param_1,uint param_2) { if (((param_1 != 0) && (param_2 != 0)) && (0x3fffffff < param_2)) { param_2 = param_2 >> 0x1e; do { if (param_1 != 0) { FUN_00ae8da0(param_1,0x40000000,1,&_mi_stats_main); } param_1 = param_1 + 0x40000000; param_2 = param_2 - 1; } while (param_2 != 0); } return; } //@@ 00ae85d0 FUN_00ae85d0 uint FUN_00ae85d0(uint param_1) { uint uVar1; uint uVar2; if (param_1 < 0x80000) { uVar2 = g_systemPageSize; } else { if (param_1 < 0x200000) { return param_1 + 0xffff & 0xffff0000; } if (param_1 < 0x800000) { return param_1 + 0x3ffff & 0xfffc0000; } if (param_1 < 0x2000000) { return param_1 + 0xfffff & 0xfff00000; } uVar2 = 0x400000; } if (param_1 < ~uVar2) { uVar1 = uVar2 - 1; param_1 = uVar1 + param_1; if ((uVar1 & uVar2) == 0) { return ~uVar1 & param_1; } param_1 = param_1 - param_1 % uVar2; } return param_1; } //@@ 00ae8670 FUN_00ae8670 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00ae8670(void) { char cVar1; HMODULE pHVar2; HANDLE ProcessHandle; BOOL BVar3; DWORD DVar4; bool bVar5; DWORD DesiredAccess; HANDLE *TokenHandle; _SYSTEM_INFO local_3c; _TOKEN_PRIVILEGES local_18; HANDLE local_8; DAT_00bf8230 = 0; GetSystemInfo(&local_3c); if (local_3c.dwPageSize != 0) { g_systemPageSize = local_3c.dwPageSize; } if (local_3c.dwAllocationGranularity != 0) { DAT_00bf822c = local_3c.dwAllocationGranularity; } pHVar2 = LoadLibraryA("kernelbase.dll"); if (pHVar2 != (HMODULE)0x0) { DAT_00c69db0 = GetProcAddress(pHVar2,"VirtualAlloc2FromApp"); if (DAT_00c69db0 == (FARPROC)0x0) { DAT_00c69db0 = GetProcAddress(pHVar2,"VirtualAlloc2"); } FreeLibrary(pHVar2); } pHVar2 = LoadLibraryA("ntdll.dll"); if (pHVar2 != (HMODULE)0x0) { _DAT_00c69db4 = GetProcAddress(pHVar2,"NtAllocateVirtualMemoryEx"); FreeLibrary(pHVar2); } pHVar2 = LoadLibraryA("kernel32.dll"); if (pHVar2 != (HMODULE)0x0) { DAT_00c69db8 = GetProcAddress(pHVar2,"GetCurrentProcessorNumberEx"); DAT_00c69dbc = GetProcAddress(pHVar2,"GetNumaProcessorNodeEx"); DAT_00c69dc0 = GetProcAddress(pHVar2,"GetNumaNodeProcessorMaskEx"); FreeLibrary(pHVar2); } cVar1 = FUN_00ae8090(6); if ((cVar1 == '\0') && (cVar1 = FUN_00ae8090(7), cVar1 == '\0')) { return; } if (DAT_00c69dac != 0) { return; } TokenHandle = &local_8; DVar4 = 0; DesiredAccess = 0x28; local_8 = (HANDLE)0x0; ProcessHandle = GetCurrentProcess(); BVar3 = OpenProcessToken(ProcessHandle,DesiredAccess,TokenHandle); if (BVar3 != 0) { BVar3 = LookupPrivilegeValueA((LPCSTR)0x0,"SeLockMemoryPrivilege",&local_18.Privileges[0].Luid); bVar5 = false; if (BVar3 != 0) { local_18.PrivilegeCount = 1; local_18.Privileges[0].Attributes = 2; BVar3 = AdjustTokenPrivileges(local_8,0,&local_18,0,(PTOKEN_PRIVILEGES)0x0,(PDWORD)0x0); bVar5 = false; if (BVar3 != 0) { DVar4 = GetLastError(); bVar5 = DVar4 == 0; if (DVar4 == 0) { DAT_00c69dac = GetLargePageMinimum(); } } } CloseHandle(local_8); if (bVar5) { return; } if (DVar4 != 0) goto LAB_00ae8805; } DVar4 = GetLastError(); LAB_00ae8805: FUN_00ae79e0("cannot enable large OS page support, error %lu\n",DVar4); return; } //@@ 00ae8820 FUN_00ae8820 int FUN_00ae8820(void) { int iVar1; BOOL BVar2; bool bVar3; int local_1c [3]; int local_10; int local_c; ULONG local_8; iVar1 = DAT_00c69da8; if (DAT_00c69da8 == 0) { iVar1 = FUN_00ae8000(0x10); if (iVar1 < 1) { local_8 = 0; GetNumaHighestNodeNumber(&local_8); for (; local_8 != 0; local_8 = local_8 - 1) { if (DAT_00c69dc0 == (code *)0x0) { BVar2 = GetNumaNodeProcessorMask((UCHAR)local_8,(PULONGLONG)&local_10); if (BVar2 != 0) { bVar3 = local_10 == 0 && local_c == 0; goto LAB_00ae888f; } } else { iVar1 = (*DAT_00c69dc0)(local_8,local_1c); if (iVar1 != 0) { bVar3 = local_1c[0] == 0; LAB_00ae888f: if (!bVar3) break; } } } iVar1 = local_8 + 1; if (iVar1 == 0) { iVar1 = 1; } } DAT_00c69da8 = iVar1; FUN_00ae7930("using %zd numa regions\n",iVar1); } return iVar1; } //@@ 00ae88d0 FUN_00ae88d0 uint FUN_00ae88d0(void) { uint uVar1; int iVar2; DWORD DVar3; BOOL BVar4; uint uVar5; bool bVar6; int local_28 [3]; int local_1c; int local_18; undefined1 local_14 [4]; uint local_10; ULONG local_c; byte local_5; uVar1 = DAT_00c69da8; if (DAT_00c69da8 == 0) { uVar1 = FUN_00ae8000(0x10); if ((int)uVar1 < 1) { local_c = 0; GetNumaHighestNodeNumber(&local_c); for (; local_c != 0; local_c = local_c - 1) { if (DAT_00c69dc0 == (code *)0x0) { BVar4 = GetNumaNodeProcessorMask((UCHAR)local_c,(PULONGLONG)&local_1c); if (BVar4 != 0) { bVar6 = local_1c == 0 && local_18 == 0; goto LAB_00ae894e; } } else { iVar2 = (*DAT_00c69dc0)(local_c,local_28); if (iVar2 != 0) { bVar6 = local_28[0] == 0; LAB_00ae894e: if (!bVar6) break; } } } uVar1 = local_c + 1; if (uVar1 == 0) { uVar1 = 1; } } DAT_00c69da8 = uVar1; FUN_00ae7930("using %zd numa regions\n",uVar1); } if (uVar1 < 2) { return 0; } uVar5 = 0; if ((DAT_00c69db8 == (code *)0x0) || (DAT_00c69dbc == (code *)0x0)) { DVar3 = GetCurrentProcessorNumber(); local_5 = 0; BVar4 = GetNumaProcessorNode((UCHAR)DVar3,&local_5); if (BVar4 != 0) { uVar5 = (uint)local_5; } } else { (*DAT_00c69db8)(local_14); local_10 = 0; iVar2 = (*DAT_00c69dbc)(local_14,&local_10); if (iVar2 != 0) { uVar5 = local_10 & 0xffff; } } if (uVar1 <= uVar5) { uVar5 = uVar5 % uVar1; } return uVar5; } //@@ 00ae8a00 FUN_00ae8a00 uint FUN_00ae8a00(void) { return g_systemPageSize; } //@@ 00ae8a10 FUN_00ae8a10 undefined4 FUN_00ae8a10(int param_1,int param_2) { LPVOID pvVar1; uint uVar2; SIZE_T dwSize; LPVOID lpAddress; if ((param_2 != 0) && (param_1 != 0)) { uVar2 = g_systemPageSize - 1; if ((uVar2 & g_systemPageSize) == 0) { lpAddress = (LPVOID)(~uVar2 & uVar2 + param_1); uVar2 = ~uVar2 & param_2 + param_1; } else { lpAddress = (LPVOID)(((uVar2 + param_1) / g_systemPageSize) * g_systemPageSize); uVar2 = ((uint)(param_2 + param_1) / g_systemPageSize) * g_systemPageSize; } dwSize = uVar2 - (int)lpAddress; if (0 < (int)dwSize) { FUN_00aedf30(&DAT_00c69e80,dwSize); pvVar1 = VirtualAlloc(lpAddress,dwSize,0x80000,4); if (pvVar1 != lpAddress) { return 0; } if (lpAddress != (LPVOID)0x0) { VirtualUnlock(lpAddress,dwSize); } } } return 1; } //@@ 00ae8aa0 FUN_00ae8aa0 uint FUN_00ae8aa0(int param_1,uint param_2) { uint uVar1; uint uVar2; uVar1 = param_2 - 1; uVar2 = param_1 + uVar1; if ((param_2 & uVar1) == 0) { return ~uVar1 & uVar2; } return uVar2 - uVar2 % param_2; } //@@ 00ae8ad0 FUN_00ae8ad0 /* WARNING: Removing unreachable block (ram,0x00ae8b53) */ int FUN_00ae8ad0(uint param_1,uint param_2,byte param_3,byte param_4,undefined1 *param_5,int param_6 ) { char cVar1; uint uVar2; DWORD DVar3; uint uVar4; uint uVar5; undefined4 uVar6; undefined4 uVar7; int local_8; if (param_1 == 0) { return 0; } uVar4 = 1; if (param_2 != 0) { uVar4 = param_2; } uVar5 = (param_3 + 2) * 0x1000; if ((((DAT_00c69dac != 0) && (cVar1 = FUN_00ae8090(6), cVar1 != '\0')) && (param_1 % DAT_00c69dac == 0)) && ((((int)((ulonglong)uVar4 % (ulonglong)DAT_00c69dac) == 0 && ((param_3 & param_4) != (byte)((ulonglong)uVar4 % (ulonglong)DAT_00c69dac))) && ((uVar5 & 0x1000) != 0)))) { if (DAT_00c69dc4 == 0) { *param_5 = 1; local_8 = FUN_00ae8e90(0,param_1,uVar4,uVar5 | 0x20000000); if (local_8 != 0) goto LAB_00ae8bcd; DAT_00c69dc4 = 10; } else { DAT_00c69dc4 = DAT_00c69dc4 + -1; LOCK(); UNLOCK(); } } *param_5 = 0; local_8 = FUN_00ae8e90(0,param_1,uVar4,uVar5); if (local_8 == 0) { uVar2 = (uint)(param_3 & param_4); uVar7 = 0; uVar6 = 0; DVar3 = GetLastError(); FUN_00ae79e0("unable to allocate OS memory (%zu bytes, error code: 0x%x, address: %p, alignment: %zu, flags: 0x%x, large only: %d, allow large: %d)\n" ,param_1,DVar3,uVar6,uVar4,uVar5,uVar7,uVar2); return 0; } LAB_00ae8bcd: FUN_00aedf30(param_6 + 0x40,param_1); if (param_3 != 0) { FUN_00aedf30(param_6 + 0x60,param_1); } return local_8; } //@@ 00ae8c00 FUN_00ae8c00 uint FUN_00ae8c00(int param_1,uint param_2,uint param_3,byte param_4,undefined4 param_5, undefined4 param_6) { uint uVar1; int iVar2; LPVOID pvVar3; DWORD DVar4; LPVOID lpAddress; uint uVar5; uint uVar6; SIZE_T dwSize; if ((g_systemPageSize <= param_2) && ((param_2 & param_2 - 1) == 0)) { uVar5 = g_systemPageSize - 1; if ((uVar5 & g_systemPageSize) == 0) { uVar5 = ~uVar5 & param_1 + uVar5; } else { uVar5 = ((param_1 + uVar5) / g_systemPageSize) * g_systemPageSize; } uVar1 = FUN_00ae8ad0(uVar5,param_2,param_3,(byte)param_3 & param_4,param_5,param_6); if (uVar1 != 0) { if (uVar1 % param_2 == 0) { return uVar1; } FUN_00ae8da0(uVar1,uVar5,param_3,param_6); FUN_00ae79e0("unable to allocate aligned OS memory directly, fall back to over-allocation (%zu bytes, address: %p, alignment: %zu, commit: %d)\n" ,uVar5,uVar1,param_2,param_3 & 0xff); if ((uVar5 < ~param_2) && (iVar2 = FUN_00ae8ad0(uVar5 + param_2,0,0,0,param_5,param_6), iVar2 != 0)) { uVar1 = FUN_00ae8aa0(iVar2,param_2); if ((byte)param_3 == 0) { return uVar1; } if (uVar5 == 0) { return uVar1; } if (uVar1 == 0) { return 0; } uVar6 = g_systemPageSize - 1; if ((g_systemPageSize & uVar6) == 0) { lpAddress = (LPVOID)(~uVar6 & uVar1); uVar6 = ~uVar6 & uVar6 + uVar1 + uVar5; } else { lpAddress = (LPVOID)((uVar1 / g_systemPageSize) * g_systemPageSize); uVar6 = ((uVar6 + uVar1 + uVar5) / g_systemPageSize) * g_systemPageSize; } dwSize = uVar6 - (int)lpAddress; if ((int)dwSize < 1) { return uVar1; } FUN_00aedf30(&DAT_00c69e60,uVar5); FUN_00aedec0(&DAT_00c69fe0,1); pvVar3 = VirtualAlloc(lpAddress,dwSize,0x1000,4); if (pvVar3 == lpAddress) { return uVar1; } DVar4 = GetLastError(); if (DVar4 == 0) { return uVar1; } FUN_00ae79e0("%s error: start: %p, csize: 0x%zx, err: %i\n","commit",lpAddress,dwSize,DVar4) ; return uVar1; } } } return 0; } //@@ 00ae8da0 FUN_00ae8da0 byte FUN_00ae8da0(LPVOID param_1,int param_2,char param_3,int param_4) { LPVOID pvVar1; BOOL BVar2; DWORD DVar3; bool bVar4; _MEMORY_BASIC_INFORMATION local_20; pvVar1 = param_1; if ((param_1 == (LPVOID)0x0) || (param_2 == 0)) { return 1; } BVar2 = VirtualFree(param_1,0,0x8000); bVar4 = BVar2 == 0; if (BVar2 != 0) goto LAB_00ae8e54; DVar3 = GetLastError(); if (DVar3 == 0x1e7) { local_20.Type = 0; local_20.BaseAddress = (PVOID)0x0; local_20.AllocationBase = (LPVOID)0x0; local_20.AllocationProtect = 0; local_20.RegionSize = 0; local_20.State = 0; local_20.Protect = 0; VirtualQuery(param_1,&local_20,0x1c); if ((local_20.AllocationBase < param_1) && ((int)param_1 - (int)local_20.AllocationBase < 0x400000)) { BVar2 = VirtualFree(local_20.AllocationBase,0,0x8000); bVar4 = BVar2 == 0; if (BVar2 != 0) goto LAB_00ae8e54; DVar3 = GetLastError(); goto LAB_00ae8e3d; } LAB_00ae8e41: param_1._3_1_ = bVar4; FUN_00ae79e0("unable to release OS memory: error code 0x%x, addr: %p, size: %zu\n",DVar3,pvVar1, param_2); } else { LAB_00ae8e3d: param_1._3_1_ = bVar4; bVar4 = param_1._3_1_; if (DVar3 != 0) goto LAB_00ae8e41; } bVar4 = param_1._3_1_; LAB_00ae8e54: if (param_3 != '\0') { FUN_00aedf10(param_4 + 0x60,param_2); } FUN_00aedf10(param_4 + 0x40,param_2); return bVar4 ^ 1; } //@@ 00ae8e90 FUN_00ae8e90 void FUN_00ae8e90(LPVOID param_1,SIZE_T param_2,uint param_3,DWORD param_4) { HANDLE pvVar1; int iVar2; DWORD DVar3; uint uVar4; LPVOID pvVar5; SIZE_T SVar6; DWORD DVar7; undefined4 uVar8; undefined4 *puVar9; undefined4 uVar10; undefined4 local_30; uint local_2c; ulonglong local_28; uint local_1c; uint local_18; uint local_14; if (((1 < param_3) && (uVar4 = param_3 % g_systemPageSize, uVar4 == 0)) && (DAT_00c69db0 != (code *)0x0)) { uVar10 = 1; local_28 = ZEXT48(&local_1c); puVar9 = &local_30; uVar8 = 4; local_14 = param_3; local_30 = 1; pvVar5 = param_1; SVar6 = param_2; DVar7 = param_4; local_2c = uVar4; local_1c = uVar4; local_18 = uVar4; pvVar1 = GetCurrentProcess(); iVar2 = (*DAT_00c69db0)(pvVar1,pvVar5,SVar6,DVar7,uVar8,puVar9,uVar10); if (iVar2 != 0) { return; } pvVar5 = param_1; DVar7 = param_4; DVar3 = GetLastError(); FUN_00ae79e0("unable to allocate aligned OS memory (%zu bytes, error code: 0x%x, address: %p, alignment: %zu, flags: 0x%x)\n" ,param_2,DVar3,pvVar5,param_3,DVar7); } VirtualAlloc(param_1,param_2,param_4,4); return; } //@@ 00ae8f50 FUN_00ae8f50 undefined4 FUN_00ae8f50(int param_1,undefined4 param_2,uint param_3,uint param_4,int param_5) { uint *puVar1; uint uVar2; uint uVar3; uint uVar4; bool bVar5; if (param_3 < 0x20) { if (param_3 == 0) { uVar4 = 0; } else { uVar4 = (1 << ((byte)param_3 & 0x1f)) + -1 << ((byte)param_4 & 0x1f); } } else { uVar4 = 0xffffffff; } puVar1 = (uint *)(param_1 + (param_4 >> 5) * 4); uVar2 = *puVar1; do { LOCK(); uVar3 = *puVar1; bVar5 = uVar2 == uVar3; if (bVar5) { *puVar1 = uVar2 | uVar4; } else { uVar2 = uVar3; } UNLOCK(); } while (!bVar5); uVar3 = uVar2 & uVar4; if (param_5 != 0) { uVar2 = CONCAT31((int3)(uVar2 >> 8),uVar3 != uVar4); *(bool *)param_5 = uVar3 != uVar4; } return CONCAT31((int3)(uVar2 >> 8),uVar3 == 0); } //@@ 00ae8fb0 FUN_00ae8fb0 bool FUN_00ae8fb0(int param_1,undefined4 param_2,undefined4 param_3,uint param_4,undefined1 *param_5 ) { uint uVar1; int iVar2; uint uVar3; uint *puVar4; bool bVar5; bool bVar6; bool bVar7; uint local_14; uint local_10; uint local_c [2]; iVar2 = FUN_00ae97a0(param_4,param_2,param_3,local_c,&local_10,&local_14); puVar4 = (uint *)(param_1 + (param_4 >> 5) * 4); uVar3 = *puVar4; do { LOCK(); uVar1 = *puVar4; bVar5 = uVar3 == uVar1; if (bVar5) { *puVar4 = uVar3 | local_c[0]; } else { uVar3 = uVar1; } UNLOCK(); } while (!bVar5); puVar4 = puVar4 + 1; bVar6 = (uVar3 & local_c[0]) == 0; bVar5 = (uVar3 & local_c[0]) != local_c[0]; if (iVar2 != 0) { param_4._3_1_ = bVar6; do { iVar2 = iVar2 + -1; uVar3 = *puVar4; do { LOCK(); uVar1 = *puVar4; bVar6 = uVar3 == uVar1; if (bVar6) { *puVar4 = uVar3 | local_10; } else { uVar3 = uVar1; } UNLOCK(); } while (!bVar6); puVar4 = puVar4 + 1; bVar6 = false; if ((uVar3 & local_10) == 0) { bVar6 = param_4._3_1_; } if ((uVar3 & local_10) != local_10) { bVar5 = true; } param_4._3_1_ = bVar6; } while (iVar2 != 0); } if (local_14 != 0) { uVar3 = *puVar4; do { LOCK(); uVar1 = *puVar4; bVar7 = uVar3 == uVar1; if (bVar7) { *puVar4 = uVar3 | local_14; } else { uVar3 = uVar1; } UNLOCK(); } while (!bVar7); bVar7 = false; if ((uVar3 & local_14) == 0) { bVar7 = bVar6; } bVar6 = bVar7; if ((uVar3 & local_14) != local_14) { bVar5 = true; } } if (param_5 != (undefined1 *)0x0) { *param_5 = bVar5; } return bVar6; } //@@ 00ae9090 FUN_00ae9090 void FUN_00ae9090(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { FUN_00ae96c0(param_1,param_2,param_3,param_4,0); return; } //@@ 00ae90b0 FUN_00ae90b0 undefined4 FUN_00ae90b0(int param_1,int param_2,uint param_3,int *param_4) { uint *puVar1; uint uVar2; uint uVar3; uint uVar4; int iVar5; uint uVar6; bool bVar7; uVar2 = *(uint *)(param_1 + param_2 * 4); puVar1 = (uint *)(param_1 + param_2 * 4); if (uVar2 != 0xffffffff) { if (param_3 < 0x20) { if (param_3 == 0) { iVar5 = 0; } else { iVar5 = (1 << ((byte)param_3 & 0x1f)) + -1; } } else { iVar5 = -1; } uVar6 = 0x20; uVar3 = ~uVar2; if ((uVar3 != 0) && (uVar6 = 0, uVar3 != 0)) { for (; (uVar3 >> uVar6 & 1) == 0; uVar6 = uVar6 + 1) { } } uVar3 = iVar5 << ((byte)uVar6 & 0x1f); while (uVar6 <= 0x20 - param_3) { uVar4 = uVar3 & uVar2; if (uVar4 == 0) { LOCK(); uVar4 = *puVar1; if (uVar2 == uVar4) { *puVar1 = uVar3 | uVar2; uVar4 = uVar2; } else { } UNLOCK(); bVar7 = uVar4 == uVar2; uVar2 = uVar4; if (bVar7) { *param_4 = param_2 * 0x20 + uVar6; return 1; } } else { if (param_3 == 1) { iVar5 = 1; } else { iVar5 = 0x1f; if (uVar4 != 0) { for (; uVar4 >> iVar5 == 0; iVar5 = iVar5 + -1) { } } iVar5 = (-uVar6 - (0x1f - iVar5)) + 0x20; } uVar6 = uVar6 + iVar5; uVar3 = uVar3 << ((byte)iVar5 & 0x1f); } } } return 0; } //@@ 00ae9180 FUN_00ae9180 undefined4 FUN_00ae9180(int param_1,uint param_2,uint param_3,uint param_4,int *param_5) { uint *puVar1; uint uVar2; uint uVar3; uint uVar4; int iVar5; uint uVar6; bool bVar7; uint local_8; local_8 = 0; if (param_2 != 0) { do { param_3 = -(uint)(param_3 < param_2) & param_3; puVar1 = (uint *)(param_1 + param_3 * 4); uVar2 = *puVar1; if (uVar2 != 0xffffffff) { if (param_4 < 0x20) { if (param_4 == 0) { iVar5 = 0; } else { iVar5 = (1 << ((byte)param_4 & 0x1f)) + -1; } } else { iVar5 = -1; } uVar6 = 0x20; uVar3 = ~uVar2; if ((uVar3 != 0) && (uVar6 = 0, uVar3 != 0)) { for (; (uVar3 >> uVar6 & 1) == 0; uVar6 = uVar6 + 1) { } } uVar3 = iVar5 << ((byte)uVar6 & 0x1f); while (uVar6 <= 0x20 - param_4) { uVar4 = uVar3 & uVar2; if (uVar4 == 0) { LOCK(); if (uVar2 == *puVar1) { *puVar1 = uVar3 | uVar2; uVar4 = uVar2; } else { uVar4 = *puVar1; } UNLOCK(); bVar7 = uVar4 == uVar2; uVar2 = uVar4; if (bVar7) { *param_5 = param_3 * 0x20 + uVar6; return 1; } } else { if (param_4 == 1) { iVar5 = 1; } else { iVar5 = 0x1f; if (uVar4 != 0) { for (; uVar4 >> iVar5 == 0; iVar5 = iVar5 + -1) { } } iVar5 = (-uVar6 - (0x1f - iVar5)) + 0x20; } uVar6 = uVar6 + iVar5; uVar3 = uVar3 << ((byte)iVar5 & 0x1f); } } } local_8 = local_8 + 1; param_3 = param_3 + 1; } while (local_8 < param_2); } return 0; } //@@ 00ae9280 FUN_00ae9280 undefined4 FUN_00ae9280(int param_1,uint param_2,uint param_3,uint param_4,int *param_5) { uint *puVar1; uint uVar2; char cVar3; uint uVar4; uint uVar5; int iVar6; uint uVar7; bool bVar8; uint local_8; if (param_4 == 1) { param_4 = 0; if (param_2 != 0) { do { param_3 = -(uint)(param_3 < param_2) & param_3; uVar2 = *(uint *)(param_1 + param_3 * 4); puVar1 = (uint *)(param_1 + param_3 * 4); if ((uVar2 != 0xffffffff) && (uVar4 = ~uVar2, uVar4 != 0)) { uVar7 = 0; if (uVar4 != 0) { for (; (uVar4 >> uVar7 & 1) == 0; uVar7 = uVar7 + 1) { } } uVar4 = 1 << ((byte)uVar7 & 0x1f); while (uVar7 < 0x20) { if ((uVar4 & uVar2) == 0) { LOCK(); uVar5 = *puVar1; if (uVar2 == uVar5) { *puVar1 = uVar4 | uVar2; uVar5 = uVar2; } else { } UNLOCK(); bVar8 = uVar5 == uVar2; uVar2 = uVar5; if (bVar8) { *param_5 = param_3 * 0x20 + uVar7; return 1; } } else { uVar7 = uVar7 + 1; uVar4 = uVar4 * 2; } } } param_3 = param_3 + 1; param_4 = param_4 + 1; } while (param_4 < param_2); } } else { local_8 = 0; if (param_2 != 0) { do { param_3 = -(uint)(param_3 < param_2) & param_3; if (param_4 < 0x21) { uVar2 = *(uint *)(param_1 + param_3 * 4); puVar1 = (uint *)(param_1 + param_3 * 4); if (uVar2 != 0xffffffff) { if (param_4 < 0x20) { if (param_4 == 0) { iVar6 = 0; } else { iVar6 = (1 << ((byte)param_4 & 0x1f)) + -1; } } else { iVar6 = -1; } uVar4 = 0x20; uVar7 = ~uVar2; if ((uVar7 != 0) && (uVar4 = 0, uVar7 != 0)) { for (; (uVar7 >> uVar4 & 1) == 0; uVar4 = uVar4 + 1) { } } uVar7 = iVar6 << ((byte)uVar4 & 0x1f); while (uVar4 <= 0x20 - param_4) { uVar5 = uVar7 & uVar2; if (uVar5 == 0) { LOCK(); uVar5 = *puVar1; if (uVar2 == uVar5) { *puVar1 = uVar7 | uVar2; uVar5 = uVar2; } else { } UNLOCK(); bVar8 = uVar5 == uVar2; uVar2 = uVar5; if (bVar8) { *param_5 = param_3 * 0x20 + uVar4; return 1; } } else { iVar6 = 0x1f; if (uVar5 != 0) { for (; uVar5 >> iVar6 == 0; iVar6 = iVar6 + -1) { } } iVar6 = (-uVar4 - (0x1f - iVar6)) + 0x20; uVar4 = uVar4 + iVar6; uVar7 = uVar7 << ((byte)iVar6 & 0x1f); } } } } cVar3 = FUN_00ae9860(param_1,param_2,param_3,param_4,0,param_5); if (cVar3 != '\0') { return 1; } local_8 = local_8 + 1; param_3 = param_3 + 1; } while (local_8 < param_2); } } return 0; } //@@ 00ae9440 FUN_00ae9440 undefined4 FUN_00ae9440(int param_1,uint param_2,uint param_3,uint param_4,code *param_5,undefined4 param_6, uint *param_7) { uint *puVar1; char cVar2; uint uVar3; uint uVar4; uint uVar5; int iVar6; uint uVar7; bool bVar8; uint local_c; local_c = 0; if (param_2 != 0) { do { param_3 = -(uint)(param_3 < param_2) & param_3; puVar1 = (uint *)(param_1 + param_3 * 4); uVar5 = *puVar1; if (uVar5 != 0xffffffff) { if (param_4 < 0x20) { if (param_4 == 0) { iVar6 = 0; } else { iVar6 = (1 << ((byte)param_4 & 0x1f)) + -1; } } else { iVar6 = -1; } uVar7 = 0x20; uVar3 = ~uVar5; if ((uVar3 != 0) && (uVar7 = 0, uVar3 != 0)) { for (; (uVar3 >> uVar7 & 1) == 0; uVar7 = uVar7 + 1) { } } uVar3 = iVar6 << ((byte)uVar7 & 0x1f); do { while( true ) { if (0x20 - param_4 < uVar7) goto LAB_00ae950a; uVar4 = uVar3 & uVar5; if (uVar4 == 0) break; if (param_4 == 1) { iVar6 = 1; } else { iVar6 = 0x1f; if (uVar4 != 0) { for (; uVar4 >> iVar6 == 0; iVar6 = iVar6 + -1) { } } iVar6 = (-uVar7 - (0x1f - iVar6)) + 0x20; } uVar7 = uVar7 + iVar6; uVar3 = uVar3 << ((byte)iVar6 & 0x1f); } LOCK(); if (uVar5 == *puVar1) { *puVar1 = uVar3 | uVar5; uVar4 = uVar5; } else { uVar4 = *puVar1; } UNLOCK(); bVar8 = uVar4 != uVar5; uVar5 = uVar4; } while (bVar8); uVar7 = param_3 * 0x20 + uVar7; *param_7 = uVar7; if ((param_5 == (code *)0x0) || (cVar2 = (*param_5)(uVar7,param_6), cVar2 != '\0')) { return 1; } if (param_4 < 0x20) { if (param_4 == 0) { uVar5 = 0; } else { uVar5 = (1 << ((byte)param_4 & 0x1f)) + -1 << ((byte)*param_7 & 0x1f); } } else { uVar5 = 0xffffffff; } puVar1 = (uint *)(param_1 + (*param_7 >> 5) * 4); LOCK(); *puVar1 = *puVar1 & ~uVar5; UNLOCK(); } LAB_00ae950a: param_3 = param_3 + 1; local_c = local_c + 1; } while (local_c < param_2); } return 0; } //@@ 00ae9590 FUN_00ae9590 undefined4 FUN_00ae9590(int param_1,undefined4 param_2,uint param_3,uint param_4) { uint *puVar1; uint uVar2; uint uVar3; uint uVar4; bool bVar5; if (param_3 < 0x20) { if (param_3 == 0) { uVar4 = 0; } else { uVar4 = (1 << ((byte)param_3 & 0x1f)) + -1 << ((byte)param_4 & 0x1f); } } else { uVar4 = 0xffffffff; } puVar1 = (uint *)(param_1 + (param_4 >> 5) * 4); uVar3 = *puVar1; do { LOCK(); uVar2 = *puVar1; bVar5 = uVar3 == uVar2; if (bVar5) { *puVar1 = uVar3 & ~uVar4; } else { uVar3 = uVar2; } UNLOCK(); } while (!bVar5); return CONCAT31((int3)((uVar3 & uVar4) >> 8),(uVar3 & uVar4) == uVar4); } //@@ 00ae95f0 FUN_00ae95f0 uint FUN_00ae95f0(int param_1,undefined4 param_2,undefined4 param_3,uint param_4) { int iVar1; uint uVar2; uint uVar3; uint *puVar4; bool bVar5; bool bVar6; uint local_10; uint local_c; uint local_8; iVar1 = FUN_00ae97a0(param_4,param_2,param_3,&local_8,&local_c,&local_10); puVar4 = (uint *)(param_1 + (param_4 >> 5) * 4); uVar2 = *puVar4; do { LOCK(); uVar3 = *puVar4; bVar5 = uVar2 == uVar3; if (bVar5) { *puVar4 = uVar2 & ~local_8; } else { uVar2 = uVar3; } UNLOCK(); } while (!bVar5); uVar2 = uVar2 & local_8; puVar4 = puVar4 + 1; bVar5 = uVar2 == local_8; if (iVar1 != 0) { do { uVar3 = *puVar4; do { LOCK(); uVar2 = *puVar4; bVar6 = uVar3 == uVar2; if (bVar6) { *puVar4 = uVar3 & ~local_c; } else { uVar3 = uVar2; } UNLOCK(); } while (!bVar6); puVar4 = puVar4 + 1; uVar2 = (uint)bVar5; if ((uVar3 & local_c) != local_c) { uVar2 = 0; } bVar5 = SUB41(uVar2,0); iVar1 = iVar1 + -1; } while (iVar1 != 0); } if (local_10 == 0) { return CONCAT31((int3)(uVar2 >> 8),bVar5); } uVar2 = *puVar4; do { LOCK(); uVar3 = *puVar4; bVar6 = uVar2 == uVar3; if (bVar6) { *puVar4 = uVar2 & ~local_10; } else { uVar2 = uVar3; } UNLOCK(); } while (!bVar6); uVar3 = (uint)bVar5; if ((uVar2 & local_10) != local_10) { uVar3 = 0; } return uVar3; } //@@ 00ae96c0 FUN_00ae96c0 undefined4 FUN_00ae96c0(int param_1,undefined4 param_2,undefined4 param_3,uint param_4,undefined1 *param_5) { uint *puVar1; int iVar2; uint uVar3; bool bVar4; uint local_10; uint local_c; uint local_8; iVar2 = FUN_00ae97a0(param_4,param_2,param_3,&local_c,&local_10,&local_8); puVar1 = (uint *)(param_1 + (param_4 >> 5) * 4); bVar4 = (*puVar1 & local_c) == local_c; uVar3 = CONCAT31((int3)((uint)iVar2 >> 8),(*puVar1 & local_c) != 0); for (; puVar1 = puVar1 + 1, iVar2 != 0; iVar2 = iVar2 + -1) { if ((*puVar1 & local_10) != local_10) { bVar4 = false; } uVar3 = uVar3 & 0xff; if ((*puVar1 & local_10) != 0) { uVar3 = 1; } } if (local_8 != 0) { if ((*puVar1 & local_8) != local_8) { bVar4 = false; } uVar3 = uVar3 & 0xff; if ((*puVar1 & local_8) != 0) { uVar3 = 1; } } if (param_5 != (undefined1 *)0x0) { *param_5 = (char)uVar3; } return CONCAT31((int3)(uVar3 >> 8),bVar4); } //@@ 00ae9770 FUN_00ae9770 int FUN_00ae9770(uint param_1,byte param_2) { if (0x1f < param_1) { return -1; } if (param_1 == 0) { return 0; } return (1 << ((byte)param_1 & 0x1f)) + -1 << (param_2 & 0x1f); } //@@ 00ae97a0 FUN_00ae97a0 uint FUN_00ae97a0(uint param_1,undefined4 param_2,uint param_3,int *param_4,undefined4 *param_5, int *param_6) { uint uVar1; int iVar2; uint uVar3; param_1 = param_1 & 0x1f; if (param_1 + param_3 < 0x21) { if (param_3 < 0x20) { if (param_3 == 0) { iVar2 = 0; } else { iVar2 = (1 << ((byte)param_3 & 0x1f)) + -1 << (sbyte)param_1; } } else { iVar2 = -1; } *param_4 = iVar2; *param_5 = 0; *param_6 = 0; return 0; } uVar1 = 0x20 - param_1; if (uVar1 < 0x20) { if (uVar1 == 0) { iVar2 = 0; } else { iVar2 = (1 << ((byte)uVar1 & 0x1f)) + -1 << (sbyte)param_1; } } else { iVar2 = -1; } uVar3 = param_3 - uVar1 >> 5; *param_4 = iVar2; *param_5 = 0xffffffff; uVar1 = param_3 - uVar1 & 0x1f; if (uVar1 == 0) { *param_6 = 0; return uVar3; } *param_6 = (1 << (sbyte)uVar1) + -1; return uVar3; } //@@ 00ae9860 FUN_00ae9860 undefined4 FUN_00ae9860(int param_1,int param_2,int param_3,uint param_4,uint param_5,int *param_6) { uint *puVar1; int iVar2; uint uVar3; undefined4 uVar4; uint uVar5; uint *puVar6; uint uVar7; uint *puVar8; uint uVar9; bool bVar10; uint local_14; uint local_10; puVar8 = (uint *)(param_1 + param_3 * 4); LAB_00ae9872: uVar7 = *puVar8; if (uVar7 == 0) { local_10 = 0x20; } else { iVar2 = 0x1f; if (uVar7 != 0) { for (; uVar7 >> iVar2 == 0; iVar2 = iVar2 + -1) { } } local_10 = 0x1f - iVar2; if (local_10 == 0) { return 0; } } if (param_4 <= local_10) { uVar4 = FUN_00ae90b0(param_1,param_3,param_4,param_6); return uVar4; } uVar7 = local_10; if ((uint)(param_2 - param_3) <= (param_4 - local_10) + 0x1f >> 5) { return 0; } do { puVar6 = puVar8 + 1; puVar8 = puVar8 + 1; if (param_4 < uVar7 + 0x20) { uVar5 = param_4 - uVar7; if (uVar5 < 0x20) { if (uVar5 == 0) { uVar9 = 0; } else { uVar9 = (1 << ((byte)uVar5 & 0x1f)) - 1; } } else { uVar9 = 0xffffffff; } } else { uVar5 = 0x20; uVar9 = 0xffffffff; } if ((uVar9 & *puVar6) != 0) { return 0; } uVar7 = uVar7 + uVar5; } while (uVar7 < param_4); uVar7 = FUN_00ae9770(local_10,0x20 - local_10); puVar6 = (uint *)(param_1 + param_3 * 4); local_14 = *puVar6; while ((local_14 & uVar7) == 0) { puVar1 = (uint *)(param_1 + param_3 * 4); LOCK(); uVar5 = *puVar1; if (local_14 == uVar5) { *puVar1 = uVar7 | local_14; uVar5 = local_14; } else { } UNLOCK(); if (uVar5 == local_14) { puVar6 = (uint *)(param_1 + (param_3 + 1) * 4); goto joined_r0x00ae9967; } local_14 = uVar5; } goto LAB_00ae99a7; joined_r0x00ae9967: if (puVar8 <= puVar6) goto LAB_00ae9984; uVar5 = 0; LOCK(); if (*puVar6 == 0) { *puVar6 = 0xffffffff; } else { uVar5 = *puVar6; } UNLOCK(); if (uVar5 != 0) goto LAB_00ae99a7; puVar6 = puVar6 + 1; goto joined_r0x00ae9967; LAB_00ae9984: uVar5 = *puVar6; while ((uVar9 & uVar5) == 0) { LOCK(); if (uVar5 == *puVar6) { *puVar6 = uVar9 | uVar5; uVar3 = uVar5; } else { uVar3 = *puVar6; } UNLOCK(); bVar10 = uVar3 == uVar5; uVar5 = uVar3; if (bVar10) { *param_6 = (param_3 + 1) * 0x20 - local_10; return 1; } } LAB_00ae99a7: puVar8 = (uint *)(param_1 + param_3 * 4); while (puVar6 = puVar6 + -1, puVar8 < puVar6) { *puVar6 = 0; } if (puVar6 == puVar8) { uVar5 = *puVar6; while( true ) { LOCK(); if (uVar5 == *puVar6) { *puVar6 = ~uVar7 & uVar5; uVar9 = uVar5; } else { uVar9 = *puVar6; } UNLOCK(); if (uVar9 == uVar5) break; uVar5 = uVar9; } } if (3 < param_5) { return 0; } param_5 = param_5 + 1; goto LAB_00ae9872; } //@@ 00ae9ad0 FUN_00ae9ad0 undefined4 FUN_00ae9ad0(void) { return DAT_00bf92f0; } //@@ 00ae9ae0 FUN_00ae9ae0 void FUN_00ae9ae0(PVOID param_1) { DWORD dwFlsIndex; dwFlsIndex = DAT_00bf92e8; *(PVOID *)(*(int *)((int)ThreadLocalStoragePointer + _tls_index * 4) + 8) = param_1; FlsSetValue(dwFlsIndex,param_1); return; } //@@ 00ae9b10 FUN_00ae9b10 int FUN_00ae9b10(void) { uint3 uVar1; uVar1 = (uint3)((uint)DAT_00bf8e10 >> 8); if ((DAT_00bf8e10 == (void **)0x0) || (DAT_00bf8e10 == &ExceptionList)) { return CONCAT31(uVar1,1); } return (uint)uVar1 << 8; } //@@ 00ae9b30 FUN_00ae9b30 undefined1 FUN_00ae9b30(void) { return DAT_00bf92ec; } //@@ 00ae9b40 FUN_00ae9b40 void FUN_00ae9b40(int *param_1) { undefined **ppuVar1; bool bVar2; undefined **ppuVar3; DWORD dwFlsIndex; int iVar4; undefined **ppuVar5; int *piVar6; LOCK(); DAT_00bf92f0 = DAT_00bf92f0 + -1; UNLOCK(); FUN_00aedf10(&DAT_00c69f00,1); dwFlsIndex = DAT_00bf92e8; if (((void **)param_1[0x164] == &ExceptionList) && (param_1 != &DAT_00bf8240)) { if ((DAT_00bf8e10 == (void **)0x0) || (DAT_00bf8e10 == &ExceptionList)) { bVar2 = true; } else { bVar2 = false; } ppuVar5 = &PTR_DAT_00bf8880; if (!bVar2) { ppuVar5 = (undefined **)&DAT_00bf8240; } *(undefined ***)(*(int *)((int)ThreadLocalStoragePointer + _tls_index * 4) + 8) = ppuVar5; FlsSetValue(dwFlsIndex,ppuVar5); ppuVar5 = *(undefined ***)(*param_1 + 0xc); if (ppuVar5 != (undefined **)&DAT_00bf8240) { ppuVar1 = *(undefined ***)(*ppuVar5 + 0x10); while (ppuVar3 = ppuVar1, ppuVar3 != (undefined **)0x0) { ppuVar1 = (undefined **)ppuVar3[0x18e]; if (ppuVar3 != ppuVar5) { FUN_00ae6960(ppuVar3); } } if (ppuVar5 != &PTR_DAT_00bf8880) { FUN_00ae6510(ppuVar5); FUN_00aedf50(*ppuVar5 + 0x1e8); piVar6 = &DAT_00c6a084; do { if (*piVar6 == 0) { LOCK(); iVar4 = *piVar6; if (iVar4 == 0) { *piVar6 = (int)ppuVar5; iVar4 = 0; } UNLOCK(); if (iVar4 == 0) { return; } } piVar6 = piVar6 + 1; if (0xc6a0a3 < (int)piVar6) { FUN_00ae84c0(ppuVar5,0xa68,&_mi_stats_main); return; } } while( true ); } FUN_00aedf50(PTR_DAT_00bf8880 + 0x1e8); piVar6 = &DAT_00c6a084; do { if (*piVar6 != 0) { LOCK(); iVar4 = *piVar6; *piVar6 = 0; UNLOCK(); if (iVar4 != 0) { FUN_00ae84c0(iVar4,0xa68,&_mi_stats_main); } } piVar6 = piVar6 + 1; } while ((int)piVar6 < 0xc6a0a4); } } return; } //@@ 00ae9ca0 FUN_00ae9ca0 void FUN_00ae9ca0(int param_1) { if (param_1 != 0) { FUN_00ae9b40(param_1); } return; } //@@ 00ae9cc0 FUN_00ae9cc0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00ae9cc0(void) { if (DAT_00bf8e18 == 0) { DAT_00bf8e10 = &ExceptionList; DAT_00bf8e18 = 1; FUN_00aea190(&DAT_00bf8e24); DAT_00bf8e18 = FUN_00ae6610(&PTR_DAT_00bf8880); _DAT_00bf8e1c = FUN_00ae6610(&PTR_DAT_00bf8880); _DAT_00bf8e20 = FUN_00ae6610(&PTR_DAT_00bf8880); } return; } //@@ 00ae9d20 FUN_00ae9d20 void FUN_00ae9d20(void) { char cVar1; if (DAT_00c6a070 == '\0') { return; } if (DAT_00c6a0a4 != '\0') { return; } DAT_00c6a0a4 = 1; FlsFree(DAT_00bf92e8); FUN_00ae68b0(1); cVar1 = FUN_00ae8090(1); if ((cVar1 != '\0') || (cVar1 = FUN_00ae8090(2), cVar1 != '\0')) { FUN_00aeef70(0); } FUN_00ae7930("process done: 0x%zx\n",DAT_00bf8e10); DAT_00bf92ec = 1; return; } //@@ 00ae9d90 FUN_00ae9d90 void FUN_00ae9d90(void) { DWORD dwFlsIndex; if (DAT_00c6a0a5 == '\0') { DAT_00c6a0a5 = '\x01'; dwFlsIndex = FlsAlloc(FUN_00ae9ca0); DAT_00bf92e8 = dwFlsIndex; *(undefined ***)(*(int *)((int)ThreadLocalStoragePointer + _tls_index * 4) + 8) = &PTR_DAT_00bf8880; FlsSetValue(dwFlsIndex,&PTR_DAT_00bf8880); } return; } //@@ 00ae9de0 FUN_00ae9de0 /* WARNING: Removing unreachable block (ram,0x00ae9e36) */ void FUN_00ae9de0(void) { char cVar1; int iVar2; int iVar3; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; if (DAT_00c6a070 == '\0') { ExceptionList = &local_10; FUN_00ae7930("process init: 0x%zx\n",&ExceptionList); DAT_00c6a070 = '\x01'; FUN_00ae9d90(); iVar2 = cpuid_Extended_Feature_Enumeration_info(7); DAT_00c6a080 = (byte)(*(uint *)(iVar2 + 8) >> 4) & 1; FUN_00ae8670(); FUN_00ae9cc0(); FUN_00ae7930("secure level: %d\n",0); mi_thread_init(); FlsSetValue(DAT_00bf92e8,(PVOID)0x0); FUN_00aeefd0(); cVar1 = FUN_00ae8090(7); if (cVar1 != '\0') { iVar2 = FUN_00ae8040(7,0,0x20000); iVar3 = FUN_00ae8000(8); if (iVar3 == -1) { FUN_00ae6230(iVar2,0,iVar2 * 500); } else { FUN_00ae5fd0(iVar2,iVar3); } } cVar1 = FUN_00ae8090(9); if ((cVar1 != '\0') && (iVar2 = FUN_00ae8000(9), 0 < iVar2)) { FUN_00ae6300(iVar2 << 10,1,1); } } ExceptionList = local_10; return; } //@@ 00ae9f10 mi_thread_init /* DB: mimalloc init.c: calls mi_process_init (FUN_00ae9de0), if the thread's default heap is the empty heap: main thread -> heap main init, else takes a cached td or _mi_os_alloc(0xa68) ('unable to allocate thread local heap metadata (%zu bytes)'), copies _mi_heap_empty/tld_empty, random keys, FlsSetValue, stat threads++ prototype: db/protos.zhl */ void __cdecl mi_thread_init(void) { int iVar1; DWORD DVar2; uint uVar3; int *piVar4; int iVar5; int *piVar6; int *local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; FUN_00ae9de0(); iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar1 + 0x10) == '\0') { FUN_00aeff45(); } if (*(undefined4 **)(iVar1 + 8) == &DAT_00bf8240) { if ((DAT_00bf8e10 == (void **)0x0) || (DAT_00bf8e10 == &ExceptionList)) { FUN_00ae9cc0(); DVar2 = DAT_00bf92e8; *(undefined ***)(iVar1 + 8) = &PTR_DAT_00bf8880; FlsSetValue(DVar2,&PTR_DAT_00bf8880); } else { piVar4 = &DAT_00c6a084; do { if (*piVar4 != 0) { LOCK(); local_14 = (int *)*piVar4; *piVar4 = 0; UNLOCK(); if (local_14 != (int *)0x0) goto LAB_00ae9feb; } piVar4 = piVar4 + 1; } while ((int)piVar4 < 0xc6a0a4); local_14 = (int *)FUN_00ae8110(0xa68,&_mi_stats_main); if ((local_14 == (int *)0x0) && (local_14 = (int *)FUN_00ae8110(0xa68,&_mi_stats_main), local_14 == (int *)0x0)) { FUN_00ae7510(0xc,"unable to allocate thread local heap metadata (%zu bytes)\n",0xa68); } else { LAB_00ae9feb: if (DAT_00c6a080 == '\0') { piVar4 = (int *)&DAT_00b19c80; piVar6 = local_14 + 400; for (iVar5 = 0x10a; iVar5 != 0; iVar5 = iVar5 + -1) { *piVar6 = *piVar4; piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; } } else { piVar4 = (int *)&DAT_00b19c80; piVar6 = local_14 + 400; for (iVar5 = 0x428; iVar5 != 0; iVar5 = iVar5 + -1) { *(char *)piVar6 = (char)*piVar4; piVar4 = (int *)((int)piVar4 + 1); piVar6 = (int *)((int)piVar6 + 1); } } if (DAT_00c6a080 == '\0') { piVar4 = &DAT_00bf8240; piVar6 = local_14; for (iVar5 = 400; iVar5 != 0; iVar5 = iVar5 + -1) { *piVar6 = *piVar4; piVar4 = piVar4 + 1; piVar6 = piVar6 + 1; } } else { piVar4 = &DAT_00bf8240; piVar6 = local_14; for (iVar5 = 0x640; iVar5 != 0; iVar5 = iVar5 + -1) { *(char *)piVar6 = (char)*piVar4; piVar4 = (int *)((int)piVar4 + 1); piVar6 = (int *)((int)piVar6 + 1); } } local_14[0x164] = (int)&ExceptionList; FUN_00aea170(local_14 + 0x169); uVar3 = FUN_00ae6610(local_14); local_14[0x166] = uVar3 | 1; iVar5 = FUN_00ae6610(local_14); local_14[0x167] = iVar5; iVar5 = FUN_00ae6610(local_14); local_14[0x168] = iVar5; *local_14 = (int)(local_14 + 400); local_14[0x206] = (int)(local_14 + 0x207); local_14[0x193] = (int)local_14; local_14[0x194] = (int)local_14; DVar2 = DAT_00bf92e8; local_14[0x205] = (int)(local_14 + 0x20a); local_14[0x208] = (int)(local_14 + 0x20a); *(int **)(iVar1 + 8) = local_14; FlsSetValue(DVar2,local_14); } } FUN_00aedf30(&DAT_00c69f00,1); LOCK(); DAT_00bf92f0 = DAT_00bf92f0 + 1; UNLOCK(); } ExceptionList = local_10; return; } //@@ 00aea110 FUN_00aea110 void FUN_00aea110(uint param_1) { uint uVar1; int iVar2; LARGE_INTEGER local_c; QueryPerformanceCounter(&local_c); param_1 = local_c.s.LowPart ^ 0xaea110 ^ param_1; for (iVar2 = ((param_1 >> 0x11 ^ param_1) & 0xf) + 1; iVar2 != 0; iVar2 = iVar2 + -1) { if (param_1 == 0) { param_1 = 0x11; } uVar1 = (param_1 >> 0x10 ^ param_1) * 0x7feb352d; param_1 = (uVar1 >> 0xf ^ uVar1) * -0x7b935975; param_1 = param_1 >> 0x10 ^ param_1; } return; } //@@ 00aea170 FUN_00aea170 void FUN_00aea170(void *param_1) { mi_random_init_ex(param_1,0); return; } //@@ 00aea190 FUN_00aea190 void FUN_00aea190(void *param_1) { mi_random_init_ex(param_1,1); return; } //@@ 00aea1b0 FUN_00aea1b0 undefined4 FUN_00aea1b0(int param_1) { undefined4 uVar1; int iVar2; iVar2 = *(int *)(param_1 + 0x80); if (iVar2 < 1) { chacha_block(param_1); *(undefined4 *)(param_1 + 0x80) = 0x10; iVar2 = 0x10; } uVar1 = *(undefined4 *)(param_1 + (0x20 - iVar2) * 4); *(undefined4 *)(param_1 + (0x20 - iVar2) * 4) = 0; *(int *)(param_1 + 0x80) = *(int *)(param_1 + 0x80) + -1; return uVar1; } //@@ 00aea200 FUN_00aea200 void FUN_00aea200(void *param_1) { if (*(char *)((int)param_1 + 0x84) != '\0') { mi_random_init_ex(param_1,0); } return; } //@@ 00aea220 FUN_00aea220 void FUN_00aea220(undefined4 *param_1,undefined4 *param_2) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; undefined4 *puVar5; memset(param_2,0,0x88); if (DAT_00c6a080 == '\0') { uVar1 = param_1[1]; uVar2 = param_1[2]; uVar3 = param_1[3]; *param_2 = *param_1; param_2[1] = uVar1; param_2[2] = uVar2; param_2[3] = uVar3; uVar1 = param_1[5]; uVar2 = param_1[6]; uVar3 = param_1[7]; param_2[4] = param_1[4]; param_2[5] = uVar1; param_2[6] = uVar2; param_2[7] = uVar3; uVar1 = param_1[9]; uVar2 = param_1[10]; uVar3 = param_1[0xb]; param_2[8] = param_1[8]; param_2[9] = uVar1; param_2[10] = uVar2; param_2[0xb] = uVar3; uVar1 = param_1[0xd]; uVar2 = param_1[0xe]; uVar3 = param_1[0xf]; param_2[0xc] = param_1[0xc]; param_2[0xd] = uVar1; param_2[0xe] = uVar2; param_2[0xf] = uVar3; } else { puVar5 = param_2; for (iVar4 = 0x40; iVar4 != 0; iVar4 = iVar4 + -1) { *(undefined1 *)puVar5 = *(undefined1 *)param_1; param_1 = (undefined4 *)((int)param_1 + 1); puVar5 = (undefined4 *)((int)puVar5 + 1); } } param_2[0xc] = 0; param_2[0xd] = 0; param_2[0xe] = param_2; param_2[0xf] = 0; chacha_block(param_2); return; } //@@ 00aea2a0 chacha_block /* DB: mimalloc random.c: copies 16-word ctx->input, 10 double rounds (local=10), adds input back, bumps 64-bit counter; callers 0xaea1b0/0xaea220 (chacha_next32 / mi_random_split region) */ void chacha_block(uint *param_1) { uint *puVar1; uint *puVar2; uint *puVar3; uint uVar4; uint uVar5; uint uVar6; uint uVar7; uint uVar8; uint local_84 [16]; uint local_44; uint local_40; uint local_3c; uint local_38; uint local_34; uint local_30; uint local_2c; uint local_28; uint local_24; uint local_20; int local_1c; uint local_18; uint local_14; uint local_10; uint local_c; uint local_8; local_1c = 10; local_84[0] = *param_1; local_84[1] = param_1[1]; local_84[2] = param_1[2]; local_84[3] = param_1[3]; local_c = param_1[4]; local_8 = param_1[5]; local_10 = param_1[6]; local_18 = param_1[7]; local_84[8] = param_1[8]; local_84[9] = param_1[9]; local_84[10] = param_1[10]; local_84[0xb] = param_1[0xb]; local_28 = param_1[0xc]; local_14 = param_1[0xd]; local_84[0xe] = param_1[0xe]; local_20 = param_1[0xf]; do { local_28 = local_c + local_84[0] ^ local_28; uVar4 = local_28 << 0x10 | local_28 >> 0x10; local_84[8] = local_84[8] + uVar4; uVar8 = local_84[8] ^ local_c; uVar8 = uVar8 << 0xc | uVar8 >> 0x14; local_84[0] = local_c + local_84[0] + uVar8; uVar4 = local_84[0] ^ uVar4; uVar4 = uVar4 << 8 | uVar4 >> 0x18; local_34 = uVar4 + local_84[8]; uVar8 = local_34 ^ uVar8; local_3c = uVar8 << 7 | uVar8 >> 0x19; local_14 = local_14 ^ local_8 + local_84[1]; uVar8 = local_14 << 0x10 | local_14 >> 0x10; local_84[9] = local_84[9] + uVar8; uVar5 = local_84[9] ^ local_8; uVar5 = uVar5 << 0xc | uVar5 >> 0x14; local_24 = local_8 + local_84[1] + uVar5; uVar8 = local_24 ^ uVar8; local_30 = uVar8 << 8 | uVar8 >> 0x18; local_44 = local_30 + local_84[9]; uVar5 = local_44 ^ uVar5; uVar8 = uVar5 << 7 | uVar5 >> 0x19; local_84[0xe] = local_84[0xe] ^ local_84[2] + local_10; uVar5 = local_84[0xe] << 0x10 | local_84[0xe] >> 0x10; local_84[10] = local_84[10] + uVar5; uVar6 = local_84[10] ^ local_10; uVar6 = uVar6 << 0xc | uVar6 >> 0x14; local_2c = local_84[2] + local_10 + uVar6; uVar5 = local_2c ^ uVar5; local_40 = uVar5 << 8 | uVar5 >> 0x18; local_84[10] = local_40 + local_84[10]; uVar6 = local_84[10] ^ uVar6; uVar5 = uVar6 << 7 | uVar6 >> 0x19; local_20 = local_20 ^ local_84[3] + local_18; uVar7 = local_20 << 0x10 | local_20 >> 0x10; local_84[0xb] = local_84[0xb] + uVar7; uVar6 = local_84[0xb] ^ local_18; uVar6 = uVar6 << 0xc | uVar6 >> 0x14; local_38 = local_84[3] + local_18 + uVar6; uVar7 = local_38 ^ uVar7; uVar7 = uVar7 << 8 | uVar7 >> 0x18; local_84[0xb] = uVar7 + local_84[0xb]; uVar6 = local_84[0xb] ^ uVar6; uVar6 = uVar6 << 7 | uVar6 >> 0x19; local_84[0] = uVar8 + local_84[0]; uVar7 = local_84[0] ^ uVar7; uVar7 = uVar7 << 0x10 | uVar7 >> 0x10; local_84[10] = uVar7 + local_84[10]; uVar8 = local_84[10] ^ uVar8; uVar8 = uVar8 << 0xc | uVar8 >> 0x14; local_84[0] = local_84[0] + uVar8; uVar7 = local_84[0] ^ uVar7; local_20 = uVar7 << 8 | uVar7 >> 0x18; local_84[0xf] = local_20; local_84[10] = local_20 + local_84[10]; uVar8 = uVar8 ^ local_84[10]; local_24 = local_24 + uVar5; local_8 = uVar8 << 7 | uVar8 >> 0x19; uVar4 = local_24 ^ uVar4; uVar4 = uVar4 << 0x10 | uVar4 >> 0x10; local_84[5] = local_8; local_84[0xb] = uVar4 + local_84[0xb]; uVar5 = local_84[0xb] ^ uVar5; uVar8 = uVar5 << 0xc | uVar5 >> 0x14; local_84[1] = local_24 + uVar8; uVar4 = local_84[1] ^ uVar4; local_28 = uVar4 << 8 | uVar4 >> 0x18; local_84[0xc] = local_28; local_84[0xb] = local_28 + local_84[0xb]; uVar8 = uVar8 ^ local_84[0xb]; local_2c = local_2c + uVar6; local_10 = uVar8 << 7 | uVar8 >> 0x19; local_30 = local_2c ^ local_30; local_84[6] = local_10; uVar4 = local_30 << 0x10 | local_30 >> 0x10; local_34 = local_34 + uVar4; uVar6 = local_34 ^ uVar6; uVar8 = uVar6 << 0xc | uVar6 >> 0x14; local_84[2] = local_2c + uVar8; uVar4 = local_84[2] ^ uVar4; local_14 = uVar4 << 8 | uVar4 >> 0x18; local_84[0xd] = local_14; local_84[8] = local_14 + local_34; uVar8 = uVar8 ^ local_84[8]; local_18 = uVar8 << 7 | uVar8 >> 0x19; local_40 = local_38 + local_3c ^ local_40; uVar4 = local_40 << 0x10 | local_40 >> 0x10; local_44 = local_44 + uVar4; local_84[7] = local_18; uVar8 = local_44 ^ local_3c; uVar8 = uVar8 << 0xc | uVar8 >> 0x14; local_84[3] = uVar8 + local_38 + local_3c; uVar4 = local_84[3] ^ uVar4; local_84[0xe] = uVar4 << 8 | uVar4 >> 0x18; local_84[9] = local_44 + local_84[0xe]; uVar8 = uVar8 ^ local_84[9]; local_c = uVar8 << 7 | uVar8 >> 0x19; local_1c = local_1c + -1; local_84[4] = local_c; } while (local_1c != 0); uVar4 = 0; puVar3 = param_1 + 1; do { puVar2 = local_84 + uVar4; puVar1 = puVar3 + 4; uVar4 = uVar4 + 4; puVar3[0xf] = *puVar2 + puVar3[-1]; puVar3[0x10] = *(int *)((int)local_84 + (-0x10 - (int)param_1) + (int)puVar1) + *puVar3; puVar3[0x11] = *(int *)((int)local_84 + (-0xc - (int)param_1) + (int)puVar1) + puVar3[1]; puVar3[0x12] = *(int *)((int)local_84 + (-8 - (int)param_1) + (int)puVar1) + puVar3[2]; puVar3 = puVar1; } while (uVar4 < 0x10); puVar3 = param_1 + 0xc; *puVar3 = *puVar3 + 1; param_1[0x20] = 0x10; if (*puVar3 == 0) { puVar3 = param_1 + 0xd; *puVar3 = *puVar3 + 1; if (*puVar3 == 0) { param_1[0xe] = param_1[0xe] + 1; } } return; } //@@ 00aea540 FUN_00aea540 void FUN_00aea540(undefined4 *param_1,undefined4 *param_2,undefined4 param_3,undefined4 param_4) { memset(param_1 + 4,0,0x78); *param_1 = 0x61707865; param_1[1] = 0x3320646e; param_1[2] = 0x79622d32; param_1[3] = 0x6b206574; param_1[4] = *param_2; param_1[5] = param_2[1]; param_1[6] = param_2[2]; param_1[7] = param_2[3]; param_1[8] = param_2[4]; param_1[9] = param_2[5]; param_1[10] = param_2[6]; param_1[0xb] = param_2[7]; param_1[0xe] = param_3; param_1[0xc] = 0; param_1[0xd] = 0; param_1[0xf] = param_4; return; } //@@ 00aea6b0 mi_random_init_ex /* DB: mimalloc random.c: BCryptGenRandom for the 32-byte key, on failure "unable to use secure randomness\n" and weak seed with _mi_random_shuffle constants 0x7feb352d/0x846ca68b, then chacha init; 3 callers = _mi_random_init / _mi_random_init_weak / _mi_random_reinit_if_weak (00aea170/00aea190/00aea200) prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl mi_random_init_ex(void *ctx,byte isWeak) { NTSTATUS NVar1; uint uVar2; undefined1 uVar3; uint local_24; uint local_20; uint local_1c; uint local_18; uint local_14; uint local_10; uint local_c; uint local_8; if (isWeak == 0) { NVar1 = BCryptGenRandom((BCRYPT_ALG_HANDLE)0x0,(PUCHAR)&local_24,0x20,2); if (-1 < NVar1) { uVar3 = 0; goto LAB_00aea8c6; } FUN_00ae79e0("unable to use secure randomness\n"); } uVar2 = FUN_00aea110(0); if (uVar2 == 0) { local_24 = 0x4ca56ae5; local_20 = 0xe7a169b6; LAB_00aea728: uVar2 = (local_20 >> 0x10 ^ local_20) * 0x7feb352d; local_1c = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_1c = local_1c >> 0x10 ^ local_1c; if (local_1c == 0) { local_18 = 0x4ca56ae5; local_14 = 0xe7a169b6; goto LAB_00aea783; } LAB_00aea819: uVar2 = (local_1c >> 0x10 ^ local_1c) * 0x7feb352d; local_18 = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_18 = local_18 >> 0x10 ^ local_18; if (local_18 != 0) goto LAB_00aea93e; local_14 = 0x4ca56ae5; local_10 = 0xe7a169b6; LAB_00aea874: uVar2 = (local_10 >> 0x10 ^ local_10) * 0x7feb352d; local_c = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_c = local_c >> 0x10 ^ local_c; uVar2 = local_c; if (local_c == 0) { uVar2 = 0x11; } } else { uVar2 = (uVar2 >> 0x10 ^ uVar2) * 0x7feb352d; uVar2 = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_24 = uVar2 >> 0x10 ^ uVar2; if (local_24 == 0) { local_20 = 0x4ca56ae5; local_1c = 0xe7a169b6; goto LAB_00aea819; } uVar2 = (uVar2 >> 0x10 ^ local_24) * 0x7feb352d; local_20 = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_20 = local_20 >> 0x10 ^ local_20; if (local_20 != 0) goto LAB_00aea728; local_1c = 0x4ca56ae5; local_18 = 0xe7a169b6; LAB_00aea93e: uVar2 = (local_18 >> 0x10 ^ local_18) * 0x7feb352d; local_14 = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_14 = local_14 >> 0x10 ^ local_14; if (local_14 == 0) { local_10 = 0x4ca56ae5; uVar2 = 0xe7a169b6; local_c = 0xe7a169b6; } else { LAB_00aea783: uVar2 = (local_14 >> 0x10 ^ local_14) * 0x7feb352d; local_10 = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_10 = local_10 >> 0x10 ^ local_10; if (local_10 != 0) goto LAB_00aea874; local_c = 0x4ca56ae5; uVar2 = 0x4ca56ae5; } } uVar2 = (uVar2 >> 0x10 ^ uVar2) * 0x7feb352d; local_8 = (uVar2 >> 0xf ^ uVar2) * -0x7b935975; local_8 = local_8 >> 0x10 ^ local_8; uVar3 = 1; LAB_00aea8c6: *(undefined1 *)((int)ctx + 0x84) = uVar3; FUN_00aea540(ctx,&local_24,ctx,0); return; } //@@ 00aea9b0 FUN_00aea9b0 undefined4 FUN_00aea9b0(int param_1,undefined4 *param_2,undefined4 *param_3,char *param_4,undefined1 *param_5, undefined1 *param_6,undefined4 param_7,undefined4 *param_8,undefined4 param_9) { undefined4 uVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; char *pcVar5; char cVar6; int iVar7; uint uVar8; undefined4 local_8; pcVar5 = param_4; if (param_1 != 0x400000) { return 0; } if (DAT_00c69da8 == 1) { uVar8 = 0; } else { iVar7 = FUN_00ae88d0(param_9); uVar8 = 0; if (0 < iVar7) { uVar8 = DAT_00c69da8; if (DAT_00c69da8 == 0) { uVar8 = FUN_00ae8820(); } uVar8 = (int)(0x10 / (ulonglong)uVar8) * iVar7; uVar8 = -(uint)(uVar8 < 0x10) & uVar8; } } param_1 = 0; local_8 = param_7; if ((*pcVar5 == '\0') || (cVar6 = FUN_00ae9440(&DAT_00bf9340,0x10,uVar8,1,FUN_00aeae50,&local_8,¶m_1), cVar6 == '\0' )) { cVar6 = FUN_00ae9440(&DAT_00bf9300,0x10,uVar8,1,FUN_00aeae50,&local_8,¶m_1); if (cVar6 == '\0') { return 0; } cVar6 = '\0'; } else { cVar6 = '\x01'; } *pcVar5 = cVar6; uVar1 = *(undefined4 *)(&DAT_00c6a0c0 + param_1 * 0x38); *param_8 = *(undefined4 *)(&DAT_00c6a0c4 + param_1 * 0x38); *param_5 = (&DAT_00c6a0c8)[param_1 * 0x38]; *param_6 = 0; iVar7 = param_1 * 0x38; uVar2 = *(undefined4 *)(iVar7 + 0xc6a0d0); uVar3 = *(undefined4 *)(iVar7 + 0xc6a0d4); uVar4 = *(undefined4 *)(iVar7 + 0xc6a0d8); *param_2 = *(undefined4 *)(&DAT_00c6a0cc + iVar7); param_2[1] = uVar2; param_2[2] = uVar3; param_2[3] = uVar4; iVar7 = param_1 * 0x38; uVar2 = *(undefined4 *)(&DAT_00c6a0e0 + iVar7); uVar3 = *(undefined4 *)(&DAT_00c6a0e4 + iVar7); uVar4 = *(undefined4 *)(&DAT_00c6a0e8 + iVar7); *param_3 = *(undefined4 *)(&DAT_00c6a0dc + iVar7); param_3[1] = uVar2; param_3[2] = uVar3; param_3[3] = uVar4; *(undefined4 *)(&DAT_00c6a0c0 + param_1 * 0x38) = 0; (&DAT_00c6a0f0)[param_1 * 7] = 0; FUN_00ae9590(&DAT_00c710c0,0x10,1,param_1); return uVar1; } //@@ 00aeab10 FUN_00aeab10 undefined4 FUN_00aeab10(uint param_1,int param_2,undefined4 param_3,undefined4 *param_4,undefined4 *param_5, char param_6,char param_7,int param_8) { int iVar1; undefined4 uVar2; undefined4 uVar3; undefined4 uVar4; char cVar5; char cVar6; int iVar7; int iVar8; undefined *puVar9; uint uVar10; longlong local_c; if ((param_2 == 0x400000) && ((param_1 & 0x3fffff) == 0)) { if (DAT_00c69da8 == 1) { uVar10 = 0; } else { iVar7 = FUN_00ae88d0(0); uVar10 = 0; if (0 < iVar7) { uVar10 = DAT_00c69da8; if (DAT_00c69da8 == 0) { uVar10 = FUN_00ae8820(); } uVar10 = (int)(0x10 / (ulonglong)uVar10) * iVar7; uVar10 = -(uint)(uVar10 < 0x10) & uVar10; } } FUN_00aeae80(0,param_8); cVar6 = FUN_00ae9180(&DAT_00c710c0,0x10,uVar10,1,¶m_2); cVar5 = param_6; iVar7 = param_2; if (cVar6 != '\0') { iVar1 = param_2 * 0x38; *(undefined4 *)(&DAT_00c6a0c4 + param_2 * 0x38) = param_3; *(uint *)(&DAT_00c6a0c0 + param_2 * 0x38) = param_1; (&DAT_00c6a0c8)[param_2 * 0x38] = param_7; (&DAT_00c6a0f0)[param_2 * 7] = 0; uVar2 = param_4[1]; uVar3 = param_4[2]; uVar4 = param_4[3]; *(undefined4 *)(&DAT_00c6a0cc + iVar1) = *param_4; *(undefined4 *)(iVar1 + 0xc6a0d0) = uVar2; *(undefined4 *)(iVar1 + 0xc6a0d4) = uVar3; *(undefined4 *)(iVar1 + 0xc6a0d8) = uVar4; uVar2 = param_5[1]; uVar3 = param_5[2]; uVar4 = param_5[3]; uVar10 = 0; iVar8 = param_2 * 0x38; *(undefined4 *)(&DAT_00c6a0dc + iVar8) = *param_5; *(undefined4 *)(&DAT_00c6a0e0 + iVar8) = uVar2; *(undefined4 *)(&DAT_00c6a0e4 + iVar8) = uVar3; *(undefined4 *)(&DAT_00c6a0e8 + iVar8) = uVar4; do { if (param_4[uVar10] != 0) { if (((param_6 == '\0') && (param_7 == '\0')) && (cVar6 = FUN_00ae8090(0x16), cVar6 != '\0')) { iVar8 = FUN_00ae8000(0x17); if (iVar8 == 0) { FUN_00aeb020(); FUN_00aead90(&DAT_00c6a0cc + iVar1,param_1,0x400000,*(undefined4 *)(param_8 + 4)); *(undefined4 *)(&DAT_00c6a0dc + iVar7 * 0x38) = 0; *(undefined4 *)(&DAT_00c6a0e0 + iVar7 * 0x38) = 0; *(undefined4 *)(&DAT_00c6a0e4 + iVar7 * 0x38) = 0; *(undefined4 *)(&DAT_00c6a0e8 + iVar7 * 0x38) = 0; } else { local_c = FUN_00aede40(); local_c = local_c + iVar8; (&DAT_00c6a0f0)[iVar7 * 7] = local_c; } } break; } uVar10 = uVar10 + 1; } while (uVar10 < 4); puVar9 = &DAT_00bf9340; if (cVar5 == '\0') { puVar9 = &DAT_00bf9300; } FUN_00ae9590(puVar9,0x10,1,param_2); return 1; } } return 0; } //@@ 00aeacf0 FUN_00aeacf0 void FUN_00aeacf0(uint param_1) { uint uVar1; uint uVar2; uint uVar3; if (param_1 < 0x80000000) { uVar1 = param_1 >> 0x1b; if (uVar1 != 0x10) { uVar3 = *(uint *)(&DAT_00c71100 + uVar1 * 4); while( true ) { LOCK(); uVar2 = *(uint *)(&DAT_00c71100 + uVar1 * 4); if (uVar3 == uVar2) { *(uint *)(&DAT_00c71100 + uVar1 * 4) = uVar3 | 1 << (param_1 >> 0x16 & 0x1f); uVar2 = uVar3; } else { } UNLOCK(); if (uVar2 == uVar3) break; uVar3 = uVar2; } } } return; } //@@ 00aead40 FUN_00aead40 void FUN_00aead40(uint param_1) { uint uVar1; uint uVar2; uint uVar3; if (param_1 < 0x80000000) { uVar1 = param_1 >> 0x1b; if (uVar1 != 0x10) { uVar3 = *(uint *)(&DAT_00c71100 + uVar1 * 4); while( true ) { LOCK(); uVar2 = *(uint *)(&DAT_00c71100 + uVar1 * 4); if (uVar3 == uVar2) { *(uint *)(&DAT_00c71100 + uVar1 * 4) = uVar3 & ~(1 << (param_1 >> 0x16 & 0x1f)); uVar2 = uVar3; } else { } UNLOCK(); if (uVar2 == uVar3) break; uVar3 = uVar2; } } } return; } //@@ 00aead90 FUN_00aead90 void FUN_00aead90(undefined4 *param_1,int param_2,uint param_3,undefined4 param_4) { uint uVar1; int iVar2; int local_8; uVar1 = 0; do { if (param_1[uVar1] != 0) { uVar1 = 0; goto LAB_00aeadb0; } uVar1 = uVar1 + 1; } while (uVar1 < 4); goto LAB_00aeae21; while (uVar1 = uVar1 + 1, uVar1 < 4) { LAB_00aeadb0: if (param_1[uVar1] != -1) { local_8 = 0; iVar2 = FUN_00aeb1a0(param_1,&local_8); while (iVar2 != 0) { FUN_00ae8400(local_8 * (param_3 >> 7) + param_2,iVar2 * (param_3 >> 7),param_4); local_8 = local_8 + iVar2; iVar2 = FUN_00aeb1a0(param_1,&local_8); } goto LAB_00aeae21; } } FUN_00ae8400(param_2,param_3,param_4); LAB_00aeae21: *param_1 = 0; param_1[1] = 0; param_1[2] = 0; param_1[3] = 0; return; } //@@ 00aeae50 FUN_00aeae50 void FUN_00aeae50(int param_1,undefined4 *param_2) { FUN_00ae5ba0(*(undefined4 *)(&DAT_00c6a0c4 + param_1 * 0x38),*param_2); return; } //@@ 00aeae80 FUN_00aeae80 /* WARNING: Removing unreachable block (ram,0x00aeaf3e) */ /* WARNING: Removing unreachable block (ram,0x00aeaf90) */ void FUN_00aeae80(char param_1,int param_2) { int iVar1; char cVar2; uint uVar3; uint uVar4; uint uVar5; longlong lVar6; uint local_18; cVar2 = FUN_00ae8090(0x16); if (cVar2 != '\0') { lVar6 = FUN_00aede40(); uVar4 = (uint)lVar6; uVar3 = 0x10; uVar5 = 0; if (param_1 == '\0') { if (uVar4 == 0) { uVar4 = 0x11; } uVar4 = (uVar4 >> 0x10 ^ uVar4) * 0x7feb352d; uVar4 = (uVar4 >> 0xf ^ uVar4) * -0x7b935975; uVar4 = (uVar4 >> 0x10 ^ uVar4) & 0x1ff; } else { uVar3 = 0x200; uVar4 = 0; } local_18 = 0; do { uVar4 = -(uint)(uVar4 < 0x200) & uVar4; if (((&DAT_00c6a0f0)[uVar4 * 7] != 0) && ((param_1 != '\0' || ((longlong)(&DAT_00c6a0f0)[uVar4 * 7] <= lVar6)))) { uVar5 = uVar5 + 1; cVar2 = FUN_00ae8f50(&DAT_00bf9300,0x10,1,uVar4,0); if (cVar2 != '\0') { if (((&DAT_00c6a0f0)[uVar4 * 7] != 0) && ((param_1 != '\0' || ((longlong)(&DAT_00c6a0f0)[uVar4 * 7] <= lVar6)))) { (&DAT_00c6a0f0)[uVar4 * 7] = 0; FUN_00aeb020(); FUN_00aead90(&DAT_00c6a0cc + uVar4 * 0x38,*(undefined4 *)(&DAT_00c6a0c0 + uVar4 * 0x38), 0x400000,*(undefined4 *)(param_2 + 4)); iVar1 = uVar4 * 0x38; *(undefined4 *)(&DAT_00c6a0dc + iVar1) = 0; *(undefined4 *)(&DAT_00c6a0e0 + iVar1) = 0; *(undefined4 *)(&DAT_00c6a0e4 + iVar1) = 0; *(undefined4 *)(&DAT_00c6a0e8 + iVar1) = 0; } FUN_00ae9590(&DAT_00bf9300,0x10,1,uVar4); } if ((param_1 == '\0') && (4 < uVar5)) { return; } } uVar4 = uVar4 + 1; local_18 = local_18 + 1; } while (local_18 < uVar3); } return; } //@@ 00aeb020 FUN_00aeb020 void FUN_00aeb020(void) { while (DAT_00c71280 != 0) { _Thrd_yield(); } return; } //@@ 00aeb040 FUN_00aeb040 int FUN_00aeb040(undefined4 param_1,undefined4 param_2,int param_3) { int iVar1; int iVar2; int iVar3; int iVar4; iVar4 = 0x400; if ((char)param_2 != '\0') { iVar4 = 0x4000; FUN_00aeb4d0(); } do { iVar4 = iVar4 + -1; iVar1 = FUN_00aeb450(); if (iVar1 == 0) { return 0; } FUN_00aeb7b0(iVar1,0,0,param_3); if (*(int *)(iVar1 + 0x50) == 0) { iVar1 = FUN_00aec3c0(iVar1,param_1,0,0,param_3); } else { FUN_00aebb90(iVar1,param_2,*(undefined4 *)(param_3 + 0x1c0)); iVar3 = DAT_00c71180; while( true ) { *(int *)(iVar1 + 0x40) = iVar3; LOCK(); if (iVar3 == DAT_00c71180) { iVar2 = iVar3; DAT_00c71180 = iVar1; } else { iVar2 = DAT_00c71180; } UNLOCK(); if (iVar2 == iVar3) break; iVar3 = iVar2; } LOCK(); UNLOCK(); iVar1 = DAT_00c71240; DAT_00c71240 = DAT_00c71240 + 1; } } while (0 < iVar4); return iVar1; } //@@ 00aeb0f0 FUN_00aeb0f0 void FUN_00aeb0f0(undefined4 param_1,undefined4 param_2) { int iVar1; iVar1 = FUN_00aeb450(); while (iVar1 != 0) { FUN_00aec3c0(iVar1,param_1,0,0,param_2); iVar1 = FUN_00aeb450(); } return; } //@@ 00aeb120 FUN_00aeb120 uint FUN_00aeb120(uint param_1,uint param_2) { if ((param_2 & param_2 - 1) == 0) { return ~(param_2 - 1) & param_1; } return param_1 - param_1 % param_2; } //@@ 00aeb150 FUN_00aeb150 int FUN_00aeb150(int param_1,uint param_2) { int iVar1; int iVar2; uint uVar3; uint uVar4; iVar1 = 0; uVar4 = 0; do { uVar3 = *(uint *)(param_1 + uVar4 * 4); if (uVar3 == 0xffffffff) { iVar1 = iVar1 + 0x20; } else { for (; uVar3 != 0; uVar3 = uVar3 >> 1) { iVar2 = iVar1 + 1; if ((uVar3 & 1) == 0) { iVar2 = iVar1; } iVar1 = iVar2; } } uVar4 = uVar4 + 1; } while (uVar4 < 4); return iVar1 * (param_2 >> 7); } //@@ 00aeb1a0 FUN_00aeb1a0 int FUN_00aeb1a0(int param_1,uint *param_2) { uint uVar1; int iVar2; uint uVar3; uint uVar4; uVar4 = *param_2 & 0x1f; for (uVar3 = *param_2 >> 5; uVar3 < 4; uVar3 = uVar3 + 1) { uVar1 = *(uint *)(param_1 + uVar3 * 4) >> (sbyte)uVar4; if (uVar1 != 0) goto joined_r0x00aeb1e2; uVar4 = 0; } LAB_00aeb1d3: *param_2 = 0x80; return 0; joined_r0x00aeb1e2: for (; (uVar1 & 1) == 0; uVar1 = uVar1 >> 1) { uVar4 = uVar4 + 1; } if (uVar3 < 4) { iVar2 = 0; uVar4 = uVar4 + uVar3 * 0x20; *param_2 = uVar4; do { do { uVar1 = uVar1 >> 1; iVar2 = iVar2 + 1; } while ((uVar1 & 1) != 0); if ((uVar4 + iVar2 & 0x1f) == 0) { uVar3 = uVar3 + 1; if (3 < uVar3) { return iVar2; } uVar1 = *(uint *)(param_1 + uVar3 * 4); } } while ((uVar1 & 1) != 0); return iVar2; } goto LAB_00aeb1d3; } //@@ 00aeb230 FUN_00aeb230 void FUN_00aeb230(int param_1,int param_2,undefined4 *param_3) { int *piVar1; int iVar2; uint uVar3; int iVar4; piVar1 = (int *)FUN_00ae6b50(); iVar2 = 0; LOCK(); iVar4 = *(int *)(param_1 + 100); if (iVar4 == 0) { *(int *)(param_1 + 100) = piVar1[0x164]; } else { iVar2 = iVar4; } UNLOCK(); if (iVar2 == 0) { *param_3 = *(undefined4 *)(param_2 + 0x10); uVar3 = param_2 - 1U & 0xffc00000; *(int *)(param_2 + 0x14) = *(int *)(param_2 + 0x14) + -1; *(byte *)(param_2 + 0xf) = *(byte *)(param_2 + 0xf) & 0xfe; *(undefined4 **)(param_2 + 0x10) = param_3; iVar4 = *piVar1 + 0x14; FUN_00aec2b0(param_2,iVar4); if (*(int *)(uVar3 + 0x50) == 0) { FUN_00aebc90(uVar3,1,iVar4); return; } if (*(int *)(uVar3 + 0x50) == *(int *)(uVar3 + 0x48)) { FUN_00aeb6c0(uVar3,iVar4); } } return; } //@@ 00aeb2b0 FUN_00aeb2b0 void FUN_00aeb2b0(int param_1,int param_2) { uint uVar1; uVar1 = param_1 - 1U & 0xffc00000; *(int *)(uVar1 + 0x48) = *(int *)(uVar1 + 0x48) + 1; FUN_00aedf30(*(int *)(param_2 + 0x1c0) + 0xe0,1); if (*(int *)(uVar1 + 0x50) == *(int *)(uVar1 + 0x48)) { FUN_00aeb6c0(uVar1,param_2); } return; } //@@ 00aeb300 FUN_00aeb300 void FUN_00aeb300(int param_1,uint param_2,uint param_3,undefined4 param_4,undefined4 param_5) { uint uVar1; if (0x200000 < param_3) { uVar1 = 0x400000; if (0x3fffff < param_3) { uVar1 = param_3; } FUN_00aebdb0(param_2,uVar1,*(undefined4 *)(param_1 + 0x594),param_4,param_5); return; } if (param_2 < 0x2001) { FUN_00aec9d0(param_1,0,param_2,param_2); return; } if (param_2 < 0x10001) { FUN_00aec9d0(param_1,1,0x40000,param_2); return; } if (param_2 < 0x200001) { FUN_00aec9d0(param_1,2,param_2,param_2); return; } FUN_00aebdb0(param_2,param_3,*(undefined4 *)(param_1 + 0x594),param_4,param_5); return; } //@@ 00aeb3a0 FUN_00aeb3a0 void FUN_00aeb3a0(int param_1,undefined4 param_2,undefined4 param_3) { uint uVar1; uVar1 = param_1 - 1U & 0xffc00000; FUN_00aec2b0(param_1,param_3); if (*(int *)(uVar1 + 0x50) == 0) { FUN_00aebc90(uVar1,param_2,param_3); return; } if (*(int *)(uVar1 + 0x50) == *(int *)(uVar1 + 0x48)) { FUN_00aeb6c0(uVar1,param_3); } return; } //@@ 00aeb3f0 FUN_00aeb3f0 int FUN_00aeb3f0(int param_1,int *param_2,int *param_3) { int iVar1; iVar1 = (-(uint)(0x3fc < param_2[6] - 4U) & 0xffffff80) + 0x80; if (param_3 != (int *)0x0) { *param_3 = *param_2 * 0x8000 - iVar1; } return iVar1 + (((int)param_2 + (-0x6c - param_1)) / 0x30) * 0x8000 + param_1; } //@@ 00aeb450 FUN_00aeb450 uint FUN_00aeb450(void) { char cVar1; uint uVar2; uint uVar3; uint uVar4; if ((DAT_00c711c0 & 0xffc00000) == 0) { cVar1 = FUN_00aeb4d0(); if (cVar1 == '\0') { return 0; } } LOCK(); UNLOCK(); uVar4 = DAT_00c711c0; while (uVar3 = uVar4 & 0xffc00000, uVar3 != 0) { LOCK(); if (uVar4 == DAT_00c711c0) { uVar2 = uVar4; DAT_00c711c0 = uVar4 + 1 & 0x3fffff | *(uint *)(uVar3 + 0x40); } else { uVar2 = DAT_00c711c0; } UNLOCK(); if (uVar2 == uVar4) break; uVar4 = uVar2; } LOCK(); UNLOCK(); if (uVar3 != 0) { *(undefined4 *)(uVar3 + 0x40) = 0; LOCK(); DAT_00c71200 = DAT_00c71200 + -1; UNLOCK(); } return uVar3; } //@@ 00aeb468 FUN_00aeb468 ulonglong FUN_00aeb468(void) { uint uVar1; uint uVar2; int iVar3; uint uVar4; LOCK(); UNLOCK(); uVar4 = DAT_00c711c0; while (uVar2 = uVar4 & 0xffc00000, uVar2 != 0) { LOCK(); if (uVar4 == DAT_00c711c0) { uVar1 = uVar4; DAT_00c711c0 = uVar4 + 1 & 0x3fffff | *(uint *)(uVar2 + 0x40); } else { uVar1 = DAT_00c711c0; } UNLOCK(); if (uVar1 == uVar4) break; uVar4 = uVar1; } LOCK(); UNLOCK(); iVar3 = -1; if (uVar2 != 0) { *(undefined4 *)(uVar2 + 0x40) = 0; LOCK(); UNLOCK(); iVar3 = DAT_00c71200; DAT_00c71200 = DAT_00c71200 + -1; } return CONCAT44(iVar3,uVar4) & 0xffffffffffc00000; } //@@ 00aeb4d0 FUN_00aeb4d0 /* WARNING: Removing unreachable block (ram,0x00aeb51e) */ ulonglong FUN_00aeb4d0(void) { uint uVar1; int iVar2; undefined4 *puVar3; uint uVar4; undefined4 in_EDX; uint uVar5; uint uVar6; iVar2 = DAT_00c71240; uVar1 = DAT_00c71180; puVar3 = (undefined4 *)0x0; if (DAT_00c71180 != 0) { puVar3 = &DAT_00c71180; LOCK(); DAT_00c71180 = 0; UNLOCK(); if (uVar1 != 0) { if ((DAT_00c711c0 & 0xffc00000) == 0) { LOCK(); DAT_00c711c0 = DAT_00c711c0 + 1 & 0x3fffff | uVar1; UNLOCK(); LOCK(); DAT_00c71200 = DAT_00c71200 + DAT_00c71240; UNLOCK(); LOCK(); DAT_00c71240 = 0; UNLOCK(); return CONCAT44(iVar2,0xc71201); } uVar5 = uVar1; while (*(uint *)(uVar5 + 0x40) != 0) { uVar5 = *(uint *)(uVar5 + 0x40); } uVar6 = DAT_00c711c0; while( true ) { iVar2 = DAT_00c71240; *(uint *)(uVar5 + 0x40) = uVar6 & 0xffc00000; LOCK(); if (uVar6 == DAT_00c711c0) { uVar4 = uVar6; DAT_00c711c0 = uVar6 + 1 & 0x3fffff | uVar1; } else { uVar4 = DAT_00c711c0; } UNLOCK(); if (uVar4 == uVar6) break; uVar6 = uVar4; } LOCK(); DAT_00c71200 = DAT_00c71200 + iVar2; UNLOCK(); LOCK(); DAT_00c71240 = DAT_00c71240 - iVar2; UNLOCK(); return CONCAT44(uVar5,0xc71201); } } return CONCAT44(in_EDX,puVar3) & 0xffffffffffffff00; } //@@ 00aeb5c0 FUN_00aeb5c0 uint FUN_00aeb5c0(int param_1,uint *param_2) { uint uVar1; uVar1 = 0; param_1 = param_1 - (int)param_2; do { if ((*(uint *)(param_1 + (int)param_2) & *param_2) != *param_2) { return (uint)param_2 & 0xffffff00; } uVar1 = uVar1 + 1; param_2 = param_2 + 1; } while (uVar1 < 4); return CONCAT31((int3)((uint)param_2 >> 8),1); } //@@ 00aeb5f0 FUN_00aeb5f0 undefined4 FUN_00aeb5f0(int param_1,uint *param_2) { uint uVar1; uVar1 = 0; param_1 = param_1 - (int)param_2; do { if ((*param_2 & *(uint *)(param_1 + (int)param_2)) != 0) { return 1; } uVar1 = uVar1 + 1; param_2 = param_2 + 1; } while (uVar1 < 4); return 0; } //@@ 00aeb620 FUN_00aeb620 void FUN_00aeb620(uint param_1,uint param_2,undefined4 *param_3) { int iVar1; int *piVar2; uint uVar3; uint uVar4; if (param_2 == 0x80) { *param_3 = 0xffffffff; param_3[1] = 0xffffffff; param_3[2] = 0xffffffff; param_3[3] = 0xffffffff; return; } *param_3 = 0; param_3[1] = 0; param_3[2] = 0; param_3[3] = 0; if (param_2 != 0) { uVar4 = param_1 & 0x1f; piVar2 = param_3 + (param_1 >> 5); do { uVar3 = param_2; if (0x20 - uVar4 < param_2) { uVar3 = 0x20 - uVar4; } if (uVar3 < 0x20) { iVar1 = (1 << ((byte)uVar3 & 0x1f)) + -1 << (sbyte)uVar4; } else { iVar1 = -1; } *piVar2 = iVar1; uVar4 = 0; piVar2 = piVar2 + 1; param_2 = param_2 - uVar3; } while (param_2 != 0); } return; } //@@ 00aeb6c0 FUN_00aeb6c0 int FUN_00aeb6c0(uint param_1,int param_2) { undefined1 uVar1; uint uVar2; int iVar3; uint uVar4; int *piVar5; iVar3 = *(int *)(param_1 + 0x68); for (piVar5 = (int *)(param_1 + 0x6c); piVar5 < (int *)(iVar3 * 0x30 + 0x6c + param_1); piVar5 = piVar5 + *piVar5 * 0xc) { if (piVar5[6] == 0) { FUN_00aec930(piVar5,param_2); piVar5[6] = 0; } } uVar1 = FUN_00ae8090(0xc,*(undefined4 *)(param_2 + 0x1c0)); FUN_00aebb90(param_1,uVar1); FUN_00aedf30(*(int *)(param_2 + 0x1c0) + 0xc0,1); FUN_00aecd30(*(int *)(param_1 + 0x58) * -0x8000,param_2); LOCK(); *(undefined4 *)(param_1 + 100) = 0; UNLOCK(); *(undefined4 *)(param_1 + 0x40) = 0; *(undefined4 *)(param_1 + 0x4c) = 1; uVar4 = DAT_00c711c0; while( true ) { *(uint *)(param_1 + 0x40) = uVar4 & 0xffc00000; LOCK(); if (uVar4 == DAT_00c711c0) { uVar2 = uVar4; DAT_00c711c0 = uVar4 + 1 & 0x3fffff | param_1; } else { uVar2 = DAT_00c711c0; } UNLOCK(); if (uVar2 == uVar4) break; uVar4 = uVar2; } LOCK(); iVar3 = DAT_00c71200; DAT_00c71200 = DAT_00c71200 + 1; UNLOCK(); return iVar3; } //@@ 00aeb7b0 FUN_00aeb7b0 undefined4 FUN_00aeb7b0(int param_1,uint param_2,uint param_3,int param_4) { int iVar1; uint *puVar2; uint uVar3; undefined1 uVar4; iVar1 = *(int *)(param_1 + 0x68); uVar4 = 0; uVar3 = *(uint *)(param_1 + 0x6c); puVar2 = (uint *)(param_1 + 0x6c) + uVar3 * 0xc; do { if ((uint *)(param_1 + 0x6c + iVar1 * 0x30) <= puVar2) { return CONCAT31((int3)(uVar3 >> 8),uVar4); } if (puVar2[6] == 0) { uVar3 = *puVar2; if (param_2 <= uVar3) { uVar4 = 1; } } else { FUN_00aed1f0(puVar2,0); if (puVar2[5] == 0) { FUN_00aedf10(*(int *)(param_4 + 0x1c0) + 0xe0,1); *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1; puVar2 = (uint *)FUN_00aec2b0(puVar2,param_4); if (param_2 <= *puVar2) { uVar3 = *puVar2; uVar4 = 1; goto LAB_00aeb85f; } } else if ((puVar2[6] == param_3) && ((puVar2[5] < (uint)(ushort)puVar2[3] || ((puVar2[8] & 0xfffffffc) != 0)))) { uVar4 = 1; } uVar3 = *puVar2; } LAB_00aeb85f: puVar2 = puVar2 + uVar3 * 0xc; } while( true ); } //@@ 00aeb880 FUN_00aeb880 void FUN_00aeb880(int param_1,char param_2,uint param_3,uint param_4,int *param_5,uint *param_6, undefined4 *param_7) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uint uVar5; *param_7 = 0; param_7[1] = 0; param_7[2] = 0; param_7[3] = 0; if (((param_4 != 0) && (param_4 < 0x400001)) && (*(int *)(param_1 + 0x60) != 1)) { uVar1 = *(int *)(param_1 + 0x5c) << 0xf; uVar2 = *(int *)(param_1 + 0x58) * 0x8000; if (param_3 < uVar2 + param_1) { uVar3 = param_3 - param_1; if (param_2 == '\0') { uVar4 = FUN_00aeb120(uVar3,0x200000); uVar5 = FUN_00ae8aa0(param_4 + uVar3,0x200000); } else { uVar4 = FUN_00ae8aa0(uVar3,0x8000); uVar5 = FUN_00aeb120(param_4 + uVar3,0x8000); } if ((uVar1 <= uVar3) && (uVar4 < uVar1)) { uVar4 = uVar1; } if (uVar5 <= uVar2) { uVar2 = uVar5; } *param_5 = uVar4 + param_1; uVar1 = -(uint)(uVar4 < uVar2) & uVar2 - uVar4; *param_6 = uVar1; if (uVar1 != 0) { uVar3 = uVar1 >> 0xf; uVar5 = uVar4 >> 0xf; if (0x80 < uVar3 + uVar5) { FUN_00ae79e0("commit mask overflow: idx=%zu count=%zu start=%zx end=%zx p=0x%p size=%zu fullsize=%zu\n" ,uVar5,uVar3,uVar4,uVar2,param_3,param_4,uVar1); } FUN_00aeb620(uVar5,uVar3,param_7); } } } return; } //@@ 00aeb9b0 FUN_00aeb9b0 undefined4 FUN_00aeb9b0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5 ) { uint *puVar1; char cVar2; uint uVar3; undefined4 uVar4; int iVar5; int iVar6; longlong lVar7; uint local_2c; uint local_28; uint local_24; uint local_20; uint local_1c [4]; int local_c; undefined4 local_8; local_8 = 0; local_c = 0; FUN_00aeb880(param_1,(byte)param_2 ^ 1,param_3,param_4,&local_8,&local_c,local_1c); iVar5 = local_c; uVar3 = 0; do { if (local_1c[uVar3] != 0) { if (local_c != 0) { puVar1 = (uint *)(param_1 + 0x30); if ((byte)param_2 == 0) { cVar2 = FUN_00aeb5f0(puVar1,local_1c); if (cVar2 != '\0') { local_2c = *puVar1 & local_1c[0]; local_28 = *(uint *)(param_1 + 0x34) & local_1c[1]; local_24 = *(uint *)(param_1 + 0x38) & local_1c[2]; local_20 = *(uint *)(param_1 + 0x3c) & local_1c[3]; iVar6 = FUN_00aeb150(&local_2c,0x400000); FUN_00aedf30(&DAT_00c69e60,iVar5 - iVar6); if (*(char *)(param_1 + 0x10) != '\0') { FUN_00ae8400(local_8,iVar5,param_5); } *puVar1 = *puVar1 & ~local_1c[0]; *(uint *)(param_1 + 0x34) = *(uint *)(param_1 + 0x34) & ~local_1c[1]; *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) & ~local_1c[2]; *(uint *)(param_1 + 0x3c) = *(uint *)(param_1 + 0x3c) & ~local_1c[3]; } } else { cVar2 = FUN_00aeb5c0(); if (cVar2 == '\0') { local_2c = *puVar1 & local_1c[0]; local_28 = *(uint *)(param_1 + 0x34) & local_1c[1]; local_24 = *(uint *)(param_1 + 0x38) & local_1c[2]; local_20 = *(uint *)(param_1 + 0x3c) & local_1c[3]; param_2._3_1_ = cVar2; uVar4 = FUN_00aeb150(&local_2c,0x400000); FUN_00aedf10(&DAT_00c69e60,uVar4); uVar4 = FUN_00ae8330(local_8,iVar5,(int)¶m_2 + 3,param_5); if ((char)uVar4 == '\0') { return uVar4; } *puVar1 = *puVar1 | local_1c[0]; *(uint *)(param_1 + 0x34) = *(uint *)(param_1 + 0x34) | local_1c[1]; *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) | local_1c[2]; *(uint *)(param_1 + 0x3c) = *(uint *)(param_1 + 0x3c) | local_1c[3]; } cVar2 = FUN_00aeb5f0(param_1 + 0x20,local_1c); if (cVar2 != '\0') { iVar5 = FUN_00ae8000(0xf); lVar7 = FUN_00aede40(); *(longlong *)(param_1 + 0x18) = lVar7 + iVar5; } } *(uint *)(param_1 + 0x20) = *(uint *)(param_1 + 0x20) & ~local_1c[0]; *(uint *)(param_1 + 0x24) = *(uint *)(param_1 + 0x24) & ~local_1c[1]; *(uint *)(param_1 + 0x28) = *(uint *)(param_1 + 0x28) & ~local_1c[2]; *(uint *)(param_1 + 0x2c) = *(uint *)(param_1 + 0x2c) & ~local_1c[3]; return CONCAT31((int3)(~local_1c[3] >> 8),1); } break; } uVar3 = uVar3 + 1; } while (uVar3 < 4); return CONCAT31((int3)(uVar3 >> 8),1); } //@@ 00aebb90 FUN_00aebb90 void FUN_00aebb90(int param_1,char param_2,undefined4 param_3) { int *piVar1; uint uVar2; uint uVar3; int iVar4; uint uVar5; uint uVar6; int iVar7; undefined8 uVar8; uint local_14 [4]; if (*(char *)(param_1 + 0x10) != '\0') { uVar3 = 0; piVar1 = (int *)(param_1 + 0x20); while (*piVar1 == 0) { uVar3 = uVar3 + 1; piVar1 = piVar1 + 1; if (3 < uVar3) { return; } } uVar8 = FUN_00aede40(); iVar4 = (int)((ulonglong)uVar8 >> 0x20); if ((param_2 != '\0') || ((*(int *)(param_1 + 0x1c) <= iVar4 && ((*(int *)(param_1 + 0x1c) < iVar4 || (*(uint *)(param_1 + 0x18) <= (uint)uVar8)))))) { *(undefined4 *)(param_1 + 0x18) = 0; *(undefined4 *)(param_1 + 0x1c) = 0; local_14[0] = *(uint *)(param_1 + 0x20); local_14[1] = *(undefined4 *)(param_1 + 0x24); local_14[2] = *(undefined4 *)(param_1 + 0x28); local_14[3] = *(undefined4 *)(param_1 + 0x2c); *(undefined4 *)(param_1 + 0x20) = 0; uVar3 = 0; *(undefined4 *)(param_1 + 0x24) = 0; *(undefined4 *)(param_1 + 0x28) = 0; *(undefined4 *)(param_1 + 0x2c) = 0; while( true ) { uVar6 = uVar3 & 0x1f; uVar5 = uVar3 >> 5; while( true ) { if (3 < uVar5) { return; } uVar2 = local_14[uVar5] >> (sbyte)uVar6; if (uVar2 != 0) break; uVar5 = uVar5 + 1; uVar6 = 0; } for (; (uVar2 & 1) == 0; uVar2 = uVar2 >> 1) { uVar6 = uVar6 + 1; } if (3 < uVar5) break; iVar4 = 0; iVar7 = uVar5 * 0x20 + uVar6; do { do { uVar2 = uVar2 >> 1; iVar4 = iVar4 + 1; } while ((uVar2 & 1) != 0); uVar3 = iVar4 + iVar7; if ((uVar3 & 0x1f) == 0) { uVar5 = uVar5 + 1; if (3 < uVar5) break; uVar2 = local_14[uVar5]; } } while ((uVar2 & 1) != 0); if (iVar4 == 0) { return; } FUN_00aeb9b0(param_1,0,iVar7 * 0x8000 + param_1,iVar4 * 0x8000,param_3); } } } return; } //@@ 00aebc90 FUN_00aebc90 void FUN_00aebc90(undefined4 *param_1,undefined4 param_2,int param_3) { char cVar1; int iVar2; int *piVar3; iVar2 = param_1[0x1a]; for (piVar3 = param_1 + 0x1b; piVar3 < param_1 + iVar2 * 0xc + 0x1b; piVar3 = piVar3 + *piVar3 * 0xc) { if ((piVar3[6] == 0) && (param_1[0x18] != 1)) { FUN_00aec930(piVar3,param_3); } } FUN_00aedf10(*(int *)(param_3 + 0x1c0) + 0xa0,param_1[0x17] << 0xf); LOCK(); param_1[0x19] = 0; UNLOCK(); FUN_00aead40(param_1); FUN_00aecd30(param_1[0x16] * -0x8000,param_3); iVar2 = param_1[0x16]; if (((iVar2 * 0x8000 != 0x400000) || (param_1[3] != 0)) || (cVar1 = FUN_00aeab10(param_1,0x400000,*param_1,param_1 + 0xc,param_1 + 8, *(undefined1 *)((int)param_1 + 5),*(undefined1 *)(param_1 + 1), *(undefined4 *)(param_3 + 0x1c4)), cVar1 == '\0')) { iVar2 = FUN_00aeb150(param_1 + 0xc,iVar2 * 0x8000); if ((iVar2 != 0) && (*(char *)(param_1 + 1) == '\0')) { FUN_00aedf10(&DAT_00c69e60,iVar2); } while (DAT_00c71280 != 0) { _Thrd_yield(); } FUN_00ae5a90(param_1,param_1[0x16] << 0xf,param_1[2],param_1[3],*param_1, *(undefined1 *)(param_1 + 1),*(undefined4 *)(param_3 + 0x1c0)); } return; } //@@ 00aebdb0 FUN_00aebdb0 int * FUN_00aebdb0(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5) { int iVar1; uint uVar2; int *local_8; local_8 = (int *)0x0; iVar1 = mi_segment_alloc(0,param_1,param_2,param_3,param_4,param_5,&local_8); if ((iVar1 == 0) || (local_8 == (int *)0x0)) { return (int *)0x0; } LOCK(); *(undefined4 *)(iVar1 + 100) = 0; UNLOCK(); uVar2 = *local_8 * 0x8000 - ((-(uint)(0x3fc < local_8[6] - 4U) & 0xffffff80) + 0x80); if (0x80000000 < uVar2) { uVar2 = 0x80000000; } local_8[6] = uVar2; return local_8; } //@@ 00aebe30 mi_segment_alloc /* DB: mimalloc segment.c (v2, 32-bit): mi_segment_calculate_slices inlined (info size 0x189f rounded to _mi_os_page_size, slices of 1<<15, default segment 0x400000), option checks, arena/OS alloc, memset of the slice table; callers 00aebdb0/00aec9d0 (mi_segment_reclaim_or_alloc / mi_segment_huge_page_alloc) */ undefined4 * mi_segment_alloc(undefined4 *param_1,int param_2,int param_3,undefined4 param_4,void *param_5, undefined4 param_6,undefined4 *param_7) { undefined1 uVar1; char cVar2; uint uVar3; uint uVar4; uint uVar5; undefined4 *segment; int iVar6; undefined4 uVar7; longlong lVar8; uint local_54 [4]; undefined4 local_44; undefined4 uStack_40; undefined4 uStack_3c; undefined4 uStack_38; uint local_34 [4]; undefined4 *local_24; uint local_20; uint local_1c; uint local_18; int local_14; uint local_10; undefined4 local_c; char local_7; byte local_6; undefined1 local_5; segment = param_1; local_24 = param_1; uVar3 = FUN_00ae8a00(); uVar4 = uVar3 + 0x189f; if ((uVar3 & uVar3 - 1) == 0) { uVar4 = ~(uVar3 - 1) & uVar4; } else { uVar4 = uVar4 - uVar4 % uVar3; } uVar3 = uVar4 + 0x7fff >> 0xf; if (param_2 == 0) { uVar4 = 0x400000; } else { uVar4 = param_2 + 0x7fff + (uVar4 + 0x7fff & 0xffff8000); } uVar4 = uVar4 >> 0xf; local_1c = uVar4; local_18 = uVar3; uVar5 = FUN_00ae9ad0(); if ((uVar5 < 2) || (uVar5 = FUN_00ae8000(0xe), uVar5 <= *(uint *)((int)param_5 + 0x1b0))) { local_6 = 0; cVar2 = FUN_00ae8090(3); if (cVar2 == '\0') goto LAB_00aebeca; LAB_00aebed8: local_7 = '\x01'; } else { local_6 = 1; LAB_00aebeca: if (param_2 != 0) goto LAB_00aebed8; local_7 = '\0'; } param_1 = (undefined4 *)((uint)param_1 & 0xffffff); if (segment != (undefined4 *)0x0) { local_34[0] = segment[0xc]; local_34[1] = segment[0xd]; local_34[2] = segment[0xe]; local_34[3] = segment[0xf]; local_44 = segment[8]; uStack_40 = segment[9]; uStack_3c = segment[10]; uStack_38 = segment[0xb]; goto code_r0x00aec14a; } local_6 = local_6 ^ 1; local_34[0] = 0; local_34[1] = 0; local_34[2] = 0; local_34[3] = 0; local_44 = 0; uStack_40 = 0; uStack_3c = 0; uStack_38 = 0; local_5 = 0; local_c = 0; if (param_3 == 0) { local_14 = uVar4 << 0xf; segment = (undefined4 *) FUN_00aea9b0(local_14,local_34,&local_44,&local_6,&local_5,(int)¶m_1 + 3,param_4, &local_c,param_6); local_10 = 0; param_3 = 0x400000; local_1c = uVar4; local_18 = uVar3; if (segment == (undefined4 *)0x0) { goto LAB_00aec01b; } } else { local_10 = uVar3 * 0x8000 + 0x3fffff & 0xffc00000; iVar6 = local_10 + uVar3 * -0x8000 + param_2; uVar3 = FUN_00ae8a00(); uVar4 = uVar3 + 0x189f; if ((uVar3 & uVar3 - 1) == 0) { uVar4 = ~(uVar3 - 1) & uVar4; } else { uVar4 = uVar4 - uVar4 % uVar3; } local_18 = uVar4 + 0x7fff >> 0xf; if (iVar6 == 0) { local_1c = 0x80; local_14 = 0x400000; } else { local_1c = iVar6 + 0x7fff + (uVar4 + 0x7fff & 0xffff8000) >> 0xf; local_14 = local_1c << 0xf; } LAB_00aec01b: uVar3 = local_18; uVar4 = local_1c; segment = (undefined4 *) FUN_00ae59b0(local_14,param_3,local_10,&local_7,&local_6,&local_5,(int)¶m_1 + 3, param_4,&local_c,param_6); if (segment == (undefined4 *)0x0) { return (undefined4 *)0x0; } if (local_7 == '\0') { local_34[0] = 0; local_34[1] = 0; local_34[2] = 0; local_34[3] = 0; } else { local_34[0] = 0xffffffff; local_34[1] = 0xffffffff; local_34[2] = 0xffffffff; local_34[3] = 0xffffffff; } } local_20 = uVar3; FUN_00aeb620(0,uVar3,local_54); uVar5 = 0; do { if ((*(uint *)((int)local_34 + uVar5) & *(uint *)((int)local_54 + uVar5)) != *(uint *)((int)local_54 + uVar5)) { cVar2 = FUN_00ae8330(segment,local_20 << 0xf,(int)¶m_1 + 3, *(undefined4 *)((int)param_5 + 0x1c0)); if (cVar2 == '\0') { return (undefined4 *)0x0; } local_34[0] = local_34[0] | local_54[0]; local_34[1] = local_34[1] | local_54[1]; local_34[2] = local_34[2] | local_54[2]; local_34[3] = local_34[3] | local_54[3]; break; } uVar5 = uVar5 + 4; } while (uVar5 < 0x10); *segment = local_c; *(undefined1 *)(segment + 1) = local_5; *(byte *)((int)segment + 5) = local_6; uVar5 = 0; do { if (local_34[uVar5] != 0xffffffff) { uVar1 = 0; goto LAB_00aec126; } uVar5 = uVar5 + 1; } while (uVar5 < 4); uVar1 = 1; LAB_00aec126: *(undefined1 *)((int)segment + 6) = uVar1; segment[2] = param_3; segment[3] = local_10; FUN_00aecd30(local_14,param_5); FUN_00aeacf0(segment); code_r0x00aec14a: segment[0x10] = 0; if (param_1._3_1_ == '\0') { memset(segment + 0x11,0,uVar4 * 0x30 + 0x58); } if (local_24 == (undefined4 *)0x0) { segment[0xc] = local_34[0]; segment[0xd] = local_34[1]; segment[0xe] = local_34[2]; segment[0xf] = local_34[3]; cVar2 = FUN_00ae8090(0x16); if (((cVar2 == '\0') || (*(char *)(segment + 1) != '\0')) || (*(char *)((int)segment + 5) != '\0')) { *(undefined1 *)(segment + 4) = 0; segment[6] = 0; segment[7] = 0; segment[8] = 0; segment[9] = 0; segment[10] = 0; segment[0xb] = 0; } else { *(undefined1 *)(segment + 4) = 1; iVar6 = FUN_00ae8000(0xf); lVar8 = FUN_00aede40(); *(longlong *)(segment + 6) = lVar8 + iVar6; segment[8] = local_44; segment[9] = uStack_40; segment[10] = uStack_3c; segment[0xb] = uStack_38; uVar3 = local_18; } } uVar4 = local_1c; segment[0x16] = local_1c; segment[0x17] = uVar3; LOCK(); segment[0x19] = &ExceptionList; UNLOCK(); segment[0x15] = (uint)segment ^ DAT_00bf8e18; uVar5 = local_1c; if (0x80 < local_1c) { uVar5 = 0x80; } segment[0x1a] = uVar5; segment[0x18] = (uint)(param_2 != 0); FUN_00aedf30(*(int *)((int)param_5 + 0x1c0) + 0xa0,segment[0x17] << 0xf); iVar6 = FUN_00aec4f0(segment,0,uVar3,param_5); if (iVar6 == 0) { return (undefined4 *)0x0; } segment[0x14] = 0; if (segment[0x18] == 0) { mi_segment_span_free(segment,uVar3,segment[0x1a] - uVar3,param_5); return segment; } uVar7 = FUN_00aec4f0(segment,uVar3,uVar4 - uVar3); *param_7 = uVar7; return segment; } //@@ 00aec2b0 FUN_00aec2b0 void FUN_00aec2b0(int *param_1,int param_2) { char cVar1; int iVar2; uint uVar3; uint uVar4; uVar3 = param_1[6]; uVar4 = (int)param_1 - 1U & 0xffc00000; if (0x7fffffff < uVar3) { uVar3 = *param_1 * 0x8000 - ((-(uint)(0x3fc < uVar3 - 4) & 0xffffff80) + 0x80); } FUN_00aedf10(*(int *)(param_2 + 0x1c0) + 0xa0,*(ushort *)((int)param_1 + 10) * uVar3); FUN_00aedf10(*(int *)(param_2 + 0x1c0) + 0x20,1); if ((*(char *)(uVar4 + 4) == '\0') && ((*(byte *)(param_1 + 2) & 1) == 0)) { cVar1 = FUN_00ae8090(0xb); if (cVar1 != '\0') { *(byte *)(param_1 + 2) = *(byte *)(param_1 + 2) | 1; iVar2 = (-(uint)(0x3fc < param_1[6] - 4U) & 0xffffff80) + 0x80; FUN_00ae8a10(((int)((int)param_1 + (-0x6c - uVar4)) / 0x30) * 0x8000 + iVar2 + uVar4, *param_1 * 0x8000 - iVar2,*(undefined4 *)(param_2 + 0x1c0)); } } *(byte *)(param_1 + 2) = *(byte *)(param_1 + 2) & 0xfb; *(undefined4 *)((int)param_1 + 10) = 0; *(undefined4 *)((int)param_1 + 0xe) = 0; *(undefined4 *)((int)param_1 + 0x12) = 0; *(undefined4 *)((int)param_1 + 0x16) = 0; *(undefined4 *)((int)param_1 + 0x1a) = 0; *(undefined4 *)((int)param_1 + 0x1e) = 0; *(undefined4 *)((int)param_1 + 0x22) = 0; *(undefined4 *)((int)param_1 + 0x26) = 0; *(undefined4 *)((int)param_1 + 0x2a) = 0; *(undefined2 *)((int)param_1 + 0x2e) = 0; param_1[6] = 1; FUN_00aec850(param_1,param_2); *(int *)(uVar4 + 0x50) = *(int *)(uVar4 + 0x50) + -1; return; } //@@ 00aec3c0 FUN_00aec3c0 int FUN_00aec3c0(int param_1,int param_2,int param_3,undefined1 *param_4,int param_5) { int iVar1; int *piVar2; if (param_4 != (undefined1 *)0x0) { *param_4 = 0; } LOCK(); *(void ***)(param_1 + 100) = &ExceptionList; UNLOCK(); *(undefined4 *)(param_1 + 0x4c) = 0; FUN_00aecd30(*(int *)(param_1 + 0x58) << 0xf,param_5); FUN_00aedf10(*(int *)(param_5 + 0x1c0) + 0xc0,1); iVar1 = *(int *)(param_1 + 0x68); for (piVar2 = (int *)(param_1 + 0x6c) + *(int *)(param_1 + 0x6c) * 0xc; piVar2 < (int *)(param_1 + 0x6c + iVar1 * 0x30); piVar2 = piVar2 + *piVar2 * 0xc) { if (piVar2[6] == 0) { piVar2 = (int *)FUN_00aec850(piVar2,param_5); } else { FUN_00aedf10(*(int *)(param_5 + 0x1c0) + 0xe0,1); *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1; piVar2[9] = param_2; FUN_00aed5c0(piVar2,0,1); FUN_00aed1f0(piVar2,0); if (piVar2[5] == 0) { piVar2 = (int *)FUN_00aec2b0(piVar2,param_5); } else { FUN_00aed380(param_2,piVar2); if ((param_3 == piVar2[6]) && ((((uint)piVar2[5] < (uint)*(ushort *)(piVar2 + 3) || ((piVar2[8] & 0xfffffffcU) != 0)) && (param_4 != (undefined1 *)0x0)))) { *param_4 = 1; } } } } if (*(int *)(param_1 + 0x50) == 0) { FUN_00aebc90(param_1,0,param_5); param_1 = 0; } return param_1; } //@@ 00aec4f0 FUN_00aec4f0 int * FUN_00aec4f0(int param_1,int param_2,int param_3,int param_4) { char cVar1; uint uVar2; int iVar3; uint uVar4; int *piVar5; int *piVar6; piVar6 = (int *)(param_1 + 0x6c + param_2 * 0x30); uVar2 = 0; piVar5 = (int *)(param_1 + 0x30); do { if (*piVar5 != -1) goto LAB_00aec55b; uVar2 = uVar2 + 1; piVar5 = piVar5 + 1; } while (uVar2 < 4); uVar2 = 0; piVar5 = (int *)(param_1 + 0x20); do { if (*piVar5 != 0) goto LAB_00aec55b; uVar2 = uVar2 + 1; piVar5 = piVar5 + 1; } while (uVar2 < 4); LAB_00aec585: uVar4 = param_3 << 0xf; piVar6[1] = 0; *piVar6 = param_3; uVar2 = param_3 - 1; if (0x7fffffff < uVar4) { uVar4 = 0x80000000; } piVar6[6] = uVar4; uVar4 = *(uint *)(param_1 + 0x68); if (0x3f < uVar2) { uVar2 = 0x3f; } if (uVar4 <= param_2 + uVar2) { uVar2 = (uVar4 - param_2) - 1; } if (uVar2 != 0) { iVar3 = 0x30; piVar5 = piVar6; do { piVar5[0xd] = iVar3; iVar3 = iVar3 + 0x30; piVar5[0xc] = 0; piVar5[0x12] = 1; uVar2 = uVar2 - 1; piVar5 = piVar5 + 0xc; } while (uVar2 != 0); uVar4 = *(uint *)(param_1 + 0x68); } piVar5 = (int *)(param_1 + 0x6c + uVar4 * 0x30); if (piVar6 + param_3 * 0xc + -0xc <= piVar5) { piVar5 = piVar6 + param_3 * 0xc + -0xc; } if (piVar6 < piVar5) { *piVar5 = 0; piVar5[6] = 1; piVar5[1] = (((int)piVar5 - (int)piVar6) / 0x30) * 0x30; } *(byte *)(piVar6 + 2) = *(byte *)(piVar6 + 2) & 0xfe | 2; *(int *)(param_1 + 0x50) = *(int *)(param_1 + 0x50) + 1; return piVar6; LAB_00aec55b: cVar1 = FUN_00aeb9b0(param_1,1,(((int)piVar6 + (-0x6c - param_1)) / 0x30) * 0x8000 + param_1, param_3 << 0xf,*(undefined4 *)(param_4 + 0x1c0)); if (cVar1 == '\0') { return (int *)0x0; } goto LAB_00aec585; } //@@ 00aec650 mi_segment_span_free /* WARNING: Removing unreachable block (ram,0x00aec7b8) */ /* DB: mimalloc v2 segment.c: (segment, slice_index, slice_count, tld): span queue only if kind != HUGE (+0x60 == 1) and thread id (+0x64) set, slice_count 0 -> 1, first/last slice (0x30 each, offset (count-1)*0x30), inlined mi_segment_schedule_purge (option 0xf, 32 KiB slices, 4 MiB segment mask 0xffc00000) via _mi_os commit/purge FUN_00aeb9b0/aeb880 prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl mi_segment_span_free(void *segment,int sliceIndex,uint sliceCount,void *tld) { uint *puVar1; void *pvVar2; int iVar3; uint uVar4; void *pvVar5; uint uVar6; longlong lVar7; undefined4 uVar8; uint local_18 [4]; undefined1 local_8 [4]; uVar6 = sliceCount; pvVar2 = segment; if ((*(int *)((int)segment + 0x60) == 1) || (*(int *)((int)segment + 100) == 0)) { sliceCount = 0; } else { sliceCount = FUN_00aecda0(sliceCount,tld); } uVar4 = 1; if (uVar6 != 0) { uVar4 = uVar6; } pvVar5 = (void *)(sliceIndex * 0x30 + (int)pvVar2); *(uint *)((int)pvVar5 + 0x6c) = uVar4; *(undefined4 *)((int)pvVar5 + 0x70) = 0; if (1 < uVar4) { iVar3 = uVar4 + sliceIndex; *(uint *)((int)pvVar2 + iVar3 * 0x30 + 0x40) = uVar4 * 0x30 + -0x30; *(undefined4 *)((int)pvVar2 + iVar3 * 0x30 + 0x3c) = 0; *(undefined4 *)((int)pvVar2 + iVar3 * 0x30 + 0x54) = 0; } uVar6 = (int)pvVar5 + 0x6bU & 0xffc00000; segment = *(void **)((int)tld + 0x1c0); tld = (void *)(((int)((int)pvVar5 - uVar6) / 0x30) * 0x8000 + uVar6); sliceIndex = (int)pvVar5; if (*(char *)((int)pvVar2 + 0x10) != '\0') { iVar3 = FUN_00ae8000(0xf); if (iVar3 == 0) { FUN_00aeb9b0(pvVar2,0,tld,uVar4 << 0xf,segment); } else { segment = (void *)0x0; FUN_00aeb880(pvVar2,1,tld,uVar4 << 0xf,local_8,&segment,local_18); uVar6 = 0; do { if (local_18[uVar6] != 0) { if (segment == (void *)0x0) break; *(uint *)((int)pvVar2 + 0x20) = *(uint *)((int)pvVar2 + 0x20) | *(uint *)((int)pvVar2 + 0x30) & local_18[0]; *(uint *)((int)pvVar2 + 0x24) = *(uint *)((int)pvVar2 + 0x24) | *(uint *)((int)pvVar2 + 0x34) & local_18[1]; *(uint *)((int)pvVar2 + 0x28) = *(uint *)((int)pvVar2 + 0x28) | *(uint *)((int)pvVar2 + 0x38) & local_18[2]; *(uint *)((int)pvVar2 + 0x2c) = *(uint *)((int)pvVar2 + 0x2c) | *(uint *)((int)pvVar2 + 0x3c) & local_18[3]; lVar7 = FUN_00aede40(); if (*(int *)((int)pvVar2 + 0x18) == 0 && *(int *)((int)pvVar2 + 0x1c) == 0) { uVar8 = 0xf; } else { if (lVar7 < *(longlong *)((int)pvVar2 + 0x18)) { uVar4 = FUN_00ae8000(0x18); puVar1 = (uint *)((int)pvVar2 + 0x18); uVar6 = *puVar1; *puVar1 = *puVar1 + uVar4; *(int *)((int)pvVar2 + 0x1c) = *(int *)((int)pvVar2 + 0x1c) + ((int)uVar4 >> 0x1f) + (uint)CARRY4(uVar6,uVar4); break; } uVar8 = 0x18; } iVar3 = FUN_00ae8000(uVar8); *(longlong *)((int)pvVar2 + 0x18) = lVar7 + iVar3; break; } uVar6 = uVar6 + 1; } while (uVar6 < 4); } } if (sliceCount == 0) { *(undefined4 *)(sliceIndex + 0x84) = 0; return; } *(undefined4 *)(sliceIndex + 0x98) = 0; *(undefined4 *)(sliceIndex + 0x94) = *(undefined4 *)sliceCount; iVar3 = sliceIndex + 0x6c; *(int *)sliceCount = iVar3; if (*(int *)(sliceIndex + 0x94) == 0) { *(int *)(sliceCount + 4) = iVar3; *(undefined4 *)(sliceIndex + 0x84) = 0; return; } *(int *)(*(int *)(sliceIndex + 0x94) + 0x2c) = iVar3; *(undefined4 *)(sliceIndex + 0x84) = 0; return; } //@@ 00aec850 FUN_00aec850 uint * FUN_00aec850(uint *param_1,void *param_2) { uint sliceCount; void *segment; uint *puVar1; bool bVar2; segment = (void *)((int)param_1 - 1U & 0xffc00000); bVar2 = *(int *)((int)segment + 100) != 0; if (*(int *)((int)segment + 0x60) == 1) { param_1[6] = 0; return param_1; } sliceCount = *param_1; puVar1 = param_1 + sliceCount * 0xc; if (((puVar1 < (uint *)(*(int *)((int)segment + 0x68) * 0x30 + 0x6c + (int)segment)) && (puVar1[6] == 0)) && (sliceCount = sliceCount + *puVar1, bVar2)) { FUN_00aec930(puVar1,param_2); } if ((((uint *)((int)segment + 0x6cU) < param_1) && (puVar1 = (uint *)((int)param_1 + (-0x30 - param_1[-0xb])), puVar1[6] == 0)) && (sliceCount = sliceCount + *puVar1, param_1 = puVar1, bVar2)) { FUN_00aec930(puVar1,param_2); } mi_segment_span_free (segment,(int)((int)param_1 + (-0x6c - ((int)param_1 - 1U & 0xffc00000))) / 0x30, sliceCount,param_2); return param_1; } //@@ 00aec930 FUN_00aec930 void FUN_00aec930(uint *param_1,int param_2) { uint *puVar1; int iVar2; uint uVar3; uint uVar4; uint uVar5; uVar4 = *param_1; if (1 < uVar4) { uVar3 = uVar4 - 1; if (uVar3 == 0) { uVar5 = 0x20; } else { iVar2 = 0x1f; if (uVar3 != 0) { for (; uVar3 >> iVar2 == 0; iVar2 = iVar2 + -1) { } } uVar5 = 0x1f - (0x1f - iVar2); if (uVar5 < 3) goto LAB_00aec961; } uVar4 = (uVar3 >> ((char)uVar5 - 2U & 0x1f) & 3 | uVar5 * 4) - 4; } LAB_00aec961: puVar1 = (uint *)(param_2 + uVar4 * 0xc); if (param_1[0xb] != 0) { *(uint *)(param_1[0xb] + 0x28) = param_1[10]; } if (param_1 == (uint *)*puVar1) { *puVar1 = param_1[10]; } if (param_1[10] != 0) { *(uint *)(param_1[10] + 0x2c) = param_1[0xb]; } if (param_1 == (uint *)puVar1[1]) { puVar1[1] = param_1[0xb]; } param_1[0xb] = 0; param_1[10] = 0; param_1[6] = 1; return; } //@@ 00aec9d0 FUN_00aec9d0 int FUN_00aec9d0(int param_1,undefined4 param_2,uint param_3,undefined4 param_4,int param_5, undefined4 param_6) { uint uVar1; char cVar2; char cVar3; uint uVar4; int iVar5; undefined4 *puVar6; undefined4 *puVar7; undefined4 *puVar8; int iVar9; uint uVar10; uVar10 = -(uint)(0x40000 < param_3) & 0x38000; uVar1 = uVar10 + 0x7fff + param_3; iVar9 = param_5; LAB_00aeca07: do { if ((uVar10 + 0x7fff & uVar10 + 0x8000) == 0) { uVar4 = ~(uVar10 + 0x7fff) & uVar1; } else { uVar4 = uVar1 - uVar1 % (uVar10 + 0x8000); } iVar5 = FUN_00aecbb0(uVar4 >> 0xf,*(undefined4 *)(param_1 + 0x594),iVar9); if (iVar5 != 0) { FUN_00aebb90(iVar5 - 1U & 0xffc00000,0,*(undefined4 *)(iVar9 + 0x1c0)); return iVar5; } param_3 = param_3 & 0xffffff; iVar5 = FUN_00ae8040(0x15,8,0x400); while (0 < iVar5) { iVar5 = iVar5 + -1; puVar6 = (undefined4 *)FUN_00aeb450(); if (puVar6 == (undefined4 *)0x0) break; puVar6[0x13] = puVar6[0x13] + 1; cVar2 = FUN_00ae65f0(param_1,*puVar6); cVar3 = FUN_00aeb7b0(puVar6,uVar4 >> 0xf,param_4,param_5); iVar9 = param_5; if (puVar6[0x14] == 0) { LAB_00aecaf7: FUN_00aec3c0(puVar6,param_1,0,0,param_5); } else { if ((cVar3 != '\0') && (cVar2 != '\0')) { iVar5 = FUN_00aec3c0(puVar6,param_1,param_4,(int)¶m_3 + 3,param_5); if (param_3._3_1_ != '\0') { return 0; } if (iVar5 != 0) goto LAB_00aeca07; break; } if ((3 < (uint)puVar6[0x13]) && (cVar2 != '\0')) goto LAB_00aecaf7; FUN_00aebb90(puVar6,1,*(undefined4 *)(param_5 + 0x1c0)); puVar8 = DAT_00c71180; while( true ) { puVar6[0x10] = puVar8; LOCK(); if (puVar8 == DAT_00c71180) { puVar7 = puVar8; DAT_00c71180 = puVar6; } else { puVar7 = DAT_00c71180; } UNLOCK(); if (puVar7 == puVar8) break; puVar8 = puVar7; } LOCK(); DAT_00c71240 = DAT_00c71240 + 1; UNLOCK(); } } iVar5 = mi_segment_alloc(0,0,0,*(undefined4 *)(param_1 + 0x594),iVar9,param_6,0); if (iVar5 == 0) { return 0; } } while( true ); } //@@ 00aecbb0 FUN_00aecbb0 int FUN_00aecbb0(uint param_1,undefined4 param_2,void *param_3) { uint *puVar1; char cVar2; uint uVar3; int iVar4; uint uVar5; uint *puVar6; uint uVar7; undefined4 *segment; uVar3 = param_1; if (1 < param_1) { uVar5 = param_1 - 1; if (uVar5 == 0) { uVar7 = 0x20; } else { iVar4 = 0x1f; if (uVar5 != 0) { for (; uVar5 >> iVar4 == 0; iVar4 = iVar4 + -1) { } } uVar7 = 0x1f - (0x1f - iVar4); if (uVar7 < 3) goto LAB_00aecbe7; } uVar3 = (uVar5 >> ((char)uVar7 - 2U & 0x1f) & 3 | uVar7 * 4) - 4; } LAB_00aecbe7: puVar6 = (uint *)((int)param_3 + uVar3 * 0xc); uVar3 = 1; if (param_1 != 0) { uVar3 = param_1; } if ((uint *)((int)param_3 + 0x1a4) < puVar6) { return 0; } do { for (puVar1 = (uint *)*puVar6; puVar1 != (uint *)0x0; puVar1 = (uint *)puVar1[10]) { if (uVar3 <= *puVar1) { segment = (undefined4 *)((int)puVar1 - 1U & 0xffc00000); cVar2 = FUN_00ae5ba0(*segment,param_2); if (cVar2 != '\0') { if (puVar1[0xb] != 0) { *(uint *)(puVar1[0xb] + 0x28) = puVar1[10]; } if (puVar1 == (uint *)*puVar6) { *puVar6 = puVar1[10]; } if (puVar1[10] != 0) { *(uint *)(puVar1[10] + 0x2c) = puVar1[0xb]; } if (puVar1 == (uint *)puVar6[1]) { puVar6[1] = puVar1[0xb]; } uVar5 = *puVar1; puVar1[0xb] = 0; puVar1[10] = 0; puVar1[6] = 1; if (uVar3 < uVar5) { iVar4 = (int)puVar1 - (int)segment; mi_segment_span_free(segment,(iVar4 + -0x6c) / 0x30 + uVar3,uVar5 - uVar3,param_3); *puVar1 = uVar3; uVar5 = uVar3; } else { iVar4 = (int)puVar1 - (int)segment; } iVar4 = FUN_00aec4f0(segment,(iVar4 + -0x6c) / 0x30,uVar5,param_3); if (iVar4 == 0) { FUN_00aec850(puVar1,param_3); return 0; } return iVar4; } } } puVar6 = puVar6 + 3; if ((uint *)((int)param_3 + 0x1a4) < puVar6) { return 0; } } while( true ); } //@@ 00aecd30 FUN_00aecd30 void FUN_00aecd30(int param_1,int param_2) { if (param_1 < 0) { FUN_00aedf10(*(undefined4 *)(param_2 + 0x1c0),1); } else { FUN_00aedf30(); } *(int *)(param_2 + 0x1b0) = *(int *)(param_2 + 0x1b0) + (param_1 >> 0x1f & 0xfffffffeU) + 1; if (*(uint *)(param_2 + 0x1b4) < *(uint *)(param_2 + 0x1b0)) { *(uint *)(param_2 + 0x1b4) = *(uint *)(param_2 + 0x1b0); } *(int *)(param_2 + 0x1b8) = *(int *)(param_2 + 0x1b8) + param_1; if (*(uint *)(param_2 + 0x1bc) < *(uint *)(param_2 + 0x1b8)) { *(uint *)(param_2 + 0x1bc) = *(uint *)(param_2 + 0x1b8); } return; } //@@ 00aecda0 FUN_00aecda0 int FUN_00aecda0(uint param_1,int param_2) { uint uVar1; int iVar2; uint uVar3; if (1 < param_1) { uVar1 = param_1 - 1; if (uVar1 == 0) { uVar3 = param_1 + 0x1f; } else { iVar2 = 0x1f; if (uVar1 != 0) { for (; uVar1 >> iVar2 == 0; iVar2 = iVar2 + -1) { } } uVar3 = 0x1f - (0x1f - iVar2); if (uVar3 < 3) goto LAB_00aecde4; } param_1 = (uVar1 >> ((char)uVar3 - 2U & 0x1f) & 3 | uVar3 * 4) - 4; } LAB_00aecde4: return param_2 + param_1 * 0xc; } //@@ 00aecdf0 FUN_00aecdf0 void FUN_00aecdf0(int *param_1,undefined4 param_2) { uint uVar1; uint *puVar2; puVar2 = (uint *)*param_1; uVar1 = *puVar2; *puVar2 = *puVar2 + 1; puVar2[1] = puVar2[1] + (uint)(0xfffffffe < uVar1); if ((DAT_00c71284 != (code *)0x0) && (*(char *)(*param_1 + 8) == '\0')) { *(undefined1 *)(*param_1 + 8) = 1; (*DAT_00c71284)(param_2,*(undefined4 *)*param_1,((undefined4 *)*param_1)[1],DAT_00c71288); *(undefined1 *)(*param_1 + 8) = 0; } return; } //@@ 00aece40 FUN_00aece40 void FUN_00aece40(int param_1,undefined4 param_2) { int *piVar1; int iVar2; int iVar3; byte bVar4; uint uVar5; uint uVar6; uint uVar7; uint local_c; uint local_8; uVar5 = 0x4a; uVar7 = 0; local_8 = 0x4a; uVar6 = *(uint *)(param_1 + 0x630); local_c = 0; if (uVar6 <= *(uint *)(param_1 + 0x634)) { do { piVar1 = (int *)(param_1 + uVar6 * 0xc + 0x208); iVar2 = *piVar1; if ((iVar2 != 0) && (bVar4 = *(byte *)(iVar2 + 0xf), 1 < bVar4)) { if (*(int *)(iVar2 + 0x14) == 0) { bVar4 = ((bVar4 >> 1) - 1) * '\x02' | bVar4 & 1; *(byte *)(iVar2 + 0xf) = bVar4; if (((char)param_2 == '\0') && (1 < bVar4)) { local_8 = uVar6; if (uVar5 <= uVar6) { local_8 = uVar5; } uVar5 = local_8; if (uVar7 < uVar6) { uVar7 = uVar6; local_c = uVar6; } } else { iVar2 = *piVar1; *(byte *)(iVar2 + 0xe) = *(byte *)(iVar2 + 0xe) & 0xfd; iVar3 = **(int **)(iVar2 + 0x24); FUN_00aedda0(piVar1,iVar2); *(undefined4 *)(iVar2 + 0x24) = 0; FUN_00aeb3a0(iVar2,param_2,iVar3 + 0x14); uVar5 = local_8; uVar7 = local_c; } } else { *(byte *)(iVar2 + 0xf) = bVar4 & 1; } } uVar6 = uVar6 + 1; } while (uVar6 <= *(uint *)(param_1 + 0x634)); } *(uint *)(param_1 + 0x634) = uVar7; *(uint *)(param_1 + 0x630) = uVar5; return; } //@@ 00aecf20 FUN_00aecf20 void FUN_00aecf20(int param_1) { bool bVar1; char cVar2; int *piVar3; int iVar4; int iVar5; int *piVar6; int *piVar7; piVar7 = (int *)(param_1 + 0x58c); while( true ) { piVar6 = (int *)*piVar7; while( true ) { if (piVar6 == (int *)0x0) { return; } LOCK(); if (piVar6 == (int *)*piVar7) { *piVar7 = 0; piVar3 = piVar6; } else { piVar3 = (int *)*piVar7; } UNLOCK(); if (piVar3 == piVar6) break; piVar6 = piVar3; } bVar1 = true; do { piVar3 = (int *)*piVar6; cVar2 = FUN_00ae7060(piVar6); if (cVar2 == '\0') { bVar1 = false; iVar5 = *piVar7; while( true ) { *piVar6 = iVar5; LOCK(); if (iVar5 == *piVar7) { *piVar7 = (int)piVar6; iVar4 = iVar5; } else { iVar4 = *piVar7; } UNLOCK(); if (iVar4 == iVar5) break; iVar5 = iVar4; } } piVar6 = piVar3; } while (piVar3 != (int *)0x0); if (bVar1) break; _Thrd_yield(); } return; } //@@ 00aecf90 FUN_00aecf90 undefined1 FUN_00aecf90(int param_1) { char cVar1; int *piVar2; int iVar3; int iVar4; int *piVar5; int *piVar6; piVar6 = (int *)(param_1 + 0x58c); piVar5 = (int *)*piVar6; while( true ) { if (piVar5 == (int *)0x0) { return 1; } LOCK(); if (piVar5 == (int *)*piVar6) { *piVar6 = 0; piVar2 = piVar5; } else { piVar2 = (int *)*piVar6; } UNLOCK(); if (piVar2 == piVar5) break; piVar5 = piVar2; } param_1._3_1_ = 1; do { piVar2 = (int *)*piVar5; cVar1 = FUN_00ae7060(piVar5); if (cVar1 == '\0') { iVar4 = *piVar6; while( true ) { *piVar5 = iVar4; LOCK(); if (iVar4 == *piVar6) { *piVar6 = (int)piVar5; iVar3 = iVar4; } else { iVar3 = *piVar6; } UNLOCK(); param_1._3_1_ = 0; if (iVar3 == iVar4) break; iVar4 = iVar3; } } piVar5 = piVar2; } while (piVar2 != (int *)0x0); return param_1._3_1_; } //@@ 00aed000 FUN_00aed000 undefined1 * FUN_00aed000(int *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { uint uVar1; uint *puVar2; int iVar3; undefined1 *puVar4; size_t _Size; undefined1 *puVar5; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; if (param_1 == &DAT_00bf8240) { ExceptionList = &local_10; mi_thread_init(); iVar3 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4); if (*(char *)(iVar3 + 0x10) == '\0') { FUN_00aeff45(); } param_1 = *(int **)(iVar3 + 8); if (param_1 == &DAT_00bf8240) { ExceptionList = local_10; return (undefined1 *)0x0; } } puVar2 = (uint *)*param_1; uVar1 = *puVar2; *puVar2 = *puVar2 + 1; puVar2[1] = puVar2[1] + (uint)(0xfffffffe < uVar1); if ((DAT_00c71284 != (code *)0x0) && (*(char *)(*param_1 + 8) == '\0')) { *(undefined1 *)(*param_1 + 8) = 1; (*DAT_00c71284)(0,*(undefined4 *)*param_1,((undefined4 *)*param_1)[1],DAT_00c71288); *(undefined1 *)(*param_1 + 8) = 0; } FUN_00aecf90(param_1); iVar3 = mi_find_page(param_1,param_2,param_4); if (iVar3 == 0) { FUN_00ae6920(param_1,1); iVar3 = mi_find_page(param_1,param_2,param_4); if (iVar3 == 0) { FUN_00ae7510(0xc,"unable to allocate memory (%zu bytes)\n",param_2); ExceptionList = local_10; return (undefined1 *)0x0; } } if (((char)param_3 == '\0') || (*(int *)(iVar3 + 0x18) != 0)) { puVar4 = (undefined1 *)FUN_00ae6ee0(param_1,iVar3,param_2,param_3); ExceptionList = local_10; return puVar4; } puVar4 = (undefined1 *)FUN_00ae6ee0(param_1,iVar3,param_2,0); _Size = FUN_00aede10(iVar3); if (DAT_00c6a080 == '\0') { memset(puVar4,0,_Size); ExceptionList = local_10; return puVar4; } puVar5 = puVar4; for (; _Size != 0; _Size = _Size - 1) { *puVar5 = 0; puVar5 = puVar5 + 1; } ExceptionList = local_10; return puVar4; } //@@ 00aed180 FUN_00aed180 void FUN_00aed180(int param_1,undefined4 param_2) { int iVar1; iVar1 = **(int **)(param_1 + 0x24); FUN_00aedda0(param_2,param_1); *(undefined4 *)(param_1 + 0x24) = 0; FUN_00aeb2b0(param_1,iVar1 + 0x14); return; } //@@ 00aed1b0 FUN_00aed1b0 void FUN_00aed1b0(int param_1,undefined4 param_2,undefined4 param_3) { int iVar1; *(byte *)(param_1 + 0xe) = *(byte *)(param_1 + 0xe) & 0xfd; iVar1 = **(int **)(param_1 + 0x24); FUN_00aedda0(param_2,param_1); *(undefined4 *)(param_1 + 0x24) = 0; FUN_00aeb3a0(param_1,param_3,iVar1 + 0x14); return; } //@@ 00aed1f0 FUN_00aed1f0 void FUN_00aed1f0(int param_1,char param_2) { int *piVar1; undefined4 *puVar2; undefined4 *puVar3; int *piVar4; uint uVar5; uint uVar6; undefined4 *puVar7; if ((param_2 != '\0') || ((*(uint *)(param_1 + 0x20) & 0xfffffffc) != 0)) { uVar6 = *(uint *)(param_1 + 0x20); while( true ) { puVar7 = (undefined4 *)(uVar6 & 0xfffffffc); LOCK(); uVar5 = *(uint *)(param_1 + 0x20); if (uVar6 == uVar5) { *(uint *)(param_1 + 0x20) = uVar6 & 3; uVar5 = uVar6; } else { } UNLOCK(); if (uVar5 == uVar6) break; uVar6 = uVar5; } if (puVar7 != (undefined4 *)0x0) { uVar6 = 1; puVar2 = puVar7; for (puVar3 = (undefined4 *)*puVar7; puVar3 != (undefined4 *)0x0; puVar3 = (undefined4 *)*puVar3) { if (*(ushort *)(param_1 + 10) < uVar6) goto LAB_00aed251; uVar6 = uVar6 + 1; puVar2 = puVar3; } if (*(ushort *)(param_1 + 10) < uVar6) { LAB_00aed251: FUN_00ae7510(0xe,"corrupted thread-free list\n"); } else { *puVar2 = *(undefined4 *)(param_1 + 0x1c); *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) - uVar6; *(undefined4 **)(param_1 + 0x1c) = puVar7; } } } piVar1 = *(int **)(param_1 + 0x1c); if (piVar1 != (int *)0x0) { if (*(int *)(param_1 + 0x10) == 0) { *(byte *)(param_1 + 0xf) = *(byte *)(param_1 + 0xf) & 0xfe; *(int **)(param_1 + 0x10) = piVar1; *(undefined4 *)(param_1 + 0x1c) = 0; return; } if (param_2 != '\0') { for (piVar4 = (int *)*piVar1; piVar4 != (int *)0x0; piVar4 = (int *)*piVar4) { piVar1 = piVar4; } *piVar1 = *(int *)(param_1 + 0x10); *(byte *)(param_1 + 0xf) = *(byte *)(param_1 + 0xf) & 0xfe; *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_1 + 0x1c); *(undefined4 *)(param_1 + 0x1c) = 0; } } return; } //@@ 00aed2c0 FUN_00aed2c0 int FUN_00aed2c0(undefined4 param_1,int *param_2,int *param_3) { uint *puVar1; uint uVar2; uint uVar3; int iVar4; uint uVar5; int local_8; iVar4 = *param_3; if (iVar4 == 0) { return 0; } local_8 = 0; code_r0x00aed2e1: puVar1 = (uint *)(iVar4 + 0x20); *(undefined4 *)(iVar4 + 0x24) = param_1; do { uVar5 = 0; LAB_00aed2f2: while( true ) { uVar2 = *puVar1; uVar3 = uVar2 & 3; if (uVar3 != 1) { if ((uVar3 != 0) && (uVar3 != 3)) goto code_r0x00aed31a; goto LAB_00aed324; } if (3 < uVar5) break; uVar5 = uVar5 + 1; _Thrd_yield(); } _Thrd_yield(); } while( true ); code_r0x00aed31a: LOCK(); if (uVar2 == *puVar1) { *puVar1 = uVar2 & 0xfffffffc; uVar3 = uVar2; } else { uVar3 = *puVar1; } UNLOCK(); if (uVar3 == uVar2) { LAB_00aed324: local_8 = local_8 + 1; iVar4 = *(int *)(iVar4 + 0x28); if (iVar4 == 0) { if (param_2[1] == 0) { *param_2 = *param_3; param_2[1] = param_3[1]; FUN_00aed8a0(param_1,param_2); return local_8; } *(int *)(param_2[1] + 0x28) = *param_3; *(int *)(*param_3 + 0x2c) = param_2[1]; param_2[1] = param_3[1]; return local_8; } goto code_r0x00aed2e1; } goto LAB_00aed2f2; } //@@ 00aed380 FUN_00aed380 void FUN_00aed380(int param_1,uint param_2) { int iVar1; uint *puVar2; uint uVar3; uint uVar4; uVar3 = param_2; uVar4 = *(uint *)(param_2 + 0x18); if (0x7fffffff < *(uint *)(param_2 + 0x18)) { FUN_00aeb3f0(param_2 - 1 & 0xffc00000,param_2,¶m_2); uVar4 = param_2; } uVar4 = FUN_00aed620(uVar4); iVar1 = (uVar4 & 0xff) * 3 + 0x82; puVar2 = (uint *)(param_1 + iVar1 * 4); *(byte *)(uVar3 + 0xe) = *(int *)(param_1 + 8 + iVar1 * 4) == 0x10008 | *(byte *)(uVar3 + 0xe) & 0xfe; *(uint *)(uVar3 + 0x28) = *puVar2; *(undefined4 *)(uVar3 + 0x2c) = 0; if (*puVar2 == 0) { puVar2[1] = uVar3; } else { *(uint *)(*puVar2 + 0x2c) = uVar3; } *puVar2 = uVar3; FUN_00aed8a0(param_1,puVar2); *(int *)(param_1 + 0x62c) = *(int *)(param_1 + 0x62c) + 1; return; } //@@ 00aed410 FUN_00aed410 void FUN_00aed410(int param_1) { int *piVar1; int iVar2; uint uVar3; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; ExceptionList = &local_10; *(byte *)(param_1 + 0xe) = *(byte *)(param_1 + 0xe) & 0xfd; if ((*(byte *)(param_1 + 0xe) & 1) == 0) { uVar3 = FUN_00aed620(*(undefined4 *)(param_1 + 0x18)); } else { uVar3 = 0x4a; } piVar1 = (int *)(*(int *)(param_1 + 0x24) + ((uVar3 & 0xff) * 3 + 0x82) * 4); if ((((*(uint *)(param_1 + 0x18) < 0x10001) && ((*(byte *)(param_1 + 0xe) & 1) == 0)) && (piVar1[1] == param_1)) && (*piVar1 == param_1)) { *(byte *)(param_1 + 0xf) = (-(0x2000 < *(uint *)(param_1 + 0x18)) & 0xf4U) + 0x12 | *(byte *)(param_1 + 0xf) & 1; iVar2 = *(int *)(param_1 + 0x24); uVar3 = ((int)piVar1 + (-0x208 - iVar2)) / 0xc; if (uVar3 < *(uint *)(iVar2 + 0x630)) { *(uint *)(iVar2 + 0x630) = uVar3; } if (*(uint *)(iVar2 + 0x634) < uVar3) { *(uint *)(iVar2 + 0x634) = uVar3; ExceptionList = local_10; return; } } else { *(byte *)(param_1 + 0xe) = *(byte *)(param_1 + 0xe) & 0xfd; iVar2 = **(int **)(param_1 + 0x24); FUN_00aedda0(piVar1,param_1); *(undefined4 *)(param_1 + 0x24) = 0; FUN_00aeb3a0(param_1,0,iVar2 + 0x14); } ExceptionList = local_10; return; } //@@ 00aed510 FUN_00aed510 undefined4 FUN_00aed510(int param_1,uint param_2,char param_3) { uint uVar1; uint uVar2; uint *puVar3; uint uVar4; uVar4 = 0; puVar3 = (uint *)(param_1 + 0x20); do { while( true ) { uVar1 = *puVar3; uVar2 = uVar1 & 3; if (uVar2 != 1) break; if (3 < uVar4) { return 0; } uVar4 = uVar4 + 1; _Thrd_yield(); } if ((param_2 == uVar2) || ((param_3 == '\0' && (uVar2 == 3)))) break; LOCK(); if (uVar1 == *puVar3) { *puVar3 = uVar1 & 0xfffffffc | param_2; uVar2 = uVar1; } else { uVar2 = *puVar3; } UNLOCK(); } while (uVar2 != uVar1); return CONCAT31((int3)(uVar2 >> 8),1); } //@@ 00aed570 FUN_00aed570 void FUN_00aed570(int param_1) { int iVar1; uint uVar2; if ((*(byte *)(param_1 + 0xe) & 1) != 0) { iVar1 = *(int *)(param_1 + 0x24); *(byte *)(param_1 + 0xe) = *(byte *)(param_1 + 0xe) & 0xfe; uVar2 = FUN_00aed620(*(undefined4 *)(param_1 + 0x18)); *(byte *)(param_1 + 0xe) = *(byte *)(param_1 + 0xe) | 1; FUN_00aedab0(iVar1 + ((uVar2 & 0xff) * 3 + 0x82) * 4,iVar1 + 0x580,param_1); } return; } //@@ 00aed5c0 FUN_00aed5c0 void FUN_00aed5c0(int param_1,uint param_2,char param_3) { uint uVar1; uint uVar2; uint *puVar3; uint uVar4; puVar3 = (uint *)(param_1 + 0x20); do { uVar4 = 0; while( true ) { while( true ) { uVar1 = *puVar3; uVar2 = uVar1 & 3; if (uVar2 == 1) break; if (param_2 == uVar2) { return; } if ((param_3 == '\0') && (uVar2 == 3)) { return; } LOCK(); if (uVar1 == *puVar3) { *puVar3 = uVar1 & 0xfffffffc | param_2; uVar2 = uVar1; } else { uVar2 = *puVar3; } UNLOCK(); if (uVar2 == uVar1) { return; } } if (3 < uVar4) break; uVar4 = uVar4 + 1; _Thrd_yield(); } _Thrd_yield(); } while( true ); } //@@ 00aed620 FUN_00aed620 uint FUN_00aed620(int param_1) { int iVar1; char cVar2; uint uVar3; uVar3 = param_1 + 3U >> 2; if (uVar3 < 2) { return 1; } if (uVar3 < 5) { return uVar3 + 1 & 0xfffffffe; } if (0x4000 < uVar3) { return 0x49; } if (uVar3 < 0x11) { uVar3 = uVar3 + 3 & 0xfffffffc; } uVar3 = uVar3 - 1; if (uVar3 == 0) { return 0x7d; } iVar1 = 0x1f; if (uVar3 != 0) { for (; uVar3 >> iVar1 == 0; iVar1 = iVar1 + -1) { } } cVar2 = -('\x1f' - (char)iVar1); return (uint)(byte)((cVar2 + '\x1f') * '\x04' + -3 + ((byte)(uVar3 >> (cVar2 + 0x1dU & 0x1f)) & 3) ); } //@@ 00aed6a0 mi_find_page /* DB: mimalloc page.c mi_find_page(heap, size, huge_alignment): size <= 0x10000 && no alignment -> bin (FUN_00aed620 _mi_bin), heap->pages[bin] first page, _mi_page_free_collect (FUN_00aed1f0), else mi_page_queue_find_free_ex (FUN_00aedb40); "allocation request is too large (%zu bytes)"; from _mi_malloc_generic FUN_00aed000 */ int mi_find_page(int *param_1,int *param_2,int param_3) { int iVar1; uint uVar2; int iVar3; uint uVar4; uint uVar5; uint local_18; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; iVar3 = param_3; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; if (param_2 < 0x10001) { if (param_3 == 0) { ExceptionList = &local_10; uVar2 = FUN_00aed620(param_2); iVar3 = (uVar2 & 0xff) * 3 + 0x82; iVar1 = param_1[iVar3]; if ((iVar1 == 0) || (FUN_00aed1f0(iVar1,0), *(int *)(iVar1 + 0x10) == 0)) { iVar3 = mi_page_queue_find_free_ex(param_1,param_1 + iVar3,1); ExceptionList = local_10; return iVar3; } *(byte *)(iVar1 + 0xf) = *(byte *)(iVar1 + 0xf) & 1; ExceptionList = local_10; return iVar1; } } else if (0x7fffffff < param_2) { ExceptionList = &local_10; FUN_00ae7510(0x84,"allocation request is too large (%zu bytes)\n",param_2); ExceptionList = local_10; return 0; } ExceptionList = &local_10; uVar2 = FUN_00ae85d0(param_2); if ((uVar2 < 0x200001) && (iVar3 == 0)) { uVar4 = FUN_00aed620(uVar2); param_2 = param_1 + (uVar4 & 0xff) * 3 + 0x82; } else { param_2 = (int *)0x0; } iVar3 = FUN_00aeb300(param_1,uVar2,iVar3,*param_1 + 0x14,*param_1 + 0x1dc); if (iVar3 == 0) { ExceptionList = local_10; return 0; } if ((param_2 == (int *)0x0) && (uVar2 = *(uint *)(iVar3 + 0x18), 0x7fffffff < *(uint *)(iVar3 + 0x18))) { FUN_00aeb3f0(iVar3 - 1U & 0xffc00000,iVar3,&local_14); uVar2 = local_14; } iVar1 = *param_1; uVar5 = iVar3 - 1U & 0xffc00000; *(int **)(iVar3 + 0x24) = param_1; uVar4 = 0x80000000; if (uVar2 < 0x80000000) { uVar4 = uVar2; } *(uint *)(iVar3 + 0x18) = uVar4; FUN_00aeb3f0(uVar5,iVar3,&local_18); *(short *)(iVar3 + 0xc) = (short)(local_18 / uVar2); *(byte *)(iVar3 + 0xf) = *(byte *)(iVar3 + 0xf) ^ (*(byte *)(iVar3 + 8) >> 2 ^ *(byte *)(iVar3 + 0xf)) & 1; FUN_00aed9b0(param_1,iVar3,iVar1); if (param_2 == (int *)0x0) { *(undefined4 *)(iVar3 + 0x24) = 0; } else { FUN_00aedd50(param_1,param_2,iVar3); } if (0x7fffffff < *(uint *)(iVar3 + 0x18)) { FUN_00aeb3f0(uVar5,iVar3,¶m_2); } ExceptionList = local_10; return iVar3; } //@@ 00aed8a0 FUN_00aed8a0 void FUN_00aed8a0(int param_1,undefined4 *param_2) { int iVar1; byte bVar2; byte bVar3; uint uVar4; uint uVar5; uint uVar6; undefined *puVar7; char cVar8; undefined4 *puVar9; uVar6 = param_2[2]; if (uVar6 < 0x201) { puVar7 = &DAT_00c6a040; if ((undefined *)*param_2 != (undefined *)0x0) { puVar7 = (undefined *)*param_2; } uVar4 = uVar6 + 3 >> 2; if (*(undefined **)(param_1 + 4 + uVar4 * 4) != puVar7) { if (uVar4 < 2) { uVar5 = 0; } else { bVar2 = FUN_00aed620(uVar6); do { puVar9 = param_2 + -3; uVar6 = param_2[-1] + 3 >> 2; if (uVar6 < 2) { bVar3 = 1; } else if (uVar6 < 5) { bVar3 = (char)uVar6 + 1U & 0xfe; } else if (uVar6 < 0x4001) { uVar5 = uVar6; if (uVar6 < 0x11) { uVar5 = uVar6 + 3 & 0xfffffffc; } uVar5 = uVar5 - 1; if (uVar5 == 0) { cVar8 = ' '; } else { iVar1 = 0x1f; if (uVar5 != 0) { for (; uVar5 >> iVar1 == 0; iVar1 = iVar1 + -1) { } } cVar8 = '\x1f' - ('\x1f' - (char)iVar1); } bVar3 = ((byte)(uVar5 >> (cVar8 - 2U & 0x1f)) & 3) + cVar8 * '\x04' + -3; } else { bVar3 = 0x49; } } while ((bVar2 == bVar3) && (param_2 = puVar9, (undefined4 *)(param_1 + 0x208) < puVar9)); uVar5 = uVar6 + 1; if (uVar4 < uVar6 + 1) { uVar5 = uVar4; } } puVar9 = (undefined4 *)(param_1 + 4 + uVar5 * 4); for (uVar6 = (uVar4 - uVar5) * 4 + 4 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) { *puVar9 = puVar7; puVar9 = puVar9 + 1; } } } return; } //@@ 00aed9b0 FUN_00aed9b0 void FUN_00aed9b0(undefined4 param_1,uint param_2,int param_3) { uint uVar1; uint uVar2; uint uVar3; uint uVar4; uVar1 = param_2; if ((*(int *)(param_2 + 0x10) == 0) && (*(ushort *)(param_2 + 10) < *(ushort *)(param_2 + 0xc))) { FUN_00aeb3f0(param_2 - 1 & 0xffc00000,param_2,¶m_2); uVar2 = param_2; if (*(uint *)(uVar1 + 0x18) < 0x80000000) { uVar2 = *(uint *)(uVar1 + 0x18); } uVar3 = (uint)*(ushort *)(uVar1 + 0xc) - (uint)*(ushort *)(uVar1 + 10); if (uVar2 < 0x1000) { uVar4 = (uint)(0x1000 / (ulonglong)uVar2); if (uVar4 == 0) { uVar4 = 1; } } else { uVar4 = 1; } if (uVar3 <= uVar4) { uVar4 = uVar3; } FUN_00aeda50(uVar1,uVar2,uVar4,param_3 + 0x1e8); *(short *)(uVar1 + 10) = *(short *)(uVar1 + 10) + (short)uVar4; if ((*(byte *)(uVar1 + 8) & 4) == 0) { *(byte *)(uVar1 + 0xf) = *(byte *)(uVar1 + 0xf) & 0xfe; } } return; } //@@ 00aeda50 FUN_00aeda50 void FUN_00aeda50(int param_1,int param_2,int param_3) { int *piVar1; int iVar2; int *piVar3; int *piVar4; iVar2 = FUN_00aeb3f0(param_1 - 1U & 0xffc00000,param_1,0); piVar4 = (int *)((uint)*(ushort *)(param_1 + 10) * param_2 + iVar2); piVar3 = (int *)(((uint)*(ushort *)(param_1 + 10) + param_3 + -1) * param_2 + iVar2); piVar1 = piVar4; while (piVar1 <= piVar3) { *piVar1 = (int)piVar1 + param_2; piVar1 = (int *)((int)piVar1 + param_2); } *piVar3 = *(int *)(param_1 + 0x10); *(int **)(param_1 + 0x10) = piVar4; return; } //@@ 00aedab0 FUN_00aedab0 void FUN_00aedab0(int *param_1,int *param_2,int param_3) { undefined4 uVar1; uVar1 = *(undefined4 *)(param_3 + 0x24); if (*(int *)(param_3 + 0x2c) != 0) { *(undefined4 *)(*(int *)(param_3 + 0x2c) + 0x28) = *(undefined4 *)(param_3 + 0x28); } if (*(int *)(param_3 + 0x28) != 0) { *(undefined4 *)(*(int *)(param_3 + 0x28) + 0x2c) = *(undefined4 *)(param_3 + 0x2c); } if (param_3 == param_2[1]) { param_2[1] = *(int *)(param_3 + 0x2c); } if (param_3 == *param_2) { *param_2 = *(int *)(param_3 + 0x28); FUN_00aed8a0(uVar1,param_2); } *(int *)(param_3 + 0x2c) = param_1[1]; *(undefined4 *)(param_3 + 0x28) = 0; if (param_1[1] == 0) { *param_1 = param_3; param_1[1] = param_3; FUN_00aed8a0(uVar1,param_1); } else { *(int *)(param_1[1] + 0x28) = param_3; param_1[1] = param_3; } *(byte *)(param_3 + 0xe) = param_1[2] == 0x10008 | *(byte *)(param_3 + 0xe) & 0xfe; return; } //@@ 00aedb40 mi_page_queue_find_free_ex /* DB: mimalloc page.c: (heap, pq, first_try): walks pq->first pages (_mi_page_free_collect 00aed1f0, ...); when none is free runs the inlined _mi_heap_collect_retired over heap->pages[page_retired_min..max] (heap+0x630/+0x634, MI_BIN_FULL 0x4a, retire_expire byte +0xf) then mi_page_fresh via _mi_segment_page_alloc (00aeb300); on failure with first_try recurses once with first_try=0; callers mi_find_free_page (00aed6a0) and itself */ int mi_page_queue_find_free_ex(int *param_1,int *param_2,char param_3) { int iVar1; byte bVar2; ushort uVar3; int iVar4; uint uVar5; uint uVar6; uint uVar7; uint local_14; int *local_10; uint local_c; uint local_8; iVar4 = *param_2; while( true ) { iVar1 = iVar4; if (iVar1 == 0) { uVar5 = 0x4a; local_8 = 0; local_c = 0x4a; uVar7 = param_1[0x18c]; uVar6 = uVar5; if (uVar7 <= (uint)param_1[0x18d]) { do { iVar4 = uVar7 * 3 + 0x82; iVar1 = param_1[iVar4]; local_10 = param_1 + iVar4; uVar5 = uVar6; if ((iVar1 != 0) && (bVar2 = *(byte *)(iVar1 + 0xf), 1 < bVar2)) { uVar3 = CONCAT11(bVar2,bVar2) & 0x1ff; bVar2 = (byte)(uVar3 >> 8); if (*(int *)(iVar1 + 0x14) == 0) { bVar2 = (((byte)uVar3 >> 1) - 1) * '\x02' | bVar2; *(byte *)(iVar1 + 0xf) = bVar2; if (bVar2 < 2) { iVar4 = *local_10; *(byte *)(iVar4 + 0xe) = *(byte *)(iVar4 + 0xe) & 0xfd; iVar1 = **(int **)(iVar4 + 0x24); FUN_00aedda0(local_10,iVar4); *(undefined4 *)(iVar4 + 0x24) = 0; FUN_00aeb3a0(iVar4,0,iVar1 + 0x14); uVar5 = local_c; } else { uVar5 = uVar7; if (uVar6 <= uVar7) { uVar5 = uVar6; } local_c = uVar5; if (local_8 < uVar7) { local_8 = uVar7; } } } else { *(byte *)(iVar1 + 0xf) = bVar2; } } uVar7 = uVar7 + 1; uVar6 = uVar5; } while (uVar7 <= (uint)param_1[0x18d]); } param_1[0x18d] = local_8; param_1[0x18c] = uVar5; uVar7 = param_2[2]; local_c = FUN_00aeb300(param_1,uVar7,0,*param_1 + 0x14,*param_1 + 0x1dc); if (local_c == 0) { if (param_3 == '\0') { return 0; } iVar4 = mi_page_queue_find_free_ex(param_1,param_2,0); return iVar4; } iVar4 = *param_1; *(int **)(local_c + 0x24) = param_1; uVar5 = 0x80000000; if (uVar7 < 0x80000000) { uVar5 = uVar7; } *(uint *)(local_c + 0x18) = uVar5; FUN_00aeb3f0(local_c - 1 & 0xffc00000,local_c,&local_14); *(short *)(local_c + 0xc) = (short)(local_14 / uVar7); *(byte *)(local_c + 0xf) = *(byte *)(local_c + 0xf) ^ (*(byte *)(local_c + 8) >> 2 ^ *(byte *)(local_c + 0xf)) & 1; FUN_00aed9b0(param_1,local_c,iVar4); uVar7 = local_c; FUN_00aedd50(param_1,param_2,local_c); return uVar7; } iVar4 = *(int *)(iVar1 + 0x28); FUN_00aed1f0(iVar1,0); if (*(int *)(iVar1 + 0x10) != 0) break; if (*(ushort *)(iVar1 + 10) < *(ushort *)(iVar1 + 0xc)) { FUN_00aed9b0(param_1,iVar1,*param_1); break; } if ((*(byte *)(iVar1 + 0xe) & 1) == 0) { FUN_00aedab0(*(int *)(iVar1 + 0x24) + 0x580,param_2,iVar1); FUN_00aed1f0(iVar1,0); } } *(byte *)(iVar1 + 0xf) = *(byte *)(iVar1 + 0xf) & 1; return iVar1; } //@@ 00aedd50 FUN_00aedd50 void FUN_00aedd50(int param_1,int *param_2,int param_3) { *(byte *)(param_3 + 0xe) = param_2[2] == 0x10008 | *(byte *)(param_3 + 0xe) & 0xfe; *(int *)(param_3 + 0x28) = *param_2; *(undefined4 *)(param_3 + 0x2c) = 0; if (*param_2 == 0) { param_2[1] = param_3; } else { *(int *)(*param_2 + 0x2c) = param_3; } *param_2 = param_3; FUN_00aed8a0(param_1,param_2); *(int *)(param_1 + 0x62c) = *(int *)(param_1 + 0x62c) + 1; return; } //@@ 00aedda0 FUN_00aedda0 void FUN_00aedda0(int *param_1,int param_2) { int *piVar1; int iVar2; iVar2 = *(int *)(param_2 + 0x24); if (*(int *)(param_2 + 0x2c) != 0) { *(undefined4 *)(*(int *)(param_2 + 0x2c) + 0x28) = *(undefined4 *)(param_2 + 0x28); } if (*(int *)(param_2 + 0x28) != 0) { *(undefined4 *)(*(int *)(param_2 + 0x28) + 0x2c) = *(undefined4 *)(param_2 + 0x2c); } if (param_2 == param_1[1]) { param_1[1] = *(int *)(param_2 + 0x2c); } if (param_2 == *param_1) { *param_1 = *(int *)(param_2 + 0x28); FUN_00aed8a0(iVar2,param_1); } piVar1 = (int *)(iVar2 + 0x62c); *piVar1 = *piVar1 + -1; *(byte *)(param_2 + 0xe) = *(byte *)(param_2 + 0xe) & 0xfe; *(undefined4 *)(param_2 + 0x28) = 0; *(undefined4 *)(param_2 + 0x2c) = 0; return; } //@@ 00aede10 FUN_00aede10 uint FUN_00aede10(uint param_1) { if (*(uint *)(param_1 + 0x18) < 0x80000000) { return *(uint *)(param_1 + 0x18); } FUN_00aeb3f0(param_1 - 1 & 0xffc00000,param_1,¶m_1); return param_1; } //@@ 00aede40 FUN_00aede40 void FUN_00aede40(void) { longlong lVar1; LARGE_INTEGER local_14; LARGE_INTEGER local_c; QueryPerformanceCounter(&local_c); lVar1 = CONCAT44(DAT_00c712a4,DAT_00c712a0); if (DAT_00c712a0 == 0 && DAT_00c712a4 == 0) { QueryPerformanceFrequency(&local_14); lVar1 = __alldiv(local_14.s.LowPart,local_14.s.HighPart,1000,0); if (lVar1 == 0) { lVar1 = 1; } } DAT_00c712a4 = (int)((ulonglong)lVar1 >> 0x20); DAT_00c712a0 = (int)lVar1; __alldiv(local_c.s.LowPart,local_c.s.HighPart,lVar1); return; } //@@ 00aedec0 FUN_00aedec0 void FUN_00aedec0(uint *param_1,uint param_2) { uint *puVar1; uint uVar2; if ((param_1 < (uint *)0xc69e00) || (&DAT_00c6a040 <= param_1)) { puVar1 = param_1 + 2; uVar2 = *puVar1; *puVar1 = *puVar1 + 1; param_1[3] = param_1[3] + (uint)(0xfffffffe < uVar2); uVar2 = *param_1; *param_1 = *param_1 + param_2; param_1[1] = param_1[1] + (uint)CARRY4(uVar2,param_2); return; } FUN_00aee500(param_1 + 2,1,0); FUN_00aee500(param_1,param_2,0); return; } //@@ 00aedf10 FUN_00aedf10 void FUN_00aedf10(undefined4 param_1,int param_2) { FUN_00aeeb90(param_1,-param_2,-(uint)(param_2 != 0)); return; } //@@ 00aedf30 FUN_00aedf30 void FUN_00aedf30(undefined4 param_1,undefined4 param_2) { FUN_00aeeb90(param_1,param_2,0); return; } //@@ 00aedf50 FUN_00aedf50 void FUN_00aedf50(void **param_1) { if (param_1 != &_mi_stats_main) { mi_stats_add(&_mi_stats_main,param_1); memset(param_1,0,0x240); } return; } //@@ 00aedf80 _mi_stats_print /* DB: mimalloc stats.c: format strings "%10s: %10s %10s %10s..." / "heap stats" / "process" / "elapsed" / "numa nodes"; called by FUN_00aeef70 (mi_stats_print_out: merge thread stats via mi_stats_add then _mi_stats_print(&_mi_stats_main, out, 0)) */ void _mi_stats_print(int param_1,undefined4 param_2,undefined4 param_3) { uint uVar1; undefined4 uVar2; undefined4 uVar3; int iVar4; int iVar5; undefined8 uVar6; undefined8 uVar7; undefined4 uVar8; undefined1 local_144 [256]; uint local_44; int local_40; int local_3c; undefined4 local_38; uint local_34; int local_30; undefined8 local_2c; undefined4 local_24; undefined4 local_20; undefined1 *local_1c; undefined4 local_18; undefined4 local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b15150; local_10 = ExceptionList; local_24 = param_2; local_20 = param_3; local_1c = local_144; local_18 = 0; local_14 = 0xff; ExceptionList = &local_10; FUN_00ae76c0(FUN_00aee560,&local_24,"%10s: %10s %10s %10s %10s %10s %10s\n","heap stats","peak " ,"total ","freed ","current ","unit ","count "); iVar4 = param_1; mi_stat_print_ex(param_1 + 0x40,"reserved",1,0,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0x60,"committed",1,0,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0x80,"reset",1,0,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0xa0,"touched",1,0,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4,"segments",0xffffffff,0xffffffff,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0xc0,"-abandoned",0xffffffff,0xffffffff,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0x1a0,"-cached",0xffffffff,0xffffffff,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0x20,"pages",0xffffffff,0xffffffff,FUN_00aee560,&local_24); mi_stat_print_ex(iVar4 + 0xe0,"-abandoned",0xffffffff,0xffffffff,FUN_00aee560,&local_24); FUN_00ae76c0(FUN_00aee560,&local_24,"%10s:","-extended"); FUN_00aee5f0(*(undefined4 *)(iVar4 + 0x1c0),*(undefined4 *)(iVar4 + 0x1c4),0xffffffff,0xffffffff, FUN_00aee560,&local_24,0); FUN_00ae76c0(FUN_00aee560,&local_24,&DAT_00b66310); FUN_00ae76c0(FUN_00aee560,&local_24,"%10s:","-noretire"); FUN_00aee5f0(*(undefined4 *)(iVar4 + 0x1f0),*(undefined4 *)(iVar4 + 500),0xffffffff,0xffffffff, FUN_00aee560,&local_24,0); FUN_00ae76c0(FUN_00aee560,&local_24,&DAT_00b66310); FUN_00ae76c0(FUN_00aee560,&local_24,"%10s:","mmaps"); FUN_00aee5f0(*(undefined4 *)(iVar4 + 0x1d0),*(undefined4 *)(iVar4 + 0x1d4),0xffffffff,0xffffffff, FUN_00aee560,&local_24,0); FUN_00ae76c0(FUN_00aee560,&local_24,&DAT_00b66310); FUN_00ae76c0(FUN_00aee560,&local_24,"%10s:","commits"); FUN_00aee5f0(*(undefined4 *)(iVar4 + 0x1e0),*(undefined4 *)(iVar4 + 0x1e4),0xffffffff,0xffffffff, FUN_00aee560,&local_24,0); FUN_00ae76c0(FUN_00aee560,&local_24,&DAT_00b66310); mi_stat_print_ex(iVar4 + 0x100,"threads",0xffffffff,0xffffffff,FUN_00aee560,&local_24); if (*(int *)(iVar4 + 0x208) == 0 && *(int *)(iVar4 + 0x20c) == 0) { local_2c = 0; uVar6 = 0; } else { uVar1 = *(uint *)(iVar4 + 0x200); uVar6 = __alldiv(uVar1 * 10, (*(int *)(iVar4 + 0x204) + (*(int *)(iVar4 + 0x204) << 2 | uVar1 >> 0x1e) + (uint)CARRY4(uVar1,uVar1 * 4)) * 2 | uVar1 * 5 >> 0x1f, *(undefined4 *)(iVar4 + 0x208),*(int *)(iVar4 + 0x20c)); } iVar4 = __alldiv(uVar6,10,0); FUN_00ae76c0(FUN_00aee560,&local_24,"%10s: %5ld.%ld avg\n","searches",iVar4, (int)uVar6 + iVar4 * -10); iVar4 = DAT_00c69da8; if (DAT_00c69da8 == 0) { iVar4 = FUN_00ae8820(); } FUN_00ae76c0(FUN_00aee560,&local_24,"%10s: %7zu\n","numa nodes",iVar4); FUN_00aeead0(&local_44,&local_34,&local_2c,¶m_1,&local_38,¶m_3,&local_3c,¶m_2); uVar6 = __alldiv(local_44,local_40,1000,0); uVar7 = __allmul(uVar6,1000,0); FUN_00ae76c0(FUN_00aee560,&local_24,"%10s: %7ld.%03ld s\n","elapsed",uVar6,local_44 - (uint)uVar7, (local_40 - (int)((ulonglong)uVar7 >> 0x20)) - (uint)(local_44 < (uint)uVar7)); uVar1 = (uint)local_2c; uVar6 = __alldiv((uint)local_2c,local_2c._4_4_,1000,0); uVar7 = __alldiv(local_34,local_30,1000,0); param_3 = (undefined4)((ulonglong)uVar7 >> 0x20); param_1 = (int)uVar7; uVar8 = param_2; uVar7 = __allmul(uVar6,1000,0); uVar3 = param_3; uVar2 = param_1; iVar5 = uVar1 - (uint)uVar7; iVar4 = (local_2c._4_4_ - (int)((ulonglong)uVar7 >> 0x20)) - (uint)(uVar1 < (uint)uVar7); uVar7 = __allmul(param_1,param_3,1000,0); FUN_00ae76c0(FUN_00aee560,&local_24, "%10s: user: %ld.%03ld s, system: %ld.%03ld s, faults: %lu, rss: ","process",uVar2, uVar3,local_34 - (uint)uVar7, (local_30 - (int)((ulonglong)uVar7 >> 0x20)) - (uint)(local_34 < (uint)uVar7),uVar6, iVar5,iVar4,uVar8); FUN_00aee5f0(local_38,0,1,0,FUN_00aee560,&local_24,&DAT_00b62fdc); if (local_3c != 0) { FUN_00ae76c0(FUN_00aee560,&local_24,", commit: "); FUN_00aee5f0(local_3c,0,1,0,FUN_00aee560,&local_24,&DAT_00b62fdc); } FUN_00ae76c0(FUN_00aee560,&local_24,&DAT_00b66310); ExceptionList = local_10; return; } //@@ 00aee480 FUN_00aee480 undefined8 FUN_00aee480(uint *param_1) { longlong lVar1; longlong lVar2; uint uVar3; lVar1 = (ulonglong)*param_1 * 0x346dc5d6; lVar2 = (ulonglong)param_1[1] * 0x3886594b + ((ulonglong)*param_1 * 0x3886594b >> 0x20); lVar1 = (ulonglong)param_1[1] * 0x346dc5d6 + (ulonglong) CONCAT14(CARRY4((uint)((ulonglong)lVar2 >> 0x20), (int)((ulonglong)lVar1 >> 0x20) + (uint)CARRY4((uint)lVar1,(uint)lVar2)), (int)((ulonglong)(lVar2 + lVar1) >> 0x20)); uVar3 = (uint)((ulonglong)lVar1 >> 0x20); return CONCAT44(uVar3 >> 0xb,(uint)lVar1 >> 0xb | uVar3 * 0x200000); } //@@ 00aee500 FUN_00aee500 undefined8 FUN_00aee500(longlong *param_1,uint param_2,int param_3) { longlong lVar1; uint uVar2; int iVar3; uint local_c; int iStack_8; iStack_8 = (int)((ulonglong)*param_1 >> 0x20); local_c = (uint)*param_1; while( true ) { LOCK(); lVar1 = *param_1; if (CONCAT44(iStack_8,local_c) == lVar1) { *param_1 = CONCAT44(iStack_8 + param_3 + (uint)CARRY4(local_c,param_2),local_c + param_2); uVar2 = local_c; iVar3 = iStack_8; } else { uVar2 = (uint)lVar1; iVar3 = (int)((ulonglong)lVar1 >> 0x20); } UNLOCK(); if ((uVar2 == local_c) && (iVar3 == iStack_8)) break; local_c = uVar2; iStack_8 = iVar3; } return CONCAT44(iStack_8,local_c); } //@@ 00aee560 FUN_00aee560 void FUN_00aee560(char *param_1,undefined4 *param_2) { uint uVar1; char cVar2; if (((param_1 != (char *)0x0) && (param_2 != (undefined4 *)0x0)) && (cVar2 = *param_1, cVar2 != '\0')) { uVar1 = param_2[3]; do { if ((uint)param_2[4] <= uVar1) { *(undefined1 *)(uVar1 + param_2[2]) = 0; FUN_00ae7780(*param_2,param_2[1],0,param_2[2]); param_2[3] = 0; uVar1 = 0; } *(char *)(uVar1 + param_2[2]) = cVar2; uVar1 = param_2[3] + 1; param_2[3] = uVar1; if (cVar2 == '\n') { *(undefined1 *)(uVar1 + param_2[2]) = 0; FUN_00ae7780(*param_2,param_2[1],0,param_2[2]); param_2[3] = 0; uVar1 = 0; } cVar2 = param_1[1]; param_1 = param_1 + 1; } while (cVar2 != '\0'); } return; } //@@ 00aee5f0 FUN_00aee5f0 /* WARNING: Removing unreachable block (ram,0x00aee6c4) */ /* WARNING: Removing unreachable block (ram,0x00aee6f1) */ void FUN_00aee5f0(uint param_1,uint param_2,int param_3,int param_4,undefined4 param_5, undefined4 param_6,undefined *param_7) { longlong lVar1; int iVar2; byte *pbVar3; undefined *puVar4; uint uVar5; byte *pbVar6; uint uVar7; ulonglong uVar8; longlong lVar9; undefined8 uVar10; undefined1 local_40 [32]; undefined1 local_20 [4]; int local_1c; undefined *local_18; uint local_14; undefined4 local_10; uint local_c; uint local_8; local_40[0] = 0; if ((param_4 < 1) && ((param_4 < 0 || (param_3 == 0)))) { pbVar6 = &DAT_00b656ec; local_14 = param_2; if (param_3 != 0 || param_4 != 0) goto LAB_00aee641; local_8 = 1000; } else { pbVar6 = &DAT_00b6d178; uVar10 = __allmul(param_1,param_2,param_3,param_4); local_14 = (uint)((ulonglong)uVar10 >> 0x20); param_1 = (uint)uVar10; LAB_00aee641: local_8 = 0x400; } uVar5 = (int)local_14 >> 0x1f; uVar7 = (param_1 ^ uVar5) - uVar5; local_1c = ((local_14 ^ uVar5) - uVar5) - (uint)((param_1 ^ uVar5) < uVar5); if ((local_1c < 1) && ((local_1c < 0 || (uVar7 < local_8)))) { if ((param_1 == 1) && (local_14 == 0)) { if (*pbVar6 == 0x42) goto LAB_00aee782; } else if (param_1 == 0 && local_14 == 0) { pbVar6 = &s_empty; } FUN_00ae80d0(local_40,0x20,"%d %-3s",param_1,pbVar6); } else { local_c = local_8; local_10 = 0; local_18 = &DAT_00b1a23c; uVar8 = __allmul(local_8,0,local_8,0); if (CONCAT44(local_1c,uVar7) < (longlong)uVar8) { uVar8 = (ulonglong)local_c; } else { local_18 = &DAT_00b6a708; local_10 = (int)(uVar8 >> 0x20); } local_c = (uint)uVar8; lVar9 = __allmul(local_8,0,uVar8); lVar1 = CONCAT44(local_10,local_c); if (lVar9 <= CONCAT44(local_1c,uVar7)) { local_18 = &DAT_00b70434; lVar1 = lVar9; } uVar10 = __alldiv(lVar1,10,0); uVar10 = __alldiv(param_1,local_14,uVar10); iVar2 = __alldiv(uVar10,10,0); uVar7 = (int)uVar10 + iVar2 * -10; if (local_8 == 0x400) { pbVar3 = &DAT_00ba9d70; } else { pbVar3 = &s_empty; } FUN_00ae80d0(local_20,8,"%s%s%s",local_18,pbVar3,pbVar6); uVar5 = (int)uVar7 >> 0x1f; FUN_00ae80d0(local_40,0x20,"%ld.%ld %-3s",iVar2,(uVar7 ^ uVar5) - uVar5,local_20); } LAB_00aee782: puVar4 = &DAT_00b1a250; if (param_7 != (undefined *)0x0) { puVar4 = param_7; } FUN_00ae76c0(param_5,param_6,puVar4,local_40); return; } //@@ 00aee7b0 FUN_00aee7b0 void FUN_00aee7b0(int *param_1,int *param_2,undefined4 param_3,undefined4 param_4) { undefined8 uVar1; if (param_1 != param_2) { if ((*param_2 != 0 || param_2[1] != 0) || (param_2[2] != 0 || param_2[3] != 0)) { uVar1 = __allmul(*param_2,param_2[1],param_3,param_4); FUN_00aee500(param_1,uVar1); uVar1 = __allmul(param_2[6],param_2[7],param_3,param_4); FUN_00aee500(param_1 + 6,uVar1); uVar1 = __allmul(param_2[2],param_2[3],param_3,param_4); FUN_00aee500(param_1 + 2,uVar1); uVar1 = __allmul(param_2[4],param_2[5],param_3,param_4); FUN_00aee500(param_1 + 4,uVar1); } } return; } //@@ 00aee850 mi_stat_print_ex /* DB: mimalloc stats.c: '%10s:' label, __alldiv amounts, ' not all freed!' / ' ok'; called 10x from _mi_stats_print (FUN_00aedf80) */ void mi_stat_print_ex(uint *param_1,undefined4 param_2,uint param_3,uint param_4,undefined4 param_5, undefined4 param_6) { uint uVar1; undefined8 uVar2; undefined4 uVar3; undefined4 uVar4; undefined4 uVar5; undefined4 uVar6; undefined4 uVar7; FUN_00ae76c0(param_5,param_6,"%10s:",param_2); uVar1 = param_1[5]; if (-1 < (int)param_4) { if ((0 < (int)param_4) || (param_3 != 0)) { FUN_00aee5f0(param_1[4],uVar1,param_3,param_4,param_5,param_6,0); FUN_00aee5f0(*param_1,param_1[1],param_3,param_4,param_5,param_6,0); FUN_00aee5f0(param_1[2],param_1[3],param_3,param_4,param_5,param_6,0); FUN_00aee5f0(param_1[6],param_1[7],param_3,param_4,param_5,param_6,0); FUN_00aee5f0(param_3,param_4,1,0,param_5,param_6,0); if ((param_3 == 1) && (param_4 == 0)) { FUN_00ae76c0(param_5,param_6,&DAT_00b1a250,&DAT_00b656ec); } else { FUN_00aee5f0(*param_1,param_1[1],0,0,param_5,param_6,0); } if (((int)param_1[3] <= (int)param_1[1]) && (((int)param_1[3] < (int)param_1[1] || (param_1[2] < *param_1)))) goto LAB_00aee943; goto LAB_00aeea4b; } if ((0 < (int)param_4) || (-1 < (int)param_4)) { FUN_00aee5f0(param_1[4],uVar1,1,0,param_5,param_6,0); FUN_00aee5f0(*param_1,param_1[1],1,0,param_5,param_6,0); FUN_00ae76c0(param_5,param_6,&DAT_00b1a250,&DAT_00b656ec); FUN_00aee5f0(param_1[6],param_1[7],1,0,param_5,param_6,0); FUN_00ae76c0(param_5,param_6,&DAT_00b66310); return; } } FUN_00aee5f0(param_1[4],uVar1,0xffffffff,0xffffffff,param_5,param_6,0); FUN_00aee5f0(*param_1,param_1[1],0xffffffff,0xffffffff,param_5,param_6,0); FUN_00aee5f0(param_1[2],param_1[3],0xffffffff,0xffffffff,param_5,param_6,0); FUN_00aee5f0(param_1[6],param_1[7],0xffffffff,0xffffffff,param_5,param_6,0); if ((param_3 & param_4) == 0xffffffff) { FUN_00ae76c0(param_5,param_6,&DAT_00b1a27c,&s_empty); } else { FUN_00aee5f0(-param_3,-(param_4 + (param_3 != 0)),1,0,param_5,param_6,0); uVar7 = 0; uVar4 = 0; uVar3 = 0; uVar5 = param_5; uVar6 = param_6; uVar2 = __alldiv(*param_1,param_1[1],param_3,param_4); FUN_00aee5f0(-(int)uVar2,-((int)((ulonglong)uVar2 >> 0x20) + (uint)((int)uVar2 != 0)),uVar3, uVar4,uVar5,uVar6,uVar7); } if ((int)param_1[3] <= (int)param_1[1]) { if ((int)param_1[3] < (int)param_1[1]) { LAB_00aee943: FUN_00ae76c0(param_5,param_6," not all freed!\n"); return; } if (param_1[2] < *param_1) { FUN_00ae76c0(param_5,param_6," not all freed!\n"); return; } } LAB_00aeea4b: FUN_00ae76c0(param_5,param_6," ok\n"); return; } //@@ 00aeead0 FUN_00aeead0 void FUN_00aeead0(longlong *param_1,undefined8 *param_2,undefined8 *param_3,undefined4 *param_4, undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8) { longlong lVar1; HANDLE pvVar2; longlong lVar3; undefined8 uVar4; _FILETIME *lpCreationTime; _FILETIME *lpExitTime; _FILETIME *lpKernelTime; undefined1 *puVar5; _FILETIME *lpUserTime; undefined4 uVar6; undefined1 local_4c [4]; undefined4 local_48; undefined4 local_44; undefined4 local_40; undefined4 local_2c; undefined4 local_28; _FILETIME local_24; _FILETIME local_1c; _FILETIME local_14; _FILETIME local_c; lVar1 = CONCAT44(DAT_00c71294,DAT_00c71290); lVar3 = FUN_00aede40(); lpUserTime = &local_c; lpKernelTime = &local_14; *param_1 = (lVar3 - CONCAT44(DAT_00c7129c,DAT_00c71298)) - lVar1; lpExitTime = &local_1c; lpCreationTime = &local_24; pvVar2 = GetCurrentProcess(); GetProcessTimes(pvVar2,lpCreationTime,lpExitTime,lpKernelTime,lpUserTime); uVar4 = FUN_00aee480(&local_c); *param_2 = uVar4; uVar4 = FUN_00aee480(&local_14); puVar5 = local_4c; uVar6 = 0x28; *param_3 = uVar4; pvVar2 = GetCurrentProcess(); K32GetProcessMemoryInfo(pvVar2,puVar5,uVar6); *param_4 = local_40; *param_5 = local_44; *param_6 = local_2c; *param_7 = local_28; *param_8 = local_48; return; } //@@ 00aeeb90 FUN_00aeeb90 /* WARNING: Removing unreachable block (ram,0x00aeebfd) */ void FUN_00aeeb90(uint *param_1,uint param_2,int param_3) { uint *puVar1; longlong lVar2; int iVar3; uint uVar4; uint uVar5; int iVar6; bool bVar7; longlong lVar8; int local_18; int iStack_14; if (param_2 != 0 || param_3 != 0) { if (((uint *)0xc69dff < param_1) && (param_1 < &DAT_00c6a040)) { lVar8 = FUN_00aee500(param_1 + 6,param_2,param_3); lVar8 = lVar8 + CONCAT44(param_3,param_2); iStack_14 = (int)((ulonglong)*(undefined8 *)(param_1 + 4) >> 0x20); local_18 = (int)*(undefined8 *)(param_1 + 4); while (CONCAT44(iStack_14,local_18) < lVar8) { LOCK(); lVar2 = *(longlong *)(param_1 + 4); if (CONCAT44(iStack_14,local_18) == lVar2) { *(longlong *)(param_1 + 4) = lVar8; iVar3 = local_18; iVar6 = iStack_14; } else { iVar3 = (int)lVar2; iVar6 = (int)((ulonglong)lVar2 >> 0x20); } UNLOCK(); if ((iVar3 == local_18) && (iVar6 == iStack_14)) break; iStack_14 = iVar6; local_18 = iVar3; } if ((param_3 < 0) || ((param_3 < 1 && (param_2 == 0)))) { param_1 = param_1 + 2; bVar7 = param_2 != 0; param_2 = -param_2; param_3 = -(param_3 + (uint)bVar7); } FUN_00aee500(param_1,param_2,param_3); return; } uVar5 = param_1[6]; uVar4 = param_2 + param_1[6]; param_1[6] = uVar4; uVar5 = param_1[7] + param_3 + (uint)CARRY4(param_2,uVar5); param_1[7] = uVar5; if (((int)param_1[5] <= (int)uVar5) && (((int)param_1[5] < (int)uVar5 || (param_1[4] < uVar4)))) { param_1[4] = uVar4; param_1[5] = uVar5; } if ((-1 < param_3) && ((0 < param_3 || (param_2 != 0)))) { uVar5 = *param_1; *param_1 = *param_1 + param_2; param_1[1] = param_1[1] + param_3 + (uint)CARRY4(uVar5,param_2); return; } puVar1 = param_1 + 2; uVar5 = *puVar1; *puVar1 = *puVar1 - param_2; param_1[3] = (param_1[3] - param_3) - (uint)(uVar5 < param_2); } return; } //@@ 00aeeca0 mi_stats_add /* DB: mimalloc stats.c: (dst, src) adds every mi_stat_count_t (+0x00..+0x1a0, 0x20 each) and mi_stat_counter_t pairs (+0x1c0..) when dst != src; callers mi_stats_merge FUN_00aedf50 and mi_stats_print_out FUN_00aeef70 with &_mi_stats_main */ void mi_stats_add(int param_1,int param_2) { if (param_1 != param_2) { FUN_00aee7b0(param_1,param_2,1,0); FUN_00aee7b0(param_1 + 0x20,param_2 + 0x20,1,0); FUN_00aee7b0(param_1 + 0x40,param_2 + 0x40,1,0); FUN_00aee7b0(param_1 + 0x60,param_2 + 0x60,1,0); FUN_00aee7b0(param_1 + 0x80,param_2 + 0x80,1,0); FUN_00aee7b0(param_1 + 0xa0,param_2 + 0xa0,1,0); FUN_00aee7b0(param_1 + 0xe0,param_2 + 0xe0,1,0); FUN_00aee7b0(param_1 + 0xc0,param_2 + 0xc0,1,0); FUN_00aee7b0(param_1 + 0x100,param_2 + 0x100,1,0); FUN_00aee7b0(param_1 + 0x180,param_2 + 0x180,1,0); FUN_00aee7b0(param_1 + 0x1a0,param_2 + 0x1a0,1,0); FUN_00aee7b0(param_1 + 0x120,param_2 + 0x120,1,0); FUN_00aee7b0(param_1 + 0x140,param_2 + 0x140,1,0); FUN_00aee7b0(param_1 + 0x160,param_2 + 0x160,1,0); if ((undefined4 *)(param_1 + 0x1c0) != (undefined4 *)(param_2 + 0x1c0)) { FUN_00aee500((undefined4 *)(param_1 + 0x1c0),*(undefined4 *)(param_2 + 0x1c0), *(undefined4 *)(param_2 + 0x1c4)); FUN_00aee500(param_1 + 0x1c8,*(undefined4 *)(param_2 + 0x1c8),*(undefined4 *)(param_2 + 0x1cc) ); } if ((undefined4 *)(param_1 + 0x1d0) != (undefined4 *)(param_2 + 0x1d0)) { FUN_00aee500((undefined4 *)(param_1 + 0x1d0),*(undefined4 *)(param_2 + 0x1d0), *(undefined4 *)(param_2 + 0x1d4)); FUN_00aee500(param_1 + 0x1d8,*(undefined4 *)(param_2 + 0x1d8),*(undefined4 *)(param_2 + 0x1dc) ); } if ((undefined4 *)(param_1 + 0x1e0) != (undefined4 *)(param_2 + 0x1e0)) { FUN_00aee500((undefined4 *)(param_1 + 0x1e0),*(undefined4 *)(param_2 + 0x1e0), *(undefined4 *)(param_2 + 0x1e4)); FUN_00aee500(param_1 + 0x1e8,*(undefined4 *)(param_2 + 0x1e8),*(undefined4 *)(param_2 + 0x1ec) ); } if ((undefined4 *)(param_1 + 0x1f0) != (undefined4 *)(param_2 + 0x1f0)) { FUN_00aee500((undefined4 *)(param_1 + 0x1f0),*(undefined4 *)(param_2 + 0x1f0), *(undefined4 *)(param_2 + 500)); FUN_00aee500(param_1 + 0x1f8,*(undefined4 *)(param_2 + 0x1f8),*(undefined4 *)(param_2 + 0x1fc) ); } if ((undefined4 *)(param_1 + 0x200) != (undefined4 *)(param_2 + 0x200)) { FUN_00aee500((undefined4 *)(param_1 + 0x200),*(undefined4 *)(param_2 + 0x200), *(undefined4 *)(param_2 + 0x204)); FUN_00aee500(param_1 + 0x208,*(undefined4 *)(param_2 + 0x208),*(undefined4 *)(param_2 + 0x20c) ); } if ((undefined4 *)(param_1 + 0x210) != (undefined4 *)(param_2 + 0x210)) { FUN_00aee500((undefined4 *)(param_1 + 0x210),*(undefined4 *)(param_2 + 0x210), *(undefined4 *)(param_2 + 0x214)); FUN_00aee500(param_1 + 0x218,*(undefined4 *)(param_2 + 0x218),*(undefined4 *)(param_2 + 0x21c) ); } if ((undefined4 *)(param_1 + 0x220) != (undefined4 *)(param_2 + 0x220)) { FUN_00aee500((undefined4 *)(param_1 + 0x220),*(undefined4 *)(param_2 + 0x220), *(undefined4 *)(param_2 + 0x224)); FUN_00aee500(param_1 + 0x228,*(undefined4 *)(param_2 + 0x228),*(undefined4 *)(param_2 + 0x22c) ); } if ((undefined4 *)(param_1 + 0x230) != (undefined4 *)(param_2 + 0x230)) { FUN_00aee500((undefined4 *)(param_1 + 0x230),*(undefined4 *)(param_2 + 0x230), *(undefined4 *)(param_2 + 0x234)); FUN_00aee500(param_1 + 0x238,*(undefined4 *)(param_2 + 0x238),*(undefined4 *)(param_2 + 0x23c) ); } } return; } //@@ 00aeef70 FUN_00aeef70 void FUN_00aeef70(undefined4 param_1) { int *piVar1; void **_Dst; piVar1 = (int *)FUN_00ae6b50(); _Dst = (void **)(*piVar1 + 0x1e8); if (_Dst != &_mi_stats_main) { mi_stats_add(&_mi_stats_main,_Dst); memset(_Dst,0,0x240); } _mi_stats_print(&_mi_stats_main,param_1,0); return; } //@@ 00aeefd0 FUN_00aeefd0 void FUN_00aeefd0(void) { int *piVar1; double in_XMM0_Qa; longlong lVar2; longlong lVar3; undefined8 uVar4; piVar1 = (int *)FUN_00ae6b50(); if ((void **)(*piVar1 + 0x1e8) != &_mi_stats_main) { memset((void **)(*piVar1 + 0x1e8),0,0x240); } memset(&_mi_stats_main,0,0x240); uVar4 = CONCAT44(DAT_00c71294,DAT_00c71290); if (DAT_00c71290 == 0 && DAT_00c71294 == 0) { FUN_00aefe80(); lVar3 = CONCAT44(DAT_00c7129c,DAT_00c71298); if (in_XMM0_Qa == 0.0) { lVar2 = FUN_00aede40(); lVar3 = FUN_00aede40(); lVar3 = lVar3 - lVar2; } DAT_00c7129c = (undefined4)((ulonglong)lVar3 >> 0x20); DAT_00c71298 = (undefined4)lVar3; uVar4 = FUN_00aede40(); } DAT_00c71294 = (int)((ulonglong)uVar4 >> 0x20); DAT_00c71290 = (int)uVar4; return; } //@@ 00aef0a1 FUN_00aef0a1 void FUN_00aef0a1(void) { code *pcVar1; undefined4 *puVar2; int in_ECX; pcVar1 = *(code **)(**(int **)(in_ECX + 4) + 8); guard_check_icall(); puVar2 = (undefined4 *)(*pcVar1)(); if (puVar2 != (undefined4 *)0x0) { pcVar1 = *(code **)*puVar2; guard_check_icall(1); (*pcVar1)(); } return; } //@@ 00aef0d2 FUN_00aef0d2 void FUN_00aef0d2(void) { undefined4 *ptr; while (ptr = DAT_00c712a8, DAT_00c712a8 != (undefined4 *)0x0) { DAT_00c712a8 = (undefined4 *)*DAT_00c712a8; FUN_00aef0a1(); operator_delete(ptr,8); } return; } //@@ 00aef0f9 std::_Facet_Register /* Library Function - Single Match void __cdecl std::_Facet_Register(class std::_Facet_base *) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void __cdecl std::_Facet_Register(_Facet_base *param_1) { undefined4 *puVar1; puVar1 = operator_new(8); if (puVar1 == (undefined4 *)0x0) { puVar1 = (undefined4 *)0x0; } else { *puVar1 = DAT_00c712a8; puVar1[1] = param_1; } DAT_00c712a8 = puVar1; return; } //@@ 00aef12b __security_check_cookie /* WARNING: This is an inlined function */ void __fastcall __security_check_cookie(uintptr_t _StackCookie) { if (_StackCookie == __security_cookie) { return; } __report_gsfailure(); return; } //@@ 00aef139 FUN_00aef139 void FUN_00aef139(byte param_1) { undefined4 *in_ECX; *in_ECX = type_info::vftable; if ((param_1 & 1) != 0) { operator_delete(in_ECX,0xc); } return; } //@@ 00aef15c operator_delete /* DB: thunk to free-like; called with (ptr,size) from string _Tidy prototype: db/protos.zhl, caller cleans up (RET n cannot check it) */ void __cdecl operator_delete(void *ptr,uint size) { FUN_00a0f500(ptr); return; } //@@ 00aef191 FUN_00aef191 void FUN_00aef191(void) { code *pcVar1; HMODULE hModule; FARPROC pFVar2; FARPROC pFVar3; InitializeCriticalSectionAndSpinCount((LPCRITICAL_SECTION)&DAT_00c712b8,4000); hModule = GetModuleHandleW((LPCWSTR)(type_info::vftable + 1)); if (hModule == (HMODULE)0x0) { hModule = GetModuleHandleW(L"kernel32.dll"); if (hModule == (HMODULE)0x0) goto LAB_00aef20b; } pFVar2 = GetProcAddress(hModule,"SleepConditionVariableCS"); pFVar3 = GetProcAddress(hModule,"WakeAllConditionVariable"); if ((pFVar2 == (FARPROC)0x0) || (pFVar3 == (FARPROC)0x0)) { DAT_00c712b4 = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,1,0,(LPCWSTR)0x0); if (DAT_00c712b4 == (HANDLE)0x0) { LAB_00aef20b: __scrt_fastfail(7); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } } else { DAT_00c712d0 = pFVar2; DAT_00c712d4 = pFVar3; } return; } //@@ 00aef213 FUN_00aef213 void FUN_00aef213(void) { DeleteCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); if (DAT_00c712b4 != (HANDLE)0x0) { CloseHandle(DAT_00c712b4); } return; } //@@ 00aef22f __Init_thread_abort /* Library Function - Single Match __Init_thread_abort Library: Visual Studio 2019 Release */ void __Init_thread_abort(undefined4 *param_1) { EnterCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); *param_1 = 0; LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); __Init_thread_notify(); return; } //@@ 00aef253 _Init_thread_footer /* DB: increments epoch under critical section, __Init_thread_notify */ void _Init_thread_footer(int *param_1) { EnterCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); DAT_00bf9380 = DAT_00bf9380 + 1; *param_1 = DAT_00bf9380; *(int *)(*(int *)((int)ThreadLocalStoragePointer + _tls_index * 4) + 0xc) = DAT_00bf9380; LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); __Init_thread_notify(); return; } //@@ 00aef29d _Init_thread_header /* DB: MSVC thread-safe static init guard with critical section/_Init_thread_wait */ void _Init_thread_header(int *param_1) { EnterCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); do { if (*param_1 == 0) { *param_1 = -1; LAB_00aef2e4: LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); return; } if (*param_1 != -1) { *(undefined4 *)(*(int *)((int)ThreadLocalStoragePointer + _tls_index * 4) + 0xc) = DAT_00bf9380; goto LAB_00aef2e4; } __Init_thread_wait(100); } while( true ); } //@@ 00aef2ef __Init_thread_notify /* Library Function - Single Match __Init_thread_notify Library: Visual Studio 2019 Release */ void __Init_thread_notify(void) { code *pcVar1; pcVar1 = DAT_00c712d4; if (DAT_00c712d4 == (code *)0x0) { SetEvent(DAT_00c712b4); ResetEvent(DAT_00c712b4); return; } guard_check_icall(&DAT_00c712b0); (*pcVar1)(); return; } //@@ 00aef325 __Init_thread_wait /* Library Function - Single Match __Init_thread_wait Library: Visual Studio 2019 Release */ void __Init_thread_wait(DWORD param_1) { code *pcVar1; pcVar1 = DAT_00c712d0; if (DAT_00c712d0 == (code *)0x0) { LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); WaitForSingleObjectEx(DAT_00c712b4,param_1,0); EnterCriticalSection((LPCRITICAL_SECTION)&DAT_00c712b8); } else { guard_check_icall(&DAT_00c712b0,&DAT_00c712b8,param_1); (*pcVar1)(); } return; } //@@ 00aef373 find_pe_section /* Library Function - Single Match struct _IMAGE_SECTION_HEADER * __cdecl find_pe_section(unsigned char * const,unsigned int) Libraries: Visual Studio 2015 Release, Visual Studio 2017 Release, Visual Studio 2019 Release */ _IMAGE_SECTION_HEADER * __cdecl find_pe_section(uchar *param_1,uint param_2) { int iVar1; _IMAGE_SECTION_HEADER *p_Var2; _IMAGE_SECTION_HEADER *p_Var3; iVar1 = *(int *)(param_1 + 0x3c); p_Var2 = (_IMAGE_SECTION_HEADER *) (param_1 + (uint)*(ushort *)(param_1 + iVar1 + 0x14) + iVar1 + 0x18); p_Var3 = p_Var2 + (uint)*(ushort *)(param_1 + iVar1 + 6) * 0x28; while( true ) { if (p_Var2 == p_Var3) { return (_IMAGE_SECTION_HEADER *)0x0; } if ((*(uint *)(p_Var2 + 0xc) <= param_2) && (param_2 < (uint)(*(int *)(p_Var2 + 8) + *(int *)(p_Var2 + 0xc)))) break; p_Var2 = p_Var2 + 0x28; } return p_Var2; } //@@ 00aef3e9 ___scrt_initialize_crt /* Library Function - Single Match ___scrt_initialize_crt Libraries: Visual Studio 2015 Release, Visual Studio 2017 Release, Visual Studio 2019 Release */ undefined1 ___scrt_initialize_crt(int param_1) { char cVar1; if (param_1 == 0) { DAT_00c712e0 = 1; } __isa_available_init(); cVar1 = GridEntity::CanTakeDamageFromTearEffects(); if (cVar1 != '\0') { cVar1 = GridEntity::CanTakeDamageFromTearEffects(); if (cVar1 != '\0') { return 1; } GridEntity::CanTakeDamageFromTearEffects(); } return 0; } //@@ 00aef422 ___scrt_initialize_onexit_tables /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* Library Function - Single Match ___scrt_initialize_onexit_tables Library: Visual Studio 2019 Release */ undefined4 ___scrt_initialize_onexit_tables(int param_1) { code *pcVar1; int iVar2; undefined4 uVar3; if (DAT_00c712e1 != '\0') { return 1; } if ((param_1 != 0) && (param_1 != 1)) { __scrt_fastfail(5); pcVar1 = (code *)swi(3); uVar3 = (*pcVar1)(); return uVar3; } iVar2 = ___scrt_is_ucrt_dll_in_use(); if ((iVar2 == 0) || (param_1 != 0)) { DAT_00c712e4 = 0xffffffff; _DAT_00c712e8 = 0xffffffff; _DAT_00c712ec = 0xffffffff; _DAT_00c712f0 = 0xffffffff; _DAT_00c712f4 = 0xffffffff; _DAT_00c712f8 = 0xffffffff; LAB_00aef495: DAT_00c712e1 = '\x01'; uVar3 = 1; } else { iVar2 = initialize_onexit_table(&DAT_00c712e4); if (iVar2 == 0) { iVar2 = initialize_onexit_table(&DAT_00c712f0); if (iVar2 == 0) goto LAB_00aef495; } uVar3 = 0; } return uVar3; } //@@ 00aef53d ___scrt_release_startup_lock /* Library Function - Single Match ___scrt_release_startup_lock Libraries: Visual Studio 2015 Release, Visual Studio 2017 Release, Visual Studio 2019 Release */ int ___scrt_release_startup_lock(char param_1) { int iVar1; int iVar2; iVar2 = ___scrt_is_ucrt_dll_in_use(); iVar1 = DAT_00c712dc; if ((iVar2 != 0) && (param_1 == '\0')) { LOCK(); DAT_00c712dc = 0; UNLOCK(); iVar2 = iVar1; } return iVar2; } //@@ 00aef55a ___scrt_uninitialize_crt /* Library Function - Single Match ___scrt_uninitialize_crt Libraries: Visual Studio 2015 Release, Visual Studio 2017 Release, Visual Studio 2019 Release */ undefined1 ___scrt_uninitialize_crt(undefined4 param_1,char param_2) { GridEntity *in_ECX; if ((DAT_00c712e0 == '\0') || (param_2 == '\0')) { GridEntity::CanTakeDamageFromTearEffects(in_ECX,param_1); GridEntity::CanTakeDamageFromTearEffects(); } return 1; } //@@ 00aef582 __onexit /* Library Function - Single Match __onexit Library: Visual Studio 2019 Release */ _onexit_t __cdecl __onexit(_onexit_t _Func) { int iVar1; if (DAT_00c712e4 == -1) { iVar1 = crt_atexit(); } else { iVar1 = register_onexit_function(&DAT_00c712e4,_Func); } return (_onexit_t)(~-(uint)(iVar1 != 0) & (uint)_Func); } //@@ 00aef5af _atexit /* Library Function - Single Match _atexit Library: Visual Studio 2019 Release */ int __cdecl _atexit(_func_4879 *param_1) { _onexit_t p_Var1; p_Var1 = __onexit((_onexit_t)param_1); return (p_Var1 != (_onexit_t)0x0) - 1; } //@@ 00aef5c4 `eh_vector_constructor_iterator' /* WARNING: Function: __SEH_prolog4 replaced with injection: SEH_prolog4 */ /* Library Function - Single Match void __stdcall `eh vector constructor iterator'(void *,unsigned int,unsigned int,void (__thiscall*)(void *),void (__thiscall*)(void *)) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void _eh_vector_constructor_iterator_ (void *param_1,uint param_2,uint param_3,_func_void_void_ptr *param_4, _func_void_void_ptr *param_5) { uint uVar1; void *in_stack_ffffffcc; void *local_14; for (uVar1 = 0; uVar1 != param_3; uVar1 = uVar1 + 1) { guard_check_icall(); (*param_4)(in_stack_ffffffcc); } FUN_00aef624(); ExceptionList = local_14; return; } //@@ 00aef624 FUN_00aef624 void FUN_00aef624(void) { char in_AL; uint unaff_EBX; int unaff_EBP; if (in_AL == '\0') { __ArrayUnwind(*(void **)(unaff_EBP + 8),*(uint *)(unaff_EBP + 0xc),unaff_EBX, *(_func_void_void_ptr **)(unaff_EBP + 0x18)); } return; } //@@ 00aef638 `eh_vector_destructor_iterator' /* WARNING: Function: __SEH_prolog4 replaced with injection: SEH_prolog4 */ /* Library Function - Single Match void __stdcall `eh vector destructor iterator'(void *,unsigned int,unsigned int,void (__thiscall*)(void *)) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void _eh_vector_destructor_iterator_ (void *param_1,uint param_2,uint param_3,_func_void_void_ptr *param_4) { void *in_stack_ffffffd0; void *local_14; while( true ) { if (param_3 == 0) break; guard_check_icall(); (*param_4)(in_stack_ffffffd0); param_3 = param_3 - 1; } FUN_00aef6ad(); ExceptionList = local_14; return; } //@@ 00aef6ad FUN_00aef6ad void FUN_00aef6ad(void) { char in_AL; uint unaff_EBX; int unaff_EBP; void *unaff_ESI; uint unaff_EDI; if (in_AL == '\0') { __ArrayUnwind(unaff_ESI,unaff_EBX,unaff_EDI,*(_func_void_void_ptr **)(unaff_EBP + 0x14)); } return; } //@@ 00aef6bd __ArrayUnwind /* WARNING: Function: __SEH_prolog4 replaced with injection: SEH_prolog4 */ /* Library Function - Single Match void __stdcall __ArrayUnwind(void *,unsigned int,unsigned int,void (__thiscall*)(void *)) Library: Visual Studio 2019 Release */ void __ArrayUnwind(void *param_1,uint param_2,uint param_3,_func_void_void_ptr *param_4) { uint uVar1; void *in_stack_ffffffc4; void *local_14; uVar1 = 0; while( true ) { if (uVar1 == param_3) break; guard_check_icall(); (*param_4)(in_stack_ffffffc4); uVar1 = uVar1 + 1; } ExceptionList = local_14; return; } //@@ 00aef74d FUN_00aef74d void FUN_00aef74d(_EXCEPTION_POINTERS *param_1) { HANDLE hProcess; UINT uExitCode; SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)0x0); UnhandledExceptionFilter(param_1); uExitCode = 0xc0000409; hProcess = GetCurrentProcess(); TerminateProcess(hProcess,uExitCode); return; } //@@ 00aef775 __report_gsfailure /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* DB: MSVC CRT stack-cookie failure handler: only caller __security_check_cookie; captures the register context (all segment/flag registers) and raises the fast-fail */ void __report_gsfailure(undefined1 param_1) { code *pcVar1; uint uVar2; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar3; uint extraout_EDX; undefined4 unaff_EBX; undefined4 unaff_EBP; undefined4 unaff_ESI; undefined4 unaff_EDI; undefined2 in_ES; undefined2 in_CS; undefined2 in_SS; undefined2 in_DS; undefined2 in_FS; undefined2 in_GS; byte bVar4; byte bVar5; byte in_AF; byte bVar6; byte bVar7; byte in_TF; byte in_IF; byte bVar8; byte in_NT; byte in_AC; byte in_VIF; byte in_VIP; byte in_ID; longlong lVar9; undefined4 unaff_retaddr; uVar2 = IsProcessorFeaturePresent(0x17); bVar4 = 0; bVar8 = 0; bVar7 = (int)uVar2 < 0; bVar6 = uVar2 == 0; bVar5 = (POPCOUNT(uVar2 & 0xff) & 1U) == 0; lVar9 = (ulonglong)extraout_EDX << 0x20; uVar3 = extraout_ECX; if (!(bool)bVar6) { pcVar1 = (code *)swi(0x29); lVar9 = (*pcVar1)(); uVar3 = extraout_ECX_00; } _DAT_00c713f8 = (undefined4)((ulonglong)lVar9 >> 0x20); _DAT_00c71400 = (undefined4)lVar9; _DAT_00c71410 = (uint)(in_NT & 1) * 0x4000 | (uint)(bVar8 & 1) * 0x800 | (uint)(in_IF & 1) * 0x200 | (uint)(in_TF & 1) * 0x100 | (uint)(bVar7 & 1) * 0x80 | (uint)(bVar6 & 1) * 0x40 | (uint)(in_AF & 1) * 0x10 | (uint)(bVar5 & 1) * 4 | (uint)(bVar4 & 1) | (uint)(in_ID & 1) * 0x200000 | (uint)(in_VIP & 1) * 0x100000 | (uint)(in_VIF & 1) * 0x80000 | (uint)(in_AC & 1) * 0x40000; _DAT_00c71414 = ¶m_1; _DAT_00c71350 = 0x10001; _DAT_00c71300 = 0xc0000409; _DAT_00c71304 = 1; _DAT_00c71310 = 1; DAT_00c71314 = 2; _DAT_00c7130c = unaff_retaddr; _DAT_00c713dc = in_GS; _DAT_00c713e0 = in_FS; _DAT_00c713e4 = in_ES; _DAT_00c713e8 = in_DS; _DAT_00c713ec = unaff_EDI; _DAT_00c713f0 = unaff_ESI; _DAT_00c713f4 = unaff_EBX; _DAT_00c713fc = uVar3; _DAT_00c71404 = unaff_EBP; DAT_00c71408 = unaff_retaddr; _DAT_00c7140c = in_CS; _DAT_00c71418 = in_SS; FUN_00aef74d(&PTR_DAT_00b1a4c0); return; } //@@ 00aef86f FUN_00aef86f void FUN_00aef86f(void) { FUN_00aef87b(8); return; } //@@ 00aef87b FUN_00aef87b /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00aef87b(undefined4 param_1) { code *pcVar1; uint uVar2; undefined4 extraout_ECX; undefined4 extraout_ECX_00; undefined4 uVar3; uint extraout_EDX; undefined4 unaff_EBX; undefined4 unaff_EBP; undefined4 unaff_ESI; undefined4 unaff_EDI; undefined2 in_ES; undefined2 in_CS; undefined2 in_SS; undefined2 in_DS; undefined2 in_FS; undefined2 in_GS; byte bVar4; byte bVar5; byte in_AF; byte bVar6; byte bVar7; byte in_TF; byte in_IF; byte bVar8; byte in_NT; byte in_AC; byte in_VIF; byte in_VIP; byte in_ID; longlong lVar9; undefined4 unaff_retaddr; uVar2 = IsProcessorFeaturePresent(0x17); bVar4 = 0; bVar8 = 0; bVar7 = (int)uVar2 < 0; bVar6 = uVar2 == 0; bVar5 = (POPCOUNT(uVar2 & 0xff) & 1U) == 0; lVar9 = (ulonglong)extraout_EDX << 0x20; uVar3 = extraout_ECX; if (!(bool)bVar6) { pcVar1 = (code *)swi(0x29); lVar9 = (*pcVar1)(); uVar3 = extraout_ECX_00; } _DAT_00c713f8 = (undefined4)((ulonglong)lVar9 >> 0x20); _DAT_00c71400 = (undefined4)lVar9; _DAT_00c71410 = (uint)(in_NT & 1) * 0x4000 | (uint)(bVar8 & 1) * 0x800 | (uint)(in_IF & 1) * 0x200 | (uint)(in_TF & 1) * 0x100 | (uint)(bVar7 & 1) * 0x80 | (uint)(bVar6 & 1) * 0x40 | (uint)(in_AF & 1) * 0x10 | (uint)(bVar5 & 1) * 4 | (uint)(bVar4 & 1) | (uint)(in_ID & 1) * 0x200000 | (uint)(in_VIP & 1) * 0x100000 | (uint)(in_VIF & 1) * 0x80000 | (uint)(in_AC & 1) * 0x40000; _DAT_00c71414 = ¶m_1; _DAT_00c71300 = 0xc0000409; _DAT_00c71304 = 1; _DAT_00c71310 = 1; DAT_00c71314 = param_1; _DAT_00c7130c = unaff_retaddr; _DAT_00c713dc = in_GS; _DAT_00c713e0 = in_FS; _DAT_00c713e4 = in_ES; _DAT_00c713e8 = in_DS; _DAT_00c713ec = unaff_EDI; _DAT_00c713f0 = unaff_ESI; _DAT_00c713f4 = unaff_EBX; _DAT_00c713fc = uVar3; _DAT_00c71404 = unaff_EBP; DAT_00c71408 = unaff_retaddr; _DAT_00c7140c = in_CS; _DAT_00c71418 = in_SS; FUN_00aef74d(&PTR_DAT_00b1a4c0); return; } //@@ 00aef94a FUN_00aef94a void FUN_00aef94a(void) { InitializeSListHead((PSLIST_HEADER)&DAT_00c71620); return; } //@@ 00aef956 `eh_vector_copy_constructor_iterator' /* WARNING: Function: __SEH_prolog4 replaced with injection: SEH_prolog4 */ /* Library Function - Single Match void __stdcall `eh vector copy constructor iterator'(void *,void *,unsigned int,unsigned int,void (__thiscall*)(void *,void *),void (__thiscall*)(void *)) Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ void _eh_vector_copy_constructor_iterator_ (void *param_1,void *param_2,uint param_3,uint param_4, _func_void_void_ptr_void_ptr *param_5,_func_void_void_ptr *param_6) { uint uVar1; void *pvVar2; void *in_stack_ffffffcc; void *local_14; for (uVar1 = 0; uVar1 != param_4; uVar1 = uVar1 + 1) { pvVar2 = param_2; guard_check_icall(); (*param_5)(pvVar2,in_stack_ffffffcc); param_2 = (void *)((int)param_2 + param_3); } FUN_00aef9bc(); ExceptionList = local_14; return; } //@@ 00aef9bc FUN_00aef9bc void FUN_00aef9bc(void) { char in_AL; uint unaff_EBX; int unaff_EBP; if (in_AL == '\0') { __ArrayUnwind(*(void **)(unaff_EBP + 8),*(uint *)(unaff_EBP + 0x10),unaff_EBX, *(_func_void_void_ptr **)(unaff_EBP + 0x1c)); } return; } //@@ 00aef9d0 __except_handler4 /* Library Function - Single Match __except_handler4 Library: Visual Studio 2019 Release */ void __except_handler4(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4) { undefined4 uVar1; uVar1 = __filter_x86_sse2_floating_point_exception_default(*param_1); *param_1 = uVar1; except_handler4_common(&__security_cookie,__security_check_cookie,param_1,param_2,param_3,param_4) ; return; } //@@ 00aefc50 __allshl /* Library Function - Single Match __allshl Library: Visual Studio */ longlong __allshl(void) { uint in_EAX; byte in_CL; int in_EDX; if (0x3f < in_CL) { return 0; } if (in_CL < 0x20) { return CONCAT44(in_EDX << (in_CL & 0x1f) | in_EAX >> 0x20 - (in_CL & 0x1f), in_EAX << (in_CL & 0x1f)); } return (ulonglong)(in_EAX << (in_CL & 0x1f)) << 0x20; } //@@ 00aefc70 __allshr /* Library Function - Single Match __allshr Library: Visual Studio */ undefined8 __allshr(void) { uint in_EAX; byte in_CL; int in_EDX; int iVar1; iVar1 = in_EDX >> 0x1f; if (0x3f < in_CL) { return CONCAT44(iVar1,iVar1); } if (in_CL < 0x20) { return CONCAT44(in_EDX >> (in_CL & 0x1f), in_EAX >> (in_CL & 0x1f) | in_EDX << 0x20 - (in_CL & 0x1f)); } return CONCAT44(iVar1,in_EDX >> (in_CL & 0x1f)); } //@@ 00aefca0 __ftoui3 /* DB: float->uint conversion, AVX512 vcvttss2usi fast path */ uint __ftoui3(void) { undefined1 auVar1 [16]; uint uVar2; bool bVar3; float in_XMM0_Da; undefined1 in_register_00001204 [12]; if (5 < __isa_available) { auVar1._4_12_ = in_register_00001204; auVar1._0_4_ = in_XMM0_Da; uVar2 = vcvttss2usi_avx512f(auVar1); return uVar2; } uVar2 = (int)in_XMM0_Da * 2; if ((int)in_XMM0_Da < 0) { bVar3 = uVar2 < 0x7f000000; if (!bVar3) goto LAB_00aefcda; } else if (0x9dffffff < uVar2) { bVar3 = false; if (uVar2 < 0x9f000000) { return (int)in_XMM0_Da << 8 | 0x80000000; } LAB_00aefcda: return -(uint)!bVar3; } return (int)in_XMM0_Da; } //@@ 00aefcf0 __dtoui3 /* DB: MSVC CRT double -> unsigned int conversion helper (vcvttsd2usi fast path, else manual; 0xffffffff on overflow); sibling of __ftoui3; used by NetConnection::send_message, libpng_png_build_gamma_table, MsgWaitForMultipleObjects timeout */ uint __dtoui3(void) { undefined1 auVar1 [16]; uint uVar2; double in_XMM0_Qa; undefined8 in_XMM0_Qb; uint local_8; uint uStack_4; if (5 < __isa_available) { auVar1._8_8_ = in_XMM0_Qb; auVar1._0_8_ = in_XMM0_Qa; uVar2 = vcvttsd2usi_avx512f(auVar1); return uVar2; } local_8 = SUB84(in_XMM0_Qa,0); uStack_4 = (uint)((ulonglong)in_XMM0_Qa >> 0x20); uVar2 = uStack_4 & 0x7fffffff; if ((longlong)in_XMM0_Qa < 0) { if (uVar2 < 0x3ff00000) { return 0; } } else { if (uVar2 < 0x41e00000) { return (int)in_XMM0_Qa; } if (uVar2 < 0x41f00000) { return local_8 >> 0x15 | uStack_4 << 0xb | 0x80000000; } } return 0xffffffff; } //@@ 00aefd70 __dtoul3 /* DB: MSVC CRT double -> unsigned __int64 conversion helper (AVX-512 vcvttpd2uqq fast path when __isa_available > 5, else manual exponent/mantissa shift, 0xffffffffffffffff on overflow); used by GetTimeNs */ ulonglong __dtoul3(void) { byte bVar1; byte bVar2; uint uVar3; uint uVar4; uint uVar5; undefined1 auVar6 [16]; double in_XMM0_Qa; uint local_8; if (5 < __isa_available) { auVar6._8_8_ = 0; auVar6._0_8_ = in_XMM0_Qa; auVar6 = vcvttpd2uqq_avx512vl(auVar6); return auVar6._0_8_; } local_8 = SUB84(in_XMM0_Qa,0); uVar3 = (uint)((ulonglong)in_XMM0_Qa >> 0x20); uVar4 = uVar3 & 0x7fffffff; if ((longlong)in_XMM0_Qa < 0) { if (uVar4 < 0x3ff00000) { return 0; } } else { if (uVar4 < 0x41e00000) { return (ulonglong)(uint)(int)in_XMM0_Qa; } uVar5 = uVar3 & 0x1fffff | 0x100000; uVar3 = (uVar4 >> 0x14) - 0x433; bVar2 = (byte)uVar3; if (uVar4 >> 0x14 < 0x433) { bVar1 = -bVar2 & 0x1f; return CONCAT44(uVar5 >> (-bVar2 & 0x1f),local_8 >> bVar1 | uVar5 << 0x20 - bVar1); } if (uVar3 < 0xc) { return CONCAT44(uVar5 << (bVar2 & 0x1f) | local_8 >> 0x20 - (bVar2 & 0x1f), local_8 << (bVar2 & 0x1f)); } } return 0xffffffffffffffff; } //@@ 00aefe20 FUN_00aefe20 void FUN_00aefe20(void) { uint in_ECX; if (__isa_available < 6) { return; } vcvtuqq2pd_avx512vl(ZEXT416(in_ECX)); return; } //@@ 00aefe80 FUN_00aefe80 void FUN_00aefe80(void) { uint in_ECX; if (__isa_available < 6) { return; } vcvtqq2pd_avx512vl(ZEXT416(in_ECX)); return; } //@@ 00aefec1 tls_callback_0 void tls_callback_0(undefined4 param_1,int param_2) { int iVar1; code *pcVar2; uint uVar3; undefined4 *puVar4; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; uStack_8 = 0xffffffff; puStack_c = &LAB_00b10960; local_10 = ExceptionList; uVar3 = __security_cookie ^ (int)register0x00000010 - 4U; ExceptionList = &local_10; if ((param_2 == 2) && (iVar1 = *(int *)((int)ThreadLocalStoragePointer + _tls_index * 4), *(char *)(iVar1 + 0x10) != '\x01')) { *(undefined1 *)(iVar1 + 0x10) = 1; for (puVar4 = &DAT_00b18c0c; puVar4 != &DAT_00b18c0c; puVar4 = puVar4 + 1) { pcVar2 = (code *)*puVar4; if (pcVar2 != (code *)0x0) { guard_check_icall(uVar3); (*pcVar2)(); } } } ExceptionList = local_10; return; } //@@ 00aeff45 FUN_00aeff45 void FUN_00aeff45(void) { tls_callback_0(0,2,0); return; } //@@ 00aeff60 __alloca_probe /* WARNING: This is an inlined function */ /* Library Function - Single Match __chkstk Library: Visual Studio */ void __alloca_probe(void) { undefined1 *in_EAX; undefined4 *puVar1; undefined4 *puVar2; undefined1 local_res0; undefined1 auStack_4 [4]; puVar2 = (undefined4 *)((int)&local_res0 - (int)in_EAX & ~-(uint)(&local_res0 < in_EAX)); for (puVar1 = (undefined4 *)((uint)auStack_4 & 0xfffff000); puVar2 < puVar1; puVar1 = puVar1 + -0x400) { } *puVar2 = _local_res0; return; } //@@ 00aeff8b __isa_available_init /* WARNING: Removing unreachable block (ram,0x00aefff9) */ /* WARNING: Removing unreachable block (ram,0x00aeffbe) */ /* WARNING: Removing unreachable block (ram,0x00af0070) */ /* DB: MSVC CRT: IsProcessorFeaturePresent(10), cpuid leaf 0/1/7 vendor "GenuineIntel" model checks, xgetbv for AVX, sets __isa_available/__favor (DAT_00bf93a0, DAT_00c71630); only caller ___scrt_initialize_crt */ undefined4 __isa_available_init(void) { int *piVar1; uint *puVar2; int iVar3; undefined8 uVar4; BOOL BVar5; uint uVar6; uint uVar7; uint uVar8; uint in_XCR0; __isa_available = 0; DAT_00bf93a0 = DAT_00bf93a0 | 1; BVar5 = IsProcessorFeaturePresent(10); uVar6 = DAT_00bf93a0; if (BVar5 != 0) { piVar1 = (int *)cpuid_basic_info(0); puVar2 = (uint *)cpuid_Version_info(1); uVar7 = puVar2[3]; if (((piVar1[1] == 0x756e6547 && piVar1[3] == 0x6c65746e) && piVar1[2] == 0x49656e69) && (((((uVar6 = *puVar2 & 0xfff3ff0, uVar6 == 0x106c0 || (uVar6 == 0x20660)) || (uVar6 == 0x20670)) || ((uVar6 == 0x30650 || (uVar6 == 0x30660)))) || (uVar6 == 0x30670))) ) { DAT_00c71630 = DAT_00c71630 | 1; } if (*piVar1 < 7) { uVar8 = 0; } else { iVar3 = cpuid_Extended_Feature_Enumeration_info(7); uVar8 = *(uint *)(iVar3 + 4); if ((uVar8 & 0x200) != 0) { DAT_00c71630 = DAT_00c71630 | 2; } } __isa_available = 1; uVar6 = DAT_00bf93a0 | 2; if ((uVar7 & 0x100000) != 0) { uVar6 = DAT_00bf93a0 | 6; __isa_available = 2; if (((uVar7 & 0x8000000) != 0) && ((uVar7 & 0x10000000) != 0)) { uVar4 = xinuse(0); in_XCR0 = in_XCR0 & (uint)uVar4; if ((in_XCR0 & 6) == 6) { __isa_available = 3; uVar6 = DAT_00bf93a0 | 0xe; if ((uVar8 & 0x20) != 0) { __isa_available = 5; uVar6 = DAT_00bf93a0 | 0x2e; if (((uVar8 & 0xd0030000) == 0xd0030000) && ((in_XCR0 & 0xe0) == 0xe0)) { DAT_00bf93a0 = DAT_00bf93a0 | 0x6e; __isa_available = 6; uVar6 = DAT_00bf93a0; } } } } } } DAT_00bf93a0 = uVar6; return 0; } //@@ 00af0160 __alldiv /* Library Function - Single Match __alldiv Library: Visual Studio */ undefined8 __alldiv(uint param_1,uint param_2,uint param_3,uint param_4) { ulonglong uVar1; longlong lVar2; uint uVar3; uint uVar4; int iVar5; uint uVar6; uint uVar7; uint uVar8; bool bVar9; char cVar10; cVar10 = (int)param_2 < 0; if ((bool)cVar10) { bVar9 = param_1 != 0; param_1 = -param_1; param_2 = -(uint)bVar9 - param_2; } if ((int)param_4 < 0) { cVar10 = cVar10 + '\x01'; bVar9 = param_3 != 0; param_3 = -param_3; param_4 = -(uint)bVar9 - param_4; } if (param_4 == 0) { uVar4 = param_2 / param_3; iVar5 = (int)(((ulonglong)param_2 % (ulonglong)param_3 << 0x20 | (ulonglong)param_1) / (ulonglong)param_3); } else { uVar7 = param_1; uVar4 = param_3; uVar6 = param_2; uVar8 = param_4; do { uVar3 = uVar8 & 1; uVar8 = uVar8 >> 1; uVar4 = (uint)(CONCAT14(uVar3 != 0,uVar4) >> 1); uVar3 = uVar6 & 1; uVar6 = uVar6 >> 1; uVar7 = (uint)(CONCAT14(uVar3 != 0,uVar7) >> 1); } while (uVar8 != 0); uVar1 = CONCAT44(uVar6,uVar7) / (ulonglong)uVar4; iVar5 = (int)uVar1; lVar2 = (ulonglong)param_3 * (uVar1 & 0xffffffff); uVar4 = (uint)((ulonglong)lVar2 >> 0x20); uVar7 = uVar4 + iVar5 * param_4; if (((CARRY4(uVar4,iVar5 * param_4)) || (param_2 < uVar7)) || ((param_2 <= uVar7 && (param_1 < (uint)lVar2)))) { iVar5 = iVar5 + -1; } uVar4 = 0; } if (cVar10 == '\x01') { bVar9 = iVar5 != 0; iVar5 = -iVar5; uVar4 = -(uint)bVar9 - uVar4; } return CONCAT44(uVar4,iVar5); } //@@ 00af0210 __allmul /* Library Function - Single Match __allmul Library: Visual Studio */ longlong __allmul(uint param_1,int param_2,uint param_3,int param_4) { if (param_4 == 0 && param_2 == 0) { return (ulonglong)param_1 * (ulonglong)param_3; } return CONCAT44((int)((ulonglong)param_1 * (ulonglong)param_3 >> 0x20) + param_2 * param_3 + param_1 * param_4, (int)((ulonglong)param_1 * (ulonglong)param_3)); } //@@ 00af0244 __scrt_fastfail /* DB: MSVC CRT: IsProcessorFeaturePresent(0x17) -> int 0x29 fastfail, else builds a CONTEXT/EXCEPTION_RECORD with code 0x40000015 (STATUS_FATAL_APP_EXIT) and calls UnhandledExceptionFilter; called with codes 5/7 from ___scrt_initialize_onexit_tables and the condition-variable init FUN_00aef191 */ void __scrt_fastfail(void) { code *pcVar1; BOOL BVar2; LONG LVar3; undefined4 local_328 [39]; EXCEPTION_RECORD local_5c; _EXCEPTION_POINTERS local_c; BVar2 = IsProcessorFeaturePresent(0x17); if (BVar2 != 0) { pcVar1 = (code *)swi(0x29); (*pcVar1)(); } FUN_00af0409(); memset(local_328,0,0x2cc); local_328[0] = 0x10001; memset(&local_5c,0,0x50); local_5c.ExceptionCode = 0x40000015; local_5c.ExceptionFlags = 1; BVar2 = IsDebuggerPresent(); local_c.ExceptionRecord = &local_5c; local_c.ContextRecord = (PCONTEXT)local_328; SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)0x0); LVar3 = UnhandledExceptionFilter(&local_c); if ((LVar3 == 0) && (BVar2 != 1)) { FUN_00af0409(); } return; } //@@ 00af03a7 FUN_00af03a7 void FUN_00af03a7(void) { SetUnhandledExceptionFilter(FUN_00af03b3); return; } //@@ 00af03b3 FUN_00af03b3 undefined4 FUN_00af03b3(int *param_1) { int iVar1; int *piVar2; int *piVar3; piVar3 = (int *)*param_1; if (((*piVar3 == -0x1f928c9d) && (piVar3[4] == 3)) && ((iVar1 = piVar3[5], iVar1 == 0x19930520 || (((iVar1 == 0x19930521 || (iVar1 == 0x19930522)) || (iVar1 == 0x1994000)))))) { piVar2 = (int *)__current_exception(); *piVar2 = (int)piVar3; iVar1 = param_1[1]; piVar3 = (int *)__current_exception_context(); *piVar3 = iVar1; /* WARNING: Subroutine does not return */ terminate(); } return 0; } //@@ 00af0409 FUN_00af0409 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00af0409(void) { _DAT_00c71638 = 0; return; } //@@ 00af0411 FUN_00af0411 undefined4 FUN_00af0411(void) { return 1; } //@@ 00af0415 ___scrt_is_ucrt_dll_in_use /* Library Function - Single Match ___scrt_is_ucrt_dll_in_use Library: Visual Studio 2019 Release */ bool ___scrt_is_ucrt_dll_in_use(void) { return DAT_00bf93c4 != 0; } //@@ 00af0430 __SEH_prolog4 /* WARNING: This is an inlined function */ /* WARNING: Unable to track spacebase fully for stack */ /* Library Function - Single Match __SEH_prolog4 Library: Visual Studio */ void __SEH_prolog4(undefined4 param_1,int param_2) { undefined4 unaff_EBX; undefined4 unaff_ESI; undefined4 unaff_EDI; undefined4 unaff_retaddr; uint auStack_1c [5]; undefined1 local_8 [8]; param_2 = -param_2; *(undefined4 *)((int)auStack_1c + param_2 + 0x10) = unaff_EBX; *(undefined4 *)((int)auStack_1c + param_2 + 0xc) = unaff_ESI; *(undefined4 *)((int)auStack_1c + param_2 + 8) = unaff_EDI; *(uint *)((int)auStack_1c + param_2 + 4) = __security_cookie ^ (uint)((int)register0x00000010 + 8) ; *(undefined4 *)((int)auStack_1c + param_2) = unaff_retaddr; ExceptionList = local_8; return; } //@@ 00af0475 ___get_entropy /* Library Function - Single Match ___get_entropy Libraries: Visual Studio 2017 Release, Visual Studio 2019 Release */ uint ___get_entropy(void) { DWORD DVar1; LARGE_INTEGER local_18; _FILETIME local_10; uint local_8; local_10.dwLowDateTime = 0; local_10.dwHighDateTime = 0; GetSystemTimeAsFileTime(&local_10); local_8 = local_10.dwHighDateTime ^ local_10.dwLowDateTime; DVar1 = GetCurrentThreadId(); local_8 = local_8 ^ DVar1; DVar1 = GetCurrentProcessId(); local_8 = local_8 ^ DVar1; QueryPerformanceCounter(&local_18); return local_18.s.HighPart ^ local_18.s.LowPart ^ local_8 ^ (uint)&local_8; } //@@ 00af050d FUN_00af050d undefined4 FUN_00af050d(void) { return 0x4000; } //@@ 00af0513 FUN_00af0513 void FUN_00af0513(void) { code *pcVar1; errno_t eVar2; eVar2 = _controlfp_s((uint *)0x0,0x10000,0x30000); if (eVar2 == 0) { return; } __scrt_fastfail(7); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } //@@ 00af0534 FUN_00af0534 void FUN_00af0534(void) { uint *puVar1; puVar1 = (uint *)FUN_0041d4c0(); *puVar1 = *puVar1 | 0x24; puVar1[1] = puVar1[1]; puVar1 = (uint *)FUN_00837050(); *puVar1 = *puVar1 | 2; puVar1[1] = puVar1[1]; return; } //@@ 00af0551 FUN_00af0551 bool FUN_00af0551(void) { return DAT_00bf93c0 == 0; } //@@ 00af0569 FUN_00af0569 /* WARNING: Removing unreachable block (ram,0x00af0579) */ /* WARNING: Removing unreachable block (ram,0x00af057a) */ /* WARNING: Removing unreachable block (ram,0x00af0580) */ /* WARNING: Removing unreachable block (ram,0x00af058a) */ /* WARNING: Removing unreachable block (ram,0x00af0591) */ void FUN_00af0569(void) { return; } //@@ 00af0595 FUN_00af0595 /* WARNING: Removing unreachable block (ram,0x00af05a5) */ /* WARNING: Removing unreachable block (ram,0x00af05a6) */ /* WARNING: Removing unreachable block (ram,0x00af05ac) */ /* WARNING: Removing unreachable block (ram,0x00af05b6) */ /* WARNING: Removing unreachable block (ram,0x00af05bd) */ void FUN_00af0595(void) { return; } //@@ 00af069f __filter_x86_sse2_floating_point_exception_default /* Library Function - Single Match __filter_x86_sse2_floating_point_exception_default Library: Visual Studio 2019 Release */ int __filter_x86_sse2_floating_point_exception_default(int param_1) { uint uVar1; if ((__isa_available < 1) || ((param_1 != -0x3ffffd4c && (param_1 != -0x3ffffd4b)))) { return param_1; } uVar1 = MXCSR ^ 0x3f; if ((uVar1 & 0x81) != 0) { if ((uVar1 & 0x204) == 0) { return -0x3fffff72; } if ((uVar1 & 0x102) != 0) { if ((uVar1 & 0x408) == 0) { return -0x3fffff6f; } if ((uVar1 & 0x810) == 0) { return -0x3fffff6d; } if ((uVar1 & 0x1020) == 0) { return -0x3fffff71; } return param_1; } } return -0x3fffff70; } //@@ 00af0720 __alloca_probe_16 /* WARNING: This is an inlined function */ /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* Library Function - Single Match __alloca_probe_16 Library: Visual Studio */ uint __alloca_probe_16(void) { uint in_EAX; uint uVar1; uVar1 = 4 - in_EAX & 0xf; return in_EAX + uVar1 | -(uint)CARRY4(in_EAX,uVar1); } //@@ 00af0736 __alloca_probe_8 /* WARNING: This is an inlined function */ /* WARNING: Function: __alloca_probe replaced with injection: alloca_probe */ /* Library Function - Single Match __alloca_probe_8 Library: Visual Studio */ uint __alloca_probe_8(void) { uint in_EAX; uint uVar1; uVar1 = 4 - in_EAX & 7; return in_EAX + uVar1 | -(uint)CARRY4(in_EAX,uVar1); } //@@ 00af0750 __aullshr /* Library Function - Single Match __aullshr Library: Visual Studio */ ulonglong __aullshr(void) { uint in_EAX; byte in_CL; uint in_EDX; if (0x3f < in_CL) { return 0; } if (in_CL < 0x20) { return CONCAT44(in_EDX >> (in_CL & 0x1f), in_EAX >> (in_CL & 0x1f) | in_EDX << 0x20 - (in_CL & 0x1f)); } return (ulonglong)(in_EDX >> (in_CL & 0x1f)); } //@@ 00af0780 FUN_00af0780 int FUN_00af0780(void) { uint uVar1; ushort uVar2; float10 in_ST0; uint uStack_1c; ushort uStack_18; if (1 < __isa_available) { return (int)in_ST0; } uStack_1c = (uint)((unkuint10)in_ST0 >> 0x20); uStack_18 = (ushort)((unkuint10)in_ST0 >> 0x40); uVar2 = uStack_18 & 0x7fff; uVar1 = -(uint)((short)uStack_18 < 0); if (uVar2 < 0x3fff) { return 0; } if ((int)uStack_1c < 0) { if (uVar2 < 0x401e) { return (uStack_1c >> (0x3eU - (char)uVar2 & 0x1f) ^ uVar1) + (uint)((short)uStack_18 < 0); } if (((uVar2 < 0x401f) && ((int)uVar1 < 0)) && (uStack_1c == 0x80000000)) { return -0x80000000; } } return -0x80000000; } //@@ 00af0791 FUN_00af0791 int FUN_00af0791(void) { uint uVar1; ushort uVar2; unkbyte10 in_ST0; uint uStack_1c; ushort uStack_18; uStack_1c = (uint)((unkuint10)in_ST0 >> 0x20); uStack_18 = (ushort)((unkuint10)in_ST0 >> 0x40); uVar2 = uStack_18 & 0x7fff; uVar1 = -(uint)((short)uStack_18 < 0); if (uVar2 < 0x3fff) { return 0; } if ((int)uStack_1c < 0) { if (uVar2 < 0x401e) { return (uStack_1c >> (0x3eU - (char)uVar2 & 0x1f) ^ uVar1) + (uint)((short)uStack_18 < 0); } if (((uVar2 < 0x401f) && ((int)uVar1 < 0)) && (uStack_1c == 0x80000000)) { return -0x80000000; } } return -0x80000000; } //@@ 00af0800 FUN_00af0800 longlong FUN_00af0800(void) { uint uVar1; uint uVar2; byte bVar3; ushort uVar4; uint uVar5; bool bVar6; float10 in_ST0; undefined8 uStack_20; ushort uStack_18; if (1 < __isa_available) { return (longlong)in_ST0; } uStack_20._0_4_ = SUB104(in_ST0,0); uVar2 = (uint)uStack_20; uStack_20._4_4_ = (uint)((unkuint10)in_ST0 >> 0x20); uVar1 = uStack_20._4_4_; uStack_20 = SUB108(in_ST0,0); uStack_18 = (ushort)((unkuint10)in_ST0 >> 0x40); uVar4 = uStack_18 & 0x7fff; if (uVar4 < 0x3fff) { return 0; } if ((int)uVar1 < 0) { if (uVar4 < 0x403e) { bVar3 = 0x3e - (char)uVar4; uVar5 = uVar1; if (0x1f < bVar3) { uVar5 = 0; uVar2 = uVar1; } uVar2 = uVar2 >> (bVar3 & 0x1f) | uVar5 << 0x20 - (bVar3 & 0x1f); uVar5 = uVar5 >> (bVar3 & 0x1f); if ((short)uStack_18 < 0) { bVar6 = uVar2 != 0; uVar2 = -uVar2; uVar5 = -(uVar5 + bVar6); } return CONCAT44(uVar5,uVar2); } if (((uVar4 < 0x403f) && ((uVar1 & 0x7fffffff) == 0 && uVar2 == 0)) && ((short)uStack_18 < 0)) { return uStack_20; } } return -0x8000000000000000; } //@@ 00af081e FUN_00af081e undefined8 FUN_00af081e(void) { uint uVar1; uint uVar2; byte bVar3; ushort uVar4; uint uVar5; bool bVar6; unkbyte10 in_ST0; undefined8 local_20; ushort uStack_18; local_20._0_4_ = (uint)in_ST0; uVar2 = (uint)local_20; local_20._4_4_ = (uint)((unkuint10)in_ST0 >> 0x20); uVar1 = local_20._4_4_; local_20 = (undefined8)in_ST0; uStack_18 = (ushort)((unkuint10)in_ST0 >> 0x40); uVar4 = uStack_18 & 0x7fff; if (uVar4 < 0x3fff) { return 0; } if ((int)uVar1 < 0) { if (uVar4 < 0x403e) { bVar3 = 0x3e - (char)uVar4; uVar5 = uVar1; if (0x1f < bVar3) { uVar5 = 0; uVar2 = uVar1; } uVar2 = uVar2 >> (bVar3 & 0x1f) | uVar5 << 0x20 - (bVar3 & 0x1f); uVar5 = uVar5 >> (bVar3 & 0x1f); if ((short)uStack_18 < 0) { bVar6 = uVar2 != 0; uVar2 = -uVar2; uVar5 = -(uVar5 + bVar6); } return CONCAT44(uVar5,uVar2); } if (((uVar4 < 0x403f) && ((uVar1 & 0x7fffffff) == 0 && uVar2 == 0)) && ((short)uStack_18 < 0)) { return local_20; } } return 0x8000000000000000; } //@@ 00af0920 Unwind@00af0920 void Unwind_00af0920(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10)); return; } //@@ 00af0928 Unwind@00af0928 void Unwind_00af0928(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x18)); return; } //@@ 00af0933 Unwind@00af0933 void Unwind_00af0933(void) { int unaff_EBP; AnimationState::~AnimationState((AnimationState *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00af093e Unwind@00af093e void Unwind_00af093e(void) { int unaff_EBP; AnimationState::~AnimationState((AnimationState *)(*(int *)(unaff_EBP + -0x10) + 0x50)); return; } //@@ 00af0970 Unwind@00af0970 void Unwind_00af0970(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x1c)); return; } //@@ 00af0978 Unwind@00af0978 void Unwind_00af0978(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x1c) + 0x18)); return; } //@@ 00af0983 Unwind@00af0983 void Unwind_00af0983(void) { int unaff_EBP; AnimationState::~AnimationState((AnimationState *)(*(int *)(unaff_EBP + -0x1c) + 0x30)); return; } //@@ 00af098e Unwind@00af098e void Unwind_00af098e(void) { int unaff_EBP; AnimationState::~AnimationState((AnimationState *)(*(int *)(unaff_EBP + -0x1c) + 0x50)); return; } //@@ 00af0999 Unwind@00af0999 void Unwind_00af0999(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x20) * 0xa0; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x24),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00af09c6 Unwind@00af09c6 void Unwind_00af09c6(void) { FUN_0040c440(); return; } //@@ 00af0a70 Unwind@00af0a70 void Unwind_00af0a70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00af0a7b Unwind@00af0a7b void Unwind_00af0a7b(void) { FUN_0040c440(); return; } //@@ 00af0ab0 Unwind@00af0ab0 void Unwind_00af0ab0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x48) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x48) = *(uint *)(unaff_EBP + -0x48) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af0ac9 Unwind@00af0ac9 void Unwind_00af0ac9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x48) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x48) = *(uint *)(unaff_EBP + -0x48) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af0b10 Unwind@00af0b10 void Unwind_00af0b10(void) { FUN_0040c440(); return; } //@@ 00af0ba0 Unwind@00af0ba0 void Unwind_00af0ba0(void) { FUN_0040c440(); return; } //@@ 00af0bab Unwind@00af0bab void Unwind_00af0bab(void) { FUN_0040c440(); return; } //@@ 00af0bb6 Unwind@00af0bb6 void Unwind_00af0bb6(void) { FUN_0040c440(); return; } //@@ 00af0bc1 Unwind@00af0bc1 void Unwind_00af0bc1(void) { FUN_0040c440(); return; } //@@ 00af0bcc Unwind@00af0bcc void Unwind_00af0bcc(void) { FUN_0040c440(); return; } //@@ 00af0bd7 Unwind@00af0bd7 void Unwind_00af0bd7(void) { FUN_0040c440(); return; } //@@ 00af0c20 Unwind@00af0c20 void Unwind_00af0c20(void) { __Init_thread_abort(&DAT_00c7f628); return; } //@@ 00af0c70 Unwind@00af0c70 void Unwind_00af0c70(void) { FUN_0040c440(); return; } //@@ 00af0cb0 Unwind@00af0cb0 void Unwind_00af0cb0(void) { FUN_0040c440(); return; } //@@ 00af0cb8 Unwind@00af0cb8 void Unwind_00af0cb8(void) { FUN_0040c440(); return; } //@@ 00af0d30 Unwind@00af0d30 void Unwind_00af0d30(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x18); return; } //@@ 00af0d70 Unwind@00af0d70 void Unwind_00af0d70(void) { FUN_00a15730(); return; } //@@ 00af0da0 Unwind@00af0da0 void Unwind_00af0da0(void) { FUN_0040d220(); return; } //@@ 00af0e10 Unwind@00af0e10 void Unwind_00af0e10(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x120) * 0xa0; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x124),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00af0e80 Unwind@00af0e80 void Unwind_00af0e80(void) { FUN_0040c440(); return; } //@@ 00af0ed0 Unwind@00af0ed0 void Unwind_00af0ed0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00af0f10 Unwind@00af0f10 void Unwind_00af0f10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x165f0)); return; } //@@ 00af0f1b Unwind@00af0f1b void Unwind_00af0f1b(void) { FUN_00413b40(); return; } //@@ 00af0f26 Unwind@00af0f26 void Unwind_00af0f26(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(unaff_EBP + -0x16a0),0x18,0x40,std::string::_Tidy_deallocate); return; } //@@ 00af0f3c Unwind@00af0f3c void Unwind_00af0f3c(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x24a0),0x38,0x40,FUN_0040db70); return; } //@@ 00af0f52 Unwind@00af0f52 void Unwind_00af0f52(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x16590)); return; } //@@ 00af0f5d Unwind@00af0f5d void Unwind_00af0f5d(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x26644) * 0x38; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x26668),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00af0f90 Unwind@00af0f90 void Unwind_00af0f90(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(unaff_EBP + -0x10a0),0x18,0x40,std::string::_Tidy_deallocate); return; } //@@ 00af0fa6 Unwind@00af0fa6 void Unwind_00af0fa6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x16578)); return; } //@@ 00af0fb1 Unwind@00af0fb1 void Unwind_00af0fb1(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(unaff_EBP + -0x2a0),0x18,0x10,std::string::_Tidy_deallocate); return; } //@@ 00af0fc7 Unwind@00af0fc7 void Unwind_00af0fc7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x16560)); return; } //@@ 00af0fd2 Unwind@00af0fd2 void Unwind_00af0fd2(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(unaff_EBP + -0x164a0),0x13c,0x100,std::string::_Tidy_deallocate); return; } //@@ 00af0fee Unwind@00af0fee void Unwind_00af0fee(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x26668),420000); return; } //@@ 00af1003 Unwind@00af1003 void Unwind_00af1003(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x26644),420000); return; } //@@ 00af1018 Unwind@00af1018 void Unwind_00af1018(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x26644),420000); return; } //@@ 00af102d Unwind@00af102d void Unwind_00af102d(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x26644),420000); return; } //@@ 00af1042 Unwind@00af1042 void Unwind_00af1042(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x26644),540000); return; } //@@ 00af1057 Unwind@00af1057 void Unwind_00af1057(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x26644),540000); return; } //@@ 00af106c Unwind@00af106c void Unwind_00af106c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x165d8)); return; } //@@ 00af1077 Unwind@00af1077 void Unwind_00af1077(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0xaa0),0x10,0x40,guard_check_icall); return; } //@@ 00af108d Unwind@00af108d void Unwind_00af108d(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x26644) * 0x6c; operator_delete(*(void **)(unaff_EBP + -0x26648), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00af10b4 Unwind@00af10b4 void Unwind_00af10b4(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x2663c) * 0x10; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x266b4),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00af10e7 Unwind@00af10e7 void Unwind_00af10e7(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x6a0),0x10,0x40,guard_check_icall); return; } //@@ 00af10fd Unwind@00af10fd void Unwind_00af10fd(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x2663c) * 0x54; operator_delete(*(void **)(unaff_EBP + -0x26648), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00af1124 Unwind@00af1124 void Unwind_00af1124(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x2663c) * 0x10; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x266b0),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00af1157 Unwind@00af1157 void Unwind_00af1157(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x266b0) * 0x13c; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x266b4),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00af11e0 Unwind@00af11e0 void Unwind_00af11e0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffd; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x20)); return; } //@@ 00af1220 Unwind@00af1220 void Unwind_00af1220(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; /* WARNING: Could not recover jumptable at 0x00af1236. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_> ((basic_ios_> *)(*(int *)(unaff_EBP + -0x14) + 0x68)); return; } //@@ 00af123d Unwind@00af123d void Unwind_00af123d(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00af1243. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_iostream_>::~basic_iostream_> ((basic_iostream_> *)(*(int *)(unaff_EBP + -0x14) + 0x20)); return; } //@@ 00af1270 Unwind@00af1270 void Unwind_00af1270(void) { FUN_00415ce0(); return; } //@@ 00af12c0 Unwind@00af12c0 void Unwind_00af12c0(void) { FUN_00414a30(); return; } //@@ 00af1330 Unwind@00af1330 void Unwind_00af1330(void) { FUN_00414620(); return; } //@@ 00af13a0 Unwind@00af13a0 void Unwind_00af13a0(void) { FUN_00415d00(); return; } //@@ 00af13d0 Unwind@00af13d0 void Unwind_00af13d0(void) { thunk_FUN_0041c7d0(); return; } //@@ 00af1400 Unwind@00af1400 void Unwind_00af1400(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x20)); return; } //@@ 00af140b Unwind@00af140b void Unwind_00af140b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00af1416 Unwind@00af1416 void Unwind_00af1416(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x40)); return; } //@@ 00af1421 Unwind@00af1421 void Unwind_00af1421(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x50)); return; } //@@ 00af142c Unwind@00af142c void Unwind_00af142c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x60)); return; } //@@ 00af1437 Unwind@00af1437 void Unwind_00af1437(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x70)); return; } //@@ 00af1442 Unwind@00af1442 void Unwind_00af1442(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x80)); return; } //@@ 00af1450 Unwind@00af1450 void Unwind_00af1450(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(*(int *)(unaff_EBP + -0x10) + 0x90)); return; } //@@ 00af145e Unwind@00af145e void Unwind_00af145e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0xc4)); return; } //@@ 00af146c Unwind@00af146c void Unwind_00af146c(void) { FUN_0040c440(); return; } //@@ 00af147a Unwind@00af147a void Unwind_00af147a(void) { FUN_00417dd0(); return; } //@@ 00af1488 Unwind@00af1488 void Unwind_00af1488(void) { FUN_00417df0(); return; } //@@ 00af1496 Unwind@00af1496 void Unwind_00af1496(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14a5 Unwind@00af14a5 void Unwind_00af14a5(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14b4 Unwind@00af14b4 void Unwind_00af14b4(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14c3 Unwind@00af14c3 void Unwind_00af14c3(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14d2 Unwind@00af14d2 void Unwind_00af14d2(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14e1 Unwind@00af14e1 void Unwind_00af14e1(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14f0 Unwind@00af14f0 void Unwind_00af14f0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af14ff Unwind@00af14ff void Unwind_00af14ff(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x24); return; } //@@ 00af150e Unwind@00af150e void Unwind_00af150e(void) { FUN_0040c440(); return; } //@@ 00af1560 Unwind@00af1560 void Unwind_00af1560(void) { FUN_0041c710(); return; } //@@ 00af1568 Unwind@00af1568 void Unwind_00af1568(void) { FUN_0041c710(); return; } //@@ 00af15a0 Unwind@00af15a0 void Unwind_00af15a0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x30) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x30) = *(uint *)(unaff_EBP + -0x30) & 0xfffffffe; EntityList_Query::~EntityList_Query(*(void **)(unaff_EBP + 8)); return; } //@@ 00af15e0 Unwind@00af15e0 void Unwind_00af15e0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffe; EntityList_Query::~EntityList_Query(*(void **)(unaff_EBP + 8)); return; } //@@ 00af1620 Unwind@00af1620 void Unwind_00af1620(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00af1628 Unwind@00af1628 void Unwind_00af1628(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x28)); return; } //@@ 00af1660 Unwind@00af1660 void Unwind_00af1660(void) { FUN_0041c670(); return; } //@@ 00af16b0 Unwind@00af16b0 void Unwind_00af16b0(void) { FUN_0041d210(); return; } //@@ 00af16e0 Unwind@00af16e0 void Unwind_00af16e0(void) { FUN_0041f860(); return; } //@@ 00af1710 Unwind@00af1710 void Unwind_00af1710(void) { FUN_0040c440(); return; } //@@ 00af1750 Unwind@00af1750 void Unwind_00af1750(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x230)); return; } //@@ 00af175b Unwind@00af175b void Unwind_00af175b(void) { FUN_00420710(); return; } //@@ 00af17a0 Unwind@00af17a0 void Unwind_00af17a0(void) { FUN_00413b40(); return; } //@@ 00af17ab Unwind@00af17ab void Unwind_00af17ab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af17b3 Unwind@00af17b3 void Unwind_00af17b3(void) { FUN_00420b00(); return; } //@@ 00af17f0 Unwind@00af17f0 void Unwind_00af17f0(void) { FUN_00413b40(); return; } //@@ 00af17fb Unwind@00af17fb void Unwind_00af17fb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af1803 Unwind@00af1803 void Unwind_00af1803(void) { __Init_thread_abort(&DAT_00c7f6f0); return; } //@@ 00af1860 Unwind@00af1860 void Unwind_00af1860(void) { FUN_0041d210(); return; } //@@ 00af1868 Unwind@00af1868 void Unwind_00af1868(void) { FUN_0041d210(); return; } //@@ 00af1870 Unwind@00af1870 void Unwind_00af1870(void) { FUN_004238c0(); return; } //@@ 00af18a0 Unwind@00af18a0 void Unwind_00af18a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af18e0 Unwind@00af18e0 void Unwind_00af18e0(void) { FUN_004242b0(); return; } //@@ 00af18e8 Unwind@00af18e8 void Unwind_00af18e8(void) { FUN_004242b0(); return; } //@@ 00af18f0 Unwind@00af18f0 void Unwind_00af18f0(void) { FUN_0041d4b0(); return; } //@@ 00af1920 Unwind@00af1920 void Unwind_00af1920(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10)); return; } //@@ 00af1950 Unwind@00af1950 void Unwind_00af1950(void) { FUN_0040c440(); return; } //@@ 00af1980 Unwind@00af1980 void Unwind_00af1980(void) { FUN_0040c440(); return; } //@@ 00af19b0 Unwind@00af19b0 void Unwind_00af19b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af19b8 Unwind@00af19b8 void Unwind_00af19b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af19f0 Unwind@00af19f0 void Unwind_00af19f0(void) { std::vector::_Tidy(); return; } //@@ 00af1a20 Unwind@00af1a20 void Unwind_00af1a20(void) { FUN_00428880(); return; } //@@ 00af1a50 Unwind@00af1a50 void Unwind_00af1a50(void) { FUN_00923c90(); return; } //@@ 00af1a90 Unwind@00af1a90 void Unwind_00af1a90(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00af1a9c Unwind@00af1a9c void Unwind_00af1a9c(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00af1aa8 Unwind@00af1aa8 void Unwind_00af1aa8(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00af1b20 Unwind@00af1b20 void Unwind_00af1b20(void) { FUN_008ea350(); return; } //@@ 00af1b2b Unwind@00af1b2b void Unwind_00af1b2b(void) { FUN_008ea350(); return; } //@@ 00af1b36 Unwind@00af1b36 void Unwind_00af1b36(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xac)); return; } //@@ 00af1b41 Unwind@00af1b41 void Unwind_00af1b41(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xac)); return; } //@@ 00af1b80 Unwind@00af1b80 void Unwind_00af1b80(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x34); return; } //@@ 00af1b8f Unwind@00af1b8f void Unwind_00af1b8f(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1b9e Unwind@00af1b9e void Unwind_00af1b9e(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1bad Unwind@00af1bad void Unwind_00af1bad(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x34); return; } //@@ 00af1bbc Unwind@00af1bbc void Unwind_00af1bbc(void) { FUN_0042a490(); return; } //@@ 00af1bc4 Unwind@00af1bc4 void Unwind_00af1bc4(void) { FUN_0040c440(); return; } //@@ 00af1bcf Unwind@00af1bcf void Unwind_00af1bcf(void) { FUN_0040c440(); return; } //@@ 00af1bd7 Unwind@00af1bd7 void Unwind_00af1bd7(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1be6 Unwind@00af1be6 void Unwind_00af1be6(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1bf5 Unwind@00af1bf5 void Unwind_00af1bf5(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1c04 Unwind@00af1c04 void Unwind_00af1c04(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1c13 Unwind@00af1c13 void Unwind_00af1c13(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1c22 Unwind@00af1c22 void Unwind_00af1c22(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1c31 Unwind@00af1c31 void Unwind_00af1c31(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2c); return; } //@@ 00af1c70 Unwind@00af1c70 void Unwind_00af1c70(void) { FUN_0042a210(); return; } //@@ 00af1ca0 Unwind@00af1ca0 void Unwind_00af1ca0(void) { FUN_0042a230(); return; } //@@ 00af1cd0 Unwind@00af1cd0 void Unwind_00af1cd0(void) { FUN_0042c780(); return; } //@@ 00af1cdb Unwind@00af1cdb void Unwind_00af1cdb(void) { FUN_0042c780(); return; } //@@ 00af1d10 Unwind@00af1d10 void Unwind_00af1d10(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1c),0x158); return; } //@@ 00af1d50 Unwind@00af1d50 void Unwind_00af1d50(void) { FUN_0041d4b0(); return; } //@@ 00af1d90 Unwind@00af1d90 void Unwind_00af1d90(void) { FUN_004242b0(); return; } //@@ 00af1dc0 Unwind@00af1dc0 void Unwind_00af1dc0(void) { FUN_0042a230(); return; } //@@ 00af1e10 Unwind@00af1e10 void Unwind_00af1e10(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00af1e40 Unwind@00af1e40 void Unwind_00af1e40(void) { FUN_0041d4b0(); return; } //@@ 00af1e70 Unwind@00af1e70 void Unwind_00af1e70(void) { FUN_0042edb0(); return; } //@@ 00af1e78 Unwind@00af1e78 void Unwind_00af1e78(void) { FUN_0042f780(); return; } //@@ 00af1eb0 Unwind@00af1eb0 void Unwind_00af1eb0(void) { thunk_FUN_0042f240(); return; } //@@ 00af1ebb Unwind@00af1ebb void Unwind_00af1ebb(void) { FUN_0042f220(); return; } //@@ 00af1ec6 Unwind@00af1ec6 void Unwind_00af1ec6(void) { std::vector::_Tidy(); return; } //@@ 00af1ed1 Unwind@00af1ed1 void Unwind_00af1ed1(void) { FUN_00415bb0(); return; } //@@ 00af1ed9 Unwind@00af1ed9 void Unwind_00af1ed9(void) { FUN_004164e0(); return; } //@@ 00af1f10 Unwind@00af1f10 void Unwind_00af1f10(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x14)); return; } //@@ 00af1f1b Unwind@00af1f1b void Unwind_00af1f1b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x128)); return; } //@@ 00af1f70 Unwind@00af1f70 void Unwind_00af1f70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af1f78 Unwind@00af1f78 void Unwind_00af1f78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af1fb0 Unwind@00af1fb0 void Unwind_00af1fb0(void) { FUN_0041d4b0(); return; } //@@ 00af1fb8 Unwind@00af1fb8 void Unwind_00af1fb8(void) { FUN_0041d4b0(); return; } //@@ 00af1fc0 Unwind@00af1fc0 void Unwind_00af1fc0(void) { FUN_0041d4b0(); return; } //@@ 00af1ff0 Unwind@00af1ff0 void Unwind_00af1ff0(void) { FUN_00431030(); return; } //@@ 00af1ffb Unwind@00af1ffb void Unwind_00af1ffb(void) { FUN_004b3950(); return; } //@@ 00af2006 Unwind@00af2006 void Unwind_00af2006(void) { thunk_FUN_004b3950(); return; } //@@ 00af2011 Unwind@00af2011 void Unwind_00af2011(void) { FUN_004b3950(); return; } //@@ 00af201c Unwind@00af201c void Unwind_00af201c(void) { thunk_FUN_004b3950(); return; } //@@ 00af2027 Unwind@00af2027 void Unwind_00af2027(void) { FUN_00431050(); return; } //@@ 00af2032 Unwind@00af2032 void Unwind_00af2032(void) { __Init_thread_abort(&DAT_00c7f6fc); return; } //@@ 00af203e Unwind@00af203e void Unwind_00af203e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x428)); return; } //@@ 00af2049 Unwind@00af2049 void Unwind_00af2049(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x440)); return; } //@@ 00af2090 Unwind@00af2090 void Unwind_00af2090(void) { FUN_004b3950(); return; } //@@ 00af2098 Unwind@00af2098 void Unwind_00af2098(void) { thunk_FUN_004b3950(); return; } //@@ 00af20a0 Unwind@00af20a0 void Unwind_00af20a0(void) { FUN_004b3950(); return; } //@@ 00af20d0 Unwind@00af20d0 void Unwind_00af20d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af20d8 Unwind@00af20d8 void Unwind_00af20d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af20e0 Unwind@00af20e0 void Unwind_00af20e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af20e8 Unwind@00af20e8 void Unwind_00af20e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af2120 Unwind@00af2120 void Unwind_00af2120(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x118),0x158); return; } //@@ 00af2135 Unwind@00af2135 void Unwind_00af2135(void) { FUN_00431700(); return; } //@@ 00af2140 Unwind@00af2140 void Unwind_00af2140(void) { FUN_00435740(); return; } //@@ 00af214e Unwind@00af214e void Unwind_00af214e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00af2156 Unwind@00af2156 void Unwind_00af2156(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1bc)); return; } //@@ 00af2190 Unwind@00af2190 void Unwind_00af2190(void) { FUN_00436fb0(); return; } //@@ 00af21d0 Unwind@00af21d0 void Unwind_00af21d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af21d8 Unwind@00af21d8 void Unwind_00af21d8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af21e0 Unwind@00af21e0 void Unwind_00af21e0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af21e8 Unwind@00af21e8 void Unwind_00af21e8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af21f0 Unwind@00af21f0 void Unwind_00af21f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af2230 Unwind@00af2230 void Unwind_00af2230(void) { FUN_0040c440(); return; } //@@ 00af223b Unwind@00af223b void Unwind_00af223b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c4)); return; } //@@ 00af2246 Unwind@00af2246 void Unwind_00af2246(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2b4)); return; } //@@ 00af2251 Unwind@00af2251 void Unwind_00af2251(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x268)); return; } //@@ 00af2290 Unwind@00af2290 void Unwind_00af2290(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af22c0 Unwind@00af22c0 void Unwind_00af22c0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af22f0 Unwind@00af22f0 void Unwind_00af22f0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00af22f8 Unwind@00af22f8 void Unwind_00af22f8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x24)); return; } //@@ 00af2330 Unwind@00af2330 void Unwind_00af2330(void) { FUN_0042a230(); return; } //@@ 00af2360 Unwind@00af2360 void Unwind_00af2360(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xe8)); return; } //@@ 00af236b Unwind@00af236b void Unwind_00af236b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb0)); return; } //@@ 00af2376 Unwind@00af2376 void Unwind_00af2376(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x110)); return; } //@@ 00af23b0 Unwind@00af23b0 void Unwind_00af23b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c)); return; } //@@ 00af2410 Unwind@00af2410 void Unwind_00af2410(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x104)); return; } //@@ 00af2450 Unwind@00af2450 void Unwind_00af2450(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af2480 Unwind@00af2480 void Unwind_00af2480(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af2488 Unwind@00af2488 void Unwind_00af2488(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00af2490 Unwind@00af2490 void Unwind_00af2490(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00af24d0 Unwind@00af24d0 void Unwind_00af24d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af24d8 Unwind@00af24d8 void Unwind_00af24d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2510 Unwind@00af2510 void Unwind_00af2510(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2518 Unwind@00af2518 void Unwind_00af2518(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2550 Unwind@00af2550 void Unwind_00af2550(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af2558 Unwind@00af2558 void Unwind_00af2558(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2560 Unwind@00af2560 void Unwind_00af2560(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2568 Unwind@00af2568 void Unwind_00af2568(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2570 Unwind@00af2570 void Unwind_00af2570(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af25b0 Unwind@00af25b0 void Unwind_00af25b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af25b8 Unwind@00af25b8 void Unwind_00af25b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af25c0 Unwind@00af25c0 void Unwind_00af25c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af25c8 Unwind@00af25c8 void Unwind_00af25c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af2600 Unwind@00af2600 void Unwind_00af2600(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af2608 Unwind@00af2608 void Unwind_00af2608(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2640 Unwind@00af2640 void Unwind_00af2640(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2648 Unwind@00af2648 void Unwind_00af2648(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2650 Unwind@00af2650 void Unwind_00af2650(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2658 Unwind@00af2658 void Unwind_00af2658(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2690 Unwind@00af2690 void Unwind_00af2690(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x184),0x19c); return; } //@@ 00af26e0 Unwind@00af26e0 void Unwind_00af26e0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x90)); return; } //@@ 00af26eb Unwind@00af26eb void Unwind_00af26eb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af2730 Unwind@00af2730 void Unwind_00af2730(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2b4)); return; } //@@ 00af2770 Unwind@00af2770 void Unwind_00af2770(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x60)); return; } //@@ 00af27a0 Unwind@00af27a0 void Unwind_00af27a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1a8)); return; } //@@ 00af27e0 Unwind@00af27e0 void Unwind_00af27e0(void) { std::vector::_Tidy(); return; } //@@ 00af27e8 Unwind@00af27e8 void Unwind_00af27e8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af27f0 Unwind@00af27f0 void Unwind_00af27f0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0xe4),0x19c); return; } //@@ 00af2840 Unwind@00af2840 void Unwind_00af2840(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1ec)); return; } //@@ 00af2880 Unwind@00af2880 void Unwind_00af2880(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x29c)); return; } //@@ 00af288b Unwind@00af288b void Unwind_00af288b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x26c)); return; } //@@ 00af2896 Unwind@00af2896 void Unwind_00af2896(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x27c)); return; } //@@ 00af28d0 Unwind@00af28d0 void Unwind_00af28d0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x130)); return; } //@@ 00af28db Unwind@00af28db void Unwind_00af28db(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x134)); return; } //@@ 00af28e6 Unwind@00af28e6 void Unwind_00af28e6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x148)); return; } //@@ 00af28f1 Unwind@00af28f1 void Unwind_00af28f1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x160)); return; } //@@ 00af2930 Unwind@00af2930 void Unwind_00af2930(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2938 Unwind@00af2938 void Unwind_00af2938(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2940 Unwind@00af2940 void Unwind_00af2940(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2948 Unwind@00af2948 void Unwind_00af2948(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2950 Unwind@00af2950 void Unwind_00af2950(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af2990 Unwind@00af2990 void Unwind_00af2990(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2998 Unwind@00af2998 void Unwind_00af2998(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af29d0 Unwind@00af29d0 void Unwind_00af29d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af29d8 Unwind@00af29d8 void Unwind_00af29d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af2a10 Unwind@00af2a10 void Unwind_00af2a10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2a18 Unwind@00af2a18 void Unwind_00af2a18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2a50 Unwind@00af2a50 void Unwind_00af2a50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af2a58 Unwind@00af2a58 void Unwind_00af2a58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2a90 Unwind@00af2a90 void Unwind_00af2a90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2a98 Unwind@00af2a98 void Unwind_00af2a98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af2aa0 Unwind@00af2aa0 void Unwind_00af2aa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2aa8 Unwind@00af2aa8 void Unwind_00af2aa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af2ae0 Unwind@00af2ae0 void Unwind_00af2ae0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc4)); return; } //@@ 00af2aeb Unwind@00af2aeb void Unwind_00af2aeb(void) { FUN_00498f80(); return; } //@@ 00af2af6 Unwind@00af2af6 void Unwind_00af2af6(void) { FUN_004999b0(); return; } //@@ 00af2b01 Unwind@00af2b01 void Unwind_00af2b01(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x98),0x19c); return; } //@@ 00af2b50 Unwind@00af2b50 void Unwind_00af2b50(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af2b5b Unwind@00af2b5b void Unwind_00af2b5b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af2ba0 Unwind@00af2ba0 void Unwind_00af2ba0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af2ba8 Unwind@00af2ba8 void Unwind_00af2ba8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2bb0 Unwind@00af2bb0 void Unwind_00af2bb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af2bb8 Unwind@00af2bb8 void Unwind_00af2bb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af2c20 Unwind@00af2c20 void Unwind_00af2c20(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x298)); return; } //@@ 00af2c60 Unwind@00af2c60 void Unwind_00af2c60(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0xec),0x19c); return; } //@@ 00af2cb0 Unwind@00af2cb0 void Unwind_00af2cb0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00af2cb8 Unwind@00af2cb8 void Unwind_00af2cb8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00af2cc0 Unwind@00af2cc0 void Unwind_00af2cc0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00af2d00 Unwind@00af2d00 void Unwind_00af2d00(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x134)); return; } //@@ 00af2d40 Unwind@00af2d40 void Unwind_00af2d40(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x15c)); return; } //@@ 00af2d4b Unwind@00af2d4b void Unwind_00af2d4b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x16c)); return; } //@@ 00af2d56 Unwind@00af2d56 void Unwind_00af2d56(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x128)); return; } //@@ 00af2d90 Unwind@00af2d90 void Unwind_00af2d90(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x84)); return; } //@@ 00af2d9b Unwind@00af2d9b void Unwind_00af2d9b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x94)); return; } //@@ 00af2da6 Unwind@00af2da6 void Unwind_00af2da6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa4)); return; } //@@ 00af2de0 Unwind@00af2de0 void Unwind_00af2de0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x80)); return; } //@@ 00af2de8 Unwind@00af2de8 void Unwind_00af2de8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00af2df0 Unwind@00af2df0 void Unwind_00af2df0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x60)); return; } //@@ 00af2df8 Unwind@00af2df8 void Unwind_00af2df8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af2e30 Unwind@00af2e30 void Unwind_00af2e30(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x144)); return; } //@@ 00af2e3b Unwind@00af2e3b void Unwind_00af2e3b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -400)); return; } //@@ 00af2e46 Unwind@00af2e46 void Unwind_00af2e46(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x180)); return; } //@@ 00af2e51 Unwind@00af2e51 void Unwind_00af2e51(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x114)); return; } //@@ 00af2e90 Unwind@00af2e90 void Unwind_00af2e90(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb8)); return; } //@@ 00af2e9b Unwind@00af2e9b void Unwind_00af2e9b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -200)); return; } //@@ 00af2ee0 Unwind@00af2ee0 void Unwind_00af2ee0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x26c)); return; } //@@ 00af2eeb Unwind@00af2eeb void Unwind_00af2eeb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c8)); return; } //@@ 00af2f30 Unwind@00af2f30 void Unwind_00af2f30(void) { std::vector::_Tidy(); return; } //@@ 00af2f70 Unwind@00af2f70 void Unwind_00af2f70(void) { std::vector::_Tidy(); return; } //@@ 00af2f7b Unwind@00af2f7b void Unwind_00af2f7b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xe8)); return; } //@@ 00af2fc0 Unwind@00af2fc0 void Unwind_00af2fc0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x72c)); return; } //@@ 00af3000 Unwind@00af3000 void Unwind_00af3000(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x16c)); return; } //@@ 00af300b Unwind@00af300b void Unwind_00af300b(void) { std::vector::_Tidy(); return; } //@@ 00af3050 Unwind@00af3050 void Unwind_00af3050(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3090 Unwind@00af3090 void Unwind_00af3090(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3098 Unwind@00af3098 void Unwind_00af3098(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af30a0 Unwind@00af30a0 void Unwind_00af30a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af30a8 Unwind@00af30a8 void Unwind_00af30a8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af30e0 Unwind@00af30e0 void Unwind_00af30e0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x8c)); return; } //@@ 00af30eb Unwind@00af30eb void Unwind_00af30eb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x8c)); return; } //@@ 00af30f6 Unwind@00af30f6 void Unwind_00af30f6(void) { thunk_FUN_0041c7d0(); return; } //@@ 00af3101 Unwind@00af3101 void Unwind_00af3101(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x8c)); return; } //@@ 00af310c Unwind@00af310c void Unwind_00af310c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x8c)); return; } //@@ 00af3117 Unwind@00af3117 void Unwind_00af3117(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x8c)); return; } //@@ 00af3122 Unwind@00af3122 void Unwind_00af3122(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af3160 Unwind@00af3160 void Unwind_00af3160(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x154)); return; } //@@ 00af31a0 Unwind@00af31a0 void Unwind_00af31a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x108)); return; } //@@ 00af31e0 Unwind@00af31e0 void Unwind_00af31e0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x154); return; } //@@ 00af31f2 Unwind@00af31f2 void Unwind_00af31f2(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00af3220 Unwind@00af3220 void Unwind_00af3220(void) { std::vector::_Tidy(); return; } //@@ 00af3260 Unwind@00af3260 void Unwind_00af3260(void) { FUN_004b3950(); return; } //@@ 00af32a0 Unwind@00af32a0 void Unwind_00af32a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1d0)); return; } //@@ 00af32e0 Unwind@00af32e0 void Unwind_00af32e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af3320 Unwind@00af3320 void Unwind_00af3320(void) { std::vector::_Tidy(); return; } //@@ 00af3360 Unwind@00af3360 void Unwind_00af3360(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x44)); return; } //@@ 00af3390 Unwind@00af3390 void Unwind_00af3390(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -100)); return; } //@@ 00af3398 Unwind@00af3398 void Unwind_00af3398(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x70)); return; } //@@ 00af33d0 Unwind@00af33d0 void Unwind_00af33d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3410 Unwind@00af3410 void Unwind_00af3410(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x28)); return; } //@@ 00af3440 Unwind@00af3440 void Unwind_00af3440(void) { std::vector::_Tidy(); return; } //@@ 00af3480 Unwind@00af3480 void Unwind_00af3480(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3488 Unwind@00af3488 void Unwind_00af3488(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3490 Unwind@00af3490 void Unwind_00af3490(void) { std::vector::_Tidy(); return; } //@@ 00af34d0 Unwind@00af34d0 void Unwind_00af34d0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3500 Unwind@00af3500 void Unwind_00af3500(void) { std::vector::_Tidy(); return; } //@@ 00af3540 Unwind@00af3540 void Unwind_00af3540(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af3548 Unwind@00af3548 void Unwind_00af3548(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af3580 Unwind@00af3580 void Unwind_00af3580(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af3588 Unwind@00af3588 void Unwind_00af3588(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00af3590 Unwind@00af3590 void Unwind_00af3590(void) { FUN_004bfd20(); return; } //@@ 00af3598 Unwind@00af3598 void Unwind_00af3598(void) { FUN_004bfd20(); return; } //@@ 00af35d0 Unwind@00af35d0 void Unwind_00af35d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2a54)); return; } //@@ 00af35db Unwind@00af35db void Unwind_00af35db(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2ab4)); return; } //@@ 00af35e6 Unwind@00af35e6 void Unwind_00af35e6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2964)); return; } //@@ 00af35f1 Unwind@00af35f1 void Unwind_00af35f1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2950)); return; } //@@ 00af35fc Unwind@00af35fc void Unwind_00af35fc(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2940)); return; } //@@ 00af3607 Unwind@00af3607 void Unwind_00af3607(void) { std::vector::_Tidy(); return; } //@@ 00af3612 Unwind@00af3612 void Unwind_00af3612(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2aa4)); return; } //@@ 00af361d Unwind@00af361d void Unwind_00af361d(void) { std::vector::_Tidy(); return; } //@@ 00af3628 Unwind@00af3628 void Unwind_00af3628(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2a94)); return; } //@@ 00af3670 Unwind@00af3670 void Unwind_00af3670(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x134)); return; } //@@ 00af367b Unwind@00af367b void Unwind_00af367b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x10c)); return; } //@@ 00af3686 Unwind@00af3686 void Unwind_00af3686(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x134)); return; } //@@ 00af36c0 Unwind@00af36c0 void Unwind_00af36c0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x290)); return; } //@@ 00af36cb Unwind@00af36cb void Unwind_00af36cb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c0)); return; } //@@ 00af3710 Unwind@00af3710 void Unwind_00af3710(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x40)); return; } //@@ 00af3740 Unwind@00af3740 void Unwind_00af3740(void) { FUN_00428880(); return; } //@@ 00af3770 Unwind@00af3770 void Unwind_00af3770(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af3778 Unwind@00af3778 void Unwind_00af3778(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af3780 Unwind@00af3780 void Unwind_00af3780(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x78)); return; } //@@ 00af3788 Unwind@00af3788 void Unwind_00af3788(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af3790 Unwind@00af3790 void Unwind_00af3790(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af3798 Unwind@00af3798 void Unwind_00af3798(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x78)); return; } //@@ 00af37a0 Unwind@00af37a0 void Unwind_00af37a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af37a8 Unwind@00af37a8 void Unwind_00af37a8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x88)); return; } //@@ 00af37f0 Unwind@00af37f0 void Unwind_00af37f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af37f8 Unwind@00af37f8 void Unwind_00af37f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3830 Unwind@00af3830 void Unwind_00af3830(void) { FUN_004d71f0(); return; } //@@ 00af38a0 Unwind@00af38a0 void Unwind_00af38a0(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0xd0)); return; } //@@ 00af38ab Unwind@00af38ab void Unwind_00af38ab(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x148)); return; } //@@ 00af3900 Unwind@00af3900 void Unwind_00af3900(void) { FUN_004d76c0(); return; } //@@ 00af3950 Unwind@00af3950 void Unwind_00af3950(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af3990 Unwind@00af3990 void Unwind_00af3990(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af3998 Unwind@00af3998 void Unwind_00af3998(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af39a0 Unwind@00af39a0 void Unwind_00af39a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af39e0 Unwind@00af39e0 void Unwind_00af39e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af39e8 Unwind@00af39e8 void Unwind_00af39e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af39f0 Unwind@00af39f0 void Unwind_00af39f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3a30 Unwind@00af3a30 void Unwind_00af3a30(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c)); return; } //@@ 00af3ac0 Unwind@00af3ac0 void Unwind_00af3ac0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3ac8 Unwind@00af3ac8 void Unwind_00af3ac8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3ad0 Unwind@00af3ad0 void Unwind_00af3ad0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3b10 Unwind@00af3b10 void Unwind_00af3b10(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xbc)); return; } //@@ 00af3b1b Unwind@00af3b1b void Unwind_00af3b1b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af3b26 Unwind@00af3b26 void Unwind_00af3b26(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af3b2e Unwind@00af3b2e void Unwind_00af3b2e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3b36 Unwind@00af3b36 void Unwind_00af3b36(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3b70 Unwind@00af3b70 void Unwind_00af3b70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3b78 Unwind@00af3b78 void Unwind_00af3b78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3b80 Unwind@00af3b80 void Unwind_00af3b80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3b88 Unwind@00af3b88 void Unwind_00af3b88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3bc0 Unwind@00af3bc0 void Unwind_00af3bc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af3bc8 Unwind@00af3bc8 void Unwind_00af3bc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3bd0 Unwind@00af3bd0 void Unwind_00af3bd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3c10 Unwind@00af3c10 void Unwind_00af3c10(void) { FUN_00428880(); return; } //@@ 00af3c40 Unwind@00af3c40 void Unwind_00af3c40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00af3c80 Unwind@00af3c80 void Unwind_00af3c80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af3c88 Unwind@00af3c88 void Unwind_00af3c88(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x60)); return; } //@@ 00af3cc0 Unwind@00af3cc0 void Unwind_00af3cc0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3cc8 Unwind@00af3cc8 void Unwind_00af3cc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3d00 Unwind@00af3d00 void Unwind_00af3d00(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af3d30 Unwind@00af3d30 void Unwind_00af3d30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3d38 Unwind@00af3d38 void Unwind_00af3d38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af3d40 Unwind@00af3d40 void Unwind_00af3d40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af3d48 Unwind@00af3d48 void Unwind_00af3d48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3d80 Unwind@00af3d80 void Unwind_00af3d80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af3d88 Unwind@00af3d88 void Unwind_00af3d88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af3d90 Unwind@00af3d90 void Unwind_00af3d90(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00af3d98 Unwind@00af3d98 void Unwind_00af3d98(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00af3dd0 Unwind@00af3dd0 void Unwind_00af3dd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af3dd8 Unwind@00af3dd8 void Unwind_00af3dd8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3de0 Unwind@00af3de0 void Unwind_00af3de0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3e20 Unwind@00af3e20 void Unwind_00af3e20(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x134)); return; } //@@ 00af3e2b Unwind@00af3e2b void Unwind_00af3e2b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x134)); return; } //@@ 00af3e36 Unwind@00af3e36 void Unwind_00af3e36(void) { FUN_0042c780(); return; } //@@ 00af3e70 Unwind@00af3e70 void Unwind_00af3e70(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af3e78 Unwind@00af3e78 void Unwind_00af3e78(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af3e80 Unwind@00af3e80 void Unwind_00af3e80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af3e88 Unwind@00af3e88 void Unwind_00af3e88(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x150)); return; } //@@ 00af3ed0 Unwind@00af3ed0 void Unwind_00af3ed0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3ed8 Unwind@00af3ed8 void Unwind_00af3ed8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); return; } //@@ 00af3ee0 Unwind@00af3ee0 void Unwind_00af3ee0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3ee8 Unwind@00af3ee8 void Unwind_00af3ee8(void) { FUN_00436fb0(); return; } //@@ 00af3ef3 Unwind@00af3ef3 void Unwind_00af3ef3(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af3efb Unwind@00af3efb void Unwind_00af3efb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af3f03 Unwind@00af3f03 void Unwind_00af3f03(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af3f40 Unwind@00af3f40 void Unwind_00af3f40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af3f80 Unwind@00af3f80 void Unwind_00af3f80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x150)); return; } //@@ 00af3fc0 Unwind@00af3fc0 void Unwind_00af3fc0(void) { FUN_0042a230(); return; } //@@ 00af3fc8 Unwind@00af3fc8 void Unwind_00af3fc8(void) { FUN_0042a230(); return; } //@@ 00af4000 Unwind@00af4000 void Unwind_00af4000(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4008 Unwind@00af4008 void Unwind_00af4008(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4040 Unwind@00af4040 void Unwind_00af4040(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4048 Unwind@00af4048 void Unwind_00af4048(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4080 Unwind@00af4080 void Unwind_00af4080(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af40c0 Unwind@00af40c0 void Unwind_00af40c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af40c8 Unwind@00af40c8 void Unwind_00af40c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af40d0 Unwind@00af40d0 void Unwind_00af40d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af40d8 Unwind@00af40d8 void Unwind_00af40d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af40e0 Unwind@00af40e0 void Unwind_00af40e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af40e8 Unwind@00af40e8 void Unwind_00af40e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4120 Unwind@00af4120 void Unwind_00af4120(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4128 Unwind@00af4128 void Unwind_00af4128(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4130 Unwind@00af4130 void Unwind_00af4130(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4170 Unwind@00af4170 void Unwind_00af4170(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -700)); return; } //@@ 00af41b0 Unwind@00af41b0 void Unwind_00af41b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af41b8 Unwind@00af41b8 void Unwind_00af41b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af41f0 Unwind@00af41f0 void Unwind_00af41f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af41f8 Unwind@00af41f8 void Unwind_00af41f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af4230 Unwind@00af4230 void Unwind_00af4230(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4238 Unwind@00af4238 void Unwind_00af4238(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4270 Unwind@00af4270 void Unwind_00af4270(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4278 Unwind@00af4278 void Unwind_00af4278(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4280 Unwind@00af4280 void Unwind_00af4280(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4288 Unwind@00af4288 void Unwind_00af4288(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af42c0 Unwind@00af42c0 void Unwind_00af42c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af42c8 Unwind@00af42c8 void Unwind_00af42c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4300 Unwind@00af4300 void Unwind_00af4300(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af4308 Unwind@00af4308 void Unwind_00af4308(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4340 Unwind@00af4340 void Unwind_00af4340(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af4380 Unwind@00af4380 void Unwind_00af4380(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4388 Unwind@00af4388 void Unwind_00af4388(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4390 Unwind@00af4390 void Unwind_00af4390(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4398 Unwind@00af4398 void Unwind_00af4398(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af43a0 Unwind@00af43a0 void Unwind_00af43a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af43e0 Unwind@00af43e0 void Unwind_00af43e0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x144) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x144) = *(uint *)(unaff_EBP + -0x144) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af43ff Unwind@00af43ff void Unwind_00af43ff(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x144) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x144) = *(uint *)(unaff_EBP + -0x144) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af441e Unwind@00af441e void Unwind_00af441e(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x144) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x144) = *(uint *)(unaff_EBP + -0x144) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af4470 Unwind@00af4470 void Unwind_00af4470(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4478 Unwind@00af4478 void Unwind_00af4478(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af44b0 Unwind@00af44b0 void Unwind_00af44b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af44b8 Unwind@00af44b8 void Unwind_00af44b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4520 Unwind@00af4520 void Unwind_00af4520(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x100)); return; } //@@ 00af4560 Unwind@00af4560 void Unwind_00af4560(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af45a0 Unwind@00af45a0 void Unwind_00af45a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af45e0 Unwind@00af45e0 void Unwind_00af45e0(void) { std::vector::_Tidy(); return; } //@@ 00af4620 Unwind@00af4620 void Unwind_00af4620(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4660 Unwind@00af4660 void Unwind_00af4660(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xfc)); return; } //@@ 00af46a0 Unwind@00af46a0 void Unwind_00af46a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af46a8 Unwind@00af46a8 void Unwind_00af46a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af46b0 Unwind@00af46b0 void Unwind_00af46b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af46f0 Unwind@00af46f0 void Unwind_00af46f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x54)); return; } //@@ 00af46f8 Unwind@00af46f8 void Unwind_00af46f8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x54)); return; } //@@ 00af4730 Unwind@00af4730 void Unwind_00af4730(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4738 Unwind@00af4738 void Unwind_00af4738(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4770 Unwind@00af4770 void Unwind_00af4770(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af4778 Unwind@00af4778 void Unwind_00af4778(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af47b0 Unwind@00af47b0 void Unwind_00af47b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af47b8 Unwind@00af47b8 void Unwind_00af47b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af47c0 Unwind@00af47c0 void Unwind_00af47c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4800 Unwind@00af4800 void Unwind_00af4800(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00af4830 Unwind@00af4830 void Unwind_00af4830(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1ec)); return; } //@@ 00af4870 Unwind@00af4870 void Unwind_00af4870(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xf8)); return; } //@@ 00af48b0 Unwind@00af48b0 void Unwind_00af48b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af48e0 Unwind@00af48e0 void Unwind_00af48e0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xe8)); return; } //@@ 00af4920 Unwind@00af4920 void Unwind_00af4920(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00af4928 Unwind@00af4928 void Unwind_00af4928(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00af4960 Unwind@00af4960 void Unwind_00af4960(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x80)); return; } //@@ 00af4968 Unwind@00af4968 void Unwind_00af4968(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af49a0 Unwind@00af49a0 void Unwind_00af49a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af49a8 Unwind@00af49a8 void Unwind_00af49a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af49b0 Unwind@00af49b0 void Unwind_00af49b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af49b8 Unwind@00af49b8 void Unwind_00af49b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af49c0 Unwind@00af49c0 void Unwind_00af49c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af49c8 Unwind@00af49c8 void Unwind_00af49c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4a00 Unwind@00af4a00 void Unwind_00af4a00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4a08 Unwind@00af4a08 void Unwind_00af4a08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af4a40 Unwind@00af4a40 void Unwind_00af4a40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af4a48 Unwind@00af4a48 void Unwind_00af4a48(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af4a80 Unwind@00af4a80 void Unwind_00af4a80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x110)); return; } //@@ 00af4a8b Unwind@00af4a8b void Unwind_00af4a8b(void) { std::deque<4byte>::~deque(); return; } //@@ 00af4ad0 Unwind@00af4ad0 void Unwind_00af4ad0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4ad8 Unwind@00af4ad8 void Unwind_00af4ad8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af4ae0 Unwind@00af4ae0 void Unwind_00af4ae0(void) { std::vector::_Tidy(); return; } //@@ 00af4b20 Unwind@00af4b20 void Unwind_00af4b20(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1b4)); return; } //@@ 00af4b60 Unwind@00af4b60 void Unwind_00af4b60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af4b68 Unwind@00af4b68 void Unwind_00af4b68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4b70 Unwind@00af4b70 void Unwind_00af4b70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af4b78 Unwind@00af4b78 void Unwind_00af4b78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4bd0 Unwind@00af4bd0 void Unwind_00af4bd0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x180)); return; } //@@ 00af4c10 Unwind@00af4c10 void Unwind_00af4c10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00af4c18 Unwind@00af4c18 void Unwind_00af4c18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00af4c20 Unwind@00af4c20 void Unwind_00af4c20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00af4c28 Unwind@00af4c28 void Unwind_00af4c28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00af4c30 Unwind@00af4c30 void Unwind_00af4c30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00af4c38 Unwind@00af4c38 void Unwind_00af4c38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00af4c40 Unwind@00af4c40 void Unwind_00af4c40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00af4c48 Unwind@00af4c48 void Unwind_00af4c48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00af4c80 Unwind@00af4c80 void Unwind_00af4c80(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af4c88 Unwind@00af4c88 void Unwind_00af4c88(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af4d20 Unwind@00af4d20 void Unwind_00af4d20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af4d28 Unwind@00af4d28 void Unwind_00af4d28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4d60 Unwind@00af4d60 void Unwind_00af4d60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af4d68 Unwind@00af4d68 void Unwind_00af4d68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4da0 Unwind@00af4da0 void Unwind_00af4da0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af4da8 Unwind@00af4da8 void Unwind_00af4da8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4de0 Unwind@00af4de0 void Unwind_00af4de0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af4e40 Unwind@00af4e40 void Unwind_00af4e40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af4e48 Unwind@00af4e48 void Unwind_00af4e48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4e50 Unwind@00af4e50 void Unwind_00af4e50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af4e58 Unwind@00af4e58 void Unwind_00af4e58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af4e90 Unwind@00af4e90 void Unwind_00af4e90(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x9c)); return; } //@@ 00af4ed0 Unwind@00af4ed0 void Unwind_00af4ed0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4ed8 Unwind@00af4ed8 void Unwind_00af4ed8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af4f10 Unwind@00af4f10 void Unwind_00af4f10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4f18 Unwind@00af4f18 void Unwind_00af4f18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4f20 Unwind@00af4f20 void Unwind_00af4f20(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af4f28 Unwind@00af4f28 void Unwind_00af4f28(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x194)); return; } //@@ 00af4f33 Unwind@00af4f33 void Unwind_00af4f33(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af4f3b Unwind@00af4f3b void Unwind_00af4f3b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4f43 Unwind@00af4f43 void Unwind_00af4f43(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x164)); return; } //@@ 00af4f80 Unwind@00af4f80 void Unwind_00af4f80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af4f88 Unwind@00af4f88 void Unwind_00af4f88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af4f90 Unwind@00af4f90 void Unwind_00af4f90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af4fd0 Unwind@00af4fd0 void Unwind_00af4fd0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af4fd8 Unwind@00af4fd8 void Unwind_00af4fd8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af5010 Unwind@00af5010 void Unwind_00af5010(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -200)); return; } //@@ 00af501b Unwind@00af501b void Unwind_00af501b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00af5060 Unwind@00af5060 void Unwind_00af5060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af50a0 Unwind@00af50a0 void Unwind_00af50a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af50ab Unwind@00af50ab void Unwind_00af50ab(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af50b6 Unwind@00af50b6 void Unwind_00af50b6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af50be Unwind@00af50be void Unwind_00af50be(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x140)); return; } //@@ 00af50c9 Unwind@00af50c9 void Unwind_00af50c9(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af50d4 Unwind@00af50d4 void Unwind_00af50d4(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af50df Unwind@00af50df void Unwind_00af50df(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x140)); return; } //@@ 00af50ea Unwind@00af50ea void Unwind_00af50ea(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af50f5 Unwind@00af50f5 void Unwind_00af50f5(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -300)); return; } //@@ 00af5100 Unwind@00af5100 void Unwind_00af5100(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af5140 Unwind@00af5140 void Unwind_00af5140(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x60),0x158); return; } //@@ 00af5180 Unwind@00af5180 void Unwind_00af5180(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xf4)); return; } //@@ 00af518b Unwind@00af518b void Unwind_00af518b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xf4)); return; } //@@ 00af5196 Unwind@00af5196 void Unwind_00af5196(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xf4)); return; } //@@ 00af51a1 Unwind@00af51a1 void Unwind_00af51a1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xf4)); return; } //@@ 00af51e0 Unwind@00af51e0 void Unwind_00af51e0(void) { FUN_00579700(); return; } //@@ 00af51e8 Unwind@00af51e8 void Unwind_00af51e8(void) { FUN_00579700(); return; } //@@ 00af5220 Unwind@00af5220 void Unwind_00af5220(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xdc)); return; } //@@ 00af5260 Unwind@00af5260 void Unwind_00af5260(void) { std::vector::_Tidy(); return; } //@@ 00af526b Unwind@00af526b void Unwind_00af526b(void) { std::vector::_Tidy(); return; } //@@ 00af52b0 Unwind@00af52b0 void Unwind_00af52b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af52f0 Unwind@00af52f0 void Unwind_00af52f0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x70),0x154); return; } //@@ 00af5340 Unwind@00af5340 void Unwind_00af5340(void) { std::vector::_Tidy(); return; } //@@ 00af5380 Unwind@00af5380 void Unwind_00af5380(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x50)); return; } //@@ 00af53b0 Unwind@00af53b0 void Unwind_00af53b0(void) { std::vector::_Tidy(); return; } //@@ 00af53bb Unwind@00af53bb void Unwind_00af53bb(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xb8)); return; } //@@ 00af53c6 Unwind@00af53c6 void Unwind_00af53c6(void) { std::vector::_Tidy(); return; } //@@ 00af53d1 Unwind@00af53d1 void Unwind_00af53d1(void) { FUN_0040c440(); return; } //@@ 00af5410 Unwind@00af5410 void Unwind_00af5410(void) { std::vector::_Tidy(); return; } //@@ 00af5480 Unwind@00af5480 void Unwind_00af5480(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0xf4),0x158); return; } //@@ 00af54d0 Unwind@00af54d0 void Unwind_00af54d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x60)); return; } //@@ 00af54d8 Unwind@00af54d8 void Unwind_00af54d8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af5510 Unwind@00af5510 void Unwind_00af5510(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x16c)); return; } //@@ 00af551b Unwind@00af551b void Unwind_00af551b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x16c)); return; } //@@ 00af5560 Unwind@00af5560 void Unwind_00af5560(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af55a0 Unwind@00af55a0 void Unwind_00af55a0(void) { std::vector::_Tidy(); return; } //@@ 00af55e0 Unwind@00af55e0 void Unwind_00af55e0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0xec),0x2f00); return; } //@@ 00af55f5 Unwind@00af55f5 void Unwind_00af55f5(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x138)); return; } //@@ 00af5600 Unwind@00af5600 void Unwind_00af5600(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x120)); return; } //@@ 00af560b Unwind@00af560b void Unwind_00af560b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x138)); return; } //@@ 00af5650 Unwind@00af5650 void Unwind_00af5650(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x128)); return; } //@@ 00af565b Unwind@00af565b void Unwind_00af565b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x114)); return; } //@@ 00af56a0 Unwind@00af56a0 void Unwind_00af56a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x200)); return; } //@@ 00af56ab Unwind@00af56ab void Unwind_00af56ab(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x200)); return; } //@@ 00af56b6 Unwind@00af56b6 void Unwind_00af56b6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x200)); return; } //@@ 00af56f0 Unwind@00af56f0 void Unwind_00af56f0(void) { std::vector::_Tidy(); return; } //@@ 00af5730 Unwind@00af5730 void Unwind_00af5730(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x218)); return; } //@@ 00af5770 Unwind@00af5770 void Unwind_00af5770(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af57b0 Unwind@00af57b0 void Unwind_00af57b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + 0xc)); return; } //@@ 00af57f0 Unwind@00af57f0 void Unwind_00af57f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa0)); return; } //@@ 00af57fb Unwind@00af57fb void Unwind_00af57fb(void) { std::vector::_Tidy(); return; } //@@ 00af5840 Unwind@00af5840 void Unwind_00af5840(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1e4)); return; } //@@ 00af584b Unwind@00af584b void Unwind_00af584b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x214)); return; } //@@ 00af5856 Unwind@00af5856 void Unwind_00af5856(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x224)); return; } //@@ 00af5861 Unwind@00af5861 void Unwind_00af5861(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x204)); return; } //@@ 00af586c Unwind@00af586c void Unwind_00af586c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -500)); return; } //@@ 00af5877 Unwind@00af5877 void Unwind_00af5877(void) { std::vector::_Tidy(); return; } //@@ 00af5882 Unwind@00af5882 void Unwind_00af5882(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1bc)); return; } //@@ 00af588d Unwind@00af588d void Unwind_00af588d(void) { std::vector::_Tidy(); return; } //@@ 00af58d0 Unwind@00af58d0 void Unwind_00af58d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd4)); return; } //@@ 00af58db Unwind@00af58db void Unwind_00af58db(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc4)); return; } //@@ 00af58e6 Unwind@00af58e6 void Unwind_00af58e6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc4)); return; } //@@ 00af5920 Unwind@00af5920 void Unwind_00af5920(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x98)); return; } //@@ 00af592b Unwind@00af592b void Unwind_00af592b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x88)); return; } //@@ 00af5970 Unwind@00af5970 void Unwind_00af5970(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00af59a0 Unwind@00af59a0 void Unwind_00af59a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af59a8 Unwind@00af59a8 void Unwind_00af59a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af59b0 Unwind@00af59b0 void Unwind_00af59b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af59b8 Unwind@00af59b8 void Unwind_00af59b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af59c0 Unwind@00af59c0 void Unwind_00af59c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af5a00 Unwind@00af5a00 void Unwind_00af5a00(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x6c)); return; } //@@ 00af5a40 Unwind@00af5a40 void Unwind_00af5a40(void) { std::vector::_Tidy(); return; } //@@ 00af5a4b Unwind@00af5a4b void Unwind_00af5a4b(void) { std::vector::_Tidy(); return; } //@@ 00af5a56 Unwind@00af5a56 void Unwind_00af5a56(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x9b0)); return; } //@@ 00af5a61 Unwind@00af5a61 void Unwind_00af5a61(void) { guard_check_icall(); return; } //@@ 00af5a6c Unwind@00af5a6c void Unwind_00af5a6c(void) { guard_check_icall(); return; } //@@ 00af5a77 Unwind@00af5a77 void Unwind_00af5a77(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x284)); return; } //@@ 00af5a82 Unwind@00af5a82 void Unwind_00af5a82(void) { guard_check_icall(); return; } //@@ 00af5a8d Unwind@00af5a8d void Unwind_00af5a8d(void) { FUN_00424420(); return; } //@@ 00af5a98 Unwind@00af5a98 void Unwind_00af5a98(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x6f8)); return; } //@@ 00af5aa3 Unwind@00af5aa3 void Unwind_00af5aa3(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb5c)); return; } //@@ 00af5aae Unwind@00af5aae void Unwind_00af5aae(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x5dc) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x5dc) = *(uint *)(unaff_EBP + -0x5dc) & 0xfffffffe; guard_check_icall(); return; } //@@ 00af5ad0 Unwind@00af5ad0 void Unwind_00af5ad0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb8c)); return; } //@@ 00af5adb Unwind@00af5adb void Unwind_00af5adb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xabc)); return; } //@@ 00af5ae6 Unwind@00af5ae6 void Unwind_00af5ae6(void) { guard_check_icall(); return; } //@@ 00af5af1 Unwind@00af5af1 void Unwind_00af5af1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x29c)); return; } //@@ 00af5afc Unwind@00af5afc void Unwind_00af5afc(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xacc)); return; } //@@ 00af5b07 Unwind@00af5b07 void Unwind_00af5b07(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xadc)); return; } //@@ 00af5b12 Unwind@00af5b12 void Unwind_00af5b12(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xaec)); return; } //@@ 00af5b1d Unwind@00af5b1d void Unwind_00af5b1d(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x9cc)); return; } //@@ 00af5b28 Unwind@00af5b28 void Unwind_00af5b28(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x8b0)); return; } //@@ 00af5b33 Unwind@00af5b33 void Unwind_00af5b33(void) { std::vector::_Tidy(); return; } //@@ 00af5b3e Unwind@00af5b3e void Unwind_00af5b3e(void) { FUN_0042c780(); return; } //@@ 00af5b49 Unwind@00af5b49 void Unwind_00af5b49(void) { FUN_00436fb0(); return; } //@@ 00af5b54 Unwind@00af5b54 void Unwind_00af5b54(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb0c)); return; } //@@ 00af5b5f Unwind@00af5b5f void Unwind_00af5b5f(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xafc)); return; } //@@ 00af5b6a Unwind@00af5b6a void Unwind_00af5b6a(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb1c)); return; } //@@ 00af5b75 Unwind@00af5b75 void Unwind_00af5b75(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb2c)); return; } //@@ 00af5b80 Unwind@00af5b80 void Unwind_00af5b80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x908)); return; } //@@ 00af5b8b Unwind@00af5b8b void Unwind_00af5b8b(void) { guard_check_icall(); return; } //@@ 00af5b96 Unwind@00af5b96 void Unwind_00af5b96(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa6c)); return; } //@@ 00af5ba1 Unwind@00af5ba1 void Unwind_00af5ba1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa7c)); return; } //@@ 00af5bac Unwind@00af5bac void Unwind_00af5bac(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa8c)); return; } //@@ 00af5bb7 Unwind@00af5bb7 void Unwind_00af5bb7(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x75c)); return; } //@@ 00af5bc2 Unwind@00af5bc2 void Unwind_00af5bc2(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb4c)); return; } //@@ 00af5bcd Unwind@00af5bcd void Unwind_00af5bcd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x26c)); return; } //@@ 00af5bd8 Unwind@00af5bd8 void Unwind_00af5bd8(void) { guard_check_icall(); return; } //@@ 00af5be3 Unwind@00af5be3 void Unwind_00af5be3(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x750)); return; } //@@ 00af5bee Unwind@00af5bee void Unwind_00af5bee(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x8bc)); return; } //@@ 00af5bf9 Unwind@00af5bf9 void Unwind_00af5bf9(void) { guard_check_icall(); return; } //@@ 00af5c04 Unwind@00af5c04 void Unwind_00af5c04(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa9c)); return; } //@@ 00af5c0f Unwind@00af5c0f void Unwind_00af5c0f(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x778)); return; } //@@ 00af5c1a Unwind@00af5c1a void Unwind_00af5c1a(void) { guard_check_icall(); return; } //@@ 00af5c25 Unwind@00af5c25 void Unwind_00af5c25(void) { FUN_00436fb0(); return; } //@@ 00af5c30 Unwind@00af5c30 void Unwind_00af5c30(void) { guard_check_icall(); return; } //@@ 00af5c3b Unwind@00af5c3b void Unwind_00af5c3b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x788)); return; } //@@ 00af5c46 Unwind@00af5c46 void Unwind_00af5c46(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x744)); return; } //@@ 00af5c51 Unwind@00af5c51 void Unwind_00af5c51(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x8c8)); return; } //@@ 00af5c5c Unwind@00af5c5c void Unwind_00af5c5c(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x1808)); return; } //@@ 00af5c67 Unwind@00af5c67 void Unwind_00af5c67(void) { FUN_00436fb0(); return; } //@@ 00af5c72 Unwind@00af5c72 void Unwind_00af5c72(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x8d4)); return; } //@@ 00af5c7d Unwind@00af5c7d void Unwind_00af5c7d(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x6ec)); return; } //@@ 00af5c88 Unwind@00af5c88 void Unwind_00af5c88(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb3c)); return; } //@@ 00af5c93 Unwind@00af5c93 void Unwind_00af5c93(void) { std::deque<4byte>::~deque(); return; } //@@ 00af5c9e Unwind@00af5c9e void Unwind_00af5c9e(void) { guard_check_icall(); return; } //@@ 00af5ca9 Unwind@00af5ca9 void Unwind_00af5ca9(void) { std::vector::_Tidy(); return; } //@@ 00af5cb4 Unwind@00af5cb4 void Unwind_00af5cb4(void) { guard_check_icall(); return; } //@@ 00af5cbf Unwind@00af5cbf void Unwind_00af5cbf(void) { guard_check_icall(); return; } //@@ 00af5cca Unwind@00af5cca void Unwind_00af5cca(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x9bc)); return; } //@@ 00af5cd5 Unwind@00af5cd5 void Unwind_00af5cd5(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x8e0)); return; } //@@ 00af5ce0 Unwind@00af5ce0 void Unwind_00af5ce0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xaac)); return; } //@@ 00af5ceb Unwind@00af5ceb void Unwind_00af5ceb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb6c)); return; } //@@ 00af5cf6 Unwind@00af5cf6 void Unwind_00af5cf6(void) { std::vector::_Tidy(); return; } //@@ 00af5d01 Unwind@00af5d01 void Unwind_00af5d01(void) { std::vector::_Tidy(); return; } //@@ 00af5d0c Unwind@00af5d0c void Unwind_00af5d0c(void) { std::vector::_Tidy(); return; } //@@ 00af5d17 Unwind@00af5d17 void Unwind_00af5d17(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x6a4)); return; } //@@ 00af5d22 Unwind@00af5d22 void Unwind_00af5d22(void) { FUN_00436fb0(); return; } //@@ 00af5d2d Unwind@00af5d2d void Unwind_00af5d2d(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb9c)); return; } //@@ 00af5d38 Unwind@00af5d38 void Unwind_00af5d38(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb7c)); return; } //@@ 00af5d43 Unwind@00af5d43 void Unwind_00af5d43(void) { int unaff_EBP; ANM2::~ANM2(*(ANM2 **)(unaff_EBP + -0x5f4)); return; } //@@ 00af5d80 Unwind@00af5d80 void Unwind_00af5d80(void) { std::vector::_Tidy(); return; } //@@ 00af5db0 Unwind@00af5db0 void Unwind_00af5db0(void) { FUN_004b3950(); return; } //@@ 00af5db8 Unwind@00af5db8 void Unwind_00af5db8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x58)); return; } //@@ 00af5dc0 Unwind@00af5dc0 void Unwind_00af5dc0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00af5e10 Unwind@00af5e10 void Unwind_00af5e10(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c)); return; } //@@ 00af5e80 Unwind@00af5e80 void Unwind_00af5e80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x28)); return; } //@@ 00af5eb0 Unwind@00af5eb0 void Unwind_00af5eb0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x80)); return; } //@@ 00af5eb8 Unwind@00af5eb8 void Unwind_00af5eb8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00af5f10 Unwind@00af5f10 void Unwind_00af5f10(void) { FUN_005cc6a0(); return; } //@@ 00af5f18 Unwind@00af5f18 void Unwind_00af5f18(void) { FUN_0042a210(); return; } //@@ 00af5f20 Unwind@00af5f20 void Unwind_00af5f20(void) { FUN_0042a210(); return; } //@@ 00af5f70 Unwind@00af5f70 void Unwind_00af5f70(void) { FUN_0042a230(); return; } //@@ 00af5fa0 Unwind@00af5fa0 void Unwind_00af5fa0(void) { FUN_0042a230(); return; } //@@ 00af5fd0 Unwind@00af5fd0 void Unwind_00af5fd0(void) { FUN_0041d4b0(); return; } //@@ 00af5fd8 Unwind@00af5fd8 void Unwind_00af5fd8(void) { FUN_0041d4b0(); return; } //@@ 00af6010 Unwind@00af6010 void Unwind_00af6010(void) { FUN_005cd520(); return; } //@@ 00af6018 Unwind@00af6018 void Unwind_00af6018(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00af6050 Unwind@00af6050 void Unwind_00af6050(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00af605b Unwind@00af605b void Unwind_00af605b(void) { guard_check_icall(); return; } //@@ 00af6063 Unwind@00af6063 void Unwind_00af6063(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x21c)); return; } //@@ 00af606e Unwind@00af606e void Unwind_00af606e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x234)); return; } //@@ 00af6079 Unwind@00af6079 void Unwind_00af6079(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x24c)); return; } //@@ 00af6084 Unwind@00af6084 void Unwind_00af6084(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x264)); return; } //@@ 00af608f Unwind@00af608f void Unwind_00af608f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x27c)); return; } //@@ 00af609a Unwind@00af609a void Unwind_00af609a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a4)); return; } //@@ 00af60a5 Unwind@00af60a5 void Unwind_00af60a5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1bc)); return; } //@@ 00af60b0 Unwind@00af60b0 void Unwind_00af60b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1d4)); return; } //@@ 00af60bb Unwind@00af60bb void Unwind_00af60bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1ec)); return; } //@@ 00af60c6 Unwind@00af60c6 void Unwind_00af60c6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x204)); return; } //@@ 00af60d1 Unwind@00af60d1 void Unwind_00af60d1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00af60dc Unwind@00af60dc void Unwind_00af60dc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00af60e7 Unwind@00af60e7 void Unwind_00af60e7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00af60f2 Unwind@00af60f2 void Unwind_00af60f2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00af60fa Unwind@00af60fa void Unwind_00af60fa(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00af6102 Unwind@00af6102 void Unwind_00af6102(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00af610a Unwind@00af610a void Unwind_00af610a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af6112 Unwind@00af6112 void Unwind_00af6112(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x2b8),300); return; } //@@ 00af6127 Unwind@00af6127 void Unwind_00af6127(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af612f Unwind@00af612f void Unwind_00af612f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af6137 Unwind@00af6137 void Unwind_00af6137(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af613f Unwind@00af613f void Unwind_00af613f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af6147 Unwind@00af6147 void Unwind_00af6147(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x2b8),0x18); return; } //@@ 00af6159 Unwind@00af6159 void Unwind_00af6159(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2ec)); return; } //@@ 00af6164 Unwind@00af6164 void Unwind_00af6164(void) { guard_check_icall(); return; } //@@ 00af616c Unwind@00af616c void Unwind_00af616c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00af6174 Unwind@00af6174 void Unwind_00af6174(void) { guard_check_icall(); return; } //@@ 00af617c Unwind@00af617c void Unwind_00af617c(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x2b8),0x458); return; } //@@ 00af6191 Unwind@00af6191 void Unwind_00af6191(void) { __Init_thread_abort(&DAT_00c7fb40); return; } //@@ 00af61d0 Unwind@00af61d0 void Unwind_00af61d0(void) { FUN_005cd520(); return; } //@@ 00af6200 Unwind@00af6200 void Unwind_00af6200(void) { FUN_005cd520(); return; } //@@ 00af6260 Unwind@00af6260 void Unwind_00af6260(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af626b Unwind@00af626b void Unwind_00af626b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x49cc)); return; } //@@ 00af6276 Unwind@00af6276 void Unwind_00af6276(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x49dc)); return; } //@@ 00af6281 Unwind@00af6281 void Unwind_00af6281(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x49ec)); return; } //@@ 00af628c Unwind@00af628c void Unwind_00af628c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x49fc)); return; } //@@ 00af6297 Unwind@00af6297 void Unwind_00af6297(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x118)); return; } //@@ 00af62a2 Unwind@00af62a2 void Unwind_00af62a2(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a0c)); return; } //@@ 00af62ad Unwind@00af62ad void Unwind_00af62ad(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x48fc)); return; } //@@ 00af62b8 Unwind@00af62b8 void Unwind_00af62b8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a1c)); return; } //@@ 00af62c3 Unwind@00af62c3 void Unwind_00af62c3(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4e60)); return; } //@@ 00af62ce Unwind@00af62ce void Unwind_00af62ce(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x19cc),0x18); return; } //@@ 00af62e0 Unwind@00af62e0 void Unwind_00af62e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af62eb Unwind@00af62eb void Unwind_00af62eb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a3c)); return; } //@@ 00af62f6 Unwind@00af62f6 void Unwind_00af62f6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a2c)); return; } //@@ 00af6301 Unwind@00af6301 void Unwind_00af6301(void) { guard_check_icall(); return; } //@@ 00af630c Unwind@00af630c void Unwind_00af630c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a4c)); return; } //@@ 00af6317 Unwind@00af6317 void Unwind_00af6317(void) { guard_check_icall(); return; } //@@ 00af631f Unwind@00af631f void Unwind_00af631f(void) { std::vector::_Tidy(); return; } //@@ 00af632a Unwind@00af632a void Unwind_00af632a(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a60)); return; } //@@ 00af6335 Unwind@00af6335 void Unwind_00af6335(void) { __Init_thread_abort(&DAT_00c7fb70); return; } //@@ 00af6341 Unwind@00af6341 void Unwind_00af6341(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a70)); return; } //@@ 00af634c Unwind@00af634c void Unwind_00af634c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a80)); return; } //@@ 00af6357 Unwind@00af6357 void Unwind_00af6357(void) { guard_check_icall(); return; } //@@ 00af635f Unwind@00af635f void Unwind_00af635f(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4d3c)); return; } //@@ 00af636a Unwind@00af636a void Unwind_00af636a(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4a94)); return; } //@@ 00af6375 Unwind@00af6375 void Unwind_00af6375(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4aa4)); return; } //@@ 00af6380 Unwind@00af6380 void Unwind_00af6380(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4ab4)); return; } //@@ 00af638b Unwind@00af638b void Unwind_00af638b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x490c)); return; } //@@ 00af6396 Unwind@00af6396 void Unwind_00af6396(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x491c)); return; } //@@ 00af63a1 Unwind@00af63a1 void Unwind_00af63a1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4ac4)); return; } //@@ 00af63ac Unwind@00af63ac void Unwind_00af63ac(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x492c)); return; } //@@ 00af63b7 Unwind@00af63b7 void Unwind_00af63b7(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x493c)); return; } //@@ 00af63c2 Unwind@00af63c2 void Unwind_00af63c2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3f8)); return; } //@@ 00af63cd Unwind@00af63cd void Unwind_00af63cd(void) { guard_check_icall(); return; } //@@ 00af63d5 Unwind@00af63d5 void Unwind_00af63d5(void) { __Init_thread_abort(&DAT_00c7fbc8); return; } //@@ 00af63e1 Unwind@00af63e1 void Unwind_00af63e1(void) { __Init_thread_abort(&DAT_00c7fbf8); return; } //@@ 00af63ed Unwind@00af63ed void Unwind_00af63ed(void) { guard_check_icall(); return; } //@@ 00af63f5 Unwind@00af63f5 void Unwind_00af63f5(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x494c)); return; } //@@ 00af6400 Unwind@00af6400 void Unwind_00af6400(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x495c)); return; } //@@ 00af640b Unwind@00af640b void Unwind_00af640b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x496c)); return; } //@@ 00af6416 Unwind@00af6416 void Unwind_00af6416(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4ad8)); return; } //@@ 00af6421 Unwind@00af6421 void Unwind_00af6421(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x497c)); return; } //@@ 00af642c Unwind@00af642c void Unwind_00af642c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b08)); return; } //@@ 00af6437 Unwind@00af6437 void Unwind_00af6437(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4af8)); return; } //@@ 00af6442 Unwind@00af6442 void Unwind_00af6442(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4ae8)); return; } //@@ 00af644d Unwind@00af644d void Unwind_00af644d(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b18)); return; } //@@ 00af6458 Unwind@00af6458 void Unwind_00af6458(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x498c)); return; } //@@ 00af6463 Unwind@00af6463 void Unwind_00af6463(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x499c)); return; } //@@ 00af646e Unwind@00af646e void Unwind_00af646e(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x48dc)); return; } //@@ 00af6479 Unwind@00af6479 void Unwind_00af6479(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b48)); return; } //@@ 00af6484 Unwind@00af6484 void Unwind_00af6484(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b38)); return; } //@@ 00af648f Unwind@00af648f void Unwind_00af648f(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b28)); return; } //@@ 00af649a Unwind@00af649a void Unwind_00af649a(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x48ec)); return; } //@@ 00af64a5 Unwind@00af64a5 void Unwind_00af64a5(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b58)); return; } //@@ 00af64b0 Unwind@00af64b0 void Unwind_00af64b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b78)); return; } //@@ 00af64bb Unwind@00af64bb void Unwind_00af64bb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b68)); return; } //@@ 00af64c6 Unwind@00af64c6 void Unwind_00af64c6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b88)); return; } //@@ 00af64d1 Unwind@00af64d1 void Unwind_00af64d1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4618)); return; } //@@ 00af64dc Unwind@00af64dc void Unwind_00af64dc(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4b98)); return; } //@@ 00af64e7 Unwind@00af64e7 void Unwind_00af64e7(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4ba8)); return; } //@@ 00af64f2 Unwind@00af64f2 void Unwind_00af64f2(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4bb8)); return; } //@@ 00af64fd Unwind@00af64fd void Unwind_00af64fd(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1b08)); return; } //@@ 00af6508 Unwind@00af6508 void Unwind_00af6508(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1294) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1294) = *(uint *)(unaff_EBP + -0x1294) & 0xfffffffe; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x6250)); return; } //@@ 00af652a Unwind@00af652a void Unwind_00af652a(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4628)); return; } //@@ 00af6535 Unwind@00af6535 void Unwind_00af6535(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4784)); return; } //@@ 00af6540 Unwind@00af6540 void Unwind_00af6540(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x47b0)); return; } //@@ 00af654b Unwind@00af654b void Unwind_00af654b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4bc8)); return; } //@@ 00af6556 Unwind@00af6556 void Unwind_00af6556(void) { __Init_thread_abort(&DAT_00c7fc28); return; } //@@ 00af6562 Unwind@00af6562 void Unwind_00af6562(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af656d Unwind@00af656d void Unwind_00af656d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00af6578 Unwind@00af6578 void Unwind_00af6578(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af6583 Unwind@00af6583 void Unwind_00af6583(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4794)); return; } //@@ 00af658e Unwind@00af658e void Unwind_00af658e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00af6599 Unwind@00af6599 void Unwind_00af6599(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c1c)); return; } //@@ 00af65a4 Unwind@00af65a4 void Unwind_00af65a4(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4be0)); return; } //@@ 00af65e0 Unwind@00af65e0 void Unwind_00af65e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af65e8 Unwind@00af65e8 void Unwind_00af65e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af65f0 Unwind@00af65f0 void Unwind_00af65f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00af65f8 Unwind@00af65f8 void Unwind_00af65f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af6630 Unwind@00af6630 void Unwind_00af6630(void) { FUN_0060c350(); return; } //@@ 00af6638 Unwind@00af6638 void Unwind_00af6638(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af6640 Unwind@00af6640 void Unwind_00af6640(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af6648 Unwind@00af6648 void Unwind_00af6648(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af6680 Unwind@00af6680 void Unwind_00af6680(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x18); return; } //@@ 00af66c0 Unwind@00af66c0 void Unwind_00af66c0(void) { FUN_0060cc00(); return; } //@@ 00af66c8 Unwind@00af66c8 void Unwind_00af66c8(void) { FUN_0060cc00(); return; } //@@ 00af6700 Unwind@00af6700 void Unwind_00af6700(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x10)); return; } //@@ 00af6708 Unwind@00af6708 void Unwind_00af6708(void) { FUN_007e3230(); return; } //@@ 00af6716 Unwind@00af6716 void Unwind_00af6716(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0xdac)); return; } //@@ 00af6724 Unwind@00af6724 void Unwind_00af6724(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0xdcc)); return; } //@@ 00af6732 Unwind@00af6732 void Unwind_00af6732(void) { FUN_006519b0(); return; } //@@ 00af6740 Unwind@00af6740 void Unwind_00af6740(void) { FUN_00579700(); return; } //@@ 00af67b0 Unwind@00af67b0 void Unwind_00af67b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af67b8 Unwind@00af67b8 void Unwind_00af67b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af67c0 Unwind@00af67c0 void Unwind_00af67c0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00af67c8 Unwind@00af67c8 void Unwind_00af67c8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00af67d0 Unwind@00af67d0 void Unwind_00af67d0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x104),0x58); return; } //@@ 00af67e2 Unwind@00af67e2 void Unwind_00af67e2(void) { FUN_00431700(); return; } //@@ 00af67ed Unwind@00af67ed void Unwind_00af67ed(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af67f5 Unwind@00af67f5 void Unwind_00af67f5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af67fd Unwind@00af67fd void Unwind_00af67fd(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x104),0x578); return; } //@@ 00af6812 Unwind@00af6812 void Unwind_00af6812(void) { FUN_00431700(); return; } //@@ 00af681d Unwind@00af681d void Unwind_00af681d(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x104) + 4)); return; } //@@ 00af682b Unwind@00af682b void Unwind_00af682b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af6833 Unwind@00af6833 void Unwind_00af6833(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af683b Unwind@00af683b void Unwind_00af683b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af6843 Unwind@00af6843 void Unwind_00af6843(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb4)); return; } //@@ 00af684e Unwind@00af684e void Unwind_00af684e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af6859 Unwind@00af6859 void Unwind_00af6859(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xcc)); return; } //@@ 00af6864 Unwind@00af6864 void Unwind_00af6864(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af686c Unwind@00af686c void Unwind_00af686c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af68b0 Unwind@00af68b0 void Unwind_00af68b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x168)); return; } //@@ 00af68bb Unwind@00af68bb void Unwind_00af68bb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1a8)); return; } //@@ 00af68c6 Unwind@00af68c6 void Unwind_00af68c6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x178)); return; } //@@ 00af68d1 Unwind@00af68d1 void Unwind_00af68d1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x198)); return; } //@@ 00af6930 Unwind@00af6930 void Unwind_00af6930(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x40)); return; } //@@ 00af6938 Unwind@00af6938 void Unwind_00af6938(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00af6970 Unwind@00af6970 void Unwind_00af6970(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af69a0 Unwind@00af69a0 void Unwind_00af69a0(void) { FUN_0040c440(); return; } //@@ 00af69d0 Unwind@00af69d0 void Unwind_00af69d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00af6a00 Unwind@00af6a00 void Unwind_00af6a00(void) { FUN_0040c440(); return; } //@@ 00af6a50 Unwind@00af6a50 void Unwind_00af6a50(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00af6a80 Unwind@00af6a80 void Unwind_00af6a80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x54)); return; } //@@ 00af6a88 Unwind@00af6a88 void Unwind_00af6a88(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af6a90 Unwind@00af6a90 void Unwind_00af6a90(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x54)); return; } //@@ 00af6a98 Unwind@00af6a98 void Unwind_00af6a98(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00af6ad0 Unwind@00af6ad0 void Unwind_00af6ad0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af6b00 Unwind@00af6b00 void Unwind_00af6b00(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00af6b08 Unwind@00af6b08 void Unwind_00af6b08(void) { FUN_0040c440(); return; } //@@ 00af6b40 Unwind@00af6b40 void Unwind_00af6b40(void) { FUN_0040c440(); return; } //@@ 00af6b48 Unwind@00af6b48 void Unwind_00af6b48(void) { FUN_0040c440(); return; } //@@ 00af6b80 Unwind@00af6b80 void Unwind_00af6b80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x7c)); return; } //@@ 00af6b88 Unwind@00af6b88 void Unwind_00af6b88(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x6c)); return; } //@@ 00af6bc0 Unwind@00af6bc0 void Unwind_00af6bc0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x48)); return; } //@@ 00af6bc8 Unwind@00af6bc8 void Unwind_00af6bc8(void) { FUN_00424420(); return; } //@@ 00af6c20 Unwind@00af6c20 void Unwind_00af6c20(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x58)); return; } //@@ 00af6c28 Unwind@00af6c28 void Unwind_00af6c28(void) { guard_check_icall(); return; } //@@ 00af6c30 Unwind@00af6c30 void Unwind_00af6c30(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c38 Unwind@00af6c38 void Unwind_00af6c38(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c40 Unwind@00af6c40 void Unwind_00af6c40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c48 Unwind@00af6c48 void Unwind_00af6c48(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c50 Unwind@00af6c50 void Unwind_00af6c50(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c58 Unwind@00af6c58 void Unwind_00af6c58(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c60 Unwind@00af6c60 void Unwind_00af6c60(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c68 Unwind@00af6c68 void Unwind_00af6c68(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c70 Unwind@00af6c70 void Unwind_00af6c70(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c78 Unwind@00af6c78 void Unwind_00af6c78(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6c80 Unwind@00af6c80 void Unwind_00af6c80(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x194)); return; } //@@ 00af6cc0 Unwind@00af6cc0 void Unwind_00af6cc0(void) { __Init_thread_abort(&DAT_00c7fd10); return; } //@@ 00af6d00 Unwind@00af6d00 void Unwind_00af6d00(void) { FUN_0042a230(); return; } //@@ 00af6d60 Unwind@00af6d60 void Unwind_00af6d60(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af6d68 Unwind@00af6d68 void Unwind_00af6d68(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00af6da0 Unwind@00af6da0 void Unwind_00af6da0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af6dd0 Unwind@00af6dd0 void Unwind_00af6dd0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x54)); return; } //@@ 00af6dd8 Unwind@00af6dd8 void Unwind_00af6dd8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x44)); return; } //@@ 00af6e10 Unwind@00af6e10 void Unwind_00af6e10(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af6e18 Unwind@00af6e18 void Unwind_00af6e18(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x78)); return; } //@@ 00af6e70 Unwind@00af6e70 void Unwind_00af6e70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af6eb0 Unwind@00af6eb0 void Unwind_00af6eb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af6ef0 Unwind@00af6ef0 void Unwind_00af6ef0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa0)); return; } //@@ 00af6f30 Unwind@00af6f30 void Unwind_00af6f30(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); return; } //@@ 00af6f38 Unwind@00af6f38 void Unwind_00af6f38(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00af6f70 Unwind@00af6f70 void Unwind_00af6f70(void) { FUN_00436fb0(); return; } //@@ 00af6f78 Unwind@00af6f78 void Unwind_00af6f78(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00af6fb0 Unwind@00af6fb0 void Unwind_00af6fb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af6fb8 Unwind@00af6fb8 void Unwind_00af6fb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7020 Unwind@00af7020 void Unwind_00af7020(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af7080 Unwind@00af7080 void Unwind_00af7080(void) { FUN_006431b0(); return; } //@@ 00af70d0 Unwind@00af70d0 void Unwind_00af70d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00af7110 Unwind@00af7110 void Unwind_00af7110(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af7118 Unwind@00af7118 void Unwind_00af7118(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00af7150 Unwind@00af7150 void Unwind_00af7150(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00af7158 Unwind@00af7158 void Unwind_00af7158(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af7160 Unwind@00af7160 void Unwind_00af7160(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00af7168 Unwind@00af7168 void Unwind_00af7168(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00af7170 Unwind@00af7170 void Unwind_00af7170(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af71a0 Unwind@00af71a0 void Unwind_00af71a0(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(unaff_EBP + -0x13c)); return; } //@@ 00af71ab Unwind@00af71ab void Unwind_00af71ab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af71b3 Unwind@00af71b3 void Unwind_00af71b3(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(unaff_EBP + -0x13c)); return; } //@@ 00af71be Unwind@00af71be void Unwind_00af71be(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af71c6 Unwind@00af71c6 void Unwind_00af71c6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af71ce Unwind@00af71ce void Unwind_00af71ce(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(unaff_EBP + -0x13c)); return; } //@@ 00af71d9 Unwind@00af71d9 void Unwind_00af71d9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af71e1 Unwind@00af71e1 void Unwind_00af71e1(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(unaff_EBP + -0x13c)); return; } //@@ 00af71ec Unwind@00af71ec void Unwind_00af71ec(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af71f4 Unwind@00af71f4 void Unwind_00af71f4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7230 Unwind@00af7230 void Unwind_00af7230(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00af7270 Unwind@00af7270 void Unwind_00af7270(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00af7278 Unwind@00af7278 void Unwind_00af7278(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00af72b0 Unwind@00af72b0 void Unwind_00af72b0(void) { std::vector::_Tidy(); return; } //@@ 00af72bb Unwind@00af72bb void Unwind_00af72bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00af72c3 Unwind@00af72c3 void Unwind_00af72c3(void) { FUN_0064b6a0(); return; } //@@ 00af72ce Unwind@00af72ce void Unwind_00af72ce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af72d6 Unwind@00af72d6 void Unwind_00af72d6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00af72e1 Unwind@00af72e1 void Unwind_00af72e1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af72e9 Unwind@00af72e9 void Unwind_00af72e9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af72f1 Unwind@00af72f1 void Unwind_00af72f1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00af72fc Unwind@00af72fc void Unwind_00af72fc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00af7307 Unwind@00af7307 void Unwind_00af7307(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af730f Unwind@00af730f void Unwind_00af730f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00af731a Unwind@00af731a void Unwind_00af731a(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xf4) & 0x20) == 0) { return; } *(uint *)(unaff_EBP + -0xf4) = *(uint *)(unaff_EBP + -0xf4) & 0xffffffdf; std::vector::_Tidy(); return; } //@@ 00af733c Unwind@00af733c void Unwind_00af733c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af7344 Unwind@00af7344 void Unwind_00af7344(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af7380 Unwind@00af7380 void Unwind_00af7380(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x54) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x54) = *(uint *)(unaff_EBP + -0x54) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af73d0 Unwind@00af73d0 void Unwind_00af73d0(void) { std::deque<4byte>::~deque(); return; } //@@ 00af7410 Unwind@00af7410 void Unwind_00af7410(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00af7450 Unwind@00af7450 void Unwind_00af7450(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c)); return; } //@@ 00af7480 Unwind@00af7480 void Unwind_00af7480(void) { FUN_0041d210(); return; } //@@ 00af74b0 Unwind@00af74b0 void Unwind_00af74b0(void) { FUN_00652810(); return; } //@@ 00af7500 Unwind@00af7500 void Unwind_00af7500(void) { FUN_00652810(); return; } //@@ 00af7530 Unwind@00af7530 void Unwind_00af7530(void) { FUN_0042a230(); return; } //@@ 00af7560 Unwind@00af7560 void Unwind_00af7560(void) { FUN_00415ce0(); return; } //@@ 00af7590 Unwind@00af7590 void Unwind_00af7590(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af7598 Unwind@00af7598 void Unwind_00af7598(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x444)); return; } //@@ 00af75a3 Unwind@00af75a3 void Unwind_00af75a3(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4e8)); return; } //@@ 00af75ae Unwind@00af75ae void Unwind_00af75ae(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x454)); return; } //@@ 00af75b9 Unwind@00af75b9 void Unwind_00af75b9(void) { guard_check_icall(); return; } //@@ 00af75c4 Unwind@00af75c4 void Unwind_00af75c4(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x358) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x358) = *(uint *)(unaff_EBP + -0x358) & 0xfffffffe; guard_check_icall(); return; } //@@ 00af75e6 Unwind@00af75e6 void Unwind_00af75e6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x454)); return; } //@@ 00af7620 Unwind@00af7620 void Unwind_00af7620(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x10)); return; } //@@ 00af7650 Unwind@00af7650 void Unwind_00af7650(void) { guard_check_icall(); return; } //@@ 00af7658 Unwind@00af7658 void Unwind_00af7658(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af7660 Unwind@00af7660 void Unwind_00af7660(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xd4) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xd4) = *(uint *)(unaff_EBP + -0xd4) & 0xfffffffe; guard_check_icall(); return; } //@@ 00af767f Unwind@00af767f void Unwind_00af767f(void) { guard_check_icall(); return; } //@@ 00af76c0 Unwind@00af76c0 void Unwind_00af76c0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00af76f0 Unwind@00af76f0 void Unwind_00af76f0(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x10)); return; } //@@ 00af76f8 Unwind@00af76f8 void Unwind_00af76f8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x444)); return; } //@@ 00af7706 Unwind@00af7706 void Unwind_00af7706(void) { FUN_00579700(); return; } //@@ 00af7714 Unwind@00af7714 void Unwind_00af7714(void) { FUN_00579700(); return; } //@@ 00af7722 Unwind@00af7722 void Unwind_00af7722(void) { FUN_00579700(); return; } //@@ 00af7730 Unwind@00af7730 void Unwind_00af7730(void) { FUN_00579700(); return; } //@@ 00af773e Unwind@00af773e void Unwind_00af773e(void) { FUN_00579700(); return; } //@@ 00af774c Unwind@00af774c void Unwind_00af774c(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x4ac)); return; } //@@ 00af775a Unwind@00af775a void Unwind_00af775a(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5c0)); return; } //@@ 00af77b0 Unwind@00af77b0 void Unwind_00af77b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af77b8 Unwind@00af77b8 void Unwind_00af77b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af77f0 Unwind@00af77f0 void Unwind_00af77f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc44)); return; } //@@ 00af77fb Unwind@00af77fb void Unwind_00af77fb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd08)); return; } //@@ 00af7806 Unwind@00af7806 void Unwind_00af7806(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd18)); return; } //@@ 00af7811 Unwind@00af7811 void Unwind_00af7811(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc64)); return; } //@@ 00af781c Unwind@00af781c void Unwind_00af781c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc54)); return; } //@@ 00af7827 Unwind@00af7827 void Unwind_00af7827(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xcf8)); return; } //@@ 00af7832 Unwind@00af7832 void Unwind_00af7832(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd28)); return; } //@@ 00af783d Unwind@00af783d void Unwind_00af783d(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd38)); return; } //@@ 00af7848 Unwind@00af7848 void Unwind_00af7848(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xce8)); return; } //@@ 00af7853 Unwind@00af7853 void Unwind_00af7853(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x9d0)); return; } //@@ 00af785e Unwind@00af785e void Unwind_00af785e(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd48)); return; } //@@ 00af7869 Unwind@00af7869 void Unwind_00af7869(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x86c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x86c) = *(uint *)(unaff_EBP + -0x86c) & 0xfffffffe; guard_check_icall(); return; } //@@ 00af7888 Unwind@00af7888 void Unwind_00af7888(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd58)); return; } //@@ 00af7893 Unwind@00af7893 void Unwind_00af7893(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x184)); return; } //@@ 00af789e Unwind@00af789e void Unwind_00af789e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xc70)); return; } //@@ 00af78a9 Unwind@00af78a9 void Unwind_00af78a9(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd68)); return; } //@@ 00af78b4 Unwind@00af78b4 void Unwind_00af78b4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x19c)); return; } //@@ 00af78f0 Unwind@00af78f0 void Unwind_00af78f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x28)); return; } //@@ 00af7930 Unwind@00af7930 void Unwind_00af7930(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af7938 Unwind@00af7938 void Unwind_00af7938(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af7940 Unwind@00af7940 void Unwind_00af7940(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af7948 Unwind@00af7948 void Unwind_00af7948(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00af7950 Unwind@00af7950 void Unwind_00af7950(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af7958 Unwind@00af7958 void Unwind_00af7958(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af7960 Unwind@00af7960 void Unwind_00af7960(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af7968 Unwind@00af7968 void Unwind_00af7968(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00af79a0 Unwind@00af79a0 void Unwind_00af79a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00af79e0 Unwind@00af79e0 void Unwind_00af79e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af79e8 Unwind@00af79e8 void Unwind_00af79e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af7a40 Unwind@00af7a40 void Unwind_00af7a40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc4)); return; } //@@ 00af7a80 Unwind@00af7a80 void Unwind_00af7a80(void) { FUN_00424420(); return; } //@@ 00af7ab0 Unwind@00af7ab0 void Unwind_00af7ab0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7ab8 Unwind@00af7ab8 void Unwind_00af7ab8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7ac0 Unwind@00af7ac0 void Unwind_00af7ac0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7b00 Unwind@00af7b00 void Unwind_00af7b00(void) { FUN_0040d480(); return; } //@@ 00af7b0b Unwind@00af7b0b void Unwind_00af7b0b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af7b50 Unwind@00af7b50 void Unwind_00af7b50(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00af7b90 Unwind@00af7b90 void Unwind_00af7b90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af7b98 Unwind@00af7b98 void Unwind_00af7b98(void) { std::vector::_Tidy(); return; } //@@ 00af7ba0 Unwind@00af7ba0 void Unwind_00af7ba0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af7ba8 Unwind@00af7ba8 void Unwind_00af7ba8(void) { std::vector::_Tidy(); return; } //@@ 00af7bb3 Unwind@00af7bb3 void Unwind_00af7bb3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00af7bbb Unwind@00af7bbb void Unwind_00af7bbb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af7bc3 Unwind@00af7bc3 void Unwind_00af7bc3(void) { FUN_0040d480(); return; } //@@ 00af7c00 Unwind@00af7c00 void Unwind_00af7c00(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x2c)); return; } //@@ 00af7c40 Unwind@00af7c40 void Unwind_00af7c40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7c48 Unwind@00af7c48 void Unwind_00af7c48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7c50 Unwind@00af7c50 void Unwind_00af7c50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7c58 Unwind@00af7c58 void Unwind_00af7c58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7c60 Unwind@00af7c60 void Unwind_00af7c60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7c6b Unwind@00af7c6b void Unwind_00af7c6b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7c76 Unwind@00af7c76 void Unwind_00af7c76(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7c7e Unwind@00af7c7e void Unwind_00af7c7e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7c89 Unwind@00af7c89 void Unwind_00af7c89(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7c94 Unwind@00af7c94 void Unwind_00af7c94(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7c9c Unwind@00af7c9c void Unwind_00af7c9c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7ca4 Unwind@00af7ca4 void Unwind_00af7ca4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7cac Unwind@00af7cac void Unwind_00af7cac(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7cb4 Unwind@00af7cb4 void Unwind_00af7cb4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7cbf Unwind@00af7cbf void Unwind_00af7cbf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7cc7 Unwind@00af7cc7 void Unwind_00af7cc7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7ccf Unwind@00af7ccf void Unwind_00af7ccf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7cd7 Unwind@00af7cd7 void Unwind_00af7cd7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7ce2 Unwind@00af7ce2 void Unwind_00af7ce2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7cea Unwind@00af7cea void Unwind_00af7cea(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7cf5 Unwind@00af7cf5 void Unwind_00af7cf5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7cfd Unwind@00af7cfd void Unwind_00af7cfd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7d05 Unwind@00af7d05 void Unwind_00af7d05(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7d0d Unwind@00af7d0d void Unwind_00af7d0d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7d18 Unwind@00af7d18 void Unwind_00af7d18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7d20 Unwind@00af7d20 void Unwind_00af7d20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7d2b Unwind@00af7d2b void Unwind_00af7d2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7d33 Unwind@00af7d33 void Unwind_00af7d33(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7d3b Unwind@00af7d3b void Unwind_00af7d3b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7d43 Unwind@00af7d43 void Unwind_00af7d43(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7d4e Unwind@00af7d4e void Unwind_00af7d4e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7d56 Unwind@00af7d56 void Unwind_00af7d56(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7d61 Unwind@00af7d61 void Unwind_00af7d61(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7d69 Unwind@00af7d69 void Unwind_00af7d69(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7d71 Unwind@00af7d71 void Unwind_00af7d71(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7d79 Unwind@00af7d79 void Unwind_00af7d79(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7d84 Unwind@00af7d84 void Unwind_00af7d84(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7d8c Unwind@00af7d8c void Unwind_00af7d8c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7d97 Unwind@00af7d97 void Unwind_00af7d97(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7d9f Unwind@00af7d9f void Unwind_00af7d9f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7da7 Unwind@00af7da7 void Unwind_00af7da7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7daf Unwind@00af7daf void Unwind_00af7daf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7dba Unwind@00af7dba void Unwind_00af7dba(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7dc2 Unwind@00af7dc2 void Unwind_00af7dc2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7dcd Unwind@00af7dcd void Unwind_00af7dcd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7dd5 Unwind@00af7dd5 void Unwind_00af7dd5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7ddd Unwind@00af7ddd void Unwind_00af7ddd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7de5 Unwind@00af7de5 void Unwind_00af7de5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7df0 Unwind@00af7df0 void Unwind_00af7df0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7df8 Unwind@00af7df8 void Unwind_00af7df8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7e03 Unwind@00af7e03 void Unwind_00af7e03(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7e0b Unwind@00af7e0b void Unwind_00af7e0b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7e13 Unwind@00af7e13 void Unwind_00af7e13(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7e1b Unwind@00af7e1b void Unwind_00af7e1b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7e26 Unwind@00af7e26 void Unwind_00af7e26(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7e2e Unwind@00af7e2e void Unwind_00af7e2e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7e39 Unwind@00af7e39 void Unwind_00af7e39(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7e41 Unwind@00af7e41 void Unwind_00af7e41(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7e49 Unwind@00af7e49 void Unwind_00af7e49(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7e51 Unwind@00af7e51 void Unwind_00af7e51(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7e5c Unwind@00af7e5c void Unwind_00af7e5c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7e64 Unwind@00af7e64 void Unwind_00af7e64(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7e6f Unwind@00af7e6f void Unwind_00af7e6f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7e77 Unwind@00af7e77 void Unwind_00af7e77(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7e7f Unwind@00af7e7f void Unwind_00af7e7f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7e87 Unwind@00af7e87 void Unwind_00af7e87(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7e92 Unwind@00af7e92 void Unwind_00af7e92(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7e9a Unwind@00af7e9a void Unwind_00af7e9a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7ea5 Unwind@00af7ea5 void Unwind_00af7ea5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7ead Unwind@00af7ead void Unwind_00af7ead(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7eb5 Unwind@00af7eb5 void Unwind_00af7eb5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7ebd Unwind@00af7ebd void Unwind_00af7ebd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7ec8 Unwind@00af7ec8 void Unwind_00af7ec8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7ed0 Unwind@00af7ed0 void Unwind_00af7ed0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7edb Unwind@00af7edb void Unwind_00af7edb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7ee3 Unwind@00af7ee3 void Unwind_00af7ee3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7eeb Unwind@00af7eeb void Unwind_00af7eeb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7ef3 Unwind@00af7ef3 void Unwind_00af7ef3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7efe Unwind@00af7efe void Unwind_00af7efe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7f06 Unwind@00af7f06 void Unwind_00af7f06(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7f11 Unwind@00af7f11 void Unwind_00af7f11(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7f19 Unwind@00af7f19 void Unwind_00af7f19(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7f21 Unwind@00af7f21 void Unwind_00af7f21(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7f29 Unwind@00af7f29 void Unwind_00af7f29(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7f34 Unwind@00af7f34 void Unwind_00af7f34(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7f3c Unwind@00af7f3c void Unwind_00af7f3c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00af7f47 Unwind@00af7f47 void Unwind_00af7f47(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7f4f Unwind@00af7f4f void Unwind_00af7f4f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7f57 Unwind@00af7f57 void Unwind_00af7f57(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7f5f Unwind@00af7f5f void Unwind_00af7f5f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7f6a Unwind@00af7f6a void Unwind_00af7f6a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00af7f75 Unwind@00af7f75 void Unwind_00af7f75(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00af7f7d Unwind@00af7f7d void Unwind_00af7f7d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7f85 Unwind@00af7f85 void Unwind_00af7f85(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7f90 Unwind@00af7f90 void Unwind_00af7f90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7f98 Unwind@00af7f98 void Unwind_00af7f98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7fa0 Unwind@00af7fa0 void Unwind_00af7fa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00af7fab Unwind@00af7fab void Unwind_00af7fab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00af7fb3 Unwind@00af7fb3 void Unwind_00af7fb3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7fbe Unwind@00af7fbe void Unwind_00af7fbe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7fc6 Unwind@00af7fc6 void Unwind_00af7fc6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7fce Unwind@00af7fce void Unwind_00af7fce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00af7fd9 Unwind@00af7fd9 void Unwind_00af7fd9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe8)); return; } //@@ 00af7fe4 Unwind@00af7fe4 void Unwind_00af7fe4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00af7fef Unwind@00af7fef void Unwind_00af7fef(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af7ff7 Unwind@00af7ff7 void Unwind_00af7ff7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af7fff Unwind@00af7fff void Unwind_00af7fff(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00af800a Unwind@00af800a void Unwind_00af800a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00af8015 Unwind@00af8015 void Unwind_00af8015(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x100)); return; } //@@ 00af8020 Unwind@00af8020 void Unwind_00af8020(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8028 Unwind@00af8028 void Unwind_00af8028(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af8030 Unwind@00af8030 void Unwind_00af8030(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00af803b Unwind@00af803b void Unwind_00af803b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00af8046 Unwind@00af8046 void Unwind_00af8046(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe8)); return; } //@@ 00af8051 Unwind@00af8051 void Unwind_00af8051(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af805c Unwind@00af805c void Unwind_00af805c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af8067 Unwind@00af8067 void Unwind_00af8067(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00af8072 Unwind@00af8072 void Unwind_00af8072(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af807d Unwind@00af807d void Unwind_00af807d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00af8088 Unwind@00af8088 void Unwind_00af8088(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x118)); return; } //@@ 00af80d0 Unwind@00af80d0 void Unwind_00af80d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af80d8 Unwind@00af80d8 void Unwind_00af80d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af80e0 Unwind@00af80e0 void Unwind_00af80e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af8120 Unwind@00af8120 void Unwind_00af8120(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00af812b Unwind@00af812b void Unwind_00af812b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af8160 Unwind@00af8160 void Unwind_00af8160(void) { FUN_0040c440(); return; } //@@ 00af81e0 Unwind@00af81e0 void Unwind_00af81e0(void) { FUN_00431050(); return; } //@@ 00af81e8 Unwind@00af81e8 void Unwind_00af81e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af81f0 Unwind@00af81f0 void Unwind_00af81f0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x44) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x44) = *(uint *)(unaff_EBP + -0x44) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00af8209 Unwind@00af8209 void Unwind_00af8209(void) { std::vector::_Tidy(); return; } //@@ 00af8240 Unwind@00af8240 void Unwind_00af8240(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00af8280 Unwind@00af8280 void Unwind_00af8280(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af82c0 Unwind@00af82c0 void Unwind_00af82c0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; /* WARNING: Could not recover jumptable at 0x00af82d6. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_> ((basic_ios_> *)(*(int *)(unaff_EBP + -0x18) + 0x68)); return; } //@@ 00af82dd Unwind@00af82dd void Unwind_00af82dd(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00af82e3. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_iostream_>::~basic_iostream_> ((basic_iostream_> *)(*(int *)(unaff_EBP + -0x18) + 0x20)); return; } //@@ 00af82e9 Unwind@00af82e9 void Unwind_00af82e9(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00af82ec. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_streambuf_>::~basic_streambuf_> (*(basic_streambuf_> **)(unaff_EBP + -0x1c)); return; } //@@ 00af8320 Unwind@00af8320 void Unwind_00af8320(void) { FUN_00414620(); return; } //@@ 00af8370 Unwind@00af8370 void Unwind_00af8370(void) { FUN_0042f780(); return; } //@@ 00af8378 Unwind@00af8378 void Unwind_00af8378(void) { FUN_0042f780(); return; } //@@ 00af83b0 Unwind@00af83b0 void Unwind_00af83b0(void) { FUN_00414a30(); return; } //@@ 00af83b8 Unwind@00af83b8 void Unwind_00af83b8(void) { FUN_00685c40(); return; } //@@ 00af83f0 Unwind@00af83f0 void Unwind_00af83f0(void) { FUN_00414620(); return; } //@@ 00af8420 Unwind@00af8420 void Unwind_00af8420(void) { std::string::_Tidy_deallocate(&DAT_00c34f08); return; } //@@ 00af842a Unwind@00af842a void Unwind_00af842a(void) { std::string::_Tidy_deallocate(&DAT_00c34f20); return; } //@@ 00af8434 Unwind@00af8434 void Unwind_00af8434(void) { std::string::_Tidy_deallocate(&DAT_00c34f38); return; } //@@ 00af843e Unwind@00af843e void Unwind_00af843e(void) { std::string::_Tidy_deallocate(&DAT_00c34f50); return; } //@@ 00af8448 Unwind@00af8448 void Unwind_00af8448(void) { std::string::_Tidy_deallocate(&DAT_00c34f68); return; } //@@ 00af8452 Unwind@00af8452 void Unwind_00af8452(void) { std::string::_Tidy_deallocate(&DAT_00c34f80); return; } //@@ 00af845c Unwind@00af845c void Unwind_00af845c(void) { std::string::_Tidy_deallocate(&DAT_00c34f98); return; } //@@ 00af8466 Unwind@00af8466 void Unwind_00af8466(void) { std::string::_Tidy_deallocate(&DAT_00c34fb0); return; } //@@ 00af8470 Unwind@00af8470 void Unwind_00af8470(void) { std::string::_Tidy_deallocate(&DAT_00c34fc8); return; } //@@ 00af847a Unwind@00af847a void Unwind_00af847a(void) { std::string::_Tidy_deallocate(&DAT_00c34fe0); return; } //@@ 00af8484 Unwind@00af8484 void Unwind_00af8484(void) { std::string::_Tidy_deallocate(&DAT_00c34ff8); return; } //@@ 00af848e Unwind@00af848e void Unwind_00af848e(void) { std::string::_Tidy_deallocate(&DAT_00c35010); return; } //@@ 00af8498 Unwind@00af8498 void Unwind_00af8498(void) { std::string::_Tidy_deallocate(&DAT_00c35028); return; } //@@ 00af84a2 Unwind@00af84a2 void Unwind_00af84a2(void) { std::string::_Tidy_deallocate(&DAT_00c35040); return; } //@@ 00af84ac Unwind@00af84ac void Unwind_00af84ac(void) { std::string::_Tidy_deallocate(&DAT_00c35058); return; } //@@ 00af84b6 Unwind@00af84b6 void Unwind_00af84b6(void) { std::string::_Tidy_deallocate(&DAT_00c35070); return; } //@@ 00af84c0 Unwind@00af84c0 void Unwind_00af84c0(void) { std::string::_Tidy_deallocate(&DAT_00c35088); return; } //@@ 00af84f0 Unwind@00af84f0 void Unwind_00af84f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af8530 Unwind@00af8530 void Unwind_00af8530(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x530)); return; } //@@ 00af8570 Unwind@00af8570 void Unwind_00af8570(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + 8)); return; } //@@ 00af8578 Unwind@00af8578 void Unwind_00af8578(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8580 Unwind@00af8580 void Unwind_00af8580(void) { FUN_00685cd0(); return; } //@@ 00af85c0 Unwind@00af85c0 void Unwind_00af85c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af8600 Unwind@00af8600 void Unwind_00af8600(void) { FUN_00693420(); return; } //@@ 00af860b Unwind@00af860b void Unwind_00af860b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8613 Unwind@00af8613 void Unwind_00af8613(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af861b Unwind@00af861b void Unwind_00af861b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8623 Unwind@00af8623 void Unwind_00af8623(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af862b Unwind@00af862b void Unwind_00af862b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8633 Unwind@00af8633 void Unwind_00af8633(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af863b Unwind@00af863b void Unwind_00af863b(void) { FUN_00693420(); return; } //@@ 00af8646 Unwind@00af8646 void Unwind_00af8646(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af864e Unwind@00af864e void Unwind_00af864e(void) { FUN_00694210(); return; } //@@ 00af8659 Unwind@00af8659 void Unwind_00af8659(void) { FUN_00693420(); return; } //@@ 00af8664 Unwind@00af8664 void Unwind_00af8664(void) { FUN_00693420(); return; } //@@ 00af866f Unwind@00af866f void Unwind_00af866f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8677 Unwind@00af8677 void Unwind_00af8677(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af867f Unwind@00af867f void Unwind_00af867f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8687 Unwind@00af8687 void Unwind_00af8687(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af868f Unwind@00af868f void Unwind_00af868f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8697 Unwind@00af8697 void Unwind_00af8697(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86a2 Unwind@00af86a2 void Unwind_00af86a2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86ad Unwind@00af86ad void Unwind_00af86ad(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86b8 Unwind@00af86b8 void Unwind_00af86b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86c3 Unwind@00af86c3 void Unwind_00af86c3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86ce Unwind@00af86ce void Unwind_00af86ce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86d9 Unwind@00af86d9 void Unwind_00af86d9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86e4 Unwind@00af86e4 void Unwind_00af86e4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86ef Unwind@00af86ef void Unwind_00af86ef(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af86fa Unwind@00af86fa void Unwind_00af86fa(void) { FUN_00693420(); return; } //@@ 00af8705 Unwind@00af8705 void Unwind_00af8705(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af8710 Unwind@00af8710 void Unwind_00af8710(void) { std::vector::_Tidy(); return; } //@@ 00af871b Unwind@00af871b void Unwind_00af871b(void) { std::vector::_Tidy(); return; } //@@ 00af8726 Unwind@00af8726 void Unwind_00af8726(void) { std::vector::_Tidy(); return; } //@@ 00af8731 Unwind@00af8731 void Unwind_00af8731(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af873c Unwind@00af873c void Unwind_00af873c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8744 Unwind@00af8744 void Unwind_00af8744(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af874f Unwind@00af874f void Unwind_00af874f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00af8757 Unwind@00af8757 void Unwind_00af8757(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af8762 Unwind@00af8762 void Unwind_00af8762(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af876d Unwind@00af876d void Unwind_00af876d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8775 Unwind@00af8775 void Unwind_00af8775(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af8780 Unwind@00af8780 void Unwind_00af8780(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00af878b Unwind@00af878b void Unwind_00af878b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af8796 Unwind@00af8796 void Unwind_00af8796(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af87a1 Unwind@00af87a1 void Unwind_00af87a1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af87ac Unwind@00af87ac void Unwind_00af87ac(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af87b4 Unwind@00af87b4 void Unwind_00af87b4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af87bf Unwind@00af87bf void Unwind_00af87bf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af87ca Unwind@00af87ca void Unwind_00af87ca(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af87d5 Unwind@00af87d5 void Unwind_00af87d5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af87e0 Unwind@00af87e0 void Unwind_00af87e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af87e8 Unwind@00af87e8 void Unwind_00af87e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af87f3 Unwind@00af87f3 void Unwind_00af87f3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af87fe Unwind@00af87fe void Unwind_00af87fe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af8809 Unwind@00af8809 void Unwind_00af8809(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af8814 Unwind@00af8814 void Unwind_00af8814(void) { std::vector::_Tidy(); return; } //@@ 00af881c Unwind@00af881c void Unwind_00af881c(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x154)); return; } //@@ 00af8827 Unwind@00af8827 void Unwind_00af8827(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x154)); return; } //@@ 00af8832 Unwind@00af8832 void Unwind_00af8832(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af883d Unwind@00af883d void Unwind_00af883d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af8848 Unwind@00af8848 void Unwind_00af8848(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af8853 Unwind@00af8853 void Unwind_00af8853(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af885e Unwind@00af885e void Unwind_00af885e(void) { std::vector::_Tidy(); return; } //@@ 00af8869 Unwind@00af8869 void Unwind_00af8869(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af8874 Unwind@00af8874 void Unwind_00af8874(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af887f Unwind@00af887f void Unwind_00af887f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8887 Unwind@00af8887 void Unwind_00af8887(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00af8892 Unwind@00af8892 void Unwind_00af8892(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af889d Unwind@00af889d void Unwind_00af889d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af88a8 Unwind@00af88a8 void Unwind_00af88a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af88b3 Unwind@00af88b3 void Unwind_00af88b3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00af88be Unwind@00af88be void Unwind_00af88be(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af88c6 Unwind@00af88c6 void Unwind_00af88c6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00af88ce Unwind@00af88ce void Unwind_00af88ce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af88d9 Unwind@00af88d9 void Unwind_00af88d9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af88e4 Unwind@00af88e4 void Unwind_00af88e4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af88ef Unwind@00af88ef void Unwind_00af88ef(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af88fa Unwind@00af88fa void Unwind_00af88fa(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00af8905 Unwind@00af8905 void Unwind_00af8905(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af890d Unwind@00af890d void Unwind_00af890d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00af8918 Unwind@00af8918 void Unwind_00af8918(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -400)); return; } //@@ 00af8923 Unwind@00af8923 void Unwind_00af8923(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1a8)); return; } //@@ 00af892e Unwind@00af892e void Unwind_00af892e(void) { std::vector::_Tidy(); return; } //@@ 00af8939 Unwind@00af8939 void Unwind_00af8939(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00af8944 Unwind@00af8944 void Unwind_00af8944(void) { std::string::_Tidy_deallocate(&DAT_00c5cab8); return; } //@@ 00af894e Unwind@00af894e void Unwind_00af894e(void) { std::string::_Tidy_deallocate(&DAT_00c5cad0); return; } //@@ 00af8958 Unwind@00af8958 void Unwind_00af8958(void) { std::string::_Tidy_deallocate(&DAT_00c5cae8); return; } //@@ 00af8962 Unwind@00af8962 void Unwind_00af8962(void) { std::string::_Tidy_deallocate(&DAT_00c5cb00); return; } //@@ 00af896c Unwind@00af896c void Unwind_00af896c(void) { std::string::_Tidy_deallocate(&DAT_00c5cb18); return; } //@@ 00af8976 Unwind@00af8976 void Unwind_00af8976(void) { std::string::_Tidy_deallocate(&DAT_00c5cb30); return; } //@@ 00af8980 Unwind@00af8980 void Unwind_00af8980(void) { std::string::_Tidy_deallocate(&DAT_00c5cb48); return; } //@@ 00af898a Unwind@00af898a void Unwind_00af898a(void) { std::string::_Tidy_deallocate(&DAT_00c5cb60); return; } //@@ 00af8994 Unwind@00af8994 void Unwind_00af8994(void) { std::string::_Tidy_deallocate(&DAT_00c5cb78); return; } //@@ 00af899e Unwind@00af899e void Unwind_00af899e(void) { std::string::_Tidy_deallocate(&DAT_00c5cb90); return; } //@@ 00af89a8 Unwind@00af89a8 void Unwind_00af89a8(void) { std::string::_Tidy_deallocate(&DAT_00c5cba8); return; } //@@ 00af89b2 Unwind@00af89b2 void Unwind_00af89b2(void) { std::string::_Tidy_deallocate(&DAT_00c5cbc0); return; } //@@ 00af89bc Unwind@00af89bc void Unwind_00af89bc(void) { std::string::_Tidy_deallocate(&DAT_00c5cbd8); return; } //@@ 00af89c6 Unwind@00af89c6 void Unwind_00af89c6(void) { std::string::_Tidy_deallocate(&DAT_00c5cbf0); return; } //@@ 00af89d0 Unwind@00af89d0 void Unwind_00af89d0(void) { std::string::_Tidy_deallocate(&DAT_00c5cc08); return; } //@@ 00af89da Unwind@00af89da void Unwind_00af89da(void) { std::string::_Tidy_deallocate(&DAT_00c5cc20); return; } //@@ 00af89e4 Unwind@00af89e4 void Unwind_00af89e4(void) { std::string::_Tidy_deallocate(&DAT_00c5cc38); return; } //@@ 00af89ee Unwind@00af89ee void Unwind_00af89ee(void) { std::string::_Tidy_deallocate(&DAT_00c5cc50); return; } //@@ 00af89f8 Unwind@00af89f8 void Unwind_00af89f8(void) { std::string::_Tidy_deallocate(&DAT_00c5cc68); return; } //@@ 00af8a02 Unwind@00af8a02 void Unwind_00af8a02(void) { std::string::_Tidy_deallocate(&DAT_00c5cc80); return; } //@@ 00af8a0c Unwind@00af8a0c void Unwind_00af8a0c(void) { std::string::_Tidy_deallocate(&DAT_00c5cc98); return; } //@@ 00af8a16 Unwind@00af8a16 void Unwind_00af8a16(void) { std::string::_Tidy_deallocate(&DAT_00c5ccb0); return; } //@@ 00af8a20 Unwind@00af8a20 void Unwind_00af8a20(void) { std::string::_Tidy_deallocate(&DAT_00c5ccc8); return; } //@@ 00af8a2a Unwind@00af8a2a void Unwind_00af8a2a(void) { std::string::_Tidy_deallocate(&DAT_00c5cce0); return; } //@@ 00af8a34 Unwind@00af8a34 void Unwind_00af8a34(void) { std::string::_Tidy_deallocate(&DAT_00c5ccf8); return; } //@@ 00af8a3e Unwind@00af8a3e void Unwind_00af8a3e(void) { std::string::_Tidy_deallocate(&DAT_00c5cd10); return; } //@@ 00af8a48 Unwind@00af8a48 void Unwind_00af8a48(void) { std::string::_Tidy_deallocate(&DAT_00c5cd28); return; } //@@ 00af8a52 Unwind@00af8a52 void Unwind_00af8a52(void) { std::string::_Tidy_deallocate(&DAT_00c5cd40); return; } //@@ 00af8a5c Unwind@00af8a5c void Unwind_00af8a5c(void) { std::string::_Tidy_deallocate(&DAT_00c5cd70); return; } //@@ 00af8a66 Unwind@00af8a66 void Unwind_00af8a66(void) { std::string::_Tidy_deallocate(&DAT_00c5cd88); return; } //@@ 00af8a70 Unwind@00af8a70 void Unwind_00af8a70(void) { std::string::_Tidy_deallocate(&DAT_00c5cda0); return; } //@@ 00af8a7a Unwind@00af8a7a void Unwind_00af8a7a(void) { std::string::_Tidy_deallocate(&DAT_00c5cdb8); return; } //@@ 00af8a84 Unwind@00af8a84 void Unwind_00af8a84(void) { std::string::_Tidy_deallocate(&DAT_00c5cdd0); return; } //@@ 00af8a8e Unwind@00af8a8e void Unwind_00af8a8e(void) { std::string::_Tidy_deallocate(&DAT_00c5cde8); return; } //@@ 00af8a98 Unwind@00af8a98 void Unwind_00af8a98(void) { std::string::_Tidy_deallocate(&DAT_00c5ce00); return; } //@@ 00af8aa2 Unwind@00af8aa2 void Unwind_00af8aa2(void) { std::string::_Tidy_deallocate(&DAT_00c5ce18); return; } //@@ 00af8aac Unwind@00af8aac void Unwind_00af8aac(void) { std::string::_Tidy_deallocate(&DAT_00c5ce30); return; } //@@ 00af8ab6 Unwind@00af8ab6 void Unwind_00af8ab6(void) { std::string::_Tidy_deallocate(&DAT_00c5ce48); return; } //@@ 00af8ac0 Unwind@00af8ac0 void Unwind_00af8ac0(void) { std::string::_Tidy_deallocate(&DAT_00c5ce60); return; } //@@ 00af8aca Unwind@00af8aca void Unwind_00af8aca(void) { std::string::_Tidy_deallocate(&DAT_00c5ce78); return; } //@@ 00af8ad4 Unwind@00af8ad4 void Unwind_00af8ad4(void) { std::string::_Tidy_deallocate(&DAT_00c5ce90); return; } //@@ 00af8ade Unwind@00af8ade void Unwind_00af8ade(void) { std::string::_Tidy_deallocate(&DAT_00c5cea8); return; } //@@ 00af8ae8 Unwind@00af8ae8 void Unwind_00af8ae8(void) { std::string::_Tidy_deallocate(&DAT_00c5cec0); return; } //@@ 00af8af2 Unwind@00af8af2 void Unwind_00af8af2(void) { std::string::_Tidy_deallocate(&DAT_00c5ced8); return; } //@@ 00af8afc Unwind@00af8afc void Unwind_00af8afc(void) { std::string::_Tidy_deallocate(&DAT_00c5cef0); return; } //@@ 00af8b06 Unwind@00af8b06 void Unwind_00af8b06(void) { std::string::_Tidy_deallocate(&DAT_00c5cf08); return; } //@@ 00af8b10 Unwind@00af8b10 void Unwind_00af8b10(void) { std::string::_Tidy_deallocate(&DAT_00c5cf20); return; } //@@ 00af8b1a Unwind@00af8b1a void Unwind_00af8b1a(void) { std::string::_Tidy_deallocate(&DAT_00c5cf38); return; } //@@ 00af8b24 Unwind@00af8b24 void Unwind_00af8b24(void) { std::string::_Tidy_deallocate(&DAT_00c5cf50); return; } //@@ 00af8b2e Unwind@00af8b2e void Unwind_00af8b2e(void) { std::string::_Tidy_deallocate(&DAT_00c5cf68); return; } //@@ 00af8b38 Unwind@00af8b38 void Unwind_00af8b38(void) { std::string::_Tidy_deallocate(&DAT_00c5cf80); return; } //@@ 00af8b42 Unwind@00af8b42 void Unwind_00af8b42(void) { std::string::_Tidy_deallocate(&DAT_00c5cf98); return; } //@@ 00af8b4c Unwind@00af8b4c void Unwind_00af8b4c(void) { std::string::_Tidy_deallocate(&DAT_00c5cfb0); return; } //@@ 00af8b56 Unwind@00af8b56 void Unwind_00af8b56(void) { std::string::_Tidy_deallocate(&DAT_00c80260); return; } //@@ 00af8b60 Unwind@00af8b60 void Unwind_00af8b60(void) { std::string::_Tidy_deallocate(&DAT_00c80278); return; } //@@ 00af8b6a Unwind@00af8b6a void Unwind_00af8b6a(void) { std::string::_Tidy_deallocate(&DAT_00c80290); return; } //@@ 00af8b74 Unwind@00af8b74 void Unwind_00af8b74(void) { std::string::_Tidy_deallocate(&DAT_00c802a8); return; } //@@ 00af8b7e Unwind@00af8b7e void Unwind_00af8b7e(void) { std::string::_Tidy_deallocate(&DAT_00c802c0); return; } //@@ 00af8b88 Unwind@00af8b88 void Unwind_00af8b88(void) { std::string::_Tidy_deallocate(&DAT_00c802d8); return; } //@@ 00af8b92 Unwind@00af8b92 void Unwind_00af8b92(void) { std::string::_Tidy_deallocate(&DAT_00c802f0); return; } //@@ 00af8b9c Unwind@00af8b9c void Unwind_00af8b9c(void) { std::string::_Tidy_deallocate(&DAT_00c80328); return; } //@@ 00af8ba6 Unwind@00af8ba6 void Unwind_00af8ba6(void) { std::string::_Tidy_deallocate(&DAT_00c80340); return; } //@@ 00af8bb0 Unwind@00af8bb0 void Unwind_00af8bb0(void) { std::string::_Tidy_deallocate(&DAT_00c80358); return; } //@@ 00af8bba Unwind@00af8bba void Unwind_00af8bba(void) { std::string::_Tidy_deallocate(&DAT_00c80370); return; } //@@ 00af8bc4 Unwind@00af8bc4 void Unwind_00af8bc4(void) { std::string::_Tidy_deallocate(&DAT_00c80388); return; } //@@ 00af8bce Unwind@00af8bce void Unwind_00af8bce(void) { std::string::_Tidy_deallocate(&DAT_00c803a0); return; } //@@ 00af8bd8 Unwind@00af8bd8 void Unwind_00af8bd8(void) { std::string::_Tidy_deallocate(&DAT_00c803b8); return; } //@@ 00af8be2 Unwind@00af8be2 void Unwind_00af8be2(void) { std::string::_Tidy_deallocate(&DAT_00c803d0); return; } //@@ 00af8bec Unwind@00af8bec void Unwind_00af8bec(void) { std::string::_Tidy_deallocate(&DAT_00c803e8); return; } //@@ 00af8bf6 Unwind@00af8bf6 void Unwind_00af8bf6(void) { std::string::_Tidy_deallocate(&DAT_00c80400); return; } //@@ 00af8c00 Unwind@00af8c00 void Unwind_00af8c00(void) { std::string::_Tidy_deallocate(&DAT_00c80418); return; } //@@ 00af8c0a Unwind@00af8c0a void Unwind_00af8c0a(void) { std::string::_Tidy_deallocate(&DAT_00c80430); return; } //@@ 00af8c14 Unwind@00af8c14 void Unwind_00af8c14(void) { std::string::_Tidy_deallocate(&DAT_00c80448); return; } //@@ 00af8c1e Unwind@00af8c1e void Unwind_00af8c1e(void) { std::string::_Tidy_deallocate(&DAT_00c80460); return; } //@@ 00af8c28 Unwind@00af8c28 void Unwind_00af8c28(void) { std::string::_Tidy_deallocate(&DAT_00c80478); return; } //@@ 00af8c32 Unwind@00af8c32 void Unwind_00af8c32(void) { std::string::_Tidy_deallocate(&DAT_00c80490); return; } //@@ 00af8c3c Unwind@00af8c3c void Unwind_00af8c3c(void) { std::string::_Tidy_deallocate(&DAT_00c804a8); return; } //@@ 00af8c46 Unwind@00af8c46 void Unwind_00af8c46(void) { std::string::_Tidy_deallocate(&DAT_00c804c0); return; } //@@ 00af8c50 Unwind@00af8c50 void Unwind_00af8c50(void) { std::string::_Tidy_deallocate(&DAT_00c804d8); return; } //@@ 00af8c5a Unwind@00af8c5a void Unwind_00af8c5a(void) { std::string::_Tidy_deallocate(&DAT_00c804f0); return; } //@@ 00af8c64 Unwind@00af8c64 void Unwind_00af8c64(void) { std::string::_Tidy_deallocate(&DAT_00c80508); return; } //@@ 00af8c6e Unwind@00af8c6e void Unwind_00af8c6e(void) { std::string::_Tidy_deallocate(&DAT_00c80520); return; } //@@ 00af8c78 Unwind@00af8c78 void Unwind_00af8c78(void) { std::string::_Tidy_deallocate(&DAT_00c80538); return; } //@@ 00af8c82 Unwind@00af8c82 void Unwind_00af8c82(void) { std::string::_Tidy_deallocate(&DAT_00c80550); return; } //@@ 00af8c8c Unwind@00af8c8c void Unwind_00af8c8c(void) { std::string::_Tidy_deallocate(&DAT_00c80568); return; } //@@ 00af8c96 Unwind@00af8c96 void Unwind_00af8c96(void) { std::string::_Tidy_deallocate(&DAT_00c80580); return; } //@@ 00af8ca0 Unwind@00af8ca0 void Unwind_00af8ca0(void) { std::string::_Tidy_deallocate(&DAT_00c80598); return; } //@@ 00af8caa Unwind@00af8caa void Unwind_00af8caa(void) { std::string::_Tidy_deallocate(&DAT_00c805b0); return; } //@@ 00af8cb4 Unwind@00af8cb4 void Unwind_00af8cb4(void) { std::string::_Tidy_deallocate(&DAT_00c805c8); return; } //@@ 00af8cbe Unwind@00af8cbe void Unwind_00af8cbe(void) { std::string::_Tidy_deallocate(&DAT_00c805e0); return; } //@@ 00af8cc8 Unwind@00af8cc8 void Unwind_00af8cc8(void) { std::string::_Tidy_deallocate(&DAT_00c805f8); return; } //@@ 00af8cd2 Unwind@00af8cd2 void Unwind_00af8cd2(void) { std::string::_Tidy_deallocate(&DAT_00c80610); return; } //@@ 00af8cdc Unwind@00af8cdc void Unwind_00af8cdc(void) { std::string::_Tidy_deallocate(&DAT_00c80628); return; } //@@ 00af8ce6 Unwind@00af8ce6 void Unwind_00af8ce6(void) { std::string::_Tidy_deallocate(&DAT_00c80640); return; } //@@ 00af8cf0 Unwind@00af8cf0 void Unwind_00af8cf0(void) { std::string::_Tidy_deallocate(&DAT_00c80658); return; } //@@ 00af8cfa Unwind@00af8cfa void Unwind_00af8cfa(void) { std::string::_Tidy_deallocate(&DAT_00c80670); return; } //@@ 00af8d04 Unwind@00af8d04 void Unwind_00af8d04(void) { std::string::_Tidy_deallocate(&DAT_00c80688); return; } //@@ 00af8d0e Unwind@00af8d0e void Unwind_00af8d0e(void) { std::string::_Tidy_deallocate(&DAT_00c806a0); return; } //@@ 00af8d18 Unwind@00af8d18 void Unwind_00af8d18(void) { std::string::_Tidy_deallocate(&DAT_00c806b8); return; } //@@ 00af8d22 Unwind@00af8d22 void Unwind_00af8d22(void) { std::string::_Tidy_deallocate(&DAT_00c806d0); return; } //@@ 00af8d2c Unwind@00af8d2c void Unwind_00af8d2c(void) { std::string::_Tidy_deallocate(&DAT_00c806e8); return; } //@@ 00af8d36 Unwind@00af8d36 void Unwind_00af8d36(void) { std::string::_Tidy_deallocate(&DAT_00c80700); return; } //@@ 00af8d40 Unwind@00af8d40 void Unwind_00af8d40(void) { std::string::_Tidy_deallocate(&DAT_00c80718); return; } //@@ 00af8d4a Unwind@00af8d4a void Unwind_00af8d4a(void) { std::string::_Tidy_deallocate(&DAT_00c80730); return; } //@@ 00af8d54 Unwind@00af8d54 void Unwind_00af8d54(void) { std::string::_Tidy_deallocate(&DAT_00c80748); return; } //@@ 00af8d5e Unwind@00af8d5e void Unwind_00af8d5e(void) { std::string::_Tidy_deallocate(&DAT_00c80760); return; } //@@ 00af8d68 Unwind@00af8d68 void Unwind_00af8d68(void) { std::string::_Tidy_deallocate(&DAT_00c80778); return; } //@@ 00af8d72 Unwind@00af8d72 void Unwind_00af8d72(void) { std::string::_Tidy_deallocate(&DAT_00c80790); return; } //@@ 00af8d7c Unwind@00af8d7c void Unwind_00af8d7c(void) { std::string::_Tidy_deallocate(&DAT_00c807a8); return; } //@@ 00af8d86 Unwind@00af8d86 void Unwind_00af8d86(void) { std::string::_Tidy_deallocate(&DAT_00c807c0); return; } //@@ 00af8d90 Unwind@00af8d90 void Unwind_00af8d90(void) { std::string::_Tidy_deallocate(&DAT_00c807d8); return; } //@@ 00af8d9a Unwind@00af8d9a void Unwind_00af8d9a(void) { std::string::_Tidy_deallocate(&DAT_00c807f0); return; } //@@ 00af8da4 Unwind@00af8da4 void Unwind_00af8da4(void) { std::string::_Tidy_deallocate(&DAT_00c80808); return; } //@@ 00af8dae Unwind@00af8dae void Unwind_00af8dae(void) { std::string::_Tidy_deallocate(&DAT_00c80820); return; } //@@ 00af8db8 Unwind@00af8db8 void Unwind_00af8db8(void) { std::string::_Tidy_deallocate(&DAT_00c80838); return; } //@@ 00af8dc2 Unwind@00af8dc2 void Unwind_00af8dc2(void) { std::string::_Tidy_deallocate(&DAT_00c80850); return; } //@@ 00af8dcc Unwind@00af8dcc void Unwind_00af8dcc(void) { std::string::_Tidy_deallocate(&DAT_00c80868); return; } //@@ 00af8dd6 Unwind@00af8dd6 void Unwind_00af8dd6(void) { std::string::_Tidy_deallocate(&DAT_00c80880); return; } //@@ 00af8de0 Unwind@00af8de0 void Unwind_00af8de0(void) { std::string::_Tidy_deallocate(&DAT_00c80898); return; } //@@ 00af8dea Unwind@00af8dea void Unwind_00af8dea(void) { std::string::_Tidy_deallocate(&DAT_00c808b0); return; } //@@ 00af8df4 Unwind@00af8df4 void Unwind_00af8df4(void) { std::string::_Tidy_deallocate(&DAT_00c808c8); return; } //@@ 00af8dfe Unwind@00af8dfe void Unwind_00af8dfe(void) { std::string::_Tidy_deallocate(&DAT_00c80900); return; } //@@ 00af8e08 Unwind@00af8e08 void Unwind_00af8e08(void) { std::string::_Tidy_deallocate(&DAT_00c80918); return; } //@@ 00af8e12 Unwind@00af8e12 void Unwind_00af8e12(void) { std::string::_Tidy_deallocate(&DAT_00c80930); return; } //@@ 00af8e1c Unwind@00af8e1c void Unwind_00af8e1c(void) { std::string::_Tidy_deallocate(&DAT_00c80948); return; } //@@ 00af8e26 Unwind@00af8e26 void Unwind_00af8e26(void) { std::string::_Tidy_deallocate(&DAT_00c80960); return; } //@@ 00af8e30 Unwind@00af8e30 void Unwind_00af8e30(void) { std::string::_Tidy_deallocate(&DAT_00c80978); return; } //@@ 00af8e3a Unwind@00af8e3a void Unwind_00af8e3a(void) { std::string::_Tidy_deallocate(&DAT_00c80990); return; } //@@ 00af8e44 Unwind@00af8e44 void Unwind_00af8e44(void) { std::string::_Tidy_deallocate(&DAT_00c809a8); return; } //@@ 00af8e4e Unwind@00af8e4e void Unwind_00af8e4e(void) { std::string::_Tidy_deallocate(&DAT_00c809c0); return; } //@@ 00af8e58 Unwind@00af8e58 void Unwind_00af8e58(void) { std::string::_Tidy_deallocate(&DAT_00c809d8); return; } //@@ 00af8e62 Unwind@00af8e62 void Unwind_00af8e62(void) { std::string::_Tidy_deallocate(&DAT_00c809f0); return; } //@@ 00af8e6c Unwind@00af8e6c void Unwind_00af8e6c(void) { std::string::_Tidy_deallocate(&DAT_00c80a08); return; } //@@ 00af8e76 Unwind@00af8e76 void Unwind_00af8e76(void) { std::string::_Tidy_deallocate(&DAT_00c80a20); return; } //@@ 00af8e80 Unwind@00af8e80 void Unwind_00af8e80(void) { std::string::_Tidy_deallocate(&DAT_00c80a38); return; } //@@ 00af8e8a Unwind@00af8e8a void Unwind_00af8e8a(void) { std::string::_Tidy_deallocate(&DAT_00c80a50); return; } //@@ 00af8ed0 Unwind@00af8ed0 void Unwind_00af8ed0(void) { FUN_004242b0(); return; } //@@ 00af8f00 Unwind@00af8f00 void Unwind_00af8f00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af8f08 Unwind@00af8f08 void Unwind_00af8f08(void) { FUN_0041d4b0(); return; } //@@ 00af8f10 Unwind@00af8f10 void Unwind_00af8f10(void) { FUN_00a55c20(); return; } //@@ 00af8f1b Unwind@00af8f1b void Unwind_00af8f1b(void) { FUN_0041d4b0(); return; } //@@ 00af8f60 Unwind@00af8f60 void Unwind_00af8f60(void) { FUN_0041d4b0(); return; } //@@ 00af8f68 Unwind@00af8f68 void Unwind_00af8f68(void) { FUN_00a55c20(); return; } //@@ 00af8f73 Unwind@00af8f73 void Unwind_00af8f73(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00af8f7b Unwind@00af8f7b void Unwind_00af8f7b(void) { FUN_0041d4b0(); return; } //@@ 00af8f83 Unwind@00af8f83 void Unwind_00af8f83(void) { FUN_00a55c20(); return; } //@@ 00af8f8e Unwind@00af8f8e void Unwind_00af8f8e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00af8f96 Unwind@00af8f96 void Unwind_00af8f96(void) { FUN_0041d4b0(); return; } //@@ 00af8f9e Unwind@00af8f9e void Unwind_00af8f9e(void) { FUN_00a55c20(); return; } //@@ 00af8fe0 Unwind@00af8fe0 void Unwind_00af8fe0(void) { std::vector::_Tidy(); return; } //@@ 00af8feb Unwind@00af8feb void Unwind_00af8feb(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x218) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x218) = *(uint *)(unaff_EBP + -0x218) & 0xfffffffb; std::vector::_Tidy(); return; } //@@ 00af900a Unwind@00af900a void Unwind_00af900a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af9015 Unwind@00af9015 void Unwind_00af9015(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00af9020 Unwind@00af9020 void Unwind_00af9020(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9028 Unwind@00af9028 void Unwind_00af9028(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af9033 Unwind@00af9033 void Unwind_00af9033(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af903e Unwind@00af903e void Unwind_00af903e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9049 Unwind@00af9049 void Unwind_00af9049(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc0)); return; } //@@ 00af9054 Unwind@00af9054 void Unwind_00af9054(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af905c Unwind@00af905c void Unwind_00af905c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af9067 Unwind@00af9067 void Unwind_00af9067(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af906f Unwind@00af906f void Unwind_00af906f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af907a Unwind@00af907a void Unwind_00af907a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9085 Unwind@00af9085 void Unwind_00af9085(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9090 Unwind@00af9090 void Unwind_00af9090(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af909b Unwind@00af909b void Unwind_00af909b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af90a6 Unwind@00af90a6 void Unwind_00af90a6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af90b1 Unwind@00af90b1 void Unwind_00af90b1(void) { std::vector::_Tidy(); return; } //@@ 00af90bc Unwind@00af90bc void Unwind_00af90bc(void) { std::vector::_Tidy(); return; } //@@ 00af90c4 Unwind@00af90c4 void Unwind_00af90c4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af90cf Unwind@00af90cf void Unwind_00af90cf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af90da Unwind@00af90da void Unwind_00af90da(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af90e5 Unwind@00af90e5 void Unwind_00af90e5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af90f0 Unwind@00af90f0 void Unwind_00af90f0(void) { std::vector::_Tidy(); return; } //@@ 00af90fb Unwind@00af90fb void Unwind_00af90fb(void) { std::vector::_Tidy(); return; } //@@ 00af9103 Unwind@00af9103 void Unwind_00af9103(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af910b Unwind@00af910b void Unwind_00af910b(void) { std::vector::_Tidy(); return; } //@@ 00af9113 Unwind@00af9113 void Unwind_00af9113(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af911e Unwind@00af911e void Unwind_00af911e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9129 Unwind@00af9129 void Unwind_00af9129(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af9134 Unwind@00af9134 void Unwind_00af9134(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af913f Unwind@00af913f void Unwind_00af913f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af9147 Unwind@00af9147 void Unwind_00af9147(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af914f Unwind@00af914f void Unwind_00af914f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc0)); return; } //@@ 00af915a Unwind@00af915a void Unwind_00af915a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af9165 Unwind@00af9165 void Unwind_00af9165(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9170 Unwind@00af9170 void Unwind_00af9170(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af917b Unwind@00af917b void Unwind_00af917b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9186 Unwind@00af9186 void Unwind_00af9186(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af918e Unwind@00af918e void Unwind_00af918e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9196 Unwind@00af9196 void Unwind_00af9196(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af91a1 Unwind@00af91a1 void Unwind_00af91a1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af91ac Unwind@00af91ac void Unwind_00af91ac(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af91b4 Unwind@00af91b4 void Unwind_00af91b4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af91bf Unwind@00af91bf void Unwind_00af91bf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af91ca Unwind@00af91ca void Unwind_00af91ca(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af91d5 Unwind@00af91d5 void Unwind_00af91d5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af91dd Unwind@00af91dd void Unwind_00af91dd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af91e5 Unwind@00af91e5 void Unwind_00af91e5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af91f0 Unwind@00af91f0 void Unwind_00af91f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af91fb Unwind@00af91fb void Unwind_00af91fb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9206 Unwind@00af9206 void Unwind_00af9206(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9211 Unwind@00af9211 void Unwind_00af9211(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af921c Unwind@00af921c void Unwind_00af921c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9227 Unwind@00af9227 void Unwind_00af9227(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9232 Unwind@00af9232 void Unwind_00af9232(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af923d Unwind@00af923d void Unwind_00af923d(void) { std::vector::_Tidy(); return; } //@@ 00af9245 Unwind@00af9245 void Unwind_00af9245(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9250 Unwind@00af9250 void Unwind_00af9250(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af925b Unwind@00af925b void Unwind_00af925b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9266 Unwind@00af9266 void Unwind_00af9266(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af9271 Unwind@00af9271 void Unwind_00af9271(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af9279 Unwind@00af9279 void Unwind_00af9279(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc0)); return; } //@@ 00af9284 Unwind@00af9284 void Unwind_00af9284(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af928f Unwind@00af928f void Unwind_00af928f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af929a Unwind@00af929a void Unwind_00af929a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af92a5 Unwind@00af92a5 void Unwind_00af92a5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af92b0 Unwind@00af92b0 void Unwind_00af92b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af92bb Unwind@00af92bb void Unwind_00af92bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af92c6 Unwind@00af92c6 void Unwind_00af92c6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af92d1 Unwind@00af92d1 void Unwind_00af92d1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af92d9 Unwind@00af92d9 void Unwind_00af92d9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af92e4 Unwind@00af92e4 void Unwind_00af92e4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af92ef Unwind@00af92ef void Unwind_00af92ef(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af92fa Unwind@00af92fa void Unwind_00af92fa(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af9305 Unwind@00af9305 void Unwind_00af9305(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af9310 Unwind@00af9310 void Unwind_00af9310(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af931b Unwind@00af931b void Unwind_00af931b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af9323 Unwind@00af9323 void Unwind_00af9323(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc0)); return; } //@@ 00af932e Unwind@00af932e void Unwind_00af932e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af9339 Unwind@00af9339 void Unwind_00af9339(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af9344 Unwind@00af9344 void Unwind_00af9344(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af934f Unwind@00af934f void Unwind_00af934f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af935a Unwind@00af935a void Unwind_00af935a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af9365 Unwind@00af9365 void Unwind_00af9365(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af9370 Unwind@00af9370 void Unwind_00af9370(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af937b Unwind@00af937b void Unwind_00af937b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af9386 Unwind@00af9386 void Unwind_00af9386(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af9391 Unwind@00af9391 void Unwind_00af9391(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af939c Unwind@00af939c void Unwind_00af939c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af93a7 Unwind@00af93a7 void Unwind_00af93a7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af93b2 Unwind@00af93b2 void Unwind_00af93b2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af93bd Unwind@00af93bd void Unwind_00af93bd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af93c8 Unwind@00af93c8 void Unwind_00af93c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af93d3 Unwind@00af93d3 void Unwind_00af93d3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af93de Unwind@00af93de void Unwind_00af93de(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af93e9 Unwind@00af93e9 void Unwind_00af93e9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af93f4 Unwind@00af93f4 void Unwind_00af93f4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af93ff Unwind@00af93ff void Unwind_00af93ff(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af940a Unwind@00af940a void Unwind_00af940a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af9415 Unwind@00af9415 void Unwind_00af9415(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af9420 Unwind@00af9420 void Unwind_00af9420(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af942b Unwind@00af942b void Unwind_00af942b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af9436 Unwind@00af9436 void Unwind_00af9436(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af9441 Unwind@00af9441 void Unwind_00af9441(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af944c Unwind@00af944c void Unwind_00af944c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af9457 Unwind@00af9457 void Unwind_00af9457(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af9462 Unwind@00af9462 void Unwind_00af9462(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af946d Unwind@00af946d void Unwind_00af946d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af9478 Unwind@00af9478 void Unwind_00af9478(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af9483 Unwind@00af9483 void Unwind_00af9483(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af948e Unwind@00af948e void Unwind_00af948e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af9499 Unwind@00af9499 void Unwind_00af9499(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af94a4 Unwind@00af94a4 void Unwind_00af94a4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af94af Unwind@00af94af void Unwind_00af94af(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af94ba Unwind@00af94ba void Unwind_00af94ba(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af94c5 Unwind@00af94c5 void Unwind_00af94c5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af94d0 Unwind@00af94d0 void Unwind_00af94d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af94db Unwind@00af94db void Unwind_00af94db(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af94e6 Unwind@00af94e6 void Unwind_00af94e6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af94f1 Unwind@00af94f1 void Unwind_00af94f1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af94fc Unwind@00af94fc void Unwind_00af94fc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af9504 Unwind@00af9504 void Unwind_00af9504(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc0)); return; } //@@ 00af950f Unwind@00af950f void Unwind_00af950f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1e0)); return; } //@@ 00af951a Unwind@00af951a void Unwind_00af951a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1c8)); return; } //@@ 00af9525 Unwind@00af9525 void Unwind_00af9525(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1b0)); return; } //@@ 00af9530 Unwind@00af9530 void Unwind_00af9530(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00af953b Unwind@00af953b void Unwind_00af953b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x168)); return; } //@@ 00af9546 Unwind@00af9546 void Unwind_00af9546(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af954e Unwind@00af954e void Unwind_00af954e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9556 Unwind@00af9556 void Unwind_00af9556(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af955e Unwind@00af955e void Unwind_00af955e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9566 Unwind@00af9566 void Unwind_00af9566(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x168)); return; } //@@ 00af9571 Unwind@00af9571 void Unwind_00af9571(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00af957c Unwind@00af957c void Unwind_00af957c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1b0)); return; } //@@ 00af9587 Unwind@00af9587 void Unwind_00af9587(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1c8)); return; } //@@ 00af9592 Unwind@00af9592 void Unwind_00af9592(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1e0)); return; } //@@ 00af959d Unwind@00af959d void Unwind_00af959d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00af95a8 Unwind@00af95a8 void Unwind_00af95a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00af95b3 Unwind@00af95b3 void Unwind_00af95b3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00af95be Unwind@00af95be void Unwind_00af95be(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00af95c9 Unwind@00af95c9 void Unwind_00af95c9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00af95d4 Unwind@00af95d4 void Unwind_00af95d4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00af95df Unwind@00af95df void Unwind_00af95df(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00af95ea Unwind@00af95ea void Unwind_00af95ea(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af95f5 Unwind@00af95f5 void Unwind_00af95f5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af95fd Unwind@00af95fd void Unwind_00af95fd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9605 Unwind@00af9605 void Unwind_00af9605(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x168)); return; } //@@ 00af9610 Unwind@00af9610 void Unwind_00af9610(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00af961b Unwind@00af961b void Unwind_00af961b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1b0)); return; } //@@ 00af9626 Unwind@00af9626 void Unwind_00af9626(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1c8)); return; } //@@ 00af9631 Unwind@00af9631 void Unwind_00af9631(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9639 Unwind@00af9639 void Unwind_00af9639(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9641 Unwind@00af9641 void Unwind_00af9641(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9649 Unwind@00af9649 void Unwind_00af9649(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9651 Unwind@00af9651 void Unwind_00af9651(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9659 Unwind@00af9659 void Unwind_00af9659(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9661 Unwind@00af9661 void Unwind_00af9661(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9669 Unwind@00af9669 void Unwind_00af9669(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9671 Unwind@00af9671 void Unwind_00af9671(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9679 Unwind@00af9679 void Unwind_00af9679(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x168)); return; } //@@ 00af9684 Unwind@00af9684 void Unwind_00af9684(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af968f Unwind@00af968f void Unwind_00af968f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9697 Unwind@00af9697 void Unwind_00af9697(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af969f Unwind@00af969f void Unwind_00af969f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00af96aa Unwind@00af96aa void Unwind_00af96aa(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af96b2 Unwind@00af96b2 void Unwind_00af96b2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af96ba Unwind@00af96ba void Unwind_00af96ba(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af96c2 Unwind@00af96c2 void Unwind_00af96c2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af96ca Unwind@00af96ca void Unwind_00af96ca(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af96d2 Unwind@00af96d2 void Unwind_00af96d2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af96da Unwind@00af96da void Unwind_00af96da(void) { FUN_00436fb0(); return; } //@@ 00af96e5 Unwind@00af96e5 void Unwind_00af96e5(void) { FUN_004242b0(); return; } //@@ 00af96f0 Unwind@00af96f0 void Unwind_00af96f0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x218) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x218) = *(uint *)(unaff_EBP + -0x218) & 0xfffffffe; FUN_004242b0(); return; } //@@ 00af9712 Unwind@00af9712 void Unwind_00af9712(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af971a Unwind@00af971a void Unwind_00af971a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x168)); return; } //@@ 00af9725 Unwind@00af9725 void Unwind_00af9725(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af972d Unwind@00af972d void Unwind_00af972d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00af9738 Unwind@00af9738 void Unwind_00af9738(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9770 Unwind@00af9770 void Unwind_00af9770(void) { thunk_FUN_0042f240(); return; } //@@ 00af97a0 Unwind@00af97a0 void Unwind_00af97a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af97a8 Unwind@00af97a8 void Unwind_00af97a8(void) { FUN_00685cd0(); return; } //@@ 00af97b0 Unwind@00af97b0 void Unwind_00af97b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af97b8 Unwind@00af97b8 void Unwind_00af97b8(void) { FUN_00685cd0(); return; } //@@ 00af97f0 Unwind@00af97f0 void Unwind_00af97f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af97f8 Unwind@00af97f8 void Unwind_00af97f8(void) { FUN_00685cd0(); return; } //@@ 00af9800 Unwind@00af9800 void Unwind_00af9800(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9840 Unwind@00af9840 void Unwind_00af9840(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9880 Unwind@00af9880 void Unwind_00af9880(void) { FUN_006936a0(); return; } //@@ 00af9888 Unwind@00af9888 void Unwind_00af9888(void) { FUN_00694210(); return; } //@@ 00af98c0 Unwind@00af98c0 void Unwind_00af98c0(void) { FUN_00694210(); return; } //@@ 00af98f0 Unwind@00af98f0 void Unwind_00af98f0(void) { FUN_006936a0(); return; } //@@ 00af98f8 Unwind@00af98f8 void Unwind_00af98f8(void) { FUN_00694210(); return; } //@@ 00af9900 Unwind@00af9900 void Unwind_00af9900(void) { FUN_00694210(); return; } //@@ 00af9930 Unwind@00af9930 void Unwind_00af9930(void) { FUN_00415bb0(); return; } //@@ 00af9938 Unwind@00af9938 void Unwind_00af9938(void) { FUN_004164e0(); return; } //@@ 00af9970 Unwind@00af9970 void Unwind_00af9970(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9978 Unwind@00af9978 void Unwind_00af9978(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9980 Unwind@00af9980 void Unwind_00af9980(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9988 Unwind@00af9988 void Unwind_00af9988(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9990 Unwind@00af9990 void Unwind_00af9990(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af9998 Unwind@00af9998 void Unwind_00af9998(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af99a0 Unwind@00af99a0 void Unwind_00af99a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af99a8 Unwind@00af99a8 void Unwind_00af99a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af99b0 Unwind@00af99b0 void Unwind_00af99b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af99b8 Unwind@00af99b8 void Unwind_00af99b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00af99c0 Unwind@00af99c0 void Unwind_00af99c0(void) { std::vector::_Tidy(); return; } //@@ 00af99c8 Unwind@00af99c8 void Unwind_00af99c8(void) { __Init_thread_abort(&DAT_00c80a80); return; } //@@ 00af9a00 Unwind@00af9a00 void Unwind_00af9a00(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00af9a40 Unwind@00af9a40 void Unwind_00af9a40(void) { FUN_00413b40(); return; } //@@ 00af9a4b Unwind@00af9a4b void Unwind_00af9a4b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00af9a53 Unwind@00af9a53 void Unwind_00af9a53(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9a5b Unwind@00af9a5b void Unwind_00af9a5b(void) { int unaff_EBP; EntityConfig_Entity::~EntityConfig_Entity((EntityConfig_Entity *)(unaff_EBP + -0x10210)); return; } //@@ 00af9a66 Unwind@00af9a66 void Unwind_00af9a66(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9a6e Unwind@00af9a6e void Unwind_00af9a6e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9a76 Unwind@00af9a76 void Unwind_00af9a76(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10218) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x10218) = *(uint *)(unaff_EBP + -0x10218) & 0xfffffffd; std::vector::_Tidy(); return; } //@@ 00af9a98 Unwind@00af9a98 void Unwind_00af9a98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9aa0 Unwind@00af9aa0 void Unwind_00af9aa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9aa8 Unwind@00af9aa8 void Unwind_00af9aa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ab0 Unwind@00af9ab0 void Unwind_00af9ab0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ab8 Unwind@00af9ab8 void Unwind_00af9ab8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ac0 Unwind@00af9ac0 void Unwind_00af9ac0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ac8 Unwind@00af9ac8 void Unwind_00af9ac8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ad0 Unwind@00af9ad0 void Unwind_00af9ad0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ad8 Unwind@00af9ad8 void Unwind_00af9ad8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ae0 Unwind@00af9ae0 void Unwind_00af9ae0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9ae8 Unwind@00af9ae8 void Unwind_00af9ae8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9af0 Unwind@00af9af0 void Unwind_00af9af0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9af8 Unwind@00af9af8 void Unwind_00af9af8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9b00 Unwind@00af9b00 void Unwind_00af9b00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9b08 Unwind@00af9b08 void Unwind_00af9b08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9b10 Unwind@00af9b10 void Unwind_00af9b10(void) { std::vector::_Tidy(); return; } //@@ 00af9b1b Unwind@00af9b1b void Unwind_00af9b1b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9b23 Unwind@00af9b23 void Unwind_00af9b23(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10218) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x10218) = *(uint *)(unaff_EBP + -0x10218) & 0xfffffffb; std::vector::_Tidy(); return; } //@@ 00af9b45 Unwind@00af9b45 void Unwind_00af9b45(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9b4d Unwind@00af9b4d void Unwind_00af9b4d(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10218) & 8) == 0) { return; } *(uint *)(unaff_EBP + -0x10218) = *(uint *)(unaff_EBP + -0x10218) & 0xfffffff7; std::vector::_Tidy(); return; } //@@ 00af9b6f Unwind@00af9b6f void Unwind_00af9b6f(void) { FUN_00698b30(); return; } //@@ 00af9b77 Unwind@00af9b77 void Unwind_00af9b77(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9b7f Unwind@00af9b7f void Unwind_00af9b7f(void) { __Init_thread_abort(&DAT_00c80a8c); return; } //@@ 00af9bc0 Unwind@00af9bc0 void Unwind_00af9bc0(void) { FUN_00413b40(); return; } //@@ 00af9bcb Unwind@00af9bcb void Unwind_00af9bcb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af9bd3 Unwind@00af9bd3 void Unwind_00af9bd3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9bdb Unwind@00af9bdb void Unwind_00af9bdb(void) { FUN_006998a0(); return; } //@@ 00af9c20 Unwind@00af9c20 void Unwind_00af9c20(void) { FUN_00413b40(); return; } //@@ 00af9c2b Unwind@00af9c2b void Unwind_00af9c2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00af9c33 Unwind@00af9c33 void Unwind_00af9c33(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00af9c3b Unwind@00af9c3b void Unwind_00af9c3b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00af9c43 Unwind@00af9c43 void Unwind_00af9c43(void) { FUN_0069b7b0(); return; } //@@ 00af9c4e Unwind@00af9c4e void Unwind_00af9c4e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9c56 Unwind@00af9c56 void Unwind_00af9c56(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10238) & 0x4000) == 0) { return; } *(uint *)(unaff_EBP + -0x10238) = *(uint *)(unaff_EBP + -0x10238) & 0xffffbfff; std::vector::_Tidy(); return; } //@@ 00af9c7d Unwind@00af9c7d void Unwind_00af9c7d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9c85 Unwind@00af9c85 void Unwind_00af9c85(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9cc0 Unwind@00af9cc0 void Unwind_00af9cc0(void) { FUN_00413b40(); return; } //@@ 00af9ccb Unwind@00af9ccb void Unwind_00af9ccb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00af9cd3 Unwind@00af9cd3 void Unwind_00af9cd3(void) { FUN_00420b00(); return; } //@@ 00af9cdb Unwind@00af9cdb void Unwind_00af9cdb(void) { FUN_00420b00(); return; } //@@ 00af9ce6 Unwind@00af9ce6 void Unwind_00af9ce6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10114) + 4)); return; } //@@ 00af9cf4 Unwind@00af9cf4 void Unwind_00af9cf4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10114) + 4)); return; } //@@ 00af9d40 Unwind@00af9d40 void Unwind_00af9d40(void) { FUN_00413b40(); return; } //@@ 00af9d4b Unwind@00af9d4b void Unwind_00af9d4b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00af9d53 Unwind@00af9d53 void Unwind_00af9d53(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00af9d5b Unwind@00af9d5b void Unwind_00af9d5b(void) { FUN_0069d1c0(); return; } //@@ 00af9d66 Unwind@00af9d66 void Unwind_00af9d66(void) { FUN_0069d1f0(); return; } //@@ 00af9da0 Unwind@00af9da0 void Unwind_00af9da0(void) { FUN_0069d580(); return; } //@@ 00af9da8 Unwind@00af9da8 void Unwind_00af9da8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00af9db0 Unwind@00af9db0 void Unwind_00af9db0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00af9e10 Unwind@00af9e10 void Unwind_00af9e10(void) { FUN_0041d210(); return; } //@@ 00af9e40 Unwind@00af9e40 void Unwind_00af9e40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x2c) + 4)); return; } //@@ 00af9e70 Unwind@00af9e70 void Unwind_00af9e70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00af9e7b Unwind@00af9e7b void Unwind_00af9e7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1c)); return; } //@@ 00af9e86 Unwind@00af9e86 void Unwind_00af9e86(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x34)); return; } //@@ 00af9e91 Unwind@00af9e91 void Unwind_00af9e91(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x4c)); return; } //@@ 00af9e9c Unwind@00af9e9c void Unwind_00af9e9c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 100)); return; } //@@ 00af9ea7 Unwind@00af9ea7 void Unwind_00af9ea7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x7c)); return; } //@@ 00af9eb2 Unwind@00af9eb2 void Unwind_00af9eb2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x94)); return; } //@@ 00af9ec0 Unwind@00af9ec0 void Unwind_00af9ec0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0xd4)); return; } //@@ 00af9ece Unwind@00af9ece void Unwind_00af9ece(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xf4)); return; } //@@ 00af9f20 Unwind@00af9f20 void Unwind_00af9f20(void) { FUN_0069fd60(); return; } //@@ 00af9fb0 Unwind@00af9fb0 void Unwind_00af9fb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x18) + 0xc)); return; } //@@ 00af9fbb Unwind@00af9fbb void Unwind_00af9fbb(void) { FUN_0069fd40(); return; } //@@ 00af9fc3 Unwind@00af9fc3 void Unwind_00af9fc3(void) { thunk_FUN_0069dbc0(); return; } //@@ 00af9fce Unwind@00af9fce void Unwind_00af9fce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x18) + 0x74)); return; } //@@ 00af9fd9 Unwind@00af9fd9 void Unwind_00af9fd9(void) { FUN_0069fd50(); return; } //@@ 00af9fe1 Unwind@00af9fe1 void Unwind_00af9fe1(void) { thunk_FUN_0069db30(); return; } //@@ 00af9fef Unwind@00af9fef void Unwind_00af9fef(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x18) + 0x98)); return; } //@@ 00af9ffd Unwind@00af9ffd void Unwind_00af9ffd(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00afa00b Unwind@00afa00b void Unwind_00afa00b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x18) + 0xb4)); return; } //@@ 00afa019 Unwind@00afa019 void Unwind_00afa019(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x1c) + 0x10)); return; } //@@ 00afa024 Unwind@00afa024 void Unwind_00afa024(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x1c) + 0x28)); return; } //@@ 00afa02f Unwind@00afa02f void Unwind_00afa02f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x1c) + 0x40)); return; } //@@ 00afa060 Unwind@00afa060 void Unwind_00afa060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x2c)); return; } //@@ 00afa06b Unwind@00afa06b void Unwind_00afa06b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x44)); return; } //@@ 00afa0a0 Unwind@00afa0a0 void Unwind_00afa0a0(void) { FUN_006a0d00(); return; } //@@ 00afa0d0 Unwind@00afa0d0 void Unwind_00afa0d0(void) { FUN_006a0cd0(); return; } //@@ 00afa100 Unwind@00afa100 void Unwind_00afa100(void) { FUN_006a0cc0(); return; } //@@ 00afa130 Unwind@00afa130 void Unwind_00afa130(void) { FUN_0041d210(); return; } //@@ 00afa160 Unwind@00afa160 void Unwind_00afa160(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb0)); return; } //@@ 00afa16b Unwind@00afa16b void Unwind_00afa16b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb0)); return; } //@@ 00afa176 Unwind@00afa176 void Unwind_00afa176(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd8)); return; } //@@ 00afa1b0 Unwind@00afa1b0 void Unwind_00afa1b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afa1b8 Unwind@00afa1b8 void Unwind_00afa1b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa1c0 Unwind@00afa1c0 void Unwind_00afa1c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa1c8 Unwind@00afa1c8 void Unwind_00afa1c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afa200 Unwind@00afa200 void Unwind_00afa200(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x150)); return; } //@@ 00afa20b Unwind@00afa20b void Unwind_00afa20b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00afa216 Unwind@00afa216 void Unwind_00afa216(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00afa221 Unwind@00afa221 void Unwind_00afa221(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0xc0),0x18,5,std::string::_Tidy_deallocate); return; } //@@ 00afa237 Unwind@00afa237 void Unwind_00afa237(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x44),0x18,2,std::string::_Tidy_deallocate); return; } //@@ 00afa24a Unwind@00afa24a void Unwind_00afa24a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00afa255 Unwind@00afa255 void Unwind_00afa255(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00afa260 Unwind@00afa260 void Unwind_00afa260(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00afa26b Unwind@00afa26b void Unwind_00afa26b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00afa276 Unwind@00afa276 void Unwind_00afa276(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00afa281 Unwind@00afa281 void Unwind_00afa281(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00afa28c Unwind@00afa28c void Unwind_00afa28c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x120)); return; } //@@ 00afa297 Unwind@00afa297 void Unwind_00afa297(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00afa2a2 Unwind@00afa2a2 void Unwind_00afa2a2(void) { std::vector::_Tidy(); return; } //@@ 00afa2ad Unwind@00afa2ad void Unwind_00afa2ad(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00afa2b8 Unwind@00afa2b8 void Unwind_00afa2b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00afa2c3 Unwind@00afa2c3 void Unwind_00afa2c3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00afa2ce Unwind@00afa2ce void Unwind_00afa2ce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00afa2d9 Unwind@00afa2d9 void Unwind_00afa2d9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00afa320 Unwind@00afa320 void Unwind_00afa320(void) { FUN_0041d4b0(); return; } //@@ 00afa360 Unwind@00afa360 void Unwind_00afa360(void) { thunk_FUN_0041c7d0(); return; } //@@ 00afa36b Unwind@00afa36b void Unwind_00afa36b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x48)); return; } //@@ 00afa376 Unwind@00afa376 void Unwind_00afa376(void) { std::vector::_Tidy(); return; } //@@ 00afa384 Unwind@00afa384 void Unwind_00afa384(void) { vector_0x3c_tidy(); return; } //@@ 00afa3e0 Unwind@00afa3e0 void Unwind_00afa3e0(void) { FUN_00436fb0(); return; } //@@ 00afa410 Unwind@00afa410 void Unwind_00afa410(void) { FUN_00436fb0(); return; } //@@ 00afa440 Unwind@00afa440 void Unwind_00afa440(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x40),0x198); return; } //@@ 00afa480 Unwind@00afa480 void Unwind_00afa480(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; EntityList_Query::~EntityList_Query(*(void **)(unaff_EBP + 8)); return; } //@@ 00afa4c0 Unwind@00afa4c0 void Unwind_00afa4c0(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x10)); return; } //@@ 00afa4c8 Unwind@00afa4c8 void Unwind_00afa4c8(void) { FUN_007e3230(); return; } //@@ 00afa4d6 Unwind@00afa4d6 void Unwind_00afa4d6(void) { thunk_FUN_0041c7d0(); return; } //@@ 00afa4e4 Unwind@00afa4e4 void Unwind_00afa4e4(void) { FUN_006da7b0(); return; } //@@ 00afa4f2 Unwind@00afa4f2 void Unwind_00afa4f2(void) { FUN_006da7b0(); return; } //@@ 00afa500 Unwind@00afa500 void Unwind_00afa500(void) { FUN_006da7b0(); return; } //@@ 00afa50e Unwind@00afa50e void Unwind_00afa50e(void) { FUN_006da7b0(); return; } //@@ 00afa51c Unwind@00afa51c void Unwind_00afa51c(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0xcd8)); return; } //@@ 00afa570 Unwind@00afa570 void Unwind_00afa570(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afa578 Unwind@00afa578 void Unwind_00afa578(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afa5d0 Unwind@00afa5d0 void Unwind_00afa5d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afa5d8 Unwind@00afa5d8 void Unwind_00afa5d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afa5e3 Unwind@00afa5e3 void Unwind_00afa5e3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa5eb Unwind@00afa5eb void Unwind_00afa5eb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00afa5f6 Unwind@00afa5f6 void Unwind_00afa5f6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa5fe Unwind@00afa5fe void Unwind_00afa5fe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afa606 Unwind@00afa606 void Unwind_00afa606(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xf4) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0xf4) = *(uint *)(unaff_EBP + -0xf4) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa625 Unwind@00afa625 void Unwind_00afa625(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa62d Unwind@00afa62d void Unwind_00afa62d(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xf4) & 8) == 0) { return; } *(uint *)(unaff_EBP + -0xf4) = *(uint *)(unaff_EBP + -0xf4) & 0xfffffff7; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa64c Unwind@00afa64c void Unwind_00afa64c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afa654 Unwind@00afa654 void Unwind_00afa654(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xf4) & 0x20) == 0) { return; } *(uint *)(unaff_EBP + -0xf4) = *(uint *)(unaff_EBP + -0xf4) & 0xffffffdf; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afa6b0 Unwind@00afa6b0 void Unwind_00afa6b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa6b8 Unwind@00afa6b8 void Unwind_00afa6b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa6f0 Unwind@00afa6f0 void Unwind_00afa6f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00afa6fb Unwind@00afa6fb void Unwind_00afa6fb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afa703 Unwind@00afa703 void Unwind_00afa703(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afa70b Unwind@00afa70b void Unwind_00afa70b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa713 Unwind@00afa713 void Unwind_00afa713(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa750 Unwind@00afa750 void Unwind_00afa750(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa758 Unwind@00afa758 void Unwind_00afa758(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afa760 Unwind@00afa760 void Unwind_00afa760(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afa768 Unwind@00afa768 void Unwind_00afa768(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xa4) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xa4) = *(uint *)(unaff_EBP + -0xa4) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa787 Unwind@00afa787 void Unwind_00afa787(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa78f Unwind@00afa78f void Unwind_00afa78f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00afa7d0 Unwind@00afa7d0 void Unwind_00afa7d0(void) { FUN_006998a0(); return; } //@@ 00afa810 Unwind@00afa810 void Unwind_00afa810(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xf8)); return; } //@@ 00afa850 Unwind@00afa850 void Unwind_00afa850(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00afa858 Unwind@00afa858 void Unwind_00afa858(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00afa890 Unwind@00afa890 void Unwind_00afa890(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x58) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x58) = *(uint *)(unaff_EBP + -0x58) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afa8e0 Unwind@00afa8e0 void Unwind_00afa8e0(void) { FUN_006b84c0(); return; } //@@ 00afa920 Unwind@00afa920 void Unwind_00afa920(void) { FUN_006da830(); return; } //@@ 00afa928 Unwind@00afa928 void Unwind_00afa928(void) { FUN_006daab0(); return; } //@@ 00afa960 Unwind@00afa960 void Unwind_00afa960(void) { FUN_006b84c0(); return; } //@@ 00afa990 Unwind@00afa990 void Unwind_00afa990(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x104)); return; } //@@ 00afa9d0 Unwind@00afa9d0 void Unwind_00afa9d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afa9d8 Unwind@00afa9d8 void Unwind_00afa9d8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x294) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x294) = *(uint *)(unaff_EBP + -0x294) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00afa9f7 Unwind@00afa9f7 void Unwind_00afa9f7(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x294) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x294) = *(uint *)(unaff_EBP + -0x294) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afaa16 Unwind@00afaa16 void Unwind_00afaa16(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x294) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x294) = *(uint *)(unaff_EBP + -0x294) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00afaa35 Unwind@00afaa35 void Unwind_00afaa35(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afaa3d Unwind@00afaa3d void Unwind_00afaa3d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afaa45 Unwind@00afaa45 void Unwind_00afaa45(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afaa4d Unwind@00afaa4d void Unwind_00afaa4d(void) { FUN_0041c710(); return; } //@@ 00afaa58 Unwind@00afaa58 void Unwind_00afaa58(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x308)); return; } //@@ 00afaa63 Unwind@00afaa63 void Unwind_00afaa63(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x294) & 0x40) == 0) { return; } *(uint *)(unaff_EBP + -0x294) = *(uint *)(unaff_EBP + -0x294) & 0xffffffbf; guard_check_icall(); return; } //@@ 00afaa85 Unwind@00afaa85 void Unwind_00afaa85(void) { guard_check_icall(); return; } //@@ 00afaa8d Unwind@00afaa8d void Unwind_00afaa8d(void) { guard_check_icall(); return; } //@@ 00afaa95 Unwind@00afaa95 void Unwind_00afaa95(void) { FUN_0041c710(); return; } //@@ 00afaaa0 Unwind@00afaaa0 void Unwind_00afaaa0(void) { FUN_0041c710(); return; } //@@ 00afaaab Unwind@00afaaab void Unwind_00afaaab(void) { __Init_thread_abort(&DAT_00c80e10); return; } //@@ 00afaaf0 Unwind@00afaaf0 void Unwind_00afaaf0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00afab20 Unwind@00afab20 void Unwind_00afab20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afab60 Unwind@00afab60 void Unwind_00afab60(void) { FUN_006b84c0(); return; } //@@ 00afaba0 Unwind@00afaba0 void Unwind_00afaba0(void) { FUN_006b84c0(); return; } //@@ 00afabe0 Unwind@00afabe0 void Unwind_00afabe0(void) { FUN_00436fb0(); return; } //@@ 00afabe8 Unwind@00afabe8 void Unwind_00afabe8(void) { FUN_0041d4b0(); return; } //@@ 00afabf3 Unwind@00afabf3 void Unwind_00afabf3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afabfb Unwind@00afabfb void Unwind_00afabfb(void) { FUN_0041d4b0(); return; } //@@ 00afac40 Unwind@00afac40 void Unwind_00afac40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x98)); return; } //@@ 00afac4b Unwind@00afac4b void Unwind_00afac4b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa8)); return; } //@@ 00afac90 Unwind@00afac90 void Unwind_00afac90(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00aface0 Unwind@00aface0 void Unwind_00aface0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00aface8 Unwind@00aface8 void Unwind_00aface8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c)); return; } //@@ 00afacf0 Unwind@00afacf0 void Unwind_00afacf0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x94)); return; } //@@ 00afad20 Unwind@00afad20 void Unwind_00afad20(void) { FUN_006b84c0(); return; } //@@ 00afad28 Unwind@00afad28 void Unwind_00afad28(void) { FUN_006b84c0(); return; } //@@ 00afad60 Unwind@00afad60 void Unwind_00afad60(void) { FUN_006b84c0(); return; } //@@ 00afad6b Unwind@00afad6b void Unwind_00afad6b(void) { std::vector::_Tidy(); return; } //@@ 00afad73 Unwind@00afad73 void Unwind_00afad73(void) { std::vector::_Tidy(); return; } //@@ 00afad7e Unwind@00afad7e void Unwind_00afad7e(void) { std::vector::_Tidy(); return; } //@@ 00afad86 Unwind@00afad86 void Unwind_00afad86(void) { std::vector::_Tidy(); return; } //@@ 00afad91 Unwind@00afad91 void Unwind_00afad91(void) { std::vector::_Tidy(); return; } //@@ 00afad99 Unwind@00afad99 void Unwind_00afad99(void) { std::vector::_Tidy(); return; } //@@ 00afade0 Unwind@00afade0 void Unwind_00afade0(void) { std::vector::_Tidy(); return; } //@@ 00afade8 Unwind@00afade8 void Unwind_00afade8(void) { std::vector::_Tidy(); return; } //@@ 00afadf3 Unwind@00afadf3 void Unwind_00afadf3(void) { std::vector::_Tidy(); return; } //@@ 00afadfe Unwind@00afadfe void Unwind_00afadfe(void) { std::vector::_Tidy(); return; } //@@ 00afae40 Unwind@00afae40 void Unwind_00afae40(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x10)); return; } //@@ 00afae48 Unwind@00afae48 void Unwind_00afae48(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x410)); return; } //@@ 00afae56 Unwind@00afae56 void Unwind_00afae56(void) { FUN_00579700(); return; } //@@ 00afae64 Unwind@00afae64 void Unwind_00afae64(void) { FUN_00579700(); return; } //@@ 00afae72 Unwind@00afae72 void Unwind_00afae72(void) { FUN_00579700(); return; } //@@ 00afae80 Unwind@00afae80 void Unwind_00afae80(void) { FUN_00579700(); return; } //@@ 00afae8e Unwind@00afae8e void Unwind_00afae8e(void) { FUN_004d7130(); return; } //@@ 00afaee0 Unwind@00afaee0 void Unwind_00afaee0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afaee8 Unwind@00afaee8 void Unwind_00afaee8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00afaef0 Unwind@00afaef0 void Unwind_00afaef0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afaf30 Unwind@00afaf30 void Unwind_00afaf30(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x88)); return; } //@@ 00afaf3b Unwind@00afaf3b void Unwind_00afaf3b(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x78); return; } //@@ 00afaf70 Unwind@00afaf70 void Unwind_00afaf70(void) { FUN_006b84c0(); return; } //@@ 00afafa0 Unwind@00afafa0 void Unwind_00afafa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afafa8 Unwind@00afafa8 void Unwind_00afafa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afafe0 Unwind@00afafe0 void Unwind_00afafe0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afafe8 Unwind@00afafe8 void Unwind_00afafe8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afaff0 Unwind@00afaff0 void Unwind_00afaff0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afaff8 Unwind@00afaff8 void Unwind_00afaff8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afb000 Unwind@00afb000 void Unwind_00afb000(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afb040 Unwind@00afb040 void Unwind_00afb040(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afb080 Unwind@00afb080 void Unwind_00afb080(void) { FUN_004d7130(); return; } //@@ 00afb088 Unwind@00afb088 void Unwind_00afb088(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00afb0c0 Unwind@00afb0c0 void Unwind_00afb0c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afb0c8 Unwind@00afb0c8 void Unwind_00afb0c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x9c)); return; } //@@ 00afb0d3 Unwind@00afb0d3 void Unwind_00afb0d3(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); return; } //@@ 00afb0db Unwind@00afb0db void Unwind_00afb0db(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00afb0e3 Unwind@00afb0e3 void Unwind_00afb0e3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x9c)); return; } //@@ 00afb0ee Unwind@00afb0ee void Unwind_00afb0ee(void) { FUN_0041c710(); return; } //@@ 00afb0f9 Unwind@00afb0f9 void Unwind_00afb0f9(void) { FUN_0041c710(); return; } //@@ 00afb140 Unwind@00afb140 void Unwind_00afb140(void) { __Init_thread_abort(&DAT_00c80e40); return; } //@@ 00afb170 Unwind@00afb170 void Unwind_00afb170(void) { FUN_006b84c0(); return; } //@@ 00afb1b0 Unwind@00afb1b0 void Unwind_00afb1b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00afb1b8 Unwind@00afb1b8 void Unwind_00afb1b8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00afb1f0 Unwind@00afb1f0 void Unwind_00afb1f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00afb1f8 Unwind@00afb1f8 void Unwind_00afb1f8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xe0)); return; } //@@ 00afb203 Unwind@00afb203 void Unwind_00afb203(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x1b8)); return; } //@@ 00afb20e Unwind@00afb20e void Unwind_00afb20e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afb216 Unwind@00afb216 void Unwind_00afb216(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afb21e Unwind@00afb21e void Unwind_00afb21e(void) { FUN_006b84c0(); return; } //@@ 00afb260 Unwind@00afb260 void Unwind_00afb260(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00afb268 Unwind@00afb268 void Unwind_00afb268(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00afb2a0 Unwind@00afb2a0 void Unwind_00afb2a0(void) { FUN_00905e30(); return; } //@@ 00afb2d0 Unwind@00afb2d0 void Unwind_00afb2d0(void) { thunk_FUN_00708f90(); return; } //@@ 00afb2db Unwind@00afb2db void Unwind_00afb2db(void) { std::vector::_Tidy(); return; } //@@ 00afb2e6 Unwind@00afb2e6 void Unwind_00afb2e6(void) { FUN_00424420(); return; } //@@ 00afb2f4 Unwind@00afb2f4 void Unwind_00afb2f4(void) { std::vector::_Tidy(); return; } //@@ 00afb330 Unwind@00afb330 void Unwind_00afb330(void) { int unaff_EBP; _eh_vector_destructor_iterator_(*(void **)(unaff_EBP + -0x10),0xb8,2,RoomDescriptor::destructor); return; } //@@ 00afb370 Unwind@00afb370 void Unwind_00afb370(void) { FUN_0040c440(); return; } //@@ 00afb37b Unwind@00afb37b void Unwind_00afb37b(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x18); return; } //@@ 00afb3b0 Unwind@00afb3b0 void Unwind_00afb3b0(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00afb3e0 Unwind@00afb3e0 void Unwind_00afb3e0(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x10) + 400),0x1c,4,FUN_006eff00); return; } //@@ 00afb3f8 Unwind@00afb3f8 void Unwind_00afb3f8(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x10) + 0x200),0x18,2,FUN_006efb90) ; return; } //@@ 00afb460 Unwind@00afb460 void Unwind_00afb460(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x1c) + 0x14),0xb8,0x20f,RoomDescriptor::destructor); return; } //@@ 00afb47c Unwind@00afb47c void Unwind_00afb47c(void) { FUN_0040c440(); return; } //@@ 00afb48a Unwind@00afb48a void Unwind_00afb48a(void) { std::vector::_Tidy(); return; } //@@ 00afb498 Unwind@00afb498 void Unwind_00afb498(void) { FUN_007383b0(); return; } //@@ 00afb4a0 Unwind@00afb4a0 void Unwind_00afb4a0(void) { int unaff_EBP; _eh_vector_destructor_iterator_ (*(void **)(unaff_EBP + -0x1c),0xc4,0x25,RoomConfig_Stage::game_destructor); return; } //@@ 00afb4b6 Unwind@00afb4b6 void Unwind_00afb4b6(void) { std::vector<28byte_string>::_Tidy(); return; } //@@ 00afb4c4 Unwind@00afb4c4 void Unwind_00afb4c4(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x1c) + 0x1c60),0x1c,0x10,FUN_0069d1f0); return; } //@@ 00afb4dc Unwind@00afb4dc void Unwind_00afb4dc(void) { RoomConfig::~RoomConfig(); return; } //@@ 00afb4ea Unwind@00afb4ea void Unwind_00afb4ea(void) { FUN_006f2040(); return; } //@@ 00afb4f8 Unwind@00afb4f8 void Unwind_00afb4f8(void) { FUN_00732c90(); return; } //@@ 00afb506 Unwind@00afb506 void Unwind_00afb506(void) { FUN_00421880(); return; } //@@ 00afb514 Unwind@00afb514 void Unwind_00afb514(void) { FUN_0041c710(); return; } //@@ 00afb51f Unwind@00afb51f void Unwind_00afb51f(void) { FUN_0041c710(); return; } //@@ 00afb52a Unwind@00afb52a void Unwind_00afb52a(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x38)); return; } //@@ 00afb535 Unwind@00afb535 void Unwind_00afb535(void) { FUN_0082ebb0(); return; } //@@ 00afb543 Unwind@00afb543 void Unwind_00afb543(void) { FUN_00579700(); return; } //@@ 00afb551 Unwind@00afb551 void Unwind_00afb551(void) { RoomTransition::~RoomTransition(); return; } //@@ 00afb55f Unwind@00afb55f void Unwind_00afb55f(void) { PlayerManager::~PlayerManager(); return; } //@@ 00afb56d Unwind@00afb56d void Unwind_00afb56d(void) { FUN_009e94c0(); return; } //@@ 00afb57b Unwind@00afb57b void Unwind_00afb57b(void) { std::vector<104byte>::_Tidy(); return; } //@@ 00afb583 Unwind@00afb583 void Unwind_00afb583(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x20) + 0xc),0x34,0x15,FUN_00425410); return; } //@@ 00afb599 Unwind@00afb599 void Unwind_00afb599(void) { online_stats_destroy(); return; } //@@ 00afb5a7 Unwind@00afb5a7 void Unwind_00afb5a7(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x20) + 8)); return; } //@@ 00afb5b2 Unwind@00afb5b2 void Unwind_00afb5b2(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x20) + 0x11c),0x58,0x30,FUN_009abd50); return; } //@@ 00afb5ca Unwind@00afb5ca void Unwind_00afb5ca(void) { FUN_00579700(); return; } //@@ 00afb5d8 Unwind@00afb5d8 void Unwind_00afb5d8(void) { int unaff_EBP; ItemOverlay::~ItemOverlay((ItemOverlay *)(*(int *)(unaff_EBP + -0x18) + 0x1c034)); return; } //@@ 00afb5e6 Unwind@00afb5e6 void Unwind_00afb5e6(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x20) + 8)); return; } //@@ 00afb5f1 Unwind@00afb5f1 void Unwind_00afb5f1(void) { FUN_00420b20(); return; } //@@ 00afb5ff Unwind@00afb5ff void Unwind_00afb5ff(void) { netplay_player_list_destructor(); return; } //@@ 00afb60d Unwind@00afb60d void Unwind_00afb60d(void) { int unaff_EBP; Leaderboard::~Leaderboard((Leaderboard *)(*(int *)(unaff_EBP + -0x18) + 0x1d650)); return; } //@@ 00afb61b Unwind@00afb61b void Unwind_00afb61b(void) { int unaff_EBP; HUD::destructor((HUD *)(*(int *)(unaff_EBP + -0x18) + 0x1da04)); return; } //@@ 00afb629 Unwind@00afb629 void Unwind_00afb629(void) { PauseScreen::~PauseScreen(); return; } //@@ 00afb637 Unwind@00afb637 void Unwind_00afb637(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x20) + 0x10)); return; } //@@ 00afb642 Unwind@00afb642 void Unwind_00afb642(void) { RevivePlayerMenu::~RevivePlayerMenu(); return; } //@@ 00afb650 Unwind@00afb650 void Unwind_00afb650(void) { int unaff_EBP; OnlineEmotes::destructor((void *)(*(int *)(unaff_EBP + -0x20) + 8)); return; } //@@ 00afb65b Unwind@00afb65b void Unwind_00afb65b(void) { std::vector>::_Tidy(); return; } //@@ 00afb669 Unwind@00afb669 void Unwind_00afb669(void) { int unaff_EBP; SharedPtrPair::~SharedPtrPair((void *)(*(int *)(unaff_EBP + -0x20) + 0x7dc)); return; } //@@ 00afb677 Unwind@00afb677 void Unwind_00afb677(void) { FUN_008d1d20(); return; } //@@ 00afb685 Unwind@00afb685 void Unwind_00afb685(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x20) + 4)); return; } //@@ 00afb690 Unwind@00afb690 void Unwind_00afb690(void) { OnlineStatsScreen::~OnlineStatsScreen(); return; } //@@ 00afb69e Unwind@00afb69e void Unwind_00afb69e(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x20) + 0x18),0x160,2,FUN_0098b130) ; return; } //@@ 00afb6b7 Unwind@00afb6b7 void Unwind_00afb6b7(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x20) + 0x2d8)); return; } //@@ 00afb6c5 Unwind@00afb6c5 void Unwind_00afb6c5(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x20) + 0x3ec)); return; } //@@ 00afb6d3 Unwind@00afb6d3 void Unwind_00afb6d3(void) { int unaff_EBP; Minimap::~Minimap((Minimap *)(*(int *)(unaff_EBP + -0x18) + 0x25ecc)); return; } //@@ 00afb6e1 Unwind@00afb6e1 void Unwind_00afb6e1(void) { FUN_0040c440(); return; } //@@ 00afb6ef Unwind@00afb6ef void Unwind_00afb6ef(void) { FUN_006ef570(); return; } //@@ 00afb6fd Unwind@00afb6fd void Unwind_00afb6fd(void) { FUN_00428ce0(); return; } //@@ 00afb70b Unwind@00afb70b void Unwind_00afb70b(void) { FUN_006f2960(); return; } //@@ 00afb719 Unwind@00afb719 void Unwind_00afb719(void) { FUN_009e5370(); return; } //@@ 00afb727 Unwind@00afb727 void Unwind_00afb727(void) { FUN_005cc630(); return; } //@@ 00afb735 Unwind@00afb735 void Unwind_00afb735(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x268ac)); return; } //@@ 00afb743 Unwind@00afb743 void Unwind_00afb743(void) { std::vector::_Tidy(); return; } //@@ 00afb751 Unwind@00afb751 void Unwind_00afb751(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x18) + 0x269ec),0x20660,2, (_func_void_void_ptr *)&LAB_006f2990); return; } //@@ 00afb76c Unwind@00afb76c void Unwind_00afb76c(void) { thunk_FUN_0042f060(); return; } //@@ 00afb77a Unwind@00afb77a void Unwind_00afb77a(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00afb788 Unwind@00afb788 void Unwind_00afb788(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x20)); return; } //@@ 00afb790 Unwind@00afb790 void Unwind_00afb790(void) { FUN_0041c710(); return; } //@@ 00afb79b Unwind@00afb79b void Unwind_00afb79b(void) { FUN_0041c710(); return; } //@@ 00afb7a6 Unwind@00afb7a6 void Unwind_00afb7a6(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x20) + 0x1c)); return; } //@@ 00afb7b1 Unwind@00afb7b1 void Unwind_00afb7b1(void) { ProceduralItemManager::~ProceduralItemManager(); return; } //@@ 00afb7bf Unwind@00afb7bf void Unwind_00afb7bf(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x18) + 0x6778c),800,7,FUN_006f29a0); return; } //@@ 00afb7da Unwind@00afb7da void Unwind_00afb7da(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x20) + 0x1c)); return; } //@@ 00afb7e5 Unwind@00afb7e5 void Unwind_00afb7e5(void) { thunk_FUN_0042f240(); return; } //@@ 00afb7f0 Unwind@00afb7f0 void Unwind_00afb7f0(void) { FUN_006935a0(); return; } //@@ 00afb7fb Unwind@00afb7fb void Unwind_00afb7fb(void) { FUN_00693580(); return; } //@@ 00afb806 Unwind@00afb806 void Unwind_00afb806(void) { Console::destructor(); return; } //@@ 00afb814 Unwind@00afb814 void Unwind_00afb814(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x20),0x6aac60); return; } //@@ 00afb850 Unwind@00afb850 void Unwind_00afb850(void) { int unaff_EBP; _eh_vector_destructor_iterator_(*(void **)(unaff_EBP + -0x10),0x6dc,8,FUN_006efde0); return; } //@@ 00afb866 Unwind@00afb866 void Unwind_00afb866(void) { FUN_00a1a6f0(); return; } //@@ 00afb874 Unwind@00afb874 void Unwind_00afb874(void) { FUN_00a1a6f0(); return; } //@@ 00afb882 Unwind@00afb882 void Unwind_00afb882(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x3778)); return; } //@@ 00afb890 Unwind@00afb890 void Unwind_00afb890(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x388c)); return; } //@@ 00afb89e Unwind@00afb89e void Unwind_00afb89e(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x39a0)); return; } //@@ 00afb8ac Unwind@00afb8ac void Unwind_00afb8ac(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x3ab4)); return; } //@@ 00afb8ba Unwind@00afb8ba void Unwind_00afb8ba(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x3bc8)); return; } //@@ 00afb8c8 Unwind@00afb8c8 void Unwind_00afb8c8(void) { HUD_Message::~HUD_Message(); return; } //@@ 00afb8d6 Unwind@00afb8d6 void Unwind_00afb8d6(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x3ed0),500,6,HUD_Message::~HUD_Message); return; } //@@ 00afb8f1 Unwind@00afb8f1 void Unwind_00afb8f1(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x4a88),500,4,HUD_Message::~HUD_Message); return; } //@@ 00afb90c Unwind@00afb90c void Unwind_00afb90c(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5258)); return; } //@@ 00afb91a Unwind@00afb91a void Unwind_00afb91a(void) { FUN_0041c710(); return; } //@@ 00afb928 Unwind@00afb928 void Unwind_00afb928(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5374)); return; } //@@ 00afb936 Unwind@00afb936 void Unwind_00afb936(void) { FUN_0040c440(); return; } //@@ 00afb944 Unwind@00afb944 void Unwind_00afb944(void) { FUN_0040c440(); return; } //@@ 00afb952 Unwind@00afb952 void Unwind_00afb952(void) { FUN_0040c440(); return; } //@@ 00afb960 Unwind@00afb960 void Unwind_00afb960(void) { FUN_0040c440(); return; } //@@ 00afb96e Unwind@00afb96e void Unwind_00afb96e(void) { FUN_0040c440(); return; } //@@ 00afb97c Unwind@00afb97c void Unwind_00afb97c(void) { FUN_0040c440(); return; } //@@ 00afb98a Unwind@00afb98a void Unwind_00afb98a(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x54dc)); return; } //@@ 00afb998 Unwind@00afb998 void Unwind_00afb998(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 22000)); return; } //@@ 00afb9a6 Unwind@00afb9a6 void Unwind_00afb9a6(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5704)); return; } //@@ 00afb9b4 Unwind@00afb9b4 void Unwind_00afb9b4(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5818)); return; } //@@ 00afb9c2 Unwind@00afb9c2 void Unwind_00afb9c2(void) { FUN_0040c440(); return; } //@@ 00afb9d0 Unwind@00afb9d0 void Unwind_00afb9d0(void) { int unaff_EBP; ANM2::~ANM2(*(ANM2 **)(unaff_EBP + -0x14)); return; } //@@ 00afb9d8 Unwind@00afb9d8 void Unwind_00afb9d8(void) { FUN_005cc630(); return; } //@@ 00afb9e6 Unwind@00afb9e6 void Unwind_00afb9e6(void) { int unaff_EBP; _eh_vector_destructor_iterator_ (*(void **)(unaff_EBP + -0x14),0x14,2,(_func_void_void_ptr *)&LAB_006f3050); return; } //@@ 00afb9f9 Unwind@00afb9f9 void Unwind_00afb9f9(void) { FUN_006f2c90(); return; } //@@ 00afba07 Unwind@00afba07 void Unwind_00afba07(void) { FUN_0040c440(); return; } //@@ 00afba12 Unwind@00afba12 void Unwind_00afba12(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x10)); return; } //@@ 00afba1d Unwind@00afba1d void Unwind_00afba1d(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x124)); return; } //@@ 00afba2b Unwind@00afba2b void Unwind_00afba2b(void) { int unaff_EBP; SharedPtrPair::~SharedPtrPair((void *)(*(int *)(unaff_EBP + -0x14) + 0x238)); return; } //@@ 00afba39 Unwind@00afba39 void Unwind_00afba39(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x264)); return; } //@@ 00afba47 Unwind@00afba47 void Unwind_00afba47(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x18)); return; } //@@ 00afbaa0 Unwind@00afbaa0 void Unwind_00afbaa0(void) { FUN_006f2ce0(); return; } //@@ 00afbaa8 Unwind@00afbaa8 void Unwind_00afbaa8(void) { FUN_006f2d30(); return; } //@@ 00afbab6 Unwind@00afbab6 void Unwind_00afbab6(void) { FUN_006f2d80(); return; } //@@ 00afbac4 Unwind@00afbac4 void Unwind_00afbac4(void) { FUN_006f2dd0(); return; } //@@ 00afbad2 Unwind@00afbad2 void Unwind_00afbad2(void) { FUN_006f2e20(); return; } //@@ 00afbae0 Unwind@00afbae0 void Unwind_00afbae0(void) { FUN_006f2e70(); return; } //@@ 00afbaee Unwind@00afbaee void Unwind_00afbaee(void) { FUN_006f2ec0(); return; } //@@ 00afbafc Unwind@00afbafc void Unwind_00afbafc(void) { FUN_006f2f10(); return; } //@@ 00afbb0a Unwind@00afbb0a void Unwind_00afbb0a(void) { FUN_006f2f60(); return; } //@@ 00afbb18 Unwind@00afbb18 void Unwind_00afbb18(void) { FUN_006f2fb0(); return; } //@@ 00afbb26 Unwind@00afbb26 void Unwind_00afbb26(void) { FUN_006f3000(); return; } //@@ 00afbb80 Unwind@00afbb80 void Unwind_00afbb80(void) { FUN_0041c710(); return; } //@@ 00afbb88 Unwind@00afbb88 void Unwind_00afbb88(void) { FUN_0041c710(); return; } //@@ 00afbb90 Unwind@00afbb90 void Unwind_00afbb90(void) { FUN_0041c710(); return; } //@@ 00afbb98 Unwind@00afbb98 void Unwind_00afbb98(void) { FUN_0041c710(); return; } //@@ 00afbba0 Unwind@00afbba0 void Unwind_00afbba0(void) { FUN_0041c710(); return; } //@@ 00afbba8 Unwind@00afbba8 void Unwind_00afbba8(void) { FUN_0041c710(); return; } //@@ 00afbbe0 Unwind@00afbbe0 void Unwind_00afbbe0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbbe8 Unwind@00afbbe8 void Unwind_00afbbe8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbbf0 Unwind@00afbbf0 void Unwind_00afbbf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbbf8 Unwind@00afbbf8 void Unwind_00afbbf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afbc00 Unwind@00afbc00 void Unwind_00afbc00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbc08 Unwind@00afbc08 void Unwind_00afbc08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbc10 Unwind@00afbc10 void Unwind_00afbc10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbc18 Unwind@00afbc18 void Unwind_00afbc18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afbc20 Unwind@00afbc20 void Unwind_00afbc20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbc60 Unwind@00afbc60 void Unwind_00afbc60(void) { FUN_0040d480(); return; } //@@ 00afbc6b Unwind@00afbc6b void Unwind_00afbc6b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afbc73 Unwind@00afbc73 void Unwind_00afbc73(void) { FUN_0040d480(); return; } //@@ 00afbc7e Unwind@00afbc7e void Unwind_00afbc7e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afbcc0 Unwind@00afbcc0 void Unwind_00afbcc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbcc8 Unwind@00afbcc8 void Unwind_00afbcc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afbcd0 Unwind@00afbcd0 void Unwind_00afbcd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbcd8 Unwind@00afbcd8 void Unwind_00afbcd8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbce0 Unwind@00afbce0 void Unwind_00afbce0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbce8 Unwind@00afbce8 void Unwind_00afbce8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbcf0 Unwind@00afbcf0 void Unwind_00afbcf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbcf8 Unwind@00afbcf8 void Unwind_00afbcf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afbd00 Unwind@00afbd00 void Unwind_00afbd00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd08 Unwind@00afbd08 void Unwind_00afbd08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbd10 Unwind@00afbd10 void Unwind_00afbd10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd18 Unwind@00afbd18 void Unwind_00afbd18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbd20 Unwind@00afbd20 void Unwind_00afbd20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd28 Unwind@00afbd28 void Unwind_00afbd28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afbd30 Unwind@00afbd30 void Unwind_00afbd30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbd38 Unwind@00afbd38 void Unwind_00afbd38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd40 Unwind@00afbd40 void Unwind_00afbd40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd48 Unwind@00afbd48 void Unwind_00afbd48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd50 Unwind@00afbd50 void Unwind_00afbd50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbd58 Unwind@00afbd58 void Unwind_00afbd58(void) { FUN_0040c440(); return; } //@@ 00afbd90 Unwind@00afbd90 void Unwind_00afbd90(void) { FUN_009e94c0(); return; } //@@ 00afbd98 Unwind@00afbd98 void Unwind_00afbd98(void) { FUN_009e94c0(); return; } //@@ 00afbda3 Unwind@00afbda3 void Unwind_00afbda3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afbdab Unwind@00afbdab void Unwind_00afbdab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afbdb3 Unwind@00afbdb3 void Unwind_00afbdb3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afbdbb Unwind@00afbdbb void Unwind_00afbdbb(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00afbe00 Unwind@00afbe00 void Unwind_00afbe00(void) { FUN_009e94c0(); return; } //@@ 00afbe08 Unwind@00afbe08 void Unwind_00afbe08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afbe10 Unwind@00afbe10 void Unwind_00afbe10(void) { FUN_009e94c0(); return; } //@@ 00afbe1b Unwind@00afbe1b void Unwind_00afbe1b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00afbe23 Unwind@00afbe23 void Unwind_00afbe23(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afbe2b Unwind@00afbe2b void Unwind_00afbe2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00afbe33 Unwind@00afbe33 void Unwind_00afbe33(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00afbe70 Unwind@00afbe70 void Unwind_00afbe70(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x84)); return; } //@@ 00afbe7b Unwind@00afbe7b void Unwind_00afbe7b(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x54),0x3f8); return; } //@@ 00afbe8d Unwind@00afbe8d void Unwind_00afbe8d(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x58),0x3f8); return; } //@@ 00afbe9f Unwind@00afbe9f void Unwind_00afbe9f(void) { FUN_00a28730(); return; } //@@ 00afbea7 Unwind@00afbea7 void Unwind_00afbea7(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x2c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x2c) = *(uint *)(unaff_EBP + -0x2c) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x70)); return; } //@@ 00afbec0 Unwind@00afbec0 void Unwind_00afbec0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x2c) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x2c) = *(uint *)(unaff_EBP + -0x2c) & 0xfffffffd; FUN_008ea350(); return; } //@@ 00afbed9 Unwind@00afbed9 void Unwind_00afbed9(void) { FUN_004242b0(); return; } //@@ 00afbf10 Unwind@00afbf10 void Unwind_00afbf10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbf18 Unwind@00afbf18 void Unwind_00afbf18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbf20 Unwind@00afbf20 void Unwind_00afbf20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbf28 Unwind@00afbf28 void Unwind_00afbf28(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00afbf60 Unwind@00afbf60 void Unwind_00afbf60(void) { FUN_009e94c0(); return; } //@@ 00afbf6b Unwind@00afbf6b void Unwind_00afbf6b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbf73 Unwind@00afbf73 void Unwind_00afbf73(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbf7b Unwind@00afbf7b void Unwind_00afbf7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbfc0 Unwind@00afbfc0 void Unwind_00afbfc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + 0x14)); return; } //@@ 00afbfc8 Unwind@00afbfc8 void Unwind_00afbfc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afbfd0 Unwind@00afbfd0 void Unwind_00afbfd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afbfd8 Unwind@00afbfd8 void Unwind_00afbfd8(void) { __Init_thread_abort(&DAT_00c80e44); return; } //@@ 00afc010 Unwind@00afc010 void Unwind_00afc010(void) { FUN_00a28730(); return; } //@@ 00afc018 Unwind@00afc018 void Unwind_00afc018(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x34)); return; } //@@ 00afc020 Unwind@00afc020 void Unwind_00afc020(void) { FUN_00a28730(); return; } //@@ 00afc028 Unwind@00afc028 void Unwind_00afc028(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x1c)); return; } //@@ 00afc030 Unwind@00afc030 void Unwind_00afc030(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afc038 Unwind@00afc038 void Unwind_00afc038(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afc040 Unwind@00afc040 void Unwind_00afc040(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00afc080 Unwind@00afc080 void Unwind_00afc080(void) { FUN_009e94c0(); return; } //@@ 00afc08b Unwind@00afc08b void Unwind_00afc08b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afc093 Unwind@00afc093 void Unwind_00afc093(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afc09b Unwind@00afc09b void Unwind_00afc09b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afc0e0 Unwind@00afc0e0 void Unwind_00afc0e0(void) { FUN_009e94c0(); return; } //@@ 00afc120 Unwind@00afc120 void Unwind_00afc120(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00afc139 Unwind@00afc139 void Unwind_00afc139(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffd; FUN_008ea350(); return; } //@@ 00afc152 Unwind@00afc152 void Unwind_00afc152(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffb; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00afc16b Unwind@00afc16b void Unwind_00afc16b(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 8) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffff7; FUN_008ea350(); return; } //@@ 00afc1b0 Unwind@00afc1b0 void Unwind_00afc1b0(void) { FUN_0041d4b0(); return; } //@@ 00afc1bb Unwind@00afc1bb void Unwind_00afc1bb(void) { FUN_0041d4b0(); return; } //@@ 00afc1c6 Unwind@00afc1c6 void Unwind_00afc1c6(void) { FUN_0041d4b0(); return; } //@@ 00afc220 Unwind@00afc220 void Unwind_00afc220(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00afc250 Unwind@00afc250 void Unwind_00afc250(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00afc280 Unwind@00afc280 void Unwind_00afc280(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x78)); return; } //@@ 00afc288 Unwind@00afc288 void Unwind_00afc288(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x7c),0x154); return; } //@@ 00afc29a Unwind@00afc29a void Unwind_00afc29a(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x44),0x158); return; } //@@ 00afc2ac Unwind@00afc2ac void Unwind_00afc2ac(void) { FUN_00424420(); return; } //@@ 00afc310 Unwind@00afc310 void Unwind_00afc310(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x88)); return; } //@@ 00afc340 Unwind@00afc340 void Unwind_00afc340(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00afc370 Unwind@00afc370 void Unwind_00afc370(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00afc3a0 Unwind@00afc3a0 void Unwind_00afc3a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x6c)); return; } //@@ 00afc3e0 Unwind@00afc3e0 void Unwind_00afc3e0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x9c)); return; } //@@ 00afc420 Unwind@00afc420 void Unwind_00afc420(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00afc450 Unwind@00afc450 void Unwind_00afc450(void) { std::deque<4byte>::~deque(); return; } //@@ 00afc480 Unwind@00afc480 void Unwind_00afc480(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x40)); return; } //@@ 00afc488 Unwind@00afc488 void Unwind_00afc488(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c)); return; } //@@ 00afc490 Unwind@00afc490 void Unwind_00afc490(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00afc4e0 Unwind@00afc4e0 void Unwind_00afc4e0(void) { FUN_008ea350(); return; } //@@ 00afc510 Unwind@00afc510 void Unwind_00afc510(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x18); return; } //@@ 00afc550 Unwind@00afc550 void Unwind_00afc550(void) { FUN_004d76c0(); return; } //@@ 00afc580 Unwind@00afc580 void Unwind_00afc580(void) { FUN_00428880(); return; } //@@ 00afc5b0 Unwind@00afc5b0 void Unwind_00afc5b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00afc5e0 Unwind@00afc5e0 void Unwind_00afc5e0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00afc5f2 Unwind@00afc5f2 void Unwind_00afc5f2(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x198); return; } //@@ 00afc604 Unwind@00afc604 void Unwind_00afc604(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x404); return; } //@@ 00afc616 Unwind@00afc616 void Unwind_00afc616(void) { int unaff_EBP; GridEntity::~GridEntity(*(GridEntity **)(unaff_EBP + -0x10)); return; } //@@ 00afc61e Unwind@00afc61e void Unwind_00afc61e(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x168)); return; } //@@ 00afc62c Unwind@00afc62c void Unwind_00afc62c(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00afc63e Unwind@00afc63e void Unwind_00afc63e(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afc650 Unwind@00afc650 void Unwind_00afc650(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x19c); return; } //@@ 00afc662 Unwind@00afc662 void Unwind_00afc662(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x390); return; } //@@ 00afc674 Unwind@00afc674 void Unwind_00afc674(void) { int unaff_EBP; GridEntity::~GridEntity(*(GridEntity **)(unaff_EBP + -0x10)); return; } //@@ 00afc67c Unwind@00afc67c void Unwind_00afc67c(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x154)); return; } //@@ 00afc68a Unwind@00afc68a void Unwind_00afc68a(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x270)); return; } //@@ 00afc698 Unwind@00afc698 void Unwind_00afc698(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afc6aa Unwind@00afc6aa void Unwind_00afc6aa(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afc6bc Unwind@00afc6bc void Unwind_00afc6bc(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00afc6ce Unwind@00afc6ce void Unwind_00afc6ce(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afc6e0 Unwind@00afc6e0 void Unwind_00afc6e0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afc6f2 Unwind@00afc6f2 void Unwind_00afc6f2(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00afc704 Unwind@00afc704 void Unwind_00afc704(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00afc716 Unwind@00afc716 void Unwind_00afc716(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x27c); return; } //@@ 00afc728 Unwind@00afc728 void Unwind_00afc728(void) { int unaff_EBP; GridEntity::~GridEntity(*(GridEntity **)(unaff_EBP + -0x10)); return; } //@@ 00afc730 Unwind@00afc730 void Unwind_00afc730(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x158); return; } //@@ 00afc742 Unwind@00afc742 void Unwind_00afc742(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00afc7b0 Unwind@00afc7b0 void Unwind_00afc7b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc7b8 Unwind@00afc7b8 void Unwind_00afc7b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afc7c0 Unwind@00afc7c0 void Unwind_00afc7c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00afc7cb Unwind@00afc7cb void Unwind_00afc7cb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afc7d3 Unwind@00afc7d3 void Unwind_00afc7d3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc7db Unwind@00afc7db void Unwind_00afc7db(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00afc7e6 Unwind@00afc7e6 void Unwind_00afc7e6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00afc7f1 Unwind@00afc7f1 void Unwind_00afc7f1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe8)); return; } //@@ 00afc7fc Unwind@00afc7fc void Unwind_00afc7fc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x100)); return; } //@@ 00afc807 Unwind@00afc807 void Unwind_00afc807(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc80f Unwind@00afc80f void Unwind_00afc80f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc817 Unwind@00afc817 void Unwind_00afc817(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc81f Unwind@00afc81f void Unwind_00afc81f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc827 Unwind@00afc827 void Unwind_00afc827(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc82f Unwind@00afc82f void Unwind_00afc82f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc837 Unwind@00afc837 void Unwind_00afc837(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc83f Unwind@00afc83f void Unwind_00afc83f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc847 Unwind@00afc847 void Unwind_00afc847(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc84f Unwind@00afc84f void Unwind_00afc84f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afc857 Unwind@00afc857 void Unwind_00afc857(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x118)); return; } //@@ 00afc862 Unwind@00afc862 void Unwind_00afc862(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00afc86d Unwind@00afc86d void Unwind_00afc86d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x148)); return; } //@@ 00afc878 Unwind@00afc878 void Unwind_00afc878(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00afc883 Unwind@00afc883 void Unwind_00afc883(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc88e Unwind@00afc88e void Unwind_00afc88e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc899 Unwind@00afc899 void Unwind_00afc899(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc8a1 Unwind@00afc8a1 void Unwind_00afc8a1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc8a9 Unwind@00afc8a9 void Unwind_00afc8a9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc8b4 Unwind@00afc8b4 void Unwind_00afc8b4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc8bc Unwind@00afc8bc void Unwind_00afc8bc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc8c7 Unwind@00afc8c7 void Unwind_00afc8c7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc8d2 Unwind@00afc8d2 void Unwind_00afc8d2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc8da Unwind@00afc8da void Unwind_00afc8da(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc8e5 Unwind@00afc8e5 void Unwind_00afc8e5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc8ed Unwind@00afc8ed void Unwind_00afc8ed(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afc8f5 Unwind@00afc8f5 void Unwind_00afc8f5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc8fd Unwind@00afc8fd void Unwind_00afc8fd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc905 Unwind@00afc905 void Unwind_00afc905(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afc90d Unwind@00afc90d void Unwind_00afc90d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afc918 Unwind@00afc918 void Unwind_00afc918(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00afc960 Unwind@00afc960 void Unwind_00afc960(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00afc990 Unwind@00afc990 void Unwind_00afc990(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afc9d0 Unwind@00afc9d0 void Unwind_00afc9d0(void) { FUN_0040c440(); return; } //@@ 00afc9d8 Unwind@00afc9d8 void Unwind_00afc9d8(void) { FUN_0040c440(); return; } //@@ 00afca10 Unwind@00afca10 void Unwind_00afca10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afca18 Unwind@00afca18 void Unwind_00afca18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afca20 Unwind@00afca20 void Unwind_00afca20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afca28 Unwind@00afca28 void Unwind_00afca28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afca30 Unwind@00afca30 void Unwind_00afca30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afcaa0 Unwind@00afcaa0 void Unwind_00afcaa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00afcaab Unwind@00afcaab void Unwind_00afcaab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00afcab6 Unwind@00afcab6 void Unwind_00afcab6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x168)); return; } //@@ 00afcaf0 Unwind@00afcaf0 void Unwind_00afcaf0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x19c); return; } //@@ 00afcb30 Unwind@00afcb30 void Unwind_00afcb30(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00afcb70 Unwind@00afcb70 void Unwind_00afcb70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcbb0 Unwind@00afcbb0 void Unwind_00afcbb0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x154); return; } //@@ 00afcbf0 Unwind@00afcbf0 void Unwind_00afcbf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcbf8 Unwind@00afcbf8 void Unwind_00afcbf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc30 Unwind@00afcc30 void Unwind_00afcc30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc38 Unwind@00afcc38 void Unwind_00afcc38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc40 Unwind@00afcc40 void Unwind_00afcc40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc48 Unwind@00afcc48 void Unwind_00afcc48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc50 Unwind@00afcc50 void Unwind_00afcc50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc58 Unwind@00afcc58 void Unwind_00afcc58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc60 Unwind@00afcc60 void Unwind_00afcc60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcc68 Unwind@00afcc68 void Unwind_00afcc68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afcc70 Unwind@00afcc70 void Unwind_00afcc70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afcc78 Unwind@00afcc78 void Unwind_00afcc78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afccb0 Unwind@00afccb0 void Unwind_00afccb0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00afccb8 Unwind@00afccb8 void Unwind_00afccb8(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afccf0 Unwind@00afccf0 void Unwind_00afccf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afccf8 Unwind@00afccf8 void Unwind_00afccf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcd00 Unwind@00afcd00 void Unwind_00afcd00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afcd40 Unwind@00afcd40 void Unwind_00afcd40(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00afcd70 Unwind@00afcd70 void Unwind_00afcd70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcd78 Unwind@00afcd78 void Unwind_00afcd78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcd80 Unwind@00afcd80 void Unwind_00afcd80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcd88 Unwind@00afcd88 void Unwind_00afcd88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcd90 Unwind@00afcd90 void Unwind_00afcd90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcd98 Unwind@00afcd98 void Unwind_00afcd98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcda0 Unwind@00afcda0 void Unwind_00afcda0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcda8 Unwind@00afcda8 void Unwind_00afcda8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdb0 Unwind@00afcdb0 void Unwind_00afcdb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdb8 Unwind@00afcdb8 void Unwind_00afcdb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdc0 Unwind@00afcdc0 void Unwind_00afcdc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdc8 Unwind@00afcdc8 void Unwind_00afcdc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdd0 Unwind@00afcdd0 void Unwind_00afcdd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdd8 Unwind@00afcdd8 void Unwind_00afcdd8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcde0 Unwind@00afcde0 void Unwind_00afcde0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcde8 Unwind@00afcde8 void Unwind_00afcde8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdf0 Unwind@00afcdf0 void Unwind_00afcdf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcdf8 Unwind@00afcdf8 void Unwind_00afcdf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce00 Unwind@00afce00 void Unwind_00afce00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce08 Unwind@00afce08 void Unwind_00afce08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce10 Unwind@00afce10 void Unwind_00afce10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce18 Unwind@00afce18 void Unwind_00afce18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce20 Unwind@00afce20 void Unwind_00afce20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce28 Unwind@00afce28 void Unwind_00afce28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce30 Unwind@00afce30 void Unwind_00afce30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce38 Unwind@00afce38 void Unwind_00afce38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce40 Unwind@00afce40 void Unwind_00afce40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce48 Unwind@00afce48 void Unwind_00afce48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce50 Unwind@00afce50 void Unwind_00afce50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce58 Unwind@00afce58 void Unwind_00afce58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce60 Unwind@00afce60 void Unwind_00afce60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce68 Unwind@00afce68 void Unwind_00afce68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce70 Unwind@00afce70 void Unwind_00afce70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afce78 Unwind@00afce78 void Unwind_00afce78(void) { std::vector::_Tidy(); return; } //@@ 00afce80 Unwind@00afce80 void Unwind_00afce80(void) { __Init_thread_abort(&DAT_00c80fc8); return; } //@@ 00afcec0 Unwind@00afcec0 void Unwind_00afcec0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcec8 Unwind@00afcec8 void Unwind_00afcec8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afced0 Unwind@00afced0 void Unwind_00afced0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afced8 Unwind@00afced8 void Unwind_00afced8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcee0 Unwind@00afcee0 void Unwind_00afcee0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcee8 Unwind@00afcee8 void Unwind_00afcee8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcef0 Unwind@00afcef0 void Unwind_00afcef0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcef8 Unwind@00afcef8 void Unwind_00afcef8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf00 Unwind@00afcf00 void Unwind_00afcf00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf08 Unwind@00afcf08 void Unwind_00afcf08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf10 Unwind@00afcf10 void Unwind_00afcf10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf18 Unwind@00afcf18 void Unwind_00afcf18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf20 Unwind@00afcf20 void Unwind_00afcf20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf28 Unwind@00afcf28 void Unwind_00afcf28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afcf30 Unwind@00afcf30 void Unwind_00afcf30(void) { __Init_thread_abort(&DAT_00c80fd4); return; } //@@ 00afcf70 Unwind@00afcf70 void Unwind_00afcf70(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x10)); return; } //@@ 00afcf78 Unwind@00afcf78 void Unwind_00afcf78(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0xc)); return; } //@@ 00afcf83 Unwind@00afcf83 void Unwind_00afcf83(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x18)); return; } //@@ 00afcf8e Unwind@00afcf8e void Unwind_00afcf8e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x24)); return; } //@@ 00afcf99 Unwind@00afcf99 void Unwind_00afcf99(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00afcfa4 Unwind@00afcfa4 void Unwind_00afcfa4(void) { FUN_0069d580(); return; } //@@ 00afcfaf Unwind@00afcfaf void Unwind_00afcfaf(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x44)); return; } //@@ 00afcfba Unwind@00afcfba void Unwind_00afcfba(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x50)); return; } //@@ 00afcfc5 Unwind@00afcfc5 void Unwind_00afcfc5(void) { FUN_00724ea0(); return; } //@@ 00afcfd0 Unwind@00afcfd0 void Unwind_00afcfd0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x104)); return; } //@@ 00afcfde Unwind@00afcfde void Unwind_00afcfde(void) { FUN_00724ec0(); return; } //@@ 00afcfec Unwind@00afcfec void Unwind_00afcfec(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x118)); return; } //@@ 00afcffa Unwind@00afcffa void Unwind_00afcffa(void) { FUN_00724ee0(); return; } //@@ 00afd030 Unwind@00afd030 void Unwind_00afd030(void) { FUN_00413b40(); return; } //@@ 00afd03b Unwind@00afd03b void Unwind_00afd03b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00afd043 Unwind@00afd043 void Unwind_00afd043(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00afd04b Unwind@00afd04b void Unwind_00afd04b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00afd053 Unwind@00afd053 void Unwind_00afd053(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00afd05b Unwind@00afd05b void Unwind_00afd05b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00afd063 Unwind@00afd063 void Unwind_00afd063(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00afd06b Unwind@00afd06b void Unwind_00afd06b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00afd073 Unwind@00afd073 void Unwind_00afd073(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00afd0b0 Unwind@00afd0b0 void Unwind_00afd0b0(void) { FUN_00413b40(); return; } //@@ 00afd0bb Unwind@00afd0bb void Unwind_00afd0bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afd0c3 Unwind@00afd0c3 void Unwind_00afd0c3(void) { FUN_0069d1f0(); return; } //@@ 00afd0ce Unwind@00afd0ce void Unwind_00afd0ce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afd110 Unwind@00afd110 void Unwind_00afd110(void) { FUN_00413b40(); return; } //@@ 00afd11b Unwind@00afd11b void Unwind_00afd11b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afd160 Unwind@00afd160 void Unwind_00afd160(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd168 Unwind@00afd168 void Unwind_00afd168(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x40) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x40) = *(uint *)(unaff_EBP + -0x40) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00afd181 Unwind@00afd181 void Unwind_00afd181(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd189 Unwind@00afd189 void Unwind_00afd189(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x40) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x40) = *(uint *)(unaff_EBP + -0x40) & 0xfffffffd; std::vector::_Tidy(); return; } //@@ 00afd1a2 Unwind@00afd1a2 void Unwind_00afd1a2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd1aa Unwind@00afd1aa void Unwind_00afd1aa(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd1b2 Unwind@00afd1b2 void Unwind_00afd1b2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd1ba Unwind@00afd1ba void Unwind_00afd1ba(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd1c2 Unwind@00afd1c2 void Unwind_00afd1c2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd1ca Unwind@00afd1ca void Unwind_00afd1ca(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd210 Unwind@00afd210 void Unwind_00afd210(void) { FUN_00413b40(); return; } //@@ 00afd21b Unwind@00afd21b void Unwind_00afd21b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd223 Unwind@00afd223 void Unwind_00afd223(void) { FUN_00724ea0(); return; } //@@ 00afd22e Unwind@00afd22e void Unwind_00afd22e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00afd236 Unwind@00afd236 void Unwind_00afd236(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00afd241 Unwind@00afd241 void Unwind_00afd241(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10124),0x198); return; } //@@ 00afd290 Unwind@00afd290 void Unwind_00afd290(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afd2d0 Unwind@00afd2d0 void Unwind_00afd2d0(void) { FUN_00413b40(); return; } //@@ 00afd2db Unwind@00afd2db void Unwind_00afd2db(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00afd2e3 Unwind@00afd2e3 void Unwind_00afd2e3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x158)); return; } //@@ 00afd2ee Unwind@00afd2ee void Unwind_00afd2ee(void) { FUN_0072c8f0(); return; } //@@ 00afd330 Unwind@00afd330 void Unwind_00afd330(void) { FUN_00413b40(); return; } //@@ 00afd370 Unwind@00afd370 void Unwind_00afd370(void) { FUN_00413b40(); return; } //@@ 00afd37b Unwind@00afd37b void Unwind_00afd37b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00afd383 Unwind@00afd383 void Unwind_00afd383(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afd38b Unwind@00afd38b void Unwind_00afd38b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00afd393 Unwind@00afd393 void Unwind_00afd393(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00afd39e Unwind@00afd39e void Unwind_00afd39e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afd3e0 Unwind@00afd3e0 void Unwind_00afd3e0(void) { FUN_00413b40(); return; } //@@ 00afd3eb Unwind@00afd3eb void Unwind_00afd3eb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afd3f3 Unwind@00afd3f3 void Unwind_00afd3f3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd3fb Unwind@00afd3fb void Unwind_00afd3fb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd440 Unwind@00afd440 void Unwind_00afd440(void) { FUN_00413b40(); return; } //@@ 00afd44b Unwind@00afd44b void Unwind_00afd44b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afd453 Unwind@00afd453 void Unwind_00afd453(void) { int unaff_EBP; vector_BombCostume_tidy((void *)(unaff_EBP + -66000)); return; } //@@ 00afd45e Unwind@00afd45e void Unwind_00afd45e(void) { FUN_0072fc90(); return; } //@@ 00afd469 Unwind@00afd469 void Unwind_00afd469(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x108)); return; } //@@ 00afd474 Unwind@00afd474 void Unwind_00afd474(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0xf0),0x18,5,std::string::_Tidy_deallocate); return; } //@@ 00afd48a Unwind@00afd48a void Unwind_00afd48a(void) { FUN_0072fca0(); return; } //@@ 00afd495 Unwind@00afd495 void Unwind_00afd495(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd49d Unwind@00afd49d void Unwind_00afd49d(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1017c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1017c) = *(uint *)(unaff_EBP + -0x1017c) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00afd4bf Unwind@00afd4bf void Unwind_00afd4bf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd4c7 Unwind@00afd4c7 void Unwind_00afd4c7(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1017c) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x1017c) = *(uint *)(unaff_EBP + -0x1017c) & 0xfffffffd; std::vector::_Tidy(); return; } //@@ 00afd520 Unwind@00afd520 void Unwind_00afd520(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x20)); return; } //@@ 00afd570 Unwind@00afd570 void Unwind_00afd570(void) { FUN_00731d50(); return; } //@@ 00afd5a0 Unwind@00afd5a0 void Unwind_00afd5a0(void) { FUN_00415d00(); return; } //@@ 00afd5d0 Unwind@00afd5d0 void Unwind_00afd5d0(void) { FUN_00694210(); return; } //@@ 00afd600 Unwind@00afd600 void Unwind_00afd600(void) { FUN_00694210(); return; } //@@ 00afd630 Unwind@00afd630 void Unwind_00afd630(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x18)); return; } //@@ 00afd660 Unwind@00afd660 void Unwind_00afd660(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); return; } //@@ 00afd690 Unwind@00afd690 void Unwind_00afd690(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x88)); return; } //@@ 00afd69b Unwind@00afd69b void Unwind_00afd69b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x7c)); return; } //@@ 00afd6e0 Unwind@00afd6e0 void Unwind_00afd6e0(void) { FUN_00413b40(); return; } //@@ 00afd6eb Unwind@00afd6eb void Unwind_00afd6eb(void) { FUN_0069d580(); return; } //@@ 00afd6f6 Unwind@00afd6f6 void Unwind_00afd6f6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afd6fe Unwind@00afd6fe void Unwind_00afd6fe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afd706 Unwind@00afd706 void Unwind_00afd706(void) { FUN_00737e50(); return; } //@@ 00afd711 Unwind@00afd711 void Unwind_00afd711(void) { FUN_0069d580(); return; } //@@ 00afd750 Unwind@00afd750 void Unwind_00afd750(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x40)); return; } //@@ 00afd758 Unwind@00afd758 void Unwind_00afd758(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x40)); return; } //@@ 00afd760 Unwind@00afd760 void Unwind_00afd760(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00afd790 Unwind@00afd790 void Unwind_00afd790(void) { std::vector::_Tidy(); return; } //@@ 00afd798 Unwind@00afd798 void Unwind_00afd798(void) { std::vector::_Tidy(); return; } //@@ 00afd7d0 Unwind@00afd7d0 void Unwind_00afd7d0(void) { std::vector::_Tidy(); return; } //@@ 00afd800 Unwind@00afd800 void Unwind_00afd800(void) { FUN_00737e50(); return; } //@@ 00afd830 Unwind@00afd830 void Unwind_00afd830(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x10)); return; } //@@ 00afd860 Unwind@00afd860 void Unwind_00afd860(void) { FUN_0041d210(); return; } //@@ 00afd890 Unwind@00afd890 void Unwind_00afd890(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x7898); return; } //@@ 00afd8d0 Unwind@00afd8d0 void Unwind_00afd8d0(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afd910 Unwind@00afd910 void Unwind_00afd910(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x58) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x58) = *(uint *)(unaff_EBP + -0x58) & 0xfffffffe; FUN_00424420(); return; } //@@ 00afd960 Unwind@00afd960 void Unwind_00afd960(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x104)); return; } //@@ 00afd96b Unwind@00afd96b void Unwind_00afd96b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x114)); return; } //@@ 00afd976 Unwind@00afd976 void Unwind_00afd976(void) { FUN_00424420(); return; } //@@ 00afd981 Unwind@00afd981 void Unwind_00afd981(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x134) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x134) = *(uint *)(unaff_EBP + -0x134) & 0xfffffffe; FUN_00424420(); return; } //@@ 00afd9a3 Unwind@00afd9a3 void Unwind_00afd9a3(void) { std::vector::_Tidy(); return; } //@@ 00afd9ae Unwind@00afd9ae void Unwind_00afd9ae(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x144)); return; } //@@ 00afd9b9 Unwind@00afd9b9 void Unwind_00afd9b9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc4)); return; } //@@ 00afd9c4 Unwind@00afd9c4 void Unwind_00afd9c4(void) { FUN_00424420(); return; } //@@ 00afd9cf Unwind@00afd9cf void Unwind_00afd9cf(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afda10 Unwind@00afda10 void Unwind_00afda10(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xa4)); return; } //@@ 00afda50 Unwind@00afda50 void Unwind_00afda50(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afda80 Unwind@00afda80 void Unwind_00afda80(void) { FUN_00424420(); return; } //@@ 00afda88 Unwind@00afda88 void Unwind_00afda88(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x34)); return; } //@@ 00afda90 Unwind@00afda90 void Unwind_00afda90(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00afdac0 Unwind@00afdac0 void Unwind_00afdac0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00afdaf0 Unwind@00afdaf0 void Unwind_00afdaf0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00afdb20 Unwind@00afdb20 void Unwind_00afdb20(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdb50 Unwind@00afdb50 void Unwind_00afdb50(void) { FUN_00741cc0(); return; } //@@ 00afdb5b Unwind@00afdb5b void Unwind_00afdb5b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x42c)); return; } //@@ 00afdb66 Unwind@00afdb66 void Unwind_00afdb66(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x438)); return; } //@@ 00afdb71 Unwind@00afdb71 void Unwind_00afdb71(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x450)); return; } //@@ 00afdb7c Unwind@00afdb7c void Unwind_00afdb7c(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x444)); return; } //@@ 00afdb87 Unwind@00afdb87 void Unwind_00afdb87(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x45c)); return; } //@@ 00afdb92 Unwind@00afdb92 void Unwind_00afdb92(void) { FUN_00738260(); return; } //@@ 00afdbd0 Unwind@00afdbd0 void Unwind_00afdbd0(void) { int unaff_EBP; vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00afdbd8 Unwind@00afdbd8 void Unwind_00afdbd8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x78)); return; } //@@ 00afdbe0 Unwind@00afdbe0 void Unwind_00afdbe0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afdbe8 Unwind@00afdbe8 void Unwind_00afdbe8(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdbf4 Unwind@00afdbf4 void Unwind_00afdbf4(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc00 Unwind@00afdc00 void Unwind_00afdc00(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc0c Unwind@00afdc0c void Unwind_00afdc0c(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc18 Unwind@00afdc18 void Unwind_00afdc18(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc24 Unwind@00afdc24 void Unwind_00afdc24(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc30 Unwind@00afdc30 void Unwind_00afdc30(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc3c Unwind@00afdc3c void Unwind_00afdc3c(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc48 Unwind@00afdc48 void Unwind_00afdc48(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc54 Unwind@00afdc54 void Unwind_00afdc54(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdc90 Unwind@00afdc90 void Unwind_00afdc90(void) { FUN_00741cc0(); return; } //@@ 00afdc9b Unwind@00afdc9b void Unwind_00afdc9b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x420)); return; } //@@ 00afdca6 Unwind@00afdca6 void Unwind_00afdca6(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x434)); return; } //@@ 00afdcb1 Unwind@00afdcb1 void Unwind_00afdcb1(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x440)); return; } //@@ 00afdcbc Unwind@00afdcbc void Unwind_00afdcbc(void) { FUN_00738260(); return; } //@@ 00afdd00 Unwind@00afdd00 void Unwind_00afdd00(void) { FUN_00741cc0(); return; } //@@ 00afdd0b Unwind@00afdd0b void Unwind_00afdd0b(void) { FUN_00741cc0(); return; } //@@ 00afdd16 Unwind@00afdd16 void Unwind_00afdd16(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd22 Unwind@00afdd22 void Unwind_00afdd22(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd2e Unwind@00afdd2e void Unwind_00afdd2e(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd3a Unwind@00afdd3a void Unwind_00afdd3a(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd46 Unwind@00afdd46 void Unwind_00afdd46(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd52 Unwind@00afdd52 void Unwind_00afdd52(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd5e Unwind@00afdd5e void Unwind_00afdd5e(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd6a Unwind@00afdd6a void Unwind_00afdd6a(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd76 Unwind@00afdd76 void Unwind_00afdd76(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afdd82 Unwind@00afdd82 void Unwind_00afdd82(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afddc0 Unwind@00afddc0 void Unwind_00afddc0(void) { FUN_00424420(); return; } //@@ 00afddc8 Unwind@00afddc8 void Unwind_00afddc8(void) { std::deque<4byte>::~deque(); return; } //@@ 00afde00 Unwind@00afde00 void Unwind_00afde00(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afde30 Unwind@00afde30 void Unwind_00afde30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afde38 Unwind@00afde38 void Unwind_00afde38(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x78) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x78) = *(uint *)(unaff_EBP + -0x78) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00afde80 Unwind@00afde80 void Unwind_00afde80(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x3c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x3c) = *(uint *)(unaff_EBP + -0x3c) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x40)); return; } //@@ 00afded0 Unwind@00afded0 void Unwind_00afded0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afded8 Unwind@00afded8 void Unwind_00afded8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afdf10 Unwind@00afdf10 void Unwind_00afdf10(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00afdf40 Unwind@00afdf40 void Unwind_00afdf40(void) { int unaff_EBP; RoomDescriptor::destructor((RoomDescriptor *)(unaff_EBP + -200)); return; } //@@ 00afdf4b Unwind@00afdf4b void Unwind_00afdf4b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xd8)); return; } //@@ 00afdf90 Unwind@00afdf90 void Unwind_00afdf90(void) { thunk_FUN_00708f90(); return; } //@@ 00afdf9b Unwind@00afdf9b void Unwind_00afdf9b(void) { std::vector::_Tidy(); return; } //@@ 00afdfa6 Unwind@00afdfa6 void Unwind_00afdfa6(void) { FUN_007530c0(); return; } //@@ 00afdfae Unwind@00afdfae void Unwind_00afdfae(void) { FUN_00424420(); return; } //@@ 00afdfe0 Unwind@00afdfe0 void Unwind_00afdfe0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x28) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x28) = *(uint *)(unaff_EBP + -0x28) & 0xfffffffe; FUN_00424420(); return; } //@@ 00afe020 Unwind@00afe020 void Unwind_00afe020(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe02c Unwind@00afe02c void Unwind_00afe02c(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe060 Unwind@00afe060 void Unwind_00afe060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afe0a0 Unwind@00afe0a0 void Unwind_00afe0a0(void) { FUN_00741cc0(); return; } //@@ 00afe0ab Unwind@00afe0ab void Unwind_00afe0ab(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0b7 Unwind@00afe0b7 void Unwind_00afe0b7(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0c3 Unwind@00afe0c3 void Unwind_00afe0c3(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0cf Unwind@00afe0cf void Unwind_00afe0cf(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0db Unwind@00afe0db void Unwind_00afe0db(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0e7 Unwind@00afe0e7 void Unwind_00afe0e7(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0f3 Unwind@00afe0f3 void Unwind_00afe0f3(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe0ff Unwind@00afe0ff void Unwind_00afe0ff(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe10b Unwind@00afe10b void Unwind_00afe10b(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe117 Unwind@00afe117 void Unwind_00afe117(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe123 Unwind@00afe123 void Unwind_00afe123(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe12f Unwind@00afe12f void Unwind_00afe12f(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe13b Unwind@00afe13b void Unwind_00afe13b(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe147 Unwind@00afe147 void Unwind_00afe147(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe190 Unwind@00afe190 void Unwind_00afe190(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe1c0 Unwind@00afe1c0 void Unwind_00afe1c0(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe200 Unwind@00afe200 void Unwind_00afe200(void) { FUN_00738260(); return; } //@@ 00afe240 Unwind@00afe240 void Unwind_00afe240(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe280 Unwind@00afe280 void Unwind_00afe280(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe2b0 Unwind@00afe2b0 void Unwind_00afe2b0(void) { FUN_00424420(); return; } //@@ 00afe2e0 Unwind@00afe2e0 void Unwind_00afe2e0(void) { FUN_00741cc0(); return; } //@@ 00afe2eb Unwind@00afe2eb void Unwind_00afe2eb(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe2f7 Unwind@00afe2f7 void Unwind_00afe2f7(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe303 Unwind@00afe303 void Unwind_00afe303(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe30f Unwind@00afe30f void Unwind_00afe30f(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe31b Unwind@00afe31b void Unwind_00afe31b(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe327 Unwind@00afe327 void Unwind_00afe327(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe333 Unwind@00afe333 void Unwind_00afe333(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe33f Unwind@00afe33f void Unwind_00afe33f(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe380 Unwind@00afe380 void Unwind_00afe380(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x48)); return; } //@@ 00afe3b0 Unwind@00afe3b0 void Unwind_00afe3b0(void) { FUN_00738260(); return; } //@@ 00afe3f0 Unwind@00afe3f0 void Unwind_00afe3f0(void) { FUN_00741cc0(); return; } //@@ 00afe430 Unwind@00afe430 void Unwind_00afe430(void) { FUN_00741cc0(); return; } //@@ 00afe43b Unwind@00afe43b void Unwind_00afe43b(void) { FUN_00738260(); return; } //@@ 00afe446 Unwind@00afe446 void Unwind_00afe446(void) { FUN_007530c0(); return; } //@@ 00afe451 Unwind@00afe451 void Unwind_00afe451(void) { FUN_00738260(); return; } //@@ 00afe459 Unwind@00afe459 void Unwind_00afe459(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x470)); return; } //@@ 00afe4a0 Unwind@00afe4a0 void Unwind_00afe4a0(void) { FUN_007530c0(); return; } //@@ 00afe4d0 Unwind@00afe4d0 void Unwind_00afe4d0(void) { FUN_00741cc0(); return; } //@@ 00afe4db Unwind@00afe4db void Unwind_00afe4db(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe4e7 Unwind@00afe4e7 void Unwind_00afe4e7(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe4f3 Unwind@00afe4f3 void Unwind_00afe4f3(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe4ff Unwind@00afe4ff void Unwind_00afe4ff(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe50b Unwind@00afe50b void Unwind_00afe50b(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe517 Unwind@00afe517 void Unwind_00afe517(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe523 Unwind@00afe523 void Unwind_00afe523(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe52f Unwind@00afe52f void Unwind_00afe52f(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe53b Unwind@00afe53b void Unwind_00afe53b(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe547 Unwind@00afe547 void Unwind_00afe547(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe553 Unwind@00afe553 void Unwind_00afe553(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe55f Unwind@00afe55f void Unwind_00afe55f(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00afe5a0 Unwind@00afe5a0 void Unwind_00afe5a0(void) { FUN_00741cc0(); return; } //@@ 00afe5ab Unwind@00afe5ab void Unwind_00afe5ab(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x48c)); return; } //@@ 00afe5b6 Unwind@00afe5b6 void Unwind_00afe5b6(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x498)); return; } //@@ 00afe5c1 Unwind@00afe5c1 void Unwind_00afe5c1(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x468)); return; } //@@ 00afe5cc Unwind@00afe5cc void Unwind_00afe5cc(void) { FUN_00738260(); return; } //@@ 00afe5d4 Unwind@00afe5d4 void Unwind_00afe5d4(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x498)); return; } //@@ 00afe5df Unwind@00afe5df void Unwind_00afe5df(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x90)); return; } //@@ 00afe620 Unwind@00afe620 void Unwind_00afe620(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1c) = *(uint *)(unaff_EBP + -0x1c) & 0xfffffffe; FUN_00424420(); return; } //@@ 00afe660 Unwind@00afe660 void Unwind_00afe660(void) { FUN_007528f0(); return; } //@@ 00afe6b0 Unwind@00afe6b0 void Unwind_00afe6b0(void) { FUN_007530b0(); return; } //@@ 00afe6e0 Unwind@00afe6e0 void Unwind_00afe6e0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1c) = *(uint *)(unaff_EBP + -0x1c) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + 8)); return; } //@@ 00afe720 Unwind@00afe720 void Unwind_00afe720(void) { thunk_FUN_00708f90(); return; } //@@ 00afe72b Unwind@00afe72b void Unwind_00afe72b(void) { std::vector::_Tidy(); return; } //@@ 00afe760 Unwind@00afe760 void Unwind_00afe760(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x14)); return; } //@@ 00afe768 Unwind@00afe768 void Unwind_00afe768(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x41c)); return; } //@@ 00afe776 Unwind@00afe776 void Unwind_00afe776(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x530)); return; } //@@ 00afe784 Unwind@00afe784 void Unwind_00afe784(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x644)); return; } //@@ 00afe792 Unwind@00afe792 void Unwind_00afe792(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x14) + 0x758),0x114,7,ANM2::~ANM2) ; return; } //@@ 00afe7ad Unwind@00afe7ad void Unwind_00afe7ad(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0xee4)); return; } //@@ 00afe7bb Unwind@00afe7bb void Unwind_00afe7bb(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0xff8)); return; } //@@ 00afe7c9 Unwind@00afe7c9 void Unwind_00afe7c9(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x110c)); return; } //@@ 00afe7d7 Unwind@00afe7d7 void Unwind_00afe7d7(void) { FUN_007dc7c0(); return; } //@@ 00afe7e5 Unwind@00afe7e5 void Unwind_00afe7e5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x14) + 0x1320)); return; } //@@ 00afe7f3 Unwind@00afe7f3 void Unwind_00afe7f3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x14) + 0x139c)); return; } //@@ 00afe801 Unwind@00afe801 void Unwind_00afe801(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x14) + 0x13c4)); return; } //@@ 00afe80f Unwind@00afe80f void Unwind_00afe80f(void) { FUN_004bfd20(); return; } //@@ 00afe81d Unwind@00afe81d void Unwind_00afe81d(void) { FUN_006da7b0(); return; } //@@ 00afe82b Unwind@00afe82b void Unwind_00afe82b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x16c8)); return; } //@@ 00afe839 Unwind@00afe839 void Unwind_00afe839(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x16d4)); return; } //@@ 00afe847 Unwind@00afe847 void Unwind_00afe847(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x173c)); return; } //@@ 00afe855 Unwind@00afe855 void Unwind_00afe855(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x1748)); return; } //@@ 00afe863 Unwind@00afe863 void Unwind_00afe863(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x1754)); return; } //@@ 00afe871 Unwind@00afe871 void Unwind_00afe871(void) { std::vector::_Tidy(); return; } //@@ 00afe87f Unwind@00afe87f void Unwind_00afe87f(void) { FUN_004b3950(); return; } //@@ 00afe88d Unwind@00afe88d void Unwind_00afe88d(void) { FUN_004b3950(); return; } //@@ 00afe89b Unwind@00afe89b void Unwind_00afe89b(void) { FUN_004b3950(); return; } //@@ 00afe8a9 Unwind@00afe8a9 void Unwind_00afe8a9(void) { FUN_004b3950(); return; } //@@ 00afe8b7 Unwind@00afe8b7 void Unwind_00afe8b7(void) { sprite_member_at_0xc_destroy(); return; } //@@ 00afe8c5 Unwind@00afe8c5 void Unwind_00afe8c5(void) { sprite_member_at_0xc_destroy(); return; } //@@ 00afe8d3 Unwind@00afe8d3 void Unwind_00afe8d3(void) { std::vector::_Tidy(); return; } //@@ 00afe8e1 Unwind@00afe8e1 void Unwind_00afe8e1(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x1ddc)); return; } //@@ 00afe8ef Unwind@00afe8ef void Unwind_00afe8ef(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00afe8fd Unwind@00afe8fd void Unwind_00afe8fd(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x1e40)); return; } //@@ 00afe90b Unwind@00afe90b void Unwind_00afe90b(void) { FUN_008ea350(); return; } //@@ 00afe919 Unwind@00afe919 void Unwind_00afe919(void) { FUN_007dc720(); return; } //@@ 00afe927 Unwind@00afe927 void Unwind_00afe927(void) { FUN_00579700(); return; } //@@ 00afe935 Unwind@00afe935 void Unwind_00afe935(void) { FUN_00579700(); return; } //@@ 00afe943 Unwind@00afe943 void Unwind_00afe943(void) { FUN_006da7b0(); return; } //@@ 00afe951 Unwind@00afe951 void Unwind_00afe951(void) { FUN_00436fb0(); return; } //@@ 00afe95f Unwind@00afe95f void Unwind_00afe95f(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x1fa4)); return; } //@@ 00afe96d Unwind@00afe96d void Unwind_00afe96d(void) { FUN_00436fb0(); return; } //@@ 00afe97b Unwind@00afe97b void Unwind_00afe97b(void) { FUN_009e0390(); return; } //@@ 00afe989 Unwind@00afe989 void Unwind_00afe989(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x2010)); return; } //@@ 00afe997 Unwind@00afe997 void Unwind_00afe997(void) { FUN_0040c440(); return; } //@@ 00afe9a5 Unwind@00afe9a5 void Unwind_00afe9a5(void) { std::vector<52byte>::_Tidy(); return; } //@@ 00afe9b3 Unwind@00afe9b3 void Unwind_00afe9b3(void) { FUN_007dc660(); return; } //@@ 00afe9c1 Unwind@00afe9c1 void Unwind_00afe9c1(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x20dc)); return; } //@@ 00afe9cf Unwind@00afe9cf void Unwind_00afe9cf(void) { int unaff_EBP; GameStatePlayer::~GameStatePlayer((GameStatePlayer *)(*(int *)(unaff_EBP + -0x14) + 0x20ec)); return; } //@@ 00afea00 Unwind@00afea00 void Unwind_00afea00(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x168)); return; } //@@ 00afea0e Unwind@00afea0e void Unwind_00afea0e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x174)); return; } //@@ 00afea1c Unwind@00afea1c void Unwind_00afea1c(void) { std::vector::_Tidy(); return; } //@@ 00afea2a Unwind@00afea2a void Unwind_00afea2a(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x194)); return; } //@@ 00afea38 Unwind@00afea38 void Unwind_00afea38(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x1a0)); return; } //@@ 00afea46 Unwind@00afea46 void Unwind_00afea46(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x1ac)); return; } //@@ 00afea54 Unwind@00afea54 void Unwind_00afea54(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x1b8)); return; } //@@ 00afea62 Unwind@00afea62 void Unwind_00afea62(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x1c4)); return; } //@@ 00afea70 Unwind@00afea70 void Unwind_00afea70(void) { std::vector::_Tidy(); return; } //@@ 00afea7e Unwind@00afea7e void Unwind_00afea7e(void) { std::vector::_Tidy(); return; } //@@ 00afea8c Unwind@00afea8c void Unwind_00afea8c(void) { std::vector<52byte>::_Tidy(); return; } //@@ 00afea9a Unwind@00afea9a void Unwind_00afea9a(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00afeaa8 Unwind@00afeaa8 void Unwind_00afeaa8(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00afeab6 Unwind@00afeab6 void Unwind_00afeab6(void) { FUN_004b3950(); return; } //@@ 00afeac4 Unwind@00afeac4 void Unwind_00afeac4(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x424)); return; } //@@ 00afead2 Unwind@00afead2 void Unwind_00afead2(void) { FUN_006da7b0(); return; } //@@ 00afeae0 Unwind@00afeae0 void Unwind_00afeae0(void) { FUN_007dcd30(); return; } //@@ 00afeaee Unwind@00afeaee void Unwind_00afeaee(void) { FUN_007dcd30(); return; } //@@ 00afeafc Unwind@00afeafc void Unwind_00afeafc(void) { FUN_007dcd30(); return; } //@@ 00afeb0a Unwind@00afeb0a void Unwind_00afeb0a(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x500)); return; } //@@ 00afeb18 Unwind@00afeb18 void Unwind_00afeb18(void) { FUN_004b3950(); return; } //@@ 00afeb26 Unwind@00afeb26 void Unwind_00afeb26(void) { std::vector<52byte>::_Tidy(); return; } //@@ 00afeb80 Unwind@00afeb80 void Unwind_00afeb80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00afeb88 Unwind@00afeb88 void Unwind_00afeb88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00afeb90 Unwind@00afeb90 void Unwind_00afeb90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00afeb98 Unwind@00afeb98 void Unwind_00afeb98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afeba0 Unwind@00afeba0 void Unwind_00afeba0(void) { FUN_0040c440(); return; } //@@ 00afebe0 Unwind@00afebe0 void Unwind_00afebe0(void) { std::deque<4byte>::~deque(); return; } //@@ 00afec10 Unwind@00afec10 void Unwind_00afec10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afec18 Unwind@00afec18 void Unwind_00afec18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afec50 Unwind@00afec50 void Unwind_00afec50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afec58 Unwind@00afec58 void Unwind_00afec58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afec90 Unwind@00afec90 void Unwind_00afec90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afec98 Unwind@00afec98 void Unwind_00afec98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afeca0 Unwind@00afeca0 void Unwind_00afeca0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afece0 Unwind@00afece0 void Unwind_00afece0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x38) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x38) = *(uint *)(unaff_EBP + -0x38) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afed30 Unwind@00afed30 void Unwind_00afed30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afed38 Unwind@00afed38 void Unwind_00afed38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00afed43 Unwind@00afed43 void Unwind_00afed43(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afed4b Unwind@00afed4b void Unwind_00afed4b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afed53 Unwind@00afed53 void Unwind_00afed53(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afed5b Unwind@00afed5b void Unwind_00afed5b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afeda0 Unwind@00afeda0 void Unwind_00afeda0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xdc) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xdc) = *(uint *)(unaff_EBP + -0xdc) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0xec)); return; } //@@ 00afedc2 Unwind@00afedc2 void Unwind_00afedc2(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xdc) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0xdc) = *(uint *)(unaff_EBP + -0xdc) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00afede4 Unwind@00afede4 void Unwind_00afede4(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xdc) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0xdc) = *(uint *)(unaff_EBP + -0xdc) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afee03 Unwind@00afee03 void Unwind_00afee03(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd4)); return; } //@@ 00afee0e Unwind@00afee0e void Unwind_00afee0e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afee16 Unwind@00afee16 void Unwind_00afee16(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00afee21 Unwind@00afee21 void Unwind_00afee21(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afee29 Unwind@00afee29 void Unwind_00afee29(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00afee34 Unwind@00afee34 void Unwind_00afee34(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afee3c Unwind@00afee3c void Unwind_00afee3c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afee44 Unwind@00afee44 void Unwind_00afee44(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd4)); return; } //@@ 00afee4f Unwind@00afee4f void Unwind_00afee4f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00afee5a Unwind@00afee5a void Unwind_00afee5a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00afee62 Unwind@00afee62 void Unwind_00afee62(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00afee6a Unwind@00afee6a void Unwind_00afee6a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00afeeb0 Unwind@00afeeb0 void Unwind_00afeeb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afeeb8 Unwind@00afeeb8 void Unwind_00afeeb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afeec0 Unwind@00afeec0 void Unwind_00afeec0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afeec8 Unwind@00afeec8 void Unwind_00afeec8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afeed0 Unwind@00afeed0 void Unwind_00afeed0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afeed8 Unwind@00afeed8 void Unwind_00afeed8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afeee0 Unwind@00afeee0 void Unwind_00afeee0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00afeee8 Unwind@00afeee8 void Unwind_00afeee8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00afef20 Unwind@00afef20 void Unwind_00afef20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00afef28 Unwind@00afef28 void Unwind_00afef28(void) { FUN_005cc630(); return; } //@@ 00afef33 Unwind@00afef33 void Unwind_00afef33(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00afef70 Unwind@00afef70 void Unwind_00afef70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afefb0 Unwind@00afefb0 void Unwind_00afefb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00afefbb Unwind@00afefbb void Unwind_00afefbb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1b0)); return; } //@@ 00afefc6 Unwind@00afefc6 void Unwind_00afefc6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x198)); return; } //@@ 00afefd1 Unwind@00afefd1 void Unwind_00afefd1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00afefdc Unwind@00afefdc void Unwind_00afefdc(void) { FUN_0069d1f0(); return; } //@@ 00afefe7 Unwind@00afefe7 void Unwind_00afefe7(void) { int unaff_EBP; ItemConfig_Item::~ItemConfig_Item((ItemConfig_Item *)(unaff_EBP + -0x1b8)); return; } //@@ 00afeff2 Unwind@00afeff2 void Unwind_00afeff2(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -500)); return; } //@@ 00afeffd Unwind@00afeffd void Unwind_00afeffd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00aff008 Unwind@00aff008 void Unwind_00aff008(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20c)); return; } //@@ 00aff050 Unwind@00aff050 void Unwind_00aff050(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2c)); return; } //@@ 00aff080 Unwind@00aff080 void Unwind_00aff080(void) { guard_check_icall(); return; } //@@ 00aff08b Unwind@00aff08b void Unwind_00aff08b(void) { guard_check_icall(); return; } //@@ 00aff096 Unwind@00aff096 void Unwind_00aff096(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c4)); return; } //@@ 00aff0a1 Unwind@00aff0a1 void Unwind_00aff0a1(void) { guard_check_icall(); return; } //@@ 00aff0ac Unwind@00aff0ac void Unwind_00aff0ac(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x4b0),0xc,2,FID_conflict__Tidy); return; } //@@ 00aff0c2 Unwind@00aff0c2 void Unwind_00aff0c2(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5d4)); return; } //@@ 00aff100 Unwind@00aff100 void Unwind_00aff100(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff140 Unwind@00aff140 void Unwind_00aff140(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00aff148 Unwind@00aff148 void Unwind_00aff148(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00aff180 Unwind@00aff180 void Unwind_00aff180(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00aff188 Unwind@00aff188 void Unwind_00aff188(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff190 Unwind@00aff190 void Unwind_00aff190(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00aff198 Unwind@00aff198 void Unwind_00aff198(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff1d0 Unwind@00aff1d0 void Unwind_00aff1d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00aff1d8 Unwind@00aff1d8 void Unwind_00aff1d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00aff1e0 Unwind@00aff1e0 void Unwind_00aff1e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff1e8 Unwind@00aff1e8 void Unwind_00aff1e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff1f0 Unwind@00aff1f0 void Unwind_00aff1f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00aff1fb Unwind@00aff1fb void Unwind_00aff1fb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00aff203 Unwind@00aff203 void Unwind_00aff203(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00aff20b Unwind@00aff20b void Unwind_00aff20b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff213 Unwind@00aff213 void Unwind_00aff213(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff21b Unwind@00aff21b void Unwind_00aff21b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00aff226 Unwind@00aff226 void Unwind_00aff226(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00aff22e Unwind@00aff22e void Unwind_00aff22e(void) { std::vector::_Tidy(); return; } //@@ 00aff236 Unwind@00aff236 void Unwind_00aff236(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00aff23e Unwind@00aff23e void Unwind_00aff23e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x34)); return; } //@@ 00aff246 Unwind@00aff246 void Unwind_00aff246(void) { guard_check_icall(); return; } //@@ 00aff251 Unwind@00aff251 void Unwind_00aff251(void) { __Init_thread_abort(&DAT_00c8114c); return; } //@@ 00aff25d Unwind@00aff25d void Unwind_00aff25d(void) { __Init_thread_abort(&DAT_00c8117c); return; } //@@ 00aff269 Unwind@00aff269 void Unwind_00aff269(void) { __Init_thread_abort(&DAT_00c811ac); return; } //@@ 00aff2b0 Unwind@00aff2b0 void Unwind_00aff2b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff2b8 Unwind@00aff2b8 void Unwind_00aff2b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff2c0 Unwind@00aff2c0 void Unwind_00aff2c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff2c8 Unwind@00aff2c8 void Unwind_00aff2c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff2d0 Unwind@00aff2d0 void Unwind_00aff2d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff2d8 Unwind@00aff2d8 void Unwind_00aff2d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff2e0 Unwind@00aff2e0 void Unwind_00aff2e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00aff320 Unwind@00aff320 void Unwind_00aff320(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb4)); return; } //@@ 00aff32b Unwind@00aff32b void Unwind_00aff32b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x84)); return; } //@@ 00aff336 Unwind@00aff336 void Unwind_00aff336(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00aff33e Unwind@00aff33e void Unwind_00aff33e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff346 Unwind@00aff346 void Unwind_00aff346(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x9c)); return; } //@@ 00aff351 Unwind@00aff351 void Unwind_00aff351(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x7c)); return; } //@@ 00aff359 Unwind@00aff359 void Unwind_00aff359(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x9c)); return; } //@@ 00aff364 Unwind@00aff364 void Unwind_00aff364(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xcc)); return; } //@@ 00aff36f Unwind@00aff36f void Unwind_00aff36f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe4)); return; } //@@ 00aff37a Unwind@00aff37a void Unwind_00aff37a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xfc)); return; } //@@ 00aff385 Unwind@00aff385 void Unwind_00aff385(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff38d Unwind@00aff38d void Unwind_00aff38d(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x294) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x294) = *(uint *)(unaff_EBP + -0x294) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff3ac Unwind@00aff3ac void Unwind_00aff3ac(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff3b4 Unwind@00aff3b4 void Unwind_00aff3b4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00aff3bc Unwind@00aff3bc void Unwind_00aff3bc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x9c)); return; } //@@ 00aff3c7 Unwind@00aff3c7 void Unwind_00aff3c7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x114)); return; } //@@ 00aff410 Unwind@00aff410 void Unwind_00aff410(void) { FUN_007dc660(); return; } //@@ 00aff41b Unwind@00aff41b void Unwind_00aff41b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00aff423 Unwind@00aff423 void Unwind_00aff423(void) { FUN_004242b0(); return; } //@@ 00aff42e Unwind@00aff42e void Unwind_00aff42e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x198)); return; } //@@ 00aff439 Unwind@00aff439 void Unwind_00aff439(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00aff441 Unwind@00aff441 void Unwind_00aff441(void) { FUN_00424420(); return; } //@@ 00aff44c Unwind@00aff44c void Unwind_00aff44c(void) { FUN_00424420(); return; } //@@ 00aff457 Unwind@00aff457 void Unwind_00aff457(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x150) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x150) = *(uint *)(unaff_EBP + -0x150) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff476 Unwind@00aff476 void Unwind_00aff476(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00aff47e Unwind@00aff47e void Unwind_00aff47e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff486 Unwind@00aff486 void Unwind_00aff486(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff48e Unwind@00aff48e void Unwind_00aff48e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff496 Unwind@00aff496 void Unwind_00aff496(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff49e Unwind@00aff49e void Unwind_00aff49e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff4a6 Unwind@00aff4a6 void Unwind_00aff4a6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff4ae Unwind@00aff4ae void Unwind_00aff4ae(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff4b6 Unwind@00aff4b6 void Unwind_00aff4b6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff4be Unwind@00aff4be void Unwind_00aff4be(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x150) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x150) = *(uint *)(unaff_EBP + -0x150) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff4dd Unwind@00aff4dd void Unwind_00aff4dd(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x150) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x150) = *(uint *)(unaff_EBP + -0x150) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff4fc Unwind@00aff4fc void Unwind_00aff4fc(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x150) & 8) == 0) { return; } *(uint *)(unaff_EBP + -0x150) = *(uint *)(unaff_EBP + -0x150) & 0xfffffff7; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff51b Unwind@00aff51b void Unwind_00aff51b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00aff523 Unwind@00aff523 void Unwind_00aff523(void) { __Init_thread_abort(&DAT_00c811c8); return; } //@@ 00aff560 Unwind@00aff560 void Unwind_00aff560(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff568 Unwind@00aff568 void Unwind_00aff568(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff570 Unwind@00aff570 void Unwind_00aff570(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff578 Unwind@00aff578 void Unwind_00aff578(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00aff5b0 Unwind@00aff5b0 void Unwind_00aff5b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x6c)); return; } //@@ 00aff5b8 Unwind@00aff5b8 void Unwind_00aff5b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00aff5c0 Unwind@00aff5c0 void Unwind_00aff5c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff5c8 Unwind@00aff5c8 void Unwind_00aff5c8(void) { FUN_0041d4b0(); return; } //@@ 00aff5d0 Unwind@00aff5d0 void Unwind_00aff5d0(void) { __Init_thread_abort(&DAT_00c811f8); return; } //@@ 00aff610 Unwind@00aff610 void Unwind_00aff610(void) { FUN_0041d4b0(); return; } //@@ 00aff650 Unwind@00aff650 void Unwind_00aff650(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff658 Unwind@00aff658 void Unwind_00aff658(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00aff690 Unwind@00aff690 void Unwind_00aff690(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x80)); return; } //@@ 00aff698 Unwind@00aff698 void Unwind_00aff698(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x98)); return; } //@@ 00aff6a3 Unwind@00aff6a3 void Unwind_00aff6a3(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x84)); return; } //@@ 00aff6e0 Unwind@00aff6e0 void Unwind_00aff6e0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd4)); return; } //@@ 00aff720 Unwind@00aff720 void Unwind_00aff720(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xae8)); return; } //@@ 00aff72b Unwind@00aff72b void Unwind_00aff72b(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa88)); return; } //@@ 00aff736 Unwind@00aff736 void Unwind_00aff736(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xb84)); return; } //@@ 00aff741 Unwind@00aff741 void Unwind_00aff741(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd14)); return; } //@@ 00aff74c Unwind@00aff74c void Unwind_00aff74c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd24)); return; } //@@ 00aff757 Unwind@00aff757 void Unwind_00aff757(void) { guard_check_icall(); return; } //@@ 00aff75f Unwind@00aff75f void Unwind_00aff75f(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc84)); return; } //@@ 00aff76a Unwind@00aff76a void Unwind_00aff76a(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc94)); return; } //@@ 00aff775 Unwind@00aff775 void Unwind_00aff775(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd04)); return; } //@@ 00aff780 Unwind@00aff780 void Unwind_00aff780(void) { guard_check_icall(); return; } //@@ 00aff78b Unwind@00aff78b void Unwind_00aff78b(void) { guard_check_icall(); return; } //@@ 00aff796 Unwind@00aff796 void Unwind_00aff796(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xca4)); return; } //@@ 00aff7a1 Unwind@00aff7a1 void Unwind_00aff7a1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xcb4)); return; } //@@ 00aff7ac Unwind@00aff7ac void Unwind_00aff7ac(void) { std::vector::_Tidy(); return; } //@@ 00aff7b7 Unwind@00aff7b7 void Unwind_00aff7b7(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xcc4)); return; } //@@ 00aff7c2 Unwind@00aff7c2 void Unwind_00aff7c2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -200)); return; } //@@ 00aff7cd Unwind@00aff7cd void Unwind_00aff7cd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00aff7d8 Unwind@00aff7d8 void Unwind_00aff7d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00aff7e3 Unwind@00aff7e3 void Unwind_00aff7e3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00aff7eb Unwind@00aff7eb void Unwind_00aff7eb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1b8)); return; } //@@ 00aff7f6 Unwind@00aff7f6 void Unwind_00aff7f6(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xcd4)); return; } //@@ 00aff801 Unwind@00aff801 void Unwind_00aff801(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xce4)); return; } //@@ 00aff80c Unwind@00aff80c void Unwind_00aff80c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xcf4)); return; } //@@ 00aff817 Unwind@00aff817 void Unwind_00aff817(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc74)); return; } //@@ 00aff822 Unwind@00aff822 void Unwind_00aff822(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc2c)); return; } //@@ 00aff82d Unwind@00aff82d void Unwind_00aff82d(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xa3c)); return; } //@@ 00aff838 Unwind@00aff838 void Unwind_00aff838(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x128)); return; } //@@ 00aff843 Unwind@00aff843 void Unwind_00aff843(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x110)); return; } //@@ 00aff84e Unwind@00aff84e void Unwind_00aff84e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf8)); return; } //@@ 00aff859 Unwind@00aff859 void Unwind_00aff859(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe0)); return; } //@@ 00aff864 Unwind@00aff864 void Unwind_00aff864(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00aff86c Unwind@00aff86c void Unwind_00aff86c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xacc)); return; } //@@ 00aff877 Unwind@00aff877 void Unwind_00aff877(void) { __Init_thread_abort(&DAT_00c8120c); return; } //@@ 00aff883 Unwind@00aff883 void Unwind_00aff883(void) { __Init_thread_abort(&DAT_00c8123c); return; } //@@ 00aff88f Unwind@00aff88f void Unwind_00aff88f(void) { __Init_thread_abort(&DAT_00c8126c); return; } //@@ 00aff8f0 Unwind@00aff8f0 void Unwind_00aff8f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00aff930 Unwind@00aff930 void Unwind_00aff930(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00aff960 Unwind@00aff960 void Unwind_00aff960(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x70)); return; } //@@ 00aff968 Unwind@00aff968 void Unwind_00aff968(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xc0)); return; } //@@ 00aff9b0 Unwind@00aff9b0 void Unwind_00aff9b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00aff9e0 Unwind@00aff9e0 void Unwind_00aff9e0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x88)); return; } //@@ 00aff9eb Unwind@00aff9eb void Unwind_00aff9eb(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xd4)); return; } //@@ 00aff9f6 Unwind@00aff9f6 void Unwind_00aff9f6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00affa30 Unwind@00affa30 void Unwind_00affa30(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00affa38 Unwind@00affa38 void Unwind_00affa38(void) { std::vector::_Tidy(); return; } //@@ 00affa40 Unwind@00affa40 void Unwind_00affa40(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00affa48 Unwind@00affa48 void Unwind_00affa48(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00affa80 Unwind@00affa80 void Unwind_00affa80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affa88 Unwind@00affa88 void Unwind_00affa88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affa90 Unwind@00affa90 void Unwind_00affa90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affa98 Unwind@00affa98 void Unwind_00affa98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affaa0 Unwind@00affaa0 void Unwind_00affaa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affaa8 Unwind@00affaa8 void Unwind_00affaa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affb10 Unwind@00affb10 void Unwind_00affb10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00affb18 Unwind@00affb18 void Unwind_00affb18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affb70 Unwind@00affb70 void Unwind_00affb70(void) { std::vector::_Tidy(); return; } //@@ 00affb78 Unwind@00affb78 void Unwind_00affb78(void) { std::vector::_Tidy(); return; } //@@ 00affb80 Unwind@00affb80 void Unwind_00affb80(void) { std::vector::_Tidy(); return; } //@@ 00affbb0 Unwind@00affbb0 void Unwind_00affbb0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x58),0x2f00); return; } //@@ 00affbf0 Unwind@00affbf0 void Unwind_00affbf0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00affc30 Unwind@00affc30 void Unwind_00affc30(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x54)); return; } //@@ 00affc38 Unwind@00affc38 void Unwind_00affc38(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00affc40 Unwind@00affc40 void Unwind_00affc40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x24)); return; } //@@ 00affc80 Unwind@00affc80 void Unwind_00affc80(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x338)); return; } //@@ 00affc8b Unwind@00affc8b void Unwind_00affc8b(void) { guard_check_icall(); return; } //@@ 00affc96 Unwind@00affc96 void Unwind_00affc96(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x414)); return; } //@@ 00affca1 Unwind@00affca1 void Unwind_00affca1(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3ac)); return; } //@@ 00affcac Unwind@00affcac void Unwind_00affcac(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x324)); return; } //@@ 00affcb7 Unwind@00affcb7 void Unwind_00affcb7(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x424)); return; } //@@ 00affcc2 Unwind@00affcc2 void Unwind_00affcc2(void) { guard_check_icall(); return; } //@@ 00affccd Unwind@00affccd void Unwind_00affccd(void) { guard_check_icall(); return; } //@@ 00affcd8 Unwind@00affcd8 void Unwind_00affcd8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x324)); return; } //@@ 00affce3 Unwind@00affce3 void Unwind_00affce3(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x434)); return; } //@@ 00affcee Unwind@00affcee void Unwind_00affcee(void) { guard_check_icall(); return; } //@@ 00affcf9 Unwind@00affcf9 void Unwind_00affcf9(void) { guard_check_icall(); return; } //@@ 00affd04 Unwind@00affd04 void Unwind_00affd04(void) { guard_check_icall(); return; } //@@ 00affd0f Unwind@00affd0f void Unwind_00affd0f(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x3c4)); return; } //@@ 00affd1a Unwind@00affd1a void Unwind_00affd1a(void) { std::vector::_Tidy(); return; } //@@ 00affd25 Unwind@00affd25 void Unwind_00affd25(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x208)); return; } //@@ 00affd30 Unwind@00affd30 void Unwind_00affd30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x240)); return; } //@@ 00affd3b Unwind@00affd3b void Unwind_00affd3b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x34c)); return; } //@@ 00affd46 Unwind@00affd46 void Unwind_00affd46(void) { guard_check_icall(); return; } //@@ 00affd80 Unwind@00affd80 void Unwind_00affd80(void) { FUN_0041c710(); return; } //@@ 00affd88 Unwind@00affd88 void Unwind_00affd88(void) { FUN_0041c710(); return; } //@@ 00affd90 Unwind@00affd90 void Unwind_00affd90(void) { FUN_0041c710(); return; } //@@ 00affdd0 Unwind@00affdd0 void Unwind_00affdd0(void) { FUN_004242b0(); return; } //@@ 00affe00 Unwind@00affe00 void Unwind_00affe00(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x90)); return; } //@@ 00affe40 Unwind@00affe40 void Unwind_00affe40(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x54),0x2f00); return; } //@@ 00affe52 Unwind@00affe52 void Unwind_00affe52(void) { __Init_thread_abort(&DAT_00c812ac); return; } //@@ 00affe90 Unwind@00affe90 void Unwind_00affe90(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x80)); return; } //@@ 00affe98 Unwind@00affe98 void Unwind_00affe98(void) { FUN_004242b0(); return; } //@@ 00affea3 Unwind@00affea3 void Unwind_00affea3(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x80)); return; } //@@ 00affee0 Unwind@00affee0 void Unwind_00affee0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00affee8 Unwind@00affee8 void Unwind_00affee8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00affef0 Unwind@00affef0 void Unwind_00affef0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00afff30 Unwind@00afff30 void Unwind_00afff30(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00afff60 Unwind@00afff60 void Unwind_00afff60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf4)); return; } //@@ 00afff6b Unwind@00afff6b void Unwind_00afff6b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10c)); return; } //@@ 00afff76 Unwind@00afff76 void Unwind_00afff76(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x214)); return; } //@@ 00afff81 Unwind@00afff81 void Unwind_00afff81(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x214)); return; } //@@ 00afff8c Unwind@00afff8c void Unwind_00afff8c(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x214)); return; } //@@ 00afffd0 Unwind@00afffd0 void Unwind_00afffd0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00b00000 Unwind@00b00000 void Unwind_00b00000(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b00008 Unwind@00b00008 void Unwind_00b00008(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b00010 Unwind@00b00010 void Unwind_00b00010(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b00018 Unwind@00b00018 void Unwind_00b00018(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b00050 Unwind@00b00050 void Unwind_00b00050(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b00080 Unwind@00b00080 void Unwind_00b00080(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b000c0 Unwind@00b000c0 void Unwind_00b000c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b000c8 Unwind@00b000c8 void Unwind_00b000c8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x74)); return; } //@@ 00b00100 Unwind@00b00100 void Unwind_00b00100(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x40),0x2f00); return; } //@@ 00b00170 Unwind@00b00170 void Unwind_00b00170(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b001a0 Unwind@00b001a0 void Unwind_00b001a0(void) { FUN_00424420(); return; } //@@ 00b001a8 Unwind@00b001a8 void Unwind_00b001a8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x48)); return; } //@@ 00b001b0 Unwind@00b001b0 void Unwind_00b001b0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x54)); return; } //@@ 00b001e0 Unwind@00b001e0 void Unwind_00b001e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b001e8 Unwind@00b001e8 void Unwind_00b001e8(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x30),0x2f00); return; } //@@ 00b00230 Unwind@00b00230 void Unwind_00b00230(void) { FUN_0041d4b0(); return; } //@@ 00b00260 Unwind@00b00260 void Unwind_00b00260(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00b00268 Unwind@00b00268 void Unwind_00b00268(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b00270 Unwind@00b00270 void Unwind_00b00270(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b002b0 Unwind@00b002b0 void Unwind_00b002b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x4c)); return; } //@@ 00b002f0 Unwind@00b002f0 void Unwind_00b002f0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00b002f8 Unwind@00b002f8 void Unwind_00b002f8(void) { FUN_007e3230(); return; } //@@ 00b00340 Unwind@00b00340 void Unwind_00b00340(void) { std::vector::_Tidy(); return; } //@@ 00b00380 Unwind@00b00380 void Unwind_00b00380(void) { std::vector::_Tidy(); return; } //@@ 00b00388 Unwind@00b00388 void Unwind_00b00388(void) { std::vector::_Tidy(); return; } //@@ 00b00390 Unwind@00b00390 void Unwind_00b00390(void) { std::vector::_Tidy(); return; } //@@ 00b003c0 Unwind@00b003c0 void Unwind_00b003c0(void) { FUN_00436fb0(); return; } //@@ 00b003c8 Unwind@00b003c8 void Unwind_00b003c8(void) { FUN_00424420(); return; } //@@ 00b00400 Unwind@00b00400 void Unwind_00b00400(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00b00450 Unwind@00b00450 void Unwind_00b00450(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00b00480 Unwind@00b00480 void Unwind_00b00480(void) { FUN_00436fb0(); return; } //@@ 00b00488 Unwind@00b00488 void Unwind_00b00488(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00b004c0 Unwind@00b004c0 void Unwind_00b004c0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00b004c8 Unwind@00b004c8 void Unwind_00b004c8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b00500 Unwind@00b00500 void Unwind_00b00500(void) { std::vector::_Tidy(); return; } //@@ 00b00508 Unwind@00b00508 void Unwind_00b00508(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x84)); return; } //@@ 00b00550 Unwind@00b00550 void Unwind_00b00550(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00b00558 Unwind@00b00558 void Unwind_00b00558(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00b00590 Unwind@00b00590 void Unwind_00b00590(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00b005c0 Unwind@00b005c0 void Unwind_00b005c0(void) { FUN_007dcd80(); return; } //@@ 00b005c8 Unwind@00b005c8 void Unwind_00b005c8(void) { FUN_007325d0(); return; } //@@ 00b005d0 Unwind@00b005d0 void Unwind_00b005d0(void) { FUN_00722c90(); return; } //@@ 00b005d8 Unwind@00b005d8 void Unwind_00b005d8(void) { FUN_007df1d0(); return; } //@@ 00b005e0 Unwind@00b005e0 void Unwind_00b005e0(void) { FUN_007325c0(); return; } //@@ 00b005e8 Unwind@00b005e8 void Unwind_00b005e8(void) { thunk_FUN_007311e0(); return; } //@@ 00b005f3 Unwind@00b005f3 void Unwind_00b005f3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x28) + 0x84)); return; } //@@ 00b00650 Unwind@00b00650 void Unwind_00b00650(void) { FUN_007de190(); return; } //@@ 00b006e0 Unwind@00b006e0 void Unwind_00b006e0(void) { FUN_007df130(); return; } //@@ 00b00710 Unwind@00b00710 void Unwind_00b00710(void) { FUN_00428880(); return; } //@@ 00b00760 Unwind@00b00760 void Unwind_00b00760(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x20)); return; } //@@ 00b0076b Unwind@00b0076b void Unwind_00b0076b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x38)); return; } //@@ 00b007a0 Unwind@00b007a0 void Unwind_00b007a0(void) { thunk_FUN_00a2ab40(); return; } //@@ 00b007f0 Unwind@00b007f0 void Unwind_00b007f0(void) { FUN_00413b40(); return; } //@@ 00b007fb Unwind@00b007fb void Unwind_00b007fb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b00803 Unwind@00b00803 void Unwind_00b00803(void) { FUN_007e1410(); return; } //@@ 00b0080e Unwind@00b0080e void Unwind_00b0080e(void) { FUN_007e2630(); return; } //@@ 00b00819 Unwind@00b00819 void Unwind_00b00819(void) { FUN_007e1430(); return; } //@@ 00b00824 Unwind@00b00824 void Unwind_00b00824(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0082c Unwind@00b0082c void Unwind_00b0082c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b00834 Unwind@00b00834 void Unwind_00b00834(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0083c Unwind@00b0083c void Unwind_00b0083c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b00844 Unwind@00b00844 void Unwind_00b00844(void) { FUN_007e1430(); return; } //@@ 00b0084f Unwind@00b0084f void Unwind_00b0084f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b00857 Unwind@00b00857 void Unwind_00b00857(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0085f Unwind@00b0085f void Unwind_00b0085f(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x10230) * 0x34; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x10234),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b008d0 Unwind@00b008d0 void Unwind_00b008d0(void) { FUN_007e2740(); return; } //@@ 00b00900 Unwind@00b00900 void Unwind_00b00900(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x28)); return; } //@@ 00b00930 Unwind@00b00930 void Unwind_00b00930(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00b0093b Unwind@00b0093b void Unwind_00b0093b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1c)); return; } //@@ 00b00990 Unwind@00b00990 void Unwind_00b00990(void) { FUN_007e4890(); return; } //@@ 00b0099b Unwind@00b0099b void Unwind_00b0099b(void) { std::vector::_Tidy(); return; } //@@ 00b009a3 Unwind@00b009a3 void Unwind_00b009a3(void) { FUN_007e3190(); return; } //@@ 00b009ae Unwind@00b009ae void Unwind_00b009ae(void) { FUN_007e3190(); return; } //@@ 00b009b9 Unwind@00b009b9 void Unwind_00b009b9(void) { FUN_007e3190(); return; } //@@ 00b009c4 Unwind@00b009c4 void Unwind_00b009c4(void) { FUN_007e3190(); return; } //@@ 00b009cf Unwind@00b009cf void Unwind_00b009cf(void) { FUN_007e3190(); return; } //@@ 00b00a10 Unwind@00b00a10 void Unwind_00b00a10(void) { FUN_00428880(); return; } //@@ 00b00a40 Unwind@00b00a40 void Unwind_00b00a40(void) { FUN_007e4890(); return; } //@@ 00b00a4b Unwind@00b00a4b void Unwind_00b00a4b(void) { FUN_007e3190(); return; } //@@ 00b00a56 Unwind@00b00a56 void Unwind_00b00a56(void) { FUN_007e3190(); return; } //@@ 00b00a61 Unwind@00b00a61 void Unwind_00b00a61(void) { FUN_007e3190(); return; } //@@ 00b00aa0 Unwind@00b00aa0 void Unwind_00b00aa0(void) { FUN_007e4890(); return; } //@@ 00b00aab Unwind@00b00aab void Unwind_00b00aab(void) { FUN_007e3190(); return; } //@@ 00b00ab6 Unwind@00b00ab6 void Unwind_00b00ab6(void) { FUN_007e3190(); return; } //@@ 00b00ac1 Unwind@00b00ac1 void Unwind_00b00ac1(void) { FUN_007e3190(); return; } //@@ 00b00b00 Unwind@00b00b00 void Unwind_00b00b00(void) { FUN_007e3190(); return; } //@@ 00b00b08 Unwind@00b00b08 void Unwind_00b00b08(void) { FUN_007e3190(); return; } //@@ 00b00b40 Unwind@00b00b40 void Unwind_00b00b40(void) { FUN_007e3190(); return; } //@@ 00b00b48 Unwind@00b00b48 void Unwind_00b00b48(void) { FUN_007e3190(); return; } //@@ 00b00ba0 Unwind@00b00ba0 void Unwind_00b00ba0(void) { FUN_007e3190(); return; } //@@ 00b00bd0 Unwind@00b00bd0 void Unwind_00b00bd0(void) { FUN_007e3190(); return; } //@@ 00b00c00 Unwind@00b00c00 void Unwind_00b00c00(void) { FUN_00417e50(); return; } //@@ 00b00c0e Unwind@00b00c0e void Unwind_00b00c0e(void) { std::vector::_Tidy(); return; } //@@ 00b00c19 Unwind@00b00c19 void Unwind_00b00c19(void) { std::vector<44byte>::_Tidy(); return; } //@@ 00b00c24 Unwind@00b00c24 void Unwind_00b00c24(void) { image_ref_vector_holder_destroy(); return; } //@@ 00b00c2f Unwind@00b00c2f void Unwind_00b00c2f(void) { FXLayers::destructor(); return; } //@@ 00b00c3d Unwind@00b00c3d void Unwind_00b00c3d(void) { FUN_00579700(); return; } //@@ 00b00c4b Unwind@00b00c4b void Unwind_00b00c4b(void) { Backdrop::destructor(); return; } //@@ 00b00c59 Unwind@00b00c59 void Unwind_00b00c59(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x4c) + 0x6e40)); return; } //@@ 00b00c67 Unwind@00b00c67 void Unwind_00b00c67(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x4c) + 0x6f54)); return; } //@@ 00b00c75 Unwind@00b00c75 void Unwind_00b00c75(void) { FUN_006da7b0(); return; } //@@ 00b00c83 Unwind@00b00c83 void Unwind_00b00c83(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x4c) + 0x7100)); return; } //@@ 00b00c91 Unwind@00b00c91 void Unwind_00b00c91(void) { FUN_00424420(); return; } //@@ 00b00c9f Unwind@00b00c9f void Unwind_00b00c9f(void) { FUN_00827f30(); return; } //@@ 00b00cad Unwind@00b00cad void Unwind_00b00cad(void) { FUN_00424420(); return; } //@@ 00b00cbb Unwind@00b00cbb void Unwind_00b00cbb(void) { FUN_004bfd20(); return; } //@@ 00b00cc9 Unwind@00b00cc9 void Unwind_00b00cc9(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x4c) + 0x7328),8,10,FUN_00424420); return; } //@@ 00b00ce1 Unwind@00b00ce1 void Unwind_00b00ce1(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x4c) + 0x7378),0xc,10,FID_conflict__Tidy); return; } //@@ 00b00cf9 Unwind@00b00cf9 void Unwind_00b00cf9(void) { anm2_member_at_1c4_destroy(); return; } //@@ 00b00d07 Unwind@00b00d07 void Unwind_00b00d07(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x4c) + 0x7744),4,8,FUN_00579700); return; } //@@ 00b00d1f Unwind@00b00d1f void Unwind_00b00d1f(void) { sprite_member_at_0x4_destroy(); return; } //@@ 00b00d2d Unwind@00b00d2d void Unwind_00b00d2d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b00d35 Unwind@00b00d35 void Unwind_00b00d35(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b00db0 Unwind@00b00db0 void Unwind_00b00db0(void) { FUN_0041c710(); return; } //@@ 00b00db8 Unwind@00b00db8 void Unwind_00b00db8(void) { FUN_0041c710(); return; } //@@ 00b00dc0 Unwind@00b00dc0 void Unwind_00b00dc0(void) { FUN_0040c440(); return; } //@@ 00b00dc8 Unwind@00b00dc8 void Unwind_00b00dc8(void) { FUN_0041c710(); return; } //@@ 00b00dd0 Unwind@00b00dd0 void Unwind_00b00dd0(void) { FUN_0041c710(); return; } //@@ 00b00dd8 Unwind@00b00dd8 void Unwind_00b00dd8(void) { FUN_0041c710(); return; } //@@ 00b00de0 Unwind@00b00de0 void Unwind_00b00de0(void) { FUN_0041c710(); return; } //@@ 00b00de8 Unwind@00b00de8 void Unwind_00b00de8(void) { FUN_0041c710(); return; } //@@ 00b00df0 Unwind@00b00df0 void Unwind_00b00df0(void) { FUN_0041c710(); return; } //@@ 00b00df8 Unwind@00b00df8 void Unwind_00b00df8(void) { FUN_0041c710(); return; } //@@ 00b00e00 Unwind@00b00e00 void Unwind_00b00e00(void) { FUN_0040c440(); return; } //@@ 00b00e08 Unwind@00b00e08 void Unwind_00b00e08(void) { FUN_0040c440(); return; } //@@ 00b00e13 Unwind@00b00e13 void Unwind_00b00e13(void) { FUN_0040c440(); return; } //@@ 00b00e1e Unwind@00b00e1e void Unwind_00b00e1e(void) { FUN_0041c710(); return; } //@@ 00b00e29 Unwind@00b00e29 void Unwind_00b00e29(void) { FUN_0041c710(); return; } //@@ 00b00e34 Unwind@00b00e34 void Unwind_00b00e34(void) { FUN_0040c440(); return; } //@@ 00b00e3f Unwind@00b00e3f void Unwind_00b00e3f(void) { FUN_0040c440(); return; } //@@ 00b00e47 Unwind@00b00e47 void Unwind_00b00e47(void) { FUN_0041c710(); return; } //@@ 00b00e4f Unwind@00b00e4f void Unwind_00b00e4f(void) { FUN_0041c710(); return; } //@@ 00b00e80 Unwind@00b00e80 void Unwind_00b00e80(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x154); return; } //@@ 00b00e92 Unwind@00b00e92 void Unwind_00b00e92(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x154); return; } //@@ 00b00ea4 Unwind@00b00ea4 void Unwind_00b00ea4(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x154); return; } //@@ 00b00ee0 Unwind@00b00ee0 void Unwind_00b00ee0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x28),0x404); return; } //@@ 00b00ef2 Unwind@00b00ef2 void Unwind_00b00ef2(void) { int unaff_EBP; GridEntity::~GridEntity(*(GridEntity **)(unaff_EBP + -0x28)); return; } //@@ 00b00efa Unwind@00b00efa void Unwind_00b00efa(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x28) + 0x168)); return; } //@@ 00b00f40 Unwind@00b00f40 void Unwind_00b00f40(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x78); return; } //@@ 00b00f4f Unwind@00b00f4f void Unwind_00b00f4f(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_004d7130(); return; } //@@ 00b00f90 Unwind@00b00f90 void Unwind_00b00f90(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0xa8)); return; } //@@ 00b00f9b Unwind@00b00f9b void Unwind_00b00f9b(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x120)); return; } //@@ 00b00fe0 Unwind@00b00fe0 void Unwind_00b00fe0(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00b01020 Unwind@00b01020 void Unwind_00b01020(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b01028 Unwind@00b01028 void Unwind_00b01028(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b01030 Unwind@00b01030 void Unwind_00b01030(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b01038 Unwind@00b01038 void Unwind_00b01038(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b01040 Unwind@00b01040 void Unwind_00b01040(void) { FUN_0040c440(); return; } //@@ 00b01048 Unwind@00b01048 void Unwind_00b01048(void) { FUN_0040c440(); return; } //@@ 00b01050 Unwind@00b01050 void Unwind_00b01050(void) { FUN_0040c440(); return; } //@@ 00b01058 Unwind@00b01058 void Unwind_00b01058(void) { FUN_0040c440(); return; } //@@ 00b01060 Unwind@00b01060 void Unwind_00b01060(void) { FUN_0040c440(); return; } //@@ 00b01068 Unwind@00b01068 void Unwind_00b01068(void) { FUN_0040c440(); return; } //@@ 00b01070 Unwind@00b01070 void Unwind_00b01070(void) { FUN_0040c440(); return; } //@@ 00b01078 Unwind@00b01078 void Unwind_00b01078(void) { FUN_0040c440(); return; } //@@ 00b01080 Unwind@00b01080 void Unwind_00b01080(void) { FUN_0040c440(); return; } //@@ 00b01088 Unwind@00b01088 void Unwind_00b01088(void) { FUN_0040c440(); return; } //@@ 00b01090 Unwind@00b01090 void Unwind_00b01090(void) { FUN_0040c440(); return; } //@@ 00b01098 Unwind@00b01098 void Unwind_00b01098(void) { FUN_0040c440(); return; } //@@ 00b010a0 Unwind@00b010a0 void Unwind_00b010a0(void) { FUN_0040c440(); return; } //@@ 00b010a8 Unwind@00b010a8 void Unwind_00b010a8(void) { FUN_0040c440(); return; } //@@ 00b010b0 Unwind@00b010b0 void Unwind_00b010b0(void) { FUN_0040c440(); return; } //@@ 00b010b8 Unwind@00b010b8 void Unwind_00b010b8(void) { FUN_0040c440(); return; } //@@ 00b010c0 Unwind@00b010c0 void Unwind_00b010c0(void) { FUN_0040c440(); return; } //@@ 00b010c8 Unwind@00b010c8 void Unwind_00b010c8(void) { FUN_0040c440(); return; } //@@ 00b01120 Unwind@00b01120 void Unwind_00b01120(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2b0)); return; } //@@ 00b0112b Unwind@00b0112b void Unwind_00b0112b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x298)); return; } //@@ 00b01136 Unwind@00b01136 void Unwind_00b01136(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x58c)); return; } //@@ 00b01141 Unwind@00b01141 void Unwind_00b01141(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x5dc)); return; } //@@ 00b0114c Unwind@00b0114c void Unwind_00b0114c(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x6dc)); return; } //@@ 00b01157 Unwind@00b01157 void Unwind_00b01157(void) { FUN_00828b10(); return; } //@@ 00b01162 Unwind@00b01162 void Unwind_00b01162(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x280)); return; } //@@ 00b0116d Unwind@00b0116d void Unwind_00b0116d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2fc)); return; } //@@ 00b01178 Unwind@00b01178 void Unwind_00b01178(void) { FUN_00828b10(); return; } //@@ 00b01183 Unwind@00b01183 void Unwind_00b01183(void) { FUN_00828b10(); return; } //@@ 00b0118e Unwind@00b0118e void Unwind_00b0118e(void) { FUN_00828b10(); return; } //@@ 00b01199 Unwind@00b01199 void Unwind_00b01199(void) { FUN_00828b10(); return; } //@@ 00b011a4 Unwind@00b011a4 void Unwind_00b011a4(void) { FUN_00828b10(); return; } //@@ 00b011af Unwind@00b011af void Unwind_00b011af(void) { FUN_00828b10(); return; } //@@ 00b011ba Unwind@00b011ba void Unwind_00b011ba(void) { FUN_00828b10(); return; } //@@ 00b011c5 Unwind@00b011c5 void Unwind_00b011c5(void) { FUN_00828b10(); return; } //@@ 00b011d0 Unwind@00b011d0 void Unwind_00b011d0(void) { FUN_00828b10(); return; } //@@ 00b011db Unwind@00b011db void Unwind_00b011db(void) { FUN_00828b10(); return; } //@@ 00b011e6 Unwind@00b011e6 void Unwind_00b011e6(void) { FUN_00828b10(); return; } //@@ 00b011f1 Unwind@00b011f1 void Unwind_00b011f1(void) { FUN_00828b10(); return; } //@@ 00b011fc Unwind@00b011fc void Unwind_00b011fc(void) { FUN_00828b10(); return; } //@@ 00b01207 Unwind@00b01207 void Unwind_00b01207(void) { FUN_00828b10(); return; } //@@ 00b01212 Unwind@00b01212 void Unwind_00b01212(void) { FUN_00828b10(); return; } //@@ 00b0121d Unwind@00b0121d void Unwind_00b0121d(void) { FUN_00828b10(); return; } //@@ 00b01228 Unwind@00b01228 void Unwind_00b01228(void) { FUN_00828b10(); return; } //@@ 00b01233 Unwind@00b01233 void Unwind_00b01233(void) { FUN_00828b10(); return; } //@@ 00b0123e Unwind@00b0123e void Unwind_00b0123e(void) { FUN_00828b10(); return; } //@@ 00b01249 Unwind@00b01249 void Unwind_00b01249(void) { FUN_00828b10(); return; } //@@ 00b01254 Unwind@00b01254 void Unwind_00b01254(void) { FUN_0040c440(); return; } //@@ 00b0125f Unwind@00b0125f void Unwind_00b0125f(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x530),0x94); return; } //@@ 00b012b0 Unwind@00b012b0 void Unwind_00b012b0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00b012f0 Unwind@00b012f0 void Unwind_00b012f0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x48)); return; } //@@ 00b012f8 Unwind@00b012f8 void Unwind_00b012f8(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00b01304 Unwind@00b01304 void Unwind_00b01304(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00b01340 Unwind@00b01340 void Unwind_00b01340(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x20)); return; } //@@ 00b01348 Unwind@00b01348 void Unwind_00b01348(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00b01380 Unwind@00b01380 void Unwind_00b01380(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b013b0 Unwind@00b013b0 void Unwind_00b013b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x34)); return; } //@@ 00b013f0 Unwind@00b013f0 void Unwind_00b013f0(void) { FUN_00424420(); return; } //@@ 00b013f8 Unwind@00b013f8 void Unwind_00b013f8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x4c)); return; } //@@ 00b01400 Unwind@00b01400 void Unwind_00b01400(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x30),0x19c); return; } //@@ 00b01440 Unwind@00b01440 void Unwind_00b01440(void) { std::vector::_Tidy(); return; } //@@ 00b0144b Unwind@00b0144b void Unwind_00b0144b(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x260)); return; } //@@ 00b01456 Unwind@00b01456 void Unwind_00b01456(void) { std::vector::_Tidy(); return; } //@@ 00b01461 Unwind@00b01461 void Unwind_00b01461(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa80)); return; } //@@ 00b0146c Unwind@00b0146c void Unwind_00b0146c(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0xa48)); return; } //@@ 00b01477 Unwind@00b01477 void Unwind_00b01477(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x9dc)); return; } //@@ 00b01482 Unwind@00b01482 void Unwind_00b01482(void) { FUN_00436fb0(); return; } //@@ 00b0148d Unwind@00b0148d void Unwind_00b0148d(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xa00)); return; } //@@ 00b01498 Unwind@00b01498 void Unwind_00b01498(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x9e8)); return; } //@@ 00b014e0 Unwind@00b014e0 void Unwind_00b014e0(void) { guard_check_icall(); return; } //@@ 00b014e8 Unwind@00b014e8 void Unwind_00b014e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b01530 Unwind@00b01530 void Unwind_00b01530(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1c0)); return; } //@@ 00b0153b Unwind@00b0153b void Unwind_00b0153b(void) { FUN_0041d4b0(); return; } //@@ 00b01580 Unwind@00b01580 void Unwind_00b01580(void) { FUN_0041d4b0(); return; } //@@ 00b01588 Unwind@00b01588 void Unwind_00b01588(void) { FUN_00a55c20(); return; } //@@ 00b015d0 Unwind@00b015d0 void Unwind_00b015d0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00b015d8 Unwind@00b015d8 void Unwind_00b015d8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00b015e0 Unwind@00b015e0 void Unwind_00b015e0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00b015e8 Unwind@00b015e8 void Unwind_00b015e8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00b01620 Unwind@00b01620 void Unwind_00b01620(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x68)); return; } //@@ 00b01628 Unwind@00b01628 void Unwind_00b01628(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x58)); return; } //@@ 00b01660 Unwind@00b01660 void Unwind_00b01660(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b016a0 Unwind@00b016a0 void Unwind_00b016a0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x154); return; } //@@ 00b016e0 Unwind@00b016e0 void Unwind_00b016e0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x94)); return; } //@@ 00b01720 Unwind@00b01720 void Unwind_00b01720(void) { FUN_0040c440(); return; } //@@ 00b01750 Unwind@00b01750 void Unwind_00b01750(void) { FUN_0041d4b0(); return; } //@@ 00b0175b Unwind@00b0175b void Unwind_00b0175b(void) { FUN_00a55c20(); return; } //@@ 00b01766 Unwind@00b01766 void Unwind_00b01766(void) { FUN_0041d4b0(); return; } //@@ 00b01771 Unwind@00b01771 void Unwind_00b01771(void) { FUN_00a55c20(); return; } //@@ 00b017b0 Unwind@00b017b0 void Unwind_00b017b0(void) { FUN_00424420(); return; } //@@ 00b017b8 Unwind@00b017b8 void Unwind_00b017b8(void) { FUN_00424420(); return; } //@@ 00b017c0 Unwind@00b017c0 void Unwind_00b017c0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b017f0 Unwind@00b017f0 void Unwind_00b017f0(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00b01820 Unwind@00b01820 void Unwind_00b01820(void) { __Init_thread_abort(&g_invalidRoomDescriptorGuard); return; } //@@ 00b01850 Unwind@00b01850 void Unwind_00b01850(void) { FUN_00694210(); return; } //@@ 00b01880 Unwind@00b01880 void Unwind_00b01880(void) { FUN_00424420(); return; } //@@ 00b0188b Unwind@00b0188b void Unwind_00b0188b(void) { FUN_00424420(); return; } //@@ 00b018d0 Unwind@00b018d0 void Unwind_00b018d0(void) { FUN_00428880(); return; } //@@ 00b01910 Unwind@00b01910 void Unwind_00b01910(void) { FUN_0060c350(); return; } //@@ 00b01918 Unwind@00b01918 void Unwind_00b01918(void) { FUN_0041c710(); return; } //@@ 00b01920 Unwind@00b01920 void Unwind_00b01920(void) { FUN_0041c710(); return; } //@@ 00b01950 Unwind@00b01950 void Unwind_00b01950(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x28),0x154); return; } //@@ 00b01962 Unwind@00b01962 void Unwind_00b01962(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x28),0x154); return; } //@@ 00b01974 Unwind@00b01974 void Unwind_00b01974(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00b0197c Unwind@00b0197c void Unwind_00b0197c(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x28),0x154); return; } //@@ 00b019b0 Unwind@00b019b0 void Unwind_00b019b0(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(unaff_EBP + -0x130)); return; } //@@ 00b019f0 Unwind@00b019f0 void Unwind_00b019f0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x20),0x158); return; } //@@ 00b01a30 Unwind@00b01a30 void Unwind_00b01a30(void) { FUN_0060cc00(); return; } //@@ 00b01a38 Unwind@00b01a38 void Unwind_00b01a38(void) { FUN_0060cc00(); return; } //@@ 00b01a90 Unwind@00b01a90 void Unwind_00b01a90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00b01a9b Unwind@00b01a9b void Unwind_00b01a9b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1c)); return; } //@@ 00b01aa6 Unwind@00b01aa6 void Unwind_00b01aa6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x34)); return; } //@@ 00b01ab1 Unwind@00b01ab1 void Unwind_00b01ab1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x4c)); return; } //@@ 00b01b00 Unwind@00b01b00 void Unwind_00b01b00(void) { RoomConfigRoom::dtor(); return; } //@@ 00b01b08 Unwind@00b01b08 void Unwind_00b01b08(void) { FUN_00413b40(); return; } //@@ 00b01b50 Unwind@00b01b50 void Unwind_00b01b50(void) { FUN_004b3950(); return; } //@@ 00b01b58 Unwind@00b01b58 void Unwind_00b01b58(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b01b60 Unwind@00b01b60 void Unwind_00b01b60(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x48) * 0x10; operator_delete(*(void **)(unaff_EBP + -0x48), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00b01bb0 Unwind@00b01bb0 void Unwind_00b01bb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b01bb8 Unwind@00b01bb8 void Unwind_00b01bb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b01bc0 Unwind@00b01bc0 void Unwind_00b01bc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b01bc8 Unwind@00b01bc8 void Unwind_00b01bc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b01bd0 Unwind@00b01bd0 void Unwind_00b01bd0(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x7c) * 0x5c; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -100),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b01c30 Unwind@00b01c30 void Unwind_00b01c30(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x50) * 0x10; operator_delete(*(void **)(unaff_EBP + -0x50), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00b01c80 Unwind@00b01c80 void Unwind_00b01c80(void) { FUN_00413b40(); return; } //@@ 00b01c8b Unwind@00b01c8b void Unwind_00b01c8b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b01c93 Unwind@00b01c93 void Unwind_00b01c93(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b01c9b Unwind@00b01c9b void Unwind_00b01c9b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b01ca3 Unwind@00b01ca3 void Unwind_00b01ca3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10184)); return; } //@@ 00b01cae Unwind@00b01cae void Unwind_00b01cae(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1016c)); return; } //@@ 00b01cb9 Unwind@00b01cb9 void Unwind_00b01cb9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10154)); return; } //@@ 00b01cc4 Unwind@00b01cc4 void Unwind_00b01cc4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1013c)); return; } //@@ 00b01ccf Unwind@00b01ccf void Unwind_00b01ccf(void) { int unaff_EBP; RoomConfig_Stage::game_destructor((RoomConfig_Stage *)(unaff_EBP + -0x10188)); return; } //@@ 00b01d10 Unwind@00b01d10 void Unwind_00b01d10(void) { FUN_00413b40(); return; } //@@ 00b01d1b Unwind@00b01d1b void Unwind_00b01d1b(void) { FUN_0069d1f0(); return; } //@@ 00b01d60 Unwind@00b01d60 void Unwind_00b01d60(void) { FUN_00413b40(); return; } //@@ 00b01d6b Unwind@00b01d6b void Unwind_00b01d6b(void) { FUN_0069d1f0(); return; } //@@ 00b01db0 Unwind@00b01db0 void Unwind_00b01db0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -100)); return; } //@@ 00b01db8 Unwind@00b01db8 void Unwind_00b01db8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x54)); return; } //@@ 00b01dc0 Unwind@00b01dc0 void Unwind_00b01dc0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x54)); return; } //@@ 00b01dc8 Unwind@00b01dc8 void Unwind_00b01dc8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x54)); return; } //@@ 00b01dd0 Unwind@00b01dd0 void Unwind_00b01dd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b01e10 Unwind@00b01e10 void Unwind_00b01e10(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FID_conflict__Tidy(*(void **)(unaff_EBP + 8)); return; } //@@ 00b01e50 Unwind@00b01e50 void Unwind_00b01e50(void) { FUN_0069d580(); return; } //@@ 00b01e58 Unwind@00b01e58 void Unwind_00b01e58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b01eb0 Unwind@00b01eb0 void Unwind_00b01eb0(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x1c) * 0x10; operator_delete(*(void **)(unaff_EBP + -0x20), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00b01f00 Unwind@00b01f00 void Unwind_00b01f00(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x34) * 0x10; operator_delete(*(void **)(unaff_EBP + -0x34), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00b01f50 Unwind@00b01f50 void Unwind_00b01f50(void) { FUN_0082e0a0(); return; } //@@ 00b01f58 Unwind@00b01f58 void Unwind_00b01f58(void) { FUN_0082e270(); return; } //@@ 00b01fb0 Unwind@00b01fb0 void Unwind_00b01fb0(void) { FUN_0042a230(); return; } //@@ 00b02000 Unwind@00b02000 void Unwind_00b02000(void) { FUN_0041c710(); return; } //@@ 00b02008 Unwind@00b02008 void Unwind_00b02008(void) { FUN_0041c710(); return; } //@@ 00b02040 Unwind@00b02040 void Unwind_00b02040(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b02048 Unwind@00b02048 void Unwind_00b02048(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02050 Unwind@00b02050 void Unwind_00b02050(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02058 Unwind@00b02058 void Unwind_00b02058(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02060 Unwind@00b02060 void Unwind_00b02060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02068 Unwind@00b02068 void Unwind_00b02068(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02070 Unwind@00b02070 void Unwind_00b02070(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02078 Unwind@00b02078 void Unwind_00b02078(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02080 Unwind@00b02080 void Unwind_00b02080(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02088 Unwind@00b02088 void Unwind_00b02088(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02090 Unwind@00b02090 void Unwind_00b02090(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02098 Unwind@00b02098 void Unwind_00b02098(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b020a0 Unwind@00b020a0 void Unwind_00b020a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b020a8 Unwind@00b020a8 void Unwind_00b020a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b020b0 Unwind@00b020b0 void Unwind_00b020b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b020b8 Unwind@00b020b8 void Unwind_00b020b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b020c0 Unwind@00b020c0 void Unwind_00b020c0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x5c) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x5c) = *(uint *)(unaff_EBP + -0x5c) & 0xfffffffd; FUN_0040c440(); return; } //@@ 00b020d9 Unwind@00b020d9 void Unwind_00b020d9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x5c) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x5c) = *(uint *)(unaff_EBP + -0x5c) & 0xfffffffb; FUN_0040c440(); return; } //@@ 00b020f2 Unwind@00b020f2 void Unwind_00b020f2(void) { FUN_0040c440(); return; } //@@ 00b020fa Unwind@00b020fa void Unwind_00b020fa(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b02150 Unwind@00b02150 void Unwind_00b02150(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b02158 Unwind@00b02158 void Unwind_00b02158(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b02190 Unwind@00b02190 void Unwind_00b02190(void) { FUN_00833270(); return; } //@@ 00b02198 Unwind@00b02198 void Unwind_00b02198(void) { FUN_00833270(); return; } //@@ 00b021d0 Unwind@00b021d0 void Unwind_00b021d0(void) { FUN_004b3950(); return; } //@@ 00b02210 Unwind@00b02210 void Unwind_00b02210(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b02240 Unwind@00b02240 void Unwind_00b02240(void) { FUN_00413b40(); return; } //@@ 00b0224b Unwind@00b0224b void Unwind_00b0224b(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b022b0 Unwind@00b022b0 void Unwind_00b022b0(void) { FUN_00835550(); return; } //@@ 00b02310 Unwind@00b02310 void Unwind_00b02310(void) { FUN_004242b0(); return; } //@@ 00b02340 Unwind@00b02340 void Unwind_00b02340(void) { FUN_004242b0(); return; } //@@ 00b0234b Unwind@00b0234b void Unwind_00b0234b(void) { FUN_004242b0(); return; } //@@ 00b02390 Unwind@00b02390 void Unwind_00b02390(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x428)); return; } //@@ 00b0239b Unwind@00b0239b void Unwind_00b0239b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x440)); return; } //@@ 00b023a6 Unwind@00b023a6 void Unwind_00b023a6(void) { FUN_00413b40(); return; } //@@ 00b023e0 Unwind@00b023e0 void Unwind_00b023e0(void) { FUN_00413b40(); return; } //@@ 00b023eb Unwind@00b023eb void Unwind_00b023eb(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1046c)); return; } //@@ 00b02450 Unwind@00b02450 void Unwind_00b02450(void) { FUN_0041d4b0(); return; } //@@ 00b024c0 Unwind@00b024c0 void Unwind_00b024c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b02500 Unwind@00b02500 void Unwind_00b02500(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b02508 Unwind@00b02508 void Unwind_00b02508(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b02540 Unwind@00b02540 void Unwind_00b02540(void) { FUN_0041d4b0(); return; } //@@ 00b02548 Unwind@00b02548 void Unwind_00b02548(void) { FUN_0041d4b0(); return; } //@@ 00b02550 Unwind@00b02550 void Unwind_00b02550(void) { FUN_00a55c20(); return; } //@@ 00b025b0 Unwind@00b025b0 void Unwind_00b025b0(void) { FUN_00839960(); return; } //@@ 00b025b8 Unwind@00b025b8 void Unwind_00b025b8(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0xc)); return; } //@@ 00b025f0 Unwind@00b025f0 void Unwind_00b025f0(void) { FUN_0060cc00(); return; } //@@ 00b02620 Unwind@00b02620 void Unwind_00b02620(void) { FUN_00839b40(); return; } //@@ 00b02628 Unwind@00b02628 void Unwind_00b02628(void) { FUN_0060cc00(); return; } //@@ 00b02660 Unwind@00b02660 void Unwind_00b02660(void) { FUN_0040c440(); return; } //@@ 00b02690 Unwind@00b02690 void Unwind_00b02690(void) { FUN_0040c440(); return; } //@@ 00b026d0 Unwind@00b026d0 void Unwind_00b026d0(void) { FUN_0083b830(); return; } //@@ 00b026d8 Unwind@00b026d8 void Unwind_00b026d8(void) { FUN_007098c0(); return; } //@@ 00b026e0 Unwind@00b026e0 void Unwind_00b026e0(void) { FUN_00709930(); return; } //@@ 00b026eb Unwind@00b026eb void Unwind_00b026eb(void) { FUN_007098c0(); return; } //@@ 00b026f3 Unwind@00b026f3 void Unwind_00b026f3(void) { FUN_00709930(); return; } //@@ 00b026fe Unwind@00b026fe void Unwind_00b026fe(void) { FUN_007098c0(); return; } //@@ 00b02709 Unwind@00b02709 void Unwind_00b02709(void) { FUN_0040c440(); return; } //@@ 00b02711 Unwind@00b02711 void Unwind_00b02711(void) { FUN_00709930(); return; } //@@ 00b0271c Unwind@00b0271c void Unwind_00b0271c(void) { FUN_007098c0(); return; } //@@ 00b027b0 Unwind@00b027b0 void Unwind_00b027b0(void) { FUN_0083c480(); return; } //@@ 00b027e0 Unwind@00b027e0 void Unwind_00b027e0(void) { FUN_0083c480(); return; } //@@ 00b02810 Unwind@00b02810 void Unwind_00b02810(void) { FUN_00415ce0(); return; } //@@ 00b02818 Unwind@00b02818 void Unwind_00b02818(void) { FUN_00415ce0(); return; } //@@ 00b02870 Unwind@00b02870 void Unwind_00b02870(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b02878 Unwind@00b02878 void Unwind_00b02878(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b02880 Unwind@00b02880 void Unwind_00b02880(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b028c0 Unwind@00b028c0 void Unwind_00b028c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b028c8 Unwind@00b028c8 void Unwind_00b028c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b028d0 Unwind@00b028d0 void Unwind_00b028d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b028d8 Unwind@00b028d8 void Unwind_00b028d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x100)); return; } //@@ 00b028e3 Unwind@00b028e3 void Unwind_00b028e3(void) { FUN_0084dbc0(); return; } //@@ 00b028ee Unwind@00b028ee void Unwind_00b028ee(void) { FUN_0040c440(); return; } //@@ 00b028f9 Unwind@00b028f9 void Unwind_00b028f9(void) { FUN_0040c440(); return; } //@@ 00b02904 Unwind@00b02904 void Unwind_00b02904(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0290c Unwind@00b0290c void Unwind_00b0290c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b02914 Unwind@00b02914 void Unwind_00b02914(void) { FUN_00420710(); return; } //@@ 00b02950 Unwind@00b02950 void Unwind_00b02950(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b02980 Unwind@00b02980 void Unwind_00b02980(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xfc)); return; } //@@ 00b0298b Unwind@00b0298b void Unwind_00b0298b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe4)); return; } //@@ 00b02996 Unwind@00b02996 void Unwind_00b02996(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0299e Unwind@00b0299e void Unwind_00b0299e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b029a6 Unwind@00b029a6 void Unwind_00b029a6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x114)); return; } //@@ 00b029b1 Unwind@00b029b1 void Unwind_00b029b1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00b029bc Unwind@00b029bc void Unwind_00b029bc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xcc)); return; } //@@ 00b029c7 Unwind@00b029c7 void Unwind_00b029c7(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x144)); return; } //@@ 00b02a10 Unwind@00b02a10 void Unwind_00b02a10(void) { FUN_0041c710(); return; } //@@ 00b02a1b Unwind@00b02a1b void Unwind_00b02a1b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x20)); return; } //@@ 00b02a26 Unwind@00b02a26 void Unwind_00b02a26(void) { FUN_00a1a6f0(); return; } //@@ 00b02a80 Unwind@00b02a80 void Unwind_00b02a80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b02a88 Unwind@00b02a88 void Unwind_00b02a88(void) { FUN_0041c710(); return; } //@@ 00b02a90 Unwind@00b02a90 void Unwind_00b02a90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b02a98 Unwind@00b02a98 void Unwind_00b02a98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b02aa0 Unwind@00b02aa0 void Unwind_00b02aa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b02aa8 Unwind@00b02aa8 void Unwind_00b02aa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b02b20 Unwind@00b02b20 void Unwind_00b02b20(void) { FUN_0041d4b0(); return; } //@@ 00b02b28 Unwind@00b02b28 void Unwind_00b02b28(void) { FUN_0041d4b0(); return; } //@@ 00b02b60 Unwind@00b02b60 void Unwind_00b02b60(void) { FUN_0041d4b0(); return; } //@@ 00b02b68 Unwind@00b02b68 void Unwind_00b02b68(void) { FUN_00a55c20(); return; } //@@ 00b02b73 Unwind@00b02b73 void Unwind_00b02b73(void) { FUN_0040c440(); return; } //@@ 00b02b7b Unwind@00b02b7b void Unwind_00b02b7b(void) { FUN_0040c440(); return; } //@@ 00b02b86 Unwind@00b02b86 void Unwind_00b02b86(void) { FUN_0040c440(); return; } //@@ 00b02b91 Unwind@00b02b91 void Unwind_00b02b91(void) { FUN_0040c440(); return; } //@@ 00b02b9c Unwind@00b02b9c void Unwind_00b02b9c(void) { FUN_0040c440(); return; } //@@ 00b02ba7 Unwind@00b02ba7 void Unwind_00b02ba7(void) { FUN_0041c710(); return; } //@@ 00b02baf Unwind@00b02baf void Unwind_00b02baf(void) { FUN_0041c710(); return; } //@@ 00b02bb7 Unwind@00b02bb7 void Unwind_00b02bb7(void) { FUN_0040c440(); return; } //@@ 00b02bc2 Unwind@00b02bc2 void Unwind_00b02bc2(void) { FUN_0040c440(); return; } //@@ 00b02c00 Unwind@00b02c00 void Unwind_00b02c00(void) { FUN_0040c440(); return; } //@@ 00b02c0b Unwind@00b02c0b void Unwind_00b02c0b(void) { FUN_0040c440(); return; } //@@ 00b02c16 Unwind@00b02c16 void Unwind_00b02c16(void) { FUN_0040c440(); return; } //@@ 00b02c21 Unwind@00b02c21 void Unwind_00b02c21(void) { FUN_0040c440(); return; } //@@ 00b02c2c Unwind@00b02c2c void Unwind_00b02c2c(void) { FUN_0040c440(); return; } //@@ 00b02c37 Unwind@00b02c37 void Unwind_00b02c37(void) { FUN_0083b830(); return; } //@@ 00b02c42 Unwind@00b02c42 void Unwind_00b02c42(void) { FUN_007098c0(); return; } //@@ 00b02c4d Unwind@00b02c4d void Unwind_00b02c4d(void) { FUN_007098c0(); return; } //@@ 00b02c58 Unwind@00b02c58 void Unwind_00b02c58(void) { FUN_007098c0(); return; } //@@ 00b02c63 Unwind@00b02c63 void Unwind_00b02c63(void) { FUN_0040c440(); return; } //@@ 00b02c6e Unwind@00b02c6e void Unwind_00b02c6e(void) { FUN_007098c0(); return; } //@@ 00b02c79 Unwind@00b02c79 void Unwind_00b02c79(void) { FUN_007098c0(); return; } //@@ 00b02c84 Unwind@00b02c84 void Unwind_00b02c84(void) { FUN_0083b830(); return; } //@@ 00b02c8f Unwind@00b02c8f void Unwind_00b02c8f(void) { FUN_007098c0(); return; } //@@ 00b02c9a Unwind@00b02c9a void Unwind_00b02c9a(void) { FUN_007098c0(); return; } //@@ 00b02ca5 Unwind@00b02ca5 void Unwind_00b02ca5(void) { FUN_0040c440(); return; } //@@ 00b02cb0 Unwind@00b02cb0 void Unwind_00b02cb0(void) { FUN_007098c0(); return; } //@@ 00b02cbb Unwind@00b02cbb void Unwind_00b02cbb(void) { FUN_007098c0(); return; } //@@ 00b02cc6 Unwind@00b02cc6 void Unwind_00b02cc6(void) { FUN_007098c0(); return; } //@@ 00b02cd1 Unwind@00b02cd1 void Unwind_00b02cd1(void) { FUN_0040c440(); return; } //@@ 00b02cdc Unwind@00b02cdc void Unwind_00b02cdc(void) { FUN_0040c440(); return; } //@@ 00b02d20 Unwind@00b02d20 void Unwind_00b02d20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b02d28 Unwind@00b02d28 void Unwind_00b02d28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b02d30 Unwind@00b02d30 void Unwind_00b02d30(void) { FUN_0041d4b0(); return; } //@@ 00b02d38 Unwind@00b02d38 void Unwind_00b02d38(void) { FUN_0041d4b0(); return; } //@@ 00b02d70 Unwind@00b02d70 void Unwind_00b02d70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x100)); return; } //@@ 00b02d7b Unwind@00b02d7b void Unwind_00b02d7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x15c)); return; } //@@ 00b02d86 Unwind@00b02d86 void Unwind_00b02d86(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1cc) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1cc) = *(uint *)(unaff_EBP + -0x1cc) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00b02da8 Unwind@00b02da8 void Unwind_00b02da8(void) { FUN_0041d4b0(); return; } //@@ 00b02df0 Unwind@00b02df0 void Unwind_00b02df0(void) { FUN_0040c440(); return; } //@@ 00b02e20 Unwind@00b02e20 void Unwind_00b02e20(void) { FUN_0040c440(); return; } //@@ 00b02e50 Unwind@00b02e50 void Unwind_00b02e50(void) { FUN_0040c440(); return; } //@@ 00b02e58 Unwind@00b02e58 void Unwind_00b02e58(void) { std::vector::_Tidy(); return; } //@@ 00b02e63 Unwind@00b02e63 void Unwind_00b02e63(void) { std::vector::_Tidy(); return; } //@@ 00b02e6b Unwind@00b02e6b void Unwind_00b02e6b(void) { std::vector::_Tidy(); return; } //@@ 00b02ea0 Unwind@00b02ea0 void Unwind_00b02ea0(void) { FUN_0084bf20(); return; } //@@ 00b02ed0 Unwind@00b02ed0 void Unwind_00b02ed0(void) { FUN_0084bf20(); return; } //@@ 00b02f00 Unwind@00b02f00 void Unwind_00b02f00(void) { FUN_0041d4b0(); return; } //@@ 00b02f08 Unwind@00b02f08 void Unwind_00b02f08(void) { FUN_00a55c20(); return; } //@@ 00b02f13 Unwind@00b02f13 void Unwind_00b02f13(void) { FUN_0041d4b0(); return; } //@@ 00b02f50 Unwind@00b02f50 void Unwind_00b02f50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00b02f5b Unwind@00b02f5b void Unwind_00b02f5b(void) { std::vector::_Tidy(); return; } //@@ 00b02f66 Unwind@00b02f66 void Unwind_00b02f66(void) { std::vector::_Tidy(); return; } //@@ 00b02f71 Unwind@00b02f71 void Unwind_00b02f71(void) { std::vector::_Tidy(); return; } //@@ 00b02fa0 Unwind@00b02fa0 void Unwind_00b02fa0(void) { FUN_0084dbc0(); return; } //@@ 00b02fab Unwind@00b02fab void Unwind_00b02fab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00b02ff0 Unwind@00b02ff0 void Unwind_00b02ff0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b02ff8 Unwind@00b02ff8 void Unwind_00b02ff8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03000 Unwind@00b03000 void Unwind_00b03000(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03008 Unwind@00b03008 void Unwind_00b03008(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03010 Unwind@00b03010 void Unwind_00b03010(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03018 Unwind@00b03018 void Unwind_00b03018(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03050 Unwind@00b03050 void Unwind_00b03050(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03058 Unwind@00b03058 void Unwind_00b03058(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03060 Unwind@00b03060 void Unwind_00b03060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03068 Unwind@00b03068 void Unwind_00b03068(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03070 Unwind@00b03070 void Unwind_00b03070(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03078 Unwind@00b03078 void Unwind_00b03078(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b030b0 Unwind@00b030b0 void Unwind_00b030b0(void) { FUN_0084db90(); return; } //@@ 00b030bb Unwind@00b030bb void Unwind_00b030bb(void) { FUN_0084db90(); return; } //@@ 00b030c6 Unwind@00b030c6 void Unwind_00b030c6(void) { FUN_00413b40(); return; } //@@ 00b03100 Unwind@00b03100 void Unwind_00b03100(void) { FUN_0084db90(); return; } //@@ 00b0310b Unwind@00b0310b void Unwind_00b0310b(void) { FUN_0084dbc0(); return; } //@@ 00b03113 Unwind@00b03113 void Unwind_00b03113(void) { FUN_0084db90(); return; } //@@ 00b0311e Unwind@00b0311e void Unwind_00b0311e(void) { FUN_0084dbc0(); return; } //@@ 00b03160 Unwind@00b03160 void Unwind_00b03160(void) { FUN_0084db90(); return; } //@@ 00b0316b Unwind@00b0316b void Unwind_00b0316b(void) { FUN_0084dbc0(); return; } //@@ 00b031b0 Unwind@00b031b0 void Unwind_00b031b0(void) { FUN_0084dbc0(); return; } //@@ 00b031bb Unwind@00b031bb void Unwind_00b031bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b031c3 Unwind@00b031c3 void Unwind_00b031c3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b031cb Unwind@00b031cb void Unwind_00b031cb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b031d3 Unwind@00b031d3 void Unwind_00b031d3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b031db Unwind@00b031db void Unwind_00b031db(void) { FUN_0084dbc0(); return; } //@@ 00b031e6 Unwind@00b031e6 void Unwind_00b031e6(void) { FUN_0084dbc0(); return; } //@@ 00b031f1 Unwind@00b031f1 void Unwind_00b031f1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b031f9 Unwind@00b031f9 void Unwind_00b031f9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b03201 Unwind@00b03201 void Unwind_00b03201(void) { FUN_0084dbc0(); return; } //@@ 00b0320c Unwind@00b0320c void Unwind_00b0320c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b03214 Unwind@00b03214 void Unwind_00b03214(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0321c Unwind@00b0321c void Unwind_00b0321c(void) { FUN_0084dbc0(); return; } //@@ 00b03227 Unwind@00b03227 void Unwind_00b03227(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b0322f Unwind@00b0322f void Unwind_00b0322f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03237 Unwind@00b03237 void Unwind_00b03237(void) { FUN_0084dbc0(); return; } //@@ 00b03242 Unwind@00b03242 void Unwind_00b03242(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b0324a Unwind@00b0324a void Unwind_00b0324a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03252 Unwind@00b03252 void Unwind_00b03252(void) { FUN_0084dbc0(); return; } //@@ 00b0325d Unwind@00b0325d void Unwind_00b0325d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b03265 Unwind@00b03265 void Unwind_00b03265(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0326d Unwind@00b0326d void Unwind_00b0326d(void) { FUN_0084dbc0(); return; } //@@ 00b03278 Unwind@00b03278 void Unwind_00b03278(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe0)); return; } //@@ 00b03283 Unwind@00b03283 void Unwind_00b03283(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b032c0 Unwind@00b032c0 void Unwind_00b032c0(void) { FUN_0084db90(); return; } //@@ 00b032cb Unwind@00b032cb void Unwind_00b032cb(void) { FUN_0084dbc0(); return; } //@@ 00b032d6 Unwind@00b032d6 void Unwind_00b032d6(void) { std::vector::_Tidy(); return; } //@@ 00b032e1 Unwind@00b032e1 void Unwind_00b032e1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b032e9 Unwind@00b032e9 void Unwind_00b032e9(void) { std::vector::_Tidy(); return; } //@@ 00b032f4 Unwind@00b032f4 void Unwind_00b032f4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b032fc Unwind@00b032fc void Unwind_00b032fc(void) { std::vector::_Tidy(); return; } //@@ 00b03307 Unwind@00b03307 void Unwind_00b03307(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0330f Unwind@00b0330f void Unwind_00b0330f(void) { std::vector::_Tidy(); return; } //@@ 00b0331a Unwind@00b0331a void Unwind_00b0331a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03322 Unwind@00b03322 void Unwind_00b03322(void) { std::vector::_Tidy(); return; } //@@ 00b0332d Unwind@00b0332d void Unwind_00b0332d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03335 Unwind@00b03335 void Unwind_00b03335(void) { std::vector::_Tidy(); return; } //@@ 00b03340 Unwind@00b03340 void Unwind_00b03340(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03380 Unwind@00b03380 void Unwind_00b03380(void) { FUN_0084db90(); return; } //@@ 00b0338b Unwind@00b0338b void Unwind_00b0338b(void) { FUN_0084dbc0(); return; } //@@ 00b03396 Unwind@00b03396 void Unwind_00b03396(void) { std::vector::_Tidy(); return; } //@@ 00b033a1 Unwind@00b033a1 void Unwind_00b033a1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b033a9 Unwind@00b033a9 void Unwind_00b033a9(void) { std::vector::_Tidy(); return; } //@@ 00b033b4 Unwind@00b033b4 void Unwind_00b033b4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b033bc Unwind@00b033bc void Unwind_00b033bc(void) { std::vector::_Tidy(); return; } //@@ 00b033c7 Unwind@00b033c7 void Unwind_00b033c7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b033cf Unwind@00b033cf void Unwind_00b033cf(void) { std::vector::_Tidy(); return; } //@@ 00b033da Unwind@00b033da void Unwind_00b033da(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b033e2 Unwind@00b033e2 void Unwind_00b033e2(void) { std::vector::_Tidy(); return; } //@@ 00b033ed Unwind@00b033ed void Unwind_00b033ed(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b033f5 Unwind@00b033f5 void Unwind_00b033f5(void) { std::vector::_Tidy(); return; } //@@ 00b03400 Unwind@00b03400 void Unwind_00b03400(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03440 Unwind@00b03440 void Unwind_00b03440(void) { FUN_00833270(); return; } //@@ 00b03448 Unwind@00b03448 void Unwind_00b03448(void) { FUN_00833270(); return; } //@@ 00b034a0 Unwind@00b034a0 void Unwind_00b034a0(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10)); return; } //@@ 00b034a8 Unwind@00b034a8 void Unwind_00b034a8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x18)); return; } //@@ 00b034b3 Unwind@00b034b3 void Unwind_00b034b3(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x24)); return; } //@@ 00b034be Unwind@00b034be void Unwind_00b034be(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00b034c9 Unwind@00b034c9 void Unwind_00b034c9(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x3c)); return; } //@@ 00b034d4 Unwind@00b034d4 void Unwind_00b034d4(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x48)); return; } //@@ 00b03510 Unwind@00b03510 void Unwind_00b03510(void) { FUN_00856b90(); return; } //@@ 00b03540 Unwind@00b03540 void Unwind_00b03540(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x10)); return; } //@@ 00b0354b Unwind@00b0354b void Unwind_00b0354b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x124)); return; } //@@ 00b035c0 Unwind@00b035c0 void Unwind_00b035c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b035c8 Unwind@00b035c8 void Unwind_00b035c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b03600 Unwind@00b03600 void Unwind_00b03600(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b03608 Unwind@00b03608 void Unwind_00b03608(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03660 Unwind@00b03660 void Unwind_00b03660(void) { FUN_0041d4b0(); return; } //@@ 00b03668 Unwind@00b03668 void Unwind_00b03668(void) { FUN_0041d4b0(); return; } //@@ 00b03670 Unwind@00b03670 void Unwind_00b03670(void) { FUN_0041d4b0(); return; } //@@ 00b0367b Unwind@00b0367b void Unwind_00b0367b(void) { FUN_0041d4b0(); return; } //@@ 00b036c0 Unwind@00b036c0 void Unwind_00b036c0(void) { FUN_0041d4b0(); return; } //@@ 00b036c8 Unwind@00b036c8 void Unwind_00b036c8(void) { FUN_0041d4b0(); return; } //@@ 00b03700 Unwind@00b03700 void Unwind_00b03700(void) { FUN_0041d4b0(); return; } //@@ 00b0370b Unwind@00b0370b void Unwind_00b0370b(void) { FUN_009e5370(); return; } //@@ 00b03716 Unwind@00b03716 void Unwind_00b03716(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x528) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x528) = *(uint *)(unaff_EBP + -0x528) & 0xfffffffe; FUN_0040c440(); return; } //@@ 00b03738 Unwind@00b03738 void Unwind_00b03738(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x528) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x528) = *(uint *)(unaff_EBP + -0x528) & 0xfffffffd; FUN_0040c440(); return; } //@@ 00b0375a Unwind@00b0375a void Unwind_00b0375a(void) { FUN_0040c440(); return; } //@@ 00b03765 Unwind@00b03765 void Unwind_00b03765(void) { FUN_0041d4b0(); return; } //@@ 00b03770 Unwind@00b03770 void Unwind_00b03770(void) { FUN_0041d4b0(); return; } //@@ 00b0377b Unwind@00b0377b void Unwind_00b0377b(void) { FUN_00a55c20(); return; } //@@ 00b03786 Unwind@00b03786 void Unwind_00b03786(void) { FUN_0041d4b0(); return; } //@@ 00b03791 Unwind@00b03791 void Unwind_00b03791(void) { FUN_0041d4b0(); return; } //@@ 00b037d0 Unwind@00b037d0 void Unwind_00b037d0(void) { FUN_0040c440(); return; } //@@ 00b03800 Unwind@00b03800 void Unwind_00b03800(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x18)); return; } //@@ 00b0380b Unwind@00b0380b void Unwind_00b0380b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00b03816 Unwind@00b03816 void Unwind_00b03816(void) { std::vector::_Tidy(); return; } //@@ 00b03850 Unwind@00b03850 void Unwind_00b03850(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b03858 Unwind@00b03858 void Unwind_00b03858(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x18)); return; } //@@ 00b03863 Unwind@00b03863 void Unwind_00b03863(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00b0386e Unwind@00b0386e void Unwind_00b0386e(void) { std::vector::_Tidy(); return; } //@@ 00b03879 Unwind@00b03879 void Unwind_00b03879(void) { FUN_00a28730(); return; } //@@ 00b038b0 Unwind@00b038b0 void Unwind_00b038b0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b038b8 Unwind@00b038b8 void Unwind_00b038b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x94)); return; } //@@ 00b038c3 Unwind@00b038c3 void Unwind_00b038c3(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xb0) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xb0) = *(uint *)(unaff_EBP + -0xb0) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00b03920 Unwind@00b03920 void Unwind_00b03920(void) { FUN_0041d4b0(); return; } //@@ 00b03928 Unwind@00b03928 void Unwind_00b03928(void) { FUN_0041d4b0(); return; } //@@ 00b03930 Unwind@00b03930 void Unwind_00b03930(void) { FUN_0041d4b0(); return; } //@@ 00b03938 Unwind@00b03938 void Unwind_00b03938(void) { FUN_0041d4b0(); return; } //@@ 00b03940 Unwind@00b03940 void Unwind_00b03940(void) { FUN_0041d4b0(); return; } //@@ 00b03948 Unwind@00b03948 void Unwind_00b03948(void) { FUN_0041d4b0(); return; } //@@ 00b03950 Unwind@00b03950 void Unwind_00b03950(void) { FUN_0041d4b0(); return; } //@@ 00b03958 Unwind@00b03958 void Unwind_00b03958(void) { FUN_0041d4b0(); return; } //@@ 00b03960 Unwind@00b03960 void Unwind_00b03960(void) { FUN_0041d4b0(); return; } //@@ 00b03990 Unwind@00b03990 void Unwind_00b03990(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b039c0 Unwind@00b039c0 void Unwind_00b039c0(void) { FUN_0040ce00(); return; } //@@ 00b039c8 Unwind@00b039c8 void Unwind_00b039c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x10)); return; } //@@ 00b03a00 Unwind@00b03a00 void Unwind_00b03a00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b03a08 Unwind@00b03a08 void Unwind_00b03a08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b03a10 Unwind@00b03a10 void Unwind_00b03a10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b03a70 Unwind@00b03a70 void Unwind_00b03a70(void) { std::vector::_Tidy(); return; } //@@ 00b03a7b Unwind@00b03a7b void Unwind_00b03a7b(void) { std::vector::_Tidy(); return; } //@@ 00b03a86 Unwind@00b03a86 void Unwind_00b03a86(void) { std::vector::_Tidy(); return; } //@@ 00b03ac0 Unwind@00b03ac0 void Unwind_00b03ac0(void) { FUN_006a80d0(); return; } //@@ 00b03af0 Unwind@00b03af0 void Unwind_00b03af0(void) { FUN_006a80d0(); return; } //@@ 00b03af8 Unwind@00b03af8 void Unwind_00b03af8(void) { FUN_006a80d0(); return; } //@@ 00b03b00 Unwind@00b03b00 void Unwind_00b03b00(void) { FUN_006a80d0(); return; } //@@ 00b03b08 Unwind@00b03b08 void Unwind_00b03b08(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x4c) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x4c) = *(uint *)(unaff_EBP + -0x4c) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b03b21 Unwind@00b03b21 void Unwind_00b03b21(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x4c) & 8) == 0) { return; } *(uint *)(unaff_EBP + -0x4c) = *(uint *)(unaff_EBP + -0x4c) & 0xfffffff7; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03b70 Unwind@00b03b70 void Unwind_00b03b70(void) { FUN_00693420(); return; } //@@ 00b03b78 Unwind@00b03b78 void Unwind_00b03b78(void) { FUN_006a80d0(); return; } //@@ 00b03b80 Unwind@00b03b80 void Unwind_00b03b80(void) { FUN_0085c250(); return; } //@@ 00b03b88 Unwind@00b03b88 void Unwind_00b03b88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03b90 Unwind@00b03b90 void Unwind_00b03b90(void) { FUN_00694210(); return; } //@@ 00b03bd0 Unwind@00b03bd0 void Unwind_00b03bd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b03bd8 Unwind@00b03bd8 void Unwind_00b03bd8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b03be0 Unwind@00b03be0 void Unwind_00b03be0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b03be8 Unwind@00b03be8 void Unwind_00b03be8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xec)); return; } //@@ 00b03bf3 Unwind@00b03bf3 void Unwind_00b03bf3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b03bfe Unwind@00b03bfe void Unwind_00b03bfe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b03c06 Unwind@00b03c06 void Unwind_00b03c06(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b03c11 Unwind@00b03c11 void Unwind_00b03c11(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b03c19 Unwind@00b03c19 void Unwind_00b03c19(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b03c24 Unwind@00b03c24 void Unwind_00b03c24(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b03c2f Unwind@00b03c2f void Unwind_00b03c2f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b03c3a Unwind@00b03c3a void Unwind_00b03c3a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd4)); return; } //@@ 00b04420 Unwind@00b04420 void Unwind_00b04420(void) { FUN_006a80d0(); return; } //@@ 00b04450 Unwind@00b04450 void Unwind_00b04450(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + 8)); return; } //@@ 00b045d0 Unwind@00b045d0 void Unwind_00b045d0(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x44)); return; } //@@ 00b045d8 Unwind@00b045d8 void Unwind_00b045d8(void) { FUN_0086e4d0(); return; } //@@ 00b045e0 Unwind@00b045e0 void Unwind_00b045e0(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x44)); return; } //@@ 00b045e8 Unwind@00b045e8 void Unwind_00b045e8(void) { FUN_0086e4d0(); return; } //@@ 00b045f0 Unwind@00b045f0 void Unwind_00b045f0(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b045f8 Unwind@00b045f8 void Unwind_00b045f8(void) { FUN_0086e4d0(); return; } //@@ 00b04600 Unwind@00b04600 void Unwind_00b04600(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x4c)); return; } //@@ 00b04608 Unwind@00b04608 void Unwind_00b04608(void) { FUN_0086e4d0(); return; } //@@ 00b04610 Unwind@00b04610 void Unwind_00b04610(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x44)); return; } //@@ 00b04618 Unwind@00b04618 void Unwind_00b04618(void) { FUN_0086e4d0(); return; } //@@ 00b04620 Unwind@00b04620 void Unwind_00b04620(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x8c)); return; } //@@ 00b0462b Unwind@00b0462b void Unwind_00b0462b(void) { FUN_0086e4d0(); return; } //@@ 00b04633 Unwind@00b04633 void Unwind_00b04633(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x8c)); return; } //@@ 00b0463e Unwind@00b0463e void Unwind_00b0463e(void) { FUN_0086e4d0(); return; } //@@ 00b04646 Unwind@00b04646 void Unwind_00b04646(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xbc)); return; } //@@ 00b04651 Unwind@00b04651 void Unwind_00b04651(void) { FUN_0086e4d0(); return; } //@@ 00b04659 Unwind@00b04659 void Unwind_00b04659(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xc4)); return; } //@@ 00b04664 Unwind@00b04664 void Unwind_00b04664(void) { FUN_0086e4d0(); return; } //@@ 00b0466c Unwind@00b0466c void Unwind_00b0466c(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x6c)); return; } //@@ 00b04674 Unwind@00b04674 void Unwind_00b04674(void) { FUN_0086e4d0(); return; } //@@ 00b0467f Unwind@00b0467f void Unwind_00b0467f(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x74)); return; } //@@ 00b04687 Unwind@00b04687 void Unwind_00b04687(void) { FUN_0086e4d0(); return; } //@@ 00b04692 Unwind@00b04692 void Unwind_00b04692(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x7c)); return; } //@@ 00b0469a Unwind@00b0469a void Unwind_00b0469a(void) { FUN_0086e4d0(); return; } //@@ 00b046a2 Unwind@00b046a2 void Unwind_00b046a2(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x84)); return; } //@@ 00b046ad Unwind@00b046ad void Unwind_00b046ad(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x6c)); return; } //@@ 00b046b5 Unwind@00b046b5 void Unwind_00b046b5(void) { FUN_0086e4d0(); return; } //@@ 00b046bd Unwind@00b046bd void Unwind_00b046bd(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x54)); return; } //@@ 00b046c5 Unwind@00b046c5 void Unwind_00b046c5(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x74)); return; } //@@ 00b046cd Unwind@00b046cd void Unwind_00b046cd(void) { FUN_0086e4d0(); return; } //@@ 00b046d5 Unwind@00b046d5 void Unwind_00b046d5(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x94)); return; } //@@ 00b046e0 Unwind@00b046e0 void Unwind_00b046e0(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x7c)); return; } //@@ 00b046e8 Unwind@00b046e8 void Unwind_00b046e8(void) { FUN_0086e4d0(); return; } //@@ 00b046f3 Unwind@00b046f3 void Unwind_00b046f3(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x9c)); return; } //@@ 00b046fe Unwind@00b046fe void Unwind_00b046fe(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x84)); return; } //@@ 00b04709 Unwind@00b04709 void Unwind_00b04709(void) { FUN_0086e4d0(); return; } //@@ 00b04711 Unwind@00b04711 void Unwind_00b04711(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xa4)); return; } //@@ 00b0471c Unwind@00b0471c void Unwind_00b0471c(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x54)); return; } //@@ 00b04724 Unwind@00b04724 void Unwind_00b04724(void) { FUN_0086e4d0(); return; } //@@ 00b0472f Unwind@00b0472f void Unwind_00b0472f(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -100)); return; } //@@ 00b04737 Unwind@00b04737 void Unwind_00b04737(void) { FUN_0086e4d0(); return; } //@@ 00b04742 Unwind@00b04742 void Unwind_00b04742(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b0474a Unwind@00b0474a void Unwind_00b0474a(void) { FUN_0086e4d0(); return; } //@@ 00b04755 Unwind@00b04755 void Unwind_00b04755(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x34)); return; } //@@ 00b0475d Unwind@00b0475d void Unwind_00b0475d(void) { FUN_0086e4d0(); return; } //@@ 00b04765 Unwind@00b04765 void Unwind_00b04765(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b0476d Unwind@00b0476d void Unwind_00b0476d(void) { FUN_0086e4d0(); return; } //@@ 00b04775 Unwind@00b04775 void Unwind_00b04775(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xac)); return; } //@@ 00b04780 Unwind@00b04780 void Unwind_00b04780(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b04788 Unwind@00b04788 void Unwind_00b04788(void) { FUN_0086e4d0(); return; } //@@ 00b04790 Unwind@00b04790 void Unwind_00b04790(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xb4)); return; } //@@ 00b0479b Unwind@00b0479b void Unwind_00b0479b(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -100)); return; } //@@ 00b047a3 Unwind@00b047a3 void Unwind_00b047a3(void) { FUN_0086e4d0(); return; } //@@ 00b047ab Unwind@00b047ab void Unwind_00b047ab(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x34)); return; } //@@ 00b047b3 Unwind@00b047b3 void Unwind_00b047b3(void) { FUN_0086e4d0(); return; } //@@ 00b047bb Unwind@00b047bb void Unwind_00b047bb(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xcc)); return; } //@@ 00b047c6 Unwind@00b047c6 void Unwind_00b047c6(void) { FUN_0086e4d0(); return; } //@@ 00b047ce Unwind@00b047ce void Unwind_00b047ce(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x24)); return; } //@@ 00b047d6 Unwind@00b047d6 void Unwind_00b047d6(void) { FUN_0086e4d0(); return; } //@@ 00b047de Unwind@00b047de void Unwind_00b047de(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x4c)); return; } //@@ 00b047e6 Unwind@00b047e6 void Unwind_00b047e6(void) { FUN_0086e4d0(); return; } //@@ 00b047f1 Unwind@00b047f1 void Unwind_00b047f1(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b047f9 Unwind@00b047f9 void Unwind_00b047f9(void) { FUN_0086e4d0(); return; } //@@ 00b04804 Unwind@00b04804 void Unwind_00b04804(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xc4)); return; } //@@ 00b0480f Unwind@00b0480f void Unwind_00b0480f(void) { FUN_0086e4d0(); return; } //@@ 00b04817 Unwind@00b04817 void Unwind_00b04817(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x74)); return; } //@@ 00b0481f Unwind@00b0481f void Unwind_00b0481f(void) { FUN_0086e4d0(); return; } //@@ 00b04827 Unwind@00b04827 void Unwind_00b04827(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x84)); return; } //@@ 00b04832 Unwind@00b04832 void Unwind_00b04832(void) { FUN_0086e4d0(); return; } //@@ 00b0483a Unwind@00b0483a void Unwind_00b0483a(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x94)); return; } //@@ 00b04845 Unwind@00b04845 void Unwind_00b04845(void) { FUN_0086e4d0(); return; } //@@ 00b04850 Unwind@00b04850 void Unwind_00b04850(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xa4)); return; } //@@ 00b0485b Unwind@00b0485b void Unwind_00b0485b(void) { FUN_0086e4d0(); return; } //@@ 00b04863 Unwind@00b04863 void Unwind_00b04863(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b0486b Unwind@00b0486b void Unwind_00b0486b(void) { FUN_0086e4d0(); return; } //@@ 00b04873 Unwind@00b04873 void Unwind_00b04873(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b0487b Unwind@00b0487b void Unwind_00b0487b(void) { FUN_0086e4d0(); return; } //@@ 00b04886 Unwind@00b04886 void Unwind_00b04886(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xd4)); return; } //@@ 00b04891 Unwind@00b04891 void Unwind_00b04891(void) { FUN_0086e4d0(); return; } //@@ 00b0489c Unwind@00b0489c void Unwind_00b0489c(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xdc)); return; } //@@ 00b048a7 Unwind@00b048a7 void Unwind_00b048a7(void) { FUN_0086e4d0(); return; } //@@ 00b048af Unwind@00b048af void Unwind_00b048af(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x74)); return; } //@@ 00b048b7 Unwind@00b048b7 void Unwind_00b048b7(void) { FUN_0086e4d0(); return; } //@@ 00b048bf Unwind@00b048bf void Unwind_00b048bf(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x84)); return; } //@@ 00b048ca Unwind@00b048ca void Unwind_00b048ca(void) { FUN_0086e4d0(); return; } //@@ 00b048d2 Unwind@00b048d2 void Unwind_00b048d2(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x94)); return; } //@@ 00b048dd Unwind@00b048dd void Unwind_00b048dd(void) { FUN_0086e4d0(); return; } //@@ 00b048e8 Unwind@00b048e8 void Unwind_00b048e8(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xa4)); return; } //@@ 00b048f3 Unwind@00b048f3 void Unwind_00b048f3(void) { FUN_0086e4d0(); return; } //@@ 00b048fb Unwind@00b048fb void Unwind_00b048fb(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b04903 Unwind@00b04903 void Unwind_00b04903(void) { FUN_0086e4d0(); return; } //@@ 00b0490b Unwind@00b0490b void Unwind_00b0490b(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b04913 Unwind@00b04913 void Unwind_00b04913(void) { FUN_0086e4d0(); return; } //@@ 00b0491e Unwind@00b0491e void Unwind_00b0491e(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xb4)); return; } //@@ 00b04929 Unwind@00b04929 void Unwind_00b04929(void) { FUN_0086e4d0(); return; } //@@ 00b04934 Unwind@00b04934 void Unwind_00b04934(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xe4)); return; } //@@ 00b0493f Unwind@00b0493f void Unwind_00b0493f(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x34)); return; } //@@ 00b04947 Unwind@00b04947 void Unwind_00b04947(void) { FUN_0086e4d0(); return; } //@@ 00b0494f Unwind@00b0494f void Unwind_00b0494f(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xac)); return; } //@@ 00b0495a Unwind@00b0495a void Unwind_00b0495a(void) { FUN_0086e4d0(); return; } //@@ 00b04965 Unwind@00b04965 void Unwind_00b04965(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xcc)); return; } //@@ 00b04970 Unwind@00b04970 void Unwind_00b04970(void) { FUN_0086e4d0(); return; } //@@ 00b0497b Unwind@00b0497b void Unwind_00b0497b(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xec)); return; } //@@ 00b04986 Unwind@00b04986 void Unwind_00b04986(void) { FUN_0086e4d0(); return; } //@@ 00b04991 Unwind@00b04991 void Unwind_00b04991(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xf4)); return; } //@@ 00b0499c Unwind@00b0499c void Unwind_00b0499c(void) { FUN_0086e4d0(); return; } //@@ 00b049a7 Unwind@00b049a7 void Unwind_00b049a7(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0xfc)); return; } //@@ 00b049b2 Unwind@00b049b2 void Unwind_00b049b2(void) { FUN_0086e4d0(); return; } //@@ 00b049bd Unwind@00b049bd void Unwind_00b049bd(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x104)); return; } //@@ 00b049c8 Unwind@00b049c8 void Unwind_00b049c8(void) { FUN_0086e4d0(); return; } //@@ 00b049d3 Unwind@00b049d3 void Unwind_00b049d3(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x10c)); return; } //@@ 00b049de Unwind@00b049de void Unwind_00b049de(void) { FUN_0086e4d0(); return; } //@@ 00b049e9 Unwind@00b049e9 void Unwind_00b049e9(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x114)); return; } //@@ 00b049f4 Unwind@00b049f4 void Unwind_00b049f4(void) { FUN_0086e4d0(); return; } //@@ 00b049ff Unwind@00b049ff void Unwind_00b049ff(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x11c)); return; } //@@ 00b04a0a Unwind@00b04a0a void Unwind_00b04a0a(void) { FUN_0086e4d0(); return; } //@@ 00b04a15 Unwind@00b04a15 void Unwind_00b04a15(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x124)); return; } //@@ 00b04a20 Unwind@00b04a20 void Unwind_00b04a20(void) { FUN_0086e4d0(); return; } //@@ 00b04a2b Unwind@00b04a2b void Unwind_00b04a2b(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -300)); return; } //@@ 00b04a36 Unwind@00b04a36 void Unwind_00b04a36(void) { FUN_0086e4d0(); return; } //@@ 00b04a41 Unwind@00b04a41 void Unwind_00b04a41(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x134)); return; } //@@ 00b04a4c Unwind@00b04a4c void Unwind_00b04a4c(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -300)); return; } //@@ 00b04a57 Unwind@00b04a57 void Unwind_00b04a57(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x13c)); return; } //@@ 00b04a62 Unwind@00b04a62 void Unwind_00b04a62(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x134)); return; } //@@ 00b04a6d Unwind@00b04a6d void Unwind_00b04a6d(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x14c)); return; } //@@ 00b04a78 Unwind@00b04a78 void Unwind_00b04a78(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x144)); return; } //@@ 00b04ab0 Unwind@00b04ab0 void Unwind_00b04ab0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b04ab8 Unwind@00b04ab8 void Unwind_00b04ab8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00b04ac0 Unwind@00b04ac0 void Unwind_00b04ac0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b04ac8 Unwind@00b04ac8 void Unwind_00b04ac8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b04ad0 Unwind@00b04ad0 void Unwind_00b04ad0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b04ad8 Unwind@00b04ad8 void Unwind_00b04ad8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b04ae0 Unwind@00b04ae0 void Unwind_00b04ae0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00b04aeb Unwind@00b04aeb void Unwind_00b04aeb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b04b30 Unwind@00b04b30 void Unwind_00b04b30(void) { FUN_006a80d0(); return; } //@@ 00b04b60 Unwind@00b04b60 void Unwind_00b04b60(void) { FUN_0041d4b0(); return; } //@@ 00b04bb0 Unwind@00b04bb0 void Unwind_00b04bb0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffd; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x14)); return; } //@@ 00b04bf0 Unwind@00b04bf0 void Unwind_00b04bf0(void) { FUN_006a80d0(); return; } //@@ 00b04bf8 Unwind@00b04bf8 void Unwind_00b04bf8(void) { FUN_006a80d0(); return; } //@@ 00b04c00 Unwind@00b04c00 void Unwind_00b04c00(void) { FUN_006a80d0(); return; } //@@ 00b04c08 Unwind@00b04c08 void Unwind_00b04c08(void) { FUN_006a80d0(); return; } //@@ 00b04c40 Unwind@00b04c40 void Unwind_00b04c40(void) { FUN_006a80d0(); return; } //@@ 00b04c48 Unwind@00b04c48 void Unwind_00b04c48(void) { FUN_006a80d0(); return; } //@@ 00b04c50 Unwind@00b04c50 void Unwind_00b04c50(void) { FUN_006a80d0(); return; } //@@ 00b04c58 Unwind@00b04c58 void Unwind_00b04c58(void) { FUN_006a80d0(); return; } //@@ 00b04c60 Unwind@00b04c60 void Unwind_00b04c60(void) { FUN_006a80d0(); return; } //@@ 00b04c68 Unwind@00b04c68 void Unwind_00b04c68(void) { FUN_006a80d0(); return; } //@@ 00b04ca0 Unwind@00b04ca0 void Unwind_00b04ca0(void) { FUN_006a80d0(); return; } //@@ 00b04cd0 Unwind@00b04cd0 void Unwind_00b04cd0(void) { FUN_006a80d0(); return; } //@@ 00b04cd8 Unwind@00b04cd8 void Unwind_00b04cd8(void) { FUN_00871eb0(); return; } //@@ 00b04ce0 Unwind@00b04ce0 void Unwind_00b04ce0(void) { FUN_008ba130(); return; } //@@ 00b04ce8 Unwind@00b04ce8 void Unwind_00b04ce8(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x70)); return; } //@@ 00b04cf0 Unwind@00b04cf0 void Unwind_00b04cf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x70) + 0x18)); return; } //@@ 00b04d30 Unwind@00b04d30 void Unwind_00b04d30(void) { FUN_006a80d0(); return; } //@@ 00b04d3b Unwind@00b04d3b void Unwind_00b04d3b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b04d43 Unwind@00b04d43 void Unwind_00b04d43(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b04d80 Unwind@00b04d80 void Unwind_00b04d80(void) { FUN_006a80d0(); return; } //@@ 00b04d8b Unwind@00b04d8b void Unwind_00b04d8b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x7c)); return; } //@@ 00b04d93 Unwind@00b04d93 void Unwind_00b04d93(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b04d9b Unwind@00b04d9b void Unwind_00b04d9b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b04de0 Unwind@00b04de0 void Unwind_00b04de0(void) { FUN_006a80d0(); return; } //@@ 00b04deb Unwind@00b04deb void Unwind_00b04deb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b04df3 Unwind@00b04df3 void Unwind_00b04df3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b04e30 Unwind@00b04e30 void Unwind_00b04e30(void) { FUN_006a80d0(); return; } //@@ 00b04e3b Unwind@00b04e3b void Unwind_00b04e3b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b04e43 Unwind@00b04e43 void Unwind_00b04e43(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b04e80 Unwind@00b04e80 void Unwind_00b04e80(void) { FUN_0041d4b0(); return; } //@@ 00b04e88 Unwind@00b04e88 void Unwind_00b04e88(void) { FUN_00a55c20(); return; } //@@ 00b04ec0 Unwind@00b04ec0 void Unwind_00b04ec0(void) { FUN_0085c1d0(); return; } //@@ 00b04f00 Unwind@00b04f00 void Unwind_00b04f00(void) { FUN_0085c250(); return; } //@@ 00b04f30 Unwind@00b04f30 void Unwind_00b04f30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + 0x10)); return; } //@@ 00b04f60 Unwind@00b04f60 void Unwind_00b04f60(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x20)); return; } //@@ 00b04f68 Unwind@00b04f68 void Unwind_00b04f68(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x30)); return; } //@@ 00b04f70 Unwind@00b04f70 void Unwind_00b04f70(void) { int unaff_EBP; luabridge::Namespace::~Namespace((void *)(unaff_EBP + -0x28)); return; } //@@ 00b04f78 Unwind@00b04f78 void Unwind_00b04f78(void) { FUN_0086e4d0(); return; } //@@ 00b04fb0 Unwind@00b04fb0 void Unwind_00b04fb0(void) { FUN_0040ce00(); return; } //@@ 00b04fe0 Unwind@00b04fe0 void Unwind_00b04fe0(void) { FUN_006a80d0(); return; } //@@ 00b04fe8 Unwind@00b04fe8 void Unwind_00b04fe8(void) { FUN_006a80d0(); return; } //@@ 00b05020 Unwind@00b05020 void Unwind_00b05020(void) { FUN_006a80d0(); return; } //@@ 00b05028 Unwind@00b05028 void Unwind_00b05028(void) { FUN_006a80d0(); return; } //@@ 00b05060 Unwind@00b05060 void Unwind_00b05060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00b05068 Unwind@00b05068 void Unwind_00b05068(void) { FUN_006a80d0(); return; } //@@ 00b05070 Unwind@00b05070 void Unwind_00b05070(void) { FUN_006a80d0(); return; } //@@ 00b05078 Unwind@00b05078 void Unwind_00b05078(void) { FUN_008a80b0(); return; } //@@ 00b05080 Unwind@00b05080 void Unwind_00b05080(void) { FUN_006a80d0(); return; } //@@ 00b05088 Unwind@00b05088 void Unwind_00b05088(void) { FUN_008a80b0(); return; } //@@ 00b050d0 Unwind@00b050d0 void Unwind_00b050d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b050d8 Unwind@00b050d8 void Unwind_00b050d8(void) { FUN_006a80d0(); return; } //@@ 00b050e0 Unwind@00b050e0 void Unwind_00b050e0(void) { FUN_006a80d0(); return; } //@@ 00b050e8 Unwind@00b050e8 void Unwind_00b050e8(void) { FUN_008a80b0(); return; } //@@ 00b050f0 Unwind@00b050f0 void Unwind_00b050f0(void) { FUN_006a80d0(); return; } //@@ 00b050f8 Unwind@00b050f8 void Unwind_00b050f8(void) { FUN_008a80b0(); return; } //@@ 00b05140 Unwind@00b05140 void Unwind_00b05140(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05148 Unwind@00b05148 void Unwind_00b05148(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b05180 Unwind@00b05180 void Unwind_00b05180(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b05188 Unwind@00b05188 void Unwind_00b05188(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05190 Unwind@00b05190 void Unwind_00b05190(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00b051d0 Unwind@00b051d0 void Unwind_00b051d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b051d8 Unwind@00b051d8 void Unwind_00b051d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b05210 Unwind@00b05210 void Unwind_00b05210(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b05218 Unwind@00b05218 void Unwind_00b05218(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b05220 Unwind@00b05220 void Unwind_00b05220(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00b05260 Unwind@00b05260 void Unwind_00b05260(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b05268 Unwind@00b05268 void Unwind_00b05268(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b05270 Unwind@00b05270 void Unwind_00b05270(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd8)); return; } //@@ 00b052b0 Unwind@00b052b0 void Unwind_00b052b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b052b8 Unwind@00b052b8 void Unwind_00b052b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x50)); return; } //@@ 00b052f0 Unwind@00b052f0 void Unwind_00b052f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b052f8 Unwind@00b052f8 void Unwind_00b052f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b05330 Unwind@00b05330 void Unwind_00b05330(void) { FUN_0085d6f0(); return; } //@@ 00b05360 Unwind@00b05360 void Unwind_00b05360(void) { FUN_0085d6f0(); return; } //@@ 00b05390 Unwind@00b05390 void Unwind_00b05390(void) { FUN_008ba160(); return; } //@@ 00b0539b Unwind@00b0539b void Unwind_00b0539b(void) { FUN_008ba160(); return; } //@@ 00b053d0 Unwind@00b053d0 void Unwind_00b053d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b053d8 Unwind@00b053d8 void Unwind_00b053d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00b05410 Unwind@00b05410 void Unwind_00b05410(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b05418 Unwind@00b05418 void Unwind_00b05418(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b05420 Unwind@00b05420 void Unwind_00b05420(void) { FUN_0069d1f0(); return; } //@@ 00b05428 Unwind@00b05428 void Unwind_00b05428(void) { FUN_0069d1f0(); return; } //@@ 00b05460 Unwind@00b05460 void Unwind_00b05460(void) { FUN_008ba170(); return; } //@@ 00b0546b Unwind@00b0546b void Unwind_00b0546b(void) { FUN_008ba170(); return; } //@@ 00b054b0 Unwind@00b054b0 void Unwind_00b054b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b054b8 Unwind@00b054b8 void Unwind_00b054b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x68)); return; } //@@ 00b054c0 Unwind@00b054c0 void Unwind_00b054c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00b05500 Unwind@00b05500 void Unwind_00b05500(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b05508 Unwind@00b05508 void Unwind_00b05508(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00b05510 Unwind@00b05510 void Unwind_00b05510(void) { FUN_0069d1f0(); return; } //@@ 00b05518 Unwind@00b05518 void Unwind_00b05518(void) { FUN_0069d1f0(); return; } //@@ 00b05550 Unwind@00b05550 void Unwind_00b05550(void) { FUN_007e1430(); return; } //@@ 00b05558 Unwind@00b05558 void Unwind_00b05558(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x4c)); return; } //@@ 00b05560 Unwind@00b05560 void Unwind_00b05560(void) { FUN_007e1430(); return; } //@@ 00b055a0 Unwind@00b055a0 void Unwind_00b055a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b055a8 Unwind@00b055a8 void Unwind_00b055a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00b055e0 Unwind@00b055e0 void Unwind_00b055e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b055e8 Unwind@00b055e8 void Unwind_00b055e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b055f0 Unwind@00b055f0 void Unwind_00b055f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b055f8 Unwind@00b055f8 void Unwind_00b055f8(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x5c)); return; } //@@ 00b05630 Unwind@00b05630 void Unwind_00b05630(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + 8)); return; } //@@ 00b05660 Unwind@00b05660 void Unwind_00b05660(void) { FUN_007e3230(); return; } //@@ 00b056a0 Unwind@00b056a0 void Unwind_00b056a0(void) { FUN_0099c310(); return; } //@@ 00b056d0 Unwind@00b056d0 void Unwind_00b056d0(void) { FUN_007530c0(); return; } //@@ 00b05700 Unwind@00b05700 void Unwind_00b05700(void) { FUN_0041d4b0(); return; } //@@ 00b0570b Unwind@00b0570b void Unwind_00b0570b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00b05716 Unwind@00b05716 void Unwind_00b05716(void) { FUN_0041d4b0(); return; } //@@ 00b05721 Unwind@00b05721 void Unwind_00b05721(void) { FUN_0041d4b0(); return; } //@@ 00b0572c Unwind@00b0572c void Unwind_00b0572c(void) { FUN_0041d4b0(); return; } //@@ 00b05737 Unwind@00b05737 void Unwind_00b05737(void) { FUN_00a55c20(); return; } //@@ 00b05742 Unwind@00b05742 void Unwind_00b05742(void) { FUN_0041d4b0(); return; } //@@ 00b0574d Unwind@00b0574d void Unwind_00b0574d(void) { FUN_00a55c20(); return; } //@@ 00b05758 Unwind@00b05758 void Unwind_00b05758(void) { FUN_0041d4b0(); return; } //@@ 00b05763 Unwind@00b05763 void Unwind_00b05763(void) { FUN_0041d4b0(); return; } //@@ 00b0576e Unwind@00b0576e void Unwind_00b0576e(void) { FUN_0041d4b0(); return; } //@@ 00b057b0 Unwind@00b057b0 void Unwind_00b057b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b057b8 Unwind@00b057b8 void Unwind_00b057b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b057c0 Unwind@00b057c0 void Unwind_00b057c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b057c8 Unwind@00b057c8 void Unwind_00b057c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b057d0 Unwind@00b057d0 void Unwind_00b057d0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x80) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x80) = *(uint *)(unaff_EBP + -0x80) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05820 Unwind@00b05820 void Unwind_00b05820(void) { FUN_004242b0(); return; } //@@ 00b05828 Unwind@00b05828 void Unwind_00b05828(void) { FUN_008c9460(); return; } //@@ 00b05860 Unwind@00b05860 void Unwind_00b05860(void) { FUN_0041d4b0(); return; } //@@ 00b0586b Unwind@00b0586b void Unwind_00b0586b(void) { FUN_00a55c20(); return; } //@@ 00b058b0 Unwind@00b058b0 void Unwind_00b058b0(void) { FUN_008ca1c0(); return; } //@@ 00b058e0 Unwind@00b058e0 void Unwind_00b058e0(void) { FUN_008ca1c0(); return; } //@@ 00b05910 Unwind@00b05910 void Unwind_00b05910(void) { FUN_008caa20(); return; } //@@ 00b05950 Unwind@00b05950 void Unwind_00b05950(void) { FUN_008ea350(); return; } //@@ 00b0595b Unwind@00b0595b void Unwind_00b0595b(void) { FUN_008ea350(); return; } //@@ 00b05966 Unwind@00b05966 void Unwind_00b05966(void) { FUN_0041d4b0(); return; } //@@ 00b05971 Unwind@00b05971 void Unwind_00b05971(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00b0597c Unwind@00b0597c void Unwind_00b0597c(void) { FUN_0041d4b0(); return; } //@@ 00b059c0 Unwind@00b059c0 void Unwind_00b059c0(void) { FUN_0041d4b0(); return; } //@@ 00b05a00 Unwind@00b05a00 void Unwind_00b05a00(void) { FUN_008cb6c0(); return; } //@@ 00b05a50 Unwind@00b05a50 void Unwind_00b05a50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b05a58 Unwind@00b05a58 void Unwind_00b05a58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b05a60 Unwind@00b05a60 void Unwind_00b05a60(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x60),0x18,3,std::string::_Tidy_deallocate); return; } //@@ 00b05aa0 Unwind@00b05aa0 void Unwind_00b05aa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05aa8 Unwind@00b05aa8 void Unwind_00b05aa8(void) { std::vector::_Tidy(); return; } //@@ 00b05ab0 Unwind@00b05ab0 void Unwind_00b05ab0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05ab8 Unwind@00b05ab8 void Unwind_00b05ab8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05ac0 Unwind@00b05ac0 void Unwind_00b05ac0(void) { FUN_0041d4b0(); return; } //@@ 00b05b00 Unwind@00b05b00 void Unwind_00b05b00(void) { FUN_0041d4b0(); return; } //@@ 00b05b0b Unwind@00b05b0b void Unwind_00b05b0b(void) { FUN_00a55c20(); return; } //@@ 00b05b50 Unwind@00b05b50 void Unwind_00b05b50(void) { FUN_008ea350(); return; } //@@ 00b05b58 Unwind@00b05b58 void Unwind_00b05b58(void) { FUN_0041d4b0(); return; } //@@ 00b05b63 Unwind@00b05b63 void Unwind_00b05b63(void) { FUN_0041d4b0(); return; } //@@ 00b05b6e Unwind@00b05b6e void Unwind_00b05b6e(void) { FUN_0041d4b0(); return; } //@@ 00b05b79 Unwind@00b05b79 void Unwind_00b05b79(void) { FUN_0041d4b0(); return; } //@@ 00b05b84 Unwind@00b05b84 void Unwind_00b05b84(void) { FUN_0041d4b0(); return; } //@@ 00b05bc0 Unwind@00b05bc0 void Unwind_00b05bc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05bc8 Unwind@00b05bc8 void Unwind_00b05bc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05bd0 Unwind@00b05bd0 void Unwind_00b05bd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05c10 Unwind@00b05c10 void Unwind_00b05c10(void) { FUN_0041d4b0(); return; } //@@ 00b05c18 Unwind@00b05c18 void Unwind_00b05c18(void) { FUN_0041d4b0(); return; } //@@ 00b05c50 Unwind@00b05c50 void Unwind_00b05c50(void) { FUN_00a28730(); return; } //@@ 00b05c58 Unwind@00b05c58 void Unwind_00b05c58(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b05c60 Unwind@00b05c60 void Unwind_00b05c60(void) { FUN_008ea350(); return; } //@@ 00b05c68 Unwind@00b05c68 void Unwind_00b05c68(void) { FUN_008ea350(); return; } //@@ 00b05c70 Unwind@00b05c70 void Unwind_00b05c70(void) { FUN_008ea350(); return; } //@@ 00b05ca0 Unwind@00b05ca0 void Unwind_00b05ca0(void) { FUN_004242b0(); return; } //@@ 00b05cf0 Unwind@00b05cf0 void Unwind_00b05cf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05cf8 Unwind@00b05cf8 void Unwind_00b05cf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05d00 Unwind@00b05d00 void Unwind_00b05d00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05d08 Unwind@00b05d08 void Unwind_00b05d08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05d10 Unwind@00b05d10 void Unwind_00b05d10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05d18 Unwind@00b05d18 void Unwind_00b05d18(void) { FUN_0040c440(); return; } //@@ 00b05d50 Unwind@00b05d50 void Unwind_00b05d50(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00b05d58 Unwind@00b05d58 void Unwind_00b05d58(void) { FUN_0040c440(); return; } //@@ 00b05d90 Unwind@00b05d90 void Unwind_00b05d90(void) { FUN_0040c440(); return; } //@@ 00b05dc0 Unwind@00b05dc0 void Unwind_00b05dc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05dc8 Unwind@00b05dc8 void Unwind_00b05dc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b05dd0 Unwind@00b05dd0 void Unwind_00b05dd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b05e10 Unwind@00b05e10 void Unwind_00b05e10(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00b05e50 Unwind@00b05e50 void Unwind_00b05e50(void) { FUN_0040c440(); return; } //@@ 00b05e90 Unwind@00b05e90 void Unwind_00b05e90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b05e9b Unwind@00b05e9b void Unwind_00b05e9b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b05ea6 Unwind@00b05ea6 void Unwind_00b05ea6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b05eae Unwind@00b05eae void Unwind_00b05eae(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xec)); return; } //@@ 00b05eb9 Unwind@00b05eb9 void Unwind_00b05eb9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b05ec4 Unwind@00b05ec4 void Unwind_00b05ec4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd4)); return; } //@@ 00b05ecf Unwind@00b05ecf void Unwind_00b05ecf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b05f10 Unwind@00b05f10 void Unwind_00b05f10(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x18)); return; } //@@ 00b05f40 Unwind@00b05f40 void Unwind_00b05f40(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00b05f70 Unwind@00b05f70 void Unwind_00b05f70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b05f7b Unwind@00b05f7b void Unwind_00b05f7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b05f86 Unwind@00b05f86 void Unwind_00b05f86(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b05f8e Unwind@00b05f8e void Unwind_00b05f8e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xec)); return; } //@@ 00b05f99 Unwind@00b05f99 void Unwind_00b05f99(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b05fa4 Unwind@00b05fa4 void Unwind_00b05fa4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd4)); return; } //@@ 00b05faf Unwind@00b05faf void Unwind_00b05faf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b05ff0 Unwind@00b05ff0 void Unwind_00b05ff0(void) { FUN_004242b0(); return; } //@@ 00b05ff8 Unwind@00b05ff8 void Unwind_00b05ff8(void) { FUN_004242b0(); return; } //@@ 00b06030 Unwind@00b06030 void Unwind_00b06030(void) { FUN_004242b0(); return; } //@@ 00b0603b Unwind@00b0603b void Unwind_00b0603b(void) { FUN_0041d4b0(); return; } //@@ 00b06046 Unwind@00b06046 void Unwind_00b06046(void) { FUN_0041d4b0(); return; } //@@ 00b06051 Unwind@00b06051 void Unwind_00b06051(void) { FUN_0041d4b0(); return; } //@@ 00b06090 Unwind@00b06090 void Unwind_00b06090(void) { FUN_004242b0(); return; } //@@ 00b060c0 Unwind@00b060c0 void Unwind_00b060c0(void) { FUN_004242b0(); return; } //@@ 00b060cb Unwind@00b060cb void Unwind_00b060cb(void) { FUN_0041d4b0(); return; } //@@ 00b060d6 Unwind@00b060d6 void Unwind_00b060d6(void) { FUN_0041d4b0(); return; } //@@ 00b060e1 Unwind@00b060e1 void Unwind_00b060e1(void) { FUN_0041d4b0(); return; } //@@ 00b06120 Unwind@00b06120 void Unwind_00b06120(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 0x14)); return; } //@@ 00b06128 Unwind@00b06128 void Unwind_00b06128(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b06160 Unwind@00b06160 void Unwind_00b06160(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00b0616b Unwind@00b0616b void Unwind_00b0616b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x11c)); return; } //@@ 00b06179 Unwind@00b06179 void Unwind_00b06179(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x230)); return; } //@@ 00b06187 Unwind@00b06187 void Unwind_00b06187(void) { FUN_008e2b80(); return; } //@@ 00b06195 Unwind@00b06195 void Unwind_00b06195(void) { FUN_008e2b00(); return; } //@@ 00b061d0 Unwind@00b061d0 void Unwind_00b061d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b061d8 Unwind@00b061d8 void Unwind_00b061d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b061e0 Unwind@00b061e0 void Unwind_00b061e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b061e8 Unwind@00b061e8 void Unwind_00b061e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b06220 Unwind@00b06220 void Unwind_00b06220(void) { FUN_0041d4b0(); return; } //@@ 00b06250 Unwind@00b06250 void Unwind_00b06250(void) { FUN_00a53bc0(); return; } //@@ 00b06280 Unwind@00b06280 void Unwind_00b06280(void) { FUN_0041d4b0(); return; } //@@ 00b0628b Unwind@00b0628b void Unwind_00b0628b(void) { FUN_00a28730(); return; } //@@ 00b06296 Unwind@00b06296 void Unwind_00b06296(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xd8)); return; } //@@ 00b062a1 Unwind@00b062a1 void Unwind_00b062a1(void) { FUN_00a28730(); return; } //@@ 00b062af Unwind@00b062af void Unwind_00b062af(void) { FUN_0040c440(); return; } //@@ 00b062ba Unwind@00b062ba void Unwind_00b062ba(void) { FUN_0041d4b0(); return; } //@@ 00b062c5 Unwind@00b062c5 void Unwind_00b062c5(void) { FUN_0041d4b0(); return; } //@@ 00b06300 Unwind@00b06300 void Unwind_00b06300(void) { FUN_0041d4b0(); return; } //@@ 00b0630b Unwind@00b0630b void Unwind_00b0630b(void) { FUN_00a28730(); return; } //@@ 00b06316 Unwind@00b06316 void Unwind_00b06316(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xd4)); return; } //@@ 00b06321 Unwind@00b06321 void Unwind_00b06321(void) { FUN_00a28730(); return; } //@@ 00b0632f Unwind@00b0632f void Unwind_00b0632f(void) { FUN_0041d4b0(); return; } //@@ 00b0633a Unwind@00b0633a void Unwind_00b0633a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00b06380 Unwind@00b06380 void Unwind_00b06380(void) { FUN_0041d4b0(); return; } //@@ 00b0638b Unwind@00b0638b void Unwind_00b0638b(void) { FUN_00a28730(); return; } //@@ 00b06396 Unwind@00b06396 void Unwind_00b06396(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xfc)); return; } //@@ 00b063a1 Unwind@00b063a1 void Unwind_00b063a1(void) { FUN_00a28730(); return; } //@@ 00b063af Unwind@00b063af void Unwind_00b063af(void) { FUN_0040c440(); return; } //@@ 00b063ba Unwind@00b063ba void Unwind_00b063ba(void) { FUN_0041d4b0(); return; } //@@ 00b063c5 Unwind@00b063c5 void Unwind_00b063c5(void) { FUN_0041d4b0(); return; } //@@ 00b063d0 Unwind@00b063d0 void Unwind_00b063d0(void) { FUN_00a28730(); return; } //@@ 00b063db Unwind@00b063db void Unwind_00b063db(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xd0)); return; } //@@ 00b063e6 Unwind@00b063e6 void Unwind_00b063e6(void) { FUN_00a28730(); return; } //@@ 00b063f4 Unwind@00b063f4 void Unwind_00b063f4(void) { FUN_0041d4b0(); return; } //@@ 00b063ff Unwind@00b063ff void Unwind_00b063ff(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00b06440 Unwind@00b06440 void Unwind_00b06440(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b06448 Unwind@00b06448 void Unwind_00b06448(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x234),0x18,6,std::string::_Tidy_deallocate) ; return; } //@@ 00b0645e Unwind@00b0645e void Unwind_00b0645e(void) { FUN_0041d4b0(); return; } //@@ 00b06469 Unwind@00b06469 void Unwind_00b06469(void) { FUN_0041d4b0(); return; } //@@ 00b06474 Unwind@00b06474 void Unwind_00b06474(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x24c)); return; } //@@ 00b0647f Unwind@00b0647f void Unwind_00b0647f(void) { FUN_0041d4b0(); return; } //@@ 00b0648a Unwind@00b0648a void Unwind_00b0648a(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b06495 Unwind@00b06495 void Unwind_00b06495(void) { FUN_00a55c20(); return; } //@@ 00b064a0 Unwind@00b064a0 void Unwind_00b064a0(void) { FUN_0041d4b0(); return; } //@@ 00b064ab Unwind@00b064ab void Unwind_00b064ab(void) { FUN_0041d4b0(); return; } //@@ 00b064b6 Unwind@00b064b6 void Unwind_00b064b6(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x1a4),0x18,6,std::string::_Tidy_deallocate) ; return; } //@@ 00b064cc Unwind@00b064cc void Unwind_00b064cc(void) { FUN_0041d4b0(); return; } //@@ 00b064d7 Unwind@00b064d7 void Unwind_00b064d7(void) { FUN_0041d4b0(); return; } //@@ 00b064e2 Unwind@00b064e2 void Unwind_00b064e2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x24c)); return; } //@@ 00b06520 Unwind@00b06520 void Unwind_00b06520(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b06528 Unwind@00b06528 void Unwind_00b06528(void) { FUN_00420710(); return; } //@@ 00b06533 Unwind@00b06533 void Unwind_00b06533(void) { FUN_00a28730(); return; } //@@ 00b0653e Unwind@00b0653e void Unwind_00b0653e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06546 Unwind@00b06546 void Unwind_00b06546(void) { FUN_00a28730(); return; } //@@ 00b06580 Unwind@00b06580 void Unwind_00b06580(void) { FUN_00a53bc0(); return; } //@@ 00b065b0 Unwind@00b065b0 void Unwind_00b065b0(void) { FUN_008e2a40(); return; } //@@ 00b065b8 Unwind@00b065b8 void Unwind_00b065b8(void) { FUN_00a28730(); return; } //@@ 00b065c3 Unwind@00b065c3 void Unwind_00b065c3(void) { FUN_00415ce0(); return; } //@@ 00b065cb Unwind@00b065cb void Unwind_00b065cb(void) { FUN_008ea350(); return; } //@@ 00b065d3 Unwind@00b065d3 void Unwind_00b065d3(void) { FUN_00a28730(); return; } //@@ 00b065de Unwind@00b065de void Unwind_00b065de(void) { FUN_00a28730(); return; } //@@ 00b065e9 Unwind@00b065e9 void Unwind_00b065e9(void) { FUN_008ea350(); return; } //@@ 00b065f1 Unwind@00b065f1 void Unwind_00b065f1(void) { int unaff_EBP; FriendEntry::~FriendEntry((void *)(unaff_EBP + -0x58)); return; } //@@ 00b06620 Unwind@00b06620 void Unwind_00b06620(void) { std::list::~list(); return; } //@@ 00b06628 Unwind@00b06628 void Unwind_00b06628(void) { FUN_00a28730(); return; } //@@ 00b06636 Unwind@00b06636 void Unwind_00b06636(void) { FUN_00a28730(); return; } //@@ 00b06644 Unwind@00b06644 void Unwind_00b06644(void) { FUN_0085b260(); return; } //@@ 00b0664c Unwind@00b0664c void Unwind_00b0664c(void) { FUN_00a28730(); return; } //@@ 00b0665a Unwind@00b0665a void Unwind_00b0665a(void) { FUN_00428880(); return; } //@@ 00b06665 Unwind@00b06665 void Unwind_00b06665(void) { FUN_00a28730(); return; } //@@ 00b06673 Unwind@00b06673 void Unwind_00b06673(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xb0)); return; } //@@ 00b0667e Unwind@00b0667e void Unwind_00b0667e(void) { FUN_00a28730(); return; } //@@ 00b066c0 Unwind@00b066c0 void Unwind_00b066c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b066c8 Unwind@00b066c8 void Unwind_00b066c8(void) { std::list::~list(); return; } //@@ 00b066d3 Unwind@00b066d3 void Unwind_00b066d3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b066db Unwind@00b066db void Unwind_00b066db(void) { FUN_0085b260(); return; } //@@ 00b066e6 Unwind@00b066e6 void Unwind_00b066e6(void) { FUN_00a28730(); return; } //@@ 00b06730 Unwind@00b06730 void Unwind_00b06730(void) { FUN_00a28730(); return; } //@@ 00b0673b Unwind@00b0673b void Unwind_00b0673b(void) { FUN_008e3570(); return; } //@@ 00b06743 Unwind@00b06743 void Unwind_00b06743(void) { FUN_00a28730(); return; } //@@ 00b06770 Unwind@00b06770 void Unwind_00b06770(void) { FUN_008e3560(); return; } //@@ 00b067a0 Unwind@00b067a0 void Unwind_00b067a0(void) { FUN_008ea350(); return; } //@@ 00b067a8 Unwind@00b067a8 void Unwind_00b067a8(void) { FUN_00a28730(); return; } //@@ 00b067e0 Unwind@00b067e0 void Unwind_00b067e0(void) { FUN_008e3570(); return; } //@@ 00b067e8 Unwind@00b067e8 void Unwind_00b067e8(void) { FUN_00a28730(); return; } //@@ 00b06820 Unwind@00b06820 void Unwind_00b06820(void) { FUN_008e3560(); return; } //@@ 00b06828 Unwind@00b06828 void Unwind_00b06828(void) { FUN_008ea350(); return; } //@@ 00b06830 Unwind@00b06830 void Unwind_00b06830(void) { FUN_00a28730(); return; } //@@ 00b06860 Unwind@00b06860 void Unwind_00b06860(void) { FUN_00a28730(); return; } //@@ 00b0686b Unwind@00b0686b void Unwind_00b0686b(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(*(void **)(unaff_EBP + -0x1c)); return; } //@@ 00b06873 Unwind@00b06873 void Unwind_00b06873(void) { FUN_00a28730(); return; } //@@ 00b0687e Unwind@00b0687e void Unwind_00b0687e(void) { FUN_00a28730(); return; } //@@ 00b06889 Unwind@00b06889 void Unwind_00b06889(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(*(void **)(unaff_EBP + -0x1c)); return; } //@@ 00b06891 Unwind@00b06891 void Unwind_00b06891(void) { FUN_00a28730(); return; } //@@ 00b0689c Unwind@00b0689c void Unwind_00b0689c(void) { FUN_00a28730(); return; } //@@ 00b068a7 Unwind@00b068a7 void Unwind_00b068a7(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(*(void **)(unaff_EBP + -0x20)); return; } //@@ 00b068af Unwind@00b068af void Unwind_00b068af(void) { FUN_00a28730(); return; } //@@ 00b068ba Unwind@00b068ba void Unwind_00b068ba(void) { FUN_00a28730(); return; } //@@ 00b068c5 Unwind@00b068c5 void Unwind_00b068c5(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby(*(void **)(unaff_EBP + -0x20)); return; } //@@ 00b068cd Unwind@00b068cd void Unwind_00b068cd(void) { FUN_00a28730(); return; } //@@ 00b06900 Unwind@00b06900 void Unwind_00b06900(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b06908 Unwind@00b06908 void Unwind_00b06908(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b06910 Unwind@00b06910 void Unwind_00b06910(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06950 Unwind@00b06950 void Unwind_00b06950(void) { FUN_0041d4b0(); return; } //@@ 00b0695b Unwind@00b0695b void Unwind_00b0695b(void) { FUN_00a55c20(); return; } //@@ 00b06966 Unwind@00b06966 void Unwind_00b06966(void) { FUN_0041d4b0(); return; } //@@ 00b06971 Unwind@00b06971 void Unwind_00b06971(void) { FUN_00a55c20(); return; } //@@ 00b069b0 Unwind@00b069b0 void Unwind_00b069b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b069b8 Unwind@00b069b8 void Unwind_00b069b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b069c0 Unwind@00b069c0 void Unwind_00b069c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b069c8 Unwind@00b069c8 void Unwind_00b069c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b069d0 Unwind@00b069d0 void Unwind_00b069d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b06a10 Unwind@00b06a10 void Unwind_00b06a10(void) { FUN_00a28730(); return; } //@@ 00b06a18 Unwind@00b06a18 void Unwind_00b06a18(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x18)); return; } //@@ 00b06a20 Unwind@00b06a20 void Unwind_00b06a20(void) { FUN_00a28730(); return; } //@@ 00b06a28 Unwind@00b06a28 void Unwind_00b06a28(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b06a60 Unwind@00b06a60 void Unwind_00b06a60(void) { FUN_00420710(); return; } //@@ 00b06a6b Unwind@00b06a6b void Unwind_00b06a6b(void) { FUN_00a53bc0(); return; } //@@ 00b06aa0 Unwind@00b06aa0 void Unwind_00b06aa0(void) { std::vector::_Tidy(); return; } //@@ 00b06aa8 Unwind@00b06aa8 void Unwind_00b06aa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06ab0 Unwind@00b06ab0 void Unwind_00b06ab0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06ab8 Unwind@00b06ab8 void Unwind_00b06ab8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06ac0 Unwind@00b06ac0 void Unwind_00b06ac0(void) { FUN_0041d4b0(); return; } //@@ 00b06acb Unwind@00b06acb void Unwind_00b06acb(void) { FUN_00a55c20(); return; } //@@ 00b06b10 Unwind@00b06b10 void Unwind_00b06b10(void) { FUN_008e68e0(); return; } //@@ 00b06b18 Unwind@00b06b18 void Unwind_00b06b18(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xa8)); return; } //@@ 00b06b23 Unwind@00b06b23 void Unwind_00b06b23(void) { FUN_0085b260(); return; } //@@ 00b06b2b Unwind@00b06b2b void Unwind_00b06b2b(void) { FUN_00a28730(); return; } //@@ 00b06b36 Unwind@00b06b36 void Unwind_00b06b36(void) { FUN_0042a230(); return; } //@@ 00b06b41 Unwind@00b06b41 void Unwind_00b06b41(void) { FUN_00a28730(); return; } //@@ 00b06b4c Unwind@00b06b4c void Unwind_00b06b4c(void) { FUN_00a28730(); return; } //@@ 00b06b57 Unwind@00b06b57 void Unwind_00b06b57(void) { FUN_00a28730(); return; } //@@ 00b06b62 Unwind@00b06b62 void Unwind_00b06b62(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x90)); return; } //@@ 00b06ba0 Unwind@00b06ba0 void Unwind_00b06ba0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b06ba8 Unwind@00b06ba8 void Unwind_00b06ba8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b06bb0 Unwind@00b06bb0 void Unwind_00b06bb0(void) { FUN_00420710(); return; } //@@ 00b06bbb Unwind@00b06bbb void Unwind_00b06bbb(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b06bc3 Unwind@00b06bc3 void Unwind_00b06bc3(void) { FUN_00420710(); return; } //@@ 00b06c00 Unwind@00b06c00 void Unwind_00b06c00(void) { FUN_0041d4b0(); return; } //@@ 00b06c08 Unwind@00b06c08 void Unwind_00b06c08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b06c10 Unwind@00b06c10 void Unwind_00b06c10(void) { FUN_0041d4b0(); return; } //@@ 00b06c18 Unwind@00b06c18 void Unwind_00b06c18(void) { FUN_0041d4b0(); return; } //@@ 00b06c20 Unwind@00b06c20 void Unwind_00b06c20(void) { FUN_0041d4b0(); return; } //@@ 00b06c28 Unwind@00b06c28 void Unwind_00b06c28(void) { FUN_0041d4b0(); return; } //@@ 00b06c30 Unwind@00b06c30 void Unwind_00b06c30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b06c38 Unwind@00b06c38 void Unwind_00b06c38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b06c70 Unwind@00b06c70 void Unwind_00b06c70(void) { FUN_008ea350(); return; } //@@ 00b06ca0 Unwind@00b06ca0 void Unwind_00b06ca0(void) { FUN_00a28730(); return; } //@@ 00b06cd0 Unwind@00b06cd0 void Unwind_00b06cd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06cd8 Unwind@00b06cd8 void Unwind_00b06cd8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06ce0 Unwind@00b06ce0 void Unwind_00b06ce0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b06ce8 Unwind@00b06ce8 void Unwind_00b06ce8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b06d20 Unwind@00b06d20 void Unwind_00b06d20(void) { FUN_00a28730(); return; } //@@ 00b06d2b Unwind@00b06d2b void Unwind_00b06d2b(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x8c)); return; } //@@ 00b06d36 Unwind@00b06d36 void Unwind_00b06d36(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xa4)); return; } //@@ 00b06d41 Unwind@00b06d41 void Unwind_00b06d41(void) { FUN_008ea350(); return; } //@@ 00b06d4c Unwind@00b06d4c void Unwind_00b06d4c(void) { FUN_008eee70(); return; } //@@ 00b06d57 Unwind@00b06d57 void Unwind_00b06d57(void) { FUN_00420710(); return; } //@@ 00b06d62 Unwind@00b06d62 void Unwind_00b06d62(void) { FUN_00a28730(); return; } //@@ 00b06d6a Unwind@00b06d6a void Unwind_00b06d6a(void) { FUN_00420710(); return; } //@@ 00b06db0 Unwind@00b06db0 void Unwind_00b06db0(void) { FUN_0041d4b0(); return; } //@@ 00b06dbb Unwind@00b06dbb void Unwind_00b06dbb(void) { FUN_0041d4b0(); return; } //@@ 00b06dc6 Unwind@00b06dc6 void Unwind_00b06dc6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00b06dd1 Unwind@00b06dd1 void Unwind_00b06dd1(void) { FUN_0041d4b0(); return; } //@@ 00b06e10 Unwind@00b06e10 void Unwind_00b06e10(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x68)); return; } //@@ 00b06e18 Unwind@00b06e18 void Unwind_00b06e18(void) { FUN_00a28730(); return; } //@@ 00b06e20 Unwind@00b06e20 void Unwind_00b06e20(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b06e28 Unwind@00b06e28 void Unwind_00b06e28(void) { FUN_008ea350(); return; } //@@ 00b06e30 Unwind@00b06e30 void Unwind_00b06e30(void) { FUN_008ea350(); return; } //@@ 00b06e38 Unwind@00b06e38 void Unwind_00b06e38(void) { FUN_00a28730(); return; } //@@ 00b06e40 Unwind@00b06e40 void Unwind_00b06e40(void) { FUN_00708d40(); return; } //@@ 00b06e48 Unwind@00b06e48 void Unwind_00b06e48(void) { FUN_00a28730(); return; } //@@ 00b06e50 Unwind@00b06e50 void Unwind_00b06e50(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b06e58 Unwind@00b06e58 void Unwind_00b06e58(void) { FUN_008ea350(); return; } //@@ 00b06e60 Unwind@00b06e60 void Unwind_00b06e60(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b06e68 Unwind@00b06e68 void Unwind_00b06e68(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x74)); return; } //@@ 00b06ea0 Unwind@00b06ea0 void Unwind_00b06ea0(void) { FUN_00a28730(); return; } //@@ 00b06ea8 Unwind@00b06ea8 void Unwind_00b06ea8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x3c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x3c) = *(uint *)(unaff_EBP + -0x3c) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b06ec1 Unwind@00b06ec1 void Unwind_00b06ec1(void) { FUN_00a28730(); return; } //@@ 00b06ec9 Unwind@00b06ec9 void Unwind_00b06ec9(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b06ed1 Unwind@00b06ed1 void Unwind_00b06ed1(void) { FUN_00a28730(); return; } //@@ 00b06ed9 Unwind@00b06ed9 void Unwind_00b06ed9(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b06ee1 Unwind@00b06ee1 void Unwind_00b06ee1(void) { FUN_00420710(); return; } //@@ 00b06f20 Unwind@00b06f20 void Unwind_00b06f20(void) { FUN_00708d40(); return; } //@@ 00b06f50 Unwind@00b06f50 void Unwind_00b06f50(void) { FUN_00a28730(); return; } //@@ 00b06f58 Unwind@00b06f58 void Unwind_00b06f58(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x44)); return; } //@@ 00b06f60 Unwind@00b06f60 void Unwind_00b06f60(void) { FUN_008ea350(); return; } //@@ 00b06f68 Unwind@00b06f68 void Unwind_00b06f68(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x30) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x30) = *(uint *)(unaff_EBP + -0x30) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x1c)); return; } //@@ 00b06f81 Unwind@00b06f81 void Unwind_00b06f81(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b06f89 Unwind@00b06f89 void Unwind_00b06f89(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b06f91 Unwind@00b06f91 void Unwind_00b06f91(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b06f99 Unwind@00b06f99 void Unwind_00b06f99(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x44)); return; } //@@ 00b06fd0 Unwind@00b06fd0 void Unwind_00b06fd0(void) { FUN_00a28730(); return; } //@@ 00b06fd8 Unwind@00b06fd8 void Unwind_00b06fd8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b06fe0 Unwind@00b06fe0 void Unwind_00b06fe0(void) { FUN_008ea350(); return; } //@@ 00b06fe8 Unwind@00b06fe8 void Unwind_00b06fe8(void) { FUN_00420710(); return; } //@@ 00b06ff3 Unwind@00b06ff3 void Unwind_00b06ff3(void) { FUN_00a28730(); return; } //@@ 00b06ffb Unwind@00b06ffb void Unwind_00b06ffb(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b07014 Unwind@00b07014 void Unwind_00b07014(void) { FUN_00a28730(); return; } //@@ 00b0701c Unwind@00b0701c void Unwind_00b0701c(void) { FUN_00a28730(); return; } //@@ 00b07024 Unwind@00b07024 void Unwind_00b07024(void) { FUN_00a28730(); return; } //@@ 00b0702c Unwind@00b0702c void Unwind_00b0702c(void) { FUN_00708d40(); return; } //@@ 00b07060 Unwind@00b07060 void Unwind_00b07060(void) { FUN_00a28730(); return; } //@@ 00b07068 Unwind@00b07068 void Unwind_00b07068(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x80)); return; } //@@ 00b07070 Unwind@00b07070 void Unwind_00b07070(void) { FUN_0085b260(); return; } //@@ 00b07078 Unwind@00b07078 void Unwind_00b07078(void) { FUN_00a28730(); return; } //@@ 00b07083 Unwind@00b07083 void Unwind_00b07083(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x90)); return; } //@@ 00b0708e Unwind@00b0708e void Unwind_00b0708e(void) { FUN_00a28730(); return; } //@@ 00b070d0 Unwind@00b070d0 void Unwind_00b070d0(void) { FUN_0041d4b0(); return; } //@@ 00b07100 Unwind@00b07100 void Unwind_00b07100(void) { FUN_00a28730(); return; } //@@ 00b07108 Unwind@00b07108 void Unwind_00b07108(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b07110 Unwind@00b07110 void Unwind_00b07110(void) { FUN_00a28730(); return; } //@@ 00b07118 Unwind@00b07118 void Unwind_00b07118(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b07120 Unwind@00b07120 void Unwind_00b07120(void) { FUN_008ea350(); return; } //@@ 00b07128 Unwind@00b07128 void Unwind_00b07128(void) { FUN_00a28730(); return; } //@@ 00b07130 Unwind@00b07130 void Unwind_00b07130(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b07138 Unwind@00b07138 void Unwind_00b07138(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b07140 Unwind@00b07140 void Unwind_00b07140(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b07148 Unwind@00b07148 void Unwind_00b07148(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b07150 Unwind@00b07150 void Unwind_00b07150(void) { FUN_0041d4b0(); return; } //@@ 00b0715b Unwind@00b0715b void Unwind_00b0715b(void) { FUN_008eee70(); return; } //@@ 00b07163 Unwind@00b07163 void Unwind_00b07163(void) { FUN_0041d4b0(); return; } //@@ 00b071a0 Unwind@00b071a0 void Unwind_00b071a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b071a8 Unwind@00b071a8 void Unwind_00b071a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b071b3 Unwind@00b071b3 void Unwind_00b071b3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b071f0 Unwind@00b071f0 void Unwind_00b071f0(void) { FUN_00a28730(); return; } //@@ 00b071f8 Unwind@00b071f8 void Unwind_00b071f8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b07200 Unwind@00b07200 void Unwind_00b07200(void) { FUN_00a28730(); return; } //@@ 00b07208 Unwind@00b07208 void Unwind_00b07208(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b07210 Unwind@00b07210 void Unwind_00b07210(void) { FUN_008ea350(); return; } //@@ 00b07218 Unwind@00b07218 void Unwind_00b07218(void) { FUN_008eee70(); return; } //@@ 00b07220 Unwind@00b07220 void Unwind_00b07220(void) { FUN_00a28730(); return; } //@@ 00b07228 Unwind@00b07228 void Unwind_00b07228(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b07230 Unwind@00b07230 void Unwind_00b07230(void) { FUN_00a28730(); return; } //@@ 00b07238 Unwind@00b07238 void Unwind_00b07238(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b07270 Unwind@00b07270 void Unwind_00b07270(void) { FUN_00a28730(); return; } //@@ 00b07278 Unwind@00b07278 void Unwind_00b07278(void) { FUN_00a28730(); return; } //@@ 00b07280 Unwind@00b07280 void Unwind_00b07280(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x34)); return; } //@@ 00b072b0 Unwind@00b072b0 void Unwind_00b072b0(void) { FUN_008ea350(); return; } //@@ 00b072b8 Unwind@00b072b8 void Unwind_00b072b8(void) { FUN_00a58200(); return; } //@@ 00b072c3 Unwind@00b072c3 void Unwind_00b072c3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b072cb Unwind@00b072cb void Unwind_00b072cb(void) { FUN_00708d40(); return; } //@@ 00b07310 Unwind@00b07310 void Unwind_00b07310(void) { FUN_00708d40(); return; } //@@ 00b07340 Unwind@00b07340 void Unwind_00b07340(void) { FUN_008ea350(); return; } //@@ 00b07348 Unwind@00b07348 void Unwind_00b07348(void) { FUN_00708d40(); return; } //@@ 00b07350 Unwind@00b07350 void Unwind_00b07350(void) { FUN_00708d40(); return; } //@@ 00b07380 Unwind@00b07380 void Unwind_00b07380(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b07388 Unwind@00b07388 void Unwind_00b07388(void) { FUN_00a28730(); return; } //@@ 00b073c0 Unwind@00b073c0 void Unwind_00b073c0(void) { FUN_00a28730(); return; } //@@ 00b073c8 Unwind@00b073c8 void Unwind_00b073c8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b073e1 Unwind@00b073e1 void Unwind_00b073e1(void) { FUN_00a28730(); return; } //@@ 00b073e9 Unwind@00b073e9 void Unwind_00b073e9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffd; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b07402 Unwind@00b07402 void Unwind_00b07402(void) { FUN_00a28730(); return; } //@@ 00b0740a Unwind@00b0740a void Unwind_00b0740a(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x44)); return; } //@@ 00b07440 Unwind@00b07440 void Unwind_00b07440(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0xb0); return; } //@@ 00b07480 Unwind@00b07480 void Unwind_00b07480(void) { FUN_0060cc00(); return; } //@@ 00b074b0 Unwind@00b074b0 void Unwind_00b074b0(void) { FUN_0041d4b0(); return; } //@@ 00b074e0 Unwind@00b074e0 void Unwind_00b074e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x464)); return; } //@@ 00b074eb Unwind@00b074eb void Unwind_00b074eb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x47c)); return; } //@@ 00b074f6 Unwind@00b074f6 void Unwind_00b074f6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x448)); return; } //@@ 00b07501 Unwind@00b07501 void Unwind_00b07501(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4e0)); return; } //@@ 00b0750c Unwind@00b0750c void Unwind_00b0750c(void) { FUN_0041d4b0(); return; } //@@ 00b07517 Unwind@00b07517 void Unwind_00b07517(void) { FUN_00a55c20(); return; } //@@ 00b07560 Unwind@00b07560 void Unwind_00b07560(void) { FUN_00413b40(); return; } //@@ 00b0756b Unwind@00b0756b void Unwind_00b0756b(void) { FUN_008f2680(); return; } //@@ 00b07573 Unwind@00b07573 void Unwind_00b07573(void) { FUN_008f2680(); return; } //@@ 00b0757b Unwind@00b0757b void Unwind_00b0757b(void) { FUN_008f2680(); return; } //@@ 00b07583 Unwind@00b07583 void Unwind_00b07583(void) { FUN_008f2680(); return; } //@@ 00b075e0 Unwind@00b075e0 void Unwind_00b075e0(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10)); return; } //@@ 00b075e8 Unwind@00b075e8 void Unwind_00b075e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x18)); return; } //@@ 00b075f3 Unwind@00b075f3 void Unwind_00b075f3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x30)); return; } //@@ 00b075fe Unwind@00b075fe void Unwind_00b075fe(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x48)); return; } //@@ 00b07609 Unwind@00b07609 void Unwind_00b07609(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x60)); return; } //@@ 00b07614 Unwind@00b07614 void Unwind_00b07614(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x78)); return; } //@@ 00b0761f Unwind@00b0761f void Unwind_00b0761f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x90)); return; } //@@ 00b0762d Unwind@00b0762d void Unwind_00b0762d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xa8)); return; } //@@ 00b0763b Unwind@00b0763b void Unwind_00b0763b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xc0)); return; } //@@ 00b07649 Unwind@00b07649 void Unwind_00b07649(void) { std::vector::_Tidy(); return; } //@@ 00b07657 Unwind@00b07657 void Unwind_00b07657(void) { FUN_00498f80(); return; } //@@ 00b07665 Unwind@00b07665 void Unwind_00b07665(void) { FUN_00436fb0(); return; } //@@ 00b0766d Unwind@00b0766d void Unwind_00b0766d(void) { FUN_008f2fb0(); return; } //@@ 00b076a0 Unwind@00b076a0 void Unwind_00b076a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076a8 Unwind@00b076a8 void Unwind_00b076a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b076b0 Unwind@00b076b0 void Unwind_00b076b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076b8 Unwind@00b076b8 void Unwind_00b076b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076c0 Unwind@00b076c0 void Unwind_00b076c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076c8 Unwind@00b076c8 void Unwind_00b076c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076d0 Unwind@00b076d0 void Unwind_00b076d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076d8 Unwind@00b076d8 void Unwind_00b076d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076e0 Unwind@00b076e0 void Unwind_00b076e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076e8 Unwind@00b076e8 void Unwind_00b076e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076f0 Unwind@00b076f0 void Unwind_00b076f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b076f8 Unwind@00b076f8 void Unwind_00b076f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07700 Unwind@00b07700 void Unwind_00b07700(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07708 Unwind@00b07708 void Unwind_00b07708(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07710 Unwind@00b07710 void Unwind_00b07710(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07718 Unwind@00b07718 void Unwind_00b07718(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07720 Unwind@00b07720 void Unwind_00b07720(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07728 Unwind@00b07728 void Unwind_00b07728(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b07730 Unwind@00b07730 void Unwind_00b07730(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b07770 Unwind@00b07770 void Unwind_00b07770(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07778 Unwind@00b07778 void Unwind_00b07778(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b077b0 Unwind@00b077b0 void Unwind_00b077b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b077b8 Unwind@00b077b8 void Unwind_00b077b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b077c0 Unwind@00b077c0 void Unwind_00b077c0(void) { FUN_00413b40(); return; } //@@ 00b077cb Unwind@00b077cb void Unwind_00b077cb(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10128),0x80); return; } //@@ 00b077e0 Unwind@00b077e0 void Unwind_00b077e0(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10128)); return; } //@@ 00b077eb Unwind@00b077eb void Unwind_00b077eb(void) { FUN_00a24660(); return; } //@@ 00b077f9 Unwind@00b077f9 void Unwind_00b077f9(void) { FUN_0041c710(); return; } //@@ 00b07807 Unwind@00b07807 void Unwind_00b07807(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0780f Unwind@00b0780f void Unwind_00b0780f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b07817 Unwind@00b07817 void Unwind_00b07817(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0781f Unwind@00b0781f void Unwind_00b0781f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b07827 Unwind@00b07827 void Unwind_00b07827(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0782f Unwind@00b0782f void Unwind_00b0782f(void) { FUN_004999b0(); return; } //@@ 00b07870 Unwind@00b07870 void Unwind_00b07870(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07878 Unwind@00b07878 void Unwind_00b07878(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b07880 Unwind@00b07880 void Unwind_00b07880(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b07888 Unwind@00b07888 void Unwind_00b07888(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b078c0 Unwind@00b078c0 void Unwind_00b078c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b078c8 Unwind@00b078c8 void Unwind_00b078c8(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10100),0xf04); return; } //@@ 00b078dd Unwind@00b078dd void Unwind_00b078dd(void) { FUN_00413b40(); return; } //@@ 00b078e8 Unwind@00b078e8 void Unwind_00b078e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b078f0 Unwind@00b078f0 void Unwind_00b078f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00b078f8 Unwind@00b078f8 void Unwind_00b078f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b07900 Unwind@00b07900 void Unwind_00b07900(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b07940 Unwind@00b07940 void Unwind_00b07940(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b07948 Unwind@00b07948 void Unwind_00b07948(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b07950 Unwind@00b07950 void Unwind_00b07950(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07990 Unwind@00b07990 void Unwind_00b07990(void) { FUN_006a80d0(); return; } //@@ 00b07998 Unwind@00b07998 void Unwind_00b07998(void) { FUN_006a80d0(); return; } //@@ 00b079d0 Unwind@00b079d0 void Unwind_00b079d0(void) { FUN_0041c710(); return; } //@@ 00b07a20 Unwind@00b07a20 void Unwind_00b07a20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b07a28 Unwind@00b07a28 void Unwind_00b07a28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07a30 Unwind@00b07a30 void Unwind_00b07a30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b07a38 Unwind@00b07a38 void Unwind_00b07a38(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b07a40 Unwind@00b07a40 void Unwind_00b07a40(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0xa4) * 0x5c; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0xb4),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b07ab0 Unwind@00b07ab0 void Unwind_00b07ab0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b07ab8 Unwind@00b07ab8 void Unwind_00b07ab8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07af0 Unwind@00b07af0 void Unwind_00b07af0(void) { FUN_00413b40(); return; } //@@ 00b07afb Unwind@00b07afb void Unwind_00b07afb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07b40 Unwind@00b07b40 void Unwind_00b07b40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b07b48 Unwind@00b07b48 void Unwind_00b07b48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b07b50 Unwind@00b07b50 void Unwind_00b07b50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b07b90 Unwind@00b07b90 void Unwind_00b07b90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07b98 Unwind@00b07b98 void Unwind_00b07b98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b07bd0 Unwind@00b07bd0 void Unwind_00b07bd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07c10 Unwind@00b07c10 void Unwind_00b07c10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b07c18 Unwind@00b07c18 void Unwind_00b07c18(void) { FUN_007e1410(); return; } //@@ 00b07c23 Unwind@00b07c23 void Unwind_00b07c23(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00b07c2b Unwind@00b07c2b void Unwind_00b07c2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b07c33 Unwind@00b07c33 void Unwind_00b07c33(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b07c70 Unwind@00b07c70 void Unwind_00b07c70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -600)); return; } //@@ 00b07c7b Unwind@00b07c7b void Unwind_00b07c7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x228)); return; } //@@ 00b07c86 Unwind@00b07c86 void Unwind_00b07c86(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x288)); return; } //@@ 00b07c91 Unwind@00b07c91 void Unwind_00b07c91(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x288)); return; } //@@ 00b07c9c Unwind@00b07c9c void Unwind_00b07c9c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x270)); return; } //@@ 00b07ca7 Unwind@00b07ca7 void Unwind_00b07ca7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x240)); return; } //@@ 00b07cf0 Unwind@00b07cf0 void Unwind_00b07cf0(void) { thunk_FUN_008fc660(); return; } //@@ 00b07cfb Unwind@00b07cfb void Unwind_00b07cfb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x430)); return; } //@@ 00b07d06 Unwind@00b07d06 void Unwind_00b07d06(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4a8)); return; } //@@ 00b07d11 Unwind@00b07d11 void Unwind_00b07d11(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x478)); return; } //@@ 00b07d1c Unwind@00b07d1c void Unwind_00b07d1c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x460)); return; } //@@ 00b07d27 Unwind@00b07d27 void Unwind_00b07d27(void) { FUN_00413b40(); return; } //@@ 00b07d32 Unwind@00b07d32 void Unwind_00b07d32(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x510)); return; } //@@ 00b07d3d Unwind@00b07d3d void Unwind_00b07d3d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x490)); return; } //@@ 00b07d48 Unwind@00b07d48 void Unwind_00b07d48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x448)); return; } //@@ 00b07d53 Unwind@00b07d53 void Unwind_00b07d53(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x448)); return; } //@@ 00b07d5e Unwind@00b07d5e void Unwind_00b07d5e(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10560) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x10560) = *(uint *)(unaff_EBP + -0x10560) & 0xfffffffb; /* WARNING: Could not recover jumptable at 0x00b07d77. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_> ((basic_ios_> *)(unaff_EBP + -0x60)); return; } //@@ 00b07d7e Unwind@00b07d7e void Unwind_00b07d7e(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00b07d84. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_iostream_>::~basic_iostream_> ((basic_iostream_> *)(unaff_EBP + -0xa8)); return; } //@@ 00b07d8a Unwind@00b07d8a void Unwind_00b07d8a(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00b07d90. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_streambuf_>::~basic_streambuf_> (*(basic_streambuf_> **)(unaff_EBP + -0x10574)); return; } //@@ 00b07d96 Unwind@00b07d96 void Unwind_00b07d96(void) { FUN_0040d480(); return; } //@@ 00b07da1 Unwind@00b07da1 void Unwind_00b07da1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x448)); return; } //@@ 00b07dac Unwind@00b07dac void Unwind_00b07dac(void) { FUN_007e1410(); return; } //@@ 00b07db7 Unwind@00b07db7 void Unwind_00b07db7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10560) + 4)); return; } //@@ 00b07dc5 Unwind@00b07dc5 void Unwind_00b07dc5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10560) + 0x1c)); return; } //@@ 00b07dd3 Unwind@00b07dd3 void Unwind_00b07dd3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x430)); return; } //@@ 00b07e10 Unwind@00b07e10 void Unwind_00b07e10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00b07e1b Unwind@00b07e1b void Unwind_00b07e1b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1c)); return; } //@@ 00b07e50 Unwind@00b07e50 void Unwind_00b07e50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x2c) + 4)); return; } //@@ 00b07e5b Unwind@00b07e5b void Unwind_00b07e5b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x2c) + 0x1c)); return; } //@@ 00b07e90 Unwind@00b07e90 void Unwind_00b07e90(void) { FUN_0041d210(); return; } //@@ 00b07e98 Unwind@00b07e98 void Unwind_00b07e98(void) { FUN_0041d210(); return; } //@@ 00b07ed0 Unwind@00b07ed0 void Unwind_00b07ed0(void) { FUN_00708d40(); return; } //@@ 00b07f00 Unwind@00b07f00 void Unwind_00b07f00(void) { FUN_00694210(); return; } //@@ 00b07f30 Unwind@00b07f30 void Unwind_00b07f30(void) { FUN_00708d40(); return; } //@@ 00b07f38 Unwind@00b07f38 void Unwind_00b07f38(void) { FUN_00708d40(); return; } //@@ 00b07f70 Unwind@00b07f70 void Unwind_00b07f70(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x250),0x18); return; } //@@ 00b07f82 Unwind@00b07f82 void Unwind_00b07f82(void) { FUN_00708d40(); return; } //@@ 00b07f8d Unwind@00b07f8d void Unwind_00b07f8d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x248)); return; } //@@ 00b07f98 Unwind@00b07f98 void Unwind_00b07f98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x230)); return; } //@@ 00b07fe0 Unwind@00b07fe0 void Unwind_00b07fe0(void) { FUN_008ea350(); return; } //@@ 00b07fe8 Unwind@00b07fe8 void Unwind_00b07fe8(void) { FUN_008ea350(); return; } //@@ 00b08020 Unwind@00b08020 void Unwind_00b08020(void) { FUN_00708d40(); return; } //@@ 00b08050 Unwind@00b08050 void Unwind_00b08050(void) { FUN_00708d40(); return; } //@@ 00b0805b Unwind@00b0805b void Unwind_00b0805b(void) { FUN_00a58200(); return; } //@@ 00b08063 Unwind@00b08063 void Unwind_00b08063(void) { FUN_00708d40(); return; } //@@ 00b0806b Unwind@00b0806b void Unwind_00b0806b(void) { FUN_008ea350(); return; } //@@ 00b08073 Unwind@00b08073 void Unwind_00b08073(void) { FUN_008ea350(); return; } //@@ 00b0807b Unwind@00b0807b void Unwind_00b0807b(void) { FUN_00a58200(); return; } //@@ 00b08083 Unwind@00b08083 void Unwind_00b08083(void) { FUN_00708d40(); return; } //@@ 00b0808b Unwind@00b0808b void Unwind_00b0808b(void) { FUN_008ea350(); return; } //@@ 00b08093 Unwind@00b08093 void Unwind_00b08093(void) { FUN_008ea350(); return; } //@@ 00b080c0 Unwind@00b080c0 void Unwind_00b080c0(void) { FUN_00708d40(); return; } //@@ 00b080cb Unwind@00b080cb void Unwind_00b080cb(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x24),0x18); return; } //@@ 00b080da Unwind@00b080da void Unwind_00b080da(void) { FUN_00a58200(); return; } //@@ 00b08110 Unwind@00b08110 void Unwind_00b08110(void) { FUN_00708d40(); return; } //@@ 00b08140 Unwind@00b08140 void Unwind_00b08140(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x230)); return; } //@@ 00b0814b Unwind@00b0814b void Unwind_00b0814b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x248)); return; } //@@ 00b08190 Unwind@00b08190 void Unwind_00b08190(void) { FUN_00900c90(); return; } //@@ 00b081c0 Unwind@00b081c0 void Unwind_00b081c0(void) { FUN_00900c90(); return; } //@@ 00b081f0 Unwind@00b081f0 void Unwind_00b081f0(void) { FUN_004242b0(); return; } //@@ 00b08220 Unwind@00b08220 void Unwind_00b08220(void) { FUN_00901450(); return; } //@@ 00b08250 Unwind@00b08250 void Unwind_00b08250(void) { FUN_00901450(); return; } //@@ 00b08280 Unwind@00b08280 void Unwind_00b08280(void) { FUN_00a1e1f0(); return; } //@@ 00b08288 Unwind@00b08288 void Unwind_00b08288(void) { FUN_008ea350(); return; } //@@ 00b08296 Unwind@00b08296 void Unwind_00b08296(void) { FUN_004242b0(); return; } //@@ 00b082a4 Unwind@00b082a4 void Unwind_00b082a4(void) { FUN_00901910(); return; } //@@ 00b082b2 Unwind@00b082b2 void Unwind_00b082b2(void) { FUN_00901910(); return; } //@@ 00b082c0 Unwind@00b082c0 void Unwind_00b082c0(void) { FUN_0042c780(); return; } //@@ 00b082ce Unwind@00b082ce void Unwind_00b082ce(void) { std::vector::_Tidy(); return; } //@@ 00b08300 Unwind@00b08300 void Unwind_00b08300(void) { FUN_00a1e1f0(); return; } //@@ 00b08308 Unwind@00b08308 void Unwind_00b08308(void) { FUN_008ea350(); return; } //@@ 00b08316 Unwind@00b08316 void Unwind_00b08316(void) { FUN_004242b0(); return; } //@@ 00b08324 Unwind@00b08324 void Unwind_00b08324(void) { FUN_00901910(); return; } //@@ 00b08332 Unwind@00b08332 void Unwind_00b08332(void) { FUN_00901910(); return; } //@@ 00b08340 Unwind@00b08340 void Unwind_00b08340(void) { FUN_0042c780(); return; } //@@ 00b0834e Unwind@00b0834e void Unwind_00b0834e(void) { std::vector::_Tidy(); return; } //@@ 00b0835c Unwind@00b0835c void Unwind_00b0835c(void) { FUN_00902c90(); return; } //@@ 00b0836a Unwind@00b0836a void Unwind_00b0836a(void) { FUN_004242b0(); return; } //@@ 00b083a0 Unwind@00b083a0 void Unwind_00b083a0(void) { FUN_008eee70(); return; } //@@ 00b083a8 Unwind@00b083a8 void Unwind_00b083a8(void) { FUN_0042a210(); return; } //@@ 00b083e0 Unwind@00b083e0 void Unwind_00b083e0(void) { FUN_00708d40(); return; } //@@ 00b083e8 Unwind@00b083e8 void Unwind_00b083e8(void) { FUN_00a58200(); return; } //@@ 00b08440 Unwind@00b08440 void Unwind_00b08440(void) { FUN_00a58200(); return; } //@@ 00b08448 Unwind@00b08448 void Unwind_00b08448(void) { FUN_00708d40(); return; } //@@ 00b08480 Unwind@00b08480 void Unwind_00b08480(void) { FUN_008ea350(); return; } //@@ 00b084c0 Unwind@00b084c0 void Unwind_00b084c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b084c8 Unwind@00b084c8 void Unwind_00b084c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b084d0 Unwind@00b084d0 void Unwind_00b084d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b084d8 Unwind@00b084d8 void Unwind_00b084d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b084e0 Unwind@00b084e0 void Unwind_00b084e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b084e8 Unwind@00b084e8 void Unwind_00b084e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b08520 Unwind@00b08520 void Unwind_00b08520(void) { FUN_00a58200(); return; } //@@ 00b0852b Unwind@00b0852b void Unwind_00b0852b(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x424) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x424) = *(uint *)(unaff_EBP + -0x424) & 0xfffffffe; /* WARNING: Could not recover jumptable at 0x00b08547. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_> ((basic_ios_> *)(unaff_EBP + -0x4bc)); return; } //@@ 00b0854e Unwind@00b0854e void Unwind_00b0854e(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00b08554. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_iostream_>::~basic_iostream_> ((basic_iostream_> *)(unaff_EBP + -0x504)); return; } //@@ 00b0855a Unwind@00b0855a void Unwind_00b0855a(void) { FUN_0040d480(); return; } //@@ 00b08565 Unwind@00b08565 void Unwind_00b08565(void) { FUN_0040d480(); return; } //@@ 00b085d0 Unwind@00b085d0 void Unwind_00b085d0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xa8) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xa8) = *(uint *)(unaff_EBP + -0xa8) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0xb0)); return; } //@@ 00b085f2 Unwind@00b085f2 void Unwind_00b085f2(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b085fa Unwind@00b085fa void Unwind_00b085fa(void) { FUN_00a28730(); return; } //@@ 00b08602 Unwind@00b08602 void Unwind_00b08602(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b0860a Unwind@00b0860a void Unwind_00b0860a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b08612 Unwind@00b08612 void Unwind_00b08612(void) { FUN_008ea350(); return; } //@@ 00b0861a Unwind@00b0861a void Unwind_00b0861a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b08660 Unwind@00b08660 void Unwind_00b08660(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x3c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x3c) = *(uint *)(unaff_EBP + -0x3c) & 0xfffffffe; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x44)); return; } //@@ 00b08679 Unwind@00b08679 void Unwind_00b08679(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b086b0 Unwind@00b086b0 void Unwind_00b086b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x160)); return; } //@@ 00b086bb Unwind@00b086bb void Unwind_00b086bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x178)); return; } //@@ 00b08700 Unwind@00b08700 void Unwind_00b08700(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00b08708 Unwind@00b08708 void Unwind_00b08708(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x98)); return; } //@@ 00b08713 Unwind@00b08713 void Unwind_00b08713(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x80)); return; } //@@ 00b08750 Unwind@00b08750 void Unwind_00b08750(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b08758 Unwind@00b08758 void Unwind_00b08758(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b08760 Unwind@00b08760 void Unwind_00b08760(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b08768 Unwind@00b08768 void Unwind_00b08768(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b08770 Unwind@00b08770 void Unwind_00b08770(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b08778 Unwind@00b08778 void Unwind_00b08778(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b08780 Unwind@00b08780 void Unwind_00b08780(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b08788 Unwind@00b08788 void Unwind_00b08788(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b08790 Unwind@00b08790 void Unwind_00b08790(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b08798 Unwind@00b08798 void Unwind_00b08798(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b087a0 Unwind@00b087a0 void Unwind_00b087a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b087a8 Unwind@00b087a8 void Unwind_00b087a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b087e0 Unwind@00b087e0 void Unwind_00b087e0(void) { FUN_008ea350(); return; } //@@ 00b08810 Unwind@00b08810 void Unwind_00b08810(void) { FUN_004242b0(); return; } //@@ 00b08840 Unwind@00b08840 void Unwind_00b08840(void) { int unaff_EBP; GameStatePlayer::~GameStatePlayer((GameStatePlayer *)(unaff_EBP + -0x5f0)); return; } //@@ 00b08880 Unwind@00b08880 void Unwind_00b08880(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x10)); return; } //@@ 00b08888 Unwind@00b08888 void Unwind_00b08888(void) { FUN_007dc720(); return; } //@@ 00b08893 Unwind@00b08893 void Unwind_00b08893(void) { FUN_006431b0(); return; } //@@ 00b0889e Unwind@00b0889e void Unwind_00b0889e(void) { std::vector::_Tidy(); return; } //@@ 00b088a9 Unwind@00b088a9 void Unwind_00b088a9(void) { FUN_00926240(); return; } //@@ 00b088b4 Unwind@00b088b4 void Unwind_00b088b4(void) { FUN_00a58200(); return; } //@@ 00b088c2 Unwind@00b088c2 void Unwind_00b088c2(void) { FUN_00a58200(); return; } //@@ 00b088cd Unwind@00b088cd void Unwind_00b088cd(void) { FUN_00906a10(); return; } //@@ 00b088db Unwind@00b088db void Unwind_00b088db(void) { FUN_00906a20(); return; } //@@ 00b088e9 Unwind@00b088e9 void Unwind_00b088e9(void) { FUN_00906a40(); return; } //@@ 00b088f7 Unwind@00b088f7 void Unwind_00b088f7(void) { std::deque<12byte>::~deque(); return; } //@@ 00b08905 Unwind@00b08905 void Unwind_00b08905(void) { std::deque<4byte>::~deque(); return; } //@@ 00b08913 Unwind@00b08913 void Unwind_00b08913(void) { std::deque<36byte>::_Tidy(); return; } //@@ 00b0891b Unwind@00b0891b void Unwind_00b0891b(void) { NetplayTextPopup::destructor(); return; } //@@ 00b08929 Unwind@00b08929 void Unwind_00b08929(void) { FUN_008fd8c0(); return; } //@@ 00b08937 Unwind@00b08937 void Unwind_00b08937(void) { FUN_008fd510(); return; } //@@ 00b08945 Unwind@00b08945 void Unwind_00b08945(void) { FUN_0091dae0(); return; } //@@ 00b0894d Unwind@00b0894d void Unwind_00b0894d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x14) + 0xc)); return; } //@@ 00b08958 Unwind@00b08958 void Unwind_00b08958(void) { FUN_0091db00(); return; } //@@ 00b08963 Unwind@00b08963 void Unwind_00b08963(void) { OnlineChat::destructor(); return; } //@@ 00b08971 Unwind@00b08971 void Unwind_00b08971(void) { FUN_00913df0(); return; } //@@ 00b0897f Unwind@00b0897f void Unwind_00b0897f(void) { FUN_00906a70(); return; } //@@ 00b0898d Unwind@00b0898d void Unwind_00b0898d(void) { std::vector<24byte>::_Tidy(); return; } //@@ 00b0899b Unwind@00b0899b void Unwind_00b0899b(void) { std::vector<32byte>::_Tidy(); return; } //@@ 00b089a9 Unwind@00b089a9 void Unwind_00b089a9(void) { FUN_004b3950(); return; } //@@ 00b089b7 Unwind@00b089b7 void Unwind_00b089b7(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby ((void *)(*(int *)(unaff_EBP + -0x10) + 0x1890)); return; } //@@ 00b089c5 Unwind@00b089c5 void Unwind_00b089c5(void) { FUN_00724ee0(); return; } //@@ 00b089d3 Unwind@00b089d3 void Unwind_00b089d3(void) { FUN_005cc630(); return; } //@@ 00b089de Unwind@00b089de void Unwind_00b089de(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x140)); return; } //@@ 00b089ec Unwind@00b089ec void Unwind_00b089ec(void) { daily_lobby_join_destructor(); return; } //@@ 00b089fa Unwind@00b089fa void Unwind_00b089fa(void) { FUN_005cc630(); return; } //@@ 00b08a02 Unwind@00b08a02 void Unwind_00b08a02(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x18) + 0x134)); return; } //@@ 00b08a10 Unwind@00b08a10 void Unwind_00b08a10(void) { GenericPopup::destructor(); return; } //@@ 00b08a1e Unwind@00b08a1e void Unwind_00b08a1e(void) { FUN_00a1d600(); return; } //@@ 00b08a70 Unwind@00b08a70 void Unwind_00b08a70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b08a78 Unwind@00b08a78 void Unwind_00b08a78(void) { FUN_008ea350(); return; } //@@ 00b08a80 Unwind@00b08a80 void Unwind_00b08a80(void) { FUN_008ea350(); return; } //@@ 00b08a88 Unwind@00b08a88 void Unwind_00b08a88(void) { FUN_0091db00(); return; } //@@ 00b08a90 Unwind@00b08a90 void Unwind_00b08a90(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b08ad0 Unwind@00b08ad0 void Unwind_00b08ad0(void) { FUN_00420710(); return; } //@@ 00b08b00 Unwind@00b08b00 void Unwind_00b08b00(void) { FUN_00a28730(); return; } //@@ 00b08b08 Unwind@00b08b08 void Unwind_00b08b08(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b08b40 Unwind@00b08b40 void Unwind_00b08b40(void) { FUN_00a28730(); return; } //@@ 00b08b48 Unwind@00b08b48 void Unwind_00b08b48(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x18)); return; } //@@ 00b08b80 Unwind@00b08b80 void Unwind_00b08b80(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b08b88 Unwind@00b08b88 void Unwind_00b08b88(void) { FUN_00420710(); return; } //@@ 00b08bd0 Unwind@00b08bd0 void Unwind_00b08bd0(void) { FUN_00a28730(); return; } //@@ 00b08bd8 Unwind@00b08bd8 void Unwind_00b08bd8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b08be0 Unwind@00b08be0 void Unwind_00b08be0(void) { FUN_00a28730(); return; } //@@ 00b08be8 Unwind@00b08be8 void Unwind_00b08be8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b08bf0 Unwind@00b08bf0 void Unwind_00b08bf0(void) { FUN_00a28730(); return; } //@@ 00b08bf8 Unwind@00b08bf8 void Unwind_00b08bf8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b08c00 Unwind@00b08c00 void Unwind_00b08c00(void) { FUN_00a28730(); return; } //@@ 00b08c08 Unwind@00b08c08 void Unwind_00b08c08(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b08c10 Unwind@00b08c10 void Unwind_00b08c10(void) { FUN_00a28730(); return; } //@@ 00b08c1b Unwind@00b08c1b void Unwind_00b08c1b(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b08c50 Unwind@00b08c50 void Unwind_00b08c50(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0xf930); return; } //@@ 00b08c90 Unwind@00b08c90 void Unwind_00b08c90(void) { FUN_00a28730(); return; } //@@ 00b08c98 Unwind@00b08c98 void Unwind_00b08c98(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b08ca0 Unwind@00b08ca0 void Unwind_00b08ca0(void) { FUN_00a28730(); return; } //@@ 00b08cd0 Unwind@00b08cd0 void Unwind_00b08cd0(void) { FUN_00a28730(); return; } //@@ 00b08cdb Unwind@00b08cdb void Unwind_00b08cdb(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0xc); return; } //@@ 00b08cea Unwind@00b08cea void Unwind_00b08cea(void) { FUN_00420710(); return; } //@@ 00b08cf5 Unwind@00b08cf5 void Unwind_00b08cf5(void) { FUN_00a28730(); return; } //@@ 00b08d30 Unwind@00b08d30 void Unwind_00b08d30(void) { FUN_00a28730(); return; } //@@ 00b08d60 Unwind@00b08d60 void Unwind_00b08d60(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b08d90 Unwind@00b08d90 void Unwind_00b08d90(void) { FUN_00909110(); return; } //@@ 00b08dc0 Unwind@00b08dc0 void Unwind_00b08dc0(void) { FUN_00708d40(); return; } //@@ 00b08dc8 Unwind@00b08dc8 void Unwind_00b08dc8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x60)); return; } //@@ 00b08e00 Unwind@00b08e00 void Unwind_00b08e00(void) { FUN_008ea350(); return; } //@@ 00b08e08 Unwind@00b08e08 void Unwind_00b08e08(void) { FUN_008ea350(); return; } //@@ 00b08e10 Unwind@00b08e10 void Unwind_00b08e10(void) { FUN_00708d40(); return; } //@@ 00b08e18 Unwind@00b08e18 void Unwind_00b08e18(void) { FUN_008ea350(); return; } //@@ 00b08e23 Unwind@00b08e23 void Unwind_00b08e23(void) { FUN_008ea350(); return; } //@@ 00b08e2b Unwind@00b08e2b void Unwind_00b08e2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b08e33 Unwind@00b08e33 void Unwind_00b08e33(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b08e3b Unwind@00b08e3b void Unwind_00b08e3b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b08e43 Unwind@00b08e43 void Unwind_00b08e43(void) { FUN_008ea350(); return; } //@@ 00b08e80 Unwind@00b08e80 void Unwind_00b08e80(void) { FUN_0090a130(); return; } //@@ 00b08eb0 Unwind@00b08eb0 void Unwind_00b08eb0(void) { FUN_00a28730(); return; } //@@ 00b08ebb Unwind@00b08ebb void Unwind_00b08ebb(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xc4)); return; } //@@ 00b08ec6 Unwind@00b08ec6 void Unwind_00b08ec6(void) { FUN_008ea350(); return; } //@@ 00b08ed1 Unwind@00b08ed1 void Unwind_00b08ed1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00b08f10 Unwind@00b08f10 void Unwind_00b08f10(void) { FUN_00708d40(); return; } //@@ 00b08f50 Unwind@00b08f50 void Unwind_00b08f50(void) { FUN_0090a890(); return; } //@@ 00b08f80 Unwind@00b08f80 void Unwind_00b08f80(void) { FUN_004242b0(); return; } //@@ 00b08fb0 Unwind@00b08fb0 void Unwind_00b08fb0(void) { FUN_004242b0(); return; } //@@ 00b08fe0 Unwind@00b08fe0 void Unwind_00b08fe0(void) { FUN_00a58200(); return; } //@@ 00b08fe8 Unwind@00b08fe8 void Unwind_00b08fe8(void) { FUN_00708d40(); return; } //@@ 00b08ff0 Unwind@00b08ff0 void Unwind_00b08ff0(void) { FUN_00a28730(); return; } //@@ 00b08ff8 Unwind@00b08ff8 void Unwind_00b08ff8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x20) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x20) = *(uint *)(unaff_EBP + -0x20) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x44)); return; } //@@ 00b09011 Unwind@00b09011 void Unwind_00b09011(void) { FUN_00708d40(); return; } //@@ 00b09040 Unwind@00b09040 void Unwind_00b09040(void) { FUN_0041d4b0(); return; } //@@ 00b09070 Unwind@00b09070 void Unwind_00b09070(void) { FUN_0085b260(); return; } //@@ 00b09078 Unwind@00b09078 void Unwind_00b09078(void) { FUN_00a28730(); return; } //@@ 00b09083 Unwind@00b09083 void Unwind_00b09083(void) { FUN_00420710(); return; } //@@ 00b0908e Unwind@00b0908e void Unwind_00b0908e(void) { FUN_00420710(); return; } //@@ 00b09099 Unwind@00b09099 void Unwind_00b09099(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x80)); return; } //@@ 00b090d0 Unwind@00b090d0 void Unwind_00b090d0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0xf930); return; } //@@ 00b090e2 Unwind@00b090e2 void Unwind_00b090e2(void) { FUN_00a28730(); return; } //@@ 00b090ed Unwind@00b090ed void Unwind_00b090ed(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b09120 Unwind@00b09120 void Unwind_00b09120(void) { FUN_00a58200(); return; } //@@ 00b09128 Unwind@00b09128 void Unwind_00b09128(void) { FUN_00906a10(); return; } //@@ 00b09130 Unwind@00b09130 void Unwind_00b09130(void) { FUN_008ea350(); return; } //@@ 00b09138 Unwind@00b09138 void Unwind_00b09138(void) { FUN_008ea350(); return; } //@@ 00b09170 Unwind@00b09170 void Unwind_00b09170(void) { FUN_00915c90(); return; } //@@ 00b09178 Unwind@00b09178 void Unwind_00b09178(void) { FUN_00915f40(); return; } //@@ 00b09180 Unwind@00b09180 void Unwind_00b09180(void) { FUN_00a58200(); return; } //@@ 00b0918b Unwind@00b0918b void Unwind_00b0918b(void) { thunk_FUN_00914760(); return; } //@@ 00b091c0 Unwind@00b091c0 void Unwind_00b091c0(void) { int unaff_EBP; GameStatePlayer::~GameStatePlayer((GameStatePlayer *)(unaff_EBP + -0x5ec)); return; } //@@ 00b09200 Unwind@00b09200 void Unwind_00b09200(void) { FUN_00a58200(); return; } //@@ 00b09208 Unwind@00b09208 void Unwind_00b09208(void) { FUN_00906a10(); return; } //@@ 00b09210 Unwind@00b09210 void Unwind_00b09210(void) { FUN_008ea350(); return; } //@@ 00b09218 Unwind@00b09218 void Unwind_00b09218(void) { FUN_008ea350(); return; } //@@ 00b09220 Unwind@00b09220 void Unwind_00b09220(void) { FUN_00708d40(); return; } //@@ 00b09228 Unwind@00b09228 void Unwind_00b09228(void) { FUN_00a28730(); return; } //@@ 00b09230 Unwind@00b09230 void Unwind_00b09230(void) { FUN_00708d40(); return; } //@@ 00b09270 Unwind@00b09270 void Unwind_00b09270(void) { FUN_00a58200(); return; } //@@ 00b09278 Unwind@00b09278 void Unwind_00b09278(void) { FUN_00906a10(); return; } //@@ 00b092b0 Unwind@00b092b0 void Unwind_00b092b0(void) { std::vector::_Tidy(); return; } //@@ 00b092b8 Unwind@00b092b8 void Unwind_00b092b8(void) { FUN_00906a70(); return; } //@@ 00b092c0 Unwind@00b092c0 void Unwind_00b092c0(void) { FUN_00a28730(); return; } //@@ 00b092c8 Unwind@00b092c8 void Unwind_00b092c8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x50)); return; } //@@ 00b092d0 Unwind@00b092d0 void Unwind_00b092d0(void) { FUN_00a28730(); return; } //@@ 00b092d8 Unwind@00b092d8 void Unwind_00b092d8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x50)); return; } //@@ 00b092f1 Unwind@00b092f1 void Unwind_00b092f1(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffd; FUN_008ea350(); return; } //@@ 00b0930a Unwind@00b0930a void Unwind_00b0930a(void) { FUN_00a58200(); return; } //@@ 00b09312 Unwind@00b09312 void Unwind_00b09312(void) { FUN_00708d40(); return; } //@@ 00b09340 Unwind@00b09340 void Unwind_00b09340(void) { FUN_00a28730(); return; } //@@ 00b09348 Unwind@00b09348 void Unwind_00b09348(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x1c)); return; } //@@ 00b09350 Unwind@00b09350 void Unwind_00b09350(void) { FUN_008ea350(); return; } //@@ 00b0935b Unwind@00b0935b void Unwind_00b0935b(void) { FUN_00a58200(); return; } //@@ 00b09366 Unwind@00b09366 void Unwind_00b09366(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0936e Unwind@00b0936e void Unwind_00b0936e(void) { FUN_00906a10(); return; } //@@ 00b09376 Unwind@00b09376 void Unwind_00b09376(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0937e Unwind@00b0937e void Unwind_00b0937e(void) { FUN_00708d40(); return; } //@@ 00b093c0 Unwind@00b093c0 void Unwind_00b093c0(void) { FUN_00420710(); return; } //@@ 00b093f0 Unwind@00b093f0 void Unwind_00b093f0(void) { FUN_00420710(); return; } //@@ 00b09420 Unwind@00b09420 void Unwind_00b09420(void) { FUN_0085b260(); return; } //@@ 00b09428 Unwind@00b09428 void Unwind_00b09428(void) { FUN_00a28730(); return; } //@@ 00b09433 Unwind@00b09433 void Unwind_00b09433(void) { FUN_00420710(); return; } //@@ 00b09470 Unwind@00b09470 void Unwind_00b09470(void) { FUN_00420710(); return; } //@@ 00b094b0 Unwind@00b094b0 void Unwind_00b094b0(void) { FUN_00708d40(); return; } //@@ 00b094bb Unwind@00b094bb void Unwind_00b094bb(void) { FUN_00724ee0(); return; } //@@ 00b094c3 Unwind@00b094c3 void Unwind_00b094c3(void) { FUN_00a28730(); return; } //@@ 00b094cb Unwind@00b094cb void Unwind_00b094cb(void) { FUN_00a28730(); return; } //@@ 00b094d3 Unwind@00b094d3 void Unwind_00b094d3(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x80)); return; } //@@ 00b094db Unwind@00b094db void Unwind_00b094db(void) { FUN_008ea350(); return; } //@@ 00b094e3 Unwind@00b094e3 void Unwind_00b094e3(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffe; FUN_008eee70(); return; } //@@ 00b094fc Unwind@00b094fc void Unwind_00b094fc(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffd; FUN_008eee70(); return; } //@@ 00b09515 Unwind@00b09515 void Unwind_00b09515(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffb; FUN_008eee70(); return; } //@@ 00b09560 Unwind@00b09560 void Unwind_00b09560(void) { FUN_008ea350(); return; } //@@ 00b09568 Unwind@00b09568 void Unwind_00b09568(void) { FUN_008ea350(); return; } //@@ 00b095a0 Unwind@00b095a0 void Unwind_00b095a0(void) { FUN_00708d40(); return; } //@@ 00b095ab Unwind@00b095ab void Unwind_00b095ab(void) { FUN_008ea350(); return; } //@@ 00b095b6 Unwind@00b095b6 void Unwind_00b095b6(void) { FUN_008ea350(); return; } //@@ 00b095c1 Unwind@00b095c1 void Unwind_00b095c1(void) { FUN_008ea350(); return; } //@@ 00b095cc Unwind@00b095cc void Unwind_00b095cc(void) { FUN_008ea350(); return; } //@@ 00b095d7 Unwind@00b095d7 void Unwind_00b095d7(void) { FUN_008ea350(); return; } //@@ 00b095e2 Unwind@00b095e2 void Unwind_00b095e2(void) { FUN_008ea350(); return; } //@@ 00b095ed Unwind@00b095ed void Unwind_00b095ed(void) { FUN_008ea350(); return; } //@@ 00b095f8 Unwind@00b095f8 void Unwind_00b095f8(void) { FUN_008ea350(); return; } //@@ 00b09603 Unwind@00b09603 void Unwind_00b09603(void) { FUN_008ea350(); return; } //@@ 00b0960e Unwind@00b0960e void Unwind_00b0960e(void) { FUN_008ea350(); return; } //@@ 00b09619 Unwind@00b09619 void Unwind_00b09619(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b09621 Unwind@00b09621 void Unwind_00b09621(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b09629 Unwind@00b09629 void Unwind_00b09629(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b09631 Unwind@00b09631 void Unwind_00b09631(void) { FUN_008ea350(); return; } //@@ 00b0963c Unwind@00b0963c void Unwind_00b0963c(void) { FUN_008ea350(); return; } //@@ 00b09647 Unwind@00b09647 void Unwind_00b09647(void) { FUN_008ea350(); return; } //@@ 00b09652 Unwind@00b09652 void Unwind_00b09652(void) { FUN_008ea350(); return; } //@@ 00b0965d Unwind@00b0965d void Unwind_00b0965d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b09665 Unwind@00b09665 void Unwind_00b09665(void) { FUN_008ea350(); return; } //@@ 00b09670 Unwind@00b09670 void Unwind_00b09670(void) { FUN_008ea350(); return; } //@@ 00b0967b Unwind@00b0967b void Unwind_00b0967b(void) { FUN_008ea350(); return; } //@@ 00b09686 Unwind@00b09686 void Unwind_00b09686(void) { FUN_008ea350(); return; } //@@ 00b09691 Unwind@00b09691 void Unwind_00b09691(void) { FUN_008ea350(); return; } //@@ 00b0969c Unwind@00b0969c void Unwind_00b0969c(void) { FUN_008ea350(); return; } //@@ 00b096a7 Unwind@00b096a7 void Unwind_00b096a7(void) { FUN_008ea350(); return; } //@@ 00b096b2 Unwind@00b096b2 void Unwind_00b096b2(void) { FUN_008ea350(); return; } //@@ 00b096bd Unwind@00b096bd void Unwind_00b096bd(void) { FUN_008ea350(); return; } //@@ 00b096c8 Unwind@00b096c8 void Unwind_00b096c8(void) { FUN_008ea350(); return; } //@@ 00b096d3 Unwind@00b096d3 void Unwind_00b096d3(void) { FUN_008ea350(); return; } //@@ 00b096de Unwind@00b096de void Unwind_00b096de(void) { FUN_008ea350(); return; } //@@ 00b096e9 Unwind@00b096e9 void Unwind_00b096e9(void) { FUN_008ea350(); return; } //@@ 00b096f4 Unwind@00b096f4 void Unwind_00b096f4(void) { FUN_008ea350(); return; } //@@ 00b096ff Unwind@00b096ff void Unwind_00b096ff(void) { FUN_008ea350(); return; } //@@ 00b0970a Unwind@00b0970a void Unwind_00b0970a(void) { FUN_008ea350(); return; } //@@ 00b09715 Unwind@00b09715 void Unwind_00b09715(void) { FUN_008ea350(); return; } //@@ 00b09720 Unwind@00b09720 void Unwind_00b09720(void) { FUN_008ea350(); return; } //@@ 00b0972b Unwind@00b0972b void Unwind_00b0972b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b09733 Unwind@00b09733 void Unwind_00b09733(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0973b Unwind@00b0973b void Unwind_00b0973b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b09780 Unwind@00b09780 void Unwind_00b09780(void) { FUN_00708d40(); return; } //@@ 00b09788 Unwind@00b09788 void Unwind_00b09788(void) { FUN_00708d40(); return; } //@@ 00b097e0 Unwind@00b097e0 void Unwind_00b097e0(void) { FUN_008ea350(); return; } //@@ 00b097e8 Unwind@00b097e8 void Unwind_00b097e8(void) { FUN_008ea350(); return; } //@@ 00b097f0 Unwind@00b097f0 void Unwind_00b097f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b097f8 Unwind@00b097f8 void Unwind_00b097f8(void) { FUN_008ea350(); return; } //@@ 00b09800 Unwind@00b09800 void Unwind_00b09800(void) { FUN_008ea350(); return; } //@@ 00b09808 Unwind@00b09808 void Unwind_00b09808(void) { FUN_00708d40(); return; } //@@ 00b09810 Unwind@00b09810 void Unwind_00b09810(void) { FUN_00911c60(); return; } //@@ 00b0981b Unwind@00b0981b void Unwind_00b0981b(void) { FUN_00909110(); return; } //@@ 00b09860 Unwind@00b09860 void Unwind_00b09860(void) { FUN_00708d40(); return; } //@@ 00b09868 Unwind@00b09868 void Unwind_00b09868(void) { FUN_00708d40(); return; } //@@ 00b09870 Unwind@00b09870 void Unwind_00b09870(void) { FUN_0090a890(); return; } //@@ 00b098a0 Unwind@00b098a0 void Unwind_00b098a0(void) { FUN_00708d40(); return; } //@@ 00b098a8 Unwind@00b098a8 void Unwind_00b098a8(void) { std::vector::_Tidy(); return; } //@@ 00b098e0 Unwind@00b098e0 void Unwind_00b098e0(void) { FUN_00a28730(); return; } //@@ 00b098e8 Unwind@00b098e8 void Unwind_00b098e8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b098f0 Unwind@00b098f0 void Unwind_00b098f0(void) { FUN_008ea350(); return; } //@@ 00b098f8 Unwind@00b098f8 void Unwind_00b098f8(void) { FUN_00a28730(); return; } //@@ 00b09900 Unwind@00b09900 void Unwind_00b09900(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b09908 Unwind@00b09908 void Unwind_00b09908(void) { FUN_00a28730(); return; } //@@ 00b09910 Unwind@00b09910 void Unwind_00b09910(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b09940 Unwind@00b09940 void Unwind_00b09940(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b09948 Unwind@00b09948 void Unwind_00b09948(void) { FUN_00a28730(); return; } //@@ 00b09953 Unwind@00b09953 void Unwind_00b09953(void) { FUN_0085b260(); return; } //@@ 00b0995b Unwind@00b0995b void Unwind_00b0995b(void) { FUN_00a28730(); return; } //@@ 00b09966 Unwind@00b09966 void Unwind_00b09966(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x80)); return; } //@@ 00b0996e Unwind@00b0996e void Unwind_00b0996e(void) { FUN_00a28730(); return; } //@@ 00b099b0 Unwind@00b099b0 void Unwind_00b099b0(void) { FUN_008ea350(); return; } //@@ 00b099b8 Unwind@00b099b8 void Unwind_00b099b8(void) { FUN_008ea350(); return; } //@@ 00b099c0 Unwind@00b099c0 void Unwind_00b099c0(void) { FUN_00708d40(); return; } //@@ 00b099cb Unwind@00b099cb void Unwind_00b099cb(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xb4) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xb4) = *(uint *)(unaff_EBP + -0xb4) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00b099ed Unwind@00b099ed void Unwind_00b099ed(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xb4) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0xb4) = *(uint *)(unaff_EBP + -0xb4) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b09a0c Unwind@00b09a0c void Unwind_00b09a0c(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xb4) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0xb4) = *(uint *)(unaff_EBP + -0xb4) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b09a2b Unwind@00b09a2b void Unwind_00b09a2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00b09a36 Unwind@00b09a36 void Unwind_00b09a36(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00b09a70 Unwind@00b09a70 void Unwind_00b09a70(void) { FUN_004242b0(); return; } //@@ 00b09aa0 Unwind@00b09aa0 void Unwind_00b09aa0(void) { FUN_00731d50(); return; } //@@ 00b09b10 Unwind@00b09b10 void Unwind_00b09b10(void) { FUN_00915f30(); return; } //@@ 00b09b18 Unwind@00b09b18 void Unwind_00b09b18(void) { FUN_00915ff0(); return; } //@@ 00b09b50 Unwind@00b09b50 void Unwind_00b09b50(void) { FUN_00915e10(); return; } //@@ 00b09b58 Unwind@00b09b58 void Unwind_00b09b58(void) { FUN_00915e10(); return; } //@@ 00b09b60 Unwind@00b09b60 void Unwind_00b09b60(void) { FUN_00915f20(); return; } //@@ 00b09b68 Unwind@00b09b68 void Unwind_00b09b68(void) { FUN_00915f20(); return; } //@@ 00b09b73 Unwind@00b09b73 void Unwind_00b09b73(void) { FUN_00915f20(); return; } //@@ 00b09ba0 Unwind@00b09ba0 void Unwind_00b09ba0(void) { FUN_00915df0(); return; } //@@ 00b09ba8 Unwind@00b09ba8 void Unwind_00b09ba8(void) { FUN_00915df0(); return; } //@@ 00b09be0 Unwind@00b09be0 void Unwind_00b09be0(void) { FUN_00415ce0(); return; } //@@ 00b09c10 Unwind@00b09c10 void Unwind_00b09c10(void) { FUN_00915f30(); return; } //@@ 00b09c40 Unwind@00b09c40 void Unwind_00b09c40(void) { FUN_00694210(); return; } //@@ 00b09c70 Unwind@00b09c70 void Unwind_00b09c70(void) { FUN_00a58200(); return; } //@@ 00b09c78 Unwind@00b09c78 void Unwind_00b09c78(void) { FUN_004b3950(); return; } //@@ 00b09c80 Unwind@00b09c80 void Unwind_00b09c80(void) { FUN_00708d40(); return; } //@@ 00b09cb0 Unwind@00b09cb0 void Unwind_00b09cb0(void) { FUN_00708d40(); return; } //@@ 00b09cb8 Unwind@00b09cb8 void Unwind_00b09cb8(void) { FUN_00a58200(); return; } //@@ 00b09cf0 Unwind@00b09cf0 void Unwind_00b09cf0(void) { FUN_00708d40(); return; } //@@ 00b09cfb Unwind@00b09cfb void Unwind_00b09cfb(void) { FUN_00a58200(); return; } //@@ 00b09d06 Unwind@00b09d06 void Unwind_00b09d06(void) { FUN_008ea350(); return; } //@@ 00b09d11 Unwind@00b09d11 void Unwind_00b09d11(void) { FUN_008ea350(); return; } //@@ 00b09d1c Unwind@00b09d1c void Unwind_00b09d1c(void) { FUN_008ea350(); return; } //@@ 00b09d27 Unwind@00b09d27 void Unwind_00b09d27(void) { FUN_008ea350(); return; } //@@ 00b09d2f Unwind@00b09d2f void Unwind_00b09d2f(void) { FUN_00731d50(); return; } //@@ 00b09d37 Unwind@00b09d37 void Unwind_00b09d37(void) { FUN_00906a10(); return; } //@@ 00b09d3f Unwind@00b09d3f void Unwind_00b09d3f(void) { FUN_00708d40(); return; } //@@ 00b09d4a Unwind@00b09d4a void Unwind_00b09d4a(void) { FUN_008ea350(); return; } //@@ 00b09d52 Unwind@00b09d52 void Unwind_00b09d52(void) { FUN_008ea350(); return; } //@@ 00b09d90 Unwind@00b09d90 void Unwind_00b09d90(void) { int unaff_EBP; GameState::~GameState((GameState *)(unaff_EBP + -0x1fe3c)); return; } //@@ 00b09d9b Unwind@00b09d9b void Unwind_00b09d9b(void) { FUN_00a58200(); return; } //@@ 00b09da6 Unwind@00b09da6 void Unwind_00b09da6(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1fe50),0xc); return; } //@@ 00b09df0 Unwind@00b09df0 void Unwind_00b09df0(void) { FUN_008ea350(); return; } //@@ 00b09dfb Unwind@00b09dfb void Unwind_00b09dfb(void) { FUN_008ea350(); return; } //@@ 00b09e06 Unwind@00b09e06 void Unwind_00b09e06(void) { FUN_009e94c0(); return; } //@@ 00b09e40 Unwind@00b09e40 void Unwind_00b09e40(void) { FUN_008ea350(); return; } //@@ 00b09e48 Unwind@00b09e48 void Unwind_00b09e48(void) { FUN_008ea350(); return; } //@@ 00b09e50 Unwind@00b09e50 void Unwind_00b09e50(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x44),0xc); return; } //@@ 00b09e5f Unwind@00b09e5f void Unwind_00b09e5f(void) { FUN_00a58200(); return; } //@@ 00b09e90 Unwind@00b09e90 void Unwind_00b09e90(void) { FUN_00a58200(); return; } //@@ 00b09ec0 Unwind@00b09ec0 void Unwind_00b09ec0(void) { FUN_00a58200(); return; } //@@ 00b09ef0 Unwind@00b09ef0 void Unwind_00b09ef0(void) { FUN_00a58200(); return; } //@@ 00b09f20 Unwind@00b09f20 void Unwind_00b09f20(void) { FUN_00926240(); return; } //@@ 00b09f2b Unwind@00b09f2b void Unwind_00b09f2b(void) { FUN_00926240(); return; } //@@ 00b09f36 Unwind@00b09f36 void Unwind_00b09f36(void) { FUN_008ea350(); return; } //@@ 00b09f41 Unwind@00b09f41 void Unwind_00b09f41(void) { FUN_00a58200(); return; } //@@ 00b09f4c Unwind@00b09f4c void Unwind_00b09f4c(void) { FUN_00906a10(); return; } //@@ 00b09f57 Unwind@00b09f57 void Unwind_00b09f57(void) { FUN_00a58200(); return; } //@@ 00b09f5f Unwind@00b09f5f void Unwind_00b09f5f(void) { FUN_00906a10(); return; } //@@ 00b09fa0 Unwind@00b09fa0 void Unwind_00b09fa0(void) { FUN_00a58200(); return; } //@@ 00b09fab Unwind@00b09fab void Unwind_00b09fab(void) { FUN_00906a10(); return; } //@@ 00b09fb6 Unwind@00b09fb6 void Unwind_00b09fb6(void) { FUN_00a58200(); return; } //@@ 00b09fc1 Unwind@00b09fc1 void Unwind_00b09fc1(void) { FUN_00906a10(); return; } //@@ 00b09fcc Unwind@00b09fcc void Unwind_00b09fcc(void) { FUN_00a58200(); return; } //@@ 00b09fd4 Unwind@00b09fd4 void Unwind_00b09fd4(void) { FUN_00a58200(); return; } //@@ 00b09fdc Unwind@00b09fdc void Unwind_00b09fdc(void) { FUN_00926240(); return; } //@@ 00b09fe7 Unwind@00b09fe7 void Unwind_00b09fe7(void) { FUN_00926240(); return; } //@@ 00b09ff2 Unwind@00b09ff2 void Unwind_00b09ff2(void) { FUN_00926240(); return; } //@@ 00b0a030 Unwind@00b0a030 void Unwind_00b0a030(void) { FUN_00926240(); return; } //@@ 00b0a03b Unwind@00b0a03b void Unwind_00b0a03b(void) { FUN_00436fb0(); return; } //@@ 00b0a046 Unwind@00b0a046 void Unwind_00b0a046(void) { FUN_00436fb0(); return; } //@@ 00b0a051 Unwind@00b0a051 void Unwind_00b0a051(void) { FUN_00436fb0(); return; } //@@ 00b0a05c Unwind@00b0a05c void Unwind_00b0a05c(void) { FUN_00436fb0(); return; } //@@ 00b0a0a0 Unwind@00b0a0a0 void Unwind_00b0a0a0(void) { FUN_0042a230(); return; } //@@ 00b0a0a8 Unwind@00b0a0a8 void Unwind_00b0a0a8(void) { FUN_0042a230(); return; } //@@ 00b0a0e0 Unwind@00b0a0e0 void Unwind_00b0a0e0(void) { std::vector::_Tidy(); return; } //@@ 00b0a0e8 Unwind@00b0a0e8 void Unwind_00b0a0e8(void) { std::vector::_Tidy(); return; } //@@ 00b0a120 Unwind@00b0a120 void Unwind_00b0a120(void) { FUN_0042a230(); return; } //@@ 00b0a150 Unwind@00b0a150 void Unwind_00b0a150(void) { FUN_0041d210(); return; } //@@ 00b0a190 Unwind@00b0a190 void Unwind_00b0a190(void) { FUN_00a28730(); return; } //@@ 00b0a19b Unwind@00b0a19b void Unwind_00b0a19b(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x9c)); return; } //@@ 00b0a1a6 Unwind@00b0a1a6 void Unwind_00b0a1a6(void) { FUN_008ea350(); return; } //@@ 00b0a1ae Unwind@00b0a1ae void Unwind_00b0a1ae(void) { FUN_00708d40(); return; } //@@ 00b0a1f0 Unwind@00b0a1f0 void Unwind_00b0a1f0(void) { FUN_008ea350(); return; } //@@ 00b0a1f8 Unwind@00b0a1f8 void Unwind_00b0a1f8(void) { FUN_00708d40(); return; } //@@ 00b0a230 Unwind@00b0a230 void Unwind_00b0a230(void) { FUN_008ea350(); return; } //@@ 00b0a260 Unwind@00b0a260 void Unwind_00b0a260(void) { FUN_00708d40(); return; } //@@ 00b0a290 Unwind@00b0a290 void Unwind_00b0a290(void) { FUN_00694210(); return; } //@@ 00b0a2c0 Unwind@00b0a2c0 void Unwind_00b0a2c0(void) { FUN_008ea350(); return; } //@@ 00b0a2f0 Unwind@00b0a2f0 void Unwind_00b0a2f0(void) { FUN_008ea350(); return; } //@@ 00b0a2f8 Unwind@00b0a2f8 void Unwind_00b0a2f8(void) { FUN_008ea350(); return; } //@@ 00b0a300 Unwind@00b0a300 void Unwind_00b0a300(void) { FUN_008ea350(); return; } //@@ 00b0a30b Unwind@00b0a30b void Unwind_00b0a30b(void) { FUN_00a55c20(); return; } //@@ 00b0a340 Unwind@00b0a340 void Unwind_00b0a340(void) { FUN_008ea350(); return; } //@@ 00b0a370 Unwind@00b0a370 void Unwind_00b0a370(void) { FUN_0041d4b0(); return; } //@@ 00b0a37b Unwind@00b0a37b void Unwind_00b0a37b(void) { FUN_00a55c20(); return; } //@@ 00b0a386 Unwind@00b0a386 void Unwind_00b0a386(void) { FUN_0041d4b0(); return; } //@@ 00b0a38e Unwind@00b0a38e void Unwind_00b0a38e(void) { FUN_00a55c20(); return; } //@@ 00b0a399 Unwind@00b0a399 void Unwind_00b0a399(void) { FUN_0041d4b0(); return; } //@@ 00b0a3a1 Unwind@00b0a3a1 void Unwind_00b0a3a1(void) { FUN_0041d4b0(); return; } //@@ 00b0a3d0 Unwind@00b0a3d0 void Unwind_00b0a3d0(void) { FUN_008ea350(); return; } //@@ 00b0a3d8 Unwind@00b0a3d8 void Unwind_00b0a3d8(void) { FUN_008ea350(); return; } //@@ 00b0a3e0 Unwind@00b0a3e0 void Unwind_00b0a3e0(void) { FUN_0091db00(); return; } //@@ 00b0a3e8 Unwind@00b0a3e8 void Unwind_00b0a3e8(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0xac)); return; } //@@ 00b0a3f3 Unwind@00b0a3f3 void Unwind_00b0a3f3(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x98)); return; } //@@ 00b0a3fe Unwind@00b0a3fe void Unwind_00b0a3fe(void) { FUN_008ea350(); return; } //@@ 00b0a406 Unwind@00b0a406 void Unwind_00b0a406(void) { FUN_008ea350(); return; } //@@ 00b0a40e Unwind@00b0a40e void Unwind_00b0a40e(void) { FUN_0091db00(); return; } //@@ 00b0a419 Unwind@00b0a419 void Unwind_00b0a419(void) { FUN_008ea350(); return; } //@@ 00b0a424 Unwind@00b0a424 void Unwind_00b0a424(void) { FUN_008ea350(); return; } //@@ 00b0a42c Unwind@00b0a42c void Unwind_00b0a42c(void) { FUN_0091db00(); return; } //@@ 00b0a470 Unwind@00b0a470 void Unwind_00b0a470(void) { FUN_00a58200(); return; } //@@ 00b0a478 Unwind@00b0a478 void Unwind_00b0a478(void) { FUN_00708d40(); return; } //@@ 00b0a4b0 Unwind@00b0a4b0 void Unwind_00b0a4b0(void) { FUN_00708d40(); return; } //@@ 00b0a4bb Unwind@00b0a4bb void Unwind_00b0a4bb(void) { FUN_00a58200(); return; } //@@ 00b0a4f0 Unwind@00b0a4f0 void Unwind_00b0a4f0(void) { FUN_0091db00(); return; } //@@ 00b0a4f8 Unwind@00b0a4f8 void Unwind_00b0a4f8(void) { FUN_0091ede0(); return; } //@@ 00b0a503 Unwind@00b0a503 void Unwind_00b0a503(void) { FUN_008ea350(); return; } //@@ 00b0a530 Unwind@00b0a530 void Unwind_00b0a530(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b0a538 Unwind@00b0a538 void Unwind_00b0a538(void) { FUN_004242b0(); return; } //@@ 00b0a540 Unwind@00b0a540 void Unwind_00b0a540(void) { FUN_008ea350(); return; } //@@ 00b0a548 Unwind@00b0a548 void Unwind_00b0a548(void) { FUN_008ea350(); return; } //@@ 00b0a550 Unwind@00b0a550 void Unwind_00b0a550(void) { FUN_0091db00(); return; } //@@ 00b0a590 Unwind@00b0a590 void Unwind_00b0a590(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0a5d0 Unwind@00b0a5d0 void Unwind_00b0a5d0(void) { FUN_008ea350(); return; } //@@ 00b0a5db Unwind@00b0a5db void Unwind_00b0a5db(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b0a610 Unwind@00b0a610 void Unwind_00b0a610(void) { FUN_0091fe60(); return; } //@@ 00b0a618 Unwind@00b0a618 void Unwind_00b0a618(void) { FUN_0091fe60(); return; } //@@ 00b0a620 Unwind@00b0a620 void Unwind_00b0a620(void) { FUN_0091fe20(); return; } //@@ 00b0a650 Unwind@00b0a650 void Unwind_00b0a650(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b0a658 Unwind@00b0a658 void Unwind_00b0a658(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0a660 Unwind@00b0a660 void Unwind_00b0a660(void) { FUN_00413b40(); return; } //@@ 00b0a66b Unwind@00b0a66b void Unwind_00b0a66b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0a673 Unwind@00b0a673 void Unwind_00b0a673(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0a6b0 Unwind@00b0a6b0 void Unwind_00b0a6b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x94)); return; } //@@ 00b0a6bb Unwind@00b0a6bb void Unwind_00b0a6bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -100)); return; } //@@ 00b0a6c3 Unwind@00b0a6c3 void Unwind_00b0a6c3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd0)); return; } //@@ 00b0a6ce Unwind@00b0a6ce void Unwind_00b0a6ce(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(unaff_EBP + -0x228)); return; } //@@ 00b0a6d9 Unwind@00b0a6d9 void Unwind_00b0a6d9(void) { std::deque<32byte>::_Tidy(); return; } //@@ 00b0a6e4 Unwind@00b0a6e4 void Unwind_00b0a6e4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b0a6ec Unwind@00b0a6ec void Unwind_00b0a6ec(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b0a6f4 Unwind@00b0a6f4 void Unwind_00b0a6f4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x7c)); return; } //@@ 00b0a6fc Unwind@00b0a6fc void Unwind_00b0a6fc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x110)); return; } //@@ 00b0a707 Unwind@00b0a707 void Unwind_00b0a707(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00b0a712 Unwind@00b0a712 void Unwind_00b0a712(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf0)); return; } //@@ 00b0a71d Unwind@00b0a71d void Unwind_00b0a71d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x7c)); return; } //@@ 00b0a760 Unwind@00b0a760 void Unwind_00b0a760(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0a768 Unwind@00b0a768 void Unwind_00b0a768(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0a770 Unwind@00b0a770 void Unwind_00b0a770(void) { FUN_00431050(); return; } //@@ 00b0a7b0 Unwind@00b0a7b0 void Unwind_00b0a7b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b0a7b8 Unwind@00b0a7b8 void Unwind_00b0a7b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b0a7c0 Unwind@00b0a7c0 void Unwind_00b0a7c0(void) { FUN_00431050(); return; } //@@ 00b0a800 Unwind@00b0a800 void Unwind_00b0a800(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00b0a80b Unwind@00b0a80b void Unwind_00b0a80b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x20)); return; } //@@ 00b0a840 Unwind@00b0a840 void Unwind_00b0a840(void) { FUN_00436fb0(); return; } //@@ 00b0a848 Unwind@00b0a848 void Unwind_00b0a848(void) { FUN_00436fb0(); return; } //@@ 00b0a853 Unwind@00b0a853 void Unwind_00b0a853(void) { FUN_00436fb0(); return; } //@@ 00b0a880 Unwind@00b0a880 void Unwind_00b0a880(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 8)); return; } //@@ 00b0a88b Unwind@00b0a88b void Unwind_00b0a88b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x20)); return; } //@@ 00b0a896 Unwind@00b0a896 void Unwind_00b0a896(void) { int unaff_EBP; PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)(*(int *)(unaff_EBP + -0x10) + 0xf64)); return; } //@@ 00b0a8d0 Unwind@00b0a8d0 void Unwind_00b0a8d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x15a0)); return; } //@@ 00b0a8db Unwind@00b0a8db void Unwind_00b0a8db(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1588)); return; } //@@ 00b0a8e6 Unwind@00b0a8e6 void Unwind_00b0a8e6(void) { FUN_00926240(); return; } //@@ 00b0a920 Unwind@00b0a920 void Unwind_00b0a920(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0a928 Unwind@00b0a928 void Unwind_00b0a928(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0a960 Unwind@00b0a960 void Unwind_00b0a960(void) { FUN_0042a230(); return; } //@@ 00b0a96b Unwind@00b0a96b void Unwind_00b0a96b(void) { FUN_0042a230(); return; } //@@ 00b0a976 Unwind@00b0a976 void Unwind_00b0a976(void) { FUN_0042a230(); return; } //@@ 00b0a981 Unwind@00b0a981 void Unwind_00b0a981(void) { FUN_0042a230(); return; } //@@ 00b0a9f0 Unwind@00b0a9f0 void Unwind_00b0a9f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0a9f8 Unwind@00b0a9f8 void Unwind_00b0a9f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0aa00 Unwind@00b0aa00 void Unwind_00b0aa00(void) { FUN_009e3d60(); return; } //@@ 00b0aa40 Unwind@00b0aa40 void Unwind_00b0aa40(void) { FUN_0040db70(); return; } //@@ 00b0aa80 Unwind@00b0aa80 void Unwind_00b0aa80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0aa88 Unwind@00b0aa88 void Unwind_00b0aa88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0aac0 Unwind@00b0aac0 void Unwind_00b0aac0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0aac8 Unwind@00b0aac8 void Unwind_00b0aac8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0ab00 Unwind@00b0ab00 void Unwind_00b0ab00(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10)); return; } //@@ 00b0ab30 Unwind@00b0ab30 void Unwind_00b0ab30(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0ab38 Unwind@00b0ab38 void Unwind_00b0ab38(void) { FUN_007e2740(); return; } //@@ 00b0ab70 Unwind@00b0ab70 void Unwind_00b0ab70(void) { FUN_00413b40(); return; } //@@ 00b0ab7b Unwind@00b0ab7b void Unwind_00b0ab7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ab83 Unwind@00b0ab83 void Unwind_00b0ab83(void) { FUN_0092dbd0(); return; } //@@ 00b0ab8e Unwind@00b0ab8e void Unwind_00b0ab8e(void) { FUN_0092dbd0(); return; } //@@ 00b0abd0 Unwind@00b0abd0 void Unwind_00b0abd0(void) { FUN_007e2740(); return; } //@@ 00b0abd8 Unwind@00b0abd8 void Unwind_00b0abd8(void) { __Init_thread_abort(&DAT_00c94050); return; } //@@ 00b0ac30 Unwind@00b0ac30 void Unwind_00b0ac30(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x10)); return; } //@@ 00b0ac60 Unwind@00b0ac60 void Unwind_00b0ac60(void) { FUN_0092ef80(); return; } //@@ 00b0ac90 Unwind@00b0ac90 void Unwind_00b0ac90(void) { FUN_0092ef80(); return; } //@@ 00b0ace0 Unwind@00b0ace0 void Unwind_00b0ace0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0ad20 Unwind@00b0ad20 void Unwind_00b0ad20(void) { FUN_00413b40(); return; } //@@ 00b0ad2b Unwind@00b0ad2b void Unwind_00b0ad2b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ad33 Unwind@00b0ad33 void Unwind_00b0ad33(void) { FUN_00420b00(); return; } //@@ 00b0ad70 Unwind@00b0ad70 void Unwind_00b0ad70(void) { FUN_0041c710(); return; } //@@ 00b0ad78 Unwind@00b0ad78 void Unwind_00b0ad78(void) { FUN_0041c710(); return; } //@@ 00b0ad83 Unwind@00b0ad83 void Unwind_00b0ad83(void) { FUN_0041c710(); return; } //@@ 00b0ad8e Unwind@00b0ad8e void Unwind_00b0ad8e(void) { FUN_0041c710(); return; } //@@ 00b0ad99 Unwind@00b0ad99 void Unwind_00b0ad99(void) { FUN_0040c440(); return; } //@@ 00b0ada4 Unwind@00b0ada4 void Unwind_00b0ada4(void) { FUN_0040c440(); return; } //@@ 00b0adaf Unwind@00b0adaf void Unwind_00b0adaf(void) { FUN_0040c440(); return; } //@@ 00b0adba Unwind@00b0adba void Unwind_00b0adba(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x3c)); return; } //@@ 00b0adc5 Unwind@00b0adc5 void Unwind_00b0adc5(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x154),0x13c,0x3f, BackdropConfig::~BackdropConfig); return; } //@@ 00b0ade0 Unwind@00b0ade0 void Unwind_00b0ade0(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x4f3c)); return; } //@@ 00b0adee Unwind@00b0adee void Unwind_00b0adee(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5050)); return; } //@@ 00b0adfc Unwind@00b0adfc void Unwind_00b0adfc(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5164)); return; } //@@ 00b0ae0a Unwind@00b0ae0a void Unwind_00b0ae0a(void) { FUN_0041c710(); return; } //@@ 00b0ae12 Unwind@00b0ae12 void Unwind_00b0ae12(void) { FUN_0041c710(); return; } //@@ 00b0ae1a Unwind@00b0ae1a void Unwind_00b0ae1a(void) { FUN_0041c710(); return; } //@@ 00b0ae22 Unwind@00b0ae22 void Unwind_00b0ae22(void) { FUN_0041c710(); return; } //@@ 00b0ae70 Unwind@00b0ae70 void Unwind_00b0ae70(void) { FUN_00413b40(); return; } //@@ 00b0ae7b Unwind@00b0ae7b void Unwind_00b0ae7b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b0ae83 Unwind@00b0ae83 void Unwind_00b0ae83(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0ae8b Unwind@00b0ae8b void Unwind_00b0ae8b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b0ae96 Unwind@00b0ae96 void Unwind_00b0ae96(void) { int unaff_EBP; BackdropConfig::~BackdropConfig((BackdropConfig *)(unaff_EBP + -0x1d0)); return; } //@@ 00b0aea1 Unwind@00b0aea1 void Unwind_00b0aea1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10354)); return; } //@@ 00b0aeac Unwind@00b0aeac void Unwind_00b0aeac(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1033c)); return; } //@@ 00b0aeb7 Unwind@00b0aeb7 void Unwind_00b0aeb7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10324)); return; } //@@ 00b0aec2 Unwind@00b0aec2 void Unwind_00b0aec2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1030c)); return; } //@@ 00b0aecd Unwind@00b0aecd void Unwind_00b0aecd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x102e0)); return; } //@@ 00b0aed8 Unwind@00b0aed8 void Unwind_00b0aed8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x102c8)); return; } //@@ 00b0aee3 Unwind@00b0aee3 void Unwind_00b0aee3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x102b0)); return; } //@@ 00b0aeee Unwind@00b0aeee void Unwind_00b0aeee(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10298)); return; } //@@ 00b0aef9 Unwind@00b0aef9 void Unwind_00b0aef9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10280)); return; } //@@ 00b0af04 Unwind@00b0af04 void Unwind_00b0af04(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10268)); return; } //@@ 00b0af0f Unwind@00b0af0f void Unwind_00b0af0f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x10250)); return; } //@@ 00b0af1a Unwind@00b0af1a void Unwind_00b0af1a(void) { int unaff_EBP; BackdropConfig::~BackdropConfig((BackdropConfig *)(unaff_EBP + -0x10358)); return; } //@@ 00b0af25 Unwind@00b0af25 void Unwind_00b0af25(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0af44 Unwind@00b0af44 void Unwind_00b0af44(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xfffffffb; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0af63 Unwind@00b0af63 void Unwind_00b0af63(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 0x10) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xffffffef; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0af82 Unwind@00b0af82 void Unwind_00b0af82(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 0x40) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xffffffbf; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0afa1 Unwind@00b0afa1 void Unwind_00b0afa1(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 0x100) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xfffffeff; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0afc5 Unwind@00b0afc5 void Unwind_00b0afc5(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 0x400) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xfffffbff; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0afe9 Unwind@00b0afe9 void Unwind_00b0afe9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 0x1000) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xffffefff; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0b00d Unwind@00b0b00d void Unwind_00b0b00d(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10360) & 0x4000) == 0) { return; } *(uint *)(unaff_EBP + -0x10360) = *(uint *)(unaff_EBP + -0x10360) & 0xffffbfff; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0b060 Unwind@00b0b060 void Unwind_00b0b060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00b0b06b Unwind@00b0b06b void Unwind_00b0b06b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1c)); return; } //@@ 00b0b076 Unwind@00b0b076 void Unwind_00b0b076(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x34)); return; } //@@ 00b0b081 Unwind@00b0b081 void Unwind_00b0b081(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x4c)); return; } //@@ 00b0b08c Unwind@00b0b08c void Unwind_00b0b08c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x78)); return; } //@@ 00b0b097 Unwind@00b0b097 void Unwind_00b0b097(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x90)); return; } //@@ 00b0b0a5 Unwind@00b0b0a5 void Unwind_00b0b0a5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xa8)); return; } //@@ 00b0b0b3 Unwind@00b0b0b3 void Unwind_00b0b0b3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xc0)); return; } //@@ 00b0b0c1 Unwind@00b0b0c1 void Unwind_00b0b0c1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xd8)); return; } //@@ 00b0b0cf Unwind@00b0b0cf void Unwind_00b0b0cf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xf0)); return; } //@@ 00b0b0dd Unwind@00b0b0dd void Unwind_00b0b0dd(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x108)); return; } //@@ 00b0b110 Unwind@00b0b110 void Unwind_00b0b110(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b118 Unwind@00b0b118 void Unwind_00b0b118(void) { FUN_004242b0(); return; } //@@ 00b0b120 Unwind@00b0b120 void Unwind_00b0b120(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x68)); return; } //@@ 00b0b128 Unwind@00b0b128 void Unwind_00b0b128(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x88)); return; } //@@ 00b0b170 Unwind@00b0b170 void Unwind_00b0b170(void) { FUN_004242b0(); return; } //@@ 00b0b1a0 Unwind@00b0b1a0 void Unwind_00b0b1a0(void) { FUN_0040c440(); return; } //@@ 00b0b1a8 Unwind@00b0b1a8 void Unwind_00b0b1a8(void) { FUN_0040c440(); return; } //@@ 00b0b1b0 Unwind@00b0b1b0 void Unwind_00b0b1b0(void) { FUN_0040c440(); return; } //@@ 00b0b1b8 Unwind@00b0b1b8 void Unwind_00b0b1b8(void) { FUN_0040c440(); return; } //@@ 00b0b1c0 Unwind@00b0b1c0 void Unwind_00b0b1c0(void) { FUN_0040c440(); return; } //@@ 00b0b1c8 Unwind@00b0b1c8 void Unwind_00b0b1c8(void) { FUN_0040c440(); return; } //@@ 00b0b1d0 Unwind@00b0b1d0 void Unwind_00b0b1d0(void) { FUN_0040c440(); return; } //@@ 00b0b1d8 Unwind@00b0b1d8 void Unwind_00b0b1d8(void) { FUN_0040c440(); return; } //@@ 00b0b210 Unwind@00b0b210 void Unwind_00b0b210(void) { FUN_0040c440(); return; } //@@ 00b0b21b Unwind@00b0b21b void Unwind_00b0b21b(void) { FUN_0040c440(); return; } //@@ 00b0b226 Unwind@00b0b226 void Unwind_00b0b226(void) { FUN_0041c710(); return; } //@@ 00b0b231 Unwind@00b0b231 void Unwind_00b0b231(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x170)); return; } //@@ 00b0b270 Unwind@00b0b270 void Unwind_00b0b270(void) { int unaff_EBP; BackdropConfig::~BackdropConfig((BackdropConfig *)(unaff_EBP + -400)); return; } //@@ 00b0b2b0 Unwind@00b0b2b0 void Unwind_00b0b2b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2b8 Unwind@00b0b2b8 void Unwind_00b0b2b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2c0 Unwind@00b0b2c0 void Unwind_00b0b2c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2c8 Unwind@00b0b2c8 void Unwind_00b0b2c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2d0 Unwind@00b0b2d0 void Unwind_00b0b2d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2d8 Unwind@00b0b2d8 void Unwind_00b0b2d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2e0 Unwind@00b0b2e0 void Unwind_00b0b2e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2e8 Unwind@00b0b2e8 void Unwind_00b0b2e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2f0 Unwind@00b0b2f0 void Unwind_00b0b2f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b2f8 Unwind@00b0b2f8 void Unwind_00b0b2f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b300 Unwind@00b0b300 void Unwind_00b0b300(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b308 Unwind@00b0b308 void Unwind_00b0b308(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b310 Unwind@00b0b310 void Unwind_00b0b310(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b350 Unwind@00b0b350 void Unwind_00b0b350(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b358 Unwind@00b0b358 void Unwind_00b0b358(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b360 Unwind@00b0b360 void Unwind_00b0b360(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b368 Unwind@00b0b368 void Unwind_00b0b368(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b370 Unwind@00b0b370 void Unwind_00b0b370(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0b378 Unwind@00b0b378 void Unwind_00b0b378(void) { FUN_0040c440(); return; } //@@ 00b0b380 Unwind@00b0b380 void Unwind_00b0b380(void) { FUN_0040c440(); return; } //@@ 00b0b388 Unwind@00b0b388 void Unwind_00b0b388(void) { FUN_0040c440(); return; } //@@ 00b0b390 Unwind@00b0b390 void Unwind_00b0b390(void) { FUN_0040c440(); return; } //@@ 00b0b398 Unwind@00b0b398 void Unwind_00b0b398(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3a0 Unwind@00b0b3a0 void Unwind_00b0b3a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3a8 Unwind@00b0b3a8 void Unwind_00b0b3a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3b0 Unwind@00b0b3b0 void Unwind_00b0b3b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3b8 Unwind@00b0b3b8 void Unwind_00b0b3b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3c0 Unwind@00b0b3c0 void Unwind_00b0b3c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3c8 Unwind@00b0b3c8 void Unwind_00b0b3c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0b3d0 Unwind@00b0b3d0 void Unwind_00b0b3d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b3d8 Unwind@00b0b3d8 void Unwind_00b0b3d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b410 Unwind@00b0b410 void Unwind_00b0b410(void) { FUN_008c9460(); return; } //@@ 00b0b418 Unwind@00b0b418 void Unwind_00b0b418(void) { FUN_008c9460(); return; } //@@ 00b0b423 Unwind@00b0b423 void Unwind_00b0b423(void) { FUN_008c9460(); return; } //@@ 00b0b42e Unwind@00b0b42e void Unwind_00b0b42e(void) { FUN_008c9460(); return; } //@@ 00b0b439 Unwind@00b0b439 void Unwind_00b0b439(void) { FUN_008c9460(); return; } //@@ 00b0b444 Unwind@00b0b444 void Unwind_00b0b444(void) { FUN_008c9460(); return; } //@@ 00b0b480 Unwind@00b0b480 void Unwind_00b0b480(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x44)); return; } //@@ 00b0b4b0 Unwind@00b0b4b0 void Unwind_00b0b4b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x44)); return; } //@@ 00b0b4b8 Unwind@00b0b4b8 void Unwind_00b0b4b8(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x30) * 8; operator_delete(*(void **)(unaff_EBP + -0x30), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00b0b4d9 Unwind@00b0b4d9 void Unwind_00b0b4d9(void) { FUN_008c9460(); return; } //@@ 00b0b510 Unwind@00b0b510 void Unwind_00b0b510(void) { longlong lVar1; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + 8) * 8; operator_delete(*(void **)(unaff_EBP + 8), -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1); return; } //@@ 00b0b560 Unwind@00b0b560 void Unwind_00b0b560(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x40)); return; } //@@ 00b0b56b Unwind@00b0b56b void Unwind_00b0b56b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x154)); return; } //@@ 00b0b579 Unwind@00b0b579 void Unwind_00b0b579(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x268)); return; } //@@ 00b0b587 Unwind@00b0b587 void Unwind_00b0b587(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x37c)); return; } //@@ 00b0b595 Unwind@00b0b595 void Unwind_00b0b595(void) { sprite_member_at_0x4_destroy(); return; } //@@ 00b0b5a3 Unwind@00b0b5a3 void Unwind_00b0b5a3(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x5ac)); return; } //@@ 00b0b5b1 Unwind@00b0b5b1 void Unwind_00b0b5b1(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x6c0)); return; } //@@ 00b0b5bf Unwind@00b0b5bf void Unwind_00b0b5bf(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x7d4)); return; } //@@ 00b0b5cd Unwind@00b0b5cd void Unwind_00b0b5cd(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x8e8)); return; } //@@ 00b0b5db Unwind@00b0b5db void Unwind_00b0b5db(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0xa04)); return; } //@@ 00b0b5e9 Unwind@00b0b5e9 void Unwind_00b0b5e9(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0xb20)); return; } //@@ 00b0b5f7 Unwind@00b0b5f7 void Unwind_00b0b5f7(void) { std::vector::_Tidy(); return; } //@@ 00b0b605 Unwind@00b0b605 void Unwind_00b0b605(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0xc44)); return; } //@@ 00b0b613 Unwind@00b0b613 void Unwind_00b0b613(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0xc50)); return; } //@@ 00b0b621 Unwind@00b0b621 void Unwind_00b0b621(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xd64)); return; } //@@ 00b0b62f Unwind@00b0b62f void Unwind_00b0b62f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xd84)); return; } //@@ 00b0b63d Unwind@00b0b63d void Unwind_00b0b63d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0xd9c)); return; } //@@ 00b0b64b Unwind@00b0b64b void Unwind_00b0b64b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0xdb8)); return; } //@@ 00b0b6a0 Unwind@00b0b6a0 void Unwind_00b0b6a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6a8 Unwind@00b0b6a8 void Unwind_00b0b6a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6b0 Unwind@00b0b6b0 void Unwind_00b0b6b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6b8 Unwind@00b0b6b8 void Unwind_00b0b6b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6c0 Unwind@00b0b6c0 void Unwind_00b0b6c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6c8 Unwind@00b0b6c8 void Unwind_00b0b6c8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6d0 Unwind@00b0b6d0 void Unwind_00b0b6d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6d8 Unwind@00b0b6d8 void Unwind_00b0b6d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6e0 Unwind@00b0b6e0 void Unwind_00b0b6e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6e8 Unwind@00b0b6e8 void Unwind_00b0b6e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6f0 Unwind@00b0b6f0 void Unwind_00b0b6f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b6f8 Unwind@00b0b6f8 void Unwind_00b0b6f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b700 Unwind@00b0b700 void Unwind_00b0b700(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b708 Unwind@00b0b708 void Unwind_00b0b708(void) { FUN_0041c710(); return; } //@@ 00b0b710 Unwind@00b0b710 void Unwind_00b0b710(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0b750 Unwind@00b0b750 void Unwind_00b0b750(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b758 Unwind@00b0b758 void Unwind_00b0b758(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b760 Unwind@00b0b760 void Unwind_00b0b760(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b768 Unwind@00b0b768 void Unwind_00b0b768(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b770 Unwind@00b0b770 void Unwind_00b0b770(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b778 Unwind@00b0b778 void Unwind_00b0b778(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b780 Unwind@00b0b780 void Unwind_00b0b780(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b788 Unwind@00b0b788 void Unwind_00b0b788(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b790 Unwind@00b0b790 void Unwind_00b0b790(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b798 Unwind@00b0b798 void Unwind_00b0b798(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b7a0 Unwind@00b0b7a0 void Unwind_00b0b7a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b7a8 Unwind@00b0b7a8 void Unwind_00b0b7a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b7b0 Unwind@00b0b7b0 void Unwind_00b0b7b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b7b8 Unwind@00b0b7b8 void Unwind_00b0b7b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0b7f0 Unwind@00b0b7f0 void Unwind_00b0b7f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b0b7f8 Unwind@00b0b7f8 void Unwind_00b0b7f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0b830 Unwind@00b0b830 void Unwind_00b0b830(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b838 Unwind@00b0b838 void Unwind_00b0b838(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b840 Unwind@00b0b840 void Unwind_00b0b840(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b880 Unwind@00b0b880 void Unwind_00b0b880(void) { FUN_0041d4b0(); return; } //@@ 00b0b88b Unwind@00b0b88b void Unwind_00b0b88b(void) { FUN_0041d4b0(); return; } //@@ 00b0b896 Unwind@00b0b896 void Unwind_00b0b896(void) { FUN_0041d4b0(); return; } //@@ 00b0b8a1 Unwind@00b0b8a1 void Unwind_00b0b8a1(void) { FUN_0041d4b0(); return; } //@@ 00b0b8ac Unwind@00b0b8ac void Unwind_00b0b8ac(void) { FUN_0041d4b0(); return; } //@@ 00b0b8b7 Unwind@00b0b8b7 void Unwind_00b0b8b7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b0b8bf Unwind@00b0b8bf void Unwind_00b0b8bf(void) { FUN_0041d4b0(); return; } //@@ 00b0b8ca Unwind@00b0b8ca void Unwind_00b0b8ca(void) { FUN_0041d4b0(); return; } //@@ 00b0b910 Unwind@00b0b910 void Unwind_00b0b910(void) { FUN_0041d4b0(); return; } //@@ 00b0b950 Unwind@00b0b950 void Unwind_00b0b950(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0b990 Unwind@00b0b990 void Unwind_00b0b990(void) { FUN_0040c440(); return; } //@@ 00b0b9c0 Unwind@00b0b9c0 void Unwind_00b0b9c0(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x248),0x18,2,std::string::_Tidy_deallocate) ; return; } //@@ 00b0b9d6 Unwind@00b0b9d6 void Unwind_00b0b9d6(void) { FUN_0041d4b0(); return; } //@@ 00b0b9e1 Unwind@00b0b9e1 void Unwind_00b0b9e1(void) { FUN_00a55c20(); return; } //@@ 00b0b9ec Unwind@00b0b9ec void Unwind_00b0b9ec(void) { FUN_0040c440(); return; } //@@ 00b0ba30 Unwind@00b0ba30 void Unwind_00b0ba30(void) { FUN_00926240(); return; } //@@ 00b0ba3b Unwind@00b0ba3b void Unwind_00b0ba3b(void) { int unaff_EBP; GameState::~GameState((GameState *)(*(int *)(unaff_EBP + -0x10) + 0xfa4)); return; } //@@ 00b0ba49 Unwind@00b0ba49 void Unwind_00b0ba49(void) { FUN_00950eb0(); return; } //@@ 00b0ba57 Unwind@00b0ba57 void Unwind_00b0ba57(void) { std::vector::_Tidy(); return; } //@@ 00b0ba62 Unwind@00b0ba62 void Unwind_00b0ba62(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x14)); return; } //@@ 00b0ba6d Unwind@00b0ba6d void Unwind_00b0ba6d(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x20)); return; } //@@ 00b0ba78 Unwind@00b0ba78 void Unwind_00b0ba78(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x134)); return; } //@@ 00b0ba86 Unwind@00b0ba86 void Unwind_00b0ba86(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x248)); return; } //@@ 00b0ba94 Unwind@00b0ba94 void Unwind_00b0ba94(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x3a8)); return; } //@@ 00b0baa2 Unwind@00b0baa2 void Unwind_00b0baa2(void) { std::deque<32byte>::_Tidy(); return; } //@@ 00b0bab0 Unwind@00b0bab0 void Unwind_00b0bab0(void) { NightmareScene::~NightmareScene(); return; } //@@ 00b0babe Unwind@00b0babe void Unwind_00b0babe(void) { std::deque<4byte>::~deque(); return; } //@@ 00b0bac6 Unwind@00b0bac6 void Unwind_00b0bac6(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x20)); return; } //@@ 00b0bad1 Unwind@00b0bad1 void Unwind_00b0bad1(void) { int unaff_EBP; AchievementOverlay::~AchievementOverlay ((AchievementOverlay *)(*(int *)(unaff_EBP + -0x10) + 0x21c1c)); return; } //@@ 00b0badf Unwind@00b0badf void Unwind_00b0badf(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x18) + 4),0x184,2,FUN_007df3f0); return; } //@@ 00b0baf8 Unwind@00b0baf8 void Unwind_00b0baf8(void) { std::vector::_Tidy(); return; } //@@ 00b0bb06 Unwind@00b0bb06 void Unwind_00b0bb06(void) { MusicManager::~MusicManager(); return; } //@@ 00b0bb14 Unwind@00b0bb14 void Unwind_00b0bb14(void) { std::vector::_Tidy(); return; } //@@ 00b0bb22 Unwind@00b0bb22 void Unwind_00b0bb22(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x18)); return; } //@@ 00b0bb2a Unwind@00b0bb2a void Unwind_00b0bb2a(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x2a33c)); return; } //@@ 00b0bb38 Unwind@00b0bb38 void Unwind_00b0bb38(void) { int unaff_EBP; ItemConfig::destructor((ItemConfig *)(*(int *)(unaff_EBP + -0x10) + 0x2a404)); return; } //@@ 00b0bb46 Unwind@00b0bb46 void Unwind_00b0bb46(void) { FUN_009505c0(); return; } //@@ 00b0bb4e Unwind@00b0bb4e void Unwind_00b0bb4e(void) { FUN_009505c0(); return; } //@@ 00b0bb59 Unwind@00b0bb59 void Unwind_00b0bb59(void) { FUN_009505c0(); return; } //@@ 00b0bb64 Unwind@00b0bb64 void Unwind_00b0bb64(void) { FUN_009505c0(); return; } //@@ 00b0bb6f Unwind@00b0bb6f void Unwind_00b0bb6f(void) { InfoDisplay::~InfoDisplay(); return; } //@@ 00b0bb7d Unwind@00b0bb7d void Unwind_00b0bb7d(void) { std::vector<164byte>::_Tidy(); return; } //@@ 00b0bb8b Unwind@00b0bb8b void Unwind_00b0bb8b(void) { FUN_00694ea0(); return; } //@@ 00b0bb99 Unwind@00b0bb99 void Unwind_00b0bb99(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x18)); return; } //@@ 00b0bba1 Unwind@00b0bba1 void Unwind_00b0bba1(void) { thunk_FUN_008fc570(); return; } //@@ 00b0bbac Unwind@00b0bbac void Unwind_00b0bbac(void) { int unaff_EBP; KAGE::Thread::~Thread((void *)(*(int *)(unaff_EBP + -0x18) + 0x2000c)); return; } //@@ 00b0bbba Unwind@00b0bbba void Unwind_00b0bbba(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x18) + 0x2001c)); return; } //@@ 00b0bbc8 Unwind@00b0bbc8 void Unwind_00b0bbc8(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x20034)); return; } //@@ 00b0bbd6 Unwind@00b0bbd6 void Unwind_00b0bbd6(void) { ModManager::~ModManager(); return; } //@@ 00b0bbe4 Unwind@00b0bbe4 void Unwind_00b0bbe4(void) { FUN_00a267c0(); return; } //@@ 00b0bbf2 Unwind@00b0bbf2 void Unwind_00b0bbf2(void) { FUN_00a267c0(); return; } //@@ 00b0bc00 Unwind@00b0bc00 void Unwind_00b0bc00(void) { FUN_00951090(); return; } //@@ 00b0bc0e Unwind@00b0bc0e void Unwind_00b0bc0e(void) { std::vector<260byte>::~vector(); return; } //@@ 00b0bc1c Unwind@00b0bc1c void Unwind_00b0bc1c(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x4abe4)); return; } //@@ 00b0bc2a Unwind@00b0bc2a void Unwind_00b0bc2a(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x4acf8)); return; } //@@ 00b0bc38 Unwind@00b0bc38 void Unwind_00b0bc38(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x10) + 0x4ae0c),8,2,FUN_0040c440); return; } //@@ 00b0bc50 Unwind@00b0bc50 void Unwind_00b0bc50(void) { FUN_00a1a6f0(); return; } //@@ 00b0bc5e Unwind@00b0bc5e void Unwind_00b0bc5e(void) { FUN_00a1a6f0(); return; } //@@ 00b0bc6c Unwind@00b0bc6c void Unwind_00b0bc6c(void) { FUN_00a1a6f0(); return; } //@@ 00b0bc7a Unwind@00b0bc7a void Unwind_00b0bc7a(void) { FUN_00a1a6f0(); return; } //@@ 00b0bc88 Unwind@00b0bc88 void Unwind_00b0bc88(void) { FUN_00a1a6f0(); return; } //@@ 00b0bc96 Unwind@00b0bc96 void Unwind_00b0bc96(void) { FUN_00a1a6f0(); return; } //@@ 00b0bca4 Unwind@00b0bca4 void Unwind_00b0bca4(void) { FUN_00a1a6f0(); return; } //@@ 00b0bcb2 Unwind@00b0bcb2 void Unwind_00b0bcb2(void) { FUN_00a1a6f0(); return; } //@@ 00b0bcc0 Unwind@00b0bcc0 void Unwind_00b0bcc0(void) { FUN_00a1a6f0(); return; } //@@ 00b0bcce Unwind@00b0bcce void Unwind_00b0bcce(void) { FUN_0085b260(); return; } //@@ 00b0bcdc Unwind@00b0bcdc void Unwind_00b0bcdc(void) { FUN_009e94c0(); return; } //@@ 00b0bce7 Unwind@00b0bce7 void Unwind_00b0bce7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x18) + 0x78)); return; } //@@ 00b0bcf2 Unwind@00b0bcf2 void Unwind_00b0bcf2(void) { FUN_009510f0(); return; } //@@ 00b0bd00 Unwind@00b0bd00 void Unwind_00b0bd00(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x4b2a8)); return; } //@@ 00b0bd0e Unwind@00b0bd0e void Unwind_00b0bd0e(void) { NetplayManager::~NetplayManager(); return; } //@@ 00b0bd1c Unwind@00b0bd1c void Unwind_00b0bd1c(void) { FUN_00498f80(); return; } //@@ 00b0bd24 Unwind@00b0bd24 void Unwind_00b0bd24(void) { FUN_00a15730(); return; } //@@ 00b0bda0 Unwind@00b0bda0 void Unwind_00b0bda0(void) { FUN_0041c710(); return; } //@@ 00b0bda8 Unwind@00b0bda8 void Unwind_00b0bda8(void) { FUN_0041c710(); return; } //@@ 00b0bdb0 Unwind@00b0bdb0 void Unwind_00b0bdb0(void) { FUN_0041c710(); return; } //@@ 00b0bde0 Unwind@00b0bde0 void Unwind_00b0bde0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bde8 Unwind@00b0bde8 void Unwind_00b0bde8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bdf0 Unwind@00b0bdf0 void Unwind_00b0bdf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bdf8 Unwind@00b0bdf8 void Unwind_00b0bdf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0be00 Unwind@00b0be00 void Unwind_00b0be00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0be08 Unwind@00b0be08 void Unwind_00b0be08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0be10 Unwind@00b0be10 void Unwind_00b0be10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0be18 Unwind@00b0be18 void Unwind_00b0be18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0be20 Unwind@00b0be20 void Unwind_00b0be20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0be28 Unwind@00b0be28 void Unwind_00b0be28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0be60 Unwind@00b0be60 void Unwind_00b0be60(void) { FUN_0040c440(); return; } //@@ 00b0be6b Unwind@00b0be6b void Unwind_00b0be6b(void) { FUN_0040c440(); return; } //@@ 00b0be76 Unwind@00b0be76 void Unwind_00b0be76(void) { FUN_0040c440(); return; } //@@ 00b0be81 Unwind@00b0be81 void Unwind_00b0be81(void) { FUN_0040c440(); return; } //@@ 00b0bec0 Unwind@00b0bec0 void Unwind_00b0bec0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x22c),0x68e88); return; } //@@ 00b0bed5 Unwind@00b0bed5 void Unwind_00b0bed5(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x228)); return; } //@@ 00b0bee0 Unwind@00b0bee0 void Unwind_00b0bee0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x228)); return; } //@@ 00b0beeb Unwind@00b0beeb void Unwind_00b0beeb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x228)); return; } //@@ 00b0bef6 Unwind@00b0bef6 void Unwind_00b0bef6(void) { FUN_004242b0(); return; } //@@ 00b0bf01 Unwind@00b0bf01 void Unwind_00b0bf01(void) { FUN_004242b0(); return; } //@@ 00b0bf40 Unwind@00b0bf40 void Unwind_00b0bf40(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bf48 Unwind@00b0bf48 void Unwind_00b0bf48(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0bf50 Unwind@00b0bf50 void Unwind_00b0bf50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bf58 Unwind@00b0bf58 void Unwind_00b0bf58(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bf60 Unwind@00b0bf60 void Unwind_00b0bf60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bf68 Unwind@00b0bf68 void Unwind_00b0bf68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0bf70 Unwind@00b0bf70 void Unwind_00b0bf70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bf78 Unwind@00b0bf78 void Unwind_00b0bf78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bf80 Unwind@00b0bf80 void Unwind_00b0bf80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bf88 Unwind@00b0bf88 void Unwind_00b0bf88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bf90 Unwind@00b0bf90 void Unwind_00b0bf90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bf98 Unwind@00b0bf98 void Unwind_00b0bf98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0bfa0 Unwind@00b0bfa0 void Unwind_00b0bfa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bfa8 Unwind@00b0bfa8 void Unwind_00b0bfa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bfb0 Unwind@00b0bfb0 void Unwind_00b0bfb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bfb8 Unwind@00b0bfb8 void Unwind_00b0bfb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0bfc0 Unwind@00b0bfc0 void Unwind_00b0bfc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bfc8 Unwind@00b0bfc8 void Unwind_00b0bfc8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bfd0 Unwind@00b0bfd0 void Unwind_00b0bfd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bfd8 Unwind@00b0bfd8 void Unwind_00b0bfd8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0bfe0 Unwind@00b0bfe0 void Unwind_00b0bfe0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bfe8 Unwind@00b0bfe8 void Unwind_00b0bfe8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0bff0 Unwind@00b0bff0 void Unwind_00b0bff0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0bff8 Unwind@00b0bff8 void Unwind_00b0bff8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0c000 Unwind@00b0c000 void Unwind_00b0c000(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c008 Unwind@00b0c008 void Unwind_00b0c008(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c010 Unwind@00b0c010 void Unwind_00b0c010(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c018 Unwind@00b0c018 void Unwind_00b0c018(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0c020 Unwind@00b0c020 void Unwind_00b0c020(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c028 Unwind@00b0c028 void Unwind_00b0c028(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c030 Unwind@00b0c030 void Unwind_00b0c030(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c038 Unwind@00b0c038 void Unwind_00b0c038(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0c040 Unwind@00b0c040 void Unwind_00b0c040(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c048 Unwind@00b0c048 void Unwind_00b0c048(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c050 Unwind@00b0c050 void Unwind_00b0c050(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c058 Unwind@00b0c058 void Unwind_00b0c058(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0c060 Unwind@00b0c060 void Unwind_00b0c060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c068 Unwind@00b0c068 void Unwind_00b0c068(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c070 Unwind@00b0c070 void Unwind_00b0c070(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c078 Unwind@00b0c078 void Unwind_00b0c078(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0c080 Unwind@00b0c080 void Unwind_00b0c080(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c088 Unwind@00b0c088 void Unwind_00b0c088(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c090 Unwind@00b0c090 void Unwind_00b0c090(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c098 Unwind@00b0c098 void Unwind_00b0c098(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0c0a0 Unwind@00b0c0a0 void Unwind_00b0c0a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c0a8 Unwind@00b0c0a8 void Unwind_00b0c0a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c0b0 Unwind@00b0c0b0 void Unwind_00b0c0b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c0b8 Unwind@00b0c0b8 void Unwind_00b0c0b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b0c0f0 Unwind@00b0c0f0 void Unwind_00b0c0f0(void) { FUN_004242b0(); return; } //@@ 00b0c120 Unwind@00b0c120 void Unwind_00b0c120(void) { FUN_0041d4b0(); return; } //@@ 00b0c160 Unwind@00b0c160 void Unwind_00b0c160(void) { FUN_004242b0(); return; } //@@ 00b0c168 Unwind@00b0c168 void Unwind_00b0c168(void) { FUN_004242b0(); return; } //@@ 00b0c170 Unwind@00b0c170 void Unwind_00b0c170(void) { FUN_004242b0(); return; } //@@ 00b0c1a0 Unwind@00b0c1a0 void Unwind_00b0c1a0(void) { __Init_thread_abort(&DAT_00c94184); return; } //@@ 00b0c1d0 Unwind@00b0c1d0 void Unwind_00b0c1d0(void) { FUN_00413b40(); return; } //@@ 00b0c1db Unwind@00b0c1db void Unwind_00b0c1db(void) { FUN_004269f0(); return; } //@@ 00b0c1e6 Unwind@00b0c1e6 void Unwind_00b0c1e6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c1ee Unwind@00b0c1ee void Unwind_00b0c1ee(void) { std::vector::_Tidy(); return; } //@@ 00b0c1f9 Unwind@00b0c1f9 void Unwind_00b0c1f9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c201 Unwind@00b0c201 void Unwind_00b0c201(void) { std::vector::_Tidy(); return; } //@@ 00b0c20c Unwind@00b0c20c void Unwind_00b0c20c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c214 Unwind@00b0c214 void Unwind_00b0c214(void) { std::vector::_Tidy(); return; } //@@ 00b0c21f Unwind@00b0c21f void Unwind_00b0c21f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c227 Unwind@00b0c227 void Unwind_00b0c227(void) { std::vector::_Tidy(); return; } //@@ 00b0c232 Unwind@00b0c232 void Unwind_00b0c232(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c23a Unwind@00b0c23a void Unwind_00b0c23a(void) { std::vector::_Tidy(); return; } //@@ 00b0c280 Unwind@00b0c280 void Unwind_00b0c280(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c288 Unwind@00b0c288 void Unwind_00b0c288(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0c2c0 Unwind@00b0c2c0 void Unwind_00b0c2c0(void) { FUN_009e94c0(); return; } //@@ 00b0c2c8 Unwind@00b0c2c8 void Unwind_00b0c2c8(void) { FUN_009e94c0(); return; } //@@ 00b0c300 Unwind@00b0c300 void Unwind_00b0c300(void) { FUN_009e94c0(); return; } //@@ 00b0c308 Unwind@00b0c308 void Unwind_00b0c308(void) { FUN_009e94c0(); return; } //@@ 00b0c340 Unwind@00b0c340 void Unwind_00b0c340(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0xe4),0x68e88); return; } //@@ 00b0c355 Unwind@00b0c355 void Unwind_00b0c355(void) { FUN_009e94c0(); return; } //@@ 00b0c35d Unwind@00b0c35d void Unwind_00b0c35d(void) { FUN_009e94c0(); return; } //@@ 00b0c3a0 Unwind@00b0c3a0 void Unwind_00b0c3a0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0xf930); return; } //@@ 00b0c3e0 Unwind@00b0c3e0 void Unwind_00b0c3e0(void) { FUN_004242b0(); return; } //@@ 00b0c3e8 Unwind@00b0c3e8 void Unwind_00b0c3e8(void) { FUN_004242b0(); return; } //@@ 00b0c420 Unwind@00b0c420 void Unwind_00b0c420(void) { FUN_004242b0(); return; } //@@ 00b0c450 Unwind@00b0c450 void Unwind_00b0c450(void) { FUN_004242b0(); return; } //@@ 00b0c480 Unwind@00b0c480 void Unwind_00b0c480(void) { FUN_004242b0(); return; } //@@ 00b0c488 Unwind@00b0c488 void Unwind_00b0c488(void) { FUN_00420710(); return; } //@@ 00b0c493 Unwind@00b0c493 void Unwind_00b0c493(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x44)); return; } //@@ 00b0c49b Unwind@00b0c49b void Unwind_00b0c49b(void) { FUN_00420710(); return; } //@@ 00b0c4a6 Unwind@00b0c4a6 void Unwind_00b0c4a6(void) { FUN_004242b0(); return; } //@@ 00b0c500 Unwind@00b0c500 void Unwind_00b0c500(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x1c)); return; } //@@ 00b0c508 Unwind@00b0c508 void Unwind_00b0c508(void) { FUN_007530c0(); return; } //@@ 00b0c510 Unwind@00b0c510 void Unwind_00b0c510(void) { FUN_00424420(); return; } //@@ 00b0c51b Unwind@00b0c51b void Unwind_00b0c51b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x1c) + 0x20)); return; } //@@ 00b0c526 Unwind@00b0c526 void Unwind_00b0c526(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x1c) + 0x2c)); return; } //@@ 00b0c531 Unwind@00b0c531 void Unwind_00b0c531(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x1c) + 0x48)); return; } //@@ 00b0c53c Unwind@00b0c53c void Unwind_00b0c53c(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x1c) + 0x8c)); return; } //@@ 00b0c570 Unwind@00b0c570 void Unwind_00b0c570(void) { FUN_0095c670(); return; } //@@ 00b0c5a0 Unwind@00b0c5a0 void Unwind_00b0c5a0(void) { FUN_0095c670(); return; } //@@ 00b0c5d0 Unwind@00b0c5d0 void Unwind_00b0c5d0(void) { FUN_0095c670(); return; } //@@ 00b0c600 Unwind@00b0c600 void Unwind_00b0c600(void) { FUN_00413b40(); return; } //@@ 00b0c60b Unwind@00b0c60b void Unwind_00b0c60b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c613 Unwind@00b0c613 void Unwind_00b0c613(void) { int unaff_EBP; CutsceneEntry::Destructor((CutsceneEntry *)(unaff_EBP + -0x100e0)); return; } //@@ 00b0c61e Unwind@00b0c61e void Unwind_00b0c61e(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10104),0x1a0); return; } //@@ 00b0c633 Unwind@00b0c633 void Unwind_00b0c633(void) { FUN_0095c8f0(); return; } //@@ 00b0c63e Unwind@00b0c63e void Unwind_00b0c63e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10104) + 0x40)); return; } //@@ 00b0c64c Unwind@00b0c64c void Unwind_00b0c64c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10104) + 0x58)); return; } //@@ 00b0c65a Unwind@00b0c65a void Unwind_00b0c65a(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1010c),0x108); return; } //@@ 00b0c66f Unwind@00b0c66f void Unwind_00b0c66f(void) { FUN_0095c8f0(); return; } //@@ 00b0c67a Unwind@00b0c67a void Unwind_00b0c67a(void) { FUN_00a1a6f0(); return; } //@@ 00b0c688 Unwind@00b0c688 void Unwind_00b0c688(void) { FUN_00a1a6f0(); return; } //@@ 00b0c6d0 Unwind@00b0c6d0 void Unwind_00b0c6d0(void) { FUN_00420710(); return; } //@@ 00b0c6db Unwind@00b0c6db void Unwind_00b0c6db(void) { FUN_00708d40(); return; } //@@ 00b0c710 Unwind@00b0c710 void Unwind_00b0c710(void) { FUN_0041d4b0(); return; } //@@ 00b0c718 Unwind@00b0c718 void Unwind_00b0c718(void) { FUN_0041d4b0(); return; } //@@ 00b0c750 Unwind@00b0c750 void Unwind_00b0c750(void) { std::vector<28byte>::_Tidy(); return; } //@@ 00b0c75b Unwind@00b0c75b void Unwind_00b0c75b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x15c)); return; } //@@ 00b0c7a0 Unwind@00b0c7a0 void Unwind_00b0c7a0(void) { FUN_0041d4b0(); return; } //@@ 00b0c7d0 Unwind@00b0c7d0 void Unwind_00b0c7d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c7d8 Unwind@00b0c7d8 void Unwind_00b0c7d8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0c7e0 Unwind@00b0c7e0 void Unwind_00b0c7e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0c7e8 Unwind@00b0c7e8 void Unwind_00b0c7e8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c820 Unwind@00b0c820 void Unwind_00b0c820(void) { std::vector::_Tidy(); return; } //@@ 00b0c828 Unwind@00b0c828 void Unwind_00b0c828(void) { std::vector::_Tidy(); return; } //@@ 00b0c833 Unwind@00b0c833 void Unwind_00b0c833(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c83b Unwind@00b0c83b void Unwind_00b0c83b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0c843 Unwind@00b0c843 void Unwind_00b0c843(void) { FUN_0041d4b0(); return; } //@@ 00b0c84b Unwind@00b0c84b void Unwind_00b0c84b(void) { FUN_00a55c20(); return; } //@@ 00b0c856 Unwind@00b0c856 void Unwind_00b0c856(void) { FUN_0041d4b0(); return; } //@@ 00b0c85e Unwind@00b0c85e void Unwind_00b0c85e(void) { FUN_00a55c20(); return; } //@@ 00b0c8a0 Unwind@00b0c8a0 void Unwind_00b0c8a0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x30),0x114); return; } //@@ 00b0c8b2 Unwind@00b0c8b2 void Unwind_00b0c8b2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0c8f0 Unwind@00b0c8f0 void Unwind_00b0c8f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b0c8f8 Unwind@00b0c8f8 void Unwind_00b0c8f8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x148)); return; } //@@ 00b0c903 Unwind@00b0c903 void Unwind_00b0c903(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x144)); return; } //@@ 00b0c940 Unwind@00b0c940 void Unwind_00b0c940(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0c970 Unwind@00b0c970 void Unwind_00b0c970(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1a0)); return; } //@@ 00b0c9b0 Unwind@00b0c9b0 void Unwind_00b0c9b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c9b8 Unwind@00b0c9b8 void Unwind_00b0c9b8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0c9c0 Unwind@00b0c9c0 void Unwind_00b0c9c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ca00 Unwind@00b0ca00 void Unwind_00b0ca00(void) { int unaff_EBP; Entity::destructor(*(Entity **)(unaff_EBP + -0x10)); return; } //@@ 00b0ca08 Unwind@00b0ca08 void Unwind_00b0ca08(void) { FUN_0099c310(); return; } //@@ 00b0ca16 Unwind@00b0ca16 void Unwind_00b0ca16(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x520)); return; } //@@ 00b0ca24 Unwind@00b0ca24 void Unwind_00b0ca24(void) { FUN_00579700(); return; } //@@ 00b0ca60 Unwind@00b0ca60 void Unwind_00b0ca60(void) { FUN_006431b0(); return; } //@@ 00b0ca90 Unwind@00b0ca90 void Unwind_00b0ca90(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xbc)); return; } //@@ 00b0cad0 Unwind@00b0cad0 void Unwind_00b0cad0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x150)); return; } //@@ 00b0cadb Unwind@00b0cadb void Unwind_00b0cadb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b0cb20 Unwind@00b0cb20 void Unwind_00b0cb20(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0cb28 Unwind@00b0cb28 void Unwind_00b0cb28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0cb60 Unwind@00b0cb60 void Unwind_00b0cb60(void) { std::vector::_Tidy(); return; } //@@ 00b0cb6b Unwind@00b0cb6b void Unwind_00b0cb6b(void) { FUN_0040c440(); return; } //@@ 00b0cb76 Unwind@00b0cb76 void Unwind_00b0cb76(void) { FUN_0040c440(); return; } //@@ 00b0cb81 Unwind@00b0cb81 void Unwind_00b0cb81(void) { FUN_0040c440(); return; } //@@ 00b0cb8c Unwind@00b0cb8c void Unwind_00b0cb8c(void) { FUN_0040c440(); return; } //@@ 00b0cbd0 Unwind@00b0cbd0 void Unwind_00b0cbd0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b0cbd8 Unwind@00b0cbd8 void Unwind_00b0cbd8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x88)); return; } //@@ 00b0cc20 Unwind@00b0cc20 void Unwind_00b0cc20(void) { std::vector::_Tidy(); return; } //@@ 00b0cc2b Unwind@00b0cc2b void Unwind_00b0cc2b(void) { FUN_0040c440(); return; } //@@ 00b0cc36 Unwind@00b0cc36 void Unwind_00b0cc36(void) { FUN_0040c440(); return; } //@@ 00b0cc70 Unwind@00b0cc70 void Unwind_00b0cc70(void) { FUN_00415ce0(); return; } //@@ 00b0cca0 Unwind@00b0cca0 void Unwind_00b0cca0(void) { FUN_00693420(); return; } //@@ 00b0cca8 Unwind@00b0cca8 void Unwind_00b0cca8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ccb0 Unwind@00b0ccb0 void Unwind_00b0ccb0(void) { FUN_00694210(); return; } //@@ 00b0ccb8 Unwind@00b0ccb8 void Unwind_00b0ccb8(void) { FUN_00694210(); return; } //@@ 00b0ccf0 Unwind@00b0ccf0 void Unwind_00b0ccf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ccf8 Unwind@00b0ccf8 void Unwind_00b0ccf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0cd00 Unwind@00b0cd00 void Unwind_00b0cd00(void) { FUN_0041c710(); return; } //@@ 00b0cd40 Unwind@00b0cd40 void Unwind_00b0cd40(void) { FUN_009e94c0(); return; } //@@ 00b0cd4b Unwind@00b0cd4b void Unwind_00b0cd4b(void) { FUN_009e94c0(); return; } //@@ 00b0cd53 Unwind@00b0cd53 void Unwind_00b0cd53(void) { FUN_00420710(); return; } //@@ 00b0cd90 Unwind@00b0cd90 void Unwind_00b0cd90(void) { FUN_0041d4b0(); return; } //@@ 00b0cd9b Unwind@00b0cd9b void Unwind_00b0cd9b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x250)); return; } //@@ 00b0cda6 Unwind@00b0cda6 void Unwind_00b0cda6(void) { std::vector::_Tidy(); return; } //@@ 00b0cdae Unwind@00b0cdae void Unwind_00b0cdae(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x238)); return; } //@@ 00b0cdb9 Unwind@00b0cdb9 void Unwind_00b0cdb9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x238)); return; } //@@ 00b0cdc4 Unwind@00b0cdc4 void Unwind_00b0cdc4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x238)); return; } //@@ 00b0cdcf Unwind@00b0cdcf void Unwind_00b0cdcf(void) { FUN_0041d4b0(); return; } //@@ 00b0cdda Unwind@00b0cdda void Unwind_00b0cdda(void) { FUN_0041d4b0(); return; } //@@ 00b0ce20 Unwind@00b0ce20 void Unwind_00b0ce20(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x44),0x19c); return; } //@@ 00b0ce32 Unwind@00b0ce32 void Unwind_00b0ce32(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x44),0x19c); return; } //@@ 00b0ce44 Unwind@00b0ce44 void Unwind_00b0ce44(void) { std::vector::_Tidy(); return; } //@@ 00b0ce70 Unwind@00b0ce70 void Unwind_00b0ce70(void) { FUN_0041d4b0(); return; } //@@ 00b0ceb0 Unwind@00b0ceb0 void Unwind_00b0ceb0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0ceb8 Unwind@00b0ceb8 void Unwind_00b0ceb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0cec0 Unwind@00b0cec0 void Unwind_00b0cec0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0cec8 Unwind@00b0cec8 void Unwind_00b0cec8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0ced0 Unwind@00b0ced0 void Unwind_00b0ced0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0ced8 Unwind@00b0ced8 void Unwind_00b0ced8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0cf10 Unwind@00b0cf10 void Unwind_00b0cf10(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x14)); return; } //@@ 00b0cf18 Unwind@00b0cf18 void Unwind_00b0cf18(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x4c)); return; } //@@ 00b0cf23 Unwind@00b0cf23 void Unwind_00b0cf23(void) { FUN_0040c440(); return; } //@@ 00b0cf31 Unwind@00b0cf31 void Unwind_00b0cf31(void) { FUN_0040c440(); return; } //@@ 00b0cf3f Unwind@00b0cf3f void Unwind_00b0cf3f(void) { FUN_0040c440(); return; } //@@ 00b0cf4d Unwind@00b0cf4d void Unwind_00b0cf4d(void) { FUN_009e94c0(); return; } //@@ 00b0cf5b Unwind@00b0cf5b void Unwind_00b0cf5b(void) { FUN_006effa0(); return; } //@@ 00b0cf69 Unwind@00b0cf69 void Unwind_00b0cf69(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x18)); return; } //@@ 00b0cf74 Unwind@00b0cf74 void Unwind_00b0cf74(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x18) + 300),0x114,3,ANM2::~ANM2); return; } //@@ 00b0cf8f Unwind@00b0cf8f void Unwind_00b0cf8f(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x470)); return; } //@@ 00b0cf9d Unwind@00b0cf9d void Unwind_00b0cf9d(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 0x584)); return; } //@@ 00b0cfab Unwind@00b0cfab void Unwind_00b0cfab(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(*(int *)(unaff_EBP + -0x18) + 0x698)) ; return; } //@@ 00b0cfb9 Unwind@00b0cfb9 void Unwind_00b0cfb9(void) { Menu_Save::~Menu_Save(); return; } //@@ 00b0cfc7 Unwind@00b0cfc7 void Unwind_00b0cfc7(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x10)); return; } //@@ 00b0cfd2 Unwind@00b0cfd2 void Unwind_00b0cfd2(void) { Menu_Game::destructor(); return; } //@@ 00b0cfe0 Unwind@00b0cfe0 void Unwind_00b0cfe0(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x14)); return; } //@@ 00b0cfeb Unwind@00b0cfeb void Unwind_00b0cfeb(void) { FUN_005cc630(); return; } //@@ 00b0cff9 Unwind@00b0cff9 void Unwind_00b0cff9(void) { FUN_005cc630(); return; } //@@ 00b0d007 Unwind@00b0d007 void Unwind_00b0d007(void) { FUN_008cf510(); return; } //@@ 00b0d015 Unwind@00b0d015 void Unwind_00b0d015(void) { int unaff_EBP; Menu_Character::destructor((Menu_Character *)(*(int *)(unaff_EBP + -0x14) + 0x1534)); return; } //@@ 00b0d023 Unwind@00b0d023 void Unwind_00b0d023(void) { FUN_008f0120(); return; } //@@ 00b0d031 Unwind@00b0d031 void Unwind_00b0d031(void) { Menu_Challenge::destructor(); return; } //@@ 00b0d03f Unwind@00b0d03f void Unwind_00b0d03f(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x14)); return; } //@@ 00b0d04a Unwind@00b0d04a void Unwind_00b0d04a(void) { Menu_Collection::destructor(); return; } //@@ 00b0d058 Unwind@00b0d058 void Unwind_00b0d058(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x1c)); return; } //@@ 00b0d063 Unwind@00b0d063 void Unwind_00b0d063(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0xb48)); return; } //@@ 00b0d071 Unwind@00b0d071 void Unwind_00b0d071(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x1c) + 0xc5c),0x114,0xb,ANM2::~ANM2); return; } //@@ 00b0d08c Unwind@00b0d08c void Unwind_00b0d08c(void) { int unaff_EBP; Menu_Stats::~Menu_Stats((Menu_Stats *)(*(int *)(unaff_EBP + -0x14) + 0x2a18)); return; } //@@ 00b0d09a Unwind@00b0d09a void Unwind_00b0d09a(void) { int unaff_EBP; Menu_Options::~Menu_Options((Menu_Options *)(*(int *)(unaff_EBP + -0x14) + 0xcecc)); return; } //@@ 00b0d0a8 Unwind@00b0d0a8 void Unwind_00b0d0a8(void) { FUN_008c94b0(); return; } //@@ 00b0d0b6 Unwind@00b0d0b6 void Unwind_00b0d0b6(void) { FUN_008d8a90(); return; } //@@ 00b0d0c4 Unwind@00b0d0c4 void Unwind_00b0d0c4(void) { int unaff_EBP; sprite_member_at_0x10_destroy((void *)(*(int *)(unaff_EBP + -0x14) + 0xd3ac)); return; } //@@ 00b0d0d2 Unwind@00b0d0d2 void Unwind_00b0d0d2(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 8)); return; } //@@ 00b0d0dd Unwind@00b0d0dd void Unwind_00b0d0dd(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x11c)); return; } //@@ 00b0d0eb Unwind@00b0d0eb void Unwind_00b0d0eb(void) { FUN_008c5d70(); return; } //@@ 00b0d0f9 Unwind@00b0d0f9 void Unwind_00b0d0f9(void) { int unaff_EBP; sprite_member_at_0x10_destroy((void *)(*(int *)(unaff_EBP + -0x14) + 0xd848)); return; } //@@ 00b0d107 Unwind@00b0d107 void Unwind_00b0d107(void) { int unaff_EBP; sprite_member_at_0x10_destroy((void *)(*(int *)(unaff_EBP + -0x14) + 0xd96c)); return; } //@@ 00b0d115 Unwind@00b0d115 void Unwind_00b0d115(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 4)); return; } //@@ 00b0d120 Unwind@00b0d120 void Unwind_00b0d120(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x118)); return; } //@@ 00b0d12e Unwind@00b0d12e void Unwind_00b0d12e(void) { FUN_008e4a20(); return; } //@@ 00b0d13c Unwind@00b0d13c void Unwind_00b0d13c(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x10)); return; } //@@ 00b0d147 Unwind@00b0d147 void Unwind_00b0d147(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(*(int *)(unaff_EBP + -0x1c) + 0x124),0x114,3,ANM2::~ANM2) ; return; } //@@ 00b0d162 Unwind@00b0d162 void Unwind_00b0d162(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x460)); return; } //@@ 00b0d170 Unwind@00b0d170 void Unwind_00b0d170(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x1c) + 0x574)); return; } //@@ 00b0d17e Unwind@00b0d17e void Unwind_00b0d17e(void) { FUN_008e7610(); return; } //@@ 00b0d18c Unwind@00b0d18c void Unwind_00b0d18c(void) { int unaff_EBP; MenuDialog::~MenuDialog((void *)(*(int *)(unaff_EBP + -0x1c) + 0x6e4)); return; } //@@ 00b0d19a Unwind@00b0d19a void Unwind_00b0d19a(void) { FUN_008e7630(); return; } //@@ 00b0d1a8 Unwind@00b0d1a8 void Unwind_00b0d1a8(void) { FUN_008dc3c0(); return; } //@@ 00b0d1b6 Unwind@00b0d1b6 void Unwind_00b0d1b6(void) { int unaff_EBP; Menu_Options::~Menu_Options((Menu_Options *)(*(int *)(unaff_EBP + -0x14) + 0xeb50)); return; } //@@ 00b0d1c4 Unwind@00b0d1c4 void Unwind_00b0d1c4(void) { int unaff_EBP; ANM2::~ANM2(*(ANM2 **)(unaff_EBP + -0x1c)); return; } //@@ 00b0d1cc Unwind@00b0d1cc void Unwind_00b0d1cc(void) { FUN_008cb7a0(); return; } //@@ 00b0d1da Unwind@00b0d1da void Unwind_00b0d1da(void) { FUN_005cc630(); return; } //@@ 00b0d1e8 Unwind@00b0d1e8 void Unwind_00b0d1e8(void) { int unaff_EBP; sprite_member_at_0x10_destroy((void *)(*(int *)(unaff_EBP + -0x14) + 0xf808)); return; } //@@ 00b0d240 Unwind@00b0d240 void Unwind_00b0d240(void) { FUN_0041c710(); return; } //@@ 00b0d270 Unwind@00b0d270 void Unwind_00b0d270(void) { FUN_009e94c0(); return; } //@@ 00b0d27b Unwind@00b0d27b void Unwind_00b0d27b(void) { FUN_0040c440(); return; } //@@ 00b0d286 Unwind@00b0d286 void Unwind_00b0d286(void) { FUN_0040c440(); return; } //@@ 00b0d291 Unwind@00b0d291 void Unwind_00b0d291(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d299 Unwind@00b0d299 void Unwind_00b0d299(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2a1 Unwind@00b0d2a1 void Unwind_00b0d2a1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2a9 Unwind@00b0d2a9 void Unwind_00b0d2a9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2b1 Unwind@00b0d2b1 void Unwind_00b0d2b1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2b9 Unwind@00b0d2b9 void Unwind_00b0d2b9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2c1 Unwind@00b0d2c1 void Unwind_00b0d2c1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2c9 Unwind@00b0d2c9 void Unwind_00b0d2c9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2d1 Unwind@00b0d2d1 void Unwind_00b0d2d1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2d9 Unwind@00b0d2d9 void Unwind_00b0d2d9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2e1 Unwind@00b0d2e1 void Unwind_00b0d2e1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2e9 Unwind@00b0d2e9 void Unwind_00b0d2e9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2f1 Unwind@00b0d2f1 void Unwind_00b0d2f1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d2f9 Unwind@00b0d2f9 void Unwind_00b0d2f9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d301 Unwind@00b0d301 void Unwind_00b0d301(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d309 Unwind@00b0d309 void Unwind_00b0d309(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0d340 Unwind@00b0d340 void Unwind_00b0d340(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d348 Unwind@00b0d348 void Unwind_00b0d348(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d350 Unwind@00b0d350 void Unwind_00b0d350(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d358 Unwind@00b0d358 void Unwind_00b0d358(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d360 Unwind@00b0d360 void Unwind_00b0d360(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d368 Unwind@00b0d368 void Unwind_00b0d368(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d370 Unwind@00b0d370 void Unwind_00b0d370(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d378 Unwind@00b0d378 void Unwind_00b0d378(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d380 Unwind@00b0d380 void Unwind_00b0d380(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d388 Unwind@00b0d388 void Unwind_00b0d388(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d390 Unwind@00b0d390 void Unwind_00b0d390(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d398 Unwind@00b0d398 void Unwind_00b0d398(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0d3d0 Unwind@00b0d3d0 void Unwind_00b0d3d0(void) { FUN_004242b0(); return; } //@@ 00b0d3d8 Unwind@00b0d3d8 void Unwind_00b0d3d8(void) { FUN_004242b0(); return; } //@@ 00b0d3e0 Unwind@00b0d3e0 void Unwind_00b0d3e0(void) { FUN_00420710(); return; } //@@ 00b0d430 Unwind@00b0d430 void Unwind_00b0d430(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d438 Unwind@00b0d438 void Unwind_00b0d438(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d440 Unwind@00b0d440 void Unwind_00b0d440(void) { FUN_0041c710(); return; } //@@ 00b0d448 Unwind@00b0d448 void Unwind_00b0d448(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d450 Unwind@00b0d450 void Unwind_00b0d450(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d458 Unwind@00b0d458 void Unwind_00b0d458(void) { FUN_0040c440(); return; } //@@ 00b0d460 Unwind@00b0d460 void Unwind_00b0d460(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0d4a0 Unwind@00b0d4a0 void Unwind_00b0d4a0(void) { FUN_004242b0(); return; } //@@ 00b0d4d0 Unwind@00b0d4d0 void Unwind_00b0d4d0(void) { FUN_0041d4b0(); return; } //@@ 00b0d4db Unwind@00b0d4db void Unwind_00b0d4db(void) { FUN_0041d4b0(); return; } //@@ 00b0d4e6 Unwind@00b0d4e6 void Unwind_00b0d4e6(void) { FUN_0041d4b0(); return; } //@@ 00b0d4f1 Unwind@00b0d4f1 void Unwind_00b0d4f1(void) { FUN_0041d4b0(); return; } //@@ 00b0d530 Unwind@00b0d530 void Unwind_00b0d530(void) { FUN_00413b40(); return; } //@@ 00b0d53b Unwind@00b0d53b void Unwind_00b0d53b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0d543 Unwind@00b0d543 void Unwind_00b0d543(void) { std::vector::_Tidy(); return; } //@@ 00b0d54e Unwind@00b0d54e void Unwind_00b0d54e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b0d559 Unwind@00b0d559 void Unwind_00b0d559(void) { image_ref_vector_holder_destroy(); return; } //@@ 00b0d564 Unwind@00b0d564 void Unwind_00b0d564(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d56c Unwind@00b0d56c void Unwind_00b0d56c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b0d574 Unwind@00b0d574 void Unwind_00b0d574(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0d57c Unwind@00b0d57c void Unwind_00b0d57c(void) { FUN_0040c440(); return; } //@@ 00b0d587 Unwind@00b0d587 void Unwind_00b0d587(void) { FUN_00993730(); return; } //@@ 00b0d592 Unwind@00b0d592 void Unwind_00b0d592(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xd4)); return; } //@@ 00b0d59d Unwind@00b0d59d void Unwind_00b0d59d(void) { std::vector::_Tidy(); return; } //@@ 00b0d5a8 Unwind@00b0d5a8 void Unwind_00b0d5a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b0d5b3 Unwind@00b0d5b3 void Unwind_00b0d5b3(void) { FUN_00993740(); return; } //@@ 00b0d5be Unwind@00b0d5be void Unwind_00b0d5be(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0d5c6 Unwind@00b0d5c6 void Unwind_00b0d5c6(void) { FUN_0040c440(); return; } //@@ 00b0d5d1 Unwind@00b0d5d1 void Unwind_00b0d5d1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0d5d9 Unwind@00b0d5d9 void Unwind_00b0d5d9(void) { __Init_thread_abort(&DAT_00c9431c); return; } //@@ 00b0d620 Unwind@00b0d620 void Unwind_00b0d620(void) { FUN_0040c440(); return; } //@@ 00b0d650 Unwind@00b0d650 void Unwind_00b0d650(void) { FUN_00998230(); return; } //@@ 00b0d6c0 Unwind@00b0d6c0 void Unwind_00b0d6c0(void) { FUN_00998530(); return; } //@@ 00b0d6f0 Unwind@00b0d6f0 void Unwind_00b0d6f0(void) { FUN_0040c440(); return; } //@@ 00b0d720 Unwind@00b0d720 void Unwind_00b0d720(void) { FUN_00998540(); return; } //@@ 00b0d750 Unwind@00b0d750 void Unwind_00b0d750(void) { FUN_00998530(); return; } //@@ 00b0d780 Unwind@00b0d780 void Unwind_00b0d780(void) { FUN_008ea350(); return; } //@@ 00b0d78b Unwind@00b0d78b void Unwind_00b0d78b(void) { FUN_008ea350(); return; } //@@ 00b0d796 Unwind@00b0d796 void Unwind_00b0d796(void) { FUN_0041d4b0(); return; } //@@ 00b0d7a1 Unwind@00b0d7a1 void Unwind_00b0d7a1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xcc)); return; } //@@ 00b0d7ac Unwind@00b0d7ac void Unwind_00b0d7ac(void) { FUN_0041d4b0(); return; } //@@ 00b0d7b7 Unwind@00b0d7b7 void Unwind_00b0d7b7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe4)); return; } //@@ 00b0d7c2 Unwind@00b0d7c2 void Unwind_00b0d7c2(void) { FUN_0041d4b0(); return; } //@@ 00b0d7cd Unwind@00b0d7cd void Unwind_00b0d7cd(void) { FUN_0041d4b0(); return; } //@@ 00b0d810 Unwind@00b0d810 void Unwind_00b0d810(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x38)); return; } //@@ 00b0d818 Unwind@00b0d818 void Unwind_00b0d818(void) { FUN_008caa20(); return; } //@@ 00b0d850 Unwind@00b0d850 void Unwind_00b0d850(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0d858 Unwind@00b0d858 void Unwind_00b0d858(void) { FUN_0040c440(); return; } //@@ 00b0d890 Unwind@00b0d890 void Unwind_00b0d890(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0d898 Unwind@00b0d898 void Unwind_00b0d898(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0d8a0 Unwind@00b0d8a0 void Unwind_00b0d8a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0d8a8 Unwind@00b0d8a8 void Unwind_00b0d8a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0d8b0 Unwind@00b0d8b0 void Unwind_00b0d8b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0d8f0 Unwind@00b0d8f0 void Unwind_00b0d8f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b0d8f8 Unwind@00b0d8f8 void Unwind_00b0d8f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b0d900 Unwind@00b0d900 void Unwind_00b0d900(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x60)); return; } //@@ 00b0d940 Unwind@00b0d940 void Unwind_00b0d940(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00b0d970 Unwind@00b0d970 void Unwind_00b0d970(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x60)); return; } //@@ 00b0d9a0 Unwind@00b0d9a0 void Unwind_00b0d9a0(void) { std::vector::_Tidy(); return; } //@@ 00b0d9a8 Unwind@00b0d9a8 void Unwind_00b0d9a8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x58)); return; } //@@ 00b0da00 Unwind@00b0da00 void Unwind_00b0da00(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x44)); return; } //@@ 00b0da30 Unwind@00b0da30 void Unwind_00b0da30(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0da60 Unwind@00b0da60 void Unwind_00b0da60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0da68 Unwind@00b0da68 void Unwind_00b0da68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0da70 Unwind@00b0da70 void Unwind_00b0da70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0da78 Unwind@00b0da78 void Unwind_00b0da78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b0da80 Unwind@00b0da80 void Unwind_00b0da80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0da88 Unwind@00b0da88 void Unwind_00b0da88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0da90 Unwind@00b0da90 void Unwind_00b0da90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0da98 Unwind@00b0da98 void Unwind_00b0da98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0daa0 Unwind@00b0daa0 void Unwind_00b0daa0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0daa8 Unwind@00b0daa8 void Unwind_00b0daa8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0dab0 Unwind@00b0dab0 void Unwind_00b0dab0(void) { FUN_0040c440(); return; } //@@ 00b0dab8 Unwind@00b0dab8 void Unwind_00b0dab8(void) { FUN_0040c440(); return; } //@@ 00b0dac0 Unwind@00b0dac0 void Unwind_00b0dac0(void) { FUN_0040c440(); return; } //@@ 00b0dac8 Unwind@00b0dac8 void Unwind_00b0dac8(void) { FUN_0040c440(); return; } //@@ 00b0dad0 Unwind@00b0dad0 void Unwind_00b0dad0(void) { FUN_0040c440(); return; } //@@ 00b0dad8 Unwind@00b0dad8 void Unwind_00b0dad8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0dae0 Unwind@00b0dae0 void Unwind_00b0dae0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0dae8 Unwind@00b0dae8 void Unwind_00b0dae8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0daf0 Unwind@00b0daf0 void Unwind_00b0daf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0daf8 Unwind@00b0daf8 void Unwind_00b0daf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0db00 Unwind@00b0db00 void Unwind_00b0db00(void) { FUN_0040c440(); return; } //@@ 00b0db08 Unwind@00b0db08 void Unwind_00b0db08(void) { FUN_0041c710(); return; } //@@ 00b0db10 Unwind@00b0db10 void Unwind_00b0db10(void) { FUN_0040c440(); return; } //@@ 00b0db18 Unwind@00b0db18 void Unwind_00b0db18(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0db50 Unwind@00b0db50 void Unwind_00b0db50(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x90)); return; } //@@ 00b0db5b Unwind@00b0db5b void Unwind_00b0db5b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00b0db66 Unwind@00b0db66 void Unwind_00b0db66(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x78)); return; } //@@ 00b0dba0 Unwind@00b0dba0 void Unwind_00b0dba0(void) { FUN_00693420(); return; } //@@ 00b0dba8 Unwind@00b0dba8 void Unwind_00b0dba8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0dbe0 Unwind@00b0dbe0 void Unwind_00b0dbe0(void) { FUN_00693420(); return; } //@@ 00b0dbeb Unwind@00b0dbeb void Unwind_00b0dbeb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00b0dbf6 Unwind@00b0dbf6 void Unwind_00b0dbf6(void) { FUN_00694210(); return; } //@@ 00b0dc01 Unwind@00b0dc01 void Unwind_00b0dc01(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x130)); return; } //@@ 00b0dc40 Unwind@00b0dc40 void Unwind_00b0dc40(void) { FUN_0041d4b0(); return; } //@@ 00b0dc48 Unwind@00b0dc48 void Unwind_00b0dc48(void) { FUN_00a55c20(); return; } //@@ 00b0dc80 Unwind@00b0dc80 void Unwind_00b0dc80(void) { FUN_0041d4b0(); return; } //@@ 00b0dc88 Unwind@00b0dc88 void Unwind_00b0dc88(void) { FUN_0041d4b0(); return; } //@@ 00b0dc93 Unwind@00b0dc93 void Unwind_00b0dc93(void) { FUN_0041d4b0(); return; } //@@ 00b0dc9e Unwind@00b0dc9e void Unwind_00b0dc9e(void) { FUN_0041d4b0(); return; } //@@ 00b0dca9 Unwind@00b0dca9 void Unwind_00b0dca9(void) { FUN_0041d4b0(); return; } //@@ 00b0dcb4 Unwind@00b0dcb4 void Unwind_00b0dcb4(void) { FUN_0041d4b0(); return; } //@@ 00b0dcbf Unwind@00b0dcbf void Unwind_00b0dcbf(void) { FUN_0041d4b0(); return; } //@@ 00b0dcca Unwind@00b0dcca void Unwind_00b0dcca(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xbc)); return; } //@@ 00b0dcd5 Unwind@00b0dcd5 void Unwind_00b0dcd5(void) { FUN_0041d4b0(); return; } //@@ 00b0dce0 Unwind@00b0dce0 void Unwind_00b0dce0(void) { FUN_008ea350(); return; } //@@ 00b0dceb Unwind@00b0dceb void Unwind_00b0dceb(void) { FUN_0041d4b0(); return; } //@@ 00b0dcf6 Unwind@00b0dcf6 void Unwind_00b0dcf6(void) { FUN_0041d4b0(); return; } //@@ 00b0dd01 Unwind@00b0dd01 void Unwind_00b0dd01(void) { FUN_00a28730(); return; } //@@ 00b0dd0c Unwind@00b0dd0c void Unwind_00b0dd0c(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x108)); return; } //@@ 00b0dd17 Unwind@00b0dd17 void Unwind_00b0dd17(void) { FUN_008ea350(); return; } //@@ 00b0dd22 Unwind@00b0dd22 void Unwind_00b0dd22(void) { FUN_008ea350(); return; } //@@ 00b0dd2d Unwind@00b0dd2d void Unwind_00b0dd2d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x34)); return; } //@@ 00b0dd35 Unwind@00b0dd35 void Unwind_00b0dd35(void) { FUN_0041d4b0(); return; } //@@ 00b0dd70 Unwind@00b0dd70 void Unwind_00b0dd70(void) { FUN_008ea350(); return; } //@@ 00b0dd78 Unwind@00b0dd78 void Unwind_00b0dd78(void) { FUN_0040c440(); return; } //@@ 00b0dd80 Unwind@00b0dd80 void Unwind_00b0dd80(void) { FUN_0041d4b0(); return; } //@@ 00b0ddb0 Unwind@00b0ddb0 void Unwind_00b0ddb0(void) { FUN_0041d4b0(); return; } //@@ 00b0ddbb Unwind@00b0ddbb void Unwind_00b0ddbb(void) { FUN_0040c440(); return; } //@@ 00b0de00 Unwind@00b0de00 void Unwind_00b0de00(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x6dc); return; } //@@ 00b0de12 Unwind@00b0de12 void Unwind_00b0de12(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x18); return; } //@@ 00b0de21 Unwind@00b0de21 void Unwind_00b0de21(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_007dc660(); return; } //@@ 00b0de80 Unwind@00b0de80 void Unwind_00b0de80(void) { std::vector::_Tidy(); return; } //@@ 00b0de8b Unwind@00b0de8b void Unwind_00b0de8b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1938)); return; } //@@ 00b0de96 Unwind@00b0de96 void Unwind_00b0de96(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1938)); return; } //@@ 00b0dea1 Unwind@00b0dea1 void Unwind_00b0dea1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1938)); return; } //@@ 00b0dee0 Unwind@00b0dee0 void Unwind_00b0dee0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -300)); return; } //@@ 00b0deeb Unwind@00b0deeb void Unwind_00b0deeb(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x194) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x194) = *(uint *)(unaff_EBP + -0x194) & 0xfffffffe; std::vector::_Tidy(); return; } //@@ 00b0df0d Unwind@00b0df0d void Unwind_00b0df0d(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1a8),0x268); return; } //@@ 00b0df22 Unwind@00b0df22 void Unwind_00b0df22(void) { int unaff_EBP; FID_conflict__Tidy(*(void **)(unaff_EBP + -0x1a8)); return; } //@@ 00b0df2d Unwind@00b0df2d void Unwind_00b0df2d(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1a8),0x4d088); return; } //@@ 00b0df42 Unwind@00b0df42 void Unwind_00b0df42(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x144)); return; } //@@ 00b0df4d Unwind@00b0df4d void Unwind_00b0df4d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -300)); return; } //@@ 00b0df58 Unwind@00b0df58 void Unwind_00b0df58(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x194) & 0x20) == 0) { return; } *(uint *)(unaff_EBP + -0x194) = *(uint *)(unaff_EBP + -0x194) & 0xffffffdf; std::vector::_Tidy(); return; } //@@ 00b0df7a Unwind@00b0df7a void Unwind_00b0df7a(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x194) & 0x40) == 0) { return; } *(uint *)(unaff_EBP + -0x194) = *(uint *)(unaff_EBP + -0x194) & 0xffffffbf; std::vector::_Tidy(); return; } //@@ 00b0df9c Unwind@00b0df9c void Unwind_00b0df9c(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x194) & 0x80) == 0) { return; } *(uint *)(unaff_EBP + -0x194) = *(uint *)(unaff_EBP + -0x194) & 0xffffff7f; std::vector::_Tidy(); return; } //@@ 00b0dfc3 Unwind@00b0dfc3 void Unwind_00b0dfc3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x174)); return; } //@@ 00b0dfce Unwind@00b0dfce void Unwind_00b0dfce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x15c)); return; } //@@ 00b0dfd9 Unwind@00b0dfd9 void Unwind_00b0dfd9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x18c)); return; } //@@ 00b0dfe4 Unwind@00b0dfe4 void Unwind_00b0dfe4(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x1c0)); return; } //@@ 00b0dfef Unwind@00b0dfef void Unwind_00b0dfef(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1a8),0xf930); return; } //@@ 00b0e040 Unwind@00b0e040 void Unwind_00b0e040(void) { FUN_00a15c00(); return; } //@@ 00b0e048 Unwind@00b0e048 void Unwind_00b0e048(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0e050 Unwind@00b0e050 void Unwind_00b0e050(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0e058 Unwind@00b0e058 void Unwind_00b0e058(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0e060 Unwind@00b0e060 void Unwind_00b0e060(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00b0e068 Unwind@00b0e068 void Unwind_00b0e068(void) { FUN_00a15c00(); return; } //@@ 00b0e0a0 Unwind@00b0e0a0 void Unwind_00b0e0a0(void) { FUN_00413b40(); return; } //@@ 00b0e0ab Unwind@00b0e0ab void Unwind_00b0e0ab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0e0b3 Unwind@00b0e0b3 void Unwind_00b0e0b3(void) { FUN_009abd50(); return; } //@@ 00b0e0be Unwind@00b0e0be void Unwind_00b0e0be(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e0c6 Unwind@00b0e0c6 void Unwind_00b0e0c6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb8)); return; } //@@ 00b0e120 Unwind@00b0e120 void Unwind_00b0e120(void) { FUN_009ada40(); return; } //@@ 00b0e150 Unwind@00b0e150 void Unwind_00b0e150(void) { FUN_00738260(); return; } //@@ 00b0e190 Unwind@00b0e190 void Unwind_00b0e190(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0e198 Unwind@00b0e198 void Unwind_00b0e198(void) { int unaff_EBP; vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x24)); return; } //@@ 00b0e1d0 Unwind@00b0e1d0 void Unwind_00b0e1d0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xa4)); return; } //@@ 00b0e1db Unwind@00b0e1db void Unwind_00b0e1db(void) { FUN_00738260(); return; } //@@ 00b0e220 Unwind@00b0e220 void Unwind_00b0e220(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0xf8)); return; } //@@ 00b0e22b Unwind@00b0e22b void Unwind_00b0e22b(void) { FUN_00738260(); return; } //@@ 00b0e270 Unwind@00b0e270 void Unwind_00b0e270(void) { int unaff_EBP; vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x18)); return; } //@@ 00b0e2a0 Unwind@00b0e2a0 void Unwind_00b0e2a0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FID_conflict__Tidy(*(void **)(unaff_EBP + 8)); return; } //@@ 00b0e2e0 Unwind@00b0e2e0 void Unwind_00b0e2e0(void) { int unaff_EBP; vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x20)); return; } //@@ 00b0e310 Unwind@00b0e310 void Unwind_00b0e310(void) { FUN_00428880(); return; } //@@ 00b0e340 Unwind@00b0e340 void Unwind_00b0e340(void) { std::deque<4byte>::~deque(); return; } //@@ 00b0e348 Unwind@00b0e348 void Unwind_00b0e348(void) { int unaff_EBP; vector_LevelGenerator_Room_tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0e380 Unwind@00b0e380 void Unwind_00b0e380(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x15c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x15c) = *(uint *)(unaff_EBP + -0x15c) & 0xfffffffe; vector_LevelGenerator_Room_tidy(*(void **)(unaff_EBP + -0x16c)); return; } //@@ 00b0e3a2 Unwind@00b0e3a2 void Unwind_00b0e3a2(void) { FUN_00738260(); return; } //@@ 00b0e3ad Unwind@00b0e3ad void Unwind_00b0e3ad(void) { FUN_00738260(); return; } //@@ 00b0e410 Unwind@00b0e410 void Unwind_00b0e410(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x24)); return; } //@@ 00b0e440 Unwind@00b0e440 void Unwind_00b0e440(void) { FUN_004242b0(); return; } //@@ 00b0e470 Unwind@00b0e470 void Unwind_00b0e470(void) { FUN_0041d4b0(); return; } //@@ 00b0e478 Unwind@00b0e478 void Unwind_00b0e478(void) { FUN_00a55c20(); return; } //@@ 00b0e4b0 Unwind@00b0e4b0 void Unwind_00b0e4b0(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x2c)); return; } //@@ 00b0e4bb Unwind@00b0e4bb void Unwind_00b0e4bb(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x140)); return; } //@@ 00b0e4c9 Unwind@00b0e4c9 void Unwind_00b0e4c9(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x254)); return; } //@@ 00b0e4d7 Unwind@00b0e4d7 void Unwind_00b0e4d7(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x368)); return; } //@@ 00b0e4e5 Unwind@00b0e4e5 void Unwind_00b0e4e5(void) { FUN_005cc630(); return; } //@@ 00b0e4f3 Unwind@00b0e4f3 void Unwind_00b0e4f3(void) { int unaff_EBP; Menu_Options::~Menu_Options((Menu_Options *)(*(int *)(unaff_EBP + -0x10) + 0x5b0)); return; } //@@ 00b0e501 Unwind@00b0e501 void Unwind_00b0e501(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x14) + 0x18)); return; } //@@ 00b0e50c Unwind@00b0e50c void Unwind_00b0e50c(void) { FUN_0040c440(); return; } //@@ 00b0e517 Unwind@00b0e517 void Unwind_00b0e517(void) { FUN_0040c440(); return; } //@@ 00b0e522 Unwind@00b0e522 void Unwind_00b0e522(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 100)); return; } //@@ 00b0e52d Unwind@00b0e52d void Unwind_00b0e52d(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x18)); return; } //@@ 00b0e535 Unwind@00b0e535 void Unwind_00b0e535(void) { int unaff_EBP; RichText::~RichText((void *)(*(int *)(unaff_EBP + -0x14) + 0x184)); return; } //@@ 00b0e543 Unwind@00b0e543 void Unwind_00b0e543(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x1f0)); return; } //@@ 00b0e551 Unwind@00b0e551 void Unwind_00b0e551(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x304)); return; } //@@ 00b0e55f Unwind@00b0e55f void Unwind_00b0e55f(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x418)); return; } //@@ 00b0e56d Unwind@00b0e56d void Unwind_00b0e56d(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x14) + 0x52c)); return; } //@@ 00b0e57b Unwind@00b0e57b void Unwind_00b0e57b(void) { PauseScreen_MyStuff::~PauseScreen_MyStuff(); return; } //@@ 00b0e589 Unwind@00b0e589 void Unwind_00b0e589(void) { FUN_0040c440(); return; } //@@ 00b0e597 Unwind@00b0e597 void Unwind_00b0e597(void) { sprite_member_at_0x4_destroy(); return; } //@@ 00b0e5a5 Unwind@00b0e5a5 void Unwind_00b0e5a5(void) { int unaff_EBP; MenuDialog::~MenuDialog((void *)(*(int *)(unaff_EBP + -0x10) + 0xfb0)); return; } //@@ 00b0e5b3 Unwind@00b0e5b3 void Unwind_00b0e5b3(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x18) + 4)); return; } //@@ 00b0e600 Unwind@00b0e600 void Unwind_00b0e600(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e608 Unwind@00b0e608 void Unwind_00b0e608(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e610 Unwind@00b0e610 void Unwind_00b0e610(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e618 Unwind@00b0e618 void Unwind_00b0e618(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e620 Unwind@00b0e620 void Unwind_00b0e620(void) { FUN_0040c440(); return; } //@@ 00b0e660 Unwind@00b0e660 void Unwind_00b0e660(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x2c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x2c) = *(uint *)(unaff_EBP + -0x2c) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x50)); return; } //@@ 00b0e679 Unwind@00b0e679 void Unwind_00b0e679(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x2c) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x2c) = *(uint *)(unaff_EBP + -0x2c) & 0xfffffffd; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b0e692 Unwind@00b0e692 void Unwind_00b0e692(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x70)); return; } //@@ 00b0e6c0 Unwind@00b0e6c0 void Unwind_00b0e6c0(void) { FUN_00a28730(); return; } //@@ 00b0e6c8 Unwind@00b0e6c8 void Unwind_00b0e6c8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x1c)); return; } //@@ 00b0e700 Unwind@00b0e700 void Unwind_00b0e700(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e708 Unwind@00b0e708 void Unwind_00b0e708(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e710 Unwind@00b0e710 void Unwind_00b0e710(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e718 Unwind@00b0e718 void Unwind_00b0e718(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e720 Unwind@00b0e720 void Unwind_00b0e720(void) { FUN_0040c440(); return; } //@@ 00b0e728 Unwind@00b0e728 void Unwind_00b0e728(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0e760 Unwind@00b0e760 void Unwind_00b0e760(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00b0e768 Unwind@00b0e768 void Unwind_00b0e768(void) { FUN_0041d4b0(); return; } //@@ 00b0e773 Unwind@00b0e773 void Unwind_00b0e773(void) { FUN_0041d4b0(); return; } //@@ 00b0e7b0 Unwind@00b0e7b0 void Unwind_00b0e7b0(void) { FUN_0041d4b0(); return; } //@@ 00b0e7e0 Unwind@00b0e7e0 void Unwind_00b0e7e0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x2f00); return; } //@@ 00b0e820 Unwind@00b0e820 void Unwind_00b0e820(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2f00); return; } //@@ 00b0e832 Unwind@00b0e832 void Unwind_00b0e832(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e860 Unwind@00b0e860 void Unwind_00b0e860(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x2f00); return; } //@@ 00b0e872 Unwind@00b0e872 void Unwind_00b0e872(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x2f00); return; } //@@ 00b0e8b0 Unwind@00b0e8b0 void Unwind_00b0e8b0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0e8b8 Unwind@00b0e8b8 void Unwind_00b0e8b8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0e8c0 Unwind@00b0e8c0 void Unwind_00b0e8c0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b0e8c8 Unwind@00b0e8c8 void Unwind_00b0e8c8(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x44)); return; } //@@ 00b0e900 Unwind@00b0e900 void Unwind_00b0e900(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x18)); return; } //@@ 00b0e930 Unwind@00b0e930 void Unwind_00b0e930(void) { FUN_004242b0(); return; } //@@ 00b0e960 Unwind@00b0e960 void Unwind_00b0e960(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x1c)); return; } //@@ 00b0e990 Unwind@00b0e990 void Unwind_00b0e990(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0e998 Unwind@00b0e998 void Unwind_00b0e998(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0e9d0 Unwind@00b0e9d0 void Unwind_00b0e9d0(void) { std::vector::_Tidy(); return; } //@@ 00b0ea00 Unwind@00b0ea00 void Unwind_00b0ea00(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffe; FID_conflict__Tidy(*(void **)(unaff_EBP + 8)); return; } //@@ 00b0ea19 Unwind@00b0ea19 void Unwind_00b0ea19(void) { FUN_00498f80(); return; } //@@ 00b0ea21 Unwind@00b0ea21 void Unwind_00b0ea21(void) { FUN_004999b0(); return; } //@@ 00b0ea50 Unwind@00b0ea50 void Unwind_00b0ea50(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0ea58 Unwind@00b0ea58 void Unwind_00b0ea58(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x24),0x2f00); return; } //@@ 00b0ea6a Unwind@00b0ea6a void Unwind_00b0ea6a(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x24),0x2f00); return; } //@@ 00b0eaa0 Unwind@00b0eaa0 void Unwind_00b0eaa0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x1c)); return; } //@@ 00b0ead0 Unwind@00b0ead0 void Unwind_00b0ead0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -100)); return; } //@@ 00b0eb00 Unwind@00b0eb00 void Unwind_00b0eb00(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0eb40 Unwind@00b0eb40 void Unwind_00b0eb40(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x40)); return; } //@@ 00b0eb48 Unwind@00b0eb48 void Unwind_00b0eb48(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0eb80 Unwind@00b0eb80 void Unwind_00b0eb80(void) { std::deque<4byte>::~deque(); return; } //@@ 00b0eb88 Unwind@00b0eb88 void Unwind_00b0eb88(void) { FUN_004242b0(); return; } //@@ 00b0ebc0 Unwind@00b0ebc0 void Unwind_00b0ebc0(void) { FUN_004b3950(); return; } //@@ 00b0ebf0 Unwind@00b0ebf0 void Unwind_00b0ebf0(void) { FUN_0040c440(); return; } //@@ 00b0ebfb Unwind@00b0ebfb void Unwind_00b0ebfb(void) { FUN_00420710(); return; } //@@ 00b0ec06 Unwind@00b0ec06 void Unwind_00b0ec06(void) { FUN_0040c440(); return; } //@@ 00b0ec0e Unwind@00b0ec0e void Unwind_00b0ec0e(void) { FUN_0040c440(); return; } //@@ 00b0ec40 Unwind@00b0ec40 void Unwind_00b0ec40(void) { FUN_0041d4b0(); return; } //@@ 00b0ec48 Unwind@00b0ec48 void Unwind_00b0ec48(void) { FUN_00a55c20(); return; } //@@ 00b0ec80 Unwind@00b0ec80 void Unwind_00b0ec80(void) { std::vector::_Tidy(); return; } //@@ 00b0ec88 Unwind@00b0ec88 void Unwind_00b0ec88(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b0ecc0 Unwind@00b0ecc0 void Unwind_00b0ecc0(void) { FUN_009c3ef0(); return; } //@@ 00b0ecc8 Unwind@00b0ecc8 void Unwind_00b0ecc8(void) { FUN_004999b0(); return; } //@@ 00b0ecd0 Unwind@00b0ecd0 void Unwind_00b0ecd0(void) { FUN_004999b0(); return; } //@@ 00b0ecd8 Unwind@00b0ecd8 void Unwind_00b0ecd8(void) { FUN_00498f80(); return; } //@@ 00b0ece0 Unwind@00b0ece0 void Unwind_00b0ece0(void) { FUN_00436fb0(); return; } //@@ 00b0ece8 Unwind@00b0ece8 void Unwind_00b0ece8(void) { FUN_0042a230(); return; } //@@ 00b0ed20 Unwind@00b0ed20 void Unwind_00b0ed20(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x148); return; } //@@ 00b0ed60 Unwind@00b0ed60 void Unwind_00b0ed60(void) { FUN_004999b0(); return; } //@@ 00b0ed90 Unwind@00b0ed90 void Unwind_00b0ed90(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00b0ed9b Unwind@00b0ed9b void Unwind_00b0ed9b(void) { int unaff_EBP; ANM2::~ANM2((ANM2 *)(*(int *)(unaff_EBP + -0x10) + 0x118)); return; } //@@ 00b0eda9 Unwind@00b0eda9 void Unwind_00b0eda9(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(*(int *)(unaff_EBP + -0x10) + 0x22c)); return; } //@@ 00b0ede0 Unwind@00b0ede0 void Unwind_00b0ede0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ede8 Unwind@00b0ede8 void Unwind_00b0ede8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0edf0 Unwind@00b0edf0 void Unwind_00b0edf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0edf8 Unwind@00b0edf8 void Unwind_00b0edf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ee00 Unwind@00b0ee00 void Unwind_00b0ee00(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x6c)); return; } //@@ 00b0ee08 Unwind@00b0ee08 void Unwind_00b0ee08(void) { std::list::destructor(); return; } //@@ 00b0ee10 Unwind@00b0ee10 void Unwind_00b0ee10(void) { FUN_0042a210(); return; } //@@ 00b0ee50 Unwind@00b0ee50 void Unwind_00b0ee50(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1c) = *(uint *)(unaff_EBP + -0x1c) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b0ee90 Unwind@00b0ee90 void Unwind_00b0ee90(void) { FUN_0041d4b0(); return; } //@@ 00b0ee9b Unwind@00b0ee9b void Unwind_00b0ee9b(void) { FUN_0040c440(); return; } //@@ 00b0eea3 Unwind@00b0eea3 void Unwind_00b0eea3(void) { FUN_0041d4b0(); return; } //@@ 00b0eed0 Unwind@00b0eed0 void Unwind_00b0eed0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b0eed8 Unwind@00b0eed8 void Unwind_00b0eed8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0ef10 Unwind@00b0ef10 void Unwind_00b0ef10(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b0ef40 Unwind@00b0ef40 void Unwind_00b0ef40(void) { FUN_00420710(); return; } //@@ 00b0ef70 Unwind@00b0ef70 void Unwind_00b0ef70(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b0efa0 Unwind@00b0efa0 void Unwind_00b0efa0(void) { FUN_0085b260(); return; } //@@ 00b0efa8 Unwind@00b0efa8 void Unwind_00b0efa8(void) { FUN_00420710(); return; } //@@ 00b0eff0 Unwind@00b0eff0 void Unwind_00b0eff0(void) { FUN_00413b40(); return; } //@@ 00b0effb Unwind@00b0effb void Unwind_00b0effb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f003 Unwind@00b0f003 void Unwind_00b0f003(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x4c)); return; } //@@ 00b0f00b Unwind@00b0f00b void Unwind_00b0f00b(void) { FUN_00709850(); return; } //@@ 00b0f013 Unwind@00b0f013 void Unwind_00b0f013(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x100ac)); return; } //@@ 00b0f050 Unwind@00b0f050 void Unwind_00b0f050(void) { FUN_0040c440(); return; } //@@ 00b0f080 Unwind@00b0f080 void Unwind_00b0f080(void) { FUN_009c7320(); return; } //@@ 00b0f0b0 Unwind@00b0f0b0 void Unwind_00b0f0b0(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x2c)); return; } //@@ 00b0f0b8 Unwind@00b0f0b8 void Unwind_00b0f0b8(void) { FUN_009c7340(); return; } //@@ 00b0f0c0 Unwind@00b0f0c0 void Unwind_00b0f0c0(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + 8)); return; } //@@ 00b0f0f0 Unwind@00b0f0f0 void Unwind_00b0f0f0(void) { FUN_009c7340(); return; } //@@ 00b0f0f8 Unwind@00b0f0f8 void Unwind_00b0f0f8(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + 8)); return; } //@@ 00b0f130 Unwind@00b0f130 void Unwind_00b0f130(void) { FUN_009c7750(); return; } //@@ 00b0f13e Unwind@00b0f13e void Unwind_00b0f13e(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x1a0),0xb8,0x20f,RoomDescriptor::destructor); return; } //@@ 00b0f15c Unwind@00b0f15c void Unwind_00b0f15c(void) { std::deque<12byte>::~deque(); return; } //@@ 00b0f16a Unwind@00b0f16a void Unwind_00b0f16a(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x19d7c),0x5dc,8, GameStatePlayer::~GameStatePlayer); return; } //@@ 00b0f185 Unwind@00b0f185 void Unwind_00b0f185(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x1cc5c),0x5dc,4, GameStatePlayer::~GameStatePlayer); return; } //@@ 00b0f1a0 Unwind@00b0f1a0 void Unwind_00b0f1a0(void) { FUN_009c7780(); return; } //@@ 00b0f1ae Unwind@00b0f1ae void Unwind_00b0f1ae(void) { FUN_009c77f0(); return; } //@@ 00b0f1bc Unwind@00b0f1bc void Unwind_00b0f1bc(void) { FUN_009e94c0(); return; } //@@ 00b0f1ca Unwind@00b0f1ca void Unwind_00b0f1ca(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b0f1d8 Unwind@00b0f1d8 void Unwind_00b0f1d8(void) { std::vector::_Tidy(); return; } //@@ 00b0f1e6 Unwind@00b0f1e6 void Unwind_00b0f1e6(void) { int unaff_EBP; _eh_vector_destructor_iterator_ ((void *)(*(int *)(unaff_EBP + -0x10) + 0x1e7b4),800,7,FUN_006f29a0); return; } //@@ 00b0f201 Unwind@00b0f201 void Unwind_00b0f201(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x1fd98)); return; } //@@ 00b0f20f Unwind@00b0f20f void Unwind_00b0f20f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1fdac)); return; } //@@ 00b0f21d Unwind@00b0f21d void Unwind_00b0f21d(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1fdc4)); return; } //@@ 00b0f22b Unwind@00b0f22b void Unwind_00b0f22b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x1fde0)); return; } //@@ 00b0f239 Unwind@00b0f239 void Unwind_00b0f239(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1fdf4)); return; } //@@ 00b0f247 Unwind@00b0f247 void Unwind_00b0f247(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 0x1fe0c)); return; } //@@ 00b0f280 Unwind@00b0f280 void Unwind_00b0f280(void) { FUN_009e94c0(); return; } //@@ 00b0f2c0 Unwind@00b0f2c0 void Unwind_00b0f2c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x444)); return; } //@@ 00b0f320 Unwind@00b0f320 void Unwind_00b0f320(void) { int unaff_EBP; GameStatePlayer::~GameStatePlayer((GameStatePlayer *)(unaff_EBP + -0x668)); return; } //@@ 00b0f32b Unwind@00b0f32b void Unwind_00b0f32b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x6d8)); return; } //@@ 00b0f370 Unwind@00b0f370 void Unwind_00b0f370(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x84)); return; } //@@ 00b0f37b Unwind@00b0f37b void Unwind_00b0f37b(void) { int unaff_EBP; invoke_pending_callbacks((void *)(unaff_EBP + -0x100)); return; } //@@ 00b0f386 Unwind@00b0f386 void Unwind_00b0f386(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -100)); return; } //@@ 00b0f38e Unwind@00b0f38e void Unwind_00b0f38e(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x88)); return; } //@@ 00b0f3c0 Unwind@00b0f3c0 void Unwind_00b0f3c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x3c)); return; } //@@ 00b0f400 Unwind@00b0f400 void Unwind_00b0f400(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f408 Unwind@00b0f408 void Unwind_00b0f408(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f410 Unwind@00b0f410 void Unwind_00b0f410(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f418 Unwind@00b0f418 void Unwind_00b0f418(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0f450 Unwind@00b0f450 void Unwind_00b0f450(void) { FUN_00a28730(); return; } //@@ 00b0f45e Unwind@00b0f45e void Unwind_00b0f45e(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0xa4)); return; } //@@ 00b0f469 Unwind@00b0f469 void Unwind_00b0f469(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x98)); return; } //@@ 00b0f4b0 Unwind@00b0f4b0 void Unwind_00b0f4b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x628)); return; } //@@ 00b0f4f0 Unwind@00b0f4f0 void Unwind_00b0f4f0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + 8)); return; } //@@ 00b0f520 Unwind@00b0f520 void Unwind_00b0f520(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f528 Unwind@00b0f528 void Unwind_00b0f528(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f560 Unwind@00b0f560 void Unwind_00b0f560(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f568 Unwind@00b0f568 void Unwind_00b0f568(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f570 Unwind@00b0f570 void Unwind_00b0f570(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f578 Unwind@00b0f578 void Unwind_00b0f578(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f580 Unwind@00b0f580 void Unwind_00b0f580(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f588 Unwind@00b0f588 void Unwind_00b0f588(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f590 Unwind@00b0f590 void Unwind_00b0f590(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f5d0 Unwind@00b0f5d0 void Unwind_00b0f5d0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b0f5d8 Unwind@00b0f5d8 void Unwind_00b0f5d8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b0f630 Unwind@00b0f630 void Unwind_00b0f630(void) { FUN_0041c710(); return; } //@@ 00b0f638 Unwind@00b0f638 void Unwind_00b0f638(void) { FUN_0041c710(); return; } //@@ 00b0f670 Unwind@00b0f670 void Unwind_00b0f670(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1c4)); return; } //@@ 00b0f67b Unwind@00b0f67b void Unwind_00b0f67b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x1ac)); return; } //@@ 00b0f686 Unwind@00b0f686 void Unwind_00b0f686(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00b0f691 Unwind@00b0f691 void Unwind_00b0f691(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f699 Unwind@00b0f699 void Unwind_00b0f699(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x180)); return; } //@@ 00b0f6a4 Unwind@00b0f6a4 void Unwind_00b0f6a4(void) { int unaff_EBP; _eh_vector_destructor_iterator_((void *)(unaff_EBP + -0x98),8,4,FUN_0040c440); return; } //@@ 00b0f6ba Unwind@00b0f6ba void Unwind_00b0f6ba(void) { FUN_0040c440(); return; } //@@ 00b0f6c5 Unwind@00b0f6c5 void Unwind_00b0f6c5(void) { FUN_0040c440(); return; } //@@ 00b0f700 Unwind@00b0f700 void Unwind_00b0f700(void) { FUN_0040c440(); return; } //@@ 00b0f708 Unwind@00b0f708 void Unwind_00b0f708(void) { FUN_0040c440(); return; } //@@ 00b0f740 Unwind@00b0f740 void Unwind_00b0f740(void) { std::vector::_Tidy(); return; } //@@ 00b0f748 Unwind@00b0f748 void Unwind_00b0f748(void) { std::vector::_Tidy(); return; } //@@ 00b0f750 Unwind@00b0f750 void Unwind_00b0f750(void) { std::vector::_Tidy(); return; } //@@ 00b0f758 Unwind@00b0f758 void Unwind_00b0f758(void) { std::vector::_Tidy(); return; } //@@ 00b0f790 Unwind@00b0f790 void Unwind_00b0f790(void) { std::vector::_Tidy(); return; } //@@ 00b0f798 Unwind@00b0f798 void Unwind_00b0f798(void) { std::vector::_Tidy(); return; } //@@ 00b0f7a0 Unwind@00b0f7a0 void Unwind_00b0f7a0(void) { std::vector::_Tidy(); return; } //@@ 00b0f7d0 Unwind@00b0f7d0 void Unwind_00b0f7d0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00b0f810 Unwind@00b0f810 void Unwind_00b0f810(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x430)); return; } //@@ 00b0f81b Unwind@00b0f81b void Unwind_00b0f81b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x460)); return; } //@@ 00b0f826 Unwind@00b0f826 void Unwind_00b0f826(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x448)); return; } //@@ 00b0f831 Unwind@00b0f831 void Unwind_00b0f831(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x478)); return; } //@@ 00b0f83c Unwind@00b0f83c void Unwind_00b0f83c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x460)); return; } //@@ 00b0f847 Unwind@00b0f847 void Unwind_00b0f847(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x448)); return; } //@@ 00b0f852 Unwind@00b0f852 void Unwind_00b0f852(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x478)); return; } //@@ 00b0f890 Unwind@00b0f890 void Unwind_00b0f890(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f898 Unwind@00b0f898 void Unwind_00b0f898(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f8a0 Unwind@00b0f8a0 void Unwind_00b0f8a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f8a8 Unwind@00b0f8a8 void Unwind_00b0f8a8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0f8e0 Unwind@00b0f8e0 void Unwind_00b0f8e0(void) { std::deque<4byte>::~deque(); return; } //@@ 00b0f920 Unwind@00b0f920 void Unwind_00b0f920(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b0f960 Unwind@00b0f960 void Unwind_00b0f960(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b0f9a0 Unwind@00b0f9a0 void Unwind_00b0f9a0(void) { FUN_009e6df0(); return; } //@@ 00b0f9ab Unwind@00b0f9ab void Unwind_00b0f9ab(void) { FUN_009e7300(); return; } //@@ 00b0f9b6 Unwind@00b0f9b6 void Unwind_00b0f9b6(void) { FUN_009e72e0(); return; } //@@ 00b0f9c1 Unwind@00b0f9c1 void Unwind_00b0f9c1(void) { FUN_009e7400(); return; } //@@ 00b0f9cc Unwind@00b0f9cc void Unwind_00b0f9cc(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x428)); return; } //@@ 00b0fa10 Unwind@00b0fa10 void Unwind_00b0fa10(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffe; /* WARNING: Could not recover jumptable at 0x00b0fa26. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ios_>::~basic_ios_> ((basic_ios_> *)(*(int *)(unaff_EBP + -0x1c) + 0x68)); return; } //@@ 00b0fa2d Unwind@00b0fa2d void Unwind_00b0fa2d(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00b0fa33. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_ostream_>::~basic_ostream_> ((basic_ostream_> *)(*(int *)(unaff_EBP + -0x1c) + 8)); return; } //@@ 00b0fa39 Unwind@00b0fa39 void Unwind_00b0fa39(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00b0fa3c. Too many branches */ /* WARNING: Treating indirect jump as call */ std::basic_streambuf_>::~basic_streambuf_> (*(basic_streambuf_> **)(unaff_EBP + -0x14)); return; } //@@ 00b0fa42 Unwind@00b0fa42 void Unwind_00b0fa42(void) { std::basic_filebuf::~basic_filebuf(); return; } //@@ 00b0fa4d Unwind@00b0fa4d void Unwind_00b0fa4d(void) { FUN_009e6b80(); return; } //@@ 00b0fa80 Unwind@00b0fa80 void Unwind_00b0fa80(void) { int unaff_EBP; /* WARNING: Could not recover jumptable at 0x00b0fa83. Too many branches */ /* WARNING: Treating indirect jump as call */ std::_Lockit::~_Lockit((_Lockit *)(unaff_EBP + -0x14)); return; } //@@ 00b0fa89 Unwind@00b0fa89 void Unwind_00b0fa89(void) { FUN_009e8650(); return; } //@@ 00b0fac0 Unwind@00b0fac0 void Unwind_00b0fac0(void) { FUN_009e8fc0(); return; } //@@ 00b0fb40 Unwind@00b0fb40 void Unwind_00b0fb40(void) { FUN_00424420(); return; } //@@ 00b0fb70 Unwind@00b0fb70 void Unwind_00b0fb70(void) { FUN_00424420(); return; } //@@ 00b0fb78 Unwind@00b0fb78 void Unwind_00b0fb78(void) { FUN_00424420(); return; } //@@ 00b0fb80 Unwind@00b0fb80 void Unwind_00b0fb80(void) { FUN_007530c0(); return; } //@@ 00b0fb88 Unwind@00b0fb88 void Unwind_00b0fb88(void) { FUN_00424420(); return; } //@@ 00b0fbc0 Unwind@00b0fbc0 void Unwind_00b0fbc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + 8)); return; } //@@ 00b0fc00 Unwind@00b0fc00 void Unwind_00b0fc00(void) { FUN_007530c0(); return; } //@@ 00b0fc30 Unwind@00b0fc30 void Unwind_00b0fc30(void) { FUN_00428880(); return; } //@@ 00b0fc60 Unwind@00b0fc60 void Unwind_00b0fc60(void) { FUN_009ebfc0(); return; } //@@ 00b0fc90 Unwind@00b0fc90 void Unwind_00b0fc90(void) { FUN_00428880(); return; } //@@ 00b0fcc0 Unwind@00b0fcc0 void Unwind_00b0fcc0(void) { FUN_009ebfc0(); return; } //@@ 00b0fcc8 Unwind@00b0fcc8 void Unwind_00b0fcc8(void) { FUN_007530c0(); return; } //@@ 00b0fd00 Unwind@00b0fd00 void Unwind_00b0fd00(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fd08 Unwind@00b0fd08 void Unwind_00b0fd08(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fd10 Unwind@00b0fd10 void Unwind_00b0fd10(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0fd50 Unwind@00b0fd50 void Unwind_00b0fd50(void) { FUN_0041d4b0(); return; } //@@ 00b0fd90 Unwind@00b0fd90 void Unwind_00b0fd90(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0fd98 Unwind@00b0fd98 void Unwind_00b0fd98(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fda0 Unwind@00b0fda0 void Unwind_00b0fda0(void) { FUN_00413b40(); return; } //@@ 00b0fdab Unwind@00b0fdab void Unwind_00b0fdab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fdb3 Unwind@00b0fdb3 void Unwind_00b0fdb3(void) { FUN_00420b00(); return; } //@@ 00b0fdf0 Unwind@00b0fdf0 void Unwind_00b0fdf0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fdf8 Unwind@00b0fdf8 void Unwind_00b0fdf8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fe30 Unwind@00b0fe30 void Unwind_00b0fe30(void) { FUN_00420710(); return; } //@@ 00b0fe60 Unwind@00b0fe60 void Unwind_00b0fe60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b0fe68 Unwind@00b0fe68 void Unwind_00b0fe68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fe70 Unwind@00b0fe70 void Unwind_00b0fe70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b0fed0 Unwind@00b0fed0 void Unwind_00b0fed0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x13c),0x128); return; } //@@ 00b0fee5 Unwind@00b0fee5 void Unwind_00b0fee5(void) { int unaff_EBP; ANM2::~ANM2(*(ANM2 **)(unaff_EBP + -0x13c)); return; } //@@ 00b0fef0 Unwind@00b0fef0 void Unwind_00b0fef0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x138)); return; } //@@ 00b0ff30 Unwind@00b0ff30 void Unwind_00b0ff30(void) { std::vector>::_Tidy(); return; } //@@ 00b0ff38 Unwind@00b0ff38 void Unwind_00b0ff38(void) { FUN_0041d4b0(); return; } //@@ 00b0ff70 Unwind@00b0ff70 void Unwind_00b0ff70(void) { std::vector>::_Tidy(); return; } //@@ 00b0ffa0 Unwind@00b0ffa0 void Unwind_00b0ffa0(void) { std::vector::_Tidy(); return; } //@@ 00b0ffa8 Unwind@00b0ffa8 void Unwind_00b0ffa8(void) { std::vector::_Tidy(); return; } //@@ 00b0ffb3 Unwind@00b0ffb3 void Unwind_00b0ffb3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0ffbb Unwind@00b0ffbb void Unwind_00b0ffbb(void) { std::vector::_Tidy(); return; } //@@ 00b0ffc6 Unwind@00b0ffc6 void Unwind_00b0ffc6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0ffce Unwind@00b0ffce void Unwind_00b0ffce(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0ffd6 Unwind@00b0ffd6 void Unwind_00b0ffd6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b0ffde Unwind@00b0ffde void Unwind_00b0ffde(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b10020 Unwind@00b10020 void Unwind_00b10020(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b10028 Unwind@00b10028 void Unwind_00b10028(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10030 Unwind@00b10030 void Unwind_00b10030(void) { std::vector::_Tidy(); return; } //@@ 00b100b0 Unwind@00b100b0 void Unwind_00b100b0(void) { FUN_009f2480(); return; } //@@ 00b100e0 Unwind@00b100e0 void Unwind_00b100e0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10120 Unwind@00b10120 void Unwind_00b10120(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b10128 Unwind@00b10128 void Unwind_00b10128(void) { FUN_0040c440(); return; } //@@ 00b10160 Unwind@00b10160 void Unwind_00b10160(void) { FUN_00415ce0(); return; } //@@ 00b10190 Unwind@00b10190 void Unwind_00b10190(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa8)); return; } //@@ 00b1019b Unwind@00b1019b void Unwind_00b1019b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xc0)); return; } //@@ 00b101e0 Unwind@00b101e0 void Unwind_00b101e0(void) { FUN_00579700(); return; } //@@ 00b10210 Unwind@00b10210 void Unwind_00b10210(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b1021b Unwind@00b1021b void Unwind_00b1021b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10223 Unwind@00b10223 void Unwind_00b10223(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b1022b Unwind@00b1022b void Unwind_00b1022b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b10236 Unwind@00b10236 void Unwind_00b10236(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b1023e Unwind@00b1023e void Unwind_00b1023e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b10246 Unwind@00b10246 void Unwind_00b10246(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b1024e Unwind@00b1024e void Unwind_00b1024e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b10256 Unwind@00b10256 void Unwind_00b10256(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b1025e Unwind@00b1025e void Unwind_00b1025e(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b10269 Unwind@00b10269 void Unwind_00b10269(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b10271 Unwind@00b10271 void Unwind_00b10271(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10279 Unwind@00b10279 void Unwind_00b10279(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b10281 Unwind@00b10281 void Unwind_00b10281(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b1028c Unwind@00b1028c void Unwind_00b1028c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b10294 Unwind@00b10294 void Unwind_00b10294(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b1029c Unwind@00b1029c void Unwind_00b1029c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b102a4 Unwind@00b102a4 void Unwind_00b102a4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b102ac Unwind@00b102ac void Unwind_00b102ac(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b102b7 Unwind@00b102b7 void Unwind_00b102b7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b102bf Unwind@00b102bf void Unwind_00b102bf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b102c7 Unwind@00b102c7 void Unwind_00b102c7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b102cf Unwind@00b102cf void Unwind_00b102cf(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b102d7 Unwind@00b102d7 void Unwind_00b102d7(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b102df Unwind@00b102df void Unwind_00b102df(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b102ea Unwind@00b102ea void Unwind_00b102ea(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b102f2 Unwind@00b102f2 void Unwind_00b102f2(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b10330 Unwind@00b10330 void Unwind_00b10330(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x58)); return; } //@@ 00b10338 Unwind@00b10338 void Unwind_00b10338(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b10340 Unwind@00b10340 void Unwind_00b10340(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x40)); return; } //@@ 00b10348 Unwind@00b10348 void Unwind_00b10348(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x88)); return; } //@@ 00b10353 Unwind@00b10353 void Unwind_00b10353(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x70)); return; } //@@ 00b1035b Unwind@00b1035b void Unwind_00b1035b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa0)); return; } //@@ 00b103a0 Unwind@00b103a0 void Unwind_00b103a0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b103a8 Unwind@00b103a8 void Unwind_00b103a8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x58) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x58) = *(uint *)(unaff_EBP + -0x58) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b103f0 Unwind@00b103f0 void Unwind_00b103f0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x3c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x3c) = *(uint *)(unaff_EBP + -0x3c) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10440 Unwind@00b10440 void Unwind_00b10440(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10480 Unwind@00b10480 void Unwind_00b10480(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x48)); return; } //@@ 00b10488 Unwind@00b10488 void Unwind_00b10488(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x30)); return; } //@@ 00b104c0 Unwind@00b104c0 void Unwind_00b104c0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x44); return; } //@@ 00b10500 Unwind@00b10500 void Unwind_00b10500(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x54); return; } //@@ 00b10540 Unwind@00b10540 void Unwind_00b10540(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x48); return; } //@@ 00b10580 Unwind@00b10580 void Unwind_00b10580(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x50); return; } //@@ 00b105c0 Unwind@00b105c0 void Unwind_00b105c0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x54); return; } //@@ 00b105cf Unwind@00b105cf void Unwind_00b105cf(void) { int unaff_EBP; IsaacRepentancePlus::Weapon::~Weapon(*(Weapon **)(unaff_EBP + -0x10)); return; } //@@ 00b10600 Unwind@00b10600 void Unwind_00b10600(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x4c); return; } //@@ 00b10640 Unwind@00b10640 void Unwind_00b10640(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x60); return; } //@@ 00b1064f Unwind@00b1064f void Unwind_00b1064f(void) { int unaff_EBP; IsaacRepentancePlus::Weapon::~Weapon(*(Weapon **)(unaff_EBP + -0x10)); return; } //@@ 00b106a0 Unwind@00b106a0 void Unwind_00b106a0(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x2b8)); return; } //@@ 00b106ab Unwind@00b106ab void Unwind_00b106ab(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xac)); return; } //@@ 00b106b6 Unwind@00b106b6 void Unwind_00b106b6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x54)); return; } //@@ 00b106be Unwind@00b106be void Unwind_00b106be(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x278)); return; } //@@ 00b10700 Unwind@00b10700 void Unwind_00b10700(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x50) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x50) = *(uint *)(unaff_EBP + -0x50) & 0xfffffffd; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b10719 Unwind@00b10719 void Unwind_00b10719(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b10721 Unwind@00b10721 void Unwind_00b10721(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x38)); return; } //@@ 00b10760 Unwind@00b10760 void Unwind_00b10760(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x44)); return; } //@@ 00b10790 Unwind@00b10790 void Unwind_00b10790(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x15c)); return; } //@@ 00b107d0 Unwind@00b107d0 void Unwind_00b107d0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b10810 Unwind@00b10810 void Unwind_00b10810(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); return; } //@@ 00b10840 Unwind@00b10840 void Unwind_00b10840(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x148)); return; } //@@ 00b1084b Unwind@00b1084b void Unwind_00b1084b(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x154)); return; } //@@ 00b10856 Unwind@00b10856 void Unwind_00b10856(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x168)); return; } //@@ 00b10890 Unwind@00b10890 void Unwind_00b10890(void) { int unaff_EBP; EntityList_Query::~EntityList_Query((void *)(unaff_EBP + -0x50)); return; } //@@ 00b108c0 Unwind@00b108c0 void Unwind_00b108c0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b108f0 Unwind@00b108f0 void Unwind_00b108f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b108f8 Unwind@00b108f8 void Unwind_00b108f8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b10930 Unwind@00b10930 void Unwind_00b10930(void) { FUN_00a64970(); return; } //@@ 00b10980 Unwind@00b10980 void Unwind_00b10980(void) { FUN_0040c440(); return; } //@@ 00b10988 Unwind@00b10988 void Unwind_00b10988(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_0040c440(); return; } //@@ 00b109d0 Unwind@00b109d0 void Unwind_00b109d0(void) { FUN_0040c440(); return; } //@@ 00b109d8 Unwind@00b109d8 void Unwind_00b109d8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_0040c440(); return; } //@@ 00b109f1 Unwind@00b109f1 void Unwind_00b109f1(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffd; FUN_0040c440(); return; } //@@ 00b10a30 Unwind@00b10a30 void Unwind_00b10a30(void) { FUN_0040c440(); return; } //@@ 00b10a38 Unwind@00b10a38 void Unwind_00b10a38(void) { FUN_00a58200(); return; } //@@ 00b10a40 Unwind@00b10a40 void Unwind_00b10a40(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_0040c440(); return; } //@@ 00b10a80 Unwind@00b10a80 void Unwind_00b10a80(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x60); return; } //@@ 00b10a8f Unwind@00b10a8f void Unwind_00b10a8f(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0x18),0x18); return; } //@@ 00b10a9e Unwind@00b10a9e void Unwind_00b10a9e(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_0041c710(); return; } //@@ 00b10ab7 Unwind@00b10ab7 void Unwind_00b10ab7(void) { FUN_007098c0(); return; } //@@ 00b10af0 Unwind@00b10af0 void Unwind_00b10af0(void) { FUN_007098c0(); return; } //@@ 00b10b20 Unwind@00b10b20 void Unwind_00b10b20(void) { FUN_00a24e90(); return; } //@@ 00b10b50 Unwind@00b10b50 void Unwind_00b10b50(void) { FUN_00415ce0(); return; } //@@ 00b10b58 Unwind@00b10b58 void Unwind_00b10b58(void) { FUN_00415ce0(); return; } //@@ 00b10b60 Unwind@00b10b60 void Unwind_00b10b60(void) { FUN_00415b30(); return; } //@@ 00b10b90 Unwind@00b10b90 void Unwind_00b10b90(void) { FUN_00a58200(); return; } //@@ 00b10bc0 Unwind@00b10bc0 void Unwind_00b10bc0(void) { FUN_0040c440(); return; } //@@ 00b10bc8 Unwind@00b10bc8 void Unwind_00b10bc8(void) { FUN_007098c0(); return; } //@@ 00b10c00 Unwind@00b10c00 void Unwind_00b10c00(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x10); return; } //@@ 00b10c40 Unwind@00b10c40 void Unwind_00b10c40(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x44); return; } //@@ 00b10c4f Unwind@00b10c4f void Unwind_00b10c4f(void) { FUN_0040c440(); return; } //@@ 00b10c5a Unwind@00b10c5a void Unwind_00b10c5a(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x18) + 0x28)); return; } //@@ 00b10c90 Unwind@00b10c90 void Unwind_00b10c90(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x34)); return; } //@@ 00b10cc0 Unwind@00b10cc0 void Unwind_00b10cc0(void) { FUN_0042a230(); return; } //@@ 00b10cc8 Unwind@00b10cc8 void Unwind_00b10cc8(void) { FUN_0042a230(); return; } //@@ 00b10d00 Unwind@00b10d00 void Unwind_00b10d00(void) { FUN_00a24e90(); return; } //@@ 00b10d0a Unwind@00b10d0a void Unwind_00b10d0a(void) { FUN_00436fb0(); return; } //@@ 00b10d14 Unwind@00b10d14 void Unwind_00b10d14(void) { FUN_00436fb0(); return; } //@@ 00b10d40 Unwind@00b10d40 void Unwind_00b10d40(void) { FUN_0042a230(); return; } //@@ 00b10db0 Unwind@00b10db0 void Unwind_00b10db0(void) { FUN_00a14bf0(); return; } //@@ 00b10de0 Unwind@00b10de0 void Unwind_00b10de0(void) { FUN_00a15c00(); return; } //@@ 00b10e10 Unwind@00b10e10 void Unwind_00b10e10(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x14); return; } //@@ 00b10e1f Unwind@00b10e1f void Unwind_00b10e1f(void) { FUN_00a68540(); return; } //@@ 00b10e50 Unwind@00b10e50 void Unwind_00b10e50(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FID_conflict__Tidy(*(void **)(unaff_EBP + 8)); return; } //@@ 00b10e90 Unwind@00b10e90 void Unwind_00b10e90(void) { FUN_00a16e60(); return; } //@@ 00b10e98 Unwind@00b10e98 void Unwind_00b10e98(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x18) * 8; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x1c),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b10ef0 Unwind@00b10ef0 void Unwind_00b10ef0(void) { FUN_00a16e60(); return; } //@@ 00b10ef8 Unwind@00b10ef8 void Unwind_00b10ef8(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + 8) * 8; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + 0xc),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b10f50 Unwind@00b10f50 void Unwind_00b10f50(void) { FUN_00a15c00(); return; } //@@ 00b10f58 Unwind@00b10f58 void Unwind_00b10f58(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x34),0x14); return; } //@@ 00b10f67 Unwind@00b10f67 void Unwind_00b10f67(void) { FUN_00a68540(); return; } //@@ 00b10f6f Unwind@00b10f6f void Unwind_00b10f6f(void) { FUN_00a15c00(); return; } //@@ 00b10fe0 Unwind@00b10fe0 void Unwind_00b10fe0(void) { FUN_00a5a420(); return; } //@@ 00b11010 Unwind@00b11010 void Unwind_00b11010(void) { int unaff_EBP; KAGE::Filesys::ArchivedFile::~ArchivedFile((void *)(unaff_EBP + -0xe44)); return; } //@@ 00b11050 Unwind@00b11050 void Unwind_00b11050(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0xc2c); return; } //@@ 00b11090 Unwind@00b11090 void Unwind_00b11090(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x10); return; } //@@ 00b110d0 Unwind@00b110d0 void Unwind_00b110d0(void) { FUN_00a24e90(); return; } //@@ 00b110d8 Unwind@00b110d8 void Unwind_00b110d8(void) { thunk_FUN_00a13c00(); return; } //@@ 00b110e3 Unwind@00b110e3 void Unwind_00b110e3(void) { std::deque<4byte>::~deque(); return; } //@@ 00b110ee Unwind@00b110ee void Unwind_00b110ee(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0x10) + 0x80)); return; } //@@ 00b110fc Unwind@00b110fc void Unwind_00b110fc(void) { FUN_00a180a0(); return; } //@@ 00b11104 Unwind@00b11104 void Unwind_00b11104(void) { FUN_00a18df0(); return; } //@@ 00b11112 Unwind@00b11112 void Unwind_00b11112(void) { FUN_00a18df0(); return; } //@@ 00b11120 Unwind@00b11120 void Unwind_00b11120(void) { FUN_00a18df0(); return; } //@@ 00b11150 Unwind@00b11150 void Unwind_00b11150(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x10); return; } //@@ 00b11190 Unwind@00b11190 void Unwind_00b11190(void) { FUN_004b3950(); return; } //@@ 00b111c0 Unwind@00b111c0 void Unwind_00b111c0(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x444) * 8; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x448),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b111f3 Unwind@00b111f3 void Unwind_00b111f3(void) { FUN_0040c440(); return; } //@@ 00b11250 Unwind@00b11250 void Unwind_00b11250(void) { FUN_00a55c20(); return; } //@@ 00b11280 Unwind@00b11280 void Unwind_00b11280(void) { FUN_00a55c20(); return; } //@@ 00b112b0 Unwind@00b112b0 void Unwind_00b112b0(void) { FUN_00a55c20(); return; } //@@ 00b112e0 Unwind@00b112e0 void Unwind_00b112e0(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b112eb Unwind@00b112eb void Unwind_00b112eb(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b112f3 Unwind@00b112f3 void Unwind_00b112f3(void) { FUN_00a55c20(); return; } //@@ 00b112fb Unwind@00b112fb void Unwind_00b112fb(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b11330 Unwind@00b11330 void Unwind_00b11330(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b1133b Unwind@00b1133b void Unwind_00b1133b(void) { FUN_00a1d600(); return; } //@@ 00b11343 Unwind@00b11343 void Unwind_00b11343(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b1134b Unwind@00b1134b void Unwind_00b1134b(void) { FUN_00a55c20(); return; } //@@ 00b11353 Unwind@00b11353 void Unwind_00b11353(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b11380 Unwind@00b11380 void Unwind_00b11380(void) { FUN_00a1d600(); return; } //@@ 00b11388 Unwind@00b11388 void Unwind_00b11388(void) { FUN_0042a210(); return; } //@@ 00b113c0 Unwind@00b113c0 void Unwind_00b113c0(void) { FUN_004b3950(); return; } //@@ 00b113c8 Unwind@00b113c8 void Unwind_00b113c8(void) { thunk_FUN_004b3950(); return; } //@@ 00b11400 Unwind@00b11400 void Unwind_00b11400(void) { __Init_thread_abort(&DAT_00c947d8); return; } //@@ 00b11430 Unwind@00b11430 void Unwind_00b11430(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x14) * 8; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x18),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b11480 Unwind@00b11480 void Unwind_00b11480(void) { FUN_00a214f0(); return; } //@@ 00b11488 Unwind@00b11488 void Unwind_00b11488(void) { FUN_00a64970(); return; } //@@ 00b114c0 Unwind@00b114c0 void Unwind_00b114c0(void) { FUN_00a64970(); return; } //@@ 00b114c8 Unwind@00b114c8 void Unwind_00b114c8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_004242b0(); return; } //@@ 00b114e1 Unwind@00b114e1 void Unwind_00b114e1(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffd; FUN_004242b0(); return; } //@@ 00b114fa Unwind@00b114fa void Unwind_00b114fa(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffb; FUN_004242b0(); return; } //@@ 00b11540 Unwind@00b11540 void Unwind_00b11540(void) { FUN_00a64970(); return; } //@@ 00b11590 Unwind@00b11590 void Unwind_00b11590(void) { FUN_004242b0(); return; } //@@ 00b115c0 Unwind@00b115c0 void Unwind_00b115c0(void) { FUN_004242b0(); return; } //@@ 00b115f0 Unwind@00b115f0 void Unwind_00b115f0(void) { FUN_004242b0(); return; } //@@ 00b11620 Unwind@00b11620 void Unwind_00b11620(void) { FUN_004242b0(); return; } //@@ 00b11650 Unwind@00b11650 void Unwind_00b11650(void) { FUN_004242b0(); return; } //@@ 00b11680 Unwind@00b11680 void Unwind_00b11680(void) { FUN_004242b0(); return; } //@@ 00b116b0 Unwind@00b116b0 void Unwind_00b116b0(void) { FUN_00a64970(); return; } //@@ 00b116b8 Unwind@00b116b8 void Unwind_00b116b8(void) { FUN_004242b0(); return; } //@@ 00b116f0 Unwind@00b116f0 void Unwind_00b116f0(void) { FUN_004242b0(); return; } //@@ 00b11720 Unwind@00b11720 void Unwind_00b11720(void) { FUN_00a24e90(); return; } //@@ 00b1172a Unwind@00b1172a void Unwind_00b1172a(void) { FUN_00a214f0(); return; } //@@ 00b11734 Unwind@00b11734 void Unwind_00b11734(void) { FUN_00a15730(); return; } //@@ 00b1173e Unwind@00b1173e void Unwind_00b1173e(void) { FUN_00a18df0(); return; } //@@ 00b11748 Unwind@00b11748 void Unwind_00b11748(void) { FUN_00a18df0(); return; } //@@ 00b11752 Unwind@00b11752 void Unwind_00b11752(void) { FUN_00a18df0(); return; } //@@ 00b11780 Unwind@00b11780 void Unwind_00b11780(void) { FUN_00a21900(); return; } //@@ 00b117b0 Unwind@00b117b0 void Unwind_00b117b0(void) { FUN_00a21900(); return; } //@@ 00b117e0 Unwind@00b117e0 void Unwind_00b117e0(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x14) * 8; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x18),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b1180d Unwind@00b1180d void Unwind_00b1180d(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x370); return; } //@@ 00b1181f Unwind@00b1181f void Unwind_00b1181f(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x18); return; } //@@ 00b11850 Unwind@00b11850 void Unwind_00b11850(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x4f0); return; } //@@ 00b11862 Unwind@00b11862 void Unwind_00b11862(void) { FUN_00a1e1f0(); return; } //@@ 00b1186a Unwind@00b1186a void Unwind_00b1186a(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x18); return; } //@@ 00b118a0 Unwind@00b118a0 void Unwind_00b118a0(void) { FUN_004242b0(); return; } //@@ 00b118d0 Unwind@00b118d0 void Unwind_00b118d0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x40); return; } //@@ 00b118df Unwind@00b118df void Unwind_00b118df(void) { FUN_00a15730(); return; } //@@ 00b118ea Unwind@00b118ea void Unwind_00b118ea(void) { FUN_00498f80(); return; } //@@ 00b118f5 Unwind@00b118f5 void Unwind_00b118f5(void) { FUN_0042c780(); return; } //@@ 00b11900 Unwind@00b11900 void Unwind_00b11900(void) { int unaff_EBP; KAGE::Memory::HeapBase::~HeapBase(*(void **)(unaff_EBP + -0x10)); return; } //@@ 00b11930 Unwind@00b11930 void Unwind_00b11930(void) { FUN_00a24e90(); return; } //@@ 00b1193a Unwind@00b1193a void Unwind_00b1193a(void) { FUN_00436fb0(); return; } //@@ 00b11970 Unwind@00b11970 void Unwind_00b11970(void) { FUN_00a23ce0(); return; } //@@ 00b119a0 Unwind@00b119a0 void Unwind_00b119a0(void) { FUN_0040c440(); return; } //@@ 00b119e0 Unwind@00b119e0 void Unwind_00b119e0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_00a23ce0(); return; } //@@ 00b119f9 Unwind@00b119f9 void Unwind_00b119f9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffd; FUN_00a23ce0(); return; } //@@ 00b11a12 Unwind@00b11a12 void Unwind_00b11a12(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffb; FUN_00a23ce0(); return; } //@@ 00b11a50 Unwind@00b11a50 void Unwind_00b11a50(void) { FUN_0042f780(); return; } //@@ 00b11a58 Unwind@00b11a58 void Unwind_00b11a58(void) { FUN_0042f780(); return; } //@@ 00b11a60 Unwind@00b11a60 void Unwind_00b11a60(void) { FUN_0040c440(); return; } //@@ 00b11a6b Unwind@00b11a6b void Unwind_00b11a6b(void) { FUN_00a23ce0(); return; } //@@ 00b11aa0 Unwind@00b11aa0 void Unwind_00b11aa0(void) { FUN_00a24e90(); return; } //@@ 00b11ad0 Unwind@00b11ad0 void Unwind_00b11ad0(void) { FUN_00436fb0(); return; } //@@ 00b11b60 Unwind@00b11b60 void Unwind_00b11b60(void) { FUN_00413b40(); return; } //@@ 00b11b6b Unwind@00b11b6b void Unwind_00b11b6b(void) { FUN_00a27930(); return; } //@@ 00b11bb0 Unwind@00b11bb0 void Unwind_00b11bb0(void) { FUN_0060cc00(); return; } //@@ 00b11bb8 Unwind@00b11bb8 void Unwind_00b11bb8(void) { FUN_0060cc00(); return; } //@@ 00b11bf0 Unwind@00b11bf0 void Unwind_00b11bf0(void) { FUN_00a28730(); return; } //@@ 00b11bfb Unwind@00b11bfb void Unwind_00b11bfb(void) { FUN_00a28730(); return; } //@@ 00b11c30 Unwind@00b11c30 void Unwind_00b11c30(void) { FUN_00a28730(); return; } //@@ 00b11c38 Unwind@00b11c38 void Unwind_00b11c38(void) { FUN_00a28730(); return; } //@@ 00b11c70 Unwind@00b11c70 void Unwind_00b11c70(void) { FUN_00a28730(); return; } //@@ 00b11ca0 Unwind@00b11ca0 void Unwind_00b11ca0(void) { FUN_008ea350(); return; } //@@ 00b11cd0 Unwind@00b11cd0 void Unwind_00b11cd0(void) { FUN_00a24e90(); return; } //@@ 00b11cd8 Unwind@00b11cd8 void Unwind_00b11cd8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(*(int *)(unaff_EBP + -0x14) + 0x10)); return; } //@@ 00b11ce3 Unwind@00b11ce3 void Unwind_00b11ce3(void) { KAGE::ThreadSafeQueue::~ThreadSafeQueue(); return; } //@@ 00b11cee Unwind@00b11cee void Unwind_00b11cee(void) { int unaff_EBP; KAGE::Thread::~Thread((void *)(*(int *)(unaff_EBP + -0x18) + 0x2c)); return; } //@@ 00b11cf9 Unwind@00b11cf9 void Unwind_00b11cf9(void) { multiplayer_connection_state_destroy(); return; } //@@ 00b11d04 Unwind@00b11d04 void Unwind_00b11d04(void) { KAGE::ThreadSafeQueue::~ThreadSafeQueue(); return; } //@@ 00b11d0f Unwind@00b11d0f void Unwind_00b11d0f(void) { multiplayer_lobby_state_destroy(); return; } //@@ 00b11d1a Unwind@00b11d1a void Unwind_00b11d1a(void) { FUN_00a53880(); return; } //@@ 00b11d28 Unwind@00b11d28 void Unwind_00b11d28(void) { FUN_00a539d0(); return; } //@@ 00b11d36 Unwind@00b11d36 void Unwind_00b11d36(void) { KAGE::ThreadSafeQueue::~ThreadSafeQueue(); return; } //@@ 00b11d44 Unwind@00b11d44 void Unwind_00b11d44(void) { FUN_00a18df0(); return; } //@@ 00b11d52 Unwind@00b11d52 void Unwind_00b11d52(void) { FUN_00a18df0(); return; } //@@ 00b11d90 Unwind@00b11d90 void Unwind_00b11d90(void) { FUN_00a2a8b0(); return; } //@@ 00b11d98 Unwind@00b11d98 void Unwind_00b11d98(void) { FUN_00a28730(); return; } //@@ 00b11da0 Unwind@00b11da0 void Unwind_00b11da0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b11da8 Unwind@00b11da8 void Unwind_00b11da8(void) { FUN_00a28730(); return; } //@@ 00b11db0 Unwind@00b11db0 void Unwind_00b11db0(void) { FUN_00a28730(); return; } //@@ 00b11db8 Unwind@00b11db8 void Unwind_00b11db8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x54)); return; } //@@ 00b11dc0 Unwind@00b11dc0 void Unwind_00b11dc0(void) { FUN_008ea350(); return; } //@@ 00b11dc8 Unwind@00b11dc8 void Unwind_00b11dc8(void) { FUN_008ea350(); return; } //@@ 00b11e00 Unwind@00b11e00 void Unwind_00b11e00(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x74); return; } //@@ 00b11e0f Unwind@00b11e0f void Unwind_00b11e0f(void) { int unaff_EBP; KAGE::Network::Multiplayer::ServiceBase::~ServiceBase(*(void **)(unaff_EBP + -0x14)); return; } //@@ 00b11e17 Unwind@00b11e17 void Unwind_00b11e17(void) { FUN_00a1d600(); return; } //@@ 00b11e22 Unwind@00b11e22 void Unwind_00b11e22(void) { FUN_00a1d600(); return; } //@@ 00b11e2d Unwind@00b11e2d void Unwind_00b11e2d(void) { std::vector::_Tidy(); return; } //@@ 00b11e38 Unwind@00b11e38 void Unwind_00b11e38(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(*(int *)(unaff_EBP + -0x14) + 0x68)); return; } //@@ 00b11e43 Unwind@00b11e43 void Unwind_00b11e43(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0xb0); return; } //@@ 00b11e55 Unwind@00b11e55 void Unwind_00b11e55(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x68); return; } //@@ 00b11e90 Unwind@00b11e90 void Unwind_00b11e90(void) { FUN_00708d40(); return; } //@@ 00b11e98 Unwind@00b11e98 void Unwind_00b11e98(void) { FUN_00a64970(); return; } //@@ 00b11ea0 Unwind@00b11ea0 void Unwind_00b11ea0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x20); return; } //@@ 00b11eaf Unwind@00b11eaf void Unwind_00b11eaf(void) { FUN_006431b0(); return; } //@@ 00b11eba Unwind@00b11eba void Unwind_00b11eba(void) { FUN_00a1d600(); return; } //@@ 00b11ec5 Unwind@00b11ec5 void Unwind_00b11ec5(void) { FUN_00708d40(); return; } //@@ 00b11ef0 Unwind@00b11ef0 void Unwind_00b11ef0(void) { FUN_00708d40(); return; } //@@ 00b11f20 Unwind@00b11f20 void Unwind_00b11f20(void) { FUN_00a28730(); return; } //@@ 00b11f28 Unwind@00b11f28 void Unwind_00b11f28(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b11f30 Unwind@00b11f30 void Unwind_00b11f30(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b11f38 Unwind@00b11f38 void Unwind_00b11f38(void) { FUN_00a2a8b0(); return; } //@@ 00b11f70 Unwind@00b11f70 void Unwind_00b11f70(void) { FUN_00a28730(); return; } //@@ 00b11fa0 Unwind@00b11fa0 void Unwind_00b11fa0(void) { FUN_00a28730(); return; } //@@ 00b11fa8 Unwind@00b11fa8 void Unwind_00b11fa8(void) { FUN_00a28730(); return; } //@@ 00b11fb0 Unwind@00b11fb0 void Unwind_00b11fb0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b11fb8 Unwind@00b11fb8 void Unwind_00b11fb8(void) { FUN_00a2a8b0(); return; } //@@ 00b11ff0 Unwind@00b11ff0 void Unwind_00b11ff0(void) { FUN_0042a210(); return; } //@@ 00b12020 Unwind@00b12020 void Unwind_00b12020(void) { FUN_007e2740(); return; } //@@ 00b12028 Unwind@00b12028 void Unwind_00b12028(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x18); return; } //@@ 00b12060 Unwind@00b12060 void Unwind_00b12060(void) { FUN_007e2740(); return; } //@@ 00b12090 Unwind@00b12090 void Unwind_00b12090(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00b120c0 Unwind@00b120c0 void Unwind_00b120c0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0x14),0x18); return; } //@@ 00b120cf Unwind@00b120cf void Unwind_00b120cf(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_007e2740(); return; } //@@ 00b120e8 Unwind@00b120e8 void Unwind_00b120e8(void) { FUN_007e2740(); return; } //@@ 00b120f0 Unwind@00b120f0 void Unwind_00b120f0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0xa8); return; } //@@ 00b12102 Unwind@00b12102 void Unwind_00b12102(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),100); return; } //@@ 00b12111 Unwind@00b12111 void Unwind_00b12111(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0xc4); return; } //@@ 00b12123 Unwind@00b12123 void Unwind_00b12123(void) { FUN_00aa0240(); return; } //@@ 00b1212b Unwind@00b1212b void Unwind_00b1212b(void) { FUN_00a15730(); return; } //@@ 00b12139 Unwind@00b12139 void Unwind_00b12139(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + 0xc) + 0xac)); return; } //@@ 00b12147 Unwind@00b12147 void Unwind_00b12147(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x58); return; } //@@ 00b12156 Unwind@00b12156 void Unwind_00b12156(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x20740); return; } //@@ 00b12168 Unwind@00b12168 void Unwind_00b12168(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x4c); return; } //@@ 00b12177 Unwind@00b12177 void Unwind_00b12177(void) { FUN_00a2b780(); return; } //@@ 00b121b0 Unwind@00b121b0 void Unwind_00b121b0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_007e2740(); return; } //@@ 00b121c9 Unwind@00b121c9 void Unwind_00b121c9(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 0xc),0x18); return; } //@@ 00b121d8 Unwind@00b121d8 void Unwind_00b121d8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffd; FUN_007e2740(); return; } //@@ 00b121f1 Unwind@00b121f1 void Unwind_00b121f1(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffb; FUN_007e2740(); return; } //@@ 00b12230 Unwind@00b12230 void Unwind_00b12230(void) { FUN_00a24e90(); return; } //@@ 00b12260 Unwind@00b12260 void Unwind_00b12260(void) { FUN_00415ce0(); return; } //@@ 00b12268 Unwind@00b12268 void Unwind_00b12268(void) { FUN_00415ce0(); return; } //@@ 00b12270 Unwind@00b12270 void Unwind_00b12270(void) { sound_entry_ptr_destroy(); return; } //@@ 00b122a0 Unwind@00b122a0 void Unwind_00b122a0(void) { FUN_007dcd30(); return; } //@@ 00b122f0 Unwind@00b122f0 void Unwind_00b122f0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0xb0); return; } //@@ 00b12330 Unwind@00b12330 void Unwind_00b12330(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0xb0); return; } //@@ 00b12370 Unwind@00b12370 void Unwind_00b12370(void) { FUN_00a64970(); return; } //@@ 00b123b0 Unwind@00b123b0 void Unwind_00b123b0(void) { FUN_004999b0(); return; } //@@ 00b123e0 Unwind@00b123e0 void Unwind_00b123e0(void) { FUN_00a24e90(); return; } //@@ 00b123ea Unwind@00b123ea void Unwind_00b123ea(void) { FUN_00436fb0(); return; } //@@ 00b123f4 Unwind@00b123f4 void Unwind_00b123f4(void) { FUN_00a15730(); return; } //@@ 00b12440 Unwind@00b12440 void Unwind_00b12440(void) { FUN_00a1d600(); return; } //@@ 00b12470 Unwind@00b12470 void Unwind_00b12470(void) { FUN_00a53390(); return; } //@@ 00b12478 Unwind@00b12478 void Unwind_00b12478(void) { FUN_0042a230(); return; } //@@ 00b124b0 Unwind@00b124b0 void Unwind_00b124b0(void) { FUN_00a52a40(); return; } //@@ 00b12520 Unwind@00b12520 void Unwind_00b12520(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b12560 Unwind@00b12560 void Unwind_00b12560(void) { FUN_00a539d0(); return; } //@@ 00b12568 Unwind@00b12568 void Unwind_00b12568(void) { FUN_00a53bc0(); return; } //@@ 00b12570 Unwind@00b12570 void Unwind_00b12570(void) { std::vector::_Tidy(); return; } //@@ 00b125a0 Unwind@00b125a0 void Unwind_00b125a0(void) { FUN_00a28730(); return; } //@@ 00b125a8 Unwind@00b125a8 void Unwind_00b125a8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x34)); return; } //@@ 00b125c1 Unwind@00b125c1 void Unwind_00b125c1(void) { FUN_00a28730(); return; } //@@ 00b125c9 Unwind@00b125c9 void Unwind_00b125c9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffd; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b125e2 Unwind@00b125e2 void Unwind_00b125e2(void) { FUN_00a28730(); return; } //@@ 00b125ea Unwind@00b125ea void Unwind_00b125ea(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x34)); return; } //@@ 00b12620 Unwind@00b12620 void Unwind_00b12620(void) { std::vector::_Tidy(); return; } //@@ 00b12628 Unwind@00b12628 void Unwind_00b12628(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b12630 Unwind@00b12630 void Unwind_00b12630(void) { FUN_00a28730(); return; } //@@ 00b12660 Unwind@00b12660 void Unwind_00b12660(void) { FUN_00a28730(); return; } //@@ 00b12690 Unwind@00b12690 void Unwind_00b12690(void) { FUN_00a28730(); return; } //@@ 00b126c0 Unwind@00b126c0 void Unwind_00b126c0(void) { FUN_00a1d600(); return; } //@@ 00b126c8 Unwind@00b126c8 void Unwind_00b126c8(void) { FUN_00a28730(); return; } //@@ 00b126d0 Unwind@00b126d0 void Unwind_00b126d0(void) { FUN_00a28730(); return; } //@@ 00b126d8 Unwind@00b126d8 void Unwind_00b126d8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b12710 Unwind@00b12710 void Unwind_00b12710(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x18)); return; } //@@ 00b12740 Unwind@00b12740 void Unwind_00b12740(void) { FUN_00a28730(); return; } //@@ 00b12790 Unwind@00b12790 void Unwind_00b12790(void) { FUN_00a558e0(); return; } //@@ 00b12798 Unwind@00b12798 void Unwind_00b12798(void) { FUN_00a28730(); return; } //@@ 00b127d0 Unwind@00b127d0 void Unwind_00b127d0(void) { FUN_00a28730(); return; } //@@ 00b12800 Unwind@00b12800 void Unwind_00b12800(void) { std::vector<12byte>::_Tidy(); return; } //@@ 00b12830 Unwind@00b12830 void Unwind_00b12830(void) { FUN_00a1d600(); return; } //@@ 00b12860 Unwind@00b12860 void Unwind_00b12860(void) { FUN_00a1d600(); return; } //@@ 00b12890 Unwind@00b12890 void Unwind_00b12890(void) { FUN_00a1d600(); return; } //@@ 00b128c0 Unwind@00b128c0 void Unwind_00b128c0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; vector_UserProfile_destroy(*(void **)(unaff_EBP + 8)); return; } //@@ 00b128d9 Unwind@00b128d9 void Unwind_00b128d9(void) { FUN_008ea350(); return; } //@@ 00b128e1 Unwind@00b128e1 void Unwind_00b128e1(void) { FUN_008ea350(); return; } //@@ 00b128e9 Unwind@00b128e9 void Unwind_00b128e9(void) { FUN_008ea350(); return; } //@@ 00b12920 Unwind@00b12920 void Unwind_00b12920(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x38)); return; } //@@ 00b12928 Unwind@00b12928 void Unwind_00b12928(void) { FUN_00a28730(); return; } //@@ 00b12960 Unwind@00b12960 void Unwind_00b12960(void) { FUN_008ea350(); return; } //@@ 00b12968 Unwind@00b12968 void Unwind_00b12968(void) { FUN_00a28730(); return; } //@@ 00b129a0 Unwind@00b129a0 void Unwind_00b129a0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b129a8 Unwind@00b129a8 void Unwind_00b129a8(void) { FUN_008ea350(); return; } //@@ 00b129b0 Unwind@00b129b0 void Unwind_00b129b0(void) { int unaff_EBP; FriendEntry::~FriendEntry((void *)(unaff_EBP + -0x38)); return; } //@@ 00b129b8 Unwind@00b129b8 void Unwind_00b129b8(void) { FUN_008ea350(); return; } //@@ 00b129f0 Unwind@00b129f0 void Unwind_00b129f0(void) { FUN_008ea350(); return; } //@@ 00b129f8 Unwind@00b129f8 void Unwind_00b129f8(void) { FUN_00a28730(); return; } //@@ 00b12a30 Unwind@00b12a30 void Unwind_00b12a30(void) { FUN_00a57b70(); return; } //@@ 00b12a38 Unwind@00b12a38 void Unwind_00b12a38(void) { FUN_008ea350(); return; } //@@ 00b12a40 Unwind@00b12a40 void Unwind_00b12a40(void) { FUN_00a28730(); return; } //@@ 00b12a70 Unwind@00b12a70 void Unwind_00b12a70(void) { FUN_00a57b70(); return; } //@@ 00b12a78 Unwind@00b12a78 void Unwind_00b12a78(void) { FUN_008ea350(); return; } //@@ 00b12a80 Unwind@00b12a80 void Unwind_00b12a80(void) { FUN_00a28730(); return; } //@@ 00b12ab0 Unwind@00b12ab0 void Unwind_00b12ab0(void) { FUN_00a57b80(); return; } //@@ 00b12aba Unwind@00b12aba void Unwind_00b12aba(void) { FUN_00a1d600(); return; } //@@ 00b12ac4 Unwind@00b12ac4 void Unwind_00b12ac4(void) { std::vector::_Tidy(); return; } //@@ 00b12ace Unwind@00b12ace void Unwind_00b12ace(void) { std::vector::_Tidy(); return; } //@@ 00b12b00 Unwind@00b12b00 void Unwind_00b12b00(void) { FUN_00a57c00(); return; } //@@ 00b12b08 Unwind@00b12b08 void Unwind_00b12b08(void) { FUN_00a28160(); return; } //@@ 00b12b40 Unwind@00b12b40 void Unwind_00b12b40(void) { FUN_00708d40(); return; } //@@ 00b12b70 Unwind@00b12b70 void Unwind_00b12b70(void) { FUN_008ea350(); return; } //@@ 00b12b78 Unwind@00b12b78 void Unwind_00b12b78(void) { FUN_008ea350(); return; } //@@ 00b12b83 Unwind@00b12b83 void Unwind_00b12b83(void) { FUN_00a58720(); return; } //@@ 00b12bb0 Unwind@00b12bb0 void Unwind_00b12bb0(void) { FUN_00708d40(); return; } //@@ 00b12bb8 Unwind@00b12bb8 void Unwind_00b12bb8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x48) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x48) = *(uint *)(unaff_EBP + -0x48) & 0xfffffffe; FUN_00708d40(); return; } //@@ 00b12bd1 Unwind@00b12bd1 void Unwind_00b12bd1(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x20); return; } //@@ 00b12be0 Unwind@00b12be0 void Unwind_00b12be0(void) { FUN_00a58c40(); return; } //@@ 00b12be8 Unwind@00b12be8 void Unwind_00b12be8(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x20); return; } //@@ 00b12bf7 Unwind@00b12bf7 void Unwind_00b12bf7(void) { FUN_00a58c40(); return; } //@@ 00b12c30 Unwind@00b12c30 void Unwind_00b12c30(void) { FUN_00708d40(); return; } //@@ 00b12c38 Unwind@00b12c38 void Unwind_00b12c38(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_00708d40(); return; } //@@ 00b12c80 Unwind@00b12c80 void Unwind_00b12c80(void) { FUN_00708d40(); return; } //@@ 00b12c88 Unwind@00b12c88 void Unwind_00b12c88(void) { FUN_008ea350(); return; } //@@ 00b12c90 Unwind@00b12c90 void Unwind_00b12c90(void) { FUN_008ea350(); return; } //@@ 00b12cd0 Unwind@00b12cd0 void Unwind_00b12cd0(void) { FUN_00731d50(); return; } //@@ 00b12cd8 Unwind@00b12cd8 void Unwind_00b12cd8(void) { FUN_00731d50(); return; } //@@ 00b12d10 Unwind@00b12d10 void Unwind_00b12d10(void) { FUN_006431b0(); return; } //@@ 00b12d1b Unwind@00b12d1b void Unwind_00b12d1b(void) { FUN_00a1d600(); return; } //@@ 00b12d26 Unwind@00b12d26 void Unwind_00b12d26(void) { FUN_00724ee0(); return; } //@@ 00b12d60 Unwind@00b12d60 void Unwind_00b12d60(void) { FUN_00415ce0(); return; } //@@ 00b12d90 Unwind@00b12d90 void Unwind_00b12d90(void) { FUN_00415ce0(); return; } //@@ 00b12dc0 Unwind@00b12dc0 void Unwind_00b12dc0(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x28); return; } //@@ 00b12dcf Unwind@00b12dcf void Unwind_00b12dcf(void) { FUN_00a156d0(); return; } //@@ 00b12dda Unwind@00b12dda void Unwind_00b12dda(void) { FUN_00a7f230(); return; } //@@ 00b12e10 Unwind@00b12e10 void Unwind_00b12e10(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x10); return; } //@@ 00b12e1f Unwind@00b12e1f void Unwind_00b12e1f(void) { int unaff_EBP; KAGE::Filesys::File::~File(*(void **)(unaff_EBP + -0x10)); return; } //@@ 00b12e50 Unwind@00b12e50 void Unwind_00b12e50(void) { FUN_00a24e90(); return; } //@@ 00b12e80 Unwind@00b12e80 void Unwind_00b12e80(void) { std::vector::_Tidy(); return; } //@@ 00b12ed0 Unwind@00b12ed0 void Unwind_00b12ed0(void) { std::vector::_Tidy(); return; } //@@ 00b12ed8 Unwind@00b12ed8 void Unwind_00b12ed8(void) { FUN_00a28730(); return; } //@@ 00b12ee0 Unwind@00b12ee0 void Unwind_00b12ee0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b12ee8 Unwind@00b12ee8 void Unwind_00b12ee8(void) { FUN_00a28730(); return; } //@@ 00b12f20 Unwind@00b12f20 void Unwind_00b12f20(void) { FUN_00a28730(); return; } //@@ 00b12f28 Unwind@00b12f28 void Unwind_00b12f28(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b12f60 Unwind@00b12f60 void Unwind_00b12f60(void) { FUN_00a28730(); return; } //@@ 00b12f68 Unwind@00b12f68 void Unwind_00b12f68(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x44)); return; } //@@ 00b12fa0 Unwind@00b12fa0 void Unwind_00b12fa0(void) { FUN_00a24e90(); return; } //@@ 00b12faa Unwind@00b12faa void Unwind_00b12faa(void) { FUN_00a70970(); return; } //@@ 00b12fb2 Unwind@00b12fb2 void Unwind_00b12fb2(void) { FUN_00a70970(); return; } //@@ 00b12fe0 Unwind@00b12fe0 void Unwind_00b12fe0(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x18)); return; } //@@ 00b13010 Unwind@00b13010 void Unwind_00b13010(void) { FUN_0040c440(); return; } //@@ 00b13040 Unwind@00b13040 void Unwind_00b13040(void) { FUN_00a24e90(); return; } //@@ 00b13070 Unwind@00b13070 void Unwind_00b13070(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b13078 Unwind@00b13078 void Unwind_00b13078(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -100),0x30); return; } //@@ 00b13087 Unwind@00b13087 void Unwind_00b13087(void) { FUN_007e1430(); return; } //@@ 00b1308f Unwind@00b1308f void Unwind_00b1308f(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -100)); return; } //@@ 00b13097 Unwind@00b13097 void Unwind_00b13097(void) { FUN_007e1430(); return; } //@@ 00b130a2 Unwind@00b130a2 void Unwind_00b130a2(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -100)); return; } //@@ 00b130e0 Unwind@00b130e0 void Unwind_00b130e0(void) { int unaff_EBP; std::string::_Tidy_deallocate(*(char **)(unaff_EBP + -0x2c)); return; } //@@ 00b13110 Unwind@00b13110 void Unwind_00b13110(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x20); return; } //@@ 00b1311f Unwind@00b1311f void Unwind_00b1311f(void) { FUN_00aab930(); return; } //@@ 00b13127 Unwind@00b13127 void Unwind_00b13127(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x14) + 4)); return; } //@@ 00b13132 Unwind@00b13132 void Unwind_00b13132(void) { FUN_0041c710(); return; } //@@ 00b13160 Unwind@00b13160 void Unwind_00b13160(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x24)); return; } //@@ 00b13168 Unwind@00b13168 void Unwind_00b13168(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x24)); return; } //@@ 00b13170 Unwind@00b13170 void Unwind_00b13170(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x24)); return; } //@@ 00b131d0 Unwind@00b131d0 void Unwind_00b131d0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_0040c440(); return; } //@@ 00b131e9 Unwind@00b131e9 void Unwind_00b131e9(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1c),0x18); return; } //@@ 00b131f8 Unwind@00b131f8 void Unwind_00b131f8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffd; FUN_0040c440(); return; } //@@ 00b13240 Unwind@00b13240 void Unwind_00b13240(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x68)); return; } //@@ 00b13248 Unwind@00b13248 void Unwind_00b13248(void) { std::vector::_Tidy(); return; } //@@ 00b13280 Unwind@00b13280 void Unwind_00b13280(void) { FUN_00a68270(); return; } //@@ 00b13288 Unwind@00b13288 void Unwind_00b13288(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x18); return; } //@@ 00b132c0 Unwind@00b132c0 void Unwind_00b132c0(void) { FUN_00a16e60(); return; } //@@ 00b132c8 Unwind@00b132c8 void Unwind_00b132c8(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x38)); return; } //@@ 00b13300 Unwind@00b13300 void Unwind_00b13300(void) { FUN_00a28160(); return; } //@@ 00b13308 Unwind@00b13308 void Unwind_00b13308(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0xc); return; } //@@ 00b13370 Unwind@00b13370 void Unwind_00b13370(void) { FUN_0042a210(); return; } //@@ 00b133c0 Unwind@00b133c0 void Unwind_00b133c0(void) { FUN_00a23ce0(); return; } //@@ 00b133f0 Unwind@00b133f0 void Unwind_00b133f0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b13430 Unwind@00b13430 void Unwind_00b13430(void) { FUN_00a64970(); return; } //@@ 00b13460 Unwind@00b13460 void Unwind_00b13460(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_00a23ce0(); return; } //@@ 00b13479 Unwind@00b13479 void Unwind_00b13479(void) { FUN_00a23ce0(); return; } //@@ 00b13481 Unwind@00b13481 void Unwind_00b13481(void) { FUN_00a23ce0(); return; } //@@ 00b13489 Unwind@00b13489 void Unwind_00b13489(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x1c),0x20); return; } //@@ 00b13498 Unwind@00b13498 void Unwind_00b13498(void) { FUN_00a70380(); return; } //@@ 00b134a0 Unwind@00b134a0 void Unwind_00b134a0(void) { FUN_00a70380(); return; } //@@ 00b134d0 Unwind@00b134d0 void Unwind_00b134d0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffe; FUN_00a23ce0(); return; } //@@ 00b134e9 Unwind@00b134e9 void Unwind_00b134e9(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffd; FUN_00a23ce0(); return; } //@@ 00b13502 Unwind@00b13502 void Unwind_00b13502(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x18) & 4) == 0) { return; } *(uint *)(unaff_EBP + -0x18) = *(uint *)(unaff_EBP + -0x18) & 0xfffffffb; FUN_00a23ce0(); return; } //@@ 00b1351b Unwind@00b1351b void Unwind_00b1351b(void) { FUN_00a23ce0(); return; } //@@ 00b13523 Unwind@00b13523 void Unwind_00b13523(void) { FUN_00a70380(); return; } //@@ 00b1352b Unwind@00b1352b void Unwind_00b1352b(void) { FUN_008ea350(); return; } //@@ 00b13560 Unwind@00b13560 void Unwind_00b13560(void) { FUN_00a64970(); return; } //@@ 00b13568 Unwind@00b13568 void Unwind_00b13568(void) { FUN_00a70950(); return; } //@@ 00b13570 Unwind@00b13570 void Unwind_00b13570(void) { FUN_00415ce0(); return; } //@@ 00b135a0 Unwind@00b135a0 void Unwind_00b135a0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_00a23ce0(); return; } //@@ 00b135b9 Unwind@00b135b9 void Unwind_00b135b9(void) { FUN_00a23ce0(); return; } //@@ 00b135c1 Unwind@00b135c1 void Unwind_00b135c1(void) { FUN_00a23ce0(); return; } //@@ 00b135c9 Unwind@00b135c9 void Unwind_00b135c9(void) { FUN_00a70380(); return; } //@@ 00b135d1 Unwind@00b135d1 void Unwind_00b135d1(void) { FUN_00a70380(); return; } //@@ 00b13600 Unwind@00b13600 void Unwind_00b13600(void) { FUN_00415ce0(); return; } //@@ 00b13608 Unwind@00b13608 void Unwind_00b13608(void) { FUN_00415ce0(); return; } //@@ 00b13640 Unwind@00b13640 void Unwind_00b13640(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x40); return; } //@@ 00b1364f Unwind@00b1364f void Unwind_00b1364f(void) { FUN_00a15730(); return; } //@@ 00b1365a Unwind@00b1365a void Unwind_00b1365a(void) { FUN_00498f80(); return; } //@@ 00b13665 Unwind@00b13665 void Unwind_00b13665(void) { FUN_0042c780(); return; } //@@ 00b13670 Unwind@00b13670 void Unwind_00b13670(void) { int unaff_EBP; KAGE::Memory::HeapBase::~HeapBase(*(void **)(unaff_EBP + -0x10)); return; } //@@ 00b13678 Unwind@00b13678 void Unwind_00b13678(void) { FUN_00a15c00(); return; } //@@ 00b136b0 Unwind@00b136b0 void Unwind_00b136b0(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x18)); return; } //@@ 00b13700 Unwind@00b13700 void Unwind_00b13700(void) { std::vector::_Tidy(); return; } //@@ 00b13708 Unwind@00b13708 void Unwind_00b13708(void) { FUN_00a28730(); return; } //@@ 00b13710 Unwind@00b13710 void Unwind_00b13710(void) { FUN_00a2a8b0(); return; } //@@ 00b13740 Unwind@00b13740 void Unwind_00b13740(void) { FUN_00a64970(); return; } //@@ 00b13770 Unwind@00b13770 void Unwind_00b13770(void) { FUN_00a64970(); return; } //@@ 00b137a0 Unwind@00b137a0 void Unwind_00b137a0(void) { FUN_00694210(); return; } //@@ 00b137d0 Unwind@00b137d0 void Unwind_00b137d0(void) { FUN_00694210(); return; } //@@ 00b137d8 Unwind@00b137d8 void Unwind_00b137d8(void) { FUN_00694210(); return; } //@@ 00b13810 Unwind@00b13810 void Unwind_00b13810(void) { FUN_008ea350(); return; } //@@ 00b13818 Unwind@00b13818 void Unwind_00b13818(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x34)); return; } //@@ 00b13820 Unwind@00b13820 void Unwind_00b13820(void) { FUN_00a2a8b0(); return; } //@@ 00b13828 Unwind@00b13828 void Unwind_00b13828(void) { FUN_00a2a8b0(); return; } //@@ 00b13830 Unwind@00b13830 void Unwind_00b13830(void) { FUN_00a2a8b0(); return; } //@@ 00b13860 Unwind@00b13860 void Unwind_00b13860(void) { FUN_00a2a8b0(); return; } //@@ 00b13868 Unwind@00b13868 void Unwind_00b13868(void) { FUN_00a2a8b0(); return; } //@@ 00b13870 Unwind@00b13870 void Unwind_00b13870(void) { FUN_00a2a8b0(); return; } //@@ 00b138a0 Unwind@00b138a0 void Unwind_00b138a0(void) { FUN_00a2a8b0(); return; } //@@ 00b138a8 Unwind@00b138a8 void Unwind_00b138a8(void) { FUN_00a2a8b0(); return; } //@@ 00b138e0 Unwind@00b138e0 void Unwind_00b138e0(void) { FUN_008ea350(); return; } //@@ 00b138e8 Unwind@00b138e8 void Unwind_00b138e8(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x30)); return; } //@@ 00b138f0 Unwind@00b138f0 void Unwind_00b138f0(void) { FUN_008ea350(); return; } //@@ 00b138f8 Unwind@00b138f8 void Unwind_00b138f8(void) { FUN_008ea350(); return; } //@@ 00b13900 Unwind@00b13900 void Unwind_00b13900(void) { FUN_00a2a8b0(); return; } //@@ 00b13908 Unwind@00b13908 void Unwind_00b13908(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x30)); return; } //@@ 00b13940 Unwind@00b13940 void Unwind_00b13940(void) { FUN_00a2a8b0(); return; } //@@ 00b13970 Unwind@00b13970 void Unwind_00b13970(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b139a0 Unwind@00b139a0 void Unwind_00b139a0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b139a8 Unwind@00b139a8 void Unwind_00b139a8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b139b0 Unwind@00b139b0 void Unwind_00b139b0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b139b8 Unwind@00b139b8 void Unwind_00b139b8(void) { int unaff_EBP; vector_UserProfile_destroy((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b139c0 Unwind@00b139c0 void Unwind_00b139c0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b139c8 Unwind@00b139c8 void Unwind_00b139c8(void) { FUN_00708d40(); return; } //@@ 00b139d0 Unwind@00b139d0 void Unwind_00b139d0(void) { FUN_008ea350(); return; } //@@ 00b139d8 Unwind@00b139d8 void Unwind_00b139d8(void) { FUN_008ea350(); return; } //@@ 00b139e0 Unwind@00b139e0 void Unwind_00b139e0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b139e8 Unwind@00b139e8 void Unwind_00b139e8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b139f0 Unwind@00b139f0 void Unwind_00b139f0(void) { FUN_00a2a8b0(); return; } //@@ 00b139f8 Unwind@00b139f8 void Unwind_00b139f8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b13a30 Unwind@00b13a30 void Unwind_00b13a30(void) { std::vector::_Tidy(); return; } //@@ 00b13a38 Unwind@00b13a38 void Unwind_00b13a38(void) { FUN_00a28730(); return; } //@@ 00b13a40 Unwind@00b13a40 void Unwind_00b13a40(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13a48 Unwind@00b13a48 void Unwind_00b13a48(void) { FUN_00a28730(); return; } //@@ 00b13a50 Unwind@00b13a50 void Unwind_00b13a50(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b13a80 Unwind@00b13a80 void Unwind_00b13a80(void) { FUN_00708d40(); return; } //@@ 00b13a88 Unwind@00b13a88 void Unwind_00b13a88(void) { FUN_00a28730(); return; } //@@ 00b13a90 Unwind@00b13a90 void Unwind_00b13a90(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13a98 Unwind@00b13a98 void Unwind_00b13a98(void) { FUN_008ea350(); return; } //@@ 00b13aa0 Unwind@00b13aa0 void Unwind_00b13aa0(void) { FUN_008ea350(); return; } //@@ 00b13aa8 Unwind@00b13aa8 void Unwind_00b13aa8(void) { FUN_00a28730(); return; } //@@ 00b13ab0 Unwind@00b13ab0 void Unwind_00b13ab0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13ab8 Unwind@00b13ab8 void Unwind_00b13ab8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13ac0 Unwind@00b13ac0 void Unwind_00b13ac0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13ac8 Unwind@00b13ac8 void Unwind_00b13ac8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13ad0 Unwind@00b13ad0 void Unwind_00b13ad0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13ad8 Unwind@00b13ad8 void Unwind_00b13ad8(void) { FUN_00a28730(); return; } //@@ 00b13ae0 Unwind@00b13ae0 void Unwind_00b13ae0(void) { FUN_008ea350(); return; } //@@ 00b13ae8 Unwind@00b13ae8 void Unwind_00b13ae8(void) { FUN_008ea350(); return; } //@@ 00b13af0 Unwind@00b13af0 void Unwind_00b13af0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x3c)); return; } //@@ 00b13b30 Unwind@00b13b30 void Unwind_00b13b30(void) { FUN_00a28730(); return; } //@@ 00b13b38 Unwind@00b13b38 void Unwind_00b13b38(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b13b70 Unwind@00b13b70 void Unwind_00b13b70(void) { FUN_008ea350(); return; } //@@ 00b13b78 Unwind@00b13b78 void Unwind_00b13b78(void) { FUN_008ea350(); return; } //@@ 00b13b80 Unwind@00b13b80 void Unwind_00b13b80(void) { FUN_00a28730(); return; } //@@ 00b13b88 Unwind@00b13b88 void Unwind_00b13b88(void) { FUN_008ea350(); return; } //@@ 00b13b90 Unwind@00b13b90 void Unwind_00b13b90(void) { FUN_008ea350(); return; } //@@ 00b13bc0 Unwind@00b13bc0 void Unwind_00b13bc0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x40)); return; } //@@ 00b13c00 Unwind@00b13c00 void Unwind_00b13c00(void) { FUN_00a74d00(); return; } //@@ 00b13c08 Unwind@00b13c08 void Unwind_00b13c08(void) { FUN_008ea350(); return; } //@@ 00b13c10 Unwind@00b13c10 void Unwind_00b13c10(void) { FUN_008ea350(); return; } //@@ 00b13c40 Unwind@00b13c40 void Unwind_00b13c40(void) { FUN_00a64970(); return; } //@@ 00b13c48 Unwind@00b13c48 void Unwind_00b13c48(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x40); return; } //@@ 00b13c80 Unwind@00b13c80 void Unwind_00b13c80(void) { FUN_00694210(); return; } //@@ 00b13c88 Unwind@00b13c88 void Unwind_00b13c88(void) { FUN_00694210(); return; } //@@ 00b13c90 Unwind@00b13c90 void Unwind_00b13c90(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x18),0x18); return; } //@@ 00b13cd0 Unwind@00b13cd0 void Unwind_00b13cd0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b13d00 Unwind@00b13d00 void Unwind_00b13d00(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b13d08 Unwind@00b13d08 void Unwind_00b13d08(void) { FUN_00a28730(); return; } //@@ 00b13d10 Unwind@00b13d10 void Unwind_00b13d10(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x20)); return; } //@@ 00b13d18 Unwind@00b13d18 void Unwind_00b13d18(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x2c)); return; } //@@ 00b13d50 Unwind@00b13d50 void Unwind_00b13d50(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x18)); return; } //@@ 00b13d58 Unwind@00b13d58 void Unwind_00b13d58(void) { FUN_00a28730(); return; } //@@ 00b13d60 Unwind@00b13d60 void Unwind_00b13d60(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x24)); return; } //@@ 00b13d90 Unwind@00b13d90 void Unwind_00b13d90(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x48)); return; } //@@ 00b13d98 Unwind@00b13d98 void Unwind_00b13d98(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x54)); return; } //@@ 00b13dd0 Unwind@00b13dd0 void Unwind_00b13dd0(void) { FUN_00a23ce0(); return; } //@@ 00b13e10 Unwind@00b13e10 void Unwind_00b13e10(void) { FUN_008ea350(); return; } //@@ 00b13e18 Unwind@00b13e18 void Unwind_00b13e18(void) { FUN_008ea350(); return; } //@@ 00b13e50 Unwind@00b13e50 void Unwind_00b13e50(void) { FUN_008ea350(); return; } //@@ 00b13e58 Unwind@00b13e58 void Unwind_00b13e58(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x18)); return; } //@@ 00b13e90 Unwind@00b13e90 void Unwind_00b13e90(void) { FUN_00a28730(); return; } //@@ 00b13e98 Unwind@00b13e98 void Unwind_00b13e98(void) { FUN_008ea350(); return; } //@@ 00b13ea0 Unwind@00b13ea0 void Unwind_00b13ea0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -100)); return; } //@@ 00b13ea8 Unwind@00b13ea8 void Unwind_00b13ea8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x70)); return; } //@@ 00b13ee0 Unwind@00b13ee0 void Unwind_00b13ee0(void) { FUN_00a28730(); return; } //@@ 00b13ee8 Unwind@00b13ee8 void Unwind_00b13ee8(void) { FUN_008ea350(); return; } //@@ 00b13ef0 Unwind@00b13ef0 void Unwind_00b13ef0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b13ef8 Unwind@00b13ef8 void Unwind_00b13ef8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x5c)); return; } //@@ 00b13f30 Unwind@00b13f30 void Unwind_00b13f30(void) { FUN_00a23ce0(); return; } //@@ 00b13f38 Unwind@00b13f38 void Unwind_00b13f38(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x28)); return; } //@@ 00b13f40 Unwind@00b13f40 void Unwind_00b13f40(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b13f70 Unwind@00b13f70 void Unwind_00b13f70(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x68)); return; } //@@ 00b13f78 Unwind@00b13f78 void Unwind_00b13f78(void) { FUN_00a23ce0(); return; } //@@ 00b13f80 Unwind@00b13f80 void Unwind_00b13f80(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x40) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x40) = *(uint *)(unaff_EBP + -0x40) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b13f99 Unwind@00b13f99 void Unwind_00b13f99(void) { FUN_00a28730(); return; } //@@ 00b13fa1 Unwind@00b13fa1 void Unwind_00b13fa1(void) { FUN_00a28730(); return; } //@@ 00b13fa9 Unwind@00b13fa9 void Unwind_00b13fa9(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x38)); return; } //@@ 00b13fe0 Unwind@00b13fe0 void Unwind_00b13fe0(void) { FUN_00a23ce0(); return; } //@@ 00b13fe8 Unwind@00b13fe8 void Unwind_00b13fe8(void) { FUN_00a28730(); return; } //@@ 00b13ff0 Unwind@00b13ff0 void Unwind_00b13ff0(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x34)); return; } //@@ 00b13ff8 Unwind@00b13ff8 void Unwind_00b13ff8(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x40) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x40) = *(uint *)(unaff_EBP + -0x40) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14011 Unwind@00b14011 void Unwind_00b14011(void) { FUN_00a28730(); return; } //@@ 00b14019 Unwind@00b14019 void Unwind_00b14019(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x34)); return; } //@@ 00b14021 Unwind@00b14021 void Unwind_00b14021(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x1c)); return; } //@@ 00b14060 Unwind@00b14060 void Unwind_00b14060(void) { FUN_00a77d90(); return; } //@@ 00b1406b Unwind@00b1406b void Unwind_00b1406b(void) { FUN_00a15730(); return; } //@@ 00b14076 Unwind@00b14076 void Unwind_00b14076(void) { FUN_00a77db0(); return; } //@@ 00b14081 Unwind@00b14081 void Unwind_00b14081(void) { FUN_00a15730(); return; } //@@ 00b1408c Unwind@00b1408c void Unwind_00b1408c(void) { FUN_00a79460(); return; } //@@ 00b14097 Unwind@00b14097 void Unwind_00b14097(void) { FUN_00a15730(); return; } //@@ 00b140d0 Unwind@00b140d0 void Unwind_00b140d0(void) { FUN_00a77d90(); return; } //@@ 00b140d8 Unwind@00b140d8 void Unwind_00b140d8(void) { FUN_00708d40(); return; } //@@ 00b140e0 Unwind@00b140e0 void Unwind_00b140e0(void) { FUN_00708d40(); return; } //@@ 00b14110 Unwind@00b14110 void Unwind_00b14110(void) { FUN_00a64970(); return; } //@@ 00b14118 Unwind@00b14118 void Unwind_00b14118(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x14),0x20); return; } //@@ 00b14127 Unwind@00b14127 void Unwind_00b14127(void) { FUN_006431b0(); return; } //@@ 00b14132 Unwind@00b14132 void Unwind_00b14132(void) { FUN_00a1d600(); return; } //@@ 00b1413d Unwind@00b1413d void Unwind_00b1413d(void) { FUN_00724ee0(); return; } //@@ 00b14148 Unwind@00b14148 void Unwind_00b14148(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x24) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x24) = *(uint *)(unaff_EBP + -0x24) & 0xfffffffe; FUN_00708d40(); return; } //@@ 00b14190 Unwind@00b14190 void Unwind_00b14190(void) { FUN_00708d40(); return; } //@@ 00b14198 Unwind@00b14198 void Unwind_00b14198(void) { FUN_00a64970(); return; } //@@ 00b141a0 Unwind@00b141a0 void Unwind_00b141a0(void) { FUN_00708d40(); return; } //@@ 00b141a8 Unwind@00b141a8 void Unwind_00b141a8(void) { FUN_00a58c40(); return; } //@@ 00b141e0 Unwind@00b141e0 void Unwind_00b141e0(void) { FUN_00708d40(); return; } //@@ 00b141e8 Unwind@00b141e8 void Unwind_00b141e8(void) { FUN_00a77d90(); return; } //@@ 00b141f0 Unwind@00b141f0 void Unwind_00b141f0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x20) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x20) = *(uint *)(unaff_EBP + -0x20) & 0xfffffffe; FUN_008ea350(); return; } //@@ 00b14230 Unwind@00b14230 void Unwind_00b14230(void) { FUN_00a64970(); return; } //@@ 00b14238 Unwind@00b14238 void Unwind_00b14238(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x1c) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x1c) = *(uint *)(unaff_EBP + -0x1c) & 0xfffffffe; FUN_00708d40(); return; } //@@ 00b14251 Unwind@00b14251 void Unwind_00b14251(void) { FUN_00724ee0(); return; } //@@ 00b14280 Unwind@00b14280 void Unwind_00b14280(void) { FUN_008eee70(); return; } //@@ 00b14288 Unwind@00b14288 void Unwind_00b14288(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + 8),0x20); return; } //@@ 00b14297 Unwind@00b14297 void Unwind_00b14297(void) { FUN_00708d40(); return; } //@@ 00b1429f Unwind@00b1429f void Unwind_00b1429f(void) { FUN_00708d40(); return; } //@@ 00b142a7 Unwind@00b142a7 void Unwind_00b142a7(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_00708d40(); return; } //@@ 00b142c0 Unwind@00b142c0 void Unwind_00b142c0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 2) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffd; FUN_00708d40(); return; } //@@ 00b142d9 Unwind@00b142d9 void Unwind_00b142d9(void) { FUN_0042a210(); return; } //@@ 00b142e1 Unwind@00b142e1 void Unwind_00b142e1(void) { FUN_00708d40(); return; } //@@ 00b14310 Unwind@00b14310 void Unwind_00b14310(void) { FUN_00708d40(); return; } //@@ 00b14318 Unwind@00b14318 void Unwind_00b14318(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x28)); return; } //@@ 00b14320 Unwind@00b14320 void Unwind_00b14320(void) { FUN_00a2a8b0(); return; } //@@ 00b14328 Unwind@00b14328 void Unwind_00b14328(void) { FUN_008eee70(); return; } //@@ 00b14360 Unwind@00b14360 void Unwind_00b14360(void) { FUN_00a64970(); return; } //@@ 00b14390 Unwind@00b14390 void Unwind_00b14390(void) { FUN_00694210(); return; } //@@ 00b143c0 Unwind@00b143c0 void Unwind_00b143c0(void) { FUN_00a79dc0(); return; } //@@ 00b143f0 Unwind@00b143f0 void Unwind_00b143f0(void) { FUN_00415ce0(); return; } //@@ 00b14420 Unwind@00b14420 void Unwind_00b14420(void) { FUN_00694210(); return; } //@@ 00b14450 Unwind@00b14450 void Unwind_00b14450(void) { FUN_00a58200(); return; } //@@ 00b144f0 Unwind@00b144f0 void Unwind_00b144f0(void) { thunk_FUN_00a7aa70(); return; } //@@ 00b144fb Unwind@00b144fb void Unwind_00b144fb(void) { thunk_FUN_00a7aa70(); return; } //@@ 00b14506 Unwind@00b14506 void Unwind_00b14506(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x206b8),8); return; } //@@ 00b14550 Unwind@00b14550 void Unwind_00b14550(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x250),0x300); return; } //@@ 00b145a0 Unwind@00b145a0 void Unwind_00b145a0(void) { longlong lVar1; uint uVar2; int unaff_EBP; lVar1 = (ulonglong)*(uint *)(unaff_EBP + -0x18) * 0x28; uVar2 = -(uint)((int)((ulonglong)lVar1 >> 0x20) != 0) | (uint)lVar1; operator_delete(*(void **)(unaff_EBP + -0x14),-(uint)(0xfffffffb < uVar2) | uVar2 + 4); return; } //@@ 00b145cd Unwind@00b145cd void Unwind_00b145cd(void) { FUN_008ea350(); return; } //@@ 00b14600 Unwind@00b14600 void Unwind_00b14600(void) { FUN_00a23ce0(); return; } //@@ 00b14630 Unwind@00b14630 void Unwind_00b14630(void) { FUN_00a23ce0(); return; } //@@ 00b14660 Unwind@00b14660 void Unwind_00b14660(void) { FUN_00a23ce0(); return; } //@@ 00b14668 Unwind@00b14668 void Unwind_00b14668(void) { FUN_0042a210(); return; } //@@ 00b146a0 Unwind@00b146a0 void Unwind_00b146a0(void) { FUN_00a28730(); return; } //@@ 00b146a8 Unwind@00b146a8 void Unwind_00b146a8(void) { FUN_008ea350(); return; } //@@ 00b146b0 Unwind@00b146b0 void Unwind_00b146b0(void) { int unaff_EBP; FriendEntry::~FriendEntry((void *)(unaff_EBP + -0x60)); return; } //@@ 00b146b8 Unwind@00b146b8 void Unwind_00b146b8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x4c)); return; } //@@ 00b146c0 Unwind@00b146c0 void Unwind_00b146c0(void) { FUN_008ea350(); return; } //@@ 00b146c8 Unwind@00b146c8 void Unwind_00b146c8(void) { FUN_00a28730(); return; } //@@ 00b14720 Unwind@00b14720 void Unwind_00b14720(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x20),0x18); return; } //@@ 00b1472f Unwind@00b1472f void Unwind_00b1472f(void) { FUN_00a23ce0(); return; } //@@ 00b14737 Unwind@00b14737 void Unwind_00b14737(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x14) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) & 0xfffffffe; FUN_00a23ce0(); return; } //@@ 00b14780 Unwind@00b14780 void Unwind_00b14780(void) { KAGE::Network::Multiplayer::LobbyEOS::~LobbyEOS(); return; } //@@ 00b147b0 Unwind@00b147b0 void Unwind_00b147b0(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0x10) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0x10) = *(uint *)(unaff_EBP + -0x10) & 0xfffffffe; FUN_00a28730(); return; } //@@ 00b147f0 Unwind@00b147f0 void Unwind_00b147f0(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0xb0) + 4)); return; } //@@ 00b147fe Unwind@00b147fe void Unwind_00b147fe(void) { int unaff_EBP; FID_conflict__Tidy((void *)(*(int *)(unaff_EBP + -0xb0) + 0x10)); return; } //@@ 00b1480c Unwind@00b1480c void Unwind_00b1480c(void) { FUN_00498f80(); return; } //@@ 00b1481a Unwind@00b1481a void Unwind_00b1481a(void) { int unaff_EBP; if ((*(uint *)(unaff_EBP + -0xa8) & 1) == 0) { return; } *(uint *)(unaff_EBP + -0xa8) = *(uint *)(unaff_EBP + -0xa8) & 0xfffffffe; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b1483c Unwind@00b1483c void Unwind_00b1483c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b14844 Unwind@00b14844 void Unwind_00b14844(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b1484c Unwind@00b1484c void Unwind_00b1484c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b14854 Unwind@00b14854 void Unwind_00b14854(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b1485f Unwind@00b1485f void Unwind_00b1485f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b14867 Unwind@00b14867 void Unwind_00b14867(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b1486f Unwind@00b1486f void Unwind_00b1486f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b14877 Unwind@00b14877 void Unwind_00b14877(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b1487f Unwind@00b1487f void Unwind_00b1487f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b14887 Unwind@00b14887 void Unwind_00b14887(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b1488f Unwind@00b1488f void Unwind_00b1488f(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b14897 Unwind@00b14897 void Unwind_00b14897(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b148d0 Unwind@00b148d0 void Unwind_00b148d0(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0xec)); return; } //@@ 00b148db Unwind@00b148db void Unwind_00b148db(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b148e6 Unwind@00b148e6 void Unwind_00b148e6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b148f1 Unwind@00b148f1 void Unwind_00b148f1(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b148f9 Unwind@00b148f9 void Unwind_00b148f9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b14904 Unwind@00b14904 void Unwind_00b14904(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b1490c Unwind@00b1490c void Unwind_00b1490c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b14914 Unwind@00b14914 void Unwind_00b14914(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b1491c Unwind@00b1491c void Unwind_00b1491c(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xa4)); return; } //@@ 00b14927 Unwind@00b14927 void Unwind_00b14927(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b14960 Unwind@00b14960 void Unwind_00b14960(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b14968 Unwind@00b14968 void Unwind_00b14968(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b14970 Unwind@00b14970 void Unwind_00b14970(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x6c)); return; } //@@ 00b14978 Unwind@00b14978 void Unwind_00b14978(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b14980 Unwind@00b14980 void Unwind_00b14980(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b149c0 Unwind@00b149c0 void Unwind_00b149c0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x428)); return; } //@@ 00b14a00 Unwind@00b14a00 void Unwind_00b14a00(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x34)); return; } //@@ 00b14a08 Unwind@00b14a08 void Unwind_00b14a08(void) { int unaff_EBP; FID_conflict__Tidy((void *)(unaff_EBP + -0x40)); return; } //@@ 00b14a10 Unwind@00b14a10 void Unwind_00b14a10(void) { FUN_004999b0(); return; } //@@ 00b14a40 Unwind@00b14a40 void Unwind_00b14a40(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x50); return; } //@@ 00b14a4f Unwind@00b14a4f void Unwind_00b14a4f(void) { FUN_00aab970(); return; } //@@ 00b14a57 Unwind@00b14a57 void Unwind_00b14a57(void) { FUN_00aab9b0(); return; } //@@ 00b14a62 Unwind@00b14a62 void Unwind_00b14a62(void) { std::deque<4byte>::~deque(); return; } //@@ 00b14a90 Unwind@00b14a90 void Unwind_00b14a90(void) { FUN_0040c440(); return; } //@@ 00b14ac0 Unwind@00b14ac0 void Unwind_00b14ac0(void) { FUN_008ea350(); return; } //@@ 00b14ac8 Unwind@00b14ac8 void Unwind_00b14ac8(void) { FUN_008ea350(); return; } //@@ 00b14b00 Unwind@00b14b00 void Unwind_00b14b00(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x10),0x528); return; } //@@ 00b14b60 Unwind@00b14b60 void Unwind_00b14b60(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x40),0x10); return; } //@@ 00b14b6f Unwind@00b14b6f void Unwind_00b14b6f(void) { FUN_00498f80(); return; } //@@ 00b14b77 Unwind@00b14b77 void Unwind_00b14b77(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14bb0 Unwind@00b14bb0 void Unwind_00b14bb0(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x50)); return; } //@@ 00b14bf0 Unwind@00b14bf0 void Unwind_00b14bf0(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x14)); return; } //@@ 00b14c20 Unwind@00b14c20 void Unwind_00b14c20(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x50)); return; } //@@ 00b14c28 Unwind@00b14c28 void Unwind_00b14c28(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14c60 Unwind@00b14c60 void Unwind_00b14c60(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14c68 Unwind@00b14c68 void Unwind_00b14c68(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14c70 Unwind@00b14c70 void Unwind_00b14c70(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14c78 Unwind@00b14c78 void Unwind_00b14c78(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14c80 Unwind@00b14c80 void Unwind_00b14c80(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x28)); return; } //@@ 00b14cc0 Unwind@00b14cc0 void Unwind_00b14cc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x58) + 4)); return; } //@@ 00b14ccb Unwind@00b14ccb void Unwind_00b14ccb(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x54)); return; } //@@ 00b14cd3 Unwind@00b14cd3 void Unwind_00b14cd3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b14d30 Unwind@00b14d30 void Unwind_00b14d30(void) { FUN_00a69a20(); return; } //@@ 00b14d60 Unwind@00b14d60 void Unwind_00b14d60(void) { FUN_00a2a8b0(); return; } //@@ 00b14d90 Unwind@00b14d90 void Unwind_00b14d90(void) { FUN_008ea350(); return; } //@@ 00b14d98 Unwind@00b14d98 void Unwind_00b14d98(void) { FUN_008ea350(); return; } //@@ 00b14da0 Unwind@00b14da0 void Unwind_00b14da0(void) { FUN_00a28730(); return; } //@@ 00b14da8 Unwind@00b14da8 void Unwind_00b14da8(void) { int unaff_EBP; KAGE::Network::Multiplayer::ConstLobby::~ConstLobby((void *)(unaff_EBP + -0x40)); return; } //@@ 00b14db0 Unwind@00b14db0 void Unwind_00b14db0(void) { std::vector::_Tidy(); return; } //@@ 00b14db8 Unwind@00b14db8 void Unwind_00b14db8(void) { FUN_008ea350(); return; } //@@ 00b14dc0 Unwind@00b14dc0 void Unwind_00b14dc0(void) { FUN_008ea350(); return; } //@@ 00b14e00 Unwind@00b14e00 void Unwind_00b14e00(void) { FUN_00a9ebc0(); return; } //@@ 00b14e30 Unwind@00b14e30 void Unwind_00b14e30(void) { FUN_00a58200(); return; } //@@ 00b14e60 Unwind@00b14e60 void Unwind_00b14e60(void) { FUN_00aa0630(); return; } //@@ 00b14e90 Unwind@00b14e90 void Unwind_00b14e90(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x140)); return; } //@@ 00b14e9b Unwind@00b14e9b void Unwind_00b14e9b(void) { int unaff_EBP; operator_delete(*(void **)(unaff_EBP + -0x138),0x20); return; } //@@ 00b14ead Unwind@00b14ead void Unwind_00b14ead(void) { FUN_004999b0(); return; } //@@ 00b14eb8 Unwind@00b14eb8 void Unwind_00b14eb8(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xf8)); return; } //@@ 00b14ec3 Unwind@00b14ec3 void Unwind_00b14ec3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xe0)); return; } //@@ 00b14ece Unwind@00b14ece void Unwind_00b14ece(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -200)); return; } //@@ 00b14ed9 Unwind@00b14ed9 void Unwind_00b14ed9(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x128)); return; } //@@ 00b14ee4 Unwind@00b14ee4 void Unwind_00b14ee4(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x110)); return; } //@@ 00b14eef Unwind@00b14eef void Unwind_00b14eef(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xb0)); return; } //@@ 00b14f30 Unwind@00b14f30 void Unwind_00b14f30(void) { FUN_004999b0(); return; } //@@ 00b14f60 Unwind@00b14f60 void Unwind_00b14f60(void) { int unaff_EBP; Mutex::ScopeLock::~ScopeLock((void *)(unaff_EBP + -0x14)); return; } //@@ 00b14fc0 Unwind@00b14fc0 void Unwind_00b14fc0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x428)); return; } //@@ 00b15030 Unwind@00b15030 void Unwind_00b15030(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x444)); return; } //@@ 00b1503b Unwind@00b1503b void Unwind_00b1503b(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x42c)); return; } //@@ 00b15080 Unwind@00b15080 void Unwind_00b15080(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(*(int *)(unaff_EBP + -0x10) + 4)); return; } //@@ 00b150b0 Unwind@00b150b0 void Unwind_00b150b0(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0xbc)); return; } //@@ 00b150bb Unwind@00b150bb void Unwind_00b150bb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x5c)); return; } //@@ 00b150c3 Unwind@00b150c3 void Unwind_00b150c3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x44)); return; } //@@ 00b150cb Unwind@00b150cb void Unwind_00b150cb(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b150d3 Unwind@00b150d3 void Unwind_00b150d3(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x8c)); return; } //@@ 00b150de Unwind@00b150de void Unwind_00b150de(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x2c)); return; } //@@ 00b150e6 Unwind@00b150e6 void Unwind_00b150e6(void) { int unaff_EBP; std::string::_Tidy_deallocate((char *)(unaff_EBP + -0x74)); return; } //@@ 00b15170 FUN_00b15170 void FUN_00b15170(void) { FUN_0040c230(); return; } //@@ 00b15180 FUN_00b15180 void FUN_00b15180(void) { return; } //@@ 00b15190 FUN_00b15190 void FUN_00b15190(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c7f6cc != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c7f6cc + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c7f6c8); } } std::string::_Tidy_deallocate(&DAT_00c7f638); ExceptionList = local_10; return; } //@@ 00b15200 FUN_00b15200 void FUN_00b15200(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; AnmCache::~AnmCache(__security_cookie ^ (int)register0x00000010 - 4U); std::map::_Erase_tree (&g_textureCacheMap,*(undefined4 *)((int)g_textureCacheMap + 4)); operator_delete(g_textureCacheMap,0x1c); FUN_00415ae0(&g_anmCacheMap,*(undefined4 *)((int)g_anmCacheMap + 4)); operator_delete(g_anmCacheMap,0x54); ExceptionList = local_10; return; } //@@ 00b152a0 FUN_00b152a0 void FUN_00b152a0(void) { ANM2 *ptr; uint size; if (g_staticSprites != (ANM2 **)0x0) { size = DAT_00c78dac - (int)g_staticSprites & 0xfffffffc; ptr = (ANM2 *)g_staticSprites; if (0xfff < size) { ptr = g_staticSprites[-1]; size = size + 0x23; if (0x1f < (uint)((int)g_staticSprites + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b152f7. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); g_staticSprites = (ANM2 **)0x0; DAT_00c78da8 = 0; DAT_00c78dac = 0; } return; } //@@ 00b15330 FUN_00b15330 void FUN_00b15330(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; ANM2::Reset((ANM2 *)&DAT_00c78dc8); AnimationState::~AnimationState((AnimationState *)&DAT_00c78e18); AnimationState::~AnimationState((AnimationState *)&DAT_00c78df8); std::string::_Tidy_deallocate(&DAT_00c78de0); std::string::_Tidy_deallocate(&DAT_00c78dc8); ExceptionList = local_10; return; } //@@ 00b153a0 FUN_00b153a0 void FUN_00b153a0(void) { FUN_004235c0(&DAT_00c7f6f4,*(undefined4 *)((int)DAT_00c7f6f4 + 4)); operator_delete(DAT_00c7f6f4,0x2c); return; } //@@ 00b153d0 FUN_00b153d0 void FUN_00b153d0(void) { _eh_vector_destructor_iterator_(&DAT_00c78f08,0x18,0x15,std::string::_Tidy_deallocate); return; } //@@ 00b153f0 FUN_00b153f0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00b153f0(void) { void *ptr; uint size; if (0xf < DAT_00c7f714) { size = DAT_00c7f714 + 1; ptr = DAT_00c7f700; if (0xfff < size) { ptr = *(void **)((int)DAT_00c7f700 + -4); size = DAT_00c7f714 + 0x24; if (0x1f < (uint)((int)DAT_00c7f700 + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b1541c. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); } _DAT_00c7f710 = 0; DAT_00c7f714 = 0xf; DAT_00c7f700 = (void *)((uint)DAT_00c7f700 & 0xffffff00); return; } //@@ 00b15450 FUN_00b15450 void FUN_00b15450(void) { FID_conflict__Tidy(&DAT_00c7f73c); return; } //@@ 00b15460 FUN_00b15460 void FUN_00b15460(void) { FID_conflict__Tidy(&DAT_00c7f74c); return; } //@@ 00b15570 FUN_00b15570 void FUN_00b15570(void) { std::vector::_Tidy(); return; } //@@ 00b15580 FUN_00b15580 void FUN_00b15580(void) { std::vector::_Tidy(); return; } //@@ 00b155b0 FUN_00b155b0 void FUN_00b155b0(void) { _eh_vector_destructor_iterator_(&g_shaders,0x50,0x14,FUN_00a24660); return; } //@@ 00b155d0 FUN_00b155d0 void FUN_00b155d0(void) { std::deque<4byte>::~deque(); return; } //@@ 00b155e0 FUN_00b155e0 void FUN_00b155e0(void) { std::deque<4byte>::~deque(); return; } //@@ 00b15610 FUN_00b15610 void FUN_00b15610(void) { _eh_vector_destructor_iterator_(&DAT_00c80900,0x18,0x10,std::string::_Tidy_deallocate); return; } //@@ 00b15630 FUN_00b15630 void FUN_00b15630(void) { _eh_vector_destructor_iterator_(&DAT_00c80328,0x18,0x3e,std::string::_Tidy_deallocate); return; } //@@ 00b15650 FUN_00b15650 void FUN_00b15650(void) { _eh_vector_destructor_iterator_(&DAT_00c80260,0x18,8,std::string::_Tidy_deallocate); return; } //@@ 00b15670 FUN_00b15670 void FUN_00b15670(void) { _eh_vector_destructor_iterator_(&DAT_00c5cd70,0x18,0x1a,std::string::_Tidy_deallocate); return; } //@@ 00b15690 FUN_00b15690 void FUN_00b15690(void) { _eh_vector_destructor_iterator_(&DAT_00c5cab8,0x18,0x1d,std::string::_Tidy_deallocate); return; } //@@ 00b156b0 FUN_00b156b0 void FUN_00b156b0(void) { FUN_004235c0(&DAT_00c80a84,*(undefined4 *)((int)DAT_00c80a84 + 4)); operator_delete(DAT_00c80a84,0x2c); return; } //@@ 00b156e0 FUN_00b156e0 void FUN_00b156e0(void) { FUN_004235c0(&DAT_00c80a90,*(undefined4 *)((int)DAT_00c80a90 + 4)); operator_delete(DAT_00c80a90,0x2c); return; } //@@ 00b15720 FUN_00b15720 void FUN_00b15720(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c7975c != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c7975c + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79758); } } ExceptionList = local_10; return; } //@@ 00b15790 FUN_00b15790 void FUN_00b15790(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79778 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79778 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79774); } } ExceptionList = local_10; return; } //@@ 00b15800 FUN_00b15800 void FUN_00b15800(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79798 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79798 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79794); } } ExceptionList = local_10; return; } //@@ 00b15870 FUN_00b15870 void FUN_00b15870(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797a0 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797a0 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c7979c); } } ExceptionList = local_10; return; } //@@ 00b158e0 FUN_00b158e0 void FUN_00b158e0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797a8 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797a8 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797a4); } } ExceptionList = local_10; return; } //@@ 00b15950 FUN_00b15950 void FUN_00b15950(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797b0 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797b0 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797ac); } } ExceptionList = local_10; return; } //@@ 00b159d0 FUN_00b159d0 void FUN_00b159d0(void) { FUN_00731e90(&DAT_00c80fcc,*(undefined4 *)((int)DAT_00c80fcc + 4)); operator_delete(DAT_00c80fcc,0x30); return; } //@@ 00b15a00 FUN_00b15a00 void FUN_00b15a00(void) { FUN_004235c0(&DAT_00c80fd8,*(undefined4 *)((int)DAT_00c80fd8 + 4)); operator_delete(DAT_00c80fd8,0x2c); return; } //@@ 00b15a30 FUN_00b15a30 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00b15a30(void) { void *ptr; uint size; if (0xf < DAT_00c35b54) { size = DAT_00c35b54 + 1; ptr = DAT_00c35b40; if (0xfff < size) { ptr = *(void **)((int)DAT_00c35b40 + -4); size = DAT_00c35b54 + 0x24; if (0x1f < (uint)((int)DAT_00c35b40 + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b15a5c. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); } _DAT_00c35b50 = 0; DAT_00c35b54 = 0xf; DAT_00c35b40 = (void *)((uint)DAT_00c35b40 & 0xffffff00); return; } //@@ 00b15b30 FUN_00b15b30 void FUN_00b15b30(void) { std::vector::_Tidy(); FID_conflict__Erase_tree_>_> (&g_roomDescriptorDummy.RestrictedGridIndexes, (fuzzer_allocator_> *) &g_roomDescriptorDummy.RestrictedGridIndexes, *(_Tree_node **) ((int)g_roomDescriptorDummy.RestrictedGridIndexes._head + 4)); operator_delete(g_roomDescriptorDummy.RestrictedGridIndexes._head,0x14); std::vector::_Tidy(); FUN_00708f90(); return; } //@@ 00b15b80 FUN_00b15b80 void FUN_00b15b80(void) { return; } //@@ 00b15ba0 FUN_00b15ba0 void FUN_00b15ba0(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c812b4 != (undefined4 *)0x0) { (**(code **)*DAT_00c812b4)(1,__security_cookie ^ (int)register0x00000010 - 4U); } PersistentGameData_Bestiary::~PersistentGameData_Bestiary ((PersistentGameData_Bestiary *)&DAT_00c82214); std::string::_Tidy_deallocate(&DAT_00c812d0); std::string::_Tidy_deallocate(&DAT_00c812b8); ExceptionList = local_10; return; } //@@ 00b15c10 FUN_00b15c10 void FUN_00b15c10(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797b8 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797b8 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797b4); } } ExceptionList = local_10; return; } //@@ 00b15c80 FUN_00b15c80 void FUN_00b15c80(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797c0 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797c0 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797bc); } } ExceptionList = local_10; return; } //@@ 00b15cf0 FUN_00b15cf0 void FUN_00b15cf0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797c8 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797c8 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c797c4); } } ExceptionList = local_10; return; } //@@ 00b15d60 FUN_00b15d60 void FUN_00b15d60(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797d0 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797d0 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797cc); } } ExceptionList = local_10; return; } //@@ 00b15dd0 FUN_00b15dd0 void FUN_00b15dd0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797d8 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797d8 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797d4); } } ExceptionList = local_10; return; } //@@ 00b15e40 FUN_00b15e40 void FUN_00b15e40(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797e0 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797e0 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797dc); } } ExceptionList = local_10; return; } //@@ 00b15eb0 FUN_00b15eb0 void FUN_00b15eb0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797e8 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797e8 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797e4); } } ExceptionList = local_10; return; } //@@ 00b15f20 FUN_00b15f20 void FUN_00b15f20(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797f0 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797f0 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797ec); } } ExceptionList = local_10; return; } //@@ 00b15f90 FUN_00b15f90 void FUN_00b15f90(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c797f8 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c797f8 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797f4); } } ExceptionList = local_10; return; } //@@ 00b16000 FUN_00b16000 void FUN_00b16000(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79800 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79800 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c797fc); } } ExceptionList = local_10; return; } //@@ 00b16070 FUN_00b16070 void FUN_00b16070(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79808 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79808 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c79804); } } ExceptionList = local_10; return; } //@@ 00b160e0 FUN_00b160e0 void FUN_00b160e0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79810 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79810 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c7980c); } } ExceptionList = local_10; return; } //@@ 00b16150 FUN_00b16150 void FUN_00b16150(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79818 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79818 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c79814); } } ExceptionList = local_10; return; } //@@ 00b161c0 FUN_00b161c0 void FUN_00b161c0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79820 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79820 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c7981c); } } ExceptionList = local_10; return; } //@@ 00b16230 FUN_00b16230 void FUN_00b16230(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79828 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79828 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79824); } } ExceptionList = local_10; return; } //@@ 00b162a0 FUN_00b162a0 void FUN_00b162a0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79830 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79830 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c7982c); } } ExceptionList = local_10; return; } //@@ 00b16310 FUN_00b16310 void FUN_00b16310(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79838 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79838 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79834); } } ExceptionList = local_10; return; } //@@ 00b16380 FUN_00b16380 void FUN_00b16380(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79840 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79840 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c7983c); } } ExceptionList = local_10; return; } //@@ 00b163f0 FUN_00b163f0 void FUN_00b163f0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79848 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79848 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c79844); } } ExceptionList = local_10; return; } //@@ 00b16460 FUN_00b16460 void FUN_00b16460(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79850 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79850 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c7984c); } } ExceptionList = local_10; return; } //@@ 00b164d0 FUN_00b164d0 void FUN_00b164d0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79858 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79858 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79854); } } ExceptionList = local_10; return; } //@@ 00b16540 FUN_00b16540 void FUN_00b16540(void) { FID_conflict__Tidy(&DAT_00c82664); return; } //@@ 00b16550 FUN_00b16550 void FUN_00b16550(void) { FID_conflict__Tidy(&DAT_00c82674); return; } //@@ 00b16560 FUN_00b16560 void FUN_00b16560(void) { FUN_008975d0(); operator_delete(DAT_00c7985c,0x58); return; } //@@ 00b16580 FUN_00b16580 void FUN_00b16580(void) { void *ptr; uint size; if (0xf < DAT_00c35e14) { size = DAT_00c35e14 + 1; ptr = DAT_00c35e00; if (0xfff < size) { ptr = *(void **)((int)DAT_00c35e00 + -4); size = DAT_00c35e14 + 0x24; if (0x1f < (uint)((int)DAT_00c35e00 + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b165d1. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); } DAT_00c35e10 = 0; DAT_00c35e14 = 0xf; DAT_00c35e00 = (void *)((uint)DAT_00c35e00 & 0xffffff00); return; } //@@ 00b165e0 FUN_00b165e0 void FUN_00b165e0(void) { KAGE::Thread::~Thread(&PTR_vftable_00c35e58); return; } //@@ 00b165f0 FUN_00b165f0 void FUN_00b165f0(void) { undefined4 *puVar1; undefined4 *puVar2; puVar2 = DAT_00c79864; *(undefined4 *)DAT_00c79864[1] = 0; puVar2 = (undefined4 *)*puVar2; while (puVar2 != (undefined4 *)0x0) { puVar1 = (undefined4 *)*puVar2; operator_delete(puVar2,0x114); puVar2 = puVar1; } operator_delete(DAT_00c79864,0x114); return; } //@@ 00b16640 FUN_00b16640 void FUN_00b16640(void) { undefined4 *puVar1; undefined4 *puVar2; puVar2 = DAT_00c7986c; *(undefined4 *)DAT_00c7986c[1] = 0; puVar2 = (undefined4 *)*puVar2; while (puVar2 != (undefined4 *)0x0) { puVar1 = (undefined4 *)*puVar2; operator_delete(puVar2,0x2c); puVar2 = puVar1; } operator_delete(DAT_00c7986c,0x2c); return; } //@@ 00b16680 FUN_00b16680 void FUN_00b16680(void) { DAT_00c79874 = 0; DAT_00c79878 = 0; return; } //@@ 00b166a0 FUN_00b166a0 void FUN_00b166a0(void) { FID_conflict__Erase_tree_>_> (&g_onlineVoteMap, (fuzzer_allocator_> *)&g_onlineVoteMap, *(_Tree_node **)((int)g_onlineVoteMap + 4)); operator_delete(g_onlineVoteMap,0x20); return; } //@@ 00b166e0 FUN_00b166e0 void FUN_00b166e0(void) { KAGE::Thread::~Thread(&PTR_vftable_00c35e64); return; } //@@ 00b166f0 FUN_00b166f0 void FUN_00b166f0(void) { int *ptr; uint size; if (g_modCharacters != (int *)0x0) { size = DAT_00c7988c - (int)g_modCharacters & 0xfffffff8; ptr = g_modCharacters; if (0xfff < size) { ptr = (int *)g_modCharacters[-1]; size = size + 0x23; if (0x1f < (uint)((int)g_modCharacters + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b16747. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); g_modCharacters = (int *)0x0; DAT_00c79888 = 0; DAT_00c7988c = 0; } return; } //@@ 00b167b0 FUN_00b167b0 void FUN_00b167b0(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c79894 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c79894 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79890); } } ExceptionList = local_10; return; } //@@ 00b16820 FUN_00b16820 void FUN_00b16820(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c7989c != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c7989c + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c79898); } } ExceptionList = local_10; return; } //@@ 00b16890 FUN_00b16890 void FUN_00b16890(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c798a4 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c798a4 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c798a0); } } ExceptionList = local_10; return; } //@@ 00b16900 FUN_00b16900 void FUN_00b16900(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c798ac != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c798ac + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c798a8); } } ExceptionList = local_10; return; } //@@ 00b16980 FUN_00b16980 void FUN_00b16980(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c798b4 != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c798b4 + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) { (*g_renderTargetReleaseFn)(&DAT_00c798b0); } } ExceptionList = local_10; return; } //@@ 00b169f0 FUN_00b169f0 void FUN_00b169f0(void) { return; } //@@ 00b16a00 FUN_00b16a00 void FUN_00b16a00(void) { FUN_004235c0(&DAT_00c94320,*(undefined4 *)((int)DAT_00c94320 + 4)); operator_delete(DAT_00c94320,0x2c); return; } //@@ 00b16a30 FUN_00b16a30 void FUN_00b16a30(void) { FID_conflict__Tidy(&g_mountPrefixes); return; } //@@ 00b16a50 FUN_00b16a50 void FUN_00b16a50(void) { void *ptr; uint size; if (g_seedComboBans != (void *)0x0) { FUN_009ebbf0(g_seedComboBans); size = DAT_00c798cc - (int)g_seedComboBans & 0xfffffff8; ptr = g_seedComboBans; if (0xfff < size) { ptr = *(void **)((int)g_seedComboBans + -4); size = size + 0x23; if (0x1f < (uint)((int)g_seedComboBans + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b16abc. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); g_seedComboBans = (void *)0x0; DAT_00c798c8 = 0; DAT_00c798cc = 0; } return; } //@@ 00b16ad0 FUN_00b16ad0 void FUN_00b16ad0(void) { FID_conflict__Erase_tree_>_> (&DAT_00c798d0,(fuzzer_allocator_> *)&DAT_00c798d0, *(_Tree_node **)((int)DAT_00c798d0 + 4)); operator_delete(DAT_00c798d0,0x14); return; } //@@ 00b16b10 FUN_00b16b10 void FUN_00b16b10(void) { FID_conflict__Tidy(&DAT_00c943c8); return; } //@@ 00b16b20 FUN_00b16b20 void FUN_00b16b20(void) { LPCRITICAL_SECTION ptr; ptr = DAT_00c37960; PTR_vftable_00c37958 = (undefined *)KAGE::Mutex::vftable; if (DAT_00c37960 != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(DAT_00c37960); operator_delete(ptr,0x1c); DAT_00c37960 = (LPCRITICAL_SECTION)0x0; } DAT_00c3795c = DAT_00c3795c & 0xfe; PTR_vftable_00c37958 = (undefined *)KAGE::MutexBase::vftable; return; } //@@ 00b16b80 FUN_00b16b80 void FUN_00b16b80(void) { FUN_00a18e10(); return; } //@@ 00b16ba0 FUN_00b16ba0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00b16ba0(void) { PTR_vftable_00c379e0 = (undefined *)KAGE::Filesys::ContentManagerBase::vftable; FID_conflict__Tidy(&DAT_00c37a00); FID_conflict__Tidy(&DAT_00c379f4); FID_conflict__Tidy(&DAT_00c379e8); _DAT_00c379e4 = _DAT_00c379e4 & 0xfffffffe; PTR_vftable_00c379e0 = (undefined *)KAGE::ManagerBase::vftable; return; } //@@ 00b16be0 FUN_00b16be0 void FUN_00b16be0(void) { PTR_vftable_00c37a10 = (undefined *)KAGE::Filesys::Manager::vftable; FUN_00a177f0(); return; } //@@ 00b16c00 FUN_00b16c00 void FUN_00b16c00(void) { return; } //@@ 00b16c10 FUN_00b16c10 void FUN_00b16c10(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; PTR_vftable_00c57b18 = (undefined *)KAGE::Input::Manager::vftable; FUN_00a21b70(__security_cookie ^ (int)register0x00000010 - 4U); KAGE::Thread::~Thread(&DAT_00c57b64); FUN_00a1f980(); ExceptionList = local_10; return; } //@@ 00b16ce0 FUN_00b16ce0 void FUN_00b16ce0(void) { FUN_00a23ee0(&DAT_00c798d8,*(undefined4 *)((int)DAT_00c798d8 + 4)); operator_delete(DAT_00c798d8,0x40); return; } //@@ 00b16d10 FUN_00b16d10 void FUN_00b16d10(void) { void *ptr; ptr = g_userProfileLock; PTR_vftable_00c5aa70 = (undefined *)KAGE::Mutex::vftable; if (g_userProfileLock != (void *)0x0) { DeleteCriticalSection(g_userProfileLock); operator_delete(ptr,0x1c); g_userProfileLock = (void *)0x0; } DAT_00c5aa74 = DAT_00c5aa74 & 0xfe; PTR_vftable_00c5aa70 = (undefined *)KAGE::MutexBase::vftable; return; } //@@ 00b16d60 FUN_00b16d60 void FUN_00b16d60(void) { char cVar1; void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (DAT_00c799dc != (int *)0x0) { cVar1 = (**(code **)(*DAT_00c799dc + 0xc))(__security_cookie ^ (int)register0x00000010 - 4U); if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&DAT_00c799d8); } } ExceptionList = local_10; return; } //@@ 00b16dd0 FUN_00b16dd0 void FUN_00b16dd0(void) { FUN_004b3950(); FUN_004b3950(); return; } //@@ 00b16e30 FUN_00b16e30 void FUN_00b16e30(void) { FUN_00a540b0(); return; } //@@ 00b16e80 FUN_00b16e80 void FUN_00b16e80(void) { FUN_00a536c0(&DAT_00c79a44,*(undefined4 *)((int)DAT_00c79a44 + 4)); operator_delete(DAT_00c79a44,0x20); return; } //@@ 00b16ec0 FUN_00b16ec0 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00b16ec0(void) { void *local_10; undefined1 *puStack_c; undefined4 local_8; puStack_c = &LAB_00af0c50; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (g_logFile != (void *)0x0) { (**(code **)(*(int *)g_logFile + 0x20))(__security_cookie ^ (int)register0x00000010 - 4U); if (g_logFile != (void *)0x0) { (*(code *)**(undefined4 **)g_logFile)(1); g_logFile = (void *)0x0; } } _DAT_00c79bdc = 0; ExceptionList = local_10; return; } //@@ 00b17000 FUN_00b17000 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00b17000(void) { _DAT_00c5ab08 = _DAT_00c5ab08 & 0xfffffffe; PTR_vftable_00c5ab04 = (undefined *)KAGE::ManagerBase::vftable; return; } //@@ 00b17020 FUN_00b17020 void FUN_00b17020(void) { FUN_007e2630(); return; } //@@ 00b17030 FUN_00b17030 void FUN_00b17030(void) { uint size; void **ptr; if (g_gamepadDevices != (void **)0x0) { size = DAT_00c79bf4 - (int)g_gamepadDevices & 0xfffffffc; ptr = g_gamepadDevices; if (0xfff < size) { ptr = g_gamepadDevices[-1]; size = size + 0x23; if (0x1f < (uint)((int)g_gamepadDevices + (-4 - (int)ptr))) { /* WARNING: Could not recover jumptable at 0x00b1705f. Too many branches */ /* WARNING: Subroutine does not return */ /* WARNING: Treating indirect jump as call */ _invalid_parameter_noinfo_noreturn(); return; } } operator_delete(ptr,size); g_gamepadDevices = (void **)0x0; DAT_00c79bf0 = 0; DAT_00c79bf4 = 0; } return; } //@@ 00b17090 FUN_00b17090 void FUN_00b17090(void) { FUN_00a721b0(&DAT_00c79bf8,*(undefined4 *)((int)DAT_00c79bf8 + 4)); operator_delete(DAT_00c79bf8,0x20); return; } //@@ 00b170c0 FUN_00b170c0 void FUN_00b170c0(void) { LPCRITICAL_SECTION ptr; ptr = DAT_00c5ab4c; PTR_vftable_00c5ab44 = (undefined *)KAGE::Mutex::vftable; if (DAT_00c5ab4c != (LPCRITICAL_SECTION)0x0) { DeleteCriticalSection(DAT_00c5ab4c); operator_delete(ptr,0x1c); DAT_00c5ab4c = (LPCRITICAL_SECTION)0x0; } DAT_00c5ab48 = DAT_00c5ab48 & 0xfe; PTR_vftable_00c5ab44 = (undefined *)KAGE::MutexBase::vftable; return; } //@@ 00b17110 FUN_00b17110 void FUN_00b17110(void) { PTR_vftable_00c5af90 = (undefined *)theoraplayer::AudioInterfaceFactory::vftable; return; } //@@ 00b17120 FUN_00b17120 void FUN_00b17120(void) { FUN_00aaba40(); return; } //@@ 00b1712a FUN_00b1712a void FUN_00b1712a(void) { FUN_00aef0d2(); return; } //@@ 00b1eee0 FUN_00b1eee0 /* WARNING: Control flow encountered bad instruction data */ void FUN_00b1eee0(void) { char cVar1; byte bVar2; char cVar3; byte bVar4; int *in_EAX; char *pcVar5; undefined3 uVar8; byte *pbVar6; int *piVar7; uint in_ECX; char *pcVar9; uint uVar10; uint uVar11; char *in_EDX; byte bVar12; char *unaff_EBX; char *unaff_ESI; char *unaff_EDI; undefined2 in_ES; int *piStack_8; cVar1 = (char)in_EAX; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; *(char *)in_EAX = (char)*in_EAX + cVar1; pcVar5 = (char *)((int)in_EAX + *in_EAX); *pcVar5 = *pcVar5 + (byte)pcVar5; piVar7 = (int *)CONCAT31((int3)((uint)pcVar5 >> 8),(byte)pcVar5 ^ (byte)((uint)in_EDX >> 8)); pcVar5 = (char *)((int)piVar7 + *piVar7); *pcVar5 = *pcVar5 + (char)pcVar5; pcVar5 = (char *)((uint)pcVar5 & 0xffffff00); *unaff_ESI = *unaff_ESI; *pcVar5 = *pcVar5; pcVar5[-0x10] = pcVar5[-0x10] + (char)((uint)pcVar5 >> 8); pcVar9 = (char *)(in_ECX & 0xffffff00); *pcVar5 = *pcVar5; cVar1 = *pcVar5; uVar8 = (undefined3)((uint)pcVar5 >> 8); piVar7 = (int *)CONCAT31(uVar8,cVar1); *(char *)piVar7 = (char)*piVar7 + cVar1; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar1; pcVar5 = (char *)CONCAT31(uVar8,cVar1); *pcVar5 = *pcVar5 + cVar1; *pcVar5 = *pcVar5 + cVar1; cVar1 = cVar1 + *pcVar5; piVar7 = (int *)CONCAT31(uVar8,cVar1); *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *pcVar9 = *pcVar9 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *pcVar9 = *pcVar9 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *unaff_EDI = *unaff_EDI + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar1; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar1; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; pcVar5 = (char *)((int)piVar7 + *piVar7); *pcVar5 = *pcVar5 + (char)pcVar5; cVar1 = (char)pcVar5 + *pcVar5; piVar7 = (int *)CONCAT31((int3)((uint)pcVar5 >> 8),cVar1); *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + (char)unaff_EBX; *(char *)piVar7 = (char)*piVar7 + cVar1; *unaff_EBX = *unaff_EBX + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *unaff_EBX = *unaff_EBX + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *unaff_ESI = *unaff_ESI + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; uVar11 = (uint)CONCAT21((short)(in_ECX >> 0x10),(char)(in_ECX >> 8) + (char)((uint)pcVar5 >> 8)) << 8; *(char *)piVar7 = (char)*piVar7 + cVar1; *(char *)((int)piVar7 * 2) = *(char *)((int)piVar7 * 2) + cVar1; *(char *)piVar7 = (char)*piVar7 + cVar1; pbVar6 = (byte *)((int)piVar7 + *piVar7); bVar2 = (byte)pbVar6; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *(char *)((int)pbVar6 * 2) = *(char *)((int)pbVar6 * 2) + (char)unaff_EBX; *(char *)((int)pbVar6 * 2) = *(char *)((int)pbVar6 * 2) + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; piStack_8 = (int *)CONCAT22(piStack_8._2_2_,in_ES); *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; *pbVar6 = *pbVar6 + bVar2; do { *pbVar6 = *pbVar6 + bVar2; *(char *)((int)pbVar6 * 2) = *(char *)((int)pbVar6 * 2) + bVar2; *pbVar6 = *pbVar6 + bVar2; cVar1 = (char)unaff_EBX; bVar12 = (byte)((uint)unaff_EBX >> 8) | (byte)(uVar11 >> 8); unaff_EBX = (char *)CONCAT22((short)((uint)unaff_EBX >> 0x10),CONCAT11(bVar12,cVar1)); uVar10 = uVar11 & 0xffffff00; *pbVar6 = *pbVar6 + bVar2; uVar11 = uVar10 - 1; } while (uVar11 != 0 && *pbVar6 != 0); *pbVar6 = *pbVar6 | bVar2; *pbVar6 = *pbVar6 + bVar2; pbVar6 = pbVar6 + -1; out((short)in_EDX,pbVar6); pcVar9 = (char *)(uVar10 - 0x100); *(int *)pbVar6 = *(int *)pbVar6 - (int)pbVar6; *pbVar6 = *pbVar6 + (char)pbVar6; uVar8 = (undefined3)((uint)pbVar6 >> 8); cVar3 = (char)pbVar6 + *pbVar6; pcVar5 = (char *)CONCAT31(uVar8,cVar3); *pcVar5 = *pcVar5 + cVar3; cVar3 = cVar3 + *pcVar5; *(char *)CONCAT31(uVar8,cVar3) = *(char *)CONCAT31(uVar8,cVar3) + cVar3; *(char *)CONCAT31(uVar8,cVar3) = *(char *)CONCAT31(uVar8,cVar3) + cVar3; cVar3 = (char)in_ES; *(char *)piStack_8 = (char)*piStack_8 + cVar3; *(char *)((int)piStack_8 * 2) = *(char *)((int)piStack_8 * 2) + cVar3; *(char *)piStack_8 = (char)*piStack_8 + cVar3; pbVar6 = (byte *)((int)piStack_8 + *piStack_8); bVar4 = (byte)pbVar6; *pbVar6 = *pbVar6 + bVar4; *pbVar6 = *pbVar6 + bVar4; *unaff_EDI = *unaff_EDI + bVar4; *pcVar9 = *pcVar9 + bVar4; *(byte **)pbVar6 = pbVar6 + *(int *)pbVar6; *pbVar6 = *pbVar6 + bVar4; *(byte **)pbVar6 = pbVar6 + *(int *)pbVar6; *pbVar6 = *pbVar6 + bVar4; *(byte **)pbVar6 = pbVar6 + *(int *)pbVar6; bVar2 = *pbVar6; *pbVar6 = *pbVar6 + bVar4; cVar3 = bVar4 - CARRY1(bVar2,bVar4); piVar7 = (int *)CONCAT31((int3)((uint)pbVar6 >> 8),cVar3); *(char *)piVar7 = (char)*piVar7 + cVar3; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar3; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar3; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar3; pcVar5 = (char *)((int)piVar7 + *piVar7); cVar3 = (char)pcVar5; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *(char *)((int)pcVar5 * 2) = *(char *)((int)pcVar5 * 2) + bVar12; *pcVar5 = *pcVar5 + cVar3; uVar8 = (undefined3)((uint)pcVar5 >> 8); cVar3 = cVar3 + *pcVar5; piVar7 = (int *)CONCAT31(uVar8,cVar3); *(char *)piVar7 = (char)*piVar7 + cVar3; *piVar7 = (int)(*piVar7 + (int)piVar7); *(char *)piVar7 = (char)*piVar7 + cVar3; pcVar5 = (char *)CONCAT31(uVar8,cVar3); *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; cVar3 = cVar3 + *pcVar5; pcVar5 = (char *)CONCAT31(uVar8,cVar3); *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar1; *pcVar5 = *pcVar5 + cVar3; *unaff_EBX = *unaff_EBX + cVar3; *pcVar5 = *pcVar5 + cVar3; *unaff_EBX = *unaff_EBX + cVar3; *pcVar5 = *pcVar5 + cVar3; *unaff_ESI = *unaff_ESI + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar1; *pcVar5 = *pcVar5 + cVar3; piVar7 = (int *)CONCAT31(uVar8,cVar3); *(char *)piVar7 = (char)*piVar7 + cVar3; piVar7 = (int *)((int)piVar7 + *piVar7); cVar3 = (char)piVar7; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; pcVar9 = (char *)((uint)CONCAT21((short)(uVar11 >> 0x10), (char)(uVar11 >> 8) + (char)((uint)piVar7 >> 8)) << 8); *(char *)piVar7 = (char)*piVar7 + cVar3; *(char *)((int)piVar7 * 2) = *(char *)((int)piVar7 * 2) + cVar3; *(char *)piVar7 = (char)*piVar7 + cVar3; pcVar5 = (char *)((int)piVar7 + *piVar7); cVar3 = (char)pcVar5; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *(char *)((int)pcVar5 * 2) = *(char *)((int)pcVar5 * 2) + cVar1; *(char *)((int)pcVar5 * 2) = *(char *)((int)pcVar5 * 2) + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + cVar3; *pcVar5 = *pcVar5 + bVar12; *pcVar5 = *pcVar5 + cVar3; *unaff_EBX = *unaff_EBX + cVar3; *pcVar5 = *pcVar5 + cVar3; *in_EDX = *in_EDX + cVar3; *pcVar5 = *pcVar5 + cVar3; *unaff_ESI = *unaff_ESI + cVar3; *pcVar5 = *pcVar5 + cVar3; bVar12 = cVar3 + cVar1; pbVar6 = (byte *)CONCAT31((int3)((uint)pcVar5 >> 8),bVar12); *pbVar6 = *pbVar6 + bVar12; *in_EDX = *in_EDX + bVar12; *pbVar6 = *pbVar6 + bVar12; *unaff_EBX = *unaff_EBX + bVar12; *pbVar6 = *pbVar6 + bVar12; *(char *)((int)pbVar6 * 2) = *(char *)((int)pbVar6 * 2) + bVar12; bVar2 = *pbVar6; *pbVar6 = *pbVar6 + bVar12; *pbVar6 = (*pbVar6 - bVar12) - CARRY1(bVar2,bVar12); *pbVar6 = *pbVar6 + bVar12; pbVar6 = pbVar6 + *(int *)pbVar6; *pbVar6 = *pbVar6 + (char)pbVar6; pbVar6 = pbVar6 + *(int *)pbVar6; cVar3 = (char)pbVar6; *pbVar6 = *pbVar6 + cVar3; *pbVar6 = *pbVar6 + cVar3; *pcVar9 = *pcVar9 + cVar1; *pbVar6 = *pbVar6 + cVar3; *unaff_EBX = *unaff_EBX + cVar3; *pbVar6 = *pbVar6 + cVar3; *unaff_EBX = *unaff_EBX + cVar3; *pbVar6 = *pbVar6 + cVar3; *unaff_ESI = *unaff_ESI + cVar3; *pbVar6 = *pbVar6 + cVar3; *pcVar9 = *pcVar9 + cVar3; *pbVar6 = *pbVar6 + cVar3; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00b20100 FUN_00b20100 /* WARNING: Control flow encountered bad instruction data */ void FUN_00b20100(void) { bool bVar1; code *pcVar2; byte bVar3; uint uVar4; char *pcVar5; char in_DL; bool in_CF; byte in_AF; char in_OF; if (in_CF) { uVar4 = in(0x1d); bVar3 = (byte)(uVar4 + 0x241aa50); bVar1 = 0x99 < bVar3 || 0xfdbe55af < uVar4; pcVar5 = (char *)CONCAT31((int3)(uVar4 + 0x241aa50 >> 8), bVar3 + (9 < (bVar3 & 0xf) | in_AF) * '\x06' + bVar1 * '`'); *pcVar5 = *pcVar5 + in_DL + bVar1; in_OF = '\0'; } pcVar2 = (code *)swi(4); if (in_OF == '\x01') { (*pcVar2)(); } /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00b20500 FUN_00b20500 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b21430 FUN_00b21430 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b214d0 FUN_00b214d0 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b21a90 FUN_00b21a90 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b21b80 FUN_00b21b80 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b220e0 FUN_00b220e0 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b22310 FUN_00b22310 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b22620 FUN_00b22620 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b23040) overlaps instruction at (ram,0x00b2303f) */ //@@ 00b23150 FUN_00b23150 /* WARNING: Unable to track spacebase fully for stack */ void FUN_00b23150(void) { int *piVar1; byte bVar2; byte bVar3; byte bVar4; byte bVar5; byte bVar6; byte bVar7; byte bVar8; byte bVar9; byte bVar10; byte bVar11; byte bVar12; byte bVar13; byte bVar14; byte bVar15; byte bVar16; char cVar17; uint in_EAX; int iVar18; uint uVar19; byte *pbVar20; byte *pbVar21; undefined2 uVar22; int in_ECX; char *in_EDX; byte unaff_BL; int iVar23; undefined1 *puVar24; int iVar25; char *pcVar26; int unaff_EDI; undefined2 in_SS; byte in_AF; undefined1 auStack_38 [4]; uVar22 = (undefined2)in_ECX; piVar1 = (int *)segment(in_SS,(short)auStack_38); iVar23 = CONCAT22((short)((uint)auStack_38 >> 0x10),(short)auStack_38 + 4); iVar18 = *(int *)(*piVar1 + 0x24); iVar25 = *(int *)(unaff_EDI + 0x58) * 0x69; pcVar26 = (char *)(iVar25 + 1); puVar24 = (undefined1 *)(iVar23 + -4); *(int *)(iVar23 + -4) = iVar23; iVar18 = (((in_EAX ^ 0x43) + 0xbc949a8f) - iVar18 ^ 0x3c5e2c6f) + 0xb6a5c7ce; bVar16 = 9 < ((byte)iVar18 & 0xf) | in_AF; bVar2 = (byte)iVar18 + bVar16 * '\x06'; bVar16 = 9 < (bVar2 & 0xf) | bVar16; bVar3 = bVar2 + bVar16 * -6 & 0xf; bVar2 = 9 < bVar3 | bVar16; bVar4 = bVar3 + bVar2 * -6 & 0xf; bVar3 = 9 < bVar4 | bVar2; bVar5 = bVar4 + bVar3 * -6 & 0xf; bVar4 = 9 < bVar5 | bVar3; bVar6 = bVar5 + bVar4 * -6 & 0xf; bVar5 = 9 < bVar6 | bVar4; bVar7 = bVar6 + bVar5 * -6 & 0xf; bVar6 = 9 < bVar7 | bVar5; bVar8 = bVar7 + bVar6 * -6 & 0xf; bVar7 = 9 < bVar8 | bVar6; bVar9 = bVar8 + bVar7 * -6 & 0xf; bVar8 = 9 < bVar9 | bVar7; bVar10 = bVar9 + bVar8 * -6 & 0xf; bVar9 = 9 < bVar10 | bVar8; bVar11 = bVar10 + bVar9 * -6 & 0xf; bVar10 = 9 < bVar11 | bVar9; bVar12 = bVar11 + bVar10 * -6 & 0xf; bVar11 = 9 < bVar12 | bVar10; bVar13 = bVar12 + bVar11 * -6 & 0xf; bVar12 = 9 < bVar13 | bVar11; bVar14 = bVar13 + bVar12 * -6 & 0xf; bVar13 = 9 < bVar14 | bVar12; bVar15 = bVar14 + bVar13 * -6 & 0xf; bVar14 = 9 < bVar15 | bVar13; uVar19 = CONCAT31((int3)((uint)iVar18 >> 8),bVar15 + bVar14 * -6) & 0xffff000f; pbVar20 = (byte *)CONCAT22((short)(uVar19 >> 0x10), CONCAT11(((((((((((((((char)((uint)iVar18 >> 8) - bVar16) - bVar2) - bVar3) - bVar4) - bVar5) - bVar6) - bVar7) - bVar8) - bVar9) - bVar10) - bVar11) - bVar12) - bVar13) - bVar14, (char)uVar19)); if (SBORROW4((int)pcVar26,*(int *)(unaff_EDI + -0xc))) { uVar22 = (undefined2)(in_ECX + -1); bVar2 = (byte)((uint)(in_ECX + -1) >> 8); *pcVar26 = *pcVar26 + bVar2; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam58585858 = bRam58585858 & bVar2; pbVar20 = *(byte **)(iVar23 + 9); puVar24 = (undefined1 *)(iVar23 + 0xd); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; } pbVar21 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar21 >> 8); *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; pbVar20[-0x20202000] = pbVar20[-0x20202000] & unaff_BL; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; pbVar20 = *(byte **)(puVar24 + 8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; iVar18 = *(int *)(puVar24 + 0x24); pbVar20 = (byte *)(iVar18 + -0x20202020); *(byte *)(iVar18 + -0x20201fc8) = *(byte *)(iVar18 + -0x20201fc8) & unaff_BL; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = (byte *)(iVar18 + -0x40404040); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bVar2 = (byte)((ushort)uVar22 >> 8); bRam2e2e2e58 = bRam2e2e2e58 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x2c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x34); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x38); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x48); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202d2d = bRam20202d2d & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e585858 = bRam2e585858 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x58); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar21 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar21 >> 8); *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; pbVar20[-0x20201ff2] = pbVar20[-0x20201ff2] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x5c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e2e2e58 = bRam2e2e2e58 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x60); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x6c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x20] = pbVar20[0x20] & unaff_BL; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x70); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x74); bRam20202020 = bRam20202020 & bVar2; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x7c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x80); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x90); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x58] = pbVar20[0x58] & unaff_BL; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x94); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); iVar18 = *(int *)(puVar24 + 0x98); pbVar20 = (byte *)(iVar18 + -0x20202020); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = (byte *)(iVar18 + -0x20201ff2); *pbVar20 = *pbVar20 & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x9c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam582e2e58 = bRam582e2e58 & bVar2; pbVar20 = *(byte **)(puVar24 + 0xa0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0xb0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0xb4); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0xb8); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); iVar18 = *(int *)(puVar24 + 200); pbVar20 = (byte *)(iVar18 + -0x20202020); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = (byte *)(iVar18 + -0x20201fc8); *pbVar20 = *pbVar20 & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0xe0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20582e58 = bRam20582e58 & bVar2; pbVar20 = *(byte **)(puVar24 + 0xe8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *(byte *)(*(int *)(puVar24 + 0xf0) + 0x2e) = *(byte *)(*(int *)(puVar24 + 0xf0) + 0x2e) & unaff_BL ; pbVar20 = *(byte **)(puVar24 + 0x104); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x108); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x10c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x110); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x118); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[-0x2020582a] = pbVar20[-0x2020582a] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x11c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x120); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20[0x58] = pbVar20[0x58] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x134); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x13c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x140); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x144); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam20202020 = bRam20202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x14c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x154); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x15c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x164); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x16c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x180); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x188); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x18c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 400); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam58202020 = bRam58202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x194); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x19c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x1a4); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x1a8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x1ac); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *(byte *)(*(int *)(puVar24 + 0x1c0) + 0x2e) = *(byte *)(*(int *)(puVar24 + 0x1c0) + 0x2e) & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x1c4); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x1c8); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x1cc); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x1d0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x1d8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x1e0); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x1e8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x1f0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x20c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x210); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x214); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e2e5820 = bRam2e2e5820 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x248); bRam20202020 = bRam20202020 & bVar2; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x24c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20[0x58] = pbVar20[0x58] & unaff_BL; pbVar20[-0x2020582a] = pbVar20[-0x2020582a] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x250); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam582e2e58 = bRam582e2e58 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x264); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x268); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x26c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e2e2e58 = bRam2e2e2e58 & bVar2; pbVar20 = (byte *)(*(int *)(puVar24 + 0x270) + -0x20202020); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *(byte *)(*(int *)(puVar24 + 0x278) + 0x2e) = *(byte *)(*(int *)(puVar24 + 0x278) + 0x2e) & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x284); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x294); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x298); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x29c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e2e5820 = bRam2e2e5820 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x2d0); bRam20202020 = bRam20202020 & bVar2; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x2dc); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e2e5820 = bRam2e2e5820 & bVar2; bRam2e585858 = bRam2e585858 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x2f8); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x2fc); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x304); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x30c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x318); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x32c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam58202020 = bRam58202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x330); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x338); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x340); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x348); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x374); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam20202020 = bRam20202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x37c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 900); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x38c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x398); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x3a8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x4d5a5a5a; *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x3b0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x3b8); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x3e0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *(byte *)(*(int *)(puVar24 + 0x3e4) + 0x2e) = *(byte *)(*(int *)(puVar24 + 0x3e4) + 0x2e) & unaff_BL; *(byte *)(*(int *)(puVar24 + 1000) + 0x2e) = *(byte *)(*(int *)(puVar24 + 1000) + 0x2e) & unaff_BL ; pbVar20 = *(byte **)(puVar24 + 0x3ec); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; bRam58585858 = bRam58585858 & bVar2; iVar18 = *(int *)(puVar24 + 0x3fc); pbVar20 = (byte *)(iVar18 + -0x20202020); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = (byte *)(iVar18 + -0x20201fc8); *pbVar20 = *pbVar20 & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x414); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2d2d2d2d = bRam2d2d2d2d & bVar2; pbVar20[-0x2f2f2f0d] = pbVar20[-0x2f2f2f0d] & unaff_BL; *(byte *)(*(int *)(puVar24 + 0x418) + 0x2e) = *(byte *)(*(int *)(puVar24 + 0x418) + 0x2e) & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x41c); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = *(byte **)(puVar24 + 0x424); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; bRam2e2e2e58 = bRam2e2e2e58 & bVar2; iVar18 = *(int *)(puVar24 + 0x428); pbVar20 = (byte *)(iVar18 + -0x20202020); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = (byte *)(iVar18 + -0x20201ff2); *pbVar20 = *pbVar20 & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x42c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x434); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x58] = pbVar20[0x58] & unaff_BL; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x43c); pbVar20[0x58] = pbVar20[0x58] & unaff_BL; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x444); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = pbVar20 + -0x20202020; *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); bRam2e2e5820 = bRam2e2e5820 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x448); bRam20202020 = bRam20202020 & bVar2; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x450); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x454); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x458); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x45c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x464); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x468); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar21 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar21 >> 8); *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; pbVar20[-0x20201ff2] = pbVar20[-0x20201ff2] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x46c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x470); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x474); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar21 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar21 >> 8); *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20[-0x20201ff2] = pbVar20[-0x20201ff2] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x478); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x58] = pbVar20[0x58] & unaff_BL; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam58202020 = bRam58202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x47c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x484); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = *(byte **)(puVar24 + 0x4bc); bRam20202020 = bRam20202020 & bVar2; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20[0x58] = pbVar20[0x58] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x4dc); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = pbVar20 + -0x7a7a7a87; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x4e0); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar21 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar21 >> 8); *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; pbVar20[-0x20202000] = pbVar20[-0x20202000] & unaff_BL; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; *pbVar21 = *pbVar21 & bVar16; iVar18 = *(int *)(puVar24 + 0x4e4); pbVar20 = (byte *)(iVar18 + -0x20202020); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2d2d2d2d = bRam2d2d2d2d & bVar2; pbVar20 = (byte *)(iVar18 + 0x65655859); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *(byte *)(iVar18 + 0x29291c4c) = *(byte *)(iVar18 + 0x29291c4c) & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x51c); bRam20202020 = bRam20202020 & bVar2; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam2e582020 = bRam2e582020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x520); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x524); *pbVar20 = *pbVar20 & (byte)((uint)pbVar20 >> 8); pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam58202020 = bRam58202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x528); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x2e] = pbVar20[0x2e] & unaff_BL; pbVar20 = *(byte **)(puVar24 + 0x52c); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bRam20202020 = bRam20202020 & bVar2; pbVar20 = *(byte **)(puVar24 + 0x534); bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20[0x58] = pbVar20[0x58] & unaff_BL; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; pbVar20 = pbVar20 + -0x20202020; bVar16 = (byte)((uint)pbVar20 >> 8); *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 & bVar16; bVar16 = (byte)pbVar20; *pbVar20 = *pbVar20 & bVar16; *pbVar20 = *pbVar20 + bVar16; cVar17 = bVar16 + (char)((uint)in_EDX >> 8); pcVar26 = (char *)CONCAT31((int3)((uint)pbVar20 >> 8),cVar17); piVar1 = (int *)(iVar25 + -0x492c9fff); *piVar1 = *piVar1 << 1; *in_EDX = *in_EDX + (char)uVar22; *pcVar26 = *pcVar26 + cVar17; *pcVar26 = *pcVar26 + (char)uVar22; return; } //@@ 00b3c6f0 FUN_00b3c6f0 /* WARNING: Control flow encountered bad instruction data */ /* WARNING: Instruction at (ram,0x00b3c6d5) overlaps instruction at (ram,0x00b3c6d4) */ /* WARNING: Removing unreachable block (ram,0x00b3c6d5) */ /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00b3c6f0(void) { byte *pbVar1; byte bVar2; byte bVar3; char cVar6; int *piVar4; char *pcVar5; char cVar7; int *in_ECX; byte bVar8; int in_EDX; int unaff_EBX; int unaff_EBP; int unaff_ESI; char *unaff_EDI; int in_GS_OFFSET; bool in_OF; in(0); in(0); pcVar5 = (char *)in(0x70); bVar3 = (byte)pcVar5; _DAT_b970a370 = pcVar5; if (in_OF) { *in_ECX = (int)(pcVar5 + *in_ECX); cVar7 = (char)((uint)in_ECX >> 8); pcVar5[1] = pcVar5[1] + cVar7; *pcVar5 = *pcVar5 + bVar3; *pcVar5 = *pcVar5 + bVar3; cVar6 = (char)((uint)pcVar5 >> 8) + bVar3; piVar4 = (int *)CONCAT22((short)((uint)pcVar5 >> 0x10),CONCAT11(cVar6,bVar3)); *(byte *)piVar4 = (char)*piVar4 + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; "[Frame: %d] Recieved eDropMessageType::MSG_DROP_EXECUTE for player \"%s\" %llu from player \"%s\" %llu \n" [unaff_EBX + 0x37] = "[Frame: %d] Recieved eDropMessageType::MSG_DROP_EXECUTE for player \"%s\" %llu from player \"%s\" %llu \n" [unaff_EBX + 0x37] + cVar7; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(char *)in_ECX = (char)*in_ECX + (char)in_ECX; *(byte *)piVar4 = (char)*piVar4 + bVar3; *unaff_EDI = *unaff_EDI + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(short *)piVar4 = (short)*piVar4 + CONCAT11(cVar6,bVar3); *(char *)in_ECX = (char)*in_ECX + cVar7; *(byte *)piVar4 = (char)*piVar4 + bVar3; pbVar1 = (byte *)((int)piVar4 + 0x57); bVar2 = *pbVar1; bVar8 = (byte)((uint)in_EDX >> 8); *pbVar1 = *pbVar1 + bVar8; *(uint *)(unaff_EDI + -4) = *(int *)(unaff_EDI + -4) + 0x101e301 + (uint)CARRY1(bVar2,bVar8); *(byte *)piVar4 = (char)*piVar4 + bVar3; *(char *)(unaff_EBP + 1) = *(char *)(unaff_EBP + 1) + cVar6; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; *piVar4 = (int)(*piVar4 + (int)piVar4); *(byte *)piVar4 = (char)*piVar4 + bVar3; *(int *)(in_GS_OFFSET + (int)piVar4) = (int)(*(int *)(in_GS_OFFSET + (int)piVar4) + (int)piVar4) ; *(char *)(unaff_ESI + 1) = *(char *)(unaff_ESI + 1) + cVar6; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; *(byte *)piVar4 = (char)*piVar4 + bVar3; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } _DAT_c3000000 = _DAT_c3000000 << 1 | (uint)((int)_DAT_c3000000 < 0); *pcVar5 = *pcVar5 + bVar3; *pcVar5 = *pcVar5 + bVar3; *pcVar5 = *pcVar5 + bVar3; pbVar1 = (byte *)(in_EDX + 0xdc682c6); bVar2 = *pbVar1; *pbVar1 = *pbVar1 + bVar3; pcVar5 = pcVar5 + CARRY1(bVar2,bVar3) + 0x514f5; *pcVar5 = *pcVar5 + (char)pcVar5; return; } //@@ 00b416f0 FUN_00b416f0 void FUN_00b416f0(void) { byte *in_EDX; byte unaff_BL; *in_EDX = *in_EDX | unaff_BL; do { /* WARNING: Do nothing block with infinite loop */ } while( true ); } //@@ 00b45f10 FUN_00b45f10 /* WARNING: Control flow encountered bad instruction data */ void FUN_00b45f10(void) { char cVar1; char *in_EAX; cVar1 = (char)in_EAX; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00b479c0 FUN_00b479c0 /* WARNING: Control flow encountered bad instruction data */ void FUN_00b479c0(void) { char cVar1; char *in_EAX; cVar1 = (char)in_EAX; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00b48b60 FUN_00b48b60 /* WARNING: Control flow encountered bad instruction data */ void FUN_00b48b60(void) { uint uVar1; byte bVar2; char cVar3; byte bVar8; undefined4 in_EAX; uint uVar4; byte *pbVar5; uint *puVar6; char *pcVar7; byte *in_ECX; byte bVar9; byte bVar11; undefined4 in_EDX; byte *pbVar10; undefined4 unaff_EBX; uint uVar12; int unaff_ESI; byte *unaff_EDI; bool bVar13; byte in_AF; bVar2 = (char)in_EAX - 0x2d; bVar8 = 9 < (bVar2 & 0xf) | in_AF; bVar2 = bVar2 + bVar8 * -6; bVar11 = (byte)((uint)in_EDX >> 8); *in_ECX = *in_ECX ^ bVar11; bVar9 = (byte)in_EDX; pbVar10 = (byte *)CONCAT22((short)((uint)in_EDX >> 0x10), CONCAT11(bVar11 ^ *(byte *)(unaff_ESI + 0x37373635),bVar9)); bVar8 = 9 < (bVar2 & 0xf) | bVar8; uVar4 = CONCAT31((int3)((uint)in_EAX >> 8),bVar2 + bVar8 * '\x06') & 0xffffff0f; DAT_28282c2c = DAT_28282c2c ^ (byte)((uint)in_ECX >> 8); uVar4 = (CONCAT22((short)(uVar4 >> 0x10),CONCAT11((char)((uint)in_EAX >> 8) + bVar8,(char)uVar4)) ^ 0x31323434) & 0xffffff23; bVar8 = (byte)(uVar4 >> 8) & *in_ECX; pbVar5 = (byte *)CONCAT22((short)(uVar4 >> 0x10),CONCAT11(bVar8,(char)uVar4)); *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; *pbVar5 = *pbVar5 & bVar8; bVar2 = (byte)(pbVar5 + -0x1c1c1c1d); bVar8 = bVar2 - 0x1b; bVar13 = bVar2 < 0x1b || bVar8 < (pbVar5 < (byte *)0x1c1c1c1d); puVar6 = (uint *)CONCAT31((int3)((uint)(pbVar5 + -0x1c1c1c1d) >> 8), bVar8 - (pbVar5 < (byte *)0x1c1c1c1d)); bVar8 = (byte)unaff_EBX - *pbVar10; uVar12 = CONCAT31((int3)((uint)unaff_EBX >> 8),bVar8 - bVar13); uVar4 = (uint)((byte)unaff_EBX < *pbVar10 || bVar8 < bVar13); uVar1 = *puVar6 - uVar12; bVar13 = *puVar6 < uVar12 || uVar1 < uVar4; *puVar6 = uVar1 - uVar4; bVar8 = *unaff_EDI; bVar2 = *unaff_EDI; *unaff_EDI = (bVar2 - bVar9) - bVar13; uVar4 = (int)puVar6 + (bVar8 < bVar9 || (byte)(bVar2 - bVar9) < bVar13) + 0x10121414 | 10; *unaff_EDI = *unaff_EDI | (byte)uVar4; pcVar7 = (char *)(uVar4 + 0x1020304); cVar3 = (char)pcVar7; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; *pcVar7 = *pcVar7 + cVar3; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00b4e3d0 FUN_00b4e3d0 /* WARNING: Control flow encountered bad instruction data */ void FUN_00b4e3d0(void) { char in_DL; int unaff_ESI; undefined2 in_stack_00000014; undefined1 in_stack_0000001c; *(char *)(unaff_ESI + 0x2c770730) = *(char *)(unaff_ESI + 0x2c770730) + in_DL; out(in_stack_00000014,in_stack_0000001c); /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00b55f10 FUN_00b55f10 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00b55f6c) overlaps instruction at (ram,0x00b55f6b) */ //@@ 00c1aef0 FUN_00c1aef0 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00c1c368) overlaps instruction at (ram,0x00c1c366) */ //@@ 00c1c6a0 FUN_00c1c6a0 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... No pcode could be generated at address: r0x00c1cff4 */ //@@ 00c1d080 FUN_00c1d080 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00c1d362) overlaps instruction at (ram,0x00c1d361) */ //@@ 00c32970 FUN_00c32970 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... No pcode could be generated at address: r0x00c32d4f */ //@@ 00c738c0 FUN_00c738c0 /* decompile failed: Exception while decompiling 00c738c0: process: timeout */ //@@ 00c742f0 FUN_00c742f0 /* decompile failed: Exception while decompiling 00c742f0: process: timeout */ //@@ 00c78e20 FUN_00c78e20 /* decompile failed: Exception while decompiling 00c78e20: process: timeout */ //@@ 00c932c0 FUN_00c932c0 /* WARNING: Instruction at (ram,0x00c9d1f3) overlaps instruction at (ram,0x00c9d1f2) */ void FUN_00c932c0(void) { byte bVar1; char cVar2; byte bVar3; char cVar7; int *in_EAX; char *pcVar4; undefined3 uVar8; int *piVar5; byte *pbVar6; byte bVar9; char cVar10; char *in_ECX; char cVar11; char cVar12; undefined4 in_EDX; char cVar13; undefined4 unaff_EBX; char *unaff_ESI; int in_GS_OFFSET; cVar2 = (char)in_EAX; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; pcVar4 = (char *)((int)in_EAX + *in_EAX + *(int *)((int)in_EAX + *in_EAX)); cVar2 = (char)pcVar4; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 - cVar2; pcVar4[0xe] = pcVar4[0xe] + cVar2; *pcVar4 = *pcVar4 + cVar2; bVar9 = (byte)in_ECX; pcVar4[0x800000] = pcVar4[0x800000] + bVar9; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *unaff_ESI = *unaff_ESI + cVar2; *in_ECX = *in_ECX + cVar2; *pcVar4 = *pcVar4 + cVar2; cVar7 = (char)((uint)pcVar4 >> 8); pcVar4[0x2800000] = pcVar4[0x2800000] + cVar7; *pcVar4 = *pcVar4 + cVar2; cVar13 = (char)((uint)unaff_EBX >> 8); pcVar4[0x3800000] = pcVar4[0x3800000] + cVar13; *pcVar4 = *pcVar4 + cVar2; uVar8 = (undefined3)((uint)pcVar4 >> 8); cVar11 = (char)in_EDX; cVar2 = cVar2 + cVar11; pcVar4 = (char *)CONCAT31(uVar8,cVar2); *pcVar4 = *pcVar4 + cVar2; *(undefined1 *)((int)pcVar4 * 2) = *(undefined1 *)((int)pcVar4 * 2); cVar10 = (char)((uint)in_ECX >> 8); bVar3 = cVar2 + cVar10; pcVar4 = (char *)CONCAT31(uVar8,bVar3); *pcVar4 = *pcVar4 + bVar3; cRam00000000 = cRam00000000 + '\x01'; pbVar6 = (byte *)(pcVar4 + 6); bVar1 = *pbVar6; *pbVar6 = *pbVar6 + bVar3; *in_ECX = (*in_ECX - bVar3) - CARRY1(bVar1,bVar3); *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; cVar2 = bVar3 + *pcVar4; piVar5 = (int *)CONCAT31(uVar8,cVar2); *(char *)(in_GS_OFFSET + (int)piVar5) = *(char *)(in_GS_OFFSET + (int)piVar5) + cVar2; cVar12 = (char)((uint)in_EDX >> 8); *(char *)piVar5 = (char)*piVar5 + cVar12; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5; *(char *)((int)piVar5 + 1) = *(char *)((int)piVar5 + 1) + bVar9; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)((int)piVar5 * 2) = *(char *)((int)piVar5 * 2) + cVar2; *(char *)((int)piVar5 + 1) = *(char *)((int)piVar5 + 1) + cVar13; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)((int)piVar5 * 2) = *(char *)((int)piVar5 * 2) + cVar2; *(char *)((int)piVar5 + 1) = *(char *)((int)piVar5 + 1) + bVar9; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; pcVar4 = (char *)CONCAT31(uVar8,cVar2); pcVar4[1] = pcVar4[1] + (char)unaff_EBX; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; pcVar4 = (char *)CONCAT31(uVar8,cVar2); pcVar4[1] = pcVar4[1] + cVar10; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; pcVar4 = (char *)CONCAT31(uVar8,cVar2); pcVar4[1] = pcVar4[1] + cVar13; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; cVar2 = cVar2 + bVar9; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; cVar2 = cVar2 + (char)unaff_EBX; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; cVar2 = cVar2 + cVar10; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; cVar2 = cVar2 + cVar13; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar11; pbVar6 = (byte *)(in_ECX + 0x46800); *pbVar6 = *pbVar6 >> (bVar9 & 7) | *pbVar6 << 8 - (bVar9 & 7); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)((int)piVar5 + -0x2a) = *(char *)((int)piVar5 + -0x2a) + cVar13; *piVar5 = (int)piVar5; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)piVar5; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; cVar2 = cRam680089ed; pcVar4 = (char *)CONCAT31(uVar8,cRam680089ed); *pcVar4 = *pcVar4 + cRam680089ed; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + bVar9; *(char **)pcVar4 = pcVar4; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; bVar3 = *(byte *)CONCAT31(uVar8,2); pbVar6 = (byte *)CONCAT31(uVar8,bVar3); *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; pbVar6[-0x13] = pbVar6[-0x13] + cVar12; *(byte **)pbVar6 = pbVar6; *pbVar6 = *pbVar6 ^ bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; bVar1 = *pbVar6; *pbVar6 = *pbVar6 + bVar3; if (SCARRY1(bVar1,bVar3)) { *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; pbVar6[0x7d008a09] = pbVar6[0x7d008a09] + cVar7; } else { bVar1 = *pbVar6; pbVar6 = (byte *)CONCAT31(uVar8,bVar1); *pbVar6 = *pbVar6 ^ bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; pbVar6 = (byte *)CONCAT31(uVar8,uRam7d008a09); } *(byte **)pbVar6 = pbVar6 + *(int *)pbVar6; cVar2 = (char)pbVar6; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar10; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar11; *pbVar6 = *pbVar6 + cVar2; cVar7 = (char)((uint)pbVar6 >> 8); *pbVar6 = *pbVar6 + cVar7; *pbVar6 = *pbVar6 + cVar2; *in_ECX = *in_ECX + cVar2; *pbVar6 = *pbVar6 + cVar7; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; return; } //@@ 00c9a6c0 FUN_00c9a6c0 /* WARNING: Instruction at (ram,0x00c9d1f3) overlaps instruction at (ram,0x00c9d1f2) */ void FUN_00c9a6c0(void) { byte bVar1; char cVar2; byte bVar3; char cVar7; int *in_EAX; char *pcVar4; undefined3 uVar8; int *piVar5; byte *pbVar6; byte bVar9; char cVar10; char *in_ECX; char cVar11; char cVar12; undefined4 in_EDX; char cVar13; undefined4 unaff_EBX; char *unaff_ESI; int in_GS_OFFSET; cVar2 = (char)in_EAX; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; *(char *)in_EAX = (char)*in_EAX + cVar2; pcVar4 = (char *)((int)in_EAX + *in_EAX + *(int *)((int)in_EAX + *in_EAX)); cVar2 = (char)pcVar4; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 - cVar2; pcVar4[0xe] = pcVar4[0xe] + cVar2; *pcVar4 = *pcVar4 + cVar2; bVar9 = (byte)in_ECX; pcVar4[0x800000] = pcVar4[0x800000] + bVar9; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *unaff_ESI = *unaff_ESI + cVar2; *in_ECX = *in_ECX + cVar2; *pcVar4 = *pcVar4 + cVar2; cVar7 = (char)((uint)pcVar4 >> 8); pcVar4[0x2800000] = pcVar4[0x2800000] + cVar7; *pcVar4 = *pcVar4 + cVar2; cVar13 = (char)((uint)unaff_EBX >> 8); pcVar4[0x3800000] = pcVar4[0x3800000] + cVar13; *pcVar4 = *pcVar4 + cVar2; uVar8 = (undefined3)((uint)pcVar4 >> 8); cVar11 = (char)in_EDX; cVar2 = cVar2 + cVar11; pcVar4 = (char *)CONCAT31(uVar8,cVar2); *pcVar4 = *pcVar4 + cVar2; *(undefined1 *)((int)pcVar4 * 2) = *(undefined1 *)((int)pcVar4 * 2); cVar10 = (char)((uint)in_ECX >> 8); bVar3 = cVar2 + cVar10; pcVar4 = (char *)CONCAT31(uVar8,bVar3); *pcVar4 = *pcVar4 + bVar3; cRam00000000 = cRam00000000 + '\x01'; pbVar6 = (byte *)(pcVar4 + 6); bVar1 = *pbVar6; *pbVar6 = *pbVar6 + bVar3; *in_ECX = (*in_ECX - bVar3) - CARRY1(bVar1,bVar3); *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; *pcVar4 = *pcVar4 + bVar3; cVar2 = bVar3 + *pcVar4; piVar5 = (int *)CONCAT31(uVar8,cVar2); *(char *)(in_GS_OFFSET + (int)piVar5) = *(char *)(in_GS_OFFSET + (int)piVar5) + cVar2; cVar12 = (char)((uint)in_EDX >> 8); *(char *)piVar5 = (char)*piVar5 + cVar12; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5; *(char *)((int)piVar5 + 1) = *(char *)((int)piVar5 + 1) + bVar9; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)((int)piVar5 * 2) = *(char *)((int)piVar5 * 2) + cVar2; *(char *)((int)piVar5 + 1) = *(char *)((int)piVar5 + 1) + cVar13; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)((int)piVar5 * 2) = *(char *)((int)piVar5 * 2) + cVar2; *(char *)((int)piVar5 + 1) = *(char *)((int)piVar5 + 1) + bVar9; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; pcVar4 = (char *)CONCAT31(uVar8,cVar2); pcVar4[1] = pcVar4[1] + (char)unaff_EBX; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; pcVar4 = (char *)CONCAT31(uVar8,cVar2); pcVar4[1] = pcVar4[1] + cVar10; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; pcVar4 = (char *)CONCAT31(uVar8,cVar2); pcVar4[1] = pcVar4[1] + cVar13; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; cVar2 = cVar2 + bVar9; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; cVar2 = cVar2 + (char)unaff_EBX; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; cVar2 = cVar2 + cVar10; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *in_ECX = *in_ECX + cVar2; *in_ECX = *in_ECX + bVar9; cVar2 = cVar2 + cVar13; piVar5 = (int *)CONCAT31(uVar8,cVar2); *piVar5 = (int)(*piVar5 + (int)piVar5); *(char *)piVar5 = (char)*piVar5 + cVar11; pbVar6 = (byte *)(in_ECX + 0x46800); *pbVar6 = *pbVar6 >> (bVar9 & 7) | *pbVar6 << 8 - (bVar9 & 7); *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)((int)piVar5 + -0x2a) = *(char *)((int)piVar5 + -0x2a) + cVar13; *piVar5 = (int)piVar5; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *piVar5 = (int)piVar5; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; *(char *)piVar5 = (char)*piVar5 + cVar2; cVar2 = cRam680089ed; pcVar4 = (char *)CONCAT31(uVar8,cRam680089ed); *pcVar4 = *pcVar4 + cRam680089ed; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + bVar9; *(char **)pcVar4 = pcVar4; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; *pcVar4 = *pcVar4 + cVar2; bVar3 = *(byte *)CONCAT31(uVar8,2); pbVar6 = (byte *)CONCAT31(uVar8,bVar3); *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; pbVar6[-0x13] = pbVar6[-0x13] + cVar12; *(byte **)pbVar6 = pbVar6; *pbVar6 = *pbVar6 ^ bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; bVar1 = *pbVar6; *pbVar6 = *pbVar6 + bVar3; if (SCARRY1(bVar1,bVar3)) { *pbVar6 = *pbVar6 + bVar3; *pbVar6 = *pbVar6 + bVar3; pbVar6[0x7d008a09] = pbVar6[0x7d008a09] + cVar7; } else { bVar1 = *pbVar6; pbVar6 = (byte *)CONCAT31(uVar8,bVar1); *pbVar6 = *pbVar6 ^ bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; *pbVar6 = *pbVar6 + bVar1; pbVar6 = (byte *)CONCAT31(uVar8,uRam7d008a09); } *(byte **)pbVar6 = pbVar6 + *(int *)pbVar6; cVar2 = (char)pbVar6; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar10; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar11; *pbVar6 = *pbVar6 + cVar2; cVar7 = (char)((uint)pbVar6 >> 8); *pbVar6 = *pbVar6 + cVar7; *pbVar6 = *pbVar6 + cVar2; *in_ECX = *in_ECX + cVar2; *pbVar6 = *pbVar6 + cVar7; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; *pbVar6 = *pbVar6 + cVar2; return; } //@@ 00cfe315 FUN_00cfe315 /* WARNING: Unable to track spacebase fully for stack */ /* WARNING: Restarted to delay deadcode elimination for space: stack */ undefined8 FUN_00cfe315(void) { undefined4 in_EAX; undefined4 in_EDX; int unaff_retaddr; undefined1 auStack_24 [8]; steamstub_drm_entry(unaff_retaddr + -5,auStack_24 + 8,auStack_24 + 8); return CONCAT44(in_EDX,in_EAX); } //@@ 00cfe370 FUN_00cfe370 undefined4 FUN_00cfe370(void) { return 0; } //@@ 00cfe380 FUN_00cfe380 void ** FUN_00cfe380(void) { return &ExceptionList; } //@@ 00cfe390 steamstub_drm_entry /* DB: SteamStub header magic 0xc0dec0df, XOR-decrypt loops, resolves 34 imports by name, int3 on failure; entered via the call/pop thunk at 00cfe315 */ int steamstub_drm_entry(int param_1,int param_2) { char *pcVar1; int iVar2; code *pcVar3; int iVar4; char *pcVar5; uint uVar6; undefined4 uVar7; uint local_844 [160]; uint local_5c4 [60]; char local_4d4 [32]; char local_4b4 [52]; undefined1 local_480 [4]; code *local_47c; code *local_478; code *local_470; code *local_46c; code *local_468; code *local_464; code *local_460; code *local_45c; code *local_458; code *local_454; code *local_450; code *local_44c; code *local_448; code *local_444; code *local_440; code *local_43c; code *local_434; code *local_430; code *local_42c; code *local_428; code *local_424; code *local_420; char *apcStack_41c [34]; undefined1 *local_394; uint local_390; code *local_38c; char *local_388; int local_384; int local_37c; int local_378; int local_374; int local_370; int local_36c; undefined1 *local_368; int local_364; uint local_360; short *local_35c; int local_358; uint *local_354; uint *local_350; uint local_34c; uint local_348; uint local_344; uint local_340; undefined1 *local_33c; int local_338; uint local_334; uint local_330; undefined2 local_32c; undefined2 uStack_32a; undefined2 uStack_328; undefined2 uStack_326; undefined2 uStack_324; undefined2 uStack_322; undefined2 uStack_320; undefined2 uStack_31e; undefined2 uStack_31c; undefined2 uStack_31a; undefined2 uStack_318; undefined2 uStack_316; undefined2 uStack_314; uint local_310; code *local_30c; int local_308; uint *local_304; uint local_300; int local_2fc; int *local_2f8; code *local_2f4; short *local_2f0; code *local_2ec; short *local_2e8; code *local_2e4; uint local_2e0; uint local_2dc; uint local_2d8; int *local_2d4; uint *local_2d0; uint local_2cc; int local_2c8; int *local_2c4; short *local_2c0; int *local_2bc; short *local_2b8; undefined1 *local_2b4; uint local_2b0; uint local_2ac; uint local_2a8; uint *local_2a4; int local_2a0; int local_29c; uint *local_298; short *local_294; uint *local_290; uint *local_28c; uint *local_288; uint *local_284; uint *local_280; uint *local_27c; int local_278; uint *local_274; int local_270; code **local_26c; int local_268; uint *local_264; int local_260; uint *local_25c; int local_258; code **local_254; int local_250; uint *local_24c; int local_248; undefined4 local_244; int local_240; int local_23c; int local_238; uint local_234; uint local_230; int local_22c; char *local_228; int local_224; uint *local_220; int local_21c; code **local_218; int local_214; uint *local_210; int local_20c; uint *local_208; int local_204; code **local_200; int local_1fc; uint *local_1f8; uint local_1f4; ushort *local_1f0; int *local_1ec; uint local_1e8; uint local_1e4; short *local_1e0; int local_1dc; int local_1d8; uint local_1d4; int local_1d0; uint local_1cc; int local_1c8; undefined1 *local_1c4; undefined1 *local_1c0; undefined1 *local_1bc; int local_1b8; undefined1 *local_1b4; int local_1b0; int local_1ac; int local_1a8; short *local_1a4; undefined1 *local_1a0; int local_19c; undefined1 *local_198; int local_194; int local_190; int local_18c; int local_188; uint local_184; uint local_180; undefined1 *local_17c; short *local_178; uint local_174; ushort *local_170; int *local_16c; uint local_168; uint local_164; uint local_160; undefined1 *local_15c; uint *local_158; int local_154; code **local_150; uint local_14c; int local_148; int local_144; undefined1 *local_140; int *local_13c; uint local_138; int local_134; char *local_130; char *local_12c; char *local_128; char *local_124; short *local_120; uint local_11c; uint local_118; int local_114; ushort *local_110; uint local_10c; uint local_108; uint local_104; uint local_100; short *local_fc; int local_f8; uint local_f4; uint local_f0; uint local_ec; int *local_e8; uint local_e4; uint *local_e0; int local_dc; uint *local_d8; int local_d4; uint local_d0; int local_cc; int local_c8; uint *local_c4; int local_c0; uint *local_bc; char *local_b8; char *local_b4; int local_b0; int *local_ac; char *local_a8; char *local_a4; int *local_a0; short *local_9c; uint local_98; char *local_94; undefined1 local_90 [4]; short *local_8c; undefined1 *local_88; int local_84; short *local_80; uint *local_7c; int *local_78; uint local_74; uint local_70; uint local_6c; int local_68; undefined1 local_62; undefined1 local_61; uint local_60; int *local_5c; undefined1 *local_58; uint local_54; uint local_50; uint local_4c; uint local_48; code **local_44; uint *local_40; int local_3c; short *local_38; int *local_34; code *local_30; code *local_2c; short *local_28; undefined1 local_22; char local_21; undefined1 *local_20; char local_19; short *local_18; short *local_14; char local_d; uint *local_c; char local_5; local_27c = local_5c4; local_140 = (undefined1 *)(param_1 + -0xf0); for (local_144 = 0xf0; local_144 != 0; local_144 = local_144 + -1) { *(undefined1 *)local_27c = *local_140; local_27c = (uint *)((int)local_27c + 1); local_140 = local_140 + 1; } local_c = local_5c4; local_14c = local_5c4[0]; local_e0 = local_5c4; for (local_148 = 0x3b; local_e0 = local_e0 + 1, local_148 != 0; local_148 = local_148 + -1) { local_390 = *local_e0; *local_e0 = *local_e0 ^ local_14c; local_14c = local_390; } local_330 = local_14c; if (local_c[1] != 0xc0dec0df) { LAB_00d0030a: local_210 = local_5c4; for (local_214 = 0xf0; local_214 != 0; local_214 = local_214 + -1) { *(undefined1 *)local_210 = 0; local_210 = (uint *)((int)local_210 + 1); } local_218 = &local_47c; for (local_21c = 0xe8; local_21c != 0; local_21c = local_21c + -1) { *(undefined1 *)local_218 = 0; local_218 = (code **)((int)local_218 + 1); } local_220 = local_844; for (local_224 = 0x280; local_224 != 0; local_224 = local_224 + -1) { *(undefined1 *)local_220 = 0; local_220 = (uint *)((int)local_220 + 1); } pcVar3 = (code *)swi(3); iVar4 = (*pcVar3)(); return iVar4; } local_b0 = param_1 - local_c[4]; local_2a0 = param_1 - local_c[6]; local_150 = &local_47c; for (local_154 = 0xe8; local_154 != 0; local_154 = local_154 + -1) { *(undefined1 *)local_150 = 0; local_150 = (code **)((int)local_150 + 1); } local_d0 = local_c[0xb] + 0xf & 0xfffffff0; if ((local_d0 == 0) || (0x280 < local_d0)) goto LAB_00d0030a; local_394 = (undefined1 *)(local_2a0 + local_c[10]); local_158 = local_844; local_15c = local_394; for (local_160 = local_d0; local_160 != 0; local_160 = local_160 - 1) { *(undefined1 *)local_158 = *local_15c; local_158 = (uint *)((int)local_158 + 1); local_15c = local_15c + 1; } local_310 = local_330; local_bc = local_844; for (local_164 = local_d0 >> 2; local_164 != 0; local_164 = local_164 - 1) { local_334 = *local_bc; *local_bc = *local_bc ^ local_310; local_bc = local_bc + 1; local_310 = local_334; } local_40 = local_844; for (local_e4 = 0; local_e4 < 0x22; local_e4 = local_e4 + 1) { if ((uint *)((int)local_844 + local_c[0xb]) <= local_40) goto LAB_00d0030a; apcStack_41c[local_e4] = (char *)local_40; while ((char)*local_40 != '\0') { local_40 = (uint *)((int)local_40 + 1); if ((uint *)((int)local_844 + local_c[0xb]) <= local_40) goto LAB_00d0030a; } local_40 = (uint *)((int)local_40 + 1); } if (local_40 != (uint *)((int)local_844 + local_c[0xb])) goto LAB_00d0030a; local_18 = (short *)0x0; local_32c = 0x6b; uStack_32a = 0x65; uStack_328 = 0x72; uStack_326 = 0x6e; uStack_324 = 0x65; uStack_322 = 0x6c; uStack_320 = 0x33; uStack_31e = 0x32; uStack_31c = 0x2e; uStack_31a = 100; uStack_318 = 0x6c; uStack_316 = 0x6c; uStack_314 = 0; local_280 = local_c; if (local_c[0x32] == 0 && local_c[0x33] == 0) { local_284 = local_c; if (local_c[0x34] == 0 && local_c[0x35] == 0) { local_288 = local_c; if (local_c[0x36] == 0 && local_c[0x37] == 0) { local_28c = local_c; if (local_c[0x38] != 0 || local_c[0x39] != 0) { local_424 = *(code **)(local_b0 + local_c[0x38]); local_18 = (short *)(*local_424)(&local_32c); } } else { local_428 = *(code **)(local_b0 + local_c[0x36]); local_18 = (short *)(*local_428)(apcStack_41c[0x14]); } } else { local_42c = *(code **)(local_b0 + local_c[0x34]); local_18 = (short *)(*local_42c)(&local_32c); } } else { local_430 = *(code **)(local_b0 + local_c[0x32]); local_18 = (short *)(*local_430)(apcStack_41c[0x14]); } if (local_18 == (short *)0x0) goto LAB_00d0030a; local_290 = local_c; if (local_c[0x3a] == 0 && local_c[0x3b] == 0) { local_294 = local_18; if (*local_18 == 0x5a4d) { local_e8 = (int *)((int)local_18 + *(int *)(local_18 + 0x1e)); if (*local_e8 == 0x4550) { if ((short)local_e8[1] == 0x14c) { if ((short)local_e8[5] == 0xe0) { local_c4 = (uint *)(local_e8 + 0x1e); if (local_e8[0x1f] == 0) { local_30 = (code *)0x0; } else { local_68 = (int)local_18 + *local_c4; if ((*(int *)(local_68 + 0x18) == 0) || (*(int *)(local_68 + 0x14) == 0)) { local_30 = (code *)0x0; } else { local_16c = (int *)((int)local_18 + *(int *)(local_68 + 0x20)); local_170 = (ushort *)((int)local_18 + *(int *)(local_68 + 0x24)); local_ec = 0xffffffff; for (local_168 = 0; local_168 < *(uint *)(local_68 + 0x18); local_168 = local_168 + 1) { local_94 = apcStack_41c[0x17]; for (local_b8 = (char *)((int)local_18 + *local_16c); (*local_94 != '\0' && (*local_b8 != '\0')); local_b8 = local_b8 + 1) { if (*local_94 < *local_b8) { local_c0 = -1; goto LAB_00cfebe2; } if (*local_b8 < *local_94) { local_c0 = 1; goto LAB_00cfebe2; } local_94 = local_94 + 1; } if (*local_b8 == '\0') { if (*local_94 == '\0') { local_c0 = 0; } else { local_c0 = 1; } } else { local_c0 = -1; } LAB_00cfebe2: if (local_c0 == 0) { local_ec = (uint)*local_170; break; } local_16c = local_16c + 1; local_170 = local_170 + 1; } if (local_ec == 0xffffffff) { local_30 = (code *)0x0; } else if (*(uint *)(local_68 + 0x14) < local_ec) { local_30 = (code *)0x0; } else { local_174 = *(uint *)((int)local_18 + *(int *)(local_68 + 0x1c) + local_ec * 4); if ((local_174 < *local_c4) || (*local_c4 + local_e8[0x1f] <= local_174)) { local_30 = (code *)((int)local_18 + local_174); } else { local_30 = (code *)0x0; } } } } } else { local_30 = (code *)0x0; } } else { local_30 = (code *)0x0; } } else { local_30 = (code *)0x0; } } else { local_30 = (code *)0x0; } local_420 = local_30; if (local_30 == (code *)0x0) goto LAB_00d0030a; } else { local_420 = *(code **)(local_b0 + local_c[0x3a]); } local_298 = local_c; if (((local_c[0x32] == 0 && local_c[0x33] == 0) && (local_430 = (code *)(*local_420)(local_18,apcStack_41c[0x18]), local_430 == (code *)0x0)) || (local_428 = (code *)(*local_420)(local_18,apcStack_41c[0x19]), local_428 == (code *)0x0)) goto LAB_00d0030a; local_29c = (*local_428)(apcStack_41c[0x15]); if (local_29c == 0) goto LAB_00d0030a; local_44 = &local_47c; for (local_f0 = 0; local_f0 < 3; local_f0 = local_f0 + 1) { pcVar3 = (code *)(*local_420)(local_29c,apcStack_41c[local_f0]); *local_44 = pcVar3; if (*local_44 == (code *)0x0) goto LAB_00d0030a; local_44 = local_44 + 1; } local_44 = &local_470; for (local_f4 = 0; local_f4 < 0x10; local_f4 = local_f4 + 1) { pcVar3 = (code *)(*local_420)(local_18,apcStack_41c[local_f4 + 3]); *local_44 = pcVar3; if (*local_44 == (code *)0x0) goto LAB_00d0030a; local_44 = local_44 + 1; } if ((local_c[0xf] & 0x20) == 0) { local_c8 = FUN_00cfe380(); if (((local_c8 == 0) || (*(int *)(local_c8 + 0x18) != local_c8)) || ((*(int *)(local_c8 + 0x30) == 0 || (*(char *)(*(int *)(local_c8 + 0x30) + 2) != '\0')))) { local_21 = '\x01'; } else { local_21 = '\0'; } if (local_21 != '\0') { local_5 = 'T'; goto LAB_00d003e5; } } if ((local_c[0x2a] & 1) != 0) { local_cc = param_2 + 0x24; local_338 = *(int *)(param_2 + 0x28); if (local_338 != 1) goto LAB_00d00215; } local_38 = (short *)(*local_47c)(1,local_c[0xd]); if (local_38 == (short *)0x0) { local_5 = 'W'; goto LAB_00d003e5; } local_33c = (undefined1 *)(local_2a0 + local_c[0xc]); local_17c = local_33c; local_178 = local_38; for (local_180 = local_c[0xd]; local_180 != 0; local_180 = local_180 - 1) { *(undefined1 *)local_178 = *local_17c; local_178 = (short *)((int)local_178 + 1); local_17c = local_17c + 1; } local_340 = local_c[0xd]; local_2a4 = local_c + 0x26; local_344 = local_340 >> 3; local_2a8 = 0x55555555; local_2ac = 0x55555555; for (local_118 = 0; local_118 < local_344; local_118 = local_118 + 1) { local_f8 = local_118 << 1; local_348 = *(uint *)(local_38 + local_118 * 4); local_34c = *(uint *)(local_38 + local_118 * 4 + 2); local_98 = 0xc6ef3720; local_70 = local_34c; local_6c = local_348; for (local_184 = 0; local_184 < 0x20; local_184 = local_184 + 1) { local_70 = local_70 - ((local_6c << 4 ^ local_6c >> 5) + local_6c ^ local_98 + local_2a4[local_98 >> 0xb & 3]); local_98 = local_98 + 0x61c88647; local_6c = local_6c - ((local_70 * 0x10 ^ local_70 >> 5) + local_70 ^ local_98 + local_2a4[local_98 & 3]) ; } *(uint *)(local_38 + local_118 * 4) = local_6c ^ local_2a8; *(uint *)(local_38 + local_118 * 4 + 2) = local_70 ^ local_2ac; local_2ac = local_34c; local_2a8 = local_348; } local_360 = local_c[0x11]; local_fc = local_38; local_c[0x11] = 0; local_48 = 0; local_350 = local_844; for (local_100 = 0; local_100 < local_d0; local_100 = local_100 + 1) { local_48 = (uint)*(byte *)((int)local_350 + local_100) << 0x18 ^ local_48; for (local_188 = 8; 0 < local_188; local_188 = local_188 + -1) { if ((local_48 & 0x80000000) == 0) { local_48 = local_48 << 1; } else { local_48 = local_48 << 1 ^ 0x488781ed; } } } local_4c = local_48; local_354 = local_5c4; for (local_104 = 0; local_104 < 0xf0; local_104 = local_104 + 1) { local_4c = (uint)*(byte *)((int)local_354 + local_104) << 0x18 ^ local_4c; for (local_18c = 8; 0 < local_18c; local_18c = local_18c + -1) { if ((local_4c & 0x80000000) == 0) { local_4c = local_4c << 1; } else { local_4c = local_4c << 1 ^ 0x488781ed; } } } local_50 = local_4c; local_358 = param_1; for (local_108 = 0; local_108 < (local_c[7] + 0xf & 0xfffffff0); local_108 = local_108 + 1) { local_50 = (uint)*(byte *)(param_1 + local_108) << 0x18 ^ local_50; for (local_190 = 8; 0 < local_190; local_190 = local_190 + -1) { if ((local_50 & 0x80000000) == 0) { local_50 = local_50 << 1; } else { local_50 = local_50 << 1 ^ 0x488781ed; } } } local_54 = local_50; local_35c = local_38; for (local_10c = 0; local_10c < local_c[0xd]; local_10c = local_10c + 1) { local_54 = (uint)*(byte *)((int)local_38 + local_10c) << 0x18 ^ local_54; for (local_194 = 8; 0 < local_194; local_194 = local_194 + -1) { if ((local_54 & 0x80000000) == 0) { local_54 = local_54 << 1; } else { local_54 = local_54 << 1 ^ 0x488781ed; } } } local_74 = local_54; local_c[0x11] = local_360; if (local_74 != local_c[0x11]) { local_5 = 'Q'; goto LAB_00d003e5; } local_2b0 = local_c[0xd]; local_9c = local_38; if ((local_2b0 < 0x40) || (*local_38 != 0x5a4d)) { local_14 = (short *)0x0; } else { local_5c = (int *)((int)local_38 + *(int *)(local_38 + 0x1e)); if ((local_2b0 < *(int *)(local_38 + 0x1e) + 0xf8U) || (*local_5c != 0x4550)) { local_14 = (short *)0x0; } else { local_28 = (short *)(*local_448)(local_5c[0xd],local_5c[0x14],0x2000,4); if (local_28 == (short *)0x0) { local_28 = (short *)(*local_448)(0,local_5c[0x14],0x2000,4); } if (local_28 == (short *)0x0) { local_14 = (short *)0x0; } else { local_198 = local_90; for (local_19c = 0xc; local_19c != 0; local_19c = local_19c + -1) { *local_198 = 0; local_198 = local_198 + 1; } local_8c = local_28; local_2b4 = (undefined1 *)(*local_448)(local_28,local_5c[0x14],0x1000,4); local_1a4 = local_9c; local_364 = *(int *)(local_9c + 0x1e) + local_5c[0x15]; local_1a0 = local_2b4; for (local_1a8 = local_364; local_1a8 != 0; local_1a8 = local_1a8 + -1) { *local_1a0 = (char)*local_1a4; local_1a0 = local_1a0 + 1; local_1a4 = (short *)((int)local_1a4 + 1); } local_88 = local_2b4 + *(int *)(local_9c + 0x1e); *(short **)(local_88 + 0x34) = local_28; local_2b8 = local_8c; local_58 = local_88 + *(ushort *)(local_88 + 0x14) + 0x18; for (local_1ac = 0; local_1ac < (int)(uint)*(ushort *)(local_88 + 6); local_1ac = local_1ac + 1) { if (*(int *)(local_58 + 0x10) == 0) { local_1b0 = local_5c[0xe]; if (local_1b0 != 0) { local_1bc = (undefined1 *) (*local_448)((int)local_2b8 + *(int *)(local_58 + 0xc),local_1b0,0x1000,4) ; local_1b4 = local_1bc; for (local_1b8 = local_1b0; local_1b8 != 0; local_1b8 = local_1b8 + -1) { *local_1b4 = 0; local_1b4 = local_1b4 + 1; } } } else { local_1bc = (undefined1 *) (*local_448)((int)local_2b8 + *(int *)(local_58 + 0xc), *(undefined4 *)(local_58 + 0x10),0x1000,4); local_368 = (undefined1 *)((int)local_38 + *(int *)(local_58 + 0x14)); local_1c4 = local_368; local_1c0 = local_1bc; for (local_1c8 = *(int *)(local_58 + 0x10); local_1c8 != 0; local_1c8 = local_1c8 + -1) { *local_1c0 = *local_1c4; local_1c0 = local_1c0 + 1; local_1c4 = local_1c4 + 1; } } local_58 = local_58 + 0x28; } local_1d4 = (int)local_28 - local_5c[0xd]; if (local_1d4 != 0) { local_2c0 = local_8c; local_2bc = (int *)(local_88 + 0xa0); if (*(int *)(local_88 + 0xa4) != 0) { for (local_78 = (int *)((int)local_8c + *local_2bc); *local_78 != 0; local_78 = (int *)((int)local_78 + local_78[1])) { local_2c8 = (int)local_8c + *local_78; local_110 = (ushort *)(local_78 + 2); for (local_1cc = 0; local_1cc < local_78[1] - 8U >> 1; local_1cc = local_1cc + 1) { local_36c = (int)(uint)*local_110 >> 0xc; local_2cc = *local_110 & 0xfff; local_1d0 = local_36c; if (local_36c != 0) { if (local_36c == 3) { local_2c4 = (int *)(local_2c8 + local_2cc); *local_2c4 = *local_2c4 + local_1d4; } else { if (local_36c != 10) { pcVar3 = (code *)swi(3); iVar4 = (*pcVar3)(); return iVar4; } local_2d0 = (uint *)(local_2c8 + local_2cc); uVar6 = *local_2d0; *local_2d0 = local_1d4 + *local_2d0; local_2d0[1] = ((int)local_1d4 >> 0x1f) + local_2d0[1] + (uint)CARRY4(local_1d4,uVar6); } } local_110 = local_110 + 1; } } } } local_80 = local_8c; local_2d4 = (int *)(local_88 + 0x80); if (*(int *)(local_88 + 0x84) != 0) { local_34 = (int *)((int)local_8c + *local_2d4); while ((iVar4 = (*local_43c)(local_34,0x14), iVar4 == 0 && (local_34[3] != 0))) { local_370 = (int)local_80 + local_34[3]; local_1d8 = (*local_428)(local_370); if (local_1d8 == 0) { local_19 = '\0'; goto LAB_00cffa9a; } if (*local_34 == 0) { iVar4 = local_34[4]; iVar2 = local_34[4]; } else { iVar4 = *local_34; iVar2 = local_34[4]; } local_a0 = (int *)((int)local_80 + iVar2); for (local_7c = (uint *)((int)local_80 + iVar4); *local_7c != 0; local_7c = local_7c + 1 ) { if ((*local_7c & 0x80000000) == 0) { local_374 = (int)local_80 + *local_7c; iVar4 = (*local_420)(local_1d8,local_374 + 2); *local_a0 = iVar4; } else { iVar4 = (*local_420)(local_1d8,*local_7c & 0xffff); *local_a0 = iVar4; } if (*local_a0 == 0) { local_19 = '\0'; goto LAB_00cffa9a; } local_a0 = local_a0 + 1; } local_34 = local_34 + 5; } } local_19 = '\x01'; LAB_00cffa9a: if (local_19 == '\0') { local_14 = (short *)0x0; } else { local_20 = local_88 + *(ushort *)(local_88 + 0x14) + 0x18; for (local_1dc = 0; local_1dc < (int)(uint)*(ushort *)(local_88 + 6); local_1dc = local_1dc + 1) { local_62 = (*(uint *)(local_20 + 0x24) & 0x20000000) != 0; local_2d8 = (uint)(byte)local_62; local_61 = (*(uint *)(local_20 + 0x24) & 0x40000000) != 0; local_2dc = (uint)(byte)local_61; local_22 = (*(uint *)(local_20 + 0x24) & 0x80000000) != 0; local_2e0 = (uint)(byte)local_22; if ((*(uint *)(local_20 + 0x24) & 0x2000000) == 0) { if ((bool)local_61) { if ((bool)local_22) { local_60 = 4; } else { local_60 = 2; } } else if ((bool)local_22) { local_60 = 8; } else { local_60 = 1; } if ((bool)local_62) { local_60 = local_60 << 4; } if ((*(uint *)(local_20 + 0x24) & 0x4000000) != 0) { local_60 = local_60 | 0x200; } local_114 = *(int *)(local_20 + 0x10); if (local_114 == 0) { if ((*(uint *)(local_20 + 0x24) & 0x40) == 0) { if ((*(uint *)(local_20 + 0x24) & 0x80) != 0) { local_114 = *(int *)(local_88 + 0x24); } } else { local_114 = *(int *)(local_88 + 0x20); } } if (local_114 != 0) { (*local_440)((int)local_8c + *(int *)(local_20 + 0xc), *(undefined4 *)(local_20 + 0x10),local_60,local_480); } } else { (*local_444)((int)local_8c + *(int *)(local_20 + 0xc),*(undefined4 *)(local_20 + 0x10) ,0x4000); } local_20 = local_20 + 0x28; } if (*(int *)(local_88 + 0x28) == 0) { LAB_00cffcf2: local_14 = local_28; } else { local_2e4 = (code *)((int)local_28 + *(int *)(local_88 + 0x28)); if (local_2e4 == (code *)0x0) { local_14 = (short *)0x0; } else { local_378 = (*local_2e4)(local_28,1,0); if (local_378 != 0) { local_90[0] = 1; goto LAB_00cffcf2; } local_14 = (short *)0x0; } } } } } } local_1e4 = local_c[0xd]; local_1e0 = local_38; for (; local_1e4 != 0; local_1e4 = local_1e4 - 1) { *(undefined1 *)local_1e0 = 0; local_1e0 = (short *)((int)local_1e0 + 1); } (*local_478)(local_38); if (local_14 == (short *)0x0) { local_5 = 'B'; } else { local_2e8 = local_14; if (*local_14 == 0x5a4d) { local_13c = (int *)((int)local_14 + *(int *)(local_14 + 0x1e)); if (*local_13c == 0x4550) { if ((short)local_13c[1] == 0x14c) { if ((short)local_13c[5] == 0xe0) { local_d8 = (uint *)(local_13c + 0x1e); if (local_13c[0x1f] == 0) { local_2c = (code *)0x0; } else { local_84 = (int)local_14 + *local_d8; if ((*(int *)(local_84 + 0x18) == 0) || (*(int *)(local_84 + 0x14) == 0)) { local_2c = (code *)0x0; } else { local_1ec = (int *)((int)local_14 + *(int *)(local_84 + 0x20)); local_1f0 = (ushort *)((int)local_14 + *(int *)(local_84 + 0x24)); local_11c = 0xffffffff; for (local_1e8 = 0; local_1e8 < *(uint *)(local_84 + 0x18); local_1e8 = local_1e8 + 1) { local_a8 = apcStack_41c[0x21]; for (local_a4 = (char *)((int)local_14 + *local_1ec); (*local_a8 != '\0' && (*local_a4 != '\0')); local_a4 = local_a4 + 1) { if (*local_a8 < *local_a4) { local_d4 = -1; goto LAB_00cfff9e; } if (*local_a4 < *local_a8) { local_d4 = 1; goto LAB_00cfff9e; } local_a8 = local_a8 + 1; } if (*local_a4 == '\0') { if (*local_a8 == '\0') { local_d4 = 0; } else { local_d4 = 1; } } else { local_d4 = -1; } LAB_00cfff9e: if (local_d4 == 0) { local_11c = (uint)*local_1f0; break; } local_1ec = local_1ec + 1; local_1f0 = local_1f0 + 1; } if (local_11c == 0xffffffff) { local_2c = (code *)0x0; } else if (*(uint *)(local_84 + 0x14) < local_11c) { local_2c = (code *)0x0; } else { local_1f4 = *(uint *)((int)local_14 + *(int *)(local_84 + 0x1c) + local_11c * 4); if ((local_1f4 < *local_d8) || (*local_d8 + local_13c[0x1f] <= local_1f4)) { local_2c = (code *)((int)local_14 + local_1f4); } else { local_2c = (code *)0x0; } } } } } else { local_2c = (code *)0x0; } } else { local_2c = (code *)0x0; } } else { local_2c = (code *)0x0; } } else { local_2c = (code *)0x0; } local_2ec = local_2c; if (local_2c == (code *)0x0) { local_5 = 'C'; } else { local_5 = (*local_2c)(param_1,local_c,0xf0); if (local_5 == '0') { local_2f0 = local_14; if ((((*local_14 == 0x5a4d) && (local_ac = (int *)((int)local_14 + *(int *)(local_14 + 0x1e)), *local_ac == 0x4550)) && ((short)local_ac[1] == 0x14c)) && ((short)local_ac[5] == 0xe0)) { local_120 = local_14; if (local_ac[10] != 0) { local_2f4 = (code *)((int)local_14 + local_ac[10]); if (local_2f4 == (code *)0x0) goto LAB_00d00215; (*local_2f4)(local_14,0,0); } local_2f8 = local_ac + 0x20; if (local_ac[0x21] != 0) { local_dc = (int)local_120 + *local_2f8; while ((iVar4 = (*local_43c)(local_dc,0x14), iVar4 == 0 && (*(int *)(local_dc + 0xc) != 0))) { local_37c = (int)local_120 + *(int *)(local_dc + 0xc); local_2fc = (*local_430)(local_37c); if (local_2fc != 0) { (*local_434)(local_2fc); } local_dc = local_dc + 0x14; } } (*local_444)(local_14,0,0x8000); } LAB_00d00215: local_384 = local_c[8] + local_b0; local_1f8 = local_5c4; for (local_1fc = 0xf0; local_1fc != 0; local_1fc = local_1fc + -1) { *(undefined1 *)local_1f8 = 0; local_1f8 = (uint *)((int)local_1f8 + 1); } local_200 = &local_47c; for (local_204 = 0xe8; local_204 != 0; local_204 = local_204 + -1) { *(undefined1 *)local_200 = 0; local_200 = (code **)((int)local_200 + 1); } local_208 = local_844; for (local_20c = 0x280; local_20c != 0; local_20c = local_20c + -1) { *(undefined1 *)local_208 = 0; local_208 = (uint *)((int)local_208 + 1); } return local_384; } } } LAB_00d003e5: local_38c = local_470; local_230 = (*local_46c)(); if (((local_5 != '5') && (local_5 != '0')) && (local_5 != 'E')) { local_128 = local_4d4; for (local_124 = apcStack_41c[0x1d]; *local_124 != '\0'; local_124 = local_124 + 1) { *local_128 = *local_124; local_128 = local_128 + 1; } *local_128 = '\0'; local_130 = local_4b4; for (local_12c = apcStack_41c[0x1e]; *local_12c != '\0'; local_12c = local_12c + 1) { *local_130 = *local_12c; local_130 = local_130 + 1; } *local_130 = '\0'; local_230 = local_230 + 0xff98; local_22c = 0; for (local_228 = local_4b4; *local_228 != '\0'; local_228 = local_228 + 1) { local_22c = local_22c + 1; } pcVar5 = local_4b4 + local_22c; do { local_b4 = pcVar5; pcVar5 = local_b4 + -1; if (pcVar5 <= local_4b4) goto LAB_00d00645; } while (*pcVar5 != ':'); pcVar1 = local_b4 + -2; local_b4 = pcVar5; *pcVar1 = local_5; local_388 = local_b4 + 1; local_234 = local_230; local_138 = 1000000000; for (local_134 = 0; pcVar5 = local_b4, local_134 < 10; local_134 = local_134 + 1) { uVar6 = local_234 / local_138; local_300._0_1_ = (char)uVar6; local_388[local_134] = (char)local_300 + '0'; local_234 = local_234 - uVar6 * local_138; local_138 = local_138 / 10; local_300 = uVar6; } LAB_00d00645: local_b4 = pcVar5; local_304 = local_c; if (local_c[5] == 0) { local_240 = (*local_468)(0x100000,0,apcStack_41c[0x1c]); local_23c = (*local_464)(2,0,apcStack_41c[0x1b]); if ((local_240 == 0) || (local_23c == 0)) { local_d = '5'; } else { local_248 = (*local_45c)(local_240,5000); if (local_248 == 0) { local_238 = (*local_460)(local_23c,2,0,0,0); if (local_238 == 0) { local_d = 'H'; } else { local_3c = local_238; if (*(int *)(local_238 + 0x90) == 2) { if (*(int *)(local_238 + 0x94) == 0) { local_244 = (*local_458)(0,0,0,0); uVar7 = (*local_44c)(); *(undefined4 *)(local_3c + 0x98) = uVar7; *(uint *)(local_3c + 0xa0) = local_c[0xe]; *(uint *)(local_3c + 0xa4) = local_c[0x11]; *(uint *)(local_3c + 0xac) = local_c[4] - 0xf0; *(int *)(local_3c + 0xa8) = (int)local_5; *(undefined4 *)(local_3c + 0x9c) = local_244; *(undefined4 *)(local_3c + 0x94) = 2; local_248 = (*local_45c)(local_244,5000); (*local_454)(local_238); (*local_450)(local_23c); (*local_450)(local_240); (*local_450)(local_244); if (local_248 == 0) { local_d = '0'; } else { local_d = 'L'; } } else { local_d = 'J'; } } else { local_d = 'I'; } } } else { local_d = 'G'; } } } else { local_d = '5'; } if (((local_d != '0') && ((local_c[0xf] & 0x40) == 0)) && (local_308 = (*local_428)(apcStack_41c[0x16]), local_308 != 0)) { local_30c = (code *)(*local_420)(local_308,apcStack_41c[0x1a]); local_24c = local_5c4; for (local_250 = 0xf0; local_250 != 0; local_250 = local_250 + -1) { *(undefined1 *)local_24c = 0; local_24c = (uint *)((int)local_24c + 1); } local_254 = &local_47c; for (local_258 = 0xe8; local_258 != 0; local_258 = local_258 + -1) { *(undefined1 *)local_254 = 0; local_254 = (code **)((int)local_254 + 1); } local_25c = local_844; for (local_260 = 0x280; local_260 != 0; local_260 = local_260 + -1) { *(undefined1 *)local_25c = 0; local_25c = (uint *)((int)local_25c + 1); } if (local_30c != (code *)0x0) { (*local_30c)(0,local_4b4,local_4d4,0x10); } } } local_264 = local_5c4; for (local_268 = 0xf0; local_268 != 0; local_268 = local_268 + -1) { *(undefined1 *)local_264 = 0; local_264 = (uint *)((int)local_264 + 1); } local_26c = &local_47c; for (local_270 = 0xe8; local_270 != 0; local_270 = local_270 + -1) { *(undefined1 *)local_26c = 0; local_26c = (code **)((int)local_26c + 1); } local_274 = local_844; for (local_278 = 0x280; local_278 != 0; local_278 = local_278 + -1) { *(undefined1 *)local_274 = 0; local_274 = (uint *)((int)local_274 + 1); } (*local_38c)(0xffffffff,(int)local_5); return 0; } //@@ 00d22300 FUN_00d22300 /* WARNING: Control flow encountered bad instruction data */ void FUN_00d22300(void) { byte *in_EAX; byte in_CH; *in_EAX = *in_EAX & in_CH; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00d22370 FUN_00d22370 void FUN_00d22370(void) { return; } //@@ 00d22ba0 FUN_00d22ba0 undefined4 FUN_00d22ba0(void) { byte *pbVar1; ushort *puVar2; short sVar3; uint uVar4; int extraout_ECX; int unaff_EBX; int unaff_EBP; byte bVar5; bool bVar6; pbVar1 = (byte *)(unaff_EBX + 0x2758a3b7); *pbVar1 = *pbVar1 >> 3 | *pbVar1 << 5; bVar5 = (char)*pbVar1 < '\0'; uVar4 = func_0xa8620e87(); bVar6 = uVar4 < 0xc9986f69 || uVar4 + 0x36679097 < (uint)bVar5; *(int *)(unaff_EBP + -0x10) = (*(int *)(unaff_EBP + -0x10) - extraout_ECX) - (uint)bVar6; puVar2 = (ushort *)(unaff_EBX + 0x412684ac); sVar3 = ((ushort)unaff_EBP & 3) - (*puVar2 & 3); *puVar2 = *puVar2 + (ushort)(0 < sVar3) * sVar3; return CONCAT22((short)((uVar4 + 0x36679097) - (uint)bVar5 >> 0x10),CONCAT11(0xc6,-bVar6)); } //@@ 00d24410 FUN_00d24410 /* WARNING: Control flow encountered bad instruction data */ void FUN_00d24410(void) { char cVar1; undefined4 in_EAX; undefined2 in_DX; undefined4 *puVar2; undefined4 *unaff_EBP; undefined4 *unaff_ESI; undefined4 *unaff_EDI; undefined4 uStack_8; puVar2 = (undefined4 *)((int)register0x00000010 + -4); cVar1 = '\x11'; do { unaff_EBP = unaff_EBP + -1; puVar2 = puVar2 + -1; *puVar2 = *unaff_EBP; cVar1 = cVar1 + -1; } while ('\0' < cVar1); out(2,in_EAX); *unaff_EDI = *unaff_ESI; out(*(undefined1 *)(unaff_ESI + 1),in_DX); /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } //@@ 00d24600 FUN_00d24600 void FUN_00d24600(void) { char *pcVar1; byte bVar2; undefined4 uVar3; byte *pbVar4; byte bVar5; byte bVar6; code *pcVar7; byte bVar8; int in_ECX; byte *in_EDX; char unaff_BH; int unaff_ESI; int unaff_EDI; undefined2 in_DS; uVar3 = **(undefined4 **)(unaff_ESI + 0x6b); pbVar4 = (byte *)(unaff_EDI + 1); bVar5 = *in_EDX; *in_EDX = (char)*in_EDX >> 1; bVar2 = *pbVar4; bVar8 = (byte)((uint)uVar3 >> 8); bVar6 = *pbVar4 - bVar8; *pbVar4 = bVar6 - (bVar5 & 1); *(undefined2 *)(in_ECX + -0x211712b3) = in_DS; pcVar1 = (char *)(CONCAT31((int3)((uint)uVar3 >> 8), (char)uVar3 + '^' + (bVar2 < bVar8 || bVar6 < (bVar5 & 1))) * 2 + -0x2fa54889); *pcVar1 = *pcVar1 + unaff_BH; pcVar7 = (code *)swi(1); (*pcVar7)(); return; } //@@ 00d24cc0 FUN_00d24cc0 /* WARNING: Control flow encountered bad instruction data */ void FUN_00d24cc0(void) { uint *puVar1; char cVar2; byte bVar3; char cVar4; code *pcVar5; byte bVar6; undefined4 in_EAX; int in_ECX; int in_EDX; int unaff_EBX; undefined4 *puVar7; undefined4 *unaff_EBP; short *unaff_ESI; undefined2 *unaff_EDI; bool in_CF; char in_PF; byte in_AF; char in_ZF; char in_SF; undefined2 in_FPUControlWord; float10 in_ST0; undefined1 uStack00000000; undefined4 uStack_8; bVar6 = (byte)in_EAX; if (!in_CF) { bVar3 = 9 < (bVar6 & 0xf) | in_AF; cVar2 = *(char *)(unaff_EBX + -0xfc49edd + (in_ECX + -1) * 8); puVar7 = (undefined4 *)((int)register0x00000010 + -4); cVar4 = '\x01'; do { unaff_EBP = unaff_EBP + -1; puVar7 = puVar7 + -1; *puVar7 = *unaff_EBP; cVar4 = cVar4 + -1; } while ('\0' < cVar4); DAT_0ea3166e = bVar6 + bVar3 * '\x06' & 0xf; out(*(undefined1 *)(((int)unaff_ESI + -1) * -0x3121e7d7), (short)CONCAT31((int3)((uint)in_EDX >> 8),((char)in_EDX - cVar2) - bVar3)); /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); } *unaff_EDI = in_FPUControlWord; puVar1 = (uint *)(CONCAT22((short)((uint)in_EAX >> 0x10), CONCAT11(in_SF << 7 | in_ZF << 6 | in_AF << 4 | in_PF << 2 | 2 | in_CF, bVar6)) + -0x24495e49); *puVar1 = *puVar1 | (uint)&uStack00000000; if (in_ECX == 1) { pcVar5 = (code *)swi(1); (*pcVar5)(); return; } *unaff_ESI = (short)in_ST0; *(int *)(unaff_EDI + -0x32f96cdd) = unaff_EBX; *(char *)(in_EDX + 0x6bf5e6d1) = *(char *)(in_EDX + 0x6bf5e6d1) + (char)unaff_EBX; pcVar5 = (code *)swi(3); (*pcVar5)(); return; } //@@ 00d25270 FUN_00d25270 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void FUN_00d25270(void) { /* WARNING: Could not recover jumptable at 0x00d25275. Too many branches */ /* WARNING: Treating indirect jump as call */ (*_DAT_e76476a4)(); return; } //@@ 00d29d70 FUN_00d29d70 /* decompile failed: Low-level Error: Bad instruction count exceeded: ... Instruction at (ram,0x00d29df1) overlaps instruction at (ram,0x00d29dee) */ //@@ 00d2bae0 FUN_00d2bae0 /* WARNING: Control flow encountered bad instruction data */ void FUN_00d2bae0(void) { char cVar1; char *in_EAX; cVar1 = (char)in_EAX; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; *in_EAX = *in_EAX + cVar1; /* WARNING: Bad instruction - Truncating control flow here */ halt_baddata(); }